From 7d8e395087b961937b5a7e6fcc69972e94141b54 Mon Sep 17 00:00:00 2001 From: Myles Borins Date: Fri, 2 Oct 2020 17:52:19 -0400 Subject: [PATCH 1/2] deps: update npm to 7.0.0-rc.3 --- deps/npm/.eslintrc.json | 215 + deps/npm/.licensee.json | 8 +- deps/npm/.npmignore | 1 + deps/npm/.travis.yml | 19 - deps/npm/AUTHORS | 24 +- deps/npm/CHANGELOG.md | 3569 +- deps/npm/CONTRIBUTING.md | 4 +- deps/npm/Makefile | 10 +- deps/npm/bin/npm-cli.js | 155 +- deps/npm/bin/npm.cmd | 0 deps/npm/bin/npx | 4 + deps/npm/bin/npx-cli.js | 128 +- deps/npm/bin/npx.cmd | 0 deps/npm/changelogs/CHANGELOG-6.md | 2910 + .../docs/content/cli-commands/npm-access.md | 6 +- .../docs/content/cli-commands/npm-adduser.md | 6 +- .../docs/content/cli-commands/npm-audit.md | 2 +- deps/npm/docs/content/cli-commands/npm-bin.md | 6 +- .../npm/docs/content/cli-commands/npm-bugs.md | 17 +- .../docs/content/cli-commands/npm-build.md | 34 - .../docs/content/cli-commands/npm-bundle.md | 2 +- .../docs/content/cli-commands/npm-cache.md | 8 +- deps/npm/docs/content/cli-commands/npm-ci.md | 4 +- .../docs/content/cli-commands/npm-config.md | 2 +- .../docs/content/cli-commands/npm-dedupe.md | 8 +- .../content/cli-commands/npm-deprecate.md | 2 +- .../docs/content/cli-commands/npm-dist-tag.md | 8 +- .../npm/docs/content/cli-commands/npm-docs.md | 18 +- .../docs/content/cli-commands/npm-doctor.md | 6 +- .../npm/docs/content/cli-commands/npm-edit.md | 6 +- .../npm/docs/content/cli-commands/npm-exec.md | 179 + .../docs/content/cli-commands/npm-explain.md | 77 + .../docs/content/cli-commands/npm-explore.md | 8 +- .../npm/docs/content/cli-commands/npm-fund.md | 10 +- .../content/cli-commands/npm-help-search.md | 2 +- .../npm/docs/content/cli-commands/npm-help.md | 4 +- .../npm/docs/content/cli-commands/npm-init.md | 2 +- .../cli-commands/npm-install-ci-test.md | 4 +- .../content/cli-commands/npm-install-test.md | 4 +- .../docs/content/cli-commands/npm-install.md | 24 +- .../npm/docs/content/cli-commands/npm-link.md | 4 +- .../docs/content/cli-commands/npm-logout.md | 6 +- deps/npm/docs/content/cli-commands/npm-ls.md | 15 +- .../docs/content/cli-commands/npm-outdated.md | 33 +- .../docs/content/cli-commands/npm-owner.md | 4 +- .../npm/docs/content/cli-commands/npm-pack.md | 6 +- .../npm/docs/content/cli-commands/npm-ping.md | 2 +- .../docs/content/cli-commands/npm-prefix.md | 8 +- .../docs/content/cli-commands/npm-profile.md | 2 +- .../docs/content/cli-commands/npm-prune.md | 4 +- .../docs/content/cli-commands/npm-publish.md | 4 +- .../docs/content/cli-commands/npm-rebuild.md | 4 +- .../npm/docs/content/cli-commands/npm-repo.md | 13 +- .../docs/content/cli-commands/npm-restart.md | 10 +- .../npm/docs/content/cli-commands/npm-root.md | 6 +- .../content/cli-commands/npm-run-script.md | 10 +- .../docs/content/cli-commands/npm-search.md | 4 +- .../content/cli-commands/npm-shrinkwrap.md | 6 +- .../npm/docs/content/cli-commands/npm-star.md | 6 +- .../docs/content/cli-commands/npm-stars.md | 8 +- .../docs/content/cli-commands/npm-start.md | 10 +- .../npm/docs/content/cli-commands/npm-stop.md | 8 +- .../npm/docs/content/cli-commands/npm-team.md | 2 +- .../npm/docs/content/cli-commands/npm-test.md | 8 +- .../content/cli-commands/npm-uninstall.md | 6 +- .../content/cli-commands/npm-unpublish.md | 8 +- .../docs/content/cli-commands/npm-update.md | 8 +- .../docs/content/cli-commands/npm-version.md | 4 +- .../npm/docs/content/cli-commands/npm-view.md | 6 +- .../docs/content/cli-commands/npm-whoami.md | 4 +- deps/npm/docs/content/cli-commands/npm.md | 3 +- deps/npm/docs/content/cli-commands/npx.md | 179 + .../docs/content/configuring-npm/folders.md | 12 +- .../npm/docs/content/configuring-npm/npmrc.md | 2 +- .../content/configuring-npm/package-json.md | 28 +- .../configuring-npm/package-lock-json.md | 4 +- .../content/configuring-npm/package-locks.md | 4 +- .../configuring-npm/shrinkwrap-json.md | 6 +- deps/npm/docs/content/using-npm/config.md | 130 +- deps/npm/docs/content/using-npm/developers.md | 4 +- deps/npm/docs/content/using-npm/disputes.md | 2 +- deps/npm/docs/content/using-npm/orgs.md | 8 +- deps/npm/docs/content/using-npm/registry.md | 4 +- deps/npm/docs/content/using-npm/removal.md | 4 +- deps/npm/docs/content/using-npm/scope.md | 8 +- deps/npm/docs/content/using-npm/scripts.md | 12 +- deps/npm/docs/content/using-npm/semver.md | 6 - deps/npm/docs/package-lock.json | 44555 +++++++++++++--- .../public/cli-commands/npm-access/index.html | 20 +- .../cli-commands/npm-adduser/index.html | 20 +- .../public/cli-commands/npm-audit/index.html | 16 +- .../public/cli-commands/npm-bin/index.html | 20 +- .../public/cli-commands/npm-bugs/index.html | 29 +- .../public/cli-commands/npm-build/index.html | 103 - .../public/cli-commands/npm-bundle/index.html | 16 +- .../public/cli-commands/npm-cache/index.html | 22 +- .../public/cli-commands/npm-ci/index.html | 18 +- .../cli-commands/npm-completion/index.html | 14 +- .../public/cli-commands/npm-config/index.html | 16 +- .../public/cli-commands/npm-dedupe/index.html | 21 +- .../cli-commands/npm-deprecate/index.html | 16 +- .../cli-commands/npm-dist-tag/index.html | 22 +- .../public/cli-commands/npm-docs/index.html | 30 +- .../public/cli-commands/npm-doctor/index.html | 20 +- .../public/cli-commands/npm-edit/index.html | 20 +- .../public/cli-commands/npm-exec/index.html | 209 + .../cli-commands/npm-explain/index.html | 138 + .../cli-commands/npm-explore/index.html | 22 +- .../public/cli-commands/npm-fund/index.html | 24 +- .../cli-commands/npm-help-search/index.html | 16 +- .../public/cli-commands/npm-help/index.html | 18 +- .../public/cli-commands/npm-hook/index.html | 14 +- .../public/cli-commands/npm-init/index.html | 16 +- .../npm-install-ci-test/index.html | 18 +- .../cli-commands/npm-install-test/index.html | 18 +- .../cli-commands/npm-install/index.html | 38 +- .../public/cli-commands/npm-link/index.html | 18 +- .../public/cli-commands/npm-logout/index.html | 20 +- .../public/cli-commands/npm-ls/index.html | 29 +- .../public/cli-commands/npm-org/index.html | 14 +- .../cli-commands/npm-outdated/index.html | 47 +- .../public/cli-commands/npm-owner/index.html | 18 +- .../public/cli-commands/npm-pack/index.html | 20 +- .../public/cli-commands/npm-ping/index.html | 16 +- .../public/cli-commands/npm-prefix/index.html | 22 +- .../cli-commands/npm-profile/index.html | 16 +- .../public/cli-commands/npm-prune/index.html | 18 +- .../cli-commands/npm-publish/index.html | 18 +- .../cli-commands/npm-rebuild/index.html | 18 +- .../public/cli-commands/npm-repo/index.html | 25 +- .../cli-commands/npm-restart/index.html | 24 +- .../public/cli-commands/npm-root/index.html | 20 +- .../cli-commands/npm-run-script/index.html | 24 +- .../public/cli-commands/npm-search/index.html | 18 +- .../cli-commands/npm-shrinkwrap/index.html | 20 +- .../public/cli-commands/npm-star/index.html | 20 +- .../public/cli-commands/npm-stars/index.html | 22 +- .../public/cli-commands/npm-start/index.html | 24 +- .../public/cli-commands/npm-stop/index.html | 22 +- .../public/cli-commands/npm-team/index.html | 16 +- .../public/cli-commands/npm-test/index.html | 22 +- .../public/cli-commands/npm-token/index.html | 14 +- .../cli-commands/npm-uninstall/index.html | 20 +- .../cli-commands/npm-unpublish/index.html | 22 +- .../public/cli-commands/npm-update/index.html | 22 +- .../cli-commands/npm-version/index.html | 18 +- .../public/cli-commands/npm-view/index.html | 20 +- .../public/cli-commands/npm-whoami/index.html | 18 +- .../docs/public/cli-commands/npm/index.html | 19 +- .../docs/public/cli-commands/npx/index.html | 209 + .../public/configuring-npm/folders/index.html | 26 +- .../public/configuring-npm/install/index.html | 14 +- .../public/configuring-npm/npmrc/index.html | 16 +- .../configuring-npm/package-json/index.html | 42 +- .../package-lock-json/index.html | 18 +- .../configuring-npm/package-locks/index.html | 18 +- .../shrinkwrap-json/index.html | 20 +- deps/npm/docs/public/favicon-32x32.png | Bin 0 -> 480 bytes .../pxiByp8kv8JHgFVrLDz8Z1xlEw.woff | Bin .../pxiByp8kv8JHgFVrLDz8Z1xlFQ.woff2 | Bin .../pxiByp8kv8JHgFVrLGT9Z1xlEw.woff | Bin .../pxiByp8kv8JHgFVrLGT9Z1xlFQ.woff2 | Bin .../{v12 => v13}/pxiEyp8kv8JHgFVrJJfecg.woff2 | Bin .../{v12 => v13}/pxiEyp8kv8JHgFVrJJfedA.woff | Bin deps/npm/docs/public/index.html | 10 +- deps/npm/docs/public/static/d/2215187023.json | 1 - deps/npm/docs/public/static/d/2496503923.json | 1 + .../d/{2417117884.json => 63159454.json} | 0 .../docs/public/using-npm/config/index.html | 133 +- .../public/using-npm/developers/index.html | 18 +- .../docs/public/using-npm/disputes/index.html | 16 +- .../npm/docs/public/using-npm/orgs/index.html | 22 +- .../docs/public/using-npm/registry/index.html | 18 +- .../docs/public/using-npm/removal/index.html | 18 +- .../docs/public/using-npm/scope/index.html | 22 +- .../docs/public/using-npm/scripts/index.html | 26 +- .../docs/public/using-npm/semver/index.html | 14 +- deps/npm/docs/src/components/FoundTypo.js | 6 +- deps/npm/lib/access.js | 257 +- deps/npm/lib/adduser.js | 92 +- deps/npm/lib/audit.js | 320 +- deps/npm/lib/auth/legacy.js | 146 +- deps/npm/lib/auth/oauth.js | 10 +- deps/npm/lib/auth/saml.js | 10 +- deps/npm/lib/auth/sso.js | 114 +- deps/npm/lib/bin.js | 34 +- deps/npm/lib/birthday.js | 20 + deps/npm/lib/bugs.js | 72 +- deps/npm/lib/build.js | 140 - deps/npm/lib/cache.js | 162 +- deps/npm/lib/ci.js | 74 +- deps/npm/lib/cli.js | 63 + deps/npm/lib/completion.js | 364 +- deps/npm/lib/config.js | 374 +- deps/npm/lib/config/bin-links.js | 32 - .../lib/config/clear-credentials-by-uri.js | 16 - deps/npm/lib/config/cmd-list.js | 136 - deps/npm/lib/config/core.js | 429 - deps/npm/lib/config/defaults.js | 442 - deps/npm/lib/config/figgy-config.js | 87 - deps/npm/lib/config/gentle-fs.js | 32 - deps/npm/lib/config/get-credentials-by-uri.js | 78 - deps/npm/lib/config/lifecycle.js | 31 - deps/npm/lib/config/load-cafile.js | 32 - deps/npm/lib/config/load-prefix.js | 51 - deps/npm/lib/config/nerf-dart.js | 23 - deps/npm/lib/config/set-credentials-by-uri.js | 39 - deps/npm/lib/config/set-user.js | 29 - deps/npm/lib/dedupe.js | 178 +- deps/npm/lib/deprecate.js | 39 +- deps/npm/lib/dist-tag.js | 132 +- deps/npm/lib/docs.js | 73 +- deps/npm/lib/doctor.js | 369 +- deps/npm/lib/doctor/check-files-permission.js | 57 - deps/npm/lib/doctor/check-ping.js | 16 - deps/npm/lib/doctor/get-git-path.js | 13 - .../lib/doctor/get-latest-nodejs-version.js | 27 - deps/npm/lib/doctor/get-latest-npm-version.js | 14 - deps/npm/lib/doctor/verify-cached-files.js | 19 - deps/npm/lib/exec.js | 225 + deps/npm/lib/explain.js | 100 + deps/npm/lib/explore.js | 100 +- deps/npm/lib/fetch-package-metadata.js | 122 - deps/npm/lib/fetch-package-metadata.md | 37 - deps/npm/lib/find-dupes.js | 9 + deps/npm/lib/fund.js | 286 +- deps/npm/lib/get.js | 18 +- deps/npm/lib/help-search.js | 292 +- deps/npm/lib/help.js | 104 +- deps/npm/lib/hook.js | 100 +- deps/npm/lib/init.js | 93 +- deps/npm/lib/install-ci-test.js | 27 +- deps/npm/lib/install-test.js | 27 +- deps/npm/lib/install.js | 1132 +- deps/npm/lib/install/access-error.js | 8 - deps/npm/lib/install/action/build.js | 13 - deps/npm/lib/install/action/extract-worker.js | 18 - deps/npm/lib/install/action/extract.js | 140 - deps/npm/lib/install/action/fetch.js | 16 - deps/npm/lib/install/action/finalize.js | 106 - deps/npm/lib/install/action/global-install.js | 18 - deps/npm/lib/install/action/global-link.js | 9 - deps/npm/lib/install/action/install.js | 8 - deps/npm/lib/install/action/move.js | 96 - deps/npm/lib/install/action/postinstall.js | 8 - deps/npm/lib/install/action/preinstall.js | 8 - deps/npm/lib/install/action/prepare.js | 27 - .../install/action/refresh-package-json.js | 45 - deps/npm/lib/install/action/remove.js | 85 - deps/npm/lib/install/action/unbuild.js | 16 - deps/npm/lib/install/actions.js | 192 - .../lib/install/and-add-parent-to-errors.js | 14 - deps/npm/lib/install/and-finish-tracker.js | 16 - deps/npm/lib/install/and-ignore-errors.js | 9 - deps/npm/lib/install/audit.js | 279 - deps/npm/lib/install/check-permissions.js | 69 - deps/npm/lib/install/copy-tree.js | 30 - deps/npm/lib/install/decompose-actions.js | 79 - deps/npm/lib/install/deps.js | 851 - deps/npm/lib/install/diff-trees.js | 260 - deps/npm/lib/install/exists.js | 27 - deps/npm/lib/install/flatten-tree.js | 42 - deps/npm/lib/install/fund.js | 48 - deps/npm/lib/install/get-requested.js | 15 - deps/npm/lib/install/has-modern-meta.js | 20 - deps/npm/lib/install/inflate-bundled.js | 18 - deps/npm/lib/install/inflate-shrinkwrap.js | 263 - deps/npm/lib/install/is-dev-dep.js | 8 - deps/npm/lib/install/is-extraneous.js | 27 - .../npm/lib/install/is-fs-access-available.js | 22 - deps/npm/lib/install/is-only-dev.js | 37 - deps/npm/lib/install/is-only-optional.js | 22 - deps/npm/lib/install/is-opt-dep.js | 8 - deps/npm/lib/install/is-prod-dep.js | 9 - deps/npm/lib/install/module-staging-path.js | 8 - .../lib/install/mutate-into-logical-tree.js | 140 - deps/npm/lib/install/node.js | 77 - deps/npm/lib/install/read-shrinkwrap.js | 107 - .../install/realize-shrinkwrap-specifier.js | 22 - .../lib/install/report-optional-failure.js | 31 - deps/npm/lib/install/save.js | 193 - deps/npm/lib/install/update-package-json.js | 56 - deps/npm/lib/install/validate-args.js | 84 - deps/npm/lib/install/validate-tree.js | 95 - deps/npm/lib/install/writable.js | 35 - deps/npm/lib/link.js | 291 +- deps/npm/lib/ll.js | 6 + deps/npm/lib/logout.js | 70 +- deps/npm/lib/ls.js | 904 +- deps/npm/lib/npm.js | 686 +- deps/npm/lib/org.js | 19 +- deps/npm/lib/outdated.js | 628 +- deps/npm/lib/owner.js | 41 +- deps/npm/lib/pack.js | 379 +- deps/npm/lib/ping.js | 60 +- deps/npm/lib/prefix.js | 23 +- deps/npm/lib/profile.js | 97 +- deps/npm/lib/prune.js | 89 +- deps/npm/lib/publish.js | 215 +- deps/npm/lib/rebuild.js | 108 +- deps/npm/lib/repo.js | 96 +- deps/npm/lib/root.js | 19 +- deps/npm/lib/run-script.js | 272 +- deps/npm/lib/search.js | 77 +- deps/npm/lib/search/all-package-metadata.js | 325 - deps/npm/lib/search/all-package-search.js | 50 - deps/npm/lib/search/format-package-stream.js | 61 +- deps/npm/lib/search/package-filter.js | 2 +- deps/npm/lib/shrinkwrap.js | 332 +- deps/npm/lib/star.js | 56 +- deps/npm/lib/stars.js | 57 +- deps/npm/lib/substack.js | 22 - deps/npm/lib/team.js | 199 +- deps/npm/lib/test.js | 24 +- deps/npm/lib/token.js | 85 +- deps/npm/lib/unbuild.js | 137 - deps/npm/lib/uninstall.js | 98 +- deps/npm/lib/unpublish.js | 197 +- deps/npm/lib/update.js | 84 +- deps/npm/lib/utils/cache-file.js | 3 +- deps/npm/lib/utils/cleanup-log-files.js | 35 + deps/npm/lib/utils/cmd-list.js | 143 + .../lib/utils/completion/file-completion.js | 8 +- .../lib/utils/completion/installed-deep.js | 80 +- .../lib/utils/completion/installed-shallow.js | 95 +- deps/npm/lib/utils/completion/none.js | 2 + deps/npm/lib/utils/config.js | 371 + deps/npm/lib/utils/correct-mkdir.js | 37 - deps/npm/lib/utils/deref-command.js | 27 + deps/npm/lib/utils/did-you-mean.js | 21 +- deps/npm/lib/utils/error-handler.js | 192 +- deps/npm/lib/utils/error-message.js | 232 +- deps/npm/lib/utils/escape-arg.js | 25 +- deps/npm/lib/utils/escape-exec-path.js | 29 +- deps/npm/lib/utils/explain-dep.js | 101 + deps/npm/lib/utils/explain-eresolve.js | 94 + deps/npm/lib/utils/flat-options.js | 250 + deps/npm/lib/utils/funding.js | 183 - deps/npm/lib/utils/gently-rm.js | 21 - deps/npm/lib/utils/get-identity.js | 40 + deps/npm/lib/utils/get-project-scope.js | 17 + deps/npm/lib/utils/git.js | 7 +- deps/npm/lib/utils/gunzip-maybe.js | 22 - .../utils/hosted-git-info-from-manifest.js | 14 + deps/npm/lib/utils/is-registry.js | 11 - deps/npm/lib/utils/is-windows-bash.js | 2 +- deps/npm/lib/utils/is-windows-shell.js | 4 +- deps/npm/lib/utils/lifecycle-cmd.js | 24 +- deps/npm/lib/utils/lifecycle.js | 14 - deps/npm/lib/utils/link.js | 8 - deps/npm/lib/utils/locker.js | 73 - deps/npm/lib/utils/metrics.js | 6 +- deps/npm/lib/utils/move.js | 12 - deps/npm/lib/utils/npm-usage.js | 84 + deps/npm/lib/utils/open-url.js | 23 +- deps/npm/lib/utils/otplease.js | 23 +- deps/npm/lib/utils/output.js | 7 +- deps/npm/lib/utils/parse-json.js | 25 - deps/npm/lib/utils/path.js | 4 + deps/npm/lib/utils/perf.js | 33 +- .../pick-manifest-from-registry-metadata.js | 6 +- deps/npm/lib/utils/ping.js | 7 + deps/npm/lib/utils/proc-log-listener.js | 16 + deps/npm/lib/utils/pulse-till-done.js | 15 +- deps/npm/lib/utils/read-local-package.js | 22 +- deps/npm/lib/utils/read-user-info.js | 20 +- deps/npm/lib/utils/reify-output.js | 153 + deps/npm/lib/utils/replace-info.js | 22 - deps/npm/lib/utils/set-user-agent.js | 15 + deps/npm/lib/utils/setup-log.js | 67 + deps/npm/lib/utils/tar.js | 113 + deps/npm/lib/utils/temp-filename.js | 7 - deps/npm/lib/utils/umask.js | 17 - deps/npm/lib/utils/unsupported.js | 21 +- deps/npm/lib/utils/update-notifier.js | 122 + deps/npm/lib/utils/usage.js | 2 +- deps/npm/lib/version.js | 394 +- deps/npm/lib/view.js | 487 +- deps/npm/lib/visnup.js | 43 - deps/npm/lib/whoami.js | 68 +- deps/npm/lib/xmas.js | 61 - deps/npm/man/man1/npm-README.1 | 2 +- deps/npm/man/man1/npm-access.1 | 2 +- deps/npm/man/man1/npm-adduser.1 | 2 +- deps/npm/man/man1/npm-audit.1 | 2 +- deps/npm/man/man1/npm-bin.1 | 2 +- deps/npm/man/man1/npm-bugs.1 | 11 +- deps/npm/man/man1/npm-build.1 | 40 - deps/npm/man/man1/npm-bundle.1 | 2 +- deps/npm/man/man1/npm-cache.1 | 2 +- deps/npm/man/man1/npm-ci.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 | 4 +- deps/npm/man/man1/npm-deprecate.1 | 2 +- deps/npm/man/man1/npm-dist-tag.1 | 2 +- deps/npm/man/man1/npm-docs.1 | 14 +- deps/npm/man/man1/npm-doctor.1 | 2 +- deps/npm/man/man1/npm-edit.1 | 2 +- deps/npm/man/man1/npm-exec.1 | 211 + deps/npm/man/man1/npm-explain.1 | 87 + deps/npm/man/man1/npm-explore.1 | 2 +- deps/npm/man/man1/npm-fund.1 | 4 +- 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-install-ci-test.1 | 2 +- deps/npm/man/man1/npm-install-test.1 | 2 +- deps/npm/man/man1/npm-install.1 | 2 +- deps/npm/man/man1/npm-link.1 | 4 +- deps/npm/man/man1/npm-logout.1 | 2 +- deps/npm/man/man1/npm-ls.1 | 6 +- deps/npm/man/man1/npm-org.1 | 2 +- deps/npm/man/man1/npm-outdated.1 | 32 +- deps/npm/man/man1/npm-owner.1 | 2 +- deps/npm/man/man1/npm-pack.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-prune.1 | 2 +- deps/npm/man/man1/npm-publish.1 | 2 +- deps/npm/man/man1/npm-rebuild.1 | 2 +- deps/npm/man/man1/npm-repo.1 | 11 +- deps/npm/man/man1/npm-restart.1 | 2 +- deps/npm/man/man1/npm-root.1 | 2 +- deps/npm/man/man1/npm-run-script.1 | 2 +- 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-start.1 | 2 +- deps/npm/man/man1/npm-stop.1 | 2 +- deps/npm/man/man1/npm-team.1 | 2 +- deps/npm/man/man1/npm-test.1 | 2 +- deps/npm/man/man1/npm-token.1 | 2 +- deps/npm/man/man1/npm-uninstall.1 | 2 +- deps/npm/man/man1/npm-unpublish.1 | 2 +- deps/npm/man/man1/npm-update.1 | 2 +- deps/npm/man/man1/npm-version.1 | 2 +- deps/npm/man/man1/npm-view.1 | 2 +- deps/npm/man/man1/npm-whoami.1 | 2 +- deps/npm/man/man1/npm.1 | 7 +- deps/npm/man/man1/npx.1 | 264 +- deps/npm/man/man5/folders.5 | 2 +- deps/npm/man/man5/install.5 | 2 +- deps/npm/man/man5/npmrc.5 | 2 +- deps/npm/man/man5/package-json.5 | 18 +- deps/npm/man/man5/package-lock-json.5 | 2 +- deps/npm/man/man5/package-locks.5 | 2 +- deps/npm/man/man5/shrinkwrap-json.5 | 2 +- deps/npm/man/man7/config.7 | 142 +- deps/npm/man/man7/developers.7 | 6 +- deps/npm/man/man7/disputes.7 | 2 +- deps/npm/man/man7/orgs.7 | 2 +- deps/npm/man/man7/registry.7 | 2 +- deps/npm/man/man7/removal.7 | 2 +- deps/npm/man/man7/scope.7 | 2 +- deps/npm/man/man7/scripts.7 | 2 +- deps/npm/man/man7/semver.7 | 2 +- .../npm/node_modules/@npmcli/arborist/LICENSE | 22 + .../node_modules/@npmcli/arborist/README.md | 335 + .../@npmcli/arborist/lib/add-rm-pkg-deps.js | 131 + .../@npmcli/arborist/lib/arborist/audit.js | 30 + .../arborist/lib/arborist/build-ideal-tree.js | 1421 + .../@npmcli/arborist/lib/arborist/deduper.js | 18 + .../@npmcli/arborist/lib/arborist/index.js | 63 + .../arborist/lib/arborist/load-actual.js | 388 + .../arborist/lib/arborist/load-virtual.js | 289 + .../arborist/lib/arborist/load-workspaces.js | 31 + .../@npmcli/arborist/lib/arborist/pruner.js | 15 + .../@npmcli/arborist/lib/arborist/rebuild.js | 293 + .../@npmcli/arborist/lib/arborist/reify.js | 864 + .../@npmcli/arborist/lib/audit-report.js | 382 + .../@npmcli/arborist/lib/calc-dep-flags.js | 94 + .../arborist/lib/consistent-resolve.js | 35 + .../@npmcli/arborist/lib/dep-spec.js | 43 + .../@npmcli/arborist/lib/dep-valid.js | 130 + .../node_modules/@npmcli/arborist/lib/diff.js | 155 + .../node_modules/@npmcli/arborist/lib/edge.js | 174 + .../@npmcli/arborist/lib/from-path.js | 13 + .../@npmcli/arborist/lib/gather-dep-set.js | 42 + .../@npmcli/arborist/lib/index.js | 6 + .../@npmcli/arborist/lib/inventory.js | 86 + .../node_modules/@npmcli/arborist/lib/link.js | 88 + .../node_modules/@npmcli/arborist/lib/node.js | 978 + .../@npmcli/arborist/lib/optional-set.js | 36 + .../@npmcli/arborist/lib/peer-set.js | 25 + .../@npmcli/arborist/lib/proc-log.js | 21 + .../arborist/lib}/realpath.js | 6 +- .../@npmcli/arborist/lib/relpath.js | 3 + .../@npmcli/arborist/lib/retire-path.js | 19 + .../@npmcli/arborist/lib/shrinkwrap.js | 939 + .../@npmcli/arborist/lib/spec-from-lock.js | 29 + .../@npmcli/arborist/lib/tracker.js | 104 + .../@npmcli/arborist/lib/version-from-tgz.js | 46 + .../node_modules/@npmcli/arborist/lib/vuln.js | 189 + .../@npmcli/arborist/lib/yarn-lock.js | 336 + .../@npmcli/arborist/package.json | 75 + .../node_modules/@npmcli/ci-detect/LICENSE | 15 + .../node_modules/@npmcli/ci-detect/README.md | 80 + .../node_modules/@npmcli/ci-detect/index.js | 44 + .../@npmcli/ci-detect/package.json | 26 + deps/npm/node_modules/@npmcli/config/LICENSE | 15 + .../npm/node_modules/@npmcli/config/README.md | 224 + .../@npmcli/config/lib/env-replace.js | 13 + .../node_modules/@npmcli/config/lib/index.js | 747 + .../@npmcli/config/lib/nerf-dart.js | 18 + .../@npmcli/config/lib/parse-field.js | 75 + .../@npmcli/config/lib/proc-log.js | 4 + .../@npmcli/config/lib/set-envs.js | 99 + .../@npmcli/config/lib/type-defs.js | 49 + .../@npmcli/config/lib/type-description.js | 18 + .../node_modules/@npmcli/config/lib/umask.js | 28 + .../node_modules/@npmcli/config/package.json | 38 + deps/npm/node_modules/@npmcli/git/LICENSE | 15 + deps/npm/node_modules/@npmcli/git/README.md | 157 + .../npm/node_modules/@npmcli/git/lib/clone.js | 143 + deps/npm/node_modules/@npmcli/git/lib/env.js | 33 + deps/npm/node_modules/@npmcli/git/lib/find.js | 7 + .../npm/node_modules/@npmcli/git/lib/index.js | 8 + .../node_modules/@npmcli/git/lib/is-clean.js | 6 + deps/npm/node_modules/@npmcli/git/lib/is.js | 6 + .../@npmcli/git/lib/lines-to-revs.js | 133 + deps/npm/node_modules/@npmcli/git/lib/opts.js | 6 + .../node_modules/@npmcli/git/lib/proc-log.js | 21 + deps/npm/node_modules/@npmcli/git/lib/revs.js | 24 + .../@npmcli/git/lib/should-retry.js | 17 + .../npm/node_modules/@npmcli/git/lib/spawn.js | 33 + .../npm/node_modules/@npmcli/git/lib/which.js | 11 + .../npm/node_modules/@npmcli/git/package.json | 41 + .../installed-package-contents/LICENSE | 15 + .../installed-package-contents/README.md | 109 + .../installed-package-contents/index.js | 224 + .../installed-package-contents/package.json | 35 + .../@npmcli/map-workspaces/CHANGELOG.md | 5 + .../@npmcli/map-workspaces/LICENSE | 15 + .../@npmcli/map-workspaces/README.md | 82 + .../@npmcli/map-workspaces/index.js | 190 + .../@npmcli/map-workspaces/package.json | 57 + .../@npmcli/metavuln-calculator/LICENSE | 15 + .../@npmcli/metavuln-calculator/README.md | 289 + .../metavuln-calculator/lib/advisory.js | 295 + .../metavuln-calculator/lib/get-dep-spec.js | 12 + .../@npmcli/metavuln-calculator/lib/hash.js | 5 + .../@npmcli/metavuln-calculator/lib/index.js | 124 + .../@npmcli/metavuln-calculator/package.json | 32 + .../node_modules/@npmcli/move-file/LICENSE.md | 22 + .../node_modules/@npmcli/move-file/README.md | 68 + .../node_modules/@npmcli/move-file/index.js | 93 + .../@npmcli/move-file/package.json | 33 + .../@npmcli/name-from-folder/LICENSE | 15 + .../@npmcli/name-from-folder/README.md | 14 + .../@npmcli/name-from-folder/index.js | 7 + .../@npmcli/name-from-folder/package.json | 27 + .../@npmcli/node-gyp/lib/index.js | 13 + .../@npmcli/node-gyp/package.json | 30 + .../@npmcli/promise-spawn/LICENSE | 15 + .../@npmcli/promise-spawn/README.md | 61 + .../@npmcli/promise-spawn/index.js | 73 + .../@npmcli/promise-spawn/package.json | 32 + .../node_modules/@npmcli/run-script/LICENSE | 15 + .../node_modules/@npmcli/run-script/README.md | 149 + .../@npmcli/run-script/lib/is-windows.js | 2 + .../@npmcli/run-script/lib/make-spawn-args.js | 40 + .../run-script/lib/node-gyp-bin/node-gyp | 2 + .../run-script/lib/node-gyp-bin/node-gyp.cmd | 1 + .../@npmcli/run-script/lib/package-envs.js | 25 + .../@npmcli/run-script/lib/run-script-pkg.js | 65 + .../@npmcli/run-script/lib/run-script.js | 12 + .../@npmcli/run-script/lib/set-path.js | 42 + .../run-script/lib/validate-options.js | 31 + .../@npmcli/run-script/package.json | 46 + .../@tootallnate/once/dist/index.d.ts | 14 + .../@tootallnate/once/dist/index.js | 39 + .../@tootallnate/once/dist/index.js.map | 1 + .../@tootallnate/once/package.json | 45 + .../node_modules/@types/color-name/LICENSE | 21 + .../node_modules/@types/color-name/README.md | 16 + .../node_modules/@types/color-name/index.d.ts | 161 + .../@types/color-name/package.json | 23 + deps/npm/node_modules/JSONStream/.travis.yml | 8 - .../node_modules/JSONStream/LICENSE.APACHE2 | 15 - deps/npm/node_modules/JSONStream/LICENSE.MIT | 24 - deps/npm/node_modules/JSONStream/bin.js | 12 - .../JSONStream/examples/all_docs.js | 13 - deps/npm/node_modules/JSONStream/index.js | 247 - deps/npm/node_modules/JSONStream/package.json | 76 - .../node_modules/JSONStream/readme.markdown | 207 - deps/npm/node_modules/JSONStream/test/bool.js | 41 - .../node_modules/JSONStream/test/browser.js | 18 - .../JSONStream/test/destroy_missing.js | 27 - .../JSONStream/test/doubledot1.js | 29 - .../JSONStream/test/doubledot2.js | 30 - .../npm/node_modules/JSONStream/test/empty.js | 44 - .../JSONStream/test/error_contents.js | 45 - .../JSONStream/test/fixtures/all_npm.json | 4030 -- .../test/fixtures/couch_sample.json | 18 - .../JSONStream/test/fixtures/depth.json | 15 - .../JSONStream/test/fixtures/error.json | 1 - .../test/fixtures/header_footer.json | 19 - deps/npm/node_modules/JSONStream/test/fn.js | 39 - deps/npm/node_modules/JSONStream/test/gen.js | 135 - .../JSONStream/test/header_footer.js | 55 - .../node_modules/JSONStream/test/issues.js | 34 - deps/npm/node_modules/JSONStream/test/keys.js | 105 - deps/npm/node_modules/JSONStream/test/map.js | 40 - .../JSONStream/test/multiple_objects.js | 36 - .../JSONStream/test/multiple_objects_error.js | 29 - deps/npm/node_modules/JSONStream/test/null.js | 28 - .../node_modules/JSONStream/test/parsejson.js | 29 - deps/npm/node_modules/JSONStream/test/run.js | 13 - .../node_modules/JSONStream/test/stringify.js | 41 - .../JSONStream/test/stringify_object.js | 47 - deps/npm/node_modules/JSONStream/test/test.js | 35 - .../npm/node_modules/JSONStream/test/test2.js | 29 - .../node_modules/JSONStream/test/two-ways.js | 41 - deps/npm/node_modules/abbrev/package.json | 66 +- deps/npm/node_modules/agent-base/.travis.yml | 24 - deps/npm/node_modules/agent-base/History.md | 113 - deps/npm/node_modules/agent-base/README.md | 2 +- .../agent-base/dist/src/index.d.ts | 74 + .../node_modules/agent-base/dist/src/index.js | 201 + .../agent-base/dist/src/index.js.map | 1 + .../agent-base/dist/src/promisify.d.ts | 4 + .../agent-base/dist/src/promisify.js | 18 + .../agent-base/dist/src/promisify.js.map | 1 + deps/npm/node_modules/agent-base/index.d.ts | 43 - deps/npm/node_modules/agent-base/index.js | 170 - deps/npm/node_modules/agent-base/package.json | 102 +- .../npm/node_modules/agent-base/patch-core.js | 51 - deps/npm/node_modules/agent-base/src/index.ts | 339 + .../node_modules/agent-base/src/promisify.ts | 33 + .../agent-base/test/ssl-cert-snakeoil.key | 15 - .../agent-base/test/ssl-cert-snakeoil.pem | 12 - deps/npm/node_modules/agent-base/test/test.js | 728 - .../node_modules/agentkeepalive/History.md | 57 + deps/npm/node_modules/agentkeepalive/LICENSE | 23 + .../npm/node_modules/agentkeepalive/README.md | 83 +- .../node_modules/agentkeepalive/index.d.ts | 75 +- deps/npm/node_modules/agentkeepalive/index.js | 1 + .../agentkeepalive/lib/_http_agent.js | 416 - .../node_modules/agentkeepalive/lib/agent.js | 350 +- .../agentkeepalive/lib/constants.js | 14 + .../agentkeepalive/lib/https_agent.js | 23 +- .../node_modules/agentkeepalive/package.json | 115 +- .../node_modules/aggregate-error/index.d.ts | 51 + .../npm/node_modules/aggregate-error/index.js | 47 + .../{boxen => aggregate-error}/license | 0 .../node_modules/aggregate-error/package.json | 41 + .../node_modules/aggregate-error/readme.md | 61 + deps/npm/node_modules/ajv/LICENSE | 2 +- deps/npm/node_modules/ajv/README.md | 596 +- deps/npm/node_modules/ajv/dist/ajv.bundle.js | 4340 +- deps/npm/node_modules/ajv/dist/ajv.min.js | 4 +- deps/npm/node_modules/ajv/dist/ajv.min.js.map | 2 +- deps/npm/node_modules/ajv/dist/nodent.min.js | 2 - .../node_modules/ajv/dist/regenerator.min.js | 2 - deps/npm/node_modules/ajv/lib/$data.js | 49 - deps/npm/node_modules/ajv/lib/ajv.d.ts | 144 +- deps/npm/node_modules/ajv/lib/ajv.js | 56 +- .../node_modules/ajv/lib/compile/_rules.js | 31 - .../npm/node_modules/ajv/lib/compile/equal.js | 2 + .../node_modules/ajv/lib/compile/formats.js | 51 +- .../npm/node_modules/ajv/lib/compile/index.js | 33 +- .../node_modules/ajv/lib/compile/resolve.js | 21 +- .../npm/node_modules/ajv/lib/compile/rules.js | 20 +- deps/npm/node_modules/ajv/lib/compile/util.js | 60 +- deps/npm/node_modules/ajv/lib/data.js | 49 + .../node_modules/ajv/lib/definition_schema.js | 37 + deps/npm/node_modules/ajv/lib/dot/_limit.jst | 17 + .../node_modules/ajv/lib/dot/_limitItems.jst | 2 + .../node_modules/ajv/lib/dot/_limitLength.jst | 2 + .../ajv/lib/dot/_limitProperties.jst | 2 + deps/npm/node_modules/ajv/lib/dot/allOf.jst | 2 - deps/npm/node_modules/ajv/lib/dot/anyOf.jst | 2 - deps/npm/node_modules/ajv/lib/dot/coerce.def | 46 +- deps/npm/node_modules/ajv/lib/dot/comment.jst | 9 + .../npm/node_modules/ajv/lib/dot/contains.jst | 2 - deps/npm/node_modules/ajv/lib/dot/custom.jst | 4 +- .../npm/node_modules/ajv/lib/dot/defaults.def | 27 +- .../node_modules/ajv/lib/dot/definitions.def | 18 +- .../node_modules/ajv/lib/dot/dependencies.jst | 3 +- deps/npm/node_modules/ajv/lib/dot/errors.def | 16 +- deps/npm/node_modules/ajv/lib/dot/format.jst | 4 +- deps/npm/node_modules/ajv/lib/dot/if.jst | 72 + deps/npm/node_modules/ajv/lib/dot/items.jst | 2 - .../node_modules/ajv/lib/dot/multipleOf.jst | 2 + deps/npm/node_modules/ajv/lib/dot/oneOf.jst | 24 +- .../node_modules/ajv/lib/dot/properties.jst | 96 +- .../ajv/lib/dot/propertyNames.jst | 6 +- deps/npm/node_modules/ajv/lib/dot/ref.jst | 4 +- .../node_modules/ajv/lib/dot/uniqueItems.jst | 42 +- .../npm/node_modules/ajv/lib/dot/validate.jst | 78 +- deps/npm/node_modules/ajv/lib/dotjs/_limit.js | 20 +- .../node_modules/ajv/lib/dotjs/_limitItems.js | 8 +- .../ajv/lib/dotjs/_limitLength.js | 6 +- .../ajv/lib/dotjs/_limitProperties.js | 8 +- deps/npm/node_modules/ajv/lib/dotjs/allOf.js | 3 +- deps/npm/node_modules/ajv/lib/dotjs/anyOf.js | 6 +- .../npm/node_modules/ajv/lib/dotjs/comment.js | 14 + deps/npm/node_modules/ajv/lib/dotjs/const.js | 5 +- .../node_modules/ajv/lib/dotjs/contains.js | 6 +- deps/npm/node_modules/ajv/lib/dotjs/custom.js | 10 +- .../ajv/lib/dotjs/dependencies.js | 7 +- deps/npm/node_modules/ajv/lib/dotjs/enum.js | 3 +- deps/npm/node_modules/ajv/lib/dotjs/format.js | 7 +- deps/npm/node_modules/ajv/lib/dotjs/if.js | 103 + deps/npm/node_modules/ajv/lib/dotjs/index.js | 33 + deps/npm/node_modules/ajv/lib/dotjs/items.js | 10 +- .../node_modules/ajv/lib/dotjs/multipleOf.js | 6 +- deps/npm/node_modules/ajv/lib/dotjs/not.js | 5 +- deps/npm/node_modules/ajv/lib/dotjs/oneOf.js | 17 +- .../npm/node_modules/ajv/lib/dotjs/pattern.js | 3 +- .../node_modules/ajv/lib/dotjs/properties.js | 203 +- .../ajv/lib/dotjs/propertyNames.js | 8 +- deps/npm/node_modules/ajv/lib/dotjs/ref.js | 7 +- .../node_modules/ajv/lib/dotjs/required.js | 8 +- .../node_modules/ajv/lib/dotjs/uniqueItems.js | 19 +- .../node_modules/ajv/lib/dotjs/validate.js | 146 +- deps/npm/node_modules/ajv/lib/keyword.js | 49 +- .../npm/node_modules/ajv/lib/patternGroups.js | 36 - deps/npm/node_modules/ajv/lib/refs/$data.json | 17 - deps/npm/node_modules/ajv/lib/refs/data.json | 17 + .../ajv/lib/refs/json-schema-draft-04.json | 7 +- .../ajv/lib/refs/json-schema-draft-07.json | 168 + .../ajv/lib/refs/json-schema-secure.json | 94 + .../ajv/lib/refs/json-schema-v5.json | 250 - deps/npm/node_modules/ajv/package.json | 188 +- .../node_modules/ajv/scripts/prepare-tests | 5 +- .../ajv/scripts/publish-built-version | 32 + .../node_modules/ajv/scripts/travis-gh-pages | 2 +- deps/npm/node_modules/ansi-align/CHANGELOG.md | 36 - deps/npm/node_modules/ansi-align/LICENSE | 13 - deps/npm/node_modules/ansi-align/README.md | 79 - deps/npm/node_modules/ansi-align/index.js | 61 - deps/npm/node_modules/ansi-align/package.json | 70 - deps/npm/node_modules/ansi-regex/package.json | 79 +- deps/npm/node_modules/ansi-styles/index.d.ts | 197 + deps/npm/node_modules/ansi-styles/index.js | 136 +- .../npm/node_modules/ansi-styles/package.json | 141 +- deps/npm/node_modules/ansi-styles/readme.md | 43 +- deps/npm/node_modules/ansicolors/package.json | 59 +- deps/npm/node_modules/ansistyles/package.json | 59 +- deps/npm/node_modules/aproba/package.json | 66 +- deps/npm/node_modules/archy/package.json | 122 +- .../node_modules/are-we-there-yet/CHANGES.md | 6 + .../node_modules/readable-stream/.travis.yml | 55 - .../readable-stream/GOVERNANCE.md | 136 - .../node_modules/readable-stream/LICENSE | 47 - .../node_modules/readable-stream/README.md | 58 - .../doc/wg-meetings/2015-01-30.md | 60 - .../readable-stream/lib/_stream_duplex.js | 131 - .../lib/_stream_passthrough.js | 47 - .../readable-stream/lib/_stream_readable.js | 1019 - .../readable-stream/lib/_stream_transform.js | 214 - .../readable-stream/lib/_stream_writable.js | 687 - .../lib/internal/streams/destroy.js | 74 - .../lib/internal/streams/stream-browser.js | 1 - .../lib/internal/streams/stream.js | 1 - .../node_modules/readable-stream/package.json | 81 - .../readable-stream/readable-browser.js | 7 - .../node_modules/readable-stream/readable.js | 19 - .../node_modules/string_decoder/LICENSE | 48 - .../node_modules/string_decoder/README.md | 47 - .../string_decoder/lib/string_decoder.js | 296 - .../node_modules/string_decoder/package.json | 59 - .../are-we-there-yet/package.json | 62 +- .../are-we-there-yet/tracker-stream.js | 1 + deps/npm/node_modules/asap/package.json | 94 +- deps/npm/node_modules/asn1/package.json | 82 +- .../npm/node_modules/assert-plus/package.json | 87 +- deps/npm/node_modules/asynckit/package.json | 108 +- deps/npm/node_modules/aws-sign2/package.json | 53 +- .../npm/node_modules/aws4/.github/FUNDING.yml | 3 + deps/npm/node_modules/aws4/.travis.yml | 6 +- deps/npm/node_modules/aws4/README.md | 440 +- deps/npm/node_modules/aws4/aws4.js | 69 +- deps/npm/node_modules/aws4/package.json | 110 +- .../node_modules/balanced-match/package.json | 62 +- .../node_modules/bcrypt-pbkdf/CONTRIBUTING.md | 13 + .../node_modules/bcrypt-pbkdf/package.json | 45 +- deps/npm/node_modules/bin-links/CHANGELOG.md | 7 +- deps/npm/node_modules/bin-links/LICENSE | 244 +- deps/npm/node_modules/bin-links/README.md | 59 +- deps/npm/node_modules/bin-links/index.js | 226 +- .../node_modules/bin-links/lib/bin-target.js | 9 + .../node_modules/bin-links/lib/check-bin.js | 71 + .../node_modules/bin-links/lib/check-bins.js | 16 + .../npm/node_modules/bin-links/lib/fix-bin.js | 44 + .../bin-links/lib/get-node-modules.js | 18 + .../node_modules/bin-links/lib/get-paths.js | 48 + .../node_modules/bin-links/lib/get-prefix.js | 3 + .../node_modules/bin-links/lib/is-windows.js | 2 + .../node_modules/bin-links/lib/link-bin.js | 9 + .../node_modules/bin-links/lib/link-bins.js | 22 + .../node_modules/bin-links/lib/link-gently.js | 81 + .../node_modules/bin-links/lib/link-mans.js | 51 + .../node_modules/bin-links/lib/man-target.js | 6 + .../node_modules/bin-links/lib/shim-bin.js | 83 + deps/npm/node_modules/bin-links/package.json | 104 +- deps/npm/node_modules/bluebird/LICENSE | 21 - deps/npm/node_modules/bluebird/README.md | 57 - deps/npm/node_modules/bluebird/changelog.md | 1 - .../bluebird/js/browser/bluebird.core.js | 3824 -- .../bluebird/js/browser/bluebird.core.min.js | 31 - .../bluebird/js/browser/bluebird.js | 5666 -- .../bluebird/js/browser/bluebird.min.js | 31 - .../node_modules/bluebird/js/release/any.js | 21 - .../bluebird/js/release/assert.js | 55 - .../node_modules/bluebird/js/release/async.js | 165 - .../node_modules/bluebird/js/release/bind.js | 67 - .../bluebird/js/release/bluebird.js | 11 - .../bluebird/js/release/call_get.js | 123 - .../bluebird/js/release/cancel.js | 129 - .../bluebird/js/release/catch_filter.js | 42 - .../bluebird/js/release/context.js | 69 - .../bluebird/js/release/debuggability.js | 934 - .../bluebird/js/release/direct_resolve.js | 46 - .../node_modules/bluebird/js/release/each.js | 30 - .../bluebird/js/release/errors.js | 116 - .../node_modules/bluebird/js/release/es5.js | 80 - .../bluebird/js/release/filter.js | 12 - .../bluebird/js/release/finally.js | 146 - .../bluebird/js/release/generators.js | 223 - .../node_modules/bluebird/js/release/join.js | 168 - .../node_modules/bluebird/js/release/map.js | 168 - .../bluebird/js/release/method.js | 55 - .../bluebird/js/release/nodeback.js | 51 - .../bluebird/js/release/nodeify.js | 58 - .../bluebird/js/release/promise.js | 789 - .../bluebird/js/release/promise_array.js | 185 - .../bluebird/js/release/promisify.js | 314 - .../node_modules/bluebird/js/release/props.js | 118 - .../node_modules/bluebird/js/release/queue.js | 73 - .../node_modules/bluebird/js/release/race.js | 49 - .../bluebird/js/release/reduce.js | 172 - .../bluebird/js/release/schedule.js | 62 - .../bluebird/js/release/settle.js | 43 - .../node_modules/bluebird/js/release/some.js | 148 - .../js/release/synchronous_inspection.js | 103 - .../bluebird/js/release/thenables.js | 86 - .../bluebird/js/release/timers.js | 93 - .../node_modules/bluebird/js/release/using.js | 226 - .../node_modules/bluebird/js/release/util.js | 389 - deps/npm/node_modules/bluebird/package.json | 109 - deps/npm/node_modules/boxen/index.js | 138 - deps/npm/node_modules/boxen/package.json | 79 - deps/npm/node_modules/boxen/readme.md | 175 - .../node_modules/brace-expansion/package.json | 64 +- deps/npm/node_modules/buffer-from/index.js | 69 - .../npm/node_modules/buffer-from/package.json | 50 - deps/npm/node_modules/buffer-from/readme.md | 69 - deps/npm/node_modules/buffer-from/test.js | 12 - deps/npm/node_modules/builtins/package.json | 40 +- deps/npm/node_modules/byline/LICENSE | 19 - deps/npm/node_modules/byline/README.md | 147 - deps/npm/node_modules/byline/lib/byline.js | 155 - deps/npm/node_modules/byline/package.json | 56 - deps/npm/node_modules/byte-size/LICENSE | 2 +- deps/npm/node_modules/byte-size/README.hbs | 136 +- deps/npm/node_modules/byte-size/README.md | 227 +- deps/npm/node_modules/byte-size/dist/index.js | 211 +- deps/npm/node_modules/byte-size/index.mjs | 211 +- deps/npm/node_modules/byte-size/package.json | 84 +- deps/npm/node_modules/cacache/CHANGELOG.md | 139 +- deps/npm/node_modules/cacache/README.es.md | 628 - deps/npm/node_modules/cacache/README.md | 104 +- deps/npm/node_modules/cacache/en.js | 3 - deps/npm/node_modules/cacache/es.js | 3 - deps/npm/node_modules/cacache/get.js | 338 +- deps/npm/node_modules/cacache/index.js | 40 +- .../node_modules/cacache/lib/content/path.js | 11 +- .../node_modules/cacache/lib/content/read.js | 201 +- .../node_modules/cacache/lib/content/rm.js | 17 +- .../node_modules/cacache/lib/content/write.js | 232 +- .../node_modules/cacache/lib/entry-index.js | 271 +- .../node_modules/cacache/lib/memoization.js | 25 +- .../node_modules/cacache/lib/util/disposer.js | 30 + .../cacache/lib/util/fix-owner.js | 55 +- .../cacache/lib/util/hash-to-segments.js | 6 +- .../cacache/lib/util/move-file.js | 74 +- deps/npm/node_modules/cacache/lib/util/tmp.js | 24 +- deps/npm/node_modules/cacache/lib/util/y.js | 25 - deps/npm/node_modules/cacache/lib/verify.js | 276 +- deps/npm/node_modules/cacache/locales/en.js | 47 - deps/npm/node_modules/cacache/locales/en.json | 7 - deps/npm/node_modules/cacache/locales/es.js | 49 - deps/npm/node_modules/cacache/locales/es.json | 6 - deps/npm/node_modules/cacache/ls.js | 2 +- deps/npm/node_modules/cacache/package.json | 168 +- deps/npm/node_modules/cacache/put.js | 132 +- deps/npm/node_modules/cacache/rm.js | 7 +- deps/npm/node_modules/call-limit/CHANGELOG.md | 16 - deps/npm/node_modules/call-limit/LICENSE | 13 - deps/npm/node_modules/call-limit/README.md | 85 - .../npm/node_modules/call-limit/call-limit.js | 99 - deps/npm/node_modules/call-limit/package.json | 65 - deps/npm/node_modules/camelcase/index.js | 64 - deps/npm/node_modules/camelcase/package.json | 75 - deps/npm/node_modules/camelcase/readme.md | 57 - .../node_modules/capture-stack-trace/index.js | 18 - .../capture-stack-trace/package.json | 61 - .../capture-stack-trace/readme.md | 36 - deps/npm/node_modules/caseless/package.json | 61 +- deps/npm/node_modules/chalk/index.d.ts | 415 + deps/npm/node_modules/chalk/index.js | 228 - deps/npm/node_modules/chalk/index.js.flow | 93 - deps/npm/node_modules/chalk/package.json | 171 +- deps/npm/node_modules/chalk/readme.md | 105 +- deps/npm/node_modules/chalk/source/index.js | 229 + .../node_modules/chalk/source/templates.js | 134 + deps/npm/node_modules/chalk/source/util.js | 39 + deps/npm/node_modules/chalk/templates.js | 128 - deps/npm/node_modules/chalk/types/index.d.ts | 97 - deps/npm/node_modules/chownr/package.json | 73 +- deps/npm/node_modules/ci-info/CHANGELOG.md | 78 - deps/npm/node_modules/ci-info/LICENSE | 21 - deps/npm/node_modules/ci-info/README.md | 108 - deps/npm/node_modules/ci-info/index.js | 66 - deps/npm/node_modules/ci-info/package.json | 66 - deps/npm/node_modules/ci-info/vendors.json | 153 - deps/npm/node_modules/cidr-regex/README.md | 23 +- deps/npm/node_modules/cidr-regex/index.d.ts | 55 + deps/npm/node_modules/cidr-regex/index.js | 19 +- deps/npm/node_modules/cidr-regex/package.json | 80 +- deps/npm/node_modules/clean-stack/index.d.ts | 47 + deps/npm/node_modules/clean-stack/index.js | 40 + .../ansi-regex => clean-stack}/license | 0 .../npm/node_modules/clean-stack/package.json | 39 + deps/npm/node_modules/clean-stack/readme.md | 76 + deps/npm/node_modules/cli-boxes/boxes.json | 50 - deps/npm/node_modules/cli-boxes/index.js | 2 - deps/npm/node_modules/cli-boxes/license | 21 - deps/npm/node_modules/cli-boxes/package.json | 71 - deps/npm/node_modules/cli-boxes/readme.md | 94 - .../npm/node_modules/cli-columns/package.json | 84 +- deps/npm/node_modules/cli-table3/CHANGELOG.md | 25 + deps/npm/node_modules/cli-table3/README.md | 8 +- deps/npm/node_modules/cli-table3/index.d.ts | 5 +- .../node_modules/ansi-regex/index.d.ts | 37 + .../node_modules/ansi-regex/index.js | 10 + .../node_modules/ansi-regex}/license | 0 .../node_modules/ansi-regex/package.json | 55 + .../node_modules/ansi-regex/readme.md | 78 + .../is-fullwidth-code-point/index.d.ts | 17 + .../is-fullwidth-code-point/index.js | 50 + .../is-fullwidth-code-point}/license | 0 .../is-fullwidth-code-point/package.json | 42 + .../is-fullwidth-code-point/readme.md | 39 + .../node_modules/string-width/index.d.ts | 29 + .../node_modules/string-width/index.js | 43 + .../node_modules/string-width}/license | 0 .../node_modules/string-width/package.json | 56 + .../node_modules/string-width/readme.md | 50 + .../node_modules/strip-ansi/index.d.ts | 17 + .../node_modules/strip-ansi/index.js | 4 + .../node_modules/strip-ansi}/license | 0 .../node_modules/strip-ansi/package.json | 54 + .../node_modules/strip-ansi/readme.md | 45 + deps/npm/node_modules/cli-table3/package.json | 148 +- deps/npm/node_modules/cli-table3/src/cell.js | 4 +- .../cli-table3/src/layout-manager.js | 26 +- deps/npm/node_modules/cli-table3/src/table.js | 10 +- deps/npm/node_modules/cli-table3/src/utils.js | 8 +- deps/npm/node_modules/cliui/CHANGELOG.md | 65 - deps/npm/node_modules/cliui/LICENSE.txt | 14 - deps/npm/node_modules/cliui/README.md | 115 - deps/npm/node_modules/cliui/index.js | 324 - .../cliui/node_modules/ansi-regex/index.js | 14 - .../node_modules/ansi-regex/package.json | 85 - .../cliui/node_modules/ansi-regex/readme.md | 87 - .../is-fullwidth-code-point/index.js | 46 - .../is-fullwidth-code-point/license | 21 - .../is-fullwidth-code-point/package.json | 77 - .../is-fullwidth-code-point/readme.md | 39 - .../cliui/node_modules/string-width/index.js | 39 - .../node_modules/string-width/package.json | 88 - .../cliui/node_modules/string-width/readme.md | 45 - .../cliui/node_modules/strip-ansi/index.d.ts | 15 - .../cliui/node_modules/strip-ansi/index.js | 7 - .../node_modules/strip-ansi/package.json | 87 - .../cliui/node_modules/strip-ansi/readme.md | 61 - deps/npm/node_modules/cliui/package.json | 101 - deps/npm/node_modules/clone/package.json | 156 +- deps/npm/node_modules/cmd-shim/README.md | 22 +- deps/npm/node_modules/cmd-shim/index.js | 276 +- .../cmd-shim/lib/to-batch-syntax.js | 2 - deps/npm/node_modules/cmd-shim/package.json | 67 +- deps/npm/node_modules/co/History.md | 172 - deps/npm/node_modules/co/LICENSE | 22 - deps/npm/node_modules/co/Readme.md | 212 - deps/npm/node_modules/co/index.js | 237 - deps/npm/node_modules/co/package.json | 66 - .../node_modules/code-point-at/package.json | 60 +- .../node_modules/color-convert/conversions.js | 632 +- deps/npm/node_modules/color-convert/index.js | 51 +- .../node_modules/color-convert/package.json | 79 +- deps/npm/node_modules/color-convert/route.js | 44 +- .../node_modules/color-name/.eslintrc.json | 43 - deps/npm/node_modules/color-name/.npmignore | 107 - deps/npm/node_modules/color-name/package.json | 55 +- deps/npm/node_modules/color-name/test.js | 7 - deps/npm/node_modules/colors/README.md | 41 +- .../colors/examples/normal-usage.js | 1 + .../colors/examples/safe-string.js | 2 + deps/npm/node_modules/colors/lib/colors.js | 14 +- .../node_modules/colors/lib/maps/random.js | 3 +- deps/npm/node_modules/colors/lib/styles.js | 18 + deps/npm/node_modules/colors/package.json | 111 +- deps/npm/node_modules/columnify/package.json | 76 +- .../combined-stream/lib/combined_stream.js | 23 +- .../node_modules/combined-stream/lib/defer.js | 26 - .../node_modules/combined-stream/package.json | 61 +- .../node_modules/combined-stream/yarn.lock | 17 + .../{slide => common-ancestor-path}/LICENSE | 0 .../common-ancestor-path/README.md | 28 + .../common-ancestor-path/index.js | 17 + .../common-ancestor-path/package.json | 28 + deps/npm/node_modules/concat-map/package.json | 125 +- deps/npm/node_modules/concat-stream/LICENSE | 24 - deps/npm/node_modules/concat-stream/index.js | 144 - .../node_modules/readable-stream/.travis.yml | 55 - .../readable-stream/GOVERNANCE.md | 136 - .../node_modules/readable-stream/LICENSE | 47 - .../node_modules/readable-stream/README.md | 58 - .../doc/wg-meetings/2015-01-30.md | 60 - .../readable-stream/duplex-browser.js | 1 - .../node_modules/readable-stream/duplex.js | 1 - .../readable-stream/lib/_stream_duplex.js | 131 - .../lib/_stream_passthrough.js | 47 - .../readable-stream/lib/_stream_readable.js | 1019 - .../readable-stream/lib/_stream_transform.js | 214 - .../readable-stream/lib/_stream_writable.js | 687 - .../lib/internal/streams/BufferList.js | 79 - .../lib/internal/streams/destroy.js | 74 - .../lib/internal/streams/stream-browser.js | 1 - .../lib/internal/streams/stream.js | 1 - .../node_modules/readable-stream/package.json | 81 - .../readable-stream/passthrough.js | 1 - .../readable-stream/readable-browser.js | 7 - .../node_modules/readable-stream/readable.js | 19 - .../node_modules/readable-stream/transform.js | 1 - .../readable-stream/writable-browser.js | 1 - .../node_modules/readable-stream/writable.js | 8 - .../node_modules/string_decoder/.travis.yml | 50 - .../node_modules/string_decoder/LICENSE | 48 - .../node_modules/string_decoder/README.md | 47 - .../string_decoder/lib/string_decoder.js | 296 - .../node_modules/string_decoder/package.json | 59 - .../node_modules/concat-stream/package.json | 89 - deps/npm/node_modules/concat-stream/readme.md | 102 - deps/npm/node_modules/config-chain/LICENCE | 22 - deps/npm/node_modules/config-chain/index.js | 282 - .../node_modules/config-chain/package.json | 63 - .../node_modules/config-chain/readme.markdown | 257 - deps/npm/node_modules/configstore/index.js | 106 - deps/npm/node_modules/configstore/license | 9 - .../npm/node_modules/configstore/package.json | 79 - deps/npm/node_modules/configstore/readme.md | 116 - .../console-control-strings/package.json | 69 +- .../node_modules/copy-concurrently/LICENSE | 14 - .../node_modules/copy-concurrently/README.md | 128 - .../node_modules/copy-concurrently/copy.js | 225 - .../copy-concurrently/is-windows.js | 2 - .../node_modules/aproba/LICENSE | 14 - .../node_modules/aproba/README.md | 94 - .../node_modules/aproba/index.js | 105 - .../node_modules/aproba/package.json | 62 - .../node_modules/iferr/LICENSE | 21 - .../node_modules/iferr/README.md | 40 - .../node_modules/iferr/index.coffee | 24 - .../node_modules/iferr/index.js | 49 - .../node_modules/iferr/package.json | 55 - .../node_modules/iferr/test/index.coffee | 42 - .../node_modules/iferr/test/mocha.opts | 2 - .../copy-concurrently/package.json | 72 - .../node_modules/core-util-is/package.json | 56 +- .../node_modules/create-error-class/index.js | 44 - .../node_modules/create-error-class/license | 21 - .../create-error-class/package.json | 60 - .../node_modules/create-error-class/readme.md | 54 - .../npm/node_modules/cross-spawn/CHANGELOG.md | 6 - deps/npm/node_modules/cross-spawn/LICENSE | 19 - deps/npm/node_modules/cross-spawn/README.md | 85 - deps/npm/node_modules/cross-spawn/index.js | 59 - .../node_modules/cross-spawn/lib/enoent.js | 73 - .../npm/node_modules/cross-spawn/lib/parse.js | 113 - .../cross-spawn/lib/util/escapeArgument.js | 30 - .../cross-spawn/lib/util/escapeCommand.js | 12 - .../lib/util/hasEmptyArgumentBug.js | 18 - .../cross-spawn/lib/util/readShebang.js | 37 - .../cross-spawn/lib/util/resolveCommand.js | 31 - .../node_modules/lru-cache/README.md | 158 - .../node_modules/lru-cache/index.js | 468 - .../node_modules/lru-cache/package.json | 71 - .../node_modules/yallist/README.md | 204 - .../node_modules/yallist/iterator.js | 7 - .../node_modules/yallist/package.json | 62 - .../node_modules/yallist/yallist.js | 370 - .../npm/node_modules/cross-spawn/package.json | 84 - .../crypto-random-string/index.js | 10 - .../node_modules/crypto-random-string/license | 21 - .../crypto-random-string/package.json | 75 - .../crypto-random-string/readme.md | 49 - deps/npm/node_modules/cyclist/.npmignore | 1 - deps/npm/node_modules/cyclist/README.md | 39 - deps/npm/node_modules/cyclist/index.js | 33 - deps/npm/node_modules/cyclist/package.json | 50 - deps/npm/node_modules/dashdash/package.json | 87 +- deps/npm/node_modules/debug/.coveralls.yml | 1 - deps/npm/node_modules/debug/.npmignore | 9 - deps/npm/node_modules/debug/.travis.yml | 20 - deps/npm/node_modules/debug/CHANGELOG.md | 395 - deps/npm/node_modules/debug/Makefile | 58 - deps/npm/node_modules/debug/README.md | 91 +- deps/npm/node_modules/debug/karma.conf.js | 70 - deps/npm/node_modules/debug/node.js | 1 - .../debug/node_modules/ms/index.js | 152 - .../debug/node_modules/ms/license.md | 21 - .../debug/node_modules/ms/package.json | 69 - .../debug/node_modules/ms/readme.md | 51 - deps/npm/node_modules/debug/package.json | 116 +- deps/npm/node_modules/debug/src/browser.js | 304 +- deps/npm/node_modules/debug/src/common.js | 264 + deps/npm/node_modules/debug/src/debug.js | 225 - deps/npm/node_modules/debug/src/index.js | 8 +- deps/npm/node_modules/debug/src/node.js | 265 +- deps/npm/node_modules/debuglog/package.json | 57 +- deps/npm/node_modules/decamelize/index.js | 13 - deps/npm/node_modules/decamelize/license | 21 - deps/npm/node_modules/decamelize/package.json | 71 - deps/npm/node_modules/decamelize/readme.md | 48 - .../decode-uri-component/index.js | 94 - .../node_modules/decode-uri-component/license | 21 - .../decode-uri-component/package.json | 69 - .../decode-uri-component/readme.md | 70 - .../npm/node_modules/deep-extend/CHANGELOG.md | 46 - deps/npm/node_modules/deep-extend/LICENSE | 20 - deps/npm/node_modules/deep-extend/README.md | 91 - deps/npm/node_modules/deep-extend/index.js | 1 - .../deep-extend/lib/deep-extend.js | 150 - .../npm/node_modules/deep-extend/package.json | 92 - deps/npm/node_modules/defaults/package.json | 63 +- .../define-properties/.editorconfig | 13 - .../node_modules/define-properties/.jscs.json | 175 - .../define-properties/.travis.yml | 233 - .../define-properties/CHANGELOG.md | 44 - .../node_modules/define-properties/LICENSE | 21 - .../node_modules/define-properties/README.md | 86 - .../node_modules/define-properties/index.js | 58 - .../define-properties/package.json | 69 - .../define-properties/test/index.js | 125 - .../node_modules/delayed-stream/package.json | 63 +- deps/npm/node_modules/delegates/package.json | 47 +- deps/npm/node_modules/depd/History.md | 96 + deps/npm/node_modules/depd/LICENSE | 22 + deps/npm/node_modules/depd/Readme.md | 280 + deps/npm/node_modules/depd/index.js | 522 + .../node_modules/depd/lib/browser/index.js | 77 + .../depd/lib/compat/callsite-tostring.js | 103 + .../depd/lib/compat/event-listener-count.js | 22 + .../npm/node_modules/depd/lib/compat/index.js | 79 + deps/npm/node_modules/depd/package.json | 41 + deps/npm/node_modules/detect-indent/index.js | 122 - deps/npm/node_modules/detect-indent/license | 21 - .../node_modules/detect-indent/package.json | 76 - deps/npm/node_modules/detect-indent/readme.md | 111 - deps/npm/node_modules/detect-newline/index.js | 24 - deps/npm/node_modules/detect-newline/license | 21 - .../node_modules/detect-newline/package.json | 72 - .../npm/node_modules/detect-newline/readme.md | 42 - deps/npm/node_modules/dezalgo/package.json | 66 +- deps/npm/node_modules/dot-prop/index.js | 141 - deps/npm/node_modules/dot-prop/license | 21 - deps/npm/node_modules/dot-prop/package.json | 80 - deps/npm/node_modules/dot-prop/readme.md | 105 - deps/npm/node_modules/dotenv/CHANGELOG.md | 96 - deps/npm/node_modules/dotenv/LICENSE | 23 - deps/npm/node_modules/dotenv/README.md | 257 - deps/npm/node_modules/dotenv/appveyor.yml | 13 - deps/npm/node_modules/dotenv/config.js | 11 - deps/npm/node_modules/dotenv/lib/main.js | 79 - deps/npm/node_modules/dotenv/package.json | 73 - deps/npm/node_modules/duplexer3/LICENSE.md | 26 - deps/npm/node_modules/duplexer3/README.md | 115 - deps/npm/node_modules/duplexer3/index.js | 76 - deps/npm/node_modules/duplexer3/package.json | 64 - deps/npm/node_modules/duplexify/.travis.yml | 6 - deps/npm/node_modules/duplexify/LICENSE | 21 - deps/npm/node_modules/duplexify/README.md | 97 - deps/npm/node_modules/duplexify/example.js | 21 - deps/npm/node_modules/duplexify/index.js | 235 - .../node_modules/readable-stream/.travis.yml | 55 - .../readable-stream/GOVERNANCE.md | 136 - .../node_modules/readable-stream/LICENSE | 47 - .../node_modules/readable-stream/README.md | 58 - .../doc/wg-meetings/2015-01-30.md | 60 - .../readable-stream/duplex-browser.js | 1 - .../node_modules/readable-stream/duplex.js | 1 - .../readable-stream/lib/_stream_duplex.js | 131 - .../lib/_stream_passthrough.js | 47 - .../readable-stream/lib/_stream_readable.js | 1019 - .../readable-stream/lib/_stream_transform.js | 214 - .../readable-stream/lib/_stream_writable.js | 687 - .../lib/internal/streams/BufferList.js | 79 - .../lib/internal/streams/destroy.js | 74 - .../lib/internal/streams/stream-browser.js | 1 - .../lib/internal/streams/stream.js | 1 - .../node_modules/readable-stream/package.json | 81 - .../readable-stream/passthrough.js | 1 - .../readable-stream/readable-browser.js | 7 - .../node_modules/readable-stream/readable.js | 19 - .../node_modules/readable-stream/transform.js | 1 - .../readable-stream/writable-browser.js | 1 - .../node_modules/readable-stream/writable.js | 8 - .../node_modules/string_decoder/.travis.yml | 50 - .../node_modules/string_decoder/LICENSE | 48 - .../node_modules/string_decoder/README.md | 47 - .../string_decoder/lib/string_decoder.js | 296 - .../node_modules/string_decoder/package.json | 59 - deps/npm/node_modules/duplexify/package.json | 70 - deps/npm/node_modules/duplexify/test.js | 291 - deps/npm/node_modules/ecc-jsbn/package.json | 63 +- deps/npm/node_modules/editor/package.json | 97 +- deps/npm/node_modules/emoji-regex/README.md | 2 +- .../node_modules/emoji-regex/es2015/index.js | 2 +- .../node_modules/emoji-regex/es2015/text.js | 2 +- deps/npm/node_modules/emoji-regex/index.d.ts | 18 + deps/npm/node_modules/emoji-regex/index.js | 2 +- .../npm/node_modules/emoji-regex/package.json | 86 +- deps/npm/node_modules/emoji-regex/text.js | 2 +- deps/npm/node_modules/encoding/.npmignore | 1 - deps/npm/node_modules/encoding/.prettierrc.js | 8 + deps/npm/node_modules/encoding/README.md | 23 +- .../npm/node_modules/encoding/lib/encoding.js | 56 +- .../node_modules/encoding/lib/iconv-loader.js | 14 - deps/npm/node_modules/encoding/package.json | 66 +- deps/npm/node_modules/encoding/test/test.js | 76 +- deps/npm/node_modules/end-of-stream/LICENSE | 21 - deps/npm/node_modules/end-of-stream/README.md | 52 - deps/npm/node_modules/end-of-stream/index.js | 87 - .../node_modules/end-of-stream/package.json | 72 - deps/npm/node_modules/env-paths/package.json | 118 +- deps/npm/node_modules/err-code/package.json | 68 +- deps/npm/node_modules/errno/.travis.yml | 11 - deps/npm/node_modules/errno/README.md | 145 - deps/npm/node_modules/errno/build.js | 43 - deps/npm/node_modules/errno/cli.js | 22 - deps/npm/node_modules/errno/custom.js | 57 - deps/npm/node_modules/errno/errno.js | 313 - deps/npm/node_modules/errno/package.json | 62 - deps/npm/node_modules/errno/test.js | 88 - .../node_modules/es-abstract/.editorconfig | 13 - deps/npm/node_modules/es-abstract/.jscs.json | 174 - deps/npm/node_modules/es-abstract/.nycrc | 14 - deps/npm/node_modules/es-abstract/.travis.yml | 232 - .../npm/node_modules/es-abstract/CHANGELOG.md | 175 - .../node_modules/es-abstract/GetIntrinsic.js | 177 - deps/npm/node_modules/es-abstract/LICENSE | 21 - deps/npm/node_modules/es-abstract/Makefile | 61 - deps/npm/node_modules/es-abstract/README.md | 44 - deps/npm/node_modules/es-abstract/es2015.js | 693 - deps/npm/node_modules/es-abstract/es2016.js | 16 - deps/npm/node_modules/es-abstract/es2017.js | 25 - deps/npm/node_modules/es-abstract/es5.js | 242 - deps/npm/node_modules/es-abstract/es6.js | 3 - deps/npm/node_modules/es-abstract/es7.js | 3 - .../es-abstract/helpers/assign.js | 17 - .../es-abstract/helpers/isFinite.js | 3 - .../node_modules/es-abstract/helpers/isNaN.js | 3 - .../es-abstract/helpers/isPrimitive.js | 3 - .../node_modules/es-abstract/helpers/mod.js | 4 - .../node_modules/es-abstract/helpers/sign.js | 3 - deps/npm/node_modules/es-abstract/index.js | 22 - .../es-abstract/operations/2015.js | 78 - .../es-abstract/operations/2016.js | 80 - .../es-abstract/operations/2017.js | 82 - .../es-abstract/operations/es5.js | 10 - .../npm/node_modules/es-abstract/package.json | 102 - .../es-abstract/test/GetIntrinsic.js | 34 - .../node_modules/es-abstract/test/diffOps.js | 24 - .../node_modules/es-abstract/test/es2015.js | 11 - .../node_modules/es-abstract/test/es2016.js | 11 - .../node_modules/es-abstract/test/es2017.js | 11 - deps/npm/node_modules/es-abstract/test/es5.js | 415 - deps/npm/node_modules/es-abstract/test/es6.js | 18 - deps/npm/node_modules/es-abstract/test/es7.js | 18 - .../es-abstract/test/helpers/values.js | 53 - .../node_modules/es-abstract/test/index.js | 28 - .../node_modules/es-abstract/test/tests.js | 1610 - .../node_modules/es-to-primitive/.jscs.json | 176 - .../node_modules/es-to-primitive/.travis.yml | 243 - .../node_modules/es-to-primitive/CHANGELOG.md | 38 - deps/npm/node_modules/es-to-primitive/LICENSE | 22 - .../npm/node_modules/es-to-primitive/Makefile | 61 - .../node_modules/es-to-primitive/README.md | 51 - .../node_modules/es-to-primitive/es2015.js | 75 - deps/npm/node_modules/es-to-primitive/es5.js | 45 - deps/npm/node_modules/es-to-primitive/es6.js | 3 - .../es-to-primitive/helpers/isPrimitive.js | 3 - .../npm/node_modules/es-to-primitive/index.js | 17 - .../node_modules/es-to-primitive/package.json | 86 - .../es-to-primitive/test/es2015.js | 151 - .../node_modules/es-to-primitive/test/es5.js | 94 - .../node_modules/es-to-primitive/test/es6.js | 151 - .../es-to-primitive/test/index.js | 20 - .../npm/node_modules/es6-promise/CHANGELOG.md | 155 - deps/npm/node_modules/es6-promise/LICENSE | 19 - deps/npm/node_modules/es6-promise/README.md | 97 - deps/npm/node_modules/es6-promise/auto.js | 4 - .../es6-promise/dist/es6-promise.auto.js | 1176 - .../es6-promise/dist/es6-promise.auto.map | 1 - .../es6-promise/dist/es6-promise.auto.min.js | 1 - .../es6-promise/dist/es6-promise.auto.min.map | 1 - .../es6-promise/dist/es6-promise.js | 1174 - .../es6-promise/dist/es6-promise.map | 1 - .../es6-promise/dist/es6-promise.min.js | 1 - .../es6-promise/dist/es6-promise.min.map | 1 - .../node_modules/es6-promise/es6-promise.d.ts | 85 - .../es6-promise/lib/es6-promise.auto.js | 3 - .../es6-promise/lib/es6-promise.js | 7 - .../es6-promise/lib/es6-promise/-internal.js | 243 - .../es6-promise/lib/es6-promise/asap.js | 119 - .../es6-promise/lib/es6-promise/enumerator.js | 124 - .../es6-promise/lib/es6-promise/polyfill.js | 35 - .../es6-promise/lib/es6-promise/promise.js | 431 - .../lib/es6-promise/promise/all.js | 52 - .../lib/es6-promise/promise/race.js | 84 - .../lib/es6-promise/promise/reject.js | 46 - .../lib/es6-promise/promise/resolve.js | 48 - .../es6-promise/lib/es6-promise/then.js | 32 - .../es6-promise/lib/es6-promise/utils.js | 21 - .../npm/node_modules/es6-promise/package.json | 106 - deps/npm/node_modules/es6-promisify/README.md | 89 - .../es6-promisify/dist/promise.js | 73 - .../es6-promisify/dist/promisify.js | 85 - .../node_modules/es6-promisify/package.json | 72 - .../escape-string-regexp/index.js | 11 - .../node_modules/escape-string-regexp/license | 21 - .../escape-string-regexp/package.json | 84 - .../escape-string-regexp/readme.md | 27 - deps/npm/node_modules/execa/index.js | 309 - deps/npm/node_modules/execa/lib/errname.js | 37 - deps/npm/node_modules/execa/lib/stdio.js | 41 - .../node_modules/get-stream/buffer-stream.js | 51 - .../execa/node_modules/get-stream/index.js | 51 - .../execa/node_modules/get-stream/license | 21 - .../node_modules/get-stream/package.json | 80 - .../execa/node_modules/get-stream/readme.md | 117 - deps/npm/node_modules/execa/package.json | 109 - deps/npm/node_modules/execa/readme.md | 279 - deps/npm/node_modules/extend/package.json | 116 +- deps/npm/node_modules/extsprintf/package.json | 54 +- .../node_modules/fast-deep-equal/README.md | 67 +- .../fast-deep-equal/es6/index.d.ts | 2 + .../node_modules/fast-deep-equal/es6/index.js | 72 + .../fast-deep-equal/es6/react.d.ts | 2 + .../node_modules/fast-deep-equal/es6/react.js | 79 + .../npm/node_modules/fast-deep-equal/index.js | 59 +- .../node_modules/fast-deep-equal/package.json | 106 +- .../node_modules/fast-deep-equal/react.d.ts | 2 + .../npm/node_modules/fast-deep-equal/react.js | 53 + .../.github/FUNDING.yml | 1 + .../fast-json-stable-stringify/.npmignore | 4 - .../fast-json-stable-stringify/.travis.yml | 6 +- .../fast-json-stable-stringify/LICENSE | 3 + .../fast-json-stable-stringify/README.md | 12 + .../fast-json-stable-stringify/index.d.ts | 4 + .../fast-json-stable-stringify/package.json | 72 +- .../node_modules/figgy-pudding/CHANGELOG.md | 151 - .../npm/node_modules/figgy-pudding/LICENSE.md | 16 - deps/npm/node_modules/figgy-pudding/README.md | 260 - deps/npm/node_modules/figgy-pudding/index.js | 197 - .../node_modules/figgy-pudding/package.json | 77 - .../node_modules/find-npm-prefix/README.md | 28 - .../find-npm-prefix/find-prefix.js | 56 - .../node_modules/find-npm-prefix/package.json | 62 - .../find-npm-prefix/test/find-prefix.js | 79 - .../flush-write-stream/.travis.yml | 6 - .../node_modules/flush-write-stream/LICENSE | 21 - .../node_modules/flush-write-stream/README.md | 59 - .../flush-write-stream/example.js | 22 - .../node_modules/flush-write-stream/index.js | 54 - .../node_modules/readable-stream/.travis.yml | 55 - .../readable-stream/GOVERNANCE.md | 136 - .../node_modules/readable-stream/LICENSE | 47 - .../node_modules/readable-stream/README.md | 58 - .../doc/wg-meetings/2015-01-30.md | 60 - .../readable-stream/duplex-browser.js | 1 - .../node_modules/readable-stream/duplex.js | 1 - .../readable-stream/lib/_stream_duplex.js | 131 - .../lib/_stream_passthrough.js | 47 - .../readable-stream/lib/_stream_readable.js | 1019 - .../readable-stream/lib/_stream_transform.js | 214 - .../readable-stream/lib/_stream_writable.js | 687 - .../lib/internal/streams/BufferList.js | 79 - .../lib/internal/streams/destroy.js | 74 - .../lib/internal/streams/stream-browser.js | 1 - .../lib/internal/streams/stream.js | 1 - .../node_modules/readable-stream/package.json | 81 - .../readable-stream/passthrough.js | 1 - .../readable-stream/readable-browser.js | 7 - .../node_modules/readable-stream/readable.js | 19 - .../node_modules/readable-stream/transform.js | 1 - .../readable-stream/writable-browser.js | 1 - .../node_modules/readable-stream/writable.js | 8 - .../node_modules/string_decoder/.travis.yml | 50 - .../node_modules/string_decoder/LICENSE | 48 - .../node_modules/string_decoder/README.md | 47 - .../string_decoder/lib/string_decoder.js | 296 - .../node_modules/string_decoder/package.json | 59 - .../flush-write-stream/package.json | 57 - .../node_modules/flush-write-stream/test.js | 85 - .../node_modules/forever-agent/package.json | 53 +- deps/npm/node_modules/form-data/README.md | 8 +- deps/npm/node_modules/form-data/package.json | 105 +- deps/npm/node_modules/form-data/yarn.lock | 2662 + deps/npm/node_modules/from2/.travis.yml | 8 - deps/npm/node_modules/from2/LICENSE.md | 21 - deps/npm/node_modules/from2/README.md | 70 - deps/npm/node_modules/from2/index.js | 103 - .../node_modules/readable-stream/.travis.yml | 55 - .../readable-stream/GOVERNANCE.md | 136 - .../node_modules/readable-stream/LICENSE | 47 - .../node_modules/readable-stream/README.md | 58 - .../doc/wg-meetings/2015-01-30.md | 60 - .../readable-stream/duplex-browser.js | 1 - .../node_modules/readable-stream/duplex.js | 1 - .../readable-stream/lib/_stream_duplex.js | 131 - .../lib/_stream_passthrough.js | 47 - .../readable-stream/lib/_stream_readable.js | 1019 - .../readable-stream/lib/_stream_transform.js | 214 - .../readable-stream/lib/_stream_writable.js | 687 - .../lib/internal/streams/BufferList.js | 79 - .../lib/internal/streams/destroy.js | 74 - .../lib/internal/streams/stream-browser.js | 1 - .../lib/internal/streams/stream.js | 1 - .../node_modules/readable-stream/package.json | 81 - .../readable-stream/passthrough.js | 1 - .../readable-stream/readable-browser.js | 7 - .../node_modules/readable-stream/readable.js | 19 - .../node_modules/readable-stream/transform.js | 1 - .../readable-stream/writable-browser.js | 1 - .../node_modules/readable-stream/writable.js | 8 - .../node_modules/string_decoder/.travis.yml | 50 - .../from2/node_modules/string_decoder/LICENSE | 48 - .../node_modules/string_decoder/README.md | 47 - .../string_decoder/lib/string_decoder.js | 296 - .../node_modules/string_decoder/package.json | 59 - deps/npm/node_modules/from2/package.json | 72 - deps/npm/node_modules/from2/test.js | 123 - deps/npm/node_modules/fs-minipass/index.js | 103 +- .../node_modules/minipass/README.md | 606 - .../node_modules/minipass/index.js | 537 - .../node_modules/minipass/package.json | 70 - .../npm/node_modules/fs-minipass/package.json | 69 +- deps/npm/node_modules/fs-vacuum/.eslintrc | 18 - deps/npm/node_modules/fs-vacuum/.npmignore | 1 - deps/npm/node_modules/fs-vacuum/.travis.yml | 14 - deps/npm/node_modules/fs-vacuum/LICENSE | 13 - deps/npm/node_modules/fs-vacuum/README.md | 33 - deps/npm/node_modules/fs-vacuum/package.json | 69 - .../node_modules/fs-vacuum/test/arguments.js | 24 - .../fs-vacuum/test/base-leaf-mismatch.js | 16 - .../test/no-entries-file-no-purge.js | 78 - .../test/no-entries-link-no-purge.js | 78 - .../fs-vacuum/test/no-entries-no-purge.js | 61 - .../test/no-entries-with-link-purge.js | 78 - .../fs-vacuum/test/no-entries-with-purge.js | 67 - .../test/not-remove-home-directory.js | 46 - .../test/other-directories-no-purge.js | 76 - .../fs-vacuum/test/racy-entries-eexist.js | 119 - .../fs-vacuum/test/racy-entries-enotempty.js | 119 - .../fs-vacuum/test/racy-entries.js | 104 - deps/npm/node_modules/fs-vacuum/vacuum.js | 117 - .../fs-write-stream-atomic/.npmignore | 3 - .../fs-write-stream-atomic/.travis.yml | 11 - .../fs-write-stream-atomic/README.md | 35 - .../fs-write-stream-atomic/index.js | 176 - .../node_modules/iferr/.npmignore | 1 - .../node_modules/iferr/LICENSE | 21 - .../node_modules/iferr/README.md | 40 - .../node_modules/iferr/index.coffee | 24 - .../node_modules/iferr/index.js | 49 - .../node_modules/iferr/package.json | 55 - .../node_modules/iferr/test/index.coffee | 42 - .../node_modules/iferr/test/mocha.opts | 2 - .../node_modules/readable-stream/.travis.yml | 55 - .../readable-stream/GOVERNANCE.md | 136 - .../node_modules/readable-stream/LICENSE | 47 - .../node_modules/readable-stream/README.md | 58 - .../doc/wg-meetings/2015-01-30.md | 60 - .../readable-stream/duplex-browser.js | 1 - .../node_modules/readable-stream/duplex.js | 1 - .../readable-stream/lib/_stream_duplex.js | 131 - .../lib/_stream_passthrough.js | 47 - .../readable-stream/lib/_stream_readable.js | 1019 - .../readable-stream/lib/_stream_transform.js | 214 - .../readable-stream/lib/_stream_writable.js | 687 - .../lib/internal/streams/BufferList.js | 79 - .../lib/internal/streams/destroy.js | 74 - .../lib/internal/streams/stream-browser.js | 1 - .../lib/internal/streams/stream.js | 1 - .../node_modules/readable-stream/package.json | 81 - .../readable-stream/passthrough.js | 1 - .../readable-stream/readable-browser.js | 7 - .../node_modules/readable-stream/readable.js | 19 - .../node_modules/readable-stream/transform.js | 1 - .../readable-stream/writable-browser.js | 1 - .../node_modules/readable-stream/writable.js | 8 - .../node_modules/string_decoder/.travis.yml | 50 - .../node_modules/string_decoder/LICENSE | 48 - .../node_modules/string_decoder/README.md | 47 - .../string_decoder/lib/string_decoder.js | 296 - .../node_modules/string_decoder/package.json | 59 - .../fs-write-stream-atomic/package.json | 67 - .../fs-write-stream-atomic/test/basic.js | 97 - .../fs-write-stream-atomic/test/chown.js | 44 - .../test/rename-eperm.js | 154 - .../test/rename-fail.js | 30 - .../fs-write-stream-atomic/test/slow-close.js | 40 - .../fs-write-stream-atomic/test/toolong.js | 29 - .../npm/node_modules/fs.realpath/package.json | 65 +- .../node_modules/function-bind/.editorconfig | 20 - .../npm/node_modules/function-bind/.jscs.json | 176 - .../npm/node_modules/function-bind/.npmignore | 22 - .../node_modules/function-bind/.travis.yml | 168 - deps/npm/node_modules/function-bind/LICENSE | 20 - deps/npm/node_modules/function-bind/README.md | 48 - .../function-bind/implementation.js | 52 - deps/npm/node_modules/function-bind/index.js | 5 - .../node_modules/function-bind/package.json | 67 - .../node_modules/function-bind/test/index.js | 252 - .../gauge/node_modules/aproba/package.json | 62 +- .../is-fullwidth-code-point/index.js | 46 + .../is-fullwidth-code-point}/license | 0 .../is-fullwidth-code-point/package.json | 45 + .../is-fullwidth-code-point/readme.md | 39 + .../node_modules/string-width/package.json | 64 +- deps/npm/node_modules/gauge/package.json | 67 +- deps/npm/node_modules/genfun/CHANGELOG.md | 53 - deps/npm/node_modules/genfun/LICENSE | 21 - deps/npm/node_modules/genfun/README.md | 223 - deps/npm/node_modules/genfun/lib/genfun.js | 296 - deps/npm/node_modules/genfun/lib/method.js | 82 - deps/npm/node_modules/genfun/lib/role.js | 17 - deps/npm/node_modules/genfun/lib/util.js | 37 - deps/npm/node_modules/genfun/package.json | 79 - deps/npm/node_modules/gentle-fs/CHANGELOG.md | 113 - deps/npm/node_modules/gentle-fs/LICENSE | 235 - deps/npm/node_modules/gentle-fs/README.md | 65 - deps/npm/node_modules/gentle-fs/index.js | 14 - .../node_modules/gentle-fs/lib/bin-link.js | 96 - deps/npm/node_modules/gentle-fs/lib/chown.js | 24 - deps/npm/node_modules/gentle-fs/lib/link.js | 126 - deps/npm/node_modules/gentle-fs/lib/mkdir.js | 22 - deps/npm/node_modules/gentle-fs/lib/rm.js | 256 - .../gentle-fs/node_modules/aproba/LICENSE | 14 - .../gentle-fs/node_modules/aproba/README.md | 94 - .../gentle-fs/node_modules/aproba/index.js | 105 - .../node_modules/aproba/package.json | 62 - .../gentle-fs/node_modules/iferr/.npmignore | 1 - .../gentle-fs/node_modules/iferr/LICENSE | 21 - .../gentle-fs/node_modules/iferr/README.md | 40 - .../gentle-fs/node_modules/iferr/index.coffee | 24 - .../gentle-fs/node_modules/iferr/index.js | 49 - .../gentle-fs/node_modules/iferr/package.json | 55 - .../node_modules/iferr/test/index.coffee | 42 - .../node_modules/iferr/test/mocha.opts | 2 - deps/npm/node_modules/gentle-fs/package.json | 82 - .../node_modules/get-caller-file/LICENSE.md | 6 - .../node_modules/get-caller-file/README.md | 41 - .../node_modules/get-caller-file/index.d.ts | 2 - .../npm/node_modules/get-caller-file/index.js | 22 - .../node_modules/get-caller-file/index.js.map | 1 - .../node_modules/get-caller-file/package.json | 69 - .../node_modules/get-stream/buffer-stream.js | 51 - deps/npm/node_modules/get-stream/index.js | 50 - deps/npm/node_modules/get-stream/package.json | 86 - deps/npm/node_modules/get-stream/readme.md | 123 - deps/npm/node_modules/getpass/package.json | 46 +- deps/npm/node_modules/glob/package.json | 90 +- deps/npm/node_modules/global-dirs/index.js | 90 - .../npm/node_modules/global-dirs/package.json | 84 - deps/npm/node_modules/global-dirs/readme.md | 69 - deps/npm/node_modules/got/index.js | 364 - deps/npm/node_modules/got/license | 21 - .../node_modules/get-stream/buffer-stream.js | 51 - .../got/node_modules/get-stream/index.js | 51 - .../got/node_modules/get-stream/license | 21 - .../got/node_modules/get-stream/package.json | 80 - .../got/node_modules/get-stream/readme.md | 117 - deps/npm/node_modules/got/package.json | 110 - deps/npm/node_modules/got/readme.md | 335 - .../npm/node_modules/graceful-fs/package.json | 102 +- deps/npm/node_modules/har-schema/package.json | 100 +- deps/npm/node_modules/har-validator/LICENSE | 22 +- deps/npm/node_modules/har-validator/README.md | 63 +- .../node_modules/har-validator/lib/async.js | 15 +- .../node_modules/har-validator/lib/promise.js | 15 +- .../node_modules/har-validator/package.json | 86 +- deps/npm/node_modules/has-flag/index.d.ts | 39 + deps/npm/node_modules/has-flag/index.js | 10 +- deps/npm/node_modules/has-flag/package.json | 118 +- deps/npm/node_modules/has-flag/readme.md | 19 + deps/npm/node_modules/has-symbols/.npmignore | 37 - deps/npm/node_modules/has-symbols/.travis.yml | 113 - .../npm/node_modules/has-symbols/CHANGELOG.md | 3 - deps/npm/node_modules/has-symbols/LICENSE | 21 - deps/npm/node_modules/has-symbols/README.md | 45 - deps/npm/node_modules/has-symbols/index.js | 13 - .../npm/node_modules/has-symbols/package.json | 82 - deps/npm/node_modules/has-symbols/shams.js | 42 - .../node_modules/has-symbols/test/index.js | 22 - .../has-symbols/test/shams/core-js.js | 28 - .../test/shams/get-own-property-symbols.js | 28 - .../node_modules/has-symbols/test/tests.js | 54 - .../npm/node_modules/has-unicode/package.json | 72 +- deps/npm/node_modules/has/LICENSE-MIT | 22 - deps/npm/node_modules/has/README.md | 18 - deps/npm/node_modules/has/package.json | 52 - deps/npm/node_modules/has/src/index.js | 5 - deps/npm/node_modules/has/test/index.js | 10 - .../node_modules/hosted-git-info/CHANGELOG.md | 44 +- .../node_modules/hosted-git-info/git-host.js | 6 +- .../npm/node_modules/hosted-git-info/index.js | 16 +- .../node_modules/hosted-git-info/package.json | 84 +- .../node_modules/http-cache-semantics/LICENSE | 9 + .../http-cache-semantics/README.md | 82 +- .../http-cache-semantics/index.js | 673 + .../http-cache-semantics/node4/index.js | 559 - .../http-cache-semantics/package.json | 78 +- .../node_modules/http-proxy-agent/.travis.yml | 22 - .../node_modules/http-proxy-agent/History.md | 101 - .../node_modules/http-proxy-agent/README.md | 2 +- .../http-proxy-agent/dist/agent.d.ts | 32 + .../http-proxy-agent/dist/agent.js | 145 + .../http-proxy-agent/dist/agent.js.map | 1 + .../http-proxy-agent/dist/index.d.ts | 21 + .../http-proxy-agent/dist/index.js | 14 + .../http-proxy-agent/dist/index.js.map | 1 + .../node_modules/http-proxy-agent/index.js | 111 - .../http-proxy-agent/package.json | 96 +- .../test/ssl-cert-snakeoil.key | 15 - .../test/ssl-cert-snakeoil.pem | 12 - .../http-proxy-agent/test/test.js | 303 - .../node_modules/http-signature/package.json | 88 +- .../https-proxy-agent/.editorconfig | 37 - .../https-proxy-agent/.eslintrc.js | 86 - .../node_modules/https-proxy-agent/History.md | 124 - .../node_modules/https-proxy-agent/README.md | 2 +- .../https-proxy-agent/dist/agent.d.ts | 30 + .../https-proxy-agent/dist/agent.js | 180 + .../https-proxy-agent/dist/agent.js.map | 1 + .../https-proxy-agent/dist/index.d.ts | 23 + .../https-proxy-agent/dist/index.js | 14 + .../https-proxy-agent/dist/index.js.map | 1 + .../dist/parse-proxy-response.d.ts | 7 + .../dist/parse-proxy-response.js | 66 + .../dist/parse-proxy-response.js.map | 1 + .../node_modules/https-proxy-agent/index.d.ts | 22 - .../node_modules/https-proxy-agent/index.js | 241 - .../https-proxy-agent/package.json | 94 +- .../npm/node_modules/humanize-ms/package.json | 63 +- .../iconv-lite/.github/dependabot.yml | 11 + deps/npm/node_modules/iconv-lite/.travis.yml | 23 - deps/npm/node_modules/iconv-lite/Changelog.md | 98 +- deps/npm/node_modules/iconv-lite/README.md | 68 +- .../iconv-lite/encodings/dbcs-codec.js | 144 +- .../iconv-lite/encodings/index.js | 3 +- .../iconv-lite/encodings/internal.js | 14 +- .../iconv-lite/encodings/sbcs-codec.js | 4 +- .../iconv-lite/encodings/sbcs-data.js | 10 + .../encodings/tables/gbk-added.json | 5 +- .../iconv-lite/encodings/utf16.js | 96 +- .../iconv-lite/encodings/utf32.js | 319 + .../node_modules/iconv-lite/encodings/utf7.js | 8 +- .../iconv-lite/lib/extend-node.js | 217 - .../node_modules/iconv-lite/lib/index.d.ts | 17 + deps/npm/node_modules/iconv-lite/lib/index.js | 53 +- .../node_modules/iconv-lite/lib/streams.js | 190 +- deps/npm/node_modules/iconv-lite/package.json | 115 +- deps/npm/node_modules/iferr/LICENSE | 21 - deps/npm/node_modules/iferr/README.md | 53 - deps/npm/node_modules/iferr/iferr.js | 23 - deps/npm/node_modules/iferr/package.json | 61 - .../npm/node_modules/ignore-walk/package.json | 65 +- deps/npm/node_modules/import-lazy/index.js | 53 - deps/npm/node_modules/import-lazy/license | 21 - .../npm/node_modules/import-lazy/package.json | 76 - deps/npm/node_modules/import-lazy/readme.md | 64 - .../npm/node_modules/imurmurhash/package.json | 74 +- .../npm/node_modules/indent-string/index.d.ts | 42 + deps/npm/node_modules/indent-string/index.js | 35 + .../{global-dirs => indent-string}/license | 0 .../node_modules/indent-string/package.json | 37 + deps/npm/node_modules/indent-string/readme.md | 70 + .../npm/node_modules/infer-owner/package.json | 67 +- deps/npm/node_modules/inflight/package.json | 63 +- deps/npm/node_modules/inherits/package.json | 82 +- deps/npm/node_modules/ini/package.json | 75 +- .../node_modules/hosted-git-info/CHANGELOG.md | 141 + .../node_modules/hosted-git-info/LICENSE | 13 + .../node_modules/hosted-git-info/README.md | 133 + .../hosted-git-info/git-host-info.js | 79 + .../node_modules/hosted-git-info/git-host.js | 156 + .../node_modules/hosted-git-info/index.js | 148 + .../node_modules/hosted-git-info/package.json | 40 + .../node_modules/npm-package-arg/CHANGELOG.md | 26 + .../node_modules/npm-package-arg}/LICENSE | 0 .../node_modules/npm-package-arg/README.md | 83 + .../node_modules/npm-package-arg/npa.js | 301 + .../node_modules/npm-package-arg/package.json | 44 + .../node_modules/semver/CHANGELOG.md | 39 + .../node_modules/semver}/LICENSE | 0 .../node_modules/semver/README.md | 412 + .../node_modules}/semver/bin/semver | 0 .../node_modules/semver/package.json | 28 + .../node_modules/semver/range.bnf | 16 + .../node_modules}/semver/semver.js | 0 .../init-package-json/package.json | 72 +- deps/npm/node_modules/ip-regex/index.d.ts | 70 + deps/npm/node_modules/ip-regex/index.js | 26 +- deps/npm/node_modules/ip-regex/license | 20 +- deps/npm/node_modules/ip-regex/package.json | 117 +- deps/npm/node_modules/ip-regex/readme.md | 27 +- deps/npm/node_modules/ip/package.json | 56 +- .../node_modules/is-callable/.editorconfig | 20 - .../node_modules/is-callable/.istanbul.yml | 47 - deps/npm/node_modules/is-callable/.jscs.json | 176 - deps/npm/node_modules/is-callable/.travis.yml | 225 - .../npm/node_modules/is-callable/CHANGELOG.md | 56 - deps/npm/node_modules/is-callable/LICENSE | 22 - deps/npm/node_modules/is-callable/Makefile | 61 - deps/npm/node_modules/is-callable/README.md | 59 - deps/npm/node_modules/is-callable/index.js | 37 - .../npm/node_modules/is-callable/package.json | 98 - deps/npm/node_modules/is-callable/test.js | 158 - deps/npm/node_modules/is-ci/LICENSE | 21 - deps/npm/node_modules/is-ci/README.md | 50 - deps/npm/node_modules/is-ci/bin.js | 4 - deps/npm/node_modules/is-ci/index.js | 3 - .../is-ci/node_modules/ci-info/CHANGELOG.md | 62 - .../is-ci/node_modules/ci-info/LICENSE | 21 - .../is-ci/node_modules/ci-info/README.md | 107 - .../is-ci/node_modules/ci-info/index.js | 66 - .../is-ci/node_modules/ci-info/package.json | 65 - .../is-ci/node_modules/ci-info/vendors.json | 152 - deps/npm/node_modules/is-ci/package.json | 69 - deps/npm/node_modules/is-cidr/README.md | 16 +- deps/npm/node_modules/is-cidr/index.d.ts | 31 + deps/npm/node_modules/is-cidr/index.js | 16 +- deps/npm/node_modules/is-cidr/package.json | 84 +- .../node_modules/is-date-object/.jscs.json | 122 - .../node_modules/is-date-object/.npmignore | 28 - .../node_modules/is-date-object/.travis.yml | 58 - .../node_modules/is-date-object/CHANGELOG.md | 10 - deps/npm/node_modules/is-date-object/LICENSE | 22 - deps/npm/node_modules/is-date-object/Makefile | 61 - .../npm/node_modules/is-date-object/README.md | 53 - deps/npm/node_modules/is-date-object/index.js | 20 - .../node_modules/is-date-object/package.json | 66 - deps/npm/node_modules/is-date-object/test.js | 33 - .../is-fullwidth-code-point/index.js | 72 +- .../is-fullwidth-code-point/package.json | 63 +- .../is-fullwidth-code-point/readme.md | 4 +- .../is-installed-globally/index.js | 5 - .../is-installed-globally/package.json | 80 - .../is-installed-globally/readme.md | 39 - .../iferr => is-lambda}/.npmignore | 0 deps/npm/node_modules/is-lambda/.travis.yml | 8 + deps/npm/node_modules/is-lambda/LICENSE | 21 + deps/npm/node_modules/is-lambda/README.md | 27 + deps/npm/node_modules/is-lambda/index.js | 6 + deps/npm/node_modules/is-lambda/package.json | 35 + deps/npm/node_modules/is-lambda/test.js | 16 + deps/npm/node_modules/is-npm/index.js | 4 - deps/npm/node_modules/is-npm/package.json | 64 - deps/npm/node_modules/is-npm/readme.md | 30 - deps/npm/node_modules/is-obj/index.js | 5 - deps/npm/node_modules/is-obj/license | 21 - deps/npm/node_modules/is-obj/package.json | 65 - deps/npm/node_modules/is-obj/readme.md | 34 - deps/npm/node_modules/is-path-inside/index.js | 14 - deps/npm/node_modules/is-path-inside/license | 21 - .../node_modules/is-path-inside/package.json | 70 - .../npm/node_modules/is-path-inside/readme.md | 34 - deps/npm/node_modules/is-redirect/index.js | 14 - deps/npm/node_modules/is-redirect/license | 21 - .../npm/node_modules/is-redirect/package.json | 67 - deps/npm/node_modules/is-redirect/readme.md | 28 - deps/npm/node_modules/is-regex/.jscs.json | 176 - deps/npm/node_modules/is-regex/.npmignore | 15 - deps/npm/node_modules/is-regex/.travis.yml | 165 - deps/npm/node_modules/is-regex/CHANGELOG.md | 27 - deps/npm/node_modules/is-regex/LICENSE | 20 - deps/npm/node_modules/is-regex/Makefile | 61 - deps/npm/node_modules/is-regex/README.md | 54 - deps/npm/node_modules/is-regex/index.js | 39 - deps/npm/node_modules/is-regex/package.json | 77 - deps/npm/node_modules/is-regex/test.js | 58 - .../node_modules/is-retry-allowed/index.js | 62 - .../npm/node_modules/is-retry-allowed/license | 21 - .../is-retry-allowed/package.json | 59 - .../node_modules/is-retry-allowed/readme.md | 42 - deps/npm/node_modules/is-stream/index.js | 21 - deps/npm/node_modules/is-stream/license | 21 - deps/npm/node_modules/is-stream/package.json | 72 - deps/npm/node_modules/is-stream/readme.md | 42 - deps/npm/node_modules/is-symbol/.editorconfig | 13 - deps/npm/node_modules/is-symbol/.jscs.json | 176 - deps/npm/node_modules/is-symbol/.nvmrc | 1 - deps/npm/node_modules/is-symbol/.travis.yml | 241 - deps/npm/node_modules/is-symbol/CHANGELOG.md | 12 - deps/npm/node_modules/is-symbol/LICENSE | 22 - deps/npm/node_modules/is-symbol/Makefile | 61 - deps/npm/node_modules/is-symbol/README.md | 46 - deps/npm/node_modules/is-symbol/index.js | 35 - deps/npm/node_modules/is-symbol/package.json | 72 - deps/npm/node_modules/is-symbol/test/index.js | 92 - .../node_modules/is-typedarray/package.json | 59 +- deps/npm/node_modules/isarray/package.json | 61 +- deps/npm/node_modules/isexe/package.json | 62 +- deps/npm/node_modules/isstream/package.json | 68 +- deps/npm/node_modules/jsbn/package.json | 54 +- .../json-parse-better-errors/CHANGELOG.md | 46 - .../json-parse-better-errors/LICENSE.md | 7 - .../json-parse-better-errors/README.md | 46 - .../json-parse-better-errors/index.js | 38 - .../json-parse-better-errors/package.json | 82 - .../CHANGELOG.md | 50 + .../json-parse-even-better-errors/LICENSE.md | 25 + .../json-parse-even-better-errors/README.md | 96 + .../json-parse-even-better-errors/index.js | 121 + .../package.json | 33 + .../json-schema-traverse/.npmignore | 60 - .../json-schema-traverse/README.md | 20 +- .../json-schema-traverse/index.js | 20 +- .../json-schema-traverse/package.json | 67 +- .../json-schema-traverse/spec/index.spec.js | 79 +- .../npm/node_modules/json-schema/package.json | 79 +- .../json-stringify-nice/.github/FUNDING.yml | 3 + .../json-stringify-nice/.npmignore | 23 + .../yallist => json-stringify-nice}/LICENSE | 0 .../json-stringify-nice/README.md | 105 + .../node_modules/json-stringify-nice/index.js | 38 + .../json-stringify-nice/package.json | 24 + .../tap-snapshots/test-basic.js-TAP.test.js | 127 + .../json-stringify-nice/test/basic.js | 68 + .../json-stringify-safe/package.json | 65 +- deps/npm/node_modules/jsonparse/package.json | 62 +- deps/npm/node_modules/jsprim/CONTRIBUTING.md | 19 + deps/npm/node_modules/jsprim/package.json | 65 +- deps/npm/node_modules/just-diff-apply/LICENSE | 21 + .../node_modules/just-diff-apply/README.md | 52 + .../npm/node_modules/just-diff-apply/index.js | 105 + .../node_modules/just-diff-apply/package.json | 23 + deps/npm/node_modules/just-diff/LICENSE | 21 + deps/npm/node_modules/just-diff/README.md | 76 + deps/npm/node_modules/just-diff/index.js | 152 + deps/npm/node_modules/just-diff/package.json | 22 + deps/npm/node_modules/latest-version/index.js | 4 - deps/npm/node_modules/latest-version/license | 21 - .../node_modules/latest-version/package.json | 71 - .../npm/node_modules/latest-version/readme.md | 40 - .../npm/node_modules/lazy-property/.npmignore | 16 - deps/npm/node_modules/lazy-property/LICENSE | 22 - deps/npm/node_modules/lazy-property/README.md | 44 - .../node_modules/lazy-property/component.json | 7 - .../lazy-property/lazyProperty.js | 19 - .../node_modules/lazy-property/package.json | 65 - deps/npm/node_modules/leven/index.d.ts | 21 + deps/npm/node_modules/leven/index.js | 77 + .../{is-installed-globally => leven}/license | 0 deps/npm/node_modules/leven/package.json | 57 + deps/npm/node_modules/leven/readme.md | 50 + deps/npm/node_modules/libcipm/CHANGELOG.md | 518 - deps/npm/node_modules/libcipm/LICENSE.md | 19 - deps/npm/node_modules/libcipm/README.md | 32 - deps/npm/node_modules/libcipm/index.js | 429 - .../libcipm/lib/config/npm-config.js | 84 - deps/npm/node_modules/libcipm/lib/extract.js | 67 - .../npm/node_modules/libcipm/lib/silentlog.js | 13 - deps/npm/node_modules/libcipm/lib/worker.js | 16 - deps/npm/node_modules/libcipm/package.json | 96 - deps/npm/node_modules/libnpm/CHANGELOG.md | 113 - deps/npm/node_modules/libnpm/LICENSE.md | 16 - deps/npm/node_modules/libnpm/README.md | 57 - deps/npm/node_modules/libnpm/access.js | 3 - deps/npm/node_modules/libnpm/adduser.js | 3 - deps/npm/node_modules/libnpm/config.js | 3 - deps/npm/node_modules/libnpm/extract.js | 3 - deps/npm/node_modules/libnpm/fetch.js | 3 - deps/npm/node_modules/libnpm/get-prefix.js | 3 - deps/npm/node_modules/libnpm/hook.js | 3 - deps/npm/node_modules/libnpm/index.js | 29 - deps/npm/node_modules/libnpm/link-bin.js | 3 - deps/npm/node_modules/libnpm/log.js | 3 - deps/npm/node_modules/libnpm/logical-tree.js | 3 - deps/npm/node_modules/libnpm/login.js | 3 - deps/npm/node_modules/libnpm/manifest.js | 3 - deps/npm/node_modules/libnpm/org.js | 3 - deps/npm/node_modules/libnpm/package.json | 94 - deps/npm/node_modules/libnpm/packument.js | 3 - deps/npm/node_modules/libnpm/parse-arg.js | 3 - deps/npm/node_modules/libnpm/profile.js | 3 - deps/npm/node_modules/libnpm/publish.js | 3 - deps/npm/node_modules/libnpm/read-json.js | 3 - deps/npm/node_modules/libnpm/run-script.js | 3 - deps/npm/node_modules/libnpm/search.js | 3 - .../node_modules/libnpm/stringify-package.js | 3 - deps/npm/node_modules/libnpm/tarball.js | 3 - deps/npm/node_modules/libnpm/team.js | 3 - deps/npm/node_modules/libnpm/unpublish.js | 3 - deps/npm/node_modules/libnpm/verify-lock.js | 3 - .../libnpmaccess/.github/settings.yml | 2 + .../libnpmaccess/.github/workflows/ci.yml | 94 + .../npm/node_modules/libnpmaccess/.travis.yml | 7 - .../node_modules/libnpmaccess/CHANGELOG.md | 37 + .../libnpmaccess/PULL_REQUEST_TEMPLATE | 7 - deps/npm/node_modules/libnpmaccess/README.md | 39 +- .../node_modules/libnpmaccess/appveyor.yml | 22 - deps/npm/node_modules/libnpmaccess/index.js | 201 +- .../node_modules/libnpmaccess/package.json | 86 +- .../test/{util => fixtures}/tnock.js | 0 .../node_modules/libnpmaccess/test/index.js | 170 +- .../node_modules/libnpmconfig/CHANGELOG.md | 51 - .../libnpmconfig/PULL_REQUEST_TEMPLATE | 7 - deps/npm/node_modules/libnpmconfig/README.md | 40 - deps/npm/node_modules/libnpmconfig/index.js | 107 - .../node_modules/find-up/index.js | 46 - .../libnpmconfig/node_modules/find-up/license | 9 - .../node_modules/find-up/package.json | 82 - .../node_modules/find-up/readme.md | 87 - .../node_modules/locate-path/index.js | 24 - .../node_modules/locate-path/license | 9 - .../node_modules/locate-path/package.json | 76 - .../node_modules/locate-path/readme.md | 99 - .../node_modules/p-limit/index.d.ts | 29 - .../node_modules/p-limit/index.js | 52 - .../libnpmconfig/node_modules/p-limit/license | 9 - .../node_modules/p-limit/package.json | 83 - .../node_modules/p-limit/readme.md | 90 - .../node_modules/p-locate/index.js | 34 - .../node_modules/p-locate/license | 9 - .../node_modules/p-locate/package.json | 83 - .../node_modules/p-locate/readme.md | 88 - .../node_modules/p-try/index.d.ts | 39 - .../libnpmconfig/node_modules/p-try/index.js | 9 - .../libnpmconfig/node_modules/p-try/license | 9 - .../node_modules/p-try/package.json | 74 - .../libnpmconfig/node_modules/p-try/readme.md | 58 - .../node_modules/libnpmconfig/package.json | 66 - deps/npm/node_modules/libnpmfund/CHANGELOG.md | 5 + deps/npm/node_modules/libnpmfund/LICENSE | 15 + deps/npm/node_modules/libnpmfund/README.md | 129 + deps/npm/node_modules/libnpmfund/index.js | 183 + deps/npm/node_modules/libnpmfund/package.json | 52 + deps/npm/node_modules/libnpmhook/CHANGELOG.md | 15 +- deps/npm/node_modules/libnpmhook/README.md | 44 +- deps/npm/node_modules/libnpmhook/index.js | 50 +- deps/npm/node_modules/libnpmhook/package.json | 88 +- deps/npm/node_modules/libnpmorg/.travis.yml | 7 - deps/npm/node_modules/libnpmorg/CHANGELOG.md | 12 + .../libnpmorg/PULL_REQUEST_TEMPLATE | 7 - deps/npm/node_modules/libnpmorg/README.md | 31 +- deps/npm/node_modules/libnpmorg/appveyor.yml | 22 - deps/npm/node_modules/libnpmorg/index.js | 81 +- deps/npm/node_modules/libnpmorg/package.json | 91 +- deps/npm/node_modules/libnpmorg/test/index.js | 81 - .../node_modules/libnpmorg/test/util/tnock.js | 12 - deps/npm/node_modules/libnpmpack/CHANGELOG.md | 17 + .../{libnpmconfig => libnpmpack}/LICENSE | 0 deps/npm/node_modules/libnpmpack/README.md | 56 + deps/npm/node_modules/libnpmpack/index.js | 48 + deps/npm/node_modules/libnpmpack/package.json | 44 + .../node_modules/libnpmpublish/.travis.yml | 7 - .../node_modules/libnpmpublish/CHANGELOG.md | 36 + .../libnpmpublish/PULL_REQUEST_TEMPLATE | 7 - deps/npm/node_modules/libnpmpublish/README.md | 63 +- .../node_modules/libnpmpublish/appveyor.yml | 22 - .../node_modules/libnpmpublish/package.json | 100 +- .../npm/node_modules/libnpmpublish/publish.js | 249 +- .../libnpmpublish/test/publish.js | 1048 - .../libnpmpublish/test/unpublish.js | 249 - .../libnpmpublish/test/util/mock-tarball.js | 47 - .../libnpmpublish/test/util/tnock.js | 12 - .../node_modules/libnpmpublish/unpublish.js | 158 +- .../npm/node_modules/libnpmsearch/.travis.yml | 7 - .../node_modules/libnpmsearch/CHANGELOG.md | 15 + .../libnpmsearch/PULL_REQUEST_TEMPLATE | 7 - deps/npm/node_modules/libnpmsearch/README.md | 26 +- .../node_modules/libnpmsearch/appveyor.yml | 22 - deps/npm/node_modules/libnpmsearch/index.js | 66 +- .../node_modules/libnpmsearch/package.json | 89 +- .../node_modules/libnpmsearch/test/index.js | 300 - .../libnpmsearch/test/util/tnock.js | 12 - deps/npm/node_modules/libnpmteam/.travis.yml | 7 - deps/npm/node_modules/libnpmteam/CHANGELOG.md | 12 + .../libnpmteam/PULL_REQUEST_TEMPLATE | 7 - deps/npm/node_modules/libnpmteam/README.md | 40 +- deps/npm/node_modules/libnpmteam/appveyor.yml | 22 - deps/npm/node_modules/libnpmteam/index.js | 112 +- deps/npm/node_modules/libnpmteam/package.json | 87 +- .../npm/node_modules/libnpmteam/test/index.js | 138 - .../libnpmteam/test/util/tnock.js | 12 - deps/npm/node_modules/libnpmversion/LICENSE | 15 + deps/npm/node_modules/libnpmversion/README.md | 154 + .../node_modules/libnpmversion/lib/commit.js | 14 + .../libnpmversion/lib/enforce-clean.js | 32 + .../node_modules/libnpmversion/lib/index.js | 39 + .../libnpmversion/lib/proc-log.js | 21 + .../libnpmversion/lib/retrieve-tag.js | 11 + .../npm/node_modules/libnpmversion/lib/tag.js | 20 + .../node_modules/libnpmversion/lib/version.js | 116 + .../libnpmversion/lib/write-json.js | 16 + .../node_modules/libnpmversion/package.json | 37 + deps/npm/node_modules/libnpx/CHANGELOG.md | 825 - deps/npm/node_modules/libnpx/LICENSE.md | 16 - deps/npm/node_modules/libnpx/README.md | 165 - deps/npm/node_modules/libnpx/auto-fallback.js | 69 - deps/npm/node_modules/libnpx/child.js | 86 - deps/npm/node_modules/libnpx/get-prefix.js | 54 - deps/npm/node_modules/libnpx/index.js | 370 - deps/npm/node_modules/libnpx/libnpx.1 | 175 - deps/npm/node_modules/libnpx/locales/ca.json | 28 - deps/npm/node_modules/libnpx/locales/cs.json | 28 - deps/npm/node_modules/libnpx/locales/de.json | 29 - deps/npm/node_modules/libnpx/locales/en.json | 30 - deps/npm/node_modules/libnpx/locales/es.json | 28 - deps/npm/node_modules/libnpx/locales/fr.json | 28 - deps/npm/node_modules/libnpx/locales/id.json | 29 - deps/npm/node_modules/libnpx/locales/it.json | 28 - deps/npm/node_modules/libnpx/locales/ja.json | 28 - deps/npm/node_modules/libnpx/locales/ko.json | 29 - deps/npm/node_modules/libnpx/locales/nb.json | 29 - deps/npm/node_modules/libnpx/locales/nl.json | 29 - deps/npm/node_modules/libnpx/locales/nn.json | 30 - deps/npm/node_modules/libnpx/locales/no.json | 29 - deps/npm/node_modules/libnpx/locales/pl.json | 29 - .../node_modules/libnpx/locales/pt_BR.json | 28 - deps/npm/node_modules/libnpx/locales/ro.json | 28 - deps/npm/node_modules/libnpx/locales/ru.json | 28 - deps/npm/node_modules/libnpx/locales/sr.json | 29 - deps/npm/node_modules/libnpx/locales/tr.json | 28 - deps/npm/node_modules/libnpx/locales/uk.json | 29 - .../node_modules/libnpx/locales/zh_CN.json | 29 - .../node_modules/libnpx/locales/zh_TW.json | 29 - deps/npm/node_modules/libnpx/package.json | 105 - deps/npm/node_modules/libnpx/parse-args.js | 241 - deps/npm/node_modules/libnpx/util.js | 17 - deps/npm/node_modules/libnpx/y.js | 21 - deps/npm/node_modules/lock-verify/LICENSE | 14 - deps/npm/node_modules/lock-verify/README.md | 22 - deps/npm/node_modules/lock-verify/index.js | 81 - .../npm/node_modules/lock-verify/package.json | 62 - deps/npm/node_modules/lockfile/.travis.yml | 11 - deps/npm/node_modules/lockfile/CHANGELOG.md | 109 - deps/npm/node_modules/lockfile/README.md | 86 - .../node_modules/lockfile/gen-changelog.sh | 9 - deps/npm/node_modules/lockfile/lockfile.js | 320 - deps/npm/node_modules/lockfile/package.json | 70 - deps/npm/node_modules/lockfile/sockets.md | 27 - deps/npm/node_modules/lockfile/speedtest.js | 63 - deps/npm/node_modules/lockfile/test/basic.js | 292 - .../lockfile/test/fixtures/bad-child.js | 5 - .../lockfile/test/fixtures/child.js | 3 - .../node_modules/lockfile/test/retry-time.js | 67 - .../lockfile/test/stale-contention.js | 85 - .../lockfile/test/unlock-no-cb.js | 10 - .../lodash._baseindexof/LICENSE.txt | 22 - .../lodash._baseindexof/README.md | 20 - .../node_modules/lodash._baseindexof/index.js | 57 - .../lodash._baseindexof/package.json | 78 - .../npm/node_modules/lodash._baseuniq/LICENSE | 47 - .../node_modules/lodash._baseuniq/README.md | 18 - .../node_modules/lodash._baseuniq/index.js | 801 - .../lodash._baseuniq/package.json | 72 - .../lodash._bindcallback/LICENSE.txt | 22 - .../lodash._bindcallback/README.md | 20 - .../lodash._bindcallback/index.js | 65 - .../lodash._bindcallback/package.json | 78 - .../lodash._cacheindexof/LICENSE.txt | 22 - .../lodash._cacheindexof/README.md | 20 - .../lodash._cacheindexof/index.js | 53 - .../lodash._cacheindexof/package.json | 78 - .../node_modules/lodash._createcache/LICENSE | 22 - .../lodash._createcache/README.md | 20 - .../node_modules/lodash._createcache/index.js | 91 - .../lodash._createcache/package.json | 81 - .../node_modules/lodash._createset/LICENSE | 47 - .../node_modules/lodash._createset/README.md | 18 - .../node_modules/lodash._createset/index.js | 280 - .../lodash._createset/package.json | 65 - .../node_modules/lodash._getnative/LICENSE | 22 - .../node_modules/lodash._getnative/README.md | 20 - .../node_modules/lodash._getnative/index.js | 137 - .../lodash._getnative/package.json | 79 - deps/npm/node_modules/lodash._root/LICENSE | 23 - deps/npm/node_modules/lodash._root/README.md | 18 - deps/npm/node_modules/lodash._root/index.js | 59 - .../node_modules/lodash._root/package.json | 65 - .../lodash.clonedeep/package.json | 77 +- .../node_modules/lodash.restparam/LICENSE.txt | 22 - .../node_modules/lodash.restparam/README.md | 20 - .../node_modules/lodash.restparam/index.js | 67 - .../lodash.restparam/package.json | 84 - deps/npm/node_modules/lodash.union/LICENSE | 47 - deps/npm/node_modules/lodash.union/README.md | 18 - deps/npm/node_modules/lodash.union/index.js | 1181 - .../node_modules/lodash.union/package.json | 72 - deps/npm/node_modules/lodash.uniq/LICENSE | 47 - deps/npm/node_modules/lodash.uniq/README.md | 18 - deps/npm/node_modules/lodash.uniq/index.js | 896 - .../npm/node_modules/lodash.uniq/package.json | 72 - deps/npm/node_modules/lodash.without/LICENSE | 47 - .../npm/node_modules/lodash.without/README.md | 18 - deps/npm/node_modules/lodash.without/index.js | 1051 - .../node_modules/lodash.without/package.json | 72 - deps/npm/node_modules/lowercase-keys/index.js | 11 - deps/npm/node_modules/lowercase-keys/license | 21 - .../node_modules/lowercase-keys/package.json | 67 - .../npm/node_modules/lowercase-keys/readme.md | 33 - deps/npm/node_modules/lru-cache/package.json | 80 +- deps/npm/node_modules/make-dir/index.js | 85 - deps/npm/node_modules/make-dir/license | 9 - deps/npm/node_modules/make-dir/package.json | 86 - deps/npm/node_modules/make-dir/readme.md | 116 - .../make-fetch-happen/CHANGELOG.md | 353 +- .../node_modules/make-fetch-happen/README.md | 30 +- .../node_modules/make-fetch-happen/agent.js | 110 +- .../node_modules/make-fetch-happen/cache.js | 172 +- .../node_modules/make-fetch-happen/index.js | 257 +- .../make-fetch-happen/package.json | 128 +- .../utils/configure-options.js | 33 + .../utils/initialize-cache.js | 26 + .../utils/is-header-conditional.js | 18 + .../utils/iterable-to-object.js | 9 + .../make-fetch-happen/utils/make-policy.js | 19 + .../node_modules/make-fetch-happen/warning.js | 2 +- .../meant/.github/workflows/ci.yml | 20 - deps/npm/node_modules/meant/CHANGELOG.md | 37 - deps/npm/node_modules/meant/LICENSE | 21 - deps/npm/node_modules/meant/README.md | 67 - deps/npm/node_modules/meant/index.js | 49 - deps/npm/node_modules/meant/package.json | 56 - deps/npm/node_modules/meant/test.js | 11 - deps/npm/node_modules/mime-db/HISTORY.md | 62 + deps/npm/node_modules/mime-db/README.md | 36 +- deps/npm/node_modules/mime-db/db.json | 711 +- deps/npm/node_modules/mime-db/package.json | 111 +- deps/npm/node_modules/mime-types/HISTORY.md | 63 + deps/npm/node_modules/mime-types/README.md | 45 +- deps/npm/node_modules/mime-types/package.json | 104 +- deps/npm/node_modules/minimatch/package.json | 73 +- deps/npm/node_modules/minimist/.travis.yml | 8 - deps/npm/node_modules/minimist/LICENSE | 18 - .../node_modules/minimist/example/parse.js | 2 - deps/npm/node_modules/minimist/index.js | 244 - deps/npm/node_modules/minimist/package.json | 73 - .../npm/node_modules/minimist/readme.markdown | 95 - .../node_modules/minimist/test/all_bool.js | 32 - deps/npm/node_modules/minimist/test/bool.js | 178 - deps/npm/node_modules/minimist/test/dash.js | 31 - .../minimist/test/default_bool.js | 35 - deps/npm/node_modules/minimist/test/dotted.js | 22 - .../node_modules/minimist/test/kv_short.js | 16 - deps/npm/node_modules/minimist/test/long.js | 31 - deps/npm/node_modules/minimist/test/num.js | 36 - deps/npm/node_modules/minimist/test/parse.js | 197 - .../minimist/test/parse_modified.js | 9 - deps/npm/node_modules/minimist/test/proto.js | 44 - deps/npm/node_modules/minimist/test/short.js | 67 - .../node_modules/minimist/test/stop_early.js | 15 - .../npm/node_modules/minimist/test/unknown.js | 102 - .../node_modules/minimist/test/whitespace.js | 8 - .../LICENSE | 0 .../node_modules/minipass-collect/README.md | 48 + .../node_modules/minipass-collect/index.js | 71 + .../minipass-collect/package.json | 29 + deps/npm/node_modules/minipass-fetch/LICENSE | 28 + .../npm/node_modules/minipass-fetch/README.md | 29 + deps/npm/node_modules/minipass-fetch/index.js | 1 + .../minipass-fetch/lib/abort-error.js | 17 + .../node_modules/minipass-fetch/lib/blob.js | 97 + .../node_modules/minipass-fetch/lib/body.js | 334 + .../minipass-fetch/lib/fetch-error.js | 31 + .../minipass-fetch/lib/headers.js | 250 + .../node_modules/minipass-fetch/lib/index.js | 320 + .../minipass-fetch/lib/request.js | 258 + .../minipass-fetch/lib/response.js | 89 + .../node_modules/minipass-fetch/package.json | 54 + .../{lockfile => minipass-flush}/LICENSE | 0 .../npm/node_modules/minipass-flush/README.md | 47 + deps/npm/node_modules/minipass-flush/index.js | 39 + .../node_modules/minipass-flush/package.json | 39 + .../node_modules/minipass-json-stream/LICENSE | 27 + .../minipass-json-stream/README.md | 189 + .../minipass-json-stream/index.js | 227 + .../minipass-json-stream/package.json | 39 + .../{proto-list => minipass-pipeline}/LICENSE | 0 .../node_modules/minipass-pipeline/README.md | 69 + .../node_modules/minipass-pipeline/index.js | 128 + .../minipass-pipeline/package.json | 29 + .../node_modules/minipass-sized/.npmignore | 22 + .../{pseudomap => minipass-sized}/LICENSE | 0 .../npm/node_modules/minipass-sized/README.md | 28 + deps/npm/node_modules/minipass-sized/index.js | 67 + .../node_modules/minipass-sized/package.json | 39 + .../node_modules/minipass-sized/test/basic.js | 83 + .../node_modules => }/minipass/LICENSE | 0 deps/npm/node_modules/minipass/README.md | 613 + deps/npm/node_modules/minipass/index.js | 545 + deps/npm/node_modules/minipass/package.json | 39 + deps/npm/node_modules/minizlib/README.md | 7 + deps/npm/node_modules/minizlib/index.js | 34 +- .../minizlib/node_modules/minipass/README.md | 606 - .../minizlib/node_modules/minipass/index.js | 537 - .../node_modules/minipass/package.json | 70 - deps/npm/node_modules/minizlib/package.json | 82 +- .../npm/node_modules/mississippi/changelog.md | 10 - deps/npm/node_modules/mississippi/index.js | 10 - deps/npm/node_modules/mississippi/license | 7 - .../npm/node_modules/mississippi/package.json | 69 - deps/npm/node_modules/mississippi/readme.md | 411 - .../node_modules/mkdirp-infer-owner/LICENSE | 15 + .../node_modules/mkdirp-infer-owner/README.md | 16 + .../node_modules/mkdirp-infer-owner/index.js | 26 + .../mkdirp-infer-owner/package.json | 36 + deps/npm/node_modules/mkdirp/CHANGELOG.md | 15 + deps/npm/node_modules/mkdirp/LICENSE | 4 +- deps/npm/node_modules/mkdirp/README.markdown | 236 +- deps/npm/node_modules/mkdirp/bin/cmd.js | 93 +- deps/npm/node_modules/mkdirp/bin/usage.txt | 12 - deps/npm/node_modules/mkdirp/index.js | 116 +- deps/npm/node_modules/mkdirp/lib/find-made.js | 29 + .../node_modules/mkdirp/lib/mkdirp-manual.js | 64 + .../node_modules/mkdirp/lib/mkdirp-native.js | 39 + deps/npm/node_modules/mkdirp/lib/opts-arg.js | 23 + deps/npm/node_modules/mkdirp/lib/path-arg.js | 29 + .../npm/node_modules/mkdirp/lib/use-native.js | 10 + .../mkdirp/node_modules/minimist/.travis.yml | 8 - .../mkdirp/node_modules/minimist/LICENSE | 18 - .../node_modules/minimist/example/parse.js | 2 - .../mkdirp/node_modules/minimist/index.js | 244 - .../mkdirp/node_modules/minimist/package.json | 73 - .../node_modules/minimist/readme.markdown | 95 - .../node_modules/minimist/test/all_bool.js | 32 - .../mkdirp/node_modules/minimist/test/bool.js | 178 - .../mkdirp/node_modules/minimist/test/dash.js | 31 - .../minimist/test/default_bool.js | 35 - .../node_modules/minimist/test/dotted.js | 22 - .../node_modules/minimist/test/kv_short.js | 16 - .../mkdirp/node_modules/minimist/test/long.js | 31 - .../mkdirp/node_modules/minimist/test/num.js | 36 - .../node_modules/minimist/test/parse.js | 197 - .../minimist/test/parse_modified.js | 9 - .../node_modules/minimist/test/proto.js | 44 - .../node_modules/minimist/test/short.js | 67 - .../node_modules/minimist/test/stop_early.js | 15 - .../node_modules/minimist/test/unknown.js | 102 - .../node_modules/minimist/test/whitespace.js | 8 - deps/npm/node_modules/mkdirp/package.json | 105 +- .../node_modules/move-concurrently/LICENSE | 14 - .../node_modules/move-concurrently/README.md | 53 - .../node_modules/move-concurrently/move.js | 84 - .../node_modules/aproba/LICENSE | 14 - .../node_modules/aproba/README.md | 94 - .../node_modules/aproba/index.js | 105 - .../node_modules/aproba/package.json | 62 - .../move-concurrently/package.json | 77 - deps/npm/node_modules/ms/index.js | 4 +- deps/npm/node_modules/ms/package.json | 70 +- deps/npm/node_modules/ms/readme.md | 2 +- deps/npm/node_modules/mute-stream/.travis.yml | 9 - .../coverage/lcov-report/__root__/index.html | 93 - .../lcov-report/__root__/mute.js.html | 500 - .../mute-stream/coverage/lcov-report/base.css | 212 - .../coverage/lcov-report/index.html | 93 - .../coverage/lcov-report/prettify.css | 1 - .../coverage/lcov-report/prettify.js | 1 - .../lcov-report/sort-arrow-sprite.png | Bin 209 -> 0 bytes .../coverage/lcov-report/sorter.js | 158 - .../mute-stream/coverage/lcov.info | 155 - .../npm/node_modules/mute-stream/package.json | 65 +- .../node_modules/mute-stream/test/basic.js | 207 - .../node_modules/node-fetch-npm/CHANGELOG.md | 252 - .../node_modules/node-fetch-npm/LICENSE.md | 22 - .../npm/node_modules/node-fetch-npm/README.md | 398 - .../node_modules/node-fetch-npm/package.json | 102 - .../node_modules/node-fetch-npm/src/blob.js | 109 - .../node_modules/node-fetch-npm/src/body.js | 411 - .../node_modules/node-fetch-npm/src/common.js | 92 - .../node-fetch-npm/src/fetch-error.js | 35 - .../node-fetch-npm/src/headers.js | 296 - .../node_modules/node-fetch-npm/src/index.js | 214 - .../node-fetch-npm/src/request.js | 174 - .../node-fetch-npm/src/response.js | 71 - .../node-gyp/.github/ISSUE_TEMPLATE.md | 32 +- .../.github/workflows/Python_tests.yml | 2 +- deps/npm/node_modules/node-gyp/.travis.yml | 17 +- deps/npm/node_modules/node-gyp/CHANGELOG.md | 101 + .../npm/node_modules/node-gyp/CONTRIBUTING.md | 34 + deps/npm/node_modules/node-gyp/README.md | 15 +- deps/npm/node_modules/node-gyp/addon.gypi | 23 +- .../npm/node_modules/node-gyp/bin/node-gyp.js | 5 +- deps/npm/node_modules/node-gyp/gyp/.flake8 | 4 + .../gyp/.github/workflows/Python_tests.yml | 31 + .../gyp/.github/workflows/nodejs-windows.yml | 27 + deps/npm/node_modules/node-gyp/gyp/AUTHORS | 3 + .../node_modules/node-gyp/gyp/CHANGELOG.md | 41 + .../node-gyp/gyp/CODE_OF_CONDUCT.md | 4 + .../node_modules/node-gyp/gyp/CONTRIBUTING.md | 32 + deps/npm/node_modules/node-gyp/gyp/DEPS | 24 - deps/npm/node_modules/node-gyp/gyp/LICENSE | 1 + deps/npm/node_modules/node-gyp/gyp/OWNERS | 1 - .../node_modules/node-gyp/gyp/PRESUBMIT.py | 138 - deps/npm/node_modules/node-gyp/gyp/README.md | 4 + .../node-gyp/gyp/codereview.settings | 10 - deps/npm/node_modules/node-gyp/gyp/gyp.bat | 0 .../npm/node_modules/node-gyp/gyp/gyp_main.py | 55 +- .../node-gyp/gyp/pylib/gyp/MSVSNew.py | 514 +- .../node-gyp/gyp/pylib/gyp/MSVSProject.py | 226 +- .../node-gyp/gyp/pylib/gyp/MSVSSettings.py | 1604 +- .../gyp/pylib/gyp/MSVSSettings_test.py | 2888 +- .../node-gyp/gyp/pylib/gyp/MSVSToolFile.py | 65 +- .../node-gyp/gyp/pylib/gyp/MSVSUserFile.py | 212 +- .../node-gyp/gyp/pylib/gyp/MSVSUtil.py | 349 +- .../node-gyp/gyp/pylib/gyp/MSVSVersion.py | 802 +- .../node-gyp/gyp/pylib/gyp/__init__.py | 1054 +- .../node-gyp/gyp/pylib/gyp/common.py | 839 +- .../node-gyp/gyp/pylib/gyp/common_test.py | 98 +- .../node-gyp/gyp/pylib/gyp/easy_xml.py | 174 +- .../node-gyp/gyp/pylib/gyp/easy_xml_test.py | 182 +- .../node-gyp/gyp/pylib/gyp/flock_tool.py | 71 +- .../gyp/pylib/gyp/generator/analyzer.py | 1112 +- .../gyp/pylib/gyp/generator/android.py | 1847 +- .../node-gyp/gyp/pylib/gyp/generator/cmake.py | 2129 +- .../gyp/generator/compile_commands_json.py | 167 +- .../gyp/generator/dump_dependency_json.py | 156 +- .../gyp/pylib/gyp/generator/eclipse.py | 733 +- .../node-gyp/gyp/pylib/gyp/generator/gypd.py | 73 +- .../node-gyp/gyp/pylib/gyp/generator/gypsh.py | 54 +- .../node-gyp/gyp/pylib/gyp/generator/make.py | 3511 +- .../node-gyp/gyp/pylib/gyp/generator/msvs.py | 5840 +- .../gyp/pylib/gyp/generator/msvs_test.py | 57 +- .../node-gyp/gyp/pylib/gyp/generator/ninja.py | 4926 +- .../gyp/pylib/gyp/generator/ninja_test.py | 76 +- .../node-gyp/gyp/pylib/gyp/generator/xcode.py | 2469 +- .../gyp/pylib/gyp/generator/xcode_test.py | 16 +- .../node-gyp/gyp/pylib/gyp/input.py | 5207 +- .../node-gyp/gyp/pylib/gyp/input_test.py | 162 +- .../node-gyp/gyp/pylib/gyp/mac_tool.py | 1090 +- .../node-gyp/gyp/pylib/gyp/msvs_emulation.py | 2001 +- .../node-gyp/gyp/pylib/gyp/ninja_syntax.py | 122 +- .../node-gyp/gyp/pylib/gyp/simple_copy.py | 46 +- .../node-gyp/gyp/pylib/gyp/win_tool.py | 618 +- .../node-gyp/gyp/pylib/gyp/xcode_emulation.py | 2996 +- .../node-gyp/gyp/pylib/gyp/xcode_ninja.py | 482 +- .../node-gyp/gyp/pylib/gyp/xcodeproj_file.py | 4682 +- .../node-gyp/gyp/pylib/gyp/xml_fix.py | 80 +- .../node-gyp/gyp/requirements_dev.txt | 2 + .../node_modules/node-gyp/gyp/samples/samples | 81 - .../node-gyp/gyp/samples/samples.bat | 5 - deps/npm/node_modules/node-gyp/gyp/setup.py | 43 +- .../npm/node_modules/node-gyp/gyp/test_gyp.py | 268 + .../node-gyp/gyp/tools/graphviz.py | 131 +- .../node-gyp/gyp/tools/pretty_gyp.py | 182 +- .../node-gyp/gyp/tools/pretty_sln.py | 267 +- .../node-gyp/gyp/tools/pretty_vcproj.py | 528 +- .../node_modules/node-gyp/lib/configure.js | 4 +- .../node_modules/node-gyp/lib/find-python.js | 39 +- deps/npm/node_modules/node-gyp/lib/install.js | 5 +- .../node_modules/node-gyp/macOS_Catalina.md | 56 +- .../node-gyp/macOS_Catalina_acid_test.sh | 21 + .../node-gyp/node_modules/nopt/CHANGELOG.md | 58 + .../node_modules/nopt}/LICENSE | 0 .../node-gyp/node_modules/nopt/README.md | 213 + .../node-gyp/node_modules/nopt/bin/nopt.js | 54 + .../node-gyp/node_modules/nopt/lib/nopt.js | 441 + .../node-gyp/node_modules/nopt/package.json | 30 + .../node-gyp/node_modules/rimraf/LICENSE | 15 + .../node-gyp/node_modules/rimraf/README.md | 101 + .../node-gyp/node_modules/rimraf/bin.js | 50 + .../node-gyp/node_modules/rimraf/package.json | 29 + .../node-gyp/node_modules/rimraf/rimraf.js | 372 + deps/npm/node_modules/node-gyp/package.json | 100 +- .../node-gyp/test/test-configure-python.js | 3 +- .../node-gyp/test/test-find-python.js | 18 +- deps/npm/node_modules/node-gyp/update-gyp.py | 45 + deps/npm/node_modules/nopt/lib/nopt.js | 4 +- deps/npm/node_modules/nopt/package.json | 69 +- .../node_modules/hosted-git-info/CHANGELOG.md | 141 + .../node_modules/hosted-git-info/LICENSE | 13 + .../node_modules/hosted-git-info/README.md | 133 + .../hosted-git-info/git-host-info.js | 79 + .../node_modules/hosted-git-info/git-host.js | 156 + .../node_modules/hosted-git-info/index.js | 148 + .../node_modules/hosted-git-info/package.json | 40 + .../node_modules/resolve/.editorconfig | 20 - .../node_modules/resolve/.travis.yml | 269 - .../node_modules/resolve/CHANGELOG.md | 629 - .../node_modules/resolve/LICENSE | 18 - .../node_modules/resolve/appveyor.yml | 47 - .../node_modules/resolve/changelog.hbs | 36 - .../node_modules/resolve/index.js | 8 - .../node_modules/resolve/lib/async.js | 229 - .../node_modules/resolve/lib/core.json | 73 - .../resolve/lib/node-modules-paths.js | 42 - .../node_modules/resolve/lib/sync.js | 154 - .../node_modules/resolve/package.json | 71 - .../node_modules/resolve/readme.markdown | 179 - .../node_modules/resolve/test/core.js | 82 - .../node_modules/resolve/test/filter.js | 34 - .../node_modules/resolve/test/filter_sync.js | 26 - .../node_modules/resolve/test/mock.js | 143 - .../node_modules/resolve/test/mock_sync.js | 67 - .../resolve/test/node-modules-paths.js | 121 - .../resolve/test/resolver/baz/package.json | 3 - .../resolve/test/resolver/cup.coffee | 1 - .../node_modules/resolve/test/symlinks.js | 56 - .../node_modules/semver/CHANGELOG.md | 39 + .../node_modules/semver/LICENSE | 15 + .../node_modules/semver/README.md | 412 + .../node_modules/semver/bin/semver | 160 + .../node_modules/semver/package.json | 28 + .../node_modules/semver/range.bnf | 16 + .../node_modules/semver/semver.js | 1483 + .../normalize-package-data/package.json | 77 +- .../node_modules/npm-audit-report/README.md | 47 +- .../node_modules/npm-audit-report/index.js | 25 - .../npm-audit-report/lib/colors.js | 24 + .../npm-audit-report/lib/exit-code.js | 14 + .../npm-audit-report/lib/index.js | 37 + .../npm-audit-report/lib/reporters/detail.js | 84 + .../npm-audit-report/lib/reporters/install.js | 75 + .../npm-audit-report/lib/reporters/json.js | 1 + .../npm-audit-report/lib/reporters/quiet.js | 1 + .../npm-audit-report/lib/utils.js | 60 - .../npm-audit-report/package.json | 94 +- .../npm-audit-report/reporters/detail.js | 197 - .../npm-audit-report/reporters/install.js | 61 - .../npm-audit-report/reporters/json.js | 17 - .../npm-audit-report/reporters/parseable.js | 99 - .../npm-audit-report/reporters/quiet.js | 14 - .../npm/node_modules/npm-bundled/package.json | 69 +- .../node_modules/npm-cache-filename/README.md | 21 - .../node_modules/npm-cache-filename/index.js | 24 - .../npm-cache-filename/package.json | 55 - .../node_modules/npm-cache-filename/test.js | 23 - .../npm-install-checks/CHANGELOG.md | 12 +- .../node_modules/npm-install-checks/README.md | 30 +- .../node_modules/npm-install-checks/index.js | 174 +- .../npm-install-checks/package.json | 75 +- .../node_modules/npm-lifecycle/CHANGELOG.md | 189 - deps/npm/node_modules/npm-lifecycle/LICENSE | 235 - deps/npm/node_modules/npm-lifecycle/README.md | 49 - deps/npm/node_modules/npm-lifecycle/index.js | 497 - .../node_modules/npm-lifecycle/lib/spawn.js | 65 - .../npm-lifecycle/node-gyp-bin/node-gyp | 6 - .../npm-lifecycle/node-gyp-bin/node-gyp.cmd | 5 - .../node_modules/npm-lifecycle/package.json | 82 - .../npm-logical-tree/CHANGELOG.md | 46 - .../node_modules/npm-logical-tree/LICENSE.md | 16 - .../node_modules/npm-logical-tree/README.md | 147 - .../node_modules/npm-logical-tree/index.js | 192 - .../npm-logical-tree/package.json | 83 - .../package-lock.json | 3529 -- .../npm-normalize-package-bin/package.json | 58 +- .../node_modules/npm-package-arg/CHANGELOG.md | 28 +- deps/npm/node_modules/npm-package-arg/LICENSE | 2 +- deps/npm/node_modules/npm-package-arg/npa.js | 10 +- .../node_modules/npm-package-arg/package.json | 96 +- deps/npm/node_modules/npm-packlist/README.md | 80 +- .../node_modules/npm-packlist/bin/index.js | 24 + deps/npm/node_modules/npm-packlist/index.js | 260 +- .../node_modules/npm-packlist/package.json | 93 +- .../npm-pick-manifest/CHANGELOG.md | 54 +- .../node_modules/npm-pick-manifest/README.md | 127 +- .../node_modules/npm-pick-manifest/index.js | 300 +- .../npm-pick-manifest/package.json | 100 +- .../npm/node_modules/npm-profile/CHANGELOG.md | 17 + deps/npm/node_modules/npm-profile/README.md | 25 +- deps/npm/node_modules/npm-profile/index.js | 182 +- .../npm/node_modules/npm-profile/package.json | 79 +- .../npm-registry-fetch/CHANGELOG.md | 127 +- .../node_modules/npm-registry-fetch/README.md | 75 +- .../node_modules/npm-registry-fetch/auth.js | 18 +- .../npm-registry-fetch/check-response.js | 36 +- .../node_modules/npm-registry-fetch/config.js | 98 - .../npm-registry-fetch/default-opts.js | 22 + .../node_modules/npm-registry-fetch/errors.js | 2 +- .../node_modules/npm-registry-fetch/index.js | 193 +- .../node_modules/safe-buffer/README.md | 584 - .../node_modules/safe-buffer/index.d.ts | 187 - .../node_modules/safe-buffer/index.js | 65 - .../node_modules/safe-buffer/package.json | 76 - .../npm-registry-fetch/package.json | 137 +- deps/npm/node_modules/npm-run-path/index.js | 39 - deps/npm/node_modules/npm-run-path/license | 21 - .../node_modules/npm-run-path/package.json | 77 - deps/npm/node_modules/npm-run-path/readme.md | 81 - .../npm-user-validate/package.json | 65 +- deps/npm/node_modules/npmlog/package.json | 64 +- .../node_modules/number-is-nan/package.json | 58 +- deps/npm/node_modules/oauth-sign/package.json | 57 +- .../node_modules/object-assign/package.json | 67 +- .../node_modules/object-keys/.editorconfig | 13 - deps/npm/node_modules/object-keys/.jscs.json | 175 - deps/npm/node_modules/object-keys/.travis.yml | 225 - .../npm/node_modules/object-keys/CHANGELOG.md | 220 - deps/npm/node_modules/object-keys/LICENSE | 21 - deps/npm/node_modules/object-keys/README.md | 76 - deps/npm/node_modules/object-keys/index.js | 141 - .../node_modules/object-keys/isArguments.js | 17 - .../npm/node_modules/object-keys/package.json | 94 - .../node_modules/object-keys/test/index.js | 5 - .../.editorconfig | 13 - .../.jscs.json | 176 - .../.npmignore | 28 - .../.travis.yml | 96 - .../CHANGELOG.md | 51 - .../object.getownpropertydescriptors/LICENSE | 22 - .../object.getownpropertydescriptors/Makefile | 61 - .../README.md | 99 - .../implementation.js | 44 - .../object.getownpropertydescriptors/index.js | 15 - .../package.json | 107 - .../polyfill.js | 7 - .../object.getownpropertydescriptors/shim.js | 14 - .../test/index.js | 17 - .../test/shimmed.js | 35 - .../test/tests.js | 127 - deps/npm/node_modules/once/package.json | 75 +- deps/npm/node_modules/opener/LICENSE.txt | 4 +- deps/npm/node_modules/opener/README.md | 3 +- deps/npm/node_modules/opener/lib/opener.js | 4 +- deps/npm/node_modules/opener/package.json | 74 +- deps/npm/node_modules/os-homedir/package.json | 59 +- deps/npm/node_modules/os-tmpdir/package.json | 57 +- deps/npm/node_modules/osenv/package.json | 75 +- deps/npm/node_modules/p-finally/index.js | 15 - deps/npm/node_modules/p-finally/license | 21 - deps/npm/node_modules/p-finally/package.json | 74 - deps/npm/node_modules/p-finally/readme.md | 47 - deps/npm/node_modules/p-map/index.d.ts | 67 + deps/npm/node_modules/p-map/index.js | 81 + deps/npm/node_modules/p-map/license | 9 + deps/npm/node_modules/p-map/package.json | 53 + deps/npm/node_modules/p-map/readme.md | 89 + deps/npm/node_modules/package-json/index.js | 67 - deps/npm/node_modules/package-json/license | 21 - .../node_modules/package-json/package.json | 75 - deps/npm/node_modules/package-json/readme.md | 91 - deps/npm/node_modules/pacote/CHANGELOG.md | 1417 - deps/npm/node_modules/pacote/LICENSE | 30 +- deps/npm/node_modules/pacote/README.md | 462 +- deps/npm/node_modules/pacote/extract.js | 99 - deps/npm/node_modules/pacote/index.js | 10 - deps/npm/node_modules/pacote/lib/bin.js | 149 + deps/npm/node_modules/pacote/lib/dir.js | 105 + .../node_modules/pacote/lib/extract-stream.js | 89 - deps/npm/node_modules/pacote/lib/fetch.js | 82 - deps/npm/node_modules/pacote/lib/fetcher.js | 470 + .../node_modules/pacote/lib/fetchers/alias.js | 24 - .../pacote/lib/fetchers/directory.js | 89 - .../node_modules/pacote/lib/fetchers/file.js | 78 - .../node_modules/pacote/lib/fetchers/git.js | 178 - .../pacote/lib/fetchers/hosted.js | 3 - .../node_modules/pacote/lib/fetchers/range.js | 3 - .../pacote/lib/fetchers/registry/index.js | 32 - .../pacote/lib/fetchers/registry/manifest.js | 81 - .../pacote/lib/fetchers/registry/packument.js | 92 - .../pacote/lib/fetchers/registry/tarball.js | 102 - .../pacote/lib/fetchers/remote.js | 34 - .../node_modules/pacote/lib/fetchers/tag.js | 3 - .../pacote/lib/fetchers/version.js | 3 - deps/npm/node_modules/pacote/lib/file.js | 93 + .../pacote/lib/finalize-manifest.js | 248 - deps/npm/node_modules/pacote/lib/git.js | 272 + deps/npm/node_modules/pacote/lib/index.js | 12 + deps/npm/node_modules/pacote/lib/registry.js | 159 + deps/npm/node_modules/pacote/lib/remote.js | 77 + .../node_modules/pacote/lib/util/cache-dir.js | 12 + .../node_modules/pacote/lib/util/cache-key.js | 6 - .../node_modules/pacote/lib/util/finished.js | 17 - deps/npm/node_modules/pacote/lib/util/git.js | 292 - .../pacote/lib/util/is-package-bin.js | 24 + deps/npm/node_modules/pacote/lib/util/npm.js | 9 + .../node_modules/pacote/lib/util/opt-check.js | 48 - .../node_modules/pacote/lib/util/pack-dir.js | 44 - .../node_modules/pacote/lib/util/proc-log.js | 21 + .../node_modules/pacote/lib/util/proclog.js | 23 - .../node_modules/pacote/lib/util/read-json.js | 15 - .../pacote/lib/with-tarball-stream.js | 135 - deps/npm/node_modules/pacote/manifest.js | 38 - .../pacote/node_modules/minipass/README.md | 606 - .../pacote/node_modules/minipass/index.js | 537 - .../pacote/node_modules/minipass/package.json | 70 - deps/npm/node_modules/pacote/package.json | 160 +- deps/npm/node_modules/pacote/packument.js | 29 - deps/npm/node_modules/pacote/prefetch.js | 64 - deps/npm/node_modules/pacote/tarball.js | 67 - .../parallel-transform/.npmignore | 1 - .../node_modules/parallel-transform/LICENSE | 20 - .../node_modules/parallel-transform/README.md | 54 - .../node_modules/parallel-transform/index.js | 105 - .../node_modules/readable-stream/.travis.yml | 55 - .../readable-stream/GOVERNANCE.md | 136 - .../node_modules/readable-stream/LICENSE | 47 - .../node_modules/readable-stream/README.md | 58 - .../doc/wg-meetings/2015-01-30.md | 60 - .../readable-stream/duplex-browser.js | 1 - .../node_modules/readable-stream/duplex.js | 1 - .../readable-stream/lib/_stream_duplex.js | 131 - .../lib/_stream_passthrough.js | 47 - .../readable-stream/lib/_stream_readable.js | 1019 - .../readable-stream/lib/_stream_transform.js | 214 - .../readable-stream/lib/_stream_writable.js | 687 - .../lib/internal/streams/BufferList.js | 79 - .../lib/internal/streams/destroy.js | 74 - .../lib/internal/streams/stream-browser.js | 1 - .../lib/internal/streams/stream.js | 1 - .../node_modules/readable-stream/package.json | 81 - .../readable-stream/passthrough.js | 1 - .../readable-stream/readable-browser.js | 7 - .../node_modules/readable-stream/readable.js | 19 - .../node_modules/readable-stream/transform.js | 1 - .../readable-stream/writable-browser.js | 1 - .../node_modules/readable-stream/writable.js | 8 - .../node_modules/string_decoder/.travis.yml | 50 - .../node_modules/string_decoder/LICENSE | 48 - .../node_modules/string_decoder/README.md | 47 - .../string_decoder/lib/string_decoder.js | 296 - .../node_modules/string_decoder/package.json | 59 - .../parallel-transform/package.json | 58 - .../minipass => parse-conflict-json}/LICENSE | 0 .../parse-conflict-json/README.md | 42 + .../node_modules/parse-conflict-json/index.js | 92 + .../parse-conflict-json/package.json | 32 + deps/npm/node_modules/path-exists/index.js | 17 - deps/npm/node_modules/path-exists/license | 21 - .../npm/node_modules/path-exists/package.json | 72 - deps/npm/node_modules/path-exists/readme.md | 50 - .../path-is-absolute/package.json | 54 +- .../node_modules/path-is-inside/LICENSE.txt | 47 - .../path-is-inside/lib/path-is-inside.js | 28 - .../node_modules/path-is-inside/package.json | 70 - deps/npm/node_modules/path-key/index.js | 13 - deps/npm/node_modules/path-key/license | 21 - deps/npm/node_modules/path-key/package.json | 71 - deps/npm/node_modules/path-key/readme.md | 51 - deps/npm/node_modules/path-parse/package.json | 58 +- .../node_modules/performance-now/package.json | 62 +- deps/npm/node_modules/pify/index.js | 84 - deps/npm/node_modules/pify/license | 9 - deps/npm/node_modules/pify/package.json | 84 - deps/npm/node_modules/pify/readme.md | 131 - deps/npm/node_modules/prepend-http/index.js | 14 - deps/npm/node_modules/prepend-http/license | 21 - .../node_modules/prepend-http/package.json | 67 - deps/npm/node_modules/prepend-http/readme.md | 31 - .../process-nextick-args/index.js | 3 +- .../process-nextick-args/package.json | 55 +- .../.github/FUNDING.yml | 3 + .../promise-all-reject-late/.npmignore | 24 + .../promise-all-reject-late/LICENSE | 15 + .../promise-all-reject-late/README.md | 40 + .../promise-all-reject-late/index.js | 27 + .../promise-all-reject-late/package.json | 22 + .../promise-all-reject-late/test/index.js | 88 + .../node_modules/promise-call-limit/LICENSE | 15 + .../node_modules/promise-call-limit/README.md | 30 + .../node_modules/promise-call-limit/index.js | 43 + .../promise-call-limit/package.json | 29 + .../promise-inflight/package.json | 60 +- .../node_modules/retry/.npmignore | 2 - .../promise-retry/node_modules/retry/License | 21 - .../promise-retry/node_modules/retry/Makefile | 22 - .../node_modules/retry/README.md | 215 - .../node_modules/retry/equation.gif | Bin 1209 -> 0 bytes .../node_modules/retry/example/dns.js | 31 - .../node_modules/retry/example/stop.js | 40 - .../promise-retry/node_modules/retry/index.js | 1 - .../node_modules/retry/lib/retry.js | 99 - .../node_modules/retry/lib/retry_operation.js | 143 - .../node_modules/retry/package.json | 56 - .../node_modules/retry/test/common.js | 10 - .../retry/test/integration/test-forever.js | 24 - .../test/integration/test-retry-operation.js | 176 - .../retry/test/integration/test-retry-wrap.js | 77 - .../retry/test/integration/test-timeouts.js | 69 - .../node_modules/promise-retry/package.json | 73 +- deps/npm/node_modules/promzard/package.json | 47 +- deps/npm/node_modules/proto-list/README.md | 3 - deps/npm/node_modules/proto-list/package.json | 51 - .../npm/node_modules/proto-list/proto-list.js | 88 - .../npm/node_modules/proto-list/test/basic.js | 61 - deps/npm/node_modules/protoduck/CHANGELOG.md | 66 - deps/npm/node_modules/protoduck/LICENSE | 21 - deps/npm/node_modules/protoduck/README.md | 346 - deps/npm/node_modules/protoduck/index.js | 349 - deps/npm/node_modules/protoduck/package.json | 88 - deps/npm/node_modules/prr/.npmignore | 1 - deps/npm/node_modules/prr/.travis.yml | 10 - deps/npm/node_modules/prr/LICENSE.md | 11 - deps/npm/node_modules/prr/README.md | 47 - deps/npm/node_modules/prr/package.json | 58 - deps/npm/node_modules/prr/prr.js | 63 - deps/npm/node_modules/prr/test.js | 169 - deps/npm/node_modules/pseudomap/README.md | 60 - deps/npm/node_modules/pseudomap/map.js | 9 - deps/npm/node_modules/pseudomap/package.json | 54 - deps/npm/node_modules/pseudomap/pseudomap.js | 113 - deps/npm/node_modules/pseudomap/test/basic.js | 86 - deps/npm/node_modules/psl/.eslintignore | 1 - deps/npm/node_modules/psl/.travis.yml | 6 - deps/npm/node_modules/psl/LICENSE | 9 + deps/npm/node_modules/psl/README.md | 10 +- .../node_modules/psl/browserstack-logo.svg | 90 + deps/npm/node_modules/psl/data/rules.json | 8835 ++- deps/npm/node_modules/psl/dist/psl.js | 8835 ++- deps/npm/node_modules/psl/dist/psl.min.js | 2 +- deps/npm/node_modules/psl/karma.conf.js | 38 - deps/npm/node_modules/psl/package.json | 95 +- deps/npm/node_modules/psl/yarn.lock | 4532 -- deps/npm/node_modules/pump/.travis.yml | 5 - deps/npm/node_modules/pump/LICENSE | 21 - deps/npm/node_modules/pump/README.md | 65 - deps/npm/node_modules/pump/index.js | 82 - deps/npm/node_modules/pump/package.json | 59 - deps/npm/node_modules/pump/test-browser.js | 66 - deps/npm/node_modules/pump/test-node.js | 53 - deps/npm/node_modules/pumpify/.travis.yml | 8 - deps/npm/node_modules/pumpify/LICENSE | 21 - deps/npm/node_modules/pumpify/README.md | 56 - deps/npm/node_modules/pumpify/index.js | 60 - .../pumpify/node_modules/pump/.travis.yml | 5 - .../pumpify/node_modules/pump/LICENSE | 21 - .../pumpify/node_modules/pump/README.md | 56 - .../pumpify/node_modules/pump/index.js | 82 - .../pumpify/node_modules/pump/package.json | 59 - .../pumpify/node_modules/pump/test-browser.js | 62 - .../pumpify/node_modules/pump/test-node.js | 53 - deps/npm/node_modules/pumpify/package.json | 70 - deps/npm/node_modules/pumpify/test.js | 235 - deps/npm/node_modules/punycode/README.md | 72 +- deps/npm/node_modules/punycode/package.json | 98 +- .../npm/node_modules/punycode/punycode.es6.js | 441 + deps/npm/node_modules/punycode/punycode.js | 863 +- .../node_modules/qrcode-terminal/package.json | 95 +- deps/npm/node_modules/qs/package.json | 126 +- deps/npm/node_modules/query-string/index.d.ts | 208 - deps/npm/node_modules/query-string/index.js | 278 - deps/npm/node_modules/query-string/license | 9 - .../node_modules/query-string/package.json | 82 - deps/npm/node_modules/query-string/readme.md | 278 - deps/npm/node_modules/qw/LICENSE | 14 - deps/npm/node_modules/qw/README.md | 35 - deps/npm/node_modules/qw/package.json | 62 - deps/npm/node_modules/qw/qw.js | 43 - deps/npm/node_modules/rc/LICENSE.APACHE2 | 15 - deps/npm/node_modules/rc/LICENSE.BSD | 26 - deps/npm/node_modules/rc/LICENSE.MIT | 24 - deps/npm/node_modules/rc/README.md | 227 - deps/npm/node_modules/rc/browser.js | 7 - deps/npm/node_modules/rc/cli.js | 4 - deps/npm/node_modules/rc/index.js | 53 - deps/npm/node_modules/rc/lib/utils.js | 104 - deps/npm/node_modules/rc/package.json | 65 - deps/npm/node_modules/rc/test/ini.js | 16 - .../node_modules/rc/test/nested-env-vars.js | 50 - deps/npm/node_modules/rc/test/test.js | 59 - deps/npm/node_modules/read-cmd-shim/README.md | 11 +- deps/npm/node_modules/read-cmd-shim/index.js | 54 +- .../node_modules/read-cmd-shim/package.json | 74 +- .../node_modules/read-installed/.npmignore | 13 - .../node_modules/read-installed/.travis.yml | 9 - deps/npm/node_modules/read-installed/LICENSE | 16 - .../npm/node_modules/read-installed/README.md | 27 - .../node_modules/read-installed/package.json | 68 - .../read-installed/read-installed.js | 407 - .../node_modules/read-installed/test/basic.js | 46 - .../test/cyclic-extraneous-peer-deps.js | 81 - .../read-installed/test/depth-0.js | 27 - .../read-installed/test/depth-1.js | 23 - .../node_modules/read-installed/test/dev.js | 23 - .../node_modules/read-installed/test/empty.js | 16 - .../read-installed/test/extraneous-dev.js | 20 - .../read-installed/test/extraneous.js | 17 - .../fixtures/extraneous-detected/package.json | 7 - .../fixtures/extraneous-dev-dep/package.json | 7 - .../grandparent-peer-dev/package.json | 8 - .../fixtures/grandparent-peer/package.json | 8 - .../read-installed/test/fixtures/package.json | 27 - .../test/grandparent-peer-dev.js | 20 - .../read-installed/test/grandparent-peer.js | 24 - .../read-installed/test/issue-40.js | 15 - .../test/linked-dep-dev-deps-extraneous.js | 59 - .../read-installed/test/noargs.js | 21 - .../read-installed/test/peer-dep-at-latest.js | 14 - .../LICENSE | 0 .../read-package-json-fast/README.md | 79 + .../read-package-json-fast/index.js | 82 + .../read-package-json-fast/package.json | 31 + .../read-package-json/CHANGELOG.md | 10 + .../read-package-json/package.json | 79 +- .../read-package-json/read-json.js | 9 +- .../node_modules/read-package-tree/README.md | 73 - .../read-package-tree/package.json | 75 - .../npm/node_modules/read-package-tree/rpt.js | 169 - deps/npm/node_modules/read/package.json | 56 +- .../node_modules/readable-stream/.travis.yml | 34 + .../readable-stream/CONTRIBUTING.md | 38 + .../node_modules/readable-stream/README.md | 74 +- .../doc/wg-meetings/2015-01-30.md | 58 + .../readable-stream/duplex-browser.js | 0 .../readable-stream/duplex.js | 0 .../readable-stream/errors-browser.js | 127 - .../node_modules/readable-stream/errors.js | 116 - .../readable-stream/experimentalWarning.js | 17 - .../readable-stream/lib/_stream_duplex.js | 96 +- .../lib/_stream_passthrough.js | 10 +- .../readable-stream/lib/_stream_readable.js | 787 +- .../readable-stream/lib/_stream_transform.js | 71 +- .../readable-stream/lib/_stream_writable.js | 390 +- .../lib/internal/streams/BufferList.js | 0 .../lib/internal/streams/async_iterator.js | 207 - .../lib/internal/streams/buffer_list.js | 210 - .../lib/internal/streams/destroy.js | 65 +- .../lib/internal/streams/end-of-stream.js | 104 - .../lib/internal/streams/from-browser.js | 3 - .../lib/internal/streams/from.js | 64 - .../lib/internal/streams/pipeline.js | 97 - .../lib/internal/streams/state.js | 27 - .../node_modules/readable-stream/package.json | 116 +- .../readable-stream/passthrough.js | 0 .../readable-stream/readable-browser.js | 2 - .../node_modules/readable-stream/readable.js | 13 +- .../readable-stream/transform.js | 0 .../readable-stream/writable-browser.js | 0 .../readable-stream/writable.js | 0 .../readdir-scoped-modules/package.json | 67 +- .../registry-auth-token/.npmignore | 6 - .../registry-auth-token/CHANGELOG.md | 112 - .../node_modules/registry-auth-token/LICENSE | 21 - .../registry-auth-token/README.md | 65 - .../registry-auth-token/base64.js | 14 - .../node_modules/registry-auth-token/index.js | 123 - .../registry-auth-token/package.json | 74 - .../registry-auth-token/registry-url.js | 5 - .../test/auth-token.test.js | 455 - .../test/registry-url.test.js | 64 - .../registry-auth-token/yarn.lock | 1516 - deps/npm/node_modules/registry-url/index.js | 6 - deps/npm/node_modules/registry-url/license | 21 - .../node_modules/registry-url/package.json | 72 - deps/npm/node_modules/registry-url/readme.md | 50 - deps/npm/node_modules/request/CHANGELOG.md | 8 + deps/npm/node_modules/request/README.md | 126 +- deps/npm/node_modules/request/index.js | 2 +- deps/npm/node_modules/request/lib/auth.js | 2 +- .../request/lib/getProxyFromURI.js | 2 +- deps/npm/node_modules/request/lib/har.js | 2 +- .../{ => request/node_modules}/uuid/AUTHORS | 0 .../request/node_modules/uuid/CHANGELOG.md | 119 + .../request/node_modules/uuid/LICENSE.md | 21 + .../request/node_modules/uuid/README.md | 276 + .../{ => request/node_modules}/uuid/bin/uuid | 0 .../{ => request/node_modules}/uuid/index.js | 0 .../node_modules/uuid/lib/bytesToUuid.js | 26 + .../node_modules}/uuid/lib/md5-browser.js | 0 .../node_modules}/uuid/lib/md5.js | 0 .../node_modules}/uuid/lib/rng-browser.js | 0 .../node_modules}/uuid/lib/rng.js | 0 .../node_modules}/uuid/lib/sha1-browser.js | 0 .../node_modules}/uuid/lib/sha1.js | 0 .../node_modules}/uuid/lib/v35.js | 0 .../request/node_modules/uuid/package.json | 49 + .../request/node_modules/uuid/v1.js | 109 + .../{ => request/node_modules}/uuid/v3.js | 0 .../{ => request/node_modules}/uuid/v4.js | 0 .../{ => request/node_modules}/uuid/v5.js | 0 deps/npm/node_modules/request/package.json | 102 +- deps/npm/node_modules/request/request.js | 24 +- .../node_modules/require-directory/.npmignore | 1 - .../require-directory/.travis.yml | 3 - .../node_modules/require-directory/LICENSE | 22 - .../require-directory/README.markdown | 184 - .../node_modules/require-directory/index.js | 86 - .../require-directory/package.json | 69 - .../require-main-filename/CHANGELOG.md | 26 - .../require-main-filename/LICENSE.txt | 14 - .../require-main-filename/README.md | 26 - .../require-main-filename/index.js | 18 - .../require-main-filename/package.json | 63 - deps/npm/node_modules/resolve-from/index.js | 47 - deps/npm/node_modules/resolve-from/license | 9 - .../node_modules/resolve-from/package.json | 66 - deps/npm/node_modules/resolve-from/readme.md | 72 - .../.editorconfig | 0 .../node_modules => }/resolve/.eslintignore | 0 deps/npm/node_modules/resolve/.travis.yml | 8 + deps/npm/node_modules/resolve/LICENSE | 21 + deps/npm/node_modules/resolve/appveyor.yml | 54 + .../resolve/example/async.js | 0 .../node_modules => }/resolve/example/sync.js | 0 deps/npm/node_modules/resolve/index.js | 6 + deps/npm/node_modules/resolve/lib/async.js | 298 + .../node_modules => }/resolve/lib/caller.js | 0 .../node_modules => }/resolve/lib/core.js | 0 deps/npm/node_modules/resolve/lib/core.json | 75 + deps/npm/node_modules/resolve/lib/is-core.js | 5 + .../resolve/lib/node-modules-paths.js | 42 + .../resolve/lib/normalize-options.js | 0 deps/npm/node_modules/resolve/lib/sync.js | 191 + deps/npm/node_modules/resolve/package.json | 47 + deps/npm/node_modules/resolve/readme.markdown | 242 + deps/npm/node_modules/resolve/test/core.js | 85 + .../node_modules => }/resolve/test/dotdot.js | 0 .../resolve/test/dotdot/abc/index.js | 0 .../resolve/test/dotdot/index.js | 0 .../resolve/test/faulty_basedir.js | 0 deps/npm/node_modules/resolve/test/filter.js | 34 + .../node_modules/resolve/test/filter_sync.js | 33 + deps/npm/node_modules/resolve/test/mock.js | 239 + .../node_modules/resolve/test/mock_sync.js | 141 + .../resolve/test/module_dir.js | 0 .../test/module_dir/xmodules/aaa/index.js | 0 .../test/module_dir/ymodules/aaa/index.js | 0 .../test/module_dir/zmodules/bbb/main.js | 0 .../test/module_dir/zmodules/bbb/package.json | 0 .../resolve/test/node-modules-paths.js | 143 + .../resolve/test/node_path.js | 0 .../resolve/test/node_path/x/aaa/index.js | 0 .../resolve/test/node_path/x/ccc/index.js | 0 .../resolve/test/node_path/y/bbb/index.js | 0 .../resolve/test/node_path/y/ccc/index.js | 0 .../resolve/test/nonstring.js | 0 .../resolve/test/pathfilter.js | 0 .../resolve/test/pathfilter/deep_ref/main.js | 0 .../resolve/test/precedence.js | 0 .../resolve/test/precedence/aaa.js | 0 .../resolve/test/precedence/aaa/index.js | 0 .../resolve/test/precedence/aaa/main.js | 0 .../resolve/test/precedence/bbb.js | 0 .../resolve/test/precedence/bbb/main.js | 0 .../resolve/test/resolver.js | 43 +- .../resolve/test/resolver/baz/doom.js | 0 .../resolve/test/resolver/baz/package.json | 4 + .../resolve/test/resolver/baz/quux.js | 0 .../resolve/test/resolver/browser_field/a.js | 0 .../resolve/test/resolver/browser_field/b.js | 0 .../test/resolver/browser_field/package.json | 0 .../test/resolver/cup.coffee} | 0 .../resolve/test/resolver/dot_main/index.js | 0 .../test/resolver/dot_main/package.json | 0 .../test/resolver/dot_slash_main/index.js | 0 .../test/resolver/dot_slash_main/package.json | 0 .../resolve/test/resolver/foo.js | 0 .../test/resolver/incorrect_main/index.js | 0 .../test/resolver/incorrect_main/package.json | 0 .../test/resolver/invalid_main/package.json | 0 .../test/resolver/mug.coffee} | 0 .../index.js => resolve/test/resolver/mug.js} | 0 .../test/resolver/multirepo/lerna.json | 0 .../test/resolver/multirepo/package.json | 0 .../multirepo/packages/package-a/index.js | 0 .../multirepo/packages/package-a/package.json | 0 .../multirepo/packages/package-b/index.js} | 0 .../multirepo/packages/package-b/package.json | 0 .../resolver/nested_symlinks/mylib/async.js | 25 + .../nested_symlinks/mylib/package.json | 15 + .../resolver/nested_symlinks/mylib/sync.js | 12 + .../resolver/other_path/lib/other-lib.js} | 0 .../test/resolver/other_path/root.js} | 0 .../resolve/test/resolver/quux/foo/index.js | 0 .../resolve/test/resolver/same_names/foo.js | 0 .../test/resolver/same_names/foo/index.js | 0 .../resolver/symlinked/_/node_modules/foo.js} | 0 .../symlinked/_/symlink_target/.gitkeep | 0 .../test/resolver/symlinked/package/bar.js | 1 + .../resolver/symlinked/package/package.json | 3 + .../test/resolver/without_basedir/main.js | 0 .../resolve/test/resolver_sync.js | 38 +- .../resolve/test/shadowed_core.js | 37 + .../shadowed_core/node_modules/util/index.js | 0 .../node_modules => }/resolve/test/subdirs.js | 0 .../npm/node_modules/resolve/test/symlinks.js | 173 + deps/npm/node_modules/retry/.npmignore | 1 - deps/npm/node_modules/retry/.travis.yml | 15 - deps/npm/node_modules/retry/Makefile | 5 +- deps/npm/node_modules/retry/Readme.md | 20 +- deps/npm/node_modules/retry/lib/retry.js | 9 +- .../node_modules/retry/lib/retry_operation.js | 17 +- deps/npm/node_modules/retry/package.json | 73 +- .../test/integration/test-retry-operation.js | 86 +- .../retry/test/integration/test-retry-wrap.js | 48 +- .../node_modules => }/retry/test/runner.js | 0 deps/npm/node_modules/rimraf/CHANGELOG.md | 65 + deps/npm/node_modules/rimraf/bin.js | 64 +- deps/npm/node_modules/rimraf/package.json | 86 +- deps/npm/node_modules/rimraf/rimraf.js | 146 +- deps/npm/node_modules/run-queue/README.md | 86 - .../run-queue/node_modules/aproba/LICENSE | 14 - .../run-queue/node_modules/aproba/README.md | 94 - .../run-queue/node_modules/aproba/index.js | 105 - .../node_modules/aproba/package.json | 62 - deps/npm/node_modules/run-queue/package.json | 63 - deps/npm/node_modules/run-queue/queue.js | 95 - .../npm/node_modules/safe-buffer/package.json | 54 +- .../node_modules/safer-buffer/package.json | 52 +- deps/npm/node_modules/semver-diff/index.js | 27 - deps/npm/node_modules/semver-diff/license | 21 - .../npm/node_modules/semver-diff/package.json | 66 - deps/npm/node_modules/semver-diff/readme.md | 52 - deps/npm/node_modules/semver/CHANGELOG.md | 72 + deps/npm/node_modules/semver/README.md | 206 +- deps/npm/node_modules/semver/bin/semver.js | 173 + .../node_modules/semver/classes/comparator.js | 139 + deps/npm/node_modules/semver/classes/index.js | 5 + deps/npm/node_modules/semver/classes/range.js | 463 + .../npm/node_modules/semver/classes/semver.js | 290 + .../node_modules/semver/functions/clean.js | 6 + deps/npm/node_modules/semver/functions/cmp.js | 48 + .../node_modules/semver/functions/coerce.js | 51 + .../semver/functions/compare-build.js | 7 + .../semver/functions/compare-loose.js | 3 + .../node_modules/semver/functions/compare.js | 5 + .../npm/node_modules/semver/functions/diff.js | 23 + deps/npm/node_modules/semver/functions/eq.js | 3 + deps/npm/node_modules/semver/functions/gt.js | 3 + deps/npm/node_modules/semver/functions/gte.js | 3 + deps/npm/node_modules/semver/functions/inc.js | 15 + deps/npm/node_modules/semver/functions/lt.js | 3 + deps/npm/node_modules/semver/functions/lte.js | 3 + .../node_modules/semver/functions/major.js | 3 + .../node_modules/semver/functions/minor.js | 3 + deps/npm/node_modules/semver/functions/neq.js | 3 + .../node_modules/semver/functions/parse.js | 37 + .../node_modules/semver/functions/patch.js | 3 + .../semver/functions/prerelease.js | 6 + .../node_modules/semver/functions/rcompare.js | 3 + .../node_modules/semver/functions/rsort.js | 3 + .../semver/functions/satisfies.js | 10 + .../npm/node_modules/semver/functions/sort.js | 3 + .../node_modules/semver/functions/valid.js | 6 + deps/npm/node_modules/semver/index.js | 48 + .../node_modules/semver/internal/constants.js | 17 + .../npm/node_modules/semver/internal/debug.js | 9 + .../semver/internal/identifiers.js | 23 + deps/npm/node_modules/semver/internal/re.js | 182 + deps/npm/node_modules/semver/package.json | 99 +- deps/npm/node_modules/semver/preload.js | 2 + deps/npm/node_modules/semver/ranges/gtr.js | 4 + .../node_modules/semver/ranges/intersects.js | 7 + deps/npm/node_modules/semver/ranges/ltr.js | 4 + .../semver/ranges/max-satisfying.js | 25 + .../semver/ranges/min-satisfying.js | 24 + .../node_modules/semver/ranges/min-version.js | 57 + .../npm/node_modules/semver/ranges/outside.js | 80 + .../node_modules/semver/ranges/simplify.js | 44 + deps/npm/node_modules/semver/ranges/subset.js | 155 + .../semver/ranges/to-comparators.js | 8 + deps/npm/node_modules/semver/ranges/valid.js | 11 + .../node_modules/set-blocking/package.json | 79 +- deps/npm/node_modules/sha/LICENSE | 46 - deps/npm/node_modules/sha/README.md | 49 - deps/npm/node_modules/sha/index.js | 107 - deps/npm/node_modules/sha/package.json | 52 - .../npm/node_modules/shebang-command/index.js | 19 - deps/npm/node_modules/shebang-command/license | 21 - .../node_modules/shebang-command/package.json | 71 - .../node_modules/shebang-command/readme.md | 39 - deps/npm/node_modules/shebang-regex/index.js | 2 - deps/npm/node_modules/shebang-regex/license | 21 - .../node_modules/shebang-regex/package.json | 64 - deps/npm/node_modules/shebang-regex/readme.md | 29 - .../npm/node_modules/signal-exit/CHANGELOG.md | 10 +- deps/npm/node_modules/signal-exit/README.md | 1 - deps/npm/node_modules/signal-exit/index.js | 6 + .../npm/node_modules/signal-exit/package.json | 82 +- deps/npm/node_modules/slide/README.md | 143 - deps/npm/node_modules/slide/index.js | 1 - .../slide/lib/async-map-ordered.js | 65 - deps/npm/node_modules/slide/lib/async-map.js | 54 - deps/npm/node_modules/slide/lib/bind-actor.js | 16 - deps/npm/node_modules/slide/lib/chain.js | 20 - deps/npm/node_modules/slide/lib/slide.js | 3 - deps/npm/node_modules/slide/package.json | 64 - .../node_modules/smart-buffer/package.json | 94 +- .../socks-proxy-agent/.travis.yml | 21 - .../node_modules/socks-proxy-agent/History.md | 96 - .../node_modules/socks-proxy-agent/README.md | 49 +- .../socks-proxy-agent/dist/agent.d.ts | 21 + .../socks-proxy-agent/dist/agent.js | 182 + .../socks-proxy-agent/dist/agent.js.map | 1 + .../socks-proxy-agent/dist/index.d.ts | 18 + .../socks-proxy-agent/dist/index.js | 14 + .../socks-proxy-agent/dist/index.js.map | 1 + .../node_modules/socks-proxy-agent/index.js | 145 - .../node_modules/agent-base/.travis.yml | 23 - .../node_modules/agent-base/History.md | 113 - .../node_modules/agent-base/README.md | 145 - .../node_modules/agent-base/index.js | 170 - .../node_modules/agent-base/package.json | 65 - .../node_modules/agent-base/patch-core.js | 37 - .../agent-base/test/ssl-cert-snakeoil.key | 15 - .../agent-base/test/ssl-cert-snakeoil.pem | 12 - .../node_modules/agent-base/test/test.js | 697 - .../socks-proxy-agent/package.json | 101 +- .../test/ssl-cert-snakeoil.key | 15 - .../test/ssl-cert-snakeoil.pem | 12 - .../socks-proxy-agent/test/test.js | 144 - .../node_modules/socks-proxy-agent/yarn.lock | 354 - deps/npm/node_modules/socks/.prettierrc.yaml | 4 +- deps/npm/node_modules/socks/.travis.yml | 7 +- deps/npm/node_modules/socks/README.md | 2 +- .../socks/build/client/socksclient.js | 325 +- .../socks/build/client/socksclient.js.map | 2 +- .../socks/build/common/constants.js | 3 +- .../socks/build/common/constants.js.map | 2 +- .../socks/build/common/helpers.js | 1 + .../socks/build/common/helpers.js.map | 2 +- .../socks/build/common/receivebuffer.js | 33 +- .../socks/build/common/receivebuffer.js.map | 2 +- .../node_modules/socks/build/common/util.js | 4 +- .../socks/build/common/util.js.map | 2 +- deps/npm/node_modules/socks/build/index.js | 15 +- .../npm/node_modules/socks/build/index.js.map | 2 +- deps/npm/node_modules/socks/package.json | 124 +- .../socks/typings/client/socksclient.d.ts | 40 +- .../socks/typings/common/constants.d.ts | 2 +- .../socks/typings/common/receiveBuffer.d.ts | 6 +- .../node_modules/sorted-object/package.json | 65 +- .../sorted-union-stream/.npmignore | 1 - .../sorted-union-stream/.travis.yml | 5 - .../node_modules/sorted-union-stream/LICENSE | 21 - .../sorted-union-stream/README.md | 80 - .../sorted-union-stream/example.js | 15 - .../node_modules/sorted-union-stream/index.js | 59 - .../node_modules/from2/LICENSE.md | 21 - .../node_modules/from2/README.md | 67 - .../node_modules/from2/index.js | 93 - .../node_modules/from2/package.json | 69 - .../node_modules/from2/test.js | 86 - .../node_modules/isarray/README.md | 54 - .../node_modules/isarray/build/build.js | 209 - .../node_modules/isarray/component.json | 19 - .../node_modules/isarray/index.js | 3 - .../node_modules/isarray/package.json | 57 - .../node_modules/readable-stream/.npmignore | 5 - .../node_modules/readable-stream/LICENSE | 18 - .../node_modules/readable-stream/README.md | 15 - .../node_modules/readable-stream/duplex.js | 1 - .../node_modules/readable-stream/float.patch | 923 - .../readable-stream/lib/_stream_duplex.js | 89 - .../lib/_stream_passthrough.js | 46 - .../readable-stream/lib/_stream_readable.js | 951 - .../readable-stream/lib/_stream_transform.js | 209 - .../readable-stream/lib/_stream_writable.js | 477 - .../node_modules/readable-stream/package.json | 65 - .../readable-stream/passthrough.js | 1 - .../node_modules/readable-stream/readable.js | 10 - .../node_modules/readable-stream/transform.js | 1 - .../node_modules/readable-stream/writable.js | 1 - .../node_modules/string_decoder/.npmignore | 2 - .../node_modules/string_decoder/LICENSE | 20 - .../node_modules/string_decoder/README.md | 7 - .../node_modules/string_decoder/index.js | 221 - .../node_modules/string_decoder/package.json | 53 - .../sorted-union-stream/package.json | 66 - .../node_modules/sorted-union-stream/test.js | 154 - deps/npm/node_modules/spdx-correct/README.md | 4 + deps/npm/node_modules/spdx-correct/index.js | 54 +- .../node_modules/spdx-correct/package.json | 63 +- .../node_modules/spdx-exceptions/index.json | 33 +- .../node_modules/spdx-exceptions/package.json | 56 +- .../spdx-expression-parse/README.md | 2 +- .../spdx-expression-parse/package.json | 90 +- .../spdx-expression-parse/parse.js | 4 +- .../spdx-expression-parse/scan.js | 4 +- .../spdx-license-ids/deprecated.json | 2 + .../node_modules/spdx-license-ids/index.json | 48 +- .../spdx-license-ids/package.json | 112 +- .../node_modules/split-on-first/index.d.ts | 29 - deps/npm/node_modules/split-on-first/index.js | 22 - deps/npm/node_modules/split-on-first/license | 9 - .../node_modules/split-on-first/package.json | 68 - .../npm/node_modules/split-on-first/readme.md | 58 - deps/npm/node_modules/sshpk/README.md | 126 +- deps/npm/node_modules/sshpk/bin/sshpk-conv | 105 +- .../npm/node_modules/sshpk/lib/certificate.js | 34 +- deps/npm/node_modules/sshpk/lib/dhe.js | 25 +- deps/npm/node_modules/sshpk/lib/ed-compat.js | 8 +- .../npm/node_modules/sshpk/lib/fingerprint.js | 80 +- .../node_modules/sshpk/lib/formats/auto.js | 19 +- .../sshpk/lib/formats/openssh-cert.js | 45 +- .../npm/node_modules/sshpk/lib/formats/pem.js | 116 +- .../node_modules/sshpk/lib/formats/pkcs8.js | 27 +- .../node_modules/sshpk/lib/formats/putty.js | 99 + .../sshpk/lib/formats/x509-pem.js | 18 +- .../node_modules/sshpk/lib/formats/x509.js | 33 +- deps/npm/node_modules/sshpk/lib/identity.js | 90 +- deps/npm/node_modules/sshpk/lib/index.js | 1 + deps/npm/node_modules/sshpk/lib/key.js | 41 +- .../npm/node_modules/sshpk/lib/private-key.js | 27 +- deps/npm/node_modules/sshpk/lib/utils.js | 81 +- deps/npm/node_modules/sshpk/package.json | 103 +- deps/npm/node_modules/ssri/CHANGELOG.md | 184 +- deps/npm/node_modules/ssri/README.md | 44 +- deps/npm/node_modules/ssri/index.js | 306 +- deps/npm/node_modules/ssri/package.json | 103 +- deps/npm/node_modules/stream-each/.npmignore | 1 - deps/npm/node_modules/stream-each/.travis.yml | 5 - deps/npm/node_modules/stream-each/LICENSE | 21 - deps/npm/node_modules/stream-each/README.md | 41 - .../node_modules/stream-each/collaborators.md | 7 - deps/npm/node_modules/stream-each/index.js | 58 - .../npm/node_modules/stream-each/package.json | 59 - deps/npm/node_modules/stream-each/test.js | 122 - .../node_modules/stream-iterate/.npmignore | 1 - .../node_modules/stream-iterate/.travis.yml | 5 - deps/npm/node_modules/stream-iterate/LICENSE | 21 - .../npm/node_modules/stream-iterate/README.md | 39 - deps/npm/node_modules/stream-iterate/index.js | 70 - .../node_modules/readable-stream/.travis.yml | 55 - .../readable-stream/GOVERNANCE.md | 136 - .../node_modules/readable-stream/LICENSE | 47 - .../node_modules/readable-stream/README.md | 58 - .../doc/wg-meetings/2015-01-30.md | 60 - .../readable-stream/duplex-browser.js | 1 - .../node_modules/readable-stream/duplex.js | 1 - .../readable-stream/lib/_stream_duplex.js | 131 - .../lib/_stream_passthrough.js | 47 - .../readable-stream/lib/_stream_readable.js | 1019 - .../readable-stream/lib/_stream_transform.js | 214 - .../readable-stream/lib/_stream_writable.js | 687 - .../lib/internal/streams/BufferList.js | 79 - .../lib/internal/streams/destroy.js | 74 - .../lib/internal/streams/stream-browser.js | 1 - .../lib/internal/streams/stream.js | 1 - .../node_modules/readable-stream/package.json | 81 - .../readable-stream/passthrough.js | 1 - .../readable-stream/readable-browser.js | 7 - .../node_modules/readable-stream/readable.js | 19 - .../node_modules/readable-stream/transform.js | 1 - .../readable-stream/writable-browser.js | 1 - .../node_modules/readable-stream/writable.js | 8 - .../node_modules/string_decoder/.travis.yml | 50 - .../node_modules/string_decoder/LICENSE | 48 - .../node_modules/string_decoder/README.md | 47 - .../string_decoder/lib/string_decoder.js | 296 - .../node_modules/string_decoder/package.json | 59 - .../node_modules/stream-iterate/package.json | 56 - deps/npm/node_modules/stream-iterate/test.js | 60 - deps/npm/node_modules/stream-shift/.npmignore | 1 - .../npm/node_modules/stream-shift/.travis.yml | 6 - deps/npm/node_modules/stream-shift/LICENSE | 21 - deps/npm/node_modules/stream-shift/README.md | 25 - deps/npm/node_modules/stream-shift/index.js | 20 - .../node_modules/stream-shift/package.json | 55 - deps/npm/node_modules/stream-shift/test.js | 48 - .../node_modules/strict-uri-encode/index.js | 2 - .../node_modules/strict-uri-encode/license | 21 - .../strict-uri-encode/package.json | 63 - .../node_modules/strict-uri-encode/readme.md | 39 - .../node_modules/ansi-regex/package.json | 58 +- .../is-fullwidth-code-point/index.js | 46 - .../is-fullwidth-code-point/license | 21 - .../is-fullwidth-code-point/package.json | 77 - .../is-fullwidth-code-point/readme.md | 39 - .../node_modules/strip-ansi/package.json | 60 +- .../node_modules/string-width/package.json | 145 +- .../string_decoder/.travis.yml | 0 .../node_modules/safe-buffer/LICENSE | 21 - .../node_modules/safe-buffer/README.md | 586 - .../node_modules/safe-buffer/index.d.ts | 187 - .../node_modules/safe-buffer/index.js | 64 - .../node_modules/safe-buffer/package.json | 62 - .../node_modules/string_decoder/package.json | 59 +- .../stringify-package/package.json | 68 +- deps/npm/node_modules/strip-ansi/package.json | 93 +- deps/npm/node_modules/strip-eof/index.js | 15 - deps/npm/node_modules/strip-eof/license | 21 - deps/npm/node_modules/strip-eof/package.json | 71 - deps/npm/node_modules/strip-eof/readme.md | 28 - .../node_modules/strip-json-comments/index.js | 70 - .../node_modules/strip-json-comments/license | 21 - .../strip-json-comments/package.json | 75 - .../strip-json-comments/readme.md | 64 - deps/npm/node_modules/supports-color/index.js | 54 +- .../node_modules/supports-color/package.json | 134 +- .../npm/node_modules/supports-color/readme.md | 16 +- deps/npm/node_modules/tar/CHANGELOG.md | 68 + deps/npm/node_modules/tar/README.md | 185 +- deps/npm/node_modules/tar/lib/buffer.js | 11 - .../node_modules/tar/lib/get-write-flag.js | 20 + deps/npm/node_modules/tar/lib/header.js | 1 - .../npm/node_modules/tar/lib/large-numbers.js | 6 +- deps/npm/node_modules/tar/lib/list.js | 2 - deps/npm/node_modules/tar/lib/mkdir.js | 2 +- deps/npm/node_modules/tar/lib/mode-fix.js | 12 +- deps/npm/node_modules/tar/lib/pack.js | 11 +- deps/npm/node_modules/tar/lib/parse.js | 165 +- .../node_modules/tar/lib/path-reservations.js | 125 + deps/npm/node_modules/tar/lib/pax.js | 1 - deps/npm/node_modules/tar/lib/replace.js | 1 - deps/npm/node_modules/tar/lib/unpack.js | 135 +- deps/npm/node_modules/tar/lib/warn-mixin.js | 27 +- deps/npm/node_modules/tar/lib/write-entry.js | 56 +- .../tar/node_modules/minipass/LICENSE | 15 - .../tar/node_modules/minipass/README.md | 606 - .../tar/node_modules/minipass/index.js | 537 - .../tar/node_modules/minipass/package.json | 70 - deps/npm/node_modules/tar/package.json | 94 +- deps/npm/node_modules/term-size/index.js | 70 - deps/npm/node_modules/term-size/license | 21 - deps/npm/node_modules/term-size/package.json | 75 - deps/npm/node_modules/term-size/readme.md | 41 - .../term-size/vendor/macos/term-size | Bin 27264 -> 0 bytes .../term-size/vendor/windows/term-size.exe | Bin 17408 -> 0 bytes deps/npm/node_modules/text-table/package.json | 115 +- deps/npm/node_modules/through/.travis.yml | 5 - deps/npm/node_modules/through/LICENSE.APACHE2 | 15 - deps/npm/node_modules/through/LICENSE.MIT | 24 - deps/npm/node_modules/through/index.js | 108 - deps/npm/node_modules/through/package.json | 69 - deps/npm/node_modules/through/readme.markdown | 64 - deps/npm/node_modules/through/test/async.js | 28 - .../node_modules/through/test/auto-destroy.js | 30 - .../node_modules/through/test/buffering.js | 71 - deps/npm/node_modules/through/test/end.js | 45 - deps/npm/node_modules/through/test/index.js | 133 - deps/npm/node_modules/through2/.npmignore | 3 - deps/npm/node_modules/through2/LICENSE.html | 336 - deps/npm/node_modules/through2/LICENSE.md | 9 - deps/npm/node_modules/through2/README.md | 136 - .../node_modules/readable-stream/.travis.yml | 55 - .../readable-stream/GOVERNANCE.md | 136 - .../node_modules/readable-stream/LICENSE | 47 - .../node_modules/readable-stream/README.md | 58 - .../doc/wg-meetings/2015-01-30.md | 60 - .../readable-stream/duplex-browser.js | 1 - .../node_modules/readable-stream/duplex.js | 1 - .../readable-stream/lib/_stream_duplex.js | 131 - .../lib/_stream_passthrough.js | 47 - .../readable-stream/lib/_stream_readable.js | 1019 - .../readable-stream/lib/_stream_transform.js | 214 - .../readable-stream/lib/_stream_writable.js | 687 - .../lib/internal/streams/BufferList.js | 79 - .../lib/internal/streams/destroy.js | 74 - .../lib/internal/streams/stream-browser.js | 1 - .../lib/internal/streams/stream.js | 1 - .../node_modules/readable-stream/package.json | 81 - .../readable-stream/passthrough.js | 1 - .../readable-stream/readable-browser.js | 7 - .../node_modules/readable-stream/readable.js | 19 - .../node_modules/readable-stream/transform.js | 1 - .../readable-stream/writable-browser.js | 1 - .../node_modules/readable-stream/writable.js | 8 - .../node_modules/string_decoder/.travis.yml | 50 - .../node_modules/string_decoder/LICENSE | 48 - .../node_modules/string_decoder/README.md | 47 - .../string_decoder/lib/string_decoder.js | 296 - .../node_modules/string_decoder/package.json | 59 - deps/npm/node_modules/through2/package.json | 68 - deps/npm/node_modules/through2/through2.js | 96 - deps/npm/node_modules/timed-out/index.js | 55 - deps/npm/node_modules/timed-out/license | 21 - deps/npm/node_modules/timed-out/package.json | 68 - deps/npm/node_modules/timed-out/readme.md | 42 - .../tiny-relative-date/package.json | 78 +- deps/npm/node_modules/tough-cookie/README.md | 28 +- .../node_modules/tough-cookie/lib/cookie.js | 57 +- .../node_modules/tough-cookie/lib/memstore.js | 5 + .../node_modules/tough-cookie/lib/store.js | 4 + .../node_modules/tough-cookie/lib/version.js | 2 + .../node_modules/tough-cookie/package.json | 100 +- .../minipass => treeverse}/LICENSE | 0 deps/npm/node_modules/treeverse/README.md | 129 + deps/npm/node_modules/treeverse/index.js | 4 + .../npm/node_modules/treeverse/lib/breadth.js | 66 + .../treeverse/lib/depth-descent.js | 87 + deps/npm/node_modules/treeverse/lib/depth.js | 74 + deps/npm/node_modules/treeverse/package.json | 37 + .../node_modules/tunnel-agent/package.json | 57 +- deps/npm/node_modules/tweetnacl/package.json | 98 +- .../typedarray-to-buffer/.airtap.yml | 15 + .../typedarray-to-buffer/.travis.yml | 11 + .../LICENSE | 0 .../typedarray-to-buffer/README.md | 85 + .../typedarray-to-buffer/index.js | 25 + .../typedarray-to-buffer/package.json | 50 + .../typedarray-to-buffer/test/basic.js | 50 + deps/npm/node_modules/typedarray/.travis.yml | 4 - deps/npm/node_modules/typedarray/LICENSE | 35 - .../node_modules/typedarray/example/tarray.js | 4 - deps/npm/node_modules/typedarray/index.js | 630 - deps/npm/node_modules/typedarray/package.json | 83 - .../node_modules/typedarray/readme.markdown | 61 - .../typedarray/test/server/undef_globals.js | 19 - .../node_modules/typedarray/test/tarray.js | 10 - deps/npm/node_modules/uid-number/README.md | 17 - .../node_modules/uid-number/get-uid-gid.js | 24 - deps/npm/node_modules/uid-number/package.json | 55 - .../npm/node_modules/uid-number/uid-number.js | 59 - deps/npm/node_modules/umask/.npmignore | 28 - deps/npm/node_modules/umask/ChangeLog | 9 - deps/npm/node_modules/umask/LICENSE | 22 - deps/npm/node_modules/umask/README.md | 78 - deps/npm/node_modules/umask/index.js | 77 - deps/npm/node_modules/umask/package.json | 60 - deps/npm/node_modules/umask/test/simple.js | 166 - .../node_modules/unique-filename/package.json | 62 +- deps/npm/node_modules/unique-slug/.npmignore | 6 - deps/npm/node_modules/unique-slug/.travis.yml | 11 +- .../{find-npm-prefix => unique-slug}/LICENSE | 0 deps/npm/node_modules/unique-slug/README.md | 5 +- deps/npm/node_modules/unique-slug/index.js | 10 +- .../npm/node_modules/unique-slug/package.json | 59 +- deps/npm/node_modules/unique-string/index.js | 4 - deps/npm/node_modules/unique-string/license | 21 - .../node_modules/unique-string/package.json | 76 - deps/npm/node_modules/unique-string/readme.md | 32 - deps/npm/node_modules/unpipe/HISTORY.md | 4 - deps/npm/node_modules/unpipe/LICENSE | 22 - deps/npm/node_modules/unpipe/README.md | 43 - deps/npm/node_modules/unpipe/index.js | 69 - deps/npm/node_modules/unpipe/package.json | 66 - deps/npm/node_modules/unzip-response/index.js | 36 - deps/npm/node_modules/unzip-response/license | 21 - .../node_modules/unzip-response/package.json | 81 - .../npm/node_modules/unzip-response/readme.md | 29 - .../npm/node_modules/update-notifier/check.js | 22 - .../npm/node_modules/update-notifier/index.js | 155 - deps/npm/node_modules/update-notifier/license | 9 - .../node_modules/update-notifier/package.json | 89 - .../node_modules/update-notifier/readme.md | 193 - deps/npm/node_modules/uri-js/LICENSE | 11 + deps/npm/node_modules/uri-js/README.md | 201 + .../node_modules/uri-js/dist/es5/uri.all.d.ts | 59 + .../node_modules/uri-js/dist/es5/uri.all.js | 1443 + .../uri-js/dist/es5/uri.all.js.map | 1 + .../uri-js/dist/es5/uri.all.min.d.ts | 59 + .../uri-js/dist/es5/uri.all.min.js | 3 + .../uri-js/dist/es5/uri.all.min.js.map | 1 + .../uri-js/dist/esnext/index.d.ts | 1 + .../node_modules/uri-js/dist/esnext/index.js | 17 + .../uri-js/dist/esnext/index.js.map | 1 + .../uri-js/dist/esnext/regexps-iri.d.ts | 3 + .../uri-js/dist/esnext/regexps-iri.js | 3 + .../uri-js/dist/esnext/regexps-iri.js.map | 1 + .../uri-js/dist/esnext/regexps-uri.d.ts | 4 + .../uri-js/dist/esnext/regexps-uri.js | 42 + .../uri-js/dist/esnext/regexps-uri.js.map | 1 + .../uri-js/dist/esnext/schemes/http.d.ts | 3 + .../uri-js/dist/esnext/schemes/http.js | 28 + .../uri-js/dist/esnext/schemes/http.js.map | 1 + .../uri-js/dist/esnext/schemes/https.d.ts | 3 + .../uri-js/dist/esnext/schemes/https.js | 9 + .../uri-js/dist/esnext/schemes/https.js.map | 1 + .../uri-js/dist/esnext/schemes/mailto.d.ts | 12 + .../uri-js/dist/esnext/schemes/mailto.js | 148 + .../uri-js/dist/esnext/schemes/mailto.js.map | 1 + .../uri-js/dist/esnext/schemes/urn-uuid.d.ts | 7 + .../uri-js/dist/esnext/schemes/urn-uuid.js | 23 + .../dist/esnext/schemes/urn-uuid.js.map | 1 + .../uri-js/dist/esnext/schemes/urn.d.ts | 10 + .../uri-js/dist/esnext/schemes/urn.js | 49 + .../uri-js/dist/esnext/schemes/urn.js.map | 1 + .../uri-js/dist/esnext/schemes/ws.d.ts | 7 + .../uri-js/dist/esnext/schemes/ws.js | 41 + .../uri-js/dist/esnext/schemes/ws.js.map | 1 + .../uri-js/dist/esnext/schemes/wss.d.ts | 3 + .../uri-js/dist/esnext/schemes/wss.js | 9 + .../uri-js/dist/esnext/schemes/wss.js.map | 1 + .../node_modules/uri-js/dist/esnext/uri.d.ts | 59 + .../node_modules/uri-js/dist/esnext/uri.js | 480 + .../uri-js/dist/esnext/uri.js.map | 1 + .../node_modules/uri-js/dist/esnext/util.d.ts | 6 + .../node_modules/uri-js/dist/esnext/util.js | 36 + .../uri-js/dist/esnext/util.js.map | 1 + deps/npm/node_modules/uri-js/package.json | 77 + deps/npm/node_modules/uri-js/yarn.lock | 1923 + deps/npm/node_modules/url-parse-lax/index.js | 14 - deps/npm/node_modules/url-parse-lax/license | 21 - .../node_modules/url-parse-lax/package.json | 73 - deps/npm/node_modules/url-parse-lax/readme.md | 100 - .../node_modules/util-deprecate/package.json | 57 +- deps/npm/node_modules/util-extend/LICENSE | 18 - deps/npm/node_modules/util-extend/README.md | 13 - deps/npm/node_modules/util-extend/extend.js | 33 - .../npm/node_modules/util-extend/package.json | 45 - deps/npm/node_modules/util-extend/test.js | 10 - .../node_modules/util-promisify/.npmignore | 1 - .../node_modules/util-promisify/.travis.yml | 8 - deps/npm/node_modules/util-promisify/LICENSE | 1072 - .../npm/node_modules/util-promisify/README.md | 42 - deps/npm/node_modules/util-promisify/index.js | 91 - .../node_modules/util-promisify/package.json | 45 - .../util-promisify/test/common.js | 56 - .../node_modules/util-promisify/test/index.js | 194 - .../util-promisify/test/timers.js | 38 - deps/npm/node_modules/uuid/CHANGELOG.md | 197 +- deps/npm/node_modules/uuid/CONTRIBUTING.md | 18 + deps/npm/node_modules/uuid/LICENSE.md | 20 +- deps/npm/node_modules/uuid/README.md | 531 +- deps/npm/node_modules/uuid/dist/bin/uuid | 2 + .../uuid/dist/esm-browser/index.js | 9 + .../node_modules/uuid/dist/esm-browser/md5.js | 215 + .../node_modules/uuid/dist/esm-browser/nil.js | 1 + .../uuid/dist/esm-browser/parse.js | 35 + .../uuid/dist/esm-browser/regex.js | 1 + .../node_modules/uuid/dist/esm-browser/rng.js | 14 + .../uuid/dist/esm-browser/sha1.js | 96 + .../uuid/dist/esm-browser/stringify.js | 30 + .../node_modules/uuid/dist/esm-browser/v1.js | 95 + .../node_modules/uuid/dist/esm-browser/v3.js | 4 + .../node_modules/uuid/dist/esm-browser/v35.js | 64 + .../node_modules/uuid/dist/esm-browser/v4.js | 24 + .../node_modules/uuid/dist/esm-browser/v5.js | 4 + .../uuid/dist/esm-browser/validate.js | 7 + .../uuid/dist/esm-browser/version.js | 11 + .../node_modules/uuid/dist/esm-node/index.js | 9 + .../node_modules/uuid/dist/esm-node/md5.js | 13 + .../node_modules/uuid/dist/esm-node/nil.js | 1 + .../node_modules/uuid/dist/esm-node/parse.js | 35 + .../node_modules/uuid/dist/esm-node/regex.js | 1 + .../node_modules/uuid/dist/esm-node/rng.js | 12 + .../node_modules/uuid/dist/esm-node/sha1.js | 13 + .../uuid/dist/esm-node/stringify.js | 29 + .../npm/node_modules/uuid/dist/esm-node/v1.js | 95 + .../npm/node_modules/uuid/dist/esm-node/v3.js | 4 + .../node_modules/uuid/dist/esm-node/v35.js | 64 + .../npm/node_modules/uuid/dist/esm-node/v4.js | 24 + .../npm/node_modules/uuid/dist/esm-node/v5.js | 4 + .../uuid/dist/esm-node/validate.js | 7 + .../uuid/dist/esm-node/version.js | 11 + deps/npm/node_modules/uuid/dist/index.js | 79 + .../npm/node_modules/uuid/dist/md5-browser.js | 223 + deps/npm/node_modules/uuid/dist/md5.js | 23 + deps/npm/node_modules/uuid/dist/nil.js | 8 + deps/npm/node_modules/uuid/dist/parse.js | 45 + deps/npm/node_modules/uuid/dist/regex.js | 8 + .../npm/node_modules/uuid/dist/rng-browser.js | 21 + deps/npm/node_modules/uuid/dist/rng.js | 24 + .../node_modules/uuid/dist/sha1-browser.js | 104 + deps/npm/node_modules/uuid/dist/sha1.js | 23 + deps/npm/node_modules/uuid/dist/stringify.js | 39 + .../node_modules/uuid/dist/umd/uuid.min.js | 1 + .../node_modules/uuid/dist/umd/uuidNIL.min.js | 1 + .../uuid/dist/umd/uuidParse.min.js | 1 + .../uuid/dist/umd/uuidStringify.min.js | 1 + .../uuid/dist/umd/uuidValidate.min.js | 1 + .../uuid/dist/umd/uuidVersion.min.js | 1 + .../node_modules/uuid/dist/umd/uuidv1.min.js | 1 + .../node_modules/uuid/dist/umd/uuidv3.min.js | 1 + .../node_modules/uuid/dist/umd/uuidv4.min.js | 1 + .../node_modules/uuid/dist/umd/uuidv5.min.js | 1 + deps/npm/node_modules/uuid/dist/uuid-bin.js | 85 + deps/npm/node_modules/uuid/dist/v1.js | 107 + deps/npm/node_modules/uuid/dist/v3.js | 16 + deps/npm/node_modules/uuid/dist/v35.js | 78 + deps/npm/node_modules/uuid/dist/v4.js | 37 + deps/npm/node_modules/uuid/dist/v5.js | 16 + deps/npm/node_modules/uuid/dist/validate.js | 17 + deps/npm/node_modules/uuid/dist/version.js | 21 + deps/npm/node_modules/uuid/lib/bytesToUuid.js | 24 - deps/npm/node_modules/uuid/package.json | 199 +- deps/npm/node_modules/uuid/v1.js | 109 - deps/npm/node_modules/uuid/wrapper.mjs | 10 + .../validate-npm-package-license/package.json | 56 +- .../validate-npm-package-name/package.json | 70 +- deps/npm/node_modules/verror/CONTRIBUTING.md | 19 + deps/npm/node_modules/verror/package.json | 69 +- deps/npm/node_modules/walk-up-path/LICENSE | 15 + deps/npm/node_modules/walk-up-path/README.md | 46 + deps/npm/node_modules/walk-up-path/index.js | 11 + .../node_modules/walk-up-path/package.json | 28 + deps/npm/node_modules/wcwidth/package.json | 65 +- .../node_modules/which-module/CHANGELOG.md | 26 - deps/npm/node_modules/which-module/LICENSE | 13 - deps/npm/node_modules/which-module/README.md | 55 - deps/npm/node_modules/which-module/index.js | 9 - .../node_modules/which-module/package.json | 68 - deps/npm/node_modules/which/CHANGELOG.md | 14 + deps/npm/node_modules/which/README.md | 3 + .../which/bin/{which => node-which} | 0 deps/npm/node_modules/which/package.json | 83 +- deps/npm/node_modules/which/which.js | 168 +- .../node_modules/string-width/index.js | 37 - .../node_modules/string-width/license | 21 - .../node_modules/string-width/package.json | 88 - .../node_modules/string-width/readme.md | 42 - deps/npm/node_modules/wide-align/package.json | 68 +- deps/npm/node_modules/widest-line/index.js | 8 - deps/npm/node_modules/widest-line/license | 9 - .../npm/node_modules/widest-line/package.json | 86 - deps/npm/node_modules/widest-line/readme.md | 34 - .../node_modules/worker-farm/.editorconfig | 16 - deps/npm/node_modules/worker-farm/.travis.yml | 12 - deps/npm/node_modules/worker-farm/LICENSE.md | 13 - deps/npm/node_modules/worker-farm/README.md | 150 - .../worker-farm/examples/basic/child.js | 5 - .../worker-farm/examples/basic/index.js | 13 - .../worker-farm/examples/pi/calc.js | 22 - .../worker-farm/examples/pi/index.js | 41 - deps/npm/node_modules/worker-farm/index.d.ts | 55 - .../worker-farm/lib/child/index.js | 56 - deps/npm/node_modules/worker-farm/lib/farm.js | 348 - deps/npm/node_modules/worker-farm/lib/fork.js | 33 - .../npm/node_modules/worker-farm/lib/index.js | 34 - .../npm/node_modules/worker-farm/package.json | 61 - .../node_modules/worker-farm/tests/child.js | 87 - .../node_modules/worker-farm/tests/debug.js | 12 - .../node_modules/worker-farm/tests/index.js | 616 - deps/npm/node_modules/wrap-ansi/index.js | 188 - deps/npm/node_modules/wrap-ansi/license | 9 - .../node_modules/ansi-regex/index.js | 14 - .../wrap-ansi/node_modules/ansi-regex/license | 9 - .../node_modules/ansi-regex/package.json | 85 - .../node_modules/ansi-regex/readme.md | 87 - .../is-fullwidth-code-point/index.js | 46 - .../is-fullwidth-code-point/license | 21 - .../is-fullwidth-code-point/package.json | 77 - .../is-fullwidth-code-point/readme.md | 39 - .../node_modules/string-width/index.js | 39 - .../node_modules/string-width/license | 9 - .../node_modules/string-width/package.json | 88 - .../node_modules/string-width/readme.md | 45 - .../node_modules/strip-ansi/index.d.ts | 15 - .../node_modules/strip-ansi/index.js | 7 - .../wrap-ansi/node_modules/strip-ansi/license | 9 - .../node_modules/strip-ansi/package.json | 87 - .../node_modules/strip-ansi/readme.md | 61 - deps/npm/node_modules/wrap-ansi/package.json | 95 - deps/npm/node_modules/wrap-ansi/readme.md | 108 - deps/npm/node_modules/wrappy/package.json | 67 +- .../write-file-atomic/CHANGELOG.md | 7 + .../node_modules/write-file-atomic/README.md | 22 +- .../node_modules/write-file-atomic/index.js | 293 +- .../write-file-atomic/package.json | 93 +- deps/npm/node_modules/xdg-basedir/index.js | 28 - deps/npm/node_modules/xdg-basedir/license | 21 - .../npm/node_modules/xdg-basedir/package.json | 73 - deps/npm/node_modules/xdg-basedir/readme.md | 60 - deps/npm/node_modules/xtend/.npmignore | 1 - deps/npm/node_modules/xtend/LICENCE | 19 - deps/npm/node_modules/xtend/Makefile | 4 - deps/npm/node_modules/xtend/README.md | 32 - deps/npm/node_modules/xtend/immutable.js | 19 - deps/npm/node_modules/xtend/mutable.js | 17 - deps/npm/node_modules/xtend/package.json | 87 - deps/npm/node_modules/xtend/test.js | 83 - deps/npm/node_modules/y18n/CHANGELOG.md | 21 - deps/npm/node_modules/y18n/LICENSE | 13 - deps/npm/node_modules/y18n/README.md | 109 - deps/npm/node_modules/y18n/index.js | 188 - deps/npm/node_modules/y18n/package.json | 70 - deps/npm/node_modules/yallist/package.json | 63 +- deps/npm/node_modules/yallist/yallist.js | 50 + .../node_modules/yargs-parser/CHANGELOG.md | 507 - .../npm/node_modules/yargs-parser/LICENSE.txt | 14 - deps/npm/node_modules/yargs-parser/README.md | 418 - deps/npm/node_modules/yargs-parser/index.js | 968 - .../yargs-parser/lib/tokenize-arg-string.js | 40 - .../node_modules/camelcase/index.d.ts | 63 - .../node_modules/camelcase/index.js | 76 - .../node_modules/camelcase/license | 9 - .../node_modules/camelcase/package.json | 75 - .../node_modules/camelcase/readme.md | 99 - .../node_modules/yargs-parser/package.json | 79 - deps/npm/node_modules/yargs/CHANGELOG.md | 1406 - deps/npm/node_modules/yargs/LICENSE | 22 - deps/npm/node_modules/yargs/README.md | 136 - deps/npm/node_modules/yargs/index.js | 39 - .../node_modules/yargs/lib/apply-extends.js | 67 - deps/npm/node_modules/yargs/lib/argsert.js | 68 - deps/npm/node_modules/yargs/lib/command.js | 447 - .../yargs/lib/completion-templates.js | 49 - deps/npm/node_modules/yargs/lib/completion.js | 116 - deps/npm/node_modules/yargs/lib/is-promise.js | 3 - .../npm/node_modules/yargs/lib/levenshtein.js | 58 - deps/npm/node_modules/yargs/lib/middleware.js | 64 - deps/npm/node_modules/yargs/lib/obj-filter.js | 11 - deps/npm/node_modules/yargs/lib/usage.js | 549 - deps/npm/node_modules/yargs/lib/validation.js | 350 - deps/npm/node_modules/yargs/lib/yerror.js | 11 - deps/npm/node_modules/yargs/locales/be.json | 39 - deps/npm/node_modules/yargs/locales/de.json | 39 - deps/npm/node_modules/yargs/locales/en.json | 42 - deps/npm/node_modules/yargs/locales/es.json | 39 - deps/npm/node_modules/yargs/locales/fr.json | 37 - deps/npm/node_modules/yargs/locales/hi.json | 42 - deps/npm/node_modules/yargs/locales/hu.json | 39 - deps/npm/node_modules/yargs/locales/id.json | 43 - deps/npm/node_modules/yargs/locales/it.json | 39 - deps/npm/node_modules/yargs/locales/ja.json | 42 - deps/npm/node_modules/yargs/locales/ko.json | 42 - deps/npm/node_modules/yargs/locales/nb.json | 37 - deps/npm/node_modules/yargs/locales/nl.json | 42 - deps/npm/node_modules/yargs/locales/nn.json | 39 - .../node_modules/yargs/locales/pirate.json | 13 - deps/npm/node_modules/yargs/locales/pl.json | 42 - deps/npm/node_modules/yargs/locales/pt.json | 38 - .../npm/node_modules/yargs/locales/pt_BR.json | 42 - deps/npm/node_modules/yargs/locales/ru.json | 39 - deps/npm/node_modules/yargs/locales/th.json | 39 - deps/npm/node_modules/yargs/locales/tr.json | 41 - .../npm/node_modules/yargs/locales/zh_CN.json | 41 - .../npm/node_modules/yargs/locales/zh_TW.json | 40 - .../yargs/node_modules/ansi-regex/index.js | 14 - .../yargs/node_modules/ansi-regex/license | 9 - .../node_modules/ansi-regex/package.json | 85 - .../yargs/node_modules/ansi-regex/readme.md | 87 - .../yargs/node_modules/find-up/index.js | 46 - .../yargs/node_modules/find-up/license | 9 - .../yargs/node_modules/find-up/package.json | 82 - .../yargs/node_modules/find-up/readme.md | 87 - .../is-fullwidth-code-point/index.js | 46 - .../is-fullwidth-code-point/license | 21 - .../is-fullwidth-code-point/package.json | 77 - .../is-fullwidth-code-point/readme.md | 39 - .../yargs/node_modules/locate-path/index.js | 24 - .../yargs/node_modules/locate-path/license | 9 - .../node_modules/locate-path/package.json | 76 - .../yargs/node_modules/locate-path/readme.md | 99 - .../yargs/node_modules/p-limit/index.d.ts | 38 - .../yargs/node_modules/p-limit/index.js | 57 - .../yargs/node_modules/p-limit/license | 9 - .../yargs/node_modules/p-limit/package.json | 84 - .../yargs/node_modules/p-limit/readme.md | 101 - .../yargs/node_modules/p-locate/index.js | 34 - .../yargs/node_modules/p-locate/license | 9 - .../yargs/node_modules/p-locate/package.json | 83 - .../yargs/node_modules/p-locate/readme.md | 88 - .../yargs/node_modules/p-try/index.d.ts | 39 - .../yargs/node_modules/p-try/index.js | 9 - .../yargs/node_modules/p-try/license | 9 - .../yargs/node_modules/p-try/package.json | 74 - .../yargs/node_modules/p-try/readme.md | 58 - .../yargs/node_modules/string-width/index.js | 39 - .../yargs/node_modules/string-width/license | 9 - .../node_modules/string-width/package.json | 88 - .../yargs/node_modules/string-width/readme.md | 45 - .../yargs/node_modules/strip-ansi/index.d.ts | 15 - .../yargs/node_modules/strip-ansi/index.js | 7 - .../yargs/node_modules/strip-ansi/license | 9 - .../node_modules/strip-ansi/package.json | 86 - .../yargs/node_modules/strip-ansi/readme.md | 61 - deps/npm/node_modules/yargs/package.json | 110 - deps/npm/node_modules/yargs/yargs.js | 1252 - deps/npm/package.json | 300 +- deps/npm/scripts/bundle-and-gitignore-deps.js | 33 + deps/npm/scripts/check-deps.js | 9 + deps/npm/scripts/publish-tag.js | 2 +- deps/npm/scripts/resetdeps.sh | 8 + .../test-lib-dist-tag.js-TAP.test.js | 109 + .../test-lib-fund.js-TAP.test.js | 94 + .../test-lib-link.js-TAP.test.js | 25 + .../tap-snapshots/test-lib-ls.js-TAP.test.js | 602 + .../test-lib-outdated.js-TAP.test.js | 154 + .../test-lib-publish.js-TAP.test.js | 13 + .../test-lib-utils-cmd-list.js-TAP.test.js | 199 + .../test-lib-utils-config.js-TAP.test.js | 1550 + ...est-lib-utils-error-handler.js-TAP.test.js | 23 + ...est-lib-utils-error-message.js-TAP.test.js | 1256 + .../test-lib-utils-explain-dep.js-TAP.test.js | 178 + ...-lib-utils-explain-eresolve.js-TAP.test.js | 938 + ...test-lib-utils-flat-options.js-TAP.test.js | 129 + ...test-lib-utils-reify-output.js-TAP.test.js | 1634 + .../test-lib-utils-tar.js-TAP.test.js | 34 + ...t-lib-utils-update-notifier.js-TAP.test.js | 102 + .../test-lib-view.js-TAP.test.js | 272 + .../test-tap-fund.js-TAP.test.js | 74 - deps/npm/test/bin/npm-cli.js | 10 + deps/npm/test/bin/npx-cli.js | 95 + deps/npm/test/common-config.js | 90 - deps/npm/test/common-tap.js | 290 - deps/npm/test/coverage-map.js | 18 + deps/npm/test/fake-registry.js | 156 - deps/npm/test/fake-registry.md | 198 - deps/npm/test/fixtures/config/.npmrc | 1 - deps/npm/test/fixtures/config/builtin | 1 - deps/npm/test/fixtures/config/globalconfig | 1 - deps/npm/test/fixtures/config/malformed | 1 - deps/npm/test/fixtures/config/multi-ca | 32 - deps/npm/test/fixtures/config/userconfig | 22 - .../test/fixtures/config/userconfig-with-gc | 23 - .../test/fixtures/eresolve-explanations.js | 2576 + .../test/fixtures/forked-underscore-1.5.1.tgz | Bin 583 -> 0 bytes ...-com-BryanDonovan-dummy-npm-bar.git.tar.gz | Bin 12585 -> 0 bytes ...com-BryanDonovan-dummy-npm-buzz.git.tar.gz | Bin 10860 -> 0 bytes ...-com-BryanDonovan-dummy-npm-foo.git.tar.gz | Bin 12712 -> 0 bytes ...b-com-BryanDonovan-npm-git-test.git.tar.gz | Bin 9521 -> 0 bytes .../fixtures/gitignore-and-npmignore-2.tar | Bin 4096 -> 0 bytes .../test/fixtures/gitignore-and-npmignore.tar | Bin 10240 -> 0 bytes .../test/fixtures/gitignore-and-npmignore.tgz | Bin 360 -> 0 bytes deps/npm/test/fixtures/gitignore.tgz | Bin 319 -> 0 bytes deps/npm/test/fixtures/npmignore.tgz | Bin 320 -> 0 bytes deps/npm/test/fixtures/onload.js | 1 - .../test/fixtures/scoped-underscore-1.3.1.tgz | Bin 55415 -> 0 bytes deps/npm/test/fixtures/third-party.md | 25 - deps/npm/test/lib/access.js | 576 + deps/npm/test/lib/adduser.js | 188 + deps/npm/test/lib/audit.js | 120 + deps/npm/test/lib/auth/legacy.js | 427 + deps/npm/test/lib/auth/oauth.js | 29 + deps/npm/test/lib/auth/saml.js | 29 + deps/npm/test/lib/auth/sso.js | 266 + deps/npm/test/lib/bin.js | 71 + deps/npm/test/lib/birthday.js | 84 + deps/npm/test/lib/bugs.js | 96 + deps/npm/test/lib/ci.js | 114 + deps/npm/test/lib/cli.js | 179 + deps/npm/test/lib/dedupe.js | 48 + deps/npm/test/lib/dist-tag.js | 323 + deps/npm/test/lib/docs.js | 85 + deps/npm/test/lib/exec.js | 688 + deps/npm/test/lib/explain.js | 176 + deps/npm/test/lib/explore.js | 282 + deps/npm/test/lib/find-dupes.js | 16 + deps/npm/test/lib/fund.js | 845 + deps/npm/test/lib/get.js | 18 + deps/npm/test/lib/install.js | 200 + deps/npm/test/lib/link.js | 291 + deps/npm/test/lib/ll.js | 31 + deps/npm/test/lib/load-all-commands.js | 23 + deps/npm/test/lib/load-all.js | 30 + deps/npm/test/lib/logout.js | 261 + deps/npm/test/lib/ls.js | 3808 ++ deps/npm/test/lib/npm.js | 346 + deps/npm/test/lib/outdated.js | 425 + deps/npm/test/lib/pack.js | 146 + deps/npm/test/lib/ping.js | 110 + deps/npm/test/lib/prefix.js | 19 + deps/npm/test/lib/prune.js | 28 + deps/npm/test/lib/publish.js | 154 + deps/npm/test/lib/repo.js | 199 + deps/npm/test/lib/restart.js | 5 + deps/npm/test/lib/root.js | 19 + deps/npm/test/lib/run-script.js | 434 + deps/npm/test/lib/start.js | 5 + deps/npm/test/lib/stop.js | 5 + deps/npm/test/lib/test.js | 40 + deps/npm/test/lib/token.js | 912 + deps/npm/test/lib/utils/cleanup-log-files.js | 80 + deps/npm/test/lib/utils/cmd-list.js | 4 + .../lib/utils/completion/installed-deep.js | 251 + .../lib/utils/completion/installed-shallow.js | 111 + deps/npm/test/lib/utils/completion/none.js | 6 + deps/npm/test/lib/utils/config.js | 172 + deps/npm/test/lib/utils/deref-command.js | 9 + deps/npm/test/lib/utils/did-you-mean.js | 7 + deps/npm/test/lib/utils/error-handler.js | 522 + deps/npm/test/lib/utils/error-message.js | 450 + deps/npm/test/lib/utils/escape-arg.js | 15 + deps/npm/test/lib/utils/escape-exec-path.js | 15 + deps/npm/test/lib/utils/explain-dep.js | 185 + deps/npm/test/lib/utils/explain-eresolve.js | 50 + deps/npm/test/lib/utils/flat-options.js | 328 + deps/npm/test/lib/utils/get-identity.js | 107 + deps/npm/test/lib/utils/get-project-scope.js | 48 + .../utils/hosted-git-info-from-manifest.js | 21 + deps/npm/test/lib/utils/is-windows-bash.js | 28 + deps/npm/test/lib/utils/is-windows-shell.js | 8 + deps/npm/test/lib/utils/is-windows.js | 8 + deps/npm/test/lib/utils/lifecycle-cmd.js | 18 + deps/npm/test/lib/utils/output.js | 8 + deps/npm/test/lib/utils/path.js | 13 + deps/npm/test/lib/utils/perf.js | 38 + deps/npm/test/lib/utils/ping.js | 36 + deps/npm/test/lib/utils/proc-log-listener.js | 38 + deps/npm/test/lib/utils/read-local-package.js | 57 + deps/npm/test/lib/utils/reify-output.js | 347 + deps/npm/test/lib/utils/set-user-agent.js | 54 + deps/npm/test/lib/utils/setup-log.js | 273 + deps/npm/test/lib/utils/tar.js | 115 + deps/npm/test/lib/utils/unsupported.js | 107 + deps/npm/test/lib/utils/update-notifier.js | 210 + deps/npm/test/lib/view.js | 556 + deps/npm/test/lib/whoami.js | 34 + .../add-remote-git-get-resolved.js | 129 - .../belongs-in-pacote/git-races.js | 219 - .../need-npm5-update/ignore-shrinkwrap.js | 135 - .../test/need-npm5-update/legacy-array-bin.js | 80 - .../test/need-npm5-update/legacy-dir-bin.js | 79 - .../legacy-npm-self-install.js | 106 - .../need-npm5-update/legacy-optional-deps.js | 80 - .../need-npm5-update/legacy-shrinkwrap.js | 132 - .../test/need-npm5-update/lifecycle-signal.js | 140 - .../move-no-clobber-dest-node-modules.js | 139 - .../update-save.js | 219 - .../need-outdated/update-symlink.js | 127 - .../need-npm5-update/outdated-depth-deep.js | 92 - .../outdated-depth-integer.js | 80 - .../outdated-include-devdependencies.js | 58 - .../test/need-npm5-update/outdated-local.js | 195 - .../need-npm5-update/outdated-new-versions.js | 65 - .../need-npm5-update/outdated-notarget.js | 47 - .../test/need-npm5-update/outdated-private.js | 115 - .../test/need-npm5-update/outdated-symlink.js | 103 - .../need-npm5-update/peer-deps-invalid.js | 100 - .../need-npm5-update/peer-deps-toplevel.js | 132 - .../peer-deps-without-package-json.js | 79 - deps/npm/test/need-npm5-update/rm-linked.js | 148 - .../shrinkwrap-complete-except-dev.js | 158 - .../shrinkwrap-dev-dep-cycle.js | 102 - deps/npm/test/network/git-cache-locking.js | 44 - deps/npm/test/network/git-cache-no-hooks.js | 50 - deps/npm/test/network/legacy-bundled-git.js | 99 - deps/npm/test/network/legacy-url-dep.js | 59 - deps/npm/test/network/registry.js | 68 - deps/npm/test/tap/00-check-mock-dep.js | 17 - deps/npm/test/tap/00-config-setup.js | 85 - deps/npm/test/tap/00-verify-bundle-deps.js | 16 - deps/npm/test/tap/00-verify-ls-ok.js | 27 - deps/npm/test/tap/00-verify-no-scoped.js | 30 - deps/npm/test/tap/404-parent.js | 54 - .../test/tap/404-private-registry-scoped.js | 36 - deps/npm/test/tap/404-private-registry.js | 37 - deps/npm/test/tap/404.js | 72 - deps/npm/test/tap/access.js | 587 - .../tap/add-named-update-protocol-port.js | 113 - deps/npm/test/tap/add-remote-git-file.js | 85 - .../npm/test/tap/add-remote-git-shrinkwrap.js | 137 - deps/npm/test/tap/add-remote-git-submodule.js | 142 - deps/npm/test/tap/add-remote-git.js | 104 - deps/npm/test/tap/adduser-always-auth.js | 266 - deps/npm/test/tap/adduser-legacy-auth.js | 102 - deps/npm/test/tap/adduser-oauth.js | 82 - deps/npm/test/tap/adduser-saml.js | 82 - deps/npm/test/tap/aliases.js | 268 - .../all-package-metadata-cache-stream-unit.js | 112 - .../all-package-metadata-entry-stream-unit.js | 190 - ...all-package-metadata-update-stream-unit.js | 176 - .../all-package-metadata-write-stream-unit.js | 125 - deps/npm/test/tap/all-package-metadata.js | 212 - deps/npm/test/tap/anon-cli-metrics.js | 151 - deps/npm/test/tap/audit-fix.js | 829 - deps/npm/test/tap/audit.js | 578 - deps/npm/test/tap/auto-prune.js | 147 - deps/npm/test/tap/bearer-token-check.js | 109 - deps/npm/test/tap/bin-overwriting.js | 108 - deps/npm/test/tap/bin.js | 23 - .../bitbucket-https-url-with-creds-package.js | 70 - .../tap/bitbucket-https-url-with-creds.js | 69 - .../test/tap/bitbucket-shortcut-package.js | 73 - deps/npm/test/tap/bitbucket-shortcut.js | 70 - deps/npm/test/tap/bugs.js | 172 - deps/npm/test/tap/build-already-built.js | 60 - deps/npm/test/tap/builtin-config.js | 136 - .../test/tap/bundled-dependencies-nonarray.js | 71 - deps/npm/test/tap/bundled-dependencies.js | 109 - deps/npm/test/tap/bundled-no-add-to-move.js | 50 - deps/npm/test/tap/bundled-transitive-deps.js | 108 - deps/npm/test/tap/cache-add-unpublished.js | 37 - .../test/tap/cache-eacces-error-message.js | 35 - deps/npm/test/tap/cache-shasum-fork.js | 92 - deps/npm/test/tap/check-cpu-reqs.js | 50 - deps/npm/test/tap/check-engine-reqs.js | 63 - deps/npm/test/tap/check-install-self.js | 56 - deps/npm/test/tap/check-os-reqs.js | 50 - deps/npm/test/tap/check-permissions.js | 95 - deps/npm/test/tap/ci-header.js | 139 - deps/npm/test/tap/ci-permissions.js | 53 - deps/npm/test/tap/ci-with-local-dependency.js | 82 - deps/npm/test/tap/ci.js | 344 - deps/npm/test/tap/circular-dep.js | 93 - deps/npm/test/tap/config-basic.js | 79 - deps/npm/test/tap/config-builtin.js | 66 - deps/npm/test/tap/config-certfile.js | 19 - deps/npm/test/tap/config-credentials.js | 350 - deps/npm/test/tap/config-edit.js | 74 - deps/npm/test/tap/config-envReplace.js | 58 - deps/npm/test/tap/config-list.js | 69 - deps/npm/test/tap/config-malformed.js | 14 - deps/npm/test/tap/config-meta.js | 137 - deps/npm/test/tap/config-new-cafile.js | 37 - deps/npm/test/tap/config-private.js | 83 - deps/npm/test/tap/config-project.js | 66 - deps/npm/test/tap/config-save.js | 91 - deps/npm/test/tap/correct-mkdir.js | 167 - deps/npm/test/tap/cruft-test.js | 43 - deps/npm/test/tap/debug-logs.js | 97 - deps/npm/test/tap/dedupe-git-semver.js | 138 - deps/npm/test/tap/dedupe-scoped.js | 155 - deps/npm/test/tap/dedupe.js | 122 - deps/npm/test/tap/deprecate.js | 157 - deps/npm/test/tap/dist-tag.js | 271 - deps/npm/test/tap/do-not-remove-other-bins.js | 117 - deps/npm/test/tap/doctor-ping-registry-404.js | 108 - deps/npm/test/tap/doctor.js | 131 - .../test/tap/extraneous-dep-cycle-ls-ok.js | 71 - deps/npm/test/tap/false-name.js | 79 - deps/npm/test/tap/fetch-package-metadata.js | 48 - deps/npm/test/tap/format-package-lock.js | 116 - deps/npm/test/tap/full-warning-messages.js | 112 - deps/npm/test/tap/fund.js | 405 - deps/npm/test/tap/gently-rm-cmdshims.js | 161 - deps/npm/test/tap/gently-rm-linked-module.js | 100 - deps/npm/test/tap/gently-rm-overeager.js | 60 - .../tap/gently-rm-symlinked-global-dir.js | 119 - .../test/tap/gist-short-shortcut-package.js | 71 - deps/npm/test/tap/gist-short-shortcut.js | 68 - deps/npm/test/tap/gist-shortcut-package.js | 65 - deps/npm/test/tap/gist-shortcut.js | 58 - .../test/tap/git-dependency-install-link.js | 172 - deps/npm/test/tap/git-npmignore.js | 200 - deps/npm/test/tap/git-prepare.js | 166 - deps/npm/test/tap/github-shortcut-package.js | 61 - deps/npm/test/tap/github-shortcut.js | 61 - deps/npm/test/tap/gitlab-shortcut-package.js | 60 - deps/npm/test/tap/gitlab-shortcut.js | 57 - .../tap/global-prefix-set-in-userconfig.js | 36 - deps/npm/test/tap/graceful-restart.js | 94 - deps/npm/test/tap/help.js | 26 - deps/npm/test/tap/hook.js | 243 - deps/npm/test/tap/ignore-install-link.js | 71 - deps/npm/test/tap/ignore-scripts.js | 128 - deps/npm/test/tap/init-create.js | 171 - deps/npm/test/tap/init-interrupt.js | 38 - deps/npm/test/tap/install-actions.js | 117 - deps/npm/test/tap/install-at-locally.js | 52 - .../test/tap/install-at-sub-path-locally.js | 49 - deps/npm/test/tap/install-bad-dep-format.js | 33 - deps/npm/test/tap/install-bad-man.js | 61 - deps/npm/test/tap/install-before.js | 89 - deps/npm/test/tap/install-bin-null.js | 73 - .../test/tap/install-cli-only-development.js | 95 - .../test/tap/install-cli-only-production.js | 81 - .../test/tap/install-cli-only-shrinkwrap.js | 119 - .../test/tap/install-cli-production-nosave.js | 48 - deps/npm/test/tap/install-cli-production.js | 79 - deps/npm/test/tap/install-cli-unicode.js | 57 - .../test/tap/install-contributors-count.js | 69 - .../test/tap/install-dep-classification.js | 188 - .../tap/install-duplicate-deps-warning.js | 51 - .../test/tap/install-from-local-multipath.js | 173 - deps/npm/test/tap/install-from-local.js | 89 - .../test/tap/install-into-likenamed-folder.js | 44 - deps/npm/test/tap/install-lifecycle.js | 35 - .../test/tap/install-link-metadeps-locally.js | 52 - .../tap/install-link-metadeps-subfolders.js | 68 - deps/npm/test/tap/install-link-scripts.js | 121 - deps/npm/test/tap/install-local-dep-cycle.js | 79 - deps/npm/test/tap/install-local-from-local.js | 94 - deps/npm/test/tap/install-man.js | 57 - deps/npm/test/tap/install-mention-funding.js | 127 - deps/npm/test/tap/install-noargs-dev.js | 90 - deps/npm/test/tap/install-order.js | 65 - .../test/tap/install-package-json-order.js | 42 - .../npm/test/tap/install-package-lock-only.js | 123 - deps/npm/test/tap/install-parse-error.js | 50 - .../test/tap/install-property-conflicts.js | 53 - .../test/tap/install-report-just-installed.js | 74 - .../tap/install-save-consistent-newlines.js | 98 - deps/npm/test/tap/install-save-exact.js | 82 - deps/npm/test/tap/install-save-local.js | 181 - deps/npm/test/tap/install-save-prefix.js | 164 - .../tap/install-scoped-already-installed.js | 129 - deps/npm/test/tap/install-scoped-link.js | 73 - .../install-scoped-with-bundled-dependency.js | 83 - .../install-scoped-with-peer-dependency.js | 40 - .../npm/test/tap/install-shrinkwrapped-git.js | 155 - ...stall-test-cli-with-broken-package-lock.js | 118 - .../install-test-cli-without-package-lock.js | 64 - deps/npm/test/tap/install-windows-newlines.js | 90 - .../tap/install-with-dev-dep-duplicate.js | 81 - .../tap/install-without-registry-config.js | 35 - deps/npm/test/tap/install.fund.js | 99 - deps/npm/test/tap/invalid-cmd-exit-code.js | 34 - .../test/tap/invalid-dep-version-filtering.js | 135 - deps/npm/test/tap/is-fs-access-available.js | 55 - deps/npm/test/tap/is-registry.js | 27 - deps/npm/test/tap/it.js | 65 - deps/npm/test/tap/legacy-ignore-nested-nm.js | 64 - deps/npm/test/tap/legacy-missing-bindir.js | 78 - deps/npm/test/tap/legacy-no-auth-leak.js | 74 - deps/npm/test/tap/legacy-platform-all.js | 74 - deps/npm/test/tap/legacy-platform.js | 64 - deps/npm/test/tap/legacy-private.js | 58 - deps/npm/test/tap/legacy-test-package.js | 70 - deps/npm/test/tap/lifecycle-INIT_CWD.js | 36 - deps/npm/test/tap/lifecycle-order.js | 33 - deps/npm/test/tap/lifecycle-path.js | 210 - deps/npm/test/tap/link.js | 205 - .../test/tap/local-args-relative-to-cwd.js | 65 - deps/npm/test/tap/locker.js | 77 - deps/npm/test/tap/lockfile-empty-dep-value.js | 68 - deps/npm/test/tap/lockfile-http-deps.js | 90 - deps/npm/test/tap/logout-scoped.js | 69 - deps/npm/test/tap/logout.js | 67 - deps/npm/test/tap/ls-depth-cli.js | 196 - deps/npm/test/tap/ls-depth-unmet.js | 157 - deps/npm/test/tap/ls-env.js | 120 - deps/npm/test/tap/ls-l-depth-0.js | 100 - deps/npm/test/tap/ls-no-results.js | 12 - deps/npm/test/tap/ls-peer.js | 123 - deps/npm/test/tap/ls-production-and-dev.js | 157 - deps/npm/test/tap/ls-top-errors.js | 71 - deps/npm/test/tap/ls.js | 222 - .../meta-test-flaky-root-ownership-test.js | 20 - deps/npm/test/tap/nerf-dart.js | 32 - deps/npm/test/tap/nested-extraneous.js | 53 - deps/npm/test/tap/no-global-warns.js | 65 - deps/npm/test/tap/no-scan-full-global-dir.js | 107 - .../test/tap/noargs-install-config-save.js | 76 - deps/npm/test/tap/node-modules-path-munge.js | 39 - .../npm/test/tap/normalize-package-explode.js | 26 - deps/npm/test/tap/npm-api-not-loaded-error.js | 48 - deps/npm/test/tap/onload.js | 39 - .../optional-metadep-rollback-collision.js | 188 - deps/npm/test/tap/org.js | 136 - deps/npm/test/tap/outdated-bad-read-tree.js | 21 - deps/npm/test/tap/outdated-color.js | 75 - deps/npm/test/tap/outdated-depth.js | 76 - deps/npm/test/tap/outdated-git.js | 61 - deps/npm/test/tap/outdated-json.js | 123 - deps/npm/test/tap/outdated-latest.js | 109 - deps/npm/test/tap/outdated-long.js | 93 - deps/npm/test/tap/outdated-remote.js | 89 - deps/npm/test/tap/outdated-symlink.js | 133 - deps/npm/test/tap/outdated.js | 123 - deps/npm/test/tap/override-bundled.js | 191 - deps/npm/test/tap/owner.js | 159 - deps/npm/test/tap/pack-files-and-ignores.js | 707 - deps/npm/test/tap/pack-scoped.js | 81 - deps/npm/test/tap/pack.js | 199 - deps/npm/test/tap/peer-deps.js | 52 - .../pick-manifest-from-registry-metadata.js | 145 - deps/npm/test/tap/ping.js | 95 - deps/npm/test/tap/prepare.js | 89 - deps/npm/test/tap/prepublish-only.js | 136 - deps/npm/test/tap/prepublish.js | 118 - deps/npm/test/tap/process-logger.js | 12 - deps/npm/test/tap/progress-config.js | 87 - deps/npm/test/tap/prune-dev-dep-cycle.js | 85 - deps/npm/test/tap/prune-dev-dep-with-bins.js | 103 - .../test/tap/prune-with-dev-dep-duplicate.js | 103 - deps/npm/test/tap/prune-with-only-dev-deps.js | 114 - deps/npm/test/tap/prune.js | 121 - deps/npm/test/tap/publish-access-scoped.js | 65 - ...ublish-access-unscoped-restricted-fails.js | 38 - deps/npm/test/tap/publish-access-unscoped.js | 65 - deps/npm/test/tap/publish-config.js | 69 - .../test/tap/publish-invalid-semver-tag.js | 76 - deps/npm/test/tap/publish-scoped.js | 81 - deps/npm/test/tap/publish.js | 162 - deps/npm/test/tap/pwd-prefix.js | 35 - deps/npm/test/tap/referer.js | 83 - deps/npm/test/tap/repo.js | 175 - deps/npm/test/tap/retry-on-stale-cache.js | 195 - .../npm/test/tap/run-script-filter-private.js | 52 - deps/npm/test/tap/run-script.js | 373 - deps/npm/test/tap/save-optional.js | 81 - deps/npm/test/tap/scope-header.js | 160 - .../test/tap/scripts-whitespace-windows.js | 88 - .../npm/test/tap/search.all-package-search.js | 207 - deps/npm/test/tap/search.js | 254 - deps/npm/test/tap/semver-doc.js | 14 - deps/npm/test/tap/shared-linked.js | 151 - deps/npm/test/tap/shrinkwrap-_auth.js | 109 - deps/npm/test/tap/shrinkwrap-default-dev.js | 93 - .../npm/test/tap/shrinkwrap-dev-dependency.js | 70 - .../test/tap/shrinkwrap-empty-dep-value.js | 66 - deps/npm/test/tap/shrinkwrap-empty-deps.js | 58 - .../npm/test/tap/shrinkwrap-extra-metadata.js | 60 - deps/npm/test/tap/shrinkwrap-global-auth.js | 97 - deps/npm/test/tap/shrinkwrap-lifecycle-cwd.js | 87 - deps/npm/test/tap/shrinkwrap-lifecycle.js | 37 - .../test/tap/shrinkwrap-local-dependency.js | 124 - deps/npm/test/tap/shrinkwrap-nested.js | 165 - .../tap/shrinkwrap-optional-dependency.js | 91 - .../test/tap/shrinkwrap-optional-platform.js | 107 - .../test/tap/shrinkwrap-optional-property.js | 87 - .../tap/shrinkwrap-prod-dependency-also.js | 85 - .../test/tap/shrinkwrap-prod-dependency.js | 76 - .../test/tap/shrinkwrap-resolve-conflict.js | 117 - .../shrinkwrap-save-dev-with-existing-deps.js | 92 - .../shrinkwrap-save-with-existing-dev-deps.js | 79 - deps/npm/test/tap/shrinkwrap-scoped-auth.js | 96 - .../tap/shrinkwrap-shared-dev-dependency.js | 89 - deps/npm/test/tap/shrinkwrap-version-match.js | 115 - deps/npm/test/tap/sorted-package-json.js | 61 - deps/npm/test/tap/spawn-enoent-help.js | 35 - deps/npm/test/tap/spawn-enoent.js | 38 - deps/npm/test/tap/spec-local-specifiers.js | 752 - .../splat-with-only-prerelease-to-latest.js | 95 - deps/npm/test/tap/startstop.js | 61 - deps/npm/test/tap/symlink-cycle.js | 44 - deps/npm/test/tap/tag-version-prefix.js | 73 - deps/npm/test/tap/tagged-version-matching.js | 151 - deps/npm/test/tap/team.js | 189 - deps/npm/test/tap/test-run-ls.js | 33 - deps/npm/test/tap/tree-style.js | 127 - deps/npm/test/tap/umask-lifecycle.js | 61 - deps/npm/test/tap/uninstall-in-reverse.js | 38 - deps/npm/test/tap/uninstall-link-clean.js | 113 - deps/npm/test/tap/uninstall-package.js | 85 - deps/npm/test/tap/uninstall-save.js | 72 - deps/npm/test/tap/unit-child-path.js | 16 - .../test/tap/unit-deps-earliestInstallable.js | 114 - .../test/tap/unit-deps-removeObsoleteDep.js | 44 - deps/npm/test/tap/unit-deps-replaceModule.js | 65 - deps/npm/test/tap/unit-module-name.js | 40 - deps/npm/test/tap/unit-package-id.js | 17 - deps/npm/test/tap/unit-token-validate-cidr.js | 18 - deps/npm/test/tap/unpack-foreign-tarball.js | 84 - deps/npm/test/tap/unpublish-config.js | 70 - deps/npm/test/tap/unsupported.js | 48 - deps/npm/test/tap/update-examples.js | 221 - deps/npm/test/tap/update-path.js | 35 - deps/npm/test/tap/update-symlink.js | 109 - deps/npm/test/tap/upgrade-lifecycles.js | 88 - deps/npm/test/tap/url-dependencies.js | 61 - deps/npm/test/tap/utils.funding.js | 657 - .../test/tap/verify-no-lifecycle-on-repo.js | 73 - .../test/tap/version-allow-same-version.js | 70 - .../test/tap/version-commit-hooks-default.js | 13 - deps/npm/test/tap/version-commit-hooks.js | 55 - .../test/tap/version-consistent-newlines.js | 80 - deps/npm/test/tap/version-from-git.js | 220 - deps/npm/test/tap/version-git-not-clean.js | 79 - deps/npm/test/tap/version-lifecycle.js | 202 - deps/npm/test/tap/version-message-config.js | 58 - deps/npm/test/tap/version-no-git.js | 43 - deps/npm/test/tap/version-no-package.js | 23 - deps/npm/test/tap/version-no-tags.js | 58 - deps/npm/test/tap/version-prerelease-id.js | 37 - .../tap/version-sub-directory-shrinkwrap.js | 65 - deps/npm/test/tap/version-sub-directory.js | 56 - .../npm/test/tap/version-update-shrinkwrap.js | 127 - deps/npm/test/tap/view.js | 381 - deps/npm/test/tap/whoami.js | 76 - deps/npm/test/util/mock-tarball.js | 47 - 4238 files changed, 196173 insertions(+), 300159 deletions(-) create mode 100644 deps/npm/.eslintrc.json delete mode 100644 deps/npm/.travis.yml mode change 100644 => 100755 deps/npm/bin/npm.cmd mode change 100644 => 100755 deps/npm/bin/npx mode change 100644 => 100755 deps/npm/bin/npx.cmd create mode 100644 deps/npm/changelogs/CHANGELOG-6.md delete mode 100644 deps/npm/docs/content/cli-commands/npm-build.md create mode 100644 deps/npm/docs/content/cli-commands/npm-exec.md create mode 100644 deps/npm/docs/content/cli-commands/npm-explain.md create mode 100644 deps/npm/docs/content/cli-commands/npx.md delete mode 100644 deps/npm/docs/public/cli-commands/npm-build/index.html create mode 100644 deps/npm/docs/public/cli-commands/npm-exec/index.html create mode 100644 deps/npm/docs/public/cli-commands/npm-explain/index.html create mode 100644 deps/npm/docs/public/cli-commands/npx/index.html create mode 100644 deps/npm/docs/public/favicon-32x32.png rename deps/npm/docs/public/google-fonts/s/poppins/{v12 => v13}/pxiByp8kv8JHgFVrLDz8Z1xlEw.woff (100%) rename deps/npm/docs/public/google-fonts/s/poppins/{v12 => v13}/pxiByp8kv8JHgFVrLDz8Z1xlFQ.woff2 (100%) rename deps/npm/docs/public/google-fonts/s/poppins/{v12 => v13}/pxiByp8kv8JHgFVrLGT9Z1xlEw.woff (100%) rename deps/npm/docs/public/google-fonts/s/poppins/{v12 => v13}/pxiByp8kv8JHgFVrLGT9Z1xlFQ.woff2 (100%) rename deps/npm/docs/public/google-fonts/s/poppins/{v12 => v13}/pxiEyp8kv8JHgFVrJJfecg.woff2 (100%) rename deps/npm/docs/public/google-fonts/s/poppins/{v12 => v13}/pxiEyp8kv8JHgFVrJJfedA.woff (100%) delete mode 100644 deps/npm/docs/public/static/d/2215187023.json create mode 100644 deps/npm/docs/public/static/d/2496503923.json rename deps/npm/docs/public/static/d/{2417117884.json => 63159454.json} (100%) create mode 100644 deps/npm/lib/birthday.js delete mode 100644 deps/npm/lib/build.js create mode 100644 deps/npm/lib/cli.js delete mode 100644 deps/npm/lib/config/bin-links.js delete mode 100644 deps/npm/lib/config/clear-credentials-by-uri.js delete mode 100644 deps/npm/lib/config/cmd-list.js delete mode 100644 deps/npm/lib/config/core.js delete mode 100644 deps/npm/lib/config/defaults.js delete mode 100644 deps/npm/lib/config/figgy-config.js delete mode 100644 deps/npm/lib/config/gentle-fs.js delete mode 100644 deps/npm/lib/config/get-credentials-by-uri.js delete mode 100644 deps/npm/lib/config/lifecycle.js delete mode 100644 deps/npm/lib/config/load-cafile.js delete mode 100644 deps/npm/lib/config/load-prefix.js delete mode 100644 deps/npm/lib/config/nerf-dart.js delete mode 100644 deps/npm/lib/config/set-credentials-by-uri.js delete mode 100644 deps/npm/lib/config/set-user.js delete mode 100644 deps/npm/lib/doctor/check-files-permission.js delete mode 100644 deps/npm/lib/doctor/check-ping.js delete mode 100644 deps/npm/lib/doctor/get-git-path.js delete mode 100644 deps/npm/lib/doctor/get-latest-nodejs-version.js delete mode 100644 deps/npm/lib/doctor/get-latest-npm-version.js delete mode 100644 deps/npm/lib/doctor/verify-cached-files.js create mode 100644 deps/npm/lib/exec.js create mode 100644 deps/npm/lib/explain.js delete mode 100644 deps/npm/lib/fetch-package-metadata.js delete mode 100644 deps/npm/lib/fetch-package-metadata.md create mode 100644 deps/npm/lib/find-dupes.js delete mode 100644 deps/npm/lib/install/access-error.js delete mode 100644 deps/npm/lib/install/action/build.js delete mode 100644 deps/npm/lib/install/action/extract-worker.js delete mode 100644 deps/npm/lib/install/action/extract.js delete mode 100644 deps/npm/lib/install/action/fetch.js delete mode 100644 deps/npm/lib/install/action/finalize.js delete mode 100644 deps/npm/lib/install/action/global-install.js delete mode 100644 deps/npm/lib/install/action/global-link.js delete mode 100644 deps/npm/lib/install/action/install.js delete mode 100644 deps/npm/lib/install/action/move.js delete mode 100644 deps/npm/lib/install/action/postinstall.js delete mode 100644 deps/npm/lib/install/action/preinstall.js delete mode 100644 deps/npm/lib/install/action/prepare.js delete mode 100644 deps/npm/lib/install/action/refresh-package-json.js delete mode 100644 deps/npm/lib/install/action/remove.js delete mode 100644 deps/npm/lib/install/action/unbuild.js delete mode 100644 deps/npm/lib/install/actions.js delete mode 100644 deps/npm/lib/install/and-add-parent-to-errors.js delete mode 100644 deps/npm/lib/install/and-finish-tracker.js delete mode 100644 deps/npm/lib/install/and-ignore-errors.js delete mode 100644 deps/npm/lib/install/audit.js delete mode 100644 deps/npm/lib/install/check-permissions.js delete mode 100644 deps/npm/lib/install/copy-tree.js delete mode 100644 deps/npm/lib/install/decompose-actions.js delete mode 100644 deps/npm/lib/install/deps.js delete mode 100644 deps/npm/lib/install/diff-trees.js delete mode 100644 deps/npm/lib/install/exists.js delete mode 100644 deps/npm/lib/install/flatten-tree.js delete mode 100644 deps/npm/lib/install/fund.js delete mode 100644 deps/npm/lib/install/get-requested.js delete mode 100644 deps/npm/lib/install/has-modern-meta.js delete mode 100644 deps/npm/lib/install/inflate-bundled.js delete mode 100644 deps/npm/lib/install/inflate-shrinkwrap.js delete mode 100644 deps/npm/lib/install/is-dev-dep.js delete mode 100644 deps/npm/lib/install/is-extraneous.js delete mode 100644 deps/npm/lib/install/is-fs-access-available.js delete mode 100644 deps/npm/lib/install/is-only-dev.js delete mode 100644 deps/npm/lib/install/is-only-optional.js delete mode 100644 deps/npm/lib/install/is-opt-dep.js delete mode 100644 deps/npm/lib/install/is-prod-dep.js delete mode 100644 deps/npm/lib/install/module-staging-path.js delete mode 100644 deps/npm/lib/install/mutate-into-logical-tree.js delete mode 100644 deps/npm/lib/install/node.js delete mode 100644 deps/npm/lib/install/read-shrinkwrap.js delete mode 100644 deps/npm/lib/install/realize-shrinkwrap-specifier.js delete mode 100644 deps/npm/lib/install/report-optional-failure.js delete mode 100644 deps/npm/lib/install/save.js delete mode 100644 deps/npm/lib/install/update-package-json.js delete mode 100644 deps/npm/lib/install/validate-args.js delete mode 100644 deps/npm/lib/install/validate-tree.js delete mode 100644 deps/npm/lib/install/writable.js create mode 100644 deps/npm/lib/ll.js delete mode 100644 deps/npm/lib/search/all-package-metadata.js delete mode 100644 deps/npm/lib/search/all-package-search.js delete mode 100644 deps/npm/lib/substack.js delete mode 100644 deps/npm/lib/unbuild.js create mode 100644 deps/npm/lib/utils/cleanup-log-files.js create mode 100644 deps/npm/lib/utils/cmd-list.js create mode 100644 deps/npm/lib/utils/completion/none.js create mode 100644 deps/npm/lib/utils/config.js delete mode 100644 deps/npm/lib/utils/correct-mkdir.js create mode 100644 deps/npm/lib/utils/deref-command.js create mode 100644 deps/npm/lib/utils/explain-dep.js create mode 100644 deps/npm/lib/utils/explain-eresolve.js create mode 100644 deps/npm/lib/utils/flat-options.js delete mode 100644 deps/npm/lib/utils/funding.js delete mode 100644 deps/npm/lib/utils/gently-rm.js create mode 100644 deps/npm/lib/utils/get-identity.js create mode 100644 deps/npm/lib/utils/get-project-scope.js delete mode 100644 deps/npm/lib/utils/gunzip-maybe.js create mode 100644 deps/npm/lib/utils/hosted-git-info-from-manifest.js delete mode 100644 deps/npm/lib/utils/is-registry.js delete mode 100644 deps/npm/lib/utils/lifecycle.js delete mode 100644 deps/npm/lib/utils/link.js delete mode 100644 deps/npm/lib/utils/locker.js delete mode 100644 deps/npm/lib/utils/move.js create mode 100644 deps/npm/lib/utils/npm-usage.js delete mode 100644 deps/npm/lib/utils/parse-json.js create mode 100644 deps/npm/lib/utils/path.js create mode 100644 deps/npm/lib/utils/ping.js create mode 100644 deps/npm/lib/utils/proc-log-listener.js create mode 100644 deps/npm/lib/utils/reify-output.js delete mode 100644 deps/npm/lib/utils/replace-info.js create mode 100644 deps/npm/lib/utils/set-user-agent.js create mode 100644 deps/npm/lib/utils/setup-log.js create mode 100644 deps/npm/lib/utils/tar.js delete mode 100644 deps/npm/lib/utils/temp-filename.js delete mode 100644 deps/npm/lib/utils/umask.js create mode 100644 deps/npm/lib/utils/update-notifier.js delete mode 100644 deps/npm/lib/visnup.js delete mode 100644 deps/npm/lib/xmas.js delete mode 100644 deps/npm/man/man1/npm-build.1 create mode 100644 deps/npm/man/man1/npm-exec.1 create mode 100644 deps/npm/man/man1/npm-explain.1 create mode 100644 deps/npm/node_modules/@npmcli/arborist/LICENSE create mode 100644 deps/npm/node_modules/@npmcli/arborist/README.md create mode 100644 deps/npm/node_modules/@npmcli/arborist/lib/add-rm-pkg-deps.js create mode 100644 deps/npm/node_modules/@npmcli/arborist/lib/arborist/audit.js create mode 100644 deps/npm/node_modules/@npmcli/arborist/lib/arborist/build-ideal-tree.js create mode 100644 deps/npm/node_modules/@npmcli/arborist/lib/arborist/deduper.js create mode 100644 deps/npm/node_modules/@npmcli/arborist/lib/arborist/index.js create mode 100644 deps/npm/node_modules/@npmcli/arborist/lib/arborist/load-actual.js create mode 100644 deps/npm/node_modules/@npmcli/arborist/lib/arborist/load-virtual.js create mode 100644 deps/npm/node_modules/@npmcli/arborist/lib/arborist/load-workspaces.js create mode 100644 deps/npm/node_modules/@npmcli/arborist/lib/arborist/pruner.js create mode 100644 deps/npm/node_modules/@npmcli/arborist/lib/arborist/rebuild.js create mode 100644 deps/npm/node_modules/@npmcli/arborist/lib/arborist/reify.js create mode 100644 deps/npm/node_modules/@npmcli/arborist/lib/audit-report.js create mode 100644 deps/npm/node_modules/@npmcli/arborist/lib/calc-dep-flags.js create mode 100644 deps/npm/node_modules/@npmcli/arborist/lib/consistent-resolve.js create mode 100644 deps/npm/node_modules/@npmcli/arborist/lib/dep-spec.js create mode 100644 deps/npm/node_modules/@npmcli/arborist/lib/dep-valid.js create mode 100644 deps/npm/node_modules/@npmcli/arborist/lib/diff.js create mode 100644 deps/npm/node_modules/@npmcli/arborist/lib/edge.js create mode 100644 deps/npm/node_modules/@npmcli/arborist/lib/from-path.js create mode 100644 deps/npm/node_modules/@npmcli/arborist/lib/gather-dep-set.js create mode 100644 deps/npm/node_modules/@npmcli/arborist/lib/index.js create mode 100644 deps/npm/node_modules/@npmcli/arborist/lib/inventory.js create mode 100644 deps/npm/node_modules/@npmcli/arborist/lib/link.js create mode 100644 deps/npm/node_modules/@npmcli/arborist/lib/node.js create mode 100644 deps/npm/node_modules/@npmcli/arborist/lib/optional-set.js create mode 100644 deps/npm/node_modules/@npmcli/arborist/lib/peer-set.js create mode 100644 deps/npm/node_modules/@npmcli/arborist/lib/proc-log.js rename deps/npm/node_modules/{read-package-tree => @npmcli/arborist/lib}/realpath.js (94%) create mode 100644 deps/npm/node_modules/@npmcli/arborist/lib/relpath.js create mode 100644 deps/npm/node_modules/@npmcli/arborist/lib/retire-path.js create mode 100644 deps/npm/node_modules/@npmcli/arborist/lib/shrinkwrap.js create mode 100644 deps/npm/node_modules/@npmcli/arborist/lib/spec-from-lock.js create mode 100644 deps/npm/node_modules/@npmcli/arborist/lib/tracker.js create mode 100644 deps/npm/node_modules/@npmcli/arborist/lib/version-from-tgz.js create mode 100644 deps/npm/node_modules/@npmcli/arborist/lib/vuln.js create mode 100644 deps/npm/node_modules/@npmcli/arborist/lib/yarn-lock.js create mode 100644 deps/npm/node_modules/@npmcli/arborist/package.json create mode 100644 deps/npm/node_modules/@npmcli/ci-detect/LICENSE create mode 100644 deps/npm/node_modules/@npmcli/ci-detect/README.md create mode 100644 deps/npm/node_modules/@npmcli/ci-detect/index.js create mode 100644 deps/npm/node_modules/@npmcli/ci-detect/package.json create mode 100644 deps/npm/node_modules/@npmcli/config/LICENSE create mode 100644 deps/npm/node_modules/@npmcli/config/README.md create mode 100644 deps/npm/node_modules/@npmcli/config/lib/env-replace.js create mode 100644 deps/npm/node_modules/@npmcli/config/lib/index.js create mode 100644 deps/npm/node_modules/@npmcli/config/lib/nerf-dart.js create mode 100644 deps/npm/node_modules/@npmcli/config/lib/parse-field.js create mode 100644 deps/npm/node_modules/@npmcli/config/lib/proc-log.js create mode 100644 deps/npm/node_modules/@npmcli/config/lib/set-envs.js create mode 100644 deps/npm/node_modules/@npmcli/config/lib/type-defs.js create mode 100644 deps/npm/node_modules/@npmcli/config/lib/type-description.js create mode 100644 deps/npm/node_modules/@npmcli/config/lib/umask.js create mode 100644 deps/npm/node_modules/@npmcli/config/package.json create mode 100644 deps/npm/node_modules/@npmcli/git/LICENSE create mode 100644 deps/npm/node_modules/@npmcli/git/README.md create mode 100644 deps/npm/node_modules/@npmcli/git/lib/clone.js create mode 100644 deps/npm/node_modules/@npmcli/git/lib/env.js create mode 100644 deps/npm/node_modules/@npmcli/git/lib/find.js create mode 100644 deps/npm/node_modules/@npmcli/git/lib/index.js create mode 100644 deps/npm/node_modules/@npmcli/git/lib/is-clean.js create mode 100644 deps/npm/node_modules/@npmcli/git/lib/is.js create mode 100644 deps/npm/node_modules/@npmcli/git/lib/lines-to-revs.js create mode 100644 deps/npm/node_modules/@npmcli/git/lib/opts.js create mode 100644 deps/npm/node_modules/@npmcli/git/lib/proc-log.js create mode 100644 deps/npm/node_modules/@npmcli/git/lib/revs.js create mode 100644 deps/npm/node_modules/@npmcli/git/lib/should-retry.js create mode 100644 deps/npm/node_modules/@npmcli/git/lib/spawn.js create mode 100644 deps/npm/node_modules/@npmcli/git/lib/which.js create mode 100644 deps/npm/node_modules/@npmcli/git/package.json create mode 100644 deps/npm/node_modules/@npmcli/installed-package-contents/LICENSE create mode 100644 deps/npm/node_modules/@npmcli/installed-package-contents/README.md create mode 100755 deps/npm/node_modules/@npmcli/installed-package-contents/index.js create mode 100644 deps/npm/node_modules/@npmcli/installed-package-contents/package.json create mode 100644 deps/npm/node_modules/@npmcli/map-workspaces/CHANGELOG.md create mode 100644 deps/npm/node_modules/@npmcli/map-workspaces/LICENSE create mode 100644 deps/npm/node_modules/@npmcli/map-workspaces/README.md create mode 100644 deps/npm/node_modules/@npmcli/map-workspaces/index.js create mode 100644 deps/npm/node_modules/@npmcli/map-workspaces/package.json create mode 100644 deps/npm/node_modules/@npmcli/metavuln-calculator/LICENSE create mode 100644 deps/npm/node_modules/@npmcli/metavuln-calculator/README.md create mode 100644 deps/npm/node_modules/@npmcli/metavuln-calculator/lib/advisory.js create mode 100644 deps/npm/node_modules/@npmcli/metavuln-calculator/lib/get-dep-spec.js create mode 100644 deps/npm/node_modules/@npmcli/metavuln-calculator/lib/hash.js create mode 100644 deps/npm/node_modules/@npmcli/metavuln-calculator/lib/index.js create mode 100644 deps/npm/node_modules/@npmcli/metavuln-calculator/package.json create mode 100644 deps/npm/node_modules/@npmcli/move-file/LICENSE.md create mode 100644 deps/npm/node_modules/@npmcli/move-file/README.md create mode 100644 deps/npm/node_modules/@npmcli/move-file/index.js create mode 100644 deps/npm/node_modules/@npmcli/move-file/package.json create mode 100644 deps/npm/node_modules/@npmcli/name-from-folder/LICENSE create mode 100644 deps/npm/node_modules/@npmcli/name-from-folder/README.md create mode 100644 deps/npm/node_modules/@npmcli/name-from-folder/index.js create mode 100644 deps/npm/node_modules/@npmcli/name-from-folder/package.json create mode 100644 deps/npm/node_modules/@npmcli/node-gyp/lib/index.js create mode 100644 deps/npm/node_modules/@npmcli/node-gyp/package.json create mode 100644 deps/npm/node_modules/@npmcli/promise-spawn/LICENSE create mode 100644 deps/npm/node_modules/@npmcli/promise-spawn/README.md create mode 100644 deps/npm/node_modules/@npmcli/promise-spawn/index.js create mode 100644 deps/npm/node_modules/@npmcli/promise-spawn/package.json create mode 100644 deps/npm/node_modules/@npmcli/run-script/LICENSE create mode 100644 deps/npm/node_modules/@npmcli/run-script/README.md create mode 100644 deps/npm/node_modules/@npmcli/run-script/lib/is-windows.js create mode 100644 deps/npm/node_modules/@npmcli/run-script/lib/make-spawn-args.js create mode 100755 deps/npm/node_modules/@npmcli/run-script/lib/node-gyp-bin/node-gyp create mode 100755 deps/npm/node_modules/@npmcli/run-script/lib/node-gyp-bin/node-gyp.cmd create mode 100644 deps/npm/node_modules/@npmcli/run-script/lib/package-envs.js create mode 100644 deps/npm/node_modules/@npmcli/run-script/lib/run-script-pkg.js create mode 100644 deps/npm/node_modules/@npmcli/run-script/lib/run-script.js create mode 100644 deps/npm/node_modules/@npmcli/run-script/lib/set-path.js create mode 100644 deps/npm/node_modules/@npmcli/run-script/lib/validate-options.js create mode 100644 deps/npm/node_modules/@npmcli/run-script/package.json create mode 100644 deps/npm/node_modules/@tootallnate/once/dist/index.d.ts create mode 100644 deps/npm/node_modules/@tootallnate/once/dist/index.js create mode 100644 deps/npm/node_modules/@tootallnate/once/dist/index.js.map create mode 100644 deps/npm/node_modules/@tootallnate/once/package.json create mode 100644 deps/npm/node_modules/@types/color-name/LICENSE create mode 100644 deps/npm/node_modules/@types/color-name/README.md create mode 100644 deps/npm/node_modules/@types/color-name/index.d.ts create mode 100644 deps/npm/node_modules/@types/color-name/package.json delete mode 100644 deps/npm/node_modules/JSONStream/.travis.yml delete mode 100644 deps/npm/node_modules/JSONStream/LICENSE.APACHE2 delete mode 100644 deps/npm/node_modules/JSONStream/LICENSE.MIT delete mode 100755 deps/npm/node_modules/JSONStream/bin.js delete mode 100644 deps/npm/node_modules/JSONStream/examples/all_docs.js delete mode 100755 deps/npm/node_modules/JSONStream/index.js delete mode 100644 deps/npm/node_modules/JSONStream/package.json delete mode 100644 deps/npm/node_modules/JSONStream/readme.markdown delete mode 100644 deps/npm/node_modules/JSONStream/test/bool.js delete mode 100644 deps/npm/node_modules/JSONStream/test/browser.js delete mode 100644 deps/npm/node_modules/JSONStream/test/destroy_missing.js delete mode 100644 deps/npm/node_modules/JSONStream/test/doubledot1.js delete mode 100644 deps/npm/node_modules/JSONStream/test/doubledot2.js delete mode 100644 deps/npm/node_modules/JSONStream/test/empty.js delete mode 100644 deps/npm/node_modules/JSONStream/test/error_contents.js delete mode 100644 deps/npm/node_modules/JSONStream/test/fixtures/all_npm.json delete mode 100644 deps/npm/node_modules/JSONStream/test/fixtures/couch_sample.json delete mode 100644 deps/npm/node_modules/JSONStream/test/fixtures/depth.json delete mode 100644 deps/npm/node_modules/JSONStream/test/fixtures/error.json delete mode 100644 deps/npm/node_modules/JSONStream/test/fixtures/header_footer.json delete mode 100644 deps/npm/node_modules/JSONStream/test/fn.js delete mode 100644 deps/npm/node_modules/JSONStream/test/gen.js delete mode 100644 deps/npm/node_modules/JSONStream/test/header_footer.js delete mode 100644 deps/npm/node_modules/JSONStream/test/issues.js delete mode 100644 deps/npm/node_modules/JSONStream/test/keys.js delete mode 100644 deps/npm/node_modules/JSONStream/test/map.js delete mode 100644 deps/npm/node_modules/JSONStream/test/multiple_objects.js delete mode 100644 deps/npm/node_modules/JSONStream/test/multiple_objects_error.js delete mode 100644 deps/npm/node_modules/JSONStream/test/null.js delete mode 100644 deps/npm/node_modules/JSONStream/test/parsejson.js delete mode 100644 deps/npm/node_modules/JSONStream/test/run.js delete mode 100644 deps/npm/node_modules/JSONStream/test/stringify.js delete mode 100644 deps/npm/node_modules/JSONStream/test/stringify_object.js delete mode 100644 deps/npm/node_modules/JSONStream/test/test.js delete mode 100644 deps/npm/node_modules/JSONStream/test/test2.js delete mode 100644 deps/npm/node_modules/JSONStream/test/two-ways.js delete mode 100644 deps/npm/node_modules/agent-base/.travis.yml delete mode 100644 deps/npm/node_modules/agent-base/History.md create mode 100644 deps/npm/node_modules/agent-base/dist/src/index.d.ts create mode 100644 deps/npm/node_modules/agent-base/dist/src/index.js create mode 100644 deps/npm/node_modules/agent-base/dist/src/index.js.map create mode 100644 deps/npm/node_modules/agent-base/dist/src/promisify.d.ts create mode 100644 deps/npm/node_modules/agent-base/dist/src/promisify.js create mode 100644 deps/npm/node_modules/agent-base/dist/src/promisify.js.map delete mode 100644 deps/npm/node_modules/agent-base/index.d.ts delete mode 100644 deps/npm/node_modules/agent-base/index.js delete mode 100644 deps/npm/node_modules/agent-base/patch-core.js create mode 100644 deps/npm/node_modules/agent-base/src/index.ts create mode 100644 deps/npm/node_modules/agent-base/src/promisify.ts delete mode 100644 deps/npm/node_modules/agent-base/test/ssl-cert-snakeoil.key delete mode 100644 deps/npm/node_modules/agent-base/test/ssl-cert-snakeoil.pem delete mode 100644 deps/npm/node_modules/agent-base/test/test.js create mode 100644 deps/npm/node_modules/agentkeepalive/LICENSE delete mode 100644 deps/npm/node_modules/agentkeepalive/lib/_http_agent.js create mode 100644 deps/npm/node_modules/agentkeepalive/lib/constants.js create mode 100644 deps/npm/node_modules/aggregate-error/index.d.ts create mode 100644 deps/npm/node_modules/aggregate-error/index.js rename deps/npm/node_modules/{boxen => aggregate-error}/license (100%) create mode 100644 deps/npm/node_modules/aggregate-error/package.json create mode 100644 deps/npm/node_modules/aggregate-error/readme.md delete mode 100644 deps/npm/node_modules/ajv/dist/nodent.min.js delete mode 100644 deps/npm/node_modules/ajv/dist/regenerator.min.js delete mode 100644 deps/npm/node_modules/ajv/lib/$data.js delete mode 100644 deps/npm/node_modules/ajv/lib/compile/_rules.js create mode 100644 deps/npm/node_modules/ajv/lib/data.js create mode 100644 deps/npm/node_modules/ajv/lib/definition_schema.js create mode 100644 deps/npm/node_modules/ajv/lib/dot/comment.jst create mode 100644 deps/npm/node_modules/ajv/lib/dot/if.jst create mode 100644 deps/npm/node_modules/ajv/lib/dotjs/comment.js create mode 100644 deps/npm/node_modules/ajv/lib/dotjs/if.js create mode 100644 deps/npm/node_modules/ajv/lib/dotjs/index.js delete mode 100644 deps/npm/node_modules/ajv/lib/patternGroups.js delete mode 100644 deps/npm/node_modules/ajv/lib/refs/$data.json create mode 100644 deps/npm/node_modules/ajv/lib/refs/data.json create mode 100644 deps/npm/node_modules/ajv/lib/refs/json-schema-draft-07.json create mode 100644 deps/npm/node_modules/ajv/lib/refs/json-schema-secure.json delete mode 100644 deps/npm/node_modules/ajv/lib/refs/json-schema-v5.json create mode 100755 deps/npm/node_modules/ajv/scripts/publish-built-version delete mode 100644 deps/npm/node_modules/ansi-align/CHANGELOG.md delete mode 100644 deps/npm/node_modules/ansi-align/LICENSE delete mode 100644 deps/npm/node_modules/ansi-align/README.md delete mode 100644 deps/npm/node_modules/ansi-align/index.js delete mode 100644 deps/npm/node_modules/ansi-align/package.json create mode 100644 deps/npm/node_modules/ansi-styles/index.d.ts delete mode 100644 deps/npm/node_modules/are-we-there-yet/node_modules/readable-stream/.travis.yml delete mode 100644 deps/npm/node_modules/are-we-there-yet/node_modules/readable-stream/GOVERNANCE.md delete mode 100644 deps/npm/node_modules/are-we-there-yet/node_modules/readable-stream/LICENSE delete mode 100644 deps/npm/node_modules/are-we-there-yet/node_modules/readable-stream/README.md delete mode 100644 deps/npm/node_modules/are-we-there-yet/node_modules/readable-stream/doc/wg-meetings/2015-01-30.md delete mode 100644 deps/npm/node_modules/are-we-there-yet/node_modules/readable-stream/lib/_stream_duplex.js delete mode 100644 deps/npm/node_modules/are-we-there-yet/node_modules/readable-stream/lib/_stream_passthrough.js delete mode 100644 deps/npm/node_modules/are-we-there-yet/node_modules/readable-stream/lib/_stream_readable.js delete mode 100644 deps/npm/node_modules/are-we-there-yet/node_modules/readable-stream/lib/_stream_transform.js delete mode 100644 deps/npm/node_modules/are-we-there-yet/node_modules/readable-stream/lib/_stream_writable.js delete mode 100644 deps/npm/node_modules/are-we-there-yet/node_modules/readable-stream/lib/internal/streams/destroy.js delete mode 100644 deps/npm/node_modules/are-we-there-yet/node_modules/readable-stream/lib/internal/streams/stream-browser.js delete mode 100644 deps/npm/node_modules/are-we-there-yet/node_modules/readable-stream/lib/internal/streams/stream.js delete mode 100644 deps/npm/node_modules/are-we-there-yet/node_modules/readable-stream/package.json delete mode 100644 deps/npm/node_modules/are-we-there-yet/node_modules/readable-stream/readable-browser.js delete mode 100644 deps/npm/node_modules/are-we-there-yet/node_modules/readable-stream/readable.js delete mode 100644 deps/npm/node_modules/are-we-there-yet/node_modules/string_decoder/LICENSE delete mode 100644 deps/npm/node_modules/are-we-there-yet/node_modules/string_decoder/README.md delete mode 100644 deps/npm/node_modules/are-we-there-yet/node_modules/string_decoder/lib/string_decoder.js delete mode 100644 deps/npm/node_modules/are-we-there-yet/node_modules/string_decoder/package.json create mode 100644 deps/npm/node_modules/aws4/.github/FUNDING.yml create mode 100644 deps/npm/node_modules/bcrypt-pbkdf/CONTRIBUTING.md create mode 100644 deps/npm/node_modules/bin-links/lib/bin-target.js create mode 100644 deps/npm/node_modules/bin-links/lib/check-bin.js create mode 100644 deps/npm/node_modules/bin-links/lib/check-bins.js create mode 100644 deps/npm/node_modules/bin-links/lib/fix-bin.js create mode 100644 deps/npm/node_modules/bin-links/lib/get-node-modules.js create mode 100644 deps/npm/node_modules/bin-links/lib/get-paths.js create mode 100644 deps/npm/node_modules/bin-links/lib/get-prefix.js create mode 100644 deps/npm/node_modules/bin-links/lib/is-windows.js create mode 100644 deps/npm/node_modules/bin-links/lib/link-bin.js create mode 100644 deps/npm/node_modules/bin-links/lib/link-bins.js create mode 100644 deps/npm/node_modules/bin-links/lib/link-gently.js create mode 100644 deps/npm/node_modules/bin-links/lib/link-mans.js create mode 100644 deps/npm/node_modules/bin-links/lib/man-target.js create mode 100644 deps/npm/node_modules/bin-links/lib/shim-bin.js delete mode 100644 deps/npm/node_modules/bluebird/LICENSE delete mode 100644 deps/npm/node_modules/bluebird/README.md delete mode 100644 deps/npm/node_modules/bluebird/changelog.md delete mode 100644 deps/npm/node_modules/bluebird/js/browser/bluebird.core.js delete mode 100644 deps/npm/node_modules/bluebird/js/browser/bluebird.core.min.js delete mode 100644 deps/npm/node_modules/bluebird/js/browser/bluebird.js delete mode 100644 deps/npm/node_modules/bluebird/js/browser/bluebird.min.js delete mode 100644 deps/npm/node_modules/bluebird/js/release/any.js delete mode 100644 deps/npm/node_modules/bluebird/js/release/assert.js delete mode 100644 deps/npm/node_modules/bluebird/js/release/async.js delete mode 100644 deps/npm/node_modules/bluebird/js/release/bind.js delete mode 100644 deps/npm/node_modules/bluebird/js/release/bluebird.js delete mode 100644 deps/npm/node_modules/bluebird/js/release/call_get.js delete mode 100644 deps/npm/node_modules/bluebird/js/release/cancel.js delete mode 100644 deps/npm/node_modules/bluebird/js/release/catch_filter.js delete mode 100644 deps/npm/node_modules/bluebird/js/release/context.js delete mode 100644 deps/npm/node_modules/bluebird/js/release/debuggability.js delete mode 100644 deps/npm/node_modules/bluebird/js/release/direct_resolve.js delete mode 100644 deps/npm/node_modules/bluebird/js/release/each.js delete mode 100644 deps/npm/node_modules/bluebird/js/release/errors.js delete mode 100644 deps/npm/node_modules/bluebird/js/release/es5.js delete mode 100644 deps/npm/node_modules/bluebird/js/release/filter.js delete mode 100644 deps/npm/node_modules/bluebird/js/release/finally.js delete mode 100644 deps/npm/node_modules/bluebird/js/release/generators.js delete mode 100644 deps/npm/node_modules/bluebird/js/release/join.js delete mode 100644 deps/npm/node_modules/bluebird/js/release/map.js delete mode 100644 deps/npm/node_modules/bluebird/js/release/method.js delete mode 100644 deps/npm/node_modules/bluebird/js/release/nodeback.js delete mode 100644 deps/npm/node_modules/bluebird/js/release/nodeify.js delete mode 100644 deps/npm/node_modules/bluebird/js/release/promise.js delete mode 100644 deps/npm/node_modules/bluebird/js/release/promise_array.js delete mode 100644 deps/npm/node_modules/bluebird/js/release/promisify.js delete mode 100644 deps/npm/node_modules/bluebird/js/release/props.js delete mode 100644 deps/npm/node_modules/bluebird/js/release/queue.js delete mode 100644 deps/npm/node_modules/bluebird/js/release/race.js delete mode 100644 deps/npm/node_modules/bluebird/js/release/reduce.js delete mode 100644 deps/npm/node_modules/bluebird/js/release/schedule.js delete mode 100644 deps/npm/node_modules/bluebird/js/release/settle.js delete mode 100644 deps/npm/node_modules/bluebird/js/release/some.js delete mode 100644 deps/npm/node_modules/bluebird/js/release/synchronous_inspection.js delete mode 100644 deps/npm/node_modules/bluebird/js/release/thenables.js delete mode 100644 deps/npm/node_modules/bluebird/js/release/timers.js delete mode 100644 deps/npm/node_modules/bluebird/js/release/using.js delete mode 100644 deps/npm/node_modules/bluebird/js/release/util.js delete mode 100644 deps/npm/node_modules/bluebird/package.json delete mode 100644 deps/npm/node_modules/boxen/index.js delete mode 100644 deps/npm/node_modules/boxen/package.json delete mode 100644 deps/npm/node_modules/boxen/readme.md delete mode 100644 deps/npm/node_modules/buffer-from/index.js delete mode 100644 deps/npm/node_modules/buffer-from/package.json delete mode 100644 deps/npm/node_modules/buffer-from/readme.md delete mode 100644 deps/npm/node_modules/buffer-from/test.js delete mode 100644 deps/npm/node_modules/byline/LICENSE delete mode 100644 deps/npm/node_modules/byline/README.md delete mode 100644 deps/npm/node_modules/byline/lib/byline.js delete mode 100644 deps/npm/node_modules/byline/package.json delete mode 100644 deps/npm/node_modules/cacache/README.es.md delete mode 100644 deps/npm/node_modules/cacache/en.js delete mode 100644 deps/npm/node_modules/cacache/es.js create mode 100644 deps/npm/node_modules/cacache/lib/util/disposer.js delete mode 100644 deps/npm/node_modules/cacache/lib/util/y.js delete mode 100644 deps/npm/node_modules/cacache/locales/en.js delete mode 100644 deps/npm/node_modules/cacache/locales/en.json delete mode 100644 deps/npm/node_modules/cacache/locales/es.js delete mode 100644 deps/npm/node_modules/cacache/locales/es.json delete mode 100644 deps/npm/node_modules/call-limit/CHANGELOG.md delete mode 100644 deps/npm/node_modules/call-limit/LICENSE delete mode 100644 deps/npm/node_modules/call-limit/README.md delete mode 100644 deps/npm/node_modules/call-limit/call-limit.js delete mode 100644 deps/npm/node_modules/call-limit/package.json delete mode 100644 deps/npm/node_modules/camelcase/index.js delete mode 100644 deps/npm/node_modules/camelcase/package.json delete mode 100644 deps/npm/node_modules/camelcase/readme.md delete mode 100644 deps/npm/node_modules/capture-stack-trace/index.js delete mode 100644 deps/npm/node_modules/capture-stack-trace/package.json delete mode 100644 deps/npm/node_modules/capture-stack-trace/readme.md create mode 100644 deps/npm/node_modules/chalk/index.d.ts delete mode 100644 deps/npm/node_modules/chalk/index.js delete mode 100644 deps/npm/node_modules/chalk/index.js.flow create mode 100644 deps/npm/node_modules/chalk/source/index.js create mode 100644 deps/npm/node_modules/chalk/source/templates.js create mode 100644 deps/npm/node_modules/chalk/source/util.js delete mode 100644 deps/npm/node_modules/chalk/templates.js delete mode 100644 deps/npm/node_modules/chalk/types/index.d.ts delete mode 100644 deps/npm/node_modules/ci-info/CHANGELOG.md delete mode 100644 deps/npm/node_modules/ci-info/LICENSE delete mode 100644 deps/npm/node_modules/ci-info/README.md delete mode 100644 deps/npm/node_modules/ci-info/index.js delete mode 100644 deps/npm/node_modules/ci-info/package.json delete mode 100644 deps/npm/node_modules/ci-info/vendors.json create mode 100644 deps/npm/node_modules/cidr-regex/index.d.ts create mode 100644 deps/npm/node_modules/clean-stack/index.d.ts create mode 100644 deps/npm/node_modules/clean-stack/index.js rename deps/npm/node_modules/{cliui/node_modules/ansi-regex => clean-stack}/license (100%) create mode 100644 deps/npm/node_modules/clean-stack/package.json create mode 100644 deps/npm/node_modules/clean-stack/readme.md delete mode 100644 deps/npm/node_modules/cli-boxes/boxes.json delete mode 100644 deps/npm/node_modules/cli-boxes/index.js delete mode 100644 deps/npm/node_modules/cli-boxes/license delete mode 100644 deps/npm/node_modules/cli-boxes/package.json delete mode 100644 deps/npm/node_modules/cli-boxes/readme.md create mode 100644 deps/npm/node_modules/cli-table3/node_modules/ansi-regex/index.d.ts create mode 100644 deps/npm/node_modules/cli-table3/node_modules/ansi-regex/index.js rename deps/npm/node_modules/{cliui/node_modules/string-width => cli-table3/node_modules/ansi-regex}/license (100%) create mode 100644 deps/npm/node_modules/cli-table3/node_modules/ansi-regex/package.json create mode 100644 deps/npm/node_modules/cli-table3/node_modules/ansi-regex/readme.md create mode 100644 deps/npm/node_modules/cli-table3/node_modules/is-fullwidth-code-point/index.d.ts create mode 100644 deps/npm/node_modules/cli-table3/node_modules/is-fullwidth-code-point/index.js rename deps/npm/node_modules/{cliui/node_modules/strip-ansi => cli-table3/node_modules/is-fullwidth-code-point}/license (100%) create mode 100644 deps/npm/node_modules/cli-table3/node_modules/is-fullwidth-code-point/package.json create mode 100644 deps/npm/node_modules/cli-table3/node_modules/is-fullwidth-code-point/readme.md create mode 100644 deps/npm/node_modules/cli-table3/node_modules/string-width/index.d.ts create mode 100644 deps/npm/node_modules/cli-table3/node_modules/string-width/index.js rename deps/npm/node_modules/{execa => cli-table3/node_modules/string-width}/license (100%) create mode 100644 deps/npm/node_modules/cli-table3/node_modules/string-width/package.json create mode 100644 deps/npm/node_modules/cli-table3/node_modules/string-width/readme.md create mode 100644 deps/npm/node_modules/cli-table3/node_modules/strip-ansi/index.d.ts create mode 100644 deps/npm/node_modules/cli-table3/node_modules/strip-ansi/index.js rename deps/npm/node_modules/{get-stream => cli-table3/node_modules/strip-ansi}/license (100%) create mode 100644 deps/npm/node_modules/cli-table3/node_modules/strip-ansi/package.json create mode 100644 deps/npm/node_modules/cli-table3/node_modules/strip-ansi/readme.md delete mode 100644 deps/npm/node_modules/cliui/CHANGELOG.md delete mode 100644 deps/npm/node_modules/cliui/LICENSE.txt delete mode 100644 deps/npm/node_modules/cliui/README.md delete mode 100644 deps/npm/node_modules/cliui/index.js delete mode 100644 deps/npm/node_modules/cliui/node_modules/ansi-regex/index.js delete mode 100644 deps/npm/node_modules/cliui/node_modules/ansi-regex/package.json delete mode 100644 deps/npm/node_modules/cliui/node_modules/ansi-regex/readme.md delete mode 100644 deps/npm/node_modules/cliui/node_modules/is-fullwidth-code-point/index.js delete mode 100644 deps/npm/node_modules/cliui/node_modules/is-fullwidth-code-point/license delete mode 100644 deps/npm/node_modules/cliui/node_modules/is-fullwidth-code-point/package.json delete mode 100644 deps/npm/node_modules/cliui/node_modules/is-fullwidth-code-point/readme.md delete mode 100644 deps/npm/node_modules/cliui/node_modules/string-width/index.js delete mode 100644 deps/npm/node_modules/cliui/node_modules/string-width/package.json delete mode 100644 deps/npm/node_modules/cliui/node_modules/string-width/readme.md delete mode 100644 deps/npm/node_modules/cliui/node_modules/strip-ansi/index.d.ts delete mode 100644 deps/npm/node_modules/cliui/node_modules/strip-ansi/index.js delete mode 100644 deps/npm/node_modules/cliui/node_modules/strip-ansi/package.json delete mode 100644 deps/npm/node_modules/cliui/node_modules/strip-ansi/readme.md delete mode 100644 deps/npm/node_modules/cliui/package.json delete mode 100644 deps/npm/node_modules/co/History.md delete mode 100644 deps/npm/node_modules/co/LICENSE delete mode 100644 deps/npm/node_modules/co/Readme.md delete mode 100644 deps/npm/node_modules/co/index.js delete mode 100644 deps/npm/node_modules/co/package.json delete mode 100644 deps/npm/node_modules/color-name/.eslintrc.json delete mode 100644 deps/npm/node_modules/color-name/.npmignore delete mode 100644 deps/npm/node_modules/color-name/test.js delete mode 100644 deps/npm/node_modules/combined-stream/lib/defer.js create mode 100644 deps/npm/node_modules/combined-stream/yarn.lock rename deps/npm/node_modules/{slide => common-ancestor-path}/LICENSE (100%) create mode 100644 deps/npm/node_modules/common-ancestor-path/README.md create mode 100644 deps/npm/node_modules/common-ancestor-path/index.js create mode 100644 deps/npm/node_modules/common-ancestor-path/package.json delete mode 100644 deps/npm/node_modules/concat-stream/LICENSE delete mode 100644 deps/npm/node_modules/concat-stream/index.js delete mode 100644 deps/npm/node_modules/concat-stream/node_modules/readable-stream/.travis.yml delete mode 100644 deps/npm/node_modules/concat-stream/node_modules/readable-stream/GOVERNANCE.md delete mode 100644 deps/npm/node_modules/concat-stream/node_modules/readable-stream/LICENSE delete mode 100644 deps/npm/node_modules/concat-stream/node_modules/readable-stream/README.md delete mode 100644 deps/npm/node_modules/concat-stream/node_modules/readable-stream/doc/wg-meetings/2015-01-30.md delete mode 100644 deps/npm/node_modules/concat-stream/node_modules/readable-stream/duplex-browser.js delete mode 100644 deps/npm/node_modules/concat-stream/node_modules/readable-stream/duplex.js delete mode 100644 deps/npm/node_modules/concat-stream/node_modules/readable-stream/lib/_stream_duplex.js delete mode 100644 deps/npm/node_modules/concat-stream/node_modules/readable-stream/lib/_stream_passthrough.js delete mode 100644 deps/npm/node_modules/concat-stream/node_modules/readable-stream/lib/_stream_readable.js delete mode 100644 deps/npm/node_modules/concat-stream/node_modules/readable-stream/lib/_stream_transform.js delete mode 100644 deps/npm/node_modules/concat-stream/node_modules/readable-stream/lib/_stream_writable.js delete mode 100644 deps/npm/node_modules/concat-stream/node_modules/readable-stream/lib/internal/streams/BufferList.js delete mode 100644 deps/npm/node_modules/concat-stream/node_modules/readable-stream/lib/internal/streams/destroy.js delete mode 100644 deps/npm/node_modules/concat-stream/node_modules/readable-stream/lib/internal/streams/stream-browser.js delete mode 100644 deps/npm/node_modules/concat-stream/node_modules/readable-stream/lib/internal/streams/stream.js delete mode 100644 deps/npm/node_modules/concat-stream/node_modules/readable-stream/package.json delete mode 100644 deps/npm/node_modules/concat-stream/node_modules/readable-stream/passthrough.js delete mode 100644 deps/npm/node_modules/concat-stream/node_modules/readable-stream/readable-browser.js delete mode 100644 deps/npm/node_modules/concat-stream/node_modules/readable-stream/readable.js delete mode 100644 deps/npm/node_modules/concat-stream/node_modules/readable-stream/transform.js delete mode 100644 deps/npm/node_modules/concat-stream/node_modules/readable-stream/writable-browser.js delete mode 100644 deps/npm/node_modules/concat-stream/node_modules/readable-stream/writable.js delete mode 100644 deps/npm/node_modules/concat-stream/node_modules/string_decoder/.travis.yml delete mode 100644 deps/npm/node_modules/concat-stream/node_modules/string_decoder/LICENSE delete mode 100644 deps/npm/node_modules/concat-stream/node_modules/string_decoder/README.md delete mode 100644 deps/npm/node_modules/concat-stream/node_modules/string_decoder/lib/string_decoder.js delete mode 100644 deps/npm/node_modules/concat-stream/node_modules/string_decoder/package.json delete mode 100644 deps/npm/node_modules/concat-stream/package.json delete mode 100644 deps/npm/node_modules/concat-stream/readme.md delete mode 100644 deps/npm/node_modules/config-chain/LICENCE delete mode 100755 deps/npm/node_modules/config-chain/index.js delete mode 100644 deps/npm/node_modules/config-chain/package.json delete mode 100644 deps/npm/node_modules/config-chain/readme.markdown delete mode 100644 deps/npm/node_modules/configstore/index.js delete mode 100644 deps/npm/node_modules/configstore/license delete mode 100644 deps/npm/node_modules/configstore/package.json delete mode 100644 deps/npm/node_modules/configstore/readme.md delete mode 100644 deps/npm/node_modules/copy-concurrently/LICENSE delete mode 100644 deps/npm/node_modules/copy-concurrently/README.md delete mode 100644 deps/npm/node_modules/copy-concurrently/copy.js delete mode 100644 deps/npm/node_modules/copy-concurrently/is-windows.js delete mode 100644 deps/npm/node_modules/copy-concurrently/node_modules/aproba/LICENSE delete mode 100644 deps/npm/node_modules/copy-concurrently/node_modules/aproba/README.md delete mode 100644 deps/npm/node_modules/copy-concurrently/node_modules/aproba/index.js delete mode 100644 deps/npm/node_modules/copy-concurrently/node_modules/aproba/package.json delete mode 100644 deps/npm/node_modules/copy-concurrently/node_modules/iferr/LICENSE delete mode 100644 deps/npm/node_modules/copy-concurrently/node_modules/iferr/README.md delete mode 100644 deps/npm/node_modules/copy-concurrently/node_modules/iferr/index.coffee delete mode 100644 deps/npm/node_modules/copy-concurrently/node_modules/iferr/index.js delete mode 100644 deps/npm/node_modules/copy-concurrently/node_modules/iferr/package.json delete mode 100644 deps/npm/node_modules/copy-concurrently/node_modules/iferr/test/index.coffee delete mode 100644 deps/npm/node_modules/copy-concurrently/node_modules/iferr/test/mocha.opts delete mode 100644 deps/npm/node_modules/copy-concurrently/package.json delete mode 100644 deps/npm/node_modules/create-error-class/index.js delete mode 100644 deps/npm/node_modules/create-error-class/license delete mode 100644 deps/npm/node_modules/create-error-class/package.json delete mode 100644 deps/npm/node_modules/create-error-class/readme.md delete mode 100644 deps/npm/node_modules/cross-spawn/CHANGELOG.md delete mode 100644 deps/npm/node_modules/cross-spawn/LICENSE delete mode 100644 deps/npm/node_modules/cross-spawn/README.md delete mode 100644 deps/npm/node_modules/cross-spawn/index.js delete mode 100644 deps/npm/node_modules/cross-spawn/lib/enoent.js delete mode 100644 deps/npm/node_modules/cross-spawn/lib/parse.js delete mode 100644 deps/npm/node_modules/cross-spawn/lib/util/escapeArgument.js delete mode 100644 deps/npm/node_modules/cross-spawn/lib/util/escapeCommand.js delete mode 100644 deps/npm/node_modules/cross-spawn/lib/util/hasEmptyArgumentBug.js delete mode 100644 deps/npm/node_modules/cross-spawn/lib/util/readShebang.js delete mode 100644 deps/npm/node_modules/cross-spawn/lib/util/resolveCommand.js delete mode 100644 deps/npm/node_modules/cross-spawn/node_modules/lru-cache/README.md delete mode 100644 deps/npm/node_modules/cross-spawn/node_modules/lru-cache/index.js delete mode 100644 deps/npm/node_modules/cross-spawn/node_modules/lru-cache/package.json delete mode 100644 deps/npm/node_modules/cross-spawn/node_modules/yallist/README.md delete mode 100644 deps/npm/node_modules/cross-spawn/node_modules/yallist/iterator.js delete mode 100644 deps/npm/node_modules/cross-spawn/node_modules/yallist/package.json delete mode 100644 deps/npm/node_modules/cross-spawn/node_modules/yallist/yallist.js delete mode 100644 deps/npm/node_modules/cross-spawn/package.json delete mode 100644 deps/npm/node_modules/crypto-random-string/index.js delete mode 100644 deps/npm/node_modules/crypto-random-string/license delete mode 100644 deps/npm/node_modules/crypto-random-string/package.json delete mode 100644 deps/npm/node_modules/crypto-random-string/readme.md delete mode 100644 deps/npm/node_modules/cyclist/.npmignore delete mode 100644 deps/npm/node_modules/cyclist/README.md delete mode 100644 deps/npm/node_modules/cyclist/index.js delete mode 100644 deps/npm/node_modules/cyclist/package.json delete mode 100644 deps/npm/node_modules/debug/.coveralls.yml delete mode 100644 deps/npm/node_modules/debug/.npmignore delete mode 100644 deps/npm/node_modules/debug/.travis.yml delete mode 100644 deps/npm/node_modules/debug/CHANGELOG.md delete mode 100644 deps/npm/node_modules/debug/Makefile delete mode 100644 deps/npm/node_modules/debug/karma.conf.js delete mode 100644 deps/npm/node_modules/debug/node.js delete mode 100644 deps/npm/node_modules/debug/node_modules/ms/index.js delete mode 100644 deps/npm/node_modules/debug/node_modules/ms/license.md delete mode 100644 deps/npm/node_modules/debug/node_modules/ms/package.json delete mode 100644 deps/npm/node_modules/debug/node_modules/ms/readme.md create mode 100644 deps/npm/node_modules/debug/src/common.js delete mode 100644 deps/npm/node_modules/debug/src/debug.js delete mode 100644 deps/npm/node_modules/decamelize/index.js delete mode 100644 deps/npm/node_modules/decamelize/license delete mode 100644 deps/npm/node_modules/decamelize/package.json delete mode 100644 deps/npm/node_modules/decamelize/readme.md delete mode 100644 deps/npm/node_modules/decode-uri-component/index.js delete mode 100644 deps/npm/node_modules/decode-uri-component/license delete mode 100644 deps/npm/node_modules/decode-uri-component/package.json delete mode 100644 deps/npm/node_modules/decode-uri-component/readme.md delete mode 100644 deps/npm/node_modules/deep-extend/CHANGELOG.md delete mode 100644 deps/npm/node_modules/deep-extend/LICENSE delete mode 100644 deps/npm/node_modules/deep-extend/README.md delete mode 100644 deps/npm/node_modules/deep-extend/index.js delete mode 100644 deps/npm/node_modules/deep-extend/lib/deep-extend.js delete mode 100644 deps/npm/node_modules/deep-extend/package.json delete mode 100644 deps/npm/node_modules/define-properties/.editorconfig delete mode 100644 deps/npm/node_modules/define-properties/.jscs.json delete mode 100644 deps/npm/node_modules/define-properties/.travis.yml delete mode 100644 deps/npm/node_modules/define-properties/CHANGELOG.md delete mode 100644 deps/npm/node_modules/define-properties/LICENSE delete mode 100644 deps/npm/node_modules/define-properties/README.md delete mode 100644 deps/npm/node_modules/define-properties/index.js delete mode 100644 deps/npm/node_modules/define-properties/package.json delete mode 100644 deps/npm/node_modules/define-properties/test/index.js create mode 100644 deps/npm/node_modules/depd/History.md create mode 100644 deps/npm/node_modules/depd/LICENSE create mode 100644 deps/npm/node_modules/depd/Readme.md create mode 100644 deps/npm/node_modules/depd/index.js create mode 100644 deps/npm/node_modules/depd/lib/browser/index.js create mode 100644 deps/npm/node_modules/depd/lib/compat/callsite-tostring.js create mode 100644 deps/npm/node_modules/depd/lib/compat/event-listener-count.js create mode 100644 deps/npm/node_modules/depd/lib/compat/index.js create mode 100644 deps/npm/node_modules/depd/package.json delete mode 100644 deps/npm/node_modules/detect-indent/index.js delete mode 100644 deps/npm/node_modules/detect-indent/license delete mode 100644 deps/npm/node_modules/detect-indent/package.json delete mode 100644 deps/npm/node_modules/detect-indent/readme.md delete mode 100644 deps/npm/node_modules/detect-newline/index.js delete mode 100644 deps/npm/node_modules/detect-newline/license delete mode 100644 deps/npm/node_modules/detect-newline/package.json delete mode 100644 deps/npm/node_modules/detect-newline/readme.md delete mode 100644 deps/npm/node_modules/dot-prop/index.js delete mode 100644 deps/npm/node_modules/dot-prop/license delete mode 100644 deps/npm/node_modules/dot-prop/package.json delete mode 100644 deps/npm/node_modules/dot-prop/readme.md delete mode 100644 deps/npm/node_modules/dotenv/CHANGELOG.md delete mode 100644 deps/npm/node_modules/dotenv/LICENSE delete mode 100644 deps/npm/node_modules/dotenv/README.md delete mode 100644 deps/npm/node_modules/dotenv/appveyor.yml delete mode 100644 deps/npm/node_modules/dotenv/config.js delete mode 100644 deps/npm/node_modules/dotenv/lib/main.js delete mode 100644 deps/npm/node_modules/dotenv/package.json delete mode 100644 deps/npm/node_modules/duplexer3/LICENSE.md delete mode 100644 deps/npm/node_modules/duplexer3/README.md delete mode 100644 deps/npm/node_modules/duplexer3/index.js delete mode 100644 deps/npm/node_modules/duplexer3/package.json delete mode 100644 deps/npm/node_modules/duplexify/.travis.yml delete mode 100644 deps/npm/node_modules/duplexify/LICENSE delete mode 100644 deps/npm/node_modules/duplexify/README.md delete mode 100644 deps/npm/node_modules/duplexify/example.js delete mode 100644 deps/npm/node_modules/duplexify/index.js delete mode 100644 deps/npm/node_modules/duplexify/node_modules/readable-stream/.travis.yml delete mode 100644 deps/npm/node_modules/duplexify/node_modules/readable-stream/GOVERNANCE.md delete mode 100644 deps/npm/node_modules/duplexify/node_modules/readable-stream/LICENSE delete mode 100644 deps/npm/node_modules/duplexify/node_modules/readable-stream/README.md delete mode 100644 deps/npm/node_modules/duplexify/node_modules/readable-stream/doc/wg-meetings/2015-01-30.md delete mode 100644 deps/npm/node_modules/duplexify/node_modules/readable-stream/duplex-browser.js delete mode 100644 deps/npm/node_modules/duplexify/node_modules/readable-stream/duplex.js delete mode 100644 deps/npm/node_modules/duplexify/node_modules/readable-stream/lib/_stream_duplex.js delete mode 100644 deps/npm/node_modules/duplexify/node_modules/readable-stream/lib/_stream_passthrough.js delete mode 100644 deps/npm/node_modules/duplexify/node_modules/readable-stream/lib/_stream_readable.js delete mode 100644 deps/npm/node_modules/duplexify/node_modules/readable-stream/lib/_stream_transform.js delete mode 100644 deps/npm/node_modules/duplexify/node_modules/readable-stream/lib/_stream_writable.js delete mode 100644 deps/npm/node_modules/duplexify/node_modules/readable-stream/lib/internal/streams/BufferList.js delete mode 100644 deps/npm/node_modules/duplexify/node_modules/readable-stream/lib/internal/streams/destroy.js delete mode 100644 deps/npm/node_modules/duplexify/node_modules/readable-stream/lib/internal/streams/stream-browser.js delete mode 100644 deps/npm/node_modules/duplexify/node_modules/readable-stream/lib/internal/streams/stream.js delete mode 100644 deps/npm/node_modules/duplexify/node_modules/readable-stream/package.json delete mode 100644 deps/npm/node_modules/duplexify/node_modules/readable-stream/passthrough.js delete mode 100644 deps/npm/node_modules/duplexify/node_modules/readable-stream/readable-browser.js delete mode 100644 deps/npm/node_modules/duplexify/node_modules/readable-stream/readable.js delete mode 100644 deps/npm/node_modules/duplexify/node_modules/readable-stream/transform.js delete mode 100644 deps/npm/node_modules/duplexify/node_modules/readable-stream/writable-browser.js delete mode 100644 deps/npm/node_modules/duplexify/node_modules/readable-stream/writable.js delete mode 100644 deps/npm/node_modules/duplexify/node_modules/string_decoder/.travis.yml delete mode 100644 deps/npm/node_modules/duplexify/node_modules/string_decoder/LICENSE delete mode 100644 deps/npm/node_modules/duplexify/node_modules/string_decoder/README.md delete mode 100644 deps/npm/node_modules/duplexify/node_modules/string_decoder/lib/string_decoder.js delete mode 100644 deps/npm/node_modules/duplexify/node_modules/string_decoder/package.json delete mode 100644 deps/npm/node_modules/duplexify/package.json delete mode 100644 deps/npm/node_modules/duplexify/test.js delete mode 100644 deps/npm/node_modules/encoding/.npmignore create mode 100644 deps/npm/node_modules/encoding/.prettierrc.js delete mode 100644 deps/npm/node_modules/encoding/lib/iconv-loader.js delete mode 100644 deps/npm/node_modules/end-of-stream/LICENSE delete mode 100644 deps/npm/node_modules/end-of-stream/README.md delete mode 100644 deps/npm/node_modules/end-of-stream/index.js delete mode 100644 deps/npm/node_modules/end-of-stream/package.json delete mode 100644 deps/npm/node_modules/errno/.travis.yml delete mode 100644 deps/npm/node_modules/errno/README.md delete mode 100755 deps/npm/node_modules/errno/build.js delete mode 100755 deps/npm/node_modules/errno/cli.js delete mode 100644 deps/npm/node_modules/errno/custom.js delete mode 100644 deps/npm/node_modules/errno/errno.js delete mode 100644 deps/npm/node_modules/errno/package.json delete mode 100644 deps/npm/node_modules/errno/test.js delete mode 100644 deps/npm/node_modules/es-abstract/.editorconfig delete mode 100644 deps/npm/node_modules/es-abstract/.jscs.json delete mode 100644 deps/npm/node_modules/es-abstract/.nycrc delete mode 100644 deps/npm/node_modules/es-abstract/.travis.yml delete mode 100644 deps/npm/node_modules/es-abstract/CHANGELOG.md delete mode 100644 deps/npm/node_modules/es-abstract/GetIntrinsic.js delete mode 100644 deps/npm/node_modules/es-abstract/LICENSE delete mode 100644 deps/npm/node_modules/es-abstract/Makefile delete mode 100644 deps/npm/node_modules/es-abstract/README.md delete mode 100644 deps/npm/node_modules/es-abstract/es2015.js delete mode 100644 deps/npm/node_modules/es-abstract/es2016.js delete mode 100644 deps/npm/node_modules/es-abstract/es2017.js delete mode 100644 deps/npm/node_modules/es-abstract/es5.js delete mode 100644 deps/npm/node_modules/es-abstract/es6.js delete mode 100644 deps/npm/node_modules/es-abstract/es7.js delete mode 100644 deps/npm/node_modules/es-abstract/helpers/assign.js delete mode 100644 deps/npm/node_modules/es-abstract/helpers/isFinite.js delete mode 100644 deps/npm/node_modules/es-abstract/helpers/isNaN.js delete mode 100644 deps/npm/node_modules/es-abstract/helpers/isPrimitive.js delete mode 100644 deps/npm/node_modules/es-abstract/helpers/mod.js delete mode 100644 deps/npm/node_modules/es-abstract/helpers/sign.js delete mode 100644 deps/npm/node_modules/es-abstract/index.js delete mode 100644 deps/npm/node_modules/es-abstract/operations/2015.js delete mode 100644 deps/npm/node_modules/es-abstract/operations/2016.js delete mode 100644 deps/npm/node_modules/es-abstract/operations/2017.js delete mode 100644 deps/npm/node_modules/es-abstract/operations/es5.js delete mode 100644 deps/npm/node_modules/es-abstract/package.json delete mode 100644 deps/npm/node_modules/es-abstract/test/GetIntrinsic.js delete mode 100644 deps/npm/node_modules/es-abstract/test/diffOps.js delete mode 100644 deps/npm/node_modules/es-abstract/test/es2015.js delete mode 100644 deps/npm/node_modules/es-abstract/test/es2016.js delete mode 100644 deps/npm/node_modules/es-abstract/test/es2017.js delete mode 100644 deps/npm/node_modules/es-abstract/test/es5.js delete mode 100644 deps/npm/node_modules/es-abstract/test/es6.js delete mode 100644 deps/npm/node_modules/es-abstract/test/es7.js delete mode 100644 deps/npm/node_modules/es-abstract/test/helpers/values.js delete mode 100644 deps/npm/node_modules/es-abstract/test/index.js delete mode 100644 deps/npm/node_modules/es-abstract/test/tests.js delete mode 100644 deps/npm/node_modules/es-to-primitive/.jscs.json delete mode 100644 deps/npm/node_modules/es-to-primitive/.travis.yml delete mode 100644 deps/npm/node_modules/es-to-primitive/CHANGELOG.md delete mode 100644 deps/npm/node_modules/es-to-primitive/LICENSE delete mode 100644 deps/npm/node_modules/es-to-primitive/Makefile delete mode 100644 deps/npm/node_modules/es-to-primitive/README.md delete mode 100644 deps/npm/node_modules/es-to-primitive/es2015.js delete mode 100644 deps/npm/node_modules/es-to-primitive/es5.js delete mode 100644 deps/npm/node_modules/es-to-primitive/es6.js delete mode 100644 deps/npm/node_modules/es-to-primitive/helpers/isPrimitive.js delete mode 100644 deps/npm/node_modules/es-to-primitive/index.js delete mode 100644 deps/npm/node_modules/es-to-primitive/package.json delete mode 100644 deps/npm/node_modules/es-to-primitive/test/es2015.js delete mode 100644 deps/npm/node_modules/es-to-primitive/test/es5.js delete mode 100644 deps/npm/node_modules/es-to-primitive/test/es6.js delete mode 100644 deps/npm/node_modules/es-to-primitive/test/index.js delete mode 100644 deps/npm/node_modules/es6-promise/CHANGELOG.md delete mode 100644 deps/npm/node_modules/es6-promise/LICENSE delete mode 100644 deps/npm/node_modules/es6-promise/README.md delete mode 100644 deps/npm/node_modules/es6-promise/auto.js delete mode 100644 deps/npm/node_modules/es6-promise/dist/es6-promise.auto.js delete mode 100644 deps/npm/node_modules/es6-promise/dist/es6-promise.auto.map delete mode 100644 deps/npm/node_modules/es6-promise/dist/es6-promise.auto.min.js delete mode 100644 deps/npm/node_modules/es6-promise/dist/es6-promise.auto.min.map delete mode 100644 deps/npm/node_modules/es6-promise/dist/es6-promise.js delete mode 100644 deps/npm/node_modules/es6-promise/dist/es6-promise.map delete mode 100644 deps/npm/node_modules/es6-promise/dist/es6-promise.min.js delete mode 100644 deps/npm/node_modules/es6-promise/dist/es6-promise.min.map delete mode 100644 deps/npm/node_modules/es6-promise/es6-promise.d.ts delete mode 100644 deps/npm/node_modules/es6-promise/lib/es6-promise.auto.js delete mode 100644 deps/npm/node_modules/es6-promise/lib/es6-promise.js delete mode 100644 deps/npm/node_modules/es6-promise/lib/es6-promise/-internal.js delete mode 100644 deps/npm/node_modules/es6-promise/lib/es6-promise/asap.js delete mode 100644 deps/npm/node_modules/es6-promise/lib/es6-promise/enumerator.js delete mode 100644 deps/npm/node_modules/es6-promise/lib/es6-promise/polyfill.js delete mode 100644 deps/npm/node_modules/es6-promise/lib/es6-promise/promise.js delete mode 100644 deps/npm/node_modules/es6-promise/lib/es6-promise/promise/all.js delete mode 100644 deps/npm/node_modules/es6-promise/lib/es6-promise/promise/race.js delete mode 100644 deps/npm/node_modules/es6-promise/lib/es6-promise/promise/reject.js delete mode 100644 deps/npm/node_modules/es6-promise/lib/es6-promise/promise/resolve.js delete mode 100644 deps/npm/node_modules/es6-promise/lib/es6-promise/then.js delete mode 100644 deps/npm/node_modules/es6-promise/lib/es6-promise/utils.js delete mode 100644 deps/npm/node_modules/es6-promise/package.json delete mode 100644 deps/npm/node_modules/es6-promisify/README.md delete mode 100644 deps/npm/node_modules/es6-promisify/dist/promise.js delete mode 100644 deps/npm/node_modules/es6-promisify/dist/promisify.js delete mode 100644 deps/npm/node_modules/es6-promisify/package.json delete mode 100644 deps/npm/node_modules/escape-string-regexp/index.js delete mode 100644 deps/npm/node_modules/escape-string-regexp/license delete mode 100644 deps/npm/node_modules/escape-string-regexp/package.json delete mode 100644 deps/npm/node_modules/escape-string-regexp/readme.md delete mode 100644 deps/npm/node_modules/execa/index.js delete mode 100644 deps/npm/node_modules/execa/lib/errname.js delete mode 100644 deps/npm/node_modules/execa/lib/stdio.js delete mode 100644 deps/npm/node_modules/execa/node_modules/get-stream/buffer-stream.js delete mode 100644 deps/npm/node_modules/execa/node_modules/get-stream/index.js delete mode 100644 deps/npm/node_modules/execa/node_modules/get-stream/license delete mode 100644 deps/npm/node_modules/execa/node_modules/get-stream/package.json delete mode 100644 deps/npm/node_modules/execa/node_modules/get-stream/readme.md delete mode 100644 deps/npm/node_modules/execa/package.json delete mode 100644 deps/npm/node_modules/execa/readme.md create mode 100644 deps/npm/node_modules/fast-deep-equal/es6/index.d.ts create mode 100644 deps/npm/node_modules/fast-deep-equal/es6/index.js create mode 100644 deps/npm/node_modules/fast-deep-equal/es6/react.d.ts create mode 100644 deps/npm/node_modules/fast-deep-equal/es6/react.js create mode 100644 deps/npm/node_modules/fast-deep-equal/react.d.ts create mode 100644 deps/npm/node_modules/fast-deep-equal/react.js create mode 100644 deps/npm/node_modules/fast-json-stable-stringify/.github/FUNDING.yml delete mode 100644 deps/npm/node_modules/fast-json-stable-stringify/.npmignore create mode 100644 deps/npm/node_modules/fast-json-stable-stringify/index.d.ts delete mode 100644 deps/npm/node_modules/figgy-pudding/CHANGELOG.md delete mode 100644 deps/npm/node_modules/figgy-pudding/LICENSE.md delete mode 100644 deps/npm/node_modules/figgy-pudding/README.md delete mode 100644 deps/npm/node_modules/figgy-pudding/index.js delete mode 100644 deps/npm/node_modules/figgy-pudding/package.json delete mode 100644 deps/npm/node_modules/find-npm-prefix/README.md delete mode 100644 deps/npm/node_modules/find-npm-prefix/find-prefix.js delete mode 100644 deps/npm/node_modules/find-npm-prefix/package.json delete mode 100644 deps/npm/node_modules/find-npm-prefix/test/find-prefix.js delete mode 100644 deps/npm/node_modules/flush-write-stream/.travis.yml delete mode 100644 deps/npm/node_modules/flush-write-stream/LICENSE delete mode 100644 deps/npm/node_modules/flush-write-stream/README.md delete mode 100644 deps/npm/node_modules/flush-write-stream/example.js delete mode 100644 deps/npm/node_modules/flush-write-stream/index.js delete mode 100644 deps/npm/node_modules/flush-write-stream/node_modules/readable-stream/.travis.yml delete mode 100644 deps/npm/node_modules/flush-write-stream/node_modules/readable-stream/GOVERNANCE.md delete mode 100644 deps/npm/node_modules/flush-write-stream/node_modules/readable-stream/LICENSE delete mode 100644 deps/npm/node_modules/flush-write-stream/node_modules/readable-stream/README.md delete mode 100644 deps/npm/node_modules/flush-write-stream/node_modules/readable-stream/doc/wg-meetings/2015-01-30.md delete mode 100644 deps/npm/node_modules/flush-write-stream/node_modules/readable-stream/duplex-browser.js delete mode 100644 deps/npm/node_modules/flush-write-stream/node_modules/readable-stream/duplex.js delete mode 100644 deps/npm/node_modules/flush-write-stream/node_modules/readable-stream/lib/_stream_duplex.js delete mode 100644 deps/npm/node_modules/flush-write-stream/node_modules/readable-stream/lib/_stream_passthrough.js delete mode 100644 deps/npm/node_modules/flush-write-stream/node_modules/readable-stream/lib/_stream_readable.js delete mode 100644 deps/npm/node_modules/flush-write-stream/node_modules/readable-stream/lib/_stream_transform.js delete mode 100644 deps/npm/node_modules/flush-write-stream/node_modules/readable-stream/lib/_stream_writable.js delete mode 100644 deps/npm/node_modules/flush-write-stream/node_modules/readable-stream/lib/internal/streams/BufferList.js delete mode 100644 deps/npm/node_modules/flush-write-stream/node_modules/readable-stream/lib/internal/streams/destroy.js delete mode 100644 deps/npm/node_modules/flush-write-stream/node_modules/readable-stream/lib/internal/streams/stream-browser.js delete mode 100644 deps/npm/node_modules/flush-write-stream/node_modules/readable-stream/lib/internal/streams/stream.js delete mode 100644 deps/npm/node_modules/flush-write-stream/node_modules/readable-stream/package.json delete mode 100644 deps/npm/node_modules/flush-write-stream/node_modules/readable-stream/passthrough.js delete mode 100644 deps/npm/node_modules/flush-write-stream/node_modules/readable-stream/readable-browser.js delete mode 100644 deps/npm/node_modules/flush-write-stream/node_modules/readable-stream/readable.js delete mode 100644 deps/npm/node_modules/flush-write-stream/node_modules/readable-stream/transform.js delete mode 100644 deps/npm/node_modules/flush-write-stream/node_modules/readable-stream/writable-browser.js delete mode 100644 deps/npm/node_modules/flush-write-stream/node_modules/readable-stream/writable.js delete mode 100644 deps/npm/node_modules/flush-write-stream/node_modules/string_decoder/.travis.yml delete mode 100644 deps/npm/node_modules/flush-write-stream/node_modules/string_decoder/LICENSE delete mode 100644 deps/npm/node_modules/flush-write-stream/node_modules/string_decoder/README.md delete mode 100644 deps/npm/node_modules/flush-write-stream/node_modules/string_decoder/lib/string_decoder.js delete mode 100644 deps/npm/node_modules/flush-write-stream/node_modules/string_decoder/package.json delete mode 100644 deps/npm/node_modules/flush-write-stream/package.json delete mode 100644 deps/npm/node_modules/flush-write-stream/test.js create mode 100644 deps/npm/node_modules/form-data/yarn.lock delete mode 100644 deps/npm/node_modules/from2/.travis.yml delete mode 100644 deps/npm/node_modules/from2/LICENSE.md delete mode 100644 deps/npm/node_modules/from2/README.md delete mode 100644 deps/npm/node_modules/from2/index.js delete mode 100644 deps/npm/node_modules/from2/node_modules/readable-stream/.travis.yml delete mode 100644 deps/npm/node_modules/from2/node_modules/readable-stream/GOVERNANCE.md delete mode 100644 deps/npm/node_modules/from2/node_modules/readable-stream/LICENSE delete mode 100644 deps/npm/node_modules/from2/node_modules/readable-stream/README.md delete mode 100644 deps/npm/node_modules/from2/node_modules/readable-stream/doc/wg-meetings/2015-01-30.md delete mode 100644 deps/npm/node_modules/from2/node_modules/readable-stream/duplex-browser.js delete mode 100644 deps/npm/node_modules/from2/node_modules/readable-stream/duplex.js delete mode 100644 deps/npm/node_modules/from2/node_modules/readable-stream/lib/_stream_duplex.js delete mode 100644 deps/npm/node_modules/from2/node_modules/readable-stream/lib/_stream_passthrough.js delete mode 100644 deps/npm/node_modules/from2/node_modules/readable-stream/lib/_stream_readable.js delete mode 100644 deps/npm/node_modules/from2/node_modules/readable-stream/lib/_stream_transform.js delete mode 100644 deps/npm/node_modules/from2/node_modules/readable-stream/lib/_stream_writable.js delete mode 100644 deps/npm/node_modules/from2/node_modules/readable-stream/lib/internal/streams/BufferList.js delete mode 100644 deps/npm/node_modules/from2/node_modules/readable-stream/lib/internal/streams/destroy.js delete mode 100644 deps/npm/node_modules/from2/node_modules/readable-stream/lib/internal/streams/stream-browser.js delete mode 100644 deps/npm/node_modules/from2/node_modules/readable-stream/lib/internal/streams/stream.js delete mode 100644 deps/npm/node_modules/from2/node_modules/readable-stream/package.json delete mode 100644 deps/npm/node_modules/from2/node_modules/readable-stream/passthrough.js delete mode 100644 deps/npm/node_modules/from2/node_modules/readable-stream/readable-browser.js delete mode 100644 deps/npm/node_modules/from2/node_modules/readable-stream/readable.js delete mode 100644 deps/npm/node_modules/from2/node_modules/readable-stream/transform.js delete mode 100644 deps/npm/node_modules/from2/node_modules/readable-stream/writable-browser.js delete mode 100644 deps/npm/node_modules/from2/node_modules/readable-stream/writable.js delete mode 100644 deps/npm/node_modules/from2/node_modules/string_decoder/.travis.yml delete mode 100644 deps/npm/node_modules/from2/node_modules/string_decoder/LICENSE delete mode 100644 deps/npm/node_modules/from2/node_modules/string_decoder/README.md delete mode 100644 deps/npm/node_modules/from2/node_modules/string_decoder/lib/string_decoder.js delete mode 100644 deps/npm/node_modules/from2/node_modules/string_decoder/package.json delete mode 100644 deps/npm/node_modules/from2/package.json delete mode 100644 deps/npm/node_modules/from2/test.js delete mode 100644 deps/npm/node_modules/fs-minipass/node_modules/minipass/README.md delete mode 100644 deps/npm/node_modules/fs-minipass/node_modules/minipass/index.js delete mode 100644 deps/npm/node_modules/fs-minipass/node_modules/minipass/package.json delete mode 100644 deps/npm/node_modules/fs-vacuum/.eslintrc delete mode 100644 deps/npm/node_modules/fs-vacuum/.npmignore delete mode 100644 deps/npm/node_modules/fs-vacuum/.travis.yml delete mode 100644 deps/npm/node_modules/fs-vacuum/LICENSE delete mode 100644 deps/npm/node_modules/fs-vacuum/README.md delete mode 100644 deps/npm/node_modules/fs-vacuum/package.json delete mode 100644 deps/npm/node_modules/fs-vacuum/test/arguments.js delete mode 100644 deps/npm/node_modules/fs-vacuum/test/base-leaf-mismatch.js delete mode 100644 deps/npm/node_modules/fs-vacuum/test/no-entries-file-no-purge.js delete mode 100644 deps/npm/node_modules/fs-vacuum/test/no-entries-link-no-purge.js delete mode 100644 deps/npm/node_modules/fs-vacuum/test/no-entries-no-purge.js delete mode 100644 deps/npm/node_modules/fs-vacuum/test/no-entries-with-link-purge.js delete mode 100644 deps/npm/node_modules/fs-vacuum/test/no-entries-with-purge.js delete mode 100644 deps/npm/node_modules/fs-vacuum/test/not-remove-home-directory.js delete mode 100644 deps/npm/node_modules/fs-vacuum/test/other-directories-no-purge.js delete mode 100644 deps/npm/node_modules/fs-vacuum/test/racy-entries-eexist.js delete mode 100644 deps/npm/node_modules/fs-vacuum/test/racy-entries-enotempty.js delete mode 100644 deps/npm/node_modules/fs-vacuum/test/racy-entries.js delete mode 100644 deps/npm/node_modules/fs-vacuum/vacuum.js delete mode 100644 deps/npm/node_modules/fs-write-stream-atomic/.npmignore delete mode 100644 deps/npm/node_modules/fs-write-stream-atomic/.travis.yml delete mode 100644 deps/npm/node_modules/fs-write-stream-atomic/README.md delete mode 100644 deps/npm/node_modules/fs-write-stream-atomic/index.js delete mode 100644 deps/npm/node_modules/fs-write-stream-atomic/node_modules/iferr/.npmignore delete mode 100644 deps/npm/node_modules/fs-write-stream-atomic/node_modules/iferr/LICENSE delete mode 100644 deps/npm/node_modules/fs-write-stream-atomic/node_modules/iferr/README.md delete mode 100644 deps/npm/node_modules/fs-write-stream-atomic/node_modules/iferr/index.coffee delete mode 100644 deps/npm/node_modules/fs-write-stream-atomic/node_modules/iferr/index.js delete mode 100644 deps/npm/node_modules/fs-write-stream-atomic/node_modules/iferr/package.json delete mode 100644 deps/npm/node_modules/fs-write-stream-atomic/node_modules/iferr/test/index.coffee delete mode 100644 deps/npm/node_modules/fs-write-stream-atomic/node_modules/iferr/test/mocha.opts delete mode 100644 deps/npm/node_modules/fs-write-stream-atomic/node_modules/readable-stream/.travis.yml delete mode 100644 deps/npm/node_modules/fs-write-stream-atomic/node_modules/readable-stream/GOVERNANCE.md delete mode 100644 deps/npm/node_modules/fs-write-stream-atomic/node_modules/readable-stream/LICENSE delete mode 100644 deps/npm/node_modules/fs-write-stream-atomic/node_modules/readable-stream/README.md delete mode 100644 deps/npm/node_modules/fs-write-stream-atomic/node_modules/readable-stream/doc/wg-meetings/2015-01-30.md delete mode 100644 deps/npm/node_modules/fs-write-stream-atomic/node_modules/readable-stream/duplex-browser.js delete mode 100644 deps/npm/node_modules/fs-write-stream-atomic/node_modules/readable-stream/duplex.js delete mode 100644 deps/npm/node_modules/fs-write-stream-atomic/node_modules/readable-stream/lib/_stream_duplex.js delete mode 100644 deps/npm/node_modules/fs-write-stream-atomic/node_modules/readable-stream/lib/_stream_passthrough.js delete mode 100644 deps/npm/node_modules/fs-write-stream-atomic/node_modules/readable-stream/lib/_stream_readable.js delete mode 100644 deps/npm/node_modules/fs-write-stream-atomic/node_modules/readable-stream/lib/_stream_transform.js delete mode 100644 deps/npm/node_modules/fs-write-stream-atomic/node_modules/readable-stream/lib/_stream_writable.js delete mode 100644 deps/npm/node_modules/fs-write-stream-atomic/node_modules/readable-stream/lib/internal/streams/BufferList.js delete mode 100644 deps/npm/node_modules/fs-write-stream-atomic/node_modules/readable-stream/lib/internal/streams/destroy.js delete mode 100644 deps/npm/node_modules/fs-write-stream-atomic/node_modules/readable-stream/lib/internal/streams/stream-browser.js delete mode 100644 deps/npm/node_modules/fs-write-stream-atomic/node_modules/readable-stream/lib/internal/streams/stream.js delete mode 100644 deps/npm/node_modules/fs-write-stream-atomic/node_modules/readable-stream/package.json delete mode 100644 deps/npm/node_modules/fs-write-stream-atomic/node_modules/readable-stream/passthrough.js delete mode 100644 deps/npm/node_modules/fs-write-stream-atomic/node_modules/readable-stream/readable-browser.js delete mode 100644 deps/npm/node_modules/fs-write-stream-atomic/node_modules/readable-stream/readable.js delete mode 100644 deps/npm/node_modules/fs-write-stream-atomic/node_modules/readable-stream/transform.js delete mode 100644 deps/npm/node_modules/fs-write-stream-atomic/node_modules/readable-stream/writable-browser.js delete mode 100644 deps/npm/node_modules/fs-write-stream-atomic/node_modules/readable-stream/writable.js delete mode 100644 deps/npm/node_modules/fs-write-stream-atomic/node_modules/string_decoder/.travis.yml delete mode 100644 deps/npm/node_modules/fs-write-stream-atomic/node_modules/string_decoder/LICENSE delete mode 100644 deps/npm/node_modules/fs-write-stream-atomic/node_modules/string_decoder/README.md delete mode 100644 deps/npm/node_modules/fs-write-stream-atomic/node_modules/string_decoder/lib/string_decoder.js delete mode 100644 deps/npm/node_modules/fs-write-stream-atomic/node_modules/string_decoder/package.json delete mode 100644 deps/npm/node_modules/fs-write-stream-atomic/package.json delete mode 100644 deps/npm/node_modules/fs-write-stream-atomic/test/basic.js delete mode 100644 deps/npm/node_modules/fs-write-stream-atomic/test/chown.js delete mode 100644 deps/npm/node_modules/fs-write-stream-atomic/test/rename-eperm.js delete mode 100644 deps/npm/node_modules/fs-write-stream-atomic/test/rename-fail.js delete mode 100644 deps/npm/node_modules/fs-write-stream-atomic/test/slow-close.js delete mode 100644 deps/npm/node_modules/fs-write-stream-atomic/test/toolong.js delete mode 100644 deps/npm/node_modules/function-bind/.editorconfig delete mode 100644 deps/npm/node_modules/function-bind/.jscs.json delete mode 100644 deps/npm/node_modules/function-bind/.npmignore delete mode 100644 deps/npm/node_modules/function-bind/.travis.yml delete mode 100644 deps/npm/node_modules/function-bind/LICENSE delete mode 100644 deps/npm/node_modules/function-bind/README.md delete mode 100644 deps/npm/node_modules/function-bind/implementation.js delete mode 100644 deps/npm/node_modules/function-bind/index.js delete mode 100644 deps/npm/node_modules/function-bind/package.json delete mode 100644 deps/npm/node_modules/function-bind/test/index.js create mode 100644 deps/npm/node_modules/gauge/node_modules/is-fullwidth-code-point/index.js rename deps/npm/node_modules/{camelcase => gauge/node_modules/is-fullwidth-code-point}/license (100%) create mode 100644 deps/npm/node_modules/gauge/node_modules/is-fullwidth-code-point/package.json create mode 100644 deps/npm/node_modules/gauge/node_modules/is-fullwidth-code-point/readme.md delete mode 100644 deps/npm/node_modules/genfun/CHANGELOG.md delete mode 100644 deps/npm/node_modules/genfun/LICENSE delete mode 100644 deps/npm/node_modules/genfun/README.md delete mode 100644 deps/npm/node_modules/genfun/lib/genfun.js delete mode 100644 deps/npm/node_modules/genfun/lib/method.js delete mode 100644 deps/npm/node_modules/genfun/lib/role.js delete mode 100644 deps/npm/node_modules/genfun/lib/util.js delete mode 100644 deps/npm/node_modules/genfun/package.json delete mode 100644 deps/npm/node_modules/gentle-fs/CHANGELOG.md delete mode 100644 deps/npm/node_modules/gentle-fs/LICENSE delete mode 100644 deps/npm/node_modules/gentle-fs/README.md delete mode 100644 deps/npm/node_modules/gentle-fs/index.js delete mode 100644 deps/npm/node_modules/gentle-fs/lib/bin-link.js delete mode 100644 deps/npm/node_modules/gentle-fs/lib/chown.js delete mode 100644 deps/npm/node_modules/gentle-fs/lib/link.js delete mode 100644 deps/npm/node_modules/gentle-fs/lib/mkdir.js delete mode 100644 deps/npm/node_modules/gentle-fs/lib/rm.js delete mode 100644 deps/npm/node_modules/gentle-fs/node_modules/aproba/LICENSE delete mode 100644 deps/npm/node_modules/gentle-fs/node_modules/aproba/README.md delete mode 100644 deps/npm/node_modules/gentle-fs/node_modules/aproba/index.js delete mode 100644 deps/npm/node_modules/gentle-fs/node_modules/aproba/package.json delete mode 100644 deps/npm/node_modules/gentle-fs/node_modules/iferr/.npmignore delete mode 100644 deps/npm/node_modules/gentle-fs/node_modules/iferr/LICENSE delete mode 100644 deps/npm/node_modules/gentle-fs/node_modules/iferr/README.md delete mode 100644 deps/npm/node_modules/gentle-fs/node_modules/iferr/index.coffee delete mode 100644 deps/npm/node_modules/gentle-fs/node_modules/iferr/index.js delete mode 100644 deps/npm/node_modules/gentle-fs/node_modules/iferr/package.json delete mode 100644 deps/npm/node_modules/gentle-fs/node_modules/iferr/test/index.coffee delete mode 100644 deps/npm/node_modules/gentle-fs/node_modules/iferr/test/mocha.opts delete mode 100644 deps/npm/node_modules/gentle-fs/package.json delete mode 100644 deps/npm/node_modules/get-caller-file/LICENSE.md delete mode 100644 deps/npm/node_modules/get-caller-file/README.md delete mode 100644 deps/npm/node_modules/get-caller-file/index.d.ts delete mode 100644 deps/npm/node_modules/get-caller-file/index.js delete mode 100644 deps/npm/node_modules/get-caller-file/index.js.map delete mode 100644 deps/npm/node_modules/get-caller-file/package.json delete mode 100644 deps/npm/node_modules/get-stream/buffer-stream.js delete mode 100644 deps/npm/node_modules/get-stream/index.js delete mode 100644 deps/npm/node_modules/get-stream/package.json delete mode 100644 deps/npm/node_modules/get-stream/readme.md delete mode 100644 deps/npm/node_modules/global-dirs/index.js delete mode 100644 deps/npm/node_modules/global-dirs/package.json delete mode 100644 deps/npm/node_modules/global-dirs/readme.md delete mode 100644 deps/npm/node_modules/got/index.js delete mode 100644 deps/npm/node_modules/got/license delete mode 100644 deps/npm/node_modules/got/node_modules/get-stream/buffer-stream.js delete mode 100644 deps/npm/node_modules/got/node_modules/get-stream/index.js delete mode 100644 deps/npm/node_modules/got/node_modules/get-stream/license delete mode 100644 deps/npm/node_modules/got/node_modules/get-stream/package.json delete mode 100644 deps/npm/node_modules/got/node_modules/get-stream/readme.md delete mode 100644 deps/npm/node_modules/got/package.json delete mode 100644 deps/npm/node_modules/got/readme.md create mode 100644 deps/npm/node_modules/has-flag/index.d.ts delete mode 100644 deps/npm/node_modules/has-symbols/.npmignore delete mode 100644 deps/npm/node_modules/has-symbols/.travis.yml delete mode 100644 deps/npm/node_modules/has-symbols/CHANGELOG.md delete mode 100644 deps/npm/node_modules/has-symbols/LICENSE delete mode 100644 deps/npm/node_modules/has-symbols/README.md delete mode 100644 deps/npm/node_modules/has-symbols/index.js delete mode 100644 deps/npm/node_modules/has-symbols/package.json delete mode 100644 deps/npm/node_modules/has-symbols/shams.js delete mode 100644 deps/npm/node_modules/has-symbols/test/index.js delete mode 100644 deps/npm/node_modules/has-symbols/test/shams/core-js.js delete mode 100644 deps/npm/node_modules/has-symbols/test/shams/get-own-property-symbols.js delete mode 100644 deps/npm/node_modules/has-symbols/test/tests.js delete mode 100644 deps/npm/node_modules/has/LICENSE-MIT delete mode 100644 deps/npm/node_modules/has/README.md delete mode 100644 deps/npm/node_modules/has/package.json delete mode 100644 deps/npm/node_modules/has/src/index.js delete mode 100644 deps/npm/node_modules/has/test/index.js create mode 100644 deps/npm/node_modules/http-cache-semantics/LICENSE create mode 100644 deps/npm/node_modules/http-cache-semantics/index.js delete mode 100644 deps/npm/node_modules/http-cache-semantics/node4/index.js delete mode 100644 deps/npm/node_modules/http-proxy-agent/.travis.yml delete mode 100644 deps/npm/node_modules/http-proxy-agent/History.md create mode 100644 deps/npm/node_modules/http-proxy-agent/dist/agent.d.ts create mode 100644 deps/npm/node_modules/http-proxy-agent/dist/agent.js create mode 100644 deps/npm/node_modules/http-proxy-agent/dist/agent.js.map create mode 100644 deps/npm/node_modules/http-proxy-agent/dist/index.d.ts create mode 100644 deps/npm/node_modules/http-proxy-agent/dist/index.js create mode 100644 deps/npm/node_modules/http-proxy-agent/dist/index.js.map delete mode 100644 deps/npm/node_modules/http-proxy-agent/index.js delete mode 100644 deps/npm/node_modules/http-proxy-agent/test/ssl-cert-snakeoil.key delete mode 100644 deps/npm/node_modules/http-proxy-agent/test/ssl-cert-snakeoil.pem delete mode 100644 deps/npm/node_modules/http-proxy-agent/test/test.js delete mode 100644 deps/npm/node_modules/https-proxy-agent/.editorconfig delete mode 100644 deps/npm/node_modules/https-proxy-agent/.eslintrc.js delete mode 100644 deps/npm/node_modules/https-proxy-agent/History.md create mode 100644 deps/npm/node_modules/https-proxy-agent/dist/agent.d.ts create mode 100644 deps/npm/node_modules/https-proxy-agent/dist/agent.js create mode 100644 deps/npm/node_modules/https-proxy-agent/dist/agent.js.map create mode 100644 deps/npm/node_modules/https-proxy-agent/dist/index.d.ts create mode 100644 deps/npm/node_modules/https-proxy-agent/dist/index.js create mode 100644 deps/npm/node_modules/https-proxy-agent/dist/index.js.map create mode 100644 deps/npm/node_modules/https-proxy-agent/dist/parse-proxy-response.d.ts create mode 100644 deps/npm/node_modules/https-proxy-agent/dist/parse-proxy-response.js create mode 100644 deps/npm/node_modules/https-proxy-agent/dist/parse-proxy-response.js.map delete mode 100644 deps/npm/node_modules/https-proxy-agent/index.d.ts delete mode 100644 deps/npm/node_modules/https-proxy-agent/index.js create mode 100644 deps/npm/node_modules/iconv-lite/.github/dependabot.yml delete mode 100644 deps/npm/node_modules/iconv-lite/.travis.yml create mode 100644 deps/npm/node_modules/iconv-lite/encodings/utf32.js delete mode 100644 deps/npm/node_modules/iconv-lite/lib/extend-node.js delete mode 100644 deps/npm/node_modules/iferr/LICENSE delete mode 100644 deps/npm/node_modules/iferr/README.md delete mode 100644 deps/npm/node_modules/iferr/iferr.js delete mode 100644 deps/npm/node_modules/iferr/package.json delete mode 100644 deps/npm/node_modules/import-lazy/index.js delete mode 100644 deps/npm/node_modules/import-lazy/license delete mode 100644 deps/npm/node_modules/import-lazy/package.json delete mode 100644 deps/npm/node_modules/import-lazy/readme.md create mode 100644 deps/npm/node_modules/indent-string/index.d.ts create mode 100644 deps/npm/node_modules/indent-string/index.js rename deps/npm/node_modules/{global-dirs => indent-string}/license (100%) create mode 100644 deps/npm/node_modules/indent-string/package.json create mode 100644 deps/npm/node_modules/indent-string/readme.md create mode 100644 deps/npm/node_modules/init-package-json/node_modules/hosted-git-info/CHANGELOG.md create mode 100644 deps/npm/node_modules/init-package-json/node_modules/hosted-git-info/LICENSE create mode 100644 deps/npm/node_modules/init-package-json/node_modules/hosted-git-info/README.md create mode 100644 deps/npm/node_modules/init-package-json/node_modules/hosted-git-info/git-host-info.js create mode 100644 deps/npm/node_modules/init-package-json/node_modules/hosted-git-info/git-host.js create mode 100644 deps/npm/node_modules/init-package-json/node_modules/hosted-git-info/index.js create mode 100644 deps/npm/node_modules/init-package-json/node_modules/hosted-git-info/package.json create mode 100644 deps/npm/node_modules/init-package-json/node_modules/npm-package-arg/CHANGELOG.md rename deps/npm/node_modules/{uid-number => init-package-json/node_modules/npm-package-arg}/LICENSE (100%) create mode 100644 deps/npm/node_modules/init-package-json/node_modules/npm-package-arg/README.md create mode 100644 deps/npm/node_modules/init-package-json/node_modules/npm-package-arg/npa.js create mode 100644 deps/npm/node_modules/init-package-json/node_modules/npm-package-arg/package.json create mode 100644 deps/npm/node_modules/init-package-json/node_modules/semver/CHANGELOG.md rename deps/npm/node_modules/{cross-spawn/node_modules/lru-cache => init-package-json/node_modules/semver}/LICENSE (100%) create mode 100644 deps/npm/node_modules/init-package-json/node_modules/semver/README.md rename deps/npm/node_modules/{ => init-package-json/node_modules}/semver/bin/semver (100%) create mode 100644 deps/npm/node_modules/init-package-json/node_modules/semver/package.json create mode 100644 deps/npm/node_modules/init-package-json/node_modules/semver/range.bnf rename deps/npm/node_modules/{ => init-package-json/node_modules}/semver/semver.js (100%) create mode 100644 deps/npm/node_modules/ip-regex/index.d.ts delete mode 100644 deps/npm/node_modules/is-callable/.editorconfig delete mode 100644 deps/npm/node_modules/is-callable/.istanbul.yml delete mode 100644 deps/npm/node_modules/is-callable/.jscs.json delete mode 100644 deps/npm/node_modules/is-callable/.travis.yml delete mode 100644 deps/npm/node_modules/is-callable/CHANGELOG.md delete mode 100644 deps/npm/node_modules/is-callable/LICENSE delete mode 100644 deps/npm/node_modules/is-callable/Makefile delete mode 100644 deps/npm/node_modules/is-callable/README.md delete mode 100644 deps/npm/node_modules/is-callable/index.js delete mode 100644 deps/npm/node_modules/is-callable/package.json delete mode 100644 deps/npm/node_modules/is-callable/test.js delete mode 100644 deps/npm/node_modules/is-ci/LICENSE delete mode 100644 deps/npm/node_modules/is-ci/README.md delete mode 100755 deps/npm/node_modules/is-ci/bin.js delete mode 100644 deps/npm/node_modules/is-ci/index.js delete mode 100644 deps/npm/node_modules/is-ci/node_modules/ci-info/CHANGELOG.md delete mode 100644 deps/npm/node_modules/is-ci/node_modules/ci-info/LICENSE delete mode 100644 deps/npm/node_modules/is-ci/node_modules/ci-info/README.md delete mode 100644 deps/npm/node_modules/is-ci/node_modules/ci-info/index.js delete mode 100644 deps/npm/node_modules/is-ci/node_modules/ci-info/package.json delete mode 100644 deps/npm/node_modules/is-ci/node_modules/ci-info/vendors.json delete mode 100644 deps/npm/node_modules/is-ci/package.json create mode 100644 deps/npm/node_modules/is-cidr/index.d.ts delete mode 100644 deps/npm/node_modules/is-date-object/.jscs.json delete mode 100644 deps/npm/node_modules/is-date-object/.npmignore delete mode 100644 deps/npm/node_modules/is-date-object/.travis.yml delete mode 100644 deps/npm/node_modules/is-date-object/CHANGELOG.md delete mode 100644 deps/npm/node_modules/is-date-object/LICENSE delete mode 100644 deps/npm/node_modules/is-date-object/Makefile delete mode 100644 deps/npm/node_modules/is-date-object/README.md delete mode 100644 deps/npm/node_modules/is-date-object/index.js delete mode 100644 deps/npm/node_modules/is-date-object/package.json delete mode 100644 deps/npm/node_modules/is-date-object/test.js delete mode 100644 deps/npm/node_modules/is-installed-globally/index.js delete mode 100644 deps/npm/node_modules/is-installed-globally/package.json delete mode 100644 deps/npm/node_modules/is-installed-globally/readme.md rename deps/npm/node_modules/{copy-concurrently/node_modules/iferr => is-lambda}/.npmignore (100%) create mode 100644 deps/npm/node_modules/is-lambda/.travis.yml create mode 100644 deps/npm/node_modules/is-lambda/LICENSE create mode 100644 deps/npm/node_modules/is-lambda/README.md create mode 100644 deps/npm/node_modules/is-lambda/index.js create mode 100644 deps/npm/node_modules/is-lambda/package.json create mode 100644 deps/npm/node_modules/is-lambda/test.js delete mode 100644 deps/npm/node_modules/is-npm/index.js delete mode 100644 deps/npm/node_modules/is-npm/package.json delete mode 100644 deps/npm/node_modules/is-npm/readme.md delete mode 100644 deps/npm/node_modules/is-obj/index.js delete mode 100644 deps/npm/node_modules/is-obj/license delete mode 100644 deps/npm/node_modules/is-obj/package.json delete mode 100644 deps/npm/node_modules/is-obj/readme.md delete mode 100644 deps/npm/node_modules/is-path-inside/index.js delete mode 100644 deps/npm/node_modules/is-path-inside/license delete mode 100644 deps/npm/node_modules/is-path-inside/package.json delete mode 100644 deps/npm/node_modules/is-path-inside/readme.md delete mode 100644 deps/npm/node_modules/is-redirect/index.js delete mode 100644 deps/npm/node_modules/is-redirect/license delete mode 100644 deps/npm/node_modules/is-redirect/package.json delete mode 100644 deps/npm/node_modules/is-redirect/readme.md delete mode 100644 deps/npm/node_modules/is-regex/.jscs.json delete mode 100644 deps/npm/node_modules/is-regex/.npmignore delete mode 100644 deps/npm/node_modules/is-regex/.travis.yml delete mode 100644 deps/npm/node_modules/is-regex/CHANGELOG.md delete mode 100644 deps/npm/node_modules/is-regex/LICENSE delete mode 100644 deps/npm/node_modules/is-regex/Makefile delete mode 100644 deps/npm/node_modules/is-regex/README.md delete mode 100644 deps/npm/node_modules/is-regex/index.js delete mode 100644 deps/npm/node_modules/is-regex/package.json delete mode 100644 deps/npm/node_modules/is-regex/test.js delete mode 100644 deps/npm/node_modules/is-retry-allowed/index.js delete mode 100644 deps/npm/node_modules/is-retry-allowed/license delete mode 100644 deps/npm/node_modules/is-retry-allowed/package.json delete mode 100644 deps/npm/node_modules/is-retry-allowed/readme.md delete mode 100644 deps/npm/node_modules/is-stream/index.js delete mode 100644 deps/npm/node_modules/is-stream/license delete mode 100644 deps/npm/node_modules/is-stream/package.json delete mode 100644 deps/npm/node_modules/is-stream/readme.md delete mode 100644 deps/npm/node_modules/is-symbol/.editorconfig delete mode 100644 deps/npm/node_modules/is-symbol/.jscs.json delete mode 100644 deps/npm/node_modules/is-symbol/.nvmrc delete mode 100644 deps/npm/node_modules/is-symbol/.travis.yml delete mode 100644 deps/npm/node_modules/is-symbol/CHANGELOG.md delete mode 100644 deps/npm/node_modules/is-symbol/LICENSE delete mode 100644 deps/npm/node_modules/is-symbol/Makefile delete mode 100644 deps/npm/node_modules/is-symbol/README.md delete mode 100644 deps/npm/node_modules/is-symbol/index.js delete mode 100644 deps/npm/node_modules/is-symbol/package.json delete mode 100644 deps/npm/node_modules/is-symbol/test/index.js delete mode 100644 deps/npm/node_modules/json-parse-better-errors/CHANGELOG.md delete mode 100644 deps/npm/node_modules/json-parse-better-errors/LICENSE.md delete mode 100644 deps/npm/node_modules/json-parse-better-errors/README.md delete mode 100644 deps/npm/node_modules/json-parse-better-errors/index.js delete mode 100644 deps/npm/node_modules/json-parse-better-errors/package.json create mode 100644 deps/npm/node_modules/json-parse-even-better-errors/CHANGELOG.md create mode 100644 deps/npm/node_modules/json-parse-even-better-errors/LICENSE.md create mode 100644 deps/npm/node_modules/json-parse-even-better-errors/README.md create mode 100644 deps/npm/node_modules/json-parse-even-better-errors/index.js create mode 100644 deps/npm/node_modules/json-parse-even-better-errors/package.json delete mode 100644 deps/npm/node_modules/json-schema-traverse/.npmignore create mode 100644 deps/npm/node_modules/json-stringify-nice/.github/FUNDING.yml create mode 100644 deps/npm/node_modules/json-stringify-nice/.npmignore rename deps/npm/node_modules/{cross-spawn/node_modules/yallist => json-stringify-nice}/LICENSE (100%) create mode 100644 deps/npm/node_modules/json-stringify-nice/README.md create mode 100644 deps/npm/node_modules/json-stringify-nice/index.js create mode 100644 deps/npm/node_modules/json-stringify-nice/package.json create mode 100644 deps/npm/node_modules/json-stringify-nice/tap-snapshots/test-basic.js-TAP.test.js create mode 100644 deps/npm/node_modules/json-stringify-nice/test/basic.js create mode 100644 deps/npm/node_modules/jsprim/CONTRIBUTING.md create mode 100644 deps/npm/node_modules/just-diff-apply/LICENSE create mode 100644 deps/npm/node_modules/just-diff-apply/README.md create mode 100644 deps/npm/node_modules/just-diff-apply/index.js create mode 100644 deps/npm/node_modules/just-diff-apply/package.json create mode 100644 deps/npm/node_modules/just-diff/LICENSE create mode 100644 deps/npm/node_modules/just-diff/README.md create mode 100644 deps/npm/node_modules/just-diff/index.js create mode 100644 deps/npm/node_modules/just-diff/package.json delete mode 100644 deps/npm/node_modules/latest-version/index.js delete mode 100644 deps/npm/node_modules/latest-version/license delete mode 100644 deps/npm/node_modules/latest-version/package.json delete mode 100644 deps/npm/node_modules/latest-version/readme.md delete mode 100644 deps/npm/node_modules/lazy-property/.npmignore delete mode 100644 deps/npm/node_modules/lazy-property/LICENSE delete mode 100644 deps/npm/node_modules/lazy-property/README.md delete mode 100644 deps/npm/node_modules/lazy-property/component.json delete mode 100644 deps/npm/node_modules/lazy-property/lazyProperty.js delete mode 100644 deps/npm/node_modules/lazy-property/package.json create mode 100644 deps/npm/node_modules/leven/index.d.ts create mode 100644 deps/npm/node_modules/leven/index.js rename deps/npm/node_modules/{is-installed-globally => leven}/license (100%) create mode 100644 deps/npm/node_modules/leven/package.json create mode 100644 deps/npm/node_modules/leven/readme.md delete mode 100644 deps/npm/node_modules/libcipm/CHANGELOG.md delete mode 100644 deps/npm/node_modules/libcipm/LICENSE.md delete mode 100644 deps/npm/node_modules/libcipm/README.md delete mode 100644 deps/npm/node_modules/libcipm/index.js delete mode 100644 deps/npm/node_modules/libcipm/lib/config/npm-config.js delete mode 100644 deps/npm/node_modules/libcipm/lib/extract.js delete mode 100644 deps/npm/node_modules/libcipm/lib/silentlog.js delete mode 100644 deps/npm/node_modules/libcipm/lib/worker.js delete mode 100644 deps/npm/node_modules/libcipm/package.json delete mode 100644 deps/npm/node_modules/libnpm/CHANGELOG.md delete mode 100644 deps/npm/node_modules/libnpm/LICENSE.md delete mode 100644 deps/npm/node_modules/libnpm/README.md delete mode 100644 deps/npm/node_modules/libnpm/access.js delete mode 100644 deps/npm/node_modules/libnpm/adduser.js delete mode 100644 deps/npm/node_modules/libnpm/config.js delete mode 100644 deps/npm/node_modules/libnpm/extract.js delete mode 100644 deps/npm/node_modules/libnpm/fetch.js delete mode 100644 deps/npm/node_modules/libnpm/get-prefix.js delete mode 100644 deps/npm/node_modules/libnpm/hook.js delete mode 100644 deps/npm/node_modules/libnpm/index.js delete mode 100644 deps/npm/node_modules/libnpm/link-bin.js delete mode 100644 deps/npm/node_modules/libnpm/log.js delete mode 100644 deps/npm/node_modules/libnpm/logical-tree.js delete mode 100644 deps/npm/node_modules/libnpm/login.js delete mode 100644 deps/npm/node_modules/libnpm/manifest.js delete mode 100644 deps/npm/node_modules/libnpm/org.js delete mode 100644 deps/npm/node_modules/libnpm/package.json delete mode 100644 deps/npm/node_modules/libnpm/packument.js delete mode 100644 deps/npm/node_modules/libnpm/parse-arg.js delete mode 100644 deps/npm/node_modules/libnpm/profile.js delete mode 100644 deps/npm/node_modules/libnpm/publish.js delete mode 100644 deps/npm/node_modules/libnpm/read-json.js delete mode 100644 deps/npm/node_modules/libnpm/run-script.js delete mode 100644 deps/npm/node_modules/libnpm/search.js delete mode 100644 deps/npm/node_modules/libnpm/stringify-package.js delete mode 100644 deps/npm/node_modules/libnpm/tarball.js delete mode 100644 deps/npm/node_modules/libnpm/team.js delete mode 100644 deps/npm/node_modules/libnpm/unpublish.js delete mode 100644 deps/npm/node_modules/libnpm/verify-lock.js create mode 100644 deps/npm/node_modules/libnpmaccess/.github/settings.yml create mode 100644 deps/npm/node_modules/libnpmaccess/.github/workflows/ci.yml delete mode 100644 deps/npm/node_modules/libnpmaccess/.travis.yml delete mode 100644 deps/npm/node_modules/libnpmaccess/PULL_REQUEST_TEMPLATE delete mode 100644 deps/npm/node_modules/libnpmaccess/appveyor.yml rename deps/npm/node_modules/libnpmaccess/test/{util => fixtures}/tnock.js (100%) delete mode 100644 deps/npm/node_modules/libnpmconfig/CHANGELOG.md delete mode 100644 deps/npm/node_modules/libnpmconfig/PULL_REQUEST_TEMPLATE delete mode 100644 deps/npm/node_modules/libnpmconfig/README.md delete mode 100644 deps/npm/node_modules/libnpmconfig/index.js delete mode 100644 deps/npm/node_modules/libnpmconfig/node_modules/find-up/index.js delete mode 100644 deps/npm/node_modules/libnpmconfig/node_modules/find-up/license delete mode 100644 deps/npm/node_modules/libnpmconfig/node_modules/find-up/package.json delete mode 100644 deps/npm/node_modules/libnpmconfig/node_modules/find-up/readme.md delete mode 100644 deps/npm/node_modules/libnpmconfig/node_modules/locate-path/index.js delete mode 100644 deps/npm/node_modules/libnpmconfig/node_modules/locate-path/license delete mode 100644 deps/npm/node_modules/libnpmconfig/node_modules/locate-path/package.json delete mode 100644 deps/npm/node_modules/libnpmconfig/node_modules/locate-path/readme.md delete mode 100644 deps/npm/node_modules/libnpmconfig/node_modules/p-limit/index.d.ts delete mode 100644 deps/npm/node_modules/libnpmconfig/node_modules/p-limit/index.js delete mode 100644 deps/npm/node_modules/libnpmconfig/node_modules/p-limit/license delete mode 100644 deps/npm/node_modules/libnpmconfig/node_modules/p-limit/package.json delete mode 100644 deps/npm/node_modules/libnpmconfig/node_modules/p-limit/readme.md delete mode 100644 deps/npm/node_modules/libnpmconfig/node_modules/p-locate/index.js delete mode 100644 deps/npm/node_modules/libnpmconfig/node_modules/p-locate/license delete mode 100644 deps/npm/node_modules/libnpmconfig/node_modules/p-locate/package.json delete mode 100644 deps/npm/node_modules/libnpmconfig/node_modules/p-locate/readme.md delete mode 100644 deps/npm/node_modules/libnpmconfig/node_modules/p-try/index.d.ts delete mode 100644 deps/npm/node_modules/libnpmconfig/node_modules/p-try/index.js delete mode 100644 deps/npm/node_modules/libnpmconfig/node_modules/p-try/license delete mode 100644 deps/npm/node_modules/libnpmconfig/node_modules/p-try/package.json delete mode 100644 deps/npm/node_modules/libnpmconfig/node_modules/p-try/readme.md delete mode 100644 deps/npm/node_modules/libnpmconfig/package.json create mode 100644 deps/npm/node_modules/libnpmfund/CHANGELOG.md create mode 100644 deps/npm/node_modules/libnpmfund/LICENSE create mode 100644 deps/npm/node_modules/libnpmfund/README.md create mode 100644 deps/npm/node_modules/libnpmfund/index.js create mode 100644 deps/npm/node_modules/libnpmfund/package.json delete mode 100644 deps/npm/node_modules/libnpmorg/.travis.yml delete mode 100644 deps/npm/node_modules/libnpmorg/PULL_REQUEST_TEMPLATE delete mode 100644 deps/npm/node_modules/libnpmorg/appveyor.yml delete mode 100644 deps/npm/node_modules/libnpmorg/test/index.js delete mode 100644 deps/npm/node_modules/libnpmorg/test/util/tnock.js create mode 100644 deps/npm/node_modules/libnpmpack/CHANGELOG.md rename deps/npm/node_modules/{libnpmconfig => libnpmpack}/LICENSE (100%) create mode 100644 deps/npm/node_modules/libnpmpack/README.md create mode 100644 deps/npm/node_modules/libnpmpack/index.js create mode 100644 deps/npm/node_modules/libnpmpack/package.json delete mode 100644 deps/npm/node_modules/libnpmpublish/.travis.yml delete mode 100644 deps/npm/node_modules/libnpmpublish/PULL_REQUEST_TEMPLATE delete mode 100644 deps/npm/node_modules/libnpmpublish/appveyor.yml delete mode 100644 deps/npm/node_modules/libnpmpublish/test/publish.js delete mode 100644 deps/npm/node_modules/libnpmpublish/test/unpublish.js delete mode 100644 deps/npm/node_modules/libnpmpublish/test/util/mock-tarball.js delete mode 100644 deps/npm/node_modules/libnpmpublish/test/util/tnock.js delete mode 100644 deps/npm/node_modules/libnpmsearch/.travis.yml delete mode 100644 deps/npm/node_modules/libnpmsearch/PULL_REQUEST_TEMPLATE delete mode 100644 deps/npm/node_modules/libnpmsearch/appveyor.yml delete mode 100644 deps/npm/node_modules/libnpmsearch/test/index.js delete mode 100644 deps/npm/node_modules/libnpmsearch/test/util/tnock.js delete mode 100644 deps/npm/node_modules/libnpmteam/.travis.yml delete mode 100644 deps/npm/node_modules/libnpmteam/PULL_REQUEST_TEMPLATE delete mode 100644 deps/npm/node_modules/libnpmteam/appveyor.yml delete mode 100644 deps/npm/node_modules/libnpmteam/test/index.js delete mode 100644 deps/npm/node_modules/libnpmteam/test/util/tnock.js create mode 100644 deps/npm/node_modules/libnpmversion/LICENSE create mode 100644 deps/npm/node_modules/libnpmversion/README.md create mode 100644 deps/npm/node_modules/libnpmversion/lib/commit.js create mode 100644 deps/npm/node_modules/libnpmversion/lib/enforce-clean.js create mode 100644 deps/npm/node_modules/libnpmversion/lib/index.js create mode 100644 deps/npm/node_modules/libnpmversion/lib/proc-log.js create mode 100644 deps/npm/node_modules/libnpmversion/lib/retrieve-tag.js create mode 100644 deps/npm/node_modules/libnpmversion/lib/tag.js create mode 100644 deps/npm/node_modules/libnpmversion/lib/version.js create mode 100644 deps/npm/node_modules/libnpmversion/lib/write-json.js create mode 100644 deps/npm/node_modules/libnpmversion/package.json delete mode 100644 deps/npm/node_modules/libnpx/CHANGELOG.md delete mode 100644 deps/npm/node_modules/libnpx/LICENSE.md delete mode 100644 deps/npm/node_modules/libnpx/README.md delete mode 100644 deps/npm/node_modules/libnpx/auto-fallback.js delete mode 100644 deps/npm/node_modules/libnpx/child.js delete mode 100644 deps/npm/node_modules/libnpx/get-prefix.js delete mode 100644 deps/npm/node_modules/libnpx/index.js delete mode 100644 deps/npm/node_modules/libnpx/libnpx.1 delete mode 100644 deps/npm/node_modules/libnpx/locales/ca.json delete mode 100644 deps/npm/node_modules/libnpx/locales/cs.json delete mode 100644 deps/npm/node_modules/libnpx/locales/de.json delete mode 100644 deps/npm/node_modules/libnpx/locales/en.json delete mode 100644 deps/npm/node_modules/libnpx/locales/es.json delete mode 100644 deps/npm/node_modules/libnpx/locales/fr.json delete mode 100644 deps/npm/node_modules/libnpx/locales/id.json delete mode 100644 deps/npm/node_modules/libnpx/locales/it.json delete mode 100644 deps/npm/node_modules/libnpx/locales/ja.json delete mode 100644 deps/npm/node_modules/libnpx/locales/ko.json delete mode 100644 deps/npm/node_modules/libnpx/locales/nb.json delete mode 100644 deps/npm/node_modules/libnpx/locales/nl.json delete mode 100644 deps/npm/node_modules/libnpx/locales/nn.json delete mode 100644 deps/npm/node_modules/libnpx/locales/no.json delete mode 100644 deps/npm/node_modules/libnpx/locales/pl.json delete mode 100644 deps/npm/node_modules/libnpx/locales/pt_BR.json delete mode 100644 deps/npm/node_modules/libnpx/locales/ro.json delete mode 100644 deps/npm/node_modules/libnpx/locales/ru.json delete mode 100644 deps/npm/node_modules/libnpx/locales/sr.json delete mode 100644 deps/npm/node_modules/libnpx/locales/tr.json delete mode 100644 deps/npm/node_modules/libnpx/locales/uk.json delete mode 100644 deps/npm/node_modules/libnpx/locales/zh_CN.json delete mode 100644 deps/npm/node_modules/libnpx/locales/zh_TW.json delete mode 100644 deps/npm/node_modules/libnpx/package.json delete mode 100644 deps/npm/node_modules/libnpx/parse-args.js delete mode 100644 deps/npm/node_modules/libnpx/util.js delete mode 100644 deps/npm/node_modules/libnpx/y.js delete mode 100644 deps/npm/node_modules/lock-verify/LICENSE delete mode 100644 deps/npm/node_modules/lock-verify/README.md delete mode 100644 deps/npm/node_modules/lock-verify/index.js delete mode 100644 deps/npm/node_modules/lock-verify/package.json delete mode 100644 deps/npm/node_modules/lockfile/.travis.yml delete mode 100644 deps/npm/node_modules/lockfile/CHANGELOG.md delete mode 100644 deps/npm/node_modules/lockfile/README.md delete mode 100644 deps/npm/node_modules/lockfile/gen-changelog.sh delete mode 100644 deps/npm/node_modules/lockfile/lockfile.js delete mode 100644 deps/npm/node_modules/lockfile/package.json delete mode 100644 deps/npm/node_modules/lockfile/sockets.md delete mode 100644 deps/npm/node_modules/lockfile/speedtest.js delete mode 100644 deps/npm/node_modules/lockfile/test/basic.js delete mode 100644 deps/npm/node_modules/lockfile/test/fixtures/bad-child.js delete mode 100644 deps/npm/node_modules/lockfile/test/fixtures/child.js delete mode 100644 deps/npm/node_modules/lockfile/test/retry-time.js delete mode 100644 deps/npm/node_modules/lockfile/test/stale-contention.js delete mode 100644 deps/npm/node_modules/lockfile/test/unlock-no-cb.js delete mode 100644 deps/npm/node_modules/lodash._baseindexof/LICENSE.txt delete mode 100644 deps/npm/node_modules/lodash._baseindexof/README.md delete mode 100644 deps/npm/node_modules/lodash._baseindexof/index.js delete mode 100644 deps/npm/node_modules/lodash._baseindexof/package.json delete mode 100644 deps/npm/node_modules/lodash._baseuniq/LICENSE delete mode 100644 deps/npm/node_modules/lodash._baseuniq/README.md delete mode 100644 deps/npm/node_modules/lodash._baseuniq/index.js delete mode 100644 deps/npm/node_modules/lodash._baseuniq/package.json delete mode 100644 deps/npm/node_modules/lodash._bindcallback/LICENSE.txt delete mode 100644 deps/npm/node_modules/lodash._bindcallback/README.md delete mode 100644 deps/npm/node_modules/lodash._bindcallback/index.js delete mode 100644 deps/npm/node_modules/lodash._bindcallback/package.json delete mode 100644 deps/npm/node_modules/lodash._cacheindexof/LICENSE.txt delete mode 100644 deps/npm/node_modules/lodash._cacheindexof/README.md delete mode 100644 deps/npm/node_modules/lodash._cacheindexof/index.js delete mode 100644 deps/npm/node_modules/lodash._cacheindexof/package.json delete mode 100644 deps/npm/node_modules/lodash._createcache/LICENSE delete mode 100644 deps/npm/node_modules/lodash._createcache/README.md delete mode 100644 deps/npm/node_modules/lodash._createcache/index.js delete mode 100644 deps/npm/node_modules/lodash._createcache/package.json delete mode 100644 deps/npm/node_modules/lodash._createset/LICENSE delete mode 100644 deps/npm/node_modules/lodash._createset/README.md delete mode 100644 deps/npm/node_modules/lodash._createset/index.js delete mode 100644 deps/npm/node_modules/lodash._createset/package.json delete mode 100644 deps/npm/node_modules/lodash._getnative/LICENSE delete mode 100644 deps/npm/node_modules/lodash._getnative/README.md delete mode 100644 deps/npm/node_modules/lodash._getnative/index.js delete mode 100644 deps/npm/node_modules/lodash._getnative/package.json delete mode 100644 deps/npm/node_modules/lodash._root/LICENSE delete mode 100644 deps/npm/node_modules/lodash._root/README.md delete mode 100644 deps/npm/node_modules/lodash._root/index.js delete mode 100644 deps/npm/node_modules/lodash._root/package.json delete mode 100644 deps/npm/node_modules/lodash.restparam/LICENSE.txt delete mode 100644 deps/npm/node_modules/lodash.restparam/README.md delete mode 100644 deps/npm/node_modules/lodash.restparam/index.js delete mode 100644 deps/npm/node_modules/lodash.restparam/package.json delete mode 100644 deps/npm/node_modules/lodash.union/LICENSE delete mode 100644 deps/npm/node_modules/lodash.union/README.md delete mode 100644 deps/npm/node_modules/lodash.union/index.js delete mode 100644 deps/npm/node_modules/lodash.union/package.json delete mode 100644 deps/npm/node_modules/lodash.uniq/LICENSE delete mode 100644 deps/npm/node_modules/lodash.uniq/README.md delete mode 100644 deps/npm/node_modules/lodash.uniq/index.js delete mode 100644 deps/npm/node_modules/lodash.uniq/package.json delete mode 100644 deps/npm/node_modules/lodash.without/LICENSE delete mode 100644 deps/npm/node_modules/lodash.without/README.md delete mode 100644 deps/npm/node_modules/lodash.without/index.js delete mode 100644 deps/npm/node_modules/lodash.without/package.json delete mode 100644 deps/npm/node_modules/lowercase-keys/index.js delete mode 100644 deps/npm/node_modules/lowercase-keys/license delete mode 100644 deps/npm/node_modules/lowercase-keys/package.json delete mode 100644 deps/npm/node_modules/lowercase-keys/readme.md delete mode 100644 deps/npm/node_modules/make-dir/index.js delete mode 100644 deps/npm/node_modules/make-dir/license delete mode 100644 deps/npm/node_modules/make-dir/package.json delete mode 100644 deps/npm/node_modules/make-dir/readme.md create mode 100644 deps/npm/node_modules/make-fetch-happen/utils/configure-options.js create mode 100644 deps/npm/node_modules/make-fetch-happen/utils/initialize-cache.js create mode 100644 deps/npm/node_modules/make-fetch-happen/utils/is-header-conditional.js create mode 100644 deps/npm/node_modules/make-fetch-happen/utils/iterable-to-object.js create mode 100644 deps/npm/node_modules/make-fetch-happen/utils/make-policy.js delete mode 100644 deps/npm/node_modules/meant/.github/workflows/ci.yml delete mode 100644 deps/npm/node_modules/meant/CHANGELOG.md delete mode 100644 deps/npm/node_modules/meant/LICENSE delete mode 100644 deps/npm/node_modules/meant/README.md delete mode 100644 deps/npm/node_modules/meant/index.js delete mode 100644 deps/npm/node_modules/meant/package.json delete mode 100644 deps/npm/node_modules/meant/test.js delete mode 100644 deps/npm/node_modules/minimist/.travis.yml delete mode 100644 deps/npm/node_modules/minimist/LICENSE delete mode 100644 deps/npm/node_modules/minimist/example/parse.js delete mode 100644 deps/npm/node_modules/minimist/index.js delete mode 100644 deps/npm/node_modules/minimist/package.json delete mode 100644 deps/npm/node_modules/minimist/readme.markdown delete mode 100644 deps/npm/node_modules/minimist/test/all_bool.js delete mode 100644 deps/npm/node_modules/minimist/test/bool.js delete mode 100644 deps/npm/node_modules/minimist/test/dash.js delete mode 100644 deps/npm/node_modules/minimist/test/default_bool.js delete mode 100644 deps/npm/node_modules/minimist/test/dotted.js delete mode 100644 deps/npm/node_modules/minimist/test/kv_short.js delete mode 100644 deps/npm/node_modules/minimist/test/long.js delete mode 100644 deps/npm/node_modules/minimist/test/num.js delete mode 100644 deps/npm/node_modules/minimist/test/parse.js delete mode 100644 deps/npm/node_modules/minimist/test/parse_modified.js delete mode 100644 deps/npm/node_modules/minimist/test/proto.js delete mode 100644 deps/npm/node_modules/minimist/test/short.js delete mode 100644 deps/npm/node_modules/minimist/test/stop_early.js delete mode 100644 deps/npm/node_modules/minimist/test/unknown.js delete mode 100644 deps/npm/node_modules/minimist/test/whitespace.js rename deps/npm/node_modules/{fs-write-stream-atomic => minipass-collect}/LICENSE (100%) create mode 100644 deps/npm/node_modules/minipass-collect/README.md create mode 100644 deps/npm/node_modules/minipass-collect/index.js create mode 100644 deps/npm/node_modules/minipass-collect/package.json create mode 100644 deps/npm/node_modules/minipass-fetch/LICENSE create mode 100644 deps/npm/node_modules/minipass-fetch/README.md create mode 100644 deps/npm/node_modules/minipass-fetch/index.js create mode 100644 deps/npm/node_modules/minipass-fetch/lib/abort-error.js create mode 100644 deps/npm/node_modules/minipass-fetch/lib/blob.js create mode 100644 deps/npm/node_modules/minipass-fetch/lib/body.js create mode 100644 deps/npm/node_modules/minipass-fetch/lib/fetch-error.js create mode 100644 deps/npm/node_modules/minipass-fetch/lib/headers.js create mode 100644 deps/npm/node_modules/minipass-fetch/lib/index.js create mode 100644 deps/npm/node_modules/minipass-fetch/lib/request.js create mode 100644 deps/npm/node_modules/minipass-fetch/lib/response.js create mode 100644 deps/npm/node_modules/minipass-fetch/package.json rename deps/npm/node_modules/{lockfile => minipass-flush}/LICENSE (100%) create mode 100644 deps/npm/node_modules/minipass-flush/README.md create mode 100644 deps/npm/node_modules/minipass-flush/index.js create mode 100644 deps/npm/node_modules/minipass-flush/package.json create mode 100644 deps/npm/node_modules/minipass-json-stream/LICENSE create mode 100644 deps/npm/node_modules/minipass-json-stream/README.md create mode 100644 deps/npm/node_modules/minipass-json-stream/index.js create mode 100644 deps/npm/node_modules/minipass-json-stream/package.json rename deps/npm/node_modules/{proto-list => minipass-pipeline}/LICENSE (100%) create mode 100644 deps/npm/node_modules/minipass-pipeline/README.md create mode 100644 deps/npm/node_modules/minipass-pipeline/index.js create mode 100644 deps/npm/node_modules/minipass-pipeline/package.json create mode 100644 deps/npm/node_modules/minipass-sized/.npmignore rename deps/npm/node_modules/{pseudomap => minipass-sized}/LICENSE (100%) create mode 100644 deps/npm/node_modules/minipass-sized/README.md create mode 100644 deps/npm/node_modules/minipass-sized/index.js create mode 100644 deps/npm/node_modules/minipass-sized/package.json create mode 100644 deps/npm/node_modules/minipass-sized/test/basic.js rename deps/npm/node_modules/{fs-minipass/node_modules => }/minipass/LICENSE (100%) create mode 100644 deps/npm/node_modules/minipass/README.md create mode 100644 deps/npm/node_modules/minipass/index.js create mode 100644 deps/npm/node_modules/minipass/package.json delete mode 100644 deps/npm/node_modules/minizlib/node_modules/minipass/README.md delete mode 100644 deps/npm/node_modules/minizlib/node_modules/minipass/index.js delete mode 100644 deps/npm/node_modules/minizlib/node_modules/minipass/package.json delete mode 100644 deps/npm/node_modules/mississippi/changelog.md delete mode 100644 deps/npm/node_modules/mississippi/index.js delete mode 100644 deps/npm/node_modules/mississippi/license delete mode 100644 deps/npm/node_modules/mississippi/package.json delete mode 100644 deps/npm/node_modules/mississippi/readme.md create mode 100644 deps/npm/node_modules/mkdirp-infer-owner/LICENSE create mode 100644 deps/npm/node_modules/mkdirp-infer-owner/README.md create mode 100644 deps/npm/node_modules/mkdirp-infer-owner/index.js create mode 100644 deps/npm/node_modules/mkdirp-infer-owner/package.json create mode 100644 deps/npm/node_modules/mkdirp/CHANGELOG.md delete mode 100644 deps/npm/node_modules/mkdirp/bin/usage.txt create mode 100644 deps/npm/node_modules/mkdirp/lib/find-made.js create mode 100644 deps/npm/node_modules/mkdirp/lib/mkdirp-manual.js create mode 100644 deps/npm/node_modules/mkdirp/lib/mkdirp-native.js create mode 100644 deps/npm/node_modules/mkdirp/lib/opts-arg.js create mode 100644 deps/npm/node_modules/mkdirp/lib/path-arg.js create mode 100644 deps/npm/node_modules/mkdirp/lib/use-native.js delete mode 100644 deps/npm/node_modules/mkdirp/node_modules/minimist/.travis.yml delete mode 100644 deps/npm/node_modules/mkdirp/node_modules/minimist/LICENSE delete mode 100644 deps/npm/node_modules/mkdirp/node_modules/minimist/example/parse.js delete mode 100644 deps/npm/node_modules/mkdirp/node_modules/minimist/index.js delete mode 100644 deps/npm/node_modules/mkdirp/node_modules/minimist/package.json delete mode 100644 deps/npm/node_modules/mkdirp/node_modules/minimist/readme.markdown delete mode 100644 deps/npm/node_modules/mkdirp/node_modules/minimist/test/all_bool.js delete mode 100644 deps/npm/node_modules/mkdirp/node_modules/minimist/test/bool.js delete mode 100644 deps/npm/node_modules/mkdirp/node_modules/minimist/test/dash.js delete mode 100644 deps/npm/node_modules/mkdirp/node_modules/minimist/test/default_bool.js delete mode 100644 deps/npm/node_modules/mkdirp/node_modules/minimist/test/dotted.js delete mode 100644 deps/npm/node_modules/mkdirp/node_modules/minimist/test/kv_short.js delete mode 100644 deps/npm/node_modules/mkdirp/node_modules/minimist/test/long.js delete mode 100644 deps/npm/node_modules/mkdirp/node_modules/minimist/test/num.js delete mode 100644 deps/npm/node_modules/mkdirp/node_modules/minimist/test/parse.js delete mode 100644 deps/npm/node_modules/mkdirp/node_modules/minimist/test/parse_modified.js delete mode 100644 deps/npm/node_modules/mkdirp/node_modules/minimist/test/proto.js delete mode 100644 deps/npm/node_modules/mkdirp/node_modules/minimist/test/short.js delete mode 100644 deps/npm/node_modules/mkdirp/node_modules/minimist/test/stop_early.js delete mode 100644 deps/npm/node_modules/mkdirp/node_modules/minimist/test/unknown.js delete mode 100644 deps/npm/node_modules/mkdirp/node_modules/minimist/test/whitespace.js delete mode 100644 deps/npm/node_modules/move-concurrently/LICENSE delete mode 100644 deps/npm/node_modules/move-concurrently/README.md delete mode 100644 deps/npm/node_modules/move-concurrently/move.js delete mode 100644 deps/npm/node_modules/move-concurrently/node_modules/aproba/LICENSE delete mode 100644 deps/npm/node_modules/move-concurrently/node_modules/aproba/README.md delete mode 100644 deps/npm/node_modules/move-concurrently/node_modules/aproba/index.js delete mode 100644 deps/npm/node_modules/move-concurrently/node_modules/aproba/package.json delete mode 100644 deps/npm/node_modules/move-concurrently/package.json delete mode 100644 deps/npm/node_modules/mute-stream/.travis.yml delete mode 100644 deps/npm/node_modules/mute-stream/coverage/lcov-report/__root__/index.html delete mode 100644 deps/npm/node_modules/mute-stream/coverage/lcov-report/__root__/mute.js.html delete mode 100644 deps/npm/node_modules/mute-stream/coverage/lcov-report/base.css delete mode 100644 deps/npm/node_modules/mute-stream/coverage/lcov-report/index.html delete mode 100644 deps/npm/node_modules/mute-stream/coverage/lcov-report/prettify.css delete mode 100644 deps/npm/node_modules/mute-stream/coverage/lcov-report/prettify.js delete mode 100644 deps/npm/node_modules/mute-stream/coverage/lcov-report/sort-arrow-sprite.png delete mode 100644 deps/npm/node_modules/mute-stream/coverage/lcov-report/sorter.js delete mode 100644 deps/npm/node_modules/mute-stream/coverage/lcov.info delete mode 100644 deps/npm/node_modules/mute-stream/test/basic.js delete mode 100644 deps/npm/node_modules/node-fetch-npm/CHANGELOG.md delete mode 100644 deps/npm/node_modules/node-fetch-npm/LICENSE.md delete mode 100644 deps/npm/node_modules/node-fetch-npm/README.md delete mode 100644 deps/npm/node_modules/node-fetch-npm/package.json delete mode 100644 deps/npm/node_modules/node-fetch-npm/src/blob.js delete mode 100644 deps/npm/node_modules/node-fetch-npm/src/body.js delete mode 100644 deps/npm/node_modules/node-fetch-npm/src/common.js delete mode 100644 deps/npm/node_modules/node-fetch-npm/src/fetch-error.js delete mode 100644 deps/npm/node_modules/node-fetch-npm/src/headers.js delete mode 100644 deps/npm/node_modules/node-fetch-npm/src/index.js delete mode 100644 deps/npm/node_modules/node-fetch-npm/src/request.js delete mode 100644 deps/npm/node_modules/node-fetch-npm/src/response.js create mode 100644 deps/npm/node_modules/node-gyp/CONTRIBUTING.md create mode 100644 deps/npm/node_modules/node-gyp/gyp/.flake8 create mode 100644 deps/npm/node_modules/node-gyp/gyp/.github/workflows/Python_tests.yml create mode 100644 deps/npm/node_modules/node-gyp/gyp/.github/workflows/nodejs-windows.yml create mode 100644 deps/npm/node_modules/node-gyp/gyp/CHANGELOG.md create mode 100644 deps/npm/node_modules/node-gyp/gyp/CODE_OF_CONDUCT.md create mode 100644 deps/npm/node_modules/node-gyp/gyp/CONTRIBUTING.md delete mode 100644 deps/npm/node_modules/node-gyp/gyp/DEPS delete mode 100644 deps/npm/node_modules/node-gyp/gyp/OWNERS delete mode 100644 deps/npm/node_modules/node-gyp/gyp/PRESUBMIT.py create mode 100644 deps/npm/node_modules/node-gyp/gyp/README.md delete mode 100644 deps/npm/node_modules/node-gyp/gyp/codereview.settings mode change 100644 => 100755 deps/npm/node_modules/node-gyp/gyp/gyp.bat create mode 100644 deps/npm/node_modules/node-gyp/gyp/requirements_dev.txt delete mode 100755 deps/npm/node_modules/node-gyp/gyp/samples/samples delete mode 100644 deps/npm/node_modules/node-gyp/gyp/samples/samples.bat create mode 100755 deps/npm/node_modules/node-gyp/gyp/test_gyp.py create mode 100644 deps/npm/node_modules/node-gyp/macOS_Catalina_acid_test.sh create mode 100644 deps/npm/node_modules/node-gyp/node_modules/nopt/CHANGELOG.md rename deps/npm/node_modules/{read-package-tree => node-gyp/node_modules/nopt}/LICENSE (100%) create mode 100644 deps/npm/node_modules/node-gyp/node_modules/nopt/README.md create mode 100755 deps/npm/node_modules/node-gyp/node_modules/nopt/bin/nopt.js create mode 100644 deps/npm/node_modules/node-gyp/node_modules/nopt/lib/nopt.js create mode 100644 deps/npm/node_modules/node-gyp/node_modules/nopt/package.json create mode 100644 deps/npm/node_modules/node-gyp/node_modules/rimraf/LICENSE create mode 100644 deps/npm/node_modules/node-gyp/node_modules/rimraf/README.md create mode 100755 deps/npm/node_modules/node-gyp/node_modules/rimraf/bin.js create mode 100644 deps/npm/node_modules/node-gyp/node_modules/rimraf/package.json create mode 100644 deps/npm/node_modules/node-gyp/node_modules/rimraf/rimraf.js create mode 100755 deps/npm/node_modules/node-gyp/update-gyp.py 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 delete mode 100644 deps/npm/node_modules/normalize-package-data/node_modules/resolve/.editorconfig delete mode 100644 deps/npm/node_modules/normalize-package-data/node_modules/resolve/.travis.yml delete mode 100644 deps/npm/node_modules/normalize-package-data/node_modules/resolve/CHANGELOG.md delete mode 100644 deps/npm/node_modules/normalize-package-data/node_modules/resolve/LICENSE delete mode 100644 deps/npm/node_modules/normalize-package-data/node_modules/resolve/appveyor.yml delete mode 100644 deps/npm/node_modules/normalize-package-data/node_modules/resolve/changelog.hbs delete mode 100644 deps/npm/node_modules/normalize-package-data/node_modules/resolve/index.js delete mode 100644 deps/npm/node_modules/normalize-package-data/node_modules/resolve/lib/async.js delete mode 100644 deps/npm/node_modules/normalize-package-data/node_modules/resolve/lib/core.json delete mode 100644 deps/npm/node_modules/normalize-package-data/node_modules/resolve/lib/node-modules-paths.js delete mode 100644 deps/npm/node_modules/normalize-package-data/node_modules/resolve/lib/sync.js delete mode 100644 deps/npm/node_modules/normalize-package-data/node_modules/resolve/package.json delete mode 100644 deps/npm/node_modules/normalize-package-data/node_modules/resolve/readme.markdown delete mode 100644 deps/npm/node_modules/normalize-package-data/node_modules/resolve/test/core.js delete mode 100644 deps/npm/node_modules/normalize-package-data/node_modules/resolve/test/filter.js delete mode 100644 deps/npm/node_modules/normalize-package-data/node_modules/resolve/test/filter_sync.js delete mode 100644 deps/npm/node_modules/normalize-package-data/node_modules/resolve/test/mock.js delete mode 100644 deps/npm/node_modules/normalize-package-data/node_modules/resolve/test/mock_sync.js delete mode 100644 deps/npm/node_modules/normalize-package-data/node_modules/resolve/test/node-modules-paths.js delete mode 100644 deps/npm/node_modules/normalize-package-data/node_modules/resolve/test/resolver/baz/package.json delete mode 100644 deps/npm/node_modules/normalize-package-data/node_modules/resolve/test/resolver/cup.coffee delete mode 100644 deps/npm/node_modules/normalize-package-data/node_modules/resolve/test/symlinks.js create mode 100644 deps/npm/node_modules/normalize-package-data/node_modules/semver/CHANGELOG.md create mode 100644 deps/npm/node_modules/normalize-package-data/node_modules/semver/LICENSE create mode 100644 deps/npm/node_modules/normalize-package-data/node_modules/semver/README.md create mode 100755 deps/npm/node_modules/normalize-package-data/node_modules/semver/bin/semver create mode 100644 deps/npm/node_modules/normalize-package-data/node_modules/semver/package.json create mode 100644 deps/npm/node_modules/normalize-package-data/node_modules/semver/range.bnf create mode 100644 deps/npm/node_modules/normalize-package-data/node_modules/semver/semver.js delete mode 100644 deps/npm/node_modules/npm-audit-report/index.js create mode 100644 deps/npm/node_modules/npm-audit-report/lib/colors.js create mode 100644 deps/npm/node_modules/npm-audit-report/lib/exit-code.js create mode 100644 deps/npm/node_modules/npm-audit-report/lib/index.js create mode 100644 deps/npm/node_modules/npm-audit-report/lib/reporters/detail.js create mode 100644 deps/npm/node_modules/npm-audit-report/lib/reporters/install.js create mode 100644 deps/npm/node_modules/npm-audit-report/lib/reporters/json.js create mode 100644 deps/npm/node_modules/npm-audit-report/lib/reporters/quiet.js delete mode 100644 deps/npm/node_modules/npm-audit-report/lib/utils.js delete mode 100644 deps/npm/node_modules/npm-audit-report/reporters/detail.js delete mode 100644 deps/npm/node_modules/npm-audit-report/reporters/install.js delete mode 100644 deps/npm/node_modules/npm-audit-report/reporters/json.js delete mode 100644 deps/npm/node_modules/npm-audit-report/reporters/parseable.js delete mode 100644 deps/npm/node_modules/npm-audit-report/reporters/quiet.js delete mode 100644 deps/npm/node_modules/npm-cache-filename/README.md delete mode 100644 deps/npm/node_modules/npm-cache-filename/index.js delete mode 100644 deps/npm/node_modules/npm-cache-filename/package.json delete mode 100644 deps/npm/node_modules/npm-cache-filename/test.js delete mode 100644 deps/npm/node_modules/npm-lifecycle/CHANGELOG.md delete mode 100644 deps/npm/node_modules/npm-lifecycle/LICENSE delete mode 100644 deps/npm/node_modules/npm-lifecycle/README.md delete mode 100644 deps/npm/node_modules/npm-lifecycle/index.js delete mode 100644 deps/npm/node_modules/npm-lifecycle/lib/spawn.js delete mode 100755 deps/npm/node_modules/npm-lifecycle/node-gyp-bin/node-gyp delete mode 100755 deps/npm/node_modules/npm-lifecycle/node-gyp-bin/node-gyp.cmd delete mode 100644 deps/npm/node_modules/npm-lifecycle/package.json delete mode 100644 deps/npm/node_modules/npm-logical-tree/CHANGELOG.md delete mode 100644 deps/npm/node_modules/npm-logical-tree/LICENSE.md delete mode 100644 deps/npm/node_modules/npm-logical-tree/README.md delete mode 100644 deps/npm/node_modules/npm-logical-tree/index.js delete mode 100644 deps/npm/node_modules/npm-logical-tree/package.json delete mode 100644 deps/npm/node_modules/npm-normalize-package-bin/package-lock.json create mode 100755 deps/npm/node_modules/npm-packlist/bin/index.js delete mode 100644 deps/npm/node_modules/npm-registry-fetch/config.js create mode 100644 deps/npm/node_modules/npm-registry-fetch/default-opts.js delete mode 100644 deps/npm/node_modules/npm-registry-fetch/node_modules/safe-buffer/README.md delete mode 100644 deps/npm/node_modules/npm-registry-fetch/node_modules/safe-buffer/index.d.ts delete mode 100644 deps/npm/node_modules/npm-registry-fetch/node_modules/safe-buffer/index.js delete mode 100644 deps/npm/node_modules/npm-registry-fetch/node_modules/safe-buffer/package.json delete mode 100644 deps/npm/node_modules/npm-run-path/index.js delete mode 100644 deps/npm/node_modules/npm-run-path/license delete mode 100644 deps/npm/node_modules/npm-run-path/package.json delete mode 100644 deps/npm/node_modules/npm-run-path/readme.md delete mode 100644 deps/npm/node_modules/object-keys/.editorconfig delete mode 100644 deps/npm/node_modules/object-keys/.jscs.json delete mode 100644 deps/npm/node_modules/object-keys/.travis.yml delete mode 100644 deps/npm/node_modules/object-keys/CHANGELOG.md delete mode 100644 deps/npm/node_modules/object-keys/LICENSE delete mode 100644 deps/npm/node_modules/object-keys/README.md delete mode 100644 deps/npm/node_modules/object-keys/index.js delete mode 100644 deps/npm/node_modules/object-keys/isArguments.js delete mode 100644 deps/npm/node_modules/object-keys/package.json delete mode 100644 deps/npm/node_modules/object-keys/test/index.js delete mode 100644 deps/npm/node_modules/object.getownpropertydescriptors/.editorconfig delete mode 100644 deps/npm/node_modules/object.getownpropertydescriptors/.jscs.json delete mode 100644 deps/npm/node_modules/object.getownpropertydescriptors/.npmignore delete mode 100644 deps/npm/node_modules/object.getownpropertydescriptors/.travis.yml delete mode 100644 deps/npm/node_modules/object.getownpropertydescriptors/CHANGELOG.md delete mode 100644 deps/npm/node_modules/object.getownpropertydescriptors/LICENSE delete mode 100644 deps/npm/node_modules/object.getownpropertydescriptors/Makefile delete mode 100644 deps/npm/node_modules/object.getownpropertydescriptors/README.md delete mode 100644 deps/npm/node_modules/object.getownpropertydescriptors/implementation.js delete mode 100644 deps/npm/node_modules/object.getownpropertydescriptors/index.js delete mode 100644 deps/npm/node_modules/object.getownpropertydescriptors/package.json delete mode 100644 deps/npm/node_modules/object.getownpropertydescriptors/polyfill.js delete mode 100644 deps/npm/node_modules/object.getownpropertydescriptors/shim.js delete mode 100644 deps/npm/node_modules/object.getownpropertydescriptors/test/index.js delete mode 100644 deps/npm/node_modules/object.getownpropertydescriptors/test/shimmed.js delete mode 100644 deps/npm/node_modules/object.getownpropertydescriptors/test/tests.js delete mode 100644 deps/npm/node_modules/p-finally/index.js delete mode 100644 deps/npm/node_modules/p-finally/license delete mode 100644 deps/npm/node_modules/p-finally/package.json delete mode 100644 deps/npm/node_modules/p-finally/readme.md create mode 100644 deps/npm/node_modules/p-map/index.d.ts create mode 100644 deps/npm/node_modules/p-map/index.js create mode 100644 deps/npm/node_modules/p-map/license create mode 100644 deps/npm/node_modules/p-map/package.json create mode 100644 deps/npm/node_modules/p-map/readme.md delete mode 100644 deps/npm/node_modules/package-json/index.js delete mode 100644 deps/npm/node_modules/package-json/license delete mode 100644 deps/npm/node_modules/package-json/package.json delete mode 100644 deps/npm/node_modules/package-json/readme.md delete mode 100644 deps/npm/node_modules/pacote/CHANGELOG.md delete mode 100644 deps/npm/node_modules/pacote/extract.js delete mode 100644 deps/npm/node_modules/pacote/index.js create mode 100755 deps/npm/node_modules/pacote/lib/bin.js create mode 100644 deps/npm/node_modules/pacote/lib/dir.js delete mode 100644 deps/npm/node_modules/pacote/lib/extract-stream.js delete mode 100644 deps/npm/node_modules/pacote/lib/fetch.js create mode 100644 deps/npm/node_modules/pacote/lib/fetcher.js delete mode 100644 deps/npm/node_modules/pacote/lib/fetchers/alias.js delete mode 100644 deps/npm/node_modules/pacote/lib/fetchers/directory.js delete mode 100644 deps/npm/node_modules/pacote/lib/fetchers/file.js delete mode 100644 deps/npm/node_modules/pacote/lib/fetchers/git.js delete mode 100644 deps/npm/node_modules/pacote/lib/fetchers/hosted.js delete mode 100644 deps/npm/node_modules/pacote/lib/fetchers/range.js delete mode 100644 deps/npm/node_modules/pacote/lib/fetchers/registry/index.js delete mode 100644 deps/npm/node_modules/pacote/lib/fetchers/registry/manifest.js delete mode 100644 deps/npm/node_modules/pacote/lib/fetchers/registry/packument.js delete mode 100644 deps/npm/node_modules/pacote/lib/fetchers/registry/tarball.js delete mode 100644 deps/npm/node_modules/pacote/lib/fetchers/remote.js delete mode 100644 deps/npm/node_modules/pacote/lib/fetchers/tag.js delete mode 100644 deps/npm/node_modules/pacote/lib/fetchers/version.js create mode 100644 deps/npm/node_modules/pacote/lib/file.js delete mode 100644 deps/npm/node_modules/pacote/lib/finalize-manifest.js create mode 100644 deps/npm/node_modules/pacote/lib/git.js create mode 100644 deps/npm/node_modules/pacote/lib/index.js create mode 100644 deps/npm/node_modules/pacote/lib/registry.js create mode 100644 deps/npm/node_modules/pacote/lib/remote.js create mode 100644 deps/npm/node_modules/pacote/lib/util/cache-dir.js delete mode 100644 deps/npm/node_modules/pacote/lib/util/cache-key.js delete mode 100644 deps/npm/node_modules/pacote/lib/util/finished.js delete mode 100644 deps/npm/node_modules/pacote/lib/util/git.js create mode 100644 deps/npm/node_modules/pacote/lib/util/is-package-bin.js create mode 100644 deps/npm/node_modules/pacote/lib/util/npm.js delete mode 100644 deps/npm/node_modules/pacote/lib/util/opt-check.js delete mode 100644 deps/npm/node_modules/pacote/lib/util/pack-dir.js create mode 100644 deps/npm/node_modules/pacote/lib/util/proc-log.js delete mode 100644 deps/npm/node_modules/pacote/lib/util/proclog.js delete mode 100644 deps/npm/node_modules/pacote/lib/util/read-json.js delete mode 100644 deps/npm/node_modules/pacote/lib/with-tarball-stream.js delete mode 100644 deps/npm/node_modules/pacote/manifest.js delete mode 100644 deps/npm/node_modules/pacote/node_modules/minipass/README.md delete mode 100644 deps/npm/node_modules/pacote/node_modules/minipass/index.js delete mode 100644 deps/npm/node_modules/pacote/node_modules/minipass/package.json delete mode 100644 deps/npm/node_modules/pacote/packument.js delete mode 100644 deps/npm/node_modules/pacote/prefetch.js delete mode 100644 deps/npm/node_modules/pacote/tarball.js delete mode 100644 deps/npm/node_modules/parallel-transform/.npmignore delete mode 100644 deps/npm/node_modules/parallel-transform/LICENSE delete mode 100644 deps/npm/node_modules/parallel-transform/README.md delete mode 100644 deps/npm/node_modules/parallel-transform/index.js delete mode 100644 deps/npm/node_modules/parallel-transform/node_modules/readable-stream/.travis.yml delete mode 100644 deps/npm/node_modules/parallel-transform/node_modules/readable-stream/GOVERNANCE.md delete mode 100644 deps/npm/node_modules/parallel-transform/node_modules/readable-stream/LICENSE delete mode 100644 deps/npm/node_modules/parallel-transform/node_modules/readable-stream/README.md delete mode 100644 deps/npm/node_modules/parallel-transform/node_modules/readable-stream/doc/wg-meetings/2015-01-30.md delete mode 100644 deps/npm/node_modules/parallel-transform/node_modules/readable-stream/duplex-browser.js delete mode 100644 deps/npm/node_modules/parallel-transform/node_modules/readable-stream/duplex.js delete mode 100644 deps/npm/node_modules/parallel-transform/node_modules/readable-stream/lib/_stream_duplex.js delete mode 100644 deps/npm/node_modules/parallel-transform/node_modules/readable-stream/lib/_stream_passthrough.js delete mode 100644 deps/npm/node_modules/parallel-transform/node_modules/readable-stream/lib/_stream_readable.js delete mode 100644 deps/npm/node_modules/parallel-transform/node_modules/readable-stream/lib/_stream_transform.js delete mode 100644 deps/npm/node_modules/parallel-transform/node_modules/readable-stream/lib/_stream_writable.js delete mode 100644 deps/npm/node_modules/parallel-transform/node_modules/readable-stream/lib/internal/streams/BufferList.js delete mode 100644 deps/npm/node_modules/parallel-transform/node_modules/readable-stream/lib/internal/streams/destroy.js delete mode 100644 deps/npm/node_modules/parallel-transform/node_modules/readable-stream/lib/internal/streams/stream-browser.js delete mode 100644 deps/npm/node_modules/parallel-transform/node_modules/readable-stream/lib/internal/streams/stream.js delete mode 100644 deps/npm/node_modules/parallel-transform/node_modules/readable-stream/package.json delete mode 100644 deps/npm/node_modules/parallel-transform/node_modules/readable-stream/passthrough.js delete mode 100644 deps/npm/node_modules/parallel-transform/node_modules/readable-stream/readable-browser.js delete mode 100644 deps/npm/node_modules/parallel-transform/node_modules/readable-stream/readable.js delete mode 100644 deps/npm/node_modules/parallel-transform/node_modules/readable-stream/transform.js delete mode 100644 deps/npm/node_modules/parallel-transform/node_modules/readable-stream/writable-browser.js delete mode 100644 deps/npm/node_modules/parallel-transform/node_modules/readable-stream/writable.js delete mode 100644 deps/npm/node_modules/parallel-transform/node_modules/string_decoder/.travis.yml delete mode 100644 deps/npm/node_modules/parallel-transform/node_modules/string_decoder/LICENSE delete mode 100644 deps/npm/node_modules/parallel-transform/node_modules/string_decoder/README.md delete mode 100644 deps/npm/node_modules/parallel-transform/node_modules/string_decoder/lib/string_decoder.js delete mode 100644 deps/npm/node_modules/parallel-transform/node_modules/string_decoder/package.json delete mode 100644 deps/npm/node_modules/parallel-transform/package.json rename deps/npm/node_modules/{minizlib/node_modules/minipass => parse-conflict-json}/LICENSE (100%) create mode 100644 deps/npm/node_modules/parse-conflict-json/README.md create mode 100644 deps/npm/node_modules/parse-conflict-json/index.js create mode 100644 deps/npm/node_modules/parse-conflict-json/package.json delete mode 100644 deps/npm/node_modules/path-exists/index.js delete mode 100644 deps/npm/node_modules/path-exists/license delete mode 100644 deps/npm/node_modules/path-exists/package.json delete mode 100644 deps/npm/node_modules/path-exists/readme.md delete mode 100644 deps/npm/node_modules/path-is-inside/LICENSE.txt delete mode 100644 deps/npm/node_modules/path-is-inside/lib/path-is-inside.js delete mode 100644 deps/npm/node_modules/path-is-inside/package.json delete mode 100644 deps/npm/node_modules/path-key/index.js delete mode 100644 deps/npm/node_modules/path-key/license delete mode 100644 deps/npm/node_modules/path-key/package.json delete mode 100644 deps/npm/node_modules/path-key/readme.md delete mode 100644 deps/npm/node_modules/pify/index.js delete mode 100644 deps/npm/node_modules/pify/license delete mode 100644 deps/npm/node_modules/pify/package.json delete mode 100644 deps/npm/node_modules/pify/readme.md delete mode 100644 deps/npm/node_modules/prepend-http/index.js delete mode 100644 deps/npm/node_modules/prepend-http/license delete mode 100644 deps/npm/node_modules/prepend-http/package.json delete mode 100644 deps/npm/node_modules/prepend-http/readme.md create mode 100644 deps/npm/node_modules/promise-all-reject-late/.github/FUNDING.yml create mode 100644 deps/npm/node_modules/promise-all-reject-late/.npmignore create mode 100644 deps/npm/node_modules/promise-all-reject-late/LICENSE create mode 100644 deps/npm/node_modules/promise-all-reject-late/README.md create mode 100644 deps/npm/node_modules/promise-all-reject-late/index.js create mode 100644 deps/npm/node_modules/promise-all-reject-late/package.json create mode 100644 deps/npm/node_modules/promise-all-reject-late/test/index.js create mode 100644 deps/npm/node_modules/promise-call-limit/LICENSE create mode 100644 deps/npm/node_modules/promise-call-limit/README.md create mode 100644 deps/npm/node_modules/promise-call-limit/index.js create mode 100644 deps/npm/node_modules/promise-call-limit/package.json delete mode 100644 deps/npm/node_modules/promise-retry/node_modules/retry/.npmignore delete mode 100644 deps/npm/node_modules/promise-retry/node_modules/retry/License delete mode 100644 deps/npm/node_modules/promise-retry/node_modules/retry/Makefile delete mode 100644 deps/npm/node_modules/promise-retry/node_modules/retry/README.md delete mode 100644 deps/npm/node_modules/promise-retry/node_modules/retry/equation.gif delete mode 100644 deps/npm/node_modules/promise-retry/node_modules/retry/example/dns.js delete mode 100644 deps/npm/node_modules/promise-retry/node_modules/retry/example/stop.js delete mode 100644 deps/npm/node_modules/promise-retry/node_modules/retry/index.js delete mode 100644 deps/npm/node_modules/promise-retry/node_modules/retry/lib/retry.js delete mode 100644 deps/npm/node_modules/promise-retry/node_modules/retry/lib/retry_operation.js delete mode 100644 deps/npm/node_modules/promise-retry/node_modules/retry/package.json delete mode 100644 deps/npm/node_modules/promise-retry/node_modules/retry/test/common.js delete mode 100644 deps/npm/node_modules/promise-retry/node_modules/retry/test/integration/test-forever.js delete mode 100644 deps/npm/node_modules/promise-retry/node_modules/retry/test/integration/test-retry-operation.js delete mode 100644 deps/npm/node_modules/promise-retry/node_modules/retry/test/integration/test-retry-wrap.js delete mode 100644 deps/npm/node_modules/promise-retry/node_modules/retry/test/integration/test-timeouts.js delete mode 100644 deps/npm/node_modules/proto-list/README.md delete mode 100644 deps/npm/node_modules/proto-list/package.json delete mode 100644 deps/npm/node_modules/proto-list/proto-list.js delete mode 100644 deps/npm/node_modules/proto-list/test/basic.js delete mode 100644 deps/npm/node_modules/protoduck/CHANGELOG.md delete mode 100644 deps/npm/node_modules/protoduck/LICENSE delete mode 100644 deps/npm/node_modules/protoduck/README.md delete mode 100644 deps/npm/node_modules/protoduck/index.js delete mode 100644 deps/npm/node_modules/protoduck/package.json delete mode 100644 deps/npm/node_modules/prr/.npmignore delete mode 100644 deps/npm/node_modules/prr/.travis.yml delete mode 100644 deps/npm/node_modules/prr/LICENSE.md delete mode 100644 deps/npm/node_modules/prr/README.md delete mode 100644 deps/npm/node_modules/prr/package.json delete mode 100644 deps/npm/node_modules/prr/prr.js delete mode 100644 deps/npm/node_modules/prr/test.js delete mode 100644 deps/npm/node_modules/pseudomap/README.md delete mode 100644 deps/npm/node_modules/pseudomap/map.js delete mode 100644 deps/npm/node_modules/pseudomap/package.json delete mode 100644 deps/npm/node_modules/pseudomap/pseudomap.js delete mode 100644 deps/npm/node_modules/pseudomap/test/basic.js delete mode 100644 deps/npm/node_modules/psl/.eslintignore delete mode 100644 deps/npm/node_modules/psl/.travis.yml create mode 100644 deps/npm/node_modules/psl/LICENSE create mode 100644 deps/npm/node_modules/psl/browserstack-logo.svg delete mode 100644 deps/npm/node_modules/psl/karma.conf.js delete mode 100644 deps/npm/node_modules/psl/yarn.lock delete mode 100644 deps/npm/node_modules/pump/.travis.yml delete mode 100644 deps/npm/node_modules/pump/LICENSE delete mode 100644 deps/npm/node_modules/pump/README.md delete mode 100644 deps/npm/node_modules/pump/index.js delete mode 100644 deps/npm/node_modules/pump/package.json delete mode 100644 deps/npm/node_modules/pump/test-browser.js delete mode 100644 deps/npm/node_modules/pump/test-node.js delete mode 100644 deps/npm/node_modules/pumpify/.travis.yml delete mode 100644 deps/npm/node_modules/pumpify/LICENSE delete mode 100644 deps/npm/node_modules/pumpify/README.md delete mode 100644 deps/npm/node_modules/pumpify/index.js delete mode 100644 deps/npm/node_modules/pumpify/node_modules/pump/.travis.yml delete mode 100644 deps/npm/node_modules/pumpify/node_modules/pump/LICENSE delete mode 100644 deps/npm/node_modules/pumpify/node_modules/pump/README.md delete mode 100644 deps/npm/node_modules/pumpify/node_modules/pump/index.js delete mode 100644 deps/npm/node_modules/pumpify/node_modules/pump/package.json delete mode 100644 deps/npm/node_modules/pumpify/node_modules/pump/test-browser.js delete mode 100644 deps/npm/node_modules/pumpify/node_modules/pump/test-node.js delete mode 100644 deps/npm/node_modules/pumpify/package.json delete mode 100644 deps/npm/node_modules/pumpify/test.js create mode 100644 deps/npm/node_modules/punycode/punycode.es6.js delete mode 100644 deps/npm/node_modules/query-string/index.d.ts delete mode 100644 deps/npm/node_modules/query-string/index.js delete mode 100644 deps/npm/node_modules/query-string/license delete mode 100644 deps/npm/node_modules/query-string/package.json delete mode 100644 deps/npm/node_modules/query-string/readme.md delete mode 100644 deps/npm/node_modules/qw/LICENSE delete mode 100644 deps/npm/node_modules/qw/README.md delete mode 100644 deps/npm/node_modules/qw/package.json delete mode 100644 deps/npm/node_modules/qw/qw.js delete mode 100644 deps/npm/node_modules/rc/LICENSE.APACHE2 delete mode 100644 deps/npm/node_modules/rc/LICENSE.BSD delete mode 100644 deps/npm/node_modules/rc/LICENSE.MIT delete mode 100644 deps/npm/node_modules/rc/README.md delete mode 100644 deps/npm/node_modules/rc/browser.js delete mode 100755 deps/npm/node_modules/rc/cli.js delete mode 100755 deps/npm/node_modules/rc/index.js delete mode 100644 deps/npm/node_modules/rc/lib/utils.js delete mode 100644 deps/npm/node_modules/rc/package.json delete mode 100644 deps/npm/node_modules/rc/test/ini.js delete mode 100644 deps/npm/node_modules/rc/test/nested-env-vars.js delete mode 100644 deps/npm/node_modules/rc/test/test.js delete mode 100644 deps/npm/node_modules/read-installed/.npmignore delete mode 100644 deps/npm/node_modules/read-installed/.travis.yml delete mode 100644 deps/npm/node_modules/read-installed/LICENSE delete mode 100644 deps/npm/node_modules/read-installed/README.md delete mode 100644 deps/npm/node_modules/read-installed/package.json delete mode 100644 deps/npm/node_modules/read-installed/read-installed.js delete mode 100644 deps/npm/node_modules/read-installed/test/basic.js delete mode 100644 deps/npm/node_modules/read-installed/test/cyclic-extraneous-peer-deps.js delete mode 100644 deps/npm/node_modules/read-installed/test/depth-0.js delete mode 100644 deps/npm/node_modules/read-installed/test/depth-1.js delete mode 100644 deps/npm/node_modules/read-installed/test/dev.js delete mode 100644 deps/npm/node_modules/read-installed/test/empty.js delete mode 100644 deps/npm/node_modules/read-installed/test/extraneous-dev.js delete mode 100644 deps/npm/node_modules/read-installed/test/extraneous.js delete mode 100644 deps/npm/node_modules/read-installed/test/fixtures/extraneous-detected/package.json delete mode 100644 deps/npm/node_modules/read-installed/test/fixtures/extraneous-dev-dep/package.json delete mode 100644 deps/npm/node_modules/read-installed/test/fixtures/grandparent-peer-dev/package.json delete mode 100644 deps/npm/node_modules/read-installed/test/fixtures/grandparent-peer/package.json delete mode 100644 deps/npm/node_modules/read-installed/test/fixtures/package.json delete mode 100644 deps/npm/node_modules/read-installed/test/grandparent-peer-dev.js delete mode 100644 deps/npm/node_modules/read-installed/test/grandparent-peer.js delete mode 100644 deps/npm/node_modules/read-installed/test/issue-40.js delete mode 100644 deps/npm/node_modules/read-installed/test/linked-dep-dev-deps-extraneous.js delete mode 100644 deps/npm/node_modules/read-installed/test/noargs.js delete mode 100644 deps/npm/node_modules/read-installed/test/peer-dep-at-latest.js rename deps/npm/node_modules/{npm-cache-filename => read-package-json-fast}/LICENSE (100%) create mode 100644 deps/npm/node_modules/read-package-json-fast/README.md create mode 100644 deps/npm/node_modules/read-package-json-fast/index.js create mode 100644 deps/npm/node_modules/read-package-json-fast/package.json delete mode 100644 deps/npm/node_modules/read-package-tree/README.md delete mode 100644 deps/npm/node_modules/read-package-tree/package.json delete mode 100644 deps/npm/node_modules/read-package-tree/rpt.js create mode 100644 deps/npm/node_modules/readable-stream/.travis.yml create mode 100644 deps/npm/node_modules/readable-stream/CONTRIBUTING.md create mode 100644 deps/npm/node_modules/readable-stream/doc/wg-meetings/2015-01-30.md rename deps/npm/node_modules/{are-we-there-yet/node_modules => }/readable-stream/duplex-browser.js (100%) rename deps/npm/node_modules/{are-we-there-yet/node_modules => }/readable-stream/duplex.js (100%) delete mode 100644 deps/npm/node_modules/readable-stream/errors-browser.js delete mode 100644 deps/npm/node_modules/readable-stream/errors.js delete mode 100644 deps/npm/node_modules/readable-stream/experimentalWarning.js rename deps/npm/node_modules/{are-we-there-yet/node_modules => }/readable-stream/lib/internal/streams/BufferList.js (100%) delete mode 100644 deps/npm/node_modules/readable-stream/lib/internal/streams/async_iterator.js delete mode 100644 deps/npm/node_modules/readable-stream/lib/internal/streams/buffer_list.js delete mode 100644 deps/npm/node_modules/readable-stream/lib/internal/streams/end-of-stream.js delete mode 100644 deps/npm/node_modules/readable-stream/lib/internal/streams/from-browser.js delete mode 100644 deps/npm/node_modules/readable-stream/lib/internal/streams/from.js delete mode 100644 deps/npm/node_modules/readable-stream/lib/internal/streams/pipeline.js delete mode 100644 deps/npm/node_modules/readable-stream/lib/internal/streams/state.js rename deps/npm/node_modules/{are-we-there-yet/node_modules => }/readable-stream/passthrough.js (100%) rename deps/npm/node_modules/{are-we-there-yet/node_modules => }/readable-stream/transform.js (100%) rename deps/npm/node_modules/{are-we-there-yet/node_modules => }/readable-stream/writable-browser.js (100%) rename deps/npm/node_modules/{are-we-there-yet/node_modules => }/readable-stream/writable.js (100%) delete mode 100644 deps/npm/node_modules/registry-auth-token/.npmignore delete mode 100644 deps/npm/node_modules/registry-auth-token/CHANGELOG.md delete mode 100644 deps/npm/node_modules/registry-auth-token/LICENSE delete mode 100644 deps/npm/node_modules/registry-auth-token/README.md delete mode 100644 deps/npm/node_modules/registry-auth-token/base64.js delete mode 100644 deps/npm/node_modules/registry-auth-token/index.js delete mode 100644 deps/npm/node_modules/registry-auth-token/package.json delete mode 100644 deps/npm/node_modules/registry-auth-token/registry-url.js delete mode 100644 deps/npm/node_modules/registry-auth-token/test/auth-token.test.js delete mode 100644 deps/npm/node_modules/registry-auth-token/test/registry-url.test.js delete mode 100644 deps/npm/node_modules/registry-auth-token/yarn.lock delete mode 100644 deps/npm/node_modules/registry-url/index.js delete mode 100644 deps/npm/node_modules/registry-url/license delete mode 100644 deps/npm/node_modules/registry-url/package.json delete mode 100644 deps/npm/node_modules/registry-url/readme.md rename deps/npm/node_modules/{ => request/node_modules}/uuid/AUTHORS (100%) create mode 100644 deps/npm/node_modules/request/node_modules/uuid/CHANGELOG.md create mode 100644 deps/npm/node_modules/request/node_modules/uuid/LICENSE.md create mode 100644 deps/npm/node_modules/request/node_modules/uuid/README.md rename deps/npm/node_modules/{ => request/node_modules}/uuid/bin/uuid (100%) rename deps/npm/node_modules/{ => request/node_modules}/uuid/index.js (100%) create mode 100644 deps/npm/node_modules/request/node_modules/uuid/lib/bytesToUuid.js rename deps/npm/node_modules/{ => request/node_modules}/uuid/lib/md5-browser.js (100%) rename deps/npm/node_modules/{ => request/node_modules}/uuid/lib/md5.js (100%) rename deps/npm/node_modules/{ => request/node_modules}/uuid/lib/rng-browser.js (100%) rename deps/npm/node_modules/{ => request/node_modules}/uuid/lib/rng.js (100%) rename deps/npm/node_modules/{ => request/node_modules}/uuid/lib/sha1-browser.js (100%) rename deps/npm/node_modules/{ => request/node_modules}/uuid/lib/sha1.js (100%) rename deps/npm/node_modules/{ => request/node_modules}/uuid/lib/v35.js (100%) create mode 100644 deps/npm/node_modules/request/node_modules/uuid/package.json create mode 100644 deps/npm/node_modules/request/node_modules/uuid/v1.js rename deps/npm/node_modules/{ => request/node_modules}/uuid/v3.js (100%) rename deps/npm/node_modules/{ => request/node_modules}/uuid/v4.js (100%) rename deps/npm/node_modules/{ => request/node_modules}/uuid/v5.js (100%) delete mode 100644 deps/npm/node_modules/require-directory/.npmignore delete mode 100644 deps/npm/node_modules/require-directory/.travis.yml delete mode 100644 deps/npm/node_modules/require-directory/LICENSE delete mode 100644 deps/npm/node_modules/require-directory/README.markdown delete mode 100644 deps/npm/node_modules/require-directory/index.js delete mode 100644 deps/npm/node_modules/require-directory/package.json delete mode 100644 deps/npm/node_modules/require-main-filename/CHANGELOG.md delete mode 100644 deps/npm/node_modules/require-main-filename/LICENSE.txt delete mode 100644 deps/npm/node_modules/require-main-filename/README.md delete mode 100644 deps/npm/node_modules/require-main-filename/index.js delete mode 100644 deps/npm/node_modules/require-main-filename/package.json delete mode 100644 deps/npm/node_modules/resolve-from/index.js delete mode 100644 deps/npm/node_modules/resolve-from/license delete mode 100644 deps/npm/node_modules/resolve-from/package.json delete mode 100644 deps/npm/node_modules/resolve-from/readme.md rename deps/npm/node_modules/{es-to-primitive => resolve}/.editorconfig (100%) rename deps/npm/node_modules/{normalize-package-data/node_modules => }/resolve/.eslintignore (100%) create mode 100644 deps/npm/node_modules/resolve/.travis.yml create mode 100644 deps/npm/node_modules/resolve/LICENSE create mode 100644 deps/npm/node_modules/resolve/appveyor.yml rename deps/npm/node_modules/{normalize-package-data/node_modules => }/resolve/example/async.js (100%) rename deps/npm/node_modules/{normalize-package-data/node_modules => }/resolve/example/sync.js (100%) create mode 100644 deps/npm/node_modules/resolve/index.js create mode 100644 deps/npm/node_modules/resolve/lib/async.js rename deps/npm/node_modules/{normalize-package-data/node_modules => }/resolve/lib/caller.js (100%) rename deps/npm/node_modules/{normalize-package-data/node_modules => }/resolve/lib/core.js (100%) create mode 100644 deps/npm/node_modules/resolve/lib/core.json create mode 100644 deps/npm/node_modules/resolve/lib/is-core.js create mode 100644 deps/npm/node_modules/resolve/lib/node-modules-paths.js rename deps/npm/node_modules/{normalize-package-data/node_modules => }/resolve/lib/normalize-options.js (100%) create mode 100644 deps/npm/node_modules/resolve/lib/sync.js create mode 100644 deps/npm/node_modules/resolve/package.json create mode 100644 deps/npm/node_modules/resolve/readme.markdown create mode 100644 deps/npm/node_modules/resolve/test/core.js rename deps/npm/node_modules/{normalize-package-data/node_modules => }/resolve/test/dotdot.js (100%) rename deps/npm/node_modules/{normalize-package-data/node_modules => }/resolve/test/dotdot/abc/index.js (100%) rename deps/npm/node_modules/{normalize-package-data/node_modules => }/resolve/test/dotdot/index.js (100%) rename deps/npm/node_modules/{normalize-package-data/node_modules => }/resolve/test/faulty_basedir.js (100%) create mode 100644 deps/npm/node_modules/resolve/test/filter.js create mode 100644 deps/npm/node_modules/resolve/test/filter_sync.js create mode 100644 deps/npm/node_modules/resolve/test/mock.js create mode 100644 deps/npm/node_modules/resolve/test/mock_sync.js rename deps/npm/node_modules/{normalize-package-data/node_modules => }/resolve/test/module_dir.js (100%) rename deps/npm/node_modules/{normalize-package-data/node_modules => }/resolve/test/module_dir/xmodules/aaa/index.js (100%) rename deps/npm/node_modules/{normalize-package-data/node_modules => }/resolve/test/module_dir/ymodules/aaa/index.js (100%) rename deps/npm/node_modules/{normalize-package-data/node_modules => }/resolve/test/module_dir/zmodules/bbb/main.js (100%) rename deps/npm/node_modules/{normalize-package-data/node_modules => }/resolve/test/module_dir/zmodules/bbb/package.json (100%) create mode 100644 deps/npm/node_modules/resolve/test/node-modules-paths.js rename deps/npm/node_modules/{normalize-package-data/node_modules => }/resolve/test/node_path.js (100%) rename deps/npm/node_modules/{normalize-package-data/node_modules => }/resolve/test/node_path/x/aaa/index.js (100%) rename deps/npm/node_modules/{normalize-package-data/node_modules => }/resolve/test/node_path/x/ccc/index.js (100%) rename deps/npm/node_modules/{normalize-package-data/node_modules => }/resolve/test/node_path/y/bbb/index.js (100%) rename deps/npm/node_modules/{normalize-package-data/node_modules => }/resolve/test/node_path/y/ccc/index.js (100%) rename deps/npm/node_modules/{normalize-package-data/node_modules => }/resolve/test/nonstring.js (100%) rename deps/npm/node_modules/{normalize-package-data/node_modules => }/resolve/test/pathfilter.js (100%) rename deps/npm/node_modules/{normalize-package-data/node_modules => }/resolve/test/pathfilter/deep_ref/main.js (100%) rename deps/npm/node_modules/{normalize-package-data/node_modules => }/resolve/test/precedence.js (100%) rename deps/npm/node_modules/{normalize-package-data/node_modules => }/resolve/test/precedence/aaa.js (100%) rename deps/npm/node_modules/{normalize-package-data/node_modules => }/resolve/test/precedence/aaa/index.js (100%) rename deps/npm/node_modules/{normalize-package-data/node_modules => }/resolve/test/precedence/aaa/main.js (100%) rename deps/npm/node_modules/{normalize-package-data/node_modules => }/resolve/test/precedence/bbb.js (100%) rename deps/npm/node_modules/{normalize-package-data/node_modules => }/resolve/test/precedence/bbb/main.js (100%) rename deps/npm/node_modules/{normalize-package-data/node_modules => }/resolve/test/resolver.js (92%) rename deps/npm/node_modules/{normalize-package-data/node_modules => }/resolve/test/resolver/baz/doom.js (100%) create mode 100644 deps/npm/node_modules/resolve/test/resolver/baz/package.json rename deps/npm/node_modules/{normalize-package-data/node_modules => }/resolve/test/resolver/baz/quux.js (100%) rename deps/npm/node_modules/{normalize-package-data/node_modules => }/resolve/test/resolver/browser_field/a.js (100%) rename deps/npm/node_modules/{normalize-package-data/node_modules => }/resolve/test/resolver/browser_field/b.js (100%) rename deps/npm/node_modules/{normalize-package-data/node_modules => }/resolve/test/resolver/browser_field/package.json (100%) rename deps/npm/node_modules/{normalize-package-data/node_modules/resolve/test/resolver/mug.coffee => resolve/test/resolver/cup.coffee} (100%) rename deps/npm/node_modules/{normalize-package-data/node_modules => }/resolve/test/resolver/dot_main/index.js (100%) rename deps/npm/node_modules/{normalize-package-data/node_modules => }/resolve/test/resolver/dot_main/package.json (100%) rename deps/npm/node_modules/{normalize-package-data/node_modules => }/resolve/test/resolver/dot_slash_main/index.js (100%) rename deps/npm/node_modules/{normalize-package-data/node_modules => }/resolve/test/resolver/dot_slash_main/package.json (100%) rename deps/npm/node_modules/{normalize-package-data/node_modules => }/resolve/test/resolver/foo.js (100%) rename deps/npm/node_modules/{normalize-package-data/node_modules => }/resolve/test/resolver/incorrect_main/index.js (100%) rename deps/npm/node_modules/{normalize-package-data/node_modules => }/resolve/test/resolver/incorrect_main/package.json (100%) rename deps/npm/node_modules/{normalize-package-data/node_modules => }/resolve/test/resolver/invalid_main/package.json (100%) rename deps/npm/node_modules/{normalize-package-data/node_modules/resolve/test/resolver/mug.js => resolve/test/resolver/mug.coffee} (100%) rename deps/npm/node_modules/{normalize-package-data/node_modules/resolve/test/resolver/multirepo/packages/package-b/index.js => resolve/test/resolver/mug.js} (100%) rename deps/npm/node_modules/{normalize-package-data/node_modules => }/resolve/test/resolver/multirepo/lerna.json (100%) rename deps/npm/node_modules/{normalize-package-data/node_modules => }/resolve/test/resolver/multirepo/package.json (100%) rename deps/npm/node_modules/{normalize-package-data/node_modules => }/resolve/test/resolver/multirepo/packages/package-a/index.js (100%) rename deps/npm/node_modules/{normalize-package-data/node_modules => }/resolve/test/resolver/multirepo/packages/package-a/package.json (100%) rename deps/npm/node_modules/{normalize-package-data/node_modules/resolve/test/resolver/other_path/lib/other-lib.js => resolve/test/resolver/multirepo/packages/package-b/index.js} (100%) rename deps/npm/node_modules/{normalize-package-data/node_modules => }/resolve/test/resolver/multirepo/packages/package-b/package.json (100%) create mode 100644 deps/npm/node_modules/resolve/test/resolver/nested_symlinks/mylib/async.js create mode 100644 deps/npm/node_modules/resolve/test/resolver/nested_symlinks/mylib/package.json create mode 100644 deps/npm/node_modules/resolve/test/resolver/nested_symlinks/mylib/sync.js rename deps/npm/node_modules/{normalize-package-data/node_modules/resolve/test/resolver/other_path/root.js => resolve/test/resolver/other_path/lib/other-lib.js} (100%) rename deps/npm/node_modules/{normalize-package-data/node_modules/resolve/test/resolver/symlinked/_/node_modules/foo.js => resolve/test/resolver/other_path/root.js} (100%) rename deps/npm/node_modules/{normalize-package-data/node_modules => }/resolve/test/resolver/quux/foo/index.js (100%) rename deps/npm/node_modules/{normalize-package-data/node_modules => }/resolve/test/resolver/same_names/foo.js (100%) rename deps/npm/node_modules/{normalize-package-data/node_modules => }/resolve/test/resolver/same_names/foo/index.js (100%) rename deps/npm/node_modules/{normalize-package-data/node_modules/resolve/test/resolver/symlinked/_/symlink_target/.gitkeep => resolve/test/resolver/symlinked/_/node_modules/foo.js} (100%) create mode 100644 deps/npm/node_modules/resolve/test/resolver/symlinked/_/symlink_target/.gitkeep create mode 100644 deps/npm/node_modules/resolve/test/resolver/symlinked/package/bar.js create mode 100644 deps/npm/node_modules/resolve/test/resolver/symlinked/package/package.json rename deps/npm/node_modules/{normalize-package-data/node_modules => }/resolve/test/resolver/without_basedir/main.js (100%) rename deps/npm/node_modules/{normalize-package-data/node_modules => }/resolve/test/resolver_sync.js (89%) create mode 100644 deps/npm/node_modules/resolve/test/shadowed_core.js create mode 100644 deps/npm/node_modules/resolve/test/shadowed_core/node_modules/util/index.js rename deps/npm/node_modules/{normalize-package-data/node_modules => }/resolve/test/subdirs.js (100%) create mode 100644 deps/npm/node_modules/resolve/test/symlinks.js delete mode 100644 deps/npm/node_modules/retry/.travis.yml rename deps/npm/node_modules/{promise-retry/node_modules => }/retry/test/runner.js (100%) create mode 100644 deps/npm/node_modules/rimraf/CHANGELOG.md delete mode 100644 deps/npm/node_modules/run-queue/README.md delete mode 100644 deps/npm/node_modules/run-queue/node_modules/aproba/LICENSE delete mode 100644 deps/npm/node_modules/run-queue/node_modules/aproba/README.md delete mode 100644 deps/npm/node_modules/run-queue/node_modules/aproba/index.js delete mode 100644 deps/npm/node_modules/run-queue/node_modules/aproba/package.json delete mode 100644 deps/npm/node_modules/run-queue/package.json delete mode 100644 deps/npm/node_modules/run-queue/queue.js delete mode 100644 deps/npm/node_modules/semver-diff/index.js delete mode 100644 deps/npm/node_modules/semver-diff/license delete mode 100644 deps/npm/node_modules/semver-diff/package.json delete mode 100644 deps/npm/node_modules/semver-diff/readme.md create mode 100755 deps/npm/node_modules/semver/bin/semver.js create mode 100644 deps/npm/node_modules/semver/classes/comparator.js create mode 100644 deps/npm/node_modules/semver/classes/index.js create mode 100644 deps/npm/node_modules/semver/classes/range.js create mode 100644 deps/npm/node_modules/semver/classes/semver.js create mode 100644 deps/npm/node_modules/semver/functions/clean.js create mode 100644 deps/npm/node_modules/semver/functions/cmp.js create mode 100644 deps/npm/node_modules/semver/functions/coerce.js create mode 100644 deps/npm/node_modules/semver/functions/compare-build.js create mode 100644 deps/npm/node_modules/semver/functions/compare-loose.js create mode 100644 deps/npm/node_modules/semver/functions/compare.js create mode 100644 deps/npm/node_modules/semver/functions/diff.js create mode 100644 deps/npm/node_modules/semver/functions/eq.js create mode 100644 deps/npm/node_modules/semver/functions/gt.js create mode 100644 deps/npm/node_modules/semver/functions/gte.js create mode 100644 deps/npm/node_modules/semver/functions/inc.js create mode 100644 deps/npm/node_modules/semver/functions/lt.js create mode 100644 deps/npm/node_modules/semver/functions/lte.js create mode 100644 deps/npm/node_modules/semver/functions/major.js create mode 100644 deps/npm/node_modules/semver/functions/minor.js create mode 100644 deps/npm/node_modules/semver/functions/neq.js create mode 100644 deps/npm/node_modules/semver/functions/parse.js create mode 100644 deps/npm/node_modules/semver/functions/patch.js create mode 100644 deps/npm/node_modules/semver/functions/prerelease.js create mode 100644 deps/npm/node_modules/semver/functions/rcompare.js create mode 100644 deps/npm/node_modules/semver/functions/rsort.js create mode 100644 deps/npm/node_modules/semver/functions/satisfies.js create mode 100644 deps/npm/node_modules/semver/functions/sort.js create mode 100644 deps/npm/node_modules/semver/functions/valid.js create mode 100644 deps/npm/node_modules/semver/index.js create mode 100644 deps/npm/node_modules/semver/internal/constants.js create mode 100644 deps/npm/node_modules/semver/internal/debug.js create mode 100644 deps/npm/node_modules/semver/internal/identifiers.js create mode 100644 deps/npm/node_modules/semver/internal/re.js create mode 100644 deps/npm/node_modules/semver/preload.js create mode 100644 deps/npm/node_modules/semver/ranges/gtr.js create mode 100644 deps/npm/node_modules/semver/ranges/intersects.js create mode 100644 deps/npm/node_modules/semver/ranges/ltr.js create mode 100644 deps/npm/node_modules/semver/ranges/max-satisfying.js create mode 100644 deps/npm/node_modules/semver/ranges/min-satisfying.js create mode 100644 deps/npm/node_modules/semver/ranges/min-version.js create mode 100644 deps/npm/node_modules/semver/ranges/outside.js create mode 100644 deps/npm/node_modules/semver/ranges/simplify.js create mode 100644 deps/npm/node_modules/semver/ranges/subset.js create mode 100644 deps/npm/node_modules/semver/ranges/to-comparators.js create mode 100644 deps/npm/node_modules/semver/ranges/valid.js delete mode 100644 deps/npm/node_modules/sha/LICENSE delete mode 100644 deps/npm/node_modules/sha/README.md delete mode 100644 deps/npm/node_modules/sha/index.js delete mode 100644 deps/npm/node_modules/sha/package.json delete mode 100644 deps/npm/node_modules/shebang-command/index.js delete mode 100644 deps/npm/node_modules/shebang-command/license delete mode 100644 deps/npm/node_modules/shebang-command/package.json delete mode 100644 deps/npm/node_modules/shebang-command/readme.md delete mode 100644 deps/npm/node_modules/shebang-regex/index.js delete mode 100644 deps/npm/node_modules/shebang-regex/license delete mode 100644 deps/npm/node_modules/shebang-regex/package.json delete mode 100644 deps/npm/node_modules/shebang-regex/readme.md delete mode 100644 deps/npm/node_modules/slide/README.md delete mode 100644 deps/npm/node_modules/slide/index.js delete mode 100644 deps/npm/node_modules/slide/lib/async-map-ordered.js delete mode 100644 deps/npm/node_modules/slide/lib/async-map.js delete mode 100644 deps/npm/node_modules/slide/lib/bind-actor.js delete mode 100644 deps/npm/node_modules/slide/lib/chain.js delete mode 100644 deps/npm/node_modules/slide/lib/slide.js delete mode 100644 deps/npm/node_modules/slide/package.json delete mode 100644 deps/npm/node_modules/socks-proxy-agent/.travis.yml delete mode 100644 deps/npm/node_modules/socks-proxy-agent/History.md create mode 100644 deps/npm/node_modules/socks-proxy-agent/dist/agent.d.ts create mode 100644 deps/npm/node_modules/socks-proxy-agent/dist/agent.js create mode 100644 deps/npm/node_modules/socks-proxy-agent/dist/agent.js.map create mode 100644 deps/npm/node_modules/socks-proxy-agent/dist/index.d.ts create mode 100644 deps/npm/node_modules/socks-proxy-agent/dist/index.js create mode 100644 deps/npm/node_modules/socks-proxy-agent/dist/index.js.map delete mode 100644 deps/npm/node_modules/socks-proxy-agent/index.js delete mode 100644 deps/npm/node_modules/socks-proxy-agent/node_modules/agent-base/.travis.yml delete mode 100644 deps/npm/node_modules/socks-proxy-agent/node_modules/agent-base/History.md delete mode 100644 deps/npm/node_modules/socks-proxy-agent/node_modules/agent-base/README.md delete mode 100644 deps/npm/node_modules/socks-proxy-agent/node_modules/agent-base/index.js delete mode 100644 deps/npm/node_modules/socks-proxy-agent/node_modules/agent-base/package.json delete mode 100644 deps/npm/node_modules/socks-proxy-agent/node_modules/agent-base/patch-core.js delete mode 100644 deps/npm/node_modules/socks-proxy-agent/node_modules/agent-base/test/ssl-cert-snakeoil.key delete mode 100644 deps/npm/node_modules/socks-proxy-agent/node_modules/agent-base/test/ssl-cert-snakeoil.pem delete mode 100644 deps/npm/node_modules/socks-proxy-agent/node_modules/agent-base/test/test.js delete mode 100644 deps/npm/node_modules/socks-proxy-agent/test/ssl-cert-snakeoil.key delete mode 100644 deps/npm/node_modules/socks-proxy-agent/test/ssl-cert-snakeoil.pem delete mode 100644 deps/npm/node_modules/socks-proxy-agent/test/test.js delete mode 100644 deps/npm/node_modules/socks-proxy-agent/yarn.lock delete mode 100644 deps/npm/node_modules/sorted-union-stream/.npmignore delete mode 100644 deps/npm/node_modules/sorted-union-stream/.travis.yml delete mode 100644 deps/npm/node_modules/sorted-union-stream/LICENSE delete mode 100644 deps/npm/node_modules/sorted-union-stream/README.md delete mode 100644 deps/npm/node_modules/sorted-union-stream/example.js delete mode 100644 deps/npm/node_modules/sorted-union-stream/index.js delete mode 100644 deps/npm/node_modules/sorted-union-stream/node_modules/from2/LICENSE.md delete mode 100644 deps/npm/node_modules/sorted-union-stream/node_modules/from2/README.md delete mode 100644 deps/npm/node_modules/sorted-union-stream/node_modules/from2/index.js delete mode 100644 deps/npm/node_modules/sorted-union-stream/node_modules/from2/package.json delete mode 100644 deps/npm/node_modules/sorted-union-stream/node_modules/from2/test.js delete mode 100644 deps/npm/node_modules/sorted-union-stream/node_modules/isarray/README.md delete mode 100644 deps/npm/node_modules/sorted-union-stream/node_modules/isarray/build/build.js delete mode 100644 deps/npm/node_modules/sorted-union-stream/node_modules/isarray/component.json delete mode 100644 deps/npm/node_modules/sorted-union-stream/node_modules/isarray/index.js delete mode 100644 deps/npm/node_modules/sorted-union-stream/node_modules/isarray/package.json delete mode 100644 deps/npm/node_modules/sorted-union-stream/node_modules/readable-stream/.npmignore delete mode 100644 deps/npm/node_modules/sorted-union-stream/node_modules/readable-stream/LICENSE delete mode 100644 deps/npm/node_modules/sorted-union-stream/node_modules/readable-stream/README.md delete mode 100644 deps/npm/node_modules/sorted-union-stream/node_modules/readable-stream/duplex.js delete mode 100644 deps/npm/node_modules/sorted-union-stream/node_modules/readable-stream/float.patch delete mode 100644 deps/npm/node_modules/sorted-union-stream/node_modules/readable-stream/lib/_stream_duplex.js delete mode 100644 deps/npm/node_modules/sorted-union-stream/node_modules/readable-stream/lib/_stream_passthrough.js delete mode 100644 deps/npm/node_modules/sorted-union-stream/node_modules/readable-stream/lib/_stream_readable.js delete mode 100644 deps/npm/node_modules/sorted-union-stream/node_modules/readable-stream/lib/_stream_transform.js delete mode 100644 deps/npm/node_modules/sorted-union-stream/node_modules/readable-stream/lib/_stream_writable.js delete mode 100644 deps/npm/node_modules/sorted-union-stream/node_modules/readable-stream/package.json delete mode 100644 deps/npm/node_modules/sorted-union-stream/node_modules/readable-stream/passthrough.js delete mode 100644 deps/npm/node_modules/sorted-union-stream/node_modules/readable-stream/readable.js delete mode 100644 deps/npm/node_modules/sorted-union-stream/node_modules/readable-stream/transform.js delete mode 100644 deps/npm/node_modules/sorted-union-stream/node_modules/readable-stream/writable.js delete mode 100644 deps/npm/node_modules/sorted-union-stream/node_modules/string_decoder/.npmignore delete mode 100644 deps/npm/node_modules/sorted-union-stream/node_modules/string_decoder/LICENSE delete mode 100644 deps/npm/node_modules/sorted-union-stream/node_modules/string_decoder/README.md delete mode 100644 deps/npm/node_modules/sorted-union-stream/node_modules/string_decoder/index.js delete mode 100644 deps/npm/node_modules/sorted-union-stream/node_modules/string_decoder/package.json delete mode 100644 deps/npm/node_modules/sorted-union-stream/package.json delete mode 100644 deps/npm/node_modules/sorted-union-stream/test.js delete mode 100644 deps/npm/node_modules/split-on-first/index.d.ts delete mode 100644 deps/npm/node_modules/split-on-first/index.js delete mode 100644 deps/npm/node_modules/split-on-first/license delete mode 100644 deps/npm/node_modules/split-on-first/package.json delete mode 100644 deps/npm/node_modules/split-on-first/readme.md create mode 100644 deps/npm/node_modules/sshpk/lib/formats/putty.js delete mode 100644 deps/npm/node_modules/stream-each/.npmignore delete mode 100644 deps/npm/node_modules/stream-each/.travis.yml delete mode 100644 deps/npm/node_modules/stream-each/LICENSE delete mode 100644 deps/npm/node_modules/stream-each/README.md delete mode 100644 deps/npm/node_modules/stream-each/collaborators.md delete mode 100644 deps/npm/node_modules/stream-each/index.js delete mode 100644 deps/npm/node_modules/stream-each/package.json delete mode 100644 deps/npm/node_modules/stream-each/test.js delete mode 100644 deps/npm/node_modules/stream-iterate/.npmignore delete mode 100644 deps/npm/node_modules/stream-iterate/.travis.yml delete mode 100644 deps/npm/node_modules/stream-iterate/LICENSE delete mode 100644 deps/npm/node_modules/stream-iterate/README.md delete mode 100644 deps/npm/node_modules/stream-iterate/index.js delete mode 100644 deps/npm/node_modules/stream-iterate/node_modules/readable-stream/.travis.yml delete mode 100644 deps/npm/node_modules/stream-iterate/node_modules/readable-stream/GOVERNANCE.md delete mode 100644 deps/npm/node_modules/stream-iterate/node_modules/readable-stream/LICENSE delete mode 100644 deps/npm/node_modules/stream-iterate/node_modules/readable-stream/README.md delete mode 100644 deps/npm/node_modules/stream-iterate/node_modules/readable-stream/doc/wg-meetings/2015-01-30.md delete mode 100644 deps/npm/node_modules/stream-iterate/node_modules/readable-stream/duplex-browser.js delete mode 100644 deps/npm/node_modules/stream-iterate/node_modules/readable-stream/duplex.js delete mode 100644 deps/npm/node_modules/stream-iterate/node_modules/readable-stream/lib/_stream_duplex.js delete mode 100644 deps/npm/node_modules/stream-iterate/node_modules/readable-stream/lib/_stream_passthrough.js delete mode 100644 deps/npm/node_modules/stream-iterate/node_modules/readable-stream/lib/_stream_readable.js delete mode 100644 deps/npm/node_modules/stream-iterate/node_modules/readable-stream/lib/_stream_transform.js delete mode 100644 deps/npm/node_modules/stream-iterate/node_modules/readable-stream/lib/_stream_writable.js delete mode 100644 deps/npm/node_modules/stream-iterate/node_modules/readable-stream/lib/internal/streams/BufferList.js delete mode 100644 deps/npm/node_modules/stream-iterate/node_modules/readable-stream/lib/internal/streams/destroy.js delete mode 100644 deps/npm/node_modules/stream-iterate/node_modules/readable-stream/lib/internal/streams/stream-browser.js delete mode 100644 deps/npm/node_modules/stream-iterate/node_modules/readable-stream/lib/internal/streams/stream.js delete mode 100644 deps/npm/node_modules/stream-iterate/node_modules/readable-stream/package.json delete mode 100644 deps/npm/node_modules/stream-iterate/node_modules/readable-stream/passthrough.js delete mode 100644 deps/npm/node_modules/stream-iterate/node_modules/readable-stream/readable-browser.js delete mode 100644 deps/npm/node_modules/stream-iterate/node_modules/readable-stream/readable.js delete mode 100644 deps/npm/node_modules/stream-iterate/node_modules/readable-stream/transform.js delete mode 100644 deps/npm/node_modules/stream-iterate/node_modules/readable-stream/writable-browser.js delete mode 100644 deps/npm/node_modules/stream-iterate/node_modules/readable-stream/writable.js delete mode 100644 deps/npm/node_modules/stream-iterate/node_modules/string_decoder/.travis.yml delete mode 100644 deps/npm/node_modules/stream-iterate/node_modules/string_decoder/LICENSE delete mode 100644 deps/npm/node_modules/stream-iterate/node_modules/string_decoder/README.md delete mode 100644 deps/npm/node_modules/stream-iterate/node_modules/string_decoder/lib/string_decoder.js delete mode 100644 deps/npm/node_modules/stream-iterate/node_modules/string_decoder/package.json delete mode 100644 deps/npm/node_modules/stream-iterate/package.json delete mode 100644 deps/npm/node_modules/stream-iterate/test.js delete mode 100644 deps/npm/node_modules/stream-shift/.npmignore delete mode 100644 deps/npm/node_modules/stream-shift/.travis.yml delete mode 100644 deps/npm/node_modules/stream-shift/LICENSE delete mode 100644 deps/npm/node_modules/stream-shift/README.md delete mode 100644 deps/npm/node_modules/stream-shift/index.js delete mode 100644 deps/npm/node_modules/stream-shift/package.json delete mode 100644 deps/npm/node_modules/stream-shift/test.js delete mode 100644 deps/npm/node_modules/strict-uri-encode/index.js delete mode 100644 deps/npm/node_modules/strict-uri-encode/license delete mode 100644 deps/npm/node_modules/strict-uri-encode/package.json delete mode 100644 deps/npm/node_modules/strict-uri-encode/readme.md delete mode 100644 deps/npm/node_modules/string-width/node_modules/is-fullwidth-code-point/index.js delete mode 100644 deps/npm/node_modules/string-width/node_modules/is-fullwidth-code-point/license delete mode 100644 deps/npm/node_modules/string-width/node_modules/is-fullwidth-code-point/package.json delete mode 100644 deps/npm/node_modules/string-width/node_modules/is-fullwidth-code-point/readme.md rename deps/npm/node_modules/{are-we-there-yet/node_modules => }/string_decoder/.travis.yml (100%) delete mode 100644 deps/npm/node_modules/string_decoder/node_modules/safe-buffer/LICENSE delete mode 100644 deps/npm/node_modules/string_decoder/node_modules/safe-buffer/README.md delete mode 100644 deps/npm/node_modules/string_decoder/node_modules/safe-buffer/index.d.ts delete mode 100644 deps/npm/node_modules/string_decoder/node_modules/safe-buffer/index.js delete mode 100644 deps/npm/node_modules/string_decoder/node_modules/safe-buffer/package.json delete mode 100644 deps/npm/node_modules/strip-eof/index.js delete mode 100644 deps/npm/node_modules/strip-eof/license delete mode 100644 deps/npm/node_modules/strip-eof/package.json delete mode 100644 deps/npm/node_modules/strip-eof/readme.md delete mode 100644 deps/npm/node_modules/strip-json-comments/index.js delete mode 100644 deps/npm/node_modules/strip-json-comments/license delete mode 100644 deps/npm/node_modules/strip-json-comments/package.json delete mode 100644 deps/npm/node_modules/strip-json-comments/readme.md create mode 100644 deps/npm/node_modules/tar/CHANGELOG.md delete mode 100644 deps/npm/node_modules/tar/lib/buffer.js create mode 100644 deps/npm/node_modules/tar/lib/get-write-flag.js create mode 100644 deps/npm/node_modules/tar/lib/path-reservations.js delete mode 100644 deps/npm/node_modules/tar/node_modules/minipass/LICENSE delete mode 100644 deps/npm/node_modules/tar/node_modules/minipass/README.md delete mode 100644 deps/npm/node_modules/tar/node_modules/minipass/index.js delete mode 100644 deps/npm/node_modules/tar/node_modules/minipass/package.json delete mode 100644 deps/npm/node_modules/term-size/index.js delete mode 100644 deps/npm/node_modules/term-size/license delete mode 100644 deps/npm/node_modules/term-size/package.json delete mode 100644 deps/npm/node_modules/term-size/readme.md delete mode 100755 deps/npm/node_modules/term-size/vendor/macos/term-size delete mode 100644 deps/npm/node_modules/term-size/vendor/windows/term-size.exe delete mode 100644 deps/npm/node_modules/through/.travis.yml delete mode 100644 deps/npm/node_modules/through/LICENSE.APACHE2 delete mode 100644 deps/npm/node_modules/through/LICENSE.MIT delete mode 100644 deps/npm/node_modules/through/index.js delete mode 100644 deps/npm/node_modules/through/package.json delete mode 100644 deps/npm/node_modules/through/readme.markdown delete mode 100644 deps/npm/node_modules/through/test/async.js delete mode 100644 deps/npm/node_modules/through/test/auto-destroy.js delete mode 100644 deps/npm/node_modules/through/test/buffering.js delete mode 100644 deps/npm/node_modules/through/test/end.js delete mode 100644 deps/npm/node_modules/through/test/index.js delete mode 100644 deps/npm/node_modules/through2/.npmignore delete mode 100644 deps/npm/node_modules/through2/LICENSE.html delete mode 100644 deps/npm/node_modules/through2/LICENSE.md delete mode 100644 deps/npm/node_modules/through2/README.md delete mode 100644 deps/npm/node_modules/through2/node_modules/readable-stream/.travis.yml delete mode 100644 deps/npm/node_modules/through2/node_modules/readable-stream/GOVERNANCE.md delete mode 100644 deps/npm/node_modules/through2/node_modules/readable-stream/LICENSE delete mode 100644 deps/npm/node_modules/through2/node_modules/readable-stream/README.md delete mode 100644 deps/npm/node_modules/through2/node_modules/readable-stream/doc/wg-meetings/2015-01-30.md delete mode 100644 deps/npm/node_modules/through2/node_modules/readable-stream/duplex-browser.js delete mode 100644 deps/npm/node_modules/through2/node_modules/readable-stream/duplex.js delete mode 100644 deps/npm/node_modules/through2/node_modules/readable-stream/lib/_stream_duplex.js delete mode 100644 deps/npm/node_modules/through2/node_modules/readable-stream/lib/_stream_passthrough.js delete mode 100644 deps/npm/node_modules/through2/node_modules/readable-stream/lib/_stream_readable.js delete mode 100644 deps/npm/node_modules/through2/node_modules/readable-stream/lib/_stream_transform.js delete mode 100644 deps/npm/node_modules/through2/node_modules/readable-stream/lib/_stream_writable.js delete mode 100644 deps/npm/node_modules/through2/node_modules/readable-stream/lib/internal/streams/BufferList.js delete mode 100644 deps/npm/node_modules/through2/node_modules/readable-stream/lib/internal/streams/destroy.js delete mode 100644 deps/npm/node_modules/through2/node_modules/readable-stream/lib/internal/streams/stream-browser.js delete mode 100644 deps/npm/node_modules/through2/node_modules/readable-stream/lib/internal/streams/stream.js delete mode 100644 deps/npm/node_modules/through2/node_modules/readable-stream/package.json delete mode 100644 deps/npm/node_modules/through2/node_modules/readable-stream/passthrough.js delete mode 100644 deps/npm/node_modules/through2/node_modules/readable-stream/readable-browser.js delete mode 100644 deps/npm/node_modules/through2/node_modules/readable-stream/readable.js delete mode 100644 deps/npm/node_modules/through2/node_modules/readable-stream/transform.js delete mode 100644 deps/npm/node_modules/through2/node_modules/readable-stream/writable-browser.js delete mode 100644 deps/npm/node_modules/through2/node_modules/readable-stream/writable.js delete mode 100644 deps/npm/node_modules/through2/node_modules/string_decoder/.travis.yml delete mode 100644 deps/npm/node_modules/through2/node_modules/string_decoder/LICENSE delete mode 100644 deps/npm/node_modules/through2/node_modules/string_decoder/README.md delete mode 100644 deps/npm/node_modules/through2/node_modules/string_decoder/lib/string_decoder.js delete mode 100644 deps/npm/node_modules/through2/node_modules/string_decoder/package.json delete mode 100644 deps/npm/node_modules/through2/package.json delete mode 100644 deps/npm/node_modules/through2/through2.js delete mode 100644 deps/npm/node_modules/timed-out/index.js delete mode 100644 deps/npm/node_modules/timed-out/license delete mode 100644 deps/npm/node_modules/timed-out/package.json delete mode 100644 deps/npm/node_modules/timed-out/readme.md create mode 100644 deps/npm/node_modules/tough-cookie/lib/version.js rename deps/npm/node_modules/{pacote/node_modules/minipass => treeverse}/LICENSE (100%) create mode 100644 deps/npm/node_modules/treeverse/README.md create mode 100644 deps/npm/node_modules/treeverse/index.js create mode 100644 deps/npm/node_modules/treeverse/lib/breadth.js create mode 100644 deps/npm/node_modules/treeverse/lib/depth-descent.js create mode 100644 deps/npm/node_modules/treeverse/lib/depth.js create mode 100644 deps/npm/node_modules/treeverse/package.json create mode 100644 deps/npm/node_modules/typedarray-to-buffer/.airtap.yml create mode 100644 deps/npm/node_modules/typedarray-to-buffer/.travis.yml rename deps/npm/node_modules/{npm-registry-fetch/node_modules/safe-buffer => typedarray-to-buffer}/LICENSE (100%) create mode 100644 deps/npm/node_modules/typedarray-to-buffer/README.md create mode 100644 deps/npm/node_modules/typedarray-to-buffer/index.js create mode 100644 deps/npm/node_modules/typedarray-to-buffer/package.json create mode 100644 deps/npm/node_modules/typedarray-to-buffer/test/basic.js delete mode 100644 deps/npm/node_modules/typedarray/.travis.yml delete mode 100644 deps/npm/node_modules/typedarray/LICENSE delete mode 100644 deps/npm/node_modules/typedarray/example/tarray.js delete mode 100644 deps/npm/node_modules/typedarray/index.js delete mode 100644 deps/npm/node_modules/typedarray/package.json delete mode 100644 deps/npm/node_modules/typedarray/readme.markdown delete mode 100644 deps/npm/node_modules/typedarray/test/server/undef_globals.js delete mode 100644 deps/npm/node_modules/typedarray/test/tarray.js delete mode 100644 deps/npm/node_modules/uid-number/README.md delete mode 100755 deps/npm/node_modules/uid-number/get-uid-gid.js delete mode 100644 deps/npm/node_modules/uid-number/package.json delete mode 100644 deps/npm/node_modules/uid-number/uid-number.js delete mode 100644 deps/npm/node_modules/umask/.npmignore delete mode 100644 deps/npm/node_modules/umask/ChangeLog delete mode 100644 deps/npm/node_modules/umask/LICENSE delete mode 100644 deps/npm/node_modules/umask/README.md delete mode 100644 deps/npm/node_modules/umask/index.js delete mode 100644 deps/npm/node_modules/umask/package.json delete mode 100644 deps/npm/node_modules/umask/test/simple.js delete mode 100644 deps/npm/node_modules/unique-slug/.npmignore rename deps/npm/node_modules/{find-npm-prefix => unique-slug}/LICENSE (100%) delete mode 100644 deps/npm/node_modules/unique-string/index.js delete mode 100644 deps/npm/node_modules/unique-string/license delete mode 100644 deps/npm/node_modules/unique-string/package.json delete mode 100644 deps/npm/node_modules/unique-string/readme.md delete mode 100644 deps/npm/node_modules/unpipe/HISTORY.md delete mode 100644 deps/npm/node_modules/unpipe/LICENSE delete mode 100644 deps/npm/node_modules/unpipe/README.md delete mode 100644 deps/npm/node_modules/unpipe/index.js delete mode 100644 deps/npm/node_modules/unpipe/package.json delete mode 100644 deps/npm/node_modules/unzip-response/index.js delete mode 100644 deps/npm/node_modules/unzip-response/license delete mode 100644 deps/npm/node_modules/unzip-response/package.json delete mode 100644 deps/npm/node_modules/unzip-response/readme.md delete mode 100644 deps/npm/node_modules/update-notifier/check.js delete mode 100644 deps/npm/node_modules/update-notifier/index.js delete mode 100644 deps/npm/node_modules/update-notifier/license delete mode 100644 deps/npm/node_modules/update-notifier/package.json delete mode 100644 deps/npm/node_modules/update-notifier/readme.md create mode 100755 deps/npm/node_modules/uri-js/LICENSE create mode 100755 deps/npm/node_modules/uri-js/README.md create mode 100755 deps/npm/node_modules/uri-js/dist/es5/uri.all.d.ts create mode 100755 deps/npm/node_modules/uri-js/dist/es5/uri.all.js create mode 100755 deps/npm/node_modules/uri-js/dist/es5/uri.all.js.map create mode 100755 deps/npm/node_modules/uri-js/dist/es5/uri.all.min.d.ts create mode 100755 deps/npm/node_modules/uri-js/dist/es5/uri.all.min.js create mode 100755 deps/npm/node_modules/uri-js/dist/es5/uri.all.min.js.map create mode 100755 deps/npm/node_modules/uri-js/dist/esnext/index.d.ts create mode 100755 deps/npm/node_modules/uri-js/dist/esnext/index.js create mode 100755 deps/npm/node_modules/uri-js/dist/esnext/index.js.map create mode 100755 deps/npm/node_modules/uri-js/dist/esnext/regexps-iri.d.ts create mode 100755 deps/npm/node_modules/uri-js/dist/esnext/regexps-iri.js create mode 100755 deps/npm/node_modules/uri-js/dist/esnext/regexps-iri.js.map create mode 100755 deps/npm/node_modules/uri-js/dist/esnext/regexps-uri.d.ts create mode 100755 deps/npm/node_modules/uri-js/dist/esnext/regexps-uri.js create mode 100755 deps/npm/node_modules/uri-js/dist/esnext/regexps-uri.js.map create mode 100755 deps/npm/node_modules/uri-js/dist/esnext/schemes/http.d.ts create mode 100755 deps/npm/node_modules/uri-js/dist/esnext/schemes/http.js create mode 100755 deps/npm/node_modules/uri-js/dist/esnext/schemes/http.js.map create mode 100755 deps/npm/node_modules/uri-js/dist/esnext/schemes/https.d.ts create mode 100755 deps/npm/node_modules/uri-js/dist/esnext/schemes/https.js create mode 100755 deps/npm/node_modules/uri-js/dist/esnext/schemes/https.js.map create mode 100755 deps/npm/node_modules/uri-js/dist/esnext/schemes/mailto.d.ts create mode 100755 deps/npm/node_modules/uri-js/dist/esnext/schemes/mailto.js create mode 100755 deps/npm/node_modules/uri-js/dist/esnext/schemes/mailto.js.map create mode 100755 deps/npm/node_modules/uri-js/dist/esnext/schemes/urn-uuid.d.ts create mode 100755 deps/npm/node_modules/uri-js/dist/esnext/schemes/urn-uuid.js create mode 100755 deps/npm/node_modules/uri-js/dist/esnext/schemes/urn-uuid.js.map create mode 100755 deps/npm/node_modules/uri-js/dist/esnext/schemes/urn.d.ts create mode 100755 deps/npm/node_modules/uri-js/dist/esnext/schemes/urn.js create mode 100755 deps/npm/node_modules/uri-js/dist/esnext/schemes/urn.js.map create mode 100755 deps/npm/node_modules/uri-js/dist/esnext/schemes/ws.d.ts create mode 100755 deps/npm/node_modules/uri-js/dist/esnext/schemes/ws.js create mode 100755 deps/npm/node_modules/uri-js/dist/esnext/schemes/ws.js.map create mode 100755 deps/npm/node_modules/uri-js/dist/esnext/schemes/wss.d.ts create mode 100755 deps/npm/node_modules/uri-js/dist/esnext/schemes/wss.js create mode 100755 deps/npm/node_modules/uri-js/dist/esnext/schemes/wss.js.map create mode 100755 deps/npm/node_modules/uri-js/dist/esnext/uri.d.ts create mode 100755 deps/npm/node_modules/uri-js/dist/esnext/uri.js create mode 100755 deps/npm/node_modules/uri-js/dist/esnext/uri.js.map create mode 100755 deps/npm/node_modules/uri-js/dist/esnext/util.d.ts create mode 100755 deps/npm/node_modules/uri-js/dist/esnext/util.js create mode 100755 deps/npm/node_modules/uri-js/dist/esnext/util.js.map create mode 100755 deps/npm/node_modules/uri-js/package.json create mode 100755 deps/npm/node_modules/uri-js/yarn.lock delete mode 100644 deps/npm/node_modules/url-parse-lax/index.js delete mode 100644 deps/npm/node_modules/url-parse-lax/license delete mode 100644 deps/npm/node_modules/url-parse-lax/package.json delete mode 100644 deps/npm/node_modules/url-parse-lax/readme.md delete mode 100644 deps/npm/node_modules/util-extend/LICENSE delete mode 100644 deps/npm/node_modules/util-extend/README.md delete mode 100644 deps/npm/node_modules/util-extend/extend.js delete mode 100644 deps/npm/node_modules/util-extend/package.json delete mode 100644 deps/npm/node_modules/util-extend/test.js delete mode 100644 deps/npm/node_modules/util-promisify/.npmignore delete mode 100644 deps/npm/node_modules/util-promisify/.travis.yml delete mode 100644 deps/npm/node_modules/util-promisify/LICENSE delete mode 100644 deps/npm/node_modules/util-promisify/README.md delete mode 100644 deps/npm/node_modules/util-promisify/index.js delete mode 100644 deps/npm/node_modules/util-promisify/package.json delete mode 100644 deps/npm/node_modules/util-promisify/test/common.js delete mode 100644 deps/npm/node_modules/util-promisify/test/index.js delete mode 100644 deps/npm/node_modules/util-promisify/test/timers.js create mode 100644 deps/npm/node_modules/uuid/CONTRIBUTING.md create mode 100755 deps/npm/node_modules/uuid/dist/bin/uuid create mode 100644 deps/npm/node_modules/uuid/dist/esm-browser/index.js create mode 100644 deps/npm/node_modules/uuid/dist/esm-browser/md5.js create mode 100644 deps/npm/node_modules/uuid/dist/esm-browser/nil.js create mode 100644 deps/npm/node_modules/uuid/dist/esm-browser/parse.js create mode 100644 deps/npm/node_modules/uuid/dist/esm-browser/regex.js create mode 100644 deps/npm/node_modules/uuid/dist/esm-browser/rng.js create mode 100644 deps/npm/node_modules/uuid/dist/esm-browser/sha1.js create mode 100644 deps/npm/node_modules/uuid/dist/esm-browser/stringify.js create mode 100644 deps/npm/node_modules/uuid/dist/esm-browser/v1.js create mode 100644 deps/npm/node_modules/uuid/dist/esm-browser/v3.js create mode 100644 deps/npm/node_modules/uuid/dist/esm-browser/v35.js create mode 100644 deps/npm/node_modules/uuid/dist/esm-browser/v4.js create mode 100644 deps/npm/node_modules/uuid/dist/esm-browser/v5.js create mode 100644 deps/npm/node_modules/uuid/dist/esm-browser/validate.js create mode 100644 deps/npm/node_modules/uuid/dist/esm-browser/version.js create mode 100644 deps/npm/node_modules/uuid/dist/esm-node/index.js create mode 100644 deps/npm/node_modules/uuid/dist/esm-node/md5.js create mode 100644 deps/npm/node_modules/uuid/dist/esm-node/nil.js create mode 100644 deps/npm/node_modules/uuid/dist/esm-node/parse.js create mode 100644 deps/npm/node_modules/uuid/dist/esm-node/regex.js create mode 100644 deps/npm/node_modules/uuid/dist/esm-node/rng.js create mode 100644 deps/npm/node_modules/uuid/dist/esm-node/sha1.js create mode 100644 deps/npm/node_modules/uuid/dist/esm-node/stringify.js create mode 100644 deps/npm/node_modules/uuid/dist/esm-node/v1.js create mode 100644 deps/npm/node_modules/uuid/dist/esm-node/v3.js create mode 100644 deps/npm/node_modules/uuid/dist/esm-node/v35.js create mode 100644 deps/npm/node_modules/uuid/dist/esm-node/v4.js create mode 100644 deps/npm/node_modules/uuid/dist/esm-node/v5.js create mode 100644 deps/npm/node_modules/uuid/dist/esm-node/validate.js create mode 100644 deps/npm/node_modules/uuid/dist/esm-node/version.js create mode 100644 deps/npm/node_modules/uuid/dist/index.js create mode 100644 deps/npm/node_modules/uuid/dist/md5-browser.js create mode 100644 deps/npm/node_modules/uuid/dist/md5.js create mode 100644 deps/npm/node_modules/uuid/dist/nil.js create mode 100644 deps/npm/node_modules/uuid/dist/parse.js create mode 100644 deps/npm/node_modules/uuid/dist/regex.js create mode 100644 deps/npm/node_modules/uuid/dist/rng-browser.js create mode 100644 deps/npm/node_modules/uuid/dist/rng.js create mode 100644 deps/npm/node_modules/uuid/dist/sha1-browser.js create mode 100644 deps/npm/node_modules/uuid/dist/sha1.js create mode 100644 deps/npm/node_modules/uuid/dist/stringify.js create mode 100644 deps/npm/node_modules/uuid/dist/umd/uuid.min.js create mode 100644 deps/npm/node_modules/uuid/dist/umd/uuidNIL.min.js create mode 100644 deps/npm/node_modules/uuid/dist/umd/uuidParse.min.js create mode 100644 deps/npm/node_modules/uuid/dist/umd/uuidStringify.min.js create mode 100644 deps/npm/node_modules/uuid/dist/umd/uuidValidate.min.js create mode 100644 deps/npm/node_modules/uuid/dist/umd/uuidVersion.min.js create mode 100644 deps/npm/node_modules/uuid/dist/umd/uuidv1.min.js create mode 100644 deps/npm/node_modules/uuid/dist/umd/uuidv3.min.js create mode 100644 deps/npm/node_modules/uuid/dist/umd/uuidv4.min.js create mode 100644 deps/npm/node_modules/uuid/dist/umd/uuidv5.min.js create mode 100644 deps/npm/node_modules/uuid/dist/uuid-bin.js create mode 100644 deps/npm/node_modules/uuid/dist/v1.js create mode 100644 deps/npm/node_modules/uuid/dist/v3.js create mode 100644 deps/npm/node_modules/uuid/dist/v35.js create mode 100644 deps/npm/node_modules/uuid/dist/v4.js create mode 100644 deps/npm/node_modules/uuid/dist/v5.js create mode 100644 deps/npm/node_modules/uuid/dist/validate.js create mode 100644 deps/npm/node_modules/uuid/dist/version.js delete mode 100644 deps/npm/node_modules/uuid/lib/bytesToUuid.js delete mode 100644 deps/npm/node_modules/uuid/v1.js create mode 100644 deps/npm/node_modules/uuid/wrapper.mjs create mode 100644 deps/npm/node_modules/verror/CONTRIBUTING.md create mode 100644 deps/npm/node_modules/walk-up-path/LICENSE create mode 100644 deps/npm/node_modules/walk-up-path/README.md create mode 100644 deps/npm/node_modules/walk-up-path/index.js create mode 100644 deps/npm/node_modules/walk-up-path/package.json delete mode 100644 deps/npm/node_modules/which-module/CHANGELOG.md delete mode 100644 deps/npm/node_modules/which-module/LICENSE delete mode 100644 deps/npm/node_modules/which-module/README.md delete mode 100644 deps/npm/node_modules/which-module/index.js delete mode 100644 deps/npm/node_modules/which-module/package.json rename deps/npm/node_modules/which/bin/{which => node-which} (100%) delete mode 100644 deps/npm/node_modules/wide-align/node_modules/string-width/index.js delete mode 100644 deps/npm/node_modules/wide-align/node_modules/string-width/license delete mode 100644 deps/npm/node_modules/wide-align/node_modules/string-width/package.json delete mode 100644 deps/npm/node_modules/wide-align/node_modules/string-width/readme.md delete mode 100644 deps/npm/node_modules/widest-line/index.js delete mode 100644 deps/npm/node_modules/widest-line/license delete mode 100644 deps/npm/node_modules/widest-line/package.json delete mode 100644 deps/npm/node_modules/widest-line/readme.md delete mode 100644 deps/npm/node_modules/worker-farm/.editorconfig delete mode 100644 deps/npm/node_modules/worker-farm/.travis.yml delete mode 100644 deps/npm/node_modules/worker-farm/LICENSE.md delete mode 100644 deps/npm/node_modules/worker-farm/README.md delete mode 100644 deps/npm/node_modules/worker-farm/examples/basic/child.js delete mode 100644 deps/npm/node_modules/worker-farm/examples/basic/index.js delete mode 100644 deps/npm/node_modules/worker-farm/examples/pi/calc.js delete mode 100644 deps/npm/node_modules/worker-farm/examples/pi/index.js delete mode 100644 deps/npm/node_modules/worker-farm/index.d.ts delete mode 100644 deps/npm/node_modules/worker-farm/lib/child/index.js delete mode 100644 deps/npm/node_modules/worker-farm/lib/farm.js delete mode 100644 deps/npm/node_modules/worker-farm/lib/fork.js delete mode 100644 deps/npm/node_modules/worker-farm/lib/index.js delete mode 100644 deps/npm/node_modules/worker-farm/package.json delete mode 100644 deps/npm/node_modules/worker-farm/tests/child.js delete mode 100644 deps/npm/node_modules/worker-farm/tests/debug.js delete mode 100644 deps/npm/node_modules/worker-farm/tests/index.js delete mode 100755 deps/npm/node_modules/wrap-ansi/index.js delete mode 100644 deps/npm/node_modules/wrap-ansi/license delete mode 100644 deps/npm/node_modules/wrap-ansi/node_modules/ansi-regex/index.js delete mode 100644 deps/npm/node_modules/wrap-ansi/node_modules/ansi-regex/license delete mode 100644 deps/npm/node_modules/wrap-ansi/node_modules/ansi-regex/package.json delete mode 100644 deps/npm/node_modules/wrap-ansi/node_modules/ansi-regex/readme.md delete mode 100644 deps/npm/node_modules/wrap-ansi/node_modules/is-fullwidth-code-point/index.js delete mode 100644 deps/npm/node_modules/wrap-ansi/node_modules/is-fullwidth-code-point/license delete mode 100644 deps/npm/node_modules/wrap-ansi/node_modules/is-fullwidth-code-point/package.json delete mode 100644 deps/npm/node_modules/wrap-ansi/node_modules/is-fullwidth-code-point/readme.md delete mode 100644 deps/npm/node_modules/wrap-ansi/node_modules/string-width/index.js delete mode 100644 deps/npm/node_modules/wrap-ansi/node_modules/string-width/license delete mode 100644 deps/npm/node_modules/wrap-ansi/node_modules/string-width/package.json delete mode 100644 deps/npm/node_modules/wrap-ansi/node_modules/string-width/readme.md delete mode 100644 deps/npm/node_modules/wrap-ansi/node_modules/strip-ansi/index.d.ts delete mode 100644 deps/npm/node_modules/wrap-ansi/node_modules/strip-ansi/index.js delete mode 100644 deps/npm/node_modules/wrap-ansi/node_modules/strip-ansi/license delete mode 100644 deps/npm/node_modules/wrap-ansi/node_modules/strip-ansi/package.json delete mode 100644 deps/npm/node_modules/wrap-ansi/node_modules/strip-ansi/readme.md delete mode 100644 deps/npm/node_modules/wrap-ansi/package.json delete mode 100644 deps/npm/node_modules/wrap-ansi/readme.md delete mode 100644 deps/npm/node_modules/xdg-basedir/index.js delete mode 100644 deps/npm/node_modules/xdg-basedir/license delete mode 100644 deps/npm/node_modules/xdg-basedir/package.json delete mode 100644 deps/npm/node_modules/xdg-basedir/readme.md delete mode 100644 deps/npm/node_modules/xtend/.npmignore delete mode 100644 deps/npm/node_modules/xtend/LICENCE delete mode 100644 deps/npm/node_modules/xtend/Makefile delete mode 100644 deps/npm/node_modules/xtend/README.md delete mode 100644 deps/npm/node_modules/xtend/immutable.js delete mode 100644 deps/npm/node_modules/xtend/mutable.js delete mode 100644 deps/npm/node_modules/xtend/package.json delete mode 100644 deps/npm/node_modules/xtend/test.js delete mode 100644 deps/npm/node_modules/y18n/CHANGELOG.md delete mode 100644 deps/npm/node_modules/y18n/LICENSE delete mode 100644 deps/npm/node_modules/y18n/README.md delete mode 100644 deps/npm/node_modules/y18n/index.js delete mode 100644 deps/npm/node_modules/y18n/package.json delete mode 100644 deps/npm/node_modules/yargs-parser/CHANGELOG.md delete mode 100644 deps/npm/node_modules/yargs-parser/LICENSE.txt delete mode 100644 deps/npm/node_modules/yargs-parser/README.md delete mode 100644 deps/npm/node_modules/yargs-parser/index.js delete mode 100644 deps/npm/node_modules/yargs-parser/lib/tokenize-arg-string.js delete mode 100644 deps/npm/node_modules/yargs-parser/node_modules/camelcase/index.d.ts delete mode 100644 deps/npm/node_modules/yargs-parser/node_modules/camelcase/index.js delete mode 100644 deps/npm/node_modules/yargs-parser/node_modules/camelcase/license delete mode 100644 deps/npm/node_modules/yargs-parser/node_modules/camelcase/package.json delete mode 100644 deps/npm/node_modules/yargs-parser/node_modules/camelcase/readme.md delete mode 100644 deps/npm/node_modules/yargs-parser/package.json delete mode 100644 deps/npm/node_modules/yargs/CHANGELOG.md delete mode 100644 deps/npm/node_modules/yargs/LICENSE delete mode 100644 deps/npm/node_modules/yargs/README.md delete mode 100644 deps/npm/node_modules/yargs/index.js delete mode 100644 deps/npm/node_modules/yargs/lib/apply-extends.js delete mode 100644 deps/npm/node_modules/yargs/lib/argsert.js delete mode 100644 deps/npm/node_modules/yargs/lib/command.js delete mode 100644 deps/npm/node_modules/yargs/lib/completion-templates.js delete mode 100644 deps/npm/node_modules/yargs/lib/completion.js delete mode 100644 deps/npm/node_modules/yargs/lib/is-promise.js delete mode 100644 deps/npm/node_modules/yargs/lib/levenshtein.js delete mode 100644 deps/npm/node_modules/yargs/lib/middleware.js delete mode 100644 deps/npm/node_modules/yargs/lib/obj-filter.js delete mode 100644 deps/npm/node_modules/yargs/lib/usage.js delete mode 100644 deps/npm/node_modules/yargs/lib/validation.js delete mode 100644 deps/npm/node_modules/yargs/lib/yerror.js delete mode 100644 deps/npm/node_modules/yargs/locales/be.json delete mode 100644 deps/npm/node_modules/yargs/locales/de.json delete mode 100644 deps/npm/node_modules/yargs/locales/en.json delete mode 100644 deps/npm/node_modules/yargs/locales/es.json delete mode 100644 deps/npm/node_modules/yargs/locales/fr.json delete mode 100644 deps/npm/node_modules/yargs/locales/hi.json delete mode 100644 deps/npm/node_modules/yargs/locales/hu.json delete mode 100644 deps/npm/node_modules/yargs/locales/id.json delete mode 100644 deps/npm/node_modules/yargs/locales/it.json delete mode 100644 deps/npm/node_modules/yargs/locales/ja.json delete mode 100644 deps/npm/node_modules/yargs/locales/ko.json delete mode 100644 deps/npm/node_modules/yargs/locales/nb.json delete mode 100644 deps/npm/node_modules/yargs/locales/nl.json delete mode 100644 deps/npm/node_modules/yargs/locales/nn.json delete mode 100644 deps/npm/node_modules/yargs/locales/pirate.json delete mode 100644 deps/npm/node_modules/yargs/locales/pl.json delete mode 100644 deps/npm/node_modules/yargs/locales/pt.json delete mode 100644 deps/npm/node_modules/yargs/locales/pt_BR.json delete mode 100644 deps/npm/node_modules/yargs/locales/ru.json delete mode 100644 deps/npm/node_modules/yargs/locales/th.json delete mode 100644 deps/npm/node_modules/yargs/locales/tr.json delete mode 100644 deps/npm/node_modules/yargs/locales/zh_CN.json delete mode 100644 deps/npm/node_modules/yargs/locales/zh_TW.json delete mode 100644 deps/npm/node_modules/yargs/node_modules/ansi-regex/index.js delete mode 100644 deps/npm/node_modules/yargs/node_modules/ansi-regex/license delete mode 100644 deps/npm/node_modules/yargs/node_modules/ansi-regex/package.json delete mode 100644 deps/npm/node_modules/yargs/node_modules/ansi-regex/readme.md delete mode 100644 deps/npm/node_modules/yargs/node_modules/find-up/index.js delete mode 100644 deps/npm/node_modules/yargs/node_modules/find-up/license delete mode 100644 deps/npm/node_modules/yargs/node_modules/find-up/package.json delete mode 100644 deps/npm/node_modules/yargs/node_modules/find-up/readme.md delete mode 100644 deps/npm/node_modules/yargs/node_modules/is-fullwidth-code-point/index.js delete mode 100644 deps/npm/node_modules/yargs/node_modules/is-fullwidth-code-point/license delete mode 100644 deps/npm/node_modules/yargs/node_modules/is-fullwidth-code-point/package.json delete mode 100644 deps/npm/node_modules/yargs/node_modules/is-fullwidth-code-point/readme.md delete mode 100644 deps/npm/node_modules/yargs/node_modules/locate-path/index.js delete mode 100644 deps/npm/node_modules/yargs/node_modules/locate-path/license delete mode 100644 deps/npm/node_modules/yargs/node_modules/locate-path/package.json delete mode 100644 deps/npm/node_modules/yargs/node_modules/locate-path/readme.md delete mode 100644 deps/npm/node_modules/yargs/node_modules/p-limit/index.d.ts delete mode 100644 deps/npm/node_modules/yargs/node_modules/p-limit/index.js delete mode 100644 deps/npm/node_modules/yargs/node_modules/p-limit/license delete mode 100644 deps/npm/node_modules/yargs/node_modules/p-limit/package.json delete mode 100644 deps/npm/node_modules/yargs/node_modules/p-limit/readme.md delete mode 100644 deps/npm/node_modules/yargs/node_modules/p-locate/index.js delete mode 100644 deps/npm/node_modules/yargs/node_modules/p-locate/license delete mode 100644 deps/npm/node_modules/yargs/node_modules/p-locate/package.json delete mode 100644 deps/npm/node_modules/yargs/node_modules/p-locate/readme.md delete mode 100644 deps/npm/node_modules/yargs/node_modules/p-try/index.d.ts delete mode 100644 deps/npm/node_modules/yargs/node_modules/p-try/index.js delete mode 100644 deps/npm/node_modules/yargs/node_modules/p-try/license delete mode 100644 deps/npm/node_modules/yargs/node_modules/p-try/package.json delete mode 100644 deps/npm/node_modules/yargs/node_modules/p-try/readme.md delete mode 100644 deps/npm/node_modules/yargs/node_modules/string-width/index.js delete mode 100644 deps/npm/node_modules/yargs/node_modules/string-width/license delete mode 100644 deps/npm/node_modules/yargs/node_modules/string-width/package.json delete mode 100644 deps/npm/node_modules/yargs/node_modules/string-width/readme.md delete mode 100644 deps/npm/node_modules/yargs/node_modules/strip-ansi/index.d.ts delete mode 100644 deps/npm/node_modules/yargs/node_modules/strip-ansi/index.js delete mode 100644 deps/npm/node_modules/yargs/node_modules/strip-ansi/license delete mode 100644 deps/npm/node_modules/yargs/node_modules/strip-ansi/package.json delete mode 100644 deps/npm/node_modules/yargs/node_modules/strip-ansi/readme.md delete mode 100644 deps/npm/node_modules/yargs/package.json delete mode 100644 deps/npm/node_modules/yargs/yargs.js create mode 100644 deps/npm/scripts/bundle-and-gitignore-deps.js create mode 100644 deps/npm/scripts/check-deps.js create mode 100755 deps/npm/scripts/resetdeps.sh create mode 100644 deps/npm/tap-snapshots/test-lib-dist-tag.js-TAP.test.js create mode 100644 deps/npm/tap-snapshots/test-lib-fund.js-TAP.test.js create mode 100644 deps/npm/tap-snapshots/test-lib-link.js-TAP.test.js create mode 100644 deps/npm/tap-snapshots/test-lib-ls.js-TAP.test.js create mode 100644 deps/npm/tap-snapshots/test-lib-outdated.js-TAP.test.js create mode 100644 deps/npm/tap-snapshots/test-lib-publish.js-TAP.test.js create mode 100644 deps/npm/tap-snapshots/test-lib-utils-cmd-list.js-TAP.test.js create mode 100644 deps/npm/tap-snapshots/test-lib-utils-config.js-TAP.test.js create mode 100644 deps/npm/tap-snapshots/test-lib-utils-error-handler.js-TAP.test.js create mode 100644 deps/npm/tap-snapshots/test-lib-utils-error-message.js-TAP.test.js create mode 100644 deps/npm/tap-snapshots/test-lib-utils-explain-dep.js-TAP.test.js create mode 100644 deps/npm/tap-snapshots/test-lib-utils-explain-eresolve.js-TAP.test.js create mode 100644 deps/npm/tap-snapshots/test-lib-utils-flat-options.js-TAP.test.js create mode 100644 deps/npm/tap-snapshots/test-lib-utils-reify-output.js-TAP.test.js create mode 100644 deps/npm/tap-snapshots/test-lib-utils-tar.js-TAP.test.js create mode 100644 deps/npm/tap-snapshots/test-lib-utils-update-notifier.js-TAP.test.js create mode 100644 deps/npm/tap-snapshots/test-lib-view.js-TAP.test.js delete mode 100644 deps/npm/tap-snapshots/test-tap-fund.js-TAP.test.js create mode 100644 deps/npm/test/bin/npm-cli.js create mode 100644 deps/npm/test/bin/npx-cli.js delete mode 100644 deps/npm/test/common-config.js delete mode 100644 deps/npm/test/common-tap.js create mode 100644 deps/npm/test/coverage-map.js delete mode 100644 deps/npm/test/fake-registry.js delete mode 100644 deps/npm/test/fake-registry.md delete mode 100644 deps/npm/test/fixtures/config/.npmrc delete mode 100644 deps/npm/test/fixtures/config/builtin delete mode 100644 deps/npm/test/fixtures/config/globalconfig delete mode 100644 deps/npm/test/fixtures/config/malformed delete mode 100644 deps/npm/test/fixtures/config/multi-ca delete mode 100644 deps/npm/test/fixtures/config/userconfig delete mode 100644 deps/npm/test/fixtures/config/userconfig-with-gc create mode 100644 deps/npm/test/fixtures/eresolve-explanations.js delete mode 100644 deps/npm/test/fixtures/forked-underscore-1.5.1.tgz delete mode 100644 deps/npm/test/fixtures/github-com-BryanDonovan-dummy-npm-bar.git.tar.gz delete mode 100644 deps/npm/test/fixtures/github-com-BryanDonovan-dummy-npm-buzz.git.tar.gz delete mode 100644 deps/npm/test/fixtures/github-com-BryanDonovan-dummy-npm-foo.git.tar.gz delete mode 100644 deps/npm/test/fixtures/github-com-BryanDonovan-npm-git-test.git.tar.gz delete mode 100644 deps/npm/test/fixtures/gitignore-and-npmignore-2.tar delete mode 100644 deps/npm/test/fixtures/gitignore-and-npmignore.tar delete mode 100644 deps/npm/test/fixtures/gitignore-and-npmignore.tgz delete mode 100644 deps/npm/test/fixtures/gitignore.tgz delete mode 100644 deps/npm/test/fixtures/npmignore.tgz delete mode 100644 deps/npm/test/fixtures/onload.js delete mode 100644 deps/npm/test/fixtures/scoped-underscore-1.3.1.tgz delete mode 100644 deps/npm/test/fixtures/third-party.md create mode 100644 deps/npm/test/lib/access.js create mode 100644 deps/npm/test/lib/adduser.js create mode 100644 deps/npm/test/lib/audit.js create mode 100644 deps/npm/test/lib/auth/legacy.js create mode 100644 deps/npm/test/lib/auth/oauth.js create mode 100644 deps/npm/test/lib/auth/saml.js create mode 100644 deps/npm/test/lib/auth/sso.js create mode 100644 deps/npm/test/lib/bin.js create mode 100644 deps/npm/test/lib/birthday.js create mode 100644 deps/npm/test/lib/bugs.js create mode 100644 deps/npm/test/lib/ci.js create mode 100644 deps/npm/test/lib/cli.js create mode 100644 deps/npm/test/lib/dedupe.js create mode 100644 deps/npm/test/lib/dist-tag.js create mode 100644 deps/npm/test/lib/docs.js create mode 100644 deps/npm/test/lib/exec.js create mode 100644 deps/npm/test/lib/explain.js create mode 100644 deps/npm/test/lib/explore.js create mode 100644 deps/npm/test/lib/find-dupes.js create mode 100644 deps/npm/test/lib/fund.js create mode 100644 deps/npm/test/lib/get.js create mode 100644 deps/npm/test/lib/install.js create mode 100644 deps/npm/test/lib/link.js create mode 100644 deps/npm/test/lib/ll.js create mode 100644 deps/npm/test/lib/load-all-commands.js create mode 100644 deps/npm/test/lib/load-all.js create mode 100644 deps/npm/test/lib/logout.js create mode 100644 deps/npm/test/lib/ls.js create mode 100644 deps/npm/test/lib/npm.js create mode 100644 deps/npm/test/lib/outdated.js create mode 100644 deps/npm/test/lib/pack.js create mode 100644 deps/npm/test/lib/ping.js create mode 100644 deps/npm/test/lib/prefix.js create mode 100644 deps/npm/test/lib/prune.js create mode 100644 deps/npm/test/lib/publish.js create mode 100644 deps/npm/test/lib/repo.js create mode 100644 deps/npm/test/lib/restart.js create mode 100644 deps/npm/test/lib/root.js create mode 100644 deps/npm/test/lib/run-script.js create mode 100644 deps/npm/test/lib/start.js create mode 100644 deps/npm/test/lib/stop.js create mode 100644 deps/npm/test/lib/test.js create mode 100644 deps/npm/test/lib/token.js create mode 100644 deps/npm/test/lib/utils/cleanup-log-files.js create mode 100644 deps/npm/test/lib/utils/cmd-list.js create mode 100644 deps/npm/test/lib/utils/completion/installed-deep.js create mode 100644 deps/npm/test/lib/utils/completion/installed-shallow.js create mode 100644 deps/npm/test/lib/utils/completion/none.js create mode 100644 deps/npm/test/lib/utils/config.js create mode 100644 deps/npm/test/lib/utils/deref-command.js create mode 100644 deps/npm/test/lib/utils/did-you-mean.js create mode 100644 deps/npm/test/lib/utils/error-handler.js create mode 100644 deps/npm/test/lib/utils/error-message.js create mode 100644 deps/npm/test/lib/utils/escape-arg.js create mode 100644 deps/npm/test/lib/utils/escape-exec-path.js create mode 100644 deps/npm/test/lib/utils/explain-dep.js create mode 100644 deps/npm/test/lib/utils/explain-eresolve.js create mode 100644 deps/npm/test/lib/utils/flat-options.js create mode 100644 deps/npm/test/lib/utils/get-identity.js create mode 100644 deps/npm/test/lib/utils/get-project-scope.js create mode 100644 deps/npm/test/lib/utils/hosted-git-info-from-manifest.js create mode 100644 deps/npm/test/lib/utils/is-windows-bash.js create mode 100644 deps/npm/test/lib/utils/is-windows-shell.js create mode 100644 deps/npm/test/lib/utils/is-windows.js create mode 100644 deps/npm/test/lib/utils/lifecycle-cmd.js create mode 100644 deps/npm/test/lib/utils/output.js create mode 100644 deps/npm/test/lib/utils/path.js create mode 100644 deps/npm/test/lib/utils/perf.js create mode 100644 deps/npm/test/lib/utils/ping.js create mode 100644 deps/npm/test/lib/utils/proc-log-listener.js create mode 100644 deps/npm/test/lib/utils/read-local-package.js create mode 100644 deps/npm/test/lib/utils/reify-output.js create mode 100644 deps/npm/test/lib/utils/set-user-agent.js create mode 100644 deps/npm/test/lib/utils/setup-log.js create mode 100644 deps/npm/test/lib/utils/tar.js create mode 100644 deps/npm/test/lib/utils/unsupported.js create mode 100644 deps/npm/test/lib/utils/update-notifier.js create mode 100644 deps/npm/test/lib/view.js create mode 100644 deps/npm/test/lib/whoami.js delete mode 100644 deps/npm/test/need-npm5-update/belongs-in-pacote/add-remote-git-get-resolved.js delete mode 100644 deps/npm/test/need-npm5-update/belongs-in-pacote/git-races.js delete mode 100644 deps/npm/test/need-npm5-update/ignore-shrinkwrap.js delete mode 100644 deps/npm/test/need-npm5-update/legacy-array-bin.js delete mode 100644 deps/npm/test/need-npm5-update/legacy-dir-bin.js delete mode 100644 deps/npm/test/need-npm5-update/legacy-npm-self-install.js delete mode 100644 deps/npm/test/need-npm5-update/legacy-optional-deps.js delete mode 100644 deps/npm/test/need-npm5-update/legacy-shrinkwrap.js delete mode 100644 deps/npm/test/need-npm5-update/lifecycle-signal.js delete mode 100644 deps/npm/test/need-npm5-update/move-no-clobber-dest-node-modules.js delete mode 100644 deps/npm/test/need-npm5-update/need-only-update-save-optional/update-save.js delete mode 100644 deps/npm/test/need-npm5-update/need-outdated/update-symlink.js delete mode 100644 deps/npm/test/need-npm5-update/outdated-depth-deep.js delete mode 100644 deps/npm/test/need-npm5-update/outdated-depth-integer.js delete mode 100644 deps/npm/test/need-npm5-update/outdated-include-devdependencies.js delete mode 100644 deps/npm/test/need-npm5-update/outdated-local.js delete mode 100644 deps/npm/test/need-npm5-update/outdated-new-versions.js delete mode 100644 deps/npm/test/need-npm5-update/outdated-notarget.js delete mode 100644 deps/npm/test/need-npm5-update/outdated-private.js delete mode 100644 deps/npm/test/need-npm5-update/outdated-symlink.js delete mode 100644 deps/npm/test/need-npm5-update/peer-deps-invalid.js delete mode 100644 deps/npm/test/need-npm5-update/peer-deps-toplevel.js delete mode 100644 deps/npm/test/need-npm5-update/peer-deps-without-package-json.js delete mode 100644 deps/npm/test/need-npm5-update/rm-linked.js delete mode 100644 deps/npm/test/need-npm5-update/shrinkwrap-complete-except-dev.js delete mode 100644 deps/npm/test/need-npm5-update/shrinkwrap-dev-dep-cycle.js delete mode 100644 deps/npm/test/network/git-cache-locking.js delete mode 100644 deps/npm/test/network/git-cache-no-hooks.js delete mode 100644 deps/npm/test/network/legacy-bundled-git.js delete mode 100644 deps/npm/test/network/legacy-url-dep.js delete mode 100644 deps/npm/test/network/registry.js delete mode 100644 deps/npm/test/tap/00-check-mock-dep.js delete mode 100644 deps/npm/test/tap/00-config-setup.js delete mode 100644 deps/npm/test/tap/00-verify-bundle-deps.js delete mode 100644 deps/npm/test/tap/00-verify-ls-ok.js delete mode 100644 deps/npm/test/tap/00-verify-no-scoped.js delete mode 100644 deps/npm/test/tap/404-parent.js delete mode 100644 deps/npm/test/tap/404-private-registry-scoped.js delete mode 100644 deps/npm/test/tap/404-private-registry.js delete mode 100644 deps/npm/test/tap/404.js delete mode 100644 deps/npm/test/tap/access.js delete mode 100644 deps/npm/test/tap/add-named-update-protocol-port.js delete mode 100644 deps/npm/test/tap/add-remote-git-file.js delete mode 100644 deps/npm/test/tap/add-remote-git-shrinkwrap.js delete mode 100644 deps/npm/test/tap/add-remote-git-submodule.js delete mode 100644 deps/npm/test/tap/add-remote-git.js delete mode 100644 deps/npm/test/tap/adduser-always-auth.js delete mode 100644 deps/npm/test/tap/adduser-legacy-auth.js delete mode 100644 deps/npm/test/tap/adduser-oauth.js delete mode 100644 deps/npm/test/tap/adduser-saml.js delete mode 100644 deps/npm/test/tap/aliases.js delete mode 100644 deps/npm/test/tap/all-package-metadata-cache-stream-unit.js delete mode 100644 deps/npm/test/tap/all-package-metadata-entry-stream-unit.js delete mode 100644 deps/npm/test/tap/all-package-metadata-update-stream-unit.js delete mode 100644 deps/npm/test/tap/all-package-metadata-write-stream-unit.js delete mode 100644 deps/npm/test/tap/all-package-metadata.js delete mode 100644 deps/npm/test/tap/anon-cli-metrics.js delete mode 100644 deps/npm/test/tap/audit-fix.js delete mode 100644 deps/npm/test/tap/audit.js delete mode 100644 deps/npm/test/tap/auto-prune.js delete mode 100644 deps/npm/test/tap/bearer-token-check.js delete mode 100644 deps/npm/test/tap/bin-overwriting.js delete mode 100644 deps/npm/test/tap/bin.js delete mode 100644 deps/npm/test/tap/bitbucket-https-url-with-creds-package.js delete mode 100644 deps/npm/test/tap/bitbucket-https-url-with-creds.js delete mode 100644 deps/npm/test/tap/bitbucket-shortcut-package.js delete mode 100644 deps/npm/test/tap/bitbucket-shortcut.js delete mode 100644 deps/npm/test/tap/bugs.js delete mode 100644 deps/npm/test/tap/build-already-built.js delete mode 100644 deps/npm/test/tap/builtin-config.js delete mode 100644 deps/npm/test/tap/bundled-dependencies-nonarray.js delete mode 100644 deps/npm/test/tap/bundled-dependencies.js delete mode 100644 deps/npm/test/tap/bundled-no-add-to-move.js delete mode 100644 deps/npm/test/tap/bundled-transitive-deps.js delete mode 100644 deps/npm/test/tap/cache-add-unpublished.js delete mode 100644 deps/npm/test/tap/cache-eacces-error-message.js delete mode 100644 deps/npm/test/tap/cache-shasum-fork.js delete mode 100644 deps/npm/test/tap/check-cpu-reqs.js delete mode 100644 deps/npm/test/tap/check-engine-reqs.js delete mode 100644 deps/npm/test/tap/check-install-self.js delete mode 100644 deps/npm/test/tap/check-os-reqs.js delete mode 100644 deps/npm/test/tap/check-permissions.js delete mode 100644 deps/npm/test/tap/ci-header.js delete mode 100644 deps/npm/test/tap/ci-permissions.js delete mode 100644 deps/npm/test/tap/ci-with-local-dependency.js delete mode 100644 deps/npm/test/tap/ci.js delete mode 100644 deps/npm/test/tap/circular-dep.js delete mode 100644 deps/npm/test/tap/config-basic.js delete mode 100644 deps/npm/test/tap/config-builtin.js delete mode 100644 deps/npm/test/tap/config-certfile.js delete mode 100644 deps/npm/test/tap/config-credentials.js delete mode 100644 deps/npm/test/tap/config-edit.js delete mode 100644 deps/npm/test/tap/config-envReplace.js delete mode 100644 deps/npm/test/tap/config-list.js delete mode 100644 deps/npm/test/tap/config-malformed.js delete mode 100644 deps/npm/test/tap/config-meta.js delete mode 100644 deps/npm/test/tap/config-new-cafile.js delete mode 100644 deps/npm/test/tap/config-private.js delete mode 100644 deps/npm/test/tap/config-project.js delete mode 100644 deps/npm/test/tap/config-save.js delete mode 100644 deps/npm/test/tap/correct-mkdir.js delete mode 100644 deps/npm/test/tap/cruft-test.js delete mode 100644 deps/npm/test/tap/debug-logs.js delete mode 100644 deps/npm/test/tap/dedupe-git-semver.js delete mode 100644 deps/npm/test/tap/dedupe-scoped.js delete mode 100644 deps/npm/test/tap/dedupe.js delete mode 100644 deps/npm/test/tap/deprecate.js delete mode 100644 deps/npm/test/tap/dist-tag.js delete mode 100644 deps/npm/test/tap/do-not-remove-other-bins.js delete mode 100644 deps/npm/test/tap/doctor-ping-registry-404.js delete mode 100644 deps/npm/test/tap/doctor.js delete mode 100644 deps/npm/test/tap/extraneous-dep-cycle-ls-ok.js delete mode 100644 deps/npm/test/tap/false-name.js delete mode 100644 deps/npm/test/tap/fetch-package-metadata.js delete mode 100644 deps/npm/test/tap/format-package-lock.js delete mode 100644 deps/npm/test/tap/full-warning-messages.js delete mode 100644 deps/npm/test/tap/fund.js delete mode 100644 deps/npm/test/tap/gently-rm-cmdshims.js delete mode 100644 deps/npm/test/tap/gently-rm-linked-module.js delete mode 100644 deps/npm/test/tap/gently-rm-overeager.js delete mode 100644 deps/npm/test/tap/gently-rm-symlinked-global-dir.js delete mode 100644 deps/npm/test/tap/gist-short-shortcut-package.js delete mode 100644 deps/npm/test/tap/gist-short-shortcut.js delete mode 100644 deps/npm/test/tap/gist-shortcut-package.js delete mode 100644 deps/npm/test/tap/gist-shortcut.js delete mode 100644 deps/npm/test/tap/git-dependency-install-link.js delete mode 100644 deps/npm/test/tap/git-npmignore.js delete mode 100644 deps/npm/test/tap/git-prepare.js delete mode 100644 deps/npm/test/tap/github-shortcut-package.js delete mode 100644 deps/npm/test/tap/github-shortcut.js delete mode 100644 deps/npm/test/tap/gitlab-shortcut-package.js delete mode 100644 deps/npm/test/tap/gitlab-shortcut.js delete mode 100644 deps/npm/test/tap/global-prefix-set-in-userconfig.js delete mode 100644 deps/npm/test/tap/graceful-restart.js delete mode 100644 deps/npm/test/tap/help.js delete mode 100644 deps/npm/test/tap/hook.js delete mode 100644 deps/npm/test/tap/ignore-install-link.js delete mode 100644 deps/npm/test/tap/ignore-scripts.js delete mode 100644 deps/npm/test/tap/init-create.js delete mode 100644 deps/npm/test/tap/init-interrupt.js delete mode 100644 deps/npm/test/tap/install-actions.js delete mode 100644 deps/npm/test/tap/install-at-locally.js delete mode 100644 deps/npm/test/tap/install-at-sub-path-locally.js delete mode 100644 deps/npm/test/tap/install-bad-dep-format.js delete mode 100644 deps/npm/test/tap/install-bad-man.js delete mode 100644 deps/npm/test/tap/install-before.js delete mode 100644 deps/npm/test/tap/install-bin-null.js delete mode 100644 deps/npm/test/tap/install-cli-only-development.js delete mode 100644 deps/npm/test/tap/install-cli-only-production.js delete mode 100644 deps/npm/test/tap/install-cli-only-shrinkwrap.js delete mode 100644 deps/npm/test/tap/install-cli-production-nosave.js delete mode 100644 deps/npm/test/tap/install-cli-production.js delete mode 100644 deps/npm/test/tap/install-cli-unicode.js delete mode 100644 deps/npm/test/tap/install-contributors-count.js delete mode 100644 deps/npm/test/tap/install-dep-classification.js delete mode 100644 deps/npm/test/tap/install-duplicate-deps-warning.js delete mode 100644 deps/npm/test/tap/install-from-local-multipath.js delete mode 100644 deps/npm/test/tap/install-from-local.js delete mode 100644 deps/npm/test/tap/install-into-likenamed-folder.js delete mode 100644 deps/npm/test/tap/install-lifecycle.js delete mode 100644 deps/npm/test/tap/install-link-metadeps-locally.js delete mode 100644 deps/npm/test/tap/install-link-metadeps-subfolders.js delete mode 100644 deps/npm/test/tap/install-link-scripts.js delete mode 100644 deps/npm/test/tap/install-local-dep-cycle.js delete mode 100644 deps/npm/test/tap/install-local-from-local.js delete mode 100644 deps/npm/test/tap/install-man.js delete mode 100644 deps/npm/test/tap/install-mention-funding.js delete mode 100644 deps/npm/test/tap/install-noargs-dev.js delete mode 100644 deps/npm/test/tap/install-order.js delete mode 100644 deps/npm/test/tap/install-package-json-order.js delete mode 100644 deps/npm/test/tap/install-package-lock-only.js delete mode 100644 deps/npm/test/tap/install-parse-error.js delete mode 100644 deps/npm/test/tap/install-property-conflicts.js delete mode 100644 deps/npm/test/tap/install-report-just-installed.js delete mode 100644 deps/npm/test/tap/install-save-consistent-newlines.js delete mode 100644 deps/npm/test/tap/install-save-exact.js delete mode 100644 deps/npm/test/tap/install-save-local.js delete mode 100644 deps/npm/test/tap/install-save-prefix.js delete mode 100644 deps/npm/test/tap/install-scoped-already-installed.js delete mode 100644 deps/npm/test/tap/install-scoped-link.js delete mode 100644 deps/npm/test/tap/install-scoped-with-bundled-dependency.js delete mode 100644 deps/npm/test/tap/install-scoped-with-peer-dependency.js delete mode 100644 deps/npm/test/tap/install-shrinkwrapped-git.js delete mode 100644 deps/npm/test/tap/install-test-cli-with-broken-package-lock.js delete mode 100644 deps/npm/test/tap/install-test-cli-without-package-lock.js delete mode 100644 deps/npm/test/tap/install-windows-newlines.js delete mode 100644 deps/npm/test/tap/install-with-dev-dep-duplicate.js delete mode 100644 deps/npm/test/tap/install-without-registry-config.js delete mode 100644 deps/npm/test/tap/install.fund.js delete mode 100644 deps/npm/test/tap/invalid-cmd-exit-code.js delete mode 100644 deps/npm/test/tap/invalid-dep-version-filtering.js delete mode 100644 deps/npm/test/tap/is-fs-access-available.js delete mode 100644 deps/npm/test/tap/is-registry.js delete mode 100644 deps/npm/test/tap/it.js delete mode 100644 deps/npm/test/tap/legacy-ignore-nested-nm.js delete mode 100644 deps/npm/test/tap/legacy-missing-bindir.js delete mode 100644 deps/npm/test/tap/legacy-no-auth-leak.js delete mode 100644 deps/npm/test/tap/legacy-platform-all.js delete mode 100644 deps/npm/test/tap/legacy-platform.js delete mode 100644 deps/npm/test/tap/legacy-private.js delete mode 100644 deps/npm/test/tap/legacy-test-package.js delete mode 100644 deps/npm/test/tap/lifecycle-INIT_CWD.js delete mode 100644 deps/npm/test/tap/lifecycle-order.js delete mode 100644 deps/npm/test/tap/lifecycle-path.js delete mode 100644 deps/npm/test/tap/link.js delete mode 100644 deps/npm/test/tap/local-args-relative-to-cwd.js delete mode 100644 deps/npm/test/tap/locker.js delete mode 100644 deps/npm/test/tap/lockfile-empty-dep-value.js delete mode 100644 deps/npm/test/tap/lockfile-http-deps.js delete mode 100644 deps/npm/test/tap/logout-scoped.js delete mode 100644 deps/npm/test/tap/logout.js delete mode 100644 deps/npm/test/tap/ls-depth-cli.js delete mode 100644 deps/npm/test/tap/ls-depth-unmet.js delete mode 100644 deps/npm/test/tap/ls-env.js delete mode 100644 deps/npm/test/tap/ls-l-depth-0.js delete mode 100644 deps/npm/test/tap/ls-no-results.js delete mode 100644 deps/npm/test/tap/ls-peer.js delete mode 100644 deps/npm/test/tap/ls-production-and-dev.js delete mode 100644 deps/npm/test/tap/ls-top-errors.js delete mode 100644 deps/npm/test/tap/ls.js delete mode 100644 deps/npm/test/tap/meta-test-flaky-root-ownership-test.js delete mode 100644 deps/npm/test/tap/nerf-dart.js delete mode 100644 deps/npm/test/tap/nested-extraneous.js delete mode 100644 deps/npm/test/tap/no-global-warns.js delete mode 100644 deps/npm/test/tap/no-scan-full-global-dir.js delete mode 100644 deps/npm/test/tap/noargs-install-config-save.js delete mode 100644 deps/npm/test/tap/node-modules-path-munge.js delete mode 100644 deps/npm/test/tap/normalize-package-explode.js delete mode 100644 deps/npm/test/tap/npm-api-not-loaded-error.js delete mode 100644 deps/npm/test/tap/onload.js delete mode 100644 deps/npm/test/tap/optional-metadep-rollback-collision.js delete mode 100644 deps/npm/test/tap/org.js delete mode 100644 deps/npm/test/tap/outdated-bad-read-tree.js delete mode 100644 deps/npm/test/tap/outdated-color.js delete mode 100644 deps/npm/test/tap/outdated-depth.js delete mode 100644 deps/npm/test/tap/outdated-git.js delete mode 100644 deps/npm/test/tap/outdated-json.js delete mode 100644 deps/npm/test/tap/outdated-latest.js delete mode 100644 deps/npm/test/tap/outdated-long.js delete mode 100644 deps/npm/test/tap/outdated-remote.js delete mode 100644 deps/npm/test/tap/outdated-symlink.js delete mode 100644 deps/npm/test/tap/outdated.js delete mode 100644 deps/npm/test/tap/override-bundled.js delete mode 100644 deps/npm/test/tap/owner.js delete mode 100644 deps/npm/test/tap/pack-files-and-ignores.js delete mode 100644 deps/npm/test/tap/pack-scoped.js delete mode 100644 deps/npm/test/tap/pack.js delete mode 100644 deps/npm/test/tap/peer-deps.js delete mode 100644 deps/npm/test/tap/pick-manifest-from-registry-metadata.js delete mode 100644 deps/npm/test/tap/ping.js delete mode 100644 deps/npm/test/tap/prepare.js delete mode 100644 deps/npm/test/tap/prepublish-only.js delete mode 100644 deps/npm/test/tap/prepublish.js delete mode 100644 deps/npm/test/tap/process-logger.js delete mode 100644 deps/npm/test/tap/progress-config.js delete mode 100644 deps/npm/test/tap/prune-dev-dep-cycle.js delete mode 100644 deps/npm/test/tap/prune-dev-dep-with-bins.js delete mode 100644 deps/npm/test/tap/prune-with-dev-dep-duplicate.js delete mode 100644 deps/npm/test/tap/prune-with-only-dev-deps.js delete mode 100644 deps/npm/test/tap/prune.js delete mode 100644 deps/npm/test/tap/publish-access-scoped.js delete mode 100644 deps/npm/test/tap/publish-access-unscoped-restricted-fails.js delete mode 100644 deps/npm/test/tap/publish-access-unscoped.js delete mode 100644 deps/npm/test/tap/publish-config.js delete mode 100644 deps/npm/test/tap/publish-invalid-semver-tag.js delete mode 100644 deps/npm/test/tap/publish-scoped.js delete mode 100644 deps/npm/test/tap/publish.js delete mode 100644 deps/npm/test/tap/pwd-prefix.js delete mode 100644 deps/npm/test/tap/referer.js delete mode 100644 deps/npm/test/tap/repo.js delete mode 100644 deps/npm/test/tap/retry-on-stale-cache.js delete mode 100644 deps/npm/test/tap/run-script-filter-private.js delete mode 100644 deps/npm/test/tap/run-script.js delete mode 100644 deps/npm/test/tap/save-optional.js delete mode 100644 deps/npm/test/tap/scope-header.js delete mode 100644 deps/npm/test/tap/scripts-whitespace-windows.js delete mode 100644 deps/npm/test/tap/search.all-package-search.js delete mode 100644 deps/npm/test/tap/search.js delete mode 100644 deps/npm/test/tap/semver-doc.js delete mode 100644 deps/npm/test/tap/shared-linked.js delete mode 100644 deps/npm/test/tap/shrinkwrap-_auth.js delete mode 100644 deps/npm/test/tap/shrinkwrap-default-dev.js delete mode 100644 deps/npm/test/tap/shrinkwrap-dev-dependency.js delete mode 100644 deps/npm/test/tap/shrinkwrap-empty-dep-value.js delete mode 100644 deps/npm/test/tap/shrinkwrap-empty-deps.js delete mode 100644 deps/npm/test/tap/shrinkwrap-extra-metadata.js delete mode 100644 deps/npm/test/tap/shrinkwrap-global-auth.js delete mode 100644 deps/npm/test/tap/shrinkwrap-lifecycle-cwd.js delete mode 100644 deps/npm/test/tap/shrinkwrap-lifecycle.js delete mode 100644 deps/npm/test/tap/shrinkwrap-local-dependency.js delete mode 100644 deps/npm/test/tap/shrinkwrap-nested.js delete mode 100644 deps/npm/test/tap/shrinkwrap-optional-dependency.js delete mode 100644 deps/npm/test/tap/shrinkwrap-optional-platform.js delete mode 100644 deps/npm/test/tap/shrinkwrap-optional-property.js delete mode 100644 deps/npm/test/tap/shrinkwrap-prod-dependency-also.js delete mode 100644 deps/npm/test/tap/shrinkwrap-prod-dependency.js delete mode 100644 deps/npm/test/tap/shrinkwrap-resolve-conflict.js delete mode 100644 deps/npm/test/tap/shrinkwrap-save-dev-with-existing-deps.js delete mode 100644 deps/npm/test/tap/shrinkwrap-save-with-existing-dev-deps.js delete mode 100644 deps/npm/test/tap/shrinkwrap-scoped-auth.js delete mode 100644 deps/npm/test/tap/shrinkwrap-shared-dev-dependency.js delete mode 100644 deps/npm/test/tap/shrinkwrap-version-match.js delete mode 100644 deps/npm/test/tap/sorted-package-json.js delete mode 100644 deps/npm/test/tap/spawn-enoent-help.js delete mode 100644 deps/npm/test/tap/spawn-enoent.js delete mode 100644 deps/npm/test/tap/spec-local-specifiers.js delete mode 100644 deps/npm/test/tap/splat-with-only-prerelease-to-latest.js delete mode 100644 deps/npm/test/tap/startstop.js delete mode 100644 deps/npm/test/tap/symlink-cycle.js delete mode 100644 deps/npm/test/tap/tag-version-prefix.js delete mode 100644 deps/npm/test/tap/tagged-version-matching.js delete mode 100644 deps/npm/test/tap/team.js delete mode 100644 deps/npm/test/tap/test-run-ls.js delete mode 100644 deps/npm/test/tap/tree-style.js delete mode 100644 deps/npm/test/tap/umask-lifecycle.js delete mode 100644 deps/npm/test/tap/uninstall-in-reverse.js delete mode 100644 deps/npm/test/tap/uninstall-link-clean.js delete mode 100644 deps/npm/test/tap/uninstall-package.js delete mode 100644 deps/npm/test/tap/uninstall-save.js delete mode 100644 deps/npm/test/tap/unit-child-path.js delete mode 100644 deps/npm/test/tap/unit-deps-earliestInstallable.js delete mode 100644 deps/npm/test/tap/unit-deps-removeObsoleteDep.js delete mode 100644 deps/npm/test/tap/unit-deps-replaceModule.js delete mode 100644 deps/npm/test/tap/unit-module-name.js delete mode 100644 deps/npm/test/tap/unit-package-id.js delete mode 100644 deps/npm/test/tap/unit-token-validate-cidr.js delete mode 100644 deps/npm/test/tap/unpack-foreign-tarball.js delete mode 100644 deps/npm/test/tap/unpublish-config.js delete mode 100644 deps/npm/test/tap/unsupported.js delete mode 100644 deps/npm/test/tap/update-examples.js delete mode 100644 deps/npm/test/tap/update-path.js delete mode 100644 deps/npm/test/tap/update-symlink.js delete mode 100644 deps/npm/test/tap/upgrade-lifecycles.js delete mode 100644 deps/npm/test/tap/url-dependencies.js delete mode 100644 deps/npm/test/tap/utils.funding.js delete mode 100644 deps/npm/test/tap/verify-no-lifecycle-on-repo.js delete mode 100644 deps/npm/test/tap/version-allow-same-version.js delete mode 100644 deps/npm/test/tap/version-commit-hooks-default.js delete mode 100644 deps/npm/test/tap/version-commit-hooks.js delete mode 100644 deps/npm/test/tap/version-consistent-newlines.js delete mode 100644 deps/npm/test/tap/version-from-git.js delete mode 100644 deps/npm/test/tap/version-git-not-clean.js delete mode 100644 deps/npm/test/tap/version-lifecycle.js delete mode 100644 deps/npm/test/tap/version-message-config.js delete mode 100644 deps/npm/test/tap/version-no-git.js delete mode 100644 deps/npm/test/tap/version-no-package.js delete mode 100644 deps/npm/test/tap/version-no-tags.js delete mode 100644 deps/npm/test/tap/version-prerelease-id.js delete mode 100644 deps/npm/test/tap/version-sub-directory-shrinkwrap.js delete mode 100644 deps/npm/test/tap/version-sub-directory.js delete mode 100644 deps/npm/test/tap/version-update-shrinkwrap.js delete mode 100644 deps/npm/test/tap/view.js delete mode 100644 deps/npm/test/tap/whoami.js delete mode 100644 deps/npm/test/util/mock-tarball.js diff --git a/deps/npm/.eslintrc.json b/deps/npm/.eslintrc.json new file mode 100644 index 00000000000000..7253bed6af197e --- /dev/null +++ b/deps/npm/.eslintrc.json @@ -0,0 +1,215 @@ +{ + "parserOptions": { + "ecmaVersion": 2020, + "ecmaFeatures": { + "jsx": true + }, + "sourceType": "module" + }, + + "env": { + "es6": true, + "node": true + }, + + "plugins": [ + "import", + "node", + "promise", + "standard" + ], + + "globals": { + "document": "readonly", + "navigator": "readonly", + "window": "readonly" + }, + + "rules": { + "accessor-pairs": "error", + "array-bracket-spacing": ["error", "never"], + "arrow-spacing": ["error", { "before": true, "after": true }], + "block-spacing": ["error", "always"], + "brace-style": ["error", "1tbs", { "allowSingleLine": true }], + "camelcase": ["error", { "properties": "never" }], + "comma-dangle": ["error", { + "arrays": "never", + "objects": "never", + "imports": "never", + "exports": "never", + "functions": "never" + }], + "comma-spacing": ["error", { "before": false, "after": true }], + "comma-style": ["error", "last"], + "computed-property-spacing": ["error", "never"], + "constructor-super": "error", + "curly": ["error", "multi-line"], + "dot-location": ["error", "property"], + "dot-notation": ["error", { "allowKeywords": true }], + "eol-last": "error", + "eqeqeq": ["error", "always", { "null": "ignore" }], + "func-call-spacing": ["error", "never"], + "generator-star-spacing": ["error", { "before": true, "after": true }], + "handle-callback-err": ["error", "^(err|error)$" ], + "indent": ["error", 2, { + "SwitchCase": 1, + "VariableDeclarator": 1, + "outerIIFEBody": 1, + "MemberExpression": 1, + "FunctionDeclaration": { "parameters": 1, "body": 1 }, + "FunctionExpression": { "parameters": 1, "body": 1 }, + "CallExpression": { "arguments": 1 }, + "ArrayExpression": 1, + "ObjectExpression": 1, + "ImportDeclaration": 1, + "flatTernaryExpressions": true, + "ignoreComments": false, + "ignoredNodes": ["TemplateLiteral *"] + }], + "key-spacing": ["error", { "beforeColon": false, "afterColon": true }], + "keyword-spacing": ["error", { "before": true, "after": true }], + "lines-between-class-members": ["error", "always", { "exceptAfterSingleLine": true }], + "new-cap": ["error", { "newIsCap": true, "capIsNew": false, "properties": true }], + "new-parens": "error", + "no-array-constructor": "error", + "no-async-promise-executor": "error", + "no-caller": "error", + "no-case-declarations": "error", + "no-class-assign": "error", + "no-compare-neg-zero": "error", + "no-cond-assign": "error", + "no-const-assign": "error", + "no-constant-condition": ["error", { "checkLoops": false }], + "no-control-regex": "error", + "no-debugger": "error", + "no-delete-var": "error", + "no-dupe-args": "error", + "no-dupe-class-members": "error", + "no-dupe-keys": "error", + "no-duplicate-case": "error", + "no-empty-character-class": "error", + "no-empty-pattern": "error", + "no-eval": "error", + "no-ex-assign": "error", + "no-extend-native": "error", + "no-extra-bind": "error", + "no-extra-boolean-cast": "error", + "no-extra-parens": ["error", "functions"], + "no-fallthrough": "error", + "no-floating-decimal": "error", + "no-func-assign": "error", + "no-global-assign": "error", + "no-implied-eval": "error", + "no-inner-declarations": ["error", "functions"], + "no-invalid-regexp": "error", + "no-irregular-whitespace": "error", + "no-iterator": "error", + "no-labels": ["error", { "allowLoop": false, "allowSwitch": false }], + "no-lone-blocks": "error", + "no-misleading-character-class": "error", + "no-prototype-builtins": "error", + "no-useless-catch": "error", + "no-mixed-operators": ["error", { + "groups": [ + ["==", "!=", "===", "!==", ">", ">=", "<", "<="], + ["&&", "||"], + ["in", "instanceof"] + ], + "allowSamePrecedence": true + }], + "no-mixed-spaces-and-tabs": "error", + "no-multi-spaces": "error", + "no-multi-str": "error", + "no-multiple-empty-lines": ["error", { "max": 1, "maxEOF": 0 }], + "no-negated-in-lhs": "error", + "no-new": "error", + "no-new-func": "error", + "no-new-object": "error", + "no-new-require": "error", + "no-new-symbol": "error", + "no-new-wrappers": "error", + "no-obj-calls": "error", + "no-octal": "error", + "no-octal-escape": "error", + "no-path-concat": "error", + "no-proto": "error", + "no-redeclare": ["error", { "builtinGlobals": false }], + "no-regex-spaces": "error", + "no-return-assign": ["error", "except-parens"], + "no-self-assign": ["error", { "props": true }], + "no-self-compare": "error", + "no-sequences": "error", + "no-shadow-restricted-names": "error", + "no-sparse-arrays": "error", + "no-tabs": "error", + "no-template-curly-in-string": "error", + "no-this-before-super": "error", + "no-throw-literal": "off", + "no-trailing-spaces": "error", + "no-undef": "error", + "no-undef-init": "error", + "no-unexpected-multiline": "error", + "no-unmodified-loop-condition": "error", + "no-unneeded-ternary": ["error", { "defaultAssignment": false }], + "no-unreachable": "error", + "no-unsafe-finally": 0, + "no-unsafe-negation": "error", + "no-unused-expressions": ["error", { "allowShortCircuit": true, "allowTernary": true, "allowTaggedTemplates": true }], + "no-unused-vars": ["error", { "vars": "all", "args": "none", "ignoreRestSiblings": true }], + "no-use-before-define": ["error", { "functions": false, "classes": false, "variables": false }], + "no-useless-call": "error", + "no-useless-computed-key": "error", + "no-useless-constructor": "error", + "no-useless-escape": "error", + "no-useless-rename": "error", + "no-useless-return": "error", + "no-void": "error", + "no-whitespace-before-property": "error", + "no-with": "error", + "object-curly-newline": ["error", { "multiline": true, "consistent": true }], + "object-curly-spacing": ["error", "always"], + "object-property-newline": ["error", { "allowMultiplePropertiesPerLine": true }], + "one-var": ["error", { "initialized": "never" }], + "operator-linebreak": ["error", "after", { "overrides": { "?": "before", ":": "before", "|>": "before" } }], + "padded-blocks": ["error", { "blocks": "never", "switches": "never", "classes": "never" }], + "prefer-const": ["error", {"destructuring": "all"}], + "prefer-promise-reject-errors": "error", + "quote-props": ["error", "as-needed"], + "quotes": ["error", "single", { "avoidEscape": true, "allowTemplateLiterals": false }], + "rest-spread-spacing": ["error", "never"], + "semi": ["error", "never"], + "semi-spacing": ["error", { "before": false, "after": true }], + "space-before-blocks": ["error", "always"], + "space-before-function-paren": ["error", "always"], + "space-in-parens": ["error", "never"], + "space-infix-ops": "error", + "space-unary-ops": ["error", { "words": true, "nonwords": false }], + "spaced-comment": ["error", "always", { + "line": { "markers": ["*package", "!", "/", ",", "="] }, + "block": { "balanced": true, "markers": ["*package", "!", ",", ":", "::", "flow-include"], "exceptions": ["*"] } + }], + "symbol-description": "error", + "template-curly-spacing": ["error", "never"], + "template-tag-spacing": ["error", "never"], + "unicode-bom": ["error", "never"], + "use-isnan": "error", + "valid-typeof": ["error", { "requireStringLiterals": true }], + "wrap-iife": ["error", "any", { "functionPrototypeMethods": true }], + "yield-star-spacing": ["error", "both"], + "yoda": ["error", "never"], + + "import/export": "error", + "import/first": "error", + "import/no-absolute-path": ["error", { "esmodule": true, "commonjs": true, "amd": false }], + "import/no-duplicates": "error", + "import/no-named-default": "error", + "import/no-webpack-loader-syntax": "error", + + "node/no-deprecated-api": "error", + "node/process-exit-as-throw": "error", + + "promise/param-names": "off", + + "standard/no-callback-literal": "error" + } +} diff --git a/deps/npm/.licensee.json b/deps/npm/.licensee.json index 5b815d601ee77a..05235667ca2df0 100644 --- a/deps/npm/.licensee.json +++ b/deps/npm/.licensee.json @@ -5,11 +5,5 @@ ], "blueOak": "bronze" }, - "corrections": true, - "packages": { - "config-chain": "1.1.12", - "cyclist": "0.2.2", - "json-schema": "0.2.3", - "qrcode-terminal": "0.12.0" - } + "corrections": true } diff --git a/deps/npm/.npmignore b/deps/npm/.npmignore index f45f47b93829b8..aacaa8f822e7ce 100644 --- a/deps/npm/.npmignore +++ b/deps/npm/.npmignore @@ -26,3 +26,4 @@ html/*.png Session.vim .nyc_output +/.editorconfig diff --git a/deps/npm/.travis.yml b/deps/npm/.travis.yml deleted file mode 100644 index 9fb0d51133692c..00000000000000 --- a/deps/npm/.travis.yml +++ /dev/null @@ -1,19 +0,0 @@ -# need to declare the language as well as the matrix below -language: node_js - -os: - - windows - -node_js: - - 12 - - 10 - - 8 - - 6 - -env: "DEPLOY_VERSION=testing" - -install: - - "node . install" - -script: - - "node . run tap -- \"test/tap/*.js\" -t600 -Rclassic -c" diff --git a/deps/npm/AUTHORS b/deps/npm/AUTHORS index c390455e200fbe..dd8474b2d0ea2a 100644 --- a/deps/npm/AUTHORS +++ b/deps/npm/AUTHORS @@ -695,15 +695,15 @@ Jarda Snajdr Naix Geng <1308363651@qq.com> Dylan Treisman mum-never-proud -Peter Fich -Maxwell Gerber -Sean Poulter -vanishcode -Jean-Charles Sisk -Martin Packman -Danielle Adams -Gianfranco Costamagna -Antonio -Sandra Tatarevićová -Antoine du Hamel -Assaf Sapir +Pablo Cúbico +Timo Sand +Edward Thomson +Masafumi Koba +jamesgeorge007 +Mickael Jeanroy +Myles Borins +Nathan LaFreniere +Lucio Martinez +Brian Jenkins +nlf +zhaoxuxu diff --git a/deps/npm/CHANGELOG.md b/deps/npm/CHANGELOG.md index 0f07a687af988e..385641563e9f7a 100644 --- a/deps/npm/CHANGELOG.md +++ b/deps/npm/CHANGELOG.md @@ -1,2910 +1,753 @@ -## 6.14.8 (2020-08-17) - -### BUG FIXES -* [`9262e8c88`](https://github.com/npm/cli/commit/9262e8c88f2f828206423928b8e21eea67f4801a) - [#1575](https://github.com/npm/cli/pull/1575) - npm install --dev deprecation message - ([@sandratatarevicova](https://github.com/sandratatarevicova)) -* [`765cfe0bc`](https://github.com/npm/cli/commit/765cfe0bc05a10b72026291ff0ca7c9ca5cb3f57) - [#1658](https://github.com/npm/cli/issues/1658) - remove unused broken require - ([@aduh95](https://github.com/aduh95)) -* [`4e28de79a`](https://github.com/npm/cli/commit/4e28de79a3a0aacc7603010a592beb448ceb6f5f) - [#1663](https://github.com/npm/cli/pull/1663) - Do not send user secret in the referer header - ([@assapir](https://github.com/assapir)) - -### DOCUMENTATION -* [`8abdf30c9`](https://github.com/npm/cli/commit/8abdf30c95ec90331456f3f2ed78e2703939bb74) - [#1572](https://github.com/npm/cli/pull/1572) - docs: add missing metadata in semver page - ([@tripu](https://github.com/tripu)) -* [`8cedcca46`](https://github.com/npm/cli/commit/8cedcca464ced5aab58be83dd5049c3df13384de) - [#1614](https://github.com/npm/cli/pull/1614) - Node-gyp supports both Python and legacy Python - ([@cclauss](https://github.com/cclauss)) - -### DEPENDENCIES -* [`a303b75fd`](https://github.com/npm/cli/commit/a303b75fd7c4b2644da02ad2ad46d80dfceec3c5) - `update-notifier@2.5.0` -* [`c48600832`](https://github.com/npm/cli/commit/c48600832aff4cc349f59997e08dc4bbde15bd49) - `npm-registry-fetch@4.0.7` -* [`a6e9fc4df`](https://github.com/npm/cli/commit/a6e9fc4df7092ba3eb5394193638b33c24855c36) - `meant@1.0.2`: - -## 6.14.7 (2020-07-21) - -### BUG FIXES -* [`de5108836`](https://github.com/npm/cli/commit/de5108836189bddf28d4d3542f9bd5869cc5c2e9) [#784](https://github.com/npm/cli/pull/784) npm explore spawn shell correctly ([@jasisk](https://github.com/jasisk)) -* [`36e6c01d3`](https://github.com/npm/cli/commit/36e6c01d334c4db75018bc6a4a0bef726fd41ce4) git tag handling regression on shrinkwrap ([@claudiahdz](https://github.com/claudiahdz)) -* [`1961c9369`](https://github.com/npm/cli/commit/1961c9369c92bf8fe530cecba9834ca3c7f5567c) [#288](https://github.com/npm/cli/pull/288) Fix package id in shrinkwrap lifecycle step output ([@bz2](https://github.com/bz2)) -* [`87888892a`](https://github.com/npm/cli/commit/87888892a1282cc3edae968c3ae4ec279189271c) [#1009](https://github.com/npm/cli/pull/1009) gracefully handle error during npm install ([@danielleadams](https://github.com/danielleadams)) -* [`6fe2bdc25`](https://github.com/npm/cli/commit/6fe2bdc25e7961956e5c0067fa4db54ff1bd0dbd) [#1547](https://github.com/npm/cli/pull/1547) npm ls --parseable --long output ([@ruyadorno](https://github.com/ruyadorno)) - -### DEPENDENCIES -* [`2d78481c7`](https://github.com/npm/cli/commit/2d78481c7ec178e628ce23df940f73a05d5c6367) update mkdirp on tacks ([@claudiahdz](https://github.com/claudiahdz)) -* [`4e129d105`](https://github.com/npm/cli/commit/4e129d105eba3b12d474caa6e5ca216a98deb75a) uninstall npm-registry-couchapp ([@claudiahdz](https://github.com/claudiahdz)) -* [`8e1869e27`](https://github.com/npm/cli/commit/8e1869e278d1dd37ddefd6b4e961d1bb17fc9d09) update marked dev dep ([@claudiahdz](https://github.com/claudiahdz)) -* [`6a6151f37`](https://github.com/npm/cli/commit/6a6151f377063c6aca852c859c01910edd235ec6) `libnpx@10.2.4` ([@claudiahdz](https://github.com/claudiahdz)) -* [`dc21422eb`](https://github.com/npm/cli/commit/dc21422eb1ca1a4a19f160fad0e924566e08c496) `bin-links@1.1.8` ([@claudiahdz](https://github.com/claudiahdz)) -* [`d341f88ce`](https://github.com/npm/cli/commit/d341f88ce6feb3df1dcb37f34910fcc6c1db85f2) `gentle-fs@2.3.1` ([@claudiahdz](https://github.com/claudiahdz)) -* [`3e168d49b`](https://github.com/npm/cli/commit/3e168d49b41574809cae2ad013776a00d3f20ff4) `libcipm@4.0.8` ([@claudiahdz](https://github.com/claudiahdz)) -* [`6ae942a51`](https://github.com/npm/cli/commit/6ae942a510520b7dff11b5b78eebeff1706e38af) `npm-audit-report@1.3.3` ([@claudiahdz](https://github.com/claudiahdz)) -* [`6a35e3dee`](https://github.com/npm/cli/commit/6a35e3deec275bf2ae76603acd424a0640458047) `npm-lifecycle@3.1.5` ([@claudiahdz](https://github.com/claudiahdz)) - -## 6.14.6 (2020-07-07) - -### BUG FIXES -* [`a9857b8f6`](https://github.com/npm/cli/commit/a9857b8f6869451ff058789c4631fadfde5bbcbc) chore: remove auth info from logs ([@claudiahdz](https://github.com/claudiahdz)) -* [`b7ad77598`](https://github.com/npm/cli/commit/b7ad77598112908d60195d0fbc472b3c84275fd5) [#1416](https://github.com/npm/cli/pull/1416) fix: wrong `npm doctor` command result ([@vanishcode](https://github.com/vanishcode)) - -### DEPENDENCIES -* [`94eca6377`](https://github.com/npm/cli/commit/94eca637756376b949edfb697e179a1fdcc231ee) `npm-registry-fetch@4.0.5` ([@claudiahdz](https://github.com/claudiahdz)) -* [`c49b6ae28`](https://github.com/npm/cli/commit/c49b6ae28791ff7184288be16654f97168aa9705) [#1418](https://github.com/npm/cli/pull/1418) `spdx-license-ids@3.0.5` ([@kemitchell](https://github.com/kemitchell)) - -### DOCUMENTATION -* [`2e052984b`](https://github.com/npm/cli/commit/2e052984b08c09115ed75387fb2c961631d85d77) - [#1459](https://github.com/npm/cli/pull/1459) - chore(docs): fixed links to cli commands ([@claudiahdz](https://github.com/claudiahdz)) -* [`0ca3509ca`](https://github.com/npm/cli/commit/0ca3509ca940865392daeeabb39192f7d5af9f5e) - [#1283](https://github.com/npm/cli/pull/1283) Update npm-link.md ([@peterfich](https://github.com/peterfich)) -* [`3dd429e9a`](https://github.com/npm/cli/commit/3dd429e9aad760ce2ff9e522b34ebfebd85b460c) - [#1377](https://github.com/npm/cli/pull/1377) - Add note about dropped `*` filenames ([@maxwellgerber](https://github.com/maxwellgerber)) -* [`9a2e2e797`](https://github.com/npm/cli/commit/9a2e2e797e5c91e7f4f261583a1906e2c440cc2f) - [#1429](https://github.com/npm/cli/pull/1429) Fix typo ([@seanpoulter](https://github.com/seanpoulter)) - -## 6.14.5 (2020-05-01) - -### BUG FIXES - -* [`33ec41f18`](https://github.com/npm/cli/commit/33ec41f18f557146607cb14a7a38c707fce6d42c) [#758](https://github.com/npm/cli/pull/758) fix: relativize file links when inflating shrinkwrap ([@jsnajdr](https://github.com/jsnajdr)) -* [`94ed456df`](https://github.com/npm/cli/commit/94ed456dfb0b122fd4192429024f034d06c3c454) [#1162](https://github.com/npm/cli/pull/1162) fix: npm init help output ([@mum-never-proud](https://github.com/mum-never-proud)) - -### DEPENDENCIES - -* [`5587ac01f`](https://github.com/npm/cli/commit/5587ac01ffd0d2ea830a6bbb67bb34a611ffc409) `npm-registry-fetch@4.0.4` - * [`fc5d94c39`](https://github.com/npm/npm-registry-fetch/commit/fc5d94c39ca218d78df77249ab3a6bf1d9ed9db1) fix: removed default timeout -* [`07a4d8884`](https://github.com/npm/cli/commit/07a4d8884448359bac485a49c05fd2d23d06834b) `graceful-fs@4.2.4` -* [`8228d1f2e`](https://github.com/npm/cli/commit/8228d1f2e427ad9adee617266108acd1ee39b4a5) `mkdirp@0.5.5` -* [`e6d208317`](https://github.com/npm/cli/commit/e6d20831740a84aea766da2a2913cf82a4d56ada) `nopt@4.0.3` - -## 6.14.4 (2020-03-24) - -### DEPENDENCIES - -* Bump `minimist@1.2.5` transitive dep to resolve security issue - * [`9c554fd8c`](https://github.com/npm/cli/commit/9c554fd8cd1e9aeb8eb122ccfa3c78d12af4097a) `update-notifier@2.5.0` - * bump `deep-extend@1.2.5` - * bump `deep-extend@0.6.0` - * bump `is-ci@1.2.1` - * bump `is-retry-allowed@1.2.0` - * bump `rc@1.2.8` - * bump `registry-auth-token@3.4.0` - * bump `widest-line@2.0.1` -* [`136832dca`](https://github.com/npm/cli/commit/136832dcae13cb5518b1fe17bd63ea9b2a195f92) `mkdirp@0.5.4` -* [`8bf99b2b5`](https://github.com/npm/cli/commit/8bf99b2b58c14d45dc6739fce77de051ebc8ffb7) [#1053](https://github.com/npm/cli/pull/1053) deps: updates term-size to use signed binary - * [`d2f08a1bdb`](https://github.com/nodejs/node/commit/d2f08a1bdb78655c4a3fc49825986c148d14117e) ([@rvagg](https://github.com/rvagg)) - -## 6.14.3 (2020-03-19) - -### DOCUMENTATION - -* [`4ad221487`](https://github.com/npm/cli/commit4ad2214873cddfd4a0eff1bd188516b08fae9f9e) [#1020](https://github.com/npm/cli/pull/1020) docs(teams): updated team docs to reflect MFA workflow ([@blkdm0n](https://github.com/blkdm0n)) -* [`4a31a4ba2`](https://github.com/npm/cli/commit/4a31a4ba2db0a5db2d1d0890ee934ba1babb73a6) [#1034](https://github.com/npm/cli/pull/1034) docs: cleanup ([@ruyadorno](https://github.com/ruyadorno)) -* [`0eac801cd`](https://github.com/npm/cli/commit/0eac801cdef344e9fbda6270145e062211255b0e) [#1013](https://github.com/npm/cli/pull/1013) docs: fix links to cli commands ([@alenros](https://github.com/alenros)) -* [`7d8e5b99c`](https://github.com/npm/cli/commit/7d8e5b99c4ef8c394cffa7fc845f54a25ff37e3a) [#755](https://github.com/npm/cli/pull/755) docs: correction to `npm update -g` behaviour ([@johnkennedy9147](https://github.com/johnkennedy9147)) - -### DEPENDENCIES - -* [`e11167646`](https://github.com/npm/cli/commit/e111676467f090f73802b97e8da7ece481b18f99) `mkdirp@0.5.3` - * [`c5b97d17d`](https://github.com/isaacs/node-mkdirp/commit/c5b97d17d45a22bcf4c815645cbb989dab57ddd8) fix: bump `minimist` dep to resolve security issue ([@isaacs](https://github.com/isaacs)) -* [`c50d679c6`](https://github.com/npm/cli/commit/c50d679c68b39dd03ad127d34f540ddcb1b1e804) `rimraf@2.7.1` -* [`a2de99ff9`](https://github.com/npm/cli/commit/a2de99ff9e02425a3ccc25280f390178be755a36) `npm-registry-mock@1.3.1` -* [`217debeb9`](https://github.com/npm/cli/commit/217debeb9812e037a6686cbf6ec67a0cd47fa68a) `npm-registry-couchapp@2.7.4` - -## 6.14.2 (2020-03-03) - -### DOCUMENTATION -* [`f9248c0be`](https://github.com/npm/cli/commit/f9248c0be63fba37a30098dc9215c752474380e3) [#730](https://github.com/npm/cli/pull/730) chore(docs): update unpublish docs & policy reference ([@nomadtechie](https://github.com/nomadtechie), [@mikemimik](https://github.com/mikemimik)) - -### DEPENDENCIES - -* [`909cc3918`](https://github.com/npm/cli/commit/909cc39180a352f206898481add5772206c8b65f) `hosted-git-info@2.8.8` ([@darcyclarke](https://github.com/darcyclarke)) - * [`5038b1891`](https://github.com/npm/hosted-git-info/commit/5038b1891a61ca3cd7453acbf85d7011fe0086bb) fix: regression in old node versions w/ respect to url.URL implmentation -* [`9204ffa58`](https://github.com/npm/cli/commit/9204ffa584c140c5e22b1ee37f6df2c98f5dc70b) `npm-profile@4.0.4` ([@isaacs](https://github.com/isaacs)) - * [`6bcf0860a`](https://github.com/npm/npm-profile/commit/6bcf0860a3841865099d0115dbcbde8b78109bd9) fix: treat non-http/https login urls as invalid -* [`0365d39bd`](https://github.com/npm/cli/commit/0365d39bdc74960a18caac674f51d0e2a98b31e6) `glob@7.1.6` ([@isaacs](https://github.com/isaacs)) -* [`dab030536`](https://github.com/nodejs/node-gyp/commit/dab030536b6a70ecae37debc74c581db9e5280fd) `node-gyp@5.1.0` ([@rvagg](https://github.com/rvagg)) - -## 6.14.1 (2020-02-26) - -* [`303e5c11e`](https://github.com/npm/cli/commit/303e5c11e7db34cf014107aecd2e81c821bfde8d) - `hosted-git-info@2.8.7` - Fixes a regression where scp-style git urls are passed to the WhatWG URL - parser, which does not handle them properly. - ([@isaacs](https://github.com/isaacs)) +## v7.0.0-rc.3 (2020-10-06) + +* [`d816c2efa`](https://github.com/npm/cli/commit/d816c2efae41930cbdf4fff8657e0adc450d1dd4) + [`c8f0d5457`](https://github.com/npm/cli/commit/c8f0d5457dd913b425987ae30a611d4eb9e84b7d) + [`d48086d0d`](https://github.com/npm/cli/commit/d48086d0d3e006e76f364fb2c62b406a97ce8f68) + [`f34595f2e`](https://github.com/npm/cli/commit/f34595f2e5814a929049aca0349ce418a7f400c6) + [#1902](https://github.com/npm/cli/pull/1902) + tests for several commands + ([@nlf](https://github.com/nlf)) +* [`6d49207db`](https://github.com/npm/cli/commit/6d49207dbc5d66f91f4f462f05dd8916046e3a7b) + [#1903](https://github.com/npm/cli/pull/1903) + Revert "Remove unused npx binary" + ([@MylesBorins](https://github.com/MylesBorins)) +* [`138dfc202`](https://github.com/npm/cli/commit/138dfc202f401d2d93b4b5d2499799be6eb4ff0b) + set executable permissions on bins that node installer uses +* [`b06d68078`](https://github.com/npm/cli/commit/b06d68078830cc2446b1e51553db10e87591865b) + `@npmcli/arborist@0.0.32` + * Do not remove `node_modules` folders from Workspaces when + `loadActual` races with `buildIdealTree` ([@ruyadorno](https://github.com/ruyadorno)) +* [`2509e3a1b`](https://github.com/npm/cli/commit/2509e3a1bf76289062f1f6f06eee184df386054b) + `uuid@8.3.1` + +## v7.0.0-rc.2 (2020-10-02) + +* [`6de81a013`](https://github.com/npm/cli/commit/6de81a013833e0961abdec6f7c1ad50b63faaae6) + `@npmcli/run-script@1.7.2` + * Fix regression running 'install' scripts when package.json does not + contain a scripts object + +## v7.0.0-rc.1 (2020-10-02) + +* [`281a7f39a`](https://github.com/npm/cli/commit/281a7f39ac314bd7657ce2bcd7918b21eee99210) + `@npmcli/arborist@0.0.31` + * Allow `npm update` to update bundled root dependencies + * Only do implicit node-gyp build for gyp files named `binding.gyp` +* [`384f5ec47`](https://github.com/npm/cli/commit/384f5ec47091eed66c2a47f2c98df3ba7506ec9f) + update minipass-fetch to fix many 'cb() never called' errors +* [`7b1e75906`](https://github.com/npm/cli/commit/7b1e75906351bd73cde2f745ccaf63b9ad7de435) + `@npmcli/run-script@1.7.1` + * Only do implicit node-gyp build for gyp files named `binding.gyp` +* [`c20e2f0c7`](https://github.com/npm/cli/commit/c20e2f0c7766a04f999fdc64faad29277904c2d3) + [#1892](https://github.com/npm/cli/pull/1892) + Support `--omit` options in npm outdated + +## v7.0.0-rc.0 (2020-10-01) + +* [`3b417055c`](https://github.com/npm/cli/commit/3b417055cf07c4ef8e4c5063f00d3c24b5f5cbd2) + [#1859](https://github.com/npm/cli/pull/1859) + fix `proxy` and `https-proxy` config support + ([@badeggg](https://github.com/badeggg)) +* [`dd7d7a284`](https://github.com/npm/cli/commit/dd7d7a284d5150d1804d0cd5a85519c86adf3bc2) + `@npmcli/arborist@0.0.30` + * [#1849](https://github.com/npm/cli/issues/1849) Do not drop peer/dev + dep while saving if both set + * Do not install or build if there is a global top bin conflict + * Default to building node-gyp dependencies +* [`40c17e12c`](https://github.com/npm/cli/commit/40c17e12c5a734c37b88692e36221ac974c0c63d) + `cli-table3@0.6.0` +* [`47a8ca1d7`](https://github.com/npm/cli/commit/47a8ca1d72f0f0835b45cfb2c4fb8ab1218dc14a) + `byte-size@7.0.0` +* [`81073f99a`](https://github.com/npm/cli/commit/81073f99a93b680e3ca08b8f099e9aca2aaf50be) + `eslint@7.10.0` +* [`67793abd4`](https://github.com/npm/cli/commit/67793abd4abdf315816b6266ddb045289f607b03) + `eslint-plugin-import@2.22.1` +* [`a27e8d006`](https://github.com/npm/cli/commit/a27e8d00664e5d4c3e81d664253a10176adb39c8) + `is-cidr@4.0.2` +* [`893fed45e`](https://github.com/npm/cli/commit/893fed45e2272ef764ebf927c659fcf5e7b355b3) + `marked-man@0.7.0` +* [`bc20e0c8a`](https://github.com/npm/cli/commit/bc20e0c8ae30a202c72af88586ab9c167dff980a) + `rimraf@3.0.2` +* [`a2b8fd3c1`](https://github.com/npm/cli/commit/a2b8fd3c153ecca55cb2d60654fff207688532ab) + `uuid@8.3.0` +* [`ee4c85b87`](https://github.com/npm/cli/commit/ee4c85b878410143644460c3860ab706a8c925e0) + `write-file-atomic@3.0.3` +* [`4bdad5fdf`](https://github.com/npm/cli/commit/4bdad5fdf6ef387e2159b529ba4652f0221433b5) + `bin-links@2.2.1` +* [`c394937ec`](https://github.com/npm/cli/commit/c394937ec1911cd17ec42c8fc74773047d47322c) + `@npmcli/run-script@1.7.0` + * Default to building node-gyp dependencies and projects +* remove many unused dependencies + ([@ruyadorno](https://github.com/ruyadorno)) + * [`558e9781a`](https://github.com/npm/cli/commit/558e9781ada06b66be4d2d5d0f7e763f645eda25) + deep-equal + * [`2aa9a1f8a`](https://github.com/npm/cli/commit/2aa9a1f8a5773b9a960b14b51c8111fb964bc9ae) + request + * [`d77594e52`](https://github.com/npm/cli/commit/d77594e52f2f7d65d45347f542f48e4dbb6d2f26) + npm-registry-couchapp + * [`8ec84d9f6`](https://github.com/npm/cli/commit/8ec84d9f691686da67bd14c2728472c94ab3b955) + tacks + * [`a07b421f7`](https://github.com/npm/cli/commit/a07b421f708c13d8239e7283ad89611b24b23d0a) + lincesee + * [`41126e165`](https://github.com/npm/cli/commit/41126e165d3d5625a55e140b84fdd02052520146) + npm-cache-filename + * [`130da51b5`](https://github.com/npm/cli/commit/130da51b553e550584f31e2a8a961f4338f2a0cd) + npm-registry-mock + * [`b355af486`](https://github.com/npm/cli/commit/b355af48696bb5001c6d2b938974d9ab9f5e2360) + sprintf-js + * [`721c0a873`](https://github.com/npm/cli/commit/721c0a8736f3cd0a0e75e0b89518a431553843c6) + uid-number + * [`9c920e5f5`](https://github.com/npm/cli/commit/9c920e5f584e4d912aabc6e412693f7142242a89) + umask + * [`aae1c38bb`](https://github.com/npm/cli/commit/aae1c38bbb983cf40e9b3df012b18bebba5e5400) + config-chain + * [`450845eac`](https://github.com/npm/cli/commit/450845eaceb7e178c8ec7867a67e5cc948986904) + find-npm-prefix + * [`963d542d3`](https://github.com/npm/cli/commit/963d542d385c7fe26830a885fe40d96010d01862) + has-unicode + * [`cad9cbc70`](https://github.com/npm/cli/commit/cad9cbc70561c8638ed6e56286f753693f411000) + infer-owner + * [`3ae02914d`](https://github.com/npm/cli/commit/3ae02914d49f3302d25c85d2242096bb2291f9f4) + lockfile + * [`7bc474d7c`](https://github.com/npm/cli/commit/7bc474d7cb2e2e083fd8358d0648d7c5fb43707f) + once + * [`5c5e0099a`](https://github.com/npm/cli/commit/5c5e0099a4708ec84da3d2e427e16c4a9cfe3c8a) + retry + * [`cfaddd334`](https://github.com/npm/cli/commit/cfaddd334b8b1eddcefa3cd2a9b823ec140271a4) + sha + * [`3a978ffc7`](https://github.com/npm/cli/commit/3a978ffc7fddd6802c81996a5710b2efd15edc11) + slide + +## v7.0.0-beta.13 (2020-09-29) + +* [`405e051f7`](https://github.com/npm/cli/commit/405e051f724a2e79844f78f8ea9ba019fdc513aa) + Fix EBADPLATFORM error message + ([@#1876](https://github.com/#1876)) +* [`e4d911d21`](https://github.com/npm/cli/commit/e4d911d219899c0fdc12f8951b7d70e0887909f8) + `@npmcli/arborist@0.0.28` + * fix: workspaces install entering an infinite loop + * Save provided range if not a subset of savePrefix + * package-lock.json custom indentation + * Check engine and platform when building ideal tree +* [`90550b2e0`](https://github.com/npm/cli/commit/90550b2e023e7638134e91c80ed96828afb41539) + [#1853](https://github.com/npm/cli/pull/1853) + test coverage and refactor for token command + ([@nlf](https://github.com/nlf)) +* [`2715220c9`](https://github.com/npm/cli/commit/2715220c9b5d3f325e65e95bae2b5af8a485a579) + [#1858](https://github.com/npm/cli/pull/1858) + [#1813](https://github.com/npm/cli/issues/1813) + do not include omitted optional dependencies in install output + ([@ruyadorno](https://github.com/ruyadorno)) +* [`e225ddcf8`](https://github.com/npm/cli/commit/e225ddcf8d74a6b1cfb24ec49e37e3f5d06e5151) + [#1862](https://github.com/npm/cli/pull/1862) + [#1861](https://github.com/npm/cli/issues/1861) + respect depth when running `npm ls ` + ([@ruyadorno](https://github.com/ruyadorno)) +* [`2469ae515`](https://github.com/npm/cli/commit/2469ae5153fa4114a72684376a1b226aa07edf81) + [#1870](https://github.com/npm/cli/pull/1870) + [#1780](https://github.com/npm/cli/issues/1780) + Add 'fetch-timeout' config + ([@isaacs](https://github.com/isaacs)) +* [`52114b75e`](https://github.com/npm/cli/commit/52114b75e83db8a5e08f23889cce41c89af9eb93) + [#1871](https://github.com/npm/cli/pull/1871) + fix `npm ls` for linked dependencies + ([@ruyadorno](https://github.com/ruyadorno)) +* [`9981211c0`](https://github.com/npm/cli/commit/9981211c070ce2b1e34d30223d12bd275adcacf5) + [#1857](https://github.com/npm/cli/pull/1857) + [#1703](https://github.com/npm/cli/issues/1703) + fix `npm outdated` parsing invalid specs + ([@ruyadorno](https://github.com/ruyadorno)) -## 6.14.0 (2020-02-25) - -### FEATURES -* [`30f170877`](https://github.com/npm/cli/commit/30f170877954acd036cb234a581e4eb155049b82) [#731](https://github.com/npm/cli/pull/731) add support for multiple funding sources ([@ljharb](https://github.com/ljharb) & [@ruyadorno](hhttps://github.com/ruyadorno/)) - -### BUG FIXES -* [`55916b130`](https://github.com/npm/cli/commit/55916b130ef52984584678f2cc17c15c1f031cb5) [#508](https://github.com/npm/cli/pull/508) fix: check `npm.config` before accessing its members ([@kaiyoma](https://github.com/kaiyoma)) -* [`7d0cd65b2`](https://github.com/npm/cli/commit/7d0cd65b23c0986b631b9b54d87bbe74902cc023) [#733](https://github.com/npm/cli/pull/733) fix: access grant with unscoped packages ([@netanelgilad](https://github.com/netanelgilad)) -* [`28c3d40d6`](https://github.com/npm/cli/commit/28c3d40d65eef63f9d6ccb60b99ac57f5057a46e), [`0769c5b20`](https://github.com/npm/cli/commit/30f170877954acd036cb234a581e4eb155049b82) [#945](https://github.com/npm/cli/pull/945), [#697](https://github.com/npm/cli/pull/697) fix: allow new major versions of node to be automatically considered "supported" ([@isaacs](https://github.com/isaacs), [@ljharb](https://github.com/ljharb)) - -### DEPENDENCIES -* [`6f39e93`](https://github.com/npm/hosted-git-info/commit/6f39e93bae9162663af6f15a9d10bce675dd5de3) `hosted-git-info@2.8.6` ([@darcyclarke](https://github.com/darcyclarke)) - * fix: passwords & usernames are escaped properly in git deps ([@stevenhilder](https://github.com/stevenhilder)) -* [`f14b594ee`](https://github.com/npm/cli/commit/f14b594ee9dbfc98ed0b65c65d904782db4f31ad) `chownr@1.1.4` ([@isaacs](https://github.com/isaacs)) -* [`77044150b`](https://github.com/npm/cli/commit/77044150b763d67d997f9ff108219132ea922678) `npm-packlist@1.4.8` ([@isaacs](https://github.com/isaacs)) -* [`1d112461a`](https://github.com/npm/cli/commit/1d112461ad8dc99e5ff7fabb5177e8c2f89a9755) `npm-registry-fetch@4.0.3` ([@isaacs](https://github.com/isaacs)) - * [`ba8b4fe`](https://github.com/npm/npm-registry-fetch/commit/ba8b4fe60eb6cdf9b39012560aec596eda8ce924) fix: always bypass cache when ?write=true -* [`a47fed760`](https://github.com/npm/cli/commit/a47fed7603a6ed31dcc314c0c573805f05a96830) `readable-stream@3.6.0` - * [`3bbf2d6`](https://github.com/nodejs/readable-stream/commit/3bbf2d6feb45b03f4e46a2ae8251601ad2262121) fix: babel's "loose mode" class transform enbrittles BufferList ([@ljharb](https://github.com/ljharb)) - -### DOCUMENTATION -* [`284c1c055`](https://github.com/npm/cli/commit/284c1c055a28c4b334496101799acefe3c54ceb3), [`fbb5f0e50`](https://github.com/npm/cli/commit/fbb5f0e50e54425119fa3f03c5de93e4cb6bfda7) [#729](https://github.com/npm/cli/pull/729) update lifecycle hooks docs - ([@seanhealy](https://github.com/seanhealy), [@mikemimik](https://github.com/mikemimik)) -* [`1c272832d`](https://github.com/npm/cli/commit/1c272832d048300e409882313305c416dc6f21a2) [#787](https://github.com/npm/cli/pull/787) fix: trademarks typo ([@dnicolson](https://github.com/dnicolson)) -* [`f6ff41776`](https://github.com/npm/cli/commit/f6ff417767d52418cc8c9e7b9731ede2c3916d2e) [#936](https://github.com/npm/cli/pull/936) fix: postinstall example ([@ajaymathur](https://github.com/ajaymathur)) -* [`373224b16`](https://github.com/npm/cli/commit/373224b16e019b7b63d8f0b4c5d4adb7e5cb80dd) [#939](https://github.com/npm/cli/pull/939) fix: bad links in publish docs ([@vit100](https://github.com/vit100)) - -### MISCELLANEOUS -* [`85c79636d`](https://github.com/npm/cli/commit/85c79636df31bac586c0e380c4852ee155a7723c) [#736](https://github.com/npm/cli/pull/736) add script to update dist-tags ([@mikemimik](https://github.com/mikemimik)) - -## 6.13.7 (2020-01-28) - -### BUG FIXES -* [`7dbb91438`](https://github.com/npm/cli/commit/7dbb914382ecd2074fffb7eba81d93262e2d23c6) - [#655](https://github.com/npm/cli/pull/655) - Update CI detection cases - ([@isaacs](https://github.com/isaacs)) +## v7.0.0-beta.12 (2020-09-22) + +* [`24f3a5448`](https://github.com/npm/cli/commit/24f3a5448f021ad603046dfb9fd97ed66bd63bba) + [#1811](https://github.com/npm/cli/issues/1811) + npm ci should never save package.json or lockfile + ([@isaacs](https://github.com/isaacs)) +* [`5e780a5f0`](https://github.com/npm/cli/commit/5e780a5f067476c1d207173fc9249faf9eaac0c2) + remove unused spec parameter, assign error code + ([@nlf](https://github.com/nlf)) +* [`f019a248a`](https://github.com/npm/cli/commit/f019a248a67e8c46dbe41bf31f4818c5ca2138bf) + Remove unused npx binary + ([@isaacs](https://github.com/isaacs)) +* [`db157b3ce`](https://github.com/npm/cli/commit/db157b3ceb46327ca2089604d5f4fc9de391584e) + `@npmcli/arborist@0.0.27` + * Resolve race condition with conflicting bin links in local installs + * [#1812](https://github.com/npm/cli/issues/1812) Log engine mismatches more usefully + * [#1814](https://github.com/npm/cli/issues/1814) Do not loop trying to resolve dependencies that fail to load + * [npm/rfcs#224](https://github.com/npm/rfcs/pull/224) Do not automatically install optional peer dependencies + * Add the `strictPeerDeps` option, defaulting to `false` + * fix forwarding configs to resolve pkg spec when adding new deps +* [`b3a50d275`](https://github.com/npm/cli/commit/b3a50d27501e47c61b52c3cc4de99ff4e4641efe) + [#1846](https://github.com/npm/cli/pull/1846) + `@npmcli/run-script@1.6.0` + * This updates node-gyp to v7, allowing us to deduplicate a lot of significant dependencies. +* [`a1d375f6b`](https://github.com/npm/cli/commit/a1d375f6b0ee358be41110a49acc1c9fdb775fbe) + [#1819](https://github.com/npm/cli/pull/1819) + Add `--strict-peer-deps` option + ([@isaacs](https://github.com/isaacs)) +* [`5837a4843`](https://github.com/npm/cli/commit/5837a4843ab1f19fb62f60151f522ca0fa5449ae) + [#1699](https://github.com/npm/cli/pull/1699) + Use allow/deny list in docs + ([@luciomartinez](https://github.com/luciomartinez)) + +## v7.0.0-beta.11 (2020-09-16) + +* [`63005f4a9`](https://github.com/npm/cli/commit/63005f4a98d55786fda46f3bbb3feab044d078df) + [#1639](https://github.com/npm/cli/issues/1639) + npm view should not output extra newline ([@MylesBorins](https://github.com/MylesBorins)) +* [`3743a42c8`](https://github.com/npm/cli/commit/3743a42c854d9ea7e333d7ff86d206a4b079a352) + [#1750](https://github.com/npm/cli/pull/1750) + add outdated tests ([@claudiahdz](https://github.com/claudiahdz)) +* [`2019abdf1`](https://github.com/npm/cli/commit/2019abdf159eb13c9fb3a2bd2f35897a8f52b0d9) + [#1786](https://github.com/npm/cli/pull/1786) + add lib/link.js tests ([@ruyadorno](https://github.com/ruyadorno)) +* [`2f8d11968`](https://github.com/npm/cli/commit/2f8d11968607a74c8def3c05266049bee5e313eb) + `@npmcli/arborist@0.0.25` + * add meta vulnerability calculator for faster audits + * changed parsing specs to be relative to cwd + * fix logging script execution + * fix properly following resolved symlinks + * fix package.json dependencies order +* [`49b2bf5a7`](https://github.com/npm/cli/commit/49b2bf5a798b49d52166744088a80b8a39ccaeb6) + `@npmcli/config@1.1.8` + * fix unkown envs to be passed through + * fix setting correct globalPrefix on load +* [`f9aac351d`](https://github.com/npm/cli/commit/f9aac351dd36a19d14e1f951a2e8e20b41545822) + `libnpmversion@1.0.5` + * fix git ignored lockfiles + +## v7.0.0-beta.10 (2020-09-08) + +* [`7418970f0`](https://github.com/npm/cli/commit/7418970f03229dd2bce7973b99b981779aee6916) + Improve output of dependency node explanations +* [`5e49bdaa3`](https://github.com/npm/cli/commit/5e49bdaa34e29dbd25c687f8e6881747a86b7435) + [#1776](https://github.com/npm/cli/pull/1776) Add 'npm explain' command + +## v7.0.0-beta.9 (2020-09-04) + +* [`ef8f5676b`](https://github.com/npm/cli/commit/ef8f5676b1c90dcf44256b8ed1f61ddb6277c23a) + [#1757](https://github.com/npm/cli/pull/1757) + view: always fetch fullMetadata, and preferOnline +* [`ac5aa709a`](https://github.com/npm/cli/commit/ac5aa709a8609ec2beb7a8c60b3bde18f882f4e8) + [#1758](https://github.com/npm/cli/pull/1758) + fix scope config +* [`a36e2537f`](https://github.com/npm/cli/commit/a36e2537fd4c81df53fb6de01900beb9fa4fa0aa) + outdated: don't throw on non-version/tag/range dep +* [`371f0f062`](https://github.com/npm/cli/commit/371f0f06215ad8caf598c20e3d0d38ff597531e9) + `@npmcli/arborist@0.0.20` + + * Provide explanation objects for `ERESOLVE` errors + * Support overriding certain classes of `ERESOLVE` errors with `--force` + * Detect changes to package.json requiring package-lock dependency flag + re-evaluation + +* [`2a4e2e9ef`](https://github.com/npm/cli/commit/2a4e2e9efecb7f86147e5071c59cfc2461a5a7f5) + [#1761](https://github.com/npm/cli/pull/1761) + Explain `ERESOLVE` errors +* [`8e3e83bd4`](https://github.com/npm/cli/commit/8e3e83bd4f816bfed0efb8266985143ee9b94b86) + `@npmcli/arborist@0.0.21` + + * Remove bin links on prune + * Remove unnecessary tree walk for workspace projects + * Install workspaces on update:true + +* [`d6b134fd9`](https://github.com/npm/cli/commit/d6b134fd9005d911343831270615f80dfead7e3d) + [#1738](https://github.com/npm/cli/pull/1738) + [#1734](https://github.com/npm/cli/pull/1734) + fix package spec parsing during cache add process + ([@mjeanroy](https://github.com/mjeanroy)) +* [`f105eb833`](https://github.com/npm/cli/commit/f105eb8333fa3300c5b47464b129c1b0057ed7bf) + `npm-audit-report@2.1.4`: + + * Do not crash on cyclical meta-vulnerability references + +* [`03a9f569b`](https://github.com/npm/cli/commit/03a9f569b5121a173f14711980db297d4a04ac6b) + `opener@1.5.2` +* [`5616a23b4`](https://github.com/npm/cli/commit/5616a23b4b868d19aa100a6d86d781cc9bfd94f7) + `@npmcli/git@2.0.4` + + * Support `.git` files, so that git worktrees are respected + +## v7.0.0-beta.8 (2020-09-01) + +* [`834e62a0e`](https://github.com/npm/cli/commit/834e62a0e5b76e97cfe9ea3d3188661579ebc874) + * fix: npm ls extraneous workspaces + * `@npmcli/arborist@0.0.19` +* [`758b02358`](https://github.com/npm/cli/commit/758b02358613591ea877e26fcdb76e5b1d40f892) + [#1739](https://github.com/npm/cli/pull/1739) + add full install options to npm exec + ([@ruyadorno](https://github.com/ruyadorno)) +* [`2ee7c8a98`](https://github.com/npm/cli/commit/2ee7c8a98cf01225a3c9ac247139243f868e2e03) + `@npmcli/config@1.1.7` + ([@ruyadorno](https://github.com/ruyadorno)) -### DEPENDENCIES -* [`0fb1296c7`](https://github.com/npm/cli/commit/0fb1296c7d6d4bb9e78c96978c433cd65e55c0ea) - `libnpx@10.2.2` - ([@mikemimik](https://github.com/mikemimik)) -* [`c9b69d569`](https://github.com/npm/cli/commit/c9b69d569fec7944375a746e9c08a6fa9bec96ff) - `node-gyp@5.0.7` - ([@mikemimik](https://github.com/mikemimik)) -* [`e8dbaf452`](https://github.com/npm/cli/commit/e8dbaf452a1f6c5350bb0c37059b89a7448e7986) - `bin-links@1.1.7` - ([@mikemimik](https://github.com/mikemimik)) - * [#613](https://github.com/npm/cli/issues/613) Fixes bin entry for package +## v7.0.0-beta.7 (2020-08-25) -## 6.13.6 (2020-01-09) +* [`b38f68acd`](https://github.com/npm/cli/commit/b38f68acd9292b7432c936db3b6d2d12e896f45d) + ensure `npm-command` HTTP header is sent properly +* [`9f200abb9`](https://github.com/npm/cli/commit/9f200abb94ea2127d9a104c225159b1b7080c82c) + Properly exit with error status code +* [`aa0152b58`](https://github.com/npm/cli/commit/aa0152b58f34f8cdae05be63853c6e0ace03236a) + [#1719](https://github.com/npm/cli/pull/1719) Detect CI properly +* [`50f9740ca`](https://github.com/npm/cli/commit/50f9740ca8000b1c4bd3155bf1bc3d58fb6f0e20) + [#1717](https://github.com/npm/cli/pull/1717) fund with multiple funding + sources ([@ruyadorno](https://github.com/ruyadorno)) +* [`3a63ecb6f`](https://github.com/npm/cli/commit/3a63ecb6f6a0b235660f73a3ffa329b1f131b0c3) + [#1718](https://github.com/npm/cli/pull/1718) + [RFC-0029](https://github.com/npm/rfcs/blob/latest/accepted/0029-add-ability-to-skip-hooks.md) + add ability to skip pre/post hooks to `npm run-script` by using + `--ignore-scripts` ([@ruyadorno](https://github.com/ruyadorno)) -### DEPENDENCIES +## v7.0.0-beta.6 (2020-08-21) -* [`6dba897a1`](https://github.com/npm/cli/commit/6dba897a1e2d56388fb6df0c814b0bb85af366b4) - `pacote@9.5.12`: - * [`d2f4176`](https://github.com/npm/pacote/commit/d2f4176b6af393d7e29de27e9b638dbcbab9a0c7) - fix(git): Do not drop uid/gid when executing in root-owned directory - ([@isaacs](https://github.com/isaacs)) +* [`707207bdd`](https://github.com/npm/cli/commit/707207bddb2900d6f7a57ff864cef26cda75a71a) + add `@npmcli/config` dependency -## 6.13.5 (2020-01-09) +* [`5cb9a1d4d`](https://github.com/npm/cli/commit/5cb9a1d4d985aaa8e988c51fe5ae7f7ed3602811) + [#1688](https://github.com/npm/cli/pull/1688) use `@npmcli/config` for + configuration ([@isaacs](https://github.com/isaacs)) -### BUG FIXES +* [`a4295f5db`](https://github.com/npm/cli/commit/a4295f5db7667e8cc6b83abdad168619ad31a12f) + `npm-registry-fetch@8.1.4`: -* [`fd0a802ec`](https://github.com/npm/cli/commit/fd0a802ec468ec7b98d6c15934c355fef0e7ff60) [#550](https://github.com/npm/cli/pull/550) Fix cache location for `npm ci` ([@zhenyavinogradov](https://github.com/zhenyavinogradov)) -* [`4b30f3cca`](https://github.com/npm/cli/commit/4b30f3ccaebf50d6ab3bad130ff94827c017cc16) [#648](https://github.com/npm/cli/pull/648) fix(version): using 'allow-same-version', git commit --allow-empty and git tag -f ([@rhengles](https://github.com/rhengles)) + * Redact passwords from HTTP logs -### TESTING +* [`a5a6a516d`](https://github.com/npm/cli/commit/a5a6a516d16828c1375eaf41d04468d919df4a57) + `json-parse-even-better-errors@2.3.0`: -* [`e16f68d30`](https://github.com/npm/cli/commit/e16f68d30d59ce1ddde9fe62f7681b2c07fce84d) test(ci): add failing cache config test ([@ruyadorno](https://github.com/ruyadorno)) -* [`3f009fbf2`](https://github.com/npm/cli/commit/3f009fbf2c42f68c5127efecc6e22db105a74fe0) [#659](https://github.com/npm/cli/pull/659) test: fix bin-overwriting test on Windows ([@isaacs](https://github.com/isaacs)) -* [`43ae0791f`](https://github.com/npm/cli/commit/43ae0791f74f68e02850201a64a6af693657b241) [#601](https://github.com/npm/cli/pull/601) ci: Allow builds to run even if one fails ([@XhmikosR](https://github.com/XhmikosR)) -* [`4a669bee4`](https://github.com/npm/cli/commit/4a669bee4ac54c70adc6979d45cd0605b6dc33fd) [#603](https://github.com/npm/cli/pull/603) Remove the unused appveyor.yml ([@XhmikosR](https://github.com/XhmikosR)) -* [`9295046ac`](https://github.com/npm/cli/commit/9295046ac92bbe82f4d84e1ec90cc81d3b80bfc7) [#600](https://github.com/npm/cli/pull/600) ci: switch to `actions/checkout@v2` ([@XhmikosR](https://github.com/XhmikosR)) + * Adds support for indentation/newline formatting preservation -### DOCUMENTATION +* [`a14054558`](https://github.com/npm/cli/commit/a1405455843db1b14938596303b29fb3ad4f90f0) + `read-package-json-fast@1.2.1`: -* [`f2d770ac7`](https://github.com/npm/cli/commit/f2d770ac768ea84867772b90a3c9acbdd0c1cb6a) [#569](https://github.com/npm/cli/pull/569) fix netlify publish path config ([@claudiahdz](https://github.com/claudiahdz)) -* [`462cf0983`](https://github.com/npm/cli/commit/462cf0983dbc18a3d93f77212ca69f878060b2ec) [#627](https://github.com/npm/cli/pull/627) update gatsby dependencies ([@felixonmars](https://github.com/felixonmars)) -* [`6fb5dbb72`](https://github.com/npm/cli/commit/6fb5dbb7213c4c050c9a47a7d5131447b8b7dcc8) - [#532](https://github.com/npm/cli/pull/532) docs: clarify usage of global prefix ([@jgehrcke](https://github.com/jgehrcke)) + * Adds support for indentation/newline formatting preservation -## 6.13.4 (2019-12-11) +* [`f8603c8af`](https://github.com/npm/cli/commit/f8603c8affefc342d81c109e4676d498a8359b78) + `libnpmversion@1.0.4`: -## BUGFIXES + * Adds support for indentation/newline formatting preservation -* [`320ac9aee`](https://github.com/npm/cli/commit/320ac9aeeafd11bb693c53b31148b8d10c4165e8) - [npm/bin-links#12](https://github.com/npm/bin-links/pull/12) - [npm/gentle-fs#7](https://github.com/npm/gentle-fs/pull/7) - Do not remove global bin/man links inappropriately - ([@isaacs](https://github.com/isaacs)) +* [`9891fa71c`](https://github.com/npm/cli/commit/9891fa71c88f425bef8d881c3795e5823d732e1f) + `read-package-json@2.1.2`: -## DEPENDENCIES + * Adds support for indentation/newline formatting preservation -* [`52fd21061`](https://github.com/npm/cli/commit/52fd21061ff8b1a73429294620ffe5ebaaa60d3e) - `gentle-fs@2.3.0` - ([@isaacs](https://github.com/isaacs)) -* [`d06f5c0b0`](https://github.com/npm/cli/commit/d06f5c0b0611c43b6e70ded92af24fa5d83a0f48) - `bin-links@1.1.6` - ([@isaacs](https://github.com/isaacs)) +* [`b44768aac`](https://github.com/npm/cli/commit/b44768aace0e9c938ebd6d05a5de1cc4368e2d7d) + [#1662](https://github.com/npm/cli/issues/1662) + [#1693](https://github.com/npm/cli/issues/1693) + [#1690](https://github.com/npm/cli/issues/1690) + `@npmcli/arborist@0.0.17`: -## 6.13.3 (2019-12-09) - -### DEPENDENCIES - -* [`19ce061a2`](https://github.com/npm/cli/commit/19ce061a2ee165d8de862c8f0f733c222846b9e1) - `bin-links@1.1.5` Properly normalize, sanitize, and verify `bin` entries - in `package.json`. -* [`59c836aae`](https://github.com/npm/cli/commit/59c836aae8d0104a767e80c540b963c91774012a) - `npm-packlist@1.4.7` -* [`fb4ecd7d2`](https://github.com/npm/cli/commit/fb4ecd7d2810b0b4897daaf081a5e2f3f483b310) - `pacote@9.5.11` - * [`5f33040`](https://github.com/npm/pacote/commit/5f3304028b6985fd380fc77c4840ff12a4898301) - [#476](https://github.com/npm/cli/issues/476) - [npm/pacote#22](https://github.com/npm/pacote/issues/22) - [npm/pacote#14](https://github.com/npm/pacote/issues/14) fix: Do not - drop perms in git when not root ([isaacs](https://github.com/isaacs), - [@darcyclarke](https://github.com/darcyclarke)) - * [`6f229f7`](https://github.com/npm/pacote/6f229f78d9911b4734f0a19c6afdc5454034c759) - sanitize and normalize package bin field - ([isaacs](https://github.com/isaacs)) -* [`1743cb339`](https://github.com/npm/cli/commit/1743cb339767e86431dcd565c7bdb0aed67b293d) - `read-package-json@2.1.1` - - -## 6.13.2 (2019-12-03) - -### BUG FIXES - -* [`4429645b3`](https://github.com/npm/cli/commit/4429645b3538e1cda54d8d1b7ecb3da7a88fdd3c) - [#546](https://github.com/npm/cli/pull/546) - fix docs target typo - ([@richardlau](https://github.com/richardlau)) -* [`867642942`](https://github.com/npm/cli/commit/867642942bec69bb9ab71cff1914fb6a9fe67de8) - [#142](https://github.com/npm/cli/pull/142) - fix(packageRelativePath): fix 'where' for file deps - ([@larsgw](https://github.com/larsgw)) -* [`d480f2c17`](https://github.com/npm/cli/commit/d480f2c176e6976b3cca3565e4c108b599b0379b) - [#527](https://github.com/npm/cli/pull/527) - Revert "windows: Add preliminary WSL support for npm and npx" - ([@craigloewen-msft](https://github.com/craigloewen-msft)) -* [`e4b97962e`](https://github.com/npm/cli/commit/e4b97962e5fce0d49beb541ce5a0f96aee0525de) - [#504](https://github.com/npm/cli/pull/504) - remove unnecessary package.json read when reading shrinkwrap - ([@Lighting-Jack](https://github.com/Lighting-Jack)) -* [`1c65d26ac`](https://github.com/npm/cli/commit/1c65d26ac9f10ac0037094c207d216fbf0e969bf) - [#501](https://github.com/npm/cli/pull/501) - fix(fund): open url for string shorthand - ([@ruyadorno](https://github.com/ruyadorno)) -* [`ae7afe565`](https://github.com/npm/cli/commit/ae7afe56504dbffabf9f73d55b6dac1e3e9fed4a) - [#263](https://github.com/npm/cli/pull/263) - Don't log error message if git tagging is disabled - ([@woppa684](https://github.com/woppa684)) -* [`4c1b16f6a`](https://github.com/npm/cli/commit/4c1b16f6aecaf78956b9335734cfde2ac076ee11) - [#182](https://github.com/npm/cli/pull/182) - Warn the user that it is uninstalling npm-install - ([@Hoidberg](https://github.com/Hoidberg)) - -## 6.13.1 (2019-11-18) - -### BUG FIXES - -* [`938d6124d`](https://github.com/npm/cli/commit/938d6124d6d15d96b5a69d0ae32ef59fceb8ceab) - [#472](https://github.com/npm/cli/pull/472) - fix(fund): support funding string shorthand - ([@ruyadorno](https://github.com/ruyadorno)) -* [`b49c5535b`](https://github.com/npm/cli/commit/b49c5535b7c41729a8d167b035924c3c66b36de0) - [#471](https://github.com/npm/cli/pull/471) - should not publish tap-snapshot folder - ([@ruyadorno](https://github.com/ruyadorno)) -* [`3471d5200`](https://github.com/npm/cli/commit/3471d5200217bfa612b1a262e36c9c043a52eb09) - [#253](https://github.com/npm/cli/pull/253) - Add preliminary WSL support for npm and npx - ([@infinnie](https://github.com/infinnie)) -* [`3ef295f23`](https://github.com/npm/cli/commit/3ef295f23ee1b2300abf13ec19e935c47a455179) - [#486](https://github.com/npm/cli/pull/486) - print quick audit report for human output - ([@isaacs](https://github.com/isaacs)) + * Load root project `package.json` when running loadVirtual. + * Fetch metadata from registry when loading tree from outdated + package-lock.json file. This avoids a situation where a lockfile or + shrinkwrap from npm v5 would result in deleting dependencies on + install. + * Preserve `package.json` and `package-lock.json` formatting in all + places where these files are written. -### TESTING - -* [`dbbf977ac`](https://github.com/npm/cli/commit/dbbf977acd1e74bcdec859c562ea4a2bc0536442) - [#278](https://github.com/npm/cli/pull/278) - added workflow to trigger and run benchmarks - ([@mikemimik](https://github.com/mikemimik)) -* [`b4f5e3825`](https://github.com/npm/cli/commit/b4f5e3825535256aaada09c5e8f104570a3d96a4) - [#457](https://github.com/npm/cli/pull/457) - feat(docs): adding tests and updating docs to reflect changes in registry teams API. - ([@nomadtechie](https://github.com/nomadtechie)) -* [`454c7dd60`](https://github.com/npm/cli/commit/454c7dd60c78371bf606f11a17ed0299025bc37c) - [#456](https://github.com/npm/cli/pull/456) - fix git configs for git 2.23 and above - ([@isaacs](https://github.com/isaacs)) +* [`281da6fdc`](https://github.com/npm/cli/commit/281da6fdcda3fb3860b73ed35daa234ad228c363) + `tar@6.0.5` -### DOCUMENTATION +* [`1faa5b33d`](https://github.com/npm/cli/commit/1faa5b33dcc6d7e4eba1c0d85ad30cf0c237c9e1) + [#1655](https://github.com/npm/cli/issues/1655) show usage when + `help-search` finds no results -* [`b8c1576a4`](https://github.com/npm/cli/commit/b8c1576a448566397c721655b95fc90bf202b35a) [`30b013ae8`](https://github.com/npm/cli/commit/30b013ae8eacd04b1b8a41ce2ed0dd50c8ebae25) [`26c1b2ef6`](https://github.com/npm/cli/commit/26c1b2ef6be1595d28d935d35faa8ec72daae544) [`9f943a765`](https://github.com/npm/cli/commit/9f943a765faf6ebb8a442e862b808dbb630e018d) [`c0346b158`](https://github.com/npm/cli/commit/c0346b158fc25ab6ca9954d4dd78d9e62f573a41) [`8e09d5ad6`](https://github.com/npm/cli/commit/8e09d5ad67d4f142241193cecbce61c659389be3) [`4a2f551ee`](https://github.com/npm/cli/commit/4a2f551eeb3285f6f200534da33644789715a41a) [`87d67258c`](https://github.com/npm/cli/commit/87d67258c213d9ea9a49ce1804294a718f08ff13) [`5c3b32722`](https://github.com/npm/cli/commit/5c3b3272234764c8b4d2d798b69af077b5a529c7) [`b150eaeff`](https://github.com/npm/cli/commit/b150eaeff428180bfa03be53fd741d5625897758) [`7555a743c`](https://github.com/npm/cli/commit/7555a743ce4c3146d6245dd63f91503c7f439a6c) [`b89423e2f`](https://github.com/npm/cli/commit/b89423e2f6a09b290b15254e7ff7e8033b434d83) - [#463](https://github.com/npm/cli/pull/463) - [#285](https://github.com/npm/cli/pull/285) - [#268](https://github.com/npm/cli/pull/268) - [#232](https://github.com/npm/cli/pull/232) - [#485](https://github.com/npm/cli/pull/485) - [#453](https://github.com/npm/cli/pull/453) - docs cleanup: typos, styling and content - ([@claudiahdz](https://github.com/claudiahdz)) - ([@XhmikosR](https://github.com/XhmikosR)) - ([@mugli](https://github.com/mugli)) - ([@brettz9](https://github.com/brettz9)) - ([@mkotsollaris](https://github.com/mkotsollaris)) +* [`10fcff73a`](https://github.com/npm/cli/commit/10fcff73a3381ea5e6dcb03888679ae4b501d2f0) + [#1695](https://github.com/npm/cli/issues/1695) fix `pulseWhileDone` + promise handling -### DEPENDENCIES +* [`88e4241c5`](https://github.com/npm/cli/commit/88e4241c5d4f512a4e2b09d26fcdcc7f877e65ed) + [#1698](https://github.com/npm/cli/pull/1698) add lib/logout.js unit + tests ([@ruyadorno](https://github.com/ruyadorno)) -* [`661d86cd2`](https://github.com/npm/cli/commit/661d86cd229b14ddf687b7f25a66941a79d233e7) - `make-fetch-happen@5.0.2` +## v7.0.0-beta.5 (2020-08-18) + +* [`b718b0e28`](https://github.com/npm/cli/commit/b718b0e2844d9244cc63667f62ccf81864cc1092) + [#1657](https://github.com/npm/cli/pull/1657) display multiple versions + when using `--json` with `npm view` ([@claudiahdz](https://github.com/claudiahdz)) +* [`9e7cc42f6`](https://github.com/npm/cli/commit/9e7cc42f687b479d96d222b61f76b2a30c7e6507) + [#1071](https://github.com/npm/cli/pull/1071) migrate from `meant` to + `leven` ([@jamesgeorge007](https://github.com/jamesgeorge007)) +* [`85027f40c`](https://github.com/npm/cli/commit/85027f40ca5237bd750a5633104d12bcc248551c) + [#1664](https://github.com/npm/cli/pull/1664) refactor and add tests for + `npm adduser` ([@ruyadorno](https://github.com/ruyadorno)) +* [`6e03e5583`](https://github.com/npm/cli/commit/6e03e55833d50fd0f5b7824ed14b7e2b14f70eaf) + [#1672](https://github.com/npm/cli/pull/1672) refactor and add tests for + `npm audit` ([@claudiahdz](https://github.com/claudiahdz)) + +## v7.0.0-beta.4 (2020-08-11) + +Replace some environment variables that were excluded. This implements the +[amendment to RFC0021](https://github.com/npm/rfcs/pull/183). + +* [`631142f4a`](https://github.com/npm/cli/commit/631142f4a13959fbe02dc115fb6efa55a3368795) + `@npmcli/run-script@1.5.0` +* [`da95386ae`](https://github.com/npm/cli/commit/da95386aedb3f0c0cc51761bfa750b64ac0eabc9) + [#1650](https://github.com/npm/cli/pull/1650) + [#1652](https://github.com/npm/cli/pull/1652) + include booleans, skip already-set envs + +## v7.0.0-beta.3 (2020-08-10) + +Bring back support for `npm audit --production`, fix a minor `npm version` +annoyance, and track down a very serious issue where a project could be +blown away when it matches a meta-dep in the tree. + +* [`5fb217701`](https://github.com/npm/cli/commit/5fb217701c060e37a3fb4a2e985f80fb015157b9) + [#1641](https://github.com/npm/cli/issues/1641) `@npmcli/arborist@0.0.15` +* [`3598fe1f2`](https://github.com/npm/cli/commit/3598fe1f2dfe6c55221bbac8aaf21feab74a936a) + `@npmcli/arborist@0.0.16` Add support for `npm audit --production` +* [`8ba2aeaee`](https://github.com/npm/cli/commit/8ba2aeaeeb77718cb06fe577fdd56dcdcbfe9c52) + `libnpmversion@1.0.3` + +## v7.0.0-beta.2 (2020-08-07) + +New notification style for updates, and a working doctor. + +* [`cf2819210`](https://github.com/npm/cli/commit/cf2819210327952696346486002239f9fc184a3e) + [#1622](https://github.com/npm/cli/pull/1622) + Improve abbrevs for install and help +* [`d062b2c02`](https://github.com/npm/cli/commit/d062b2c02a4d6d5f1a274aa8eb9c5969ca6253db) + new npm-specific update-notifier implementation +* [`f6d468a3b`](https://github.com/npm/cli/commit/f6d468a3b4bef0b3cc134065d776969869fca51e) + update doctor command +* [`b8b4d77af`](https://github.com/npm/cli/commit/b8b4d77af836f8c49832dda29a0de1b3c2d39233) + [#1638](https://github.com/npm/cli/pull/1638) + Direct users to our GitHub issues instead of npm.community + +## v7.0.0-beta.1 (2020-08-05) + +Fix some issues found in the beta pubish process, and initial attempts to +use npm v7 with [citgm](https://github.com/nodejs/citgm/). + +* [`2c305e8b7`](https://github.com/npm/cli/commit/2c305e8b7bfa28b07812df74f46983fad2cb85b6) + output generated tarball filename +* [`0808328c9`](https://github.com/npm/cli/commit/0808328c93d9cd975837eeb53202ce3844e1cf70) + pack: set correct filename for scoped packages + ([@isaacs](https://github.com/isaacs)) +* [`cf27df035`](https://github.com/npm/cli/commit/cf27df035cfba4f859d14859229bb90841b8fda6) + `@npmcli/arborist@0.0.14` ([@isaacs](https://github.com/isaacs)) + +## v7.0.0-beta.0 (2020-08-04) + +Major refactoring and overhaul of, well, pretty much everything. Almost +all dependencies have been updated, many have been removed, and the entire +`Installer` class is moved into +[`@npmcli/arborist`](http://npm.im/@npmcli/arborist). + +### Some High-level Changes and Improvements + +- You can install GitHub pull requests by adding `#pull/` to the + git url. So it'd be something like `npm install + github:user/project#pull/123` to install PR number 123 of the + `user/project` git repo. You can of course also use this in + dependencies, or anywhere else dependency specifiers are found. +- Initial Workspaces support is added. If you `npm install` in a project + with a `workspaces` declaration, npm will install all your sub-projects' + dependencies as well, and link everything up proper. +- `npm exec` is added, to run any arbitrary command as if it was an npm + script. This is sort of like `npx`, which is also ported to use `npm + exec` under the hood. +- `npm audit` output is tightened up, and prettified. Audit can also now + fix a few more classes of problems, sends far less data over the wire, + and doesn't place blame on the wrong maintainers. (Technically this is a + breaking change if you depend on the specific audit output, but it's + also a big improvement!) +- `npm install` got faster. Like a lot faster. "So fast you'll think it's + broken" faster. `npm ls` got even fasterer. A lot of stuff sped up, is + what we're saying. +- Support has been dropped for Node.js versions less than v10. + +### On the "Breaking" in "Breaking Changes" + +The Semantic Versioning specification precisely defines what constitutes a +"breaking" change. In a nutshell, it's any change that causes a you to +change _your_ code in order to start using _our_ code. We hasten to point +this out, because a "breaking change" does not mean that something about +the update is "broken", necessarily. + +We're sure that some things likely _are_ broken in this beta, because beta +software, and a healthy pessimism about things. But nothing is "broken" on +purpose here, and if you find a bug, we'd love for you to [let us +know](https://github.com/npm/cli/issues). + +### Known Issues, and What's Missing From This Beta (Why Not GA?) + +It's beta software! + +#### Tests + +We have not yet gotten to 100% test coverage of the npm CLI codebase. As +such, there are almost certainly bugs lying in wait. We _do_ have 100% +test coverage of most of the commands, and all recently-updated +dependencies in the npm stack, so it's certainly more well-tested than any +version of npm before. + +#### Docs + +The documentation is incorrect and out of date in most places. Prior to a +GA release, we'll be going through all of our documentation with a +fine-toothed comb to minimize the lies that it tells. + +#### Error Messaging + +There are a few cases where this release will just say something failed, +and not give you as much help as we'd like. We know, and we'll fix that +prior to the GA 7.0.0 release. + +In particular, if you install a project that has conflicting +`peerDependencies` in the tree, it'll just say "Unable to resolve package +tree". Prior to GA release, it'll tell you how to fix it. (For the time +being, just run it again with `--legacy-peer-deps`, and that'll make it +operate like npm v6.) + +#### Audit Issue + +There is a known performance issue in some cases that we've identified +where `npm audit` can spin wildly out of control like a dancer gripped by a +fever, heating up your laptop with fires of passion and CPU work. This +happens when a vulnerability is in a tree with a _lot_ of cross-linked +dependencies that all depend on one another. + +We have a fix for it, but if you run into this issue, you can run with +`--no-audit` to tell npm to chill out a little bit. + +That's about it! It's ready to use, and you should try it out. + +Now on to the list of **BREAKING CHANGES**! + +### Programmatic Usage + +- [RFC + 20](https://github.com/npm/rfcs/blob/latest/accepted/0020-npm-option-handling.md) + The CLI and its dependencies no longer use the `figgy-pudding` library + for configs. Configuration is done using a flat plain old JavaScript + object. +- The `lib/fetch-package-metadata.js` module is removed. Use + [`pacote`](http://npm.im/pacote) to fetch package metadata. +- [`@npmcli/arborist`](http://npm.im/@npmcli/arborist) should be used to do + most things programmatically involving dependency trees. +- The `onload-script` option is no longer supported. +- The `log-stream` option is no longer supported. +- `npm.load()` MUST be called with two arguments (the parsed cli options + and a callback). +- `npm.root` alias for `npm.dir` removed. +- The `package.json` in npm now defines an `exports` field, making it no + longer possible to `require()` npm's internal modules. (This was always + a bad idea, but now it won't work.) + +### All Registry Interactions + +The following affect all commands that contact the npm registry. + +- `referer` header no longer sent +- `npm-command` header added + +### All Lifecycle Scripts + +The environment for lifecycle scripts (eg, build scripts, `npm test`, etc.) +has changed. + +- [RFC + 21](https://github.com/npm/rfcs/blob/latest/accepted/0021-reduce-lifecycle-script-environment.md) + Environment no longer includes `npm_package_*` fields, or `npm_config_*` + fields for default configs. `npm_package_json`, `npm_package_integrity`, + `npm_package_resolved`, and `npm_command` environment variables added. + + (NB: this [will change a bit prior to a `v7.0.0` GA + release](https://github.com/npm/rfcs/pull/183)) + +- [RFC + 22](https://github.com/npm/rfcs/blob/latest/accepted/0022-quieter-install-scripts.md) + Scripts run during the normal course of installation are silenced unless + they exit in error (ie, with a signal or non-zero exit status code), and + are for a non-optional dependency. + +- [RFC + 24](https://github.com/npm/rfcs/blob/latest/accepted/0024-npm-run-traverse-directory-tree.md) + `PATH` environment variable includes all `node_modules/.bin` folders, + even if found outside of an existing `node_modules` folder hierarchy. + +- The `user`, `group`, `uid`, `gid`, and `unsafe-perms` configurations are + no longer relevant. When npm is run as root, scripts are always run with + the effective `uid` and `gid` of the working directory owner. + +- Commands that just run a single script (`npm test`, `npm start`, `npm + stop`, and `npm restart`) will now run their script even if + `--ignore-scripts` is set. Prior to the GA v7.0.0 release, [they will + _not_ run the pre/post scripts](https://github.com/npm/rfcs/pull/185), + however. (So, it'll be possible to run `npm test --ignore-scripts` to + run your test but not your linter, for example.) + +### npx + +The `npx` binary was rewritten in npm v7, and the standalone `npx` package +deprecated when v7.0.0 hits GA. `npx` uses the new `npm exec` command +instead of a separate argument parser and install process, with some +affordances to maintain backwards compatibility with the arguments it +accepted in previous versions. + +This resulted in some shifts in its functionality: + +- Any `npm` config value may be provided. +- To prevent security and user-experience problems from mistyping package + names, `npx` prompts before installing anything. Suppress this + prompt with the `-y` or `--yes` option. +- The `--no-install` option is deprecated, and will be converted to `--no`. +- Shell fallback functionality is removed, as it is not advisable. +- The `-p` argument is a shorthand for `--parseable` in npm, but shorthand + for `--package` in npx. This is maintained, but only for the `npx` + executable. (Ie, running `npm exec -p foo` will be different from + running `npx -p foo`.) +- The `--ignore-existing` option is removed. Locally installed bins are + always present in the executed process `PATH`. +- The `--npm` option is removed. `npx` will always use the `npm` it ships + with. +- The `--node-arg` and `-n` options are removed. +- The `--always-spawn` option is redundant, and thus removed. +- The `--shell` option is replaced with `--script-shell`, but maintained + in the `npx` executable for backwards compatibility. + +We do intend to continue supporting the `npx` that npm ships; just not the +`npm install -g npx` library that is out in the wild today. + +### Files On Disk + +- [RFC + 13](https://github.com/npm/rfcs/blob/latest/accepted/0013-no-package-json-_fields.md) + Installed `package.json` files no longer are mutated to include extra + metadata. (This extra metadata is stored in the lockfile.) +- `package-lock.json` is updated to a newer format, using + `"lockfileVersion": 2`. This format is backwards-compatible with npm CLI + versions using `"lockfileVersion": 1`, but older npm clients will print a + warning about the version mismatch. +- `yarn.lock` files used as source of package metadata and resolution + guidance, if available. (Prior to v7, they were ignored.) + +### Dependency Resolution + +These changes affect `install`, `ci`, `install-test`, `install-ci-test`, +`update`, `prune`, `dedupe`, `uninstall`, `link`, and `audit fix`. + +- [RFC + 25](https://github.com/npm/rfcs/blob/latest/accepted/0025-install-peer-deps.md) + `peerDependencies` are installed by default. This behavior can be + disabled by setting the `legacy-peer-deps` configuration flag. + + **BREAKING CHANGE**: this can cause some packages to not be + installable, if they have unresolveable peer dependency conflicts. + While the correct solution is to fix the conflict, this was not forced + upon users for several years, and some have come to rely on this lack + of correctness. Use the `--legacy-peer-deps` config flag if impacted. -## 6.13.0 (2019-11-05) +- [RFC + 23](https://github.com/npm/rfcs/blob/latest/accepted/0023-acceptDependencies.md) + Support for `acceptDependencies` is added. This can result in dependency + resolutions that previous versions of npm will incorrectly flag as invalid. -### NEW FEATURES +- Git dependencies on known git hosts (GitHub, BitBucket, etc.) will + always attempt to fetch package contents from the relevant tarball CDNs + if possible, falling back to `git+ssh` for private packages. `resolved` + value in `package-lock.json` will always reflect the `git+ssh` url value. + Saved value in `package.json` dependencies will always reflect the + canonical shorthand value. + +- Support for the `--link` flag (to install a link to a globall-installed + copy of a module if present, otherwise install locally) has been removed. + Local installs are always local, and `npm link ` must be used + explicitly if desired. + +- Installing a dependency with the same name as the root project no longer + requires `--force`. (That is, the `ENOSELF` error is removed.) + +### Workspaces -* [`4414b06d9`](https://github.com/npm/cli/commit/4414b06d944c56bee05ccfb85260055a767ee334) - [#273](https://github.com/npm/cli/pull/273) - add fund command - ([@ruyadorno](https://github.com/ruyadorno)) +- [RFC + 26](https://github.com/npm/rfcs/blob/latest/accepted/0026-workspaces.md) + First phase of `workspaces` support is added. This changes npm's + behavior when a root project's `package.json` file contains a + `workspaces` field. -### DOCUMENTATION +### `npm update` -* [`ae4c74d04`](https://github.com/npm/cli/commit/ae4c74d04f820a0255a92bdfe77ecf97af134fae) - [#274](https://github.com/npm/cli/pull/274) - migrate existing docs to gatsby - ([@claudiahdz](https://github.com/claudiahdz)) -* [`4ff1bb180`](https://github.com/npm/cli/commit/4ff1bb180b1db8c72e51b3d57bd4e268b738e049) - [#277](https://github.com/npm/cli/pull/277) - updated documentation copy - ([@oletizi](https://github.com/oletizi)) - -### BUG FIXES - -* [`e4455409f`](https://github.com/npm/cli/commit/e4455409fe6fe9c198b250b488129171f0b4624a) - [#281](https://github.com/npm/cli/pull/281) - delete ps1 files on package removal - ([@NoDocCat](https://github.com/NoDocCat)) -* [`cd14d4701`](https://github.com/npm/cli/commit/cd14d47014e8c96ffd6a18791e8752028b19d637) - [#279](https://github.com/npm/cli/pull/279) - update supported node list to remove v6.0, v6.1, v9.0 - v9.2 - ([@ljharb](https://github.com/ljharb)) - -### DEPENDENCIES - -* [`a37296b20`](https://github.com/npm/cli/commit/a37296b20ca3e19c2bbfa78fedcfe695e03fda69) - `pacote@9.5.9` -* [`d3cb3abe8`](https://github.com/npm/cli/commit/d3cb3abe8cee54bd2624acdcf8043932ef0d660a) - `read-cmd-shim@1.0.5` - -### TESTING - -* [`688cd97be`](https://github.com/npm/cli/commit/688cd97be94ca949719424ff69ff515a68c5caba) - [#272](https://github.com/npm/cli/pull/272) - use github actions for CI - ([@JasonEtco](https://github.com/JasonEtco)) -* [`9a2d8af84`](https://github.com/npm/cli/commit/9a2d8af84f7328f13d8f578cf4b150b9d5f09517) - [#240](https://github.com/npm/cli/pull/240) - Clean up some flakiness and inconsistency - ([@isaacs](https://github.com/isaacs)) +- [RFC + 19](https://github.com/npm/rfcs/blob/latest/accepted/0019-remove-update-depth-option.md) + Update all dependencies when `npm update` is run without any arguments. + As it is no longer relevant, `--depth` config flag removed from `npm + update`. -## 6.12.1 (2019-10-29) - -### BUG FIXES - -* [`6508e833d`](https://github.com/npm/cli/commit/6508e833df35a3caeb2b496f120ce67feff306b6) - [#269](https://github.com/npm/cli/pull/269) - add node v13 as a supported version - ([@ljharb](https://github.com/ljharb)) -* [`b6588a8f7`](https://github.com/npm/cli/commit/b6588a8f74fb8b1ad103060b73c4fd5174b1d1f6) - [#265](https://github.com/npm/cli/pull/265) - Fix regression in lockfile repair for sub-deps - ([@feelepxyz](https://github.com/feelepxyz)) -* [`d5dfe57a1`](https://github.com/npm/cli/commit/d5dfe57a1d810fe7fd64edefc976633ee3a4da53) - [#266](https://github.com/npm/cli/pull/266) - resolve circular dependency in pack.js - ([@addaleax](https://github.com/addaleax)) - -### DEPENDENCIES - -* [`73678bb59`](https://github.com/npm/cli/commit/73678bb590a8633c3bdbf72e08f1279f9e17fd28) - `chownr@1.1.3` -* [`4b76926e2`](https://github.com/npm/cli/commit/4b76926e2058ef30ab1d5e2541bb96d847653417) - `graceful-fs@4.2.3` -* [`c691f36a9`](https://github.com/npm/cli/commit/c691f36a9c108b6267859fe61e4a38228b190c17) - `libcipm@4.0.7` -* [`5e1a14975`](https://github.com/npm/cli/commit/5e1a14975311bfdc43df8e1eb317ae5690ee580c) - `npm-packlist@1.4.6` -* [`c194482d6`](https://github.com/npm/cli/commit/c194482d65ee81a5a0a6281c7a9f984462286c56) - `npm-registry-fetch@4.0.2` -* [`bc6a8e0ec`](https://github.com/npm/cli/commit/bc6a8e0ec966281e49b1dc66f9c641ea661ab7a6) - `tar@4.4.1` -* [`4dcca3cbb`](https://github.com/npm/cli/commit/4dcca3cbb161da1f261095d9cdd26e1fbb536a8d) - `uuid@3.3.3` - -## 6.12.0 (2019-10-08): - -Now `npm ci` runs prepare scripts for git dependencies, and respects the -`--no-optional` argument. Warnings for `engine` mismatches are printed -again. Various other fixes and cleanups. - -### BUG FIXES - -* [`890b245dc`](https://github.com/npm/cli/commit/890b245dc1f609590d8ab993fac7cf5a37ed46a5) - [#252](https://github.com/npm/cli/pull/252) ci: add dirPacker to options - ([@claudiahdz](https://github.com/claudiahdz)) -* [`f3299acd0`](https://github.com/npm/cli/commit/f3299acd0b4249500e940776aca77cc6c0977263) - [#257](https://github.com/npm/cli/pull/257) - [npm.community#4792](https://npm.community/t/engines-and-engines-strict-ignored/4792) - warn message on engine mismatch - ([@ruyadorno](https://github.com/ruyadorno)) -* [`bbc92fb8f`](https://github.com/npm/cli/commit/bbc92fb8f3478ff67071ebaff551f01c1ea42ced) - [#259](https://github.com/npm/cli/pull/259) - [npm.community#10288](https://npm.community/t/npm-token-err-figgypudding-options-cannot-be-modified-use-concat-instead/10288) - Fix figgyPudding error in `npm token` - ([@benblank](https://github.com/benblank)) -* [`70f54dcb5`](https://github.com/npm/cli/commit/70f54dcb5693b301c6b357922b7e8d16b57d8b00) - [#241](https://github.com/npm/cli/pull/241) doctor: Make OK more - consistent ([@gemal](https://github.com/gemal)) - -### FEATURES - -* [`ed993a29c`](https://github.com/npm/cli/commit/ed993a29ccf923425317c433844d55dbea2f23ee) - [#249](https://github.com/npm/cli/pull/249) Add CI environment variables - to user-agent ([@isaacs](https://github.com/isaacs)) -* [`f6b0459a4`](https://github.com/npm/cli/commit/f6b0459a466a2c663dbd549cdc331e7732552dca) - [#248](https://github.com/npm/cli/pull/248) Add option to save - package-lock without formatting Adds a new config - `--format-package-lock`, which defaults to true. - ([@bl00mber](https://github.com/bl00mber)) - -### DEPENDENCIES - -* [`0ca063c5d`](https://github.com/npm/cli/commit/0ca063c5dc961c4aa17373f4b33fb54c51c8c8d6) - `npm-lifecycle@3.1.4`: - - fix: filter functions and undefined out of makeEnv - ([@isaacs](https://github.com/isaacs)) -* [`5df6b0ea2`](https://github.com/npm/cli/commit/5df6b0ea2e3106ba65bba649cc8d7f02f4738236) - `libcipm@4.0.4`: - - fix: pack git directories properly - ([@claudiahdz](https://github.com/claudiahdz)) - - respect no-optional argument - ([@cruzdanilo](https://github.com/cruzdanilo)) -* [`7e04f728c`](https://github.com/npm/cli/commit/7e04f728cc4cd4853a8fc99e2df0a12988897589) - `tar@4.4.12` -* [`5c380e5a3`](https://github.com/npm/cli/commit/5c380e5a33d760bb66a4285b032ae5f50af27199) - `stringify-package@1.0.1` ([@isaacs](https://github.com/isaacs)) -* [`62f2ca692`](https://github.com/npm/cli/commit/62f2ca692ac0c0467ef4cf74f91777a5175258c4) - `node-gyp@5.0.5` ([@isaacs](https://github.com/isaacs)) -* [`0ff0ea47a`](https://github.com/npm/cli/commit/0ff0ea47a8840dd7d952bde7f7983a5016cda8ea) - `npm-install-checks@3.0.2` ([@isaacs](https://github.com/isaacs)) -* [`f46edae94`](https://github.com/npm/cli/commit/f46edae9450b707650a0efab09aa1e9295a18070) - `hosted-git-info@2.8.5` ([@isaacs](https://github.com/isaacs)) - -### TESTING - -* [`44a2b036b`](https://github.com/npm/cli/commit/44a2b036b34324ec85943908264b2e36de5a9435) - [#262](https://github.com/npm/cli/pull/262) fix root-ownership race - conditions in meta-test ([@isaacs](https://github.com/isaacs)) - -## 6.11.3 (2019-09-03): - -Fix npm ci regressions and npm outdated depth. - -### BUG FIXES - -* [`235ed1d28`](https://github.com/npm/cli/commit/235ed1d2838ef302bb995e183980209d16c51b9b) - [#239](https://github.com/npm/cli/pull/239) - Don't override user specified depth in outdated - Restores ability to update packages using `--depth` as suggested by `npm audit`. - ([@G-Rath](https://github.com/G-Rath)) -* [`1fafb5151`](https://github.com/npm/cli/commit/1fafb51513466cd793866b576dfea9a8963a3335) - [#242](https://github.com/npm/cli/pull/242) - [npm.community#9586](https://npm.community/t/6-11-1-some-dependencies-are-no-longer-being-installed/9586/4) - Revert "install: do not descend into directory deps' child modules" - ([@isaacs](https://github.com/isaacs)) -* [`cebf542e6`](https://github.com/npm/cli/commit/cebf542e61dcabdd2bd3b876272bf8eebf7d01cc) - [#243](https://github.com/npm/cli/pull/243) - [npm.community#9720](https://npm.community/t/6-11-2-npm-ci-installs-package-with-wrong-permissions/9720) - ci: pass appropriate configs for file/dir modes - ([@isaacs](https://github.com/isaacs)) +### `npm outdated` -### DEPENDENCIES +- [RFC + 27](https://github.com/npm/rfcs/blob/latest/accepted/0027-remove-depth-outdated.md) + Remove `--depth` config from `npm outdated`. Only top-level dependencies + are shown, unless `--all` config option is set. -* [`e5fbb7ed1`](https://github.com/npm/cli/commit/e5fbb7ed1fc7ef5c6ca4790e2d0dc441e0ac1596) - `read-cmd-shim@1.0.4` - ([@claudiahdz](https://github.com/claudiahdz)) -* [`23ce65616`](https://github.com/npm/cli/commit/23ce65616c550647c586f7babc3c2f60115af2aa) - `npm-pick-manifest@3.0.2` - ([@claudiahdz](https://github.com/claudiahdz)) +### `npm adduser`, `npm login` -## 6.11.2 (2019-08-22): +- The `--sso` options are deprecated, and will print a warning. -Fix a recent Windows regression, and two long-standing Windows bugs. Also, -get CI running on Windows, so these things are less likely in the future. +### `npm audit` -### DEPENDENCIES +- Output and data structure is significantly refactored to call attention + to issues, identify classes of fixes not previously available, and + remove extraneous data not used for any purpose. -* [`9778a1b87`](https://github.com/npm/cli/commit/9778a1b878aaa817af6e99385e7683c2a389570d) - `cmd-shim@3.0.3`: Fix regression where shims fail to preserve exit code - ([@isaacs](https://github.com/isaacs)) -* [`bf93e91d8`](https://github.com/npm/cli/commit/bf93e91d879c816a055d5913e6e4210d7299f299) - `npm-package-arg@6.1.1`: Properly handle git+file: urls on Windows when a - drive letter is included. ([@isaacs](https://github.com/isaacs)) + **BREAKING CHANGE**: Any tools consuming the output of `npm audit` will + almost certainly need to be updated, as this has changed significantly, + both in the readable and `--json` output styles. -### BUGFIXES +### `npm dedupe` -* [`6cc4cc66f`](https://github.com/npm/cli/commit/6cc4cc66f1fb050dc4113e35cab59197fd48e04a) - escape args properly on Windows Bash Despite being bash, Node.js running - on windows git mingw bash still executes child processes using cmd.exe. - As a result, arguments in this environment need to be escaped in the - style of cmd.exe, not bash. ([@isaacs](https://github.com/isaacs)) +- Performs a full dependency tree reification to disk. As a result, `npm + dedupe` can cause missing or invalid packages to be installed or updated, + though it will only do this if required by the stated dependency + semantics. -### TESTS +- Note that the `--prefer-dedupe` flag has been added, so that you may + install in a maximally deduplicated state from the outset. -* [`291aba7b8`](https://github.com/npm/cli/commit/291aba7b821e247b96240b1ec037310ead69a594) - make tests pass on Windows ([@isaacs](https://github.com/isaacs)) -* [`fea3a023a`](https://github.com/npm/cli/commit/fea3a023a80863f32a5f97f5132401b1a16161b8) - travis: run tests on Windows as well - ([@isaacs](https://github.com/isaacs)) +### `npm fund` -## 6.11.1 (2019-08-20): - -Fix a regression for windows command shim syntax. - -* [`37db29647`](https://github.com/npm/cli/commit/37db2964710c80003604b7e3c1527d17be7ed3d0) - `cmd-shim@3.0.2` ([@isaacs](https://github.com/isaacs)) - -## v6.11.0 (2019-08-20): - -A few meaty bugfixes, and introducing `peerDependenciesMeta`. - -### FEATURES - -* [`a12341088`](https://github.com/npm/cli/commit/a12341088820c0e7ef6c1c0db3c657f0c2b3943e) - [#224](https://github.com/npm/cli/pull/224) Implements - peerDependenciesMeta ([@arcanis](https://github.com/arcanis)) -* [`2f3b79bba`](https://github.com/npm/cli/commit/2f3b79bbad820fd4a398aa494b19f79b7fd520a1) - [#234](https://github.com/npm/cli/pull/234) add new forbidden 403 error - code ([@claudiahdz](https://github.com/claudiahdz)) - -### BUGFIXES - -* [`24acc9fc8`](https://github.com/npm/cli/commit/24acc9fc89d99d87cc66206c6c6f7cdc82fbf763) - and - [`45772af0d`](https://github.com/npm/cli/commit/45772af0ddca54b658cb2ba2182eec26d0a4729d) - [#217](https://github.com/npm/cli/pull/217) - [npm.community#8863](https://npm.community/t/installing-the-same-module-under-multiple-relative-paths-fails-on-linux/8863) - [npm.community#9327](https://npm.community/t/reinstall-breaks-after-npm-update-to-6-10-2/9327,) - do not descend into directory deps' child modules, fix shrinkwrap files - that inappropriately list child nodes of symlink packages - ([@isaacs](https://github.com/isaacs) and - [@salomvary](https://github.com/salomvary)) -* [`50cfe113d`](https://github.com/npm/cli/commit/50cfe113da5fcc59c1d99b0dcf1050ace45803c7) - [#229](https://github.com/npm/cli/pull/229) fixed typo in semver doc - ([@gall0ws](https://github.com/gall0ws)) -* [`e8fb2a1bd`](https://github.com/npm/cli/commit/e8fb2a1bd9785e0092e9926f4fd65ad431e38452) - [#231](https://github.com/npm/cli/pull/231) Fix spelling mistakes in - CHANGELOG-3.md ([@XhmikosR](https://github.com/XhmikosR)) -* [`769d2e057`](https://github.com/npm/cli/commit/769d2e057daf5a2cbfe0ce86f02550e59825a691) - [npm/uid-number#7](https://github.com/npm/uid-number/issues/7) Better - error on invalid `--user`/`--group` configs. This addresses the issue - when people fail to install binary packages on Docker and other - environments where there is no 'nobody' user. - ([@isaacs](https://github.com/isaacs)) -* [`8b43c9624`](https://github.com/npm/cli/commit/8b43c962498c8e2707527e4fca442d7a4fa51595) - [nodejs/node#28987](https://github.com/nodejs/node/issues/28987) - [npm.community#6032](https://npm.community/t/npm-ci-doesnt-respect-npmrc-variables/6032) - [npm.community#6658](https://npm.community/t/npm-ci-doesnt-fill-anymore-the-process-env-npm-config-cache-variable-on-post-install-scripts/6658) - [npm.community#6069](https://npm.community/t/npm-ci-does-not-compile-native-dependencies-according-to-npmrc-configuration/6069) - [npm.community#9323](https://npm.community/t/npm-6-9-x-not-passing-environment-to-node-gyp-regression-from-6-4-x/9323/2) - Fix the regression where random config values in a .npmrc file are not - passed to lifecycle scripts, breaking build processes which rely on them. - ([@isaacs](https://github.com/isaacs)) -* [`8b85eaa47`](https://github.com/npm/cli/commit/8b85eaa47da3abaacc90fe23162a68cc6e1f0404) - save files with inferred ownership rather than relying on `SUDO_UID` and - `SUDO_GID`. ([@isaacs](https://github.com/isaacs)) -* [`b7f6e5f02`](https://github.com/npm/cli/commit/b7f6e5f0285515087b4614d81db17206524c0fdb) - Infer ownership of shrinkwrap files - ([@isaacs](https://github.com/isaacs)) -* [`54b095d77`](https://github.com/npm/cli/commit/54b095d77b3b131622b3cf4cb5c689aa2dd10b6b) - [#235](https://github.com/npm/cli/pull/235) Add spec to dist-tag remove - function ([@theberbie](https://github.com/theberbie)) +- Human readable output updated, reinstating depth level to the printed + output. -### DEPENDENCIES +### `npm ls` -* [`dc8f9e52f`](https://github.com/npm/cli/commit/dc8f9e52f0bb107c0a6b20cc0c97cbc3b056c1b3) - `pacote@9.5.7`: Infer the ownership of all unpacked files in - `node_modules`, so that we never have user-owned files in root-owned - folders, or root-owned files in user-owned folders. - ([@isaacs](https://github.com/isaacs)) -* [`bb33940c3`](https://github.com/npm/cli/commit/bb33940c32aad61704084e61ebd1bd8e7cacccc8) - `cmd-shim@3.0.0`: - * [`9c93ac3`](https://github.com/npm/cmd-shim/commit/9c93ac39e95b0d6ae852e842e4c5dba5e19687c2) - [#2](https://github.com/npm/cmd-shim/pull/2) - [npm#3380](https://github.com/npm/npm/issues/3380) Handle environment - variables properly ([@basbossink](https://github.com/basbossink)) - * [`2d277f8`](https://github.com/npm/cmd-shim/commit/2d277f8e84d45401747b0b9470058f168b974ad5) - [#25](https://github.com/npm/cmd-shim/pull/25) - [#36](https://github.com/npm/cmd-shim/pull/36) - [#35](https://github.com/npm/cmd-shim/pull/35) Fix 'no shebang' case by - always providing `$basedir` in shell script - ([@igorklopov](https://github.com/igorklopov)) - * [`adaf20b`](https://github.com/npm/cmd-shim/commit/adaf20b7fa2c09c2111a2506c6a3e53ed0831f88) - [#26](https://github.com/npm/cmd-shim/pull/26) Fix `$*` causing an - error when arguments contain parentheses - ([@satazor](https://github.com/satazor)) - * [`49f0c13`](https://github.com/npm/cmd-shim/commit/49f0c1318fd384e0031c3fd43801f0e22e1e555f) - [#30](https://github.com/npm/cmd-shim/pull/30) Fix paths for MSYS/MINGW - bash ([@dscho](https://github.com/dscho)) - * [`51a8af3`](https://github.com/npm/cmd-shim/commit/51a8af30990cb072cb30d67fc1b564b14746bba9) - [#34](https://github.com/npm/cmd-shim/pull/34) Add proper support for - PowerShell ([@ExE-Boss](https://github.com/ExE-Boss)) - * [`4c37e04`](https://github.com/npm/cmd-shim/commit/4c37e048dee672237e8962fdffca28e20e9f976d) - [#10](https://github.com/npm/cmd-shim/issues/10) Work around quoted - batch file names ([@isaacs](https://github.com/isaacs)) -* [`a4e279544`](https://github.com/npm/cli/commit/a4e279544f7983e0adff1e475e3760f1ea85825a) - `npm-lifecycle@3.1.3` ([@isaacs](https://github.com/isaacs)): - * fail properly if `uid-number` raises an error -* [`7086a1809`](https://github.com/npm/cli/commit/7086a1809bbfda9be81344b3949c7d3ac687ffc4) - `libcipm@4.0.3` ([@isaacs](https://github.com/isaacs)) -* [`8845141f9`](https://github.com/npm/cli/commit/8845141f9d7827dae572c8cf26f2c775db905bd3) - `read-package-json@2.1.0` ([@isaacs](https://github.com/isaacs)) -* [`51c028215`](https://github.com/npm/cli/commit/51c02821575d80035ebe853492d110db11a7d1b9) - `bin-links@1.1.3` ([@isaacs](https://github.com/isaacs)) -* [`534a5548c`](https://github.com/npm/cli/commit/534a5548c9ebd59f0dd90e9ccca148ed8946efa6) - `read-cmd-shim@1.0.3` ([@isaacs](https://github.com/isaacs)) -* [`3038f2fd5`](https://github.com/npm/cli/commit/3038f2fd5b1d7dd886ee72798241d8943690f508) - `gentle-fs@2.2.1` ([@isaacs](https://github.com/isaacs)) -* [`a609a1648`](https://github.com/npm/cli/commit/a609a16489f76791697d270b499fd4949ab1f8c3) - `graceful-fs@4.2.2` ([@isaacs](https://github.com/isaacs)) -* [`f0346f754`](https://github.com/npm/cli/commit/f0346f75490619a81b310bfc18646ae5ae2e0ea4) - `cacache@12.0.3` ([@isaacs](https://github.com/isaacs)) -* [`ca9c615c8`](https://github.com/npm/cli/commit/ca9c615c8cff5c7db125735eb09f84d912d18694) - `npm-pick-manifest@3.0.0` ([@isaacs](https://github.com/isaacs)) -* [`b417affbf`](https://github.com/npm/cli/commit/b417affbf7133dc7687fd809e4956a43eae3438a) - `pacote@9.5.8` ([@isaacs](https://github.com/isaacs)) - -### TESTS - -* [`b6df0913c`](https://github.com/npm/cli/commit/b6df0913ca73246f1fa6cfa0e81e34ba5f2b6204) - [#228](https://github.com/npm/cli/pull/228) Proper handing of - /usr/bin/node lifecycle-path test - ([@olivr70](https://github.com/olivr70)) -* [`aaf98e88c`](https://github.com/npm/cli/commit/aaf98e88c78fd6c850d0a3d3ee2f61c02f63bc8c) - `npm-registry-mock@1.3.0` ([@isaacs](https://github.com/isaacs)) - -## v6.10.3 (2019-08-06): - -### BUGFIXES - -* [`27cccfbda`](https://github.com/npm/cli/commit/27cccfbdac8526cc807b07f416355949b1372a9b) - [#223](https://github.com/npm/cli/pull/223) vulns → vulnerabilities in - npm audit output ([@sapegin](https://github.com/sapegin)) -* [`d5e865eb7`](https://github.com/npm/cli/commit/d5e865eb79329665a927cc2767b4395c03045dbb) - [#222](https://github.com/npm/cli/pull/222) - [#226](https://github.com/npm/cli/pull/226) install, doctor: don't crash - if registry unset ([@dmitrydvorkin](https://github.com/dmitrydvorkin), - [@isaacs](https://github.com/isaacs)) -* [`5b3890226`](https://github.com/npm/cli/commit/5b389022652abeb0e1c278a152550eb95bc6c452) - [#227](https://github.com/npm/cli/pull/227) - [npm.community#9167](https://npm.community/t/npm-err-cb-never-called-permission-denied/9167/5) - Handle unhandledRejections, tell user what to do when encountering an - `EACCES` error in the cache. ([@isaacs](https://github.com/isaacs)) - -### DEPENDENCIES - -* [`77516df6e`](https://github.com/npm/cli/commit/77516df6eac94a6d7acb5e9ca06feaa0868d779b) - `licensee@7.0.3` ([@isaacs](https://github.com/isaacs)) -* [`ceb993590`](https://github.com/npm/cli/commit/ceb993590e4e376a9a78264ce7bb4327fbbb37fe) - `query-string@6.8.2` ([@isaacs](https://github.com/isaacs)) -* [`4050b9189`](https://github.com/npm/cli/commit/4050b91898c60e9b22998cf82b70b9b822de592a) - `hosted-git-info@2.8.2` - * [#46](https://github.com/npm/hosted-git-info/issues/46) - [#43](https://github.com/npm/hosted-git-info/issues/43) - [#47](https://github.com/npm/hosted-git-info/pull/47) - [#44](https://github.com/npm/hosted-git-info/pull/44) Add support for - GitLab subgroups ([@mterrel](https://github.com/mterrel), - [@isaacs](https://github.com/isaacs), - [@ybiquitous](https://github.com/ybiquitous)) - * [`3b1d629`](https://github.com/npm/hosted-git-info/commit/3b1d629) - [#48](https://github.com/npm/hosted-git-info/issues/48) fix http - protocol using sshurl by default - ([@fengmk2](https://github.com/fengmk2)) - * [`5d4a8d7`](https://github.com/npm/hosted-git-info/commit/5d4a8d7) - ignore noCommittish on tarball url generation - ([@isaacs](https://github.com/isaacs)) - * [`1692435`](https://github.com/npm/hosted-git-info/commit/1692435) - use gist tarball url that works for anonymous gists - ([@isaacs](https://github.com/isaacs)) - * [`d5cf830`](https://github.com/npm/hosted-git-info/commit/d5cf8309be7af884032616c63ea302ce49dd321c) - Do not allow invalid gist urls ([@isaacs](https://github.com/isaacs)) - * [`e518222`](https://github.com/npm/hosted-git-info/commit/e5182224351183ce619dd5ef00019ae700ed37b7) - Use LRU cache to prevent unbounded memory consumption - ([@iarna](https://github.com/iarna)) - -## v6.10.2 (2019-07-23): - -tl;dr - Fixes several issues with the cache when npm is run as `sudo` on -Unix systems. - -### TESTING - -* [`2a78b96f8`](https://github.com/npm/cli/commit/2a78b96f830bbd834720ccc9eacccc54915ae6f7) - check test cache for root-owned files - ([@isaacs](https://github.com/isaacs)) -* [`108646ebc`](https://github.com/npm/cli/commit/108646ebc12f3eeebaa0a45884c45991a45e57e4) - run sudo tests on Travis-CI ([@isaacs](https://github.com/isaacs)) -* [`cf984e946`](https://github.com/npm/cli/commit/cf984e946f453cbea2fcc7a59608de3f24ab74c3) - set --no-esm tap flag ([@isaacs](https://github.com/isaacs)) -* [`8e0a3100d`](https://github.com/npm/cli/commit/8e0a3100dffb3965bb3dc4240e82980dfadf2f3c) - add script to run tests and leave fixtures for inspection and debugging - ([@isaacs](https://github.com/isaacs)) +- Extraneous dependencies are listed based on their location in the + `node_modules` tree. +- `npm ls` only prints the first level of dependencies by default. You can + make it print more of the tree by using `--depth=` to set a specific + depth, or `--all` to print all of them. -### BUGFIXES +### `npm pack`, `npm publish` -* [`25f4f73f6`](https://github.com/npm/cli/commit/25f4f73f6dc9744757787c82351120cd1baee5f8) - add a util for writing arbitrary files to cache This prevents metrics - timing and debug logs from becoming root-owned. - ([@isaacs](https://github.com/isaacs)) -* [`2c61ce65d`](https://github.com/npm/cli/commit/2c61ce65d6b67100fdf3fcb9729055b669cb1a1d) - infer cache owner from parent dir in `correct-mkdir` util - ([@isaacs](https://github.com/isaacs)) -* [`235e5d6df`](https://github.com/npm/cli/commit/235e5d6df6f427585ec58425f1f3339d08f39d8a) - ensure correct owner on cached all-packages metadata - ([@isaacs](https://github.com/isaacs)) -* [`e2d377bb6`](https://github.com/npm/cli/commit/e2d377bb6419d8a3c1d80a73dba46062b4dad336) - [npm.community#8540](https://npm.community/t/npm-audit-fails-with-child-requires-fails-because-requires-must-be-an-object/8540) - audit: report server error on failure - ([@isaacs](https://github.com/isaacs)) -* [`52576a39e`](https://github.com/npm/cli/commit/52576a39ed75d94c46bb2c482fd38d2c6ea61c56) - [#216](https://github.com/npm/cli/pull/216) - [npm.community#5385](https://npm.community/t/6-8-0-npm-ci-fails-with-local-dependency/5385) - [npm.community#6076](https://npm.community/t/npm-ci-fail-to-local-packages/6076) - Fix `npm ci` with `file:` dependencies. Partially reverts - [#40](https://github.com/npm/cli/pull/40)/[#86](https://github.com/npm/cli/pull/86), - recording dependencies of linked deps in order for `npm ci` to work. - ([@jfirebaugh](https://github.com/jfirebaugh)) - -### DEPENDENCIES - -* [`0fefdee13`](https://github.com/npm/cli/commit/0fefdee130fd7d0dbb240fb9ecb50a793fbf3d29) - `cacache@12.0.2` ([@isaacs](https://github.com/isaacs)) - * infer uid/gid instead of accepting as options, preventing the - overwhelming majority of cases where root-owned files end up in the - cache folder. - ([ac84d14](https://github.com/npm/cacache/commit/ac84d14)) - ([@isaacs](https://github.com/isaacs)) - ([#1](https://github.com/npm/cacache/pull/1)) - * **i18n:** add another error message - ([676cb32](https://github.com/npm/cacache/commit/676cb32)) - ([@zkat](https://github.com/zkat)) -* [`e1d87a392`](https://github.com/npm/cli/commit/e1d87a392371a070b0788ab7bfc62be18b21e9ad) - `pacote@9.5.4` ([@isaacs](https://github.com/isaacs)) - * git: ensure stream failures are reported - ([7f07b5d](https://github.com/npm/pacote/commit/7f07b5d)) - [#1](https://github.com/npm/pacote/issues/1) - ([@lddubeau](https://github.com/lddubeau)) -* [`3f035bf09`](https://github.com/npm/cli/commit/3f035bf098e2feea76574cec18b04812659aa16d) - `infer-owner@1.0.4` ([@isaacs](https://github.com/isaacs)) -* [`ba3283112`](https://github.com/npm/cli/commit/ba32831126591d2f6f48e31a4a2329b533b1ff19) - `npm-registry-fetch@4.0.0` ([@isaacs](https://github.com/isaacs)) -* [`ee90c334d`](https://github.com/npm/cli/commit/ee90c334d271383d0325af42f20f80f34cb61f07) - `libnpm@3.0.1` ([@isaacs](https://github.com/isaacs)) -* [`1e480c384`](https://github.com/npm/cli/commit/1e480c38416982ae28b5cdd48c698ca59d3c0395) - `libnpmaccess@3.0.2` ([@isaacs](https://github.com/isaacs)) -* [`7662ee850`](https://github.com/npm/cli/commit/7662ee850220c71ecaec639adbc7715286f0d28b) - `libnpmhook@5.0.3` ([@isaacs](https://github.com/isaacs)) -* [`1357fadc6`](https://github.com/npm/cli/commit/1357fadc613d0bfeb40f9a8f3ecace2face2fe2c) - `libnpmorg@1.0.1` ([@isaacs](https://github.com/isaacs)) -* [`a621b5cb6`](https://github.com/npm/cli/commit/a621b5cb6c881f95a11af86a8051754a67ae017c) - `libnpmsearch@2.0.2` ([@isaacs](https://github.com/isaacs)) -* [`560cd31dd`](https://github.com/npm/cli/commit/560cd31dd51b6aa2e396ccdd7289fab0a50b5608) - `libnpmteam@1.0.2` ([@isaacs](https://github.com/isaacs)) -* [`de7ae0867`](https://github.com/npm/cli/commit/de7ae0867d4c0180edc283457ce0b4e8e5eee554) - `npm-profile@4.0.2` ([@isaacs](https://github.com/isaacs)) -* [`e95da463c`](https://github.com/npm/cli/commit/e95da463cb7a325457ef411a569d7ef4bf76901d) - `libnpm@3.0.1` ([@isaacs](https://github.com/isaacs)) -* [`554b641d4`](https://github.com/npm/cli/commit/554b641d49d135ae8d137e83aa288897c32dacc6) - `npm-registry-fetch@4.0.0` ([@isaacs](https://github.com/isaacs)) -* [`06772f34a`](https://github.com/npm/cli/commit/06772f34ab851440dcd78574736936c674a84aed) - `node-gyp@5.0.3` ([@isaacs](https://github.com/isaacs)) -* [`85358db80`](https://github.com/npm/cli/commit/85358db80d6ccb5f7bc9a0b4d558ac6dd2468394) - `npm-lifecycle@3.1.2` ([@isaacs](https://github.com/isaacs)) - * [`051cf20`](https://github.com/npm/npm-lifecycle/commit/051cf20072a01839c17920d2e841756251c4f924) - [#26](https://github.com/npm/npm-lifecycle/pull/26) fix switches for - alternative shells on Windows - ([@gucong3000](https://github.com/gucong3000)) - * [`3aaf954`](https://github.com/npm/npm-lifecycle/commit/3aaf95435965e8f7acfd955582cf85237afd2c9b) - [#25](https://github.com/npm/npm-lifecycle/pull/25) set only one PATH - env variable for child process on Windows - ([@zkochan](https://github.com/zkochan)) - * [`ea18ed2`](https://github.com/npm/npm-lifecycle/commit/ea18ed2b754ca7f11998cad70d88e9004c5bef4a) - [#36](https://github.com/npm/npm-lifecycle/pull/36) - [#11](https://github.com/npm/npm-lifecycle/issue/11) - [#18](https://github.com/npm/npm-lifecycle/issue/18) remove - procInterrupt listener on SIGINT in procError - ([@mattshin](https://github.com/mattshin)) - * [`5523951`](https://github.com/npm/npm-lifecycle/commit/55239519c57b82521605622e6c71640a31ed4586) - [#29](https://github.com/npm/npm-lifecycle/issue/29) - [#30](https://github.com/npm/npm-lifecycle/pull/30) Use platform - specific path casing if present - ([@mattezell](https://github.com/mattezell)) - -## v6.10.1 (2019-07-11): - -### BUGFIXES - -* [`3cbd57712`](https://github.com/npm/cli/commit/3cbd577120a9da6e51bb8b13534d1bf71ea5712c) - fix(git): strip GIT environs when running git - ([@isaacs](https://github.com/isaacs)) -* [`a81a8c4c4`](https://github.com/npm/cli/commit/a81a8c4c466f510215a51cef1bb08544d11844fe) - [#206](https://github.com/npm/cli/pull/206) improve isOnly(Dev,Optional) - ([@larsgw](https://github.com/larsgw)) -* [`172f9aca6`](https://github.com/npm/cli/commit/172f9aca67a66ee303c17f90a994cd52fc66552a) - [#179](https://github.com/npm/cli/pull/179) fix-xmas-underline - ([@raywu0123](https://github.com/raywu0123)) -* [`f52673fc7`](https://github.com/npm/cli/commit/f52673fc7284e58af8c04533e82b76bf7add72cf) - [#212](https://github.com/npm/cli/pull/212) build: use `/usr/bin/env` to - load bash ([@rsmarples](https://github.com/rsmarples)) - -### DEPENDENCIES - -* [`ef4445ad3`](https://github.com/npm/cli/commit/ef4445ad34a53b5639499c8e3c9752f62ee6f37c) - [#208](https://github.com/npm/cli/pull/208) `node-gyp@5.0.2` - ([@irega](https://github.com/irega)) -* [`c0d611356`](https://github.com/npm/cli/commit/c0d611356f7b23077e97574b01c8886e544db425) - `npm-lifecycle@3.0.0` ([@isaacs](https://github.com/isaacs)) -* [`7716ba972`](https://github.com/npm/cli/commit/7716ba9720270d5b780755a5bb1ce79702067f1f) - `libcipm@4.0.0` ([@isaacs](https://github.com/isaacs)) -* [`42d22e837`](https://github.com/npm/cli/commit/42d22e8374c7d303d94e405d7385d94dd2558814) - `libnpm@3.0.0` ([@isaacs](https://github.com/isaacs)) -* [`a2ea7f9ff`](https://github.com/npm/cli/commit/a2ea7f9ff64ae743d05fdbf7d46fb9afafa8aa6f) - `semver@5.7.0` ([@isaacs](https://github.com/isaacs)) -* [`429226a5e`](https://github.com/npm/cli/commit/429226a5e992cd907d4f19bd738037007cf78c1f) - `lru-cache@5.1.1` ([@isaacs](https://github.com/isaacs)) -* [`175670ea6`](https://github.com/npm/cli/commit/175670ea65cca03f8b2e957df3dd4b8b0efd0e1f) - `npm-registry-fetch@3.9.1`: ([@isaacs](https://github.com/isaacs)) -* [`0d0517f7f`](https://github.com/npm/cli/commit/0d0517f7f8c902b5064ac18fb4015b31750ad2b2) - `call-limit@1.1.1` ([@isaacs](https://github.com/isaacs)) -* [`741400429`](https://github.com/npm/cli/commit/74140042917ea241062a812ceb65c5423c2bafa9) - `glob@7.1.4` ([@isaacs](https://github.com/isaacs)) -* [`bddd60e30`](https://github.com/npm/cli/commit/bddd60e302283a4a70d35f8f742e42bd13f4dabf) - `inherits@2.0.4` ([@isaacs](https://github.com/isaacs)) -* [`4acf03fd1`](https://github.com/npm/cli/commit/4acf03fd140ed3ddb2dcf3fdc9756bc3f5a8bcbb) - `libnpmsearch@2.0.1` ([@isaacs](https://github.com/isaacs)) -* [`c2bd17291`](https://github.com/npm/cli/commit/c2bd17291a86bea7ced2fbd07d66d013bd7a7560) - `marked@0.6.3` ([@isaacs](https://github.com/isaacs)) -* [`7f0221bb1`](https://github.com/npm/cli/commit/7f0221bb1bb41ffc933c785940e227feae38c80c) - `marked-man@0.6.0` ([@isaacs](https://github.com/isaacs)) -* [`f458fe7dd`](https://github.com/npm/cli/commit/f458fe7dd3bebddf603aaae183a424ea8aaa018f) - `npm-lifecycle@2.1.1` ([@isaacs](https://github.com/isaacs)) -* [`009752978`](https://github.com/npm/cli/commit/0097529780269c28444f1efa0d7c131d47a933eb) - `node-gyp@4.0.0` ([@isaacs](https://github.com/isaacs)) -* [`0fa2bb438`](https://github.com/npm/cli/commit/0fa2bb4386379d6e9d8c95db08662ec0529964f9) - `query-string@6.8.1` ([@isaacs](https://github.com/isaacs)) -* [`b86450929`](https://github.com/npm/cli/commit/b86450929796950a1fe4b1f9b02b1634c812f3bb) - `tar-stream@2.1.0` ([@isaacs](https://github.com/isaacs)) -* [`25db00fe9`](https://github.com/npm/cli/commit/25db00fe953453198adb9e1bd71d1bc2a9f04aaa) - `worker-farm@1.7.0` ([@isaacs](https://github.com/isaacs)) -* [`8dfbe8610`](https://github.com/npm/cli/commit/8dfbe861085dfa8fa56bb504b4a00fba04c34f9d) - `readable-stream@3.4.0` ([@isaacs](https://github.com/isaacs)) -* [`f6164d5dd`](https://github.com/npm/cli/commit/f6164d5ddd072eabdf2237f1694a31efd746eb1d) - [isaacs/chownr#21](https://github.com/isaacs/chownr/pull/21) - [isaacs/chownr#20](https://github.com/isaacs/chownr/issues/20) - [npm.community#7901](https://npm.community/t/7901/) - [npm.community#8203](https://npm.community/t/8203) `chownr@1.1.2` This - fixes an EISDIR error from cacache on Darwin in Node versions prior to - 10.6. ([@isaacs](https://github.com/isaacs)) - -## v6.10.0 (2019-07-03): - -### FEATURES - -* [`87fef4e35`](https://github.com/npm/cli/commit/87fef4e35) - [#176](https://github.com/npm/cli/pull/176) fix: Always return JSON for - outdated --json ([@sreeramjayan](https://github.com/sreeramjayan)) -* [`f101d44fc`](https://github.com/npm/cli/commit/f101d44fc) - [#203](https://github.com/npm/cli/pull/203) fix(unpublish): add space - after hyphen ([@ffflorian](https://github.com/ffflorian)) -* [`a4475de4c`](https://github.com/npm/cli/commit/a4475de4c) - [#202](https://github.com/npm/cli/pull/202) enable production flag for - npm audit ([@CalebCourier](https://github.com/CalebCourier)) -* [`d192904d0`](https://github.com/npm/cli/commit/d192904d0) - [#178](https://github.com/npm/cli/pull/178) fix: Return a value for - `view` when in silent mode - ([@stayradiated](https://github.com/stayradiated)) -* [`39d473adf`](https://github.com/npm/cli/commit/39d473adf) - [#185](https://github.com/npm/cli/pull/185) Allow git to follow global - tagsign config ([@junderw](https://github.com/junderw)) - -### BUGFIXES - -* [`d9238af0b`](https://github.com/npm/cli/commit/d9238af0b) - [#201](https://github.com/npm/cli/pull/163) - [npm/npm#17858](https://github.com/npm/npm/issues/17858) - [npm/npm#18042](https://github.com/npm/npm/issues/18042) - [npm.community#644](https://npm.community/t/644) do not crash when - removing nameless packages - ([@SteveVanOpstal](https://github.com/SteveVanOpstal) and - [@isaacs](https://github.com/isaacs)) -* [`4bec4f111`](https://github.com/npm/cli/commit/4bec4f111) - [#200](https://github.com/npm/cli/pull/200) Check for `node` (as well as - `node.exe`) in npm's local dir on Windows - ([@rgoulais](https://github.com/rgoulais)) -* [`ce93dab2d`](https://github.com/npm/cli/commit/ce93dab2db423ef23b3e08a0612dafbeb2d25789) - [#180](https://github.com/npm/cli/pull/180) - [npm.community#6187](https://npm.community/t/6187) Fix handling of - `remote` deps in `npm outdated` ([@larsgw](https://github.com/larsgw)) - -### TESTING - -* [`a823f3084`](https://github.com/npm/cli/commit/a823f3084) travis: Update - to include new v12 LTS ([@isaacs](https://github.com/isaacs)) -* [`33e2d1dac`](https://github.com/npm/cli/commit/33e2d1dac) fix flaky - debug-logs test ([@isaacs](https://github.com/isaacs)) -* [`e9411c6cd`](https://github.com/npm/cli/commit/e9411c6cd) Don't time out - waiting for gpg user input ([@isaacs](https://github.com/isaacs)) -* [`d2d301704`](https://github.com/npm/cli/commit/d2d301704) - [#195](https://github.com/npm/cli/pull/195) Add the arm64 check for - legacy-platform-all.js test case. - ([@ossdev07](https://github.com/ossdev07)) -* [`a4dc34243`](https://github.com/npm/cli/commit/a4dc34243) parallel tests - ([@isaacs](https://github.com/isaacs)) +- Generated gzipped tarballs no longer contain the zlib OS indicator. As a + result, they are truly dependent _only_ on the contents of the package, + and fully reproducible. However, anyone relying on this byte to identify + the operating system of a package's creation may no longer rely on it. -### DOCUMENTATION - -* [`f5857e263`](https://github.com/npm/cli/commit/f5857e263) - [#192](https://github.com/npm/cli/pull/192) Clarify usage of - bundledDependencies - ([@john-osullivan](https://github.com/john-osullivan)) -* [`747fdaf66`](https://github.com/npm/cli/commit/747fdaf66) - [#159](https://github.com/npm/cli/pull/159) doc: add --audit-level param - ([@ngraef](https://github.com/ngraef)) - -### DEPENDENCIES - -* [`e36b3c320`](https://github.com/npm/cli/commit/e36b3c320) - graceful-fs@4.2.0 ([@isaacs](https://github.com/isaacs)) -* [`6bb935c09`](https://github.com/npm/cli/commit/6bb935c09) - read-package-tree@5.3.1 ([@isaacs](https://github.com/isaacs)) - * [`e9cd536`](https://github.com/npm/read-package-tree/commit/e9cd536) - Use custom caching `realpath` implementation, dramatically reducing - `lstat` calls when reading the package tree - ([@isaacs](https://github.com/isaacs)) -* [`39538b460`](https://github.com/npm/cli/commit/39538b460) - write-file-atomic@2.4.3 ([@isaacs](https://github.com/isaacs)) - * [`f8b1552`](https://github.com/npm/write-file-atomic/commit/f8b1552) - [#38](https://github.com/npm/write-file-atomic/pull/38) Ignore errors - raised by `fs.closeSync` ([@lukeapage](https://github.com/lukeapage)) -* [`042193069`](https://github.com/npm/cli/commit/042193069) pacote@9.5.1 - ([@isaacs](https://github.com/isaacs)) - * [`8bbd051`](https://github.com/npm/pacote/commit/8bbd051) - [#172](https://github.com/zkat/pacote/pull/172) limit git retry - times, avoid unlimited retries ([小秦](https://github.com/xqin)) - * [`92f5e4c`](https://github.com/npm/pacote/commit/92f5e4c) - [#170](https://github.com/zkat/pacote/pull/170) fix(errors): Fix - "TypeError: err.code.match is not a function" error - ([@jviotti](https://github.com/jviotti)) -* [`8bd8e909f`](https://github.com/npm/cli/commit/8bd8e909f) cacache@11.3.3 - ([@isaacs](https://github.com/isaacs)) - * [`47de8f5`](https://github.com/npm/cacache/commit/47de8f5) - [#146](https://github.com/zkat/cacache/pull/146) - [npm.community#2395](https://npm.community/t/2395) fix(config): Add - ssri config 'error' option ([@larsgw](https://github.com/larsgw)) - * [`5156561`](https://github.com/npm/cacache/commit/5156561) - fix(write): avoid a `cb never called` situation - ([@zkat](https://github.com/zkat)) - * [`90f40f0`](https://github.com/npm/cacache/commit/90f40f0) - [#166](https://github.com/zkat/cacache/pull/166) - [#165](https://github.com/zkat/cacache/issues/165) docs: Fix docs for - `path` property in get.info - ([@hdgarrood](https://github.com/hdgarrood)) -* [`bf61c45c6`](https://github.com/npm/cli/commit/bf61c45c6) bluebird@3.5.5 - ([@isaacs](https://github.com/isaacs)) -* [`f75d46a9d`](https://github.com/npm/cli/commit/f75d46a9d) tar@4.4.10 - ([@isaacs](https://github.com/isaacs)) - * [`c80341a`](https://github.com/npm/node-tar/commit/c80341a) - [#215](https://github.com/npm/node-tar/pull/215) Fix - encoding/decoding of base-256 numbers - ([@justfalter](https://github.com/justfalter)) - * [`77522f0`](https://github.com/npm/node-tar/commit/77522f0) - [#204](https://github.com/npm/node-tar/issues/204) - [#214](https://github.com/npm/node-tar/issues/214) Use `stat` instead - of `lstat` when checking CWD ([@stkb](https://github.com/stkb)) -* [`ec6236210`](https://github.com/npm/cli/commit/ec6236210) - npm-packlist@1.4.4 ([@isaacs](https://github.com/isaacs)) - * [`63d1e3e`](https://github.com/npm/npm-packlist/commit/63d1e3e) - [#30](https://github.com/npm/npm-packlist/issues/30) Sort package - tarball entries by file type for compression benefits - ([@isaacs](https://github.com/isaacs)) - * [`7fcd045`](https://github.com/npm/npm-packlist/commit/7fcd045) - Ignore `.DS_Store` files as well as folders - ([@isaacs](https://github.com/isaacs)) - * [`68b7c96`](https://github.com/npm/npm-packlist/commit/68b7c96) Never - include .git folders in package root. (Note: this prevents the issue - that broke the v6.9.1 release.) - ([@isaacs](https://github.com/isaacs)) -* [`57bef61bc`](https://github.com/npm/cli/commit/57bef61bc) update fstream - in node-gyp ([@isaacs](https://github.com/isaacs)) - * Addresses [security advisory - #886](https://www.npmjs.com/advisories/886) -* [`acbbf7eee`](https://github.com/npm/cli/commit/acbbf7eee) - [#183](https://github.com/npm/cli/pull/183) licensee@7.0.2 - ([@kemitchell](https://github.com/kemitchell)) -* [`011ae67f0`](https://github.com/npm/cli/commit/011ae67f0) - readable-stream@3.3.0 ([@isaacs](https://github.com/isaacs)) -* [`f5e884909`](https://github.com/npm/cli/commit/f5e884909) - npm-registry-mock@1.2.1 ([@isaacs](https://github.com/isaacs)) -* [`b57d07e35`](https://github.com/npm/cli/commit/b57d07e35) - npm-registry-couchapp@2.7.2 ([@isaacs](https://github.com/isaacs)) - -## v6.9.2 (2019-06-27): - -This release is identical to v6.9.1, but we had to publish a new version -due to [a .git directory in the release](https://npm.community/t/8454). - -## v6.9.1 (2019-06-26): - -### BUGFIXES - -* [`6b1a9da0e`](https://github.com/npm/cli/commit/6b1a9da0e0f5c295cdaf4dea4b73bd221d778611) - [#165](https://github.com/npm/cli/pull/165) - Update `knownBroken` version. - ([@ljharb](https://github.com/ljharb)) -* [`d07547154`](https://github.com/npm/cli/commit/d07547154eb8a88aa4fde8a37e128e1e3272adc1) - [npm.community#5929](https://npm.community/t/npm-outdated-throw-an-error-cannot-read-property-length-of-undefined/5929) - Fix `outdated` rendering for global dependencies. - ([@zkat](https://github.com/zkat)) -* [`e4a1f1745`](https://github.com/npm/cli/commit/e4a1f174514a57580fd5e0fa33eee0f42bba77fc) - [npm.community#6259](https://npm.community/t/npm-token-create-doesnt-work-in-6-6-0-6-9-0/6259) - Fix OTP for token create and remove. - ([@zkat](https://github.com/zkat)) - -### DEPENDENCIES - -* [`a163a9c35`](https://github.com/npm/cli/commit/a163a9c35f6f341de343562368056258bba5d7dc) - `sha@3.0.0` - ([@aeschright](https://github.com/aeschright)) -* [`47b08b3b9`](https://github.com/npm/cli/commit/47b08b3b9860438b416efb438e975a628ec2eed5) - `query-string@6.4.0` - ([@aeschright](https://github.com/aeschright)) -* [`d6a956cff`](https://github.com/npm/cli/commit/d6a956cff6357e6de431848e578c391768685a64) - `readable-stream@3.2.0` - ([@aeschright](https://github.com/aeschright)) -* [`10b8bed2b`](https://github.com/npm/cli/commit/10b8bed2bb0afac5451164e87f25924cc1ac6f2e) - `tacks@1.3.0` - ([@aeschright](https://github.com/aeschright)) -* [`e7483704d`](https://github.com/npm/cli/commit/e7483704dda1acffc8c6b8c165c14c8a7512f3c8) - `tap@12.6.0` - ([@aeschright](https://github.com/aeschright)) -* [`3242fe698`](https://github.com/npm/cli/commit/3242fe698ead46a9cda94e1a4d489cd84a85d7e3) - `tar-stream@2.0.1` - ([@aeschright](https://github.com/aeschright)) - -## v6.9.0 (2019-02-20): - -### FEATURES - -* [`2ba3a0f67`](https://github.com/npm/cli/commit/2ba3a0f6721f6d5a16775aebce6012965634fc7c) - [#90](https://github.com/npm/cli/pull/90) - Time traveling installs using the `--before` flag. - ([@zkat](https://github.com/zkat)) -* [`b7b54f2d1`](https://github.com/npm/cli/commit/b7b54f2d18e2d8d65ec67c850b21ae9f01c60e7e) - [#3](https://github.com/npm/cli/pull/3) - Add support for package aliases. This allows packages to be installed under a - different directory than the package name listed in `package.json`, and adds a - new dependency type to allow this to be done for registry dependencies. - ([@zkat](https://github.com/zkat)) -* [`684bccf06`](https://github.com/npm/cli/commit/684bccf061dfc97bb759121bc0ad635e01c65868) - [#146](https://github.com/npm/cli/pull/146) - Always save `package-lock.json` when using `--package-lock-only`. - ([@aeschright](https://github.com/aeschright)) -* [`b8b8afd40`](https://github.com/npm/cli/commit/b8b8afd4048b4ba1181e00ba2ac49ced43936ce0) - [#139](https://github.com/npm/cli/pull/139) - Make empty-string run-scripts run successfully as a no-op. - ([@vlasy](https://github.com/vlasy)) -* [`8047b19b1`](https://github.com/npm/cli/commit/8047b19b1b994fd4b4e7b5c91d7cc4e0384bd5e4) - [npm.community#3784](https://npm.community/t/3784) - Match git semver ranges when flattening the tree. - ([@larsgw](https://github.com/larsgw)) -* [`e135c2bb3`](https://github.com/npm/cli/commit/e135c2bb360dcf00ecee34a95985afec21ba3655) - [npm.community#1725](https://npm.community/t/1725?u=larsgw) - Re-enable updating local packages. - ([@larsgw](https://github.com/larsgw)) - -### BUGFIXES - -* [`cf09fbaed`](https://github.com/npm/cli/commit/cf09fbaed489d908e9b551382cc5f61bdabe99a9) - [#153](https://github.com/npm/cli/pull/153) - Set modified to undefined in `npm view` when `time` is not available. This - fixes a bug where `npm view` would crash on certain third-party registries. - ([@simonua](https://github.com/simonua)) -* [`774fc26ee`](https://github.com/npm/cli/commit/774fc26eeb01345c11bd8c97e2c4f328d419d9b5) - [#154](https://github.com/npm/cli/pull/154) - Print out tar version in `install.sh` only when the flag is supported not all - the tar implementations support --version flag. This allows the install script - to work in OpenBSD, for example. - ([@agudulin](https://github.com/agudulin)) -* [`863baff11`](https://github.com/npm/cli/commit/863baff11d8c870f1a0d9619bb5133c67d71e407) - [#158](https://github.com/npm/cli/pull/158) - Fix typo in error message for `npm stars`. - ([@phihag](https://github.com/phihag)) -* [`a805a95ad`](https://github.com/npm/cli/commit/a805a95ad8832ef5008671f4bd4c11b83e32e0f2) - [npm.community#4227](https://npm.community/t/4227) - Strip version info from pkg on E404. This improves the error messaging format. - ([@larsgw](https://github.com/larsgw)) - -### DOCS - -* [`5d7633833`](https://github.com/npm/cli/commit/5d76338338621fd0b3d4f7914a51726d27569ee1) - [#160](https://github.com/npm/cli/pull/160) - Add `npm add` as alias to npm install in docs. - ([@ahasall](https://github.com/ahasall)) -* [`489c2211c`](https://github.com/npm/cli/commit/489c2211c96a01d65df50fd57346c785bcc3efe6) - [#162](https://github.com/npm/cli/pull/162) - Fix link to RFC #10 in the changelog. - ([@mansona](https://github.com/mansona)) -* [`433020ead`](https://github.com/npm/cli/commit/433020ead5251b562bc3b0f5f55341a5b8cc9023) - [#135](https://github.com/npm/cli/pull/135) - Describe exit codes in npm-audit docs. - ([@emilis-tm](https://github.com/emilis-tm)) - -### DEPENDENCIES - -* [`ee6b6746b`](https://github.com/npm/cli/commit/ee6b6746b04f145dfe489af2d26667ac32ba0cef) - [zkat/make-fetch-happen#29](https://github.com/zkat/make-fetch-happen/issues/29) - `agent-base@4.2.1` - ([@TooTallNate](https://github.com/TooTallNate)) -* [`2ce23baf5`](https://github.com/npm/cli/commit/2ce23baf53b1ce7d11b8efb80c598ddaf9cef9e7) - `lock-verify@2.1.0`: - Adds support for package aliases - ([@zkat](https://github.com/zkat)) -* [`baaedbc6e`](https://github.com/npm/cli/commit/baaedbc6e2fc370d73b35e7721794719115507cc) - `pacote@9.5.0`: - Adds opts.before support - ([@zkat](https://github.com/zkat)) -* [`57e771a03`](https://github.com/npm/cli/commit/57e771a032165d1e31e71d0ff7530442139c21a6) - [#164](https://github.com/npm/cli/pull/164) - `licensee@6.1.0` - ([@kemitchell](https://github.com/kemitchell)) -* [`2b78288d4`](https://github.com/npm/cli/commit/2b78288d4accd10c1b7cc6c36bc28045f5634d91) - add core to default inclusion tests in pack - ([@Kat Marchán](https://github.com/Kat Marchán)) -* [`9b8b6513f`](https://github.com/npm/cli/commit/9b8b6513fbce92764b32a067322984985ff683fe) - [npm.community#5382](https://npm.community/t/npm-pack-leaving-out-files-6-8-0-only/5382) - `npm-packlist@1.4.1`: Fixes bug where `core/` directories were being suddenly excluded. - ([@zkat](https://github.com/zkat)) - -## v6.8.0 (2019-02-07): - -This release includes an implementation of [RFC #10](https://github.com/npm/rfcs/blob/latest/implemented/0010-monorepo-subdirectory-declaration.md), documenting an optional field that can be used to specify -the directory path for a package within a monorepo. - -### NEW FEATURES - -* [`3663cdef2`](https://github.com/npm/cli/commit/3663cdef205fa9ba2c2830e5ef7ceeb31c30298c) - [#140](https://github.com/npm/cli/pull/140) - Update package.json docs to include repository.directory details. - ([@greysteil](https://github.com/greysteil)) - -### BUGFIXES - -* [`550bf703a`](https://github.com/npm/cli/commit/550bf703ae3e31ba6a300658ae95b6937f67b68f) - Add @types to ignore list to fix git clean -fd. - ([@zkat](https://github.com/zkat)) -* [`cdb059293`](https://github.com/npm/cli/commit/cdb0592939d6256c80f7ec5a2b6251131a512a2a) - [#144](https://github.com/npm/cli/pull/144) - Fix common.npm callback arguments. - ([@larsgw](https://github.com/larsgw)) -* [`25573e9b9`](https://github.com/npm/cli/commit/25573e9b9d5d26261c68d453f06db5b3b1cd6789) - [npm.community#4770](https://npm.community/t/https://npm.community/t/4770) - Show installed but unmet peer deps. - ([@larsgw](https://github.com/larsgw)) -* [`ce2c4bd1a`](https://github.com/npm/cli/commit/ce2c4bd1a2ce7ac1727a4ca9a350b743a2e27b2a) - [#149](https://github.com/npm/cli/pull/149) - Use figgy-config to make sure extra opts are there. - ([@zkat](https://github.com/zkat)) -* [`3c22d1a35`](https://github.com/npm/cli/commit/3c22d1a35878f73c0af8ea5968b962a85a1a9b84) - [npm.community#5101](https://npm.community/t/npm-6-6-0-breaks-access-to-ls-collaborators/5101) - Fix `ls-collaborators` access error for non-scoped case. - ([@zkat](https://github.com/zkat)) -* [`d5137091d`](https://github.com/npm/cli/commit/d5137091dd695a2980f7ade85fdc56b2421ff677) - [npm.community#754](https://npm.community/t/npm-install-for-package-with-local-dependency-fails/754) - Fix issue with sub-folder local references. - ([@iarna](https://github.com/iarna)) - ([@jhecking](https://github.com/jhecking)) - -### DEPENDENCY BUMPS - -* [`d72141080`](https://github.com/npm/cli/commit/d72141080ec8fcf35bcc5650245efbe649de053e) - `npm-registry-couchapp@2.7.1` - ([@zkat](https://github.com/zkat)) -* [`671cad1b1`](https://github.com/npm/cli/commit/671cad1b18239d540da246d6f78de45d9f784396) - `npm-registry-fetch@3.9.0`: - Make sure publishing with legacy username:password `_auth` works again. - ([@zkat](https://github.com/zkat)) -* [`95ca1aef4`](https://github.com/npm/cli/commit/95ca1aef4077c8e68d9f4dce37f6ba49b591c4ca) - `pacote@9.4.1` - ([@aeschright](https://github.com/aeschright)) -* [`322fef403`](https://github.com/npm/cli/commit/322fef40376e71cd100159dc914e7ca89faae327) - `normalize-package-data@2.5.0` - ([@aeschright](https://github.com/aeschright)) -* [`32d34c0da`](https://github.com/npm/cli/commit/32d34c0da4f393a74697297667eb9226155ecc6b) - `npm-packlist@1.3.0` - ([@aeschright](https://github.com/aeschright)) -* [`338571cf0`](https://github.com/npm/cli/commit/338571cf0bd3a1e2ea800464d57581932ff0fb11) - `read-package-tree@5.2.2` - ([@zkat](https://github.com/zkat)) - -### MISC - -* [`89b23a5f7`](https://github.com/npm/cli/commit/89b23a5f7b0ccdcdda1d7d4d3eafb6903156d186) - [#120](https://github.com/npm/cli/pull/120) - Use `const` in lib/fetch-package-metadata.md. - ([@watilde](https://github.com/watilde)) -* [`4970d553c`](https://github.com/npm/cli/commit/4970d553c0ea66128931d118469fd31c87cc7986) - [#126](https://github.com/npm/cli/pull/126) - Replace ronn with marked-man in `.npmignore`. - ([@watilde](https://github.com/watilde)) -* [`d9b6090dc`](https://github.com/npm/cli/commit/d9b6090dc26cd0fded18b4f80248cff3e51bb185) - [#138](https://github.com/npm/cli/pull/138) - Reduce work to test if executable ends with a 'g'. - ([@elidoran](https://github.com/elidoran)) - ([@larsgw](https://github.com/larsgw)) - -## v6.7.0 (2019-01-23): - -Hey y'all! This is a quick hotfix release that includes some important fixes to -`npm@6.6.0` related to the large rewrite/refactor. We're tagging it as a feature -release because the changes involve some minor new features, and semver is -semver, but there's nothing major here. - -### NEW FEATURES - -* [`50463f58b`](https://github.com/npm/cli/commit/50463f58b4b70180a85d6d8c10fcf50d8970ef5e) - Improve usage errors to `npm org` commands and add optional filtering to `npm - org ls` subcommand. - ([@zkat](https://github.com/zkat)) - -### BUGFIXES - -* [`4027070b0`](https://github.com/npm/cli/commit/4027070b03be3bdae2515f2291de89b91f901df9) - Fix default usage printout for `npm org` so you actually see how it's supposed - to be used. - ([@zkat](https://github.com/zkat)) -* [`cfea6ea5b`](https://github.com/npm/cli/commit/cfea6ea5b67ec5e4ec57e3a9cb8c82d018cb5476) - fix default usage message for npm hook - ([@zkat](https://github.com/zkat)) - -### DOCS - -* [`e959e1421`](https://github.com/npm/cli/commit/e959e14217d751ddb295565fd75cc81de1ee0d5b) - Add manpage for `npm org` command. - ([@zkat](https://github.com/zkat)) - -### DEPENDENCY BUMPS - -* [`8543fc357`](https://github.com/npm/cli/commit/8543fc3576f64e91f7946d4c56a5ffb045b55156) - `pacote@9.4.0`: Fall back to "fullfat" packuments on ETARGET errors. This will - make it so that, when a package is published but the corgi follower hasn't - caught up, users can still install a freshly-published package. - ([@zkat](https://github.com/zkat)) -* [`75475043b`](https://github.com/npm/cli/commit/75475043b03a254b2e7db2c04c3f0baea31d8dc5) - [npm.community#4752](https://npm.community/t/npm-6-6-0-broke-authentication-with-npm-registry-couchapp/4752) - `libnpmpublish@1.1.1`: Fixes auth error for username/password legacy authentication. - ([@sreeramjayan](https://github.com/sreeramjayan)) -* [`0af8c00ac`](https://github.com/npm/cli/commit/0af8c00acb01849362ffca25b567cc62447c7175) - [npm.community#4746](https://npm.community/t/npm-6-6-0-release-breaking-docker-npm-ci-commands/4746) - `libcipm@3.0.3`: Fixes issue with "cannot run in wd" errors for run-scripts. - ([@zkat](https://github.com/zkat)) -* [`5a7962e46`](https://github.com/npm/cli/commit/5a7962e46f582c6bd91784b0ddc941ed45e9f802) - `write-file-atomic@2.4.2`: - Fixes issues with leaking `signal-exit` instances and file descriptors. - ([@iarna](https://github.com/iarna)) - -## v6.6.0 (2019-01-17): - -### REFACTORING OUT npm-REGISTRY-CLIENT - -Today is an auspicious day! This release marks the end of a massive internal -refactor to npm that means we finally got rid of the legacy -[`npm-registry-client`](https://npm.im/npm-registry-client) in favor of the -shiny, new, `window.fetch`-like -[`npm-registry-fetch`](https://npm.im/npm-registry-fetch). - -Now, the installer had already done most of this work with the release of -`npm@5`, but it turns out _every other command_ still used the legacy client. -This release updates all of those commands to use the new client, and while -we're at it, adds a few extra goodies: - -* All OTP-requiring commands will now **prompt**. `--otp` is no longer required for `dist-tag`, `access`, et al. -* We're starting to integrate a new config system which will eventually get extracted into a standalone package. -* We now use [`libnpm`](https://npm.im/libnpm) for the API functionality of a lot of our commands! That means you can install a library if you want to write your own tooling around them. -* There's now an `npm org` command for managing users in your org. -* [`pacote`](https://npm.im/pacote) now consumes npm-style configurations, instead of its own naming for various config vars. This will make it easier to load npm configs using `libnpm.config` and hand them directly to `pacote`. - -There's too many commits to list all of them here, so check out the PR if you're -curious about details: - -* [`c5af34c05`](https://github.com/npm/cli/commit/c5af34c05fd569aecd11f18d6d0ddeac3970b253) - [npm-registry-client@REMOVED](https://www.youtube.com/watch\?v\=kPIdRJlzERo) - ([@zkat](https://github.com/zkat)) -* [`4cca9cb90`](https://github.com/npm/cli/commit/4cca9cb9042c0eeb743377e8f1ae1c07733df43f) - [`ad67461dc`](https://github.com/npm/cli/commit/ad67461dc3a73d5ae6569fdbee44c67e1daf86e7) - [`77625f9e2`](https://github.com/npm/cli/commit/77625f9e20d4285b7726b3bf3ebc10cb21c638f0) - [`6e922aefb`](https://github.com/npm/cli/commit/6e922aefbb4634bbd77ed3b143e0765d63afc7f9) - [`584613ea8`](https://github.com/npm/cli/commit/584613ea8ff94b927db4957e5647504b30ca2b1f) - [`64de4ebf0`](https://github.com/npm/cli/commit/64de4ebf019b217179039124c6621e74651e4d27) - [`6cd87d1a9`](https://github.com/npm/cli/commit/6cd87d1a9bb90e795f9891ea4db384435f4a8930) - [`2786834c0`](https://github.com/npm/cli/commit/2786834c0257b8bb1bbb115f1ce7060abaab2e17) - [`514558e09`](https://github.com/npm/cli/commit/514558e094460fd0284a759c13965b685133b3fe) - [`dec07ebe3`](https://github.com/npm/cli/commit/dec07ebe3312245f6421c6e523660be4973ae8c2) - [`084741913`](https://github.com/npm/cli/commit/084741913c4fdb396e589abf3440b4be3aa0b67e) - [`45aff0e02`](https://github.com/npm/cli/commit/45aff0e02251785a85e56eafacf9efaeac6f92ae) - [`846ddcc44`](https://github.com/npm/cli/commit/846ddcc44538f2d9a51ac79405010dfe97fdcdeb) - [`8971ba1b9`](https://github.com/npm/cli/commit/8971ba1b953d4f05ff5094f1822b91526282edd8) - [`99156e081`](https://github.com/npm/cli/commit/99156e081a07516d6c970685bc3d858f89dc4f9c) - [`ab2155306`](https://github.com/npm/cli/commit/ab215530674d7f6123c9572d0ad4ca9e9b5fb184) - [`b37a66542`](https://github.com/npm/cli/commit/b37a66542ca2879069b2acd338b1904de71b7f40) - [`d2af0777a`](https://github.com/npm/cli/commit/d2af0777ac179ff5009dbbf0354a4a84f151b60f) - [`e0b4c6880`](https://github.com/npm/cli/commit/e0b4c6880504fa2e8491c2fbd098efcb2e496849) - [`ff72350b4`](https://github.com/npm/cli/commit/ff72350b4c56d65e4a92671d86a33080bf3c2ea5) - [`6ed943303`](https://github.com/npm/cli/commit/6ed943303ce7a267ddb26aa25caa035f832895dd) - [`90a069e7d`](https://github.com/npm/cli/commit/90a069e7d4646682211f4cabe289c306ee1d5397) - [`b24ed5fdc`](https://github.com/npm/cli/commit/b24ed5fdc3a4395628465ae5273bad54eea274c8) - [`ec9fcc14f`](https://github.com/npm/cli/commit/ec9fcc14f4e0e2f3967e2fd6ad8b8433076393cb) - [`8a56fa39e`](https://github.com/npm/cli/commit/8a56fa39e61136da45565447fe201a57f04ad4cd) - [`41d19e18f`](https://github.com/npm/cli/commit/41d19e18f769c6f0acfdffbdb01d12bf332908ce) - [`125ff9551`](https://github.com/npm/cli/commit/125ff9551595dda9dab2edaef10f4c73ae8e1433) - [`1c3b226ff`](https://github.com/npm/cli/commit/1c3b226ff37159c426e855e83c8f6c361603901d) - [`3c0a7b06b`](https://github.com/npm/cli/commit/3c0a7b06b6473fe068fc8ae8466c07a177975b87) - [`08fcb3f0f`](https://github.com/npm/cli/commit/08fcb3f0f26e025702b35253ed70a527ab69977f) - [`c8135d97a`](https://github.com/npm/cli/commit/c8135d97a424b38363dc4530c45e4583471e9849) - [`ae936f22c`](https://github.com/npm/cli/commit/ae936f22ce80614287f2769e9aaa9a155f03cc15) - [#2](https://github.com/npm/cli/pull/2) - Move rest of commands to `npm-registry-fetch` and use [`figgy-pudding`](https://npm.im/figgy-pudding) for configs. - ([@zkat](https://github.com/zkat)) - -### NEW FEATURES - -* [`02c837e01`](https://github.com/npm/cli/commit/02c837e01a71a26f37cbd5a09be89df8a9ce01da) - [#106](https://github.com/npm/cli/pull/106) - Make `npm dist-tags` the same as `npm dist-tag ls`. - ([@isaacs](https://github.com/isaacs)) -* [`1065a7809`](https://github.com/npm/cli/commit/1065a7809161fd4dc23e96b642019fc842fdacf2) - [#65](https://github.com/npm/cli/pull/65) - Add support for `IBM i`. - ([@dmabupt](https://github.com/dmabupt)) -* [`a22e6f5fc`](https://github.com/npm/cli/commit/a22e6f5fc3e91350d3c64dcc88eabbe0efbca759) - [#131](https://github.com/npm/cli/pull/131) - Update profile to support new npm-profile API. - ([@zkat](https://github.com/zkat)) - -### BUGFIXES - -* [`890a74458`](https://github.com/npm/cli/commit/890a74458dd4a55e2d85f3eba9dbf125affa4206) - [npm.community#3278](https://npm.community/t/3278) - Fix support for passing git binary path config with `--git`. - ([@larsgw](https://github.com/larsgw)) -* [`90e55a143`](https://github.com/npm/cli/commit/90e55a143ed1de8678d65c17bc3c2b103a15ddac) - [npm.community#2713](https://npm.community/t/npx-envinfo-preset-jest-fails-on-windows-with-a-stack-trace/2713) - Check for `npm.config`'s existence in `error-handler.js` to prevent weird - errors when failures happen before config object is loaded. - ([@BeniCheni](https://github.com/BeniCheni)) -* [`134207174`](https://github.com/npm/cli/commit/134207174652e1eb6d7b0f44fd9858a0b6a0cd6c) - [npm.community#2569](https://npm.community/t/2569) - Fix checking for optional dependencies. - ([@larsgw](https://github.com/larsgw)) -* [`7a2f6b05d`](https://github.com/npm/cli/commit/7a2f6b05d27f3bcf47a48230db62e86afa41c9d3) - [npm.community#4172](https://npm.community/t/4172) - Remove tink experiments. - ([@larsgw](https://github.com/larsgw)) -* [`c5b6056b6`](https://github.com/npm/cli/commit/c5b6056b6b35eefb81ae5fb00a5c7681c5318c22) - [#123](https://github.com/npm/cli/pull/123) - Handle git branch references correctly. - ([@johanneswuerbach](https://github.com/johanneswuerbach)) -* [`f58b43ef2`](https://github.com/npm/cli/commit/f58b43ef2c5e3dea2094340a0cf264b2d11a5da4) - [npm.community#3983](https://npm.community/t/npm-audit-error-messaging-update-for-401s/3983) - Report any errors above 400 as potentially not supporting audit. - ([@zkat](https://github.com/zkat)) -* [`a5c9e6f35`](https://github.com/npm/cli/commit/a5c9e6f35a591a6e2d4b6ace5c01bc03f2b75fdc) - [#124](https://github.com/npm/cli/pull/124) - Set default homepage to an empty string. - ([@anchnk](https://github.com/anchnk)) -* [`5d076351d`](https://github.com/npm/cli/commit/5d076351d7ec1d3585942a9289548166a7fbbd4c) - [npm.community#4054](https://npm.community/t/4054) - Fix npm-prefix description. - ([@larsgw](https://github.com/larsgw)) - -### DOCS - -* [`31a7274b7`](https://github.com/npm/cli/commit/31a7274b70de18b24e7bee51daa22cc7cbb6141c) - [#71](https://github.com/npm/cli/pull/71) - Fix typo in npm-token documentation. - ([@GeorgeTaveras1231](https://github.com/GeorgeTaveras1231)) -* [`2401b7592`](https://github.com/npm/cli/commit/2401b7592c6ee114e6db7077ebf8c072b7bfe427) - Correct docs for fake-registry interface. - ([@iarna](https://github.com/iarna)) - -### DEPENDENCIES - -* [`9cefcdc1d`](https://github.com/npm/cli/commit/9cefcdc1d2289b56f9164d14d7e499e115cfeaee) - `npm-registry-fetch@3.8.0` - ([@zkat](https://github.com/zkat)) -* [`1c769c9b3`](https://github.com/npm/cli/commit/1c769c9b3e431d324c1a5b6dd10e1fddb5cb88c7) - `pacote@9.1.0` - ([@zkat](https://github.com/zkat)) -* [`f3bc5539b`](https://github.com/npm/cli/commit/f3bc5539b30446500abcc3873781b2c717f8e22c) - `figgy-pudding@3.5.1` - ([@zkat](https://github.com/zkat)) -* [`bf7199d3c`](https://github.com/npm/cli/commit/bf7199d3cbf50545da1ebd30d28f0a6ed5444a00) - `npm-profile@4.0.1` - ([@zkat](https://github.com/zkat)) -* [`118c50496`](https://github.com/npm/cli/commit/118c50496c01231cab3821ae623be6df89cb0a32) - `semver@5.5.1` - ([@isaacs](https://github.com/isaacs)) -* [`eab4df925`](https://github.com/npm/cli/commit/eab4df9250e9169c694b3f6c287d2932bf5e08fb) - `libcipm@3.0.2` - ([@zkat](https://github.com/zkat)) -* [`b86e51573`](https://github.com/npm/cli/commit/b86e515734faf433dc6c457c36c1de52795aa870) - `libnpm@1.4.0` - ([@zkat](https://github.com/zkat)) -* [`56fffbff2`](https://github.com/npm/cli/commit/56fffbff27fe2fae8bef27d946755789ef0d89bd) - `get-stream@4.1.0` - ([@zkat](https://github.com/zkat)) -* [`df972e948`](https://github.com/npm/cli/commit/df972e94868050b5aa42ac18b527fd929e1de9e4) - npm-profile@REMOVED - ([@zkat](https://github.com/zkat)) -* [`32c73bf0e`](https://github.com/npm/cli/commit/32c73bf0e3f0441d0c7c940292235d4b93aa87e2) - `libnpm@2.0.1` - ([@zkat](https://github.com/zkat)) -* [`569491b80`](https://github.com/npm/cli/commit/569491b8042f939dc13986b6adb2a0a260f95b63) - `licensee@5.0.0` - ([@zkat](https://github.com/zkat)) -* [`a3ba0ccf1`](https://github.com/npm/cli/commit/a3ba0ccf1fa86aec56b1ad49883abf28c1f56b3c) - move rimraf to prod deps - ([@zkat](https://github.com/zkat)) -* [`f63a0d6cf`](https://github.com/npm/cli/commit/f63a0d6cf0b7db3dcc80e72e1383c3df723c8119) - `spdx-license-ids@3.0.3`: - Ref: https://github.com/npm/cli/pull/121 - ([@zkat](https://github.com/zkat)) -* [`f350e714f`](https://github.com/npm/cli/commit/f350e714f66a77f71a7ebe17daeea2ea98179a1a) - `aproba@2.0.0` - ([@aeschright](https://github.com/aeschright)) -* [`a67e4d8b2`](https://github.com/npm/cli/commit/a67e4d8b214e58ede037c3854961acb33fd889da) - `byte-size@5.0.1` - ([@aeschright](https://github.com/aeschright)) -* [`8bea4efa3`](https://github.com/npm/cli/commit/8bea4efa34857c4e547904b3630dd442def241de) - `cacache@11.3.2` - ([@aeschright](https://github.com/aeschright)) -* [`9d4776836`](https://github.com/npm/cli/commit/9d4776836a4eaa4b19701b4e4f00cd64578bf078) - `chownr@1.1.1` - ([@aeschright](https://github.com/aeschright)) -* [`70da139e9`](https://github.com/npm/cli/commit/70da139e97ed1660c216e2d9b3f9cfb986bfd4a4) - `ci-info@2.0.0` - ([@aeschright](https://github.com/aeschright)) -* [`bcdeddcc3`](https://github.com/npm/cli/commit/bcdeddcc3d4dc242f42404223dafe4afdc753b32) - `cli-table3@0.5.1` - ([@aeschright](https://github.com/aeschright)) -* [`63aab82c7`](https://github.com/npm/cli/commit/63aab82c7bfca4f16987cf4156ddebf8d150747c) - `is-cidr@3.0.0` - ([@aeschright](https://github.com/aeschright)) -* [`d522bd90c`](https://github.com/npm/cli/commit/d522bd90c3b0cb08518f249ae5b90bd609fff165) - `JSONStream@1.3.5` - ([@aeschright](https://github.com/aeschright)) -* [`2a59bfc79`](https://github.com/npm/cli/commit/2a59bfc7989bd5575d8cbba912977c6d1ba92567) - `libnpmhook@5.0.2` - ([@aeschright](https://github.com/aeschright)) -* [`66d60e394`](https://github.com/npm/cli/commit/66d60e394e5a96330f90e230505758f19a3643ac) - `marked@0.6.0` - ([@aeschright](https://github.com/aeschright)) -* [`8213def9a`](https://github.com/npm/cli/commit/8213def9aa9b6e702887e4f2ed7654943e1e4154) - `npm-packlist@1.2.0` - ([@aeschright](https://github.com/aeschright)) -* [`e4ffc6a2b`](https://github.com/npm/cli/commit/e4ffc6a2bfb8d0b7047cb6692030484760fc8c91) - `unique-filename@1.1.1` - ([@aeschright](https://github.com/aeschright)) -* [`09a5c2fab`](https://github.com/npm/cli/commit/09a5c2fabe0d1c00ec8c99f328f6d28a3495eb0b) - `semver@5.6.0` - ([@aeschright](https://github.com/aeschright)) -* [`740e79e17`](https://github.com/npm/cli/commit/740e79e17a78247f73349525043c9388ce94459a) - `rimraf@2.6.3` - ([@aeschright](https://github.com/aeschright)) -* [`455476c8d`](https://github.com/npm/cli/commit/455476c8d148ca83a4e030e96e93dcf1c7f0ff5f) - `require-inject@1.4.4` - ([@aeschright](https://github.com/aeschright)) -* [`3f40251c5`](https://github.com/npm/cli/commit/3f40251c5868feaacbcdbcb1360877ce76998f5e) - `npm-pick-manifest@2.2.3` - ([@aeschright](https://github.com/aeschright)) -* [`4ffa8a8e9`](https://github.com/npm/cli/commit/4ffa8a8e9e80e5562898dd76fe5a49f5694f38c8) - `query-string@6.2.0` - ([@aeschright](https://github.com/aeschright)) -* [`a0a0ca9ec`](https://github.com/npm/cli/commit/a0a0ca9ec2a962183d420fa751f4139969760f18) - `pacote@9.3.0` - ([@aeschright](https://github.com/aeschright)) -* [`5777ea8ad`](https://github.com/npm/cli/commit/5777ea8ad2058be3166a6dad2d31d2d393c9f778) - `readable-stream@3.1.1` - ([@aeschright](https://github.com/aeschright)) -* [`887e94386`](https://github.com/npm/cli/commit/887e94386f42cb59a5628e7762b3662d084b23c8) - `lru-cache@4.1.5` - ([@aeschright](https://github.com/aeschright)) -* [`41f15524c`](https://github.com/npm/cli/commit/41f15524c58c59d206c4b1d25ae9e0f22745213b) - Updating semver docs. - ([@aeschright](https://github.com/aeschright)) -* [`fb3bbb72d`](https://github.com/npm/cli/commit/fb3bbb72d448ac37a465b31233b21381917422f3) - `npm-audit-report@1.3.2`: - ([@melkikh](https://github.com/melkikh)) - -### TESTING - -* [`f1edffba9`](https://github.com/npm/cli/commit/f1edffba90ebd96cf88675d2e18ebc48954ba50e) - Modernize maketest script. - ([@iarna](https://github.com/iarna)) -* [`ae263473d`](https://github.com/npm/cli/commit/ae263473d92a896b482830d4019a04b5dbd1e9d7) - maketest: Use promise based example common.npm call. - ([@iarna](https://github.com/iarna)) -* [`d9970da5e`](https://github.com/npm/cli/commit/d9970da5ee97a354eab01cbf16f9101693a15d2d) - maketest: Use newEnv for env production. - ([@iarna](https://github.com/iarna)) - -### MISCELLANEOUS - -* [`c665f35aa`](https://github.com/npm/cli/commit/c665f35aacdb8afdbe35f3dd7ccb62f55ff6b896) - [#119](https://github.com/npm/cli/pull/119) - Replace var with const/let in lib/repo.js. - ([@watilde](https://github.com/watilde)) -* [`46639ba9f`](https://github.com/npm/cli/commit/46639ba9f04ea729502f1af28b02eb67fb6dcb66) - Update package-lock.json for https tarball URLs - ([@aeschright](https://github.com/aeschright)) - -## v6.5.0 (2018-11-28): - -### NEW FEATURES - -* [`fc1a8d185`](https://github.com/npm/cli/commit/fc1a8d185fc678cdf3784d9df9eef9094e0b2dec) - Backronym `npm ci` to `npm clean-install`. - ([@zkat](https://github.com/zkat)) -* [`4be51a9cc`](https://github.com/npm/cli/commit/4be51a9cc65635bb26fa4ce62233f26e0104bc20) - [#81](https://github.com/npm/cli/pull/81) - Adds 'Homepage' to outdated --long output. - ([@jbottigliero](https://github.com/jbottigliero)) - -### BUGFIXES - -* [`89652cb9b`](https://github.com/npm/cli/commit/89652cb9b810f929f5586fc90cc6794d076603fb) - [npm.community#1661](https://npm.community/t/1661) - Fix sign-git-commit options. They were previously totally wrong. - ([@zkat](https://github.com/zkat)) -* [`414f2d1a1`](https://github.com/npm/cli/commit/414f2d1a1bdffc02ed31ebb48a43216f284c21d4) - [npm.community#1742](https://npm.community/t/npm-audit-making-non-rfc-compliant-requests-to-server-resulting-in-400-bad-request-pr-with-fix/1742) - Set lowercase headers for npm audit requests. - ([@maartenba](https://github.com/maartenba)) -* [`a34246baf`](https://github.com/npm/cli/commit/a34246bafe73218dc9e3090df9ee800451db2c7d) - [#75](https://github.com/npm/cli/pull/75) - Fix `npm edit` handling of scoped packages. - ([@larsgw](https://github.com/larsgw)) -* [`d3e8a7c72`](https://github.com/npm/cli/commit/d3e8a7c7240dd25379a5bcad324a367c58733c73) - [npm.community#2303](https://npm.community/t/npm-ci-logs-success-to-stderr/2303) - Make summary output for `npm ci` go to `stdout`, not `stderr`. - ([@alopezsanchez](https://github.com/alopezsanchez)) -* [`71d8fb4a9`](https://github.com/npm/cli/commit/71d8fb4a94d65e1855f6d0c5f2ad2b7c3202e3c4) - [npm.community#1377](https://npm.community/t/unhelpful-error-message-when-publishing-without-logging-in-error-eperm-operation-not-permitted-unlink/1377/3) - Close the file descriptor during publish if exiting upload via an error. This - will prevent strange error messages when the upload fails and make sure - cleanup happens correctly. - ([@macdja38](https://github.com/macdja38)) - -### DOCS UPDATES - -* [`b1a8729c8`](https://github.com/npm/cli/commit/b1a8729c80175243fbbeecd164e9ddd378a09a50) - [#60](https://github.com/npm/cli/pull/60) - Mention --otp flag when prompting for OTP. - ([@bakkot](https://github.com/bakkot)) -* [`bcae4ea81`](https://github.com/npm/cli/commit/bcae4ea8173e489a76cc226bbd30dd9eabe21ec6) - [#64](https://github.com/npm/cli/pull/64) - Clarify that git dependencies use the default branch, not just `master`. - ([@zckrs](https://github.com/zckrs)) -* [`15da82690`](https://github.com/npm/cli/commit/15da8269032bf509ade3252978e934f2a61d4499) - [#72](https://github.com/npm/cli/pull/72) - `bash_completion.d` dir is sometimes found in `/etc` not `/usr/local`. - ([@RobertKielty](https://github.com/RobertKielty)) -* [`8a6ecc793`](https://github.com/npm/cli/commit/8a6ecc7936dae2f51638397ff5a1d35cccda5495) - [#74](https://github.com/npm/cli/pull/74) - Update OTP documentation for `dist-tag add` to clarify `--otp` is needed right - now. - ([@scotttrinh](https://github.com/scotttrinh)) -* [`dcc03ec85`](https://github.com/npm/cli/commit/dcc03ec858bddd7aa2173b5a86b55c1c2385a2a3) - [#82](https://github.com/npm/cli/pull/82) - Note that `prepare` runs when installing git dependencies. - ([@seishun](https://github.com/seishun)) -* [`a91a470b7`](https://github.com/npm/cli/commit/a91a470b71e08ccf6a75d4fb8c9937789fa8d067) - [#83](https://github.com/npm/cli/pull/83) - Specify that --dry-run isn't available in older versions of npm publish. - ([@kjin](https://github.com/kjin)) -* [`1b2fabcce`](https://github.com/npm/cli/commit/1b2fabccede37242233755961434c52536224de5) - [#96](https://github.com/npm/cli/pull/96) - Fix inline code tag issue in docs. - ([@midare](https://github.com/midare)) -* [`6cc70cc19`](https://github.com/npm/cli/commit/6cc70cc1977e58a3e1ea48e660ffc6b46b390e59) - [#68](https://github.com/npm/cli/pull/68) - Add semver link and a note on empty string format to `deprecate` doc. - ([@neverett](https://github.com/neverett)) -* [`61dbbb7c3`](https://github.com/npm/cli/commit/61dbbb7c3474834031bce88c423850047e8131dc) - Fix semver docs after version update. - ([@zkat](https://github.com/zkat)) -* [`4acd45a3d`](https://github.com/npm/cli/commit/4acd45a3d0ce92f9999446226fe7dfb89a90ba2e) - [#78](https://github.com/npm/cli/pull/78) - Correct spelling across various docs. - ([@hugovk](https://github.com/hugovk)) - -### DEPENDENCIES - -* [`4f761283e`](https://github.com/npm/cli/commit/4f761283e8896d0ceb5934779005646463a030e8) - `figgy-pudding@3.5.1` - ([@zkat](https://github.com/zkat)) -* [`3706db0bc`](https://github.com/npm/cli/commit/3706db0bcbc306d167bb902362e7f6962f2fe1a1) - [npm.community#1764](https://npm.community/t/crash-invalid-config-key-requested-error/1764) - `ssri@6.0.1` - ([@zkat](https://github.com/zkat)) -* [`83c2b117d`](https://github.com/npm/cli/commit/83c2b117d0b760d0ea8d667e5e4bdfa6a7a7a8f6) - `bluebird@3.5.2` - ([@petkaantonov](https://github.com/petkaantonov)) -* [`2702f46bd`](https://github.com/npm/cli/commit/2702f46bd7284fb303ca2119d23c52536811d705) - `ci-info@1.5.1` - ([@watson](https://github.com/watson)) -* [`4db6c3898`](https://github.com/npm/cli/commit/4db6c3898b07100e3a324e4aae50c2fab4b93a04) - `config-chain@1.1.1`:2 - ([@dawsbot](https://github.com/dawbot)) -* [`70bee4f69`](https://github.com/npm/cli/commit/70bee4f69bb4ce4e18c48582fe2b48d8b4aba566) - `glob@7.1.3` - ([@isaacs](https://github.com/isaacs)) -* [`e469fd6be`](https://github.com/npm/cli/commit/e469fd6be95333dcaa7cf377ca3620994ca8d0de) - `opener@1.5.1`: - Fix browser opening under Windows Subsystem for Linux (WSL). - ([@thijsputman](https://github.com/thijsputman)) -* [`03840dced`](https://github.com/npm/cli/commit/03840dced865abdca6e6449ea030962e5b19db0c) - `semver@5.5.1` - ([@iarna](https://github.com/iarna)) -* [`161dc0b41`](https://github.com/npm/cli/commit/161dc0b4177e76306a0e3b8660b3b496cc3db83b) - `bluebird@3.5.3` - ([@petkaantonov](https://github.com/petkaantonov)) -* [`bb6f94395`](https://github.com/npm/cli/commit/bb6f94395491576ec42996ff6665df225f6b4377) - `graceful-fs@4.1.1`:5 - ([@isaacs](https://github.com/isaacs)) -* [`43b1f4c91`](https://github.com/npm/cli/commit/43b1f4c91fa1d7b3ebb6aa2d960085e5f3ac7607) - `tar@4.4.8` - ([@isaacs](https://github.com/isaacs)) -* [`ab62afcc4`](https://github.com/npm/cli/commit/ab62afcc472de82c479bf91f560a0bbd6a233c80) - `npm-packlist@1.1.1`:2 - ([@isaacs](https://github.com/isaacs)) -* [`027f06be3`](https://github.com/npm/cli/commit/027f06be35bb09f390e46fcd2b8182539939d1f7) - `ci-info@1.6.0` - ([@watson](https://github.com/watson)) - -### MISCELLANEOUS - -* [`27217dae8`](https://github.com/npm/cli/commit/27217dae8adbc577ee9cb323b7cfe9c6b2493aca) - [#70](https://github.com/npm/cli/pull/70) - Automatically audit dependency licenses for npm itself. - ([@kemitchell](https://github.com/kemitchell)) - -## v6.4.1 (2018-08-22): - -### BUGFIXES - -* [`4bd40f543`](https://github.com/npm/cli/commit/4bd40f543dc89f0721020e7d0bb3497300d74818) - [#42](https://github.com/npm/cli/pull/42) - Prevent blowing up on malformed responses from the `npm audit` endpoint, such - as with third-party registries. - ([@framp](https://github.com/framp)) -* [`0e576f0aa`](https://github.com/npm/cli/commit/0e576f0aa6ea02653d948c10f29102a2d4a31944) - [#46](https://github.com/npm/cli/pull/46) - Fix `NO_PROXY` support by renaming npm-side config to `--noproxy`. The - environment variable should still work. - ([@SneakyFish5](https://github.com/SneakyFish5)) -* [`d8e811d6a`](https://github.com/npm/cli/commit/d8e811d6adf3d87474982cb831c11316ac725605) - [#33](https://github.com/npm/cli/pull/33) - Disable `update-notifier` checks when a CI environment is detected. - ([@Sibiraj-S](https://github.com/Sibiraj-S)) -* [`1bc5b8cea`](https://github.com/npm/cli/commit/1bc5b8ceabc86bfe4777732f25ffef0f3de81bd1) - [#47](https://github.com/npm/cli/pull/47) - Fix issue where `postpack` scripts would break if `pack` was used with - `--dry-run`. - ([@larsgw](https://github.com/larsgw)) - -### DEPENDENCY BUMPS - -* [`4c57316d5`](https://github.com/npm/cli/commit/4c57316d5633e940105fa545b52d8fbfd2eb9f75) - `figgy-pudding@3.4.1` - ([@zkat](https://github.com/zkat)) -* [`85f4d7905`](https://github.com/npm/cli/commit/85f4d79059865d5267f3516b6cdbc746012202c6) - `cacache@11.2.0` - ([@zkat](https://github.com/zkat)) -* [`d20ac242a`](https://github.com/npm/cli/commit/d20ac242aeb44aa3581c65c052802a02d5eb22f3) - `npm-packlist@1.1.11`: - No real changes in npm-packlist, but npm-bundled included a - circular dependency fix, as well as adding a proper LICENSE file. - ([@isaacs](https://github.com/isaacs)) -* [`e8d5f4418`](https://github.com/npm/cli/commit/e8d5f441821553a31fc8cd751670663699d2c8ce) - [npm.community#632](https://npm.community/t/using-npm-ci-does-not-run-prepare-script-for-git-modules/632) - `libcipm@2.0.2`: - Fixes issue where `npm ci` wasn't running the `prepare` lifecycle script when - installing git dependencies - ([@edahlseng](https://github.com/edahlseng)) -* [`a5e6f78e9`](https://github.com/npm/cli/commit/a5e6f78e916873f7d18639ebdb8abd20479615a9) - `JSONStream@1.3.4`: - Fixes memory leak problem when streaming large files (like legacy npm search). - ([@daern91](https://github.com/daern91)) -* [`3b940331d`](https://github.com/npm/cli/commit/3b940331dcccfa67f92366adb7ffd9ecf7673a9a) - [npm.community#1042](https://npm.community/t/3-path-variables-are-assigned-to-child-process-launched-by-npm/1042) - `npm-lifecycle@2.1.0`: - Fixes issue for Windows user where multiple `Path`/`PATH` variables were being - added to the environment and breaking things in all sorts of fun and - interesting ways. - ([@JimiC](https://github.com/JimiC)) -* [`d612d2ce8`](https://github.com/npm/cli/commit/d612d2ce8fab72026f344f125539ecbf3746af9a) - `npm-registry-client@8.6.0` - ([@iarna](https://github.com/iarna)) -* [`1f6ba1cb1`](https://github.com/npm/cli/commit/1f6ba1cb174590c1f5d2b00e2ca238dfa39d507a) - `opener@1.5.0` - ([@domenic](https://github.com/domenic)) -* [`37b8f405f`](https://github.com/npm/cli/commit/37b8f405f35c861b7beeed56f71ad20b0bf87889) - `request@2.88.0` - ([@mikeal](https://github.com/mikeal)) -* [`bb91a2a14`](https://github.com/npm/cli/commit/bb91a2a14562e77769057f1b6d06384be6d6bf7f) - `tacks@1.2.7` - ([@iarna](https://github.com/iarna)) -* [`30bc9900a`](https://github.com/npm/cli/commit/30bc9900ae79c80bf0bdee0ae6372da6f668124c) - `ci-info@1.4.0`: - Adds support for two more CI services - ([@watson](https://github.com/watson)) -* [`1d2fa4ddd`](https://github.com/npm/cli/commit/1d2fa4dddcab8facfee92096cc24b299387f3182) - `marked@0.5.0` - ([@joshbruce](https://github.com/joshbruce)) - -### DOCUMENTATION - -* [`08ecde292`](https://github.com/npm/cli/commit/08ecde2928f8c89a2fdaa800ae845103750b9327) - [#54](https://github.com/npm/cli/pull/54) - Mention registry terms of use in manpage and registry docs and update language - in README for it. - ([@kemitchell](https://github.com/kemitchell)) -* [`de956405d`](https://github.com/npm/cli/commit/de956405d8b72354f98579d00c6dd30ac3b9bddf) - [#41](https://github.com/npm/cli/pull/41) - Add documentation for `--dry-run` in `install` and `pack` docs. - ([@reconbot](https://github.com/reconbot)) -* [`95031b90c`](https://github.com/npm/cli/commit/95031b90ce0b0c4dcd5e4eafc86e3e5bfd59fb3e) - [#48](https://github.com/npm/cli/pull/48) - Update republish time and lightly reorganize republish info. - ([@neverett](https://github.com/neverett)) -* [`767699b68`](https://github.com/npm/cli/commit/767699b6829b8b899d5479445e99b0ffc43ff92d) - [#53](https://github.com/npm/cli/pull/53) - Correct `npm@6.4.0` release date in changelog. - ([@charmander](https://github.com/charmander)) -* [`3fea3166e`](https://github.com/npm/cli/commit/3fea3166eb4f43f574fcfd9ee71a171feea2bc29) - [#55](https://github.com/npm/cli/pull/55) - Align command descriptions in help text. - ([@erik](https://github.com/erik)) - -## v6.4.0 (2018-08-09): - -### NEW FEATURES - -* [`6e9f04b0b`](https://github.com/npm/cli/commit/6e9f04b0baed007169d4e0c341f097cf133debf7) - [npm/cli#8](https://github.com/npm/cli/pull/8) - Search for authentication token defined by environment variables by preventing - the translation layer from env variable to npm option from breaking - `:_authToken`. - ([@mkhl](https://github.com/mkhl)) -* [`84bfd23e7`](https://github.com/npm/cli/commit/84bfd23e7d6434d30595594723a6e1976e84b022) - [npm/cli#35](https://github.com/npm/cli/pull/35) - Stop filtering out non-IPv4 addresses from `local-addrs`, making npm actually - use IPv6 addresses when it must. - ([@valentin2105](https://github.com/valentin2105)) -* [`792c8c709`](https://github.com/npm/cli/commit/792c8c709dc7a445687aa0c8cba5c50bc4ed83fd) - [npm/cli#31](https://github.com/npm/cli/pull/31) - configurable audit level for non-zero exit - `npm audit` currently exits with exit code 1 if any vulnerabilities are found of any level. - Add a flag of `--audit-level` to `npm audit` to allow it to pass if only vulnerabilities below a certain level are found. - Example: `npm audit --audit-level=high` will exit with 0 if only low or moderate level vulns are detected. - ([@lennym](https://github.com/lennym)) - -### BUGFIXES - -* [`d81146181`](https://github.com/npm/cli/commit/d8114618137bb5b9a52a86711bb8dc18bfc8e60c) - [npm/cli#32](https://github.com/npm/cli/pull/32) - Don't check for updates to npm when we are updating npm itself. - ([@olore](https://github.com/olore)) - -### DEPENDENCY UPDATES - -A very special dependency update event! Since the [release of -`node-gyp@3.8.0`](https://github.com/nodejs/node-gyp/pull/1521), an awkward -version conflict that was preventing `request` from begin flattened was -resolved. This means two things: - -1. We've cut down the npm tarball size by another 200kb, to 4.6MB -2. `npm audit` now shows no vulnerabilities for npm itself! - -Thanks, [@rvagg](https://github.com/rvagg)! - -* [`866d776c2`](https://github.com/npm/cli/commit/866d776c27f80a71309389aaab42825b2a0916f6) - `request@2.87.0` - ([@simov](https://github.com/simov)) -* [`f861c2b57`](https://github.com/npm/cli/commit/f861c2b579a9d4feae1653222afcefdd4f0e978f) - `node-gyp@3.8.0` - ([@rvagg](https://github.com/rvagg)) -* [`32e6947c6`](https://github.com/npm/cli/commit/32e6947c60db865257a0ebc2f7e754fedf7a6fc9) - [npm/cli#39](https://github.com/npm/cli/pull/39) - `colors@1.1.2`: - REVERT REVERT, newer versions of this library are broken and print ansi - codes even when disabled. - ([@iarna](https://github.com/iarna)) -* [`beb96b92c`](https://github.com/npm/cli/commit/beb96b92caf061611e3faafc7ca10e77084ec335) - `libcipm@2.0.1` - ([@zkat](https://github.com/zkat)) -* [`348fc91ad`](https://github.com/npm/cli/commit/348fc91ad223ff91cd7bcf233018ea1d979a2af1) - `validate-npm-package-license@3.0.4`: Fixes errors with empty or string-only - license fields. - ([@Gudahtt](https://github.com/Gudahtt)) -* [`e57d34575`](https://github.com/npm/cli/commit/e57d3457547ef464828fc6f82ae4750f3e511550) - `iferr@1.0.2` - ([@shesek](https://github.com/shesek)) -* [`46f1c6ad4`](https://github.com/npm/cli/commit/46f1c6ad4b2fd5b0d7ec879b76b76a70a3a2595c) - `tar@4.4.6` - ([@isaacs](https://github.com/isaacs)) -* [`50df1bf69`](https://github.com/npm/cli/commit/50df1bf691e205b9f13e0fff0d51a68772c40561) - `hosted-git-info@2.7.1` - ([@iarna](https://github.com/iarna)) - ([@Erveon](https://github.com/Erveon)) - ([@huochunpeng](https://github.com/huochunpeng)) - -### DOCUMENTATION - -* [`af98e76ed`](https://github.com/npm/cli/commit/af98e76ed96af780b544962aa575585b3fa17b9a) - [npm/cli#34](https://github.com/npm/cli/pull/34) - Remove `npm publish` from list of commands not affected by `--dry-run`. - ([@joebowbeer](https://github.com/joebowbeer)) -* [`e2b0f0921`](https://github.com/npm/cli/commit/e2b0f092193c08c00f12a6168ad2bd9d6e16f8ce) - [npm/cli#36](https://github.com/npm/cli/pull/36) - Tweak formatting in repository field examples. - ([@noahbenham](https://github.com/noahbenham)) -* [`e2346e770`](https://github.com/npm/cli/commit/e2346e7702acccefe6d711168c2b0e0e272e194a) - [npm/cli#14](https://github.com/npm/cli/pull/14) - Used `process.env` examples to make accessing certain `npm run-scripts` - environment variables more clear. - ([@mwarger](https://github.com/mwarger)) - -## v6.3.0 (2018-08-01): - -This is basically the same as the prerelease, but two dependencies have been -bumped due to bugs that had been around for a while. - -* [`0a22be42e`](https://github.com/npm/cli/commit/0a22be42eb0d40cd0bd87e68c9e28fc9d72c0e19) - `figgy-pudding@3.2.0` - ([@zkat](https://github.com/zkat)) -* [`0096f6997`](https://github.com/npm/cli/commit/0096f69978d2f40b170b28096f269b0b0008a692) - `cacache@11.1.0` - ([@zkat](https://github.com/zkat)) - -## v6.3.0-next.0 (2018-07-25): - -### NEW FEATURES - -* [`ad0dd226f`](https://github.com/npm/cli/commit/ad0dd226fb97a33dcf41787ae7ff282803fb66f2) - [npm/cli#26](https://github.com/npm/cli/pull/26) - `npm version` now supports a `--preid` option to specify the preid for - prereleases. For example, `npm version premajor --preid rc` will tag a version - like `2.0.0-rc.0`. - ([@dwilches](https://github.com/dwilches)) - -### MESSAGING IMPROVEMENTS - -* [`c1dad1e99`](https://github.com/npm/cli/commit/c1dad1e994827f2eab7a13c0f6454f4e4c22ebc2) - [npm/cli#6](https://github.com/npm/cli/pull/6) - Make `npm audit fix` message provide better instructions for vulnerabilities - that require manual review. - ([@bradsk88](https://github.com/bradsk88)) -* [`15c1130fe`](https://github.com/npm/cli/commit/15c1130fe81961706667d845aad7a5a1f70369f3) - Fix missing colon next to tarball url in new `npm view` output. - ([@zkat](https://github.com/zkat)) -* [`21cf0ab68`](https://github.com/npm/cli/commit/21cf0ab68cf528d5244ae664133ef400bdcfbdb6) - [npm/cli#24](https://github.com/npm/cli/pull/24) - Use the default OTP explanation everywhere except when the context is - "OTP-aware" (like when setting double-authentication). This improves the - overall CLI messaging when prompting for an OTP code. - ([@jdeniau](https://github.com/jdeniau)) - -### MISC - -* [`a9ac8712d`](https://github.com/npm/cli/commit/a9ac8712dfafcb31a4e3deca24ddb92ff75e942d) - [npm/cli#21](https://github.com/npm/cli/pull/21) - Use the extracted `stringify-package` package. - ([@dpogue](https://github.com/dpogue)) -* [`9db15408c`](https://github.com/npm/cli/commit/9db15408c60be788667cafc787116555507dc433) - [npm/cli#27](https://github.com/npm/cli/pull/27) - `wrappy` was previously added to dependencies in order to flatten it, but we - no longer do legacy-style for npm itself, so it has been removed from - `package.json`. - ([@rickschubert](https://github.com/rickschubert)) - -### DOCUMENTATION - -* [`3242baf08`](https://github.com/npm/cli/commit/3242baf0880d1cdc0e20b546d3c1da952e474444) - [npm/cli#13](https://github.com/npm/cli/pull/13) - Update more dead links in README.md. - ([@u32i64](https://github.com/u32i64)) -* [`06580877b`](https://github.com/npm/cli/commit/06580877b6023643ec780c19d84fbe120fe5425c) - [npm/cli#19](https://github.com/npm/cli/pull/19) - Update links in docs' `index.html` to refer to new bug/PR URLs. - ([@watilde](https://github.com/watilde)) -* [`ca03013c2`](https://github.com/npm/cli/commit/ca03013c23ff38e12902e9569a61265c2d613738) - [npm/cli#15](https://github.com/npm/cli/pull/15) - Fix some typos in file-specifiers docs. - ([@Mstrodl](https://github.com/Mstrodl)) -* [`4f39f79bc`](https://github.com/npm/cli/commit/4f39f79bcacef11bf2f98d09730bc94d0379789b) - [npm/cli#16](https://github.com/npm/cli/pull/16) - Fix some typos in file-specifiers and package-lock docs. - ([@watilde](https://github.com/watilde)) -* [`35e51f79d`](https://github.com/npm/cli/commit/35e51f79d1a285964aad44f550811aa9f9a72cd8) - [npm/cli#18](https://github.com/npm/cli/pull/18) - Update build status badge url in README. - ([@watilde](https://github.com/watilde)) -* [`a67db5607`](https://github.com/npm/cli/commit/a67db5607ba2052b4ea44f66657f98b758fb4786) - [npm/cli#17](https://github.com/npm/cli/pull/17/) - Replace TROUBLESHOOTING.md with [posts in - npm.community](https://npm.community/c/support/troubleshooting). - ([@watilde](https://github.com/watilde)) -* [`e115f9de6`](https://github.com/npm/cli/commit/e115f9de65bf53711266152fc715a5012f7d3462) - [npm/cli#7](https://github.com/npm/cli/pull/7) - Use https URLs in documentation when appropriate. Happy [Not Secure Day](https://arstechnica.com/gadgets/2018/07/todays-the-day-that-chrome-brands-plain-old-http-as-not-secure/)! - ([@XhmikosR](https://github.com/XhmikosR)) - -## v6.2.0 (2018-07-13): - -In case you missed it, [we -moved!](https://blog.npmjs.org/post/175587538995/announcing-npmcommunity). We -look forward to seeing future PRs landing in -[npm/cli](https://github.com/npm/cli) in the future, and we'll be chatting with -you all in [npm.community](https://npm.community). Go check it out! - -This final release of `npm@6.2.0` includes a couple of features that weren't -quite ready on time but that we'd still like to include. Enjoy! - -### FEATURES - -* [`244b18380`](https://github.com/npm/npm/commit/244b18380ee55950b13c293722771130dbad70de) - [#20554](https://github.com/npm/npm/pull/20554) - Add support for tab-separated output for `npm audit` data with the - `--parseable` flag. - ([@luislobo](https://github.com/luislobo)) -* [`7984206e2`](https://github.com/npm/npm/commit/7984206e2f41b8d8361229cde88d68f0c96ed0b8) - [#12697](https://github.com/npm/npm/pull/12697) - Add new `sign-git-commit` config to control whether the git commit itself gets - signed, or just the tag (which is the default). - ([@tribou](https://github.com/tribou)) - -### FIXES - -* [`4c32413a5`](https://github.com/npm/npm/commit/4c32413a5b42e18a34afb078cf00eed60f08e4ff) - [#19418](https://github.com/npm/npm/pull/19418) - Do not use `SET` to fetch the env in git-bash or Cygwin. - ([@gucong3000](https://github.com/gucong3000)) - -### DEPENDENCY BUMPS - -* [`d9b2712a6`](https://github.com/npm/npm/commit/d9b2712a670e5e78334e83f89a5ed49616f1f3d3) - `request@2.81.0`: Downgraded to allow better deduplication. This does - introduce a bunch of `hoek`-related audit reports, but they don't affect npm - itself so we consider it safe. We'll upgrade `request` again once `node-gyp` - unpins it. - ([@simov](https://github.com/simov)) -* [`2ac48f863`](https://github.com/npm/npm/commit/2ac48f863f90166b2bbf2021ed4cc04343d2503c) - `node-gyp@3.7.0` - ([@MylesBorins](https://github.com/MylesBorins)) -* [`8dc6d7640`](https://github.com/npm/npm/commit/8dc6d76408f83ba35bda77a2ac1bdbde01937349) - `cli-table3@0.5.0`: `cli-table2` is unmaintained and required `lodash`. With - this dependency bump, we've removed `lodash` from our tree, which cut back - tarball size by another 300kb. - ([@Turbo87](https://github.com/Turbo87)) -* [`90c759fee`](https://github.com/npm/npm/commit/90c759fee6055cf61cf6709432a5e6eae6278096) - `npm-audit-report@1.3.1` - ([@zkat](https://github.com/zkat)) -* [`4231a0a1e`](https://github.com/npm/npm/commit/4231a0a1eb2be13931c3b71eba38c0709644302c) - Add `cli-table3` to bundleDeps. - ([@iarna](https://github.com/iarna)) -* [`322d9c2f1`](https://github.com/npm/npm/commit/322d9c2f107fd82a4cbe2f9d7774cea5fbf41b8d) - Make `standard` happy. - ([@iarna](https://github.com/iarna)) - -### DOCS - -* [`5724983ea`](https://github.com/npm/npm/commit/5724983ea8f153fb122f9c0ccab6094a26dfc631) - [#21165](https://github.com/npm/npm/pull/21165) - Fix some markdown formatting in npm-disputes.md. - ([@hchiam](https://github.com/hchiam)) -* [`738178315`](https://github.com/npm/npm/commit/738178315fe48e463028657ea7ae541c3d63d171) - [#20920](https://github.com/npm/npm/pull/20920) - Explicitly state that republishing an unpublished package requires a 72h - waiting period. - ([@gmattie](https://github.com/gmattie)) -* [`f0a372b07`](https://github.com/npm/npm/commit/f0a372b074cc43ee0e1be28dbbcef0d556b3b36c) - Replace references to the old repo or issue tracker. We're at npm/cli now! - ([@zkat](https://github.com/zkat)) - -## v6.2.0-next.1 (2018-07-05): - -This is a quick patch to the release to fix an issue that was preventing users -from installing `npm@next`. - -* [`ecdcbd745`](https://github.com/npm/npm/commit/ecdcbd745ae1edd9bdd102dc3845a7bc76e1c5fb) - [#21129](https://github.com/npm/npm/pull/21129) - Remove postinstall script that depended on source files, thus preventing - `npm@next` from being installable from the registry. - ([@zkat](https://github.com/zkat)) - -## v6.2.0-next.0 (2018-06-28): - -### NEW FEATURES - -* [`ce0793358`](https://github.com/npm/npm/commit/ce07933588ec2da1cc1980f93bdaa485d6028ae2) - [#20750](https://github.com/npm/npm/pull/20750) - You can now disable the update notifier entirely by using - `--no-update-notifier` or setting it in your config with `npm config set - update-notifier false`. - ([@travi](https://github.com/travi)) -* [`d2ad776f6`](https://github.com/npm/npm/commit/d2ad776f6dcd92ae3937465736dcbca171131343) - [#20879](https://github.com/npm/npm/pull/20879) - When `npm run-script

npm access

+

npm access

Set access level on published packages

Synopsis

npm access public [<package>]
@@ -137,15 +139,15 @@ 

See Also

👀 Found a typo? Let us know!

The current stable version of npm is here. To upgrade, run: npm install npm@latest -g

To report bugs or submit feature requests for the docs, please post here. Submit npm issues here.

\ No newline at end of file +
\ No newline at end of file diff --git a/deps/npm/docs/public/cli-commands/npm-adduser/index.html b/deps/npm/docs/public/cli-commands/npm-adduser/index.html index 80d72bfe5b68f0..e9326cd06b3a04 100644 --- a/deps/npm/docs/public/cli-commands/npm-adduser/index.html +++ b/deps/npm/docs/public/cli-commands/npm-adduser/index.html @@ -1,4 +1,4 @@ -

+

section: cli-commands title: npm-adduser description: Set access level on published packages

@@ -132,15 +134,15 @@

See Also

👀 Found a typo? Let us know!

The current stable version of npm is here. To upgrade, run: npm install npm@latest -g

To report bugs or submit feature requests for the docs, please post here. Submit npm issues here.

\ No newline at end of file +
\ No newline at end of file diff --git a/deps/npm/docs/public/cli-commands/npm-audit/index.html b/deps/npm/docs/public/cli-commands/npm-audit/index.html index 1ce2b7d9d311d5..3b296a99d86883 100644 --- a/deps/npm/docs/public/cli-commands/npm-audit/index.html +++ b/deps/npm/docs/public/cli-commands/npm-audit/index.html @@ -1,4 +1,4 @@ -

npm audit

+

npm audit

Run a security audit

Synopsis

npm audit [--json|--parseable|--audit-level=(low|moderate|high|critical)]
@@ -155,14 +157,14 @@ 

See Also

👀 Found a typo? Let us know!

The current stable version of npm is here. To upgrade, run: npm install npm@latest -g

To report bugs or submit feature requests for the docs, please post here. Submit npm issues here.

\ No newline at end of file +
\ No newline at end of file diff --git a/deps/npm/docs/public/cli-commands/npm-bin/index.html b/deps/npm/docs/public/cli-commands/npm-bin/index.html index 650cb7416279ef..f249285676bf69 100644 --- a/deps/npm/docs/public/cli-commands/npm-bin/index.html +++ b/deps/npm/docs/public/cli-commands/npm-bin/index.html @@ -1,4 +1,4 @@ -

npm bin

+

npm bin

Display npm bin folder

Synopsis

npm bin [-g|--global]
@@ -82,16 +84,16 @@

Print the folder where npm will install executables.

See Also

👀 Found a typo? Let us know!

The current stable version of npm is here. To upgrade, run: npm install npm@latest -g

To report bugs or submit feature requests for the docs, please post here. Submit npm issues here.

\ No newline at end of file +
\ No newline at end of file diff --git a/deps/npm/docs/public/cli-commands/npm-bugs/index.html b/deps/npm/docs/public/cli-commands/npm-bugs/index.html index a3c06a02ea97de..eb90fe305e967d 100644 --- a/deps/npm/docs/public/cli-commands/npm-bugs/index.html +++ b/deps/npm/docs/public/cli-commands/npm-bugs/index.html @@ -1,4 +1,4 @@ -

npm bugs

+

npm bugs

Bugs for a package in a web browser maybe

Synopsis

-
npm bugs [<pkgname>]
+
npm bugs [<pkgname> [<pkgname> ...]]
 
 aliases: issues

Description

@@ -89,9 +91,12 @@

browser

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

The browser that is called by the npm bugs command to open websites.

+

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

+

Set to true to use default system URL opener.

registry

👀 Found a typo? Let us know!

The current stable version of npm is here. To upgrade, run: npm install npm@latest -g

To report bugs or submit feature requests for the docs, please post here. Submit npm issues here.

\ No newline at end of file +
\ No newline at end of file diff --git a/deps/npm/docs/public/cli-commands/npm-build/index.html b/deps/npm/docs/public/cli-commands/npm-build/index.html deleted file mode 100644 index 12afed16620096..00000000000000 --- a/deps/npm/docs/public/cli-commands/npm-build/index.html +++ /dev/null @@ -1,103 +0,0 @@ -

npm build

-

Build a package

-

Synopsis

-
npm build [<package-folder>]
-
    -
  • <package-folder>: -A folder containing a package.json file in its root.
  • -
-

Description

-

This is the plumbing command called by npm link and npm install.

-

It should generally be called during installation, but if you need to run it -directly, run:

-
    npm run-script build
-

See Also

-

👀 Found a typo? Let us know!

The current stable version of npm is here. To upgrade, run: npm install npm@latest -g

To report bugs or submit feature requests for the docs, please post here. Submit npm issues here.

\ No newline at end of file diff --git a/deps/npm/docs/public/cli-commands/npm-bundle/index.html b/deps/npm/docs/public/cli-commands/npm-bundle/index.html index a686be6653710e..899cba5fe45fe6 100644 --- a/deps/npm/docs/public/cli-commands/npm-bundle/index.html +++ b/deps/npm/docs/public/cli-commands/npm-bundle/index.html @@ -1,4 +1,4 @@ -

npm bundle

+

npm bundle

REMOVED

Description

The npm bundle command has been removed in 1.0, for the simple reason @@ -83,12 +85,12 @@

Just use npm install now to do what npm bundle used to do.

See Also

👀 Found a typo? Let us know!

The current stable version of npm is here. To upgrade, run: npm install npm@latest -g

To report bugs or submit feature requests for the docs, please post here. Submit npm issues here.

\ No newline at end of file +
\ No newline at end of file diff --git a/deps/npm/docs/public/cli-commands/npm-cache/index.html b/deps/npm/docs/public/cli-commands/npm-cache/index.html index a6275295a6e187..8ad8bbb7eaab63 100644 --- a/deps/npm/docs/public/cli-commands/npm-cache/index.html +++ b/deps/npm/docs/public/cli-commands/npm-cache/index.html @@ -1,4 +1,4 @@ -

npm cache

+

npm cache

Manipulates packages cache

Synopsis

👀 Found a typo? Let us know!

The current stable version of npm is here. To upgrade, run: npm install npm@latest -g

To report bugs or submit feature requests for the docs, please post here. Submit npm issues here.

\ No newline at end of file +
\ No newline at end of file diff --git a/deps/npm/docs/public/cli-commands/npm-ci/index.html b/deps/npm/docs/public/cli-commands/npm-ci/index.html index 5c0d7722ded423..d7f0143d361c73 100644 --- a/deps/npm/docs/public/cli-commands/npm-ci/index.html +++ b/deps/npm/docs/public/cli-commands/npm-ci/index.html @@ -1,4 +1,4 @@ -

npm ci

+

npm ci

Install a project with a clean slate

Synopsis

npm ci
@@ -96,7 +98,7 @@

"$HOME/.npm"

Description

-

This command is similar to npm install, except it's meant to be used in +

This command is similar to npm install, except it's meant to be used in automated environments such as test platforms, continuous integration, and deployment -- or any situation where you want to make sure you're doing a clean install of your dependencies. It can be significantly faster than a regular npm @@ -113,13 +115,13 @@

See Also

👀 Found a typo? Let us know!

The current stable version of npm is here. To upgrade, run: npm install npm@latest -g

To report bugs or submit feature requests for the docs, please post here. Submit npm issues here.

\ No newline at end of file +
\ No newline at end of file diff --git a/deps/npm/docs/public/cli-commands/npm-completion/index.html b/deps/npm/docs/public/cli-commands/npm-completion/index.html index 692f97359b3f97..38509399d730ba 100644 --- a/deps/npm/docs/public/cli-commands/npm-completion/index.html +++ b/deps/npm/docs/public/cli-commands/npm-completion/index.html @@ -1,4 +1,4 @@ -

npm completion

+

npm completion

Tab Completion for npm

Synopsis

source <(npm completion)
@@ -97,11 +99,11 @@

npm developers
  • npm
  • -

    👀 Found a typo? Let us know!

    The current stable version of npm is here. To upgrade, run: npm install npm@latest -g

    To report bugs or submit feature requests for the docs, please post here. Submit npm issues here.

    \ No newline at end of file +
    \ No newline at end of file diff --git a/deps/npm/docs/public/cli-commands/npm-config/index.html b/deps/npm/docs/public/cli-commands/npm-config/index.html index 8da04568e36128..44cdce664c2670 100644 --- a/deps/npm/docs/public/cli-commands/npm-config/index.html +++ b/deps/npm/docs/public/cli-commands/npm-config/index.html @@ -1,4 +1,4 @@ -

    npm config

    +

    npm config

    Manage the npm configuration files

    Synopsis

    npm config set <key> <value> [-g|--global]
    @@ -117,15 +119,15 @@ 

    See Also

    👀 Found a typo? Let us know!

    The current stable version of npm is here. To upgrade, run: npm install npm@latest -g

    To report bugs or submit feature requests for the docs, please post here. Submit npm issues here.

    \ No newline at end of file +
    \ No newline at end of file diff --git a/deps/npm/docs/public/cli-commands/npm-dedupe/index.html b/deps/npm/docs/public/cli-commands/npm-dedupe/index.html index f5eed4eb8be125..b328aa18cc1cba 100644 --- a/deps/npm/docs/public/cli-commands/npm-dedupe/index.html +++ b/deps/npm/docs/public/cli-commands/npm-dedupe/index.html @@ -1,4 +1,4 @@ -

    npm dedupe

    +

    npm dedupe

    Reduce duplication

    Synopsis

    👀 Found a typo? Let us know!

    The current stable version of npm is here. To upgrade, run: npm install npm@latest -g

    To report bugs or submit feature requests for the docs, please post here. Submit npm issues here.

    \ No newline at end of file +
    \ No newline at end of file diff --git a/deps/npm/docs/public/cli-commands/npm-deprecate/index.html b/deps/npm/docs/public/cli-commands/npm-deprecate/index.html index 6dedf68aa434e1..22b755c00494b3 100644 --- a/deps/npm/docs/public/cli-commands/npm-deprecate/index.html +++ b/deps/npm/docs/public/cli-commands/npm-deprecate/index.html @@ -1,4 +1,4 @@ -

    npm deprecate

    +

    npm deprecate

    Deprecate a version of a package

    Synopsis

    npm deprecate <pkg>[@<version>] <message>
    @@ -91,13 +93,13 @@

    See Also

    👀 Found a typo? Let us know!

    The current stable version of npm is here. To upgrade, run: npm install npm@latest -g

    To report bugs or submit feature requests for the docs, please post here. Submit npm issues here.

    \ No newline at end of file +
    \ No newline at end of file diff --git a/deps/npm/docs/public/cli-commands/npm-dist-tag/index.html b/deps/npm/docs/public/cli-commands/npm-dist-tag/index.html index 02a1d7e90e0ad5..13ac9d2cfd08cd 100644 --- a/deps/npm/docs/public/cli-commands/npm-dist-tag/index.html +++ b/deps/npm/docs/public/cli-commands/npm-dist-tag/index.html @@ -1,4 +1,4 @@ -

    +

    section: cli-commands title: npm-dist-tag description: Modify package distribution tags

    @@ -136,17 +138,17 @@

    v.

    See Also

    👀 Found a typo? Let us know!

    The current stable version of npm is here. To upgrade, run: npm install npm@latest -g

    To report bugs or submit feature requests for the docs, please post here. Submit npm issues here.

    \ No newline at end of file +
    \ No newline at end of file diff --git a/deps/npm/docs/public/cli-commands/npm-docs/index.html b/deps/npm/docs/public/cli-commands/npm-docs/index.html index 36ebdd7436459c..a93b68af29051e 100644 --- a/deps/npm/docs/public/cli-commands/npm-docs/index.html +++ b/deps/npm/docs/public/cli-commands/npm-docs/index.html @@ -1,4 +1,4 @@ -

    npm docs

    +

    npm docs

    Docs for a package in a web browser maybe

    Synopsis

    npm docs [<pkgname> [<pkgname> ...]]
    -npm docs .
    -npm home [<pkgname> [<pkgname> ...]]
    -npm home .
    + +aliases: home

    Description

    This command tries to guess at the likely location of a package's documentation URL, and then tries to open it using the --browser @@ -91,9 +92,12 @@

    browser

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

    The browser that is called by the npm docs command to open websites.

    +

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

    +

    Set to true to use default system URL opener.

    registry

    👀 Found a typo? Let us know!

    The current stable version of npm is here. To upgrade, run: npm install npm@latest -g

    To report bugs or submit feature requests for the docs, please post here. Submit npm issues here.

    \ No newline at end of file +
    \ No newline at end of file diff --git a/deps/npm/docs/public/cli-commands/npm-doctor/index.html b/deps/npm/docs/public/cli-commands/npm-doctor/index.html index e6827207474d10..d5b1cc22f6c434 100644 --- a/deps/npm/docs/public/cli-commands/npm-doctor/index.html +++ b/deps/npm/docs/public/cli-commands/npm-doctor/index.html @@ -1,4 +1,4 @@ -

    npm doctor

    +

    npm doctor

    Check your environments

    Synopsis

    npm doctor
    @@ -153,14 +155,14 @@

    npm cache clean and reset the cache.

    See Also

    👀 Found a typo? Let us know!

    The current stable version of npm is here. To upgrade, run: npm install npm@latest -g

    To report bugs or submit feature requests for the docs, please post here. Submit npm issues here.

    \ No newline at end of file +
    \ No newline at end of file diff --git a/deps/npm/docs/public/cli-commands/npm-edit/index.html b/deps/npm/docs/public/cli-commands/npm-edit/index.html index 395a4970318e1e..f3997342b5f31e 100644 --- a/deps/npm/docs/public/cli-commands/npm-edit/index.html +++ b/deps/npm/docs/public/cli-commands/npm-edit/index.html @@ -1,4 +1,4 @@ -

    npm edit

    +

    npm edit

    Edit an installed package

    Synopsis

    npm edit <pkg>[/<subpkg>...]
    @@ -99,15 +101,15 @@

    See Also

    👀 Found a typo? Let us know!

    The current stable version of npm is here. To upgrade, run: npm install npm@latest -g

    To report bugs or submit feature requests for the docs, please post here. Submit npm issues here.

    \ No newline at end of file +
    \ No newline at end of file diff --git a/deps/npm/docs/public/cli-commands/npm-exec/index.html b/deps/npm/docs/public/cli-commands/npm-exec/index.html new file mode 100644 index 00000000000000..4965461066b458 --- /dev/null +++ b/deps/npm/docs/public/cli-commands/npm-exec/index.html @@ -0,0 +1,209 @@ +

    npm exec

    +

    Run a command from a local or remote npm package

    +

    Synopsis

    +
    npm exec -- <pkg>[@<version>] [args...]
    +npm exec -p <pkg>[@<version>] -- <cmd> [args...]
    +npm exec -c '<cmd> [args...]'
    +npm exec -p foo -c '<cmd> [args...]'
    +
    +npx <pkg>[@<specifier>] [args...]
    +npx -p <pkg>[@<specifier>] <cmd> [args...]
    +npx -c '<cmd> [args...]'
    +npx -p <pkg>[@<specifier>] -c '<cmd> [args...]'
    +
    +alias: npm x, npx
    +
    +-p <pkg> --package=<pkg> (may be specified multiple times)
    +-c <cmd> --call=<cmd> (may not be mixed with positional arguments)
    +

    Description

    +

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

    +

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

    +

    If any requested packages are not present in the local project +dependencies, then they are installed to a folder in the npm cache, which +is added to the PATH environment variable in the executed process. A +prompt is printed (which can be suppressed by providing either --yes or +--no).

    +

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

    +

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

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

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

    +

    npx vs npm exec

    +

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

    +

    For example:

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

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

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

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

    +

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

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

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

    +
    $ foo@latest bar
    +

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

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

    Examples

    +

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

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

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

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

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

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

    Compatibility with Older npx Versions

    +

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

    +

    This resulted in some shifts in its functionality:

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

    See Also

    +

    👀 Found a typo? Let us know!

    The current stable version of npm is here. To upgrade, run: npm install npm@latest -g

    To report bugs or submit feature requests for the docs, or for any issues regarding the npm command line tool, please post on the npm/cli GitHub project.

    \ No newline at end of file diff --git a/deps/npm/docs/public/cli-commands/npm-explain/index.html b/deps/npm/docs/public/cli-commands/npm-explain/index.html new file mode 100644 index 00000000000000..a3a0df79bd177b --- /dev/null +++ b/deps/npm/docs/public/cli-commands/npm-explain/index.html @@ -0,0 +1,138 @@ +

    npm explain

    +

    Explain installed packages

    +

    Synopsis

    +
    npm explain <folder | specifier>
    +

    Description

    +

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

    +

    Positional arguments can be either folders within node_modules, or +name@version-range specifiers, which will select the dependency +relationships to explain.

    +

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

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

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

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

    Configuration

    +

    json

    +
      +
    • Default: false
    • +
    • Type: Bolean
    • +
    +

    Show information in JSON format.

    +

    See Also

    +

    👀 Found a typo? Let us know!

    The current stable version of npm is here. To upgrade, run: npm install npm@latest -g

    To report bugs or submit feature requests for the docs, or for any issues regarding the npm command line tool, please post on the npm/cli GitHub project.

    \ No newline at end of file diff --git a/deps/npm/docs/public/cli-commands/npm-explore/index.html b/deps/npm/docs/public/cli-commands/npm-explore/index.html index c76f46551fcf5c..b7204d716f726e 100644 --- a/deps/npm/docs/public/cli-commands/npm-explore/index.html +++ b/deps/npm/docs/public/cli-commands/npm-explore/index.html @@ -1,4 +1,4 @@ -

    +

    section: cli-commands title: npm-explore description: Browse an installed package

    @@ -103,15 +105,15 @@

    See Also

    👀 Found a typo? Let us know!

    The current stable version of npm is here. To upgrade, run: npm install npm@latest -g

    To report bugs or submit feature requests for the docs, please post here. Submit npm issues here.

    \ No newline at end of file +
    \ No newline at end of file diff --git a/deps/npm/docs/public/cli-commands/npm-fund/index.html b/deps/npm/docs/public/cli-commands/npm-fund/index.html index 19fec68f2fb0c6..df8866081572a9 100644 --- a/deps/npm/docs/public/cli-commands/npm-fund/index.html +++ b/deps/npm/docs/public/cli-commands/npm-fund/index.html @@ -1,4 +1,4 @@ -

    npm fund

    +

    👀 Found a typo? Let us know!

    The current stable version of npm is here. To upgrade, run: npm install npm@latest -g

    To report bugs or submit feature requests for the docs, please post here. Submit npm issues here.

    \ No newline at end of file +
    \ No newline at end of file diff --git a/deps/npm/docs/public/cli-commands/npm-help-search/index.html b/deps/npm/docs/public/cli-commands/npm-help-search/index.html index 7b1490aeb5a28a..4e9a3786554945 100644 --- a/deps/npm/docs/public/cli-commands/npm-help-search/index.html +++ b/deps/npm/docs/public/cli-commands/npm-help-search/index.html @@ -1,4 +1,4 @@ -

    npm help-search

    +

    npm help-search

    Search npm help documentation

    Synopsis

    npm help-search <text>
    @@ -97,12 +99,12 @@

    See Also

    👀 Found a typo? Let us know!

    The current stable version of npm is here. To upgrade, run: npm install npm@latest -g

    To report bugs or submit feature requests for the docs, please post here. Submit npm issues here.

    \ No newline at end of file +
    \ No newline at end of file diff --git a/deps/npm/docs/public/cli-commands/npm-help/index.html b/deps/npm/docs/public/cli-commands/npm-help/index.html index 293b23aff65b78..c2505a8dbaff38 100644 --- a/deps/npm/docs/public/cli-commands/npm-help/index.html +++ b/deps/npm/docs/public/cli-commands/npm-help/index.html @@ -1,4 +1,4 @@ -

    npm help

    +

    npm help

    Get help on npm

    Synopsis

    npm help <term> [<terms..>]
    @@ -96,15 +98,15 @@

    npm
  • npm folders
  • -
  • npm config
  • +
  • npm config
  • npmrc
  • package.json
  • -
  • npm help-search
  • -

    👀 Found a typo? Let us know!

    The current stable version of npm is here. To upgrade, run: npm install npm@latest -g

    To report bugs or submit feature requests for the docs, please post here. Submit npm issues here.

    \ No newline at end of file +
    \ No newline at end of file diff --git a/deps/npm/docs/public/cli-commands/npm-hook/index.html b/deps/npm/docs/public/cli-commands/npm-hook/index.html index 7015de0f594777..ea6143a11a2b3f 100644 --- a/deps/npm/docs/public/cli-commands/npm-hook/index.html +++ b/deps/npm/docs/public/cli-commands/npm-hook/index.html @@ -1,4 +1,4 @@ -

    npm hook

    +

    npm hook

    Manage registry hooks

    Synopsis

    npm hook ls [pkg]
    @@ -112,11 +114,11 @@ 

    See Also

    👀 Found a typo? Let us know!

    The current stable version of npm is here. To upgrade, run: npm install npm@latest -g

    To report bugs or submit feature requests for the docs, please post here. Submit npm issues here.

    \ No newline at end of file +
    \ No newline at end of file diff --git a/deps/npm/docs/public/cli-commands/npm-init/index.html b/deps/npm/docs/public/cli-commands/npm-init/index.html index 94c30cb44613a2..0129a1a59c7b0e 100644 --- a/deps/npm/docs/public/cli-commands/npm-init/index.html +++ b/deps/npm/docs/public/cli-commands/npm-init/index.html @@ -1,4 +1,4 @@ -

    npm init

    +

    npm init

    create a package.json file

    Synopsis

    npm init [--force|-f|--yes|-y|--scope]
    @@ -117,13 +119,13 @@ 

    https://github.com/isaacs/init-package-json
  • package.json
  • -
  • npm version
  • +
  • npm version
  • npm scope
  • -

    👀 Found a typo? Let us know!

    The current stable version of npm is here. To upgrade, run: npm install npm@latest -g

    To report bugs or submit feature requests for the docs, please post here. Submit npm issues here.

    \ No newline at end of file +
    \ No newline at end of file diff --git a/deps/npm/docs/public/cli-commands/npm-install-ci-test/index.html b/deps/npm/docs/public/cli-commands/npm-install-ci-test/index.html index afa3f9c62587d8..0da8bbee0b31ef 100644 --- a/deps/npm/docs/public/cli-commands/npm-install-ci-test/index.html +++ b/deps/npm/docs/public/cli-commands/npm-install-ci-test/index.html @@ -1,4 +1,4 @@ -

    npm install-ci-test

    +

    npm install-ci-test

    Install a project with a clean slate and run tests

    Synopsis

    npm install-ci-test
    @@ -84,13 +86,13 @@ 

    This command runs an npm ci followed immediately by an npm test.

    See Also

    👀 Found a typo? Let us know!

    The current stable version of npm is here. To upgrade, run: npm install npm@latest -g

    To report bugs or submit feature requests for the docs, please post here. Submit npm issues here.

    \ No newline at end of file +
    \ No newline at end of file diff --git a/deps/npm/docs/public/cli-commands/npm-install-test/index.html b/deps/npm/docs/public/cli-commands/npm-install-test/index.html index d03fba4d626dfc..7fb28e3b1fa3ef 100644 --- a/deps/npm/docs/public/cli-commands/npm-install-test/index.html +++ b/deps/npm/docs/public/cli-commands/npm-install-test/index.html @@ -1,4 +1,4 @@ -

    npm install-test

    +

    npm install-test

    Install package(s) and run tests

    Synopsis

    npm install-test (with no args, in package dir)
    @@ -93,13 +95,13 @@ 

    npm install.

    See Also

    👀 Found a typo? Let us know!

    The current stable version of npm is here. To upgrade, run: npm install npm@latest -g

    To report bugs or submit feature requests for the docs, please post here. Submit npm issues here.

    \ No newline at end of file +
    \ No newline at end of file diff --git a/deps/npm/docs/public/cli-commands/npm-install/index.html b/deps/npm/docs/public/cli-commands/npm-install/index.html index ecca450abd7d7c..d5ae908c829cb7 100644 --- a/deps/npm/docs/public/cli-commands/npm-install/index.html +++ b/deps/npm/docs/public/cli-commands/npm-install/index.html @@ -1,4 +1,4 @@ -

    npm install

    +

    npm install

    Install a package

    Synopsis

    npm install (with no args, in package dir)
    @@ -95,14 +97,14 @@ 

    This command installs a package, and any packages that it depends on. If the package has a package-lock or shrinkwrap file, the installation of dependencies will be driven by that, with an npm-shrinkwrap.json taking precedence if both -files exist. See package-lock.json and npm shrinkwrap.

    +files exist. See package-lock.json and npm shrinkwrap.

    A package is:

    • a) a folder containing a program described by a package.json file
    • b) a gzipped tarball containing (a)
    • c) a url that resolves to (b)
    • d) a <name>@<version> that is published on the registry (see registry) with (c)
    • -
    • e) a <name>@<tag> (see npm dist-tag) that points to (d)
    • +
    • e) a <name>@<tag> (see npm dist-tag) that points to (d)
    • f) a <name> that has a "latest" tag satisfying (e)
    • g) a <git remote url> that resolves to (a)
    @@ -447,25 +449,25 @@

    See Also

    👀 Found a typo? Let us know!

    The current stable version of npm is here. To upgrade, run: npm install npm@latest -g

    To report bugs or submit feature requests for the docs, please post here. Submit npm issues here.

    \ No newline at end of file +
    \ No newline at end of file diff --git a/deps/npm/docs/public/cli-commands/npm-link/index.html b/deps/npm/docs/public/cli-commands/npm-link/index.html index b46a285634ef37..ec9a2bb7eac61a 100644 --- a/deps/npm/docs/public/cli-commands/npm-link/index.html +++ b/deps/npm/docs/public/cli-commands/npm-link/index.html @@ -1,4 +1,4 @@ -

    npm link

    +

    npm link

    Synopsis

    npm link (in package dir)
    @@ -123,15 +125,15 @@ 

    npm developers
  • package.json
  • -
  • npm install
  • +
  • npm- nstall
  • npm folders
  • -
  • npm config
  • +
  • npm config
  • npmrc
  • -

    👀 Found a typo? Let us know!

    The current stable version of npm is here. To upgrade, run: npm install npm@latest -g

    To report bugs or submit feature requests for the docs, please post here. Submit npm issues here.

    \ No newline at end of file +
    \ No newline at end of file diff --git a/deps/npm/docs/public/cli-commands/npm-logout/index.html b/deps/npm/docs/public/cli-commands/npm-logout/index.html index 7932b91253caa0..d00e63b611f0c3 100644 --- a/deps/npm/docs/public/cli-commands/npm-logout/index.html +++ b/deps/npm/docs/public/cli-commands/npm-logout/index.html @@ -1,4 +1,4 @@ -

    npm logout

    +

    npm logout

    Log out of the registry

    Synopsis

    npm logout [--registry=<url>] [--scope=<@scope>]
    @@ -98,15 +100,15 @@

    npm logout --scope=@myco

    See Also

    👀 Found a typo? Let us know!

    The current stable version of npm is here. To upgrade, run: npm install npm@latest -g

    To report bugs or submit feature requests for the docs, please post here. Submit npm issues here.

    \ No newline at end of file +
    \ No newline at end of file diff --git a/deps/npm/docs/public/cli-commands/npm-ls/index.html b/deps/npm/docs/public/cli-commands/npm-ls/index.html index 4ba2deedd6fcdf..f9a1328723fa3e 100644 --- a/deps/npm/docs/public/cli-commands/npm-ls/index.html +++ b/deps/npm/docs/public/cli-commands/npm-ls/index.html @@ -1,4 +1,4 @@ -

    npm ls

    +

    npm ls

    List installed packages

    Synopsis

    npm ls [[<@scope>/]<pkg> ...]
    @@ -87,7 +89,7 @@ 

    also show the paths to the specified packages. For example, running npm ls promzard in npm's source tree will show:

    -

    👀 Found a typo? Let us know!

    The current stable version of npm is here. To upgrade, run: npm install npm@latest -g

    To report bugs or submit feature requests for the docs, please post here. Submit npm issues here.

    \ No newline at end of file +
    \ No newline at end of file diff --git a/deps/npm/docs/public/cli-commands/npm-org/index.html b/deps/npm/docs/public/cli-commands/npm-org/index.html index a787390433e401..ed7d73b9d9933c 100644 --- a/deps/npm/docs/public/cli-commands/npm-org/index.html +++ b/deps/npm/docs/public/cli-commands/npm-org/index.html @@ -1,4 +1,4 @@ -

    npm org

    +

    npm org

    Manage orgs

    Synopsis

    npm org set <orgname> <username> [developer | admin | owner]
    @@ -100,11 +102,11 @@ 

    See Also

    👀 Found a typo? Let us know!

    The current stable version of npm is here. To upgrade, run: npm install npm@latest -g

    To report bugs or submit feature requests for the docs, please post here. Submit npm issues here.

    \ No newline at end of file +
    \ No newline at end of file diff --git a/deps/npm/docs/public/cli-commands/npm-outdated/index.html b/deps/npm/docs/public/cli-commands/npm-outdated/index.html index 7b06dc9aa23d9e..2fe406300f7d8a 100644 --- a/deps/npm/docs/public/cli-commands/npm-outdated/index.html +++ b/deps/npm/docs/public/cli-commands/npm-outdated/index.html @@ -1,4 +1,4 @@ -

    npm outdated

    +

    npm outdated

    Check for outdated packages

    Synopsis

    npm outdated [[<@scope>/]<pkg> ...]
    @@ -92,24 +94,23 @@

    latest. This may or may not be the maximum version of the package, or the most-recently published version of the package, depending on how the package's developer manages the latest dist-tag. -
  • location is where in the dependency tree the package is located. Note that -npm outdated defaults to a depth of 0, so unless you override that, you'll -always be seeing only top-level dependencies that are outdated.
  • +
  • location is where in the physical tree the package is located.
  • +
  • depended by shows which package depends on the displayed dependency
  • package type (when using --long / -l) tells you whether this package is -a dependency or a devDependency. Packages not included in package.json +a dependency or a dev/peer/optional dependency. Packages not included in package.json are always marked dependencies.
  • -
  • homepage (when using --long / -l) is the homepage value contained in the package's package.json
  • +
  • homepage (when using --long / -l) is the homepage value contained in the package's packument
  • Red means there's a newer version matching your semver requirements, so you should update now.
  • Yellow indicates that there's a newer version above your semver requirements (usually new major, or new 0.x minor) so proceed with caution.
  • An example

    $ npm outdated
    -Package      Current   Wanted   Latest  Location
    -glob          5.0.15   5.0.15    6.0.1  test-outdated-output
    -nothingness    0.0.3      git      git  test-outdated-output
    -npm            3.5.1    3.5.2    3.5.1  test-outdated-output
    -local-dev      0.0.3   linked   linked  test-outdated-output
    -once           1.3.2    1.3.3    1.3.3  test-outdated-output
    +Package Current Wanted Latest Location Depended by +glob 5.0.15 5.0.15 6.0.1 node_modules/glob dependent-package-name +nothingness 0.0.3 git git node_modules/nothingness dependent-package-name +npm 3.5.1 3.5.2 3.5.1 node_modules/npm dependent-package-name +local-dev 0.0.3 linked linked local-dev dependent-package-name +once 1.3.2 1.3.3 1.3.3 node_modules/once dependent-package-name

    With these dependencies:

    {
       "glob": "^5.0.15",
    @@ -159,23 +160,23 @@ 

    depth

    +

    all

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

    Max depth for checking dependency tree.

    +

    Display all outdated dependencies on the tree.

    See Also

    👀 Found a typo? Let us know!

    The current stable version of npm is here. To upgrade, run: npm install npm@latest -g

    To report bugs or submit feature requests for the docs, please post here. Submit npm issues here.

    \ No newline at end of file +
    \ No newline at end of file diff --git a/deps/npm/docs/public/cli-commands/npm-owner/index.html b/deps/npm/docs/public/cli-commands/npm-owner/index.html index f6fe631e3ced8f..c67e9f1b1e9dfb 100644 --- a/deps/npm/docs/public/cli-commands/npm-owner/index.html +++ b/deps/npm/docs/public/cli-commands/npm-owner/index.html @@ -1,4 +1,4 @@ -

    npm owner

    +

    npm owner

    Manage package owners

    Synopsis

    npm owner add <user> [<@scope>/]<pkg>
    @@ -103,15 +105,15 @@ 

    --otp.

    See Also

    👀 Found a typo? Let us know!

    The current stable version of npm is here. To upgrade, run: npm install npm@latest -g

    To report bugs or submit feature requests for the docs, please post here. Submit npm issues here.

    \ No newline at end of file +
    \ No newline at end of file diff --git a/deps/npm/docs/public/cli-commands/npm-pack/index.html b/deps/npm/docs/public/cli-commands/npm-pack/index.html index 289b9bb2d3e07d..e544c555843833 100644 --- a/deps/npm/docs/public/cli-commands/npm-pack/index.html +++ b/deps/npm/docs/public/cli-commands/npm-pack/index.html @@ -1,4 +1,4 @@ -

    npm pack

    +

    npm pack

    Create a tarball from a package

    Synopsis

    npm pack [[<@scope>/]<pkg>...] [--dry-run]
    @@ -91,15 +93,15 @@

    See Also

    👀 Found a typo? Let us know!

    The current stable version of npm is here. To upgrade, run: npm install npm@latest -g

    To report bugs or submit feature requests for the docs, please post here. Submit npm issues here.

    \ No newline at end of file +
    \ No newline at end of file diff --git a/deps/npm/docs/public/cli-commands/npm-ping/index.html b/deps/npm/docs/public/cli-commands/npm-ping/index.html index 078cdf8ce5f550..681ded9d469f24 100644 --- a/deps/npm/docs/public/cli-commands/npm-ping/index.html +++ b/deps/npm/docs/public/cli-commands/npm-ping/index.html @@ -1,4 +1,4 @@ -

    npm ping

    +

    npm ping

    Ping npm registry

    Synopsis

    npm ping [--registry <registry>]
    @@ -86,13 +88,13 @@

    Ping error: {*Detail about error}

    See Also

    👀 Found a typo? Let us know!

    The current stable version of npm is here. To upgrade, run: npm install npm@latest -g

    To report bugs or submit feature requests for the docs, please post here. Submit npm issues here.

    \ No newline at end of file +
    \ No newline at end of file diff --git a/deps/npm/docs/public/cli-commands/npm-prefix/index.html b/deps/npm/docs/public/cli-commands/npm-prefix/index.html index 4c989a79782e10..467e4fdee7741c 100644 --- a/deps/npm/docs/public/cli-commands/npm-prefix/index.html +++ b/deps/npm/docs/public/cli-commands/npm-prefix/index.html @@ -1,4 +1,4 @@ -

    npm prefix

    +

    👀 Found a typo? Let us know!

    The current stable version of npm is here. To upgrade, run: npm install npm@latest -g

    To report bugs or submit feature requests for the docs, please post here. Submit npm issues here.

    \ No newline at end of file +
    \ No newline at end of file diff --git a/deps/npm/docs/public/cli-commands/npm-profile/index.html b/deps/npm/docs/public/cli-commands/npm-profile/index.html index 5d93c29c31a7e4..93d3ae4c188f6e 100644 --- a/deps/npm/docs/public/cli-commands/npm-profile/index.html +++ b/deps/npm/docs/public/cli-commands/npm-profile/index.html @@ -1,4 +1,4 @@ -

    npm profile

    +

    npm profile

    Change settings on your registry profile

    Synopsis

    npm profile get [--json|--parseable] [<property>]
    @@ -140,12 +142,12 @@ 

    See Also

    👀 Found a typo? Let us know!

    The current stable version of npm is here. To upgrade, run: npm install npm@latest -g

    To report bugs or submit feature requests for the docs, please post here. Submit npm issues here.

    \ No newline at end of file +
    \ No newline at end of file diff --git a/deps/npm/docs/public/cli-commands/npm-prune/index.html b/deps/npm/docs/public/cli-commands/npm-prune/index.html index 5b137b7433d092..7d25f1ffe1ab2e 100644 --- a/deps/npm/docs/public/cli-commands/npm-prune/index.html +++ b/deps/npm/docs/public/cli-commands/npm-prune/index.html @@ -1,4 +1,4 @@ -

    npm prune

    +

    npm prune

    Remove extraneous packages

    Synopsis

    npm prune [[<@scope>/]<pkg>...] [--production] [--dry-run] [--json]
    @@ -98,14 +100,14 @@

    npm prune from time-to-time to remove them.

    See Also

    👀 Found a typo? Let us know!

    The current stable version of npm is here. To upgrade, run: npm install npm@latest -g

    To report bugs or submit feature requests for the docs, please post here. Submit npm issues here.

    \ No newline at end of file +
    \ No newline at end of file diff --git a/deps/npm/docs/public/cli-commands/npm-publish/index.html b/deps/npm/docs/public/cli-commands/npm-publish/index.html index 4f3f77c6880f4d..6664c16b935347 100644 --- a/deps/npm/docs/public/cli-commands/npm-publish/index.html +++ b/deps/npm/docs/public/cli-commands/npm-publish/index.html @@ -1,4 +1,4 @@ -

    npm publish

    +

    npm publish

    Publish a package

    Synopsis

    npm publish [<tarball>|<folder>] [--tag <tag>] [--access <public|restricted>] [--otp otpcode] [--dry-run]
    @@ -117,11 +119,11 @@ 

    Once a package is published with a given name and version, that specific name and version combination can never be used again, even if -it is removed with npm unpublish.

    +it is removed with npm unpublish.

    As of npm@5, both a sha1sum and an integrity field with a sha512sum of the tarball will be submitted to the registry during publication. Subsequent installs will use the strongest supported algorithm to verify downloads.

    -

    Similar to --dry-run see npm pack, which figures out the files to be +

    Similar to --dry-run see npm pack, which figures out the files to be included and packs them into a tarball to be uploaded to the registry.

    See Also

    👀 Found a typo? Let us know!

    The current stable version of npm is here. To upgrade, run: npm install npm@latest -g

    To report bugs or submit feature requests for the docs, please post here. Submit npm issues here.

    \ No newline at end of file +
    \ No newline at end of file diff --git a/deps/npm/docs/public/cli-commands/npm-rebuild/index.html b/deps/npm/docs/public/cli-commands/npm-rebuild/index.html index 74fdf0e6924c7b..55cccd20377d4d 100644 --- a/deps/npm/docs/public/cli-commands/npm-rebuild/index.html +++ b/deps/npm/docs/public/cli-commands/npm-rebuild/index.html @@ -1,4 +1,4 @@ -

    npm rebuild

    +

    npm rebuild

    Rebuild a package

    Synopsis

    👀 Found a typo? Let us know!

    The current stable version of npm is here. To upgrade, run: npm install npm@latest -g

    To report bugs or submit feature requests for the docs, please post here. Submit npm issues here.

    \ No newline at end of file +
    \ No newline at end of file diff --git a/deps/npm/docs/public/cli-commands/npm-repo/index.html b/deps/npm/docs/public/cli-commands/npm-repo/index.html index 46329c69ac4ceb..b6130f67b07ec8 100644 --- a/deps/npm/docs/public/cli-commands/npm-repo/index.html +++ b/deps/npm/docs/public/cli-commands/npm-repo/index.html @@ -1,4 +1,4 @@ -

    npm repo

    +

    npm repo

    Open package repository page in the browser

    Synopsis

    -
    npm repo [<pkg>]
    +
    npm repo [<pkgname> [<pkgname> ...]]

    Description

    This command tries to guess at the likely location of a package's repository URL, and then tries to open it using the --browser @@ -87,18 +89,21 @@

    browser

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

    The browser that is called by the npm repo command 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.

    See Also

    👀 Found a typo? Let us know!

    The current stable version of npm is here. To upgrade, run: npm install npm@latest -g

    To report bugs or submit feature requests for the docs, please post here. Submit npm issues here.

    \ No newline at end of file +
    \ No newline at end of file diff --git a/deps/npm/docs/public/cli-commands/npm-restart/index.html b/deps/npm/docs/public/cli-commands/npm-restart/index.html index e6e6962beade64..331c49129cc873 100644 --- a/deps/npm/docs/public/cli-commands/npm-restart/index.html +++ b/deps/npm/docs/public/cli-commands/npm-restart/index.html @@ -1,4 +1,4 @@ -

    npm restart

    +

    npm restart

    Restart a package

    Synopsis

    npm restart [-- <args>]
    @@ -100,17 +102,17 @@

    See Also

    👀 Found a typo? Let us know!

    The current stable version of npm is here. To upgrade, run: npm install npm@latest -g

    To report bugs or submit feature requests for the docs, please post here. Submit npm issues here.

    \ No newline at end of file +
    \ No newline at end of file diff --git a/deps/npm/docs/public/cli-commands/npm-root/index.html b/deps/npm/docs/public/cli-commands/npm-root/index.html index 6bea2a1e9464e2..85b3ed6fa71979 100644 --- a/deps/npm/docs/public/cli-commands/npm-root/index.html +++ b/deps/npm/docs/public/cli-commands/npm-root/index.html @@ -1,4 +1,4 @@ -

    npm root

    +

    npm root

    Display npm root

    Synopsis

    npm root [-g]
    @@ -82,16 +84,16 @@

    Print the effective node_modules folder to standard out.

    See Also

    👀 Found a typo? Let us know!

    The current stable version of npm is here. To upgrade, run: npm install npm@latest -g

    To report bugs or submit feature requests for the docs, please post here. Submit npm issues here.

    \ No newline at end of file +
    \ No newline at end of file diff --git a/deps/npm/docs/public/cli-commands/npm-run-script/index.html b/deps/npm/docs/public/cli-commands/npm-run-script/index.html index 16a66c3754a7b8..408493ed8b5ba7 100644 --- a/deps/npm/docs/public/cli-commands/npm-run-script/index.html +++ b/deps/npm/docs/public/cli-commands/npm-run-script/index.html @@ -1,4 +1,4 @@ -

    npm run-script

    +

    npm run-script

    Run arbitrary package scripts

    Synopsis

    npm run-script <command> [--silent] [-- <args>...]
    @@ -131,16 +133,16 @@ 

    See Also

    👀 Found a typo? Let us know!

    The current stable version of npm is here. To upgrade, run: npm install npm@latest -g

    To report bugs or submit feature requests for the docs, please post here. Submit npm issues here.

    \ No newline at end of file +
    \ No newline at end of file diff --git a/deps/npm/docs/public/cli-commands/npm-search/index.html b/deps/npm/docs/public/cli-commands/npm-search/index.html index 095a18d7c39b41..9d230fc37cc410 100644 --- a/deps/npm/docs/public/cli-commands/npm-search/index.html +++ b/deps/npm/docs/public/cli-commands/npm-search/index.html @@ -1,4 +1,4 @@ -

    npm search

    +

    npm search

    Search for packages

    Synopsis

    npm search [-l|--long] [--json] [--parseable] [--no-description] [search terms ...]
    @@ -158,14 +160,14 @@ 

    See Also

    👀 Found a typo? Let us know!

    The current stable version of npm is here. To upgrade, run: npm install npm@latest -g

    To report bugs or submit feature requests for the docs, please post here. Submit npm issues here.

    \ No newline at end of file +
    \ No newline at end of file diff --git a/deps/npm/docs/public/cli-commands/npm-shrinkwrap/index.html b/deps/npm/docs/public/cli-commands/npm-shrinkwrap/index.html index 1f27ce197b3e56..b8c663503ae823 100644 --- a/deps/npm/docs/public/cli-commands/npm-shrinkwrap/index.html +++ b/deps/npm/docs/public/cli-commands/npm-shrinkwrap/index.html @@ -1,4 +1,4 @@ -

    npm shrinkwrap

    +

    npm shrinkwrap

    Lock down dependency versions for publication

    Synopsis

    npm shrinkwrap
    @@ -86,19 +88,19 @@

    package-locks.

    See Also

    👀 Found a typo? Let us know!

    The current stable version of npm is here. To upgrade, run: npm install npm@latest -g

    To report bugs or submit feature requests for the docs, please post here. Submit npm issues here.

    \ No newline at end of file +
    \ No newline at end of file diff --git a/deps/npm/docs/public/cli-commands/npm-star/index.html b/deps/npm/docs/public/cli-commands/npm-star/index.html index d70d5c15d43687..daf59cd3eb2f84 100644 --- a/deps/npm/docs/public/cli-commands/npm-star/index.html +++ b/deps/npm/docs/public/cli-commands/npm-star/index.html @@ -1,4 +1,4 @@ -

    npm star

    +

    npm star

    Mark your favorite packages

    Synopsis

    👀 Found a typo? Let us know!

    The current stable version of npm is here. To upgrade, run: npm install npm@latest -g

    To report bugs or submit feature requests for the docs, please post here. Submit npm issues here.

    \ No newline at end of file +
    \ No newline at end of file diff --git a/deps/npm/docs/public/cli-commands/npm-stars/index.html b/deps/npm/docs/public/cli-commands/npm-stars/index.html index 37e928f1548043..60849a81b1d1ac 100644 --- a/deps/npm/docs/public/cli-commands/npm-stars/index.html +++ b/deps/npm/docs/public/cli-commands/npm-stars/index.html @@ -1,4 +1,4 @@ -

    npm stars

    +

    npm stars

    View packages marked as favorites

    Synopsis

    npm stars [<user>]
    @@ -85,15 +87,15 @@

    See Also

    👀 Found a typo? Let us know!

    The current stable version of npm is here. To upgrade, run: npm install npm@latest -g

    To report bugs or submit feature requests for the docs, please post here. Submit npm issues here.

    \ No newline at end of file +
    \ No newline at end of file diff --git a/deps/npm/docs/public/cli-commands/npm-start/index.html b/deps/npm/docs/public/cli-commands/npm-start/index.html index 4598aad6aae334..0978d84f5b55f9 100644 --- a/deps/npm/docs/public/cli-commands/npm-start/index.html +++ b/deps/npm/docs/public/cli-commands/npm-start/index.html @@ -1,4 +1,4 @@ -

    npm start

    +

    npm start

    Start a package

    Synopsis

    npm start [-- <args>]
    @@ -83,19 +85,19 @@

    "scripts" object. If no "start" property is specified on the "scripts" object, it will run node server.js.

    As of npm@2.0.0, you can -use custom arguments when executing scripts. Refer to npm run-script for more details.

    +use custom arguments when executing scripts. Refer to npm run-script for more details.

    See Also

    👀 Found a typo? Let us know!

    The current stable version of npm is here. To upgrade, run: npm install npm@latest -g

    To report bugs or submit feature requests for the docs, please post here. Submit npm issues here.

    \ No newline at end of file +
    \ No newline at end of file diff --git a/deps/npm/docs/public/cli-commands/npm-stop/index.html b/deps/npm/docs/public/cli-commands/npm-stop/index.html index 3a72ea2b3014d3..e13dcb2269254a 100644 --- a/deps/npm/docs/public/cli-commands/npm-stop/index.html +++ b/deps/npm/docs/public/cli-commands/npm-stop/index.html @@ -1,4 +1,4 @@ -

    npm stop

    +

    npm stop

    Stop a package

    Synopsis

    npm stop [-- <args>]
    @@ -82,16 +84,16 @@

    This runs a package's "stop" script, if one was provided.

    See Also

    👀 Found a typo? Let us know!

    The current stable version of npm is here. To upgrade, run: npm install npm@latest -g

    To report bugs or submit feature requests for the docs, please post here. Submit npm issues here.

    \ No newline at end of file +
    \ No newline at end of file diff --git a/deps/npm/docs/public/cli-commands/npm-team/index.html b/deps/npm/docs/public/cli-commands/npm-team/index.html index d4bfe61fa216d1..07d4f028d2dfd3 100644 --- a/deps/npm/docs/public/cli-commands/npm-team/index.html +++ b/deps/npm/docs/public/cli-commands/npm-team/index.html @@ -1,4 +1,4 @@ -

    npm team

    +

    npm team

    Manage organization teams and team memberships

    Synopsis

    npm team create <scope:team>
    @@ -116,13 +118,13 @@ 

    npm access command to grant or revoke the appropriate permissions.

    See Also

    👀 Found a typo? Let us know!

    The current stable version of npm is here. To upgrade, run: npm install npm@latest -g

    To report bugs or submit feature requests for the docs, please post here. Submit npm issues here.

    \ No newline at end of file +
    \ No newline at end of file diff --git a/deps/npm/docs/public/cli-commands/npm-test/index.html b/deps/npm/docs/public/cli-commands/npm-test/index.html index 38b98aadeb4dbb..d5a4db4d9aca73 100644 --- a/deps/npm/docs/public/cli-commands/npm-test/index.html +++ b/deps/npm/docs/public/cli-commands/npm-test/index.html @@ -1,4 +1,4 @@ -

    npm test

    +

    npm test

    Test a package

    Synopsis

    👀 Found a typo? Let us know!

    The current stable version of npm is here. To upgrade, run: npm install npm@latest -g

    To report bugs or submit feature requests for the docs, please post here. Submit npm issues here.

    \ No newline at end of file +
    \ No newline at end of file diff --git a/deps/npm/docs/public/cli-commands/npm-token/index.html b/deps/npm/docs/public/cli-commands/npm-token/index.html index 8d72d3d1173f08..cb279933df0ff3 100644 --- a/deps/npm/docs/public/cli-commands/npm-token/index.html +++ b/deps/npm/docs/public/cli-commands/npm-token/index.html @@ -1,4 +1,4 @@ -

    npm token

    +

    npm token

    Manage your authentication tokens

    Synopsis

    👀 Found a typo? Let us know!

    The current stable version of npm is here. To upgrade, run: npm install npm@latest -g

    To report bugs or submit feature requests for the docs, please post here. Submit npm issues here.

    \ No newline at end of file +
    \ No newline at end of file diff --git a/deps/npm/docs/public/cli-commands/npm-uninstall/index.html b/deps/npm/docs/public/cli-commands/npm-uninstall/index.html index 4277c248316486..025c128e4f8cb8 100644 --- a/deps/npm/docs/public/cli-commands/npm-uninstall/index.html +++ b/deps/npm/docs/public/cli-commands/npm-uninstall/index.html @@ -1,4 +1,4 @@ -

    npm uninstall

    +

    npm uninstall

    Remove a package

    Synopsis

    npm uninstall [<@scope>/]<pkg>[@<version>]... [-S|--save|-D|--save-dev|-O|--save-optional|--no-save]
    @@ -106,16 +108,16 @@ 

    npm uninstall lodash --no-save

    See Also

    👀 Found a typo? Let us know!

    The current stable version of npm is here. To upgrade, run: npm install npm@latest -g

    To report bugs or submit feature requests for the docs, please post here. Submit npm issues here.

    \ No newline at end of file +
    \ No newline at end of file diff --git a/deps/npm/docs/public/cli-commands/npm-unpublish/index.html b/deps/npm/docs/public/cli-commands/npm-unpublish/index.html index 6d3c7322dbd27c..a17bccf2b85eef 100644 --- a/deps/npm/docs/public/cli-commands/npm-unpublish/index.html +++ b/deps/npm/docs/public/cli-commands/npm-unpublish/index.html @@ -1,4 +1,4 @@ -

    npm unpublish

    +

    npm unpublish

    Remove a package from the registry

    Synopsis

    Unpublishing a single version of a package

    @@ -94,16 +96,16 @@

    To learn more about how unpublish is treated on the npm registry, see our unpublish policies.

    See Also

    👀 Found a typo? Let us know!

    The current stable version of npm is here. To upgrade, run: npm install npm@latest -g

    To report bugs or submit feature requests for the docs, please post here. Submit npm issues here.

    \ No newline at end of file +
    \ No newline at end of file diff --git a/deps/npm/docs/public/cli-commands/npm-update/index.html b/deps/npm/docs/public/cli-commands/npm-update/index.html index 6c1ba709956308..d4666b9a2d9546 100644 --- a/deps/npm/docs/public/cli-commands/npm-update/index.html +++ b/deps/npm/docs/public/cli-commands/npm-update/index.html @@ -1,4 +1,4 @@ -

    npm update

    +

    npm update

    Update a package

    Synopsis

    👀 Found a typo? Let us know!

    The current stable version of npm is here. To upgrade, run: npm install npm@latest -g

    To report bugs or submit feature requests for the docs, please post here. Submit npm issues here.

    \ No newline at end of file +
    \ No newline at end of file diff --git a/deps/npm/docs/public/cli-commands/npm-version/index.html b/deps/npm/docs/public/cli-commands/npm-version/index.html index ed6c7f851efa25..8c9f794d4c152f 100644 --- a/deps/npm/docs/public/cli-commands/npm-version/index.html +++ b/deps/npm/docs/public/cli-commands/npm-version/index.html @@ -1,4 +1,4 @@ -

    npm version

    +

    npm version

    Bump a package version

    Synopsis

    npm version [<newversion> | major | minor | patch | premajor | preminor | prepatch | prerelease [--preid=<prerelease-id>] | from-git]
    @@ -167,17 +169,17 @@ 

    Note that you must have a default GPG key set up in your git config for this to work properly.

    See Also

    👀 Found a typo? Let us know!

    The current stable version of npm is here. To upgrade, run: npm install npm@latest -g

    To report bugs or submit feature requests for the docs, please post here. Submit npm issues here.

    \ No newline at end of file +
    \ No newline at end of file diff --git a/deps/npm/docs/public/cli-commands/npm-view/index.html b/deps/npm/docs/public/cli-commands/npm-view/index.html index 41817313312bb8..a7f27c570c2389 100644 --- a/deps/npm/docs/public/cli-commands/npm-view/index.html +++ b/deps/npm/docs/public/cli-commands/npm-view/index.html @@ -1,4 +1,4 @@ -

    npm view

    +

    npm view

    View registry info

    Synopsis

    npm view [<@scope>/]<name>[@<version>] [<field>[.<subfield>]...]
    @@ -133,16 +135,16 @@ 

    See Also

    👀 Found a typo? Let us know!

    The current stable version of npm is here. To upgrade, run: npm install npm@latest -g

    To report bugs or submit feature requests for the docs, please post here. Submit npm issues here.

    \ No newline at end of file +
    \ No newline at end of file diff --git a/deps/npm/docs/public/cli-commands/npm-whoami/index.html b/deps/npm/docs/public/cli-commands/npm-whoami/index.html index f6f61b4b66378e..96893a2a8ab9d1 100644 --- a/deps/npm/docs/public/cli-commands/npm-whoami/index.html +++ b/deps/npm/docs/public/cli-commands/npm-whoami/index.html @@ -1,4 +1,4 @@ -

    npm whoami

    +

    npm whoami

    Display npm username

    Synopsis

    npm whoami [--registry <registry>]
    @@ -82,14 +84,14 @@

    Print the username config to standard output.

    See Also

    👀 Found a typo? Let us know!

    The current stable version of npm is here. To upgrade, run: npm install npm@latest -g

    To report bugs or submit feature requests for the docs, please post here. Submit npm issues here.

    \ No newline at end of file +
    \ No newline at end of file diff --git a/deps/npm/docs/public/cli-commands/npm/index.html b/deps/npm/docs/public/cli-commands/npm/index.html index 8ce52572b982bb..4453cf1cc226c5 100644 --- a/deps/npm/docs/public/cli-commands/npm/index.html +++ b/deps/npm/docs/public/cli-commands/npm/index.html @@ -1,4 +1,4 @@ -

    npm

    +

    npm

    javascript package manager

    Synopsis

    npm <command> [args]

    Version

    -

    6.14.8

    +

    7.0.0-rc.3

    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 @@ -109,7 +111,8 @@

    node-gyp for that task. For a Unix system, node-gyp needs Python, make and a buildchain like GCC. On Windows, -Python and Microsoft Visual Studio C++ are needed. +Python and Microsoft Visual Studio C++ are needed. Python 3 is +not supported by node-gyp. For more information visit the node-gyp repository and the node-gyp Wiki.

    @@ -203,11 +206,11 @@

    npm install
  • npm config
  • npmrc
  • -

    👀 Found a typo? Let us know!

    The current stable version of npm is here. To upgrade, run: npm install npm@latest -g

    To report bugs or submit feature requests for the docs, please post here. Submit npm issues here.

    \ No newline at end of file +
    \ No newline at end of file diff --git a/deps/npm/docs/public/cli-commands/npx/index.html b/deps/npm/docs/public/cli-commands/npx/index.html new file mode 100644 index 00000000000000..f610d85df50a98 --- /dev/null +++ b/deps/npm/docs/public/cli-commands/npx/index.html @@ -0,0 +1,209 @@ +

    npx

    +

    Run a command from a local or remote npm package

    +

    Synopsis

    +
    npm exec -- <pkg>[@<version>] [args...]
    +npm exec -p <pkg>[@<version>] -- <cmd> [args...]
    +npm exec -c '<cmd> [args...]'
    +npm exec -p foo -c '<cmd> [args...]'
    +
    +npx <pkg>[@<specifier>] [args...]
    +npx -p <pkg>[@<specifier>] <cmd> [args...]
    +npx -c '<cmd> [args...]'
    +npx -p <pkg>[@<specifier>] -c '<cmd> [args...]'
    +
    +alias: npm x, npx
    +
    +-p <pkg> --package=<pkg> (may be specified multiple times)
    +-c <cmd> --call=<cmd> (may not be mixed with positional arguments)
    +

    Description

    +

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

    +

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

    +

    If any requested packages are not present in the local project +dependencies, then they are installed to a folder in the npm cache, which +is added to the PATH environment variable in the executed process. A +prompt is printed (which can be suppressed by providing either --yes or +--no).

    +

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

    +

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

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

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

    +

    npx vs npm exec

    +

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

    +

    For example:

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

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

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

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

    +

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

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

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

    +
    $ foo@latest bar
    +

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

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

    Examples

    +

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

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

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

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

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

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

    Compatibility with Older npx Versions

    +

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

    +

    This resulted in some shifts in its functionality:

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

    See Also

    +

    👀 Found a typo? Let us know!

    The current stable version of npm is here. To upgrade, run: npm install npm@latest -g

    To report bugs or submit feature requests for the docs, or for any issues regarding the npm command line tool, please post on the npm/cli GitHub project.

    \ No newline at end of file diff --git a/deps/npm/docs/public/configuring-npm/folders/index.html b/deps/npm/docs/public/configuring-npm/folders/index.html index a48e497a09d4fc..17d12c1176612e 100644 --- a/deps/npm/docs/public/configuring-npm/folders/index.html +++ b/deps/npm/docs/public/configuring-npm/folders/index.html @@ -1,4 +1,4 @@ -

    folders

    +

    folders

    Folder Structures Used by npm

    Description

    npm puts various things on your computer. That's its job.

    @@ -122,7 +124,7 @@

    Cache

    -

    See npm cache. Cache files are stored in ~/.npm on Posix, or +

    See npm cache. Cache files are stored in ~/.npm on Posix, or %AppData%/npm-cache on Windows.

    This is controlled by the cache configuration param.

    Temp Files

    @@ -226,18 +228,18 @@

    See also

    👀 Found a typo? Let us know!

    The current stable version of npm is here. To upgrade, run: npm install npm@latest -g

    To report bugs or submit feature requests for the docs, please post here. Submit npm issues here.

    \ No newline at end of file +
    \ No newline at end of file diff --git a/deps/npm/docs/public/configuring-npm/install/index.html b/deps/npm/docs/public/configuring-npm/install/index.html index 51d74d7182030d..c5afab29fae3b8 100644 --- a/deps/npm/docs/public/configuring-npm/install/index.html +++ b/deps/npm/docs/public/configuring-npm/install/index.html @@ -1,4 +1,4 @@ -

    install

    +

    install

    Download and Install npm

    Description

    To publish and install packages to and from the public npm registry, you must install Node.js and the npm command line interface using either a Node version manager or a Node installer. We strongly recommend using a Node version manager to install Node.js and npm. We do not recommend using a Node installer, since the Node installation process installs npm in a directory with local permissions and can cause permissions errors when you run npm packages globally.

    @@ -116,11 +118,11 @@

    this page to install npm for Linux in the way many Linux developers prefer.

    Less-common operating systems

    -

    For more information on installing Node.js on a variety of operating systems, see this page.

    👀 Found a typo? Let us know!

    The current stable version of npm is here. To upgrade, run: npm install npm@latest -g

    To report bugs or submit feature requests for the docs, please post here. Submit npm issues here.

    \ No newline at end of file +
    \ No newline at end of file diff --git a/deps/npm/docs/public/configuring-npm/npmrc/index.html b/deps/npm/docs/public/configuring-npm/npmrc/index.html index 5c64f020eff061..ac019336f8b1de 100644 --- a/deps/npm/docs/public/configuring-npm/npmrc/index.html +++ b/deps/npm/docs/public/configuring-npm/npmrc/index.html @@ -1,4 +1,4 @@ -

    npmrc

    +

    npmrc

    The npm config files

    Description

    npm gets its config settings from the command line, environment @@ -134,15 +136,15 @@

    See also

    👀 Found a typo? Let us know!

    The current stable version of npm is here. To upgrade, run: npm install npm@latest -g

    To report bugs or submit feature requests for the docs, please post here. Submit npm issues here.

    \ No newline at end of file +
    \ No newline at end of file diff --git a/deps/npm/docs/public/configuring-npm/package-json/index.html b/deps/npm/docs/public/configuring-npm/package-json/index.html index 3b0a40657b1298..f00ef555315e97 100644 --- a/deps/npm/docs/public/configuring-npm/package-json/index.html +++ b/deps/npm/docs/public/configuring-npm/package-json/index.html @@ -1,4 +1,4 @@ -

    package.json

    +

    package.json

    Specifics of npm's package.json handling

    Description

    This document is all you need to know about what's required in your package.json @@ -263,13 +265,15 @@

    .hg
  • .lock-wscript
  • .wafpickle-N
  • +
  • .*.swp
  • .DS_Store
  • +
  • ._*
  • npm-debug.log
  • .npmrc
  • node_modules
  • config.gypi
  • +
  • *.orig
  • package-lock.json (use shrinkwrap instead)
  • -
  • All files containing a * character (incompatible with Windows)
  • main

    The main field is a module ID that is the primary entry point to your program. @@ -438,7 +442,7 @@

    range1 || range2 Passes if either range1 or range2 are satisfied.
  • git... See 'Git URLs as Dependencies' below
  • user/repo See 'GitHub URLs' below
  • -
  • tag A specific version tagged and published as tag See npm dist-tag
  • +
  • tag A specific version tagged and published as tag See npm dist-tag
  • path/path/path See Local Paths below
  • For example, these are all valid:

    @@ -638,17 +642,17 @@

    You can specify which operating systems your module will run on:

    "os" : [ "darwin", "linux" ]
    -

    You can also blacklist instead of whitelist operating systems, -just prepend the blacklisted os with a '!':

    +

    You can also block instead of allowing operating systems, +just prepend the blocked os with a '!':

    "os" : [ "!win32" ]

    The host operating system is determined by process.platform

    -

    It is allowed to both blacklist, and whitelist, although there isn't any +

    It is allowed to both block and allow an item, although there isn't any good reason to do this.

    cpu

    If your code only runs on certain cpu architectures, you can specify which ones.

    "cpu" : [ "x64", "ia32" ]
    -

    Like the os option, you can also blacklist architectures:

    +

    Like the os option, you can also block architectures:

    "cpu" : [ "!arm", "!mips" ]

    The host architecture is determined by process.arch

    preferGlobal

    @@ -697,18 +701,18 @@

    SEE ALSO

    👀 Found a typo? Let us know!

    The current stable version of npm is here. To upgrade, run: npm install npm@latest -g

    To report bugs or submit feature requests for the docs, please post here. Submit npm issues here.

    \ No newline at end of file +
    \ No newline at end of file diff --git a/deps/npm/docs/public/configuring-npm/package-lock-json/index.html b/deps/npm/docs/public/configuring-npm/package-lock-json/index.html index 9e465fcb37a4ec..a2d811c4b86eaf 100644 --- a/deps/npm/docs/public/configuring-npm/package-lock-json/index.html +++ b/deps/npm/docs/public/configuring-npm/package-lock-json/index.html @@ -1,4 +1,4 @@ -

    package-lock.json

    +

    package-lock.json

    A manifestation of the manifest

    Description

    package-lock.json is automatically generated for any operations where npm @@ -174,16 +176,16 @@

    The dependencies of this dependency, exactly as at the top level.

    See also

    👀 Found a typo? Let us know!

    The current stable version of npm is here. To upgrade, run: npm install npm@latest -g

    To report bugs or submit feature requests for the docs, please post here. Submit npm issues here.

    \ No newline at end of file +
    \ No newline at end of file diff --git a/deps/npm/docs/public/configuring-npm/package-locks/index.html b/deps/npm/docs/public/configuring-npm/package-locks/index.html index ffd90b7b4fbd65..002fd3850c8755 100644 --- a/deps/npm/docs/public/configuring-npm/package-locks/index.html +++ b/deps/npm/docs/public/configuring-npm/package-locks/index.html @@ -1,4 +1,4 @@ -

    package-locks

    +

    package-locks

    An explanation of npm lockfiles

    Description

    -

    Conceptually, the "input" to npm install is a package.json, while its +

    Conceptually, the "input" to npm install is a package.json, while its "output" is a fully-formed node_modules tree: a representation of the dependencies you declared. In an ideal world, npm would work like a pure function: the same package.json should produce the exact same node_modules @@ -206,12 +208,12 @@

    package.json
  • package-lock.json
  • shrinkwrap.json
  • -
  • npm shrinkwrap
  • -

    👀 Found a typo? Let us know!

    The current stable version of npm is here. To upgrade, run: npm install npm@latest -g

    To report bugs or submit feature requests for the docs, please post here. Submit npm issues here.

    \ No newline at end of file +
    \ No newline at end of file diff --git a/deps/npm/docs/public/configuring-npm/shrinkwrap-json/index.html b/deps/npm/docs/public/configuring-npm/shrinkwrap-json/index.html index 2a526f39abc300..41cdad4b01ab8f 100644 --- a/deps/npm/docs/public/configuring-npm/shrinkwrap-json/index.html +++ b/deps/npm/docs/public/configuring-npm/shrinkwrap-json/index.html @@ -1,4 +1,4 @@ -

    npm shrinkwrap.json

    +

    npm shrinkwrap.json

    A publishable lockfile

    Description

    -

    npm-shrinkwrap.json is a file created by npm shrinkwrap. It is identical to +

    npm-shrinkwrap.json is a file created by npm shrinkwrap. It is identical to package-lock.json, with one major caveat: Unlike package-lock.json, npm-shrinkwrap.json may be included when publishing a package.

    The recommended use-case for npm-shrinkwrap.json is applications deployed @@ -91,15 +93,15 @@

    package-lock.json.

    See also

    👀 Found a typo? Let us know!

    The current stable version of npm is here. To upgrade, run: npm install npm@latest -g

    To report bugs or submit feature requests for the docs, please post here. Submit npm issues here.

    \ No newline at end of file +
    \ No newline at end of file diff --git a/deps/npm/docs/public/favicon-32x32.png b/deps/npm/docs/public/favicon-32x32.png new file mode 100644 index 0000000000000000000000000000000000000000..2feaae330f0a4ef71246dd1daac5018f7edf45b7 GIT binary patch literal 480 zcmV<60U!Q}P)(L{v5bB2p3MX`Xk4U?P<$uMU=f515-EhLGqDe2b%uoM?#kpc2~ zS`>@PihCXfVD93%9NqGM&UKTJ;3YfW?4T0+72uRu{Gnc_w{DkS+HHF6bYck}@Oo@C zgf}3<9|12FXfYw_rcI~9TRe_q04N!#(M(+@YqN7f z_WR-npm cli | npm cli documentationnpm cli | npm cli documentation
    npm cli _
    The intelligent package manager for the Node Javascript Platform. Install stuff and get coding!
    npm cli _
    The intelligent package manager for the Node Javascript Platform. Install stuff and get coding!
    npm cli _
    The intelligent package manager for the Node Javascript Platform. Install stuff and get coding!

    The current stable version of npm is available on GitHub.

    To upgrade, run: npm install npm@latest -g

    \ No newline at end of file +
    npm cli _
    The intelligent package manager for the Node Javascript Platform. Install stuff and get coding!
    npm cli _
    The intelligent package manager for the Node Javascript Platform. Install stuff and get coding!
    npm cli _
    The intelligent package manager for the Node Javascript Platform. Install stuff and get coding!

    The current stable version of npm is available on GitHub.

    To upgrade, run: npm install npm@latest -g

    \ No newline at end of file diff --git a/deps/npm/docs/public/static/d/2215187023.json b/deps/npm/docs/public/static/d/2215187023.json deleted file mode 100644 index e28be9a95bba41..00000000000000 --- a/deps/npm/docs/public/static/d/2215187023.json +++ /dev/null @@ -1 +0,0 @@ -{"data":{"allMarkdownRemark":{"nodes":[{"fields":{"slug":"/cli-commands/npm-adduser"},"frontmatter":{"description":null,"section":null,"title":""}},{"fields":{"slug":"/cli-commands/npm-dist-tag"},"frontmatter":{"description":null,"section":null,"title":""}},{"fields":{"slug":"/cli-commands/npm-explore"},"frontmatter":{"description":null,"section":null,"title":""}},{"fields":{"slug":"/using-npm/config"},"frontmatter":{"description":"More than you probably want to know about npm configuration","section":"using-npm","title":"config"}},{"fields":{"slug":"/using-npm/developers"},"frontmatter":{"description":"Developer Guide","section":"using-npm","title":"developers"}},{"fields":{"slug":"/using-npm/disputes"},"frontmatter":{"description":"Handling Module Name Disputes","section":"using-npm","title":"disputes"}},{"fields":{"slug":"/configuring-npm/folders"},"frontmatter":{"description":"Folder Structures Used by npm","section":"configuring-npm","title":"folders"}},{"fields":{"slug":"/configuring-npm/install"},"frontmatter":{"description":"Download and install node and npm","section":"configuring-npm","title":"install"}},{"fields":{"slug":"/cli-commands/npm"},"frontmatter":{"description":"javascript package manager","section":"cli-commands","title":"npm"}},{"fields":{"slug":"/cli-commands/npm-access"},"frontmatter":{"description":"Set access level on published packages","section":"cli-commands","title":"npm-access"}},{"fields":{"slug":"/cli-commands/npm-audit"},"frontmatter":{"description":"Run a security audit","section":"cli-commands","title":"npm-audit"}},{"fields":{"slug":"/cli-commands/npm-bin"},"frontmatter":{"description":"Display npm bin folder","section":"cli-commands","title":"npm-bin"}},{"fields":{"slug":"/cli-commands/npm-bugs"},"frontmatter":{"description":"Bugs for a package in a web browser maybe","section":"cli-commands","title":"npm-bugs"}},{"fields":{"slug":"/cli-commands/npm-build"},"frontmatter":{"description":"Build a package","section":"cli-commands","title":"npm-build"}},{"fields":{"slug":"/cli-commands/npm-bundle"},"frontmatter":{"description":"REMOVED","section":"cli-commands","title":"npm-bundle"}},{"fields":{"slug":"/cli-commands/npm-cache"},"frontmatter":{"description":"Manipulates packages cache","section":"cli-commands","title":"npm-cache"}},{"fields":{"slug":"/cli-commands/npm-ci"},"frontmatter":{"description":"Install a project with a clean slate","section":"cli-commands","title":"npm-ci"}},{"fields":{"slug":"/cli-commands/npm-completion"},"frontmatter":{"description":"Tab Completion for npm","section":"cli-commands","title":"npm-completion"}},{"fields":{"slug":"/cli-commands/npm-config"},"frontmatter":{"description":"Manage the npm configuration files","section":"cli-commands","title":"npm-config"}},{"fields":{"slug":"/cli-commands/npm-dedupe"},"frontmatter":{"description":"Reduce duplication","section":"cli-commands","title":"npm-dedupe"}},{"fields":{"slug":"/cli-commands/npm-deprecate"},"frontmatter":{"description":"Deprecate a version of a package","section":"cli-commands","title":"npm-deprecate"}},{"fields":{"slug":"/cli-commands/npm-docs"},"frontmatter":{"description":"Docs for a package in a web browser maybe","section":"cli-commands","title":"npm-docs"}},{"fields":{"slug":"/cli-commands/npm-doctor"},"frontmatter":{"description":"Check your environments","section":"cli-commands","title":"npm-doctor"}},{"fields":{"slug":"/cli-commands/npm-edit"},"frontmatter":{"description":"Edit an installed package","section":"cli-commands","title":"npm-edit"}},{"fields":{"slug":"/cli-commands/npm-fund"},"frontmatter":{"description":"Retrieve funding information","section":"cli-commands","title":"npm-fund"}},{"fields":{"slug":"/cli-commands/npm-help"},"frontmatter":{"description":"Get help on npm","section":"cli-commands","title":"npm-help"}},{"fields":{"slug":"/cli-commands/npm-help-search"},"frontmatter":{"description":"Search npm help documentation","section":"cli-commands","title":"npm-help-search"}},{"fields":{"slug":"/cli-commands/npm-hook"},"frontmatter":{"description":"Manage registry hooks","section":"cli-commands","title":"npm-hook"}},{"fields":{"slug":"/cli-commands/npm-init"},"frontmatter":{"description":"create a package.json file","section":"cli-commands","title":"npm-init"}},{"fields":{"slug":"/cli-commands/npm-install"},"frontmatter":{"description":"Install a package","section":"cli-commands","title":"npm-install"}},{"fields":{"slug":"/cli-commands/npm-install-ci-test"},"frontmatter":{"description":"Install a project with a clean slate and run tests","section":"cli-commands","title":"npm-install-ci-test"}},{"fields":{"slug":"/cli-commands/npm-install-test"},"frontmatter":{"description":"Install package(s) and run tests","section":"cli-commands","title":"npm-install-test"}},{"fields":{"slug":"/cli-commands/npm-link"},"frontmatter":{"description":"Symlink a package folder","section":"cli-commands","title":"npm-link"}},{"fields":{"slug":"/cli-commands/npm-logout"},"frontmatter":{"description":"Log out of the registry","section":"cli-commands","title":"npm-logout"}},{"fields":{"slug":"/cli-commands/npm-ls"},"frontmatter":{"description":"List installed packages","section":"cli-commands","title":"npm-ls"}},{"fields":{"slug":"/cli-commands/npm-org"},"frontmatter":{"description":"Manage orgs","section":"cli-commands","title":"npm-org"}},{"fields":{"slug":"/cli-commands/npm-outdated"},"frontmatter":{"description":"Check for outdated packages","section":"cli-commands","title":"npm-outdated"}},{"fields":{"slug":"/cli-commands/npm-owner"},"frontmatter":{"description":"Manage package owners","section":"cli-commands","title":"npm-owner"}},{"fields":{"slug":"/cli-commands/npm-pack"},"frontmatter":{"description":"Create a tarball from a package","section":"cli-commands","title":"npm-pack"}},{"fields":{"slug":"/cli-commands/npm-ping"},"frontmatter":{"description":"Ping npm registry","section":"cli-commands","title":"npm-ping"}},{"fields":{"slug":"/cli-commands/npm-prefix"},"frontmatter":{"description":"Display prefix","section":"cli-commands","title":"npm-prefix"}},{"fields":{"slug":"/cli-commands/npm-profile"},"frontmatter":{"description":"Change settings on your registry profile","section":"cli-commands","title":"npm-profile"}},{"fields":{"slug":"/cli-commands/npm-prune"},"frontmatter":{"description":"Remove extraneous packages","section":"cli-commands","title":"npm-prune"}},{"fields":{"slug":"/cli-commands/npm-publish"},"frontmatter":{"description":"Publish a package","section":"cli-commands","title":"npm-publish"}},{"fields":{"slug":"/cli-commands/npm-rebuild"},"frontmatter":{"description":"Rebuild a package","section":"cli-commands","title":"npm-rebuild"}},{"fields":{"slug":"/cli-commands/npm-repo"},"frontmatter":{"description":"Open package repository page in the browser","section":"cli-commands","title":"npm-repo"}},{"fields":{"slug":"/cli-commands/npm-restart"},"frontmatter":{"description":"Restart a package","section":"cli-commands","title":"npm-restart"}},{"fields":{"slug":"/cli-commands/npm-root"},"frontmatter":{"description":"Display npm root","section":"cli-commands","title":"npm-root"}},{"fields":{"slug":"/cli-commands/npm-run-script"},"frontmatter":{"description":"Run arbitrary package scripts","section":"cli-commands","title":"npm-run-script"}},{"fields":{"slug":"/cli-commands/npm-search"},"frontmatter":{"description":"Search for packages","section":"cli-commands","title":"npm-search"}},{"fields":{"slug":"/cli-commands/npm-shrinkwrap"},"frontmatter":{"description":"Lock down dependency versions for publication","section":"cli-commands","title":"npm-shrinkwrap"}},{"fields":{"slug":"/cli-commands/npm-star"},"frontmatter":{"description":"Mark your favorite packages","section":"cli-commands","title":"npm-star"}},{"fields":{"slug":"/cli-commands/npm-stars"},"frontmatter":{"description":"View packages marked as favorites","section":"cli-commands","title":"npm-stars"}},{"fields":{"slug":"/cli-commands/npm-start"},"frontmatter":{"description":"Start a package","section":"cli-commands","title":"npm-start"}},{"fields":{"slug":"/cli-commands/npm-stop"},"frontmatter":{"description":"Stop a package","section":"cli-commands","title":"npm-stop"}},{"fields":{"slug":"/cli-commands/npm-team"},"frontmatter":{"description":"Manage organization teams and team memberships","section":"cli-commands","title":"npm-team"}},{"fields":{"slug":"/cli-commands/npm-test"},"frontmatter":{"description":"Test a package","section":"cli-commands","title":"npm-test"}},{"fields":{"slug":"/cli-commands/npm-token"},"frontmatter":{"description":"Manage your authentication tokens","section":"cli-commands","title":"npm-token"}},{"fields":{"slug":"/cli-commands/npm-uninstall"},"frontmatter":{"description":"Remove a package","section":"cli-commands","title":"npm-uninstall"}},{"fields":{"slug":"/cli-commands/npm-unpublish"},"frontmatter":{"description":"Remove a package from the registry","section":"cli-commands","title":"npm-unpublish"}},{"fields":{"slug":"/cli-commands/npm-update"},"frontmatter":{"description":"Update a package","section":"cli-commands","title":"npm-update"}},{"fields":{"slug":"/cli-commands/npm-version"},"frontmatter":{"description":"Bump a package version","section":"cli-commands","title":"npm-version"}},{"fields":{"slug":"/cli-commands/npm-view"},"frontmatter":{"description":"View registry info","section":"cli-commands","title":"npm-view"}},{"fields":{"slug":"/cli-commands/npm-whoami"},"frontmatter":{"description":"Display npm username","section":"cli-commands","title":"npm-whoami"}},{"fields":{"slug":"/configuring-npm/npmrc"},"frontmatter":{"description":"The npm config files","section":"configuring-npm","title":"npmrc"}},{"fields":{"slug":"/using-npm/orgs"},"frontmatter":{"description":"Working with Teams & Orgs","section":"using-npm","title":"orgs"}},{"fields":{"slug":"/configuring-npm/package-lock-json"},"frontmatter":{"description":"A manifestation of the manifest","section":"configuring-npm","title":"package-lock.json"}},{"fields":{"slug":"/configuring-npm/package-locks"},"frontmatter":{"description":"An explanation of npm lockfiles","section":"configuring-npm","title":"package-locks"}},{"fields":{"slug":"/configuring-npm/package-json"},"frontmatter":{"description":"Specifics of npm's package.json handling","section":"configuring-npm","title":"package.json"}},{"fields":{"slug":"/using-npm/registry"},"frontmatter":{"description":"The JavaScript Package Registry","section":"using-npm","title":"registry"}},{"fields":{"slug":"/using-npm/removal"},"frontmatter":{"description":"Cleaning the Slate","section":"using-npm","title":"removal"}},{"fields":{"slug":"/using-npm/scope"},"frontmatter":{"description":"Scoped packages","section":"using-npm","title":"scope"}},{"fields":{"slug":"/using-npm/scripts"},"frontmatter":{"description":"How npm handles the \"scripts\" field","section":"using-npm","title":"scripts"}},{"fields":{"slug":"/using-npm/semver"},"frontmatter":{"description":"The semantic versioner for npm","section":"using-npm","title":"semver"}},{"fields":{"slug":"/configuring-npm/shrinkwrap-json"},"frontmatter":{"description":"A publishable lockfile","section":"configuring-npm","title":"shrinkwrap.json"}}]}}} \ No newline at end of file diff --git a/deps/npm/docs/public/static/d/2496503923.json b/deps/npm/docs/public/static/d/2496503923.json new file mode 100644 index 00000000000000..55db467abf1dde --- /dev/null +++ b/deps/npm/docs/public/static/d/2496503923.json @@ -0,0 +1 @@ +{"data":{"allMarkdownRemark":{"nodes":[{"fields":{"slug":"/using-npm/semver"},"frontmatter":{"description":null,"section":null,"title":""}},{"fields":{"slug":"/cli-commands/npm-adduser"},"frontmatter":{"description":null,"section":null,"title":""}},{"fields":{"slug":"/cli-commands/npm-dist-tag"},"frontmatter":{"description":null,"section":null,"title":""}},{"fields":{"slug":"/cli-commands/npm-explore"},"frontmatter":{"description":null,"section":null,"title":""}},{"fields":{"slug":"/using-npm/config"},"frontmatter":{"description":"More than you probably want to know about npm configuration","section":"using-npm","title":"config"}},{"fields":{"slug":"/using-npm/developers"},"frontmatter":{"description":"Developer Guide","section":"using-npm","title":"developers"}},{"fields":{"slug":"/using-npm/disputes"},"frontmatter":{"description":"Handling Module Name Disputes","section":"using-npm","title":"disputes"}},{"fields":{"slug":"/configuring-npm/folders"},"frontmatter":{"description":"Folder Structures Used by npm","section":"configuring-npm","title":"folders"}},{"fields":{"slug":"/configuring-npm/install"},"frontmatter":{"description":"Download and install node and npm","section":"configuring-npm","title":"install"}},{"fields":{"slug":"/cli-commands/npm"},"frontmatter":{"description":"javascript package manager","section":"cli-commands","title":"npm"}},{"fields":{"slug":"/cli-commands/npm-access"},"frontmatter":{"description":"Set access level on published packages","section":"cli-commands","title":"npm-access"}},{"fields":{"slug":"/cli-commands/npm-audit"},"frontmatter":{"description":"Run a security audit","section":"cli-commands","title":"npm-audit"}},{"fields":{"slug":"/cli-commands/npm-bin"},"frontmatter":{"description":"Display npm bin folder","section":"cli-commands","title":"npm-bin"}},{"fields":{"slug":"/cli-commands/npm-bugs"},"frontmatter":{"description":"Bugs for a package in a web browser maybe","section":"cli-commands","title":"npm-bugs"}},{"fields":{"slug":"/cli-commands/npm-bundle"},"frontmatter":{"description":"REMOVED","section":"cli-commands","title":"npm-bundle"}},{"fields":{"slug":"/cli-commands/npm-cache"},"frontmatter":{"description":"Manipulates packages cache","section":"cli-commands","title":"npm-cache"}},{"fields":{"slug":"/cli-commands/npm-ci"},"frontmatter":{"description":"Install a project with a clean slate","section":"cli-commands","title":"npm-ci"}},{"fields":{"slug":"/cli-commands/npm-completion"},"frontmatter":{"description":"Tab Completion for npm","section":"cli-commands","title":"npm-completion"}},{"fields":{"slug":"/cli-commands/npm-config"},"frontmatter":{"description":"Manage the npm configuration files","section":"cli-commands","title":"npm-config"}},{"fields":{"slug":"/cli-commands/npm-dedupe"},"frontmatter":{"description":"Reduce duplication","section":"cli-commands","title":"npm-dedupe"}},{"fields":{"slug":"/cli-commands/npm-deprecate"},"frontmatter":{"description":"Deprecate a version of a package","section":"cli-commands","title":"npm-deprecate"}},{"fields":{"slug":"/cli-commands/npm-docs"},"frontmatter":{"description":"Docs for a package in a web browser maybe","section":"cli-commands","title":"npm-docs"}},{"fields":{"slug":"/cli-commands/npm-doctor"},"frontmatter":{"description":"Check your environments","section":"cli-commands","title":"npm-doctor"}},{"fields":{"slug":"/cli-commands/npm-edit"},"frontmatter":{"description":"Edit an installed package","section":"cli-commands","title":"npm-edit"}},{"fields":{"slug":"/cli-commands/npm-exec"},"frontmatter":{"description":"Run a command from a local or remote npm package","section":"cli-commands","title":"npm-exec"}},{"fields":{"slug":"/cli-commands/npm-explain"},"frontmatter":{"description":"Explain installed packages","section":"cli-commands","title":"npm-explain"}},{"fields":{"slug":"/cli-commands/npm-fund"},"frontmatter":{"description":"Retrieve funding information","section":"cli-commands","title":"npm-fund"}},{"fields":{"slug":"/cli-commands/npm-help"},"frontmatter":{"description":"Get help on npm","section":"cli-commands","title":"npm-help"}},{"fields":{"slug":"/cli-commands/npm-help-search"},"frontmatter":{"description":"Search npm help documentation","section":"cli-commands","title":"npm-help-search"}},{"fields":{"slug":"/cli-commands/npm-hook"},"frontmatter":{"description":"Manage registry hooks","section":"cli-commands","title":"npm-hook"}},{"fields":{"slug":"/cli-commands/npm-init"},"frontmatter":{"description":"create a package.json file","section":"cli-commands","title":"npm-init"}},{"fields":{"slug":"/cli-commands/npm-install"},"frontmatter":{"description":"Install a package","section":"cli-commands","title":"npm-install"}},{"fields":{"slug":"/cli-commands/npm-install-ci-test"},"frontmatter":{"description":"Install a project with a clean slate and run tests","section":"cli-commands","title":"npm-install-ci-test"}},{"fields":{"slug":"/cli-commands/npm-install-test"},"frontmatter":{"description":"Install package(s) and run tests","section":"cli-commands","title":"npm-install-test"}},{"fields":{"slug":"/cli-commands/npm-link"},"frontmatter":{"description":"Symlink a package folder","section":"cli-commands","title":"npm-link"}},{"fields":{"slug":"/cli-commands/npm-logout"},"frontmatter":{"description":"Log out of the registry","section":"cli-commands","title":"npm-logout"}},{"fields":{"slug":"/cli-commands/npm-ls"},"frontmatter":{"description":"List installed packages","section":"cli-commands","title":"npm-ls"}},{"fields":{"slug":"/cli-commands/npm-org"},"frontmatter":{"description":"Manage orgs","section":"cli-commands","title":"npm-org"}},{"fields":{"slug":"/cli-commands/npm-outdated"},"frontmatter":{"description":"Check for outdated packages","section":"cli-commands","title":"npm-outdated"}},{"fields":{"slug":"/cli-commands/npm-owner"},"frontmatter":{"description":"Manage package owners","section":"cli-commands","title":"npm-owner"}},{"fields":{"slug":"/cli-commands/npm-pack"},"frontmatter":{"description":"Create a tarball from a package","section":"cli-commands","title":"npm-pack"}},{"fields":{"slug":"/cli-commands/npm-ping"},"frontmatter":{"description":"Ping npm registry","section":"cli-commands","title":"npm-ping"}},{"fields":{"slug":"/cli-commands/npm-prefix"},"frontmatter":{"description":"Display prefix","section":"cli-commands","title":"npm-prefix"}},{"fields":{"slug":"/cli-commands/npm-profile"},"frontmatter":{"description":"Change settings on your registry profile","section":"cli-commands","title":"npm-profile"}},{"fields":{"slug":"/cli-commands/npm-prune"},"frontmatter":{"description":"Remove extraneous packages","section":"cli-commands","title":"npm-prune"}},{"fields":{"slug":"/cli-commands/npm-publish"},"frontmatter":{"description":"Publish a package","section":"cli-commands","title":"npm-publish"}},{"fields":{"slug":"/cli-commands/npm-rebuild"},"frontmatter":{"description":"Rebuild a package","section":"cli-commands","title":"npm-rebuild"}},{"fields":{"slug":"/cli-commands/npm-repo"},"frontmatter":{"description":"Open package repository page in the browser","section":"cli-commands","title":"npm-repo"}},{"fields":{"slug":"/cli-commands/npm-restart"},"frontmatter":{"description":"Restart a package","section":"cli-commands","title":"npm-restart"}},{"fields":{"slug":"/cli-commands/npm-root"},"frontmatter":{"description":"Display npm root","section":"cli-commands","title":"npm-root"}},{"fields":{"slug":"/cli-commands/npm-run-script"},"frontmatter":{"description":"Run arbitrary package scripts","section":"cli-commands","title":"npm-run-script"}},{"fields":{"slug":"/cli-commands/npm-search"},"frontmatter":{"description":"Search for packages","section":"cli-commands","title":"npm-search"}},{"fields":{"slug":"/cli-commands/npm-shrinkwrap"},"frontmatter":{"description":"Lock down dependency versions for publication","section":"cli-commands","title":"npm-shrinkwrap"}},{"fields":{"slug":"/cli-commands/npm-star"},"frontmatter":{"description":"Mark your favorite packages","section":"cli-commands","title":"npm-star"}},{"fields":{"slug":"/cli-commands/npm-stars"},"frontmatter":{"description":"View packages marked as favorites","section":"cli-commands","title":"npm-stars"}},{"fields":{"slug":"/cli-commands/npm-start"},"frontmatter":{"description":"Start a package","section":"cli-commands","title":"npm-start"}},{"fields":{"slug":"/cli-commands/npm-stop"},"frontmatter":{"description":"Stop a package","section":"cli-commands","title":"npm-stop"}},{"fields":{"slug":"/cli-commands/npm-team"},"frontmatter":{"description":"Manage organization teams and team memberships","section":"cli-commands","title":"npm-team"}},{"fields":{"slug":"/cli-commands/npm-test"},"frontmatter":{"description":"Test a package","section":"cli-commands","title":"npm-test"}},{"fields":{"slug":"/cli-commands/npm-token"},"frontmatter":{"description":"Manage your authentication tokens","section":"cli-commands","title":"npm-token"}},{"fields":{"slug":"/cli-commands/npm-uninstall"},"frontmatter":{"description":"Remove a package","section":"cli-commands","title":"npm-uninstall"}},{"fields":{"slug":"/cli-commands/npm-unpublish"},"frontmatter":{"description":"Remove a package from the registry","section":"cli-commands","title":"npm-unpublish"}},{"fields":{"slug":"/cli-commands/npm-update"},"frontmatter":{"description":"Update a package","section":"cli-commands","title":"npm-update"}},{"fields":{"slug":"/cli-commands/npm-version"},"frontmatter":{"description":"Bump a package version","section":"cli-commands","title":"npm-version"}},{"fields":{"slug":"/cli-commands/npm-view"},"frontmatter":{"description":"View registry info","section":"cli-commands","title":"npm-view"}},{"fields":{"slug":"/cli-commands/npm-whoami"},"frontmatter":{"description":"Display npm username","section":"cli-commands","title":"npm-whoami"}},{"fields":{"slug":"/configuring-npm/npmrc"},"frontmatter":{"description":"The npm config files","section":"configuring-npm","title":"npmrc"}},{"fields":{"slug":"/cli-commands/npx"},"frontmatter":{"description":"Run a command from a local or remote npm package","section":"cli-commands","title":"npx"}},{"fields":{"slug":"/using-npm/orgs"},"frontmatter":{"description":"Working with Teams & Orgs","section":"using-npm","title":"orgs"}},{"fields":{"slug":"/configuring-npm/package-lock-json"},"frontmatter":{"description":"A manifestation of the manifest","section":"configuring-npm","title":"package-lock.json"}},{"fields":{"slug":"/configuring-npm/package-locks"},"frontmatter":{"description":"An explanation of npm lockfiles","section":"configuring-npm","title":"package-locks"}},{"fields":{"slug":"/configuring-npm/package-json"},"frontmatter":{"description":"Specifics of npm's package.json handling","section":"configuring-npm","title":"package.json"}},{"fields":{"slug":"/using-npm/registry"},"frontmatter":{"description":"The JavaScript Package Registry","section":"using-npm","title":"registry"}},{"fields":{"slug":"/using-npm/removal"},"frontmatter":{"description":"Cleaning the Slate","section":"using-npm","title":"removal"}},{"fields":{"slug":"/using-npm/scope"},"frontmatter":{"description":"Scoped packages","section":"using-npm","title":"scope"}},{"fields":{"slug":"/using-npm/scripts"},"frontmatter":{"description":"How npm handles the \"scripts\" field","section":"using-npm","title":"scripts"}},{"fields":{"slug":"/configuring-npm/shrinkwrap-json"},"frontmatter":{"description":"A publishable lockfile","section":"configuring-npm","title":"shrinkwrap.json"}}]}}} \ No newline at end of file diff --git a/deps/npm/docs/public/static/d/2417117884.json b/deps/npm/docs/public/static/d/63159454.json similarity index 100% rename from deps/npm/docs/public/static/d/2417117884.json rename to deps/npm/docs/public/static/d/63159454.json diff --git a/deps/npm/docs/public/using-npm/config/index.html b/deps/npm/docs/public/using-npm/config/index.html index b14cf505b97d78..32bc99414b467e 100644 --- a/deps/npm/docs/public/using-npm/config/index.html +++ b/deps/npm/docs/public/using-npm/config/index.html @@ -1,4 +1,4 @@ -

    config

    +

    config

    More than you probably want to know about npm configuration

    Description

    npm gets its configuration values from the following sources, sorted by priority:

    @@ -179,6 +181,14 @@

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

    👀 Found a typo? Let us know!

    The current stable version of npm is here. To upgrade, run: npm install npm@latest -g

    To report bugs or submit feature requests for the docs, please post here. Submit npm issues here.

    \ No newline at end of file +
    \ No newline at end of file diff --git a/deps/npm/docs/public/using-npm/developers/index.html b/deps/npm/docs/public/using-npm/developers/index.html index a5295c580a67a8..1fe7ca647aa62b 100644 --- a/deps/npm/docs/public/using-npm/developers/index.html +++ b/deps/npm/docs/public/using-npm/developers/index.html @@ -1,4 +1,4 @@ -

    developers

    +

    developers

    Developer Guide

    Description

    So, you've decided to use npm to develop (and maybe publish/deploy) @@ -195,8 +197,8 @@

    .npmignore to be a maintenance headache, you might instead try populating the files property of package.json, which is an array of file or directory names -that should be included in your package. Sometimes a whitelist is easier -to manage than a blacklist.

    +that should be included in your package. Sometimes manually picking +which items to allow is easier to manage than building a block list.

    Testing whether your .npmignore or files config works

    If you want to double check that your package will include only the files you intend it to when published, you can run the npm pack command locally @@ -252,11 +254,11 @@

    npm publish
  • npm adduser
  • npm registry
  • -

    👀 Found a typo? Let us know!

    The current stable version of npm is here. To upgrade, run: npm install npm@latest -g

    To report bugs or submit feature requests for the docs, please post here. Submit npm issues here.

    \ No newline at end of file +
    \ No newline at end of file diff --git a/deps/npm/docs/public/using-npm/disputes/index.html b/deps/npm/docs/public/using-npm/disputes/index.html index 93cbb66eb15adb..c906b9bf51cea6 100644 --- a/deps/npm/docs/public/using-npm/disputes/index.html +++ b/deps/npm/docs/public/using-npm/disputes/index.html @@ -1,4 +1,4 @@ -

    disputes

    +

    disputes

    Handling Module Name Disputes

    This document describes the steps that you should take to resolve module name disputes with other npm publishers. It also describes special steps you should @@ -184,12 +186,12 @@

    See also

    👀 Found a typo? Let us know!

    The current stable version of npm is here. To upgrade, run: npm install npm@latest -g

    To report bugs or submit feature requests for the docs, please post here. Submit npm issues here.

    \ No newline at end of file +
    \ No newline at end of file diff --git a/deps/npm/docs/public/using-npm/orgs/index.html b/deps/npm/docs/public/using-npm/orgs/index.html index 16d8f5ada127e8..0e5ae8a39b261a 100644 --- a/deps/npm/docs/public/using-npm/orgs/index.html +++ b/deps/npm/docs/public/using-npm/orgs/index.html @@ -1,4 +1,4 @@ -

    orgs

    +

    orgs

    Working with Teams & Orgs

    Description

    There are three levels of org users:

    @@ -88,8 +90,8 @@

    The developer will be able to access packages based on the teams they are on. Access is either read-write or read-only.

    There are two main commands:

      -
    1. npm team see npm team for more details
    2. -
    3. npm access see npm access for more details
    4. +
    5. npm team see npm team for more details
    6. +
    7. npm access see npm access for more details

    Team Admins create teams

    See also

    👀 Found a typo? Let us know!

    The current stable version of npm is here. To upgrade, run: npm install npm@latest -g

    To report bugs or submit feature requests for the docs, please post here. Submit npm issues here.

    \ No newline at end of file +
    \ No newline at end of file diff --git a/deps/npm/docs/public/using-npm/registry/index.html b/deps/npm/docs/public/using-npm/registry/index.html index 63a3a76f24f8e9..3bbf20373afabc 100644 --- a/deps/npm/docs/public/using-npm/registry/index.html +++ b/deps/npm/docs/public/using-npm/registry/index.html @@ -1,4 +1,4 @@ -

    registry

    +

    registry

    The JavaScript Package Registry

    Description

    To resolve packages by name and version, npm talks to a registry website @@ -95,7 +97,7 @@

    https://github.com/npm/npm-registry-couchapp.

    The registry URL used is determined by the scope of the package (see scope. If no scope is specified, the default registry is used, which is -supplied by the registry config parameter. See npm config, +supplied by the registry config parameter. See npm config, npmrc, and config for more on managing npm's configuration.

    Does npm send any information about me back to the registry?

    Yes.

    @@ -144,16 +146,16 @@

    https://www.npmjs.com/

    See also

    👀 Found a typo? Let us know!

    The current stable version of npm is here. To upgrade, run: npm install npm@latest -g

    To report bugs or submit feature requests for the docs, please post here. Submit npm issues here.

    \ No newline at end of file +
    \ No newline at end of file diff --git a/deps/npm/docs/public/using-npm/removal/index.html b/deps/npm/docs/public/using-npm/removal/index.html index ae39dd10ad8d88..e1e6ae7a8dd1c4 100644 --- a/deps/npm/docs/public/using-npm/removal/index.html +++ b/deps/npm/docs/public/using-npm/removal/index.html @@ -1,4 +1,4 @@ -

    removal

    +

    removal

    Cleaning the Slate

    Synopsis

    So sad to see you go.

    @@ -107,13 +109,13 @@

    See also

    👀 Found a typo? Let us know!

    The current stable version of npm is here. To upgrade, run: npm install npm@latest -g

    To report bugs or submit feature requests for the docs, please post here. Submit npm issues here.

    \ No newline at end of file +
    \ No newline at end of file diff --git a/deps/npm/docs/public/using-npm/scope/index.html b/deps/npm/docs/public/using-npm/scope/index.html index dd243f1f9cf255..f2a5b722ba6189 100644 --- a/deps/npm/docs/public/using-npm/scope/index.html +++ b/deps/npm/docs/public/using-npm/scope/index.html @@ -1,4 +1,4 @@ -

    scope

    +

    scope

    Scoped packages

    Description

    All npm packages have a name. Some package names also have a scope. A scope @@ -106,7 +108,7 @@

    "@myorg/mypackage": "^1.3.0" }

    Note that if the @ symbol is omitted, in either case, npm will instead attempt to -install from GitHub; see npm install.

    +install from GitHub; see npm install.

    Requiring scoped packages

    Because scoped packages are installed into a scope folder, you have to include the name of the scope when requiring them in your code, e.g.

    @@ -148,15 +150,15 @@

    See also

    👀 Found a typo? Let us know!

    The current stable version of npm is here. To upgrade, run: npm install npm@latest -g

    To report bugs or submit feature requests for the docs, please post here. Submit npm issues here.

    \ No newline at end of file +
    \ No newline at end of file diff --git a/deps/npm/docs/public/using-npm/scripts/index.html b/deps/npm/docs/public/using-npm/scripts/index.html index 8b2a03aafb7890..9dd33d399a157d 100644 --- a/deps/npm/docs/public/using-npm/scripts/index.html +++ b/deps/npm/docs/public/using-npm/scripts/index.html @@ -1,4 +1,4 @@ -

    scripts

    +

    scripts

    How npm handles the "scripts" field

    Description

    The "scripts" property of of your package.json file supports a number of built-in scripts and their preset life cycle events as well as arbitrary scripts. These all can be executed by running npm run-script <stage> or npm run <stage> for short. Pre and post commands with matching names will be run for those as well (e.g. premyscript, myscript, postmyscript). Scripts from dependencies can be run with npm explore <pkg> -- npm run <stage>.

    @@ -138,7 +140,7 @@

    Life Cycle Operation Order

    -

    npm publish

    +

    npm publish

    -

    npm pack

    +

    npm pack

    • prepack
    • postpack
    -

    npm install

    +

    npm install

    -

    npm start

    +

    npm start

    npm run start has an npm start shorthand.

    👀 Found a typo? Let us know!

    The current stable version of npm is here. To upgrade, run: npm install npm@latest -g

    To report bugs or submit feature requests for the docs, please post here. Submit npm issues here.

    \ No newline at end of file +
    \ No newline at end of file diff --git a/deps/npm/docs/public/using-npm/semver/index.html b/deps/npm/docs/public/using-npm/semver/index.html index 218de1cc766fa0..a48fc1eca25f78 100644 --- a/deps/npm/docs/public/using-npm/semver/index.html +++ b/deps/npm/docs/public/using-npm/semver/index.html @@ -1,4 +1,4 @@ -

    semver(7) -- The semantic versioner for npm

    +

    👀 Found a typo? Let us know!

    The current stable version of npm is here. To upgrade, run: npm install npm@latest -g

    To report bugs or submit feature requests for the docs, please post here. Submit npm issues here.

    \ No newline at end of file +
    \ No newline at end of file diff --git a/deps/npm/docs/src/components/FoundTypo.js b/deps/npm/docs/src/components/FoundTypo.js index 5aca0894934dc8..d3bfe6e0b058b9 100644 --- a/deps/npm/docs/src/components/FoundTypo.js +++ b/deps/npm/docs/src/components/FoundTypo.js @@ -13,8 +13,10 @@ const FoundTypo = () => {

    👀 Found a typo? Let us know!

    The current stable version of npm is here. To upgrade, run: npm install npm@latest -g

    - To report bugs or submit feature requests for the docs, please post here. - Submit npm issues here. + To report bugs or submit feature requests for the docs, or for any + issues regarding the npm command line tool, please post on the npm/cli GitHub + project.

    ) diff --git a/deps/npm/lib/access.js b/deps/npm/lib/access.js index e850c132eb24b2..33d296f8fadd97 100644 --- a/deps/npm/lib/access.js +++ b/deps/npm/lib/access.js @@ -1,22 +1,18 @@ 'use strict' -/* eslint-disable standard/no-callback-literal */ -const BB = require('bluebird') +const path = require('path') + +const libaccess = require('libnpmaccess') +const readPackageJson = require('read-package-json-fast') -const figgyPudding = require('figgy-pudding') -const libaccess = require('libnpm/access') -const npmConfig = require('./config/figgy-config.js') +const npm = require('./npm.js') const output = require('./utils/output.js') const otplease = require('./utils/otplease.js') -const path = require('path') -const prefix = require('./npm.js').prefix -const readPackageJson = BB.promisify(require('read-package-json')) -const usage = require('./utils/usage.js') -const whoami = require('./whoami.js') +const usageUtil = require('./utils/usage.js') +const getIdentity = require('./utils/get-identity.js') +const { prefix } = npm -module.exports = access - -access.usage = usage( +const usage = usageUtil( 'npm access', 'npm access public []\n' + 'npm access restricted []\n' + @@ -29,27 +25,49 @@ access.usage = usage( 'npm access edit []' ) -access.subcommands = [ - 'public', 'restricted', 'grant', 'revoke', - 'ls-packages', 'ls-collaborators', 'edit', - '2fa-required', '2fa-not-required' +const subcommands = [ + 'public', + 'restricted', + 'grant', + 'revoke', + 'ls-packages', + 'ls-collaborators', + 'edit', + '2fa-required', + '2fa-not-required' ] -const AccessConfig = figgyPudding({ - json: {} -}) +const UsageError = (msg) => + Object.assign(new Error(`\nUsage: ${msg}\n\n` + usage), { + code: 'EUSAGE' + }) + +const cmd = (args, cb) => + access(args) + .then(x => cb(null, x)) + .catch(err => err.code === 'EUSAGE' + ? cb(err.message) + : cb(err) + ) -function UsageError (msg = '') { - throw Object.assign(new Error( - (msg ? `\nUsage: ${msg}\n\n` : '') + - access.usage - ), {code: 'EUSAGE'}) +const access = async ([cmd, ...args], cb) => { + const fn = subcommands.includes(cmd) && access[cmd] + + if (!cmd) { + throw UsageError('Subcommand is required.') + } + + if (!fn) { + throw UsageError(`${cmd} is not a recognized subcommand.`) + } + + return fn(args, { ...npm.flatOptions }) } -access.completion = function (opts, cb) { +const completion = function (opts, cb) { var argv = opts.conf.argv.remain if (argv.length === 2) { - return cb(null, access.subcommands) + return cb(null, subcommands) } switch (argv[2]) { @@ -66,7 +84,6 @@ access.completion = function (opts, cb) { case 'edit': case '2fa-required': case '2fa-not-required': - return cb(null, []) case 'revoke': return cb(null, []) default: @@ -74,125 +91,107 @@ access.completion = function (opts, cb) { } } -function access ([cmd, ...args], cb) { - return BB.try(() => { - const fn = access.subcommands.includes(cmd) && access[cmd] - if (!cmd) { UsageError('Subcommand is required.') } - if (!fn) { UsageError(`${cmd} is not a recognized subcommand.`) } - - return fn(args, AccessConfig(npmConfig())) - }).then( - x => cb(null, x), - err => err.code === 'EUSAGE' ? cb(err.message) : cb(err) - ) -} +access.public = ([pkg], opts) => + modifyPackage(pkg, opts, libaccess.public) -access.public = ([pkg], opts) => { - return modifyPackage(pkg, opts, libaccess.public) -} +access.restricted = ([pkg], opts) => + modifyPackage(pkg, opts, libaccess.restricted) -access.restricted = ([pkg], opts) => { - return modifyPackage(pkg, opts, libaccess.restricted) -} +access.grant = async ([perms, scopeteam, pkg], opts) => { + if (!perms || (perms !== 'read-only' && perms !== 'read-write')) { + throw UsageError('First argument must be either `read-only` or `read-write`.') + } -access.grant = ([perms, scopeteam, pkg], opts) => { - return BB.try(() => { - if (!perms || (perms !== 'read-only' && perms !== 'read-write')) { - UsageError('First argument must be either `read-only` or `read-write.`') - } - if (!scopeteam) { - UsageError('`` argument is required.') - } - const [, scope, team] = scopeteam.match(/^@?([^:]+):(.*)$/) || [] - if (!scope && !team) { - UsageError( - 'Second argument used incorrect format.\n' + - 'Example: @example:developers' - ) - } - return modifyPackage(pkg, opts, (pkgName, opts) => { - return libaccess.grant(pkgName, scopeteam, perms, opts) - }, false) - }) -} + if (!scopeteam) { + throw UsageError('`` argument is required.') + } -access.revoke = ([scopeteam, pkg], opts) => { - return BB.try(() => { - if (!scopeteam) { - UsageError('`` argument is required.') - } - const [, scope, team] = scopeteam.match(/^@?([^:]+):(.*)$/) || [] - if (!scope || !team) { - UsageError( - 'First argument used incorrect format.\n' + - 'Example: @example:developers' - ) - } - return modifyPackage(pkg, opts, (pkgName, opts) => { - return libaccess.revoke(pkgName, scopeteam, opts) - }) - }) -} + const [, scope, team] = scopeteam.match(/^@?([^:]+):(.*)$/) || [] -access['2fa-required'] = access.tfaRequired = ([pkg], opts) => { - return modifyPackage(pkg, opts, libaccess.tfaRequired, false) -} + if (!scope && !team) { + throw UsageError( + 'Second argument used incorrect format.\n' + + 'Example: @example:developers' + ) + } -access['2fa-not-required'] = access.tfaNotRequired = ([pkg], opts) => { - return modifyPackage(pkg, opts, libaccess.tfaNotRequired, false) + return modifyPackage(pkg, opts, (pkgName, opts) => + libaccess.grant(pkgName, scopeteam, perms, opts), false) } -access['ls-packages'] = access.lsPackages = ([owner], opts) => { - return ( - owner ? BB.resolve(owner) : BB.fromNode(cb => whoami([], true, cb)) - ).then(owner => { - return libaccess.lsPackages(owner, opts) - }).then(pkgs => { - // TODO - print these out nicely (breaking change) - output(JSON.stringify(pkgs, null, 2)) - }) +access.revoke = async ([scopeteam, pkg], opts) => { + if (!scopeteam) { + throw UsageError('`` argument is required.') + } + + const [, scope, team] = scopeteam.match(/^@?([^:]+):(.*)$/) || [] + + if (!scope || !team) { + throw UsageError( + 'First argument used incorrect format.\n' + + 'Example: @example:developers' + ) + } + + return modifyPackage(pkg, opts, (pkgName, opts) => + libaccess.revoke(pkgName, scopeteam, opts)) } -access['ls-collaborators'] = access.lsCollaborators = ([pkg, usr], opts) => { - return getPackage(pkg, false).then(pkgName => - libaccess.lsCollaborators(pkgName, usr, opts) - ).then(collabs => { - // TODO - print these out nicely (breaking change) - output(JSON.stringify(collabs, null, 2)) - }) +access['2fa-required'] = access.tfaRequired = ([pkg], opts) => + modifyPackage(pkg, opts, libaccess.tfaRequired, false) + +access['2fa-not-required'] = access.tfaNotRequired = ([pkg], opts) => + modifyPackage(pkg, opts, libaccess.tfaNotRequired, false) + +access['ls-packages'] = access.lsPackages = async ([owner], opts) => { + if (!owner) { + owner = await getIdentity(opts) + } + + const pkgs = await libaccess.lsPackages(owner, opts) + + // TODO - print these out nicely (breaking change) + output(JSON.stringify(pkgs, null, 2)) } -access['edit'] = () => BB.reject(new Error('edit subcommand is not implemented yet')) +access['ls-collaborators'] = access.lsCollaborators = async ([pkg, usr], opts) => { + const pkgName = await getPackage(pkg, false) + const collabs = await libaccess.lsCollaborators(pkgName, usr, opts) -function modifyPackage (pkg, opts, fn, requireScope = true) { - return getPackage(pkg, requireScope).then(pkgName => - otplease(opts, opts => fn(pkgName, opts)) - ) + // TODO - print these out nicely (breaking change) + output(JSON.stringify(collabs, null, 2)) } -function getPackage (name, requireScope = true) { - return BB.try(() => { - if (name && name.trim()) { - return name.trim() - } else { - return readPackageJson( - path.resolve(prefix, 'package.json') - ).then( - data => data.name, - err => { - if (err.code === 'ENOENT') { - throw new Error('no package name passed to command and no package.json found') - } else { - throw err - } - } - ) +access.edit = () => + Promise.reject(new Error('edit subcommand is not implemented yet')) + +const modifyPackage = (pkg, opts, fn, requireScope = true) => + getPackage(pkg, requireScope) + .then(pkgName => otplease(opts, opts => fn(pkgName, opts))) + +const getPackage = async (name, requireScope) => { + if (name && name.trim()) { + return name.trim() + } else { + try { + const pkg = await readPackageJson(path.resolve(prefix, 'package.json')) + name = pkg.name + } catch (err) { + if (err.code === 'ENOENT') { + throw new Error( + 'no package name passed to command and no package.json found' + ) + } else { + throw err + } } - }).then(name => { + if (requireScope && !name.match(/^@[^/]+\/.*$/)) { - UsageError('This command is only available for scoped packages.') + throw UsageError('This command is only available for scoped packages.') } else { return name } - }) + } } + +module.exports = Object.assign(cmd, { usage, completion, subcommands }) diff --git a/deps/npm/lib/adduser.js b/deps/npm/lib/adduser.js index cf82ff5b04915e..017958e027b956 100644 --- a/deps/npm/lib/adduser.js +++ b/deps/npm/lib/adduser.js @@ -1,50 +1,78 @@ -module.exports = adduser +'use strict' const log = require('npmlog') const npm = require('./npm.js') -const usage = require('./utils/usage') -let crypto - -try { - crypto = require('crypto') -} catch (ex) {} +const output = require('./utils/output.js') +const usageUtil = require('./utils/usage.js') +const authTypes = { + legacy: require('./auth/legacy.js'), + oauth: require('./auth/oauth.js'), + saml: require('./auth/saml.js'), + sso: require('./auth/sso.js') +} -adduser.usage = usage( +const usage = usageUtil( 'adduser', - 'npm adduser [--registry=url] [--scope=@orgname] [--auth-type=legacy] [--always-auth]' + 'npm adduser [--registry=url] [--scope=@orgname] [--always-auth]' ) -function adduser (args, cb) { - if (!crypto) { - return cb(new Error( - 'You must compile node with ssl support to use the adduser feature' - )) - } +const completion = require('./utils/completion/none.js') - let registry = npm.config.get('registry') - const scope = npm.config.get('scope') - const creds = npm.config.getCredentialsByURI(npm.config.get('registry')) +const cmd = (args, cb) => adduser(args).then(() => cb()).catch(cb) +const getRegistry = ({ scope, registry }) => { if (scope) { - const scopedRegistry = npm.config.get(scope + ':registry') + const scopedRegistry = npm.config.get(`${scope}:registry`) const cliRegistry = npm.config.get('registry', 'cli') - if (scopedRegistry && !cliRegistry) registry = scopedRegistry + if (scopedRegistry && !cliRegistry) { + return scopedRegistry + } } + return registry +} - log.disableProgress() +const getAuthType = ({ authType }) => { + const type = authTypes[authType] + + if (!type) { + throw new Error('no such auth module') + } + + return type +} + +const updateConfig = async ({ newCreds, registry, scope }) => { + npm.config.delete('_token', 'user') // prevent legacy pollution - let auth - try { - auth = require('./auth/' + npm.config.get('auth-type')) - } catch (e) { - return cb(new Error('no such auth module')) + if (scope) { + npm.config.set(scope + ':registry', registry, 'user') } - auth.login(creds, registry, scope, function (err, newCreds) { - if (err) return cb(err) - npm.config.del('_token', 'user') // prevent legacy pollution - if (scope) npm.config.set(scope + ':registry', registry, 'user') - npm.config.setCredentialsByURI(registry, newCreds) - npm.config.save('user', cb) + npm.config.setCredentialsByURI(registry, newCreds) + await npm.config.save('user') +} + +const adduser = async (args) => { + const { scope } = npm.flatOptions + const registry = getRegistry(npm.flatOptions) + const auth = getAuthType(npm.flatOptions) + const creds = npm.config.getCredentialsByURI(registry) + + log.disableProgress() + + const { message, newCreds } = await auth({ + creds, + registry, + scope + }) + + await updateConfig({ + newCreds, + registry, + scope }) + + output(message) } + +module.exports = Object.assign(cmd, { completion, usage }) diff --git a/deps/npm/lib/audit.js b/deps/npm/lib/audit.js index 7b694c13c5d7ff..ed2db91dd28cdb 100644 --- a/deps/npm/lib/audit.js +++ b/deps/npm/lib/audit.js @@ -1,305 +1,53 @@ -'use strict' - -const Bluebird = require('bluebird') - -const audit = require('./install/audit.js') -const figgyPudding = require('figgy-pudding') -const fs = require('graceful-fs') -const Installer = require('./install.js').Installer -const lockVerify = require('lock-verify') -const log = require('npmlog') -const npa = require('libnpm/parse-arg') +const Arborist = require('@npmcli/arborist') +const auditReport = require('npm-audit-report') const npm = require('./npm.js') -const npmConfig = require('./config/figgy-config.js') const output = require('./utils/output.js') -const parseJson = require('json-parse-better-errors') +const reifyOutput = require('./utils/reify-output.js') -const readFile = Bluebird.promisify(fs.readFile) - -const AuditConfig = figgyPudding({ - also: {}, - 'audit-level': {}, - deepArgs: 'deep-args', - 'deep-args': {}, - dev: {}, - force: {}, - 'dry-run': {}, - global: {}, - json: {}, - only: {}, - parseable: {}, - prod: {}, - production: {}, - registry: {}, - runId: {} -}) +const audit = async args => { + const arb = new Arborist({ + ...npm.flatOptions, + audit: true, + path: npm.prefix + }) + const fix = args[0] === 'fix' + await arb.audit({ fix }) + if (fix) { + reifyOutput(arb) + } else { + const reporter = npm.flatOptions.json ? 'json' : 'detail' + const result = auditReport(arb.auditReport, { + ...npm.flatOptions, + reporter + }) + process.exitCode = process.exitCode || result.exitCode + output(result.report) + } +} -module.exports = auditCmd +const cmd = (args, cb) => audit(args).then(() => cb()).catch(cb) -const usage = require('./utils/usage') -auditCmd.usage = usage( +const usageUtil = require('./utils/usage') +const usage = usageUtil( 'audit', - '\nnpm audit [--json] [--production]' + + 'npm audit [--json] [--production]' + '\nnpm audit fix ' + '[--force|--package-lock-only|--dry-run|--production|--only=(dev|prod)]' ) -auditCmd.completion = function (opts, cb) { +const completion = (opts, cb) => { const argv = opts.conf.argv.remain + if (argv.length === 2) { + return cb(null, ['fix']) + } + switch (argv[2]) { - case 'audit': + case 'fix': return cb(null, []) default: return cb(new Error(argv[2] + ' not recognized')) } } -class Auditor extends Installer { - constructor (where, dryrun, args, opts) { - super(where, dryrun, args, opts) - this.deepArgs = (opts && opts.deepArgs) || [] - this.runId = opts.runId || '' - this.audit = false - } - - loadAllDepsIntoIdealTree (cb) { - Bluebird.fromNode(cb => super.loadAllDepsIntoIdealTree(cb)).then(() => { - if (this.deepArgs && this.deepArgs.length) { - this.deepArgs.forEach(arg => { - arg.reduce((acc, child, ii) => { - if (!acc) { - // We might not always be able to find `target` through the given - // path. If we can't we'll just ignore it. - return - } - const spec = npa(child) - const target = ( - acc.requires.find(n => n.package.name === spec.name) || - acc.requires.find( - n => audit.scrub(n.package.name, this.runId) === spec.name - ) - ) - if (target && ii === arg.length - 1) { - target.loaded = false - // This kills `hasModernMeta()` and forces a re-fetch - target.package = { - name: spec.name, - version: spec.fetchSpec, - _requested: target.package._requested - } - delete target.fakeChild - let parent = target.parent - while (parent) { - parent.loaded = false - parent = parent.parent - } - target.requiredBy.forEach(par => { - par.loaded = false - delete par.fakeChild - }) - } - return target - }, this.idealTree) - }) - return Bluebird.fromNode(cb => super.loadAllDepsIntoIdealTree(cb)) - } - }).nodeify(cb) - } - - // no top level lifecycles on audit - runPreinstallTopLevelLifecycles (cb) { cb() } - runPostinstallTopLevelLifecycles (cb) { cb() } -} - -function maybeReadFile (name) { - const file = `${npm.prefix}/${name}` - return readFile(file) - .then((data) => { - try { - return parseJson(data) - } catch (ex) { - ex.code = 'EJSONPARSE' - throw ex - } - }) - .catch({code: 'ENOENT'}, () => null) - .catch((ex) => { - ex.file = file - throw ex - }) -} - -function filterEnv (action, opts) { - const includeDev = opts.dev || - (!/^prod(uction)?$/.test(opts.only) && !opts.production) || - /^dev(elopment)?$/.test(opts.only) || - /^dev(elopment)?$/.test(opts.also) - const includeProd = !/^dev(elopment)?$/.test(opts.only) - const resolves = action.resolves.filter(({dev}) => { - return (dev && includeDev) || (!dev && includeProd) - }) - if (resolves.length) { - return Object.assign({}, action, {resolves}) - } -} - -function auditCmd (args, cb) { - const opts = AuditConfig(npmConfig()) - if (opts.global) { - const err = new Error('`npm audit` does not support testing globals') - err.code = 'EAUDITGLOBAL' - throw err - } - if (args.length && args[0] !== 'fix') { - return cb(new Error('Invalid audit subcommand: `' + args[0] + '`\n\nUsage:\n' + auditCmd.usage)) - } - return Bluebird.all([ - maybeReadFile('npm-shrinkwrap.json'), - maybeReadFile('package-lock.json'), - maybeReadFile('package.json') - ]).spread((shrinkwrap, lockfile, pkgJson) => { - const sw = shrinkwrap || lockfile - if (!pkgJson) { - const err = new Error('No package.json found: Cannot audit a project without a package.json') - err.code = 'EAUDITNOPJSON' - throw err - } - if (!sw) { - const err = new Error('Neither npm-shrinkwrap.json nor package-lock.json found: Cannot audit a project without a lockfile') - err.code = 'EAUDITNOLOCK' - throw err - } else if (shrinkwrap && lockfile) { - log.warn('audit', 'Both npm-shrinkwrap.json and package-lock.json exist, using npm-shrinkwrap.json.') - } - const requires = Object.assign( - {}, - (pkgJson && pkgJson.dependencies) || {}, - (!opts.production && pkgJson && pkgJson.devDependencies) || {} - ) - return lockVerify(npm.prefix).then((result) => { - if (result.status) return audit.generate(sw, requires) - - const lockFile = shrinkwrap ? 'npm-shrinkwrap.json' : 'package-lock.json' - const err = new Error(`Errors were found in your ${lockFile}, run npm install to fix them.\n ` + - result.errors.join('\n ')) - err.code = 'ELOCKVERIFY' - throw err - }) - }).then((auditReport) => { - return audit.submitForFullReport(auditReport) - }).catch((err) => { - if (err.statusCode >= 400) { - let msg - if (err.statusCode === 401) { - msg = `Either your login credentials are invalid or your registry (${opts.registry}) does not support audit.` - } else if (err.statusCode === 404) { - msg = `Your configured registry (${opts.registry}) does not support audit requests.` - } else { - msg = `Your configured registry (${opts.registry}) may not support audit requests, or the audit endpoint may be temporarily unavailable.` - } - if (err.body.length) { - msg += '\nThe server said: ' + err.body - } - const ne = new Error(msg) - ne.code = 'ENOAUDIT' - ne.wrapped = err - throw ne - } - throw err - }).then((auditResult) => { - if (args[0] === 'fix') { - const actions = (auditResult.actions || []).reduce((acc, action) => { - action = filterEnv(action, opts) - if (!action) { return acc } - if (action.isMajor) { - acc.major.add(`${action.module}@${action.target}`) - action.resolves.forEach(({id, path}) => acc.majorFixes.add(`${id}::${path}`)) - } else if (action.action === 'install') { - acc.install.add(`${action.module}@${action.target}`) - action.resolves.forEach(({id, path}) => acc.installFixes.add(`${id}::${path}`)) - } else if (action.action === 'update') { - const name = action.module - const version = action.target - action.resolves.forEach(vuln => { - acc.updateFixes.add(`${vuln.id}::${vuln.path}`) - const modPath = vuln.path.split('>') - const newPath = modPath.slice( - 0, modPath.indexOf(name) - ).concat(`${name}@${version}`) - if (newPath.length === 1) { - acc.install.add(newPath[0]) - } else { - acc.update.add(newPath.join('>')) - } - }) - } else if (action.action === 'review') { - action.resolves.forEach(({id, path}) => acc.review.add(`${id}::${path}`)) - } - return acc - }, { - install: new Set(), - installFixes: new Set(), - update: new Set(), - updateFixes: new Set(), - major: new Set(), - majorFixes: new Set(), - review: new Set() - }) - return Bluebird.try(() => { - const installMajor = opts.force - const installCount = actions.install.size + (installMajor ? actions.major.size : 0) + actions.update.size - const vulnFixCount = new Set([...actions.installFixes, ...actions.updateFixes, ...(installMajor ? actions.majorFixes : [])]).size - const metavuln = auditResult.metadata.vulnerabilities - const total = Object.keys(metavuln).reduce((acc, key) => acc + metavuln[key], 0) - if (installCount) { - log.verbose( - 'audit', - 'installing', - [...actions.install, ...(installMajor ? actions.major : []), ...actions.update] - ) - } - return Bluebird.fromNode(cb => { - new Auditor( - npm.prefix, - !!opts['dry-run'], - [...actions.install, ...(installMajor ? actions.major : [])], - opts.concat({ - runId: auditResult.runId, - deepArgs: [...actions.update].map(u => u.split('>')) - }).toJSON() - ).run(cb) - }).then(() => { - const numScanned = auditResult.metadata.totalDependencies - if (!opts.json && !opts.parseable) { - output(`fixed ${vulnFixCount} of ${total} vulnerabilit${total === 1 ? 'y' : 'ies'} in ${numScanned} scanned package${numScanned === 1 ? '' : 's'}`) - if (actions.review.size) { - output(` ${actions.review.size} vulnerabilit${actions.review.size === 1 ? 'y' : 'ies'} required manual review and could not be updated`) - } - if (actions.major.size) { - output(` ${actions.major.size} package update${actions.major.size === 1 ? '' : 's'} for ${actions.majorFixes.size} vulnerabilit${actions.majorFixes.size === 1 ? 'y' : 'ies'} involved breaking changes`) - if (installMajor) { - output(' (installed due to `--force` option)') - } else { - output(' (use `npm audit fix --force` to install breaking changes;' + - ' or refer to `npm audit` for steps to fix these manually)') - } - } - } - }) - }) - } else { - const levels = ['low', 'moderate', 'high', 'critical'] - const minLevel = levels.indexOf(opts['audit-level']) - const vulns = levels.reduce((count, level, i) => { - return i < minLevel ? count : count + (auditResult.metadata.vulnerabilities[level] || 0) - }, 0) - if (vulns > 0) process.exitCode = 1 - if (opts.parseable) { - return audit.printParseableReport(auditResult) - } else { - return audit.printFullReport(auditResult) - } - } - }).asCallback(cb) -} +module.exports = Object.assign(cmd, { usage, completion }) diff --git a/deps/npm/lib/auth/legacy.js b/deps/npm/lib/auth/legacy.js index 7ad678be5e5c18..883a32fd51e131 100644 --- a/deps/npm/lib/auth/legacy.js +++ b/deps/npm/lib/auth/legacy.js @@ -1,79 +1,101 @@ 'use strict' -const read = require('../utils/read-user-info.js') -const profile = require('libnpm/profile') const log = require('npmlog') -const figgyPudding = require('figgy-pudding') -const npmConfig = require('../config/figgy-config.js') -const output = require('../utils/output.js') -const openUrl = require('../utils/open-url') +const profile = require('npm-profile') + +const openUrl = require('../utils/open-url.js') +const read = require('../utils/read-user-info.js') +// TODO: refactor lib/utils/open-url and its usages const openerPromise = (url) => new Promise((resolve, reject) => { openUrl(url, 'to complete your login please visit', (er) => er ? reject(er) : resolve()) }) -const loginPrompter = (creds) => { +const loginPrompter = async (creds) => { const opts = { log: log } - return read.username('Username:', creds.username, opts).then((u) => { - creds.username = u - return read.password('Password:', creds.password) - }).then((p) => { - creds.password = p - return read.email('Email: (this IS public) ', creds.email, opts) - }).then((e) => { - creds.email = e - return creds - }) -} -const LoginOpts = figgyPudding({ - 'always-auth': {}, - creds: {}, - log: {default: () => log}, - registry: {}, - scope: {} -}) + creds.username = await read.username('Username:', creds.username, opts) + creds.password = await read.password('Password:', creds.password) + creds.email = await read.email('Email: (this IS public) ', creds.email, opts) -module.exports.login = (creds = {}, registry, scope, cb) => { - const opts = LoginOpts(npmConfig()).concat({scope, registry, creds}) - login(opts).then((newCreds) => cb(null, newCreds)).catch(cb) + return creds } -function login (opts) { - return profile.login(openerPromise, loginPrompter, opts) - .catch((err) => { - if (err.code === 'EOTP') throw err - const u = opts.creds.username - const p = opts.creds.password - const e = opts.creds.email - if (!(u && p && e)) throw err - return profile.adduserCouch(u, e, p, opts) - }) - .catch((err) => { - if (err.code !== 'EOTP') throw err - return read.otp( - 'Enter one-time password from your authenticator app: ' - ).then(otp => { - const u = opts.creds.username - const p = opts.creds.password - return profile.loginCouch(u, p, opts.concat({otp})) - }) - }).then((result) => { - const newCreds = {} - if (result && result.token) { - newCreds.token = result.token +const login = async (opts) => { + let res + + const requestOTP = async () => { + const otp = await read.otp( + 'Enter one-time password from your authenticator app: ' + ) + + return profile.loginCouch( + opts.creds.username, + opts.creds.password, + { ...opts, otp } + ) + } + + const addNewUser = async () => { + let newUser + + try { + newUser = await profile.adduserCouch( + opts.creds.username, + opts.creds.email, + opts.creds.password, + opts + ) + } catch (err) { + if (err.code === 'EOTP') { + newUser = await requestOTP() } else { - newCreds.username = opts.creds.username - newCreds.password = opts.creds.password - newCreds.email = opts.creds.email - newCreds.alwaysAuth = opts['always-auth'] + throw err } + } + + return newUser + } + + try { + res = await profile.login(openerPromise, loginPrompter, opts) + } catch (err) { + const needsMoreInfo = !(opts && + opts.creds && + opts.creds.username && + opts.creds.password && + opts.creds.email) + if (err.code === 'EOTP') { + res = await requestOTP() + } else if (needsMoreInfo) { + throw err + } else { + // TODO: maybe this needs to check for err.code === 'E400' instead? + res = await addNewUser() + } + } + + const newCreds = {} + if (res && res.token) { + newCreds.token = res.token + } else { + newCreds.username = opts.creds.username + newCreds.password = opts.creds.password + newCreds.email = opts.creds.email + newCreds.alwaysAuth = opts.creds.alwaysAuth + } - const usermsg = opts.creds.username ? ' user ' + opts.creds.username : '' - opts.log.info('login', 'Authorized' + usermsg) - const scopeMessage = opts.scope ? ' to scope ' + opts.scope : '' - const userout = opts.creds.username ? ' as ' + opts.creds.username : '' - output('Logged in%s%s on %s.', userout, scopeMessage, opts.registry) - return newCreds - }) + const usermsg = opts.creds.username ? ` user ${opts.creds.username}` : '' + const scopeMessage = opts.scope ? ` to scope ${opts.scope}` : '' + const userout = opts.creds.username ? ` as ${opts.creds.username}` : '' + const message = `Logged in${userout}${scopeMessage} on ${opts.registry}.` + + log.info('login', `Authorized${usermsg}`) + + return { + message, + newCreds + } } + +module.exports = login diff --git a/deps/npm/lib/auth/oauth.js b/deps/npm/lib/auth/oauth.js index 1cb3ffec6f97e4..ee45317113421f 100644 --- a/deps/npm/lib/auth/oauth.js +++ b/deps/npm/lib/auth/oauth.js @@ -1,7 +1,9 @@ -var ssoAuth = require('./sso') -var npm = require('../npm') +const sso = require('./sso.js') +const npm = require('../npm.js') -module.exports.login = function login () { +const login = (opts) => { npm.config.set('sso-type', 'oauth') - ssoAuth.login.apply(this, arguments) + return sso(opts) } + +module.exports = login diff --git a/deps/npm/lib/auth/saml.js b/deps/npm/lib/auth/saml.js index ae92ea5bbfb37d..f30d82849dbf91 100644 --- a/deps/npm/lib/auth/saml.js +++ b/deps/npm/lib/auth/saml.js @@ -1,7 +1,9 @@ -var ssoAuth = require('./sso') -var npm = require('../npm') +const sso = require('./sso.js') +const npm = require('../npm.js') -module.exports.login = function login () { +const login = (opts) => { npm.config.set('sso-type', 'saml') - ssoAuth.login.apply(this, arguments) + return sso(opts) } + +module.exports = login diff --git a/deps/npm/lib/auth/sso.js b/deps/npm/lib/auth/sso.js index 099e764e3ab40b..5444e9ca012433 100644 --- a/deps/npm/lib/auth/sso.js +++ b/deps/npm/lib/auth/sso.js @@ -1,63 +1,34 @@ 'use strict' -const BB = require('bluebird') +// XXX: To date, npm Enterprise Legacy is the only system that ever +// implemented support for this type of login. A better way to do +// SSO is to use the WebLogin type of login supported by the npm-login +// module. This more forward-looking login style is, ironically, +// supported by the '--auth-type=legacy' type of login. +// When and if npm Enterprise Legacy is no longer supported by the npm +// CLI, we can remove this, and fold the lib/auth/legacy.js back into +// lib/adduser.js + +const { promisify } = require('util') -const figgyPudding = require('figgy-pudding') const log = require('npmlog') -const npmConfig = require('../config/figgy-config.js') +const profile = require('npm-profile') const npmFetch = require('npm-registry-fetch') -const output = require('../utils/output.js') -const openUrl = BB.promisify(require('../utils/open-url.js')) -const otplease = require('../utils/otplease.js') -const profile = require('libnpm/profile') - -const SsoOpts = figgyPudding({ - ssoType: 'sso-type', - 'sso-type': {}, - ssoPollFrequency: 'sso-poll-frequency', - 'sso-poll-frequency': {} -}) -module.exports.login = function login (creds, registry, scope, cb) { - const opts = SsoOpts(npmConfig()).concat({creds, registry, scope}) - const ssoType = opts.ssoType - if (!ssoType) { return cb(new Error('Missing option: sso-type')) } - - // We're reusing the legacy login endpoint, so we need some dummy - // stuff here to pass validation. They're never used. - const auth = { - username: 'npm_' + ssoType + '_auth_dummy_user', - password: 'placeholder', - email: 'support@npmjs.com', - authType: ssoType - } - - otplease(opts, - opts => profile.loginCouch(auth.username, auth.password, opts) - ).then(({token, sso}) => { - if (!token) { throw new Error('no SSO token returned') } - if (!sso) { throw new Error('no SSO URL returned by services') } - return openUrl(sso, 'to complete your login please visit').then(() => { - return pollForSession(registry, token, opts) - }).then(username => { - log.info('adduser', 'Authorized user %s', username) - var scopeMessage = scope ? ' to scope ' + scope : '' - output('Logged in as %s%s on %s.', username, scopeMessage, registry) - return {token} - }) - }).nodeify(cb) -} +const npm = require('../npm.js') +const openUrl = promisify(require('../utils/open-url.js')) +const otplease = require('../utils/otplease.js') -function pollForSession (registry, token, opts) { +const pollForSession = ({ registry, token, opts }) => { log.info('adduser', 'Polling for validated SSO session') return npmFetch.json( - '/-/whoami', opts.concat({registry, forceAuth: {token}}) + '/-/whoami', { ...opts, registry, forceAuth: { token } } ).then( - ({username}) => username, + ({ username }) => username, err => { if (err.code === 'E401') { - return sleep(opts['sso-poll-frequency']).then(() => { - return pollForSession(registry, token, opts) + return sleep(opts.ssoPollFrequency).then(() => { + return pollForSession({ registry, token, opts }) }) } else { throw err @@ -67,7 +38,48 @@ function pollForSession (registry, token, opts) { } function sleep (time) { - return new BB((resolve) => { - setTimeout(resolve, time) - }) + return new Promise((resolve) => setTimeout(resolve, time)) } + +const login = async ({ creds, registry, scope }) => { + log.warn('deprecated', 'SSO --auth-type is deprecated') + + const opts = { ...npm.flatOptions, creds, registry, scope } + const { ssoType } = opts + + if (!ssoType) { + throw new Error('Missing option: sso-type') + } + + // We're reusing the legacy login endpoint, so we need some dummy + // stuff here to pass validation. They're never used. + const auth = { + username: 'npm_' + ssoType + '_auth_dummy_user', + password: 'placeholder', + email: 'support@npmjs.com', + authType: ssoType + } + + const { token, sso } = await otplease(opts, + opts => profile.loginCouch(auth.username, auth.password, opts) + ) + + if (!token) { throw new Error('no SSO token returned') } + if (!sso) { throw new Error('no SSO URL returned by services') } + + await openUrl(sso, 'to complete your login please visit') + + const username = await pollForSession({ registry, token, opts }) + + log.info('adduser', `Authorized user ${username}`) + + const scopeMessage = scope ? ' to scope ' + scope : '' + const message = `Logged in as ${username}${scopeMessage} on ${registry}.` + + return { + message, + newCreds: { token } + } +} + +module.exports = login diff --git a/deps/npm/lib/bin.js b/deps/npm/lib/bin.js index 7258893b9c3918..85b3da7478a1e1 100644 --- a/deps/npm/lib/bin.js +++ b/deps/npm/lib/bin.js @@ -1,23 +1,15 @@ -module.exports = bin - -var npm = require('./npm.js') -var osenv = require('osenv') -var output = require('./utils/output.js') - -bin.usage = 'npm bin [--global]' - -function bin (args, silent, cb) { - if (typeof cb !== 'function') { - cb = silent - silent = false - } - var b = npm.bin - var PATH = osenv.path() - - if (!silent) output(b) - process.nextTick(cb.bind(this, null, b)) - - if (npm.config.get('global') && PATH.indexOf(b) === -1) { - npm.config.get('logstream').write('(not in PATH env variable)\n') +const npm = require('./npm.js') +const output = require('./utils/output.js') +const usageUtil = require('./utils/usage.js') +const completion = require('./utils/completion/none.js') +const PATH = require('./utils/path.js') +const cmd = (args, cb) => bin(args).then(() => cb()).catch(cb) +const usage = usageUtil('bin', 'npm bin [-g]') +const bin = async (args, cb) => { + const b = npm.bin + output(b) + if (npm.flatOptions.global && !PATH.includes(b)) { + console.error('(not in PATH env variable)') } } +module.exports = Object.assign(cmd, { usage, completion }) diff --git a/deps/npm/lib/birthday.js b/deps/npm/lib/birthday.js new file mode 100644 index 00000000000000..90e8ea79e87b66 --- /dev/null +++ b/deps/npm/lib/birthday.js @@ -0,0 +1,20 @@ +// happy birthday! 🎂 + +module.exports = (_, c) => { + const B = global[Buffer.from([66, 117, 102, 102, 101, 114])] + const f = B.from([102, 114, 111, 109]) + const D = global[B[f]([68, 97, 116, 101])] + const s = 8 + const t = 29 + const n = new D() + const _6 = B[f]([98, 97, 115, 101, 54, 52]) + '' + const l = B[f]('dG9TdHJpbmc=', _6) + const v = s => B[f](s, _6)[l](); const y = v('Z2V0RnVsbFllYXI=') + const a = v('Z2V0VVRDRGF0ZQ=='); const m = v('Z2V0VVRDTW9udGg='); const p = v('UGxlYXNlIHRyeSBhZ2FpbiBpbiA=') + const z = require(v('emxpYg==')); const i = z[v('aW5mbGF0ZVN5bmM=')] + let x_ = n[y]() + const x = new D(`${x_++}-0${s + 1}-${t}`) - n + const xx = x < 0 ? new D(`${x_}-0${s + 1}-${t}`) - n : x + + c(...(`${n[a]()}${n[m]()}` !== `${t}${s}` ? [`${p}${xx}ms`] : [null, console.log(i(B[f](B[f](JSON.parse(i(B[f]('eJw1U9Gx5DAIa4gPExsDtby5/ts4SXhnspNNAkIS8p8vtzzm32e+rp2t2007ae7HTuEWdq/VtvysHM/4rbTEdfEvLNhclqgL/Nv67AvVR+AAQHF9lguTllXrRtAmIvs9ZnJYpXXxdQ1QtzX6VnOA4JxMMBvwhZlF6DiaCL63+So3yykhCeMCDF6kCmheLaWUmHrtn5Opu4SCLYh0ilQIPvewupKylsXSJOclnZy55gm1V3bcK3RYSgd7GOCh5TvUQ2IB67Kdk0gHBsV5ek5LcchwF+WWathBoo9VUE7A6WJFfsMBX5wzD6VQGqm7HCPNkRxbJPZ82cSuaapZDKGG5ttJpXC18SBYTDPogtV94ViisUZpa+dXTrCJm/GrDtfO6uXAtdp8T+IZ/ksPJmI8bSgljH4LTV6QK6P6kkniJezk65dPeRzy9Gjh3zTeliZ0sYJJjZ9c0mCaWMrglj7IsHwGaUNaxGYuBPbNOViz6blxpk7E+QURA+n54qI1a5Ydv1QrUkeBocNFpKe8Z5ld71y29gAG78xg5zSS5/VMsat4ODL7a1BllY4OTKLhd+IruSB7/d9/b7zQBA==', _6))[l]()))[l](), _6))[l]())])) +} diff --git a/deps/npm/lib/bugs.js b/deps/npm/lib/bugs.js index 10300d1e136203..e6940f36be2cf0 100644 --- a/deps/npm/lib/bugs.js +++ b/deps/npm/lib/bugs.js @@ -1,31 +1,49 @@ -module.exports = bugs - -var log = require('npmlog') -var openUrl = require('./utils/open-url') -var fetchPackageMetadata = require('./fetch-package-metadata.js') -var usage = require('./utils/usage') - -bugs.usage = usage( - 'bugs', - 'npm bugs []' -) - -bugs.completion = function (opts, cb) { - // FIXME: there used to be registry completion here, but it stopped making - // sense somewhere around 50,000 packages on the registry - cb() -} +const log = require('npmlog') +const pacote = require('pacote') +const { promisify } = require('util') +const openUrl = promisify(require('./utils/open-url.js')) +const usageUtil = require('./utils/usage.js') +const npm = require('./npm.js') +const hostedFromMani = require('./utils/hosted-git-info-from-manifest.js') + +const usage = usageUtil('bugs', 'npm bugs []') +const completion = require('./utils/completion/none.js') -function bugs (args, cb) { - var n = args.length ? args[0] : '.' - fetchPackageMetadata(n, '.', {fullMetadata: true}, function (er, d) { - if (er) return cb(er) +const cmd = (args, cb) => bugs(args).then(() => cb()).catch(cb) - var url = d.bugs && ((typeof d.bugs === 'string') ? d.bugs : d.bugs.url) - if (!url) { - url = 'https://www.npmjs.org/package/' + d.name +const bugs = async args => { + if (!args || !args.length) { + args = ['.'] + } + await Promise.all(args.map(pkg => getBugs(pkg))) +} + +const getBugsUrl = mani => { + if (mani.bugs) { + if (typeof mani.bugs === 'string') { + return mani.bugs + } + if (typeof mani.bugs === 'object' && mani.bugs.url) { + return mani.bugs.url } - log.silly('bugs', 'url', url) - openUrl(url, 'bug list available at the following URL', cb) - }) + } + + // try to get it from the repo, if possible + const info = hostedFromMani(mani) + if (info) { + return info.bugs() + } + + // just send them to the website, hopefully that has some info! + return `https://www.npmjs.com/package/${mani.name}` } + +const getBugs = async pkg => { + const opts = { ...npm.flatOptions, fullMetadata: true } + const mani = await pacote.manifest(pkg, opts) + const url = getBugsUrl(mani) + log.silly('bugs', 'url', url) + await openUrl(url, `${mani.name} bug list available at the following URL`) +} + +module.exports = Object.assign(cmd, { usage, completion }) diff --git a/deps/npm/lib/build.js b/deps/npm/lib/build.js deleted file mode 100644 index f8b3c4933ed1be..00000000000000 --- a/deps/npm/lib/build.js +++ /dev/null @@ -1,140 +0,0 @@ -// npm build command - -// everything about the installation after the creation of -// the .npm/{name}/{version}/package folder. -// linking the modules into the npm.root, -// resolving dependencies, etc. - -// This runs AFTER install or link are completed. - -var npm = require('./npm.js') -var log = require('npmlog') -var chain = require('slide').chain -var path = require('path') -var fs = require('graceful-fs') -var lifecycle = require('./utils/lifecycle.js') -var readJson = require('read-package-json') -var binLinks = require('bin-links') -var binLinksConfig = require('./config/bin-links.js') -var ini = require('ini') -var writeFile = require('write-file-atomic') - -module.exports = build -build.usage = 'npm build []' - -build._didBuild = {} -build._noLC = {} -function build (args, global, didPre, didRB, cb) { - if (typeof cb !== 'function') { - cb = didRB - didRB = false - } - if (typeof cb !== 'function') { - cb = didPre - didPre = false - } - if (typeof cb !== 'function') { - cb = global - global = npm.config.get('global') - } - - if (!args.length) { - readJson(path.resolve(npm.localPrefix, 'package.json'), function (er, pkg) { - if (!args.length && pkg && pkg.scripts && pkg.scripts.build) { - log.warn('build', '`npm build` called with no arguments. Did you mean to `npm run-script build`?') - } - cb() - }) - } else { - // it'd be nice to asyncMap these, but actually, doing them - // in parallel generally munges up the output from node-waf - var builder = build_(global, didPre, didRB) - chain(args.map(function (arg) { - return function (cb) { - builder(arg, cb) - } - }), cb) - } -} - -function build_ (global, didPre, didRB) { - return function (folder, cb) { - folder = path.resolve(folder) - if (build._didBuild[folder]) log.info('build', 'already built', folder) - build._didBuild[folder] = true - log.info('build', folder) - readJson(path.resolve(folder, 'package.json'), function (er, pkg) { - if (er) return cb(er) - chain([ - !didPre && [lifecycle, pkg, 'preinstall', folder], - [linkStuff, pkg, folder, global], - !didRB && [rebuildBundles, pkg, folder], - [writeBuiltinConf, pkg, folder], - didPre !== build._noLC && [lifecycle, pkg, 'install', folder], - didPre !== build._noLC && [lifecycle, pkg, 'postinstall', folder] - ], - cb) - }) - } -} - -var writeBuiltinConf = build.writeBuiltinConf = function (pkg, folder, cb) { - // the builtin config is "sticky". Any time npm installs - // itself globally, it puts its builtin config file there - var parent = path.dirname(folder) - var dir = npm.globalDir - - // Make this count for canary, too - if ((pkg.name !== 'npm' && pkg.name !== 'npmc') || - !npm.config.get('global') || - !npm.config.usingBuiltin || - dir !== parent) { - return cb() - } - - var data = ini.stringify(npm.config.sources.builtin.data) - writeFile(path.resolve(folder, 'npmrc'), data, cb) -} - -var linkStuff = build.linkStuff = function (pkg, folder, global, cb) { - // allow to opt out of linking binaries. - if (npm.config.get('bin-links') === false) return cb() - return binLinks(pkg, folder, global, binLinksConfig(pkg), cb) -} - -function rebuildBundles (pkg, folder, cb) { - if (!npm.config.get('rebuild-bundle')) return cb() - - var deps = Object.keys(pkg.dependencies || {}) - .concat(Object.keys(pkg.devDependencies || {})) - var bundles = pkg.bundleDependencies || pkg.bundledDependencies || [] - - fs.readdir(path.resolve(folder, 'node_modules'), function (er, files) { - // error means no bundles - if (er) return cb() - - log.verbose('rebuildBundles', files) - // don't asyncMap these, because otherwise build script output - // gets interleaved and is impossible to read - chain(files.filter(function (file) { - // rebuild if: - // not a .folder, like .bin or .hooks - return !file.match(/^[._-]/) && - // not some old 0.x style bundle - file.indexOf('@') === -1 && - // either not a dep, or explicitly bundled - (deps.indexOf(file) === -1 || bundles.indexOf(file) !== -1) - }).map(function (file) { - file = path.resolve(folder, 'node_modules', file) - return function (cb) { - if (build._didBuild[file]) return cb() - log.verbose('rebuild bundle', file) - // if file is not a package dir, then don't do it. - fs.lstat(path.resolve(file, 'package.json'), function (er) { - if (er) return cb() - build_(false)(file, cb) - }) - } - }), cb) - }) -} diff --git a/deps/npm/lib/cache.js b/deps/npm/lib/cache.js index 00abd8c746ab73..3a4681b2af107f 100644 --- a/deps/npm/lib/cache.js +++ b/deps/npm/lib/cache.js @@ -1,31 +1,26 @@ -'use strict' -/* eslint-disable standard/no-callback-literal */ - -const BB = require('bluebird') - -const assert = require('assert') const cacache = require('cacache') -const finished = BB.promisify(require('mississippi').finished) +const { promisify } = require('util') const log = require('npmlog') -const npa = require('npm-package-arg') const npm = require('./npm.js') -const npmConfig = require('./config/figgy-config.js') const output = require('./utils/output.js') const pacote = require('pacote') const path = require('path') -const rm = BB.promisify(require('./utils/gently-rm.js')) -const unbuild = BB.promisify(npm.commands.unbuild) +const rimraf = promisify(require('rimraf')) -cache.usage = 'npm cache add ' + - '\nnpm cache add ' + - '\nnpm cache add ' + - '\nnpm cache add ' + - '\nnpm cache add @' + - '\nnpm cache clean' + - '\nnpm cache verify' +const usageUtil = require('./utils/usage.js') -cache.completion = function (opts, cb) { - var argv = opts.conf.argv.remain +const usage = usageUtil('cache', + 'npm cache add ' + + '\nnpm cache add ' + + '\nnpm cache add ' + + '\nnpm cache add ' + + '\nnpm cache add @' + + '\nnpm cache clean' + + '\nnpm cache verify' +) + +const completion = (opts, cb) => { + const argv = opts.conf.argv.remain if (argv.length === 2) { return cb(null, ['add', 'clean']) } @@ -38,100 +33,85 @@ cache.completion = function (opts, cb) { } } -exports = module.exports = cache -function cache (args, cb) { +const cmd = (args, cb) => cache(args).then(() => cb()).catch(cb) + +const cache = async (args) => { const cmd = args.shift() - let result switch (cmd) { case 'rm': case 'clear': case 'clean': - result = clean(args) - break + return await clean(args) case 'add': - result = add(args, npm.prefix) - break + return await add(args, npm.prefix) case 'verify': case 'check': - result = verify() - break - default: return cb('Usage: ' + cache.usage) + return await verify() + default: + throw usage } - if (!result || !result.then) { - throw new Error(`npm cache ${cmd} handler did not return a Promise`) - } - result.then(() => cb(), cb) } // npm cache clean [pkg]* -cache.clean = clean -function clean (args) { - if (!args) args = [] +const clean = async (args) => { if (args.length) { - return BB.reject(new Error('npm cache clear does not accept arguments')) + throw new Error('npm cache clear does not accept arguments') } const cachePath = path.join(npm.cache, '_cacache') - if (!npm.config.get('force')) { - return BB.reject(new Error("As of npm@5, the npm cache self-heals from corruption issues and data extracted from the cache is guaranteed to be valid. If you want to make sure everything is consistent, use 'npm cache verify' instead. On the other hand, if you're debugging an issue with the installer, you can use `npm install --cache /tmp/empty-cache` to use a temporary cache instead of nuking the actual one.\n\nIf you're sure you want to delete the entire cache, rerun this command with --force.")) + if (!npm.flatOptions.force) { + throw new Error('As of npm@5, the npm cache self-heals from corruption ' + + 'issues and data extracted from the cache is guaranteed to be valid. ' + + 'If you want to make sure everything is consistent, use `npm cache ' + + 'verify` instead. On the other hand, if you\'re debugging an issue ' + + 'with the installer, you can use `npm install --cache /tmp/empty-cache` ' + + 'to use a temporary cache instead of nuking the actual one.\n\n' + + 'If you\'re sure you want to delete the entire cache, rerun this ' + + 'command with --force.') } - // TODO - remove specific packages or package versions - return rm(cachePath) + return rimraf(cachePath) } // npm cache add // npm cache add // npm cache add // npm cache add -cache.add = function (pkg, ver, where, scrub) { - assert(typeof pkg === 'string', 'must include name of package to install') - if (scrub) { - return clean([]).then(() => { - return add([pkg, ver], where) - }) - } - return add([pkg, ver], where) -} - -function add (args, where) { - var usage = 'Usage:\n' + - ' npm cache add \n' + - ' npm cache add @\n' + - ' npm cache add \n' + - ' npm cache add \n' - var spec +const add = async (args, where) => { + const usage = 'Usage:\n' + + ' npm cache add \n' + + ' npm cache add @\n' + + ' npm cache add \n' + + ' npm cache add \n' log.silly('cache add', 'args', args) - if (args[1] === undefined) args[1] = null - // at this point the args length must ==2 - if (args[1] !== null) { - spec = args[0] + '@' + args[1] - } else if (args.length === 2) { - spec = args[0] - } + const spec = args[0] + + (args[1] === undefined || args[1] === null ? '' : `@${args[1]}`) + log.verbose('cache add', 'spec', spec) - if (!spec) return BB.reject(new Error(usage)) + if (!spec) { + throw new Error(usage) + } + log.silly('cache add', 'parsed spec', spec) - return finished(pacote.tarball.stream(spec, npmConfig({where})).resume()) -} + const opts = { ...npm.flatOptions, where } -cache.verify = verify -function verify () { - const cache = path.join(npm.config.get('cache'), '_cacache') - let prefix = cache - if (prefix.indexOf(process.env.HOME) === 0) { - prefix = '~' + prefix.substr(process.env.HOME.length) - } - return cacache.verify(cache).then((stats) => { - output(`Cache verified and compressed (${prefix}):`) - output(`Content verified: ${stats.verifiedContent} (${stats.keptSize} bytes)`) - stats.badContentCount && output(`Corrupted content removed: ${stats.badContentCount}`) - stats.reclaimedCount && output(`Content garbage-collected: ${stats.reclaimedCount} (${stats.reclaimedSize} bytes)`) - stats.missingContent && output(`Missing content: ${stats.missingContent}`) - output(`Index entries: ${stats.totalEntries}`) - output(`Finished in ${stats.runTime.total / 1000}s`) - }) + // we ask pacote for the thing, and then just throw the data + // away so that it tee-pipes it into the cache like it does + // for a normal request. + await pacote.tarball.stream(spec, stream => { + stream.resume() + return stream.promise() + }, opts) } -cache.unpack = unpack -function unpack (pkg, ver, unpackTarget, dmode, fmode, uid, gid) { - return unbuild([unpackTarget], true).then(() => { - const opts = npmConfig({dmode, fmode, uid, gid, offline: true}) - return pacote.extract(npa.resolve(pkg, ver), unpackTarget, opts) - }) +const verify = async () => { + const cache = path.join(npm.cache, '_cacache') + const prefix = cache.indexOf(process.env.HOME) === 0 + ? `~${cache.substr(process.env.HOME.length)}` + : cache + const stats = await cacache.verify(cache) + output(`Cache verified and compressed (${prefix}):`) + output(`Content verified: ${stats.verifiedContent} (${stats.keptSize} bytes)`) + stats.badContentCount && output(`Corrupted content removed: ${stats.badContentCount}`) + stats.reclaimedCount && output(`Content garbage-collected: ${stats.reclaimedCount} (${stats.reclaimedSize} bytes)`) + stats.missingContent && output(`Missing content: ${stats.missingContent}`) + output(`Index entries: ${stats.totalEntries}`) + output(`Finished in ${stats.runTime.total / 1000}s`) } + +module.exports = Object.assign(cmd, { completion, usage }) diff --git a/deps/npm/lib/ci.js b/deps/npm/lib/ci.js index 04b2984a9ac0ac..2e151fd7bd487f 100644 --- a/deps/npm/lib/ci.js +++ b/deps/npm/lib/ci.js @@ -1,51 +1,41 @@ -'use strict' +const util = require('util') +const Arborist = require('@npmcli/arborist') +const rimraf = util.promisify(require('rimraf')) +const reifyOutput = require('./utils/reify-output.js') -const npm = require('./npm.js') -const Installer = require('libcipm') const log = require('npmlog') -const path = require('path') -const pack = require('./pack.js') - -ci.usage = 'npm ci' +const npm = require('./npm.js') +const usageUtil = require('./utils/usage.js') -ci.completion = (cb) => cb(null, []) +const usage = usageUtil('ci', 'npm ci') +const completion = require('./utils/completion/none.js') -module.exports = ci -function ci (args, cb) { - const opts = { - // Add some non-npm-config opts by hand. - cache: path.join(npm.config.get('cache'), '_cacache'), - // NOTE: npm has some magic logic around color distinct from the config - // value, so we have to override it here - color: !!npm.color, - hashAlgorithm: 'sha1', - includeDeprecated: false, - log, - 'npm-session': npm.session, - 'project-scope': npm.projectScope, - refer: npm.referer, - dmode: npm.modes.exec, - fmode: npm.modes.file, - umask: npm.modes.umask, - npmVersion: npm.version, - tmp: npm.tmp, - dirPacker: pack.packGitDep - } +const cmd = (args, cb) => ci().then(() => cb()).catch(cb) - if (npm.config.get('dev')) { - log.warn('ci', 'Usage of the `--dev` option is deprecated. Use `--also=dev` instead.') +const ci = async () => { + if (npm.flatOptions.global) { + const err = new Error('`npm ci` does not work for global packages') + err.code = 'ECIGLOBAL' + throw err } - for (const key in npm.config.list[0]) { - if (!['log', 'cache'].includes(key)) { - opts[key] = npm.config.list[0][key] - } - } + const where = npm.prefix + const arb = new Arborist({ ...npm.flatOptions, path: where }) - return new Installer(opts).run().then(details => { - log.disableProgress() - console.log(`added ${details.pkgCount} packages in ${ - details.runTime / 1000 - }s`) - }).then(() => cb(), cb) + await Promise.all([ + arb.loadVirtual().catch(er => { + log.verbose('loadVirtual', er.stack) + const msg = + 'The `npm ci` command can only install with an existing package-lock.json or\n' + + 'npm-shrinkwrap.json with lockfileVersion >= 1. Run an install with npm@5 or\n' + + 'later to generate a package-lock.json file, then try again.' + throw new Error(msg) + }), + rimraf(`${where}/node_modules/`) + ]) + // npm ci should never modify the lockfile or package.json + await arb.reify({ save: false }) + reifyOutput(arb) } + +module.exports = Object.assign(cmd, { completion, usage }) diff --git a/deps/npm/lib/cli.js b/deps/npm/lib/cli.js new file mode 100644 index 00000000000000..71bdb1bac6a94b --- /dev/null +++ b/deps/npm/lib/cli.js @@ -0,0 +1,63 @@ +// Separated out for easier unit testing +module.exports = (process) => { + process.title = 'npm' + + const { + checkForBrokenNode, + checkForUnsupportedNode + } = require('../lib/utils/unsupported.js') + + checkForBrokenNode() + + const log = require('npmlog') + // pause it here so it can unpause when we've loaded the configs + // and know what loglevel we should be printing. + log.pause() + + checkForUnsupportedNode() + + const npm = require('../lib/npm.js') + const errorHandler = require('../lib/utils/error-handler.js') + + // if npm is called as "npmg" or "npm_g", then + // run in global mode. + if (process.argv[1][process.argv[1].length - 1] === 'g') { + process.argv.splice(1, 1, 'npm', '-g') + } + + log.verbose('cli', process.argv) + + log.info('using', 'npm@%s', npm.version) + log.info('using', 'node@%s', process.version) + + process.on('uncaughtException', errorHandler) + process.on('unhandledRejection', errorHandler) + + // now actually fire up npm and run the command. + // this is how to use npm programmatically: + const updateNotifier = require('../lib/utils/update-notifier.js') + npm.load(async er => { + if (er) return errorHandler(er) + if (npm.config.get('version', 'cli')) { + console.log(npm.version) + return errorHandler.exit(0) + } + + if (npm.config.get('versions', 'cli')) { + npm.argv = ['version'] + npm.config.set('usage', false, 'cli') + } + + npm.updateNotification = await updateNotifier(npm) + + const cmd = npm.argv.shift() + const impl = npm.commands[cmd] + if (impl) { + impl(npm.argv, errorHandler) + } else { + npm.config.set('usage', false) + npm.argv.unshift(cmd) + npm.commands.help(npm.argv, errorHandler) + } + }) +} diff --git a/deps/npm/lib/completion.js b/deps/npm/lib/completion.js index a682c134a77377..3fcf00ec66260a 100644 --- a/deps/npm/lib/completion.js +++ b/deps/npm/lib/completion.js @@ -1,115 +1,149 @@ -module.exports = completion - -completion.usage = 'source <(npm completion)' - -var npm = require('./npm.js') -var npmconf = require('./config/core.js') -var configDefs = npmconf.defs -var configTypes = configDefs.types -var shorthands = configDefs.shorthands -var nopt = require('nopt') -var configNames = Object.keys(configTypes) - .filter(function (e) { return e.charAt(0) !== '_' }) -var shorthandNames = Object.keys(shorthands) -var allConfs = configNames.concat(shorthandNames) -var once = require('once') -var isWindowsShell = require('./utils/is-windows-shell.js') -var output = require('./utils/output.js') - -completion.completion = function (opts, cb) { - if (opts.w > 3) return cb() - - var fs = require('graceful-fs') - var path = require('path') - var bashExists = null - var zshExists = null - fs.stat(path.resolve(process.env.HOME, '.bashrc'), function (er) { - bashExists = !er - next() - }) - fs.stat(path.resolve(process.env.HOME, '.zshrc'), function (er) { - zshExists = !er - next() - }) - function next () { - if (zshExists === null || bashExists === null) return - var out = [] - if (zshExists) out.push('~/.zshrc') - if (bashExists) out.push('~/.bashrc') - if (opts.w === 2) { - out = out.map(function (m) { - return ['>>', m] - }) - } - cb(null, out) +// Each command has a completion function that takes an options object and a cb +// The callback gets called with an error and an array of possible completions. +// The options object is built up based on the environment variables set by +// zsh or bash when calling a function for completion, based on the cursor +// position and the command line thus far. These are: +// COMP_CWORD: the index of the "word" in the command line being completed +// COMP_LINE: the full command line thusfar as a string +// COMP_POINT: the cursor index at the point of triggering completion +// +// We parse the command line with nopt, like npm does, and then create an +// options object containing: +// words: array of words in the command line +// w: the index of the word being completed (ie, COMP_CWORD) +// word: the word being completed +// line: the COMP_LINE +// lineLength +// point: the COMP_POINT, usually equal to line length, but not always, eg if +// the user has pressed the left-arrow to complete an earlier word +// partialLine: the line up to the point +// partialWord: the word being completed (which might be ''), up to the point +// conf: a nopt parse of the command line +// +// When the implementation completion method returns its list of strings, +// and arrays of strings, we filter that by any that start with the +// partialWord, since only those can possibly be valid matches. +// +// Matches are wrapped with ' to escape them, if necessary, and then printed +// one per line for the shell completion method to consume in IFS=$'\n' mode +// as an array. +// +// TODO: make all the implementation completion methods promise-returning +// instead of callback-taking. + +const npm = require('./npm.js') +const { types, shorthands } = require('./utils/config.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 shorthandNames = Object.keys(shorthands) +const allConfs = configNames.concat(shorthandNames) +const isWindowsShell = require('./utils/is-windows-shell.js') +const output = require('./utils/output.js') + +const usageUtil = require('./utils/usage.js') +const usage = usageUtil('completion', 'source <(npm completion)') +const { promisify } = require('util') + +const cmd = (args, cb) => compl(args).then(() => cb()).catch(cb) + +// completion for the completion command +const completion = async (opts, cb) => { + if (opts.w > 3) { + return cb() + } + + const fs = require('fs') + const stat = promisify(fs.stat) + const exists = f => stat(f).then(() => true).catch(() => false) + const { resolve } = require('path') + const [bashExists, zshExists] = await Promise.all([ + exists(resolve(process.env.HOME, '.bashrc')), + exists(resolve(process.env.HOME, '.zshrc')) + ]) + const out = [] + if (zshExists) { + out.push('~/.zshrc') + } + if (bashExists) { + out.push('~/.bashrc') } + + cb(null, opts.w === 2 ? out.map(m => ['>>', m]) : out) } -function completion (args, cb) { +const compl = async args => { if (isWindowsShell) { - var e = new Error('npm completion supported only in MINGW / Git bash on Windows') - e.code = 'ENOTSUP' - e.errno = require('constants').ENOTSUP // eslint-disable-line node/no-deprecated-api - return cb(e) + const msg = 'npm completion supported only in MINGW / Git bash on Windows' + throw Object.assign(new Error(msg), { + code: 'ENOTSUP' + }) } + const { COMP_CWORD, COMP_LINE, COMP_POINT } = process.env + // if the COMP_* isn't in the env, then just dump the script. - if (process.env.COMP_CWORD === undefined || - process.env.COMP_LINE === undefined || - process.env.COMP_POINT === undefined) { - return dumpScript(cb) + if (COMP_CWORD === undefined || + COMP_LINE === undefined || + COMP_POINT === undefined) { + return dumpScript() } - console.error(process.env.COMP_CWORD) - console.error(process.env.COMP_LINE) - console.error(process.env.COMP_POINT) + // ok we're actually looking at the envs and outputting the suggestions + console.error({ COMP_CWORD, COMP_LINE, COMP_POINT }) // get the partial line and partial word, // if the point isn't at the end. // ie, tabbing at: npm foo b|ar - var w = +process.env.COMP_CWORD - var words = args.map(unescape) - var word = words[w] - var line = process.env.COMP_LINE - var point = +process.env.COMP_POINT - var partialLine = line.substr(0, point) - var partialWords = words.slice(0, w) + const w = +COMP_CWORD + const words = args.map(unescape) + console.error({ words, args, w }) + const word = words[w] + const line = COMP_LINE + const point = +COMP_POINT + const partialLine = line.substr(0, point) + const partialWords = words.slice(0, w) // figure out where in that last word the point is. - var partialWord = args[w] - var i = partialWord.length - while (partialWord.substr(0, i) !== partialLine.substr(-1 * i) && i > 0) { + const partialWordRaw = args[w] + console.error('partial word (args[%i])', w, partialWordRaw, args) + let i = partialWordRaw.length + while (partialWordRaw.substr(0, i) !== partialLine.substr(-1 * i) && i > 0) { i-- } - partialWord = unescape(partialWord.substr(0, i)) + const partialWord = unescape(partialWordRaw.substr(0, i)) partialWords.push(partialWord) - var opts = { - words: words, - w: w, - word: word, - line: line, + const opts = { + words, + w, + word, + line, lineLength: line.length, - point: point, - partialLine: partialLine, - partialWords: partialWords, - partialWord: partialWord, + point, + partialLine, + partialWords, + partialWord, raw: args } - cb = wrapCb(cb, opts) - console.error(opts) + const wrap = getWrap(opts) if (partialWords.slice(0, -1).indexOf('--') === -1) { - if (word.charAt(0) === '-') return configCompl(opts, cb) + if (word.charAt(0) === '-') { + return wrap(configCompl(opts)) + } if (words[w - 1] && words[w - 1].charAt(0) === '-' && !isFlag(words[w - 1])) { // awaiting a value for a non-bool config. // don't even try to do this for now console.error('configValueCompl') - return configValueCompl(opts, cb) + return wrap(configValueCompl(opts)) } } @@ -118,42 +152,54 @@ function completion (args, cb) { // 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. - var parsed = opts.conf = - nopt(configTypes, shorthands, partialWords.slice(0, -1), 0) + const parsed = opts.conf = + nopt(types, shorthands, partialWords.slice(0, -1), 0) // check if there's a command already. - console.error(parsed) - var cmd = parsed.argv.remain[1] - if (!cmd) return cmdCompl(opts, cb) + console.error('PARSED', parsed) + const cmd = parsed.argv.remain[1] + console.error('CMD', cmd) + if (!cmd) { + return wrap(cmdCompl(opts)) + } - Object.keys(parsed).forEach(function (k) { - npm.config.set(k, parsed[k]) - }) + Object.keys(parsed).forEach(k => npm.config.set(k, parsed[k])) // at this point, if words[1] is some kind of npm command, // then complete on it. // otherwise, do nothing - cmd = npm.commands[cmd] - if (cmd && cmd.completion) return cmd.completion(opts, cb) - - // nothing to do. - cb() + const impl = npm.commands[cmd] + if (impl && impl.completion) { + // XXX promisify all the cmd.completion functions + return await new Promise((res, rej) => { + impl.completion(opts, (er, comps) => er ? rej(er) : res(wrap(comps))) + }) + } } -function dumpScript (cb) { - var fs = require('graceful-fs') - var path = require('path') - var p = path.resolve(__dirname, 'utils/completion.sh') +const dumpScript = async () => { + const fs = require('fs') + const readFile = promisify(fs.readFile) + const { resolve } = require('path') + const p = resolve(__dirname, 'utils/completion.sh') + + const d = (await readFile(p, 'utf8')).replace(/^#!.*?\n/, '') + await new Promise((res, rej) => { + let done = false + process.stdout.write(d, () => { + if (done) { + return + } + done = true + res() + }) - // The Darwin patch below results in callbacks first for the write and then - // for the error handler, so make sure we only call our callback once. - cb = once(cb) + process.stdout.on('error', er => { + if (done) { + return + } - fs.readFile(p, 'utf8', function (er, d) { - if (er) return cb(er) - d = d.replace(/^#!.*?\n/, '') + done = true - process.stdout.write(d, function () { cb() }) - process.stdout.on('error', function (er) { // Darwin is a pain sometimes. // // This is necessary because the "source" or "." program in @@ -164,85 +210,93 @@ function dumpScript (cb) { // Really, one should not be tossing away EPIPE errors, or any // errors, so casually. But, without this, `. <(npm completion)` // can never ever work on OS X. - if (er.errno === 'EPIPE') er = null - cb(er) + if (er.errno === 'EPIPE') { + res() + } else { + rej(er) + } }) }) } -function unescape (w) { - if (w.charAt(0) === '\'') return w.replace(/^'|'$/g, '') - else return w.replace(/\\ /g, ' ') -} +const unescape = w => w.charAt(0) === '\'' ? w.replace(/^'|'$/g, '') + : w.replace(/\\ /g, ' ') -function escape (w) { - if (!w.match(/\s+/)) return w - return '\'' + w + '\'' -} +const escape = w => !/\s+/.test(w) ? w + : '\'' + w + '\'' // The command should respond with an array. Loop over that, // wrapping quotes around any that have spaces, and writing -// them to stdout. Use console.log, not the outfd config. +// them to stdout. // If any of the items are arrays, then join them with a space. // Ie, returning ['a', 'b c', ['d', 'e']] would allow it to expand // to: 'a', 'b c', or 'd' 'e' -function wrapCb (cb, opts) { - return function (er, compls) { - if (!Array.isArray(compls)) compls = compls ? [compls] : [] - compls = compls.map(function (c) { - if (Array.isArray(c)) c = c.map(escape).join(' ') - else c = escape(c) - return c - }) +const getWrap = opts => compls => { + console.error('WRAP', opts, compls) - if (opts.partialWord) { - compls = compls.filter(function (c) { - return c.indexOf(opts.partialWord) === 0 - }) - } + if (!Array.isArray(compls)) { + compls = compls ? [compls] : [] + } - console.error([er && er.stack, compls, opts.partialWord]) - if (er || compls.length === 0) return cb(er) + compls = compls.map(c => + Array.isArray(c) ? c.map(escape).join(' ') : escape(c)) + if (opts.partialWord) { + console.error('HAS PARTIAL WORD', opts.partialWord, compls) + compls = compls.filter(c => c.startsWith(opts.partialWord)) + } + + console.error(compls, opts.partialWord) + if (compls.length > 0) { output(compls.join('\n')) - cb() } } // the current word has a dash. Return the config names, // with the same number of dashes as the current word has. -function configCompl (opts, cb) { - var word = opts.word - var split = word.match(/^(-+)((?:no-)*)(.*)$/) - var dashes = split[1] - var no = split[2] - var flags = configNames.filter(isFlag) +const configCompl = opts => { + const word = opts.word + const split = word.match(/^(-+)((?:no-)*)(.*)$/) + const dashes = split[1] + const no = split[2] + const flags = configNames.filter(isFlag) console.error(flags) - - return cb(null, allConfs.map(function (c) { - return dashes + c - }).concat(flags.map(function (f) { - return dashes + (no || 'no-') + f - }))) + return allConfs.map(c => dashes + c) + .concat(flags.map(f => dashes + (no || 'no-') + f)) } // expand with the valid values of various config values. // not yet implemented. -function configValueCompl (opts, cb) { - console.error('configValue', opts) - return cb(null, []) -} +const configValueCompl = opts => [] // check if the thing is a flag or not. -function isFlag (word) { +const isFlag = word => { // shorthands never take args. - var split = word.match(/^(-*)((?:no-)+)?(.*)$/) - var no = split[2] - var conf = split[3] - return no || configTypes[conf] === Boolean || shorthands[conf] + const split = word.match(/^(-*)((?:no-)+)?(.*)$/) + const no = split[2] + const conf = split[3] + const type = types[conf] + return no || + type === Boolean || + (Array.isArray(type) && type.includes(Boolean)) || + shorthands[conf] } // complete against the npm commands -function cmdCompl (opts, cb) { - return cb(null, npm.fullList) +// if they all resolve to the same thing, just return the thing it already is +const cmdCompl = opts => { + console.error('CMD COMPL', opts.partialWord) + const matches = fullList.filter(c => c.startsWith(opts.partialWord)) + console.error('MATCHES', matches) + if (!matches.length) { + return matches + } + const derefs = new Set([...matches.map(c => deref(c))]) + if (derefs.size === 1) { + console.error('ONLY ONE MATCH', derefs) + return [...derefs] + } + return fullList } + +module.exports = Object.assign(cmd, { completion, usage }) diff --git a/deps/npm/lib/config.js b/deps/npm/lib/config.js index 5f9819879be23d..fd59152aad9e8c 100644 --- a/deps/npm/lib/config.js +++ b/deps/npm/lib/config.js @@ -1,23 +1,19 @@ -/* eslint-disable standard/no-callback-literal */ -module.exports = config - -var log = require('npmlog') -var npm = require('./npm.js') -var npmconf = require('./config/core.js') -var fs = require('graceful-fs') -var writeFileAtomic = require('write-file-atomic') -var types = npmconf.defs.types -var ini = require('ini') -var editor = require('editor') -var os = require('os') -var path = require('path') -var mkdirp = require('gentle-fs').mkdir -var umask = require('./utils/umask') -var usage = require('./utils/usage') -var output = require('./utils/output') -var noProgressTillDone = require('./utils/no-progress-while-running').tillDone - -config.usage = usage( +const npm = require('./npm.js') +const { defaults, types } = require('./utils/config.js') +const usageUtil = require('./utils/usage.js') +const output = require('./utils/output.js') + +const editor = require('editor') +const mkdirp = require('mkdirp-infer-owner') +const { dirname } = require('path') +const { promisify } = require('util') +const fs = require('fs') +const readFile = promisify(fs.readFile) +const writeFile = promisify(fs.writeFile) +const { EOL } = require('os') +const ini = require('ini') + +const usage = usageUtil( 'config', 'npm config set ' + '\nnpm config get []' + @@ -27,16 +23,19 @@ config.usage = usage( '\nnpm set ' + '\nnpm get []' ) -config.completion = function (opts, cb) { - var argv = opts.conf.argv.remain + +const cmd = (args, cb) => config(args).then(() => cb()).catch(cb) + +const completion = (opts, cb) => { + const argv = opts.conf.argv.remain if (argv[1] !== 'config') argv.unshift('config') if (argv.length === 2) { - var cmds = ['get', 'set', 'delete', 'ls', 'rm', 'edit'] + const cmds = ['get', 'set', 'delete', 'ls', 'rm', 'edit'] if (opts.partialWord !== 'l') cmds.push('list') return cb(null, cmds) } - var action = argv[2] + const action = argv[2] switch (action) { case 'set': // todo: complete with valid values, if possible. @@ -56,231 +55,180 @@ config.completion = function (opts, cb) { } } -// npm config set key value -// npm config get key -// npm config list -function config (args, cb) { - var action = args.shift() - switch (action) { - case 'set': - return set(args[0], args[1], cb) - case 'get': - return get(args[0], cb) - case 'delete': - case 'rm': - case 'del': - return del(args[0], cb) - case 'list': - case 'ls': - return npm.config.get('json') ? listJson(cb) : list(cb) - case 'edit': - return edit(cb) - default: - return unknown(action, cb) +const config = async ([action, key, val]) => { + npm.log.disableProgress() + try { + switch (action) { + case 'set': + await set(key, val) + break + case 'get': + await get(key) + break + case 'delete': + case 'rm': + case 'del': + await del(key) + break + case 'list': + case 'ls': + await (npm.config.get('json') ? listJson() : list()) + break + case 'edit': + await edit() + break + default: + throw usage + } + } finally { + npm.log.enableProgress() } } -function edit (cb) { - var e = npm.config.get('editor') - var which = npm.config.get('global') ? 'global' : 'user' - var f = npm.config.get(which + 'config') - if (!e) return cb(new Error('No EDITOR config or environ set.')) - npm.config.save(which, function (er) { - if (er) return cb(er) - fs.readFile(f, 'utf8', function (er, data) { - if (er) data = '' - data = [ - ';;;;', - '; npm ' + (npm.config.get('global') - ? 'globalconfig' : 'userconfig') + ' file', - '; this is a simple ini-formatted file', - '; lines that start with semi-colons are comments.', - '; read `npm help config` for help on the various options', - ';;;;', - '', - data - ].concat([ - ';;;;', - '; all options with default values', - ';;;;' - ]).concat(Object.keys(npmconf.defaults).reduce(function (arr, key) { - var obj = {} - obj[key] = npmconf.defaults[key] - if (key === 'logstream') return arr - return arr.concat( - ini.stringify(obj) - .replace(/\n$/m, '') - .replace(/^/g, '; ') - .replace(/\n/g, '\n; ') - .split('\n')) - }, [])) - .concat(['']) - .join(os.EOL) - mkdirp(path.dirname(f), function (er) { - if (er) return cb(er) - writeFileAtomic( - f, - data, - function (er) { - if (er) return cb(er) - editor(f, { editor: e }, noProgressTillDone(cb)) - } - ) - }) - }) - }) -} - -function del (key, cb) { - if (!key) return cb(new Error('no key provided')) - var where = npm.config.get('global') ? 'global' : 'user' - npm.config.del(key, where) - npm.config.save(where, cb) -} - -function set (key, val, cb) { +const set = async (key, val) => { if (key === undefined) { - return unknown('', cb) + throw usage } + if (val === undefined) { if (key.indexOf('=') !== -1) { - var k = key.split('=') + const k = key.split('=') key = k.shift() val = k.join('=') } else { val = '' } } + key = key.trim() val = val.trim() - log.info('config', 'set %j %j', key, val) - var where = npm.config.get('global') ? 'global' : 'user' - if (key.match(/umask/)) val = umask.fromString(val) + npm.log.info('config', 'set %j %j', key, val) + const where = npm.config.get('global') ? 'global' : 'user' + const validBefore = npm.config.data.get(where).valid + console.error('validBefore?', validBefore) npm.config.set(key, val, where) - npm.config.save(where, cb) -} - -function get (key, cb) { - if (!key) return list(cb) - if (!publicVar(key)) { - return cb(new Error('---sekretz---')) + if (!npm.config.validate(where)) { + npm.log.warn('config', 'omitting invalid config values') } - var val = npm.config.get(key) - if (key.match(/umask/)) val = umask.toString(val) - output(val) - cb() -} - -function sort (a, b) { - return a > b ? 1 : -1 + await npm.config.save(where) } -function publicVar (k) { - return !(k.charAt(0) === '_' || k.indexOf(':_') !== -1) -} - -function getKeys (data) { - return Object.keys(data).filter(publicVar).sort(sort) -} - -function listJson (cb) { - const publicConf = npm.config.keys.reduce((publicConf, k) => { - var value = npm.config.get(k) - - if (publicVar(k) && - // argv is not really config, it's command config - k !== 'argv' && - // logstream is a Stream, and would otherwise produce circular refs - k !== 'logstream') publicConf[k] = value +const get = async key => { + if (!key) { + return list() + } - return publicConf - }, {}) + if (!publicVar(key)) { + throw `The ${key} option is protected, and cannot be retrieved in this way` + } - output(JSON.stringify(publicConf, null, 2)) - return cb() + output(npm.config.get(key)) } -function listFromSource (title, conf, long) { - var confKeys = getKeys(conf) - var msg = '' - - if (confKeys.length) { - msg += '; ' + title + '\n' - confKeys.forEach(function (k) { - var val = JSON.stringify(conf[k]) - if (conf[k] !== npm.config.get(k)) { - if (!long) return - msg += '; ' + k + ' = ' + val + ' (overridden)\n' - } else msg += k + ' = ' + val + '\n' - }) - msg += '\n' +const del = async key => { + if (!key) { + throw usage } - return msg + const where = npm.config.get('global') ? 'global' : 'user' + npm.config.delete(key, where) + await npm.config.save(where) } -function list (cb) { - var msg = '' - var long = npm.config.get('long') - - var cli = npm.config.sources.cli.data - var cliKeys = getKeys(cli) - if (cliKeys.length) { - msg += '; cli configs\n' - cliKeys.forEach(function (k) { - if (cli[k] && typeof cli[k] === 'object') return - if (k === 'argv') return - msg += k + ' = ' + JSON.stringify(cli[k]) + '\n' - }) - msg += '\n' +const edit = async () => { + const { editor: e, global } = npm.flatOptions + if (!e) { + throw new Error('No `editor` config or EDITOR envionment variable set') } - // env configs - msg += listFromSource('environment configs', npm.config.sources.env.data, long) - - // project config file - var project = npm.config.sources.project - msg += listFromSource('project config ' + project.path, project.data, long) - - // user config file - msg += listFromSource('userconfig ' + npm.config.get('userconfig'), npm.config.sources.user.data, long) + const where = global ? 'global' : 'user' + const file = npm.config.data.get(where).source + + // save first, just to make sure it's synced up + // this also removes all the comments from the last time we edited it. + await npm.config.save(where) + const data = (await readFile(file, 'utf8').catch(() => '')).replace(/\r\n/g, '\n') + const defData = Object.entries(defaults).reduce((str, [key, val]) => { + const obj = { [key]: val } + const i = ini.stringify(obj) + .replace(/\n$/m, '') + .replace(/^/g, '; ') + .replace(/\n/g, '\n; ') + .split('\n') + return str + '\n' + i + }, '') + + const tmpData = `;;;; +; npm ${where}config file: ${file} +; this is a simple ini-formatted file +; lines that start with semi-colons are comments +; run \`npm help 7 config\` for documentation of the various options +; +; Configs like \`@scope:registry\` map a scope to a given registry url. +; +; Configs like \`///:_authToken\` are auth that is restricted +; to the registry host specified. + +${data.split('\n').sort((a, b) => a.localeCompare(b)).join('\n').trim()} + +;;;; +; all available options shown below with default values +;;;; + +${defData} +`.split('\n').join(EOL) + await mkdirp(dirname(file)) + await writeFile(file, tmpData, 'utf8') + await new Promise((res, rej) => { + editor(file, { editor: e }, (er) => er ? rej(er) : res()) + }) +} - // global config file - msg += listFromSource('globalconfig ' + npm.config.get('globalconfig'), npm.config.sources.global.data, long) +const publicVar = k => !/^(\/\/[^:]+:)?_/.test(k) - // builtin config file - var builtin = npm.config.sources.builtin || {} - if (builtin && builtin.data) { - msg += listFromSource('builtin config ' + builtin.path, builtin.data, long) +const list = async () => { + const msg = [] + const { long } = npm.flatOptions + for (const [where, { data, source }] of npm.config.data.entries()) { + if (where === 'default' && !long) { + continue + } + const keys = Object.keys(data).sort((a, b) => a.localeCompare(b)) + if (!keys.length) { + continue + } + msg.push(`; "${where}" config from ${source}`, '') + for (const k of keys) { + const v = publicVar(k) ? JSON.stringify(data[k]) : '(protected)' + const src = npm.config.find(k) + const overridden = src !== where + msg.push((overridden ? '; ' : '') + + `${k} = ${v} ${overridden ? `; overridden by ${src}` : ''}`) + } + msg.push('') } - // only show defaults if --long if (!long) { - msg += '; node bin location = ' + process.execPath + '\n' + - '; cwd = ' + process.cwd() + '\n' + - '; HOME = ' + process.env.HOME + '\n' + - '; "npm config ls -l" to show all defaults.\n' - - output(msg) - return cb() + msg.push( + `; node bin location = ${process.execPath}`, + `; cwd = ${process.cwd()}`, + `; HOME = ${process.env.HOME}`, + '; Run `npm config ls -l` to show all defaults.' + ) } - var defaults = npmconf.defaults - var defKeys = getKeys(defaults) - msg += '; default values\n' - defKeys.forEach(function (k) { - if (defaults[k] && typeof defaults[k] === 'object') return - var val = JSON.stringify(defaults[k]) - if (defaults[k] !== npm.config.get(k)) { - msg += '; ' + k + ' = ' + val + ' (overridden)\n' - } else msg += k + ' = ' + val + '\n' - }) - msg += '\n' - - output(msg) - return cb() + output(msg.join('\n').trim()) } -function unknown (action, cb) { - cb('Usage:\n' + config.usage) +const listJson = async () => { + const publicConf = {} + for (const key in npm.config.list[0]) { + if (!publicVar(key)) { + continue + } + publicConf[key] = npm.config.get(key) + } + output(JSON.stringify(publicConf, null, 2)) } + +module.exports = Object.assign(cmd, { usage, completion }) diff --git a/deps/npm/lib/config/bin-links.js b/deps/npm/lib/config/bin-links.js deleted file mode 100644 index 1ee90cc35e92f5..00000000000000 --- a/deps/npm/lib/config/bin-links.js +++ /dev/null @@ -1,32 +0,0 @@ -'use strict' - -const npm = require('../npm.js') -var packageId = require('../utils/package-id.js') -const log = require('npmlog') - -module.exports = binLinksOpts - -function binLinksOpts (pkg) { - return { - ignoreScripts: npm.config.get('ignore-scripts'), - force: npm.config.get('force'), - globalBin: npm.globalBin, - globalDir: npm.globalDir, - json: npm.config.get('json'), - log: log, - name: 'npm', - parseable: npm.config.get('parseable'), - pkgId: packageId(pkg), - prefix: npm.config.get('prefix'), - prefixes: [ - npm.prefix, - npm.globalPrefix, - npm.dir, - npm.root, - npm.globalDir, - npm.bin, - npm.globalBin - ], - umask: npm.config.get('umask') - } -} diff --git a/deps/npm/lib/config/clear-credentials-by-uri.js b/deps/npm/lib/config/clear-credentials-by-uri.js deleted file mode 100644 index 13c356605f0210..00000000000000 --- a/deps/npm/lib/config/clear-credentials-by-uri.js +++ /dev/null @@ -1,16 +0,0 @@ -var assert = require('assert') - -var toNerfDart = require('./nerf-dart.js') - -module.exports = clearCredentialsByURI - -function clearCredentialsByURI (uri) { - assert(uri && typeof uri === 'string', 'registry URL is required') - - var nerfed = toNerfDart(uri) - - this.del(nerfed + ':_authToken', 'user') - this.del(nerfed + ':_password', 'user') - this.del(nerfed + ':username', 'user') - this.del(nerfed + ':email', 'user') -} diff --git a/deps/npm/lib/config/cmd-list.js b/deps/npm/lib/config/cmd-list.js deleted file mode 100644 index d9d0d85b7d520f..00000000000000 --- a/deps/npm/lib/config/cmd-list.js +++ /dev/null @@ -1,136 +0,0 @@ -// short names for common things -var shorthands = { - 'un': 'uninstall', - 'rb': 'rebuild', - 'list': 'ls', - 'ln': 'link', - 'create': 'init', - 'i': 'install', - 'it': 'install-test', - 'cit': 'install-ci-test', - 'up': 'update', - 'c': 'config', - 's': 'search', - 'se': 'search', - 'unstar': 'star', // same function - 'tst': 'test', - 't': 'test', - 'ddp': 'dedupe', - 'v': 'view', - 'run': 'run-script', - 'clean-install': 'ci', - 'clean-install-test': 'cit' -} - -var affordances = { - 'la': 'ls', - 'll': 'ls', - 'verison': 'version', - 'ic': 'ci', - 'innit': 'init', - 'isntall': 'install', - 'install-clean': 'ci', - 'isntall-clean': 'ci', - 'dist-tags': 'dist-tag', - 'apihelp': 'help', - 'find-dupes': 'dedupe', - 'upgrade': 'update', - 'udpate': 'update', - 'login': 'adduser', - 'add-user': 'adduser', - 'author': 'owner', - 'home': 'docs', - 'issues': 'bugs', - 'info': 'view', - 'show': 'view', - 'find': 'search', - 'add': 'install', - 'unlink': 'uninstall', - 'remove': 'uninstall', - 'rm': 'uninstall', - 'r': 'uninstall', - 'rum': 'run-script', - 'sit': 'cit', - 'urn': 'run-script', - 'ogr': 'org' -} - -// these are filenames in . -var cmdList = [ - 'ci', - 'install-ci-test', - 'install', - 'install-test', - 'uninstall', - 'cache', - 'config', - 'set', - 'get', - 'update', - 'outdated', - 'prune', - 'pack', - 'dedupe', - 'hook', - - 'rebuild', - 'link', - - 'publish', - 'star', - 'stars', - 'adduser', - 'login', // This is an alias for `adduser` but it can be confusing - 'logout', - 'unpublish', - 'owner', - 'access', - 'team', - 'deprecate', - 'shrinkwrap', - 'token', - 'profile', - 'audit', - 'fund', - 'org', - - 'help', - 'help-search', - 'ls', - 'search', - 'view', - 'init', - 'version', - 'edit', - 'explore', - 'docs', - 'repo', - 'bugs', - 'root', - 'prefix', - 'bin', - 'whoami', - 'dist-tag', - 'ping', - - 'test', - 'stop', - 'start', - 'restart', - 'run-script', - 'completion', - 'doctor' -] - -var plumbing = [ - 'build', - 'unbuild', - 'xmas', - 'substack', - 'visnup' -] -module.exports.aliases = Object.assign({}, shorthands, affordances) -module.exports.shorthands = shorthands -module.exports.affordances = affordances -module.exports.cmdList = cmdList -module.exports.plumbing = plumbing diff --git a/deps/npm/lib/config/core.js b/deps/npm/lib/config/core.js deleted file mode 100644 index 36420b3450163d..00000000000000 --- a/deps/npm/lib/config/core.js +++ /dev/null @@ -1,429 +0,0 @@ -var CC = require('config-chain').ConfigChain -var inherits = require('inherits') -var configDefs = require('./defaults.js') -var types = configDefs.types -var once = require('once') -var fs = require('fs') -var path = require('path') -var nopt = require('nopt') -var ini = require('ini') -var Umask = configDefs.Umask -var mkdirp = require('gentle-fs').mkdir -var umask = require('../utils/umask') -var isWindows = require('../utils/is-windows.js') - -exports.load = load -exports.Conf = Conf -exports.loaded = false -exports.rootConf = null -exports.usingBuiltin = false -exports.defs = configDefs - -Object.defineProperty(exports, 'defaults', { get: function () { - return configDefs.defaults -}, -enumerable: true }) - -Object.defineProperty(exports, 'types', { get: function () { - return configDefs.types -}, -enumerable: true }) - -exports.validate = validate - -var myUid = process.getuid && process.getuid() -var myGid = process.getgid && process.getgid() - -var loading = false -var loadCbs = [] -function load () { - var cli, builtin, cb - for (var i = 0; i < arguments.length; i++) { - switch (typeof arguments[i]) { - case 'string': builtin = arguments[i]; break - case 'object': cli = arguments[i]; break - case 'function': cb = arguments[i]; break - } - } - - if (!cb) cb = function () {} - - if (exports.loaded) { - var ret = exports.loaded - if (cli) { - ret = new Conf(ret) - ret.unshift(cli) - } - return process.nextTick(cb.bind(null, null, ret)) - } - - // either a fresh object, or a clone of the passed in obj - if (!cli) { - cli = {} - } else { - cli = Object.keys(cli).reduce(function (c, k) { - c[k] = cli[k] - return c - }, {}) - } - - loadCbs.push(cb) - if (loading) return - - loading = true - - cb = once(function (er, conf) { - if (!er) { - exports.loaded = conf - loading = false - } - loadCbs.forEach(function (fn) { - fn(er, conf) - }) - loadCbs.length = 0 - }) - - // check for a builtin if provided. - exports.usingBuiltin = !!builtin - var rc = exports.rootConf = new Conf() - if (builtin) { - rc.addFile(builtin, 'builtin') - } else { - rc.add({}, 'builtin') - } - - rc.on('load', function () { - load_(builtin, rc, cli, cb) - }) - rc.on('error', cb) -} - -function load_ (builtin, rc, cli, cb) { - var defaults = configDefs.defaults - var conf = new Conf(rc) - - conf.usingBuiltin = !!builtin - conf.add(cli, 'cli') - conf.addEnv() - - conf.loadPrefix(function (er) { - if (er) return cb(er) - - // If you're doing `npm --userconfig=~/foo.npmrc` then you'd expect - // that ~/.npmrc won't override the stuff in ~/foo.npmrc (or, indeed - // be used at all). - // - // However, if the cwd is ~, then ~/.npmrc is the home for the project - // config, and will override the userconfig. - // - // If you're not setting the userconfig explicitly, then it will be loaded - // twice, which is harmless but excessive. If you *are* setting the - // userconfig explicitly then it will override your explicit intent, and - // that IS harmful and unexpected. - // - // Solution: Do not load project config file that is the same as either - // the default or resolved userconfig value. npm will log a "verbose" - // message about this when it happens, but it is a rare enough edge case - // that we don't have to be super concerned about it. - var projectConf = path.resolve(conf.localPrefix, '.npmrc') - var defaultUserConfig = rc.get('userconfig') - var resolvedUserConfig = conf.get('userconfig') - if (!conf.get('global') && - projectConf !== defaultUserConfig && - projectConf !== resolvedUserConfig) { - conf.addFile(projectConf, 'project') - conf.once('load', afterPrefix) - } else { - conf.add({}, 'project') - afterPrefix() - } - }) - - function afterPrefix () { - conf.addFile(conf.get('userconfig'), 'user') - conf.once('error', cb) - conf.once('load', afterUser) - } - - function afterUser () { - // globalconfig and globalignorefile defaults - // need to respond to the 'prefix' setting up to this point. - // Eg, `npm config get globalconfig --prefix ~/local` should - // return `~/local/etc/npmrc` - // annoying humans and their expectations! - if (conf.get('prefix')) { - var etc = path.resolve(conf.get('prefix'), 'etc') - defaults.globalconfig = path.resolve(etc, 'npmrc') - defaults.globalignorefile = path.resolve(etc, 'npmignore') - } - - conf.addFile(conf.get('globalconfig'), 'global') - - // move the builtin into the conf stack now. - conf.root = defaults - conf.add(rc.shift(), 'builtin') - conf.once('load', function () { - conf.loadExtras(afterExtras) - }) - } - - function afterExtras (er) { - if (er) return cb(er) - - // warn about invalid bits. - validate(conf) - - var cafile = conf.get('cafile') - - if (cafile) { - return conf.loadCAFile(cafile, finalize) - } - - finalize() - } - - function finalize (er) { - if (er) { - return cb(er) - } - - exports.loaded = conf - cb(er, conf) - } -} - -// Basically the same as CC, but: -// 1. Always ini -// 2. Parses environment variable names in field values -// 3. Field values that start with ~/ are replaced with process.env.HOME -// 4. Can inherit from another Conf object, using it as the base. -inherits(Conf, CC) -function Conf (base) { - if (!(this instanceof Conf)) return new Conf(base) - - CC.call(this) - - if (base) { - if (base instanceof Conf) { - this.root = base.list[0] || base.root - } else { - this.root = base - } - } else { - this.root = configDefs.defaults - } -} - -Conf.prototype.loadPrefix = require('./load-prefix.js') -Conf.prototype.loadCAFile = require('./load-cafile.js') -Conf.prototype.setUser = require('./set-user.js') -Conf.prototype.getCredentialsByURI = require('./get-credentials-by-uri.js') -Conf.prototype.setCredentialsByURI = require('./set-credentials-by-uri.js') -Conf.prototype.clearCredentialsByURI = require('./clear-credentials-by-uri.js') - -Conf.prototype.loadExtras = function (cb) { - this.setUser(function (er) { - if (er) return cb(er) - // Without prefix, nothing will ever work - mkdirp(this.prefix, cb) - }.bind(this)) -} - -Conf.prototype.save = function (where, cb) { - var target = this.sources[where] - if (!target || !(target.path || target.source) || !target.data) { - var er - if (where !== 'builtin') er = new Error('bad save target: ' + where) - if (cb) { - process.nextTick(cb.bind(null, er)) - return this - } - return this.emit('error', er) - } - - if (target.source) { - var pref = target.prefix || '' - Object.keys(target.data).forEach(function (k) { - target.source[pref + k] = target.data[k] - }) - if (cb) process.nextTick(cb) - return this - } - - var data = ini.stringify(target.data) - - var then = function then (er) { - if (er) return done(er) - - fs.chmod(target.path, mode, done) - } - - var done = function done (er) { - if (er) { - if (cb) return cb(er) - else return this.emit('error', er) - } - this._saving-- - if (this._saving === 0) { - if (cb) cb() - this.emit('save') - } - } - - then = then.bind(this) - done = done.bind(this) - this._saving++ - - var mode = where === 'user' ? '0600' : '0666' - if (!data.trim()) { - fs.unlink(target.path, function () { - // ignore the possible error (e.g. the file doesn't exist) - done(null) - }) - } else { - // we don't have to use inferOwner here, because gentle-fs will - // mkdir with the correctly inferred ownership. Just preserve it. - const dir = path.dirname(target.path) - mkdirp(dir, function (er) { - if (er) return then(er) - fs.stat(dir, (er, st) => { - if (er) return then(er) - fs.writeFile(target.path, data, 'utf8', function (er) { - if (er) return then(er) - if (myUid === 0 && (myUid !== st.uid || myGid !== st.gid)) { - fs.chown(target.path, st.uid, st.gid, then) - } else { - then() - } - }) - }) - }) - } - - return this -} - -Conf.prototype.addFile = function (file, name) { - name = name || file - var marker = { __source__: name } - this.sources[name] = { path: file, type: 'ini' } - this.push(marker) - this._await() - fs.readFile(file, 'utf8', function (er, data) { - // just ignore missing files. - if (er) return this.add({}, marker) - - this.addString(data, file, 'ini', marker) - }.bind(this)) - return this -} - -// always ini files. -Conf.prototype.parse = function (content, file) { - return CC.prototype.parse.call(this, content, file, 'ini') -} - -Conf.prototype.add = function (data, marker) { - try { - Object.keys(data).forEach(function (k) { - const newKey = envReplace(k) - const newField = parseField(data[k], newKey) - delete data[k] - data[newKey] = newField - }) - } catch (e) { - this.emit('error', e) - return this - } - return CC.prototype.add.call(this, data, marker) -} - -Conf.prototype.addEnv = function (env) { - env = env || process.env - var conf = {} - Object.keys(env) - .filter(function (k) { return k.match(/^npm_config_/i) }) - .forEach(function (k) { - if (!env[k]) return - - // leave first char untouched, even if - // it is a '_' - convert all other to '-' - var p = k.toLowerCase() - .replace(/^npm_config_/, '') - .replace(/(?!^)_/g, '-') - conf[p] = env[k] - }) - return CC.prototype.addEnv.call(this, '', conf, 'env') -} - -function parseField (f, k) { - if (typeof f !== 'string' && !(f instanceof String)) return f - - // type can be an array or single thing. - var typeList = [].concat(types[k]) - var isPath = typeList.indexOf(path) !== -1 - var isBool = typeList.indexOf(Boolean) !== -1 - var isString = typeList.indexOf(String) !== -1 - var isUmask = typeList.indexOf(Umask) !== -1 - var isNumber = typeList.indexOf(Number) !== -1 - - f = ('' + f).trim() - - if (f.match(/^".*"$/)) { - try { - f = JSON.parse(f) - } catch (e) { - throw new Error('Failed parsing JSON config key ' + k + ': ' + f) - } - } - - if (isBool && !isString && f === '') return true - - switch (f) { - case 'true': return true - case 'false': return false - case 'null': return null - case 'undefined': return undefined - } - - f = envReplace(f) - - if (isPath) { - var homePattern = isWindows ? /^~(\/|\\)/ : /^~\// - if (f.match(homePattern) && process.env.HOME) { - f = path.resolve(process.env.HOME, f.substr(2)) - } - f = path.resolve(f) - } - - if (isUmask) f = umask.fromString(f) - - if (isNumber && !isNaN(f)) f = +f - - return f -} - -function envReplace (f) { - if (typeof f !== 'string' || !f) return f - - // replace any ${ENV} values with the appropriate environ. - var envExpr = /(\\*)\$\{([^}]+)\}/g - return f.replace(envExpr, function (orig, esc, name) { - esc = esc.length && esc.length % 2 - if (esc) return orig - if (undefined === process.env[name]) { - throw new Error('Failed to replace env in config: ' + orig) - } - - return process.env[name] - }) -} - -function validate (cl) { - // warn about invalid configs at every level. - cl.list.forEach(function (conf) { - nopt.clean(conf, configDefs.types) - }) - - nopt.clean(cl.root, configDefs.types) -} diff --git a/deps/npm/lib/config/defaults.js b/deps/npm/lib/config/defaults.js deleted file mode 100644 index e07da3aaf97f4b..00000000000000 --- a/deps/npm/lib/config/defaults.js +++ /dev/null @@ -1,442 +0,0 @@ -// defaults, types, and shorthands. - -var path = require('path') -var url = require('url') -var Stream = require('stream').Stream -var semver = require('semver') -var stableFamily = semver.parse(process.version) -var nopt = require('nopt') -var os = require('os') -var osenv = require('osenv') -var umask = require('../utils/umask') -var hasUnicode = require('has-unicode') - -var log -try { - log = require('npmlog') -} catch (er) { - var util = require('util') - log = { warn: function (m) { - console.warn(m + ' ' + util.format.apply(util, [].slice.call(arguments, 1))) - } } -} - -exports.Umask = Umask -function Umask () {} -function validateUmask (data, k, val) { - return umask.validate(data, k, val) -} - -function validateSemver (data, k, val) { - if (!semver.valid(val)) return false - data[k] = semver.valid(val) -} - -function validateStream (data, k, val) { - if (!(val instanceof Stream)) return false - data[k] = val -} - -nopt.typeDefs.semver = { type: semver, validate: validateSemver } -nopt.typeDefs.Stream = { type: Stream, validate: validateStream } -nopt.typeDefs.Umask = { type: Umask, validate: validateUmask } - -nopt.invalidHandler = function (k, val, type) { - log.warn('invalid config', k + '=' + JSON.stringify(val)) - - if (Array.isArray(type)) { - if (type.indexOf(url) !== -1) type = url - else if (type.indexOf(path) !== -1) type = path - } - - switch (type) { - case Umask: - log.warn('invalid config', 'Must be umask, octal number in range 0000..0777') - break - case url: - log.warn('invalid config', "Must be a full url with 'http://'") - break - case path: - log.warn('invalid config', 'Must be a valid filesystem path') - break - case Number: - log.warn('invalid config', 'Must be a numeric value') - break - case Stream: - log.warn('invalid config', 'Must be an instance of the Stream class') - break - } -} - -if (!stableFamily || (+stableFamily.minor % 2)) stableFamily = null -else stableFamily = stableFamily.major + '.' + stableFamily.minor - -var defaults - -var temp = osenv.tmpdir() -var home = osenv.home() - -var uidOrPid = process.getuid ? process.getuid() : process.pid - -if (home) process.env.HOME = home -else home = path.resolve(temp, 'npm-' + uidOrPid) - -var cacheExtra = process.platform === 'win32' ? 'npm-cache' : '.npm' -var cacheRoot = (process.platform === 'win32' && process.env.APPDATA) || home -var cache = path.resolve(cacheRoot, cacheExtra) - -var globalPrefix -Object.defineProperty(exports, 'defaults', {get: function () { - if (defaults) return defaults - - if (process.env.PREFIX) { - globalPrefix = process.env.PREFIX - } else if (process.platform === 'win32') { - // c:\node\node.exe --> prefix=c:\node\ - globalPrefix = path.dirname(process.execPath) - } else { - // /usr/local/bin/node --> prefix=/usr/local - globalPrefix = path.dirname(path.dirname(process.execPath)) - - // destdir only is respected on Unix - if (process.env.DESTDIR) { - globalPrefix = path.join(process.env.DESTDIR, globalPrefix) - } - } - - defaults = { - access: null, - 'allow-same-version': false, - 'always-auth': false, - also: null, - audit: true, - 'audit-level': 'low', - 'auth-type': 'legacy', - - 'before': null, - 'bin-links': true, - browser: null, - - ca: null, - cafile: null, - - cache: cache, - - 'cache-lock-stale': 60000, - 'cache-lock-retries': 10, - 'cache-lock-wait': 10000, - - 'cache-max': Infinity, - 'cache-min': 10, - - cert: null, - - cidr: null, - - color: process.env.NO_COLOR == null, - depth: Infinity, - description: true, - dev: false, - 'dry-run': false, - editor: osenv.editor(), - 'engine-strict': false, - force: false, - 'format-package-lock': true, - - fund: true, - - 'fetch-retries': 2, - 'fetch-retry-factor': 10, - 'fetch-retry-mintimeout': 10000, - 'fetch-retry-maxtimeout': 60000, - - git: 'git', - 'git-tag-version': true, - 'commit-hooks': true, - - global: false, - globalconfig: path.resolve(globalPrefix, 'etc', 'npmrc'), - 'global-style': false, - group: process.platform === 'win32' ? 0 - : process.env.SUDO_GID || (process.getgid && process.getgid()), - 'ham-it-up': false, - heading: 'npm', - 'if-present': false, - 'ignore-prepublish': false, - 'ignore-scripts': false, - 'init-module': path.resolve(home, '.npm-init.js'), - 'init-author-name': '', - 'init-author-email': '', - 'init-author-url': '', - 'init-version': '1.0.0', - 'init-license': 'ISC', - json: false, - key: null, - 'legacy-bundling': false, - link: false, - 'local-address': undefined, - loglevel: 'notice', - logstream: process.stderr, - 'logs-max': 10, - long: false, - maxsockets: 50, - message: '%s', - 'metrics-registry': null, - 'node-options': null, - 'node-version': process.version, - 'offline': false, - 'onload-script': false, - only: null, - optional: true, - otp: null, - 'package-lock': true, - 'package-lock-only': false, - parseable: false, - 'prefer-offline': false, - 'prefer-online': false, - prefix: globalPrefix, - preid: '', - production: process.env.NODE_ENV === 'production', - 'progress': !process.env.TRAVIS && !process.env.CI, - proxy: null, - 'https-proxy': null, - 'noproxy': null, - 'user-agent': 'npm/{npm-version} ' + - 'node/{node-version} ' + - '{platform} ' + - '{arch} ' + - '{ci}', - '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', - searchopts: '', - searchexclude: null, - searchlimit: 20, - searchstaleness: 15 * 60, - 'send-metrics': false, - shell: osenv.shell(), - shrinkwrap: true, - 'sign-git-commit': false, - 'sign-git-tag': false, - 'sso-poll-frequency': 500, - 'sso-type': 'oauth', - 'strict-ssl': true, - tag: 'latest', - 'tag-version-prefix': 'v', - timing: false, - tmp: temp, - unicode: hasUnicode(), - 'unsafe-perm': process.platform === 'win32' || - process.platform === 'cygwin' || - !(process.getuid && process.setuid && - process.getgid && process.setgid) || - process.getuid() !== 0, - 'update-notifier': true, - usage: false, - user: (process.platform === 'win32' || os.type() === 'OS400') ? 0 : 'nobody', - userconfig: path.resolve(home, '.npmrc'), - umask: process.umask ? process.umask() : umask.fromString('022'), - version: false, - versions: false, - viewer: process.platform === 'win32' ? 'browser' : 'man', - - _exit: true - } - - return defaults -}}) - -exports.types = { - access: [null, 'restricted', 'public'], - 'allow-same-version': Boolean, - 'always-auth': Boolean, - also: [null, 'dev', 'development'], - audit: Boolean, - 'audit-level': ['low', 'moderate', 'high', 'critical'], - 'auth-type': ['legacy', 'sso', 'saml', 'oauth'], - 'before': [null, Date], - 'bin-links': Boolean, - browser: [null, String], - ca: [null, String, Array], - cafile: path, - cache: path, - 'cache-lock-stale': Number, - 'cache-lock-retries': Number, - 'cache-lock-wait': Number, - 'cache-max': Number, - 'cache-min': Number, - cert: [null, String], - cidr: [null, String, Array], - color: ['always', Boolean], - depth: Number, - description: Boolean, - dev: Boolean, - 'dry-run': Boolean, - editor: String, - 'engine-strict': Boolean, - force: Boolean, - fund: Boolean, - 'format-package-lock': Boolean, - 'fetch-retries': Number, - 'fetch-retry-factor': Number, - 'fetch-retry-mintimeout': Number, - 'fetch-retry-maxtimeout': Number, - git: String, - 'git-tag-version': Boolean, - 'commit-hooks': Boolean, - global: Boolean, - globalconfig: path, - 'global-style': Boolean, - group: [Number, String], - 'https-proxy': [null, url], - 'user-agent': String, - 'ham-it-up': Boolean, - 'heading': String, - 'if-present': Boolean, - 'ignore-prepublish': Boolean, - 'ignore-scripts': Boolean, - 'init-module': path, - 'init-author-name': String, - 'init-author-email': String, - 'init-author-url': ['', url], - 'init-license': String, - 'init-version': semver, - json: Boolean, - key: [null, String], - 'legacy-bundling': Boolean, - link: Boolean, - 'local-address': getLocalAddresses(), - loglevel: ['silent', 'error', 'warn', 'notice', 'http', 'timing', 'info', 'verbose', 'silly'], - logstream: Stream, - 'logs-max': Number, - long: Boolean, - maxsockets: Number, - message: String, - 'metrics-registry': [null, String], - 'node-options': [null, String], - 'node-version': [null, semver], - 'noproxy': [null, String, Array], - offline: Boolean, - 'onload-script': [null, String], - only: [null, 'dev', 'development', 'prod', 'production'], - optional: Boolean, - 'package-lock': Boolean, - otp: [null, String], - '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': [false, true, 'auto', 'warn-only'], - searchopts: String, - searchexclude: [null, String], - searchlimit: Number, - searchstaleness: Number, - 'send-metrics': Boolean, - shell: String, - shrinkwrap: Boolean, - 'sign-git-commit': Boolean, - 'sign-git-tag': Boolean, - 'sso-poll-frequency': Number, - 'sso-type': [null, 'oauth', 'saml'], - 'strict-ssl': Boolean, - tag: String, - timing: Boolean, - tmp: path, - unicode: Boolean, - 'unsafe-perm': Boolean, - 'update-notifier': Boolean, - usage: Boolean, - user: [Number, String], - userconfig: path, - umask: Umask, - version: Boolean, - 'tag-version-prefix': String, - versions: Boolean, - viewer: String, - _exit: Boolean -} - -function getLocalAddresses () { - var interfaces - // #8094: some environments require elevated permissions to enumerate - // interfaces, and synchronously throw EPERM when run without - // elevated privileges - try { - interfaces = os.networkInterfaces() - } catch (e) { - interfaces = {} - } - - return Object.keys(interfaces).map( - nic => interfaces[nic].map(({address}) => address) - ).reduce((curr, next) => curr.concat(next), []).concat(undefined) -} - -exports.shorthands = { - before: ['--enjoy-by'], - s: ['--loglevel', 'silent'], - d: ['--loglevel', 'info'], - dd: ['--loglevel', 'verbose'], - ddd: ['--loglevel', 'silly'], - noreg: ['--no-registry'], - N: ['--no-registry'], - reg: ['--registry'], - 'no-reg': ['--no-registry'], - silent: ['--loglevel', 'silent'], - verbose: ['--loglevel', 'verbose'], - quiet: ['--loglevel', 'warn'], - q: ['--loglevel', 'warn'], - h: ['--usage'], - H: ['--usage'], - '?': ['--usage'], - help: ['--usage'], - v: ['--version'], - f: ['--force'], - desc: ['--description'], - 'no-desc': ['--no-description'], - 'local': ['--no-global'], - l: ['--long'], - m: ['--message'], - p: ['--parseable'], - porcelain: ['--parseable'], - readonly: ['--read-only'], - g: ['--global'], - S: ['--save'], - D: ['--save-dev'], - E: ['--save-exact'], - O: ['--save-optional'], - P: ['--save-prod'], - y: ['--yes'], - n: ['--no-yes'], - B: ['--save-bundle'], - C: ['--prefix'] -} diff --git a/deps/npm/lib/config/figgy-config.js b/deps/npm/lib/config/figgy-config.js deleted file mode 100644 index d704d1502cb447..00000000000000 --- a/deps/npm/lib/config/figgy-config.js +++ /dev/null @@ -1,87 +0,0 @@ -'use strict' - -const BB = require('bluebird') - -const crypto = require('crypto') -const figgyPudding = require('figgy-pudding') -const log = require('npmlog') -const npm = require('../npm.js') -const pack = require('../pack.js') -const path = require('path') - -const npmSession = npm.session = crypto.randomBytes(8).toString('hex') -log.verbose('npm-session', npmSession) - -const SCOPE_REGISTRY_REGEX = /@.*:registry$/gi -const NpmConfig = figgyPudding({}, { - other (key) { - return key.match(SCOPE_REGISTRY_REGEX) - } -}) - -let baseConfig - -module.exports = mkConfig -function mkConfig (...providers) { - if (!baseConfig) { - baseConfig = NpmConfig(npm.config, { - // Add some non-npm-config opts by hand. - cache: path.join(npm.config.get('cache'), '_cacache'), - // NOTE: npm has some magic logic around color distinct from the config - // value, so we have to override it here - color: !!npm.color, - dirPacker: pack.packGitDep, - hashAlgorithm: 'sha1', - includeDeprecated: false, - log, - 'npm-session': npmSession, - 'project-scope': npm.projectScope, - refer: npm.referer, - dmode: npm.modes.exec, - fmode: npm.modes.file, - umask: npm.modes.umask, - npmVersion: npm.version, - tmp: npm.tmp, - Promise: BB - }) - const ownerStats = calculateOwner() - if (ownerStats.uid != null || ownerStats.gid != null) { - baseConfig = baseConfig.concat(ownerStats) - } - } - let conf = baseConfig.concat(...providers) - // Adapt some other configs if missing - if (npm.config.get('prefer-online') === undefined) { - conf = conf.concat({ - 'prefer-online': npm.config.get('cache-max') <= 0 - }) - } - if (npm.config.get('prefer-online') === undefined) { - conf = conf.concat({ - 'prefer-online': npm.config.get('cache-min') >= 9999 - }) - } - return conf -} - -let effectiveOwner -function calculateOwner () { - if (!effectiveOwner) { - effectiveOwner = { uid: 0, gid: 0 } - - // Pretty much only on windows - if (!process.getuid) { - return effectiveOwner - } - - effectiveOwner.uid = +process.getuid() - effectiveOwner.gid = +process.getgid() - - if (effectiveOwner.uid === 0) { - if (process.env.SUDO_UID) effectiveOwner.uid = +process.env.SUDO_UID - if (process.env.SUDO_GID) effectiveOwner.gid = +process.env.SUDO_GID - } - } - - return effectiveOwner -} diff --git a/deps/npm/lib/config/gentle-fs.js b/deps/npm/lib/config/gentle-fs.js deleted file mode 100644 index c4a1f9fa22db43..00000000000000 --- a/deps/npm/lib/config/gentle-fs.js +++ /dev/null @@ -1,32 +0,0 @@ -'use strict' - -const npm = require('../npm.js') -const log = require('npmlog') - -module.exports = gentleFSOpts - -function gentleFSOpts (gently, base, abs) { - return { - // never rm the root, prefix, or bin dirs - // - // globals included because of `npm link` -- as far as the package - // requesting the link is concerned, the linked package is always - // installed globally - prefixes: [ - npm.prefix, - npm.globalPrefix, - npm.dir, - npm.root, - npm.globalDir, - npm.bin, - npm.globalBin - ], - absolute: abs, - log: log, - prefix: npm.prefix, - force: npm.config.get('force'), - gently: gently, - base: base, - name: 'npm' - } -} diff --git a/deps/npm/lib/config/get-credentials-by-uri.js b/deps/npm/lib/config/get-credentials-by-uri.js deleted file mode 100644 index 21926c68659932..00000000000000 --- a/deps/npm/lib/config/get-credentials-by-uri.js +++ /dev/null @@ -1,78 +0,0 @@ -var assert = require('assert') - -var toNerfDart = require('./nerf-dart.js') - -module.exports = getCredentialsByURI - -function getCredentialsByURI (uri) { - assert(uri && typeof uri === 'string', 'registry URL is required') - var nerfed = toNerfDart(uri) - var defnerf = toNerfDart(this.get('registry')) - - // hidden class micro-optimization - var c = { - scope: nerfed, - token: undefined, - password: undefined, - username: undefined, - email: undefined, - auth: undefined, - alwaysAuth: undefined - } - - // used to override scope matching for tokens as well as legacy auth - if (this.get(nerfed + ':always-auth') !== undefined) { - var val = this.get(nerfed + ':always-auth') - c.alwaysAuth = val === 'false' ? false : !!val - } else if (this.get('always-auth') !== undefined) { - c.alwaysAuth = this.get('always-auth') - } - - if (this.get(nerfed + ':_authToken')) { - c.token = this.get(nerfed + ':_authToken') - // the bearer token is enough, don't confuse things - return c - } - - if (this.get(nerfed + ':-authtoken')) { - c.token = this.get(nerfed + ':-authtoken') - // the bearer token is enough, don't confuse things - return c - } - - // Handle the old-style _auth= style for the default - // registry, if set. - var authDef = this.get('_auth') - var userDef = this.get('username') - var passDef = this.get('_password') - if (authDef && !(userDef && passDef)) { - authDef = Buffer.from(authDef, 'base64').toString() - authDef = authDef.split(':') - userDef = authDef.shift() - passDef = authDef.join(':') - } - - if (this.get(nerfed + ':_password')) { - c.password = Buffer.from(this.get(nerfed + ':_password'), 'base64').toString('utf8') - } else if (nerfed === defnerf && passDef) { - c.password = passDef - } - - if (this.get(nerfed + ':username')) { - c.username = this.get(nerfed + ':username') - } else if (nerfed === defnerf && userDef) { - c.username = userDef - } - - if (this.get(nerfed + ':email')) { - c.email = this.get(nerfed + ':email') - } else if (this.get('email')) { - c.email = this.get('email') - } - - if (c.username && c.password) { - c.auth = Buffer.from(c.username + ':' + c.password).toString('base64') - } - - return c -} diff --git a/deps/npm/lib/config/lifecycle.js b/deps/npm/lib/config/lifecycle.js deleted file mode 100644 index 86941edcd8e45b..00000000000000 --- a/deps/npm/lib/config/lifecycle.js +++ /dev/null @@ -1,31 +0,0 @@ -'use strict' - -const npm = require('../npm.js') -const log = require('npmlog') - -module.exports = lifecycleOpts - -let opts - -function lifecycleOpts (moreOpts) { - if (!opts) { - opts = { - config: npm.config.snapshot, - dir: npm.dir, - failOk: false, - force: npm.config.get('force'), - group: npm.config.get('group'), - ignorePrepublish: npm.config.get('ignore-prepublish'), - ignoreScripts: npm.config.get('ignore-scripts'), - log: log, - nodeOptions: npm.config.get('node-options'), - production: npm.config.get('production'), - scriptShell: npm.config.get('script-shell'), - scriptsPrependNodePath: npm.config.get('scripts-prepend-node-path'), - unsafePerm: npm.config.get('unsafe-perm'), - user: npm.config.get('user') - } - } - - return moreOpts ? Object.assign({}, opts, moreOpts) : opts -} diff --git a/deps/npm/lib/config/load-cafile.js b/deps/npm/lib/config/load-cafile.js deleted file mode 100644 index de8f61625a6b17..00000000000000 --- a/deps/npm/lib/config/load-cafile.js +++ /dev/null @@ -1,32 +0,0 @@ -module.exports = loadCAFile - -var fs = require('fs') - -function loadCAFile (cafilePath, cb) { - if (!cafilePath) return process.nextTick(cb) - - fs.readFile(cafilePath, 'utf8', afterCARead.bind(this)) - - function afterCARead (er, cadata) { - if (er) { - // previous cafile no longer exists, so just continue on gracefully - if (er.code === 'ENOENT') return cb() - return cb(er) - } - - var delim = '-----END CERTIFICATE-----' - var output - - output = cadata - .split(delim) - .filter(function (xs) { - return !!xs.trim() - }) - .map(function (xs) { - return xs.trimLeft() + delim - }) - - this.set('ca', output) - cb(null) - } -} diff --git a/deps/npm/lib/config/load-prefix.js b/deps/npm/lib/config/load-prefix.js deleted file mode 100644 index 090865d2157c02..00000000000000 --- a/deps/npm/lib/config/load-prefix.js +++ /dev/null @@ -1,51 +0,0 @@ -module.exports = loadPrefix - -var findPrefix = require('find-npm-prefix') -var path = require('path') - -function loadPrefix (cb) { - var cli = this.list[0] - - Object.defineProperty(this, 'prefix', - { - set: function (prefix) { - var g = this.get('global') - this[g ? 'globalPrefix' : 'localPrefix'] = prefix - }.bind(this), - get: function () { - var g = this.get('global') - return g ? this.globalPrefix : this.localPrefix - }.bind(this), - enumerable: true - }) - - Object.defineProperty(this, 'globalPrefix', - { - set: function (prefix) { - this.set('prefix', prefix) - }.bind(this), - get: function () { - return path.resolve(this.get('prefix')) - }.bind(this), - enumerable: true - }) - - var p - Object.defineProperty(this, 'localPrefix', - { set: function (prefix) { p = prefix }, - get: function () { return p }, - enumerable: true }) - - // try to guess at a good node_modules location. - // If we are *explicitly* given a prefix on the cli, then - // always use that. otherwise, infer local prefix from cwd. - if (Object.prototype.hasOwnProperty.call(cli, 'prefix')) { - p = path.resolve(cli.prefix) - process.nextTick(cb) - } else { - findPrefix(process.cwd()).then((found) => { - p = found - cb() - }, cb) - } -} diff --git a/deps/npm/lib/config/nerf-dart.js b/deps/npm/lib/config/nerf-dart.js deleted file mode 100644 index 8d2bdd26edf9ba..00000000000000 --- a/deps/npm/lib/config/nerf-dart.js +++ /dev/null @@ -1,23 +0,0 @@ -var url = require('url') - -module.exports = toNerfDart - -/** - * Maps a URL to an identifier. - * - * Name courtesy schiffertronix media LLC, a New Jersey corporation - * - * @param {String} uri The URL to be nerfed. - * - * @returns {String} A nerfed URL. - */ -function toNerfDart (uri) { - var parsed = url.parse(uri) - delete parsed.protocol - delete parsed.auth - delete parsed.query - delete parsed.search - delete parsed.hash - - return url.resolve(url.format(parsed), '.') -} diff --git a/deps/npm/lib/config/set-credentials-by-uri.js b/deps/npm/lib/config/set-credentials-by-uri.js deleted file mode 100644 index 4723d561a8af6f..00000000000000 --- a/deps/npm/lib/config/set-credentials-by-uri.js +++ /dev/null @@ -1,39 +0,0 @@ -var assert = require('assert') - -var toNerfDart = require('./nerf-dart.js') - -module.exports = setCredentialsByURI - -function setCredentialsByURI (uri, c) { - assert(uri && typeof uri === 'string', 'registry URL is required') - assert(c && typeof c === 'object', 'credentials are required') - - var nerfed = toNerfDart(uri) - - if (c.token) { - this.set(nerfed + ':_authToken', c.token, 'user') - this.del(nerfed + ':_password', 'user') - this.del(nerfed + ':username', 'user') - this.del(nerfed + ':email', 'user') - this.del(nerfed + ':always-auth', 'user') - } else if (c.username || c.password || c.email) { - assert(c.username, 'must include username') - assert(c.password, 'must include password') - assert(c.email, 'must include email address') - - this.del(nerfed + ':_authToken', 'user') - - var encoded = Buffer.from(c.password, 'utf8').toString('base64') - this.set(nerfed + ':_password', encoded, 'user') - this.set(nerfed + ':username', c.username, 'user') - this.set(nerfed + ':email', c.email, 'user') - - if (c.alwaysAuth !== undefined) { - this.set(nerfed + ':always-auth', c.alwaysAuth, 'user') - } else { - this.del(nerfed + ':always-auth', 'user') - } - } else { - throw new Error('No credentials to set.') - } -} diff --git a/deps/npm/lib/config/set-user.js b/deps/npm/lib/config/set-user.js deleted file mode 100644 index 570a1f54e2757f..00000000000000 --- a/deps/npm/lib/config/set-user.js +++ /dev/null @@ -1,29 +0,0 @@ -module.exports = setUser - -var assert = require('assert') -var path = require('path') -var fs = require('fs') -var mkdirp = require('gentle-fs').mkdir - -function setUser (cb) { - var defaultConf = this.root - assert(defaultConf !== Object.prototype) - - // If global, leave it as-is. - // If not global, then set the user to the owner of the prefix folder. - // Just set the default, so it can be overridden. - if (this.get('global')) return cb() - if (process.env.SUDO_UID) { - defaultConf.user = +(process.env.SUDO_UID) - return cb() - } - - var prefix = path.resolve(this.get('prefix')) - mkdirp(prefix, function (er) { - if (er) return cb(er) - fs.stat(prefix, function (er, st) { - defaultConf.user = st && st.uid - return cb(er) - }) - }) -} diff --git a/deps/npm/lib/dedupe.js b/deps/npm/lib/dedupe.js index 325faeaabcd43f..eb197ec62bfcd5 100644 --- a/deps/npm/lib/dedupe.js +++ b/deps/npm/lib/dedupe.js @@ -1,160 +1,24 @@ -var util = require('util') -var path = require('path') -var validate = require('aproba') -var without = require('lodash.without') -var asyncMap = require('slide').asyncMap -var chain = require('slide').chain -var npa = require('npm-package-arg') -var log = require('npmlog') -var npm = require('./npm.js') -var Installer = require('./install.js').Installer -var findRequirement = require('./install/deps.js').findRequirement -var earliestInstallable = require('./install/deps.js').earliestInstallable -var checkPermissions = require('./install/check-permissions.js') -var decomposeActions = require('./install/decompose-actions.js') -var loadExtraneous = require('./install/deps.js').loadExtraneous -var computeMetadata = require('./install/deps.js').computeMetadata -var sortActions = require('./install/diff-trees.js').sortActions -var moduleName = require('./utils/module-name.js') -var packageId = require('./utils/package-id.js') -var childPath = require('./utils/child-path.js') -var usage = require('./utils/usage') -var getRequested = require('./install/get-requested.js') - -module.exports = dedupe -module.exports.Deduper = Deduper - -dedupe.usage = usage( - 'dedupe', - 'npm dedupe' -) - -function dedupe (args, cb) { - validate('AF', arguments) - // the /path/to/node_modules/.. - var where = path.resolve(npm.dir, '..') - var dryrun = false - if (npm.command.match(/^find/)) dryrun = true - if (npm.config.get('dry-run')) dryrun = true - if (dryrun && !npm.config.get('json')) npm.config.set('parseable', true) - - new Deduper(where, dryrun).run(cb) -} - -function Deduper (where, dryrun) { - validate('SB', arguments) - Installer.call(this, where, dryrun, []) - this.noPackageJsonOk = true - this.topLevelLifecycles = false -} -util.inherits(Deduper, Installer) - -Deduper.prototype.loadIdealTree = function (cb) { - validate('F', arguments) - log.silly('install', 'loadIdealTree') - - var self = this - chain([ - [this.newTracker(this.progress.loadIdealTree, 'cloneCurrentTree')], - [this, this.cloneCurrentTreeToIdealTree], - [this, this.finishTracker, 'cloneCurrentTree'], - - [this.newTracker(this.progress.loadIdealTree, 'loadAllDepsIntoIdealTree', 10)], - [ function (next) { - loadExtraneous(self.idealTree, self.progress.loadAllDepsIntoIdealTree, next) - } ], - [this, this.finishTracker, 'loadAllDepsIntoIdealTree'], - - [this, andComputeMetadata(this.idealTree)] - ], cb) -} - -function andComputeMetadata (tree) { - return function (next) { - next(null, computeMetadata(tree)) - } -} - -Deduper.prototype.generateActionsToTake = function (cb) { - validate('F', arguments) - log.silly('dedupe', 'generateActionsToTake') - chain([ - [this.newTracker(log, 'hoist', 1)], - [hoistChildren, this.idealTree, this.differences], - [this, this.finishTracker, 'hoist'], - [this.newTracker(log, 'sort-actions', 1)], - [this, function (next) { - this.differences = sortActions(this.differences) - next() - }], - [this, this.finishTracker, 'sort-actions'], - [checkPermissions, this.differences], - [decomposeActions, this.differences, this.todo] - ], cb) -} - -function move (node, hoistTo, diff) { - node.parent.children = without(node.parent.children, node) - hoistTo.children.push(node) - node.fromPath = node.path - node.path = childPath(hoistTo.path, node) - node.parent = hoistTo - if (!diff.filter(function (action) { return action[0] === 'move' && action[1] === node }).length) { - diff.push(['move', node]) - } -} - -function moveRemainingChildren (node, diff) { - node.children.forEach(function (child) { - move(child, node, diff) - moveRemainingChildren(child, diff) +// dedupe duplicated packages, or find them in the tree +const npm = require('./npm.js') +const Arborist = require('@npmcli/arborist') +const usageUtil = require('./utils/usage.js') +const reifyOutput = require('./utils/reify-output.js') + +const usage = usageUtil('dedupe', 'npm dedupe') +const completion = require('./utils/completion/none.js') + +const cmd = (args, cb) => dedupe(args).then(() => cb()).catch(cb) + +const dedupe = async (args) => { + const dryRun = (args && args.dryRun) || npm.flatOptions.dryRun + const where = npm.prefix + const arb = new Arborist({ + ...npm.flatOptions, + path: where, + dryRun }) + await arb.dedupe(npm.flatOptions) + reifyOutput(arb) } -function remove (child, diff, done) { - remove_(child, diff, new Set(), done) -} - -function remove_ (child, diff, seen, done) { - if (seen.has(child)) return done() - seen.add(child) - diff.push(['remove', child]) - child.parent.children = without(child.parent.children, child) - asyncMap(child.children, function (child, next) { - remove_(child, diff, seen, next) - }, done) -} - -function hoistChildren (tree, diff, next) { - hoistChildren_(tree, diff, new Set(), next) -} - -function hoistChildren_ (tree, diff, seen, next) { - validate('OAOF', arguments) - if (seen.has(tree)) return next() - seen.add(tree) - asyncMap(tree.children, function (child, done) { - if (!tree.parent || child.fromBundle || child.package._inBundle) return hoistChildren_(child, diff, seen, done) - var better = findRequirement(tree.parent, moduleName(child), getRequested(child) || npa(packageId(child))) - if (better) { - return chain([ - [remove, child, diff], - [andComputeMetadata(tree)] - ], done) - } - var hoistTo = earliestInstallable(tree, tree.parent, child.package, log) - if (hoistTo) { - move(child, hoistTo, diff) - chain([ - [andComputeMetadata(hoistTo)], - [hoistChildren_, child, diff, seen], - [ function (next) { - moveRemainingChildren(child, diff) - next() - } ] - ], done) - } else { - done() - } - }, next) -} +module.exports = Object.assign(cmd, { usage, completion }) diff --git a/deps/npm/lib/deprecate.js b/deps/npm/lib/deprecate.js index 7fe2fbed4ba554..d7a9a9481e0a88 100644 --- a/deps/npm/lib/deprecate.js +++ b/deps/npm/lib/deprecate.js @@ -1,36 +1,31 @@ 'use strict' -const BB = require('bluebird') - -const npmConfig = require('./config/figgy-config.js') -const fetch = require('libnpm/fetch') -const figgyPudding = require('figgy-pudding') +const npm = require('./npm.js') +const fetch = require('npm-registry-fetch') const otplease = require('./utils/otplease.js') -const npa = require('libnpm/parse-arg') +const npa = require('npm-package-arg') const semver = require('semver') -const whoami = require('./whoami.js') - -const DeprecateConfig = figgyPudding({}) +const getItentity = require('./utils/get-identity') module.exports = deprecate deprecate.usage = 'npm deprecate [@] ' deprecate.completion = function (opts, cb) { - return BB.try(() => { + return Promise.resolve().then(() => { if (opts.conf.argv.remain.length > 2) { return } - return whoami([], true, () => {}).then(username => { + return getItentity(npm.flatOptions).then(username => { if (username) { // first, get a list of remote packages this user owns. // once we have a user account, then don't complete anything. // get the list of packages by user return fetch( `/-/by-user/${encodeURIComponent(username)}`, - DeprecateConfig() + npm.flatOptions ).then(list => list[username]) } }) - }).nodeify(cb) + }).then(() => cb(), er => cb(er)) } function deprecate ([pkg, msg], opts, cb) { @@ -38,8 +33,8 @@ function deprecate ([pkg, msg], opts, cb) { cb = opts opts = null } - opts = DeprecateConfig(opts || npmConfig()) - return BB.try(() => { + opts = opts || npm.flatOptions + return Promise.resolve().then(() => { if (msg == null) throw new Error(`Usage: ${deprecate.usage}`) // fetch the data and make sure it exists. const p = npa(pkg) @@ -53,20 +48,22 @@ function deprecate ([pkg, msg], opts, cb) { } const uri = '/' + p.escapedName - return fetch.json(uri, opts.concat({ + return fetch.json(uri, { + ...opts, spec: p, - query: {write: true} - })).then(packument => { + query: { write: true } + }).then(packument => { // filter all the versions that match Object.keys(packument.versions) .filter(v => semver.satisfies(v, spec)) .forEach(v => { packument.versions[v].deprecated = msg }) - return otplease(opts, opts => fetch(uri, opts.concat({ + return otplease(opts, opts => fetch(uri, { + ...opts, spec: p, method: 'PUT', body: packument, ignoreBody: true - }))) + })) }) - }).nodeify(cb) + }).then(() => cb(), cb) } diff --git a/deps/npm/lib/dist-tag.js b/deps/npm/lib/dist-tag.js index 64bb97b61a4c6f..4d8c77d00b9422 100644 --- a/deps/npm/lib/dist-tag.js +++ b/deps/npm/lib/dist-tag.js @@ -1,32 +1,25 @@ -/* eslint-disable standard/no-callback-literal */ -module.exports = distTag +'use strict' -const BB = require('bluebird') - -const figgyPudding = require('figgy-pudding') const log = require('npmlog') -const npa = require('libnpm/parse-arg') -const npmConfig = require('./config/figgy-config.js') -const output = require('./utils/output.js') -const otplease = require('./utils/otplease.js') -const readLocalPkg = BB.promisify(require('./utils/read-local-package.js')) -const regFetch = require('libnpm/fetch') +const npa = require('npm-package-arg') +const regFetch = require('npm-registry-fetch') const semver = require('semver') -const usage = require('./utils/usage') -const DistTagOpts = figgyPudding({ - tag: {} -}) +const npm = require('./npm.js') +const output = require('./utils/output.js') +const otplease = require('./utils/otplease.js') +const readLocalPkgName = require('./utils/read-local-package.js') +const usageUtil = require('./utils/usage.js') -distTag.usage = usage( +const usage = usageUtil( 'dist-tag', 'npm dist-tag add @ []' + '\nnpm dist-tag rm ' + '\nnpm dist-tag ls []' ) -distTag.completion = function (opts, cb) { - var argv = opts.conf.argv.remain +const completion = function (opts, cb) { + const argv = opts.conf.argv.remain if (argv.length === 2) { return cb(null, ['add', 'rm', 'ls']) } @@ -37,49 +30,45 @@ distTag.completion = function (opts, cb) { } } -function UsageError () { - throw Object.assign(new Error('Usage:\n' + distTag.usage), { - code: 'EUSAGE' - }) -} +const cmd = (args, cb) => distTag(args).then(() => cb()).catch(cb) -function distTag ([cmd, pkg, tag], cb) { - const opts = DistTagOpts(npmConfig()) - return BB.try(() => { - switch (cmd) { - case 'add': case 'a': case 'set': case 's': - return add(pkg, tag, opts) - case 'rm': case 'r': case 'del': case 'd': case 'remove': - return remove(pkg, tag, opts) - case 'ls': case 'l': case 'sl': case 'list': - return list(pkg, opts) - default: - if (!pkg) { - return list(cmd, opts) - } else { - UsageError() - } - } - }).then( - x => cb(null, x), - err => { - if (err.code === 'EUSAGE') { - cb(err.message) - } else { - cb(err) - } - } - ) +const distTag = async ([cmdName, pkg, tag]) => { + const opts = npm.flatOptions + const has = (items) => new Set(items).has(cmdName) + + if (has(['add', 'a', 'set', 's'])) { + return add(pkg, tag, opts) + } + + if (has(['rm', 'r', 'del', 'd', 'remove'])) { + return remove(pkg, tag, opts) + } + + if (has(['ls', 'l', 'sl', 'list'])) { + return list(pkg, opts) + } + + if (!pkg) { + // when only using the pkg name the default behavior + // should be listing the existing tags + return list(cmdName, opts) + } else { + throw usage + } } function add (spec, tag, opts) { spec = npa(spec || '') const version = spec.rawSpec - const t = (tag || opts.tag).trim() + const defaultTag = tag || opts.defaultTag - log.verbose('dist-tag add', t, 'to', spec.name + '@' + version) + log.verbose('dist-tag add', defaultTag, 'to', spec.name + '@' + version) + + if (!spec.name || !version || !defaultTag) { + throw usage + } - if (!spec || !version || !t) UsageError() + const t = defaultTag.trim() if (semver.validRange(t)) { throw new Error('Tag name must not be a valid SemVer range: ' + t) @@ -91,15 +80,17 @@ function add (spec, tag, opts) { return } tags[t] = version - const url = `/-/package/${spec.escapedName}/dist-tags/${encodeURIComponent(t)}` - const reqOpts = opts.concat({ + const url = + `/-/package/${spec.escapedName}/dist-tags/${encodeURIComponent(t)}` + const reqOpts = { + ...opts, method: 'PUT', body: JSON.stringify(version), headers: { 'content-type': 'application/json' }, spec - }) + } return otplease(reqOpts, reqOpts => regFetch(url, reqOpts)).then(() => { output(`+${t}: ${spec.name}@${version}`) }) @@ -110,6 +101,10 @@ function remove (spec, tag, opts) { spec = npa(spec || '') log.verbose('dist-tag del', tag, 'from', spec.name) + if (!spec.name) { + throw usage + } + return fetchTags(spec, opts).then(tags => { if (!tags[tag]) { log.info('dist-tag del', tag, 'is not a dist-tag on', spec.name) @@ -117,11 +112,13 @@ function remove (spec, tag, opts) { } const version = tags[tag] delete tags[tag] - const url = `/-/package/${spec.escapedName}/dist-tags/${encodeURIComponent(tag)}` - const reqOpts = opts.concat({ + const url = + `/-/package/${spec.escapedName}/dist-tags/${encodeURIComponent(tag)}` + const reqOpts = { + ...opts, method: 'DELETE', spec - }) + } return otplease(reqOpts, reqOpts => regFetch(url, reqOpts)).then(() => { output(`-${tag}: ${spec.name}@${version}`) }) @@ -130,15 +127,19 @@ function remove (spec, tag, opts) { function list (spec, opts) { if (!spec) { - return readLocalPkg().then(pkg => { - if (!pkg) { UsageError() } + return readLocalPkgName().then(pkg => { + if (!pkg) { + throw usage + } + return list(pkg, opts) }) } spec = npa(spec) return fetchTags(spec, opts).then(tags => { - var msg = Object.keys(tags).map(k => `${k}: ${tags[k]}`).sort().join('\n') + const msg = + Object.keys(tags).map(k => `${k}: ${tags[k]}`).sort().join('\n') output(msg) return tags }, err => { @@ -150,10 +151,11 @@ function list (spec, opts) { function fetchTags (spec, opts) { return regFetch.json( `/-/package/${spec.escapedName}/dist-tags`, - opts.concat({ + { + ...opts, 'prefer-online': true, spec - }) + } ).then(data => { if (data && typeof data === 'object') delete data._etag if (!data || !Object.keys(data).length) { @@ -162,3 +164,5 @@ function fetchTags (spec, opts) { return data }) } + +module.exports = Object.assign(cmd, { usage, completion }) diff --git a/deps/npm/lib/docs.js b/deps/npm/lib/docs.js index 6d67da4e120907..e101f8fea75e3d 100644 --- a/deps/npm/lib/docs.js +++ b/deps/npm/lib/docs.js @@ -1,41 +1,42 @@ -module.exports = docs - -var openUrl = require('./utils/open-url') -var log = require('npmlog') -var fetchPackageMetadata = require('./fetch-package-metadata.js') -var usage = require('./utils/usage') - -docs.usage = usage( - 'docs', - 'npm docs ' + - '\nnpm docs .' -) -docs.completion = function (opts, cb) { - // FIXME: there used to be registry completion here, but it stopped making - // sense somewhere around 50,000 packages on the registry - cb() +const log = require('npmlog') +const pacote = require('pacote') +const { promisify } = require('util') +const openUrl = promisify(require('./utils/open-url.js')) +const usageUtil = require('./utils/usage.js') +const npm = require('./npm.js') +const hostedFromMani = require('./utils/hosted-git-info-from-manifest.js') + +const usage = usageUtil('docs', 'npm docs [ [ ...]]') +const completion = require('./utils/completion/none.js') + +const cmd = (args, cb) => docs(args).then(() => cb()).catch(cb) + +const docs = async args => { + if (!args || !args.length) { + args = ['.'] + } + await Promise.all(args.map(pkg => getDocs(pkg))) } -function docs (args, cb) { - if (!args || !args.length) args = ['.'] - var pending = args.length - log.silly('docs', args) - args.forEach(function (proj) { - getDoc(proj, function (err) { - if (err) { - return cb(err) - } - --pending || cb() - }) - }) +const getDocsUrl = mani => { + if (mani.homepage) { + return mani.homepage + } + + const info = hostedFromMani(mani) + if (info) { + return info.docs() + } + + return 'https://www.npmjs.com/package/' + mani.name } -function getDoc (project, cb) { - log.silly('getDoc', project) - fetchPackageMetadata(project, '.', {fullMetadata: true}, function (er, d) { - if (er) return cb(er) - var url = d.homepage - if (!url) url = 'https://www.npmjs.org/package/' + d.name - return openUrl(url, 'docs available at the following URL', cb) - }) +const getDocs = async pkg => { + const opts = { ...npm.flatOptions, fullMetadata: true } + const mani = await pacote.manifest(pkg, opts) + const url = getDocsUrl(mani) + log.silly('docs', 'url', url) + await openUrl(url, `${mani.name} docs available at the following URL`) } + +module.exports = Object.assign(cmd, { usage, completion }) diff --git a/deps/npm/lib/doctor.js b/deps/npm/lib/doctor.js index 96094e6346d05f..1e781dc596afed 100644 --- a/deps/npm/lib/doctor.js +++ b/deps/npm/lib/doctor.js @@ -1,113 +1,294 @@ -'use strict' - -const ansiTrim = require('./utils/ansi-trim') -const chain = require('slide').chain -const color = require('ansicolors') -const defaultRegistry = require('./config/defaults').defaults.registry -const log = require('npmlog') -const npm = require('./npm') -const output = require('./utils/output') -const path = require('path') -const semver = require('semver') -const styles = require('ansistyles') -const table = require('text-table') +const npm = require('./npm.js') -// steps -const checkFilesPermission = require('./doctor/check-files-permission') -const checkPing = require('./doctor/check-ping') -const getGitPath = require('./doctor/get-git-path') -const getLatestNodejsVersion = require('./doctor/get-latest-nodejs-version') -const getLatestNpmVersion = require('./doctor/get-latest-npm-version') -const verifyCachedFiles = require('./doctor/verify-cached-files') +const chalk = require('chalk') +const ansiTrim = require('./utils/ansi-trim.js') +const table = require('text-table') +const output = require('./utils/output.js') +const completion = require('./utils/completion/none.js') +const usageUtil = require('./utils/usage.js') +const usage = usageUtil('doctor', 'npm doctor') +const { resolve } = require('path') -const globalNodeModules = path.join(npm.config.globalPrefix, 'lib', 'node_modules') -const localNodeModules = path.join(npm.config.localPrefix, 'node_modules') +const ping = require('./utils/ping.js') +const checkPing = async () => { + const tracker = npm.log.newItem('checkPing', 1) + tracker.info('checkPing', 'Pinging registry') + try { + await ping(npm.flatOptions) + return '' + } catch (er) { + if (/^E\d{3}$/.test(er.code || '')) { + throw er.code.substr(1) + ' ' + er.message + } else { + throw er + } + } finally { + tracker.finish() + } +} -module.exports = doctor +const pacote = require('pacote') +const getLatestNpmVersion = async () => { + const tracker = npm.log.newItem('getLatestNpmVersion', 1) + tracker.info('getLatestNpmVersion', 'Getting npm package information') + try { + const latest = (await pacote.manifest('npm@latest', npm.flatOptions)).version + if (semver.gte(npm.version, latest)) { + return `current: v${npm.version}, latest: v${latest}` + } else { + throw `Use npm v${latest}` + } + } finally { + tracker.finish() + } +} -doctor.usage = 'npm doctor' +const semver = require('semver') +const fetch = require('make-fetch-happen') +const getLatestNodejsVersion = async () => { + // XXX get the latest in the current major as well + const current = process.version + const currentRange = `^${current}` + const url = 'https://nodejs.org/dist/index.json' + const tracker = npm.log.newItem('getLatestNodejsVersion', 1) + tracker.info('getLatestNodejsVersion', 'Getting Node.js release information') + try { + const res = await fetch(url, { method: 'GET', ...npm.flatOptions }) + const data = await res.json() + let maxCurrent = '0.0.0' + let maxLTS = '0.0.0' + for (const { lts, version } of data) { + if (lts && semver.gt(version, maxLTS)) { + maxLTS = version + } + if (semver.satisfies(version, currentRange) && semver.gt(version, maxCurrent)) { + maxCurrent = version + } + } + const recommended = semver.gt(maxCurrent, maxLTS) ? maxCurrent : maxLTS + if (semver.gte(process.version, recommended)) { + return `current: ${current}, recommended: ${recommended}` + } else { + throw `Use node ${recommended} (current: ${current})` + } + } finally { + tracker.finish() + } +} -function doctor (args, silent, cb) { - args = args || {} - if (typeof cb !== 'function') { - cb = silent - silent = false +const { promisify } = require('util') +const fs = require('fs') +const { R_OK, W_OK, X_OK } = fs.constants +const maskLabel = mask => { + const label = [] + if (mask & R_OK) { + label.push('readable') + } + if (mask & W_OK) { + label.push('writable') + } + if (mask & X_OK) { + label.push('executable') + } + return label.join(', ') +} +const lstat = promisify(fs.lstat) +const readdir = promisify(fs.readdir) +const access = promisify(fs.access) +const isWindows = require('./utils/is-windows.js') +const checkFilesPermission = async (root, shouldOwn = true, mask = null) => { + if (mask === null) { + mask = shouldOwn ? R_OK | W_OK : R_OK } - const actionsToRun = [ - [checkPing], - [getLatestNpmVersion], - [getLatestNodejsVersion, args['node-url']], - [getGitPath], - [checkFilesPermission, npm.cache, 4, 6], - [checkFilesPermission, globalNodeModules, 4, 4], - [checkFilesPermission, localNodeModules, 6, 6], - [verifyCachedFiles, path.join(npm.cache, '_cacache')] - ] + let ok = true + + const tracker = npm.log.newItem(root, 1) + + try { + const uid = process.getuid() + const gid = process.getgid() + const files = new Set([root]) + for (const f of files) { + tracker.silly('checkFilesPermission', f.substr(root.length + 1)) + const st = await lstat(f) + .catch(er => { + ok = false + tracker.warn('checkFilesPermission', 'error getting info for ' + f) + }) + + tracker.completeWork(1) + + if (!st) { + continue + } + + if (shouldOwn && (uid !== st.uid || gid !== st.gid)) { + tracker.warn('checkFilesPermission', 'should be owner of ' + f) + ok = false + } + + if (!st.isDirectory() && !st.isFile()) { + continue + } - log.info('doctor', 'Running checkup') - chain(actionsToRun, function (stderr, stdout) { - if (stderr && stderr.message !== 'not found: git') return cb(stderr) - const list = makePretty(stdout) - let outHead = ['Check', 'Value', 'Recommendation'] - let outBody = list - - if (npm.color) { - outHead = outHead.map(function (item) { - return styles.underline(item) - }) - outBody = outBody.map(function (item) { - if (item[2]) { - item[0] = color.red(item[0]) - item[2] = color.magenta(item[2]) + try { + await access(f, mask) + } catch (er) { + ok = false + const msg = `Missing permissions on ${f} (expect: ${maskLabel(mask)})` + tracker.error('checkFilesPermission', msg) + continue + } + + if (st.isDirectory()) { + const entries = await readdir(f) + .catch(er => { + ok = false + tracker.warn('checkFilesPermission', 'error reading directory ' + f) + return [] + }) + for (const entry of entries) { + files.add(resolve(f, entry)) } - return item - }) + } } - - const outTable = [outHead].concat(outBody) - const tableOpts = { - stringLength: function (s) { return ansiTrim(s).length } + } finally { + tracker.finish() + if (!ok) { + throw `Check the permissions of files in ${root}` + + (shouldOwn ? ' (should be owned by current user)' : '') + } else { + return '' } + } +} + +const which = require('which') +const getGitPath = async () => { + const tracker = npm.log.newItem('getGitPath', 1) + tracker.info('getGitPath', 'Finding git in your PATH') + try { + return await which('git').catch(er => { + tracker.warn(er) + throw "Install git and ensure it's in your PATH." + }) + } finally { + tracker.finish() + } +} - if (!silent) output(table(outTable, tableOpts)) +const cacache = require('cacache') +const verifyCachedFiles = async () => { + const tracker = npm.log.newItem('verifyCachedFiles', 1) + tracker.info('verifyCachedFiles', 'Verifying the npm cache') + try { + const stats = await cacache.verify(npm.flatOptions.cache) + const { badContentCount, reclaimedCount, missingContent, reclaimedSize } = stats + if (badContentCount || reclaimedCount || missingContent) { + if (badContentCount) { + tracker.warn('verifyCachedFiles', `Corrupted content removed: ${badContentCount}`) + } + if (reclaimedCount) { + tracker.warn('verifyCachedFiles', `Content garbage-collected: ${reclaimedCount} (${reclaimedSize} bytes)`) + } + if (missingContent) { + tracker.warn('verifyCachedFiles', `Missing content: ${missingContent}`) + } + tracker.warn('verifyCachedFiles', 'Cache issues have been fixed') + } + tracker.info('verifyCachedFiles', `Verification complete. Stats: ${ + JSON.stringify(stats, null, 2) + }`) + return `verified ${stats.verifiedContent} tarballs` + } finally { + tracker.finish() + } +} - cb(null, list) - }) +const { defaults: { registry: defaultRegistry } } = require('./utils/config.js') +const checkNpmRegistry = async () => { + if (npm.flatOptions.registry !== defaultRegistry) { + throw `Try \`npm config set registry=${defaultRegistry}\`` + } else { + return `using default registry (${defaultRegistry})` + } } -function makePretty (p) { - const ping = p[1] - const npmLTS = p[2] - const nodeLTS = p[3].replace('v', '') - const whichGit = p[4] || 'not installed' - const readbleCaches = p[5] ? 'ok' : 'notOk' - const executableGlobalModules = p[6] ? 'ok' : 'notOk' - const executableLocalModules = p[7] ? 'ok' : 'notOk' - const cacheStatus = p[8] ? `verified ${p[8].verifiedContent} tarballs` : 'notOk' - const npmV = npm.version - const nodeV = process.version.replace('v', '') - const registry = npm.config.get('registry') || '' - const list = [ - ['npm ping', ping], - ['npm -v', 'v' + npmV], - ['node -v', 'v' + nodeV], - ['npm config get registry', registry], - ['which git', whichGit], - ['Perms check on cached files', readbleCaches], - ['Perms check on global node_modules', executableGlobalModules], - ['Perms check on local node_modules', executableLocalModules], - ['Verify cache contents', cacheStatus] +const cmd = (args, cb) => doctor(args).then(() => cb()).catch(cb) + +const doctor = async args => { + npm.log.info('Running checkup') + + // each message is [title, ok, message] + const messages = [] + + const actions = [ + ['npm ping', checkPing, []], + ['npm -v', getLatestNpmVersion, []], + ['node -v', getLatestNodejsVersion, []], + ['npm config get registry', checkNpmRegistry, []], + ['which git', getGitPath, []], + ...(isWindows ? [] : [ + ['Perms check on cached files', checkFilesPermission, [npm.cache, true, R_OK]], + ['Perms check on local node_modules', checkFilesPermission, [npm.localDir, true]], + ['Perms check on global node_modules', checkFilesPermission, [npm.globalDir, false]], + ['Perms check on local bin folder', checkFilesPermission, [npm.localBin, false, R_OK | W_OK | X_OK]], + ['Perms check on global bin folder', checkFilesPermission, [npm.globalBin, false, X_OK]] + ]), + ['Verify cache contents', verifyCachedFiles, [npm.flatOptions.cache]] + // TODO: + // - ensure arborist.loadActual() runs without errors and no invalid edges + // - ensure package-lock.json matches loadActual() + // - verify loadActual without hidden lock file matches hidden lockfile + // - verify all local packages have bins linked ] - if (p[0] !== 200) list[0][2] = 'Check your internet connection' - if (!semver.satisfies(npmV, '>=' + npmLTS)) list[1][2] = 'Use npm v' + npmLTS - if (!semver.satisfies(nodeV, '>=' + nodeLTS)) list[2][2] = 'Use node v' + nodeLTS - if (registry !== defaultRegistry) list[3][2] = 'Try `npm config set registry ' + defaultRegistry + '`' - if (whichGit === 'not installed') list[4][2] = 'Install git and ensure it\'s in your PATH.' - if (readbleCaches !== 'ok') list[5][2] = 'Check the permissions of your files in ' + npm.config.get('cache') - if (executableGlobalModules !== 'ok') list[6][2] = globalNodeModules + ' must be readable and writable by the current user.' - if (executableLocalModules !== 'ok') list[7][2] = localNodeModules + ' must be readable and writable by the current user.' + for (const [msg, fn, args] of actions) { + const line = [msg] + try { + line.push(true, await fn(...args)) + } catch (er) { + line.push(false, er) + } + messages.push(line) + } + + const silent = npm.log.levels[npm.log.level] > npm.log.levels.error + + const outHead = ['Check', 'Value', 'Recommendation/Notes'] + .map(!npm.color ? h => h : h => chalk.underline(h)) + let allOk = true + const outBody = messages.map(!npm.color + ? item => { + allOk = allOk && item[1] + item[1] = item[1] ? 'ok' : 'not ok' + item[2] = String(item[2]) + return item + } + : item => { + allOk = allOk && item[1] + if (!item[1]) { + item[0] = chalk.red(item[0]) + item[2] = chalk.magenta(String(item[2])) + } + item[1] = item[1] ? chalk.green('ok') : chalk.red('not ok') + return item + }) + const outTable = [outHead, ...outBody] + const tableOpts = { + stringLength: s => ansiTrim(s).length + } - return list + if (!silent) { + output(table(outTable, tableOpts)) + if (!allOk) { + console.error('') + } + } + if (!allOk) { + throw 'Some problems found. See above for recommendations.' + } } + +module.exports = Object.assign(cmd, { completion, usage }) diff --git a/deps/npm/lib/doctor/check-files-permission.js b/deps/npm/lib/doctor/check-files-permission.js deleted file mode 100644 index 1cefb6e64cea51..00000000000000 --- a/deps/npm/lib/doctor/check-files-permission.js +++ /dev/null @@ -1,57 +0,0 @@ -var fs = require('fs') -var path = require('path') -var getUid = require('uid-number') -var chain = require('slide').chain -var log = require('npmlog') -var npm = require('../npm.js') -var fileCompletion = require('../utils/completion/file-completion.js') - -function checkFilesPermission (root, fmask, dmask, cb) { - if (process.platform === 'win32') return cb(null, true) - getUid(npm.config.get('user'), npm.config.get('group'), function (e, uid, gid) { - var tracker = log.newItem('checkFilePermissions', 1) - if (e) { - tracker.finish() - tracker.warn('checkFilePermissions', 'Error looking up user and group:', e) - return cb(e) - } - tracker.info('checkFilePermissions', 'Building file list of ' + root) - fileCompletion(root, '.', Infinity, function (e, files) { - if (e) { - tracker.warn('checkFilePermissions', 'Error building file list:', e) - tracker.finish() - return cb(e) - } - tracker.addWork(files.length) - tracker.completeWork(1) - chain(files.map(andCheckFile), function (er) { - tracker.finish() - cb(null, !er) - }) - function andCheckFile (f) { - return [checkFile, f] - } - function checkFile (f, next) { - var file = path.join(root, f) - tracker.silly('checkFilePermissions', f) - fs.lstat(file, function (e, stat) { - tracker.completeWork(1) - if (e) return next(e) - if (!stat.isDirectory() && !stat.isFile()) return next() - // 6 = fs.constants.R_OK | fs.constants.W_OK - // constants aren't available on v4 - fs.access(file, stat.isFile() ? fmask : dmask, (err) => { - if (err) { - tracker.error('checkFilePermissions', `Missing permissions on ${file}`) - return next(new Error('Missing permissions for ' + file)) - } else { - return next() - } - }) - }) - } - }) - }) -} - -module.exports = checkFilesPermission diff --git a/deps/npm/lib/doctor/check-ping.js b/deps/npm/lib/doctor/check-ping.js deleted file mode 100644 index d8eac459fd69be..00000000000000 --- a/deps/npm/lib/doctor/check-ping.js +++ /dev/null @@ -1,16 +0,0 @@ -var log = require('npmlog') -var ping = require('../ping.js') - -function checkPing (cb) { - var tracker = log.newItem('checkPing', 1) - tracker.info('checkPing', 'Pinging registry') - ping({}, true, (err, pong) => { - if (err && err.code && err.code.match(/^E\d{3}$/)) { - return cb(null, [err.code.substr(1), 'failed']) - } else { - cb(null, [200, 'ok']) - } - }) -} - -module.exports = checkPing diff --git a/deps/npm/lib/doctor/get-git-path.js b/deps/npm/lib/doctor/get-git-path.js deleted file mode 100644 index 5b00e9d54e6bc9..00000000000000 --- a/deps/npm/lib/doctor/get-git-path.js +++ /dev/null @@ -1,13 +0,0 @@ -var log = require('npmlog') -var which = require('which') - -function getGitPath (cb) { - var tracker = log.newItem('getGitPath', 1) - tracker.info('getGitPath', 'Finding git in your PATH') - which('git', function (err, path) { - tracker.finish() - cb(err, path) - }) -} - -module.exports = getGitPath diff --git a/deps/npm/lib/doctor/get-latest-nodejs-version.js b/deps/npm/lib/doctor/get-latest-nodejs-version.js deleted file mode 100644 index 1586b087a0bff3..00000000000000 --- a/deps/npm/lib/doctor/get-latest-nodejs-version.js +++ /dev/null @@ -1,27 +0,0 @@ -var log = require('npmlog') -var request = require('request') -var semver = require('semver') - -function getLatestNodejsVersion (url, cb) { - var tracker = log.newItem('getLatestNodejsVersion', 1) - tracker.info('getLatestNodejsVersion', 'Getting Node.js release information') - var version = 'v0.0.0' - url = url || 'https://nodejs.org/dist/index.json' - request(url, function (e, res, index) { - tracker.finish() - if (e) return cb(e) - if (res.statusCode !== 200) { - return cb(new Error('Status not 200, ' + res.statusCode)) - } - try { - JSON.parse(index).forEach(function (item) { - if (item.lts && semver.gt(item.version, version)) version = item.version - }) - cb(null, version) - } catch (e) { - cb(e) - } - }) -} - -module.exports = getLatestNodejsVersion diff --git a/deps/npm/lib/doctor/get-latest-npm-version.js b/deps/npm/lib/doctor/get-latest-npm-version.js deleted file mode 100644 index 5a096ab8950699..00000000000000 --- a/deps/npm/lib/doctor/get-latest-npm-version.js +++ /dev/null @@ -1,14 +0,0 @@ -var log = require('npmlog') -var fetchPackageMetadata = require('../fetch-package-metadata') - -function getLatestNpmVersion (cb) { - var tracker = log.newItem('getLatestNpmVersion', 1) - tracker.info('getLatestNpmVersion', 'Getting npm package information') - fetchPackageMetadata('npm@latest', '.', {}, function (err, d) { - tracker.finish() - if (err) { return cb(err) } - cb(null, d.version) - }) -} - -module.exports = getLatestNpmVersion diff --git a/deps/npm/lib/doctor/verify-cached-files.js b/deps/npm/lib/doctor/verify-cached-files.js deleted file mode 100644 index f00dbd6256059c..00000000000000 --- a/deps/npm/lib/doctor/verify-cached-files.js +++ /dev/null @@ -1,19 +0,0 @@ -'use strict' - -const cacache = require('cacache') -const log = require('npmlog') - -module.exports = verifyCachedFiles -function verifyCachedFiles (cache, cb) { - log.info('verifyCachedFiles', `Verifying cache at ${cache}`) - cacache.verify(cache).then((stats) => { - log.info('verifyCachedFiles', `Verification complete. Stats: ${JSON.stringify(stats, 2)}`) - if (stats.reclaimedCount || stats.badContentCount || stats.missingContent) { - stats.badContentCount && log.warn('verifyCachedFiles', `Corrupted content removed: ${stats.badContentCount}`) - stats.reclaimedCount && log.warn('verifyCachedFiles', `Content garbage-collected: ${stats.reclaimedCount} (${stats.reclaimedSize} bytes)`) - stats.missingContent && log.warn('verifyCachedFiles', `Missing content: ${stats.missingContent}`) - log.warn('verifyCachedFiles', 'Cache issues have been fixed') - } - return stats - }).then((s) => cb(null, s), cb) -} diff --git a/deps/npm/lib/exec.js b/deps/npm/lib/exec.js new file mode 100644 index 00000000000000..793abb75a0d01b --- /dev/null +++ b/deps/npm/lib/exec.js @@ -0,0 +1,225 @@ +const npm = require('./npm.js') + +const usageUtil = require('./utils/usage.js') + +const usage = usageUtil('exec', + 'Run a command from a local or remote npm package.\n\n' + + + 'npm exec -- [@] [args...]\n' + + 'npm exec --package=[@] -- [args...]\n' + + 'npm exec -c \' [args...]\'\n' + + 'npm exec --package=foo -c \' [args...]\'\n' + + '\n' + + 'npx [@] [args...]\n' + + 'npx -p [@] [args...]\n' + + 'npx -c \' [args...]\'\n' + + 'npx -p [@] -c \' [args...]\'', + + '\n--package= (may be specified multiple times)\n' + + '-p is a shorthand for --package only when using npx executable\n' + + '-c --call= (may not be mixed with positional arguments)' +) + +const completion = require('./utils/completion/installed-shallow.js') + +const { promisify } = require('util') +const read = promisify(require('read')) + +// it's like this: +// +// npm x pkg@version <-- runs the bin named "pkg" or the only bin if only 1 +// +// { name: 'pkg', bin: { pkg: 'pkg.js', foo: 'foo.js' }} <-- run pkg +// { name: 'pkg', bin: { foo: 'foo.js' }} <-- run foo? +// +// npm x -p pkg@version -- foo +// +// npm x -p pkg@version -- foo --registry=/dev/null +// +// const pkg = npm.flatOptions.package || getPackageFrom(args[0]) +// const cmd = getCommand(pkg, args[0]) +// --> npm x -c 'cmd ...args.slice(1)' +// +// we've resolved cmd and args, and escaped them properly, and installed the +// relevant packages. +// +// Add the ${npx install prefix}/node_modules/.bin to PATH +// +// pkg = readPackageJson('./package.json') +// pkg.scripts.___npx = ${the -c arg} +// runScript({ pkg, event: 'npx', ... }) +// process.env.npm_lifecycle_event = 'npx' + +const mkdirp = require('mkdirp-infer-owner') +const readPackageJson = require('read-package-json-fast') +const Arborist = require('@npmcli/arborist') +const runScript = require('@npmcli/run-script') +const { resolve, delimiter } = require('path') +const crypto = require('crypto') +const pacote = require('pacote') +const npa = require('npm-package-arg') +const escapeArg = require('./utils/escape-arg.js') + +const cmd = (args, cb) => exec(args).then(() => cb()).catch(cb) + +const exec = async args => { + const { package: packages, call } = npm.flatOptions + + if (call && args.length) { + throw usage + } + + const needPackageCommandSwap = args.length && !packages.length + if (needPackageCommandSwap) { + packages.push(args[0]) + } + + // If we do `npm exec foo`, and have a `foo` locally, then we'll + // always use that, so we don't really need to fetch the manifest. + // So: run npa on each packages entry, and if it is a name with a + // rawSpec==='', then try to readPackageJson at + // 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, npm.localPrefix) + if (spec.type === 'tag' && spec.rawSpec === '') { + // fall through to the pacote.manifest() approach + try { + const pj = resolve(npm.localPrefix, 'node_modules', spec.name) + return await readPackageJson(pj) + } catch (er) {} + } + return await pacote.manifest(p, { + ...npm.flatOptions + }) + })) + + if (needPackageCommandSwap) { + args[0] = getBinFromManifest(manis[0]) + } + + // turn list of args into command string + const script = call || args.map(escapeArg).join(' ').trim() + + // figure out whether we need to install stuff, or if local is fine + const localArb = new Arborist({ + ...npm.flatOptions, + path: npm.localPrefix + }) + const tree = await localArb.loadActual() + + // do we have all the packages in manifest list? + const needInstall = manis.some(mani => manifestMissing(tree, mani)) + + const pathArr = [process.env.PATH] + if (needInstall) { + const installDir = cacheInstallDir(packages) + await mkdirp(installDir) + const arb = new Arborist({ ...npm.flatOptions, path: installDir }) + const tree = await arb.loadActual() + + // any that don't match the manifest we have, install them + // add installDir/node_modules/.bin to pathArr + const add = manis.filter(mani => manifestMissing(tree, mani)) + .map(mani => mani._from) + .sort((a, b) => a.localeCompare(b)) + + // no need to install if already present + if (add.length) { + if (!npm.flatOptions.yes) { + // set -n to always say no + if (npm.flatOptions.yes === false) { + throw 'canceled' + } + const addList = add.map(a => ` ${a.replace(/@$/, '')}`) + .join('\n') + '\n' + const prompt = `Need to install the following packages:\n${ + addList + }Ok to proceed? ` + const confirm = await read({ prompt, default: 'y' }) + if (confirm.trim().toLowerCase().charAt(0) !== 'y') { + throw 'canceled' + } + } + await arb.reify({ ...npm.flatOptions, add }) + } + pathArr.unshift(resolve(installDir, 'node_modules/.bin')) + } + + // do the fakey runScript dance + // still should work if no package.json in cwd + const realPkg = await readPackageJson(`${npm.localPrefix}/package.json`) + .catch(() => ({})) + const pkg = { + ...realPkg, + scripts: { + ...(realPkg.scripts || {}), + npx: script + } + } + + npm.log.disableProgress() + try { + return await runScript({ + pkg, + banner: false, + // we always run in cwd, not --prefix + path: process.cwd(), + stdioString: true, + event: 'npx', + env: { + PATH: pathArr.join(delimiter) + }, + stdio: 'inherit' + }) + } finally { + npm.log.enableProgress() + } +} + +const manifestMissing = (tree, mani) => { + // if the tree doesn't have a child by that name/version, return true + // true means we need to install it + const child = tree.children.get(mani.name) + // if no child, we have to load it + if (!child) { + return true + } + // if no version/tag specified, allow whatever's there + if (mani._from === `${mani.name}@`) { + return false + } + // otherwise the version has to match what we WOULD get + return child.version !== mani.version +} + +const getBinFromManifest = mani => { + // if we have a bin matching (unscoped portion of) packagename, use that + // otherwise if there's 1 bin, use that, + // otherwise fail + const bins = Object.entries(mani.bin || {}) + if (bins.length === 1) { + return bins[0][0] + } + // XXX probably a util to parse this better? + const name = mani.name.replace(/^@[^/]+\//, '') + if (mani.bin && mani.bin[name]) { + return name + } + // XXX need better error message + throw Object.assign(new Error('could not determine executable to run'), { + pkgid: mani._id + }) +} + +// only packages not found in ${prefix}/node_modules +const cacheInstallDir = packages => + resolve(npm.config.get('cache'), '_npx', getHash(packages)) + +const getHash = packages => + crypto.createHash('sha512') + .update(packages.sort((a, b) => a.localeCompare(b)).join('\n')) + .digest('hex') + .slice(0, 16) + +module.exports = Object.assign(cmd, { completion, usage }) diff --git a/deps/npm/lib/explain.js b/deps/npm/lib/explain.js new file mode 100644 index 00000000000000..46f0d0c9829958 --- /dev/null +++ b/deps/npm/lib/explain.js @@ -0,0 +1,100 @@ +const usageUtil = require('./utils/usage.js') +const npm = require('./npm.js') +const { explainNode } = require('./utils/explain-dep.js') +const completion = require('./utils/completion/installed-deep.js') +const output = require('./utils/output.js') +const Arborist = require('@npmcli/arborist') +const npa = require('npm-package-arg') +const semver = require('semver') +const { relative, resolve } = require('path') +const validName = require('validate-npm-package-name') + +const usage = usageUtil('explain', 'npm explain ') + +const cmd = (args, cb) => explain(args).then(() => cb()).catch(cb) + +const explain = async (args) => { + if (!args.length) { + throw usage + } + + const arb = new Arborist({ path: npm.prefix, ...npm.flatOptions }) + const tree = await arb.loadActual() + + const nodes = new Set() + for (const arg of args) { + for (const node of getNodes(tree, arg)) { + nodes.add(node) + } + } + if (nodes.size === 0) { + throw `No dependencies found matching ${args.join(', ')}` + } + + const expls = [] + for (const node of nodes) { + const { extraneous, dev, optional, devOptional, peer } = node + const expl = node.explain() + if (extraneous) { + expl.extraneous = true + } else { + expl.dev = dev + expl.optional = optional + expl.devOptional = devOptional + expl.peer = peer + } + expls.push(expl) + } + + if (npm.flatOptions.json) { + output(JSON.stringify(expls, null, 2)) + } else { + output(expls.map(expl => { + return explainNode(expl, Infinity, npm.color) + }).join('\n\n')) + } +} + +const getNodes = (tree, arg) => { + // if it's just a name, return packages by that name + const { validForOldPackages: valid } = validName(arg) + if (valid) { + return tree.inventory.query('name', arg) + } + + // if it's a location, get that node + const maybeLoc = arg.replace(/\\/g, '/').replace(/\/+$/, '') + const nodeByLoc = tree.inventory.get(maybeLoc) + if (nodeByLoc) { + return [nodeByLoc] + } + + // maybe a path to a node_modules folder + const maybePath = relative(npm.prefix, resolve(maybeLoc)) + .replace(/\\/g, '/').replace(/\/+$/, '') + const nodeByPath = tree.inventory.get(maybePath) + if (nodeByPath) { + return [nodeByPath] + } + + // otherwise, try to select all matching nodes + try { + return getNodesByVersion(tree, arg) + } catch (er) { + return [] + } +} + +const getNodesByVersion = (tree, arg) => { + const spec = npa(arg, npm.prefix) + if (spec.type !== 'version' && spec.type !== 'range') { + return [] + } + + return tree.inventory.filter(node => { + return node.package.name === spec.name && + semver.satisfies(node.package.version, spec.rawSpec) + }) +} + +module.exports = Object.assign(cmd, { usage, completion }) diff --git a/deps/npm/lib/explore.js b/deps/npm/lib/explore.js index 32c93d6553ac96..cbc30ba093972e 100644 --- a/deps/npm/lib/explore.js +++ b/deps/npm/lib/explore.js @@ -1,60 +1,66 @@ // npm explore [@] // open a subshell to the package folder. -module.exports = explore -explore.usage = 'npm explore [ -- ]' -explore.completion = require('./utils/completion/installed-shallow.js') - -var npm = require('./npm.js') -var spawn = require('./utils/spawn') -var path = require('path') -var fs = require('graceful-fs') -var isWindows = require('./utils/is-windows.js') -var escapeExecPath = require('./utils/escape-exec-path.js') -var escapeArg = require('./utils/escape-arg.js') -var output = require('./utils/output.js') -var log = require('npmlog') - -function explore (args, cb) { - if (args.length < 1 || !args[0]) return cb(explore.usage) - var p = args.shift() - - var cwd = path.resolve(npm.dir, p) - var opts = {cwd: cwd, stdio: 'inherit'} - - var shellArgs = [] +const usageUtil = require('./utils/usage.js') +const completion = require('./utils/completion/installed-shallow.js') +const usage = usageUtil('explore', 'npm explore [ -- ]') + +const cmd = (args, cb) => explore(args).then(() => cb()).catch(cb) + +const output = require('./utils/output.js') +const npm = require('./npm.js') +const isWindows = require('./utils/is-windows.js') +const escapeArg = require('./utils/escape-arg.js') +const escapeExecPath = require('./utils/escape-exec-path.js') +const log = require('npmlog') + +const spawn = require('@npmcli/promise-spawn') + +const { resolve } = require('path') +const { promisify } = require('util') +const stat = promisify(require('fs').stat) + +const explore = async args => { + if (args.length < 1 || !args[0]) { + throw usage + } + + const pkg = args.shift() + const cwd = resolve(npm.dir, pkg) + const opts = { cwd, stdio: 'inherit', stdioString: true } + + const shellArgs = [] if (args.length) { if (isWindows) { - var execCmd = escapeExecPath(args.shift()) - var execArgs = [execCmd].concat(args.map(escapeArg)) + const execCmd = escapeExecPath(args.shift()) opts.windowsVerbatimArguments = true - shellArgs = ['/d', '/s', '/c'].concat(execArgs) + shellArgs.push('/d', '/s', '/c', execCmd, ...args.map(escapeArg)) } else { - shellArgs = ['-c', args.map(escapeArg).join(' ').trim()] + shellArgs.push('-c', args.map(escapeArg).join(' ').trim()) } } - var sh = npm.config.get('shell') - fs.stat(cwd, function (er, s) { - if (er || !s.isDirectory()) { - return cb(new Error( - "It doesn't look like " + p + ' is installed.' - )) - } + await stat(cwd).catch(er => { + throw new Error(`It doesn't look like ${pkg} is installed.`) + }) - if (!shellArgs.length) { - output( - '\nExploring ' + cwd + '\n' + - "Type 'exit' or ^D when finished\n" - ) - } + const sh = npm.flatOptions.shell + log.disableProgress() - log.silly('explore', {sh, shellArgs, opts}) - var shell = spawn(sh, shellArgs, opts) - shell.on('close', function (er) { - // only fail if non-interactive. - if (!shellArgs.length) return cb() - cb(er) - }) - }) + if (!shellArgs.length) { + output(`\nExploring ${cwd}\nType 'exit' or ^D when finished\n`) + } + + log.silly('explore', { sh, shellArgs, opts }) + + // only noisily fail if non-interactive, but still keep exit code intact + const proc = spawn(sh, shellArgs, opts) + try { + const res = await (shellArgs.length ? proc : proc.catch(er => er)) + process.exitCode = res.code + } finally { + log.enableProgress() + } } + +module.exports = Object.assign(cmd, { completion, usage }) diff --git a/deps/npm/lib/fetch-package-metadata.js b/deps/npm/lib/fetch-package-metadata.js deleted file mode 100644 index ebb378647b86bd..00000000000000 --- a/deps/npm/lib/fetch-package-metadata.js +++ /dev/null @@ -1,122 +0,0 @@ -'use strict' - -const deprCheck = require('./utils/depr-check') -const path = require('path') -const log = require('npmlog') -const pacote = require('pacote') -const readPackageTree = require('read-package-tree') -const rimraf = require('rimraf') -const validate = require('aproba') -const npa = require('npm-package-arg') -const npm = require('./npm') -let npmConfig -const npmlog = require('npmlog') -const limit = require('call-limit') -const tempFilename = require('./utils/temp-filename.js') -const replaceInfo = require('./utils/replace-info.js') -const isWindows = require('./utils/is-windows.js') - -function andLogAndFinish (spec, tracker, done) { - validate('SOF|SZF|OOF|OZF', [spec, tracker, done]) - return (er, pkg) => { - if (er) { - er.message = replaceInfo(er.message) - var spc = replaceInfo(String(spec)) - log.silly('fetchPackageMetaData', 'error for ' + spc, er.message) - if (tracker) tracker.finish() - } - return done(er, pkg) - } -} - -const LRUCache = require('lru-cache') -const CACHE = new LRUCache({ - max: 300 * 1024 * 1024, - length: (p) => p._contentLength -}) - -module.exports = limit(fetchPackageMetadata, npm.limit.fetch) -function fetchPackageMetadata (spec, where, opts, done) { - validate('SSOF|SSFZ|OSOF|OSFZ', [spec, where, opts, done]) - - if (!done) { - done = opts - opts = {} - } - var tracker = opts.tracker - const logAndFinish = andLogAndFinish(spec, tracker, done) - - if (typeof spec === 'object') { - var dep = spec - } else { - dep = npa(spec) - } - if (!isWindows && dep.type === 'directory' && /^[a-zA-Z]:/.test(dep.fetchSpec)) { - var err = new Error(`Can't install from windows path on a non-windows system: ${dep.fetchSpec.replace(/[/]/g, '\\')}`) - err.code = 'EWINDOWSPATH' - return logAndFinish(err) - } - if (!npmConfig) { - npmConfig = require('./config/figgy-config.js') - } - pacote.manifest(dep, npmConfig({ - annotate: true, - fullMetadata: opts.fullMetadata, - log: tracker || npmlog, - memoize: CACHE, - where: where - })).then( - (pkg) => logAndFinish(null, deprCheck(pkg)), - (err) => { - if (dep.type !== 'directory') return logAndFinish(err) - if (err.code === 'ENOTDIR') { - var enolocal = new Error(`Could not install "${path.relative(process.cwd(), dep.fetchSpec)}" as it is not a directory and is not a file with a name ending in .tgz, .tar.gz or .tar`) - enolocal.code = 'ENOLOCAL' - if (err.stack) enolocal.stack = err.stack - return logAndFinish(enolocal) - } else if (err.code === 'ENOPACKAGEJSON') { - var enopackage = new Error(`Could not install from "${path.relative(process.cwd(), dep.fetchSpec)}" as it does not contain a package.json file.`) - enopackage.code = 'ENOLOCAL' - if (err.stack) enopackage.stack = err.stack - return logAndFinish(enopackage) - } else { - return logAndFinish(err) - } - } - ) -} - -module.exports.addBundled = addBundled -function addBundled (pkg, next) { - validate('OF', arguments) - if (pkg._bundled !== undefined) return next(null, pkg) - - if (!pkg.bundleDependencies && pkg._requested.type !== 'directory') return next(null, pkg) - const requested = pkg._requested || npa(pkg._from) - if (requested.type === 'directory') { - pkg._bundled = null - return readPackageTree(pkg._requested.fetchSpec, function (er, tree) { - if (tree) pkg._bundled = tree.children - return next(null, pkg) - }) - } - pkg._bundled = null - const target = tempFilename('unpack') - if (!npmConfig) { - npmConfig = require('./config/figgy-config.js') - } - const opts = npmConfig({integrity: pkg._integrity}) - pacote.extract(pkg._resolved || pkg._requested || npa.resolve(pkg.name, pkg.version), target, opts).then(() => { - log.silly('addBundled', 'read tarball') - readPackageTree(target, (err, tree) => { - if (err) { return next(err) } - log.silly('cleanup', 'remove extracted module') - rimraf(target, function () { - if (tree) { - pkg._bundled = tree.children - } - next(null, pkg) - }) - }) - }, next) -} diff --git a/deps/npm/lib/fetch-package-metadata.md b/deps/npm/lib/fetch-package-metadata.md deleted file mode 100644 index 7b4562341b1cb4..00000000000000 --- a/deps/npm/lib/fetch-package-metadata.md +++ /dev/null @@ -1,37 +0,0 @@ -fetch-package-metadata ----------------------- - - const fetchPackageMetadata = require("npm/lib/fetch-package-metadata") - fetchPackageMetadata(spec, contextdir, callback) - -This will get package metadata (and if possible, ONLY package metadata) for -a specifier as passed to `npm install` et al, eg `npm@next` or `npm@^2.0.3` - -## fetchPackageMetadata(*spec*, *contextdir*, *tracker*, *callback*) - -* *spec* **string** | **object** -- The package specifier, can be anything npm can - understand (see [realize-package-specifier]), or it can be the result from - realize-package-specifier or npm-package-arg (for non-local deps). - -* *contextdir* **string** -- The directory from which relative paths to - local packages should be resolved. - -* *tracker* **object** -- **(optional)** An are-we-there-yet tracker group as - provided by `npm.log.newGroup()`. - -* *callback* **function (er, package)** -- Called when the package information - has been loaded. `package` is the object for of the `package.json` - matching the requested spec. In the case of named packages, it comes from - the registry and thus may not exactly match what's found in the associated - tarball. - -[realize-package-specifier]: (https://github.com/npm/realize-package-specifier) - -In the case of tarballs and git repos, it will use the cache to download -them in order to get the package metadata. For named packages, only the -metadata is downloaded (eg https://registry.npmjs.org/package). For local -directories, the package.json is read directly. For local tarballs, the -tarball is streamed in memory and just the package.json is extracted from -it. (Due to the nature of tars, having the package.json early in the file -will result in it being loaded faster– the extractor short-circuits the -uncompress/untar streams as best as it can.) diff --git a/deps/npm/lib/find-dupes.js b/deps/npm/lib/find-dupes.js new file mode 100644 index 00000000000000..95791637821446 --- /dev/null +++ b/deps/npm/lib/find-dupes.js @@ -0,0 +1,9 @@ +// dedupe duplicated packages, or find them in the tree +const dedupe = require('./dedupe.js') +const usageUtil = require('./utils/usage.js') + +const usage = usageUtil('find-dupes', 'npm find-dupes') +const completion = require('./utils/completion/none.js') +const cmd = (args, cb) => dedupe({ dryRun: true }, cb) + +module.exports = Object.assign(cmd, { usage, completion }) diff --git a/deps/npm/lib/fund.js b/deps/npm/lib/fund.js index e605ea8c3fd039..d1c58d9b954c61 100644 --- a/deps/npm/lib/fund.js +++ b/deps/npm/lib/fund.js @@ -1,128 +1,177 @@ -'use strict' - -const path = require('path') - const archy = require('archy') -const figgyPudding = require('figgy-pudding') -const readPackageTree = require('read-package-tree') +const Arborist = require('@npmcli/arborist') +const chalk = require('chalk') +const pacote = require('pacote') +const semver = require('semver') +const npa = require('npm-package-arg') +const { depth } = require('treeverse') +const { + readTree: getFundingInfo, + normalizeFunding, + isValidFunding +} = require('libnpmfund') const npm = require('./npm.js') -const npmConfig = require('./config/figgy-config.js') -const fetchPackageMetadata = require('./fetch-package-metadata.js') -const computeMetadata = require('./install/deps.js').computeMetadata -const readShrinkwrap = require('./install/read-shrinkwrap.js') -const mutateIntoLogicalTree = require('./install/mutate-into-logical-tree.js') +const completion = require('./utils/completion/installed-deep.js') const output = require('./utils/output.js') const openUrl = require('./utils/open-url.js') -const { getFundingInfo, retrieveFunding, validFundingField, flatCacheSymbol } = require('./utils/funding.js') - -const FundConfig = figgyPudding({ - browser: {}, // used by ./utils/open-url - global: {}, - json: {}, - unicode: {}, - which: {} -}) - -module.exports = fundCmd +const usageUtil = require('./utils/usage.js') -const usage = require('./utils/usage') -fundCmd.usage = usage( +const usage = usageUtil( 'fund', - 'npm fund [--json]', - 'npm fund [--browser] [[<@scope>/] [--which=]' + 'npm fund', + 'npm fund [--json] [--browser] [--unicode] [[<@scope>/] [--which=]' ) -fundCmd.completion = function (opts, cb) { - const argv = opts.conf.argv.remain - switch (argv[2]) { - case 'fund': - return cb(null, []) - default: - return cb(new Error(argv[2] + ' not recognized')) - } -} +const cmd = (args, cb) => fund(args).then(() => cb()).catch(cb) function printJSON (fundingInfo) { return JSON.stringify(fundingInfo, null, 2) } -// the human-printable version does some special things that turned out to -// be very verbose but hopefully not hard to follow: we stack up items -// that have a shared url/type and make sure they're printed at the highest -// level possible, in that process they also carry their dependencies along -// with them, moving those up in the visual tree -function printHuman (fundingInfo, opts) { - const flatCache = fundingInfo[flatCacheSymbol] - - const { name, version } = fundingInfo +const getPrintableName = ({ name, version }) => { const printableVersion = version ? `@${version}` : '' + return `${name}${printableVersion}` +} - const items = Object.keys(flatCache).map((url) => { - const deps = flatCache[url] - - const packages = deps.map((dep) => { - const { name, version } = dep - - const printableVersion = version ? `@${version}` : '' - return `${name}${printableVersion}` - }) - - return { - label: url, - nodes: [packages.join(', ')] - } +function printHuman (fundingInfo, { color, unicode }) { + const seenUrls = new Map() + + const tree = obj => + archy(obj, '', { unicode }) + + const result = depth({ + tree: fundingInfo, + + // composes human readable package name + // and creates a new archy item for readable output + visit: ({ name, version, funding }) => { + const [fundingSource] = [] + .concat(normalizeFunding(funding)) + .filter(isValidFunding) + const { url } = fundingSource || {} + const pkgRef = getPrintableName({ name, version }) + let item = { + label: pkgRef + } + + if (url) { + item.label = tree({ + label: color ? chalk.bgBlack.white(url) : url, + nodes: [pkgRef] + }).trim() + + // stacks all packages together under the same item + if (seenUrls.has(url)) { + item = seenUrls.get(url) + item.label += `, ${pkgRef}` + return null + } else { + seenUrls.set(url, item) + } + } + + return item + }, + + // puts child nodes back into returned archy + // output while also filtering out missing items + leave: (item, children) => { + if (item) { item.nodes = children.filter(Boolean) } + + return item + }, + + // turns tree-like object return by libnpmfund + // into children to be properly read by treeverse + getChildren: (node) => + Object.keys(node.dependencies || {}) + .map(key => ({ + name: key, + ...node.dependencies[key] + })) }) - return archy({ label: `${name}${printableVersion}`, nodes: items }, '', { unicode: opts.unicode }) + const res = tree(result) + return color ? chalk.reset(res) : res } -function openFundingUrl (packageName, fundingSourceNumber, cb) { - function getUrlAndOpen (packageMetadata) { - const { funding } = packageMetadata - const validSources = [].concat(retrieveFunding(funding)).filter(validFundingField) +async function openFundingUrl ({ path, tree, spec, fundingSourceNumber }) { + const arg = npa(spec, path) + const retrievePackageMetadata = () => { + if (arg.type === 'directory') { + if (tree.path === arg.fetchSpec) { + // matches cwd, e.g: npm fund . + return tree.package + } else { + // matches any file path within current arborist inventory + for (const item of tree.inventory.values()) { + if (item.path === arg.fetchSpec) { + return item.package + } + } + } + } else { + // tries to retrieve a package from arborist inventory + // by matching resulted package name from the provided spec + const [item] = [...tree.inventory.query('name', arg.name)] + .filter(i => semver.valid(i.package.version)) + .sort((a, b) => semver.rcompare(a.package.version, b.package.version)) + + if (item) { + return item.package + } + } + } - if (validSources.length === 1 || (fundingSourceNumber > 0 && fundingSourceNumber <= validSources.length)) { - const { type, url } = validSources[fundingSourceNumber ? fundingSourceNumber - 1 : 0] + const { funding } = retrievePackageMetadata() || + await pacote.manifest(arg, npm.flatOptions).catch(() => ({})) + + const validSources = [] + .concat(normalizeFunding(funding)) + .filter(isValidFunding) + + const matchesValidSource = + validSources.length === 1 || + (fundingSourceNumber > 0 && fundingSourceNumber <= validSources.length) + + if (matchesValidSource) { + const index = fundingSourceNumber ? fundingSourceNumber - 1 : 0 + const { type, url } = validSources[index] + const typePrefix = type ? `${type} funding` : 'Funding' + const msg = `${typePrefix} available at the following URL` + return new Promise((resolve, reject) => + openUrl(url, msg, err => err + ? reject(err) + : resolve() + )) + } else if (validSources.length && !(fundingSourceNumber >= 1)) { + validSources.forEach(({ type, url }, i) => { const typePrefix = type ? `${type} funding` : 'Funding' const msg = `${typePrefix} available at the following URL` - openUrl(url, msg, cb) - } else if (!(fundingSourceNumber >= 1)) { - validSources.forEach(({ type, url }, i) => { - const typePrefix = type ? `${type} funding` : 'Funding' - const msg = `${typePrefix} available at the following URL` - console.log(`${i + 1}: ${msg}: ${url}`) - }) - console.log('Run `npm fund [<@scope>/] --which=1`, for example, to open the first funding URL listed in that package') - cb() - } else { - const noFundingError = new Error(`No valid funding method available for: ${packageName}`) - noFundingError.code = 'ENOFUND' + output(`${i + 1}: ${msg}: ${url}`) + }) + output('Run `npm fund [<@scope>/] --which=1`, for example, to open the first funding URL listed in that package') + } else { + const noFundingError = new Error(`No valid funding method available for: ${spec}`) + noFundingError.code = 'ENOFUND' - throw noFundingError - } + throw noFundingError } - - fetchPackageMetadata( - packageName, - '.', - { fullMetadata: true }, - function (err, packageMetadata) { - if (err) return cb(err) - getUrlAndOpen(packageMetadata) - } - ) } -function fundCmd (args, cb) { - const opts = FundConfig(npmConfig()) - const dir = path.resolve(npm.dir, '..') - const packageName = args[0] +const fund = async (args) => { + const opts = npm.flatOptions + const spec = args[0] const numberArg = opts.which const fundingSourceNumber = numberArg && parseInt(numberArg, 10) - if (numberArg !== undefined && (String(fundingSourceNumber) !== numberArg || fundingSourceNumber < 1)) { + const badFundingSourceNumber = + numberArg !== undefined && + (String(fundingSourceNumber) !== numberArg || fundingSourceNumber < 1) + + if (badFundingSourceNumber) { const err = new Error('`npm fund [<@scope>/] [--which=fundingSourceNumber]` must be given a positive integer') err.code = 'EFUNDNUMBER' throw err @@ -134,35 +183,30 @@ function fundCmd (args, cb) { throw err } - if (packageName) { - openFundingUrl(packageName, fundingSourceNumber, cb) + const where = npm.prefix + const arb = new Arborist({ ...opts, path: where }) + const tree = await arb.loadActual() + + if (spec) { + await openFundingUrl({ + path: where, + tree, + spec, + fundingSourceNumber + }) return } - readPackageTree(dir, function (err, tree) { - if (err) { - process.exitCode = 1 - return cb(err) - } + const print = opts.json + ? printJSON + : printHuman - readShrinkwrap.andInflate(tree, function () { - const fundingInfo = getFundingInfo( - mutateIntoLogicalTree.asReadInstalled( - computeMetadata(tree) - ) - ) - - const print = opts.json - ? printJSON - : printHuman - - output( - print( - fundingInfo, - opts - ) - ) - cb(err, tree) - }) - }) + output( + print( + getFundingInfo(tree), + opts + ) + ) } + +module.exports = Object.assign(cmd, { usage, completion }) diff --git a/deps/npm/lib/get.js b/deps/npm/lib/get.js index 8dc805ec560c31..bccdc72121f4b1 100644 --- a/deps/npm/lib/get.js +++ b/deps/npm/lib/get.js @@ -1,12 +1,14 @@ +const npm = require('./npm.js') +const usageUtil = require('./utils/usage.js') -module.exports = get +const usage = usageUtil( + 'get', + 'npm get (See `npm config`)' +) -get.usage = 'npm get (See `npm config`)' +const completion = npm.commands.config.completion -var npm = require('./npm.js') - -get.completion = npm.commands.config.completion - -function get (args, cb) { +const cmd = (args, cb) => npm.commands.config(['get'].concat(args), cb) -} + +module.exports = Object.assign(cmd, { usage, completion }) diff --git a/deps/npm/lib/help-search.js b/deps/npm/lib/help-search.js index 475f305e49103c..6d8cf60069ecb2 100644 --- a/deps/npm/lib/help-search.js +++ b/deps/npm/lib/help-search.js @@ -1,77 +1,73 @@ +const fs = require('fs') +const path = require('path') +const npm = require('./npm.js') +const glob = require('glob') +const color = require('ansicolors') +const output = require('./utils/output.js') +const usageUtil = require('./utils/usage.js') +const { promisify } = require('util') +const readFile = promisify(fs.readFile) +const didYouMean = require('./utils/did-you-mean.js') +const { cmdList } = require('./utils/cmd-list.js') + +const usage = usageUtil('help-search', 'npm help-search ') +const completion = require('./utils/completion/none.js') + +const npmUsage = require('./utils/npm-usage.js') + +const cmd = (args, cb) => helpSearch(args).then(() => cb()).catch(cb) + +const helpSearch = async args => { + if (!args.length) { + throw usage + } -module.exports = helpSearch - -var fs = require('graceful-fs') -var path = require('path') -var asyncMap = require('slide').asyncMap -var npm = require('./npm.js') -var glob = require('glob') -var color = require('ansicolors') -var output = require('./utils/output.js') + const docPath = path.resolve(__dirname, '..', 'docs/content') -helpSearch.usage = 'npm help-search ' + // XXX: make glob return a promise and remove this wrapping + const files = await new Promise((res, rej) => + glob(`${docPath}/*/*.md`, (er, files) => er ? rej(er) : res(files))) -function helpSearch (args, silent, cb) { - if (typeof cb !== 'function') { - cb = silent - silent = false + const data = await readFiles(files) + const results = await searchFiles(args, data, files) + const formatted = formatResults(args, results) + if (!formatted.trim()) { + npmUsage(false) + } else { + output(formatted) + output(didYouMean(args[0], cmdList)) } - if (!args.length) return cb(helpSearch.usage) - - var docPath = path.resolve(__dirname, '..', 'doc') - return glob(docPath + '/*/*.md', function (er, files) { - if (er) return cb(er) - readFiles(files, function (er, data) { - if (er) return cb(er) - searchFiles(args, data, function (er, results) { - if (er) return cb(er) - formatResults(args, results, cb) - }) - }) - }) } -function readFiles (files, cb) { - var res = {} - asyncMap(files, function (file, cb) { - fs.readFile(file, 'utf8', function (er, data) { - res[file] = data - return cb(er) - }) - }, function (er) { - return cb(er, res) - }) +const readFiles = async files => { + const res = {} + await Promise.all(files.map(async file => { + res[file] = (await readFile(file, 'utf8')) + .replace(/^---\n(.*\n)*?---\n/, '').trim() + })) + return res } -function searchFiles (args, files, cb) { - var results = [] - Object.keys(files).forEach(function (file) { - var data = files[file] - +const searchFiles = async (args, data, files) => { + const results = [] + for (const [file, content] of Object.entries(data)) { + const lowerCase = content.toLowerCase() // skip if no matches at all - var match - for (var a = 0, l = args.length; a < l && !match; a++) { - match = data.toLowerCase().indexOf(args[a].toLowerCase()) !== -1 + if (!args.some(a => lowerCase.includes(a.toLowerCase()))) { + continue } - if (!match) return - var lines = data.split(/\n+/) + const lines = content.split(/\n+/) // if a line has a search term, then skip it and the next line. // if the next line has a search term, then skip all 3 // otherwise, set the line to null. then remove the nulls. - l = lines.length - for (var i = 0; i < l; i++) { - var line = lines[i] - var nextLine = lines[i + 1] - var ll - - match = false + for (let i = 0; i < lines.length; i++) { + const line = lines[i] + const nextLine = lines[i + 1] + let match = false if (nextLine) { - for (a = 0, ll = args.length; a < ll && !match; a++) { - match = nextLine.toLowerCase() - .indexOf(args[a].toLowerCase()) !== -1 - } + match = args.some(a => nextLine.toLowerCase().includes(a.toLowerCase())) if (match) { // skip over the next line, and the line after it. i += 2 @@ -79,10 +75,8 @@ function searchFiles (args, files, cb) { } } - match = false - for (a = 0, ll = args.length; a < ll && !match; a++) { - match = line.toLowerCase().indexOf(args[a].toLowerCase()) !== -1 - } + match = args.some(a => line.toLowerCase().includes(a.toLowerCase())) + if (match) { // skip over the next line i++ @@ -93,120 +87,128 @@ function searchFiles (args, files, cb) { } // now squish any string of nulls into a single null - lines = lines.reduce(function (l, r) { - if (!(r === null && l[l.length - 1] === null)) l.push(r) + const pruned = lines.reduce((l, r) => { + if (!(r === null && l[l.length - 1] === null)) { + l.push(r) + } return l }, []) - if (lines[lines.length - 1] === null) lines.pop() - if (lines[0] === null) lines.shift() + if (pruned[pruned.length - 1] === null) { + pruned.pop() + } + if (pruned[0] === null) { + pruned.shift() + } - // now see how many args were found at all. - var found = {} - var totalHits = 0 - lines.forEach(function (line) { - args.forEach(function (arg) { - var hit = (line || '').toLowerCase() + // now count how many args were found + const found = {} + let totalHits = 0 + for (const line of pruned) { + for (const arg of args) { + const hit = (line || '').toLowerCase() .split(arg.toLowerCase()).length - 1 + if (hit > 0) { found[arg] = (found[arg] || 0) + hit totalHits += hit } - }) - }) - - var cmd = 'npm help ' - if (path.basename(path.dirname(file)) === 'api') { - cmd = 'npm apihelp ' + } } - cmd += path.basename(file, '.md').replace(/^npm-/, '') + + const cmd = 'npm help ' + + path.basename(file, '.md').replace(/^npm-/, '') results.push({ - file: file, - cmd: cmd, - lines: lines, + file, + cmd, + lines: pruned, found: Object.keys(found), hits: found, - totalHits: totalHits + totalHits }) - }) + } // if only one result, then just show that help section. if (results.length === 1) { - return npm.commands.help([results[0].file.replace(/\.md$/, '')], cb) - } - - if (results.length === 0) { - output('No results for ' + args.map(JSON.stringify).join(' ')) - return cb() + npm.commands.help([results[0].file.replace(/\.md$/, '')], er => { + if (er) { + throw er + } + }) + return [] } // sort results by number of results found, then by number of hits // then by number of matching lines - results = results.sort(function (a, b) { - return a.found.length > b.found.length ? -1 - : a.found.length < b.found.length ? 1 - : a.totalHits > b.totalHits ? -1 - : a.totalHits < b.totalHits ? 1 - : a.lines.length > b.lines.length ? -1 - : a.lines.length < b.lines.length ? 1 - : 0 - }) - - cb(null, results) + return results.sort((a, b) => + a.found.length > b.found.length ? -1 + : a.found.length < b.found.length ? 1 + : a.totalHits > b.totalHits ? -1 + : a.totalHits < b.totalHits ? 1 + : a.lines.length > b.lines.length ? -1 + : a.lines.length < b.lines.length ? 1 + : 0).slice(0, 10) } -function formatResults (args, results, cb) { - if (!results) return cb(null) - - var cols = Math.min(process.stdout.columns || Infinity, 80) + 1 - - var out = results.map(function (res) { - var out = res.cmd - var r = Object.keys(res.hits) - .map(function (k) { - return k + ':' + res.hits[k] - }).sort(function (a, b) { - return a > b ? 1 : -1 - }).join(' ') - - out += ((new Array(Math.max(1, cols - out.length - r.length))) - .join(' ')) + r +const formatResults = (args, results) => { + if (!results) { + return 'No results for ' + args.map(JSON.stringify).join(' ') + } - if (!npm.config.get('long')) return out + const cols = Math.min(process.stdout.columns || Infinity, 80) + 1 - out = '\n\n' + out + '\n' + - (new Array(cols)).join('—') + '\n' + - res.lines.map(function (line, i) { - if (line === null || i > 3) return '' - for (var out = line, a = 0, l = args.length; a < l; a++) { - var finder = out.toLowerCase().split(args[a].toLowerCase()) - var newOut = '' - var p = 0 + const out = results.map(res => { + const out = [res.cmd] + const r = Object.keys(res.hits) + .map(k => `${k}:${res.hits[k]}`) + .sort((a, b) => a > b ? 1 : -1) + .join(' ') - finder.forEach(function (f) { - newOut += out.substr(p, f.length) + out.push(' '.repeat((Math.max(1, cols - out.join(' ').length - r.length - 1)))) + out.push(r) - var hilit = out.substr(p + f.length, args[a].length) - if (npm.color) hilit = color.bgBlack(color.red(hilit)) - newOut += hilit + if (!npm.flatOptions.long) { + return out.join('') + } - p += f.length + args[a].length - }) + out.unshift('\n\n') + out.push('\n') + out.push('-'.repeat(cols - 1) + '\n') + res.lines.forEach((line, i) => { + if (line === null || i > 3) { + return + } + if (!npm.color) { + out.push(line + '\n') + return + } + const hilitLine = [] + for (const arg of args) { + const finder = line.toLowerCase().split(arg.toLowerCase()) + let p = 0 + for (const f of finder) { + hilitLine.push(line.substr(p, f.length)) + const word = line.substr(p + f.length, arg.length) + const hilit = color.bgBlack(color.red(word)) + hilitLine.push(hilit) + p += f.length + arg.length } + } + out.push(hilitLine.join('') + '\n') + }) - return newOut - }).join('\n').trim() - return out + return out.join('') }).join('\n') - if (results.length && !npm.config.get('long')) { - out = 'Top hits for ' + (args.map(JSON.stringify).join(' ')) + '\n' + - (new Array(cols)).join('—') + '\n' + - out + '\n' + - (new Array(cols)).join('—') + '\n' + - '(run with -l or --long to see more context)' - } + const finalOut = results.length && !npm.flatOptions.long + ? 'Top hits for ' + (args.map(JSON.stringify).join(' ')) + '\n' + + '—'.repeat(cols - 1) + '\n' + + out + '\n' + + '—'.repeat(cols - 1) + '\n' + + '(run with -l or --long to see more context)' + : out - output(out.trim()) - cb(null, results) + return finalOut.trim() } + +module.exports = Object.assign(cmd, { usage, completion }) diff --git a/deps/npm/lib/help.js b/deps/npm/lib/help.js index 61f1f3f94cc66c..1719e34e4234ae 100644 --- a/deps/npm/lib/help.js +++ b/deps/npm/lib/help.js @@ -6,20 +6,21 @@ help.completion = function (opts, cb) { getSections(cb) } +const npmUsage = require('./utils/npm-usage.js') var path = require('path') var spawn = require('./utils/spawn') var npm = require('./npm.js') var log = require('npmlog') var openUrl = require('./utils/open-url') var glob = require('glob') -var didYouMean = require('./utils/did-you-mean') -var cmdList = require('./config/cmd-list').cmdList -var shorthands = require('./config/cmd-list').shorthands -var commands = cmdList.concat(Object.keys(shorthands)) var output = require('./utils/output.js') +const usage = require('./utils/usage.js') + +help.usage = usage('help', 'npm help []') + function help (args, cb) { - var argv = npm.config.get('argv').cooked + var argv = npm.config.parsedArgv.cooked var argnum = 0 if (args.length === 2 && ~~args[0]) { @@ -28,15 +29,18 @@ function help (args, cb) { // npm help foo bar baz: search topics if (args.length > 1 && args[0]) { - return npm.commands['help-search'](args, argnum, cb) + return npm.commands['help-search'](args, cb) } - var section = npm.deref(args[0]) || args[0] + const affordances = { + 'find-dupes': 'dedupe' + } + var section = affordances[args[0]] || npm.deref(args[0]) || args[0] // npm help : show basic usage if (!section) { - var valid = argv[0] === 'help' ? 0 : 1 - return npmUsage(valid, cb) + npmUsage(argv[0] === 'help') + return cb() } // npm -h: show command usage @@ -49,11 +53,9 @@ function help (args, cb) { return cb() } - // npm apihelp
    : Prefer section 3 over section 1 - var apihelp = argv.length && argv[0].indexOf('api') !== -1 - var pref = apihelp ? [3, 1, 5, 7] : [1, 3, 5, 7] + var pref = [1, 5, 7] if (argnum) { - pref = [ argnum ].concat(pref.filter(function (n) { + pref = [argnum].concat(pref.filter(function (n) { return n !== argnum })) } @@ -98,7 +100,7 @@ function pickMan (mans, pref_) { var bn = b.match(nre)[1] return an === bn ? (a > b ? -1 : 1) : pref[an] < pref[bn] ? -1 - : 1 + : 1 }) return mans[0] } @@ -154,79 +156,7 @@ function htmlMan (man) { default: throw new Error('invalid man section: ' + sect) } - return path.resolve(__dirname, '..', 'docs', 'public', sect, f, 'index.html') -} - -function npmUsage (valid, cb) { - npm.config.set('loglevel', 'silent') - log.level = 'silent' - output([ - '\nUsage: npm ', - '', - 'where is one of:', - npm.config.get('long') ? usages() - : ' ' + wrap(commands), - '', - 'npm -h quick help on ', - 'npm -l display full usage info', - 'npm help search for help on ', - 'npm help npm involved overview', - '', - 'Specify configs in the ini-formatted file:', - ' ' + npm.config.get('userconfig'), - 'or on the command line via: npm --key value', - 'Config info can be viewed via: npm help config', - '', - 'npm@' + npm.version + ' ' + path.dirname(__dirname) - ].join('\n')) - - if (npm.argv.length > 1) { - output(didYouMean(npm.argv[1], commands)) - } - - cb(valid) -} - -function usages () { - // return a string of : - var maxLen = 0 - return Object.keys(npm.commands).filter(function (c) { - return c === npm.deref(c) - }).reduce(function (set, c) { - set.push([c, npm.commands[c].usage || '']) - maxLen = Math.max(maxLen, c.length) - return set - }, []).map(function (item) { - var c = item[0] - var usage = item[1] - return '\n ' + - c + (new Array(maxLen - c.length + 2).join(' ')) + - (usage.split('\n').join('\n' + (new Array(maxLen + 6).join(' ')))) - }).join('\n') -} - -function wrap (arr) { - var out = [''] - var l = 0 - var line - - line = process.stdout.columns - if (!line) { - line = 60 - } else { - line = Math.min(60, Math.max(line - 16, 24)) - } - - arr.sort(function (a, b) { return a < b ? -1 : 1 }) - .forEach(function (c) { - if (out[l].length + c.length + 2 < line) { - out[l] += ', ' + c - } else { - out[l++] += ',' - out[l] = c - } - }) - return out.join('\n ').substr(2) + return 'file://' + path.resolve(__dirname, '..', 'docs', 'public', sect, f, 'index.html') } function getSections (cb) { diff --git a/deps/npm/lib/hook.js b/deps/npm/lib/hook.js index 4d980cf95d15e7..e2c6d76aa13de3 100644 --- a/deps/npm/lib/hook.js +++ b/deps/npm/lib/hook.js @@ -1,70 +1,40 @@ -'use strict' - -const BB = require('bluebird') - -const hookApi = require('libnpm/hook') -const npmConfig = require('./config/figgy-config.js') +const hookApi = require('libnpmhook') +const npm = require('./npm.js') const output = require('./utils/output.js') const otplease = require('./utils/otplease.js') -const pudding = require('figgy-pudding') const relativeDate = require('tiny-relative-date') const Table = require('cli-table3') -const validate = require('aproba') -const npm = require('./npm') -hook.usage = [ +const usageUtil = require('./utils/usage.js') +const usage = usageUtil('hook', [ 'npm hook add [--type=]', 'npm hook ls [pkg]', 'npm hook rm ', 'npm hook update ' -].join('\n') - -hook.completion = (opts, cb) => { - validate('OF', [opts, cb]) - return cb(null, []) // fill in this array with completion values -} +].join('\n')) -const HookConfig = pudding({ - json: {}, - loglevel: {}, - parseable: {}, - silent: {}, - unicode: {} -}) +const completion = require('./utils/completion/none.js') -function UsageError () { - throw Object.assign(new Error(hook.usage), {code: 'EUSAGE'}) -} +const cmd = (args, cb) => hook(args).then(() => cb()).catch(cb) -module.exports = (args, cb) => BB.try(() => hook(args)).then( - val => cb(null, val), - err => err.code === 'EUSAGE' ? cb(err.message) : cb(err) -) -function hook (args) { - if (args.length === 4) { // secret is passed in the args - // we have the user secret in the CLI args, we need to redact it from the referer. - redactUserSecret() +const hook = async (args) => otplease(npm.flatOptions, opts => { + switch (args[0]) { + case 'add': + return add(args[1], args[2], args[3], opts) + case 'ls': + return ls(args[1], opts) + case 'rm': + return rm(args[1], opts) + case 'update': + case 'up': + return update(args[1], args[2], args[3], opts) + default: + throw usage } - return otplease(npmConfig(), opts => { - opts = HookConfig(opts) - switch (args[0]) { - case 'add': - return add(args[1], args[2], args[3], opts) - case 'ls': - return ls(args[1], opts) - case 'rm': - return rm(args[1], opts) - case 'update': - case 'up': - return update(args[1], args[2], args[3], opts) - default: - UsageError() - } - }) -} +}) -function add (pkg, uri, secret, opts) { - return hookApi.add(pkg, uri, secret, opts).then(hook => { +const add = (pkg, uri, secret, opts) => { + hookApi.add(pkg, uri, secret, opts).then(hook => { if (opts.json) { output(JSON.stringify(hook, null, 2)) } else if (opts.parseable) { @@ -78,8 +48,8 @@ function add (pkg, uri, secret, opts) { }) } -function ls (pkg, opts) { - return hookApi.ls(opts.concat({package: pkg})).then(hooks => { +const ls = (pkg, opts) => { + return hookApi.ls({ ...opts, package: pkg }).then(hooks => { if (opts.json) { output(JSON.stringify(hooks, null, 2)) } else if (opts.parseable) { @@ -95,10 +65,10 @@ function ls (pkg, opts) { } else { output(`You have ${hooks.length} hooks configured.`) } - const table = new Table({head: ['id', 'target', 'endpoint']}) + const table = new Table({ head: ['id', 'target', 'endpoint'] }) hooks.forEach((hook) => { table.push([ - {rowSpan: 2, content: hook.id}, + { rowSpan: 2, content: hook.id }, hookName(hook), hook.endpoint ]) @@ -111,7 +81,7 @@ function ls (pkg, opts) { hook.response_code ]) } else { - table.push([{colSpan: 2, content: 'never triggered'}]) + table.push([{ colSpan: 2, content: 'never triggered' }]) } }) output(table.toString()) @@ -119,7 +89,7 @@ function ls (pkg, opts) { }) } -function rm (id, opts) { +const rm = (id, opts) => { return hookApi.rm(id, opts).then(hook => { if (opts.json) { output(JSON.stringify(hook, null, 2)) @@ -134,7 +104,7 @@ function rm (id, opts) { }) } -function update (id, uri, secret, opts) { +const update = (id, uri, secret, opts) => { return hookApi.update(id, uri, secret, opts).then(hook => { if (opts.json) { output(JSON.stringify(hook, null, 2)) @@ -149,17 +119,11 @@ function update (id, uri, secret, opts) { }) } -function hookName (hook) { +const hookName = (hook) => { let target = hook.name if (hook.type === 'scope') { target = '@' + target } if (hook.type === 'owner') { target = '~' + target } return target } -function redactUserSecret () { - const referer = npm.referer - if (!referer) return - const splittedReferer = referer.split(' ') - splittedReferer[4] = '[REDACTED]' - npm.referer = splittedReferer.join(' ') -} +module.exports = Object.assign(cmd, { usage, completion }) diff --git a/deps/npm/lib/init.js b/deps/npm/lib/init.js index 41995abe22bbf1..bec96b44c9a683 100644 --- a/deps/npm/lib/init.js +++ b/deps/npm/lib/init.js @@ -1,64 +1,61 @@ // initialize a package.json file -module.exports = init +const usageUtil = require('./utils/usage.js') +const completion = require('./utils/completion/none.js') -var path = require('path') -var log = require('npmlog') -var npa = require('npm-package-arg') -var npm = require('./npm.js') -var npx = require('libnpx') -var initJson = require('init-package-json') -var isRegistry = require('./utils/is-registry.js') -var output = require('./utils/output.js') -var noProgressTillDone = require('./utils/no-progress-while-running').tillDone -var usage = require('./utils/usage') +const npa = require('npm-package-arg') +const npm = require('./npm.js') +const initJson = require('init-package-json') +const output = require('./utils/output.js') -init.usage = usage( +const usage = usageUtil( 'init', '\nnpm init [--force|-f|--yes|-y|--scope]' + '\nnpm init <@scope> (same as `npx <@scope>/create`)' + '\nnpm init [<@scope>/] (same as `npx [<@scope>/]create-`)' ) -function init (args, cb) { +const cmd = (args, cb) => init(args).then(() => cb()).catch(cb) + +const init = async args => { + // the new npx style way if (args.length) { - var NPM_PATH = path.resolve(__dirname, '../bin/npm-cli.js') - var initerName = args[0] - var packageName = initerName + const initerName = args[0] + let packageName = initerName if (/^@[^/]+$/.test(initerName)) { packageName = initerName + '/create' } else { - var req = npa(initerName) + const req = npa(initerName) if (req.type === 'git' && req.hosted) { - var { user, project } = req.hosted + const { user, project } = req.hosted packageName = initerName .replace(user + '/' + project, user + '/create-' + project) - } else if (isRegistry(req)) { + } else if (req.registry) { packageName = req.name.replace(/^(@[^/]+\/)?/, '$1create-') if (req.rawSpec) { packageName += '@' + req.rawSpec } } else { - var err = new Error( + throw Object.assign(new Error( 'Unrecognized initializer: ' + initerName + '\nFor more package binary executing power check out `npx`:' + '\nhttps://www.npmjs.com/package/npx' - ) - err.code = 'EUNSUPPORTED' - throw err + ), { code: 'EUNSUPPORTED' }) } } - var npxArgs = [process.argv0, '[fake arg]', '--always-spawn', packageName, ...process.argv.slice(4)] - var parsed = npx.parseArgs(npxArgs, NPM_PATH) - - return npx(parsed) - .then(() => cb()) - .catch(cb) + npm.config.set('package', []) + npm.flatOptions = { ...npm.flatOptions, package: [] } + return new Promise((res, rej) => { + npm.commands.exec([packageName, ...args.slice(1)], er => er ? rej(er) : res()) + }) } - var dir = process.cwd() - log.pause() - var initFile = npm.config.get('init-module') - if (!initJson.yes(npm.config)) { + + // the old way + const dir = process.cwd() + npm.log.pause() + npm.log.disableProgress() + const initFile = npm.config.get('init-module') + if (!npm.flatOptions.yes && !npm.flatOptions.force) { 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.', @@ -72,14 +69,24 @@ function init (args, cb) { 'Press ^C at any time to quit.' ].join('\n')) } - initJson(dir, initFile, npm.config, noProgressTillDone(function (er, data) { - log.resume() - log.silly('package data', data) - if (er && er.message === 'canceled') { - log.warn('init', 'canceled') - return cb(null, data) - } - log.info('init', 'written successfully') - cb(er, data) - })) + // XXX promisify init-package-json + await new Promise((res, rej) => { + initJson(dir, initFile, npm.config, (er, data) => { + npm.log.resume() + npm.log.enableProgress() + npm.log.silly('package data', data) + if (er && er.message === 'canceled') { + npm.log.warn('init', 'canceled') + return res() + } + npm.log.info('init', 'written successfully') + if (er) { + rej(er) + } else { + res(data) + } + }) + }) } + +module.exports = Object.assign(cmd, { completion, usage }) diff --git a/deps/npm/lib/install-ci-test.js b/deps/npm/lib/install-ci-test.js index 26120f4a216dfa..52c41c413a64cc 100644 --- a/deps/npm/lib/install-ci-test.js +++ b/deps/npm/lib/install-ci-test.js @@ -1,26 +1,19 @@ -'use strict' - // npm install-ci-test // Runs `npm ci` and then runs `npm test` -module.exports = installTest -var ci = require('./ci.js') -var test = require('./test.js') -var usage = require('./utils/usage') +const ci = require('./ci.js') +const test = require('./test.js') +const usageUtil = require('./utils/usage.js') -installTest.usage = usage( +const usage = usageUtil( 'install-ci-test', - '\nnpm install-ci-test [args]' + + 'npm install-ci-test [args]' + '\nSame args as `npm ci`' ) -installTest.completion = ci.completion +const completion = ci.completion + +const ciTest = (args, cb) => + ci(args, er => er ? cb(er) : test([], cb)) -function installTest (args, cb) { - ci(args, function (er) { - if (er) { - return cb(er) - } - test([], cb) - }) -} +module.exports = Object.assign(ciTest, { usage, completion }) diff --git a/deps/npm/lib/install-test.js b/deps/npm/lib/install-test.js index f66dfd40152a0f..9593361e320b8e 100644 --- a/deps/npm/lib/install-test.js +++ b/deps/npm/lib/install-test.js @@ -1,26 +1,19 @@ -'use strict' - // npm install-test // Runs `npm install` and then runs `npm test` -module.exports = installTest -var install = require('./install.js') -var test = require('./test.js') -var usage = require('./utils/usage') +const install = require('./install.js') +const test = require('./test.js') +const usageUtil = require('./utils/usage.js') -installTest.usage = usage( +const usage = usageUtil( 'install-test', - '\nnpm install-test [args]' + + 'npm install-test [args]' + '\nSame args as `npm install`' ) -installTest.completion = install.completion +const completion = install.completion + +const installTest = (args, cb) => + install(args, er => er ? cb(er) : test([], cb)) -function installTest (args, cb) { - install(args, function (er) { - if (er) { - return cb(er) - } - test([], cb) - }) -} +module.exports = Object.assign(installTest, { usage, completion }) diff --git a/deps/npm/lib/install.js b/deps/npm/lib/install.js index 082eda5165e3fb..68778d45a14690 100644 --- a/deps/npm/lib/install.js +++ b/deps/npm/lib/install.js @@ -1,27 +1,78 @@ 'use strict' /* eslint-disable camelcase */ /* eslint-disable standard/no-callback-literal */ -// npm install -// -// See doc/cli/npm-install.md for more description -// -// Managing contexts... -// there's a lot of state associated with an "install" operation, including -// packages that are already installed, parent packages, current shrinkwrap, and -// so on. We maintain this state in a "context" object that gets passed around. -// every time we dive into a deeper node_modules folder, the "family" list that -// gets passed along uses the previous "family" list as its __proto__. Any -// "resolved precise dependency" things that aren't already on this object get -// added, and then that's passed to the next generation of installation. +const fs = require('fs') +const util = require('util') +const readdir = util.promisify(fs.readdir) +const npm = require('./npm.js') +const usageUtil = require('./utils/usage.js') +const reifyOutput = require('./utils/reify-output.js') +const log = require('npmlog') +const { resolve, join } = require('path') +const Arborist = require('@npmcli/arborist') +const runScript = require('@npmcli/run-script') + +const install = async (args, cb) => { + // the /path/to/node_modules/.. + const globalTop = resolve(npm.globalDir, '..') + const { ignoreScripts, global: isGlobalInstall } = npm.flatOptions + const where = isGlobalInstall ? globalTop : npm.prefix + + // don't try to install the prefix into itself + args = args.filter(a => resolve(a) !== npm.prefix) + + // `npm i -g` => "install this package globally" + if (where === globalTop && !args.length) { + args = ['.'] + } -module.exports = install -module.exports.Installer = Installer + // TODO: Add warnings for other deprecated flags? or remove this one? + if (npm.config.get('dev')) { + log.warn('install', 'Usage of the `--dev` option is deprecated. Use `--include=dev` instead.') + } -var usage = require('./utils/usage') + const arb = new Arborist({ + ...npm.flatOptions, + path: where + }) + + try { + await arb.reify({ + ...npm.flatOptions, + add: args + }) + if (!args.length && !isGlobalInstall && !ignoreScripts) { + const { scriptShell } = npm.flatOptions + const scripts = [ + 'preinstall', + 'install', + 'postinstall', + 'prepublish', // XXX should we remove this finally?? + 'preprepare', + 'prepare', + 'postprepare' + ] + for (const event of scripts) { + await runScript({ + path: where, + args: [], + scriptShell, + stdio: 'inherit', + stdioString: true, + event + }) + } + } + reifyOutput(arb) + cb() + } catch (er) { + cb(er) + } +} -install.usage = usage( +const usage = usageUtil( 'install', - '\nnpm install (with no args, in package dir)' + + 'npm install (with no args, in package dir)' + '\nnpm install [<@scope>/]' + '\nnpm install [<@scope>/]@' + '\nnpm install [<@scope>/]@' + @@ -35,1040 +86,65 @@ install.usage = usage( '[--save-prod|--save-dev|--save-optional] [--save-exact] [--no-save]' ) -install.completion = function (opts, cb) { - validate('OF', arguments) +const completion = async (opts, cb) => { + const { partialWord } = opts // install can complete to a folder with a package.json, or any package. // if it has a slash, then it's gotta be a folder // if it starts with https?://, then just give up, because it's a url - if (/^https?:\/\//.test(opts.partialWord)) { + if (/^https?:\/\//.test(partialWord)) { // do not complete to URLs return cb(null, []) } - if (/\//.test(opts.partialWord)) { + if (/\//.test(partialWord)) { // Complete fully to folder if there is exactly one match and it // is a folder containing a package.json file. If that is not the // case we return 0 matches, which will trigger the default bash // complete. - var lastSlashIdx = opts.partialWord.lastIndexOf('/') - var partialName = opts.partialWord.slice(lastSlashIdx + 1) - var partialPath = opts.partialWord.slice(0, lastSlashIdx) - if (partialPath === '') partialPath = '/' + const lastSlashIdx = partialWord.lastIndexOf('/') + const partialName = partialWord.slice(lastSlashIdx + 1) + const partialPath = partialWord.slice(0, lastSlashIdx) || '/' - var annotatePackageDirMatch = function (sibling, cb) { - var fullPath = path.join(partialPath, sibling) + const annotatePackageDirMatch = async (sibling) => { + const fullPath = join(partialPath, sibling) if (sibling.slice(0, partialName.length) !== partialName) { - return cb(null, null) // not name match + return null // not name match } - fs.readdir(fullPath, function (err, contents) { - if (err) return cb(null, { isPackage: false }) - - cb( - null, - { - fullPath: fullPath, - isPackage: contents.indexOf('package.json') !== -1 - } - ) - }) - } - - return fs.readdir(partialPath, function (err, siblings) { - if (err) return cb(null, []) // invalid dir: no matching - - asyncMap(siblings, annotatePackageDirMatch, function (err, matches) { - if (err) return cb(err) - - var cleaned = matches.filter(function (x) { return x !== null }) - if (cleaned.length !== 1) return cb(null, []) - if (!cleaned[0].isPackage) return cb(null, []) - - // Success - only one match and it is a package dir - return cb(null, [cleaned[0].fullPath]) - }) - }) - } - - // FIXME: there used to be registry completion here, but it stopped making - // sense somewhere around 50,000 packages on the registry - cb() -} - -// system packages -var fs = require('fs') -var path = require('path') -// dependencies -var log = require('npmlog') -var readPackageTree = require('read-package-tree') -var readPackageJson = require('read-package-json') -var chain = require('slide').chain -var asyncMap = require('slide').asyncMap -var archy = require('archy') -var mkdirp = require('gentle-fs').mkdir -var rimraf = require('rimraf') -var iferr = require('iferr') -var validate = require('aproba') -var uniq = require('lodash.uniq') -var Bluebird = require('bluebird') - -// npm internal utils -var npm = require('./npm.js') -var locker = require('./utils/locker.js') -var lock = locker.lock -var unlock = locker.unlock -var parseJSON = require('./utils/parse-json.js') -var output = require('./utils/output.js') -var saveMetrics = require('./utils/metrics.js').save - -// install specific libraries -var copyTree = require('./install/copy-tree.js') -var readShrinkwrap = require('./install/read-shrinkwrap.js') -var computeMetadata = require('./install/deps.js').computeMetadata -var prefetchDeps = require('./install/deps.js').prefetchDeps -var loadDeps = require('./install/deps.js').loadDeps -var loadDevDeps = require('./install/deps.js').loadDevDeps -var getAllMetadata = require('./install/deps.js').getAllMetadata -var loadRequestedDeps = require('./install/deps.js').loadRequestedDeps -var loadExtraneous = require('./install/deps.js').loadExtraneous -var diffTrees = require('./install/diff-trees.js') -var checkPermissions = require('./install/check-permissions.js') -var decomposeActions = require('./install/decompose-actions.js') -var validateTree = require('./install/validate-tree.js') -var validateArgs = require('./install/validate-args.js') -var saveRequested = require('./install/save.js').saveRequested -var saveShrinkwrap = require('./install/save.js').saveShrinkwrap -var audit = require('./install/audit.js') -var { - getPrintFundingReport, - getPrintFundingReportJSON -} = require('./install/fund.js') -var getSaveType = require('./install/save.js').getSaveType -var doSerialActions = require('./install/actions.js').doSerial -var doReverseSerialActions = require('./install/actions.js').doReverseSerial -var doParallelActions = require('./install/actions.js').doParallel -var doOneAction = require('./install/actions.js').doOne -var removeObsoleteDep = require('./install/deps.js').removeObsoleteDep -var removeExtraneous = require('./install/deps.js').removeExtraneous -var computeVersionSpec = require('./install/deps.js').computeVersionSpec -var packageId = require('./utils/package-id.js') -var moduleName = require('./utils/module-name.js') -var errorMessage = require('./utils/error-message.js') -var isExtraneous = require('./install/is-extraneous.js') - -function unlockCB (lockPath, name, cb) { - validate('SSF', arguments) - return function (installEr) { - var args = arguments - try { - unlock(lockPath, name, reportErrorAndReturn) - } catch (unlockEx) { - process.nextTick(function () { - reportErrorAndReturn(unlockEx) - }) - } - function reportErrorAndReturn (unlockEr) { - if (installEr) { - if (unlockEr && unlockEr.code !== 'ENOTLOCKED') { - log.warn('unlock' + name, unlockEr) + try { + const contents = await readdir(fullPath) + return { + fullPath, + isPackage: contents.indexOf('package.json') !== -1 } - return cb.apply(null, args) + } catch { + return { isPackage: false } } - if (unlockEr) return cb(unlockEr) - return cb.apply(null, args) - } - } -} - -function install (where, args, cb) { - if (!cb) { - cb = args - args = where - where = null - } - var globalTop = path.resolve(npm.globalDir, '..') - if (!where) { - where = npm.config.get('global') - ? globalTop - : npm.prefix - } - validate('SAF', [where, args, cb]) - // the /path/to/node_modules/.. - var dryrun = !!npm.config.get('dry-run') - - if (npm.config.get('dev')) { - log.warn('install', 'Usage of the `--dev` option is deprecated. Use `--also=dev` instead.') - } - - if (where === globalTop && !args.length) { - args = ['.'] - } - args = args.filter(function (a) { - return path.resolve(a) !== npm.prefix - }) - - new Installer(where, dryrun, args).run(cb) -} - -function Installer (where, dryrun, args, opts) { - validate('SBA|SBAO', arguments) - if (!opts) opts = {} - this.where = where - this.dryrun = dryrun - this.args = args - // fakechildren are children created from the lockfile and lack relationship data - // the only exist when the tree does not match the lockfile - // this is fine when doing full tree installs/updates but not ok when modifying only - // a few deps via `npm install` or `npm uninstall`. - this.currentTree = null - this.idealTree = null - this.differences = [] - this.todo = [] - this.progress = {} - this.noPackageJsonOk = !!args.length - this.topLevelLifecycles = !args.length - - this.autoPrune = npm.config.get('package-lock') - - const dev = npm.config.get('dev') - const only = npm.config.get('only') - const onlyProd = /^prod(uction)?$/.test(only) - const onlyDev = /^dev(elopment)?$/.test(only) - const prod = npm.config.get('production') - this.dev = opts.dev != null ? opts.dev : dev || (!onlyProd && !prod) || onlyDev - this.prod = opts.prod != null ? opts.prod : !onlyDev - - this.packageLockOnly = opts.packageLockOnly != null - ? opts.packageLockOnly : npm.config.get('package-lock-only') - this.rollback = opts.rollback != null ? opts.rollback : npm.config.get('rollback') - this.link = opts.link != null ? opts.link : npm.config.get('link') - this.saveOnlyLock = opts.saveOnlyLock - this.global = opts.global != null ? opts.global : this.where === path.resolve(npm.globalDir, '..') - this.audit = npm.config.get('audit') && !this.global - this.fund = npm.config.get('fund') && !this.global - this.started = Date.now() -} -Installer.prototype = {} - -Installer.prototype.run = function (_cb) { - validate('F|', arguments) - - var result - var cb - if (_cb) { - cb = function (err) { - saveMetrics(!err) - return _cb.apply(this, arguments) } - } else { - result = new Promise((resolve, reject) => { - cb = (err, value) => err ? reject(err) : resolve(value) - }) - } - // FIXME: This is bad and I should feel bad. - // lib/install needs to have some way of sharing _limited_ - // state with the things it calls. Passing the object is too - // much. The global config is WAY too much. =( =( - // But not having this is gonna break linked modules in - // subtle stupid ways, and refactoring all this code isn't - // the right thing to do just yet. - if (this.global) { - var prevGlobal = npm.config.get('global') - npm.config.set('global', true) - var next = cb - cb = function () { - npm.config.set('global', prevGlobal) - next.apply(null, arguments) - } - } - - var installSteps = [] - var postInstallSteps = [] - if (!this.dryrun) { - installSteps.push( - [this.newTracker(log, 'runTopLevelLifecycles', 2)], - [this, this.runPreinstallTopLevelLifecycles]) - } - installSteps.push( - [this.newTracker(log, 'loadCurrentTree', 4)], - [this, this.loadCurrentTree], - [this, this.finishTracker, 'loadCurrentTree'], - - [this.newTracker(log, 'loadIdealTree', 12)], - [this, this.loadIdealTree], - [this, this.finishTracker, 'loadIdealTree'], - - [this, this.debugTree, 'currentTree', 'currentTree'], - [this, this.debugTree, 'idealTree', 'idealTree'], - [this.newTracker(log, 'generateActionsToTake')], - [this, this.generateActionsToTake], - [this, this.finishTracker, 'generateActionsToTake'], - - [this, this.debugActions, 'diffTrees', 'differences'], - [this, this.debugActions, 'decomposeActions', 'todo'], - [this, this.startAudit] - ) - - if (this.packageLockOnly) { - postInstallSteps.push( - [this, this.saveToDependencies]) - } else if (!this.dryrun) { - installSteps.push( - [this.newTracker(log, 'executeActions', 8)], - [this, this.executeActions], - [this, this.finishTracker, 'executeActions']) - var node_modules = path.resolve(this.where, 'node_modules') - var staging = path.resolve(node_modules, '.staging') - postInstallSteps.push( - [this.newTracker(log, 'rollbackFailedOptional', 1)], - [this, this.rollbackFailedOptional, staging, this.todo], - [this, this.finishTracker, 'rollbackFailedOptional'], - [this, this.commit, staging, this.todo], - - [this, this.runPostinstallTopLevelLifecycles], - [this, this.finishTracker, 'runTopLevelLifecycles'] - ) - if (getSaveType()) { - postInstallSteps.push( - // this is necessary as we don't fill in `dependencies` and `devDependencies` in deps loaded from shrinkwrap - // until after we extract them - [this, (next) => { computeMetadata(this.idealTree); next() }], - [this, this.pruneIdealTree], - [this, this.debugLogicalTree, 'saveTree', 'idealTree'], - [this, this.saveToDependencies]) - } - } - postInstallSteps.push( - [this, this.printWarnings], - [this, this.printInstalled]) - - var self = this - chain(installSteps, function (installEr) { - if (installEr) self.failing = true - chain(postInstallSteps, function (postInstallEr) { - if (installEr && postInstallEr) { - var msg = errorMessage(postInstallEr) - msg.summary.forEach(function (logline) { - log.warn.apply(log, logline) - }) - msg.detail.forEach(function (logline) { - log.verbose.apply(log, logline) + try { + const siblings = await readdir(partialPath) + const matches = await Promise.all( + siblings.map(async sibling => { + return await annotatePackageDirMatch(sibling) }) + ) + const match = matches.filter(el => !el || el.isPackage).pop() + if (match) { + // Success - only one match and it is a package dir + return cb(null, [match.fullPath]) + } else { + // no matches + return cb(null, []) } - cb(installEr || postInstallEr, self.getInstalledModules(), self.idealTree) - }) - }) - return result -} - -Installer.prototype.loadArgMetadata = function (next) { - getAllMetadata(this.args, this.currentTree, process.cwd(), iferr(next, (args) => { - this.args = args - next() - })) -} - -Installer.prototype.newTracker = function (tracker, name, size) { - validate('OS', [tracker, name]) - if (size) validate('N', [size]) - this.progress[name] = tracker.newGroup(name, size) - return function (next) { - process.emit('time', 'stage:' + name) - next() - } -} - -Installer.prototype.finishTracker = function (name, cb) { - validate('SF', arguments) - process.emit('timeEnd', 'stage:' + name) - cb() -} - -Installer.prototype.loadCurrentTree = function (cb) { - validate('F', arguments) - log.silly('install', 'loadCurrentTree') - var todo = [] - if (this.global) { - todo.push([this, this.readGlobalPackageData]) - } else { - todo.push([this, this.readLocalPackageData]) - } - todo.push([this, this.normalizeCurrentTree]) - chain(todo, cb) -} - -var createNode = require('./install/node.js').create -var flatNameFromTree = require('./install/flatten-tree.js').flatNameFromTree -Installer.prototype.normalizeCurrentTree = function (cb) { - this.currentTree.isTop = true - normalizeTree(this.currentTree) - // If the user didn't have a package.json then fill in deps with what was on disk - if (this.currentTree.error) { - for (let child of this.currentTree.children) { - if (!child.fakeChild && isExtraneous(child)) { - this.currentTree.package.dependencies[moduleName(child)] = computeVersionSpec(this.currentTree, child) - } - } - } - computeMetadata(this.currentTree) - return cb() - - function normalizeTree (tree, seen) { - if (!seen) seen = new Set() - if (seen.has(tree)) return - seen.add(tree) - createNode(tree) - tree.location = flatNameFromTree(tree) - tree.children.forEach((child) => normalizeTree(child, seen)) - } -} - -Installer.prototype.loadIdealTree = function (cb) { - validate('F', arguments) - log.silly('install', 'loadIdealTree') - - chain([ - [this.newTracker(this.progress.loadIdealTree, 'loadIdealTree:cloneCurrentTree')], - [this, this.cloneCurrentTreeToIdealTree], - [this, this.finishTracker, 'loadIdealTree:cloneCurrentTree'], - - [this.newTracker(this.progress.loadIdealTree, 'loadIdealTree:loadShrinkwrap')], - [this, this.loadShrinkwrap], - [this, this.finishTracker, 'loadIdealTree:loadShrinkwrap'], - - [this.newTracker(this.progress.loadIdealTree, 'loadIdealTree:loadAllDepsIntoIdealTree', 10)], - [this, this.loadAllDepsIntoIdealTree], - [this, this.finishTracker, 'loadIdealTree:loadAllDepsIntoIdealTree'], - [this, function (next) { computeMetadata(this.idealTree); next() }], - [this, this.pruneIdealTree] - ], cb) -} - -Installer.prototype.pruneIdealTree = function (cb) { - if (!this.idealTree) return cb() - // if our lock file didn't have the requires field and there - // are any fake children then forgo pruning until we have more info. - if (!this.idealTree.hasRequiresFromLock && this.idealTree.children.some((n) => n.fakeChild)) return cb() - const toPrune = this.idealTree.children - .filter((child) => isExtraneous(child) && (this.autoPrune || child.removing)) - .map((n) => ({name: moduleName(n)})) - return removeExtraneous(toPrune, this.idealTree, cb) -} - -Installer.prototype.loadAllDepsIntoIdealTree = function (cb) { - validate('F', arguments) - log.silly('install', 'loadAllDepsIntoIdealTree') - var saveDeps = getSaveType() - - var cg = this.progress['loadIdealTree:loadAllDepsIntoIdealTree'] - var installNewModules = !!this.args.length - var steps = [] - - if (installNewModules) { - steps.push([validateArgs, this.idealTree, this.args]) - steps.push([loadRequestedDeps, this.args, this.idealTree, saveDeps, cg.newGroup('loadRequestedDeps')]) - } else { - const depsToPreload = Object.assign({}, - this.idealTree.package.devDependencies, - this.idealTree.package.dependencies - ) - steps.push( - [prefetchDeps, this.idealTree, depsToPreload, cg.newGroup('prefetchDeps')], - [loadDeps, this.idealTree, cg.newGroup('loadDeps')], - [loadDevDeps, this.idealTree, cg.newGroup('loadDevDeps')]) - } - steps.push( - [loadExtraneous.andResolveDeps, this.idealTree, cg.newGroup('loadExtraneous')]) - chain(steps, cb) -} - -Installer.prototype.generateActionsToTake = function (cb) { - validate('F', arguments) - log.silly('install', 'generateActionsToTake') - var cg = this.progress.generateActionsToTake - chain([ - [validateTree, this.idealTree, cg.newGroup('validateTree')], - [diffTrees, this.currentTree, this.idealTree, this.differences, cg.newGroup('diffTrees')], - [this, this.computeLinked], - [checkPermissions, this.differences], - [decomposeActions, this.differences, this.todo] - ], cb) -} - -Installer.prototype.computeLinked = function (cb) { - validate('F', arguments) - if (!this.link || this.global) return cb() - var linkTodoList = [] - var self = this - asyncMap(this.differences, function (action, next) { - var cmd = action[0] - var pkg = action[1] - if (cmd !== 'add' && cmd !== 'update') return next() - var isReqByTop = pkg.requiredBy.filter(function (mod) { return mod.isTop }).length - var isReqByUser = pkg.userRequired - var isExtraneous = pkg.requiredBy.length === 0 - if (!isReqByTop && !isReqByUser && !isExtraneous) return next() - isLinkable(pkg, function (install, link) { - if (install) linkTodoList.push(['global-install', pkg]) - if (link) linkTodoList.push(['global-link', pkg]) - if (install || link) removeObsoleteDep(pkg) - next() - }) - }, function () { - if (linkTodoList.length === 0) return cb() - self.differences.length = 0 - Array.prototype.push.apply(self.differences, linkTodoList) - diffTrees(self.currentTree, self.idealTree, self.differences, log.newGroup('d2'), cb) - }) -} - -function isLinkable (pkg, cb) { - var globalPackage = path.resolve(npm.globalPrefix, 'lib', 'node_modules', moduleName(pkg)) - var globalPackageJson = path.resolve(globalPackage, 'package.json') - fs.stat(globalPackage, function (er) { - if (er) return cb(true, true) - fs.readFile(globalPackageJson, function (er, data) { - var json = parseJSON.noExceptions(data) - cb(false, json && json.version === pkg.package.version) - }) - }) -} - -Installer.prototype.executeActions = function (cb) { - validate('F', arguments) - log.silly('install', 'executeActions') - var todo = this.todo - var cg = this.progress.executeActions - - var node_modules = path.resolve(this.where, 'node_modules') - var staging = path.resolve(node_modules, '.staging') - var steps = [] - var trackLifecycle = cg.newGroup('lifecycle') - - cb = unlockCB(node_modules, '.staging', cb) - - steps.push( - [doSerialActions, 'global-install', staging, todo, trackLifecycle.newGroup('global-install')], - [lock, node_modules, '.staging'], - [rimraf, staging], - [doParallelActions, 'extract', staging, todo, cg.newGroup('extract', 100)], - [doReverseSerialActions, 'unbuild', staging, todo, cg.newGroup('unbuild')], - [doSerialActions, 'remove', staging, todo, cg.newGroup('remove')], - [doSerialActions, 'move', staging, todo, cg.newGroup('move')], - [doSerialActions, 'finalize', staging, todo, cg.newGroup('finalize')], - [doParallelActions, 'refresh-package-json', staging, todo, cg.newGroup('refresh-package-json')], - [doParallelActions, 'preinstall', staging, todo, trackLifecycle.newGroup('preinstall')], - [doSerialActions, 'build', staging, todo, trackLifecycle.newGroup('build')], - [doSerialActions, 'global-link', staging, todo, trackLifecycle.newGroup('global-link')], - [doParallelActions, 'update-linked', staging, todo, trackLifecycle.newGroup('update-linked')], - [doSerialActions, 'install', staging, todo, trackLifecycle.newGroup('install')], - [doSerialActions, 'postinstall', staging, todo, trackLifecycle.newGroup('postinstall')]) - - var self = this - chain(steps, function (er) { - if (!er || self.rollback) { - rimraf(staging, function () { cb(er) }) - } else { - cb(er) - } - }) -} - -Installer.prototype.rollbackFailedOptional = function (staging, actionsToRun, cb) { - if (!this.rollback) return cb() - var failed = uniq(actionsToRun.map(function (action) { - return action[1] - }).filter(function (pkg) { - return pkg.failed && pkg.rollback - })) - var top = this.currentTree && this.currentTree.path - Bluebird.map(failed, (pkg) => { - return Bluebird.map(pkg.rollback, (rollback) => rollback(top, staging, pkg)) - }).asCallback(cb) -} - -Installer.prototype.commit = function (staging, actionsToRun, cb) { - var toCommit = actionsToRun.map(function (action) { return action[1] }).filter(function (pkg) { return !pkg.failed && pkg.commit }) - asyncMap(toCommit, function (pkg, next) { - asyncMap(pkg.commit, function (commit, done) { - commit(staging, pkg, done) - }, function () { - pkg.commit = [] - next.apply(null, arguments) - }) - }, cb) -} - -Installer.prototype.runPreinstallTopLevelLifecycles = function (cb) { - validate('F', arguments) - if (this.failing) return cb() - if (!this.topLevelLifecycles) return cb() - log.silly('install', 'runPreinstallTopLevelLifecycles') - - readPackageJson(path.join(this.where, 'package.json'), log, false, (err, data) => { - if (err) return cb() - this.currentTree = createNode({ - isTop: true, - package: data, - path: this.where - }) - doOneAction('preinstall', this.where, this.currentTree, log.newGroup('preinstall:.'), cb) - }) -} - -Installer.prototype.runPostinstallTopLevelLifecycles = function (cb) { - validate('F', arguments) - if (this.failing) return cb() - if (!this.topLevelLifecycles) return cb() - log.silly('install', 'runPostinstallTopLevelLifecycles') - var steps = [] - var trackLifecycle = this.progress.runTopLevelLifecycles - - steps.push( - [doOneAction, 'build', this.idealTree.path, this.idealTree, trackLifecycle.newGroup('build:.')], - [doOneAction, 'install', this.idealTree.path, this.idealTree, trackLifecycle.newGroup('install:.')], - [doOneAction, 'postinstall', this.idealTree.path, this.idealTree, trackLifecycle.newGroup('postinstall:.')]) - if (this.dev) { - steps.push( - [doOneAction, 'prepare', this.idealTree.path, this.idealTree, trackLifecycle.newGroup('prepare')]) - } - chain(steps, cb) -} - -Installer.prototype.startAudit = function (cb) { - if (!this.audit) return cb() - this.auditSubmission = Bluebird.try(() => { - return audit.generateFromInstall(this.idealTree, this.differences, this.args, this.remove) - }).then((auditData) => { - return audit.submitForInstallReport(auditData) - }).catch(_ => {}) - cb() -} - -Installer.prototype.saveToDependencies = function (cb) { - validate('F', arguments) - if (this.failing) return cb() - log.silly('install', 'saveToDependencies') - // Note idealTree will be mutated during the save operations below as the - // package is reloaded from disk to preserve additional details. This means - // steps after postInstall will see a slightly different package object. - if (this.saveOnlyLock) { - saveShrinkwrap(this.idealTree, cb) - } else { - saveRequested(this.idealTree, cb) - } -} - -Installer.prototype.readGlobalPackageData = function (cb) { - validate('F', arguments) - log.silly('install', 'readGlobalPackageData') - var self = this - this.loadArgMetadata(iferr(cb, function () { - mkdirp(self.where, iferr(cb, function () { - var pkgs = {} - self.args.forEach(function (pkg) { - pkgs[pkg.name] = true - }) - readPackageTree(self.where, function (ctx, kid) { return ctx.parent || pkgs[kid] }, iferr(cb, function (currentTree) { - self.currentTree = currentTree - return cb() - })) - })) - })) -} - -Installer.prototype.readLocalPackageData = function (cb) { - validate('F', arguments) - log.silly('install', 'readLocalPackageData') - var self = this - mkdirp(this.where, iferr(cb, function () { - readPackageTree(self.where, iferr(cb, function (currentTree) { - self.currentTree = currentTree - self.currentTree.warnings = [] - if (currentTree.error && currentTree.error.code === 'EJSONPARSE') { - return cb(currentTree.error) - } - if (!self.noPackageJsonOk && !currentTree.package) { - log.error('install', "Couldn't read dependencies") - var er = new Error("ENOENT, open '" + path.join(self.where, 'package.json') + "'") - er.code = 'ENOPACKAGEJSON' - er.errno = 34 - return cb(er) - } - if (!currentTree.package) currentTree.package = {} - readShrinkwrap(currentTree, function (err) { - if (err) { - cb(err) - } else { - self.loadArgMetadata(cb) - } - }) - })) - })) -} - -Installer.prototype.cloneCurrentTreeToIdealTree = function (cb) { - validate('F', arguments) - log.silly('install', 'cloneCurrentTreeToIdealTree') - - if (npm.config.get('before')) { - this.idealTree = { - package: this.currentTree.package, - path: this.currentTree.path, - realpath: this.currentTree.realpath, - children: [], - requires: [], - missingDeps: {}, - missingDevDeps: {}, - requiredBy: [], - error: this.currentTree.error, - warnings: [], - isTop: true - } - } else { - this.idealTree = copyTree(this.currentTree) - this.idealTree.warnings = [] - } - - cb() -} - -Installer.prototype.loadShrinkwrap = function (cb) { - validate('F', arguments) - log.silly('install', 'loadShrinkwrap') - readShrinkwrap.andInflate(this.idealTree, iferr(cb, () => { - computeMetadata(this.idealTree) - cb() - })) -} - -Installer.prototype.getInstalledModules = function () { - return this.differences.filter(function (action) { - var mutation = action[0] - return (mutation === 'add' || mutation === 'update') - }).map(function (action) { - var child = action[1] - return [child.package._id, child.path] - }) -} - -Installer.prototype.printWarnings = function (cb) { - if (!this.idealTree) return cb() - - var self = this - var warned = false - this.idealTree.warnings.forEach(function (warning) { - if (warning.code === 'EPACKAGEJSON' && self.global) return - if (warning.code === 'ENOTDIR') return - warned = true - var msg = errorMessage(warning) - msg.summary.forEach(function (logline) { - log.warn.apply(log, logline) - }) - msg.detail.forEach(function (logline) { - log.verbose.apply(log, logline) - }) - }) - if (warned && log.levels[npm.config.get('loglevel')] <= log.levels.warn) console.error() - cb() -} - -Installer.prototype.printInstalled = function (cb) { - validate('F', arguments) - if (this.failing) return cb() - log.silly('install', 'printInstalled') - const diffs = this.differences - if (!this.idealTree.error && this.idealTree.removedChildren) { - const deps = this.currentTree.package.dependencies || {} - const dev = this.currentTree.package.devDependencies || {} - this.idealTree.removedChildren.forEach((r) => { - if (diffs.some((d) => d[0] === 'remove' && d[1].path === r.path)) return - if (!deps[moduleName(r)] && !dev[moduleName(r)]) return - diffs.push(['remove', r]) - }) - } - return Bluebird.try(() => { - if (!this.auditSubmission) return - return Bluebird.resolve(this.auditSubmission).timeout(10000).catch(() => null) - }).then((auditResult) => { - if (auditResult && !auditResult.metadata) { - log.warn('audit', 'Audit result from registry missing metadata. This is probably an issue with the registry.') - } - // maybe write audit report w/ hash of pjson & shrinkwrap for later reading by `npm audit` - if (npm.config.get('json')) { - return this.printInstalledForJSON(diffs, auditResult) - } else if (npm.config.get('parseable')) { - return this.printInstalledForParseable(diffs, auditResult) - } else { - return this.printInstalledForHuman(diffs, auditResult) - } - }).asCallback(cb) -} - -Installer.prototype.printInstalledForHuman = function (diffs, auditResult) { - var removed = 0 - var added = 0 - var updated = 0 - var moved = 0 - // Count the number of contributors to packages added, tracking - // contributors we've seen, so we can produce a running unique count. - var contributors = new Set() - diffs.forEach(function (action) { - var mutation = action[0] - var pkg = action[1] - if (pkg.failed) return - if (mutation === 'remove') { - ++removed - } else if (mutation === 'move') { - ++moved - } else if (mutation === 'add') { - ++added - // Count contributors to added packages. Start by combining `author` - // and `contributors` data into a single array of contributor-people - // for this package. - var people = [] - var meta = pkg.package - if (meta.author) people.push(meta.author) - if (meta.contributors && Array.isArray(meta.contributors)) { - people = people.concat(meta.contributors) - } - // Make sure a normalized string for every person behind this - // package is in `contributors`. - people.forEach(function (person) { - // Ignore errors from malformed `author` and `contributors`. - try { - var normalized = normalizePerson(person) - } catch (error) { - return - } - if (!contributors.has(normalized)) contributors.add(normalized) - }) - } else if (mutation === 'update' || mutation === 'update-linked') { - ++updated - } - }) - var report = '' - if (this.args.length && (added || updated)) { - report += this.args.map((p) => { - return `+ ${p.name}@${p.version}${ - !p._requested.name || p._requested.name === p.name - ? '' - : ` (as ${p._requested.name})` - }` - }).join('\n') + '\n' - } - var actions = [] - if (added) { - var action = 'added ' + packages(added) - if (contributors.size) action += from(contributors.size) - actions.push(action) - } - if (removed) actions.push('removed ' + packages(removed)) - if (updated) actions.push('updated ' + packages(updated)) - if (moved) actions.push('moved ' + packages(moved)) - if (auditResult && auditResult.metadata && auditResult.metadata.totalDependencies) { - actions.push('audited ' + packages(auditResult.metadata.totalDependencies)) - } - if (actions.length === 0) { - report += 'up to date' - } else if (actions.length === 1) { - report += actions[0] - } else { - var lastAction = actions.pop() - report += actions.join(', ') + ' and ' + lastAction - } - report += ' in ' + ((Date.now() - this.started) / 1000) + 's' - - output(report) - - function packages (num) { - return num + ' package' + (num > 1 ? 's' : '') - } - - function from (num) { - return ' from ' + num + ' contributor' + (num > 1 ? 's' : '') - } - - // Values of `author` and elements of `contributors` in `package.json` - // files can be e-mail style strings or Objects with `name`, `email, - // and `url` String properties. Convert Objects to Strings so that - // we can efficiently keep a set of contributors we have already seen. - function normalizePerson (argument) { - if (typeof argument === 'string') return argument - var returned = '' - if (argument.name) returned += argument.name - if (argument.email) returned += ' <' + argument.email + '>' - if (argument.url) returned += ' (' + argument.email + ')' - return returned - } - - const { fund, idealTree } = this - const printFundingReport = getPrintFundingReport({ - fund, - idealTree - }) - if (printFundingReport.length) { - output(printFundingReport) - } - - if (auditResult) { - return audit.printInstallReport(auditResult) - } -} - -Installer.prototype.printInstalledForJSON = function (diffs, auditResult) { - const { fund, idealTree } = this - const printFundingReport = getPrintFundingReportJSON({ - fund, - idealTree - }) - var result = { - added: [], - removed: [], - updated: [], - moved: [], - failed: [], - warnings: [], - audit: auditResult, - funding: printFundingReport, - elapsed: Date.now() - this.started - } - var self = this - this.idealTree.warnings.forEach(function (warning) { - if (warning.code === 'EPACKAGEJSON' && self.global) return - if (warning.code === 'ENOTDIR') return - var output = errorMessage(warning) - var message = flattenMessage(output.summary) - if (output.detail.length) { - message += '\n' + flattenMessage(output.detail) - } - result.warnings.push(message) - }) - diffs.forEach(function (action) { - var mutation = action[0] - var child = action[1] - var record = recordAction(action) - if (child.failed) { - result.failed.push(record) - } else if (mutation === 'add') { - result.added.push(record) - } else if (mutation === 'update' || mutation === 'update-linked') { - result.updated.push(record) - } else if (mutation === 'move') { - result.moved.push(record) - } else if (mutation === 'remove') { - result.removed.push(record) - } - }) - output(JSON.stringify(result, null, 2)) - - function flattenMessage (msg) { - return msg.map(function (logline) { return logline.slice(1).join(' ') }).join('\n') - } - - function recordAction (action) { - var mutation = action[0] - var child = action[1] - const isAlias = child.package && child.package._requested && child.package._requested.type === 'alias' - const name = isAlias - ? child.package._requested.name - : child.package && child.package.name - var result = { - action: mutation, - name, - version: child.package && `${isAlias ? `npm:${child.package.name}@` : ''}${child.package.version}`, - path: child.path + } catch { + return cb(null, []) // invalid dir: no matching } - if (mutation === 'move') { - result.previousPath = child.fromPath - } else if (mutation === 'update') { - result.previousVersion = child.oldPkg.package && child.oldPkg.package.version - } - return result } -} - -Installer.prototype.printInstalledForParseable = function (diffs) { - var self = this - diffs.forEach(function (action) { - var mutation = action[0] - var child = action[1] - if (mutation === 'move') { - var previousPath = path.relative(self.where, child.fromPath) - } else if (mutation === 'update') { - var previousVersion = child.oldPkg.package && child.oldPkg.package.version - } - const isAlias = child.package._requested && child.package._requested.type === 'alias' - const version = child.package && isAlias - ? `npm:${child.package.name}@${child.package.version}` - : child.package - ? child.package.version - : '' - output( - mutation + '\t' + - moduleName(child) + '\t' + - version + '\t' + - (child.path ? path.relative(self.where, child.path) : '') + '\t' + - (previousVersion || '') + '\t' + - (previousPath || '')) - }) -} - -Installer.prototype.debugActions = function (name, actionListName, cb) { - validate('SSF', arguments) - var actionsToLog = this[actionListName] - log.silly(name, 'action count', actionsToLog.length) - actionsToLog.forEach(function (action) { - log.silly(name, action.map(function (value) { - return (value && value.package) ? packageId(value) : value - }).join(' ')) - }) + // Note: there used to be registry completion here, + // but it stopped making sense somewhere around + // 50,000 packages on the registry cb() } -// This takes an object and a property name instead of a value to allow us -// to define the arguments for use by chain before the property exists yet. -Installer.prototype.debugTree = function (name, treeName, cb) { - validate('SSF', arguments) - log.silly(name, this.archyDebugTree(this[treeName]).trim()) - cb() -} - -Installer.prototype.archyDebugTree = function (tree) { - validate('O', arguments) - var seen = new Set() - function byName (aa, bb) { - return packageId(aa).localeCompare(packageId(bb)) - } - function expandTree (tree) { - seen.add(tree) - return { - label: packageId(tree), - nodes: tree.children.filter((tree) => { return !seen.has(tree) && !tree.removed }).sort(byName).map(expandTree) - } - } - return archy(expandTree(tree), '', { unicode: npm.config.get('unicode') }) -} - -Installer.prototype.debugLogicalTree = function (name, treeName, cb) { - validate('SSF', arguments) - this[treeName] && log.silly(name, this.archyDebugLogicalTree(this[treeName]).trim()) - cb() -} - -Installer.prototype.archyDebugLogicalTree = function (tree) { - validate('O', arguments) - var seen = new Set() - function byName (aa, bb) { - return packageId(aa).localeCompare(packageId(bb)) - } - function expandTree (tree) { - seen.add(tree) - return { - label: packageId(tree), - nodes: tree.requires.filter((tree) => { return !seen.has(tree) && !tree.removed }).sort(byName).map(expandTree) - } - } - return archy(expandTree(tree), '', { unicode: npm.config.get('unicode') }) -} +module.exports = Object.assign(install, { usage, completion }) diff --git a/deps/npm/lib/install/access-error.js b/deps/npm/lib/install/access-error.js deleted file mode 100644 index ff94be98576379..00000000000000 --- a/deps/npm/lib/install/access-error.js +++ /dev/null @@ -1,8 +0,0 @@ -'use strict' -module.exports = function (dir, er) { - if (!er) return - var accessEr = new Error("EACCES, access '" + dir + "'", -13) - accessEr.code = 'EACCES' - accessEr.path = dir - return accessEr -} diff --git a/deps/npm/lib/install/action/build.js b/deps/npm/lib/install/action/build.js deleted file mode 100644 index be2c141f0dc97b..00000000000000 --- a/deps/npm/lib/install/action/build.js +++ /dev/null @@ -1,13 +0,0 @@ -'use strict' -var chain = require('slide').chain -var build = require('../../build.js') -var npm = require('../../npm.js') -var packageId = require('../../utils/package-id.js') - -module.exports = function (staging, pkg, log, next) { - log.silly('build', packageId(pkg)) - chain([ - [build.linkStuff, pkg.package, pkg.path, npm.config.get('global')], - [build.writeBuiltinConf, pkg.package, pkg.path] - ], next) -} diff --git a/deps/npm/lib/install/action/extract-worker.js b/deps/npm/lib/install/action/extract-worker.js deleted file mode 100644 index 225e5b4aeab668..00000000000000 --- a/deps/npm/lib/install/action/extract-worker.js +++ /dev/null @@ -1,18 +0,0 @@ -'use strict' - -const BB = require('bluebird') - -const extract = require('pacote/extract') -// const npmlog = require('npmlog') - -module.exports = (args, cb) => { - const parsed = typeof args === 'string' ? JSON.parse(args) : args - const spec = parsed[0] - const extractTo = parsed[1] - const opts = parsed[2] - // if (!opts.log) { - // opts.log = npmlog - // } - // opts.log.level = opts.loglevel || opts.log.level - BB.resolve(extract(spec, extractTo, opts)).nodeify(cb) -} diff --git a/deps/npm/lib/install/action/extract.js b/deps/npm/lib/install/action/extract.js deleted file mode 100644 index 585580edd29b78..00000000000000 --- a/deps/npm/lib/install/action/extract.js +++ /dev/null @@ -1,140 +0,0 @@ -'use strict' - -const BB = require('bluebird') - -const figgyPudding = require('figgy-pudding') -const stat = BB.promisify(require('graceful-fs').stat) -const gentlyRm = BB.promisify(require('../../utils/gently-rm.js')) -const mkdirp = BB.promisify(require('gentle-fs').mkdir) -const moduleName = require('../../utils/module-name.js') -const moduleStagingPath = require('../module-staging-path.js') -const move = require('../../utils/move.js') -const npa = require('npm-package-arg') -const npm = require('../../npm.js') -let npmConfig -const packageId = require('../../utils/package-id.js') -const path = require('path') -const localWorker = require('./extract-worker.js') -const workerFarm = require('worker-farm') -const isRegistry = require('../../utils/is-registry.js') - -const WORKER_PATH = require.resolve('./extract-worker.js') -let workers - -const ExtractOpts = figgyPudding({ - log: {} -}, { other () { return true } }) - -// Disabled for now. Re-enable someday. Just not today. -const ENABLE_WORKERS = false - -extract.init = () => { - if (ENABLE_WORKERS) { - workers = workerFarm({ - maxConcurrentCallsPerWorker: npm.limit.fetch, - maxRetries: 1 - }, WORKER_PATH) - } - return BB.resolve() -} -extract.teardown = () => { - if (ENABLE_WORKERS) { - workerFarm.end(workers) - workers = null - } - return BB.resolve() -} -module.exports = extract -function extract (staging, pkg, log) { - log.silly('extract', packageId(pkg)) - const extractTo = moduleStagingPath(staging, pkg) - if (!npmConfig) { - npmConfig = require('../../config/figgy-config.js') - } - let opts = ExtractOpts(npmConfig()).concat({ - integrity: pkg.package._integrity, - resolved: pkg.package._resolved - }) - const args = [ - pkg.package._requested, - extractTo, - opts - ] - return BB.fromNode((cb) => { - let launcher = localWorker - let msg = args - const spec = typeof args[0] === 'string' ? npa(args[0]) : args[0] - args[0] = spec.raw - if (ENABLE_WORKERS && (isRegistry(spec) || spec.type === 'remote')) { - // We can't serialize these options - opts = opts.concat({ - loglevel: opts.log.level, - log: null, - dirPacker: null, - Promise: null, - _events: null, - _eventsCount: null, - list: null, - sources: null, - _maxListeners: null, - root: null - }) - // workers will run things in parallel! - launcher = workers - try { - msg = JSON.stringify(msg) - } catch (e) { - return cb(e) - } - } - launcher(msg, cb) - }).then(() => { - if (pkg.package.bundleDependencies || anyBundled(pkg)) { - return readBundled(pkg, staging, extractTo) - } - }).then(() => { - return gentlyRm(path.join(extractTo, 'node_modules')) - }) -} - -function anyBundled (top, pkg) { - if (!pkg) pkg = top - return pkg.children.some((child) => child.fromBundle === top || anyBundled(top, child)) -} - -function readBundled (pkg, staging, extractTo) { - return BB.map(pkg.children, (child) => { - if (!child.fromBundle) return - if (child.error) { - throw child.error - } else { - return stageBundledModule(pkg, child, staging, extractTo) - } - }, {concurrency: 10}) -} - -function stageBundledModule (bundler, child, staging, parentPath) { - const stageFrom = path.join(parentPath, 'node_modules', moduleName(child)) - const stageTo = moduleStagingPath(staging, child) - - return BB.map(child.children, (child) => { - if (child.error) { - throw child.error - } else { - return stageBundledModule(bundler, child, staging, stageFrom) - } - }).then(() => { - return finishModule(bundler, child, stageTo, stageFrom) - }) -} - -function finishModule (bundler, child, stageTo, stageFrom) { - // If we were the one's who bundled this module… - if (child.fromBundle === bundler) { - return mkdirp(path.dirname(stageTo)).then(() => { - return move(stageFrom, stageTo) - }) - } else { - return stat(stageFrom).then(() => gentlyRm(stageFrom), () => {}) - } -} diff --git a/deps/npm/lib/install/action/fetch.js b/deps/npm/lib/install/action/fetch.js deleted file mode 100644 index 346194e51607e1..00000000000000 --- a/deps/npm/lib/install/action/fetch.js +++ /dev/null @@ -1,16 +0,0 @@ -'use strict' - -const BB = require('bluebird') - -const finished = BB.promisify(require('mississippi').finished) -const npmConfig = require('../../config/figgy-config.js') -const packageId = require('../../utils/package-id.js') -const pacote = require('pacote') - -module.exports = fetch -function fetch (staging, pkg, log, next) { - log.silly('fetch', packageId(pkg)) - const opts = npmConfig({integrity: pkg.package._integrity}) - return finished(pacote.tarball.stream(pkg.package._requested, opts)) - .then(() => next(), next) -} diff --git a/deps/npm/lib/install/action/finalize.js b/deps/npm/lib/install/action/finalize.js deleted file mode 100644 index 1e53c189d210e6..00000000000000 --- a/deps/npm/lib/install/action/finalize.js +++ /dev/null @@ -1,106 +0,0 @@ -'use strict' -const path = require('path') -const fs = require('graceful-fs') -const Bluebird = require('bluebird') -const rimraf = Bluebird.promisify(require('rimraf')) -const mkdirp = Bluebird.promisify(require('gentle-fs').mkdir) -const lstat = Bluebird.promisify(fs.lstat) -const readdir = Bluebird.promisify(fs.readdir) -const symlink = Bluebird.promisify(fs.symlink) -const gentlyRm = Bluebird.promisify(require('../../utils/gently-rm')) -const moduleStagingPath = require('../module-staging-path.js') -const move = require('move-concurrently') -const moveOpts = {fs: fs, Promise: Bluebird, maxConcurrency: 4} -const getRequested = require('../get-requested.js') -const log = require('npmlog') -const packageId = require('../../utils/package-id.js') - -module.exports = function (staging, pkg, log) { - log.silly('finalize', pkg.realpath) - - const extractedTo = moduleStagingPath(staging, pkg) - - const delpath = path.join(path.dirname(pkg.realpath), '.' + path.basename(pkg.realpath) + '.DELETE') - let movedDestAway = false - - const requested = pkg.package._requested || getRequested(pkg) - if (requested.type === 'directory') { - const relative = path.relative(path.dirname(pkg.path), pkg.realpath) - return makeParentPath(pkg.path) - .then(() => symlink(relative, pkg.path, 'junction')) - .catch((ex) => { - return rimraf(pkg.path).then(() => symlink(relative, pkg.path, 'junction')) - }) - } else { - return makeParentPath(pkg.realpath) - .then(moveStagingToDestination) - .then(restoreOldNodeModules) - .catch((err) => { - if (movedDestAway) { - return rimraf(pkg.realpath).then(moveOldDestinationBack).then(() => { - throw err - }) - } else { - throw err - } - }) - .then(() => rimraf(delpath)) - } - - function makeParentPath (dir) { - return mkdirp(path.dirname(dir)) - } - - function moveStagingToDestination () { - return destinationIsClear() - .then(actuallyMoveStaging) - .catch(() => moveOldDestinationAway().then(actuallyMoveStaging)) - } - - function destinationIsClear () { - return lstat(pkg.realpath).then(() => { - throw new Error('destination exists') - }, () => {}) - } - - function actuallyMoveStaging () { - return move(extractedTo, pkg.realpath, moveOpts) - } - - function moveOldDestinationAway () { - return rimraf(delpath).then(() => { - return move(pkg.realpath, delpath, moveOpts) - }).then(() => { movedDestAway = true }) - } - - function moveOldDestinationBack () { - return move(delpath, pkg.realpath, moveOpts).then(() => { movedDestAway = false }) - } - - function restoreOldNodeModules () { - if (!movedDestAway) return - return readdir(path.join(delpath, 'node_modules')).catch(() => []).then((modules) => { - if (!modules.length) return - return mkdirp(path.join(pkg.realpath, 'node_modules')).then(() => Bluebird.map(modules, (file) => { - const from = path.join(delpath, 'node_modules', file) - const to = path.join(pkg.realpath, 'node_modules', file) - return move(from, to, moveOpts) - })) - }) - } -} - -module.exports.rollback = function (top, staging, pkg) { - return Bluebird.try(() => { - const requested = pkg.package._requested || getRequested(pkg) - if (requested && requested.type === 'directory') return Promise.resolve() - // strictly speaking rolling back a finalize should ONLY remove module that - // was being finalized, not any of the things under it. But currently - // those modules are guaranteed to be useless so we may as well remove them too. - // When/if we separate `commit` step and can rollback to previous versions - // of upgraded modules then we'll need to revisit this… - return gentlyRm(pkg.path, false, top).catch((err) => { - log.warn('rollback', `Rolling back ${packageId(pkg)} failed (this is probably harmless): ${err.message ? err.message : err}`) - }) - }) -} diff --git a/deps/npm/lib/install/action/global-install.js b/deps/npm/lib/install/action/global-install.js deleted file mode 100644 index 44d2f628f2c731..00000000000000 --- a/deps/npm/lib/install/action/global-install.js +++ /dev/null @@ -1,18 +0,0 @@ -'use strict' -var path = require('path') -var npm = require('../../npm.js') -var Installer = require('../../install.js').Installer -var packageId = require('../../utils/package-id.js') -var moduleName = require('../../utils/module-name.js') - -module.exports = function (staging, pkg, log, next) { - log.silly('global-install', packageId(pkg)) - var globalRoot = path.resolve(npm.globalDir, '..') - npm.config.set('global', true) - var install = new Installer(globalRoot, false, [moduleName(pkg) + '@' + pkg.package._requested.rawSpec]) - install.link = false - install.run(function () { - npm.config.set('global', false) - next.apply(null, arguments) - }) -} diff --git a/deps/npm/lib/install/action/global-link.js b/deps/npm/lib/install/action/global-link.js deleted file mode 100644 index c9d9a8feb2af78..00000000000000 --- a/deps/npm/lib/install/action/global-link.js +++ /dev/null @@ -1,9 +0,0 @@ -'use strict' -var moduleName = require('../../utils/module-name.js') -var npm = require('../../npm.js') -var packageId = require('../../utils/package-id.js') - -module.exports = function (staging, pkg, log, next) { - log.silly('global-link', packageId(pkg)) - npm.link(moduleName(pkg), next) -} diff --git a/deps/npm/lib/install/action/install.js b/deps/npm/lib/install/action/install.js deleted file mode 100644 index a5cf63b7396a03..00000000000000 --- a/deps/npm/lib/install/action/install.js +++ /dev/null @@ -1,8 +0,0 @@ -'use strict' -var lifecycle = require('../../utils/lifecycle.js') -var packageId = require('../../utils/package-id.js') - -module.exports = function (staging, pkg, log, next) { - log.silly('install', packageId(pkg)) - lifecycle(pkg.package, 'install', pkg.path, next) -} diff --git a/deps/npm/lib/install/action/move.js b/deps/npm/lib/install/action/move.js deleted file mode 100644 index 8a956f59d6d908..00000000000000 --- a/deps/npm/lib/install/action/move.js +++ /dev/null @@ -1,96 +0,0 @@ -'use strict' -var fs = require('graceful-fs') -var path = require('path') -var chain = require('slide').chain -var iferr = require('iferr') -var rimraf = require('rimraf') -var mkdirp = require('gentle-fs').mkdir -var rmStuff = require('../../unbuild.js').rmStuff -var lifecycle = require('../../utils/lifecycle.js') -var move = require('../../utils/move.js') - -/* - Move a module from one point in the node_modules tree to another. - Do not disturb either the source or target location's node_modules - folders. -*/ - -module.exports = function (staging, pkg, log, next) { - log.silly('move', pkg.fromPath, pkg.path) - chain([ - [lifecycle, pkg.package, 'preuninstall', pkg.fromPath, { failOk: true }], - [lifecycle, pkg.package, 'uninstall', pkg.fromPath, { failOk: true }], - [rmStuff, pkg.package, pkg.fromPath], - [lifecycle, pkg.package, 'postuninstall', pkg.fromPath, { failOk: true }], - [moveModuleOnly, pkg.fromPath, pkg.path, log], - [lifecycle, pkg.package, 'preinstall', pkg.path, { failOk: true }], - [removeEmptyParents, path.resolve(pkg.fromPath, '..')] - ], next) -} - -function removeEmptyParents (pkgdir, next) { - fs.rmdir(pkgdir, function (er) { - // FIXME: Make sure windows does what we want here - if (er && er.code !== 'ENOENT') return next() - removeEmptyParents(path.resolve(pkgdir, '..'), next) - }) -} - -function moveModuleOnly (from, to, log, done) { - var fromModules = path.join(from, 'node_modules') - var tempFromModules = from + '.node_modules' - var toModules = path.join(to, 'node_modules') - var tempToModules = to + '.node_modules' - - log.silly('move', 'move existing destination node_modules away', toModules) - - move(toModules, tempToModules).then(removeDestination(done), removeDestination(done)) - - function removeDestination (next) { - return function (er) { - log.silly('move', 'remove existing destination', to) - if (er) { - rimraf(to, iferr(next, makeDestination(next))) - } else { - rimraf(to, iferr(next, makeDestination(iferr(next, moveToModulesBack(next))))) - } - } - } - - function moveToModulesBack (next) { - return function () { - log.silly('move', 'move existing destination node_modules back', toModules) - move(tempToModules, toModules).then(next, done) - } - } - - function makeDestination (next) { - return function () { - log.silly('move', 'make sure destination parent exists', path.resolve(to, '..')) - mkdirp(path.resolve(to, '..'), iferr(done, moveNodeModules(next))) - } - } - - function moveNodeModules (next) { - return function () { - log.silly('move', 'move source node_modules away', fromModules) - move(fromModules, tempFromModules).then(doMove(moveNodeModulesBack(next)), doMove(next)) - } - } - - function doMove (next) { - return function () { - log.silly('move', 'move module dir to final dest', from, to) - move(from, to).then(next, done) - } - } - - function moveNodeModulesBack (next) { - return function () { - mkdirp(from, iferr(done, function () { - log.silly('move', 'put source node_modules back', fromModules) - move(tempFromModules, fromModules).then(next, done) - })) - } - } -} diff --git a/deps/npm/lib/install/action/postinstall.js b/deps/npm/lib/install/action/postinstall.js deleted file mode 100644 index 01accb2a471657..00000000000000 --- a/deps/npm/lib/install/action/postinstall.js +++ /dev/null @@ -1,8 +0,0 @@ -'use strict' -var lifecycle = require('../../utils/lifecycle.js') -var packageId = require('../../utils/package-id.js') - -module.exports = function (staging, pkg, log, next) { - log.silly('postinstall', packageId(pkg)) - lifecycle(pkg.package, 'postinstall', pkg.path, next) -} diff --git a/deps/npm/lib/install/action/preinstall.js b/deps/npm/lib/install/action/preinstall.js deleted file mode 100644 index 374ff563326c01..00000000000000 --- a/deps/npm/lib/install/action/preinstall.js +++ /dev/null @@ -1,8 +0,0 @@ -'use strict' -var lifecycle = require('../../utils/lifecycle.js') -var packageId = require('../../utils/package-id.js') - -module.exports = function (staging, pkg, log, next) { - log.silly('preinstall', packageId(pkg)) - lifecycle(pkg.package, 'preinstall', pkg.path, next) -} diff --git a/deps/npm/lib/install/action/prepare.js b/deps/npm/lib/install/action/prepare.js deleted file mode 100644 index d48c8e7e86249a..00000000000000 --- a/deps/npm/lib/install/action/prepare.js +++ /dev/null @@ -1,27 +0,0 @@ -'use strict' -var chain = require('slide').chain -var lifecycle = require('../../utils/lifecycle.js') -var packageId = require('../../utils/package-id.js') -var prepublishWarning = require('../../utils/warn-deprecated.js')('prepublish-on-install') -var moduleStagingPath = require('../module-staging-path.js') - -module.exports = function (staging, pkg, log, next) { - log.silly('prepublish', packageId(pkg)) - // TODO: for `npm@5`, change the behavior and remove this warning. - // see https://github.com/npm/npm/issues/10074 for details - if (pkg.package && pkg.package.scripts && pkg.package.scripts.prepublish) { - prepublishWarning([ - 'As of npm@5, `prepublish` scripts are deprecated.', - 'Use `prepare` for build steps and `prepublishOnly` for upload-only.', - 'See the deprecation note in `npm help scripts` for more information.' - ]) - } - var buildpath = moduleStagingPath(staging, pkg) - chain( - [ - [lifecycle, pkg.package, 'prepublish', buildpath], - [lifecycle, pkg.package, 'prepare', buildpath] - ], - next - ) -} diff --git a/deps/npm/lib/install/action/refresh-package-json.js b/deps/npm/lib/install/action/refresh-package-json.js deleted file mode 100644 index 32e64444445cbd..00000000000000 --- a/deps/npm/lib/install/action/refresh-package-json.js +++ /dev/null @@ -1,45 +0,0 @@ -'use strict' - -const Bluebird = require('bluebird') - -const checkPlatform = Bluebird.promisify(require('npm-install-checks').checkPlatform) -const getRequested = require('../get-requested.js') -const npm = require('../../npm.js') -const path = require('path') -const readJson = Bluebird.promisify(require('read-package-json')) -const updatePackageJson = Bluebird.promisify(require('../update-package-json')) - -module.exports = function (staging, pkg, log) { - log.silly('refresh-package-json', pkg.realpath) - - return readJson(path.join(pkg.path, 'package.json'), false).then((metadata) => { - Object.keys(pkg.package).forEach(function (key) { - if (key !== 'version' && key !== 'dependencies' && !isEmpty(pkg.package[key])) { - metadata[key] = pkg.package[key] - } - }) - if (metadata._resolved == null && pkg.fakeChild) { - metadata._resolved = pkg.fakeChild.resolved - } - // These two sneak in and it's awful - delete metadata.readme - delete metadata.readmeFilename - - pkg.package = metadata - pkg.fakeChild = false - }).catch(() => 'ignore').then(() => { - return checkPlatform(pkg.package, npm.config.get('force')) - }).then(() => { - const requested = pkg.package._requested || getRequested(pkg) - if (requested.type !== 'directory') { - return updatePackageJson(pkg, pkg.path) - } - }) -} - -function isEmpty (value) { - if (value == null) return true - if (Array.isArray(value)) return !value.length - if (typeof value === 'object') return !Object.keys(value).length - return false -} diff --git a/deps/npm/lib/install/action/remove.js b/deps/npm/lib/install/action/remove.js deleted file mode 100644 index f7182d596bed01..00000000000000 --- a/deps/npm/lib/install/action/remove.js +++ /dev/null @@ -1,85 +0,0 @@ -'use strict' -var path = require('path') -var fs = require('graceful-fs') -var rimraf = require('rimraf') -var asyncMap = require('slide').asyncMap -var mkdirp = require('gentle-fs').mkdir -var npm = require('../../npm.js') -var andIgnoreErrors = require('../and-ignore-errors.js') -var move = require('../../utils/move.js') -var isInside = require('path-is-inside') -var vacuum = require('fs-vacuum') - -// This is weird because we want to remove the module but not it's node_modules folder -// allowing for this allows us to not worry about the order of operations -module.exports = function (staging, pkg, log, next) { - log.silly('remove', pkg.path) - if (pkg.target) { - removeLink(pkg, next) - } else { - removeDir(pkg, log, next) - } -} - -function removeLink (pkg, next) { - var base = isInside(pkg.path, npm.prefix) ? npm.prefix : pkg.path - rimraf(pkg.path, (err) => { - if (err) return next(err) - vacuum(pkg.path, {base: base}, next) - }) -} - -function removeDir (pkg, log, next) { - var modpath = path.join(path.dirname(pkg.path), '.' + path.basename(pkg.path) + '.MODULES') - - move(path.join(pkg.path, 'node_modules'), modpath).then(unbuildPackage, unbuildPackage) - - function unbuildPackage (moveEr) { - rimraf(pkg.path, moveEr ? andRemoveEmptyParents(pkg.path) : moveModulesBack) - } - - function andRemoveEmptyParents (path) { - return function (er) { - if (er) return next(er) - removeEmptyParents(pkg.path) - } - } - - function moveModulesBack () { - fs.readdir(modpath, makeTarget) - } - - function makeTarget (readdirEr, files) { - if (readdirEr) return cleanup() - if (!files.length) return cleanup() - mkdirp(path.join(pkg.path, 'node_modules'), function (mkdirEr) { moveModules(mkdirEr, files) }) - } - - function moveModules (mkdirEr, files) { - if (mkdirEr) return next(mkdirEr) - asyncMap(files, function (file, done) { - var from = path.join(modpath, file) - var to = path.join(pkg.path, 'node_modules', file) - // we ignore errors here, because they can legitimately happen, for instance, - // bundled modules will be in both node_modules folders - move(from, to).then(andIgnoreErrors(done), andIgnoreErrors(done)) - }, cleanup) - } - - function cleanup () { - rimraf(modpath, afterCleanup) - } - - function afterCleanup (rimrafEr) { - if (rimrafEr) log.warn('remove', rimrafEr) - removeEmptyParents(path.resolve(pkg.path, '..')) - } - - function removeEmptyParents (pkgdir) { - fs.rmdir(pkgdir, function (er) { - // FIXME: Make sure windows does what we want here - if (er && er.code !== 'ENOENT') return next() - removeEmptyParents(path.resolve(pkgdir, '..')) - }) - } -} diff --git a/deps/npm/lib/install/action/unbuild.js b/deps/npm/lib/install/action/unbuild.js deleted file mode 100644 index dbfbd9c4b12cc8..00000000000000 --- a/deps/npm/lib/install/action/unbuild.js +++ /dev/null @@ -1,16 +0,0 @@ -'use strict' -var Bluebird = require('bluebird') -var lifecycle = Bluebird.promisify(require('../../utils/lifecycle.js')) -var packageId = require('../../utils/package-id.js') -var rmStuff = Bluebird.promisify(require('../../unbuild.js').rmStuff) - -module.exports = function (staging, pkg, log) { - log.silly('unbuild', packageId(pkg)) - return lifecycle(pkg.package, 'preuninstall', pkg.path, { failOk: true }).then(() => { - return lifecycle(pkg.package, 'uninstall', pkg.path, { failOk: true }) - }).then(() => { - return rmStuff(pkg.package, pkg.path) - }).then(() => { - return lifecycle(pkg.package, 'postuninstall', pkg.path, { failOk: true }) - }) -} diff --git a/deps/npm/lib/install/actions.js b/deps/npm/lib/install/actions.js deleted file mode 100644 index e26432b77c86a8..00000000000000 --- a/deps/npm/lib/install/actions.js +++ /dev/null @@ -1,192 +0,0 @@ -'use strict' - -const BB = require('bluebird') - -const andAddParentToErrors = require('./and-add-parent-to-errors.js') -const failedDependency = require('./deps.js').failedDependency -const isInstallable = BB.promisify(require('./validate-args.js').isInstallable) -const moduleName = require('../utils/module-name.js') -const npm = require('../npm.js') -const reportOptionalFailure = require('./report-optional-failure.js') -const validate = require('aproba') - -const actions = {} - -actions.fetch = require('./action/fetch.js') -actions.extract = require('./action/extract.js') -actions.build = require('./action/build.js') -actions.preinstall = require('./action/preinstall.js') -actions.install = require('./action/install.js') -actions.postinstall = require('./action/postinstall.js') -actions.prepare = require('./action/prepare.js') -actions.finalize = require('./action/finalize.js') -actions.remove = require('./action/remove.js') -actions.unbuild = require('./action/unbuild.js') -actions.move = require('./action/move.js') -actions['global-install'] = require('./action/global-install.js') -actions['global-link'] = require('./action/global-link.js') -actions['refresh-package-json'] = require('./action/refresh-package-json.js') - -// FIXME: We wrap actions like three ways to sunday here. -// Rewrite this to only work one way. - -Object.keys(actions).forEach(function (actionName) { - var action = actions[actionName] - actions[actionName] = (staging, pkg, log) => { - validate('SOO', [staging, pkg, log]) - // refuse to run actions for failed packages - if (pkg.failed) return BB.resolve() - if (action.rollback) { - if (!pkg.rollback) pkg.rollback = [] - pkg.rollback.unshift(action.rollback) - } - if (action.commit) { - if (!pkg.commit) pkg.commit = [] - pkg.commit.push(action.commit) - } - - let actionP - if (pkg.knownInstallable) { - actionP = runAction(action, staging, pkg, log) - } else { - actionP = isInstallable(null, pkg.package).then(() => { - pkg.knownInstallable = true - return runAction(action, staging, pkg, log) - }) - } - - return actionP.then(() => { - log.finish() - }, (err) => { - return BB.fromNode((cb) => { - andAddParentToErrors(pkg.parent, cb)(err) - }).catch((err) => { - return handleOptionalDepErrors(pkg, err) - }) - }) - } - actions[actionName].init = action.init || (() => BB.resolve()) - actions[actionName].teardown = action.teardown || (() => BB.resolve()) -}) -exports.actions = actions - -function runAction (action, staging, pkg, log) { - return BB.fromNode((cb) => { - const result = action(staging, pkg, log, cb) - if (result && result.then) { - result.then(() => cb(), cb) - } - }) -} - -function markAsFailed (pkg) { - if (pkg.failed) return - pkg.failed = true - pkg.requires.forEach((req) => { - var requiredBy = req.requiredBy.filter((reqReqBy) => !reqReqBy.failed) - if (requiredBy.length === 0 && !req.userRequired) { - markAsFailed(req) - } - }) -} - -function handleOptionalDepErrors (pkg, err) { - markAsFailed(pkg) - var anyFatal = failedDependency(pkg) - if (anyFatal) { - throw err - } else { - reportOptionalFailure(pkg, null, err) - } -} - -exports.doOne = doOne -function doOne (cmd, staging, pkg, log, next) { - validate('SSOOF', arguments) - const prepped = prepareAction([cmd, pkg], staging, log) - return withInit(actions[cmd], () => { - return execAction(prepped) - }).nodeify(next) -} - -exports.doParallel = doParallel -function doParallel (type, staging, actionsToRun, log, next) { - validate('SSAOF', arguments) - const acts = actionsToRun.reduce((acc, todo) => { - if (todo[0] === type) { - acc.push(prepareAction(todo, staging, log)) - } - return acc - }, []) - log.silly('doParallel', type + ' ' + acts.length) - time(log) - if (!acts.length) { return next() } - return withInit(actions[type], () => { - return BB.map(acts, execAction, { - concurrency: npm.limit.action - }) - }).nodeify((err) => { - log.finish() - timeEnd(log) - next(err) - }) -} - -exports.doSerial = doSerial -function doSerial (type, staging, actionsToRun, log, next) { - validate('SSAOF', arguments) - log.silly('doSerial', '%s %d', type, actionsToRun.length) - runSerial(type, staging, actionsToRun, log, next) -} - -exports.doReverseSerial = doReverseSerial -function doReverseSerial (type, staging, actionsToRun, log, next) { - validate('SSAOF', arguments) - log.silly('doReverseSerial', '%s %d', type, actionsToRun.length) - runSerial(type, staging, [].concat(actionsToRun).reverse(), log, next) -} - -function runSerial (type, staging, actionsToRun, log, next) { - const acts = actionsToRun.reduce((acc, todo) => { - if (todo[0] === type) { - acc.push(prepareAction(todo, staging, log)) - } - return acc - }, []) - time(log) - if (!acts.length) { return next() } - return withInit(actions[type], () => { - return BB.each(acts, execAction) - }).nodeify((err) => { - log.finish() - timeEnd(log) - next(err) - }) -} - -function time (log) { - process.emit('time', 'action:' + log.name) -} -function timeEnd (log) { - process.emit('timeEnd', 'action:' + log.name) -} - -function withInit (action, body) { - return BB.using( - action.init().disposer(() => action.teardown()), - body - ) -} - -function prepareAction (action, staging, log) { - validate('ASO', arguments) - validate('SO', action) - var cmd = action[0] - var pkg = action[1] - if (!actions[cmd]) throw new Error('Unknown decomposed command "' + cmd + '" (is it new?)') - return [actions[cmd], staging, pkg, log.newGroup(cmd + ':' + moduleName(pkg))] -} - -function execAction (todo) { - return todo[0].apply(null, todo.slice(1)) -} diff --git a/deps/npm/lib/install/and-add-parent-to-errors.js b/deps/npm/lib/install/and-add-parent-to-errors.js deleted file mode 100644 index fe4128230b1af5..00000000000000 --- a/deps/npm/lib/install/and-add-parent-to-errors.js +++ /dev/null @@ -1,14 +0,0 @@ -'use strict' -var moduleName = require('../utils/module-name.js') -var validate = require('aproba') - -module.exports = function (parent, cb) { - validate('F', [cb]) - return function (er) { - if (!er) return cb.apply(null, arguments) - if (er instanceof Error && parent && parent.package && parent.package.name) { - er.parent = moduleName(parent) - } - cb(er) - } -} diff --git a/deps/npm/lib/install/and-finish-tracker.js b/deps/npm/lib/install/and-finish-tracker.js deleted file mode 100644 index 2bab60ddc40080..00000000000000 --- a/deps/npm/lib/install/and-finish-tracker.js +++ /dev/null @@ -1,16 +0,0 @@ -'use strict' -var validate = require('aproba') - -module.exports = function (tracker, cb) { - validate('OF', [tracker, cb]) - return function () { - tracker.finish() - cb.apply(null, arguments) - } -} - -module.exports.now = function (tracker, cb) { - validate('OF', [tracker, cb]) - tracker.finish() - cb.apply(null, Array.prototype.slice.call(arguments, 2)) -} diff --git a/deps/npm/lib/install/and-ignore-errors.js b/deps/npm/lib/install/and-ignore-errors.js deleted file mode 100644 index cf46ad82155b5c..00000000000000 --- a/deps/npm/lib/install/and-ignore-errors.js +++ /dev/null @@ -1,9 +0,0 @@ -'use strict' - -module.exports = function (cb) { - return function () { - var args = Array.prototype.slice.call(arguments, 1) - if (args.length) args.unshift(null) - return cb.apply(null, args) - } -} diff --git a/deps/npm/lib/install/audit.js b/deps/npm/lib/install/audit.js deleted file mode 100644 index f5bc5ae1a92d65..00000000000000 --- a/deps/npm/lib/install/audit.js +++ /dev/null @@ -1,279 +0,0 @@ -'use strict' -exports.generate = generate -exports.generateFromInstall = generateFromInstall -exports.submitForInstallReport = submitForInstallReport -exports.submitForFullReport = submitForFullReport -exports.printInstallReport = printInstallReport -exports.printParseableReport = printParseableReport -exports.printFullReport = printFullReport - -const auditReport = require('npm-audit-report') -const npmConfig = require('../config/figgy-config.js') -const figgyPudding = require('figgy-pudding') -const treeToShrinkwrap = require('../shrinkwrap.js').treeToShrinkwrap -const packageId = require('../utils/package-id.js') -const output = require('../utils/output.js') -const npm = require('../npm.js') -const qw = require('qw') -const regFetch = require('npm-registry-fetch') -const perf = require('../utils/perf.js') -const npa = require('npm-package-arg') -const uuid = require('uuid') -const ssri = require('ssri') -const cloneDeep = require('lodash.clonedeep') - -// used when scrubbing module names/specifiers -const runId = uuid.v4() - -const InstallAuditConfig = figgyPudding({ - color: {}, - json: {}, - unicode: {} -}, { - other (key) { - return /:registry$/.test(key) - } -}) - -function submitForInstallReport (auditData) { - const opts = InstallAuditConfig(npmConfig()) - const scopedRegistries = [...opts.keys()].filter( - k => /:registry$/.test(k) - ).map(k => opts[k]) - scopedRegistries.forEach(registry => { - // we don't care about the response so destroy the stream if we can, or leave it flowing - // so it can eventually finish and clean up after itself - regFetch('/-/npm/v1/security/audits/quick', opts.concat({ - method: 'POST', - registry, - gzip: true, - body: auditData - })).then(_ => { - _.body.on('error', () => {}) - if (_.body.destroy) { - _.body.destroy() - } else { - _.body.resume() - } - }, _ => {}) - }) - perf.emit('time', 'audit submit') - return regFetch('/-/npm/v1/security/audits/quick', opts.concat({ - method: 'POST', - gzip: true, - body: auditData - })).then(response => { - perf.emit('timeEnd', 'audit submit') - perf.emit('time', 'audit body') - return response.json() - }).then(result => { - perf.emit('timeEnd', 'audit body') - return result - }) -} - -function submitForFullReport (auditData) { - perf.emit('time', 'audit submit') - const opts = InstallAuditConfig(npmConfig()) - return regFetch('/-/npm/v1/security/audits', opts.concat({ - method: 'POST', - gzip: true, - body: auditData - })).then(response => { - perf.emit('timeEnd', 'audit submit') - perf.emit('time', 'audit body') - return response.json() - }).then(result => { - perf.emit('timeEnd', 'audit body') - result.runId = runId - return result - }) -} - -function printInstallReport (auditResult) { - const opts = InstallAuditConfig(npmConfig()) - return auditReport(auditResult, { - reporter: 'install', - withColor: opts.color, - withUnicode: opts.unicode - }).then(result => output(result.report)) -} - -function printFullReport (auditResult) { - const opts = InstallAuditConfig(npmConfig()) - return auditReport(auditResult, { - log: output, - reporter: opts.json ? 'json' : 'detail', - withColor: opts.color, - withUnicode: opts.unicode - }).then(result => output(result.report)) -} - -function printParseableReport (auditResult) { - const opts = InstallAuditConfig(npmConfig()) - return auditReport(auditResult, { - log: output, - reporter: 'parseable', - withColor: opts.color, - withUnicode: opts.unicode - }).then(result => output(result.report)) -} - -function generate (shrinkwrap, requires, diffs, install, remove) { - const sw = cloneDeep(shrinkwrap) - delete sw.lockfileVersion - sw.requires = scrubRequires(requires) - scrubDeps(sw.dependencies) - - // sw.diffs = diffs || {} - sw.install = (install || []).map(scrubArg) - sw.remove = (remove || []).map(scrubArg) - return generateMetadata().then((md) => { - sw.metadata = md - return sw - }) -} - -const scrubKeys = qw`version` -const deleteKeys = qw`from resolved` - -function scrubDeps (deps) { - if (!deps) return - Object.keys(deps).forEach(name => { - if (!shouldScrubName(name) && !shouldScrubSpec(name, deps[name].version)) return - const value = deps[name] - delete deps[name] - deps[scrub(name)] = value - }) - Object.keys(deps).forEach(name => { - for (let toScrub of scrubKeys) { - if (!deps[name][toScrub]) continue - deps[name][toScrub] = scrubSpec(name, deps[name][toScrub]) - } - for (let toDelete of deleteKeys) delete deps[name][toDelete] - - scrubRequires(deps[name].requires) - scrubDeps(deps[name].dependencies) - }) -} - -function scrubRequires (reqs) { - if (!reqs) return reqs - Object.keys(reqs).forEach(name => { - const spec = reqs[name] - if (shouldScrubName(name) || shouldScrubSpec(name, spec)) { - delete reqs[name] - reqs[scrub(name)] = scrubSpec(name, spec) - } else { - reqs[name] = scrubSpec(name, spec) - } - }) - return reqs -} - -function getScope (name) { - if (name[0] === '@') return name.slice(0, name.indexOf('/')) -} - -function shouldScrubName (name) { - const scope = getScope(name) - const cfg = npm.config // avoid the no-dynamic-lookups test - return Boolean(scope && cfg.get(scope + ':registry')) -} -function shouldScrubSpec (name, spec) { - const req = npa.resolve(name, spec) - return !req.registry -} - -function scrubArg (arg) { - const req = npa(arg) - let name = req.name - if (shouldScrubName(name) || shouldScrubSpec(name, req.rawSpec)) { - name = scrubName(name) - } - const spec = scrubSpec(req.name, req.rawSpec) - return name + '@' + spec -} - -function scrubName (name) { - return shouldScrubName(name) ? scrub(name) : name -} - -function scrubSpec (name, spec) { - const req = npa.resolve(name, spec) - if (req.registry) return spec - if (req.type === 'git') { - return 'git+ssh://' + scrub(spec) - } else if (req.type === 'remote') { - return 'https://' + scrub(spec) - } else if (req.type === 'directory') { - return 'file:' + scrub(spec) - } else if (req.type === 'file') { - return 'file:' + scrub(spec) + '.tar' - } else { - return scrub(spec) - } -} - -module.exports.scrub = scrub -function scrub (value, rid) { - return ssri.fromData((rid || runId) + ' ' + value, {algorithms: ['sha256']}).hexDigest() -} - -function generateMetadata () { - const meta = {} - meta.npm_version = npm.version - meta.node_version = process.version - meta.platform = process.platform - meta.node_env = process.env.NODE_ENV - - return Promise.resolve(meta) -} -/* - const head = path.resolve(npm.prefix, '.git/HEAD') - return readFile(head, 'utf8').then((head) => { - if (!head.match(/^ref: /)) { - meta.commit_hash = head.trim() - return - } - const headFile = head.replace(/^ref: /, '').trim() - meta.branch = headFile.replace(/^refs[/]heads[/]/, '') - return readFile(path.resolve(npm.prefix, '.git', headFile), 'utf8') - }).then((commitHash) => { - meta.commit_hash = commitHash.trim() - const proc = spawn('git', qw`diff --quiet --exit-code package.json package-lock.json`, {cwd: npm.prefix, stdio: 'ignore'}) - return new Promise((resolve, reject) => { - proc.once('error', reject) - proc.on('exit', (code, signal) => { - if (signal == null) meta.state = code === 0 ? 'clean' : 'dirty' - resolve() - }) - }) - }).then(() => meta, () => meta) -*/ - -function generateFromInstall (tree, diffs, install, remove) { - const requires = {} - tree.requires.forEach((pkg) => { - requires[pkg.package.name] = tree.package.dependencies[pkg.package.name] || tree.package.devDependencies[pkg.package.name] || pkg.package.version - }) - - const auditInstall = (install || []).filter((a) => a.name).map(packageId) - const auditRemove = (remove || []).filter((a) => a.name).map(packageId) - const auditDiffs = {} - diffs.forEach((action) => { - const mutation = action[0] - const child = action[1] - if (mutation !== 'add' && mutation !== 'update' && mutation !== 'remove') return - if (!auditDiffs[mutation]) auditDiffs[mutation] = [] - if (mutation === 'add') { - auditDiffs[mutation].push({location: child.location}) - } else if (mutation === 'update') { - auditDiffs[mutation].push({location: child.location, previous: packageId(child.oldPkg)}) - } else if (mutation === 'remove') { - auditDiffs[mutation].push({previous: packageId(child)}) - } - }) - - return generate(treeToShrinkwrap(tree), requires, auditDiffs, auditInstall, auditRemove) -} diff --git a/deps/npm/lib/install/check-permissions.js b/deps/npm/lib/install/check-permissions.js deleted file mode 100644 index 7806fcff993e19..00000000000000 --- a/deps/npm/lib/install/check-permissions.js +++ /dev/null @@ -1,69 +0,0 @@ -'use strict' -var path = require('path') -var log = require('npmlog') -var validate = require('aproba') -var uniq = require('lodash.uniq') -var asyncMap = require('slide').asyncMap -var npm = require('../npm.js') -var exists = require('./exists.js') -var writable = require('./writable.js') - -module.exports = function (actions, next) { - validate('AF', arguments) - var errors = [] - asyncMap(actions, function (action, done) { - var cmd = action[0] - var pkg = action[1] - switch (cmd) { - case 'add': - hasAnyWriteAccess(path.resolve(pkg.path, '..'), errors, done) - break - case 'update': - case 'remove': - hasWriteAccess(pkg.path, errors, andHasWriteAccess(path.resolve(pkg.path, '..'), errors, done)) - break - case 'move': - hasAnyWriteAccess(pkg.path, errors, andHasWriteAccess(path.resolve(pkg.fromPath, '..'), errors, done)) - break - default: - done() - } - }, function () { - if (!errors.length) return next() - uniq(errors.map(function (er) { return 'Missing write access to ' + er.path })).forEach(function (er) { - log.warn('checkPermissions', er) - }) - npm.config.get('force') ? next() : next(errors[0]) - }) -} - -function andHasWriteAccess (dir, errors, done) { - validate('SAF', arguments) - return function () { - hasWriteAccess(dir, errors, done) - } -} - -function hasAnyWriteAccess (dir, errors, done) { - validate('SAF', arguments) - findNearestDir() - function findNearestDir () { - var nextDir = path.resolve(dir, '..') - exists(dir, function (dirDoesntExist) { - if (!dirDoesntExist || nextDir === dir) { - return hasWriteAccess(dir, errors, done) - } else { - dir = nextDir - findNearestDir() - } - }) - } -} - -function hasWriteAccess (dir, errors, done) { - validate('SAF', arguments) - writable(dir, function (er) { - if (er) errors.push(er) - done() - }) -} diff --git a/deps/npm/lib/install/copy-tree.js b/deps/npm/lib/install/copy-tree.js deleted file mode 100644 index 2bf7064f334896..00000000000000 --- a/deps/npm/lib/install/copy-tree.js +++ /dev/null @@ -1,30 +0,0 @@ -'use strict' -var createNode = require('./node.js').create -module.exports = function (tree) { - return copyTree(tree, {}) -} - -function copyTree (tree, cache) { - if (cache[tree.path]) { return cache[tree.path] } - var newTree = cache[tree.path] = createNode(Object.assign({}, tree)) - copyModuleList(newTree, 'children', cache) - newTree.children.forEach(function (child) { - child.parent = newTree - }) - copyModuleList(newTree, 'requires', cache) - copyModuleList(newTree, 'requiredBy', cache) - return newTree -} - -function copyModuleList (tree, key, cache) { - var newList = [] - if (tree[key]) { - tree[key].forEach(function (child) { - const copy = copyTree(child, cache) - if (copy) { - newList.push(copy) - } - }) - } - tree[key] = newList -} diff --git a/deps/npm/lib/install/decompose-actions.js b/deps/npm/lib/install/decompose-actions.js deleted file mode 100644 index ba08e6e7684e51..00000000000000 --- a/deps/npm/lib/install/decompose-actions.js +++ /dev/null @@ -1,79 +0,0 @@ -'use strict' -var validate = require('aproba') -var npm = require('../npm.js') - -module.exports = function (differences, decomposed, next) { - validate('AAF', arguments) - differences.forEach((action) => { - var cmd = action[0] - var pkg = action[1] - switch (cmd) { - case 'add': - addSteps(decomposed, pkg) - break - case 'update': - updateSteps(decomposed, pkg) - break - case 'move': - moveSteps(decomposed, pkg) - break - case 'remove': - removeSteps(decomposed, pkg) - break - default: - defaultSteps(decomposed, cmd, pkg) - } - }) - next() -} - -function addAction (decomposed, action, pkg) { - if (decomposed.some((_) => _[0] === action && _[1] === pkg)) return - decomposed.push([action, pkg]) -} - -function addSteps (decomposed, pkg) { - if (pkg.fromBundle) { - // make sure our source module exists to extract ourselves from - // if we're installing our source module anyway, the duplication - // of these steps will be elided by `addAction` automatically - addAction(decomposed, 'fetch', pkg.fromBundle) - addAction(decomposed, 'extract', pkg.fromBundle) - } - if (!pkg.fromBundle && !pkg.isLink) { - addAction(decomposed, 'fetch', pkg) - addAction(decomposed, 'extract', pkg) - } - if (!pkg.fromBundle || npm.config.get('rebuild-bundle')) { - addAction(decomposed, 'preinstall', pkg) - addAction(decomposed, 'build', pkg) - addAction(decomposed, 'install', pkg) - addAction(decomposed, 'postinstall', pkg) - } - if (!pkg.fromBundle || !pkg.isLink) { - addAction(decomposed, 'finalize', pkg) - } - addAction(decomposed, 'refresh-package-json', pkg) -} - -function updateSteps (decomposed, pkg) { - removeSteps(decomposed, pkg.oldPkg) - addSteps(decomposed, pkg) -} - -function removeSteps (decomposed, pkg) { - addAction(decomposed, 'unbuild', pkg) - addAction(decomposed, 'remove', pkg) -} - -function moveSteps (decomposed, pkg) { - addAction(decomposed, 'move', pkg) - addAction(decomposed, 'build', pkg) - addAction(decomposed, 'install', pkg) - addAction(decomposed, 'postinstall', pkg) - addAction(decomposed, 'refresh-package-json', pkg) -} - -function defaultSteps (decomposed, cmd, pkg) { - addAction(decomposed, cmd, pkg) -} diff --git a/deps/npm/lib/install/deps.js b/deps/npm/lib/install/deps.js deleted file mode 100644 index 960dd375d05bb6..00000000000000 --- a/deps/npm/lib/install/deps.js +++ /dev/null @@ -1,851 +0,0 @@ -'use strict' - -const BB = require('bluebird') - -var fs = require('fs') -var assert = require('assert') -var path = require('path') -var semver = require('semver') -var asyncMap = require('slide').asyncMap -var chain = require('slide').chain -var iferr = require('iferr') -var npa = require('npm-package-arg') -var validate = require('aproba') -var dezalgo = require('dezalgo') -var fetchPackageMetadata = require('../fetch-package-metadata.js') -var andAddParentToErrors = require('./and-add-parent-to-errors.js') -var addBundled = require('../fetch-package-metadata.js').addBundled -var readShrinkwrap = require('./read-shrinkwrap.js') -var inflateShrinkwrap = require('./inflate-shrinkwrap.js') -var inflateBundled = require('./inflate-bundled.js') -var andFinishTracker = require('./and-finish-tracker.js') -var npm = require('../npm.js') -var flatNameFromTree = require('./flatten-tree.js').flatNameFromTree -var createChild = require('./node.js').create -var resetMetadata = require('./node.js').reset -var isInstallable = require('./validate-args.js').isInstallable -var packageId = require('../utils/package-id.js') -var moduleName = require('../utils/module-name.js') -var isDevDep = require('./is-dev-dep.js') -var isProdDep = require('./is-prod-dep.js') -var reportOptionalFailure = require('./report-optional-failure.js') -var getSaveType = require('./save.js').getSaveType -var unixFormatPath = require('../utils/unix-format-path.js') -var isExtraneous = require('./is-extraneous.js') -var isRegistry = require('../utils/is-registry.js') -var hasModernMeta = require('./has-modern-meta.js') - -// The export functions in this module mutate a dependency tree, adding -// items to them. - -var registryTypes = { range: true, version: true } - -function doesChildVersionMatch (child, requested, requestor) { - if (child.fromShrinkwrap && !child.hasRequiresFromLock) return true - // ranges of * ALWAYS count as a match, because when downloading we allow - // prereleases to match * if there are ONLY prereleases - if (requested.type === 'range' && requested.fetchSpec === '*') return true - - if (requested.type === 'directory') { - if (!child.isLink) return false - return path.relative(child.realpath, requested.fetchSpec) === '' - } - - if (requested.type === 'git' && child.fromShrinkwrap) { - const fromSw = child.package._from ? npa(child.package._from) : child.fromShrinkwrap - fromSw.name = requested.name // we're only checking specifiers here - if (fromSw.toString() === requested.toString()) return true - } - - if (requested.type === 'git' && requested.gitRange) { - const sameRepo = npa(child.package._from).fetchSpec === requested.fetchSpec - try { - return sameRepo && semver.satisfies(child.package.version, requested.gitRange, true) - } catch (e) { - return false - } - } - - if (requested.type === 'alias') { - return doesChildVersionMatch(child, requested.subSpec, requestor) - } - - if (!registryTypes[requested.type]) { - var childReq = child.package._requested - if (childReq) { - if (childReq.rawSpec === requested.rawSpec) return true - if (childReq.type === requested.type) { - if (childReq.saveSpec === requested.saveSpec) return true - if ((childReq.fetchSpec === requested.fetchSpec) && requested.type !== 'git') return true - } - } - // If _requested didn't exist OR if it didn't match then we'll try using - // _from. We pass it through npa to normalize the specifier. - // This can happen when installing from an `npm-shrinkwrap.json` where `_requested` will - // be the tarball URL from `resolved` and thus can't match what's in the `package.json`. - // In those cases _from, will be preserved and we can compare that to ensure that they - // really came from the same sources. - // You'll see this scenario happen with at least tags and git dependencies. - // Some buggy clients will write spaces into the module name part of a _from. - if (child.package._from) { - var fromReq = npa(child.package._from) - if (fromReq.rawSpec === requested.rawSpec) return true - if (fromReq.type === requested.type && fromReq.saveSpec && fromReq.saveSpec === requested.saveSpec) return true - } - return false - } - try { - return semver.satisfies(child.package.version, requested.fetchSpec, true) - } catch (e) { - return false - } -} - -function childDependencySpecifier (tree, name, spec, where) { - return npa.resolve(name, spec, where || packageRelativePath(tree)) -} - -exports.computeMetadata = computeMetadata -function computeMetadata (tree, seen) { - if (!seen) seen = new Set() - if (!tree || seen.has(tree)) return - seen.add(tree) - if (tree.parent == null) { - resetMetadata(tree) - tree.isTop = true - } - tree.location = flatNameFromTree(tree) - - function findChild (name, spec, kind) { - try { - var req = childDependencySpecifier(tree, name, spec) - } catch (err) { - return - } - var child = findRequirement(tree, req.name, req) - if (child) { - resolveWithExistingModule(child, tree) - return true - } - } - - const deps = tree.package.dependencies || {} - const reqs = tree.swRequires || {} - for (let name of Object.keys(deps)) { - if (findChild(name, deps[name])) continue - if (name in reqs && findChild(name, reqs[name])) continue - tree.missingDeps[name] = deps[name] - } - if (tree.isTop) { - const devDeps = tree.package.devDependencies || {} - for (let name of Object.keys(devDeps)) { - if (findChild(name, devDeps[name])) continue - tree.missingDevDeps[name] = devDeps[name] - } - } - - tree.children.filter((child) => !child.removed).forEach((child) => computeMetadata(child, seen)) - - return tree -} - -function isDep (tree, child) { - var name = moduleName(child) - var prodVer = isProdDep(tree, name) - var devVer = isDevDep(tree, name) - - try { - var prodSpec = childDependencySpecifier(tree, name, prodVer) - } catch (err) { - return {isDep: true, isProdDep: false, isDevDep: false} - } - var matches - if (prodSpec) matches = doesChildVersionMatch(child, prodSpec, tree) - if (matches) return {isDep: true, isProdDep: prodSpec, isDevDep: false} - if (devVer === prodVer) return {isDep: child.fromShrinkwrap, isProdDep: false, isDevDep: false} - try { - var devSpec = childDependencySpecifier(tree, name, devVer) - return {isDep: doesChildVersionMatch(child, devSpec, tree) || child.fromShrinkwrap, isProdDep: false, isDevDep: devSpec} - } catch (err) { - return {isDep: child.fromShrinkwrap, isProdDep: false, isDevDep: false} - } -} - -function addRequiredDep (tree, child) { - var dep = isDep(tree, child) - if (!dep.isDep) return false - replaceModuleByPath(child, 'requiredBy', tree) - replaceModuleByName(tree, 'requires', child) - if (dep.isProdDep && tree.missingDeps) delete tree.missingDeps[moduleName(child)] - if (dep.isDevDep && tree.missingDevDeps) delete tree.missingDevDeps[moduleName(child)] - return true -} - -exports.removeObsoleteDep = removeObsoleteDep -function removeObsoleteDep (child, log) { - if (child.removed) return - child.removed = true - if (log) { - log.silly('removeObsoleteDep', 'removing ' + packageId(child) + - ' from the tree as its been replaced by a newer version or is no longer required') - } - // remove from physical tree - if (child.parent) { - child.parent.children = child.parent.children.filter(function (pchild) { return pchild !== child }) - } - // remove from logical tree - var requires = child.requires || [] - requires.forEach(function (requirement) { - requirement.requiredBy = requirement.requiredBy.filter(function (reqBy) { return reqBy !== child }) - // we don't just check requirement.requires because that doesn't account - // for circular deps. isExtraneous does. - if (isExtraneous(requirement)) removeObsoleteDep(requirement, log) - }) -} - -exports.packageRelativePath = packageRelativePath -function packageRelativePath (tree) { - if (!tree) return '' - var requested = tree.package._requested || {} - if (requested.type === 'directory') { - return requested.fetchSpec - } else if (requested.type === 'file') { - return path.dirname(requested.fetchSpec) - } else if ((tree.isLink || tree.isInLink) && !preserveSymlinks()) { - return tree.realpath - } else { - return tree.path - } -} - -function matchingDep (tree, name) { - if (!tree || !tree.package) return - if (tree.package.dependencies && tree.package.dependencies[name]) return tree.package.dependencies[name] - if (tree.package.devDependencies && tree.package.devDependencies[name]) return tree.package.devDependencies[name] -} - -exports.getAllMetadata = function (args, tree, where, next) { - asyncMap(args, function (arg, done) { - let spec - try { - spec = npa(arg) - } catch (e) { - return done(e) - } - if (spec.type !== 'file' && spec.type !== 'directory' && (spec.name == null || spec.rawSpec === '')) { - return fs.stat(path.join(arg, 'package.json'), (err) => { - if (err) { - var version = matchingDep(tree, spec.name) - if (version) { - try { - return fetchPackageMetadata(npa.resolve(spec.name, version), where, done) - } catch (e) { - return done(e) - } - } else { - return fetchPackageMetadata(spec, where, done) - } - } else { - try { - return fetchPackageMetadata(npa('file:' + arg), where, done) - } catch (e) { - return done(e) - } - } - }) - } else { - return fetchPackageMetadata(spec, where, done) - } - }, next) -} - -// Add a list of args to tree's top level dependencies -exports.loadRequestedDeps = function (args, tree, saveToDependencies, log, next) { - validate('AOOF', [args, tree, log, next]) - asyncMap(args, function (pkg, done) { - var depLoaded = andAddParentToErrors(tree, done) - resolveWithNewModule(pkg, tree, log.newGroup('loadRequestedDeps'), iferr(depLoaded, function (child, tracker) { - validate('OO', arguments) - if (npm.config.get('global')) { - child.isGlobal = true - } - var childName = moduleName(child) - child.saveSpec = computeVersionSpec(tree, child) - child.userRequired = true - child.save = getSaveType(tree, child) - const types = ['dependencies', 'devDependencies', 'optionalDependencies'] - if (child.save) { - tree.package[child.save][childName] = child.saveSpec - // Astute readers might notice that this exact same code exists in - // save.js under a different guise. That code is responsible for deps - // being removed from the final written `package.json`. The removal in - // this function is specifically to prevent "installed as both X and Y" - // warnings when moving an existing dep between different dep fields. - // - // Or, try it by removing this loop, and do `npm i -P x && npm i -D x` - for (let saveType of types) { - if (child.save !== saveType) { - delete tree.package[saveType][childName] - } - } - if (child.save === 'optionalDependencies') tree.package.dependencies[childName] = child.saveSpec - } - - // For things the user asked to install, that aren't a dependency (or - // won't be when we're done), flag it as "depending" on the user - // themselves, so we don't remove it as a dep that no longer exists - var childIsDep = addRequiredDep(tree, child) - if (!childIsDep) child.userRequired = true - depLoaded(null, child, tracker) - })) - }, andForEachChild(loadDeps, andFinishTracker(log, next))) -} - -function isNotEmpty (value) { - return value != null && value !== '' -} - -exports.computeVersionSpec = computeVersionSpec -function computeVersionSpec (tree, child) { - validate('OO', arguments) - var requested - var childReq = child.package._requested - if (child.isLink) { - requested = npa.resolve(moduleName(child), 'file:' + child.realpath, getTop(tree).path) - } else if (childReq && (isNotEmpty(childReq.saveSpec) || (isNotEmpty(childReq.rawSpec) && isNotEmpty(childReq.fetchSpec)))) { - requested = child.package._requested - } else if (child.package._from) { - requested = npa(child.package._from, tree.path) - } else if (child.name && child.name !== child.package.name) { - requested = npa.resolve(child.name, `npm:${child.package.name}@${child.package.version})`) - } else { - requested = npa.resolve(child.package.name, child.package.version) - } - if (isRegistry(requested)) { - var version = child.package.version - var rangeDescriptor = '' - if (semver.valid(version, true) && - semver.gte(version, '0.1.0', true) && - !npm.config.get('save-exact')) { - rangeDescriptor = npm.config.get('save-prefix') - } - if (requested.type === 'alias') { - rangeDescriptor = `npm:${requested.subSpec.name}@${rangeDescriptor}` - } - return rangeDescriptor + version - } else if (requested.type === 'directory' || requested.type === 'file') { - return 'file:' + unixFormatPath(path.relative(getTop(tree).path, requested.fetchSpec)) - } else { - return requested.saveSpec || requested.rawSpec - } -} - -function moduleNameMatches (name) { - return function (child) { return moduleName(child) === name } -} - -// while this implementation does not require async calling, doing so -// gives this a consistent interface with loadDeps et al -exports.removeDeps = function (args, tree, saveToDependencies, next) { - validate('AOSF|AOZF', [args, tree, saveToDependencies, next]) - for (let pkg of args) { - var pkgName = moduleName(pkg) - var toRemove = tree.children.filter(moduleNameMatches(pkgName)) - var pkgToRemove = toRemove[0] || createChild({name: pkgName}) - var saveType = getSaveType(tree, pkg) || 'dependencies' - if (tree.isTop && saveToDependencies) { - pkgToRemove.save = saveType - } - if (tree.package[saveType][pkgName]) { - delete tree.package[saveType][pkgName] - if (saveType === 'optionalDependencies' && tree.package.dependencies[pkgName]) { - delete tree.package.dependencies[pkgName] - } - } - replaceModuleByPath(tree, 'removedChildren', pkgToRemove) - for (let parent of pkgToRemove.requiredBy) { - parent.requires = parent.requires.filter((child) => child !== pkgToRemove) - } - pkgToRemove.requiredBy = pkgToRemove.requiredBy.filter((parent) => parent !== tree) - flagAsRemoving(pkgToRemove) - } - next() -} - -function flagAsRemoving (toRemove, seen) { - if (!seen) seen = new Set() - if (seen.has(toRemove)) return - seen.add(toRemove) - toRemove.removing = true - toRemove.requires.forEach((required) => { - flagAsRemoving(required, seen) - }) -} - -exports.removeExtraneous = function (args, tree, next) { - for (let pkg of args) { - var pkgName = moduleName(pkg) - var toRemove = tree.children.filter(moduleNameMatches(pkgName)) - if (toRemove.length) { - removeObsoleteDep(toRemove[0]) - } - } - next() -} - -function andForEachChild (load, next) { - validate('F', [next]) - next = dezalgo(next) - return function (er, children, logs) { - // when children is empty, logs won't be passed in at all (asyncMap is weird) - // so shortcircuit before arg validation - if (!er && (!children || children.length === 0)) return next() - validate('EAA', arguments) - if (er) return next(er) - assert(children.length === logs.length) - var cmds = [] - for (var ii = 0; ii < children.length; ++ii) { - cmds.push([load, children[ii], logs[ii]]) - } - var sortedCmds = cmds.sort(function installOrder (aa, bb) { - return moduleName(aa[1]).localeCompare(moduleName(bb[1])) - }) - chain(sortedCmds, next) - } -} - -function isDepOptional (tree, name, pkg) { - if (pkg.package && pkg.package._optional) return true - const optDeps = tree.package.optionalDependencies - if (optDeps && optDeps[name] != null) return true - - const devDeps = tree.package.devDependencies - if (devDeps && devDeps[name] != null) { - const includeDev = npm.config.get('dev') || - (!/^prod(uction)?$/.test(npm.config.get('only')) && !npm.config.get('production')) || - /^dev(elopment)?$/.test(npm.config.get('only')) || - /^dev(elopment)?$/.test(npm.config.get('also')) - return !includeDev - } - const prodDeps = tree.package.dependencies - if (prodDeps && prodDeps[name] != null) { - const includeProd = !/^dev(elopment)?$/.test(npm.config.get('only')) - return !includeProd - } - return false -} - -exports.failedDependency = failedDependency -function failedDependency (tree, name, pkg) { - if (name) { - if (isDepOptional(tree, name, pkg || {})) { - return false - } - } - - tree.failed = true - - if (tree.isTop) return true - - if (tree.userRequired) return true - - if (!tree.requiredBy) return false - - let anyFailed = false - for (var ii = 0; ii < tree.requiredBy.length; ++ii) { - var requireParent = tree.requiredBy[ii] - if (failedDependency(requireParent, moduleName(tree), tree)) { - anyFailed = true - } - } - return anyFailed -} - -function andHandleOptionalErrors (log, tree, name, done) { - validate('OOSF', arguments) - return function (er, child, childLog) { - if (!er) validate('OO', [child, childLog]) - if (!er) return done(er, child, childLog) - var isFatal = failedDependency(tree, name) - if (er && !isFatal) { - reportOptionalFailure(tree, name, er) - return done() - } else { - return done(er, child, childLog) - } - } -} - -exports.prefetchDeps = prefetchDeps -function prefetchDeps (tree, deps, log, next) { - validate('OOOF', arguments) - var skipOptional = !npm.config.get('optional') - var seen = new Set() - const finished = andFinishTracker(log, next) - const fpm = BB.promisify(fetchPackageMetadata) - resolveBranchDeps(tree.package, deps).then( - () => finished(), finished - ) - - function resolveBranchDeps (pkg, deps) { - return BB.resolve(null).then(() => { - var allDependencies = Object.keys(deps).map((dep) => { - return npa.resolve(dep, deps[dep]) - }).filter((dep) => { - return isRegistry(dep) && - !seen.has(dep.toString()) && - !findRequirement(tree, dep.name, dep) - }) - if (skipOptional) { - var optDeps = pkg.optionalDependencies || {} - allDependencies = allDependencies.filter((dep) => !optDeps[dep.name]) - } - return BB.map(allDependencies, (dep) => { - seen.add(dep.toString()) - return fpm(dep, '', {tracker: log.newItem('fetchMetadata')}).then( - (pkg) => { - return pkg && pkg.dependencies && resolveBranchDeps(pkg, pkg.dependencies) - }, - () => null - ) - }) - }) - } -} - -// Load any missing dependencies in the given tree -exports.loadDeps = loadDeps -function loadDeps (tree, log, next) { - validate('OOF', arguments) - if (tree.loaded || (tree.parent && tree.parent.failed) || tree.removed) return andFinishTracker.now(log, next) - if (tree.parent) tree.loaded = true - if (!tree.package.dependencies) tree.package.dependencies = {} - asyncMap(Object.keys(tree.package.dependencies), function (dep, done) { - var version = tree.package.dependencies[dep] - addDependency(dep, version, tree, log.newGroup('loadDep:' + dep), andHandleOptionalErrors(log, tree, dep, done)) - }, andForEachChild(loadDeps, andFinishTracker(log, next))) -} - -// Load development dependencies into the given tree -exports.loadDevDeps = function (tree, log, next) { - validate('OOF', arguments) - if (!tree.package.devDependencies) return andFinishTracker.now(log, next) - asyncMap(Object.keys(tree.package.devDependencies), function (dep, done) { - // things defined as both dev dependencies and regular dependencies are treated - // as the former - if (tree.package.dependencies[dep]) return done() - - var logGroup = log.newGroup('loadDevDep:' + dep) - addDependency(dep, tree.package.devDependencies[dep], tree, logGroup, andHandleOptionalErrors(log, tree, dep, done)) - }, andForEachChild(loadDeps, andFinishTracker(log, next))) -} - -var loadExtraneous = exports.loadExtraneous = function (tree, log, next) { - var seen = new Set() - - function loadExtraneous (tree) { - if (seen.has(tree)) return - seen.add(tree) - for (var child of tree.children) { - if (child.loaded) continue - resolveWithExistingModule(child, tree) - loadExtraneous(child) - } - } - loadExtraneous(tree) - log.finish() - next() -} - -exports.loadExtraneous.andResolveDeps = function (tree, log, next) { - validate('OOF', arguments) - // For canonicalized trees (eg from shrinkwrap) we don't want to bother - // resolving the dependencies of extraneous deps. - if (tree.loaded) return loadExtraneous(tree, log, next) - asyncMap(tree.children.filter(function (child) { return !child.loaded }), function (child, done) { - resolveWithExistingModule(child, tree) - done(null, child, log) - }, andForEachChild(loadDeps, andFinishTracker(log, next))) -} - -function addDependency (name, versionSpec, tree, log, done) { - validate('SSOOF', arguments) - var next = andAddParentToErrors(tree, done) - try { - var req = childDependencySpecifier(tree, name, versionSpec) - if (tree.swRequires && tree.swRequires[name]) { - var swReq = childDependencySpecifier(tree, name, tree.swRequires[name]) - } - } catch (err) { - return done(err) - } - var child = findRequirement(tree, name, req) - if (!child && swReq) child = findRequirement(tree, name, swReq) - if (hasModernMeta(child)) { - resolveWithExistingModule(child, tree) - if (child.package._shrinkwrap === undefined) { - readShrinkwrap.andInflate(child, function (er) { next(er, child, log) }) - } else { - next(null, child, log) - } - } else { - if (child) { - if (req.registry) { - req = childDependencySpecifier(tree, name, child.package.version) - } - if (child.fromBundle) reportBundleOverride(child, log) - removeObsoleteDep(child, log) - } - fetchPackageMetadata(req, packageRelativePath(tree), {tracker: log.newItem('fetchMetadata')}, iferr(next, function (pkg) { - resolveWithNewModule(pkg, tree, log, next) - })) - } -} - -function getTop (pkg) { - const seen = new Set() - while (pkg.parent && !seen.has(pkg.parent)) { - pkg = pkg.parent - seen.add(pkg) - } - return pkg -} - -function reportBundleOverride (child, log) { - const code = 'EBUNDLEOVERRIDE' - const top = getTop(child.fromBundle) - const bundlerId = packageId(child.fromBundle) - if (!top.warnings.some((w) => { - return w.code === code - })) { - const err = new Error(`${bundlerId} had bundled packages that do not match the required version(s). They have been replaced with non-bundled versions.`) - err.code = code - top.warnings.push(err) - } - if (log) log.verbose('bundle', `${code}: Replacing ${bundlerId}'s bundled version of ${moduleName(child)} with ${packageId(child)}.`) -} - -function resolveWithExistingModule (child, tree) { - validate('OO', arguments) - addRequiredDep(tree, child) - if (tree.parent && child.parent !== tree) updatePhantomChildren(tree.parent, child) -} - -var updatePhantomChildren = exports.updatePhantomChildren = function (current, child) { - validate('OO', arguments) - while (current && current !== child.parent) { - if (!current.phantomChildren) current.phantomChildren = {} - current.phantomChildren[moduleName(child)] = child - current = current.parent - } -} - -exports._replaceModuleByPath = replaceModuleByPath -function replaceModuleByPath (obj, key, child) { - return replaceModule(obj, key, child, function (replacing, child) { - return replacing.path === child.path - }) -} - -exports._replaceModuleByName = replaceModuleByName -function replaceModuleByName (obj, key, child) { - var childName = moduleName(child) - return replaceModule(obj, key, child, function (replacing, child) { - return moduleName(replacing) === childName - }) -} - -function replaceModule (obj, key, child, matchBy) { - validate('OSOF', arguments) - if (!obj[key]) obj[key] = [] - // we replace children with a new array object instead of mutating it - // because mutating it results in weird failure states. - // I would very much like to know _why_ this is. =/ - var children = [].concat(obj[key]) - for (var replaceAt = 0; replaceAt < children.length; ++replaceAt) { - if (matchBy(children[replaceAt], child)) break - } - var replacing = children.splice(replaceAt, 1, child) - obj[key] = children - return replacing[0] -} - -function resolveWithNewModule (pkg, tree, log, next) { - validate('OOOF', arguments) - - log.silly('resolveWithNewModule', packageId(pkg), 'checking installable status') - return isInstallable(tree, pkg, (err) => { - let installable = !err - addBundled(pkg, (bundleErr) => { - var parent = earliestInstallable(tree, tree, pkg, log) || tree - var isLink = pkg._requested.type === 'directory' - var name = pkg._requested.name || pkg.name - var child = createChild({ - name, - package: pkg, - parent: parent, - path: path.join(parent.isLink ? parent.realpath : parent.path, 'node_modules', name), - realpath: isLink ? pkg._requested.fetchSpec : path.join(parent.realpath, 'node_modules', name), - children: pkg._bundled || [], - isLink: isLink, - isInLink: parent.isLink, - knownInstallable: installable - }) - if (!installable || bundleErr) child.failed = true - delete pkg._bundled - var hasBundled = child.children.length - - var replaced = replaceModuleByName(parent, 'children', child) - if (replaced) { - if (replaced.fromBundle) reportBundleOverride(replaced, log) - removeObsoleteDep(replaced) - } - addRequiredDep(tree, child) - child.location = flatNameFromTree(child) - - if (tree.parent && parent !== tree) updatePhantomChildren(tree.parent, child) - - if (hasBundled) { - inflateBundled(child, child, child.children) - } - - if (pkg._shrinkwrap && pkg._shrinkwrap.dependencies) { - return inflateShrinkwrap(child, pkg._shrinkwrap, (swErr) => { - if (swErr) child.failed = true - next(err || bundleErr || swErr, child, log) - }) - } - next(err || bundleErr, child, log) - }) - }) -} - -var isOptionalPeerDep = exports.isOptionalPeerDep = function (tree, pkgname) { - if (!tree.package.peerDependenciesMeta) return - if (!tree.package.peerDependenciesMeta[pkgname]) return - return !!tree.package.peerDependenciesMeta[pkgname].optional -} - -var validatePeerDeps = exports.validatePeerDeps = function (tree, onInvalid) { - if (!tree.package.peerDependencies) return - Object.keys(tree.package.peerDependencies).forEach(function (pkgname) { - var version = tree.package.peerDependencies[pkgname] - try { - var spec = npa.resolve(pkgname, version) - } catch (e) {} - var match = spec && findRequirement(tree.parent || tree, pkgname, spec) - if (!match && !isOptionalPeerDep(tree, pkgname)) onInvalid(tree, pkgname, version) - }) -} - -exports.validateAllPeerDeps = function (tree, onInvalid) { - validateAllPeerDeps(tree, onInvalid, new Set()) -} - -function validateAllPeerDeps (tree, onInvalid, seen) { - validate('OFO', arguments) - if (seen.has(tree)) return - seen.add(tree) - validatePeerDeps(tree, onInvalid) - tree.children.forEach(function (child) { validateAllPeerDeps(child, onInvalid, seen) }) -} - -// Determine if a module requirement is already met by the tree at or above -// our current location in the tree. -var findRequirement = exports.findRequirement = function (tree, name, requested, requestor) { - validate('OSO', [tree, name, requested]) - if (!requestor) requestor = tree - var nameMatch = function (child) { - return moduleName(child) === name && child.parent && !child.removed - } - var versionMatch = function (child) { - return doesChildVersionMatch(child, requested, requestor) - } - if (nameMatch(tree)) { - // this *is* the module, but it doesn't match the version, so a - // new copy will have to be installed - return versionMatch(tree) ? tree : null - } - - var matches = tree.children.filter(nameMatch) - if (matches.length) { - matches = matches.filter(versionMatch) - // the module exists as a dependent, but the version doesn't match, so - // a new copy will have to be installed above here - if (matches.length) return matches[0] - return null - } - if (tree.isTop) return null - if (!preserveSymlinks() && /^[.][.][\\/]/.test(path.relative(tree.parent.realpath, tree.realpath))) return null - return findRequirement(tree.parent, name, requested, requestor) -} - -function preserveSymlinks () { - if (!('NODE_PRESERVE_SYMLINKS' in process.env)) return false - const value = process.env.NODE_PRESERVE_SYMLINKS - if (value == null || value === '' || value === 'false' || value === 'no' || value === '0') return false - return true -} - -// Find the highest level in the tree that we can install this module in. -// If the module isn't installed above us yet, that'd be the very top. -// If it is, then it's the level below where its installed. -var earliestInstallable = exports.earliestInstallable = function (requiredBy, tree, pkg, log) { - validate('OOOO', arguments) - - function undeletedModuleMatches (child) { - return !child.removed && moduleName(child) === ((pkg._requested && pkg._requested.name) || pkg.name) - } - const undeletedMatches = tree.children.filter(undeletedModuleMatches) - if (undeletedMatches.length) { - // if there's a conflict with another child AT THE SAME level then we're replacing it, so - // mark it as removed and continue with resolution normally. - if (tree === requiredBy) { - undeletedMatches.forEach((pkg) => { - if (pkg.fromBundle) reportBundleOverride(pkg, log) - removeObsoleteDep(pkg, log) - }) - } else { - return null - } - } - - // If any of the children of this tree have conflicting - // binaries then we need to decline to install this package here. - var binaryMatches = pkg.bin && tree.children.some(function (child) { - if (child.removed || !child.package.bin) return false - return Object.keys(child.package.bin).some(function (bin) { - return pkg.bin[bin] - }) - }) - - if (binaryMatches) return null - - // if this tree location requested the same module then we KNOW it - // isn't compatible because if it were findRequirement would have - // found that version. - var deps = tree.package.dependencies || {} - if (!tree.removed && requiredBy !== tree && deps[pkg.name]) { - return null - } - - var devDeps = tree.package.devDependencies || {} - if (tree.isTop && devDeps[pkg.name]) { - var requested = childDependencySpecifier(tree, pkg.name, devDeps[pkg.name]) - if (!doesChildVersionMatch({package: pkg}, requested, tree)) { - return null - } - } - - if (tree.phantomChildren && tree.phantomChildren[pkg.name]) return null - - if (tree.isTop) return tree - if (tree.isGlobal) return tree - - if (npm.config.get('global-style') && tree.parent.isTop) return tree - if (npm.config.get('legacy-bundling')) return tree - - if (!preserveSymlinks() && /^[.][.][\\/]/.test(path.relative(tree.parent.realpath, tree.realpath))) return tree - - return (earliestInstallable(requiredBy, tree.parent, pkg, log) || tree) -} diff --git a/deps/npm/lib/install/diff-trees.js b/deps/npm/lib/install/diff-trees.js deleted file mode 100644 index 147aa9b8e74f38..00000000000000 --- a/deps/npm/lib/install/diff-trees.js +++ /dev/null @@ -1,260 +0,0 @@ -'use strict' -var npm = require('../npm.js') -var validate = require('aproba') -var npa = require('npm-package-arg') -var flattenTree = require('./flatten-tree.js') -var isOnlyDev = require('./is-only-dev.js') -var log = require('npmlog') -var path = require('path') -var ssri = require('ssri') -var moduleName = require('../utils/module-name.js') -var isOnlyOptional = require('./is-only-optional.js') - -// we don't use get-requested because we're operating on files on disk, and -// we don't want to extrapolate from what _should_ be there. -function pkgRequested (pkg) { - return pkg._requested || (pkg._resolved && npa(pkg._resolved)) || (pkg._from && npa(pkg._from)) -} - -function nonRegistrySource (requested) { - if (fromGit(requested)) return true - if (fromLocal(requested)) return true - if (fromRemote(requested)) return true - return false -} - -function fromRemote (requested) { - if (requested.type === 'remote') return true -} - -function fromLocal (requested) { - // local is an npm@3 type that meant "file" - if (requested.type === 'file' || requested.type === 'directory' || requested.type === 'local') return true - return false -} - -function fromGit (requested) { - if (requested.type === 'hosted' || requested.type === 'git') return true - return false -} - -function pkgIntegrity (pkg) { - try { - // dist is provided by the registry - var sri = (pkg.dist && pkg.dist.integrity) || - // _integrity is provided by pacote - pkg._integrity || - // _shasum is legacy - (pkg._shasum && ssri.fromHex(pkg._shasum, 'sha1').toString()) - if (!sri) return - var integrity = ssri.parse(sri) - if (Object.keys(integrity).length === 0) return - return integrity - } catch (ex) { - - } -} - -function sriMatch (aa, bb) { - if (!aa || !bb) return false - for (let algo of Object.keys(aa)) { - if (!bb[algo]) continue - for (let aaHash of aa[algo]) { - for (let bbHash of bb[algo]) { - return aaHash.digest === bbHash.digest - } - } - } - return false -} - -function pkgAreEquiv (aa, bb) { - // coming in we know they share a path… - - // if one is inside a link and the other is not, then they are not equivalent - // this happens when we're replacing a linked dep with a non-linked version - if (aa.isInLink !== bb.isInLink) return false - // if they share package metadata _identity_, they're the same thing - if (aa.package === bb.package) return true - // if they share integrity information, they're the same thing - var aaIntegrity = pkgIntegrity(aa.package) - var bbIntegrity = pkgIntegrity(bb.package) - if (aaIntegrity || bbIntegrity) return sriMatch(aaIntegrity, bbIntegrity) - - // if they're links and they share the same target, they're the same thing - if (aa.isLink && bb.isLink) return aa.realpath === bb.realpath - - // if we can't determine both their sources then we have no way to know - // if they're the same thing, so we have to assume they aren't - var aaReq = pkgRequested(aa.package) - var bbReq = pkgRequested(bb.package) - if (!aaReq || !bbReq) return false - - if (fromGit(aaReq) && fromGit(bbReq)) { - // if both are git and share a _resolved specifier (one with the - // comittish replaced by a commit hash) then they're the same - return aa.package._resolved && bb.package._resolved && - aa.package._resolved === bb.package._resolved - } - - // we have to give up trying to find matches for non-registry sources at this point… - if (nonRegistrySource(aaReq) || nonRegistrySource(bbReq)) return false - - // finally, if they ARE a registry source then version matching counts - return aa.package.version === bb.package.version -} - -function pushAll (aa, bb) { - Array.prototype.push.apply(aa, bb) -} - -module.exports = function (oldTree, newTree, differences, log, next) { - validate('OOAOF', arguments) - pushAll(differences, sortActions(diffTrees(oldTree, newTree))) - log.finish() - next() -} - -function isNotTopOrExtraneous (node) { - return !node.isTop && !node.userRequired && !node.existing -} - -var sortActions = module.exports.sortActions = function (differences) { - var actions = {} - differences.forEach(function (action) { - var child = action[1] - actions[child.location] = action - }) - - var sorted = [] - var added = {} - - var sortedlocs = Object.keys(actions).sort(sortByLocation) - - // We're going to sort the actions taken on top level dependencies first, before - // considering the order of transitive deps. Because we're building our list - // from the bottom up, this means we will return a list with top level deps LAST. - // This is important in terms of keeping installations as consistent as possible - // as folks add new dependencies. - var toplocs = sortedlocs.filter(function (location) { - var mod = actions[location][1] - if (!mod.requiredBy) return true - // If this module is required by any non-top level module - // or by any extraneous module, eg user requested or existing - // then we don't want to give this priority sorting. - return !mod.requiredBy.some(isNotTopOrExtraneous) - }) - - toplocs.concat(sortedlocs).forEach(function (location) { - sortByDeps(actions[location]) - }) - - function sortByLocation (aa, bb) { - return bb.localeCompare(aa) - } - function sortModuleByLocation (aa, bb) { - return sortByLocation(aa && aa.location, bb && bb.location) - } - function sortByDeps (action) { - var mod = action[1] - if (added[mod.location]) return - added[mod.location] = action - if (!mod.requiredBy) mod.requiredBy = [] - mod.requiredBy.sort(sortModuleByLocation).forEach(function (mod) { - if (actions[mod.location]) sortByDeps(actions[mod.location]) - }) - sorted.unshift(action) - } - - // safety net, anything excluded above gets tacked on the end - differences.forEach((_) => { - if (sorted.indexOf(_) === -1) sorted.push(_) - }) - - return sorted -} - -function setAction (differences, action, pkg) { - differences.push([action, pkg]) -} - -var diffTrees = module.exports._diffTrees = function (oldTree, newTree) { - validate('OO', arguments) - var differences = [] - var flatOldTree = flattenTree(oldTree) - var flatNewTree = flattenTree(newTree) - var toRemove = {} - var toRemoveByName = {} - - // Build our tentative remove list. We don't add remove actions yet - // because we might resuse them as part of a move. - Object.keys(flatOldTree).forEach(function (flatname) { - if (flatname === '/') return - if (flatNewTree[flatname]) return - var pkg = flatOldTree[flatname] - if (pkg.isInLink && /^[.][.][/\\]/.test(path.relative(newTree.realpath, pkg.realpath))) return - - toRemove[flatname] = pkg - var name = moduleName(pkg) - if (!toRemoveByName[name]) toRemoveByName[name] = [] - toRemoveByName[name].push({flatname: flatname, pkg: pkg}) - }) - - // generate our add/update/move actions - Object.keys(flatNewTree).forEach(function (flatname) { - if (flatname === '/') return - var pkg = flatNewTree[flatname] - var oldPkg = pkg.oldPkg = flatOldTree[flatname] - if (oldPkg) { - // if the versions are equivalent then we don't need to update… unless - // the user explicitly asked us to. - if (!pkg.userRequired && pkgAreEquiv(oldPkg, pkg)) return - setAction(differences, 'update', pkg) - } else { - var name = moduleName(pkg) - // find any packages we're removing that share the same name and are equivalent - var removing = (toRemoveByName[name] || []).filter((rm) => pkgAreEquiv(rm.pkg, pkg)) - var bundlesOrFromBundle = pkg.fromBundle || pkg.package.bundleDependencies - // if we have any removes that match AND we're not working with a bundle then upgrade to a move - if (removing.length && !bundlesOrFromBundle) { - var toMv = removing.shift() - toRemoveByName[name] = toRemoveByName[name].filter((rm) => rm !== toMv) - pkg.fromPath = toMv.pkg.path - setAction(differences, 'move', pkg) - delete toRemove[toMv.flatname] - // we don't generate add actions for things found in links (which already exist on disk) - } else if (!pkg.isInLink || !(pkg.fromBundle && pkg.fromBundle.isLink)) { - setAction(differences, 'add', pkg) - } - } - }) - - // finally generate our remove actions from any not consumed by moves - Object - .keys(toRemove) - .map((flatname) => toRemove[flatname]) - .forEach((pkg) => setAction(differences, 'remove', pkg)) - - return filterActions(differences) -} - -function filterActions (differences) { - const includeOpt = npm.config.get('optional') - const includeDev = npm.config.get('dev') || - (!/^prod(uction)?$/.test(npm.config.get('only')) && !npm.config.get('production')) || - /^dev(elopment)?$/.test(npm.config.get('only')) || - /^dev(elopment)?$/.test(npm.config.get('also')) - const includeProd = !/^dev(elopment)?$/.test(npm.config.get('only')) - if (includeProd && includeDev && includeOpt) return differences - - log.silly('diff-trees', 'filtering actions:', 'includeDev', includeDev, 'includeProd', includeProd, 'includeOpt', includeOpt) - return differences.filter((diff) => { - const pkg = diff[1] - const pkgIsOnlyDev = isOnlyDev(pkg) - const pkgIsOnlyOpt = isOnlyOptional(pkg) - if (!includeProd && pkgIsOnlyDev) return true - if (includeDev && pkgIsOnlyDev) return true - if (includeProd && !pkgIsOnlyDev && (includeOpt || !pkgIsOnlyOpt)) return true - return false - }) -} diff --git a/deps/npm/lib/install/exists.js b/deps/npm/lib/install/exists.js deleted file mode 100644 index 59100d63ba0d94..00000000000000 --- a/deps/npm/lib/install/exists.js +++ /dev/null @@ -1,27 +0,0 @@ -'use strict' -var fs = require('fs') -var inflight = require('inflight') -var accessError = require('./access-error.js') -var isFsAccessAvailable = require('./is-fs-access-available.js') - -if (isFsAccessAvailable) { - module.exports = fsAccessImplementation -} else { - module.exports = fsStatImplementation -} - -// exposed only for testing purposes -module.exports.fsAccessImplementation = fsAccessImplementation -module.exports.fsStatImplementation = fsStatImplementation - -function fsAccessImplementation (dir, done) { - done = inflight('exists:' + dir, done) - if (!done) return - fs.access(dir, fs.F_OK, done) -} - -function fsStatImplementation (dir, done) { - done = inflight('exists:' + dir, done) - if (!done) return - fs.stat(dir, function (er) { done(accessError(dir, er)) }) -} diff --git a/deps/npm/lib/install/flatten-tree.js b/deps/npm/lib/install/flatten-tree.js deleted file mode 100644 index 56282b771da43a..00000000000000 --- a/deps/npm/lib/install/flatten-tree.js +++ /dev/null @@ -1,42 +0,0 @@ -'use strict' -var validate = require('aproba') -var moduleName = require('../utils/module-name.js') - -module.exports = flattenTree -module.exports.flatName = flatName -module.exports.flatNameFromTree = flatNameFromTree - -function flattenTree (tree) { - validate('O', arguments) - var seen = new Set() - var flat = {} - var todo = [[tree, '/']] - while (todo.length) { - var next = todo.shift() - var pkg = next[0] - seen.add(pkg) - var path = next[1] - flat[path] = pkg - if (path !== '/') path += '/' - for (var ii = 0; ii < pkg.children.length; ++ii) { - var child = pkg.children[ii] - if (!seen.has(child)) { - todo.push([child, flatName(path, child)]) - } - } - } - return flat -} - -function flatName (path, child) { - validate('SO', arguments) - return path + (moduleName(child) || 'TOP') -} - -function flatNameFromTree (tree) { - validate('O', arguments) - if (tree.isTop) return '/' - var path = flatNameFromTree(tree.parent) - if (path !== '/') path += '/' - return flatName(path, tree) -} diff --git a/deps/npm/lib/install/fund.js b/deps/npm/lib/install/fund.js deleted file mode 100644 index 809c05b33878b2..00000000000000 --- a/deps/npm/lib/install/fund.js +++ /dev/null @@ -1,48 +0,0 @@ -'use strict' - -const { EOL } = require('os') - -const computeMetadata = require('./deps.js').computeMetadata -const mutateIntoLogicalTree = require('./mutate-into-logical-tree.js') -var { getFundingInfo } = require('../utils/funding.js') - -exports.getPrintFundingReport = getPrintFundingReport -exports.getPrintFundingReportJSON = getPrintFundingReportJSON - -function getFundingResult ({ fund, idealTree }) { - if (fund) { - const fundingInfoTree = - mutateIntoLogicalTree.asReadInstalled( - computeMetadata(idealTree) - ) - const fundResult = getFundingInfo(fundingInfoTree, { countOnly: true }) - return fundResult - } else { - return {} - } -} - -function getPrintFundingReport ({ fund, idealTree }, opts) { - const fundResult = getFundingResult({ fund, idealTree }) - const { length } = fundResult || {} - const { json } = opts || {} - - function padding (msg) { - return json ? '' : (EOL + msg) - } - - function packageQuantity (amount) { - return `package${amount > 1 ? 's are' : ' is'}` - } - - if (!length) return '' - - return padding('') + length + ' ' + - packageQuantity(length) + - ' looking for funding' + - padding(' run `npm fund` for details\n') -} - -function getPrintFundingReportJSON ({ fund, idealTree }) { - return getPrintFundingReport({ fund, idealTree }, { json: true }) -} diff --git a/deps/npm/lib/install/get-requested.js b/deps/npm/lib/install/get-requested.js deleted file mode 100644 index df0eec6f6a6313..00000000000000 --- a/deps/npm/lib/install/get-requested.js +++ /dev/null @@ -1,15 +0,0 @@ -'use strict' -const npa = require('npm-package-arg') -const moduleName = require('../utils/module-name.js') -const packageRelativePath = require('./deps').packageRelativePath -module.exports = function (child, reqBy) { - if (!child.requiredBy.length) return - if (!reqBy) reqBy = child.requiredBy[0] - const deps = reqBy.package.dependencies || {} - const devDeps = reqBy.package.devDependencies || {} - const optDeps = reqBy.package.optionalDependencies || {} - const name = moduleName(child) - const spec = deps[name] || devDeps[name] || optDeps[name] - const where = packageRelativePath(reqBy) - return npa.resolve(name, spec, where) -} diff --git a/deps/npm/lib/install/has-modern-meta.js b/deps/npm/lib/install/has-modern-meta.js deleted file mode 100644 index bf801d0d31f5f7..00000000000000 --- a/deps/npm/lib/install/has-modern-meta.js +++ /dev/null @@ -1,20 +0,0 @@ -'use strict' -module.exports = hasModernMeta - -const npa = require('npm-package-arg') -const moduleName = require('../utils/module-name.js') - -function isLink (child) { - return child.isLink || (child.parent && isLink(child.parent)) -} - -function hasModernMeta (child) { - if (!child) return false - const resolved = child.package._resolved && npa.resolve(moduleName(child), child.package._resolved) - const version = npa.resolve(moduleName(child), child.package.version) - return child.isTop || - isLink(child) || - child.fromBundle || child.package._inBundle || - child.package._integrity || child.package._shasum || - (resolved && resolved.type === 'git') || (version && version.type === 'git') -} diff --git a/deps/npm/lib/install/inflate-bundled.js b/deps/npm/lib/install/inflate-bundled.js deleted file mode 100644 index 66bbb44a33de37..00000000000000 --- a/deps/npm/lib/install/inflate-bundled.js +++ /dev/null @@ -1,18 +0,0 @@ -'use strict' - -var childPath = require('../utils/child-path.js') -var reset = require('./node.js').reset - -module.exports = function inflateBundled (bundler, parent, children) { - children.forEach(function (child) { - if (child.fromBundle === bundler) return - reset(child) - child.fromBundle = bundler - child.isInLink = bundler.isLink - child.parent = parent - child.path = childPath(parent.path, child) - child.realpath = bundler.isLink ? child.realpath : childPath(parent.realpath, child) - child.isLink = child.isLink || parent.isLink || parent.target - inflateBundled(bundler, child, child.children) - }) -} diff --git a/deps/npm/lib/install/inflate-shrinkwrap.js b/deps/npm/lib/install/inflate-shrinkwrap.js deleted file mode 100644 index f89aa815497a18..00000000000000 --- a/deps/npm/lib/install/inflate-shrinkwrap.js +++ /dev/null @@ -1,263 +0,0 @@ -'use strict' - -const BB = require('bluebird') - -let addBundled -const childPath = require('../utils/child-path.js') -const createChild = require('./node.js').create -let fetchPackageMetadata -const inflateBundled = require('./inflate-bundled.js') -const moduleName = require('../utils/module-name.js') -const normalizePackageData = require('normalize-package-data') -const npm = require('../npm.js') -const realizeShrinkwrapSpecifier = require('./realize-shrinkwrap-specifier.js') -const validate = require('aproba') -const path = require('path') -const isRegistry = require('../utils/is-registry.js') -const hasModernMeta = require('./has-modern-meta.js') -const ssri = require('ssri') -const npa = require('npm-package-arg') - -module.exports = function (tree, sw, opts, finishInflating) { - if (!fetchPackageMetadata) { - fetchPackageMetadata = BB.promisify(require('../fetch-package-metadata.js')) - addBundled = BB.promisify(fetchPackageMetadata.addBundled) - } - if (arguments.length === 3) { - finishInflating = opts - opts = {} - } - if (!npm.config.get('shrinkwrap') || !npm.config.get('package-lock')) { - return finishInflating() - } - tree.loaded = false - tree.hasRequiresFromLock = sw.requires - return inflateShrinkwrap(tree.path, tree, sw.dependencies, opts).then( - () => finishInflating(), - finishInflating - ) -} - -function inflateShrinkwrap (topPath, tree, swdeps, opts) { - if (!swdeps) return Promise.resolve() - if (!opts) opts = {} - const onDisk = {} - tree.children.forEach((child) => { - onDisk[moduleName(child)] = child - }) - - tree.children = [] - - return BB.each(Object.keys(swdeps), (name) => { - const sw = swdeps[name] - const dependencies = sw.dependencies || {} - const requested = realizeShrinkwrapSpecifier(name, sw, topPath) - - if (Object.keys(sw).length === 0) { - let message = `Object for dependency "${name}" is empty.\n` - message += 'Something went wrong. Regenerate the package-lock.json with "npm install".\n' - message += 'If using a shrinkwrap, regenerate with "npm shrinkwrap".' - return Promise.reject(new Error(message)) - } - - return inflatableChild( - onDisk[name], name, topPath, tree, sw, requested, opts - ).then((child) => { - child.hasRequiresFromLock = tree.hasRequiresFromLock - return inflateShrinkwrap(topPath, child, dependencies) - }) - }) -} - -function normalizePackageDataNoErrors (pkg) { - try { - normalizePackageData(pkg) - } catch (ex) { - // don't care - } -} - -function quotemeta (str) { - return str.replace(/([^A-Za-z_0-9/])/g, '\\$1') -} - -function tarballToVersion (name, tb) { - const registry = quotemeta(npm.config.get('registry') || '') - .replace(/https?:/, 'https?:') - .replace(/([^/])$/, '$1/') - let matchRegTarball - if (name) { - const nameMatch = quotemeta(name) - matchRegTarball = new RegExp(`^${registry}${nameMatch}/-/${nameMatch}-(.*)[.]tgz$`) - } else { - matchRegTarball = new RegExp(`^${registry}(.*)?/-/\\1-(.*)[.]tgz$`) - } - const match = tb.match(matchRegTarball) - if (!match) return - return match[2] || match[1] -} - -function relativizeLink (name, spec, topPath, requested) { - if (!spec.startsWith('file:')) { - return - } - - let requestedPath = requested.fetchSpec - if (requested.type === 'file') { - requestedPath = path.dirname(requestedPath) - } - - const relativized = path.relative(requestedPath, path.resolve(topPath, spec.slice(5))) - return 'file:' + relativized -} - -function inflatableChild (onDiskChild, name, topPath, tree, sw, requested, opts) { - validate('OSSOOOO|ZSSOOOO', arguments) - const usesIntegrity = ( - requested.registry || - requested.type === 'remote' || - requested.type === 'file' - ) - const regTarball = tarballToVersion(name, sw.version) - if (regTarball) { - sw.resolved = sw.version - sw.version = regTarball - } - if (sw.requires) { - Object.keys(sw.requires).forEach(name => { - const spec = sw.requires[name] - sw.requires[name] = tarballToVersion(name, spec) || - relativizeLink(name, spec, topPath, requested) || - spec - }) - } - const modernLink = requested.type === 'directory' && !sw.from - if (hasModernMeta(onDiskChild) && childIsEquivalent(sw, requested, onDiskChild)) { - // The version on disk matches the shrinkwrap entry. - if (!onDiskChild.fromShrinkwrap) onDiskChild.fromShrinkwrap = requested - onDiskChild.package._requested = requested - onDiskChild.package._spec = requested.rawSpec - onDiskChild.package._where = topPath - onDiskChild.package._optional = sw.optional - onDiskChild.package._development = sw.dev - onDiskChild.package._inBundle = sw.bundled - onDiskChild.fromBundle = (sw.bundled || onDiskChild.package._inBundle) ? tree.fromBundle || tree : null - if (!onDiskChild.package._args) onDiskChild.package._args = [] - onDiskChild.package._args.push([String(requested), topPath]) - // non-npm registries can and will return unnormalized data, plus - // even the npm registry may have package data normalized with older - // normalization rules. This ensures we get package data in a consistent, - // stable format. - normalizePackageDataNoErrors(onDiskChild.package) - onDiskChild.swRequires = sw.requires - tree.children.push(onDiskChild) - return BB.resolve(onDiskChild) - } else if ((sw.version && (sw.integrity || !usesIntegrity) && (requested.type !== 'directory' || modernLink)) || sw.bundled) { - // The shrinkwrap entry has an integrity field. We can fake a pkg to get - // the installer to do a content-address fetch from the cache, if possible. - return BB.resolve(makeFakeChild(name, topPath, tree, sw, requested)) - } else { - // It's not on disk, and we can't just look it up by address -- do a full - // fpm/inflate bundle pass. For registry deps, this will go straight to the - // tarball URL, as if it were a remote tarball dep. - return fetchChild(topPath, tree, sw, requested) - } -} - -function isGit (sw) { - const version = npa.resolve(sw.name, sw.version) - return (version && version.type === 'git') -} - -function makeFakeChild (name, topPath, tree, sw, requested) { - const isDirectory = requested.type === 'directory' - const from = sw.from || requested.raw - const pkg = { - name: name, - version: sw.version, - _id: name + '@' + sw.version, - _resolved: sw.resolved || (isGit(sw) && sw.version), - _requested: requested, - _optional: sw.optional, - _development: sw.dev, - _inBundle: sw.bundled, - _integrity: sw.integrity, - _from: from, - _spec: requested.rawSpec, - _where: topPath, - _args: [[requested.toString(), topPath]], - dependencies: sw.requires - } - - if (!sw.bundled) { - const bundleDependencies = Object.keys(sw.dependencies || {}).filter((d) => sw.dependencies[d].bundled) - if (bundleDependencies.length === 0) { - pkg.bundleDependencies = bundleDependencies - } - } - const child = createChild({ - package: pkg, - loaded: isDirectory, - parent: tree, - children: [], - fromShrinkwrap: requested, - fakeChild: sw, - fromBundle: sw.bundled ? tree.fromBundle || tree : null, - path: childPath(tree.path, pkg), - realpath: isDirectory ? requested.fetchSpec : childPath(tree.realpath, pkg), - location: (tree.location === '/' ? '' : tree.location + '/') + pkg.name, - isLink: isDirectory, - isInLink: tree.isLink || tree.isInLink, - swRequires: sw.requires - }) - tree.children.push(child) - return child -} - -function fetchChild (topPath, tree, sw, requested) { - return fetchPackageMetadata(requested, topPath).then((pkg) => { - pkg._from = sw.from || requested.raw - pkg._optional = sw.optional - pkg._development = sw.dev - pkg._inBundle = false - return addBundled(pkg).then(() => pkg) - }).then((pkg) => { - var isLink = pkg._requested.type === 'directory' - const child = createChild({ - package: pkg, - loaded: false, - parent: tree, - fromShrinkwrap: requested, - path: childPath(tree.path, pkg), - realpath: isLink ? requested.fetchSpec : childPath(tree.realpath, pkg), - children: pkg._bundled || [], - location: (tree.location === '/' ? '' : tree.location + '/') + pkg.name, - fromBundle: null, - isLink: isLink, - isInLink: tree.isLink, - swRequires: sw.requires - }) - tree.children.push(child) - if (pkg._bundled) { - delete pkg._bundled - inflateBundled(child, child, child.children) - } - return child - }) -} - -function childIsEquivalent (sw, requested, child) { - if (!child) return false - if (child.fromShrinkwrap) return true - if ( - sw.integrity && - child.package._integrity && - ssri.parse(sw.integrity).match(child.package._integrity) - ) return true - if (child.isLink && requested.type === 'directory') return path.relative(child.realpath, requested.fetchSpec) === '' - - if (sw.resolved) return child.package._resolved === sw.resolved - if (!isRegistry(requested) && sw.from) return child.package._from === sw.from - if (!isRegistry(requested) && child.package._resolved) return sw.version === child.package._resolved - return child.package.version === sw.version -} diff --git a/deps/npm/lib/install/is-dev-dep.js b/deps/npm/lib/install/is-dev-dep.js deleted file mode 100644 index c7a7982c5e670e..00000000000000 --- a/deps/npm/lib/install/is-dev-dep.js +++ /dev/null @@ -1,8 +0,0 @@ -'use strict' -module.exports = isDevDep - -function isDevDep (node, name) { - return node.package && - node.package.devDependencies && - node.package.devDependencies[name] -} diff --git a/deps/npm/lib/install/is-extraneous.js b/deps/npm/lib/install/is-extraneous.js deleted file mode 100644 index a6477c23744079..00000000000000 --- a/deps/npm/lib/install/is-extraneous.js +++ /dev/null @@ -1,27 +0,0 @@ -'use strict' -module.exports = isExtraneous - -function isExtraneous (tree) { - var result = !isNotExtraneous(tree) - return result -} - -function topHasNoPjson (tree) { - var top = tree - while (!top.isTop) top = top.parent - return top.error -} - -function isNotExtraneous (tree, isCycle) { - if (!isCycle) isCycle = {} - if (tree.isTop || tree.userRequired) { - return true - } else if (isCycle[tree.path]) { - return topHasNoPjson(tree) - } else { - isCycle[tree.path] = true - return tree.requiredBy && tree.requiredBy.some(function (node) { - return isNotExtraneous(node, Object.create(isCycle)) - }) - } -} diff --git a/deps/npm/lib/install/is-fs-access-available.js b/deps/npm/lib/install/is-fs-access-available.js deleted file mode 100644 index a7d2640d794b5d..00000000000000 --- a/deps/npm/lib/install/is-fs-access-available.js +++ /dev/null @@ -1,22 +0,0 @@ -'use strict' -var fs = require('fs') -var semver = require('semver') -var isWindows = process.platform === 'win32' - -// fs.access first introduced in node 0.12 / io.js -if (!fs.access) { - module.exports = false -} else if (!isWindows) { - // fs.access always works on non-Windows OSes - module.exports = true -} else { - // The Windows implementation of `fs.access` has a bug where it will - // sometimes return access errors all the time for directories, even - // when access is available. As all we actually test ARE directories, this - // is a bit of a problem. - // This was fixed in io.js version 1.5.0 - // As of 2015-07-20, it is still unfixed in node: - // https://github.com/joyent/node/issues/25657 - - module.exports = semver.gte(process.version, '1.5.0') -} diff --git a/deps/npm/lib/install/is-only-dev.js b/deps/npm/lib/install/is-only-dev.js deleted file mode 100644 index 804497393eaa3c..00000000000000 --- a/deps/npm/lib/install/is-only-dev.js +++ /dev/null @@ -1,37 +0,0 @@ -'use strict' -module.exports = isOnlyDev - -const moduleName = require('../utils/module-name.js') -const isDevDep = require('./is-dev-dep.js') -const isProdDep = require('./is-prod-dep.js') - -// Returns true if the module `node` is only required direcctly as a dev -// dependency of the top level or transitively _from_ top level dev -// dependencies. -// Dual mode modules (that are both dev AND prod) should return false. -function isOnlyDev (node, seen) { - if (!seen) seen = new Set() - return node.requiredBy.length && node.requiredBy.every(andIsOnlyDev(moduleName(node), seen)) -} - -// There is a known limitation with this implementation: If a dependency is -// ONLY required by cycles that are detached from the top level then it will -// ultimately return true. -// -// This is ok though: We don't allow shrinkwraps with extraneous deps and -// these situation is caught by the extraneous checker before we get here. -function andIsOnlyDev (name, seen) { - return function (req) { - const isDev = isDevDep(req, name) - const isProd = isProdDep(req, name) - if (req.isTop) { - return isDev && !isProd - } else { - if (seen.has(req)) return true - seen.add(req) - const result = isOnlyDev(req, seen) - seen.delete(req) - return result - } - } -} diff --git a/deps/npm/lib/install/is-only-optional.js b/deps/npm/lib/install/is-only-optional.js deleted file mode 100644 index ea27eadcfa809a..00000000000000 --- a/deps/npm/lib/install/is-only-optional.js +++ /dev/null @@ -1,22 +0,0 @@ -'use strict' -module.exports = isOptional - -const isOptDep = require('./is-opt-dep.js') -const moduleName = require('../utils/module-name.js') - -function isOptional (node, seen) { - if (!seen) seen = new Set() - // If a node is not required by anything, then we've reached - // the top level package. - if (seen.has(node) || node.requiredBy.length === 0) { - return false - } - seen.add(node) - const swOptional = node.fromShrinkwrap && node.package._optional - const result = node.requiredBy.every(function (req) { - if (req.fakeChild && swOptional) return true - return isOptDep(req, moduleName(node)) || isOptional(req, seen) - }) - seen.delete(node) - return result -} diff --git a/deps/npm/lib/install/is-opt-dep.js b/deps/npm/lib/install/is-opt-dep.js deleted file mode 100644 index 807b8ab998bf20..00000000000000 --- a/deps/npm/lib/install/is-opt-dep.js +++ /dev/null @@ -1,8 +0,0 @@ -'use strict' -module.exports = isOptDep - -function isOptDep (node, name) { - return node.package && - node.package.optionalDependencies && - node.package.optionalDependencies[name] -} diff --git a/deps/npm/lib/install/is-prod-dep.js b/deps/npm/lib/install/is-prod-dep.js deleted file mode 100644 index 1e2a0b4e4904cf..00000000000000 --- a/deps/npm/lib/install/is-prod-dep.js +++ /dev/null @@ -1,9 +0,0 @@ -'use strict' - -module.exports = isProdDep - -function isProdDep (node, name) { - return node.package && - node.package.dependencies && - node.package.dependencies[name] -} diff --git a/deps/npm/lib/install/module-staging-path.js b/deps/npm/lib/install/module-staging-path.js deleted file mode 100644 index 00ee96b33d50b0..00000000000000 --- a/deps/npm/lib/install/module-staging-path.js +++ /dev/null @@ -1,8 +0,0 @@ -'use strict' -var uniqueFilename = require('unique-filename') -var moduleName = require('../utils/module-name.js') - -module.exports = moduleStagingPath -function moduleStagingPath (staging, pkg) { - return uniqueFilename(staging, moduleName(pkg), pkg.realpath) -} diff --git a/deps/npm/lib/install/mutate-into-logical-tree.js b/deps/npm/lib/install/mutate-into-logical-tree.js deleted file mode 100644 index 885149450f1f1a..00000000000000 --- a/deps/npm/lib/install/mutate-into-logical-tree.js +++ /dev/null @@ -1,140 +0,0 @@ -'use strict' -var union = require('lodash.union') -var without = require('lodash.without') -var validate = require('aproba') -var flattenTree = require('./flatten-tree.js') -var isExtraneous = require('./is-extraneous.js') -var validateAllPeerDeps = require('./deps.js').validateAllPeerDeps -var packageId = require('../utils/package-id.js') -var moduleName = require('../utils/module-name.js') -var npm = require('../npm.js') - -// Return true if tree is a part of a cycle that: -// A) Never connects to the top of the tree -// B) Has not not had a point in the cycle arbitrarily declared its top -// yet. -function isDisconnectedCycle (tree, seen) { - if (!seen) seen = {} - if (tree.isTop || tree.cycleTop || tree.requiredBy.length === 0) { - return false - } else if (seen[tree.path]) { - return true - } else { - seen[tree.path] = true - return tree.requiredBy.every(function (node) { - return isDisconnectedCycle(node, Object.create(seen)) - }) - } -} - -var mutateIntoLogicalTree = module.exports = function (tree) { - validate('O', arguments) - - validateAllPeerDeps(tree, function (tree, pkgname, version) { - if (!tree.missingPeers) tree.missingPeers = {} - tree.missingPeers[pkgname] = version - }) - - var flat = flattenTree(tree) - - Object.keys(flat).sort().forEach(function (flatname) { - var node = flat[flatname] - if (!(node.requiredBy && node.requiredBy.length)) return - - if (node.parent) { - // If a node is a cycle that never reaches the root of the logical - // tree then we'll leave it attached to the root, or else it - // would go missing. Further we'll note that this is the node in the - // cycle that we picked arbitrarily to be the one attached to the root. - // others will fall - if (isDisconnectedCycle(node)) { - node.cycleTop = true - // Nor do we want to disconnect non-cyclical extraneous modules from the tree. - } else if (node.requiredBy.length) { - // regular deps though, we do, as we're moving them into the capable - // hands of the modules that require them. - node.parent.children = without(node.parent.children, node) - } - } - - node.requiredBy.forEach(function (parentNode) { - parentNode.children = union(parentNode.children, [node]) - }) - }) - return tree -} - -module.exports.asReadInstalled = function (tree) { - mutateIntoLogicalTree(tree) - return translateTree(tree) -} - -function translateTree (tree) { - return translateTree_(tree, new Set()) -} - -function translateTree_ (tree, seen) { - var pkg = tree.package - if (seen.has(tree)) return pkg - seen.add(tree) - if (pkg._dependencies) return pkg - pkg._dependencies = pkg.dependencies - pkg.dependencies = {} - tree.children.forEach(function (child) { - const dep = pkg.dependencies[moduleName(child)] = translateTree_(child, seen) - if (child.fakeChild) { - dep.missing = true - dep.optional = child.package._optional - dep.requiredBy = child.package._spec - } - }) - - function markMissing (name, requiredBy) { - if (pkg.dependencies[name]) { - if (pkg.dependencies[name].missing) return - pkg.dependencies[name].invalid = true - pkg.dependencies[name].realName = name - pkg.dependencies[name].extraneous = false - } else { - pkg.dependencies[name] = { - requiredBy: requiredBy, - missing: true, - optional: !!pkg.optionalDependencies[name] - } - } - } - - Object.keys(tree.missingDeps).forEach(function (name) { - markMissing(name, tree.missingDeps[name]) - }) - Object.keys(tree.missingDevDeps).forEach(function (name) { - markMissing(name, tree.missingDevDeps[name]) - }) - var checkForMissingPeers = (tree.parent ? [] : [tree]).concat(tree.children) - checkForMissingPeers.filter(function (child) { - return child.missingPeers - }).forEach(function (child) { - Object.keys(child.missingPeers).forEach(function (pkgname) { - var version = child.missingPeers[pkgname] - var peerPkg = pkg.dependencies[pkgname] - if (!peerPkg) { - peerPkg = pkg.dependencies[pkgname] = { - _id: pkgname + '@' + version, - name: pkgname, - version: version - } - } - if (!peerPkg.peerMissing) peerPkg.peerMissing = [] - peerPkg.peerMissing.push({ - requiredBy: packageId(child), - requires: pkgname + '@' + version - }) - }) - }) - pkg.path = tree.path - - pkg.error = tree.error - pkg.extraneous = !tree.isTop && (!tree.parent.isTop || !tree.parent.error) && !npm.config.get('global') && isExtraneous(tree) - if (tree.target && tree.parent && !tree.parent.target) pkg.link = tree.realpath - return pkg -} diff --git a/deps/npm/lib/install/node.js b/deps/npm/lib/install/node.js deleted file mode 100644 index 18138078a2e662..00000000000000 --- a/deps/npm/lib/install/node.js +++ /dev/null @@ -1,77 +0,0 @@ -'use strict' - -var defaultTemplate = { - package: { - version: '', - dependencies: {}, - devDependencies: {}, - optionalDependencies: {} - }, - loaded: false, - children: [], - requiredBy: [], - requires: [], - missingDeps: {}, - missingDevDeps: {}, - phantomChildren: {}, - path: null, - realpath: null, - location: null, - userRequired: false, - save: false, - saveSpec: null, - isTop: false, - fromBundle: false -} - -function isLink (node) { - return node && node.isLink -} -function isInLink (node) { - return node && (node.isInLink || node.isLink) -} - -var create = exports.create = function (node, template, isNotTop) { - if (!template) template = defaultTemplate - Object.keys(template).forEach(function (key) { - if (template[key] != null && typeof template[key] === 'object' && !(template[key] instanceof Array)) { - if (!node[key]) node[key] = {} - return create(node[key], template[key], true) - } - if (node[key] != null) return - node[key] = template[key] - }) - if (!isNotTop) { - // isLink is true for the symlink and everything inside it. - // by contrast, isInLink is true for only the things inside a link - if (node.isLink == null) node.isLink = isLink(node.parent) - if (node.isInLink == null) node.isInLink = isInLink(node.parent) - if (node.fromBundle == null) { - node.fromBundle = false - } - } - return node -} - -exports.reset = function (node) { - reset(node, new Set()) -} - -function reset (node, seen) { - if (seen.has(node)) return - seen.add(node) - var child = create(node) - - // FIXME: cleaning up after read-package-json's mess =( - if (child.package._id === '@') delete child.package._id - - child.isTop = false - child.requiredBy = [] - child.requires = [] - child.missingDeps = {} - child.missingDevDeps = {} - child.phantomChildren = {} - child.location = null - - child.children.forEach(function (child) { reset(child, seen) }) -} diff --git a/deps/npm/lib/install/read-shrinkwrap.js b/deps/npm/lib/install/read-shrinkwrap.js deleted file mode 100644 index 1d9fb99c1d8078..00000000000000 --- a/deps/npm/lib/install/read-shrinkwrap.js +++ /dev/null @@ -1,107 +0,0 @@ -'use strict' - -const BB = require('bluebird') - -const fs = require('graceful-fs') -const iferr = require('iferr') -const inflateShrinkwrap = require('./inflate-shrinkwrap.js') -const log = require('npmlog') -const parseJSON = require('../utils/parse-json.js') -const path = require('path') -const PKGLOCK_VERSION = require('../npm.js').lockfileVersion - -const readFileAsync = BB.promisify(fs.readFile) - -module.exports = readShrinkwrap -function readShrinkwrap (child, next) { - if (child.package._shrinkwrap) return process.nextTick(next) - BB.join( - maybeReadFile('npm-shrinkwrap.json', child), - // Don't read non-root lockfiles - child.isTop && maybeReadFile('package-lock.json', child), - (shrinkwrap, lockfile) => { - if (shrinkwrap && lockfile) { - log.warn('read-shrinkwrap', 'Ignoring package-lock.json because there is already an npm-shrinkwrap.json. Please use only one of the two.') - } - const name = shrinkwrap ? 'npm-shrinkwrap.json' : 'package-lock.json' - const parsed = parsePkgLock(shrinkwrap || lockfile, name) - if (parsed && parsed.lockfileVersion !== PKGLOCK_VERSION) { - log.warn('read-shrinkwrap', `This version of npm is compatible with lockfileVersion@${PKGLOCK_VERSION}, but ${name} was generated for lockfileVersion@${parsed.lockfileVersion || 0}. I'll try to do my best with it!`) - } - child.package._shrinkwrap = parsed - } - ).then(() => next(), next) -} - -function maybeReadFile (name, child) { - return readFileAsync( - path.join(child.path, name), - 'utf8' - ).catch({code: 'ENOENT'}, () => null) -} - -module.exports.andInflate = function (child, next) { - readShrinkwrap(child, iferr(next, function () { - if (child.package._shrinkwrap) { - return inflateShrinkwrap(child, child.package._shrinkwrap || {}, next) - } else { - return next() - } - })) -} - -const PARENT_RE = /\|{7,}/g -const OURS_RE = /<{7,}/g -const THEIRS_RE = /={7,}/g -const END_RE = />{7,}/g - -module.exports._isDiff = isDiff -function isDiff (str) { - return str.match(OURS_RE) && str.match(THEIRS_RE) && str.match(END_RE) -} - -module.exports._parsePkgLock = parsePkgLock -function parsePkgLock (str, filename) { - if (!str) { return null } - try { - return parseJSON(str) - } catch (e) { - if (isDiff(str)) { - log.warn('conflict', `A git conflict was detected in ${filename}. Attempting to auto-resolve.`) - log.warn('conflict', 'To make this happen automatically on git rebase/merge, consider using the npm-merge-driver:') - log.warn('conflict', '$ npx npm-merge-driver install -g') - const pieces = str.split(/[\n\r]+/g).reduce((acc, line) => { - if (line.match(PARENT_RE)) acc.state = 'parent' - else if (line.match(OURS_RE)) acc.state = 'ours' - else if (line.match(THEIRS_RE)) acc.state = 'theirs' - else if (line.match(END_RE)) acc.state = 'top' - else { - if (acc.state === 'top' || acc.state === 'ours') acc.ours += line - if (acc.state === 'top' || acc.state === 'theirs') acc.theirs += line - if (acc.state === 'top' || acc.state === 'parent') acc.parent += line - } - return acc - }, { - state: 'top', - ours: '', - theirs: '', - parent: '' - }) - try { - const ours = parseJSON(pieces.ours) - const theirs = parseJSON(pieces.theirs) - return reconcileLockfiles(ours, theirs) - } catch (_e) { - log.error('conflict', `Automatic conflict resolution failed. Please manually resolve conflicts in ${filename} and try again.`) - log.silly('conflict', `Error during resolution: ${_e}`) - throw e - } - } else { - throw e - } - } -} - -function reconcileLockfiles (parent, ours, theirs) { - return Object.assign({}, ours, theirs) -} diff --git a/deps/npm/lib/install/realize-shrinkwrap-specifier.js b/deps/npm/lib/install/realize-shrinkwrap-specifier.js deleted file mode 100644 index e4b14b1f0d9597..00000000000000 --- a/deps/npm/lib/install/realize-shrinkwrap-specifier.js +++ /dev/null @@ -1,22 +0,0 @@ -'use strict' -var npa = require('npm-package-arg') -const isRegistry = require('../utils/is-registry.js') - -module.exports = function (name, sw, where) { - try { - if (sw.version && sw.integrity) { - return npa.resolve(name, sw.version, where) - } else if (sw.from) { - const spec = npa(sw.from, where) - if (isRegistry(spec) && sw.version) { - return npa.resolve(name, sw.version, where) - } else if (!sw.resolved) { - return spec - } - } - if (sw.resolved) { - return npa.resolve(name, sw.resolved, where) - } - } catch (_) { } - return npa.resolve(name, sw.version, where) -} diff --git a/deps/npm/lib/install/report-optional-failure.js b/deps/npm/lib/install/report-optional-failure.js deleted file mode 100644 index 41c7c535bdd63b..00000000000000 --- a/deps/npm/lib/install/report-optional-failure.js +++ /dev/null @@ -1,31 +0,0 @@ -'use strict' -var path = require('path') -var moduleName = require('../utils/module-name.js') - -module.exports = reportOptionalFailure - -function top (tree) { - if (tree.parent) return top(tree.parent) - return tree -} - -function reportOptionalFailure (tree, what, error) { - var topTree = top(tree) - if (!topTree.warnings) topTree.warnings = [] - var id - if (what) { - var depVer = tree.package.dependencies && tree.package.dependencies[what] - var optDepVer = tree.package.optionalDependencies && tree.package.optionalDependencies[what] - var devDepVer = tree.package.devDependencies && tree.package.devDependencies[what] - var version = depVer || optDepVer || devDepVer - id = what + (version ? '@' + version : '') - } else { - id = tree._id || moduleName(tree) + (tree.package.version ? '@' + tree.package.version : '') - } - var location = path.relative(topTree.path, tree.path) - if (what) location = path.join(location, 'node_modules', what) - - error.optional = id - error.location = location - topTree.warnings.push(error) -} diff --git a/deps/npm/lib/install/save.js b/deps/npm/lib/install/save.js deleted file mode 100644 index 986233a516a7c5..00000000000000 --- a/deps/npm/lib/install/save.js +++ /dev/null @@ -1,193 +0,0 @@ -'use strict' - -const deepSortObject = require('../utils/deep-sort-object.js') -const detectIndent = require('detect-indent') -const detectNewline = require('detect-newline') -const fs = require('graceful-fs') -const iferr = require('iferr') -const log = require('npmlog') -const moduleName = require('../utils/module-name.js') -const npm = require('../npm.js') -const packageId = require('../utils/package-id.js') -const parseJSON = require('../utils/parse-json.js') -const path = require('path') -const stringifyPackage = require('stringify-package') -const validate = require('aproba') -const without = require('lodash.without') -const writeFileAtomic = require('write-file-atomic') - -// if the -S|--save option is specified, then write installed packages -// as dependencies to a package.json file. - -exports.saveRequested = function (tree, andReturn) { - validate('OF', arguments) - savePackageJson(tree, andWarnErrors(andSaveShrinkwrap(tree, andReturn))) -} - -function andSaveShrinkwrap (tree, andReturn) { - validate('OF', arguments) - return function (er) { - validate('E', arguments) - saveShrinkwrap(tree, andWarnErrors(andReturn)) - } -} - -function andWarnErrors (cb) { - validate('F', arguments) - return function (er) { - if (er) log.warn('saveError', er.message) - arguments[0] = null - cb.apply(null, arguments) - } -} - -exports.saveShrinkwrap = saveShrinkwrap - -function saveShrinkwrap (tree, next) { - validate('OF', arguments) - if (!npm.config.get('package-lock-only') && (!npm.config.get('shrinkwrap') || !npm.config.get('package-lock'))) { - return next() - } - require('../shrinkwrap.js').createShrinkwrap(tree, {silent: false}, next) -} - -function savePackageJson (tree, next) { - validate('OF', arguments) - var saveBundle = npm.config.get('save-bundle') - - // each item in the tree is a top-level thing that should be saved - // to the package.json file. - // The relevant tree shape is { : {what:} } - var saveTarget = path.resolve(tree.path, 'package.json') - // don't use readJson, because we don't want to do all the other - // tricky npm-specific stuff that's in there. - fs.readFile(saveTarget, 'utf8', iferr(next, function (packagejson) { - const indent = detectIndent(packagejson).indent - const newline = detectNewline(packagejson) - try { - tree.package = parseJSON(packagejson) - } catch (ex) { - return next(ex) - } - - // If we're saving bundled deps, normalize the key before we start - if (saveBundle) { - var bundle = tree.package.bundleDependencies || tree.package.bundledDependencies - delete tree.package.bundledDependencies - if (!Array.isArray(bundle)) bundle = [] - } - - var toSave = getThingsToSave(tree) - var toRemove = getThingsToRemove(tree) - var savingTo = {} - toSave.forEach(function (pkg) { if (pkg.save) savingTo[pkg.save] = true }) - toRemove.forEach(function (pkg) { if (pkg.save) savingTo[pkg.save] = true }) - - Object.keys(savingTo).forEach(function (save) { - if (!tree.package[save]) tree.package[save] = {} - }) - - log.verbose('saving', toSave) - const types = ['dependencies', 'devDependencies', 'optionalDependencies'] - toSave.forEach(function (pkg) { - if (pkg.save) tree.package[pkg.save][pkg.name] = pkg.spec - const movedFrom = [] - for (let saveType of types) { - if ( - pkg.save !== saveType && - tree.package[saveType] && - tree.package[saveType][pkg.name] - ) { - movedFrom.push(saveType) - delete tree.package[saveType][pkg.name] - } - } - if (movedFrom.length) { - log.notice('save', `${pkg.name} is being moved from ${movedFrom.join(' and ')} to ${pkg.save}`) - } - if (saveBundle) { - var ii = bundle.indexOf(pkg.name) - if (ii === -1) bundle.push(pkg.name) - } - }) - - toRemove.forEach(function (pkg) { - if (pkg.save) delete tree.package[pkg.save][pkg.name] - if (saveBundle) { - bundle = without(bundle, pkg.name) - } - }) - - Object.keys(savingTo).forEach(function (key) { - tree.package[key] = deepSortObject(tree.package[key]) - }) - if (saveBundle) { - tree.package.bundleDependencies = deepSortObject(bundle) - } - - var json = stringifyPackage(tree.package, indent, newline) - if (json === packagejson) { - log.verbose('shrinkwrap', 'skipping write for package.json because there were no changes.') - next() - } else { - writeFileAtomic(saveTarget, json, next) - } - - // Restore derived id as it was removed when reloading from disk - tree.package._id = packageId(tree.package) - })) -} - -exports.getSaveType = function (tree, arg) { - if (arguments.length) validate('OO', arguments) - var globalInstall = npm.config.get('global') - var noSaveFlags = !npm.config.get('save') && - !npm.config.get('save-dev') && - !npm.config.get('save-prod') && - !npm.config.get('save-optional') - if (globalInstall || noSaveFlags) return null - - if (npm.config.get('save-optional')) { - return 'optionalDependencies' - } else if (npm.config.get('save-dev')) { - return 'devDependencies' - } else if (npm.config.get('save-prod')) { - return 'dependencies' - } else { - if (arg) { - var name = moduleName(arg) - if (tree.package.optionalDependencies[name]) { - return 'optionalDependencies' - } else if (tree.package.devDependencies[name]) { - return 'devDependencies' - } - } - return 'dependencies' - } -} - -function getThingsToSave (tree) { - validate('O', arguments) - var toSave = tree.children.filter(function (child) { - return child.save - }).map(function (child) { - return { - name: moduleName(child), - spec: child.saveSpec, - save: child.save - } - }) - return toSave -} - -function getThingsToRemove (tree) { - validate('O', arguments) - if (!tree.removedChildren) return [] - var toRemove = tree.removedChildren.map(function (child) { - return { - name: moduleName(child), - save: child.save - } - }) - return toRemove -} diff --git a/deps/npm/lib/install/update-package-json.js b/deps/npm/lib/install/update-package-json.js deleted file mode 100644 index afffaf78002061..00000000000000 --- a/deps/npm/lib/install/update-package-json.js +++ /dev/null @@ -1,56 +0,0 @@ -'use strict' -var path = require('path') -var writeFileAtomic = require('write-file-atomic') -var moduleName = require('../utils/module-name.js') -var deepSortObject = require('../utils/deep-sort-object.js') -var sortedObject = require('sorted-object') -var isWindows = require('../utils/is-windows.js') - -var sortKeys = [ - 'dependencies', 'devDependencies', 'bundleDependencies', - 'optionalDependencies', 'keywords', 'engines', 'scripts', - 'files' -] - -module.exports = function (mod, buildpath, next) { - var pkg = sortedObject(mod.package) - var name = moduleName(mod) - // Add our diagnostic keys to the package.json. - // Note that there are folks relying on these, for ex, the Visual Studio - // Node.js addon. - pkg._requiredBy = - mod.requiredBy - .map(function (req) { - if ( - req.package.devDependencies && - req.package.devDependencies[name] && - !req.package.dependencies[name] - ) { - return '#DEV:' + req.location - } else { - return req.location - } - }) - .concat(mod.userRequired ? ['#USER'] : []) - .sort() - pkg._location = mod.location - pkg._phantomChildren = {} - Object.keys(mod.phantomChildren).sort().forEach(function (name) { - pkg._phantomChildren[name] = mod.phantomChildren[name].package.version - }) - pkg._inBundle = !!mod.fromBundle - - // sort keys that are known safe to sort to produce more consistent output - sortKeys.forEach(function (key) { - if (pkg[key] != null) pkg[key] = deepSortObject(pkg[key]) - }) - - var data = JSON.stringify(sortedObject(pkg), null, 2) + '\n' - - writeFileAtomic(path.resolve(buildpath, 'package.json'), data, { - // We really don't need this guarantee, and fsyncing here is super slow. Except on - // Windows where there isn't a big performance difference and it prevents errors when - // rolling back optional packages (#17671) - fsync: isWindows - }, next) -} diff --git a/deps/npm/lib/install/validate-args.js b/deps/npm/lib/install/validate-args.js deleted file mode 100644 index b680a1b24ba471..00000000000000 --- a/deps/npm/lib/install/validate-args.js +++ /dev/null @@ -1,84 +0,0 @@ -'use strict' -var validate = require('aproba') -var asyncMap = require('slide').asyncMap -var chain = require('slide').chain -var npmInstallChecks = require('npm-install-checks') -var iferr = require('iferr') -var checkEngine = npmInstallChecks.checkEngine -var checkPlatform = npmInstallChecks.checkPlatform -var npm = require('../npm.js') - -module.exports = function (idealTree, args, next) { - validate('OAF', arguments) - var force = npm.config.get('force') - - asyncMap(args, function (pkg, done) { - chain([ - [hasMinimumFields, pkg], - [checkSelf, idealTree, pkg, force], - [isInstallable, idealTree, pkg] - ], done) - }, next) -} - -function hasMinimumFields (pkg, cb) { - if (pkg.name === '' || pkg.name == null) { - return cb(new Error(`Can't install ${pkg._resolved}: Missing package name`)) - } else if (pkg.version === '' || pkg.version == null) { - return cb(new Error(`Can't install ${pkg._resolved}: Missing package version`)) - } else { - return cb() - } -} - -function setWarnings (idealTree, warn) { - function top (tree) { - if (tree.parent) return top(tree.parent) - return tree - } - - var topTree = top(idealTree) - if (!topTree.warnings) topTree.warnings = [] - - if (topTree.warnings.every(i => ( - i.code !== warn.code || - i.required !== warn.required || - i.pkgid !== warn.pkgid))) { - topTree.warnings.push(warn) - } -} - -var isInstallable = module.exports.isInstallable = function (idealTree, pkg, next) { - var force = npm.config.get('force') - var nodeVersion = npm.config.get('node-version') - if (/-/.test(nodeVersion)) { - // for the purposes of validation, if the node version is a prerelease, - // strip that. We check and warn about this sceanrio over in validate-tree. - nodeVersion = nodeVersion.replace(/-.*/, '') - } - var strict = npm.config.get('engine-strict') - checkEngine(pkg, npm.version, nodeVersion, force, strict, iferr(next, thenWarnEngineIssues)) - function thenWarnEngineIssues (warn) { - if (idealTree && warn) setWarnings(idealTree, warn) - checkPlatform(pkg, force, next) - } -} - -function checkSelf (idealTree, pkg, force, next) { - if (idealTree.package && idealTree.package.name !== pkg.name) return next() - if (force) { - var warn = new Error("Wouldn't install " + pkg.name + ' as a dependency of itself, but being forced') - warn.code = 'ENOSELF' - idealTree.warnings.push(warn) - next() - } else { - var er = new Error('Refusing to install package with name "' + pkg.name + - '" under a package\n' + - 'also called "' + pkg.name + '". Did you name your project the same\n' + - 'as the dependency you\'re installing?\n\n' + - 'For more information, see:\n' + - ' ') - er.code = 'ENOSELF' - next(er) - } -} diff --git a/deps/npm/lib/install/validate-tree.js b/deps/npm/lib/install/validate-tree.js deleted file mode 100644 index 24a140171d45c1..00000000000000 --- a/deps/npm/lib/install/validate-tree.js +++ /dev/null @@ -1,95 +0,0 @@ -'use strict' -var path = require('path') -var validate = require('aproba') -var asyncMap = require('slide').asyncMap -var chain = require('slide').chain -var npmInstallChecks = require('npm-install-checks') -var checkGit = npmInstallChecks.checkGit -var clone = require('lodash.clonedeep') -var normalizePackageData = require('normalize-package-data') -var npm = require('../npm.js') -var andFinishTracker = require('./and-finish-tracker.js') -var flattenTree = require('./flatten-tree.js') -var validateAllPeerDeps = require('./deps.js').validateAllPeerDeps -var packageId = require('../utils/package-id.js') - -module.exports = function (idealTree, log, next) { - validate('OOF', arguments) - var moduleMap = flattenTree(idealTree) - var modules = Object.keys(moduleMap).map(function (name) { return moduleMap[name] }) - - chain([ - [asyncMap, modules, function (mod, done) { - chain([ - mod.parent && !mod.isLink && [checkGit, mod.realpath], - [checkErrors, mod, idealTree] - ], done) - }], - [thenValidateAllPeerDeps, idealTree], - [thenCheckTop, idealTree], - [thenCheckDuplicateDeps, idealTree] - ], andFinishTracker(log, next)) -} - -function checkErrors (mod, idealTree, next) { - if (mod.error && (mod.parent || path.resolve(npm.globalDir, '..') !== mod.path)) idealTree.warnings.push(mod.error) - next() -} - -function thenValidateAllPeerDeps (idealTree, next) { - validate('OF', arguments) - validateAllPeerDeps(idealTree, function (tree, pkgname, version) { - var warn = new Error(packageId(tree) + ' requires a peer of ' + pkgname + '@' + - version + ' but none is installed. You must install peer dependencies yourself.') - warn.code = 'EPEERINVALID' - idealTree.warnings.push(warn) - }) - next() -} - -function thenCheckTop (idealTree, next) { - validate('OF', arguments) - if (idealTree.package.error) return next() - - // FIXME: when we replace read-package-json with something less magic, - // this should done elsewhere. - // As it is, the package has already been normalized and thus some - // errors are suppressed. - var pkg = clone(idealTree.package) - try { - normalizePackageData(pkg, function (warn) { - var warnObj = new Error(packageId(idealTree) + ' ' + warn) - warnObj.code = 'EPACKAGEJSON' - idealTree.warnings.push(warnObj) - }, false) - } catch (er) { - er.code = 'EPACKAGEJSON' - idealTree.warnings.push(er) - } - - var nodeVersion = npm.config.get('node-version') - if (/-/.test(nodeVersion)) { - // if this is a prerelease node… - var warnObj = new Error('You are using a pre-release version of node and things may not work as expected') - warnObj.code = 'ENODEPRE' - idealTree.warnings.push(warnObj) - } - - next() -} - -// check for deps duplciated between devdeps and regular deps -function thenCheckDuplicateDeps (idealTree, next) { - var deps = idealTree.package.dependencies || {} - var devDeps = idealTree.package.devDependencies || {} - - for (var pkg in devDeps) { - if (pkg in deps) { - var warnObj = new Error('The package ' + pkg + ' is included as both a dev and production dependency.') - warnObj.code = 'EDUPLICATEDEP' - idealTree.warnings.push(warnObj) - } - } - - next() -} diff --git a/deps/npm/lib/install/writable.js b/deps/npm/lib/install/writable.js deleted file mode 100644 index 199b48f5970688..00000000000000 --- a/deps/npm/lib/install/writable.js +++ /dev/null @@ -1,35 +0,0 @@ -'use strict' -var path = require('path') -var fs = require('fs') -var inflight = require('inflight') -var accessError = require('./access-error.js') -var andIgnoreErrors = require('./and-ignore-errors.js') -var isFsAccessAvailable = require('./is-fs-access-available.js') - -if (isFsAccessAvailable) { - module.exports = fsAccessImplementation -} else { - module.exports = fsOpenImplementation -} - -// exposed only for testing purposes -module.exports.fsAccessImplementation = fsAccessImplementation -module.exports.fsOpenImplementation = fsOpenImplementation - -function fsAccessImplementation (dir, done) { - done = inflight('writable:' + dir, done) - if (!done) return - fs.access(dir, fs.W_OK, done) -} - -function fsOpenImplementation (dir, done) { - done = inflight('writable:' + dir, done) - if (!done) return - var tmp = path.join(dir, '.npm.check.permissions') - fs.open(tmp, 'w', function (er, fd) { - if (er) return done(accessError(dir, er)) - fs.close(fd, function () { - fs.unlink(tmp, andIgnoreErrors(done)) - }) - }) -} diff --git a/deps/npm/lib/link.js b/deps/npm/lib/link.js index e05526c4080d3b..56d50f98483eb2 100644 --- a/deps/npm/lib/link.js +++ b/deps/npm/lib/link.js @@ -1,197 +1,140 @@ -// link with no args: symlink the folder to the global location -// link with package arg: symlink the global to the local - -var npm = require('./npm.js') -var symlink = require('./utils/link.js') -var fs = require('graceful-fs') -var log = require('npmlog') -var asyncMap = require('slide').asyncMap -var chain = require('slide').chain -var path = require('path') -var build = require('./build.js') -var npa = require('npm-package-arg') -var usage = require('./utils/usage') -var output = require('./utils/output.js') - -module.exports = link - -link.usage = usage( +'use strict' + +const { readdir } = require('fs') +const { resolve } = require('path') + +const Arborist = require('@npmcli/arborist') +const npa = require('npm-package-arg') +const rpj = require('read-package-json-fast') +const semver = require('semver') + +const npm = require('./npm.js') +const usageUtil = require('./utils/usage.js') +const reifyOutput = require('./utils/reify-output.js') + +const completion = (opts, cb) => { + const dir = npm.globalDir + readdir(dir, (er, files) => cb(er, files.filter(f => !/^[._-]/.test(f)))) +} + +const usage = usageUtil( 'link', 'npm link (in package dir)' + '\nnpm link [<@scope>/][@]' ) -link.completion = function (opts, cb) { - var dir = npm.globalDir - fs.readdir(dir, function (er, files) { - cb(er, files.filter(function (f) { - return !f.match(/^[._-]/) - })) - }) -} - -function link (args, cb) { - if (process.platform === 'win32') { - var semver = require('semver') - if (!semver.gte(process.version, '0.7.9')) { - var msg = 'npm link not supported on windows prior to node 0.7.9' - var e = new Error(msg) - e.code = 'ENOTSUP' - e.errno = require('constants').ENOTSUP // eslint-disable-line node/no-deprecated-api - return cb(e) - } - } +const cmd = (args, cb) => link(args).then(() => cb()).catch(cb) +const link = async args => { if (npm.config.get('global')) { - return cb(new Error( - 'link should never be --global.\n' + - 'Please re-run this command with --local' - )) + throw Object.assign( + new Error( + 'link should never be --global.\n' + + 'Please re-run this command with --local' + ), + { code: 'ELINKGLOBAL' } + ) } - if (args.length === 1 && args[0] === '.') args = [] - if (args.length) return linkInstall(args, cb) - linkPkg(npm.prefix, cb) + // link with no args: symlink the folder to the global location + // link with package arg: symlink the global to the local + args = args.filter(a => resolve(a) !== npm.prefix) + return args.length + ? linkInstall(args) + : linkPkg() } -function parentFolder (id, folder) { - if (id[0] === '@') { - return path.resolve(folder, '..', '..') - } else { - return path.resolve(folder, '..') - } -} - -function linkInstall (pkgs, cb) { - asyncMap(pkgs, function (pkg, cb) { - var t = path.resolve(npm.globalDir, '..') - var pp = path.resolve(npm.globalDir, pkg) - var rp = null - var target = path.resolve(npm.dir, pkg) - - function n (er, data) { - if (er) return cb(er, data) - // we want the ONE thing that was installed into the global dir - var installed = data.filter(function (info) { - var id = info[0] - var folder = info[1] - return parentFolder(id, folder) === npm.globalDir - }) - var id = installed[0][0] - pp = installed[0][1] - var what = npa(id) - pkg = what.name - target = path.resolve(npm.dir, pkg) - next() - } - - // if it's a folder, a random not-installed thing, or not a scoped package, - // then link or install it first - if (pkg[0] !== '@' && (pkg.indexOf('/') !== -1 || pkg.indexOf('\\') !== -1)) { - return fs.lstat(path.resolve(pkg), function (er, st) { - if (er || !st.isDirectory()) { - npm.commands.install(t, pkg, n) - } else { - rp = path.resolve(pkg) - linkPkg(rp, n) - } - }) - } - - fs.lstat(pp, function (er, st) { - if (er) { - rp = pp - return npm.commands.install(t, [pkg], n) - } else if (!st.isSymbolicLink()) { - rp = pp - next() - } else { - return fs.realpath(pp, function (er, real) { - if (er) log.warn('invalid symbolic link', pkg) - else rp = real - next() - }) +// Returns a list of items that can't be fulfilled by +// things found in the current arborist inventory +const missingArgsFromTree = (tree, args) => { + const foundNodes = [] + const missing = args.filter(a => { + const arg = npa(a) + const nodes = tree.children.values() + const argFound = [...nodes].every(node => { + // TODO: write tests for unmatching version specs, this is hard to test + // atm but should be simple once we have a mocked registry again + if (arg.name !== node.name /* istanbul ignore next */ || ( + arg.version && + !semver.satisfies(node.version, arg.version) + )) { + foundNodes.push(node) + return true } }) + return argFound + }) - function next () { - if (npm.config.get('dry-run')) return resultPrinter(pkg, pp, target, rp, cb) - chain( - [ - [ function (cb) { - log.verbose('link', 'symlinking %s to %s', pp, target) - cb() - } ], - [symlink, pp, target, false, false], - // do not run any scripts - rp && [build, [target], npm.config.get('global'), build._noLC, true], - [resultPrinter, pkg, pp, target, rp] - ], - cb - ) - } - }, cb) + // remote nodes from the loaded tree in order + // to avoid dropping them later when reifying + for (const node of foundNodes) { + node.parent = null + } + + return missing } -function linkPkg (folder, cb_) { - var me = folder || npm.prefix - var readJson = require('read-package-json') - - log.verbose('linkPkg', folder) - - readJson(path.resolve(me, 'package.json'), function (er, d) { - function cb (er) { - return cb_(er, [[d && d._id, target, null, null]]) - } - if (er) return cb(er) - if (!d.name) { - er = new Error('Package must have a name field to be linked') - return cb(er) - } - var target = path.resolve(npm.globalDir, d.name) - if (npm.config.get('dry-run')) return resultPrinter(path.basename(me), me, target, cb) - symlink(me, target, false, true, function (er) { - if (er) return cb(er) - log.verbose('link', 'build target', target) - // also install missing dependencies. - npm.commands.install(me, [], function (er) { - if (er) return cb(er) - // build the global stuff. Don't run *any* scripts, because - // install command already will have done that. - build([target], true, build._noLC, true, function (er) { - if (er) return cb(er) - resultPrinter(path.basename(me), me, target, cb) - }) - }) - }) +const linkInstall = async args => { + // load current packages from the global space, + // and then add symlinks installs locally + const globalTop = resolve(npm.globalDir, '..') + const globalOpts = { + ...npm.flatOptions, + path: globalTop, + global: true, + prune: false + } + const globalArb = new Arborist(globalOpts) + + // get only current top-level packages from the global space + const globals = await globalArb.loadActual({ + filter: (node, kid) => + !node.isRoot || args.some(a => npa(a).name === kid) }) -} -function resultPrinter (pkg, src, dest, rp, cb) { - if (typeof cb !== 'function') { - cb = rp - rp = null + // any extra arg that is missing from the current + // global space should be reified there first + const missing = missingArgsFromTree(globals, args) + if (missing.length) { + await globalArb.reify({ + ...globalOpts, + add: missing + }) } - var where = dest - rp = (rp || '').trim() - src = (src || '').trim() - // XXX If --json is set, then look up the data from the package.json - if (npm.config.get('parseable')) { - return parseableOutput(dest, rp || src, cb) + + // get a list of module names that should be linked in the local prefix + const names = [] + for (const a of args) { + const arg = npa(a) + names.push( + arg.type === 'directory' + ? (await rpj(resolve(arg.fetchSpec, 'package.json'))).name + : arg.name + ) } - if (rp === src) rp = null - output(where + ' -> ' + src + (rp ? ' -> ' + rp : '')) - cb() + + // create a new arborist instance for the local prefix and + // reify all the pending names as symlinks there + const localArb = new Arborist({ + ...npm.flatOptions, + path: npm.prefix + }) + await localArb.reify({ + add: names.map(l => `file:${resolve(globalTop, 'node_modules', l)}`) + }) + + reifyOutput(localArb) } -function parseableOutput (dest, rp, cb) { - // XXX this should match ls --parseable and install --parseable - // look up the data from package.json, format it the same way. - // - // link is always effectively 'long', since it doesn't help much to - // *just* print the target folder. - // However, we don't actually ever read the version number, so - // the second field is always blank. - output(dest + '::' + rp) - cb() +const linkPkg = async () => { + const globalTop = resolve(npm.globalDir, '..') + const arb = new Arborist({ + ...npm.flatOptions, + path: globalTop, + global: true + }) + await arb.reify({ add: [`file:${npm.prefix}`] }) + reifyOutput(arb) } + +module.exports = Object.assign(cmd, { completion, usage }) diff --git a/deps/npm/lib/ll.js b/deps/npm/lib/ll.js new file mode 100644 index 00000000000000..ada260e32936a4 --- /dev/null +++ b/deps/npm/lib/ll.js @@ -0,0 +1,6 @@ +const { usage, completion } = require('./ls.js') +const npm = require('./npm.js') +module.exports = Object.assign((args, cb) => { + npm.config.set('long', true) + return npm.commands.ls(args, cb) +}, { usage, completion }) diff --git a/deps/npm/lib/logout.js b/deps/npm/lib/logout.js index 411f547210b8f1..861a50a23de0db 100644 --- a/deps/npm/lib/logout.js +++ b/deps/npm/lib/logout.js @@ -1,44 +1,48 @@ 'use strict' -const BB = require('bluebird') - const eu = encodeURIComponent -const getAuth = require('npm-registry-fetch/auth.js') const log = require('npmlog') +const getAuth = require('npm-registry-fetch/auth.js') +const npmFetch = require('npm-registry-fetch') const npm = require('./npm.js') -const npmConfig = require('./config/figgy-config.js') -const npmFetch = require('libnpm/fetch') +const usageUtil = require('./utils/usage.js') +const completion = require('./utils/completion/none.js') -logout.usage = 'npm logout [--registry=] [--scope=<@scope>]' +const usage = usageUtil( + 'logout', + 'npm logout [--registry=] [--scope=<@scope>]' +) -function afterLogout (normalized) { - var scope = npm.config.get('scope') +const cmd = (args, cb) => logout(args).then(() => cb()).catch(cb) - if (scope) npm.config.del(scope + ':registry') +const logout = async (args) => { + const { registry, scope } = npm.flatOptions + const regRef = scope ? `${scope}:registry` : 'registry' + const reg = npm.flatOptions[regRef] || registry - npm.config.clearCredentialsByURI(normalized) - return BB.fromNode(cb => npm.config.save('user', cb)) -} + const auth = getAuth(reg, npm.flatOptions) -module.exports = logout -function logout (args, cb) { - const opts = npmConfig() - BB.try(() => { - const reg = npmFetch.pickRegistry('foo', opts) - const auth = getAuth(reg, opts) - if (auth.token) { - log.verbose('logout', 'clearing session token for', reg) - return npmFetch(`/-/user/token/${eu(auth.token)}`, opts.concat({ - method: 'DELETE', - ignoreBody: true - })).then(() => afterLogout(reg)) - } else if (auth.username || auth.password) { - log.verbose('logout', 'clearing user credentials for', reg) - return afterLogout(reg) - } else { - throw new Error( - 'Not logged in to', reg + ',', "so can't log out." - ) - } - }).nodeify(cb) + if (auth.token) { + log.verbose('logout', `clearing token for ${reg}`) + await npmFetch(`/-/user/token/${eu(auth.token)}`, { + ...npm.flatOptions, + method: 'DELETE', + ignoreBody: true + }) + } else if (auth.username || auth.password) { + log.verbose('logout', `clearing user credentials for ${reg}`) + } else { + const msg = `not logged in to ${reg}, so can't log out!` + throw Object.assign(new Error(msg), { code: 'ENEEDAUTH' }) + } + + if (scope) { + npm.config.delete(regRef, 'user') + } + + npm.config.clearCredentialsByURI(reg) + + await npm.config.save('user') } + +module.exports = Object.assign(cmd, { completion, usage }) diff --git a/deps/npm/lib/ls.js b/deps/npm/lib/ls.js index c333f236bad31d..d55cdfb455cba0 100644 --- a/deps/npm/lib/ls.js +++ b/deps/npm/lib/ls.js @@ -1,554 +1,510 @@ -// show the installed versions of packages -// -// --parseable creates output like this: -// ::: -// Flags are a :-separated list of zero or more indicators - -module.exports = exports = ls - -var path = require('path') -var url = require('url') -var readPackageTree = require('read-package-tree') -var archy = require('archy') -var semver = require('semver') -var color = require('ansicolors') -var moduleName = require('./utils/module-name.js') -var npa = require('npm-package-arg') -var sortedObject = require('sorted-object') -var npm = require('./npm.js') -var mutateIntoLogicalTree = require('./install/mutate-into-logical-tree.js') -var computeMetadata = require('./install/deps.js').computeMetadata -var readShrinkwrap = require('./install/read-shrinkwrap.js') -var packageId = require('./utils/package-id.js') -var usage = require('./utils/usage') -var output = require('./utils/output.js') - -ls.usage = usage( +'use strict' + +const { resolve } = require('path') +const { EOL } = require('os') + +const archy = require('archy') +const chalk = require('chalk') +const Arborist = require('@npmcli/arborist') +const { breadth } = require('treeverse') +const npa = require('npm-package-arg') + +const npm = require('./npm.js') +const usageUtil = require('./utils/usage.js') +const completion = require('./utils/completion/installed-deep.js') +const output = require('./utils/output.js') + +const _depth = Symbol('depth') +const _dedupe = Symbol('dedupe') +const _filteredBy = Symbol('filteredBy') +const _include = Symbol('include') +const _invalid = Symbol('invalid') +const _name = Symbol('name') +const _missing = Symbol('missing') +const _parent = Symbol('parent') +const _problems = Symbol('problems') +const _required = Symbol('required') +const _type = Symbol('type') + +const usage = usageUtil( 'ls', 'npm ls [[<@scope>/] ...]' ) -ls.completion = require('./utils/completion/installed-deep.js') +const cmd = (args, cb) => ls(args).then(() => cb()).catch(cb) -function ls (args, silent, cb) { - if (typeof cb !== 'function') { - cb = silent - silent = false - } - var dir = path.resolve(npm.dir, '..') - readPackageTree(dir, function (_, physicalTree) { - if (!physicalTree) physicalTree = {package: {}, path: dir} - physicalTree.isTop = true - readShrinkwrap.andInflate(physicalTree, function () { - lsFromTree(dir, computeMetadata(physicalTree), args, silent, cb) - }) - }) -} +const initTree = async ({ arb, args, json }) => { + const tree = await arb.loadActual() + tree[_include] = args.length === 0 + tree[_depth] = 0 -function inList (list, value) { - return list.indexOf(value) !== -1 + return tree } -var lsFromTree = ls.fromTree = function (dir, physicalTree, args, silent, cb) { - if (typeof cb !== 'function') { - cb = silent - silent = false - } +const isGitNode = (node) => { + if (!node.resolved) return - // npm ls 'foo@~1.3' bar 'baz@<2' - if (!args) { - args = [] - } else { - args = args.map(function (a) { - if (typeof a === 'object' && a.package._requested.type === 'alias') { - return [moduleName(a), `npm:${a.package.name}@${a.package.version}`, a] - } else if (typeof a === 'object') { - return [a.package.name, a.package.version, a] - } else { - var p = npa(a) - var name = p.name - // When version spec is missing, we'll skip using it when filtering. - // Otherwise, `semver.validRange` would return '*', which won't - // match prerelease versions. - var ver = (p.rawSpec && - (semver.validRange(p.rawSpec) || '')) - return [ name, ver, a ] - } - }) + try { + const { type } = npa(node.resolved) + return type === 'git' || type === 'hosted' + } catch (err) { + return false } +} - var data = mutateIntoLogicalTree.asReadInstalled(physicalTree) - - pruneNestedExtraneous(data) - filterByEnv(data) - filterByLink(data) +const isOptional = (node) => + node[_type] === 'optional' || node[_type] === 'peerOptional' - var unlooped = filterFound(unloop(data), args) - var lite = getLite(unlooped) +const isExtraneous = (node, { global }) => + node.extraneous && !global - if (silent) return cb(null, data, lite) +const getProblems = (node, { global }) => { + const problems = new Set() - var long = npm.config.get('long') - var json = npm.config.get('json') - var out - if (json) { - var seen = new Set() - var d = long ? unlooped : lite - // the raw data can be circular - out = JSON.stringify(d, function (k, o) { - if (typeof o === 'object') { - if (seen.has(o)) return '[Circular]' - seen.add(o) - } - return o - }, 2) - } else if (npm.config.get('parseable')) { - out = makeParseable(unlooped, long, dir) - } else if (data) { - out = makeArchy(unlooped, long, dir) + if (node[_missing] && !isOptional(node)) { + problems.add(`missing: ${node.pkgid}, required by ${node[_missing]}`) } - output(out) - if (args.length && !data._found) process.exitCode = 1 + if (node[_invalid]) { + problems.add(`invalid: ${node.pkgid} ${node.path}`) + } - var er - // if any errors were found, then complain and exit status 1 - if (lite.problems && lite.problems.length) { - er = lite.problems.join('\n') + if (isExtraneous(node, { global })) { + problems.add(`extraneous: ${node.pkgid} ${node.path}`) } - cb(er, data, lite) + + return problems } -function pruneNestedExtraneous (data, visited) { - visited = visited || [] - visited.push(data) - for (var i in data.dependencies) { - if (data.dependencies[i].extraneous) { - data.dependencies[i].dependencies = {} - } else if (visited.indexOf(data.dependencies[i]) === -1) { - pruneNestedExtraneous(data.dependencies[i], visited) +// annotates _parent and _include metadata into the resulting +// item obj allowing for filtering out results during output +const augmentItemWithIncludeMetadata = (node, item) => { + item[_parent] = node[_parent] + item[_include] = node[_include] + + // append current item to its parent.nodes which is the + // structure expected by archy in order to print tree + if (node[_include]) { + // includes all ancestors of included node + let p = node[_parent] + while (p) { + p[_include] = true + p = p[_parent] } } + + return item } -function filterByEnv (data) { - var dev = npm.config.get('dev') || /^dev(elopment)?$/.test(npm.config.get('only')) - var production = npm.config.get('production') || /^prod(uction)?$/.test(npm.config.get('only')) - var dependencies = {} - var devKeys = Object.keys(data.devDependencies || []) - var prodKeys = Object.keys(data._dependencies || []) - Object.keys(data.dependencies).forEach(function (name) { - if (!dev && inList(devKeys, name) && !inList(prodKeys, name) && data.dependencies[name].missing) { - return - } +const getHumanOutputItem = (node, { args, color, global, long }) => { + const { pkgid, path } = node + let printable = pkgid - if ((dev && inList(devKeys, name)) || // only --dev - (production && inList(prodKeys, name)) || // only --production - (!dev && !production)) { // no --production|--dev|--only=xxx - dependencies[name] = data.dependencies[name] + // special formatting for top-level package name + if (node.isRoot) { + const hasNoPackageJson = !Object.keys(node.package).length + if (hasNoPackageJson) { + printable = path + } else { + printable += `${long ? EOL : ' '}${path}` } - }) - data.dependencies = dependencies -} - -function filterByLink (data) { - if (npm.config.get('link')) { - var dependencies = {} - Object.keys(data.dependencies).forEach(function (name) { - var dependency = data.dependencies[name] - if (dependency.link) { - dependencies[name] = dependency - } - }) - data.dependencies = dependencies } -} -function alphasort (a, b) { - a = a.toLowerCase() - b = b.toLowerCase() - return a > b ? 1 - : a < b ? -1 : 0 -} + const highlightDepName = + color && args.length && node[_filteredBy] + const missingColor = isOptional(node) + ? chalk.yellow.bgBlack + : chalk.red.bgBlack + const missingMsg = `UNMET ${isOptional(node) ? 'OPTIONAL ' : ''}DEPENDENCY` + const label = + ( + node[_missing] + ? (color ? missingColor(missingMsg) : missingMsg) + ' ' + : '' + ) + + `${highlightDepName ? chalk.yellow.bgBlack(printable) : printable}` + + ( + node[_dedupe] + ? ' ' + (color ? chalk.gray('deduped') : 'deduped') + : '' + ) + + ( + node[_invalid] + ? ' ' + (color ? chalk.red.bgBlack('invalid') : 'invalid') + : '' + ) + + ( + isExtraneous(node, { global }) + ? ' ' + (color ? chalk.green.bgBlack('extraneous') : 'extraneous') + : '' + ) + + (isGitNode(node) ? ` (${node.resolved})` : '') + + (node.isLink ? ` -> ${node.realpath}` : '') + + (long ? `${EOL}${node.package.description || ''}` : '') -function isCruft (data) { - return data.extraneous && data.error && data.error.code === 'ENOTDIR' + return augmentItemWithIncludeMetadata(node, { label, nodes: [] }) } -function getLite (data, noname, depth) { - var lite = {} - - if (isCruft(data)) return lite - - var maxDepth = npm.config.get('depth') +const getJsonOutputItem = (node, { global, long }) => { + const item = {} - if (typeof depth === 'undefined') depth = 0 - if (!noname && data.name) lite.name = data.name - if (data.version) lite.version = data.version - if (data.extraneous) { - lite.extraneous = true - lite.problems = lite.problems || [] - lite.problems.push('extraneous: ' + packageId(data) + ' ' + (data.path || '')) + if (node.version) { + item.version = node.version } - - if (data.error && data.path !== path.resolve(npm.globalDir, '..') && - (data.error.code !== 'ENOENT' || noname)) { - lite.invalid = true - lite.problems = lite.problems || [] - var message = data.error.message - lite.problems.push('error in ' + data.path + ': ' + message) + if (node.resolved) { + item.resolved = node.resolved } - if (data._from) { - lite.from = data._from - } + item[_name] = node.name - if (data._resolved) { - lite.resolved = data._resolved + // special formatting for top-level package name + const hasPackageJson = + node && node.package && Object.keys(node.package).length + if (node.isRoot && hasPackageJson) { + item.name = node.package.name || node.name } - if (data.invalid) { - lite.invalid = true - lite.problems = lite.problems || [] - lite.problems.push('invalid: ' + - packageId(data) + - ' ' + (data.path || '')) + if (long) { + item.name = item[_name] + const { dependencies, ...packageInfo } = node.package + Object.assign(item, packageInfo) + item.extraneous = false + item.path = node.path + item._dependencies = node.package.dependencies || {} + item.devDependencies = node.package.devDependencies || {} + item.peerDependencies = node.package.peerDependencies || {} } - if (data.peerInvalid) { - lite.peerInvalid = true - lite.problems = lite.problems || [] - lite.problems.push('peer dep not met: ' + - packageId(data) + - ' ' + (data.path || '')) + // augment json output items with extra metadata + if (isExtraneous(node, { global })) { + item.extraneous = true } - - var deps = (data.dependencies && Object.keys(data.dependencies)) || [] - if (deps.length) { - lite.dependencies = deps.map(function (d) { - var dep = data.dependencies[d] - if (dep.missing && !dep.optional) { - lite.problems = lite.problems || [] - var p - if (data.depth > maxDepth) { - p = 'max depth reached: ' - } else { - p = 'missing: ' - } - p += d + '@' + dep.requiredBy + - ', required by ' + - packageId(data) - lite.problems.push(p) - if (dep.dependencies) { - return [d, getLite(dep, true)] - } else { - return [d, { required: dep.requiredBy, missing: true }] - } - } else if (dep.peerMissing) { - lite.problems = lite.problems || [] - dep.peerMissing.forEach(function (missing) { - var pdm = 'peer dep missing: ' + - missing.requires + - ', required by ' + - missing.requiredBy - lite.problems.push(pdm) - }) - return [d, { required: dep, peerMissing: true }] - } else if (npm.config.get('json')) { - if (depth === maxDepth) delete dep.dependencies - return [d, getLite(dep, true, depth + 1)] - } - return [d, getLite(dep, true)] - }).reduce(function (deps, d) { - if (d[1].problems) { - lite.problems = lite.problems || [] - lite.problems.push.apply(lite.problems, d[1].problems) - } - deps[d[0]] = d[1] - return deps - }, {}) + if (node[_invalid]) { + item.invalid = true } - return lite -} - -function unloop (root) { - var queue = [root] - var seen = new Set() - seen.add(root) - - while (queue.length) { - var current = queue.shift() - var deps = current.dependencies = current.dependencies || {} - Object.keys(deps).forEach(function (d) { - var dep = deps[d] - if (dep.missing && !dep.dependencies) return - if (dep.path && seen.has(dep)) { - dep = deps[d] = Object.assign({}, dep) - dep.dependencies = {} - dep._deduped = path.relative(root.path, dep.path).replace(/node_modules\//g, '') - return - } - seen.add(dep) - queue.push(dep) - }) + if (node[_missing] && !isOptional(node)) { + item.required = node[_required] + item.missing = true + } + if (node[_include] && node[_problems] && node[_problems].size) { + item.problems = [...node[_problems]] } - return root + return augmentItemWithIncludeMetadata(node, item) } -function filterFound (root, args) { - if (!args.length) return root - if (!root.dependencies) return root - - // Mark all deps - var toMark = [root] - while (toMark.length) { - var markPkg = toMark.shift() - var markDeps = markPkg.dependencies - if (!markDeps) continue - Object.keys(markDeps).forEach(function (depName) { - var dep = markDeps[depName] - if (dep.peerMissing && !dep._from) return - dep._parent = markPkg - for (var ii = 0; ii < args.length; ii++) { - var argName = args[ii][0] - var argVersion = args[ii][1] - var argRaw = args[ii][2] - var found - if (typeof argRaw === 'object') { - if (dep.path === argRaw.path) { - found = true - } - } else if (depName === argName && argVersion) { - found = semver.satisfies(dep.version, argVersion, true) - } else if (depName === argName) { - // If version is missing from arg, just do a name match. - found = true - } - if (found) { - dep._found = 'explicit' - var parent = dep._parent - while (parent && !parent._found && !parent._deduped) { - parent._found = 'implicit' - parent = parent._parent - } - break - } - } - toMark.push(dep) - }) - } - var toTrim = [root] - while (toTrim.length) { - var trimPkg = toTrim.shift() - var trimDeps = trimPkg.dependencies - if (!trimDeps) continue - trimPkg.dependencies = {} - Object.keys(trimDeps).forEach(function (name) { - var dep = trimDeps[name] - if (!dep._found) return - if (dep._found === 'implicit' && dep._deduped) return - trimPkg.dependencies[name] = dep - toTrim.push(dep) - }) - } - return root +const filterByEdgesTypes = ({ + dev, + development, + link, + node, + prod, + production, + only, + tree +}) => { + // filter deps by type, allows for: `npm ls --dev`, `npm ls --prod`, + // `npm ls --link`, `npm ls --only=dev`, etc + const filterDev = node === tree && + (dev || development || /^dev(elopment)?$/.test(only)) + const filterProd = node === tree && + (prod || production || /^prod(uction)?$/.test(only)) + const filterLink = node === tree && link + + return (edge) => + (filterDev ? edge.dev : true) && + (filterProd ? (!edge.dev && !edge.peer && !edge.peerOptional) : true) && + (filterLink ? (edge.to && edge.to.isLink) : true) } -function makeArchy (data, long, dir) { - var out = makeArchy_(data, long, dir, 0) - return archy(out, '', { unicode: npm.config.get('unicode') }) -} +const appendExtraneousChildren = ({ node, seenPaths }) => + // extraneous children are not represented + // in edges out, so here we add them to the list: + [...node.children.values()] + .filter(i => !seenPaths.has(i.path) && i.extraneous) -function makeArchy_ (data, long, dir, depth, parent, d) { - if (data.missing) { - if (depth - 1 <= npm.config.get('depth')) { - // just missing - var unmet = 'UNMET ' + (data.optional ? 'OPTIONAL ' : '') + 'DEPENDENCY' - if (npm.color) { - if (data.optional) { - unmet = color.bgBlack(color.yellow(unmet)) - } else { - unmet = color.bgBlack(color.red(unmet)) - } - } - var label = data._id || (d + '@' + data.requiredBy) - if (data._found === 'explicit' && data._id) { - if (npm.color) { - label = color.bgBlack(color.yellow(label.trim())) + ' ' - } else { - label = label.trim() + ' ' - } - } - return { - label: unmet + ' ' + label, - nodes: Object.keys(data.dependencies || {}) - .sort(alphasort).filter(function (d) { - return !isCruft(data.dependencies[d]) - }).map(function (d) { - return makeArchy_(sortedObject(data.dependencies[d]), long, dir, depth + 1, data, d) - }) - } - } else { - return {label: d + '@' + data.requiredBy} - } - } +const mapEdgesToNodes = ({ seenPaths }) => (edge) => { + let node = edge.to - var out = {} - if (data._requested && data._requested.type === 'alias') { - out.label = `${d}@npm:${data._id}` - } else { - out.label = data._id || '' - } - if (data._found === 'explicit' && data._id) { - if (npm.color) { - out.label = color.bgBlack(color.yellow(out.label.trim())) + ' ' - } else { - out.label = out.label.trim() + ' ' - } + // if the edge is linking to a missing node, we go ahead + // and create a new obj that will represent the missing node + if (edge.missing || (edge.optional && !node)) { + const { name, spec } = edge + const pkgid = `${name}@${spec}` + node = { name, pkgid, [_missing]: edge.from.pkgid } } - if (data.link) out.label += ' -> ' + data.link - if (data._deduped) { - if (npm.color) { - out.label += ' ' + color.brightBlack('deduped') - } else { - out.label += ' deduped' - } + // keeps track of a set of seen paths to avoid the edge case in which a tree + // item would appear twice given that it's a children of an extraneous item, + // so it's marked extraneous but it will ALSO show up in edgesOuts of + // its parent so it ends up as two diff nodes if we don't track it + if (node.path) { + seenPaths.add(node.path) } - if (data.invalid) { - if (data.realName !== data.name) out.label += ' (' + data.realName + ')' - var invalid = 'invalid' - if (npm.color) invalid = color.bgBlack(color.red(invalid)) - out.label += ' ' + invalid - } + node[_required] = edge.spec + node[_type] = edge.type + node[_invalid] = edge.invalid - if (data.peerInvalid) { - var peerInvalid = 'peer invalid' - if (npm.color) peerInvalid = color.bgBlack(color.red(peerInvalid)) - out.label += ' ' + peerInvalid - } + return node +} - if (data.peerMissing) { - var peerMissing = 'UNMET PEER DEPENDENCY' +const filterByPositionalArgs = (args, { node }) => + args.length > 0 ? args.some( + (spec) => (node.satisfies && node.satisfies(spec)) + ) : true + +const augmentNodesWithMetadata = ({ + args, + currentDepth, + nodeResult, + parseable, + seenNodes +}) => (node) => { + // if the original edge was a deduped dep, treeverse will fail to + // revisit that node in tree traversal logic, so we make it so that + // we have a diff obj for deduped nodes: + if (seenNodes.has(node.path)) { + node = { + name: node.name, + version: node.version, + pkgid: node.pkgid, + package: node.package, + path: node.path, + isLink: node.isLink, + realpath: node.realpath, + [_invalid]: node[_invalid], + [_missing]: node[_missing], + [_dedupe]: true + } + } else { + // keeps track of already seen nodes in order to check for dedupes + seenNodes.set(node.path, node) + } + + // _parent is going to be a ref to a treeverse-visited node (returned from + // getHumanOutputItem, getJsonOutputItem, etc) so that we have an easy + // shortcut to place new nodes in their right place during tree traversal + node[_parent] = nodeResult + // _include is the property that allow us to filter based on position args + // e.g: `npm ls foo`, `npm ls simple-output@2` + // _filteredBy is used to apply extra color info to the item that + // was used in args in order to filter + node[_filteredBy] = node[_include] = + filterByPositionalArgs(args, { node: seenNodes.get(node.path), seenNodes }) + // _depth keeps track of how many levels deep tree traversal currently is + // so that we can `npm ls --depth=1` + node[_depth] = currentDepth + 1 + + return node +} - if (npm.color) peerMissing = color.bgBlack(color.red(peerMissing)) - out.label = peerMissing + ' ' + out.label +const sortAlphabetically = (a, b) => + a.pkgid.localeCompare(b.pkgid) + +const humanOutput = ({ color, result, seenItems, unicode }) => { + // we need to traverse the entire tree in order to determine which items + // should be included (since a nested transitive included dep will make it + // so that all its ancestors should be displayed) + // here is where we put items in their expected place for archy output + for (const item of seenItems) { + if (item[_include] && item[_parent]) { + item[_parent].nodes.push(item) + } } - if (data.extraneous && data.path !== dir) { - var extraneous = 'extraneous' - if (npm.color) extraneous = color.bgBlack(color.green(extraneous)) - out.label += ' ' + extraneous + if (!result.nodes.length) { + result.nodes = ['(empty)'] } - if (data.error && depth) { - var message = data.error.message - if (message.indexOf('\n')) message = message.slice(0, message.indexOf('\n')) - var error = 'error: ' + message - if (npm.color) error = color.bgRed(color.brightWhite(error)) - out.label += ' ' + error - } + const archyOutput = archy(result, '', { unicode }) + return color ? chalk.reset(archyOutput) : archyOutput +} - // add giturl to name@version - if (data._resolved) { - try { - var type = npa(data._resolved).type - var isGit = type === 'git' || type === 'hosted' - if (isGit) { - out.label += ' (' + data._resolved + ')' +const jsonOutput = ({ path, problems, result, rootError, seenItems }) => { + if (problems.size) { + result.problems = [...problems] + } + + if (rootError) { + result.problems = [ + ...(result.problems || []), + ...[`error in ${path}: Failed to parse root package.json`] + ] + result.invalid = true + } + + // we need to traverse the entire tree in order to determine which items + // should be included (since a nested transitive included dep will make it + // so that all its ancestors should be displayed) + // here is where we put items in their expected place for json output + for (const item of seenItems) { + // append current item to its parent item.dependencies obj in order + // to provide a json object structure that represents the installed tree + if (item[_include] && item[_parent]) { + if (!item[_parent].dependencies) { + item[_parent].dependencies = {} } - } catch (ex) { - // npa threw an exception then it ain't git so whatev - } - } - if (long) { - if (dir === data.path) out.label += '\n' + dir - out.label += '\n' + getExtras(data) - } else if (dir === data.path) { - if (out.label) out.label += ' ' - out.label += dir - } - - // now all the children. - out.nodes = [] - if (depth <= npm.config.get('depth')) { - out.nodes = Object.keys(data.dependencies || {}) - .sort(alphasort).filter(function (d) { - return !isCruft(data.dependencies[d]) - }).map(function (d) { - return makeArchy_(sortedObject(data.dependencies[d]), long, dir, depth + 1, data, d) - }) - } - - if (out.nodes.length === 0 && data.path === dir) { - out.nodes = ['(empty)'] + item[_parent].dependencies[item[_name]] = item + } } - return out + return JSON.stringify(result, null, 2) } -function getExtras (data) { - var extras = [] - - if (data.description) extras.push(data.description) - if (data.repository) extras.push(data.repository.url) - if (data.homepage) extras.push(data.homepage) - if (data._from) { - var from = data._from - if (from.indexOf(data.name + '@') === 0) { - from = from.substr(data.name.length + 1) +const parseableOutput = ({ global, long, seenNodes }) => { + let out = '' + for (const node of seenNodes.values()) { + if (node.path && node[_include]) { + out += node.path + if (long) { + out += `:${node.pkgid}` + out += node.path !== node.realpath ? `:${node.realpath}` : '' + out += isExtraneous(node, { global }) ? ':EXTRANEOUS' : '' + out += node[_invalid] ? ':INVALID' : '' + } + out += EOL } - var u = url.parse(from) - if (u.protocol) extras.push(from) } - return extras.join('\n') + return out.trim() } -function makeParseable (data, long, dir, depth, parent, d) { - if (data._deduped) return [] - depth = depth || 0 - if (depth > npm.config.get('depth')) return [ makeParseable_(data, long, dir, depth, parent, d) ] - return [ makeParseable_(data, long, dir, depth, parent, d) ] - .concat(Object.keys(data.dependencies || {}) - .sort(alphasort).map(function (d) { - return makeParseable(data.dependencies[d], long, dir, depth + 1, data, d) - })) - .filter(function (x) { return x && x.length }) - .join('\n') -} +const ls = async (args) => { + const { + all, + color, + depth, + json, + long, + global, + parseable, + prefix, + unicode + } = npm.flatOptions + const path = global ? resolve(npm.globalDir, '..') : prefix + const dev = npm.config.get('dev') + const development = npm.config.get('development') + const link = npm.config.get('link') + const only = npm.config.get('only') + const prod = npm.config.get('prod') + const production = npm.config.get('production') + + const arb = new Arborist({ + global, + ...npm.flatOptions, + legacyPeerDeps: false, + path + }) + const tree = await initTree({ + arb, + args, + global, + json + }) -function makeParseable_ (data, long, dir, depth, parent, d) { - if (data.hasOwnProperty('_found') && data._found !== 'explicit') return '' + const seenItems = new Set() + const seenNodes = new Map() + const problems = new Set() + + // defines special handling of printed depth when filtering with args + const filterDefaultDepth = depth === null ? Infinity : depth + const depthToPrint = (all || args.length) + ? filterDefaultDepth + : (depth || 0) + + // add root node of tree to list of seenNodes + seenNodes.set(tree.path, tree) + + // tree traversal happens here, using treeverse.breadth + const result = await breadth({ + tree, + // recursive method, `node` is going to be the current elem (starting from + // the `tree` obj) that was just visited in the `visit` method below + // `nodeResult` is going to be the returned `item` from `visit` + getChildren (node, nodeResult) { + const seenPaths = new Set() + const shouldSkipChildren = + !(node instanceof Arborist.Node) || (node[_depth] > depthToPrint) + return (shouldSkipChildren) + ? [] + : [...(node.target || node).edgesOut.values()] + .filter(filterByEdgesTypes({ + dev, + development, + link, + node, + prod, + production, + only, + tree + })) + .map(mapEdgesToNodes({ seenPaths })) + .concat(appendExtraneousChildren({ node, seenPaths })) + .sort(sortAlphabetically) + .map(augmentNodesWithMetadata({ + args, + currentDepth: node[_depth], + nodeResult, + parseable, + seenNodes + })) + }, + // visit each `node` of the `tree`, returning an `item` - these are + // the elements that will be used to build the final output + visit (node) { + node[_problems] = getProblems(node, { global }) + + const item = json + ? getJsonOutputItem(node, { global, long }) + : parseable + ? null + : getHumanOutputItem(node, { args, color, global, long }) + + // loop through list of node problems to add them to global list + if (node[_include]) { + for (const problem of node[_problems]) { + problems.add(problem) + } + } - if (data.missing) { - if (depth < npm.config.get('depth')) { - data = npm.config.get('long') - ? path.resolve(parent.path, 'node_modules', d) + - ':' + d + '@' + JSON.stringify(data.requiredBy) + ':INVALID:MISSING' - : '' - } else { - data = path.resolve(dir || '', 'node_modules', d || '') + - (npm.config.get('long') - ? ':' + d + '@' + JSON.stringify(data.requiredBy) + - ':' + // no realpath resolved - ':MAXDEPTH' - : '') + seenItems.add(item) + + // return a promise so we don't blow the stack + return Promise.resolve(item) } + }) - return data + // handle the special case of a broken package.json in the root folder + const [rootError] = tree.errors.filter(e => + e.code === 'EJSONPARSE' && e.path === resolve(path, 'package.json')) + + output( + json + ? jsonOutput({ path, problems, result, rootError, seenItems }) + : parseable + ? parseableOutput({ seenNodes, global, long }) + : humanOutput({ color, result, seenItems, unicode }) + ) + + // if filtering items, should exit with error code on no results + if (!tree[_include] && args.length) { + process.exitCode = 1 } - if (!npm.config.get('long')) return data.path + if (rootError) { + throw Object.assign( + new Error('Failed to parse root package.json'), + { code: 'EJSONPARSE' } + ) + } - return data.path + - ':' + (data._id || '') + - (data.link && data.link !== data.path ? ':' + data.link : '') + - (data.extraneous ? ':EXTRANEOUS' : '') + - (data.error && data.path !== path.resolve(npm.globalDir, '..') ? ':ERROR' : '') + - (data.invalid ? ':INVALID' : '') + - (data.peerInvalid ? ':PEERINVALID' : '') + - (data.peerMissing ? ':PEERINVALID:MISSING' : '') + if (problems.size) { + throw Object.assign( + new Error([...problems].join(EOL)), + { code: 'ELSPROBLEMS' } + ) + } } + +module.exports = Object.assign(cmd, { usage, completion }) diff --git a/deps/npm/lib/npm.js b/deps/npm/lib/npm.js index 74ef6ad2c6e748..79d2767229806a 100644 --- a/deps/npm/lib/npm.js +++ b/deps/npm/lib/npm.js @@ -1,502 +1,290 @@ -;(function () { - // windows: running 'npm blah' in this folder will invoke WSH, not node. - /* globals WScript */ - if (typeof WScript !== 'undefined') { - WScript.echo( - 'npm does not work when run\n' + - 'with the Windows Scripting Host\n\n' + - '"cd" to a different directory,\n' + - 'or type "npm.cmd ",\n' + - 'or type "node npm ".' - ) - WScript.quit(1) - return - } +// The order of the code in this file is relevant, because a lot of things +// require('npm.js'), but also we need to use some of those modules. So, +// we define and instantiate the singleton ahead of loading any modules +// required for its methods. + +// these are all dependencies used in the ctor +const EventEmitter = require('events') +const { resolve, dirname } = require('path') +const Config = require('@npmcli/config') + +// Patch the global fs module here at the app level +require('graceful-fs').gracefulify(require('fs')) + +const procLogListener = require('./utils/proc-log-listener.js') + +const hasOwnProperty = (obj, key) => Object.prototype.hasOwnProperty.call(obj, key) + +// the first time `npm.commands.xyz` is loaded, it gets added +// to the cmds object, so we don't have to load it again. +const proxyCmds = (npm) => { + const cmds = {} + return new Proxy(cmds, { + get: (prop, cmd) => { + if (hasOwnProperty(cmds, cmd)) { + return cmds[cmd] + } - var unsupported = require('../lib/utils/unsupported.js') - unsupported.checkForBrokenNode() - - var gfs = require('graceful-fs') - // Patch the global fs module here at the app level - var fs = gfs.gracefulify(require('fs')) - - var EventEmitter = require('events').EventEmitter - var npm = module.exports = new EventEmitter() - var npmconf = require('./config/core.js') - var log = require('npmlog') - var inspect = require('util').inspect - - // capture global logging - process.on('log', function (level) { - try { - return log[level].apply(log, [].slice.call(arguments, 1)) - } catch (ex) { - log.verbose('attempt to log ' + inspect(arguments) + ' crashed: ' + ex.message) + const actual = deref(cmd) + if (!actual) { + cmds[cmd] = undefined + return cmds[cmd] + } + if (cmds[actual]) { + cmds[cmd] = cmds[actual] + return cmds[cmd] + } + cmds[actual] = makeCmd(actual) + cmds[cmd] = cmds[actual] + return cmds[cmd] } }) - - var path = require('path') - var abbrev = require('abbrev') - var which = require('which') - var glob = require('glob') - var rimraf = require('rimraf') - var parseJSON = require('./utils/parse-json.js') - var aliases = require('./config/cmd-list').aliases - var cmdList = require('./config/cmd-list').cmdList - var plumbing = require('./config/cmd-list').plumbing - var output = require('./utils/output.js') - var startMetrics = require('./utils/metrics.js').start - var perf = require('./utils/perf.js') - - perf.emit('time', 'npm') - perf.on('timing', function (name, finished) { - log.timing(name, 'Completed in', finished + 'ms') - }) - - npm.config = { - loaded: false, - get: function () { - throw new Error('npm.load() required') - }, - set: function () { - throw new Error('npm.load() required') +} + +const makeCmd = cmd => { + const impl = require(`./${cmd}.js`) + const fn = (args, cb) => npm[_runCmd](cmd, impl, args, cb) + Object.assign(fn, impl) + return fn +} + +const { types, defaults, shorthands } = require('./utils/config.js') + +let warnedNonDashArg = false +const _runCmd = Symbol('_runCmd') +const _load = Symbol('_load') +const _flatOptions = Symbol('_flatOptions') +const _tmpFolder = Symbol('_tmpFolder') +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(this) + procLogListener() + process.emit('time', 'npm') + this.version = require('../package.json').version + this.config = new Config({ + npmPath: dirname(__dirname), + types, + defaults, + shorthands + }) + this.updateNotification = null } - npm.commands = {} - - // TUNING - npm.limit = { - fetch: 10, - action: 50 - } - // *** - - npm.lockfileVersion = 1 - - npm.rollbacks = [] - - try { - // startup, ok to do this synchronously - var j = parseJSON(fs.readFileSync( - path.join(__dirname, '../package.json')) + '') - npm.name = j.name - npm.version = j.version - } catch (ex) { - try { - log.info('error reading version', ex) - } catch (er) {} - npm.version = ex + deref (c) { + return deref(c) } - var commandCache = {} - var aliasNames = Object.keys(aliases) - - var littleGuys = [ 'isntall', 'verison' ] - var fullList = cmdList.concat(aliasNames).filter(function (c) { - return plumbing.indexOf(c) === -1 - }) - var abbrevs = abbrev(fullList) - - // we have our reasons - fullList = npm.fullList = fullList.filter(function (c) { - return littleGuys.indexOf(c) === -1 - }) - - var registryRefer - - Object.keys(abbrevs).concat(plumbing).forEach(function addCommand (c) { - Object.defineProperty(npm.commands, c, { get: function () { - if (!loaded) { - throw new Error( - 'Call npm.load(config, cb) before using this command.\n' + - 'See the README.md or bin/npm-cli.js for example usage.' - ) - } - var a = npm.deref(c) - if (c === 'la' || c === 'll') { - npm.config.set('long', true) - } - - npm.command = c - if (commandCache[a]) return commandCache[a] - - var cmd = require(path.join(__dirname, a + '.js')) + // this will only ever be called with cmd set to the canonical command name + [_runCmd] (cmd, impl, args, cb) { + if (!this.loaded) { + throw new Error( + 'Call npm.load(cb) before using this command.\n' + + 'See the README.md or bin/npm-cli.js for example usage.' + ) + } - commandCache[a] = function () { - var args = Array.prototype.slice.call(arguments, 0) - if (typeof args[args.length - 1] !== 'function') { - args.push(defaultCb) - } - if (args.length === 1) args.unshift([]) + process.emit('time', `command:${cmd}`) + this.command = cmd - // Options are prefixed by a hyphen-minus (-, \u2d). - // Other dash-type chars look similar but are invalid. - Array(args[0]).forEach(function (arg) { - if (/^[\u2010-\u2015\u2212\uFE58\uFE63\uFF0D]/.test(arg)) { - log.error('arg', 'Argument starts with non-ascii dash, this is probably invalid:', arg) - } + // Options are prefixed by a hyphen-minus (-, \u2d). + // Other dash-type chars look similar but are invalid. + if (!warnedNonDashArg) { + args.filter(arg => /^[\u2010-\u2015\u2212\uFE58\uFE63\uFF0D]/.test(arg)) + .forEach(arg => { + warnedNonDashArg = true + log.error('arg', 'Argument starts with non-ascii dash, this is probably invalid:', arg) }) + } - if (!registryRefer) { - registryRefer = [a].concat(args[0]).map(function (arg) { - // exclude anything that might be a URL, path, or private module - // Those things will always have a slash in them somewhere - if (arg && arg.match && arg.match(/\/|\\/)) { - return '[REDACTED]' - } else { - return arg - } - }).filter(function (arg) { - return arg && arg.match - }).join(' ') - npm.referer = registryRefer - } - - cmd.apply(npm, args) - } - - Object.keys(cmd).forEach(function (k) { - commandCache[a][k] = cmd[k] + if (this.config.get('usage')) { + console.log(impl.usage) + cb() + } else { + impl(args, er => { + process.emit('timeEnd', `command:${cmd}`) + cb(er) }) - - return commandCache[a] - }, - enumerable: fullList.indexOf(c) !== -1, - configurable: true }) - - // make css-case commands callable via camelCase as well - if (c.match(/-([a-z])/)) { - addCommand(c.replace(/-([a-z])/g, function (a, b) { - return b.toUpperCase() - })) } - }) - - function defaultCb (er, data) { - log.disableProgress() - if (er) console.error(er.stack || er.message) - else output(data) } - npm.deref = function (c) { - if (!c) return '' - if (c.match(/[A-Z]/)) { - c = c.replace(/([A-Z])/g, function (m) { - return '-' + m.toLowerCase() - }) + // call with parsed CLI options and a callback when done loading + // XXX promisify this and stop taking a callback + load (cb) { + if (!cb || typeof cb !== 'function') { + throw new TypeError('must call as: npm.load(callback)') } - if (plumbing.indexOf(c) !== -1) return c - var a = abbrevs[c] - while (aliases[a]) { - a = aliases[a] + this.once('load', cb) + if (this.loaded || this.loadErr) { + this.emit('load', this.loadErr) + return } - return a + if (this.loading) { + return + } + this.loading = true + + process.emit('time', 'npm:load') + this.log.pause() + return this[_load]().catch(er => er).then((er) => { + this.loading = false + this.loadErr = er + 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.env.npm_command = this.command + } + process.emit('timeEnd', 'npm:load') + this.emit('load', er) + }) } - var loaded = false - var loading = false - var loadErr = null - var loadListeners = [] - - function loadCb (er) { - loadListeners.forEach(function (cb) { - process.nextTick(cb.bind(npm, er, npm)) - }) - loadListeners.length = 0 + get loaded () { + return this.config.loaded } - npm.load = function (cli, cb_) { - if (!cb_ && typeof cli === 'function') { - cb_ = cli - cli = {} - } - if (!cb_) cb_ = function () {} - if (!cli) cli = {} - loadListeners.push(cb_) - if (loaded || loadErr) return cb(loadErr) - if (loading) return - loading = true - var onload = true - - function cb (er) { - if (loadErr) return - loadErr = er - if (er) return cb_(er) - if (npm.config.get('force')) { - log.warn('using --force', 'I sure hope you know what you are doing.') - } - npm.config.loaded = true - loaded = true - loadCb(loadErr = er) - onload = onload && npm.config.get('onload-script') - if (onload) { - try { - require(onload) - } catch (err) { - log.warn('onload-script', 'failed to require onload script', onload) - log.warn('onload-script', err) - } - onload = false - } + async [_load] () { + const node = await which(process.argv[0]).catch(er => null) + if (node && node.toUpperCase() !== process.execPath.toUpperCase()) { + log.verbose('node symlink', node) + process.execPath = node } + this.config.execPath = node - log.pause() + await this.config.load() + this.argv = this.config.parsedArgv.remain - load(npm, cli, cb) - } + setUserAgent(this.config) - function load (npm, cli, cb) { - which(process.argv[0], function (er, node) { - if (!er && node.toUpperCase() !== process.execPath.toUpperCase()) { - log.verbose('node symlink', node) - process.execPath = node - process.installPrefix = path.resolve(node, '..', '..') - } + this.color = setupLog(this.config, this) + process.env.COLOR = this.color ? '1' : '0' - // look up configs - var builtin = path.resolve(__dirname, '..', 'npmrc') - npmconf.load(cli, builtin, function (er, config) { - if (er === config) er = null - - npm.config = config - if (er) return cb(er) - - // if the 'project' config is not a filename, and we're - // not in global mode, then that means that it collided - // with either the default or effective userland config - if (!config.get('global') && - config.sources.project && - config.sources.project.type !== 'ini') { - log.verbose( - 'config', - 'Skipping project config: %s. (matches userconfig)', - config.localPrefix + '/.npmrc' - ) - } - - // Include npm-version and node-version in user-agent - var ua = config.get('user-agent') || '' - ua = ua.replace(/\{node-version\}/gi, process.version) - ua = ua.replace(/\{npm-version\}/gi, npm.version) - ua = ua.replace(/\{platform\}/gi, process.platform) - ua = ua.replace(/\{arch\}/gi, process.arch) - - // continuous integration platforms - const ciName = process.env.GERRIT_PROJECT ? 'gerrit' - : process.env.GITLAB_CI ? 'gitlab' - : process.env.APPVEYOR ? 'appveyor' - : process.env.CIRCLECI ? 'circle-ci' - : process.env.SEMAPHORE ? 'semaphore' - : process.env.DRONE ? 'drone' - : process.env.GITHUB_ACTION ? 'github-actions' - : process.env.TDDIUM ? 'tddium' - : process.env.JENKINS_URL ? 'jenkins' - : process.env['bamboo.buildKey'] ? 'bamboo' - : process.env.GO_PIPELINE_NAME ? 'gocd' - // codeship and a few others - : process.env.CI_NAME ? process.env.CI_NAME - // test travis after the others, since several CI systems mimic it - : process.env.TRAVIS ? 'travis-ci' - // aws CodeBuild/CodePipeline - : process.env.CODEBUILD_SRC_DIR ? 'aws-codebuild' - : process.env.CI === 'true' || process.env.CI === '1' ? 'custom' - // Google Cloud Build - it sets almost nothing - : process.env.BUILDER_OUTPUT ? 'builder' - : false - const ci = ciName ? `ci/${ciName}` : '' - ua = ua.replace(/\{ci\}/gi, ci) - - config.set('user-agent', ua.trim()) - - if (config.get('metrics-registry') == null) { - config.set('metrics-registry', config.get('registry')) - } - - var color = config.get('color') - - if (npm.config.get('timing') && npm.config.get('loglevel') === 'notice') { - log.level = 'timing' - } else { - log.level = config.get('loglevel') - } - log.heading = config.get('heading') || 'npm' - log.stream = config.get('logstream') - - switch (color) { - case 'always': - npm.color = true - break - case false: - npm.color = false - break - default: - npm.color = process.stdout.isTTY && process.env['TERM'] !== 'dumb' - break - } - if (npm.color) { - log.enableColor() - } else { - log.disableColor() - } - - if (config.get('unicode')) { - log.enableUnicode() - } else { - log.disableUnicode() - } - - if (config.get('progress') && process.stderr.isTTY && process.env['TERM'] !== 'dumb') { - log.enableProgress() - } else { - log.disableProgress() - } - - glob(path.resolve(npm.cache, '_logs', '*-debug.log'), function (er, files) { - if (er) return cb(er) - - while (files.length >= npm.config.get('logs-max')) { - rimraf.sync(files[0]) - files.splice(0, 1) - } - }) + cleanUpLogFiles(this.cache, this.config.get('logs-max'), log.warn) - log.resume() - - var umask = npm.config.get('umask') - npm.modes = { - exec: parseInt('0777', 8) & (~umask), - file: parseInt('0666', 8) & (~umask), - umask: umask - } + log.resume() + const umask = this.config.get('umask') + this.modes = { + exec: 0o777 & (~umask), + file: 0o666 & (~umask), + umask + } - var gp = Object.getOwnPropertyDescriptor(config, 'globalPrefix') - Object.defineProperty(npm, 'globalPrefix', gp) + const configScope = this.config.get('scope') + if (configScope && !/^@/.test(configScope)) { + this.config.set('scope', `@${configScope}`, this.config.find('scope')) + } + this.projectScope = this.config.get('scope') || + getProjectScope(this.prefix) - var lp = Object.getOwnPropertyDescriptor(config, 'localPrefix') - Object.defineProperty(npm, 'localPrefix', lp) + startMetrics() + } - config.set('scope', scopeifyScope(config.get('scope'))) - npm.projectScope = config.get('scope') || - scopeifyScope(getProjectScope(npm.prefix)) + get flatOptions () { + return this[_flatOptions] + } - startMetrics() + get lockfileVersion () { + return 2 + } - return cb(null, npm) - }) - }) + get log () { + return log } - Object.defineProperty(npm, 'prefix', - { - get: function () { - return npm.config.get('global') ? npm.globalPrefix : npm.localPrefix - }, - set: function (r) { - var k = npm.config.get('global') ? 'globalPrefix' : 'localPrefix' - npm[k] = r - return r - }, - enumerable: true - }) + get cache () { + return this.config.get('cache') + } - Object.defineProperty(npm, 'bin', - { - get: function () { - if (npm.config.get('global')) return npm.globalBin - return path.resolve(npm.root, '.bin') - }, - enumerable: true - }) + set cache (r) { + this.config.set('cache', r) + } - Object.defineProperty(npm, 'globalBin', - { - get: function () { - var b = npm.globalPrefix - if (process.platform !== 'win32') b = path.resolve(b, 'bin') - return b - } - }) + get globalPrefix () { + return this.config.globalPrefix + } - Object.defineProperty(npm, 'dir', - { - get: function () { - if (npm.config.get('global')) return npm.globalDir - return path.resolve(npm.prefix, 'node_modules') - }, - enumerable: true - }) + set globalPrefix (r) { + this.config.globalPrefix = r + } - Object.defineProperty(npm, 'globalDir', - { - get: function () { - return (process.platform !== 'win32') - ? path.resolve(npm.globalPrefix, 'lib', 'node_modules') - : path.resolve(npm.globalPrefix, 'node_modules') - }, - enumerable: true - }) + get localPrefix () { + return this.config.localPrefix + } - Object.defineProperty(npm, 'root', - { get: function () { return npm.dir } }) + set localPrefix (r) { + this.config.localPrefix = r + } - Object.defineProperty(npm, 'cache', - { get: function () { return npm.config.get('cache') }, - set: function (r) { return npm.config.set('cache', r) }, - enumerable: true - }) + get globalDir () { + return process.platform !== 'win32' + ? resolve(this.globalPrefix, 'lib', 'node_modules') + : resolve(this.globalPrefix, 'node_modules') + } - var tmpFolder - var rand = require('crypto').randomBytes(4).toString('hex') - Object.defineProperty(npm, 'tmp', - { - get: function () { - if (!tmpFolder) tmpFolder = 'npm-' + process.pid + '-' + rand - return path.resolve(npm.config.get('tmp'), tmpFolder) - }, - enumerable: true - }) + get localDir () { + return resolve(this.localPrefix, 'node_modules') + } - // the better to repl you with - Object.getOwnPropertyNames(npm.commands).forEach(function (n) { - if (npm.hasOwnProperty(n) || n === 'config') return + get dir () { + return (this.config.get('global')) ? this.globalDir : this.localDir + } - Object.defineProperty(npm, n, { get: function () { - return function () { - var args = Array.prototype.slice.call(arguments, 0) - var cb = defaultCb + get globalBin () { + const b = this.globalPrefix + return process.platform !== 'win32' ? resolve(b, 'bin') : b + } - if (args.length === 1 && Array.isArray(args[0])) { - args = args[0] - } + get localBin () { + return resolve(this.dir, '.bin') + } - if (typeof args[args.length - 1] === 'function') { - cb = args.pop() - } - npm.commands[n](args, cb) - } - }, - enumerable: false, - configurable: true }) - }) + get bin () { + return this.config.get('global') ? this.globalBin : this.localBin + } - if (require.main === module) { - require('../bin/npm-cli.js') + get prefix () { + return this.config.get('global') ? this.globalPrefix : this.localPrefix } - function scopeifyScope (scope) { - return (!scope || scope[0] === '@') ? scope : ('@' + scope) + set prefix (r) { + const k = this.config.get('global') ? 'globalPrefix' : 'localPrefix' + this[k] = r } - function getProjectScope (prefix) { - try { - var pkg = JSON.parse(fs.readFileSync(path.join(prefix, 'package.json'))) - if (typeof pkg.name !== 'string') return '' - var sep = pkg.name.indexOf('/') - if (sep === -1) return '' - return pkg.name.slice(0, sep) - } catch (ex) { - return '' + // XXX add logging to see if we actually use this + get tmp () { + if (!this[_tmpFolder]) { + const rand = require('crypto').randomBytes(4).toString('hex') + this[_tmpFolder] = `npm-${process.pid}-${rand}` } + return resolve(this.config.get('tmp'), this[_tmpFolder]) } -})() +}() + +// now load everything required by the class methods + +const log = require('npmlog') +const { promisify } = require('util') +const startMetrics = require('./utils/metrics.js').start + +const which = promisify(require('which')) + +const setUserAgent = require('./utils/set-user-agent.js') +const deref = require('./utils/deref-command.js') +const setupLog = require('./utils/setup-log.js') +const cleanUpLogFiles = require('./utils/cleanup-log-files.js') +const getProjectScope = require('./utils/get-project-scope.js') + +if (require.main === module) { + require('./cli.js')(process) +} diff --git a/deps/npm/lib/org.js b/deps/npm/lib/org.js index d8f857e3dfdd94..0d4463fcdf6d5a 100644 --- a/deps/npm/lib/org.js +++ b/deps/npm/lib/org.js @@ -1,8 +1,7 @@ 'use strict' -const figgyPudding = require('figgy-pudding') -const liborg = require('libnpm/org') -const npmConfig = require('./config/figgy-config.js') +const liborg = require('libnpmorg') +const npm = require('./npm.js') const output = require('./utils/output.js') const otplease = require('./utils/otplease.js') const Table = require('cli-table3') @@ -16,13 +15,6 @@ org.usage = 'npm org rm orgname username\n' + 'npm org ls orgname []' -const OrgConfig = figgyPudding({ - json: {}, - loglevel: {}, - parseable: {}, - silent: {} -}) - org.completion = function (opts, cb) { var argv = opts.conf.argv.remain if (argv.length === 2) { @@ -40,12 +32,11 @@ org.completion = function (opts, cb) { } function UsageError () { - throw Object.assign(new Error(org.usage), {code: 'EUSAGE'}) + throw Object.assign(new Error(org.usage), { code: 'EUSAGE' }) } function org ([cmd, orgname, username, role], cb) { - otplease(npmConfig(), opts => { - opts = OrgConfig(opts) + return otplease(npm.flatOptions, opts => { switch (cmd) { case 'add': case 'set': @@ -141,7 +132,7 @@ function orgList (org, user, opts) { output([user, roster[user]].join('\t')) }) } else if (!opts.silent && opts.loglevel !== 'silent') { - const table = new Table({head: ['user', 'role']}) + const table = new Table({ head: ['user', 'role'] }) Object.keys(roster).sort().forEach(user => { table.push([user, roster[user]]) }) diff --git a/deps/npm/lib/outdated.js b/deps/npm/lib/outdated.js index 5b84ae35587c80..c3b15e41180699 100644 --- a/deps/npm/lib/outdated.js +++ b/deps/npm/lib/outdated.js @@ -1,454 +1,278 @@ -/* - -npm outdated [pkg] - -Does the following: - -1. check for a new version of pkg - -If no packages are specified, then run for all installed -packages. - ---parseable creates output like this: -::: - -*/ - -module.exports = outdated - -outdated.usage = 'npm outdated [[<@scope>/] ...]' - -outdated.completion = require('./utils/completion/installed-deep.js') +'use strict' const os = require('os') -const url = require('url') const path = require('path') -const readPackageTree = require('read-package-tree') -const asyncMap = require('slide').asyncMap +const pacote = require('pacote') +const table = require('text-table') const color = require('ansicolors') const styles = require('ansistyles') -const table = require('text-table') -const semver = require('semver') -const npa = require('libnpm/parse-arg') +const npa = require('npm-package-arg') const pickManifest = require('npm-pick-manifest') -const fetchPackageMetadata = require('./fetch-package-metadata.js') -const mutateIntoLogicalTree = require('./install/mutate-into-logical-tree.js') + +const Arborist = require('@npmcli/arborist') + const npm = require('./npm.js') -const npmConfig = require('./config/figgy-config.js') -const figgyPudding = require('figgy-pudding') -const packument = require('libnpm/packument') -const long = npm.config.get('long') -const isExtraneous = require('./install/is-extraneous.js') -const computeMetadata = require('./install/deps.js').computeMetadata -const computeVersionSpec = require('./install/deps.js').computeVersionSpec -const moduleName = require('./utils/module-name.js') const output = require('./utils/output.js') -const ansiTrim = require('./utils/ansi-trim') - -const OutdatedConfig = figgyPudding({ - also: {}, - color: {}, - depth: {}, - dev: 'development', - development: {}, - global: {}, - json: {}, - only: {}, - parseable: {}, - prod: 'production', - production: {}, - save: {}, - 'save-dev': {}, - 'save-optional': {} -}) - -function uniq (list) { - // we maintain the array because we need an array, not iterator, return - // value. - var uniqed = [] - var seen = new Set() - list.forEach(function (item) { - if (seen.has(item)) return - seen.add(item) - uniqed.push(item) - }) - return uniqed +const usageUtil = require('./utils/usage.js') +const ansiTrim = require('./utils/ansi-trim.js') + +const usage = usageUtil('outdated', + 'npm outdated [[<@scope>/] ...]' +) +const completion = require('./utils/completion/none.js') + +function cmd (args, cb) { + outdated(args) + .then(() => cb()) + .catch(cb) } -function andComputeMetadata (next) { - return function (er, tree) { - if (er) return next(er) - next(null, computeMetadata(tree)) - } -} +async function outdated (args) { + const opts = npm.flatOptions + const global = path.resolve(npm.globalDir, '..') + const where = opts.global + ? global + : npm.prefix -function outdated (args, silent, cb) { - if (typeof cb !== 'function') { - cb = silent - silent = false - } - let opts = OutdatedConfig(npmConfig()) - var dir = path.resolve(npm.dir, '..') - - // default depth for `outdated` is 0 (cf. `ls`) - if (opts.depth === Infinity) opts = opts.concat({depth: 0}) - - readPackageTree(dir, andComputeMetadata(function (er, tree) { - if (!tree) return cb(er) - mutateIntoLogicalTree(tree) - outdated_(args, '', tree, {}, 0, opts, function (er, list) { - list = uniq(list || []).sort(function (aa, bb) { - return aa[0].path.localeCompare(bb[0].path) || - aa[1].localeCompare(bb[1]) - }) - if (er || silent || - (list.length === 0 && !opts.json)) { - return cb(er, list) - } - if (opts.json) { - output(makeJSON(list, opts)) - } else if (opts.parseable) { - output(makeParseable(list, opts)) - } else { - var outList = list.map(x => makePretty(x, opts)) - var outHead = [ 'Package', - 'Current', - 'Wanted', - 'Latest', - 'Location' - ] - if (long) outHead.push('Package Type', 'Homepage') - var outTable = [outHead].concat(outList) - - if (opts.color) { - outTable[0] = outTable[0].map(function (heading) { - return styles.underline(heading) - }) - } + const arb = new Arborist({ + ...opts, + path: where + }) - var tableOpts = { - align: ['l', 'r', 'r', 'r', 'l'], - stringLength: function (s) { return ansiTrim(s).length } - } - output(table(outTable, tableOpts)) - } - process.exitCode = list.length ? 1 : 0 - cb(null, list.map(function (item) { return [item[0].parent.path].concat(item.slice(1, 7)) })) - }) - })) -} + const tree = await arb.loadActual() + const list = await outdated_(tree, args, opts) -// [[ dir, dep, has, want, latest, type ]] -function makePretty (p, opts) { - var depname = p[1] - var has = p[2] - var want = p[3] - var latest = p[4] - var type = p[6] - var deppath = p[7] - var homepage = p[0].package.homepage || '' - - var columns = [ depname, - has || 'MISSING', - want, - latest, - deppath || 'global' - ] - if (long) { - columns[5] = type - columns[6] = homepage - } + // sorts list alphabetically + const outdated = list.sort((a, b) => a.name.localeCompare(b.name)) - if (opts.color) { - columns[0] = color[has === want ? 'yellow' : 'red'](columns[0]) // dep - columns[2] = color.green(columns[2]) // want - columns[3] = color.magenta(columns[3]) // latest + // return if no outdated packages + if (outdated.length === 0 && !opts.json) { + return } - return columns -} - -function makeParseable (list) { - return list.map(function (p) { - var dep = p[0] - var depname = p[1] - var dir = dep.path - var has = p[2] - var want = p[3] - var latest = p[4] - var type = p[6] - - var out = [ - dir, - depname + '@' + want, - (has ? (depname + '@' + has) : 'MISSING'), - depname + '@' + latest + // display results + if (opts.json) { + output(makeJSON(outdated, opts)) + } else if (opts.parseable) { + output(makeParseable(outdated, opts)) + } else { + const outList = outdated.map(x => makePretty(x, opts)) + const outHead = ['Package', + 'Current', + 'Wanted', + 'Latest', + 'Location', + 'Depended by' ] - if (long) out.push(type, dep.package.homepage) - return out.join(':') - }).join(os.EOL) -} + if (opts.long) outHead.push('Package Type', 'Homepage') + const outTable = [outHead].concat(outList) -function makeJSON (list, opts) { - var out = {} - list.forEach(function (p) { - var dep = p[0] - var depname = p[1] - var dir = dep.path - var has = p[2] - var want = p[3] - var latest = p[4] - var type = p[6] - if (!opts.global) { - dir = path.relative(process.cwd(), dir) - } - out[depname] = { current: has, - wanted: want, - latest: latest, - location: dir - } - if (long) { - out[depname].type = type - out[depname].homepage = dep.package.homepage + if (opts.color) { + outTable[0] = outTable[0].map(heading => styles.underline(heading)) } - }) - return JSON.stringify(out, null, 2) -} -function outdated_ (args, path, tree, parentHas, depth, opts, cb) { - if (!tree.package) tree.package = {} - if (path && moduleName(tree)) path += ' > ' + tree.package.name - if (!path && moduleName(tree)) path = tree.package.name - if (depth > opts.depth) { - return cb(null, []) + const tableOpts = { + align: ['l', 'r', 'r', 'r', 'l'], + stringLength: s => ansiTrim(s).length + } + output(table(outTable, tableOpts)) } - var types = {} - var pkg = tree.package - - if (!tree.children) tree.children = [] - - var deps = tree.error ? tree.children : tree.children.filter((child) => !isExtraneous(child)) - - deps.forEach(function (dep) { - types[moduleName(dep)] = 'dependencies' - }) +} - Object.keys(tree.missingDeps || {}).forEach(function (name) { - deps.push({ - package: { name: name }, - path: tree.path, - parent: tree, - isMissing: true - }) - types[name] = 'dependencies' - }) +async function outdated_ (tree, deps, opts) { + const list = [] - // If we explicitly asked for dev deps OR we didn't ask for production deps - // AND we asked to save dev-deps OR we didn't ask to save anything that's NOT - // dev deps then… - // (All the save checking here is because this gets called from npm-update currently - // and that requires this logic around dev deps.) - // FIXME: Refactor npm update to not be in terms of outdated. - var dev = opts.dev || /^dev(elopment)?$/.test(opts.also) - var prod = opts.production || /^prod(uction)?$/.test(opts.only) - if ( - (dev || !prod) && - ( - opts['save-dev'] || (!opts.save && !opts['save-optional']) - ) - ) { - Object.keys(tree.missingDevDeps).forEach(function (name) { - deps.push({ - package: { name: name }, - path: tree.path, - parent: tree, - isMissing: true - }) - if (!types[name]) { - types[name] = 'devDependencies' + const edges = new Set() + function getEdges (nodes, type) { + const getEdgesIn = (node) => { + for (const edge of node.edgesIn) { + edges.add(edge) } - }) - } + } - if (opts['save-dev']) { - deps = deps.filter(function (dep) { return pkg.devDependencies[moduleName(dep)] }) - deps.forEach(function (dep) { - types[moduleName(dep)] = 'devDependencies' - }) - } else if (opts.save) { - // remove optional dependencies from dependencies during --save. - deps = deps.filter(function (dep) { return !pkg.optionalDependencies[moduleName(dep)] }) - } else if (opts['save-optional']) { - deps = deps.filter(function (dep) { return pkg.optionalDependencies[moduleName(dep)] }) - deps.forEach(function (dep) { - types[moduleName(dep)] = 'optionalDependencies' - }) - } - var doUpdate = dev || ( - !prod && - !Object.keys(parentHas).length && - !opts.global - ) - if (doUpdate) { - Object.keys(pkg.devDependencies || {}).forEach(function (k) { - if (!(k in parentHas)) { - deps[k] = pkg.devDependencies[k] - types[k] = 'devDependencies' + const getEdgesOut = (node) => { + if (opts.global) { + for (const child of node.children.values()) { + edges.add(child) + } + } else { + for (const edge of node.edgesOut.values()) { + edges.add(edge) + } } - }) - } - - var has = Object.create(parentHas) - tree.children.forEach(function (child) { - if (moduleName(child) && child.package.private) { - deps = deps.filter(function (dep) { return dep !== child }) - } - has[moduleName(child)] = { - version: child.isLink ? 'linked' : child.package.version, - from: child.isLink ? 'file:' + child.path : child.package._from } - }) - // now get what we should have, based on the dep. - // if has[dep] !== shouldHave[dep], then cb with the data - // otherwise dive into the folder - asyncMap(deps, function (dep, cb) { - var name = moduleName(dep) - var required - if (tree.package.dependencies && name in tree.package.dependencies) { - required = tree.package.dependencies[name] - } else if (tree.package.optionalDependencies && name in tree.package.optionalDependencies) { - required = tree.package.optionalDependencies[name] - } else if (tree.package.devDependencies && name in tree.package.devDependencies) { - required = tree.package.devDependencies[name] - } else if (has[name]) { - required = computeVersionSpec(tree, dep) + if (!nodes) return getEdgesOut(tree) + for (const node of nodes) { + type === 'edgesOut' + ? getEdgesOut(node) + : getEdgesIn(node) } + } - if (!long) return shouldUpdate(args, dep, name, has, required, depth, path, opts, cb) - - shouldUpdate(args, dep, name, has, required, depth, path, opts, cb, types[name]) - }, cb) -} - -function shouldUpdate (args, tree, dep, has, req, depth, pkgpath, opts, cb, type) { - // look up the most recent version. - // if that's what we already have, or if it's not on the args list, - // then dive into it. Otherwise, cb() with the data. - - // { version: , from: } - var curr = has[dep] - - function skip (er) { - // show user that no viable version can be found - if (er) return cb(er) - outdated_(args, - pkgpath, - tree, - has, - depth + 1, - opts, - cb) + async function getPackument (spec) { + const packument = await pacote.packument(spec, { + fullMetadata: npm.flatOptions.long, + preferOnline: true + }) + return packument } - if (args.length && args.indexOf(dep) === -1) return skip() + async function getOutdatedInfo (edge) { + const spec = npa(edge.name) + const node = edge.to || edge + const { path, location } = node + const { version: current } = node.package || {} + + const type = edge.optional ? 'optionalDependencies' + : edge.peer ? 'peerDependencies' + : edge.dev ? 'devDependencies' + : 'dependencies' - if (tree.isLink && req == null) return skip() + for (const omitType of opts.omit || []) { + if (node[omitType]) { + return + } + } - if (req == null || req === '') req = '*' + // deps different from prod not currently + // on disk are not included in the output + if (edge.error === 'MISSING' && type !== 'dependencies') return - var parsed = npa.resolve(dep, req) - if (parsed.type === 'directory') { - if (tree.isLink) { - return skip() - } else { - return doIt('linked', 'linked') + try { + const packument = await getPackument(spec) + const expected = edge.spec + // if it's not a range, version, or tag, skip it + try { + if (!npa(`${edge.name}@${edge.spec}`).registry) { + return null + } + } catch (err) { + return null + } + const wanted = pickManifest(packument, expected, npm.flatOptions) + const latest = pickManifest(packument, '*', npm.flatOptions) + + if ( + !current || + current !== wanted.version || + wanted.version !== latest.version + ) { + list.push({ + name: edge.name, + path, + type, + current, + location, + wanted: wanted.version, + latest: latest.version, + dependent: edge.from ? edge.from.name : 'global', + homepage: packument.homepage + }) + } + } catch (err) { + // silently catch and ignore ETARGET, E403 & + // E404 errors, deps are just skipped + if (!( + err.code === 'ETARGET' || + err.code === 'E403' || + err.code === 'E404') + ) { + throw err + } } - } else if (parsed.type === 'git') { - return doIt('git', 'git') - } else if (parsed.type === 'file') { - return updateLocalDeps() - } else if (parsed.type === 'remote') { - return doIt('remote', 'remote') - } else { - return packument(parsed, opts.concat({ - 'prefer-online': true - })).nodeify(updateDeps) } - function doIt (wanted, latest) { - let c = curr && curr.version - if (parsed.type === 'alias') { - c = `npm:${parsed.subSpec.name}@${c}` + const p = [] + if (deps.length !== 0) { + // specific deps + for (let i = 0; i < deps.length; i++) { + const nodes = tree.inventory.query('name', deps[i]) + getEdges(nodes, 'edgesIn') } - if (!long) { - return cb(null, [[tree, dep, c, wanted, latest, req, null, pkgpath]]) + } else { + if (opts.all) { + // all deps in tree + const nodes = tree.inventory.values() + getEdges(nodes, 'edgesOut') } - cb(null, [[tree, dep, c, wanted, latest, req, type, pkgpath]]) + // top-level deps + getEdges() } - function updateLocalDeps (latestRegistryVersion) { - fetchPackageMetadata('file:' + parsed.fetchSpec, '.', (er, localDependency) => { - if (er) return cb() + for (const edge of edges) { + p.push(getOutdatedInfo(edge)) + } - var wanted = localDependency.version - var latest = localDependency.version + await Promise.all(p) + return list +} - if (latestRegistryVersion) { - latest = latestRegistryVersion - if (semver.lt(wanted, latestRegistryVersion)) { - wanted = latestRegistryVersion - req = dep + '@' + latest - } - } +// formatting functions +function makePretty (dep, opts) { + const { + current = 'MISSING', + location = '-', + homepage = '', + name, + wanted, + latest, + type, + dependent + } = dep - if (!curr || curr.version !== wanted) { - doIt(wanted, latest) - } else { - skip() - } - }) + const columns = [name, current, wanted, latest, location, dependent] + + if (opts.long) { + columns[6] = type + columns[7] = homepage } - function updateDeps (er, d) { - if (er) return cb(er) + if (opts.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 + } - if (parsed.type === 'alias') { - req = parsed.subSpec.rawSpec - } - try { - var l = pickManifest(d, 'latest') - var m = pickManifest(d, req) - } catch (er) { - if (er.code === 'ETARGET' || er.code === 'E403') { - return skip(er) - } else { - return skip() - } - } + return columns +} - // check that the url origin hasn't changed (#1727) and that - // there is no newer version available - var dFromUrl = m._from && url.parse(m._from).protocol - var cFromUrl = curr && curr.from && url.parse(curr.from).protocol - - if ( - !curr || - (dFromUrl && cFromUrl && m._from !== curr.from) || - m.version !== curr.version || - m.version !== l.version - ) { - if (parsed.type === 'alias') { - doIt( - `npm:${parsed.subSpec.name}@${m.version}`, - `npm:${parsed.subSpec.name}@${l.version}` - ) - } else { - doIt(m.version, l.version) - } - } else { - skip() +// --parseable creates output like this: +// :::: +function makeParseable (list, opts) { + return list.map(dep => { + const { name, current, wanted, latest, path, dependent, type, homepage } = dep + const out = [ + path, + name + '@' + wanted, + current ? (name + '@' + current) : 'MISSING', + name + '@' + latest, + dependent + ] + if (opts.long) out.push(type, homepage) + + return out.join(':') + }).join(os.EOL) +} + +function makeJSON (list, opts) { + const out = {} + list.forEach(dep => { + const { name, current, wanted, latest, path, type, dependent, homepage } = dep + out[name] = { + current, + wanted, + latest, + dependent, + location: path } - } + if (opts.long) { + out[name].type = type + out[name].homepage = homepage + } + }) + return JSON.stringify(out, null, 2) } + +module.exports = Object.assign(cmd, { completion, usage }) diff --git a/deps/npm/lib/owner.js b/deps/npm/lib/owner.js index a64cb5e14ccefb..5bc61f75179f9d 100644 --- a/deps/npm/lib/owner.js +++ b/deps/npm/lib/owner.js @@ -1,17 +1,15 @@ module.exports = owner -const BB = require('bluebird') - const log = require('npmlog') -const npa = require('libnpm/parse-arg') -const npmConfig = require('./config/figgy-config.js') -const npmFetch = require('libnpm/fetch') +const npa = require('npm-package-arg') +const npm = require('./npm.js') +const npmFetch = require('npm-registry-fetch') const output = require('./utils/output.js') const otplease = require('./utils/otplease.js') -const packument = require('libnpm/packument') -const readLocalPkg = BB.promisify(require('./utils/read-local-package.js')) +const { packument } = require('pacote') +const readLocalPkg = require('./utils/read-local-package.js') const usage = require('./utils/usage') -const whoami = BB.promisify(require('./whoami.js')) +const getIdentity = require('./utils/get-identity') owner.usage = usage( 'owner', @@ -29,9 +27,9 @@ owner.completion = function (opts, cb) { else subs.push('ls', 'list') return cb(null, subs) } - BB.try(() => { - const opts = npmConfig() - return whoami([], true).then(username => { + Promise.resolve().then(() => { + const opts = npm.flatOptions + return getIdentity(opts).then(username => { const un = encodeURIComponent(username) let byUser, theUser switch (argv[2]) { @@ -72,16 +70,16 @@ owner.completion = function (opts, cb) { return cb() } }) - }).nodeify(cb) + }).then(() => cb(), cb) } function UsageError () { - throw Object.assign(new Error(owner.usage), {code: 'EUSAGE'}) + throw Object.assign(new Error(owner.usage), { code: 'EUSAGE' }) } function owner ([action, ...args], cb) { - const opts = npmConfig() - BB.try(() => { + const opts = npm.flatOptions + Promise.resolve().then(() => { switch (action) { case 'ls': case 'list': return ls(args[0], opts) case 'add': return add(args[0], args[1], opts) @@ -103,7 +101,7 @@ function ls (pkg, opts) { } const spec = npa(pkg) - return packument(spec, opts.concat({fullMetadata: true})).then( + return packument(spec, { ...opts, fullMetadata: true }).then( data => { var owners = data.maintainers if (!owners || !owners.length) { @@ -183,7 +181,7 @@ function rm (user, pkg, opts) { } function withMutation (spec, user, opts, mutation) { - return BB.try(() => { + return Promise.resolve().then(() => { if (user) { const uri = `/-/user/org.couchdb.user:${encodeURIComponent(user)}` return npmFetch.json(uri, opts).then(mutate_, err => { @@ -203,9 +201,10 @@ function withMutation (spec, user, opts, mutation) { } if (u) u = { name: u.name, email: u.email } - return packument(spec, opts.concat({ + return packument(spec, { + ...opts, fullMetadata: true - })).then(data => { + }).then(data => { // save the number of maintainers before mutation so that we can figure // out if maintainers were added or removed const beforeMutation = data.maintainers.length @@ -221,12 +220,12 @@ function withMutation (spec, user, opts, mutation) { } const dataPath = `/${spec.escapedName}/-rev/${encodeURIComponent(data._rev)}` return otplease(opts, opts => { - const reqOpts = opts.concat({ + return npmFetch.json(dataPath, { + ...opts, method: 'PUT', body: data, spec }) - return npmFetch.json(dataPath, reqOpts) }).then(data => { if (data.error) { throw new Error('Failed to update package metadata: ' + JSON.stringify(data)) diff --git a/deps/npm/lib/pack.js b/deps/npm/lib/pack.js index 8189cb6cedc0b7..20e518484c0dcd 100644 --- a/deps/npm/lib/pack.js +++ b/deps/npm/lib/pack.js @@ -1,363 +1,50 @@ -'use strict' - -// npm pack -// Packs the specified package into a .tgz file, which can then -// be installed. - -// Set this early to avoid issues with circular dependencies. -module.exports = pack - -const BB = require('bluebird') - -const byteSize = require('byte-size') -const cacache = require('cacache') -const columnify = require('columnify') -const cp = require('child_process') -const deprCheck = require('./utils/depr-check') -const fpm = require('./fetch-package-metadata') -const fs = require('graceful-fs') -const install = require('./install') -const lifecycle = BB.promisify(require('./utils/lifecycle')) +const util = require('util') const log = require('npmlog') -const move = require('move-concurrently') -const npm = require('./npm') -const npmConfig = require('./config/figgy-config.js') -const output = require('./utils/output') const pacote = require('pacote') -const path = require('path') -const PassThrough = require('stream').PassThrough -const pathIsInside = require('path-is-inside') -const pipe = BB.promisify(require('mississippi').pipe) -const prepublishWarning = require('./utils/warn-deprecated')('prepublish-on-install') -const pinflight = require('promise-inflight') -const readJson = BB.promisify(require('read-package-json')) -const tar = require('tar') -const packlist = require('npm-packlist') -const ssri = require('ssri') +const libpack = require('libnpmpack') +const npa = require('npm-package-arg') -pack.usage = 'npm pack [[<@scope>/]...] [--dry-run]' +const npm = require('./npm.js') +const { getContents, logTar } = require('./utils/tar.js') -// if it can be installed, it can be packed. -pack.completion = install.completion +const writeFile = util.promisify(require('fs').writeFile) +const output = require('./utils/output.js') -function pack (args, silent, cb) { - const cwd = process.cwd() - if (typeof cb !== 'function') { - cb = silent - silent = false - } +const completion = require('./utils/completion/none.js') +const usageUtil = require('./utils/usage.js') +const usage = usageUtil('pack', 'npm pack [[<@scope>/]...] [--dry-run]') - if (args.length === 0) args = ['.'] +const cmd = (args, cb) => pack(args).then(() => cb()).catch(cb) - BB.all( - args.map((arg) => pack_(arg, cwd)) - ).then((tarballs) => { - if (!silent && npm.config.get('json')) { - output(JSON.stringify(tarballs, null, 2)) - } else if (!silent) { - tarballs.forEach(logContents) - output(tarballs.map((f) => path.relative(cwd, f.filename)).join('\n')) - } - return tarballs - }).nodeify(cb) -} +const pack = async (args) => { + if (args.length === 0) args = ['.'] -function pack_ (pkg, dir) { - return BB.fromNode((cb) => fpm(pkg, dir, cb)).then((mani) => { - let name = mani.name[0] === '@' - // scoped packages get special treatment - ? mani.name.substr(1).replace(/\//g, '-') - : mani.name - const target = `${name}-${mani.version}.tgz` - return pinflight(target, () => { - const dryRun = npm.config.get('dry-run') - if (mani._requested.type === 'directory') { - return prepareDirectory(mani._resolved) - .then(() => { - return packDirectory(mani, mani._resolved, target, target, true, dryRun) - }) - } else if (dryRun) { - log.verbose('pack', '--dry-run mode enabled. Skipping write.') - return cacache.tmp.withTmp(npm.tmp, {tmpPrefix: 'packing'}, (tmp) => { - const tmpTarget = path.join(tmp, path.basename(target)) - return packFromPackage(pkg, tmpTarget, target) - }) - } else { - return packFromPackage(pkg, target, target) - } - }) - }) -} + const { unicode } = npm.flatOptions -function packFromPackage (arg, target, filename) { - const opts = npmConfig() - return pacote.tarball.toFile(arg, target, opts) - .then(() => cacache.tmp.withTmp(npm.tmp, {tmpPrefix: 'unpacking'}, (tmp) => { - const tmpTarget = path.join(tmp, filename) - return pacote.extract(arg, tmpTarget, opts) - .then(() => readJson(path.join(tmpTarget, 'package.json'))) - })) - .then((pkg) => getContents(pkg, target, filename)) -} + // clone the opts because pacote mutates it with resolved/integrity + const tarballs = await Promise.all(args.map((arg) => + pack_(arg, { ...npm.flatOptions }))) -module.exports.prepareDirectory = prepareDirectory -function prepareDirectory (dir) { - return readJson(path.join(dir, 'package.json')).then((pkg) => { - if (!pkg.name) { - throw new Error('package.json requires a "name" field') - } - if (!pkg.version) { - throw new Error('package.json requires a valid "version" field') - } - if (!pathIsInside(dir, npm.tmp)) { - if (pkg.scripts && pkg.scripts.prepublish) { - prepublishWarning([ - 'As of npm@5, `prepublish` scripts are deprecated.', - 'Use `prepare` for build steps and `prepublishOnly` for upload-only.', - 'See the deprecation note in `npm help scripts` for more information.' - ]) - } - if (npm.config.get('ignore-prepublish')) { - return lifecycle(pkg, 'prepare', dir).then(() => pkg) - } else { - return lifecycle(pkg, 'prepublish', dir).then(() => { - return lifecycle(pkg, 'prepare', dir) - }).then(() => pkg) - } - } - return pkg - }) + for (const tar of tarballs) { + logTar(tar, { log, unicode }) + output(tar.filename.replace(/^@/, '').replace(/\//, '-')) + } } -module.exports.packDirectory = packDirectory -function packDirectory (mani, dir, target, filename, logIt, dryRun) { - deprCheck(mani) - return readJson(path.join(dir, 'package.json')).then((pkg) => { - return lifecycle(pkg, 'prepack', dir) - }).then(() => { - return readJson(path.join(dir, 'package.json')) - }).then((pkg) => { - return cacache.tmp.withTmp(npm.tmp, {tmpPrefix: 'packing'}, (tmp) => { - const tmpTarget = path.join(tmp, path.basename(target)) - - const tarOpt = { - file: tmpTarget, - cwd: dir, - prefix: 'package/', - portable: true, - // Provide a specific date in the 1980s for the benefit of zip, - // which is confounded by files dated at the Unix epoch 0. - mtime: new Date('1985-10-26T08:15:00.000Z'), - gzip: true - } - - return BB.resolve(packlist({ path: dir })) - // NOTE: node-tar does some Magic Stuff depending on prefixes for files - // specifically with @ signs, so we just neutralize that one - // and any such future "features" by prepending `./` - .then((files) => tar.create(tarOpt, files.map((f) => `./${f}`))) - .then(() => getContents(pkg, tmpTarget, filename, logIt)) - // thread the content info through - .tap(() => { - if (dryRun) { - log.verbose('pack', '--dry-run mode enabled. Skipping write.') - } else { - return move(tmpTarget, target, {Promise: BB, fs}) - } - }) - .tap(() => lifecycle(pkg, 'postpack', dir)) - }) - }) -} +const pack_ = async (arg, opts) => { + const spec = npa(arg) + const { dryRun } = opts + const manifest = await pacote.manifest(spec, opts) + const filename = `${manifest.name}-${manifest.version}.tgz` + .replace(/^@/, '').replace(/\//, '-') + const tarballData = await libpack(arg, opts) + const pkgContents = await getContents(manifest, tarballData) -module.exports.logContents = logContents -function logContents (tarball) { - log.notice('') - log.notice('', `${npm.config.get('unicode') ? '📦 ' : 'package:'} ${tarball.name}@${tarball.version}`) - log.notice('=== Tarball Contents ===') - if (tarball.files.length) { - log.notice('', columnify(tarball.files.map((f) => { - const bytes = byteSize(f.size) - return {path: f.path, size: `${bytes.value}${bytes.unit}`} - }), { - include: ['size', 'path'], - showHeaders: false - })) + if (!dryRun) { + await writeFile(filename, tarballData) } - if (tarball.bundled.length) { - log.notice('=== Bundled Dependencies ===') - tarball.bundled.forEach((name) => log.notice('', name)) - } - log.notice('=== Tarball Details ===') - log.notice('', columnify([ - {name: 'name:', value: tarball.name}, - {name: 'version:', value: tarball.version}, - tarball.filename && {name: 'filename:', value: tarball.filename}, - {name: 'package size:', value: byteSize(tarball.size)}, - {name: 'unpacked size:', value: byteSize(tarball.unpackedSize)}, - {name: 'shasum:', value: tarball.shasum}, - { - name: 'integrity:', - value: tarball.integrity.toString().substr(0, 20) + '[...]' + tarball.integrity.toString().substr(80)}, - tarball.bundled.length && {name: 'bundled deps:', value: tarball.bundled.length}, - tarball.bundled.length && {name: 'bundled files:', value: tarball.entryCount - tarball.files.length}, - tarball.bundled.length && {name: 'own files:', value: tarball.files.length}, - {name: 'total files:', value: tarball.entryCount} - ].filter((x) => x), { - include: ['name', 'value'], - showHeaders: false - })) - log.notice('', '') -} -module.exports.getContents = getContents -function getContents (pkg, target, filename, silent) { - const bundledWanted = new Set( - pkg.bundleDependencies || - pkg.bundledDependencies || - [] - ) - const files = [] - const bundled = new Set() - let totalEntries = 0 - let totalEntrySize = 0 - return tar.t({ - file: target, - onentry (entry) { - totalEntries++ - totalEntrySize += entry.size - const p = entry.path - if (p.startsWith('package/node_modules/')) { - const name = p.match(/^package\/node_modules\/((?:@[^/]+\/)?[^/]+)/)[1] - if (bundledWanted.has(name)) { - bundled.add(name) - } - } else { - files.push({ - path: entry.path.replace(/^package\//, ''), - size: entry.size, - mode: entry.mode - }) - } - }, - strip: 1 - }) - .then(() => BB.all([ - BB.fromNode((cb) => fs.stat(target, cb)), - ssri.fromStream(fs.createReadStream(target), { - algorithms: ['sha1', 'sha512'] - }) - ])) - .then(([stat, integrity]) => { - const shasum = integrity['sha1'][0].hexDigest() - return { - id: pkg._id, - name: pkg.name, - version: pkg.version, - from: pkg._from, - size: stat.size, - unpackedSize: totalEntrySize, - shasum, - integrity: ssri.parse(integrity['sha512'][0]), - filename, - files, - entryCount: totalEntries, - bundled: Array.from(bundled) - } - }) + return pkgContents } -const PASSTHROUGH_OPTS = [ - 'always-auth', - 'auth-type', - 'ca', - 'cafile', - 'cert', - 'git', - 'local-address', - 'maxsockets', - 'offline', - 'prefer-offline', - 'prefer-online', - 'proxy', - 'https-proxy', - 'registry', - 'send-metrics', - 'sso-poll-frequency', - 'sso-type', - 'strict-ssl' -] - -module.exports.packGitDep = packGitDep -function packGitDep (manifest, dir) { - const stream = new PassThrough() - readJson(path.join(dir, 'package.json')).then((pkg) => { - if (pkg.scripts && pkg.scripts.prepare) { - log.verbose('prepareGitDep', `${manifest._spec}: installing devDeps and running prepare script.`) - const cliArgs = PASSTHROUGH_OPTS.reduce((acc, opt) => { - if (npm.config.get(opt, 'cli') != null) { - acc.push(`--${opt}=${npm.config.get(opt)}`) - } - return acc - }, []) - const child = cp.spawn(process.env.NODE || process.execPath, [ - require.resolve('../bin/npm-cli.js'), - 'install', - '--dev', - '--prod', - '--ignore-prepublish', - '--no-progress', - '--no-save' - ].concat(cliArgs), { - cwd: dir, - env: process.env - }) - let errData = [] - let errDataLen = 0 - let outData = [] - let outDataLen = 0 - child.stdout.on('data', (data) => { - outData.push(data) - outDataLen += data.length - log.gauge.pulse('preparing git package') - }) - child.stderr.on('data', (data) => { - errData.push(data) - errDataLen += data.length - log.gauge.pulse('preparing git package') - }) - return BB.fromNode((cb) => { - child.on('error', cb) - child.on('exit', (code, signal) => { - if (code > 0) { - const err = new Error(`${signal}: npm exited with code ${code} while attempting to build ${manifest._requested}. Clone the repository manually and run 'npm install' in it for more information.`) - err.code = code - err.signal = signal - cb(err) - } else { - cb() - } - }) - }).then(() => { - if (outDataLen > 0) log.silly('prepareGitDep', '1>', Buffer.concat(outData, outDataLen).toString()) - if (errDataLen > 0) log.silly('prepareGitDep', '2>', Buffer.concat(errData, errDataLen).toString()) - }, (err) => { - if (outDataLen > 0) log.error('prepareGitDep', '1>', Buffer.concat(outData, outDataLen).toString()) - if (errDataLen > 0) log.error('prepareGitDep', '2>', Buffer.concat(errData, errDataLen).toString()) - throw err - }) - } - }).then(() => { - return readJson(path.join(dir, 'package.json')) - }).then((pkg) => { - return cacache.tmp.withTmp(npm.tmp, { - tmpPrefix: 'pacote-packing' - }, (tmp) => { - const tmpTar = path.join(tmp, 'package.tgz') - return packDirectory(manifest, dir, tmpTar).then(() => { - return pipe(fs.createReadStream(tmpTar), stream) - }) - }) - }).catch((err) => stream.emit('error', err)) - return stream -} +module.exports = Object.assign(cmd, { usage, completion }) diff --git a/deps/npm/lib/ping.js b/deps/npm/lib/ping.js index 3023bab00e9943..71e5a1970d35af 100644 --- a/deps/npm/lib/ping.js +++ b/deps/npm/lib/ping.js @@ -1,47 +1,29 @@ -'use strict' - -const npmConfig = require('./config/figgy-config.js') -const fetch = require('libnpm/fetch') -const figgyPudding = require('figgy-pudding') const log = require('npmlog') const npm = require('./npm.js') const output = require('./utils/output.js') +const usageUtil = require('./utils/usage.js') -const PingConfig = figgyPudding({ - json: {}, - registry: {} -}) - -module.exports = ping - -ping.usage = 'npm ping\nping registry' +const usage = usageUtil('ping', 'npm ping\nping registry') +const completion = require('./utils/completion/none.js') -function ping (args, silent, cb) { - if (typeof cb !== 'function') { - cb = silent - silent = false - } +const cmd = (args, cb) => ping(args).then(() => cb()).catch(cb) +const pingUtil = require('./utils/ping.js') - const opts = PingConfig(npmConfig()) - const registry = opts.registry - log.notice('PING', registry) +const ping = async args => { + log.notice('PING', npm.flatOptions.registry) const start = Date.now() - return fetch('/-/ping?write=true', opts).then( - res => res.json().catch(() => ({})) - ).then(details => { - if (silent) { - } else { - const time = Date.now() - start - log.notice('PONG', `${time / 1000}ms`) - if (npm.config.get('json')) { - output(JSON.stringify({ - registry, - time, - details - }, null, 2)) - } else if (Object.keys(details).length) { - log.notice('PONG', `${JSON.stringify(details, null, 2)}`) - } - } - }).nodeify(cb) + const details = await pingUtil(npm.flatOptions) + const time = Date.now() - start + log.notice('PONG', `${time / 1000}ms`) + if (npm.flatOptions.json) { + output(JSON.stringify({ + registry: npm.flatOptions.registry, + time, + details + }, null, 2)) + } else if (Object.keys(details).length) { + log.notice('PONG', `${JSON.stringify(details, null, 2)}`) + } } + +module.exports = Object.assign(cmd, { completion, usage }) diff --git a/deps/npm/lib/prefix.js b/deps/npm/lib/prefix.js index fb20389c457b2e..0a991447346d64 100644 --- a/deps/npm/lib/prefix.js +++ b/deps/npm/lib/prefix.js @@ -1,15 +1,8 @@ -module.exports = prefix - -var npm = require('./npm.js') -var output = require('./utils/output.js') - -prefix.usage = 'npm prefix [-g]' - -function prefix (args, silent, cb) { - if (typeof cb !== 'function') { - cb = silent - silent = false - } - if (!silent) output(npm.prefix) - process.nextTick(cb.bind(this, null, npm.prefix)) -} +const npm = require('./npm.js') +const output = require('./utils/output.js') +const usageUtil = require('./utils/usage.js') +const completion = require('./utils/completion/none.js') +const cmd = (args, cb) => prefix(args).then(() => cb()).catch(cb) +const usage = usageUtil('prefix', 'npm prefix [-g]') +const prefix = async (args, cb) => output(npm.prefix) +module.exports = Object.assign(cmd, { usage, completion }) diff --git a/deps/npm/lib/profile.js b/deps/npm/lib/profile.js index 7ce9cb5cce5df2..a9e0325943c3d4 100644 --- a/deps/npm/lib/profile.js +++ b/deps/npm/lib/profile.js @@ -1,23 +1,17 @@ 'use strict' -const BB = require('bluebird') - const ansistyles = require('ansistyles') -const figgyPudding = require('figgy-pudding') const inspect = require('util').inspect const log = require('npmlog') const npm = require('./npm.js') -const npmConfig = require('./config/figgy-config.js') const otplease = require('./utils/otplease.js') const output = require('./utils/output.js') -const profile = require('libnpm/profile') +const profile = require('npm-profile') const pulseTillDone = require('./utils/pulse-till-done.js') const qrcodeTerminal = require('qrcode-terminal') -const queryString = require('query-string') -const qw = require('qw') const readUserInfo = require('./utils/read-user-info.js') const Table = require('cli-table3') -const url = require('url') +const { URL } = require('url') module.exports = profileCmd @@ -27,7 +21,7 @@ profileCmd.usage = 'npm profile get []\n' + 'npm profile set ' -profileCmd.subcommands = qw`enable-2fa disable-2fa get set` +profileCmd.subcommands = ['enable-2fa', 'disable-2fa', 'get', 'set'] profileCmd.completion = function (opts, cb) { var argv = opts.conf.argv.remain @@ -35,7 +29,7 @@ profileCmd.completion = function (opts, cb) { case 'enable-2fa': case 'enable-tfa': if (argv.length === 3) { - return cb(null, qw`auth-and-writes auth-only`) + return cb(null, ['auth-and-writes', 'auth-only']) } else { return cb(null, []) } @@ -53,13 +47,6 @@ function withCb (prom, cb) { prom.then((value) => cb(null, value), cb) } -const ProfileOpts = figgyPudding({ - json: {}, - otp: {}, - parseable: {}, - registry: {} -}) - function profileCmd (args, cb) { if (args.length === 0) return cb(new Error(profileCmd.usage)) log.gauge.show('profile') @@ -87,13 +74,22 @@ function profileCmd (args, cb) { } } -const knownProfileKeys = qw` - name email ${'two-factor auth'} fullname homepage - freenode twitter github created updated` +const knownProfileKeys = [ + 'name', + 'email', + 'two-factor auth', + 'fullname', + 'homepage', + 'freenode', + 'twitter', + 'github', + 'created', + 'updated' +] function get (args) { const tfa = 'two-factor auth' - const conf = ProfileOpts(npmConfig()) + const conf = npm.flatOptions return pulseTillDone.withPromise(profile.get(conf)).then((info) => { if (!info.cidr_whitelist) delete info.cidr_whitelist if (conf.json) { @@ -105,7 +101,7 @@ function get (args) { Object.keys(info).filter((k) => !(k in cleaned)).forEach((k) => { cleaned[k] = info[k] || '' }) delete cleaned.tfa delete cleaned.email_verified - cleaned['email'] += info.email_verified ? ' (verified)' : '(unverified)' + cleaned.email += info.email_verified ? ' (verified)' : '(unverified)' if (info.tfa && !info.tfa.pending) { cleaned[tfa] = info.tfa.mode } else { @@ -128,18 +124,25 @@ function get (args) { }) } else { const table = new Table() - Object.keys(cleaned).forEach((k) => table.push({[ansistyles.bright(k)]: cleaned[k]})) + Object.keys(cleaned).forEach((k) => table.push({ [ansistyles.bright(k)]: cleaned[k] })) output(table.toString()) } } }) } -const writableProfileKeys = qw` - email password fullname homepage freenode twitter github` +const writableProfileKeys = [ + 'email', + 'password', + 'fullname', + 'homepage', + 'freenode', + 'twitter', + 'github' +] function set (args) { - let conf = ProfileOpts(npmConfig()) + const conf = npm.flatOptions const prop = (args[0] || '').toLowerCase().trim() let value = args.length > 1 ? args.slice(1).join(' ') : null if (prop !== 'password' && value === null) { @@ -153,16 +156,16 @@ function set (args) { if (writableProfileKeys.indexOf(prop) === -1) { return Promise.reject(Error(`"${prop}" is not a property we can set. Valid properties are: ` + writableProfileKeys.join(', '))) } - return BB.try(() => { + return Promise.resolve().then(() => { if (prop === 'password') { return readUserInfo.password('Current password: ').then((current) => { return readPasswords().then((newpassword) => { - value = {old: current, new: newpassword} + value = { old: current, new: newpassword } }) }) } else if (prop === 'email') { return readUserInfo.password('Password: ').then((current) => { - return {password: current, email: value} + return { password: current, email: value } }) } function readPasswords () { @@ -185,7 +188,7 @@ function set (args) { return otplease(conf, conf => profile.set(newUser, conf)) .then((result) => { if (conf.json) { - output(JSON.stringify({[prop]: result[prop]}, null, 2)) + output(JSON.stringify({ [prop]: result[prop] }, null, 2)) } else if (conf.parseable) { output(prop + '\t' + result[prop]) } else if (result[prop] != null) { @@ -209,7 +212,7 @@ function enable2fa (args) { ' auth-only - Require two-factor authentication only when logging in\n' + ' auth-and-writes - Require two-factor authentication when logging in AND when publishing')) } - const conf = ProfileOpts(npmConfig()) + const conf = npm.flatOptions if (conf.json || conf.parseable) { return Promise.reject(new Error( 'Enabling two-factor authentication is an interactive operation and ' + @@ -222,7 +225,7 @@ function enable2fa (args) { } } - return BB.try(() => { + return Promise.resolve().then(() => { // if they're using legacy auth currently then we have to update them to a // bearer token before continuing. const auth = getAuth(conf) @@ -232,8 +235,8 @@ function enable2fa (args) { auth.basic.password, false, [], conf ).then((result) => { if (!result.token) throw new Error('Your registry ' + conf.registry + 'does not seem to support bearer tokens. Bearer tokens are required for two-factor authentication') - npm.config.setCredentialsByURI(conf.registry, {token: result.token}) - return BB.fromNode((cb) => npm.config.save('user', cb)) + npm.config.setCredentialsByURI(conf.registry, { token: result.token }) + return npm.config.save('user') }) } }).then(() => { @@ -246,7 +249,7 @@ function enable2fa (args) { if (!info.tfa) return if (info.tfa.pending) { log.info('profile', 'Resetting two-factor authentication') - return pulseTillDone.withPromise(profile.set({tfa: {password, mode: 'disable'}}, conf)) + return pulseTillDone.withPromise(profile.set({ tfa: { password, mode: 'disable' } }, conf)) } else { if (conf.auth.otp) return return readUserInfo.otp('Enter one-time password from your authenticator app: ').then((otp) => { @@ -265,15 +268,15 @@ function enable2fa (args) { if (typeof challenge.tfa !== 'string' || !/^otpauth:[/][/]/.test(challenge.tfa)) { throw new Error('Unknown error enabling two-factor authentication. Expected otpauth URL, got: ' + inspect(challenge.tfa)) } - const otpauth = url.parse(challenge.tfa) - const opts = queryString.parse(otpauth.query) + const otpauth = new URL(challenge.tfa) + const secret = otpauth.searchParams.get('secret') return qrcode(challenge.tfa).then((code) => { - output('Scan into your authenticator app:\n' + code + '\n Or enter code:', opts.secret) + output('Scan into your authenticator app:\n' + code + '\n Or enter code:', secret) }).then((code) => { return readUserInfo.otp('And an OTP code from your authenticator: ') }).then((otp1) => { log.info('profile', 'Finalizing two-factor authentication') - return profile.set({tfa: [otp1]}, conf) + return profile.set({ tfa: [otp1] }, conf) }).then((result) => { output('2FA successfully enabled. Below are your recovery codes, please print these out.') output('You will need these to recover access to your account if you lose your authentication device.') @@ -286,12 +289,12 @@ function getAuth (conf) { const creds = npm.config.getCredentialsByURI(conf.registry) let auth if (creds.token) { - auth = {token: creds.token} + auth = { token: creds.token } } else if (creds.username) { - auth = {basic: {username: creds.username, password: creds.password}} + auth = { basic: { username: creds.username, password: creds.password } } } else if (creds.auth) { const basic = Buffer.from(creds.auth, 'base64').toString().split(':', 2) - auth = {basic: {username: basic[0], password: basic[1]}} + auth = { basic: { username: basic[0], password: basic[1] } } } else { auth = {} } @@ -301,23 +304,23 @@ function getAuth (conf) { } function disable2fa (args) { - let conf = ProfileOpts(npmConfig()) + let conf = npm.flatOptions return pulseTillDone.withPromise(profile.get(conf)).then((info) => { if (!info.tfa || info.tfa.pending) { output('Two factor authentication not enabled.') return } return readUserInfo.password().then((password) => { - return BB.try(() => { + return Promise.resolve().then(() => { if (conf.otp) return return readUserInfo.otp('Enter one-time password from your authenticator: ').then((otp) => { - conf = conf.concat({otp}) + conf = { ...conf, otp } }) }).then(() => { log.info('profile', 'disabling tfa') - return pulseTillDone.withPromise(profile.set({tfa: {password: password, mode: 'disable'}}, conf)).then(() => { + return pulseTillDone.withPromise(profile.set({ tfa: { password: password, mode: 'disable' } }, conf)).then(() => { if (conf.json) { - output(JSON.stringify({tfa: false}, null, 2)) + output(JSON.stringify({ tfa: false }, null, 2)) } else if (conf.parseable) { output('tfa\tfalse') } else { diff --git a/deps/npm/lib/prune.js b/deps/npm/lib/prune.js index 010e471e4b328e..66f9d8ba240d6a 100644 --- a/deps/npm/lib/prune.js +++ b/deps/npm/lib/prune.js @@ -1,68 +1,25 @@ -// prune extraneous packages. - -module.exports = prune -module.exports.Pruner = Pruner - -prune.usage = 'npm prune [[<@scope>/]...] [--production]' - -var npm = require('./npm.js') -var log = require('npmlog') -var util = require('util') -var moduleName = require('./utils/module-name.js') -var Installer = require('./install.js').Installer -var isExtraneous = require('./install/is-extraneous.js') -var isOnlyDev = require('./install/is-only-dev.js') -var removeDeps = require('./install/deps.js').removeDeps -var loadExtraneous = require('./install/deps.js').loadExtraneous -var chain = require('slide').chain -var computeMetadata = require('./install/deps.js').computeMetadata - -prune.completion = require('./utils/completion/installed-deep.js') - -function prune (args, cb) { - var dryrun = !!npm.config.get('dry-run') - new Pruner('.', dryrun, args).run(cb) -} - -function Pruner (where, dryrun, args) { - Installer.call(this, where, dryrun, args) - this.autoPrune = true -} -util.inherits(Pruner, Installer) - -Pruner.prototype.loadAllDepsIntoIdealTree = function (cb) { - log.silly('uninstall', 'loadAllDepsIntoIdealTree') - - var cg = this.progress['loadIdealTree:loadAllDepsIntoIdealTree'] - var steps = [] - - computeMetadata(this.idealTree) - var self = this - var excludeDev = npm.config.get('production') || /^prod(uction)?$/.test(npm.config.get('only')) - function shouldPrune (child) { - if (isExtraneous(child)) return true - if (!excludeDev) return false - return isOnlyDev(child) - } - function getModuleName (child) { - // wrapping because moduleName doesn't like extra args and we're called - // from map. - return moduleName(child) - } - function matchesArg (name) { - return self.args.length === 0 || self.args.indexOf(name) !== -1 - } - function nameObj (name) { - return {name: name} - } - var toPrune = this.idealTree.children.filter(shouldPrune).map(getModuleName).filter(matchesArg).map(nameObj) - - steps.push( - [removeDeps, toPrune, this.idealTree, null], - [loadExtraneous, this.idealTree, cg.newGroup('loadExtraneous')]) - chain(steps, cb) +// prune extraneous packages +const npm = require('./npm.js') +const Arborist = require('@npmcli/arborist') +const usageUtil = require('./utils/usage.js') + +const reifyOutput = require('./utils/reify-output.js') + +const usage = usageUtil('prune', + 'npm prune [[<@scope>/]...] [--production]' +) +const completion = require('./utils/completion/none.js') + +const cmd = (args, cb) => prune().then(() => cb()).catch(cb) + +const prune = async () => { + const where = npm.prefix + const arb = new Arborist({ + ...npm.flatOptions, + path: where + }) + await arb.prune(npm.flatOptions) + reifyOutput(arb) } -Pruner.prototype.runPreinstallTopLevelLifecycles = function (cb) { cb() } -Pruner.prototype.runPostinstallTopLevelLifecycles = function (cb) { cb() } -Pruner.prototype.saveToDependencies = function (cb) { cb() } +module.exports = Object.assign(cmd, { usage, completion }) diff --git a/deps/npm/lib/publish.js b/deps/npm/lib/publish.js index e81fc1a0574546..602d213b683939 100644 --- a/deps/npm/lib/publish.js +++ b/deps/npm/lib/publish.js @@ -1,167 +1,94 @@ 'use strict' -const BB = require('bluebird') - -const cacache = require('cacache') -const figgyPudding = require('figgy-pudding') -const libpub = require('libnpm/publish') -const libunpub = require('libnpm/unpublish') -const lifecycle = BB.promisify(require('./utils/lifecycle.js')) +const util = require('util') const log = require('npmlog') -const npa = require('libnpm/parse-arg') -const npmConfig = require('./config/figgy-config.js') +const semver = require('semver') +const pack = require('libnpmpack') +const libpub = require('libnpmpublish').publish +const runScript = require('@npmcli/run-script') + +const npm = require('./npm.js') const output = require('./utils/output.js') const otplease = require('./utils/otplease.js') -const pack = require('./pack') -const { tarball, extract } = require('libnpm') -const path = require('path') -const readFileAsync = BB.promisify(require('graceful-fs').readFile) -const readJson = BB.promisify(require('read-package-json')) -const semver = require('semver') -const statAsync = BB.promisify(require('graceful-fs').stat) +const { getContents, logTar } = require('./utils/tar.js') -publish.usage = 'npm publish [|] [--tag ] [--access ] [--dry-run]' + - "\n\nPublishes '.' if no argument supplied" + - '\n\nSets tag `latest` if no --tag specified' +const readJson = util.promisify(require('read-package-json')) -publish.completion = function (opts, cb) { - // publish can complete to a folder with a package.json - // or a tarball, or a tarball url. - // for now, not yet implemented. - return cb() -} +const completion = require('./utils/completion/none.js') +const usageUtil = require('./utils/usage.js') +const usage = usageUtil('publish', + 'npm publish [] [--tag ] [--access ] [--dry-run]' + + '\n\nPublishes \'.\' if no argument supplied' + + '\nSets tag `latest` if no --tag specified') -const PublishConfig = figgyPudding({ - dryRun: 'dry-run', - 'dry-run': { default: false }, - force: { default: false }, - json: { default: false }, - Promise: { default: () => Promise }, - tag: { default: 'latest' }, - tmp: {} -}) - -module.exports = publish -function publish (args, isRetry, cb) { - if (typeof cb !== 'function') { - cb = isRetry - isRetry = false - } +const cmd = (args, cb) => publish(args).then(() => cb()).catch(cb) + +const publish = async args => { if (args.length === 0) args = ['.'] - if (args.length !== 1) return cb(publish.usage) + if (args.length !== 1) throw usage log.verbose('publish', args) - const opts = PublishConfig(npmConfig()) - const t = opts.tag.trim() - if (semver.validRange(t)) { - return cb(new Error('Tag name must not be a valid SemVer range: ' + t)) + const opts = { ...npm.flatOptions } + const { json, defaultTag } = opts + if (semver.validRange(defaultTag)) { + throw new Error('Tag name must not be a valid SemVer range: ' + defaultTag.trim()) } - return publish_(args[0], opts) - .then((tarball) => { - const silent = log.level === 'silent' - if (!silent && opts.json) { - output(JSON.stringify(tarball, null, 2)) - } else if (!silent) { - output(`+ ${tarball.id}`) - } - }) - .nodeify(cb) + const tarball = await publish_(args[0], opts) + const silent = log.level === 'silent' + if (!silent && json) { + output(JSON.stringify(tarball, null, 2)) + } else if (!silent) { + output(`+ ${tarball.id}`) + } + + return tarball } -function publish_ (arg, opts) { - return statAsync(arg).then((stat) => { - if (stat.isDirectory()) { - return stat - } else { - const err = new Error('not a directory') - err.code = 'ENOTDIR' - throw err - } - }).then(() => { - return publishFromDirectory(arg, opts) - }, (err) => { - if (err.code !== 'ENOENT' && err.code !== 'ENOTDIR') { - throw err - } else { - return publishFromPackage(arg, opts) - } +const publish_ = async (arg, opts) => { + const { unicode, dryRun, json } = opts + let manifest = await readJson(`${arg}/package.json`) + + // prepublishOnly + await runScript({ + event: 'prepublishOnly', + path: arg, + stdio: 'inherit', + pkg: manifest }) -} -function publishFromDirectory (arg, opts) { - // All this readJson is because any of the given scripts might modify the - // package.json in question, so we need to refresh after every step. - let contents - return pack.prepareDirectory(arg).then(() => { - return readJson(path.join(arg, 'package.json')) - }).then((pkg) => { - return lifecycle(pkg, 'prepublishOnly', arg) - }).then(() => { - return readJson(path.join(arg, 'package.json')) - }).then((pkg) => { - return cacache.tmp.withTmp(opts.tmp, {tmpPrefix: 'fromDir'}, (tmpDir) => { - const target = path.join(tmpDir, 'package.tgz') - return pack.packDirectory(pkg, arg, target, null, true) - .tap((c) => { contents = c }) - .then((c) => !opts.json && pack.logContents(c)) - .then(() => upload(pkg, false, target, opts)) - }) - }).then(() => { - return readJson(path.join(arg, 'package.json')) - }).tap((pkg) => { - return lifecycle(pkg, 'publish', arg) - }).tap((pkg) => { - return lifecycle(pkg, 'postpublish', arg) + const tarballData = await pack(arg) + const pkgContents = await getContents(manifest, tarballData) + + if (!json) { + logTar(pkgContents, { log, unicode }) + } + + if (!dryRun) { + // The purpose of re-reading the manifest is in case it changed, + // so that we send the latest and greatest thing to the registry + manifest = await readJson(`${arg}/package.json`) + await otplease(opts, opts => libpub(arg, manifest, opts)) + } + + // publish + await runScript({ + event: 'publish', + path: arg, + stdio: 'inherit', + pkg: manifest }) - .then(() => contents) -} -function publishFromPackage (arg, opts) { - return cacache.tmp.withTmp(opts.tmp, {tmpPrefix: 'fromPackage'}, tmp => { - const extracted = path.join(tmp, 'package') - const target = path.join(tmp, 'package.json') - return tarball.toFile(arg, target, opts) - .then(() => extract(arg, extracted, opts)) - .then(() => readJson(path.join(extracted, 'package.json'))) - .then((pkg) => { - return BB.resolve(pack.getContents(pkg, target)) - .tap((c) => !opts.json && pack.logContents(c)) - .tap(() => upload(pkg, false, target, opts)) - }) + // postpublish + await runScript({ + event: 'postpublish', + path: arg, + stdio: 'inherit', + pkg: manifest }) -} -function upload (pkg, isRetry, cached, opts) { - if (!opts.dryRun) { - return readFileAsync(cached).then(tarball => { - return otplease(opts, opts => { - return libpub(pkg, tarball, opts) - }).catch(err => { - if ( - err.code === 'EPUBLISHCONFLICT' && - opts.force && - !isRetry - ) { - log.warn('publish', 'Forced publish over ' + pkg._id) - return otplease(opts, opts => libunpub( - npa.resolve(pkg.name, pkg.version), opts - )).finally(() => { - // ignore errors. Use the force. Reach out with your feelings. - return otplease(opts, opts => { - return upload(pkg, true, tarball, opts) - }).catch(() => { - // but if it fails again, then report the first error. - throw err - }) - }) - } else { - throw err - } - }) - }) - } else { - return opts.Promise.resolve(true) - } + return pkgContents } + +module.exports = Object.assign(cmd, { usage, completion }) diff --git a/deps/npm/lib/rebuild.js b/deps/npm/lib/rebuild.js index bbc5e8f4811b34..a2beecc50c21b2 100644 --- a/deps/npm/lib/rebuild.js +++ b/deps/npm/lib/rebuild.js @@ -1,78 +1,52 @@ +const Arborist = require('@npmcli/arborist') +const npm = require('./npm.js') +const usageUtil = require('./utils/usage.js') +const { resolve } = require('path') +const output = require('./utils/output.js') +const npa = require('npm-package-arg') +const semver = require('semver') -module.exports = rebuild +const cmd = (args, cb) => rebuild(args).then(() => cb()).catch(cb) -var readInstalled = require('read-installed') -var semver = require('semver') -var log = require('npmlog') -var npm = require('./npm.js') -var npa = require('npm-package-arg') -var usage = require('./utils/usage') -var output = require('./utils/output.js') +const usage = usageUtil('rebuild', 'npm rebuild [[<@scope>/][@] ...]') -rebuild.usage = usage( - 'rebuild', - 'npm rebuild [[<@scope>/]...]' -) +const completion = require('./utils/completion/installed-deep.js') -rebuild.completion = require('./utils/completion/installed-deep.js') +const rebuild = async args => { + const globalTop = resolve(npm.globalDir, '..') + const where = npm.flatOptions.global ? globalTop : npm.prefix + const arb = new Arborist({ + ...npm.flatOptions, + path: where + }) -function rebuild (args, cb) { - var opt = { depth: npm.config.get('depth'), dev: true } - readInstalled(npm.prefix, opt, function (er, data) { - log.info('readInstalled', typeof data) - if (er) return cb(er) - var set = filter(data, args) - var folders = Object.keys(set).filter(function (f) { - return f !== npm.prefix + if (args.length) { + // get the set of nodes matching the name that we want rebuilt + const tree = await arb.loadActual() + const filter = getFilterFn(args) + await arb.rebuild({ + nodes: tree.inventory.filter(filter) }) - if (!folders.length) return cb() - log.silly('rebuild set', folders) - cleanBuild(folders, set, cb) - }) -} + } else { + await arb.rebuild() + } -function cleanBuild (folders, set, cb) { - npm.commands.build(folders, function (er) { - if (er) return cb(er) - output(folders.map(function (f) { - return set[f] + ' ' + f - }).join('\n')) - cb() - }) + output('rebuilt dependencies successfully') } -function filter (data, args, set, seen) { - if (!set) set = {} - if (!seen) seen = new Set() - if (set.hasOwnProperty(data.path)) return set - if (seen.has(data)) return set - seen.add(data) - var pass - if (!args.length) pass = true // rebuild everything - else if (data.name && data._id) { - for (var i = 0, l = args.length; i < l; i++) { - var arg = args[i] - var nv = npa(arg) - var n = nv.name - var v = nv.rawSpec - if (n !== data.name) continue - if (!semver.satisfies(data.version, v, true)) continue - pass = true - break - } - } - if (pass && data._id) { - log.verbose('rebuild', 'path, id', [data.path, data._id]) - set[data.path] = data._id - } - // need to also dive through kids, always. - // since this isn't an install these won't get auto-built unless - // they're not dependencies. - Object.keys(data.dependencies || {}).forEach(function (d) { - // return - var dep = data.dependencies[d] - if (typeof dep === 'string') return - filter(dep, args, set, seen) +const getFilterFn = args => { + const specs = args.map(arg => { + const spec = npa(arg) + if (spec.type === 'tag' && spec.rawSpec === '') { return spec } + if (spec.type !== 'range' && spec.type !== 'version') { throw new Error('`npm rebuild` only supports SemVer version/range specifiers') } + return spec + }) + return node => specs.some(spec => { + const { version } = node.package + if (spec.name !== node.name) { return false } + if (spec.rawSpec === '' || spec.rawSpec === '*') { return true } + return semver.satisfies(version, spec.fetchSpec) }) - return set } + +module.exports = Object.assign(cmd, { usage, completion }) diff --git a/deps/npm/lib/repo.js b/deps/npm/lib/repo.js index b930402aedf953..ed0253859ccc86 100644 --- a/deps/npm/lib/repo.js +++ b/deps/npm/lib/repo.js @@ -1,50 +1,72 @@ -module.exports = repo +const log = require('npmlog') +const pacote = require('pacote') +const { promisify } = require('util') +const openUrl = promisify(require('./utils/open-url.js')) +const usageUtil = require('./utils/usage.js') +const npm = require('./npm.js') +const hostedFromMani = require('./utils/hosted-git-info-from-manifest.js') +const { URL } = require('url') -repo.usage = 'npm repo []' +const usage = usageUtil('repo', 'npm repo [ [ ...]]') +const completion = require('./utils/completion/none.js') -const openUrl = require('./utils/open-url') -const hostedGitInfo = require('hosted-git-info') -const url_ = require('url') -const fetchPackageMetadata = require('./fetch-package-metadata.js') +const cmd = (args, cb) => repo(args).then(() => cb()).catch(cb) -repo.completion = function (opts, cb) { - // FIXME: there used to be registry completion here, but it stopped making - // sense somewhere around 50,000 packages on the registry - cb() +const repo = async args => { + if (!args || !args.length) { + args = ['.'] + } + await Promise.all(args.map(pkg => getRepo(pkg))) } -function repo (args, cb) { - const n = args.length ? args[0] : '.' - fetchPackageMetadata(n, '.', {fullMetadata: true}, function (er, d) { - if (er) return cb(er) - getUrlAndOpen(d, cb) - }) -} +const getRepo = async pkg => { + const opts = { ...npm.flatOptions, fullMetadata: true } + const mani = await pacote.manifest(pkg, opts) + + const r = mani.repository + const rurl = !r ? null + : typeof r === 'string' ? r + : typeof r === 'object' && typeof r.url === 'string' ? r.url + : null + + if (!rurl) { + throw Object.assign(new Error('no repository'), { + pkgid: pkg + }) + } -function getUrlAndOpen (d, cb) { - const r = d.repository - if (!r) return cb(new Error('no repository')) - // XXX remove this when npm@v1.3.10 from node 0.10 is deprecated - // from https://github.com/npm/npm-www/issues/418 - const info = hostedGitInfo.fromUrl(r.url) - const url = info ? info.browse() : unknownHostedUrl(r.url) + const info = hostedFromMani(mani) + const url = info ? info.browse(mani.repository.directory) : unknownHostedUrl(rurl) - if (!url) return cb(new Error('no repository: could not get url')) + if (!url) { + throw Object.assign(new Error('no repository: could not get url'), { + pkgid: pkg + }) + } - openUrl(url, 'repository available at the following URL', cb) + log.silly('docs', 'url', url) + await openUrl(url, `${mani.name} repo available at the following URL`) } -function unknownHostedUrl (url) { +const unknownHostedUrl = url => { try { - const idx = url.indexOf('@') - if (idx !== -1) { - url = url.slice(idx + 1).replace(/:([^\d]+)/, '/$1') + const { + protocol, + hostname, + pathname + } = new URL(url) + + /* istanbul ignore next - URL ctor should prevent this */ + if (!protocol || !hostname) { + return null } - url = url_.parse(url) - const protocol = url.protocol === 'https:' - ? 'https:' - : 'http:' - return protocol + '//' + (url.host || '') + - url.path.replace(/\.git$/, '') - } catch (e) {} + + const proto = /(git\+)http:$/.test(protocol) ? 'http:' : 'https:' + const path = pathname.replace(/\.git$/, '') + return `${proto}//${hostname}${path}` + } catch (e) { + return null + } } + +module.exports = Object.assign(cmd, { usage, completion }) diff --git a/deps/npm/lib/root.js b/deps/npm/lib/root.js index 97d76c120f807e..27e357655c3c01 100644 --- a/deps/npm/lib/root.js +++ b/deps/npm/lib/root.js @@ -1,15 +1,8 @@ -module.exports = root - const npm = require('./npm.js') const output = require('./utils/output.js') - -root.usage = 'npm root [-g]' - -function root (args, silent, cb) { - if (typeof cb !== 'function') { - cb = silent - silent = false - } - if (!silent) output(npm.dir) - process.nextTick(cb.bind(this, null, npm.dir)) -} +const usageUtil = require('./utils/usage.js') +const completion = require('./utils/completion/none.js') +const cmd = (args, cb) => root(args).then(() => cb()).catch(cb) +const usage = usageUtil('root', 'npm root [-g]') +const root = async (args, cb) => output(npm.dir) +module.exports = Object.assign(cmd, { usage, completion }) diff --git a/deps/npm/lib/run-script.js b/deps/npm/lib/run-script.js index 476591c051e73a..90f11270c65d1e 100644 --- a/deps/npm/lib/run-script.js +++ b/deps/npm/lib/run-script.js @@ -1,72 +1,92 @@ -module.exports = runScript - -var lifecycle = require('./utils/lifecycle.js') -var npm = require('./npm.js') -var path = require('path') -var readJson = require('read-package-json') -var log = require('npmlog') -var chain = require('slide').chain -var usage = require('./utils/usage') -var output = require('./utils/output.js') -var didYouMean = require('./utils/did-you-mean') -var isWindowsShell = require('./utils/is-windows-shell.js') - -runScript.usage = usage( +const run = require('@npmcli/run-script') +const npm = require('./npm.js') +const readJson = require('read-package-json-fast') +const { resolve } = require('path') +const output = require('./utils/output.js') +const log = require('npmlog') +const usageUtil = require('./utils/usage') +const didYouMean = require('./utils/did-you-mean') +const isWindowsShell = require('./utils/is-windows-shell.js') + +const usage = usageUtil( 'run-script', - 'npm run-script [-- ...]' + 'npm run-script [-- ]' ) -runScript.completion = function (opts, cb) { - // see if there's already a package specified. - var argv = opts.conf.argv.remain - - if (argv.length >= 4) return cb() - - if (argv.length === 3) { - // either specified a script locally, in which case, done, - // or a package, in which case, complete against its scripts - var json = path.join(npm.localPrefix, 'package.json') - return readJson(json, function (er, d) { - if (er && er.code !== 'ENOENT' && er.code !== 'ENOTDIR') return cb(er) - if (er) d = {} - var scripts = Object.keys(d.scripts || {}) - console.error('local scripts', scripts) - if (scripts.indexOf(argv[2]) !== -1) return cb() - // ok, try to find out which package it was, then - var pref = npm.config.get('global') ? npm.config.get('prefix') - : npm.localPrefix - var pkgDir = path.resolve(pref, 'node_modules', argv[2], 'package.json') - readJson(pkgDir, function (er, d) { - if (er && er.code !== 'ENOENT' && er.code !== 'ENOTDIR') return cb(er) - if (er) d = {} - var scripts = Object.keys(d.scripts || {}) - return cb(null, scripts) - }) - }) +const completion = async (opts, cb) => { + const argv = opts.conf.argv.remain + if (argv.length === 2) { + // find the script name + const json = resolve(npm.localPrefix, 'package.json') + const { scripts = {} } = await readJson(json).catch(er => ({})) + return cb(null, Object.keys(scripts)) } + // otherwise nothing to do, just let the system handle it + return cb() +} - readJson(path.join(npm.localPrefix, 'package.json'), function (er, d) { - if (er && er.code !== 'ENOENT' && er.code !== 'ENOTDIR') return cb(er) - d = d || {} - cb(null, Object.keys(d.scripts || {})) - }) +const cmd = (args, cb) => { + const fn = args.length ? runScript : list + return fn(args).then(() => cb()).catch(cb) } -function runScript (args, cb) { - if (!args.length) return list(cb) +const runScript = async (args) => { + const path = npm.localPrefix + const event = args.shift() + const { scriptShell } = npm.flatOptions + + const pkg = await readJson(`${path}/package.json`) + const { scripts = {} } = pkg + + if (event === 'restart' && !scripts.restart) { + scripts.restart = 'npm stop --if-present && npm start' + } else if (event === 'env') { + scripts.env = isWindowsShell ? 'SET' : 'env' + } + pkg.scripts = scripts + + if (!scripts[event]) { + if (npm.config.get('if-present')) { + return + } + const suggestions = didYouMean(event, Object.keys(scripts)) + throw new Error(`missing script: ${event}${ + suggestions ? `\n${suggestions}` : ''}`) + } + + // positional args only added to the main event, not pre/post + const events = [[event, args]] + if (!npm.flatOptions.ignoreScripts) { + if (scripts[`pre${event}`]) { + events.unshift([`pre${event}`, []]) + } + if (scripts[`post${event}`]) { + events.push([`post${event}`, []]) + } + } - var pkgdir = npm.localPrefix - var cmd = args.shift() + const opts = { + path, + args, + scriptShell, + stdio: log.level === 'silent' ? 'pipe' : 'inherit', + stdioString: true, + pkg + } - readJson(path.resolve(pkgdir, 'package.json'), function (er, d) { - if (er) return cb(er) - run(d, pkgdir, cmd, args, cb) - }) + for (const [event, args] of events) { + await run({ + ...opts, + event, + args + }) + } } -function list (cb) { - var json = path.join(npm.localPrefix, 'package.json') - var cmdList = [ +const list = async () => { + const path = npm.localPrefix + const { scripts, name } = await readJson(`${path}/package.json`) + const cmdList = [ 'publish', 'install', 'uninstall', @@ -75,111 +95,53 @@ function list (cb) { 'start', 'restart', 'version' - ].reduce(function (l, p) { - return l.concat(['pre' + p, p, 'post' + p]) - }, []) - return readJson(json, function (er, d) { - if (er && er.code !== 'ENOENT' && er.code !== 'ENOTDIR') return cb(er) - if (er) d = {} - var allScripts = Object.keys(d.scripts || {}) - var scripts = [] - var runScripts = [] - allScripts.forEach(function (script) { - if (cmdList.indexOf(script) !== -1) scripts.push(script) - else runScripts.push(script) - }) - - if (log.level === 'silent') { - return cb(null, allScripts) - } + ].reduce((l, p) => l.concat(['pre' + p, p, 'post' + p]), []) - if (npm.config.get('json')) { - output(JSON.stringify(d.scripts || {}, null, 2)) - return cb(null, allScripts) - } + if (!scripts) { + return [] + } - if (npm.config.get('parseable')) { - allScripts.forEach(function (script) { - output(script + ':' + d.scripts[script]) - }) - return cb(null, allScripts) - } + const allScripts = Object.keys(scripts) + if (log.level === 'silent') { + return allScripts + } - var s = '\n ' - var prefix = ' ' - if (scripts.length) { - output('Lifecycle scripts included in %s:', d.name) - } - scripts.forEach(function (script) { - output(prefix + script + s + d.scripts[script]) - }) - if (!scripts.length && runScripts.length) { - output('Scripts available in %s via `npm run-script`:', d.name) - } else if (runScripts.length) { - output('\navailable via `npm run-script`:') - } - runScripts.forEach(function (script) { - output(prefix + script + s + d.scripts[script]) - }) - return cb(null, allScripts) - }) -} + if (npm.flatOptions.json) { + output(JSON.stringify(scripts, null, 2)) + return allScripts + } -function run (pkg, wd, cmd, args, cb) { - if (!pkg.scripts) pkg.scripts = {} - - var cmds - if (cmd === 'restart' && !pkg.scripts.restart) { - cmds = [ - 'prestop', 'stop', 'poststop', - 'restart', - 'prestart', 'start', 'poststart' - ] - } else { - if (pkg.scripts[cmd] == null) { - if (cmd === 'test') { - pkg.scripts.test = 'echo \'Error: no test specified\'' - } else if (cmd === 'env') { - if (isWindowsShell) { - log.verbose('run-script using default platform env: SET (Windows)') - pkg.scripts[cmd] = 'SET' - } else { - log.verbose('run-script using default platform env: env (Unix)') - pkg.scripts[cmd] = 'env' - } - } else if (npm.config.get('if-present')) { - return cb(null) - } else { - let suggestions = didYouMean(cmd, Object.keys(pkg.scripts)) - suggestions = suggestions ? '\n' + suggestions : '' - return cb(new Error('missing script: ' + cmd + suggestions)) - } + if (npm.flatOptions.parseable) { + for (const [script, cmd] of Object.entries(scripts)) { + output(`${script}:${cmd}`) } - cmds = [cmd] + return allScripts } - if (!cmd.match(/^(pre|post)/)) { - cmds = ['pre' + cmd].concat(cmds).concat('post' + cmd) + const indent = '\n ' + const prefix = ' ' + const cmds = [] + const runScripts = [] + for (const script of allScripts) { + const list = cmdList.includes(script) ? cmds : runScripts + list.push(script) } - log.verbose('run-script', cmds) - chain(cmds.map(function (c) { - // pass cli arguments after -- to script. - if (pkg.scripts[c] && c === cmd) { - pkg.scripts[c] = pkg.scripts[c] + joinArgs(args) - } - - // when running scripts explicitly, assume that they're trusted. - return [lifecycle, pkg, c, wd, { unsafePerm: true }] - }), cb) + if (cmds.length) { + output(`Lifecycle scripts included in ${name}:`) + } + for (const script of cmds) { + output(prefix + script + indent + scripts[script]) + } + if (!cmds.length && runScripts.length) { + output(`Scripts available in ${name} via \`npm run-script\`:`) + } else if (runScripts.length) { + output('\navailable via `npm run-script`:') + } + for (const script of runScripts) { + output(prefix + script + indent + scripts[script]) + } + return allScripts } -// join arguments after '--' and pass them to script, -// handle special characters such as ', ", ' '. -function joinArgs (args) { - var joinedArgs = '' - args.forEach(function (arg) { - joinedArgs += ' "' + arg.replace(/"/g, '\\"') + '"' - }) - return joinedArgs -} +module.exports = Object.assign(cmd, { completion, usage }) diff --git a/deps/npm/lib/search.js b/deps/npm/lib/search.js index 3c59f8b43d15bb..92397d842b8b4c 100644 --- a/deps/npm/lib/search.js +++ b/deps/npm/lib/search.js @@ -2,14 +2,13 @@ module.exports = exports = search +const Pipeline = require('minipass-pipeline') + const npm = require('./npm.js') -const allPackageSearch = require('./search/all-package-search') -const figgyPudding = require('figgy-pudding') const formatPackageStream = require('./search/format-package-stream.js') -const libSearch = require('libnpm/search') + +const libSearch = require('libnpmsearch') const log = require('npmlog') -const ms = require('mississippi') -const npmConfig = require('./config/figgy-config.js') const output = require('./utils/output.js') const usage = require('./utils/usage') @@ -22,26 +21,14 @@ search.completion = function (opts, cb) { cb(null, []) } -const SearchOpts = figgyPudding({ - description: {}, - exclude: {}, - include: {}, - limit: {}, - log: {}, - staleness: {}, - unicode: {} -}) - function search (args, cb) { - const opts = SearchOpts(npmConfig()).concat({ - description: npm.config.get('description'), - exclude: prepareExcludes(npm.config.get('searchexclude')), - include: prepareIncludes(args, npm.config.get('searchopts')), - limit: npm.config.get('searchlimit') || 20, - log: log, - staleness: npm.config.get('searchstaleness'), - unicode: npm.config.get('unicode') - }) + const opts = { + ...npm.flatOptions, + ...npm.flatOptions.search, + include: prepareIncludes(args, npm.flatOptions.search.opts), + exclude: prepareExcludes(npm.flatOptions.search.exclude) + } + if (opts.include.length === 0) { return cb(new Error('search must be called with arguments')) } @@ -49,49 +36,31 @@ function search (args, cb) { // Used later to figure out whether we had any packages go out let anyOutput = false - const entriesStream = ms.through.obj() - - let esearchWritten = false - libSearch.stream(opts.include, opts).on('data', pkg => { - entriesStream.write(pkg) - !esearchWritten && (esearchWritten = true) - }).on('error', err => { - if (esearchWritten) { - // If esearch errored after already starting output, we can't fall back. - return entriesStream.emit('error', err) - } - log.warn('search', 'fast search endpoint errored. Using old search.') - allPackageSearch(opts) - .on('data', pkg => entriesStream.write(pkg)) - .on('error', err => entriesStream.emit('error', err)) - .on('end', () => entriesStream.end()) - }).on('end', () => entriesStream.end()) - // Grab a configured output stream that will spit out packages in the // desired format. + // + // This is a text minipass stream var outputStream = formatPackageStream({ - args: args, // --searchinclude options are not highlighted - long: npm.config.get('long'), - description: npm.config.get('description'), - json: npm.config.get('json'), - parseable: npm.config.get('parseable'), - color: npm.color + args, // --searchinclude options are not highlighted + ...opts }) - outputStream.on('data', chunk => { + + log.silly('search', 'searching packages') + const p = new Pipeline(libSearch.stream(opts.include, opts), outputStream) + + p.on('data', chunk => { if (!anyOutput) { anyOutput = true } output(chunk.toString('utf8')) }) - log.silly('search', 'searching packages') - ms.pipe(entriesStream, outputStream, err => { - if (err) return cb(err) - if (!anyOutput && !npm.config.get('json') && !npm.config.get('parseable')) { + p.promise().then(() => { + if (!anyOutput && !opts.json && !opts.parseable) { output('No matches found for ' + (args.map(JSON.stringify).join(' '))) } log.silly('search', 'search completed') log.clearProgress() cb(null, {}) - }) + }, err => cb(err)) } function prepareIncludes (args, searchopts) { diff --git a/deps/npm/lib/search/all-package-metadata.js b/deps/npm/lib/search/all-package-metadata.js deleted file mode 100644 index 388b4f61f04968..00000000000000 --- a/deps/npm/lib/search/all-package-metadata.js +++ /dev/null @@ -1,325 +0,0 @@ -'use strict' - -const BB = require('bluebird') - -const cacheFile = require('npm-cache-filename') -const chownr = BB.promisify(require('chownr')) -const correctMkdir = BB.promisify(require('../utils/correct-mkdir.js')) -const figgyPudding = require('figgy-pudding') -const fs = require('graceful-fs') -const JSONStream = require('JSONStream') -const log = require('npmlog') -const mkdir = BB.promisify(require('gentle-fs').mkdir) -const ms = require('mississippi') -const npmFetch = require('libnpm/fetch') -const path = require('path') -const sortedUnionStream = require('sorted-union-stream') -const url = require('url') -const writeStreamAtomic = require('fs-write-stream-atomic') - -const statAsync = BB.promisify(fs.stat) - -const APMOpts = figgyPudding({ - cache: {}, - registry: {} -}) -// Returns a sorted stream of all package metadata. Internally, takes care of -// maintaining its metadata cache and making partial or full remote requests, -// according to staleness, validity, etc. -// -// The local cache must hold certain invariants: -// 1. It must be a proper JSON object -// 2. It must have its keys lexically sorted -// 3. The first entry must be `_updated` with a millisecond timestamp as a val. -// 4. It must include all entries that exist in the metadata endpoint as of -// the value in `_updated` -module.exports = allPackageMetadata -function allPackageMetadata (opts) { - const staleness = opts.staleness - const stream = ms.through.obj() - - opts = APMOpts(opts) - const cacheBase = cacheFile(path.resolve(path.dirname(opts.cache)))(url.resolve(opts.registry, '/-/all')) - const cachePath = path.join(cacheBase, '.cache.json') - createEntryStream( - cachePath, staleness, opts - ).then(({entryStream, latest, newEntries}) => { - log.silly('all-package-metadata', 'entry stream created') - if (entryStream && newEntries) { - return createCacheWriteStream(cachePath, latest, opts).then(writer => { - log.silly('all-package-metadata', 'output stream created') - ms.pipeline.obj(entryStream, writer, stream) - }) - } else if (entryStream) { - ms.pipeline.obj(entryStream, stream) - } else { - stream.emit('error', new Error('No search sources available')) - } - }).catch(err => stream.emit('error', err)) - return stream -} - -// Creates a stream of the latest available package metadata. -// Metadata will come from a combination of the local cache and remote data. -module.exports._createEntryStream = createEntryStream -function createEntryStream (cachePath, staleness, opts) { - return createCacheEntryStream( - cachePath, opts - ).catch(err => { - log.warn('', 'Failed to read search cache. Rebuilding') - log.silly('all-package-metadata', 'cache read error: ', err) - return {} - }).then(({ - updateStream: cacheStream, - updatedLatest: cacheLatest - }) => { - cacheLatest = cacheLatest || 0 - return createEntryUpdateStream(staleness, cacheLatest, opts).catch(err => { - log.warn('', 'Search data request failed, search might be stale') - log.silly('all-package-metadata', 'update request error: ', err) - return {} - }).then(({updateStream, updatedLatest}) => { - updatedLatest = updatedLatest || 0 - const latest = updatedLatest || cacheLatest - if (!cacheStream && !updateStream) { - throw new Error('No search sources available') - } - if (cacheStream && updateStream) { - // Deduped, unioned, sorted stream from the combination of both. - return { - entryStream: createMergedStream(cacheStream, updateStream), - latest, - newEntries: !!updatedLatest - } - } else { - // Either one works if one or the other failed - return { - entryStream: cacheStream || updateStream, - latest, - newEntries: !!updatedLatest - } - } - }) - }) -} - -// Merges `a` and `b` into one stream, dropping duplicates in favor of entries -// in `b`. Both input streams should already be individually sorted, and the -// returned output stream will have semantics resembling the merge step of a -// plain old merge sort. -module.exports._createMergedStream = createMergedStream -function createMergedStream (a, b) { - linkStreams(a, b) - return sortedUnionStream(b, a, ({name}) => name) -} - -// Reads the local index and returns a stream that spits out package data. -module.exports._createCacheEntryStream = createCacheEntryStream -function createCacheEntryStream (cacheFile, opts) { - log.verbose('all-package-metadata', 'creating entry stream from local cache') - log.verbose('all-package-metadata', cacheFile) - return statAsync(cacheFile).then(stat => { - // TODO - This isn't very helpful if `cacheFile` is empty or just `{}` - const entryStream = ms.pipeline.obj( - fs.createReadStream(cacheFile), - JSONStream.parse('*'), - // I believe this passthrough is necessary cause `jsonstream` returns - // weird custom streams that behave funny sometimes. - ms.through.obj() - ) - return extractUpdated(entryStream, 'cached-entry-stream', opts) - }) -} - -// Stream of entry updates from the server. If `latest` is `0`, streams the -// entire metadata object from the registry. -module.exports._createEntryUpdateStream = createEntryUpdateStream -function createEntryUpdateStream (staleness, latest, opts) { - log.verbose('all-package-metadata', 'creating remote entry stream') - let partialUpdate = false - let uri = '/-/all' - if (latest && (Date.now() - latest < (staleness * 1000))) { - // Skip the request altogether if our `latest` isn't stale. - log.verbose('all-package-metadata', 'Local data up to date, skipping update') - return BB.resolve({}) - } else if (latest === 0) { - log.warn('', 'Building the local index for the first time, please be patient') - log.verbose('all-package-metadata', 'No cached data: requesting full metadata db') - } else { - log.verbose('all-package-metadata', 'Cached data present with timestamp:', latest, 'requesting partial index update') - uri += '/since?stale=update_after&startkey=' + latest - partialUpdate = true - } - return npmFetch(uri, opts).then(res => { - log.silly('all-package-metadata', 'request stream opened, code:', res.statusCode) - let entryStream = ms.pipeline.obj( - res.body, - JSONStream.parse('*', (pkg, key) => { - if (key[0] === '_updated' || key[0][0] !== '_') { - return pkg - } - }) - ) - if (partialUpdate) { - // The `/all/since` endpoint doesn't return `_updated`, so we - // just use the request's own timestamp. - return { - updateStream: entryStream, - updatedLatest: Date.parse(res.headers.get('date')) - } - } else { - return extractUpdated(entryStream, 'entry-update-stream', opts) - } - }) -} - -// Both the (full) remote requests and the local index have `_updated` as their -// first returned entries. This is the "latest" unix timestamp for the metadata -// in question. This code does a bit of juggling with the data streams -// so that we can pretend that field doesn't exist, but still extract `latest` -function extractUpdated (entryStream, label, opts) { - log.silly('all-package-metadata', 'extracting latest') - return new BB((resolve, reject) => { - function nope (msg) { - return function () { - log.warn('all-package-metadata', label, msg) - entryStream.removeAllListeners() - entryStream.destroy() - reject(new Error(msg)) - } - } - const onErr = nope('Failed to read stream') - const onEnd = nope('Empty or invalid stream') - entryStream.on('error', onErr) - entryStream.on('end', onEnd) - entryStream.once('data', latest => { - log.silly('all-package-metadata', 'got first stream entry for', label, latest) - entryStream.removeListener('error', onErr) - entryStream.removeListener('end', onEnd) - if (typeof latest === 'number') { - // The extra pipeline is to return a stream that will implicitly unpause - // after having an `.on('data')` listener attached, since using this - // `data` event broke its initial state. - resolve({ - updateStream: entryStream.pipe(ms.through.obj()), - updatedLatest: latest - }) - } else { - reject(new Error('expected first entry to be _updated')) - } - }) - }) -} - -// Creates a stream that writes input metadata to the current cache. -// Cache updates are atomic, and the stream closes when *everything* is done. -// The stream is also passthrough, so entries going through it will also -// be output from it. -module.exports._createCacheWriteStream = createCacheWriteStream -function createCacheWriteStream (cacheFile, latest, opts) { - return _ensureCacheDirExists(cacheFile, opts).then(({uid, gid}) => { - log.silly('all-package-metadata', 'creating output stream') - const outStream = _createCacheOutStream() - const cacheFileStream = writeStreamAtomic(cacheFile) - const inputStream = _createCacheInStream( - cacheFileStream, outStream, latest - ) - - // Glue together the various streams so they fail together. - // `cacheFileStream` errors are already handled by the `inputStream` - // pipeline - let errEmitted = false - linkStreams(inputStream, outStream, () => { errEmitted = true }) - - cacheFileStream.on('close', () => { - if (!errEmitted) { - if (typeof uid === 'number' && - typeof gid === 'number' && - process.getuid && - process.getgid && - (process.getuid() !== uid || process.getgid() !== gid)) { - chownr.sync(cacheFile, uid, gid) - } - outStream.end() - } - }) - - return ms.duplex.obj(inputStream, outStream) - }) -} - -// return the {uid,gid} that the cache should have -function _ensureCacheDirExists (cacheFile, opts) { - var cacheBase = path.dirname(cacheFile) - log.silly('all-package-metadata', 'making sure cache dir exists at', cacheBase) - return correctMkdir(opts.cache).then(st => { - return mkdir(cacheBase).then(made => { - return chownr(made || cacheBase, st.uid, st.gid) - }).then(() => ({ uid: st.uid, gid: st.gid })) - }) -} - -function _createCacheOutStream () { - // NOTE: this looks goofy, but it's necessary in order to get - // JSONStream to play nice with the rest of everything. - return ms.pipeline.obj( - ms.through(), - JSONStream.parse('*', (obj, key) => { - // This stream happens to get _updated passed through it, for - // implementation reasons. We make sure to filter it out cause - // the fact that it comes t - if (typeof obj === 'object') { - return obj - } - }), - ms.through.obj() - ) -} - -function _createCacheInStream (writer, outStream, latest) { - let updatedWritten = false - const inStream = ms.pipeline.obj( - ms.through.obj((pkg, enc, cb) => { - if (!updatedWritten && typeof pkg === 'number') { - // This is the `_updated` value getting sent through. - updatedWritten = true - return cb(null, ['_updated', pkg]) - } else if (typeof pkg !== 'object') { - this.emit('error', new Error('invalid value written to input stream')) - } else { - // The [key, val] format is expected by `jsonstream` for object writing - cb(null, [pkg.name, pkg]) - } - }), - JSONStream.stringifyObject('{', ',', '}'), - ms.through((chunk, enc, cb) => { - // This tees off the buffer data to `outStream`, and then continues - // the pipeline as usual - outStream.write(chunk, enc, () => cb(null, chunk)) - }), - // And finally, we write to the cache file. - writer - ) - inStream.write(latest) - return inStream -} - -// Links errors between `a` and `b`, preventing cycles, and calls `cb` if -// an error happens, once per error. -function linkStreams (a, b, cb) { - var lastError = null - a.on('error', function (err) { - if (err !== lastError) { - lastError = err - b.emit('error', err) - cb && cb(err) - } - }) - b.on('error', function (err) { - if (err !== lastError) { - lastError = err - a.emit('error', err) - cb && cb(err) - } - }) -} diff --git a/deps/npm/lib/search/all-package-search.js b/deps/npm/lib/search/all-package-search.js deleted file mode 100644 index fef343bcbc3ba3..00000000000000 --- a/deps/npm/lib/search/all-package-search.js +++ /dev/null @@ -1,50 +0,0 @@ -var ms = require('mississippi') -var allPackageMetadata = require('./all-package-metadata') -var packageFilter = require('./package-filter.js') - -module.exports = allPackageSearch -function allPackageSearch (opts) { - var searchSection = (opts.unicode ? '🤔 ' : '') + 'search' - - // Get a stream with *all* the packages. This takes care of dealing - // with the local cache as well, but that's an internal detail. - var allEntriesStream = allPackageMetadata(opts) - - // Grab a stream that filters those packages according to given params. - var filterStream = streamFilter(function (pkg) { - opts.log.gauge.pulse('search') - opts.log.gauge.show({section: searchSection, logline: 'scanning ' + pkg.name}) - // Simply 'true' if the package matches search parameters. - var match = packageFilter(pkg, opts.include, opts.exclude, { - description: opts.description - }) - return match - }) - return ms.pipeline.obj(allEntriesStream, filterStream) -} - -function streamFilter (filter) { - return ms.through.obj(function (data, enc, cb) { - if (filter(data)) { - this.push(standardizePkg(data)) - } - cb() - }) -} - -function standardizePkg (data) { - return { - name: data.name, - description: data.description, - maintainers: (data.maintainers || []).map(function (m) { - return { username: m.name, email: m.email } - }), - keywords: data.keywords || [], - version: Object.keys(data.versions || {})[0] || [], - date: ( - data.time && - data.time.modified && - new Date(data.time.modified) - ) || null - } -} diff --git a/deps/npm/lib/search/format-package-stream.js b/deps/npm/lib/search/format-package-stream.js index bb0f552ba09d19..7a9f616136f95a 100644 --- a/deps/npm/lib/search/format-package-stream.js +++ b/deps/npm/lib/search/format-package-stream.js @@ -1,8 +1,10 @@ 'use strict' -var ms = require('mississippi') -var jsonstream = require('JSONStream') -var columnify = require('columnify') +// XXX these output classes should not live in here forever. it'd be good to +// split them out, perhaps to libnpmsearch + +const Minipass = require('minipass') +const columnify = require('columnify') // This module consumes package data in the following format: // @@ -18,29 +20,44 @@ var columnify = require('columnify') // The returned stream will format this package data // into a byte stream of formatted, displayable output. -module.exports = formatPackageStream -function formatPackageStream (opts) { - opts = opts || {} - if (opts.json) { - return jsonOutputStream() - } else { - return textOutputStream(opts) +module.exports = (opts = {}) => + opts.json ? new JSONOutputStream() : new TextOutputStream(opts) + +class JSONOutputStream extends Minipass { + constructor () { + super() + this._didFirst = false } -} -function jsonOutputStream () { - return ms.pipeline.obj( - ms.through.obj(), - jsonstream.stringify('[', ',', ']'), - ms.through() - ) + write (obj) { + if (!this._didFirst) { + super.write('[\n') + this._didFirst = true + } else { + super.write('\n,\n') + } + try { + return super.write(JSON.stringify(obj)) + } catch (er) { + return this.emit('error', er) + } + } + + end () { + super.write(this._didFirst ? ']\n' : '\n]\n') + } } -function textOutputStream (opts) { - var line = 0 - return ms.through.obj(function (pkg, enc, cb) { - cb(null, prettify(pkg, ++line, opts)) - }) +class TextOutputStream extends Minipass { + constructor (opts) { + super() + this._opts = opts + this._line = 0 + } + + write (pkg) { + return super.write(prettify(pkg, ++this._line, this._opts)) + } } function prettify (data, num, opts) { diff --git a/deps/npm/lib/search/package-filter.js b/deps/npm/lib/search/package-filter.js index 892adb08c96a50..142350eec999aa 100644 --- a/deps/npm/lib/search/package-filter.js +++ b/deps/npm/lib/search/package-filter.js @@ -7,7 +7,7 @@ function filter (data, include, exclude, opts) { } function getWords (data, opts) { - return [ data.name ] + return [data.name] .concat((opts && opts.description) ? data.description : []) .concat((data.maintainers || []).map(function (m) { return '=' + m.name diff --git a/deps/npm/lib/shrinkwrap.js b/deps/npm/lib/shrinkwrap.js index 5428e7255b81d9..ec759578c29681 100644 --- a/deps/npm/lib/shrinkwrap.js +++ b/deps/npm/lib/shrinkwrap.js @@ -1,296 +1,52 @@ -'use strict' - -const BB = require('bluebird') - -const chain = require('slide').chain -const detectIndent = require('detect-indent') -const detectNewline = require('detect-newline') -const readFile = BB.promisify(require('graceful-fs').readFile) -const getRequested = require('./install/get-requested.js') -const id = require('./install/deps.js') -const iferr = require('iferr') -const isOnlyOptional = require('./install/is-only-optional.js') -const isOnlyDev = require('./install/is-only-dev.js') -const lifecycle = require('./utils/lifecycle.js') -const log = require('npmlog') -const moduleName = require('./utils/module-name.js') -const move = require('move-concurrently') +const Arborist = require('@npmcli/arborist') const npm = require('./npm.js') -const path = require('path') -const readPackageTree = BB.promisify(require('read-package-tree')) -const ssri = require('ssri') -const stringifyPackage = require('stringify-package') -const validate = require('aproba') -const writeFileAtomic = require('write-file-atomic') -const unixFormatPath = require('./utils/unix-format-path.js') -const isRegistry = require('./utils/is-registry.js') - -const { chown } = require('fs') -const inferOwner = require('infer-owner') -const selfOwner = { - uid: process.getuid && process.getuid(), - gid: process.getgid && process.getgid() -} - -const PKGLOCK = 'package-lock.json' -const SHRINKWRAP = 'npm-shrinkwrap.json' -const PKGLOCK_VERSION = npm.lockfileVersion - -// emit JSON describing versions of all packages currently installed (for later -// use with shrinkwrap install) -shrinkwrap.usage = 'npm shrinkwrap' - -module.exports = exports = shrinkwrap -exports.treeToShrinkwrap = treeToShrinkwrap - -function shrinkwrap (args, silent, cb) { - if (typeof cb !== 'function') { - cb = silent - silent = false - } - - if (args.length) { - log.warn('shrinkwrap', "doesn't take positional args") - } - - move( - path.resolve(npm.prefix, PKGLOCK), - path.resolve(npm.prefix, SHRINKWRAP), - { Promise: BB } - ).then(() => { - log.notice('', `${PKGLOCK} has been renamed to ${SHRINKWRAP}. ${SHRINKWRAP} will be used for future installations.`) - return readFile(path.resolve(npm.prefix, SHRINKWRAP)).then((d) => { - return JSON.parse(d) - }) - }, (err) => { - if (err.code !== 'ENOENT') { - throw err - } else { - return readPackageTree(npm.localPrefix).then( - id.computeMetadata - ).then((tree) => { - return BB.fromNode((cb) => { - createShrinkwrap(tree, { - silent, - defaultFile: SHRINKWRAP - }, cb) - }) - }) - } - }).then((data) => cb(null, data), cb) -} - -module.exports.createShrinkwrap = createShrinkwrap - -function createShrinkwrap (tree, opts, cb) { - opts = opts || {} - lifecycle(tree.package, 'preshrinkwrap', tree.path, function () { - const pkginfo = treeToShrinkwrap(tree) - chain([ - [lifecycle, tree.package, 'shrinkwrap', tree.path], - [shrinkwrap_, tree.path, pkginfo, opts], - [lifecycle, tree.package, 'postshrinkwrap', tree.path] - ], iferr(cb, function (data) { - cb(null, pkginfo) - })) - }) -} - -function treeToShrinkwrap (tree) { - validate('O', arguments) - var pkginfo = {} - if (tree.package.name) pkginfo.name = tree.package.name - if (tree.package.version) pkginfo.version = tree.package.version - if (tree.children.length) { - pkginfo.requires = true - shrinkwrapDeps(pkginfo.dependencies = {}, tree, tree) - } - return pkginfo -} - -function shrinkwrapDeps (deps, top, tree, seen) { - validate('OOO', [deps, top, tree]) - if (!seen) seen = new Set() - if (seen.has(tree)) return - seen.add(tree) - sortModules(tree.children).forEach(function (child) { - var childIsOnlyDev = isOnlyDev(child) - var pkginfo = deps[moduleName(child)] = {} - var requested = getRequested(child) || child.package._requested || {} - var linked = child.isLink || child.isInLink - pkginfo.version = childVersion(top, child, requested) - if (requested.type === 'git' && child.package._from) { - pkginfo.from = child.package._from - } - if (child.fromBundle && !linked) { - pkginfo.bundled = true - } else { - if (isRegistry(requested)) { - pkginfo.resolved = child.package._resolved - } - // no integrity for git deps as integrity hashes are based on the - // tarball and we can't (yet) create consistent tarballs from a stable - // source. - if (requested.type !== 'git') { - pkginfo.integrity = child.package._integrity || undefined - if (!pkginfo.integrity && child.package._shasum) { - pkginfo.integrity = ssri.fromHex(child.package._shasum, 'sha1') - } - } - } - if (childIsOnlyDev) pkginfo.dev = true - if (isOnlyOptional(child)) pkginfo.optional = true - if (child.requires.length) { - pkginfo.requires = {} - sortModules(child.requires).forEach((required) => { - var requested = getRequested(required, child) || required.package._requested || {} - pkginfo.requires[moduleName(required)] = childRequested(top, required, requested) - }) - } - // iterate into children on non-links and links contained within the top level package - if (child.children.length) { - pkginfo.dependencies = {} - shrinkwrapDeps(pkginfo.dependencies, top, child, seen) - } - }) -} - -function sortModules (modules) { - // sort modules with the locale-agnostic Unicode sort - var sortedModuleNames = modules.map(moduleName).sort() - return modules.sort((a, b) => ( - sortedModuleNames.indexOf(moduleName(a)) - sortedModuleNames.indexOf(moduleName(b)) - )) -} +const usageUtil = require('./utils/usage.js') +const usage = usageUtil('shrinkwrap', 'npm shrinkwrap') +const { resolve, basename } = require('path') +const log = require('npmlog') -function childVersion (top, child, req) { - if (req.type === 'directory' || req.type === 'file') { - return 'file:' + unixFormatPath(path.relative(top.path, child.package._resolved || req.fetchSpec)) - } else if (!isRegistry(req) && !child.fromBundle) { - return child.package._resolved || req.saveSpec || req.rawSpec - } else if (req.type === 'alias') { - return `npm:${child.package.name}@${child.package.version}` - } else { - return child.package.version +const cmd = (args, cb) => shrinkwrap().then(() => cb()).catch(cb) + +const completion = require('./utils/completion/none.js') + +const shrinkwrap = async () => { + // if has a npm-shrinkwrap.json, nothing to do + // if has a package-lock.json, rename to npm-shrinkwrap.json + // if has neither, load the actual tree and save that as npm-shrinkwrap.json + // in all cases, re-cast to current lockfile version + // + // loadVirtual, fall back to loadActual + // rename shrinkwrap file type, and tree.meta.save() + if (npm.flatOptions.global) { + const er = new Error('`npm shrinkwrap` does not work for global packages') + er.code = 'ESHRINKWRAPGLOBAL' + throw er } -} -function childRequested (top, child, requested) { - if (requested.type === 'directory' || requested.type === 'file') { - return 'file:' + unixFormatPath(path.relative(top.path, child.package._resolved || requested.fetchSpec)) - } else if (requested.type === 'git' && child.package._from) { - return child.package._from - } else if (!isRegistry(requested) && !child.fromBundle) { - return child.package._resolved || requested.saveSpec || requested.rawSpec - } else if (requested.type === 'tag') { - // tags are not ranges we can match against, so we invent a "reasonable" - // one based on what we actually installed. - return npm.config.get('save-prefix') + child.package.version - } else if (requested.saveSpec || requested.rawSpec) { - return requested.saveSpec || requested.rawSpec - } else if (child.package._from || (child.package._requested && child.package._requested.rawSpec)) { - return child.package._from.replace(/^@?[^@]+@/, '') || child.package._requested.rawSpec + const path = npm.prefix + const sw = resolve(path, 'npm-shrinkwrap.json') + const arb = new Arborist({ ...npm.flatOptions, path }) + const tree = await arb.loadVirtual().catch(() => arb.loadActual()) + const { meta } = tree + const newFile = meta.hiddenLockfile || !meta.loadedFromDisk + const oldFilename = meta.filename + const notSW = !newFile && basename(oldFilename) !== 'npm-shrinkwrap.json' + const { promises: { unlink } } = require('fs') + + meta.hiddenLockfile = false + meta.filename = sw + await meta.save() + + if (newFile) { + log.notice('', 'created a lockfile as npm-shrinkwrap.json') + } else if (notSW) { + await unlink(oldFilename) + log.notice('', 'package-lock.json has been renamed to npm-shrinkwrap.json') + } else if (meta.originalLockfileVersion !== npm.lockfileVersion) { + log.notice('', `npm-shrinkwrap.json updated to version ${npm.lockfileVersion}`) } else { - return child.package.version - } -} - -function shrinkwrap_ (dir, pkginfo, opts, cb) { - save(dir, pkginfo, opts, cb) -} - -function save (dir, pkginfo, opts, cb) { - // copy the keys over in a well defined order - // because javascript objects serialize arbitrarily - BB.join( - checkPackageFile(dir, SHRINKWRAP), - checkPackageFile(dir, PKGLOCK), - checkPackageFile(dir, 'package.json'), - (shrinkwrap, lockfile, pkg) => { - const info = ( - shrinkwrap || - lockfile || - { - path: path.resolve(dir, opts.defaultFile || PKGLOCK), - data: '{}', - indent: pkg && pkg.indent, - newline: pkg && pkg.newline - } - ) - const updated = updateLockfileMetadata(pkginfo, pkg && JSON.parse(pkg.raw)) - const swdata = stringifyPackage(updated, info.indent, info.newline) - if (swdata === info.raw) { - // skip writing if file is identical - log.verbose('shrinkwrap', `skipping write for ${path.basename(info.path)} because there were no changes.`) - cb(null, pkginfo) - } else { - inferOwner(info.path).then(owner => { - writeFileAtomic(info.path, swdata, (err) => { - if (err) return cb(err) - if (opts.silent) return cb(null, pkginfo) - if (!shrinkwrap && !lockfile) { - log.notice('', `created a lockfile as ${path.basename(info.path)}. You should commit this file.`) - } - if (selfOwner.uid === 0 && (selfOwner.uid !== owner.uid || selfOwner.gid !== owner.gid)) { - chown(info.path, owner.uid, owner.gid, er => cb(er, pkginfo)) - } else { - cb(null, pkginfo) - } - }) - }) - } - } - ).then((file) => { - }, cb) -} - -function updateLockfileMetadata (pkginfo, pkgJson) { - // This is a lot of work just to make sure the extra metadata fields are - // between version and dependencies fields, without affecting any other stuff - const newPkg = {} - let metainfoWritten = false - const metainfo = new Set([ - 'lockfileVersion', - 'preserveSymlinks' - ]) - Object.keys(pkginfo).forEach((k) => { - if (k === 'dependencies') { - writeMetainfo(newPkg) - } - if (!metainfo.has(k)) { - newPkg[k] = pkginfo[k] - } - if (k === 'version') { - writeMetainfo(newPkg) - } - }) - if (!metainfoWritten) { - writeMetainfo(newPkg) - } - function writeMetainfo (pkginfo) { - pkginfo.lockfileVersion = PKGLOCK_VERSION - if (process.env.NODE_PRESERVE_SYMLINKS) { - pkginfo.preserveSymlinks = process.env.NODE_PRESERVE_SYMLINKS - } - metainfoWritten = true + log.notice('', 'npm-shrinkwrap.json up to date') } - return newPkg } -function checkPackageFile (dir, name) { - const file = path.resolve(dir, name) - return readFile( - file, 'utf8' - ).then((data) => { - const format = npm.config.get('format-package-lock') !== false - const indent = format ? detectIndent(data).indent : 0 - const newline = format ? detectNewline(data) : 0 - - return { - path: file, - raw: data, - indent, - newline - } - }).catch({code: 'ENOENT'}, () => {}) -} +module.exports = Object.assign(cmd, { usage, completion }) diff --git a/deps/npm/lib/star.js b/deps/npm/lib/star.js index 44a762b15c0c03..04b8285fb0555e 100644 --- a/deps/npm/lib/star.js +++ b/deps/npm/lib/star.js @@ -1,20 +1,12 @@ 'use strict' -const BB = require('bluebird') - -const fetch = require('libnpm/fetch') -const figgyPudding = require('figgy-pudding') +const fetch = require('npm-registry-fetch') const log = require('npmlog') -const npa = require('libnpm/parse-arg') +const npa = require('npm-package-arg') const npm = require('./npm.js') -const npmConfig = require('./config/figgy-config.js') const output = require('./utils/output.js') const usage = require('./utils/usage.js') -const whoami = require('./whoami.js') - -const StarConfig = figgyPudding({ - 'unicode': {} -}) +const getItentity = require('./utils/get-identity') star.usage = usage( 'star', @@ -30,21 +22,24 @@ star.completion = function (opts, cb) { module.exports = star function star (args, cb) { - const opts = StarConfig(npmConfig()) - return BB.try(() => { + const opts = npm.flatOptions + return Promise.resolve().then(() => { if (!args.length) throw new Error(star.usage) - let s = opts.unicode ? '\u2605 ' : '(*)' - const u = opts.unicode ? '\u2606 ' : '( )' - const using = !(npm.command.match(/^un/)) - if (!using) s = u - return BB.map(args.map(npa), pkg => { - return BB.all([ - whoami([pkg], true, () => {}), - fetch.json(pkg.escapedName, opts.concat({ + // if we're unstarring, then show an empty star image + // otherwise, show the full star image + const unstar = /^un/.test(npm.command) + const full = opts.unicode ? '\u2605 ' : '(*)' + const empty = opts.unicode ? '\u2606 ' : '( )' + const show = unstar ? empty : full + return Promise.all(args.map(npa).map(pkg => { + return Promise.all([ + getItentity(opts), + fetch.json(pkg.escapedName, { + ...opts, spec: pkg, - query: {write: true}, - 'prefer-online': true - })) + query: { write: true }, + preferOnline: true + }) ]).then(([username, fullData]) => { if (!username) { throw new Error('You need to be logged in!') } const body = { @@ -53,7 +48,7 @@ function star (args, cb) { users: fullData.users || {} } - if (using) { + if (!unstar) { log.info('star', 'starring', body._id) body.users[username] = true log.verbose('star', 'starring', body) @@ -62,16 +57,17 @@ function star (args, cb) { log.info('star', 'unstarring', body._id) log.verbose('star', 'unstarring', body) } - return fetch.json(pkg.escapedName, opts.concat({ + return fetch.json(pkg.escapedName, { + ...opts, spec: pkg, method: 'PUT', body - })) + }) }).then(data => { - output(s + ' ' + pkg.name) + output(show + ' ' + pkg.name) log.verbose('star', data) return data }) - }) - }).nodeify(cb) + })) + }).then(() => cb(), cb) } diff --git a/deps/npm/lib/stars.js b/deps/npm/lib/stars.js index 8b28baffd8c9a7..391e3ec86f2f72 100644 --- a/deps/npm/lib/stars.js +++ b/deps/npm/lib/stars.js @@ -1,37 +1,36 @@ 'use strict' -const BB = require('bluebird') - -const npmConfig = require('./config/figgy-config.js') -const fetch = require('libnpm/fetch') +const npm = require('./npm.js') +const fetch = require('npm-registry-fetch') const log = require('npmlog') const output = require('./utils/output.js') -const whoami = require('./whoami.js') +const getIdentity = require('./utils/get-identity.js') +const usageUtil = require('./utils/usage.js') +const usage = usageUtil('stars', 'npm stars []') +const completion = require('./utils/completion/none.js') -stars.usage = 'npm stars []' +const cmd = (args, cb) => stars(args).then(() => cb()).catch(cb) -module.exports = stars -function stars ([user], cb) { - const opts = npmConfig() - return BB.try(() => { - return (user ? BB.resolve(user) : whoami([], true, () => {})).then(usr => { - return fetch.json('/-/_view/starredByUser', opts.concat({ - query: {key: `"${usr}"`} // WHY. WHY THE ""?! - })) - }).then(data => data.rows).then(stars => { - if (stars.length === 0) { - log.warn('stars', 'user has not starred any packages.') - } else { - stars.forEach(s => output(s.value)) - } - }) - }).catch(err => { - if (err.code === 'ENEEDAUTH') { - throw Object.assign(new Error("'npm stars' on your own user account requires auth"), { - code: 'ENEEDAUTH' - }) - } else { - throw err +const stars = (args) => { + return stars_(args).catch(er => { + if (er.code === 'ENEEDAUTH') { + log.warn('star', 'auth is required to look up your username') } - }).nodeify(cb) + throw er + }) +} + +const stars_ = async ([user = getIdentity(npm.flatOptions)]) => { + const { rows } = await fetch.json('/-/_view/starredByUser', { + ...npm.flatOptions, + query: { key: `"${await user}"` } + }) + if (rows.length === 0) { + log.warn('stars', 'user has not starred any packages') + } + for (const row of rows) { + output(row.value) + } } + +module.exports = Object.assign(cmd, { usage, completion }) diff --git a/deps/npm/lib/substack.js b/deps/npm/lib/substack.js deleted file mode 100644 index 428e0a5898b6ee..00000000000000 --- a/deps/npm/lib/substack.js +++ /dev/null @@ -1,22 +0,0 @@ -module.exports = substack -var npm = require('./npm.js') -var output = require('./utils/output.js') - -var isms = [ - '\u001b[32mbeep \u001b[35mboop\u001b[m', - 'Replace your configs with services', - 'SEPARATE ALL THE CONCERNS!', - 'MODULE ALL THE THINGS!', - '\\o/', - 'but first, burritos', - 'full time mad scientist here', - 'c/,,\\' -] - -function substack (args, cb) { - var i = Math.floor(Math.random() * isms.length) - output(isms[i]) - var c = args.shift() - if (c) npm.commands[c](args, cb) - else cb() -} diff --git a/deps/npm/lib/team.js b/deps/npm/lib/team.js index e24f733475a23a..b0e15e3494eaab 100644 --- a/deps/npm/lib/team.js +++ b/deps/npm/lib/team.js @@ -1,18 +1,13 @@ -/* eslint-disable standard/no-callback-literal */ - const columns = require('cli-columns') -const figgyPudding = require('figgy-pudding') -const libteam = require('libnpm/team') -const npmConfig = require('./config/figgy-config.js') +const libteam = require('libnpmteam') +const npm = require('./npm.js') const output = require('./utils/output.js') const otplease = require('./utils/otplease.js') -const usage = require('./utils/usage') - -module.exports = team +const usageUtil = require('./utils/usage') -team.subcommands = ['create', 'destroy', 'add', 'rm', 'ls', 'edit'] +const subcommands = ['create', 'destroy', 'add', 'rm', 'ls', 'edit'] -team.usage = usage( +const usage = usageUtil( 'team', 'npm team create [--otp ]\n' + 'npm team destroy [--otp ]\n' + @@ -22,21 +17,10 @@ team.usage = usage( 'npm team edit ' ) -const TeamConfig = figgyPudding({ - json: {}, - loglevel: {}, - parseable: {}, - silent: {} -}) - -function UsageError () { - throw Object.assign(new Error(team.usage), {code: 'EUSAGE'}) -} - -team.completion = function (opts, cb) { - var argv = opts.conf.argv.remain +const completion = (opts, cb) => { + const { conf: { argv: { remain: argv } } } = opts if (argv.length === 2) { - return cb(null, team.subcommands) + return cb(null, subcommands) } switch (argv[2]) { case 'ls': @@ -51,10 +35,14 @@ team.completion = function (opts, cb) { } } -function team ([cmd, entity = '', user = ''], cb) { +const cmd = (args, cb) => team(args).then(() => cb()).catch(cb) + +const team = async ([cmd, entity = '', user = '']) => { // Entities are in the format : - otplease(npmConfig(), opts => { - opts = TeamConfig(opts).concat({description: null}) + // XXX: "description" option to libnpmteam is used as a description of the + // team, but in npm's options, this is a boolean meaning "show the + // description in npm search output". Hence its being set to null here. + await otplease(npm.flatOptions, opts => { entity = entity.replace(/^@/, '') switch (cmd) { case 'create': return teamCreate(entity, opts) @@ -72,100 +60,91 @@ function team ([cmd, entity = '', user = ''], cb) { case 'edit': throw new Error('`npm team edit` is not implemented yet.') default: - UsageError() + throw usage } - }).then( - data => cb(null, data), - err => err.code === 'EUSAGE' ? cb(err.message) : cb(err) - ) + }) } -function teamCreate (entity, opts) { - return libteam.create(entity, opts).then(() => { - if (opts.json) { - output(JSON.stringify({ - created: true, - team: entity - })) - } else if (opts.parseable) { - output(`${entity}\tcreated`) - } else if (!opts.silent && opts.loglevel !== 'silent') { - output(`+@${entity}`) - } - }) +const teamCreate = async (entity, opts) => { + await libteam.create(entity, opts) + if (opts.json) { + output(JSON.stringify({ + created: true, + team: entity + })) + } else if (opts.parseable) { + output(`${entity}\tcreated`) + } else if (!opts.silent && opts.loglevel !== 'silent') { + output(`+@${entity}`) + } } -function teamDestroy (entity, opts) { - return libteam.destroy(entity, opts).then(() => { - if (opts.json) { - output(JSON.stringify({ - deleted: true, - team: entity - })) - } else if (opts.parseable) { - output(`${entity}\tdeleted`) - } else if (!opts.silent && opts.loglevel !== 'silent') { - output(`-@${entity}`) - } - }) +const teamDestroy = async (entity, opts) => { + await libteam.destroy(entity, opts) + if (opts.json) { + output(JSON.stringify({ + deleted: true, + team: entity + })) + } else if (opts.parseable) { + output(`${entity}\tdeleted`) + } else if (!opts.silent && opts.loglevel !== 'silent') { + output(`-@${entity}`) + } } -function teamAdd (entity, user, opts) { - return libteam.add(user, entity, opts).then(() => { - if (opts.json) { - output(JSON.stringify({ - added: true, - team: entity, - user - })) - } else if (opts.parseable) { - output(`${user}\t${entity}\tadded`) - } else if (!opts.silent && opts.loglevel !== 'silent') { - output(`${user} added to @${entity}`) - } - }) +const teamAdd = async (entity, user, opts) => { + await libteam.add(user, entity, opts) + if (opts.json) { + output(JSON.stringify({ + added: true, + team: entity, + user + })) + } else if (opts.parseable) { + output(`${user}\t${entity}\tadded`) + } else if (!opts.silent && opts.loglevel !== 'silent') { + output(`${user} added to @${entity}`) + } } -function teamRm (entity, user, opts) { - return libteam.rm(user, entity, opts).then(() => { - if (opts.json) { - output(JSON.stringify({ - removed: true, - team: entity, - user - })) - } else if (opts.parseable) { - output(`${user}\t${entity}\tremoved`) - } else if (!opts.silent && opts.loglevel !== 'silent') { - output(`${user} removed from @${entity}`) - } - }) +const teamRm = async (entity, user, opts) => { + await libteam.rm(user, entity, opts) + if (opts.json) { + output(JSON.stringify({ + removed: true, + team: entity, + user + })) + } else if (opts.parseable) { + output(`${user}\t${entity}\tremoved`) + } else if (!opts.silent && opts.loglevel !== 'silent') { + output(`${user} removed from @${entity}`) + } } -function teamListUsers (entity, opts) { - return libteam.lsUsers(entity, opts).then(users => { - users = users.sort() - if (opts.json) { - output(JSON.stringify(users, null, 2)) - } else if (opts.parseable) { - output(users.join('\n')) - } else if (!opts.silent && opts.loglevel !== 'silent') { - output(`\n@${entity} has ${users.length} user${users.length === 1 ? '' : 's'}:\n`) - output(columns(users, {padding: 1})) - } - }) +const teamListUsers = async (entity, opts) => { + const users = (await libteam.lsUsers(entity, opts)).sort() + if (opts.json) { + output(JSON.stringify(users, null, 2)) + } else if (opts.parseable) { + output(users.join('\n')) + } else if (!opts.silent && opts.loglevel !== 'silent') { + output(`\n@${entity} has ${users.length} user${users.length === 1 ? '' : 's'}:\n`) + output(columns(users, { padding: 1 })) + } } -function teamListTeams (entity, opts) { - return libteam.lsTeams(entity, opts).then(teams => { - teams = teams.sort() - if (opts.json) { - output(JSON.stringify(teams, null, 2)) - } else if (opts.parseable) { - output(teams.join('\n')) - } else if (!opts.silent && opts.loglevel !== 'silent') { - output(`\n@${entity} has ${teams.length} team${teams.length === 1 ? '' : 's'}:\n`) - output(columns(teams.map(t => `@${t}`), {padding: 1})) - } - }) +const teamListTeams = async (entity, opts) => { + const teams = (await libteam.lsTeams(entity, opts)).sort() + if (opts.json) { + output(JSON.stringify(teams, null, 2)) + } else if (opts.parseable) { + output(teams.join('\n')) + } else if (!opts.silent && opts.loglevel !== 'silent') { + output(`\n@${entity} has ${teams.length} team${teams.length === 1 ? '' : 's'}:\n`) + output(columns(teams.map(t => `@${t}`), { padding: 1 })) + } } + +module.exports = Object.assign(cmd, { completion, usage }) diff --git a/deps/npm/lib/test.js b/deps/npm/lib/test.js index 05bffed86d59c1..2c721575599b0a 100644 --- a/deps/npm/lib/test.js +++ b/deps/npm/lib/test.js @@ -1,16 +1,12 @@ -/* eslint-disable standard/no-callback-literal */ -module.exports = test - const testCmd = require('./utils/lifecycle-cmd.js')('test') +const { completion, usage } = testCmd +const cmd = (args, cb) => testCmd(args, er => { + if (er && er.code === 'ELIFECYCLE') { + /* eslint-disable standard/no-callback-literal */ + cb('Test failed. See above for more details.') + } else { + cb(er) + } +}) -test.usage = testCmd.usage - -function test (args, cb) { - testCmd(args, function (er) { - if (!er) return cb() - if (er.code === 'ELIFECYCLE') { - return cb('Test failed. See above for more details.') - } - return cb(er) - }) -} +module.exports = Object.assign(cmd, { completion, usage }) diff --git a/deps/npm/lib/token.js b/deps/npm/lib/token.js index 96a05e45664f48..0cd8b7bc67d38a 100644 --- a/deps/npm/lib/token.js +++ b/deps/npm/lib/token.js @@ -1,13 +1,10 @@ 'use strict' -const profile = require('libnpm/profile') +const profile = require('npm-profile') const npm = require('./npm.js') -const figgyPudding = require('figgy-pudding') -const npmConfig = require('./config/figgy-config.js') const output = require('./utils/output.js') const otplease = require('./utils/otplease.js') const Table = require('cli-table3') -const Bluebird = require('bluebird') const isCidrV4 = require('is-cidr').v4 const isCidrV6 = require('is-cidr').v6 const readUserInfo = require('./utils/read-user-info.js') @@ -19,15 +16,27 @@ module.exports = token token._validateCIDRList = validateCIDRList -token.usage = +const usageUtil = require('./utils/usage.js') +token.usage = usageUtil('token', 'npm token list\n' + 'npm token revoke \n' + - 'npm token create [--read-only] [--cidr=list]\n' + 'npm token create [--read-only] [--cidr=list]') + +const UsageError = (msg) => + Object.assign(new Error(`\nUsage: ${msg}\n\n` + token.usage), { + code: 'EUSAGE' + }) + +const InvalidCIDRError = (msg) => + Object.assign(new Error(msg), { code: 'EINVALIDCIDR' }) token.subcommands = ['list', 'revoke', 'create'] token.completion = function (opts, cb) { var argv = opts.conf.argv.remain + if (argv.length === 2) { + return cb(null, token.subcommands) + } switch (argv[2]) { case 'list': @@ -61,7 +70,7 @@ function token (args, cb) { withCb(create(args.slice(1)), cb) break default: - cb(new Error('Unknown profile command: ' + args[0])) + cb(UsageError(`${args[0]} is not a recognized subcommand.`)) } } @@ -80,44 +89,28 @@ function generateTokenIds (tokens, minLength) { return byId } -const TokenConfig = figgyPudding({ - auth: {}, - registry: {}, - otp: {}, - cidr: {}, - 'read-only': {}, - json: {}, - parseable: {} -}) - function config () { - let conf = TokenConfig(npmConfig()) + const conf = { ...npm.flatOptions } const creds = npm.config.getCredentialsByURI(conf.registry) if (creds.token) { - conf = conf.concat({ - auth: { token: creds.token } - }) + conf.auth = { token: creds.token } } else if (creds.username) { - conf = conf.concat({ - auth: { - basic: { - username: creds.username, - password: creds.password - } + conf.auth = { + basic: { + username: creds.username, + password: creds.password } - }) + } } else if (creds.auth) { const auth = Buffer.from(creds.auth, 'base64').toString().split(':', 2) - conf = conf.concat({ - auth: { - basic: { - username: auth[0], - password: auth[1] - } + conf.auth = { + basic: { + username: auth[0], + password: auth[1] } - }) + } } else { - conf = conf.concat({ auth: {} }) + conf.auth = {} } if (conf.otp) conf.auth.otp = conf.otp return conf @@ -164,7 +157,7 @@ function list (args) { function rm (args) { if (args.length === 0) { - throw new Error('npm token revoke ') + return Promise.reject(UsageError('`` argument is required.')) } const conf = config() const toRemove = [] @@ -176,20 +169,20 @@ function rm (args) { if (matches.length === 1) { toRemove.push(matches[0].key) } else if (matches.length > 1) { - throw new Error(`Token ID "${id}" was ambiguous, a new token may have been created since you last ran \`npm-profile token list\`.`) + throw new Error(`Token ID "${id}" was ambiguous, a new token may have been created since you last ran \`npm token list\`.`) } else { const tokenMatches = tokens.filter((token) => id.indexOf(token.token) === 0) - if (tokenMatches === 0) { + if (tokenMatches.length === 0) { throw new Error(`Unknown token id or value "${id}".`) } toRemove.push(id) } }) - return Bluebird.map(toRemove, (key) => { + return Promise.all(toRemove.map(key => { return otplease(conf, conf => { return profile.removeToken(key, conf) }) - }) + })) })).then(() => { if (conf.json) { output(JSON.stringify(toRemove)) @@ -204,10 +197,10 @@ function rm (args) { function create (args) { const conf = config() const cidr = conf.cidr - const readonly = conf['read-only'] + const readonly = conf.readOnly - const validCIDR = validateCIDRList(cidr) return readUserInfo.password().then((password) => { + const validCIDR = validateCIDRList(cidr) log.info('token', 'creating') return pulseTillDone.withPromise(otplease(conf, conf => { return profile.createToken(password, readonly, validCIDR, conf) @@ -221,7 +214,7 @@ function create (args) { Object.keys(result).forEach((k) => output(k + '\t' + result[k])) } else { const table = new Table() - Object.keys(result).forEach((k) => table.push({[ansistyles.bright(k)]: String(result[k])})) + Object.keys(result).forEach((k) => table.push({ [ansistyles.bright(k)]: String(result[k]) })) output(table.toString()) } }) @@ -229,10 +222,10 @@ function create (args) { function validateCIDR (cidr) { if (isCidrV6(cidr)) { - throw new Error('CIDR whitelist can only contain IPv4 addresses, ' + cidr + ' is IPv6') + throw InvalidCIDRError('CIDR whitelist can only contain IPv4 addresses, ' + cidr + ' is IPv6') } if (!isCidrV4(cidr)) { - throw new Error('CIDR whitelist contains invalid CIDR entry: ' + cidr) + throw InvalidCIDRError('CIDR whitelist contains invalid CIDR entry: ' + cidr) } } diff --git a/deps/npm/lib/unbuild.js b/deps/npm/lib/unbuild.js deleted file mode 100644 index 3e8d3e4f1f3edb..00000000000000 --- a/deps/npm/lib/unbuild.js +++ /dev/null @@ -1,137 +0,0 @@ -module.exports = unbuild -module.exports.rmStuff = rmStuff -unbuild.usage = 'npm unbuild \n(this is plumbing)' - -const readJson = require('read-package-json') -const gentlyRm = require('./utils/gently-rm.js') -const npm = require('./npm.js') -const path = require('path') -const isInside = require('path-is-inside') -const lifecycle = require('./utils/lifecycle.js') -const asyncMap = require('slide').asyncMap -const chain = require('slide').chain -const log = require('npmlog') -const build = require('./build.js') -const output = require('./utils/output.js') - -// args is a list of folders. -// remove any bins/etc, and then delete the folder. -function unbuild (args, silent, cb) { - if (typeof silent === 'function') { - cb = silent - silent = false - } - asyncMap(args, unbuild_(silent), cb) -} - -function unbuild_ (silent) { - return function (folder, cb_) { - function cb (er) { - cb_(er, path.relative(npm.root, folder)) - } - folder = path.resolve(folder) - const base = isInside(folder, npm.prefix) ? npm.prefix : folder - delete build._didBuild[folder] - log.verbose('unbuild', folder.substr(npm.prefix.length + 1)) - readJson(path.resolve(folder, 'package.json'), function (er, pkg) { - // if no json, then just trash it, but no scripts or whatever. - if (er) return gentlyRm(folder, false, base, cb) - chain( - [ - [lifecycle, pkg, 'preuninstall', folder, { failOk: true }], - [lifecycle, pkg, 'uninstall', folder, { failOk: true }], - !silent && function (cb) { - output('unbuild ' + pkg._id) - cb() - }, - [rmStuff, pkg, folder], - [lifecycle, pkg, 'postuninstall', folder, { failOk: true }], - [gentlyRm, folder, false, base] - ], - cb - ) - }) - } -} - -function rmStuff (pkg, folder, cb) { - // if it's global, and folder is in {prefix}/node_modules, - // then bins are in {prefix}/bin - // otherwise, then bins are in folder/../.bin - const dir = path.dirname(folder) - const scope = path.basename(dir) - const parent = scope.charAt(0) === '@' ? path.dirname(dir) : dir - const gnm = npm.dir - // gnm might be an absolute path, parent might be relative - // this checks they're the same directory regardless - const top = path.relative(gnm, parent) === '' - - log.verbose('unbuild rmStuff', pkg._id, 'from', gnm) - if (!top) log.verbose('unbuild rmStuff', 'in', parent) - asyncMap([rmBins, rmMans], function (fn, cb) { - fn(pkg, folder, parent, top, cb) - }, cb) -} - -function rmBins (pkg, folder, parent, top, cb) { - if (!pkg.bin) return cb() - const binRoot = top ? npm.bin : path.resolve(parent, '.bin') - asyncMap(Object.keys(pkg.bin), function (b, cb) { - if (process.platform === 'win32') { - chain([ - [gentlyRm, path.resolve(binRoot, b) + '.ps1', true, folder], - [gentlyRm, path.resolve(binRoot, b) + '.cmd', true, folder], - [gentlyRm, path.resolve(binRoot, b), true, folder] - ], cb) - } else { - gentlyRm(path.resolve(binRoot, b), true, folder, cb) - } - }, gentlyRmBinRoot) - - function gentlyRmBinRoot (err) { - if (err || top) return cb(err) - return gentlyRm(binRoot, true, parent, cb) - } -} - -function rmMans (pkg, folder, parent, top, cb) { - if (!pkg.man || - !top || - process.platform === 'win32' || - !npm.config.get('global')) { - return cb() - } - const manRoot = path.resolve(npm.config.get('prefix'), 'share', 'man') - log.verbose('rmMans', 'man files are', pkg.man, 'in', manRoot) - asyncMap(pkg.man, function (man, cb) { - if (Array.isArray(man)) { - man.forEach(rmMan) - } else { - rmMan(man) - } - - function rmMan (man) { - log.silly('rmMan', 'preparing to remove', man) - const parseMan = man.match(/(.*\.([0-9]+)(\.gz)?)$/) - if (!parseMan) { - log.error( - 'rmMan', man, 'is not a valid name for a man file.', - 'Man files must end with a number, ' + - 'and optionally a .gz suffix if they are compressed.' - ) - return cb() - } - - const stem = parseMan[1] - const sxn = parseMan[2] - const gz = parseMan[3] || '' - const bn = path.basename(stem) - const manDest = path.join( - manRoot, - 'man' + sxn, - (bn.indexOf(pkg.name) === 0 ? bn : pkg.name + '-' + bn) + '.' + sxn + gz - ) - gentlyRm(manDest, true, cb) - } - }, cb) -} diff --git a/deps/npm/lib/uninstall.js b/deps/npm/lib/uninstall.js index c4bd23ea319959..58e2f61a822f29 100644 --- a/deps/npm/lib/uninstall.js +++ b/deps/npm/lib/uninstall.js @@ -1,79 +1,45 @@ -'use strict' // remove a package. -module.exports = uninstall - -const path = require('path') -const validate = require('aproba') -const readJson = require('read-package-json') -const iferr = require('iferr') +const Arborist = require('@npmcli/arborist') const npm = require('./npm.js') -const Installer = require('./install.js').Installer -const getSaveType = require('./install/save.js').getSaveType -const removeDeps = require('./install/deps.js').removeDeps -const log = require('npmlog') -const usage = require('./utils/usage') - -uninstall.usage = usage( - 'uninstall', - 'npm uninstall [<@scope>/][@]... [--save-prod|--save-dev|--save-optional] [--no-save]' -) +const rpj = require('read-package-json-fast') +const { resolve } = require('path') +const usageUtil = require('./utils/usage.js') +const reifyOutput = require('./utils/reify-output.js') -uninstall.completion = require('./utils/completion/installed-shallow.js') +const cmd = (args, cb) => rm(args).then(() => cb()).catch(cb) -function uninstall (args, cb) { - validate('AF', arguments) +const rm = async args => { // the /path/to/node_modules/.. - const dryrun = !!npm.config.get('dry-run') - - if (args.length === 1 && args[0] === '.') args = [] + const { global, prefix } = npm.flatOptions + const path = global ? resolve(npm.globalDir, '..') : prefix + + if (!args.length) { + if (!global) { + throw new Error('must provide a package name to remove') + } else { + const pkg = await rpj(resolve(npm.localPrefix, 'package.json')) + .catch(er => { + throw er.code !== 'ENOENT' && er.code !== 'ENOTDIR' ? er : usage() + }) + args.push(pkg.name) + } + } - const where = npm.config.get('global') || !args.length - ? path.resolve(npm.globalDir, '..') - : npm.prefix + const arb = new Arborist({ ...npm.flatOptions, path }) - args = args.filter(function (a) { - return path.resolve(a) !== where + await arb.reify({ + ...npm.flatOptions, + rm: args }) - - if (args.length) { - new Uninstaller(where, dryrun, args).run(cb) - } else { - // remove this package from the global space, if it's installed there - readJson(path.resolve(npm.localPrefix, 'package.json'), function (er, pkg) { - if (er && er.code !== 'ENOENT' && er.code !== 'ENOTDIR') return cb(er) - if (er) return cb(uninstall.usage) - new Uninstaller(where, dryrun, [pkg.name]).run(cb) - }) - } + reifyOutput(arb) } -class Uninstaller extends Installer { - constructor (where, dryrun, args) { - super(where, dryrun, args) - this.remove = [] - } - - loadArgMetadata (next) { - this.args = this.args.map(function (arg) { return {name: arg} }) - next() - } - - loadAllDepsIntoIdealTree (cb) { - validate('F', arguments) - this.remove = this.args - this.args = [] - log.silly('uninstall', 'loadAllDepsIntoIdealTree') - const saveDeps = getSaveType() - - super.loadAllDepsIntoIdealTree(iferr(cb, () => { - removeDeps(this.remove, this.idealTree, saveDeps, cb) - })) - } +const usage = usageUtil( + 'uninstall', + 'npm uninstall [<@scope>/][@]... [--save-prod|--save-dev|--save-optional] [--no-save]' +) - // no top level lifecycles on rm - runPreinstallTopLevelLifecycles (cb) { cb() } - runPostinstallTopLevelLifecycles (cb) { cb() } -} +const completion = require('./utils/completion/installed-shallow.js') -module.exports.Uninstaller = Uninstaller +module.exports = Object.assign(cmd, { usage, completion }) diff --git a/deps/npm/lib/unpublish.js b/deps/npm/lib/unpublish.js index 59d7d1b5887d21..ec0f149c5cc4de 100644 --- a/deps/npm/lib/unpublish.js +++ b/deps/npm/lib/unpublish.js @@ -1,114 +1,105 @@ -/* eslint-disable standard/no-callback-literal */ -'use strict' - -module.exports = unpublish - -const BB = require('bluebird') - -const figgyPudding = require('figgy-pudding') -const libaccess = require('libnpm/access') -const libunpub = require('libnpm/unpublish') +const path = require('path') +const util = require('util') const log = require('npmlog') const npa = require('npm-package-arg') -const npm = require('./npm.js') -const npmConfig = require('./config/figgy-config.js') +const libaccess = require('libnpmaccess') const npmFetch = require('npm-registry-fetch') -const otplease = require('./utils/otplease.js') +const libunpub = require('libnpmpublish').unpublish +const readJson = util.promisify(require('read-package-json')) + +const npm = require('./npm.js') +const usageUtil = require('./utils/usage.js') const output = require('./utils/output.js') -const path = require('path') -const readJson = BB.promisify(require('read-package-json')) -const usage = require('./utils/usage.js') -const whoami = BB.promisify(require('./whoami.js')) - -unpublish.usage = usage( - 'unpublish', - '\nnpm unpublish [<@scope>/]@' + - '\nnpm unpublish [<@scope>/] --force' -) - -function UsageError () { - throw Object.assign(new Error(`Usage: ${unpublish.usage}`), { - code: 'EUSAGE' - }) -} +const otplease = require('./utils/otplease.js') +const whoami = util.promisify(require('./whoami.js')) + +const usage = usageUtil('unpublish', 'npm unpublish [<@scope>/][@]') + +const cmd = (args, cb) => unpublish(args).then(() => cb()).catch(cb) + +const completion = (args, cb) => completionFn(args) + .then((res) => cb(null, res)) + .catch(cb) + +const completionFn = async (args) => { + const { partialWord, conf } = args + + if (conf.argv.remain.length >= 3) return -const UnpublishConfig = figgyPudding({ - force: {}, - loglevel: {}, - silent: {} -}) - -unpublish.completion = function (cliOpts, cb) { - if (cliOpts.conf.argv.remain.length >= 3) return cb() - - whoami([], true).then(username => { - if (!username) { return [] } - const opts = UnpublishConfig(npmConfig()) - return libaccess.lsPackages(username, opts).then(access => { - // do a bit of filtering at this point, so that we don't need - // to fetch versions for more than one thing, but also don't - // accidentally a whole project. - let pkgs = Object.keys(access) - if (!cliOpts.partialWord || !pkgs.length) { return pkgs } - const pp = npa(cliOpts.partialWord).name - pkgs = pkgs.filter(p => !p.indexOf(pp)) - if (pkgs.length > 1) return pkgs - return npmFetch.json(npa(pkgs[0]).escapedName, opts).then(doc => { - const vers = Object.keys(doc.versions) - if (!vers.length) { - return pkgs - } else { - return vers.map(v => `${pkgs[0]}@${v}`) - } - }) - }) - }).nodeify(cb) + const username = await whoami([], true) + if (!username) { return [] } + const opts = npm.flatOptions + + const access = await libaccess.lsPackages(username, opts) + // do a bit of filtering at this point, so that we don't need + // to fetch versions for more than one thing, but also don't + // accidentally a whole project + let pkgs = Object.keys(access) + if (!partialWord || !pkgs.length) return pkgs + + const pp = npa(partialWord).name + pkgs = pkgs.filter(p => !p.indexOf(pp)) + if (pkgs.length > 1) return pkgs + + const json = await npmFetch.json(npa(pkgs[0]).escapedName, opts) + const versions = Object.keys(json.versions) + if (!versions.length) { + return pkgs + } else { + return versions.map(v => `${pkgs[0]}@${v}`) + } } -function unpublish (args, cb) { - if (args.length > 1) return cb(unpublish.usage) +async function unpublish (args) { + if (args.length > 1) throw usage const spec = args.length && npa(args[0]) - const opts = UnpublishConfig(npmConfig()) - const version = spec.rawSpec - BB.try(() => { - log.silly('unpublish', 'args[0]', args[0]) - log.silly('unpublish', 'spec', spec) - if (!version && !opts.force) { - throw Object.assign(new Error( - 'Refusing to delete entire project.\n' + - 'Run with --force to do this.\n' + - unpublish.usage - ), { code: 'EUSAGE' }) - } - if (!spec || path.resolve(spec.name) === npm.localPrefix) { - // if there's a package.json in the current folder, then - // read the package name and version out of that. - const cwdJson = path.join(npm.localPrefix, 'package.json') - return readJson(cwdJson).then(data => { - log.verbose('unpublish', data) - return otplease(opts, opts => { - return libunpub(npa.resolve(data.name, data.version), opts.concat(data.publishConfig)) - }) - }, err => { - if (err && err.code !== 'ENOENT' && err.code !== 'ENOTDIR') { - throw err - } else { - UsageError() - } - }) - } else { - return otplease(opts, opts => libunpub(spec, opts)) - } - }).then( - ret => { - if (!opts.silent && opts.loglevel !== 'silent') { - output(`- ${spec.name}${ - spec.type === 'version' ? `@${spec.rawSpec}` : '' - }`) + const opts = npm.flatOptions + const { force, silent, loglevel } = opts + let ret + + log.silly('unpublish', 'args[0]', args[0]) + log.silly('unpublish', 'spec', spec) + + if (!spec.rawSpec && !force) { + throw ( + 'Refusing to delete entire project.\n' + + 'Run with --force to do this.\n' + + usage + ) + } + + if (!spec || path.resolve(spec.name) === npm.localPrefix) { + // if there's a package.json in the current folder, then + // read the package name and version out of that. + const pkgJson = path.join(npm.localPrefix, 'package.json') + const manifest = await readJson(pkgJson) + + log.verbose('unpublish', manifest) + + const { name, version, publishConfig } = manifest + const pkgJsonSpec = npa.resolve(name, version) + + try { + ret = await otplease(opts, opts => libunpub(pkgJsonSpec, { ...opts, publishConfig })) + } catch (err) { + if (err && err.code !== 'ENOENT' && err.code !== 'ENOTDIR') { + throw err + } else { + throw `Usage: ${usage}` } - cb(null, ret) - }, - err => err.code === 'EUSAGE' ? cb(err.message) : cb(err) - ) + } + } else { + ret = await otplease(opts, opts => libunpub(spec, opts)) + } + + if (!silent && loglevel !== 'silent') { + output(`- ${spec.name}${ + spec.type === 'version' ? `@${spec.rawSpec}` : '' + }`) + } + + return ret } + +module.exports = Object.assign(cmd, { completion, usage }) diff --git a/deps/npm/lib/update.js b/deps/npm/lib/update.js index fdb934fac6730f..7f777315351498 100644 --- a/deps/npm/lib/update.js +++ b/deps/npm/lib/update.js @@ -1,72 +1,38 @@ -'use strict' -module.exports = update +const path = require('path') +const Arborist = require('@npmcli/arborist') -const url = require('url') const log = require('npmlog') -const Bluebird = require('bluebird') const npm = require('./npm.js') -const Installer = require('./install.js').Installer -const usage = require('./utils/usage') -const outdated = Bluebird.promisify(npm.commands.outdated) +const usageUtil = require('./utils/usage.js') +const reifyOutput = require('./utils/reify-output.js') +const completion = require('./utils/completion/installed-deep.js') -update.usage = usage( +const usage = usageUtil( 'update', 'npm update [-g] [...]' ) -update.completion = npm.commands.outdated.completion +const cmd = (args, cb) => update(args).then(() => cb()).catch(cb) -function update (args, cb) { - return update_(args).asCallback(cb) -} - -function update_ (args) { - let dryrun = false - if (npm.config.get('dry-run')) dryrun = true - - log.verbose('update', 'computing outdated modules to update') - return outdated(args, true).then((rawOutdated) => { - const outdated = rawOutdated.map(function (ww) { - return { - dep: ww[0], - depname: ww[1], - current: ww[2], - wanted: ww[3], - latest: ww[4], - req: ww[5], - what: ww[1] + '@' + ww[3] - } - }) - - const wanted = outdated.filter(function (ww) { - if (ww.current === ww.wanted && ww.wanted !== ww.latest) { - log.verbose( - 'outdated', - 'not updating', ww.depname, - "because it's currently at the maximum version that matches its specified semver range" - ) - } - return ww.current !== ww.wanted - }) - if (wanted.length === 0) return +const update = async args => { + const update = args.length === 0 ? true : args + const global = path.resolve(npm.globalDir, '..') + const where = npm.flatOptions.global + ? global + : npm.prefix - log.info('outdated', 'updating', wanted) - const toInstall = {} + if (npm.flatOptions.depth) { + log.warn('update', 'The --depth option no longer has any effect. See RFC0019.\n' + + 'https://github.com/npm/rfcs/blob/latest/accepted/0019-remove-update-depth-option.md') + } - wanted.forEach(function (ww) { - // use the initial installation method (repo, tar, git) for updating - if (url.parse(ww.req).protocol) ww.what = ww.req - - const where = (ww.dep.parent && ww.dep.parent.path) || ww.dep.path - const isTransitive = !(ww.dep.requiredBy || []).some((p) => p.isTop) - const key = where + ':' + String(isTransitive) - if (!toInstall[key]) toInstall[key] = {where: where, opts: {saveOnlyLock: isTransitive}, what: []} - if (toInstall[key].what.indexOf(ww.what) === -1) toInstall[key].what.push(ww.what) - }) - return Bluebird.each(Object.keys(toInstall), (key) => { - const deps = toInstall[key] - const inst = new Installer(deps.where, dryrun, deps.what, deps.opts) - return inst.run() - }) + const arb = new Arborist({ + ...npm.flatOptions, + path: where }) + + await arb.reify({ update }) + reifyOutput(arb) } + +module.exports = Object.assign(cmd, { usage, completion }) diff --git a/deps/npm/lib/utils/cache-file.js b/deps/npm/lib/utils/cache-file.js index 7b3136b2e2db93..9db253a3bd097d 100644 --- a/deps/npm/lib/utils/cache-file.js +++ b/deps/npm/lib/utils/cache-file.js @@ -1,9 +1,8 @@ -// XXX use infer-owner or gentle-fs.mkdir here const npm = require('../npm.js') const path = require('path') const chownr = require('chownr') const writeFileAtomic = require('write-file-atomic') -const mkdirp = require('mkdirp') +const mkdirp = require('mkdirp-infer-owner') const fs = require('graceful-fs') let cache = null diff --git a/deps/npm/lib/utils/cleanup-log-files.js b/deps/npm/lib/utils/cleanup-log-files.js new file mode 100644 index 00000000000000..a2c28e2e871b71 --- /dev/null +++ b/deps/npm/lib/utils/cleanup-log-files.js @@ -0,0 +1,35 @@ +// module to clean out the old log files in cache/_logs +// this is a best-effort attempt. if a rm fails, we just +// log a message about it and move on. We do return a +// Promise that succeeds when we've tried to delete everything, +// just for the benefit of testing this function properly. + +const { resolve } = require('path') +const rimraf = require('rimraf') +const glob = require('glob') +module.exports = (cache, max, warn) => { + /* eslint-disable promise/param-names */ + return new Promise(done => { + glob(resolve(cache, '_logs', '*-debug.log'), (er, files) => { + if (er) { + return done() + } + + let pending = files.length - max + if (pending <= 0) { + return done() + } + + for (let i = 0; i < files.length - max; i++) { + rimraf(files[i], (er) => { + if (er) { + warn('log', 'failed to remove log file', files[i]) + } + if (--pending === 0) { + done() + } + }) + } + }) + }) +} diff --git a/deps/npm/lib/utils/cmd-list.js b/deps/npm/lib/utils/cmd-list.js new file mode 100644 index 00000000000000..6328d80d5c1a00 --- /dev/null +++ b/deps/npm/lib/utils/cmd-list.js @@ -0,0 +1,143 @@ +// short names for common things +const shorthands = { + un: 'uninstall', + rb: 'rebuild', + list: 'ls', + ln: 'link', + create: 'init', + i: 'install', + it: 'install-test', + cit: 'install-ci-test', + up: 'update', + c: 'config', + s: 'search', + se: 'search', + unstar: 'star', // same function + tst: 'test', + t: 'test', + ddp: 'dedupe', + v: 'view', + run: 'run-script', + 'clean-install': 'ci', + 'clean-install-test': 'cit', + x: 'exec', + why: 'explain' +} + +const affordances = { + la: 'll', + verison: 'version', + ic: 'ci', + innit: 'init', + // manually abbrev so that install-test doesn't make insta stop working + in: 'install', + ins: 'install', + inst: 'install', + insta: 'install', + instal: 'install', + isnt: 'install', + isnta: 'install', + isntal: 'install', + 'install-clean': 'ci', + 'isntall-clean': 'ci', + hlep: 'help', + 'dist-tags': 'dist-tag', + upgrade: 'update', + udpate: 'update', + login: 'adduser', + 'add-user': 'adduser', + author: 'owner', + home: 'docs', + issues: 'bugs', + info: 'view', + show: 'view', + find: 'search', + add: 'install', + unlink: 'uninstall', + remove: 'uninstall', + rm: 'uninstall', + r: 'uninstall', + rum: 'run-script', + sit: 'cit', + urn: 'run-script', + ogr: 'org' +} + +// these are filenames in . +const cmdList = [ + 'ci', + 'install-ci-test', + 'install', + 'install-test', + 'uninstall', + 'cache', + 'config', + 'set', + 'get', + 'update', + 'outdated', + 'prune', + 'pack', + 'find-dupes', + 'dedupe', + 'hook', + + 'rebuild', + 'link', + + 'publish', + 'star', + 'stars', + 'adduser', + 'login', // This is an alias for `adduser` but it can be confusing + 'logout', + 'unpublish', + 'owner', + 'access', + 'team', + 'deprecate', + 'shrinkwrap', + 'token', + 'profile', + 'audit', + 'fund', + 'org', + + 'help', + 'ls', + 'll', + 'search', + 'view', + 'init', + 'version', + 'edit', + 'explore', + 'docs', + 'repo', + 'bugs', + 'root', + 'prefix', + 'bin', + 'whoami', + 'dist-tag', + 'ping', + + 'test', + 'stop', + 'start', + 'restart', + 'run-script', + 'completion', + 'doctor', + 'exec', + 'explain' +] + +const plumbing = ['birthday', 'help-search'] +module.exports = { + aliases: Object.assign({}, shorthands, affordances), + shorthands, + affordances, + cmdList, + plumbing +} diff --git a/deps/npm/lib/utils/completion/file-completion.js b/deps/npm/lib/utils/completion/file-completion.js index e16b636a684d19..e4daa4dd4cc00b 100644 --- a/deps/npm/lib/utils/completion/file-completion.js +++ b/deps/npm/lib/utils/completion/file-completion.js @@ -1,16 +1,14 @@ module.exports = fileCompletion -var mkdir = require('mkdirp') -var glob = require('glob') +const mkdir = require('mkdirp') +const glob = require('glob') function fileCompletion (root, req, depth, cb) { if (typeof cb !== 'function') { cb = depth depth = Infinity } - mkdir(root, function (er) { - if (er) return cb(er) - + mkdir(root).catch(cb).then(() => { // can be either exactly the req, or a descendent var pattern = root + '/{' + req + ',' + req + '/**/*}' var opts = { mark: true, dot: true, maxDepth: depth } diff --git a/deps/npm/lib/utils/completion/installed-deep.js b/deps/npm/lib/utils/completion/installed-deep.js index dc9bfbee8a2da7..8337757bb268c6 100644 --- a/deps/npm/lib/utils/completion/installed-deep.js +++ b/deps/npm/lib/utils/completion/installed-deep.js @@ -1,52 +1,46 @@ -module.exports = installedDeep +'use strict' -var npm = require('../../npm.js') -var readInstalled = require('read-installed') +const { resolve } = require('path') +const Arborist = require('@npmcli/arborist') +const npm = require('../../npm.js') -function installedDeep (opts, cb) { - var local - var global - var depth = npm.config.get('depth') - var opt = { depth: depth, dev: true } - - if (npm.config.get('global')) { - local = [] - next() - } else { - readInstalled(npm.prefix, opt, function (er, data) { - local = getNames(data || {}) - next() - }) - } +const readNames = async () => { + const { + depth, + global, + prefix + } = npm.flatOptions - readInstalled(npm.config.get('prefix'), opt, function (er, data) { - global = getNames(data || {}) - next() - }) + const getValues = (tree) => + [...tree.inventory.values()] + .map(i => { + return i + }) + .filter(i => (i.depth - 1) <= depth) + .sort((a, b) => a.depth - b.depth) + .sort((a, b) => a.depth === b.depth ? a.name.localeCompare(b.name) : 0) - function getNames_ (d, n) { - if (d.realName && n) { - if (n[d.realName]) return n - n[d.realName] = true - } - if (!n) n = {} - Object.keys(d.dependencies || {}).forEach(function (dep) { - getNames_(d.dependencies[dep], n) - }) - return n - } - function getNames (d) { - return Object.keys(getNames_(d)) + const res = new Set() + const gArb = new Arborist({ global: true, path: resolve(npm.globalDir, '..') }) + const gTree = await gArb.loadActual({ global: true }) + + for (const node of getValues(gTree)) { + res.add(global ? node.name : [node.name, '-g']) } - function next () { - if (!local || !global) return - if (!npm.config.get('global')) { - global = global.map(function (g) { - return [g, '-g'] - }) + if (!global) { + const arb = new Arborist({ global: false, path: prefix }) + const tree = await arb.loadActual() + for (const node of getValues(tree)) { + res.add(node.name) } - var names = local.concat(global) - return cb(null, names) } + + return [...res] } + +function installedDeep (opts, cb) { + return readNames().then(res => cb(null, res)).catch(cb) +} + +module.exports = installedDeep diff --git a/deps/npm/lib/utils/completion/installed-shallow.js b/deps/npm/lib/utils/completion/installed-shallow.js index bf692fedea3a5d..5a7a5932ff8685 100644 --- a/deps/npm/lib/utils/completion/installed-shallow.js +++ b/deps/npm/lib/utils/completion/installed-shallow.js @@ -1,87 +1,20 @@ +const npm = require('../../npm.js') +const { promisify } = require('util') +const readdir = promisify(require('readdir-scoped-modules')) -module.exports = installedShallow +const names = global => readdir(global ? npm.globalDir : npm.localDir) -var npm = require('../../npm.js') -var fs = require('graceful-fs') -var path = require('path') -var readJson = require('read-package-json') -var asyncMap = require('slide').asyncMap - -function installedShallow (opts, filter, cb) { - if (typeof cb !== 'function') { - cb = filter - filter = null - } - var conf = opts.conf - var args = conf.argv.remain - if (args.length > 3) return cb() - var local - var global - var localDir = npm.dir - var globalDir = npm.globalDir - if (npm.config.get('global')) { - local = [] - next() - } else { - fs.readdir(localDir, function (er, pkgs) { - local = (pkgs || []).filter(function (p) { - return p.charAt(0) !== '.' - }) - next() - }) +const installedShallow = async opts => { + const { conf: { argv: { remain } } } = opts + if (remain.length > 3) { + return null } - fs.readdir(globalDir, function (er, pkgs) { - global = (pkgs || []).filter(function (p) { - return p.charAt(0) !== '.' - }) - next() - }) - function next () { - if (!local || !global) return - filterInstalled(local, global, filter, cb) - } + const { global } = npm.flatOptions + const locals = global ? [] : await names(false) + const globals = (await names(true)).map(n => global ? n : `${n} -g`) + return [...locals, ...globals] } -function filterInstalled (local, global, filter, cb) { - var fl - var fg - - if (!filter) { - fl = local - fg = global - return next() - } - - asyncMap(local, function (p, cb) { - readJson(path.join(npm.dir, p, 'package.json'), function (er, d) { - if (!d || !filter(d)) return cb(null, []) - return cb(null, d.name) - }) - }, function (er, local) { - fl = local || [] - next() - }) - - var globalDir = npm.globalDir - asyncMap(global, function (p, cb) { - readJson(path.join(globalDir, p, 'package.json'), function (er, d) { - if (!d || !filter(d)) return cb(null, []) - return cb(null, d.name) - }) - }, function (er, global) { - fg = global || [] - next() - }) - - function next () { - if (!fg || !fl) return - if (!npm.config.get('global')) { - fg = fg.map(function (g) { - return [g, '-g'] - }) - } - console.error('filtered', fl, fg) - return cb(null, fl.concat(fg)) - } -} +module.exports = (opts, cb) => + installedShallow(opts).then(list => cb(null, list)).catch(cb) diff --git a/deps/npm/lib/utils/completion/none.js b/deps/npm/lib/utils/completion/none.js new file mode 100644 index 00000000000000..752400da46f4cb --- /dev/null +++ b/deps/npm/lib/utils/completion/none.js @@ -0,0 +1,2 @@ +// used for commands where no completion is relevant/possible +module.exports = (opts, cb) => cb(null, []) diff --git a/deps/npm/lib/utils/config.js b/deps/npm/lib/utils/config.js new file mode 100644 index 00000000000000..5fe14a722bb934 --- /dev/null +++ b/deps/npm/lib/utils/config.js @@ -0,0 +1,371 @@ +// defaults, types, and shorthands + +const { + typeDefs: { + semver: { type: semver }, + Umask: { type: Umask }, + url: { type: url }, + path: { type: path } + } +} = require('@npmcli/config') + +const ciDetect = require('@npmcli/ci-detect') + +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 || 'bash' + +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, + 'always-auth': false, + also: null, + audit: true, + 'audit-level': null, + 'auth-type': 'legacy', + + before: null, + 'bin-links': true, + browser: null, + + ca: null, + cafile: null, + + cache, + + 'cache-lock-stale': 60000, + 'cache-lock-retries': 10, + 'cache-lock-wait': 10000, + + 'cache-max': Infinity, + 'cache-min': 10, + + cert: null, + + cidr: null, + + color: process.env.NO_COLOR == null, + call: '', + depth: null, + description: true, + dev: false, + 'dry-run': false, + editor, + 'engine-strict': false, + force: false, + 'format-package-lock': true, + + fund: true, + + 'fetch-retries': 2, + 'fetch-retry-factor': 10, + 'fetch-retry-mintimeout': 10000, + 'fetch-retry-maxtimeout': 60000, + 'fetch-timeout': 5 * 60 * 1000, + + git: 'git', + 'git-tag-version': true, + 'commit-hooks': true, + + global: false, + 'global-style': false, + heading: 'npm', + 'if-present': false, + include: [], + 'include-staged': false, + 'ignore-prepublish': false, + 'ignore-scripts': false, + 'init-module': '~/.npm-init.js', + 'init-author-name': '', + 'init-author-email': '', + 'init-author-url': '', + 'init-version': '1.0.0', + 'init-license': 'ISC', + json: false, + key: null, + 'legacy-bundling': false, + 'legacy-peer-deps': false, + 'strict-peer-deps': false, + link: false, + 'local-address': undefined, + loglevel: 'notice', + 'logs-max': 10, + long: false, + maxsockets: 50, + message: '%s', + 'metrics-registry': null, + 'node-options': null, + 'node-version': process.version, + 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, + preid: '', + production: process.env.NODE_ENV === 'production', + progress: !ciDetect(), + proxy: null, + 'https-proxy': null, + noproxy: null, + 'user-agent': 'npm/{npm-version} ' + + 'node/{node-version} ' + + '{platform} ' + + '{arch} ' + + '{ci}', + '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', + searchopts: '', + searchexclude: null, + searchlimit: 20, + searchstaleness: 15 * 60, + 'send-metrics': false, + shell, + shrinkwrap: true, + 'sign-git-commit': false, + 'sign-git-tag': false, + 'sso-poll-frequency': 500, + 'sso-type': 'oauth', + 'strict-ssl': true, + tag: 'latest', + 'tag-version-prefix': 'v', + timing: false, + tmp: tmpdir(), + unicode, + 'update-notifier': true, + usage: false, + userconfig: '~/.npmrc', + umask: process.umask ? process.umask() : 0o22, + version: false, + versions: false, + viewer: isWindows ? 'browser' : 'man' +} + +const types = { + access: [null, 'restricted', 'public'], + all: Boolean, + 'allow-same-version': Boolean, + 'always-auth': Boolean, + also: [null, 'dev', 'development'], + 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], + cafile: path, + cache: path, + 'cache-lock-stale': Number, + 'cache-lock-retries': Number, + 'cache-lock-wait': Number, + 'cache-max': Number, + 'cache-min': Number, + cert: [null, String], + cidr: [null, String, Array], + color: ['always', Boolean], + call: String, + depth: [null, Number], + description: Boolean, + dev: Boolean, + 'dry-run': Boolean, + editor: String, + 'engine-strict': Boolean, + force: Boolean, + fund: Boolean, + 'format-package-lock': Boolean, + 'fetch-retries': Number, + 'fetch-retry-factor': Number, + 'fetch-retry-mintimeout': Number, + 'fetch-retry-maxtimeout': Number, + 'fetch-timeout': Number, + git: String, + 'git-tag-version': Boolean, + 'commit-hooks': Boolean, + global: Boolean, + globalconfig: path, + 'global-style': Boolean, + group: [Number, String], + 'https-proxy': [null, url], + 'user-agent': String, + heading: String, + 'if-present': Boolean, + include: [Array, 'prod', 'dev', 'optional', 'peer'], + 'include-staged': Boolean, + 'ignore-prepublish': Boolean, + 'ignore-scripts': Boolean, + 'init-module': path, + 'init-author-name': String, + 'init-author-email': String, + 'init-author-url': ['', url], + 'init-license': String, + 'init-version': semver, + json: Boolean, + key: [null, String], + 'legacy-bundling': Boolean, + 'legacy-peer-deps': Boolean, + 'strict-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, + 'metrics-registry': [null, String], + 'node-options': [null, String], + 'node-version': [null, semver], + noproxy: [null, String, Array], + 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'], + searchopts: String, + searchexclude: [null, String], + searchlimit: Number, + searchstaleness: Number, + 'send-metrics': Boolean, + shell: String, + shrinkwrap: Boolean, + 'sign-git-commit': Boolean, + 'sign-git-tag': Boolean, + 'sso-poll-frequency': Number, + 'sso-type': [null, 'oauth', 'saml'], + 'strict-ssl': Boolean, + tag: String, + timing: Boolean, + tmp: path, + unicode: Boolean, + 'update-notifier': Boolean, + usage: Boolean, + userconfig: path, + umask: Umask, + version: Boolean, + 'tag-version-prefix': String, + versions: Boolean, + viewer: String +} + +const shorthands = { + a: ['--all'], + 'enjoy-by': ['--before'], + c: ['--call'], + s: ['--loglevel', 'silent'], + d: ['--loglevel', 'info'], + dd: ['--loglevel', 'verbose'], + ddd: ['--loglevel', 'silly'], + noreg: ['--no-registry'], + N: ['--no-registry'], + reg: ['--registry'], + 'no-reg': ['--no-registry'], + silent: ['--loglevel', 'silent'], + verbose: ['--loglevel', 'verbose'], + quiet: ['--loglevel', 'warn'], + q: ['--loglevel', 'warn'], + h: ['--usage'], + H: ['--usage'], + '?': ['--usage'], + help: ['--usage'], + v: ['--version'], + f: ['--force'], + desc: ['--description'], + 'no-desc': ['--no-description'], + local: ['--no-global'], + l: ['--long'], + m: ['--message'], + p: ['--parseable'], + porcelain: ['--parseable'], + readonly: ['--read-only'], + g: ['--global'], + S: ['--save'], + D: ['--save-dev'], + E: ['--save-exact'], + O: ['--save-optional'], + P: ['--save-prod'], + y: ['--yes'], + n: ['--no-yes'], + B: ['--save-bundle'], + C: ['--prefix'] +} + +module.exports = { defaults, types, shorthands } diff --git a/deps/npm/lib/utils/correct-mkdir.js b/deps/npm/lib/utils/correct-mkdir.js deleted file mode 100644 index 57368e946e37f5..00000000000000 --- a/deps/npm/lib/utils/correct-mkdir.js +++ /dev/null @@ -1,37 +0,0 @@ -// XXX this can probably be replaced with gentle-fs.mkdir everywhere it's used -const chownr = require('chownr') -const inflight = require('inflight') -const log = require('npmlog') -const mkdirp = require('mkdirp') -const inferOwner = require('infer-owner') - -// retain ownership of the parent dir -// this matches behavior in cacache to infer the cache ownership -// based on the ownership of the cache folder or it is parent. - -module.exports = function correctMkdir (path, cb) { - cb = inflight('correctMkdir: ' + path, cb) - if (!cb) { - return log.verbose('correctMkdir', path, 'correctMkdir already in flight; waiting') - } else { - log.verbose('correctMkdir', path, 'correctMkdir not in flight; initializing') - } - - if (!process.getuid) { - log.verbose('makeCacheDir', 'UID & GID are irrelevant on', process.platform) - return mkdirp(path, (er, made) => cb(er, { uid: 0, gid: 0 })) - } - - inferOwner(path).then(owner => { - mkdirp(path, (er, made) => { - if (er) { - log.error('correctMkdir', 'failed to make directory %s', path) - return cb(er) - } - chownr(made || path, owner.uid, owner.gid, (er) => cb(er, owner)) - }) - }, er => { - log.error('correctMkdir', 'failed to infer path ownership %s', path) - return cb(er) - }) -} diff --git a/deps/npm/lib/utils/deref-command.js b/deps/npm/lib/utils/deref-command.js new file mode 100644 index 00000000000000..18e11689e9b1dc --- /dev/null +++ b/deps/npm/lib/utils/deref-command.js @@ -0,0 +1,27 @@ +// de-reference abbreviations and shorthands into canonical command name + +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 abbrev = require('abbrev') +const abbrevs = abbrev(fullList) + +module.exports = c => { + if (!c || typeof c !== 'string') { + return '' + } + if (c.match(/[A-Z]/)) { + c = c.replace(/([A-Z])/g, m => '-' + m.toLowerCase()) + } + if (plumbing.indexOf(c) !== -1) { + return c + } + // first deref the abbrev, if there is one + // then resolve any aliases + // so `npm install-cl` will resolve to `install-clean` then to `ci` + let a = abbrevs[c] + while (aliases[a]) { + a = aliases[a] + } + return a || '' +} diff --git a/deps/npm/lib/utils/did-you-mean.js b/deps/npm/lib/utils/did-you-mean.js index 479f04755d7db9..c2bdf159dd1185 100644 --- a/deps/npm/lib/utils/did-you-mean.js +++ b/deps/npm/lib/utils/did-you-mean.js @@ -1,17 +1,12 @@ -var meant = require('meant') +const leven = require('leven') -function didYouMean (scmd, commands) { - var bestSimilarity = meant(scmd, commands).map(function (str) { - return ' ' + str - }) - - if (bestSimilarity.length === 0) return '' - if (bestSimilarity.length === 1) { - return '\nDid you mean this?\n' + bestSimilarity[0] - } else { - return ['\nDid you mean one of these?'] - .concat(bestSimilarity.slice(0, 3)).join('\n') - } +const didYouMean = (scmd, commands) => { + const best = commands + .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')}` } module.exports = didYouMean diff --git a/deps/npm/lib/utils/error-handler.js b/deps/npm/lib/utils/error-handler.js index 902ad7af9b328e..16abcd67ce3035 100644 --- a/deps/npm/lib/utils/error-handler.js +++ b/deps/npm/lib/utils/error-handler.js @@ -1,40 +1,37 @@ - -module.exports = errorHandler -module.exports.exit = exit - -var cbCalled = false -var log = require('npmlog') -var npm = require('../npm.js') -var itWorked = false -var path = require('path') -var wroteLogFile = false -var exitCode = 0 -var rollbacks = npm.rollbacks -var chain = require('slide').chain -var errorMessage = require('./error-message.js') -var replaceInfo = require('./replace-info.js') -var stopMetrics = require('./metrics.js').stop +let cbCalled = false +const log = require('npmlog') +const npm = require('../npm.js') +let itWorked = false +const path = require('path') +let wroteLogFile = false +let exitCode = 0 +const errorMessage = require('./error-message.js') +const stopMetrics = require('./metrics.js').stop const cacheFile = require('./cache-file.js') -var logFileName -function getLogFile () { +let logFileName +const getLogFile = () => { if (!logFileName) { logFileName = path.resolve(npm.config.get('cache'), '_logs', (new Date()).toISOString().replace(/[.:]/g, '_') + '-debug.log') } return logFileName } -var timings = { +const timings = { version: npm.version, command: process.argv.slice(2), logfile: null } -process.on('timing', function (name, value) { - if (timings[name]) { timings[name] += value } else { timings[name] = value } +process.on('timing', (name, value) => { + if (timings[name]) { + timings[name] += value + } else { + timings[name] = value + } }) -process.on('exit', function (code) { +process.on('exit', code => { process.emit('timeEnd', 'npm') log.disableProgress() if (npm.config && npm.config.loaded && npm.config.get('timing')) { @@ -57,7 +54,7 @@ process.on('exit', function (code) { log.error('', 'cb() never called!') console.error('') log.error('', 'This is an error with npm itself. Please report this error at:') - log.error('', ' ') + log.error('', ' ') writeLogFile() } @@ -80,54 +77,20 @@ process.on('exit', function (code) { wroteLogFile = false } - var doExit = npm.config && npm.config.loaded && npm.config.get('_exit') - if (doExit) { - // actually exit. - if (exitCode === 0 && !itWorked) { - exitCode = 1 - } - if (exitCode !== 0) process.exit(exitCode) - } else { - itWorked = false // ready for next exit + // actually exit. + if (exitCode === 0 && !itWorked) { + exitCode = 1 } + if (exitCode !== 0) process.exit(exitCode) }) -function exit (code, noLog) { +const exit = (code, noLog) => { exitCode = exitCode || process.exitCode || code - var doExit = npm.config && npm.config.loaded ? npm.config.get('_exit') : true - log.verbose('exit', [code, doExit]) + log.verbose('exit', code) if (log.level === 'silent') noLog = true - if (rollbacks.length) { - chain(rollbacks.map(function (f) { - return function (cb) { - npm.commands.unbuild([f], true, cb) - } - }), function (er) { - if (er) { - log.error('error rolling back', er) - if (!code) { - errorHandler(er) - } else { - if (!noLog) writeLogFile() - reallyExit(er) - } - } else { - if (!noLog && code) writeLogFile() - reallyExit() - } - }) - rollbacks.length = 0 - } else if (code && !noLog) { - writeLogFile() - } else { - reallyExit() - } - - function reallyExit (er) { - if (er && !code) code = typeof er.errno === 'number' ? er.errno : 1 - + const reallyExit = () => { itWorked = !code // Exit directly -- nothing in the CLI should still be running in the @@ -139,9 +102,15 @@ function exit (code, noLog) { process.exit(code) }) } + + if (code && !noLog) { + writeLogFile() + } else { + reallyExit() + } } -function errorHandler (er) { +const errorHandler = (er) => { log.disableProgress() if (!npm.config || !npm.config.loaded) { // logging won't work unless we pretend that it's ready @@ -153,6 +122,13 @@ function errorHandler (er) { er = er || new Error('Callback called more than once.') } + if (npm.updateNotification) { + const { level } = log + log.level = log.levels.notice + log.notice('', npm.updateNotification) + log.level = level + } + cbCalled = true if (!er) return exit(0) if (typeof er === 'string') { @@ -163,50 +139,35 @@ function errorHandler (er) { return exit(1, true) } - var m = er.code || er.message.match(/^(?:Error: )?(E[A-Z]+)/) - if (m && !er.code) { - er.code = m + if (!er.code) { + const matchErrorCode = er.message.match(/^(?:Error: )?(E[A-Z]+)/) + er.code = matchErrorCode && matchErrorCode[1] } - ;[ - 'type', - 'stack', - 'statusCode', - 'pkgid' - ].forEach(function (k) { - var v = er[k] - if (!v) return - v = replaceInfo(v) - log.verbose(k, v) - }) + for (const k of ['type', 'stack', 'statusCode', 'pkgid']) { + const v = er[k] + if (v) log.verbose(k, v) + } log.verbose('cwd', process.cwd()) - var os = require('os') - var args = replaceInfo(process.argv) + const os = require('os') log.verbose('', os.type() + ' ' + os.release()) - log.verbose('argv', args.map(JSON.stringify).join(' ')) + log.verbose('argv', process.argv.map(JSON.stringify).join(' ')) log.verbose('node', process.version) log.verbose('npm ', 'v' + npm.version) - ;[ - 'code', - 'syscall', - 'file', - 'path', - 'dest', - 'errno' - ].forEach(function (k) { - var v = er[k] + for (const k of ['code', 'syscall', 'file', 'path', 'dest', 'errno']) { + const v = er[k] if (v) log.error(k, v) - }) + } - var msg = errorMessage(er) - msg.summary.concat(msg.detail).forEach(function (errline) { - log.error.apply(log, errline) - }) + const msg = errorMessage(er) + for (const errline of [...msg.summary, ...msg.detail]) { + log.error(...errline) + } if (npm.config && npm.config.get('json')) { - var error = { + const error = { error: { code: er.code, summary: messageText(msg.summary), @@ -216,32 +177,28 @@ function errorHandler (er) { console.log(JSON.stringify(error, null, 2)) } - exit(typeof er.errno === 'number' ? er.errno : 1) + exit(typeof er.errno === 'number' ? er.errno : typeof er.code === 'number' ? er.code : 1) } -function messageText (msg) { - return msg.map(function (line) { - return line.slice(1).join(' ') - }).join('\n') -} +const messageText = msg => msg.map(line => line.slice(1).join(' ')).join('\n') -function writeLogFile () { +const writeLogFile = () => { if (wroteLogFile) return - var os = require('os') + const os = require('os') try { - var logOutput = '' - log.record.forEach(function (m) { - var pref = [m.id, m.level] - if (m.prefix) pref.push(m.prefix) - pref = pref.join(' ') - - m.message.trim().split(/\r?\n/).map(function (line) { - return (pref + ' ' + line).trim() - }).forEach(function (line) { - logOutput += line + os.EOL - }) + let logOutput = '' + log.record.forEach(m => { + const p = [m.id, m.level] + if (m.prefix) p.push(m.prefix) + const pref = p.join(' ') + + m.message.trim().split(/\r?\n/) + .map(line => (pref + ' ' + line).trim()) + .forEach(line => { + logOutput += line + os.EOL + }) }) cacheFile.write(getLogFile(), logOutput) @@ -252,3 +209,6 @@ function writeLogFile () { } } + +module.exports = errorHandler +module.exports.exit = exit diff --git a/deps/npm/lib/utils/error-message.js b/deps/npm/lib/utils/error-message.js index 78ccdeeb533d62..a1e1caeeb48722 100644 --- a/deps/npm/lib/utils/error-message.js +++ b/deps/npm/lib/utils/error-message.js @@ -1,29 +1,31 @@ 'use strict' -var npm = require('../npm.js') -var util = require('util') -var nameValidator = require('validate-npm-package-name') -var npmlog = require('npmlog') -var replaceInfo = require('./replace-info.js') - -module.exports = errorMessage - -function errorMessage (er) { - var short = [] - var detail = [] - - er.message = replaceInfo(er.message) - er.stack = replaceInfo(er.stack) - +const npm = require('../npm.js') +const { format } = require('util') +const { resolve } = require('path') +const nameValidator = require('validate-npm-package-name') +const npmlog = require('npmlog') +const { report: explainEresolve } = require('./explain-eresolve.js') + +module.exports = (er) => { + const short = [] + const detail = [] switch (er.code) { - case 'ENOAUDIT': - short.push(['audit', er.message]) + case 'ERESOLVE': + short.push(['ERESOLVE', er.message]) + detail.push(['', '']) + detail.push(['', explainEresolve(er)]) break - case 'EAUDITNOPJSON': - short.push(['audit', er.message]) + + case 'ENOLOCK': { + const cmd = npm.command || '' + short.push([cmd, 'This command requires an existing lockfile.']) + detail.push([cmd, 'Try creating one first with: npm i --package-lock-only']) + detail.push([cmd, `Original error: ${er.message}`]) break - case 'EAUDITNOLOCK': + } + + case 'ENOAUDIT': short.push(['audit', er.message]) - detail.push(['audit', 'Try creating one first with: npm i --package-lock-only']) break case 'ECONNREFUSED': @@ -38,13 +40,13 @@ function errorMessage (er) { break case 'EACCES': - case 'EPERM': + case 'EPERM': { const isCachePath = typeof er.path === 'string' && - npm.config && er.path.startsWith(npm.config.get('cache')) + npm.config.loaded && er.path.startsWith(npm.config.get('cache')) const isCacheDest = typeof er.dest === 'string' && - npm.config && er.dest.startsWith(npm.config.get('cache')) + npm.config.loaded && er.dest.startsWith(npm.config.get('cache')) - const isWindows = process.platform === 'win32' + const isWindows = require('./is-windows.js') if (!isWindows && (isCachePath || isCacheDest)) { // user probably doesn't need this, but still add it to the debug log @@ -66,7 +68,7 @@ function errorMessage (er) { '', [ '\nThe operation was rejected by your operating system.', - (process.platform === 'win32' + (isWindows ? 'It\'s possible that the file was already in use (by a text editor or antivirus),\n' + 'or that you lack permissions to access it.' : 'It is likely you do not have the permissions to access this file as the current user'), @@ -76,32 +78,7 @@ function errorMessage (er) { ].join('\n')]) } break - - case 'EUIDLOOKUP': - short.push(['lifecycle', er.message]) - detail.push([ - '', - [ - '', - 'Failed to look up the user/group for running scripts.', - '', - 'Try again with a different --user or --group settings, or', - 'run with --unsafe-perm to execute scripts as root.' - ].join('\n') - ]) - break - - case 'ELIFECYCLE': - short.push(['', er.message]) - detail.push([ - '', - [ - '', - 'Failed at the ' + er.pkgid + ' ' + er.stage + ' script.', - 'This is probably not a problem with npm. There is likely additional logging output above.' - ].join('\n')] - ) - break + } case 'ENOGIT': short.push(['', er.message]) @@ -116,11 +93,11 @@ function errorMessage (er) { break case 'EJSONPARSE': - const path = require('path') // Check whether we ran into a conflict in our own package.json - if (er.file === path.join(npm.prefix, 'package.json')) { - const isDiff = require('../install/read-shrinkwrap.js')._isDiff + if (er.file === resolve(npm.prefix, 'package.json')) { + const { isDiff } = require('parse-conflict-json') const txt = require('fs').readFileSync(er.file, 'utf8') + .replace(/\r\n/g, '\n') if (isDiff(txt)) { detail.push([ '', @@ -139,8 +116,8 @@ function errorMessage (er) { detail.push([ 'JSON.parse', [ - 'Failed to parse package.json data.', - 'package.json must be actual JSON, not just JavaScript.' + 'Failed to parse JSON data.', + 'Note: package.json must be actual JSON, not just JavaScript.' ].join('\n') ]) break @@ -161,8 +138,10 @@ function errorMessage (er) { } else { // npm ERR! code E401 // npm ERR! Unable to authenticate, need: Basic - const auth = (er.headers && er.headers['www-authenticate'] && er.headers['www-authenticate'].map((au) => au.split(/,\s*/))[0]) || [] - if (auth.indexOf('Bearer') !== -1) { + const auth = !er.headers || !er.headers['www-authenticate'] ? [] + : er.headers['www-authenticate'].map((au) => au.split(/[,\s]+/))[0] + + if (auth.includes('Bearer')) { short.push(['', 'Unable to authenticate, your authentication token seems to be invalid.']) detail.push([ '', @@ -171,7 +150,7 @@ function errorMessage (er) { ' npm login' ].join('\n') ]) - } else if (auth.indexOf('Basic') !== -1) { + } else if (auth.includes('Basic')) { short.push(['', 'Incorrect or missing password.']) detail.push([ '', @@ -195,30 +174,26 @@ function errorMessage (er) { case 'E404': // There's no need to have 404 in the message as well. - var msg = er.message.replace(/^404\s+/, '') - short.push(['404', msg]) + short.push(['404', er.message.replace(/^404\s+/, '')]) if (er.pkgid && er.pkgid !== '-') { - var pkg = er.pkgid.replace(/(?!^)@.*$/, '') + const pkg = er.pkgid.replace(/(?!^)@.*$/, '') detail.push(['404', '']) detail.push(['404', '', "'" + er.pkgid + "' is not in the npm registry."]) - var valResult = nameValidator(pkg) + const valResult = nameValidator(pkg) if (valResult.validForNewPackages) { detail.push(['404', 'You should bug the author to publish it (or use the name yourself!)']) } else { - detail.push(['404', 'Your package name is not valid, because', '']) + detail.push(['404', 'This package name is not valid, because', '']) - var errorsArray = (valResult.errors || []).concat(valResult.warnings || []) + const errorsArray = (valResult.errors || []).concat(valResult.warnings || []) errorsArray.forEach(function (item, idx) { detail.push(['404', ' ' + (idx + 1) + '. ' + item]) }) } - if (er.parent) { - detail.push(['404', "It was specified as a dependency of '" + er.parent + "'"]) - } detail.push(['404', '\nNote that you can also install from a']) detail.push(['404', 'tarball, folder, http url, or git url.']) } @@ -244,32 +219,19 @@ function errorMessage (er) { ]) break - case 'ECYCLE': - short.push([ - 'cycle', - [ - er.message, - 'While installing: ' + er.pkgid - ].join('\n') - ]) - detail.push([ - 'cycle', - [ - 'Found a pathological dependency case that npm cannot solve.', - 'Please report this to the package author.' - ].join('\n') - ]) - break - - case 'EBADPLATFORM': - var validOs = er.os.join ? er.os.join(',') : er.os - var validArch = er.cpu.join ? er.cpu.join(',') : er.cpu - var expected = {os: validOs, arch: validArch} - var actual = {os: process.platform, arch: process.arch} + case 'EBADPLATFORM': { + const validOs = er.required && + er.required.os && + er.required.os.join ? er.required.os.join(',') : er.required.os + const validArch = er.required && + er.required.cpu && + er.required.cpu.join ? er.required.cpu.join(',') : er.required.cpu + const expected = { os: validOs, arch: validArch } + const actual = { os: process.platform, arch: process.arch } short.push([ 'notsup', [ - util.format('Unsupported platform for %s: wanted %j (current: %j)', er.pkgid, expected, actual) + format('Unsupported platform for %s: wanted %j (current: %j)', er.pkgid, expected, actual) ].join('\n') ]) detail.push([ @@ -282,6 +244,7 @@ function errorMessage (er) { ].join('\n') ]) break + } case 'EEXIST': short.push(['', er.message]) @@ -311,58 +274,38 @@ function errorMessage (er) { ]) break - case 'ENOPACKAGEJSON': - short.push(['package.json', er.message]) - detail.push([ - 'package.json', - [ - "npm can't find a package.json file in your current directory." - ].join('\n') - ]) - break - case 'ETARGET': short.push(['notarget', er.message]) - msg = [ + detail.push(['notarget', [ 'In most cases you or one of your dependencies are requesting', "a package version that doesn't exist." - ] - if (er.parent) { - msg.push("\nIt was specified as a dependency of '" + er.parent + "'\n") - } - detail.push(['notarget', msg.join('\n')]) + ].join('\n')]) break case 'E403': short.push(['403', er.message]) - msg = [ + detail.push(['403', [ 'In most cases, you or one of your dependencies are requesting', - 'a package version that is forbidden by your security policy.' - ] - if (er.parent) { - msg.push("\nIt was specified as a dependency of '" + er.parent + "'\n") - } - detail.push(['403', msg.join('\n')]) + 'a package version that is forbidden by your security policy, or', + 'on a server you do not have access to.' + ].join('\n')]) break - case 'ENOTSUP': - if (er.required) { - short.push(['notsup', er.message]) - short.push(['notsup', 'Not compatible with your version of node/npm: ' + er.pkgid]) - detail.push([ - 'notsup', - [ - 'Not compatible with your version of node/npm: ' + er.pkgid, - 'Required: ' + JSON.stringify(er.required), - 'Actual: ' + JSON.stringify({ - npm: npm.version, - node: npm.config.get('node-version') - }) - ].join('\n') - ]) - break - } // else passthrough - /* eslint no-fallthrough:0 */ + case 'EBADENGINE': + short.push(['engine', er.message]) + short.push(['engine', 'Not compatible with your version of node/npm: ' + er.pkgid]) + detail.push([ + 'notsup', + [ + 'Not compatible with your version of node/npm: ' + er.pkgid, + 'Required: ' + JSON.stringify(er.required), + 'Actual: ' + JSON.stringify({ + npm: npm.version, + node: npm.config.loaded ? npm.config.get('node-version') : process.version + }) + ].join('\n') + ]) + break case 'ENOSPC': short.push(['nospc', er.message]) @@ -406,21 +349,26 @@ function errorMessage (er) { 'typeerror', [ 'This is an error with npm itself. Please report this error at:', - ' ' + ' https://github.com/npm/cli/issues' ].join('\n') ]) break default: short.push(['', er.message || er]) + if (er.signal) { + detail.push(['signal', er.signal]) + } + if (er.cmd && Array.isArray(er.args)) { + detail.push(['command', ...[er.cmd, ...er.args]]) + } + if (er.stdout) { + detail.push(['', er.stdout.trim()]) + } + if (er.stderr) { + detail.push(['', er.stderr.trim()]) + } break } - if (er.optional) { - short.unshift(['optional', er.optional + ' (' + er.location + '):']) - short.concat(detail).forEach(function (msg) { - if (!msg[0]) msg[0] = 'optional' - if (msg[1]) msg[1] = msg[1].toString().replace(/(^|\n)/g, '$1SKIPPING OPTIONAL DEPENDENCY: ') - }) - } - return {summary: short, detail: detail} + return { summary: short, detail: detail } } diff --git a/deps/npm/lib/utils/escape-arg.js b/deps/npm/lib/utils/escape-arg.js index 114abaadaa0906..135d380fc2d5a7 100644 --- a/deps/npm/lib/utils/escape-arg.js +++ b/deps/npm/lib/utils/escape-arg.js @@ -1,6 +1,5 @@ -'use strict' -var path = require('path') -var isWindows = require('./is-windows.js') +const { normalize } = require('path') +const isWindows = require('./is-windows.js') /* Escape the name of an executable suitable for passing to the system shell. @@ -9,19 +8,11 @@ Windows is easy, wrap in double quotes and you're done, as there's no facility to create files with quotes in their names. Unix-likes are a little more complicated, wrap in single quotes and escape -any single quotes in the filename. +any single quotes in the filename. The '"'"' construction ends the quoted +block, creates a new " quoted string with ' in it. So, `foo'bar` becomes +`'foo'"'"'bar'`, which is the bash way of saying `'foo' + "'" + 'bar'`. */ -module.exports = escapify - -function escapify (str) { - if (isWindows) { - return '"' + path.normalize(str) + '"' - } else { - if (/[^-_.~/\w]/.test(str)) { - return "'" + str.replace(/'/g, "'\"'\"'") + "'" - } else { - return str - } - } -} +module.exports = str => isWindows ? '"' + normalize(str) + '"' + : /[^-_.~/\w]/.test(str) ? "'" + str.replace(/'/g, '\'"\'"\'') + "'" + : str diff --git a/deps/npm/lib/utils/escape-exec-path.js b/deps/npm/lib/utils/escape-exec-path.js index 42b64934867dd1..83c70680b4da2d 100644 --- a/deps/npm/lib/utils/escape-exec-path.js +++ b/deps/npm/lib/utils/escape-exec-path.js @@ -1,6 +1,5 @@ -'use strict' -var path = require('path') -var isWindows = require('./is-windows.js') +const { normalize } = require('path') +const isWindows = require('./is-windows.js') /* Escape the name of an executable suitable for passing to the system shell. @@ -9,22 +8,14 @@ Windows is easy, wrap in double quotes and you're done, as there's no facility to create files with quotes in their names. Unix-likes are a little more complicated, wrap in single quotes and escape -any single quotes in the filename. +any single quotes in the filename. The '"'"' construction ends the quoted +block, creates a new " quoted string with ' in it. So, `foo'bar` becomes +`'foo'"'"'bar'`, which is the bash way of saying `'foo' + "'" + 'bar'`. */ -module.exports = escapify +const winQuote = str => !/ /.test(str) ? str : '"' + str + '"' +const winEsc = str => normalize(str).split(/\\/).map(winQuote).join('\\') -function windowsQuotes (str) { - if (!/ /.test(str)) return str - return '"' + str + '"' -} - -function escapify (str) { - if (isWindows) { - return path.normalize(str).split(/\\/).map(windowsQuotes).join('\\') - } else if (/[^-_.~/\w]/.test(str)) { - return "'" + str.replace(/'/g, "'\"'\"'") + "'" - } else { - return str - } -} +module.exports = str => isWindows ? winEsc(str) + : /[^-_.~/\w]/.test(str) ? "'" + str.replace(/'/g, '\'"\'"\'') + "'" + : str diff --git a/deps/npm/lib/utils/explain-dep.js b/deps/npm/lib/utils/explain-dep.js new file mode 100644 index 00000000000000..facab373baad6a --- /dev/null +++ b/deps/npm/lib/utils/explain-dep.js @@ -0,0 +1,101 @@ +const chalk = require('chalk') +const nocolor = { + bold: s => s, + dim: s => s, + red: s => s, + yellow: s => s, + cyan: s => s, + magenta: s => s +} + +const explainNode = (node, depth, color) => + printNode(node, color) + + explainDependents(node, depth, color) + +const colorType = (type, color) => { + const { red, yellow, cyan, magenta } = color ? chalk : nocolor + const style = type === 'extraneous' ? red + : type === 'dev' ? yellow + : type === 'optional' ? cyan + : type === 'peer' ? magenta + : /* istanbul ignore next */ s => s + return style(type) +} + +const printNode = (node, color) => { + const { + name, + version, + location, + extraneous, + dev, + optional, + peer + } = node + const { bold, dim } = color ? chalk : nocolor + const extra = [] + if (extraneous) { + extra.push(' ' + bold(colorType('extraneous', color))) + } + if (dev) { + extra.push(' ' + bold(colorType('dev', color))) + } + if (optional) { + extra.push(' ' + bold(colorType('optional', color))) + } + if (peer) { + extra.push(' ' + bold(colorType('peer', color))) + } + + return `${bold(name)}@${bold(version)}${extra.join('')}` + + (location ? dim(`\n${location}`) : '') +} + +const explainDependents = ({ name, dependents }, depth, color) => { + if (!dependents || !dependents.length || depth <= 0) { + return '' + } + + const max = Math.ceil(depth / 2) + const messages = dependents.slice(0, max) + .map(dep => explainDependency(name, dep, depth, color)) + + // show just the names of the first 5 deps that overflowed the list + if (dependents.length > max) { + let len = 0 + const maxLen = 50 + const showNames = [] + for (let i = max; i < dependents.length; i++) { + const { from: { name } } = dependents[i] + len += name.length + if (len >= maxLen && i < dependents.length - 1) { + showNames.push('...') + break + } + showNames.push(name) + } + const show = `(${showNames.join(', ')})` + messages.push(`${dependents.length - max} more ${show}`) + } + + const str = '\n' + messages.join('\n') + return str.split('\n').join('\n ') +} + +const explainDependency = (name, { type, from, spec }, depth, color) => { + const { bold } = color ? chalk : nocolor + return (type === 'prod' ? '' : `${colorType(type, color)} `) + + `${bold(name)}@"${bold(spec)}" from ` + + explainFrom(from, depth, color) +} + +const explainFrom = (from, depth, color) => { + if (!from.name && !from.version) { + return 'the root project' + } + + return printNode(from, color) + + explainDependents(from, depth - 1, color) +} + +module.exports = { explainNode, printNode } diff --git a/deps/npm/lib/utils/explain-eresolve.js b/deps/npm/lib/utils/explain-eresolve.js new file mode 100644 index 00000000000000..51a856f6cb9232 --- /dev/null +++ b/deps/npm/lib/utils/explain-eresolve.js @@ -0,0 +1,94 @@ +// this is called when an ERESOLVE error is caught in the error-handler, +// or when there's a log.warn('eresolve', msg, explanation), to turn it +// into a human-intelligible explanation of what's wrong and how to fix. +// +// TODO: abstract out the explainNode methods into a separate util for +// use by a future `npm explain ` command. + +const npm = require('../npm.js') +const { writeFileSync } = require('fs') +const { resolve } = require('path') +const { explainNode, printNode } = require('./explain-dep.js') + +// expl is an explanation object that comes from Arborist. It looks like: +// { +// dep: { +// whileInstalling: { +// explanation of the thing being installed when we hit the conflict +// }, +// name, +// version, +// dependents: [ +// things depending on this node (ie, reason for inclusion) +// { name, version, dependents }, ... +// ] +// } +// current: { +// explanation of the current node that already was in the tree conflicting +// } +// peerConflict: { +// explanation of the peer dependency that couldn't be added, or null +// } +// fixWithForce: Boolean - can we use --force to push through this? +// type: type of the edge that couldn't be met +// isPeer: true if the edge that couldn't be met is a peer dependency +// } +// Depth is how far we want to want to descend into the object making a report. +// The full report (ie, depth=Infinity) is always written to the cache folder +// at ${cache}/eresolve-report.txt along with full json. +const explainEresolve = (expl, color, depth) => { + const { dep, current, peerConflict } = expl + + const out = [] + /* istanbul ignore else - should always have this for ERESOLVEs */ + if (dep.whileInstalling) { + out.push('While resolving: ' + printNode(dep.whileInstalling, color)) + } + + out.push('Found: ' + explainNode(current, depth, color)) + + out.push('\nCould not add conflicting dependency: ' + + explainNode(dep, depth, color)) + + if (peerConflict) { + const heading = '\nConflicting peer dependency:' + const pc = explainNode(peerConflict, depth, color) + out.push(heading + ' ' + pc) + } + + return out.join('\n') +} + +// generate a full verbose report and tell the user how to fix it +const report = (expl, depth = 4) => { + const fullReport = resolve(npm.cache, 'eresolve-report.txt') + + const orForce = expl.fixWithForce ? ' or --force' : '' + const fix = `Fix the upstream dependency conflict, or retry +this command with --legacy-peer-deps${orForce} +to accept an incorrect (and potentially broken) dependency resolution.` + + writeFileSync(fullReport, `# npm resolution error report + +${new Date().toISOString()} + +${explainEresolve(expl, false, Infinity)} + +${fix} + +Raw JSON explanation object: + +${JSON.stringify(expl, null, 2)} +`, 'utf8') + + return explainEresolve(expl, npm.color, depth) + + `\n\n${fix}\n\nSee ${fullReport} for a full report.` +} + +// the terser explain method for the warning when using --force +const explain = (expl, depth = 2) => explainEresolve(expl, npm.color, depth) + +module.exports = { + explain, + report +} diff --git a/deps/npm/lib/utils/flat-options.js b/deps/npm/lib/utils/flat-options.js new file mode 100644 index 00000000000000..721bbbde766519 --- /dev/null +++ b/deps/npm/lib/utils/flat-options.js @@ -0,0 +1,250 @@ +// 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 npmSession = crypto.randomBytes(8).toString('hex') +log.verbose('npm-session', npmSession) +const { join } = require('path') + +const buildOmitList = npm => { + const include = npm.config.get('include') || [] + const omit = new Set((npm.config.get('omit') || []) + .filter(type => !include.includes(type))) + const only = npm.config.get('only') + + if (/^prod(uction)?$/.test(only) || npm.config.get('production')) { + omit.add('dev') + } + + if (/dev/.test(npm.config.get('also'))) { + omit.delete('dev') + } + + if (npm.config.get('dev')) { + omit.delete('dev') + } + + if (npm.config.get('optional') === false) { + omit.add('optional') + } + + npm.config.set('omit', [...omit]) + return [...omit] +} + +const flatOptions = npm => npm.flatOptions || Object.freeze({ + // 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, + includeStaged: npm.config.get('include-staged'), + + preferDedupe: npm.config.get('prefer-dedupe'), + ignoreScripts: npm.config.get('ignore-scripts'), + + projectScope: npm.projectScope, + npmVersion: npm.version, + nodeVersion: npm.config.get('node-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, + cache: join(npm.config.get('cache'), '_cacache'), + prefix: npm.prefix, + globalPrefix: npm.globalPrefix, + localPrefix: npm.localPrefix, + global: npm.config.get('global'), + + metricsRegistry: npm.config.get('metrics-registry') || + npm.config.get('registry'), + sendMetrics: npm.config.get('send-metrics'), + registry: npm.config.get('registry'), + scope: npm.config.get('scope'), + access: npm.config.get('access'), + alwaysAuth: npm.config.get('always-auth'), + audit: npm.config.get('audit'), + auditLevel: npm.config.get('audit-level'), + authType: npm.config.get('auth-type'), + ssoType: npm.config.get('sso-type'), + ssoPollFrequency: npm.config.get('sso-poll-frequency'), + before: npm.config.get('before'), + browser: npm.config.get('browser'), + ca: npm.config.get('ca'), + cafile: npm.config.get('cafile'), + cert: npm.config.get('cert'), + key: npm.config.get('key'), + + // XXX remove these when we don't use lockfile any more, once + // arborist is handling the installation process + cacheLockRetries: npm.config.get('cache-lock-retries'), + cacheLockStale: npm.config.get('cache-lock-stale'), + cacheLockWait: npm.config.get('cache-lock-wait'), + lockFile: { + retries: npm.config.get('cache-lock-retries'), + stale: npm.config.get('cache-lock-stale'), + wait: npm.config.get('cache-lock-wait') + }, + + // XXX remove these once no longer used + get cacheMax () { + return npm.config.get('cache-max') + }, + get cacheMin () { + return npm.config.get('cache-min') + }, + + // token creation options + cidr: npm.config.get('cidr'), + readOnly: npm.config.get('read-only'), + + // npm version options + preid: npm.config.get('preid'), + tagVersionPrefix: npm.config.get('tag-version-prefix'), + allowSameVersion: npm.config.get('allow-same-version'), + + // npm version git options + message: npm.config.get('message'), + commitHooks: npm.config.get('commit-hooks'), + gitTagVersion: npm.config.get('git-tag-version'), + signGitCommit: npm.config.get('sign-git-commit'), + signGitTag: npm.config.get('sign-git-tag'), + + // only used for npm ls in v7, not update + depth: npm.config.get('depth'), + all: npm.config.get('all'), + + // Output configs + unicode: npm.config.get('unicode'), + json: npm.config.get('json'), + long: npm.config.get('long'), + parseable: npm.config.get('parseable'), + + // options for npm search + search: { + description: npm.config.get('description'), + exclude: npm.config.get('searchexclude'), + limit: npm.config.get('searchlimit') || 20, + opts: npm.config.get('searchopts'), + staleness: npm.config.get('searchstaleness') + }, + + dryRun: npm.config.get('dry-run'), + engineStrict: npm.config.get('engine-strict'), + + retry: { + retries: npm.config.get('fetch-retries'), + factor: npm.config.get('fetch-retry-factor'), + maxTimeout: npm.config.get('fetch-retry-maxtimeout'), + minTimeout: npm.config.get('fetch-retry-mintimeout') + }, + + timeout: npm.config.get('fetch-timeout'), + + force: npm.config.get('force'), + + formatPackageLock: npm.config.get('format-package-lock'), + fund: npm.config.get('fund'), + + // binary locators + git: npm.config.get('git'), + npmBin: require.main.filename, + nodeBin: process.env.NODE || process.execPath, + viewer: npm.config.get('viewer'), + editor: npm.config.get('editor'), + + // configs that affect how we build trees + binLinks: npm.config.get('bin-links'), + rebuildBundle: npm.config.get('rebuild-bundle'), + packageLock: npm.config.get('package-lock'), + packageLockOnly: npm.config.get('package-lock-only'), + globalStyle: npm.config.get('global-style'), + legacyBundling: npm.config.get('legacy-bundling'), + scriptShell: npm.config.get('script-shell') || undefined, + shell: npm.config.get('shell'), + omit: buildOmitList(npm), + legacyPeerDeps: npm.config.get('legacy-peer-deps'), + strictPeerDeps: npm.config.get('strict-peer-deps'), + + // npx stuff + call: npm.config.get('call'), + package: npm.config.get('package'), + + // used to build up the appropriate {add:{...}} options to Arborist.reify + save: npm.config.get('save'), + saveBundle: npm.config.get('save-bundle') && !npm.config.get('save-peer'), + saveType: npm.config.get('save-optional') && npm.config.get('save-peer') + ? 'peerOptional' + : npm.config.get('save-optional') ? 'optional' + : npm.config.get('save-dev') ? 'dev' + : npm.config.get('save-peer') ? 'peer' + : npm.config.get('save-prod') ? 'prod' + : null, + savePrefix: npm.config.get('save-exact') ? '' + : npm.config.get('save-prefix'), + + // configs for npm-registry-fetch + otp: npm.config.get('otp'), + offline: npm.config.get('offline'), + preferOffline: getPreferOffline(npm), + preferOnline: getPreferOnline(npm), + strictSSL: npm.config.get('strict-ssl'), + defaultTag: npm.config.get('tag'), + get tag () { + return npm.config.get('tag') + }, + userAgent: npm.config.get('user-agent'), + + // yes, it's fine, just do it, jeez, stop asking + yes: npm.config.get('yes'), + + ...getScopesAndAuths(npm), + + // npm fund exclusive option to select an item from a funding list + which: npm.config.get('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: npm.config.get('https-proxy') || npm.config.get('proxy'), + noProxy: npm.config.get('noproxy') +}) + +const getPreferOnline = npm => { + const po = npm.config.get('prefer-online') + if (po !== undefined) { + return po + } + return npm.config.get('cache-max') <= 0 +} + +const getPreferOffline = npm => { + const po = npm.config.get('prefer-offline') + if (po !== undefined) { + return po + } + return npm.config.get('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 = npm => { + const scopesAndAuths = {} + // pull out all the @scope:... configs into a flat object. + for (const key in npm.config.list[0]) { + if (/@.*:registry$/i.test(key) || /^\/\//.test(key)) { + scopesAndAuths[key] = npm.config.get(key) + } + } + return scopesAndAuths +} + +module.exports = flatOptions diff --git a/deps/npm/lib/utils/funding.js b/deps/npm/lib/utils/funding.js deleted file mode 100644 index 5375639109ee2a..00000000000000 --- a/deps/npm/lib/utils/funding.js +++ /dev/null @@ -1,183 +0,0 @@ -'use strict' - -const URL = require('url').URL - -exports.getFundingInfo = getFundingInfo -exports.retrieveFunding = retrieveFunding -exports.validFundingField = validFundingField - -const flatCacheSymbol = Symbol('npm flat cache') -exports.flatCacheSymbol = flatCacheSymbol - -// supports object funding and string shorthand, or an array of these -// if original was an array, returns an array; else returns the lone item -function retrieveFunding (funding) { - const sources = [].concat(funding || []).map(item => ( - typeof item === 'string' - ? { url: item } - : item - )) - return Array.isArray(funding) ? sources : sources[0] -} - -// Is the value of a `funding` property of a `package.json` -// a valid type+url for `npm fund` to display? -function validFundingField (funding) { - if (!funding) return false - - if (Array.isArray(funding)) { - return funding.every(f => !Array.isArray(f) && validFundingField(f)) - } - - try { - var parsed = new URL(funding.url || funding) - } catch (error) { - return false - } - - if ( - parsed.protocol !== 'https:' && - parsed.protocol !== 'http:' - ) return false - - return Boolean(parsed.host) -} - -const empty = () => Object.create(null) - -function getFundingInfo (idealTree, opts) { - let packageWithFundingCount = 0 - const flat = empty() - const seen = new Set() - const { countOnly } = opts || {} - const _trailingDependencies = Symbol('trailingDependencies') - - function tracked (name, version) { - const key = String(name) + String(version) - if (seen.has(key)) { - return true - } - seen.add(key) - } - - function retrieveDependencies (dependencies) { - const trailing = dependencies[_trailingDependencies] - - if (trailing) { - return Object.assign( - empty(), - dependencies, - trailing - ) - } - - return dependencies - } - - function hasDependencies (dependencies) { - return dependencies && ( - Object.keys(dependencies).length || - dependencies[_trailingDependencies] - ) - } - - function addToFlatCache (funding, dep) { - [].concat(funding || []).forEach((f) => { - const key = f.url - if (!Array.isArray(flat[key])) { - flat[key] = [] - } - flat[key].push(dep) - }) - } - - function attachFundingInfo (target, funding, dep) { - if (funding && validFundingField(funding)) { - target.funding = retrieveFunding(funding) - if (!countOnly) { - addToFlatCache(target.funding, dep) - } - - packageWithFundingCount++ - } - } - - function getFundingDependencies (tree) { - const deps = tree && tree.dependencies - if (!deps) return empty() - - const directDepsWithFunding = Object.keys(deps).map((key) => { - const dep = deps[key] - const { name, funding, version } = dep - - // avoids duplicated items within the funding tree - if (tracked(name, version)) return empty() - - const fundingItem = {} - - if (version) { - fundingItem.version = version - } - - attachFundingInfo(fundingItem, funding, dep) - - return { - dep, - fundingItem - } - }) - - return directDepsWithFunding.reduce((res, { dep: directDep, fundingItem }, i) => { - if (!fundingItem || fundingItem.length === 0) return res - - // recurse - const transitiveDependencies = directDep.dependencies && - Object.keys(directDep.dependencies).length > 0 && - getFundingDependencies(directDep) - - // if we're only counting items there's no need - // to add all the data to the resulting object - if (countOnly) return null - - if (hasDependencies(transitiveDependencies)) { - fundingItem.dependencies = retrieveDependencies(transitiveDependencies) - } - - if (fundingItem.funding && fundingItem.funding.length !== 0) { - res[directDep.name] = fundingItem - } else if (fundingItem.dependencies) { - res[_trailingDependencies] = - Object.assign( - empty(), - res[_trailingDependencies], - fundingItem.dependencies - ) - } - - return res - }, countOnly ? null : empty()) - } - - const idealTreeDependencies = getFundingDependencies(idealTree) - const result = { - length: packageWithFundingCount - } - - if (!countOnly) { - result.name = idealTree.name || idealTree.path - - if (idealTree && idealTree.version) { - result.version = idealTree.version - } - - if (idealTree && idealTree.funding) { - result.funding = retrieveFunding(idealTree.funding) - } - - result.dependencies = retrieveDependencies(idealTreeDependencies) - - result[flatCacheSymbol] = flat - } - - return result -} diff --git a/deps/npm/lib/utils/gently-rm.js b/deps/npm/lib/utils/gently-rm.js deleted file mode 100644 index 16d0aa9bd7f447..00000000000000 --- a/deps/npm/lib/utils/gently-rm.js +++ /dev/null @@ -1,21 +0,0 @@ -// only remove the thing if it's a symlink into a specific folder. This is -// a very common use-case of npm's, but not so common elsewhere. - -exports = module.exports = gentlyRm - -var gentleFS = require('gentle-fs') -var gentleFSOpts = require('../config/gentle-fs.js') - -function gentlyRm (target, gently, base, cb) { - if (!cb) { - cb = base - base = undefined - } - - if (!cb) { - cb = gently - gently = false - } - - return gentleFS.rm(target, gentleFSOpts(gently, base), cb) -} diff --git a/deps/npm/lib/utils/get-identity.js b/deps/npm/lib/utils/get-identity.js new file mode 100644 index 00000000000000..d31b3ae28734fa --- /dev/null +++ b/deps/npm/lib/utils/get-identity.js @@ -0,0 +1,40 @@ +const npmFetch = require('npm-registry-fetch') +const npm = require('../npm') + +const needsAuthError = (msg) => + Object.assign(new Error(msg), { code: 'ENEEDAUTH' }) + +module.exports = async (opts = {}) => { + const { registry } = opts + if (!registry) { + throw Object.assign(new Error('No registry specified.'), { code: 'ENOREGISTRY' }) + } + + // First, check if we have a user/pass-based auth + const creds = npm.config.getCredentialsByURI(registry) + const { username: usernameFromURI, token } = creds + + if (usernameFromURI) { + // Found username; return it + return usernameFromURI + } else if (token) { + // No username, but we have a token; fetch the username from registry + const registryData = await npmFetch.json('/-/whoami', { + ...opts + }) + const { username: usernameFromRegistry } = registryData + // Retrieved username from registry; return it + if (usernameFromRegistry) { + return usernameFromRegistry + } else { + // Didn't get username from registry; bad token + throw needsAuthError( + 'Your auth token is no longer valid. Please login again.' + ) + } + } else { + // At this point, if they have a credentials object, it doesn't have a + // token or auth in it. Probably just the default registry. + throw needsAuthError('This command requires you to be logged in.') + } +} diff --git a/deps/npm/lib/utils/get-project-scope.js b/deps/npm/lib/utils/get-project-scope.js new file mode 100644 index 00000000000000..0b2b6061c06128 --- /dev/null +++ b/deps/npm/lib/utils/get-project-scope.js @@ -0,0 +1,17 @@ +const { resolve } = require('path') +module.exports = prefix => { + try { + const { name } = require(resolve(prefix, 'package.json')) + if (!name || typeof name !== 'string') { + return '' + } + const split = name.split('/') + if (split.length < 2) { + return '' + } + const scope = split[0] + return /^@/.test(scope) ? scope : '' + } catch (er) { + return '' + } +} diff --git a/deps/npm/lib/utils/git.js b/deps/npm/lib/utils/git.js index 1951640e815689..369f1589084b10 100644 --- a/deps/npm/lib/utils/git.js +++ b/deps/npm/lib/utils/git.js @@ -1,18 +1,16 @@ 'use strict' -const BB = require('bluebird') - const exec = require('child_process').execFile const spawn = require('./spawn') const npm = require('../npm.js') const which = require('which') const git = npm.config.get('git') -const assert = require('assert') const log = require('npmlog') const noProgressTillDone = require('./no-progress-while-running.js').tillDone +const { promisify } = require('util') exports.spawn = spawnGit -exports.exec = BB.promisify(execGit) +exports.exec = promisify(execGit) exports.chainableExec = chainableExec exports.whichAndExec = whichAndExec @@ -47,7 +45,6 @@ function chainableExec () { } function whichAndExec (args, options, cb) { - assert.equal(typeof cb, 'function', 'no callback provided') // check for git which(git, function (err) { if (err) { diff --git a/deps/npm/lib/utils/gunzip-maybe.js b/deps/npm/lib/utils/gunzip-maybe.js deleted file mode 100644 index adf7e4402aa2d9..00000000000000 --- a/deps/npm/lib/utils/gunzip-maybe.js +++ /dev/null @@ -1,22 +0,0 @@ -var duplex = require('mississippi').duplex -var through = require('mississippi').through -var zlib = require('zlib') - -function hasGzipHeader (c) { - return c[0] === 0x1F && c[1] === 0x8B && c[2] === 0x08 -} - -module.exports = gunzip -function gunzip () { - var stream = duplex() - var peeker = through(function (chunk, enc, cb) { - var newStream = hasGzipHeader(chunk) - ? zlib.createGunzip() - : through() - stream.setReadable(newStream) - stream.setWritable(newStream) - stream.write(chunk) - }) - stream.setWritable(peeker) - return stream -} diff --git a/deps/npm/lib/utils/hosted-git-info-from-manifest.js b/deps/npm/lib/utils/hosted-git-info-from-manifest.js new file mode 100644 index 00000000000000..9592b0b3a937b8 --- /dev/null +++ b/deps/npm/lib/utils/hosted-git-info-from-manifest.js @@ -0,0 +1,14 @@ +// given a manifest, try to get the hosted git info from it based on +// repository (if a string) or repository.url (if an object) +// returns null if it's not a valid repo, or not a known hosted repo +const hostedGitInfo = require('hosted-git-info') +module.exports = mani => { + const r = mani.repository + const rurl = !r ? null + : typeof r === 'string' ? r + : typeof r === 'object' && typeof r.url === 'string' ? r.url + : null + + // hgi returns undefined sometimes, but let's always return null here + return (rurl && hostedGitInfo.fromUrl(rurl.replace(/^git\+/, ''))) || null +} diff --git a/deps/npm/lib/utils/is-registry.js b/deps/npm/lib/utils/is-registry.js deleted file mode 100644 index e5f08e16a0b961..00000000000000 --- a/deps/npm/lib/utils/is-registry.js +++ /dev/null @@ -1,11 +0,0 @@ -'use strict' -module.exports = isRegistry - -function isRegistry (req) { - if (req == null) return false - // modern metadata - if ('registry' in req) return req.registry - // legacy metadata - if (req.type === 'range' || req.type === 'version' || req.type === 'tag') return true - return false -} diff --git a/deps/npm/lib/utils/is-windows-bash.js b/deps/npm/lib/utils/is-windows-bash.js index 0a6c179680e8c6..420b4c2d49da78 100644 --- a/deps/npm/lib/utils/is-windows-bash.js +++ b/deps/npm/lib/utils/is-windows-bash.js @@ -1,4 +1,4 @@ 'use strict' -var isWindows = require('./is-windows.js') +const isWindows = require('./is-windows.js') module.exports = isWindows && (/^MINGW(32|64)$/.test(process.env.MSYSTEM) || process.env.TERM === 'cygwin') diff --git a/deps/npm/lib/utils/is-windows-shell.js b/deps/npm/lib/utils/is-windows-shell.js index 803bbaa49cc8f4..5f2f95e2e364a7 100644 --- a/deps/npm/lib/utils/is-windows-shell.js +++ b/deps/npm/lib/utils/is-windows-shell.js @@ -1,4 +1,4 @@ 'use strict' -var isWindows = require('./is-windows.js') -var isWindowsBash = require('./is-windows-bash.js') +const isWindows = require('./is-windows.js') +const isWindowsBash = require('./is-windows-bash.js') module.exports = isWindows && !isWindowsBash diff --git a/deps/npm/lib/utils/lifecycle-cmd.js b/deps/npm/lib/utils/lifecycle-cmd.js index bb802f45ee08c3..40a90aa20b1991 100644 --- a/deps/npm/lib/utils/lifecycle-cmd.js +++ b/deps/npm/lib/utils/lifecycle-cmd.js @@ -1,18 +1,12 @@ -exports = module.exports = cmd +// The implementation of commands that are just "run a script" +// test, start, stop, restart -var npm = require('../npm.js') -var usage = require('./usage.js') +const npm = require('../npm.js') +const usageUtil = require('./usage.js') -function cmd (stage) { - function CMD (args, cb) { - npm.commands['run-script']([stage].concat(args), cb) - } - CMD.usage = usage(stage, 'npm ' + stage + ' [-- ]') - var installedShallow = require('./completion/installed-shallow.js') - CMD.completion = function (opts, cb) { - installedShallow(opts, function (d) { - return d.scripts && d.scripts[stage] - }, cb) - } - return CMD +module.exports = stage => { + const cmd = (args, cb) => npm.commands.run([stage, ...args], cb) + const usage = usageUtil(stage, `npm ${stage} [-- ]`) + const completion = require('./completion/none.js') + return Object.assign(cmd, { usage, completion }) } diff --git a/deps/npm/lib/utils/lifecycle.js b/deps/npm/lib/utils/lifecycle.js deleted file mode 100644 index 2d3265e0eb2b3e..00000000000000 --- a/deps/npm/lib/utils/lifecycle.js +++ /dev/null @@ -1,14 +0,0 @@ -exports = module.exports = runLifecycle - -const lifecycleOpts = require('../config/lifecycle') -const lifecycle = require('npm-lifecycle') - -function runLifecycle (pkg, stage, wd, moreOpts, cb) { - if (typeof moreOpts === 'function') { - cb = moreOpts - moreOpts = null - } - - const opts = lifecycleOpts(moreOpts) - lifecycle(pkg, stage, wd, opts).then(cb, cb) -} diff --git a/deps/npm/lib/utils/link.js b/deps/npm/lib/utils/link.js deleted file mode 100644 index c2642481444ec4..00000000000000 --- a/deps/npm/lib/utils/link.js +++ /dev/null @@ -1,8 +0,0 @@ -module.exports = link - -var gentleFS = require('gentle-fs') -var gentleFSOpts = require('../config/gentle-fs.js') - -function link (from, to, gently, abs, cb) { - return gentleFS.link(from, to, gentleFSOpts(gently, undefined, abs), cb) -} diff --git a/deps/npm/lib/utils/locker.js b/deps/npm/lib/utils/locker.js deleted file mode 100644 index 9cd8b2c4fdac95..00000000000000 --- a/deps/npm/lib/utils/locker.js +++ /dev/null @@ -1,73 +0,0 @@ -var crypto = require('crypto') -var resolve = require('path').resolve - -var lockfile = require('lockfile') -var log = require('npmlog') - -var npm = require('../npm.js') -var correctMkdir = require('../utils/correct-mkdir.js') - -var installLocks = {} - -function lockFileName (base, name) { - var c = name.replace(/[^a-zA-Z0-9]+/g, '-').replace(/^-+|-+$/g, '') - var p = resolve(base, name) - var h = crypto.createHash('sha1').update(p).digest('hex') - var l = resolve(npm.cache, '_locks') - - return resolve(l, c.substr(0, 24) + '-' + h.substr(0, 16) + '.lock') -} - -function lock (base, name, cb) { - var lockDir = resolve(npm.cache, '_locks') - correctMkdir(lockDir, function (er) { - if (er) return cb(er) - - var opts = { - stale: npm.config.get('cache-lock-stale'), - retries: npm.config.get('cache-lock-retries'), - wait: npm.config.get('cache-lock-wait') - } - var lf = lockFileName(base, name) - lockfile.lock(lf, opts, function (er) { - if (er) log.warn('locking', lf, 'failed', er) - - if (!er) { - log.verbose('lock', 'using', lf, 'for', resolve(base, name)) - installLocks[lf] = true - } - - cb(er) - }) - }) -} - -function unlock (base, name, cb) { - var lf = lockFileName(base, name) - var locked = installLocks[lf] - if (locked === false) { - return process.nextTick(cb) - } else if (locked === true) { - lockfile.unlock(lf, function (er) { - if (er) { - log.warn('unlocking', lf, 'failed', er) - } else { - installLocks[lf] = false - log.verbose('unlock', 'done using', lf, 'for', resolve(base, name)) - } - - cb(er) - }) - } else { - var notLocked = new Error( - 'Attempt to unlock ' + resolve(base, name) + ", which hasn't been locked" - ) - notLocked.code = 'ENOTLOCKED' - throw notLocked - } -} - -module.exports = { - lock: lock, - unlock: unlock -} diff --git a/deps/npm/lib/utils/metrics.js b/deps/npm/lib/utils/metrics.js index 1a4bb79a6e85d3..d1f5e5586e575a 100644 --- a/deps/npm/lib/utils/metrics.js +++ b/deps/npm/lib/utils/metrics.js @@ -7,8 +7,8 @@ exports.send = sendMetrics const fs = require('fs') const path = require('path') const npm = require('../npm.js') -const regFetch = require('libnpm/fetch') -const uuid = require('uuid') +const regFetch = require('npm-registry-fetch') +const { v4: uuidv4 } = require('uuid') const cacheFile = require('./cache-file.js') let inMetrics = false @@ -42,7 +42,7 @@ function saveMetrics (itWorked) { } } catch (ex) { metrics = { - metricId: uuid.v4(), + metricId: uuidv4(), metrics: { from: new Date().toISOString(), to: new Date().toISOString(), diff --git a/deps/npm/lib/utils/move.js b/deps/npm/lib/utils/move.js deleted file mode 100644 index d564962c219411..00000000000000 --- a/deps/npm/lib/utils/move.js +++ /dev/null @@ -1,12 +0,0 @@ -'use strict' -module.exports = wrappedMove - -const fs = require('graceful-fs') -const move = require('move-concurrently') -const Bluebird = require('bluebird') - -const options = {fs: fs, Promise: Bluebird, maxConcurrency: 4} - -function wrappedMove (from, to) { - return move(from, to, options) -} diff --git a/deps/npm/lib/utils/npm-usage.js b/deps/npm/lib/utils/npm-usage.js new file mode 100644 index 00000000000000..77eb97317abf1b --- /dev/null +++ b/deps/npm/lib/utils/npm-usage.js @@ -0,0 +1,84 @@ +const npm = require('../npm.js') +const didYouMean = require('./did-you-mean.js') +const { dirname } = require('path') +const output = require('./output.js') +const { cmdList } = require('./cmd-list') + +module.exports = (valid = true) => { + npm.config.set('loglevel', 'silent') + npm.log.level = 'silent' + output(` +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: +${npm.config.get('long') ? usages() : ('\n ' + wrap(cmdList))} + +Specify configs in the ini-formatted file: + ${npm.config.get('userconfig')} +or on the command line via: npm --key=value + +More configuration info: npm help config +Configuration fields: npm help 7 config + +npm@${npm.version} ${dirname(dirname(__dirname))} +`) + + if (npm.argv.length >= 1) { + output(didYouMean(npm.argv[0], cmdList)) + } + + if (!valid) { + process.exitCode = 1 + } +} + +const wrap = (arr) => { + var out = [''] + var l = 0 + var line + + line = process.stdout.columns + if (!line) { + line = 60 + } else { + line = Math.min(60, Math.max(line - 16, 24)) + } + + arr.sort(function (a, b) { return a < b ? -1 : 1 }) + .forEach(function (c) { + if (out[l].length + c.length + 2 < line) { + out[l] += ', ' + c + } else { + out[l++] += ',' + out[l] = c + } + }) + return out.join('\n ').substr(2) +} + +const usages = () => { + // return a string of : + var maxLen = 0 + return cmdList.reduce(function (set, c) { + set.push([c, require(`./${npm.deref(c)}.js`).usage || '']) + maxLen = Math.max(maxLen, c.length) + return set + }, []).sort((a, b) => { + return a[0].localeCompare(b[0]) + }).map(function (item) { + var c = item[0] + var usage = item[1] + return '\n ' + + c + (new Array(maxLen - c.length + 2).join(' ')) + + (usage.split('\n').join('\n' + (new Array(maxLen + 6).join(' ')))) + }).join('\n') +} diff --git a/deps/npm/lib/utils/open-url.js b/deps/npm/lib/utils/open-url.js index e1ed2b3fab76d5..8f270221cd643b 100644 --- a/deps/npm/lib/utils/open-url.js +++ b/deps/npm/lib/utils/open-url.js @@ -3,6 +3,16 @@ const npm = require('../npm.js') const output = require('./output.js') const opener = require('opener') +const { URL } = require('url') + +const isUrlValid = url => { + try { + return /^(https?|file):$/.test(new URL(url).protocol) + } catch (_) { + return false + } +} + // attempt to open URL in web-browser, print address otherwise: module.exports = function open (url, errMsg, cb, browser = npm.config.get('browser')) { function printAlternateMsg () { @@ -12,19 +22,22 @@ module.exports = function open (url, errMsg, cb, browser = npm.config.get('brows title: errMsg, url }, null, 2) - : `${errMsg}:\n\n${url}` + : `${errMsg}:\n ${url}\n` output(alternateMsg) } - const skipBrowser = process.argv.indexOf('--no-browser') > -1 - - if (skipBrowser) { + if (browser === false) { printAlternateMsg() return cb() } - opener(url, { command: browser }, (er) => { + if (!isUrlValid(url)) { + return cb(new Error('Invalid URL: ' + url)) + } + + const command = browser === true ? null : browser + opener(url, { command }, (er) => { if (er && er.code === 'ENOENT') { printAlternateMsg() return cb() diff --git a/deps/npm/lib/utils/otplease.js b/deps/npm/lib/utils/otplease.js index d0477a896d0049..6a389a0913abb2 100644 --- a/deps/npm/lib/utils/otplease.js +++ b/deps/npm/lib/utils/otplease.js @@ -1,27 +1,22 @@ 'use strict' -const BB = require('bluebird') - -const optCheck = require('figgy-pudding')({ - prompt: {default: 'This operation requires a one-time password.\nEnter OTP:'}, - otp: {} -}) +const prompt = 'This operation requires a one-time password.\nEnter OTP:' const readUserInfo = require('./read-user-info.js') +const isOtpError = err => + err.code === 'EOTP' || (err.code === 'E401' && /one-time pass/.test(err.body)) + module.exports = otplease function otplease (opts, fn) { - opts = opts.concat ? opts : optCheck(opts) - return BB.try(() => { - return fn(opts) - }).catch(err => { - if (err.code !== 'EOTP' && !(err.code === 'E401' && /one-time pass/.test(err.body))) { + opts = { prompt, ...opts } + return Promise.resolve().then(() => fn(opts)).catch(err => { + if (!isOtpError(err)) { throw err } else if (!process.stdin.isTTY || !process.stdout.isTTY) { throw err } else { - return readUserInfo.otp( - optCheck(opts).prompt - ).then(otp => fn(opts.concat({otp}))) + return readUserInfo.otp(opts.prompt) + .then(otp => fn({ ...opts, otp })) } }) } diff --git a/deps/npm/lib/utils/output.js b/deps/npm/lib/utils/output.js index 3dd66cbdd2ab8d..2d1549859ac0d1 100644 --- a/deps/npm/lib/utils/output.js +++ b/deps/npm/lib/utils/output.js @@ -1,8 +1,7 @@ -'use strict' -var log = require('npmlog') +const log = require('npmlog') // output to stdout in a progress bar compatible way -module.exports = function () { +module.exports = (...msg) => { log.clearProgress() - console.log.apply(console, arguments) + console.log(...msg) log.showProgress() } diff --git a/deps/npm/lib/utils/parse-json.js b/deps/npm/lib/utils/parse-json.js deleted file mode 100644 index c2ebac35819adc..00000000000000 --- a/deps/npm/lib/utils/parse-json.js +++ /dev/null @@ -1,25 +0,0 @@ -'use strict' -var parseJsonWithErrors = require('json-parse-better-errors') -var parseJSON = module.exports = function (content) { - return parseJsonWithErrors(stripBOM(content)) -} - -parseJSON.noExceptions = function (content) { - try { - return parseJSON(content) - } catch (ex) { - - } -} - -// from read-package-json -function stripBOM (content) { - content = content.toString() - // Remove byte order marker. This catches EF BB BF (the UTF-8 BOM) - // because the buffer-to-string conversion in `fs.readFileSync()` - // translates it to FEFF, the UTF-16 BOM. - if (content.charCodeAt(0) === 0xFEFF) { - content = content.slice(1) - } - return content -} diff --git a/deps/npm/lib/utils/path.js b/deps/npm/lib/utils/path.js new file mode 100644 index 00000000000000..ad0065a2c52f36 --- /dev/null +++ b/deps/npm/lib/utils/path.js @@ -0,0 +1,4 @@ +// return the PATH array in a cross-platform way +const PATH = process.env.PATH || process.env.Path || process.env.path +const { delimiter } = require('path') +module.exports = PATH.split(delimiter) diff --git a/deps/npm/lib/utils/perf.js b/deps/npm/lib/utils/perf.js index d314860792d2a3..8cc4573dd1ec74 100644 --- a/deps/npm/lib/utils/perf.js +++ b/deps/npm/lib/utils/perf.js @@ -1,26 +1,17 @@ -'use strict' -var log = require('npmlog') -var EventEmitter = require('events').EventEmitter -var perf = new EventEmitter() -module.exports = perf +const log = require('npmlog') +const timings = new Map() -var timings = {} +process.on('time', (name) => { + timings.set(name, Date.now()) +}) -process.on('time', time) -process.on('timeEnd', timeEnd) - -perf.on('time', time) -perf.on('timeEnd', timeEnd) - -function time (name) { - timings[name] = Date.now() -} - -function timeEnd (name) { - if (name in timings) { - perf.emit('timing', name, Date.now() - timings[name]) - delete timings[name] +process.on('timeEnd', (name) => { + if (timings.has(name)) { + const ms = Date.now() - timings.get(name) + process.emit('timing', name, ms) + log.timing(name, `Completed in ${ms}ms`) + timings.delete(name) } else { log.silly('timing', "Tried to end timer that doesn't exist:", name) } -} +}) diff --git a/deps/npm/lib/utils/pick-manifest-from-registry-metadata.js b/deps/npm/lib/utils/pick-manifest-from-registry-metadata.js index 589cef207dcd9d..4161fafccef16f 100644 --- a/deps/npm/lib/utils/pick-manifest-from-registry-metadata.js +++ b/deps/npm/lib/utils/pick-manifest-from-registry-metadata.js @@ -12,14 +12,14 @@ function pickManifestFromRegistryMetadata (spec, tag, versions, metadata) { if (tagged && metadata.versions[tagged] && semver.satisfies(tagged, spec, true)) { - return {resolvedTo: tag, manifest: metadata.versions[tagged]} + return { resolvedTo: tag, manifest: metadata.versions[tagged] } } // find the max satisfying version. var ms = semver.maxSatisfying(versions, spec, true) if (ms) { - return {resolvedTo: ms, manifest: metadata.versions[ms]} + return { resolvedTo: ms, manifest: metadata.versions[ms] } } else if (spec === '*' && versions.length && tagged && metadata.versions[tagged]) { - return {resolvedTo: tag, manifest: metadata.versions[tagged]} + return { resolvedTo: tag, manifest: metadata.versions[tagged] } } else { } diff --git a/deps/npm/lib/utils/ping.js b/deps/npm/lib/utils/ping.js new file mode 100644 index 00000000000000..f5f7fcc6a62586 --- /dev/null +++ b/deps/npm/lib/utils/ping.js @@ -0,0 +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) + return res.json().catch(() => ({})) +} diff --git a/deps/npm/lib/utils/proc-log-listener.js b/deps/npm/lib/utils/proc-log-listener.js new file mode 100644 index 00000000000000..1dc4b4399eaea1 --- /dev/null +++ b/deps/npm/lib/utils/proc-log-listener.js @@ -0,0 +1,16 @@ +const log = require('npmlog') +const { inspect } = require('util') +module.exports = () => { + process.on('log', (level, ...args) => { + try { + log[level](...args) + } catch (ex) { + try { + // if it crashed once, it might again! + log.verbose(`attempt to log ${inspect([level, ...args])} crashed`, ex) + } catch (ex2) { + console.error(`attempt to log ${inspect([level, ...args])} crashed`, ex) + } + } + }) +} diff --git a/deps/npm/lib/utils/pulse-till-done.js b/deps/npm/lib/utils/pulse-till-done.js index b292c2fa56fa19..a533c064448da4 100644 --- a/deps/npm/lib/utils/pulse-till-done.js +++ b/deps/npm/lib/utils/pulse-till-done.js @@ -1,7 +1,6 @@ 'use strict' const validate = require('aproba') const log = require('npmlog') -const Bluebird = require('bluebird') let pulsers = 0 let pulse @@ -21,18 +20,22 @@ module.exports = function (prefix, cb) { validate('SF', [prefix, cb]) if (!prefix) prefix = 'network' pulseStart(prefix) - return function () { + return (er, ...args) => { pulseStop() - cb.apply(null, arguments) + cb(er, ...args) } } -module.exports.withPromise = pulseWhile -function pulseWhile (prefix, promise) { +const pulseWhile = async (prefix, promise) => { if (!promise) { promise = prefix prefix = '' } pulseStart(prefix) - return Bluebird.resolve(promise).finally(() => pulseStop()) + try { + return await promise + } finally { + pulseStop() + } } +module.exports.withPromise = pulseWhile diff --git a/deps/npm/lib/utils/read-local-package.js b/deps/npm/lib/utils/read-local-package.js index 27ca7b4e395376..8d30883e7da329 100644 --- a/deps/npm/lib/utils/read-local-package.js +++ b/deps/npm/lib/utils/read-local-package.js @@ -1,12 +1,16 @@ -exports = module.exports = readLocalPkg +'use strict' -var npm = require('../npm.js') -var readJson = require('read-package-json') +const { resolve } = require('path') +const readJson = require('read-package-json-fast') +const npm = require('../npm.js') -function readLocalPkg (cb) { - if (npm.config.get('global')) return cb() - var path = require('path') - readJson(path.resolve(npm.prefix, 'package.json'), function (er, d) { - return cb(er, d && d.name) - }) +async function readLocalPackageName (cb) { + if (npm.flatOptions.global) { + return + } + + const filepath = resolve(npm.flatOptions.prefix, 'package.json') + return (await readJson(filepath)).name } + +module.exports = readLocalPackageName diff --git a/deps/npm/lib/utils/read-user-info.js b/deps/npm/lib/utils/read-user-info.js index 1e8c86a52379fc..f5a583be6dd697 100644 --- a/deps/npm/lib/utils/read-user-info.js +++ b/deps/npm/lib/utils/read-user-info.js @@ -1,6 +1,6 @@ 'use strict' -const Bluebird = require('bluebird') -const readAsync = Bluebird.promisify(require('read')) +const { promisify } = require('util') +const readAsync = promisify(require('read')) const userValidate = require('npm-user-validate') const log = require('npmlog') @@ -10,12 +10,8 @@ exports.username = readUsername exports.email = readEmail function read (opts) { - return Bluebird.try(() => { - log.clearProgress() - return readAsync(opts) - }).finally(() => { - log.showProgress() - }) + log.clearProgress() + return readAsync(opts).finally(() => log.showProgress()) } function readOTP (msg, otp, isRetry) { @@ -30,7 +26,7 @@ function readOTP (msg, otp, isRetry) { } if (isRetry && otp && /^[\d ]+$|^[A-Fa-f0-9]{64,64}$/.test(otp)) return otp.replace(/\s+/g, '') - return read({prompt: msg, default: otp || ''}) + return read({ prompt: msg, default: otp || '' }) .then((otp) => readOTP(msg, otp, true)) } @@ -38,7 +34,7 @@ function readPassword (msg, password, isRetry) { if (!msg) msg = 'npm password: ' if (isRetry && password) return password - return read({prompt: msg, silent: true, default: password || ''}) + return read({ prompt: msg, silent: true, default: password || '' }) .then((password) => readPassword(msg, password, true)) } @@ -53,7 +49,7 @@ function readUsername (msg, username, opts, isRetry) { } } - return read({prompt: msg, default: username || ''}) + return read({ prompt: msg, default: username || '' }) .then((username) => readUsername(msg, username, opts, true)) } @@ -68,6 +64,6 @@ function readEmail (msg, email, opts, isRetry) { } } - return read({prompt: msg, default: email || ''}) + return read({ prompt: msg, default: email || '' }) .then((username) => readEmail(msg, username, opts, true)) } diff --git a/deps/npm/lib/utils/reify-output.js b/deps/npm/lib/utils/reify-output.js new file mode 100644 index 00000000000000..09b31fa9413a63 --- /dev/null +++ b/deps/npm/lib/utils/reify-output.js @@ -0,0 +1,153 @@ +// pass in an arborist object, and it'll output the data about what +// was done, what was audited, etc. +// +// added 351 packages, removed 132 packages, and audited 13388 packages in 19.157s +// +// 1 package is looking for funding +// run `npm fund` for details +// +// found 37 vulnerabilities (5 low, 7 moderate, 25 high) +// run `npm audit fix` to fix them, or `npm audit` for details + +const npm = require('../npm.js') +const log = require('npmlog') +const output = require('./output.js') +const { depth } = require('treeverse') +const ms = require('ms') +const auditReport = require('npm-audit-report') +const { readTree: getFundingInfo } = require('libnpmfund') + +// TODO: output JSON if flatOptions.json is true +const reifyOutput = arb => { + // don't print any info in --silent mode + if (log.levels[log.level] > log.levels.error) { + return + } + + const { diff, auditReport, actualTree } = arb + + const summary = { + added: 0, + removed: 0, + changed: 0, + audited: auditReport ? actualTree.inventory.size : 0, + funding: 0 + } + + if (diff) { + depth({ + tree: diff, + visit: d => { + switch (d.action) { + case 'REMOVE': + summary.removed++ + break + case 'ADD': + actualTree.inventory.has(d.ideal) && summary.added++ + break + case 'CHANGE': + summary.changed++ + break + default: + return + } + const node = d.actual || d.ideal + log.silly(d.action, node.location) + }, + getChildren: d => d.children + }) + } + + if (npm.flatOptions.fund) { + const fundingInfo = getFundingInfo(actualTree, { countOnly: true }) + summary.funding = fundingInfo.length + } + + if (npm.flatOptions.json) { + if (arb.auditReport) { + summary.audit = npm.command === 'audit' ? arb.auditReport + : arb.auditReport.toJSON().metadata + } + output(JSON.stringify(summary, 0, 2)) + } else { + packagesChangedMessage(summary) + packagesFundingMessage(summary) + printAuditReport(arb) + } +} + +// if we're running `npm audit fix`, then we print the full audit report +// at the end if there's still stuff, because it's silly for `npm audit` +// to tell you to run `npm audit` for details. otherwise, use the summary +// report. if we get here, we know it's not quiet or json. +const printAuditReport = arb => { + if (!arb.auditReport) { + return + } + + const reporter = npm.command !== 'audit' ? 'install' : 'detail' + const defaultAuditLevel = npm.command !== 'audit' ? 'none' : 'low' + const auditLevel = npm.flatOptions.auditLevel || defaultAuditLevel + + const res = auditReport(arb.auditReport, { + reporter, + ...npm.flatOptions, + auditLevel + }) + process.exitCode = process.exitCode || res.exitCode + output('\n' + res.report) +} + +const packagesChangedMessage = ({ added, removed, changed, audited }) => { + const msg = ['\n'] + if (added === 0 && removed === 0 && changed === 0) { + msg.push('up to date') + if (audited) { + msg.push(', ') + } + } else { + if (added) { + msg.push(`added ${added} package${added === 1 ? '' : 's'}`) + } + if (removed) { + if (added) { + msg.push(', ') + } + if (added && !audited && !changed) { + msg.push('and ') + } + msg.push(`removed ${removed} package${removed === 1 ? '' : 's'}`) + } + if (changed) { + if (added || removed) { + msg.push(', ') + } + if (!audited && (added || removed)) { + msg.push('and ') + } + msg.push(`changed ${changed} package${changed === 1 ? '' : 's'}`) + } + if (audited) { + msg.push(', and ') + } + } + if (audited) { + msg.push(`audited ${audited} package${audited === 1 ? '' : 's'}`) + } + msg.push(` in ${ms(Date.now() - npm.started)}`) + output(msg.join('')) +} + +const packagesFundingMessage = ({ funding }) => { + if (!funding) { + return + } + + output('') + const pkg = funding === 1 ? 'package' : 'packages' + const is = funding === 1 ? 'is' : 'are' + output(`${funding} ${pkg} ${is} looking for funding`) + output(' run `npm fund` for details') +} + +module.exports = reifyOutput diff --git a/deps/npm/lib/utils/replace-info.js b/deps/npm/lib/utils/replace-info.js deleted file mode 100644 index 36e35b0785ab02..00000000000000 --- a/deps/npm/lib/utils/replace-info.js +++ /dev/null @@ -1,22 +0,0 @@ -const URL = require('url').URL - -// replaces auth info in an array -// of arguments or in a strings -function replaceInfo (arg) { - const isArray = Array.isArray(arg) - const isString = typeof arg === 'string' - - if (!isArray && !isString) return arg - - const args = isString ? arg.split(' ') : arg - const info = args.map(arg => { - try { - const url = new URL(arg) - return url.password === '' ? arg : arg.replace(url.password, '***') - } catch (e) { return arg } - }) - - return isString ? info.join(' ') : info -} - -module.exports = replaceInfo diff --git a/deps/npm/lib/utils/set-user-agent.js b/deps/npm/lib/utils/set-user-agent.js new file mode 100644 index 00000000000000..8c90911162ceef --- /dev/null +++ b/deps/npm/lib/utils/set-user-agent.js @@ -0,0 +1,15 @@ +// Expand placeholder values in user-agent +const ciDetect = require('@npmcli/ci-detect') +const { version } = require('../../package.json') +module.exports = config => { + const ciName = ciDetect() + const ci = ciName ? `ci/${ciName}` : '' + const ua = (config.get('user-agent') || '') + .replace(/\{node-version\}/gi, config.get('node-version')) + .replace(/\{npm-version\}/gi, version) + .replace(/\{platform\}/gi, process.platform) + .replace(/\{arch\}/gi, process.arch) + .replace(/\{ci\}/gi, ci) + + config.set('user-agent', ua.trim()) +} diff --git a/deps/npm/lib/utils/setup-log.js b/deps/npm/lib/utils/setup-log.js new file mode 100644 index 00000000000000..dde55b4facafcc --- /dev/null +++ b/deps/npm/lib/utils/setup-log.js @@ -0,0 +1,67 @@ +// module to set the appropriate log settings based on configs +// returns a boolean to say whether we should enable color on +// stdout or not. +// +// Also (and this is a really inexcusable kludge), we patch the +// log.warn() method so that when we see a peerDep override +// explanation from Arborist, we can replace the object with a +// highly abbreviated explanation of what's being overridden. +const log = require('npmlog') +const { explain } = require('./explain-eresolve.js') + +module.exports = (config) => { + const color = config.get('color') + + const { warn } = log + + log.warn = (heading, ...args) => { + if (heading === 'ERESOLVE' && args[1] && typeof args[1] === 'object') { + warn(heading, args[0]) + return warn('', explain(args[1])) + } + return warn(heading, ...args) + } + + if (config.get('timing') && config.get('loglevel') === 'notice') { + log.level = 'timing' + } else { + log.level = config.get('loglevel') + } + log.heading = config.get('heading') || 'npm' + + const stdoutTTY = process.stdout.isTTY + const stderrTTY = process.stderr.isTTY + const dumbTerm = process.env.TERM === 'dumb' + const stderrNotDumb = stderrTTY && !dumbTerm + + const enableColorStderr = color === 'always' ? true + : color === false ? false + : stderrTTY + + const enableColorStdout = color === 'always' ? true + : color === false ? false + : stdoutTTY + + if (enableColorStderr) { + log.enableColor() + } else { + log.disableColor() + } + + if (config.get('unicode')) { + log.enableUnicode() + } else { + log.disableUnicode() + } + + // if it's more than error, don't show progress + const quiet = log.levels[log.level] > log.levels.error + + if (config.get('progress') && stderrNotDumb && !quiet) { + log.enableProgress() + } else { + log.disableProgress() + } + + return enableColorStdout +} diff --git a/deps/npm/lib/utils/tar.js b/deps/npm/lib/utils/tar.js new file mode 100644 index 00000000000000..4ad1219f21bbd0 --- /dev/null +++ b/deps/npm/lib/utils/tar.js @@ -0,0 +1,113 @@ +'use strict' + +const tar = require('tar') +const ssri = require('ssri') +const npmlog = require('npmlog') +const byteSize = require('byte-size') +const columnify = require('columnify') + +module.exports = { logTar, getContents } + +function logTar (tarball, opts = {}) { + const { unicode = false, log = npmlog } = opts + log.notice('') + log.notice('', `${unicode ? '📦 ' : 'package:'} ${tarball.name}@${tarball.version}`) + log.notice('=== Tarball Contents ===') + if (tarball.files.length) { + log.notice('', columnify(tarball.files.map((f) => { + const bytes = byteSize(f.size) + return { path: f.path, size: `${bytes.value}${bytes.unit}` } + }), { + include: ['size', 'path'], + showHeaders: false + })) + } + if (tarball.bundled.length) { + log.notice('=== Bundled Dependencies ===') + tarball.bundled.forEach((name) => log.notice('', name)) + } + log.notice('=== Tarball Details ===') + log.notice('', columnify([ + { name: 'name:', value: tarball.name }, + { name: 'version:', value: tarball.version }, + tarball.filename && { name: 'filename:', value: tarball.filename }, + { name: 'package size:', value: byteSize(tarball.size) }, + { name: 'unpacked size:', value: byteSize(tarball.unpackedSize) }, + { name: 'shasum:', value: tarball.shasum }, + { + name: 'integrity:', + value: tarball.integrity.toString().substr(0, 20) + '[...]' + tarball.integrity.toString().substr(80) + }, + tarball.bundled.length && { name: 'bundled deps:', value: tarball.bundled.length }, + tarball.bundled.length && { name: 'bundled files:', value: tarball.entryCount - tarball.files.length }, + tarball.bundled.length && { name: 'own files:', value: tarball.files.length }, + { name: 'total files:', value: tarball.entryCount } + ].filter((x) => x), { + include: ['name', 'value'], + showHeaders: false + })) + log.notice('', '') +} + +async function getContents (manifest, tarball) { + const files = [] + const bundled = new Set() + let totalEntries = 0 + let totalEntrySize = 0 + + // reads contents of tarball + const stream = tar.t({ + onentry (entry) { + totalEntries++ + totalEntrySize += entry.size + const p = entry.path + if (p.startsWith('package/node_modules/')) { + const name = p.match(/^package\/node_modules\/((?:@[^/]+\/)?[^/]+)/)[1] + bundled.add(name) + } + files.push({ + path: entry.path.replace(/^package\//, ''), + size: entry.size, + mode: entry.mode + }) + } + }) + stream.end(tarball) + + const integrity = await ssri.fromData(tarball, { + algorithms: ['sha1', 'sha512'] + }) + + const comparator = (a, b) => { + return a.path.localeCompare(b.path, undefined, { + sensitivity: 'case', + numeric: true + }) + } + + const isUpper = (str) => { + const ch = str.charAt(0) + return ch >= 'A' && ch <= 'Z' + } + + const uppers = files.filter(file => isUpper(file.path)) + const others = files.filter(file => !isUpper(file.path)) + + uppers.sort(comparator) + others.sort(comparator) + + const shasum = integrity.sha1[0].hexDigest() + return { + id: manifest._id || `${manifest.name}@${manifest.version}`, + name: manifest.name, + version: manifest.version, + size: tarball.length, + unpackedSize: totalEntrySize, + shasum, + integrity: ssri.parse(integrity.sha512[0]), + filename: `${manifest.name}-${manifest.version}.tgz`, + files: uppers.concat(others), + entryCount: totalEntries, + bundled: Array.from(bundled) + } +} diff --git a/deps/npm/lib/utils/temp-filename.js b/deps/npm/lib/utils/temp-filename.js deleted file mode 100644 index 6b8245e8b790f0..00000000000000 --- a/deps/npm/lib/utils/temp-filename.js +++ /dev/null @@ -1,7 +0,0 @@ -'use strict' -var uniqueFilename = require('unique-filename') -var npm = require('../npm.js') - -module.exports = function (prefix) { - return uniqueFilename(npm.tmp, prefix) -} diff --git a/deps/npm/lib/utils/umask.js b/deps/npm/lib/utils/umask.js deleted file mode 100644 index 2dde1befa69dce..00000000000000 --- a/deps/npm/lib/utils/umask.js +++ /dev/null @@ -1,17 +0,0 @@ -var umask = require('umask') -var npmlog = require('npmlog') -var _fromString = umask.fromString - -module.exports = umask - -// fromString with logging callback -umask.fromString = function (val) { - _fromString(val, function (err, result) { - if (err) { - npmlog.warn('invalid umask', err.message) - } - val = result - }) - - return val -} diff --git a/deps/npm/lib/utils/unsupported.js b/deps/npm/lib/utils/unsupported.js index c78cdcbc294940..8e880c2cc5e250 100644 --- a/deps/npm/lib/utils/unsupported.js +++ b/deps/npm/lib/utils/unsupported.js @@ -1,10 +1,9 @@ -'use strict' -var semver = require('semver') -var supported = require('../../package.json').engines.node -var knownBroken = '<6.2.0 || 9 <9.3.0' +const semver = require('semver') +const supported = require('../../package.json').engines.node +const knownBroken = '<6.2.0 || 9 <9.3.0' -var checkVersion = exports.checkVersion = function (version) { - var versionNoPrerelease = version.replace(/-.*$/, '') +const checkVersion = exports.checkVersion = version => { + const versionNoPrerelease = version.replace(/-.*$/, '') return { version: versionNoPrerelease, broken: semver.satisfies(versionNoPrerelease, knownBroken), @@ -12,8 +11,8 @@ var checkVersion = exports.checkVersion = function (version) { } } -exports.checkForBrokenNode = function () { - var nodejs = checkVersion(process.version) +exports.checkForBrokenNode = () => { + const nodejs = checkVersion(process.version) if (nodejs.broken) { console.error('ERROR: npm is known not to run on Node.js ' + process.version) console.error("You'll need to upgrade to a newer Node.js version in order to use this") @@ -22,10 +21,10 @@ exports.checkForBrokenNode = function () { } } -exports.checkForUnsupportedNode = function () { - var nodejs = checkVersion(process.version) +exports.checkForUnsupportedNode = () => { + const nodejs = checkVersion(process.version) if (nodejs.unsupported) { - var log = require('npmlog') + const log = require('npmlog') log.warn('npm', 'npm does not support Node.js ' + process.version) log.warn('npm', 'You should probably upgrade to a newer version of node as we') log.warn('npm', "can't make any promises that npm will work with this version.") diff --git a/deps/npm/lib/utils/update-notifier.js b/deps/npm/lib/utils/update-notifier.js new file mode 100644 index 00000000000000..dda6f3dcaa37bd --- /dev/null +++ b/deps/npm/lib/utils/update-notifier.js @@ -0,0 +1,122 @@ +// print a banner telling the user to upgrade npm to latest +// but not in CI, and not if we're doing that already. +// Check daily for betas, and weekly otherwise. + +const pacote = require('pacote') +const ciDetect = require('@npmcli/ci-detect') +const semver = require('semver') +const chalk = require('chalk') +const { promisify } = require('util') +const stat = promisify(require('fs').stat) +const writeFile = promisify(require('fs').writeFile) +const { resolve } = require('path') + +const isGlobalNpmUpdate = npm => { + return npm.flatOptions.global && + ['install', 'update'].includes(npm.command) && + npm.argv.includes('npm') +} + +// update check frequency +const DAILY = 1000 * 60 * 60 * 24 +const WEEKLY = DAILY * 7 + +const updateTimeout = async (npm, duration) => { + const t = new Date(Date.now() - duration) + // don't put it in the _cacache folder, just in npm's cache + const f = resolve(npm.flatOptions.cache, '../_update-notifier-last-checked') + // if we don't have a file, then definitely check it. + const st = await stat(f).catch(() => ({ mtime: t - 1 })) + + if (t > st.mtime) { + // best effort, if this fails, it's ok. + // might be using /dev/null as the cache or something weird like that. + await writeFile(f, '').catch(() => {}) + return true + } else { + return false + } +} + +const updateNotifier = module.exports = async (npm, spec = 'latest') => { + // never check for updates in CI, when updating npm already, or opted out + if (!npm.config.get('update-notifier') || + isGlobalNpmUpdate(npm) || + ciDetect()) { + return null + } + + // if we're on a prerelease train, then updates are coming fast + // check for a new one daily. otherwise, weekly. + const { version } = npm + const current = semver.parse(version) + + // if we're on a beta train, always get the next beta + if (current.prerelease.length) { + spec = `^${version}` + } + + // while on a beta train, get updates daily + const duration = spec !== 'latest' ? DAILY : WEEKLY + + // if we've already checked within the specified duration, don't check again + if (!(await updateTimeout(npm, duration))) { + return null + } + + // if they're currently using a prerelease, nudge to the next prerelease + // otherwise, nudge to latest. + const useColor = npm.log.useColor() + + const mani = await pacote.manifest(`npm@${spec}`, { + // always prefer latest, even if doing --tag=whatever on the cmd + defaultTag: 'latest', + ...npm.flatOptions + }).catch(() => null) + + // if pacote failed, give up + if (!mani) { + return null + } + + const latest = mani.version + + // if the current version is *greater* than latest, we're on a 'next' + // and should get the updates from that release train. + // Note that this isn't another http request over the network, because + // the packument will be cached by pacote from previous request. + if (semver.gt(version, latest) && spec === 'latest') { + return updateNotifier(npm, `^${version}`) + } + + // if we already have something >= the desired spec, then we're done + if (semver.gte(version, latest)) { + return null + } + + // ok! notify the user about this update they should get. + // The message is saved for printing at process exit so it will not get + // lost in any other messages being printed as part of the command. + const update = semver.parse(mani.version) + const type = update.major !== current.major ? 'major' + : update.minor !== current.minor ? 'minor' + : update.patch !== current.patch ? 'patch' + : 'prerelease' + const typec = !useColor ? type + : type === 'major' ? chalk.red(type) + : type === 'minor' ? chalk.yellow(type) + : chalk.green(type) + const oldc = !useColor ? current : chalk.red(current) + const latestc = !useColor ? latest : chalk.green(latest) + const changelog = `https://github.com/npm/cli/releases/tag/v${latest}` + const changelogc = !useColor ? `<${changelog}>` : chalk.cyan(changelog) + const cmd = `npm install -g npm@${latest}` + const cmdc = !useColor ? `\`${cmd}\`` : chalk.green(cmd) + const message = `\nNew ${typec} version of npm available! ` + + `${oldc} -> ${latestc}\n` + + `Changelog: ${changelogc}\n` + + `Run ${cmdc} to update!\n` + const messagec = !useColor ? message : chalk.bgBlack.white(message) + + return messagec +} diff --git a/deps/npm/lib/utils/usage.js b/deps/npm/lib/utils/usage.js index ba069e645e156b..1eda734c0fcf98 100644 --- a/deps/npm/lib/utils/usage.js +++ b/deps/npm/lib/utils/usage.js @@ -1,5 +1,5 @@ 'use strict' -var aliases = require('../config/cmd-list').aliases +var aliases = require('../utils/cmd-list').aliases module.exports = function usage (cmd, txt, opt) { var post = Object.keys(aliases).reduce(function (p, c) { diff --git a/deps/npm/lib/version.js b/deps/npm/lib/version.js index 6619a8ba9d0d76..0cfe5906ed551f 100644 --- a/deps/npm/lib/version.js +++ b/deps/npm/lib/version.js @@ -1,355 +1,71 @@ -'use strict' -const BB = require('bluebird') - -const assert = require('assert') -const chain = require('slide').chain -const detectIndent = require('detect-indent') -const detectNewline = require('detect-newline') -const fs = require('graceful-fs') -const readFile = BB.promisify(require('graceful-fs').readFile) -const git = require('./utils/git.js') -const lifecycle = require('./utils/lifecycle.js') -const log = require('npmlog') +const libversion = require('libnpmversion') const npm = require('./npm.js') const output = require('./utils/output.js') -const parseJSON = require('./utils/parse-json.js') -const path = require('path') -const semver = require('semver') -const stringifyPackage = require('stringify-package') -const writeFileAtomic = require('write-file-atomic') - -version.usage = 'npm version [ | major | minor | patch | premajor | preminor | prepatch | prerelease [--preid=] | from-git]' + - '\n(run in package dir)\n' + - "'npm -v' or 'npm --version' to print npm version " + - '(' + npm.version + ')\n' + - "'npm view version' to view a package's " + - 'published version\n' + - "'npm ls' to inspect current package/dependency versions" +const usageUtil = require('./utils/usage.js') -// npm version -module.exports = version -function version (args, silent, cb_) { - if (typeof cb_ !== 'function') { - cb_ = silent - silent = false +const completion = (opts, cb) => { + const none = require('./utils/completion/none.js') + const { conf: { argv: { remain } } } = opts + if (remain.length > 2) { + return none(opts, cb) } - if (args.length > 1) return cb_(version.usage) - - readPackage(function (er, data, indent, newline) { - if (!args.length) return dump(data, cb_) - - if (er) { - log.error('version', 'No valid package.json found') - return cb_(er) - } - - if (args[0] === 'from-git') { - retrieveTagVersion(silent, data, cb_) - } else { - var newVersion = semver.valid(args[0]) - if (!newVersion) newVersion = semver.inc(data.version, args[0], npm.config.get('preid')) - if (!newVersion) return cb_(version.usage) - persistVersion(newVersion, silent, data, cb_) - } - }) -} - -function retrieveTagVersion (silent, data, cb_) { - chain([ - verifyGit, - parseLastGitTag - ], function (er, results) { - if (er) return cb_(er) - var localData = { - hasGit: true, - existingTag: true - } - - var version = results[results.length - 1] - persistVersion(version, silent, data, localData, cb_) - }) -} - -function parseLastGitTag (cb) { - var options = { env: process.env } - git.whichAndExec(['describe', '--abbrev=0'], options, function (er, stdout) { - if (er) { - if (er.message.indexOf('No names found') !== -1) return cb(new Error('No tags found')) - return cb(er) - } - - var tag = stdout.trim() - var prefix = npm.config.get('tag-version-prefix') - // Strip the prefix from the start of the tag: - if (tag.indexOf(prefix) === 0) tag = tag.slice(prefix.length) - var version = semver.valid(tag) - if (!version) return cb(new Error(tag + ' is not a valid version')) - cb(null, version) - }) -} - -function persistVersion (newVersion, silent, data, localData, cb_) { - if (typeof localData === 'function') { - cb_ = localData - localData = {} - } - - if (!npm.config.get('allow-same-version') && data.version === newVersion) { - return cb_(new Error('Version not changed, might want --allow-same-version')) - } - data.version = newVersion - var lifecycleData = Object.create(data) - lifecycleData._id = data.name + '@' + newVersion - - var where = npm.prefix - chain([ - !localData.hasGit && [checkGit, localData], - [lifecycle, lifecycleData, 'preversion', where], - [updatePackage, newVersion, silent], - [lifecycle, lifecycleData, 'version', where], - [commit, localData, newVersion], - [lifecycle, lifecycleData, 'postversion', where] - ], cb_) -} - -function readPackage (cb) { - var packagePath = path.join(npm.localPrefix, 'package.json') - fs.readFile(packagePath, 'utf8', function (er, data) { - if (er) return cb(new Error(er)) - var indent - var newline - try { - indent = detectIndent(data).indent - newline = detectNewline(data) - data = JSON.parse(data) - } catch (e) { - er = e - data = null - } - cb(er, data, indent, newline) - }) + return cb(null, [ + 'major', + 'minor', + 'patch', + 'premajor', + 'preminor', + 'prepatch', + 'prerelease', + 'from-git' + ]) } -function updatePackage (newVersion, silent, cb_) { - function cb (er) { - if (!er && !silent) output('v' + newVersion) - cb_(er) +const usage = usageUtil('version', +`npm version [ | major | minor | patch | premajor | preminor | prepatch | prerelease [--preid=] | from-git] +(run in package dir) + +'npm -v' or 'npm --version' to print npm version (${npm.version}) +'npm view version' to view a package's published version +'npm ls' to inspect current package/dependency versions` +) + +const cmd = (args, cb) => version(args).then(() => cb()).catch(cb) + +const version = async args => { + switch (args.length) { + case 0: + return list() + case 1: + return output(await libversion(args[0], { + ...npm.flatOptions, + path: npm.prefix + })) + default: + throw version.usage } - - readPackage(function (er, data, indent, newline) { - if (er) return cb(new Error(er)) - data.version = newVersion - write(data, 'package.json', indent, newline, cb) - }) -} - -function commit (localData, newVersion, cb) { - updateShrinkwrap(newVersion, function (er, hasShrinkwrap, hasLock) { - if (er || !localData.hasGit) return cb(er) - localData.hasShrinkwrap = hasShrinkwrap - localData.hasPackageLock = hasLock - _commit(newVersion, localData, cb) - }) -} - -const SHRINKWRAP = 'npm-shrinkwrap.json' -const PKGLOCK = 'package-lock.json' - -function readLockfile (name) { - return readFile( - path.join(npm.localPrefix, name), 'utf8' - ).catch({code: 'ENOENT'}, () => null) -} - -function updateShrinkwrap (newVersion, cb) { - BB.join( - readLockfile(SHRINKWRAP), - readLockfile(PKGLOCK), - (shrinkwrap, lockfile) => { - if (!shrinkwrap && !lockfile) { - return cb(null, false, false) - } - const file = shrinkwrap ? SHRINKWRAP : PKGLOCK - let data - let indent - let newline - try { - data = parseJSON(shrinkwrap || lockfile) - indent = detectIndent(shrinkwrap || lockfile).indent - newline = detectNewline(shrinkwrap || lockfile) - } catch (err) { - log.error('version', `Bad ${file} data.`) - return cb(err) - } - data.version = newVersion - write(data, file, indent, newline, (err) => { - if (err) { - log.error('version', `Failed to update version in ${file}`) - return cb(err) - } else { - return cb(null, !!shrinkwrap, !!lockfile) - } - }) - } - ) -} - -function dump (data, cb) { - var v = {} - - if (data && data.name && data.version) v[data.name] = data.version - v.npm = npm.version - Object.keys(process.versions).sort().forEach(function (k) { - v[k] = process.versions[k] - }) - - if (npm.config.get('json')) v = JSON.stringify(v, null, 2) - - output(v) - cb() } -function statGitFolder (cb) { - fs.stat(path.join(npm.localPrefix, '.git'), cb) -} - -function callGitStatus (cb) { - git.whichAndExec( - [ 'status', '--porcelain' ], - { env: process.env }, - cb - ) -} +const list = async () => { + const results = {} + const { promisify } = require('util') + const { resolve } = require('path') + const readFile = promisify(require('fs').readFile) + const pj = resolve(npm.prefix, 'package.json') -function cleanStatusLines (stdout) { - var lines = stdout.trim().split('\n').filter(function (line) { - return line.trim() && !line.match(/^\?\? /) - }).map(function (line) { - return line.trim() - }) + const pkg = await readFile(pj, 'utf8') + .then(data => JSON.parse(data)) + .catch(() => ({})) - return lines -} - -function verifyGit (cb) { - function checkStatus (er) { - if (er) return cb(er) - callGitStatus(checkStdout) + if (pkg.name && pkg.version) { + results[pkg.name] = pkg.version } - - function checkStdout (er, stdout) { - if (er) return cb(er) - var lines = cleanStatusLines(stdout) - if (lines.length > 0) { - return cb(new Error( - 'Git working directory not clean.\n' + lines.join('\n') - )) - } - - cb() + results.npm = npm.version + for (const [key, version] of Object.entries(process.versions)) { + results[key] = version } - statGitFolder(checkStatus) -} - -function checkGit (localData, cb) { - statGitFolder(function (er) { - var doGit = !er && npm.config.get('git-tag-version') - if (!doGit) { - if (er && npm.config.get('git-tag-version')) log.verbose('version', 'error checking for .git', er) - log.verbose('version', 'not tagging in git') - return cb(null, false) - } - - // check for git - callGitStatus(function (er, stdout) { - if (er && er.code === 'ENOGIT') { - log.warn( - 'version', - 'This is a Git checkout, but the git command was not found.', - 'npm could not create a Git tag for this release!' - ) - return cb(null, false) - } - - var lines = cleanStatusLines(stdout) - if (lines.length && !npm.config.get('force')) { - return cb(new Error( - 'Git working directory not clean.\n' + lines.join('\n') - )) - } - localData.hasGit = true - cb(null, true) - }) - }) + output(npm.flatOptions.json ? JSON.stringify(results, null, 2) : results) } -module.exports.buildCommitArgs = buildCommitArgs -function buildCommitArgs (args) { - const add = [] - args = args || [] - if (args[0] === 'commit') args.shift() - if (!npm.config.get('commit-hooks')) add.push('-n') - if (npm.config.get('allow-same-version')) add.push('--allow-empty') - return ['commit', ...add, ...args] -} - -module.exports.buildTagFlags = buildTagFlags -function buildTagFlags () { - return '-'.concat( - npm.config.get('sign-git-tag') ? 's' : '', - npm.config.get('allow-same-version') ? 'f' : '', - 'm' - ) -} - -function _commit (version, localData, cb) { - const options = { env: process.env } - const message = npm.config.get('message').replace(/%s/g, version) - const signCommit = npm.config.get('sign-git-commit') - const commitArgs = buildCommitArgs([ - 'commit', - ...(signCommit ? ['-S', '-m'] : ['-m']), - message - ]) - - stagePackageFiles(localData, options).then(() => { - return git.exec(commitArgs, options) - }).then(() => { - if (!localData.existingTag) { - return git.exec([ - 'tag', npm.config.get('tag-version-prefix') + version, - buildTagFlags(), message - ], options) - } - }).nodeify(cb) -} - -function stagePackageFiles (localData, options) { - return addLocalFile('package.json', options, false).then(() => { - if (localData.hasShrinkwrap) { - return addLocalFile('npm-shrinkwrap.json', options, true) - } else if (localData.hasPackageLock) { - return addLocalFile('package-lock.json', options, true) - } - }) -} - -function addLocalFile (file, options, ignoreFailure) { - const p = git.exec(['add', path.join(npm.localPrefix, file)], options) - return ignoreFailure - ? p.catch(() => {}) - : p -} - -function write (data, file, indent, newline, cb) { - assert(data && typeof data === 'object', 'must pass data to version write') - assert(typeof file === 'string', 'must pass filename to write to version write') - - log.verbose('version.write', 'data', data, 'to', file) - writeFileAtomic( - path.join(npm.localPrefix, file), - stringifyPackage(data, indent, newline), - cb - ) -} +module.exports = Object.assign(cmd, { usage, completion }) diff --git a/deps/npm/lib/view.js b/deps/npm/lib/view.js index a16884e25f647f..b8c22cd6a1274a 100644 --- a/deps/npm/lib/view.js +++ b/deps/npm/lib/view.js @@ -1,55 +1,42 @@ -'use strict' - // npm view [pkg [pkg ...]] -module.exports = view - -const BB = require('bluebird') const byteSize = require('byte-size') const color = require('ansicolors') const columns = require('cli-columns') -const npmConfig = require('./config/figgy-config.js') const log = require('npmlog') -const figgyPudding = require('figgy-pudding') -const npa = require('libnpm/parse-arg') +const npa = require('npm-package-arg') const npm = require('./npm.js') -const packument = require('libnpm/packument') +const { packument } = require('pacote') const path = require('path') -const readJson = require('libnpm/read-json') +const { inspect, promisify } = require('util') +const readJson = promisify(require('read-package-json')) const relativeDate = require('tiny-relative-date') const semver = require('semver') const style = require('ansistyles') -const usage = require('./utils/usage') -const util = require('util') -const validateName = require('validate-npm-package-name') - -const ViewConfig = figgyPudding({ - global: {}, - json: {}, - tag: {}, - unicode: {} -}) - -view.usage = usage( +const usageUtil = require('./utils/usage') + +const usage = usageUtil( 'view', 'npm view [<@scope>/][@] [[.subfield]...]' ) -view.completion = function (opts, cb) { +const cmd = (args, cb) => view(args).then(() => cb()).catch(cb) + +const completion = async (opts, cb) => { if (opts.conf.argv.remain.length <= 2) { - // FIXME: there used to be registry completion here, but it stopped making - // sense somewhere around 50,000 packages on the registry + // There used to be registry completion here, but it stopped + // making sense somewhere around 50,000 packages on the registry return cb() } - // have the package, get the fields. - const config = ViewConfig(npmConfig()) - const tag = config.tag + // have the package, get the fields + const config = { ...npm.flatOptions, fullMetadata: true, preferOnline: true } + const { defaultTag } = config const spec = npa(opts.conf.argv.remain[2]) - return packument(spec, config).then(d => { - const dv = d.versions[d['dist-tags'][tag]] - d.versions = Object.keys(d.versions).sort(semver.compareLoose) - return getFields(d).concat(getFields(dv)) - }).nodeify(cb) + const pckmnt = await packument(spec, config) + const dv = pckmnt.versions[pckmnt['dist-tags'][defaultTag]] + pckmnt.versions = Object.keys(pckmnt.versions).sort(semver.compareLoose) + const fields = getFields(pckmnt).concat(getFields(dv)) + return cb(null, fields) function getFields (d, f, pref) { f = f || [] @@ -73,15 +60,10 @@ view.completion = function (opts, cb) { } } -function view (args, silent, cb) { - if (typeof cb !== 'function') { - cb = silent - silent = false - } - +const view = async args => { if (!args.length) args = ['.'] - const opts = ViewConfig(npmConfig()) + const opts = { ...npm.flatOptions, preferOnline: true, fullMetadata: true } const pkg = args.shift() let nv if (/^[.]@/.test(pkg)) { @@ -93,247 +75,207 @@ function view (args, silent, cb) { const local = (name === '.' || !name) if (opts.global && local) { - return cb(new Error('Cannot use view command in global mode.')) + throw new Error('Cannot use view command in global mode.') } if (local) { const dir = npm.prefix - BB.resolve(readJson(path.resolve(dir, 'package.json'))).nodeify((er, d) => { - d = d || {} - if (er && er.code !== 'ENOENT' && er.code !== 'ENOTDIR') return cb(er) - if (!d.name) return cb(new Error('Invalid package.json')) - - const p = d.name - nv = npa(p) - if (pkg && ~pkg.indexOf('@')) { - nv.rawSpec = pkg.split('@')[pkg.indexOf('@')] - } - - fetchAndRead(nv, args, silent, opts, cb) - }) + const manifest = await readJson(path.resolve(dir, 'package.json')) + if (!manifest || !manifest.name) throw new Error('Invalid package.json') + const p = manifest.name + nv = npa(p) + if (pkg && ~pkg.indexOf('@')) { + nv.rawSpec = pkg.split('@')[pkg.indexOf('@')] + } + await fetchAndRead(nv, args, opts) } else { - fetchAndRead(nv, args, silent, opts, cb) + await fetchAndRead(nv, args, opts) } } -function fetchAndRead (nv, args, silent, opts, cb) { +const fetchAndRead = async (nv, args, opts) => { // get the data about this package - let version = nv.rawSpec || npm.config.get('tag') - - return packument(nv, opts.concat({ - fullMetadata: true, - 'prefer-online': true - })).catch(err => { - // TODO - this should probably go into pacote, but the tests expect it. - if (err.code === 'E404') { - err.message = `'${nv.name}' is not in the npm registry.` - const validated = validateName(nv.name) - if (!validated.validForNewPackages) { - err.message += '\n' - err.message += (validated.errors || []).join('\n') - err.message += (validated.warnings || []).join('\n') - } else { - err.message += '\nYou should bug the author to publish it' - err.message += '\n(or use the name yourself!)' - err.message += '\n' - err.message += '\nNote that you can also install from a' - err.message += '\ntarball, folder, http url, or git url.' - } - } - throw err - }).then(data => { - if (data['dist-tags'] && data['dist-tags'][version]) { - version = data['dist-tags'][version] - } + let version = nv.rawSpec || npm.flatOptions.defaultTag - if (data.time && data.time.unpublished) { - const u = data.time.unpublished - let er = new Error('Unpublished by ' + u.name + ' on ' + u.time) - er.statusCode = 404 - er.code = 'E404' - er.pkgid = data._id - throw er - } + const pckmnt = await packument(nv, opts) - const results = [] - let error = null - const versions = data.versions || {} - data.versions = Object.keys(versions).sort(semver.compareLoose) - if (!args.length) args = [''] + if (pckmnt['dist-tags'] && pckmnt['dist-tags'][version]) { + version = pckmnt['dist-tags'][version] + } - // remove readme unless we asked for it - if (args.indexOf('readme') === -1) { - delete data.readme - } + if (pckmnt.time && pckmnt.time.unpublished) { + const u = pckmnt.time.unpublished + const er = new Error('Unpublished by ' + u.name + ' on ' + u.time) + er.statusCode = 404 + er.code = 'E404' + er.pkgid = pckmnt._id + throw er + } - Object.keys(versions).forEach(function (v) { - if (semver.satisfies(v, version, true)) { - args.forEach(function (args) { - // remove readme unless we asked for it - if (args.indexOf('readme') !== -1) { - delete versions[v].readme - } - results.push(showFields(data, versions[v], args)) - }) - } - }) - let retval = results.reduce(reducer, {}) + const results = [] + const versions = pckmnt.versions || {} + pckmnt.versions = Object.keys(versions).sort(semver.compareLoose) + if (!args.length) args = [''] - if (args.length === 1 && args[0] === '') { - retval = cleanBlanks(retval) - log.silly('view', retval) - } + // remove readme unless we asked for it + if (args.indexOf('readme') === -1) { + delete pckmnt.readme + } - if (silent) { - return retval - } else if (error) { - throw error - } else if ( - !opts.json && - args.length === 1 && - args[0] === '' - ) { - data.version = version - return BB.all( - results.map((v) => prettyView(data, v[Object.keys(v)[0]][''], opts)) - ).then(() => retval) - } else { - return BB.fromNode(cb => { - printData(retval, data._id, opts, cb) - }).then(() => retval) + Object.keys(versions).forEach(function (v) { + if (semver.satisfies(v, version, true)) { + args.forEach(arg => { + // remove readme unless we asked for it + if (args.indexOf('readme') !== -1) { + delete versions[v].readme + } + results.push(showFields(pckmnt, versions[v], arg)) + }) } - }).nodeify(cb) + }) + let retval = results.reduce(reducer, {}) + + if (args.length === 1 && args[0] === '') { + retval = cleanBlanks(retval) + log.silly('view', retval) + } + + if ( + !opts.json && + args.length === 1 && + args[0] === '' + ) { + // general view + pckmnt.version = version + await Promise.all( + results.map((v) => prettyView(pckmnt, v[Object.keys(v)[0]][''], opts)) + ) + return retval + } else { + // view by field name + await printData(retval, pckmnt._id, opts) + return retval + } } -function prettyView (packument, manifest, opts) { +const prettyView = async (packument, manifest, opts) => { // More modern, pretty printing of default view const unicode = opts.unicode - return BB.try(() => { - if (!manifest) { - log.error( - 'view', - 'No matching versions.\n' + - 'To see a list of versions, run:\n' + - `> npm view ${packument.name} versions` - ) - return - } - const tags = [] - Object.keys(packument['dist-tags']).forEach((t) => { - const version = packument['dist-tags'][t] - tags.push(`${style.bright(color.green(t))}: ${version}`) - }) - const unpackedSize = manifest.dist.unpackedSize && - byteSize(manifest.dist.unpackedSize) - const licenseField = manifest.license || manifest.licence || 'Proprietary' - const info = { - name: color.green(manifest.name), - version: color.green(manifest.version), - bins: Object.keys(manifest.bin || {}).map(color.yellow), - versions: color.yellow(packument.versions.length + ''), - description: manifest.description, - deprecated: manifest.deprecated, - keywords: (packument.keywords || []).map(color.yellow), - license: typeof licenseField === 'string' - ? licenseField - : (licenseField.type || 'Proprietary'), - deps: Object.keys(manifest.dependencies || {}).map((dep) => { - return `${color.yellow(dep)}: ${manifest.dependencies[dep]}` - }), - publisher: manifest._npmUser && unparsePerson({ - name: color.yellow(manifest._npmUser.name), - email: color.cyan(manifest._npmUser.email) - }), - modified: packument.time ? color.yellow(relativeDate(packument.time[packument.version])) : undefined, - maintainers: (packument.maintainers || []).map((u) => unparsePerson({ - name: color.yellow(u.name), - email: color.cyan(u.email) - })), - repo: ( - manifest.bugs && (manifest.bugs.url || manifest.bugs) - ) || ( - manifest.repository && (manifest.repository.url || manifest.repository) - ), - site: ( - manifest.homepage && (manifest.homepage.url || manifest.homepage) - ), - stars: color.yellow('' + packument.users ? Object.keys(packument.users || {}).length : 0), - tags, - tarball: color.cyan(manifest.dist.tarball), - shasum: color.yellow(manifest.dist.shasum), - integrity: manifest.dist.integrity && color.yellow(manifest.dist.integrity), - fileCount: manifest.dist.fileCount && color.yellow(manifest.dist.fileCount), - unpackedSize: unpackedSize && color.yellow(unpackedSize.value) + ' ' + unpackedSize.unit - } - if (info.license.toLowerCase().trim() === 'proprietary') { - info.license = style.bright(color.red(info.license)) - } else { - info.license = color.green(info.license) - } + const tags = [] + + Object.keys(packument['dist-tags']).forEach((t) => { + const version = packument['dist-tags'][t] + tags.push(`${style.bright(color.green(t))}: ${version}`) + }) + const unpackedSize = manifest.dist.unpackedSize && + byteSize(manifest.dist.unpackedSize) + const licenseField = manifest.license || 'Proprietary' + const info = { + name: color.green(manifest.name), + version: color.green(manifest.version), + bins: Object.keys(manifest.bin || {}).map(color.yellow), + versions: color.yellow(packument.versions.length + ''), + description: manifest.description, + deprecated: manifest.deprecated, + keywords: (packument.keywords || []).map(color.yellow), + license: typeof licenseField === 'string' + ? licenseField + : (licenseField.type || 'Proprietary'), + deps: Object.keys(manifest.dependencies || {}).map((dep) => { + return `${color.yellow(dep)}: ${manifest.dependencies[dep]}` + }), + publisher: manifest._npmUser && unparsePerson({ + name: color.yellow(manifest._npmUser.name), + email: color.cyan(manifest._npmUser.email) + }), + modified: packument.time ? color.yellow(relativeDate(packument.time[packument.version])) : undefined, + maintainers: (packument.maintainers || []).map((u) => unparsePerson({ + name: color.yellow(u.name), + email: color.cyan(u.email) + })), + repo: ( + manifest.bugs && (manifest.bugs.url || manifest.bugs) + ) || ( + manifest.repository && (manifest.repository.url || manifest.repository) + ), + site: ( + manifest.homepage && (manifest.homepage.url || manifest.homepage) + ), + tags, + tarball: color.cyan(manifest.dist.tarball), + shasum: color.yellow(manifest.dist.shasum), + integrity: manifest.dist.integrity && color.yellow(manifest.dist.integrity), + fileCount: manifest.dist.fileCount && color.yellow(manifest.dist.fileCount), + unpackedSize: unpackedSize && color.yellow(unpackedSize.value) + ' ' + unpackedSize.unit + } + if (info.license.toLowerCase().trim() === 'proprietary') { + info.license = style.bright(color.red(info.license)) + } else { + info.license = color.green(info.license) + } + console.log('') + console.log( + style.underline(style.bright(`${info.name}@${info.version}`)) + + ' | ' + info.license + + ' | deps: ' + (info.deps.length ? color.cyan(info.deps.length) : color.green('none')) + + ' | versions: ' + info.versions + ) + info.description && console.log(info.description) + if (info.repo || info.site) { + info.site && console.log(color.cyan(info.site)) + } + + const warningSign = unicode ? ' ⚠️ ' : '!!' + info.deprecated && console.log( + `\n${style.bright(color.red('DEPRECATED'))}${ + warningSign + } - ${info.deprecated}` + ) + + if (info.keywords.length) { console.log('') - console.log( - style.underline(style.bright(`${info.name}@${info.version}`)) + - ' | ' + info.license + - ' | deps: ' + (info.deps.length ? color.cyan(info.deps.length) : color.green('none')) + - ' | versions: ' + info.versions - ) - info.description && console.log(info.description) - if (info.repo || info.site) { - info.site && console.log(color.cyan(info.site)) - } + console.log('keywords:', info.keywords.join(', ')) + } - const warningSign = unicode ? ' ⚠️ ' : '!!' - info.deprecated && console.log( - `\n${style.bright(color.red('DEPRECATED'))}${ - warningSign - } - ${info.deprecated}` - ) + if (info.bins.length) { + console.log('') + console.log('bin:', info.bins.join(', ')) + } - if (info.keywords.length) { - console.log('') - console.log('keywords:', info.keywords.join(', ')) - } + console.log('') + console.log('dist') + console.log('.tarball:', info.tarball) + console.log('.shasum:', info.shasum) + info.integrity && console.log('.integrity:', info.integrity) + info.unpackedSize && console.log('.unpackedSize:', info.unpackedSize) - if (info.bins.length) { - console.log('') - console.log('bin:', info.bins.join(', ')) + const maxDeps = 24 + if (info.deps.length) { + console.log('') + console.log('dependencies:') + console.log(columns(info.deps.slice(0, maxDeps), { padding: 1 })) + if (info.deps.length > maxDeps) { + console.log(`(...and ${info.deps.length - maxDeps} more.)`) } + } + if (info.maintainers && info.maintainers.length) { console.log('') - console.log('dist') - console.log('.tarball:', info.tarball) - console.log('.shasum:', info.shasum) - info.integrity && console.log('.integrity:', info.integrity) - info.unpackedSize && console.log('.unpackedSize:', info.unpackedSize) - - const maxDeps = 24 - if (info.deps.length) { - console.log('') - console.log('dependencies:') - console.log(columns(info.deps.slice(0, maxDeps), {padding: 1})) - if (info.deps.length > maxDeps) { - console.log(`(...and ${info.deps.length - maxDeps} more.)`) - } - } + console.log('maintainers:') + info.maintainers.forEach((u) => console.log('-', u)) + } - if (info.maintainers && info.maintainers.length) { - console.log('') - console.log('maintainers:') - info.maintainers.forEach((u) => console.log('-', u)) - } + console.log('') + console.log('dist-tags:') + console.log(columns(info.tags)) + if (info.publisher || info.modified) { + let publishInfo = 'published' + if (info.modified) { publishInfo += ` ${info.modified}` } + if (info.publisher) { publishInfo += ` by ${info.publisher}` } console.log('') - console.log('dist-tags:') - console.log(columns(info.tags)) - - if (info.publisher || info.modified) { - let publishInfo = 'published' - if (info.modified) { publishInfo += ` ${info.modified}` } - if (info.publisher) { publishInfo += ` by ${info.publisher}` } - console.log('') - console.log(publishInfo) - } - }) + console.log(publishInfo) + } } function cleanBlanks (obj) { @@ -384,7 +326,7 @@ function search (data, fields, version, title) { if (index) { field = index[1] index = index[2] - if (data.field && data.field.hasOwnProperty(index)) { + if (data[field] && data[field][index]) { return search(data[field][index], tail, version, title) } else { field = field + '[' + index + ']' @@ -404,15 +346,11 @@ function search (data, fields, version, title) { results = results.reduce(reducer, {}) return results } - if (!data.hasOwnProperty(field)) return undefined + if (!data[field]) return undefined data = data[field] if (tail.length) { - if (typeof data === 'object') { - // there are more fields to deal with. - return search(data, tail, version, title) - } else { - return new Error('Not an object: ' + data) - } + // there are more fields to deal with. + return search(data, tail, version, title) } o = {} o[version] = {} @@ -420,7 +358,7 @@ function search (data, fields, version, title) { return o } -function printData (data, name, opts, cb) { +async function printData (data, name, opts) { const versions = Object.keys(data) let msg = '' let msgJson = [] @@ -440,14 +378,13 @@ function printData (data, name, opts, cb) { if (opts.json) { msgJson[msgJson.length - 1][f] = d } else { - d = util.inspect(d, { showHidden: false, depth: 5, colors: npm.color, maxArrayLength: null }) + d = inspect(d, { showHidden: false, depth: 5, colors: npm.color, maxArrayLength: null }) } } else if (typeof d === 'string' && opts.json) { d = JSON.stringify(d) } if (!opts.json) { if (f && includeFields) f += ' = ' - if (d.indexOf('\n') !== -1) d = ' \n' + d msg += (includeVersions ? name + '@' + v + ' ' : '') + (includeFields ? f : '') + d + '\n' } @@ -459,7 +396,6 @@ function printData (data, name, opts, cb) { const k = Object.keys(msgJson[0])[0] msgJson = msgJson.map(function (m) { return m[k] }) } - if (msgJson.length === 1) { msg = JSON.stringify(msgJson[0], null, 2) + '\n' } else if (msgJson.length > 1) { @@ -467,35 +403,21 @@ function printData (data, name, opts, cb) { } } - // preserve output symmetry by adding a whitespace-only line at the end if - // there's one at the beginning - if (/^\s*\n/.test(msg)) msg += '\n' - // disable the progress bar entirely, as we can't meaningfully update it if // we may have partial lines printed. log.disableProgress() - // print directly to stdout to not unnecessarily add blank lines - process.stdout.write(msg, () => cb(null, data)) + // only log if there is something to log + if (msg !== '') console.log(msg.trim()) } + function cleanup (data) { if (Array.isArray(data)) { return data.map(cleanup) } if (!data || typeof data !== 'object') return data - if (typeof data.versions === 'object' && - data.versions && - !Array.isArray(data.versions)) { - data.versions = Object.keys(data.versions || {}) - } - - let keys = Object.keys(data) - keys.forEach(function (d) { - if (d.charAt(0) === '_') delete data[d] - else if (typeof data[d] === 'object') data[d] = cleanup(data[d]) - }) - keys = Object.keys(data) + const keys = Object.keys(data) if (keys.length <= 3 && data.name && (keys.length === 1 || @@ -506,8 +428,9 @@ function cleanup (data) { return data } function unparsePerson (d) { - if (typeof d === 'string') return d return d.name + (d.email ? ' <' + d.email + '>' : '') + (d.url ? ' (' + d.url + ')' : '') } + +module.exports = Object.assign(cmd, { completion, usage }) diff --git a/deps/npm/lib/visnup.js b/deps/npm/lib/visnup.js deleted file mode 100644 index a61bacb73bf952..00000000000000 --- a/deps/npm/lib/visnup.js +++ /dev/null @@ -1,43 +0,0 @@ -module.exports = visnup -var npm = require('./npm.js') -var output = require('./utils/output.js') - -var handsomeFace = [ - [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 232, 237, 236, 236, 232, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], - [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 235, 236, 235, 233, 237, 235, 233, 232, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], - [0, 0, 0, 0, 0, 0, 0, 0, 0, 232, 235, 233, 232, 235, 235, 234, 233, 236, 232, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], - [0, 0, 0, 0, 0, 0, 0, 0, 237, 235, 232, 232, 234, 233, 233, 232, 232, 233, 232, 232, 235, 232, 233, 234, 234, 0, 0, 0, 0, 0, 0, 0, 0, 0], - [0, 0, 0, 0, 0, 0, 0, 232, 232, 232, 239, 238, 235, 233, 232, 232, 232, 232, 232, 232, 232, 233, 235, 232, 233, 233, 232, 0, 0, 0, 0, 0, 0, 0], - [0, 0, 0, 0, 234, 234, 232, 233, 234, 233, 234, 235, 233, 235, 60, 238, 238, 234, 234, 233, 234, 233, 238, 251, 246, 233, 233, 232, 0, 0, 0, 0, 0, 0], - [0, 0, 233, 233, 233, 232, 232, 239, 249, 251, 252, 231, 231, 188, 250, 254, 59, 60, 255, 231, 231, 231, 252, 235, 239, 235, 232, 233, 0, 0, 0, 0, 0, 0], - [0, 0, 232, 233, 232, 232, 232, 248, 231, 231, 231, 231, 231, 231, 231, 254, 238, 254, 231, 231, 231, 231, 231, 252, 233, 235, 237, 233, 234, 0, 0, 0, 0, 0], - [0, 0, 233, 232, 232, 232, 248, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 251, 233, 233, 233, 236, 233, 0, 0, 0, 0], - [232, 233, 233, 232, 232, 246, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 249, 233, 234, 234, 0, 0, 0, 0], - [232, 232, 232, 232, 233, 249, 231, 255, 255, 255, 255, 254, 109, 60, 239, 237, 238, 237, 235, 235, 235, 235, 236, 235, 235, 235, 234, 232, 232, 232, 232, 232, 233, 0], - [0, 232, 232, 233, 233, 233, 233, 233, 233, 233, 233, 233, 235, 236, 238, 238, 235, 188, 254, 254, 145, 236, 252, 254, 254, 254, 254, 249, 236, 235, 232, 232, 233, 0], - [0, 0, 233, 237, 249, 239, 233, 252, 231, 231, 231, 231, 231, 231, 254, 235, 235, 254, 231, 231, 251, 235, 237, 231, 231, 231, 231, 7, 237, 235, 232, 233, 233, 0], - [0, 0, 0, 0, 233, 248, 239, 233, 231, 231, 231, 231, 254, 233, 233, 235, 254, 255, 231, 254, 237, 236, 254, 239, 235, 235, 233, 233, 232, 232, 233, 232, 0, 0], - [0, 0, 0, 232, 233, 246, 255, 255, 236, 236, 236, 236, 236, 255, 231, 231, 231, 231, 231, 231, 252, 234, 248, 231, 231, 231, 231, 248, 232, 232, 232, 0, 0, 0], - [0, 0, 0, 0, 235, 237, 7, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 255, 238, 235, 7, 231, 231, 231, 246, 232, 0, 0, 0, 0, 0], - [0, 0, 0, 0, 0, 235, 103, 188, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 252, 232, 238, 231, 231, 255, 244, 232, 0, 0, 0, 0, 0], - [0, 0, 0, 0, 0, 235, 236, 103, 146, 253, 255, 231, 231, 231, 231, 231, 253, 251, 250, 250, 250, 246, 232, 235, 152, 255, 146, 66, 233, 0, 0, 0, 0, 0], - [0, 0, 0, 0, 0, 0, 233, 103, 146, 146, 146, 146, 254, 231, 231, 231, 109, 103, 146, 255, 188, 239, 240, 103, 255, 253, 103, 238, 234, 0, 0, 0, 0, 0], - [0, 0, 0, 0, 0, 0, 232, 235, 109, 146, 146, 146, 146, 146, 252, 152, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 103, 235, 233, 0, 0, 0, 0, 0], - [0, 0, 0, 0, 0, 0, 0, 235, 235, 103, 146, 146, 146, 146, 146, 146, 188, 188, 188, 188, 188, 188, 152, 146, 146, 146, 66, 235, 0, 0, 0, 0, 0, 0], - [0, 0, 0, 0, 0, 0, 0, 0, 233, 235, 66, 146, 146, 146, 146, 152, 255, 146, 240, 239, 241, 109, 146, 146, 146, 103, 233, 0, 0, 0, 0, 0, 0, 0], - [0, 0, 0, 0, 0, 0, 0, 0, 0, 234, 237, 109, 146, 146, 146, 146, 146, 254, 231, 231, 188, 146, 146, 146, 103, 233, 0, 0, 0, 0, 0, 0, 0, 0], - [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 233, 237, 60, 103, 146, 146, 146, 146, 146, 103, 66, 60, 235, 232, 0, 0, 0, 0, 0, 0, 0, 0, 0], - [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 232, 233, 233, 236, 235, 237, 235, 237, 237, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] -] - -function visnup (args, cb) { - handsomeFace.forEach(function (line) { - output(line.map(function (ch) { - return '\u001b[' + (ch ? '48;5;' + ch : ch) + 'm' - }).join(' ')) - }) - - var c = args.shift() - if (c) npm.commands[c](args, cb) - else cb() -} diff --git a/deps/npm/lib/whoami.js b/deps/npm/lib/whoami.js index 5145b447de4c6b..8e1c1d0523ae31 100644 --- a/deps/npm/lib/whoami.js +++ b/deps/npm/lib/whoami.js @@ -1,63 +1,17 @@ -'use strict' - -const BB = require('bluebird') - -const npmConfig = require('./config/figgy-config.js') -const fetch = require('libnpm/fetch') -const figgyPudding = require('figgy-pudding') const npm = require('./npm.js') const output = require('./utils/output.js') +const getIdentity = require('./utils/get-identity.js') +const usageUtil = require('./utils/usage.js') +const completion = require('./utils/completion/none.js') -const WhoamiConfig = figgyPudding({ - json: {}, - registry: {} -}) +const cmd = (args, cb) => whoami(args).then(() => cb()).catch(cb) -module.exports = whoami +const usage = usageUtil('whoami', 'npm whoami [--registry ]\n(just prints username according to given registry)') -whoami.usage = 'npm whoami [--registry ]\n(just prints username according to given registry)' - -function whoami ([spec], silent, cb) { - // FIXME: need tighter checking on this, but is a breaking change - if (typeof cb !== 'function') { - cb = silent - silent = false - } - const opts = WhoamiConfig(npmConfig()) - return BB.try(() => { - // First, check if we have a user/pass-based auth - const registry = opts.registry - if (!registry) throw new Error('no default registry set') - return npm.config.getCredentialsByURI(registry) - }).then(({username, token}) => { - if (username) { - return username - } else if (token) { - return fetch.json('/-/whoami', opts.concat({ - spec - })).then(({username}) => { - if (username) { - return username - } else { - throw Object.assign(new Error( - 'Your auth token is no longer valid. Please log in again.' - ), {code: 'ENEEDAUTH'}) - } - }) - } else { - // At this point, if they have a credentials object, it doesn't have a - // token or auth in it. Probably just the default registry. - throw Object.assign(new Error( - 'This command requires you to be logged in.' - ), {code: 'ENEEDAUTH'}) - } - }).then(username => { - if (silent) { - } else if (opts.json) { - output(JSON.stringify(username)) - } else { - output(username) - } - return username - }).nodeify(cb) +const whoami = async ([spec]) => { + const opts = npm.flatOptions + const username = await getIdentity(opts, spec) + output(opts.json ? JSON.stringify(username) : username) } + +module.exports = Object.assign(cmd, { completion, usage }) diff --git a/deps/npm/lib/xmas.js b/deps/npm/lib/xmas.js deleted file mode 100644 index 81ab59c8e22368..00000000000000 --- a/deps/npm/lib/xmas.js +++ /dev/null @@ -1,61 +0,0 @@ -// happy xmas -var log = require('npmlog') - -module.exports = function (args, cb) { - var s = process.platform === 'win32' ? ' *' : ' \u2605' - var f = '\uFF0F' - var b = '\uFF3C' - var x = process.platform === 'win32' ? ' ' : '' - var o = [ - '\u0069', '\u0020', '\u0020', '\u0020', '\u0020', '\u0020', - '\u0020', '\u0020', '\u0020', '\u0020', '\u0020', '\u0020', - '\u0020', '\u2E1B', '\u2042', '\u2E2E', '&', '@', '\uFF61' - ] - var oc = [33, 34, 35, 36, 37] - var l = '\u005e' - - function w (s) { process.stderr.write(s) } - - w('\n') - ;(function T (H) { - for (var i = 0; i < H; i++) w(' ') - w(x + '\u001b[33m' + s + '\n') - var M = H * 2 - 1 - for (var L = 1; L <= H; L++) { - var O = L * 2 - 2 - var S = (M - O) / 2 - for (i = 0; i < S; i++) w(' ') - w(x + '\u001b[21m') - w(x + '\u001b[32m' + f) - for (i = 0; i < O; i++) { - w( - '\u001b[' + oc[Math.floor(Math.random() * oc.length)] + 'm' + - o[Math.floor(Math.random() * o.length)] - ) - } - w(x + '\u001b[32m' + b + '\n') - w(x + '\u001b[0m') - } - w(' ') - for (i = 1; i < H; i++) w('\u001b[32m' + l) - w('| ' + x + ' |') - for (i = 1; i < H; i++) w('\u001b[32m' + l) - if (H > 10) { - w('\n ') - for (i = 1; i < H; i++) w(' ') - w('| ' + x + ' |') - for (i = 1; i < H; i++) w(' ') - } - })(20) - w('\n\n') - log.heading = '' - log.addLevel('npm', 100000, log.headingStyle) - log.npm('loves you', 'Happy Xmas, JavaScripters!') - cb() -} -var dg = false -Object.defineProperty(module.exports, 'usage', {get: function () { - if (dg) module.exports([], function () {}) - dg = true - return ' ' -}}) diff --git a/deps/npm/man/man1/npm-README.1 b/deps/npm/man/man1/npm-README.1 index 2bead70fba6058..aecf98ab6bbc72 100644 --- a/deps/npm/man/man1/npm-README.1 +++ b/deps/npm/man/man1/npm-README.1 @@ -1,4 +1,4 @@ -.TH "NPM" "1" "August 2020" "" "" +.TH "NPM" "1" "October 2020" "" "" .SH "NAME" \fBnpm\fR \- a JavaScript package manager .P diff --git a/deps/npm/man/man1/npm-access.1 b/deps/npm/man/man1/npm-access.1 index 0f55e9bf73daaf..df3429c6078ed4 100644 --- a/deps/npm/man/man1/npm-access.1 +++ b/deps/npm/man/man1/npm-access.1 @@ -1,4 +1,4 @@ -.TH "NPM\-ACCESS" "1" "August 2020" "" "" +.TH "NPM\-ACCESS" "1" "October 2020" "" "" .SH "NAME" \fBnpm-access\fR \- Set access level on published packages .SS Synopsis diff --git a/deps/npm/man/man1/npm-adduser.1 b/deps/npm/man/man1/npm-adduser.1 index 9adc04819bbde5..ce66d8301a8f32 100644 --- a/deps/npm/man/man1/npm-adduser.1 +++ b/deps/npm/man/man1/npm-adduser.1 @@ -4,7 +4,7 @@ section: cli\-commands title: npm\-adduser description: Set access level on published packages .HR -.TH "NPM\-ADDUSER" "1" "August 2020" "" "" +.TH "NPM\-ADDUSER" "1" "October 2020" "" "" .SH "NAME" \fBnpm-adduser\fR \- Add a registry user account .SS Synopsis diff --git a/deps/npm/man/man1/npm-audit.1 b/deps/npm/man/man1/npm-audit.1 index ab632299949147..b69dc654ac3823 100644 --- a/deps/npm/man/man1/npm-audit.1 +++ b/deps/npm/man/man1/npm-audit.1 @@ -1,4 +1,4 @@ -.TH "NPM\-AUDIT" "1" "August 2020" "" "" +.TH "NPM\-AUDIT" "1" "October 2020" "" "" .SH "NAME" \fBnpm-audit\fR \- Run a security audit .SS Synopsis diff --git a/deps/npm/man/man1/npm-bin.1 b/deps/npm/man/man1/npm-bin.1 index 16b61c2d58d40f..62398b3fbbda58 100644 --- a/deps/npm/man/man1/npm-bin.1 +++ b/deps/npm/man/man1/npm-bin.1 @@ -1,4 +1,4 @@ -.TH "NPM\-BIN" "1" "August 2020" "" "" +.TH "NPM\-BIN" "1" "October 2020" "" "" .SH "NAME" \fBnpm-bin\fR \- Display npm bin folder .SS Synopsis diff --git a/deps/npm/man/man1/npm-bugs.1 b/deps/npm/man/man1/npm-bugs.1 index c61c27de38a01b..31c1da17b36311 100644 --- a/deps/npm/man/man1/npm-bugs.1 +++ b/deps/npm/man/man1/npm-bugs.1 @@ -1,11 +1,11 @@ -.TH "NPM\-BUGS" "1" "August 2020" "" "" +.TH "NPM\-BUGS" "1" "October 2020" "" "" .SH "NAME" \fBnpm-bugs\fR \- Bugs for a package in a web browser maybe .SS Synopsis .P .RS 2 .nf -npm bugs [] +npm bugs [ [ \.\.\.]] aliases: issues .fi @@ -22,11 +22,16 @@ a \fBpackage\.json\fP in the current folder and use the \fBname\fP property\. .IP \(bu 2 Default: OS X: \fB"open"\fP, Windows: \fB"start"\fP, Others: \fB"xdg\-open"\fP .IP \(bu 2 -Type: String +Type: String or Boolean .RE .P The browser that is called by the \fBnpm bugs\fP command to open websites\. +.P +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 registry .RS 0 .IP \(bu 2 diff --git a/deps/npm/man/man1/npm-build.1 b/deps/npm/man/man1/npm-build.1 deleted file mode 100644 index 07f6ff013dfde2..00000000000000 --- a/deps/npm/man/man1/npm-build.1 +++ /dev/null @@ -1,40 +0,0 @@ -.TH "NPM\-BUILD" "1" "August 2020" "" "" -.SH "NAME" -\fBnpm-build\fR \- Build a package -.SS Synopsis -.P -.RS 2 -.nf -npm build [] -.fi -.RE -.RS 0 -.IP \(bu 2 -\fB\fP: -A folder containing a \fBpackage\.json\fP file in its root\. - -.RE -.SS Description -.P -This is the plumbing command called by \fBnpm link\fP and \fBnpm install\fP\|\. -.P -It should generally be called during installation, but if you need to run it -directly, run: -.P -.RS 2 -.nf - npm run\-script build -.fi -.RE -.SS See Also -.RS 0 -.IP \(bu 2 -npm help install -.IP \(bu 2 -npm help link -.IP \(bu 2 -npm help scripts -.IP \(bu 2 -npm help package\.json - -.RE diff --git a/deps/npm/man/man1/npm-bundle.1 b/deps/npm/man/man1/npm-bundle.1 index 75fbd5cd9e5898..7fef018422c7b8 100644 --- a/deps/npm/man/man1/npm-bundle.1 +++ b/deps/npm/man/man1/npm-bundle.1 @@ -1,4 +1,4 @@ -.TH "NPM\-BUNDLE" "1" "August 2020" "" "" +.TH "NPM\-BUNDLE" "1" "October 2020" "" "" .SH "NAME" \fBnpm-bundle\fR \- REMOVED .SS Description diff --git a/deps/npm/man/man1/npm-cache.1 b/deps/npm/man/man1/npm-cache.1 index 9d2ee6447dca99..69eaabba2f53fe 100644 --- a/deps/npm/man/man1/npm-cache.1 +++ b/deps/npm/man/man1/npm-cache.1 @@ -1,4 +1,4 @@ -.TH "NPM\-CACHE" "1" "August 2020" "" "" +.TH "NPM\-CACHE" "1" "October 2020" "" "" .SH "NAME" \fBnpm-cache\fR \- Manipulates packages cache .SS Synopsis diff --git a/deps/npm/man/man1/npm-ci.1 b/deps/npm/man/man1/npm-ci.1 index 0b716af6892453..9d47aeaa300ad9 100644 --- a/deps/npm/man/man1/npm-ci.1 +++ b/deps/npm/man/man1/npm-ci.1 @@ -1,4 +1,4 @@ -.TH "NPM\-CI" "1" "August 2020" "" "" +.TH "NPM\-CI" "1" "October 2020" "" "" .SH "NAME" \fBnpm-ci\fR \- Install a project with a clean slate .SS Synopsis diff --git a/deps/npm/man/man1/npm-completion.1 b/deps/npm/man/man1/npm-completion.1 index c47174226161f6..03d30fd3e6031e 100644 --- a/deps/npm/man/man1/npm-completion.1 +++ b/deps/npm/man/man1/npm-completion.1 @@ -1,4 +1,4 @@ -.TH "NPM\-COMPLETION" "1" "August 2020" "" "" +.TH "NPM\-COMPLETION" "1" "October 2020" "" "" .SH "NAME" \fBnpm-completion\fR \- Tab Completion for npm .SS Synopsis diff --git a/deps/npm/man/man1/npm-config.1 b/deps/npm/man/man1/npm-config.1 index fd7e75c5f5fe96..f53e960ecc1d96 100644 --- a/deps/npm/man/man1/npm-config.1 +++ b/deps/npm/man/man1/npm-config.1 @@ -1,4 +1,4 @@ -.TH "NPM\-CONFIG" "1" "August 2020" "" "" +.TH "NPM\-CONFIG" "1" "October 2020" "" "" .SH "NAME" \fBnpm-config\fR \- Manage the npm configuration files .SS Synopsis diff --git a/deps/npm/man/man1/npm-dedupe.1 b/deps/npm/man/man1/npm-dedupe.1 index fbfbbb64eaa9d8..ef0eb25b0c264b 100644 --- a/deps/npm/man/man1/npm-dedupe.1 +++ b/deps/npm/man/man1/npm-dedupe.1 @@ -1,4 +1,4 @@ -.TH "NPM\-DEDUPE" "1" "August 2020" "" "" +.TH "NPM\-DEDUPE" "1" "October 2020" "" "" .SH "NAME" \fBnpm-dedupe\fR \- Reduce duplication .SS Synopsis @@ -58,6 +58,8 @@ Modules .P Note that this operation transforms the dependency tree, but will never result in new modules being installed\. +.P +Using \fBnpm find\-dupes\fP will run the command in dryRun mode\. .SS See Also .RS 0 .IP \(bu 2 diff --git a/deps/npm/man/man1/npm-deprecate.1 b/deps/npm/man/man1/npm-deprecate.1 index 5024b478299954..995b3bd87cb2a4 100644 --- a/deps/npm/man/man1/npm-deprecate.1 +++ b/deps/npm/man/man1/npm-deprecate.1 @@ -1,4 +1,4 @@ -.TH "NPM\-DEPRECATE" "1" "August 2020" "" "" +.TH "NPM\-DEPRECATE" "1" "October 2020" "" "" .SH "NAME" \fBnpm-deprecate\fR \- Deprecate a version of a package .SS Synopsis diff --git a/deps/npm/man/man1/npm-dist-tag.1 b/deps/npm/man/man1/npm-dist-tag.1 index ebddc7e5a777a4..d3afd98d91802b 100644 --- a/deps/npm/man/man1/npm-dist-tag.1 +++ b/deps/npm/man/man1/npm-dist-tag.1 @@ -4,7 +4,7 @@ section: cli\-commands title: npm\-dist\-tag description: Modify package distribution tags .HR -.TH "NPM\-DIST\-TAG" "1" "August 2020" "" "" +.TH "NPM\-DIST\-TAG" "1" "October 2020" "" "" .SH "NAME" \fBnpm-dist-tag\fR \- Modify package distribution tags .SS Synopsis diff --git a/deps/npm/man/man1/npm-docs.1 b/deps/npm/man/man1/npm-docs.1 index b5dc52d220b726..460d6b2dfcbd7a 100644 --- a/deps/npm/man/man1/npm-docs.1 +++ b/deps/npm/man/man1/npm-docs.1 @@ -1,4 +1,4 @@ -.TH "NPM\-DOCS" "1" "August 2020" "" "" +.TH "NPM\-DOCS" "1" "October 2020" "" "" .SH "NAME" \fBnpm-docs\fR \- Docs for a package in a web browser maybe .SS Synopsis @@ -6,9 +6,8 @@ .RS 2 .nf npm docs [ [ \.\.\.]] -npm docs \. -npm home [ [ \.\.\.]] -npm home \. + +aliases: home .fi .RE .SS Description @@ -24,11 +23,16 @@ the current folder and use the \fBname\fP property\. .IP \(bu 2 Default: OS X: \fB"open"\fP, Windows: \fB"start"\fP, Others: \fB"xdg\-open"\fP .IP \(bu 2 -Type: String +Type: String or Boolean .RE .P The browser that is called by the \fBnpm docs\fP command to open websites\. +.P +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 registry .RS 0 .IP \(bu 2 diff --git a/deps/npm/man/man1/npm-doctor.1 b/deps/npm/man/man1/npm-doctor.1 index 3e614110b87151..5872742d874a61 100644 --- a/deps/npm/man/man1/npm-doctor.1 +++ b/deps/npm/man/man1/npm-doctor.1 @@ -1,4 +1,4 @@ -.TH "NPM\-DOCTOR" "1" "August 2020" "" "" +.TH "NPM\-DOCTOR" "1" "October 2020" "" "" .SH "NAME" \fBnpm-doctor\fR \- Check your environments .SS Synopsis diff --git a/deps/npm/man/man1/npm-edit.1 b/deps/npm/man/man1/npm-edit.1 index 2f3ddd62e302fd..09ec020e098e49 100644 --- a/deps/npm/man/man1/npm-edit.1 +++ b/deps/npm/man/man1/npm-edit.1 @@ -1,4 +1,4 @@ -.TH "NPM\-EDIT" "1" "August 2020" "" "" +.TH "NPM\-EDIT" "1" "October 2020" "" "" .SH "NAME" \fBnpm-edit\fR \- Edit an installed package .SS Synopsis diff --git a/deps/npm/man/man1/npm-exec.1 b/deps/npm/man/man1/npm-exec.1 new file mode 100644 index 00000000000000..cff1ed3e994eff --- /dev/null +++ b/deps/npm/man/man1/npm-exec.1 @@ -0,0 +1,211 @@ +.TH "NPM\-EXEC" "1" "October 2020" "" "" +.SH "NAME" +\fBnpm-exec\fR \- Run a command from a local or remote npm package +.SS Synopsis +.P +.RS 2 +.nf +npm exec \-\- [@] [args\.\.\.] +npm exec \-p [@] \-\- [args\.\.\.] +npm exec \-c ' [args\.\.\.]' +npm exec \-p foo \-c ' [args\.\.\.]' + +npx [@] [args\.\.\.] +npx \-p [@] [args\.\.\.] +npx \-c ' [args\.\.\.]' +npx \-p [@] \-c ' [args\.\.\.]' + +alias: npm x, npx + +\-p \-\-package= (may be specified multiple times) +\-c \-\-call= (may not be mixed with positional arguments) +.fi +.RE +.SS Description +.P +This command allows you to run an arbitrary command from an npm package +(either one installed locally, or fetched remotely), in a similar context +as running it via \fBnpm run\fP\|\. +.P +Whatever packages are specified by the \fB\-\-package\fP or \fB\-p\fP option will be +provided in the \fBPATH\fP of the executed command, along with any locally +installed package executables\. The \fB\-\-package\fP or \fB\-p\fP option may be +specified multiple times, to execute the supplied command in an environment +where all specified packages are available\. +.P +If any requested packages are not present in the local project +dependencies, then they are installed to a folder in the npm cache, which +is added to the \fBPATH\fP environment variable in the executed process\. A +prompt is printed (which can be suppressed by providing either \fB\-\-yes\fP or +\fB\-\-no\fP)\. +.P +Package names provided without a specifier will be matched with whatever +version exists in the local project\. Package names with a specifier will +only be considered a match if they have the exact same name and version as +the local dependency\. +.P +If no \fB\-c\fP or \fB\-\-call\fP option is provided, then the positional arguments +are used to generate the command string\. If no \fB\-p\fP or \fB\-\-package\fP options +are provided, then npm will attempt to determine the executable name from +the package specifier provided as the first positional argument according +to the following heuristic: +.RS 0 +.IP \(bu 2 +If the package has a single entry in its \fBbin\fP field in \fBpackage\.json\fP, +then that command will be used\. +.IP \(bu 2 +If the package has multiple \fBbin\fP entries, and one of them matches the +unscoped portion of the \fBname\fP field, then that command will be used\. +.IP \(bu 2 +If this does not result in exactly one option (either because there are +no bin entries, or none of them match the \fBname\fP of the package), then +\fBnpm exec\fP exits with an error\. + +.RE +.P +To run a binary \fIother than\fR the named binary, specify one or more +\fB\-\-package\fP options, which will prevent npm from inferring the package from +the first command argument\. +.SS \fBnpx\fP vs \fBnpm exec\fP +.P +When run via the \fBnpx\fP binary, all flags and options \fImust\fR be set prior to +any positional arguments\. When run via \fBnpm exec\fP, a double\-hyphen \fB\-\-\fP +flag can be used to suppress npm's parsing of switches and options that +should be sent to the executed command\. +.P +For example: +.P +.RS 2 +.nf +$ npx foo@latest bar \-\-package=@npmcli/foo +.fi +.RE +.P +In this case, npm will resolve the \fBfoo\fP package name, and run the +following command: +.P +.RS 2 +.nf +$ foo bar \-\-package=@npmcli/foo +.fi +.RE +.P +Since the \fB\-\-package\fP option comes \fIafter\fR the positional arguments, it is +treated as an argument to the executed command\. +.P +In contrast, due to npm's argument parsing logic, running this command is +different: +.P +.RS 2 +.nf +$ npm exec foo@latest bar \-\-package=@npmcli/foo +.fi +.RE +.P +In this case, npm will parse the \fB\-\-package\fP option first, resolving the +\fB@npmcli/foo\fP package\. Then, it will execute the following command in that +context: +.P +.RS 2 +.nf +$ foo@latest bar +.fi +.RE +.P +The double\-hyphen character is recommended to explicitly tell npm to stop +parsing command line options and switches\. The following command would +thus be equivalent to the \fBnpx\fP command above: +.P +.RS 2 +.nf +$ npm exec \-\- foo@latest bar \-\-package=@npmcli/foo +.fi +.RE +.SS Examples +.P +Run the version of \fBtap\fP in the local dependencies, with the provided +arguments: +.P +.RS 2 +.nf +$ npm exec \-\- tap \-\-bail test/foo\.js +$ npx tap \-\-bail test/foo\.js +.fi +.RE +.P +Run a command \fIother than\fR the command whose name matches the package name +by specifying a \fB\-\-package\fP option: +.P +.RS 2 +.nf +$ npm exec \-\-package=foo \-\- bar \-\-bar\-argument +# ~ or ~ +$ npx \-\-package=foo bar \-\-bar\-argument +.fi +.RE +.P +Run an arbitrary shell script, in the context of the current project: +.P +.RS 2 +.nf +$ npm x \-c 'eslint && say "hooray, lint passed"' +$ npx \-c 'eslint && say "hooray, lint passed"' +.fi +.RE +.SS Compatibility with Older npx Versions +.P +The \fBnpx\fP binary was rewritten in npm v7\.0\.0, and the standalone \fBnpx\fP +package deprecated at that time\. \fBnpx\fP uses the \fBnpm exec\fP +command instead of a separate argument parser and install process, with +some affordances to maintain backwards compatibility with the arguments it +accepted in previous versions\. +.P +This resulted in some shifts in its functionality: +.RS 0 +.IP \(bu 2 +Any \fBnpm\fP config value may be provided\. +.IP \(bu 2 +To prevent security and user\-experience problems from mistyping package +names, \fBnpx\fP prompts before installing anything\. Suppress this +prompt with the \fB\-y\fP or \fB\-\-yes\fP option\. +.IP \(bu 2 +The \fB\-\-no\-install\fP option is deprecated, and will be converted to \fB\-\-no\fP\|\. +.IP \(bu 2 +Shell fallback functionality is removed, as it is not advisable\. +.IP \(bu 2 +The \fB\-p\fP argument is a shorthand for \fB\-\-parseable\fP in npm, but shorthand +for \fB\-\-package\fP in npx\. This is maintained, but only for the \fBnpx\fP +executable\. +.IP \(bu 2 +The \fB\-\-ignore\-existing\fP option is removed\. Locally installed bins are +always present in the executed process \fBPATH\fP\|\. +.IP \(bu 2 +The \fB\-\-npm\fP option is removed\. \fBnpx\fP will always use the \fBnpm\fP it ships +with\. +.IP \(bu 2 +The \fB\-\-node\-arg\fP and \fB\-n\fP options are removed\. +.IP \(bu 2 +The \fB\-\-always\-spawn\fP option is redundant, and thus removed\. +.IP \(bu 2 +The \fB\-\-shell\fP option is replaced with \fB\-\-script\-shell\fP, but maintained +in the \fBnpx\fP executable for backwards compatibility\. + +.RE +.SS See Also +.RS 0 +.IP \(bu 2 +npm help run\-script +.IP \(bu 2 +npm help scripts +.IP \(bu 2 +npm help test +.IP \(bu 2 +npm help start +.IP \(bu 2 +npm help restart +.IP \(bu 2 +npm help stop +.IP \(bu 2 +npm help config + +.RE diff --git a/deps/npm/man/man1/npm-explain.1 b/deps/npm/man/man1/npm-explain.1 new file mode 100644 index 00000000000000..91469d7e2ede98 --- /dev/null +++ b/deps/npm/man/man1/npm-explain.1 @@ -0,0 +1,87 @@ +.TH "NPM\-EXPLAIN" "1" "October 2020" "" "" +.SH "NAME" +\fBnpm-explain\fR \- Explain installed packages +.SS Synopsis +.P +.RS 2 +.nf +npm explain +.fi +.RE +.SS Description +.P +This command will print the chain of dependencies causing a given package +to be installed in the current project\. +.P +Positional arguments can be either folders within \fBnode_modules\fP, or +\fBname@version\-range\fP specifiers, which will select the dependency +relationships to explain\. +.P +For example, running \fBnpm explain glob\fP within npm's source tree will show: +.P +.RS 2 +.nf +glob@7\.1\.6 +node_modules/glob + glob@"^7\.1\.4" from the root project + +glob@7\.1\.1 dev +node_modules/tacks/node_modules/glob + glob@"^7\.0\.5" from rimraf@2\.6\.2 + node_modules/tacks/node_modules/rimraf + rimraf@"^2\.6\.2" from tacks@1\.3\.0 + node_modules/tacks + dev tacks@"^1\.3\.0" from the root project +.fi +.RE +.P +To explain just the package residing at a specific folder, pass that as the +argument to the command\. This can be useful when trying to figure out +exactly why a given dependency is being duplicated to satisfy conflicting +version requirements within the project\. +.P +.RS 2 +.nf +$ npm explain node_modules/nyc/node_modules/find\-up +find\-up@3\.0\.0 dev +node_modules/nyc/node_modules/find\-up + find\-up@"^3\.0\.0" from nyc@14\.1\.1 + node_modules/nyc + nyc@"^14\.1\.1" from tap@14\.10\.8 + node_modules/tap + dev tap@"^14\.10\.8" from the root project +.fi +.RE +.SS Configuration +.SS json +.RS 0 +.IP \(bu 2 +Default: false +.IP \(bu 2 +Type: Bolean + +.RE +.P +Show information in JSON format\. +.SS See Also +.RS 0 +.IP \(bu 2 +npm help config +.IP \(bu 2 +npm help npmrc +.IP \(bu 2 +npm help folders +.IP \(bu 2 +npm help ls +.IP \(bu 2 +npm help install +.IP \(bu 2 +npm help link +.IP \(bu 2 +npm help prune +.IP \(bu 2 +npm help outdated +.IP \(bu 2 +npm help update + +.RE diff --git a/deps/npm/man/man1/npm-explore.1 b/deps/npm/man/man1/npm-explore.1 index 93598500ea40df..09ad8490340fa1 100644 --- a/deps/npm/man/man1/npm-explore.1 +++ b/deps/npm/man/man1/npm-explore.1 @@ -4,7 +4,7 @@ section: cli\-commands title: npm\-explore description: Browse an installed package .HR -.TH "NPM\-EXPLORE" "1" "August 2020" "" "" +.TH "NPM\-EXPLORE" "1" "October 2020" "" "" .SH "NAME" \fBnpm-explore\fR \- Browse an installed package .SS Synopsis diff --git a/deps/npm/man/man1/npm-fund.1 b/deps/npm/man/man1/npm-fund.1 index 85312fb5cdf6a2..2ea4cda1898d73 100644 --- a/deps/npm/man/man1/npm-fund.1 +++ b/deps/npm/man/man1/npm-fund.1 @@ -1,4 +1,4 @@ -.TH "NPM\-FUND" "1" "August 2020" "" "" +.TH "NPM\-FUND" "1" "October 2020" "" "" .SH "NAME" \fBnpm-fund\fR \- Retrieve funding information .SS Synopsis @@ -19,7 +19,7 @@ config param; if there are multiple funding sources for the package, the user will be instructed to pass the \fB\-\-which\fP command to disambiguate\. .P The list will avoid duplicated entries and will stack all packages -that share the same type/url as a single entry\. Given this nature the +that share the same url as a single entry\. Given this nature the list is not going to have the same shape of the output from \fBnpm ls\fP\|\. .SS Configuration .SS browser diff --git a/deps/npm/man/man1/npm-help-search.1 b/deps/npm/man/man1/npm-help-search.1 index f2d5d0aa73e056..d3e10b3632fc63 100644 --- a/deps/npm/man/man1/npm-help-search.1 +++ b/deps/npm/man/man1/npm-help-search.1 @@ -1,4 +1,4 @@ -.TH "NPM\-HELP\-SEARCH" "1" "August 2020" "" "" +.TH "NPM\-HELP\-SEARCH" "1" "October 2020" "" "" .SH "NAME" \fBnpm-help-search\fR \- Search npm help documentation .SS Synopsis diff --git a/deps/npm/man/man1/npm-help.1 b/deps/npm/man/man1/npm-help.1 index f3d31009e70748..8fd8cd06cdbc46 100644 --- a/deps/npm/man/man1/npm-help.1 +++ b/deps/npm/man/man1/npm-help.1 @@ -1,4 +1,4 @@ -.TH "NPM\-HELP" "1" "August 2020" "" "" +.TH "NPM\-HELP" "1" "October 2020" "" "" .SH "NAME" \fBnpm-help\fR \- Get help on npm .SS Synopsis diff --git a/deps/npm/man/man1/npm-hook.1 b/deps/npm/man/man1/npm-hook.1 index bc7bfd69052130..73332de82a124e 100644 --- a/deps/npm/man/man1/npm-hook.1 +++ b/deps/npm/man/man1/npm-hook.1 @@ -1,4 +1,4 @@ -.TH "NPM\-HOOK" "1" "August 2020" "" "" +.TH "NPM\-HOOK" "1" "October 2020" "" "" .SH "NAME" \fBnpm-hook\fR \- Manage registry hooks .SS Synopsis diff --git a/deps/npm/man/man1/npm-init.1 b/deps/npm/man/man1/npm-init.1 index a6afe6f3c3c64c..98368ceef93e98 100644 --- a/deps/npm/man/man1/npm-init.1 +++ b/deps/npm/man/man1/npm-init.1 @@ -1,4 +1,4 @@ -.TH "NPM\-INIT" "1" "August 2020" "" "" +.TH "NPM\-INIT" "1" "October 2020" "" "" .SH "NAME" \fBnpm-init\fR \- create a package\.json file .SS Synopsis diff --git a/deps/npm/man/man1/npm-install-ci-test.1 b/deps/npm/man/man1/npm-install-ci-test.1 index 8e4081564a6ff5..17e8d5f1659728 100644 --- a/deps/npm/man/man1/npm-install-ci-test.1 +++ b/deps/npm/man/man1/npm-install-ci-test.1 @@ -1,4 +1,4 @@ -.TH "NPM" "" "August 2020" "" "" +.TH "NPM" "" "October 2020" "" "" .SH "NAME" \fBnpm\fR .SS Synopsis diff --git a/deps/npm/man/man1/npm-install-test.1 b/deps/npm/man/man1/npm-install-test.1 index 62d32764ba76e1..6b2d35393ca305 100644 --- a/deps/npm/man/man1/npm-install-test.1 +++ b/deps/npm/man/man1/npm-install-test.1 @@ -1,4 +1,4 @@ -.TH "NPM" "" "August 2020" "" "" +.TH "NPM" "" "October 2020" "" "" .SH "NAME" \fBnpm\fR .SS Synopsis diff --git a/deps/npm/man/man1/npm-install.1 b/deps/npm/man/man1/npm-install.1 index 0f2a87c7f8d3ab..e7eb08bbdc0b3e 100644 --- a/deps/npm/man/man1/npm-install.1 +++ b/deps/npm/man/man1/npm-install.1 @@ -1,4 +1,4 @@ -.TH "NPM\-INSTALL" "1" "August 2020" "" "" +.TH "NPM\-INSTALL" "1" "October 2020" "" "" .SH "NAME" \fBnpm-install\fR \- Install a package .SS Synopsis diff --git a/deps/npm/man/man1/npm-link.1 b/deps/npm/man/man1/npm-link.1 index 870f1ca595cbba..4c8cb4b885110d 100644 --- a/deps/npm/man/man1/npm-link.1 +++ b/deps/npm/man/man1/npm-link.1 @@ -1,4 +1,4 @@ -.TH "NPM\-LINK" "1" "August 2020" "" "" +.TH "NPM\-LINK" "1" "October 2020" "" "" .SH "NAME" \fBnpm-link\fR \- Symlink a package folder .SS Synopsis @@ -90,7 +90,7 @@ npm help developers .IP \(bu 2 npm help package\.json .IP \(bu 2 -npm help install +npm help npm\- nstall .IP \(bu 2 npm help folders .IP \(bu 2 diff --git a/deps/npm/man/man1/npm-logout.1 b/deps/npm/man/man1/npm-logout.1 index b5530624f4274f..9da7fc5d020d22 100644 --- a/deps/npm/man/man1/npm-logout.1 +++ b/deps/npm/man/man1/npm-logout.1 @@ -1,4 +1,4 @@ -.TH "NPM\-LOGOUT" "1" "August 2020" "" "" +.TH "NPM\-LOGOUT" "1" "October 2020" "" "" .SH "NAME" \fBnpm-logout\fR \- Log out of the registry .SS Synopsis diff --git a/deps/npm/man/man1/npm-ls.1 b/deps/npm/man/man1/npm-ls.1 index 41a3938b1b5128..2de01f1cb5c537 100644 --- a/deps/npm/man/man1/npm-ls.1 +++ b/deps/npm/man/man1/npm-ls.1 @@ -1,4 +1,4 @@ -.TH "NPM\-LS" "1" "August 2020" "" "" +.TH "NPM\-LS" "1" "October 2020" "" "" .SH "NAME" \fBnpm-ls\fR \- List installed packages .SS Synopsis @@ -22,7 +22,7 @@ For example, running \fBnpm ls promzard\fP in npm's source tree will show: .P .RS 2 .nf - npm@6\.14\.8 /path/to/npm + npm@7\.0\.0\-rc\.3 /path/to/npm └─┬ init\-package\-json@0\.0\.4 └── promzard@0\.1\.5 .fi @@ -148,6 +148,8 @@ npm help npmrc .IP \(bu 2 npm help folders .IP \(bu 2 +npm help explain +.IP \(bu 2 npm help install .IP \(bu 2 npm help link diff --git a/deps/npm/man/man1/npm-org.1 b/deps/npm/man/man1/npm-org.1 index 474c363be9205b..0b3a5d81cad4b2 100644 --- a/deps/npm/man/man1/npm-org.1 +++ b/deps/npm/man/man1/npm-org.1 @@ -1,4 +1,4 @@ -.TH "NPM\-ORG" "1" "August 2020" "" "" +.TH "NPM\-ORG" "1" "October 2020" "" "" .SH "NAME" \fBnpm-org\fR \- Manage orgs .SS Synopsis diff --git a/deps/npm/man/man1/npm-outdated.1 b/deps/npm/man/man1/npm-outdated.1 index 983a5392c43349..aa22c22bad114d 100644 --- a/deps/npm/man/man1/npm-outdated.1 +++ b/deps/npm/man/man1/npm-outdated.1 @@ -1,4 +1,4 @@ -.TH "NPM\-OUTDATED" "1" "August 2020" "" "" +.TH "NPM\-OUTDATED" "1" "October 2020" "" "" .SH "NAME" \fBnpm-outdated\fR \- Check for outdated packages .SS Synopsis @@ -27,15 +27,15 @@ with a dist\-tag of \fBlatest\fP\|\. This may or may not be the maximum version the package, or the most\-recently published version of the package, depending on how the package's developer manages the latest dist\-tag \fInpm\-dist\-tag\fR\|\. .IP \(bu 2 -\fBlocation\fP is where in the dependency tree the package is located\. Note that -\fBnpm outdated\fP defaults to a depth of 0, so unless you override that, you'll -always be seeing only top\-level dependencies that are outdated\. +\fBlocation\fP is where in the physical tree the package is located\. +.IP \(bu 2 +\fBdepended by\fP shows which package depends on the displayed dependency .IP \(bu 2 \fBpackage type\fP (when using \fB\-\-long\fP / \fB\-l\fP) tells you whether this package is -a \fBdependency\fP or a \fBdevDependency\fP\|\. Packages not included in \fBpackage\.json\fP +a \fBdependency\fP or a dev/peer/optional dependency\. Packages not included in \fBpackage\.json\fP are always marked \fBdependencies\fP\|\. .IP \(bu 2 -\fBhomepage\fP (when using \fB\-\-long\fP / \fB\-l\fP) is the \fBhomepage\fP value contained in the package's \fBpackage\.json\fP +\fBhomepage\fP (when using \fB\-\-long\fP / \fB\-l\fP) is the \fBhomepage\fP value contained in the package's packument .IP \(bu 2 Red means there's a newer version matching your semver requirements, so you should update now\. .IP \(bu 2 @@ -47,12 +47,12 @@ Yellow indicates that there's a newer version above your semver requirements (us .RS 2 .nf $ npm outdated -Package Current Wanted Latest Location -glob 5\.0\.15 5\.0\.15 6\.0\.1 test\-outdated\-output -nothingness 0\.0\.3 git git test\-outdated\-output -npm 3\.5\.1 3\.5\.2 3\.5\.1 test\-outdated\-output -local\-dev 0\.0\.3 linked linked test\-outdated\-output -once 1\.3\.2 1\.3\.3 1\.3\.3 test\-outdated\-output +Package Current Wanted Latest Location Depended by +glob 5\.0\.15 5\.0\.15 6\.0\.1 node_modules/glob dependent\-package\-name +nothingness 0\.0\.3 git git node_modules/nothingness dependent\-package\-name +npm 3\.5\.1 3\.5\.2 3\.5\.1 node_modules/npm dependent\-package\-name +local\-dev 0\.0\.3 linked linked local\-dev dependent\-package\-name +once 1\.3\.2 1\.3\.3 1\.3\.3 node_modules/once dependent\-package\-name .fi .RE .P @@ -132,16 +132,16 @@ Type: Boolean .P Check packages in the global install prefix instead of in the current project\. -.SS depth +.SS all .RS 0 .IP \(bu 2 -Default: 0 +Default: false .IP \(bu 2 -Type: Int +Type: Boolean .RE .P -Max depth for checking dependency tree\. +Display all outdated dependencies on the tree\. .SS See Also .RS 0 .IP \(bu 2 diff --git a/deps/npm/man/man1/npm-owner.1 b/deps/npm/man/man1/npm-owner.1 index 416ef0ccf96d67..886d1f3cb4e19a 100644 --- a/deps/npm/man/man1/npm-owner.1 +++ b/deps/npm/man/man1/npm-owner.1 @@ -1,4 +1,4 @@ -.TH "NPM\-OWNER" "1" "August 2020" "" "" +.TH "NPM\-OWNER" "1" "October 2020" "" "" .SH "NAME" \fBnpm-owner\fR \- Manage package owners .SS Synopsis diff --git a/deps/npm/man/man1/npm-pack.1 b/deps/npm/man/man1/npm-pack.1 index 734df4a826c03c..469812c8e13d48 100644 --- a/deps/npm/man/man1/npm-pack.1 +++ b/deps/npm/man/man1/npm-pack.1 @@ -1,4 +1,4 @@ -.TH "NPM\-PACK" "1" "August 2020" "" "" +.TH "NPM\-PACK" "1" "October 2020" "" "" .SH "NAME" \fBnpm-pack\fR \- Create a tarball from a package .SS Synopsis diff --git a/deps/npm/man/man1/npm-ping.1 b/deps/npm/man/man1/npm-ping.1 index dc64e9f2b9e758..d1c6788e5f2e0c 100644 --- a/deps/npm/man/man1/npm-ping.1 +++ b/deps/npm/man/man1/npm-ping.1 @@ -1,4 +1,4 @@ -.TH "NPM\-PING" "1" "August 2020" "" "" +.TH "NPM\-PING" "1" "October 2020" "" "" .SH "NAME" \fBnpm-ping\fR \- Ping npm registry .SS Synopsis diff --git a/deps/npm/man/man1/npm-prefix.1 b/deps/npm/man/man1/npm-prefix.1 index 097d1852089ff7..558a4a997d9ef5 100644 --- a/deps/npm/man/man1/npm-prefix.1 +++ b/deps/npm/man/man1/npm-prefix.1 @@ -1,4 +1,4 @@ -.TH "NPM\-PREFIX" "1" "August 2020" "" "" +.TH "NPM\-PREFIX" "1" "October 2020" "" "" .SH "NAME" \fBnpm-prefix\fR \- Display prefix .SS Synopsis diff --git a/deps/npm/man/man1/npm-profile.1 b/deps/npm/man/man1/npm-profile.1 index 5b8ea7f16ec02c..8a95810ae75556 100644 --- a/deps/npm/man/man1/npm-profile.1 +++ b/deps/npm/man/man1/npm-profile.1 @@ -1,4 +1,4 @@ -.TH "NPM\-PROFILE" "1" "August 2020" "" "" +.TH "NPM\-PROFILE" "1" "October 2020" "" "" .SH "NAME" \fBnpm-profile\fR \- Change settings on your registry profile .SS Synopsis diff --git a/deps/npm/man/man1/npm-prune.1 b/deps/npm/man/man1/npm-prune.1 index 0f582fb8a066c1..8330dcec832946 100644 --- a/deps/npm/man/man1/npm-prune.1 +++ b/deps/npm/man/man1/npm-prune.1 @@ -1,4 +1,4 @@ -.TH "NPM\-PRUNE" "1" "August 2020" "" "" +.TH "NPM\-PRUNE" "1" "October 2020" "" "" .SH "NAME" \fBnpm-prune\fR \- Remove extraneous packages .SS Synopsis diff --git a/deps/npm/man/man1/npm-publish.1 b/deps/npm/man/man1/npm-publish.1 index 5aeb1c9425290c..e4b806aabe682a 100644 --- a/deps/npm/man/man1/npm-publish.1 +++ b/deps/npm/man/man1/npm-publish.1 @@ -1,4 +1,4 @@ -.TH "NPM\-PUBLISH" "1" "August 2020" "" "" +.TH "NPM\-PUBLISH" "1" "October 2020" "" "" .SH "NAME" \fBnpm-publish\fR \- Publish a package .SS Synopsis diff --git a/deps/npm/man/man1/npm-rebuild.1 b/deps/npm/man/man1/npm-rebuild.1 index a339a77f6b5d3f..67b7c5dc28fe48 100644 --- a/deps/npm/man/man1/npm-rebuild.1 +++ b/deps/npm/man/man1/npm-rebuild.1 @@ -1,4 +1,4 @@ -.TH "NPM\-REBUILD" "1" "August 2020" "" "" +.TH "NPM\-REBUILD" "1" "October 2020" "" "" .SH "NAME" \fBnpm-rebuild\fR \- Rebuild a package .SS Synopsis diff --git a/deps/npm/man/man1/npm-repo.1 b/deps/npm/man/man1/npm-repo.1 index 16494f20915634..a8fe193f0c2979 100644 --- a/deps/npm/man/man1/npm-repo.1 +++ b/deps/npm/man/man1/npm-repo.1 @@ -1,11 +1,11 @@ -.TH "NPM\-REPO" "1" "August 2020" "" "" +.TH "NPM\-REPO" "1" "October 2020" "" "" .SH "NAME" \fBnpm-repo\fR \- Open package repository page in the browser .SS Synopsis .P .RS 2 .nf -npm repo [] +npm repo [ [ \.\.\.]] .fi .RE .SS Description @@ -20,11 +20,16 @@ a \fBpackage\.json\fP in the current folder and use the \fBname\fP property\. .IP \(bu 2 Default: OS X: \fB"open"\fP, Windows: \fB"start"\fP, Others: \fB"xdg\-open"\fP .IP \(bu 2 -Type: String +Type: String or Boolean .RE .P The browser that is called by the \fBnpm repo\fP command to open websites\. +.P +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 See Also .RS 0 .IP \(bu 2 diff --git a/deps/npm/man/man1/npm-restart.1 b/deps/npm/man/man1/npm-restart.1 index 5606fab7f0792d..af7679cacdee80 100644 --- a/deps/npm/man/man1/npm-restart.1 +++ b/deps/npm/man/man1/npm-restart.1 @@ -1,4 +1,4 @@ -.TH "NPM\-RESTART" "1" "August 2020" "" "" +.TH "NPM\-RESTART" "1" "October 2020" "" "" .SH "NAME" \fBnpm-restart\fR \- Restart a package .SS Synopsis diff --git a/deps/npm/man/man1/npm-root.1 b/deps/npm/man/man1/npm-root.1 index ac8fac9ecde387..5b131bfaa13bbc 100644 --- a/deps/npm/man/man1/npm-root.1 +++ b/deps/npm/man/man1/npm-root.1 @@ -1,4 +1,4 @@ -.TH "NPM\-ROOT" "1" "August 2020" "" "" +.TH "NPM\-ROOT" "1" "October 2020" "" "" .SH "NAME" \fBnpm-root\fR \- Display npm root .SS Synopsis diff --git a/deps/npm/man/man1/npm-run-script.1 b/deps/npm/man/man1/npm-run-script.1 index d45689ca5c7653..100a052f2f9f37 100644 --- a/deps/npm/man/man1/npm-run-script.1 +++ b/deps/npm/man/man1/npm-run-script.1 @@ -1,4 +1,4 @@ -.TH "NPM\-RUN\-SCRIPT" "1" "August 2020" "" "" +.TH "NPM\-RUN\-SCRIPT" "1" "October 2020" "" "" .SH "NAME" \fBnpm-run-script\fR \- Run arbitrary package scripts .SS Synopsis diff --git a/deps/npm/man/man1/npm-search.1 b/deps/npm/man/man1/npm-search.1 index 37ab65ee5d03ce..cb520d9d638a99 100644 --- a/deps/npm/man/man1/npm-search.1 +++ b/deps/npm/man/man1/npm-search.1 @@ -1,4 +1,4 @@ -.TH "NPM\-SEARCH" "1" "August 2020" "" "" +.TH "NPM\-SEARCH" "1" "October 2020" "" "" .SH "NAME" \fBnpm-search\fR \- Search for packages .SS Synopsis diff --git a/deps/npm/man/man1/npm-shrinkwrap.1 b/deps/npm/man/man1/npm-shrinkwrap.1 index 5ec9f9cdd9f410..4afd2af8cb6c88 100644 --- a/deps/npm/man/man1/npm-shrinkwrap.1 +++ b/deps/npm/man/man1/npm-shrinkwrap.1 @@ -1,4 +1,4 @@ -.TH "NPM\-SHRINKWRAP" "1" "August 2020" "" "" +.TH "NPM\-SHRINKWRAP" "1" "October 2020" "" "" .SH "NAME" \fBnpm-shrinkwrap\fR \- Lock down dependency versions for publication .SS Synopsis diff --git a/deps/npm/man/man1/npm-star.1 b/deps/npm/man/man1/npm-star.1 index 547a9e0c0acfb8..342887dc29c1e6 100644 --- a/deps/npm/man/man1/npm-star.1 +++ b/deps/npm/man/man1/npm-star.1 @@ -1,4 +1,4 @@ -.TH "NPM\-STAR" "1" "August 2020" "" "" +.TH "NPM\-STAR" "1" "October 2020" "" "" .SH "NAME" \fBnpm-star\fR \- Mark your favorite packages .SS Synopsis diff --git a/deps/npm/man/man1/npm-stars.1 b/deps/npm/man/man1/npm-stars.1 index dea4cf654d5f64..014bccf4a38c13 100644 --- a/deps/npm/man/man1/npm-stars.1 +++ b/deps/npm/man/man1/npm-stars.1 @@ -1,4 +1,4 @@ -.TH "NPM\-STARS" "1" "August 2020" "" "" +.TH "NPM\-STARS" "1" "October 2020" "" "" .SH "NAME" \fBnpm-stars\fR \- View packages marked as favorites .SS Synopsis diff --git a/deps/npm/man/man1/npm-start.1 b/deps/npm/man/man1/npm-start.1 index 7a7766a04c696a..5356c6e49e5410 100644 --- a/deps/npm/man/man1/npm-start.1 +++ b/deps/npm/man/man1/npm-start.1 @@ -1,4 +1,4 @@ -.TH "NPM\-START" "1" "August 2020" "" "" +.TH "NPM\-START" "1" "October 2020" "" "" .SH "NAME" \fBnpm-start\fR \- Start a package .SS Synopsis diff --git a/deps/npm/man/man1/npm-stop.1 b/deps/npm/man/man1/npm-stop.1 index 3f08b3fc5d4ba5..9d6ccc4486dfe0 100644 --- a/deps/npm/man/man1/npm-stop.1 +++ b/deps/npm/man/man1/npm-stop.1 @@ -1,4 +1,4 @@ -.TH "NPM\-STOP" "1" "August 2020" "" "" +.TH "NPM\-STOP" "1" "October 2020" "" "" .SH "NAME" \fBnpm-stop\fR \- Stop a package .SS Synopsis diff --git a/deps/npm/man/man1/npm-team.1 b/deps/npm/man/man1/npm-team.1 index aa402f20ea4178..8719674e349346 100644 --- a/deps/npm/man/man1/npm-team.1 +++ b/deps/npm/man/man1/npm-team.1 @@ -1,4 +1,4 @@ -.TH "NPM\-TEAM" "1" "August 2020" "" "" +.TH "NPM\-TEAM" "1" "October 2020" "" "" .SH "NAME" \fBnpm-team\fR \- Manage organization teams and team memberships .SS Synopsis diff --git a/deps/npm/man/man1/npm-test.1 b/deps/npm/man/man1/npm-test.1 index 4653e0956ed5bd..9d420d9c0975f8 100644 --- a/deps/npm/man/man1/npm-test.1 +++ b/deps/npm/man/man1/npm-test.1 @@ -1,4 +1,4 @@ -.TH "NPM\-TEST" "1" "August 2020" "" "" +.TH "NPM\-TEST" "1" "October 2020" "" "" .SH "NAME" \fBnpm-test\fR \- Test a package .SS Synopsis diff --git a/deps/npm/man/man1/npm-token.1 b/deps/npm/man/man1/npm-token.1 index 192f0166925f80..94c92cf3b350f3 100644 --- a/deps/npm/man/man1/npm-token.1 +++ b/deps/npm/man/man1/npm-token.1 @@ -1,4 +1,4 @@ -.TH "NPM\-TOKEN" "1" "August 2020" "" "" +.TH "NPM\-TOKEN" "1" "October 2020" "" "" .SH "NAME" \fBnpm-token\fR \- Manage your authentication tokens .SS Synopsis diff --git a/deps/npm/man/man1/npm-uninstall.1 b/deps/npm/man/man1/npm-uninstall.1 index 0caa7e251efcf6..9abe6471fa6b8e 100644 --- a/deps/npm/man/man1/npm-uninstall.1 +++ b/deps/npm/man/man1/npm-uninstall.1 @@ -1,4 +1,4 @@ -.TH "NPM\-UNINSTALL" "1" "August 2020" "" "" +.TH "NPM\-UNINSTALL" "1" "October 2020" "" "" .SH "NAME" \fBnpm-uninstall\fR \- Remove a package .SS Synopsis diff --git a/deps/npm/man/man1/npm-unpublish.1 b/deps/npm/man/man1/npm-unpublish.1 index a81ef365d7a343..674863db0fad41 100644 --- a/deps/npm/man/man1/npm-unpublish.1 +++ b/deps/npm/man/man1/npm-unpublish.1 @@ -1,4 +1,4 @@ -.TH "NPM\-UNPUBLISH" "1" "August 2020" "" "" +.TH "NPM\-UNPUBLISH" "1" "October 2020" "" "" .SH "NAME" \fBnpm-unpublish\fR \- Remove a package from the registry .SS Synopsis diff --git a/deps/npm/man/man1/npm-update.1 b/deps/npm/man/man1/npm-update.1 index fb74d097ea549e..86563ded737f1b 100644 --- a/deps/npm/man/man1/npm-update.1 +++ b/deps/npm/man/man1/npm-update.1 @@ -1,4 +1,4 @@ -.TH "NPM\-UPDATE" "1" "August 2020" "" "" +.TH "NPM\-UPDATE" "1" "October 2020" "" "" .SH "NAME" \fBnpm-update\fR \- Update a package .SS Synopsis diff --git a/deps/npm/man/man1/npm-version.1 b/deps/npm/man/man1/npm-version.1 index f2e442e4517b87..0a3f50a97dff27 100644 --- a/deps/npm/man/man1/npm-version.1 +++ b/deps/npm/man/man1/npm-version.1 @@ -1,4 +1,4 @@ -.TH "NPM\-VERSION" "1" "August 2020" "" "" +.TH "NPM\-VERSION" "1" "October 2020" "" "" .SH "NAME" \fBnpm-version\fR \- Bump a package version .SS Synopsis diff --git a/deps/npm/man/man1/npm-view.1 b/deps/npm/man/man1/npm-view.1 index 55de9cd0c0b57c..ce0ec2ddb90993 100644 --- a/deps/npm/man/man1/npm-view.1 +++ b/deps/npm/man/man1/npm-view.1 @@ -1,4 +1,4 @@ -.TH "NPM\-VIEW" "1" "August 2020" "" "" +.TH "NPM\-VIEW" "1" "October 2020" "" "" .SH "NAME" \fBnpm-view\fR \- View registry info .SS Synopsis diff --git a/deps/npm/man/man1/npm-whoami.1 b/deps/npm/man/man1/npm-whoami.1 index ee27e158b060df..0a0af758894a0a 100644 --- a/deps/npm/man/man1/npm-whoami.1 +++ b/deps/npm/man/man1/npm-whoami.1 @@ -1,4 +1,4 @@ -.TH "NPM\-WHOAMI" "1" "August 2020" "" "" +.TH "NPM\-WHOAMI" "1" "October 2020" "" "" .SH "NAME" \fBnpm-whoami\fR \- Display npm username .SS Synopsis diff --git a/deps/npm/man/man1/npm.1 b/deps/npm/man/man1/npm.1 index bfcfc11cc0dda1..efd4e47de85142 100644 --- a/deps/npm/man/man1/npm.1 +++ b/deps/npm/man/man1/npm.1 @@ -1,4 +1,4 @@ -.TH "NPM" "1" "August 2020" "" "" +.TH "NPM" "1" "October 2020" "" "" .SH "NAME" \fBnpm\fR \- javascript package manager .SS Synopsis @@ -10,7 +10,7 @@ npm [args] .RE .SS Version .P -6\.14\.8 +7\.0\.0\-rc\.3 .SS Description .P npm is the package manager for the Node JavaScript platform\. It puts @@ -50,7 +50,8 @@ requires compiling of C++ Code, npm will use node\-gyp \fIhttps://github\.com/nodejs/node\-gyp\fR for that task\. For a Unix system, node\-gyp \fIhttps://github\.com/nodejs/node\-gyp\fR needs Python, make and a buildchain like GCC\. On Windows, -Python and Microsoft Visual Studio C++ are needed\. +Python and Microsoft Visual Studio C++ are needed\. Python 3 is +not supported by node\-gyp \fIhttps://github\.com/nodejs/node\-gyp\fR\|\. For more information visit the node\-gyp repository \fIhttps://github\.com/nodejs/node\-gyp\fR and the node\-gyp Wiki \fIhttps://github\.com/nodejs/node\-gyp/wiki\fR\|\. diff --git a/deps/npm/man/man1/npx.1 b/deps/npm/man/man1/npx.1 index 8d0588f6bf2b1e..007bf4c65cd6e8 100644 --- a/deps/npm/man/man1/npx.1 +++ b/deps/npm/man/man1/npx.1 @@ -1,175 +1,211 @@ -.TH "NPX" "1" "July 2020" "npx@10.2.3" "User Commands" +.TH "NPX" "1" "October 2020" "" "" .SH "NAME" -\fBnpx\fR \- execute npm package binaries -.SH SYNOPSIS +\fBnpx\fR \- Run a command from a local or remote npm package +.SS Synopsis .P -\fBnpx [options] [@version] [command\-arg]\.\.\.\fP -.P -\fBnpx [options] [\-p|\-\-package ]\.\.\. [command\-arg]\.\.\.\fP -.P -\fBnpx [options] \-c ''\fP -.P -\fBnpx \-\-shell\-auto\-fallback [shell]\fP -.SH INSTALL -.P -\fBnpm install \-g npx\fP -.SH DESCRIPTION -.P -Executes \fB\fP either from a local \fBnode_modules/\.bin\fP, or from a central cache, installing any packages needed in order for \fB\fP to run\. -.P -By default, \fBnpx\fP will check whether \fB\fP exists in \fB$PATH\fP, or in the local project binaries, and execute that\. If \fB\fP is not found, it will be installed prior to execution\. -.P -Unless a \fB\-\-package\fP option is specified, \fBnpx\fP will try to guess the name of the binary to invoke depending on the specifier provided\. All package specifiers understood by \fBnpm\fP may be used with \fBnpx\fP, including git specifiers, remote tarballs, local directories, or scoped packages\. -.P -If a full specifier is included, or if \fB\-\-package\fP is used, npx will always use a freshly\-installed, temporary version of the package\. This can also be forced with the \fB\-\-ignore\-existing\fP flag\. +.RS 2 +.nf +npm exec \-\- [@] [args\.\.\.] +npm exec \-p [@] \-\- [args\.\.\.] +npm exec \-c ' [args\.\.\.]' +npm exec \-p foo \-c ' [args\.\.\.]' + +npx [@] [args\.\.\.] +npx \-p [@] [args\.\.\.] +npx \-c ' [args\.\.\.]' +npx \-p [@] \-c ' [args\.\.\.]' + +alias: npm x, npx + +\-p \-\-package= (may be specified multiple times) +\-c \-\-call= (may not be mixed with positional arguments) +.fi +.RE +.SS Description +.P +This command allows you to run an arbitrary command from an npm package +(either one installed locally, or fetched remotely), in a similar context +as running it via \fBnpm run\fP\|\. +.P +Whatever packages are specified by the \fB\-\-package\fP or \fB\-p\fP option will be +provided in the \fBPATH\fP of the executed command, along with any locally +installed package executables\. The \fB\-\-package\fP or \fB\-p\fP option may be +specified multiple times, to execute the supplied command in an environment +where all specified packages are available\. +.P +If any requested packages are not present in the local project +dependencies, then they are installed to a folder in the npm cache, which +is added to the \fBPATH\fP environment variable in the executed process\. A +prompt is printed (which can be suppressed by providing either \fB\-\-yes\fP or +\fB\-\-no\fP)\. +.P +Package names provided without a specifier will be matched with whatever +version exists in the local project\. Package names with a specifier will +only be considered a match if they have the exact same name and version as +the local dependency\. +.P +If no \fB\-c\fP or \fB\-\-call\fP option is provided, then the positional arguments +are used to generate the command string\. If no \fB\-p\fP or \fB\-\-package\fP options +are provided, then npm will attempt to determine the executable name from +the package specifier provided as the first positional argument according +to the following heuristic: .RS 0 .IP \(bu 2 -\fB\-p, \-\-package \fP \- define the package to be installed\. This defaults to the value of \fB\fP\|\. This is only needed for packages with multiple binaries if you want to call one of the other executables, or where the binary name does not match the package name\. If this option is provided \fB\fP will be executed as\-is, without interpreting \fB@version\fP if it's there\. Multiple \fB\-\-package\fP options may be provided, and all the packages specified will be installed\. -.IP \(bu 2 -\fB\-\-no\-install\fP \- If passed to \fBnpx\fP, it will only try to run \fB\fP if it already exists in the current path or in \fB$prefix/node_modules/\.bin\fP\|\. It won't try to install missing commands\. +If the package has a single entry in its \fBbin\fP field in \fBpackage\.json\fP, +then that command will be used\. .IP \(bu 2 -\fB\-\-cache \fP \- set the location of the npm cache\. Defaults to npm's own cache settings\. +If the package has multiple \fBbin\fP entries, and one of them matches the +unscoped portion of the \fBname\fP field, then that command will be used\. .IP \(bu 2 -\fB\-\-userconfig \fP \- path to the user configuration file to pass to npm\. Defaults to whatever npm's current default is\. -.IP \(bu 2 -\fB\-c \fP \- Execute \fB\fP inside an \fBnpm run\-script\fP\-like shell environment, with all the usual environment variables available\. Only the first item in \fB\fP will be automatically used as \fB\fP\|\. Any others \fImust\fR use \fB\-p\fP\|\. -.IP \(bu 2 -\fB\-\-shell \fP \- The shell to invoke the command with, if any\. -.IP \(bu 2 -\fB\-\-shell\-auto\-fallback []\fP \- Generates shell code to override your shell's "command not found" handler with one that calls \fBnpx\fP\|\. Tries to figure out your shell, or you can pass its name (either \fBbash\fP, \fBfish\fP, or \fBzsh\fP) as an option\. See below for how to install\. -.IP \(bu 2 -\fB\-\-ignore\-existing\fP \- If this flag is set, npx will not look in \fB$PATH\fP, or in the current package's \fBnode_modules/\.bin\fP for an existing version before deciding whether to install\. Binaries in those paths will still be available for execution, but will be shadowed by any packages requested by this install\. -.IP \(bu 2 -\fB\-q, \-\-quiet\fP \- Suppressed any output from npx itself (progress bars, error messages, install reports)\. Subcommand output itself will not be silenced\. -.IP \(bu 2 -\fB\-n, \-\-node\-arg\fP \- Extra node argument to supply to node when binary is a node script\. You can supply this option multiple times to add more arguments\. -.IP \(bu 2 -\fB\-v, \-\-version\fP \- Show the current npx version\. +If this does not result in exactly one option (either because there are +no bin entries, or none of them match the \fBname\fP of the package), then +\fBnpm exec\fP exits with an error\. .RE -.SH EXAMPLES -.SS Running a project\-local bin .P -.RS 2 -.nf -$ npm i \-D webpack -$ npx webpack \.\.\. -.fi -.RE -.SS One\-off invocation without local installation +To run a binary \fIother than\fR the named binary, specify one or more +\fB\-\-package\fP options, which will prevent npm from inferring the package from +the first command argument\. +.SS \fBnpx\fP vs \fBnpm exec\fP .P -.RS 2 -.nf -$ npm rm webpack -$ npx webpack \-\- \.\.\. -$ cat package\.json -\|\.\.\.webpack not in "devDependencies"\.\.\. -.fi -.RE -.SS Invoking a command from a github repository +When run via the \fBnpx\fP binary, all flags and options \fImust\fR be set prior to +any positional arguments\. When run via \fBnpm exec\fP, a double\-hyphen \fB\-\-\fP +flag can be used to suppress npm's parsing of switches and options that +should be sent to the executed command\. +.P +For example: .P .RS 2 .nf -$ npx github:piuccio/cowsay -\|\.\.\.or\.\.\. -$ npx git+ssh://my\.hosted\.git:cowsay\.git#semver:^1 -\|\.\.\.etc\.\.\. +$ npx foo@latest bar \-\-package=@npmcli/foo .fi .RE -.SS Execute a full shell command using one npx call w/ multiple packages +.P +In this case, npm will resolve the \fBfoo\fP package name, and run the +following command: .P .RS 2 .nf -$ npx \-p lolcatjs \-p cowsay \-c \\ - 'echo "$npm_package_name@$npm_package_version" | cowsay | lolcatjs' -\|\.\.\. - _____ -< your\-cool\-package@1\.2\.3 > - \-\-\-\-\- - \\ ^__^ - \\ (oo)\\_______ - (__)\\ )\\/\\ - ||\-\-\-\-w | - || || +$ foo bar \-\-package=@npmcli/foo .fi .RE -.SS Run node binary with \-\-inspect +.P +Since the \fB\-\-package\fP option comes \fIafter\fR the positional arguments, it is +treated as an argument to the executed command\. +.P +In contrast, due to npm's argument parsing logic, running this command is +different: .P .RS 2 .nf -$ npx \-\-node\-arg=\-\-inspect cowsay -Debugger listening on ws://127\.0\.0\.1:9229/\.\.\.\. +$ npm exec foo@latest bar \-\-package=@npmcli/foo .fi .RE -.SS Specify a node version to run npm scripts (or anything else!) +.P +In this case, npm will parse the \fB\-\-package\fP option first, resolving the +\fB@npmcli/foo\fP package\. Then, it will execute the following command in that +context: .P .RS 2 .nf -npx \-p node@8 npm run build +$ foo@latest bar .fi .RE -.SH SHELL AUTO FALLBACK .P -You can configure \fBnpx\fP to run as your default fallback command when you type something in the command line with an \fB@\fP but the command is not found\. This includes installing packages that were not found in the local prefix either\. -.P -For example: +The double\-hyphen character is recommended to explicitly tell npm to stop +parsing command line options and switches\. The following command would +thus be equivalent to the \fBnpx\fP command above: .P .RS 2 .nf -$ npm@4 \-\-version -(stderr) npm@4 not found\. Trying with npx\.\.\. -4\.6\.1 -$ asdfasdfasf -zsh: command not found: asfdasdfasdf +$ npm exec \-\- foo@latest bar \-\-package=@npmcli/foo .fi .RE +.SS Examples .P -Currently, \fBzsh\fP, \fBbash\fP (>= 4), and \fBfish\fP are supported\. You can access these completion scripts using \fBnpx \-\-shell\-auto\-fallback \fP\|\. -.P -To install permanently, add the relevant line below to your \fB~/\.bashrc\fP, \fB~/\.zshrc\fP, \fB~/\.config/fish/config\.fish\fP, or as needed\. To install just for the shell session, simply run the line\. -.P -You can optionally pass through \fB\-\-no\-install\fP when generating the fallback to prevent it from installing packages if the command is missing\. -.SS For bash@>=4: +Run the version of \fBtap\fP in the local dependencies, with the provided +arguments: .P .RS 2 .nf -$ source <(npx \-\-shell\-auto\-fallback bash) +$ npm exec \-\- tap \-\-bail test/foo\.js +$ npx tap \-\-bail test/foo\.js .fi .RE -.SS For zsh: +.P +Run a command \fIother than\fR the command whose name matches the package name +by specifying a \fB\-\-package\fP option: .P .RS 2 .nf -$ source <(npx \-\-shell\-auto\-fallback zsh) +$ npm exec \-\-package=foo \-\- bar \-\-bar\-argument +# ~ or ~ +$ npx \-\-package=foo bar \-\-bar\-argument .fi .RE -.SS For fish: +.P +Run an arbitrary shell script, in the context of the current project: .P .RS 2 .nf -$ source (npx \-\-shell\-auto\-fallback fish | psub) +$ npm x \-c 'eslint && say "hooray, lint passed"' +$ npx \-c 'eslint && say "hooray, lint passed"' .fi .RE -.SH ACKNOWLEDGEMENTS +.SS Compatibility with Older npx Versions .P -Huge thanks to Kwyn Meagher \fIhttps://blog\.kwyn\.io\fR for generously donating the package name in the main npm registry\. Previously \fBnpx\fP was used for a Tessel board Neopixels library, which can now be found under \fBnpx\-tessel\fP \fIhttps://npm\.im/npx\-tessel\fR\|\. -.SH AUTHOR +The \fBnpx\fP binary was rewritten in npm v7\.0\.0, and the standalone \fBnpx\fP +package deprecated at that time\. \fBnpx\fP uses the \fBnpm exec\fP +command instead of a separate argument parser and install process, with +some affordances to maintain backwards compatibility with the arguments it +accepted in previous versions\. .P -Written by Kat Marchan \fIhttps://github\.com/zkat\fR\|\. -.SH REPORTING BUGS -.P -Please file any relevant issues on Github\. \fIhttps://github\.com/npm/npx\fR -.SH LICENSE -.P -This work is released by its authors into the public domain under CC0\-1\.0\. See \fBLICENSE\.md\fP for details\. -.SH SEE ALSO +This resulted in some shifts in its functionality: .RS 0 .IP \(bu 2 -\fBnpm(1)\fP +Any \fBnpm\fP config value may be provided\. +.IP \(bu 2 +To prevent security and user\-experience problems from mistyping package +names, \fBnpx\fP prompts before installing anything\. Suppress this +prompt with the \fB\-y\fP or \fB\-\-yes\fP option\. .IP \(bu 2 -\fBnpm\-run\-script(1)\fP +The \fB\-\-no\-install\fP option is deprecated, and will be converted to \fB\-\-no\fP\|\. .IP \(bu 2 -\fBnpm\-config(7)\fP +Shell fallback functionality is removed, as it is not advisable\. +.IP \(bu 2 +The \fB\-p\fP argument is a shorthand for \fB\-\-parseable\fP in npm, but shorthand +for \fB\-\-package\fP in npx\. This is maintained, but only for the \fBnpx\fP +executable\. +.IP \(bu 2 +The \fB\-\-ignore\-existing\fP option is removed\. Locally installed bins are +always present in the executed process \fBPATH\fP\|\. +.IP \(bu 2 +The \fB\-\-npm\fP option is removed\. \fBnpx\fP will always use the \fBnpm\fP it ships +with\. +.IP \(bu 2 +The \fB\-\-node\-arg\fP and \fB\-n\fP options are removed\. +.IP \(bu 2 +The \fB\-\-always\-spawn\fP option is redundant, and thus removed\. +.IP \(bu 2 +The \fB\-\-shell\fP option is replaced with \fB\-\-script\-shell\fP, but maintained +in the \fBnpx\fP executable for backwards compatibility\. .RE +.SS See Also +.RS 0 +.IP \(bu 2 +npm help run\-script +.IP \(bu 2 +npm help scripts +.IP \(bu 2 +npm help test +.IP \(bu 2 +npm help start +.IP \(bu 2 +npm help restart +.IP \(bu 2 +npm help stop +.IP \(bu 2 +npm help config +.RE diff --git a/deps/npm/man/man5/folders.5 b/deps/npm/man/man5/folders.5 index 0eb2760599b3cc..656e1cded05b6c 100644 --- a/deps/npm/man/man5/folders.5 +++ b/deps/npm/man/man5/folders.5 @@ -1,4 +1,4 @@ -.TH "FOLDERS" "5" "August 2020" "" "" +.TH "FOLDERS" "5" "October 2020" "" "" .SH "NAME" \fBfolders\fR \- Folder Structures Used by npm .SS Description diff --git a/deps/npm/man/man5/install.5 b/deps/npm/man/man5/install.5 index 125016ae4100bc..985923c5d0b2d4 100644 --- a/deps/npm/man/man5/install.5 +++ b/deps/npm/man/man5/install.5 @@ -1,4 +1,4 @@ -.TH "INSTALL" "5" "August 2020" "" "" +.TH "INSTALL" "5" "October 2020" "" "" .SH "NAME" \fBinstall\fR \- Download and Install npm .SS Description diff --git a/deps/npm/man/man5/npmrc.5 b/deps/npm/man/man5/npmrc.5 index 1dc4ac5bbaf492..742fc4e3dee75c 100644 --- a/deps/npm/man/man5/npmrc.5 +++ b/deps/npm/man/man5/npmrc.5 @@ -1,4 +1,4 @@ -.TH "NPMRC" "5" "August 2020" "" "" +.TH "NPMRC" "5" "October 2020" "" "" .SH "NAME" \fBnpmrc\fR \- The npm config files .SS Description diff --git a/deps/npm/man/man5/package-json.5 b/deps/npm/man/man5/package-json.5 index da9147f2763e3b..5ff35f75a195e2 100644 --- a/deps/npm/man/man5/package-json.5 +++ b/deps/npm/man/man5/package-json.5 @@ -1,4 +1,4 @@ -.TH "PACKAGE\.JSON" "5" "August 2020" "" "" +.TH "PACKAGE\.JSON" "5" "October 2020" "" "" .SH "NAME" \fBpackage.json\fR \- Specifics of npm's package\.json handling .SS Description @@ -308,8 +308,12 @@ Conversely, some files are always ignored: .IP \(bu 2 \fB\|\.wafpickle\-N\fP .IP \(bu 2 +\fB\|\.*\.swp\fP +.IP \(bu 2 \fB\|\.DS_Store\fP .IP \(bu 2 +\fB\|\._*\fP +.IP \(bu 2 \fBnpm\-debug\.log\fP .IP \(bu 2 \fB\|\.npmrc\fP @@ -318,9 +322,9 @@ Conversely, some files are always ignored: .IP \(bu 2 \fBconfig\.gypi\fP .IP \(bu 2 -\fBpackage\-lock\.json\fP (use shrinkwrap instead) +\fB*\.orig\fP .IP \(bu 2 -All files containing a \fB*\fP character (incompatible with Windows) +\fBpackage\-lock\.json\fP (use shrinkwrap instead) .RE .SS main @@ -909,8 +913,8 @@ module will run on: .fi .RE .P -You can also blacklist instead of whitelist operating systems, -just prepend the blacklisted os with a '!': +You can also block instead of allowing operating systems, +just prepend the blocked os with a '!': .P .RS 2 .nf @@ -920,7 +924,7 @@ just prepend the blacklisted os with a '!': .P The host operating system is determined by \fBprocess\.platform\fP .P -It is allowed to both blacklist, and whitelist, although there isn't any +It is allowed to both block and allow an item, although there isn't any good reason to do this\. .SS cpu .P @@ -933,7 +937,7 @@ you can specify which ones\. .fi .RE .P -Like the \fBos\fP option, you can also blacklist architectures: +Like the \fBos\fP option, you can also block architectures: .P .RS 2 .nf diff --git a/deps/npm/man/man5/package-lock-json.5 b/deps/npm/man/man5/package-lock-json.5 index 5a61e250bd7ea6..8919e989600bf1 100644 --- a/deps/npm/man/man5/package-lock-json.5 +++ b/deps/npm/man/man5/package-lock-json.5 @@ -1,4 +1,4 @@ -.TH "PACKAGE\-LOCK\.JSON" "5" "August 2020" "" "" +.TH "PACKAGE\-LOCK\.JSON" "5" "October 2020" "" "" .SH "NAME" \fBpackage-lock.json\fR \- A manifestation of the manifest .SS Description diff --git a/deps/npm/man/man5/package-locks.5 b/deps/npm/man/man5/package-locks.5 index ec556d672dcd0b..c1258ab12bb40f 100644 --- a/deps/npm/man/man5/package-locks.5 +++ b/deps/npm/man/man5/package-locks.5 @@ -1,4 +1,4 @@ -.TH "PACKAGE\-LOCKS" "5" "August 2020" "" "" +.TH "PACKAGE\-LOCKS" "5" "October 2020" "" "" .SH "NAME" \fBpackage-locks\fR \- An explanation of npm lockfiles .SS Description diff --git a/deps/npm/man/man5/shrinkwrap-json.5 b/deps/npm/man/man5/shrinkwrap-json.5 index 3bf7c478b1ec3e..901ed72eb9c82c 100644 --- a/deps/npm/man/man5/shrinkwrap-json.5 +++ b/deps/npm/man/man5/shrinkwrap-json.5 @@ -1,4 +1,4 @@ -.TH "NPM\-SHRINKWRAP\.JSON" "5" "August 2020" "" "" +.TH "NPM\-SHRINKWRAP\.JSON" "5" "October 2020" "" "" .SH "NAME" \fBnpm-shrinkwrap.json\fR \- A publishable lockfile .SS Description diff --git a/deps/npm/man/man7/config.7 b/deps/npm/man/man7/config.7 index 4fadfd72346955..f748ea33e93d2c 100644 --- a/deps/npm/man/man7/config.7 +++ b/deps/npm/man/man7/config.7 @@ -1,4 +1,4 @@ -.TH "CONFIG" "7" "August 2020" "" "" +.TH "CONFIG" "7" "October 2020" "" "" .SH "NAME" \fBconfig\fR \- More than you probably want to know about npm configuration .SS Description @@ -178,6 +178,18 @@ When publishing scoped packages, the access level defaults to \fBrestricted\fP\| 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 +.RS 0 +.IP \(bu 2 +Default: \fBfalse\fP +.IP \(bu 2 +Type: Boolean + +.RE +.P +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 .RS 0 .IP \(bu 2 @@ -284,11 +296,16 @@ ostensibly Unix systems\. .IP \(bu 2 Default: OS X: \fB"open"\fP, Windows: \fB"start"\fP, Others: \fB"xdg\-open"\fP .IP \(bu 2 -Type: String +Type: String or Boolean .RE .P -The browser that is called by the \fBnpm docs\fP command to open websites\. +The browser that is called by npm commands to open websites\. +.P +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 .RS 0 .IP \(bu 2 @@ -443,19 +460,15 @@ disabled when the environment variable \fBNO_COLOR\fP is set to any value\. .SS depth .RS 0 .IP \(bu 2 -Default: Infinity +Default: 0 .IP \(bu 2 Type: Number .RE .P -The depth to go when recursing directories for \fBnpm ls\fP, -\fBnpm cache ls\fP, and \fBnpm outdated\fP\|\. +The depth to go when recursing packages for \fBnpm ls\fP\|\. .P -For \fBnpm outdated\fP, a setting of \fBInfinity\fP will be treated as \fB0\fP -since that gives more useful information\. To show the outdated status -of all packages and dependents, use a large integer value, -e\.g\., \fBnpm outdated \-\-depth 9999\fP +To make this default to \fBInfinity\fP instead of \fB0\fP, set \fB\-\-all\fP\|\. .SS description .RS 0 .IP \(bu 2 @@ -522,18 +535,33 @@ Type: Boolean .RE .P -Makes various commands more forceful\. +Removes various protections against unfortunate side effects, common +mistakes, unnecessary performance degradation, and malicious input\. .RS 0 .IP \(bu 2 -lifecycle script failure does not block progress\. +Allow clobbering non\-npm files in global installs\. +.IP \(bu 2 +Allow the \fBnpm version\fP command to work on an unclean git repository\. +.IP \(bu 2 +Allow deleting the cache folder with \fBnpm cache clean\fP\|\. +.IP \(bu 2 +Allow installing packages that have an \fBengines\fP declaration requiring a +different version of npm\. .IP \(bu 2 -publishing clobbers previously published versions\. +Allow installing packages that have an \fBengines\fP declaration requiring a +different version of \fBnode\fP, even if \fB\-\-engines\-strict\fP is enabled\. .IP \(bu 2 -skips cache when requesting from the registry\. +Allow \fBnpm audit fix\fP to install modules outside your stated dependency +range (including SemVer\-major changes)\. .IP \(bu 2 -prevents checks against clobbering non\-npm files\. +Allow a module to be installed as a direct dependency of itself\. +.IP \(bu 2 +Allow unpublishing all versions of a published package\. .RE +.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 format\-package\-lock .RS 0 .IP \(bu 2 @@ -588,6 +616,16 @@ Type: Number .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 fund .RS 0 .IP \(bu 2 @@ -598,7 +636,7 @@ 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\. +aknowledging the number of dependencies looking for funding\. See npm help \fBfund\fP for details\. .SS git .RS 0 @@ -856,6 +894,28 @@ 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 \fBglobal\-style\fP this option will be preferred\. +.SS legacy\-peer\-deps +.RS 0 +.IP \(bu 2 +Default: false +.IP \(bu 2 +Type: Boolean + +.RE +.P +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\. +.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 +\fBpeerDependencies\fP \fIcould\fR be unpacked in a correct place\. +.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 .RS 0 .IP \(bu 2 @@ -906,24 +966,6 @@ 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 logstream -.RS 0 -.IP \(bu 2 -Default: process\.stderr -.IP \(bu 2 -Type: Stream - -.RE -.P -This is the stream that is passed to the -npmlog \fIhttps://github\.com/npm/npmlog\fR module at run time\. -.P -It cannot be set from the command line, but if you are using npm -programmatically, you may wish to send logs to somewhere other than -stderr\. -.P -If the \fBcolor\fP config is set to true, then this stream will receive -colored output if it is a TTY\. .SS logs\-max .RS 0 .IP \(bu 2 @@ -1020,17 +1062,6 @@ Type: Boolean .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 onload\-script -.RS 0 -.IP \(bu 2 -Default: false -.IP \(bu 2 -Type: path - -.RE -.P -A node module to \fBrequire()\fP when npm loads\. Useful for programmatic -usage\. .SS only .RS 0 .IP \(bu 2 @@ -1521,6 +1552,27 @@ Type: 'oauth', 'saml', or null .RE .P If \fB\-\-auth\-type=sso\fP, the type of SSO type to use\. +.SS strict\-peer\-deps +.RS 0 +.IP \(bu 2 +Default: false +.IP \(bu 2 +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\. +.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 .RS 0 .IP \(bu 2 diff --git a/deps/npm/man/man7/developers.7 b/deps/npm/man/man7/developers.7 index 9758713ed81ccd..2e3aba25d0c281 100644 --- a/deps/npm/man/man7/developers.7 +++ b/deps/npm/man/man7/developers.7 @@ -1,4 +1,4 @@ -.TH "DEVELOPERS" "7" "August 2020" "" "" +.TH "DEVELOPERS" "7" "October 2020" "" "" .SH "NAME" \fBdevelopers\fR \- Developer Guide .SS Description @@ -179,8 +179,8 @@ The following paths and files are never ignored, so adding them to If, given the structure of your project, you find \fB\|\.npmignore\fP to be a maintenance headache, you might instead try populating the \fBfiles\fP property of \fBpackage\.json\fP, which is an array of file or directory names -that should be included in your package\. Sometimes a whitelist is easier -to manage than a blacklist\. +that should be included in your package\. Sometimes manually picking +which items to allow is easier to manage than building a block list\. .SS Testing whether your \fB\|\.npmignore\fP or \fBfiles\fP config works .P If you want to double check that your package will include only the files diff --git a/deps/npm/man/man7/disputes.7 b/deps/npm/man/man7/disputes.7 index 4a4c6b43938c5a..3bfb018ccf83f8 100644 --- a/deps/npm/man/man7/disputes.7 +++ b/deps/npm/man/man7/disputes.7 @@ -1,4 +1,4 @@ -.TH "DISPUTES" "7" "August 2020" "" "" +.TH "DISPUTES" "7" "October 2020" "" "" .SH "NAME" \fBdisputes\fR \- Handling Module Name Disputes .P diff --git a/deps/npm/man/man7/orgs.7 b/deps/npm/man/man7/orgs.7 index 3e87316c86f207..cb229f4a0eee3f 100644 --- a/deps/npm/man/man7/orgs.7 +++ b/deps/npm/man/man7/orgs.7 @@ -1,4 +1,4 @@ -.TH "ORGS" "7" "August 2020" "" "" +.TH "ORGS" "7" "October 2020" "" "" .SH "NAME" \fBorgs\fR \- Working with Teams & Orgs .SS Description diff --git a/deps/npm/man/man7/registry.7 b/deps/npm/man/man7/registry.7 index 77f998292639eb..cd4068c6cda1c9 100644 --- a/deps/npm/man/man7/registry.7 +++ b/deps/npm/man/man7/registry.7 @@ -1,4 +1,4 @@ -.TH "REGISTRY" "7" "August 2020" "" "" +.TH "REGISTRY" "7" "October 2020" "" "" .SH "NAME" \fBregistry\fR \- The JavaScript Package Registry .SS Description diff --git a/deps/npm/man/man7/removal.7 b/deps/npm/man/man7/removal.7 index 482b598f05efde..98a06c6ffd43be 100644 --- a/deps/npm/man/man7/removal.7 +++ b/deps/npm/man/man7/removal.7 @@ -1,4 +1,4 @@ -.TH "REMOVAL" "7" "August 2020" "" "" +.TH "REMOVAL" "7" "October 2020" "" "" .SH "NAME" \fBremoval\fR \- Cleaning the Slate .SS Synopsis diff --git a/deps/npm/man/man7/scope.7 b/deps/npm/man/man7/scope.7 index dbb7d592065805..28ae6121b07138 100644 --- a/deps/npm/man/man7/scope.7 +++ b/deps/npm/man/man7/scope.7 @@ -1,4 +1,4 @@ -.TH "SCOPE" "7" "August 2020" "" "" +.TH "SCOPE" "7" "October 2020" "" "" .SH "NAME" \fBscope\fR \- Scoped packages .SS Description diff --git a/deps/npm/man/man7/scripts.7 b/deps/npm/man/man7/scripts.7 index d74abc013aa199..ea5ef96939e154 100644 --- a/deps/npm/man/man7/scripts.7 +++ b/deps/npm/man/man7/scripts.7 @@ -1,4 +1,4 @@ -.TH "SCRIPTS" "7" "August 2020" "" "" +.TH "SCRIPTS" "7" "October 2020" "" "" .SH "NAME" \fBscripts\fR \- How npm handles the "scripts" field .SS Description diff --git a/deps/npm/man/man7/semver.7 b/deps/npm/man/man7/semver.7 index 2614080cae61a2..93c06872b94e89 100644 --- a/deps/npm/man/man7/semver.7 +++ b/deps/npm/man/man7/semver.7 @@ -1,4 +1,4 @@ -.TH "SEMVER" "7" "August 2020" "" "" +.TH "SEMVER" "7" "October 2020" "" "" .SH "NAME" \fBsemver\fR \- The semantic versioner for npm .SH Install diff --git a/deps/npm/node_modules/@npmcli/arborist/LICENSE b/deps/npm/node_modules/@npmcli/arborist/LICENSE new file mode 100644 index 00000000000000..13ff5b9eac5dca --- /dev/null +++ b/deps/npm/node_modules/@npmcli/arborist/LICENSE @@ -0,0 +1,22 @@ +The ISC License + +Copyright npm, Inc. + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND NPM DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +AND FITNESS. IN NO EVENT SHALL NPM BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE +OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. + +--- + +Files and metadata contained in `test/fixtures/registry-mocks/content` are +downloaded from the public npm registry. These are the property of their +respective owners. The use and distribution of said artifacts are covered by +their associated licenses. diff --git a/deps/npm/node_modules/@npmcli/arborist/README.md b/deps/npm/node_modules/@npmcli/arborist/README.md new file mode 100644 index 00000000000000..c8efd37b747410 --- /dev/null +++ b/deps/npm/node_modules/@npmcli/arborist/README.md @@ -0,0 +1,335 @@ +# @npmcli/arborist + +Inspect and manage `node_modules` trees. + +![a tree with the word ARBORIST superimposed on it](https://raw.githubusercontent.com/npm/arborist/master/logo.svg?sanitize=true) + +There's more documentation [in the notes +folder](https://github.com/npm/arborist/tree/master/notes). + +## USAGE + +```js +const Arborist = require('@npmcli/arborist') + +const arb = new Arborist({ + // options object + + // where we're doing stuff. defaults to cwd. + path: '/path/to/package/root', + + // url to the default registry. defaults to npm's default registry + registry: 'https://registry.npmjs.org', + + // scopes can be mapped to a different registry + '@foo:registry': 'https://registry.foo.com/', + + // Auth can be provided in a couple of different ways. If none are + // provided, then requests are anonymous, and private packages will 404. + // Arborist doesn't do anything with these, it just passes them down + // the chain to pacote and npm-registry-fetch. + + // Safest: a bearer token provided by a registry: + // 1. an npm auth token, used with the default registry + token: 'deadbeefcafebad', + // 2. an alias for the same thing: + _authToken: 'deadbeefcafebad', + + // insecure options: + // 3. basic auth, username:password, base64 encoded + auth: 'aXNhYWNzOm5vdCBteSByZWFsIHBhc3N3b3Jk', + // 4. username and base64 encoded password + username: 'isaacs', + password: 'bm90IG15IHJlYWwgcGFzc3dvcmQ=', + + // auth configs can also be scoped to a given registry with this + // rather unusual pattern: + '//registry.foo.com:token': 'blahblahblah', + '//basic.auth.only.foo.com:_auth': 'aXNhYWNzOm5vdCBteSByZWFsIHBhc3N3b3Jk', + '//registry.foo.com:always-auth': true, +}) + +// READING + +// returns a promise. reads the actual contents of node_modules +arb.loadActual().then(tree => { + // tree is also stored at arb.virtualTree +}) + +// read just what the package-lock.json/npm-shrinkwrap says +// This *also* loads the yarn.lock file, but that's only relevant +// when building the ideal tree. +arb.loadVirtual().then(tree => { + // tree is also stored at arb.virtualTree + // now arb.virtualTree is loaded + // this fails if there's no package-lock.json or package.json in the folder + // note that loading this way should only be done if there's no + // node_modules folder +}) + +// OPTIMIZING AND DESIGNING + +// build an ideal tree from the package.json and various lockfiles. +arb.buildIdealTree(options).then(() => { + // next step is to reify that ideal tree onto disk. + // options can be: + // rm: array of package names to remove at top level + // add: Array of package specifiers to add at the top level. Each of + // these will be resolved with pacote.manifest if the name can't be + // determined from the spec. (Eg, `github:foo/bar` vs `foo@somespec`.) + // The dep will be saved in the location where it already exists, + // (or pkg.dependencies) unless a different saveType is specified. + // saveType: Save added packages in a specific dependency set. + // - null (default) Wherever they exist already, or 'dependencies' + // - prod: definitely in 'dependencies' + // - optional: in 'optionalDependencies' + // - dev: devDependencies + // - peer: save in peerDependencies, and remove any optional flag from + // peerDependenciesMeta if one exists + // - peerOptional: save in peerDependencies, and add a + // peerDepsMeta[name].optional flag + // saveBundle: add newly added deps to the bundleDependencies list + // update: Either `true` to just go ahead and update everything, or an + // object with any or all of the following fields: + // - all: boolean. set to true to just update everything + // - names: names of packages update (like `npm update foo`) + // prune: boolean, default true. Prune extraneous nodes from the tree. + // preferDedupe: prefer to deduplicate packages if possible, rather than + // choosing a newer version of a dependency. Defaults to false, ie, + // always try to get the latest and greatest deps. + // legacyBundling: Nest every dep under the node requiring it, npm v2 style. + // No unnecessary deduplication. Default false. + + // At the end of this process, arb.idealTree is set. +}) + +// WRITING + +// Make the idealTree be the thing that's on disk +arb.reify({ + // write the lockfile(s) back to disk, and package.json with any updates + // defaults to 'true' + save: true, +}).then(() => { + // node modules has been written to match the idealTree +}) +``` + +## DATA STRUCTURES + +A `node_modules` tree is a logical graph of dependencies overlaid on a +physical tree of folders. + +A `Node` represents a package folder on disk, either at the root of the +package, or within a `node_modules` folder. The physical structure of the +folder tree is represented by the `node.parent` reference to the containing +folder, and `node.children` map of nodes within its `node_modules` +folder, where the key in the map is the name of the folder in +`node_modules`, and the value is the child node. + +A node without a parent is a top of tree. + +A `Link` represents a symbolic link to a package on disk. This can be a +symbolic link to a package folder within the current tree, or elsewhere on +disk. The `link.target` is a reference to the actual node. Links differ +from Nodes in that dependencies are resolved from the _target_ location, +rather than from the link location. + +An `Edge` represents a dependency relationship. Each node has an `edgesIn` +set, and an `edgesOut` map. Each edge has a `type` which specifies what +kind of dependency it represents: `'prod'` for regular dependencies, +`'peer'` for peerDependencies, `'dev'` for devDependencies, and +`'optional'` for optionalDependencies. `edge.from` is a reference to the +node that has the dependency, and `edge.to` is a reference to the node that +requires the dependency. + +As nodes are moved around in the tree, the graph edges are automatically +updated to point at the new module resolution targets. In other words, +`edge.from`, `edge.name`, and `edge.spec` are immutable; `edge.to` is +updated automatically when a node's parent changes. + +### class Node + +All arborist trees are `Node` objects. A `Node` refers +to a package folder, which may have children in `node_modules`. + +* `node.name` The name of this node's folder in `node_modules`. +* `node.parent` Physical parent node in the tree. The package in whose + `node_modules` folder this package lives. Null if node is top of tree. + + Setting `node.parent` will automatically update `node.location` and all + graph edges affected by the move. + +* `node.meta` A `Shrinkwrap` object which looks up `resolved` and + `integrity` values for all modules in this tree. Only relevant on `root` + nodes. + +* `node.children` Map of packages located in the node's `node_modules` + folder. +* `node.package` The contents of this node's `package.json` file. +* `node.path` File path to this package. If the node is a link, then this + is the path to the link, not to the link target. If the node is _not_ a + link, then this matches `node.realpath`. +* `node.realpath` The full real filepath on disk where this node lives. +* `node.location` A slash-normalized relative path from the root node to + this node's path. +* `node.isLink` Whether this represents a symlink. Always `false` for Node + objects, always `true` for Link objects. +* `node.isRoot` True if this node is a root node. (Ie, if `node.root === + node`.) +* `node.root` The root node where we are working. If not assigned to some + other value, resolves to the node itself. (Ie, the root node's `root` + property refers to itself.) +* `node.isTop` True if this node is the top of its tree (ie, has no + `parent`, false otherwise). +* `node.top` The top node in this node's tree. This will be equal to + `node.root` for simple trees, but link targets will frequently be outside + of (or nested somewhere within) a `node_modules` hierarchy, and so will + have a different `top`. +* `node.dev`, `node.optional`, `node.devOptional`, `node.peer`, Indicators + as to whether this node is a dev, optional, and/or peer dependency. + These flags are relevant when pruning dependencies out of the tree or + deciding what to reify. See **Package Dependency Flags** below for + explanations. +* `node.edgesOut` Edges in the dependency graph indicating nodes that this + node depends on, which resolve its dependencies. +* `node.edgesIn` Edges in the dependency graph indicating nodes that depend + on this node. + +* `extraneous` True if this package is not required by any other for any + reason. False for top of tree. + +* `node.resolve(name)` Identify the node that will be returned when code + in this package runs `require(name)` + +* `node.errors` Array of errors encountered while parsing package.json or + version specifiers. + +### class Link + +Link objects represent a symbolic link within the `node_modules` folder. +They have most of the same properties and methods as `Node` objects, with a +few differences. + +* `link.target` A Node object representing the package that the link + references. If this is a Node already present within the tree, then it + will be the same object. If it's outside of the tree, then it will be + treated as the top of its own tree. +* `link.isLink` Always true. +* `link.children` This is always an empty map, since links don't have their + own children directly. + +### class Edge + +Edge objects represent a dependency relationship a package node to the +point in the tree where the dependency will be loaded. As nodes are moved +within the tree, Edges automatically update to point to the appropriate +location. + +* `new Edge({ from, type, name, spec })` Creates a new edge with the + specified fields. After instantiation, none of the fields can be + changed directly. +* `edge.from` The node that has the dependency. +* `edge.type` The type of dependency. One of `'prod'`, `'dev'`, `'peer'`, + or `'optional'`. +* `edge.name` The name of the dependency. Ie, the key in the + relevant `package.json` dependencies object. +* `edge.spec` The specifier that is required. This can be a version, + range, tag name, git url, or tarball URL. Any specifier allowed by npm + is supported. +* `edge.to` Automatically set to the node in the tree that matches the + `name` field. +* `edge.valid` True if `edge.to` satisfies the specifier. +* `edge.error` A string indicating the type of error if there is a problem, + or `null` if it's valid. Values, in order of precedence: + * `DETACHED` Indicates that the edge has been detached from its + `edge.from` node, typically because a new edge was created when a + dependency specifier was modified. + * `MISSING` Indicates that the dependency is unmet. Note that this is + _not_ set for unmet dependencies of the `optional` type. + * `PEER LOCAL` Indicates that a `peerDependency` is found in the + node's local `node_modules` folder, and the node is not the top of + the tree. This violates the `peerDependency` contract, because it + means that the dependency is not a peer. + * `INVALID` Indicates that the dependency does not satisfy `edge.spec`. +* `edge.reload()` Re-resolve to find the appropriate value for `edge.to`. + Called automatically from the `Node` class when the tree is mutated. + +### Package Dependency Flags + +The dependency type of a node can be determined efficiently by looking at +the `dev`, `optional`, and `devOptional` flags on the node object. These +are updated by arborist when necessary whenever the tree is modified in +such a way that the dependency graph can change, and are relevant when +pruning nodes from the tree. + +``` +| extraneous | peer | dev | optional | devOptional | meaning | prune? | +|------------+------+-----+----------+-------------+---------------------+-------------------| +| | | | | | production dep | never | +|------------+------+-----+----------+-------------+---------------------+-------------------| +| X | N/A | N/A | N/A | N/A | nothing depends on | always | +| | | | | | this, it is trash | | +|------------+------+-----+----------+-------------+---------------------+-------------------| +| | | X | | X | devDependency, or | if pruning dev | +| | | | | not in lock | only depended upon | | +| | | | | | by devDependencies | | +|------------+------+-----+----------+-------------+---------------------+-------------------| +| | | | X | X | optionalDependency, | if pruning | +| | | | | not in lock | or only depended on | optional | +| | | | | | by optionalDeps | | +|------------+------+-----+----------+-------------+---------------------+-------------------| +| | | X | X | X | Optional dependency | if pruning EITHER | +| | | | | not in lock | of dep(s) in the | dev OR optional | +| | | | | | dev hierarchy | | +|------------+------+-----+----------+-------------+---------------------+-------------------| +| | | | | X | BOTH a non-optional | if pruning BOTH | +| | | | | in lock | dep within the dev | dev AND optional | +| | | | | | hierarchy, AND a | | +| | | | | | dep within the | | +| | | | | | optional hierarchy | | +|------------+------+-----+----------+-------------+---------------------+-------------------| +| | X | | | | peer dependency, or | if pruning peers | +| | | | | | only depended on by | | +| | | | | | peer dependencies | | +|------------+------+-----+----------+-------------+---------------------+-------------------| +| | X | X | | X | peer dependency of | if pruning peer | +| | | | | not in lock | dev node hierarchy | OR dev deps | +|------------+------+-----+----------+-------------+---------------------+-------------------| +| | X | | X | X | peer dependency of | if pruning peer | +| | | | | not in lock | optional nodes, or | OR optional deps | +| | | | | | peerOptional dep | | +|------------+------+-----+----------+-------------+---------------------+-------------------| +| | X | X | X | X | peer optional deps | if pruning peer | +| | | | | not in lock | of the dev dep | OR optional OR | +| | | | | | hierarchy | dev | +|------------+------+-----+----------+-------------+---------------------+-------------------| +| | X | | | X | BOTH a non-optional | if pruning peers | +| | | | | in lock | peer dep within the | OR: | +| | | | | | dev hierarchy, AND | BOTH optional | +| | | | | | a peer optional dep | AND dev deps | ++------------+------+-----+----------+-------------+---------------------+-------------------+ +``` + +* If none of these flags are set, then the node is required by the + dependency and/or peerDependency hierarchy. It should not be pruned. +* If _both_ `node.dev` and `node.optional` are set, then the node is an + optional dependency of one of the packages in the devDependency + hierarchy. It should be pruned if _either_ dev or optional deps are + being removed. +* If `node.dev` is set, but `node.optional` is not, then the node is + required in the devDependency hierarchy. It should be pruned if dev + dependencies are being removed. +* If `node.optional` is set, but `node.dev` is not, then the node is + required in the optionalDependency hierarchy. It should be pruned if + optional dependencies are being removed. +* If `node.devOptional` is set, then the node is a (non-optional) + dependency within the devDependency hierarchy, _and_ a dependency + within the `optionalDependency` hierarchy. It should be pruned if + _both_ dev and optional dependencies are being removed. +* If `node.peer` is set, then all the same semantics apply as above, except + that the dep is brought in by a peer dep at some point, rather than a + normal non-peer dependency. + +Note: `devOptional` is only set in the shrinkwrap/package-lock file if +_neither_ `dev` nor `optional` are set, as it would be redundant. 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 new file mode 100644 index 00000000000000..c050bde53a3451 --- /dev/null +++ b/deps/npm/node_modules/@npmcli/arborist/lib/add-rm-pkg-deps.js @@ -0,0 +1,131 @@ +// add and remove dependency specs to/from pkg manifest + +const removeFromOthers = (name, type, pkg) => { + const others = new Set([ + 'dependencies', + 'optionalDependencies', + 'devDependencies', + 'peerDependenciesMeta', + 'peerDependencies', + ]) + + switch (type) { + case 'prod': + others.delete('dependencies') + break + case 'dev': + others.delete('devDependencies') + break + case 'optional': + others.delete('optionalDependencies') + break + case 'peer': + case 'peerOptional': + others.delete('devDependencies') + others.delete('peerDependencies') + others.delete('peerDependenciesMeta') + break + } + + for (const other of others) + deleteSubKey(pkg, other, name) +} + +const add = ({pkg, add, saveBundle, saveType}) => { + for (const spec of add) + addSingle({pkg, spec, saveBundle, saveType}) + + return pkg +} + +const addSingle = ({pkg, spec, saveBundle, saveType}) => { + if (!saveType) + saveType = getSaveType(pkg, spec) + + const { name, rawSpec } = spec + removeFromOthers(name, saveType, pkg) + const type = saveType === 'prod' ? 'dependencies' + : saveType === 'optional' ? 'optionalDependencies' + : saveType === 'peer' || saveType === 'peerOptional' ? 'peerDependencies' + : saveType === 'dev' ? 'devDependencies' + : /* istanbul ignore next */ null + + pkg[type] = pkg[type] || {} + if (rawSpec !== '' || pkg[type][name] === undefined) + pkg[type][name] = rawSpec || '*' + + if (saveType === 'peer' || saveType === 'peerOptional') { + const pdm = pkg.peerDependenciesMeta || {} + if (saveType === 'peer' && pdm[name] && pdm[name].optional) + pdm[name].optional = false + else if (saveType === 'peerOptional') { + pdm[name] = pdm[name] || {} + pdm[name].optional = true + pkg.peerDependenciesMeta = pdm + } + // peerDeps are often also a devDep, so that they can be tested when + // using package managers that don't auto-install peer deps + if (pkg.devDependencies && pkg.devDependencies[name] !== undefined) + pkg.devDependencies[name] = pkg.peerDependencies[name] + } + + if (saveBundle) { + // keep it sorted, keep it unique + const bd = new Set(pkg.bundleDependencies || []) + bd.add(spec.name) + pkg.bundleDependencies = [...bd].sort((a, b) => a.localeCompare(b)) + } +} + +const getSaveType = (pkg, spec) => { + const {name} = spec + const { + // these names are so lonnnnngggg + devDependencies: devDeps, + optionalDependencies: optDeps, + peerDependencies: peerDeps, + peerDependenciesMeta: peerDepsMeta, + } = pkg + + if (peerDeps && peerDeps[name] !== undefined) { + if (peerDepsMeta && peerDepsMeta[name] && peerDepsMeta[name].optional) + return 'peerOptional' + else + return 'peer' + } else if (devDeps && devDeps[name] !== undefined) + return 'dev' + else if (optDeps && optDeps[name] !== undefined) + return 'optional' + else + return 'prod' +} + +const deleteSubKey = (obj, k, sk) => { + if (obj[k]) { + delete obj[k][sk] + if (!Object.keys(obj[k]).length) + delete obj[k] + } +} + +const rm = (pkg, rm) => { + for (const type of [ + 'dependencies', + 'optionalDependencies', + 'peerDependencies', + 'peerDependenciesMeta', + 'devDependencies', + ]) { + for (const name of rm) + deleteSubKey(pkg, type, name) + } + if (pkg.bundleDependencies) { + pkg.bundleDependencies = pkg.bundleDependencies + .filter(name => !rm.includes(name)) + if (!pkg.bundleDependencies.length) + delete pkg.bundleDependencies + } + return pkg +} + +module.exports = { add, rm } diff --git a/deps/npm/node_modules/@npmcli/arborist/lib/arborist/audit.js b/deps/npm/node_modules/@npmcli/arborist/lib/arborist/audit.js new file mode 100644 index 00000000000000..aee7072d02ab01 --- /dev/null +++ b/deps/npm/node_modules/@npmcli/arborist/lib/arborist/audit.js @@ -0,0 +1,30 @@ +// mixin implementing the audit method + +const AuditReport = require('../audit-report.js') + +// shared with reify +const _global = Symbol.for('global') + +module.exports = cls => class Auditor extends cls { + async audit (options = {}) { + this.addTracker('audit') + if (this[_global]) { + throw Object.assign( + new Error('`npm audit` does not support testing globals'), + { code: 'EAUDITGLOBAL' } + ) + } + + // allow the user to set options on the ctor as well. + // XXX: deprecate separate method options objects. + options = { ...this.options, ...options } + + process.emit('time', 'audit') + const tree = await this.loadVirtual() + this.auditReport = await AuditReport.load(tree, this.options) + const ret = options.fix ? this.reify() : this.auditReport + process.emit('timeEnd', 'audit') + this.finishTracker('audit') + return ret + } +} diff --git a/deps/npm/node_modules/@npmcli/arborist/lib/arborist/build-ideal-tree.js b/deps/npm/node_modules/@npmcli/arborist/lib/arborist/build-ideal-tree.js new file mode 100644 index 00000000000000..2b9b4595b512bb --- /dev/null +++ b/deps/npm/node_modules/@npmcli/arborist/lib/arborist/build-ideal-tree.js @@ -0,0 +1,1421 @@ +// mixin implementing the buildIdealTree method +const rpj = require('read-package-json-fast') +const npa = require('npm-package-arg') +const pacote = require('pacote') +const cacache = require('cacache') +const semver = require('semver') +const promiseCallLimit = require('promise-call-limit') +const getPeerSet = require('../peer-set.js') +const realpath = require('../../lib/realpath.js') + +const fromPath = require('../from-path.js') +const calcDepFlags = require('../calc-dep-flags.js') +const Shrinkwrap = require('../shrinkwrap.js') +const Node = require('../node.js') +const Link = require('../link.js') +const addRmPkgDeps = require('../add-rm-pkg-deps.js') +const gatherDepSet = require('../gather-dep-set.js') +const optionalSet = require('../optional-set.js') +const {checkEngine, checkPlatform} = require('npm-install-checks') + +// enum of return values for canPlaceDep. +// No, this is a conflict, you may not put that package here +const CONFLICT = Symbol('CONFLICT') +// Yes, this is fine, and should not be a problem +const OK = Symbol('OK') +// No need, because the package already here is fine +const KEEP = Symbol('KEEP') +// Yes, clobber the package that is already here +const REPLACE = Symbol('REPLACE') + +const relpath = require('../relpath.js') + +// note: some of these symbols are shared so we can hit +// them with unit tests and reuse them across mixins +const _complete = Symbol('complete') +const _depsSeen = Symbol('depsSeen') +const _depsQueue = Symbol('depsQueue') +const _currentDep = Symbol('currentDep') +const _updateAll = Symbol('updateAll') +const _mutateTree = Symbol('mutateTree') +const _flagsSuspect = Symbol.for('flagsSuspect') +const _prune = Symbol('prune') +const _preferDedupe = Symbol('preferDedupe') +const _legacyBundling = Symbol('legacyBundling') +const _parseSettings = Symbol('parseSettings') +const _initTree = Symbol('initTree') +const _applyUserRequests = Symbol('applyUserRequests') +const _inflateAncientLockfile = Symbol('inflateAncientLockfile') +const _buildDeps = Symbol('buildDeps') +const _buildDepStep = Symbol('buildDepStep') +const _nodeFromEdge = Symbol('nodeFromEdge') +const _nodeFromSpec = Symbol('nodeFromSpec') +const _fetchManifest = Symbol('fetchManifest') +const _problemEdges = Symbol('problemEdges') +const _manifests = Symbol('manifests') +const _loadWorkspaces = Symbol.for('loadWorkspaces') +const _linkFromSpec = Symbol('linkFromSpec') +const _loadPeerSet = Symbol('loadPeerSet') +const _updateNames = Symbol.for('updateNames') +const _placeDep = Symbol.for('placeDep') +const _canPlaceDep = Symbol.for('canPlaceDep') +const _canPlacePeers = Symbol('canPlacePeers') +const _pruneForReplacement = Symbol('pruneForReplacement') +const _fixDepFlags = Symbol('fixDepFlags') +const _resolveLinks = Symbol('resolveLinks') +const _rootNodeFromPackage = Symbol('rootNodeFromPackage') +const _add = Symbol('add') +const _resolvedAdd = Symbol.for('resolvedAdd') +const _queueNamedUpdates = Symbol('queueNamedUpdates') +const _queueVulnDependents = Symbol('queueVulnDependents') +const _avoidRange = Symbol('avoidRange') +const _shouldUpdateNode = Symbol('shouldUpdateNode') +const _resetDepFlags = Symbol('resetDepFlags') +const _loadFailures = Symbol('loadFailures') +const _pruneFailedOptional = Symbol('pruneFailedOptional') +const _linkNodes = Symbol('linkNodes') +const _follow = Symbol('follow') +const _globalStyle = Symbol('globalStyle') +const _globalRootNode = Symbol('globalRootNode') +const _isVulnerable = Symbol.for('isVulnerable') +const _usePackageLock = Symbol.for('usePackageLock') +const _rpcache = Symbol.for('realpathCache') +const _stcache = Symbol.for('statCache') +const _updateFilePath = Symbol('updateFilePath') +const _followSymlinkPath = Symbol('followSymlinkPath') +const _getRelpathSpec = Symbol('getRelpathSpec') +const _retrieveSpecName = Symbol('retrieveSpecName') +const _strictPeerDeps = Symbol('strictPeerDeps') +const _checkEngineAndPlatform = Symbol('checkEngineAndPlatform') +const _checkEngine = Symbol('checkEngine') +const _checkPlatform = Symbol('checkPlatform') + +// used for the ERESOLVE error to show the last peer conflict encountered +const _peerConflict = Symbol('peerConflict') + +// used by Reify mixin +const _force = Symbol.for('force') +const _explicitRequests = Symbol.for('explicitRequests') +const _global = Symbol.for('global') +const _idealTreePrune = Symbol.for('idealTreePrune') + +module.exports = cls => class IdealTreeBuilder extends cls { + constructor (options) { + super(options) + + // normalize trailing slash + const registry = options.registry || 'https://registry.npmjs.org' + options.registry = this.registry = registry.replace(/\/+$/, '') + '/' + + const { + idealTree = null, + global = false, + follow = false, + globalStyle = false, + legacyPeerDeps = false, + force = false, + packageLock = true, + strictPeerDeps = false, + } = options + + this[_force] = !!force + this[_strictPeerDeps] = !!strictPeerDeps + + this.idealTree = idealTree + this.legacyPeerDeps = legacyPeerDeps + + this[_usePackageLock] = packageLock + this[_global] = !!global + this[_globalStyle] = this[_global] || globalStyle + this[_follow] = !!follow + + this[_explicitRequests] = new Set() + this[_preferDedupe] = false + this[_legacyBundling] = false + this[_depsSeen] = new Set() + this[_depsQueue] = [] + this[_currentDep] = null + this[_updateNames] = [] + this[_updateAll] = false + this[_mutateTree] = false + this[_loadFailures] = new Set() + this[_linkNodes] = new Set() + this[_manifests] = new Map() + this[_peerConflict] = null + } + + get explicitRequests () { + return new Set(this[_explicitRequests]) + } + + // public method + async buildIdealTree (options = {}) { + if (this.idealTree) + return Promise.resolve(this.idealTree) + + // allow the user to set reify options on the ctor as well. + // XXX: deprecate separate reify() options object. + options = { ...this.options, ...options } + + // an empty array or any falsey value is the same as null + if (!options.add || options.add.length === 0) + options.add = null + if (!options.rm || options.rm.length === 0) + options.rm = null + + process.emit('time', 'idealTree') + + if (!options.add && !options.rm && this[_global]) + return Promise.reject(new Error('global requires an add or rm option')) + + // first get the virtual tree, if possible. If there's a lockfile, then + // that defines the ideal tree, unless the root package.json is not + // satisfied by what the ideal tree provides. + // from there, we start adding nodes to it to satisfy the deps requested + // by the package.json in the root. + + this[_parseSettings](options) + + // start tracker block + this.addTracker('idealTree') + + try { + await this[_initTree]() + await this[_applyUserRequests](options) + await this[_inflateAncientLockfile]() + await this[_buildDeps]() + await this[_fixDepFlags]() + await this[_pruneFailedOptional]() + await this[_checkEngineAndPlatform]() + } finally { + process.emit('timeEnd', 'idealTree') + this.finishTracker('idealTree') + } + + return this.idealTree + } + + [_checkEngineAndPlatform] () { + // engine/platform checks throw, so start the promise chain off first + return Promise.resolve() + .then(() => { + for (const node of this.idealTree.inventory.values()) { + if (!node.optional) { + this[_checkEngine](node) + this[_checkPlatform](node) + } + } + }) + } + + [_checkPlatform] (node) { + checkPlatform(node.package, this[_force]) + } + + [_checkEngine] (node) { + const { engineStrict, npmVersion, nodeVersion } = this.options + const c = () => checkEngine(node.package, npmVersion, nodeVersion, this[_force]) + + if (engineStrict) + c() + else { + try { + c() + } catch (er) { + this.log.warn(er.code, er.message, { + package: er.pkgid, + required: er.required, + current: er.current, + }) + } + } + } + + [_parseSettings] (options) { + const update = options.update === true ? { all: true } + : Array.isArray(options.update) ? { names: options.update } + : options.update || {} + + if (update.all || !Array.isArray(update.names)) + update.names = [] + + this[_complete] = !!options.complete + this[_preferDedupe] = !!options.preferDedupe + this[_legacyBundling] = !!options.legacyBundling + this[_updateNames] = update.names + this[_updateAll] = update.all + // we prune by default unless explicitly set to boolean false + this[_prune] = options.prune !== false + + // set if we add anything, but also set here if we know we'll make + // changes and thus have to maybe prune later. + this[_mutateTree] = !!( + options.add || + options.rm || + update.all || + update.names.length + ) + } + + // load the initial tree, either the virtualTree from a shrinkwrap, + // or just the root node from a package.json + [_initTree] () { + process.emit('time', 'idealTree:init') + return ( + this[_global] ? this[_globalRootNode]() + : rpj(this.path + '/package.json').then( + pkg => this[_rootNodeFromPackage](pkg), + er => this[_rootNodeFromPackage]({}) + )) + .then(root => this[_loadWorkspaces](root)) + // ok to not have a virtual tree. probably initial install. + // When updating all, we load the shrinkwrap, but don't bother + // to build out the full virtual tree from it, since we'll be + // reconstructing it anyway. + .then(root => this[_global] ? root + : !this[_usePackageLock] || this[_updateAll] + ? Shrinkwrap.reset({ path: this.path }) + .then(meta => Object.assign(root, {meta})) + : this.loadVirtual({ root })) + + // if we don't have a lockfile to go from, then start with the + // actual tree, so we only make the minimum required changes. + // don't do this for global installs or updates, because in those + // cases we don't use a lockfile anyway. + // Load on a new Arborist object, so the Nodes aren't the same, + // or else it'll get super confusing when we change them! + // Only have to mapWorkspaces if we didn't get it from actual or virtual + .then(async root => { + if (!this[_updateAll] && !this[_global] && !root.meta.loadedFromDisk) + await new this.constructor(this.options).loadActual({ root }) + return root + }) + .then(tree => { + // null the virtual tree, because we're about to hack away at it + // if you want another one, load another copy. + this.idealTree = tree + this.virtualTree = null + process.emit('timeEnd', 'idealTree:init') + }) + } + + [_globalRootNode] () { + const root = this[_rootNodeFromPackage]({}) + // this is a gross kludge to handle the fact that we don't save + // metadata on the root node in global installs, because the "root" + // node is something like /usr/local/lib/node_modules. + const meta = new Shrinkwrap({ path: this.path }) + meta.reset() + root.meta = meta + return Promise.resolve(root) + } + + [_rootNodeFromPackage] (pkg) { + return new Node({ + path: this.path, + pkg, + extraneous: false, + dev: false, + devOptional: false, + peer: false, + optional: false, + global: this[_global], + legacyPeerDeps: this.legacyPeerDeps, + }) + } + + // process the add/rm requests by modifying the root node, and the + // update.names request by queueing nodes dependent on those named. + async [_applyUserRequests] (options) { + process.emit('time', 'idealTree:userRequests') + // If we have a list of package names to update, and we know it's + // going to update them wherever they are, add any paths into those + // named nodes to the buildIdealTree queue. + if (this[_updateNames].length) + this[_queueNamedUpdates]() + + if (this.auditReport && this.auditReport.size > 0) + this[_queueVulnDependents](options) + + if (options.rm && options.rm.length) { + addRmPkgDeps.rm(this.idealTree.package, options.rm) + for (const name of options.rm) + this[_explicitRequests].add(name) + } + + if (options.add) + await this[_add](options) + + // triggers a refresh of all edgesOut + this.idealTree.package = this.idealTree.package + process.emit('timeEnd', 'idealTree:userRequests') + } + + // This returns a promise because we might not have the name yet, + // and need to call pacote.manifest to find the name. + [_add] ({add, saveType = null, saveBundle = false}) { + // get the name for each of the specs in the list. + // ie, doing `foo@bar` we just return foo + // but if it's a url or git, we don't know the name until we + // fetch it and look in its manifest. + return Promise.all(add.map(rawSpec => + this[_retrieveSpecName](npa(rawSpec)) + .then(add => this[_updateFilePath](add)) + .then(add => this[_followSymlinkPath](add)) + )).then(add => { + this[_resolvedAdd] = add + // now add is a list of spec objects with names. + // find a home for each of them! + addRmPkgDeps.add({ + pkg: this.idealTree.package, + add, + saveBundle, + saveType, + path: this.path, + }) + for (const spec of add) + this[_explicitRequests].add(spec.name) + }) + } + + async [_retrieveSpecName] (spec) { + // if it's just @'' then we reload whatever's there, or get latest + // if it's an explicit tag, we need to install that specific tag version + const isTag = spec.rawSpec && spec.type === 'tag' + + if (spec.name && !isTag) + return spec + + const mani = await pacote.manifest(spec, { ...this.options }) + // if it's a tag type, then we need to run it down to an actual version + if (isTag) + return npa(`${mani.name}@${mani.version}`) + + spec.name = mani.name + return spec + } + + async [_updateFilePath] (spec) { + if (spec.type === 'file') + spec = this[_getRelpathSpec](spec, spec.fetchSpec) + + return spec + } + + async [_followSymlinkPath] (spec) { + if (spec.type === 'directory') { + const real = await ( + realpath(spec.fetchSpec, this[_rpcache], this[_stcache]) + // TODO: create synthetic test case to simulate realpath failure + .catch(/* istanbul ignore next */() => null) + ) + + spec = this[_getRelpathSpec](spec, real) + } + return spec + } + + [_getRelpathSpec] (spec, filepath) { + /* istanbul ignore else - should also be covered by realpath failure */ + if (filepath) { + const { name } = spec + spec = npa(`file:${relpath(this.path, filepath)}`, this.path) + spec.name = name + } + return spec + } + + // TODO: provide a way to fix bundled deps by exposing metadata about + // what's in the bundle at each published manifest. Without that, we + // can't possibly fix bundled deps without breaking a ton of other stuff, + // and leaving the user subject to getting it overwritten later anyway. + [_queueVulnDependents] (options) { + for (const {nodes} of this.auditReport.values()) { + for (const node of nodes) { + const bundler = node.getBundler() + + // XXX this belongs in the audit report itself, not here. + // We shouldn't even get these things here, and they shouldn't + // be printed by npm-audit-report as if they can be fixed, because + // they can't. + if (bundler) { + this.log.warn(`audit fix ${node.name}@${node.version}`, + `${node.location}\nis a bundled dependency of\n${ + bundler.name}@${bundler.version} at ${bundler.location}\n` + + 'It cannot be fixed automatically.\n' + + `Check for updates to the ${bundler.name} package.`) + continue + } + + for (const edge of node.edgesIn) { + this.addTracker('idealTree', edge.from.name, edge.from.location) + this[_depsQueue].push(edge.from) + } + } + } + + // note any that can't be fixed at the root level without --force + // if there's a fix, we use that. otherwise, the user has to remove it, + // find a different thing, fix the upstream, etc. + // + // XXX: how to handle top nodes that aren't the root? Maybe the report + // just tells the user to cd into that directory and fix it? + if (this[_force] && this.auditReport && this.auditReport.topVulns.size) { + options.add = options.add || [] + options.rm = options.rm || [] + for (const [name, topVuln] of this.auditReport.topVulns.entries()) { + const { + simpleRange, + topNodes, + fixAvailable, + } = topVuln + for (const node of topNodes) { + if (node !== this.idealTree) { + // not something we're going to fix, sorry. have to cd into + // that directory and fix it yourself. + this.log.warn('audit', 'Manual fix required in linked project ' + + `at ./${node.location} for ${name}@${simpleRange}.\n` + + `'cd ./${node.location}' and run 'npm audit' for details.`) + continue + } + + if (!fixAvailable) { + this.log.warn('audit', `No fix available for ${name}@${simpleRange}`) + continue + } + + const { isSemVerMajor, version } = fixAvailable + const breakingMessage = isSemVerMajor + ? 'a SemVer major change' + : 'outside your stated dependency range' + this.log.warn('audit', `Updating ${name} to ${version},` + + `which is ${breakingMessage}.`) + options.add.push(`${name}@${version}`) + } + } + } + } + + [_isVulnerable] (node) { + return this.auditReport && this.auditReport.isVulnerable(node) + } + + [_avoidRange] (name) { + if (!this.auditReport) + return null + const vuln = this.auditReport.get(name) + if (!vuln) + return null + return vuln.range + } + + [_queueNamedUpdates] () { + // ignore top nodes, since they are not loaded the same way, and + // probably have their own project associated with them. + + // for every node with one of the names on the list, we add its + // dependents to the queue to be evaluated. in buildDepStem, + // anything on the update names list will get refreshed, even if + // it isn't a problem. + + // XXX this could be faster by doing a series of inventory.query('name') + // calls rather than walking over everything in the tree. + const set = this.idealTree.inventory + .filter(n => this[_shouldUpdateNode](n)) + for (const node of set) { + for (const edge of node.edgesIn) { + this.addTracker('idealTree', edge.from.name, edge.from.location) + this[_depsQueue].push(edge.from) + } + } + } + + [_shouldUpdateNode] (node) { + return this[_updateNames].includes(node.name) && + !node.isTop && + !node.inDepBundle && + !node.inShrinkwrap + } + + async [_inflateAncientLockfile] () { + const { meta, inventory } = this.idealTree + const ancient = meta.ancientLockfile + const old = meta.loadedFromDisk && !(meta.originalLockfileVersion >= 2) + if (inventory.size === 0 || !(ancient || old && this[_complete])) + return + + // if the lockfile is from node v5 or earlier, then we'll have to reload + // all the manifests of everything we encounter. this is costly, but at + // least it's just a one-time hit. + process.emit('time', 'idealTree:inflate') + + const heading = ancient ? 'ancient lockfile' : 'old lockfile' + this.log.warn(heading, + ` +The ${meta.type} file was created with an old version of npm, +so supplemental metadata must be fetched from the registry. + +This is a one-time fix-up, please be patient... +`) + + this.addTracker('idealTree:inflate') + const queue = [] + for (const node of inventory.values()) { + queue.push(async () => { + this.log.silly('inflate', node.location) + const id = `${node.name}@${node.version}` + const sloc = node.location.substr('node_modules/'.length) + const t = `idealTree:inflate:${sloc}` + this.addTracker(t) + await pacote.manifest(id, { + ...this.options, + resolved: node.resolved, + integrity: node.integrity, + fullMetadata: false, + }).then(mani => { + node.package = { ...mani, _id: `${mani.name}@${mani.version}` } + }).catch((er) => { + const warning = `Could not fetch metadata for ${id}` + this.log.warn(heading, warning, er) + }) + this.finishTracker(t) + }) + } + await promiseCallLimit(queue) + this.finishTracker('idealTree:inflate') + process.emit('timeEnd', 'idealTree:inflate') + } + + // at this point we have a virtual tree with the actual root node's + // package deps, which may be partly or entirely incomplete, invalid + // or extraneous. + [_buildDeps] (node) { + process.emit('time', 'idealTree:buildDeps') + this[_depsQueue].push(this.idealTree) + this.log.silly('idealTree', 'buildDeps') + this.addTracker('idealTree', this.idealTree.name, '') + return this[_buildDepStep]() + .then(() => process.emit('timeEnd', 'idealTree:buildDeps')) + } + + async [_buildDepStep] () { + // removes tracker of previous dependency in the queue + if (this[_currentDep]) { + const { location, name } = this[_currentDep] + process.emit('timeEnd', `idealTree:${location || '#root'}`) + this.finishTracker('idealTree', name, location) + this[_currentDep] = null + } + + if (!this[_depsQueue].length) + return this[_resolveLinks]() + + // sort physically shallower deps up to the front of the queue, + // because they'll affect things deeper in, then alphabetical + this[_depsQueue].sort((a, b) => + (a.depth - b.depth) || a.path.localeCompare(b.path)) + + const node = this[_depsQueue].shift() + const bd = node.package.bundleDependencies + const hasBundle = bd && Array.isArray(bd) && bd.length + const { hasShrinkwrap } = node + + // if the node was already visited, or has since been removed from the + // tree, skip over it and process the rest of the queue. If a node has + // a shrinkwrap, also skip it, because it's going to get its deps + // satisfied by whatever's in that file anyway. + if (this[_depsSeen].has(node) || + node.root !== this.idealTree || + hasShrinkwrap && !this[_complete]) + return this[_buildDepStep]() + + this[_depsSeen].add(node) + this[_currentDep] = node + process.emit('time', `idealTree:${node.location || '#root'}`) + + // if we're loading a _complete_ ideal tree, for a --package-lock-only + // installation for example, we have to crack open the tarball and + // look inside if it has bundle deps or shrinkwraps. note that this is + // not necessary during a reification, because we just update the + // ideal tree by reading bundles/shrinkwraps in place. + // Don't bother if the node is from the actual tree and hasn't + // been resolved, because we can't fetch it anyway, could be anything! + const crackOpen = this[_complete] && + node !== this.idealTree && + node.resolved && + (hasBundle || hasShrinkwrap) + if (crackOpen) { + const Arborist = this.constructor + const opt = { ...this.options } + await cacache.tmp.withTmp(this.cache, opt, async path => { + await pacote.extract(node.resolved, path, opt) + + if (hasShrinkwrap) { + await new Arborist({ ...this.options, path }) + .loadVirtual({ root: node }) + } + + if (hasBundle) { + await new Arborist({ ...this.options, path }) + .loadActual({ root: node, ignoreMissing: true }) + } + }) + } + + // if any deps are missing or invalid, then we fetch the manifest for + // the thing we want, and build a new dep node from that. + // Then, find the ideal placement for that node. The ideal placement + // searches from the node's deps (or parent deps in the case of non-root + // peer deps), and walks up the tree until it finds the highest spot + // where it doesn't cause any conflicts. + // + // A conflict can be: + // - A node by that name already exists at that location. + // - The parent has a peer dep on that name + // - One of the node's peer deps conflicts at that location, unless the + // peer dep is met by a node at that location, which is fine. + // + // If we create a new node, then build its ideal deps as well. + // + // Note: this is the same "maximally naive" deduping tree-building + // algorithm that npm has used since v3. In a case like this: + // + // root -> (a@1, b@1||2) + // a -> (b@1) + // + // You'll end up with a tree like this: + // + // root + // +-- a@1 + // | +-- b@1 + // +-- b@2 + // + // rather than this, more deduped, but just as correct tree: + // + // root + // +-- a@1 + // +-- b@1 + // + // Another way to look at it is that this algorithm favors getting higher + // version deps at higher levels in the tree, even if that reduces + // potential deduplication. + // + // Set `preferDedupe: true` in the options to replace the shallower + // dep if allowed. + + const tasks = await Promise.all( + // resolve all the edges into nodes using pacote.manifest + // return a {dep,edge} object so that we can track the reason + // for this node through the parallelized async operation. + // note that dep.edgesOut will have all its peer deps resolved, + // since they're relevant in the calculation about where to place + // the new and/or updated dependency. + this[_problemEdges](node).map(edge => this[_nodeFromEdge](edge) + .then(dep => ({edge, dep}))) + ) + + const placed = tasks + .sort((a, b) => a.edge.name.localeCompare(b.edge.name)) + .map(({ edge, dep }) => this[_placeDep](dep, node, edge)) + + const promises = [] + for (const set of placed) { + for (const node of set) { + this[_mutateTree] = true + this.addTracker('idealTree', node.name, node.location) + this[_depsQueue].push(node) + + // we're certainly going to need these soon, fetch them asap + // if it fails at this point, though, dont' worry because it + // may well be an optional dep that has gone missing. it'll + // fail later anyway. + const from = fromPath(node) + promises.push(...this[_problemEdges](node).map(e => + this[_fetchManifest](npa.resolve(e.name, e.spec, from)) + .catch(er => null))) + } + } + await Promise.all(promises) + + return this[_buildDepStep]() + } + + // loads a node from an edge, and then loads its peer deps (and their + // peer deps, on down the line) into a virtual root parent. + [_nodeFromEdge] (edge, parent) { + // create a virtual root node with the same deps as the node that + // is requesting this one, so that we can get all the peer deps in + // a context where they're likely to be resolvable. + const { legacyPeerDeps } = this + parent = parent || new Node({ + path: '/virtual-root', + sourceReference: edge.from, + legacyPeerDeps, + }) + + const spec = npa.resolve(edge.name, edge.spec, edge.from.path) + return this[_nodeFromSpec](edge.name, spec, parent, edge) + .then(node => { + // handle otherwise unresolvable dependency nesting loops by + // creating a symbolic link + // a1 -> b1 -> a2 -> b2 -> a1 -> ... + // instead of nesting forever, when the loop occurs, create + // a symbolic link to the earlier instance + for (let p = edge.from.resolveParent; p; p = p.resolveParent) { + if (p.matches(node) && !p.isRoot) + return new Link({ parent, target: p }) + } + return this[_loadPeerSet](node) + }) + } + + [_problemEdges] (node) { + // skip over any bundled deps, they're not our problem. + // Note that this WILL fetch bundled meta-deps which are also dependencies + // but not listed as bundled deps. When reifying, we first unpack any + // nodes that have bundleDependencies, then do a loadActual on them, move + // the nodes into the ideal tree, and then prune. So, fetching those + // possibly-bundled meta-deps at this point doesn't cause any worse + // problems than a few unnecessary packument fetches. + + // also skip over any nodes in the tree that failed to load, since those + // will crash the install later on anyway. + const bd = node.isRoot ? null : node.package.bundleDependencies + const bundled = new Set(bd || []) + + return [...node.edgesOut.values()] + .filter(edge => { + // If it's included in a bundle, we take whatever is specified. + if (bundled.has(edge.name)) + return false + + // If it's already been logged as a load failure, skip it. + if (edge.to && this[_loadFailures].has(edge.to)) + return false + + // If it's shrinkwrapped, we use what the shrinkwap wants. + if (edge.to && edge.to.inShrinkwrap) + return false + + // If the edge has an error, there's a problem. + if (!edge.valid) + return true + + // If the edge has no destination, that's a problem. + if (!edge.to) + return edge.type !== 'peerOptional' + + // If user has explicitly asked to update this package by name, it's a problem. + if (this[_updateNames].includes(edge.name)) + return true + + // If we're fixing a security vulnerability with this package, it's a problem. + if (this[_isVulnerable](edge.to)) + return true + + // If the user has explicitly asked to install this package, it's a problem. + if (node.isRoot && this[_explicitRequests].has(edge.name)) + return true + + // No problems! + return false + }) + } + + async [_fetchManifest] (spec) { + const options = { + ...this.options, + avoid: this[_avoidRange](spec.name), + } + // get the intended spec and stored metadata from yarn.lock file, + // if available and valid. + spec = this.idealTree.meta.checkYarnLock(spec, options) + + if (this[_manifests].has(spec.raw)) + return this[_manifests].get(spec.raw) + else { + this.log.silly('fetch manifest', spec.raw) + const p = pacote.manifest(spec, options) + .then(mani => { + this[_manifests].set(spec.raw, mani) + return mani + }) + this[_manifests].set(spec.raw, p) + return p + } + } + + [_nodeFromSpec] (name, spec, parent, edge) { + // pacote will slap integrity on its options, so we have to clone + // the object so it doesn't get mutated. + // Don't bother to load the manifest for link deps, because the target + // might be within another package that doesn't exist yet. + const { legacyPeerDeps } = this + return spec.type === 'directory' + ? this[_linkFromSpec](name, spec, parent, edge) + : this[_fetchManifest](spec) + .then(pkg => new Node({ name, pkg, parent, legacyPeerDeps }), error => { + error.requiredBy = edge.from.location || '.' + + // failed to load the spec, either because of enotarget or + // fetch failure of some other sort. save it so we can verify + // later that it's optional, otherwise the error is fatal. + const n = new Node({ + name, + parent, + error, + legacyPeerDeps, + }) + this[_loadFailures].add(n) + return n + }) + } + + [_linkFromSpec] (name, spec, parent, edge) { + const realpath = spec.fetchSpec + const { legacyPeerDeps } = this + return rpj(realpath + '/package.json').catch(() => ({})).then(pkg => { + const link = new Link({ name, parent, realpath, pkg, legacyPeerDeps }) + this[_linkNodes].add(link) + return link + }) + } + + // load all peer deps and meta-peer deps into the node's parent + // At the end of this, the node's peer-type outward edges are all + // resolved, and so are all of theirs, but other dep types are not. + // We prefer to get peer deps that meet the requiring node's dependency, + // if possible, since that almost certainly works (since that package was + // developed with this set of deps) and will typically be more restrictive. + [_loadPeerSet] (node) { + const peerEdges = [...node.edgesOut.values()] + .filter(e => e.peer && !e.valid) + .map(e => node.parent && node.parent.edgesOut.get(e.name) || e) + return Promise.all( + peerEdges.map(edge => this[_nodeFromEdge](edge, node.parent)) + ).then(() => node) + } + + // starting from either node, or in the case of non-root peer deps, + // the node's parent, walk up the tree until we find the first spot + // where this dep cannot be placed, and use the one right before that. + // place dep, requested by node, to satisfy edge + [_placeDep] (dep, node, edge, peerEntryEdge = null) { + if (edge.to && + !edge.error && + !this[_updateNames].includes(edge.name) && + !this[_isVulnerable](edge.to)) + return [] + + // top nodes should still get peer deps from their parent or fsParent + // if possible, and only install locally if there's no other option, + // eg for a link outside of the project root. + const start = edge.peer && !node.isRoot + ? node.resolveParent || node + : node + + let target + let canPlace = null + let warnPeer = false + for (let check = start; check; check = check.resolveParent) { + const cp = this[_canPlaceDep](dep, check, edge, peerEntryEdge) + + // anything other than a conflict is fine to proceed with + if (cp !== CONFLICT) { + canPlace = cp + target = check + } else { + if (check === start) { + // if it's a peer dep, and the first place we're putting it conflicts + // because the node has a direct dependency on the pkg in question, + // then we treat that as an override when --force is applied, and + // just warn about it. + const checkEdge = check.edgesOut.get(edge.name) + warnPeer = check === start && edge.peer && checkEdge + } + break + } + + // nest packages like npm v1 and v2 + // very disk-inefficient + if (this[_legacyBundling]) + break + + // when installing globally, or just in global style, we never place + // deps above the first level. + if (this[_globalStyle] && check.resolveParent === this.idealTree) + break + } + + if (!target) { + const curNode = node.resolve(edge.name) + const pc = this[_peerConflict] || { peer: null, current: null } + // we'll only get one of these + const current = curNode ? curNode.explain() : pc.current + const peerConflict = pc.peer + const expl = { + code: 'ERESOLVE', + dep: dep.explain(edge), + current, + peerConflict, + fixWithForce: edge.peer && !!warnPeer, + type: edge.type, + isPeer: edge.peer, + } + const override = this[_force] || !this[_strictPeerDeps] + + if (override && expl.fixWithForce) { + this.log.warn('ERESOLVE', 'overriding peer dependency', expl) + return [] + } else { + const er = new Error('unable to resolve dependency tree') + throw Object.assign(er, expl) + } + } + + this.log.silly( + 'placeDep', + target.location || 'ROOT', + `${edge.name}@${edge.spec}`, + canPlace, + `for: ${node.package._id || node.location}` + ) + + // it worked, so we clearly have no peer conflicts at this point. + this[_peerConflict] = null + + // Can only get KEEP here if the original edge was valid, + // and we're checking for an update but it's already up to date. + if (canPlace === KEEP) { + dep.parent = null + return [] + } + + // figure out which of this node's peer deps will get placed as well + const virtualRoot = dep.parent + + const placed = [dep] + const oldChild = target.children.get(edge.name) + if (oldChild) { + // if we're replacing, we should also remove any nodes for edges that + // are now invalid, and where this (or its deps) is the only dependent, + // and also recurse on that pruning. Otherwise leaving that dep node + // around can result in spurious conflicts pushing nodes deeper into + // the tree than needed in the case of cycles that will be removed + // later anyway. + const oldDeps = [] + for (const [name, edge] of oldChild.edgesOut.entries()) { + if (!dep.edgesOut.has(name) && edge.to) + oldDeps.push(edge.to) + } + dep.replace(oldChild) + this[_pruneForReplacement](dep, oldDeps) + // this may also create some invalid edges, for example if we're + // intentionally causing something to get nested which was previously + // placed in this location. + for (const edge of dep.edgesIn) { + if (edge.invalid) { + this[_depsQueue].push(edge.from) + this[_depsSeen].delete(edge.from) + } + } + } else + dep.parent = target + + // If the edge is not an error, then we're updating something, and + // MAY end up putting a better/identical node further up the tree in + // a way that causes an unnecessary duplication. If so, remove the + // now-unnecessary node. + if (edge.valid && edge.to.parent !== target && dep.canReplace(edge.to)) + edge.to.parent = null + + // visit any dependents who are upset by this change + for (const edge of dep.edgesIn) { + if (!edge.valid) { + this.addTracker('idealTree', edge.from.name, edge.from.location) + this[_depsQueue].push(edge.from) + } + } + + // in case we just made some duplicates that can be removed, + // prune anything deeper in the tree that can be replaced by this + if (this.idealTree) { + for (const node of this.idealTree.inventory.query('name', dep.name)) { + if (node !== dep && + node.isDescendantOf(target) && + !node.inShrinkwrap && + !node.inBundle && + node.canReplaceWith(dep)) { + // don't prune if the dupe is necessary! + // root (a, d) + // +-- a (b, c2) + // | +-- b (c2) <-- place c2 for b, lands at root + // +-- d (e) + // +-- e (c1, d) + // +-- c1 + // +-- f (c2) + // +-- c2 <-- pruning this would be bad + + const mask = node.parent !== target && + node.parent.parent !== target && + node.parent.parent.resolve(dep.name) + + if (!mask || mask === dep || node.canReplaceWith(mask)) + node.parent = null + } + } + } + + // also place its unmet or invalid peer deps at this location + // note that dep has now been removed from the virtualRoot set + // by virtue of being placed in the target's node_modules. + if (virtualRoot) { + const peers = [] + // double loop so that we don't yank things out and then fail to find + // them in the virtualRoot's children. + for (const peerEdge of dep.edgesOut.values()) { + // XXX needs some rework + if (peerEdge.peer && !peerEdge.valid) { + const peer = virtualRoot.children.get(peerEdge.name) /* istanbul ignore next - should be impossible */ || + peerEdge.to + /* istanbul ignore else - should be impossible */ + if (peer) + peers.push([peer, peerEdge]) + } + } + + for (const [peer, peerEdge] of peers) { + const peerPlaced = this[_placeDep]( + peer, dep, peerEdge, peerEntryEdge || edge) + placed.push(...peerPlaced) + } + } + + return placed + } + + [_pruneForReplacement] (node, oldDeps) { + // gather up all the invalid edgesOut, and any now-extraneous + // deps that the new node doesn't depend on but the old one did. + const invalidDeps = new Set([...node.edgesOut.values()] + .filter(e => e.to && !e.valid).map(e => e.to)) + for (const dep of oldDeps) + invalidDeps.add(dep) + + // ignore dependency edges from the node being replaced, but + // otherwise filter the set down to just the set with no + // dependencies from outside the set, except the node in question. + const deps = gatherDepSet(invalidDeps, edge => + edge.from !== node && edge.to !== node) + + // now just delete whatever's left, because it's junk + for (const dep of deps) + dep.parent = null + } + + // check if we can place DEP in TARGET to satisfy EDGE + // Need to verify: + // - no child by that name there already + // - target does not have a peer dep on name + // - no higher-level pkg by that name and incompatible spec is depended on + // by anything lower in the tree. + // - node's peer deps and meta-peer deps are siblings in a virtual root at + // this point. make sure that the whole family can come along, so apply + // the same checks to each of them. They may land higher up in the tree, + // but we need to know that they CAN live here. + // Responses: + // - OK - Yes, because there is nothing there and no conflicts caused + // - REPLACE - Yes, and you can clobber what's there + // - KEEP - No, but what's there is fine + // - CONFLICT - You may not put that there + // + // Check peers on OK or REPLACE. KEEP and CONFLICT do not require peer + // checking, because either we're leaving it alone, or it won't work anyway. + // When we check peers, we pass along the peerEntryEdge to track the + // original edge that caused us to load the family of peer dependencies. + [_canPlaceDep] (dep, target, edge, peerEntryEdge = null) { + // peer deps of root deps are effectively root deps + const isRootDep = target.isRoot && ( + // a direct dependency from the root node + edge.from === target || + // a member of the peer set of a direct root dependency + peerEntryEdge && peerEntryEdge.from === target + ) + + const entryEdge = peerEntryEdge || edge + + // has child by that name already + if (target.children.has(dep.name)) { + const current = target.children.get(dep.name) + // if the integrities match, then it's literally the same exact bytes, + // even if it came from somewhere else. + if (dep.integrity && dep.integrity === current.integrity) + return KEEP + + // we can always place the root's deps in the root nm folder + if (isRootDep) + return this[_canPlacePeers](dep, target, edge, REPLACE, peerEntryEdge) + + // if the version is greater, try to use the new one + const curVer = current.version + const newVer = dep.version + // always try to replace if the version is greater + const tryReplace = curVer && newVer && semver.gte(newVer, curVer) + if (tryReplace && current.canReplaceWith(dep)) + return this[_canPlacePeers](dep, target, edge, REPLACE, peerEntryEdge) + + // ok, see if the current one satisfies the edge we're working on then + if (edge.satisfiedBy(current)) + return KEEP + + // last try, if we prefer deduplication over novelty, check to see if + // this (older) dep can satisfy the needs of the less nested instance + if (this[_preferDedupe] && current.canReplaceWith(dep)) { + const res = this[_canPlacePeers](dep, target, edge, REPLACE, peerEntryEdge) + /* istanbul ignore else - It's extremely rare that a replaceable + * node would be a conflict, if the current one wasn't a conflict, + * but it is theoretically possible if peer deps are pinned. In + * that case we treat it like any other conflict, and keep trying */ + if (res !== CONFLICT) + return res + } + + // if this is a peer dep, AND target is the resolveParent of the edge, + // then this is the only place it can go. If the current node is not + // a non-peer dependency of this specific target, then it can replace + // and dupe it deeper in the tree. If the current node is a peer dep + // in a set that is a non-peer dep of a deeper target, then replace + // the whole peer set and the module bringing it in, and add the + // dependent to the queue for re-evaluation. + if (edge.peer && target === edge.from.resolveParent && !peerEntryEdge) { + const peerSet = getPeerSet(current) + for (const p of peerSet) { + // if any have a non-peer dep from the target, or a peer dep if + // the target is root, then we can't safely replace. + for (const edge of p.edgesIn) { + if (edge.peer) { + // root deps take precedence always. + // in case this is an edge coming from a link it's also + // going to conflict since deps are effectively relative + // to its link node parent + if (edge.from.isTop) + return CONFLICT + + // other peer deps on this node are irrelevant though. + continue + } + // note that we MAY resolve this conflict by using the target's + // conflicting dep on the peer, if --force is set. + if (edge.from === target) + return CONFLICT + } + } + // all peers could be nested deeper in the tree, so replace + // adding to the queue will happen later when we scan dep's edgesIn + return REPLACE + } + + // no agreement could be reached :( + return CONFLICT + } + + // check to see if the target DOESN'T have a child by that name, + // but DOES have a conflicting dependency of its own. no need to check + // if this is the edge we're already looking to resolve! + if (target !== entryEdge.from && target.edgesOut.has(dep.name)) { + const edge = target.edgesOut.get(dep.name) + // It might be that the dep would not be valid here, BUT some other + // version would. Could to try to resolve that, but that makes this no + // longer a pure synchronous function. ugh. + // This is a pretty unlikely scenario in a normal install, because we + // resolve the peer dep set against the parent dependencies, and + // presumably they all worked together SOMEWHERE to get published in the + // first place, and since we resolve shallower deps before deeper ones, + // this can only occur by a child having a peer dep that does not satisfy + // the parent. It can happen if we're doing a deep update limited by + // a specific name, however, or if a dep makes an incompatible change + // to its peer dep in a non-semver-major version bump, or if the parent + // is unbounded in its dependency list. + if (!edge.satisfiedBy(dep)) + return CONFLICT + } + + // check to see what the name resolves to here, and who depends on it + // and if they'd be ok with the new dep being there instead. we know + // at this point that it's not the target's direct child node. this is + // only a check we do when deduping. if it's a direct dep of the target, + // then we just make the invalid edge and resolve it later. + const current = target !== entryEdge.from && target.resolve(dep.name) + if (current) { + for (const edge of current.edgesIn.values()) { + if (edge.from.isDescendantOf(target) && edge.valid) { + if (!edge.satisfiedBy(dep)) + return CONFLICT + } + } + } + + return this[_canPlacePeers](dep, target, edge, OK, peerEntryEdge) + } + + // make sure the family of peer deps can live here alongside it. + // this doesn't guarantee that THIS solution will be the one we take, + // but it does establish that SOME solution exists at this level in + // the tree. + [_canPlacePeers] (dep, target, edge, ret, peerEntryEdge) { + if (!dep.parent || peerEntryEdge) + return ret + + for (const peer of dep.parent.children.values()) { + if (peer !== dep) { + const peerEdge = dep.edgesOut.get(peer.name) || + [...peer.edgesIn].find(e => e.peer) + /* istanbul ignore else - pretty sure this is impossible, but just + being cautious */ + if (peerEdge) { + const canPlacePeer = this[_canPlaceDep](peer, target, peerEdge, edge) + if (canPlacePeer === CONFLICT) { + const current = target.resolve(peer.name) + this[_peerConflict] = { + peer: peer.explain(peerEdge), + current: current && current.explain(), + } + return CONFLICT + } + } + } + } + + return ret + } + + // go through all the links in the this[_linkNodes] set + // for each one: + // - if outside the root, ignore it, assume it's fine, it's not our problem + // - if a node in the tree already, assign the target to that node. + // - if a path under an existing node, then assign that as the fsParent, + // and add it to the _depsQueue + // + // call buildDepStep if anything was added to the queue, otherwise we're done + [_resolveLinks] () { + for (const link of this[_linkNodes]) { + this[_linkNodes].delete(link) + const realpath = link.realpath + const loc = relpath(this.path, realpath) + const fromInv = this.idealTree.inventory.get(loc) + if (fromInv && fromInv !== link.target) + link.target = fromInv + + const external = /^\.\.\//.test(loc) + + if (external && !this[_follow]) { + // outside the root, somebody else's problem, ignore it + continue + } + + if (!link.target.parent && !link.target.fsParent) { + // the fsParent MUST be some node in the tree, possibly the root. + // find it by walking up. Note that this is where its deps may + // end up being installed, if possible. + const parts = loc.split('/') + for (let p = parts.length - 1; p > -1; p--) { + const path = parts.slice(0, p).join('/') + if (!path && external) + break + const node = !path ? this.idealTree + : this.idealTree.inventory.get(path) + if (node) { + link.target.fsParent = node + this.addTracker('idealTree', link.target.name, link.target.location) + this[_depsQueue].push(link.target) + p = -1 + } + } + } + + // didn't find a parent for it, but we're filling in external + // link targets, so go ahead and process it. + if (this[_follow] && !link.target.parent && !link.target.fsParent) { + this.addTracker('idealTree', link.target.name, link.target.location) + this[_depsQueue].push(link.target) + } + } + + if (this[_depsQueue].length) + return this[_buildDepStep]() + } + + [_fixDepFlags] () { + process.emit('time', 'idealTree:fixDepFlags') + const metaFromDisk = this.idealTree.meta.loadedFromDisk + const flagsSuspect = this[_flagsSuspect] + const mutateTree = this[_mutateTree] + // if the options set prune:false, then we don't prune, but we still + // mark the extraneous items in the tree if we modified it at all. + // If we did no modifications, we just iterate over the extraneous nodes. + // if we started with an empty tree, then the dep flags are already + // all set to true, and there can be nothing extraneous, so there's + // nothing to prune, because we built it from scratch. if we didn't + // add or remove anything, then also nothing to do. + if (metaFromDisk && mutateTree) + this[_resetDepFlags]() + + // update all the dev/optional/etc flags in the tree + // either we started with a fresh tree, or we + // reset all the flags to find the extraneous nodes. + // + // if we started from a blank slate, or changed something, then + // the dep flags will be all set to true. + if (!metaFromDisk || mutateTree) + calcDepFlags(this.idealTree) + else { + // otherwise just unset all the flags on the root node + // since they will sometimes have the default value + this.idealTree.extraneous = false + this.idealTree.dev = false + this.idealTree.optional = false + this.idealTree.devOptional = false + this.idealTree.peer = false + } + + // at this point, any node marked as extraneous should be pruned. + // if we started from a shrinkwrap, and then added/removed something, + // then the tree is suspect. Prune what is marked as extraneous. + // otherwise, don't bother. + const needPrune = metaFromDisk && (mutateTree || flagsSuspect) + if (this[_prune] && needPrune) + this[_idealTreePrune]() + process.emit('timeEnd', 'idealTree:fixDepFlags') + } + + [_idealTreePrune] () { + for (const node of this.idealTree.inventory.filter(n => n.extraneous)) + node.parent = null + } + + // we'll need to actually do a walk from the root, because you can have + // a cycle of deps that all depend on each other, but no path from root. + // Also, since the ideal tree is loaded from the shrinkwrap, it had + // extraneous flags set false that might now be actually extraneous, and + // dev/optional flags that are also now incorrect. This method sets + // all flags to true, so we can find the set that is actually extraneous. + [_resetDepFlags] () { + for (const node of this.idealTree.inventory.values()) { + node.extraneous = true + node.dev = true + node.devOptional = true + node.peer = true + node.optional = true + } + } + + [_pruneFailedOptional] () { + for (const node of this[_loadFailures]) { + if (!node.optional) + throw node.errors[0] + const set = optionalSet(node) + for (const node of set) + node.parent = null + } + } +} diff --git a/deps/npm/node_modules/@npmcli/arborist/lib/arborist/deduper.js b/deps/npm/node_modules/@npmcli/arborist/lib/arborist/deduper.js new file mode 100644 index 00000000000000..c78e42e7575d0e --- /dev/null +++ b/deps/npm/node_modules/@npmcli/arborist/lib/arborist/deduper.js @@ -0,0 +1,18 @@ +module.exports = cls => class Deduper extends cls { + async dedupe (options = {}) { + // allow the user to set options on the ctor as well. + // XXX: deprecate separate method options objects. + options = { ...this.options, ...options } + const tree = await this.loadVirtual().catch(() => this.loadActual()) + const names = [] + for (const name of tree.inventory.query('name')) { + if (tree.inventory.query('name', name).size > 1) + names.push(name) + } + return this.reify({ + ...options, + preferDedupe: true, + update: { names }, + }) + } +} diff --git a/deps/npm/node_modules/@npmcli/arborist/lib/arborist/index.js b/deps/npm/node_modules/@npmcli/arborist/lib/arborist/index.js new file mode 100644 index 00000000000000..4c7e96da4ecf39 --- /dev/null +++ b/deps/npm/node_modules/@npmcli/arborist/lib/arborist/index.js @@ -0,0 +1,63 @@ +// The arborist manages three trees: +// - actual +// - virtual +// - ideal +// +// The actual tree is what's present on disk in the node_modules tree +// and elsewhere that links may extend. +// +// The virtual tree is loaded from metadata (package.json and lock files). +// +// The ideal tree is what we WANT that actual tree to become. This starts +// with the virtual tree, and then applies the options requesting +// add/remove/update actions. +// +// To reify a tree, we calculate a diff between the ideal and actual trees, +// and then turn the actual tree into the ideal tree by taking the actions +// required. At the end of the reification process, the actualTree is +// updated to reflect the changes. +// +// Each tree has an Inventory at the root. Shrinkwrap is tracked by Arborist +// instance. It always refers to the actual tree, but is updated (and written +// to disk) on reification. + +// Each of the mixin "classes" adds functionality, but are not dependent on +// constructor call order. So, we just load them in an array, and build up +// the base class, so that the overall voltron class is easier to test and +// cover, and separation of concerns can be maintained. + +const {resolve} = require('path') +const {homedir} = require('os') + +const mixins = [ + require('../tracker.js'), + require('./pruner.js'), + require('./deduper.js'), + require('./audit.js'), + require('./build-ideal-tree.js'), + require('./load-workspaces.js'), + require('./load-actual.js'), + require('./load-virtual.js'), + require('./rebuild.js'), + require('./reify.js'), +] + +const Base = mixins.reduce((a, b) => b(a), require('events')) + +class Arborist extends Base { + constructor (options = {}) { + process.emit('time', 'arborist:ctor') + super(options) + this.options = { + nodeVersion: process.version, + ...options, + path: options.path || '.', + cache: options.cache || `${homedir()}/.npm/_cacache`, + } + this.cache = resolve(this.options.cache) + this.path = resolve(this.options.path) + process.emit('timeEnd', 'arborist:ctor') + } +} + +module.exports = Arborist diff --git a/deps/npm/node_modules/@npmcli/arborist/lib/arborist/load-actual.js b/deps/npm/node_modules/@npmcli/arborist/lib/arborist/load-actual.js new file mode 100644 index 00000000000000..5c440cfc7ce239 --- /dev/null +++ b/deps/npm/node_modules/@npmcli/arborist/lib/arborist/load-actual.js @@ -0,0 +1,388 @@ +// mix-in implementing the loadActual method + +const {relative, dirname, resolve, join} = require('path') + +const rpj = require('read-package-json-fast') +const {promisify} = require('util') +const readdir = promisify(require('readdir-scoped-modules')) +const walkUp = require('walk-up-path') +const ancestorPath = require('common-ancestor-path') + +const Shrinkwrap = require('../shrinkwrap.js') +const calcDepFlags = require('../calc-dep-flags.js') +const Node = require('../node.js') +const Link = require('../link.js') +const realpath = require('../realpath.js') + +const _loadFSNode = Symbol('loadFSNode') +const _newNode = Symbol('newNode') +const _newLink = Symbol('newLink') +const _loadFSTree = Symbol('loadFSTree') +const _loadFSChildren = Symbol('loadFSChildren') +const _findMissingEdges = Symbol('findMissingEdges') +const _findFSParents = Symbol('findFSParents') + +const _actualTreeLoaded = Symbol('actualTreeLoaded') +const _rpcache = Symbol.for('realpathCache') +const _stcache = Symbol.for('statCache') +const _topNodes = Symbol('linkTargets') +const _cache = Symbol('nodeLoadingCache') +const _loadActual = Symbol('loadActual') +const _loadActualVirtually = Symbol('loadActualVirtually') +const _loadActualActually = Symbol('loadActualActually') +const _loadWorkspaces = Symbol.for('loadWorkspaces') +const _actualTreePromise = Symbol('actualTreePromise') +const _actualTree = Symbol('actualTree') +const _transplant = Symbol('transplant') +const _transplantFilter = Symbol('transplantFilter') + +const _filter = Symbol('filter') +const _global = Symbol.for('global') + +module.exports = cls => class ActualLoader extends cls { + constructor (options) { + super(options) + + this[_global] = !!options.global + + // the tree of nodes on disk + this.actualTree = options.actualTree + + // ensure when walking the tree that we don't call loadTree on the + // same actual node more than one time. + this[_actualTreeLoaded] = new Set() + + // caches for cached realpath calls + const cwd = process.cwd() + // assume that the cwd is real enough for our purposes + this[_rpcache] = new Map([[cwd, cwd]]) + this[_stcache] = new Map() + + // cache of nodes when loading the actualTree, so that we avoid + // loaded the same node multiple times when symlinks attack. + this[_cache] = new Map() + + // cache of link targets for setting fsParent links + // We don't do fsParent as a magic getter/setter, because + // it'd be too costly to keep up to date along the walk. + // And, we know that it can ONLY be relevant when the node + // is a target of a link, otherwise it'd be in a node_modules + // folder, so take advantage of that to limit the scans later. + this[_topNodes] = new Set() + } + + // public method + async loadActual (options = {}) { + // allow the user to set options on the ctor as well. + // XXX: deprecate separate method options objects. + options = { ...this.options, ...options } + + // stash the promise so that we don't ever have more than one + // going at the same time. This is so that buildIdealTree can + // default to the actualTree if no shrinkwrap present, but + // reify() can still call buildIdealTree and loadActual in parallel + // safely. + return this.actualTree ? this.actualTree + : this[_actualTreePromise] ? this[_actualTreePromise] + : this[_actualTreePromise] = this[_loadActual](options) + .then(tree => this.actualTree = tree) + } + + async [_loadActual] (options) { + // mostly realpath to throw if the root doesn't exist + const { + global = false, + filter = () => true, + root = null, + transplantFilter = () => true, + ignoreMissing = false, + } = options + this[_filter] = filter + this[_transplantFilter] = transplantFilter + + if (global) { + const real = await realpath(this.path, this[_rpcache], this[_stcache]) + const newNodeOrLink = this.path === real ? _newNode : _newLink + this[_actualTree] = await this[newNodeOrLink]({ + path: this.path, + realpath: real, + pkg: {}, + global, + }) + return this[_loadActualActually]({root, ignoreMissing}) + } + + // not in global mode, hidden lockfile is allowed, load root pkg too + this[_actualTree] = await this[_loadFSNode]({ + path: this.path, + real: await realpath(this.path, this[_rpcache], this[_stcache]), + }) + + // XXX only rely on this if the hidden lockfile is the newest thing? + // need some kind of heuristic, like if the package.json or sw have + // been touched more recently, then ignore it? This is a hazard if + // user switches back and forth between Arborist and another way of + // mutating the node_modules folder. + const meta = await Shrinkwrap.load({ + path: this[_actualTree].path, + hiddenLockfile: true, + }) + if (meta.loadedFromDisk) { + this[_actualTree].meta = meta + meta.add(this[_actualTree]) + return this[_loadActualVirtually]({ root }) + } else { + const meta = await Shrinkwrap.load({ + path: this[_actualTree].path, + }) + this[_actualTree].meta = meta + meta.add(this[_actualTree]) + return this[_loadActualActually]({ root, ignoreMissing }) + } + } + + async [_loadActualVirtually] ({ root }) { + // have to load on a new Arborist object, so we don't assign + // the virtualTree on this one! Also, the weird reference is because + // we can't easily get a ref to Arborist in this module, without + // creating a circular reference, since this class is a mixin used + // to build up the Arborist class itself. + await new this.constructor({...this.options}).loadVirtual({ + root: this[_actualTree], + }) + this[_transplant](root) + return this[_actualTree] + } + + async [_loadActualActually] ({ root, ignoreMissing }) { + await this[_loadFSTree](this[_actualTree]) + if (!ignoreMissing) + await this[_findMissingEdges]() + this[_findFSParents]() + this[_transplant](root) + + await this[_loadWorkspaces](this[_actualTree]) + // only reset root flags if we're not re-rooting, otherwise leave as-is + calcDepFlags(this[_actualTree], !root) + return this[_actualTree] + } + + [_transplant] (root) { + if (!root) + return + // have to set the fsChildren first, because re-rooting a Link + // re-roots the target, but without updating its realpath, so + // we have to re-root the targets first so their location is + // updated appropriately. + for (const node of this[_actualTree].fsChildren) + node.fsParent = root + + for (const node of this[_actualTree].children.values()) { + if (this[_transplantFilter](node)) + node.parent = root + } + this[_actualTree] = root + } + + [_loadFSNode] ({ path, parent, real, root }) { + if (!real) { + return realpath(path, this[_rpcache], this[_stcache]) + .then( + real => this[_loadFSNode]({ path, parent, real, root }), + // if realpath fails, just provide a dummy error node + error => new Node({ error, path, realpath: path, parent, root }) + ) + } + + // cache temporarily holds a promise placeholder so we don't try to create + // the same node multiple times. this is rare to encounter, given the + // aggressive caching on realpath and lstat calls, but it's possible that + // it's already loaded as a tree top, and then gets its parent loaded + // later, if a symlink points deeper in the tree. + const cached = this[_cache].get(path) + if (cached && !cached.dummy) { + return Promise.resolve(cached).then(node => { + node.parent = parent + return node + }) + } + + const p = rpj(join(real, 'package.json')) + // soldier on if read-package-json raises an error + .then(pkg => [pkg, null], error => [null, error]) + .then(([pkg, error]) => { + return this[path === real ? _newNode : _newLink]({ + legacyPeerDeps: this.legacyPeerDeps, + path, + realpath: real, + pkg, + error, + parent, + root, + }) + }) + .then(node => { + this[_cache].set(path, node) + return node + }) + + this[_cache].set(path, p) + return p + } + + // this is the way it is to expose a timing issue which is difficult to + // test otherwise. The creation of a Node may take slightly longer than + // the creation of a Link that targets it. If the Node has _begun_ its + // creation phase (and put a Promise in the cache) then the Link will + // get a Promise as its cachedTarget instead of an actual Node object. + // This is not a problem, because it gets resolved prior to returning + // the tree or attempting to load children. However, it IS remarkably + // difficult to get to happen in a test environment to verify reliably. + // Hence this kludge. + [_newNode] (options) { + // check it for an fsParent if it's a tree top. there's a decent chance + // it'll get parented later, making the fsParent scan a no-op, but better + // safe than sorry, since it's cheap. + const { parent, realpath } = options + if (!parent) + this[_topNodes].add(realpath) + return process.env._TEST_ARBORIST_SLOW_LINK_TARGET_ === '1' + ? new Promise(res => setTimeout(() => res(new Node(options)), 100)) + : new Node(options) + } + + [_newLink] (options) { + const { realpath } = options + this[_topNodes].add(realpath) + const target = this[_cache].get(realpath) + const link = new Link({ ...options, target }) + + if (!target) { + this[_cache].set(realpath, link.target) + // if a link target points at a node outside of the root tree's + // node_modules hierarchy, then load that node as well. + return this[_loadFSTree](link.target).then(() => link) + } else if (target.then) + target.then(node => link.target = node) + + return link + } + + [_loadFSTree] (node) { + const did = this[_actualTreeLoaded] + node = node.target || node + + // if a Link target has started, but not completed, then + // a Promise will be in the cache to indicate this. + if (node.then) + return node.then(node => this[_loadFSTree](node)) + + // impossible except in pathological ELOOP cases + /* istanbul ignore if */ + if (did.has(node.realpath)) + return Promise.resolve(node) + + did.add(node.realpath) + return this[_loadFSChildren](node) + .then(() => Promise.all( + [...node.children.entries()] + .filter(([name, kid]) => !did.has(kid.realpath)) + .map(([name, kid]) => this[_loadFSTree](kid)))) + } + + // create child nodes for all the entries in node_modules + // and attach them to the node as a parent + [_loadFSChildren] (node) { + const nm = resolve(node.realpath, 'node_modules') + return readdir(nm).then(kids => { + return Promise.all( + // ignore . dirs and retired scoped package folders + kids.filter(kid => !/^(@[^/]+\/)?\./.test(kid)) + .filter(kid => this[_filter](node, kid)) + .map(kid => this[_loadFSNode]({ + parent: node, + path: resolve(nm, kid), + }))) + }, + // error in the readdir is not fatal, just means no kids + () => {}) + } + + async [_findMissingEdges] () { + // try to resolve any missing edges by walking up the directory tree, + // checking for the package in each node_modules folder. stop at the + // root directory. + // The tricky move here is that we load a "dummy" node for the folder + // containing the node_modules folder, so that it can be assigned as + // the fsParent. It's a bad idea to *actually* load that full node, + // because people sometimes develop in ~/projects/node_modules/... + // so we'd end up loading a massive tree with lots of unrelated junk. + const nmContents = new Map() + const tree = this[_actualTree] + for (const node of tree.inventory.values()) { + const ancestor = ancestorPath(node.realpath, this.path) + + const depPromises = [] + for (const [name, edge] of node.edgesOut.entries()) { + if (!edge.missing && !(edge.to && edge.to.dummy)) + continue + + // start the walk from the dirname, because we would have found + // the dep in the loadFSTree step already if it was local. + for (const p of walkUp(dirname(node.realpath))) { + // only walk as far as the nearest ancestor + // this keeps us from going into completely unrelated + // places when a project is just missing something, but + // allows for finding the transitive deps of link targets. + // ie, if it has to go up and back out to get to the path + // from the nearest common ancestor, we've gone too far. + if (ancestor && /^\.\.(?:[\\/]|$)/.test(relative(ancestor, p))) + break + + const entries = nmContents.get(p) || + await readdir(p + '/node_modules').catch(() => []) + nmContents.set(p, entries) + if (!entries.includes(name)) + continue + + const d = this[_cache].has(p) ? await this[_cache].get(p) + : new Node({ path: p, root: node.root, dummy: true }) + this[_cache].set(p, d) + if (d.dummy) { + // it's a placeholder, so likely would not have loaded this dep, + // unless another dep in the tree also needs it. + const depPath = `${p}/node_modules/${name}` + const cached = this[_cache].get(depPath) + if (!cached || cached.dummy) { + depPromises.push(this[_loadFSNode]({ + path: depPath, + root: node.root, + parent: d, + }).then(node => this[_loadFSTree](node))) + } + } + break + } + } + await Promise.all(depPromises) + } + } + + // try to find a node that is the parent in a fs tree sense, but not a + // node_modules tree sense, of any link targets. this allows us to + // resolve deps that node will find, but a legacy npm view of the + // world would not have noticed. + [_findFSParents] () { + for (const path of this[_topNodes]) { + const node = this[_cache].get(path) + if (node && !node.parent && !node.fsParent) { + for (const p of walkUp(dirname(path))) { + if (this[_cache].has(p)) { + node.fsParent = this[_cache].get(p) + break + } + } + } + } + } +} diff --git a/deps/npm/node_modules/@npmcli/arborist/lib/arborist/load-virtual.js b/deps/npm/node_modules/@npmcli/arborist/lib/arborist/load-virtual.js new file mode 100644 index 00000000000000..7d0572826fc809 --- /dev/null +++ b/deps/npm/node_modules/@npmcli/arborist/lib/arborist/load-virtual.js @@ -0,0 +1,289 @@ +// mixin providing the loadVirtual method + +const {dirname, resolve} = require('path') +const walkUp = require('walk-up-path') + +const nameFromFolder = require('@npmcli/name-from-folder') +const consistentResolve = require('../consistent-resolve.js') +const Shrinkwrap = require('../shrinkwrap.js') +const Node = require('../node.js') +const Link = require('../link.js') +const relpath = require('../relpath.js') +const calcDepFlags = require('../calc-dep-flags.js') +const rpj = require('read-package-json-fast') + +const loadFromShrinkwrap = Symbol('loadFromShrinkwrap') +const resolveNodes = Symbol('resolveNodes') +const resolveLinks = Symbol('resolveLinks') +const assignParentage = Symbol('assignParentage') +const loadRoot = Symbol('loadRoot') +const loadNode = Symbol('loadVirtualNode') +const loadLink = Symbol('loadVirtualLink') +const loadWorkspaces = Symbol.for('loadWorkspaces') +const loadWorkspacesVirtual = Symbol.for('loadWorkspacesVirtual') +const flagsSuspect = Symbol.for('flagsSuspect') +const reCalcDepFlags = Symbol('reCalcDepFlags') +const checkRootEdges = Symbol('checkRootEdges') + +const depsToEdges = (type, deps) => + Object.entries(deps).map(d => [type, ...d]) + +module.exports = cls => class VirtualLoader extends cls { + constructor (options) { + super(options) + + // the virtual tree we load from a shrinkwrap + this.virtualTree = options.virtualTree + this[flagsSuspect] = false + } + + // public method + async loadVirtual (options = {}) { + if (this.virtualTree) + return Promise.resolve(this.virtualTree) + + // allow the user to set reify options on the ctor as well. + // XXX: deprecate separate reify() options object. + options = { ...this.options, ...options } + + if (options.root && options.root.meta) + return this[loadFromShrinkwrap](options.root.meta, options.root) + + const s = await Shrinkwrap.load({ path: this.path }) + if (!s.loadedFromDisk && !options.root) { + const er = new Error('loadVirtual requires existing shrinkwrap file') + throw Object.assign(er, { code: 'ENOLOCK' }) + } + + // when building the ideal tree, we pass in a root node to this function + // otherwise, load it from the root package json or the lockfile + const { + root = await this[loadRoot](s), + } = options + + return this[loadFromShrinkwrap](s, root) + } + + async [loadRoot] (s) { + const pj = this.path + '/package.json' + const pkg = await rpj(pj).catch(() => s.data.packages['']) || {} + return this[loadWorkspaces](this[loadNode]('', pkg)) + } + + async [loadFromShrinkwrap] (s, root) { + root.meta = s + // root is never any of these things, but might be a brand new + // baby Node object that never had its dep flags calculated. + root.extraneous = false + root.dev = false + root.optional = false + root.devOptional = false + root.peer = false + this[checkRootEdges](s, root) + s.add(root) + this.virtualTree = root + const {links, nodes} = this[resolveNodes](s, root) + await this[resolveLinks](links, nodes) + this[assignParentage](nodes) + if (this[flagsSuspect]) + this[reCalcDepFlags]() + return root + } + + [reCalcDepFlags] () { + // reset all dep flags + for (const node of this.virtualTree.inventory.values()) { + node.extraneous = true + node.dev = true + node.optional = true + node.devOptional = true + node.peer = true + } + calcDepFlags(this.virtualTree, true) + } + + // check the lockfile deps, and see if they match. if they do not + // then we have to reset dep flags at the end. for example, if the + // user manually edits their package.json file, then we need to know + // that the idealTree is no longer entirely trustworthy. + [checkRootEdges] (s, root) { + // loaded virtually from tree, no chance of being out of sync + // ancient lockfiles are critically damaged by this process, + // so we need to just hope for the best in those cases. + if (!s.loadedFromDisk || s.ancientLockfile) + return + + const lock = s.get('') + const prod = lock.dependencies || {} + const dev = lock.devDependencies || {} + const optional = lock.optionalDependencies || {} + const peer = lock.peerDependencies || {} + const peerOptional = {} + if (lock.peerDependenciesMeta) { + for (const [name, meta] of Object.entries(lock.peerDependenciesMeta)) { + if (meta.optional && peer[name] !== undefined) { + peerOptional[name] = peer[name] + delete peer[name] + } + } + } + for (const name of Object.keys(optional)) + delete prod[name] + + const lockWS = [] + const workspaces = this[loadWorkspacesVirtual]({ + cwd: this.path, + lockfile: s.data, + }) + for (const [name, path] of workspaces.entries()) + lockWS.push(['workspace', name, `file:${path}`]) + + const lockEdges = [ + ...depsToEdges('prod', prod), + ...depsToEdges('dev', dev), + ...depsToEdges('optional', optional), + ...depsToEdges('peer', peer), + ...depsToEdges('peerOptional', peerOptional), + ...lockWS, + ].sort(([atype, aname], [btype, bname]) => + atype.localeCompare(btype) || aname.localeCompare(bname)) + + const rootEdges = [...root.edgesOut.values()] + .map(e => [e.type, e.name, e.spec]) + .sort(([atype, aname], [btype, bname]) => + atype.localeCompare(btype) || aname.localeCompare(bname)) + + if (rootEdges.length !== lockEdges.length) { + // something added or removed + return this[flagsSuspect] = true + } + + for (let i = 0; i < lockEdges.length; i++) { + if (rootEdges[i][0] !== lockEdges[i][0] || + rootEdges[i][1] !== lockEdges[i][1] || + rootEdges[i][2] !== lockEdges[i][2]) + return this[flagsSuspect] = true + } + } + + // separate out link metadatas, and create Node objects for nodes + [resolveNodes] (s, root) { + const links = new Map() + const nodes = new Map([['', root]]) + for (const [location, meta] of Object.entries(s.data.packages)) { + // skip the root because we already got it + if (!location) + continue + + if (meta.link) + links.set(location, meta) + else + nodes.set(location, this[loadNode](location, meta)) + } + return {links, nodes} + } + + // links is the set of metadata, and nodes is the map of non-Link nodes + // Set the targets to nodes in the set, if we have them (we might not) + async [resolveLinks] (links, nodes) { + // now we've loaded the root, and all real nodes + // link up the links + const {meta} = this.virtualTree + const {loadedFromDisk, originalLockfileVersion} = meta + const oldLockfile = loadedFromDisk && !(originalLockfileVersion >= 2) + + for (const [location, meta] of links.entries()) { + const targetPath = resolve(this.path, meta.resolved) + const targetLoc = relpath(this.path, targetPath) + const target = nodes.get(targetLoc) + const link = this[loadLink](location, targetLoc, target, meta) + nodes.set(location, link) + nodes.set(targetLoc, link.target) + // legacy shrinkwraps do not store all the info we need for the target. + // if we're loading from disk, and have a link in place, we need to + // look in that actual folder (or at least try to) in order to get + // the dependencies of the link target and load it properly. + if (oldLockfile) { + const pj = link.realpath + '/package.json' + const pkg = await rpj(pj).catch(() => null) + if (pkg) + link.target.package = pkg + } + } + } + + [assignParentage] (nodes) { + for (const [location, node] of nodes) { + const { path, name } = node + for (const p of walkUp(dirname(path))) { + const ploc = relpath(this.path, p) + const parent = nodes.get(ploc) + if (!parent) + continue + + const locTest = `${ploc}/node_modules/${name}`.replace(/^\//, '') + const ptype = location === locTest + ? 'parent' + : 'fsParent' + node[ptype] = parent + // read inBundle from package because 'package' here is + // actually a v2 lockfile metadata entry. + // If the *parent* is also bundled, though, then we assume + // that it's being pulled in just by virtue of that. + const {inBundle} = node.package + const ppkg = parent.package + const {inBundle: parentBundled} = ppkg + const hasEdge = parent.edgesOut.has(name) + if (ptype === 'parent' && inBundle && hasEdge && !parentBundled) { + if (!ppkg.bundleDependencies) + ppkg.bundleDependencies = [name] + else if (!ppkg.bundleDependencies.includes(name)) + ppkg.bundleDependencies.push(name) + } + + break + } + } + } + + [loadNode] (location, sw) { + const path = resolve(this.path, location) + // shrinkwrap doesn't include package name unless necessary + if (!sw.name) + sw.name = nameFromFolder(path) + const node = new Node({ + legacyPeerDeps: this.legacyPeerDeps, + root: this.virtualTree, + path, + realpath: path, + integrity: sw.integrity, + resolved: consistentResolve(sw.resolved, this.path, path), + pkg: sw, + hasShrinkwrap: sw.hasShrinkwrap, + }) + // cast to boolean because they're undefined in the lock file when false + node.extraneous = !!sw.extraneous + node.devOptional = !!(sw.devOptional || sw.dev || sw.optional) + node.peer = !!sw.peer + node.optional = !!sw.optional + node.dev = !!sw.dev + return node + } + + [loadLink] (location, targetLoc, target, meta) { + const path = resolve(this.path, location) + const link = new Link({ + legacyPeerDeps: this.legacyPeerDeps, + path, + realpath: resolve(this.path, targetLoc), + target, + pkg: target && target.package, + }) + link.extraneous = target.extraneous + link.devOptional = target.devOptional + link.peer = target.peer + link.optional = target.optional + link.dev = target.dev + return link + } +} diff --git a/deps/npm/node_modules/@npmcli/arborist/lib/arborist/load-workspaces.js b/deps/npm/node_modules/@npmcli/arborist/lib/arborist/load-workspaces.js new file mode 100644 index 00000000000000..93d078415f5851 --- /dev/null +++ b/deps/npm/node_modules/@npmcli/arborist/lib/arborist/load-workspaces.js @@ -0,0 +1,31 @@ +const mapWorkspaces = require('@npmcli/map-workspaces') + +const _appendWorkspaces = Symbol('appendWorkspaces') +// shared ref used by other mixins/Arborist +const _loadWorkspaces = Symbol.for('loadWorkspaces') +const _loadWorkspacesVirtual = Symbol.for('loadWorkspacesVirtual') + +module.exports = cls => class MapWorkspaces extends cls { + [_appendWorkspaces] (node, workspaces) { + if (node && workspaces.size) + node.workspaces = workspaces + + return node + } + + async [_loadWorkspaces] (node) { + if (node.workspaces) + return node + + const workspaces = await mapWorkspaces({ + cwd: node.path, + pkg: node.package, + }) + + return this[_appendWorkspaces](node, workspaces) + } + + [_loadWorkspacesVirtual] (opts) { + return mapWorkspaces.virtual(opts) + } +} diff --git a/deps/npm/node_modules/@npmcli/arborist/lib/arborist/pruner.js b/deps/npm/node_modules/@npmcli/arborist/lib/arborist/pruner.js new file mode 100644 index 00000000000000..3e9d4f1bf66b0f --- /dev/null +++ b/deps/npm/node_modules/@npmcli/arborist/lib/arborist/pruner.js @@ -0,0 +1,15 @@ +const _idealTreePrune = Symbol.for('idealTreePrune') + +module.exports = cls => class Pruner extends cls { + async prune (options = {}) { + // allow the user to set options on the ctor as well. + // XXX: deprecate separate method options objects. + options = { ...this.options, ...options } + + await this.buildIdealTree(options) + + this[_idealTreePrune]() + + return this.reify(options) + } +} diff --git a/deps/npm/node_modules/@npmcli/arborist/lib/arborist/rebuild.js b/deps/npm/node_modules/@npmcli/arborist/lib/arborist/rebuild.js new file mode 100644 index 00000000000000..b610045c0655ec --- /dev/null +++ b/deps/npm/node_modules/@npmcli/arborist/lib/arborist/rebuild.js @@ -0,0 +1,293 @@ +// Arborist.rebuild({path = this.path}) will do all the binlinks and +// bundle building needed. Called by reify, and by `npm rebuild`. + +const {depth: dfwalk} = require('treeverse') +const promiseAllRejectLate = require('promise-all-reject-late') +const rpj = require('read-package-json-fast') +const binLinks = require('bin-links') +const runScript = require('@npmcli/run-script') +const promiseCallLimit = require('promise-call-limit') +const {resolve} = require('path') +const { + isNodeGypPackage, + defaultGypInstallScript, +} = require('@npmcli/node-gyp') + +const boolEnv = b => b ? '1' : '' +const sortNodes = (a, b) => (a.depth - b.depth) || a.path.localeCompare(b.path) + +const _rebuildBundle = Symbol('rebuildBundle') +const _ignoreScripts = Symbol('ignoreScripts') +const _binLinks = Symbol('binLinks') +const _oldMeta = Symbol('oldMeta') +const _createBinLinks = Symbol('createBinLinks') +const _doHandleOptionalFailure = Symbol('doHandleOptionalFailure') +const _linkAllBins = Symbol('linkAllBins') +const _runScripts = Symbol('runScripts') +const _buildQueues = Symbol('buildQueues') +const _addToBuildSet = Symbol('addToBuildSet') +const _checkBins = Symbol.for('checkBins') +const _queues = Symbol('queues') +const _scriptShell = Symbol('scriptShell') + +const _force = Symbol.for('force') + +// defined by reify mixin +const _handleOptionalFailure = Symbol.for('handleOptionalFailure') +const _trashList = Symbol.for('trashList') + +module.exports = cls => class Builder extends cls { + constructor (options) { + super(options) + + const { + ignoreScripts = false, + scriptShell, + binLinks = true, + rebuildBundle = true, + } = options + + this[_binLinks] = binLinks + this[_ignoreScripts] = !!ignoreScripts + this[_scriptShell] = scriptShell + this[_rebuildBundle] = !!rebuildBundle + this[_queues] = { + preinstall: [], + install: [], + postinstall: [], + bin: [], + } + this[_oldMeta] = null + } + + async rebuild ({ nodes, handleOptionalFailure = false } = {}) { + // nothing to do if we're not building anything! + if (this[_ignoreScripts] && !this[_binLinks]) + return + + // when building for the first time, as part of reify, we ignore + // failures in optional nodes, and just delete them. however, when + // running JUST a rebuild, we treat optional failures as real fails + this[_doHandleOptionalFailure] = handleOptionalFailure + + // if we don't have a set of nodes, then just rebuild + // the actual tree on disk. + if (!nodes) + nodes = (await this.loadActual()).inventory.values() + + process.emit('time', 'build') + + await this[_buildQueues](nodes) + if (!this[_ignoreScripts]) + await this[_runScripts]('preinstall') + if (this[_binLinks]) + await this[_linkAllBins]() + if (!this[_ignoreScripts]) { + await this[_runScripts]('install') + await this[_runScripts]('postinstall') + } + + process.emit('timeEnd', 'build') + } + + async [_buildQueues] (nodes) { + process.emit('time', 'build:queue') + const set = new Set() + + const promises = [] + for (const node of nodes) { + promises.push(this[_addToBuildSet](node, set)) + + // if it has bundle deps, add those too, if rebuildBundle + if (this[_rebuildBundle] !== false) { + const bd = node.package.bundleDependencies + if (bd && bd.length) { + dfwalk({ + tree: node, + leave: node => promises.push(this[_addToBuildSet](node, set)), + getChildren: node => [...node.children.values()], + filter: node => node.inBundle, + }) + } + } + } + await promiseAllRejectLate(promises) + + // now sort into the queues for the 4 things we have to do + // run in the same predictable order that buildIdealTree uses + // there's no particular reason for doing it in this order rather + // than another, but sorting *somehow* makes it consistent. + const queue = [...set].sort(sortNodes) + + for (const node of queue) { + const { package: { bin, scripts = {} } } = node + const { preinstall, install, postinstall } = scripts + const tests = { bin, preinstall, install, postinstall } + for (const [key, has] of Object.entries(tests)) { + if (has) + this[_queues][key].push(node) + } + } + process.emit('timeEnd', 'build:queue') + } + + async [_checkBins] (node) { + // if the node is a global top, and we're not in force mode, then + // any existing bins need to either be missing, or a symlink into + // the node path. Otherwise a package can have a preinstall script + // that unlinks something, to allow them to silently overwrite system + // binaries, which is unsafe and insecure. + if (!node.globalTop || this[_force]) + return + const { path, package: pkg } = node + await binLinks.checkBins({ pkg, path, top: true, global: true }) + } + + async [_addToBuildSet] (node, set, refreshed = false) { + if (set.has(node)) + return + + if (this[_oldMeta] === null) { + const {root: {meta}} = node + this[_oldMeta] = meta && meta.loadedFromDisk && + !(meta.originalLockfileVersion >= 2) + } + + const { package: pkg, hasInstallScript } = node + const { gypfile, bin, scripts = {} } = pkg + + const { preinstall, install, postinstall } = scripts + const anyScript = preinstall || install || postinstall + if (!refreshed && !anyScript && (hasInstallScript || this[_oldMeta])) { + // we either have an old metadata (and thus might have scripts) + // or we have an indication that there's install scripts (but + // don't yet know what they are) so we have to load the package.json + // from disk to see what the deal is. Failure here just means + // no scripts to add, probably borked package.json. + // add to the set then remove while we're reading the pj, so we + // don't accidentally hit it multiple times. + set.add(node) + const pkg = await rpj(node.path + '/package.json').catch(() => ({})) + set.delete(node) + + const {scripts = {}} = pkg + node.package.scripts = scripts + return this[_addToBuildSet](node, set, true) + } + + // Rebuild node-gyp dependencies lacking an install or preinstall script + // note that 'scripts' might be missing entirely, and the package may + // set gypfile:false to avoid this automatic detection. + const isGyp = gypfile !== false && + !install && + !preinstall && + await isNodeGypPackage(node.path) + + if (bin || preinstall || install || postinstall || isGyp) { + if (bin) + await this[_checkBins](node) + if (isGyp) { + scripts.install = defaultGypInstallScript + node.package.scripts = scripts + } + set.add(node) + } + } + + async [_runScripts] (event) { + const queue = this[_queues][event] + + if (!queue.length) + return + + process.emit('time', `build:run:${event}`) + await promiseCallLimit(queue.map(node => async () => { + const { + path, + integrity, + resolved, + optional, + peer, + dev, + devOptional, + package: pkg, + location, + } = node + + // skip any that we know we'll be deleting + if (this[_trashList].has(path)) + return + + const timer = `build:run:${event}:${location}` + process.emit('time', timer) + this.log.info('run', pkg._id, event, location, pkg.scripts[event]) + const p = runScript({ + event, + path, + pkg, + stdioString: true, + env: { + npm_package_resolved: resolved, + npm_package_integrity: integrity, + npm_package_json: resolve(path, 'package.json'), + npm_package_optional: boolEnv(optional), + npm_package_dev: boolEnv(dev), + npm_package_peer: boolEnv(peer), + npm_package_dev_optional: + boolEnv(devOptional && !dev && !optional), + }, + scriptShell: this[_scriptShell], + }).catch(er => { + const { code, signal } = er + this.log.info('run', pkg._id, event, {code, signal}) + throw er + }).then(({code, signal}) => { + this.log.info('run', pkg._id, event, {code, signal}) + }) + + await (this[_doHandleOptionalFailure] + ? this[_handleOptionalFailure](node, p) + : p) + + process.emit('timeEnd', timer) + })) + process.emit('timeEnd', `build:run:${event}`) + } + + async [_linkAllBins] () { + const queue = this[_queues].bin + if (!queue.length) + return + + process.emit('time', 'build:link') + const promises = [] + // sort the queue by node path, so that the module-local collision + // detector in bin-links will always resolve the same way. + for (const node of queue.sort(sortNodes)) + promises.push(this[_createBinLinks](node)) + + await promiseAllRejectLate(promises) + process.emit('timeEnd', 'build:link') + } + + async [_createBinLinks] (node) { + if (this[_trashList].has(node.path)) + return + + process.emit('time', `build:link:${node.location}`) + + const p = binLinks({ + pkg: node.package, + path: node.path, + top: !!(node.isTop || node.globalTop), + force: this[_force], + global: !!node.globalTop, + }) + + await (this[_doHandleOptionalFailure] + ? this[_handleOptionalFailure](node, p) + : p) + + process.emit('timeEnd', `build:link:${node.location}`) + } +} diff --git a/deps/npm/node_modules/@npmcli/arborist/lib/arborist/reify.js b/deps/npm/node_modules/@npmcli/arborist/lib/arborist/reify.js new file mode 100644 index 00000000000000..8fe88edb8f7221 --- /dev/null +++ b/deps/npm/node_modules/@npmcli/arborist/lib/arborist/reify.js @@ -0,0 +1,864 @@ +// mixin implementing the reify method + +const pacote = require('pacote') +const rpj = require('read-package-json-fast') +const { orderDeps, updateDepSpec } = require('../dep-spec.js') +const AuditReport = require('../audit-report.js') +const {subset} = require('semver') + +const {dirname, resolve, relative} = require('path') +const {depth: dfwalk} = require('treeverse') +const fs = require('fs') +const {promisify} = require('util') +const rename = promisify(fs.rename) +const symlink = promisify(fs.symlink) +const writeFile = promisify(fs.writeFile) +const mkdirp = require('mkdirp-infer-owner') +const rimraf = promisify(require('rimraf')) +const packageContents = require('@npmcli/installed-package-contents') + +const relpath = require('../relpath.js') +const Diff = require('../diff.js') +const retirePath = require('../retire-path.js') +const promiseAllRejectLate = require('promise-all-reject-late') +const optionalSet = require('../optional-set.js') + +const _retiredPaths = Symbol('retiredPaths') +const _retiredUnchanged = Symbol('retiredUnchanged') +const _sparseTreeDirs = Symbol('sparseTreeDirs') +const _savePrefix = Symbol('savePrefix') +const _retireShallowNodes = Symbol('retireShallowNodes') +const _getBundlesByDepth = Symbol('getBundlesByDepth') +const _registryResolved = Symbol('registryResolved') +const _addNodeToTrashList = Symbol('addNodeToTrashList') +// shared by rebuild mixin +const _trashList = Symbol.for('trashList') +const _handleOptionalFailure = Symbol.for('handleOptionalFailure') +const _loadTrees = Symbol.for('loadTrees') + +// shared symbols for swapping out when testing +const _diffTrees = Symbol.for('diffTrees') +const _createSparseTree = Symbol.for('createSparseTree') +const _loadShrinkwrapsAndUpdateTrees = Symbol.for('loadShrinkwrapsAndUpdateTrees') +const _reifyNode = Symbol.for('reifyNode') +const _extractOrLink = Symbol('extractOrLink') +// defined by rebuild mixin +const _checkBins = Symbol.for('checkBins') +const _symlink = Symbol('symlink') +const _warnDeprecated = Symbol('warnDeprecated') +const _loadAncientPackageDetails = Symbol('loadAncientPackageDetails') +const _loadBundlesAndUpdateTrees = Symbol.for('loadBundlesAndUpdateTrees') +const _submitQuickAudit = Symbol('submitQuickAudit') +const _awaitQuickAudit = Symbol('awaitQuickAudit') +const _unpackNewModules = Symbol.for('unpackNewModules') +const _moveContents = Symbol.for('moveContents') +const _moveBackRetiredUnchanged = Symbol.for('moveBackRetiredUnchanged') +const _build = Symbol('build') +const _removeTrash = Symbol.for('removeTrash') +const _renamePath = Symbol.for('renamePath') +const _rollbackRetireShallowNodes = Symbol.for('rollbackRetireShallowNodes') +const _rollbackCreateSparseTree = Symbol.for('rollbackCreateSparseTree') +const _rollbackMoveBackRetiredUnchanged = Symbol.for('rollbackMoveBackRetiredUnchanged') +const _saveIdealTree = Symbol.for('saveIdealTree') +const _copyIdealToActual = Symbol('copyIdealToActual') +const _addOmitsToTrashList = Symbol('addOmitsToTrashList') +const _packageLockOnly = Symbol('packageLockOnly') +const _dryRun = Symbol('dryRun') +const _reifyPackages = Symbol('reifyPackages') + +const _omitDev = Symbol('omitDev') +const _omitOptional = Symbol('omitOptional') +const _omitPeer = Symbol('omitPeer') + +const _global = Symbol.for('global') + +// defined by Ideal mixin +const _pruneBundledMetadeps = Symbol.for('pruneBundledMetadeps') +const _explicitRequests = Symbol.for('explicitRequests') +const _resolvedAdd = Symbol.for('resolvedAdd') +const _usePackageLock = Symbol.for('usePackageLock') +const _formatPackageLock = Symbol.for('formatPackageLock') + +module.exports = cls => class Reifier extends cls { + constructor (options) { + super(options) + + const { + savePrefix = '^', + packageLockOnly = false, + dryRun = false, + formatPackageLock = true, + } = options + + this[_dryRun] = !!dryRun + this[_packageLockOnly] = !!packageLockOnly + this[_savePrefix] = savePrefix + this[_formatPackageLock] = !!formatPackageLock + + this.diff = null + this[_retiredPaths] = {} + this[_retiredUnchanged] = {} + this[_sparseTreeDirs] = new Set() + this[_trashList] = new Set() + } + + // public method + async reify (options = {}) { + if (this[_packageLockOnly] && this[_global]) { + const er = new Error('cannot generate lockfile for global packages') + er.code = 'ESHRINKWRAPGLOBAL' + throw er + } + + const omit = new Set(options.omit || []) + this[_omitDev] = omit.has('dev') + this[_omitOptional] = omit.has('optional') + this[_omitPeer] = omit.has('peer') + + // start tracker block + this.addTracker('reify') + process.emit('time', 'reify') + await this[_loadTrees](options) + .then(() => this[_diffTrees]()) + .then(() => this[_reifyPackages]()) + .then(() => this[_saveIdealTree](options)) + .then(() => this[_copyIdealToActual]()) + .then(() => this[_awaitQuickAudit]()) + + this.finishTracker('reify') + process.emit('timeEnd', 'reify') + return this.actualTree + } + + async [_reifyPackages] () { + // we don't submit the audit report or write to disk on dry runs + if (this[_dryRun]) + return + + if (this[_packageLockOnly]) { + // we already have the complete tree, so just audit it now, + // and that's all we have to do here. + return this[_submitQuickAudit]() + } + + await this[_retireShallowNodes]() + await this[_createSparseTree]() + await this[_addOmitsToTrashList]() + await this[_loadShrinkwrapsAndUpdateTrees]() + await this[_loadBundlesAndUpdateTrees]() + await this[_submitQuickAudit]() + await this[_unpackNewModules]() + await this[_moveBackRetiredUnchanged]() + await this[_build]() + await this[_removeTrash]() + } + + // when doing a local install, we load everything and figure it all out. + // when doing a global install, we *only* care about the explicit requests. + [_loadTrees] (options) { + process.emit('time', 'reify:loadTrees') + const bitOpt = { + ...options, + complete: this[_packageLockOnly] || this[_dryRun], + } + + // if we're only writing a package lock, then it doesn't matter what's here + if (this[_packageLockOnly]) { + return this.buildIdealTree(bitOpt) + .then(() => process.emit('timeEnd', 'reify:loadTrees')) + } + + const actualOpt = this[_global] ? { + ignoreMissing: true, + global: true, + filter: (node, kid) => !node.isRoot ? true + : this[_explicitRequests].has(kid), + } : { ignoreMissing: true } + + if (!this[_global]) { + return Promise.all([this.loadActual(actualOpt), this.buildIdealTree(bitOpt)]) + .then(() => process.emit('timeEnd', 'reify:loadTrees')) + } + + // the global install space tends to have a lot of stuff in it. don't + // load all of it, just what we care about. we won't be saving a + // hidden lockfile in there anyway. + return this.buildIdealTree(bitOpt) + .then(() => this.loadActual(actualOpt)) + .then(() => process.emit('timeEnd', 'reify:loadTrees')) + } + + [_diffTrees] () { + if (this[_packageLockOnly]) + return + + process.emit('time', 'reify:diffTrees') + // XXX if we have an existing diff already, there should be a way + // to just invalidate the parts that changed, but avoid walking the + // whole tree again. + + // find all the nodes that need to change between the actual + // and ideal trees. + this.diff = Diff.calculate({ + actual: this.actualTree, + ideal: this.idealTree, + }) + + for (const node of this.diff.removed) { + // a node in a dep bundle will only be removed if its bundling dep + // is removed as well. in which case, we don't have to delete it! + if (!node.inDepBundle) + this[_addNodeToTrashList](node) + } + process.emit('timeEnd', 'reify:diffTrees') + } + + // add the node and all its bins to the list of things to be + // removed later on in the process. optionally, also mark them + // as a retired paths, so that we move them out of the way and + // replace them when rolling back on failure. + [_addNodeToTrashList] (node, retire) { + const paths = [node.path, ...node.binPaths] + const moves = this[_retiredPaths] + this.log.silly('reify', 'mark', retire ? 'retired' : 'deleted', paths) + for (const path of paths) { + if (retire) { + const retired = retirePath(path) + moves[path] = retired + this[_trashList].add(retired) + } else + this[_trashList].add(path) + } + } + + // move aside the shallowest nodes in the tree that have to be + // changed or removed, so that we can rollback if necessary. + [_retireShallowNodes] () { + process.emit('time', 'reify:retireShallow') + const moves = this[_retiredPaths] = {} + for (const diff of this.diff.children) { + if (diff.action === 'CHANGE' || diff.action === 'REMOVE') { + // we'll have to clean these up at the end, so add them to the list + this[_addNodeToTrashList](diff.actual, true) + } + } + this.log.silly('reify', 'moves', moves) + const movePromises = Object.entries(moves) + .map(([from, to]) => this[_renamePath](from, to)) + return promiseAllRejectLate(movePromises) + .catch(er => this[_rollbackRetireShallowNodes](er)) + .then(() => process.emit('timeEnd', 'reify:retireShallow')) + } + + [_renamePath] (from, to, didMkdirp = false) { + return rename(from, to) + .catch(er => { + // Occasionally an expected bin file might not exist in the package, + // or a shim/symlink might have been moved aside. If we've already + // handled the most common cause of ENOENT (dir doesn't exist yet), + // then just ignore any ENOENT. + if (er.code === 'ENOENT') { + return didMkdirp ? null : mkdirp(dirname(to)).then(() => + this[_renamePath](from, to, true)) + } else if (er.code === 'EEXIST') + return rimraf(to).then(() => rename(from, to)) + else + throw er + }) + } + + [_rollbackRetireShallowNodes] (er) { + process.emit('time', 'reify:rollback:retireShallow') + const moves = this[_retiredPaths] + const movePromises = Object.entries(moves) + .map(([from, to]) => this[_renamePath](to, from)) + return promiseAllRejectLate(movePromises) + // ignore subsequent rollback errors + .catch(er => {}) + .then(() => process.emit('timeEnd', 'reify:rollback:retireShallow')) + .then(() => { + throw er + }) + } + + // adding to the trash list will skip reifying, and delete them + // if they are currently in the tree and otherwise untouched. + [_addOmitsToTrashList] () { + if (!this[_omitDev] && !this[_omitOptional] && !this[_omitPeer]) + return + + process.emit('time', 'reify:trashOmits') + const filter = node => + node.peer && this[_omitPeer] || + node.dev && this[_omitDev] || + node.optional && this[_omitOptional] || + node.devOptional && this[_omitOptional] && this[_omitDev] + + for (const node of this.idealTree.inventory.filter(filter)) + this[_addNodeToTrashList](node) + + process.emit('timeEnd', 'reify:trashOmits') + } + + [_createSparseTree] () { + process.emit('time', 'reify:createSparse') + // if we call this fn again, we look for the previous list + // so that we can avoid making the same directory multiple times + const dirs = this.diff.leaves + .filter(diff => { + return (diff.action === 'ADD' || diff.action === 'CHANGE') && + !this[_sparseTreeDirs].has(diff.ideal.path) + }) + .map(diff => diff.ideal.path) + + return promiseAllRejectLate(dirs.map(d => mkdirp(d))) + .then(() => dirs.forEach(dir => this[_sparseTreeDirs].add(dir))) + .then(() => process.emit('timeEnd', 'reify:createSparse')) + .catch(er => this[_rollbackCreateSparseTree](er)) + } + + [_rollbackCreateSparseTree] (er) { + process.emit('time', 'reify:rollback:createSparse') + // cut the roots of the sparse tree, not the leaves + const moves = this[_retiredPaths] + const failures = [] + const unlinks = Object.entries(moves) + .map(([from, to]) => rimraf(from).catch(er => failures.push([from, er]))) + return promiseAllRejectLate(unlinks) + .then(() => { + if (failures.length) + this.log.warn('cleanup', 'Failed to remove some directories', failures) + }) + .then(() => process.emit('timeEnd', 'reify:rollback:createSparse')) + .then(() => this[_rollbackRetireShallowNodes](er)) + } + + // shrinkwrap nodes define their dependency branches with a file, so + // we need to unpack them, read that shrinkwrap file, and then update + // the tree by calling loadVirtual with the node as the root. + [_loadShrinkwrapsAndUpdateTrees] (seen = new Set()) { + const shrinkwraps = this.diff.leaves + .filter(d => (d.action === 'CHANGE' || d.action === 'ADD') && + d.ideal.hasShrinkwrap && !seen.has(d.ideal) && + !this[_trashList].has(d.ideal.path)) + + if (!shrinkwraps.length) + return + + process.emit('time', 'reify:loadShrinkwraps') + + const Arborist = this.constructor + return promiseAllRejectLate(shrinkwraps.map(diff => { + const node = diff.ideal + seen.add(node) + return this[_reifyNode](node) + })) + .then(nodes => promiseAllRejectLate(nodes.map(node => new Arborist({ + ...this.options, + path: node.path, + }).loadVirtual({ root: node })))) + // reload the diff and sparse tree because the ideal tree changed + .then(() => this[_diffTrees]()) + .then(() => this[_createSparseTree]()) + .then(() => process.emit('timeEnd', 'reify:loadShrinkwraps')) + .catch(er => this[_rollbackCreateSparseTree](er)) + } + + // create a symlink for Links, extract for Nodes + // return the node object, since we usually want that + // handle optional dep failures here + // If node is in trash list, skip it + // If reifying fails, and the node is optional, add it and its optionalSet + // to the trash list + // Always return the node. + [_reifyNode] (node) { + if (this[_trashList].has(node.path)) + return node + + process.emit('time', `reifyNode:${node.location}`) + this.addTracker('reify', node.name, node.location) + + const p = Promise.resolve() + .then(() => this[_checkBins](node)) + .then(() => this[_extractOrLink](node)) + .then(() => this[_warnDeprecated](node)) + .then(() => this[_loadAncientPackageDetails](node)) + + return this[_handleOptionalFailure](node, p) + .then(() => { + this.finishTracker('reify', node.name, node.location) + process.emit('timeEnd', `reifyNode:${node.location}`) + return node + }) + } + + [_extractOrLink] (node) { + // in normal cases, node.resolved should *always* be set by now. + // however, it is possible when a lockfile is damaged, or very old, + // or in some other race condition bugs in npm v6, that a previously + // bundled dependency will have just a version, but no resolved value, + // and no 'bundled: true' setting. + // Do the best with what we have, or else remove it from the tree + // entirely, since we can't possibly reify it. + const res = node.resolved ? this[_registryResolved](node.resolved) + : node.package.name && node.version + ? `${node.package.name}@${node.version}` + : null + + // no idea what this thing is. remove it from the tree. + if (!res) { + node.parent = null + this.log.verbose('reify', 'unrecognized node in tree', node.path) + node.parent = null + this[_addNodeToTrashList](node) + return + } + + return node.isLink + ? rimraf(node.path).then(() => this[_symlink](node)) + : pacote.extract(res, node.path, { + ...this.options, + resolved: node.resolved, + integrity: node.integrity, + }) + } + + [_symlink] (node) { + const dir = dirname(node.path) + const target = node.realpath + const rel = relative(dir, target) + return symlink(rel, node.path, 'dir') + } + + [_warnDeprecated] (node) { + const {_id, deprecated} = node.package + if (deprecated) + this.log.warn('deprecated', `${_id}: ${deprecated}`) + } + + [_loadAncientPackageDetails] (node) { + // If we're loading from a v1 lockfile, load details from the package.json + // that weren't recorded in the old format. + const {meta} = this.idealTree + const ancient = meta.ancientLockfile + const old = meta.loadedFromDisk && !(meta.originalLockfileVersion >= 2) + // already replaced with the manifest if it's truly ancient + if (old && !ancient) { + // XXX should have a shared location where package.json is read, + // so we don't ever read the same pj more than necessary. + return rpj(node.path + '/package.json').then(pkg => { + node.package.bin = pkg.bin + node.package.os = pkg.os + node.package.cpu = pkg.cpu + node.package.engines = pkg.engines + meta.add(node) + }) + } + } + + // if the node is optional, then the failure of the promise is nonfatal + // just add it and its optional set to the trash list. + [_handleOptionalFailure] (node, p) { + return (node.optional ? p.catch(er => { + const set = optionalSet(node) + for (node of set) { + this.log.verbose('reify', 'failed optional dependency', node.path) + this[_addNodeToTrashList](node) + } + }) : p).then(() => node) + } + + [_registryResolved] (resolved) { + // the default registry url is a magic value meaning "the currently + // configured registry". + // + // XXX: use a magic string that isn't also a valid value, like + // ${REGISTRY} or something. This has to be threaded through the + // Shrinkwrap and Node classes carefully, so for now, just treat + // the default reg as the magical animal that it has been. + return resolved && resolved + .replace(/^https?:\/\/registry.npmjs.org\//, this.registry) + } + + // bundles are *sort of* like shrinkwraps, in that the branch is defined + // by the contents of the package. however, in their case, rather than + // shipping a virtual tree that must be reified, they ship an entire + // reified actual tree that must be unpacked and not modified. + [_loadBundlesAndUpdateTrees] ( + depth = 0, bundlesByDepth = this[_getBundlesByDepth]() + ) { + if (depth === 0) + process.emit('time', 'reify:loadBundles') + const maxBundleDepth = bundlesByDepth.get('maxBundleDepth') + if (depth > maxBundleDepth) { + // if we did something, then prune the tree and update the diffs + if (maxBundleDepth !== -1) { + this[_pruneBundledMetadeps](bundlesByDepth) + this[_diffTrees]() + } + process.emit('timeEnd', 'reify:loadBundles') + return + } + + // skip any that have since been removed from the tree, eg by a + // shallower bundle overwriting them with a bundled meta-dep. + const set = (bundlesByDepth.get(depth) || []) + .filter(node => node.root === this.idealTree && + !this[_trashList].has(node.path)) + + if (!set.length) + return this[_loadBundlesAndUpdateTrees](depth + 1, bundlesByDepth) + + // extract all the nodes with bundles + return promiseAllRejectLate(set.map(node => this[_reifyNode](node))) + // then load their unpacked children and move into the ideal tree + .then(nodes => + promiseAllRejectLate(nodes.map(node => new this.constructor({ + ...this.options, + path: node.path, + }).loadActual({ + root: node, + // don't transplant any sparse folders we created + transplantFilter: node => node.package._id, + })))) + // move onto the next level of bundled items + .then(() => this[_loadBundlesAndUpdateTrees](depth + 1, bundlesByDepth)) + .catch(er => this[_rollbackCreateSparseTree](er)) + } + + [_getBundlesByDepth] () { + const bundlesByDepth = new Map() + let maxBundleDepth = -1 + dfwalk({ + tree: this.diff, + visit: diff => { + const node = diff.ideal + if (node && !node.isRoot && node.package.bundleDependencies && + node.package.bundleDependencies.length) { + maxBundleDepth = Math.max(maxBundleDepth, node.depth) + if (!bundlesByDepth.has(node.depth)) + bundlesByDepth.set(node.depth, [node]) + else + bundlesByDepth.get(node.depth).push(node) + } + }, + getChildren: diff => diff.children, + }) + + bundlesByDepth.set('maxBundleDepth', maxBundleDepth) + return bundlesByDepth + } + + // https://github.com/npm/cli/issues/1597#issuecomment-667639545 + [_pruneBundledMetadeps] (bundlesByDepth) { + const bundleShadowed = new Set() + // create the list of nodes shadowed by children of bundlers + for (const bundles of bundlesByDepth.values()) { + // skip the 'maxBundleDepth' item + if (!Array.isArray(bundles)) + continue + for (const node of bundles) { + for (const name of node.children.keys()) { + const shadow = node.parent.resolve(name) + if (!shadow) + continue + bundleShadowed.add(shadow) + shadow.extraneous = true + } + } + } + let changed = true + while (changed) { + changed = false + for (const shadow of bundleShadowed) { + if (!shadow.extraneous) { + bundleShadowed.delete(shadow) + continue + } + + for (const edge of shadow.edgesIn) { + if (!edge.from.extraneous) { + shadow.extraneous = false + bundleShadowed.delete(shadow) + changed = true + } else { + for (const shadDep of shadow.edgesOut.values()) { + /* istanbul ignore else - pretty unusual situation, just being + * defensive here. Would mean that a bundled dep has a dependency + * that is unmet. which, weird, but if you bundle it, we take + * whatever you put there and assume the publisher knows best. */ + if (shadDep.to) + bundleShadowed.add(shadDep.to) + } + } + } + } + } + for (const shadow of bundleShadowed) { + shadow.parent = null + this[_addNodeToTrashList](shadow) + } + } + + [_submitQuickAudit] () { + if (this.options.audit === false) + return this.auditReport = null + + // we submit the quick audit at this point in the process, as soon as + // we have all the deps resolved, so that it can overlap with the other + // actions as much as possible. Stash the promise, which we resolve + // before finishing the reify() and returning the tree. Thus, we do + // NOT return the promise, as the intent is for this to run in parallel + // with the reification, and be resolved at a later time. + process.emit('time', 'reify:audit') + + this.auditReport = AuditReport.load(this.idealTree, this.options) + .then(res => { + process.emit('timeEnd', 'reify:audit') + this.auditReport = res + }) + } + + // return the promise if we're waiting for it, or the replaced result + [_awaitQuickAudit] () { + return this.auditReport + } + + // ok! actually unpack stuff into their target locations! + // The sparse tree has already been created, so we walk the diff + // kicking off each unpack job. If any fail, we rimraf the sparse + // tree entirely and try to put everything back where it was. + [_unpackNewModules] () { + process.emit('time', 'reify:unpack') + const unpacks = [] + dfwalk({ + tree: this.diff, + visit: diff => { + // no unpacking if we don't want to change this thing + if (diff.action !== 'CHANGE' && diff.action !== 'ADD') + return + + const node = diff.ideal + const bd = node.package.bundleDependencies + const sw = node.hasShrinkwrap + + // check whether we still need to unpack this one. + // test the inDepBundle last, since that's potentially a tree walk. + const doUnpack = node && // can't unpack if removed! + !node.isRoot && // root node already exists + !(bd && bd.length) && // already unpacked to read bundle + !sw && // already unpacked to read sw + !node.inDepBundle // already unpacked by another dep's bundle + + if (doUnpack) + unpacks.push(this[_reifyNode](node)) + }, + getChildren: diff => diff.children, + }) + return promiseAllRejectLate(unpacks) + .then(() => process.emit('timeEnd', 'reify:unpack')) + .catch(er => this[_rollbackCreateSparseTree](er)) + } + + // This is the part where we move back the unchanging nodes that were + // the children of a node that did change. If this fails, the rollback + // is a three-step process. First, we try to move the retired unchanged + // nodes BACK to their retirement folders, then delete the sparse tree, + // then move everything out of retirement. + [_moveBackRetiredUnchanged] () { + // get a list of all unchanging children of any shallow retired nodes + // if they are not the ancestor of any node in the diff set, then the + // directory won't already exist, so just rename it over. + // This is sort of an inverse diff tree, of all the nodes where + // the actualTree and idealTree _don't_ differ, starting from the + // shallowest nodes that we moved aside in the first place. + process.emit('time', 'reify:unretire') + const moves = this[_retiredPaths] + this[_retiredUnchanged] = {} + return promiseAllRejectLate(this.diff.children.map(diff => { + const realFolder = (diff.actual || diff.ideal).path + const retireFolder = moves[realFolder] + this[_retiredUnchanged][retireFolder] = [] + return promiseAllRejectLate(diff.unchanged.map(node => { + // no need to roll back links, since we'll just delete them anyway + if (node.isLink) + return mkdirp(dirname(node.path)).then(() => this[_reifyNode](node)) + + // will have been moved/unpacked along with bundler + if (node.inDepBundle) + return + + this[_retiredUnchanged][retireFolder].push(node) + + const rel = relative(realFolder, node.path) + const fromPath = resolve(retireFolder, rel) + // if it has bundleDependencies, then make node_modules. otherwise + // skip it. + const bd = node.package.bundleDependencies + const dir = bd && bd.length ? node.path + '/node_modules' : node.path + return mkdirp(dir).then(() => this[_moveContents](node, fromPath)) + })) + })) + .then(() => process.emit('timeEnd', 'reify:unretire')) + .catch(er => this[_rollbackMoveBackRetiredUnchanged](er)) + } + + // move the contents from the fromPath to the node.path + [_moveContents] (node, fromPath) { + return packageContents({ + path: fromPath, + depth: 1, + packageJsonCache: new Map([[fromPath + '/package.json', node.package]]), + }).then(res => promiseAllRejectLate(res.map(path => { + const rel = relative(fromPath, path) + const to = resolve(node.path, rel) + return this[_renamePath](path, to) + }))) + } + + [_rollbackMoveBackRetiredUnchanged] (er) { + const moves = this[_retiredPaths] + // flip the mapping around to go back + const realFolders = new Map(Object.entries(moves).map(([k, v]) => [v, k])) + const promises = Object.entries(this[_retiredUnchanged]) + .map(([retireFolder, nodes]) => promiseAllRejectLate(nodes.map(node => { + const realFolder = realFolders.get(retireFolder) + const rel = relative(realFolder, node.path) + const fromPath = resolve(retireFolder, rel) + return this[_moveContents]({ ...node, path: fromPath }, node.path) + }))) + return promiseAllRejectLate(promises) + .then(() => this[_rollbackCreateSparseTree](er)) + } + + [_build] () { + process.emit('time', 'reify:build') + + // for all the things being installed, run their appropriate scripts + // run in tip->root order, so as to be more likely to build a node's + // deps before attempting to build it itself + const nodes = [] + dfwalk({ + tree: this.diff, + leave: diff => { + if (!diff.ideal.isRoot) + nodes.push(diff.ideal) + }, + // process adds before changes, ignore removals + getChildren: diff => diff && diff.children, + filter: diff => diff.action === 'ADD' || diff.action === 'CHANGE', + }) + + return this.rebuild({ nodes, handleOptionalFailure: true }) + .then(() => process.emit('timeEnd', 'reify:build')) + .catch(er => this[_rollbackMoveBackRetiredUnchanged](er)) + } + + // the tree is pretty much built now, so it's cleanup time. + // remove the retired folders, and any deleted nodes + // If this fails, there isn't much we can do but tell the user about it. + // Thankfully, it's pretty unlikely that it'll fail, since rimraf is a tank. + [_removeTrash] () { + process.emit('time', 'reify:trash') + const promises = [] + const failures = [] + const rm = path => rimraf(path).catch(er => failures.push([path, er])) + + for (const path of this[_trashList]) + promises.push(rm(path)) + + return promiseAllRejectLate(promises).then(() => { + if (failures.length) + this.log.warn('cleanup', 'Failed to remove some directories', failures) + }) + .then(() => process.emit('timeEnd', 'reify:trash')) + } + + // last but not least, we save the ideal tree metadata to the package-lock + // or shrinkwrap file, and any additions or removals to package.json + [_saveIdealTree] (options) { + // the ideal tree is actualized now, hooray! + // it still contains all the references to optional nodes that were removed + // for install failures. Those still end up in the shrinkwrap, so we + // save it first, then prune out the optional trash, and then return it. + + // support save=false option + if (options.save === false || this[_global] || this[_dryRun]) + return + + process.emit('time', 'reify:save') + + if (this[_resolvedAdd]) { + const root = this.idealTree + const pkg = root.package + for (const req of this[_resolvedAdd]) { + const {name, rawSpec, subSpec} = req + const spec = subSpec ? subSpec.rawSpec : rawSpec + const child = root.children.get(name) + + if (req.registry) { + const version = child.version + const prefixRange = this[_savePrefix] + version + // if we installed a range, then we save the range specified + // if it is not a subset of the ^x.y.z. eg, installing a range + // of `1.x <1.2.3` will not be saved as `^1.2.0`, because that + // would allow versions outside the requested range. Tags and + // specific versions save with the save-prefix. + const isRange = (subSpec || req).type === 'range' + const range = !isRange || subset(prefixRange, spec, { loose: true }) + ? prefixRange : spec + const pname = child.package.name + const alias = name !== pname + updateDepSpec(pkg, name, (alias ? `npm:${pname}@` : '') + range) + } else if (req.hosted) + updateDepSpec(pkg, name, req.hosted.shortcut({ noCommittish: false })) + else + updateDepSpec(pkg, name, req.saveSpec) + } + + // refresh the edges so they have the correct specs + this.idealTree.package = pkg + } + + // preserve indentation, if possible + const pj = resolve(this.idealTree.path, 'package.json') + const { + [Symbol.for('indent')]: indent, + [Symbol.for('newline')]: newline, + } = this.idealTree.package + const pjData = orderDeps({ + ...this.idealTree.package, + _id: undefined, // strip this off + }) + const format = indent === undefined ? ' ' : indent + const eol = newline === undefined ? '\n' : newline + const json = (JSON.stringify(pjData, null, format) + '\n') + .replace(/\n/g, eol) + + const saveOpt = { + format: (this[_formatPackageLock] && format) ? format + : this[_formatPackageLock], + } + return Promise.all([ + this[_usePackageLock] && this.idealTree.meta.save(saveOpt), + writeFile(pj, json), + ]).then(() => process.emit('timeEnd', 'reify:save')) + } + + [_copyIdealToActual] () { + // save the ideal's meta as a hidden lockfile after we actualize it + this.idealTree.meta.filename = + this.path + '/node_modules/.package-lock.json' + this.idealTree.meta.hiddenLockfile = true + this.actualTree = this.idealTree + this.idealTree = null + for (const path of this[_trashList]) { + const loc = relpath(this.path, path) + const node = this.actualTree.inventory.get(loc) + if (node && node.root === this.actualTree) + node.parent = null + } + + return !this[_global] && this.actualTree.meta.save() + } +} diff --git a/deps/npm/node_modules/@npmcli/arborist/lib/audit-report.js b/deps/npm/node_modules/@npmcli/arborist/lib/audit-report.js new file mode 100644 index 00000000000000..9407e0ee6f097c --- /dev/null +++ b/deps/npm/node_modules/@npmcli/arborist/lib/audit-report.js @@ -0,0 +1,382 @@ +// an object representing the set of vulnerabilities in a tree +/* eslint camelcase: "off" */ + +const npa = require('npm-package-arg') +const pickManifest = require('npm-pick-manifest') + +const Vuln = require('./vuln.js') +const Calculator = require('@npmcli/metavuln-calculator') + +const _getReport = Symbol('getReport') +const _fixAvailable = Symbol('fixAvailable') +const _checkTopNode = Symbol('checkTopNode') +const _init = Symbol('init') +const _omit = Symbol('omit') +const procLog = require('./proc-log.js') + +const fetch = require('npm-registry-fetch') + +class AuditReport extends Map { + static load (tree, opts) { + return new AuditReport(tree, opts).run() + } + + get auditReportVersion () { + return 2 + } + + toJSON () { + const obj = { + auditReportVersion: this.auditReportVersion, + vulnerabilities: {}, + metadata: { + vulnerabilities: { + info: 0, + low: 0, + moderate: 0, + high: 0, + critical: 0, + total: this.size, + }, + dependencies: { + prod: 0, + dev: 0, + optional: 0, + peer: 0, + peerOptional: 0, + total: this.tree.inventory.size, + }, + }, + } + + for (const node of this.tree.inventory.values()) { + const { dependencies } = obj.metadata + let prod = true + for (const type of [ + 'dev', + 'optional', + 'peer', + 'peerOptional', + ]) { + if (node[type]) { + dependencies[type]++ + prod = false + } + } + if (prod) + dependencies.prod++ + } + + // if it doesn't have any topVulns, then it's fixable with audit fix + // for each topVuln, figure out if it's fixable with audit fix --force, + // or if we have to just delete the thing, and if the fix --force will + // require a semver major update. + const vulnerabilities = [] + for (const [name, vuln] of this.entries()) { + vulnerabilities.push([name, vuln.toJSON()]) + obj.metadata.vulnerabilities[vuln.severity]++ + } + + obj.vulnerabilities = vulnerabilities + .sort(([a], [b]) => a.localeCompare(b)) + .reduce((set, [name, vuln]) => { + set[name] = vuln + return set + }, {}) + + return obj + } + + constructor (tree, opts = {}) { + super() + this[_omit] = new Set(opts.omit || []) + this.topVulns = new Map() + + this.calculator = new Calculator(opts) + this.error = null + this.options = opts + this.log = opts.log || procLog + this.tree = tree + } + + async run () { + this.report = await this[_getReport]() + if (this.report) + await this[_init]() + return this + } + + isVulnerable (node) { + const vuln = this.get(node.package.name) + return !!(vuln && vuln.isVulnerable(node)) + } + + async [_init] () { + process.emit('time', 'auditReport:init') + + const promises = [] + for (const [name, advisories] of Object.entries(this.report)) { + for (const advisory of advisories) + promises.push(this.calculator.calculate(name, advisory)) + } + + // now the advisories are calculated with a set of versions + // and the packument. turn them into our style of vuln objects + // which also have the affected nodes, and also create entries + // for all the metavulns that we find from dependents. + const advisories = new Set(await Promise.all(promises)) + const seen = new Set() + for (const advisory of advisories) { + const { name, range } = advisory + + // don't flag the exact same name/range more than once + // adding multiple advisories with the same range is fine, but no + // need to search for nodes we already would have added. + const k = `${name}@${range}` + if (seen.has(k)) + continue + + seen.add(k) + + const vuln = this.get(name) || new Vuln({ name, advisory }) + if (this.has(name)) + vuln.addAdvisory(advisory) + super.set(name, vuln) + + const p = [] + for (const node of this.tree.inventory.query('name', name)) { + if (shouldOmit(node, this[_omit])) + continue + + // if not vulnerable by this advisory, keep searching + if (!advisory.testVersion(node.version)) + continue + + // we will have loaded the source already if this is a metavuln + if (advisory.type === 'metavuln') + vuln.addVia(this.get(advisory.dependency)) + + // already marked this one, no need to do it again + if (vuln.nodes.has(node)) + continue + + // haven't marked this one yet. get its dependents. + vuln.nodes.add(node) + for (const { from: dep, spec } of node.edgesIn) { + if (dep.isTop && !vuln.topNodes.has(dep)) + this[_checkTopNode](dep, vuln, spec) + else { + // calculate a metavuln, if necessary + p.push(this.calculator.calculate(dep.name, advisory).then(meta => { + if (meta.testVersion(dep.version, spec)) + advisories.add(meta) + })) + } + } + } + await Promise.all(p) + + // make sure we actually got something. if not, remove it + // this can happen if you are loading from a lockfile created by + // npm v5, since it lists the current version of all deps, + // rather than the range that is actually depended upon, + // or if using --omit with the older audit endpoint. + if (this.get(name).nodes.size === 0) { + this.delete(name) + continue + } + + // if the vuln is valid, but THIS advisory doesn't apply to any of + // the nodes it references, then remove it from the advisory list. + // happens when using omit with old audit endpoint. + for (const advisory of vuln.advisories) { + const relevant = [...vuln.nodes].some(n => advisory.testVersion(n.version)) + if (!relevant) + vuln.deleteAdvisory(advisory) + } + } + process.emit('timeEnd', 'auditReport:init') + } + + [_checkTopNode] (topNode, vuln, spec) { + vuln.fixAvailable = this[_fixAvailable](topNode, vuln, spec) + + if (vuln.fixAvailable !== true) { + // now we know the top node is vulnerable, and cannot be + // upgraded out of the bad place without --force. But, there's + // no need to add it to the actual vulns list, because nothing + // depends on root. + this.topVulns.set(vuln.name, vuln) + vuln.topNodes.add(topNode) + } + } + + // check whether the top node is vulnerable. + // check whether we can get out of the bad place with --force, and if + // so, whether that update is SemVer Major + [_fixAvailable] (topNode, vuln, spec) { + // this will always be set to at least {name, versions:{}} + const paku = vuln.packument + + if (!vuln.testSpec(spec)) + return true + + // similarly, even if we HAVE a packument, but we're looking for it + // somewhere other than the registry, and we got something vulnerable, + // then we're stuck with it. + const specObj = npa(spec) + if (!specObj.registry) + return false + + // We don't provide fixes for top nodes other than root, but we + // still check to see if the node is fixable with a different version, + // and if that is a semver major bump. + try { + const { + _isSemVerMajor: isSemVerMajor, + version, + name, + } = pickManifest(paku, spec, { + ...this.options, + before: null, + avoid: vuln.range, + avoidStrict: true, + }) + return {name, version, isSemVerMajor} + } catch (er) { + return false + } + } + + set () { + throw new Error('do not call AuditReport.set() directly') + } + + // convert a quick-audit into a bulk advisory listing + static auditToBulk (report) { + if (!report.advisories) { + // tack on the report json where the response body would go + throw Object.assign(new Error('Invalid advisory report'), { + body: JSON.stringify(report), + }) + } + + const bulk = {} + const {advisories} = report + for (const advisory of Object.values(advisories)) { + const { + id, + url, + title, + severity, + vulnerable_versions, + module_name: name, + } = advisory + bulk[name] = bulk[name] || [] + bulk[name].push({id, url, title, severity, vulnerable_versions}) + } + + return bulk + } + + async [_getReport] () { + // if we're not auditing, just return false + if (this.options.audit === false || this.tree.inventory.size === 0) + return null + + process.emit('time', 'auditReport:getReport') + try { + try { + // first try the super fast bulk advisory listing + const body = prepareBulkData(this.tree, this[_omit]) + + // no sense asking if we don't have anything to audit + if (!Object.keys(body).length) + return {} + + const res = await fetch('/-/npm/v1/security/advisories/bulk', { + ...this.options, + registry: this.options.auditRegistry || this.options.registry, + method: 'POST', + gzip: true, + body, + }) + + return await res.json() + } catch (_) { + // that failed, try the quick audit endpoint + const body = prepareData(this.tree, this.options) + const res = await fetch('/-/npm/v1/security/audits/quick', { + ...this.options, + registry: this.options.auditRegistry || this.options.registry, + method: 'POST', + gzip: true, + body, + }) + return AuditReport.auditToBulk(await res.json()) + } + } catch (er) { + this.log.verbose('audit error', er) + this.log.silly('audit error', String(er.body)) + this.error = er + return null + } finally { + process.emit('timeEnd', 'auditReport:getReport') + } + } +} + +// return true if we should ignore this one +const shouldOmit = (node, omit) => + !node.version ? true + : omit.size === 0 ? false + : node.dev && omit.has('dev') || + node.optional && omit.has('optional') || + node.devOptional && omit.has('dev') && omit.has('optional') || + node.peer && omit.has('peer') + +const prepareBulkData = (tree, omit) => { + const payload = {} + for (const name of tree.inventory.query('name')) { + const set = new Set() + for (const node of tree.inventory.query('name', name)) { + if (shouldOmit(node, omit)) + continue + + set.add(node.version) + } + if (set.size) + payload[name] = [...set] + } + return payload +} + +const prepareData = (tree, opts) => { + const { npmVersion: npm_version } = opts + const node_version = process.version + const { platform, arch } = process + const { NODE_ENV: node_env } = process.env + const data = tree.meta.commit() + // the legacy audit endpoint doesn't support any kind of pre-filtering + // we just have to get the advisories and skip over them in the report + return { + name: data.name, + version: data.version, + requires: { + ...(tree.package.devDependencies || {}), + ...(tree.package.peerDependencies || {}), + ...(tree.package.optionalDependencies || {}), + ...(tree.package.dependencies || {}), + }, + dependencies: data.dependencies, + metadata: { + node_version, + npm_version, + platform, + arch, + node_env, + }, + } +} + +module.exports = AuditReport diff --git a/deps/npm/node_modules/@npmcli/arborist/lib/calc-dep-flags.js b/deps/npm/node_modules/@npmcli/arborist/lib/calc-dep-flags.js new file mode 100644 index 00000000000000..73f1e60d7ce97b --- /dev/null +++ b/deps/npm/node_modules/@npmcli/arborist/lib/calc-dep-flags.js @@ -0,0 +1,94 @@ +const { depth } = require('treeverse') + +const calcDepFlags = (tree, resetRoot = true) => { + if (resetRoot) { + tree.dev = false + tree.optional = false + tree.devOptional = false + tree.peer = false + } + const ret = depth({ + tree, + visit: node => calcDepFlagsStep(node), + filter: node => node, + getChildren: node => [...node.edgesOut.values()].map(edge => edge.to), + }) + return ret +} + +const calcDepFlagsStep = (node) => { + // This rewalk is necessary to handle cases where devDep and optional + // or normal dependency graphs overlap deep in the dep graph. + // Since we're only walking through deps that are not already flagged + // as non-dev/non-optional, it's typically a very shallow traversal + node.extraneous = false + + // for links, map their hierarchy appropriately + if (node.target) { + node.target.dev = node.dev + node.target.optional = node.optional + node.target.devOptional = node.devOptional + node.target.peer = node.peer + node.target.extraneous = false + node = node.target + } + + node.edgesOut.forEach(({peer, optional, dev, to}) => { + // if the dep is missing, then its flags are already maximally unset + if (!to) + return + + // everything with any kind of edge into it is not extraneous + to.extraneous = false + + // devOptional is the *overlap* of the dev and optional tree. + // however, for convenience and to save an extra rewalk, we leave + // it set when we are in *either* tree, and then omit it from the + // package-lock if either dev or optional are set. + const unsetDevOpt = !node.devOptional && !node.dev && !node.optional && + !dev && !optional + + // if we are not in the devOpt tree, then we're also not in + // either the dev or opt trees + const unsetDev = unsetDevOpt || !node.dev && !dev + const unsetOpt = unsetDevOpt || + !node.optional && !optional + const unsetPeer = !node.peer && !peer + + if (unsetPeer) + unsetFlag(to, 'peer') + + if (unsetDevOpt) + unsetFlag(to, 'devOptional') + + if (unsetDev) + unsetFlag(to, 'dev') + + if (unsetOpt) + unsetFlag(to, 'optional') + }) + + return node +} + +// typically a short walk, since it only traverses deps that +// have the flag set. +const unsetFlag = (node, flag) => { + if (node[flag]) { + node[flag] = false + depth({ + tree: node, + visit: node => { + node.extraneous = node[flag] = false + if (node.target) + node.target.extraneous = node.target[flag] = false + }, + getChildren: node => [...(node.target || node).edgesOut.values()] + .filter(edge => edge.to && edge.to[flag] && + (flag !== 'peer' && edge.type === 'peer' || edge.type === 'prod')) + .map(edge => edge.to), + }) + } +} + +module.exports = calcDepFlags diff --git a/deps/npm/node_modules/@npmcli/arborist/lib/consistent-resolve.js b/deps/npm/node_modules/@npmcli/arborist/lib/consistent-resolve.js new file mode 100644 index 00000000000000..5d648de5bd87b4 --- /dev/null +++ b/deps/npm/node_modules/@npmcli/arborist/lib/consistent-resolve.js @@ -0,0 +1,35 @@ +// take a path and a resolved value, and turn it into a resolution from +// the given new path. This is used with converting a package.json's +// relative file: path into one suitable for a lockfile, or between +// lockfiles, and for converting hosted git repos to a consistent url type. +const npa = require('npm-package-arg') +const relpath = require('./relpath.js') +const consistentResolve = (resolved, fromPath, toPath, relPaths = false) => { + if (!resolved) + return null + + try { + const { + fetchSpec, + saveSpec, + type, + hosted, + rawSpec, + raw, + } = npa(resolved, fromPath) + const isPath = type === 'file' || type === 'directory' + return isPath && !relPaths ? `file:${fetchSpec}` + : isPath ? 'file:' + (toPath ? relpath(toPath, fetchSpec) : fetchSpec) + : hosted ? 'git+' + hosted.sshurl({ noCommittish: false }) + : type === 'git' ? saveSpec + // always return something. 'foo' is interpreted as 'foo@' otherwise. + : rawSpec === '' && raw.slice(-1) !== '@' ? raw + // just strip off the name, but otherwise return as-is + : rawSpec + } catch (_) { + // whatever we passed in was not acceptable to npa. + // leave it 100% untouched. + return resolved + } +} +module.exports = consistentResolve diff --git a/deps/npm/node_modules/@npmcli/arborist/lib/dep-spec.js b/deps/npm/node_modules/@npmcli/arborist/lib/dep-spec.js new file mode 100644 index 00000000000000..92911543e16841 --- /dev/null +++ b/deps/npm/node_modules/@npmcli/arborist/lib/dep-spec.js @@ -0,0 +1,43 @@ +const types = [ + 'peerDependencies', + 'devDependencies', + 'optionalDependencies', + 'dependencies', +] + +const findType = (pkg, name) => { + for (const t of types) { + if (pkg[t] && typeof pkg[t] === 'object' && pkg[t][name] !== undefined) + return t + } + return 'dependencies' +} + +// given a dep name and spec, update it wherever it exists in +// the manifest, or add the spec to 'dependencies' if not found. +const updateDepSpec = (pkg, name, newSpec) => { + const type = findType(pkg, name) + pkg[type] = pkg[type] || {} + pkg[type][name] = newSpec + return pkg +} + +// sort alphabetically all types of deps for a given package +const orderDeps = (pkg) => { + for (const type of types) { + if (pkg && pkg[type]) { + pkg[type] = Object.keys(pkg[type]) + .sort((a, b) => a.localeCompare(b)) + .reduce((res, key) => { + res[key] = pkg[type][key] + return res + }, {}) + } + } + return pkg +} + +module.exports = { + orderDeps, + updateDepSpec, +} diff --git a/deps/npm/node_modules/@npmcli/arborist/lib/dep-valid.js b/deps/npm/node_modules/@npmcli/arborist/lib/dep-valid.js new file mode 100644 index 00000000000000..0e92ed4f058850 --- /dev/null +++ b/deps/npm/node_modules/@npmcli/arborist/lib/dep-valid.js @@ -0,0 +1,130 @@ +// Do not rely on package._fields, so that we don't throw +// false failures if a tree is generated by other clients. +// Only relies on child.resolved, which MAY come from +// client-specific package.json meta _fields, but most of +// the time will be pulled out of a lockfile + +const semver = require('semver') +const npa = require('npm-package-arg') +const {relative} = require('path') +const fromPath = require('./from-path.js') + +const depValid = (child, requested, requestor) => { + // NB: we don't do much to verify 'tag' type requests. + // Just verify that we got a remote resolution. Presumably, it + // came from a registry and was tagged at some point. + + if (typeof requested === 'string') { + try { + // tarball/dir must have resolved to the same tgz on disk, but for + // file: deps that depend on other files/dirs, we must resolve the + // location based on the *requestor* file/dir, not where it ends up. + // '' is equivalent to '*' + requested = npa.resolve(child.name, requested || '*', fromPath(requestor)) + } catch (er) { + // Not invalid because the child doesn't match, but because + // the spec itself is not supported. Nothing would match, + // so the edge is definitely not valid and never can be. + er.dependency = child.name + er.requested = requested + requestor.errors.push(er) + return false + } + } + + // if the lockfile is super old, or hand-modified, + // then it's possible to hit this state. + if (!requested) { + const er = new Error('Invalid dependency specifier') + er.dependency = child.name + er.requested = requested + requestor.errors.push(er) + return false + } + + switch (requested.type) { + case 'range': + if (requested.fetchSpec === '*') + return true + // fallthrough + case 'version': + // if it's a version or a range other than '*', semver it + return semver.satisfies(child.package.version, requested.fetchSpec, true) + + case 'directory': + // directory must be a link to the specified folder + return !!child.isLink && + relative(child.realpath, requested.fetchSpec) === '' + + case 'file': + return tarballValid(child, requested, requestor) + + case 'alias': + // check that the alias target is valid + return depValid(child, requested.subSpec, requestor) + + case 'tag': + // if it's a tag, we just verify that it has a tarball resolution + // presumably, it came from the registry and was tagged at some point + return child.resolved && npa(child.resolved).type === 'remote' + + case 'remote': + // verify that we got it from the desired location + return child.resolved === requested.fetchSpec + + case 'git': { + // if it's a git type, verify that they're the same repo + // + // if it specifies a definite commit, then it must have the + // same commit to be considered the same repo + // + // if it has a #semver: specifier, verify that the + // version in the package is in the semver range + const resRepo = npa(child.resolved || '') + const resHost = resRepo.hosted + const reqHost = requested.hosted + const reqCommit = /^[a-fA-F0-9]{40}$/.test(requested.gitCommittish || '') + const nc = { noCommittish: !reqCommit } + const sameRepo = + resHost ? reqHost && reqHost.ssh(nc) === resHost.ssh(nc) + : resRepo.fetchSpec === requested.fetchSpec + + return !sameRepo ? false + : !requested.gitRange ? true + : semver.satisfies(child.package.version, requested.gitRange, { + loose: true, + }) + } + + default: // unpossible, just being cautious + break + } + + const er = new Error('Unsupported dependency type') + er.dependency = child.name + er.requested = requested + requestor.errors.push(er) + return false +} + +const tarballValid = (child, requested, requestor) => { + if (child.isLink) + return false + + if (child.resolved) + return child.resolved === `file:${requested.fetchSpec}` + + // if we have a legacy mutated package.json file. we can't be 100% + // sure that it resolved to the same file, but if it was the same + // request, that's a pretty good indicator of sameness. + if (child.package._requested) + return child.package._requested.saveSpec === requested.saveSpec + + // ok, we're probably dealing with some legacy cruft here, not much + // we can do at this point unfortunately. + return false +} + +module.exports = (child, requested, accept, requestor) => + depValid(child, requested, requestor) || + (typeof accept === 'string' ? depValid(child, accept, requestor) : false) diff --git a/deps/npm/node_modules/@npmcli/arborist/lib/diff.js b/deps/npm/node_modules/@npmcli/arborist/lib/diff.js new file mode 100644 index 00000000000000..2e70234b50c7f0 --- /dev/null +++ b/deps/npm/node_modules/@npmcli/arborist/lib/diff.js @@ -0,0 +1,155 @@ +// a tree representing the difference between two trees +// A Diff node's parent is not necessarily the parent of +// the node location it refers to, but rather the highest level +// node that needs to be either changed or removed. +// Thus, the root Diff node is the shallowest change required +// for a given branch of the tree being mutated. + +const {depth} = require('treeverse') + +const ssri = require('ssri') + +class Diff { + constructor ({actual, ideal}) { + this.children = [] + this.actual = actual + this.ideal = ideal + if (this.ideal) { + this.resolved = this.ideal.resolved + this.integrity = this.ideal.integrity + } + this.action = getAction(this) + this.parent = null + // the set of leaf nodes that we rake up to the top level + this.leaves = [] + // the set of nodes that don't change in this branch of the tree + this.unchanged = [] + // the set of nodes that will be removed in this branch of the tree + this.removed = [] + } + + static calculate ({actual, ideal}) { + return depth({ + tree: new Diff({actual, ideal}), + getChildren, + leave, + }) + } +} + +const getAction = ({actual, ideal}) => + !ideal ? 'REMOVE' + // bundled meta-deps are copied over to the ideal tree when we visit it, + // so they'll appear to be missing here. There's no need to handle them + // in the diff, though, because they'll be replaced at reify time anyway + // Otherwise, add the missing node. + : !actual ? (ideal.inDepBundle ? null : 'ADD') + // always ignore the root node + : ideal.isRoot && actual.isRoot || + // top nodes, links, and git deps won't have integrity, but do have resolved + !ideal.integrity && !actual.integrity && + ideal.resolved === actual.resolved || + // otherwise, verify that it's the same bits + // note that if ideal has integrity, and resolved doesn't, we treat + // that as a 'change', so that it gets re-fetched and locked down. + ideal.integrity && + actual.integrity && + ssri.parse(ideal.integrity).match(actual.integrity) ? null + : 'CHANGE' + +const allChildren = node => { + if (!node) + return new Map() + + const kids = new Map() + for (const n of [node, ...node.fsChildren]) { + for (const kid of n.children.values()) + kids.set(kid.path, kid) + } + return kids +} + +// functions for the walk options when we traverse the trees +// to create the diff tree +const getChildren = diff => { + const children = [] + const {unchanged, removed} = diff + + // Note: we DON'T diff fsChildren themselves, because they are either + // included in the package contents, or part of some other project, and + // will never appear in legacy shrinkwraps anyway. but we _do_ include the + // child nodes of fsChildren, because those are nodes that we are typically + // responsible for installing. + const actualKids = allChildren(diff.actual) + const idealKids = allChildren(diff.ideal) + const paths = new Set([...actualKids.keys(), ...idealKids.keys()]) + for (const path of paths) { + const actual = actualKids.get(path) + const ideal = idealKids.get(path) + diffNode(actual, ideal, children, unchanged, removed) + } + + if (diff.leaves && !children.length) + diff.leaves.push(diff) + + return children +} + +const diffNode = (actual, ideal, children, unchanged, removed) => { + const action = getAction({actual, ideal}) + + // if it's a match, then get its children + // otherwise, this is the child diff node + if (action) { + if (action === 'REMOVE') + removed.push(actual) + children.push(new Diff({actual, ideal})) + } else { + unchanged.push(ideal) + // !*! Weird dirty hack warning !*! + // + // Bundled deps aren't loaded in the ideal tree, because we don't know + // what they are going to be without unpacking. Swap them over now if + // the bundling node isn't changing, so we don't prune them later. + // + // It's a little bit dirty to be doing this here, since it means that + // diffing trees can mutate them, but otherwise we have to walk over + // all unchanging bundlers and correct the diff later, so it's more + // efficient to just fix it while we're passing through already. + // + // Note that moving over a bundled dep will break the links to other + // deps under this parent, which may have been transitively bundled. + // Breaking those links means that we'll no longer see the transitive + // dependency, meaning that it won't appear as bundled any longer! + // In order to not end up dropping transitively bundled deps, we have + // to get the list of nodes to move, then move them all at once, rather + // than moving them one at a time in the first loop. + const bd = ideal.package.bundleDependencies + if (actual && bd && bd.length) { + const bundledChildren = [] + for (const node of actual.children.values()) { + if (node.inBundle) + bundledChildren.push(node) + } + for (const node of bundledChildren) + node.parent = ideal + } + children.push(...getChildren({actual, ideal, unchanged, removed})) + } +} + +// set the parentage in the leave step so that we aren't attaching +// child nodes only to remove them later. also bubble up the unchanged +// nodes so that we can move them out of staging in the reification step. +const leave = (diff, children) => { + children.forEach(kid => { + kid.parent = diff + diff.leaves.push(...kid.leaves) + diff.unchanged.push(...kid.unchanged) + diff.removed.push(...kid.removed) + }) + diff.children = children + return diff +} + +module.exports = Diff diff --git a/deps/npm/node_modules/@npmcli/arborist/lib/edge.js b/deps/npm/node_modules/@npmcli/arborist/lib/edge.js new file mode 100644 index 00000000000000..210e35cbcf51b2 --- /dev/null +++ b/deps/npm/node_modules/@npmcli/arborist/lib/edge.js @@ -0,0 +1,174 @@ +// An edge in the dependency graph +// Represents a dependency relationship of some kind + +const npa = require('npm-package-arg') +const depValid = require('./dep-valid.js') +const _from = Symbol('_from') +const _to = Symbol('_to') +const _type = Symbol('_type') +const _spec = Symbol('_spec') +const _accept = Symbol('_accept') +const _name = Symbol('_name') +const _error = Symbol('_error') +const _loadError = Symbol('_loadError') +const _setFrom = Symbol('_setFrom') + +const types = new Set([ + 'prod', + 'dev', + 'optional', + 'peer', + 'peerOptional', + 'workspace', +]) + +class Edge { + constructor (options) { + const { type, name, spec, accept, from } = options + + if (typeof spec !== 'string') + throw new TypeError('must provide string spec') + + if (type === 'workspace' && npa(spec).type !== 'directory') + throw new TypeError('workspace edges must be a symlink') + + this[_spec] = spec + + if (accept !== undefined) { + if (typeof accept !== 'string') + throw new TypeError('accept field must be a string if provided') + this[_accept] = accept || '*' + } + + if (typeof name !== 'string') + throw new TypeError('must provide dependency name') + this[_name] = name + + if (!types.has(type)) { + throw new TypeError( + `invalid type: ${type}\n` + + `(valid types are: ${Edge.types.join(', ')})`) + } + this[_type] = type + if (!from) + throw new TypeError('must provide "from" node') + this[_setFrom](from) + this[_error] = this[_loadError]() + } + + satisfiedBy (node) { + return depValid(node, this.spec, this.accept, this.from) + } + + get workspace () { + return this[_type] === 'workspace' + } + + get prod () { + return this[_type] === 'prod' + } + + get dev () { + return this[_type] === 'dev' + } + + get optional () { + return this[_type] === 'optional' || this[_type] === 'peerOptional' + } + + get peer () { + return this[_type] === 'peer' || this[_type] === 'peerOptional' + } + + get type () { + return this[_type] + } + + get name () { + return this[_name] + } + + get spec () { + return this[_spec] + } + + get accept () { + return this[_accept] + } + + get valid () { + return !this.error + } + + get missing () { + return this.error === 'MISSING' + } + + get invalid () { + return this.error === 'INVALID' + } + + get peerLocal () { + return this.error === 'PEER LOCAL' + } + + get error () { + this[_error] = this[_error] || this[_loadError]() + return this[_error] === 'OK' ? null : this[_error] + } + + [_loadError] () { + return !this[_to] ? (this.optional ? null : 'MISSING') + : this.peer && this.from === this.to.parent && !this.from.isTop ? 'PEER LOCAL' + : !depValid(this.to, this.spec, this.accept, this.from) ? 'INVALID' + : 'OK' + } + + reload (hard = false) { + const newTo = this[_from].resolve(this.name) + if (newTo !== this[_to]) { + if (this[_to]) + this[_to].edgesIn.delete(this) + this[_to] = newTo + this[_error] = this[_loadError]() + if (this[_to]) + this[_to].addEdgeIn(this) + } else if (hard) + this[_error] = this[_loadError]() + } + + detach () { + if (this[_to]) + this[_to].edgesIn.delete(this) + this[_from].edgesOut.delete(this.name) + this[_to] = null + this[_error] = 'DETACHED' + this[_from] = null + } + + [_setFrom] (node) { + this[_from] = node + if (node.edgesOut.has(this.name)) + node.edgesOut.get(this.name).detach() + node.addEdgeOut(this) + this.reload() + } + + get from () { + return this[_from] + } + + get to () { + return this[_to] + } +} + +Edge.types = [...types] +Edge.errors = [ + 'DETACHED', + 'MISSING', + 'PEER LOCAL', + 'INVALID', +] + +module.exports = Edge diff --git a/deps/npm/node_modules/@npmcli/arborist/lib/from-path.js b/deps/npm/node_modules/@npmcli/arborist/lib/from-path.js new file mode 100644 index 00000000000000..08be583d1a49d0 --- /dev/null +++ b/deps/npm/node_modules/@npmcli/arborist/lib/from-path.js @@ -0,0 +1,13 @@ +// file dependencies need their dependencies resolved based on the +// location where the tarball was found, not the location where they +// end up getting installed. directory (ie, symlink) deps also need +// to be resolved based on their targets, but that's what realpath is + +const {dirname} = require('path') +const npa = require('npm-package-arg') + +const fromPath = (node, spec) => + spec && spec.type === 'file' ? dirname(spec.fetchSpec) + : node.realpath + +module.exports = node => fromPath(node, node.resolved && npa(node.resolved)) diff --git a/deps/npm/node_modules/@npmcli/arborist/lib/gather-dep-set.js b/deps/npm/node_modules/@npmcli/arborist/lib/gather-dep-set.js new file mode 100644 index 00000000000000..1dc9a0b188eaa4 --- /dev/null +++ b/deps/npm/node_modules/@npmcli/arborist/lib/gather-dep-set.js @@ -0,0 +1,42 @@ +// Given a set of nodes in a tree, and a filter function to test +// incoming edges to the dep set that should be ignored otherwise. +// +// find the set of deps that are only depended upon by nodes in the set, or +// their dependencies, or edges that are ignored. +// +// Used when figuring out what to prune when replacing a node with a newer +// version, or when an optional dep fails to install. + +const gatherDepSet = (set, edgeFilter) => { + const deps = new Set(set) + + // add the full set of dependencies. note that this loop will continue + // as the deps set increases in size. + for (const node of deps) { + for (const edge of node.edgesOut.values()) { + if (edge.to && edgeFilter(edge)) + deps.add(edge.to) + } + } + + // now remove all nodes in the set that have a dependant outside the set + // if any change is made, then re-check + // continue until no changes made, or deps set evaporates fully. + let changed = true + while (changed === true && deps.size > 0) { + changed = false + for (const dep of deps) { + for (const edge of dep.edgesIn) { + if (!deps.has(edge.from) && edgeFilter(edge)) { + changed = true + deps.delete(dep) + break + } + } + } + } + + return deps +} + +module.exports = gatherDepSet diff --git a/deps/npm/node_modules/@npmcli/arborist/lib/index.js b/deps/npm/node_modules/@npmcli/arborist/lib/index.js new file mode 100644 index 00000000000000..830a88a5f953ba --- /dev/null +++ b/deps/npm/node_modules/@npmcli/arborist/lib/index.js @@ -0,0 +1,6 @@ +module.exports = require('./arborist/index.js') +module.exports.Arborist = module.exports +module.exports.Node = require('./node.js') +module.exports.Link = require('./link.js') +// XXX export the other classes, too. shrinkwrap, diff, etc. +// they're handy! diff --git a/deps/npm/node_modules/@npmcli/arborist/lib/inventory.js b/deps/npm/node_modules/@npmcli/arborist/lib/inventory.js new file mode 100644 index 00000000000000..696ad25e437f4b --- /dev/null +++ b/deps/npm/node_modules/@npmcli/arborist/lib/inventory.js @@ -0,0 +1,86 @@ +// a class to manage an inventory and set of indexes of +// a set of objects based on specific fields. +// primary is the primary index key. +// keys is the set of fields to be able to query. +const _primaryKey = Symbol('_primaryKey') +const _index = Symbol('_index') +const defaultKeys = ['name', 'license', 'funding'] +class Inventory extends Map { + constructor (opt = {}) { + const { primary, keys } = opt + super() + this[_primaryKey] = primary || 'location' + this[_index] = (keys || defaultKeys).reduce((index, i) => { + index.set(i, new Map()) + return index + }, new Map()) + } + + get primaryKey () { + return this[_primaryKey] + } + + get indexes () { + return [...this[_index].keys()] + } + + * filter (fn) { + for (const node of this.values()) { + if (fn(node)) + yield node + } + } + + add (node) { + const current = super.get(node[this.primaryKey]) + if (current) { + if (current === node) + return + this.delete(current) + } + super.set(node[this.primaryKey], node) + for (const [key, map] of this[_index].entries()) { + const val_ = node[key] || (node.package && node.package[key]) + const val = typeof val_ === 'string' ? val_ + : !val_ || typeof val_ !== 'object' ? val_ + : key === 'license' ? val_.type + : key === 'funding' ? val_.url + : /* istanbul ignore next - not used */ val_ + const set = map.get(val) || new Set() + set.add(node) + map.set(val, set) + } + } + + delete (node) { + if (!this.has(node)) + return + + super.delete(node[this.primaryKey]) + for (const [key, map] of this[_index].entries()) { + const val = node[key] || (node.package && node.package[key]) + const set = map.get(val) + if (set) { + set.delete(node) + if (set.size === 0) + map.delete(node[key]) + } + } + } + + query (key, val) { + const map = this[_index].get(key) + return map && (arguments.length === 2 ? map.get(val) : map.keys()) || + new Set() + } + + has (node) { + return super.get(node[this.primaryKey]) === node + } + + set (k, v) { + throw new Error('direct set() not supported, use inventory.add(node)') + } +} + +module.exports = Inventory diff --git a/deps/npm/node_modules/@npmcli/arborist/lib/link.js b/deps/npm/node_modules/@npmcli/arborist/lib/link.js new file mode 100644 index 00000000000000..af4fac158ff0f4 --- /dev/null +++ b/deps/npm/node_modules/@npmcli/arborist/lib/link.js @@ -0,0 +1,88 @@ +const relpath = require('./relpath.js') +const Node = require('./node.js') +const _loadDeps = Symbol.for('Arborist.Node._loadDeps') +const _target = Symbol('_target') +const {dirname} = require('path') +class Link extends Node { + constructor (options) { + const { realpath, target } = options + + if (!realpath && !(target && target.path)) + throw new TypeError('must provide realpath for Link node') + + super({ + ...options, + realpath: realpath || target.path, + }) + + this.target = target || new Node({ + ...options, + path: realpath, + parent: null, + root: this.root, + linksIn: [this], + }) + + if (this.root.meta) + this.root.meta.add(this) + } + + get target () { + return this[_target] + } + + set target (target) { + const current = this[_target] + if (current && current.linksIn) + current.linksIn.delete(this) + + this[_target] = target + + if (!target) { + this.package = {} + return + } + + if (target.then) { + // can set to a promise during an async tree build operation + // wait until then to assign it. + target.then(node => this.target = node) + return + } + + this.package = target.package + + this.realpath = target.path + if (target.root === target) + target.root = this.root + target.linksIn.add(this) + } + + // a link always resolves to the relative path to its target + get resolved () { + return this.path && this.realpath + ? `file:${relpath(dirname(this.path), this.realpath)}` + : null + } + + set resolved (r) {} + + // deps are resolved on the target, not the Link + // so this is a no-op + [_loadDeps] () {} + + // links can't have children, only their targets can + // fix it to an empty list so that we can still call + // things that iterate over them, just as a no-op + get children () { + return new Map() + } + + set children (c) {} + + get isLink () { + return true + } +} + +module.exports = Link diff --git a/deps/npm/node_modules/@npmcli/arborist/lib/node.js b/deps/npm/node_modules/@npmcli/arborist/lib/node.js new file mode 100644 index 00000000000000..cc5e97f9e4b2b0 --- /dev/null +++ b/deps/npm/node_modules/@npmcli/arborist/lib/node.js @@ -0,0 +1,978 @@ +// inventory, path, realpath, root, and parent +// +// node.root is a reference to the root module in the tree (ie, typically the +// cwd project folder) +// +// node.location is the /-delimited path from the root module to the node. In +// the case of link targets that may be outside of the root's package tree, +// this can include some number of /../ path segments. The location of the +// root module is always '.'. node.location thus never contains drive letters +// or absolute paths, and is portable within a given project, suitable for +// inclusion in lockfiles and metadata. +// +// node.path is the path to the place where this node lives on disk. It is +// system-specific and absolute. +// +// node.realpath is the path to where the module actually resides on disk. In +// the case of non-link nodes, node.realpath is equivalent to node.path. In +// the case of link nodes, it is equivalent to node.target.path. +// +// Setting node.parent will set the node's root to the parent's root, as well +// as updating edgesIn and edgesOut to reload dependency resolutions as needed, +// and setting node.path to parent.path/node_modules/name. +// +// node.inventory is a Map of name to a Set() of all the nodes under a given +// root by that name. It's empty for non-root nodes, and changing the root +// reference will remove it from the old root's inventory and add it to the new +// one. This map is useful for cases like `npm update foo` or `npm ls foo` +// where we need to quickly find all instances of a given package name within a +// tree. + +const nameFromFolder = require('@npmcli/name-from-folder') +const Edge = require('./edge.js') +const Inventory = require('./inventory.js') +const {normalize} = require('read-package-json-fast') +const {getPaths: getBinPaths} = require('bin-links') +const npa = require('npm-package-arg') + +/* istanbul ignore next */ +const dassert = /\barborist\b/.test(process.env.NODE_DEBUG || '') + ? require('assert') : () => {} + +const {resolve, relative, dirname, basename} = require('path') +const _package = Symbol('_package') +const _parent = Symbol('_parent') +const _fsParent = Symbol('_fsParent') +const _reloadEdges = Symbol('_reloadEdges') +const _loadDepType = Symbol('_loadDepType') +const _loadWorkspaces = Symbol('_loadWorkspaces') +const _reloadNamedEdges = Symbol('_reloadNamedEdges') +// overridden by Link class +const _loadDeps = Symbol.for('Arborist.Node._loadDeps') +const _root = Symbol('_root') +const _refreshLocation = Symbol('_refreshLocation') +const _refreshTopMeta = Symbol('_refreshTopMeta') +const _refreshPath = Symbol('_refreshPath') +const _delistFromMeta = Symbol('_delistFromMeta') +const _global = Symbol.for('global') +const _workspaces = Symbol('_workspaces') +const _explain = Symbol('_explain') +const _explainEdge = Symbol('_explainEdge') +const _explanation = Symbol('_explanation') + +const relpath = require('./relpath.js') +const consistentResolve = require('./consistent-resolve.js') + +class Node { + constructor (options) { + // NB: path can be null if it's a link target + const { + root, + path, + realpath, + parent, + error, + meta, + fsParent, + resolved, + integrity, + // allow setting name explicitly when we haven't set a path yet + name, + children, + fsChildren, + legacyPeerDeps = false, + linksIn, + hasShrinkwrap, + extraneous = true, + dev = true, + optional = true, + devOptional = true, + peer = true, + global = false, + dummy = false, + sourceReference = null, + } = options + + // true if part of a global install + this[_global] = global + + this[_workspaces] = null + + this.errors = error ? [error] : [] + + // this will usually be null, except when modeling a + // package's dependencies in a virtual root. + this.sourceReference = sourceReference + + const pkg = sourceReference ? sourceReference.package + : normalize(options.pkg || {}) + + this.name = name || + nameFromFolder(path || pkg.name || realpath) || + pkg.name + + if (!this.name) + throw new TypeError('could not detect node name from path or package') + + // should be equal if not a link + this.path = path + this.realpath = !this.isLink ? this.path : realpath + + this.resolved = resolved || null + if (!this.resolved) { + // note: this *only* works for non-file: deps, so we avoid even + // trying here. + // file: deps are tracked in package.json will _resolved set to the + // full path to the tarball or link target. However, if the package + // is checked into git or moved to another location, that's 100% not + // portable at all! The _where and _location don't provide much help, + // since _location is just where the module ended up in the tree, + // and _where can be different than the actual root if it's a + // meta-dep deeper in the dependency graph. + // + // If we don't have the other oldest indicators of legacy npm, then it's + // probably what we're getting from pacote, which IS trustworthy. + // + // Otherwise, hopefully a shrinkwrap will help us out. + const resolved = consistentResolve(pkg._resolved) + if (resolved && !(/^file:/.test(resolved) && pkg._where)) + this.resolved = resolved + } + this.integrity = integrity || pkg._integrity || null + this.hasShrinkwrap = hasShrinkwrap || pkg._hasShrinkwrap || false + this.legacyPeerDeps = legacyPeerDeps + + this.children = new Map() + this.fsChildren = new Set() + this.inventory = new Inventory({}) + this.linksIn = new Set(linksIn || []) + + // these three are set by an Arborist taking a catalog + // after the tree is built. We don't get this along the way, + // because they have a tendency to change as new children are + // added, especially when they're deduped. Eg, a dev dep may be + // a 3-levels-deep dependency of a non-dev dep. If we calc the + // flags along the way, then they'll tend to be invalid by the + // time we need to look at them. + if (!dummy) { + this.dev = dev + this.optional = optional + this.devOptional = devOptional + this.peer = peer + this.extraneous = extraneous + this.dummy = false + } else { + // true if this is a placeholder for the purpose of serving as a + // fsParent to link targets that get their deps resolved outside + // the root tree folder. + this.dummy = true + this.dev = false + this.optional = false + this.devOptional = false + this.peer = false + this.extraneous = false + } + + this.edgesIn = new Set() + this.edgesOut = new Map() + + // only relevant for the root and top nodes + this.meta = meta + + // have to set the internal package ref before assigning the parent, + // because this.package is read when adding to inventory + this[_package] = pkg + + // Note: this is _slightly_ less efficient for the initial tree + // building than it could be, but in exchange, it's a much simpler + // algorithm. + // If this node has a bunch of children, and those children satisfy + // its various deps, then we're going to _first_ create all the + // edges, and _then_ assign the children into place, re-resolving + // them all in _reloadNamedEdges. + // A more efficient, but more complicated, approach would be to + // flag this node as being a part of a tree build, so it could + // hold off on resolving its deps until its children are in place. + + // call the parent setter + // Must be set prior to calling _loadDeps, because top-ness is relevant + + // will also assign root if present on the parent + this.parent = parent + + this[_fsParent] = null + this.fsParent = fsParent || null + + // see parent/root setters below. + // root is set to parent's root if we have a parent, otherwise if it's + // null, then it's set to the node itself. + if (!parent && !fsParent) + this.root = root || null + + if (this.isRoot) + this.location = '' + + // mostly a convenience for testing, but also a way to create + // trees in a more declarative way than setting parent on each + if (children) { + for (const c of children) + new Node({ ...c, parent: this }) + } + if (fsChildren) { + for (const c of fsChildren) + new Node({ ...c, fsParent: this }) + } + + // now load all the dep edges + this[_loadDeps]() + } + + get global () { + return this.root[_global] + } + + // true for packages installed directly in the global node_modules folder + get globalTop () { + return this.global && this.parent.isRoot + } + + get workspaces () { + return this[_workspaces] + } + + set workspaces (workspaces) { + // deletes edges if they already exists + if (this[_workspaces]) { + for (const name of this[_workspaces].keys()) { + if (!workspaces.has(name)) + this.edgesOut.get(name).detach() + } + } + + this[_workspaces] = workspaces + this[_loadWorkspaces]() + this[_loadDeps]() + } + + get binPaths () { + if (!this.parent) + return [] + + return getBinPaths({ + pkg: this[_package], + path: this.path, + global: this.global, + top: this.globalTop, + }) + } + + get hasInstallScript () { + const {hasInstallScript, scripts} = this.package + const {install, preinstall, postinstall} = scripts || {} + return !!(hasInstallScript || install || preinstall || postinstall) + } + + get version () { + return this[_package].version || '' + } + + get pkgid () { + const { name = '', version = '' } = this.package + // root package will prefer package name over folder name, + // and never be called an alias. + const myname = this.isRoot ? name || this.name : this.name + const alias = !this.isRoot && name && myname !== name ? `npm:${name}@` : '' + return `${myname}@${alias}${version}` + } + + get package () { + return this[_package] + } + + set package (pkg) { + // just detach them all. we could make this _slightly_ more efficient + // by only detaching the ones that changed, but we'd still have to walk + // them all, and the comparison logic gets a bit tricky. we generally + // only do this more than once at the root level, so the resolve() calls + // are only one level deep, and there's not much to be saved, anyway. + // simpler to just toss them all out. + for (const edge of this.edgesOut.values()) + edge.detach() + + this[_explanation] = null + this[_package] = pkg + this[_loadWorkspaces]() + this[_loadDeps]() + // do a hard reload, since the dependents may now be valid or invalid + // as a result of the package change. + this.edgesIn.forEach(edge => edge.reload(true)) + } + + // node.explain(nodes seen already, edge we're trying to satisfy + // if edge is not specified, it lists every edge into the node. + explain (edge = null, seen = []) { + if (this[_explanation]) + return this[_explanation] + + return this[_explanation] = this[_explain](edge, seen) + } + + [_explain] (edge, seen) { + if (this.isRoot && !this.sourceReference) { + return { + location: this.path, + } + } + + const why = { + name: this.isRoot ? this.package.name : this.name, + version: this.package.version, + } + if (this.errors.length || !this.package.name || !this.package.version) { + why.errors = this.errors.length ? this.errors : [ + new Error('invalid package: lacks name and/or version'), + ] + why.package = this.package + } + + if (this.root.sourceReference) { + const {name, version} = this.root.package + why.whileInstalling = { + name, + version, + } + if (edge) + this[_explainEdge](edge, seen) + } + + if (this.sourceReference) + return this.sourceReference.explain(edge, seen) + + if (seen.includes(this)) + return why + + why.location = this.location + + // make a new list each time. we can revisit, but not loop. + seen = seen.concat(this) + + why.dependents = [] + if (edge) + why.dependents.push(this[_explainEdge](edge, seen)) + else { + // if we have an edge from the root, just show that, and stop there + // no need to go deeper, because it doesn't provide much more value. + const edges = [] + for (const edge of this.edgesIn) { + if (!edge.valid && !edge.from.isRoot) + continue + + if (edge.from.isRoot) { + edges.length = 0 + edges.push(edge) + break + } + + edges.push(edge) + } + for (const edge of edges) + why.dependents.push(this[_explainEdge](edge, seen)) + } + return why + } + + // return the edge data, and an explanation of how that edge came to be here + [_explainEdge] (edge, seen) { + return { + type: edge.type, + spec: edge.spec, + ...(edge.error ? { error: edge.error } : {}), + from: edge.from.explain(null, seen), + } + } + + isDescendantOf (node) { + for (let p = this; p; p = p.parent) { + if (p === node) + return true + } + return false + } + + getBundler (path = []) { + // made a cycle, definitely not bundled! + if (path.includes(this)) + return null + + path.push(this) + + const parent = this[_parent] + if (!parent) + return null + + const pBundler = parent.getBundler(path) + if (pBundler) + return pBundler + + const ppkg = parent.package + const bd = ppkg && ppkg.bundleDependencies + // explicit bundling + if (Array.isArray(bd) && bd.includes(this.name)) + return parent + + // deps that are deduped up to the bundling level are bundled. + // however, if they get their dep met further up than that, + // then they are not bundled. Ie, installing a package with + // unmet bundled deps will not cause your deps to be bundled. + for (const edge of this.edgesIn) { + const eBundler = edge.from.getBundler(path) + if (!eBundler) + continue + + if (eBundler === parent) + return eBundler + } + + return null + } + + get inBundle () { + return !!this.getBundler() + } + + // when reifying, if a package is technically in a bundleDependencies list, + // but that list is the root project, we still have to install it. This + // getter returns true if it's in a dependency's bundle list, not the root's. + get inDepBundle () { + const bundler = this.getBundler() + return !!bundler && bundler !== this.root + } + + get isRoot () { + return this === this.root + } + + set root (root) { + const nullRoot = root === null + if (nullRoot) + root = this + else { + // should only ever be 1 step + while (root.root !== root) + root = root.root + } + + if (root === this.root) + return + + this[_delistFromMeta]() + this[_root] = root + this[_refreshLocation]() + + if (this.top.meta) + this[_refreshTopMeta]() + + if (this.target && !nullRoot) + this.target.root = root + + this.fsChildren.forEach(c => c.root = root) + this.children.forEach(c => c.root = root) + /* istanbul ignore next */ + dassert(this === root || this.inventory.size === 0) + } + + get root () { + return this[_root] || this + } + + [_loadWorkspaces] () { + if (!this[_workspaces]) return + + for (const [name, path] of this[_workspaces].entries()) + new Edge({ from: this, name, spec: `file:${path}`, type: 'workspace' }) + } + + [_loadDeps] () { + // Caveat! Order is relevant! + // packages in optionalDependencies and prod/peer/dev are + // optional. Packages in both deps and devDeps are required. + // Note the subtle breaking change from v6: it is no longer possible + // to have a different spec for a devDep than production dep. + this[_loadDepType](this.package.optionalDependencies, 'optional') + this[_loadDepType](this.package.dependencies, 'prod') + + const pd = this.package.peerDependencies + if (pd && typeof pd === 'object' && !this.legacyPeerDeps) { + const pm = this.package.peerDependenciesMeta || {} + const peerDependencies = {} + const peerOptional = {} + for (const [name, dep] of Object.entries(pd)) { + if (pm[name] && pm[name].optional) + peerOptional[name] = dep + else + peerDependencies[name] = dep + } + this[_loadDepType](peerDependencies, 'peer') + this[_loadDepType](peerOptional, 'peerOptional') + } + + // Linked targets that are disconnected from the tree are tops, + // but don't have a 'path' field, only a 'realpath', because we + // don't know their canonical location. We don't need their devDeps. + if (this.isTop && this.path) + this[_loadDepType](this.package.devDependencies, 'dev') + } + + [_loadDepType] (obj, type) { + const from = this + const ad = this.package.acceptDependencies || {} + for (const [name, spec] of Object.entries(obj || {})) { + const accept = ad[name] + // if it's already set, then we keep the existing edge + // NB: the Edge ctor adds itself to from.edgesOut + if (!this.edgesOut.get(name)) + new Edge({ from, name, spec, accept, type }) + } + } + + get fsParent () { + return this[_fsParent] + } + + set fsParent (fsParent) { + fsParent = fsParent || null + + if (this[_fsParent] === fsParent) + return + + const current = this[_fsParent] + if (current) + current.fsChildren.delete(this) + + if (!fsParent) { + this[_fsParent] = null + // reload ALL edges, since they're now all suspect and likely invalid + this[_reloadEdges](e => true) + return + } + + // prune off the original location, so we don't leave edges lying around + if (current) + this.fsParent = null + + const fspp = fsParent.realpath + const nmPath = resolve(fspp, 'node_modules', this.name) + // actually in the node_modules folder! this can happen when a link + // points deep within a node_modules folder, so that the target node + // is loaded before its parent. + if (nmPath === this.path) { + this[_fsParent] = null + this.parent = fsParent + return + } + + // ok! have a pseudo-parent, meaning that we're contained in + // the parent node's fs tree, but NOT in its node_modules folder. + // Almost certainly due to being a linked workspace-style package. + this[_fsParent] = fsParent + fsParent.fsChildren.add(this) + // refresh the path BEFORE setting root, so meta gets updated properly + this[_refreshPath](fsParent, current && current.path) + this.root = fsParent.root + this[_reloadEdges](e => !e.to) + } + + // called when we find that we have an fsParent which could account + // for some missing edges which are actually fine and not missing at all. + [_reloadEdges] (filter) { + this[_explanation] = null + this.edgesOut.forEach(edge => filter(edge) && edge.reload()) + this.fsChildren.forEach(c => c[_reloadEdges](filter)) + this.children.forEach(c => c[_reloadEdges](filter)) + } + + // is it safe to replace one node with another? check the edges to + // make sure no one will get upset. Note that the node might end up + // having its own unmet dependencies, if the new node has new deps. + // Note that there are cases where Arborist will opt to insert a node + // into the tree even though this function returns false! This is + // necessary when a root dependency is added or updated, or when a + // root dependency brings peer deps along with it. In that case, we + // will go ahead and create the invalid state, and then try to resolve + // it with more tree construction, because it's a user request. + canReplaceWith (node) { + if (node.name !== this.name) + return false + + for (const edge of this.edgesIn) { + if (!edge.satisfiedBy(node)) + return false + } + + return true + } + + canReplace (node) { + return node.canReplaceWith(this) + } + + satisfies (requested) { + if (requested instanceof Edge) + return this.name === requested.name && requested.satisfiedBy(this) + + const parsed = npa(requested) + const { name = this.name, rawSpec: spec } = parsed + return this.name === name && this.satisfies(new Edge({ + from: new Node({ path: this.root.path }), + type: 'prod', + name, + spec, + })) + } + + matches (node) { + // if the nodes are literally the same object, obviously a match. + if (node === this) + return true + + // if the names don't match, they're different things, even if + // the package contents are identical. + if (node.name !== this.name) + return false + + // if they're links, they match if the targets match + if (this.isLink) + return node.isLink && this.target.matches(node.target) + + // if they're two root nodes, they're different if the paths differ + if (this.isRoot && node.isRoot) + return this.path === node.path + + // if the integrity matches, then they're the same. + if (this.integrity && node.integrity) + return this.integrity === node.integrity + + // if no integrity, check resolved + if (this.resolved && node.resolved) + return this.resolved === node.resolved + + // if no resolved, check both package name and version + // otherwise, conclude that they are different things + return this.package.name && node.package.name && + this.package.name === node.package.name && + this.version && node.version && + this.version === node.version + } + + // replace this node with the supplied argument + // Useful when mutating an ideal tree, so we can avoid having to call + // the parent/root setters more than necessary. + replaceWith (node) { + node.path = this.path + node.name = this.name + if (!node.isLink) + node.realpath = this.path + node.root = this.isRoot ? node : this.root + // pretend to be in the tree, so top/etc refs are not changing for kids. + node.parent = null + node[_parent] = this[_parent] + this.fsChildren.forEach(c => c.fsParent = node) + this.children.forEach(c => c.parent = node) + // now remove the hidden reference, and call parent setter to finalize. + node[_parent] = null + node.parent = this.parent + } + + replace (node) { + node.replaceWith(this) + } + + get inShrinkwrap () { + return this.parent && (this.parent.hasShrinkwrap || this.parent.inShrinkwrap) + } + + get parent () { + return this[_parent] + } + + // This setter keeps everything in order when we move a node from + // one point in a logical tree to another. Edges get reloaded, + // metadata updated, etc. It's also called when we *replace* a node + // with another by the same name (eg, to update or dedupe). + // This does a couple of walks out on the node_modules tree, recursing + // into child nodes. However, as setting the parent is typically done + // with nodes that don't have have many children, and (deduped) package + // trees tend to be broad rather than deep, it's not that bad. + // The only walk that starts from the parent rather than this node is + // limited by edge name. + set parent (parent) { + const oldParent = this[_parent] + + // link nodes can't contain children directly. + // children go under the link target. + if (parent) { + if (parent.isLink) + parent = parent.target + + if (oldParent === parent) + return + } + + // ok now we know something is actually changing, and parent is not a link + + // check to see if the location is going to change. + // we can skip some of the inventory/meta stuff if not. + const newPath = parent ? resolve(parent.path, 'node_modules', this.name) + : this.path + const pathChange = newPath !== this.path + const newTop = parent ? parent.top : this + const topChange = newTop !== this.top + const newRoot = parent ? parent.root : null + const rootChange = newRoot !== this.root + + // if the path, top, or root are changing, then we need to delist + // from metadata and inventory where this module (and its children) + // are currently tracked. Need to do this BEFORE updating the + // path and setting node.root. We don't have to do this for node.target, + // because its path isn't changing, so everything we need will happen + // safely when we set this.root = parent.root. + if (this.path && (pathChange || topChange || rootChange)) { + this[_delistFromMeta]() + // delisting method doesn't walk children by default, since it would + // be excessive to do so when changing the root reference, as a + // root change walks children changing root as well. But in this case, + // we are about to change the parent, and thus the top, so we have + // to delist from the metadata now to ensure we remove it from the + // proper top node metadata if it isn't the root. + this.fsChildren.forEach(c => c[_delistFromMeta]()) + this.children.forEach(c => c[_delistFromMeta]()) + } + + // remove from former parent. + if (oldParent) + oldParent.children.delete(this.name) + + // update internal link. at this point, the node is actually in + // the new location in the tree, but the paths are not updated yet. + this[_parent] = parent + + // remove former child. calls back into this setter to unlist + if (parent) { + const oldChild = parent.children.get(this.name) + if (oldChild) + oldChild.parent = null + + parent.children.set(this.name, this) + } + + // this is the point of no return. this.location is no longer valid, + // and this.path is no longer going to reference this node in the + // inventory or shrinkwrap metadata. + if (parent) + this[_refreshPath](parent, oldParent && oldParent.path) + + // call the root setter. this updates this.location, and sets the + // root on all children, and this.target if this is a link. + // if the root isn't changing, then this is a no-op. + // the root setter is a no-op if the root didn't change, so we have + // to manually call the method to update location and metadata + if (!rootChange) + this[_refreshLocation]() + else + this.root = newRoot + + // if the new top is not the root, and it has meta, then we're updating + // nodes within a link target's folder. update it now. + if (newTop !== newRoot && newTop.meta) + this[_refreshTopMeta]() + + // refresh dep links + // note that this is _also_ done when a node is removed from the + // tree by setting parent=null, so deduplication is covered. + this.edgesIn.forEach(edge => edge.reload()) + this.edgesOut.forEach(edge => edge.reload()) + + // in case any of the parent's other descendants were resolving to + // a different instance of this package, walk the tree from that point + // reloading edges by this name. This only walks until it stops finding + // changes, so if there's a portion of the tree blocked by a different + // instance, or already updated by the previous in/out reloading, it won't + // needlessly re-resolve deps that won't need to be changed. + if (parent) + parent[_reloadNamedEdges](this.name, true) + + // since loading a parent can add *or change* resolutions, we also + // walk the tree from this point reloading all edges. + this[_reloadEdges](e => true) + + // have to refresh the location of children and fsChildren at this point, + // because their paths have likely changed, and root may have been set. + if (!rootChange) { + this.children.forEach(c => c[_refreshLocation]()) + this.fsChildren.forEach(c => c[_refreshLocation]()) + } + } + + // called after changing the parent (and thus the top), and after changing + // the path, if the top is tracking metadata, so that we update the top's + // metadata with the new node. Note that we DON'T walk fsChildren here, + // because they do not share our top node. + [_refreshTopMeta] () { + this.top.meta.add(this) + this.children.forEach(c => c[_refreshTopMeta]()) + } + + // Call this before changing path or updating the _root reference. + // Removes the node from all the metadata trackers where it might live. + [_delistFromMeta] () { + const top = this.top + const root = this.root + + root.inventory.delete(this) + if (root.meta) + root.meta.delete(this.path) + + // need to also remove from the top meta if that's set. but, we only do + // that if the top is not the same as the root, or else we'll remove it + // twice unnecessarily. If the top and this have different roots, then + // that means we're in the process of changing this.parent, which sets the + // internal _parent reference BEFORE setting the root node, because paths + // need to be set up before assigning root. In that case, don't delist, + // or else we'll delete the metadata before we have a chance to apply it. + if (top.meta && top !== root && top.root === this.root) + top.meta.delete(this.path) + } + + // recurse through the tree updating path when it changes. + // called by the parent and fsParent setters. + [_refreshPath] (parent, fromPath = null) { + const ppath = parent.path + const relPath = typeof fromPath === 'string' + ? relative(fromPath, this.path) + : null + const oldPath = this.path + const newPath = relPath !== null ? resolve(ppath, relPath) + : parent === this[_parent] ? resolve(ppath, 'node_modules', this.name) + // fsparent initial assignment, nothing to update here + : oldPath + + // if no change, nothing to do! + if (newPath === oldPath) + return + + this[_delistFromMeta]() + this.path = newPath + if (!this.isLink) { + this.realpath = this.path + if (this.linksIn.size) { + for (const link of this.linksIn) + link.realpath = newPath + } + } + + this[_refreshLocation]() + this.fsChildren.forEach(c => c[_refreshPath](this, oldPath)) + this.children.forEach(c => c[_refreshPath](this, oldPath)) + } + + // Called whenever the root/parent is changed. + // NB: need to remove from former root's meta/inventory and then update + // this.path BEFORE calling this method! + [_refreshLocation] () { + const root = this.root + this.location = relpath(root.realpath, this.path) + + root.inventory.add(this) + if (root.meta) + root.meta.add(this) + } + + addEdgeOut (edge) { + this.edgesOut.set(edge.name, edge) + } + + addEdgeIn (edge) { + this.edgesIn.add(edge) + + // try to get metadata from the yarn.lock file + if (this.root.meta) + this.root.meta.addEdge(edge) + } + + [_reloadNamedEdges] (name, root) { + // either it's the node in question, or it's going to block it anyway + if (this.name === name && !this.isTop) { + // reload the edges in so that anything that SHOULD be blocked + // by this node actually will be. + this.edgesIn.forEach(e => e.reload()) + return + } + + const edge = this.edgesOut.get(name) + // if we don't have an edge, do nothing, but keep descending + if (edge) { + const toBefore = edge.to + edge.reload() + const toAfter = edge.to + if (toBefore === toAfter && !root) { + // nothing changed, we're done here. either it was already + // referring to this node (due to its edgesIn reloads), or + // it is blocked by another node in the tree. So either its children + // have already been updated, or don't need to be. + // + // but: always descend past the _first_ node, because it's likely + // that this is being triggered by this node getting a new child, + // so the whole point is to update the rest of the family. + return + } + } + for (const c of this.children.values()) + c[_reloadNamedEdges](name) + + for (const c of this.fsChildren) + c[_reloadNamedEdges](name) + } + + get isLink () { + return false + } + + get depth () { + return this.isTop ? 0 : this.parent.depth + 1 + } + + get isTop () { + return !this.parent + } + + get top () { + return this.isTop ? this : this.parent.top + } + + get resolveParent () { + return this.parent || this.fsParent + } + + resolve (name) { + const mine = this.children.get(name) + if (mine) + return mine + const resolveParent = this.resolveParent + if (resolveParent) + return resolveParent.resolve(name) + return null + } + + inNodeModules () { + const rp = this.realpath + const name = this.name + const scoped = name.charAt(0) === '@' + const d = dirname(rp) + const nm = scoped ? dirname(d) : d + const dir = dirname(nm) + const base = scoped ? `${basename(d)}/${basename(rp)}` : basename(rp) + return base === name && basename(nm) === 'node_modules' ? dir : false + } +} + +module.exports = Node diff --git a/deps/npm/node_modules/@npmcli/arborist/lib/optional-set.js b/deps/npm/node_modules/@npmcli/arborist/lib/optional-set.js new file mode 100644 index 00000000000000..9472158bc44be9 --- /dev/null +++ b/deps/npm/node_modules/@npmcli/arborist/lib/optional-set.js @@ -0,0 +1,36 @@ +// when an optional dep fails to install, we need to remove the branch of the +// graph up to the first optionalDependencies, as well as any nodes that are +// only required by other nodes in the set. +// +// This function finds the set of nodes that will need to be removed in that +// case. +// +// Note that this is *only* going to work with trees where calcDepFlags +// has been called, because we rely on the node.optional flag. + +const gatherDepSet = require('./gather-dep-set.js') +const optionalSet = node => { + if (!node.optional) + return new Set() + + // start with the node, then walk up the dependency graph until we + // get to the boundaries that define the optional set. since the + // node is optional, we know that all paths INTO this area of the + // graph are optional, but there may be non-optional dependencies + // WITHIN the area. + const set = new Set([node]) + for (const node of set) { + for (const edge of node.edgesIn) { + if (!edge.optional) + set.add(edge.from) + } + } + + // now that we've hit the boundary, gather the rest of the nodes in + // the optional section. that's the set of dependencies that are only + // depended upon by other nodes within the set, or optional dependencies + // from outside the set. + return gatherDepSet(set, edge => !edge.optional) +} + +module.exports = optionalSet diff --git a/deps/npm/node_modules/@npmcli/arborist/lib/peer-set.js b/deps/npm/node_modules/@npmcli/arborist/lib/peer-set.js new file mode 100644 index 00000000000000..727814e1de3f09 --- /dev/null +++ b/deps/npm/node_modules/@npmcli/arborist/lib/peer-set.js @@ -0,0 +1,25 @@ +// when we have to dupe a set of peer dependencies deeper into the tree in +// order to make room for a dep that would otherwise conflict, we use +// this to get the set of all deps that have to be checked to ensure +// nothing is locking them into the current location. +// +// this is different in its semantics from an "optional set" (ie, the nodes +// that should be removed if an optional dep fails), because in this case, +// we specifically intend to include deps in the peer set that have +// dependants outside the set. +const peerSet = node => { + const set = new Set([node]) + for (const node of set) { + for (const edge of node.edgesOut.values()) { + if (edge.valid && edge.peer && edge.to) + set.add(edge.to) + } + for (const edge of node.edgesIn) { + if (edge.valid && edge.peer) + set.add(edge.from) + } + } + return set +} + +module.exports = peerSet diff --git a/deps/npm/node_modules/@npmcli/arborist/lib/proc-log.js b/deps/npm/node_modules/@npmcli/arborist/lib/proc-log.js new file mode 100644 index 00000000000000..52e0e466798ee0 --- /dev/null +++ b/deps/npm/node_modules/@npmcli/arborist/lib/proc-log.js @@ -0,0 +1,21 @@ +// default logger. +// emits 'log' events on the process +const LEVELS = [ + 'notice', + 'error', + 'warn', + 'info', + 'verbose', + 'http', + 'silly', + 'pause', + 'resume', +] + +const log = level => (...args) => process.emit('log', level, ...args) + +const logger = {} +for (const level of LEVELS) + logger[level] = log(level) + +module.exports = logger diff --git a/deps/npm/node_modules/read-package-tree/realpath.js b/deps/npm/node_modules/@npmcli/arborist/lib/realpath.js similarity index 94% rename from deps/npm/node_modules/read-package-tree/realpath.js rename to deps/npm/node_modules/@npmcli/arborist/lib/realpath.js index 70c666064ec894..fa467c097a60b7 100644 --- a/deps/npm/node_modules/read-package-tree/realpath.js +++ b/deps/npm/node_modules/@npmcli/arborist/lib/realpath.js @@ -6,8 +6,7 @@ // so we can handle many fewer edge cases. const fs = require('fs') -/* istanbul ignore next */ -const promisify = require('util').promisify || require('util-promisify') +const promisify = require('util').promisify const readlink = promisify(fs.readlink) const lstat = promisify(fs.lstat) const { resolve, basename, dirname } = require('path') @@ -77,9 +76,8 @@ const realpathChild = (dir, base, rpcache, stcache, depth) => { return realish } - let res return readlink(realish).then(target => { - const resolved = res = resolve(realdir, target) + const resolved = resolve(realdir, target) if (realish === resolved) throw eloop(realish) diff --git a/deps/npm/node_modules/@npmcli/arborist/lib/relpath.js b/deps/npm/node_modules/@npmcli/arborist/lib/relpath.js new file mode 100644 index 00000000000000..33e12ff6f6ca8a --- /dev/null +++ b/deps/npm/node_modules/@npmcli/arborist/lib/relpath.js @@ -0,0 +1,3 @@ +const {relative} = require('path') +const relpath = (from, to) => relative(from, to).replace(/\\/g, '/') +module.exports = relpath diff --git a/deps/npm/node_modules/@npmcli/arborist/lib/retire-path.js b/deps/npm/node_modules/@npmcli/arborist/lib/retire-path.js new file mode 100644 index 00000000000000..a6ce867d78940a --- /dev/null +++ b/deps/npm/node_modules/@npmcli/arborist/lib/retire-path.js @@ -0,0 +1,19 @@ +const crypto = require('crypto') +const {dirname, basename, resolve} = require('path') + +// use sha1 because it's faster, and collisions extremely unlikely anyway +const pathSafeHash = s => + crypto.createHash('sha1') + .update(s) + .digest('base64') + .replace(/[^a-zA-Z0-9]+/g, '') + .substr(0, 8) + +const retirePath = from => { + const d = dirname(from) + const b = basename(from) + const hash = pathSafeHash(from) + return resolve(d, `.${b}-${hash}`) +} + +module.exports = retirePath diff --git a/deps/npm/node_modules/@npmcli/arborist/lib/shrinkwrap.js b/deps/npm/node_modules/@npmcli/arborist/lib/shrinkwrap.js new file mode 100644 index 00000000000000..74d14a8e735c19 --- /dev/null +++ b/deps/npm/node_modules/@npmcli/arborist/lib/shrinkwrap.js @@ -0,0 +1,939 @@ +// a module that manages a shrinkwrap file (npm-shrinkwrap.json or +// package-lock.json). + +// Increment whenever the lockfile version updates +// v1 - npm <=6 +// v2 - arborist v1, npm v7, backwards compatible with v1, add 'packages' +// v3 will drop the 'dependencies' field, backwards comp with v2, not v1 +// +// We cannot bump to v3 until npm v6 is out of common usage, and +// definitely not before npm v8. + +const lockfileVersion = 2 + +// for comparing nodes to yarn.lock entries +const mismatch = (a, b) => a && b && a !== b + +// this.tree => the root node for the tree (ie, same path as this) +// - Set the first time we do `this.add(node)` for a path matching this.path +// +// this.add(node) => +// - decorate the node with the metadata we have, if we have it, and it matches +// - add to the map of nodes needing to be committed, so that subsequent +// changes are captured when we commit that location's metadata. +// +// this.commit() => +// - commit all nodes awaiting update to their metadata entries +// - re-generate this.data and this.yarnLock based on this.tree +// +// Note that between this.add() and this.commit(), `this.data` will be out of +// date! Always call `commit()` before relying on it. +// +// After calling this.commit(), any nodes not present in the tree will have +// been removed from the shrinkwrap data as well. + +const YarnLock = require('./yarn-lock.js') +const {promisify} = require('util') +const rimraf = promisify(require('rimraf')) +const fs = require('fs') +const readFile = promisify(fs.readFile) +const writeFile = promisify(fs.writeFile) +const stat = promisify(fs.stat) +const readdir = promisify(fs.readdir) +const { resolve, basename } = require('path') +const specFromLock = require('./spec-from-lock.js') +const versionFromTgz = require('./version-from-tgz.js') +const npa = require('npm-package-arg') +const rpj = require('read-package-json-fast') +const parseJSON = require('parse-conflict-json') + +const stringify = require('json-stringify-nice') +const swKeyOrder = [ + 'name', + 'version', + 'lockfileVersion', + 'resolved', + 'integrity', + 'requires', + 'packages', + 'dependencies', +] + +// sometimes resolved: is weird or broken, or something npa can't handle +const specFromResolved = resolved => { + try { + return npa(resolved) + } catch (er) { + return {} + } +} + +const relpath = require('./relpath.js') + +const consistentResolve = require('./consistent-resolve.js') + +const maybeReadFile = file => { + return readFile(file, 'utf8').then(d => d, er => { + /* istanbul ignore else - can't test without breaking module itself */ + if (er.code === 'ENOENT') + return '' + else + throw er + }) +} + +const maybeStatFile = file => { + return stat(file).then(st => st.isFile(), er => { + /* istanbul ignore else - can't test without breaking module itself */ + if (er.code === 'ENOENT') + return null + else + throw er + }) +} + +const pkgMetaKeys = [ + // note: name is included if necessary, for alias packages + 'version', + 'dependencies', + 'peerDependencies', + 'peerDependenciesMeta', + 'optionalDependencies', + 'bundleDependencies', + 'acceptDependencies', + 'funding', + 'engines', + 'os', + 'cpu', + '_integrity', + 'license', + '_hasShrinkwrap', + 'hasInstallScript', + 'bin', + 'deprecated', + 'workspaces', +] + +const nodeMetaKeys = [ + 'integrity', + 'inBundle', + 'hasShrinkwrap', + 'hasInstallScript', +] + +const metaFieldFromPkg = (pkg, key) => { + const val = pkg[key] + // get the license type, not an object + return (key === 'license' && val && typeof val === 'object' && val.type) + ? val.type + // skip empty objects and falsey values + : (val && !(typeof val === 'object' && !Object.keys(val).length)) ? val + : null +} + +// check to make sure that there are no packages newer than the hidden lockfile +const assertNoNewer = async (path, data, lockTime, dir = path, seen = null) => { + const base = basename(dir) + const isNM = dir !== path && base === 'node_modules' + const isScope = dir !== path && !isNM && base.charAt(0) === '@' + const isParent = dir === path || isNM || isScope + + const rel = relpath(path, dir) + if (dir !== path) { + const dirTime = (await stat(dir)).mtime + if (dirTime > lockTime) + throw 'out of date, updated: ' + rel + if (!isScope && !isNM && !data.packages[rel]) + throw 'missing from lockfile: ' + rel + seen.add(rel) + } else + seen = new Set([rel]) + + const parent = isParent ? dir : resolve(dir, 'node_modules') + const children = dir === path + ? Promise.resolve([{name: 'node_modules', isDirectory: () => true }]) + : readdir(parent, { withFileTypes: true }) + + return children.catch(() => []) + .then(ents => Promise.all( + ents.filter(ent => ent.isDirectory() && !/^\./.test(ent.name)) + .map(ent => assertNoNewer(path, data, lockTime, resolve(parent, ent.name), seen)) + )).then(() => { + if (dir !== path) + return + + // assert that all the entries in the lockfile were seen + for (const loc of new Set(Object.keys(data.packages))) { + if (!seen.has(loc)) + throw 'missing from node_modules: ' + loc + } + }) +} + +const _awaitingUpdate = Symbol('_awaitingUpdate') +const _updateWaitingNode = Symbol('_updateWaitingNode') +const _lockFromLoc = Symbol('_lockFromLoc') +const _pathToLoc = Symbol('_pathToLoc') +const _loadAll = Symbol('_loadAll') +const _metaFromLock = Symbol('_metaFromLock') +const _resolveMetaNode = Symbol('_resolveMetaNode') +const _fixDependencies = Symbol('_fixDependencies') +const _buildLegacyLockfile = Symbol('_buildLegacyLockfile') +const _filenameSet = Symbol('_filenameSet') +const _maybeRead = Symbol('_maybeRead') +const _maybeStat = Symbol('_maybeStat') +class Shrinkwrap { + static load (options) { + return new Shrinkwrap(options).load() + } + + static get keyOrder () { + return swKeyOrder + } + + static reset (options) { + // still need to know if it was loaded from the disk, but don't + // bother reading it if we're gonna just throw it away. + const s = new Shrinkwrap(options) + s.reset() + + return s[_maybeStat]().then(([sw, lock]) => { + s.filename = resolve(s.path, + (s.hiddenLockfile ? 'node_modules/.package-lock' + : s.shrinkwrapOnly || sw && !lock ? 'npm-shrinkwrap' + : 'package-lock') + '.json') + s.loadedFromDisk = sw || lock + s.type = basename(s.filename) + return s + }) + } + + static metaFromNode (node, path) { + if (node.isLink) { + return { + resolved: relpath(path, node.realpath), + link: true, + } + } + + const meta = {} + pkgMetaKeys.forEach(key => { + const val = metaFieldFromPkg(node.package, key) + if (val) + meta[key.replace(/^_/, '')] = val + }) + // we only include name if different from the node path name + const pname = node.package.name + if (pname && pname !== node.name) + meta.name = pname + + if (node.isTop && node.package.devDependencies) + meta.devDependencies = node.package.devDependencies + + nodeMetaKeys.forEach(key => { + if (node[key]) + meta[key] = node[key] + }) + + const resolved = consistentResolve(node.resolved, node.path, path, true) + if (resolved) + meta.resolved = resolved + + if (node.extraneous) + meta.extraneous = true + else { + if (node.peer) + meta.peer = true + if (node.dev) + meta.dev = true + if (node.optional) + meta.optional = true + if (node.devOptional && !node.dev && !node.optional) + meta.devOptional = true + } + return meta + } + + constructor (options = {}) { + const { + path, + indent = 2, + newline = '\n', + shrinkwrapOnly = false, + hiddenLockfile = false, + } = options + this[_awaitingUpdate] = new Map() + this.tree = null + this.path = resolve(path || '.') + this.filename = null + this.data = null + this.indent = indent + this.newline = newline + this.loadedFromDisk = false + this.type = null + this.yarnLock = null + this.hiddenLockfile = hiddenLockfile + this.loadingError = null + // only load npm-shrinkwrap.json in dep trees, not package-lock + this.shrinkwrapOnly = shrinkwrapOnly + } + + // check to see if a spec is present in the yarn.lock file, and if so, + // if we should use it, and what it should resolve to. This is only + // done when we did not load a shrinkwrap from disk. Also, decorate + // the options object if provided with the resolved and integrity that + // we expect. + checkYarnLock (spec, options = {}) { + spec = npa(spec) + const { yarnLock, loadedFromDisk } = this + const useYarnLock = yarnLock && !loadedFromDisk + const fromYarn = useYarnLock && yarnLock.entries.get(spec.raw) + if (fromYarn && fromYarn.version) { + // if it's the yarn or npm default registry, use the version as + // our effective spec. if it's any other kind of thing, use that. + const yarnRegRe = /^https?:\/\/registry.yarnpkg.com\// + const npmRegRe = /^https?:\/\/registry.npmjs.org\// + const {resolved, version, integrity} = fromYarn + const isYarnReg = spec.registry && yarnRegRe.test(resolved) + const isnpmReg = spec.registry && !isYarnReg && npmRegRe.test(resolved) + const isReg = isnpmReg || isYarnReg + // don't use the simple version if the "registry" url is + // something else entirely! + const tgz = isReg && versionFromTgz(spec.name, resolved) || {} + const yspec = tgz.name === spec.name && tgz.version === version ? version + : isReg && tgz.name && tgz.version ? `npm:${tgz.name}@${tgz.version}` + : resolved + if (yspec) { + options.resolved = resolved.replace(yarnRegRe, 'https://registry.npmjs.org/') + options.integrity = integrity + return npa(`${spec.name}@${yspec}`) + } + } + return spec + } + + // throw away the shrinkwrap data so we can start fresh + // still worth doing a load() first so we know which files to write. + reset () { + this.tree = null + this[_awaitingUpdate] = new Map() + this.data = { + lockfileVersion, + requires: true, + packages: {}, + dependencies: {}, + } + } + + [_filenameSet] () { + return this.shrinkwrapOnly ? [ + this.path + '/npm-shrinkwrap.json', + ] : this.hiddenLockfile ? [ + null, + this.path + '/node_modules/.package-lock.json', + ] : [ + this.path + '/npm-shrinkwrap.json', + this.path + '/package-lock.json', + this.path + '/yarn.lock', + ] + } + + [_maybeRead] () { + return Promise.all(this[_filenameSet]().map(fn => fn && maybeReadFile(fn))) + } + + [_maybeStat] () { + // throw away yarn, we only care about lock or shrinkwrap when checking + // this way, since we're not actually loading the full lock metadata + return Promise.all(this[_filenameSet]().slice(0, 2) + .map(fn => fn && maybeStatFile(fn))) + } + + load () { + // we don't need to load package-lock.json except for top of tree nodes, + // only npm-shrinkwrap.json. + return this[_maybeRead]().then(([sw, lock, yarn]) => { + const data = lock || sw || '' + + // use shrinkwrap only for deps, otherwise prefer package-lock + // and ignore npm-shrinkwrap if both are present. + // TODO: emit a warning here or something if both are present. + this.filename = resolve(this.path, + (this.hiddenLockfile ? 'node_modules/.package-lock' + : this.shrinkwrapOnly || sw && !lock ? 'npm-shrinkwrap' + : 'package-lock') + '.json') + + this.type = basename(this.filename) + this.loadedFromDisk = !!data + + if (yarn) { + this.yarnLock = new YarnLock() + // ignore invalid yarn data. we'll likely clobber it later anyway. + try { + this.yarnLock.parse(yarn) + } catch (_) {} + } + + return data ? parseJSON(data) : {} + }).then(async data => { + // don't use detect-indent, just pick the first line. + // if the file starts with {" then we have an indent of '', ie, none + // which will default to 2 at save time. + const { + [Symbol.for('indent')]: indent, + [Symbol.for('newline')]: newline, + } = data + this.indent = indent !== undefined ? indent : this.indent + this.newline = newline !== undefined ? newline : this.newline + + if (!this.hiddenLockfile || !data.packages) + return data + + // add a few ms just to account for jitter + const lockTime = +(await stat(this.filename)).mtime + 10 + await assertNoNewer(this.path, data, lockTime) + + // all good! hidden lockfile is the newest thing in here. + return data + }).catch(er => { + this.loadingError = er + this.loadedFromDisk = false + this.ancientLockfile = false + return {} + }).then(lock => { + this.data = { + ...lock, + lockfileVersion, + requires: true, + packages: lock.packages || {}, + ...(this.hiddenLockfile ? {} : {dependencies: lock.dependencies || {}}), + } + this.originalLockfileVersion = lock.lockfileVersion + this.ancientLockfile = this.loadedFromDisk && + !(lock.lockfileVersion >= 2) && !lock.requires + + // load old lockfile deps into the packages listing + if (lock.dependencies && !lock.packages) { + return rpj(this.path + '/package.json').then(pkg => pkg, er => ({})) + .then(pkg => { + this[_loadAll]('', null, this.data) + this[_fixDependencies](pkg) + }) + } + }) + .then(() => this) + } + + [_loadAll] (location, name, lock) { + // migrate a v1 package lock to the new format. + const meta = this[_metaFromLock](location, name, lock) + // dependencies nested under a link are actually under the link target + if (meta.link) + location = meta.resolved + if (lock.dependencies) { + for (const [name, dep] of Object.entries(lock.dependencies)) { + const loc = location + (location ? '/' : '') + 'node_modules/' + name + this[_loadAll](loc, name, dep) + } + } + } + + // v1 lockfiles track the optional/dev flags, but they don't tell us + // which thing had what kind of dep on what other thing, so we need + // to correct that now, or every link will be considered prod + [_fixDependencies] (pkg) { + // we need the root package.json because legacy shrinkwraps just + // have requires:true at the root level, which is even less useful + // than merging all dep types into one object. + const root = this.data.packages[''] + pkgMetaKeys.forEach(key => { + const val = metaFieldFromPkg(pkg, key) + const k = key.replace(/^_/, '') + if (val) + root[k] = val + }) + + for (const [loc, meta] of Object.entries(this.data.packages)) { + if (!meta.requires || !loc) + continue + + // resolve each require to a meta entry + // if this node isn't optional, but the dep is, then it's an optionalDep + // likewise for dev deps. + // This isn't perfect, but it's a pretty good approximation, and at + // least gets us out of having all 'prod' edges, which throws off the + // buildIdealTree process + for (const [name, spec] of Object.entries(meta.requires)) { + const dep = this[_resolveMetaNode](loc, name) + // this overwrites the false value set above + const depType = dep && dep.optional && !meta.optional + ? 'optionalDependencies' + : /* istanbul ignore next - dev deps are only for the root level */ + dep && dep.dev && !meta.dev ? 'devDependencies' + // also land here if the dep just isn't in the tree, which maybe + // should be an error, since it means that the shrinkwrap is + // invalid, but we can't do much better without any info. + : 'dependencies' + meta[depType] = meta[depType] || {} + meta[depType][name] = spec + } + delete meta.requires + } + } + + [_resolveMetaNode] (loc, name) { + for (let path = loc; true; path = path.replace(/(^|\/)[^/]*$/, '')) { + const check = `${path}${path ? '/' : ''}node_modules/${name}` + if (this.data.packages[check]) + return this.data.packages[check] + + if (!path) + break + } + return null + } + + [_lockFromLoc] (lock, path, i = 0) { + if (!lock) + return null + + if (path[i] === '') + i++ + + if (i >= path.length) + return lock + + if (!lock.dependencies) + return null + + return this[_lockFromLoc](lock.dependencies[path[i]], path, i + 1) + } + + // pass in a path relative to the root path, or an absolute path, + // get back a /-normalized location based on root path. + [_pathToLoc] (path) { + return relpath(this.path, resolve(this.path, path)) + } + + delete (nodePath) { + if (!this.data) + throw new Error('run load() before getting or setting data') + const location = this[_pathToLoc](nodePath) + this[_awaitingUpdate].delete(location) + + delete this.data.packages[location] + const path = location.split(/(?:^|\/)node_modules\//) + const name = path.pop() + const pLock = this[_lockFromLoc](this.data, path) + if (pLock && pLock.dependencies) + delete pLock.dependencies[name] + } + + get (nodePath) { + if (!this.data) + throw new Error('run load() before getting or setting data') + + const location = this[_pathToLoc](nodePath) + if (this[_awaitingUpdate].has(location)) + this[_updateWaitingNode](location) + + // first try to get from the newer spot, which we know has + // all the things we need. + if (this.data.packages[location]) + return this.data.packages[location] + + // otherwise, fall back to the legacy metadata, and hope for the best + // get the node in the shrinkwrap corresponding to this spot + const path = location.split(/(?:^|\/)node_modules\//) + const name = path[path.length - 1] + const lock = this[_lockFromLoc](this.data, path) + + return this[_metaFromLock](location, name, lock) + } + + [_metaFromLock] (location, name, lock) { + // This function tries as hard as it can to figure out the metadata + // from a lockfile which may be outdated or incomplete. Since v1 + // lockfiles used the "version" field to contain a variety of + // different possible types of data, this gets a little complicated. + if (!lock) + return {} + + // try to figure out a npm-package-arg spec from the lockfile entry + // This will return null if we could not get anything valid out of it. + const spec = specFromLock(name, lock, this.path) + + if (spec.type === 'directory') { + // the "version" was a file: url to a non-tarball path + // this is a symlink dep. We don't store much metadata + // about symlinks, just the target. + const target = relpath(this.path, spec.fetchSpec) + this.data.packages[location] = { + link: true, + resolved: target, + } + // also save the link target, omitting version since we don't know + // what it is, but we know it isn't a link to itself! + if (!this.data.packages[target]) + this[_metaFromLock](target, name, { ...lock, version: null }) + return this.data.packages[location] + } + + const meta = {} + // when calling loadAll we'll change these into proper dep objects + if (lock.requires && typeof lock.requires === 'object') + meta.requires = lock.requires + + if (lock.optional) + meta.optional = true + if (lock.dev) + meta.dev = true + + // the root will typically have a name from the root project's + // package.json file. + if (location === '') + meta.name = lock.name + + // if we have integrity, save it now. + if (lock.integrity) + meta.integrity = lock.integrity + + if (lock.version && !lock.integrity) { + // this is usually going to be a git url or symlink, but it could + // also be a registry dependency that did not have integrity at + // the time it was saved. + // Symlinks were already handled above, so that leaves git. + // + // For git, always save the full SSH url. we'll actually fetch the + // tgz most of the time, since it's faster, but it won't work for + // private repos, and we can't get back to the ssh from the tgz, + // so we store the ssh instead. + // For unknown git hosts, just resolve to the raw spec in lock.version + if (spec.type === 'git') { + meta.resolved = consistentResolve(spec, this.path, this.path) + + // return early because there is nothing else we can do with this + return this.data.packages[location] = meta + } else if (spec.registry) { + // registry dep that didn't save integrity. grab the version, and + // fall through to pick up the resolved and potentially name. + meta.version = lock.version + } + // only other possible case is a tarball without integrity. + // fall through to do what we can with the filename later. + } + + // at this point, we know that the spec is either a registry dep + // (ie, version, because locking, which means a resolved url), + // or a remote dep, or file: url. Remote deps and file urls + // have a fetchSpec equal to the fully resolved thing. + // Registry deps, we take what's in the lockfile. + if (lock.resolved || (spec.type && !spec.registry)) { + if (spec.registry) + meta.resolved = lock.resolved + else if (spec.type === 'file') + meta.resolved = consistentResolve(spec, this.path, this.path, true) + else if (spec.fetchSpec) + meta.resolved = spec.fetchSpec + } + + // at this point, if still we don't have a version, do our best to + // infer it from the tarball url/file. This works a surprising + // amount of the time, even though it's not guaranteed. + if (!meta.version) { + if (spec.type === 'file' || spec.type === 'remote') { + const fromTgz = versionFromTgz(spec.name, spec.fetchSpec) || + versionFromTgz(spec.name, meta.resolved) + if (fromTgz) { + meta.version = fromTgz.version + if (fromTgz.name !== name) + meta.name = fromTgz.name + } + } else if (spec.type === 'alias') { + meta.name = spec.subSpec.name + meta.version = spec.subSpec.fetchSpec + } else if (spec.type === 'version') + meta.version = spec.fetchSpec + // ok, I did my best! good luck! + } + + if (lock.bundled) + meta.inBundle = true + + // save it for next time + return this.data.packages[location] = meta + } + + add (node) { + if (!this.data) + throw new Error('run load() before getting or setting data') + + // will be actually updated on read + const loc = relpath(this.path, node.path) + if (node.path === this.path) + this.tree = node + + // if we have metadata about this node, and it's a match, then + // try to decorate it. + if (node.resolved === null || node.integrity === null) { + const { + resolved, + integrity, + hasShrinkwrap, + } = this.get(node.path) + + const pathFixed = !resolved ? null + : !/^file:/.test(resolved) ? resolved + // resolve onto the metadata path + : `file:${resolve(this.path, resolved.substr(5))}` + + // if we have one, only set the other if it matches + // otherwise it could be for a completely different thing. + const resolvedOk = !resolved || !node.resolved || + node.resolved === pathFixed + const integrityOk = !integrity || !node.integrity || + node.integrity === integrity + + if ((resolved || integrity) && resolvedOk && integrityOk) { + node.resolved = node.resolved || pathFixed || null + node.integrity = node.integrity || integrity || null + node.hasShrinkwrap = node.hasShrinkwrap || hasShrinkwrap || false + } else { + // try to read off the package or node itself + const { + resolved, + integrity, + hasShrinkwrap, + } = Shrinkwrap.metaFromNode(node, this.path) + node.resolved = node.resolved || resolved || null + node.integrity = node.integrity || integrity || null + node.hasShrinkwrap = node.hasShrinkwrap || hasShrinkwrap || false + } + } + this[_awaitingUpdate].set(loc, node) + } + + addEdge (edge) { + if (!this.yarnLock || !edge.valid) + return + + const { to: node } = edge + + // if it's already set up, nothing to do + if (node.resolved !== null && node.integrity !== null) + return + + // if the yarn lock is empty, nothing to do + if (!this.yarnLock.entries || !this.yarnLock.entries.size) + return + + // we relativize the path here because that's how it shows up in the lock + // XXX how is this different from pathFixed above?? + const pathFixed = !node.resolved ? null + : !/file:/.test(node.resolved) ? node.resolved + : consistentResolve(node.resolved, node.path, this.path, true) + + const entry = this.yarnLock.entries.get(`${node.name}@${edge.spec}`) + + if (!entry || + mismatch(node.version, entry.version) || + mismatch(node.integrity, entry.integrity) || + mismatch(pathFixed, entry.resolved)) + return + + node.integrity = node.integrity || entry.integrity || null + node.resolved = node.resolved || + consistentResolve(entry.resolved, this.path, node.path) || null + + this[_awaitingUpdate].set(relpath(this.path, node.path), node) + } + + [_updateWaitingNode] (loc) { + const node = this[_awaitingUpdate].get(loc) + this[_awaitingUpdate].delete(loc) + this.data.packages[loc] = Shrinkwrap.metaFromNode(node, this.path) + } + + commit () { + if (this.tree) { + if (this.yarnLock) + this.yarnLock.fromTree(this.tree) + const root = Shrinkwrap.metaFromNode(this.tree, this.path) + this.data.packages = {} + if (Object.keys(root).length) + this.data.packages[''] = root + for (const node of this.tree.inventory.values()) { + const loc = relpath(this.path, node.path) + this.data.packages[loc] = Shrinkwrap.metaFromNode(node, this.path) + } + } else if (this[_awaitingUpdate].size > 0) { + for (const loc of this[_awaitingUpdate].keys()) + this[_updateWaitingNode](loc) + } + + // hidden lockfiles don't include legacy metadata or a root entry + if (this.hiddenLockfile) { + delete this.data.packages[''] + delete this.data.dependencies + } else if (this.tree) + this[_buildLegacyLockfile](this.tree, this.data) + + return this.data + } + + [_buildLegacyLockfile] (node, lock, path = []) { + if (node === this.tree) { + // the root node + lock.name = node.package.name || node.name + if (node.version) + lock.version = node.version + } + + // npm v6 and before tracked 'from', meaning "the request that led + // to this package being installed". However, that's inherently + // racey and non-deterministic in a world where deps are deduped + // ahead of fetch time. In order to maintain backwards compatibility + // with v6 in the lockfile, we do this trick where we pick a valid + // dep link out of the edgesIn set. Choose the edge with the fewest + // number of `node_modules` sections in the requestor path, and then + // lexically sort afterwards. + const edge = [...node.edgesIn].filter(e => e.valid).sort((a, b) => { + const aloc = a.from.location.split('node_modules') + const bloc = b.from.location.split('node_modules') + /* istanbul ignore next - sort calling order is indeterminate */ + return aloc.length > bloc.length ? 1 + : bloc.length > aloc.length ? -1 + : aloc[aloc.length - 1].localeCompare(bloc[bloc.length - 1]) + })[0] + + const res = consistentResolve(node.resolved, this.path, this.path, true) + const rSpec = specFromResolved(res) + + // if we don't have anything (ie, it's extraneous) then use the resolved + // value as if that was where we got it from, since at least it's true. + // if we don't have either, just an empty object so nothing matches below. + // This will effectively just save the version and resolved, as if it's + // a standard version/range dep, which is a reasonable default. + const spec = !edge ? rSpec + : npa.resolve(node.name, edge.spec, edge.from.realpath) + + if (node.target) + lock.version = `file:${relpath(this.path, node.realpath)}` + else if (spec && (spec.type === 'file' || spec.type === 'remote')) + lock.version = spec.saveSpec + else if (spec && spec.type === 'git' || rSpec.type === 'git') { + lock.version = node.resolved + /* istanbul ignore else - don't think there are any cases where a git + * spec (or indeed, ANY npa spec) doesn't have a .raw member */ + if (spec.raw) + lock.from = spec.raw + } else if (!node.isRoot && + node.package && + node.package.name && + node.package.name !== node.name) + lock.version = `npm:${node.package.name}@${node.version}` + else if (node.package && node.version) + lock.version = node.version + + if (node.inDepBundle) + lock.bundled = true + + // when we didn't resolve to git, file, or dir, and didn't request + // git, file, dir, or remote, then the resolved value is necessary. + if (node.resolved && + !node.target && + rSpec.type !== 'git' && + rSpec.type !== 'file' && + rSpec.type !== 'directory' && + spec.type !== 'directory' && + spec.type !== 'git' && + spec.type !== 'file' && + spec.type !== 'remote') + lock.resolved = node.resolved + + if (node.integrity) + lock.integrity = node.integrity + + if (node.extraneous) + lock.extraneous = true + else if (!node.isLink) { + if (node.peer) + lock.peer = true + + if (node.devOptional && !node.dev && !node.optional) + lock.devOptional = true + + if (node.dev) + lock.dev = true + + if (node.optional) + lock.optional = true + } + + const depender = node.target || node + if (depender.edgesOut.size > 0) { + if (node !== this.tree) { + lock.requires = [...depender.edgesOut.entries()].reduce((set, [k, v]) => { + // omit peer deps from legacy lockfile requires field, because + // npm v6 doesn't handle peer deps, and this triggers some bad + // behavior if the dep can't be found in the dependencies list. + if (!v.peer) + set[k] = v.spec + return set + }, {}) + } else + lock.requires = true + } + + // now we walk the children, putting them in the 'dependencies' object + const {children} = node.target || node + if (!children.size) + delete lock.dependencies + else { + const kidPath = [...path, node.realpath] + const dependencies = {} + // skip any that are already in the descent path, so cyclical link + // dependencies don't blow up with ELOOP. + let found = false + for (const [name, kid] of children.entries()) { + if (path.includes(kid.realpath)) + continue + dependencies[name] = this[_buildLegacyLockfile](kid, {}, kidPath) + found = true + } + if (found) + lock.dependencies = dependencies + } + return lock + } + + save (options = {}) { + if (!this.data) + throw new Error('run load() before saving data') + + const { format = true } = options + const defaultIndent = this.indent || 2 + const indent = format === true ? defaultIndent + : format || 0 + const eol = format ? this.newline || '\n' : '' + const data = this.commit() + const json = stringify(data, swKeyOrder, indent).replace(/\n/g, eol) + return Promise.all([ + writeFile(this.filename, json).catch(er => { + if (this.hiddenLockfile) { + // well, we did our best. + // if we reify, and there's nothing there, then it might be lacking + // a node_modules folder, but then the lockfile is not important. + // Remove the file, so that in case there WERE deps, but we just + // failed to update the file for some reason, it's not out of sync. + return rimraf(this.filename) + } + throw er + }), + this.yarnLock && this.yarnLock.entries.size && + writeFile(this.path + '/yarn.lock', this.yarnLock.toString()), + ]) + } +} + +module.exports = Shrinkwrap diff --git a/deps/npm/node_modules/@npmcli/arborist/lib/spec-from-lock.js b/deps/npm/node_modules/@npmcli/arborist/lib/spec-from-lock.js new file mode 100644 index 00000000000000..eccf472a96a800 --- /dev/null +++ b/deps/npm/node_modules/@npmcli/arborist/lib/spec-from-lock.js @@ -0,0 +1,29 @@ +const npa = require('npm-package-arg') + +// extracted from npm v6 lib/install/realize-shrinkwrap-specifier.js +const specFromLock = (name, lock, where) => { + try { + if (lock.version) { + const spec = npa.resolve(name, lock.version, where) + if (lock.integrity || spec.type === 'git') + return spec + } + if (lock.from) { + // legacy metadata includes "from", but not integrity + const spec = npa.resolve(name, lock.from, where) + if (spec.registry && lock.version) + return npa.resolve(name, lock.version, where) + else if (!lock.resolved) + return spec + } + if (lock.resolved) + return npa.resolve(name, lock.resolved, where) + } catch (_) { } + try { + return npa.resolve(name, lock.version, where) + } catch (_) { + return {} + } +} + +module.exports = specFromLock diff --git a/deps/npm/node_modules/@npmcli/arborist/lib/tracker.js b/deps/npm/node_modules/@npmcli/arborist/lib/tracker.js new file mode 100644 index 00000000000000..c90404f00aa9bc --- /dev/null +++ b/deps/npm/node_modules/@npmcli/arborist/lib/tracker.js @@ -0,0 +1,104 @@ +const procLog = require('./proc-log.js') + +const _progress = Symbol('_progress') +const _onError = Symbol('_onError') + +module.exports = cls => class Tracker extends cls { + constructor (options = {}) { + super(options) + this[_progress] = new Map() + this.log = options.log || procLog + } + + addTracker (section, subsection = null, key = null) { + // TrackerGroup type object not found + if (!this.log.newGroup) + return + + if (section === null || section === undefined) + this[_onError](`Tracker can't be null or undefined`) + + if (key === null) + key = subsection + + const hasTracker = this[_progress].has(section) + const hasSubtracker = this[_progress].has(`${section}:${key}`) + + if (hasTracker && subsection === null) + // 0. existing tracker, no subsection + this[_onError](`Tracker "${section}" already exists`) + + else if (!hasTracker && subsection === null) { + // 1. no existing tracker, no subsection + // Create a new tracker from this.log + // starts progress bar + if (this[_progress].size === 0) + this.log.enableProgress() + + this[_progress].set(section, this.log.newGroup(section)) + } else if (!hasTracker && subsection !== null) + // 2. no parent tracker and subsection + this[_onError](`Parent tracker "${section}" does not exist`) + + else if (!hasTracker || !hasSubtracker) { + // 3. existing parent tracker, no subsection tracker + // Create a new subtracker in this[_progress] from parent tracker + this[_progress].set(`${section}:${key}`, + this[_progress].get(section).newGroup(`${section}:${subsection}`) + ) + } + // 4. existing parent tracker, existing subsection tracker + // skip it + } + + finishTracker (section, subsection = null, key = null) { + // TrackerGroup type object not found + if (!this.log.newGroup) + return + + if (section === null || section === undefined) + this[_onError](`Tracker can't be null or undefined`) + + if (key === null) + key = subsection + + const hasTracker = this[_progress].has(section) + const hasSubtracker = this[_progress].has(`${section}:${key}`) + + // 0. parent tracker exists, no subsection + // Finish parent tracker and remove from this[_progress] + if (hasTracker && subsection === null) { + // check if parent tracker does + // not have any remaining children + const keys = this[_progress].keys() + for (const key of keys) { + if (key.match(new RegExp(section + ':'))) + this.finishTracker(section, key) + } + + // remove parent tracker + this[_progress].get(section).finish() + this[_progress].delete(section) + + // remove progress bar if all + // trackers are finished + if (this[_progress].size === 0) + this.log.disableProgress() + } else if (!hasTracker && subsection === null) + // 1. no existing parent tracker, no subsection + this[_onError](`Tracker "${section}" does not exist`) + + else if (!hasTracker || hasSubtracker) { + // 2. subtracker exists + // Finish subtracker and remove from this[_progress] + this[_progress].get(`${section}:${key}`).finish() + this[_progress].delete(`${section}:${key}`) + } + // 3. existing parent tracker, no subsection + } + + [_onError] (msg) { + this.log.disableProgress() + throw new Error(msg) + } +} diff --git a/deps/npm/node_modules/@npmcli/arborist/lib/version-from-tgz.js b/deps/npm/node_modules/@npmcli/arborist/lib/version-from-tgz.js new file mode 100644 index 00000000000000..4b433ea636a8b9 --- /dev/null +++ b/deps/npm/node_modules/@npmcli/arborist/lib/version-from-tgz.js @@ -0,0 +1,46 @@ +/* eslint node/no-deprecated-api: "off" */ +const semver = require('semver') +const {basename} = require('path') +const {parse} = require('url') +module.exports = (name, tgz) => { + const base = basename(tgz) + if (!base.endsWith('.tgz')) + return null + + const u = parse(tgz) + if (/^https?:/.test(u.protocol)) { + // registry url? check for most likely pattern. + // either /@foo/bar/-/bar-1.2.3.tgz or + // /foo/-/foo-1.2.3.tgz, and fall through to + // basename checking. Note that registries can + // be mounted below the root url, so /a/b/-/x/y/foo/-/foo-1.2.3.tgz + // is a potential option. + const tfsplit = u.path.substr(1).split('/-/') + if (tfsplit.length > 1) { + const afterTF = tfsplit.pop() + if (afterTF === base) { + const pre = tfsplit.pop() + const preSplit = pre.split(/\/|%2f/i) + const project = preSplit.pop() + const scope = preSplit.pop() + return versionFromBaseScopeName(base, scope, project) + } + } + } + + const split = name.split(/\/|%2f/i) + const project = split.pop() + const scope = split.pop() + return versionFromBaseScopeName(base, scope, project) +} + +const versionFromBaseScopeName = (base, scope, name) => { + if (!base.startsWith(name + '-')) + return null + + const parsed = semver.parse(base.substring(name.length + 1, base.length - 4)) + return parsed ? { + name: scope && scope.charAt(0) === '@' ? `${scope}/${name}` : name, + version: parsed.version, + } : null +} diff --git a/deps/npm/node_modules/@npmcli/arborist/lib/vuln.js b/deps/npm/node_modules/@npmcli/arborist/lib/vuln.js new file mode 100644 index 00000000000000..8f887a3fc96cb0 --- /dev/null +++ b/deps/npm/node_modules/@npmcli/arborist/lib/vuln.js @@ -0,0 +1,189 @@ +// An object representing a vulnerability either as the result of an +// advisory or due to the package in question depending exclusively on +// vulnerable versions of a dep. +// +// - name: package name +// - range: Set of vulnerable versions +// - nodes: Set of nodes affected +// - effects: Set of vulns triggered by this one +// - advisories: Set of advisories (including metavulns) causing this vuln. +// All of the entries in via are vulnerability objects returned by +// @npmcli/metavuln-calculator +// - via: dependency vulns which cause this one + +const {satisfies, simplifyRange} = require('semver') +const semverOpt = { loose: true, includePrerelease: true } + +const npa = require('npm-package-arg') +const _range = Symbol('_range') +const _simpleRange = Symbol('_simpleRange') +const _fixAvailable = Symbol('_fixAvailable') + +const severities = new Map([ + ['info', 0], + ['low', 1], + ['moderate', 2], + ['high', 3], + ['critical', 4], + [null, -1], +]) + +for (const [name, val] of severities.entries()) + severities.set(val, name) + +class Vuln { + constructor ({ name, advisory }) { + this.name = name + this.via = new Set() + this.advisories = new Set() + this.severity = null + this.effects = new Set() + this.topNodes = new Set() + this[_range] = null + this[_simpleRange] = null + this.nodes = new Set() + // assume a fix is available unless it hits a top node + // that locks it in place, setting this to false or {isSemVerMajor, version}. + this[_fixAvailable] = true + this.addAdvisory(advisory) + this.packument = advisory.packument + this.versions = advisory.versions + } + + get fixAvailable () { + return this[_fixAvailable] + } + + set fixAvailable (f) { + this[_fixAvailable] = f + // if there's a fix available for this at the top level, it means that + // it will also fix the vulns that led to it being there. to get there, + // we set the vias to the most "strict" of fix availables. + // - false: no fix is available + // - {name, version, isSemVerMajor} fix requires -f, is semver major + // - {name, version} fix requires -f, not semver major + // - true: fix does not require -f + for (const v of this.via) { + // don't blow up on loops + if (v.fixAvailable === f) + continue + + if (f === false) + v.fixAvailable = f + else if (v.fixAvailable === true) + v.fixAvailable = f + else if (typeof f === 'object' && ( + typeof v.fixAvailable !== 'object' || !v.fixAvailable.isSemVerMajor)) + v.fixAvailable = f + } + } + + testSpec (spec) { + const specObj = npa(spec) + if (!specObj.registry) + return true + + for (const v of this.versions) { + if (satisfies(v, spec) && !satisfies(v, this.range, semverOpt)) + return false + } + return true + } + + toJSON () { + // sort so that they're always in a consistent order + return { + name: this.name, + severity: this.severity, + // just loop over the advisories, since via is only Vuln objects, + // and calculated advisories have all the info we need + via: [...this.advisories].map(v => v.type === 'metavuln' ? v.dependency : { + ...v, + versions: undefined, + vulnerableVersions: undefined, + id: undefined, + }).sort((a, b) => + String(a.source || a).localeCompare(String(b.source || b))), + effects: [...this.effects].map(v => v.name) + .sort(/* istanbul ignore next */(a, b) => a.localeCompare(b)), + range: this.simpleRange, + nodes: [...this.nodes].map(n => n.location) + .sort(/* istanbul ignore next */(a, b) => a.localeCompare(b)), + fixAvailable: this[_fixAvailable], + } + } + + addVia (v) { + this.via.add(v) + v.effects.add(this) + // call the setter since we might add vias _after_ setting fixAvailable + this.fixAvailable = this.fixAvailable + } + + deleteVia (v) { + this.via.delete(v) + v.effects.delete(this) + } + + deleteAdvisory (advisory) { + this.advisories.delete(advisory) + // make sure we have the max severity of all the vulns causing this one + this.severity = null + this[_range] = null + this[_simpleRange] = null + // refresh severity + for (const advisory of this.advisories) + this.addAdvisory(advisory) + + // remove any effects that are no longer relevant + const vias = new Set([...this.advisories].map(a => a.dependency)) + for (const via of this.via) { + if (!vias.has(via.name)) + this.deleteVia(via) + } + } + + addAdvisory (advisory) { + this.advisories.add(advisory) + const sev = severities.get(advisory.severity) + this[_range] = null + this[_simpleRange] = null + if (sev > severities.get(this.severity)) + this.severity = advisory.severity + } + + get range () { + return this[_range] || + (this[_range] = [...this.advisories].map(v => v.range).join(' || ')) + } + + get simpleRange () { + if (this[_simpleRange] && this[_simpleRange] === this[_range]) + return this[_simpleRange] + + const versions = [...this.advisories][0].versions + const range = this.range + const simple = simplifyRange(versions, range, semverOpt) + return this[_simpleRange] = this[_range] = simple + } + + isVulnerable (node) { + if (this.nodes.has(node)) + return true + + const { version } = node.package + if (!version) + return false + + for (const v of this.advisories) { + if (v.testVersion(version)) { + this.nodes.add(node) + return true + } + } + + return false + } +} + +module.exports = Vuln diff --git a/deps/npm/node_modules/@npmcli/arborist/lib/yarn-lock.js b/deps/npm/node_modules/@npmcli/arborist/lib/yarn-lock.js new file mode 100644 index 00000000000000..17dbc235cda566 --- /dev/null +++ b/deps/npm/node_modules/@npmcli/arborist/lib/yarn-lock.js @@ -0,0 +1,336 @@ +// parse a yarn lock file +// basic format +// +// [, ...]: +// +// : +// +// +// Assume that any key or value might be quoted, though that's only done +// in practice if certain chars are in the string. Quoting unnecessarily +// does not cause problems for yarn, so that's what we do when we write +// it back. +// +// The data format would support nested objects, but at this time, it +// appears that yarn does not use that for anything, so in the interest +// of a simpler parser algorithm, this implementation only supports a +// single layer of sub objects. +// +// This doesn't deterministically define the shape of the tree, and so +// cannot be used (on its own) for Arborist.loadVirtual. +// But it can give us resolved, integrity, and version, which is useful +// for Arborist.loadActual and for building the ideal tree. +// +// At the very least, when a yarn.lock file is present, we update it +// along the way, and save it back in Shrinkwrap.save() +// +// NIHing this rather than using @yarnpkg/lockfile because that module +// is an impenetrable 10kloc of webpack flow output, which is overkill +// for something relatively simple and tailored to Arborist's use case. + +const consistentResolve = require('./consistent-resolve.js') +const {dirname} = require('path') +const {breadth} = require('treeverse') + +// sort a key/value object into a string of JSON stringified keys and vals +const sortKV = obj => Object.keys(obj) + .sort((a, b) => a.localeCompare(b)) + .map(k => ` ${JSON.stringify(k)} ${JSON.stringify(obj[k])}`) + .join('\n') + +// for checking against previous entries +const match = (p, n) => + p.integrity && n.integrity ? p.integrity === n.integrity + : p.resolved && n.resolved ? p.resolved === n.resolved + : p.version && n.version ? p.version === n.version + : true + +const prefix = +`# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. +# yarn lockfile v1 + + +` + +const nullSymbol = Symbol('null') +class YarnLock { + static parse (data) { + return new YarnLock().parse(data) + } + + static fromTree (tree) { + return new YarnLock().fromTree(tree) + } + + constructor () { + this.entries = null + this.endCurrent() + } + + endCurrent () { + this.current = null + this.subkey = nullSymbol + } + + parse (data) { + const ENTRY_START = /^[^\s].*:$/ + const SUBKEY = /^ {2}[^\s]+:$/ + const SUBVAL = /^ {4}[^\s]+ .+$/ + const METADATA = /^ {2}[^\s]+ .+$/ + this.entries = new Map() + this.current = null + const linere = /([^\n]*)\n/gm + let match + let lineNum = 0 + if (!/\n$/.test(data)) + data += '\n' + while (match = linere.exec(data)) { + const line = match[1] + lineNum++ + if (line.charAt(0) === '#') + continue + if (line === '') { + this.endCurrent() + continue + } + if (ENTRY_START.test(line)) { + this.endCurrent() + const specs = this.splitQuoted(line.slice(0, -1), /, */) + this.current = new YarnLockEntry(specs) + specs.forEach(spec => this.entries.set(spec, this.current)) + continue + } + if (SUBKEY.test(line)) { + this.subkey = line.slice(2, -1) + this.current[this.subkey] = {} + continue + } + if (SUBVAL.test(line) && this.current && this.current[this.subkey]) { + const subval = this.splitQuoted(line.trimLeft(), ' ') + if (subval.length === 2) { + this.current[this.subkey][subval[0]] = subval[1] + continue + } + } + // any other metadata + if (METADATA.test(line) && this.current) { + const metadata = this.splitQuoted(line.trimLeft(), ' ') + if (metadata.length === 2) { + // strip off the legacy shasum hashes + if (metadata[0] === 'resolved') + metadata[1] = metadata[1].replace(/#.*/, '') + this.current[metadata[0]] = metadata[1] + continue + } + } + + throw Object.assign(new Error('invalid or corrupted yarn.lock file'), { + position: match.index, + content: match[0], + line: lineNum, + }) + } + this.endCurrent() + return this + } + + splitQuoted (str, delim) { + // a,"b,c",d"e,f => ['a','"b','c"','d"e','f'] => ['a','b,c','d"e','f'] + const split = str.split(delim) + const out = [] + let o = 0 + for (let i = 0; i < split.length; i++) { + const chunk = split[i] + if (/^".*"$/.test(chunk)) + out[o++] = chunk.trim().slice(1, -1) + else if (/^"/.test(chunk)) { + let collect = chunk.trimLeft().slice(1) + while (++i < split.length) { + const n = split[i] + // something that is not a slash, followed by an even number + // of slashes then a " then end => ending on an unescaped " + if (/[^\\](\\\\)*"$/.test(n)) { + collect += n.trimRight().slice(0, -1) + break + } else + collect += n + } + out[o++] = collect + } else + out[o++] = chunk.trim() + } + return out + } + + toString () { + return prefix + [...new Set([...this.entries.values()])] + .map(e => e.toString()) + .sort((a, b) => a.localeCompare(b)).join('\n\n') + '\n' + } + + fromTree (tree) { + this.entries = new Map() + // walk the tree in a deterministic order, breadth-first, alphabetical + breadth({ + tree, + visit: node => this.addEntryFromNode(node), + getChildren: node => [...node.children.values(), ...node.fsChildren] + .sort((a, b) => a.depth - b.depth || a.name.localeCompare(b.name)), + }) + return this + } + + addEntryFromNode (node) { + const specs = [...node.edgesIn] + .map(e => `${node.name}@${e.spec}`) + .sort((a, b) => a.localeCompare(b)) + + // Note: + // yarn will do excessive duplication in a case like this: + // root -> (x@1.x, y@1.x, z@1.x) + // y@1.x -> (x@1.1, z@2.x) + // z@1.x -> () + // z@2.x -> (x@1.x) + // + // where x@1.2 exists, because the "x@1.x" spec will *always* resolve + // to x@1.2, which doesn't work for y's dep on x@1.1, so you'll get this: + // + // root + // +-- x@1.2.0 + // +-- y + // | +-- x@1.1.0 + // | +-- z@2 + // | +-- x@1.2.0 + // +-- z@1 + // + // instead of this more deduped tree that arborist builds by default: + // + // root + // +-- x@1.2.0 (dep is x@1.x, from root) + // +-- y + // | +-- x@1.1.0 + // | +-- z@2 (dep on x@1.x deduped to x@1.1.0 under y) + // +-- z@1 + // + // In order to not create an invalid yarn.lock file with conflicting + // entries, AND not tell yarn to create an invalid tree, we need to + // ignore the x@1.x spec coming from z, since it's already in the entries. + // + // So, if the integrity and resolved don't match a previous entry, skip it. + // We call this method on shallower nodes first, so this is fine. + const n = this.entryDataFromNode(node) + let priorEntry = null + const newSpecs = [] + for (const s of specs) { + const prev = this.entries.get(s) + // no previous entry for this spec at all, so it's new + if (!prev) { + // if we saw a match already, then assign this spec to it as well + if (priorEntry) + priorEntry.addSpec(s) + else + newSpecs.push(s) + continue + } + + const m = match(prev, n) + // there was a prior entry, but a different thing. skip this one + if (!m) + continue + + // previous matches, but first time seeing it, so already has this spec. + // go ahead and add all the previously unseen specs, though + if (!priorEntry) { + priorEntry = prev + for (const s of newSpecs) { + priorEntry.addSpec(s) + this.entries.set(s, priorEntry) + } + newSpecs.length = 0 + continue + } + + // have a prior entry matching n, and matching the prev we just saw + // add the spec to it + priorEntry.addSpec(s) + this.entries.set(s, priorEntry) + } + + // if we never found a matching prior, then this is a whole new thing + if (!priorEntry) { + const entry = Object.assign(new YarnLockEntry(newSpecs), n) + for (const s of newSpecs) + this.entries.set(s, entry) + } else { + // pick up any new info that we got for this node, so that we can + // decorate with integrity/resolved/etc. + Object.assign(priorEntry, n) + } + } + + entryDataFromNode (node) { + const n = {} + if (node.package.dependencies) + n.dependencies = node.package.dependencies + if (node.package.optionalDependencies) + n.optionalDependencies = node.package.optionalDependencies + if (node.version) + n.version = node.version + if (node.resolved) { + n.resolved = consistentResolve( + node.resolved, + node.isLink ? dirname(node.path) : node.path, + node.root.path, + true + ) + } + if (node.integrity) + n.integrity = node.integrity + + return n + } + + static get Entry () { + return YarnLockEntry + } +} + +const _specs = Symbol('_specs') +class YarnLockEntry { + constructor (specs) { + this[_specs] = new Set(specs) + this.resolved = null + this.version = null + this.integrity = null + this.dependencies = null + this.optionalDependencies = null + } + + toString () { + // sort objects to the bottom, then alphabetical + return ([...this[_specs]] + .sort((a, b) => a.localeCompare(b)) + .map(JSON.stringify).join(', ') + + ':\n' + + Object.getOwnPropertyNames(this) + .filter(prop => this[prop] !== null) + .sort( + (a, b) => + /* istanbul ignore next - sort call order is unpredictable */ + (typeof this[a] === 'object') === (typeof this[b] === 'object') + ? a.localeCompare(b) + : typeof this[a] === 'object' ? 1 : -1) + .map(prop => + typeof this[prop] !== 'object' + ? ` ${JSON.stringify(prop)} ${JSON.stringify(this[prop])}\n` + : Object.keys(this[prop]).length === 0 ? '' + : ` ${prop}:\n` + sortKV(this[prop]) + '\n') + .join('')).trim() + } + + addSpec (spec) { + this[_specs].add(spec) + } +} + +module.exports = YarnLock diff --git a/deps/npm/node_modules/@npmcli/arborist/package.json b/deps/npm/node_modules/@npmcli/arborist/package.json new file mode 100644 index 00000000000000..d8c63159af36c9 --- /dev/null +++ b/deps/npm/node_modules/@npmcli/arborist/package.json @@ -0,0 +1,75 @@ +{ + "name": "@npmcli/arborist", + "version": "0.0.32", + "description": "Manage node_modules trees", + "dependencies": { + "@npmcli/installed-package-contents": "^1.0.5", + "@npmcli/map-workspaces": "^1.0.1", + "@npmcli/metavuln-calculator": "^1.0.0", + "@npmcli/name-from-folder": "^1.0.1", + "@npmcli/node-gyp": "^1.0.0", + "@npmcli/run-script": "^1.7.0", + "bin-links": "^2.2.1", + "cacache": "^15.0.3", + "common-ancestor-path": "^1.0.1", + "json-parse-even-better-errors": "^2.3.1", + "json-stringify-nice": "^1.1.1", + "mkdirp-infer-owner": "^2.0.0", + "npm-install-checks": "^4.0.0", + "npm-package-arg": "^8.0.0", + "npm-pick-manifest": "^6.1.0", + "pacote": "^11.1.10", + "parse-conflict-json": "^1.1.1", + "promise-all-reject-late": "^1.0.0", + "promise-call-limit": "^1.0.1", + "read-package-json-fast": "^1.2.1", + "readdir-scoped-modules": "^1.1.0", + "semver": "^7.1.2", + "treeverse": "^1.0.4", + "walk-up-path": "^1.0.0" + }, + "devDependencies": { + "eslint": "^7.9.0", + "eslint-plugin-import": "^2.22.0", + "eslint-plugin-node": "^11.1.0", + "eslint-plugin-promise": "^4.2.1", + "eslint-plugin-standard": "^4.0.1", + "minify-registry-metadata": "^2.1.0", + "mutate-fs": "^2.1.1", + "require-inject": "^1.4.4", + "tap": "^14.10.7", + "tcompare": "^3.0.4" + }, + "scripts": { + "test": "tap", + "posttest": "npm run lint", + "snap": "tap", + "postsnap": "npm run lint", + "test-proxy": "ARBORIST_TEST_PROXY=1 tap --snapshot", + "preversion": "npm test", + "postversion": "npm publish", + "prepublishOnly": "git push origin --follow-tags", + "eslint": "eslint", + "lint": "npm run eslint -- \"lib/**/*.js\"", + "lintfix": "npm run lint -- --fix" + }, + "repository": { + "type": "git", + "url": "https://github.com/npm/arborist" + }, + "author": "Isaac Z. Schlueter (http://blog.izs.me/)", + "license": "ISC", + "files": [ + "lib/**/*.js" + ], + "main": "lib/index.js", + "tap": { + "100": true, + "node-arg": [ + "--unhandled-rejections=strict" + ], + "coverage-map": "map.js", + "esm": false, + "timeout": "120" + } +} diff --git a/deps/npm/node_modules/@npmcli/ci-detect/LICENSE b/deps/npm/node_modules/@npmcli/ci-detect/LICENSE new file mode 100644 index 00000000000000..19cec97b184683 --- /dev/null +++ b/deps/npm/node_modules/@npmcli/ci-detect/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) npm, Inc. + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/deps/npm/node_modules/@npmcli/ci-detect/README.md b/deps/npm/node_modules/@npmcli/ci-detect/README.md new file mode 100644 index 00000000000000..45f9a01c2f387a --- /dev/null +++ b/deps/npm/node_modules/@npmcli/ci-detect/README.md @@ -0,0 +1,80 @@ +# @npmcli/ci-detect + +Detect what kind of CI environment the program is in + +[![Build Status](https://travis-ci.com/npm/ci-detect.svg?branch=master)](https://travis-ci.com/npm/ci-detect) +[![Coverage Status](https://coveralls.io/repos/github/npm/ci-detect/badge.svg?branch=master)](https://coveralls.io/github/npm/ci-detect?branch=master) + +## USAGE + +```js +const ciDetect = require('@npmcli/ci-detect') +// false if not in CI +// otherwise, a string indicating the CI environment type +const inCI = ciDetect() +``` + +## CIs Detected + +Returns one of the following strings, or `false` if none match, by looking +at the appropriate environment variables. + +* `'gerrit'` Gerrit +* `'gitlab'` GitLab +* `'circleci'` Circle-CI +* `'semaphore'` Semaphore +* `'drone'` Drone +* `'github-actions'` GitHub Actions +* `'tddium'` TDDium +* `'jenkins'` Jenkins +* `'bamboo'` Bamboo +* `'gocd'` GoCD +* `'wercker'` Oracle Wercker +* `'netlify'` Netlify +* `'now-github'` Zeit.co's Now for GitHub deployment service +* `'now-bitbucket'` Zeit.co's Now for BitBucket deployment service +* `'now-gitlab'` Zeit.co's Now for GitLab deployment service +* `'now'` Zeit.co's Now service, but not GitHub/BitBucket/GitLab +* `'azure-pipelines'` Azure Pipelines +* `'bitrise'` Bitrise +* `'buddy'` Buddy +* `'buildkite'` Buildkite +* `'cirrus'` Cirrus CI +* `'dsari'` dsari CI +* `'strider'` Strider CI +* `'taskcluster'` Mozilla Taskcluster +* `'hudson'` Hudson CI +* `'magnum'` Magnum CI +* `'nevercode'` Nevercode +* `'render'` Render CI +* `'sail'` Sail CI +* `'shippable'` Shippable +* `'heroku'` Heroku +* `'codeship'` CodeShip +* Anything that sets the `CI_NAME` environment variable will return the + value as the result. (This is how CodeShip is detected.) +* `'travis-ci'` Travis-CI - A few other CI systems set `TRAVIS=1` in the + environment, because devs use that to indicate "test mode", so this one + can get some false positives, and is tested later in the process to + minimize this effect. +* `'aws-codebuild'` AWS CodeBuild +* `'builder'` Google Cloud Builder - This one is a bit weird. It doesn't + really set anything that can be reliably detected except + `BUILDER_OUTPUT`, so it can get false positives pretty easily. +* `'custom'` anything else that sets `CI` environment variable to either + `'1'` or `'true'`. + +## Caveats + +Note that since any program can set or unset whatever environment variables +they want, this is not 100% reliable. + +Also, note that if your program does different behavior in +CI/test/deployment than other places, then there's a good chance that +you're doing something wrong! + +But, for little niceties like setting colors or other output parameters, or +logging and that sort of non-essential thing, this module provides a way to +tweak without checking a bunch of things in a bunch of places. Mostly, +it's a single place to keep a note of what CI system sets which environment +variable. diff --git a/deps/npm/node_modules/@npmcli/ci-detect/index.js b/deps/npm/node_modules/@npmcli/ci-detect/index.js new file mode 100644 index 00000000000000..6a60606ff7bbc4 --- /dev/null +++ b/deps/npm/node_modules/@npmcli/ci-detect/index.js @@ -0,0 +1,44 @@ +module.exports = () => + process.env.GERRIT_PROJECT ? 'gerrit' + : process.env.SYSTEM_TEAMFOUNDATIONCOLLECTIONURI ? 'azure-pipelines' + : process.env.BITRISE_IO ? 'bitrise' + : process.env.BUDDY_WORKSPACE_ID ? 'buddy' + : process.env.BUILDKITE ? 'buildkite' + : process.env.CIRRUS_CI ? 'cirrus' + : process.env.GITLAB_CI ? 'gitlab' + : process.env.APPVEYOR ? 'appveyor' + : process.env.CIRCLECI ? 'circle-ci' + : process.env.SEMAPHORE ? 'semaphore' + : process.env.DRONE ? 'drone' + : process.env.DSARI ? 'dsari' + : process.env.GITHUB_ACTION ? 'github-actions' + : process.env.TDDIUM ? 'tddium' + : process.env.STRIDER ? 'strider' + : process.env.TASKCLUSTER_ROOT_URL ? 'taskcluster' + : process.env.JENKINS_URL ? 'jenkins' + : process.env['bamboo.buildKey'] ? 'bamboo' + : process.env.GO_PIPELINE_NAME ? 'gocd' + : process.env.HUDSON_URL ? 'hudson' + : process.env.WERCKER ? 'wercker' + : process.env.NETLIFY ? 'netlify' + : process.env.NOW_GITHUB_DEPLOYMENT ? 'now-github' + : process.env.GITLAB_DEPLOYMENT ? 'now-gitlab' + : process.env.BITBUCKET_DEPLOYMENT ? 'now-bitbucket' + : process.env.NOW_BUILDER ? 'now' + : process.env.MAGNUM ? 'magnum' + : process.env.NEVERCODE ? 'nevercode' + : process.env.RENDER ? 'render' + : process.env.SAIL_CI ? 'sail' + : process.env.SHIPPABLE ? 'shippable' + // codeship and a few others + : process.env.CI_NAME ? process.env.CI_NAME + // heroku doesn't set envs other than node in a heroku-specific location + : /\/\.heroku\/node\/bin\/node$/.test(process.env.NODE || '') ? 'heroku' + // test travis after the others, since several CI systems mimic it + : process.env.TRAVIS ? 'travis-ci' + // aws CodeBuild/CodePipeline + : process.env.CODEBUILD_SRC_DIR ? 'aws-codebuild' + : process.env.CI === 'true' || process.env.CI === '1' ? 'custom' + // Google Cloud Build - it sets almost nothing + : process.env.BUILDER_OUTPUT ? 'builder' + : false diff --git a/deps/npm/node_modules/@npmcli/ci-detect/package.json b/deps/npm/node_modules/@npmcli/ci-detect/package.json new file mode 100644 index 00000000000000..89dec0ccc23b31 --- /dev/null +++ b/deps/npm/node_modules/@npmcli/ci-detect/package.json @@ -0,0 +1,26 @@ +{ + "name": "@npmcli/ci-detect", + "version": "1.3.0", + "description": "Detect what kind of CI environment the program is in", + "author": "Isaac Z. Schlueter (https://izs.me)", + "license": "ISC", + "scripts": { + "test": "tap", + "preversion": "npm test", + "postversion": "npm publish", + "prepublishOnly": "git push origin --follow-tags" + }, + "tap": { + "check-coverage": true + }, + "devDependencies": { + "tap": "^14.10.2" + }, + "files": [ + "index.js" + ], + "repository": { + "type": "git", + "url": "git+https://github.com/npm/ci-detect.git" + } +} diff --git a/deps/npm/node_modules/@npmcli/config/LICENSE b/deps/npm/node_modules/@npmcli/config/LICENSE new file mode 100644 index 00000000000000..19cec97b184683 --- /dev/null +++ b/deps/npm/node_modules/@npmcli/config/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) npm, Inc. + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/deps/npm/node_modules/@npmcli/config/README.md b/deps/npm/node_modules/@npmcli/config/README.md new file mode 100644 index 00000000000000..fe70e4663eea16 --- /dev/null +++ b/deps/npm/node_modules/@npmcli/config/README.md @@ -0,0 +1,224 @@ +# `@npmcli/config` + +Configuration management for the npm cli. + +This module is the spiritual descendant of +[`npmconf`](http://npm.im/npmconf), and the code that once lived in npm's +`lib/config/` folder. + +It does the management of configuration files that npm uses, but +importantly, does _not_ define all the configuration defaults or types, as +those parts make more sense to live within the npm CLI itself. + +The only exceptions: + +- The `prefix` config value has some special semantics, setting the local + prefix if specified on the CLI options and not in global mode, or the + global prefix otherwise. +- The `project` config file is loaded based on the local prefix (which can + only be set by the CLI config options, and otherwise defaults to a walk + up the folder tree to the first parent containing a `node_modules` + folder, `package.json` file, or `package-lock.json` file.) +- The `userconfig` value, as set by the environment and CLI (defaulting to + `~/.npmrc`, is used to load user configs. +- The `globalconfig` value, as set by the environment, CLI, and + `userconfig` file (defaulting to `$PREFIX/etc/npmrc`) is used to load + global configs. +- A `builtin` config, read from a `npmrc` file in the root of the npm + project itself, overrides all defaults. + +The resulting hierarchy of configs: + +- CLI switches. eg `--some-key=some-value` on the command line. These are + parsed by [`nopt`](http://npm.im/nopt), which is not a great choice, but + it's the one that npm has used forever, and changing it will be + difficult. +- Environment variables. eg `npm_config_some_key=some_value` in the + environment. There is no way at this time to modify this prefix. +- INI-formatted project configs. eg `some-key = some-value` in the + `localPrefix` folder (ie, the `cwd`, or its nearest parent that contains + either a `node_modules` folder or `package.json` file.) +- INI-formatted userconfig file. eg `some-key = some-value` in `~/.npmrc`. + The `userconfig` config value can be overridden by the `cli`, `env`, or + `project` configs to change this value. +- INI-formatted globalconfig file. eg `some-key = some-value` in + the `globalPrefix` folder, which is inferred by looking at the location + of the node executable, or the `prefix` setting in the `cli`, `env`, + `project`, or `userconfig`. The `globalconfig` value at any of those + levels can override this. +- INI-formatted builtin config file. eg `some-key = some-value` in + `/usr/local/lib/node_modules/npm/npmrc`. This is not configurable, and + is determined by looking in the `npmPath` folder. +- Default values (passed in by npm when it loads this module). + +## USAGE + +```js +const Config = require('@npmcli/config') +// the types of all the configs we know about +const types = require('./config/types.js') +// default values for all the configs we know about +const defaults = require('./config/defaults.js') +// if you want -c to be short for --call and so on, define it here +const shorthands = require('./config/shorthands.js') + +const conf = new Config({ + // path to the npm module being run + npmPath: resolve(__dirname, '..'), + types, + shorthands, + defaults, + // optional, defaults to process.argv + argv: process.argv, + // optional, defaults to process.env + env: process.env, + // optional, defaults to process.execPath + execPath: process.execPath, + // optional, defaults to process.platform + platform: process.platform, + // optional, defaults to process.cwd() + cwd: process.cwd(), + // optional, defaults to emitting 'log' events on process object + // only silly, verbose, warn, and error are logged by this module + log: require('npmlog') +}) + +// returns a promise that fails if config loading fails, and +// resolves when the config object is ready for action +conf.load().then(() => { + console.log('loaded ok! some-key = ' + conf.get('some-key')) +}).catch(er => { + console.error('error loading configs!', er) +}) +``` + +## API + +The `Config` class is the sole export. + +```js +const Config = require('@npmcli/config') +``` + +### static `Config.typeDefs` + +The type definitions passed to `nopt` for CLI option parsing and known +configuration validation. + +### constructor `new Config(options)` + +Options: + +- `types` Types of all known config values. Note that some are effectively + given semantic value in the config loading process itself. +- `shorthands` An object mapping a shorthand value to an array of CLI + arguments that replace it. +- `defaults` Default values for each of the known configuration keys. + These should be defined for all configs given a type, and must be valid. +- `npmPath` The path to the `npm` module, for loading the `builtin` config + file. +- `cwd` Optional, defaults to `process.cwd()`, used for inferring the + `localPrefix` and loading the `project` config. +- `platform` Optional, defaults to `process.platform`. Used when inferring + the `globalPrefix` from the `execPath`, since this is done diferently on + Windows. +- `execPath` Optional, defaults to `process.execPath`. Used to infer the + `globalPrefix`. +- `log` Optional, the object used to log debug messages, warnings, and + errors. Defaults to emitting on the `process` object. +- `env` Optional, defaults to `process.env`. Source of the environment + variables for configuration. +- `argv` Optional, defaults to `process.argv`. Source of the CLI options + used for configuration. + +Returns a `config` object, which is not yet loaded. + +Fields: + +- `config.globalPrefix` The prefix for `global` operations. Set by the + `prefix` config value, or defaults based on the location of the + `execPath` option. +- `config.localPrefix` The prefix for `local` operations. Set by the + `prefix` config value on the CLI only, or defaults to either the `cwd` or + its nearest ancestor containing a `node_modules` folder or `package.json` + file. +- `config.sources` A read-only `Map` of the file (or a comment, if no file + found, or relevant) to the config level loaded from that source. +- `config.data` A `Map` of config level to `ConfigData` objects. These + objects should not be modified directly under any circumstances. + - `source` The source where this data was loaded from. + - `raw` The raw data used to generate this config data, as it was parsed + initially from the environment, config file, or CLI options. + - `data` The data object reflecting the inheritance of configs up to this + point in the chain. + - `loadError` Any errors encountered that prevented the loading of this + config data. +- `config.list` A list sorted in priority of all the config data objects in + the prototype chain. `config.list[0]` is the `cli` level, + `config.list[1]` is the `env` level, and so on. +- `cwd` The `cwd` param +- `env` The `env` param +- `argv` The `argv` param +- `execPath` The `execPath` param +- `platform` The `platform` param +- `log` The `log` param +- `defaults` The `defaults` param +- `shorthands` The `shorthands` param +- `types` The `types` param +- `npmPath` The `npmPath` param +- `globalPrefix` The effective `globalPrefix` +- `localPrefix` The effective `localPrefix` +- `prefix` If `config.get('global')` is true, then `globalPrefix`, + otherwise `localPrefix` +- `home` The user's home directory, found by looking at `env.HOME` or + calling `os.homedir()`. +- `loaded` A boolean indicating whether or not configs are loaded +- `valid` A getter that returns `true` if all the config objects are valid. + Any data objects that have been modified with `config.set(...)` will be + re-evaluated when `config.valid` is read. + +### `config.load()` + +Load configuration from the various sources of information. + +Returns a `Promise` that resolves when configuration is loaded, and fails +if a fatal error is encountered. + +### `config.find(key)` + +Find the effective place in the configuration levels a given key is set. +Returns one of: `cli`, `env`, `project`, `user`, `global`, `builtin`, or +`default`. + +Returns `null` if the key is not set. + +### `config.get(key, where = 'cli')` + +Load the given key from the config stack. + +### `config.set(key, value, where = 'cli')` + +Set the key to the specified value, at the specified level in the config +stack. + +### `config.delete(key, where = 'cli')` + +Delete the configuration key from the specified level in the config stack. + +### `config.validate(where)` + +Verify that all known configuration options are set to valid values, and +log a warning if they are invalid. + +If `where` is not set, then all config objects are validated. + +Returns `true` if all configs are valid. + +Note that it's usually enough (and more efficient) to just check +`config.valid`, since each data object is marked for re-evaluation on every +`config.set()` operation. + +### `config.save(where)` + +Save the config file specified by the `where` param. Must be one of +`project`, `user`, `global`, `builtin`. diff --git a/deps/npm/node_modules/@npmcli/config/lib/env-replace.js b/deps/npm/node_modules/@npmcli/config/lib/env-replace.js new file mode 100644 index 00000000000000..464dc550b00fb7 --- /dev/null +++ b/deps/npm/node_modules/@npmcli/config/lib/env-replace.js @@ -0,0 +1,13 @@ +// replace any ${ENV} values with the appropriate environ. + +const envExpr = /(\\*)\$\{([^}]+)\}/g + +module.exports = (f, env) => f.replace(envExpr, (orig, esc, name) => { + const val = env[name] !== undefined ? env[name] : `\$\{${name}\}` + + // consume the escape chars that are relevant. + if (esc.length % 2) + return orig.substr((esc.length + 1) / 2) + + return (esc.substr(esc.length / 2)) + val +}) diff --git a/deps/npm/node_modules/@npmcli/config/lib/index.js b/deps/npm/node_modules/@npmcli/config/lib/index.js new file mode 100644 index 00000000000000..af19e720f866bb --- /dev/null +++ b/deps/npm/node_modules/@npmcli/config/lib/index.js @@ -0,0 +1,747 @@ +// TODO: set the scope config from package.json or explicit cli config +const walkUp = require('walk-up-path') +const ini = require('ini') +const nopt = require('nopt') +const mkdirp = require('mkdirp-infer-owner') + +/* istanbul ignore next */ +const myUid = process.getuid && process.getuid() +/* istanbul ignore next */ +const myGid = process.getgid && process.getgid() + +const { resolve, dirname, join } = require('path') +const { homedir } = require('os') +const { promisify } = require('util') +const fs = require('fs') +const readFile = promisify(fs.readFile) +const writeFile = promisify(fs.writeFile) +const chmod = promisify(fs.chmod) +const chown = promisify(fs.chown) +const unlink = promisify(fs.unlink) +const stat = promisify(fs.stat) + +const hasOwnProperty = (obj, key) => + Object.prototype.hasOwnProperty.call(obj, key) + +// define a custom getter, but turn into a normal prop +// if we set it. otherwise it can't be set on child objects +const settableGetter = (obj, key, get) => { + Object.defineProperty(obj, key, { + get, + set (value) { + Object.defineProperty(obj, key, { + value, + configurable: true, + writable: true, + enumerable: true, + }) + }, + configurable: true, + enumerable: true, + }) +} + +const typeDefs = require('./type-defs.js') +const nerfDart = require('./nerf-dart.js') +const envReplace = require('./env-replace.js') +const parseField = require('./parse-field.js') +const typeDescription = require('./type-description.js') +const setEnvs = require('./set-envs.js') + +// types that can be saved back to +const confFileTypes = new Set([ + 'global', + 'user', + 'project', +]) + +const confTypes = new Set([ + 'default', + 'builtin', + ...confFileTypes, + 'env', + 'cli', +]) + +const _loaded = Symbol('loaded') +const _get = Symbol('get') +const _find = Symbol('find') +const _loadObject = Symbol('loadObject') +const _loadFile = Symbol('loadFile') + +class Config { + static get typeDefs () { + return typeDefs + } + + constructor ({ + types, + shorthands, + defaults, + npmPath, + + // options just to override in tests, mostly + env = process.env, + argv = process.argv, + log = require('./proc-log.js'), + platform = process.platform, + execPath = process.execPath, + cwd = process.cwd(), + }) { + this.npmPath = npmPath + this.types = types + this.shorthands = shorthands + this.defaults = defaults + this.log = log + this.argv = argv + this.env = env + this.execPath = execPath + this.platform = platform + this.cwd = cwd + + // set when we load configs + this.globalPrefix = null + this.localPrefix = null + + // defaults to env.HOME, but will always be *something* + this.home = null + + // set up the prototype chain of config objects + const wheres = [...confTypes] + this.data = new Map() + let parent = null + for (const where of wheres) { + this.data.set(where, parent = new ConfigData(parent)) + } + + this.data.set = () => { + throw new Error('cannot change internal config data structure') + } + this.data.delete = () => { + throw new Error('cannot change internal config data structure') + } + + this.sources = new Map([]) + + this.list = [] + for (const { data } of this.data.values()) { + this.list.unshift(data) + } + Object.freeze(this.list) + + this[_loaded] = false + } + + get loaded () { + return this[_loaded] + } + + get prefix () { + return this[_get]('global') ? this.globalPrefix : this.localPrefix + } + + // return the location where key is found. + find (key) { + if (!this.loaded) + throw new Error('call config.load() before reading values') + return this[_find](key) + } + [_find] (key) { + // have to look in reverse order + const entries = [...this.data.entries()] + for (let i = entries.length - 1; i > -1; i--) { + const [where, { data }] = entries[i] + if (hasOwnProperty(data, key)) + return where + } + return null + } + + get (key, where) { + if (!this.loaded) + throw new Error('call config.load() before reading values') + return this[_get](key, where) + } + // we need to get values sometimes, so use this internal one to do so + // while in the process of loading. + [_get] (key, where = null) { + if (where !== null && !confTypes.has(where)) { + throw new Error('invalid config location param: ' + where) + } + const { data, source } = this.data.get(where || 'cli') + return where === null || hasOwnProperty(data, key) ? data[key] : undefined + } + + set (key, val, where = 'cli') { + if (!this.loaded) + throw new Error('call config.load() before setting values') + if (!confTypes.has(where)) + throw new Error('invalid config location param: ' + where) + this.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 + } + + delete (key, where = 'cli') { + if (!this.loaded) + throw new Error('call config.load() before deleting values') + if (!confTypes.has(where)) + throw new Error('invalid config location param: ' + where) + delete this.data.get(where).data[key] + } + + async load () { + if (this.loaded) + throw new Error('attempting to load npm config multiple times') + + process.emit('time', 'config:load') + // first load the defaults, which sets the global prefix + process.emit('time', 'config:load:defaults') + this.loadDefaults() + process.emit('timeEnd', 'config:load:defaults') + + // next load the builtin config, as this sets new effective defaults + process.emit('time', 'config:load:builtin') + await this.loadBuiltinConfig() + process.emit('timeEnd', 'config:load:builtin') + + // cli and env are not async, and can set the prefix, relevant to project + process.emit('time', 'config:load:cli') + this.loadCLI() + process.emit('timeEnd', 'config:load:cli') + process.emit('time', 'config:load:env') + this.loadEnv() + process.emit('timeEnd', 'config:load:env') + + // next project config, which can affect userconfig location + process.emit('time', 'config:load:project') + await this.loadProjectConfig() + process.emit('timeEnd', 'config:load:project') + // then user config, which can affect globalconfig location + process.emit('time', 'config:load:user') + await this.loadUserConfig() + process.emit('timeEnd', 'config:load:user') + // last but not least, global config file + process.emit('time', 'config:load:global') + 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() + process.emit('timeEnd', 'config:load:validate') + + // set this before calling setEnvs, so that we don't have to share + // symbols, as that module also does a bunch of get operations + this[_loaded] = true + + // set proper globalPrefix now that everything is loaded + this.globalPrefix = this.get('prefix') + + process.emit('time', 'config:load:setEnvs') + this.setEnvs() + process.emit('timeEnd', 'config:load:setEnvs') + + process.emit('timeEnd', 'config:load') + } + + loadDefaults () { + this.loadGlobalPrefix() + this.loadHome() + + this[_loadObject]({ + ...this.defaults, + prefix: this.globalPrefix, + }, 'default', 'default values') + + const { data } = this.data.get('default') + + // the metrics-registry defaults to the current resolved value of + // the registry, unless overridden somewhere else. + settableGetter(data, 'metrics-registry', () => this[_get]('registry')) + + // if the prefix is set on cli, env, or userconfig, then we need to + // default the globalconfig file to that location, instead of the default + // global prefix. It's weird that `npm get globalconfig --prefix=/foo` + // returns `/foo/etc/npmrc`, but better to not change it at this point. + settableGetter(data, 'globalconfig', () => + resolve(this[_get]('prefix'), 'etc/npmrc')) + } + + loadHome () { + if (this.env.HOME) + return this.home = this.env.HOME + this.home = homedir() + } + + loadGlobalPrefix () { + if (this.globalPrefix) + throw new Error('cannot load default global prefix more than once') + + if (this.env.PREFIX) { + this.globalPrefix = this.env.PREFIX + } else if (this.platform === 'win32') { + // c:\node\node.exe --> prefix=c:\node\ + this.globalPrefix = dirname(this.execPath) + } else { + // /usr/local/bin/node --> prefix=/usr/local + this.globalPrefix = dirname(dirname(this.execPath)) + + // destdir only is respected on Unix + if (this.env.DESTDIR) + this.globalPrefix = join(this.env.DESTDIR, this.globalPrefix) + } + } + + loadEnv () { + const prefix = 'npm_config_' + const conf = Object.create(null) + for (const [envKey, envVal] of Object.entries(this.env)) { + if (!/^npm_config_/i.test(envKey) || envVal === '') + continue + const key = envKey.substr('npm_config_'.length) + .replace(/(?!^)_/g, '-') // don't replace _ at the start of the key + .toLowerCase() + conf[key] = envVal + } + this[_loadObject](conf, 'env', 'environment') + } + + loadCLI () { + nopt.invalidHandler = (k, val, type) => + this.invalidHandler(k, val, type, 'command line options', 'cli') + const conf = nopt(this.types, this.shorthands, this.argv) + nopt.invalidHandler = null + this.parsedArgv = conf.argv + delete conf.argv + this[_loadObject](conf, 'cli', 'command line options') + } + + get valid () { + for (const [where, {valid}] of this.data.entries()) { + if (valid === false || valid === null && !this.validate(where)) + return false + } + return true + } + + validate (where) { + if (!where) { + let valid = true + for (const [where, obj] of this.data.entries()) { + // no need to validate our defaults, we know they're fine + // cli was already validated when parsed the first time + if (where === 'default' || where === 'builtin' || where === 'cli') + continue + const ret = this.validate(where) + valid = valid && ret + } + return valid + } else { + const obj = this.data.get(where) + obj[_valid] = true + + nopt.invalidHandler = (k, val, type) => + this.invalidHandler(k, val, type, obj.source, where) + + nopt.clean(obj.data, this.types, this.typeDefs) + + nopt.invalidHandler = null + return obj[_valid] + } + } + + invalidHandler (k, val, type, source, where) { + this.log.warn( + 'invalid config', + k + '=' + JSON.stringify(val), + `set in ${source}` + ) + this.data.get(where)[_valid] = false + + if (Array.isArray(type)) { + if (type.indexOf(typeDefs.url.type) !== -1) + 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) + type = typeDefs.path.type + } + } + + const typeDesc = typeDescription(type) + const oneOrMore = typeDesc.indexOf(Array) !== -1 + const mustBe = typeDesc + .filter(m => m !== undefined && m !== Array) + const oneOf = mustBe.length === 1 && oneOrMore ? ' one or more' + : mustBe.length > 1 && oneOrMore ? ' one or more of:' + : mustBe.length > 1 ? ' one of:' + : '' + const msg = 'Must be' + oneOf + const desc = mustBe.length === 1 ? mustBe[0] + : mustBe.filter(m => m !== Array) + .map(n => typeof n === 'string' ? n : JSON.stringify(n)) + .join(', ') + this.log.warn('invalid config', msg, desc) + } + + [_loadObject] (obj, where, source, er = null) { + const conf = this.data.get(where) + if (conf.source) { + const m = `double-loading "${where}" configs from ${source}, ` + + `previously loaded from ${conf.source}` + throw new Error(m) + } + + if (this.sources.has(source)) { + const m = `double-loading config "${source}" as "${where}", ` + + `previously loaded as "${this.sources.get(source)}"` + throw new Error(m) + } + + conf.source = source + this.sources.set(source, where) + if (er) { + conf.loadError = er + if (er.code !== 'ENOENT') + this.log.verbose('config', `error loading ${where} config`, er) + } else { + conf.raw = obj + for (const [key, value] of Object.entries(obj)) { + const k = envReplace(key, this.env) + const v = this.parseField(value, k) + conf.data[k] = v + } + } + } + + // Parse a field, coercing it to the best type available. + parseField (f, key, listElement = false) { + return parseField(f, key, this, listElement) + } + + async [_loadFile] (file, type) { + process.emit('time', 'config:load:file:' + file) + // only catch the error from readFile, not from the loadObject call + await readFile(file, 'utf8').then( + data => this[_loadObject](ini.parse(data), type, file), + er => this[_loadObject](null, type, file, er) + ) + process.emit('timeEnd', 'config:load:file:' + file) + } + + loadBuiltinConfig () { + return this[_loadFile](resolve(this.npmPath, 'npmrc'), 'builtin') + } + + async loadProjectConfig () { + // the localPrefix can be set by the CLI config, but otherwise is + // found by walking up the folder tree + await this.loadLocalPrefix() + const projectFile = resolve(this.localPrefix, '.npmrc') + // if we're in the ~ directory, and there happens to be a node_modules + // folder (which is not TOO uncommon, it turns out), then we can end + // up loading the "project" config where the "userconfig" will be, + // which causes some calamaties. So, we only load project config if + // it doesn't match what the userconfig will be. + if (projectFile !== this[_get]('userconfig')) + return this[_loadFile](projectFile, 'project') + else { + this.data.get('project').source = '(same as "user" config, ignored)' + this.sources.set(this.data.get('project').source, 'project') + } + } + + async loadLocalPrefix () { + const cliPrefix = this[_get]('prefix', 'cli') + if (cliPrefix) { + this.localPrefix = cliPrefix + return + } + + for (const p of walkUp(this.cwd)) { + // walk up until we have a nm dir or a pj file + const hasAny = (await Promise.all([ + stat(resolve(p, 'node_modules')) + .then(st => st.isDirectory()) + .catch(() => false), + stat(resolve(p, 'package.json')) + .then(st => st.isFile()) + .catch(() => false), + ])).some(is => is) + if (hasAny) { + this.localPrefix = p + return + } + } + + this.localPrefix = this.cwd + } + + loadUserConfig () { + return this[_loadFile](this[_get]('userconfig'), 'user') + } + + loadGlobalConfig () { + return this[_loadFile](this[_get]('globalconfig'), 'global') + } + + async save (where) { + if (!this.loaded) + throw new Error('call config.load() before saving') + if (!confFileTypes.has(where)) + throw new Error('invalid config location param: ' + where) + const conf = this.data.get(where) + conf[_raw] = { ...conf.data } + conf[_loadError] = null + + // upgrade auth configs to more secure variants before saving + if (where === 'user') { + const reg = this.get('registry') + const creds = this.getCredentialsByURI(reg) + try { this.setCredentialsByURI(reg, creds) } catch (_) {} + } + + const iniData = ini.stringify(conf.data).trim() + '\n' + if (!iniData.trim()) { + // ignore the unlink error (eg, if file doesn't exist) + await unlink(conf.source).catch(er => {}) + return + } + const dir = dirname(conf.source) + await mkdirp(dir) + await writeFile(conf.source, iniData, 'utf8') + // don't leave a root-owned config file lying around + /* istanbul ignore if - this is best-effort and a pita to test */ + if (myUid === 0) { + const st = await stat(dir).catch(() => null) + if (st && (st.uid !== myUid || st.gid !== myGid)) + await chown(conf.source, st.uid, st.gid).catch(() => {}) + } + const mode = where === 'user' ? 0o600 : 0o666 + await chmod(conf.source, mode) + } + + clearCredentialsByURI (uri) { + const nerfed = nerfDart(uri) + const def = nerfDart(this.get('registry')) + if (def === nerfed) { + this.delete(`-authtoken`, 'user') + this.delete(`_authToken`, 'user') + this.delete(`_auth`, 'user') + this.delete(`_password`, 'user') + this.delete(`username`, 'user') + this.delete(`email`, 'user') + } + this.delete(`${nerfed}:-authtoken`, 'user') + this.delete(`${nerfed}:_authToken`, 'user') + this.delete(`${nerfed}:_auth`, 'user') + this.delete(`${nerfed}:_password`, 'user') + this.delete(`${nerfed}:username`, 'user') + this.delete(`${nerfed}:email`, 'user') + } + + setCredentialsByURI (uri, { token, username, password, email, alwaysAuth }) { + const nerfed = nerfDart(uri) + const def = nerfDart(this.get('registry')) + + if (def === nerfed) { + // remove old style auth info not limited to a single registry + this.delete('_password', 'user') + this.delete('username', 'user') + this.delete('email', 'user') + this.delete('_auth', 'user') + this.delete('_authtoken', 'user') + this.delete('_authToken', 'user') + } + + this.delete(`${nerfed}:-authtoken`) + if (token) { + this.set(`${nerfed}:_authToken`, token, 'user') + this.delete(`${nerfed}:_password`, 'user') + this.delete(`${nerfed}:username`, 'user') + this.delete(`${nerfed}:email`, 'user') + this.delete(`${nerfed}:always-auth`, 'user') + } else if (username || password || email) { + if (!username) + throw new Error('must include username') + if (!password) + throw new Error('must include password') + if (!email) + throw new Error('must include email') + this.delete(`${nerfed}:_authToken`, 'user') + this.set(`${nerfed}:username`, username, 'user') + // note: not encrypted, no idea why we bothered to do this, but oh well + // protects against shoulder-hacks if password is memorable, I guess? + const encoded = Buffer.from(password, 'utf8').toString('base64') + this.set(`${nerfed}:_password`, encoded, 'user') + this.set(`${nerfed}:email`, email, 'user') + if (alwaysAuth !== undefined) + this.set(`${nerfed}:always-auth`, alwaysAuth, 'user') + else + this.delete(`${nerfed}:always-auth`, 'user') + } else { + throw new Error('No credentials to set.') + } + } + + // this has to be a bit more complicated to support legacy data of all forms + getCredentialsByURI (uri) { + const nerfed = nerfDart(uri) + const creds = {} + + // you can set always-auth for a single registry, or as a default + const alwaysAuthReg = this.get(`${nerfed}:always-auth`) + if (alwaysAuthReg !== undefined) + creds.alwaysAuth = !!alwaysAuthReg + else + creds.alwaysAuth = this.get('always-auth') + + const email = this.get(`${nerfed}:email`) || this.get('email') + if (email) + creds.email = email + + const tokenReg = this.get(`${nerfed}:_authToken`) || + this.get(`${nerfed}:-authtoken`) || + nerfed === nerfDart(this.get('registry')) && this.get('_authToken') + + if (tokenReg) { + creds.token = tokenReg + return creds + } + + const userReg = this.get(`${nerfed}:username`) + const passReg = this.get(`${nerfed}:_password`) + if (userReg && passReg) { + creds.username = userReg + creds.password = Buffer.from(passReg, 'base64').toString('utf8') + const auth = `${creds.username}:${creds.password}` + creds.auth = Buffer.from(auth, 'utf8').toString('base64') + return creds + } + + // at this point, we can only use the values if the URI is the + // default registry. + const defaultNerf = nerfDart(this.get('registry')) + if (nerfed !== defaultNerf) + return creds + + const userDef = this.get('username') + const passDef = this.get('_password') + if (userDef && passDef) { + creds.username = userDef + creds.password = Buffer.from(passDef, 'base64').toString('utf8') + const auth = `${creds.username}:${creds.password}` + creds.auth = Buffer.from(auth, 'utf8').toString('base64') + return creds + } + + // Handle the old-style _auth= style for the default + // registry, if set. + const auth = this.get('_auth') + if (!auth) + return creds + + const authDecode = Buffer.from(auth, 'base64').toString('utf8') + const authSplit = authDecode.split(':') + creds.username = authSplit.shift() + creds.password = authSplit.join(':') + creds.auth = auth + 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, + }) + } + + // set up the environment object we have with npm_config_* environs + // for all configs that are different from their default values, and + // set EDITOR and HOME. + setEnvs () { setEnvs(this) } +} + +const _data = Symbol('data') +const _raw = Symbol('raw') +const _loadError = Symbol('loadError') +const _source = Symbol('source') +const _valid = Symbol('valid') +class ConfigData { + constructor (parent) { + this[_data] = Object.create(parent && parent.data) + this[_source] = null + this[_loadError] = null + this[_raw] = null + this[_valid] = true + } + + get data () { + return this[_data] + } + + get valid () { + return this[_valid] + } + + set source (s) { + if (this[_source]) + throw new Error('cannot set ConfigData source more than once') + this[_source] = s + } + get source () { return this[_source] } + + set loadError (e) { + if (this[_loadError] || this[_raw]) + throw new Error('cannot set ConfigData loadError after load') + this[_loadError] = e + } + get loadError () { return this[_loadError] } + + set raw (r) { + if (this[_raw] || this[_loadError]) + throw new Error('cannot set ConfigData raw after load') + this[_raw] = r + } + get raw () { return this[_raw] } +} + +module.exports = Config diff --git a/deps/npm/node_modules/@npmcli/config/lib/nerf-dart.js b/deps/npm/node_modules/@npmcli/config/lib/nerf-dart.js new file mode 100644 index 00000000000000..d6ae4aa2aa7e2a --- /dev/null +++ b/deps/npm/node_modules/@npmcli/config/lib/nerf-dart.js @@ -0,0 +1,18 @@ +const { URL } = require('url') + +/** + * Maps a URL to an identifier. + * + * Name courtesy schiffertronix media LLC, a New Jersey corporation + * + * @param {String} uri The URL to be nerfed. + * + * @returns {String} A nerfed URL. + */ +module.exports = (url) => { + const parsed = new URL(url) + const from = `${parsed.protocol}//${parsed.host}${parsed.pathname}` + const rel = new URL('.', from) + const res = `//${rel.host}${rel.pathname}` + return res +} diff --git a/deps/npm/node_modules/@npmcli/config/lib/parse-field.js b/deps/npm/node_modules/@npmcli/config/lib/parse-field.js new file mode 100644 index 00000000000000..216295a5f81d8c --- /dev/null +++ b/deps/npm/node_modules/@npmcli/config/lib/parse-field.js @@ -0,0 +1,75 @@ +// Parse a field, coercing it to the best type available. +const typeDefs = require('./type-defs.js') +const envReplace = require('./env-replace.js') +const { resolve } = require('path') + +const { parse: umaskParse } = require('./umask.js') + +const parseField = (f, key, opts, listElement = false) => { + if (typeof f !== 'string' && !Array.isArray(f)) + return f + + const { platform, types, log, home, env } = opts + + // type can be array or a single thing. coerce to array. + const typeList = new Set([].concat(types[key])) + const isPath = typeList.has(typeDefs.path.type) + const isBool = typeList.has(typeDefs.Boolean.type) + const isString = typeList.has(typeDefs.String.type) + const isUmask = typeList.has(typeDefs.Umask.type) + const isNumber = typeList.has(typeDefs.Number.type) + const isList = !listElement && typeList.has(Array) + + if (Array.isArray(f)) + return !isList ? f : f.map(field => parseField(field, key, opts, true)) + + // now we know it's a string + f = f.trim() + + // list types get put in the environment separated by double-\n + // usually a single \n would suffice, but ca/cert configs can contain + // line breaks and multiple entries. + if (isList) + return parseField(f.split('\n\n'), key, opts) + + // --foo is like --foo=true for boolean types + if (isBool && !isString && f === '') + return true + + // string types can be the string 'true', 'false', etc. + // otherwise, parse these values out + if (!isString) { + switch (f) { + case 'true': return true + case 'false': return false + case 'null': return null + case 'undefined': return undefined + } + } + + f = envReplace(f, env) + + if (isPath) { + const homePattern = platform === 'win32' ? /^~(\/|\\)/ : /^~\// + if (homePattern.test(f) && home) + f = resolve(home, f.substr(2)) + else + f = resolve(f) + } + + if (isUmask) { + try { + return umaskParse(f) + } catch (er) { + // let it warn later when we validate + return f + } + } + + if (isNumber && !isNaN(f)) + f = +f + + return f +} + +module.exports = parseField diff --git a/deps/npm/node_modules/@npmcli/config/lib/proc-log.js b/deps/npm/node_modules/@npmcli/config/lib/proc-log.js new file mode 100644 index 00000000000000..0492a261807564 --- /dev/null +++ b/deps/npm/node_modules/@npmcli/config/lib/proc-log.js @@ -0,0 +1,4 @@ +const log = (level) => (...args) => process.emit('log', level, ...args) +for (const level of ['silly', 'verbose', 'warn', 'error']) { + exports[level] = log(level) +} diff --git a/deps/npm/node_modules/@npmcli/config/lib/set-envs.js b/deps/npm/node_modules/@npmcli/config/lib/set-envs.js new file mode 100644 index 00000000000000..d41b044ed9298d --- /dev/null +++ b/deps/npm/node_modules/@npmcli/config/lib/set-envs.js @@ -0,0 +1,99 @@ +// Set environment variables for any non-default configs, +// so that they're already there when we run lifecycle scripts. +// +// See https://github.com/npm/rfcs/pull/90 + +// Return the env key if this is a thing that belongs in the env. +// Ie, if the key isn't a @scope, //nerf.dart, or _private, +// and the value is a string or array. Otherwise return false. +const envKey = (key, val) => { + return !/^[/@_]/.test(key) && + (typeof envVal(val) === 'string') && + `npm_config_${key.replace(/-/g, '_').toLowerCase()}` +} + +const envVal = val => Array.isArray(val) ? val.map(v => envVal(v)).join('\n\n') + : val === null || val === undefined || val === false ? '' + : typeof val === 'object' ? null + : String(val) + +const sameConfigValue = (def, val) => + !Array.isArray(val) || !Array.isArray(def) ? def === val + : sameArrayValue(def, val) + +const sameArrayValue = (def, val) => { + if (def.length !== val.length) + return false + + for (let i = 0; i < def.length; i++) { + /* istanbul ignore next - there are no array configs where the default + * is not an empty array, so this loop is a no-op, but it's the correct + * thing to do if we ever DO add a config like that. */ + if (def[i] !== val[i]) + return false + } + return true +} + +const setEnv = (env, rawKey, rawVal) => { + const val = envVal(rawVal) + const key = envKey(rawKey, val) + if (key && val !== null) + env[key] = val +} + +const setEnvs = (config) => { + // This ensures that all npm config values that are not the defaults are + // shared appropriately with child processes, without false positives. + const { + globalPrefix, + platform, + env, + defaults, + list: [cliConf, envConf], + } = config + + const { DESTDIR } = env + if (platform !== 'win32' && DESTDIR && globalPrefix.indexOf(DESTDIR) === 0) + env.PREFIX = globalPrefix.substr(DESTDIR.length) + else + env.PREFIX = globalPrefix + + // if the key is the default value, + // if the environ is NOT the default value, + // set the environ + // else skip it, it's fine + // if the key is NOT the default value, + // if the env is setting it, then leave it (already set) + // otherwise, set the env + const cliSet = new Set(Object.keys(cliConf)) + const envSet = new Set(Object.keys(envConf)) + for (const key in cliConf) { + if (sameConfigValue(defaults[key], cliConf[key])) { + // config is the default, if the env thought different, then we + // have to set it BACK to the default in the environment. + if (!sameConfigValue(envConf[key], cliConf[key])) + setEnv(env, key, cliConf[key]) + } else { + // config is not the default. if the env wasn't the one to set + // it that way, then we have to put it in the env + if (!(envSet.has(key) && !cliSet.has(key))) + setEnv(env, key, cliConf[key]) + } + } + + // also set some other common nice envs that we want to rely on + env.HOME = config.home + if (cliConf.editor) + env.EDITOR = cliConf.editor + + // note: this doesn't afect the *current* node process, of course, since + // it's already started, but it does affect the options passed to scripts. + if (cliConf['node-options']) + env.NODE_OPTIONS = cliConf['node-options'] + + env.npm_execpath = require.main.filename + env.npm_node_execpath = config.execPath +} + +module.exports = setEnvs diff --git a/deps/npm/node_modules/@npmcli/config/lib/type-defs.js b/deps/npm/node_modules/@npmcli/config/lib/type-defs.js new file mode 100644 index 00000000000000..07703206c57439 --- /dev/null +++ b/deps/npm/node_modules/@npmcli/config/lib/type-defs.js @@ -0,0 +1,49 @@ +const nopt = require('nopt') + +const { Umask, validate: validateUmask } = require('./umask.js') + +const semver = require('semver') +const validateSemver = (data, k, val) => { + const valid = semver.valid(val) + if (!valid) + return false + data[k] = valid +} + +// add descriptions so we can validate more usefully +module.exports = { + ...nopt.typeDefs, + semver: { + type: semver, + validate: validateSemver, + description: 'full valid SemVer string', + }, + Umask: { + type: Umask, + validate: validateUmask, + description: 'octal number in range 0o000..0o777 (0..511)', + }, + url: { + ...nopt.typeDefs.url, + description: 'full url with "http://"', + }, + path: { + ...nopt.typeDefs.path, + description: 'valid filesystem path', + }, + Number: { + ...nopt.typeDefs.Number, + description: 'numeric value', + }, + Boolean: { + ...nopt.typeDefs.Boolean, + description: 'boolean value (true or false)', + }, + Date: { + ...nopt.typeDefs.Date, + description: 'valid Date string', + }, +} + +// TODO: make nopt less of a global beast so this kludge isn't necessary +nopt.typeDefs = module.exports diff --git a/deps/npm/node_modules/@npmcli/config/lib/type-description.js b/deps/npm/node_modules/@npmcli/config/lib/type-description.js new file mode 100644 index 00000000000000..828a747db4aac5 --- /dev/null +++ b/deps/npm/node_modules/@npmcli/config/lib/type-description.js @@ -0,0 +1,18 @@ +// return the description of the valid values of a field +// returns a string for one thing, or an array of descriptions +const typeDefs = require('./type-defs.js') +const typeDescription = t => { + if (!t || typeof t !== 'function' && typeof t !== 'object') + return t + + if (Array.isArray(t)) + return t.map(t => typeDescription(t)) + + for (const { type, description } of Object.values(typeDefs)) { + if (type === t) + return description || type + } + + return t +} +module.exports = t => [].concat(typeDescription(t)).filter(t => t !== undefined) diff --git a/deps/npm/node_modules/@npmcli/config/lib/umask.js b/deps/npm/node_modules/@npmcli/config/lib/umask.js new file mode 100644 index 00000000000000..b445c6fca95bfa --- /dev/null +++ b/deps/npm/node_modules/@npmcli/config/lib/umask.js @@ -0,0 +1,28 @@ +class Umask {} +const parse = val => { + if (typeof val === 'string') { + if (/^0o?[0-7]+$/.test(val)) + return parseInt(val.replace(/^0o?/, ''), 8) + else if (/^[1-9][0-9]*$/.test(val)) + return parseInt(val, 10) + else + throw new Error(`invalid umask value: ${val}`) + } + if (typeof val !== 'number') + throw new Error(`invalid umask value: ${val}`) + val = Math.floor(val) + if (val < 0 || val > 511) + throw new Error(`invalid umask value: ${val}`) + return val +} + +const validate = (data, k, val) => { + try { + data[k] = parse(val) + return true + } catch (er) { + return false + } +} + +module.exports = { Umask, parse, validate } diff --git a/deps/npm/node_modules/@npmcli/config/package.json b/deps/npm/node_modules/@npmcli/config/package.json new file mode 100644 index 00000000000000..b16d2f286efaab --- /dev/null +++ b/deps/npm/node_modules/@npmcli/config/package.json @@ -0,0 +1,38 @@ +{ + "name": "@npmcli/config", + "version": "1.1.8", + "files": [ + "lib" + ], + "main": "lib/index.js", + "description": "Configuration management for the npm cli", + "repository": { + "type": "git", + "url": "git+https://github.com/npm/config" + }, + "author": "Isaac Z. Schlueter (https://izs.me)", + "license": "ISC", + "scripts": { + "test": "tap", + "snap": "tap", + "preversion": "npm test", + "postversion": "npm publish", + "prepublishOnly": "git push origin --follow-tags" + }, + "tap": { + "check-coverage": true, + "coverage-map": "map.js" + }, + "devDependencies": { + "tap": "^14.10.8" + }, + "dependencies": { + "walk-up-path": "^1.0.0", + "ini": "^1.3.5", + "nopt": "^5.0.0", + "mkdirp-infer-owner": "^2.0.0" + }, + "engines": { + "node": ">=10" + } +} diff --git a/deps/npm/node_modules/@npmcli/git/LICENSE b/deps/npm/node_modules/@npmcli/git/LICENSE new file mode 100644 index 00000000000000..8f90f96f4c6c50 --- /dev/null +++ b/deps/npm/node_modules/@npmcli/git/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) npm, Inc. + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE NPM DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS. IN NO EVENT SHALL THE NPM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, +OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, +DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS +ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. diff --git a/deps/npm/node_modules/@npmcli/git/README.md b/deps/npm/node_modules/@npmcli/git/README.md new file mode 100644 index 00000000000000..ca8afcbce41d5e --- /dev/null +++ b/deps/npm/node_modules/@npmcli/git/README.md @@ -0,0 +1,157 @@ +# @npmcli/git + +A utility for spawning git from npm CLI contexts. + +This is _not_ an implementation of git itself, it's just a thing that +spawns child processes to tell the system git CLI implementation to do +stuff. + +## USAGE + +```js +const git = require('@npmcli/git') +git.clone('git://foo/bar.git', 'some-branch', 'some-path', opts) // clone a repo + .then(() => git.spawn(['checkout', 'some-branch'], {cwd: 'bar'})) + .then(() => git.spawn(['you get the idea'])) +``` + +## API + +Most methods take an options object. Options are described below. + +### `git.spawn(args, opts = {})` + +Launch a `git` subprocess with the arguments specified. + +All the other functions call this one at some point. + +Processes are launched using +[`@npmcli/promise-spawn`](http://npm.im/@npmcli/promise-spawn), with the +`stdioString: true` option enabled by default, since git output is +generally in readable string format. + +Return value is a `Promise` that resolves to a result object with `{cmd, +args, code, signal, stdout, stderr}` members, or rejects with an error with +the same fields, passed back from +[`@npmcli/promise-spawn`](http://npm.im/@npmcli/promise-spawn). + +### `git.clone(repo, ref = 'HEAD', target = null, opts = {})` -> `Promise` + +Clone the repository into `target` path (or the default path for the name +of the repository), checking out `ref`. + +Return value is the sha of the current HEAD in the locally cloned +repository. + +In lieu of a specific `ref`, you may also pass in a `spec` option, which is +a [`npm-package-arg`](http://npm.im/npm-package-arg) object for a `git` +package dependency reference. In this way, you can select SemVer tags +within a range, or any git committish value. For example: + +```js +const npa = require('npm-package-arg') +git.clone('git@github.com:npm/git.git', '', null, { + spec: npa('github:npm/git#semver:1.x'), +}) + +// only gitRange and gitCommittish are relevant, so this works, too +git.clone('git@github.com:npm/git.git', null, null, { + spec: { gitRange: '1.x' } +}) +``` + +This will automatically do a shallow `--depth=1` clone on any hosts that +are known to support it. To force a shallow or deep clone, you can set the +`gitShallow` option to `true` or `false` respectively. + +### `git.revs(repo, opts = {})` -> `Promise` + +Fetch a representation of all of the named references in a given +repository. The resulting doc is intentionally somewhat +[packument](https://www.npmjs.com/package/pacote#packuments)-like, so that +git semver ranges can be applied using the same +[`npm-pick-manifest`](http://npm.im/npm-pick-manifest) logic. + +The resulting object looks like: + +```js +revs = { + versions: { + // all semver-looking tags go in here... + // version: { sha, ref, rawRef, type } + '1.0.0': { + sha: '1bc5fba3353f8e1b56493b266bc459276ab23139', + ref: 'v1.0.0', + rawRef: 'refs/tags/v1.0.0', + type: 'tag', + }, + }, + 'dist-tags': { + HEAD: '1.0.0', + latest: '1.0.0', + }, + refs: { + // all the advertised refs that can be cloned down remotely + HEAD: { sha, ref, rawRef, type: 'head' }, + master: { ... }, + 'v1.0.0': { ... }, + 'refs/tags/v1.0.0': { ... }, + }, + shas: { + // all named shas referenced above + // sha: [list, of, refs] + '6b2501f9183a1753027a9bf89a184b7d3d4602c7': [ + 'HEAD', + 'master', + 'refs/heads/master', + ], + '1bc5fba3353f8e1b56493b266bc459276ab23139': [ 'v1.0.0', 'refs/tags/v1.0.0' ], + }, +} +``` + +### `git.is(opts)` -> `Promise` + +Resolve to `true` if the path argument refers to the root of a git +repository. + +It does this by looking for a file in `${path}/.git/index`, which is not an +airtight indicator, but at least avoids being fooled by an empty directory +or a file named `.git`. + +### `git.find(opts)` -> `Promise` + +Given a path, walk up the file system tree until a git repo working +directory is found. Since this calls `stat` a bunch of times, it's +probably best to only call it if you're reasonably sure you're likely to be +in a git project somewhere. + +Resolves to `null` if not in a git project. + +### `git.isClean(opts = {})` -> `Promise` + +Return true if in a git dir, and that git dir is free of changes. This +will resolve `true` if the git working dir is clean, or `false` if not, and +reject if the path is not within a git directory or some other error +occurs. + +## OPTIONS + +- `retry` An object to configure retry behavior for transient network + errors with exponential backoff. + - `retries`: Defaults to `opts.fetchRetries` or 2 + - `factor`: Defaults to `opts.fetchRetryFactor` or 10 + - `maxTimeout`: Defaults to `opts.fetchRetryMaxtimeout` or 60000 + - `minTimeout`: Defaults to `opts.fetchRetryMintimeout` or 1000 +- `git` Path to the `git` binary to use. Will look up the first `git` in + the `PATH` if not specified. +- `spec` The [`npm-package-arg`](http://npm.im/npm-package-arg) specifier + object for the thing being fetched (if relevant). +- `fakePlatform` set to a fake value of `process.platform` to use. (Just + for testing `win32` behavior on Unix, and vice versa.) +- `cwd` The current working dir for the git command. Particularly for + `find` and `is` and `isClean`, it's good to know that this defaults to + `process.cwd()`, as one might expect. +- Any other options that can be passed to + [`@npmcli/promise-spawn`](http://npm.im/@npmcli/promise-spawn), or + `child_process.spawn()`. diff --git a/deps/npm/node_modules/@npmcli/git/lib/clone.js b/deps/npm/node_modules/@npmcli/git/lib/clone.js new file mode 100644 index 00000000000000..3c50a05cf1aec1 --- /dev/null +++ b/deps/npm/node_modules/@npmcli/git/lib/clone.js @@ -0,0 +1,143 @@ +// The goal here is to minimize both git workload and +// the number of refs we download over the network. +// +// Every method ends up with the checked out working dir +// at the specified ref, and resolves with the git sha. + +// Only certain whitelisted hosts get shallow cloning. +// Many hosts (including GHE) don't always support it. +// A failed shallow fetch takes a LOT longer than a full +// fetch in most cases, so we skip it entirely. +// Set opts.gitShallow = true/false to force this behavior +// one way or the other. +const shallowHosts = new Set([ + 'github.com', + 'gist.github.com', + 'gitlab.com', + 'bitbucket.com', + 'bitbucket.org', +]) +const { parse } = require('url') +const { basename, resolve } = require('path') + +const revs = require('./revs.js') +const spawn = require('./spawn.js') + +const pickManifest = require('npm-pick-manifest') +const { promisify } = require('util') +const fs = require('fs') +const mkdirp = require('mkdirp') + +module.exports = (repo, ref = 'HEAD', target = null, /* istanbul ignore next */ opts = {}) => + revs(repo, opts).then(revs => clone( + repo, + revs, + ref, + resolveRef(revs, ref, opts), + target || defaultTarget(repo, opts.cwd), + opts + )) + +const maybeShallow = (repo, opts) => + opts.gitShallow === false || opts.gitShallow ? opts.gitShallow + : shallowHosts.has(parse(repo).host) + +const isWindows = opts => (opts.fakePlatform || process.platform) === 'win32' + +const defaultTarget = (repo, /* istanbul ignore next */ cwd = process.cwd()) => + resolve(cwd, basename(repo.replace(/[\/\\]?\.git$/, ''))) + +const clone = (repo, revs, ref, revDoc, target, opts) => + !revDoc ? unresolved(repo, ref, target, opts) + : revDoc.sha === revs.refs.HEAD.sha ? plain(repo, revDoc, target, opts) + : revDoc.type === 'tag' || revDoc.type === 'branch' + ? branch(repo, revDoc, target, opts) + : other(repo, revDoc, target, opts) + +const resolveRef = (revs, ref, opts) => { + const { spec = {} } = opts + ref = spec.gitCommittish || ref + return !revs ? /* istanbul ignore next - will fail anyway, can't pull */ null + : spec.gitRange ? pickManifest(revs, spec.gitRange, opts) + : !ref ? revs.refs.HEAD + : revs.refs[ref] ? revs.refs[ref] + : revs.shas[ref] ? revs.refs[revs.shas[ref][0]] + : null +} + +// pull request or some other kind of advertised ref +const other = (repo, revDoc, target, opts) => { + const shallow = maybeShallow(repo, opts) + + const fetchOrigin = [ 'fetch', 'origin', revDoc.rawRef ] + .concat(shallow ? ['--depth=1'] : []) + + const git = (args) => spawn(args, { ...opts, cwd: target }) + return mkdirp(target) + .then(() => git(['init'])) + .then(() => isWindows(opts) + ? git(['config', '--local', '--add', 'core.longpaths', 'true']) + : null) + .then(() => git(['remote', 'add', 'origin', repo])) + .then(() => git(fetchOrigin)) + .then(() => git(['checkout', revDoc.sha])) + .then(() => updateSubmodules(target, opts)) + .then(() => revDoc.sha) +} + +// tag or branches. use -b +const branch = (repo, revDoc, target, opts) => { + const args = [ + 'clone', + '-b', + revDoc.ref, + repo, + target, + '--recurse-submodules', + ] + if (maybeShallow(repo, opts)) + args.push('--depth=1') + if (isWindows(opts)) + args.push('--config', 'core.longpaths=true') + return spawn(args, opts).then(() => revDoc.sha) +} + +// just the head. clone it +const plain = (repo, revDoc, target, opts) => { + const args = [ + 'clone', + repo, + target, + '--recurse-submodules' + ] + if (maybeShallow(repo, opts)) + args.push('--depth=1') + if (isWindows(opts)) + args.push('--config', 'core.longpaths=true') + return spawn(args, opts).then(() => revDoc.sha) +} + +const updateSubmodules = (target, opts) => new Promise(res => + fs.stat(target + '/.gitmodules', er => res(er ? null + : spawn([ + 'submodule', + 'update', + '-q', + '--init', + '--recursive' + ], { ...opts, cwd: target })))) + +const unresolved = (repo, ref, target, opts) => { + // can't do this one shallowly, because the ref isn't advertised + // but we can avoid checking out the working dir twice, at least + const lp = isWindows(opts) ? ['--config', 'core.longpaths=true'] : [] + const cloneArgs = ['clone', '--mirror', '-q', repo, target + '/.git'] + const git = (args) => spawn(args, { ...opts, cwd: target }) + return mkdirp(target) + .then(() => git(cloneArgs.concat(lp))) + .then(() => git(['init'])) + .then(() => git(['checkout', ref])) + .then(() => updateSubmodules(target, opts)) + .then(() => git(['rev-parse', '--revs-only', 'HEAD'])) + .then(({stdout}) => stdout.trim()) +} diff --git a/deps/npm/node_modules/@npmcli/git/lib/env.js b/deps/npm/node_modules/@npmcli/git/lib/env.js new file mode 100644 index 00000000000000..87787cdbebe670 --- /dev/null +++ b/deps/npm/node_modules/@npmcli/git/lib/env.js @@ -0,0 +1,33 @@ +const uniqueFilename = require('unique-filename') +const { join } = require('path') +const {tmpdir} = require('os') + +const goodEnvVars = new Set([ + 'GIT_ASKPASS', + 'GIT_EXEC_PATH', + 'GIT_PROXY_COMMAND', + 'GIT_SSH', + 'GIT_SSH_COMMAND', + 'GIT_SSL_CAINFO', + 'GIT_SSL_NO_VERIFY' +]) + +// memoize +let gitEnv + +module.exports = () => { + if (gitEnv) + return gitEnv + + // we set the template dir to an empty folder to give git less to do + const tmpDir = join(tmpdir(), 'npmcli-git-template-tmp') + const tmpName = uniqueFilename(tmpDir, 'git-clone') + return gitEnv = Object.keys(process.env).reduce((gitEnv, k) => { + if (goodEnvVars.has(k) || !k.startsWith('GIT_')) + gitEnv[k] = process.env[k] + return gitEnv + }, { + GIT_ASKPASS: 'echo', + GIT_TEMPLATE_DIR: tmpName + }) +} diff --git a/deps/npm/node_modules/@npmcli/git/lib/find.js b/deps/npm/node_modules/@npmcli/git/lib/find.js new file mode 100644 index 00000000000000..2d2ad308665de1 --- /dev/null +++ b/deps/npm/node_modules/@npmcli/git/lib/find.js @@ -0,0 +1,7 @@ +const is = require('./is.js') +const { dirname } = require('path') +const check = (cwd, prev) => is({ cwd }).then(isGit => + isGit ? cwd + : cwd === prev ? null + : check(dirname(cwd), cwd)) +module.exports = ({ cwd = process.cwd() } = {}) => check(cwd) diff --git a/deps/npm/node_modules/@npmcli/git/lib/index.js b/deps/npm/node_modules/@npmcli/git/lib/index.js new file mode 100644 index 00000000000000..7088792a1fc6e3 --- /dev/null +++ b/deps/npm/node_modules/@npmcli/git/lib/index.js @@ -0,0 +1,8 @@ +module.exports = { + clone: require('./clone.js'), + revs: require('./revs.js'), + spawn: require('./spawn.js'), + is: require('./is.js'), + find: require('./find.js'), + isClean: require('./is-clean.js'), +} diff --git a/deps/npm/node_modules/@npmcli/git/lib/is-clean.js b/deps/npm/node_modules/@npmcli/git/lib/is-clean.js new file mode 100644 index 00000000000000..19f8049e0fb145 --- /dev/null +++ b/deps/npm/node_modules/@npmcli/git/lib/is-clean.js @@ -0,0 +1,6 @@ +const spawn = require('./spawn.js') + +module.exports = (opts = {}) => + spawn([ 'status', '--porcelain=v1', '-uno' ], opts) + .then(res => res.stdout.trim().split(/\r?\n+/) + .map(l => l.trim()).filter(l => l).length ? false : true) diff --git a/deps/npm/node_modules/@npmcli/git/lib/is.js b/deps/npm/node_modules/@npmcli/git/lib/is.js new file mode 100644 index 00000000000000..e2542f21577272 --- /dev/null +++ b/deps/npm/node_modules/@npmcli/git/lib/is.js @@ -0,0 +1,6 @@ +// not an airtight indicator, but a good gut-check to even bother trying +const { promisify } = require('util') +const fs = require('fs') +const stat = promisify(fs.stat) +module.exports = ({ cwd = process.cwd() } = {}) => + stat(cwd + '/.git').then(() => true, () => false) diff --git a/deps/npm/node_modules/@npmcli/git/lib/lines-to-revs.js b/deps/npm/node_modules/@npmcli/git/lib/lines-to-revs.js new file mode 100644 index 00000000000000..524e672431ea4b --- /dev/null +++ b/deps/npm/node_modules/@npmcli/git/lib/lines-to-revs.js @@ -0,0 +1,133 @@ +// turn an array of lines from `git ls-remote` into a thing +// vaguely resembling a packument, where docs are a resolved ref + +const semver = require('semver') + +module.exports = lines => finish(lines.reduce(linesToRevsReducer, { + versions: {}, + 'dist-tags': {}, + refs: {}, + shas: {}, +})) + +const finish = revs => distTags(shaList(peelTags(revs))) + +// We can check out shallow clones on specific SHAs if we have a ref +const shaList = revs => { + Object.keys(revs.refs).forEach(ref => { + doc = revs.refs[ref] + if (revs.shas[doc.sha]) + revs.shas[doc.sha].push(ref) + else + revs.shas[doc.sha] = [ref] + }) + return revs +} + + +// Replace any tags with their ^{} counterparts, if those exist +const peelTags = revs => { + Object.keys(revs.refs).filter(ref => ref.endsWith('^{}')).forEach(ref => { + const peeled = revs.refs[ref] + const unpeeled = revs.refs[ref.replace(/\^\{\}$/, '')] + if (unpeeled) { + unpeeled.sha = peeled.sha + delete revs.refs[ref] + } + }) + return revs +} + +const distTags = revs => { + // not entirely sure what situations would result in an + // ichabod repo, but best to be careful in Sleepy Hollow anyway + const HEAD = revs.refs.HEAD || /* istanbul ignore next */ {} + const versions = Object.keys(revs.versions) + versions.forEach(v => { + // simulate a dist-tags with latest pointing at the + // 'latest' branch if one exists and is a version, + // or HEAD if not. + const ver = revs.versions[v] + if (revs.refs.latest && ver.sha === revs.refs.latest.sha) + revs['dist-tags'].latest = v + else if (ver.sha === HEAD.sha) { + revs['dist-tags'].HEAD = v + if (!revs.refs.latest) + revs['dist-tags'].latest = v + } + }) + return revs +} + +const refType = ref => + ref.startsWith('refs/tags/') ? 'tag' + : ref.startsWith('refs/heads/') ? 'branch' + : ref.startsWith('refs/pull/') ? 'pull' + : ref === 'HEAD' ? 'head' + // Could be anything, ignore for now + : /* istanbul ignore next */ 'other' + +// return the doc, or null if we should ignore it. +const lineToRevDoc = line => { + const split = line.trim().split(/\s+/, 2) + if (split.length < 2) + return null + + const sha = split[0].trim() + const rawRef = split[1].trim() + const type = refType(rawRef) + + if (type === 'tag') { + // refs/tags/foo^{} is the 'peeled tag', ie the commit + // that is tagged by refs/tags/foo they resolve to the same + // content, just different objects in git's data structure. + // But, we care about the thing the tag POINTS to, not the tag + // object itself, so we only look at the peeled tag refs, and + // ignore the pointer. + // For now, though, we have to save both, because some tags + // don't have peels, if they were not annotated. + const ref = rawRef.substr('refs/tags/'.length) + return { sha, ref, rawRef, type } + } + + if (type === 'branch') { + const ref = rawRef.substr('refs/heads/'.length) + return { sha, ref, rawRef, type } + } + + if (type === 'pull') { + // NB: merged pull requests installable with #pull/123/merge + // for the merged pr, or #pull/123 for the PR head + const ref = rawRef.substr('refs/'.length).replace(/\/head$/, '') + return { sha, ref, rawRef, type } + } + + if (type === 'head') { + const ref = 'HEAD' + return { sha, ref, rawRef, type } + } + + // at this point, all we can do is leave the ref un-munged + return { sha, ref: rawRef, rawRef, type } +} + +const linesToRevsReducer = (revs, line) => { + const doc = lineToRevDoc(line) + + if (!doc) + return revs + + revs.refs[doc.ref] = doc + revs.refs[doc.rawRef] = doc + + if (doc.type === 'tag') { + // try to pull a semver value out of tags like `release-v1.2.3` + // which is a pretty common pattern. + const match = !doc.ref.endsWith('^{}') && + doc.ref.match(/v?(\d+\.\d+\.\d+(?:[-+].+)?)$/) + if (match && semver.valid(match[1], true)) + revs.versions[semver.clean(match[1], true)] = doc + } + + return revs +} diff --git a/deps/npm/node_modules/@npmcli/git/lib/opts.js b/deps/npm/node_modules/@npmcli/git/lib/opts.js new file mode 100644 index 00000000000000..7da4801a6aae05 --- /dev/null +++ b/deps/npm/node_modules/@npmcli/git/lib/opts.js @@ -0,0 +1,6 @@ +const gitEnv = require('./env.js') +module.exports = (opts = {}) => ({ + stdioString: true, + ...opts, + env: opts.env || gitEnv(), +}) diff --git a/deps/npm/node_modules/@npmcli/git/lib/proc-log.js b/deps/npm/node_modules/@npmcli/git/lib/proc-log.js new file mode 100644 index 00000000000000..b2bdd9dc90205c --- /dev/null +++ b/deps/npm/node_modules/@npmcli/git/lib/proc-log.js @@ -0,0 +1,21 @@ +// default logger. +// emits 'log' events on the process +const LEVELS = [ + 'notice', + 'error', + 'warn', + 'info', + 'verbose', + 'http', + 'silly', + 'pause', + 'resume' +] + +const log = level => (...args) => process.emit('log', level, ...args) + +const logger = {} +for (const level of LEVELS) { + logger[level] = log(level) +} +module.exports = logger diff --git a/deps/npm/node_modules/@npmcli/git/lib/revs.js b/deps/npm/node_modules/@npmcli/git/lib/revs.js new file mode 100644 index 00000000000000..5744731872231f --- /dev/null +++ b/deps/npm/node_modules/@npmcli/git/lib/revs.js @@ -0,0 +1,24 @@ +const pinflight = require('promise-inflight') +const spawn = require('./spawn.js') +const LRU = require('lru-cache') + +const revsCache = new LRU({ + max: 100, + maxAge: 5 * 60 * 1000, +}) + +const linesToRevs = require('./lines-to-revs.js') + +module.exports = (repo, opts = {}) => { + if (!opts.noGitRevCache) { + const cached = revsCache.get(repo) + if (cached) + return Promise.resolve(cached) + } + + return pinflight(`ls-remote:${repo}`, () => + spawn(['ls-remote', repo], opts) + .then(({stdout}) => linesToRevs(stdout.trim().split('\n'))) + .then(revs => (revsCache.set(repo, revs), revs)) + ) +} diff --git a/deps/npm/node_modules/@npmcli/git/lib/should-retry.js b/deps/npm/node_modules/@npmcli/git/lib/should-retry.js new file mode 100644 index 00000000000000..8082bb5d7c6e71 --- /dev/null +++ b/deps/npm/node_modules/@npmcli/git/lib/should-retry.js @@ -0,0 +1,17 @@ +const transientErrors = [ + 'remote error: Internal Server Error', + 'The remote end hung up unexpectedly', + 'Connection timed out', + 'Operation timed out', + 'Failed to connect to .* Timed out', + 'Connection reset by peer', + 'SSL_ERROR_SYSCALL', + 'The requested URL returned error: 503' +].join('|') + +const transientErrorRe = new RegExp(transientErrors) + +const maxRetry = 3 + +module.exports = (error, number) => + transientErrorRe.test(error) && (number < maxRetry) diff --git a/deps/npm/node_modules/@npmcli/git/lib/spawn.js b/deps/npm/node_modules/@npmcli/git/lib/spawn.js new file mode 100644 index 00000000000000..3c3a943fe9f0d3 --- /dev/null +++ b/deps/npm/node_modules/@npmcli/git/lib/spawn.js @@ -0,0 +1,33 @@ +const spawn = require('@npmcli/promise-spawn') +const promiseRetry = require('promise-retry') +const shouldRetry = require('./should-retry.js') +const whichGit = require('./which.js') +const makeOpts = require('./opts.js') +const procLog = require('./proc-log.js') + +module.exports = (gitArgs, opts = {}) => { + const gitPath = whichGit(opts) + + if (gitPath instanceof Error) + return Promise.reject(gitPath) + + const log = opts.log || procLog + return promiseRetry((retry, number) => { + if (number !== 1) + log.silly('pacote', `Retrying git command: ${ + gitArgs.join(' ')} attempt # ${number}`) + + return spawn(gitPath, gitArgs, makeOpts(opts)) + .catch(er => { + if (shouldRetry(er.stderr, number)) + retry(er) + else + throw er + }) + }, opts.retry !== null && opts.retry !== undefined ? opts.retry : { + retries: opts.fetchRetries || 2, + factor: opts.fetchRetryFactor || 10, + maxTimeout: opts.fetchRetryMaxtimeout || 60000, + minTimeout: opts.fetchRetryMintimeout || 1000, + }) +} diff --git a/deps/npm/node_modules/@npmcli/git/lib/which.js b/deps/npm/node_modules/@npmcli/git/lib/which.js new file mode 100644 index 00000000000000..9e82d391aadedb --- /dev/null +++ b/deps/npm/node_modules/@npmcli/git/lib/which.js @@ -0,0 +1,11 @@ +const which = require('which') + +let gitPath +try { + gitPath = which.sync('git') +} catch (e) {} + +module.exports = (opts = {}) => + opts.git || + opts.git !== false && gitPath || + Object.assign(new Error('No git binary found in $PATH'), { code: 'ENOGIT' }) diff --git a/deps/npm/node_modules/@npmcli/git/package.json b/deps/npm/node_modules/@npmcli/git/package.json new file mode 100644 index 00000000000000..bb07188560b4c7 --- /dev/null +++ b/deps/npm/node_modules/@npmcli/git/package.json @@ -0,0 +1,41 @@ +{ + "name": "@npmcli/git", + "version": "2.0.4", + "main": "lib/index.js", + "files": [ + "lib/*.js" + ], + "description": "a util for spawning git from npm CLI contexts", + "repository": { + "type": "git", + "url": "git+https://github.com/npm/git" + }, + "author": "Isaac Z. Schlueter (https://izs.me)", + "license": "ISC", + "scripts": { + "test": "tap", + "snap": "tap", + "preversion": "npm test", + "postversion": "npm publish", + "prepublishOnly": "git push origin --follow-tags" + }, + "tap": { + "check-coverage": true, + "coverage-map": "map.js" + }, + "devDependencies": { + "slash": "^3.0.0", + "tap": "^14.10.6" + }, + "dependencies": { + "@npmcli/promise-spawn": "^1.1.0", + "lru-cache": "^6.0.0", + "mkdirp": "^1.0.3", + "npm-pick-manifest": "^6.0.0", + "promise-inflight": "^1.0.1", + "promise-retry": "^1.1.1", + "semver": "^7.3.2", + "unique-filename": "^1.1.1", + "which": "^2.0.2" + } +} diff --git a/deps/npm/node_modules/@npmcli/installed-package-contents/LICENSE b/deps/npm/node_modules/@npmcli/installed-package-contents/LICENSE new file mode 100644 index 00000000000000..19cec97b184683 --- /dev/null +++ b/deps/npm/node_modules/@npmcli/installed-package-contents/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) npm, Inc. + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/deps/npm/node_modules/@npmcli/installed-package-contents/README.md b/deps/npm/node_modules/@npmcli/installed-package-contents/README.md new file mode 100644 index 00000000000000..edd23bd26d64c8 --- /dev/null +++ b/deps/npm/node_modules/@npmcli/installed-package-contents/README.md @@ -0,0 +1,109 @@ +# @npmcli/installed-package-contents + +Get the list of files installed in a package in node_modules, including +bundled dependencies. + +This is useful if you want to remove a package node from the tree _without_ +removing its child nodes, for example to extract a new version of the +dependency into place safely. + +It's sort of the reflection of [npm-packlist](http://npm.im/npm-packlist), +but for listing out the _installed_ files rather than the files that _will_ +be installed. This is of course a much simpler operation, because we don't +have to handle ignore files or package.json `files` lists. + +## USAGE + +```js +// programmatic usage +const pkgContents = require('@npmcli/installed-package-contents') + +pkgContents({ path: 'node_modules/foo', depth: 1 }).then(files => { + // files is an array of items that need to be passed to + // rimraf or moved out of the way to make the folder empty + // if foo bundled dependencies, those will be included. + // It will not traverse into child directories, because we set + // depth:1 in the options. + // If the folder doesn't exist, this returns an empty array. +}) + +pkgContents({ path: 'node_modules/foo', depth: Infinity }).then(files => { + // setting depth:Infinity tells it to keep walking forever + // until it hits something that isn't a directory, so we'll + // just get the list of all files, but not their containing + // directories. +}) +``` + +As a CLI: + +```bash +$ installed-package-contents node_modules/bundle-some -d1 +node_modules/.bin/some +node_modules/bundle-some/package.json +node_modules/bundle-some/node_modules/@scope/baz +node_modules/bundle-some/node_modules/.bin/foo +node_modules/bundle-some/node_modules/foo +``` + +CLI options: + +``` +Usage: + installed-package-contents [-d --depth=] + +Lists the files installed for a package specified by . + +Options: + -d --depth= Provide a numeric value ("Infinity" is allowed) + to specify how deep in the file tree to traverse. + Default=1 + -h --help Show this usage information +``` + +## OPTIONS + +* `depth` Number, default `1`. How deep to traverse through folders to get + contents. Typically you'd want to set this to either `1` (to get the + surface files and folders) or `Infinity` (to get all files), but any + other positive number is supported as well. If set to `0` or a + negative number, returns the path provided and (if it is a package) its + set of linked bins. +* `path` Required. Path to the package in `node_modules` where traversal + should begin. + +## RETURN VALUE + +A Promise that resolves to an array of fully-resolved files and folders +matching the criteria. This includes all bundled dependencies in +`node_modules`, and any linked executables in `node_modules/.bin` that the +package caused to be installed. + +An empty or missing package folder will return an empty array. Empty +directories _within_ package contents are listed, even if the `depth` +argument would cause them to be traversed into. + +## CAVEAT + +If using this module to generate a list of files that should be recursively +removed to clear away the package, note that this will leave empty +directories behind in certain cases: + +- If all child packages are bundled dependencies, then the + `node_modules` folder will remain. +- If all child packages within a given scope were bundled dependencies, + then the `node_modules/@scope` folder will remain. +- If all linked bin scripts were removed, then an empty `node_modules/.bin` + folder will remain. + +In the interest of speed and algorithmic complexity, this module does _not_ +do a subsequent readdir to see if it would remove all directory entries, +though it would be easier to look at if it returned `node_modules` or +`.bin` in that case rather than the contents. However, if the intent is to +pass these arguments to `rimraf`, it hardly makes sense to do _two_ +`readdir` calls just so that we can have the luxury of having to make a +third. + +Since the primary use case is to delete a package's contents so that they +can be re-filled with a new version of that package, this caveat does not +pose a problem. Empty directories are already ignored by both npm and git. diff --git a/deps/npm/node_modules/@npmcli/installed-package-contents/index.js b/deps/npm/node_modules/@npmcli/installed-package-contents/index.js new file mode 100755 index 00000000000000..fa81551fed4bfe --- /dev/null +++ b/deps/npm/node_modules/@npmcli/installed-package-contents/index.js @@ -0,0 +1,224 @@ +// to GET CONTENTS for folder at PATH (which may be a PACKAGE): +// - if PACKAGE, read path/package.json +// - if bins in ../node_modules/.bin, add those to result +// - if depth >= maxDepth, add PATH to result, and finish +// - readdir(PATH, with file types) +// - add all FILEs in PATH to result +// - if PARENT: +// - if depth < maxDepth, add GET CONTENTS of all DIRs in PATH +// - else, add all DIRs in PATH +// - if no parent +// - if no bundled deps, +// - if depth < maxDepth, add GET CONTENTS of DIRs in path except +// node_modules +// - else, add all DIRs in path other than node_modules +// - if has bundled deps, +// - get list of bundled deps +// - add GET CONTENTS of bundled deps, PACKAGE=true, depth + 1 + +const bundled = require('npm-bundled') +const {promisify} = require('util') +const fs = require('fs') +const readFile = promisify(fs.readFile) +const readdir = promisify(fs.readdir) +const stat = promisify(fs.stat) +const {relative, resolve, basename, dirname} = require('path') +const normalizePackageBin = require('npm-normalize-package-bin') + +const readPackage = ({ path, packageJsonCache }) => + packageJsonCache.has(path) ? Promise.resolve(packageJsonCache.get(path)) + : readFile(path).then(json => { + const pkg = normalizePackageBin(JSON.parse(json)) + packageJsonCache.set(path, pkg) + return pkg + }) + .catch(er => null) + +// just normalize bundle deps and bin, that's all we care about here. +const normalized = Symbol('package data has been normalized') +const rpj = ({ path, packageJsonCache }) => + readPackage({path, packageJsonCache}) + .then(pkg => { + if (!pkg || pkg[normalized]) + return pkg + if (pkg.bundledDependencies && !pkg.bundleDependencies) { + pkg.bundleDependencies = pkg.bundledDependencies + delete pkg.bundledDependencies + } + const bd = pkg.bundleDependencies + if (bd === true) { + pkg.bundleDependencies = [ + ...Object.keys(pkg.dependencies || {}), + ...Object.keys(pkg.optionalDependencies || {}), + ] + } + if (typeof bd === 'object' && !Array.isArray(bd)) { + pkg.bundleDependencies = Object.keys(bd) + } + pkg[normalized] = true + return pkg + }) + + +const pkgContents = async ({ + path, + depth, + currentDepth = 0, + pkg = null, + result = null, + packageJsonCache = null, +}) => { + if (!result) + result = new Set() + + if (!packageJsonCache) + packageJsonCache = new Map() + + if (pkg === true) { + return rpj({ path: path + '/package.json', packageJsonCache }) + .then(pkg => pkgContents({ + path, + depth, + currentDepth, + pkg, + result, + packageJsonCache, + })) + } + + if (pkg) { + // add all bins to result if they exist + if (pkg.bin) { + const dir = dirname(path) + const base = basename(path) + const scope = basename(dir) + const nm = /^@.+/.test(scope) ? dirname(dir) : dir + + const binFiles = [] + Object.keys(pkg.bin).forEach(b => { + const base = resolve(nm, '.bin', b) + binFiles.push(base, base + '.cmd', base + '.ps1') + }) + + const bins = await Promise.all( + binFiles.map(b => stat(b).then(() => b).catch((er) => null)) + ) + bins.filter(b => b).forEach(b => result.add(b)) + } + } + + if (currentDepth >= depth) { + result.add(path) + return result + } + + // we'll need bundle list later, so get that now in parallel + const [dirEntries, bundleDeps] = await Promise.all([ + readdir(path, { withFileTypes: true }), + currentDepth === 0 && pkg && pkg.bundleDependencies + ? bundled({ path, packageJsonCache }) : null, + ]).catch(() => []) + + // not a thing, probably a missing folder + if (!dirEntries) + return result + + // empty folder, just add the folder itself to the result + if (!dirEntries.length && !bundleDeps && currentDepth !== 0) { + result.add(path) + return result + } + + const recursePromises = [] + + for (const entry of dirEntries) { + const p = resolve(path, entry.name) + if (entry.isDirectory() === false) { + result.add(p) + continue + } + + if (currentDepth !== 0 || entry.name !== 'node_modules') { + if (currentDepth < depth - 1) { + recursePromises.push(pkgContents({ + path: p, + packageJsonCache, + depth, + currentDepth: currentDepth + 1, + result, + })) + } else { + result.add(p) + } + continue + } + } + + if (bundleDeps) { + // bundle deps are all folders + // we always recurse to get pkg bins, but if currentDepth is too high, + // it'll return early before walking their contents. + recursePromises.push(...bundleDeps.map(dep => { + const p = resolve(path, 'node_modules', dep) + return pkgContents({ + path: p, + packageJsonCache, + pkg: true, + depth, + currentDepth: currentDepth + 1, + result, + }) + })) + } + + if (recursePromises.length) + await Promise.all(recursePromises) + + return result +} + +module.exports = ({path, depth = 1, packageJsonCache}) => pkgContents({ + path: resolve(path), + depth, + pkg: true, + packageJsonCache, +}).then(results => [...results]) + + +if (require.main === module) { + const options = { path: null, depth: 1 } + const usage = `Usage: + installed-package-contents [-d --depth=] + +Lists the files installed for a package specified by . + +Options: + -d --depth= Provide a numeric value ("Infinity" is allowed) + to specify how deep in the file tree to traverse. + Default=1 + -h --help Show this usage information` + + process.argv.slice(2).forEach(arg => { + let match + if ((match = arg.match(/^--depth=([0-9]+|Infinity)/)) || + (match = arg.match(/^-d([0-9]+|Infinity)/))) + options.depth = +match[1] + else if (arg === '-h' || arg === '--help') { + console.log(usage) + process.exit(0) + } else + options.path = arg + }) + if (!options.path) { + console.error('ERROR: no path provided') + console.error(usage) + process.exit(1) + } + const cwd = process.cwd() + module.exports(options) + .then(list => list.sort().forEach(p => console.log(relative(cwd, p)))) + .catch(/* istanbul ignore next - pretty unusual */ er => { + console.error(er) + process.exit(1) + }) +} diff --git a/deps/npm/node_modules/@npmcli/installed-package-contents/package.json b/deps/npm/node_modules/@npmcli/installed-package-contents/package.json new file mode 100644 index 00000000000000..5af7077b6ac989 --- /dev/null +++ b/deps/npm/node_modules/@npmcli/installed-package-contents/package.json @@ -0,0 +1,35 @@ +{ + "name": "@npmcli/installed-package-contents", + "version": "1.0.5", + "description": "Get the list of files installed in a package in node_modules, including bundled dependencies", + "author": "Isaac Z. Schlueter (https://izs.me)", + "main": "index.js", + "bin": "index.js", + "license": "ISC", + "scripts": { + "test": "tap", + "snap": "tap", + "preversion": "npm test", + "postversion": "npm publish", + "postpublish": "git push origin --follow-tags" + }, + "tap": { + "check-coverage": true + }, + "devDependencies": { + "tap": "^14.10.4" + }, + "dependencies": { + "npm-bundled": "^1.1.1", + "npm-normalize-package-bin": "^1.0.1", + "read-package-json-fast": "^1.1.1", + "readdir-scoped-modules": "^1.1.0" + }, + "repository": "git+https://github.com/npm/installed-package-contents", + "files": [ + "index.js" + ], + "engines": { + "node": ">= 10" + } +} diff --git a/deps/npm/node_modules/@npmcli/map-workspaces/CHANGELOG.md b/deps/npm/node_modules/@npmcli/map-workspaces/CHANGELOG.md new file mode 100644 index 00000000000000..a50779fcdc430c --- /dev/null +++ b/deps/npm/node_modules/@npmcli/map-workspaces/CHANGELOG.md @@ -0,0 +1,5 @@ +# Changelog + +## 0.0.0-pre.0 + +- Initial pre-release. diff --git a/deps/npm/node_modules/@npmcli/map-workspaces/LICENSE b/deps/npm/node_modules/@npmcli/map-workspaces/LICENSE new file mode 100644 index 00000000000000..dedcd7d2f9daec --- /dev/null +++ b/deps/npm/node_modules/@npmcli/map-workspaces/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) npm Inc. + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/deps/npm/node_modules/@npmcli/map-workspaces/README.md b/deps/npm/node_modules/@npmcli/map-workspaces/README.md new file mode 100644 index 00000000000000..001b269e458ff6 --- /dev/null +++ b/deps/npm/node_modules/@npmcli/map-workspaces/README.md @@ -0,0 +1,82 @@ +# @npmcli/map-workspaces + +[![NPM version](https://img.shields.io/npm/v/@npmcli/map-workspaces)](https://www.npmjs.com/package/@npmcli/map-workspaces) +[![Build Status](https://img.shields.io/github/workflow/status/npm/map-workspaces/node-ci)](https://github.com/npm/map-workspaces) +[![License](https://img.shields.io/github/license/npm/map-workspaces)](https://github.com/npm/map-workspaces/blob/master/LICENSE) + +Retrieves a name:pathname Map for a given workspaces config. + +Long version: Reads the `workspaces` property from a valid **workspaces configuration** object and traverses the paths and globs defined there in order to find valid nested packages and return a **Map** of all found packages where keys are package names and values are folder locations. + +## Install + +`npm install map-workspaces` + +## Usage: + +```js +const mapWorkspaces = require('@npmcli/map-workspaces') +await mapWorkspaces({ + workspaces: { + packages: [ + "a", + "b" + ] + } +}, { cwd }) +// -> +// Map { +// 'a': '/a' +// 'b': '/b' +// } +``` + +## Examples: + +### Glob usage: + +Given a folder structure such as: + +``` +├── package.json +└── apps + ├── a + │ └── package.json + ├── b + │ └── package.json + └── c + └── package.json +``` + +```js +const mapWorkspaces = require('@npmcli/map-workspaces') +await mapWorkspaces({ + workspaces: [ + "apps/*" + ] +}, { cwd }) +// -> +// Map { +// 'a': '/apps/a' +// 'b': '/apps/b' +// 'c': '/apps/c' +// } +``` + +## API: + +### `mapWorkspaces(pkg, opts = {}) -> Promise` + +- `pkg`: A valid `package.json` **Object** +- `opts`: + - `cwd`: A **String** defining the base directory to use when reading globs and paths. + - `ignore`: An **Array** of paths to be ignored when using [globs](https://www.npmjs.com/package/glob) to look for nested package. + - ...[Also support all other glob options](https://www.npmjs.com/package/glob#options) + +#### Returns + +A **Map** in which keys are **package names** and values are the **pathnames** for each found **workspace**. + +## LICENSE + +[ISC](./LICENSE) diff --git a/deps/npm/node_modules/@npmcli/map-workspaces/index.js b/deps/npm/node_modules/@npmcli/map-workspaces/index.js new file mode 100644 index 00000000000000..b06662154a83a1 --- /dev/null +++ b/deps/npm/node_modules/@npmcli/map-workspaces/index.js @@ -0,0 +1,190 @@ +const { promisify } = require('util') +const path = require('path') + +const getName = require('@npmcli/name-from-folder') +const minimatch = require('minimatch') +const rpj = require('read-package-json-fast') +const glob = require('glob') +const pGlob = promisify(glob) + +function appendNegatedPatterns (patterns) { + const results = [] + for (let pattern of patterns) { + const excl = pattern.match(/^!+/) + if (excl) { + pattern = pattern.substr(excl[0].length) + } + + // strip off any / from the start of the pattern. /foo => foo + pattern = pattern.replace(/^\/+/, '') + + // an odd number of ! means a negated pattern. !!foo ==> foo + const negate = excl && excl[0].length % 2 === 1 + results.push({ pattern, negate }) + } + + return results +} + +function getPatterns (workspaces) { + const workspacesDeclaration = + Array.isArray(workspaces.packages) + ? workspaces.packages + : workspaces + + if (!Array.isArray(workspacesDeclaration)) { + throw getError({ + message: 'workspaces config expects an Array', + code: 'EWORKSPACESCONFIG' + }) + } + + return [ + ...appendNegatedPatterns(workspacesDeclaration), + { pattern: '**/node_modules/**', negate: true } + ] +} + +function isEmpty (patterns) { + return patterns.length < 2 +} + +function getPackageName (pkg, pathname) { + const { name } = pkg + return name || getName(pathname) +} + +function pkgPathmame (opts) { + return (...args) => { + const cwd = opts.cwd ? opts.cwd : process.cwd() + return path.join.apply(null, [cwd, ...args]) + } +} + +// make sure glob pattern only matches folders +function getGlobPattern (pattern) { + return pattern.endsWith('/') + ? pattern + : `${pattern}/` +} + +function getError ({ Type = TypeError, message, code }) { + return Object.assign(new Type(message), { code }) +} + +function reverseResultMap (map) { + return new Map(Array.from(map, item => item.reverse())) +} + +async function mapWorkspaces (opts = {}) { + if (!opts || !opts.pkg) { + throw getError({ + message: 'mapWorkspaces missing pkg info', + code: 'EMAPWORKSPACESPKG' + }) + } + + const { workspaces = [] } = opts.pkg + const patterns = getPatterns(workspaces) + const results = new Map() + const seen = new Map() + + if (isEmpty(patterns)) { + return results + } + + const getGlobOpts = () => ({ + ...opts, + ignore: [ + ...opts.ignore || [], + ...['**/node_modules/**'] + ] + }) + + const getPackagePathname = pkgPathmame(opts) + + for (const item of patterns) { + const matches = await pGlob(getGlobPattern(item.pattern), getGlobOpts()) + + for (const match of matches) { + let pkg + const packageJsonPathname = getPackagePathname(match, 'package.json') + const packagePathname = path.dirname(packageJsonPathname) + + try { + pkg = await rpj(packageJsonPathname) + } catch (err) { + if (err.code === 'ENOENT') { + continue + } else { + throw err + } + } + + const name = getPackageName(pkg, packagePathname) + + if (item.negate) { + results.delete(packagePathname, name) + } else { + if (seen.has(name) && seen.get(name) !== packagePathname) { + throw getError({ + Type: Error, + message: 'must not have multiple workspaces with the same name', + code: 'EDUPLICATEWORKSPACE' + }) + } + + seen.set(name, packagePathname) + results.set(packagePathname, name) + } + } + } + + return reverseResultMap(results) +} + +mapWorkspaces.virtual = function (opts = {}) { + if (!opts || !opts.lockfile) { + throw getError({ + message: 'mapWorkspaces.virtual missing lockfile info', + code: 'EMAPWORKSPACESLOCKFILE' + }) + } + + const { packages = {} } = opts.lockfile + const { workspaces = [] } = packages[''] || {} + const patterns = getPatterns(workspaces) + + // uses a pathname-keyed map in order to negate the exact items + const results = new Map() + + if (isEmpty(patterns)) { + return results + } + + const getPackagePathname = pkgPathmame(opts) + + for (const packageKey of Object.keys(packages)) { + if (packageKey === '') { + continue + } + + for (const item of patterns) { + if (minimatch(packageKey, item.pattern)) { + const packagePathname = getPackagePathname(packageKey) + const name = getPackageName(packages[packageKey], packagePathname) + + if (item.negate) { + results.delete(packagePathname) + } else { + results.set(packagePathname, name) + } + } + } + } + + // Invert pathname-keyed to a proper name-to-pathnames Map + return reverseResultMap(results) +} + +module.exports = mapWorkspaces diff --git a/deps/npm/node_modules/@npmcli/map-workspaces/package.json b/deps/npm/node_modules/@npmcli/map-workspaces/package.json new file mode 100644 index 00000000000000..2a66a74240d6de --- /dev/null +++ b/deps/npm/node_modules/@npmcli/map-workspaces/package.json @@ -0,0 +1,57 @@ +{ + "name": "@npmcli/map-workspaces", + "version": "1.0.1", + "files": [ + "index.js" + ], + "engines": { + "node": ">=10" + }, + "description": "Retrieves a name:pathname Map for a given workspaces config", + "repository": "https://github.com/npm/map-workspaces", + "keywords": [ + "npm", + "npmcli", + "libnpm", + "cli", + "workspaces", + "map-workspaces" + ], + "author": "npm Inc. ", + "contributors": [ + { + "name": "Ruy Adorno", + "url": "https://ruyadorno.com", + "twitter": "ruyadorno" + } + ], + "license": "ISC", + "scripts": { + "lint": "standard", + "pretest": "npm run lint", + "test": "tap test*.js", + "snap": "tap test*.js", + "preversion": "npm test", + "postversion": "npm publish", + "prepublishOnly": "git push origin --follow-tags" + }, + "tap": { + "check-coverage": true + }, + "standard": { + "ignore": [ + "/tap-snapshots/" + ] + }, + "devDependencies": { + "require-inject": "^1.4.4", + "standard": "^14.3.4", + "tap": "^14.10.8" + }, + "dependencies": { + "@npmcli/name-from-folder": "^1.0.1", + "glob": "^7.1.6", + "minimatch": "^3.0.4", + "read-package-json-fast": "^1.2.1" + } +} diff --git a/deps/npm/node_modules/@npmcli/metavuln-calculator/LICENSE b/deps/npm/node_modules/@npmcli/metavuln-calculator/LICENSE new file mode 100644 index 00000000000000..19cec97b184683 --- /dev/null +++ b/deps/npm/node_modules/@npmcli/metavuln-calculator/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) npm, Inc. + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/deps/npm/node_modules/@npmcli/metavuln-calculator/README.md b/deps/npm/node_modules/@npmcli/metavuln-calculator/README.md new file mode 100644 index 00000000000000..00f3064e117d0a --- /dev/null +++ b/deps/npm/node_modules/@npmcli/metavuln-calculator/README.md @@ -0,0 +1,289 @@ +# @npmcli/metavuln-calculator + +Calculate meta-vulnerabilities from package security advisories + +This is a pretty low-level package to abstract out the parts of +[@npmcli/arborist](http://npm.im/@npmcli/arborist) that calculate +metavulnerabilities from security advisories. If you just want to get an +audit for a package tree, probably what you want to use is +`arborist.audit()`. + +## USAGE + +```js +const Calculator = require('@npmcli/metavuln-calculator') +// pass in any options for cacache and pacote +// see those modules for option descriptions +const calculator = new Calculator(options) + +// get an advisory somehow, typically by POSTing a JSON payload like: +// {"pkgname":["1.2.3","4.3.5", ...versions], ...packages} +// to /-/npm/v1/security/advisories/bulk +// to get a payload response like: +// { +// "semver": [ +// { +// "id": 31, +// "url": "https://npmjs.com/advisories/31", +// "title": "Regular Expression Denial of Service", +// "severity": "moderate", +// "vulnerable_versions": "<4.3.2" +// } +// ], +// ...advisories +// } +const arb = new Aborist(options) +const tree = await arb.loadActual() +const advisories = await getBulkAdvisoryReportSomehow(tree) + +// then to get a comprehensive set of advisories including metavulns: +const set = new Set() +for (const [name, advisory] of Object.entries(advisories)) { + // make sure we have the advisories loaded with latest version lists + set.add(await calculator.calculate(name, {advisory})) +} + +for (const vuln of set) { + for (const node of tree.inventory.query('name', vuln.name)) { + // not vulnerable, just keep looking + if (!vuln.testVersion(node.version)) + continue + for (const { from: dep, spec } of node.edgesIn) { + const metaAdvisory = await calculator.calculate(dep.name, vuln) + if (metaAdvisory.testVersion(dep.version, spec)) { + set.add(metaAdvisory) + } + } + } +} +``` + +## API + +### Class: Advisory + +The `Calculator.calculate` method returns a Promise that resolves to a +`Advisory` object, filled in from the cache and updated if necessary with +the available advisory data. + +Do not instantiate `Advisory` objects directly. Use the `calculate()` +method to get one with appropriate data filled in. + +Do not mutate `Advisory` objects. Use the supplied methods only. + +#### Fields + +- `name` The name of the package that this vulnerability is about +- `id` The unique cache key for this vuln or metavuln. (See **Cache Keys** + below.) +- `dependency` For metavulns, the dependency that causes this package to be + have a vulnerability. For advisories, the same as `name`. +- `type` Either `'advisory'` or `'metavuln'`, depending on the type of + vulnerability that this object represents. +- `url` The url for the advisory (`null` for metavulns) +- `title` The text title of the advisory or metavuln +- `severity` The severity level info/low/medium/high/critical +- `range` The range that is vulnerable +- `versions` The set of available versions of the package +- `vulnerableVersions` The set of versions that are vulnerable +- `source` The numeric ID of the advisory, or the cache key of the + vulnerability that causes this metavuln +- `updated` Boolean indicating whether this vulnerability was updated since + being read from cache. +- `packument` The packument object for the package that this vulnerability + is about. + +#### `vuln.testVersion(version, [dependencySpecifier]) -> Boolean` + +Check to see if a given version is vulnerable. Returns `true` if the +version is vulnerable, and should be avoided. + +For metavulns, `dependencySpecifier` indicates the version range of the +source of the vulnerability, which the module depends on. If not provided, +will attempt to read from the packument. If not provided, and unable to +read from the packument, then `true` is returned, indicating that the (not +installable) package version should be avoided. + +#### Cache Keys + +The cache keys are calculated by hashing together the `source` and `name` +fields, prefixing with the string `'security-advisory:'` and the name of +the dependency that is vulnerable. + +So, a third-level metavulnerability might have a key like: + +``` +'security-advisory:foo:'+ hash(['foo', hash(['bar', hash(['baz', 123])])]) +``` + +Thus, the cached entry with this key would reflect the version of `foo` +that is vulnerable by virtue of dependending exclusively on versions of +`bar` which are vulnerable by virtue of depending exclusively on versions +of `baz` which are vulnerable by virtue of advisory ID `123`. + +Loading advisory data entirely from cache without hitting an npm registry +security advisory endpoint is not supported at this time, but technically +possible, and likely to come in a future version of this library. + +### `calculator = new Calculator(options)` + +Options object is used for `cacache` and `pacote` calls. + +### `calculator.calculate(name, source)` + +- `name` The name of the package that the advisory is about +- `source` Advisory object from the npm security endpoint, or a `Advisory` + object returned by a previous call to the `calculate()` method. + "Advisory" objects need to have: + - `id` id of the advisory or Advisory object + - `vulnerable_versions` range of versions affected + - `url` + - `title` + - `severity` + +Fetches the packument and returns a Promise that resolves to a +vulnerability object described above. + +Will perform required I/O to fetch package metadata from registry and +read from cache. Advisory information written back to cache. + +## Dependent Version Sampling + +Typically, dependency ranges don't change very frequently, and the most +recent version published on a given release line is most likely to contain +the fix for a given vulnerability. + +So, we see things like this: + +``` +3.0.4 - not vulnerable +3.0.3 - vulnerable +3.0.2 - vulnerable +3.0.1 - vulnerable +3.0.0 - vulnerable +2.3.107 - not vulnerable +2.3.106 - not vulnerable +2.3.105 - vulnerable +... 523 more vulnerable versions ... +2.0.0 - vulnerable +1.1.102 - not vulnerable +1.1.101 - vulnerable +... 387 more vulnerable versions ... +0.0.0 - vulnerable +``` + +In order to determine which versions of a package are affected by a +vulnerability in a dependency, this module uses the following algorithm to +minimize the number of tests required by performing a binary search on each +version set, and presuming that versions _between_ vulnerable versions +within a given set are also vulnerable. + +1. Sort list of available versions by SemVer precedence +2. Group versions into sets based on MAJOR/MINOR versions. + + 3.0.0 - 3.0.4 + 2.3.0 - 2.3.107 + 2.2.0 - 2.2.43 + 2.1.0 - 2.1.432 + 2.0.0 - 2.0.102 + 1.1.0 - 1.1.102 + 1.0.0 - 1.0.157 + 0.1.0 - 0.1.123 + 0.0.0 - 0.0.57 + +3. Test the highest and lowest in each MAJOR/MINOR set, and mark highest + and lowest with known-vulnerable status. (`(s)` means "safe" and `(v)` + means "vulnerable".) + + 3.0.0(v) - 3.0.4(s) + 2.3.0(v) - 2.3.107(s) + 2.2.0(v) - 2.2.43(v) + 2.1.0(v) - 2.1.432(v) + 2.0.0(v) - 2.0.102(v) + 1.1.0(v) - 1.1.102(s) + 1.0.0(v) - 1.0.157(v) + 0.1.0(v) - 0.1.123(v) + 0.0.0(v) - 0.0.57(v) + +4. For each set of package versions: + + 1. If highest and lowest both vulnerable, assume entire set is + vulnerable, and continue to next set. Ie, in the example, throw out + the following version sets: + + 2.2.0(v) - 2.2.43(v) + 2.1.0(v) - 2.1.432(v) + 2.0.0(v) - 2.0.102(v) + 1.0.0(v) - 1.0.157(v) + 0.1.0(v) - 0.1.123(v) + 0.0.0(v) - 0.0.57(v) + + 2. Test middle version MID in set, splitting into two sets. + + 3.0.0(v) - 3.0.2(v) - 3.0.4(s) + 2.3.0(v) - 2.3.54(v) - 2.3.107(s) + 1.1.0(v) - 1.1.51(v) - 1.1.102(s) + + 3. If any untested versions in Set(mid..highest) or Set(lowest..mid), + add to list of sets to test. + + 3.0.0(v) - 3.0.2(v) <-- thrown out on next iteration + 3.0.2(v) - 3.0.4(s) + 2.3.0(v) - 2.3.54(v) <-- thrown out on next iteration + 2.3.54(v) - 2.3.107(s) + 1.1.0(v) - 1.1.51(v) <-- thrown out on next iteration + 1.1.51(v) - 1.1.102(s) + +When the process finishes, all versions are either confirmed safe, or +confirmed/assumed vulnerable, and we avoid checking large sets of versions +where vulnerabilities went unfixed. + +### Testing Version for MetaVuln Status + +When the dependency is in `bundleDependencies`, we treat any dependent +version that _may_ be vulnerable as a vulnerability. If the dependency is +not in `bundleDependencies`, then we treat the dependent module as a +vulnerability if it can _only_ resolve to dependency versions that are +vulnerable. + +This relies on the reasonable assumption that the version of a bundled +dependency will be within the stated dependency range, and accounts for the +fact that we can't know ahead of time which version of a dependency may be +bundled. So, we avoid versions that _may_ bundle a vulnerable dependency. + +For example: + +Package `foo` depends on package `bar` at the following version ranges: + +``` +foo version bar version range +1.0.0 ^1.2.3 +1.0.1 ^1.2.4 +1.0.2 ^1.2.5 +1.1.0 ^1.3.1 +1.1.1 ^1.3.2 +1.1.2 ^1.3.3 +2.0.0 ^2.0.0 +2.0.1 ^2.0.1 +2.0.2 ^2.0.2 +``` + +There is an advisory for `bar@1.2.4 - 1.3.2`. So: + +``` +foo version vulnerable? +1.0.0 if bundled (can use 1.2.3, which is not vulnerable) +1.0.1 yes (must use ^1.2.4, entirely contained in vuln range) +1.0.2 yes (must use ^1.2.5, entirely contained in vuln range) +1.1.0 if bundled (can use 1.3.3, which is not vulnerable) +1.1.1 if bundled (can use 1.3.3, which is not vulnerable) +1.1.2 no (dep is outside of vuln range) +2.0.0 no (dep is outside of vuln range) +2.0.1 no (dep is outside of vuln range) +2.0.2 no (dep is outside of vuln range) +``` + +To test a package version for metaVulnerable status, we attempt to load the +manifest of the dependency, using the vulnerable version set as the `avoid` +versions. If we end up selecting a version that should be avoided, then +that means that the package is vulnerable by virtue of its dependency. diff --git a/deps/npm/node_modules/@npmcli/metavuln-calculator/lib/advisory.js b/deps/npm/node_modules/@npmcli/metavuln-calculator/lib/advisory.js new file mode 100644 index 00000000000000..95bcc67558ed17 --- /dev/null +++ b/deps/npm/node_modules/@npmcli/metavuln-calculator/lib/advisory.js @@ -0,0 +1,295 @@ +const hash = require('./hash.js') +const semver = require('semver') +const semverOpt = { includePrerelease: true, loose: true } +const getDepSpec = require('./get-dep-spec.js') + +// any fields that we don't want in the cache need to be hidden +const _source = Symbol('source') +const _packument = Symbol('packument') +const _versionVulnMemo = Symbol('versionVulnMemo') +const _updated = Symbol('updated') +const _options = Symbol('options') +const _specVulnMemo = Symbol('specVulnMemo') +const _testVersion = Symbol('testVersion') +const _testVersions = Symbol('testVersions') +const _calculateRange = Symbol('calculateRange') +const _markVulnerable = Symbol('markVulnerable') +const _testSpec = Symbol('testSpec') + +class Advisory { + constructor (name, source, options = {}) { + this.source = source.id + this[_source] = source + this[_options] = options + this.name = name + if (!source.name) + source.name = name + + this.dependency = source.name + + if (this.type === 'advisory') { + this.title = source.title + this.url = source.url + } else { + this.title = `Depends on vulnerable versions of ${source.name}` + this.url = null + } + + this.severity = source.severity + this.versions = [] + this.vulnerableVersions = [] + // advisories have the range, metavulns do not + this.range = source.vulnerable_versions || null + this.id = hash(this) + + this[_packument] = null + // memoized list of which versions are vulnerable + this[_versionVulnMemo] = new Map() + // memoized list of which dependency specs are vulnerable + this[_specVulnMemo] = new Map() + this[_updated] = false + } + + // true if we updated from what we had in cache + get updated () { + return this[_updated] + } + + get type () { + return this.dependency === this.name ? 'advisory' : 'metavuln' + } + + get packument () { + return this[_packument] + } + + // load up the data from a cache entry and a fetched packument + load (cached, packument) { + // basic data integrity gutchecks + if (!cached || typeof cached !== 'object') { + throw new TypeError('invalid cached data, expected object') + } + if (!packument || typeof packument !== 'object') { + throw new TypeError('invalid packument data, expected object') + } + if (cached.id && cached.id !== this.id) { + throw Object.assign(new Error('loading from incorrect cache entry'), { + expected: this.id, + actual: cached.id, + }) + } + if (packument.name !== this.name) { + throw Object.assign(new Error('loading from incorrect packument'), { + expected: this.name, + actual: packument.name, + }) + } + if (this[_packument]) + throw new Error('advisory object already loaded') + + // if we have a range from the initialization, and the cached + // data has a *different* range, then we know we have to recalc. + // just don't use the cached data, so we will definitely not match later + if (!this.range || cached.range && cached.range === this.range) + Object.assign(this, cached) + + this[_packument] = packument + + const pakuVersions = Object.keys(packument.versions) + const allVersions = new Set([...pakuVersions, ...this.versions]) + const versionsAdded = [] + const versionsRemoved = [] + for (const v of allVersions) { + if (!this.versions.includes(v)) { + versionsAdded.push(v) + this.versions.push(v) + } else if (!pakuVersions.includes(v)) { + versionsRemoved.push(v) + } + } + + // strip out any removed versions from our lists, and sort by semver + this.versions = semver.sort(this.versions.filter(v => + !versionsRemoved.includes(v)), semverOpt) + + // if no changes, then just return what we got from cache + // versions added or removed always means we changed + // otherwise, advisories change if the range changes, and + // metavulns change if the source was updated + const unchanged = this.type === 'advisory' + ? this.range && this.range === cached.range + : !this[_source].updated + + // if the underlying source changed, by an advisory updating the + // range, or a source advisory being updated, then we have to re-check + // otherwise, only recheck the new ones. + this.vulnerableVersions = !unchanged ? [] + : semver.sort(this.vulnerableVersions.filter(v => + !versionsRemoved.includes(v)), semverOpt) + + if (unchanged && !versionsAdded.length && !versionsRemoved.length) { + // nothing added or removed, nothing to do here. use the cached copy. + return this + } + + this[_updated] = true + + // test any versions newly added + if (!unchanged || versionsAdded.length) + this[_testVersions](unchanged ? versionsAdded : this.versions) + this.vulnerableVersions = semver.sort(this.vulnerableVersions, semverOpt) + + // metavulns have to calculate their range, since cache is invalidated + // advisories just get their range from the advisory above + if (this.type === 'metavuln') + this[_calculateRange]() + + return this + } + + [_calculateRange] () { + const metavuln = this.vulnerableVersions.join(' || ').trim() + this.range = !metavuln ? '<0.0.0-0' + : semver.simplifyRange(this.versions, metavuln, semverOpt) + } + + // returns true if marked as vulnerable, false if ok + // spec is a dependency specifier, for metavuln cases + // where the version might not be in the packument. if + // we have the packument and spec is not provided, then + // we use the dependency version from the manifest. + testVersion (version, spec = null) { + const sv = String(version) + if (this[_versionVulnMemo].has(sv)) + return this[_versionVulnMemo].get(sv) + + const result = this[_testVersion](version, spec) + if (result) + this[_markVulnerable](version) + this[_versionVulnMemo].set(sv, !!result) + return result + } + + [_markVulnerable] (version) { + const sv = String(version) + if (!this.vulnerableVersions.includes(sv)) + this.vulnerableVersions.push(sv) + } + + [_testVersion] (version, spec) { + const sv = String(version) + if (this.vulnerableVersions.includes(sv)) + return true + + if (this.type === 'advisory') { + // advisory, just test range + return semver.satisfies(version, this.range, semverOpt) + } + + // check the dependency of this version on the vulnerable dep + // if we got a version that's not in the packument, fall back on + // the spec provided, if possible. + const mani = this[_packument].versions[version] || { + dependencies: { + [this.dependency]: spec, + }, + } + + if (!spec) + spec = getDepSpec(mani, this.dependency) + + // no dep, no vuln + if (spec === null) + return false + + if (!semver.validRange(spec, semverOpt)) { + // not a semver range, nothing we can hope to do about it + return true + } + + const bd = mani.bundleDependencies + const bundled = bd && bd.includes(this[_source].name) + // XXX if bundled, then semver.intersects() means vulnerable + // else, pick a manifest and see if it can't be avoided + // try to pick a version of the dep that isn't vulnerable + const avoid = this[_source].range + + if (bundled) { + return semver.intersects(spec, avoid, semverOpt) + } + + return this[_source].testSpec(spec) + } + + testSpec (spec) { + // testing all the versions is a bit costly, and the spec tends to stay + // consistent across multiple versions, so memoize this as well, in case + // we're testing lots of versions. + const memo = this[_specVulnMemo] + if (memo.has(spec)) { + return memo.get(spec) + } + + const res = this[_testSpec](spec) + memo.set(spec, res) + return res + } + + [_testSpec] (spec) { + for (const v of this.versions) { + const satisfies = semver.satisfies(v, spec) + if (!satisfies) + continue + if (!this.testVersion(v)) + return false + } + // either vulnerable, or not installable because nothing satisfied + // either way, best avoided. + return true + } + + [_testVersions] (versions) { + if (!versions.length) + return + + // set of lists of versions + const versionSets = new Set() + versions = semver.sort(versions.map(v => semver.parse(v, semverOpt))) + + // start out with the versions grouped by major and minor + let last = versions[0].major + '.' + versions[0].minor + let list = [] + versionSets.add(list) + for (const v of versions) { + const k = v.major + '.' + v.minor + if (k !== last) { + last = k + list = [] + versionSets.add(list) + } + list.push(v) + } + + for (const list of versionSets) { + const headVuln = this.testVersion(list[0]) + const tailVuln = this.testVersion(list[list.length - 1]) + // if head and tail both vulnerable, whole list is thrown out + if (headVuln && tailVuln) { + for (const v of list.slice(1, -1)) { + this[_markVulnerable](v) + } + continue + } + + // if length is 2 or 1, then we marked them all already + if (list.length <= 2) + continue + + const mid = Math.floor(list.length / 2) + // leave out the ends, since we tested those already + versionSets.add(list.slice(0, mid)) + versionSets.add(list.slice(mid)) + } + } +} +module.exports = Advisory diff --git a/deps/npm/node_modules/@npmcli/metavuln-calculator/lib/get-dep-spec.js b/deps/npm/node_modules/@npmcli/metavuln-calculator/lib/get-dep-spec.js new file mode 100644 index 00000000000000..02321a8fee978d --- /dev/null +++ b/deps/npm/node_modules/@npmcli/metavuln-calculator/lib/get-dep-spec.js @@ -0,0 +1,12 @@ +module.exports = (mani, name) => { + // skip dev because that only matters at the root, + // where we aren't fetching a manifest from the registry + // with multiple versions anyway. + return mani.dependencies && typeof mani.dependencies[name] === 'string' + ? mani.dependencies[name] + : mani.optionalDependencies && typeof mani.optionalDependencies[name] === 'string' + ? mani.optionalDependencies[name] + : mani.peerDependencies && typeof mani.peerDependencies[name] === 'string' + ? mani.peerDependencies[name] + : null +} diff --git a/deps/npm/node_modules/@npmcli/metavuln-calculator/lib/hash.js b/deps/npm/node_modules/@npmcli/metavuln-calculator/lib/hash.js new file mode 100644 index 00000000000000..79c0678c7581af --- /dev/null +++ b/deps/npm/node_modules/@npmcli/metavuln-calculator/lib/hash.js @@ -0,0 +1,5 @@ +const {createHash} = require('crypto') + +module.exports = ({name, source}) => createHash('sha512') + .update(JSON.stringify([name, source])) + .digest('base64') diff --git a/deps/npm/node_modules/@npmcli/metavuln-calculator/lib/index.js b/deps/npm/node_modules/@npmcli/metavuln-calculator/lib/index.js new file mode 100644 index 00000000000000..e8d88641776cb5 --- /dev/null +++ b/deps/npm/node_modules/@npmcli/metavuln-calculator/lib/index.js @@ -0,0 +1,124 @@ +// this is the public class that is used by consumers. +// the Advisory class handles all the calculation, and this +// class handles all the IO with the registry and cache. +const pacote = require('pacote') +const cacache = require('cacache') +const Advisory = require('./advisory.js') +const {homedir} = require('os') +const jsonParse = require('json-parse-even-better-errors') + +const _packument = Symbol('packument') +const _cachePut = Symbol('cachePut') +const _cacheGet = Symbol('cacheGet') +const _cacheData = Symbol('cacheData') +const _packuments = Symbol('packuments') +const _cache = Symbol('cache') +const _options = Symbol('options') +const _advisories = Symbol('advisories') +const _calculate = Symbol('calculate') + +class Calculator { + constructor (options = {}) { + this[_options] = { ...options } + this[_cache] = this[_options].cache || (homedir() + '/.npm/_cacache') + this[_options].cache = this[_cache] + this[_packuments] = new Map() + this[_cacheData] = new Map() + this[_advisories] = new Map() + } + + get cache () { + return this[_cache] + } + + get options () { + return { ...this[_options] } + } + + async calculate (name, source) { + const k = `security-advisory:${name}:${source.id}` + if (this[_advisories].has(k)) + return this[_advisories].get(k) + + const p = this[_calculate](name, source) + this[_advisories].set(k, p) + return p + } + + async [_calculate] (name, source) { + const k = `security-advisory:${name}:${source.id}` + const t = `metavuln:calculate:${k}` + process.emit('time', t) + const advisory = new Advisory(name, source, this[_options]) + // load packument and cached advisory + const [cached, packument] = await Promise.all([ + this[_cacheGet](advisory), + this[_packument](name) + ]) + process.emit('time', `metavuln:load:${k}`) + advisory.load(cached, packument) + process.emit('timeEnd', `metavuln:load:${k}`) + if (advisory.updated) + await this[_cachePut](advisory) + this[_advisories].set(k, advisory) + process.emit('timeEnd', t) + return advisory + } + + async [_cachePut] (advisory) { + const { name, id } = advisory + const key = `security-advisory:${name}:${id}` + process.emit('time', `metavuln:cache:put:${key}`) + const data = JSON.stringify(advisory) + const options = { ...this[_options] } + this[_cacheData].set(key, jsonParse(data)) + await cacache.put(this[_cache], key, data, options).catch(() => {}) + process.emit('timeEnd', `metavuln:cache:put:${key}`) + } + + async [_cacheGet] (advisory) { + const { name, id } = advisory + const key = `security-advisory:${name}:${id}` + /* istanbul ignore if - should be impossible, since we memoize the + * advisory object itself using the same key, just being cautious */ + if (this[_cacheData].has(key)) + return this[_cacheData].get(key) + + process.emit('time', `metavuln:cache:get:${key}`) + const p = cacache.get(this[_cache], key, { ...this[_options] }) + .catch(() => ({ data: '{}' })) + .then(({ data }) => { + data = jsonParse(data) + process.emit('timeEnd', `metavuln:cache:get:${key}`) + this[_cacheData].set(key, data) + return data + }) + this[_cacheData].set(key, p) + return p + } + + async [_packument] (name) { + if (this[_packuments].has(name)) + return this[_packuments].get(name) + + process.emit('time', `metavuln:packument:${name}`) + const p = pacote.packument(name, { ...this[_options] }) + .catch((er) => { + // presumably not something from the registry. + // an empty packument will have an effective range of * + return { + name, + versions: {}, + } + }) + .then(paku => { + process.emit('timeEnd', `metavuln:packument:${name}`) + this[_packuments].set(name, paku) + return paku + }) + this[_packuments].set(name, p) + return p + } +} + +module.exports = Calculator diff --git a/deps/npm/node_modules/@npmcli/metavuln-calculator/package.json b/deps/npm/node_modules/@npmcli/metavuln-calculator/package.json new file mode 100644 index 00000000000000..ec5eea5a4ceac3 --- /dev/null +++ b/deps/npm/node_modules/@npmcli/metavuln-calculator/package.json @@ -0,0 +1,32 @@ +{ + "name": "@npmcli/metavuln-calculator", + "version": "1.0.0", + "main": "lib/index.js", + "files": [ + "lib" + ], + "description": "Calculate meta-vulnerabilities from package security advisories", + "repository": "https://github.com/npm/metavuln-calculator", + "author": "Isaac Z. Schlueter (https://izs.me)", + "license": "ISC", + "scripts": { + "test": "tap", + "snap": "tap", + "preversion": "npm test", + "postversion": "npm publish", + "prepublishOnly": "git push origin --follow-tags" + }, + "tap": { + "check-coverage": true, + "coverage-map": "map.js" + }, + "devDependencies": { + "tap": "^14.10.8", + "require-inject": "^1.4.4" + }, + "dependencies": { + "pacote": "^11.1.11", + "cacache": "^15.0.5", + "semver": "^7.3.2" + } +} diff --git a/deps/npm/node_modules/@npmcli/move-file/LICENSE.md b/deps/npm/node_modules/@npmcli/move-file/LICENSE.md new file mode 100644 index 00000000000000..072bf20840acd6 --- /dev/null +++ b/deps/npm/node_modules/@npmcli/move-file/LICENSE.md @@ -0,0 +1,22 @@ +MIT License + +Copyright (c) Sindre Sorhus (https://sindresorhus.com) +Copyright (c) npm, Inc. + +Permission is hereby granted, free of charge, to any person obtaining a +copy of this software and associated documentation files (the "Software"), +to deal in the Software without restriction, including without limitation +the rights to use, copy, modify, merge, publish, distribute, sublicense, +and/or sell copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. diff --git a/deps/npm/node_modules/@npmcli/move-file/README.md b/deps/npm/node_modules/@npmcli/move-file/README.md new file mode 100644 index 00000000000000..da682ebd5123a5 --- /dev/null +++ b/deps/npm/node_modules/@npmcli/move-file/README.md @@ -0,0 +1,68 @@ +# @npmcli/move-file + +A fork of [move-file](https://github.com/sindresorhus/move-file) with +compatibility with all node 10.x versions. + +> Move a file + +The built-in +[`fs.rename()`](https://nodejs.org/api/fs.html#fs_fs_rename_oldpath_newpath_callback) +is just a JavaScript wrapper for the C `rename(2)` function, which doesn't +support moving files across partitions or devices. This module is what you +would have expected `fs.rename()` to be. + +## Highlights + +- Promise API. +- Supports moving a file across partitions and devices. +- Optionally prevent overwriting an existing file. +- Creates non-existent destination directories for you. +- Support for Node versions that lack built-in recursive `fs.mkdir()` + +## Install + +``` +$ npm install @npmcli/move-file +``` + +## Usage + +```js +const moveFile = require('@npmcli/move-file'); + +(async () => { + await moveFile('source/unicorn.png', 'destination/unicorn.png'); + console.log('The file has been moved'); +})(); +``` + +## API + +### moveFile(source, destination, options?) + +Returns a `Promise` that resolves when the file has been moved. + +### moveFile.sync(source, destination, options?) + +#### source + +Type: `string` + +File you want to move. + +#### destination + +Type: `string` + +Where you want the file moved. + +#### options + +Type: `object` + +##### overwrite + +Type: `boolean`\ +Default: `true` + +Overwrite existing destination file. diff --git a/deps/npm/node_modules/@npmcli/move-file/index.js b/deps/npm/node_modules/@npmcli/move-file/index.js new file mode 100644 index 00000000000000..d1567d1f64f730 --- /dev/null +++ b/deps/npm/node_modules/@npmcli/move-file/index.js @@ -0,0 +1,93 @@ +const { dirname } = require('path') +const { promisify } = require('util') +const { + access: access_, + accessSync, + copyFile: copyFile_, + copyFileSync, + unlink: unlink_, + unlinkSync, + rename: rename_, + renameSync, +} = require('fs') + +const access = promisify(access_) +const copyFile = promisify(copyFile_) +const unlink = promisify(unlink_) +const rename = promisify(rename_) + +const mkdirp = require('mkdirp') + +const pathExists = async path => { + try { + await access(path) + return true + } catch (er) { + return er.code !== 'ENOENT' + } +} + +const pathExistsSync = path => { + try { + accessSync(path) + return true + } catch (er) { + return er.code !== 'ENOENT' + } +} + +module.exports = async (source, destination, options = {}) => { + if (!source || !destination) { + throw new TypeError('`source` and `destination` file required') + } + + options = { + overwrite: true, + ...options + } + + if (!options.overwrite && await pathExists(destination)) { + throw new Error(`The destination file exists: ${destination}`) + } + + await mkdirp(dirname(destination)) + + try { + await rename(source, destination) + } catch (error) { + if (error.code === 'EXDEV') { + await copyFile(source, destination) + await unlink(source) + } else { + throw error + } + } +} + +module.exports.sync = (source, destination, options = {}) => { + if (!source || !destination) { + throw new TypeError('`source` and `destination` file required') + } + + options = { + overwrite: true, + ...options + } + + if (!options.overwrite && pathExistsSync(destination)) { + throw new Error(`The destination file exists: ${destination}`) + } + + mkdirp.sync(dirname(destination)) + + try { + renameSync(source, destination) + } catch (error) { + if (error.code === 'EXDEV') { + copyFileSync(source, destination) + unlinkSync(source) + } else { + throw error + } + } +} diff --git a/deps/npm/node_modules/@npmcli/move-file/package.json b/deps/npm/node_modules/@npmcli/move-file/package.json new file mode 100644 index 00000000000000..476bc76ba73ff5 --- /dev/null +++ b/deps/npm/node_modules/@npmcli/move-file/package.json @@ -0,0 +1,33 @@ +{ + "name": "@npmcli/move-file", + "version": "1.0.1", + "files": [ + "index.js" + ], + "description": "move a file (fork of move-file)", + "dependencies": { + "mkdirp": "^1.0.4" + }, + "devDependencies": { + "require-inject": "^1.4.4", + "tap": "^14.10.7" + }, + "scripts": { + "test": "tap", + "snap": "tap", + "preversion": "npm test", + "postversion": "npm publish", + "prepublishOnly": "git push origin --follow-tags" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/npm/move-file" + }, + "tap": { + "check-coverage": true + }, + "license": "MIT", + "engines": { + "node": ">=10" + } +} diff --git a/deps/npm/node_modules/@npmcli/name-from-folder/LICENSE b/deps/npm/node_modules/@npmcli/name-from-folder/LICENSE new file mode 100644 index 00000000000000..d24a9fca761c83 --- /dev/null +++ b/deps/npm/node_modules/@npmcli/name-from-folder/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright npm, Inc. + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND NPM DISCLAIMS ALL WARRANTIES WITH REGARD +TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS. IN NO EVENT SHALL NPM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR +CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, +DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS +ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. diff --git a/deps/npm/node_modules/@npmcli/name-from-folder/README.md b/deps/npm/node_modules/@npmcli/name-from-folder/README.md new file mode 100644 index 00000000000000..0735ca28a0aa35 --- /dev/null +++ b/deps/npm/node_modules/@npmcli/name-from-folder/README.md @@ -0,0 +1,14 @@ +# @npmcli/name-from-folder + +Get the package name from a folder path, including the scope if the +basename of the dirname starts with `@`. + +For a path like `/x/y/z/@scope/pkg` it'll return `@scope/pkg`. If the path +name is something like `/x/y/z/pkg`, then it'll return `pkg`. + +## USAGE + +```js +const nameFromFolder = require('@npmcli/name-from-folder') +const name = nameFromFolder('/some/folder/path') +``` diff --git a/deps/npm/node_modules/@npmcli/name-from-folder/index.js b/deps/npm/node_modules/@npmcli/name-from-folder/index.js new file mode 100644 index 00000000000000..afb1dbb76297f7 --- /dev/null +++ b/deps/npm/node_modules/@npmcli/name-from-folder/index.js @@ -0,0 +1,7 @@ +const { basename, dirname } = require('path') + +const getName = (parent, base) => + parent.charAt(0) === '@' ? `${parent}/${base}` : base + +module.exports = dir => dir ? getName(basename(dirname(dir)), basename(dir)) + : false diff --git a/deps/npm/node_modules/@npmcli/name-from-folder/package.json b/deps/npm/node_modules/@npmcli/name-from-folder/package.json new file mode 100644 index 00000000000000..9569b4e66e90c9 --- /dev/null +++ b/deps/npm/node_modules/@npmcli/name-from-folder/package.json @@ -0,0 +1,27 @@ +{ + "name": "@npmcli/name-from-folder", + "version": "1.0.1", + "files": [ + "index.js" + ], + "description": "Get the package name from a folder path", + "repository": { + "type": "git", + "url": "git+https://github.com/npm/name-from-folder" + }, + "author": "Isaac Z. Schlueter (https://izs.me)", + "license": "ISC", + "scripts": { + "test": "tap", + "snap": "tap", + "preversion": "npm test", + "postversion": "npm publish", + "prepublishOnly": "git push origin --follow-tags" + }, + "tap": { + "check-coverage": true + }, + "devDependencies": { + "tap": "^14.10.7" + } +} diff --git a/deps/npm/node_modules/@npmcli/node-gyp/lib/index.js b/deps/npm/node_modules/@npmcli/node-gyp/lib/index.js new file mode 100644 index 00000000000000..77e9f287e54fa6 --- /dev/null +++ b/deps/npm/node_modules/@npmcli/node-gyp/lib/index.js @@ -0,0 +1,13 @@ +const util = require('util') +const {stat} = require('fs').promises + +async function isNodeGypPackage(path) { + return await stat(`${path}/binding.gyp`) + .then(st => st.isFile()) + .catch(() => false) +} + +module.exports = { + isNodeGypPackage, + defaultGypInstallScript: 'node-gyp rebuild' +} diff --git a/deps/npm/node_modules/@npmcli/node-gyp/package.json b/deps/npm/node_modules/@npmcli/node-gyp/package.json new file mode 100644 index 00000000000000..ff78b3cc381724 --- /dev/null +++ b/deps/npm/node_modules/@npmcli/node-gyp/package.json @@ -0,0 +1,30 @@ +{ + "name": "@npmcli/node-gyp", + "version": "1.0.1", + "description": "Tools for dealing with node-gyp packages", + "scripts": { + "test": "tap", + "preversion": "npm test", + "postversion": "npm publish", + "prepublishOnly": "git push origin --follow-tags" + }, + "keywords": [ + "npm", + "cli", + "node-gyp" + ], + "files": [ + "lib/**/*.js" + ], + "main": "lib/index.js", + "author": "Brian Jenkins ", + "license": "ISC", + "tap": { + "check-coverage": true, + "coverage-map": "map.js" + }, + "devDependencies": { + "tap": "^14.10.6", + "tmp": "^0.2.1" + } +} diff --git a/deps/npm/node_modules/@npmcli/promise-spawn/LICENSE b/deps/npm/node_modules/@npmcli/promise-spawn/LICENSE new file mode 100644 index 00000000000000..8f90f96f4c6c50 --- /dev/null +++ b/deps/npm/node_modules/@npmcli/promise-spawn/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) npm, Inc. + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE NPM DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS. IN NO EVENT SHALL THE NPM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, +OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, +DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS +ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. diff --git a/deps/npm/node_modules/@npmcli/promise-spawn/README.md b/deps/npm/node_modules/@npmcli/promise-spawn/README.md new file mode 100644 index 00000000000000..3b604f2a733980 --- /dev/null +++ b/deps/npm/node_modules/@npmcli/promise-spawn/README.md @@ -0,0 +1,61 @@ +# @npmcli/promise-spawn + +Spawn processes the way the npm cli likes to do. Give it some options, +it'll give you a Promise that resolves or rejects based on the results of +the execution. + +Note: When the current user is root, this will use +[`infer-owner`](http://npm.im/infer-owner) to find the owner of the current +working directory, and run with that effective uid/gid. Otherwise, it runs +as the current user always. (This helps prevent doing git checkouts and +such, and leaving root-owned files lying around in user-owned locations.) + +## USAGE + +```js +const promiseSpawn = require('@npmcli/promise-spawn') + +promiseSpawn('ls', [ '-laF', 'some/dir/*.js' ], { + cwd: '/tmp/some/path', // defaults to process.cwd() + stdioString: false, // stdout/stderr as strings rather than buffers + stdio: 'pipe', // any node spawn stdio arg is valid here + // any other arguments to node child_process.spawn can go here as well, + // but uid/gid will be ignored and set by infer-owner if relevant. +}, { + extra: 'things', + to: 'decorate', + the: 'result', +}).then(result => { + // {code === 0, signal === null, stdout, stderr, and all the extras} + console.log('ok!', result) +}).catch(er => { + // er has all the same properties as the result, set appropriately + console.error('failed!', er) +}) +``` + +## API + +### `promiseSpawn(cmd, args, opts, extra)` -> `Promise` + +Run the command, return a Promise that resolves/rejects based on the +process result. + +Result or error will be decorated with the properties in the `extra` +object. You can use this to attach some helpful info about _why_ the +command is being run, if it makes sense for your use case. + +Returned promise is decorated with the `stdin` stream if the process is set +to pipe from `stdin`. Writing to this stream writes to the `stdin` of the +spawned process. + +#### Options + +- `stdioString` Boolean, default `false`. Return stdio/stderr output as + strings rather than buffers. +- `cwd` String, default `process.cwd()`. Current working directory for + running the script. Also the argument to `infer-owner` to determine + effective uid/gid when run as root on Unix systems. +- Any other options for `child_process.spawn` can be passed as well, but + note that `uid` and `gid` will be overridden by the owner of the cwd when + run as root on Unix systems, or `null` otherwise. diff --git a/deps/npm/node_modules/@npmcli/promise-spawn/index.js b/deps/npm/node_modules/@npmcli/promise-spawn/index.js new file mode 100644 index 00000000000000..f977297bb49ec5 --- /dev/null +++ b/deps/npm/node_modules/@npmcli/promise-spawn/index.js @@ -0,0 +1,73 @@ +const {spawn} = require('child_process') + +const inferOwner = require('infer-owner') + +// 'extra' object is for decorating the error a bit more +const promiseSpawn = (cmd, args, opts, extra = {}) => { + const cwd = opts.cwd || process.cwd() + const isRoot = process.getuid && process.getuid() === 0 + return !isRoot ? promiseSpawnUid(cmd, args, { + ...opts, + cwd, + uid: undefined, + gid: undefined, + }, extra) + : inferOwner(cwd).then(({uid, gid}) => promiseSpawnUid(cmd, args, { + ...opts, + cwd, + uid, + gid, + }, extra)) +} + +const stdioResult = (stdout, stderr, {stdioString}) => + stdioString ? { + stdout: Buffer.concat(stdout).toString(), + stderr: Buffer.concat(stderr).toString(), + } : { + stdout: Buffer.concat(stdout), + stderr: Buffer.concat(stderr), + } + +const promiseSpawnUid = (cmd, args, opts, extra) => { + let proc + const p = new Promise((res, rej) => { + proc = spawn(cmd, args, opts) + const stdout = [] + const stderr = [] + const reject = er => rej(Object.assign(er, { + cmd, + args, + ...stdioResult(stdout, stderr, opts), + ...extra, + })) + proc.on('error', reject) + if (proc.stdout) { + proc.stdout.on('data', c => stdout.push(c)).on('error', reject) + proc.stdout.on('error', er => reject(er)) + } + if (proc.stderr) { + proc.stderr.on('data', c => stderr.push(c)).on('error', reject) + proc.stderr.on('error', er => reject(er)) + } + proc.on('close', (code, signal) => { + const result = { + cmd, + args, + code, + signal, + ...stdioResult(stdout, stderr, opts), + ...extra + } + if (code || signal) + rej(Object.assign(new Error('command failed'), result)) + else + res(result) + }) + }) + + p.stdin = proc.stdin + return p +} + +module.exports = promiseSpawn diff --git a/deps/npm/node_modules/@npmcli/promise-spawn/package.json b/deps/npm/node_modules/@npmcli/promise-spawn/package.json new file mode 100644 index 00000000000000..9cabd33e7f9ae7 --- /dev/null +++ b/deps/npm/node_modules/@npmcli/promise-spawn/package.json @@ -0,0 +1,32 @@ +{ + "name": "@npmcli/promise-spawn", + "version": "1.2.0", + "files": [ + "index.js" + ], + "description": "spawn processes the way the npm cli likes to do", + "repository": { + "type": "git", + "url": "git+https://github.com/npm/promise-spawn" + }, + "author": "Isaac Z. Schlueter (https://izs.me)", + "license": "ISC", + "scripts": { + "test": "tap", + "snap": "tap", + "preversion": "npm test", + "postversion": "npm publish", + "prepublishOnly": "git push origin --follow-tags" + }, + "tap": { + "check-coverage": true + }, + "devDependencies": { + "minipass": "^3.1.1", + "require-inject": "^1.4.4", + "tap": "^14.10.6" + }, + "dependencies": { + "infer-owner": "^1.0.4" + } +} diff --git a/deps/npm/node_modules/@npmcli/run-script/LICENSE b/deps/npm/node_modules/@npmcli/run-script/LICENSE new file mode 100644 index 00000000000000..19cec97b184683 --- /dev/null +++ b/deps/npm/node_modules/@npmcli/run-script/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) npm, Inc. + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/deps/npm/node_modules/@npmcli/run-script/README.md b/deps/npm/node_modules/@npmcli/run-script/README.md new file mode 100644 index 00000000000000..59b473d94706c5 --- /dev/null +++ b/deps/npm/node_modules/@npmcli/run-script/README.md @@ -0,0 +1,149 @@ +# @npmcli/run-script + +Run a lifecycle script for a package (descendant of npm-lifecycle) + +## USAGE + +```js +const runScript = require('@npmcli/run-script') + +runScript({ + // required, the script to run + event: 'install', + + // extra args to pass to the command, defaults to [] + args: [], + + // required, the folder where the package lives + path: '/path/to/package/folder', + + // optional, defaults to /bin/sh on unix, or cmd.exe on windows + scriptShell: '/bin/bash', + + // optional, defaults to false + // return stdout and stderr as strings rather than buffers + stdioString: true, + + // optional, additional environment variables to add + // note that process.env IS inherited by default + // Always set: + // - npm_package_json The package.json file in the folder + // - npm_lifecycle_event The event that this is being run for + // - npm_lifecycle_script The script being run + // The fields described in https://github.com/npm/rfcs/pull/183 + env: { + npm_package_from: 'foo@bar', + npm_package_resolved: 'https://registry.npmjs.org/foo/-/foo-1.2.3.tgz', + npm_package_integrity: 'sha512-foobarbaz', + }, + + // defaults to 'pipe'. Can also pass an array like you would to node's + // exec or spawn functions. Note that if it's anything other than + // 'pipe' then the stdout/stderr values on the result will be missing. + // npm cli sets this to 'inherit' for explicit run-scripts (test, etc.) + // but leaves it as 'pipe' for install scripts that run in parallel. + stdio: 'inherit', + + // print the package id and script, and the command to be run, like: + // > somepackage@1.2.3 postinstall + // > make all-the-things + // Defaults true when stdio:'inherit', otherwise suppressed + banner: true, +}) + .then(({ code, signal, stdout, stderr, pkgid, path, event, script }) => { + // do something with the results + }) + .catch(er => { + // command did not work. + // er is decorated with: + // - code + // - signal + // - stdout + // - stderr + // - path + // - pkgid (name@version string) + // - event + // - script + }) +``` + +## API + +Call the exported `runScript` function with an options object. + +Returns a promise that resolves to the result of the execution. Promise +rejects if the execution fails (exits non-zero) or has any other error. +Rejected errors are decorated with the same values as the result object. + +If the stdio options mean that it'll have a piped stdin, then the stdin is +ended immediately on the child process. If stdin is shared with the parent +terminal, then it is up to the user to end it, of course. + +### Results + +- `code` Process exit code +- `signal` Process exit signal +- `stdout` stdout data (Buffer, or String when `stdioString` set to true) +- `stderr` stderr data (Buffer, or String when `stdioString` set to true) +- `path` Path to the package executing its script +- `event` Lifecycle event being run +- `script` Command being run + +### Options + +- `path` Required. The path to the package having its script run. +- `event` Required. The event being executed. +- `args` Optional, default `[]`. Extra arguments to pass to the script. +- `env` Optional, object of fields to add to the environment of the + subprocess. Note that process.env IS inherited by default These are + always set: + - `npm_package_json` The package.json file in the folder + - `npm_lifecycle_event` The event that this is being run for + - `npm_lifecycle_script` The script being run + - The `package.json` fields described in + [RFC183](https://github.com/npm/rfcs/pull/183/files). +- `scriptShell` Optional, defaults to `/bin/sh` on Unix, defaults to + `env.comspec` or `cmd` on Windows. Custom script to use to execute the + command. +- `stdio` Optional, defaults to `'pipe'`. The same as the `stdio` argument + passed to `child_process` functions in Node.js. Note that if a stdio + output is set to anything other than `pipe`, it will not be present in + the result/error object. +- `cmd` Optional. Override the script from the `package.json` with + something else, which will be run in an otherwise matching environment. +- `stdioString` Optional, defaults to `false`. Return string values for + `stderr` and `stdout` rather than Buffers. +- `banner` Optional, defaults to `true`. If the `stdio` option is set to + `'inherit'`, then print a banner with the package name and version, event + name, and script command to be run. Set explicitly to `false` to disable + for inherited stdio. + +Note that this does _not_ run pre-event and post-event scripts. The +caller has to manage that process themselves. + +## Differences from [npm-lifecycle](https://github.com/npm/npm-lifecycle) + +This is an implementation to satisfy [RFC +90](https://github.com/npm/rfcs/pull/90), [RFC +77](https://github.com/npm/rfcs/pull/77), and [RFC +73](https://github.com/npm/rfcs/pull/73). + +Apart from those behavior changes in npm v7, this is also just refresh of +the codebase, with modern coding techniques and better test coverage. + +Functionally, this means: + +- Output is not dumped to the top level process's stdio by default. +- Less stuff is put into the environment. +- It is not opinionated about logging. (So, at least with the logging + framework in npm v7.0 and before, the caller has to call + `log.disableProgress()` and `log.enableProgress()` at the appropriate + times, if necessary.) +- The directory containing the `node` executable is _never_ added to the + `PATH` environment variable. (Ie, `--scripts-prepend-node-path` is + effectively always set to `false`.) Doing so causes more unintended side + effects than it ever prevented. +- Hook scripts are not run by this module. If the caller wishes to run + hook scripts, then they can override the default package script with an + explicit `cmd` option pointing to the `node_modules/.hook/${event}` + script. diff --git a/deps/npm/node_modules/@npmcli/run-script/lib/is-windows.js b/deps/npm/node_modules/@npmcli/run-script/lib/is-windows.js new file mode 100644 index 00000000000000..651917e6ad27ab --- /dev/null +++ b/deps/npm/node_modules/@npmcli/run-script/lib/is-windows.js @@ -0,0 +1,2 @@ +const platform = process.env.__FAKE_TESTING_PLATFORM__ || process.platform +module.exports = platform === 'win32' 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 new file mode 100644 index 00000000000000..181be8493f3343 --- /dev/null +++ b/deps/npm/node_modules/@npmcli/run-script/lib/make-spawn-args.js @@ -0,0 +1,40 @@ +/* eslint camelcase: "off" */ +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 makeSpawnArgs = options => { + const { + event, + path, + scriptShell = isWindows ? process.env.comspec || 'cmd' : 'sh', + env = {}, + stdio, + cmd, + stdioString = false, + } = options + + const isCmd = /(?:^|\\)cmd(?:\.exe)?$/i.test(scriptShell) + const args = isCmd ? ['/d', '/s', '/c', `"${cmd}"`] : ['-c', cmd] + + const spawnOpts = { + env: setPATH(path, { + // we need to at least save the PATH environment var + ...process.env, + ...env, + npm_package_json: resolve(path, 'package.json'), + npm_lifecycle_event: event, + npm_lifecycle_script: cmd, + npm_config_node_gyp, + }), + stdioString, + stdio, + cwd: path, + ...(isCmd ? { windowsVerbatimArguments: true } : {}), + } + + return [scriptShell, args, spawnOpts] +} + +module.exports = makeSpawnArgs diff --git a/deps/npm/node_modules/@npmcli/run-script/lib/node-gyp-bin/node-gyp b/deps/npm/node_modules/@npmcli/run-script/lib/node-gyp-bin/node-gyp new file mode 100755 index 00000000000000..5bec64d961a3a9 --- /dev/null +++ b/deps/npm/node_modules/@npmcli/run-script/lib/node-gyp-bin/node-gyp @@ -0,0 +1,2 @@ +#!/usr/bin/env sh +node "$npm_config_node_gyp" "$@" diff --git a/deps/npm/node_modules/@npmcli/run-script/lib/node-gyp-bin/node-gyp.cmd b/deps/npm/node_modules/@npmcli/run-script/lib/node-gyp-bin/node-gyp.cmd new file mode 100755 index 00000000000000..a59f0c4f9722e0 --- /dev/null +++ b/deps/npm/node_modules/@npmcli/run-script/lib/node-gyp-bin/node-gyp.cmd @@ -0,0 +1 @@ +@node "%npm_config_node_gyp%" %* diff --git a/deps/npm/node_modules/@npmcli/run-script/lib/package-envs.js b/deps/npm/node_modules/@npmcli/run-script/lib/package-envs.js new file mode 100644 index 00000000000000..47791fb991bd53 --- /dev/null +++ b/deps/npm/node_modules/@npmcli/run-script/lib/package-envs.js @@ -0,0 +1,25 @@ +// https://github.com/npm/rfcs/pull/183 + +const envVal = val => Array.isArray(val) ? val.map(v => envVal(v)).join('\n\n') + : val === null || val === false ? '' + : String(val) + +const packageEnvs = (env, vals, prefix) => { + for (const [key, val] of Object.entries(vals)) { + if (val === undefined) + continue + else if (val && !Array.isArray(val) && typeof val === 'object') + packageEnvs(env, val, `${prefix}${key}_`) + else + env[`${prefix}${key}`] = envVal(val) + } + return env +} + +module.exports = (env, pkg) => packageEnvs({ ...env }, { + name: pkg.name, + version: pkg.version, + config: pkg.config, + engines: pkg.engines, + bin: pkg.bin, +}, 'npm_package_') diff --git a/deps/npm/node_modules/@npmcli/run-script/lib/run-script-pkg.js b/deps/npm/node_modules/@npmcli/run-script/lib/run-script-pkg.js new file mode 100644 index 00000000000000..841ed4db32e3de --- /dev/null +++ b/deps/npm/node_modules/@npmcli/run-script/lib/run-script-pkg.js @@ -0,0 +1,65 @@ +const makeSpawnArgs = require('./make-spawn-args.js') +const promiseSpawn = require('@npmcli/promise-spawn') +const packageEnvs = require('./package-envs.js') +const { isNodeGypPackage, defaultGypInstallScript } = require('@npmcli/node-gyp') + +// you wouldn't like me when I'm angry... +const bruce = (id, event, cmd) => `\n> ${id ? id + ' ' : ''}${event}\n> ${cmd}\n` + +const runScriptPkg = async options => { + const { + event, + path, + scriptShell, + env = {}, + stdio = 'pipe', + pkg, + args = [], + stdioString = false, + // note: only used when stdio:inherit + banner = true, + } = options + + const {scripts = {}, gypfile} = pkg + let cmd = null + if (options.cmd) + cmd = options.cmd + else if (pkg.scripts && pkg.scripts[event]) + cmd = pkg.scripts[event] + args.map(a => ` ${JSON.stringify(a)}`).join('') + else if ( // If there is no preinstall or install script, default to rebuilding node-gyp packages. + event === 'install' && + !scripts.install && + !scripts.preinstall && + gypfile !== false && + await isNodeGypPackage(path) + ) + cmd = defaultGypInstallScript + + if (!cmd) + return { code: 0, signal: null } + + if (stdio === 'inherit' && banner !== false) { + // we're dumping to the parent's stdout, so print the banner + console.log(bruce(pkg._id, event, cmd)) + } + + const p = promiseSpawn(...makeSpawnArgs({ + event, + path, + scriptShell, + env: packageEnvs(env, pkg), + stdio, + cmd, + stdioString, + }), { + event, + script: cmd, + pkgid: pkg._id, + path, + }) + if (p.stdin) + p.stdin.end() + return p +} + +module.exports = runScriptPkg diff --git a/deps/npm/node_modules/@npmcli/run-script/lib/run-script.js b/deps/npm/node_modules/@npmcli/run-script/lib/run-script.js new file mode 100644 index 00000000000000..3be39b0ba8076f --- /dev/null +++ b/deps/npm/node_modules/@npmcli/run-script/lib/run-script.js @@ -0,0 +1,12 @@ +const rpj = require('read-package-json-fast') +const runScriptPkg = require('./run-script-pkg.js') +const validateOptions = require('./validate-options.js') + +const runScript = options => { + validateOptions(options) + const {pkg, path} = options + return pkg ? runScriptPkg(options) + : rpj(path + '/package.json').then(pkg => runScriptPkg({...options, pkg})) +} + +module.exports = runScript diff --git a/deps/npm/node_modules/@npmcli/run-script/lib/set-path.js b/deps/npm/node_modules/@npmcli/run-script/lib/set-path.js new file mode 100644 index 00000000000000..dfa8001b7743dd --- /dev/null +++ b/deps/npm/node_modules/@npmcli/run-script/lib/set-path.js @@ -0,0 +1,42 @@ +const {resolve, dirname} = require('path') +const isWindows = require('./is-windows.js') +const nodeGypPath = resolve(__dirname, 'node-gyp-bin') + +// Windows typically calls its PATH environ 'Path', but this is not +// guaranteed, nor is it guaranteed to be the only one. Merge them +// all together in the order they appear in the object. +const setPATH = (projectPath, env) => { + // not require('path').delimiter, because we fake this for testing + const delimiter = isWindows ? ';' : ':' + const PATH = Object.keys(env).filter(p => /^path$/i.test(p) && env[p]) + .map(p => env[p].split(delimiter)) + .reduce((set, p) => set.concat(p.filter(p => !set.includes(p))), []) + .join(delimiter) + + const pathArr = [] + // unshift the ./node_modules/.bin from every folder + // walk up until dirname() does nothing, at the root + // XXX should we specify a cwd that we don't go above? + let p = projectPath + let pp + do { + pathArr.push(resolve(p, 'node_modules', '.bin')) + pp = p + p = dirname(p) + } while (p !== pp) + pathArr.push(nodeGypPath, PATH) + + const pathVal = pathArr.join(delimiter) + + // XXX include the node-gyp-bin path somehow? Probably better for + // npm or arborist or whoever to just provide that by putting it in + // the PATH environ, since that's preserved anyway. + for (const key of Object.keys(env)) { + if (/^path$/i.test(key)) + env[key] = pathVal + } + + return env +} + +module.exports = setPATH diff --git a/deps/npm/node_modules/@npmcli/run-script/lib/validate-options.js b/deps/npm/node_modules/@npmcli/run-script/lib/validate-options.js new file mode 100644 index 00000000000000..48ac5c5d9e399f --- /dev/null +++ b/deps/npm/node_modules/@npmcli/run-script/lib/validate-options.js @@ -0,0 +1,31 @@ +const validateOptions = options => { + if (typeof options !== 'object' || !options) + throw new TypeError('invalid options object provided to runScript') + + const { + event, + path, + scriptShell, + env = {}, + stdio = 'pipe', + args = [], + cmd, + } = options + + if (!event || typeof event !== 'string') + throw new TypeError('valid event not provided to runScript') + if (!path || typeof path !== 'string') + throw new TypeError('valid path not provided to runScript') + if (scriptShell !== undefined && typeof scriptShell !== 'string') + throw new TypeError('invalid scriptShell option provided to runScript') + if (typeof env !== 'object' || !env) + throw new TypeError('invalid env option provided to runScript') + if (typeof stdio !== 'string' && !Array.isArray(stdio)) + throw new TypeError('invalid stdio option provided to runScript') + if (!Array.isArray(args) || args.some(a => typeof a !== 'string')) + throw new TypeError('invalid args option provided to runScript') + if (cmd !== undefined && typeof cmd !== 'string') + throw new TypeError('invalid cmd option provided to runScript') +} + +module.exports = validateOptions diff --git a/deps/npm/node_modules/@npmcli/run-script/package.json b/deps/npm/node_modules/@npmcli/run-script/package.json new file mode 100644 index 00000000000000..2481066cbf3cdc --- /dev/null +++ b/deps/npm/node_modules/@npmcli/run-script/package.json @@ -0,0 +1,46 @@ +{ + "name": "@npmcli/run-script", + "version": "1.7.2", + "description": "Run a lifecycle script for a package (descendant of npm-lifecycle)", + "author": "Isaac Z. Schlueter (https://izs.me)", + "license": "ISC", + "scripts": { + "test": "tap", + "preversion": "npm test", + "postversion": "npm publish", + "prepublishOnly": "git push origin --follow-tags", + "eslint": "eslint", + "lint": "npm run eslint -- \"lib/**/*.js\"", + "lintfix": "npm run lint -- --fix" + }, + "tap": { + "check-coverage": true, + "coverage-map": "map.js" + }, + "devDependencies": { + "eslint": "^7.10.0", + "eslint-plugin-import": "^2.22.1", + "eslint-plugin-node": "^11.1.0", + "eslint-plugin-promise": "^4.2.1", + "eslint-plugin-standard": "^4.0.1", + "minipass": "^3.1.1", + "require-inject": "^1.4.4", + "tap": "^14.10.6" + }, + "dependencies": { + "@npmcli/node-gyp": "^1.0.0", + "@npmcli/promise-spawn": "^1.2.0", + "infer-owner": "^1.0.4", + "node-gyp": "^7.1.0", + "read-package-json-fast": "^1.1.3" + }, + "files": [ + "lib/**/*.js", + "lib/node-gyp-bin" + ], + "main": "lib/run-script.js", + "repository": { + "type": "git", + "url": "git+https://github.com/npm/run-script.git" + } +} diff --git a/deps/npm/node_modules/@tootallnate/once/dist/index.d.ts b/deps/npm/node_modules/@tootallnate/once/dist/index.d.ts new file mode 100644 index 00000000000000..a7efe943b2acbc --- /dev/null +++ b/deps/npm/node_modules/@tootallnate/once/dist/index.d.ts @@ -0,0 +1,14 @@ +/// +import { EventEmitter } from 'events'; +declare function once(emitter: EventEmitter, name: string): once.CancelablePromise; +declare namespace once { + interface CancelFunction { + (): void; + } + interface CancelablePromise extends Promise { + cancel: CancelFunction; + } + type CancellablePromise = CancelablePromise; + function spread(emitter: EventEmitter, name: string): once.CancelablePromise; +} +export = once; diff --git a/deps/npm/node_modules/@tootallnate/once/dist/index.js b/deps/npm/node_modules/@tootallnate/once/dist/index.js new file mode 100644 index 00000000000000..bfd0dc88f758b8 --- /dev/null +++ b/deps/npm/node_modules/@tootallnate/once/dist/index.js @@ -0,0 +1,39 @@ +"use strict"; +function noop() { } +function once(emitter, name) { + const o = once.spread(emitter, name); + const r = o.then((args) => args[0]); + r.cancel = o.cancel; + return r; +} +(function (once) { + function spread(emitter, name) { + let c = null; + const p = new Promise((resolve, reject) => { + function cancel() { + emitter.removeListener(name, onEvent); + emitter.removeListener('error', onError); + p.cancel = noop; + } + function onEvent(...args) { + cancel(); + resolve(args); + } + function onError(err) { + cancel(); + reject(err); + } + c = cancel; + emitter.on(name, onEvent); + emitter.on('error', onError); + }); + if (!c) { + throw new TypeError('Could not get `cancel()` function'); + } + p.cancel = c; + return p; + } + once.spread = spread; +})(once || (once = {})); +module.exports = once; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/deps/npm/node_modules/@tootallnate/once/dist/index.js.map b/deps/npm/node_modules/@tootallnate/once/dist/index.js.map new file mode 100644 index 00000000000000..30d20491dbca83 --- /dev/null +++ b/deps/npm/node_modules/@tootallnate/once/dist/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA,SAAS,IAAI,KAAI,CAAC;AAElB,SAAS,IAAI,CACZ,OAAqB,EACrB,IAAY;IAEZ,MAAM,CAAC,GAAG,IAAI,CAAC,MAAM,CAAM,OAAO,EAAE,IAAI,CAAC,CAAC;IAC1C,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,IAAS,EAAE,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC,CAA8B,CAAC;IACtE,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,MAAM,CAAC;IACpB,OAAO,CAAC,CAAC;AACV,CAAC;AAED,WAAU,IAAI;IAWb,SAAgB,MAAM,CACrB,OAAqB,EACrB,IAAY;QAEZ,IAAI,CAAC,GAA+B,IAAI,CAAC;QACzC,MAAM,CAAC,GAAG,IAAI,OAAO,CAAI,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;YAC5C,SAAS,MAAM;gBACd,OAAO,CAAC,cAAc,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;gBACtC,OAAO,CAAC,cAAc,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;gBACzC,CAAC,CAAC,MAAM,GAAG,IAAI,CAAC;YACjB,CAAC;YACD,SAAS,OAAO,CAAC,GAAG,IAAW;gBAC9B,MAAM,EAAE,CAAC;gBACT,OAAO,CAAC,IAAS,CAAC,CAAC;YACpB,CAAC;YACD,SAAS,OAAO,CAAC,GAAU;gBAC1B,MAAM,EAAE,CAAC;gBACT,MAAM,CAAC,GAAG,CAAC,CAAC;YACb,CAAC;YACD,CAAC,GAAG,MAAM,CAAC;YACX,OAAO,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;YAC1B,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QAC9B,CAAC,CAA8B,CAAC;QAChC,IAAI,CAAC,CAAC,EAAE;YACP,MAAM,IAAI,SAAS,CAAC,mCAAmC,CAAC,CAAC;SACzD;QACD,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC;QACb,OAAO,CAAC,CAAC;IACV,CAAC;IA5Be,WAAM,SA4BrB,CAAA;AACF,CAAC,EAxCS,IAAI,KAAJ,IAAI,QAwCb;AAED,iBAAS,IAAI,CAAC"} \ No newline at end of file diff --git a/deps/npm/node_modules/@tootallnate/once/package.json b/deps/npm/node_modules/@tootallnate/once/package.json new file mode 100644 index 00000000000000..8343f9fad73aba --- /dev/null +++ b/deps/npm/node_modules/@tootallnate/once/package.json @@ -0,0 +1,45 @@ +{ + "name": "@tootallnate/once", + "version": "1.1.2", + "description": "Creates a Promise that waits for a single event", + "main": "./dist/index.js", + "types": "./dist/index.d.ts", + "files": [ + "dist" + ], + "scripts": { + "prebuild": "rimraf dist", + "build": "tsc", + "test": "mocha --reporter spec", + "test-lint": "eslint src --ext .js,.ts", + "prepublishOnly": "npm run build" + }, + "repository": { + "type": "git", + "url": "git://github.com/TooTallNate/once.git" + }, + "keywords": [], + "author": "Nathan Rajlich (http://n8.io/)", + "license": "MIT", + "bugs": { + "url": "https://github.com/TooTallNate/once/issues" + }, + "devDependencies": { + "@types/node": "^12.12.11", + "@typescript-eslint/eslint-plugin": "1.6.0", + "@typescript-eslint/parser": "1.1.0", + "eslint": "5.16.0", + "eslint-config-airbnb": "17.1.0", + "eslint-config-prettier": "4.1.0", + "eslint-import-resolver-typescript": "1.1.1", + "eslint-plugin-import": "2.16.0", + "eslint-plugin-jsx-a11y": "6.2.1", + "eslint-plugin-react": "7.12.4", + "mocha": "^6.2.2", + "rimraf": "^3.0.0", + "typescript": "^3.7.3" + }, + "engines": { + "node": ">= 6" + } +} diff --git a/deps/npm/node_modules/@types/color-name/LICENSE b/deps/npm/node_modules/@types/color-name/LICENSE new file mode 100644 index 00000000000000..21071075c24599 --- /dev/null +++ b/deps/npm/node_modules/@types/color-name/LICENSE @@ -0,0 +1,21 @@ + MIT License + + Copyright (c) Microsoft Corporation. All rights reserved. + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all + copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + SOFTWARE diff --git a/deps/npm/node_modules/@types/color-name/README.md b/deps/npm/node_modules/@types/color-name/README.md new file mode 100644 index 00000000000000..d08d108b2b5b67 --- /dev/null +++ b/deps/npm/node_modules/@types/color-name/README.md @@ -0,0 +1,16 @@ +# Installation +> `npm install --save @types/color-name` + +# Summary +This package contains type definitions for color-name ( https://github.com/colorjs/color-name ). + +# Details +Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/color-name + +Additional Details + * Last updated: Wed, 13 Feb 2019 16:16:48 GMT + * Dependencies: none + * Global values: none + +# Credits +These definitions were written by Junyoung Clare Jang . diff --git a/deps/npm/node_modules/@types/color-name/index.d.ts b/deps/npm/node_modules/@types/color-name/index.d.ts new file mode 100644 index 00000000000000..b5bff4717a3beb --- /dev/null +++ b/deps/npm/node_modules/@types/color-name/index.d.ts @@ -0,0 +1,161 @@ +// Type definitions for color-name 1.1 +// Project: https://github.com/colorjs/color-name +// Definitions by: Junyoung Clare Jang +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/** + * Tuple of Red, Green, and Blue + * @example + * // Red = 55, Green = 70, Blue = 0 + * const rgb: RGB = [55, 70, 0]; + */ +export type RGB = [number, number, number]; + +export const aliceblue: RGB; +export const antiquewhite: RGB; +export const aqua: RGB; +export const aquamarine: RGB; +export const azure: RGB; +export const beige: RGB; +export const bisque: RGB; +export const black: RGB; +export const blanchedalmond: RGB; +export const blue: RGB; +export const blueviolet: RGB; +export const brown: RGB; +export const burlywood: RGB; +export const cadetblue: RGB; +export const chartreuse: RGB; +export const chocolate: RGB; +export const coral: RGB; +export const cornflowerblue: RGB; +export const cornsilk: RGB; +export const crimson: RGB; +export const cyan: RGB; +export const darkblue: RGB; +export const darkcyan: RGB; +export const darkgoldenrod: RGB; +export const darkgray: RGB; +export const darkgreen: RGB; +export const darkgrey: RGB; +export const darkkhaki: RGB; +export const darkmagenta: RGB; +export const darkolivegreen: RGB; +export const darkorange: RGB; +export const darkorchid: RGB; +export const darkred: RGB; +export const darksalmon: RGB; +export const darkseagreen: RGB; +export const darkslateblue: RGB; +export const darkslategray: RGB; +export const darkslategrey: RGB; +export const darkturquoise: RGB; +export const darkviolet: RGB; +export const deeppink: RGB; +export const deepskyblue: RGB; +export const dimgray: RGB; +export const dimgrey: RGB; +export const dodgerblue: RGB; +export const firebrick: RGB; +export const floralwhite: RGB; +export const forestgreen: RGB; +export const fuchsia: RGB; +export const gainsboro: RGB; +export const ghostwhite: RGB; +export const gold: RGB; +export const goldenrod: RGB; +export const gray: RGB; +export const green: RGB; +export const greenyellow: RGB; +export const grey: RGB; +export const honeydew: RGB; +export const hotpink: RGB; +export const indianred: RGB; +export const indigo: RGB; +export const ivory: RGB; +export const khaki: RGB; +export const lavender: RGB; +export const lavenderblush: RGB; +export const lawngreen: RGB; +export const lemonchiffon: RGB; +export const lightblue: RGB; +export const lightcoral: RGB; +export const lightcyan: RGB; +export const lightgoldenrodyellow: RGB; +export const lightgray: RGB; +export const lightgreen: RGB; +export const lightgrey: RGB; +export const lightpink: RGB; +export const lightsalmon: RGB; +export const lightseagreen: RGB; +export const lightskyblue: RGB; +export const lightslategray: RGB; +export const lightslategrey: RGB; +export const lightsteelblue: RGB; +export const lightyellow: RGB; +export const lime: RGB; +export const limegreen: RGB; +export const linen: RGB; +export const magenta: RGB; +export const maroon: RGB; +export const mediumaquamarine: RGB; +export const mediumblue: RGB; +export const mediumorchid: RGB; +export const mediumpurple: RGB; +export const mediumseagreen: RGB; +export const mediumslateblue: RGB; +export const mediumspringgreen: RGB; +export const mediumturquoise: RGB; +export const mediumvioletred: RGB; +export const midnightblue: RGB; +export const mintcream: RGB; +export const mistyrose: RGB; +export const moccasin: RGB; +export const navajowhite: RGB; +export const navy: RGB; +export const oldlace: RGB; +export const olive: RGB; +export const olivedrab: RGB; +export const orange: RGB; +export const orangered: RGB; +export const orchid: RGB; +export const palegoldenrod: RGB; +export const palegreen: RGB; +export const paleturquoise: RGB; +export const palevioletred: RGB; +export const papayawhip: RGB; +export const peachpuff: RGB; +export const peru: RGB; +export const pink: RGB; +export const plum: RGB; +export const powderblue: RGB; +export const purple: RGB; +export const rebeccapurple: RGB; +export const red: RGB; +export const rosybrown: RGB; +export const royalblue: RGB; +export const saddlebrown: RGB; +export const salmon: RGB; +export const sandybrown: RGB; +export const seagreen: RGB; +export const seashell: RGB; +export const sienna: RGB; +export const silver: RGB; +export const skyblue: RGB; +export const slateblue: RGB; +export const slategray: RGB; +export const slategrey: RGB; +export const snow: RGB; +export const springgreen: RGB; +export const steelblue: RGB; +export const tan: RGB; +export const teal: RGB; +export const thistle: RGB; +export const tomato: RGB; +export const turquoise: RGB; +export const violet: RGB; +export const wheat: RGB; +export const white: RGB; +export const whitesmoke: RGB; +export const yellow: RGB; +export const yellowgreen: RGB; diff --git a/deps/npm/node_modules/@types/color-name/package.json b/deps/npm/node_modules/@types/color-name/package.json new file mode 100644 index 00000000000000..d5e367e1403798 --- /dev/null +++ b/deps/npm/node_modules/@types/color-name/package.json @@ -0,0 +1,23 @@ +{ + "name": "@types/color-name", + "version": "1.1.1", + "description": "TypeScript definitions for color-name", + "license": "MIT", + "contributors": [ + { + "name": "Junyoung Clare Jang", + "url": "https://github.com/Ailrun", + "githubUsername": "Ailrun" + } + ], + "main": "", + "types": "index", + "repository": { + "type": "git", + "url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git" + }, + "scripts": {}, + "dependencies": {}, + "typesPublisherContentHash": "e22c6881e2dcf766e32142cbb82d9acf9c08258bdf0da8e76c8a448d1be44ac7", + "typeScriptVersion": "2.0" +} \ No newline at end of file diff --git a/deps/npm/node_modules/JSONStream/.travis.yml b/deps/npm/node_modules/JSONStream/.travis.yml deleted file mode 100644 index 5f30bb5bd1aad4..00000000000000 --- a/deps/npm/node_modules/JSONStream/.travis.yml +++ /dev/null @@ -1,8 +0,0 @@ -language: node_js -node_js: - - 4 - - 5 - - 6 -sudo: false - - diff --git a/deps/npm/node_modules/JSONStream/LICENSE.APACHE2 b/deps/npm/node_modules/JSONStream/LICENSE.APACHE2 deleted file mode 100644 index 6366c04716fb9e..00000000000000 --- a/deps/npm/node_modules/JSONStream/LICENSE.APACHE2 +++ /dev/null @@ -1,15 +0,0 @@ -Apache License, Version 2.0 - -Copyright (c) 2011 Dominic Tarr - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. diff --git a/deps/npm/node_modules/JSONStream/LICENSE.MIT b/deps/npm/node_modules/JSONStream/LICENSE.MIT deleted file mode 100644 index 6eafbd734a6e06..00000000000000 --- a/deps/npm/node_modules/JSONStream/LICENSE.MIT +++ /dev/null @@ -1,24 +0,0 @@ -The MIT License - -Copyright (c) 2011 Dominic Tarr - -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/JSONStream/bin.js b/deps/npm/node_modules/JSONStream/bin.js deleted file mode 100755 index af2b6ac6c6e1aa..00000000000000 --- a/deps/npm/node_modules/JSONStream/bin.js +++ /dev/null @@ -1,12 +0,0 @@ -#! /usr/bin/env node - -var JSONStream = require('./') - -if(!module.parent && process.title !== 'browser') { - process.stdin - .pipe(JSONStream.parse(process.argv[2])) - .pipe(JSONStream.stringify('[', ',\n', ']\n', 2)) - .pipe(process.stdout) -} - - diff --git a/deps/npm/node_modules/JSONStream/examples/all_docs.js b/deps/npm/node_modules/JSONStream/examples/all_docs.js deleted file mode 100644 index fa87fe52da53dc..00000000000000 --- a/deps/npm/node_modules/JSONStream/examples/all_docs.js +++ /dev/null @@ -1,13 +0,0 @@ -var request = require('request') - , JSONStream = require('JSONStream') - , es = require('event-stream') - -var parser = JSONStream.parse(['rows', true]) //emit parts that match this path (any element of the rows array) - , req = request({url: 'http://isaacs.couchone.com/registry/_all_docs'}) - , logger = es.mapSync(function (data) { //create a stream that logs to stderr, - console.error(data) - return data - }) - -req.pipe(parser) -parser.pipe(logger) diff --git a/deps/npm/node_modules/JSONStream/index.js b/deps/npm/node_modules/JSONStream/index.js deleted file mode 100755 index f4ed901f965603..00000000000000 --- a/deps/npm/node_modules/JSONStream/index.js +++ /dev/null @@ -1,247 +0,0 @@ -'use strict' - -var Parser = require('jsonparse') - , through = require('through') - -var bufferFrom = Buffer.from && Buffer.from !== Uint8Array.from - -/* - - the value of this.stack that creationix's jsonparse has is weird. - - it makes this code ugly, but his problem is way harder that mine, - so i'll forgive him. - -*/ - -exports.parse = function (path, map) { - var header, footer - var parser = new Parser() - var stream = through(function (chunk) { - if('string' === typeof chunk) - chunk = bufferFrom ? Buffer.from(chunk) : new Buffer(chunk) - parser.write(chunk) - }, - function (data) { - if(data) - stream.write(data) - if (header) - stream.emit('header', header) - if (footer) - stream.emit('footer', footer) - stream.queue(null) - }) - - if('string' === typeof path) - path = path.split('.').map(function (e) { - if (e === '$*') - return {emitKey: true} - else if (e === '*') - return true - else if (e === '') // '..'.split('.') returns an empty string - return {recurse: true} - else - return e - }) - - - var count = 0, _key - if(!path || !path.length) - path = null - - parser.onValue = function (value) { - if (!this.root) - stream.root = value - - if(! path) return - - var i = 0 // iterates on path - var j = 0 // iterates on stack - var emitKey = false; - var emitPath = false; - while (i < path.length) { - var key = path[i] - var c - j++ - - if (key && !key.recurse) { - c = (j === this.stack.length) ? this : this.stack[j] - if (!c) return - if (! check(key, c.key)) { - setHeaderFooter(c.key, value) - return - } - emitKey = !!key.emitKey; - emitPath = !!key.emitPath; - i++ - } else { - i++ - var nextKey = path[i] - if (! nextKey) return - while (true) { - c = (j === this.stack.length) ? this : this.stack[j] - if (!c) return - if (check(nextKey, c.key)) { - i++; - if (!Object.isFrozen(this.stack[j])) - this.stack[j].value = null - break - } else { - setHeaderFooter(c.key, value) - } - j++ - } - } - - } - - // emit header - if (header) { - stream.emit('header', header); - header = false; - } - if (j !== this.stack.length) return - - count ++ - var actualPath = this.stack.slice(1).map(function(element) { return element.key }).concat([this.key]) - var data = value - if(null != data) - if(null != (data = map ? map(data, actualPath) : data)) { - if (emitKey || emitPath) { - data = { value: data }; - if (emitKey) - data["key"] = this.key; - if (emitPath) - data["path"] = actualPath; - } - - stream.queue(data) - } - if (this.value) delete this.value[this.key] - for(var k in this.stack) - if (!Object.isFrozen(this.stack[k])) - this.stack[k].value = null - } - parser._onToken = parser.onToken; - - parser.onToken = function (token, value) { - parser._onToken(token, value); - if (this.stack.length === 0) { - if (stream.root) { - if(!path) - stream.queue(stream.root) - count = 0; - stream.root = null; - } - } - } - - parser.onError = function (err) { - if(err.message.indexOf("at position") > -1) - err.message = "Invalid JSON (" + err.message + ")"; - stream.emit('error', err) - } - - return stream - - function setHeaderFooter(key, value) { - // header has not been emitted yet - if (header !== false) { - header = header || {} - header[key] = value - } - - // footer has not been emitted yet but header has - if (footer !== false && header === false) { - footer = footer || {} - footer[key] = value - } - } -} - -function check (x, y) { - if ('string' === typeof x) - return y == x - else if (x && 'function' === typeof x.exec) - return x.exec(y) - else if ('boolean' === typeof x || 'object' === typeof x) - return x - else if ('function' === typeof x) - return x(y) - return false -} - -exports.stringify = function (op, sep, cl, indent) { - indent = indent || 0 - if (op === false){ - op = '' - sep = '\n' - cl = '' - } else if (op == null) { - - op = '[\n' - sep = '\n,\n' - cl = '\n]\n' - - } - - //else, what ever you like - - var stream - , first = true - , anyData = false - stream = through(function (data) { - anyData = true - try { - var json = JSON.stringify(data, null, indent) - } catch (err) { - return stream.emit('error', err) - } - if(first) { first = false ; stream.queue(op + json)} - else stream.queue(sep + json) - }, - function (data) { - if(!anyData) - stream.queue(op) - stream.queue(cl) - stream.queue(null) - }) - - return stream -} - -exports.stringifyObject = function (op, sep, cl, indent) { - indent = indent || 0 - if (op === false){ - op = '' - sep = '\n' - cl = '' - } else if (op == null) { - - op = '{\n' - sep = '\n,\n' - cl = '\n}\n' - - } - - //else, what ever you like - - var first = true - var anyData = false - var stream = through(function (data) { - anyData = true - var json = JSON.stringify(data[0]) + ':' + JSON.stringify(data[1], null, indent) - if(first) { first = false ; this.queue(op + json)} - else this.queue(sep + json) - }, - function (data) { - if(!anyData) this.queue(op) - this.queue(cl) - - this.queue(null) - }) - - return stream -} - - diff --git a/deps/npm/node_modules/JSONStream/package.json b/deps/npm/node_modules/JSONStream/package.json deleted file mode 100644 index 91783af0b0ab64..00000000000000 --- a/deps/npm/node_modules/JSONStream/package.json +++ /dev/null @@ -1,76 +0,0 @@ -{ - "_from": "JSONStream@1.3.5", - "_id": "JSONStream@1.3.5", - "_inBundle": false, - "_integrity": "sha512-E+iruNOY8VV9s4JEbe1aNEm6MiszPRr/UfcHMz0TQh1BXSxHK+ASV1R6W4HpjBhSeS+54PIsAMCBmwD06LLsqQ==", - "_location": "/JSONStream", - "_phantomChildren": {}, - "_requested": { - "type": "version", - "registry": true, - "raw": "JSONStream@1.3.5", - "name": "JSONStream", - "escapedName": "JSONStream", - "rawSpec": "1.3.5", - "saveSpec": null, - "fetchSpec": "1.3.5" - }, - "_requiredBy": [ - "#USER", - "/", - "/npm-registry-fetch" - ], - "_resolved": "https://registry.npmjs.org/JSONStream/-/JSONStream-1.3.5.tgz", - "_shasum": "3208c1f08d3a4d99261ab64f92302bc15e111ca0", - "_spec": "JSONStream@1.3.5", - "_where": "/Users/aeschright/code/cli", - "author": { - "name": "Dominic Tarr", - "email": "dominic.tarr@gmail.com", - "url": "http://bit.ly/dominictarr" - }, - "bin": { - "JSONStream": "./bin.js" - }, - "bugs": { - "url": "https://github.com/dominictarr/JSONStream/issues" - }, - "bundleDependencies": false, - "dependencies": { - "jsonparse": "^1.2.0", - "through": ">=2.2.7 <3" - }, - "deprecated": false, - "description": "rawStream.pipe(JSONStream.parse()).pipe(streamOfObjects)", - "devDependencies": { - "assertions": "~2.2.2", - "event-stream": "~0.7.0", - "it-is": "~1", - "render": "~0.1.1", - "tape": "~2.12.3", - "trees": "~0.0.3" - }, - "engines": { - "node": "*" - }, - "homepage": "http://github.com/dominictarr/JSONStream", - "keywords": [ - "json", - "stream", - "streaming", - "parser", - "async", - "parsing" - ], - "license": "(MIT OR Apache-2.0)", - "name": "JSONStream", - "optionalDependencies": {}, - "repository": { - "type": "git", - "url": "git://github.com/dominictarr/JSONStream.git" - }, - "scripts": { - "test": "node test/run.js" - }, - "version": "1.3.5" -} diff --git a/deps/npm/node_modules/JSONStream/readme.markdown b/deps/npm/node_modules/JSONStream/readme.markdown deleted file mode 100644 index 422c3df2cc616a..00000000000000 --- a/deps/npm/node_modules/JSONStream/readme.markdown +++ /dev/null @@ -1,207 +0,0 @@ -# JSONStream - -streaming JSON.parse and stringify - -![](https://secure.travis-ci.org/dominictarr/JSONStream.png?branch=master) - -## install -```npm install JSONStream``` - -## example - -``` js - -var request = require('request') - , JSONStream = require('JSONStream') - , es = require('event-stream') - -request({url: 'http://isaacs.couchone.com/registry/_all_docs'}) - .pipe(JSONStream.parse('rows.*')) - .pipe(es.mapSync(function (data) { - console.error(data) - return data - })) -``` - -## JSONStream.parse(path) - -parse stream of values that match a path - -``` js - JSONStream.parse('rows.*.doc') -``` - -The `..` operator is the recursive descent operator from [JSONPath](http://goessner.net/articles/JsonPath/), which will match a child at any depth (see examples below). - -If your keys have keys that include `.` or `*` etc, use an array instead. -`['row', true, /^doc/]`. - -If you use an array, `RegExp`s, booleans, and/or functions. The `..` operator is also available in array representation, using `{recurse: true}`. -any object that matches the path will be emitted as 'data' (and `pipe`d down stream) - -If `path` is empty or null, no 'data' events are emitted. - -If you want to have keys emitted, you can prefix your `*` operator with `$`: `obj.$*` - in this case the data passed to the stream is an object with a `key` holding the key and a `value` property holding the data. - -### Examples - -query a couchdb view: - -``` bash -curl -sS localhost:5984/tests/_all_docs&include_docs=true -``` -you will get something like this: - -``` js -{"total_rows":129,"offset":0,"rows":[ - { "id":"change1_0.6995461115147918" - , "key":"change1_0.6995461115147918" - , "value":{"rev":"1-e240bae28c7bb3667f02760f6398d508"} - , "doc":{ - "_id": "change1_0.6995461115147918" - , "_rev": "1-e240bae28c7bb3667f02760f6398d508","hello":1} - }, - { "id":"change2_0.6995461115147918" - , "key":"change2_0.6995461115147918" - , "value":{"rev":"1-13677d36b98c0c075145bb8975105153"} - , "doc":{ - "_id":"change2_0.6995461115147918" - , "_rev":"1-13677d36b98c0c075145bb8975105153" - , "hello":2 - } - }, -]} - -``` - -we are probably most interested in the `rows.*.doc` - -create a `Stream` that parses the documents from the feed like this: - -``` js -var stream = JSONStream.parse(['rows', true, 'doc']) //rows, ANYTHING, doc - -stream.on('data', function(data) { - console.log('received:', data); -}); -//emits anything from _before_ the first match -stream.on('header', function (data) { - console.log('header:', data) // => {"total_rows":129,"offset":0} -}) - -``` -awesome! - -In case you wanted the contents the doc emitted: - -``` js -var stream = JSONStream.parse(['rows', true, 'doc', {emitKey: true}]) //rows, ANYTHING, doc, items in docs with keys - -stream.on('data', function(data) { - console.log('key:', data.key); - console.log('value:', data.value); -}); - -``` - -You can also emit the path: - -``` js -var stream = JSONStream.parse(['rows', true, 'doc', {emitPath: true}]) //rows, ANYTHING, doc, items in docs with keys - -stream.on('data', function(data) { - console.log('path:', data.path); - console.log('value:', data.value); -}); - -``` - -### recursive patterns (..) - -`JSONStream.parse('docs..value')` -(or `JSONStream.parse(['docs', {recurse: true}, 'value'])` using an array) -will emit every `value` object that is a child, grand-child, etc. of the -`docs` object. In this example, it will match exactly 5 times at various depth -levels, emitting 0, 1, 2, 3 and 4 as results. - -```js -{ - "total": 5, - "docs": [ - { - "key": { - "value": 0, - "some": "property" - } - }, - {"value": 1}, - {"value": 2}, - {"blbl": [{}, {"a":0, "b":1, "value":3}, 10]}, - {"value": 4} - ] -} -``` - -## JSONStream.parse(pattern, map) - -provide a function that can be used to map or filter -the json output. `map` is passed the value at that node of the pattern, -if `map` return non-nullish (anything but `null` or `undefined`) -that value will be emitted in the stream. If it returns a nullish value, -nothing will be emitted. - -`JSONStream` also emits `'header'` and `'footer'` events, -the `'header'` event contains anything in the output that was before -the first match, and the `'footer'`, is anything after the last match. - -## JSONStream.stringify(open, sep, close) - -Create a writable stream. - -you may pass in custom `open`, `close`, and `seperator` strings. -But, by default, `JSONStream.stringify()` will create an array, -(with default options `open='[\n', sep='\n,\n', close='\n]\n'`) - -If you call `JSONStream.stringify(false)` -the elements will only be seperated by a newline. - -If you only write one item this will be valid JSON. - -If you write many items, -you can use a `RegExp` to split it into valid chunks. - -## JSONStream.stringifyObject(open, sep, close) - -Very much like `JSONStream.stringify`, -but creates a writable stream for objects instead of arrays. - -Accordingly, `open='{\n', sep='\n,\n', close='\n}\n'`. - -When you `.write()` to the stream you must supply an array with `[ key, data ]` -as the first argument. - -## unix tool - -query npm to see all the modules that browserify has ever depended on. - -``` bash -curl https://registry.npmjs.org/browserify | JSONStream 'versions.*.dependencies' -``` - -## numbers - -numbers will be emitted as numbers. -huge numbers that cannot be represented in memory as javascript numbers will be emitted as strings. -cf https://github.com/creationix/jsonparse/commit/044b268f01c4b8f97fb936fc85d3bcfba179e5bb for details. - -## Acknowlegements - -this module depends on https://github.com/creationix/jsonparse -by Tim Caswell -and also thanks to Florent Jaby for teaching me about parsing with: -https://github.com/Floby/node-json-streams - -## license - -Dual-licensed under the MIT License or the Apache License, version 2.0 - diff --git a/deps/npm/node_modules/JSONStream/test/bool.js b/deps/npm/node_modules/JSONStream/test/bool.js deleted file mode 100644 index 6c386d609f07f5..00000000000000 --- a/deps/npm/node_modules/JSONStream/test/bool.js +++ /dev/null @@ -1,41 +0,0 @@ - -var fs = require ('fs') - , join = require('path').join - , file = join(__dirname, 'fixtures','all_npm.json') - , JSONStream = require('../') - , it = require('it-is').style('colour') - - function randomObj () { - return ( - Math.random () < 0.4 - ? {hello: 'eonuhckmqjk', - whatever: 236515, - lies: true, - nothing: [null], -// stuff: [Math.random(),Math.random(),Math.random()] - } - : ['AOREC', 'reoubaor', {ouec: 62642}, [[[], {}, 53]]] - ) - } - -var expected = [] - , stringify = JSONStream.stringify() - , es = require('event-stream') - , stringified = '' - , called = 0 - , count = 10 - , ended = false - -while (count --) - expected.push(randomObj()) - - es.connect( - es.readArray(expected), - stringify, - JSONStream.parse([true]), - es.writeArray(function (err, lines) { - - it(lines).has(expected) - console.error('PASSED') - }) - ) diff --git a/deps/npm/node_modules/JSONStream/test/browser.js b/deps/npm/node_modules/JSONStream/test/browser.js deleted file mode 100644 index 3c28d4919f3ecb..00000000000000 --- a/deps/npm/node_modules/JSONStream/test/browser.js +++ /dev/null @@ -1,18 +0,0 @@ -var test = require('tape') -var JSONStream = require('../') -var testData = '{"rows":[{"hello":"world"}, {"foo": "bar"}]}' - -test('basic parsing', function (t) { - t.plan(2) - var parsed = JSONStream.parse("rows.*") - var parsedKeys = {} - parsed.on('data', function(match) { - parsedKeys[Object.keys(match)[0]] = true - }) - parsed.on('end', function() { - t.equal(!!parsedKeys['hello'], true) - t.equal(!!parsedKeys['foo'], true) - }) - parsed.write(testData) - parsed.end() -}) \ No newline at end of file diff --git a/deps/npm/node_modules/JSONStream/test/destroy_missing.js b/deps/npm/node_modules/JSONStream/test/destroy_missing.js deleted file mode 100644 index 315fdc83423104..00000000000000 --- a/deps/npm/node_modules/JSONStream/test/destroy_missing.js +++ /dev/null @@ -1,27 +0,0 @@ -var fs = require ('fs'); -var net = require('net'); -var join = require('path').join; -var file = join(__dirname, 'fixtures','all_npm.json'); -var JSONStream = require('../'); - - -var server = net.createServer(function(client) { - var parser = JSONStream.parse([]); - parser.on('end', function() { - console.log('close') - console.error('PASSED'); - server.close(); - }); - client.pipe(parser); - var n = 4 - client.on('data', function () { - if(--n) return - client.end(); - }) -}); -server.listen(9999); - - -var client = net.connect({ port : 9999 }, function() { - fs.createReadStream(file).pipe(client).on('data', console.log) //.resume(); -}); diff --git a/deps/npm/node_modules/JSONStream/test/doubledot1.js b/deps/npm/node_modules/JSONStream/test/doubledot1.js deleted file mode 100644 index 78149b93f6e7c3..00000000000000 --- a/deps/npm/node_modules/JSONStream/test/doubledot1.js +++ /dev/null @@ -1,29 +0,0 @@ -var fs = require ('fs') - , join = require('path').join - , file = join(__dirname, 'fixtures','all_npm.json') - , JSONStream = require('../') - , it = require('it-is') - -var expected = JSON.parse(fs.readFileSync(file)) - , parser = JSONStream.parse('rows..rev') - , called = 0 - , ended = false - , parsed = [] - -fs.createReadStream(file).pipe(parser) - -parser.on('data', function (data) { - called ++ - parsed.push(data) -}) - -parser.on('end', function () { - ended = true -}) - -process.on('exit', function () { - it(called).equal(expected.rows.length) - for (var i = 0 ; i < expected.rows.length ; i++) - it(parsed[i]).deepEqual(expected.rows[i].value.rev) - console.error('PASSED') -}) diff --git a/deps/npm/node_modules/JSONStream/test/doubledot2.js b/deps/npm/node_modules/JSONStream/test/doubledot2.js deleted file mode 100644 index b0bc5b16704a7b..00000000000000 --- a/deps/npm/node_modules/JSONStream/test/doubledot2.js +++ /dev/null @@ -1,30 +0,0 @@ - var fs = require ('fs') - , join = require('path').join - , file = join(__dirname, 'fixtures','depth.json') - , JSONStream = require('../') - , it = require('it-is') - - var expected = JSON.parse(fs.readFileSync(file)) - , parser = JSONStream.parse(['docs', {recurse: true}, 'value']) - , called = 0 - , ended = false - , parsed = [] - - fs.createReadStream(file).pipe(parser) - - parser.on('data', function (data) { - called ++ - parsed.push(data) - }) - - parser.on('end', function () { - ended = true - }) - - process.on('exit', function () { - var expectedValues = [0, [1], {"a": 2}, "3", 4] - it(called).equal(expectedValues.length) - for (var i = 0 ; i < 5 ; i++) - it(parsed[i]).deepEqual(expectedValues[i]) - console.error('PASSED') - }) diff --git a/deps/npm/node_modules/JSONStream/test/empty.js b/deps/npm/node_modules/JSONStream/test/empty.js deleted file mode 100644 index 19e888c1eb6c16..00000000000000 --- a/deps/npm/node_modules/JSONStream/test/empty.js +++ /dev/null @@ -1,44 +0,0 @@ -var JSONStream = require('../') - , stream = require('stream') - , it = require('it-is') - -var output = [ [], [] ] - -var parser1 = JSONStream.parse(['docs', /./]) -parser1.on('data', function(data) { - output[0].push(data) -}) - -var parser2 = JSONStream.parse(['docs', /./]) -parser2.on('data', function(data) { - output[1].push(data) -}) - -var pending = 2 -function onend () { - if (--pending > 0) return - it(output).deepEqual([ - [], [{hello: 'world'}] - ]) - console.error('PASSED') -} -parser1.on('end', onend) -parser2.on('end', onend) - -function makeReadableStream() { - var readStream = new stream.Stream() - readStream.readable = true - readStream.write = function (data) { this.emit('data', data) } - readStream.end = function (data) { this.emit('end') } - return readStream -} - -var emptyArray = makeReadableStream() -emptyArray.pipe(parser1) -emptyArray.write('{"docs":[]}') -emptyArray.end() - -var objectArray = makeReadableStream() -objectArray.pipe(parser2) -objectArray.write('{"docs":[{"hello":"world"}]}') -objectArray.end() diff --git a/deps/npm/node_modules/JSONStream/test/error_contents.js b/deps/npm/node_modules/JSONStream/test/error_contents.js deleted file mode 100644 index 13c27aec0d35ab..00000000000000 --- a/deps/npm/node_modules/JSONStream/test/error_contents.js +++ /dev/null @@ -1,45 +0,0 @@ - - -var fs = require ('fs') - , join = require('path').join - , file = join(__dirname, 'fixtures','error.json') - , JSONStream = require('../') - , it = require('it-is') - -var expected = JSON.parse(fs.readFileSync(file)) - , parser = JSONStream.parse(['rows']) - , called = 0 - , headerCalled = 0 - , footerCalled = 0 - , ended = false - , parsed = [] - -fs.createReadStream(file).pipe(parser) - -parser.on('header', function (data) { - headerCalled ++ - it(data).deepEqual({ - error: 'error_code', - message: 'this is an error message' - }) -}) - -parser.on('footer', function (data) { - footerCalled ++ -}) - -parser.on('data', function (data) { - called ++ - parsed.push(data) -}) - -parser.on('end', function () { - ended = true -}) - -process.on('exit', function () { - it(called).equal(0) - it(headerCalled).equal(1) - it(footerCalled).equal(0) - console.error('PASSED') -}) diff --git a/deps/npm/node_modules/JSONStream/test/fixtures/all_npm.json b/deps/npm/node_modules/JSONStream/test/fixtures/all_npm.json deleted file mode 100644 index 2ada0396e1091e..00000000000000 --- a/deps/npm/node_modules/JSONStream/test/fixtures/all_npm.json +++ /dev/null @@ -1,4030 +0,0 @@ -{"total_rows":4028,"offset":0,"rows":[ -{"id":"","key":"","value":{"rev":"1-2f11e026763c10730d8b19ba5dce7565"}}, -{"id":"3scale","key":"3scale","value":{"rev":"3-db3d574bf0ecdfdf627afeaa21b4bdaa"}}, -{"id":"7digital-api","key":"7digital-api","value":{"rev":"20-21d11832780e2368aabc946598a41dd5"}}, -{"id":"AMD","key":"AMD","value":{"rev":"7-3b4305a9c786ab4c5ce611e7f0de0aca"}}, -{"id":"AriesNode","key":"AriesNode","value":{"rev":"3-9d88392bca6582c5c54784927dbfdee6"}}, -{"id":"Array.prototype.forEachAsync","key":"Array.prototype.forEachAsync","value":{"rev":"3-85696441ba6bef77cc1e7de7b073110e"}}, -{"id":"Babel","key":"Babel","value":{"rev":"5-9d8370c6ac6fd9cd3d530f26a9379814"}}, -{"id":"Blaggie-System","key":"Blaggie-System","value":{"rev":"3-47782b1e5cbfa425170192799510e148"}}, -{"id":"Blob","key":"Blob","value":{"rev":"3-cf5fb5d69da4dd00bc4f2be8870ca698"}}, -{"id":"BlobBuilder","key":"BlobBuilder","value":{"rev":"3-eb977ff1713a915384fac994f9d8fa7c"}}, -{"id":"Buffer","key":"Buffer","value":{"rev":"3-549594b58e83d6d07bb219e73de558e5"}}, -{"id":"CLI-UI","key":"CLI-UI","value":{"rev":"5-5912625f27b4bdfb4d3eed16726c48a8"}}, -{"id":"CLoader","key":"CLoader","value":{"rev":"1-ad3c317ddf3497e73ab41cb1ddbc6ba8"}}, -{"id":"CM1","key":"CM1","value":{"rev":"15-a325a2dc28bc6967a1a14beed86f3b80"}}, -{"id":"CONFIGURATOR","key":"CONFIGURATOR","value":{"rev":"3-c76bf9282a75cc4d3fb349e831ccb8a5"}}, -{"id":"Cashew","key":"Cashew","value":{"rev":"7-6a74dc51dbecc47d2c15bfb7d056a20f"}}, -{"id":"Class","key":"Class","value":{"rev":"5-958c6365f76a60a8b3dafbbd9730ac7e"}}, -{"id":"ClassLoader","key":"ClassLoader","value":{"rev":"3-27fe8faa8a1d60d639f87af52826ed47"}}, -{"id":"ClearSilver","key":"ClearSilver","value":{"rev":"3-f3e54eb9ce64fc6a090186e61f15ed0b"}}, -{"id":"Couch-cleaner","key":"Couch-cleaner","value":{"rev":"3-fc77270917d967a4e2e8637cfa9f0fe0"}}, -{"id":"CouchCover","key":"CouchCover","value":{"rev":"15-3b2d87d314f57272a5c27c42bbb3eaf9"}}, -{"id":"DOM-js","key":"DOM-js","value":{"rev":"8-748cdc96566a7b65bbd0b12be2eeb386"}}, -{"id":"DOMBuilder","key":"DOMBuilder","value":{"rev":"19-41a518f2ce16fabc0241535ccd967300"}}, -{"id":"DateZ","key":"DateZ","value":{"rev":"15-69d8115a9bd521e614eaad3cf2611264"}}, -{"id":"Dateselect","key":"Dateselect","value":{"rev":"3-6511567a876d8fe15724bbc7f247214c"}}, -{"id":"Deferred","key":"Deferred","value":{"rev":"3-c61dfc4a0d1bd3e9f35c7182f161f1f2"}}, -{"id":"DeskSet","key":"DeskSet","value":{"rev":"5-359bf760718898ff3591eb366e336cf9"}}, -{"id":"Estro","key":"Estro","value":{"rev":"11-97192e2d0327469bb30f814963db6dff"}}, -{"id":"EventProxy.js","key":"EventProxy.js","value":{"rev":"5-106696b56c6959cec4bfd37f406ee60a"}}, -{"id":"EventServer","key":"EventServer","value":{"rev":"3-59d174119435e99e2affe0c4ba7caae0"}}, -{"id":"Expressive","key":"Expressive","value":{"rev":"3-7eae0ea010eb9014b28108e814918eac"}}, -{"id":"F","key":"F","value":{"rev":"12-91a3db69527b46cf43e36b7ec64a4336"}}, -{"id":"Faker","key":"Faker","value":{"rev":"9-77951c352cb6f9a0b824be620a8fa40d"}}, -{"id":"FastLegS","key":"FastLegS","value":{"rev":"27-4399791981235021a36c94bb9e9b52b5"}}, -{"id":"Fayer","key":"Fayer","value":{"rev":"7-7e4974ff2716329375f9711bcabef701"}}, -{"id":"File","key":"File","value":{"rev":"3-45e353a984038bc48248dfc32b18f9a8"}}, -{"id":"FileError","key":"FileError","value":{"rev":"3-bb4b03a2548e3c229e2c7e92242946c3"}}, -{"id":"FileList","key":"FileList","value":{"rev":"3-ec4a3fc91794ef7fdd3fe88b19cec7b0"}}, -{"id":"FileReader","key":"FileReader","value":{"rev":"7-e81b58a2d8a765ae4781b41bbfadb4cb"}}, -{"id":"FileSaver","key":"FileSaver","value":{"rev":"3-476dcb3f63f4d10feee08d41a8128cb8"}}, -{"id":"FileWriter","key":"FileWriter","value":{"rev":"3-f2fcdbc4938de480cce2e8e8416a93dd"}}, -{"id":"FileWriterSync","key":"FileWriterSync","value":{"rev":"3-9494c3fe7a1230238f37a724ec10895b"}}, -{"id":"FormData","key":"FormData","value":{"rev":"3-8872d717575f7090107a96d81583f6fe"}}, -{"id":"Frenchpress","key":"Frenchpress","value":{"rev":"3-6d916fc15b9e77535771578f96c47c52"}}, -{"id":"FreshDocs","key":"FreshDocs","value":{"rev":"5-f1f3e76c85267faf21d06d911cc6c203"}}, -{"id":"Google_Plus_API","key":"Google_Plus_API","value":{"rev":"3-3302bc9846726d996a45daee3dc5922c"}}, -{"id":"Gord","key":"Gord","value":{"rev":"11-32fddef1453773ac7270ba0e7c83f727"}}, -{"id":"Graph","key":"Graph","value":{"rev":"7-c346edea4f90e3e18d50a62473868cf4"}}, -{"id":"GridFS","key":"GridFS","value":{"rev":"27-4fc649aaa007fddec4947bdb7111560f"}}, -{"id":"Haraka","key":"Haraka","value":{"rev":"39-ee8f890521c1579b3cc779c8ebe03480"}}, -{"id":"Index","key":"Index","value":{"rev":"29-d8f4881c1544bf51dea1927e87ebb3f3"}}, -{"id":"JS-Entities","key":"JS-Entities","value":{"rev":"7-905636d8b46f273210233b60063d079b"}}, -{"id":"JSLint-commonJS","key":"JSLint-commonJS","value":{"rev":"3-759a81f82af7055e85ee89c9707c9609"}}, -{"id":"JSON","key":"JSON","value":{"rev":"3-7966a79067c34fb5de2e62c796f67341"}}, -{"id":"JSONPath","key":"JSONPath","value":{"rev":"7-58789d57ae366a5b0ae4b36837f15d59"}}, -{"id":"JSONSelect","key":"JSONSelect","value":{"rev":"9-5b0730da91eeb52e8f54da516367dc0f"}}, -{"id":"JSONloops","key":"JSONloops","value":{"rev":"3-3d4a1f8bfcfd778ab7def54155324331"}}, -{"id":"JSPP","key":"JSPP","value":{"rev":"7-af09a2bb193b3ff44775e8fbb7d4f522"}}, -{"id":"JSV","key":"JSV","value":{"rev":"3-41a7af86909046111be8ee9b56b077c8"}}, -{"id":"Jody","key":"Jody","value":{"rev":"43-70c1cf40e93cd8ce53249e5295d6b159"}}, -{"id":"Journaling-Hash","key":"Journaling-Hash","value":{"rev":"3-ac676eecb40a4dff301c671fa4bb6be9"}}, -{"id":"Kahana","key":"Kahana","value":{"rev":"33-1cb7e291ae02cee4e8105509571223f5"}}, -{"id":"LazyBoy","key":"LazyBoy","value":{"rev":"13-20a8894e3a957f184f5ae2a3e709551c"}}, -{"id":"Lingo","key":"Lingo","value":{"rev":"9-1af9a6df616e601f09c8cec07ccad1ae"}}, -{"id":"Loggy","key":"Loggy","value":{"rev":"33-e115c25163ab468314eedbe497d1c51e"}}, -{"id":"MeCab","key":"MeCab","value":{"rev":"4-2687176c7b878930e812a534976a6988"}}, -{"id":"Mercury","key":"Mercury","value":{"rev":"3-09a6bff1332ed829bd2c37bfec244a41"}}, -{"id":"Mu","key":"Mu","value":{"rev":"7-28e6ab82c402c3a75fe0f79dea846b97"}}, -{"id":"N","key":"N","value":{"rev":"7-e265046b5bdd299b2cad1584083ce2d5"}}, -{"id":"NORRIS","key":"NORRIS","value":{"rev":"3-4b5b23b09118582c44414f8d480619e6"}}, -{"id":"NetOS","key":"NetOS","value":{"rev":"3-3f943f87a24c11e6dd8c265469914e80"}}, -{"id":"NewBase60","key":"NewBase60","value":{"rev":"3-fd84758db79870e82917d358c6673f32"}}, -{"id":"NoCR","key":"NoCR","value":{"rev":"3-8f6cddd528f2d6045e3dda6006fb6948"}}, -{"id":"NodObjC","key":"NodObjC","value":{"rev":"15-ea6ab2df532c90fcefe5a428950bfdbb"}}, -{"id":"Node-JavaScript-Preprocessor","key":"Node-JavaScript-Preprocessor","value":{"rev":"13-4662b5ad742caaa467ec5d6c8e77b1e5"}}, -{"id":"NodeInterval","key":"NodeInterval","value":{"rev":"3-dc3446db2e0cd5be29a3c07942dba66d"}}, -{"id":"NodeSSH","key":"NodeSSH","value":{"rev":"3-45530fae5a69c44a6dd92357910f4212"}}, -{"id":"Nonsense","key":"Nonsense","value":{"rev":"3-9d86191475bc76dc3dd496d4dfe5d94e"}}, -{"id":"NormAndVal","key":"NormAndVal","value":{"rev":"9-d3b3d6ffd046292f4733aa5f3eb7be61"}}, -{"id":"Olive","key":"Olive","value":{"rev":"5-67f3057f09cae5104f09472db1d215aa"}}, -{"id":"OnCollect","key":"OnCollect","value":{"rev":"16-6dbe3afd04f123dda87bb1e21cdfd776"}}, -{"id":"PJsonCouch","key":"PJsonCouch","value":{"rev":"3-be9588f49d85094c36288eb63f8236b3"}}, -{"id":"PMInject","key":"PMInject","value":{"rev":"5-da518047d8273dbf3b3c05ea25e77836"}}, -{"id":"PanPG","key":"PanPG","value":{"rev":"13-beb54225a6b1be4c157434c28adca016"}}, -{"id":"PerfDriver","key":"PerfDriver","value":{"rev":"2-b448fb2f407f341b8df7032f29e4920f"}}, -{"id":"PostgresClient","key":"PostgresClient","value":{"rev":"8-2baec6847f8ad7dcf24b7d61a4034163"}}, -{"id":"QuickWeb","key":"QuickWeb","value":{"rev":"13-d388df9c484021ecd75bc9650d659a67"}}, -{"id":"R.js","key":"R.js","value":{"rev":"3-3f154b95ec6fc744f95a29750f16667e"}}, -{"id":"R2","key":"R2","value":{"rev":"11-f5ccff6f108f6b928caafb62b80d1056"}}, -{"id":"Reston","key":"Reston","value":{"rev":"5-9d234010f32f593edafc04620f3cf2bd"}}, -{"id":"Sardines","key":"Sardines","value":{"rev":"5-d7d3d2269420e21c2c62b86ff5a0021e"}}, -{"id":"SessionWebSocket","key":"SessionWebSocket","value":{"rev":"8-d9fc9beaf90057aefeb701addd7fc845"}}, -{"id":"Sheet","key":"Sheet","value":{"rev":"8-c827c713564e4ae5a17988ffea520d0d"}}, -{"id":"Spec_My_Node","key":"Spec_My_Node","value":{"rev":"8-fa58408e9d9736d9c6fa8daf5d632106"}}, -{"id":"Spot","key":"Spot","value":{"rev":"3-6b6c2131451fed28fb57c924c4fa44cc"}}, -{"id":"Sslac","key":"Sslac","value":{"rev":"3-70a2215cc7505729254aa6fa1d9a25d9"}}, -{"id":"StaticServer","key":"StaticServer","value":{"rev":"3-6f5433177ef4d76a52f01c093117a532"}}, -{"id":"StringScanner","key":"StringScanner","value":{"rev":"3-e85d0646c25ec477c1c45538712d3a38"}}, -{"id":"Structr","key":"Structr","value":{"rev":"3-449720001801cff5831c2cc0e0f1fcf8"}}, -{"id":"Templ8","key":"Templ8","value":{"rev":"11-4e6edb250bc250df20b2d557ca7f6589"}}, -{"id":"Template","key":"Template","value":{"rev":"6-1f055c73524d2b7e82eb6c225bd4b8e0"}}, -{"id":"Thimble","key":"Thimble","value":{"rev":"3-8499b261206f2f2e9acf92d8a4e54afb"}}, -{"id":"Toji","key":"Toji","value":{"rev":"96-511e171ad9f32a9264c2cdf01accacfb"}}, -{"id":"TwigJS","key":"TwigJS","value":{"rev":"3-1aaefc6d6895d7d4824174d410a747b9"}}, -{"id":"UkGeoTool","key":"UkGeoTool","value":{"rev":"5-e84291128e12f66cebb972a60c1d710f"}}, -{"id":"Vector","key":"Vector","value":{"rev":"3-bf5dc97abe7cf1057260b70638175a96"}}, -{"id":"_design/app","key":"_design/app","value":{"rev":"421-b1661d854599a58d0904d68aa44d8b63"}}, -{"id":"_design/ui","key":"_design/ui","value":{"rev":"78-db00aeb91a59a326e38e2bef7f1126cf"}}, -{"id":"aaronblohowiak-plugify-js","key":"aaronblohowiak-plugify-js","value":{"rev":"3-0272c269eacd0c86bfc1711566922577"}}, -{"id":"aaronblohowiak-uglify-js","key":"aaronblohowiak-uglify-js","value":{"rev":"3-77844a6def6ec428d75caa0846c95502"}}, -{"id":"aasm-js","key":"aasm-js","value":{"rev":"3-01a48108d55909575440d9e0ef114f37"}}, -{"id":"abbrev","key":"abbrev","value":{"rev":"16-e17a2b6c7360955b950edf2cb2ef1602"}}, -{"id":"abhispeak","key":"abhispeak","value":{"rev":"5-9889431f68ec10212db3be91796608e2"}}, -{"id":"ace","key":"ace","value":{"rev":"3-e8d267de6c17ebaa82c2869aff983c74"}}, -{"id":"acl","key":"acl","value":{"rev":"13-87c131a1801dc50840a177be73ce1c37"}}, -{"id":"active-client","key":"active-client","value":{"rev":"5-0ca16ae2e48a3ba9de2f6830a8c2d3a0"}}, -{"id":"activenode-monitor","key":"activenode-monitor","value":{"rev":"9-2634fa446379c39475d0ce4183fb92f2"}}, -{"id":"activeobject","key":"activeobject","value":{"rev":"43-6d73e28412612aaee37771e3ab292c3d"}}, -{"id":"actor","key":"actor","value":{"rev":"3-f6b84acd7d2e689b860e3142a18cd460"}}, -{"id":"actors","key":"actors","value":{"rev":"3-6df913bbe5b99968a2e71ae4ef07b2d2"}}, -{"id":"addTimeout","key":"addTimeout","value":{"rev":"15-e5170f0597fe8cf5ed0b54b7e6f2cde1"}}, -{"id":"addressable","key":"addressable","value":{"rev":"27-0c74fde458d92e4b93a29317da15bb3c"}}, -{"id":"aejs","key":"aejs","value":{"rev":"7-4928e2ce6151067cd6c585c0ba3e0bc3"}}, -{"id":"aenoa-supervisor","key":"aenoa-supervisor","value":{"rev":"7-6d399675981e76cfdfb9144bc2f7fb6d"}}, -{"id":"after","key":"after","value":{"rev":"9-baee7683ff54182cf7544cc05b0a4ad7"}}, -{"id":"ahr","key":"ahr","value":{"rev":"27-4ed272c516f3f2f9310e4f0ef28254e9"}}, -{"id":"ahr.browser","key":"ahr.browser","value":{"rev":"3-f7226aab4a1a3ab5f77379f92aae87f9"}}, -{"id":"ahr.browser.jsonp","key":"ahr.browser.jsonp","value":{"rev":"3-abed17143cf5e3c451c3d7da457e6f5b"}}, -{"id":"ahr.browser.request","key":"ahr.browser.request","value":{"rev":"7-fafd7b079d0415f388b64a20509a270b"}}, -{"id":"ahr.node","key":"ahr.node","value":{"rev":"17-f487a4a9896bd3876a11f9dfa1c639a7"}}, -{"id":"ahr.options","key":"ahr.options","value":{"rev":"13-904a4cea763a4455f7b2ae0abba18b8d"}}, -{"id":"ahr.utils","key":"ahr.utils","value":{"rev":"3-5f7b4104ea280d1fd36370c8f3356ead"}}, -{"id":"ahr2","key":"ahr2","value":{"rev":"87-ddf57f3ee158dcd23b2df330e2883a1d"}}, -{"id":"ain","key":"ain","value":{"rev":"7-d840736668fb36e9be3c26a68c5cd411"}}, -{"id":"ain-tcp","key":"ain-tcp","value":{"rev":"11-d18a1780bced8981d1d9dbd262ac4045"}}, -{"id":"ain2","key":"ain2","value":{"rev":"5-0b67879174f5f0a06448c7c737d98b5e"}}, -{"id":"airbrake","key":"airbrake","value":{"rev":"33-4bb9f822162e0c930c31b7f961938dc9"}}, -{"id":"ajaxrunner","key":"ajaxrunner","value":{"rev":"2-17e6a5de4f0339f4e6ce0b7681d0ba0c"}}, -{"id":"ajs","key":"ajs","value":{"rev":"13-063a29dec829fdaf4ca63d622137d1c6"}}, -{"id":"ajs-xgettext","key":"ajs-xgettext","value":{"rev":"3-cd4bbcc1c9d87fa7119d3bbbca99b793"}}, -{"id":"akismet","key":"akismet","value":{"rev":"13-a144e15dd6c2b13177572e80a526edd1"}}, -{"id":"alfred","key":"alfred","value":{"rev":"45-9a69041b18d2587c016b1b1deccdb2ce"}}, -{"id":"alfred-bcrypt","key":"alfred-bcrypt","value":{"rev":"11-7ed10ef318e5515d1ef7c040818ddb22"}}, -{"id":"algorithm","key":"algorithm","value":{"rev":"3-9ec0b38298cc15b0f295152de8763358"}}, -{"id":"algorithm-js","key":"algorithm-js","value":{"rev":"9-dd7496b7ec2e3b23cc7bb182ae3aac6d"}}, -{"id":"alists","key":"alists","value":{"rev":"5-22cc13c86d84081a826ac79a0ae5cda3"}}, -{"id":"altshift","key":"altshift","value":{"rev":"53-1c51d8657f271f390503a6fe988d09db"}}, -{"id":"amazon-ses","key":"amazon-ses","value":{"rev":"5-c175d60de2232a5664666a80832269e5"}}, -{"id":"ambrosia","key":"ambrosia","value":{"rev":"3-8c648ec7393cf842838c20e2c5d9bce4"}}, -{"id":"amd","key":"amd","value":{"rev":"3-d78c4df97a577af598a7def2a38379fa"}}, -{"id":"amionline","key":"amionline","value":{"rev":"3-a62887a632523700402b0f4ebb896812"}}, -{"id":"amo-version-reduce","key":"amo-version-reduce","value":{"rev":"3-05f6956269e5e921ca3486d3d6ea74b0"}}, -{"id":"amqp","key":"amqp","value":{"rev":"17-ee62d2b8248f8eb13f3369422d66df26"}}, -{"id":"amqpsnoop","key":"amqpsnoop","value":{"rev":"3-36a1c45647bcfb2f56cf68dbc24b0426"}}, -{"id":"ams","key":"ams","value":{"rev":"40-1c0cc53ad942d2fd23c89618263befc8"}}, -{"id":"amulet","key":"amulet","value":{"rev":"7-d1ed71811e45652799982e4f2e9ffb36"}}, -{"id":"anachronism","key":"anachronism","value":{"rev":"11-468bdb40f9a5aa146bae3c1c6253d0e1"}}, -{"id":"analytics","key":"analytics","value":{"rev":"3-a143ccdd863b5f7dbee4d2f7732390b3"}}, -{"id":"ann","key":"ann","value":{"rev":"9-41f00594d6216c439f05f7116a697cac"}}, -{"id":"ansi-color","key":"ansi-color","value":{"rev":"6-d6f02b32525c1909d5134afa20f470de"}}, -{"id":"ansi-font","key":"ansi-font","value":{"rev":"3-b039661ad9b6aa7baf34741b449c4420"}}, -{"id":"ant","key":"ant","value":{"rev":"3-35a64e0b7f6eb63a90c32971694b0d93"}}, -{"id":"anvil.js","key":"anvil.js","value":{"rev":"19-290c82075f0a9ad764cdf6dc5c558e0f"}}, -{"id":"aop","key":"aop","value":{"rev":"7-5963506c9e7912aa56fda065c56fd472"}}, -{"id":"ap","key":"ap","value":{"rev":"3-f525b5b490a1ada4452f46307bf92d08"}}, -{"id":"apac","key":"apac","value":{"rev":"12-945d0313a84797b4c3df19da4bec14d4"}}, -{"id":"aparser","key":"aparser","value":{"rev":"5-cb35cfc9184ace6642413dad97e49dca"}}, -{"id":"api-easy","key":"api-easy","value":{"rev":"15-2ab5eefef1377ff217cb020e80343d65"}}, -{"id":"api.js","key":"api.js","value":{"rev":"5-a14b8112fbda17022c80356a010de59a"}}, -{"id":"api_request","key":"api_request","value":{"rev":"3-8531e71f5cf2f3f811684269132d72d4"}}, -{"id":"apimaker","key":"apimaker","value":{"rev":"3-bdbd4a2ebf5b67276d89ea73eaa20025"}}, -{"id":"apn","key":"apn","value":{"rev":"30-0513d27341f587b39db54300c380921f"}}, -{"id":"app","key":"app","value":{"rev":"3-d349ddb47167f60c03d259649569e002"}}, -{"id":"app.js","key":"app.js","value":{"rev":"3-bff3646634daccfd964b4bbe510acb25"}}, -{"id":"append","key":"append","value":{"rev":"7-53e2f4ab2a69dc0c5e92f10a154998b6"}}, -{"id":"applescript","key":"applescript","value":{"rev":"10-ef5ab30ccd660dc71fb89e173f30994a"}}, -{"id":"appzone","key":"appzone","value":{"rev":"21-fb27e24d460677fe9c7eda0d9fb1fead"}}, -{"id":"apricot","key":"apricot","value":{"rev":"14-b55361574a0715f78afc76ddf6125845"}}, -{"id":"arcane","key":"arcane","value":{"rev":"3-f846c96e890ed6150d4271c93cc05a24"}}, -{"id":"archetype","key":"archetype","value":{"rev":"3-441336def3b7aade89c8c1c19a84f56d"}}, -{"id":"ardrone","key":"ardrone","value":{"rev":"8-540e95b796da734366a89bb06dc430c5"}}, -{"id":"ardrone-web","key":"ardrone-web","value":{"rev":"3-8a53cc85a95be20cd44921347e82bbe4"}}, -{"id":"arduino","key":"arduino","value":{"rev":"3-22f6359c47412d086d50dc7f1a994139"}}, -{"id":"argon","key":"argon","value":{"rev":"3-ba12426ce67fac01273310cb3909b855"}}, -{"id":"argparse","key":"argparse","value":{"rev":"8-5e841e38cca6cfc3fe1d1f507a7f47ee"}}, -{"id":"argparser","key":"argparser","value":{"rev":"19-b8793bfc005dd84e1213ee53ae56206d"}}, -{"id":"argsparser","key":"argsparser","value":{"rev":"26-d31eca2f41546172763af629fc50631f"}}, -{"id":"argtype","key":"argtype","value":{"rev":"10-96a7d23e571d56cf598472115bcac571"}}, -{"id":"arguments","key":"arguments","value":{"rev":"7-767de2797f41702690bef5928ec7c6e9"}}, -{"id":"armory","key":"armory","value":{"rev":"41-ea0f7bd0868c11fc9986fa708e11e071"}}, -{"id":"armrest","key":"armrest","value":{"rev":"3-bbe40b6320b6328211be33425bed20c8"}}, -{"id":"arnold","key":"arnold","value":{"rev":"3-4896fc8d02b8623f47a024f0dbfa44bf"}}, -{"id":"arouter","key":"arouter","value":{"rev":"7-55cab1f7128df54f27be94039a8d8dc5"}}, -{"id":"array-promise","key":"array-promise","value":{"rev":"3-e2184561ee65de64c2dfeb57955c758f"}}, -{"id":"arrayemitter","key":"arrayemitter","value":{"rev":"3-d64c917ac1095bfcbf173dac88d3d148"}}, -{"id":"asEvented","key":"asEvented","value":{"rev":"3-2ad3693b49d4d9dc9a11c669033a356e"}}, -{"id":"asciimo","key":"asciimo","value":{"rev":"12-50130f5ac2ef4d95df190be2c8ede893"}}, -{"id":"asereje","key":"asereje","value":{"rev":"15-84853499f89a87109ddf47ba692323ba"}}, -{"id":"ash","key":"ash","value":{"rev":"6-3697a3aee708bece8a08c7e0d1010476"}}, -{"id":"ask","key":"ask","value":{"rev":"3-321bbc3837d749b5d97bff251693a825"}}, -{"id":"asn1","key":"asn1","value":{"rev":"13-e681a814a4a1439a22b19e141b45006f"}}, -{"id":"aspsms","key":"aspsms","value":{"rev":"9-7b82d722bdac29a4da8c88b642ad64f2"}}, -{"id":"assert","key":"assert","value":{"rev":"3-85480762f5cb0be2cb85f80918257189"}}, -{"id":"assertions","key":"assertions","value":{"rev":"9-d797d4c09aa994556c7d5fdb4e86fe1b"}}, -{"id":"assertn","key":"assertn","value":{"rev":"6-080a4fb5d2700a6850d56b58c6f6ee9e"}}, -{"id":"assertvanish","key":"assertvanish","value":{"rev":"13-3b0b555ff77c1bfc2fe2642d50879648"}}, -{"id":"asset","key":"asset","value":{"rev":"33-cb70b68e0e05e9c9a18b3d89f1bb43fc"}}, -{"id":"assetgraph","key":"assetgraph","value":{"rev":"82-7853d644e64741b46fdd29a997ec4852"}}, -{"id":"assetgraph-builder","key":"assetgraph-builder","value":{"rev":"61-1ed98d95f3589050037851edde760a01"}}, -{"id":"assetgraph-sprite","key":"assetgraph-sprite","value":{"rev":"15-351b5fd9e50a3dda8580d014383423e0"}}, -{"id":"assets-expander","key":"assets-expander","value":{"rev":"11-f9e1197b773d0031dd015f1d871b87c6"}}, -{"id":"assets-packager","key":"assets-packager","value":{"rev":"13-51f7d2d57ed35be6aff2cc2aa2fa74db"}}, -{"id":"assoc","key":"assoc","value":{"rev":"9-07098388f501da16bf6afe6c9babefd5"}}, -{"id":"ast-inlining","key":"ast-inlining","value":{"rev":"5-02e7e2c3a06ed81ddc61980f778ac413"}}, -{"id":"ast-transformer","key":"ast-transformer","value":{"rev":"5-b4020bb763b8839afa8d3ac0d54a6f26"}}, -{"id":"astar","key":"astar","value":{"rev":"3-3df8c56c64c3863ef0650c0c74e2801b"}}, -{"id":"aster","key":"aster","value":{"rev":"7-b187c1270d3924f5ee04044e579d2df9"}}, -{"id":"asterisk-manager","key":"asterisk-manager","value":{"rev":"3-7fbf4294dafee04cc17cca4692c09c33"}}, -{"id":"astrolin","key":"astrolin","value":{"rev":"3-30ac515a2388e7dc22b25c15346f6d7e"}}, -{"id":"asyn","key":"asyn","value":{"rev":"3-51996b0197c21e85858559045c1481b7"}}, -{"id":"async","key":"async","value":{"rev":"26-73aea795f46345a7e65d89ec75dff2f1"}}, -{"id":"async-array","key":"async-array","value":{"rev":"17-3ef5faff03333aa5b2a733ef36118066"}}, -{"id":"async-chain","key":"async-chain","value":{"rev":"9-10ec3e50b01567390d55973494e36d43"}}, -{"id":"async-ejs","key":"async-ejs","value":{"rev":"19-6f0e6e0eeb3cdb4c816ea427d8288d7d"}}, -{"id":"async-fs","key":"async-fs","value":{"rev":"3-b96906283d345604f784dfcdbeb21a63"}}, -{"id":"async-it","key":"async-it","value":{"rev":"7-6aed4439df25989cfa040fa4b5dd4ff2"}}, -{"id":"async-json","key":"async-json","value":{"rev":"5-589d5b6665d00c5bffb99bb142cac5d0"}}, -{"id":"async-memoizer","key":"async-memoizer","value":{"rev":"9-01d56f4dff95e61a39dab5ebee49d5dc"}}, -{"id":"async-object","key":"async-object","value":{"rev":"21-1bf28b0f8a7d875b54126437f3539f9b"}}, -{"id":"asyncEJS","key":"asyncEJS","value":{"rev":"3-28b1c94255381f23a4d4f52366255937"}}, -{"id":"async_testing","key":"async_testing","value":{"rev":"14-0275d8b608d8644dfe8d68a81fa07e98"}}, -{"id":"asyncevents","key":"asyncevents","value":{"rev":"3-de104847994365dcab5042db2b46fb84"}}, -{"id":"asyncify","key":"asyncify","value":{"rev":"3-3f6deb82ee1c6cb25e83a48fe6379b75"}}, -{"id":"asyncjs","key":"asyncjs","value":{"rev":"27-15903d7351f80ed37cb069aedbfc26cc"}}, -{"id":"asynct","key":"asynct","value":{"rev":"5-6be002b3e005d2d53b80fff32ccbd2ac"}}, -{"id":"at_scheduler","key":"at_scheduler","value":{"rev":"3-5587061c90218d2e99b6e22d5b488b0b"}}, -{"id":"atbar","key":"atbar","value":{"rev":"19-e9e906d4874afd4d8bf2d8349ed46dff"}}, -{"id":"atob","key":"atob","value":{"rev":"3-bc907d10dd2cfc940de586dc090451da"}}, -{"id":"audiolib","key":"audiolib","value":{"rev":"17-cb2f55ff50061081b440f0605cf0450c"}}, -{"id":"audit_couchdb","key":"audit_couchdb","value":{"rev":"24-6e620895b454b345b2aed13db847c237"}}, -{"id":"auditor","key":"auditor","value":{"rev":"11-c4df509d40650c015943dd90315a12c0"}}, -{"id":"authnet_cim","key":"authnet_cim","value":{"rev":"7-f02bbd206ac2b8c05255bcd8171ac1eb"}}, -{"id":"autocomplete","key":"autocomplete","value":{"rev":"3-f2773bca040d5abcd0536dbebe5847bf"}}, -{"id":"autodafe","key":"autodafe","value":{"rev":"7-a75262b53a9dd1a25693adecde7206d7"}}, -{"id":"autolint","key":"autolint","value":{"rev":"7-07f885902d72b52678fcc57aa4b9c592"}}, -{"id":"autoload","key":"autoload","value":{"rev":"5-9247704d9a992a175e3ae49f4af757d0"}}, -{"id":"autoloader","key":"autoloader","value":{"rev":"11-293c20c34d0c81fac5c06b699576b1fe"}}, -{"id":"auton","key":"auton","value":{"rev":"25-4fcb7a62b607b7929b62a9b792afef55"}}, -{"id":"autoreleasepool","key":"autoreleasepool","value":{"rev":"5-5d2798bf74bbec583cc6f19127e3c89e"}}, -{"id":"autorequire","key":"autorequire","value":{"rev":"9-564a46b355532fcec24db0afc99daed5"}}, -{"id":"autotest","key":"autotest","value":{"rev":"7-e319995dd0e1fbd935c14c46b1234f77"}}, -{"id":"awesome","key":"awesome","value":{"rev":"15-4458b746e4722214bd26ea15e453288e"}}, -{"id":"aws","key":"aws","value":{"rev":"14-9a8f0989be29034d3fa5c66c594b649b"}}, -{"id":"aws-js","key":"aws-js","value":{"rev":"6-c61d87b8ad948cd065d2ca222808c209"}}, -{"id":"aws-lib","key":"aws-lib","value":{"rev":"36-9733e215c03d185a860574600a8feb14"}}, -{"id":"aws2js","key":"aws2js","value":{"rev":"35-42498f44a5ae7d4f3c84096b435d0e0b"}}, -{"id":"azure","key":"azure","value":{"rev":"5-2c4e05bd842d3dcfa419f4d2b67121e2"}}, -{"id":"b64","key":"b64","value":{"rev":"3-e5e727a46df4c8aad38acd117d717140"}}, -{"id":"b64url","key":"b64url","value":{"rev":"9-ab3b017f00a53b0078261254704c30ba"}}, -{"id":"ba","key":"ba","value":{"rev":"11-3cec7ec9a566fe95fbeb34271538d60a"}}, -{"id":"babelweb","key":"babelweb","value":{"rev":"11-8e6a2fe00822cec15573cdda48b6d0a0"}}, -{"id":"backbone","key":"backbone","value":{"rev":"37-79b95355f8af59bf9131e14d52b68edc"}}, -{"id":"backbone-browserify","key":"backbone-browserify","value":{"rev":"3-f25dac0b05a7f7aa5dbc0f4a1ad97969"}}, -{"id":"backbone-celtra","key":"backbone-celtra","value":{"rev":"3-775a5ebb25c1cd84723add52774ece84"}}, -{"id":"backbone-couch","key":"backbone-couch","value":{"rev":"8-548327b3cd7ee7a4144c9070377be5f6"}}, -{"id":"backbone-cradle","key":"backbone-cradle","value":{"rev":"3-b9bc220ec48b05eed1d4d77a746b10db"}}, -{"id":"backbone-dirty","key":"backbone-dirty","value":{"rev":"21-fa0f688cc95a85c0fc440733f09243b5"}}, -{"id":"backbone-dnode","key":"backbone-dnode","value":{"rev":"65-3212d3aa3284efb3bc0732bac71b5a2e"}}, -{"id":"backbone-proxy","key":"backbone-proxy","value":{"rev":"3-3602cb984bdd266516a3145663f9a5c6"}}, -{"id":"backbone-redis","key":"backbone-redis","value":{"rev":"9-2e3f6a9e095b00ccec9aa19b3fbc65eb"}}, -{"id":"backbone-rel","key":"backbone-rel","value":{"rev":"5-f9773dc85f1c502e61c163a22d2f74aa"}}, -{"id":"backbone-simpledb","key":"backbone-simpledb","value":{"rev":"5-a815128e1e3593696f666f8b3da36d78"}}, -{"id":"backbone-stash","key":"backbone-stash","value":{"rev":"19-8d3cc5f9ed28f9a56856154e2b4e7f78"}}, -{"id":"backplane","key":"backplane","value":{"rev":"7-f69188dac21e007b09efe1b5b3575087"}}, -{"id":"backport-0.4","key":"backport-0.4","value":{"rev":"11-25e15f01f1ef9e626433a82284bc00d6"}}, -{"id":"backuptweets","key":"backuptweets","value":{"rev":"3-68712682aada41082d3ae36c03c8f899"}}, -{"id":"bake","key":"bake","value":{"rev":"113-ce13508ba2b4f15aa4df06d796aa4573"}}, -{"id":"bal-util","key":"bal-util","value":{"rev":"31-b818725a5af131c89ec66b9fdebf2122"}}, -{"id":"balancer","key":"balancer","value":{"rev":"7-63dcb4327081a8ec4d6c51a21253cb4b"}}, -{"id":"bancroft","key":"bancroft","value":{"rev":"11-8fa3370a4615a0ed4ba411b05c0285f4"}}, -{"id":"bandcamp","key":"bandcamp","value":{"rev":"41-f2fee472d63257fdba9e5fa8ad570ee8"}}, -{"id":"banner","key":"banner","value":{"rev":"19-89a447e2136b2fabddbad84abcd63a27"}}, -{"id":"banzai-docstore-couchdb","key":"banzai-docstore-couchdb","value":{"rev":"5-950c115737d634e2f48ee1c772788321"}}, -{"id":"banzai-redis","key":"banzai-redis","value":{"rev":"3-446f29e0819fd79c810fdfa8ce05bdcf"}}, -{"id":"banzai-statestore-couchdb","key":"banzai-statestore-couchdb","value":{"rev":"5-c965442821741ce6f20e266fe43aea4a"}}, -{"id":"banzai-statestore-mem","key":"banzai-statestore-mem","value":{"rev":"3-a0891a1a2344922d91781c332ed26528"}}, -{"id":"bar","key":"bar","value":{"rev":"7-fbb44a76cb023e6a8941f15576cf190b"}}, -{"id":"barc","key":"barc","value":{"rev":"7-dfe352b410782543d6b1aea292f123eb"}}, -{"id":"barista","key":"barista","value":{"rev":"9-d3f3c776453ba69a81947f34d7cc3cbf"}}, -{"id":"bark","key":"bark","value":{"rev":"20-fc1a94f80cfa199c16aa075e940e06dc"}}, -{"id":"barricane-db","key":"barricane-db","value":{"rev":"3-450947b9a05047fe195f76a69a3144e8"}}, -{"id":"base-converter","key":"base-converter","value":{"rev":"7-1b49b01df111176b89343ad56ac68d5c"}}, -{"id":"base32","key":"base32","value":{"rev":"11-d686c54c9de557681356e74b83d916e8"}}, -{"id":"base64","key":"base64","value":{"rev":"24-bd713c3d7e96fad180263ed7563c595e"}}, -{"id":"bash","key":"bash","value":{"rev":"3-86a1c61babfa47da0ebc14c2f4e59a6a"}}, -{"id":"basic-auth","key":"basic-auth","value":{"rev":"3-472a87af27264ae81bd4394d70792e55"}}, -{"id":"basicFFmpeg","key":"basicFFmpeg","value":{"rev":"15-3e87a41c543bde1e6f7c49d021fda62f"}}, -{"id":"basicauth","key":"basicauth","value":{"rev":"3-15d95a05b6f5e7b6d7261f87c4eb73de"}}, -{"id":"basil-cookie","key":"basil-cookie","value":{"rev":"11-fff96b263f31b9d017e3cf59bf6fb23f"}}, -{"id":"batik","key":"batik","value":{"rev":"7-a19ce28cbbf54649fa225ed5474eff02"}}, -{"id":"batman","key":"batman","value":{"rev":"15-6af5469bf143790cbb4af196824c9e95"}}, -{"id":"batteries","key":"batteries","value":{"rev":"13-656c68fe887f4af3ef1e720e64275f4e"}}, -{"id":"bbcode","key":"bbcode","value":{"rev":"5-e79a8b62125f8a3a1751bf7bd8875f33"}}, -{"id":"bcrypt","key":"bcrypt","value":{"rev":"31-db8496d1239362a97a26f1e5eeb8a733"}}, -{"id":"beaconpush","key":"beaconpush","value":{"rev":"3-956fcd87a6d3f9d5b9775d47e36aa3e5"}}, -{"id":"bean","key":"bean","value":{"rev":"56-151c1558e15016205e65bd515eab9ee0"}}, -{"id":"bean.database.mongo","key":"bean.database.mongo","value":{"rev":"3-ede73166710137cbf570385b7e8f17fe"}}, -{"id":"beandocs","key":"beandocs","value":{"rev":"3-9f7492984c95b69ca1ad30d40223f117"}}, -{"id":"beanpole","key":"beanpole","value":{"rev":"53-565a78a2304405cdc9f4a6b6101160fa"}}, -{"id":"beanprep","key":"beanprep","value":{"rev":"3-bd387f0072514b8e44131671f9aad1b0"}}, -{"id":"beans","key":"beans","value":{"rev":"54-7f6d40a2a5bf228fe3547cce43edaa63"}}, -{"id":"beanstalk_client","key":"beanstalk_client","value":{"rev":"6-13c8c80aa6469b5dcf20d65909289383"}}, -{"id":"beanstalk_worker","key":"beanstalk_worker","value":{"rev":"6-45500991db97ed5a18ea96f3621bf99f"}}, -{"id":"beantest","key":"beantest","value":{"rev":"7-52d8160a0c0420c7d659b2ee10f26644"}}, -{"id":"beatit","key":"beatit","value":{"rev":"7-c0ba5f95b0601dcb628e4820555cc252"}}, -{"id":"beatport","key":"beatport","value":{"rev":"5-3b186b633ceea7f047e1df91e7b683a5"}}, -{"id":"beautifyjs","key":"beautifyjs","value":{"rev":"3-89ce050152aca0727c099060229ddc73"}}, -{"id":"beaver","key":"beaver","value":{"rev":"17-3b56116e8e40205e8efcedefee0319e3"}}, -{"id":"beeline","key":"beeline","value":{"rev":"11-92a4bd9524cc7aec3106efcacff6faed"}}, -{"id":"beet","key":"beet","value":{"rev":"95-3c9d9de63c363319b2201ac83bc0ee7d"}}, -{"id":"begin","key":"begin","value":{"rev":"3-b32a5eb1b9475353b37f90813ed89dce"}}, -{"id":"begin.js","key":"begin.js","value":{"rev":"7-9156869392a448595bf3e5723fcb7b57"}}, -{"id":"bejesus-api","key":"bejesus-api","value":{"rev":"11-6b42f8ffc370c494d01481b64536e91e"}}, -{"id":"bejesus-cli","key":"bejesus-cli","value":{"rev":"31-5fbbfe5ec1f6a0a7a3fafdf69230434a"}}, -{"id":"bem","key":"bem","value":{"rev":"22-c0e0f8d9e92b355246fd15058199b73c"}}, -{"id":"ben","key":"ben","value":{"rev":"3-debe52552a86f1e71895dd5d32add585"}}, -{"id":"bench","key":"bench","value":{"rev":"14-20987e1becf3acd1bd1833b04712c87c"}}, -{"id":"bencher","key":"bencher","value":{"rev":"3-08866a8fdcf180582b43690bbbf21087"}}, -{"id":"benchmark","key":"benchmark","value":{"rev":"219-0669bc24f3f2918d93369bb0d801abf3"}}, -{"id":"bencode","key":"bencode","value":{"rev":"8-7b9eff4c1658fb3a054ebc6f50e6edcd"}}, -{"id":"beseda","key":"beseda","value":{"rev":"49-5cc8c4e9bb3e836de7db58c3adf9a5bb"}}, -{"id":"bf","key":"bf","value":{"rev":"14-d81312e1bf4f7202b801b4343199aa55"}}, -{"id":"biggie-router","key":"biggie-router","value":{"rev":"42-56a546a78d5abd4402183b3d300d563e"}}, -{"id":"bigint","key":"bigint","value":{"rev":"58-02f368567849596219d6a0e87d9bc6b9"}}, -{"id":"bignumber","key":"bignumber","value":{"rev":"3-6e372428992a767e0a991ec3f39b8343"}}, -{"id":"binary","key":"binary","value":{"rev":"47-947aa2f5238a68e34b164ef7e50ece28"}}, -{"id":"binarySearch","key":"binarySearch","value":{"rev":"15-93a3d2f9c2690457023b5ae5f3d00446"}}, -{"id":"bind","key":"bind","value":{"rev":"9-b74d0af83e90a2655e564ab64bf1d27d"}}, -{"id":"binpack","key":"binpack","value":{"rev":"7-3dc67a64e0ef01f3aa59441c5150e04f"}}, -{"id":"bintrees","key":"bintrees","value":{"rev":"12-507fcd92f447f81842cba08cacb425cf"}}, -{"id":"bisection","key":"bisection","value":{"rev":"5-f785ea3bbd8fcc7cd9381d20417b87bb"}}, -{"id":"bison","key":"bison","value":{"rev":"12-e663b2ef96650b3b5a0cc36524e1b94a"}}, -{"id":"bitcoder","key":"bitcoder","value":{"rev":"8-19c957d6b845f4d7ad531951c971e03d"}}, -{"id":"bitcoin","key":"bitcoin","value":{"rev":"13-af88a28c02ab146622743c4c1c32e87b"}}, -{"id":"bitcoin-impl","key":"bitcoin-impl","value":{"rev":"8-99068f1d259e3c75209a6bd08e3e06a2"}}, -{"id":"bitcoin-p2p","key":"bitcoin-p2p","value":{"rev":"25-6df0283eb6e419bc3a1571f17721b100"}}, -{"id":"bitcoinjs-mongoose","key":"bitcoinjs-mongoose","value":{"rev":"3-57e239b31e218693f8cf3cf1cf098437"}}, -{"id":"bitly","key":"bitly","value":{"rev":"8-d6bfac8338e223fe62538954d2e9246a"}}, -{"id":"bitly.node","key":"bitly.node","value":{"rev":"3-15329b7a77633e0dae2c720e592420fb"}}, -{"id":"biwascheme","key":"biwascheme","value":{"rev":"3-37a85eed1bd2d4ee85ef1e100e7ebe8f"}}, -{"id":"black","key":"black","value":{"rev":"3-e07ae2273357da5894f4b7cdf1b20560"}}, -{"id":"black_coffee","key":"black_coffee","value":{"rev":"3-c5c764cf550ad3c831a085509f64cdfb"}}, -{"id":"bleach","key":"bleach","value":{"rev":"5-ef3ab7e761a6903eb70da1550a07e53d"}}, -{"id":"blend","key":"blend","value":{"rev":"16-c5dd075b3ede45f91056b4b768b2bfe8"}}, -{"id":"bless","key":"bless","value":{"rev":"29-1b9bc6f17acd144f51a297e4bdccfe0e"}}, -{"id":"blitz","key":"blitz","value":{"rev":"5-8bf6786f6fd7dbc0570ba21f803f35e6"}}, -{"id":"blo","key":"blo","value":{"rev":"5-9e752ea37438ea026e88a7aa7e7a91ba"}}, -{"id":"blog","key":"blog","value":{"rev":"13-80fc7b11d73e23ca7e518d271d1836ee"}}, -{"id":"blogmate","key":"blogmate","value":{"rev":"11-e503081be9290647c841aa8c04eb6e70"}}, -{"id":"bloodmoney","key":"bloodmoney","value":{"rev":"3-859b0235de3a29bf241323a31f9aa730"}}, -{"id":"bloom","key":"bloom","value":{"rev":"15-c609882b29d61a771d7dbf17f43016ad"}}, -{"id":"blue","key":"blue","value":{"rev":"6-e84221f7286dffbfda6f8abc6306064c"}}, -{"id":"bluemold","key":"bluemold","value":{"rev":"11-f48528b642b5d38d7c02b03622117fa7"}}, -{"id":"bn-lang","key":"bn-lang","value":{"rev":"3-266f186334f69448a940081589e82b04"}}, -{"id":"bn-lang-util","key":"bn-lang-util","value":{"rev":"3-0bc44f1d7d3746120dd835bfb685e229"}}, -{"id":"bn-log","key":"bn-log","value":{"rev":"5-db81a8a978071efd24b45e350e8b8954"}}, -{"id":"bn-template","key":"bn-template","value":{"rev":"3-604e77465ab1dc7e17f3b325089651ec"}}, -{"id":"bn-time","key":"bn-time","value":{"rev":"3-9c33587e783a98e1ccea409cacd5bbfb"}}, -{"id":"bn-unit","key":"bn-unit","value":{"rev":"3-5f35e3fd446241f682231bedcf846c0a"}}, -{"id":"bncode","key":"bncode","value":{"rev":"7-915a1759135a9837954c0ead58bf8e5a"}}, -{"id":"bnf","key":"bnf","value":{"rev":"5-4fe80fcafcc7a263f28b8dc62093bd8d"}}, -{"id":"bob","key":"bob","value":{"rev":"9-9ceeb581263c04793a2231b3726ab22b"}}, -{"id":"bogart","key":"bogart","value":{"rev":"30-70aed6f0827d2bd09963afddcad7a34a"}}, -{"id":"boil","key":"boil","value":{"rev":"3-7ab0fc3b831c591fd15711c27a6f5de0"}}, -{"id":"bolt","key":"bolt","value":{"rev":"3-138dfbdea2ab53ca714ca51494d32610"}}, -{"id":"bones","key":"bones","value":{"rev":"70-c74f0845c167cd755250fc7b4b9b40c2"}}, -{"id":"bones-admin","key":"bones-admin","value":{"rev":"11-2cdfe738d66aacff8569712a279c041d"}}, -{"id":"bones-auth","key":"bones-auth","value":{"rev":"35-2224f95bf3521809ce805ff215d2856c"}}, -{"id":"bones-document","key":"bones-document","value":{"rev":"13-95971fed1f47005c282e0fa60498e31c"}}, -{"id":"bonsai","key":"bonsai","value":{"rev":"3-67eb8935492d4ae9182a7ec74c1f36a6"}}, -{"id":"bonzo","key":"bonzo","value":{"rev":"142-7c5680b0f841c2263f06e96eb5237825"}}, -{"id":"bookbu","key":"bookbu","value":{"rev":"3-d9a104bccc67eae8a5dc6f0f4c3ba5fc"}}, -{"id":"bootstrap","key":"bootstrap","value":{"rev":"17-7a62dbe5e3323beb47165f13265f1a96"}}, -{"id":"borschik","key":"borschik","value":{"rev":"7-2570b5d6555a031394a55ff054797cb9"}}, -{"id":"bots","key":"bots","value":{"rev":"9-df43539c13d2996d9e32dff848615e8a"}}, -{"id":"bounce","key":"bounce","value":{"rev":"8-a3e424b2be1379743e9628c726facaa8"}}, -{"id":"bowser","key":"bowser","value":{"rev":"11-23ecc98edf5fde63fda626bb03da597f"}}, -{"id":"box2d","key":"box2d","value":{"rev":"6-5c920e9829764cbf904b9a59474c1672"}}, -{"id":"box2dnode","key":"box2dnode","value":{"rev":"3-12ffe24dcc1478ea0008c60c4ef7118f"}}, -{"id":"boxcar","key":"boxcar","value":{"rev":"5-a9ba953c547585285559d0e05c16e29e"}}, -{"id":"boxer","key":"boxer","value":{"rev":"8-60c49ff8574d5a47616796ad991463ad"}}, -{"id":"bracket-matcher","key":"bracket-matcher","value":{"rev":"27-a01c946c69665629e212a0f702be1b38"}}, -{"id":"brain","key":"brain","value":{"rev":"24-3aba33914e0f823505c69ef01361681b"}}, -{"id":"brainfuck","key":"brainfuck","value":{"rev":"7-adf33477ffe8640c9fdd6a0f8b349953"}}, -{"id":"brains","key":"brains","value":{"rev":"3-d7e7a95ea742f9b42fefb594c67c726a"}}, -{"id":"braintree","key":"braintree","value":{"rev":"14-eabe1c3e4e7cfd1f521f4bfd337611f7"}}, -{"id":"brazilnut","key":"brazilnut","value":{"rev":"3-4163b5a5598a8905c1283db9d260e5cc"}}, -{"id":"brazln","key":"brazln","value":{"rev":"29-15895bb5b193552826c196efe084caf2"}}, -{"id":"bread","key":"bread","value":{"rev":"9-093c9dd71fffb9a5b1c9eb8ac3e2a9b0"}}, -{"id":"breakfast","key":"breakfast","value":{"rev":"3-231e3046ede5e35e272dfab4a379015d"}}, -{"id":"brequire","key":"brequire","value":{"rev":"18-58b386e08541b222238aa12a13119fd9"}}, -{"id":"bricks","key":"bricks","value":{"rev":"15-f72e6c858c5bceb00cc34a16d52a7b59"}}, -{"id":"bricks-analytics","key":"bricks-analytics","value":{"rev":"3-dc2b6d2157c5039a4c36ceda46761b37"}}, -{"id":"bricks-compress","key":"bricks-compress","value":{"rev":"5-580eeecaa30c210502f42c5e184344a3"}}, -{"id":"bricks-rewrite","key":"bricks-rewrite","value":{"rev":"5-7a141aacaa3fd706b97847c6e8f9830a"}}, -{"id":"brokenbin","key":"brokenbin","value":{"rev":"5-bbc7a1c9628ed9f49b6d23e80c242852"}}, -{"id":"broker","key":"broker","value":{"rev":"9-756a097b948756e4bd7609b6f83a0847"}}, -{"id":"browscap","key":"browscap","value":{"rev":"12-c6fed16796d1ad84913f2617c66f0c7b"}}, -{"id":"browser-require","key":"browser-require","value":{"rev":"27-99f61fb3036ebc643282625649cc674f"}}, -{"id":"browserify","key":"browserify","value":{"rev":"163-c307ee153caf2160e5c32abd58898139"}}, -{"id":"browserjet","key":"browserjet","value":{"rev":"3-a386ab8911c410362eb8fceab5a998fe"}}, -{"id":"brt","key":"brt","value":{"rev":"3-b8452659a92039571ff1f877c8f874c7"}}, -{"id":"brunch","key":"brunch","value":{"rev":"113-64ae44857425c5d860d36f38ab3cf797"}}, -{"id":"brushes.js","key":"brushes.js","value":{"rev":"3-e28bd6597b949d84965a788928738f53"}}, -{"id":"bson","key":"bson","value":{"rev":"50-9d9db515dd9d2a4d873d186f324767a5"}}, -{"id":"btc-ex-api","key":"btc-ex-api","value":{"rev":"3-cabbf284cb01af79ee183d8023106762"}}, -{"id":"btoa","key":"btoa","value":{"rev":"3-b4a124b3650a746b8da9c9f93f386bac"}}, -{"id":"btoa-atob","key":"btoa-atob","value":{"rev":"3-baac60a3f04487333cc0364301220a53"}}, -{"id":"bucket","key":"bucket","value":{"rev":"3-5c2da8f67e29de1c29adbf51ad7d7299"}}, -{"id":"buffalo","key":"buffalo","value":{"rev":"9-6c763d939d775a255c65ba8dcf0d5372"}}, -{"id":"bufferjs","key":"bufferjs","value":{"rev":"13-b6e09e35ec822714d3ec485ac2010272"}}, -{"id":"bufferlib","key":"bufferlib","value":{"rev":"16-d48d96815fc7709d6b7d0a8bfc67f053"}}, -{"id":"bufferlist","key":"bufferlist","value":{"rev":"18-6fcedc10ffbca1afdc866e208d2f906a"}}, -{"id":"buffers","key":"buffers","value":{"rev":"11-3a70ec2da112befdc65b8c02772b8c44"}}, -{"id":"bufferstream","key":"bufferstream","value":{"rev":"82-6f82c5affb3906ebbaa0b116baf73c54"}}, -{"id":"buffertools","key":"buffertools","value":{"rev":"20-68f90e224f81fab81295f9079dc3c0fc"}}, -{"id":"buffoon","key":"buffoon","value":{"rev":"9-1cdc1cbced94691e836d4266eed7c143"}}, -{"id":"builder","key":"builder","value":{"rev":"25-b9679e2aaffec1ac6d59fdd259d9590c"}}, -{"id":"buildr","key":"buildr","value":{"rev":"69-cb3a756903a6322c6f9f4dd1c384a607"}}, -{"id":"bumper","key":"bumper","value":{"rev":"3-1e8d17aa3b29815e4069294cc9ce572c"}}, -{"id":"bundle","key":"bundle","value":{"rev":"39-46fde9cd841bce1fbdd92f6a1235c308"}}, -{"id":"bunker","key":"bunker","value":{"rev":"7-ed993a296fa0b8d3c3a7cd759d6f371e"}}, -{"id":"burari","key":"burari","value":{"rev":"11-08b61073d6ad0ef0c7449a574dc8f54b"}}, -{"id":"burrito","key":"burrito","value":{"rev":"38-3f3b109972720647f5412f3a2478859b"}}, -{"id":"busbuddy","key":"busbuddy","value":{"rev":"5-298ec29f6307351cf7a19bceebe957c7"}}, -{"id":"buster","key":"buster","value":{"rev":"9-870a6e9638806adde2f40105900cd4b3"}}, -{"id":"buster-args","key":"buster-args","value":{"rev":"7-9b189c602e437a505625dbf7fef5dead"}}, -{"id":"buster-assertions","key":"buster-assertions","value":{"rev":"5-fa34a8a5e7cf4dd08c2d02c39de3b563"}}, -{"id":"buster-cli","key":"buster-cli","value":{"rev":"5-b1a85006e41dbf74313253c571e63874"}}, -{"id":"buster-client","key":"buster-client","value":{"rev":"5-340637ec63b54bb01c1313a78db01945"}}, -{"id":"buster-configuration","key":"buster-configuration","value":{"rev":"3-a12e7ff172562b513534fc26be00aaed"}}, -{"id":"buster-core","key":"buster-core","value":{"rev":"5-871df160645e6684111a8fd02ff0eee9"}}, -{"id":"buster-evented-logger","key":"buster-evented-logger","value":{"rev":"5-c46681e6275a76723e3bc834555dbe32"}}, -{"id":"buster-format","key":"buster-format","value":{"rev":"5-e193e90436c7f941739b82adad86bdd8"}}, -{"id":"buster-module-loader","key":"buster-module-loader","value":{"rev":"5-4148b61f8b718e6181aa6054664a7c44"}}, -{"id":"buster-multicast","key":"buster-multicast","value":{"rev":"3-79480b5be761d243b274cb1e77375afc"}}, -{"id":"buster-promise","key":"buster-promise","value":{"rev":"5-b50030957fbd70e65576faa9c541b739"}}, -{"id":"buster-script-loader","key":"buster-script-loader","value":{"rev":"3-85af28b5bc4e647f27514fede19a144e"}}, -{"id":"buster-server","key":"buster-server","value":{"rev":"7-57b8b43047504818322018d2bbfee1f1"}}, -{"id":"buster-static","key":"buster-static","value":{"rev":"3-018c89d1524f7823934087f18dab9047"}}, -{"id":"buster-terminal","key":"buster-terminal","value":{"rev":"5-2c54c30ffa4a2d4b061e4c38e6b9b0e7"}}, -{"id":"buster-test","key":"buster-test","value":{"rev":"5-f7ee9c9f3b379e0ad5aa03d07581ad6f"}}, -{"id":"buster-test-cli","key":"buster-test-cli","value":{"rev":"9-c207974d20e95029cad5fa4c9435d152"}}, -{"id":"buster-user-agent-parser","key":"buster-user-agent-parser","value":{"rev":"5-7883085a203b3047b28ad08361219d1d"}}, -{"id":"buster-util","key":"buster-util","value":{"rev":"3-81977275a9c467ad79bb7e3f2b1caaa8"}}, -{"id":"butler","key":"butler","value":{"rev":"7-c964c4d213da6b0de2492ee57514d0f8"}}, -{"id":"byline","key":"byline","value":{"rev":"9-0b236ed5986c20136c0d581a244d52ac"}}, -{"id":"bz","key":"bz","value":{"rev":"7-d2a463b259c4e09dc9a79ddee9575ca0"}}, -{"id":"c2dm","key":"c2dm","value":{"rev":"11-a1e6a6643506bed3e1443155706aa5fe"}}, -{"id":"cabin","key":"cabin","value":{"rev":"7-df81ef56f0bb085d381c36600496dc57"}}, -{"id":"caboose","key":"caboose","value":{"rev":"49-7226441f91b63fb5c3ac240bd99d142a"}}, -{"id":"caboose-authentication","key":"caboose-authentication","value":{"rev":"3-9c71a9d7315fdea7d5f52fe52ecef118"}}, -{"id":"caboose-model","key":"caboose-model","value":{"rev":"3-967426d5acb8bb70e133f0052075dc1b"}}, -{"id":"cache2file","key":"cache2file","value":{"rev":"17-ac9caec611a38e1752d91f8cc80cfb04"}}, -{"id":"caching","key":"caching","value":{"rev":"11-06041aaaa46b63ed36843685cac63245"}}, -{"id":"calais","key":"calais","value":{"rev":"11-f8ac2064ca45dd5b7db7ea099cd61dfb"}}, -{"id":"calc","key":"calc","value":{"rev":"3-bead9c5b0bee34e44e7c04aa2bf9cd68"}}, -{"id":"calipso","key":"calipso","value":{"rev":"87-b562676045a66a3ec702591c67a9635e"}}, -{"id":"caman","key":"caman","value":{"rev":"15-4b97c73f0ac101c68335de2937483893"}}, -{"id":"camanjs","key":"camanjs","value":{"rev":"3-2856bbdf7a1d454929b4a80b119e3da0"}}, -{"id":"camelot","key":"camelot","value":{"rev":"7-8e257c5213861ecbd229ee737a3a8bb4"}}, -{"id":"campusbooks","key":"campusbooks","value":{"rev":"18-489be33c6ac2d6cbcf93355f2b129389"}}, -{"id":"canvas","key":"canvas","value":{"rev":"78-27dbf5b6e0a25ba5886d485fd897d701"}}, -{"id":"canvasutil","key":"canvasutil","value":{"rev":"7-0b87a370d673886efb7763aaf500b744"}}, -{"id":"capoo","key":"capoo","value":{"rev":"9-136a3ddf489228d5f4b504b1da619447"}}, -{"id":"capsule","key":"capsule","value":{"rev":"19-ad3c9ba0af71a84228e6dd360017f379"}}, -{"id":"capt","key":"capt","value":{"rev":"13-0805d789000fb2e361103a5e62379196"}}, -{"id":"carena","key":"carena","value":{"rev":"10-d38e8c336a0dbb8091514f638b22b96b"}}, -{"id":"carrier","key":"carrier","value":{"rev":"20-b2b4a0560d40eeac617000e9e22a9e9d"}}, -{"id":"cart","key":"cart","value":{"rev":"12-493e79c6fa0b099626e90da79a69f1e5"}}, -{"id":"carto","key":"carto","value":{"rev":"45-8eab07e2fac57396dd62af5805062387"}}, -{"id":"caruso","key":"caruso","value":{"rev":"5-d58e22212b0bcebbab4b42adc68799aa"}}, -{"id":"cas","key":"cas","value":{"rev":"3-82a93160eb9add99bde1599e55d18fd8"}}, -{"id":"cas-auth","key":"cas-auth","value":{"rev":"3-b02f77c198050b99f1df18f637e77c10"}}, -{"id":"cas-client","key":"cas-client","value":{"rev":"3-ca69e32a3053bc680d1dddc57271483b"}}, -{"id":"cashew","key":"cashew","value":{"rev":"7-9e81cde34263adad6949875c4b33ee99"}}, -{"id":"cassandra","key":"cassandra","value":{"rev":"3-8617ef73fdc73d02ecec74d31f98e463"}}, -{"id":"cassandra-client","key":"cassandra-client","value":{"rev":"19-aa1aef5d203be5b0eac678284f1a979f"}}, -{"id":"casset","key":"casset","value":{"rev":"3-2052c7feb5b89c77aaa279c8b50126ce"}}, -{"id":"castaneum","key":"castaneum","value":{"rev":"26-4dc55ba2482cca4230b4bc77ecb5b70d"}}, -{"id":"cat","key":"cat","value":{"rev":"3-75f20119b363b85c1a8433e26b86c943"}}, -{"id":"catchjs","key":"catchjs","value":{"rev":"3-ffda7eff7613de37f629dc7a831ffda1"}}, -{"id":"caterpillar","key":"caterpillar","value":{"rev":"5-bc003e3af33240e67b4c3042f308b7da"}}, -{"id":"causeeffect","key":"causeeffect","value":{"rev":"9-7e4e25bff656170c97cb0cce1b2ab6ca"}}, -{"id":"cayenne","key":"cayenne","value":{"rev":"5-2797f561467b41cc45804e5498917800"}}, -{"id":"ccn4bnode","key":"ccn4bnode","value":{"rev":"17-96f55189e5c98f0fa8200e403a04eb39"}}, -{"id":"ccnq3_config","key":"ccnq3_config","value":{"rev":"21-40345771769a9cadff4af9113b8124c2"}}, -{"id":"ccnq3_logger","key":"ccnq3_logger","value":{"rev":"5-4aa168dc24425938a29cf9ac456158d7"}}, -{"id":"ccnq3_portal","key":"ccnq3_portal","value":{"rev":"17-84e629ec1eaba1722327ccb9dddb05cf"}}, -{"id":"ccnq3_roles","key":"ccnq3_roles","value":{"rev":"43-97de74b08b1af103da8905533a84b749"}}, -{"id":"ccss","key":"ccss","value":{"rev":"11-b9beb506410ea81581ba4c7dfe9b2a7d"}}, -{"id":"cdb","key":"cdb","value":{"rev":"13-d7b6f609f069dc738912b405aac558ab"}}, -{"id":"cdb_changes","key":"cdb_changes","value":{"rev":"13-1dc99b096cb91c276332b651396789e8"}}, -{"id":"celeri","key":"celeri","value":{"rev":"17-b19294619ef6c2056f3bf6641e8945c2"}}, -{"id":"celery","key":"celery","value":{"rev":"5-bdfccd483cf30c4c10c5ec0963de1248"}}, -{"id":"cempl8","key":"cempl8","value":{"rev":"21-bb9547b78a1548fe11dc1d5b816b6da1"}}, -{"id":"cfg","key":"cfg","value":{"rev":"3-85c7651bb8f16b057e60a46946eb95af"}}, -{"id":"cgi","key":"cgi","value":{"rev":"17-7ceac458c7f141d4fbbf05d267a72aa8"}}, -{"id":"chain","key":"chain","value":{"rev":"9-b0f175c5ad0173bcb7e11e58b02a7394"}}, -{"id":"chain-gang","key":"chain-gang","value":{"rev":"22-b0e6841a344b65530ea2a83a038e5aa6"}}, -{"id":"chainer","key":"chainer","value":{"rev":"15-8c6a565035225a1dcca0177e92ccf42d"}}, -{"id":"chainify","key":"chainify","value":{"rev":"3-0926790f18a0016a9943cfb4830e0187"}}, -{"id":"chains","key":"chains","value":{"rev":"5-d9e1ac38056e2638e38d9a7c415929c6"}}, -{"id":"chainsaw","key":"chainsaw","value":{"rev":"24-82e078efbbc59f798d29a0259481012e"}}, -{"id":"changelog","key":"changelog","value":{"rev":"27-317e473de0bf596b273a9dadecea126d"}}, -{"id":"channel-server","key":"channel-server","value":{"rev":"3-3c882f7e61686e8a124b5198c638a18e"}}, -{"id":"channels","key":"channels","value":{"rev":"5-0b532f054886d9094cb98493ee0a7a16"}}, -{"id":"chaos","key":"chaos","value":{"rev":"40-7caa4459d398f5ec30fea91d087f0d71"}}, -{"id":"chard","key":"chard","value":{"rev":"3-f2de35f7a390ea86ac0eb78bf720d0de"}}, -{"id":"charenc","key":"charenc","value":{"rev":"3-092036302311a8f5779b800c98170b5b"}}, -{"id":"chargify","key":"chargify","value":{"rev":"5-e3f29f2816b04c26ca047d345928e2c1"}}, -{"id":"charm","key":"charm","value":{"rev":"13-3e7e7b5babc1efc472e3ce62eec2c0c7"}}, -{"id":"chat-server","key":"chat-server","value":{"rev":"7-c73b785372474e083fb8f3e9690761da"}}, -{"id":"chatroom","key":"chatroom","value":{"rev":"3-f4fa8330b7eb277d11407f968bffb6a2"}}, -{"id":"chatspire","key":"chatspire","value":{"rev":"3-081e167e3f7c1982ab1b7fc3679cb87c"}}, -{"id":"checkip","key":"checkip","value":{"rev":"3-b31d58a160a4a3fe2f14cfbf2217949e"}}, -{"id":"cheddar-getter","key":"cheddar-getter","value":{"rev":"3-d675ec138ea704df127fabab6a52a8dc"}}, -{"id":"chess","key":"chess","value":{"rev":"3-8b15268c8b0fb500dcbc83b259e7fb88"}}, -{"id":"chessathome-worker","key":"chessathome-worker","value":{"rev":"7-cdfd411554c35ba7a52e54f7744bed35"}}, -{"id":"chirkut.js","key":"chirkut.js","value":{"rev":"3-c0e515eee0f719c5261a43e692a3585c"}}, -{"id":"chiron","key":"chiron","value":{"rev":"6-ccb575e432c1c1981fc34b4e27329c85"}}, -{"id":"chopper","key":"chopper","value":{"rev":"5-168681c58c2a50796676dea73dc5398b"}}, -{"id":"choreographer","key":"choreographer","value":{"rev":"14-b0159823becdf0b4552967293968b2a8"}}, -{"id":"chromic","key":"chromic","value":{"rev":"3-c4ca0bb1f951db96c727241092afa9cd"}}, -{"id":"chrono","key":"chrono","value":{"rev":"9-6399d715df1a2f4696f89f2ab5d4d83a"}}, -{"id":"chuck","key":"chuck","value":{"rev":"3-71f2ee071d4b6fb2af3b8b828c51d8ab"}}, -{"id":"chunkedstream","key":"chunkedstream","value":{"rev":"3-b145ed7d1abd94ac44343413e4f823e7"}}, -{"id":"cider","key":"cider","value":{"rev":"10-dc20cd3eac9470e96911dcf75ac6492b"}}, -{"id":"cinch","key":"cinch","value":{"rev":"5-086af7f72caefb57284e4101cbe3c905"}}, -{"id":"cipherpipe","key":"cipherpipe","value":{"rev":"5-0b5590f808415a7297de6d45947d911f"}}, -{"id":"cjson","key":"cjson","value":{"rev":"25-02e3d327b48e77dc0f9e070ce9454ac2"}}, -{"id":"ck","key":"ck","value":{"rev":"3-f482385f5392a49353d8ba5eb9c7afef"}}, -{"id":"ckup","key":"ckup","value":{"rev":"26-90a76ec0cdf951dc2ea6058098407ee2"}}, -{"id":"class","key":"class","value":{"rev":"6-e2805f7d87586a66fb5fd170cf74b3b0"}}, -{"id":"class-42","key":"class-42","value":{"rev":"3-14c988567a2c78a857f15c9661bd6430"}}, -{"id":"class-js","key":"class-js","value":{"rev":"5-792fd04288a651dad87bc47eb91c2042"}}, -{"id":"classify","key":"classify","value":{"rev":"23-35eb336c350446f5ed49069df151dbb7"}}, -{"id":"clean-css","key":"clean-css","value":{"rev":"13-e30ea1007f6c5bb49e07276228b8a960"}}, -{"id":"clearInterval","key":"clearInterval","value":{"rev":"3-a49fa235d3dc14d28a3d15f8db291986"}}, -{"id":"clearTimeout","key":"clearTimeout","value":{"rev":"3-e838bd25adc825112922913c1a35b934"}}, -{"id":"cli","key":"cli","value":{"rev":"65-9e79c37c12d21b9b9114093de0773c54"}}, -{"id":"cli-color","key":"cli-color","value":{"rev":"9-0a8e775e713b1351f6a6648748dd16ec"}}, -{"id":"cli-table","key":"cli-table","value":{"rev":"3-9e447a8bb392fb7d9c534445a650e328"}}, -{"id":"clickatell","key":"clickatell","value":{"rev":"3-31f1a66d08a789976919df0c9280de88"}}, -{"id":"clicktime","key":"clicktime","value":{"rev":"9-697a99f5f704bfebbb454df47c9c472a"}}, -{"id":"clientexpress","key":"clientexpress","value":{"rev":"3-9b07041cd7b0c3967c4625ac74c9b50c"}}, -{"id":"cliff","key":"cliff","value":{"rev":"15-ef9ef25dbad08c0e346388522d94c5c3"}}, -{"id":"clip","key":"clip","value":{"rev":"21-c3936e566feebfe0beddb0bbb686c00d"}}, -{"id":"clock","key":"clock","value":{"rev":"5-19bc51841d41408b4446c0862487dc5e"}}, -{"id":"clog","key":"clog","value":{"rev":"5-1610fe2c0f435d2694a1707ee15cd11e"}}, -{"id":"clone","key":"clone","value":{"rev":"11-099d07f38381b54902c4cf5b93671ed4"}}, -{"id":"closure","key":"closure","value":{"rev":"7-9c2ac6b6ec9f14d12d10bfbfad58ec14"}}, -{"id":"closure-compiler","key":"closure-compiler","value":{"rev":"8-b3d2f9e3287dd33094a35d797d6beaf2"}}, -{"id":"cloud","key":"cloud","value":{"rev":"27-407c7aa77d3d4a6cc903d18b383de8b8"}}, -{"id":"cloud9","key":"cloud9","value":{"rev":"71-4af631e3fa2eb28058cb0d18ef3a6a3e"}}, -{"id":"cloudcontrol","key":"cloudcontrol","value":{"rev":"15-2df57385aa9bd92f7ed81e6892e23696"}}, -{"id":"cloudfiles","key":"cloudfiles","value":{"rev":"30-01f84ebda1d8f151b3e467590329960c"}}, -{"id":"cloudfoundry","key":"cloudfoundry","value":{"rev":"3-66fafd3d6b1353b1699d35e634686ab6"}}, -{"id":"cloudmailin","key":"cloudmailin","value":{"rev":"3-a4e3e4d457f5a18261bb8df145cfb418"}}, -{"id":"cloudnode-cli","key":"cloudnode-cli","value":{"rev":"17-3a80f7855ce618f7aee68bd693ed485b"}}, -{"id":"cloudservers","key":"cloudservers","value":{"rev":"42-6bc34f7e34f84a24078b43a609e96c59"}}, -{"id":"clucene","key":"clucene","value":{"rev":"37-3d613f12a857b8fe22fbf420bcca0dc3"}}, -{"id":"cluster","key":"cluster","value":{"rev":"83-63fb7a468d95502f94ea45208ba0a890"}}, -{"id":"cluster-isolatable","key":"cluster-isolatable","value":{"rev":"5-6af883cea9ab1c90bb126d8b3be2d156"}}, -{"id":"cluster-live","key":"cluster-live","value":{"rev":"7-549d19e9727f460c7de48f93b92e9bb3"}}, -{"id":"cluster-log","key":"cluster-log","value":{"rev":"7-9c47854df8ec911e679743185668a5f7"}}, -{"id":"cluster-loggly","key":"cluster-loggly","value":{"rev":"3-e1f7e331282d7b8317ce55e0fce7f934"}}, -{"id":"cluster-mail","key":"cluster-mail","value":{"rev":"9-dc18c5c1b2b265f3d531b92467b6cc35"}}, -{"id":"cluster-responsetimes","key":"cluster-responsetimes","value":{"rev":"3-c9e16daee15eb84910493264e973275c"}}, -{"id":"cluster-socket.io","key":"cluster-socket.io","value":{"rev":"7-29032f0b42575e9fe183a0af92191132"}}, -{"id":"cluster.exception","key":"cluster.exception","value":{"rev":"3-10856526e2f61e3000d62b12abd750e3"}}, -{"id":"clutch","key":"clutch","value":{"rev":"8-50283f7263c430cdd1d293c033571012"}}, -{"id":"cm1-route","key":"cm1-route","value":{"rev":"13-40e72b5a4277b500c98c966bcd2a8a86"}}, -{"id":"cmd","key":"cmd","value":{"rev":"9-9168fcd96fb1ba9449050162023f3570"}}, -{"id":"cmdopt","key":"cmdopt","value":{"rev":"3-85677533e299bf195e78942929cf9839"}}, -{"id":"cmp","key":"cmp","value":{"rev":"5-b10f873b78eb64e406fe55bd001ae0fa"}}, -{"id":"cmudict","key":"cmudict","value":{"rev":"3-cd028380bba917d5ed2be7a8d3b3b0b7"}}, -{"id":"cnlogger","key":"cnlogger","value":{"rev":"9-dbe7e0e50d25ca5ae939fe999c3c562b"}}, -{"id":"coa","key":"coa","value":{"rev":"11-ff4e634fbebd3f80b9461ebe58b3f64e"}}, -{"id":"cobra","key":"cobra","value":{"rev":"5-a3e0963830d350f4a7e91b438caf9117"}}, -{"id":"cockpit","key":"cockpit","value":{"rev":"3-1757b37245ee990999e4456b9a6b963e"}}, -{"id":"coco","key":"coco","value":{"rev":"104-eabc4d7096295c2156144a7581d89b35"}}, -{"id":"cocos2d","key":"cocos2d","value":{"rev":"19-88a5c75ceb6e7667665c056d174f5f1a"}}, -{"id":"codem-transcode","key":"codem-transcode","value":{"rev":"9-1faa2657d53271ccc44cce27de723e99"}}, -{"id":"codepad","key":"codepad","value":{"rev":"5-094ddce74dc057dc0a4d423d6d2fbc3a"}}, -{"id":"codetube","key":"codetube","value":{"rev":"3-819794145f199330e724864db70da53b"}}, -{"id":"coerce","key":"coerce","value":{"rev":"3-e7d392d497c0b8491b89fcbbd1a5a89f"}}, -{"id":"coffee-conf","key":"coffee-conf","value":{"rev":"3-883bc4767d70810ece2fdf1ccae883de"}}, -{"id":"coffee-css","key":"coffee-css","value":{"rev":"11-66ca197173751389b24945f020f198f9"}}, -{"id":"coffee-echonest","key":"coffee-echonest","value":{"rev":"3-3cd0e2b77103e334eccf6cf4168f39b2"}}, -{"id":"coffee-machine","key":"coffee-machine","value":{"rev":"9-02deb4d27fd5d56002ead122e9bb213e"}}, -{"id":"coffee-new","key":"coffee-new","value":{"rev":"67-0664b0f289030c38d113070fd26f4f71"}}, -{"id":"coffee-resque","key":"coffee-resque","value":{"rev":"22-5b022809317d3a873be900f1a697c5eb"}}, -{"id":"coffee-resque-retry","key":"coffee-resque-retry","value":{"rev":"29-1fb64819a4a21ebb4d774d9d4108e419"}}, -{"id":"coffee-revup","key":"coffee-revup","value":{"rev":"3-23aafa258bcdcf2bb68d143d61383551"}}, -{"id":"coffee-script","key":"coffee-script","value":{"rev":"60-a6c3739655f43953bd86283776586b95"}}, -{"id":"coffee-son","key":"coffee-son","value":{"rev":"3-84a81e7e24c8cb23293940fc1b87adfe"}}, -{"id":"coffee-toaster","key":"coffee-toaster","value":{"rev":"17-d43d7276c08b526c229c78b7d5acd6cc"}}, -{"id":"coffee-watcher","key":"coffee-watcher","value":{"rev":"3-3d861a748f0928c789cbdb8ff62b6091"}}, -{"id":"coffee-world","key":"coffee-world","value":{"rev":"15-46dc320f94fa64c39e183224ec59f47a"}}, -{"id":"coffee4clients","key":"coffee4clients","value":{"rev":"15-58fba7dd10bced0411cfe546b9336145"}}, -{"id":"coffeeapp","key":"coffeeapp","value":{"rev":"48-bece0a26b78afc18cd37d577f90369d9"}}, -{"id":"coffeebot","key":"coffeebot","value":{"rev":"3-a9007053f25a4c13b324f0ac7066803e"}}, -{"id":"coffeedoc","key":"coffeedoc","value":{"rev":"21-a955faafafd10375baf3101ad2c142d0"}}, -{"id":"coffeegrinder","key":"coffeegrinder","value":{"rev":"9-6e725aad7fd39cd38f41c743ef8a7563"}}, -{"id":"coffeekup","key":"coffeekup","value":{"rev":"35-9b1eecdb7b13d3e75cdc7b1045cf910a"}}, -{"id":"coffeemaker","key":"coffeemaker","value":{"rev":"9-4c5e665aa2a5b4efa2b7d077d0a4f9c1"}}, -{"id":"coffeemate","key":"coffeemate","value":{"rev":"71-03d0221fb495f2dc6732009884027b47"}}, -{"id":"coffeepack","key":"coffeepack","value":{"rev":"3-bbf0e27cb4865392164e7ab33f131d58"}}, -{"id":"coffeeq","key":"coffeeq","value":{"rev":"9-4e38e9742a0b9d7b308565729fbfd123"}}, -{"id":"coffeescript-growl","key":"coffeescript-growl","value":{"rev":"7-2bc1f93c4aad5fa8fb4bcfd1b3ecc279"}}, -{"id":"coffeescript-notify","key":"coffeescript-notify","value":{"rev":"3-8aeb31f8e892d3fefa421ff28a1b3de9"}}, -{"id":"collectd","key":"collectd","value":{"rev":"5-3d4c84b0363aa9c078157d82695557a1"}}, -{"id":"collection","key":"collection","value":{"rev":"3-a47e1fe91b9eebb3e75954e350ec2ca3"}}, -{"id":"collection_functions","key":"collection_functions","value":{"rev":"3-7366c721008062373ec924a409415189"}}, -{"id":"collections","key":"collections","value":{"rev":"3-0237a40d08a0da36c2dd01ce73a89bb2"}}, -{"id":"color","key":"color","value":{"rev":"15-4898b2cd9744feb3249ba10828c186f8"}}, -{"id":"color-convert","key":"color-convert","value":{"rev":"7-2ccb47c7f07a47286d9a2f39383d28f0"}}, -{"id":"color-string","key":"color-string","value":{"rev":"5-9a6336f420e001e301a15b88b0103696"}}, -{"id":"colorize","key":"colorize","value":{"rev":"3-ff380385edacc0c46e4c7b5c05302576"}}, -{"id":"colors","key":"colors","value":{"rev":"8-7c7fb9c5af038c978f0868c7706fe145"}}, -{"id":"colour-extractor","key":"colour-extractor","value":{"rev":"3-62e96a84c6adf23f438b5aac76c7b257"}}, -{"id":"coloured","key":"coloured","value":{"rev":"8-c5295f2d5a8fc08e93d180a4e64f8d38"}}, -{"id":"coloured-log","key":"coloured-log","value":{"rev":"14-8627a3625959443acad71e2c23dfc582"}}, -{"id":"comb","key":"comb","value":{"rev":"5-7f201b621ae9a890c7f5a31867eba3e9"}}, -{"id":"combine","key":"combine","value":{"rev":"14-bed33cd4389a2e4bb826a0516c6ae307"}}, -{"id":"combined-stream","key":"combined-stream","value":{"rev":"13-678f560200ac2835b9026e9e2b955cb0"}}, -{"id":"combiner","key":"combiner","value":{"rev":"3-5e7f133c8c14958eaf9e92bd79ae8ee1"}}, -{"id":"combohandler","key":"combohandler","value":{"rev":"7-d7e1a402f0066caa6756a8866de81dd9"}}, -{"id":"combyne","key":"combyne","value":{"rev":"23-05ebee9666a769e32600bc5548d10ce9"}}, -{"id":"comfy","key":"comfy","value":{"rev":"5-8bfe55bc16611dfe51a184b8f3eb31c1"}}, -{"id":"command-parser","key":"command-parser","value":{"rev":"5-8a5c3ed6dfa0fa55cc71b32cf52332fc"}}, -{"id":"commander","key":"commander","value":{"rev":"11-9dd16c00844d464bf66c101a57075401"}}, -{"id":"commando","key":"commando","value":{"rev":"3-e159f1890f3771dfd6e04f4d984f26f3"}}, -{"id":"common","key":"common","value":{"rev":"16-94eafcf104c0c7d1090e668ddcc12a5f"}}, -{"id":"common-exception","key":"common-exception","value":{"rev":"7-bd46358014299da814691c835548ef21"}}, -{"id":"common-node","key":"common-node","value":{"rev":"5-b2c4bef0e7022d5d453661a9c43497a8"}}, -{"id":"common-pool","key":"common-pool","value":{"rev":"5-c495fa945361ba4fdfb2ee8733d791b4"}}, -{"id":"common-utils","key":"common-utils","value":{"rev":"3-e5a047f118fc304281d2bc5e9ab18e62"}}, -{"id":"commondir","key":"commondir","value":{"rev":"3-ea49874d12eeb9adf28ca28989dfb5a9"}}, -{"id":"commonjs","key":"commonjs","value":{"rev":"6-39fcd0de1ec265890cf063effd0672e3"}}, -{"id":"commonjs-utils","key":"commonjs-utils","value":{"rev":"6-c0266a91dbd0a43effb7d30da5d9f35c"}}, -{"id":"commonkv","key":"commonkv","value":{"rev":"3-90b2fe4c79e263b044303706c4d5485a"}}, -{"id":"commons","key":"commons","value":{"rev":"6-0ecb654aa2bd17cf9519f86d354f8a50"}}, -{"id":"complete","key":"complete","value":{"rev":"7-acde8cba7677747d09c3d53ff165754e"}}, -{"id":"complex-search","key":"complex-search","value":{"rev":"5-c80b2c7f049f333bde89435f3de497ca"}}, -{"id":"compose","key":"compose","value":{"rev":"1-cf8a97d6ead3bef056d85daec5d36c70"}}, -{"id":"composer","key":"composer","value":{"rev":"6-1deb43725051f845efd4a7c8e68aa6d6"}}, -{"id":"compress","key":"compress","value":{"rev":"17-f0aacce1356f807b51e083490fb353bd"}}, -{"id":"compress-buffer","key":"compress-buffer","value":{"rev":"12-2886014c7f2541f4ddff9f0f55f4c171"}}, -{"id":"compress-ds","key":"compress-ds","value":{"rev":"5-9e4c6931edf104443353594ef50aa127"}}, -{"id":"compressor","key":"compressor","value":{"rev":"3-ee8ad155a98e1483d899ebcf82d5fb63"}}, -{"id":"concrete","key":"concrete","value":{"rev":"5-bc70bbffb7c6fe9e8c399db578fb3bae"}}, -{"id":"condo","key":"condo","value":{"rev":"9-5f03d58ee7dc29465defa3758f3b138a"}}, -{"id":"conductor","key":"conductor","value":{"rev":"8-1878afadcda7398063de6286c2d2c5c1"}}, -{"id":"conf","key":"conf","value":{"rev":"11-dcf0f6a93827d1b143cb1d0858f2be4a"}}, -{"id":"config","key":"config","value":{"rev":"37-2b741a1e6951a74b7f1de0d0547418a0"}}, -{"id":"config-loader","key":"config-loader","value":{"rev":"3-708cc96d1206de46fb450eb57ca07b0d"}}, -{"id":"configurator","key":"configurator","value":{"rev":"5-b31ad9731741d19f28241f6af5b41fee"}}, -{"id":"confu","key":"confu","value":{"rev":"7-c46f82c4aa9a17db6530b00669461eaf"}}, -{"id":"confy","key":"confy","value":{"rev":"3-893b33743830a0318dc99b1788aa92ee"}}, -{"id":"connect","key":"connect","value":{"rev":"151-8b5617fc6ece6c125b5f628936159bd6"}}, -{"id":"connect-access-control","key":"connect-access-control","value":{"rev":"3-ccf5fb09533d41eb0b564eb1caecf910"}}, -{"id":"connect-airbrake","key":"connect-airbrake","value":{"rev":"5-19db5e5828977540814d09f9eb7f028f"}}, -{"id":"connect-analytics","key":"connect-analytics","value":{"rev":"3-6f71c8b08ed9f5762c1a4425c196fb2a"}}, -{"id":"connect-app-cache","key":"connect-app-cache","value":{"rev":"27-3e69452dfe51cc907f8b188aede1bda8"}}, -{"id":"connect-assetmanager","key":"connect-assetmanager","value":{"rev":"46-f2a8834d2749e0c069cee06244e7501c"}}, -{"id":"connect-assetmanager-handlers","key":"connect-assetmanager-handlers","value":{"rev":"38-8b93821fcf46f20bbad4319fb39302c1"}}, -{"id":"connect-assets","key":"connect-assets","value":{"rev":"33-7ec2940217e29a9514d20cfd49af10f5"}}, -{"id":"connect-auth","key":"connect-auth","value":{"rev":"36-5640e82f3e2773e44ce47b0687436305"}}, -{"id":"connect-cache","key":"connect-cache","value":{"rev":"11-efe1f0ab00c181b1a4dece446ef13a90"}}, -{"id":"connect-coffee","key":"connect-coffee","value":{"rev":"3-3d4ebcfe083c9e5a5d587090f1bb4d65"}}, -{"id":"connect-conneg","key":"connect-conneg","value":{"rev":"3-bc3e04e65cf1f5233a38cc846e9a4a75"}}, -{"id":"connect-cookie-session","key":"connect-cookie-session","value":{"rev":"3-f48ca73aa1ce1111a2c962d219b59c1a"}}, -{"id":"connect-cors","key":"connect-cors","value":{"rev":"10-5bc9e3759671a0157fdc307872d38844"}}, -{"id":"connect-couchdb","key":"connect-couchdb","value":{"rev":"9-9adb6d24c7fb6de58bafe6d06fb4a230"}}, -{"id":"connect-cradle","key":"connect-cradle","value":{"rev":"5-0e5e32e00a9b98eff1ab010173d26ffb"}}, -{"id":"connect-docco","key":"connect-docco","value":{"rev":"9-c8e379f9a89db53f8921895ac4e87ed6"}}, -{"id":"connect-dojo","key":"connect-dojo","value":{"rev":"17-f323c634536b9b948ad9607f4ca0847f"}}, -{"id":"connect-esi","key":"connect-esi","value":{"rev":"45-01de7506d405856586ea77cb14022192"}}, -{"id":"connect-facebook","key":"connect-facebook","value":{"rev":"3-bf77eb01c0476e607b25bc9d93416b7e"}}, -{"id":"connect-force-domain","key":"connect-force-domain","value":{"rev":"5-a65755f93aaea8a21c7ce7dd4734dca0"}}, -{"id":"connect-form","key":"connect-form","value":{"rev":"16-fa786af79f062a05ecdf3e7cf48317e2"}}, -{"id":"connect-geoip","key":"connect-geoip","value":{"rev":"3-d87f93bcac58aa7904886a8fb6c45899"}}, -{"id":"connect-googleapps","key":"connect-googleapps","value":{"rev":"13-49c5c6c6724b21eea9a8eaae2165978d"}}, -{"id":"connect-gzip","key":"connect-gzip","value":{"rev":"7-2e1d4bb887c1ddda278fc8465ee5645b"}}, -{"id":"connect-heroku-redis","key":"connect-heroku-redis","value":{"rev":"13-92da2be67451e5f55f6fbe3672c86dc4"}}, -{"id":"connect-i18n","key":"connect-i18n","value":{"rev":"8-09d47d7c220770fc80d1b6fd87ffcd07"}}, -{"id":"connect-identity","key":"connect-identity","value":{"rev":"8-8eb9e21bbf80045e0243720955d6070f"}}, -{"id":"connect-image-resizer","key":"connect-image-resizer","value":{"rev":"7-5f82563f87145f3cc06086afe3a14a62"}}, -{"id":"connect-index","key":"connect-index","value":{"rev":"3-8b8373334079eb26c8735b39483889a0"}}, -{"id":"connect-jsonp","key":"connect-jsonp","value":{"rev":"16-9e80af455e490710f06039d3c0025840"}}, -{"id":"connect-jsonrpc","key":"connect-jsonrpc","value":{"rev":"6-6556800f0bef6ae5eb10496d751048e7"}}, -{"id":"connect-kyoto","key":"connect-kyoto","value":{"rev":"5-8f6a9e9b24d1a71c786645402f509645"}}, -{"id":"connect-less","key":"connect-less","value":{"rev":"3-461ed9a80b462b978a81d5bcee6f3665"}}, -{"id":"connect-load-balance","key":"connect-load-balance","value":{"rev":"3-e74bff5fb47d1490c05a9cc4339af347"}}, -{"id":"connect-memcached","key":"connect-memcached","value":{"rev":"3-5fc92b7f9fb5bcfb364a27e6f052bcc7"}}, -{"id":"connect-mongo","key":"connect-mongo","value":{"rev":"13-c3869bc7337b2f1ee6b9b3364993f321"}}, -{"id":"connect-mongodb","key":"connect-mongodb","value":{"rev":"30-30cb932839ce16e4e496f5a33fdd720a"}}, -{"id":"connect-mongoose","key":"connect-mongoose","value":{"rev":"3-48a5b329e4cfa885442d43bbd1d0db46"}}, -{"id":"connect-mongoose-session","key":"connect-mongoose-session","value":{"rev":"3-6692b8e1225d5cd6a2daabd61cecb1cd"}}, -{"id":"connect-mysql-session","key":"connect-mysql-session","value":{"rev":"9-930abd0279ef7f447e75c95b3e71be12"}}, -{"id":"connect-no-www","key":"connect-no-www","value":{"rev":"3-33bed7417bc8a5e8efc74ce132c33158"}}, -{"id":"connect-notifo","key":"connect-notifo","value":{"rev":"3-4681f8c5a7dfd35aee9634e809c41804"}}, -{"id":"connect-parameter-router","key":"connect-parameter-router","value":{"rev":"3-f435f06d556c208d43ef05c64bcddceb"}}, -{"id":"connect-pg","key":"connect-pg","value":{"rev":"11-d84c53d8f1c24adfc266e7a031dddf0d"}}, -{"id":"connect-proxy","key":"connect-proxy","value":{"rev":"7-a691ff57a9affeab47c54d17dbe613cb"}}, -{"id":"connect-queryparser","key":"connect-queryparser","value":{"rev":"3-bb35a7f3f75297a63bf942a63b842698"}}, -{"id":"connect-redis","key":"connect-redis","value":{"rev":"40-4faa12962b14da49380de2bb183176f9"}}, -{"id":"connect-restreamer","key":"connect-restreamer","value":{"rev":"3-08e637ca685cc63b2b4f9722c763c105"}}, -{"id":"connect-riak","key":"connect-riak","value":{"rev":"5-3268c29a54e430a3f8adb33570afafdb"}}, -{"id":"connect-rpx","key":"connect-rpx","value":{"rev":"28-acc7bb4200c1d30f359151f0a715162c"}}, -{"id":"connect-security","key":"connect-security","value":{"rev":"16-fecd20f486a8ea4d557119af5b5a2960"}}, -{"id":"connect-select","key":"connect-select","value":{"rev":"5-5ca28ec800419e4cb3e97395a6b96153"}}, -{"id":"connect-session-mongo","key":"connect-session-mongo","value":{"rev":"9-9e6a26dfbb9c13a9d6f4060a1895730a"}}, -{"id":"connect-session-redis-store","key":"connect-session-redis-store","value":{"rev":"8-fecfed6e17476eaada5cfe7740d43893"}}, -{"id":"connect-sessionvoc","key":"connect-sessionvoc","value":{"rev":"13-57b6e6ea2158e3b7136054839662ea3d"}}, -{"id":"connect-spdy","key":"connect-spdy","value":{"rev":"11-f9eefd7303295d77d317cba78d299130"}}, -{"id":"connect-sts","key":"connect-sts","value":{"rev":"9-8e3fd563c04ce14b824fc4da42efb70e"}}, -{"id":"connect-timeout","key":"connect-timeout","value":{"rev":"4-6f5f8d97480c16c7acb05fe82400bbc7"}}, -{"id":"connect-unstable","key":"connect-unstable","value":{"rev":"3-1d3a4edc52f005d8cb4d557485095314"}}, -{"id":"connect-wormhole","key":"connect-wormhole","value":{"rev":"3-f33b15acc686bd9ad0c6df716529009f"}}, -{"id":"connect-xcors","key":"connect-xcors","value":{"rev":"7-f8e1cd6805a8779bbd6bb2c1000649fb"}}, -{"id":"connect_facebook","key":"connect_facebook","value":{"rev":"3-b3001d71f619836a009c53c816ce36ed"}}, -{"id":"connect_json","key":"connect_json","value":{"rev":"3-dd0df74291f80f45b4314d56192c19c5"}}, -{"id":"connectables","key":"connectables","value":{"rev":"3-f6e9f8f13883a523b4ea6035281f541b"}}, -{"id":"conseq","key":"conseq","value":{"rev":"3-890d340704322630e7a724333f394c70"}}, -{"id":"consistent-hashing","key":"consistent-hashing","value":{"rev":"3-fcef5d4479d926560cf1bc900f746f2a"}}, -{"id":"console","key":"console","value":{"rev":"3-1e0449b07c840eeac6b536e2552844f4"}}, -{"id":"console.log","key":"console.log","value":{"rev":"9-d608afe50e732ca453365befcb87bad5"}}, -{"id":"consolemark","key":"consolemark","value":{"rev":"13-320f003fc2c3cec909ab3e9c3bce9743"}}, -{"id":"construct","key":"construct","value":{"rev":"3-75bdc809ee0572172e6acff537af7d9b"}}, -{"id":"context","key":"context","value":{"rev":"3-86b1a6a0f77ef86d4d9ccfff47ceaf6a"}}, -{"id":"contextify","key":"contextify","value":{"rev":"9-547b8019ef66e0d1c84fe00be832e750"}}, -{"id":"contract","key":"contract","value":{"rev":"3-d09e775c2c1e297b6cbbfcd5efbae3c7"}}, -{"id":"contracts","key":"contracts","value":{"rev":"13-3fd75c77e688937734f51cf97f10dd7d"}}, -{"id":"control","key":"control","value":{"rev":"31-7abf0cb81d19761f3ff59917e56ecedf"}}, -{"id":"controljs","key":"controljs","value":{"rev":"3-a8e80f93e389ca07509fa7addd6cb805"}}, -{"id":"convert","key":"convert","value":{"rev":"3-6c962b92274bcbe82b82a30806559d47"}}, -{"id":"conway","key":"conway","value":{"rev":"5-93ce24976e7dd5ba02fe4addb2b44267"}}, -{"id":"cookie","key":"cookie","value":{"rev":"14-946d98bf46e940d13ca485148b1bd609"}}, -{"id":"cookie-sessions","key":"cookie-sessions","value":{"rev":"8-4b399ac8cc4baea15f6c5e7ac94399f0"}}, -{"id":"cookiejar","key":"cookiejar","value":{"rev":"20-220b41a4c2a8f2b7b14aafece7dcc1b5"}}, -{"id":"cookies","key":"cookies","value":{"rev":"15-b3b35c32a99ed79accc724685d131d18"}}, -{"id":"cool","key":"cool","value":{"rev":"3-007d1123eb2dc52cf845d625f7ccf198"}}, -{"id":"coolmonitor","key":"coolmonitor","value":{"rev":"3-69c3779c596527f63e49c5e507dff1e1"}}, -{"id":"coop","key":"coop","value":{"rev":"9-39dee3260858cf8c079f31bdf02cea1d"}}, -{"id":"coordinator","key":"coordinator","value":{"rev":"32-9d92f2033a041d5c40f8e1018d512755"}}, -{"id":"core-utils","key":"core-utils","value":{"rev":"9-98f2412938a67d83e53e76a26b5601e0"}}, -{"id":"cornify","key":"cornify","value":{"rev":"6-6913172d09c52f9e8dc0ea19ec49972c"}}, -{"id":"corpus","key":"corpus","value":{"rev":"3-a357e7779f8d4ec020b755c71dd1e57b"}}, -{"id":"corrector","key":"corrector","value":{"rev":"3-ef3cf99fc59a581aee3590bdb8615269"}}, -{"id":"cosmos","key":"cosmos","value":{"rev":"3-3eb292c59758fb5215f22739fa9531ce"}}, -{"id":"couch-ar","key":"couch-ar","value":{"rev":"25-f106d2965ab74b25b18328ca44ca4a02"}}, -{"id":"couch-cleaner","key":"couch-cleaner","value":{"rev":"15-74e61ef98a770d76be4c7e7571d18381"}}, -{"id":"couch-client","key":"couch-client","value":{"rev":"10-94945ebd3e17f509fcc71fb6c6ef5d35"}}, -{"id":"couch-session","key":"couch-session","value":{"rev":"4-c73dea41ceed26a2a0bde9a9c8ffffc4"}}, -{"id":"couch-sqlite","key":"couch-sqlite","value":{"rev":"3-3e420fe6623542475595aa7e55a4e4bd"}}, -{"id":"couch-stream","key":"couch-stream","value":{"rev":"5-911704fc984bc49acce1e10adefff7ff"}}, -{"id":"couchapp","key":"couchapp","value":{"rev":"16-ded0f4742bb3f5fd42ec8f9c6b21ae8e"}}, -{"id":"couchcmd","key":"couchcmd","value":{"rev":"3-651ea2b435e031481b5d3d968bd3d1eb"}}, -{"id":"couchdb","key":"couchdb","value":{"rev":"12-8abcfd649751226c10edf7cf0508a09f"}}, -{"id":"couchdb-api","key":"couchdb-api","value":{"rev":"23-f2c82f08f52f266df7ac2aa709615244"}}, -{"id":"couchdb-tmp","key":"couchdb-tmp","value":{"rev":"3-9a695fb4ba352f3be2d57c5995718520"}}, -{"id":"couchdev","key":"couchdev","value":{"rev":"3-50a0ca3ed0395dd72de62a1b96619e66"}}, -{"id":"couchlegs","key":"couchlegs","value":{"rev":"5-be78e7922ad4ff86dbe5c17a87fdf4f1"}}, -{"id":"couchtato","key":"couchtato","value":{"rev":"11-15a1ce8de9a8cf1e81d96de6afbb4f45"}}, -{"id":"couchy","key":"couchy","value":{"rev":"13-0a52b2712fb8447f213866612e3ccbf7"}}, -{"id":"courier","key":"courier","value":{"rev":"17-eb94fe01aeaad43805f4bce21d23bcba"}}, -{"id":"coverage","key":"coverage","value":{"rev":"10-a333448996d0b0d420168d1b5748db32"}}, -{"id":"coverage_testing","key":"coverage_testing","value":{"rev":"3-62834678206fae7911401aa86ec1a85e"}}, -{"id":"cqs","key":"cqs","value":{"rev":"6-0dad8b969c70abccc27a146a99399533"}}, -{"id":"crab","key":"crab","value":{"rev":"9-599fc7757f0c9efbe3889f30981ebe93"}}, -{"id":"cradle","key":"cradle","value":{"rev":"60-8fb414b66cb07b4bae59c0316d5c45b4"}}, -{"id":"cradle-fixed","key":"cradle-fixed","value":{"rev":"4-589afffa26fca22244ad2038abb77dc5"}}, -{"id":"cradle-init","key":"cradle-init","value":{"rev":"13-499d63592141f1e200616952bbdea015"}}, -{"id":"crawler","key":"crawler","value":{"rev":"5-ec4a8d77f90d86d17d6d14d631360188"}}, -{"id":"crc","key":"crc","value":{"rev":"3-25ab83f8b1333e6d4e4e5fb286682422"}}, -{"id":"creatary","key":"creatary","value":{"rev":"3-770ad84ecb2e2a3994637d419384740d"}}, -{"id":"createsend","key":"createsend","value":{"rev":"7-19885346e4d7a01ac2e9ad70ea0e822a"}}, -{"id":"creationix","key":"creationix","value":{"rev":"61-7ede1759afbd41e8b4dedc348b72202e"}}, -{"id":"creek","key":"creek","value":{"rev":"33-4f511aa4dd379e04bba7ac333744325e"}}, -{"id":"cron","key":"cron","value":{"rev":"12-8d794edb5f9b7cb6322acaef1c848043"}}, -{"id":"cron2","key":"cron2","value":{"rev":"13-bae2f1b02ffcbb0e77bde6c33b566f80"}}, -{"id":"crontab","key":"crontab","value":{"rev":"36-14d26bf316289fb4841940eee2932f37"}}, -{"id":"crossroads","key":"crossroads","value":{"rev":"7-d73d51cde30f24caad91e6a3c5b420f2"}}, -{"id":"crowdflower","key":"crowdflower","value":{"rev":"3-16c2dfc9fd505f75068f75bd19e3d227"}}, -{"id":"cruvee","key":"cruvee","value":{"rev":"3-979ccf0286b1701e9e7483a10451d975"}}, -{"id":"crypt","key":"crypt","value":{"rev":"3-031b338129bebc3749b42fb3d442fc4b"}}, -{"id":"crypto","key":"crypto","value":{"rev":"3-66a444b64481c85987dd3f22c32e0630"}}, -{"id":"csj","key":"csj","value":{"rev":"3-bc3133c7a0a8827e89aa03897b81d177"}}, -{"id":"cson","key":"cson","value":{"rev":"7-3ac3e1e10572e74e58874cfe3200eb87"}}, -{"id":"csrf-express","key":"csrf-express","value":{"rev":"3-4cc36d88e8ad10b9c2cc8a7318f0abd3"}}, -{"id":"css-crawler","key":"css-crawler","value":{"rev":"13-4739c7bf1decc72d7682b53303f93ec6"}}, -{"id":"css-smasher","key":"css-smasher","value":{"rev":"3-631128f966135c97d648efa3eadf7bfb"}}, -{"id":"css-sourcery","key":"css-sourcery","value":{"rev":"3-571343da3a09af7de473d29ed7dd788b"}}, -{"id":"css2json","key":"css2json","value":{"rev":"5-fb6d84c1da4a9391fa05d782860fe7c4"}}, -{"id":"csskeeper","key":"csskeeper","value":{"rev":"5-ea667a572832ea515b044d4b87ea7d98"}}, -{"id":"csslike","key":"csslike","value":{"rev":"3-6e957cce81f6e790f8562526d907ad94"}}, -{"id":"csslint","key":"csslint","value":{"rev":"19-b1e973274a0a6b8eb81b4d715a249612"}}, -{"id":"cssmin","key":"cssmin","value":{"rev":"10-4bb4280ec56f110c43abe01189f95818"}}, -{"id":"csso","key":"csso","value":{"rev":"17-ccfe2a72d377919b07973bbb1d19b8f2"}}, -{"id":"cssom","key":"cssom","value":{"rev":"3-f96b884b63b4c04bac18b8d9c0a4c4cb"}}, -{"id":"cssp","key":"cssp","value":{"rev":"5-abf69f9ff99b7d0bf2731a5b5da0897c"}}, -{"id":"cssunminifier","key":"cssunminifier","value":{"rev":"3-7bb0c27006af682af92d1969fcb4fa73"}}, -{"id":"cssutils","key":"cssutils","value":{"rev":"3-4759f9db3b8eac0964e36f5229260526"}}, -{"id":"csv","key":"csv","value":{"rev":"21-0420554e9c08e001063cfb0a69a48255"}}, -{"id":"csv2mongo","key":"csv2mongo","value":{"rev":"9-373f11c05e5d1744c3187d9aaeaae0ab"}}, -{"id":"csvutils","key":"csvutils","value":{"rev":"15-84aa82e56b49cd425a059c8f0735a23c"}}, -{"id":"ctrlflow","key":"ctrlflow","value":{"rev":"33-0b817baf6c744dc17b83d5d8ab1ba74e"}}, -{"id":"ctrlflow_tests","key":"ctrlflow_tests","value":{"rev":"3-d9ed35503d27b0736c59669eecb4c4fe"}}, -{"id":"ctype","key":"ctype","value":{"rev":"9-c5cc231475f23a01682d0b1a3b6e49c2"}}, -{"id":"cube","key":"cube","value":{"rev":"5-40320a20d260e082f5c4ca508659b4d1"}}, -{"id":"cucumber","key":"cucumber","value":{"rev":"11-8489af0361b6981cf9001a0403815936"}}, -{"id":"cucumis","key":"cucumis","value":{"rev":"33-6dc38f1161fae3efa2a89c8288b6e040"}}, -{"id":"cucumis-rm","key":"cucumis-rm","value":{"rev":"3-6179249ad15166f8d77eb136b3fa87ca"}}, -{"id":"cupcake","key":"cupcake","value":{"rev":"15-1dd13a85415a366942e7f0a3de06aa2a"}}, -{"id":"curator","key":"curator","value":{"rev":"19-d798ab7fbca11ba0e9c6c40c0a2f9440"}}, -{"id":"curl","key":"curl","value":{"rev":"11-ac7143ac07c64ea169ba7d4e58be232a"}}, -{"id":"curly","key":"curly","value":{"rev":"30-0248a5563b6e96457315ad0cc2fe22c1"}}, -{"id":"curry","key":"curry","value":{"rev":"11-ce13fa80e84eb25d9cf76cf4162a634e"}}, -{"id":"cursory","key":"cursory","value":{"rev":"3-ea2f4b1b47caf38460402d1a565c18b8"}}, -{"id":"d-utils","key":"d-utils","value":{"rev":"37-699ad471caa28183d75c06f0f2aab41c"}}, -{"id":"d3","key":"d3","value":{"rev":"5-4d867844bd7dce21b34cd7283bb9cad4"}}, -{"id":"d3bench","key":"d3bench","value":{"rev":"3-617cc625bfd91c175d037bfcace9c4e9"}}, -{"id":"daemon","key":"daemon","value":{"rev":"11-8654f90bc609ca2c3ec260c7d6b7793e"}}, -{"id":"daemon-tools","key":"daemon-tools","value":{"rev":"18-8197fce2054de67925e6f2c3fa3cd90a"}}, -{"id":"daimyo","key":"daimyo","value":{"rev":"25-531b0b0afdc5ae3d41b4131da40af6cf"}}, -{"id":"daleth","key":"daleth","value":{"rev":"7-4824619205289ba237ef2a4dc1fba1ec"}}, -{"id":"dali","key":"dali","value":{"rev":"9-037c4c76f739ecb537a064c07d3c63e3"}}, -{"id":"damncomma","key":"damncomma","value":{"rev":"3-b1472eada01efb8a12d521e5a248834b"}}, -{"id":"dana","key":"dana","value":{"rev":"3-2a3c0ff58a6d13fedd17e1d192080e59"}}, -{"id":"dandy","key":"dandy","value":{"rev":"9-f4ae43659dd812a010b0333bf8e5a282"}}, -{"id":"dash","key":"dash","value":{"rev":"5-698513f86165f429a5f55320d5a700f0"}}, -{"id":"dash-fu","key":"dash-fu","value":{"rev":"3-848e99a544f9f78f311c7ebfc5a172c4"}}, -{"id":"dashboard","key":"dashboard","value":{"rev":"3-71844d1fc1140b7533f9e57740d2b666"}}, -{"id":"data","key":"data","value":{"rev":"23-b594e2bd1ffef1cda8b7e94dbf15ad5b"}}, -{"id":"data-layer","key":"data-layer","value":{"rev":"9-9205d35cc6eaf1067ee0cec1b421d749"}}, -{"id":"data-page","key":"data-page","value":{"rev":"3-d7a3346a788a0c07132e50585db11c99"}}, -{"id":"data-section","key":"data-section","value":{"rev":"9-d3fff313977667c53cbadb134d993412"}}, -{"id":"data-uuid","key":"data-uuid","value":{"rev":"8-24001fe9f37c4cc7ac01079ee4767363"}}, -{"id":"data-visitor","key":"data-visitor","value":{"rev":"6-7fe5da9d118fab27157dba97050c6487"}}, -{"id":"database-cleaner","key":"database-cleaner","value":{"rev":"19-4bdfc8b324e95e6da9f72e7b7b708b98"}}, -{"id":"datapool","key":"datapool","value":{"rev":"3-f99c93ca812d2f4725bbaea99122832c"}}, -{"id":"datasift","key":"datasift","value":{"rev":"3-6de3ae25c9a99f651101e191595bcf64"}}, -{"id":"date","key":"date","value":{"rev":"9-b334fc6450d093de40a664a4a835cfc4"}}, -{"id":"date-utils","key":"date-utils","value":{"rev":"31-7be8fcf1919564a8fb7223a86a5954ac"}}, -{"id":"dateformat","key":"dateformat","value":{"rev":"11-5b924e1d29056a0ef9b89b9d7984d5c4"}}, -{"id":"dateformatjs","key":"dateformatjs","value":{"rev":"3-4c50a38ecc493535ee2570a838673937"}}, -{"id":"datejs","key":"datejs","value":{"rev":"5-f47e3e6532817f822aa910b59a45717c"}}, -{"id":"dateselect","key":"dateselect","value":{"rev":"3-ce58def02fd8c8feda8c6f2004726f97"}}, -{"id":"datetime","key":"datetime","value":{"rev":"7-14227b0677eb93b8eb519db47f46bf36"}}, -{"id":"db","key":"db","value":{"rev":"3-636e9ea922a85c92bc11aa9691a2e67f"}}, -{"id":"db-drizzle","key":"db-drizzle","value":{"rev":"157-955f74f49ac4236df317e227c08afaa3"}}, -{"id":"db-mysql","key":"db-mysql","value":{"rev":"224-e596a18d9af33ff1fbcf085a9f4f56fd"}}, -{"id":"db-oracle","key":"db-oracle","value":{"rev":"13-a1e2924d87b4badfddeccf6581525b08"}}, -{"id":"dcrypt","key":"dcrypt","value":{"rev":"29-a144a609bef5004781df901440d67b2d"}}, -{"id":"decafscript","key":"decafscript","value":{"rev":"3-f3a239dc7d503c900fc9854603d716e6"}}, -{"id":"decimal","key":"decimal","value":{"rev":"3-614ed56d4d6c5eb7883d8fd215705a12"}}, -{"id":"decimaljson","key":"decimaljson","value":{"rev":"9-7cb23f4b2b1168b1a213f1eefc85fa51"}}, -{"id":"deck","key":"deck","value":{"rev":"7-da422df97f13c7d84e8f3690c1e1ca32"}}, -{"id":"deckard","key":"deckard","value":{"rev":"3-85e0cd76cdd88ff60a617239060d6f46"}}, -{"id":"deckem","key":"deckem","value":{"rev":"9-03ca75ea35960ccd5779b4cfa8cfb9f9"}}, -{"id":"defensio","key":"defensio","value":{"rev":"5-0ad0ae70b4e184626d914cc4005ee34c"}}, -{"id":"defer","key":"defer","value":{"rev":"3-8d003c96f4263a26b7955e251cddbd95"}}, -{"id":"deferrable","key":"deferrable","value":{"rev":"8-3ae57ce4391105962d09ad619d4c4670"}}, -{"id":"deferred","key":"deferred","value":{"rev":"17-9cee7948dbdf7b6dcc00bbdc60041dd0"}}, -{"id":"define","key":"define","value":{"rev":"45-9d422f2ac5ab693f881df85898d68e3a"}}, -{"id":"deflate","key":"deflate","value":{"rev":"10-3ebe2b87e09f4ae51857cae02e1af788"}}, -{"id":"degrees","key":"degrees","value":{"rev":"5-707c57cfa3e589e8059fe9860cc0c10b"}}, -{"id":"deimos","key":"deimos","value":{"rev":"11-6481696be774d14254fe7c427107dc2a"}}, -{"id":"deja","key":"deja","value":{"rev":"47-bde4457402db895aad46198433842668"}}, -{"id":"delayed-stream","key":"delayed-stream","value":{"rev":"13-f6ca393b08582350f78c5c66f183489b"}}, -{"id":"delegator","key":"delegator","value":{"rev":"3-650651749c1df44ef544c919fae74f82"}}, -{"id":"dep-graph","key":"dep-graph","value":{"rev":"3-e404af87822756da52754e2cc5c576b1"}}, -{"id":"dependency-promise","key":"dependency-promise","value":{"rev":"11-1cc2be8465d736ec8f3cc8940ab22823"}}, -{"id":"depends","key":"depends","value":{"rev":"30-adc9604bbd8117592f82eee923d8703e"}}, -{"id":"deploy","key":"deploy","value":{"rev":"3-82020957528bd0bdd675bed9ac4e4cc5"}}, -{"id":"deployjs","key":"deployjs","value":{"rev":"5-a3e99a5ed81d4b1ad44b6477e6a5a985"}}, -{"id":"deputy-client","key":"deputy-client","value":{"rev":"3-31fd224b301ec0f073df7afa790050ec"}}, -{"id":"deputy-server","key":"deputy-server","value":{"rev":"3-0d790cce82aadfd2b8f39a6b056f2792"}}, -{"id":"derby","key":"derby","value":{"rev":"40-b642048a1a639d77ab139160a4da0fd2"}}, -{"id":"des","key":"des","value":{"rev":"24-fcbdc086e657aef356b75433b3e65ab6"}}, -{"id":"descent","key":"descent","value":{"rev":"7-9cc259b25fc688597fc7efaa516d03c6"}}, -{"id":"describe","key":"describe","value":{"rev":"6-788c7f2feaf2e88f4b1179976b273744"}}, -{"id":"deserver","key":"deserver","value":{"rev":"5-da8083694e89b8434123fe7482a3cc7e"}}, -{"id":"detect","key":"detect","value":{"rev":"3-c27f258d39d7905c2b92383809bb5988"}}, -{"id":"detective","key":"detective","value":{"rev":"9-d6cfa0c6389783cdc9c9ffa9e4082c64"}}, -{"id":"dev","key":"dev","value":{"rev":"23-5c2ce4a4f6a4f24d3cff3b7db997d8bc"}}, -{"id":"dev-warnings","key":"dev-warnings","value":{"rev":"5-5a7d7f36d09893df96441be8b09e41d6"}}, -{"id":"dhcpjs","key":"dhcpjs","value":{"rev":"3-1bc01bd612f3ab1fce178c979aa34e43"}}, -{"id":"dht","key":"dht","value":{"rev":"3-40c0b909b6c0e2305e19d10cea1881b0"}}, -{"id":"dht-bencode","key":"dht-bencode","value":{"rev":"5-88a1da8de312a54097507d72a049f0f3"}}, -{"id":"dialect","key":"dialect","value":{"rev":"18-db7928ce4756eea35db1732d4f2ebc88"}}, -{"id":"dialect-http","key":"dialect-http","value":{"rev":"19-23a927d28cb43733dbd05294134a5b8c"}}, -{"id":"dicks","key":"dicks","value":{"rev":"11-ba64897899e336d366ffd4b68cac99f5"}}, -{"id":"diff","key":"diff","value":{"rev":"13-1a88acb0369ab8ae096a2323d65a2811"}}, -{"id":"diff_match_patch","key":"diff_match_patch","value":{"rev":"8-2f6f467e483b23b217a2047e4aded850"}}, -{"id":"diffbot","key":"diffbot","value":{"rev":"3-8cb8e34af89cb477a5da52e3fd9a13f7"}}, -{"id":"digest","key":"digest","value":{"rev":"7-bc6fb9e68c83197381b0d9ac7db16c1c"}}, -{"id":"dir","key":"dir","value":{"rev":"7-574462bb241a39eeffe6c5184d40c57a"}}, -{"id":"dir-watcher","key":"dir-watcher","value":{"rev":"31-1a3ca4d6aa8aa32c619efad5fbfce494"}}, -{"id":"dir2html","key":"dir2html","value":{"rev":"5-b4bfb2916c2d94c85aa75ffa29ad1af4"}}, -{"id":"directive","key":"directive","value":{"rev":"3-3373f02b8762cb1505c8f8cbcc50d3d4"}}, -{"id":"dirsum","key":"dirsum","value":{"rev":"5-8545445faaa41d2225ec7ff226a10750"}}, -{"id":"dirty","key":"dirty","value":{"rev":"13-d636ea0d1ed35560c0bc7272965c1a6f"}}, -{"id":"dirty-uuid","key":"dirty-uuid","value":{"rev":"5-65acdfda886afca65ae52f0ac21ce1b2"}}, -{"id":"discogs","key":"discogs","value":{"rev":"21-839410e6bf3bee1435ff837daaeaf9f8"}}, -{"id":"discount","key":"discount","value":{"rev":"13-a8fb2a8f668ac0a55fffada1ea94a4b7"}}, -{"id":"discovery","key":"discovery","value":{"rev":"3-46f4496224d132e56cbc702df403219d"}}, -{"id":"diskcache","key":"diskcache","value":{"rev":"23-7b14ad41fc199184fb939828e9122099"}}, -{"id":"dispatch","key":"dispatch","value":{"rev":"6-e72cc7b2bcc97faf897ae4e4fa3ec681"}}, -{"id":"distribute.it","key":"distribute.it","value":{"rev":"12-0978757eb25d22117af675806cf6eef2"}}, -{"id":"dive","key":"dive","value":{"rev":"21-9cbd1281c5a3c2dae0cc0407863f3336"}}, -{"id":"diveSync","key":"diveSync","value":{"rev":"3-015ec4803903106bf24cb4f17cedee68"}}, -{"id":"dk-assets","key":"dk-assets","value":{"rev":"3-25d9b6ac727caf1e227e6436af835d03"}}, -{"id":"dk-core","key":"dk-core","value":{"rev":"3-0b6a2f4dfc0484a3908159a897920bae"}}, -{"id":"dk-couchdb","key":"dk-couchdb","value":{"rev":"3-cc9ef511f9ed46be9d7099f10b1ee776"}}, -{"id":"dk-model","key":"dk-model","value":{"rev":"3-3a61006be57d304724c049e4dcf2fc9b"}}, -{"id":"dk-model-couchdb","key":"dk-model-couchdb","value":{"rev":"3-5163def21660db8428e623909bbfcb4d"}}, -{"id":"dk-routes","key":"dk-routes","value":{"rev":"3-4563357f850248d7d0fb37f9bdcb893b"}}, -{"id":"dk-server","key":"dk-server","value":{"rev":"3-9aef13fc5814785c9805b26828e8d114"}}, -{"id":"dk-template","key":"dk-template","value":{"rev":"3-809c94776252441129705fbe1d93e752"}}, -{"id":"dk-transport","key":"dk-transport","value":{"rev":"3-9271da6f86079027535179b743d0d4c3"}}, -{"id":"dk-websockets","key":"dk-websockets","value":{"rev":"3-426b44c04180d6caf7cf765f03fc52c2"}}, -{"id":"dnet-index-proxy","key":"dnet-index-proxy","value":{"rev":"51-1f3cf4f534c154369d5e774a8f599106"}}, -{"id":"dnode","key":"dnode","value":{"rev":"129-68db10c25c23d635dc828aa698d1279e"}}, -{"id":"dnode-ez","key":"dnode-ez","value":{"rev":"17-75877eab5cf3976b8876c49afd2f7e38"}}, -{"id":"dnode-protocol","key":"dnode-protocol","value":{"rev":"23-fb28f8e1180e6aa44fa564e0d55b3d1e"}}, -{"id":"dnode-smoothiecharts","key":"dnode-smoothiecharts","value":{"rev":"3-d1483028e5768527c2786b9ed5d76463"}}, -{"id":"dnode-stack","key":"dnode-stack","value":{"rev":"9-c1ad8ce01282ce4fa72b5993c580e58e"}}, -{"id":"dnode-worker","key":"dnode-worker","value":{"rev":"3-4c73c0d7ed225197fd8fb0555eaf1152"}}, -{"id":"dns-server","key":"dns-server","value":{"rev":"3-4858a1773da514fea68eac6d9d39f69e"}}, -{"id":"dns-srv","key":"dns-srv","value":{"rev":"12-867c769437fa0ad8a83306aa9e2a158e"}}, -{"id":"doc","key":"doc","value":{"rev":"5-2c077b3fd3b6efa4e927b66f1390e4ea"}}, -{"id":"doc.md","key":"doc.md","value":{"rev":"7-8e8e51be4956550388699222b2e039e7"}}, -{"id":"docco","key":"docco","value":{"rev":"18-891bde1584809c3b1f40fef9961b4f28"}}, -{"id":"docdown","key":"docdown","value":{"rev":"5-fcf5be2ab6ceaed76c1980b462359057"}}, -{"id":"docket","key":"docket","value":{"rev":"13-a4969e0fb17af8dba7df178e364161c2"}}, -{"id":"docpad","key":"docpad","value":{"rev":"77-a478ac8c7ac86e304f9213380ea4b550"}}, -{"id":"docs","key":"docs","value":{"rev":"3-6b1fae9738a3327a3a3be826c0981c3a"}}, -{"id":"dojo-node","key":"dojo-node","value":{"rev":"13-e0dc12e9ce8ab3f40b228c2af8c41064"}}, -{"id":"dom","key":"dom","value":{"rev":"3-cecd9285d0d5b1cab0f18350aac1b2b0"}}, -{"id":"dom-js","key":"dom-js","value":{"rev":"8-dd20e8b23028f4541668501650b52a71"}}, -{"id":"dom-js-ns","key":"dom-js-ns","value":{"rev":"3-787567fc1d6f4ca7e853215a4307b593"}}, -{"id":"domjs","key":"domjs","value":{"rev":"3-d2d05a20dccb57fb6db7da08916c6c0f"}}, -{"id":"doml","key":"doml","value":{"rev":"11-c3b49c50906d9875b546413e4acd1b38"}}, -{"id":"domo","key":"domo","value":{"rev":"3-a4321e6c0c688f773068365b44b08b6b"}}, -{"id":"domready","key":"domready","value":{"rev":"46-21c6b137bbed79ddbff31fdf0ef7d61f"}}, -{"id":"donkey","key":"donkey","value":{"rev":"3-1454aa878654886e8495ebb060aa10f7"}}, -{"id":"dot","key":"dot","value":{"rev":"19-b6d2d53cb9ae1a608a0956aeb8092578"}}, -{"id":"dotaccess","key":"dotaccess","value":{"rev":"13-63ddef6740e84f4517f7dd1bb0d68c56"}}, -{"id":"douche","key":"douche","value":{"rev":"3-6a200f908ccfc9ae549e80209e117cbf"}}, -{"id":"dox","key":"dox","value":{"rev":"10-856cc6bf3dc7c44e028173fea8323c24"}}, -{"id":"drag","key":"drag","value":{"rev":"9-00f27e241269c3df1d71e45b698e9b3b"}}, -{"id":"drain","key":"drain","value":{"rev":"3-8827a0ee7ed74b948bf56d5a33455fc8"}}, -{"id":"drawback","key":"drawback","value":{"rev":"74-dd356b3e55175525317e53c24979a431"}}, -{"id":"drev","key":"drev","value":{"rev":"9-43529419a69529dd7af9a83985aab1f2"}}, -{"id":"drews-mixins","key":"drews-mixins","value":{"rev":"17-63373bae6525859bddfc8d6ad19bdb06"}}, -{"id":"drnu","key":"drnu","value":{"rev":"3-b9b14b2241ded1e52a92fc4225b4ddc5"}}, -{"id":"dropbox","key":"dropbox","value":{"rev":"19-2cb7a40d253621fdfa96f23b96e42ecb"}}, -{"id":"drtoms-nodehelpers","key":"drtoms-nodehelpers","value":{"rev":"3-be0a75cdd7c2d49b1ec4ad1d2c3bc911"}}, -{"id":"drty","key":"drty","value":{"rev":"3-56eabd39b9badfa0af601c5cc64cee2c"}}, -{"id":"drty-facebook","key":"drty-facebook","value":{"rev":"3-fd07af7fb87d7f1d35e13f458a02c127"}}, -{"id":"drumkit","key":"drumkit","value":{"rev":"3-f3cdacef51453d3ac630759aff2a8b58"}}, -{"id":"drupal","key":"drupal","value":{"rev":"13-13835b1e1c8a0e8f0b0e8479640a8d7e"}}, -{"id":"dryice","key":"dryice","value":{"rev":"15-9990fdbde5475a8dbdcc055cb08d654d"}}, -{"id":"dryml","key":"dryml","value":{"rev":"33-483ff8cc3ab1431790cc2587c0bce989"}}, -{"id":"ds","key":"ds","value":{"rev":"9-743274a1d0143927851af07ff0f86d8d"}}, -{"id":"dt","key":"dt","value":{"rev":"3-ab59016f28e182c763b78ba49a59191c"}}, -{"id":"dtl","key":"dtl","value":{"rev":"11-415b4aeec93f096523569615e80f1be1"}}, -{"id":"dtrace-provider","key":"dtrace-provider","value":{"rev":"12-7f01510bd2b1d543f11e3dc02d98ab69"}}, -{"id":"dtrejo","key":"dtrejo","value":{"rev":"3-85f5bb2b9faec499e6aa77fe22e6e3ec"}}, -{"id":"dude","key":"dude","value":{"rev":"3-006528c1efd98312991273ba6ee45f7b"}}, -{"id":"dunce","key":"dunce","value":{"rev":"3-fa4fa5cafdfd1d86c650746f60b7bc0e"}}, -{"id":"duostack","key":"duostack","value":{"rev":"15-47824bdf6e32f49f64014e75421dc42e"}}, -{"id":"duplex-stream","key":"duplex-stream","value":{"rev":"3-2d0e12876e7ad4e5d3ea5520dcbad861"}}, -{"id":"durilka","key":"durilka","value":{"rev":"15-54400496515c8625e8bedf19f8a41cad"}}, -{"id":"dust","key":"dust","value":{"rev":"18-9bc9cae2e48c54f4389e9fce5dfc021e"}}, -{"id":"dustfs","key":"dustfs","value":{"rev":"5-944770c24f06989f3fc62427f2ddebc4"}}, -{"id":"dx","key":"dx","value":{"rev":"3-6000afd60be07d9ff91e7231a388f22f"}}, -{"id":"dynamic","key":"dynamic","value":{"rev":"3-33b83464ed56eb33c052a13dfb709c9c"}}, -{"id":"dynobj","key":"dynobj","value":{"rev":"5-3eb168dae1f9c20369fa1d5ae45f9021"}}, -{"id":"each","key":"each","value":{"rev":"3-5063799b0afcbb61378b1d605660a864"}}, -{"id":"ears","key":"ears","value":{"rev":"11-e77cd2b865409be7ba2e072e98b1c8a1"}}, -{"id":"easey","key":"easey","value":{"rev":"3-a380d8d945e03f55732ae8769cd6dbbf"}}, -{"id":"easy","key":"easy","value":{"rev":"3-73b836a34beafa31cdd8129fe158bf6e"}}, -{"id":"easy-oauth","key":"easy-oauth","value":{"rev":"5-2c1db698e61d77f99633042113099528"}}, -{"id":"easyfs","key":"easyfs","value":{"rev":"3-b807671a77c2a8cc27a9f1aa20ff74c0"}}, -{"id":"easyhash","key":"easyhash","value":{"rev":"3-2eeb24098bc4d201766dcc92dc7325f7"}}, -{"id":"easyrss","key":"easyrss","value":{"rev":"9-1687a54348670ef9ca387ea7ec87f0be"}}, -{"id":"ebnf-diagram","key":"ebnf-diagram","value":{"rev":"3-704e4605bf933b281a6821259a531055"}}, -{"id":"ec2","key":"ec2","value":{"rev":"22-25e562ae8898807c7b4c696c809cf387"}}, -{"id":"echo","key":"echo","value":{"rev":"19-75c2421f623ecc9fe2771f3658589ce8"}}, -{"id":"eco","key":"eco","value":{"rev":"14-b4db836928c91cbf22628cc65ca94f56"}}, -{"id":"ed","key":"ed","value":{"rev":"3-bed9b8225e83a02241d48254077a7df4"}}, -{"id":"edate","key":"edate","value":{"rev":"3-5ec1441ffe3b56d5d01561003b9844f2"}}, -{"id":"eden","key":"eden","value":{"rev":"35-9aa2ff880c2d4f45e3da881b15e58d0a"}}, -{"id":"eio","key":"eio","value":{"rev":"5-e6dd895635596d826ccdf4439761d5fa"}}, -{"id":"ejs","key":"ejs","value":{"rev":"30-c7b020b6cb8ee2626f47db21fc5fedb4"}}, -{"id":"ejs-ext","key":"ejs-ext","value":{"rev":"15-820393685191bbed37938acb7af5885e"}}, -{"id":"elastical","key":"elastical","value":{"rev":"3-c652af043bc4256a29a87e3de9b78093"}}, -{"id":"elasticsearchclient","key":"elasticsearchclient","value":{"rev":"33-bcb59deb7d9d56737a6946c56830ae6b"}}, -{"id":"elastiseahclient","key":"elastiseahclient","value":{"rev":"3-c4e525605859e249f04fb07d31739002"}}, -{"id":"elementtree","key":"elementtree","value":{"rev":"3-ef2017fe67ae425253de911c2f219d31"}}, -{"id":"elf-logger","key":"elf-logger","value":{"rev":"6-98d61588cfc171611568cf86004aa2e1"}}, -{"id":"elk","key":"elk","value":{"rev":"25-8b92241d0218c6593a7dc8a8cc69b7ce"}}, -{"id":"elucidata-build-tools","key":"elucidata-build-tools","value":{"rev":"7-0ad3de708aaac2eebfcfce273bfe6edf"}}, -{"id":"email","key":"email","value":{"rev":"16-110ae6a99ab3e37f4edd9357c03d78c2"}}, -{"id":"email-verificationtoken","key":"email-verificationtoken","value":{"rev":"7-ef37672bc6e9ee806ecc22fd5257ae03"}}, -{"id":"emailjs","key":"emailjs","value":{"rev":"31-0dd24f9aba8d96e9493e55e8345f3d21"}}, -{"id":"embedly","key":"embedly","value":{"rev":"21-47838d8015e9b927c56a7bd52c52e4fc"}}, -{"id":"emile","key":"emile","value":{"rev":"11-05d4715964b5bf2e1fd98096cb7ccc83"}}, -{"id":"emit.io","key":"emit.io","value":{"rev":"3-faacb1c30bb92c06a55a44bb027a9475"}}, -{"id":"emre","key":"emre","value":{"rev":"3-5686f4782f1f5171fff83b662ce68802"}}, -{"id":"encrypt","key":"encrypt","value":{"rev":"3-77e2e2007b452f7fcdfa9e8696a188f5"}}, -{"id":"ender","key":"ender","value":{"rev":"95-89b8c6ccfcaf3eb56f5dbe48bf3c2e24"}}, -{"id":"ender-dragdealer","key":"ender-dragdealer","value":{"rev":"9-e12bb3492614f20fe5781f20e3bb17dc"}}, -{"id":"ender-fermata","key":"ender-fermata","value":{"rev":"3-e52d772042852408ae070b361c247068"}}, -{"id":"ender-fittext","key":"ender-fittext","value":{"rev":"5-e46f5a384d790ea6f65a5f8b9e43bac6"}}, -{"id":"ender-flowplayer","key":"ender-flowplayer","value":{"rev":"3-87267072fb566112315254fdf6547500"}}, -{"id":"ender-js","key":"ender-js","value":{"rev":"80-aa18576f782e3aa14c2ba7ba05658a30"}}, -{"id":"ender-json","key":"ender-json","value":{"rev":"3-5606608389aef832e4d4ecaa6c088a94"}}, -{"id":"ender-lettering","key":"ender-lettering","value":{"rev":"3-6fc6ad3869fad6374a1de69ba4e9301d"}}, -{"id":"ender-modules","key":"ender-modules","value":{"rev":"5-2bbb354d6219b5e13e6c897c562b8c83"}}, -{"id":"ender-poke","key":"ender-poke","value":{"rev":"5-3afa2fd690ebc4f2d75125b2c57e2a43"}}, -{"id":"ender-test","key":"ender-test","value":{"rev":"5-f8e90a951e5ad58199e53645067fad0c"}}, -{"id":"ender-tipsy","key":"ender-tipsy","value":{"rev":"5-cefd04c5d89707dfe31023702328d417"}}, -{"id":"ender-tween","key":"ender-tween","value":{"rev":"13-035312bb47bb3d29e7157932d4d29dcb"}}, -{"id":"ender-vows","key":"ender-vows","value":{"rev":"5-d48e088816d71779a80a74c43cd61b80"}}, -{"id":"ender-wallet","key":"ender-wallet","value":{"rev":"21-93723cd24fbf14d0f58f2ee41df9910d"}}, -{"id":"endtable","key":"endtable","value":{"rev":"36-8febf1be0120d867f9ff90e5c5058ef9"}}, -{"id":"enhance-css","key":"enhance-css","value":{"rev":"7-ae1cf6dee7d3116103781edaa7d47ba4"}}, -{"id":"ensure","key":"ensure","value":{"rev":"27-47e0874d1823188965a02a41abb61739"}}, -{"id":"ent","key":"ent","value":{"rev":"9-51924cd76fabcc4a244db66d65d48eff"}}, -{"id":"entropy","key":"entropy","value":{"rev":"17-84bfbbc0689b3b55e4fa3881888f0c12"}}, -{"id":"enumerable","key":"enumerable","value":{"rev":"3-d31bfcaca3b53eacc9ce09983efffe35"}}, -{"id":"envious","key":"envious","value":{"rev":"3-08d1e6d9c25c4e2350a0dd6759a27426"}}, -{"id":"environ","key":"environ","value":{"rev":"5-6f78def4743dfbeb77c1cb62d41eb671"}}, -{"id":"epub","key":"epub","value":{"rev":"3-5c3604eab851bce0a6ac66db6a6ce77a"}}, -{"id":"erlang","key":"erlang","value":{"rev":"3-3bd8e8e8ed416a32567475d984028b65"}}, -{"id":"err","key":"err","value":{"rev":"11-61d11f26b47d29ef819136214830f24c"}}, -{"id":"errbacker","key":"errbacker","value":{"rev":"5-0ad6d62207abb9822118ae69d0b9181d"}}, -{"id":"es5","key":"es5","value":{"rev":"3-5497cb0c821f3e17234c09ab0e67e1de"}}, -{"id":"es5-basic","key":"es5-basic","value":{"rev":"9-2ff708ae54ae223923cb810f799bfb2d"}}, -{"id":"es5-ext","key":"es5-ext","value":{"rev":"21-04537d704412a631596beeba4d534b33"}}, -{"id":"es5-shim","key":"es5-shim","value":{"rev":"34-3c4c40a6dab9ff137d1a7d4349d72c5b"}}, -{"id":"es5-shimify","key":"es5-shimify","value":{"rev":"3-f85700407e9c129d22b45c15700c82f1"}}, -{"id":"esc","key":"esc","value":{"rev":"5-42911775f391330f361105b8a0cefe47"}}, -{"id":"escaperoute","key":"escaperoute","value":{"rev":"18-e1372f35e6dcdb353b8c11e3c7e2f3b4"}}, -{"id":"escort","key":"escort","value":{"rev":"27-bf43341e15d565c9f67dd3300dc57734"}}, -{"id":"escrito","key":"escrito","value":{"rev":"5-c39d5b373486327b2e13670f921a2c7b"}}, -{"id":"esl","key":"esl","value":{"rev":"9-562ff6239a3b9910989bdf04746fa9d1"}}, -{"id":"espresso","key":"espresso","value":{"rev":"75-4c3692f1e92ea841e2d04338f4f2432e"}}, -{"id":"esproxy","key":"esproxy","value":{"rev":"7-be629dc6e1428f0fdb22fdbe7ab2ee99"}}, -{"id":"etch-a-sketch","key":"etch-a-sketch","value":{"rev":"3-a4e23b8e9f298d4844d6bff0a9688e53"}}, -{"id":"etherpad-lite-client","key":"etherpad-lite-client","value":{"rev":"55-58ca439a697db64ee66652da2d327fcb"}}, -{"id":"etsy","key":"etsy","value":{"rev":"5-1b795b360c28261f11c07d849637047c"}}, -{"id":"eve","key":"eve","value":{"rev":"3-16e72b336a1f354f4dfc8fa783fa2e72"}}, -{"id":"event-emitter","key":"event-emitter","value":{"rev":"5-15fe3e2e19b206929b815909737b15ac"}}, -{"id":"event-queue","key":"event-queue","value":{"rev":"12-200cd3bcd8e0b35bc4b15c1d8b6161e2"}}, -{"id":"event-stream","key":"event-stream","value":{"rev":"15-811a6329b5820d998731a604accf83db"}}, -{"id":"eventable","key":"eventable","value":{"rev":"3-08e9cd94a9aae280f406d043039e545e"}}, -{"id":"eventbrite","key":"eventbrite","value":{"rev":"13-cac3c9bda2da1c7b115de04264bb440f"}}, -{"id":"evented","key":"evented","value":{"rev":"6-ade6271c40a19aab6c4e3bb18b0987b6"}}, -{"id":"evented-twitter","key":"evented-twitter","value":{"rev":"6-3ebb7327022d6d6a8c49d684febb236b"}}, -{"id":"eventedsocket","key":"eventedsocket","value":{"rev":"59-cd2158c47b676a58ca3064a42c5274f7"}}, -{"id":"eventemitter","key":"eventemitter","value":{"rev":"5-7766fd7ebc44d52efbd0e7088e2321ec"}}, -{"id":"eventemitter2","key":"eventemitter2","value":{"rev":"41-927ce7996d4056a21f543e1f928f9699"}}, -{"id":"eventful","key":"eventful","value":{"rev":"7-9505f3c621f50addf02a457cfcc8ae78"}}, -{"id":"eventhub","key":"eventhub","value":{"rev":"15-5390d210a4d3ba079dd6e26bda652caa"}}, -{"id":"eventpipe","key":"eventpipe","value":{"rev":"7-41f0f93a9dcea477f08782af28e5b0f1"}}, -{"id":"events","key":"events","value":{"rev":"12-e3ead8eac62799cb299c139687135289"}}, -{"id":"events.io","key":"events.io","value":{"rev":"3-56c6955024cbb1765a1f9f37d8a739a4"}}, -{"id":"events.node","key":"events.node","value":{"rev":"3-e072f9c457fd8a3882ccd41ce52c5d00"}}, -{"id":"eventstream","key":"eventstream","value":{"rev":"5-a578a3a2a62d50631b3fb4d44a058bd1"}}, -{"id":"eventvat","key":"eventvat","value":{"rev":"3-e26d7fe8a226c7bc7f9e55abf1630e9c"}}, -{"id":"everyauth","key":"everyauth","value":{"rev":"107-a621f3028a230f9f3ade6a4e729a9a38"}}, -{"id":"ewdDOM","key":"ewdDOM","value":{"rev":"7-28188ec27fe011bf7fcb330a5fc90b55"}}, -{"id":"ewdGateway","key":"ewdGateway","value":{"rev":"7-81fe5ec1a3e920894b560fbf96160258"}}, -{"id":"exceptional","key":"exceptional","value":{"rev":"5-5842d306b2cf084c4e7c2ecb1d715280"}}, -{"id":"exceptional-node","key":"exceptional-node","value":{"rev":"5-3385b42af0a6ea8a943cb686d5789b0c"}}, -{"id":"executor","key":"executor","value":{"rev":"3-aee4f949a4d140a439965e137200c4fb"}}, -{"id":"exif","key":"exif","value":{"rev":"3-da6fd2bd837633f673b325231c164a0f"}}, -{"id":"expanda","key":"expanda","value":{"rev":"3-dcbc59c5db0017d25748ec8094aeeb0a"}}, -{"id":"express","key":"express","value":{"rev":"157-24ef0cdd4ba6c6697c66f3e78bc777bb"}}, -{"id":"express-aid","key":"express-aid","value":{"rev":"21-6d3831e93b823f800e6a22eb08aa41d6"}}, -{"id":"express-app-bootstrap","key":"express-app-bootstrap","value":{"rev":"3-4b5a256bef5ca3bd41b0958f594907b9"}}, -{"id":"express-asset","key":"express-asset","value":{"rev":"3-7d5e23bc753851c576e429e7901301d9"}}, -{"id":"express-blocks","key":"express-blocks","value":{"rev":"7-305b6e046355c8e7a4bb0f1f225092ef"}}, -{"id":"express-cache","key":"express-cache","value":{"rev":"5-eebbea6c0e5db5fd4c12847933c853e1"}}, -{"id":"express-chromeframe","key":"express-chromeframe","value":{"rev":"5-1bb72d30b7a1f00d3eaf248285942d5e"}}, -{"id":"express-coffee","key":"express-coffee","value":{"rev":"39-14eff195c9352c6c3898befb3d613807"}}, -{"id":"express-config","key":"express-config","value":{"rev":"3-27ea0d27e20afa9ece375878aab846ed"}}, -{"id":"express-configure","key":"express-configure","value":{"rev":"7-46bd636c0b56dfcfa4f1ee46b43d6ca0"}}, -{"id":"express-contrib","key":"express-contrib","value":{"rev":"20-472c93fefe0a9a6440a76b2c843b2e0e"}}, -{"id":"express-controllers","key":"express-controllers","value":{"rev":"3-296d54f3b5bf26bfa057cd8c5f0a11ea"}}, -{"id":"express-controllers-new","key":"express-controllers-new","value":{"rev":"15-11f73e4a8ab935987a3b8f132d80afa5"}}, -{"id":"express-cross-site","key":"express-cross-site","value":{"rev":"11-b76814fdd58a616b3cafe6e97f3c7c98"}}, -{"id":"express-csrf","key":"express-csrf","value":{"rev":"20-2a79f0fdc65ed91120e7417a5cf8ce6c"}}, -{"id":"express-custom-errors","key":"express-custom-errors","value":{"rev":"6-bd131169ccac73fa3766195147e34404"}}, -{"id":"express-dialect","key":"express-dialect","value":{"rev":"34-1fbc5baf7ea464abbadcfaf3c1971660"}}, -{"id":"express-dust","key":"express-dust","value":{"rev":"5-33a1d8dd9c113d6fb8f1818c8a749c1b"}}, -{"id":"express-expose","key":"express-expose","value":{"rev":"7-f8757d8bf8d3fac8395ee8ce5117a895"}}, -{"id":"express-extras","key":"express-extras","value":{"rev":"6-53c7bfc68a41043eb5e11321673a2c48"}}, -{"id":"express-form","key":"express-form","value":{"rev":"27-533598a1bd5a0e9b8d694f5b38228c6c"}}, -{"id":"express-helpers","key":"express-helpers","value":{"rev":"3-7b9123b0ea6b840bb5a6e4da9c28308c"}}, -{"id":"express-livejade","key":"express-livejade","value":{"rev":"9-1320996d4ed3db352a2c853226880a17"}}, -{"id":"express-logger","key":"express-logger","value":{"rev":"5-c485b1020742310a313cac87abdde67b"}}, -{"id":"express-messages","key":"express-messages","value":{"rev":"5-f6225b906d0ac33ba1bfc5409b227edb"}}, -{"id":"express-messages-bootstrap","key":"express-messages-bootstrap","value":{"rev":"5-fb8fc70c1cbd6df0e07b2e0148bdf8bf"}}, -{"id":"express-mongoose","key":"express-mongoose","value":{"rev":"29-2d6907a23c8c3bbfdf9b6f9b6b3c00e3"}}, -{"id":"express-mvc-bootstrap","key":"express-mvc-bootstrap","value":{"rev":"15-c53ecb696af1d34ff94efe5ab5d89287"}}, -{"id":"express-namespace","key":"express-namespace","value":{"rev":"7-d209feb707821b06426aed233295df75"}}, -{"id":"express-on-railway","key":"express-on-railway","value":{"rev":"7-784b533cbf29930d04039bafb2c03cc0"}}, -{"id":"express-params","key":"express-params","value":{"rev":"3-13f0ed9c17d10fd01d1ff869e625c91f"}}, -{"id":"express-resource","key":"express-resource","value":{"rev":"13-cca556327152588a87112c6bf2613bc9"}}, -{"id":"express-rewrite","key":"express-rewrite","value":{"rev":"7-c76ca2616eb6e70209ace6499f5b961a"}}, -{"id":"express-route-util","key":"express-route-util","value":{"rev":"9-4b7bad7e8ab3bf71daf85362b47ec8be"}}, -{"id":"express-rpx","key":"express-rpx","value":{"rev":"9-54d48f5e24174500c73f07d97a7d3f9f"}}, -{"id":"express-session-mongo","key":"express-session-mongo","value":{"rev":"3-850cf5b42f65a6f27af6edf1ad1aa966"}}, -{"id":"express-session-mongo-russp","key":"express-session-mongo-russp","value":{"rev":"7-441e8afcd466a4cbb5e65a1949190f97"}}, -{"id":"express-session-redis","key":"express-session-redis","value":{"rev":"6-5f4f16092a0706d2daef89470d6971e6"}}, -{"id":"express-share","key":"express-share","value":{"rev":"5-f5327a97738e9c8e6e05a51cb7153f82"}}, -{"id":"express-spdy","key":"express-spdy","value":{"rev":"11-2634f388338c45b2d6f020d2a6739ba1"}}, -{"id":"express-template-override","key":"express-template-override","value":{"rev":"5-758cf2eb0c9cbc32f205c4ba2ece24f9"}}, -{"id":"express-trace","key":"express-trace","value":{"rev":"5-ba59571f8881e02e2b297ed9ffb4e48c"}}, -{"id":"express-unstable","key":"express-unstable","value":{"rev":"3-06467336e1610ba9915401df26c936c1"}}, -{"id":"express-validate","key":"express-validate","value":{"rev":"15-b63bd9b18fadfc2345d0a10a7a2fb2e7"}}, -{"id":"express-view-helpers","key":"express-view-helpers","value":{"rev":"7-4d07ba11f81788783c6f9fd48fdf8834"}}, -{"id":"express-with-ease","key":"express-with-ease","value":{"rev":"3-604d9176a4a03f9f7c74679604c7bbf9"}}, -{"id":"express-wormhole","key":"express-wormhole","value":{"rev":"3-7e06cf63b070e0f54b2aa71b48db9a40"}}, -{"id":"expresso","key":"expresso","value":{"rev":"79-a27b6ef2f9e7bb9f85da34f728d124a8"}}, -{"id":"expressobdd","key":"expressobdd","value":{"rev":"5-e8cae7a17a9e8c1779c08abedc674e03"}}, -{"id":"ext","key":"ext","value":{"rev":"6-8790c06324c5f057b1713ba420e8bf27"}}, -{"id":"extend","key":"extend","value":{"rev":"3-934d0de77bbaefb1b52ec18a17f46d7d"}}, -{"id":"extendables","key":"extendables","value":{"rev":"11-e4db9b62a4047e95fb4d7f88e351a14e"}}, -{"id":"extjs-node","key":"extjs-node","value":{"rev":"3-2b2033dbbf0b99d41e876498886b0995"}}, -{"id":"extractcontent","key":"extractcontent","value":{"rev":"6-ad70764c834ecd3414cbc15dbda317c3"}}, -{"id":"extractor","key":"extractor","value":{"rev":"9-f95bde04bb8db37350c9cc95c5578c03"}}, -{"id":"extx-layout","key":"extx-layout","value":{"rev":"3-f6bbc3a923ebce17f62cbf382b096ac7"}}, -{"id":"extx-reference-slot","key":"extx-reference-slot","value":{"rev":"14-b1b92573492f7239144693ee9e1d1aac"}}, -{"id":"extx-shotenjin","key":"extx-shotenjin","value":{"rev":"5-c641121ba57fb960d8db766511ecf6cd"}}, -{"id":"eyes","key":"eyes","value":{"rev":"16-fab6b201646fb12986e396c33a7cd428"}}, -{"id":"f","key":"f","value":{"rev":"3-23b73ffafbe5b56b6a0736db6a7256a6"}}, -{"id":"f-core","key":"f-core","value":{"rev":"3-9a6898e007acf48d956f0a70ff07a273"}}, -{"id":"f7u12rl","key":"f7u12rl","value":{"rev":"3-7b5e15d106db8b7f8784b27f7d2c9bdc"}}, -{"id":"fab","key":"fab","value":{"rev":"10-149dec0b653ce481af013c63fec125e8"}}, -{"id":"fab.accept","key":"fab.accept","value":{"rev":"6-d6b08e7054d823906c6c64c92b008d3a"}}, -{"id":"fab.static","key":"fab.static","value":{"rev":"6-5bdb6db53223bb5203ba91a5b2b87566"}}, -{"id":"fabric","key":"fabric","value":{"rev":"15-30e99e486c58962c049bea54e00b7cb9"}}, -{"id":"face-detect","key":"face-detect","value":{"rev":"3-d4d3f1a894c807f79ba541d2f2ed630d"}}, -{"id":"facebook","key":"facebook","value":{"rev":"17-e241999000e34aed62ee0f9f358bfd06"}}, -{"id":"facebook-api","key":"facebook-api","value":{"rev":"5-cb9d07b2eba18d8fb960768d69f80326"}}, -{"id":"facebook-client","key":"facebook-client","value":{"rev":"17-84c106420b183ca791b0c80fd8c3fe00"}}, -{"id":"facebook-connect","key":"facebook-connect","value":{"rev":"6-471f28bb12928e32610d02c0b03aa972"}}, -{"id":"facebook-express","key":"facebook-express","value":{"rev":"11-6e6d98b8252907b05c41aac7e0418f4e"}}, -{"id":"facebook-graph","key":"facebook-graph","value":{"rev":"9-c92149825fef42ad76bcffdd232cc9a5"}}, -{"id":"facebook-graph-client","key":"facebook-graph-client","value":{"rev":"10-c3136a2b2e5c5d80b78404a4102af7b5"}}, -{"id":"facebook-js","key":"facebook-js","value":{"rev":"22-dd9d916550ebccb71e451acbd7a4b315"}}, -{"id":"facebook-realtime-graph","key":"facebook-realtime-graph","value":{"rev":"6-c4fe01ac036585394cd59f01c6fc7df1"}}, -{"id":"facebook-sdk","key":"facebook-sdk","value":{"rev":"21-77daf7eba51bb913e54381995718e13d"}}, -{"id":"facebook-session-cookie","key":"facebook-session-cookie","value":{"rev":"9-70e14cac759dacadacb0af17387ab230"}}, -{"id":"facebook-signed-request","key":"facebook-signed-request","value":{"rev":"5-11cb36123a94e37fff6a7efd6f7d88b9"}}, -{"id":"facebook.node","key":"facebook.node","value":{"rev":"3-f6760795e71c1d5734ae34f9288d02be"}}, -{"id":"factory-worker","key":"factory-worker","value":{"rev":"7-1c365b3dd92b12573d00c08b090e01ae"}}, -{"id":"fake","key":"fake","value":{"rev":"25-2d1ae2299168d95edb8d115fb7961c8e"}}, -{"id":"fake-queue","key":"fake-queue","value":{"rev":"7-d6970de6141c1345c6ad3cd1586cfe7b"}}, -{"id":"fakedb","key":"fakedb","value":{"rev":"34-889fb5c9fa328b536f9deb138ff125b1"}}, -{"id":"fakeweb","key":"fakeweb","value":{"rev":"3-7fb1394b4bac70f9ab26e60b1864b41f"}}, -{"id":"fanfeedr","key":"fanfeedr","value":{"rev":"22-de3d485ad60c8642eda260afe5620973"}}, -{"id":"fantomex","key":"fantomex","value":{"rev":"3-79b26bcf9aa365485ed8131c474bf6f8"}}, -{"id":"far","key":"far","value":{"rev":"19-c8d9f1e8bc12a31cb27bef3ed44759ce"}}, -{"id":"farm","key":"farm","value":{"rev":"31-ab77f7f48b24bf6f0388b926d2ac370b"}}, -{"id":"fast-detective","key":"fast-detective","value":{"rev":"5-b0b6c8901458f3f07044d4266db0aa52"}}, -{"id":"fast-msgpack-rpc","key":"fast-msgpack-rpc","value":{"rev":"7-b2dfd3d331459382fe1e8166288ffef6"}}, -{"id":"fast-or-slow","key":"fast-or-slow","value":{"rev":"13-4118190cd6a0185af8ea9b381ee2bc98"}}, -{"id":"fast-stats","key":"fast-stats","value":{"rev":"3-15cdd56d9efa38f08ff20ca731867d4d"}}, -{"id":"fastcgi-stream","key":"fastcgi-stream","value":{"rev":"5-99c0c4dfc7a874e1af71e5ef3ac95ba4"}}, -{"id":"faye","key":"faye","value":{"rev":"30-49b7d05534c35527972a4d5e07ac8895"}}, -{"id":"faye-service","key":"faye-service","value":{"rev":"3-bad8bf6722461627eac7d0141e09b3f7"}}, -{"id":"fe-fu","key":"fe-fu","value":{"rev":"21-f3cb04870621ce40da8ffa009686bdeb"}}, -{"id":"feed-tables","key":"feed-tables","value":{"rev":"9-4410bad138f4df570e7be37bb17209b3"}}, -{"id":"feedBum","key":"feedBum","value":{"rev":"3-b4ff9edffb0c5c33c4ed40f60a12611a"}}, -{"id":"feedparser","key":"feedparser","value":{"rev":"5-eb2c32e00832ed7036eb1b87d2eea33e"}}, -{"id":"feral","key":"feral","value":{"rev":"19-0b512b6301a26ca5502710254bd5a9ba"}}, -{"id":"fermata","key":"fermata","value":{"rev":"25-eeafa3e5b769a38b8a1065c0a66e0653"}}, -{"id":"ferret","key":"ferret","value":{"rev":"9-7ab6b29cb0cad9855d927855c2a27bff"}}, -{"id":"ffmpeg-node","key":"ffmpeg-node","value":{"rev":"3-e55011ecb147f599475a12b10724a583"}}, -{"id":"ffmpeg2theora","key":"ffmpeg2theora","value":{"rev":"13-05d2f83dbbb90e832176ebb7fdc2ae2e"}}, -{"id":"fiberize","key":"fiberize","value":{"rev":"5-dfb978d6b88db702f68a13e363fb21af"}}, -{"id":"fibers","key":"fibers","value":{"rev":"71-4b22dbb449839723ed9b0d533339c764"}}, -{"id":"fibers-promise","key":"fibers-promise","value":{"rev":"9-3a9977528f8df079969d4ae48db7a0a7"}}, -{"id":"fidel","key":"fidel","value":{"rev":"37-370838ed9984cfe6807114b5fef789e6"}}, -{"id":"fig","key":"fig","value":{"rev":"7-24acf90e7d06dc8b83adb02b5776de3c"}}, -{"id":"file","key":"file","value":{"rev":"6-1131008db6855f20969413be7cc2e968"}}, -{"id":"file-api","key":"file-api","value":{"rev":"9-a9cc8f3de14eef5bba86a80f6705651c"}}, -{"id":"fileify","key":"fileify","value":{"rev":"17-50603c037d5e3a0a405ff4af3e71211f"}}, -{"id":"filepad","key":"filepad","value":{"rev":"23-8c4b2c04151723033523369c42144cc9"}}, -{"id":"filerepl","key":"filerepl","value":{"rev":"5-94999cc91621e08f96ded7423ed6d6f0"}}, -{"id":"fileset","key":"fileset","value":{"rev":"3-ea6a9f45aaa5e65279463041ee629dbe"}}, -{"id":"filestore","key":"filestore","value":{"rev":"9-6cce7c9cd2b2b11d12905885933ad25a"}}, -{"id":"filesystem-composer","key":"filesystem-composer","value":{"rev":"34-f1d04d711909f3683c1d00cd4ab7ca47"}}, -{"id":"fileutils","key":"fileutils","value":{"rev":"3-88876b61c9d0a915f95ce0f258e5ce51"}}, -{"id":"filter","key":"filter","value":{"rev":"3-4032087a5cf2de3dd164c95454a2ab05"}}, -{"id":"filter-chain","key":"filter-chain","value":{"rev":"5-c522429dc83ccc7dde4eaf5409070332"}}, -{"id":"fin","key":"fin","value":{"rev":"23-77cf12e84eb62958b40aa08fdcbb259d"}}, -{"id":"fin-id","key":"fin-id","value":{"rev":"3-9f85ee1e426d4bdad5904002a6d9342c"}}, -{"id":"finance","key":"finance","value":{"rev":"3-cf97ddb6af3f6601bfb1e49a600f56af"}}, -{"id":"finder","key":"finder","value":{"rev":"13-65767fe51799a397ddd9b348ead12ed2"}}, -{"id":"findit","key":"findit","value":{"rev":"15-435e4168208548a2853f6efcd4529de3"}}, -{"id":"fingerprint","key":"fingerprint","value":{"rev":"3-c40e2169260010cac472e688c392ea3d"}}, -{"id":"finjector","key":"finjector","value":{"rev":"5-646da199b0b336d20e421ef6ad613e90"}}, -{"id":"firebird","key":"firebird","value":{"rev":"5-7e7ec03bc00e562f5f7afc7cad76da77"}}, -{"id":"firmata","key":"firmata","value":{"rev":"20-f3cbde43ce2677a208bcf3599af5b670"}}, -{"id":"first","key":"first","value":{"rev":"3-c647f6fc1353a1c7b49f5e6cd1905b1e"}}, -{"id":"fishback","key":"fishback","value":{"rev":"19-27a0fdc8c3abe4d61fff9c7a098f3fd9"}}, -{"id":"fitbit-js","key":"fitbit-js","value":{"rev":"3-62fe0869ddefd2949d8c1e568f994c93"}}, -{"id":"fix","key":"fix","value":{"rev":"17-4a79db9924922da010df71e5194bcac6"}}, -{"id":"flagpoll","key":"flagpoll","value":{"rev":"3-0eb7b98e2a0061233aa5228eb7348dff"}}, -{"id":"flags","key":"flags","value":{"rev":"3-594f0ec2e903ac74556d1c1f7c6cca3b"}}, -{"id":"flexcache","key":"flexcache","value":{"rev":"11-e1e4eeaa0793d95056a857bec04282ae"}}, -{"id":"flickr-conduit","key":"flickr-conduit","value":{"rev":"7-d3b2b610171589db68809c3ec3bf2bcb"}}, -{"id":"flickr-js","key":"flickr-js","value":{"rev":"5-66c8e8a00ad0a906f632ff99cf490163"}}, -{"id":"flickr-reflection","key":"flickr-reflection","value":{"rev":"6-3c34c3ac904b6d6f26182807fbb95c5e"}}, -{"id":"flo","key":"flo","value":{"rev":"3-ce440035f0ec9a10575b1c8fab0c77da"}}, -{"id":"flow","key":"flow","value":{"rev":"6-95841a07c96f664d49d1af35373b3dbc"}}, -{"id":"flowcontrol","key":"flowcontrol","value":{"rev":"3-093bbbc7496072d9ecb136a826680366"}}, -{"id":"flowjs","key":"flowjs","value":{"rev":"3-403fc9e107ec70fe06236c27e70451c7"}}, -{"id":"fluent-ffmpeg","key":"fluent-ffmpeg","value":{"rev":"33-5982779d5f55a5915f0f8b0353f1fe2a"}}, -{"id":"flume-rpc","key":"flume-rpc","value":{"rev":"7-4214a2db407a3e64f036facbdd34df91"}}, -{"id":"flux","key":"flux","value":{"rev":"3-1ad83106af7ee83547c797246bd2c8b1"}}, -{"id":"fly","key":"fly","value":{"rev":"9-0a45b1b97f56ba0faf4af4777b473fad"}}, -{"id":"fn","key":"fn","value":{"rev":"5-110bab5d623b3628e413d972e040ed26"}}, -{"id":"fnProxy","key":"fnProxy","value":{"rev":"3-db1c90e5a06992ed290c679ac6dbff6a"}}, -{"id":"follow","key":"follow","value":{"rev":"3-44256c802b4576fcbae1264e9b824e6a"}}, -{"id":"fomatto","key":"fomatto","value":{"rev":"7-31ce5c9eba7f084ccab2dc5994796f2d"}}, -{"id":"foounit","key":"foounit","value":{"rev":"20-caf9cd90d6c94d19be0b3a9c9cb33ee0"}}, -{"id":"forEachAsync","key":"forEachAsync","value":{"rev":"3-d9cd8021ea9d5014583327752a9d01c4"}}, -{"id":"forever","key":"forever","value":{"rev":"99-90060d5d1754b1bf749e5278a2a4516b"}}, -{"id":"forge","key":"forge","value":{"rev":"9-0d9d59fd2d47a804e600aaef538ebbbf"}}, -{"id":"fork","key":"fork","value":{"rev":"13-f355105e07608de5ae2f3e7c0817af52"}}, -{"id":"forker","key":"forker","value":{"rev":"11-9717e2e3fa60b46df08261d936d9e5d7"}}, -{"id":"form-data","key":"form-data","value":{"rev":"3-5750e73f7a0902ec2fafee1db6d2e6f6"}}, -{"id":"form-validator","key":"form-validator","value":{"rev":"25-7d016b35895dc58ffd0bbe54fd9be241"}}, -{"id":"form2json","key":"form2json","value":{"rev":"8-7501dd9b43b9fbb7194b94e647816e5e"}}, -{"id":"formaline","key":"formaline","value":{"rev":"3-2d45fbb3e83b7e77bde0456607e6f1e3"}}, -{"id":"format","key":"format","value":{"rev":"7-5dddc67c10de521ef06a7a07bb3f7e2e"}}, -{"id":"formatdate","key":"formatdate","value":{"rev":"3-6d522e3196fe3b438fcc4aed0f7cf690"}}, -{"id":"formidable","key":"formidable","value":{"rev":"87-d27408b00793fee36f6632a895372590"}}, -{"id":"forms","key":"forms","value":{"rev":"6-253e032f07979b79c2e7dfa01be085dc"}}, -{"id":"forrst","key":"forrst","value":{"rev":"3-ef553ff1b6383bab0f81f062cdebac53"}}, -{"id":"fortumo","key":"fortumo","value":{"rev":"6-def3d146b29b6104019c513ce20bb61f"}}, -{"id":"foss-credits","key":"foss-credits","value":{"rev":"3-c824326e289e093406b2de4efef70cb7"}}, -{"id":"foss-credits-collection","key":"foss-credits-collection","value":{"rev":"17-de4ffca51768a36c8fb1b9c2bc66c80f"}}, -{"id":"foursquareonnode","key":"foursquareonnode","value":{"rev":"5-a4f0a1ed5d3be3056f10f0e9517efa83"}}, -{"id":"fraggle","key":"fraggle","value":{"rev":"7-b9383baf96bcdbd4022b4b887e4a3729"}}, -{"id":"framework","key":"framework","value":{"rev":"3-afb19a9598a0d50320b4f1faab1ae2c6"}}, -{"id":"frameworkjs","key":"frameworkjs","value":{"rev":"7-cd418da3272c1e8349126e442ed15dbd"}}, -{"id":"frank","key":"frank","value":{"rev":"12-98031fb56f1c89dfc7888f5d8ca7f0a9"}}, -{"id":"freakset","key":"freakset","value":{"rev":"21-ba60d0840bfa3da2c8713c3c2e6856a0"}}, -{"id":"freckle","key":"freckle","value":{"rev":"3-8e2e9a07b2650fbbd0a598b948ef993b"}}, -{"id":"freebase","key":"freebase","value":{"rev":"7-a1daf1cc2259b886f574f5c902eebcf4"}}, -{"id":"freecontrol","key":"freecontrol","value":{"rev":"6-7a51776b8764f406573d5192bab36adf"}}, -{"id":"freestyle","key":"freestyle","value":{"rev":"9-100f9e9d3504d6e1c6a2d47651c70f51"}}, -{"id":"frenchpress","key":"frenchpress","value":{"rev":"9-306d6ac21837879b8040d7f9aa69fc20"}}, -{"id":"fs-boot","key":"fs-boot","value":{"rev":"20-72b44b403767aa486bf1dc987c750733"}}, -{"id":"fs-ext","key":"fs-ext","value":{"rev":"10-3360831c3852590a762f8f82525c025e"}}, -{"id":"fsevents","key":"fsevents","value":{"rev":"6-bb994f41842e144cf43249fdf6bf51e1"}}, -{"id":"fsext","key":"fsext","value":{"rev":"9-a1507d84e91ddf26ffaa76016253b4fe"}}, -{"id":"fsh","key":"fsh","value":{"rev":"5-1e3784b2df1c1a28b81f27907945f48b"}}, -{"id":"fsm","key":"fsm","value":{"rev":"5-b113be7b30b2a2c9089edcb6fa4c15d3"}}, -{"id":"fswatch","key":"fswatch","value":{"rev":"11-287eea565c9562161eb8969d765bb191"}}, -{"id":"ftp","key":"ftp","value":{"rev":"5-751e312520c29e76f7d79c648248c56c"}}, -{"id":"ftp-get","key":"ftp-get","value":{"rev":"27-1e908bd075a0743dbb1d30eff06485e2"}}, -{"id":"fugue","key":"fugue","value":{"rev":"81-0c08e67e8deb4b5b677fe19f8362dbd8"}}, -{"id":"fullauto","key":"fullauto","value":{"rev":"9-ef915156026dabded5a4a76c5a751916"}}, -{"id":"fun","key":"fun","value":{"rev":"12-8396e3583e206dbf90bbea4316976f66"}}, -{"id":"functional","key":"functional","value":{"rev":"5-955979028270f5d3749bdf86b4d2c925"}}, -{"id":"functools","key":"functools","value":{"rev":"5-42ba84ce365bf8c0aaf3e5e6c369920b"}}, -{"id":"funk","key":"funk","value":{"rev":"14-67440a9b2118d8f44358bf3b17590243"}}, -{"id":"fusion","key":"fusion","value":{"rev":"19-64983fc6e5496c836be26e5fbc8527d1"}}, -{"id":"fusker","key":"fusker","value":{"rev":"48-58f05561c65ad288a78fa7210f146ba1"}}, -{"id":"future","key":"future","value":{"rev":"3-0ca60d8ae330e40ef6cf8c17a421d668"}}, -{"id":"futures","key":"futures","value":{"rev":"44-8a2aaf0f40cf84c9475824d9cec006ad"}}, -{"id":"fuzzy_file_finder","key":"fuzzy_file_finder","value":{"rev":"8-ee555aae1d433e60166d2af1d72ac6b9"}}, -{"id":"fuzzylogic","key":"fuzzylogic","value":{"rev":"8-596a8f4744d1dabcb8eb6466d9980fca"}}, -{"id":"fxs","key":"fxs","value":{"rev":"3-d3cb81151b0ddd9a4a5934fb63ffff75"}}, -{"id":"g","key":"g","value":{"rev":"3-55742a045425a9b4c9fe0e8925fad048"}}, -{"id":"g.raphael","key":"g.raphael","value":{"rev":"4-190d0235dc08f783dda77b3ecb60b11a"}}, -{"id":"ga","key":"ga","value":{"rev":"3-c47d516ac5e6de8ef7ef9d16fabcf6c7"}}, -{"id":"galletita","key":"galletita","value":{"rev":"3-aa7a01c3362a01794f36e7aa9664b850"}}, -{"id":"game","key":"game","value":{"rev":"3-0f1539e4717a2780205d98ef6ec0886d"}}, -{"id":"gamina","key":"gamina","value":{"rev":"15-871f4970f1e87b7c8ad361456001c76f"}}, -{"id":"gang-bang","key":"gang-bang","value":{"rev":"6-f565cb7027a8ca109481df49a6d41114"}}, -{"id":"gapserver","key":"gapserver","value":{"rev":"9-b25eb0eefc21e407cba596a0946cb3a0"}}, -{"id":"garbage","key":"garbage","value":{"rev":"3-80f4097d5f1f2c75f509430a11c8a15e"}}, -{"id":"gaseous","key":"gaseous","value":{"rev":"3-8021582ab9dde42d235193e6067be72d"}}, -{"id":"gaudium","key":"gaudium","value":{"rev":"11-7d612f1c5d921180ccf1c162fe2c7446"}}, -{"id":"gauss","key":"gauss","value":{"rev":"3-8fd18b2d7a223372f190797e4270a535"}}, -{"id":"gcli","key":"gcli","value":{"rev":"3-210404347cc643e924cec678d0195099"}}, -{"id":"gcw2html","key":"gcw2html","value":{"rev":"3-2aff7bff7981f2f9800c5f65812aa0a6"}}, -{"id":"gd","key":"gd","value":{"rev":"4-ac5a662e709a2993ed1fd1cbf7c4d7b4"}}, -{"id":"gdata","key":"gdata","value":{"rev":"3-c6b3a95064a1e1e0bb74f248ab4e73c4"}}, -{"id":"gdata-js","key":"gdata-js","value":{"rev":"17-0959500a4000d7058d8116af1e01b0d9"}}, -{"id":"gearman","key":"gearman","value":{"rev":"8-ac9fb7af75421ca2988d6098dbfd4c7c"}}, -{"id":"gearnode","key":"gearnode","value":{"rev":"7-8e40ec257984e887e2ff5948a6dde04e"}}, -{"id":"geck","key":"geck","value":{"rev":"161-c8117106ef58a6d7d21920df80159eab"}}, -{"id":"geddy","key":"geddy","value":{"rev":"13-da16f903aca1ec1f47086fa250b58abb"}}, -{"id":"gen","key":"gen","value":{"rev":"3-849005c8b8294c2a811ff4eccdedf436"}}, -{"id":"generic-function","key":"generic-function","value":{"rev":"5-dc046f58f96119225efb17ea5334a60f"}}, -{"id":"generic-pool","key":"generic-pool","value":{"rev":"18-65ff988620293fe7ffbd0891745c3ded"}}, -{"id":"genji","key":"genji","value":{"rev":"49-4c72bcaa57572ad0d43a1b7e9e5a963a"}}, -{"id":"genstatic","key":"genstatic","value":{"rev":"19-4278d0766226af4db924bb0f6b127699"}}, -{"id":"gently","key":"gently","value":{"rev":"24-c9a3ba6b6fd183ee1b5dda569122e978"}}, -{"id":"genx","key":"genx","value":{"rev":"7-f0c0ff65e08e045e8dd1bfcb25ca48d4"}}, -{"id":"geo","key":"geo","value":{"rev":"7-fa2a79f7260b849c277735503a8622e9"}}, -{"id":"geo-distance","key":"geo-distance","value":{"rev":"7-819a30e9b4776e4416fe9510ca79cd93"}}, -{"id":"geocoder","key":"geocoder","value":{"rev":"15-736e627571ad8dba3a9d0da1ae019c35"}}, -{"id":"geohash","key":"geohash","value":{"rev":"6-b9e62c804abe565425a8e6a01354407a"}}, -{"id":"geoip","key":"geoip","value":{"rev":"231-e5aa7acd5fb44833a67f96476b4fac49"}}, -{"id":"geoip-lite","key":"geoip-lite","value":{"rev":"9-efd916135c056406ede1ad0fe15534fa"}}, -{"id":"geojs","key":"geojs","value":{"rev":"35-b0f97b7c72397d6eb714602dc1121183"}}, -{"id":"geolib","key":"geolib","value":{"rev":"3-923a8622d1bd97c22f71ed6537ba5062"}}, -{"id":"geonode","key":"geonode","value":{"rev":"35-c2060653af72123f2f9994fca1c86d70"}}, -{"id":"geoutils","key":"geoutils","value":{"rev":"6-2df101fcbb01849533b2fbc80dc0eb7a"}}, -{"id":"gerbil","key":"gerbil","value":{"rev":"3-b5961044bda490a34085ca826aeb3022"}}, -{"id":"gerenuk","key":"gerenuk","value":{"rev":"13-4e45a640bcbadc3112e105ec5b60b907"}}, -{"id":"get","key":"get","value":{"rev":"18-dd215d673f19bbd8b321a7dd63e004e8"}}, -{"id":"getopt","key":"getopt","value":{"rev":"3-454354e4557d5e7205410acc95c9baae"}}, -{"id":"getrusage","key":"getrusage","value":{"rev":"8-d6ef24793b8e4c46f3cdd14937cbabe1"}}, -{"id":"gettext","key":"gettext","value":{"rev":"3-4c12268a4cab64ec4ef3ac8c9ec7912b"}}, -{"id":"getz","key":"getz","value":{"rev":"9-f3f43934139c9af6ddfb8b91e9a121ba"}}, -{"id":"gevorg.me","key":"gevorg.me","value":{"rev":"33-700502b8ca7041bf8d29368069cac365"}}, -{"id":"gex","key":"gex","value":{"rev":"3-105824d7a3f9c2ac7313f284c3f81d22"}}, -{"id":"gexode","key":"gexode","value":{"rev":"3-4a3552eae4ff3ba4443f9371a1ab4b2e"}}, -{"id":"gfx","key":"gfx","value":{"rev":"8-1f6c90bc3819c3b237e8d1f28ad1b136"}}, -{"id":"gherkin","key":"gherkin","value":{"rev":"77-6e835c8107bb4c7c8ad1fa072ac12c20"}}, -{"id":"ghm","key":"ghm","value":{"rev":"3-c440ae39832a575087ff1920b33c275b"}}, -{"id":"gif","key":"gif","value":{"rev":"14-e65638621d05b99ffe71b18097f29134"}}, -{"id":"gimme","key":"gimme","value":{"rev":"7-caab8354fe257fc307f8597e34ede547"}}, -{"id":"gist","key":"gist","value":{"rev":"11-eea7ea1adf3cde3a0804d2e1b0d6f7d6"}}, -{"id":"gista","key":"gista","value":{"rev":"23-48b8c374cfb8fc4e8310f3469cead6d5"}}, -{"id":"gisty","key":"gisty","value":{"rev":"5-1a898d0816f4129ab9a0d3f03ff9feb4"}}, -{"id":"git","key":"git","value":{"rev":"39-1f77df3ebeec9aae47ae8df56de6757f"}}, -{"id":"git-fs","key":"git-fs","value":{"rev":"14-7d365cddff5029a9d11fa8778a7296d2"}}, -{"id":"gitProvider","key":"gitProvider","value":{"rev":"9-c704ae702ef27bb57c0efd279a464e28"}}, -{"id":"github","key":"github","value":{"rev":"16-9345138ca7507c12be4a817b1abfeef6"}}, -{"id":"github-flavored-markdown","key":"github-flavored-markdown","value":{"rev":"3-f12043eb2969aff51db742b13d329446"}}, -{"id":"gitteh","key":"gitteh","value":{"rev":"39-88b00491fd4ce3294b8cdf61b9708383"}}, -{"id":"gitter","key":"gitter","value":{"rev":"16-88d7ef1ab6a7e751ca2cf6b50894deb4"}}, -{"id":"gittyup","key":"gittyup","value":{"rev":"37-ed6030c1acdd8b989ac34cd10d6dfd1e"}}, -{"id":"gitweb","key":"gitweb","value":{"rev":"9-5331e94c6df9ee7724cde3738a0c6230"}}, -{"id":"gitwiki","key":"gitwiki","value":{"rev":"9-0f167a3a87bce7f3e941136a06e91810"}}, -{"id":"gizmo","key":"gizmo","value":{"rev":"5-1da4da8d66690457c0bf743473b755f6"}}, -{"id":"gleak","key":"gleak","value":{"rev":"17-d44a968b32e4fdc7d27bacb146391422"}}, -{"id":"glob","key":"glob","value":{"rev":"203-4a79e232cf6684a48ccb9134a6ce938c"}}, -{"id":"glob-trie.js","key":"glob-trie.js","value":{"rev":"7-bff534e3aba8f6333fa5ea871b070de2"}}, -{"id":"global","key":"global","value":{"rev":"3-f15b0c9ae0ea9508890bff25c8e0f795"}}, -{"id":"globalize","key":"globalize","value":{"rev":"5-33d10c33fb24af273104f66098e246c4"}}, -{"id":"glossary","key":"glossary","value":{"rev":"3-5e143d09d22a01eb2ee742ceb3e18f6e"}}, -{"id":"glossy","key":"glossy","value":{"rev":"9-f31e00844e8be49e5812fe64a6f1e1cc"}}, -{"id":"gm","key":"gm","value":{"rev":"28-669722d34a3dc29c8c0b27abd73493a1"}}, -{"id":"gnarly","key":"gnarly","value":{"rev":"3-796f5df3483f304cb404cc7ac7702512"}}, -{"id":"gnomenotify","key":"gnomenotify","value":{"rev":"9-bc066c0556ad4a20e7a7ae58cdc4cf91"}}, -{"id":"gofer","key":"gofer","value":{"rev":"15-3fc77ce34e95ffecd12d3854a1bb2da9"}}, -{"id":"goo.gl","key":"goo.gl","value":{"rev":"37-eac7c44d33cc42c618372f0bdd4365c2"}}, -{"id":"goodreads","key":"goodreads","value":{"rev":"5-acd9fe24139aa8b81b26431dce9954aa"}}, -{"id":"goog","key":"goog","value":{"rev":"13-c964ecfcef4d20c8c7d7526323257c04"}}, -{"id":"googl","key":"googl","value":{"rev":"8-2d4d80ef0c5f93400ec2ec8ef80de433"}}, -{"id":"google-openid","key":"google-openid","value":{"rev":"19-380884ba97e3d6fc48c8c7db3dc0e91b"}}, -{"id":"google-spreadsheets","key":"google-spreadsheets","value":{"rev":"3-f640ef136c4b5e90210c2d5d43102b38"}}, -{"id":"google-voice","key":"google-voice","value":{"rev":"37-2e1c3cba3455852f26b0ccaf1fed7125"}}, -{"id":"googleanalytics","key":"googleanalytics","value":{"rev":"8-1d3e470ce4aacadb0418dd125887813d"}}, -{"id":"googleclientlogin","key":"googleclientlogin","value":{"rev":"23-5de8ee62c0ddbc63a001a36a6afe730e"}}, -{"id":"googlediff","key":"googlediff","value":{"rev":"3-438a2f0758e9770a157ae4cce9b6f49e"}}, -{"id":"googlemaps","key":"googlemaps","value":{"rev":"18-bc939560c587711f3d96f3caadd65a7f"}}, -{"id":"googleplus-scraper","key":"googleplus-scraper","value":{"rev":"7-598ea99bd64f4ad69cccb74095abae59"}}, -{"id":"googlereaderauth","key":"googlereaderauth","value":{"rev":"5-cd0eb8ca36ea78620af0fce270339a7b"}}, -{"id":"googlesets","key":"googlesets","value":{"rev":"5-1b2e597e903c080182b3306d63278fd9"}}, -{"id":"googleweather","key":"googleweather","value":{"rev":"3-6bfdaaeedb8a712ee3e89a8ed27508eb"}}, -{"id":"gopostal.node","key":"gopostal.node","value":{"rev":"3-14ff3a655dc3680c9e8e2751ebe294bc"}}, -{"id":"gowallan","key":"gowallan","value":{"rev":"3-23adc9c01a6b309eada47602fdc8ed90"}}, -{"id":"gowiththeflow","key":"gowiththeflow","value":{"rev":"3-52bb6cf6294f67ba5a892db4666d3790"}}, -{"id":"gpg","key":"gpg","value":{"rev":"5-0ca2b5af23e108a4f44f367992a75fed"}}, -{"id":"graceful-fs","key":"graceful-fs","value":{"rev":"3-01e9f7d1c0f6e6a611a60ee84de1f5cc"}}, -{"id":"gracie","key":"gracie","value":{"rev":"3-aa0f7c01a33c7c1e9a49b86886ef5255"}}, -{"id":"graff","key":"graff","value":{"rev":"7-5ab558cb24e30abd67f2a1dbf47cd639"}}, -{"id":"graft","key":"graft","value":{"rev":"3-7419de38b249b891bf7998bcdd2bf557"}}, -{"id":"grain","key":"grain","value":{"rev":"3-e57cbf02121970da230964ddbfd31432"}}, -{"id":"grainstore","key":"grainstore","value":{"rev":"19-5f9c5bb13b2c9ac4e6a05aec33aeb7c5"}}, -{"id":"graph","key":"graph","value":{"rev":"7-909d2fefcc84b5dd1512b60d631ea4e5"}}, -{"id":"graphquire","key":"graphquire","value":{"rev":"27-246e798f80b3310419644302405d68ad"}}, -{"id":"graphviz","key":"graphviz","value":{"rev":"8-3b79341eaf3f67f91bce7c88c08b9f0d"}}, -{"id":"grasshopper","key":"grasshopper","value":{"rev":"45-4002406990476b74dac5108bd19c4274"}}, -{"id":"gravatar","key":"gravatar","value":{"rev":"11-0164b7ac97e8a477b4e8791eae2e7fea"}}, -{"id":"grave","key":"grave","value":{"rev":"3-136f6378b956bc5dd9773250f8813038"}}, -{"id":"gravity","key":"gravity","value":{"rev":"5-dd40fcee1a769ce786337e9536d24244"}}, -{"id":"graylog","key":"graylog","value":{"rev":"5-abcff9cd91ff20e36f8a70a3f2de658b"}}, -{"id":"greg","key":"greg","value":{"rev":"5-ececb0a3bb552b6da4f66b8bf6f75cf0"}}, -{"id":"gridcentric","key":"gridcentric","value":{"rev":"4-4378e1c280e18b5aaabd23038b80d76c"}}, -{"id":"gridly","key":"gridly","value":{"rev":"3-86e878756b493da8f66cbd633a15f821"}}, -{"id":"grinder","key":"grinder","value":{"rev":"9-0aaeecf0c81b1c9c93a924c5eb0bff45"}}, -{"id":"grir.am","key":"grir.am","value":{"rev":"3-3ec153c764af1c26b50fefa437318c5a"}}, -{"id":"groundcrew","key":"groundcrew","value":{"rev":"3-9e9ed9b1c70c00c432f36bb853fa21a0"}}, -{"id":"groupie","key":"groupie","value":{"rev":"6-b5e3f0891a7e8811d6112b24bd5a46b4"}}, -{"id":"groupon","key":"groupon","value":{"rev":"21-8b74723c153695f4ed4917575abcca8f"}}, -{"id":"growing-file","key":"growing-file","value":{"rev":"7-995b233a1add5b9ea80aec7ac3f60dc5"}}, -{"id":"growl","key":"growl","value":{"rev":"10-4be41ae10ec96e1334dccdcdced12fe3"}}, -{"id":"gsl","key":"gsl","value":{"rev":"49-3367acfb521b30d3ddb9b80305009553"}}, -{"id":"gss","key":"gss","value":{"rev":"3-e4cffbbbc4536d952d13d46376d899b7"}}, -{"id":"guards","key":"guards","value":{"rev":"8-d7318d3d9dc842ab41e6ef5b88f9d37f"}}, -{"id":"guardtime","key":"guardtime","value":{"rev":"3-5a2942efabab100ffb3dc0fa3b581b7a"}}, -{"id":"guava","key":"guava","value":{"rev":"11-d9390d298b503f0ffb8e3ba92eeb9759"}}, -{"id":"guid","key":"guid","value":{"rev":"16-d99e725bbbf97a326833858767b7ed08"}}, -{"id":"gumbo","key":"gumbo","value":{"rev":"31-727cf5a3b7d8590fff871f27da114d9d"}}, -{"id":"gunther","key":"gunther","value":{"rev":"9-f95c89128412208d16acd3e615844115"}}, -{"id":"gzbz2","key":"gzbz2","value":{"rev":"3-e1844b1b3a7881a0c8dc0dd4edcc11ca"}}, -{"id":"gzip","key":"gzip","value":{"rev":"17-37afa05944f055d6f43ddc87c1b163c2"}}, -{"id":"gzip-stack","key":"gzip-stack","value":{"rev":"8-cf455d60277832c60ee622d198c0c51a"}}, -{"id":"gzippo","key":"gzippo","value":{"rev":"15-6416c13ecbbe1c5cd3e30adf4112ead7"}}, -{"id":"h5eb","key":"h5eb","value":{"rev":"3-11ed2566fa4b8a01ff63a720c94574cd"}}, -{"id":"hack","key":"hack","value":{"rev":"3-70f536dd46719e8201a6ac5cc96231f6"}}, -{"id":"hack.io","key":"hack.io","value":{"rev":"18-128305614e7fd6b461248bf3bfdd7ab7"}}, -{"id":"hacktor","key":"hacktor","value":{"rev":"3-51b438df35ba8a955d434ab25a4dad67"}}, -{"id":"haibu","key":"haibu","value":{"rev":"99-b29b8c37be42f90985c6d433d53c8679"}}, -{"id":"haibu-carapace","key":"haibu-carapace","value":{"rev":"22-9a89b2f495e533d0f93e4ee34121e48c"}}, -{"id":"haibu-nginx","key":"haibu-nginx","value":{"rev":"7-e176128dc6dbb0d7f5f33369edf1f7ee"}}, -{"id":"halfstreamxml","key":"halfstreamxml","value":{"rev":"7-5c0f3defa6ba921f8edb564584553df4"}}, -{"id":"ham","key":"ham","value":{"rev":"3-1500dc495cade7334f6a051f2758f748"}}, -{"id":"haml","key":"haml","value":{"rev":"15-a93e7762c7d43469a06519472497fd93"}}, -{"id":"haml-edge","key":"haml-edge","value":{"rev":"5-c4e44a73263ac9b7e632375de7e43d7c"}}, -{"id":"hamljs","key":"hamljs","value":{"rev":"10-a01c7214b69992352bde44938418ebf4"}}, -{"id":"hamljs-coffee","key":"hamljs-coffee","value":{"rev":"3-c2733c8ff38f5676075b84cd7f3d8684"}}, -{"id":"handlebars","key":"handlebars","value":{"rev":"4-0e21906b78605f7a1d5ec7cb4c7d35d7"}}, -{"id":"hanging-gardens","key":"hanging-gardens","value":{"rev":"27-3244e37f08bea0e31759e9f38983f59a"}}, -{"id":"hanging_gardens_registry","key":"hanging_gardens_registry","value":{"rev":"17-d87aa3a26f91dc314f02c686672a5ec6"}}, -{"id":"hapi","key":"hapi","value":{"rev":"3-ed721fe9aae4a459fe0945dabd7d680a"}}, -{"id":"harmony","key":"harmony","value":{"rev":"3-d6c9d6acc29d29c97c75c77f7c8e1390"}}, -{"id":"hascan","key":"hascan","value":{"rev":"13-a7ab15c72f464b013cbc55dc426543ca"}}, -{"id":"hash_ring","key":"hash_ring","value":{"rev":"12-0f072b1dd1fd93ae2f2b79f5ea72074d"}}, -{"id":"hashbangify","key":"hashbangify","value":{"rev":"5-738e0cf99649d41c19d3449c0e9a1cbf"}}, -{"id":"hashish","key":"hashish","value":{"rev":"9-62c5e74355458e1ead819d87151b7d38"}}, -{"id":"hashkeys","key":"hashkeys","value":{"rev":"3-490809bdb61f930f0d9f370eaadf36ea"}}, -{"id":"hashlib","key":"hashlib","value":{"rev":"7-1f19c9d6062ff22ed2e963204a1bd405"}}, -{"id":"hashring","key":"hashring","value":{"rev":"11-4c9f2b1ba7931c8bab310f4ecaf91419"}}, -{"id":"hashtable","key":"hashtable","value":{"rev":"7-2aaf2667cbdb74eb8da61e2e138059ca"}}, -{"id":"hat","key":"hat","value":{"rev":"9-6f37874d9703eab62dc875e2373837a8"}}, -{"id":"hbase","key":"hbase","value":{"rev":"20-7ca92712de26ffb18d275a21696aa263"}}, -{"id":"hbase-thrift","key":"hbase-thrift","value":{"rev":"7-39afb33a4e61cc2b3dc94f0c7fd32c65"}}, -{"id":"hbs","key":"hbs","value":{"rev":"29-aa2676e6790c5716f84f128dcd03e797"}}, -{"id":"header-stack","key":"header-stack","value":{"rev":"13-7ad1ccf3c454d77029c000ceb18ce5ab"}}, -{"id":"headers","key":"headers","value":{"rev":"13-04f8f5f25e2dd9890f6b2f120adf297a"}}, -{"id":"healthety","key":"healthety","value":{"rev":"60-07c67c22ee2a13d0ad675739d1814a6d"}}, -{"id":"heatmap","key":"heatmap","value":{"rev":"9-c53f4656d9517f184df7aea9226c1765"}}, -{"id":"heavy-flow","key":"heavy-flow","value":{"rev":"5-0b9188334339e7372b364a7fc730c639"}}, -{"id":"heckle","key":"heckle","value":{"rev":"13-b462abef7b9d1471ed8fb8f23af463e0"}}, -{"id":"helium","key":"helium","value":{"rev":"3-4d6ce9618c1be522268944240873f53e"}}, -{"id":"hello-world","key":"hello-world","value":{"rev":"3-e87f287308a209491c011064a87100b7"}}, -{"id":"hello.io","key":"hello.io","value":{"rev":"3-39b78278fa638495522edc7a84f6a52e"}}, -{"id":"helloworld","key":"helloworld","value":{"rev":"3-8f163aebdcf7d8761709bdbb634c3689"}}, -{"id":"helpers","key":"helpers","value":{"rev":"3-67d75b1c8e5ad2a268dd4ea191d4754b"}}, -{"id":"helpful","key":"helpful","value":{"rev":"41-e11bed25d5a0ca7e7ad116d5a339ec2a"}}, -{"id":"hem","key":"hem","value":{"rev":"27-042fc9d4b96f20112cd943e019e54d20"}}, -{"id":"hempwick","key":"hempwick","value":{"rev":"11-de1f6f0f23937d9f33286e12ee877540"}}, -{"id":"heritable","key":"heritable","value":{"rev":"13-1468ff92063251a037bbe80ee987a9c3"}}, -{"id":"hermes-raw-client","key":"hermes-raw-client","value":{"rev":"11-5d143c371cb8353612badc72be1917ff"}}, -{"id":"heru","key":"heru","value":{"rev":"3-d124a20939e30e2a3c08f7104b2a1a5c"}}, -{"id":"hexdump","key":"hexdump","value":{"rev":"3-c455710ca80662969ccbca3acc081cb8"}}, -{"id":"hexy","key":"hexy","value":{"rev":"16-5142b0461622436daa2e476d252770f2"}}, -{"id":"highlight","key":"highlight","value":{"rev":"9-4b172b7aef6f40d768f022b2ba4e6748"}}, -{"id":"highlight.js","key":"highlight.js","value":{"rev":"5-16c1ebd28d5f2e781e666c6ee013c30c"}}, -{"id":"hiker","key":"hiker","value":{"rev":"9-89d1ce978b349f1f0df262655299d83c"}}, -{"id":"hipchat","key":"hipchat","value":{"rev":"3-73118782367d474af0f6410290df5f7f"}}, -{"id":"hipchat-js","key":"hipchat-js","value":{"rev":"3-253b83875d3e18e9c89333bc377183c3"}}, -{"id":"hiredis","key":"hiredis","value":{"rev":"46-29ceb03860efbd4b3b995247f27f78b9"}}, -{"id":"hive","key":"hive","value":{"rev":"15-40a4c6fcfa3b80007a18ef4ede80075b"}}, -{"id":"hive-cache","key":"hive-cache","value":{"rev":"3-36b10607b68586fccbfeb856412bd6bf"}}, -{"id":"hoard","key":"hoard","value":{"rev":"13-75d4c484095e2e38ac63a65bd9fd7f4b"}}, -{"id":"hook","key":"hook","value":{"rev":"7-2f1e375058e2b1fa61d3651f6d57a6f8"}}, -{"id":"hook.io","key":"hook.io","value":{"rev":"63-9fac4fb8337d1953963d47144f806f72"}}, -{"id":"hook.io-browser","key":"hook.io-browser","value":{"rev":"3-7e04347d80adc03eb5637b7e4b8ca58b"}}, -{"id":"hook.io-couch","key":"hook.io-couch","value":{"rev":"3-ce0eb281d1ba21aa1caca3a52553a07b"}}, -{"id":"hook.io-cron","key":"hook.io-cron","value":{"rev":"15-50deedc2051ce65bca8a42048154139c"}}, -{"id":"hook.io-helloworld","key":"hook.io-helloworld","value":{"rev":"23-ef5cf0cec9045d28d846a7b0872874e4"}}, -{"id":"hook.io-irc","key":"hook.io-irc","value":{"rev":"5-39c7ac5e192aef34b87af791fa77ee04"}}, -{"id":"hook.io-logger","key":"hook.io-logger","value":{"rev":"13-9e3208ea8eacfe5378cd791f2377d06d"}}, -{"id":"hook.io-mailer","key":"hook.io-mailer","value":{"rev":"9-d9415d53dc086102024cf7400fdfb7a2"}}, -{"id":"hook.io-pinger","key":"hook.io-pinger","value":{"rev":"17-860ab3a892284b91999f86c3882e2ff5"}}, -{"id":"hook.io-repl","key":"hook.io-repl","value":{"rev":"13-c0d430ccdfd197e4746c46d2814b6d92"}}, -{"id":"hook.io-request","key":"hook.io-request","value":{"rev":"13-f0e8d167d59917d90266f921e3ef7c64"}}, -{"id":"hook.io-sitemonitor","key":"hook.io-sitemonitor","value":{"rev":"8-725ea7deb9cb1031eabdc4fd798308ff"}}, -{"id":"hook.io-twilio","key":"hook.io-twilio","value":{"rev":"11-6b2e231307f6174861aa5dcddad264b3"}}, -{"id":"hook.io-twitter","key":"hook.io-twitter","value":{"rev":"3-59296395b22e661e7e5c141c4c7be46d"}}, -{"id":"hook.io-webhook","key":"hook.io-webhook","value":{"rev":"15-b27e51b63c8ec70616c66061d949f388"}}, -{"id":"hook.io-webserver","key":"hook.io-webserver","value":{"rev":"29-eb6bff70736648427329eba08b5f55c3"}}, -{"id":"hook.io-ws","key":"hook.io-ws","value":{"rev":"4-a85578068b54560ef663a7ecfea2731f"}}, -{"id":"hooks","key":"hooks","value":{"rev":"33-6640fb0c27903af6b6ae7b7c41d79e01"}}, -{"id":"hoptoad-notifier","key":"hoptoad-notifier","value":{"rev":"16-8249cb753a3626f2bf2664024ae7a5ee"}}, -{"id":"horaa","key":"horaa","value":{"rev":"5-099e5d6486d10944e10b584eb3f6e924"}}, -{"id":"hornet","key":"hornet","value":{"rev":"22-8c40d7ba4ca832b951e6d5db165f3305"}}, -{"id":"horseman","key":"horseman","value":{"rev":"11-7228e0f84c2036669a218710c22f72c0"}}, -{"id":"hostify","key":"hostify","value":{"rev":"11-8c1a2e73f8b9474a6c26121688c28dc7"}}, -{"id":"hostinfo","key":"hostinfo","value":{"rev":"5-c8d638f40ccf94f4083430966d25e787"}}, -{"id":"hostip","key":"hostip","value":{"rev":"3-d4fd628b94e1f913d97ec1746d96f2a0"}}, -{"id":"hostname","key":"hostname","value":{"rev":"7-55fefb3c37990bbcad3d98684d17f38f"}}, -{"id":"hotnode","key":"hotnode","value":{"rev":"16-d7dad5de3ffc2ca6a04f74686aeb0e4b"}}, -{"id":"howmuchtime","key":"howmuchtime","value":{"rev":"3-351ce870ae6e2c21a798169d074e2a3f"}}, -{"id":"hstore","key":"hstore","value":{"rev":"3-55ab4d359c2fc8725829038e3adb7571"}}, -{"id":"hsume2-socket.io","key":"hsume2-socket.io","value":{"rev":"5-4b537247ae9999c285c802cc36457598"}}, -{"id":"htdoc","key":"htdoc","value":{"rev":"3-80ef9e3202b0d96b79435a2bc90bc899"}}, -{"id":"html","key":"html","value":{"rev":"3-92c4af7de329c92ff2e0be5c13020e78"}}, -{"id":"html-minifier","key":"html-minifier","value":{"rev":"7-2441ed004e2a6e7f1c42003ec03277ec"}}, -{"id":"html-sourcery","key":"html-sourcery","value":{"rev":"11-7ce1d4aa2e1d319fa108b02fb294d4ce"}}, -{"id":"html2coffeekup","key":"html2coffeekup","value":{"rev":"13-bae4a70411f6f549c281c69835fe3276"}}, -{"id":"html2coffeekup-bal","key":"html2coffeekup-bal","value":{"rev":"5-0663ac1339d72932004130b668c949f0"}}, -{"id":"html2jade","key":"html2jade","value":{"rev":"11-e50f504c5c847d7ffcde7328c2ade4fb"}}, -{"id":"html5","key":"html5","value":{"rev":"46-ca85ea99accaf1dc9ded4e2e3aa429c6"}}, -{"id":"html5edit","key":"html5edit","value":{"rev":"10-0383296c33ada4d356740f29121eeb9f"}}, -{"id":"htmlKompressor","key":"htmlKompressor","value":{"rev":"13-95a3afe7f7cfe02e089e41588b937fb1"}}, -{"id":"htmlkup","key":"htmlkup","value":{"rev":"27-5b0115636f38886ae0a40e5f52e2bfdd"}}, -{"id":"htmlparser","key":"htmlparser","value":{"rev":"14-52b2196c1456d821d47bb1d2779b2433"}}, -{"id":"htmlparser2","key":"htmlparser2","value":{"rev":"3-9bc0b807acd913999dfc949b3160a3db"}}, -{"id":"htracr","key":"htracr","value":{"rev":"27-384d0522328e625978b97d8eae8d942d"}}, -{"id":"http","key":"http","value":{"rev":"3-f197d1b599cb9da720d3dd58d9813ace"}}, -{"id":"http-agent","key":"http-agent","value":{"rev":"10-1715dd3a7adccf55bd6637d78bd345d1"}}, -{"id":"http-auth","key":"http-auth","value":{"rev":"3-21636d4430be18a5c6c42e5cb622c2e0"}}, -{"id":"http-basic-auth","key":"http-basic-auth","value":{"rev":"6-0a77e99ce8e31558d5917bd684fa2c9a"}}, -{"id":"http-browserify","key":"http-browserify","value":{"rev":"3-4f720b4af628ed8b5fb22839c1f91f4d"}}, -{"id":"http-console","key":"http-console","value":{"rev":"43-a20cbefed77bcae7de461922286a1f04"}}, -{"id":"http-digest","key":"http-digest","value":{"rev":"6-e0164885dcad21ab6150d537af0edd92"}}, -{"id":"http-digest-auth","key":"http-digest-auth","value":{"rev":"7-613ac841b808fd04e272e050fd5a45ac"}}, -{"id":"http-get","key":"http-get","value":{"rev":"39-b7cfeb2b572d4ecf695493e0886869f4"}}, -{"id":"http-load","key":"http-load","value":{"rev":"3-8c64f4972ff59e89fee041adde99b8ba"}}, -{"id":"http-proxy","key":"http-proxy","value":{"rev":"97-5b8af88886c8c047a9862bf62f6b9294"}}, -{"id":"http-proxy-backward","key":"http-proxy-backward","value":{"rev":"2-4433b04a41e8adade3f6b6b2b939df4b"}}, -{"id":"http-proxy-glimpse","key":"http-proxy-glimpse","value":{"rev":"3-a3e9791d4d9bfef5929ca55d874df18b"}}, -{"id":"http-proxy-no-line-184-error","key":"http-proxy-no-line-184-error","value":{"rev":"3-7e20a990820976d8c6d27c312cc5a67c"}}, -{"id":"http-proxy-selective","key":"http-proxy-selective","value":{"rev":"12-6e273fcd008afeceb6737345c46e1024"}}, -{"id":"http-recorder","key":"http-recorder","value":{"rev":"3-26dd0bc4f5c0bf922db1875e995d025f"}}, -{"id":"http-request-provider","key":"http-request-provider","value":{"rev":"6-436b69971dd1735ac3e41571375f2d15"}}, -{"id":"http-server","key":"http-server","value":{"rev":"21-1b80b6558692afd08c36629b0ecdc18c"}}, -{"id":"http-signature","key":"http-signature","value":{"rev":"9-49ca63427b535f2d18182d92427bc5b6"}}, -{"id":"http-stack","key":"http-stack","value":{"rev":"9-51614060741d6c85a7fd4c714ed1a9b2"}}, -{"id":"http-status","key":"http-status","value":{"rev":"5-1ec72fecc62a41d6f180d15c95e81270"}}, -{"id":"http_compat","key":"http_compat","value":{"rev":"3-88244d4b0fd08a3140fa1b2e8b1b152c"}}, -{"id":"http_router","key":"http_router","value":{"rev":"23-ad52b58b6bfc96d6d4e8215e0c31b294"}}, -{"id":"http_trace","key":"http_trace","value":{"rev":"7-d8024b5e41540e4240120ffefae523e4"}}, -{"id":"httpd","key":"httpd","value":{"rev":"3-9e2a19f007a6a487cdb752f4b8249657"}}, -{"id":"httpmock","key":"httpmock","value":{"rev":"3-b6966ba8ee2c31b0e7729fc59bb00ccf"}}, -{"id":"https-proxied","key":"https-proxied","value":{"rev":"5-f63a4c663d372502b0dcd4997e759e66"}}, -{"id":"httpu","key":"httpu","value":{"rev":"5-88a5b2bac8391d91673fc83d4cfd32df"}}, -{"id":"hungarian-magic","key":"hungarian-magic","value":{"rev":"4-9eae750ac6f30b6687d9a031353f5217"}}, -{"id":"huntergatherer","key":"huntergatherer","value":{"rev":"9-5c9d833a134cfaa901d89dce93f5b013"}}, -{"id":"hxp","key":"hxp","value":{"rev":"8-1f52ba766491826bdc6517c6cc508b2c"}}, -{"id":"hyde","key":"hyde","value":{"rev":"3-5763db65cab423404752b1a6354a7a6c"}}, -{"id":"hydra","key":"hydra","value":{"rev":"8-8bb4ed249fe0f9cdb8b11e492b646b88"}}, -{"id":"hyperpublic","key":"hyperpublic","value":{"rev":"11-5738162f3dbf95803dcb3fb28efd8740"}}, -{"id":"i18n","key":"i18n","value":{"rev":"7-f0d6b3c72ecd34dde02d805041eca996"}}, -{"id":"ical","key":"ical","value":{"rev":"13-baf448be48ab83ec9b3fb8bf83fbb9a1"}}, -{"id":"icalendar","key":"icalendar","value":{"rev":"5-78dd8fd8ed2c219ec56ad26a0727cf76"}}, -{"id":"icecap","key":"icecap","value":{"rev":"9-88d6865078a5e6e1ff998e2e73e593f3"}}, -{"id":"icecapdjs","key":"icecapdjs","value":{"rev":"11-d8e3c718a230d49caa3b5f76cfff7ce9"}}, -{"id":"icecast-stack","key":"icecast-stack","value":{"rev":"9-13b8da6ae373152ab0c8560e2f442af0"}}, -{"id":"ichabod","key":"ichabod","value":{"rev":"19-d0f02ffba80661398ceb80a7e0cbbfe6"}}, -{"id":"icing","key":"icing","value":{"rev":"11-84815e78828190fbaa52d6b93c75cb4f"}}, -{"id":"ico","key":"ico","value":{"rev":"3-5727a35c1df453bfdfa6a03e49725adf"}}, -{"id":"iconv","key":"iconv","value":{"rev":"18-5f5b3193268f1fa099e0112b3e033ffc"}}, -{"id":"iconv-jp","key":"iconv-jp","value":{"rev":"3-660b8f2def930263d2931cae2dcc401d"}}, -{"id":"id3","key":"id3","value":{"rev":"8-afe68aede872cae7b404aaa01c0108a5"}}, -{"id":"idea","key":"idea","value":{"rev":"9-a126c0e52206c51dcf972cf53af0bc32"}}, -{"id":"idiomatic-console","key":"idiomatic-console","value":{"rev":"25-67696c16bf79d1cc8caf4df62677c3ec"}}, -{"id":"idiomatic-stdio","key":"idiomatic-stdio","value":{"rev":"15-9d74c9a8872b1f7c41d6c671d7a14b7d"}}, -{"id":"iglob","key":"iglob","value":{"rev":"6-b8a3518cb67cad20c89f37892a2346a5"}}, -{"id":"ignite","key":"ignite","value":{"rev":"19-06daa730a70f69dc3a0d6d4984905c61"}}, -{"id":"iles-forked-irc-js","key":"iles-forked-irc-js","value":{"rev":"7-eb446f4e0db856e00351a5da2fa20616"}}, -{"id":"image","key":"image","value":{"rev":"8-5f7811db33c210eb38e1880f7cc433f2"}}, -{"id":"imageable","key":"imageable","value":{"rev":"61-9f7e03d3d990d34802f1e9c8019dbbfa"}}, -{"id":"imageinfo","key":"imageinfo","value":{"rev":"11-9bde1a1f0801d94539a4b70b61614849"}}, -{"id":"imagemagick","key":"imagemagick","value":{"rev":"10-b1a1ea405940fecf487da94b733e8c29"}}, -{"id":"imagick","key":"imagick","value":{"rev":"3-21d51d8a265a705881dadbc0c9f7c016"}}, -{"id":"imap","key":"imap","value":{"rev":"13-6a59045496c80b474652d2584edd4acb"}}, -{"id":"imbot","key":"imbot","value":{"rev":"11-0d8075eff5e5ec354683f396378fd101"}}, -{"id":"imdb","key":"imdb","value":{"rev":"7-2bba884d0e8804f4a7e0883abd47b0a7"}}, -{"id":"imgur","key":"imgur","value":{"rev":"3-30c0e5fddc1be3398ba5f7eee1a251d7"}}, -{"id":"impact","key":"impact","value":{"rev":"7-d3390690f11c6f9dcca9f240a7bedfef"}}, -{"id":"imsi","key":"imsi","value":{"rev":"3-0aa9a01c9c79b17afae3684b7b920ced"}}, -{"id":"index","key":"index","value":{"rev":"13-ad5d8d7dfad64512a12db4d820229c07"}}, -{"id":"indexer","key":"indexer","value":{"rev":"9-b0173ce9ad9fa1b80037fa8e33a8ce12"}}, -{"id":"inflect","key":"inflect","value":{"rev":"17-9e5ea2826fe08bd950cf7e22d73371bd"}}, -{"id":"inflectjs","key":"inflectjs","value":{"rev":"3-c59db027b72be720899b4a280ac2518f"}}, -{"id":"inflector","key":"inflector","value":{"rev":"3-191ff29d3b5ed8ef6877032a1d01d864"}}, -{"id":"inheritance","key":"inheritance","value":{"rev":"3-450a1e68bd2d8f16abe7001491abb6a8"}}, -{"id":"inherits","key":"inherits","value":{"rev":"3-284f97a7ae4f777bfabe721b66de07fa"}}, -{"id":"ini","key":"ini","value":{"rev":"5-142c8f9125fbace57689e2837deb1883"}}, -{"id":"iniparser","key":"iniparser","value":{"rev":"14-1053c59ef3d50a46356be45576885c49"}}, -{"id":"inireader","key":"inireader","value":{"rev":"15-9cdc485b18bff6397f5fec45befda402"}}, -{"id":"init","key":"init","value":{"rev":"5-b81610ad72864417dab49f7a3f29cc9f"}}, -{"id":"inject","key":"inject","value":{"rev":"5-82bddb6b4f21ddaa0137fedc8913d60e"}}, -{"id":"inliner","key":"inliner","value":{"rev":"45-8a1c3e8f78438f06865b3237d6c5339a"}}, -{"id":"inode","key":"inode","value":{"rev":"7-118ffafc62dcef5bbeb14e4328c68ab3"}}, -{"id":"inotify","key":"inotify","value":{"rev":"18-03d7b1a318bd283e0185b414b48dd602"}}, -{"id":"inotify-plusplus","key":"inotify-plusplus","value":{"rev":"10-0e0ce9065a62e5e21ee5bb53fac61a6d"}}, -{"id":"inspect","key":"inspect","value":{"rev":"5-b5f18717e29caec3399abe5e4ce7a269"}}, -{"id":"instagram","key":"instagram","value":{"rev":"5-decddf3737a1764518b6a7ce600d720d"}}, -{"id":"instagram-node-lib","key":"instagram-node-lib","value":{"rev":"13-8be77f1180b6afd9066834b3f5ee8de5"}}, -{"id":"instant-styleguide","key":"instant-styleguide","value":{"rev":"9-66c02118993621376ad0b7396db435b3"}}, -{"id":"intercept","key":"intercept","value":{"rev":"9-f5622744c576405516a427b4636ee864"}}, -{"id":"interface","key":"interface","value":{"rev":"10-13806252722402bd18d88533056a863b"}}, -{"id":"interleave","key":"interleave","value":{"rev":"25-69bc136937604863748a029fb88e3605"}}, -{"id":"interstate","key":"interstate","value":{"rev":"3-3bb4a6c35ca765f88a10b9fab6307c59"}}, -{"id":"intervals","key":"intervals","value":{"rev":"21-89b71bd55b8d5f6b670d69fc5b9f847f"}}, -{"id":"intestine","key":"intestine","value":{"rev":"3-66a5531e06865ed9c966d95437ba1371"}}, -{"id":"ios7crypt","key":"ios7crypt","value":{"rev":"7-a2d309a2c074e5c1c456e2b56cbcfd17"}}, -{"id":"iostat","key":"iostat","value":{"rev":"11-f0849c0072e76701b435aa769a614e82"}}, -{"id":"ip2cc","key":"ip2cc","value":{"rev":"9-2c282606fd08d469184a272a2108639c"}}, -{"id":"ipaddr.js","key":"ipaddr.js","value":{"rev":"5-1017fd5342840745614701476ed7e6c4"}}, -{"id":"iptables","key":"iptables","value":{"rev":"7-23e56ef5d7bf0ee8f5bd0e38bde8aae3"}}, -{"id":"iptrie","key":"iptrie","value":{"rev":"4-10317b0e073befe9601e9dc308dc361a"}}, -{"id":"ipv6","key":"ipv6","value":{"rev":"6-85e937f3d79e44dbb76264c7aaaa140f"}}, -{"id":"iqengines","key":"iqengines","value":{"rev":"3-8bdbd32e9dc35b77d80a31edae235178"}}, -{"id":"irc","key":"irc","value":{"rev":"8-ed30964f57b99b1b2f2104cc5e269618"}}, -{"id":"irc-colors","key":"irc-colors","value":{"rev":"9-7ddb19db9a553567aae86bd97f1dcdfc"}}, -{"id":"irc-js","key":"irc-js","value":{"rev":"58-1c898cea420aee60283edb4fadceb90e"}}, -{"id":"ircat.js","key":"ircat.js","value":{"rev":"6-f25f20953ce96697c033315d250615d0"}}, -{"id":"ircbot","key":"ircbot","value":{"rev":"9-85a4a6f88836fc031855736676b10dec"}}, -{"id":"irccd","key":"irccd","value":{"rev":"3-bf598ae8b6af63be41852ae8199416f4"}}, -{"id":"ircd","key":"ircd","value":{"rev":"7-3ba7fc2183d32ee1e58e63092d7e82bb"}}, -{"id":"ircdjs","key":"ircdjs","value":{"rev":"15-8fcdff2bf29cf24c3bbc4b461e6cbe9f"}}, -{"id":"irclog","key":"irclog","value":{"rev":"3-79a99bd8048dd98a93c747a1426aabde"}}, -{"id":"ircrpc","key":"ircrpc","value":{"rev":"5-278bec6fc5519fdbd152ea4fa35dc58c"}}, -{"id":"irrklang","key":"irrklang","value":{"rev":"3-65936dfabf7777027069343c2e72b32e"}}, -{"id":"isaacs","key":"isaacs","value":{"rev":"7-c55a41054056f502bc580bc6819d9d1f"}}, -{"id":"isbn","key":"isbn","value":{"rev":"3-51e784ded2e3ec9ef9b382fecd1c26a1"}}, -{"id":"iscroll","key":"iscroll","value":{"rev":"4-4f6635793806507665503605e7c180f0"}}, -{"id":"isodate","key":"isodate","value":{"rev":"7-ea4b1f77e9557b153264f68fd18a9f23"}}, -{"id":"it-is","key":"it-is","value":{"rev":"14-7617f5831c308d1c4ef914bc5dc30fa7"}}, -{"id":"iterator","key":"iterator","value":{"rev":"3-e6f70367a55cabbb89589f2a88be9ab0"}}, -{"id":"itunes","key":"itunes","value":{"rev":"7-47d151c372d70d0bc311141749c84d5a"}}, -{"id":"iws","key":"iws","value":{"rev":"3-dc7b4d18565b79d3e14aa691e5e632f4"}}, -{"id":"jQuery","key":"jQuery","value":{"rev":"29-f913933259b4ec5f4c5ea63466a4bb08"}}, -{"id":"jWorkflow","key":"jWorkflow","value":{"rev":"7-582cd7aa62085ec807117138b6439550"}}, -{"id":"jaCodeMap","key":"jaCodeMap","value":{"rev":"7-28efcbf4146977bdf1e594e0982ec097"}}, -{"id":"jaaulde-cookies","key":"jaaulde-cookies","value":{"rev":"3-d5b5a75f9cabbebb2804f0b4ae93d0c5"}}, -{"id":"jacker","key":"jacker","value":{"rev":"3-888174c7e3e2a5d241f2844257cf1b10"}}, -{"id":"jade","key":"jade","value":{"rev":"144-318a9d9f63906dc3da1ef7c1ee6420b5"}}, -{"id":"jade-browser","key":"jade-browser","value":{"rev":"9-0ae6b9e321cf04e3ca8fbfe0e38f4d9e"}}, -{"id":"jade-client-connect","key":"jade-client-connect","value":{"rev":"5-96dbafafa31187dd7f829af54432de8e"}}, -{"id":"jade-ext","key":"jade-ext","value":{"rev":"9-aac9a58a4e07d82bc496bcc4241d1be0"}}, -{"id":"jade-i18n","key":"jade-i18n","value":{"rev":"23-76a21a41b5376e10c083672dccf7fc62"}}, -{"id":"jade-serial","key":"jade-serial","value":{"rev":"3-5ec712e1d8cd8d5af20ae3e62ee92854"}}, -{"id":"jadedown","key":"jadedown","value":{"rev":"11-0d16ce847d6afac2939eebcb24a7216c"}}, -{"id":"jadeify","key":"jadeify","value":{"rev":"17-4322b68bb5a7e81e839edabbc8c405a4"}}, -{"id":"jadevu","key":"jadevu","value":{"rev":"15-1fd8557a6db3c23f267de76835f9ee65"}}, -{"id":"jah","key":"jah","value":{"rev":"3-f29704037a1cffe2b08abb4283bee4a4"}}, -{"id":"jake","key":"jake","value":{"rev":"36-5cb64b1c5a89ac53eb4d09d66a5b10e1"}}, -{"id":"jammit-express","key":"jammit-express","value":{"rev":"6-e3dfa928114a2721fe9b8882d284f759"}}, -{"id":"janrain","key":"janrain","value":{"rev":"5-9554501be76fb3a472076858d1abbcd5"}}, -{"id":"janrain-api","key":"janrain-api","value":{"rev":"3-f45a65c695f4c72fdd1bf3593d8aa796"}}, -{"id":"jaque","key":"jaque","value":{"rev":"32-7f269a70c67beefc53ba1684bff5a57b"}}, -{"id":"jar","key":"jar","value":{"rev":"3-7fe0ab4aa3a2ccc5d50853f118e7aeb5"}}, -{"id":"jarvis","key":"jarvis","value":{"rev":"3-fb203b29b397a0b12c1ae56240624e3d"}}, -{"id":"jarvis-test","key":"jarvis-test","value":{"rev":"5-9537ddae8291e6dad03bc0e6acc9ac80"}}, -{"id":"jasbin","key":"jasbin","value":{"rev":"25-ae22f276406ac8bb4293d78595ce02ad"}}, -{"id":"jasmine-dom","key":"jasmine-dom","value":{"rev":"17-686de4c573f507c30ff72c6671dc3d93"}}, -{"id":"jasmine-jquery","key":"jasmine-jquery","value":{"rev":"7-86c077497a367bcd9ea96d5ab8137394"}}, -{"id":"jasmine-node","key":"jasmine-node","value":{"rev":"27-4c544c41c69d2b3cb60b9953d1c46d54"}}, -{"id":"jasmine-reporters","key":"jasmine-reporters","value":{"rev":"3-21ba522ae38402848d5a66d3d4d9a2b3"}}, -{"id":"jasmine-runner","key":"jasmine-runner","value":{"rev":"23-7458777b7a6785efc878cfd40ccb99d8"}}, -{"id":"jasminy","key":"jasminy","value":{"rev":"3-ce76023bac40c5f690cba59d430fd083"}}, -{"id":"jason","key":"jason","value":{"rev":"15-394a59963c579ed5db37fada4d082b5c"}}, -{"id":"javiary","key":"javiary","value":{"rev":"5-661be61fd0f47c9609b7d148e298e2fc"}}, -{"id":"jazz","key":"jazz","value":{"rev":"12-d11d602c1240b134b0593425911242fc"}}, -{"id":"jdoc","key":"jdoc","value":{"rev":"3-0c61fdd6b367a9acac710e553927b290"}}, -{"id":"jeesh","key":"jeesh","value":{"rev":"13-23b4e1ecf9ca76685bf7f1bfc6c076f1"}}, -{"id":"jellyfish","key":"jellyfish","value":{"rev":"25-7fef81f9b5ef5d4abbcecb030a433a72"}}, -{"id":"jen","key":"jen","value":{"rev":"3-ab1b07453318b7e0254e1dadbee7868f"}}, -{"id":"jerk","key":"jerk","value":{"rev":"34-e31f26d5e3b700d0a3e5f5a5acf0d381"}}, -{"id":"jessie","key":"jessie","value":{"rev":"19-829b932e57204f3b7833b34f75d6bf2a"}}, -{"id":"jezebel","key":"jezebel","value":{"rev":"15-b67c259e160390064da69a512382e06f"}}, -{"id":"jimi","key":"jimi","value":{"rev":"10-cc4a8325d6b847362a422304a0057231"}}, -{"id":"jinjs","key":"jinjs","value":{"rev":"37-38fcf1989f1b251a35e4ff725118f55e"}}, -{"id":"jinkies","key":"jinkies","value":{"rev":"30-73fec0e854aa31bcbf3ae1ca04462b22"}}, -{"id":"jison","key":"jison","value":{"rev":"52-d03c6f5e2bdd7624d39d93ec5e88c383"}}, -{"id":"jitsu","key":"jitsu","value":{"rev":"164-95083f8275f0bf2834f62027569b4da2"}}, -{"id":"jitter","key":"jitter","value":{"rev":"16-3f7b183aa7922615f4b5b2fb46653477"}}, -{"id":"jj","key":"jj","value":{"rev":"21-1b3f97e9725e1241c96a884c85dc4e30"}}, -{"id":"jjw","key":"jjw","value":{"rev":"13-835c632dfc5df7dd37860bd0b2c1cb38"}}, -{"id":"jkwery","key":"jkwery","value":{"rev":"11-212429c9c9e1872d4e278da055b5ae0a"}}, -{"id":"jmen","key":"jmen","value":{"rev":"3-a0b67d5b84a077061d3fed2ddbf2c6a8"}}, -{"id":"jobmanager","key":"jobmanager","value":{"rev":"15-1a589ede5f10d1ea2f33f1bb91f9b3aa"}}, -{"id":"jobs","key":"jobs","value":{"rev":"12-3072b6164c5dca8fa9d24021719048ff"}}, -{"id":"jobvite","key":"jobvite","value":{"rev":"56-3d69b0e6d91722ef4908b4fe26bb5432"}}, -{"id":"jodoc","key":"jodoc","value":{"rev":"3-7b05c6d7b4c9a9fa85d3348948d2d52d"}}, -{"id":"johnny-mnemonic","key":"johnny-mnemonic","value":{"rev":"3-e8749d4be597f002aae720011b7c9273"}}, -{"id":"join","key":"join","value":{"rev":"5-ab92491dc83b5e8ed5f0cc49e306d5d5"}}, -{"id":"jolokia-client","key":"jolokia-client","value":{"rev":"26-1f93cb53f4a870b94540cdbf7627b1c4"}}, -{"id":"joo","key":"joo","value":{"rev":"11-e0d4a97eceacdd13769bc5f56e059aa7"}}, -{"id":"jools","key":"jools","value":{"rev":"3-9da332d524a117c4d72a58bb45fa34fd"}}, -{"id":"joose","key":"joose","value":{"rev":"22-ef8a1895680ad2f9c1cd73cd1afbb58e"}}, -{"id":"joosex-attribute","key":"joosex-attribute","value":{"rev":"18-119df97dba1ba2631c94d49e3142bbd7"}}, -{"id":"joosex-bridge-ext","key":"joosex-bridge-ext","value":{"rev":"20-5ad2168291aad2cf021df0a3eb103538"}}, -{"id":"joosex-class-simpleconstructor","key":"joosex-class-simpleconstructor","value":{"rev":"6-f71e02e44f611550374ad9f5d0c37fdf"}}, -{"id":"joosex-class-singleton","key":"joosex-class-singleton","value":{"rev":"6-3ba6b8644722b29febe384a368c18aab"}}, -{"id":"joosex-cps","key":"joosex-cps","value":{"rev":"20-493c65faf1ec59416bae475529c51cd4"}}, -{"id":"joosex-meta-lazy","key":"joosex-meta-lazy","value":{"rev":"13-ef8bc4e57006cfcecd72a344d8dc9da6"}}, -{"id":"joosex-namespace-depended","key":"joosex-namespace-depended","value":{"rev":"22-8a38a21f8564470b96082177e81f3db6"}}, -{"id":"joosex-observable","key":"joosex-observable","value":{"rev":"7-52e7018931e5465920bb6feab88aa468"}}, -{"id":"joosex-role-parameterized","key":"joosex-role-parameterized","value":{"rev":"6-65aa4fa4967c4fbe06357ccda5e6f810"}}, -{"id":"joosex-simplerequest","key":"joosex-simplerequest","value":{"rev":"10-12d105b60b8b3ca3a3626ca0ec53892d"}}, -{"id":"josp","key":"josp","value":{"rev":"3-c4fa8445a0d96037e00fe96d007bcf0c"}}, -{"id":"jot","key":"jot","value":{"rev":"3-8fab571ce3ad993f3594f3c2e0fc6915"}}, -{"id":"journey","key":"journey","value":{"rev":"40-efe1fa6c8d735592077c9a24b3b56a03"}}, -{"id":"jpeg","key":"jpeg","value":{"rev":"8-ab437fbaf88f32a7fb625a0b27521292"}}, -{"id":"jq","key":"jq","value":{"rev":"3-9d83287aa9e6aab25590fac9adbab968"}}, -{"id":"jqNode","key":"jqNode","value":{"rev":"3-fcaf2c47aba5637a4a23c64b6fc778cf"}}, -{"id":"jqbuild","key":"jqbuild","value":{"rev":"3-960edcea36784aa9ca135cd922e0cb9b"}}, -{"id":"jqserve","key":"jqserve","value":{"rev":"3-39272c5479aabaafe66ffa26a6eb3bb5"}}, -{"id":"jqtpl","key":"jqtpl","value":{"rev":"54-ce2b62ced4644d5fe24c3a8ebcb4d528"}}, -{"id":"jquajax","key":"jquajax","value":{"rev":"3-a079cb8f3a686faaafe420760e77a330"}}, -{"id":"jquery","key":"jquery","value":{"rev":"27-60fd58bba99d044ffe6e140bafd72595"}}, -{"id":"jquery-browserify","key":"jquery-browserify","value":{"rev":"9-a4e9afd657f3c632229afa356382f6a4"}}, -{"id":"jquery-deferred","key":"jquery-deferred","value":{"rev":"5-0fd0cec51f7424a50f0dba3cbe74fd58"}}, -{"id":"jquery-drive","key":"jquery-drive","value":{"rev":"3-8474f192fed5c5094e56bc91f5e8a0f8"}}, -{"id":"jquery-mousewheel","key":"jquery-mousewheel","value":{"rev":"3-cff81086cf651e52377a8d5052b09d64"}}, -{"id":"jquery-placeholdize","key":"jquery-placeholdize","value":{"rev":"3-7acc3fbda1b8daabce18876d2b4675e3"}}, -{"id":"jquery-tmpl-jst","key":"jquery-tmpl-jst","value":{"rev":"13-575031eb2f2b1e4c5562e195fce0bc93"}}, -{"id":"jquery.effects.blind","key":"jquery.effects.blind","value":{"rev":"3-5f3bec5913edf1bfcee267891f6204e2"}}, -{"id":"jquery.effects.bounce","key":"jquery.effects.bounce","value":{"rev":"3-245b2e7d9a1295dd0f7d568b8087190d"}}, -{"id":"jquery.effects.clip","key":"jquery.effects.clip","value":{"rev":"3-7aa63a590b6d90d5ea20e21c8dda675d"}}, -{"id":"jquery.effects.core","key":"jquery.effects.core","value":{"rev":"3-dd2fa270d8aea21104c2c92d6b06500d"}}, -{"id":"jquery.effects.drop","key":"jquery.effects.drop","value":{"rev":"3-8d0e30016e99460063a9a9000ce7b032"}}, -{"id":"jquery.effects.explode","key":"jquery.effects.explode","value":{"rev":"3-3d5e3bb2fb451f7eeaeb72b6743b6e6c"}}, -{"id":"jquery.effects.fade","key":"jquery.effects.fade","value":{"rev":"3-f362c762053eb278b5db5f92e248c3a5"}}, -{"id":"jquery.effects.fold","key":"jquery.effects.fold","value":{"rev":"3-c7d823c2b25c4f1e6a1801f4b1bc7a2c"}}, -{"id":"jquery.effects.highlight","key":"jquery.effects.highlight","value":{"rev":"3-44ef3c62a6b829382bffa6393cd31ed9"}}, -{"id":"jquery.effects.pulsate","key":"jquery.effects.pulsate","value":{"rev":"3-3cad87635cecc2602d40682cf669d2fe"}}, -{"id":"jquery.effects.scale","key":"jquery.effects.scale","value":{"rev":"3-2c8df02eeed343088e2253d84064a219"}}, -{"id":"jquery.effects.shake","key":"jquery.effects.shake","value":{"rev":"3-d63ab567d484311744d848b520a720c7"}}, -{"id":"jquery.effects.slide","key":"jquery.effects.slide","value":{"rev":"3-9eb5d1075d67045a8fa305e596981934"}}, -{"id":"jquery.effects.transfer","key":"jquery.effects.transfer","value":{"rev":"3-371bc87350ede6da53a40468b63200a9"}}, -{"id":"jquery.tmpl","key":"jquery.tmpl","value":{"rev":"5-75efd6c8c0ce030f2da12b984f9dfe6c"}}, -{"id":"jquery.ui.accordion","key":"jquery.ui.accordion","value":{"rev":"3-964ee7d6c50f31e7db6631da28e2261a"}}, -{"id":"jquery.ui.autocomplete","key":"jquery.ui.autocomplete","value":{"rev":"3-950d240629d142eab5e07c2776e39bcc"}}, -{"id":"jquery.ui.button","key":"jquery.ui.button","value":{"rev":"3-a1c7f3eeb9298ac0c116d75a176a6d17"}}, -{"id":"jquery.ui.core","key":"jquery.ui.core","value":{"rev":"3-b7ba340b7304a304f85c4d13438d1195"}}, -{"id":"jquery.ui.datepicker","key":"jquery.ui.datepicker","value":{"rev":"3-5b76579057f1b870959a06ab833f1972"}}, -{"id":"jquery.ui.dialog","key":"jquery.ui.dialog","value":{"rev":"3-0c314cee86bf67298759efcfd47246f6"}}, -{"id":"jquery.ui.draggable","key":"jquery.ui.draggable","value":{"rev":"3-b7a15d2bdbcdc6f0f3cd6e4522f9f1f3"}}, -{"id":"jquery.ui.droppable","key":"jquery.ui.droppable","value":{"rev":"3-86d8a1558f5e9383b271b4d968ba081d"}}, -{"id":"jquery.ui.mouse","key":"jquery.ui.mouse","value":{"rev":"3-ccb88d773c452c778c694f9f551cb816"}}, -{"id":"jquery.ui.position","key":"jquery.ui.position","value":{"rev":"3-c49c13b38592a363585600b7af54d977"}}, -{"id":"jquery.ui.progressbar","key":"jquery.ui.progressbar","value":{"rev":"3-b28dfadab64f9548b828c42bf870fcc9"}}, -{"id":"jquery.ui.resizable","key":"jquery.ui.resizable","value":{"rev":"3-aa356230544cbe8ab8dc5fab08cc0fa7"}}, -{"id":"jquery.ui.selectable","key":"jquery.ui.selectable","value":{"rev":"3-6b11846c104d580556e40eb5194c45f2"}}, -{"id":"jquery.ui.slider","key":"jquery.ui.slider","value":{"rev":"3-e8550b76bf58a9cbeca9ea91eb763257"}}, -{"id":"jquery.ui.sortable","key":"jquery.ui.sortable","value":{"rev":"3-1ddd981bd720f055fbd5bb1d06df55ad"}}, -{"id":"jquery.ui.tabs","key":"jquery.ui.tabs","value":{"rev":"3-e0514383f4d920b9dc23ef7a7ea4d8af"}}, -{"id":"jquery.ui.widget","key":"jquery.ui.widget","value":{"rev":"3-3a0800fa067c12d013168f74acf21e6d"}}, -{"id":"jqueryify","key":"jqueryify","value":{"rev":"3-2655cf6a45795a8bd138a464e6c18f04"}}, -{"id":"jrep","key":"jrep","value":{"rev":"3-edbcf6931b8a2b3f550727d8b839acc3"}}, -{"id":"js-beautify-node","key":"js-beautify-node","value":{"rev":"3-401cd1c130aaec2c090b578fe8db6290"}}, -{"id":"js-class","key":"js-class","value":{"rev":"5-a63fbb0136dcd602feee72e70674d5db"}}, -{"id":"js-jango","key":"js-jango","value":{"rev":"3-af4e4a7844791617e66a40a1c403bb98"}}, -{"id":"js-loader","key":"js-loader","value":{"rev":"13-8d9729495c1692e47d2cd923e839b4c8"}}, -{"id":"js-manager","key":"js-manager","value":{"rev":"5-6d384a2ce4737f13d417f85689c3c372"}}, -{"id":"js-nts","key":"js-nts","value":{"rev":"3-7d921611b567d2d890bc983c343558ef"}}, -{"id":"js-openstack","key":"js-openstack","value":{"rev":"11-d56996be276fbe6162573575932b1cba"}}, -{"id":"js-select","key":"js-select","value":{"rev":"9-9d20f6d86d9e6f8a84191346288b76ed"}}, -{"id":"js.io","key":"js.io","value":{"rev":"3-c5e16e13372ba592ccf2ac86ee007a1f"}}, -{"id":"js2","key":"js2","value":{"rev":"35-2dc694e48b67252d8787f5e889a07430"}}, -{"id":"js2coffee","key":"js2coffee","value":{"rev":"19-8eeafa894dcc0dc306b02e728543511e"}}, -{"id":"jsDAV","key":"jsDAV","value":{"rev":"11-4ab1935d98372503439b054daef2e78e"}}, -{"id":"jsDump","key":"jsDump","value":{"rev":"5-32d6e4032bd114245356970f0b76a58a"}}, -{"id":"jsSourceCodeParser","key":"jsSourceCodeParser","value":{"rev":"3-78c5e8624ab25fca99a7bb6cd9be402b"}}, -{"id":"jsapp","key":"jsapp","value":{"rev":"3-6758eb2743cc22f723a6612b34c8d943"}}, -{"id":"jscc-node","key":"jscc-node","value":{"rev":"3-5f52dc20dc2a188bc32e7219c9d2f225"}}, -{"id":"jscheckstyle","key":"jscheckstyle","value":{"rev":"5-82021f06a1bd824ac195e0ab8a3b598c"}}, -{"id":"jsclass","key":"jsclass","value":{"rev":"9-2a0656b9497c5a8208a0fefa5aae3350"}}, -{"id":"jsconfig","key":"jsconfig","value":{"rev":"3-b1afef99468f81eff319453623135a56"}}, -{"id":"jscssp","key":"jscssp","value":{"rev":"6-413ad0701e6dbb412e8a01aadb6672c4"}}, -{"id":"jsdata","key":"jsdata","value":{"rev":"5-53f8b26f28291dccfdff8f14e7f4c44c"}}, -{"id":"jsdeferred","key":"jsdeferred","value":{"rev":"8-bc238b921a1fa465503722756a98e9b7"}}, -{"id":"jsdoc","key":"jsdoc","value":{"rev":"3-386eb47a2761a1ad025996232751fba9"}}, -{"id":"jsdog","key":"jsdog","value":{"rev":"11-d4a523898a7c474b5c7b8cb8b24bafe8"}}, -{"id":"jsdom","key":"jsdom","value":{"rev":"63-86bc6b9d8bfdb99b793ac959e126f7ff"}}, -{"id":"jsftp","key":"jsftp","value":{"rev":"35-89cd772521d7ac3cead71c602ddeb819"}}, -{"id":"jsgi","key":"jsgi","value":{"rev":"20-dbef9d8dfb5c9bf1a3b6014159bb305a"}}, -{"id":"jsgi-node","key":"jsgi-node","value":{"rev":"1-8ec0892e521754aaf88684714d306af9"}}, -{"id":"jsgrep","key":"jsgrep","value":{"rev":"7-be19445481acdbbb684fdc2425d88d08"}}, -{"id":"jshelpers","key":"jshelpers","value":{"rev":"11-9509dcdd48bc494de76cae66217ebedb"}}, -{"id":"jshint","key":"jshint","value":{"rev":"34-ed2e7ea0e849126bd9821b86f23b7314"}}, -{"id":"jshint-autofix","key":"jshint-autofix","value":{"rev":"9-abbb3622aa8a47a8890dbbaab0009b6d"}}, -{"id":"jshint-mode","key":"jshint-mode","value":{"rev":"5-06ec066819b93c7ae6782c755a0e2125"}}, -{"id":"jshint-runner","key":"jshint-runner","value":{"rev":"7-6fc8a15e387a4e81e300a54a86a3a240"}}, -{"id":"jshtml","key":"jshtml","value":{"rev":"5-d3e96c31cf1cd2fcf7743defc1631c3a"}}, -{"id":"jsinc","key":"jsinc","value":{"rev":"9-0e4dc3ba04b440085a79d6001232abfc"}}, -{"id":"jslint","key":"jslint","value":{"rev":"10-ab451352333b5f3d29c6cdbab49187dd"}}, -{"id":"jslint-core","key":"jslint-core","value":{"rev":"3-1f874d8cca07b6f007bc80c23ba15e2e"}}, -{"id":"jslint-strict","key":"jslint-strict","value":{"rev":"8-3d694a0f3079691da1866de16f290ea2"}}, -{"id":"jslinux","key":"jslinux","value":{"rev":"13-033cb60c7867aae599863323a97f45c0"}}, -{"id":"jslitmus","key":"jslitmus","value":{"rev":"6-d3f3f82ea1a376acc2b24c69da003409"}}, -{"id":"jsmeter","key":"jsmeter","value":{"rev":"5-7838bb9b970cbaa29a48802c508fd091"}}, -{"id":"jsmin","key":"jsmin","value":{"rev":"6-002ad1b385915e60f895b5e52492fb94"}}, -{"id":"json","key":"json","value":{"rev":"39-1d24fb8c3bdf0ac533bfc52e74420adc"}}, -{"id":"json-browser","key":"json-browser","value":{"rev":"6-883f051c1297cf631adba1c855ff2e13"}}, -{"id":"json-builder","key":"json-builder","value":{"rev":"5-e7a996ff1ef89114ce2ab6de9b653af8"}}, -{"id":"json-command","key":"json-command","value":{"rev":"16-8239cb65563720c42da5562d3a031b09"}}, -{"id":"json-fu","key":"json-fu","value":{"rev":"5-7933c35711cb9d7673d7514fe495c56d"}}, -{"id":"json-line-protocol","key":"json-line-protocol","value":{"rev":"7-98de63467d154b40a029391af8a26042"}}, -{"id":"json-object","key":"json-object","value":{"rev":"7-534cd9680c386c5b9800848755698f2b"}}, -{"id":"json-ref","key":"json-ref","value":{"rev":"3-cd09776d166c3f77013e429737c7e1e9"}}, -{"id":"json-san","key":"json-san","value":{"rev":"7-8683abde23232c1d84266e7a2d5c4527"}}, -{"id":"json-schema","key":"json-schema","value":{"rev":"1-2f323062e7ec80d2ff765da43c7aaa7d"}}, -{"id":"json-sockets","key":"json-sockets","value":{"rev":"26-bfef71c0d9fb4d56010b05f47f142748"}}, -{"id":"json-storage","key":"json-storage","value":{"rev":"3-46139e3a54c0a27e67820df2c7e87dbf"}}, -{"id":"json-storage-model","key":"json-storage-model","value":{"rev":"3-8b77044e192791613cf92b2f3317357f"}}, -{"id":"json-streamify","key":"json-streamify","value":{"rev":"5-d98cd72265fba652481eef6baa980f46"}}, -{"id":"json-streams","key":"json-streams","value":{"rev":"3-e07fc5ca24b33145c8aacf9995d46723"}}, -{"id":"json-tables","key":"json-tables","value":{"rev":"3-37a652b54880487e66ffeee6822b945b"}}, -{"id":"json-template","key":"json-template","value":{"rev":"3-9ee3a101c60ea682fb88759b2df837e4"}}, -{"id":"json2","key":"json2","value":{"rev":"12-bc3d411db772e0947ca58a54c2084073"}}, -{"id":"json2ify","key":"json2ify","value":{"rev":"3-c2d6677cc35e4668c97cf6800a4728d8"}}, -{"id":"json2xml","key":"json2xml","value":{"rev":"3-e955b994479362685e2197b39909dea2"}}, -{"id":"json_req","key":"json_req","value":{"rev":"15-14520bc890cbb0ab4c142b59bf21c9f1"}}, -{"id":"jsonapi","key":"jsonapi","value":{"rev":"11-2b27aaca5643d6a5b3ab38721cf6342f"}}, -{"id":"jsonconfig","key":"jsonconfig","value":{"rev":"5-0072bb54cb0ae5b13eee4f1657ba6a29"}}, -{"id":"jsond","key":"jsond","value":{"rev":"13-7c3622aeb147dae4698608ee32d81b45"}}, -{"id":"jsondate","key":"jsondate","value":{"rev":"3-1da5d30ee1cf7c6d9605a446efd91478"}}, -{"id":"jsonds","key":"jsonds","value":{"rev":"9-af2867869a46787e58c337e700dbf0dd"}}, -{"id":"jsonds2","key":"jsonds2","value":{"rev":"3-e7ed9647cc1ba72e59b625840358c7ca"}}, -{"id":"jsonfiles","key":"jsonfiles","value":{"rev":"3-5e643ba75c401f653f505e7938540d83"}}, -{"id":"jsonify","key":"jsonify","value":{"rev":"3-91207fd1bc11668be7906f74992de6bb"}}, -{"id":"jsonize","key":"jsonize","value":{"rev":"3-4881031480a5326d9f5966189170db25"}}, -{"id":"jsonlint","key":"jsonlint","value":{"rev":"11-88d3c1c395846e7687f410e0dc405469"}}, -{"id":"jsonml","key":"jsonml","value":{"rev":"3-9990d9515fa554b5c7ff8bf8c7bb3308"}}, -{"id":"jsonparse","key":"jsonparse","value":{"rev":"3-569962847a5fd9d65fdf91af9e3e87a5"}}, -{"id":"jsonpointer","key":"jsonpointer","value":{"rev":"5-0310a11e82e9e22a4e5239dee2bc2213"}}, -{"id":"jsonprettify","key":"jsonprettify","value":{"rev":"3-173ae677f2110dfff8cb17dd2b4c68de"}}, -{"id":"jsonreq","key":"jsonreq","value":{"rev":"5-84b47d8c528ea7efa9aae113e5ff53cf"}}, -{"id":"jsonrpc","key":"jsonrpc","value":{"rev":"10-e40ff49715537320cbbbde67378f099e"}}, -{"id":"jsonrpc-ws","key":"jsonrpc-ws","value":{"rev":"7-73c385f3d35dadbdc87927f6a751e3ca"}}, -{"id":"jsonrpc2","key":"jsonrpc2","value":{"rev":"13-71efdea4f551d3a2550fcf5355ea8c8c"}}, -{"id":"jsontool","key":"jsontool","value":{"rev":"14-44bc979d3a8dc9295c825def01e533b4"}}, -{"id":"jsontoxml","key":"jsontoxml","value":{"rev":"8-2640fd26237ab4a45450748d392dd2d2"}}, -{"id":"jsontry","key":"jsontry","value":{"rev":"3-adb3f32f86419ac4b589ce41ab253952"}}, -{"id":"jsorm-i18n","key":"jsorm-i18n","value":{"rev":"3-54347174039512616ed76cc9a37605ea"}}, -{"id":"jsorm-utilities","key":"jsorm-utilities","value":{"rev":"3-187fc9f86ed8d32ebcb6c451fa7cc3c4"}}, -{"id":"jspack","key":"jspack","value":{"rev":"3-84955792d8b57fc301968daf674bace7"}}, -{"id":"jspkg","key":"jspkg","value":{"rev":"5-f5471c37554dad3492021490a70a1190"}}, -{"id":"jspp","key":"jspp","value":{"rev":"8-7607018fa48586f685dda17d77d0999b"}}, -{"id":"jss","key":"jss","value":{"rev":"20-4517b1daeda4f878debddc9f23347f00"}}, -{"id":"jst","key":"jst","value":{"rev":"27-8372bf5c052b6bd6e28f5d2c89b47e49"}}, -{"id":"jstestdriver","key":"jstestdriver","value":{"rev":"3-d26b172af33d6c45fc3dc96b96865714"}}, -{"id":"jstoxml","key":"jstoxml","value":{"rev":"15-c26b77ed5228500238c7b21a3dbdbbb7"}}, -{"id":"jsup","key":"jsup","value":{"rev":"3-54eb8598ae1a49bd1540e482a44a6abc"}}, -{"id":"jthon","key":"jthon","value":{"rev":"5-d578940ac32497839ff48d3f6205e9e2"}}, -{"id":"juggernaut","key":"juggernaut","value":{"rev":"20-15d33218943b9ec64b642e2a4a05e4b8"}}, -{"id":"juggernaut-yoomee","key":"juggernaut-yoomee","value":{"rev":"7-a58d429e46aac76260e236c64d20ff02"}}, -{"id":"jump","key":"jump","value":{"rev":"19-d47e23c31dc623b54e60004b08f6f624"}}, -{"id":"jumprope","key":"jumprope","value":{"rev":"5-98d4e2452f14d3b0996f04882b07d674"}}, -{"id":"junction","key":"junction","value":{"rev":"3-2b73ea17d862b1e95039141e98e53268"}}, -{"id":"jus-config","key":"jus-config","value":{"rev":"5-d2da00317dceb712d82dbfc776122dbe"}}, -{"id":"jus-i18n","key":"jus-i18n","value":{"rev":"3-d146cfc5f3c9aee769390ed921836b6e"}}, -{"id":"jus-task","key":"jus-task","value":{"rev":"13-d127de2a102eef2eb0d1b67810ecd558"}}, -{"id":"justtest","key":"justtest","value":{"rev":"17-467ee4ca606f0447a0c458550552fd0a"}}, -{"id":"jute","key":"jute","value":{"rev":"99-158d262e9126de5026bbfeb3168d9277"}}, -{"id":"jwt","key":"jwt","value":{"rev":"3-4cb8a706d1bc3c300bdadeba781c7bc4"}}, -{"id":"kaffeine","key":"kaffeine","value":{"rev":"47-261825b8d8cdf168387c6a275682dd0b"}}, -{"id":"kafka","key":"kafka","value":{"rev":"9-7465d4092e6322d0b744f017be8ffcea"}}, -{"id":"kahan","key":"kahan","value":{"rev":"5-107bb2dcdb51faaa00aef1e37eff91eb"}}, -{"id":"kahve-ansi","key":"kahve-ansi","value":{"rev":"5-a86d9a3ea56362fa81c8ee9f1ef8f2ef"}}, -{"id":"kahve-cake","key":"kahve-cake","value":{"rev":"3-873b4e553c4ba417c888aadce3b800f6"}}, -{"id":"kahve-classmethod","key":"kahve-classmethod","value":{"rev":"3-08e0a5786edc15539cc6746fe6c65bec"}}, -{"id":"kahve-exception","key":"kahve-exception","value":{"rev":"3-fb9d839cfdc069271cbc10fa27a87f3c"}}, -{"id":"kahve-progress","key":"kahve-progress","value":{"rev":"3-d2fcdd99793a0c3c3a314afb067a3701"}}, -{"id":"kanso","key":"kanso","value":{"rev":"41-2b18ab56cc86313daa840b7b3f63b318"}}, -{"id":"kaph","key":"kaph","value":{"rev":"7-c24622e38cf23bac67459bfe5a0edd63"}}, -{"id":"karait","key":"karait","value":{"rev":"9-a4abc4bc11c747448c4884cb714737c9"}}, -{"id":"kasabi","key":"kasabi","value":{"rev":"3-36cb65aef11d181c532f4549d58944e6"}}, -{"id":"kassit","key":"kassit","value":{"rev":"27-6fafe5122a4dda542a34ba18dddfc9ea"}}, -{"id":"kdtree","key":"kdtree","value":{"rev":"9-177bf5018be1f177d302af1d746b0462"}}, -{"id":"keeper","key":"keeper","value":{"rev":"13-43ce24b6e1fb8ac23c58a78e3e92d137"}}, -{"id":"kestrel","key":"kestrel","value":{"rev":"3-1303ae0617ed1076eed022176c78b0c4"}}, -{"id":"kettle","key":"kettle","value":{"rev":"3-385c10c43df484666148e796840e72c7"}}, -{"id":"keyed_list","key":"keyed_list","value":{"rev":"5-c98d8bc8619300da1a09098bb298bf16"}}, -{"id":"keyframely","key":"keyframely","value":{"rev":"5-586380d2258a099d8fa4748f2688b571"}}, -{"id":"keygrip","key":"keygrip","value":{"rev":"18-4178954fb4f0e26407851104876f1a03"}}, -{"id":"keyjson","key":"keyjson","value":{"rev":"5-96ab1d8b6fa77864883b657360070af4"}}, -{"id":"keymaster","key":"keymaster","value":{"rev":"8-e7eb722489b02991943e9934b8155162"}}, -{"id":"keys","key":"keys","value":{"rev":"12-8b34b8f593667f0c23f1841edb5b6fa3"}}, -{"id":"keysym","key":"keysym","value":{"rev":"13-ec57906511f8f2f896a9e81dc206ea77"}}, -{"id":"keyx","key":"keyx","value":{"rev":"3-80dc49b56e3ba1d280298c36afa2a82c"}}, -{"id":"khronos","key":"khronos","value":{"rev":"3-1a3772db2725c4c3098d5cf4ca2189a4"}}, -{"id":"kindred","key":"kindred","value":{"rev":"5-99c7f4f06e4a47e476f9d75737f719d7"}}, -{"id":"kiokujs","key":"kiokujs","value":{"rev":"8-4b96a9bc1866f58bb263b310e64df403"}}, -{"id":"kiokujs-backend-batch","key":"kiokujs-backend-batch","value":{"rev":"3-4739de0f2e0c01581ce0b02638d3df02"}}, -{"id":"kiokujs-backend-couchdb","key":"kiokujs-backend-couchdb","value":{"rev":"8-53e830e0a7e8ea810883c00ce79bfeef"}}, -{"id":"kiss.js","key":"kiss.js","value":{"rev":"11-7c9b1d7e2faee25ade6f1cad1bb261d9"}}, -{"id":"kissy","key":"kissy","value":{"rev":"8-3f8f7c169a3e84df6a7f68315f13b3ba"}}, -{"id":"kitkat","key":"kitkat","value":{"rev":"41-5f2600e4e1c503f63702c74195ff3361"}}, -{"id":"kitkat-express","key":"kitkat-express","value":{"rev":"3-91ef779ed9acdad1ca6f776e10a70246"}}, -{"id":"kizzy","key":"kizzy","value":{"rev":"5-f281b9e4037eda414f918ec9021e28c9"}}, -{"id":"kjs","key":"kjs","value":{"rev":"3-2ee03262f843e497161f1aef500dd229"}}, -{"id":"kju","key":"kju","value":{"rev":"5-0a7de1cd26864c85a22c7727c660d441"}}, -{"id":"klass","key":"klass","value":{"rev":"39-61491ef3824772d5ef33f7ea04219461"}}, -{"id":"klout-js","key":"klout-js","value":{"rev":"8-8d99f6dad9c21cb5da0d64fefef8c6d6"}}, -{"id":"knid","key":"knid","value":{"rev":"7-2cbfae088155da1044b568584cd296df"}}, -{"id":"knox","key":"knox","value":{"rev":"19-3c42553bd201b23a6bc15fdd073dad17"}}, -{"id":"knox-stream","key":"knox-stream","value":{"rev":"17-e40275f926b6ed645e4ef04caf8e5df4"}}, -{"id":"kns","key":"kns","value":{"rev":"9-5da1a89ad8c08f4b10cd715036200da3"}}, -{"id":"ko","key":"ko","value":{"rev":"9-9df2853d0e9ed9f7740f53291d0035dd"}}, -{"id":"koala","key":"koala","value":{"rev":"8-9e3fea91917f6d8cfb5aae22115e132f"}}, -{"id":"kohai","key":"kohai","value":{"rev":"3-1721a193589459fa077fea809fd7c9a9"}}, -{"id":"koku","key":"koku","value":{"rev":"5-414736980e0e70d90cd7f29b175fb18c"}}, -{"id":"komainu","key":"komainu","value":{"rev":"5-0f1a8f132fe58385e989dd4f93aefa26"}}, -{"id":"komodo-scheme","key":"komodo-scheme","value":{"rev":"3-97d1bd27f069684c491012e079fd82c4"}}, -{"id":"konphyg","key":"konphyg","value":{"rev":"7-e5fc03d6ddf39f2e0723291800bf0d43"}}, -{"id":"kranium","key":"kranium","value":{"rev":"3-4a78d2eb28e949a55b0dbd2ab00cecaf"}}, -{"id":"kue","key":"kue","value":{"rev":"21-053b32204d89a3067c5a90ca62ede08c"}}, -{"id":"kyatchi","key":"kyatchi","value":{"rev":"21-8dfbbe498f3740a2869c82e4ab4522d1"}}, -{"id":"kyoto","key":"kyoto","value":{"rev":"15-b9acdad89d56c71b6f427a443c16f85f"}}, -{"id":"kyoto-client","key":"kyoto-client","value":{"rev":"11-7fb392ee23ce64a48ae5638d713f4fbd"}}, -{"id":"kyoto-tycoon","key":"kyoto-tycoon","value":{"rev":"18-81ece8df26dbd9986efe1d97d935bec2"}}, -{"id":"kyuri","key":"kyuri","value":{"rev":"9-bedd4c087bd7bf612bde5e862d8b91bb"}}, -{"id":"labBuilder","key":"labBuilder","value":{"rev":"11-37f85b5325f1ccf25193c8b737823185"}}, -{"id":"laconic","key":"laconic","value":{"rev":"3-f5b7b9ac113fe7d32cbf4cb0d01c3052"}}, -{"id":"languagedetect","key":"languagedetect","value":{"rev":"3-ac487c034a3470ebd47b54614ea848f9"}}, -{"id":"lastfm","key":"lastfm","value":{"rev":"52-5af213489ca6ecdf2afc851c4642b082"}}, -{"id":"layers","key":"layers","value":{"rev":"7-62cd47d9645faa588c635dab2fbd2ef0"}}, -{"id":"lazy","key":"lazy","value":{"rev":"18-9b5ccdc9c3a970ec4c2b63b6f882da6a"}}, -{"id":"lazy-image","key":"lazy-image","value":{"rev":"5-34a6bc95017c50b3cb69981c7343e5da"}}, -{"id":"lazyBum","key":"lazyBum","value":{"rev":"15-03da6d744ba8cce7efca88ccb7e18c4d"}}, -{"id":"lazyprop","key":"lazyprop","value":{"rev":"14-82b4bcf318094a7950390f03e2fec252"}}, -{"id":"ldapjs","key":"ldapjs","value":{"rev":"11-e2b28e11a0aebe37b758d8f1ed61dd57"}}, -{"id":"ldapjs-riak","key":"ldapjs-riak","value":{"rev":"7-005413a1d4e371663626a3cca200c7e0"}}, -{"id":"ldifgrep","key":"ldifgrep","value":{"rev":"3-e4f06821a3444abbcd3c0c26300dcdda"}}, -{"id":"leaf","key":"leaf","value":{"rev":"8-0ccf5cdd1b59717b53375fe4bf044ec3"}}, -{"id":"lean","key":"lean","value":{"rev":"3-32dbbc771a3f1f6697c21c5d6c516967"}}, -{"id":"leche","key":"leche","value":{"rev":"7-0f5e19052ae1e3cb25ff2aa73271ae4f"}}, -{"id":"leche.spice.io","key":"leche.spice.io","value":{"rev":"3-07db415fdb746873f211e8155ecdf232"}}, -{"id":"less","key":"less","value":{"rev":"37-160fe5ea5dba44f02defdb8ec8c647d5"}}, -{"id":"less-bal","key":"less-bal","value":{"rev":"3-d50532c7c46013a62d06a0e54f8846ce"}}, -{"id":"less4clients","key":"less4clients","value":{"rev":"5-343d2973a166801681c856558d975ddf"}}, -{"id":"lessup","key":"lessup","value":{"rev":"9-a2e7627ef1b493fe82308d019ae481ac"}}, -{"id":"lessweb","key":"lessweb","value":{"rev":"9-e21794e578884c228dbed7c5d6128a41"}}, -{"id":"leveldb","key":"leveldb","value":{"rev":"11-3809e846a7a5ff883d17263288664195"}}, -{"id":"levenshtein","key":"levenshtein","value":{"rev":"6-44d27b6a6bc407772cafc29af485854f"}}, -{"id":"lib","key":"lib","value":{"rev":"5-a95272f11e927888c8b711503fce670b"}}, -{"id":"libdtrace","key":"libdtrace","value":{"rev":"8-4d4f72b2349154da514700f576e34564"}}, -{"id":"liberator","key":"liberator","value":{"rev":"15-b702710ccb3b45e41e9e2f3ebb6375ae"}}, -{"id":"libirc","key":"libirc","value":{"rev":"3-05b125de0c179dd311129aac2e1c8047"}}, -{"id":"liblzg","key":"liblzg","value":{"rev":"5-445ed45dc3cd166a299f85f6149aa098"}}, -{"id":"libnotify","key":"libnotify","value":{"rev":"10-c6723206898865e4828e963f5acc005e"}}, -{"id":"libxml-to-js","key":"libxml-to-js","value":{"rev":"33-64d3152875d33d6feffd618152bc41df"}}, -{"id":"libxmlext","key":"libxmlext","value":{"rev":"3-6a896dacba6f25fbca9b79d4143aaa9a"}}, -{"id":"libxmljs","key":"libxmljs","value":{"rev":"17-4b2949b53d9ecde79a99361774c1144b"}}, -{"id":"libxpm","key":"libxpm","value":{"rev":"3-c03efe75832c4416ceee5d72be12a8ef"}}, -{"id":"libyaml","key":"libyaml","value":{"rev":"5-f279bde715345a4e81d43c1d798ee608"}}, -{"id":"lift","key":"lift","value":{"rev":"21-61dcb771e5e0dc03fa327120d440ccda"}}, -{"id":"light-traits","key":"light-traits","value":{"rev":"26-b35c49550f9380fd462d57c64d51540f"}}, -{"id":"lightnode","key":"lightnode","value":{"rev":"3-ce37ccbf6a6546d4fa500e0eff84e882"}}, -{"id":"limestone","key":"limestone","value":{"rev":"3-d6f76ae98e4189db4ddfa8e15b4cdea9"}}, -{"id":"limited-file","key":"limited-file","value":{"rev":"3-c1d78250965b541836a70d3e867c694f"}}, -{"id":"lin","key":"lin","value":{"rev":"17-0a26ea2a603df0d14a9c40aad96bfb5e"}}, -{"id":"line-parser","key":"line-parser","value":{"rev":"7-84047425699f5a8a8836f4f2e63777bc"}}, -{"id":"line-reader","key":"line-reader","value":{"rev":"9-d2a7cb3a9793149e643490dc16a1eb50"}}, -{"id":"linebuffer","key":"linebuffer","value":{"rev":"12-8e79075aa213ceb49b28e0af7b3f3861"}}, -{"id":"lines","key":"lines","value":{"rev":"9-01a0565f47c3816919ca75bf77539df5"}}, -{"id":"lines-adapter","key":"lines-adapter","value":{"rev":"23-f287561e42a841c00bbf94bc8741bebc"}}, -{"id":"linestream","key":"linestream","value":{"rev":"5-18c2be87653ecf20407ed70eeb601ae7"}}, -{"id":"lingo","key":"lingo","value":{"rev":"10-b3d62b203c4af108feeaf0e32b2a4186"}}, -{"id":"link","key":"link","value":{"rev":"15-7570cea23333dbe3df11fd71171e6226"}}, -{"id":"linkedin-js","key":"linkedin-js","value":{"rev":"22-1bb1f392a9838684076b422840cf98eb"}}, -{"id":"linkscape","key":"linkscape","value":{"rev":"5-7272f50a54b1db015ce6d1e79eeedad7"}}, -{"id":"linkshare","key":"linkshare","value":{"rev":"3-634c4a18a217f77ccd6b89a9a2473d2a"}}, -{"id":"linode-api","key":"linode-api","value":{"rev":"13-2b43281ec86206312a2c387c9fc2c49f"}}, -{"id":"lint","key":"lint","value":{"rev":"49-fb76fddeb3ca609e5cac75fb0b0ec216"}}, -{"id":"linter","key":"linter","value":{"rev":"18-0fc884c96350f860cf2695f615572dba"}}, -{"id":"lintnode","key":"lintnode","value":{"rev":"8-b70bca986d7bde759521d0693dbc28b8"}}, -{"id":"linux-util","key":"linux-util","value":{"rev":"9-d049e8375e9c50b7f2b6268172d79734"}}, -{"id":"liquid","key":"liquid","value":{"rev":"3-353fa3c93ddf1951e3a75d60e6e8757b"}}, -{"id":"liquor","key":"liquor","value":{"rev":"3-4ee78e69a4a400a4de3491b0954947e7"}}, -{"id":"listener","key":"listener","value":{"rev":"5-02b5858d36aa99dcc5fc03c9274c94ee"}}, -{"id":"litmus","key":"litmus","value":{"rev":"9-7e403d052483301d025e9d09b4e7a9dd"}}, -{"id":"littering","key":"littering","value":{"rev":"5-9026438311ffc18d369bfa886c120bcd"}}, -{"id":"live-twitter-map","key":"live-twitter-map","value":{"rev":"3-45a40054bbab23374a4f1743c8bd711d"}}, -{"id":"livereload","key":"livereload","value":{"rev":"5-11ff486b4014ec1998705dbd396e96f2"}}, -{"id":"load","key":"load","value":{"rev":"7-2fff87aeb91d74bc57c134ee2cf0d65b"}}, -{"id":"loadbuilder","key":"loadbuilder","value":{"rev":"9-fa9c5cb13b3af03f9d9fbf5064fa0e0f"}}, -{"id":"loadit","key":"loadit","value":{"rev":"3-51bee062ed0d985757c6ae24929fa74e"}}, -{"id":"local-cdn","key":"local-cdn","value":{"rev":"9-9c2931766a559cf036318583455456e6"}}, -{"id":"localStorage","key":"localStorage","value":{"rev":"3-455fbe195db27131789b5d59db4504b0"}}, -{"id":"locales","key":"locales","value":{"rev":"5-bee452772e2070ec07af0dd86d6dbc41"}}, -{"id":"localhose","key":"localhose","value":{"rev":"9-3a2f63ecbed2e31400ca7515fd020a77"}}, -{"id":"localhost","key":"localhost","value":{"rev":"3-c6c4f6b5688cbe62865010099c9f461f"}}, -{"id":"localhostapp","key":"localhostapp","value":{"rev":"3-17884c4847c549e07e0c881fdf60d01f"}}, -{"id":"localize","key":"localize","value":{"rev":"7-1f83adb6d1eefcf7222a05f489b5db10"}}, -{"id":"location","key":"location","value":{"rev":"3-cc6fbf77b4ade80312bd95fde4e00015"}}, -{"id":"lockfile","key":"lockfile","value":{"rev":"3-4b4b79c2b0f09cc516db1a9d581c5038"}}, -{"id":"lode","key":"lode","value":{"rev":"15-5062a9a0863770d172097c5074a2bdae"}}, -{"id":"log","key":"log","value":{"rev":"12-0aa7922459ff8397764956c56a106930"}}, -{"id":"log-buddy","key":"log-buddy","value":{"rev":"3-64c6d4927d1d235d927f09c16c874e06"}}, -{"id":"log-watcher","key":"log-watcher","value":{"rev":"3-70f8727054c8e4104f835930578f4ee1"}}, -{"id":"log4js","key":"log4js","value":{"rev":"38-137b28e6e96515da7a6399cae86795dc"}}, -{"id":"log4js-amqp","key":"log4js-amqp","value":{"rev":"3-90530c28ef63d4598c12dfcf450929c0"}}, -{"id":"log5","key":"log5","value":{"rev":"17-920e3765dcfdc31bddf13de6895122b3"}}, -{"id":"logbot","key":"logbot","value":{"rev":"3-234eedc70b5474c713832e642f4dc3b4"}}, -{"id":"logger","key":"logger","value":{"rev":"3-5eef338fb5e845a81452fbb22e582aa7"}}, -{"id":"logging","key":"logging","value":{"rev":"22-99d320792c5445bd04699c4cf19edd89"}}, -{"id":"logging-system","key":"logging-system","value":{"rev":"5-5eda9d0b1d04256f5f44abe51cd14626"}}, -{"id":"loggly","key":"loggly","value":{"rev":"49-944a404e188327431a404e5713691a8c"}}, -{"id":"login","key":"login","value":{"rev":"44-7c450fe861230a5121ff294bcd6f97c9"}}, -{"id":"logly","key":"logly","value":{"rev":"7-832fe9af1cd8bfed84a065822cec398a"}}, -{"id":"logmagic","key":"logmagic","value":{"rev":"11-5d2c7dd32ba55e5ab85127be09723ef8"}}, -{"id":"logmonger","key":"logmonger","value":{"rev":"3-07a101d795f43f7af668210660274a7b"}}, -{"id":"lokki","key":"lokki","value":{"rev":"3-f6efcce38029ea0b4889707764088540"}}, -{"id":"long-stack-traces","key":"long-stack-traces","value":{"rev":"7-4b2fe23359b29e188cb2b8936b63891a"}}, -{"id":"loom","key":"loom","value":{"rev":"3-6348ab890611154da4881a0b351b0cb5"}}, -{"id":"loop","key":"loop","value":{"rev":"3-a56e9a6144f573092bb441106b370e0c"}}, -{"id":"looseleaf","key":"looseleaf","value":{"rev":"57-46ef6f055a40c34c714e3e9b9fe5d4cd"}}, -{"id":"lovely","key":"lovely","value":{"rev":"21-f577923512458f02f48ef59eebe55176"}}, -{"id":"lpd","key":"lpd","value":{"rev":"3-433711ae25002f67aa339380668fd491"}}, -{"id":"lpd-printers","key":"lpd-printers","value":{"rev":"3-47060e6c05fb4aad227d36f6e7941227"}}, -{"id":"lru-cache","key":"lru-cache","value":{"rev":"10-23c5e7423fe315745ef924f58c36e119"}}, -{"id":"ls-r","key":"ls-r","value":{"rev":"7-a769b11a06fae8ff439fe7eeb0806b5e"}}, -{"id":"lsof","key":"lsof","value":{"rev":"5-82aa3bcf23b8026a95e469b6188938f9"}}, -{"id":"ltx","key":"ltx","value":{"rev":"21-89ca85a9ce0c9fc13b20c0f1131168b0"}}, -{"id":"lucky-server","key":"lucky-server","value":{"rev":"3-a50d87239166f0ffc374368463f96b07"}}, -{"id":"lunapark","key":"lunapark","value":{"rev":"3-841d197f404da2e63d69b0c2132d87db"}}, -{"id":"lunchbot","key":"lunchbot","value":{"rev":"3-5d8984bef249e3d9e271560b5753f4cf"}}, -{"id":"lw-nun","key":"lw-nun","value":{"rev":"3-b686f89361b7b405e4581db6c60145ed"}}, -{"id":"lw-sass","key":"lw-sass","value":{"rev":"3-e46f90e0c8eab0c8c5d5eb8cf2a9a6da"}}, -{"id":"lwes","key":"lwes","value":{"rev":"3-939bb87efcbede1c1a70de881686fbce"}}, -{"id":"lwink","key":"lwink","value":{"rev":"3-1c432fafe4809e8d4a7e6214123ae452"}}, -{"id":"lzma","key":"lzma","value":{"rev":"3-31dc39414531e329b42b3a4ea0292c43"}}, -{"id":"m1node","key":"m1node","value":{"rev":"11-b34d55bdbc6f65b1814e77fab4a7e823"}}, -{"id":"m1test","key":"m1test","value":{"rev":"3-815ce56949e41e120082632629439eac"}}, -{"id":"m2node","key":"m2node","value":{"rev":"7-f50ec5578d995dd6a0a38e1049604bfc"}}, -{"id":"m2pdb","key":"m2pdb","value":{"rev":"3-ee798ac17c8c554484aceae2f77a826b"}}, -{"id":"m3u","key":"m3u","value":{"rev":"5-7ca6d768e0aed5b88dd45c943ca9ffa0"}}, -{"id":"mac","key":"mac","value":{"rev":"21-db5883c390108ff9ba46660c78b18b6c"}}, -{"id":"macchiato","key":"macchiato","value":{"rev":"5-0df1c87029e6005577fd8fd5cdb25947"}}, -{"id":"macgyver","key":"macgyver","value":{"rev":"3-f517699102b7bd696d8197d7ce57afb9"}}, -{"id":"macros","key":"macros","value":{"rev":"3-8356bcc0d1b1bd3879eeb880b2f3330b"}}, -{"id":"macrotest","key":"macrotest","value":{"rev":"10-2c6ceffb38f8ce5b0f382dbb02720d70"}}, -{"id":"maddy","key":"maddy","value":{"rev":"9-93d59c65c3f44aa6ed43dc986dd73ca5"}}, -{"id":"madmimi-node","key":"madmimi-node","value":{"rev":"11-257e1b1bd5ee5194a7052542952b8b7a"}}, -{"id":"maga","key":"maga","value":{"rev":"24-c69734f9fc138788db741b862f889583"}}, -{"id":"magic","key":"magic","value":{"rev":"34-aed787cc30ab86c95f547b9555d6a381"}}, -{"id":"magic-templates","key":"magic-templates","value":{"rev":"3-89546e9a038150cf419b4b15a84fd2aa"}}, -{"id":"magickal","key":"magickal","value":{"rev":"3-e9ed74bb90df0a52564d47aed0451ce7"}}, -{"id":"mai","key":"mai","value":{"rev":"5-f3561fe6de2bd25201250ddb6dcf9f01"}}, -{"id":"mail","key":"mail","value":{"rev":"14-9ae558552e6a7c11017f118a71c072e9"}}, -{"id":"mail-stack","key":"mail-stack","value":{"rev":"5-c82567203540076cf4878ea1ab197b52"}}, -{"id":"mailbox","key":"mailbox","value":{"rev":"12-0b582e127dd7cf669de16ec36f8056a4"}}, -{"id":"mailchimp","key":"mailchimp","value":{"rev":"23-3d9328ee938b7940322351254ea54877"}}, -{"id":"mailer","key":"mailer","value":{"rev":"40-7b251b758f9dba4667a3127195ea0380"}}, -{"id":"mailer-bal","key":"mailer-bal","value":{"rev":"3-fc8265b1905ea37638309d7c10852050"}}, -{"id":"mailer-fixed","key":"mailer-fixed","value":{"rev":"13-3004df43c62eb64ed5fb0306b019fe66"}}, -{"id":"mailgun","key":"mailgun","value":{"rev":"25-29de1adb355636822dc21fef51f37aed"}}, -{"id":"mailparser","key":"mailparser","value":{"rev":"14-7142e4168046418afc4a76d1b330f302"}}, -{"id":"mailto-parser","key":"mailto-parser","value":{"rev":"3-f8dea7b60c0e993211f81a86dcf5b18d"}}, -{"id":"makeerror","key":"makeerror","value":{"rev":"17-ceb9789357d80467c9ae75caa64ca8ac"}}, -{"id":"malt","key":"malt","value":{"rev":"7-e5e76a842eb0764a5ebe57290b629097"}}, -{"id":"mango","key":"mango","value":{"rev":"7-6224e74a3132e54f294f62998ed9127f"}}, -{"id":"map-reduce","key":"map-reduce","value":{"rev":"11-a81d8bdc6dae7e7b76d5df74fff40ae1"}}, -{"id":"mapnik","key":"mapnik","value":{"rev":"64-693f5b957b7faf361c2cc2a22747ebf7"}}, -{"id":"maptail","key":"maptail","value":{"rev":"14-8334618ddc20006a5f77ff35b172c152"}}, -{"id":"marak","key":"marak","value":{"rev":"3-27be187af00fc97501035dfb97a11ecf"}}, -{"id":"markdoc","key":"markdoc","value":{"rev":"13-23becdeda44b26ee54c9aaa31457e4ba"}}, -{"id":"markdom","key":"markdom","value":{"rev":"10-3c0df12e4f4a2e675d0f0fde48aa425f"}}, -{"id":"markdown","key":"markdown","value":{"rev":"19-88e02c28ce0179be900bf9e6aadc070f"}}, -{"id":"markdown-js","key":"markdown-js","value":{"rev":"6-964647c2509850358f70f4e23670fbeb"}}, -{"id":"markdown-wiki","key":"markdown-wiki","value":{"rev":"6-ce35fb0612a463db5852c5d3dcc7fdd3"}}, -{"id":"markdown2html","key":"markdown2html","value":{"rev":"3-549babe5d9497785fa8b9305c81d7214"}}, -{"id":"marked","key":"marked","value":{"rev":"21-9371df65f63131c9f24e8805db99a7d9"}}, -{"id":"markov","key":"markov","value":{"rev":"13-9ab795448c54ef87851f1392d6f3671a"}}, -{"id":"maryjane","key":"maryjane","value":{"rev":"3-e2e6cce443850b5df1554bf851d16760"}}, -{"id":"massagist","key":"massagist","value":{"rev":"11-cac3a103aecb4ff3f0f607aca2b1d3fb"}}, -{"id":"masson","key":"masson","value":{"rev":"10-87a5e6fd05bd4b8697fa3fa636238c20"}}, -{"id":"masstransit","key":"masstransit","value":{"rev":"11-74898c746e541ff1a00438017ee66d4a"}}, -{"id":"matchmaker","key":"matchmaker","value":{"rev":"3-192db6fb162bdf84fa3e858092fd3e20"}}, -{"id":"math","key":"math","value":{"rev":"5-16a74d8639e44a5ccb265ab1a3b7703b"}}, -{"id":"math-lexer","key":"math-lexer","value":{"rev":"19-54b42374b0090eeee50f39cb35f2eb40"}}, -{"id":"matrices","key":"matrices","value":{"rev":"43-06d64271a5148f89d649645712f8971f"}}, -{"id":"matrix","key":"matrix","value":{"rev":"3-77cff57242445cf3d76313b72bbc38f4"}}, -{"id":"matrixlib","key":"matrixlib","value":{"rev":"11-b3c105a5e5be1835183e7965d04825d9"}}, -{"id":"matterhorn","key":"matterhorn","value":{"rev":"9-a310dba2ea054bdce65e6df2f6ae85e5"}}, -{"id":"matterhorn-dust","key":"matterhorn-dust","value":{"rev":"3-2fb311986d62cf9f180aa76038ebf7b3"}}, -{"id":"matterhorn-gui","key":"matterhorn-gui","value":{"rev":"3-7921b46c9bff3ee82e4b32bc0a0a977d"}}, -{"id":"matterhorn-prng","key":"matterhorn-prng","value":{"rev":"3-c33fd59c1f1d24fb423553ec242e444b"}}, -{"id":"matterhorn-standard","key":"matterhorn-standard","value":{"rev":"13-0aaab6ecf55cdad6f773736da968afba"}}, -{"id":"matterhorn-state","key":"matterhorn-state","value":{"rev":"3-0ba8fd8a4c644b18aff34f1aef95db33"}}, -{"id":"matterhorn-user","key":"matterhorn-user","value":{"rev":"17-e42dc37a5cb24710803b3bd8dee7484d"}}, -{"id":"matterhorn-view","key":"matterhorn-view","value":{"rev":"3-b39042d665f5912d02e724d33d129a97"}}, -{"id":"mbtiles","key":"mbtiles","value":{"rev":"41-b92035d0ec8f47850734c4bb995baf7d"}}, -{"id":"mcast","key":"mcast","value":{"rev":"8-559b2b09cfa34cb88c16ae72ec90d28a"}}, -{"id":"md5","key":"md5","value":{"rev":"3-43d600c70f6442d3878c447585bf43bf"}}, -{"id":"mdgram","key":"mdgram","value":{"rev":"15-4d65cf0d5edef976de9a612c0cde0907"}}, -{"id":"mdns","key":"mdns","value":{"rev":"11-8b6789c3779fce7f019f9f10c625147a"}}, -{"id":"mecab-binding","key":"mecab-binding","value":{"rev":"3-3395763d23a3f8e3e00ba75cb988f9b4"}}, -{"id":"mechanize","key":"mechanize","value":{"rev":"5-94b72f43e270aa24c00e283fa52ba398"}}, -{"id":"mediatags","key":"mediatags","value":{"rev":"3-d5ea41e140fbbc821590cfefdbd016a5"}}, -{"id":"mediator","key":"mediator","value":{"rev":"3-42aac2225b47f72f97001107a3d242f5"}}, -{"id":"memcache","key":"memcache","value":{"rev":"5-aebcc4babe11b654afd3cede51e945ec"}}, -{"id":"memcached","key":"memcached","value":{"rev":"9-7c46464425c78681a8e6767ef9993c4c"}}, -{"id":"memcouchd","key":"memcouchd","value":{"rev":"3-b57b9fb4f6c60604f616c2f70456b4d6"}}, -{"id":"meme","key":"meme","value":{"rev":"11-53fcb51e1d8f8908b95f0fa12788e9aa"}}, -{"id":"memo","key":"memo","value":{"rev":"9-3a9ca97227ed19cacdacf10ed193ee8b"}}, -{"id":"memoize","key":"memoize","value":{"rev":"15-44bdd127c49035c8bd781a9299c103c2"}}, -{"id":"memoizer","key":"memoizer","value":{"rev":"9-d9a147e8c8a58fd7e8f139dc902592a6"}}, -{"id":"memorystream","key":"memorystream","value":{"rev":"9-6d0656067790e158f3c4628968ed70d3"}}, -{"id":"memstore","key":"memstore","value":{"rev":"5-03dcac59882c8a434e4c2fe2ac354941"}}, -{"id":"mercury","key":"mercury","value":{"rev":"3-147af865af6f7924f44f14f4b5c14dac"}}, -{"id":"mersenne","key":"mersenne","value":{"rev":"7-d8ae550eb8d0deaa1fd60f86351cb548"}}, -{"id":"meryl","key":"meryl","value":{"rev":"23-2c0e3fad99005109c584530e303bc5bf"}}, -{"id":"mesh","key":"mesh","value":{"rev":"5-f3ea4aef5b3f169eab8b518e5044c950"}}, -{"id":"meta-promise","key":"meta-promise","value":{"rev":"5-0badf85ab432341e6256252463468b89"}}, -{"id":"meta-test","key":"meta-test","value":{"rev":"49-92df2922499960ac750ce96d861ddd7e"}}, -{"id":"meta_code","key":"meta_code","value":{"rev":"7-9b4313c0c52a09c788464f1fea05baf7"}}, -{"id":"metamanager","key":"metamanager","value":{"rev":"5-dbb0312dad15416d540eb3d860fbf205"}}, -{"id":"metaweblog","key":"metaweblog","value":{"rev":"3-d3ab090ec27242e220412d6413e388ee"}}, -{"id":"metric","key":"metric","value":{"rev":"3-8a706db5b518421ad640a75e65cb4be9"}}, -{"id":"metrics","key":"metrics","value":{"rev":"13-62e5627c1ca5e6d3b3bde8d17e675298"}}, -{"id":"metrics-broker","key":"metrics-broker","value":{"rev":"15-0fdf57ea4ec84aa1f905f53b4975e72d"}}, -{"id":"mhash","key":"mhash","value":{"rev":"3-f00d65dc939474a5c508d37a327e5074"}}, -{"id":"micro","key":"micro","value":{"rev":"17-882c0ecf34ddaef5c673c547ae80b80b"}}, -{"id":"microcache","key":"microcache","value":{"rev":"3-ef75e04bc6e86d14f93ad9c429503bd9"}}, -{"id":"microevent","key":"microevent","value":{"rev":"3-9c0369289b62873ef6e8624eef724d15"}}, -{"id":"microtest","key":"microtest","value":{"rev":"11-11afdadfb15c1db030768ce52f34de1a"}}, -{"id":"microtime","key":"microtime","value":{"rev":"20-5f75e87316cbb5f7a4be09142cd755e5"}}, -{"id":"middlefiddle","key":"middlefiddle","value":{"rev":"13-bb94c05d75c24bdeb23a4637c7ecf55e"}}, -{"id":"middleware","key":"middleware","value":{"rev":"5-80937a4c620fcc2a5532bf064ec0837b"}}, -{"id":"midi","key":"midi","value":{"rev":"9-96da6599a84a761430adfd41deb3969a"}}, -{"id":"midi-js","key":"midi-js","value":{"rev":"11-1d174af1352e3d37f6ec0df32d56ce1a"}}, -{"id":"migrate","key":"migrate","value":{"rev":"13-7493879fb60a31b9e2a9ad19e94bfef6"}}, -{"id":"mikronode","key":"mikronode","value":{"rev":"31-1edae4ffbdb74c43ea584a7757dacc9b"}}, -{"id":"milk","key":"milk","value":{"rev":"21-81fb117817ed2e4c19e16dc310c09735"}}, -{"id":"millstone","key":"millstone","value":{"rev":"29-73d54de4b4de313b0fec4edfaec741a4"}}, -{"id":"mime","key":"mime","value":{"rev":"33-de72b641474458cb21006dea6a524ceb"}}, -{"id":"mime-magic","key":"mime-magic","value":{"rev":"13-2df6b966d7f29d5ee2dd2e1028d825b1"}}, -{"id":"mimelib","key":"mimelib","value":{"rev":"9-7994cf0fe3007329b9397f4e08481487"}}, -{"id":"mimelib-noiconv","key":"mimelib-noiconv","value":{"rev":"5-c84995d4b2bbe786080c9b54227b5bb4"}}, -{"id":"mimeograph","key":"mimeograph","value":{"rev":"37-bead083230f48f354f3ccac35e11afc0"}}, -{"id":"mimeparse","key":"mimeparse","value":{"rev":"8-5ca7e6702fe7f1f37ed31b05e82f4a87"}}, -{"id":"mingy","key":"mingy","value":{"rev":"19-09b19690c55abc1e940374e25e9a0d26"}}, -{"id":"mini-lzo-wrapper","key":"mini-lzo-wrapper","value":{"rev":"4-d751d61f481363a2786ac0312893dfca"}}, -{"id":"miniee","key":"miniee","value":{"rev":"5-be0833a9f15382695f861a990f3d6108"}}, -{"id":"minifyjs","key":"minifyjs","value":{"rev":"13-f255df8c7567440bc4c0f8eaf04a18c6"}}, -{"id":"minimal","key":"minimal","value":{"rev":"5-6be6b3454d30c59a30f9ee8af0ee606c"}}, -{"id":"minimal-test","key":"minimal-test","value":{"rev":"15-65dca2c1ee27090264577cc8b93983cb"}}, -{"id":"minimatch","key":"minimatch","value":{"rev":"11-449e570c76f4e6015c3dc90f080f8c47"}}, -{"id":"minirpc","key":"minirpc","value":{"rev":"10-e85b92273a97fa86e20faef7a3b50518"}}, -{"id":"ministore","key":"ministore","value":{"rev":"11-f131868141ccd0851bb91800c86dfff1"}}, -{"id":"minitest","key":"minitest","value":{"rev":"13-c92e32499a25ff2d7e484fbbcabe1081"}}, -{"id":"miniweb","key":"miniweb","value":{"rev":"3-e8c413a77e24891138eaa9e73cb08715"}}, -{"id":"minj","key":"minj","value":{"rev":"9-ccf50caf8e38b0fc2508f01a63f80510"}}, -{"id":"minotaur","key":"minotaur","value":{"rev":"29-6d048956b26e8a213f6ccc96027bacde"}}, -{"id":"mirror","key":"mirror","value":{"rev":"21-01bdd78ff03ca3f8f99fce104baab9f9"}}, -{"id":"misao-chan","key":"misao-chan","value":{"rev":"13-f032690f0897fc4a1dc12f1e03926627"}}, -{"id":"mite.node","key":"mite.node","value":{"rev":"13-0bfb15c4a6f172991756660b29869dd4"}}, -{"id":"mixable","key":"mixable","value":{"rev":"3-bc518ab862a6ceacc48952b9bec7d61a"}}, -{"id":"mixin","key":"mixin","value":{"rev":"3-3a7ae89345d21ceaf545d93b20caf2f2"}}, -{"id":"mixinjs","key":"mixinjs","value":{"rev":"3-064173d86b243316ef1b6c5743a60bf9"}}, -{"id":"mixpanel","key":"mixpanel","value":{"rev":"7-f742248bfbfc480658c4c46f7ab7a74a"}}, -{"id":"mixpanel-api","key":"mixpanel-api","value":{"rev":"5-61a3fa28921887344d1af339917e147a"}}, -{"id":"mixpanel_api","key":"mixpanel_api","value":{"rev":"3-11939b6fd20b80bf9537380875bf3996"}}, -{"id":"mjoe","key":"mjoe","value":{"rev":"3-8b3549cd6edcc03112217370b071b076"}}, -{"id":"mjsunit.runner","key":"mjsunit.runner","value":{"rev":"12-94c779b555069ca5fb0bc9688515673e"}}, -{"id":"mkdir","key":"mkdir","value":{"rev":"3-e8fd61b35638f1f3a65d36f09344ff28"}}, -{"id":"mkdirp","key":"mkdirp","value":{"rev":"15-c8eacf17b336ea98d1d9960f02362cbf"}}, -{"id":"mmap","key":"mmap","value":{"rev":"16-df335eb3257dfbd2fb0de341970d2656"}}, -{"id":"mmikulicic-thrift","key":"mmikulicic-thrift","value":{"rev":"3-f4a9f7a97bf50e966d1184fba423a07f"}}, -{"id":"mmmodel","key":"mmmodel","value":{"rev":"7-00d61723742a325aaaa6955ba52cef60"}}, -{"id":"mmodel","key":"mmodel","value":{"rev":"3-717309af27d6c5d98ed188c9c9438a37"}}, -{"id":"mmseg","key":"mmseg","value":{"rev":"17-794d553e67d6023ca3d58dd99fe1da15"}}, -{"id":"mobilize","key":"mobilize","value":{"rev":"25-8a657ec0accf8db2e8d7b935931ab77b"}}, -{"id":"mock","key":"mock","value":{"rev":"3-d8805bff4796462750071cddd3f75ea7"}}, -{"id":"mock-request","key":"mock-request","value":{"rev":"7-4ac4814c23f0899b1100d5f0617e40f4"}}, -{"id":"mock-request-response","key":"mock-request-response","value":{"rev":"5-fe1566c9881039a92a80e0e82a95f096"}}, -{"id":"mocket","key":"mocket","value":{"rev":"13-9001879cd3cb6f52f3b2d85fb14b8f9b"}}, -{"id":"modbus-stack","key":"modbus-stack","value":{"rev":"7-50c56e74d9cb02c5d936b0b44c54f621"}}, -{"id":"model","key":"model","value":{"rev":"3-174181c2f314f35fc289b7a921ba4d39"}}, -{"id":"models","key":"models","value":{"rev":"8-6cc2748edfd96679f9bb3596864874a9"}}, -{"id":"modestmaps","key":"modestmaps","value":{"rev":"8-79265968137a2327f98bfc6943a84da9"}}, -{"id":"modjewel","key":"modjewel","value":{"rev":"3-73efc7b9dc24d82cab1de249896193fd"}}, -{"id":"modlr","key":"modlr","value":{"rev":"17-ccf16db98ab6ccb95e005b3bb76dba64"}}, -{"id":"module-grapher","key":"module-grapher","value":{"rev":"19-b6ba30b41e29fc01d4b679a643f030e5"}}, -{"id":"modulr","key":"modulr","value":{"rev":"15-8e8ffd75c6c6149206de4ce0c2aefad7"}}, -{"id":"mogile","key":"mogile","value":{"rev":"5-79a8af20dbe6bff166ac2197a3998b0c"}}, -{"id":"mojo","key":"mojo","value":{"rev":"25-1d9c26d6afd6ea77253f220d86d60307"}}, -{"id":"monad","key":"monad","value":{"rev":"10-cf20354900b7e67d94c342feb06a1eb9"}}, -{"id":"mongeese","key":"mongeese","value":{"rev":"3-f4b319d98f9f73fb17cd3ebc7fc86412"}}, -{"id":"mongo-pool","key":"mongo-pool","value":{"rev":"3-215481828e69fd874b5938a79a7e0934"}}, -{"id":"mongodb","key":"mongodb","value":{"rev":"147-3dc09965e762787f34131a8739297383"}}, -{"id":"mongodb-async","key":"mongodb-async","value":{"rev":"7-ba9097bdc86b72885fa5a9ebb49a64d0"}}, -{"id":"mongodb-provider","key":"mongodb-provider","value":{"rev":"5-5523643b403e969e0b80c57db08cb9d3"}}, -{"id":"mongodb-rest","key":"mongodb-rest","value":{"rev":"36-60b4abc4a22f31de09407cc7cdd0834f"}}, -{"id":"mongodb-wrapper","key":"mongodb-wrapper","value":{"rev":"13-7a6c5eaff36ede45211aa80f3a506cfe"}}, -{"id":"mongodb_heroku","key":"mongodb_heroku","value":{"rev":"3-05947c1e06e1f8860c7809b063a8d1a0"}}, -{"id":"mongode","key":"mongode","value":{"rev":"11-faa14f050da4a165e2568d413a6b8bc0"}}, -{"id":"mongojs","key":"mongojs","value":{"rev":"26-a628eb51534ffcdd97c1a940d460a52c"}}, -{"id":"mongolia","key":"mongolia","value":{"rev":"76-711c39de0e152e224d4118c9b0de834f"}}, -{"id":"mongolian","key":"mongolian","value":{"rev":"44-3773671b31c406a18cb9f5a1764ebee4"}}, -{"id":"mongoose","key":"mongoose","value":{"rev":"181-03a8aa7f691cbd987995bf6e3354e0f5"}}, -{"id":"mongoose-admin","key":"mongoose-admin","value":{"rev":"7-59078ad5a345e9e66574346d3e70f9ad"}}, -{"id":"mongoose-auth","key":"mongoose-auth","value":{"rev":"49-87c79f3a6164c438a53b7629be87ae5d"}}, -{"id":"mongoose-autoincr","key":"mongoose-autoincr","value":{"rev":"3-9c4dd7c3fdcd8621166665a68fccb602"}}, -{"id":"mongoose-closures","key":"mongoose-closures","value":{"rev":"3-2ff9cff790f387f2236a2c7382ebb55b"}}, -{"id":"mongoose-crypt","key":"mongoose-crypt","value":{"rev":"3-d77ffbf250e39fcc290ad37824fe2236"}}, -{"id":"mongoose-dbref","key":"mongoose-dbref","value":{"rev":"29-02090b9904fd6f5ce72afcfa729f7c96"}}, -{"id":"mongoose-flatmatcher","key":"mongoose-flatmatcher","value":{"rev":"5-4f0565901e8b588cc562ae457ad975a6"}}, -{"id":"mongoose-helpers","key":"mongoose-helpers","value":{"rev":"3-3a57e9819e24c9b0f5b5eabe41037092"}}, -{"id":"mongoose-joins","key":"mongoose-joins","value":{"rev":"3-9bae444730a329473421f50cba1c86a7"}}, -{"id":"mongoose-misc","key":"mongoose-misc","value":{"rev":"3-bcd7f3f450cf6ed233d042ac574409ce"}}, -{"id":"mongoose-relationships","key":"mongoose-relationships","value":{"rev":"9-6155a276b162ec6593b8542f0f769024"}}, -{"id":"mongoose-rest","key":"mongoose-rest","value":{"rev":"29-054330c035adf842ab34423215995113"}}, -{"id":"mongoose-spatial","key":"mongoose-spatial","value":{"rev":"3-88660dabd485edcaa29a2ea01afb90bd"}}, -{"id":"mongoose-temporal","key":"mongoose-temporal","value":{"rev":"3-1dd736395fe9be95498e588df502b7bb"}}, -{"id":"mongoose-types","key":"mongoose-types","value":{"rev":"13-8126458b91ef1bf46e582042f5dbd015"}}, -{"id":"mongoose-units","key":"mongoose-units","value":{"rev":"3-5fcdb7aedb1d5cff6e18ee1352c3d0f7"}}, -{"id":"mongoq","key":"mongoq","value":{"rev":"11-2060d674d5f8a964e800ed4470b92587"}}, -{"id":"mongoskin","key":"mongoskin","value":{"rev":"13-5a7bfacd9e9b95ec469f389751e7e435"}}, -{"id":"mongous","key":"mongous","value":{"rev":"3-4d98b4a4bfdd6d9f46342002a69d8d3a"}}, -{"id":"mongrel2","key":"mongrel2","value":{"rev":"3-93156356e478f30fc32455054e384b80"}}, -{"id":"monguava","key":"monguava","value":{"rev":"9-69ec50128220aba3e16128a4be2799c0"}}, -{"id":"mongueue","key":"mongueue","value":{"rev":"9-fc8d9df5bf15f5a25f68cf58866f11fe"}}, -{"id":"moniker","key":"moniker","value":{"rev":"5-a139616b725ddfdd1db6a376fb6584f7"}}, -{"id":"monitor","key":"monitor","value":{"rev":"56-44d2b8b7dec04b3f320f7dc4a1704c53"}}, -{"id":"monome","key":"monome","value":{"rev":"3-2776736715cbfc045bf7b42e70ccda9c"}}, -{"id":"monomi","key":"monomi","value":{"rev":"6-b6b745441f157cc40c846d23cd14297a"}}, -{"id":"moof","key":"moof","value":{"rev":"13-822b4ebf873b720bd4c7e16fcbbbbb3d"}}, -{"id":"moonshado","key":"moonshado","value":{"rev":"3-b54de1aef733c8fa118fa7cf6af2fb9b"}}, -{"id":"moose","key":"moose","value":{"rev":"5-e11c8b7c09826e3431ed3408ee874779"}}, -{"id":"mootools","key":"mootools","value":{"rev":"9-39f5535072748ccd3cf0212ef4c3d4fa"}}, -{"id":"mootools-array","key":"mootools-array","value":{"rev":"3-d1354704a9fe922d969c2bf718e0dc53"}}, -{"id":"mootools-browser","key":"mootools-browser","value":{"rev":"3-ce0946b357b6ddecc128febef2c5d720"}}, -{"id":"mootools-class","key":"mootools-class","value":{"rev":"3-0ea815d28b61f3880087e3f4b8668354"}}, -{"id":"mootools-class-extras","key":"mootools-class-extras","value":{"rev":"3-575796745bd169c35f4fc0019bb36b76"}}, -{"id":"mootools-client","key":"mootools-client","value":{"rev":"3-b658c331f629f80bfe17c3e6ed44c525"}}, -{"id":"mootools-cookie","key":"mootools-cookie","value":{"rev":"3-af93588531e5a52c76a8e7a4eac3612a"}}, -{"id":"mootools-core","key":"mootools-core","value":{"rev":"3-01b1678fc56d94d29566b7853ad56059"}}, -{"id":"mootools-domready","key":"mootools-domready","value":{"rev":"3-0fc6620e2c8f7d107816cace9c099633"}}, -{"id":"mootools-element","key":"mootools-element","value":{"rev":"3-bac857c1701c91207d1ec6d1eb002d07"}}, -{"id":"mootools-element-dimensions","key":"mootools-element-dimensions","value":{"rev":"3-d82df62b3e97122ad0a7668efb7ba776"}}, -{"id":"mootools-element-event","key":"mootools-element-event","value":{"rev":"3-a30380151989ca31851cf751fcd55e9a"}}, -{"id":"mootools-element-style","key":"mootools-element-style","value":{"rev":"3-6103fa8551a21dc592e410dc7df647f8"}}, -{"id":"mootools-event","key":"mootools-event","value":{"rev":"3-7327279ec157de8c47f3ee24615ead95"}}, -{"id":"mootools-function","key":"mootools-function","value":{"rev":"3-eb3ee17acf40d6cc05463cb88edc6f5e"}}, -{"id":"mootools-fx","key":"mootools-fx","value":{"rev":"3-757ab6c8423e8c434d1ee783ea28cdb5"}}, -{"id":"mootools-fx-css","key":"mootools-fx-css","value":{"rev":"3-8eb0cf468c826b9c485835fab94837e7"}}, -{"id":"mootools-fx-morph","key":"mootools-fx-morph","value":{"rev":"3-b91310f8a81221592970fe7632bd9f7a"}}, -{"id":"mootools-fx-transitions","key":"mootools-fx-transitions","value":{"rev":"3-a1ecde35dfbb80f3a6062005758bb934"}}, -{"id":"mootools-fx-tween","key":"mootools-fx-tween","value":{"rev":"3-39497defbffdf463932cc9f00cde8d5d"}}, -{"id":"mootools-json","key":"mootools-json","value":{"rev":"3-69deb6679a5d1d49f22e19834ae07c32"}}, -{"id":"mootools-more","key":"mootools-more","value":{"rev":"3-d8f46ce319ca0e3deb5fc04ad5f73cb9"}}, -{"id":"mootools-number","key":"mootools-number","value":{"rev":"3-9f4494883ac39f93734fea9af6ef2fc5"}}, -{"id":"mootools-object","key":"mootools-object","value":{"rev":"3-c9632dfa793ab4d9ad4b68a2e27f09fc"}}, -{"id":"mootools-request","key":"mootools-request","value":{"rev":"3-663e5472f351eea3b7488ee441bc6a61"}}, -{"id":"mootools-request-html","key":"mootools-request-html","value":{"rev":"3-0ab9576c11a564d44b3c3ca3ef3dc240"}}, -{"id":"mootools-request-json","key":"mootools-request-json","value":{"rev":"3-c0359201c94ba1684ea6336e35cd70c2"}}, -{"id":"mootools-server","key":"mootools-server","value":{"rev":"3-98e89499f6eab137bbab053a3932a526"}}, -{"id":"mootools-slick-finder","key":"mootools-slick-finder","value":{"rev":"3-9a5820e90d6ea2d797268f3c60a9f177"}}, -{"id":"mootools-slick-parser","key":"mootools-slick-parser","value":{"rev":"3-d4e6b1673e6e2a6bcc66bf4988b2994d"}}, -{"id":"mootools-string","key":"mootools-string","value":{"rev":"3-2fda1c7915295df62e547018a7f05916"}}, -{"id":"mootools-swiff","key":"mootools-swiff","value":{"rev":"3-f0edeead85f3d48cf2af2ca35a4e67a5"}}, -{"id":"mootools.js","key":"mootools.js","value":{"rev":"3-085e50e3529d19e1d6ad630027ba51dc"}}, -{"id":"morestreams","key":"morestreams","value":{"rev":"7-3d0145c2cfb9429dfdcfa872998c9fe8"}}, -{"id":"morpheus","key":"morpheus","value":{"rev":"45-04335640f709335d1828523425a87909"}}, -{"id":"morton","key":"morton","value":{"rev":"11-abd787350e21bef65c1c6776e40a0753"}}, -{"id":"mothermayi","key":"mothermayi","value":{"rev":"5-2c46f9873efd19f543def5eeda0a05f1"}}, -{"id":"mountable-proxy","key":"mountable-proxy","value":{"rev":"7-3b91bd0707447885676727ad183bb051"}}, -{"id":"move","key":"move","value":{"rev":"69-ce11c235c78de6d6184a86aaa93769eb"}}, -{"id":"moviesearch","key":"moviesearch","value":{"rev":"3-72e77965a44264dfdd5af23e4a36d2ce"}}, -{"id":"mp","key":"mp","value":{"rev":"3-47899fb2bdaf21dda16abd037b325c3b"}}, -{"id":"mpdsocket","key":"mpdsocket","value":{"rev":"3-2dd4c9bb019f3f491c55364be7a56229"}}, -{"id":"mrcolor","key":"mrcolor","value":{"rev":"3-4695b11798a65c61714b8f236a40936c"}}, -{"id":"msgbus","key":"msgbus","value":{"rev":"27-a5d861b55c933842226d4e536820ec99"}}, -{"id":"msgme","key":"msgme","value":{"rev":"3-d1968af1234a2059eb3d84eb76cdaa4e"}}, -{"id":"msgpack","key":"msgpack","value":{"rev":"9-ecf7469392d87460ddebef2dd369b0e5"}}, -{"id":"msgpack-0.4","key":"msgpack-0.4","value":{"rev":"3-5d509ddba6c53ed6b8dfe4afb1d1661d"}}, -{"id":"msgpack2","key":"msgpack2","value":{"rev":"4-63b8f3ccf35498eb5c8bd9b8d683179b"}}, -{"id":"mu","key":"mu","value":{"rev":"7-7a8ce1cba5d6d98e696c4e633aa081fa"}}, -{"id":"mu2","key":"mu2","value":{"rev":"3-4ade1c5b1496c720312beae1822da9de"}}, -{"id":"mud","key":"mud","value":{"rev":"66-56e1b1a1e5af14c3df0520c58358e7cd"}}, -{"id":"muffin","key":"muffin","value":{"rev":"22-210c45a888fe1f095becdcf11876a2bc"}}, -{"id":"multi-node","key":"multi-node","value":{"rev":"1-224161d875f0e1cbf4b1e249603c670a"}}, -{"id":"multicast-eventemitter","key":"multicast-eventemitter","value":{"rev":"13-ede3e677d6e21bbfe42aad1b549a137c"}}, -{"id":"multimeter","key":"multimeter","value":{"rev":"7-847f45a6f592a8410a77d3e5efb5cbf3"}}, -{"id":"multipart-stack","key":"multipart-stack","value":{"rev":"9-85aaa2ed2180d3124d1dcd346955b672"}}, -{"id":"muse","key":"muse","value":{"rev":"3-d6bbc06df2e359d6ef285f9da2bd0efd"}}, -{"id":"musicmetadata","key":"musicmetadata","value":{"rev":"21-957bf986aa9d0db02175ea1d79293909"}}, -{"id":"mustache","key":"mustache","value":{"rev":"6-7f8458f2b52de5b37004b105c0f39e62"}}, -{"id":"mustachio","key":"mustachio","value":{"rev":"9-6ed3f41613f886128acd18b73b55439f"}}, -{"id":"mutex","key":"mutex","value":{"rev":"3-de95bdff3dd00271361067b5d70ea03b"}}, -{"id":"muzak","key":"muzak","value":{"rev":"9-5ff968ffadebe957b72a8b77b538b71c"}}, -{"id":"mvc","key":"mvc","value":{"rev":"52-7c954b6c3b90b1b734d8e8c3d2d34f5e"}}, -{"id":"mvc.coffee","key":"mvc.coffee","value":{"rev":"3-f203564ed70c0284455e7f96ea61fdb7"}}, -{"id":"mypackage","key":"mypackage","value":{"rev":"3-49cc95fb2e5ac8ee3dbbab1de451c0d1"}}, -{"id":"mypakege","key":"mypakege","value":{"rev":"3-e74d7dc2c2518304ff1700cf295eb823"}}, -{"id":"myrtle-parser","key":"myrtle-parser","value":{"rev":"3-9089c1a2f3c3a24f0bce3941bc1d534d"}}, -{"id":"mysql","key":"mysql","value":{"rev":"30-a8dc68eb056cb6f69fae2423c1337474"}}, -{"id":"mysql-activerecord","key":"mysql-activerecord","value":{"rev":"17-9d21d0b10a5c84f6cacfd8d2236f9887"}}, -{"id":"mysql-client","key":"mysql-client","value":{"rev":"5-cc877218864c319d17f179e49bf58c99"}}, -{"id":"mysql-helper","key":"mysql-helper","value":{"rev":"3-c6f3b9f00cd9fee675aa2a9942cc336a"}}, -{"id":"mysql-libmysqlclient","key":"mysql-libmysqlclient","value":{"rev":"38-51c08e24257b99bf5591232016ada8ab"}}, -{"id":"mysql-native","key":"mysql-native","value":{"rev":"12-0592fbf66c55e6e9db6a75c97be088c3"}}, -{"id":"mysql-native-prerelease","key":"mysql-native-prerelease","value":{"rev":"7-b1a6f3fc41f6c152f3b178e13f91b5c4"}}, -{"id":"mysql-oil","key":"mysql-oil","value":{"rev":"9-70c07b9c552ff592be8ca89ea6efa408"}}, -{"id":"mysql-pool","key":"mysql-pool","value":{"rev":"15-41f510c45174b6c887856120ce3d5a3b"}}, -{"id":"mysql-simple","key":"mysql-simple","value":{"rev":"13-7ee13f035e8ebcbc27f6fe910058aee9"}}, -{"id":"n","key":"n","value":{"rev":"31-bfaed5022beae2177a090c4c8fce82a4"}}, -{"id":"n-ext","key":"n-ext","value":{"rev":"3-5ad67a300f8e88ef1dd58983c9061bc1"}}, -{"id":"n-pubsub","key":"n-pubsub","value":{"rev":"3-af990bcbf9f94554365788b81715d3b4"}}, -{"id":"n-rest","key":"n-rest","value":{"rev":"7-42f1d92f9229f126a1b063ca27bfc85b"}}, -{"id":"n-util","key":"n-util","value":{"rev":"6-d0c59c7412408bc94e20de4d22396d79"}}, -{"id":"nMemcached","key":"nMemcached","value":{"rev":"3-be350fd46624a1cac0052231101e0594"}}, -{"id":"nStoreSession","key":"nStoreSession","value":{"rev":"3-a3452cddd2b9ff8edb6d46999fa5b0eb"}}, -{"id":"nTPL","key":"nTPL","value":{"rev":"41-16a54848286364d894906333b0c1bb2c"}}, -{"id":"nTunes","key":"nTunes","value":{"rev":"18-76bc566a504100507056316fe8d3cc35"}}, -{"id":"nabe","key":"nabe","value":{"rev":"13-dc93f35018e84a23ace4d5114fa1bb28"}}, -{"id":"nack","key":"nack","value":{"rev":"118-f629c8c208c76fa0c2ce66d21f927ee4"}}, -{"id":"nagari","key":"nagari","value":{"rev":"11-cb200690c6d606d8597178e492b54cde"}}, -{"id":"nailplate","key":"nailplate","value":{"rev":"11-e1532c42d9d83fc32942dec0b87df587"}}, -{"id":"nails","key":"nails","value":{"rev":"12-f472bf005c4a4c2b49fb0118b109bef1"}}, -{"id":"nake","key":"nake","value":{"rev":"11-250933df55fbe7bb19e34a84ed23ca3e"}}, -{"id":"named-routes","key":"named-routes","value":{"rev":"6-ffbdd4caa74a30e87aa6dbb36f2b967c"}}, -{"id":"namespace","key":"namespace","value":{"rev":"7-89e2850e14206af13f26441e75289878"}}, -{"id":"namespaces","key":"namespaces","value":{"rev":"11-7a9b3d2537438211021a472035109f3c"}}, -{"id":"nami","key":"nami","value":{"rev":"29-3d44b1338222a4d994d4030868a94ea8"}}, -{"id":"nano","key":"nano","value":{"rev":"105-50efc49a8f6424706af554872002c014"}}, -{"id":"nanostate","key":"nanostate","value":{"rev":"9-1664d985e8cdbf16e150ba6ba4d79ae5"}}, -{"id":"narcissus","key":"narcissus","value":{"rev":"3-46581eeceff566bd191a14dec7b337f6"}}, -{"id":"nariya","key":"nariya","value":{"rev":"13-d83b8b6162397b154a4b59553be225e9"}}, -{"id":"narrativ","key":"narrativ","value":{"rev":"9-ef215eff6bf222425f73d23e507f7ff3"}}, -{"id":"narrow","key":"narrow","value":{"rev":"5-c6963048ba02adaf819dc51815fa0015"}}, -{"id":"narwhal","key":"narwhal","value":{"rev":"6-13bf3f87e6cfb1e57662cc3e3be450fc"}}, -{"id":"narwhal-lib","key":"narwhal-lib","value":{"rev":"6-4722d9b35fed59a2e8f7345a1eb6769d"}}, -{"id":"nat","key":"nat","value":{"rev":"3-da0906c08792043546f98ace8ce59a78"}}, -{"id":"native2ascii","key":"native2ascii","value":{"rev":"3-9afd51209d67303a8ee807ff862e31fc"}}, -{"id":"nativeUtil","key":"nativeUtil","value":{"rev":"7-6e3e9757b436ebcee35a20e633c08d60"}}, -{"id":"natives","key":"natives","value":{"rev":"24-6c4269c9c7cfb52571bd2c94fa26efc6"}}, -{"id":"natural","key":"natural","value":{"rev":"110-fc92701ad8525f45fbdb5863959ca03c"}}, -{"id":"naturalsort","key":"naturalsort","value":{"rev":"3-4321f5e432aee224af0fee9e4fb901ff"}}, -{"id":"nave","key":"nave","value":{"rev":"29-79baa66065fa9075764cc3e5da2edaef"}}, -{"id":"navigator","key":"navigator","value":{"rev":"3-f2f4f5376afb10753006f40bd49689c3"}}, -{"id":"nbs-api","key":"nbs-api","value":{"rev":"3-94949b1f0797369abc0752482268ef08"}}, -{"id":"nbt","key":"nbt","value":{"rev":"3-b711b9db76f64449df7f43c659ad8e7f"}}, -{"id":"nclosure","key":"nclosure","value":{"rev":"9-042b39740a39f0556d0dc2c0990b7fa8"}}, -{"id":"nclosureultimate","key":"nclosureultimate","value":{"rev":"3-61ff4bc480239304c459374c9a5f5754"}}, -{"id":"nconf","key":"nconf","value":{"rev":"65-8d8c0d2c6d5d9d526b8a3f325f68eca1"}}, -{"id":"nconf-redis","key":"nconf-redis","value":{"rev":"5-21ae138633b20cb29ed49b9fcd425e10"}}, -{"id":"ncp","key":"ncp","value":{"rev":"23-6441091c6c27ecb5b99f5781299a2192"}}, -{"id":"ncss","key":"ncss","value":{"rev":"9-1d2330e0fdbc40f0810747c2b156ecf2"}}, -{"id":"ncurses","key":"ncurses","value":{"rev":"12-bb059ea6fee12ca77f1fbb7bb6dd9447"}}, -{"id":"ndb","key":"ndb","value":{"rev":"15-b3e826f68a57095413666e9fe74589da"}}, -{"id":"ndistro","key":"ndistro","value":{"rev":"3-fcda3c018d11000b2903ad7104b60b35"}}, -{"id":"ndns","key":"ndns","value":{"rev":"5-1aeaaca119be44af7a83207d76f263fc"}}, -{"id":"nebulog","key":"nebulog","value":{"rev":"3-1863b0ce17cc0f07a50532a830194254"}}, -{"id":"neco","key":"neco","value":{"rev":"43-e830913302b52012ab63177ecf292822"}}, -{"id":"ned","key":"ned","value":{"rev":"15-4230c69fb52dfddfd65526dcfe5c4ec6"}}, -{"id":"nedis","key":"nedis","value":{"rev":"7-d49e329dca586d1a3569266f0595c9ad"}}, -{"id":"neko","key":"neko","value":{"rev":"60-13aa87d2278c3a734733cff2a34a7970"}}, -{"id":"neo4j","key":"neo4j","value":{"rev":"7-dde7066eac32a405df95ccf9c50c8ae7"}}, -{"id":"nerve","key":"nerve","value":{"rev":"3-2c47b79586d7930aabf9325ca88ad7e8"}}, -{"id":"nest","key":"nest","value":{"rev":"23-560d67971e9acddacf087608306def24"}}, -{"id":"nestableflow","key":"nestableflow","value":{"rev":"5-ee8af667a84d333fcc8092c89f4189c3"}}, -{"id":"nestor","key":"nestor","value":{"rev":"3-f1affbc37be3bf4e337365bd172578dc"}}, -{"id":"net","key":"net","value":{"rev":"3-895103ee532ef31396d9c06764df1ed8"}}, -{"id":"netiface","key":"netiface","value":{"rev":"3-885c94284fd3a9601afe291ab68aca84"}}, -{"id":"netpool","key":"netpool","value":{"rev":"3-dadfd09b9eb7ef73e2bff34a381de207"}}, -{"id":"netstring","key":"netstring","value":{"rev":"9-d26e7bf4a3ce5eb91bb1889d362f71e6"}}, -{"id":"neuron","key":"neuron","value":{"rev":"11-edaed50492368ff39eaf7d2004d7f4d8"}}, -{"id":"new","key":"new","value":{"rev":"3-7789b37104d8161b7ccf898a9cda1fc6"}}, -{"id":"newforms","key":"newforms","value":{"rev":"9-2a87cb74477d210fcb1d0c3e3e236f03"}}, -{"id":"nexpect","key":"nexpect","value":{"rev":"15-e7127f41b9f3ec45185ede7bab7b4acd"}}, -{"id":"next","key":"next","value":{"rev":"13-de5e62125b72e48ea142a55a3817589c"}}, -{"id":"nextrip","key":"nextrip","value":{"rev":"5-1ac8103552967af98d3de452ef81a94f"}}, -{"id":"nexttick","key":"nexttick","value":{"rev":"9-c7ec279e713ea8483d33c31871aea0db"}}, -{"id":"ngen","key":"ngen","value":{"rev":"9-972980a439c34851d67e4f61a96c2632"}}, -{"id":"ngen-basicexample","key":"ngen-basicexample","value":{"rev":"3-897763c230081d320586bcadfa84499f"}}, -{"id":"ngeohash","key":"ngeohash","value":{"rev":"5-9ca0c06066bc798e934db35cad99453e"}}, -{"id":"ngist","key":"ngist","value":{"rev":"7-592c24e72708219ed1eb078ddff95ab6"}}, -{"id":"ngram","key":"ngram","value":{"rev":"5-00e6b24dc178bdeb49b1ac8cb09f6e77"}}, -{"id":"ngrep","key":"ngrep","value":{"rev":"3-49c1a3839b12083280475177c1a16e38"}}, -{"id":"nhp-body-restreamer","key":"nhp-body-restreamer","value":{"rev":"1-8a4e5e23ae681a3f8be9afb613648230"}}, -{"id":"nhttpd","key":"nhttpd","value":{"rev":"3-cdc73384e1a1a4666e813ff52f2f5e4f"}}, -{"id":"nib","key":"nib","value":{"rev":"25-d67d5a294ba5b8953472cf936b97e13d"}}, -{"id":"nicetime","key":"nicetime","value":{"rev":"3-39fdba269d712064dc1e02a7ab846821"}}, -{"id":"nicknack","key":"nicknack","value":{"rev":"5-7b5477b63f782d0a510b0c15d2824f20"}}, -{"id":"nide","key":"nide","value":{"rev":"9-74f642fced47c934f9bae29f04d17a46"}}, -{"id":"nih-op","key":"nih-op","value":{"rev":"3-6e649b45964f84cb04340ab7f0a36a1c"}}, -{"id":"nimble","key":"nimble","value":{"rev":"5-867b808dd80eab33e5f22f55bb5a7376"}}, -{"id":"ninjs","key":"ninjs","value":{"rev":"3-f59997cc4bacb2d9d9852f955d15199e"}}, -{"id":"ninotify","key":"ninotify","value":{"rev":"3-a0f3c7cbbe7ccf5d547551aa062cc8b5"}}, -{"id":"nirc","key":"nirc","value":{"rev":"3-28197984656939a5a93a77c0a1605406"}}, -{"id":"nithub","key":"nithub","value":{"rev":"3-eaa85e6ac6668a304e4e4a565c54f57d"}}, -{"id":"nix","key":"nix","value":{"rev":"12-7b338b03c0e110aeb348551b14796ff1"}}, -{"id":"nko","key":"nko","value":{"rev":"39-2bf94b2bc279b8cf847bfc7668029d37"}}, -{"id":"nlog","key":"nlog","value":{"rev":"3-ae469820484ca33f346001dcb7b63a2d"}}, -{"id":"nlog4js","key":"nlog4js","value":{"rev":"3-bc17a61a9023d64e192d249144e69f02"}}, -{"id":"nlogger","key":"nlogger","value":{"rev":"11-1e48fc9a5a4214d9e56db6c6b63f1eeb"}}, -{"id":"nmd","key":"nmd","value":{"rev":"27-2dcb60d0258a9cea838f7cc4e0922f90"}}, -{"id":"nntp","key":"nntp","value":{"rev":"5-c86b189e366b9a6a428f9a2ee88dccf1"}}, -{"id":"no.de","key":"no.de","value":{"rev":"10-0dc855fd6b0b36a710b473b2720b22c0"}}, -{"id":"nobj","key":"nobj","value":{"rev":"3-0b4a46b91b70117306a9888202117223"}}, -{"id":"noblemachine","key":"noblemachine","value":{"rev":"3-06fec410fe0c7328e06eec50b4fa5d9a"}}, -{"id":"noblerecord","key":"noblerecord","value":{"rev":"5-22f24c4285bd405785588480bb2bc324"}}, -{"id":"nock","key":"nock","value":{"rev":"5-f94423d37dbdf41001ec097f20635271"}}, -{"id":"nocr-mongo","key":"nocr-mongo","value":{"rev":"5-ce6335ed276187cc38c30cb5872d3d83"}}, -{"id":"nodast","key":"nodast","value":{"rev":"3-1c563107f2d77b79a8f0d0b8ba7041f5"}}, -{"id":"node-api","key":"node-api","value":{"rev":"3-b69cefec93d9f73256acf9fb9edeebd6"}}, -{"id":"node-apidoc","key":"node-apidoc","value":{"rev":"6-cd26945e959403fcbee8ba542e14e667"}}, -{"id":"node-app-reloader","key":"node-app-reloader","value":{"rev":"5-e08cac7656afd6c124f8e2a9b9d6fdd3"}}, -{"id":"node-arse","key":"node-arse","value":{"rev":"9-b643c828541739a5fa972c801f81b212"}}, -{"id":"node-assert-extras","key":"node-assert-extras","value":{"rev":"3-3498e17b996ffc42a29d46c9699a3b52"}}, -{"id":"node-assert-lint-free","key":"node-assert-lint-free","value":{"rev":"5-852130ba6bafc703657b833343bc5646"}}, -{"id":"node-asset","key":"node-asset","value":{"rev":"18-f7cf59be8e0d015a43d05807a1ed9c0c"}}, -{"id":"node-awesm","key":"node-awesm","value":{"rev":"3-539c10145541ac5efc4dd295767b2abc"}}, -{"id":"node-backbone-couch","key":"node-backbone-couch","value":{"rev":"19-c4d8e93436b60e098c81cc0fe50f960c"}}, -{"id":"node-base64","key":"node-base64","value":{"rev":"11-da10a7157fd9e139b48bc8d9e44a98fa"}}, -{"id":"node-bj","key":"node-bj","value":{"rev":"3-5cd21fa259199870d1917574cd167396"}}, -{"id":"node-bosh-stress-tool","key":"node-bosh-stress-tool","value":{"rev":"3-36afc4b47e570964b7f8d705e1d47732"}}, -{"id":"node-brainfuck","key":"node-brainfuck","value":{"rev":"5-c7a6f703a97a409670005cab52664629"}}, -{"id":"node-build","key":"node-build","value":{"rev":"10-4f2f137fb4ef032f9dca3e3c64c15270"}}, -{"id":"node-casa","key":"node-casa","value":{"rev":"3-3f80a478aa47620bfc0c64cc6f140d98"}}, -{"id":"node-ccl","key":"node-ccl","value":{"rev":"13-00498b820cc4cadce8cc5b7b76e30b0f"}}, -{"id":"node-chain","key":"node-chain","value":{"rev":"6-b543f421ac63eeedc667b3395e7b8971"}}, -{"id":"node-child-process-manager","key":"node-child-process-manager","value":{"rev":"36-befb1a0eeac02ad400e2aaa8a076a053"}}, -{"id":"node-chirpstream","key":"node-chirpstream","value":{"rev":"10-f20e404f9ae5d43dfb6bcee15bd9affe"}}, -{"id":"node-clone","key":"node-clone","value":{"rev":"5-5ace5d51179d0e642bf9085b3bbf999b"}}, -{"id":"node-cloudwatch","key":"node-cloudwatch","value":{"rev":"3-7f9d1e075fcc3bd3e7849acd893371d5"}}, -{"id":"node-combine","key":"node-combine","value":{"rev":"3-51891c3c7769ff11a243c89c7e537907"}}, -{"id":"node-compat","key":"node-compat","value":{"rev":"9-24fce8e15eed3e193832b1c93a482d15"}}, -{"id":"node-config","key":"node-config","value":{"rev":"6-8821f6b46347e57258e62e1be841c186"}}, -{"id":"node-crocodoc","key":"node-crocodoc","value":{"rev":"5-ad4436f633f37fe3248dce93777fc26e"}}, -{"id":"node-csv","key":"node-csv","value":{"rev":"10-cd15d347b595f1d9d1fd30b483c52724"}}, -{"id":"node-date","key":"node-date","value":{"rev":"3-a5b41cab3247e12f2beaf1e0b1ffadfa"}}, -{"id":"node-dbi","key":"node-dbi","value":{"rev":"27-96e1df6fdefbae77bfa02eda64c3e3b9"}}, -{"id":"node-debug-proxy","key":"node-debug-proxy","value":{"rev":"9-c00a14832cdd5ee4d489eb41a3d0d621"}}, -{"id":"node-dep","key":"node-dep","value":{"rev":"15-378dedd3f0b3e54329c00c675b19401c"}}, -{"id":"node-dev","key":"node-dev","value":{"rev":"48-6a98f38078fe5678d6c2fb48aec3c1c3"}}, -{"id":"node-downloader","key":"node-downloader","value":{"rev":"3-a541126c56c48681571e5e998c481343"}}, -{"id":"node-evented","key":"node-evented","value":{"rev":"6-a6ce8ab39e01cc0262c80d4bf08fc333"}}, -{"id":"node-exception-notifier","key":"node-exception-notifier","value":{"rev":"3-cebc02c45dace4852f8032adaa4e3c9c"}}, -{"id":"node-expat","key":"node-expat","value":{"rev":"33-261d85273a0a551e7815f835a933d5eb"}}, -{"id":"node-expect","key":"node-expect","value":{"rev":"7-5ba4539adfd3ba95dab21bb5bc0a5193"}}, -{"id":"node-express-boilerplate","key":"node-express-boilerplate","value":{"rev":"3-972f51d1ff9493e48d7cf508461f1114"}}, -{"id":"node-extjs","key":"node-extjs","value":{"rev":"7-33143616b4590523b4e1549dd8ffa991"}}, -{"id":"node-extjs4","key":"node-extjs4","value":{"rev":"3-8e5033aed477629a6fb9812466a90cfd"}}, -{"id":"node-fakeweb","key":"node-fakeweb","value":{"rev":"5-f01377fa6d03461cbe77f41b73577cf4"}}, -{"id":"node-fb","key":"node-fb","value":{"rev":"3-bc5f301a60e475de7c614837d3f9f35a"}}, -{"id":"node-fb-signed-request","key":"node-fb-signed-request","value":{"rev":"3-33c8f043bb947b63a84089d633d68f8e"}}, -{"id":"node-fects","key":"node-fects","value":{"rev":"3-151b7b895b74b24a87792fac34735814"}}, -{"id":"node-ffi","key":"node-ffi","value":{"rev":"22-25cf229f0ad4102333b2b13e03054ac5"}}, -{"id":"node-filter","key":"node-filter","value":{"rev":"3-0e6a86b4abb65df3594e5c93ab04bd31"}}, -{"id":"node-foursquare","key":"node-foursquare","value":{"rev":"25-549bbb0c2b4f96b2c5e6a5f642e8481d"}}, -{"id":"node-fs","key":"node-fs","value":{"rev":"5-14050cbc3887141f6b0e1e7d62736a63"}}, -{"id":"node-fs-synchronize","key":"node-fs-synchronize","value":{"rev":"11-6341e79f3391a9e1daa651a5932c8795"}}, -{"id":"node-gd","key":"node-gd","value":{"rev":"11-2ede7f4af38f062b86cc32bb0125e1bf"}}, -{"id":"node-geocode","key":"node-geocode","value":{"rev":"6-505af45c7ce679ac6738b495cc6b03c2"}}, -{"id":"node-get","key":"node-get","value":{"rev":"9-906945005a594ea1f05d4ad23170a83f"}}, -{"id":"node-gettext","key":"node-gettext","value":{"rev":"5-532ea4b528108b4c8387ddfc8fa690b2"}}, -{"id":"node-gist","key":"node-gist","value":{"rev":"11-3495a499c9496d01235676f429660424"}}, -{"id":"node-glbse","key":"node-glbse","value":{"rev":"5-69a537189610c69cc549f415431b181a"}}, -{"id":"node-google-sql","key":"node-google-sql","value":{"rev":"7-bfe20d25a4423651ecdff3f5054a6946"}}, -{"id":"node-gravatar","key":"node-gravatar","value":{"rev":"6-8265fc1ad003fd8a7383244c92abb346"}}, -{"id":"node-handlersocket","key":"node-handlersocket","value":{"rev":"16-f1dc0246559748a842dd0e1919c569ae"}}, -{"id":"node-hdfs","key":"node-hdfs","value":{"rev":"3-d460fba8ff515660de34cb216223c569"}}, -{"id":"node-hipchat","key":"node-hipchat","value":{"rev":"3-9d16738bf70f9e37565727e671ffe551"}}, -{"id":"node-hive","key":"node-hive","value":{"rev":"31-5eef1fa77a39e4bdacd8fa85ec2ce698"}}, -{"id":"node-html-encoder","key":"node-html-encoder","value":{"rev":"3-75f92e741a3b15eb56e3c4513feaca6d"}}, -{"id":"node-i3","key":"node-i3","value":{"rev":"3-5c489f43aeb06054b02ad3706183599c"}}, -{"id":"node-indextank","key":"node-indextank","value":{"rev":"5-235a17fce46c73c8b5abc4cf5f964385"}}, -{"id":"node-inherit","key":"node-inherit","value":{"rev":"3-099c0acf9c889eea94faaf64067bfc52"}}, -{"id":"node-inspector","key":"node-inspector","value":{"rev":"34-ca9fa856cf32a737d1ecccb759aaf5e1"}}, -{"id":"node-int64","key":"node-int64","value":{"rev":"11-50b92b5b65adf17e673b4d15df643ed4"}}, -{"id":"node-ip-lib","key":"node-ip-lib","value":{"rev":"3-2fe72f7b78cbc1739c71c7cfaec9fbcd"}}, -{"id":"node-iplookup","key":"node-iplookup","value":{"rev":"10-ba8474624dd852a46303d32ff0556883"}}, -{"id":"node-jdownloader","key":"node-jdownloader","value":{"rev":"3-b015035cfb8540568da5deb55b35248c"}}, -{"id":"node-jslint-all","key":"node-jslint-all","value":{"rev":"5-582f4a31160d3700731fa39771702896"}}, -{"id":"node-jsonengine","key":"node-jsonengine","value":{"rev":"3-6e429c32e42b205f3ed1ea1f48d67cbc"}}, -{"id":"node-khtml","key":"node-khtml","value":{"rev":"39-db8e8eea569657fc7de6300172a6a8a7"}}, -{"id":"node-linkshare","key":"node-linkshare","value":{"rev":"35-acc18a5d584b828bb2bd4f32bbcde98c"}}, -{"id":"node-log","key":"node-log","value":{"rev":"17-79cecc66227b4fb3a2ae04b7dac17cc2"}}, -{"id":"node-logentries","key":"node-logentries","value":{"rev":"3-0f640d5ff489a6904f4a8c18fb5f7e9c"}}, -{"id":"node-logger","key":"node-logger","value":{"rev":"3-75084f98359586bdd254e57ea5915d37"}}, -{"id":"node-logging","key":"node-logging","value":{"rev":"15-af01bc2b6128150787c85c8df1dae642"}}, -{"id":"node-mailer","key":"node-mailer","value":{"rev":"5-5b88675f05efe2836126336c880bd841"}}, -{"id":"node-mailgun","key":"node-mailgun","value":{"rev":"5-4bcfb7bf5163748b87c1b9ed429ed178"}}, -{"id":"node-markdown","key":"node-markdown","value":{"rev":"6-67137da4014f22f656aaefd9dfa2801b"}}, -{"id":"node-mdbm","key":"node-mdbm","value":{"rev":"22-3006800b042cf7d4b0b391c278405143"}}, -{"id":"node-minify","key":"node-minify","value":{"rev":"13-e853813d4b6519b168965979b8ccccdd"}}, -{"id":"node-mug","key":"node-mug","value":{"rev":"3-f7567ffac536bfa7eb5a7e3da7a0efa0"}}, -{"id":"node-mvc","key":"node-mvc","value":{"rev":"3-74f7c07b2991fcddb27afd2889b6db4e"}}, -{"id":"node-mwire","key":"node-mwire","value":{"rev":"26-79d7982748f42b9e07ab293447b167ec"}}, -{"id":"node-mynix-feed","key":"node-mynix-feed","value":{"rev":"3-59d4a624b3831bbab6ee99be2f84e568"}}, -{"id":"node-nether","key":"node-nether","value":{"rev":"3-0fbefe710fe0d74262bfa25f6b4e1baf"}}, -{"id":"node-nude","key":"node-nude","value":{"rev":"3-600abb219646299ac602fa51fa260f37"}}, -{"id":"node-nxt","key":"node-nxt","value":{"rev":"3-8ce48601c2b0164e2b125259a0c97d45"}}, -{"id":"node-oauth","key":"node-oauth","value":{"rev":"3-aa6cd61f44d74118bafa5408900c4984"}}, -{"id":"node-opencalais","key":"node-opencalais","value":{"rev":"13-a3c0b882aca7207ce36f107e40a0ce50"}}, -{"id":"node-props","key":"node-props","value":{"rev":"7-e400cee08cc9abdc1f1ce4f262a04b05"}}, -{"id":"node-proxy","key":"node-proxy","value":{"rev":"20-ce722bf45c84a7d925b8b7433e786ed6"}}, -{"id":"node-pusher","key":"node-pusher","value":{"rev":"3-7cc7cd5bffaf3b11c44438611beeba98"}}, -{"id":"node-putio","key":"node-putio","value":{"rev":"3-8a1fc6362fdcf16217cdb6846e419b4c"}}, -{"id":"node-raphael","key":"node-raphael","value":{"rev":"25-e419d98a12ace18a40d94a9e8e32cdd4"}}, -{"id":"node-rapleaf","key":"node-rapleaf","value":{"rev":"11-c849c8c8635e4eb2f81bd7810b7693fd"}}, -{"id":"node-rats","key":"node-rats","value":{"rev":"3-dca544587f3121148fe02410032cf726"}}, -{"id":"node-rdf2json","key":"node-rdf2json","value":{"rev":"3-bde382dc2fcb40986c5ac41643d44543"}}, -{"id":"node-recurly","key":"node-recurly","value":{"rev":"11-79cab9ccee7c1ddb83791e8de41c72f5"}}, -{"id":"node-redis","key":"node-redis","value":{"rev":"13-12adf3a3e986675637fa47b176f527e3"}}, -{"id":"node-redis-mapper","key":"node-redis-mapper","value":{"rev":"5-53ba8f67cc82dbf1d127fc7359353f32"}}, -{"id":"node-redis-monitor","key":"node-redis-monitor","value":{"rev":"3-79bcba76241d7c7dbc4b18d90a9d59e3"}}, -{"id":"node-restclient","key":"node-restclient","value":{"rev":"6-5844eba19bc465a8f75b6e94c061350f"}}, -{"id":"node-restclient2","key":"node-restclient2","value":{"rev":"5-950de911f7bde7900dfe5b324f49818c"}}, -{"id":"node-runner","key":"node-runner","value":{"rev":"3-e9a9e6bd10d2ab1aed8b401b04fadc7b"}}, -{"id":"node-sc-setup","key":"node-sc-setup","value":{"rev":"3-e89c496e03c48d8574ccaf61c9ed4fca"}}, -{"id":"node-schedule","key":"node-schedule","value":{"rev":"9-ae12fa59226f1c9b7257b8a2d71373b4"}}, -{"id":"node-sdlmixer","key":"node-sdlmixer","value":{"rev":"8-489d85278d6564b6a4e94990edcb0527"}}, -{"id":"node-secure","key":"node-secure","value":{"rev":"3-73673522a4bb5f853d55e535f0934803"}}, -{"id":"node-sendgrid","key":"node-sendgrid","value":{"rev":"9-4662c31304ca4ee4e702bd3a54ea7824"}}, -{"id":"node-sizzle","key":"node-sizzle","value":{"rev":"6-c08c24d9d769d3716e5c4e3441740eb2"}}, -{"id":"node-soap-client","key":"node-soap-client","value":{"rev":"9-35ff34a4a5af569de6a2e89d1b35b69a"}}, -{"id":"node-spec","key":"node-spec","value":{"rev":"9-92e99ca74b9a09a8ae2eb7382ef511ef"}}, -{"id":"node-static","key":"node-static","value":{"rev":"10-11b0480fcd416db3d3d4041f43a55290"}}, -{"id":"node-static-maccman","key":"node-static-maccman","value":{"rev":"3-49e256728b14c85776b74f2bd912eb42"}}, -{"id":"node-statsd","key":"node-statsd","value":{"rev":"5-08d3e6b4b2ed1d0b7916e9952f55573c"}}, -{"id":"node-statsd-instrument","key":"node-statsd-instrument","value":{"rev":"3-c3cd3315e1edcc91096830392f439305"}}, -{"id":"node-std","key":"node-std","value":{"rev":"3-f99be0f03be4175d546823799bb590d3"}}, -{"id":"node-store","key":"node-store","value":{"rev":"3-7cb6bf13de9550b869c768f464fd0f65"}}, -{"id":"node-stringprep","key":"node-stringprep","value":{"rev":"13-9b08baa97042f71c5c8e9e2fdcc2c300"}}, -{"id":"node-synapse","key":"node-synapse","value":{"rev":"3-c46c47099eb2792f4a57fdfd789520ca"}}, -{"id":"node-syslog","key":"node-syslog","value":{"rev":"23-34f7df06ba88d9f897b7e00404db7187"}}, -{"id":"node-t","key":"node-t","value":{"rev":"3-042225eff3208ba9add61a9f79d90871"}}, -{"id":"node-taobao","key":"node-taobao","value":{"rev":"7-c988ace74806b2e2f55e162f54ba1a2c"}}, -{"id":"node-term-ui","key":"node-term-ui","value":{"rev":"5-210310014b19ce26c5e3e840a8a0549e"}}, -{"id":"node-tiny","key":"node-tiny","value":{"rev":"7-df05ab471f25ca4532d80c83106944d7"}}, -{"id":"node-tmpl","key":"node-tmpl","value":{"rev":"3-6fcfa960da8eb72a5e3087559d3fe206"}}, -{"id":"node-twilio","key":"node-twilio","value":{"rev":"11-af69e600109d38c77eadbcec4bee4782"}}, -{"id":"node-twitter-mailer","key":"node-twitter-mailer","value":{"rev":"7-f915b76d834cb162c91816abc30cee5f"}}, -{"id":"node-usb","key":"node-usb","value":{"rev":"3-0c3837307f86a80427800f1b45aa5862"}}, -{"id":"node-uuid","key":"node-uuid","value":{"rev":"6-642efa619ad8a6476a44a5c6158e7a36"}}, -{"id":"node-vapor.js","key":"node-vapor.js","value":{"rev":"3-d293284cc415b2906533e91db13ee748"}}, -{"id":"node-version","key":"node-version","value":{"rev":"3-433b1529a6aa3d619314e461e978d2b6"}}, -{"id":"node-webapp","key":"node-webapp","value":{"rev":"11-65411bfd8eaf19d3539238360d904d43"}}, -{"id":"node-wiki","key":"node-wiki","value":{"rev":"5-22b0177c9a5e4dc1f72d36bb83c746d0"}}, -{"id":"node-wkhtml","key":"node-wkhtml","value":{"rev":"5-a8fa203720442b443d558670c9750548"}}, -{"id":"node-xerces","key":"node-xerces","value":{"rev":"3-de6d82ec712af997b7aae451277667f0"}}, -{"id":"node-xml","key":"node-xml","value":{"rev":"3-e14a52dcd04302aea7dd6943cf6dd886"}}, -{"id":"node-xmpp","key":"node-xmpp","value":{"rev":"36-031eb5e830ed2e2027ee4ee7f861cf81"}}, -{"id":"node-xmpp-bosh","key":"node-xmpp-bosh","value":{"rev":"85-f7f8b699b6fda74fc27c621466915bd1"}}, -{"id":"node-xmpp-via-bosh","key":"node-xmpp-via-bosh","value":{"rev":"3-5f5fee9e42ae8ce8f42d55c31808c969"}}, -{"id":"node.io","key":"node.io","value":{"rev":"224-e99561d454a7676d10875e1b06ba44c7"}}, -{"id":"node.io-min","key":"node.io-min","value":{"rev":"3-e8389bdcfa55c68ae9698794d9089ce4"}}, -{"id":"node.isbn","key":"node.isbn","value":{"rev":"3-76aa84f3c49a54b6c901f440af35192d"}}, -{"id":"node.uptime","key":"node.uptime","value":{"rev":"5-cfc2c1c1460d000eab4e1a28506e6d29"}}, -{"id":"node3p","key":"node3p","value":{"rev":"14-b1931b8aa96227854d78965cc4301168"}}, -{"id":"node3p-web","key":"node3p-web","value":{"rev":"12-bc783ee1e493e80b7e7a3c2fce39f55e"}}, -{"id":"nodeBase","key":"nodeBase","value":{"rev":"39-4d9ae0f18e0bca7192901422d85e85c7"}}, -{"id":"nodeCgi","key":"nodeCgi","value":{"rev":"9-bb65e71ee63551e519f49434f2ae1cd7"}}, -{"id":"nodeDocs","key":"nodeDocs","value":{"rev":"3-0c6e714d3e6d5c2cc9482444680fb3ca"}}, -{"id":"nodePhpSessions","key":"nodePhpSessions","value":{"rev":"3-5063b38582deaca9cacdc029db97c2b1"}}, -{"id":"node_bsdiff","key":"node_bsdiff","value":{"rev":"5-e244ef36755a2b6534ce50fa1ee5ee6e"}}, -{"id":"node_hash","key":"node_hash","value":{"rev":"3-cdce2fcc2c18fcd25e16be8e52add891"}}, -{"id":"node_util","key":"node_util","value":{"rev":"3-cde723ee2311cf48f7cf0a3bc3484f9a"}}, -{"id":"node_xslt","key":"node_xslt","value":{"rev":"3-f12035155aee31d1749204fdca2aee10"}}, -{"id":"nodec","key":"nodec","value":{"rev":"3-dba2af2d5b98a71964abb4328512b9e1"}}, -{"id":"nodefm","key":"nodefm","value":{"rev":"3-c652a95d30318a371736515feab649f9"}}, -{"id":"nodegit","key":"nodegit","value":{"rev":"31-92a2cea0d1c92086c920bc007f5a3f16"}}, -{"id":"nodeib","key":"nodeib","value":{"rev":"3-e67d779007817597ca36e8b821f38e6a"}}, -{"id":"nodeinfo","key":"nodeinfo","value":{"rev":"53-61bf0f48662dc2e04cde38a2b897c211"}}, -{"id":"nodejitsu-client","key":"nodejitsu-client","value":{"rev":"3-4fa613f888ebe249aff7b03aa9b8d7ef"}}, -{"id":"nodejs-intro","key":"nodejs-intro","value":{"rev":"4-c75f03e80b597f734f4466e62ecebfeb"}}, -{"id":"nodejs-tvrage","key":"nodejs-tvrage","value":{"rev":"9-88bb3b5d23652ebdb7186a30bc3be43f"}}, -{"id":"nodejs.be-cli","key":"nodejs.be-cli","value":{"rev":"3-d8f23777f9b18101f2d2dc5aa618a703"}}, -{"id":"nodeler","key":"nodeler","value":{"rev":"9-00760d261ea75164a5709109011afb25"}}, -{"id":"nodelint","key":"nodelint","value":{"rev":"8-31502553d4bb099ba519fb331cccdd63"}}, -{"id":"nodeload","key":"nodeload","value":{"rev":"12-f02626475b59ebe67a864a114c99ff9b"}}, -{"id":"nodemachine","key":"nodemachine","value":{"rev":"8-5342324502e677e35aefef17dc08c8db"}}, -{"id":"nodemailer","key":"nodemailer","value":{"rev":"63-d39a5143b06fa79edcb81252d6329861"}}, -{"id":"nodemock","key":"nodemock","value":{"rev":"33-7095334209b39c8e1482374bee1b712a"}}, -{"id":"nodemon","key":"nodemon","value":{"rev":"42-4f40ba2299ef4ae613a384a48e4045fa"}}, -{"id":"nodepad","key":"nodepad","value":{"rev":"5-93718cc67e97c89f45b753c1caef07e4"}}, -{"id":"nodepal","key":"nodepal","value":{"rev":"5-e53372a5081b3753993ee98299ecd550"}}, -{"id":"nodepie","key":"nodepie","value":{"rev":"21-a44a6d3575758ed591e13831a5420758"}}, -{"id":"nodepress","key":"nodepress","value":{"rev":"3-f17616b9ae61e15d1d219cb87ac5a63a"}}, -{"id":"noderelict","key":"noderelict","value":{"rev":"23-0ca0997e3ef112e9393ae8ccef63f1ee"}}, -{"id":"noderpc","key":"noderpc","value":{"rev":"27-7efb6365916b403c3aa4e1c766de75a2"}}, -{"id":"nodespec","key":"nodespec","value":{"rev":"3-69f357577e52e9fd096ac88a1e7e3445"}}, -{"id":"nodespy","key":"nodespy","value":{"rev":"3-ad33e14db2bcaf61bf99d3e8915da5ee"}}, -{"id":"nodestalker","key":"nodestalker","value":{"rev":"5-080eba88a3625ecf7935ec5e9d2db6e9"}}, -{"id":"nodester-api","key":"nodester-api","value":{"rev":"39-52046dbcdf4447bbb85aecc92086ae1d"}}, -{"id":"nodester-cli","key":"nodester-cli","value":{"rev":"89-6de3d724a974c1dd3b632417f8b01267"}}, -{"id":"nodetk","key":"nodetk","value":{"rev":"11-265d267335e7603249e1af9441700f2f"}}, -{"id":"nodeunit","key":"nodeunit","value":{"rev":"40-d1cc6c06f878fb0b86779186314bc193"}}, -{"id":"nodeunit-coverage","key":"nodeunit-coverage","value":{"rev":"3-29853918351e75e3f6f93acd97e2942f"}}, -{"id":"nodeunit-dsl","key":"nodeunit-dsl","value":{"rev":"6-91be44077bc80c942f86f0ac28a69c5e"}}, -{"id":"nodevlc","key":"nodevlc","value":{"rev":"3-e151577d3e1ba2f58db465d94ebcb1c1"}}, -{"id":"nodevore","key":"nodevore","value":{"rev":"3-ac73b3bc33e2f934776dda359869ddcf"}}, -{"id":"nodewatch","key":"nodewatch","value":{"rev":"9-267bfe1324c51993865dc41b09aee6dc"}}, -{"id":"nodewii","key":"nodewii","value":{"rev":"9-716b3faa8957c1aea337540402ae7f43"}}, -{"id":"nodie","key":"nodie","value":{"rev":"3-cc29702a2e7e295cfe583a05fb77b530"}}, -{"id":"nodify","key":"nodify","value":{"rev":"10-87fadf6bf262882bd71ab7e759b29949"}}, -{"id":"nodrrr","key":"nodrrr","value":{"rev":"3-75937f4ffb722a67d6c5a67663366854"}}, -{"id":"nodules","key":"nodules","value":{"rev":"8-2c6ec430f26ff7ef171e80b7b5e990c2"}}, -{"id":"nodysentary","key":"nodysentary","value":{"rev":"3-7574fc8e12b1271c2eb1c66026f702cb"}}, -{"id":"nohm","key":"nohm","value":{"rev":"45-09dcf4df92734b3c51c8df3c3b374b0b"}}, -{"id":"noid","key":"noid","value":{"rev":"5-ac31e001806789e80a7ffc64f2914eb4"}}, -{"id":"nolife","key":"nolife","value":{"rev":"7-cfd4fe84b1062303cefb83167ea48bba"}}, -{"id":"nolog","key":"nolog","value":{"rev":"9-6e82819b801f5d7ec6773596d5d2efb2"}}, -{"id":"nomnom","key":"nomnom","value":{"rev":"34-bf66753d1d155820cfacfc7fa7a830c9"}}, -{"id":"nomplate","key":"nomplate","value":{"rev":"9-6ea21ee9568421a60cb80637c4c6cb48"}}, -{"id":"nonogo","key":"nonogo","value":{"rev":"5-8307413f9a3da913f9818c4f2d951519"}}, -{"id":"noode","key":"noode","value":{"rev":"7-454df50a7cbd03c46a9951cb1ddbe1c6"}}, -{"id":"noodle","key":"noodle","value":{"rev":"7-163745527770de0de8e7e9d59fc3888c"}}, -{"id":"noop","key":"noop","value":{"rev":"5-ed9fd66573ed1186e66b4c2bc16192cb"}}, -{"id":"nope","key":"nope","value":{"rev":"3-7088ffb62b8e06261527cbfa69cb94c5"}}, -{"id":"nopro","key":"nopro","value":{"rev":"11-6c4aeafe6329821b2259ef11414481dd"}}, -{"id":"nopt","key":"nopt","value":{"rev":"23-cce441940b6f129cab94a359ddb8b3e4"}}, -{"id":"norm","key":"norm","value":{"rev":"9-2bf26c3803fdc3bb6319e490cae3b625"}}, -{"id":"norq","key":"norq","value":{"rev":"3-b1a80ad1aa4ccc493ac25da22b0f0697"}}, -{"id":"norris","key":"norris","value":{"rev":"3-a341286d9e83fa392c1ce6b764d0aace"}}, -{"id":"norris-ioc","key":"norris-ioc","value":{"rev":"15-d022f159229d89ce60fc2a15d71eac59"}}, -{"id":"norris-tester","key":"norris-tester","value":{"rev":"3-fc2f34c9373bbdf5a1cd9cfbaff21f83"}}, -{"id":"northwatcher","key":"northwatcher","value":{"rev":"13-edab28a123f0100e12f96c9828428a8a"}}, -{"id":"nosey","key":"nosey","value":{"rev":"4-10a22f27dd9f2a40acf035a7d250c661"}}, -{"id":"nosql-thin","key":"nosql-thin","value":{"rev":"6-604169cacf303b5278064f68b884090b"}}, -{"id":"notch","key":"notch","value":{"rev":"3-5b720089f0f9cfdbbbea8677216eeee5"}}, -{"id":"notes","key":"notes","value":{"rev":"3-5dfbd6ec33c69c0f1b619dd65d9e7a56"}}, -{"id":"nothing","key":"nothing","value":{"rev":"3-8b44e10efd7d6504755c0c4bd1043814"}}, -{"id":"notifications","key":"notifications","value":{"rev":"3-a68448bca7ea2d3d3ce43e4d03cd76c6"}}, -{"id":"notifo","key":"notifo","value":{"rev":"8-0bc13ea6135adfa80c5fac497a2ddeda"}}, -{"id":"notify","key":"notify","value":{"rev":"3-da00942576bcb5fab594186f80d4575a"}}, -{"id":"notify-send","key":"notify-send","value":{"rev":"7-89f5c6bc656d51577e3997b9f90d0454"}}, -{"id":"nova","key":"nova","value":{"rev":"3-4e136f35b7d5b85816c17496c6c0e382"}}, -{"id":"now","key":"now","value":{"rev":"84-dbfde18b3f6fe79dd3637b6da34b78cf"}}, -{"id":"now-bal","key":"now-bal","value":{"rev":"3-c769bcdd45a93095f68c2de54f35543f"}}, -{"id":"nowpad","key":"nowpad","value":{"rev":"51-8d90c49031f79a9d31eb4ed6f39609b6"}}, -{"id":"nowww","key":"nowww","value":{"rev":"3-541994af2e579b376d2037f4e34f31d8"}}, -{"id":"noxmox","key":"noxmox","value":{"rev":"9-4ac8b1529dced329cac0976b9ca9eed0"}}, -{"id":"nozzle","key":"nozzle","value":{"rev":"23-e60444326d11a5b57c208de548c325e8"}}, -{"id":"npm","key":"npm","value":{"rev":"665-71d13d024c846b2ee85ed054fcfcb242"}}, -{"id":"npm-deploy","key":"npm-deploy","value":{"rev":"23-751e9d3c2edac0fd9916b0e886414ef2"}}, -{"id":"npm-dev-install","key":"npm-dev-install","value":{"rev":"3-7a08e11a59758329ba8dc4e781ea9993"}}, -{"id":"npm-docsite","key":"npm-docsite","value":{"rev":"3-5ed4f1ffea02487ab9ea24cfa0196f76"}}, -{"id":"npm-github-service","key":"npm-github-service","value":{"rev":"8-6891bc055b499e088fc79a7f94b6a4ec"}}, -{"id":"npm-intro-slides","key":"npm-intro-slides","value":{"rev":"8-e95f28475662cb8f70f4cb48baaa9d27"}}, -{"id":"npm-monitor","key":"npm-monitor","value":{"rev":"7-4e3209ea893fe37c0e516fe21de2d8ad"}}, -{"id":"npm-remapper","key":"npm-remapper","value":{"rev":"3-69163475ee93f32faac3f934e772b6c7"}}, -{"id":"npm-tweets","key":"npm-tweets","value":{"rev":"9-86064412a8aa02d813b20d2e49d78d84"}}, -{"id":"npm-wrapper","key":"npm-wrapper","value":{"rev":"3-59c4d372b84f6e91dbe48a220511dfd5"}}, -{"id":"npm2debian","key":"npm2debian","value":{"rev":"3-3cf2f471f3bfbc613176c7c780a6aad6"}}, -{"id":"npmcount","key":"npmcount","value":{"rev":"5-59c55b09d9c2cc7da217cab3b0ea642c"}}, -{"id":"npmdep","key":"npmdep","value":{"rev":"9-78184ad3b841e5c91bbfa29ff722778a"}}, -{"id":"npmtop","key":"npmtop","value":{"rev":"19-2754af894829f22d6edb3a17a64cdf1e"}}, -{"id":"nquery","key":"nquery","value":{"rev":"9-461fb0c9bcc3c15e0696dc2e99807c98"}}, -{"id":"nrecipe","key":"nrecipe","value":{"rev":"15-a96b6b0134a7625eb4eb236b4bf3fbf3"}}, -{"id":"nserver","key":"nserver","value":{"rev":"5-ea895373c340dd8d9119f3f549990048"}}, -{"id":"nserver-util","key":"nserver-util","value":{"rev":"5-5e14eb0bc9f7ab0eac04c5699c6bb328"}}, -{"id":"nssocket","key":"nssocket","value":{"rev":"51-6aac1d5dd0aa7629b3619b3085d63c04"}}, -{"id":"nstore","key":"nstore","value":{"rev":"28-6e2639829539b7315040487dfa5c79af"}}, -{"id":"nstore-cache","key":"nstore-cache","value":{"rev":"3-453ed78dcbe68b31ff675f4d94b47c4a"}}, -{"id":"nstore-query","key":"nstore-query","value":{"rev":"3-39f46992dd278824db641a37ec5546f5"}}, -{"id":"ntodo","key":"ntodo","value":{"rev":"7-e214da8bbed2d3e40bdaec77d7a49831"}}, -{"id":"ntp","key":"ntp","value":{"rev":"5-5ee2b25e8f3bca06d1cc4ce3b25cac42"}}, -{"id":"nts","key":"nts","value":{"rev":"7-ecaf47f8af1f77de791d1d1fa9bab88e"}}, -{"id":"nttpd","key":"nttpd","value":{"rev":"21-cda7aa0f1db126428f6ca01d44b4d209"}}, -{"id":"ntwitter","key":"ntwitter","value":{"rev":"11-732c6f34137c942bc98967170b2f83fc"}}, -{"id":"nub","key":"nub","value":{"rev":"3-932ecf56889fa43584687dbb2cf4aa91"}}, -{"id":"nubnub","key":"nubnub","value":{"rev":"6-93a5267209e1aa869521a5952cbb1828"}}, -{"id":"null","key":"null","value":{"rev":"3-ae8247cfa9553d23a229993cfc8436c5"}}, -{"id":"numb","key":"numb","value":{"rev":"5-594cd9e8e8e4262ddb3ddd80e8084b62"}}, -{"id":"nun","key":"nun","value":{"rev":"8-3bd8b37ed85c1a5da211bd0d5766848e"}}, -{"id":"nunz","key":"nunz","value":{"rev":"3-040f033943158be495f6b0da1a0c0344"}}, -{"id":"nurl","key":"nurl","value":{"rev":"11-6c4ee6fc5c5119c56f2fd8ad8a0cb928"}}, -{"id":"nutil","key":"nutil","value":{"rev":"3-7785a1d4651dcfe78c874848f41d1348"}}, -{"id":"nutils","key":"nutils","value":{"rev":"13-889624db0c155fc2f0b501bba47e55ec"}}, -{"id":"nuvem","key":"nuvem","value":{"rev":"23-054b9b1240f4741f561ef0bb3197bdf8"}}, -{"id":"nvm","key":"nvm","value":{"rev":"28-251b7eb3429a00099b37810d05accd47"}}, -{"id":"nwm","key":"nwm","value":{"rev":"3-fe9274106aac9e67eea734159477acaf"}}, -{"id":"nx","key":"nx","value":{"rev":"55-7ad32fcb34ec25f841ddd0e5857375c7"}}, -{"id":"nx-core","key":"nx-core","value":{"rev":"33-a7bc62348591bae89fff82057bede1ab"}}, -{"id":"nx-daemon","key":"nx-daemon","value":{"rev":"3-7b86a87654c9e32746a4d36d7c527182"}}, -{"id":"nyaatorrents","key":"nyaatorrents","value":{"rev":"5-8600707a1e84f617bd5468b5c9179202"}}, -{"id":"nyala","key":"nyala","value":{"rev":"17-23c908297a37c47f9f09977f4cf101ff"}}, -{"id":"nyam","key":"nyam","value":{"rev":"17-697b5f17fe67630bc9494184146c12f1"}}, -{"id":"nyancat","key":"nyancat","value":{"rev":"13-84c18d007db41b40e9145bdc049b0a00"}}, -{"id":"nymph","key":"nymph","value":{"rev":"5-3a5d7a75d32f7a71bf4ec131f71484d8"}}, -{"id":"o3-xml","key":"o3-xml","value":{"rev":"3-cc4df881333805600467563f80b5216c"}}, -{"id":"oahu","key":"oahu","value":{"rev":"3-e789fc2098292518cb33606c73bfeca4"}}, -{"id":"oauth","key":"oauth","value":{"rev":"38-36b99063db7dc302b70d932e9bbafc24"}}, -{"id":"oauth-client","key":"oauth-client","value":{"rev":"12-ae097c9580ddcd5ca938b169486a63c6"}}, -{"id":"oauth-server","key":"oauth-server","value":{"rev":"7-ea931e31eaffaa843be61ffc89f29da7"}}, -{"id":"oauth2","key":"oauth2","value":{"rev":"3-4fce73fdc95580f397afeaf1bbd596bb"}}, -{"id":"oauth2-client","key":"oauth2-client","value":{"rev":"7-b5bd019159112384abc2087b2f8cb4f7"}}, -{"id":"oauth2-provider","key":"oauth2-provider","value":{"rev":"3-acd8f23b8c1c47b19838424b64618c70"}}, -{"id":"oauth2-server","key":"oauth2-server","value":{"rev":"11-316baa7e754053d0153086d0748b07c5"}}, -{"id":"obj_diff","key":"obj_diff","value":{"rev":"3-9289e14caaec4bb6aa64aa1be547db3b"}}, -{"id":"object-additions","key":"object-additions","value":{"rev":"3-11f03ae5afe00ad2be034fb313ce71a9"}}, -{"id":"object-proxy","key":"object-proxy","value":{"rev":"3-4d531308fc97bac6f6f9acd1e8f5b53a"}}, -{"id":"object-sync","key":"object-sync","value":{"rev":"5-6628fff49d65c96edc9d7a2e13db8d6d"}}, -{"id":"observer","key":"observer","value":{"rev":"3-a48052671a59b1c7874b4462e375664d"}}, -{"id":"octo.io","key":"octo.io","value":{"rev":"7-5692104396299695416ecb8548e53541"}}, -{"id":"octopus","key":"octopus","value":{"rev":"3-0a286abf59ba7232210e24a371902e7b"}}, -{"id":"odbc","key":"odbc","value":{"rev":"3-8550f0b183b229e41f3cb947bad9b059"}}, -{"id":"odot","key":"odot","value":{"rev":"13-3954b69c1a560a71fe58ab0c5c1072ba"}}, -{"id":"offliner","key":"offliner","value":{"rev":"3-9b58041cbd7b0365e04fec61c192c9b2"}}, -{"id":"ofxer","key":"ofxer","value":{"rev":"11-f8a79e1f27c92368ca1198ad37fbe83e"}}, -{"id":"ogre","key":"ogre","value":{"rev":"35-ea9c78c1d5b1761f059bb97ea568b23d"}}, -{"id":"oi.tekcos","key":"oi.tekcos","value":{"rev":"5-fdca9adb54acea3f91567082b107dde9"}}, -{"id":"oktest","key":"oktest","value":{"rev":"3-3b40312743a3eb1d8541ceee3ecfeace"}}, -{"id":"omcc","key":"omcc","value":{"rev":"3-19718e77bf82945c3ca7a3cdfb91188c"}}, -{"id":"omegle","key":"omegle","value":{"rev":"3-507ba8a51afbe2ff078e3e96712b7286"}}, -{"id":"ometa","key":"ometa","value":{"rev":"10-457fa17de89e1012ce812af3a53f4035"}}, -{"id":"ometa-highlighter","key":"ometa-highlighter","value":{"rev":"21-d18470d6d9a93bc7383c7d8ace22ad1d"}}, -{"id":"ometajs","key":"ometajs","value":{"rev":"20-c7e8c32926f2523e40e4a7ba2297192c"}}, -{"id":"onion","key":"onion","value":{"rev":"3-b46c000c8ff0b06f5f0028d268bc5c94"}}, -{"id":"onvalid","key":"onvalid","value":{"rev":"3-090bc1cf1418545b84db0fceb0846293"}}, -{"id":"oo","key":"oo","value":{"rev":"7-2297a18cdbcf29ad4867a2159912c04e"}}, -{"id":"oop","key":"oop","value":{"rev":"7-45fab8bae343e805d0c1863149dc20df"}}, -{"id":"op","key":"op","value":{"rev":"13-4efb059757caaecc18d5110b44266b35"}}, -{"id":"open-uri","key":"open-uri","value":{"rev":"21-023a00f26ecd89e278136fbb417ae9c3"}}, -{"id":"open.core","key":"open.core","value":{"rev":"35-f578db4e41dd4ae9128e3be574cf7b14"}}, -{"id":"open311","key":"open311","value":{"rev":"13-bb023a45d3c3988022d2fef809de8d98"}}, -{"id":"openid","key":"openid","value":{"rev":"29-b3c8a0e76d99ddb80c98d2aad5586771"}}, -{"id":"openlayers","key":"openlayers","value":{"rev":"3-602c34468c9be326e95be327b58d599b"}}, -{"id":"opentok","key":"opentok","value":{"rev":"5-5f4749f1763d45141d0272c1dbe6249a"}}, -{"id":"opentsdb-dashboard","key":"opentsdb-dashboard","value":{"rev":"3-2e0c5ccf3c9cfce17c20370c93283707"}}, -{"id":"opower-jobs","key":"opower-jobs","value":{"rev":"16-1602139f92e58d88178f21f1b3e0939f"}}, -{"id":"optimist","key":"optimist","value":{"rev":"64-ca3e5085acf135169d79949c25d84690"}}, -{"id":"optparse","key":"optparse","value":{"rev":"6-0200c34395f982ae3b80f4d18cb14483"}}, -{"id":"opts","key":"opts","value":{"rev":"8-ce2a0e31de55a1e02d5bbff66c4e8794"}}, -{"id":"orchestra","key":"orchestra","value":{"rev":"9-52ca98cddb51a2a43ec02338192c44fc"}}, -{"id":"orchid","key":"orchid","value":{"rev":"49-af9635443671ed769e4efa691b8ca84a"}}, -{"id":"orderly","key":"orderly","value":{"rev":"3-9ccc42d45b64278c9ffb1e64fc4f0d62"}}, -{"id":"orgsync.live","key":"orgsync.live","value":{"rev":"3-4dffc8ac43931364f59b9cb534acbaef"}}, -{"id":"orm","key":"orm","value":{"rev":"21-f3e7d89239364559d306110580bbb08f"}}, -{"id":"ormnomnom","key":"ormnomnom","value":{"rev":"15-0aacfbb5b7b580d76e9ecf5214a1d5ed"}}, -{"id":"orona","key":"orona","value":{"rev":"8-62d4ba1bf49098a140a2b85f80ebb103"}}, -{"id":"osc4node","key":"osc4node","value":{"rev":"3-0910613e78065f78b61142b35986e8b3"}}, -{"id":"oscar","key":"oscar","value":{"rev":"3-f5d2d39a67c67441bc2135cdaf2b47f8"}}, -{"id":"osrandom","key":"osrandom","value":{"rev":"3-026016691a5ad068543503e5e7ce6a84"}}, -{"id":"ossp-uuid","key":"ossp-uuid","value":{"rev":"10-8b7e1fba847d7cc9aa4f4c8813ebe6aa"}}, -{"id":"ostatus","key":"ostatus","value":{"rev":"3-76e0ec8c61c6df15c964197b722e24e7"}}, -{"id":"ostrich","key":"ostrich","value":{"rev":"3-637e0821e5ccfd0f6b1261b22c168c8d"}}, -{"id":"otk","key":"otk","value":{"rev":"5-2dc24e159cc618f43e573561286c4dcd"}}, -{"id":"ourl","key":"ourl","value":{"rev":"5-a3945e59e33faac96c75b508ef7fa1fb"}}, -{"id":"oursql","key":"oursql","value":{"rev":"21-bc53ab462155fa0aedbe605255fb9988"}}, -{"id":"out","key":"out","value":{"rev":"5-eb261f940b6382e2689210a58bc1b440"}}, -{"id":"overload","key":"overload","value":{"rev":"10-b88919e5654bef4922029afad4f1d519"}}, -{"id":"ox","key":"ox","value":{"rev":"3-0ca445370b4f76a93f2181ad113956d9"}}, -{"id":"pachube","key":"pachube","value":{"rev":"10-386ac6be925bab307b5d545516fb18ef"}}, -{"id":"pachube-stream","key":"pachube-stream","value":{"rev":"13-176dadcc5c516420fb3feb1f964739e0"}}, -{"id":"pack","key":"pack","value":{"rev":"29-8f8c511d95d1fb322c1a6d7965ef8f29"}}, -{"id":"packagebohrer","key":"packagebohrer","value":{"rev":"3-507358253a945a74c49cc169ad0bf5a2"}}, -{"id":"packer","key":"packer","value":{"rev":"9-23410d893d47418731e236cfcfcfbf03"}}, -{"id":"packet","key":"packet","value":{"rev":"8-1b366f97d599c455dcbbe4339da7cf9e"}}, -{"id":"pacote-sam-egenial","key":"pacote-sam-egenial","value":{"rev":"3-b967db1b9fceb9a937f3520efd89f479"}}, -{"id":"pacoteegenial","key":"pacoteegenial","value":{"rev":"3-9cfe8518b885bfd9a44ed38814f7d623"}}, -{"id":"pact","key":"pact","value":{"rev":"7-82996c1a0c8e9a5e9df959d4ad37085e"}}, -{"id":"pad","key":"pad","value":{"rev":"3-eef6147f09b662cff95c946f2b065da5"}}, -{"id":"paddle","key":"paddle","value":{"rev":"3-fedd0156b9a0dadb5e9b0f1cfab508fd"}}, -{"id":"padlock","key":"padlock","value":{"rev":"9-3a9e378fbe8e3817da7999f675af227e"}}, -{"id":"pagen","key":"pagen","value":{"rev":"9-9aac56724039c38dcdf7f6d5cbb4911c"}}, -{"id":"paginate-js","key":"paginate-js","value":{"rev":"5-995269155152db396662c59b67e9e93d"}}, -{"id":"pairtree","key":"pairtree","value":{"rev":"3-0361529e6c91271e2a61f3d7fd44366e"}}, -{"id":"palsu-app","key":"palsu-app","value":{"rev":"3-73f1fd9ae35e3769efc9c1aa25ec6da7"}}, -{"id":"pam","key":"pam","value":{"rev":"3-77b5bd15962e1c8be1980b33fd3b9737"}}, -{"id":"panache","key":"panache","value":{"rev":"25-749d2034f7f9179c2266cf896bb4abb0"}}, -{"id":"panic","key":"panic","value":{"rev":"7-068b22be54ca8ae7b03eb153c2ea849a"}}, -{"id":"pantry","key":"pantry","value":{"rev":"33-3896f0fc165092f6cabb2949be3952c4"}}, -{"id":"paper-keys","key":"paper-keys","value":{"rev":"3-729378943040ae01d59f07bb536309b7"}}, -{"id":"paperboy","key":"paperboy","value":{"rev":"8-db2d51c2793b4ffc82a1ae928c813aae"}}, -{"id":"paperserve","key":"paperserve","value":{"rev":"6-8509fb68217199a3eb74f223b1e2bee5"}}, -{"id":"parall","key":"parall","value":{"rev":"5-279d7105a425e136f6101250e8f81a14"}}, -{"id":"parallel","key":"parallel","value":{"rev":"14-f1294b3b840cfb26095107110b6720ec"}}, -{"id":"paramon","key":"paramon","value":{"rev":"3-37e599e924beb509c894c992cf72791b"}}, -{"id":"parannus","key":"parannus","value":{"rev":"7-7541f1ed13553261330b9e1c4706f112"}}, -{"id":"parasite","key":"parasite","value":{"rev":"13-83c26181bb92cddb8ff76bc154a50210"}}, -{"id":"parrot","key":"parrot","value":{"rev":"3-527d1cb4b5be0e252dc92a087d380f17"}}, -{"id":"parseUri","key":"parseUri","value":{"rev":"3-3b60b1fd6d8109279b5d0cfbdb89b343"}}, -{"id":"parseopt","key":"parseopt","value":{"rev":"10-065f1acaf02c94f0684f75fefc2fd1ec"}}, -{"id":"parser","key":"parser","value":{"rev":"5-f661f0b7ede9b6d3e0de259ed20759b1"}}, -{"id":"parser_email","key":"parser_email","value":{"rev":"12-63333860c62f2a9c9d6b0b7549bf1cdc"}}, -{"id":"parstream","key":"parstream","value":{"rev":"3-ef7e8ffc8ce1e7d951e37f85bfd445ab"}}, -{"id":"parted","key":"parted","value":{"rev":"9-250e4524994036bc92915b6760d62d8a"}}, -{"id":"partial","key":"partial","value":{"rev":"7-208411e6191275a4193755ee86834716"}}, -{"id":"party","key":"party","value":{"rev":"5-9337d8dc5e163f0300394f533ab1ecdf"}}, -{"id":"pashua","key":"pashua","value":{"rev":"3-b752778010f4e20f662a3d8f0f57b18b"}}, -{"id":"pass","key":"pass","value":{"rev":"3-66a2d55d93eae8535451f12965578db8"}}, -{"id":"passthru","key":"passthru","value":{"rev":"9-3c8f0b20f1a16976f3645a6f7411b56a"}}, -{"id":"passwd","key":"passwd","value":{"rev":"19-44ac384382a042faaa1f3b111786c831"}}, -{"id":"password","key":"password","value":{"rev":"9-0793f6a8d09076f25cde7c9e528eddec"}}, -{"id":"password-hash","key":"password-hash","value":{"rev":"9-590c62e275ad577c6f8ddbf5ba4579cc"}}, -{"id":"path","key":"path","value":{"rev":"3-3ec064cf3f3a85cb59528654c5bd938f"}}, -{"id":"pathjs","key":"pathjs","value":{"rev":"5-d5e1b1a63e711cae3ac79a3b1033b609"}}, -{"id":"pathname","key":"pathname","value":{"rev":"9-16f2c1473454900ce18a217b2ea52c57"}}, -{"id":"paths","key":"paths","value":{"rev":"3-fa47b7c1d533a7d9f4bbaffc5fb89905"}}, -{"id":"patr","key":"patr","value":{"rev":"7-7bcd37586389178b9f23d33c1d7a0292"}}, -{"id":"pattern","key":"pattern","value":{"rev":"36-3ded826185c384af535dcd428af3f626"}}, -{"id":"payment-paypal-payflowpro","key":"payment-paypal-payflowpro","value":{"rev":"14-d8814a1d8bba57a6ecf8027064adc7ad"}}, -{"id":"paynode","key":"paynode","value":{"rev":"16-16084e61db66ac18fdbf95a51d31c09a"}}, -{"id":"payos","key":"payos","value":{"rev":"3-373695bd80c454b32b83a5eba6044261"}}, -{"id":"paypal-ipn","key":"paypal-ipn","value":{"rev":"5-ef32291f9f8371b20509db3acee722f6"}}, -{"id":"pcap","key":"pcap","value":{"rev":"46-8ae9e919221102581d6bb848dc67b84b"}}, -{"id":"pd","key":"pd","value":{"rev":"7-82146739c4c0eb4e49e40aa80a29cc0a"}}, -{"id":"pdf","key":"pdf","value":{"rev":"6-5c6b6a133e1b3ce894ebb1a49090216c"}}, -{"id":"pdfcrowd","key":"pdfcrowd","value":{"rev":"5-026b4611b50374487bfd64fd3e0d562c"}}, -{"id":"pdfkit","key":"pdfkit","value":{"rev":"13-2fd34c03225a87dfd8057c85a83f3c50"}}, -{"id":"pdflatex","key":"pdflatex","value":{"rev":"3-bbbf61f09ebe4c49ca0aff8019611660"}}, -{"id":"pdl","key":"pdl","value":{"rev":"3-4c41bf12e901ee15bdca468db8c89102"}}, -{"id":"peanut","key":"peanut","value":{"rev":"55-b797121dbbcba1219934284ef56abb8a"}}, -{"id":"pebble","key":"pebble","value":{"rev":"21-3cd08362123260a2e96d96d80e723805"}}, -{"id":"pecode","key":"pecode","value":{"rev":"3-611f5e8c61bbf4467b84da954ebdd521"}}, -{"id":"pegjs","key":"pegjs","value":{"rev":"11-091040d16433014d1da895e32ac0f6a9"}}, -{"id":"per-second","key":"per-second","value":{"rev":"5-e1593b3f7008ab5e1c3cae86f39ba3f3"}}, -{"id":"permafrost","key":"permafrost","value":{"rev":"9-494cbc9a2f43a60b57f23c5f5b12270d"}}, -{"id":"perry","key":"perry","value":{"rev":"41-15aed7a778fc729ad62fdfb231c50774"}}, -{"id":"persistencejs","key":"persistencejs","value":{"rev":"20-2585af3f15f0a4a7395e937237124596"}}, -{"id":"pg","key":"pg","value":{"rev":"142-48de452fb8a84022ed7cae8ec2ebdaf6"}}, -{"id":"phonetap","key":"phonetap","value":{"rev":"7-2cc7d3c2a09518ad9b0fe816c6a99125"}}, -{"id":"php-autotest","key":"php-autotest","value":{"rev":"3-04470b38b259187729af574dd3dc1f97"}}, -{"id":"phpass","key":"phpass","value":{"rev":"3-66f4bec659bf45b312022bb047b18696"}}, -{"id":"piano","key":"piano","value":{"rev":"3-0bab6b5409e4305c87a775e96a2b7ad3"}}, -{"id":"picard","key":"picard","value":{"rev":"5-7676e6ad6d5154fdc016b001465891f3"}}, -{"id":"picardForTynt","key":"picardForTynt","value":{"rev":"3-09d205b790bd5022b69ec4ad54bad770"}}, -{"id":"pid","key":"pid","value":{"rev":"3-0ba7439d599b9d613461794c3892d479"}}, -{"id":"pieshop","key":"pieshop","value":{"rev":"12-7851afe1bbc20de5d054fe93b071f849"}}, -{"id":"pig","key":"pig","value":{"rev":"3-8e6968a7b64635fed1bad12c39d7a46a"}}, -{"id":"pigeons","key":"pigeons","value":{"rev":"53-8df70420d3c845cf0159b3f25d0aab90"}}, -{"id":"piles","key":"piles","value":{"rev":"3-140cb1e83b5a939ecd429b09886132ef"}}, -{"id":"pillar","key":"pillar","value":{"rev":"6-83c81550187f6d00e11dd9955c1c94b7"}}, -{"id":"pilot","key":"pilot","value":{"rev":"3-073ed1a083cbd4c2aa2561f19e5935ea"}}, -{"id":"pinboard","key":"pinboard","value":{"rev":"3-1020cab02a1183acdf82e1f7620dc1e0"}}, -{"id":"pinf-loader-js","key":"pinf-loader-js","value":{"rev":"5-709ba9c86fb4de906bd7bbca53771f0f"}}, -{"id":"pinf-loader-js-demos-npmpackage","key":"pinf-loader-js-demos-npmpackage","value":{"rev":"3-860569d98c83e59185cff356e56b10a6"}}, -{"id":"pingback","key":"pingback","value":{"rev":"5-5d0a05d65a14f6837b0deae16c550bec"}}, -{"id":"pingdom","key":"pingdom","value":{"rev":"11-f299d6e99122a9fa1497bfd166dadd02"}}, -{"id":"pintpay","key":"pintpay","value":{"rev":"3-eba9c4059283adec6b1ab017284c1f17"}}, -{"id":"pipe","key":"pipe","value":{"rev":"5-d202bf317c10a52ac817b5c1a4ce4c88"}}, -{"id":"pipe_utils","key":"pipe_utils","value":{"rev":"13-521857c99eb76bba849a22240308e584"}}, -{"id":"pipegram","key":"pipegram","value":{"rev":"3-1449333c81dd658d5de9eebf36c07709"}}, -{"id":"pipeline-surveyor","key":"pipeline-surveyor","value":{"rev":"11-464db89b17e7b44800088ec4a263d92e"}}, -{"id":"pipes","key":"pipes","value":{"rev":"99-8320636ff840a61d82d9c257a2e0ed48"}}, -{"id":"pipes-cellar","key":"pipes-cellar","value":{"rev":"27-e035e58a3d82e50842d766bb97ea3ed9"}}, -{"id":"pipes-cohort","key":"pipes-cohort","value":{"rev":"9-88fc0971e01516873396e44974874903"}}, -{"id":"piton-entity","key":"piton-entity","value":{"rev":"31-86254212066019f09d67dfd58524bd75"}}, -{"id":"piton-http-utils","key":"piton-http-utils","value":{"rev":"3-6cf6aa0c655ff6118d53e62e3b970745"}}, -{"id":"piton-mixin","key":"piton-mixin","value":{"rev":"3-7b7737004e53e04f7f95ba5850eb5e70"}}, -{"id":"piton-pipe","key":"piton-pipe","value":{"rev":"3-8d7df4e53f620ef2f24e9fc8b24f0238"}}, -{"id":"piton-simplate","key":"piton-simplate","value":{"rev":"3-9ac00835d3de59d535cdd2347011cdc9"}}, -{"id":"piton-string-utils","key":"piton-string-utils","value":{"rev":"3-ecab73993d764dfb378161ea730dbbd5"}}, -{"id":"piton-validity","key":"piton-validity","value":{"rev":"13-1766651d69e3e075bf2c66b174b66026"}}, -{"id":"pixel-ping","key":"pixel-ping","value":{"rev":"11-38d717c927e13306e8ff9032785b50f2"}}, -{"id":"pixelcloud","key":"pixelcloud","value":{"rev":"7-0897d734157b52dece8f86cde7be19d4"}}, -{"id":"pixiedust","key":"pixiedust","value":{"rev":"3-6b932dee4b6feeed2f797de5d0066f8a"}}, -{"id":"pkginfo","key":"pkginfo","value":{"rev":"13-3ee42503d6672812960a965d4f3a1bc2"}}, -{"id":"pksqlite","key":"pksqlite","value":{"rev":"13-095e7d7d0258b71491c39d0e8c4f19be"}}, -{"id":"plants.js","key":"plants.js","value":{"rev":"3-e3ef3a16f637787e84c100a9b9ec3b08"}}, -{"id":"plate","key":"plate","value":{"rev":"20-92ba0729b2edc931f28870fe7f2ca95a"}}, -{"id":"platform","key":"platform","value":{"rev":"4-be465a1d21be066c96e30a42b8602177"}}, -{"id":"platformjs","key":"platformjs","value":{"rev":"35-5c510fa0c90492fd1d0f0fc078460018"}}, -{"id":"platoon","key":"platoon","value":{"rev":"28-e0e0c5f852eadacac5a652860167aa11"}}, -{"id":"play","key":"play","value":{"rev":"5-17f7cf7cf5d1c21c7392f3c43473098d"}}, -{"id":"plist","key":"plist","value":{"rev":"10-2a23864923aeed93fb8e25c4b5b2e97e"}}, -{"id":"png","key":"png","value":{"rev":"14-9cc7aeaf0c036c9a880bcee5cd46229a"}}, -{"id":"png-guts","key":"png-guts","value":{"rev":"5-a29c7c686f9d08990ce29632bf59ef90"}}, -{"id":"policyfile","key":"policyfile","value":{"rev":"21-4a9229cca4bcac10f730f296f7118548"}}, -{"id":"polla","key":"polla","value":{"rev":"27-9af5a575961a4dddb6bef482c168c756"}}, -{"id":"poly","key":"poly","value":{"rev":"3-7f7fe29d9f0ec4fcbf8481c797b20455"}}, -{"id":"polyglot","key":"polyglot","value":{"rev":"3-9306e246d1f8b954b41bef76e3e81291"}}, -{"id":"pool","key":"pool","value":{"rev":"10-f364b59aa8a9076a17cd94251dd013ab"}}, -{"id":"poolr","key":"poolr","value":{"rev":"5-cacfbeaa7aaca40c1a41218e8ac8b732"}}, -{"id":"pop","key":"pop","value":{"rev":"41-8edd9ef2f34a90bf0ec5e8eb0e51e644"}}, -{"id":"pop-disqus","key":"pop-disqus","value":{"rev":"3-4a8272e6a8453ed2d754397dc8b349bb"}}, -{"id":"pop-ga","key":"pop-ga","value":{"rev":"3-5beaf7b355d46b3872043b97696ee693"}}, -{"id":"pop-gallery","key":"pop-gallery","value":{"rev":"3-1a88920ff930b8ce51cd50fcfe62675e"}}, -{"id":"pop3-client","key":"pop3-client","value":{"rev":"3-be8c314b0479d9d98384e2ff36d7f207"}}, -{"id":"poplib","key":"poplib","value":{"rev":"7-ab64c5c35269aee897b0904b4548096b"}}, -{"id":"porter-stemmer","key":"porter-stemmer","value":{"rev":"5-724a7b1d635b95a14c9ecd9d2f32487d"}}, -{"id":"portfinder","key":"portfinder","value":{"rev":"5-cdf36d1c666bbdae500817fa39b9c2bd"}}, -{"id":"portscanner","key":"portscanner","value":{"rev":"3-773c1923b6f3b914bd801476efcfdf64"}}, -{"id":"pos","key":"pos","value":{"rev":"3-1c1a27020560341ecd1b54d0e3cfaf2a"}}, -{"id":"posix-getopt","key":"posix-getopt","value":{"rev":"3-819b69724575b65fe25cf1c768e1b1c6"}}, -{"id":"postageapp","key":"postageapp","value":{"rev":"9-f5735237f7e6f0b467770e28e84c56db"}}, -{"id":"postal","key":"postal","value":{"rev":"19-dd70aeab4ae98ccf3d9f203dff9ccf37"}}, -{"id":"posterous","key":"posterous","value":{"rev":"3-6f8a9e7cae8a26f021653f2c27b0c67f"}}, -{"id":"postgres","key":"postgres","value":{"rev":"6-e8844a47c83ff3ef0a1ee7038b2046b2"}}, -{"id":"postgres-js","key":"postgres-js","value":{"rev":"3-bbe27a49ee9f8ae8789660e178d6459d"}}, -{"id":"postman","key":"postman","value":{"rev":"5-548538583f2e7ad448adae27f9a801e5"}}, -{"id":"postmark","key":"postmark","value":{"rev":"24-a6c61b346329e499d4a4a37dbfa446a2"}}, -{"id":"postmark-api","key":"postmark-api","value":{"rev":"3-79973af301aa820fc18c2c9d418adcd7"}}, -{"id":"postmessage","key":"postmessage","value":{"rev":"5-854bdb27c2a1af5b629b01f7d69691fe"}}, -{"id":"postpie","key":"postpie","value":{"rev":"10-88527e2731cd07a3b8ddec2608682700"}}, -{"id":"postprocess","key":"postprocess","value":{"rev":"5-513ecd54bf8df0ae73d2a50c717fd939"}}, -{"id":"potato","key":"potato","value":{"rev":"3-0f4cab343859692bf619e79cd9cc5be1"}}, -{"id":"pour","key":"pour","value":{"rev":"7-272bee63c5f19d12102198a23a4af902"}}, -{"id":"pow","key":"pow","value":{"rev":"22-58b557cd71ec0e95eef51dfd900e4736"}}, -{"id":"precious","key":"precious","value":{"rev":"19-b370292b258bcbca02c5d8861ebee0bb"}}, -{"id":"predicate","key":"predicate","value":{"rev":"3-1c6d1871fe71bc61457483793eecf7f9"}}, -{"id":"prefer","key":"prefer","value":{"rev":"11-236b9d16cd019e1d9af41e745bfed754"}}, -{"id":"prenup","key":"prenup","value":{"rev":"3-4c56ddf1ee22cd90c85963209736bc75"}}, -{"id":"pretty-json","key":"pretty-json","value":{"rev":"5-2dbb22fc9573c19e64725ac331a8d59c"}}, -{"id":"prettyfy","key":"prettyfy","value":{"rev":"3-fc7e39aad63a42533d4ac6d6bfa32325"}}, -{"id":"prick","key":"prick","value":{"rev":"10-71a02e1be02df2af0e6a958099be565a"}}, -{"id":"printf","key":"printf","value":{"rev":"5-2896b8bf90df19d4a432153211ca3a7e"}}, -{"id":"pro","key":"pro","value":{"rev":"5-e98adaf2f741e00953bbb942bbeb14d2"}}, -{"id":"probe_couchdb","key":"probe_couchdb","value":{"rev":"28-86f8918a3e64608f8009280fb28a983d"}}, -{"id":"process","key":"process","value":{"rev":"3-6865fc075d8083afd8e2aa266512447c"}}, -{"id":"procfile","key":"procfile","value":{"rev":"3-22dbb2289f5fb3060a8f7833b50116a4"}}, -{"id":"profile","key":"profile","value":{"rev":"29-5afee07fe4c334d9836fda1df51e1f2d"}}, -{"id":"profilejs","key":"profilejs","value":{"rev":"9-128c2b0e09624ee69a915cff20cdf359"}}, -{"id":"profiler","key":"profiler","value":{"rev":"13-4f1582fad93cac11daad5d5a67565e4f"}}, -{"id":"progress","key":"progress","value":{"rev":"7-bba60bc39153fa0fbf5e909b6df213b0"}}, -{"id":"progress-bar","key":"progress-bar","value":{"rev":"5-616721d3856b8e5a374f247404d6ab29"}}, -{"id":"progressify","key":"progressify","value":{"rev":"5-0379cbed5adc2c3f3ac6adf0307ec11d"}}, -{"id":"proj4js","key":"proj4js","value":{"rev":"5-7d209ce230f6a2d5931800acef436a06"}}, -{"id":"projectwatch","key":"projectwatch","value":{"rev":"15-d0eca46ffc3d9e18a51db2d772fa2778"}}, -{"id":"promise","key":"promise","value":{"rev":"3-1409350eb10aa9055ed13a5b59f0abc3"}}, -{"id":"promised-fs","key":"promised-fs","value":{"rev":"28-1d3e0dd1884e1c39a5d5e2d35bb1f911"}}, -{"id":"promised-http","key":"promised-http","value":{"rev":"8-3f8d560c800ddd44a617bf7d7c688392"}}, -{"id":"promised-io","key":"promised-io","value":{"rev":"11-e9a280e85c021cd8b77e524aac50fafb"}}, -{"id":"promised-traits","key":"promised-traits","value":{"rev":"14-62d0ac59d4ac1c6db99c0273020565ea"}}, -{"id":"promised-utils","key":"promised-utils","value":{"rev":"20-0c2488685eb8999c40ee5e7cfa4fd75d"}}, -{"id":"prompt","key":"prompt","value":{"rev":"32-d52a524c147e34c1258facab69660cc2"}}, -{"id":"props","key":"props","value":{"rev":"17-8c4c0bf1b69087510612c8d5ccbfbfeb"}}, -{"id":"proserver","key":"proserver","value":{"rev":"3-4b0a001404171eb0f6f3e5d73a35fcb1"}}, -{"id":"protege","key":"protege","value":{"rev":"150-9790c23d7b7eb5fb94cd5b8048bdbf10"}}, -{"id":"proto","key":"proto","value":{"rev":"6-29fe2869f34e2737b0cc2a0dbba8e397"}}, -{"id":"proto-list","key":"proto-list","value":{"rev":"3-0f64ff29a4a410d5e03a57125374b87b"}}, -{"id":"protobuf-stream","key":"protobuf-stream","value":{"rev":"3-950e621ce7eef306eff5f932a9c4cbae"}}, -{"id":"protodiv","key":"protodiv","value":{"rev":"9-ed8d84033943934eadf5d95dfd4d8eca"}}, -{"id":"proton","key":"proton","value":{"rev":"19-8ad32d57a3e71df786ff41ef8c7281f2"}}, -{"id":"protoparse","key":"protoparse","value":{"rev":"3-9fbcc3b26220f974d4b9c9c883a0260b"}}, -{"id":"prototype","key":"prototype","value":{"rev":"5-2a672703595e65f5d731a967b43655a7"}}, -{"id":"prowl","key":"prowl","value":{"rev":"5-ec480caa5a7db4f1ec2ce22d5eb1dad8"}}, -{"id":"prowler","key":"prowler","value":{"rev":"3-09747704f78c7c123fb1c719c4996924"}}, -{"id":"prox","key":"prox","value":{"rev":"5-0ac5f893b270a819d91f0c6581aca2a8"}}, -{"id":"proxify","key":"proxify","value":{"rev":"3-d24a979b708645328476bd42bd5aaba8"}}, -{"id":"proxino","key":"proxino","value":{"rev":"7-894cc6d453af00e5e39ebc8f0b0abe3a"}}, -{"id":"proxio","key":"proxio","value":{"rev":"55-a1b2744054b3dc3adc2f7f67d2c026a4"}}, -{"id":"proxy","key":"proxy","value":{"rev":"3-c6dd1a8b58e0ed7ac983c89c05ee987d"}}, -{"id":"proxy-by-url","key":"proxy-by-url","value":{"rev":"5-acfcf47f3575cea6594513ff459c5f2c"}}, -{"id":"pseudo","key":"pseudo","value":{"rev":"11-4d894a335036d96cdb9bb19f7b857293"}}, -{"id":"psk","key":"psk","value":{"rev":"17-375055bf6315476a37b5fadcdcb6b149"}}, -{"id":"pty","key":"pty","value":{"rev":"8-0b3ea0287fd23f882da27dabce4e3230"}}, -{"id":"pub-mix","key":"pub-mix","value":{"rev":"3-2c455b249167cbf6b1a6ea761bf119f4"}}, -{"id":"pubjs","key":"pubjs","value":{"rev":"3-a0ceab8bc6ec019dfcf9a8e16756bea0"}}, -{"id":"publicsuffix","key":"publicsuffix","value":{"rev":"8-1592f0714595c0ca0433272c60afc733"}}, -{"id":"publisher","key":"publisher","value":{"rev":"13-f2c8722f14732245d3ca8842fe5b7661"}}, -{"id":"pubnub-client","key":"pubnub-client","value":{"rev":"8-6e511a6dd2b7feb6cefe410facd61f53"}}, -{"id":"pubsub","key":"pubsub","value":{"rev":"11-6c6270bf95af417fb766c05f66b2cc9e"}}, -{"id":"pubsub.io","key":"pubsub.io","value":{"rev":"24-9686fe9ae3356966dffee99f53eaad2c"}}, -{"id":"pubsubd","key":"pubsubd","value":{"rev":"3-b1ff2fa958bd450933735162e9615449"}}, -{"id":"pulley","key":"pulley","value":{"rev":"13-f81ed698175ffd0b5b19357a623b8f15"}}, -{"id":"pulse","key":"pulse","value":{"rev":"9-da4bdabb6d7c189d05c8d6c64713e4ac"}}, -{"id":"pulverizr","key":"pulverizr","value":{"rev":"16-ffd4db4d2b1bfbd0b6ac794dca9e728e"}}, -{"id":"pulverizr-bal","key":"pulverizr-bal","value":{"rev":"5-dba279d07f3ed72990d10f11c5d10792"}}, -{"id":"punycode","key":"punycode","value":{"rev":"3-c0df35bb32d1490a4816161974610682"}}, -{"id":"puppy","key":"puppy","value":{"rev":"3-355fb490dba55efdf8840e2769cb7f41"}}, -{"id":"pure","key":"pure","value":{"rev":"7-b2da0d64ea12cea63bed940222bb36df"}}, -{"id":"purpose","key":"purpose","value":{"rev":"3-ef30ac479535bd603954c27ecb5d564a"}}, -{"id":"push-it","key":"push-it","value":{"rev":"35-2640be8ca8938768836520ce5fc7fff2"}}, -{"id":"pusher","key":"pusher","value":{"rev":"5-eb363d1e0ea2c59fd92a07ea642c5d03"}}, -{"id":"pusher-pipe","key":"pusher-pipe","value":{"rev":"11-11ab87d1288a8c7d11545fdab56616f6"}}, -{"id":"pushinator","key":"pushinator","value":{"rev":"15-6b2c37931bc9438e029a6af0cf97091c"}}, -{"id":"put","key":"put","value":{"rev":"12-4b05a7cdfdb24a980597b38781457cf5"}}, -{"id":"put-selector","key":"put-selector","value":{"rev":"1-1a9b3b8b5a44485b93966503370978aa"}}, -{"id":"putio","key":"putio","value":{"rev":"3-973b65e855e1cd0d3cc685542263cc55"}}, -{"id":"pwilang","key":"pwilang","value":{"rev":"43-49ad04f5abbdd9c5b16ec0271ab17520"}}, -{"id":"py","key":"py","value":{"rev":"3-aade832559d0fab88116aa794e3a9f35"}}, -{"id":"pygments","key":"pygments","value":{"rev":"3-2b2c96f39bdcb9ff38eb7d4bac7c90ba"}}, -{"id":"python","key":"python","value":{"rev":"15-706af811b5544a4aacc6ad1e9863e369"}}, -{"id":"q","key":"q","value":{"rev":"80-fd2397ad465750240d0f22a0abc53de5"}}, -{"id":"q-comm","key":"q-comm","value":{"rev":"17-972994947f097fdcffcfcb2277c966ce"}}, -{"id":"q-fs","key":"q-fs","value":{"rev":"68-958b01dd5bdc4da5ba3c1cd02c85fc0e"}}, -{"id":"q-http","key":"q-http","value":{"rev":"26-42a7db91b650386d920f52afe3e9161f"}}, -{"id":"q-io","key":"q-io","value":{"rev":"20-79f7b3d43bcbd53cc57b6531426738e2"}}, -{"id":"q-io-buffer","key":"q-io-buffer","value":{"rev":"5-05528d9a527da73357991bec449a1b76"}}, -{"id":"q-require","key":"q-require","value":{"rev":"12-e3fc0388e4d3e6d8a15274c3cc239712"}}, -{"id":"q-util","key":"q-util","value":{"rev":"10-94e0c392e70fec942aee0f024e5c090f"}}, -{"id":"qbox","key":"qbox","value":{"rev":"17-88f9148881ede94ae9dcbf4e1980aa69"}}, -{"id":"qfi","key":"qfi","value":{"rev":"3-a6052f02aec10f17085b09e4f9da1ce0"}}, -{"id":"qjscl","key":"qjscl","value":{"rev":"11-def1631b117a53cab5fd38ffec28d727"}}, -{"id":"qooxdoo","key":"qooxdoo","value":{"rev":"5-720d33ec2de3623d6535b3bdc8041d81"}}, -{"id":"qoper8","key":"qoper8","value":{"rev":"11-48fa2ec116bec46d64161e35b0f0cd86"}}, -{"id":"qq","key":"qq","value":{"rev":"23-6f7a5f158364bbf2e90a0c6eb1fbf8a9"}}, -{"id":"qqwry","key":"qqwry","value":{"rev":"10-bf0d6cc2420bdad92a1104c184e7e045"}}, -{"id":"qr","key":"qr","value":{"rev":"11-0a0120b7ec22bbcf76ff1d78fd4a7689"}}, -{"id":"qrcode","key":"qrcode","value":{"rev":"11-b578b6a76bffe996a0390e3d886b79bb"}}, -{"id":"qs","key":"qs","value":{"rev":"23-3da45c8c8a5eb33d45360d92b6072d37"}}, -{"id":"quack-array","key":"quack-array","value":{"rev":"5-6b676aa6273e4515ab5e7bfee1c331e0"}}, -{"id":"quadprog","key":"quadprog","value":{"rev":"7-c0ceeeb12735f334e8c7940ac1f0a896"}}, -{"id":"quadraticon","key":"quadraticon","value":{"rev":"66-1da88ea871e6f90967b9f65c0204309d"}}, -{"id":"quasi","key":"quasi","value":{"rev":"3-6fe0faa91d849938d8c92f91b0828395"}}, -{"id":"query","key":"query","value":{"rev":"13-635ff8d88c6a3f9d92f9ef465b14fb82"}}, -{"id":"query-engine","key":"query-engine","value":{"rev":"21-66feaee07df9fa1f625ac797e8f6b90b"}}, -{"id":"querystring","key":"querystring","value":{"rev":"5-2b509239fafba56319137bfbe1e9eeb7"}}, -{"id":"queue","key":"queue","value":{"rev":"3-5c4af574e5056f7e6ceb9bfefc1c632d"}}, -{"id":"queuelib","key":"queuelib","value":{"rev":"61-87c2abc94a5ad40af8193fac9a1d9f7e"}}, -{"id":"quickcheck","key":"quickcheck","value":{"rev":"7-64e6c1e9efc08a89abe3d01c414d1411"}}, -{"id":"quickserve","key":"quickserve","value":{"rev":"3-9c19f8ad7daf06182f42b8c7063b531f"}}, -{"id":"quip","key":"quip","value":{"rev":"8-0624055f5056f72bc719340c95e5111a"}}, -{"id":"qunit","key":"qunit","value":{"rev":"37-6e7fefdaffab8fc5fb92a391da227c38"}}, -{"id":"qunit-tap","key":"qunit-tap","value":{"rev":"22-0266cd1b5bb7cbab89fa52642f0e8277"}}, -{"id":"qwery","key":"qwery","value":{"rev":"66-29f9b44da544a3a9b4537a85ceace7c8"}}, -{"id":"qwery-mobile","key":"qwery-mobile","value":{"rev":"5-182264ca68c30519bf0d29cf1e15854b"}}, -{"id":"raZerdummy","key":"raZerdummy","value":{"rev":"7-1fa549e0cff60795b49cbd3732f32175"}}, -{"id":"rabbit.js","key":"rabbit.js","value":{"rev":"3-dbcd5cd590576673c65b34c44ff06bec"}}, -{"id":"rabblescay","key":"rabblescay","value":{"rev":"5-3fea196ffd581a842a24ab7bb2118fe2"}}, -{"id":"racer","key":"racer","value":{"rev":"51-41c65689a335d70fa6b55b9706b9c0fe"}}, -{"id":"radcouchdb","key":"radcouchdb","value":{"rev":"3-64ccb4d0acb2b11cbb1d3fcef5f9a68e"}}, -{"id":"radio-stream","key":"radio-stream","value":{"rev":"6-c5f80a0bef7bbaacdd22d92da3d09244"}}, -{"id":"railway","key":"railway","value":{"rev":"74-5ce92a45c7d11540b0e2b5a8455361ce"}}, -{"id":"railway-mailer","key":"railway-mailer","value":{"rev":"3-8df2fbe4af4d3b1f12557d8397bf0548"}}, -{"id":"railway-twitter","key":"railway-twitter","value":{"rev":"3-df984f182bb323052e36876e8e3a066c"}}, -{"id":"rand","key":"rand","value":{"rev":"11-abb69107c390e2a6dcec64cb72f36096"}}, -{"id":"random","key":"random","value":{"rev":"7-32550b221f3549b67f379c1c2dbc5c57"}}, -{"id":"random-data","key":"random-data","value":{"rev":"5-ae651ea36724105b8677ae489082ab4d"}}, -{"id":"range","key":"range","value":{"rev":"3-1d3925f30ffa6b5f3494d507fcef3aa1"}}, -{"id":"ranger","key":"ranger","value":{"rev":"17-6135a9a9d83cbd3945f1ce991f276cb8"}}, -{"id":"rap-battle","key":"rap-battle","value":{"rev":"3-6960516c0d27906bb9343805a5eb0e45"}}, -{"id":"raphael","key":"raphael","value":{"rev":"7-012f159593a82e4587ea024a5d4fbe41"}}, -{"id":"raphael-zoom","key":"raphael-zoom","value":{"rev":"3-aaab74bebbeb4241cade4f4d3c9b130e"}}, -{"id":"rapid","key":"rapid","value":{"rev":"8-ae0b05388c7904fc88c743e3dcde1d9d"}}, -{"id":"rasputin","key":"rasputin","value":{"rev":"3-87cdd9bd591606f4b8439e7a76681c7b"}}, -{"id":"rate-limiter","key":"rate-limiter","value":{"rev":"3-24cd20fef83ce02f17dd383b72f5f125"}}, -{"id":"rats","key":"rats","value":{"rev":"3-1ff1efb311451a17789da910eaf59fb6"}}, -{"id":"raydash","key":"raydash","value":{"rev":"7-96c345beb3564d2789d209d1fe695857"}}, -{"id":"rbytes","key":"rbytes","value":{"rev":"13-cf09d91347a646f590070e516f0c9bc9"}}, -{"id":"rdf","key":"rdf","value":{"rev":"3-9a5012d1fc10da762dbe285d0b317499"}}, -{"id":"rdf-raptor-parser","key":"rdf-raptor-parser","value":{"rev":"11-25c61e4d57cf67ee8a5afb6dfcf193e3"}}, -{"id":"rdfstore","key":"rdfstore","value":{"rev":"41-4499a73efc48ad07234e56fd4e27e4e0"}}, -{"id":"rdio","key":"rdio","value":{"rev":"5-fa20a8ab818a6150e38e9bb7744968f9"}}, -{"id":"rdx","key":"rdx","value":{"rev":"3-e1db5ee3aad06edd9eadcdaa8aaba149"}}, -{"id":"rea","key":"rea","value":{"rev":"3-f17ceeb35337bc9ccf9cb440d5c4dfaf"}}, -{"id":"read-files","key":"read-files","value":{"rev":"3-e08fac4abcdbc7312beb0362ff4427b4"}}, -{"id":"readability","key":"readability","value":{"rev":"3-475601a3d99d696763872c52bce6a155"}}, -{"id":"readabilitySAX","key":"readabilitySAX","value":{"rev":"19-83277777f3f721be26aca28c66227b01"}}, -{"id":"ready.js","key":"ready.js","value":{"rev":"39-8e309b8b274722c051c67f90885571e8"}}, -{"id":"readyjslint","key":"readyjslint","value":{"rev":"3-0a3742129bfbe07d47fcfb9ff67d39b2"}}, -{"id":"recaptcha","key":"recaptcha","value":{"rev":"8-8895926476be014fbe08b301294bf37b"}}, -{"id":"recaptcha-async","key":"recaptcha-async","value":{"rev":"9-3033260389f8afdb5351974119b78ca2"}}, -{"id":"recline","key":"recline","value":{"rev":"189-b56ab8c7791201dccf4aea2532189f1d"}}, -{"id":"recon","key":"recon","value":{"rev":"13-79cbddefb00fec6895342d18609cadb1"}}, -{"id":"reconf","key":"reconf","value":{"rev":"5-0596988db2cf9bf5921502a2aab24ade"}}, -{"id":"redback","key":"redback","value":{"rev":"37-03b390f69cacf42a46e393b7cf297d09"}}, -{"id":"rede","key":"rede","value":{"rev":"3-ee74c2fd990c7780dc823e22a9c3bef2"}}, -{"id":"redecard","key":"redecard","value":{"rev":"13-7dec5a50c34132a2f20f0f143d6b5215"}}, -{"id":"redim","key":"redim","value":{"rev":"15-91c9fd560d1ce87d210b461c52a6d258"}}, -{"id":"redis","key":"redis","value":{"rev":"98-ec237259e8ef5c42a76ff260be50f8fd"}}, -{"id":"redis-channels","key":"redis-channels","value":{"rev":"3-8efc40a25fd18c1c9c41bbaeedb0b22f"}}, -{"id":"redis-client","key":"redis-client","value":{"rev":"3-3376054236e651e7dfcf91be8632fd0e"}}, -{"id":"redis-completer","key":"redis-completer","value":{"rev":"11-9e5bf1f8d37df681e7896252809188d3"}}, -{"id":"redis-keyspace","key":"redis-keyspace","value":{"rev":"25-245f2375741eb3e574dfce9f2da2b687"}}, -{"id":"redis-lua","key":"redis-lua","value":{"rev":"7-81f3dd3a4601271818f15278f495717a"}}, -{"id":"redis-namespace","key":"redis-namespace","value":{"rev":"3-ddf52a172db190fe788aad4116b1cb29"}}, -{"id":"redis-node","key":"redis-node","value":{"rev":"24-7a1e9098d8b5a42a99ca71a01b0d7672"}}, -{"id":"redis-queue","key":"redis-queue","value":{"rev":"3-9896587800c4b98ff291b74210c16b6e"}}, -{"id":"redis-session-store","key":"redis-session-store","value":{"rev":"3-2229501ecf817f9ca60ff2c7721ddd73"}}, -{"id":"redis-tag","key":"redis-tag","value":{"rev":"9-6713e8e91a38613cfef09d7b40f4df71"}}, -{"id":"redis-url","key":"redis-url","value":{"rev":"5-f53545a0039b512a2f7afd4ba2e08773"}}, -{"id":"redis-user","key":"redis-user","value":{"rev":"11-a8c0f6d40cbfbb6183a46e121f31ec06"}}, -{"id":"redis2json","key":"redis2json","value":{"rev":"5-dd96f78f8db0bf695346c95c2ead1307"}}, -{"id":"redis_objects","key":"redis_objects","value":{"rev":"3-499fe6dd07e7a3839111b1892b97f54c"}}, -{"id":"redisev","key":"redisev","value":{"rev":"3-8e857dbe2341292c6e170a7bfe3fa81b"}}, -{"id":"redisfs","key":"redisfs","value":{"rev":"69-d9c90256d32348fdca7a4e646ab4d551"}}, -{"id":"redisify","key":"redisify","value":{"rev":"3-03fce3095b4129e71280d278f11121ba"}}, -{"id":"rediskit","key":"rediskit","value":{"rev":"5-6a0324708f45d884a492cbc408137059"}}, -{"id":"redisql","key":"redisql","value":{"rev":"6-b31802eb37910cb74bd3c9f7b477c025"}}, -{"id":"redmark","key":"redmark","value":{"rev":"5-8724ab00513b6bd7ddfdcd3cc2e0a4e8"}}, -{"id":"redmess","key":"redmess","value":{"rev":"13-14f58666444993ce899cd2260cdc9140"}}, -{"id":"redobj","key":"redobj","value":{"rev":"7-7ebbeffc306f4f7ff9b53ee57e1a250e"}}, -{"id":"redpack","key":"redpack","value":{"rev":"73-58b3fb3bcadf7d80fbe97d9e82d4928b"}}, -{"id":"reds","key":"reds","value":{"rev":"9-baebb36b92887d93fd79785a8c1e6355"}}, -{"id":"reed","key":"reed","value":{"rev":"45-5580f319dc3b5bfb66612ed5c7e17337"}}, -{"id":"reflect","key":"reflect","value":{"rev":"18-b590003cd55332160a5e5327e806e851"}}, -{"id":"reflect-builder","key":"reflect-builder","value":{"rev":"3-453d618b263f9452c0b6bbab0a701f49"}}, -{"id":"reflect-next","key":"reflect-next","value":{"rev":"9-4f2b27a38985d81e906e824321af7713"}}, -{"id":"reflect-tree-builder","key":"reflect-tree-builder","value":{"rev":"5-5f801f53e126dc8a72e13b1417904ce6"}}, -{"id":"reflect-unbuilder","key":"reflect-unbuilder","value":{"rev":"5-f36fd4182fd465a743198b5188697db9"}}, -{"id":"reflectjs","key":"reflectjs","value":{"rev":"3-e03bdb411ffcdd901b896a1cf43eea69"}}, -{"id":"reflex","key":"reflex","value":{"rev":"3-e8bb6b6de906265114b22036832ef650"}}, -{"id":"refmate","key":"refmate","value":{"rev":"3-7d44c45a2eb39236ad2071c84dc0fbba"}}, -{"id":"regext","key":"regext","value":{"rev":"4-97ca5c25fd2f3dc4bd1f3aa821d06f0f"}}, -{"id":"reid-yui3","key":"reid-yui3","value":{"rev":"5-cab8f6e22dfa9b9c508a5dd312bf56b0"}}, -{"id":"rel","key":"rel","value":{"rev":"7-f447870ac7a078f742e4295896646241"}}, -{"id":"relative-date","key":"relative-date","value":{"rev":"5-d0fa11f8100da888cbcce6e96d76b2e4"}}, -{"id":"reloadOnUpdate","key":"reloadOnUpdate","value":{"rev":"9-e7d4c215578b779b2f888381d398bd79"}}, -{"id":"reloaded","key":"reloaded","value":{"rev":"3-dba828b9ab73fc7ce8e47f98068bce8c"}}, -{"id":"remap","key":"remap","value":{"rev":"5-825ac1783df84aba3255c1d39f32ac00"}}, -{"id":"remedial","key":"remedial","value":{"rev":"17-9bb17db015e96db3c833f84d9dbd972a"}}, -{"id":"remote-console","key":"remote-console","value":{"rev":"6-104bae3ba9e4b0a8f772d0b8dc37007e"}}, -{"id":"remote_js","key":"remote_js","value":{"rev":"3-6c0e3058c33113346c037c59206ac0ec"}}, -{"id":"render","key":"render","value":{"rev":"27-fc8be4e9c50e49fb42df83e9446a1f58"}}, -{"id":"renode","key":"renode","value":{"rev":"11-107a3e15a987393157b47125487af296"}}, -{"id":"reparse","key":"reparse","value":{"rev":"10-210ec92e82f5a8515f45d20c7fa2f164"}}, -{"id":"repl","key":"repl","value":{"rev":"3-295279fe20b9ac54b2a235a6bc7013aa"}}, -{"id":"repl-edit","key":"repl-edit","value":{"rev":"18-eb2e604ab8bb65685376459beb417a31"}}, -{"id":"repl-utils","key":"repl-utils","value":{"rev":"7-fc31547ecb53e7e36610cdb68bcec582"}}, -{"id":"replace","key":"replace","value":{"rev":"17-a8976fcdbeb08e27ee2f0fc69ccd7c9d"}}, -{"id":"replica","key":"replica","value":{"rev":"3-f9dae960f91e8dc594f43b004f516d5f"}}, -{"id":"replicate","key":"replicate","value":{"rev":"3-3d6e52af6ff36c02139f619c7e5599c6"}}, -{"id":"replique","key":"replique","value":{"rev":"5-72d990b7d9ce9ff107d96be17490226a"}}, -{"id":"req2","key":"req2","value":{"rev":"3-712151f335b25b5bdef428982d77d0e0"}}, -{"id":"reqhooks","key":"reqhooks","value":{"rev":"17-2f0f0b73545bb1936f449a1ec4a28011"}}, -{"id":"request","key":"request","value":{"rev":"55-0d0b00eecde877ca5cd4ad9e0badc4d1"}}, -{"id":"require","key":"require","value":{"rev":"15-59e9fa05a9de52ee2a818c045736452b"}}, -{"id":"require-analyzer","key":"require-analyzer","value":{"rev":"72-f759f0cdc352df317df29791bfe451f1"}}, -{"id":"require-kiss","key":"require-kiss","value":{"rev":"5-f7ef9d7beda584e9c95635a281a01587"}}, -{"id":"require-like","key":"require-like","value":{"rev":"7-29d5de79e7ff14bb02da954bd9a2ee33"}}, -{"id":"requireincontext","key":"requireincontext","value":{"rev":"5-988ff7c27a21e527ceeb50cbedc8d1b0"}}, -{"id":"requirejs","key":"requirejs","value":{"rev":"3-e609bc91d12d698a17aa51bb50a50509"}}, -{"id":"requirejson","key":"requirejson","value":{"rev":"3-2b8173e58d08034a53a3226c464b1dc8"}}, -{"id":"reqwest","key":"reqwest","value":{"rev":"57-5aa2c1ed17b1e3630859bcad85559e6a"}}, -{"id":"resig-class","key":"resig-class","value":{"rev":"3-16b1a2cdb3224f2043708436dbac4395"}}, -{"id":"resistance","key":"resistance","value":{"rev":"9-9cacbf5fa8318419b4751034a511b8c1"}}, -{"id":"resmin","key":"resmin","value":{"rev":"17-a9c8ded5073118748d765784ca4ea069"}}, -{"id":"resolve","key":"resolve","value":{"rev":"11-bba3470bc93a617ccf9fb6c12097c793"}}, -{"id":"resource-router","key":"resource-router","value":{"rev":"13-7b2991958da4d7701c51537192ca756c"}}, -{"id":"resourcer","key":"resourcer","value":{"rev":"3-4e8b5493d6fcdf147f53d3aaa731a509"}}, -{"id":"response","key":"response","value":{"rev":"3-c5cadf4e5dd90dc1022b92a67853b0f8"}}, -{"id":"resque","key":"resque","value":{"rev":"12-e2f5e1bc3e53ac0a992d1a7da7da0d14"}}, -{"id":"rest-in-node","key":"rest-in-node","value":{"rev":"3-41d1ba925857302211bd0bf9d19975f9"}}, -{"id":"rest-mongo","key":"rest-mongo","value":{"rev":"3-583d2a4b672d6d7e7ad26d0b6df20b45"}}, -{"id":"rest.node","key":"rest.node","value":{"rev":"3-2ed59ba9dcc97123632dfdfaea2559ed"}}, -{"id":"restalytics","key":"restalytics","value":{"rev":"11-5fb3cd8e95b37f1725922fa6fbb146e0"}}, -{"id":"restarter","key":"restarter","value":{"rev":"52-ab0a4fe59128b8848ffd88f9756d0049"}}, -{"id":"restartr","key":"restartr","value":{"rev":"12-d3b86e43e7df7697293db65bb1a1ae65"}}, -{"id":"restify","key":"restify","value":{"rev":"132-054bdc85bebc6221a07dda186238b4c3"}}, -{"id":"restler","key":"restler","value":{"rev":"13-f5392d9dd22e34ce3bcc307c51c889b3"}}, -{"id":"restler-aaronblohowiak","key":"restler-aaronblohowiak","value":{"rev":"8-28b231eceb667153e10effcb1ebeb989"}}, -{"id":"restmvc.js","key":"restmvc.js","value":{"rev":"25-d57b550754437580c447adf612c87d9a"}}, -{"id":"resware","key":"resware","value":{"rev":"9-a5ecbc53fefb280c5d1e3efd822704ff"}}, -{"id":"retrie","key":"retrie","value":{"rev":"7-28ea803ad6b119928ac792cbc8f475c9"}}, -{"id":"retro","key":"retro","value":{"rev":"3-94c3aec940e28869554cbb8449d9369e"}}, -{"id":"retry","key":"retry","value":{"rev":"19-89f3ef664c6fa48ff33a0b9f7e798f15"}}, -{"id":"reut","key":"reut","value":{"rev":"23-d745dd7f8606275848a299ad7c38ceb7"}}, -{"id":"rewrite","key":"rewrite","value":{"rev":"3-5cb91fd831d0913e89354f53b875137d"}}, -{"id":"rex","key":"rex","value":{"rev":"39-59025e6947e5f197f124d24a5393865f"}}, -{"id":"rfb","key":"rfb","value":{"rev":"34-db6e684ac9366a0e3658a508a2187ae1"}}, -{"id":"rhyme","key":"rhyme","value":{"rev":"7-27347762f3f5bfa07307da4e476c2d52"}}, -{"id":"riak-js","key":"riak-js","value":{"rev":"55-11d4ee4beb566946f3968abdf1c4b0ef"}}, -{"id":"riakqp","key":"riakqp","value":{"rev":"7-83f562e6907431fcee56a9408ac6d2c1"}}, -{"id":"rightjs","key":"rightjs","value":{"rev":"9-d53ae4c4f5af3bbbe18d7c879e5bdd1b"}}, -{"id":"rimraf","key":"rimraf","value":{"rev":"17-3ddc3f3f36618712e5f4f27511836e7a"}}, -{"id":"rio","key":"rio","value":{"rev":"11-7c6249c241392b51b9142ca1b228dd4e"}}, -{"id":"ristretto","key":"ristretto","value":{"rev":"3-beb22d7a575e066781f1fd702c4572d7"}}, -{"id":"roast","key":"roast","value":{"rev":"32-17cb066823afab1656196a2fe81246cb"}}, -{"id":"robb","key":"robb","value":{"rev":"5-472ed7ba7928131d86a05fcae89b9f93"}}, -{"id":"robots","key":"robots","value":{"rev":"9-afac82b944045c82acb710cc98c7311d"}}, -{"id":"robotskirt","key":"robotskirt","value":{"rev":"63-29a66420951812d421bf6728f67e710c"}}, -{"id":"robotstxt","key":"robotstxt","value":{"rev":"25-1e01cac90f4570d35ab20232feaeebfa"}}, -{"id":"rocket","key":"rocket","value":{"rev":"27-b0f1ff02e70b237bcf6a5b46aa9b74df"}}, -{"id":"roil","key":"roil","value":{"rev":"48-6b00c09b576fe195546bd031763c0d79"}}, -{"id":"roll","key":"roll","value":{"rev":"5-d3fed9271132eb6c954b3ac6c7ffccf0"}}, -{"id":"rollin","key":"rollin","value":{"rev":"3-bd461bc810c12cfcea94109ba9a2ab39"}}, -{"id":"ron","key":"ron","value":{"rev":"5-913645180d29f377506bcd5292d3cb49"}}, -{"id":"rondo","key":"rondo","value":{"rev":"3-9bed539bbaa0cb978f5c1b711d70cd50"}}, -{"id":"ronn","key":"ronn","value":{"rev":"12-b1b1a1d47376fd11053e2b81fe772c4c"}}, -{"id":"rot13","key":"rot13","value":{"rev":"10-a41e8b581812f02ca1a593f6da0c52dc"}}, -{"id":"router","key":"router","value":{"rev":"26-a7883048759715134710d68f179da18b"}}, -{"id":"routes","key":"routes","value":{"rev":"3-d841826cfd365d8f383a9c4f4288933c"}}, -{"id":"rpc","key":"rpc","value":{"rev":"5-5896f380115a7a606cd7cbbc6d113f05"}}, -{"id":"rpc-socket","key":"rpc-socket","value":{"rev":"17-8743dc1a1f5ba391fc5c7d432cc6eeba"}}, -{"id":"rq","key":"rq","value":{"rev":"7-ba263671c3a3b52851dc7d5e6bd4ef8c"}}, -{"id":"rql","key":"rql","value":{"rev":"1-ac5ec10ed5e41a10a289f26aff4def5a"}}, -{"id":"rqueue","key":"rqueue","value":{"rev":"12-042898704386874c70d0ffaeea6ebc78"}}, -{"id":"rrd","key":"rrd","value":{"rev":"9-488adf135cf29cd4725865a8f25a57ba"}}, -{"id":"rsa","key":"rsa","value":{"rev":"8-7d6f981d72322028c3bebb7141252e98"}}, -{"id":"rss","key":"rss","value":{"rev":"3-0a97b20a0a9051876d779af7663880bd"}}, -{"id":"rssee","key":"rssee","value":{"rev":"9-da2599eae68e50c1695fd7f8fcba2b30"}}, -{"id":"rumba","key":"rumba","value":{"rev":"3-7a3827fa6eca2d02d3189cbad38dd6ca"}}, -{"id":"run","key":"run","value":{"rev":"9-0145abb61e6107a3507624928db461da"}}, -{"id":"runforcover","key":"runforcover","value":{"rev":"3-a36b00ea747c98c7cd7afebf1e1b203c"}}, -{"id":"runlol","key":"runlol","value":{"rev":"3-3c97684baaa3d5b31ca404e8a616fe41"}}, -{"id":"runner","key":"runner","value":{"rev":"11-b7ceeedf7b0dde19c809642f1537723a"}}, -{"id":"runways","key":"runways","value":{"rev":"5-f216f5fa6af7ccc7566cdd06cf424980"}}, -{"id":"rw-translate","key":"rw-translate","value":{"rev":"3-16d2beb17a27713e10459ce368c5d087"}}, -{"id":"rx","key":"rx","value":{"rev":"5-ea2a04ecf38963f8a99b7a408b45af31"}}, -{"id":"rzr","key":"rzr","value":{"rev":"4-6a137fa752709531f2715de5a213b326"}}, -{"id":"s-tpl","key":"s-tpl","value":{"rev":"3-1533cf9657cfe669a25da96b6a655f5c"}}, -{"id":"s3-post","key":"s3-post","value":{"rev":"9-ad3b268bc6754852086b50c2f465c02c"}}, -{"id":"safis","key":"safis","value":{"rev":"3-f1494d0dae2b7dfd60beba5a72412ad2"}}, -{"id":"saiga","key":"saiga","value":{"rev":"22-0c67e8cf8f4b6e8ea30552ffc57d222a"}}, -{"id":"sailthru-client","key":"sailthru-client","value":{"rev":"7-1c9c236050868fb8dec4a34ded2436d3"}}, -{"id":"saimonmoore-cradle","key":"saimonmoore-cradle","value":{"rev":"3-5059616ab0f0f10e1c2d164f686e127e"}}, -{"id":"salesforce","key":"salesforce","value":{"rev":"7-f88cbf517b1fb900358c97b2c049960f"}}, -{"id":"sam","key":"sam","value":{"rev":"7-d7e24d2e94411a17cbedfbd8083fd878"}}, -{"id":"sandbox","key":"sandbox","value":{"rev":"10-0b51bed24e0842f99744dcf5d79346a6"}}, -{"id":"sandboxed-module","key":"sandboxed-module","value":{"rev":"15-bf8fa69d15ae8416d534e3025a16d87d"}}, -{"id":"sanitizer","key":"sanitizer","value":{"rev":"32-6ea8f4c77cd17253c27d0d87e0790678"}}, -{"id":"sapnwrfc","key":"sapnwrfc","value":{"rev":"3-0bc717109ffcd5265ae24f00416a0281"}}, -{"id":"sardines","key":"sardines","value":{"rev":"7-82712731b5af112ca43b9e3fe9975bb0"}}, -{"id":"sargam","key":"sargam","value":{"rev":"3-6b4c70f4b2bcd2add43704bf40c44507"}}, -{"id":"sasl","key":"sasl","value":{"rev":"4-44a6e12b561b112a574ec9e0c4a8843f"}}, -{"id":"sass","key":"sass","value":{"rev":"14-46bcee5423a1efe22f039e116bb7a77c"}}, -{"id":"satisfic","key":"satisfic","value":{"rev":"3-c6e9a2e65a0e55868cea708bcf7b11cf"}}, -{"id":"sax","key":"sax","value":{"rev":"30-58c5dd2c3367522974406bbf29204a40"}}, -{"id":"say","key":"say","value":{"rev":"10-95f31672af6166ea9099d92706c49ed1"}}, -{"id":"sayndo","key":"sayndo","value":{"rev":"51-fd93715c5ff0fcaa68e4e13c2b51ba61"}}, -{"id":"sc-handlebars","key":"sc-handlebars","value":{"rev":"3-b424c3a66fd0e538b068c6046f404084"}}, -{"id":"scgi-server","key":"scgi-server","value":{"rev":"9-3364b5c39985ea8f3468b6abb53d5ea6"}}, -{"id":"scheduler","key":"scheduler","value":{"rev":"25-72bc526bb49b0dd42ad5917d38ea3b18"}}, -{"id":"schema","key":"schema","value":{"rev":"21-166410ae972449965dfa1ce615971168"}}, -{"id":"schema-builder","key":"schema-builder","value":{"rev":"3-bce4612e1e5e6a8a85f16326d3810145"}}, -{"id":"schema-org","key":"schema-org","value":{"rev":"15-59b3b654de0380669d0dcd7573c3b7a1"}}, -{"id":"scone","key":"scone","value":{"rev":"15-85ed2dd4894e896ca1c942322753b76b"}}, -{"id":"scooj","key":"scooj","value":{"rev":"3-1be2074aeba4df60594c03f3e59c7734"}}, -{"id":"scope","key":"scope","value":{"rev":"65-9d7eb8c5fc6c54d8e2c49f4b4b4f5166"}}, -{"id":"scope-provider","key":"scope-provider","value":{"rev":"22-2c25a0b260fd18236d5245c8250d990e"}}, -{"id":"scoped-http-client","key":"scoped-http-client","value":{"rev":"3-afa954fe6d1c8b64a1240b77292d99b5"}}, -{"id":"scottbot","key":"scottbot","value":{"rev":"3-d812ddb4af49976c391f14aeecf93180"}}, -{"id":"scraper","key":"scraper","value":{"rev":"19-e2166b3de2b33d7e6baa04c704887fa6"}}, -{"id":"scrapinode","key":"scrapinode","value":{"rev":"15-ae5bf5085d8c4d5390f7c313b0ad13d2"}}, -{"id":"scrappy-do","key":"scrappy-do","value":{"rev":"3-868f5d299da401112e3ed9976194f1ee"}}, -{"id":"scrapr","key":"scrapr","value":{"rev":"3-d700714a56e8f8b8e9b3bc94274f4a24"}}, -{"id":"scrawl","key":"scrawl","value":{"rev":"3-a70a2905b9a1d2f28eb379c14363955f"}}, -{"id":"scribe","key":"scribe","value":{"rev":"5-4cefaaf869ba8e6ae0257e5705532fbe"}}, -{"id":"scriptTools","key":"scriptTools","value":{"rev":"7-1b66b7f02f2f659ae224057afac60bcf"}}, -{"id":"scriptbroadcast","key":"scriptbroadcast","value":{"rev":"10-3cdc4dae471445b7e08e6fc37c2481e6"}}, -{"id":"scriptjs","key":"scriptjs","value":{"rev":"38-9a522df4f0707d47c904f6781fd97ff6"}}, -{"id":"scrowser","key":"scrowser","value":{"rev":"3-a76938b1f84db0793941dba1f84f4c2f"}}, -{"id":"scss","key":"scss","value":{"rev":"10-49a4ad40eca3c797add57986c74e100b"}}, -{"id":"scylla","key":"scylla","value":{"rev":"10-2c5a1efed63c0ac3a3e75861ee323af4"}}, -{"id":"sdl","key":"sdl","value":{"rev":"40-3df0824da620098c0253b5330c6b0c5c"}}, -{"id":"sdlmixer","key":"sdlmixer","value":{"rev":"4-91455739802a98a5549f6c2b8118758d"}}, -{"id":"search","key":"search","value":{"rev":"9-8f696da412a6ccd07c3b8f22cec315cb"}}, -{"id":"searchjs","key":"searchjs","value":{"rev":"3-59418ce307d41de5649dfc158be51adf"}}, -{"id":"searchparser","key":"searchparser","value":{"rev":"3-a84719692ee33c88f3419f033b839f7a"}}, -{"id":"sechash","key":"sechash","value":{"rev":"11-20db8651628dcf6e8cbbc9bf9b2c4f12"}}, -{"id":"secret","key":"secret","value":{"rev":"7-ac44b38fa32b3f5ebc8fd03b02ec69ec"}}, -{"id":"seedrandom","key":"seedrandom","value":{"rev":"3-becb92de803208672887fc22a1a33694"}}, -{"id":"seek","key":"seek","value":{"rev":"3-d778b8d56582e15d409e2346b86caa53"}}, -{"id":"sel","key":"sel","value":{"rev":"19-94c8bc0872d2da7eab2b35daff7a3b5d"}}, -{"id":"select","key":"select","value":{"rev":"5-43593bfec39caaf1a0bc1fedc96d0dce"}}, -{"id":"selenium","key":"selenium","value":{"rev":"3-8ae8ac7a491b813fd011671e0d494f20"}}, -{"id":"selfish","key":"selfish","value":{"rev":"17-827856c3f3b9a3fdd1758477a24bf706"}}, -{"id":"selleck","key":"selleck","value":{"rev":"13-b8325fcdb383397041e4a408b40d708c"}}, -{"id":"semver","key":"semver","value":{"rev":"25-b2aea0cc920a9981cd429442a3fd62f6"}}, -{"id":"sendgrid","key":"sendgrid","value":{"rev":"3-047e2ad730390bac7cf72b7fc3856c1c"}}, -{"id":"sendgrid-api","key":"sendgrid-api","value":{"rev":"5-6e951b0d60a1b7c778fbf548d4e3aed8"}}, -{"id":"sendgrid-web","key":"sendgrid-web","value":{"rev":"3-dc77d2dbcedfcbe4e497958a2a070cfd"}}, -{"id":"sentry","key":"sentry","value":{"rev":"7-57af332354cbd37ce1c743b424b27dd0"}}, -{"id":"seq","key":"seq","value":{"rev":"77-33a8f54017402835c8542945a5c0a443"}}, -{"id":"sequelize","key":"sequelize","value":{"rev":"63-4c28ad13b73549aad7edc57378b21854"}}, -{"id":"sequence","key":"sequence","value":{"rev":"3-914f8010dc12aec0749ddb719f5ac82d"}}, -{"id":"sequencer","key":"sequencer","value":{"rev":"7-d83e687509678c0f5bcf15e5297677c0"}}, -{"id":"sequent","key":"sequent","value":{"rev":"3-cc6f26ab708c7681fa7d9e3bc15d19c0"}}, -{"id":"serializer","key":"serializer","value":{"rev":"7-a0d13120e2d5cfaa6e453b085280fa08"}}, -{"id":"serialport","key":"serialport","value":{"rev":"32-dc365d057a4f46e9f140dc36d6cc825a"}}, -{"id":"serialportify","key":"serialportify","value":{"rev":"3-1bf4ad9c5ebb5d96ca91fc03a10b5443"}}, -{"id":"serialq","key":"serialq","value":{"rev":"3-5897fcd0fca7d8312e61dbcb93790a71"}}, -{"id":"series","key":"series","value":{"rev":"11-0374191f646c277c51602ebe73033b6a"}}, -{"id":"serve","key":"serve","value":{"rev":"11-560c0c1bdeb3348c7a7d18265d27988e"}}, -{"id":"servedir","key":"servedir","value":{"rev":"18-17cffd8d8326b26e7d9319c79d601dda"}}, -{"id":"server-backbone-redis","key":"server-backbone-redis","value":{"rev":"13-c56419457002aa4fa23b142634882594"}}, -{"id":"server-tracker","key":"server-tracker","value":{"rev":"21-f620e295079a8b0acd29fa1a1469100c"}}, -{"id":"service","key":"service","value":{"rev":"11-07533f9e5e854248c0a1d99e911fa419"}}, -{"id":"sesame","key":"sesame","value":{"rev":"19-1e7ad5d030566f4c67027cc5925a2bdb"}}, -{"id":"sesh","key":"sesh","value":{"rev":"4-1682b3ced38e95f2a11a2f545a820bd5"}}, -{"id":"session","key":"session","value":{"rev":"6-a798bf4cd7d127d0111da7cdc3e058a4"}}, -{"id":"session-mongoose","key":"session-mongoose","value":{"rev":"3-b089c8d365d7de3e659cfa7080697dba"}}, -{"id":"sessionvoc-client","key":"sessionvoc-client","value":{"rev":"23-0f9ed8cd4af55f2aae17cb841247b818"}}, -{"id":"set","key":"set","value":{"rev":"3-a285b30a9c1545b427ebd882bc53d8b2"}}, -{"id":"setInterval","key":"setInterval","value":{"rev":"3-0557f666d05223391466547f52cfff42"}}, -{"id":"setTimeout","key":"setTimeout","value":{"rev":"3-e3c059c93763967ddff5974471f227f8"}}, -{"id":"setochka","key":"setochka","value":{"rev":"3-d559e24618b4fc2d5fc4ef44bccb68be"}}, -{"id":"settings","key":"settings","value":{"rev":"5-4af85bb564a330886c79682d2f1d927c"}}, -{"id":"sexy","key":"sexy","value":{"rev":"7-e57fa6bca5d89be86467786fb9f9b997"}}, -{"id":"sexy-args","key":"sexy-args","value":{"rev":"3-715d7d57234220bd79c78772d2566355"}}, -{"id":"sfaClient","key":"sfaClient","value":{"rev":"3-5d9ddd6ea05d7ef366dbf4f66dd4f642"}}, -{"id":"sfml","key":"sfml","value":{"rev":"10-766c876cd1cc220f776e2fa3c1d9efbb"}}, -{"id":"sh","key":"sh","value":{"rev":"5-3ce779be28550e831cf3c0140477376c"}}, -{"id":"sha1","key":"sha1","value":{"rev":"3-66d4b67ace9c65ae8f03d6dd0647ff6b"}}, -{"id":"sha1_file","key":"sha1_file","value":{"rev":"7-eb25e9c5f470a1b80c1697a952a1c5ed"}}, -{"id":"shadows","key":"shadows","value":{"rev":"5-d6a1a21871c733f34495592307ab7961"}}, -{"id":"share","key":"share","value":{"rev":"15-ef81a004f0e115040dcc1510f6302fa9"}}, -{"id":"shared-views","key":"shared-views","value":{"rev":"11-2c83145e6deb3493e44805c92b58929e"}}, -{"id":"sharedjs","key":"sharedjs","value":{"rev":"9-d43a861b02aa88ae22810f9771d774ec"}}, -{"id":"shell","key":"shell","value":{"rev":"39-7e2042bd6f485b827d53f5f727164d6f"}}, -{"id":"shelld","key":"shelld","value":{"rev":"3-118a62ff31d85e61b78bbd97333a7330"}}, -{"id":"shimify","key":"shimify","value":{"rev":"3-dde4d45bcbd2f6f7faaeb7f8c31d5e8b"}}, -{"id":"ship","key":"ship","value":{"rev":"3-5f294fc3841c901d6cea7f3862625d95"}}, -{"id":"shmakowiki","key":"shmakowiki","value":{"rev":"15-079ae4595d1ddf019d22d3d0ac49a188"}}, -{"id":"shorten","key":"shorten","value":{"rev":"3-ed1395b35faf4639e25dacbb038cf237"}}, -{"id":"shorttag","key":"shorttag","value":{"rev":"5-21d15e4cb8b62aeefe23edc99ff768ec"}}, -{"id":"shorturl","key":"shorturl","value":{"rev":"5-58f78b2a5318ec7da8a5f88739f2796b"}}, -{"id":"shorty","key":"shorty","value":{"rev":"9-17f804ff6e94295549cca6fd534b89de"}}, -{"id":"shotenjin","key":"shotenjin","value":{"rev":"3-91a7864d216a931095e9999133d3c41f"}}, -{"id":"should","key":"should","value":{"rev":"19-ed561071d434f319080fa5d0f647dd93"}}, -{"id":"shovel","key":"shovel","value":{"rev":"5-0168a02a8fa8d7856a5f4a5c18706724"}}, -{"id":"showdown","key":"showdown","value":{"rev":"3-7be5479804451db3faed968fa428af56"}}, -{"id":"shredder","key":"shredder","value":{"rev":"3-93e12ab8822ba5fe86d662f124a8ad1a"}}, -{"id":"shrtn","key":"shrtn","value":{"rev":"19-5883692283903e3166b478b98bcad999"}}, -{"id":"shuffle","key":"shuffle","value":{"rev":"3-71c96da1843abb468649ab0806e6b9d3"}}, -{"id":"sibilant","key":"sibilant","value":{"rev":"18-4dcb400eb9ed9cb1c7826d155807f6d0"}}, -{"id":"sideline","key":"sideline","value":{"rev":"15-84f284a9277718bf90f68dc9351500ae"}}, -{"id":"siesta","key":"siesta","value":{"rev":"5-ff99a009e6e5897c6322237c51d0a142"}}, -{"id":"sign","key":"sign","value":{"rev":"3-2cf70313707c6a046a6ceca61431ea5e"}}, -{"id":"signals","key":"signals","value":{"rev":"7-c756190260cd3ea43e6d44e4722164cb"}}, -{"id":"signature","key":"signature","value":{"rev":"3-fb7552c27ace0f9321ec7438057a37bf"}}, -{"id":"signed-request","key":"signed-request","value":{"rev":"13-9f1563535dcc1a83338a7375d8240f35"}}, -{"id":"signer","key":"signer","value":{"rev":"5-32c9909da2c4dfb284b858164c03cfe0"}}, -{"id":"simple-class","key":"simple-class","value":{"rev":"3-92c6eea4b3a6169db9d62b12f66268cb"}}, -{"id":"simple-ffmpeg","key":"simple-ffmpeg","value":{"rev":"9-b6dd4fe162803e6db434d71035637993"}}, -{"id":"simple-logger","key":"simple-logger","value":{"rev":"5-52b4c957b3671375547d623c6a9444be"}}, -{"id":"simple-mime","key":"simple-mime","value":{"rev":"9-34e4b1dcc26047b64459d924abab65cc"}}, -{"id":"simple-proxy","key":"simple-proxy","value":{"rev":"9-ad6cd76215717527dc6b226e1219e98e"}}, -{"id":"simple-rest-client","key":"simple-rest-client","value":{"rev":"3-8331b3ae49b52720adf2b72d5da0353d"}}, -{"id":"simple-schedule","key":"simple-schedule","value":{"rev":"7-432d3803e1cf9ab5830923a30fd312e0"}}, -{"id":"simple-server","key":"simple-server","value":{"rev":"25-d4d8ba53d3829f4ca51545a3c23a1244"}}, -{"id":"simple-settings","key":"simple-settings","value":{"rev":"3-497d7c5422f764f3738b3ef303ff9737"}}, -{"id":"simple-static","key":"simple-static","value":{"rev":"3-64c9cf84e5140d4285e451357ac83df5"}}, -{"id":"simple-xml-writer","key":"simple-xml-writer","value":{"rev":"3-d1ca18252c341b4430ab6e1240b5f571"}}, -{"id":"simple-xmpp","key":"simple-xmpp","value":{"rev":"11-b4c10de5e4e12a81c4486206d7fb6b40"}}, -{"id":"simple_pubsub","key":"simple_pubsub","value":{"rev":"9-22ae79856ca25b152f104e5d8bc93f12"}}, -{"id":"simpledb","key":"simpledb","value":{"rev":"13-6bf111aa18bffd86e65fd996525a6113"}}, -{"id":"simplegeo","key":"simplegeo","value":{"rev":"8-eb684eea019ae7e5fa0c087a9747367e"}}, -{"id":"simplegeo-client","key":"simplegeo-client","value":{"rev":"7-b2c976bbf8c145c6b0e1744630548084"}}, -{"id":"simplegeo-thrift","key":"simplegeo-thrift","value":{"rev":"3-bf6ddf40c020889fe28630217f38a442"}}, -{"id":"simplelogger","key":"simplelogger","value":{"rev":"3-36634d2543faecdeccc962422d149ffc"}}, -{"id":"simplesets","key":"simplesets","value":{"rev":"26-48fc18f94744c9b288945844b7cc9196"}}, -{"id":"simplesmtp","key":"simplesmtp","value":{"rev":"6-0952f0c5f43a8e94b11355774bbbe9e8"}}, -{"id":"simplydb","key":"simplydb","value":{"rev":"5-34659bf97bbb40f0ec4a3af14107dc31"}}, -{"id":"sin","key":"sin","value":{"rev":"6-0e8bd66b3e2c8c91efef14a3ddc79c53"}}, -{"id":"sink","key":"sink","value":{"rev":"8-4c49709009dfb5719935dba568a3398e"}}, -{"id":"sink-test","key":"sink-test","value":{"rev":"18-411afcb398102f245e92f2ce91897d3e"}}, -{"id":"sinon","key":"sinon","value":{"rev":"19-fa38010bb1bbed437273e1296660d598"}}, -{"id":"sinon-buster","key":"sinon-buster","value":{"rev":"5-a456f0e21b3edb647ad11179cd02354b"}}, -{"id":"sinon-nodeunit","key":"sinon-nodeunit","value":{"rev":"7-d60aa76cc41a6c9d9db4e8ae268b7b3c"}}, -{"id":"sip","key":"sip","value":{"rev":"17-02be6fb014d41fe66ab22ff2ae60a5b8"}}, -{"id":"sitemap","key":"sitemap","value":{"rev":"13-a6d1c830fdc8942c317c1ebe00efbb6d"}}, -{"id":"sizlate","key":"sizlate","value":{"rev":"3-a86c680c681299045f9aabecb99dc161"}}, -{"id":"sizzle","key":"sizzle","value":{"rev":"5-f00e18a80fb8a4f6bdbf11735e265720"}}, -{"id":"sk","key":"sk","value":{"rev":"33-b0b894d02b0211dae08baadfd84b46c2"}}, -{"id":"skeleton","key":"skeleton","value":{"rev":"5-3559721c222b99cd3f56acaaf706992f"}}, -{"id":"skillet","key":"skillet","value":{"rev":"3-0d6bbe21952f85967a5e12425691ee50"}}, -{"id":"skull.io","key":"skull.io","value":{"rev":"3-082e9d58f24ac59144fc130f6b54927e"}}, -{"id":"slang","key":"slang","value":{"rev":"7-3cd6390e3421f677e4e1b00fdf2d3ee1"}}, -{"id":"sleepless","key":"sleepless","value":{"rev":"5-1482568719534caf17f12daf0130ae0d"}}, -{"id":"sleepylib","key":"sleepylib","value":{"rev":"3-60e851f120e34b0726eb50a38b1e27e2"}}, -{"id":"sleight","key":"sleight","value":{"rev":"3-a0f16b17befee698b172074f84daf44c"}}, -{"id":"slick","key":"slick","value":{"rev":"3-596b7b7cf7b8881c55327e8bcf373700"}}, -{"id":"slickback","key":"slickback","value":{"rev":"9-c036e7393d0f9a463a263f287f3bcefd"}}, -{"id":"slide","key":"slide","value":{"rev":"14-83ade7490da699cf0ed99cec818ce3cd"}}, -{"id":"slippers","key":"slippers","value":{"rev":"5-0d657ed5fca4c0ed8b51c6d7f6eac08a"}}, -{"id":"slug","key":"slug","value":{"rev":"3-046a5bd74cc1edce30faa3b6ab239652"}}, -{"id":"slugr","key":"slugr","value":{"rev":"39-ac346964f547433fe34e637de682f81a"}}, -{"id":"smartdc","key":"smartdc","value":{"rev":"31-8c9db85e4548007a0ef87b7286229952"}}, -{"id":"smoosh","key":"smoosh","value":{"rev":"34-ba1c140a173ff8d1f9cdbe5e5addcc43"}}, -{"id":"smores","key":"smores","value":{"rev":"17-1aef1fa2e1675093c5aaf33436d83f5a"}}, -{"id":"smpp","key":"smpp","value":{"rev":"5-9be31b75aee4db09cfe5a2ceef4bea13"}}, -{"id":"smsified","key":"smsified","value":{"rev":"13-bb97eae0bbb6f4d5c4f2f391cd20e891"}}, -{"id":"smtp","key":"smtp","value":{"rev":"20-c3de67c5d0b3c4493293d9f55adb21ad"}}, -{"id":"smtpc","key":"smtpc","value":{"rev":"11-7c4e1207be6eb06350221af0134e8bd7"}}, -{"id":"smtpclient","key":"smtpclient","value":{"rev":"3-ba61ad5f0fd3fdd382e505abcde8c24e"}}, -{"id":"snake","key":"snake","value":{"rev":"15-384892bf8a5ebf222f6fe0ae321aaaa4"}}, -{"id":"snappy","key":"snappy","value":{"rev":"11-94f2d59347c10cc41b6f4a2dd2b0f15e"}}, -{"id":"sng","key":"sng","value":{"rev":"41-a1d3c6253dec5da8b3134ba3505924f5"}}, -{"id":"snip","key":"snip","value":{"rev":"3-cc51d232fff6a7d7b24588bd98e5613b"}}, -{"id":"snipes","key":"snipes","value":{"rev":"3-12af12ca83e15d056969ec76a3cc2ef0"}}, -{"id":"snippets","key":"snippets","value":{"rev":"13-d19c8a99287ec721d56ef9efdf3ce729"}}, -{"id":"snorkel","key":"snorkel","value":{"rev":"11-bc7ba5d1465c7d1ba71479087292615e"}}, -{"id":"snowball","key":"snowball","value":{"rev":"3-76cfbdb9f379ac635874b76d7ee2fd3b"}}, -{"id":"snpp","key":"snpp","value":{"rev":"8-4f10a9f2bff48e348303d8a143afaa6c"}}, -{"id":"snsclient","key":"snsclient","value":{"rev":"3-302ce1c7132a36ef909ce534a509e27f"}}, -{"id":"soap","key":"soap","value":{"rev":"7-10f361a406dfee3074adac0cea127d87"}}, -{"id":"socket-push","key":"socket-push","value":{"rev":"22-196553953d58d92c288678b1dcd49ba7"}}, -{"id":"socket-twitchat","key":"socket-twitchat","value":{"rev":"11-9b159a4610ea444eaae39baa3bf05280"}}, -{"id":"socket.io","key":"socket.io","value":{"rev":"95-c29c929613dd95aa5aea8a5e14f2573f"}}, -{"id":"socket.io-client","key":"socket.io-client","value":{"rev":"33-a3c79d917bb038f0ca72f9cb27180a66"}}, -{"id":"socket.io-cluster","key":"socket.io-cluster","value":{"rev":"5-83bdaf79d2243eaf3a59b45fc604dc1a"}}, -{"id":"socket.io-connect","key":"socket.io-connect","value":{"rev":"17-62f00efc3bff3a1b549cc5e346da996f"}}, -{"id":"socket.io-context","key":"socket.io-context","value":{"rev":"42-a029996765557776d72690db1f14c1fa"}}, -{"id":"socket.io-ender","key":"socket.io-ender","value":{"rev":"9-c4523af5f5cc815ee69c325c1e29ede4"}}, -{"id":"socket.io-juggernaut","key":"socket.io-juggernaut","value":{"rev":"6-b8b97b2df2c186f24487e027278ec975"}}, -{"id":"socket.io-sessions","key":"socket.io-sessions","value":{"rev":"11-2151ee14eb29543811a9e567bcf6811a"}}, -{"id":"socketstream","key":"socketstream","value":{"rev":"29-b198d27ad6a3c4f9b63bc467e85a54a3"}}, -{"id":"sockjs","key":"sockjs","value":{"rev":"21-a8d6534c55e8b3e33cf06516b59aa408"}}, -{"id":"socksified","key":"socksified","value":{"rev":"3-92350ec9889b8db9c3d34bdbc41b1f7b"}}, -{"id":"soda","key":"soda","value":{"rev":"24-04987191e2c4241fbfaf78263c83d121"}}, -{"id":"soda-runner","key":"soda-runner","value":{"rev":"5-da4e8078a7666404d2a5ab3267a5ef75"}}, -{"id":"sodn","key":"sodn","value":{"rev":"3-3ee6350723c54aad792c769947c6b05e"}}, -{"id":"sofa","key":"sofa","value":{"rev":"7-2f8ffd47ce19e6fb7e1ea2e02076955d"}}, -{"id":"solder","key":"solder","value":{"rev":"10-8f7ad0a60c2716ce65658047c4ae5361"}}, -{"id":"solr","key":"solr","value":{"rev":"11-56a295dff56d9f2a4a7293257ca793a4"}}, -{"id":"solr-client","key":"solr-client","value":{"rev":"7-a296273d32224eb241343cb98ded7b82"}}, -{"id":"sones","key":"sones","value":{"rev":"3-9ddbbdc44f3501917e701d3304eb91a5"}}, -{"id":"song","key":"song","value":{"rev":"7-967aa3a58702b3470996cd8e63b1b18d"}}, -{"id":"sorted","key":"sorted","value":{"rev":"3-47b6ec0f744aa04929d48a7d3d10f581"}}, -{"id":"sosumi","key":"sosumi","value":{"rev":"10-8c3980beb3d7c48d4cccf44a8d1d5ff7"}}, -{"id":"soundcloud","key":"soundcloud","value":{"rev":"7-9ee76aecd3d1946731a1173185796864"}}, -{"id":"soupselect","key":"soupselect","value":{"rev":"12-5fea60f4e52117a8212aa7add6c34278"}}, -{"id":"source","key":"source","value":{"rev":"7-57d6cae0530c7cba4a3932f0df129f20"}}, -{"id":"source-map","key":"source-map","value":{"rev":"6-7da8d2ccc104fa30a93ee165975f28e8"}}, -{"id":"spacesocket","key":"spacesocket","value":{"rev":"6-d1679084b0917f86d6c4e3ac89a89809"}}, -{"id":"spark","key":"spark","value":{"rev":"12-64d44ebde2a4b48aed3bc7814c63e773"}}, -{"id":"spark2","key":"spark2","value":{"rev":"28-918548a309f0d18eebd5c64966376959"}}, -{"id":"sparql","key":"sparql","value":{"rev":"3-8eec87fe9fcb4d07aef214858eada777"}}, -{"id":"sparql-orm","key":"sparql-orm","value":{"rev":"3-b2a7efa5622b0b478fdca3f9050800cc"}}, -{"id":"spatial","key":"spatial","value":{"rev":"3-d09d40af02a9c9e5150500cc66d75f8d"}}, -{"id":"spawn","key":"spawn","value":{"rev":"3-f882c01cf1bb538f5f4be78769e1b097"}}, -{"id":"spdy","key":"spdy","value":{"rev":"13-1fbf077bbb8bc87d5058648c0c66288b"}}, -{"id":"spec","key":"spec","value":{"rev":"15-1074d3a8b8332fcc1059fbb5c4f69a7a"}}, -{"id":"speck","key":"speck","value":{"rev":"21-652b0670953ba79e548f4e5d9ce3d923"}}, -{"id":"spectrum","key":"spectrum","value":{"rev":"28-21fb9eeffe2e63a5383371a44a58a1ad"}}, -{"id":"speller","key":"speller","value":{"rev":"6-91e03f89b09338cf8f38d2e64c1778ce"}}, -{"id":"sphericalmercator","key":"sphericalmercator","value":{"rev":"9-3affc61ae0d64854d77829da5414bbc5"}}, -{"id":"spider","key":"spider","value":{"rev":"3-cd04679891875dfb2bf67613514238eb"}}, -{"id":"spider-tdd","key":"spider-tdd","value":{"rev":"3-d95b6d680d053a063e6fab3fdae16261"}}, -{"id":"spine","key":"spine","value":{"rev":"9-2a5cd4733be1d78376814e78966d885a"}}, -{"id":"spine.app","key":"spine.app","value":{"rev":"43-1044b31d4c53ff5c741a16d49291b321"}}, -{"id":"spine.mobile","key":"spine.mobile","value":{"rev":"19-220f64c212a5f22b27d597e299263490"}}, -{"id":"split_er","key":"split_er","value":{"rev":"3-3419662807bf16f7b5b53998a4759246"}}, -{"id":"spludo","key":"spludo","value":{"rev":"14-d41915fcd1b50553f5b9e706b41d2894"}}, -{"id":"spm","key":"spm","value":{"rev":"9-28d6699288d580807091aafdf78dd479"}}, -{"id":"spore","key":"spore","value":{"rev":"44-1c50fb0e6f7c3447f34b1927c976201f"}}, -{"id":"spork","key":"spork","value":{"rev":"3-e90976749b649b88ab83b59785dba101"}}, -{"id":"spotify","key":"spotify","value":{"rev":"3-90c74506a69e08a41feeb23541ac0b4f"}}, -{"id":"spotify-metadata","key":"spotify-metadata","value":{"rev":"3-a546d3e59e40ec0be5d8524f3a1e7a60"}}, -{"id":"spotlight","key":"spotlight","value":{"rev":"3-bead50ac8f53311d539a420c74ea23e2"}}, -{"id":"spread","key":"spread","value":{"rev":"3-ad7bf6d948043fc6dd47a6fcec7da294"}}, -{"id":"spreadsheet","key":"spreadsheet","value":{"rev":"11-94030e23cc9c8e515c1f340656aea031"}}, -{"id":"spreadsheets","key":"spreadsheets","value":{"rev":"3-6563c479735b1b6599bf9602fa65ff38"}}, -{"id":"sprintf","key":"sprintf","value":{"rev":"10-56c5bc7a19ecf8dd92e24d4dca081059"}}, -{"id":"spruce","key":"spruce","value":{"rev":"7-1ea45ef3c5412dd2a6c1fe7b2a083d68"}}, -{"id":"spy","key":"spy","value":{"rev":"3-f5546fdbbec80ba97756d0d1fefa7923"}}, -{"id":"sql","key":"sql","value":{"rev":"5-6c41452f684418ba521666e977f46e54"}}, -{"id":"sqlite","key":"sqlite","value":{"rev":"9-18761259920b497360f581ff8051dcbb"}}, -{"id":"sqlite3","key":"sqlite3","value":{"rev":"51-f9c99537afd9826819c5f40105e50987"}}, -{"id":"sqlmw","key":"sqlmw","value":{"rev":"17-b05b0b089c0f3b1185f96dc19bf61cf5"}}, -{"id":"squeeze","key":"squeeze","value":{"rev":"6-5e517be339d9aa409cedfcc11d1883b1"}}, -{"id":"squish","key":"squish","value":{"rev":"15-2334d8412df59ddd2fce60c1f77954c7"}}, -{"id":"sqwish","key":"sqwish","value":{"rev":"28-cc159dd5fd420432a7724c46456f4958"}}, -{"id":"srand","key":"srand","value":{"rev":"16-22f98b1b1a208c22dfbe95aa889cd08e"}}, -{"id":"srcds","key":"srcds","value":{"rev":"3-bd79da47d36662609c0c75c713874fd1"}}, -{"id":"srs","key":"srs","value":{"rev":"32-c8c961ea10fc60fc428bddff133a8aba"}}, -{"id":"sserve","key":"sserve","value":{"rev":"3-957457395e2c61c20bcb727fc19fc4d4"}}, -{"id":"ssh","key":"ssh","value":{"rev":"3-c7dda694daa7ca1e264b494400edfa18"}}, -{"id":"ssh-agent","key":"ssh-agent","value":{"rev":"3-dbc87102ed1f17b7253a1901976dfa9d"}}, -{"id":"sshmq","key":"sshmq","value":{"rev":"3-052f36ca47cddf069a1700fc79a08930"}}, -{"id":"stache","key":"stache","value":{"rev":"11-9bb0239153147939a25fd20184f20fc6"}}, -{"id":"stack","key":"stack","value":{"rev":"7-e18abdce80008ac9e2feb66f3407fe67"}}, -{"id":"stack-trace","key":"stack-trace","value":{"rev":"13-9fe20c5a3e34a5e4472c6f4fdea86efc"}}, -{"id":"stack.static","key":"stack.static","value":{"rev":"7-ad064faf6255a632cefa71a6ff3c47f3"}}, -{"id":"stack2","key":"stack2","value":{"rev":"3-e5f8ea94c0dd2b4c7f5d3941d689622b"}}, -{"id":"stackedy","key":"stackedy","value":{"rev":"25-f988787b9b5720dece8ae3cb83a2bc12"}}, -{"id":"stage","key":"stage","value":{"rev":"7-d2931fcb473f63320067c3e75638924e"}}, -{"id":"stalker","key":"stalker","value":{"rev":"19-ece35be8695846fc766a71c0022d4ff7"}}, -{"id":"startupify","key":"startupify","value":{"rev":"11-3c87ef5e9ee33122cf3515a63b22c52a"}}, -{"id":"stash","key":"stash","value":{"rev":"10-41239a1df74b69fe7bb3e360f9a35ad1"}}, -{"id":"statechart","key":"statechart","value":{"rev":"6-97e6947b5bbaf14bdb55efa6dfa5e19c"}}, -{"id":"stately","key":"stately","value":{"rev":"6-f8a257cd9fdd84947ff2cf7357afc88b"}}, -{"id":"stathat","key":"stathat","value":{"rev":"3-b79b7bd50bb1e4dcc1301424104a5b36"}}, -{"id":"station","key":"station","value":{"rev":"5-92e6387138b1ee10976bd92dd48ea818"}}, -{"id":"statistics","key":"statistics","value":{"rev":"3-a1c3a03d833c6f02fde403950790e9b4"}}, -{"id":"stats","key":"stats","value":{"rev":"13-fe513ea6b3b5b6b31935fd3464ec5d3b"}}, -{"id":"std","key":"std","value":{"rev":"55-58a4f182c3f51996a0d60a6f575cfefd"}}, -{"id":"steam","key":"steam","value":{"rev":"5-bffdf677d2d1ae3e8236892e68a3dd66"}}, -{"id":"stem","key":"stem","value":{"rev":"36-4f1c38eff671ede0241038017a810132"}}, -{"id":"step","key":"step","value":{"rev":"8-048d7707a45af3a7824a478d296cc467"}}, -{"id":"stepc","key":"stepc","value":{"rev":"3-be85de2c02f4889fdf77fda791feefea"}}, -{"id":"stepper","key":"stepper","value":{"rev":"9-cc54000dc973835c38e139b30cbb10cc"}}, -{"id":"steps","key":"steps","value":{"rev":"5-3561591b425e1fff52dc397f9688feae"}}, -{"id":"stextile","key":"stextile","value":{"rev":"29-9a8b6de917df01d322847f112dcadadf"}}, -{"id":"stitch","key":"stitch","value":{"rev":"13-8a50e4a4f015d1afe346aa6b6c8646bd"}}, -{"id":"stitchup","key":"stitchup","value":{"rev":"7-fe14604e3a8b82f62c38d0cb3ccce61e"}}, -{"id":"stomp","key":"stomp","value":{"rev":"15-e0430c0be74cd20c5204b571999922f7"}}, -{"id":"stopwords","key":"stopwords","value":{"rev":"3-2dd9fade030cfcce85848c5b3b4116fc"}}, -{"id":"store","key":"store","value":{"rev":"9-5537cc0f4827044504e8dae9617c9347"}}, -{"id":"store.js","key":"store.js","value":{"rev":"22-116c9a6194703ea98512d89ec5865e3d"}}, -{"id":"stories","key":"stories","value":{"rev":"11-244ca52d0a41f70bc4dfa0aca0f82a40"}}, -{"id":"storify","key":"storify","value":{"rev":"5-605b197219e916df561dd7722af97e2e"}}, -{"id":"storify-templates","key":"storify-templates","value":{"rev":"3-0960756aa963cee21b679a59cef114a1"}}, -{"id":"storm","key":"storm","value":{"rev":"3-9052e6af8528d1bc0d96021dfa21dd3e"}}, -{"id":"stove","key":"stove","value":{"rev":"17-01c9f0e87398e6bfa03a764e89295e00"}}, -{"id":"str.js","key":"str.js","value":{"rev":"9-301f54edeebde3c5084c3a8071e2aa09"}}, -{"id":"strack","key":"strack","value":{"rev":"10-5acf78ae6a417a82b49c221d606b8fed"}}, -{"id":"strappy","key":"strappy","value":{"rev":"3-fb63a899ff82c0f1142518cc263dd632"}}, -{"id":"strata","key":"strata","value":{"rev":"31-de615eccbda796e2bea405c2806ec792"}}, -{"id":"stream-buffers","key":"stream-buffers","value":{"rev":"7-d8fae628da43d377dd4e982f5bf7b09b"}}, -{"id":"stream-handler","key":"stream-handler","value":{"rev":"7-333eb7dcf2aeb550f948ee2162b21be2"}}, -{"id":"stream-stack","key":"stream-stack","value":{"rev":"22-a70979df042e2ff760b2d900259c84a1"}}, -{"id":"streamer","key":"streamer","value":{"rev":"17-dd16e62ada55311a793fbf7963a920f3"}}, -{"id":"streamlib","key":"streamlib","value":{"rev":"3-5125b1e6a92290f8d7f5fdad71e13fc2"}}, -{"id":"streamline","key":"streamline","value":{"rev":"152-0931f5697340c62e05dcd1a741afd38f"}}, -{"id":"streamline-streams","key":"streamline-streams","value":{"rev":"3-3224030ecfbf5a8ac5d218ab56dee545"}}, -{"id":"streamline-util","key":"streamline-util","value":{"rev":"3-a8047ecf37b985ec836c552fd2bcbf78"}}, -{"id":"streamlogger","key":"streamlogger","value":{"rev":"3-43f93a109774591f1409b0b86c363623"}}, -{"id":"streamlogger-fixed","key":"streamlogger-fixed","value":{"rev":"3-6e48de9e269b4f5bf979c560190b0680"}}, -{"id":"strftime","key":"strftime","value":{"rev":"25-74130d5c9cbf91025ce91f0463a9b1b5"}}, -{"id":"string-color","key":"string-color","value":{"rev":"3-9f336bf06bd80b2d2338c216099421c7"}}, -{"id":"strscan","key":"strscan","value":{"rev":"8-3e0d182a8d0c786754c555c0ac12e9d9"}}, -{"id":"strtok","key":"strtok","value":{"rev":"8-a1a1da7946d62fabb6cca56fc218654b"}}, -{"id":"struct","key":"struct","value":{"rev":"3-ff0f9cb336df73a5a19a38e17633583c"}}, -{"id":"structr","key":"structr","value":{"rev":"21-69b3672dab234d0effec5a72a2b1791c"}}, -{"id":"sty","key":"sty","value":{"rev":"9-ce5691388abc3ccaff23030bff190914"}}, -{"id":"style","key":"style","value":{"rev":"7-342569887fb53caddc60d745706cd66e"}}, -{"id":"style-compile","key":"style-compile","value":{"rev":"5-6f8b86c94c5344ec280a28f025691996"}}, -{"id":"styleless","key":"styleless","value":{"rev":"5-c236b81c38193ad71d7ed7c5b571995d"}}, -{"id":"stylewriter","key":"stylewriter","value":{"rev":"3-25a3f83252b220d8db0aa70c8fc1da4f"}}, -{"id":"stylus","key":"stylus","value":{"rev":"135-8b69084f50a95c297d1044e48b39a6c9"}}, -{"id":"stylus-blueprint","key":"stylus-blueprint","value":{"rev":"5-50ec59a9fa161ca68dac765f2281c13e"}}, -{"id":"stylus-sprite","key":"stylus-sprite","value":{"rev":"27-db597a75467baaad94de287494e9c21e"}}, -{"id":"styout","key":"styout","value":{"rev":"9-9d9460bb9bfa253ed0b5fbeb27f7710a"}}, -{"id":"sugar","key":"sugar","value":{"rev":"5-2722426edc51a7703f5c37306b03a8c4"}}, -{"id":"sugardoll","key":"sugardoll","value":{"rev":"16-cfadf4e7108357297be180a3868130db"}}, -{"id":"suger-pod","key":"suger-pod","value":{"rev":"5-c812b763cf6cdd218c6a18e1a4e2a4ac"}}, -{"id":"sunny","key":"sunny","value":{"rev":"3-c26b62eef1eeeeef58a7ea9373df3b39"}}, -{"id":"superagent","key":"superagent","value":{"rev":"3-1b32cc8372b7713f973bb1e044e6a86f"}}, -{"id":"supermarket","key":"supermarket","value":{"rev":"20-afa8a26ecec3069717c8ca7e5811cc31"}}, -{"id":"supershabam-websocket","key":"supershabam-websocket","value":{"rev":"7-513117fb37b3ab7cdaeeae31589e212e"}}, -{"id":"supervisor","key":"supervisor","value":{"rev":"16-2c6c141d018ef8927acee79f31d466ff"}}, -{"id":"supervisord","key":"supervisord","value":{"rev":"7-359ba115e5e10b5c95ef1a7562ad7a45"}}, -{"id":"svg2jadepartial","key":"svg2jadepartial","value":{"rev":"9-4a6260dd5d7c14801e8012e3ba7510f5"}}, -{"id":"swake","key":"swake","value":{"rev":"5-6f780362f0317427752d87cc5c640021"}}, -{"id":"swarm","key":"swarm","value":{"rev":"43-f1a963a0aeb043bf69529a82798b3afc"}}, -{"id":"sweet","key":"sweet","value":{"rev":"5-333f4d3529f65ce53b037cc282e3671d"}}, -{"id":"swig","key":"swig","value":{"rev":"29-53294b9d4f350192cf65817692092bfa"}}, -{"id":"switchback","key":"switchback","value":{"rev":"3-e117371d415f4a3d4ad30e78f5ec28bf"}}, -{"id":"switchboard","key":"switchboard","value":{"rev":"3-504d6c1e45165c54fbb1d3025d5120d7"}}, -{"id":"swiz","key":"swiz","value":{"rev":"82-cfb7840376b57896fba469e5c6ff3786"}}, -{"id":"swizec-bitly","key":"swizec-bitly","value":{"rev":"3-a705807238b8ef3ff2d008910bc350c3"}}, -{"id":"sws","key":"sws","value":{"rev":"5-bc5e8558bde6c2ae971abdd448a006d2"}}, -{"id":"symbie","key":"symbie","value":{"rev":"5-3184f869ed386341a4cdc35d85efb62a"}}, -{"id":"symbox","key":"symbox","value":{"rev":"5-eed33350cbb763726335ef1df74a6591"}}, -{"id":"synapse","key":"synapse","value":{"rev":"3-a9672d5159c0268babbfb94d7554d4bb"}}, -{"id":"sync","key":"sync","value":{"rev":"65-89fa6b8ab2df135d57e0bba4e921ad3b"}}, -{"id":"synchro","key":"synchro","value":{"rev":"21-6a881704308298f1894509a5b59287ae"}}, -{"id":"synchronous","key":"synchronous","value":{"rev":"7-bf89d61f001d994429e0fd12c26c2676"}}, -{"id":"syncler","key":"syncler","value":{"rev":"2-12870522e069945fc12f7d0f612700ee"}}, -{"id":"syncrepl","key":"syncrepl","value":{"rev":"5-e9234a1d8a529bc0d1b01c3b77c69c30"}}, -{"id":"synct","key":"synct","value":{"rev":"3-3664581b69e6f40dabc90525217f46cd"}}, -{"id":"syndicate","key":"syndicate","value":{"rev":"7-1db2b05d6b3e55fa622c3c26df7f9cad"}}, -{"id":"syslog","key":"syslog","value":{"rev":"5-d52fbc739505a2a194faf9a32da39d23"}}, -{"id":"syslog-node","key":"syslog-node","value":{"rev":"15-039177b9c516fd8d0b31faf92aa73f6f"}}, -{"id":"system","key":"system","value":{"rev":"18-33152371e0696a853ddb8b2234a6dfea"}}, -{"id":"taazr-uglify","key":"taazr-uglify","value":{"rev":"7-5c63dc75aa7c973df102c298291be8a5"}}, -{"id":"table","key":"table","value":{"rev":"9-a8a46ddf3a7cab63a0228303305cc32e"}}, -{"id":"tache.io","key":"tache.io","value":{"rev":"7-5639c70dc56b0a6333b568af377bb216"}}, -{"id":"taco","key":"taco","value":{"rev":"3-97cfbd54b4053c9e01e18af7c3902d1a"}}, -{"id":"tad","key":"tad","value":{"rev":"3-529ebda7291e24ae020d5c2931ba22cd"}}, -{"id":"tafa-misc-util","key":"tafa-misc-util","value":{"rev":"19-52984b66029c7d5cc78d3e2ae88c98d6"}}, -{"id":"tag","key":"tag","value":{"rev":"3-80b0d526b10a26f41fe73978843a07b9"}}, -{"id":"taglib","key":"taglib","value":{"rev":"3-efd2e6bc818bf3b385df40dfae506fa5"}}, -{"id":"tail","key":"tail","value":{"rev":"21-09bce80ad6aa4b01c6a70825fd141fd4"}}, -{"id":"tails","key":"tails","value":{"rev":"14-3ba6976831b1388e14235622ab001681"}}, -{"id":"tamejs","key":"tamejs","value":{"rev":"39-9a3657941df3bd24c43b5473e9f3b4c8"}}, -{"id":"taobao-js-api","key":"taobao-js-api","value":{"rev":"7-d46c8b48364b823dabf808f2b30e1eb8"}}, -{"id":"tap","key":"tap","value":{"rev":"35-1b8e553cf848f5ab27711efa0e74a033"}}, -{"id":"tap-assert","key":"tap-assert","value":{"rev":"19-f2960c64bcfa6ce4ed73e870d8d9e3fa"}}, -{"id":"tap-consumer","key":"tap-consumer","value":{"rev":"3-3e38aafb6d2d840bdb20818efbc75df4"}}, -{"id":"tap-global-harness","key":"tap-global-harness","value":{"rev":"3-f32589814daf8c1816c1f5a24de4ad12"}}, -{"id":"tap-harness","key":"tap-harness","value":{"rev":"7-a5af01384152c452abc11d4e641e6157"}}, -{"id":"tap-producer","key":"tap-producer","value":{"rev":"3-2db67a9541c37c912d4de2576bb3caa0"}}, -{"id":"tap-results","key":"tap-results","value":{"rev":"5-b8800525438965e38dc586e6b5cb142d"}}, -{"id":"tap-runner","key":"tap-runner","value":{"rev":"11-3975c0f5044530b61158a029899f4c03"}}, -{"id":"tap-test","key":"tap-test","value":{"rev":"5-0a3bba26b6b94dae8b7f59712335ee98"}}, -{"id":"tar","key":"tar","value":{"rev":"6-94226dd7add6ae6a1e68088360a466e4"}}, -{"id":"tar-async","key":"tar-async","value":{"rev":"37-d6579d43c1ee2f41205f28b0cde5da23"}}, -{"id":"tar-js","key":"tar-js","value":{"rev":"5-6826f2aad965fb532c7403964ce80d85"}}, -{"id":"task","key":"task","value":{"rev":"3-81f72759a5b64dff88a01a4838cc4a23"}}, -{"id":"task-extjs","key":"task-extjs","value":{"rev":"14-c9ba76374805425c332e0c66725e885c"}}, -{"id":"task-joose-nodejs","key":"task-joose-nodejs","value":{"rev":"20-6b8e4d24323d3240d5ee790d00c0d96a"}}, -{"id":"task-joose-stable","key":"task-joose-stable","value":{"rev":"32-026eada52cd5dd17a680359daec4917a"}}, -{"id":"tasks","key":"tasks","value":{"rev":"5-84e8f83d0c6ec27b4f05057c48063d62"}}, -{"id":"tav","key":"tav","value":{"rev":"3-da9899817edd20f0c73ad09bdf540cc6"}}, -{"id":"taxman","key":"taxman","value":{"rev":"5-9b9c68db8a1c8efedad800026cb23ae4"}}, -{"id":"tbone","key":"tbone","value":{"rev":"3-5789b010d0b1f1c663750c894fb5c570"}}, -{"id":"tcp-proxy","key":"tcp-proxy","value":{"rev":"3-118c6dc26d11537cf157fe2f28b05af5"}}, -{"id":"teamgrowl","key":"teamgrowl","value":{"rev":"8-3d13200b3bfeeace0787f9f9f027216d"}}, -{"id":"teamgrowl-server","key":"teamgrowl-server","value":{"rev":"8-a14dc4a26c2c06a4d9509eaff6e24735"}}, -{"id":"telehash","key":"telehash","value":{"rev":"6-4fae3629c1e7e111ba3e486b39a29913"}}, -{"id":"telemail","key":"telemail","value":{"rev":"3-60928460428265fc8002ca61c7f23abe"}}, -{"id":"telemetry","key":"telemetry","value":{"rev":"5-1be1d37ef62dc786b0a0f0d2d7984eb1"}}, -{"id":"teleport","key":"teleport","value":{"rev":"36-5b55a43ba83f4fe1a547c04e29139c3d"}}, -{"id":"teleport-dashboard","key":"teleport-dashboard","value":{"rev":"7-4cbc728d7a3052848a721fcdd92dda30"}}, -{"id":"teleport-site","key":"teleport-site","value":{"rev":"3-aeb8c0a93b7b0bcd7a30fe33bf23808c"}}, -{"id":"telnet","key":"telnet","value":{"rev":"11-7a587104b94ce135315c7540eb3493f6"}}, -{"id":"telnet-protocol","key":"telnet-protocol","value":{"rev":"3-8fcee2ed02c2e603c48e51e90ae78a00"}}, -{"id":"temp","key":"temp","value":{"rev":"6-91ef505da0a0860a13c0eb1a5d2531e6"}}, -{"id":"tempPath","key":"tempPath","value":{"rev":"3-34f2c1937d97207245986c344136547c"}}, -{"id":"tempis","key":"tempis","value":{"rev":"3-b2c0989068cc8125a519d19b9c79ffb6"}}, -{"id":"template","key":"template","value":{"rev":"6-d0088c6a5a7610570920db0f5c950bf9"}}, -{"id":"template-engine","key":"template-engine","value":{"rev":"3-3746216e1e2e456dbb0fd2f9070c1619"}}, -{"id":"tengwar","key":"tengwar","value":{"rev":"3-645a00f03e1e9546631ac22c37e1f3b4"}}, -{"id":"tenjin","key":"tenjin","value":{"rev":"5-0925c7535455266125b7730296c66356"}}, -{"id":"teriaki","key":"teriaki","value":{"rev":"3-d3c17f70d8697c03f43a7eae75f8c089"}}, -{"id":"terminal","key":"terminal","value":{"rev":"11-0e024d173ee3c28432877c0c5f633f19"}}, -{"id":"termspeak","key":"termspeak","value":{"rev":"7-fdfc93dd7d0d65fe502cabca191d8496"}}, -{"id":"termutil","key":"termutil","value":{"rev":"5-bccf8377ff28bc1f07f8b4b44d1e2335"}}, -{"id":"test","key":"test","value":{"rev":"38-129620013bbd3ec13617c403b02b52f1"}}, -{"id":"test-cmd","key":"test-cmd","value":{"rev":"35-7dd417a80390c2c124c66273ae33bd07"}}, -{"id":"test-helper","key":"test-helper","value":{"rev":"3-7b29af65825fc46d0603a39cdc6c95b4"}}, -{"id":"test-report","key":"test-report","value":{"rev":"5-e51cd1069b6cc442707f0861b35851be"}}, -{"id":"test-report-view","key":"test-report-view","value":{"rev":"3-9ba670940a8235eaef9b957dde6379af"}}, -{"id":"test-run","key":"test-run","value":{"rev":"20-6de89383602e6843d9376a78778bec19"}}, -{"id":"test_it","key":"test_it","value":{"rev":"5-be5cd436b9145398fa88c15c1269b102"}}, -{"id":"testbed","key":"testbed","value":{"rev":"2-db233788f7e516f227fac439d9450ef4"}}, -{"id":"testharness","key":"testharness","value":{"rev":"46-787468cb68ec31b442327639dcc0a4e5"}}, -{"id":"testingey","key":"testingey","value":{"rev":"17-a7ad6a9ff5721ae449876f6448d6f22f"}}, -{"id":"testnode","key":"testnode","value":{"rev":"9-cb63c450b241806e2271cd56fe502395"}}, -{"id":"testosterone","key":"testosterone","value":{"rev":"35-278e8af2b59bb6caf56728c67f720c37"}}, -{"id":"testqueue","key":"testqueue","value":{"rev":"3-59c574aeb345ef2d6e207a342be3f497"}}, -{"id":"testrunner","key":"testrunner","value":{"rev":"7-152e7d4a97f6cf6f00e22140e1969664"}}, -{"id":"testy","key":"testy","value":{"rev":"5-e8f4c9f4a799b6f8ab4effc21c3073a0"}}, -{"id":"text","key":"text","value":{"rev":"6-58a79b0db4968d6ad233898744a75351"}}, -{"id":"textareaserver","key":"textareaserver","value":{"rev":"3-f032b1397eb5e6369e1ac0ad1e78f466"}}, -{"id":"textile","key":"textile","value":{"rev":"6-2a8db66876f0119883449012c9c54c47"}}, -{"id":"textual","key":"textual","value":{"rev":"3-0ad9d5d3403b239185bad403625fed19"}}, -{"id":"tf2logparser","key":"tf2logparser","value":{"rev":"5-ffbc427b95ffeeb013dc13fa2b9621e3"}}, -{"id":"tfe-express","key":"tfe-express","value":{"rev":"3-b68ac01185885bcd22fa430ddb97e757"}}, -{"id":"tfidf","key":"tfidf","value":{"rev":"13-988808af905397dc103a0edf8c7c8a9f"}}, -{"id":"theBasics","key":"theBasics","value":{"rev":"7-9ebef2e59e1bd2fb3544ed16e1dc627b"}}, -{"id":"thefunlanguage.com","key":"thefunlanguage.com","value":{"rev":"3-25d56a3a4f639af23bb058db541bffe0"}}, -{"id":"thelinuxlich-docco","key":"thelinuxlich-docco","value":{"rev":"7-2ac0969da67ead2fa8bc0b21880b1d6b"}}, -{"id":"thelinuxlich-vogue","key":"thelinuxlich-vogue","value":{"rev":"5-ebc0a28cf0ae447b7ebdafc51c460bc0"}}, -{"id":"thepusher","key":"thepusher","value":{"rev":"5-b80cce6f81b1cae7373cd802df34c05c"}}, -{"id":"thetvdb","key":"thetvdb","value":{"rev":"3-a3a017a90b752d8158bf6dfcbcfdf250"}}, -{"id":"thirty-two","key":"thirty-two","value":{"rev":"3-1d4761ba7c4fa475e0c69e9c96d6ac04"}}, -{"id":"thoonk","key":"thoonk","value":{"rev":"15-c62c90d7e9072d96302d3a534ce943bb"}}, -{"id":"thrift","key":"thrift","value":{"rev":"14-447a41c9b655ec06e8e4854d5a55523a"}}, -{"id":"throttle","key":"throttle","value":{"rev":"3-8a3b3c657c49ede67c883806fbfb4df6"}}, -{"id":"thyme","key":"thyme","value":{"rev":"5-f06104f10d43a2b4cbcc7621ed45eacf"}}, -{"id":"tiamat","key":"tiamat","value":{"rev":"44-810633d6cd5edaa0510fe0f38c02ad58"}}, -{"id":"tictoc","key":"tictoc","value":{"rev":"3-0be6cf95d4466595376dadd0fc08bd95"}}, -{"id":"tidy","key":"tidy","value":{"rev":"3-25116d4dcf6765ef2a09711ecc1e03c9"}}, -{"id":"tiers","key":"tiers","value":{"rev":"3-ffaa8ffe472fe703de8f0bbeb8af5621"}}, -{"id":"tilejson","key":"tilejson","value":{"rev":"5-76b990dd945fb412ed00a96edc86b59d"}}, -{"id":"tilelive","key":"tilelive","value":{"rev":"57-9283e846e77263ed6e7299680d6b4b06"}}, -{"id":"tilelive-mapnik","key":"tilelive-mapnik","value":{"rev":"31-30f871ede46789fc6a36f427a1a99fff"}}, -{"id":"tilemill","key":"tilemill","value":{"rev":"19-7b884c9d707dd34f21cb71e88b45fc73"}}, -{"id":"tilestream","key":"tilestream","value":{"rev":"76-3a29ba96ecdb6c860c211ae8f2d909a9"}}, -{"id":"timbits","key":"timbits","value":{"rev":"59-b48dde4a210ec9fb4c33c07a52bce61e"}}, -{"id":"time","key":"time","value":{"rev":"51-907f587206e6a27803a3570e42650adc"}}, -{"id":"timeTraveller","key":"timeTraveller","value":{"rev":"7-389de8c8e86daea495d14aeb2b77df38"}}, -{"id":"timeout","key":"timeout","value":{"rev":"11-8e53dedecfaf6c4f1086eb0f43c71325"}}, -{"id":"timer","key":"timer","value":{"rev":"5-a8bcbb898a807e6662b54ac988fb967b"}}, -{"id":"timerjs","key":"timerjs","value":{"rev":"3-7d24eb268746fdb6b5e9be93bec93f1b"}}, -{"id":"timespan","key":"timespan","value":{"rev":"12-315b2793cbf28a18cea36e97a3c8a55f"}}, -{"id":"timezone","key":"timezone","value":{"rev":"35-2741d5d3b68a953d4cb3a596bc2bc15e"}}, -{"id":"tiny","key":"tiny","value":{"rev":"9-a61d26d02ce39381f7e865ad82494692"}}, -{"id":"tld","key":"tld","value":{"rev":"3-5ce4b4e48a11413ad8a1f3bfd0d0b778"}}, -{"id":"tldextract","key":"tldextract","value":{"rev":"7-620962e27145bd9fc17dc406c38b0c32"}}, -{"id":"tmp","key":"tmp","value":{"rev":"23-20f5c14244d58f35bd3e970f5f65cc32"}}, -{"id":"tmpl","key":"tmpl","value":{"rev":"5-5894c206e15fa58ab9415706b9d53f1f"}}, -{"id":"tmpl-precompile","key":"tmpl-precompile","value":{"rev":"15-3db34b681596b258cae1dae8cc24119d"}}, -{"id":"tmppckg","key":"tmppckg","value":{"rev":"11-b3a13e1280eb9cbef182c1f3f24bd570"}}, -{"id":"tnetstrings","key":"tnetstrings","value":{"rev":"3-d6b8ed2390a3e38138cb01b82d820079"}}, -{"id":"toDataURL","key":"toDataURL","value":{"rev":"3-1ea3cb62666b37343089bb9ef48fbace"}}, -{"id":"toYaml","key":"toYaml","value":{"rev":"11-3c629e3859c70d57b1ae51b2ac459011"}}, -{"id":"tob","key":"tob","value":{"rev":"7-376c174d06a675855406cfcdcacf61f5"}}, -{"id":"tobi","key":"tobi","value":{"rev":"50-d8749ac3739b042afe82657802bc3ba8"}}, -{"id":"toddick","key":"toddick","value":{"rev":"13-db528ef519f57b8c1d752ad7270b4d05"}}, -{"id":"tokenizer","key":"tokenizer","value":{"rev":"5-f6524fafb16059b66074cd04bf248a03"}}, -{"id":"tokyotosho","key":"tokyotosho","value":{"rev":"5-7432e0207165d9c165fd73d2a23410d6"}}, -{"id":"tolang","key":"tolang","value":{"rev":"7-65dbdf56b039f680e61a1e1d7feb9fb1"}}, -{"id":"toolkit","key":"toolkit","value":{"rev":"13-58075a57a6069dc39f98e72d473a0c30"}}, -{"id":"tools","key":"tools","value":{"rev":"3-ba301d25cfc6ad71dd68c811ea97fa01"}}, -{"id":"topcube","key":"topcube","value":{"rev":"29-736b3816d410f626dbc4da663acb05aa"}}, -{"id":"torrent-search","key":"torrent-search","value":{"rev":"7-7dd48fac0c1f99f34fad7da365085b6c"}}, -{"id":"tosource","key":"tosource","value":{"rev":"5-13483e2c11b07611c26b37f2e76a0bf3"}}, -{"id":"tplcpl","key":"tplcpl","value":{"rev":"15-8ba1e6d14ad6b8eb71b703e22054ac0a"}}, -{"id":"tracejs","key":"tracejs","value":{"rev":"23-1ffec83afc19855bcbed8049a009a910"}}, -{"id":"traceur","key":"traceur","value":{"rev":"9-a48f7e4cb1fb452125d81c62c8ab628b"}}, -{"id":"traceurl","key":"traceurl","value":{"rev":"21-e016db44a86b124ea00411f155d884d4"}}, -{"id":"tracey","key":"tracey","value":{"rev":"5-76699aab64e89271cbb7df80a00d3583"}}, -{"id":"tracy","key":"tracy","value":{"rev":"5-412f78082ba6f4c3c7d5328cf66d2e10"}}, -{"id":"traits","key":"traits","value":{"rev":"10-3a37dbec4b78518c00c577f5e286a9b9"}}, -{"id":"tramp","key":"tramp","value":{"rev":"5-3b6d27b8b432b925b7c9fc088e84d8e4"}}, -{"id":"transcode","key":"transcode","value":{"rev":"6-a6494707bd94b5e6d1aa9df3dbcf8d7c"}}, -{"id":"transformer","key":"transformer","value":{"rev":"15-7738ac7c02f03d64f73610fbf7ed92a6"}}, -{"id":"transformjs","key":"transformjs","value":{"rev":"5-f1ab667c430838e1d3238e1f878998e2"}}, -{"id":"transitive","key":"transitive","value":{"rev":"43-841de40a5e3434bd51a1c8f19891f982"}}, -{"id":"translate","key":"translate","value":{"rev":"12-f3ddbbada2f109843c5422d83dd7a203"}}, -{"id":"transliteration.ua","key":"transliteration.ua","value":{"rev":"3-f847c62d8749904fc7de6abe075e619a"}}, -{"id":"transmission","key":"transmission","value":{"rev":"9-587eaa395430036f17b175bc439eabb6"}}, -{"id":"transmogrify","key":"transmogrify","value":{"rev":"5-3e415cd9420c66551cccc0aa91b11d98"}}, -{"id":"transporter","key":"transporter","value":{"rev":"6-698b696890bf01d751e9962bd86cfe7e"}}, -{"id":"traverse","key":"traverse","value":{"rev":"60-9432066ab44fbb0e913227dc62c953d9"}}, -{"id":"traverser","key":"traverser","value":{"rev":"11-1d50662f13134868a1df5019d99bf038"}}, -{"id":"treeeater","key":"treeeater","value":{"rev":"56-2c8a9fd3e842b221ab8da59c6d847327"}}, -{"id":"treelib","key":"treelib","value":{"rev":"13-212ccc836a943c8b2a5342b65ab9edf3"}}, -{"id":"trees","key":"trees","value":{"rev":"3-3ee9e9cf3fd8aa985e32b3d9586a7c0e"}}, -{"id":"trentm-datetime","key":"trentm-datetime","value":{"rev":"3-740a291379ddf97bda2aaf2ff0e1654d"}}, -{"id":"trentm-git","key":"trentm-git","value":{"rev":"3-b81ce3764a45e5d0862488fab9fac486"}}, -{"id":"trentm-hashlib","key":"trentm-hashlib","value":{"rev":"3-4b4175b6a8702bdb9c1fe5ac4786761b"}}, -{"id":"trial","key":"trial","value":{"rev":"3-cf77f189409517495dd8259f86e0620e"}}, -{"id":"trie","key":"trie","value":{"rev":"3-6cc3c209cf4aae5a4f92e1ca38c4c54c"}}, -{"id":"trollop","key":"trollop","value":{"rev":"6-75076593614c9cd51d61a76f73d2c5b5"}}, -{"id":"trollscript","key":"trollscript","value":{"rev":"5-fcf646075c5be575b9174f84d08fbb37"}}, -{"id":"trollscriptjs","key":"trollscriptjs","value":{"rev":"3-1dfd1acd3d15c0bd18ea407e3933b621"}}, -{"id":"tropo-webapi","key":"tropo-webapi","value":{"rev":"11-5106730dbd79167df38812ffaa912ded"}}, -{"id":"tropo-webapi-node","key":"tropo-webapi-node","value":{"rev":"15-483c64bcbf1dcadaea30e78d7bc3ebbc"}}, -{"id":"trundle","key":"trundle","value":{"rev":"3-2af32ed348fdedebd1077891bb22a756"}}, -{"id":"trust-reverse-proxy","key":"trust-reverse-proxy","value":{"rev":"6-ba5bed0849617e0390f0e24750bf5747"}}, -{"id":"trying","key":"trying","value":{"rev":"3-43b417160b178c710e0d85af6b3d56e7"}}, -{"id":"ttapi","key":"ttapi","value":{"rev":"51-727e47d8b383b387a498711c07ce4de6"}}, -{"id":"tubbs","key":"tubbs","value":{"rev":"7-b386e59f2205b22615a376f5ddee3eb0"}}, -{"id":"tuild","key":"tuild","value":{"rev":"13-4a2b92f95a0ee342c060974ce7a0021d"}}, -{"id":"tumbler","key":"tumbler","value":{"rev":"5-ff16653ab92d0af5e70d9caa88f3b7ed"}}, -{"id":"tumbler-sprite","key":"tumbler-sprite","value":{"rev":"3-604d25b7bb9e32b92cadd75aeb23997c"}}, -{"id":"tumblr","key":"tumblr","value":{"rev":"9-14d160f1f2854330fba300b3ea233893"}}, -{"id":"tumblr2","key":"tumblr2","value":{"rev":"7-29bb5d86501cdbcef889289fe7f4b51e"}}, -{"id":"tumblrrr","key":"tumblrrr","value":{"rev":"10-0c50379fbab7b39766e1a61379c39964"}}, -{"id":"tunguska","key":"tunguska","value":{"rev":"1-a6b24d2c2a5a9f091a9b6f13bac66927"}}, -{"id":"tupalocomapi","key":"tupalocomapi","value":{"rev":"3-a1cdf85a08784f62c2ec440a1ed90ad4"}}, -{"id":"turing","key":"turing","value":{"rev":"5-4ba083c8343718acb9450d96551b65c0"}}, -{"id":"tutti","key":"tutti","value":{"rev":"21-929cc205b3d8bc68f86aa63578e0af95"}}, -{"id":"tuttiserver","key":"tuttiserver","value":{"rev":"39-b3fe7cbaf2d43458dae061f37aa5ae18"}}, -{"id":"tuttiterm","key":"tuttiterm","value":{"rev":"7-6c0e9e7f6f137de0ee7c886351fdf373"}}, -{"id":"tvister","key":"tvister","value":{"rev":"7-963eab682ab09922a44fbca50c0ec019"}}, -{"id":"twbot","key":"twbot","value":{"rev":"15-923625f516566c977975b3da3d4bc46b"}}, -{"id":"tweasy","key":"tweasy","value":{"rev":"10-7215063e5729b1c114ef73f07a1368d3"}}, -{"id":"tweeter.js","key":"tweeter.js","value":{"rev":"3-bc8437157c11cf32eec168d7c71037bb"}}, -{"id":"tweetstream","key":"tweetstream","value":{"rev":"6-81a6bf2a3e29208e1c4c65a3958ee5d8"}}, -{"id":"twerk","key":"twerk","value":{"rev":"5-01cbfddf9ad25a67ff1e45ec39acb780"}}, -{"id":"twerp","key":"twerp","value":{"rev":"23-1b4726d1fef030a3dde6fae2cdfbb687"}}, -{"id":"twigjs","key":"twigjs","value":{"rev":"7-07b90e2c35c5c81d394b29086507de04"}}, -{"id":"twilio","key":"twilio","value":{"rev":"20-68d5439ecb1774226025e6f9125bbb86"}}, -{"id":"twilio-node","key":"twilio-node","value":{"rev":"13-84d31c2dc202df3924ed399289cbc1fc"}}, -{"id":"twiliode","key":"twiliode","value":{"rev":"3-6cbe432dd6c6d94d8a4faa6e0ea47dd3"}}, -{"id":"twill","key":"twill","value":{"rev":"5-3a0caf9c0e83ab732ae8ae61f4f17830"}}, -{"id":"twisted-deferred","key":"twisted-deferred","value":{"rev":"9-f35acecb8736d96582e1f9b62dd4ae47"}}, -{"id":"twitpic","key":"twitpic","value":{"rev":"11-55b11432a09edeec1189024f26a48153"}}, -{"id":"twitter","key":"twitter","value":{"rev":"60-9ad6368932c8a74ea5bd10dda993d74d"}}, -{"id":"twitter-client","key":"twitter-client","value":{"rev":"11-dc3da9e1724cf00aa86c1e7823cfd919"}}, -{"id":"twitter-connect","key":"twitter-connect","value":{"rev":"12-969292347a4251d121566169236a3091"}}, -{"id":"twitter-js","key":"twitter-js","value":{"rev":"24-251d0c54749e86bd544a15290e311370"}}, -{"id":"twitter-node","key":"twitter-node","value":{"rev":"12-a7ed6c69f05204de2e258f46230a05b6"}}, -{"id":"twitter-text","key":"twitter-text","value":{"rev":"16-978bda8ec4eaf68213d0ee54242feefa"}}, -{"id":"type","key":"type","value":{"rev":"3-c5b8b87cde9e27277302cb5cb6d00f85"}}, -{"id":"typecheck","key":"typecheck","value":{"rev":"5-79723661620bb0fb254bc7f888d6e937"}}, -{"id":"typed-array","key":"typed-array","value":{"rev":"3-89ac91e2a51a9e5872515d5a83691e83"}}, -{"id":"typhoon","key":"typhoon","value":{"rev":"23-2027c96b8fd971332848594f3b0526cb"}}, -{"id":"typogr","key":"typogr","value":{"rev":"13-2dfe00f08ee13e6b00a99df0a8f96718"}}, -{"id":"ua-parser","key":"ua-parser","value":{"rev":"14-d1a018354a583dba4506bdc0c04a416b"}}, -{"id":"uberblic","key":"uberblic","value":{"rev":"5-500704ed73f255eb5b86ad0a5e158bc9"}}, -{"id":"ucengine","key":"ucengine","value":{"rev":"5-1e8a91c813e39b6f1b9f988431bb65c8"}}, -{"id":"udon","key":"udon","value":{"rev":"3-9a819e835f88fc91272b6366c70d83c0"}}, -{"id":"ueberDB","key":"ueberDB","value":{"rev":"85-fa700e5a64efaf2e71de843d7175606c"}}, -{"id":"uglify-js","key":"uglify-js","value":{"rev":"30-9ac97132a90f94b0a3aadcd96ed51890"}}, -{"id":"uglify-js-middleware","key":"uglify-js-middleware","value":{"rev":"5-47bd98d7f1118f5cab617310d4022eb4"}}, -{"id":"uglifycss","key":"uglifycss","value":{"rev":"3-4eefc4632e6e61ec999e93a1e26e0c83"}}, -{"id":"ui","key":"ui","value":{"rev":"27-b6439c8fcb5feb1d8f722ac5a91727c0"}}, -{"id":"ukijs","key":"ukijs","value":{"rev":"13-a0d7b143104e6cc0760cbe7e61c4f293"}}, -{"id":"umecob","key":"umecob","value":{"rev":"19-960fef8b8b8468ee69096173baa63232"}}, -{"id":"underscore","key":"underscore","value":{"rev":"29-419857a1b0dc08311717d1f6066218b8"}}, -{"id":"underscore-data","key":"underscore-data","value":{"rev":"17-e763dd42ea6e4ab71bc442e9966e50e4"}}, -{"id":"underscore.date","key":"underscore.date","value":{"rev":"11-a1b5870b855d49a3bd37823a736e9f93"}}, -{"id":"underscore.inspector","key":"underscore.inspector","value":{"rev":"7-04d67b5bfe387391d461b11c6ddda231"}}, -{"id":"underscore.string","key":"underscore.string","value":{"rev":"31-4100a9e1f1d7e8dde007cc6736073e88"}}, -{"id":"underscorem","key":"underscorem","value":{"rev":"5-181dd113e62482020122e6a68f80cdc1"}}, -{"id":"underscorex","key":"underscorex","value":{"rev":"8-76b82cffecd4304822fbc346e6cebc1b"}}, -{"id":"underscorify","key":"underscorify","value":{"rev":"3-7bb03dccba21d30c50328e7d4878704e"}}, -{"id":"unicode","key":"unicode","value":{"rev":"45-2fc73b36aad2661e5bb2e703e62a6f71"}}, -{"id":"unicoder","key":"unicoder","value":{"rev":"3-6f6571d361217af7fea7c224ca8a1149"}}, -{"id":"unit","key":"unit","value":{"rev":"5-68847eeb11474765cf73f1e21ca4b839"}}, -{"id":"unite","key":"unite","value":{"rev":"3-a8812f4e77d1d1a9dc67c327d8e75b47"}}, -{"id":"unittest-jslint","key":"unittest-jslint","value":{"rev":"3-c371c63c7b68a32357becb7b6a02d048"}}, -{"id":"unixlib","key":"unixlib","value":{"rev":"3-41f4c2859ca92951cf40556faa4eacdb"}}, -{"id":"unlimit","key":"unlimit","value":{"rev":"3-f42d98066e6ebbc23ef67499845ac020"}}, -{"id":"unrequire","key":"unrequire","value":{"rev":"17-bc75241891ae005eb52844222daf8f97"}}, -{"id":"unshortener","key":"unshortener","value":{"rev":"15-0851cb8bc3c378c37a3df9760067a109"}}, -{"id":"unused","key":"unused","value":{"rev":"3-362e713349c4a5541564fa2de33d01ba"}}, -{"id":"upload","key":"upload","value":{"rev":"3-63aedcfb335754c3bca1675c4add51c4"}}, -{"id":"ups_node","key":"ups_node","value":{"rev":"15-fa6d0be3831ee09420fb703c4d508534"}}, -{"id":"upy","key":"upy","value":{"rev":"5-dab63054d02be71f9c2709659974a5e1"}}, -{"id":"uri","key":"uri","value":{"rev":"3-5baaa12433cff7539b1d39c0c7f62853"}}, -{"id":"uri-parser","key":"uri-parser","value":{"rev":"3-d7e81b08e8b3f6f5ac8c6b4220228529"}}, -{"id":"url","key":"url","value":{"rev":"3-0dfd5ec2904cb1f645fa7449dbb0ce52"}}, -{"id":"url-expander","key":"url-expander","value":{"rev":"21-73bf9fa3c98b15d5ef0ed9815d862953"}}, -{"id":"urllib","key":"urllib","value":{"rev":"5-b015944526c15589a1504d398dcb598a"}}, -{"id":"urn-parser","key":"urn-parser","value":{"rev":"3-08a35a166790ecf88729befd4ebc7bf1"}}, -{"id":"useless","key":"useless","value":{"rev":"3-9d7b7ab9d4811847ed6e99ce2226d687"}}, -{"id":"user-agent","key":"user-agent","value":{"rev":"16-ac00f085795346421242e3d4d75523ad"}}, -{"id":"useragent","key":"useragent","value":{"rev":"7-3184d8aba5540e6596da9e3635ee3c24"}}, -{"id":"useragent_parser","key":"useragent_parser","value":{"rev":"3-730427aba3f0825fd28850e96b1613d4"}}, -{"id":"utf7","key":"utf7","value":{"rev":"3-ad56e4c9ac5a509ff568a3cdf0ed074f"}}, -{"id":"utf8","key":"utf8","value":{"rev":"3-c530cad759dd6e4e471338a71a307434"}}, -{"id":"util","key":"util","value":{"rev":"3-0e55e3466bc3ea6aeda6384639e842c3"}}, -{"id":"utility-belt","key":"utility-belt","value":{"rev":"3-8de401b41ef742b3c0a144b99099771f"}}, -{"id":"utml","key":"utml","value":{"rev":"5-5f0f3de6f787056bd124ca98716fbc19"}}, -{"id":"uubench","key":"uubench","value":{"rev":"6-b6cb0756e35ce998b61bb9a6ea0f5732"}}, -{"id":"uuid","key":"uuid","value":{"rev":"13-3f014b236668ec5eb49d0a17ad54d397"}}, -{"id":"uuid-lib","key":"uuid-lib","value":{"rev":"3-3de40495439e240b5a41875c19c65b1a"}}, -{"id":"uuid-pure","key":"uuid-pure","value":{"rev":"19-b94e9f434901fe0a0bbfdfa06f785874"}}, -{"id":"uuid.js","key":"uuid.js","value":{"rev":"8-3232a97c9f4a2b601d207488350df01b"}}, -{"id":"v8-profiler","key":"v8-profiler","value":{"rev":"12-790c90391bcbec136e316e57b30a845c"}}, -{"id":"valentine","key":"valentine","value":{"rev":"35-dd4b0642aacaf833e1119fc42bb6e9df"}}, -{"id":"validate-json","key":"validate-json","value":{"rev":"5-6a71fb36b102b3a4c5f6cc35012518b3"}}, -{"id":"validations","key":"validations","value":{"rev":"5-7272c97d35e3269813d91f1ea06e7217"}}, -{"id":"validator","key":"validator","value":{"rev":"45-9983ff692c291143ba670b613e07ddab"}}, -{"id":"vanilla","key":"vanilla","value":{"rev":"3-2e1d05af0873386b7cd6d432f1e76217"}}, -{"id":"vapor","key":"vapor","value":{"rev":"1-e1f86f03c94a4b90bca347408dbc56ff"}}, -{"id":"vargs","key":"vargs","value":{"rev":"6-9e389cfd648034dd469348112eedb23b"}}, -{"id":"vash","key":"vash","value":{"rev":"9-85ade8b7249a0e8230e8f0aaf1c34e2a"}}, -{"id":"vbench","key":"vbench","value":{"rev":"3-059528251a566c6ac363e236212448ce"}}, -{"id":"vendor.js","key":"vendor.js","value":{"rev":"5-264b0f8a771cad113be6919b6004ff95"}}, -{"id":"ventstatus","key":"ventstatus","value":{"rev":"3-16aa39e22b149b23b64317991415f92c"}}, -{"id":"version-compare","key":"version-compare","value":{"rev":"3-a8d6eea31572fe973ddd98c0a8097bc6"}}, -{"id":"vertica","key":"vertica","value":{"rev":"37-035d50183c3ad3056db0d7a13c20005d"}}, -{"id":"vhost","key":"vhost","value":{"rev":"9-53bbdba14dae631a49e782d169e4fc5a"}}, -{"id":"vice","key":"vice","value":{"rev":"5-0f74600349f4540b1b104d4ebfec1309"}}, -{"id":"video","key":"video","value":{"rev":"10-65c0b603047188fe2b07cbd2e1c93fe7"}}, -{"id":"vie","key":"vie","value":{"rev":"5-94e23770c5a0510480a0bae07d846ebc"}}, -{"id":"view","key":"view","value":{"rev":"21-a2abdfc54ab732a906347090c68564a5"}}, -{"id":"vigilante","key":"vigilante","value":{"rev":"30-951541a8b2fc2364bb1ccd7cfae56482"}}, -{"id":"villain","key":"villain","value":{"rev":"10-8dbfc5db42230d8813e6cc61af14d575"}}, -{"id":"vine","key":"vine","value":{"rev":"17-e7ac5d190cacf0f2d17d27e37b2b9f5f"}}, -{"id":"vipe","key":"vipe","value":{"rev":"3-78996531221e08292b9ca3de6e19d578"}}, -{"id":"viralheat","key":"viralheat","value":{"rev":"3-b928ce797fd5955c766b6b7e9e9c8f54"}}, -{"id":"viralheat-sentiment","key":"viralheat-sentiment","value":{"rev":"3-5d083e0d141ecf36e06c7c2885b01b5c"}}, -{"id":"virustotal.js","key":"virustotal.js","value":{"rev":"3-074be49f7e877b154a2144ef844f78e9"}}, -{"id":"vk","key":"vk","value":{"rev":"9-48f53ea9ebe68c9d3af45eb601c71006"}}, -{"id":"vmcjs","key":"vmcjs","value":{"rev":"5-44d8dd906fa3530d2bfc2dfee7f498d4"}}, -{"id":"vogue","key":"vogue","value":{"rev":"38-891354d18638a26d5b5ba95933faae0e"}}, -{"id":"vogue-dtrejo","key":"vogue-dtrejo","value":{"rev":"3-3ef8d57d3b5c0aca297fe38c9040954f"}}, -{"id":"votizen-logger","key":"votizen-logger","value":{"rev":"4-ba0837a28693aba346fab885a3a8f315"}}, -{"id":"vows","key":"vows","value":{"rev":"80-43d6a81c184c06d73e692358e913821e"}}, -{"id":"vows-bdd","key":"vows-bdd","value":{"rev":"3-dc2a7013dd94b0b65a3ed3a8b69b680e"}}, -{"id":"vows-ext","key":"vows-ext","value":{"rev":"49-079067a01a681ca7df4dfaae74adb3fb"}}, -{"id":"vows-fluent","key":"vows-fluent","value":{"rev":"23-67625a035cedf90c8fed73722465ecea"}}, -{"id":"vows-is","key":"vows-is","value":{"rev":"68-45a13df422d08ab00cc8f785b6411741"}}, -{"id":"voyeur","key":"voyeur","value":{"rev":"5-56fe23f95df6ff648b67f1a9baf10d41"}}, -{"id":"vws.pubsub","key":"vws.pubsub","value":{"rev":"5-609497d66ab6a76c5201904e41b95715"}}, -{"id":"wabtools","key":"wabtools","value":{"rev":"7-b24cd7262720a29f59da103b7110325d"}}, -{"id":"wadey-ranger","key":"wadey-ranger","value":{"rev":"17-a0541bad0880ffc199e8b2ef4c80ddb8"}}, -{"id":"wagner","key":"wagner","value":{"rev":"3-4b76219928f409b7124e02c0518d6cb6"}}, -{"id":"wait","key":"wait","value":{"rev":"3-7f8a5f9c8e86da4f219353ae778868a9"}}, -{"id":"waiter","key":"waiter","value":{"rev":"5-680176b06719c9a8499725b0a617cdc9"}}, -{"id":"waitlist","key":"waitlist","value":{"rev":"17-f3b2a4cf58b940c3839debda23c12b8e"}}, -{"id":"wake_on_lan","key":"wake_on_lan","value":{"rev":"6-1295bb5c618495b74626aaaa1c644d32"}}, -{"id":"walk","key":"walk","value":{"rev":"22-c05e1e1252a59b1048a0b6464631d08b"}}, -{"id":"walker","key":"walker","value":{"rev":"18-e8a20efc286234fb20789dc68cd04cd1"}}, -{"id":"warp","key":"warp","value":{"rev":"19-c7f17d40291984cd27f1d57fe764a5d2"}}, -{"id":"watch","key":"watch","value":{"rev":"18-3bc43d36ea1dbf69b93d4ea3d9534d44"}}, -{"id":"watch-less","key":"watch-less","value":{"rev":"5-f69a778ee58c681ad3b24a766576c016"}}, -{"id":"watch-tree","key":"watch-tree","value":{"rev":"5-316b60e474c3ae6e97f7cdb06b65af78"}}, -{"id":"watch.js","key":"watch.js","value":{"rev":"11-8c02c7429f90ca5e756a131d85bd5a32"}}, -{"id":"watch_dir","key":"watch_dir","value":{"rev":"5-df0a592508e1e13f5d24c2863733a8b9"}}, -{"id":"watchable","key":"watchable","value":{"rev":"3-f8694ff0c3add9a1310f0980e24ea23b"}}, -{"id":"watchersto","key":"watchersto","value":{"rev":"5-06665e682f58f61831d41d08b4ea12e7"}}, -{"id":"watchman","key":"watchman","value":{"rev":"11-956ad2175d0c5b52e82988a697474244"}}, -{"id":"watchn","key":"watchn","value":{"rev":"15-9685afa8b501f8cd7e068beed1264cfe"}}, -{"id":"wave","key":"wave","value":{"rev":"7-d13054ac592b3b4f81147b6bc7a91ea1"}}, -{"id":"wax","key":"wax","value":{"rev":"71-2e8877b0b6df27c1375dcd7f6bbdb4b7"}}, -{"id":"waz-storage-js","key":"waz-storage-js","value":{"rev":"15-1aaa07353c3d25f5794fa004a23c4dfa"}}, -{"id":"wd","key":"wd","value":{"rev":"19-20c4ee8b83057ece691f9669e288059e"}}, -{"id":"weak","key":"weak","value":{"rev":"3-b774b8be74f33c843df631aa07854104"}}, -{"id":"web","key":"web","value":{"rev":"3-c571dee306020f6f92c7a3150e8023b1"}}, -{"id":"webapp","key":"webapp","value":{"rev":"5-60525be5734cf1d02a77508e5f46bafa"}}, -{"id":"webfonts","key":"webfonts","value":{"rev":"5-d7be242801702fd1eb728385b8982107"}}, -{"id":"webgenjs","key":"webgenjs","value":{"rev":"3-ac6be47eedcbb2561babdb9495d60f29"}}, -{"id":"webgl","key":"webgl","value":{"rev":"18-21cd40f6c7e4943a2d858ed813d3c45d"}}, -{"id":"webhookit-comment","key":"webhookit-comment","value":{"rev":"5-1fbed3d75bf485433bdcac4fac625eab"}}, -{"id":"webhookit-ejs","key":"webhookit-ejs","value":{"rev":"5-9b76f543e9c0941d0245cb3bfd2cc64e"}}, -{"id":"webhookit-email","key":"webhookit-email","value":{"rev":"5-d472fde4f101d55d029a29777bbdb952"}}, -{"id":"webhookit-http","key":"webhookit-http","value":{"rev":"13-9f6f05cdb03f45a2227b9cd820565e63"}}, -{"id":"webhookit-jsonparse","key":"webhookit-jsonparse","value":{"rev":"3-6d49bf8a9849130d9bbc5b0d6fb0bf67"}}, -{"id":"webhookit-jsonpath","key":"webhookit-jsonpath","value":{"rev":"5-7acaf50267274584dca1cc5c1e77ce2e"}}, -{"id":"webhookit-objectbuilder","key":"webhookit-objectbuilder","value":{"rev":"5-e63fb26621929f3ab8d8519556116b30"}}, -{"id":"webhookit-soupselect","key":"webhookit-soupselect","value":{"rev":"9-726f2f4794437632032058bc81e6ee5d"}}, -{"id":"webhookit-xml2js","key":"webhookit-xml2js","value":{"rev":"3-ec959e474ecb3a163f2991767594a60e"}}, -{"id":"webhookit-yql","key":"webhookit-yql","value":{"rev":"9-c6ae87a8cc55d33901485ee7c3895ef8"}}, -{"id":"webify","key":"webify","value":{"rev":"3-86810874abf2274d1387ee748987b627"}}, -{"id":"webjs","key":"webjs","value":{"rev":"103-593a1e4e69d8db6284ecf4fce01b4668"}}, -{"id":"webmake","key":"webmake","value":{"rev":"13-f6588093a487212a151d1c00c26de7b4"}}, -{"id":"webmetrics","key":"webmetrics","value":{"rev":"3-44a428fd2ecb1b1bf50c33157750dd16"}}, -{"id":"webrepl","key":"webrepl","value":{"rev":"21-d6dcdbb59186092d9a0f1977c69394a5"}}, -{"id":"webservice","key":"webservice","value":{"rev":"18-05038f1cf997cff1ed81e783485680aa"}}, -{"id":"webshell","key":"webshell","value":{"rev":"3-05c431cf961a9dbaee1dfd95237e189a"}}, -{"id":"websocket","key":"websocket","value":{"rev":"33-7c20d55a88f187d7b398525824159f67"}}, -{"id":"websocket-client","key":"websocket-client","value":{"rev":"12-26a3530b9e6d465f472c791db01c9fc3"}}, -{"id":"websocket-protocol","key":"websocket-protocol","value":{"rev":"3-e52a8496f70686c289087149aee8b359"}}, -{"id":"websocket-server","key":"websocket-server","value":{"rev":"46-9f69e2f9408eb196b3a1aa990e5b5ac2"}}, -{"id":"websockets","key":"websockets","value":{"rev":"3-5535fcb4ae144909f021ee067eec7b2a"}}, -{"id":"webworker","key":"webworker","value":{"rev":"16-f7a4c758b176c6e464c93b6a9f79283b"}}, -{"id":"weibo","key":"weibo","value":{"rev":"21-8a50310389b2f43d8a7cb14e138eb122"}}, -{"id":"weld","key":"weld","value":{"rev":"7-16601ac41d79b3a01e4d2615035376ed"}}, -{"id":"whatlang","key":"whatlang","value":{"rev":"5-f7b10a0f8c3b6579c81d1d1222aeccd7"}}, -{"id":"wheat","key":"wheat","value":{"rev":"16-f6a97282f521edb7f2b0e5edc9577ce0"}}, -{"id":"which","key":"which","value":{"rev":"7-e5fdcb208715f2201d3911caf8a67042"}}, -{"id":"whiskers","key":"whiskers","value":{"rev":"9-2cfd73cebeaf8ce3cb1591e825380621"}}, -{"id":"whiskey","key":"whiskey","value":{"rev":"49-55367718b9067ff2bcb7fbb89327587b"}}, -{"id":"whisperjs","key":"whisperjs","value":{"rev":"19-e2182c72ea24b8c40e12b0c1027eb60d"}}, -{"id":"wikimapia","key":"wikimapia","value":{"rev":"11-8d1a314e8c827236e21e0aabc6e5efd9"}}, -{"id":"wikiminute","key":"wikiminute","value":{"rev":"11-d031a2c7d41bcecb52ac9c7bb5e75e8e"}}, -{"id":"wikiwym","key":"wikiwym","value":{"rev":"3-c0fd4c9b6b93b3a8b14021c2ebae5b0c"}}, -{"id":"wiky","key":"wiky","value":{"rev":"6-be49acce152652e9219a32da1dfd01ea"}}, -{"id":"wildfile","key":"wildfile","value":{"rev":"9-16a05032f890f07c72a5f48c3a6ffbc0"}}, -{"id":"willful.js","key":"willful.js","value":{"rev":"3-3bb957b0a5fc1b4b6c15bace7e8f5902"}}, -{"id":"wilson","key":"wilson","value":{"rev":"14-d4bf88484f1b1cf86b07f4b74f26991d"}}, -{"id":"window","key":"window","value":{"rev":"3-ea84e74fd5556ff662ff47f40522cfa2"}}, -{"id":"windshaft","key":"windshaft","value":{"rev":"21-1d31e4eb7482d15b97c919a4b051ea9c"}}, -{"id":"windtunnel","key":"windtunnel","value":{"rev":"5-0d2ef7faed1b221a3eaa581480adad64"}}, -{"id":"wingrr","key":"wingrr","value":{"rev":"9-a599fad3e0c74895aa266c61805b76cb"}}, -{"id":"wings","key":"wings","value":{"rev":"3-cfcfd262d905cd3be1d1bae82fafd9f0"}}, -{"id":"winston","key":"winston","value":{"rev":"111-13acba5a9ba6d4f19469acb4122d72ea"}}, -{"id":"winston-amqp","key":"winston-amqp","value":{"rev":"5-61408e1dde45f974a995dd27905b8831"}}, -{"id":"winston-mongodb","key":"winston-mongodb","value":{"rev":"9-ae755237a8faa8f5a0b92029c236691a"}}, -{"id":"winston-redis","key":"winston-redis","value":{"rev":"3-1fb861edc109ed5cbd735320124ba103"}}, -{"id":"winston-riak","key":"winston-riak","value":{"rev":"15-3f2923a73386524d851244ace1bece98"}}, -{"id":"winston-syslog","key":"winston-syslog","value":{"rev":"9-7f256bd63aebec19edea47f80de21dfd"}}, -{"id":"winstoon","key":"winstoon","value":{"rev":"9-d719ca7abfeeaa468d1b431c24836089"}}, -{"id":"wirez","key":"wirez","value":{"rev":"5-5c5d0768485ed11c2b80a8a6a3699c39"}}, -{"id":"wobot","key":"wobot","value":{"rev":"9-176ed86fd9d94a7e94efb782c7512533"}}, -{"id":"word-generator","key":"word-generator","value":{"rev":"5-a2c67f11474a8925eb67f04369ac068a"}}, -{"id":"wordnik","key":"wordnik","value":{"rev":"3-4e371fbf7063ced50bbe726079fda1ec"}}, -{"id":"wordpress-auth","key":"wordpress-auth","value":{"rev":"5-05eef01542e00a88418d2885efb4c9ad"}}, -{"id":"wordwrap","key":"wordwrap","value":{"rev":"5-a728ce2cdeab69b71d40fe7c1c41d7c1"}}, -{"id":"wordy","key":"wordy","value":{"rev":"3-bc220ca3dbd008aee932c551cfbdcc6b"}}, -{"id":"worker","key":"worker","value":{"rev":"6-3b03aa764c9fac66ec5c1773e9abc43b"}}, -{"id":"worker-pool","key":"worker-pool","value":{"rev":"3-e3550e704b48f5799a4cc02af7d27355"}}, -{"id":"workflow","key":"workflow","value":{"rev":"3-817c6c77cbb2f332ea9bdddf3b565c00"}}, -{"id":"workhorse","key":"workhorse","value":{"rev":"30-c39ae2ddd867a137073a289c1709f229"}}, -{"id":"world-db","key":"world-db","value":{"rev":"6-eaef1beb6abbebd3e903a28a7f46aa81"}}, -{"id":"worm","key":"worm","value":{"rev":"7-00db15dc9cfd48777cce32fb93e1df6b"}}, -{"id":"wormhole","key":"wormhole","value":{"rev":"37-21e2db062666040c477a7042fc2ffc9d"}}, -{"id":"wrap","key":"wrap","value":{"rev":"3-aded14c091b730813bd24d92cae45cd6"}}, -{"id":"wrench","key":"wrench","value":{"rev":"12-57d3da63e34e59e1f5d1b3bde471e31f"}}, -{"id":"wsclient","key":"wsclient","value":{"rev":"17-f962faf4f6c9d4eda9111e90b2d0735d"}}, -{"id":"wscomm","key":"wscomm","value":{"rev":"47-80affda45da523e57c87b8d43ef73ec9"}}, -{"id":"wsscraper","key":"wsscraper","value":{"rev":"3-94a84fe9b3df46b8d6ad4851e389dae1"}}, -{"id":"wu","key":"wu","value":{"rev":"4-f307d3a00e7a1212b7949bcb96161088"}}, -{"id":"wunderapi","key":"wunderapi","value":{"rev":"17-31e3b991e97931022992b97f9441b9af"}}, -{"id":"wurfl-client","key":"wurfl-client","value":{"rev":"3-a8c3e454d6d9c9b23b7290eb64866e80"}}, -{"id":"wwwdude","key":"wwwdude","value":{"rev":"19-eb8192461b8864af59740f9b44e168ca"}}, -{"id":"x","key":"x","value":{"rev":"9-10403358980aba239b7a9af78175589d"}}, -{"id":"x-core","key":"x-core","value":{"rev":"13-f04b063855da231539d1945a35802d9e"}}, -{"id":"x11","key":"x11","value":{"rev":"5-e5b1435c0aa29207c90fdeaa87570bb7"}}, -{"id":"xappy-async_testing","key":"xappy-async_testing","value":{"rev":"3-747c934540267492b0e6d3bb6d65964c"}}, -{"id":"xappy-pg","key":"xappy-pg","value":{"rev":"4-119e8f93af1e4976900441ec5e3bb0b9"}}, -{"id":"xcbjs","key":"xcbjs","value":{"rev":"3-095a693f9ac7b4e2c319f79d95eb3e95"}}, -{"id":"xemplar","key":"xemplar","value":{"rev":"9-2ccde68ffac8e66aa8013b98d82ff20c"}}, -{"id":"xfer","key":"xfer","value":{"rev":"3-c1875506ed132c6a2b5e7d7eaff9df14"}}, -{"id":"xjs","key":"xjs","value":{"rev":"11-05d5cd002298894ed582a9f5bff5a762"}}, -{"id":"xjst","key":"xjst","value":{"rev":"11-68774970fc7f413ff620fb0d50d8a1d9"}}, -{"id":"xkcdbot","key":"xkcdbot","value":{"rev":"3-7cc9affb442c9ae4c7a109a0b72c2600"}}, -{"id":"xml","key":"xml","value":{"rev":"12-0d1a69f11767de47bfc4a0fce566e36e"}}, -{"id":"xml-markup","key":"xml-markup","value":{"rev":"6-100a92d1f7fe9444e285365dce8203de"}}, -{"id":"xml-simple","key":"xml-simple","value":{"rev":"3-d60e388df5b65128a5e000381643dd31"}}, -{"id":"xml-stream","key":"xml-stream","value":{"rev":"13-44d6ee47e00c91735e908e69c5dffc6b"}}, -{"id":"xml2js","key":"xml2js","value":{"rev":"27-434297bcd9db7628c57fcc9bbbe2671e"}}, -{"id":"xml2js-expat","key":"xml2js-expat","value":{"rev":"15-a8c5c0ba64584d07ed94c0a14dc55fe8"}}, -{"id":"xml2json","key":"xml2json","value":{"rev":"17-fa740417285834be1aa4d95e1ed6d9b9"}}, -{"id":"xmlbuilder","key":"xmlbuilder","value":{"rev":"32-63e3be32dda07c6e998866cddd8a879e"}}, -{"id":"xmlhttprequest","key":"xmlhttprequest","value":{"rev":"9-570fba8bfd5b0958c258cee7309c4b54"}}, -{"id":"xmlrpc","key":"xmlrpc","value":{"rev":"15-ae062e34a965e7543d4fd7b6c3f29cb7"}}, -{"id":"xmpp-client","key":"xmpp-client","value":{"rev":"6-2d123b4666b5deda71f071295cfca793"}}, -{"id":"xmpp-muc","key":"xmpp-muc","value":{"rev":"6-d95b8bca67f406a281a27aa4d89f6f46"}}, -{"id":"xmpp-server","key":"xmpp-server","value":{"rev":"9-44374bc3398cc74f2a36ff973fa0d35f"}}, -{"id":"xp","key":"xp","value":{"rev":"7-781a5e1da74332f25c441f627cd0b4ea"}}, -{"id":"xregexp","key":"xregexp","value":{"rev":"3-c34025fdeb13c18389e737a4b3d4ddf7"}}, -{"id":"xsd","key":"xsd","value":{"rev":"5-566590ccb8923453175a3f1f3b6cbf24"}}, -{"id":"ya-csv","key":"ya-csv","value":{"rev":"28-d485b812914b3c3f5d7e9c4bcee0c3ea"}}, -{"id":"yabble","key":"yabble","value":{"rev":"5-5370a53003a122fe40a16ed2b0e5cead"}}, -{"id":"yaconfig","key":"yaconfig","value":{"rev":"3-f82a452260b010cc5128818741c46017"}}, -{"id":"yah","key":"yah","value":{"rev":"3-cfc0c10f85a9e3076247ca350077e90f"}}, -{"id":"yajet","key":"yajet","value":{"rev":"5-6f7f24335436c84081adf0bbb020b151"}}, -{"id":"yajl","key":"yajl","value":{"rev":"3-8ac011e5a00368aad8d58d95a64c7254"}}, -{"id":"yaml","key":"yaml","value":{"rev":"16-732e5cb6dc10eefeb7dae959e677fb5b"}}, -{"id":"yaml-config","key":"yaml-config","value":{"rev":"3-fb817000005d48526a106ecda5ac5435"}}, -{"id":"yamlish","key":"yamlish","value":{"rev":"3-604fb4f1de9d5aa5ed48432c7db4a8a1"}}, -{"id":"yamlparser","key":"yamlparser","value":{"rev":"13-130a82262c7f742c2a1e26fc58983503"}}, -{"id":"yammer-js","key":"yammer-js","value":{"rev":"3-16ec240ab0b26fa9f0513ada8c769c1f"}}, -{"id":"yanc","key":"yanc","value":{"rev":"15-33d713f0dee42efe8306e6b2a43fe336"}}, -{"id":"yanlibs","key":"yanlibs","value":{"rev":"3-e481217d43b9f79b80e22538eabadabc"}}, -{"id":"yanop","key":"yanop","value":{"rev":"5-6c407ce6f1c18b6bac37ad5945ff8fed"}}, -{"id":"yanx","key":"yanx","value":{"rev":"6-f4c4d255526eaa922baa498f37d38fe0"}}, -{"id":"yasession","key":"yasession","value":{"rev":"7-6e2598123d41b33535b88e99eb87828f"}}, -{"id":"yelp","key":"yelp","value":{"rev":"3-5c769f488a65addba313ff3b6256c365"}}, -{"id":"yeti","key":"yeti","value":{"rev":"50-65338f573ed8f799ec9b1c9bd2643e34"}}, -{"id":"youtube","key":"youtube","value":{"rev":"7-5020698499af8946e9578864a21f6ac5"}}, -{"id":"youtube-dl","key":"youtube-dl","value":{"rev":"76-a42f09b7bf87e7e6157d5d9835cca8a7"}}, -{"id":"youtube-js","key":"youtube-js","value":{"rev":"5-e2d798a185490ad98cb57c2641c4658e"}}, -{"id":"yproject","key":"yproject","value":{"rev":"7-70cb1624de9e8321c67f1f348dc80ff4"}}, -{"id":"yql","key":"yql","value":{"rev":"18-d19123b254abfb097648c4a242513fd3"}}, -{"id":"yubico","key":"yubico","value":{"rev":"9-0e2bd84479a68e1f12c89800a4049053"}}, -{"id":"yui-cli","key":"yui-cli","value":{"rev":"7-0186f7278da8734861109799b9123197"}}, -{"id":"yui-compressor","key":"yui-compressor","value":{"rev":"12-5804d78bb24bb2d3555ca2e28ecc6b70"}}, -{"id":"yui-repl","key":"yui-repl","value":{"rev":"25-9b202e835a46a07be931e6529a4ccb61"}}, -{"id":"yui3","key":"yui3","value":{"rev":"93-4decc441f19acf0ab5abd1a81e3cbb40"}}, -{"id":"yui3-2in3","key":"yui3-2in3","value":{"rev":"10-dc0429fe818aceeca80d075613c9547a"}}, -{"id":"yui3-bare","key":"yui3-bare","value":{"rev":"33-60779e2088efe782b437ecc053c01e2f"}}, -{"id":"yui3-base","key":"yui3-base","value":{"rev":"33-89017bb5dfde621fc7d179f2939e3d1b"}}, -{"id":"yui3-core","key":"yui3-core","value":{"rev":"17-3759fa0072e24f4bb29e22144cb3dda3"}}, -{"id":"yui3-gallery","key":"yui3-gallery","value":{"rev":"38-9ce6f7a60b2f815337767249d1827951"}}, -{"id":"yui3-mocha","key":"yui3-mocha","value":{"rev":"3-83ff9c42a37f63de0c132ce6cb1ad282"}}, -{"id":"yuitest","key":"yuitest","value":{"rev":"17-b5dd4ad4e82b6b310d7a6e9103570779"}}, -{"id":"zap","key":"zap","value":{"rev":"15-9b9b7c6badb0a9fd9d469934e9be12c0"}}, -{"id":"zappa","key":"zappa","value":{"rev":"26-d193767b488e778db41455924001b1fb"}}, -{"id":"zen","key":"zen","value":{"rev":"7-23a260d4379816a5c931c2e823bda1ae"}}, -{"id":"zeppelin","key":"zeppelin","value":{"rev":"7-9db2e313fe323749e259be91edcdee8e"}}, -{"id":"zeromq","key":"zeromq","value":{"rev":"24-7cb4cec19fb3a03871900ac3558fcbef"}}, -{"id":"zest","key":"zest","value":{"rev":"5-080a2a69a93d66fcaae0da7ddaa9ceab"}}, -{"id":"zest-js","key":"zest-js","value":{"rev":"5-541454063618fa3a9d6f44e0147ea622"}}, -{"id":"zip","key":"zip","value":{"rev":"11-443da314322b6a1a93b40a38124610f2"}}, -{"id":"zipfile","key":"zipfile","value":{"rev":"32-e846d29fc615e8fbc610f44653a1e085"}}, -{"id":"zipper","key":"zipper","value":{"rev":"5-cde0a4a7f03c139dcd779f3ede55bd0e"}}, -{"id":"zippy","key":"zippy","value":{"rev":"7-3906ca62dd8020e9673a7c229944bd3f"}}, -{"id":"zipwith","key":"zipwith","value":{"rev":"3-58c50c6220d6493047f8333c5db22cc9"}}, -{"id":"zlib","key":"zlib","value":{"rev":"27-e0443f2d9a0c9db31f86a6c5b9ba78ba"}}, -{"id":"zlib-sync","key":"zlib-sync","value":{"rev":"3-b17a39dd23b3455d35ffd862004ed677"}}, -{"id":"zlibcontext","key":"zlibcontext","value":{"rev":"11-1c0c6b34e87adab1b6d5ee60be6a608c"}}, -{"id":"zlibstream","key":"zlibstream","value":{"rev":"5-44e30d87de9aaaa975c64d8dcdcd1a94"}}, -{"id":"zmq","key":"zmq","value":{"rev":"7-eae5d939fcdb7be5edfb328aefeaba4e"}}, -{"id":"zo","key":"zo","value":{"rev":"5-956f084373731805e5871f4716049529"}}, -{"id":"zombie","key":"zombie","value":{"rev":"109-9eec325353a47bfcc32a94719bf147da"}}, -{"id":"zombie-https","key":"zombie-https","value":{"rev":"3-6aff25d319be319343882575acef4890"}}, -{"id":"zoneinfo","key":"zoneinfo","value":{"rev":"15-d95d2041324d961fe26a0217cf485511"}}, -{"id":"zookeeper","key":"zookeeper","value":{"rev":"11-5a5ed278a01e4b508ffa6e9a02059898"}}, -{"id":"zoom","key":"zoom","value":{"rev":"3-9d0277ad580d64c9a4d48a40d22976f0"}}, -{"id":"zsock","key":"zsock","value":{"rev":"16-4f975b91f0f9c2d2a2501e362401c368"}}, -{"id":"zutil","key":"zutil","value":{"rev":"9-3e7bc6520008b4fcd5ee6eb9e8e5adf5"}} -]} diff --git a/deps/npm/node_modules/JSONStream/test/fixtures/couch_sample.json b/deps/npm/node_modules/JSONStream/test/fixtures/couch_sample.json deleted file mode 100644 index b154c861c595cb..00000000000000 --- a/deps/npm/node_modules/JSONStream/test/fixtures/couch_sample.json +++ /dev/null @@ -1,18 +0,0 @@ -{"total_rows":129,"offset":0,"rows":[ - { "id":"change1_0.6995461115147918" - , "key":"change1_0.6995461115147918" - , "value":{"rev":"1-e240bae28c7bb3667f02760f6398d508"} - , "doc":{ - "_id": "change1_0.6995461115147918" - , "_rev": "1-e240bae28c7bb3667f02760f6398d508","hello":1} - }, - { "id":"change2_0.6995461115147918" - , "key":"change2_0.6995461115147918" - , "value":{"rev":"1-13677d36b98c0c075145bb8975105153"} - , "doc":{ - "_id":"change2_0.6995461115147918" - , "_rev":"1-13677d36b98c0c075145bb8975105153" - , "hello":2 - } - }, -]} diff --git a/deps/npm/node_modules/JSONStream/test/fixtures/depth.json b/deps/npm/node_modules/JSONStream/test/fixtures/depth.json deleted file mode 100644 index 9b4bfb93764403..00000000000000 --- a/deps/npm/node_modules/JSONStream/test/fixtures/depth.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "total": 5, - "docs": [ - { - "key": { - "value": 0, - "some": "property" - } - }, - {"value": [1]}, - {"value": {"a":2}}, - {"blbl": [{}, {"a":0, "b":1, "value":"3"}, 10]}, - {"value": 4} - ] -} diff --git a/deps/npm/node_modules/JSONStream/test/fixtures/error.json b/deps/npm/node_modules/JSONStream/test/fixtures/error.json deleted file mode 100644 index 9736f3ecd35de8..00000000000000 --- a/deps/npm/node_modules/JSONStream/test/fixtures/error.json +++ /dev/null @@ -1 +0,0 @@ -{"error": "error_code", "message": "this is an error message"} diff --git a/deps/npm/node_modules/JSONStream/test/fixtures/header_footer.json b/deps/npm/node_modules/JSONStream/test/fixtures/header_footer.json deleted file mode 100644 index 6e4694d2a0dc21..00000000000000 --- a/deps/npm/node_modules/JSONStream/test/fixtures/header_footer.json +++ /dev/null @@ -1,19 +0,0 @@ -{"total_rows":129,"offset":0,"rows":[ - { "id":"change1_0.6995461115147918" - , "key":"change1_0.6995461115147918" - , "value":{"rev":"1-e240bae28c7bb3667f02760f6398d508"} - , "doc":{ - "_id": "change1_0.6995461115147918" - , "_rev": "1-e240bae28c7bb3667f02760f6398d508","hello":1} - }, - { "id":"change2_0.6995461115147918" - , "key":"change2_0.6995461115147918" - , "value":{"rev":"1-13677d36b98c0c075145bb8975105153"} - , "doc":{ - "_id":"change2_0.6995461115147918" - , "_rev":"1-13677d36b98c0c075145bb8975105153" - , "hello":2 - } - } -], -"foo": {"bar": "baz"}} diff --git a/deps/npm/node_modules/JSONStream/test/fn.js b/deps/npm/node_modules/JSONStream/test/fn.js deleted file mode 100644 index 4acc672627fd16..00000000000000 --- a/deps/npm/node_modules/JSONStream/test/fn.js +++ /dev/null @@ -1,39 +0,0 @@ - - -var fs = require ('fs') - , join = require('path').join - , file = join(__dirname, 'fixtures','all_npm.json') - , JSONStream = require('../') - , it = require('it-is') - -function fn (s) { - return !isNaN(parseInt(s, 10)) -} - -var expected = JSON.parse(fs.readFileSync(file)) - , parser = JSONStream.parse(['rows', fn]) - , called = 0 - , ended = false - , parsed = [] - -fs.createReadStream(file).pipe(parser) - -parser.on('data', function (data) { - called ++ - it.has({ - id: it.typeof('string'), - value: {rev: it.typeof('string')}, - key:it.typeof('string') - }) - parsed.push(data) -}) - -parser.on('end', function () { - ended = true -}) - -process.on('exit', function () { - it(called).equal(expected.rows.length) - it(parsed).deepEqual(expected.rows) - console.error('PASSED') -}) diff --git a/deps/npm/node_modules/JSONStream/test/gen.js b/deps/npm/node_modules/JSONStream/test/gen.js deleted file mode 100644 index c233722ac31a20..00000000000000 --- a/deps/npm/node_modules/JSONStream/test/gen.js +++ /dev/null @@ -1,135 +0,0 @@ -return // dont run this test for now since tape is weird and broken on 0.10 - -var fs = require('fs') -var JSONStream = require('../') -var file = process.argv[2] || '/tmp/JSONStream-test-large.json' -var size = Number(process.argv[3] || 100000) -var tape = require('tape') -// if (process.title !== 'browser') { - tape('out of mem', function (t) { - t.plan(1) - ////////////////////////////////////////////////////// - // Produces a random number between arg1 and arg2 - ////////////////////////////////////////////////////// - var randomNumber = function (min, max) { - var number = Math.floor(Math.random() * (max - min + 1) + min); - return number; - }; - - ////////////////////////////////////////////////////// - // Produces a random string of a length between arg1 and arg2 - ////////////////////////////////////////////////////// - var randomString = function (min, max) { - - // add several spaces to increase chanses of creating 'words' - var chars = ' 0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'; - var result = ''; - - var randomLength = randomNumber(min, max); - - for (var i = randomLength; i > 0; --i) { - result += chars[Math.round(Math.random() * (chars.length - 1))]; - } - return result; - }; - - ////////////////////////////////////////////////////// - // Produces a random JSON document, as a string - ////////////////////////////////////////////////////// - var randomJsonDoc = function () { - - var doc = { - "CrashOccurenceID": randomNumber(10000, 50000), - "CrashID": randomNumber(1000, 10000), - "SiteName": randomString(10, 25), - "MachineName": randomString(10, 25), - "Date": randomString(26, 26), - "ProcessDuration": randomString(18, 18), - "ThreadIdentityName": null, - "WindowsIdentityName": randomString(15, 40), - "OperatingSystemName": randomString(35, 65), - "DetailedExceptionInformation": randomString(100, 800) - }; - - doc = JSON.stringify(doc); - doc = doc.replace(/\,/g, ',\n'); // add new lines after each attribute - return doc; - }; - - ////////////////////////////////////////////////////// - // generates test data - ////////////////////////////////////////////////////// - var generateTestData = function (cb) { - - console.log('generating large data file...'); - - var stream = fs.createWriteStream(file, { - encoding: 'utf8' - }); - - var i = 0; - var max = size; - var writing = false - var split = ',\n'; - var doc = randomJsonDoc(); - stream.write('['); - - function write () { - if(writing) return - writing = true - while(++i < max) { - if(Math.random() < 0.001) - console.log('generate..', i + ' / ' + size) - if(!stream.write(doc + split)) { - writing = false - return stream.once('drain', write) - } - } - stream.write(doc + ']') - stream.end(); - console.log('END') - } - write() - stream.on('close', cb) - }; - - ////////////////////////////////////////////////////// - // Shows that parsing 100000 instances using JSONStream fails - // - // After several seconds, you will get this crash - // FATAL ERROR: JS Allocation failed - process out of memory - ////////////////////////////////////////////////////// - var testJSONStreamParse_causesOutOfMem = function (done) { - var items = 0 - console.log('parsing data files using JSONStream...'); - - var parser = JSONStream.parse([true]); - var stream = fs.createReadStream(file); - stream.pipe(parser); - - parser.on('data', function (data) { - items++ - if(Math.random() < 0.01) console.log(items, '...') - }); - - parser.on('end', function () { - t.equal(items, size) - }); - - }; - - ////////////////////////////////////////////////////// - // main - ////////////////////////////////////////////////////// - - fs.stat(file, function (err, stat) { - console.log(stat) - if(err) - generateTestData(testJSONStreamParse_causesOutOfMem); - else - testJSONStreamParse_causesOutOfMem() - }) - - }) - -// } diff --git a/deps/npm/node_modules/JSONStream/test/header_footer.js b/deps/npm/node_modules/JSONStream/test/header_footer.js deleted file mode 100644 index f18fc59e7e48d4..00000000000000 --- a/deps/npm/node_modules/JSONStream/test/header_footer.js +++ /dev/null @@ -1,55 +0,0 @@ - - -var fs = require ('fs') - , join = require('path').join - , file = join(__dirname, 'fixtures','header_footer.json') - , JSONStream = require('../') - , it = require('it-is') - -var expected = JSON.parse(fs.readFileSync(file)) - , parser = JSONStream.parse(['rows', /\d+/ /*, 'value'*/]) - , called = 0 - , headerCalled = 0 - , footerCalled = 0 - , ended = false - , parsed = [] - -fs.createReadStream(file).pipe(parser) - -parser.on('header', function (data) { - headerCalled ++ - it(data).deepEqual({ - total_rows: 129, - offset: 0 - }) -}) - -parser.on('footer', function (data) { - footerCalled ++ - it(data).deepEqual({ - foo: { bar: 'baz' } - }) -}) - -parser.on('data', function (data) { - called ++ - it.has({ - id: it.typeof('string'), - value: {rev: it.typeof('string')}, - key:it.typeof('string') - }) - it(headerCalled).equal(1) - parsed.push(data) -}) - -parser.on('end', function () { - ended = true -}) - -process.on('exit', function () { - it(called).equal(expected.rows.length) - it(headerCalled).equal(1) - it(footerCalled).equal(1) - it(parsed).deepEqual(expected.rows) - console.error('PASSED') -}) diff --git a/deps/npm/node_modules/JSONStream/test/issues.js b/deps/npm/node_modules/JSONStream/test/issues.js deleted file mode 100644 index ea4c74337ad8a3..00000000000000 --- a/deps/npm/node_modules/JSONStream/test/issues.js +++ /dev/null @@ -1,34 +0,0 @@ -var JSONStream = require('../'); -var test = require('tape') - -test('#66', function (t) { - var error = 0; - var stream = JSONStream - .parse() - .on('error', function (err) { - t.ok(err); - error++; - }) - .on('end', function () { - t.ok(error === 1); - t.end(); - }); - - stream.write('["foo":bar['); - stream.end(); - -}); - -test('#81 - failure to parse nested objects', function (t) { - var stream = JSONStream - .parse('.bar.foo') - .on('error', function (err) { - t.error(err); - }) - .on('end', function () { - t.end(); - }); - - stream.write('{"bar":{"foo":"baz"}}'); - stream.end(); -}); diff --git a/deps/npm/node_modules/JSONStream/test/keys.js b/deps/npm/node_modules/JSONStream/test/keys.js deleted file mode 100644 index 747723d11e2cc3..00000000000000 --- a/deps/npm/node_modules/JSONStream/test/keys.js +++ /dev/null @@ -1,105 +0,0 @@ -var test = require('tape'); -var fs = require ('fs'); -var join = require('path').join; -var couch_sample_file = join(__dirname, 'fixtures','couch_sample.json'); -var JSONStream = require('../'); - -var fixture = { - obj: { - one: 1, - two: 2, - three: 3 - } -}; - -function assertFixtureKeys(stream, t) { - var keys = []; - var values = []; - stream.on('data', function(data) { - keys.push(data.key); - values.push(data.value); - }); - - stream.on('end', function() { - t.deepEqual(keys, ['one', 'two', 'three']); - t.deepEqual(values, [1,2,3]); - t.end(); - }); - stream.write(JSON.stringify(fixture)); - stream.end(); -} - -test('keys via string', function(t) { - var stream = JSONStream.parse('obj.$*'); - assertFixtureKeys(stream, t); -}); - -test('keys via array', function(t) { - var stream = JSONStream.parse(['obj',{emitKey: true}]); - assertFixtureKeys(stream, t); -}); - -test('path via array', function(t) { - var stream = JSONStream.parse(['obj',{emitPath: true}]); - - var paths = []; - var values = []; - stream.on('data', function(data) { - console.log(JSON.stringify(data)); - paths.push(data.path); - values.push(data.value); - }); - - stream.on('end', function() { - t.deepEqual(paths, [['obj', 'one'], ['obj', 'two'], ['obj', 'three']]); - t.deepEqual(values, [1,2,3]); - t.end(); - }); - stream.write(JSON.stringify(fixture)); - stream.end(); -}); - -test('advanced keys', function(t) { - var advanced = fs.readFileSync(couch_sample_file); - var stream = JSONStream.parse(['rows', true, 'doc', {emitKey: true}]); - - var keys = []; - var values = []; - stream.on('data', function(data) { - keys.push(data.key); - values.push(data.value); - }); - - stream.on('end', function() { - t.deepEqual(keys, [ - '_id', '_rev', 'hello', - '_id', '_rev', 'hello' - ]); - t.deepEqual(values, [ - "change1_0.6995461115147918", "1-e240bae28c7bb3667f02760f6398d508", 1, - "change2_0.6995461115147918", "1-13677d36b98c0c075145bb8975105153", 2 - ]); - t.end(); - }); - stream.write(advanced); - stream.end(); -}); - -test('parent keys', function(t) { - var stream = JSONStream.parse('$*'); - var d = null; - stream.on('data', function(data) { - if(d) t.fail('should only be called once'); - d = data; - }); - - stream.on('end', function() { - t.deepEqual(d,{ - key: 'obj', - value: fixture.obj - }); - t.end(); - }); - stream.write(JSON.stringify(fixture)); - stream.end(); -}) diff --git a/deps/npm/node_modules/JSONStream/test/map.js b/deps/npm/node_modules/JSONStream/test/map.js deleted file mode 100644 index 29b9d896913570..00000000000000 --- a/deps/npm/node_modules/JSONStream/test/map.js +++ /dev/null @@ -1,40 +0,0 @@ - -var test = require('tape') - -var JSONStream = require('../') - -test('map function', function (t) { - - var actual = [] - - stream = JSONStream.parse([true], function (e) { return e*10 }) - stream.on('data', function (v) { actual.push(v)}) - stream.on('end', function () { - t.deepEqual(actual, [10,20,30,40,50,60]) - t.end() - - }) - - stream.write(JSON.stringify([1,2,3,4,5,6], null, 2)) - stream.end() - -}) - -test('filter function', function (t) { - - var actual = [] - - stream = JSONStream - .parse([true], function (e) { return e%2 ? e : null}) - .on('data', function (v) { actual.push(v)}) - .on('end', function () { - t.deepEqual(actual, [1,3,5]) - t.end() - - }) - - stream.write(JSON.stringify([1,2,3,4,5,6], null, 2)) - stream.end() - -}) - diff --git a/deps/npm/node_modules/JSONStream/test/multiple_objects.js b/deps/npm/node_modules/JSONStream/test/multiple_objects.js deleted file mode 100644 index 22f6324228e54d..00000000000000 --- a/deps/npm/node_modules/JSONStream/test/multiple_objects.js +++ /dev/null @@ -1,36 +0,0 @@ -var fs = require ('fs'); -var net = require('net'); -var join = require('path').join; -var file = join(__dirname, 'fixtures','all_npm.json'); -var it = require('it-is'); -var JSONStream = require('../'); - -var str = fs.readFileSync(file); - -var datas = {} - -var server = net.createServer(function(client) { - var data_calls = 0; - var parser = JSONStream.parse(['rows', true, 'key']); - parser.on('data', function(data) { - ++ data_calls; - datas[data] = (datas[data] || 0) + 1 - it(data).typeof('string') - }); - - parser.on('end', function() { - console.log('END') - var min = Infinity - for (var d in datas) - min = min > datas[d] ? datas[d] : min - it(min).equal(3); - server.close(); - }); - client.pipe(parser); -}); -server.listen(9999); - -var client = net.connect({ port : 9999 }, function() { - var msgs = str + ' ' + str + '\n\n' + str - client.end(msgs); -}); diff --git a/deps/npm/node_modules/JSONStream/test/multiple_objects_error.js b/deps/npm/node_modules/JSONStream/test/multiple_objects_error.js deleted file mode 100644 index 83d113b7f33f00..00000000000000 --- a/deps/npm/node_modules/JSONStream/test/multiple_objects_error.js +++ /dev/null @@ -1,29 +0,0 @@ -var fs = require ('fs'); -var net = require('net'); -var join = require('path').join; -var file = join(__dirname, 'fixtures','all_npm.json'); -var it = require('it-is'); -var JSONStream = require('../'); - -var str = fs.readFileSync(file); - -var server = net.createServer(function(client) { - var data_calls = 0; - var parser = JSONStream.parse(); - parser.on('error', function(err) { - console.log(err); - server.close(); - }); - - parser.on('end', function() { - console.log('END'); - server.close(); - }); - client.pipe(parser); -}); -server.listen(9999); - -var client = net.connect({ port : 9999 }, function() { - var msgs = str + '}'; - client.end(msgs); -}); diff --git a/deps/npm/node_modules/JSONStream/test/null.js b/deps/npm/node_modules/JSONStream/test/null.js deleted file mode 100644 index 95dd60c0af04dc..00000000000000 --- a/deps/npm/node_modules/JSONStream/test/null.js +++ /dev/null @@ -1,28 +0,0 @@ -var JSONStream = require('../') - -var data = [ - {ID: 1, optional: null}, - {ID: 2, optional: null}, - {ID: 3, optional: 20}, - {ID: 4, optional: null}, - {ID: 5, optional: 'hello'}, - {ID: 6, optional: null} -] - - -var test = require('tape') - -test ('null properties', function (t) { - var actual = [] - var stream = - - JSONStream.parse('*.optional') - .on('data', function (v) { actual.push(v) }) - .on('end', function () { - t.deepEqual(actual, [20, 'hello']) - t.end() - }) - - stream.write(JSON.stringify(data, null, 2)) - stream.end() -}) diff --git a/deps/npm/node_modules/JSONStream/test/parsejson.js b/deps/npm/node_modules/JSONStream/test/parsejson.js deleted file mode 100644 index e70dabc1846240..00000000000000 --- a/deps/npm/node_modules/JSONStream/test/parsejson.js +++ /dev/null @@ -1,29 +0,0 @@ - - -/* - sometimes jsonparse changes numbers slightly. -*/ - -var r = Math.random() - , Parser = require('jsonparse') - , p = new Parser() - , assert = require('assert') - , times = 20 - , bufferFrom = Buffer.from && Buffer.from !== Uint8Array.from - , str - -while (times --) { - - assert.equal(JSON.parse(JSON.stringify(r)), r, 'core JSON') - - p.onValue = function (v) { - console.error('parsed', v) - assert.equal(v,r) - } - console.error('correct', r) - str = JSON.stringify([r]) - p.write (bufferFrom ? Buffer.from(str) : new Buffer(str)) - - - -} diff --git a/deps/npm/node_modules/JSONStream/test/run.js b/deps/npm/node_modules/JSONStream/test/run.js deleted file mode 100644 index 7d62e7385bd44f..00000000000000 --- a/deps/npm/node_modules/JSONStream/test/run.js +++ /dev/null @@ -1,13 +0,0 @@ -var readdirSync = require('fs').readdirSync -var spawnSync = require('child_process').spawnSync -var extname = require('path').extname - -var files = readdirSync(__dirname) -files.forEach(function(file){ - if (extname(file) !== '.js' || file === 'run.js') - return - console.log(`*** ${file} ***`) - var result = spawnSync(process.argv0, [file], { stdio: 'inherit', cwd: __dirname} ) - if (result.status !== 0) - process.exit(result.status) -}) diff --git a/deps/npm/node_modules/JSONStream/test/stringify.js b/deps/npm/node_modules/JSONStream/test/stringify.js deleted file mode 100644 index b6de85ed253f22..00000000000000 --- a/deps/npm/node_modules/JSONStream/test/stringify.js +++ /dev/null @@ -1,41 +0,0 @@ - -var fs = require ('fs') - , join = require('path').join - , file = join(__dirname, 'fixtures','all_npm.json') - , JSONStream = require('../') - , it = require('it-is').style('colour') - - function randomObj () { - return ( - Math.random () < 0.4 - ? {hello: 'eonuhckmqjk', - whatever: 236515, - lies: true, - nothing: [null], - stuff: [Math.random(),Math.random(),Math.random()] - } - : ['AOREC', 'reoubaor', {ouec: 62642}, [[[], {}, 53]]] - ) - } - -var expected = [] - , stringify = JSONStream.stringify() - , es = require('event-stream') - , stringified = '' - , called = 0 - , count = 10 - , ended = false - -while (count --) - expected.push(randomObj()) - - es.connect( - es.readArray(expected), - stringify, - //JSONStream.parse([/./]), - es.writeArray(function (err, lines) { - - it(JSON.parse(lines.join(''))).deepEqual(expected) - console.error('PASSED') - }) - ) diff --git a/deps/npm/node_modules/JSONStream/test/stringify_object.js b/deps/npm/node_modules/JSONStream/test/stringify_object.js deleted file mode 100644 index 9490115a0db996..00000000000000 --- a/deps/npm/node_modules/JSONStream/test/stringify_object.js +++ /dev/null @@ -1,47 +0,0 @@ - -var fs = require ('fs') - , join = require('path').join - , file = join(__dirname, 'fixtures','all_npm.json') - , JSONStream = require('../') - , it = require('it-is').style('colour') - , es = require('event-stream') - , pending = 10 - , passed = true - - function randomObj () { - return ( - Math.random () < 0.4 - ? {hello: 'eonuhckmqjk', - whatever: 236515, - lies: true, - nothing: [null], - stuff: [Math.random(),Math.random(),Math.random()] - } - : ['AOREC', 'reoubaor', {ouec: 62642}, [[[], {}, 53]]] - ) - } - -for (var ix = 0; ix < pending; ix++) (function (count) { - var expected = {} - , stringify = JSONStream.stringifyObject() - - es.connect( - stringify, - es.writeArray(function (err, lines) { - it(JSON.parse(lines.join(''))).deepEqual(expected) - if (--pending === 0) { - console.error('PASSED') - } - }) - ) - - while (count --) { - var key = Math.random().toString(16).slice(2) - expected[key] = randomObj() - stringify.write([ key, expected[key] ]) - } - - process.nextTick(function () { - stringify.end() - }) -})(ix) diff --git a/deps/npm/node_modules/JSONStream/test/test.js b/deps/npm/node_modules/JSONStream/test/test.js deleted file mode 100644 index 8ea7c2e1f13895..00000000000000 --- a/deps/npm/node_modules/JSONStream/test/test.js +++ /dev/null @@ -1,35 +0,0 @@ - - -var fs = require ('fs') - , join = require('path').join - , file = join(__dirname, 'fixtures','all_npm.json') - , JSONStream = require('../') - , it = require('it-is') - -var expected = JSON.parse(fs.readFileSync(file)) - , parser = JSONStream.parse(['rows', /\d+/ /*, 'value'*/]) - , called = 0 - , ended = false - , parsed = [] - -fs.createReadStream(file).pipe(parser) - -parser.on('data', function (data) { - called ++ - it.has({ - id: it.typeof('string'), - value: {rev: it.typeof('string')}, - key:it.typeof('string') - }) - parsed.push(data) -}) - -parser.on('end', function () { - ended = true -}) - -process.on('exit', function () { - it(called).equal(expected.rows.length) - it(parsed).deepEqual(expected.rows) - console.error('PASSED') -}) diff --git a/deps/npm/node_modules/JSONStream/test/test2.js b/deps/npm/node_modules/JSONStream/test/test2.js deleted file mode 100644 index d09df7be4d3ee0..00000000000000 --- a/deps/npm/node_modules/JSONStream/test/test2.js +++ /dev/null @@ -1,29 +0,0 @@ - - -var fs = require ('fs') - , join = require('path').join - , file = join(__dirname, '..','package.json') - , JSONStream = require('../') - , it = require('it-is') - -var expected = JSON.parse(fs.readFileSync(file)) - , parser = JSONStream.parse([]) - , called = 0 - , ended = false - , parsed = [] - -fs.createReadStream(file).pipe(parser) - -parser.on('data', function (data) { - called ++ - it(data).deepEqual(expected) -}) - -parser.on('end', function () { - ended = true -}) - -process.on('exit', function () { - it(called).equal(1) - console.error('PASSED') -}) \ No newline at end of file diff --git a/deps/npm/node_modules/JSONStream/test/two-ways.js b/deps/npm/node_modules/JSONStream/test/two-ways.js deleted file mode 100644 index 8f3b89c8bfe6ec..00000000000000 --- a/deps/npm/node_modules/JSONStream/test/two-ways.js +++ /dev/null @@ -1,41 +0,0 @@ - -var fs = require ('fs') - , join = require('path').join - , file = join(__dirname, 'fixtures','all_npm.json') - , JSONStream = require('../') - , it = require('it-is').style('colour') - - function randomObj () { - return ( - Math.random () < 0.4 - ? {hello: 'eonuhckmqjk', - whatever: 236515, - lies: true, - nothing: [null], -// stuff: [Math.random(),Math.random(),Math.random()] - } - : ['AOREC', 'reoubaor', {ouec: 62642}, [[[], {}, 53]]] - ) - } - -var expected = [] - , stringify = JSONStream.stringify() - , es = require('event-stream') - , stringified = '' - , called = 0 - , count = 10 - , ended = false - -while (count --) - expected.push(randomObj()) - - es.connect( - es.readArray(expected), - stringify, - JSONStream.parse([/./]), - es.writeArray(function (err, lines) { - - it(lines).has(expected) - console.error('PASSED') - }) - ) diff --git a/deps/npm/node_modules/abbrev/package.json b/deps/npm/node_modules/abbrev/package.json index 4c05db1efe758f..bf4e8015bba9d5 100644 --- a/deps/npm/node_modules/abbrev/package.json +++ b/deps/npm/node_modules/abbrev/package.json @@ -1,61 +1,21 @@ { - "_args": [ - [ - "abbrev@1.1.1", - "/Users/rebecca/code/npm" - ] - ], - "_from": "abbrev@1.1.1", - "_id": "abbrev@1.1.1", - "_inBundle": false, - "_integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==", - "_location": "/abbrev", - "_phantomChildren": {}, - "_requested": { - "type": "version", - "registry": true, - "raw": "abbrev@1.1.1", - "name": "abbrev", - "escapedName": "abbrev", - "rawSpec": "1.1.1", - "saveSpec": null, - "fetchSpec": "1.1.1" - }, - "_requiredBy": [ - "/", - "/node-gyp/nopt", - "/nopt" - ], - "_resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", - "_spec": "1.1.1", - "_where": "/Users/rebecca/code/npm", - "author": { - "name": "Isaac Z. Schlueter", - "email": "i@izs.me" - }, - "bugs": { - "url": "https://github.com/isaacs/abbrev-js/issues" - }, + "name": "abbrev", + "version": "1.1.1", "description": "Like ruby's abbrev module, but in js", + "author": "Isaac Z. Schlueter ", + "main": "abbrev.js", + "scripts": { + "test": "tap test.js --100", + "preversion": "npm test", + "postversion": "npm publish", + "postpublish": "git push origin --all; git push origin --tags" + }, + "repository": "http://github.com/isaacs/abbrev-js", + "license": "ISC", "devDependencies": { "tap": "^10.1" }, "files": [ "abbrev.js" - ], - "homepage": "https://github.com/isaacs/abbrev-js#readme", - "license": "ISC", - "main": "abbrev.js", - "name": "abbrev", - "repository": { - "type": "git", - "url": "git+ssh://git@github.com/isaacs/abbrev-js.git" - }, - "scripts": { - "postpublish": "git push origin --all; git push origin --tags", - "postversion": "npm publish", - "preversion": "npm test", - "test": "tap test.js --100" - }, - "version": "1.1.1" + ] } diff --git a/deps/npm/node_modules/agent-base/.travis.yml b/deps/npm/node_modules/agent-base/.travis.yml deleted file mode 100644 index 76200951f0450b..00000000000000 --- a/deps/npm/node_modules/agent-base/.travis.yml +++ /dev/null @@ -1,24 +0,0 @@ -sudo: false - -language: node_js - -node_js: - - "4" - - "5" - - "6" - - "7" - - "8" - - "9" - - "10" - -install: - - PATH="`npm bin`:`npm bin -g`:$PATH" - # Install dependencies and build - - npm install - -script: - # Output useful info for debugging - - node --version - - npm --version - # Run tests - - npm test diff --git a/deps/npm/node_modules/agent-base/History.md b/deps/npm/node_modules/agent-base/History.md deleted file mode 100644 index 80c88dc401f960..00000000000000 --- a/deps/npm/node_modules/agent-base/History.md +++ /dev/null @@ -1,113 +0,0 @@ - -4.2.0 / 2018-01-15 -================== - - * Add support for returning an `http.Agent` instance - * Optimize promisifying logic - * Set `timeout` to null for proper cleanup - * Remove Node.js <= 0.11.3 special-casing from test case - -4.1.2 / 2017-11-20 -================== - - * test Node 9 on Travis - * ensure that `https.get()` uses the patched `https.request()` - -4.1.1 / 2017-07-20 -================== - - * Correct `https.request()` with a String (#9) - -4.1.0 / 2017-06-26 -================== - - * mix in Agent options into Request options - * throw when nothing is returned from agent-base callback - * do not modify the options object for https requests - -4.0.1 / 2017-06-13 -================== - - * add `this` context tests and fixes - -4.0.0 / 2017-06-06 -================== - - * drop support for Node.js < 4 - * drop old versions of Node.js from Travis-CI - * specify Node.js >= 4.0.0 in `engines.node` - * remove more old code - * remove "extend" dependency - * remove "semver" dependency - * make the Promise logic a bit cleaner - * add async function pseudo-example to README - * use direct return in README example - -3.0.0 / 2017-06-02 -================== - - * drop support for Node.js v0.8 and v0.10 - * add support for async, Promises, and direct return - * add a couple `options` test cases - * implement a `"timeout"` option - * rename main file to `index.js` - * test Node 8 on Travis - -2.1.1 / 2017-05-30 -================== - - * Revert [`fe2162e`](https://github.com/TooTallNate/node-agent-base/commit/fe2162e0ba18123f5b301cba4de1e9dd74e437cd) and [`270bdc9`](https://github.com/TooTallNate/node-agent-base/commit/270bdc92eb8e3bd0444d1e5266e8e9390aeb3095) (fixes #7) - -2.1.0 / 2017-05-26 -================== - - * unref is not supported for node < 0.9.1 (@pi0) - * add tests to dangling socket (@pi0) - * check unref() is supported (@pi0) - * fix dangling sockets problem (@pi0) - * add basic "ws" module tests - * make `Agent` be subclassable - * turn `addRequest()` into a named function - * test: Node.js v4 likes to call `cork` on the stream (#3, @tomhughes) - * travis: test node v4, v5, v6 and v7 - -2.0.1 / 2015-09-10 -================== - - * package: update "semver" to v5.0.1 for WebPack (#1, @vhpoet) - -2.0.0 / 2015-07-10 -================== - - * refactor to patch Node.js core for more consistent `opts` values - * ensure that HTTP(s) default port numbers are always given - * test: use ssl-cert-snakeoil SSL certs - * test: add tests for arbitrary options - * README: add API section - * README: make the Agent HTTP/HTTPS generic in the example - * README: use SVG for Travis-CI badge - -1.0.2 / 2015-06-27 -================== - - * agent: set `req._hadError` to true after emitting "error" - * package: update "mocha" to v2 - * test: add artificial HTTP GET request test - * test: add artificial data events test - * test: fix artifical GET response test on node > v0.11.3 - * test: use a real timeout for the async error test - -1.0.1 / 2013-09-09 -================== - - * Fix passing an "error" object to the callback function on the first tick - -1.0.0 / 2013-09-09 -================== - - * New API: now you pass a callback function directly - -0.0.1 / 2013-07-09 -================== - - * Initial release diff --git a/deps/npm/node_modules/agent-base/README.md b/deps/npm/node_modules/agent-base/README.md index dbeceab8a125f6..d791f000566abf 100644 --- a/deps/npm/node_modules/agent-base/README.md +++ b/deps/npm/node_modules/agent-base/README.md @@ -1,7 +1,7 @@ agent-base ========== ### Turn a function into an [`http.Agent`][http.Agent] instance -[![Build Status](https://travis-ci.org/TooTallNate/node-agent-base.svg?branch=master)](https://travis-ci.org/TooTallNate/node-agent-base) +[![Build Status](https://github.com/TooTallNate/node-agent-base/workflows/Node%20CI/badge.svg)](https://github.com/TooTallNate/node-agent-base/actions?workflow=Node+CI) This module provides an `http.Agent` generator. That is, you pass it an async callback function, and it returns a new `http.Agent` instance that will invoke the diff --git a/deps/npm/node_modules/agent-base/dist/src/index.d.ts b/deps/npm/node_modules/agent-base/dist/src/index.d.ts new file mode 100644 index 00000000000000..8c8ea4eb2e82ea --- /dev/null +++ b/deps/npm/node_modules/agent-base/dist/src/index.d.ts @@ -0,0 +1,74 @@ +/// +import net from 'net'; +import http from 'http'; +import https from 'https'; +import { Duplex } from 'stream'; +import { EventEmitter } from 'events'; +declare function createAgent(opts?: createAgent.AgentOptions): createAgent.Agent; +declare function createAgent(callback: createAgent.AgentCallback, opts?: createAgent.AgentOptions): createAgent.Agent; +declare namespace createAgent { + interface ClientRequest extends http.ClientRequest { + _last?: boolean; + _hadError?: boolean; + method: string; + } + interface AgentRequestOptions { + host?: string; + path?: string; + port: number; + } + interface HttpRequestOptions extends AgentRequestOptions, Omit { + secureEndpoint: false; + } + interface HttpsRequestOptions extends AgentRequestOptions, Omit { + secureEndpoint: true; + } + type RequestOptions = HttpRequestOptions | HttpsRequestOptions; + type AgentLike = Pick | http.Agent; + type AgentCallbackReturn = Duplex | AgentLike; + type AgentCallbackCallback = (err?: Error | null, socket?: createAgent.AgentCallbackReturn) => void; + type AgentCallbackPromise = (req: createAgent.ClientRequest, opts: createAgent.RequestOptions) => createAgent.AgentCallbackReturn | Promise; + type AgentCallback = typeof Agent.prototype.callback; + type AgentOptions = { + timeout?: number; + }; + /** + * Base `http.Agent` implementation. + * No pooling/keep-alive is implemented by default. + * + * @param {Function} callback + * @api public + */ + class Agent extends EventEmitter { + timeout: number | null; + maxFreeSockets: number; + maxSockets: number; + sockets: { + [key: string]: net.Socket[]; + }; + requests: { + [key: string]: http.IncomingMessage[]; + }; + options: https.AgentOptions; + private promisifiedCallback?; + private explicitDefaultPort?; + private explicitProtocol?; + constructor(callback?: createAgent.AgentCallback | createAgent.AgentOptions, _opts?: createAgent.AgentOptions); + get defaultPort(): number; + set defaultPort(v: number); + get protocol(): string; + set protocol(v: string); + callback(req: createAgent.ClientRequest, opts: createAgent.RequestOptions, fn: createAgent.AgentCallbackCallback): void; + callback(req: createAgent.ClientRequest, opts: createAgent.RequestOptions): createAgent.AgentCallbackReturn | Promise; + /** + * Called by node-core's "_http_client.js" module when creating + * a new HTTP request with this Agent instance. + * + * @api public + */ + addRequest(req: ClientRequest, _opts: RequestOptions): void; + freeSocket(socket: net.Socket, opts: AgentOptions): void; + destroy(): void; + } +} +export = createAgent; diff --git a/deps/npm/node_modules/agent-base/dist/src/index.js b/deps/npm/node_modules/agent-base/dist/src/index.js new file mode 100644 index 00000000000000..0467bf0b0aec59 --- /dev/null +++ b/deps/npm/node_modules/agent-base/dist/src/index.js @@ -0,0 +1,201 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +const events_1 = require("events"); +const debug_1 = __importDefault(require("debug")); +const promisify_1 = __importDefault(require("./promisify")); +const debug = debug_1.default('agent-base'); +function isAgent(v) { + return Boolean(v) && typeof v.addRequest === 'function'; +} +function isSecureEndpoint() { + const { stack } = new Error(); + if (typeof stack !== 'string') + return false; + return stack.split('\n').some(l => l.indexOf('(https.js:') !== -1); +} +function createAgent(callback, opts) { + return new createAgent.Agent(callback, opts); +} +(function (createAgent) { + /** + * Base `http.Agent` implementation. + * No pooling/keep-alive is implemented by default. + * + * @param {Function} callback + * @api public + */ + class Agent extends events_1.EventEmitter { + constructor(callback, _opts) { + super(); + let opts = _opts; + if (typeof callback === 'function') { + this.callback = callback; + } + else if (callback) { + opts = callback; + } + // Timeout for the socket to be returned from the callback + this.timeout = null; + if (opts && typeof opts.timeout === 'number') { + this.timeout = opts.timeout; + } + // These aren't actually used by `agent-base`, but are required + // for the TypeScript definition files in `@types/node` :/ + this.maxFreeSockets = 1; + this.maxSockets = 1; + this.sockets = {}; + this.requests = {}; + this.options = {}; + } + get defaultPort() { + if (typeof this.explicitDefaultPort === 'number') { + return this.explicitDefaultPort; + } + return isSecureEndpoint() ? 443 : 80; + } + set defaultPort(v) { + this.explicitDefaultPort = v; + } + get protocol() { + if (typeof this.explicitProtocol === 'string') { + return this.explicitProtocol; + } + return isSecureEndpoint() ? 'https:' : 'http:'; + } + set protocol(v) { + this.explicitProtocol = v; + } + callback(req, opts, fn) { + throw new Error('"agent-base" has no default implementation, you must subclass and override `callback()`'); + } + /** + * Called by node-core's "_http_client.js" module when creating + * a new HTTP request with this Agent instance. + * + * @api public + */ + addRequest(req, _opts) { + const opts = Object.assign({}, _opts); + if (typeof opts.secureEndpoint !== 'boolean') { + opts.secureEndpoint = isSecureEndpoint(); + } + if (opts.host == null) { + opts.host = 'localhost'; + } + if (opts.port == null) { + opts.port = opts.secureEndpoint ? 443 : 80; + } + if (opts.protocol == null) { + opts.protocol = opts.secureEndpoint ? 'https:' : 'http:'; + } + if (opts.host && opts.path) { + // If both a `host` and `path` are specified then it's most + // likely the result of a `url.parse()` call... we need to + // remove the `path` portion so that `net.connect()` doesn't + // attempt to open that as a unix socket file. + delete opts.path; + } + delete opts.agent; + delete opts.hostname; + delete opts._defaultAgent; + delete opts.defaultPort; + delete opts.createConnection; + // Hint to use "Connection: close" + // XXX: non-documented `http` module API :( + req._last = true; + req.shouldKeepAlive = false; + let timedOut = false; + let timeoutId = null; + const timeoutMs = opts.timeout || this.timeout; + const onerror = (err) => { + if (req._hadError) + return; + req.emit('error', err); + // For Safety. Some additional errors might fire later on + // and we need to make sure we don't double-fire the error event. + req._hadError = true; + }; + const ontimeout = () => { + timeoutId = null; + timedOut = true; + const err = new Error(`A "socket" was not created for HTTP request before ${timeoutMs}ms`); + err.code = 'ETIMEOUT'; + onerror(err); + }; + const callbackError = (err) => { + if (timedOut) + return; + if (timeoutId !== null) { + clearTimeout(timeoutId); + timeoutId = null; + } + onerror(err); + }; + const onsocket = (socket) => { + if (timedOut) + return; + if (timeoutId != null) { + clearTimeout(timeoutId); + timeoutId = null; + } + if (isAgent(socket)) { + // `socket` is actually an `http.Agent` instance, so + // relinquish responsibility for this `req` to the Agent + // from here on + debug('Callback returned another Agent instance %o', socket.constructor.name); + socket.addRequest(req, opts); + return; + } + if (socket) { + socket.once('free', () => { + this.freeSocket(socket, opts); + }); + req.onSocket(socket); + return; + } + const err = new Error(`no Duplex stream was returned to agent-base for \`${req.method} ${req.path}\``); + onerror(err); + }; + if (typeof this.callback !== 'function') { + onerror(new Error('`callback` is not defined')); + return; + } + if (!this.promisifiedCallback) { + if (this.callback.length >= 3) { + debug('Converting legacy callback function to promise'); + this.promisifiedCallback = promisify_1.default(this.callback); + } + else { + this.promisifiedCallback = this.callback; + } + } + if (typeof timeoutMs === 'number' && timeoutMs > 0) { + timeoutId = setTimeout(ontimeout, timeoutMs); + } + if ('port' in opts && typeof opts.port !== 'number') { + opts.port = Number(opts.port); + } + try { + debug('Resolving socket for %o request: %o', opts.protocol, `${req.method} ${req.path}`); + Promise.resolve(this.promisifiedCallback(req, opts)).then(onsocket, callbackError); + } + catch (err) { + Promise.reject(err).catch(callbackError); + } + } + freeSocket(socket, opts) { + debug('Freeing socket %o %o', socket.constructor.name, opts); + socket.destroy(); + } + destroy() { + debug('Destroying agent %o', this.constructor.name); + } + } + createAgent.Agent = Agent; + // So that `instanceof` works correctly + createAgent.prototype = createAgent.Agent.prototype; +})(createAgent || (createAgent = {})); +module.exports = createAgent; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/deps/npm/node_modules/agent-base/dist/src/index.js.map b/deps/npm/node_modules/agent-base/dist/src/index.js.map new file mode 100644 index 00000000000000..dfc8c5cc7b67b1 --- /dev/null +++ b/deps/npm/node_modules/agent-base/dist/src/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;AAIA,mCAAsC;AACtC,kDAAgC;AAChC,4DAAoC;AAEpC,MAAM,KAAK,GAAG,eAAW,CAAC,YAAY,CAAC,CAAC;AAExC,SAAS,OAAO,CAAC,CAAM;IACtB,OAAO,OAAO,CAAC,CAAC,CAAC,IAAI,OAAO,CAAC,CAAC,UAAU,KAAK,UAAU,CAAC;AACzD,CAAC;AAED,SAAS,gBAAgB;IACxB,MAAM,EAAE,KAAK,EAAE,GAAG,IAAI,KAAK,EAAE,CAAC;IAC9B,IAAI,OAAO,KAAK,KAAK,QAAQ;QAAE,OAAO,KAAK,CAAC;IAC5C,OAAO,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;AACpE,CAAC;AAOD,SAAS,WAAW,CACnB,QAA+D,EAC/D,IAA+B;IAE/B,OAAO,IAAI,WAAW,CAAC,KAAK,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;AAC9C,CAAC;AAED,WAAU,WAAW;IAmDpB;;;;;;OAMG;IACH,MAAa,KAAM,SAAQ,qBAAY;QAetC,YACC,QAA+D,EAC/D,KAAgC;YAEhC,KAAK,EAAE,CAAC;YAER,IAAI,IAAI,GAAG,KAAK,CAAC;YACjB,IAAI,OAAO,QAAQ,KAAK,UAAU,EAAE;gBACnC,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;aACzB;iBAAM,IAAI,QAAQ,EAAE;gBACpB,IAAI,GAAG,QAAQ,CAAC;aAChB;YAED,0DAA0D;YAC1D,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC;YACpB,IAAI,IAAI,IAAI,OAAO,IAAI,CAAC,OAAO,KAAK,QAAQ,EAAE;gBAC7C,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC;aAC5B;YAED,+DAA+D;YAC/D,0DAA0D;YAC1D,IAAI,CAAC,cAAc,GAAG,CAAC,CAAC;YACxB,IAAI,CAAC,UAAU,GAAG,CAAC,CAAC;YACpB,IAAI,CAAC,OAAO,GAAG,EAAE,CAAC;YAClB,IAAI,CAAC,QAAQ,GAAG,EAAE,CAAC;YACnB,IAAI,CAAC,OAAO,GAAG,EAAE,CAAC;QACnB,CAAC;QAED,IAAI,WAAW;YACd,IAAI,OAAO,IAAI,CAAC,mBAAmB,KAAK,QAAQ,EAAE;gBACjD,OAAO,IAAI,CAAC,mBAAmB,CAAC;aAChC;YACD,OAAO,gBAAgB,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;QACtC,CAAC;QAED,IAAI,WAAW,CAAC,CAAS;YACxB,IAAI,CAAC,mBAAmB,GAAG,CAAC,CAAC;QAC9B,CAAC;QAED,IAAI,QAAQ;YACX,IAAI,OAAO,IAAI,CAAC,gBAAgB,KAAK,QAAQ,EAAE;gBAC9C,OAAO,IAAI,CAAC,gBAAgB,CAAC;aAC7B;YACD,OAAO,gBAAgB,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC;QAChD,CAAC;QAED,IAAI,QAAQ,CAAC,CAAS;YACrB,IAAI,CAAC,gBAAgB,GAAG,CAAC,CAAC;QAC3B,CAAC;QAaD,QAAQ,CACP,GAA8B,EAC9B,IAA8B,EAC9B,EAAsC;YAKtC,MAAM,IAAI,KAAK,CACd,yFAAyF,CACzF,CAAC;QACH,CAAC;QAED;;;;;WAKG;QACH,UAAU,CAAC,GAAkB,EAAE,KAAqB;YACnD,MAAM,IAAI,qBAAwB,KAAK,CAAE,CAAC;YAE1C,IAAI,OAAO,IAAI,CAAC,cAAc,KAAK,SAAS,EAAE;gBAC7C,IAAI,CAAC,cAAc,GAAG,gBAAgB,EAAE,CAAC;aACzC;YAED,IAAI,IAAI,CAAC,IAAI,IAAI,IAAI,EAAE;gBACtB,IAAI,CAAC,IAAI,GAAG,WAAW,CAAC;aACxB;YAED,IAAI,IAAI,CAAC,IAAI,IAAI,IAAI,EAAE;gBACtB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,cAAc,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;aAC3C;YAED,IAAI,IAAI,CAAC,QAAQ,IAAI,IAAI,EAAE;gBAC1B,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,cAAc,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC;aACzD;YAED,IAAI,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,IAAI,EAAE;gBAC3B,2DAA2D;gBAC3D,0DAA0D;gBAC1D,4DAA4D;gBAC5D,8CAA8C;gBAC9C,OAAO,IAAI,CAAC,IAAI,CAAC;aACjB;YAED,OAAO,IAAI,CAAC,KAAK,CAAC;YAClB,OAAO,IAAI,CAAC,QAAQ,CAAC;YACrB,OAAO,IAAI,CAAC,aAAa,CAAC;YAC1B,OAAO,IAAI,CAAC,WAAW,CAAC;YACxB,OAAO,IAAI,CAAC,gBAAgB,CAAC;YAE7B,kCAAkC;YAClC,2CAA2C;YAC3C,GAAG,CAAC,KAAK,GAAG,IAAI,CAAC;YACjB,GAAG,CAAC,eAAe,GAAG,KAAK,CAAC;YAE5B,IAAI,QAAQ,GAAG,KAAK,CAAC;YACrB,IAAI,SAAS,GAAyC,IAAI,CAAC;YAC3D,MAAM,SAAS,GAAG,IAAI,CAAC,OAAO,IAAI,IAAI,CAAC,OAAO,CAAC;YAE/C,MAAM,OAAO,GAAG,CAAC,GAA0B,EAAE,EAAE;gBAC9C,IAAI,GAAG,CAAC,SAAS;oBAAE,OAAO;gBAC1B,GAAG,CAAC,IAAI,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC;gBACvB,yDAAyD;gBACzD,iEAAiE;gBACjE,GAAG,CAAC,SAAS,GAAG,IAAI,CAAC;YACtB,CAAC,CAAC;YAEF,MAAM,SAAS,GAAG,GAAG,EAAE;gBACtB,SAAS,GAAG,IAAI,CAAC;gBACjB,QAAQ,GAAG,IAAI,CAAC;gBAChB,MAAM,GAAG,GAA0B,IAAI,KAAK,CAC3C,sDAAsD,SAAS,IAAI,CACnE,CAAC;gBACF,GAAG,CAAC,IAAI,GAAG,UAAU,CAAC;gBACtB,OAAO,CAAC,GAAG,CAAC,CAAC;YACd,CAAC,CAAC;YAEF,MAAM,aAAa,GAAG,CAAC,GAA0B,EAAE,EAAE;gBACpD,IAAI,QAAQ;oBAAE,OAAO;gBACrB,IAAI,SAAS,KAAK,IAAI,EAAE;oBACvB,YAAY,CAAC,SAAS,CAAC,CAAC;oBACxB,SAAS,GAAG,IAAI,CAAC;iBACjB;gBACD,OAAO,CAAC,GAAG,CAAC,CAAC;YACd,CAAC,CAAC;YAEF,MAAM,QAAQ,GAAG,CAAC,MAA2B,EAAE,EAAE;gBAChD,IAAI,QAAQ;oBAAE,OAAO;gBACrB,IAAI,SAAS,IAAI,IAAI,EAAE;oBACtB,YAAY,CAAC,SAAS,CAAC,CAAC;oBACxB,SAAS,GAAG,IAAI,CAAC;iBACjB;gBAED,IAAI,OAAO,CAAC,MAAM,CAAC,EAAE;oBACpB,oDAAoD;oBACpD,wDAAwD;oBACxD,eAAe;oBACf,KAAK,CACJ,6CAA6C,EAC7C,MAAM,CAAC,WAAW,CAAC,IAAI,CACvB,CAAC;oBACD,MAA4B,CAAC,UAAU,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;oBACpD,OAAO;iBACP;gBAED,IAAI,MAAM,EAAE;oBACX,MAAM,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,EAAE;wBACxB,IAAI,CAAC,UAAU,CAAC,MAAoB,EAAE,IAAI,CAAC,CAAC;oBAC7C,CAAC,CAAC,CAAC;oBACH,GAAG,CAAC,QAAQ,CAAC,MAAoB,CAAC,CAAC;oBACnC,OAAO;iBACP;gBAED,MAAM,GAAG,GAAG,IAAI,KAAK,CACpB,qDAAqD,GAAG,CAAC,MAAM,IAAI,GAAG,CAAC,IAAI,IAAI,CAC/E,CAAC;gBACF,OAAO,CAAC,GAAG,CAAC,CAAC;YACd,CAAC,CAAC;YAEF,IAAI,OAAO,IAAI,CAAC,QAAQ,KAAK,UAAU,EAAE;gBACxC,OAAO,CAAC,IAAI,KAAK,CAAC,2BAA2B,CAAC,CAAC,CAAC;gBAChD,OAAO;aACP;YAED,IAAI,CAAC,IAAI,CAAC,mBAAmB,EAAE;gBAC9B,IAAI,IAAI,CAAC,QAAQ,CAAC,MAAM,IAAI,CAAC,EAAE;oBAC9B,KAAK,CAAC,gDAAgD,CAAC,CAAC;oBACxD,IAAI,CAAC,mBAAmB,GAAG,mBAAS,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;iBACpD;qBAAM;oBACN,IAAI,CAAC,mBAAmB,GAAG,IAAI,CAAC,QAAQ,CAAC;iBACzC;aACD;YAED,IAAI,OAAO,SAAS,KAAK,QAAQ,IAAI,SAAS,GAAG,CAAC,EAAE;gBACnD,SAAS,GAAG,UAAU,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC;aAC7C;YAED,IAAI,MAAM,IAAI,IAAI,IAAI,OAAO,IAAI,CAAC,IAAI,KAAK,QAAQ,EAAE;gBACpD,IAAI,CAAC,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;aAC9B;YAED,IAAI;gBACH,KAAK,CACJ,qCAAqC,EACrC,IAAI,CAAC,QAAQ,EACb,GAAG,GAAG,CAAC,MAAM,IAAI,GAAG,CAAC,IAAI,EAAE,CAC3B,CAAC;gBACF,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,mBAAmB,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC,CAAC,IAAI,CACxD,QAAQ,EACR,aAAa,CACb,CAAC;aACF;YAAC,OAAO,GAAG,EAAE;gBACb,OAAO,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC;aACzC;QACF,CAAC;QAED,UAAU,CAAC,MAAkB,EAAE,IAAkB;YAChD,KAAK,CAAC,sBAAsB,EAAE,MAAM,CAAC,WAAW,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;YAC7D,MAAM,CAAC,OAAO,EAAE,CAAC;QAClB,CAAC;QAED,OAAO;YACN,KAAK,CAAC,qBAAqB,EAAE,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;QACrD,CAAC;KACD;IAlPY,iBAAK,QAkPjB,CAAA;IAED,uCAAuC;IACvC,WAAW,CAAC,SAAS,GAAG,WAAW,CAAC,KAAK,CAAC,SAAS,CAAC;AACrD,CAAC,EAhTS,WAAW,KAAX,WAAW,QAgTpB;AAED,iBAAS,WAAW,CAAC"} \ No newline at end of file diff --git a/deps/npm/node_modules/agent-base/dist/src/promisify.d.ts b/deps/npm/node_modules/agent-base/dist/src/promisify.d.ts new file mode 100644 index 00000000000000..02688696fb4c1a --- /dev/null +++ b/deps/npm/node_modules/agent-base/dist/src/promisify.d.ts @@ -0,0 +1,4 @@ +import { ClientRequest, RequestOptions, AgentCallbackCallback, AgentCallbackPromise } from './index'; +declare type LegacyCallback = (req: ClientRequest, opts: RequestOptions, fn: AgentCallbackCallback) => void; +export default function promisify(fn: LegacyCallback): AgentCallbackPromise; +export {}; diff --git a/deps/npm/node_modules/agent-base/dist/src/promisify.js b/deps/npm/node_modules/agent-base/dist/src/promisify.js new file mode 100644 index 00000000000000..b2f6132a7beaa5 --- /dev/null +++ b/deps/npm/node_modules/agent-base/dist/src/promisify.js @@ -0,0 +1,18 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +function promisify(fn) { + return function (req, opts) { + return new Promise((resolve, reject) => { + fn.call(this, req, opts, (err, rtn) => { + if (err) { + reject(err); + } + else { + resolve(rtn); + } + }); + }); + }; +} +exports.default = promisify; +//# sourceMappingURL=promisify.js.map \ No newline at end of file diff --git a/deps/npm/node_modules/agent-base/dist/src/promisify.js.map b/deps/npm/node_modules/agent-base/dist/src/promisify.js.map new file mode 100644 index 00000000000000..4bff9bfcfa2899 --- /dev/null +++ b/deps/npm/node_modules/agent-base/dist/src/promisify.js.map @@ -0,0 +1 @@ +{"version":3,"file":"promisify.js","sourceRoot":"","sources":["../../src/promisify.ts"],"names":[],"mappings":";;AAeA,SAAwB,SAAS,CAAC,EAAkB;IACnD,OAAO,UAAsB,GAAkB,EAAE,IAAoB;QACpE,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;YACtC,EAAE,CAAC,IAAI,CACN,IAAI,EACJ,GAAG,EACH,IAAI,EACJ,CAAC,GAA6B,EAAE,GAAyB,EAAE,EAAE;gBAC5D,IAAI,GAAG,EAAE;oBACR,MAAM,CAAC,GAAG,CAAC,CAAC;iBACZ;qBAAM;oBACN,OAAO,CAAC,GAAG,CAAC,CAAC;iBACb;YACF,CAAC,CACD,CAAC;QACH,CAAC,CAAC,CAAC;IACJ,CAAC,CAAC;AACH,CAAC;AAjBD,4BAiBC"} \ No newline at end of file diff --git a/deps/npm/node_modules/agent-base/index.d.ts b/deps/npm/node_modules/agent-base/index.d.ts deleted file mode 100644 index ff6788bdc77c65..00000000000000 --- a/deps/npm/node_modules/agent-base/index.d.ts +++ /dev/null @@ -1,43 +0,0 @@ -// Type definitions for agent-base 4.2.1 -// Project: https://github.com/TooTallNate/node-agent-base -// Definitions by: Christopher Quadflieg - -/// -import { EventEmitter } from 'events'; - -declare namespace Agent { - export type AgentCallback = ( - req?: any, - opts?: { - secureEndpoint: boolean; - } - ) => void; - - export interface AgentOptions { - timeout?: number; - host?: string; - port?: number; - [key: string]: any; - } - - export interface Agent extends EventEmitter { - _promisifiedCallback: boolean; - timeout: number | null; - options?: AgentOptions; - callback: AgentCallback; - addRequest: (req?: any, opts?: any) => void; - freeSocket: (socket: any, opts: any) => void; - } -} - -/** - * Base `http.Agent` implementation. - * No pooling/keep-alive is implemented by default. - */ -declare function Agent(opts?: Agent.AgentOptions): Agent.Agent; -declare function Agent( - callback: Agent.AgentCallback, - opts?: Agent.AgentOptions -): Agent.Agent; - -export = Agent; diff --git a/deps/npm/node_modules/agent-base/index.js b/deps/npm/node_modules/agent-base/index.js deleted file mode 100644 index 0ee6b29699a670..00000000000000 --- a/deps/npm/node_modules/agent-base/index.js +++ /dev/null @@ -1,170 +0,0 @@ -'use strict'; -require('./patch-core'); -const inherits = require('util').inherits; -const promisify = require('es6-promisify'); -const EventEmitter = require('events').EventEmitter; - -module.exports = Agent; - -function isAgent(v) { - return v && typeof v.addRequest === 'function'; -} - -/** - * Base `http.Agent` implementation. - * No pooling/keep-alive is implemented by default. - * - * @param {Function} callback - * @api public - */ -function Agent(callback, _opts) { - if (!(this instanceof Agent)) { - return new Agent(callback, _opts); - } - - EventEmitter.call(this); - - // The callback gets promisified if it has 3 parameters - // (i.e. it has a callback function) lazily - this._promisifiedCallback = false; - - let opts = _opts; - if ('function' === typeof callback) { - this.callback = callback; - } else if (callback) { - opts = callback; - } - - // timeout for the socket to be returned from the callback - this.timeout = (opts && opts.timeout) || null; - - this.options = opts; -} -inherits(Agent, EventEmitter); - -/** - * Override this function in your subclass! - */ -Agent.prototype.callback = function callback(req, opts) { - throw new Error( - '"agent-base" has no default implementation, you must subclass and override `callback()`' - ); -}; - -/** - * Called by node-core's "_http_client.js" module when creating - * a new HTTP request with this Agent instance. - * - * @api public - */ -Agent.prototype.addRequest = function addRequest(req, _opts) { - const ownOpts = Object.assign({}, _opts); - - // Set default `host` for HTTP to localhost - if (null == ownOpts.host) { - ownOpts.host = 'localhost'; - } - - // Set default `port` for HTTP if none was explicitly specified - if (null == ownOpts.port) { - ownOpts.port = ownOpts.secureEndpoint ? 443 : 80; - } - - const opts = Object.assign({}, this.options, ownOpts); - - if (opts.host && opts.path) { - // If both a `host` and `path` are specified then it's most likely the - // result of a `url.parse()` call... we need to remove the `path` portion so - // that `net.connect()` doesn't attempt to open that as a unix socket file. - delete opts.path; - } - - delete opts.agent; - delete opts.hostname; - delete opts._defaultAgent; - delete opts.defaultPort; - delete opts.createConnection; - - // Hint to use "Connection: close" - // XXX: non-documented `http` module API :( - req._last = true; - req.shouldKeepAlive = false; - - // Create the `stream.Duplex` instance - let timeout; - let timedOut = false; - const timeoutMs = this.timeout; - const freeSocket = this.freeSocket; - - function onerror(err) { - if (req._hadError) return; - req.emit('error', err); - // For Safety. Some additional errors might fire later on - // and we need to make sure we don't double-fire the error event. - req._hadError = true; - } - - function ontimeout() { - timeout = null; - timedOut = true; - const err = new Error( - 'A "socket" was not created for HTTP request before ' + timeoutMs + 'ms' - ); - err.code = 'ETIMEOUT'; - onerror(err); - } - - function callbackError(err) { - if (timedOut) return; - if (timeout != null) { - clearTimeout(timeout); - timeout = null; - } - onerror(err); - } - - function onsocket(socket) { - if (timedOut) return; - if (timeout != null) { - clearTimeout(timeout); - timeout = null; - } - if (isAgent(socket)) { - // `socket` is actually an http.Agent instance, so relinquish - // responsibility for this `req` to the Agent from here on - socket.addRequest(req, opts); - } else if (socket) { - function onfree() { - freeSocket(socket, opts); - } - socket.on('free', onfree); - req.onSocket(socket); - } else { - const err = new Error( - 'no Duplex stream was returned to agent-base for `' + req.method + ' ' + req.path + '`' - ); - onerror(err); - } - } - - if (!this._promisifiedCallback && this.callback.length >= 3) { - // Legacy callback function - convert to a Promise - this.callback = promisify(this.callback, this); - this._promisifiedCallback = true; - } - - if (timeoutMs > 0) { - timeout = setTimeout(ontimeout, timeoutMs); - } - - try { - Promise.resolve(this.callback(req, opts)).then(onsocket, callbackError); - } catch (err) { - Promise.reject(err).catch(callbackError); - } -}; - -Agent.prototype.freeSocket = function freeSocket(socket, opts) { - // TODO reuse sockets - socket.destroy(); -}; diff --git a/deps/npm/node_modules/agent-base/package.json b/deps/npm/node_modules/agent-base/package.json index 70da68723410f2..17c81217fde022 100644 --- a/deps/npm/node_modules/agent-base/package.json +++ b/deps/npm/node_modules/agent-base/package.json @@ -1,52 +1,25 @@ { - "_from": "agent-base@4", - "_id": "agent-base@4.3.0", - "_inBundle": false, - "_integrity": "sha512-salcGninV0nPrwpGNn4VTXBb1SOuXQBiqbrNXoeizJsHrsL6ERFM2Ne3JUSBWRE6aeNJI2ROP/WEEIDUiDe3cg==", - "_location": "/agent-base", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "agent-base@4", - "name": "agent-base", - "escapedName": "agent-base", - "rawSpec": "4", - "saveSpec": null, - "fetchSpec": "4" - }, - "_requiredBy": [ - "/http-proxy-agent", - "/https-proxy-agent" - ], - "_resolved": "https://registry.npmjs.org/agent-base/-/agent-base-4.3.0.tgz", - "_shasum": "8165f01c436009bccad0b1d122f05ed770efc6ee", - "_spec": "agent-base@4", - "_where": "/Users/isaacs/dev/npm/cli/node_modules/http-proxy-agent", - "author": { - "name": "Nathan Rajlich", - "email": "nathan@tootallnate.net", - "url": "http://n8.io/" - }, - "bugs": { - "url": "https://github.com/TooTallNate/node-agent-base/issues" - }, - "bundleDependencies": false, - "dependencies": { - "es6-promisify": "^5.0.0" - }, - "deprecated": false, + "name": "agent-base", + "version": "6.0.1", "description": "Turn a function into an `http.Agent` instance", - "devDependencies": { - "@types/es6-promisify": "^5.0.0", - "@types/node": "^10.5.3", - "mocha": "^3.4.2", - "ws": "^3.0.0" + "main": "dist/src/index", + "typings": "dist/src/index", + "files": [ + "dist/src", + "src" + ], + "scripts": { + "prebuild": "rimraf dist", + "build": "tsc", + "postbuild": "cpy --parents src test '!**/*.ts' dist", + "test": "mocha --reporter spec dist/test/*.js", + "test-lint": "eslint src --ext .js,.ts", + "prepublishOnly": "npm run build" }, - "engines": { - "node": ">= 4.0.0" + "repository": { + "type": "git", + "url": "git://github.com/TooTallNate/node-agent-base.git" }, - "homepage": "https://github.com/TooTallNate/node-agent-base#readme", "keywords": [ "http", "agent", @@ -54,15 +27,38 @@ "barebones", "https" ], + "author": "Nathan Rajlich (http://n8.io/)", "license": "MIT", - "main": "./index.js", - "name": "agent-base", - "repository": { - "type": "git", - "url": "git://github.com/TooTallNate/node-agent-base.git" + "bugs": { + "url": "https://github.com/TooTallNate/node-agent-base/issues" }, - "scripts": { - "test": "mocha --reporter spec" + "dependencies": { + "debug": "4" }, - "version": "4.3.0" + "devDependencies": { + "@types/debug": "4", + "@types/mocha": "^5.2.7", + "@types/node": "^12.12.17", + "@types/semver": "^7.1.0", + "@types/ws": "^6.0.3", + "@typescript-eslint/eslint-plugin": "1.6.0", + "@typescript-eslint/parser": "1.1.0", + "async-listen": "^1.2.0", + "cpy-cli": "^2.0.0", + "eslint": "5.16.0", + "eslint-config-airbnb": "17.1.0", + "eslint-config-prettier": "4.1.0", + "eslint-import-resolver-typescript": "1.1.1", + "eslint-plugin-import": "2.16.0", + "eslint-plugin-jsx-a11y": "6.2.1", + "eslint-plugin-react": "7.12.4", + "mocha": "^6.2.0", + "rimraf": "^3.0.0", + "semver": "^7.1.2", + "typescript": "^3.5.3", + "ws": "^3.0.0" + }, + "engines": { + "node": ">= 6.0.0" + } } diff --git a/deps/npm/node_modules/agent-base/patch-core.js b/deps/npm/node_modules/agent-base/patch-core.js deleted file mode 100644 index 21cbbb6753bdf4..00000000000000 --- a/deps/npm/node_modules/agent-base/patch-core.js +++ /dev/null @@ -1,51 +0,0 @@ -'use strict'; -const url = require('url'); -const https = require('https'); - -/** - * This currently needs to be applied to all Node.js versions - * in order to determine if the `req` is an HTTP or HTTPS request. - * - * There is currently no PR attempting to move this property upstream. - */ -const patchMarker = "__agent_base_https_request_patched__"; -if (!https.request[patchMarker]) { - https.request = (function(request) { - return function(_options, cb) { - let options; - if (typeof _options === 'string') { - options = url.parse(_options); - } else { - options = Object.assign({}, _options); - } - if (null == options.port) { - options.port = 443; - } - options.secureEndpoint = true; - return request.call(https, options, cb); - }; - })(https.request); - https.request[patchMarker] = true; -} - -/** - * This is needed for Node.js >= 9.0.0 to make sure `https.get()` uses the - * patched `https.request()`. - * - * Ref: https://github.com/nodejs/node/commit/5118f31 - */ -https.get = function (_url, _options, cb) { - let options; - if (typeof _url === 'string' && _options && typeof _options !== 'function') { - options = Object.assign({}, url.parse(_url), _options); - } else if (!_options && !cb) { - options = _url; - } else if (!cb) { - options = _url; - cb = _options; - } - - const req = https.request(options, cb); - req.end(); - return req; -}; diff --git a/deps/npm/node_modules/agent-base/src/index.ts b/deps/npm/node_modules/agent-base/src/index.ts new file mode 100644 index 00000000000000..870e3be2ccb10b --- /dev/null +++ b/deps/npm/node_modules/agent-base/src/index.ts @@ -0,0 +1,339 @@ +import net from 'net'; +import http from 'http'; +import https from 'https'; +import { Duplex } from 'stream'; +import { EventEmitter } from 'events'; +import createDebug from 'debug'; +import promisify from './promisify'; + +const debug = createDebug('agent-base'); + +function isAgent(v: any): v is createAgent.AgentLike { + return Boolean(v) && typeof v.addRequest === 'function'; +} + +function isSecureEndpoint(): boolean { + const { stack } = new Error(); + if (typeof stack !== 'string') return false; + return stack.split('\n').some(l => l.indexOf('(https.js:') !== -1); +} + +function createAgent(opts?: createAgent.AgentOptions): createAgent.Agent; +function createAgent( + callback: createAgent.AgentCallback, + opts?: createAgent.AgentOptions +): createAgent.Agent; +function createAgent( + callback?: createAgent.AgentCallback | createAgent.AgentOptions, + opts?: createAgent.AgentOptions +) { + return new createAgent.Agent(callback, opts); +} + +namespace createAgent { + export interface ClientRequest extends http.ClientRequest { + _last?: boolean; + _hadError?: boolean; + method: string; + } + + export interface AgentRequestOptions { + host?: string; + path?: string; + // `port` on `http.RequestOptions` can be a string or undefined, + // but `net.TcpNetConnectOpts` expects only a number + port: number; + } + + export interface HttpRequestOptions + extends AgentRequestOptions, + Omit { + secureEndpoint: false; + } + + export interface HttpsRequestOptions + extends AgentRequestOptions, + Omit { + secureEndpoint: true; + } + + export type RequestOptions = HttpRequestOptions | HttpsRequestOptions; + + export type AgentLike = Pick | http.Agent; + + export type AgentCallbackReturn = Duplex | AgentLike; + + export type AgentCallbackCallback = ( + err?: Error | null, + socket?: createAgent.AgentCallbackReturn + ) => void; + + export type AgentCallbackPromise = ( + req: createAgent.ClientRequest, + opts: createAgent.RequestOptions + ) => + | createAgent.AgentCallbackReturn + | Promise; + + export type AgentCallback = typeof Agent.prototype.callback; + + export type AgentOptions = { + timeout?: number; + }; + + /** + * Base `http.Agent` implementation. + * No pooling/keep-alive is implemented by default. + * + * @param {Function} callback + * @api public + */ + export class Agent extends EventEmitter { + public timeout: number | null; + public maxFreeSockets: number; + public maxSockets: number; + public sockets: { + [key: string]: net.Socket[]; + }; + public requests: { + [key: string]: http.IncomingMessage[]; + }; + public options: https.AgentOptions; + private promisifiedCallback?: createAgent.AgentCallbackPromise; + private explicitDefaultPort?: number; + private explicitProtocol?: string; + + constructor( + callback?: createAgent.AgentCallback | createAgent.AgentOptions, + _opts?: createAgent.AgentOptions + ) { + super(); + + let opts = _opts; + if (typeof callback === 'function') { + this.callback = callback; + } else if (callback) { + opts = callback; + } + + // Timeout for the socket to be returned from the callback + this.timeout = null; + if (opts && typeof opts.timeout === 'number') { + this.timeout = opts.timeout; + } + + // These aren't actually used by `agent-base`, but are required + // for the TypeScript definition files in `@types/node` :/ + this.maxFreeSockets = 1; + this.maxSockets = 1; + this.sockets = {}; + this.requests = {}; + this.options = {}; + } + + get defaultPort(): number { + if (typeof this.explicitDefaultPort === 'number') { + return this.explicitDefaultPort; + } + return isSecureEndpoint() ? 443 : 80; + } + + set defaultPort(v: number) { + this.explicitDefaultPort = v; + } + + get protocol(): string { + if (typeof this.explicitProtocol === 'string') { + return this.explicitProtocol; + } + return isSecureEndpoint() ? 'https:' : 'http:'; + } + + set protocol(v: string) { + this.explicitProtocol = v; + } + + callback( + req: createAgent.ClientRequest, + opts: createAgent.RequestOptions, + fn: createAgent.AgentCallbackCallback + ): void; + callback( + req: createAgent.ClientRequest, + opts: createAgent.RequestOptions + ): + | createAgent.AgentCallbackReturn + | Promise; + callback( + req: createAgent.ClientRequest, + opts: createAgent.AgentOptions, + fn?: createAgent.AgentCallbackCallback + ): + | createAgent.AgentCallbackReturn + | Promise + | void { + throw new Error( + '"agent-base" has no default implementation, you must subclass and override `callback()`' + ); + } + + /** + * Called by node-core's "_http_client.js" module when creating + * a new HTTP request with this Agent instance. + * + * @api public + */ + addRequest(req: ClientRequest, _opts: RequestOptions): void { + const opts: RequestOptions = { ..._opts }; + + if (typeof opts.secureEndpoint !== 'boolean') { + opts.secureEndpoint = isSecureEndpoint(); + } + + if (opts.host == null) { + opts.host = 'localhost'; + } + + if (opts.port == null) { + opts.port = opts.secureEndpoint ? 443 : 80; + } + + if (opts.protocol == null) { + opts.protocol = opts.secureEndpoint ? 'https:' : 'http:'; + } + + if (opts.host && opts.path) { + // If both a `host` and `path` are specified then it's most + // likely the result of a `url.parse()` call... we need to + // remove the `path` portion so that `net.connect()` doesn't + // attempt to open that as a unix socket file. + delete opts.path; + } + + delete opts.agent; + delete opts.hostname; + delete opts._defaultAgent; + delete opts.defaultPort; + delete opts.createConnection; + + // Hint to use "Connection: close" + // XXX: non-documented `http` module API :( + req._last = true; + req.shouldKeepAlive = false; + + let timedOut = false; + let timeoutId: ReturnType | null = null; + const timeoutMs = opts.timeout || this.timeout; + + const onerror = (err: NodeJS.ErrnoException) => { + if (req._hadError) return; + req.emit('error', err); + // For Safety. Some additional errors might fire later on + // and we need to make sure we don't double-fire the error event. + req._hadError = true; + }; + + const ontimeout = () => { + timeoutId = null; + timedOut = true; + const err: NodeJS.ErrnoException = new Error( + `A "socket" was not created for HTTP request before ${timeoutMs}ms` + ); + err.code = 'ETIMEOUT'; + onerror(err); + }; + + const callbackError = (err: NodeJS.ErrnoException) => { + if (timedOut) return; + if (timeoutId !== null) { + clearTimeout(timeoutId); + timeoutId = null; + } + onerror(err); + }; + + const onsocket = (socket: AgentCallbackReturn) => { + if (timedOut) return; + if (timeoutId != null) { + clearTimeout(timeoutId); + timeoutId = null; + } + + if (isAgent(socket)) { + // `socket` is actually an `http.Agent` instance, so + // relinquish responsibility for this `req` to the Agent + // from here on + debug( + 'Callback returned another Agent instance %o', + socket.constructor.name + ); + (socket as createAgent.Agent).addRequest(req, opts); + return; + } + + if (socket) { + socket.once('free', () => { + this.freeSocket(socket as net.Socket, opts); + }); + req.onSocket(socket as net.Socket); + return; + } + + const err = new Error( + `no Duplex stream was returned to agent-base for \`${req.method} ${req.path}\`` + ); + onerror(err); + }; + + if (typeof this.callback !== 'function') { + onerror(new Error('`callback` is not defined')); + return; + } + + if (!this.promisifiedCallback) { + if (this.callback.length >= 3) { + debug('Converting legacy callback function to promise'); + this.promisifiedCallback = promisify(this.callback); + } else { + this.promisifiedCallback = this.callback; + } + } + + if (typeof timeoutMs === 'number' && timeoutMs > 0) { + timeoutId = setTimeout(ontimeout, timeoutMs); + } + + if ('port' in opts && typeof opts.port !== 'number') { + opts.port = Number(opts.port); + } + + try { + debug( + 'Resolving socket for %o request: %o', + opts.protocol, + `${req.method} ${req.path}` + ); + Promise.resolve(this.promisifiedCallback(req, opts)).then( + onsocket, + callbackError + ); + } catch (err) { + Promise.reject(err).catch(callbackError); + } + } + + freeSocket(socket: net.Socket, opts: AgentOptions) { + debug('Freeing socket %o %o', socket.constructor.name, opts); + socket.destroy(); + } + + destroy() { + debug('Destroying agent %o', this.constructor.name); + } + } + + // So that `instanceof` works correctly + createAgent.prototype = createAgent.Agent.prototype; +} + +export = createAgent; diff --git a/deps/npm/node_modules/agent-base/src/promisify.ts b/deps/npm/node_modules/agent-base/src/promisify.ts new file mode 100644 index 00000000000000..60cc6627100b81 --- /dev/null +++ b/deps/npm/node_modules/agent-base/src/promisify.ts @@ -0,0 +1,33 @@ +import { + Agent, + ClientRequest, + RequestOptions, + AgentCallbackCallback, + AgentCallbackPromise, + AgentCallbackReturn +} from './index'; + +type LegacyCallback = ( + req: ClientRequest, + opts: RequestOptions, + fn: AgentCallbackCallback +) => void; + +export default function promisify(fn: LegacyCallback): AgentCallbackPromise { + return function(this: Agent, req: ClientRequest, opts: RequestOptions) { + return new Promise((resolve, reject) => { + fn.call( + this, + req, + opts, + (err: Error | null | undefined, rtn?: AgentCallbackReturn) => { + if (err) { + reject(err); + } else { + resolve(rtn); + } + } + ); + }); + }; +} diff --git a/deps/npm/node_modules/agent-base/test/ssl-cert-snakeoil.key b/deps/npm/node_modules/agent-base/test/ssl-cert-snakeoil.key deleted file mode 100644 index fd12501220a564..00000000000000 --- a/deps/npm/node_modules/agent-base/test/ssl-cert-snakeoil.key +++ /dev/null @@ -1,15 +0,0 @@ ------BEGIN RSA PRIVATE KEY----- -MIICWwIBAAKBgQCzURxIqzer0ACAbX/lHdsn4Gd9PLKrf7EeDYfIdV0HZKPD8WDr -bBx2/fBu0OW2sjnzv/SVZbJ0DAuPE/p0+eT0qb2qC10iz9iTD7ribd7gxhirVb8y -b3fBjXsxc8V8p4Ny1LcvNSqCjwUbJqdRogfoJeTiqPM58z5sNzuv5iq7iwIDAQAB -AoGAPMQy4olrP0UotlzlJ36bowLP70ffgHCwU+/f4NWs5fF78c3du0oSx1w820Dd -Z7E0JF8bgnlJJTxjumPZz0RUCugrEHBKJmzEz3cxF5E3+7NvteZcjKn9D67RrM5x -1/uSZ9cqKE9cYvY4fSuHx18diyZ4axR/wB1Pea2utjjDM+ECQQDb9ZbmmaWMiRpQ -5Up+loxP7BZNPsEVsm+DVJmEFbaFgGfncWBqSIqnPNjMwTwj0OigTwCAEGPkfRVW -T0pbYWCxAkEA0LK7SCTwzyDmhASUalk0x+3uCAA6ryFdwJf/wd8TRAvVOmkTEldX -uJ7ldLvfrONYO3v56uKTU/SoNdZYzKtO+wJAX2KM4ctXYy5BXztPpr2acz4qHa1N -Bh+vBAC34fOYhyQ76r3b1btHhWZ5jbFuZwm9F2erC94Ps5IaoqcX07DSwQJAPKGw -h2U0EPkd/3zVIZCJJQya+vgWFIs9EZcXVtvYXQyTBkVApTN66MhBIYjzkub5205J -bVQmOV37AKklY1DhwQJAA1wos0cYxro02edzatxd0DIR2r4qqOqLkw6BhYHhq6HJ -ZvIcQkHqdSXzdETFc01I1znDGGIrJHcnvKWgBPoEUg== ------END RSA PRIVATE KEY----- diff --git a/deps/npm/node_modules/agent-base/test/ssl-cert-snakeoil.pem b/deps/npm/node_modules/agent-base/test/ssl-cert-snakeoil.pem deleted file mode 100644 index b115a5e91498de..00000000000000 --- a/deps/npm/node_modules/agent-base/test/ssl-cert-snakeoil.pem +++ /dev/null @@ -1,12 +0,0 @@ ------BEGIN CERTIFICATE----- -MIIB1TCCAT4CCQDV5mPlzm9+izANBgkqhkiG9w0BAQUFADAvMS0wKwYDVQQDEyQ3 -NTI3YmQ3Ny1hYjNlLTQ3NGItYWNlNy1lZWQ2MDUzOTMxZTcwHhcNMTUwNzA2MjI0 -NTA3WhcNMjUwNzAzMjI0NTA3WjAvMS0wKwYDVQQDEyQ3NTI3YmQ3Ny1hYjNlLTQ3 -NGItYWNlNy1lZWQ2MDUzOTMxZTcwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGB -ALNRHEirN6vQAIBtf+Ud2yfgZ308sqt/sR4Nh8h1XQdko8PxYOtsHHb98G7Q5bay -OfO/9JVlsnQMC48T+nT55PSpvaoLXSLP2JMPuuJt3uDGGKtVvzJvd8GNezFzxXyn -g3LUty81KoKPBRsmp1GiB+gl5OKo8znzPmw3O6/mKruLAgMBAAEwDQYJKoZIhvcN -AQEFBQADgYEACzoHUF8UV2Z6541Q2wKEA0UFUzmUjf/E1XwBO+1P15ZZ64uw34B4 -1RwMPtAo9RY/PmICTWtNxWGxkzwb2JtDWtnxVER/lF8k2XcXPE76fxTHJF/BKk9J -QU8OTD1dd9gHCBviQB9TqntRZ5X7axjtuWjb2umY+owBYzAHZkp1HKI= ------END CERTIFICATE----- diff --git a/deps/npm/node_modules/agent-base/test/test.js b/deps/npm/node_modules/agent-base/test/test.js deleted file mode 100644 index 0f372c07606317..00000000000000 --- a/deps/npm/node_modules/agent-base/test/test.js +++ /dev/null @@ -1,728 +0,0 @@ -/** - * Module dependencies. - */ - -var fs = require('fs'); -var url = require('url'); -var net = require('net'); -var tls = require('tls'); -var http = require('http'); -var https = require('https'); -var WebSocket = require('ws'); -var assert = require('assert'); -var events = require('events'); -var inherits = require('util').inherits; -var Agent = require('../'); - -var PassthroughAgent = Agent(function(req, opts) { - return opts.secureEndpoint ? https.globalAgent : http.globalAgent; -}); - -describe('Agent', function() { - describe('subclass', function() { - it('should be subclassable', function(done) { - function MyAgent() { - Agent.call(this); - } - inherits(MyAgent, Agent); - - MyAgent.prototype.callback = function(req, opts, fn) { - assert.equal(req.path, '/foo'); - assert.equal(req.getHeader('host'), '127.0.0.1:1234'); - assert.equal(opts.secureEndpoint, true); - done(); - }; - - var info = url.parse('https://127.0.0.1:1234/foo'); - info.agent = new MyAgent(); - https.get(info); - }); - }); - describe('options', function() { - it('should support an options Object as first argument', function() { - var agent = new Agent({ timeout: 1000 }); - assert.equal(1000, agent.timeout); - }); - it('should support an options Object as second argument', function() { - var agent = new Agent(function() {}, { timeout: 1000 }); - assert.equal(1000, agent.timeout); - }); - it('should be mixed in with HTTP request options', function(done) { - var agent = new Agent({ - host: 'my-proxy.com', - port: 3128, - foo: 'bar' - }); - agent.callback = function(req, opts, fn) { - assert.equal('bar', opts.foo); - assert.equal('a', opts.b); - - // `host` and `port` are special-cases, and should always be - // overwritten in the request `opts` inside the agent-base callback - assert.equal('localhost', opts.host); - assert.equal(80, opts.port); - done(); - }; - var opts = { - b: 'a', - agent: agent - }; - http.get(opts); - }); - }); - describe('`this` context', function() { - it('should be the Agent instance', function(done) { - var called = false; - var agent = new Agent(); - agent.callback = function() { - called = true; - assert.equal(this, agent); - }; - var info = url.parse('http://127.0.0.1/foo'); - info.agent = agent; - var req = http.get(info); - req.on('error', function(err) { - assert(/no Duplex stream was returned/.test(err.message)); - done(); - }); - }); - it('should be the Agent instance with callback signature', function(done) { - var called = false; - var agent = new Agent(); - agent.callback = function(req, opts, fn) { - called = true; - assert.equal(this, agent); - fn(); - }; - var info = url.parse('http://127.0.0.1/foo'); - info.agent = agent; - var req = http.get(info); - req.on('error', function(err) { - assert(/no Duplex stream was returned/.test(err.message)); - done(); - }); - }); - }); - describe('"error" event', function() { - it('should be invoked on `http.ClientRequest` instance if `callback()` has not been defined', function( - done - ) { - var agent = new Agent(); - var info = url.parse('http://127.0.0.1/foo'); - info.agent = agent; - var req = http.get(info); - req.on('error', function(err) { - assert.equal( - '"agent-base" has no default implementation, you must subclass and override `callback()`', - err.message - ); - done(); - }); - }); - it('should be invoked on `http.ClientRequest` instance if Error passed to callback function on the first tick', function( - done - ) { - var agent = new Agent(function(req, opts, fn) { - fn(new Error('is this caught?')); - }); - var info = url.parse('http://127.0.0.1/foo'); - info.agent = agent; - var req = http.get(info); - req.on('error', function(err) { - assert.equal('is this caught?', err.message); - done(); - }); - }); - it('should be invoked on `http.ClientRequest` instance if Error passed to callback function after the first tick', function( - done - ) { - var agent = new Agent(function(req, opts, fn) { - setTimeout(function() { - fn(new Error('is this caught?')); - }, 10); - }); - var info = url.parse('http://127.0.0.1/foo'); - info.agent = agent; - var req = http.get(info); - req.on('error', function(err) { - assert.equal('is this caught?', err.message); - done(); - }); - }); - }); - describe('artificial "streams"', function() { - it('should send a GET request', function(done) { - var stream = new events.EventEmitter(); - - // needed for the `http` module to call .write() on the stream - stream.writable = true; - - stream.write = function(str) { - assert(0 == str.indexOf('GET / HTTP/1.1')); - done(); - }; - - // needed for `http` module in Node.js 4 - stream.cork = function() {}; - - var opts = { - method: 'GET', - host: '127.0.0.1', - path: '/', - port: 80, - agent: new Agent(function(req, opts, fn) { - fn(null, stream); - }) - }; - var req = http.request(opts); - req.end(); - }); - it('should receive a GET response', function(done) { - var stream = new events.EventEmitter(); - var opts = { - method: 'GET', - host: '127.0.0.1', - path: '/', - port: 80, - agent: new Agent(function(req, opts, fn) { - fn(null, stream); - }) - }; - var req = http.request(opts, function(res) { - assert.equal('1.0', res.httpVersion); - assert.equal(200, res.statusCode); - assert.equal('bar', res.headers.foo); - assert.deepEqual(['1', '2'], res.headers['set-cookie']); - done(); - }); - - // have to wait for the "socket" event since `http.ClientRequest` - // doesn't *actually* attach the listeners to the "stream" until - // this happens - req.once('socket', function() { - var buf = Buffer.from( - 'HTTP/1.0 200\r\n' + - 'Foo: bar\r\n' + - 'Set-Cookie: 1\r\n' + - 'Set-Cookie: 2\r\n\r\n' - ); - stream.emit('data', buf); - }); - - req.end(); - }); - }); -}); - -describe('"http" module', function() { - var server; - var port; - - // setup test HTTP server - before(function(done) { - server = http.createServer(); - server.listen(0, function() { - port = server.address().port; - done(); - }); - }); - - // shut down test HTTP server - after(function(done) { - server.once('close', function() { - done(); - }); - server.close(); - }); - - it('should work for basic HTTP requests', function(done) { - var called = false; - var agent = new Agent(function(req, opts, fn) { - called = true; - var socket = net.connect(opts); - fn(null, socket); - }); - - // add HTTP server "request" listener - var gotReq = false; - server.once('request', function(req, res) { - gotReq = true; - res.setHeader('X-Foo', 'bar'); - res.setHeader('X-Url', req.url); - res.end(); - }); - - var info = url.parse('http://127.0.0.1:' + port + '/foo'); - info.agent = agent; - http.get(info, function(res) { - assert.equal('bar', res.headers['x-foo']); - assert.equal('/foo', res.headers['x-url']); - assert(gotReq); - assert(called); - done(); - }); - }); - - it('should support direct return in `connect()`', function(done) { - var called = false; - var agent = new Agent(function(req, opts) { - called = true; - return net.connect(opts); - }); - - // add HTTP server "request" listener - var gotReq = false; - server.once('request', function(req, res) { - gotReq = true; - res.setHeader('X-Foo', 'bar'); - res.setHeader('X-Url', req.url); - res.end(); - }); - - var info = url.parse('http://127.0.0.1:' + port + '/foo'); - info.agent = agent; - http.get(info, function(res) { - assert.equal('bar', res.headers['x-foo']); - assert.equal('/foo', res.headers['x-url']); - assert(gotReq); - assert(called); - done(); - }); - }); - - it('should support returning a Promise in `connect()`', function(done) { - var called = false; - var agent = new Agent(function(req, opts) { - return new Promise(function(resolve, reject) { - called = true; - resolve(net.connect(opts)); - }); - }); - - // add HTTP server "request" listener - var gotReq = false; - server.once('request', function(req, res) { - gotReq = true; - res.setHeader('X-Foo', 'bar'); - res.setHeader('X-Url', req.url); - res.end(); - }); - - var info = url.parse('http://127.0.0.1:' + port + '/foo'); - info.agent = agent; - http.get(info, function(res) { - assert.equal('bar', res.headers['x-foo']); - assert.equal('/foo', res.headers['x-url']); - assert(gotReq); - assert(called); - done(); - }); - }); - - it('should set the `Connection: close` response header', function(done) { - var called = false; - var agent = new Agent(function(req, opts, fn) { - called = true; - var socket = net.connect(opts); - fn(null, socket); - }); - - // add HTTP server "request" listener - var gotReq = false; - server.once('request', function(req, res) { - gotReq = true; - res.setHeader('X-Url', req.url); - assert.equal('close', req.headers.connection); - res.end(); - }); - - var info = url.parse('http://127.0.0.1:' + port + '/bar'); - info.agent = agent; - http.get(info, function(res) { - assert.equal('/bar', res.headers['x-url']); - assert.equal('close', res.headers.connection); - assert(gotReq); - assert(called); - done(); - }); - }); - - it('should pass through options from `http.request()`', function(done) { - var agent = new Agent(function(req, opts, fn) { - assert.equal('google.com', opts.host); - assert.equal('bar', opts.foo); - done(); - }); - - http.get({ - host: 'google.com', - foo: 'bar', - agent: agent - }); - }); - - it('should default to port 80', function(done) { - var agent = new Agent(function(req, opts, fn) { - assert.equal(80, opts.port); - done(); - }); - - // (probably) not hitting a real HTTP server here, - // so no need to add a httpServer request listener - http.get({ - host: '127.0.0.1', - path: '/foo', - agent: agent - }); - }); - - it('should support the "timeout" option', function(done) { - // ensure we timeout after the "error" event had a chance to trigger - this.timeout(1000); - this.slow(800); - - var agent = new Agent( - function(req, opts, fn) { - // this function will time out - }, - { timeout: 100 } - ); - - var opts = url.parse('http://nodejs.org'); - opts.agent = agent; - - var req = http.get(opts); - req.once('error', function(err) { - assert.equal('ETIMEOUT', err.code); - req.abort(); - done(); - }); - }); - - it('should free sockets after use', function(done) { - var agent = new Agent(function(req, opts, fn) { - var socket = net.connect(opts); - fn(null, socket); - }); - - // add HTTP server "request" listener - var gotReq = false; - server.once('request', function(req, res) { - gotReq = true; - res.end(); - }); - - var info = url.parse('http://127.0.0.1:' + port + '/foo'); - info.agent = agent; - http.get(info, function(res) { - res.socket.emit('free'); - assert.equal(true, res.socket.destroyed); - assert(gotReq); - done(); - }); - }); - - - describe('PassthroughAgent', function() { - it('should pass through to `http.globalAgent`', function(done) { - // add HTTP server "request" listener - var gotReq = false; - server.once('request', function(req, res) { - gotReq = true; - res.setHeader('X-Foo', 'bar'); - res.setHeader('X-Url', req.url); - res.end(); - }); - - var info = url.parse('http://127.0.0.1:' + port + '/foo'); - info.agent = PassthroughAgent; - http.get(info, function(res) { - assert.equal('bar', res.headers['x-foo']); - assert.equal('/foo', res.headers['x-url']); - assert(gotReq); - done(); - }); - }); - }); -}); - -describe('"https" module', function() { - var server; - var port; - - // setup test HTTPS server - before(function(done) { - var options = { - key: fs.readFileSync(__dirname + '/ssl-cert-snakeoil.key'), - cert: fs.readFileSync(__dirname + '/ssl-cert-snakeoil.pem') - }; - server = https.createServer(options); - server.listen(0, function() { - port = server.address().port; - done(); - }); - }); - - // shut down test HTTP server - after(function(done) { - server.once('close', function() { - done(); - }); - server.close(); - }); - - it('should not modify the passed in Options object', function(done) { - var called = false; - var agent = new Agent(function(req, opts, fn) { - called = true; - assert.equal(true, opts.secureEndpoint); - assert.equal(443, opts.port); - assert.equal('localhost', opts.host); - }); - var opts = { agent: agent }; - var req = https.request(opts); - assert.equal(true, called); - assert.equal(false, 'secureEndpoint' in opts); - assert.equal(false, 'port' in opts); - done(); - }); - - it('should work with a String URL', function(done) { - var endpoint = 'https://127.0.0.1:' + port; - var req = https.get(endpoint); - - // it's gonna error out since `rejectUnauthorized` is not being passed in - req.on('error', function(err) { - assert.equal(err.code, 'DEPTH_ZERO_SELF_SIGNED_CERT'); - done(); - }); - }); - - it('should work for basic HTTPS requests', function(done) { - var called = false; - var agent = new Agent(function(req, opts, fn) { - called = true; - assert(opts.secureEndpoint); - var socket = tls.connect(opts); - fn(null, socket); - }); - - // add HTTPS server "request" listener - var gotReq = false; - server.once('request', function(req, res) { - gotReq = true; - res.setHeader('X-Foo', 'bar'); - res.setHeader('X-Url', req.url); - res.end(); - }); - - var info = url.parse('https://127.0.0.1:' + port + '/foo'); - info.agent = agent; - info.rejectUnauthorized = false; - https.get(info, function(res) { - assert.equal('bar', res.headers['x-foo']); - assert.equal('/foo', res.headers['x-url']); - assert(gotReq); - assert(called); - done(); - }); - }); - - it('should pass through options from `https.request()`', function(done) { - var agent = new Agent(function(req, opts, fn) { - assert.equal('google.com', opts.host); - assert.equal('bar', opts.foo); - done(); - }); - - https.get({ - host: 'google.com', - foo: 'bar', - agent: agent - }); - }); - - it('should support the 3-argument `https.get()`', function(done) { - var agent = new Agent(function(req, opts, fn) { - assert.equal('google.com', opts.host); - assert.equal('/q', opts.pathname || opts.path); - assert.equal('881', opts.port); - assert.equal('bar', opts.foo); - done(); - }); - - https.get( - 'https://google.com:881/q', - { - host: 'google.com', - foo: 'bar', - agent: agent - } - ); - }); - - it('should default to port 443', function(done) { - var agent = new Agent(function(req, opts, fn) { - assert.equal(true, opts.secureEndpoint); - assert.equal(false, opts.rejectUnauthorized); - assert.equal(443, opts.port); - done(); - }); - - // (probably) not hitting a real HTTPS server here, - // so no need to add a httpsServer request listener - https.get({ - host: '127.0.0.1', - path: '/foo', - agent: agent, - rejectUnauthorized: false - }); - }); - - it('should not re-patch https.request', () => { - var patchModulePath = "../patch-core"; - var patchedRequest = https.request; - - delete require.cache[require.resolve(patchModulePath)]; - require(patchModulePath); - - assert.equal(patchedRequest, https.request); - assert.equal(true, https.request.__agent_base_https_request_patched__); - }); - - describe('PassthroughAgent', function() { - it('should pass through to `https.globalAgent`', function(done) { - // add HTTP server "request" listener - var gotReq = false; - server.once('request', function(req, res) { - gotReq = true; - res.setHeader('X-Foo', 'bar'); - res.setHeader('X-Url', req.url); - res.end(); - }); - - var info = url.parse('https://127.0.0.1:' + port + '/foo'); - info.agent = PassthroughAgent; - info.rejectUnauthorized = false; - https.get(info, function(res) { - assert.equal('bar', res.headers['x-foo']); - assert.equal('/foo', res.headers['x-url']); - assert(gotReq); - done(); - }); - }); - }); -}); - -describe('"ws" server', function() { - var wss; - var server; - var port; - - // setup test HTTP server - before(function(done) { - server = http.createServer(); - wss = new WebSocket.Server({ server: server }); - server.listen(0, function() { - port = server.address().port; - done(); - }); - }); - - // shut down test HTTP server - after(function(done) { - server.once('close', function() { - done(); - }); - server.close(); - }); - - it('should work for basic WebSocket connections', function(done) { - function onconnection(ws) { - ws.on('message', function(data) { - assert.equal('ping', data); - ws.send('pong'); - }); - } - wss.on('connection', onconnection); - - var agent = new Agent(function(req, opts, fn) { - var socket = net.connect(opts); - fn(null, socket); - }); - - var client = new WebSocket('ws://127.0.0.1:' + port + '/', { - agent: agent - }); - - client.on('open', function() { - client.send('ping'); - }); - - client.on('message', function(data) { - assert.equal('pong', data); - client.close(); - wss.removeListener('connection', onconnection); - done(); - }); - }); -}); - -describe('"wss" server', function() { - var wss; - var server; - var port; - - // setup test HTTP server - before(function(done) { - var options = { - key: fs.readFileSync(__dirname + '/ssl-cert-snakeoil.key'), - cert: fs.readFileSync(__dirname + '/ssl-cert-snakeoil.pem') - }; - server = https.createServer(options); - wss = new WebSocket.Server({ server: server }); - server.listen(0, function() { - port = server.address().port; - done(); - }); - }); - - // shut down test HTTP server - after(function(done) { - server.once('close', function() { - done(); - }); - server.close(); - }); - - it('should work for secure WebSocket connections', function(done) { - function onconnection(ws) { - ws.on('message', function(data) { - assert.equal('ping', data); - ws.send('pong'); - }); - } - wss.on('connection', onconnection); - - var agent = new Agent(function(req, opts, fn) { - var socket = tls.connect(opts); - fn(null, socket); - }); - - var client = new WebSocket('wss://127.0.0.1:' + port + '/', { - agent: agent, - rejectUnauthorized: false - }); - - client.on('open', function() { - client.send('ping'); - }); - - client.on('message', function(data) { - assert.equal('pong', data); - client.close(); - wss.removeListener('connection', onconnection); - done(); - }); - }); -}); diff --git a/deps/npm/node_modules/agentkeepalive/History.md b/deps/npm/node_modules/agentkeepalive/History.md index d5d14d8b4cb683..b4e41124878071 100644 --- a/deps/npm/node_modules/agentkeepalive/History.md +++ b/deps/npm/node_modules/agentkeepalive/History.md @@ -1,4 +1,61 @@ +4.1.3 / 2020-06-15 +================== + +**fixes** + * [[`4ba9f9c`](http://github.com/node-modules/agentkeepalive/commit/4ba9f9c844f2a6b8037ce56599d25c69ef054d91)] - fix: compatible with node v12.16.3 (#91) (killa <>) + +4.1.2 / 2020-04-25 +================== + +**fixes** + * [[`de66b02`](http://github.com/node-modules/agentkeepalive/commit/de66b0206d064a97129c2c31bcdabd4d64557b91)] - fix: detect http request timeout handler (#88) (fengmk2 <>) + +4.1.1 / 2020-04-25 +================== + +**fixes** + * [[`bbd20c0`](http://github.com/node-modules/agentkeepalive/commit/bbd20c03b8cf7dfb00b3aad1ada26d4ab90d2d6e)] - fix: definition error (#87) (吖猩 <>) + +**others** + * [[`3b01699`](http://github.com/node-modules/agentkeepalive/commit/3b01699b8e90022d5f56898dd709e4fe7ee7cdaa)] - test: run test on node 12 (#84) (Igor Savin <>) + +4.1.0 / 2019-10-12 +================== + +**features** + * [[`fe33b80`](http://github.com/node-modules/agentkeepalive/commit/fe33b800acc09109388bfe65107550952b6fc7b0)] - feat: Add `reusedSocket` property on client request (#82) (Weijia Wang <>) + +**others** + * [[`77ba744`](http://github.com/node-modules/agentkeepalive/commit/77ba744667bb6b9e5986a53e5222f62094db12b9)] - docs: fix grammar in readme (#81) (Herrington Darkholme <<2883231+HerringtonDarkholme@users.noreply.github.com>>) + +4.0.2 / 2019-02-19 +================== + +**fixes** + * [[`56d4a9b`](http://github.com/node-modules/agentkeepalive/commit/56d4a9b2a4499ea28943ddb590358d7831a02cb1)] - fix: HttpAgent export = internal (#74) (Andrew Leedham <>) + +4.0.1 / 2019-02-19 +================== + +**fixes** + * [[`bad1ac0`](http://github.com/node-modules/agentkeepalive/commit/bad1ac0e710fbc486717e14e68c59266d35df6a8)] - fix: HttpsAgent Type Definition (#71) (#72) (Andrew Leedham <>) + * [[`f48a4a7`](http://github.com/node-modules/agentkeepalive/commit/f48a4a701ea6fbe43781c91e1c0aaad6e328ac7f)] - fix: export interface (#70) (Vinay <>) + +**others** + * [[`9124343`](http://github.com/node-modules/agentkeepalive/commit/91243437cfdd324cb97f39dee76746d5e5f4cd72)] - chore: add agent.options.keepAlive instead agent.keepAlive (fengmk2 <>) + * [[`d177d40`](http://github.com/node-modules/agentkeepalive/commit/d177d40422fe7296990b4e270cf498e3f33c18fa)] - test: add request timeout bigger than agent timeout cases (fengmk2 <>) + +4.0.0 / 2018-10-23 +================== + +**features** + * [[`5c9f3bb`](http://github.com/node-modules/agentkeepalive/commit/5c9f3bbd60555744edcf777105b148982a1a42b6)] - feat: impl the new Agent extend http.Agent (fengmk2 <>) + +**others** + * [[`498c8f1`](http://github.com/node-modules/agentkeepalive/commit/498c8f13cf76600d3dd6e1c91cdf2d8292355dff)] - chore: move LICENSE from readme to file (fengmk2 <>) + * [[`4f39894`](http://github.com/node-modules/agentkeepalive/commit/4f398942ba2f90cf4501239e56ac4e6344931a01)] - bugfix: support agent.options.timeout on https agent (fengmk2 <>) + 3.5.2 / 2018-10-19 ================== diff --git a/deps/npm/node_modules/agentkeepalive/LICENSE b/deps/npm/node_modules/agentkeepalive/LICENSE new file mode 100644 index 00000000000000..941258ca703b30 --- /dev/null +++ b/deps/npm/node_modules/agentkeepalive/LICENSE @@ -0,0 +1,23 @@ +The MIT License + +Copyright(c) node-modules and other contributors. +Copyright(c) 2012 - 2015 fengmk2 + +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/agentkeepalive/README.md b/deps/npm/node_modules/agentkeepalive/README.md index 823145821b72f1..70e57bbf6dd452 100644 --- a/deps/npm/node_modules/agentkeepalive/README.md +++ b/deps/npm/node_modules/agentkeepalive/README.md @@ -1,29 +1,17 @@ # agentkeepalive [![NPM version][npm-image]][npm-url] -[![build status][travis-image]][travis-url] -[![Appveyor status][appveyor-image]][appveyor-url] -[![Test coverage][codecov-image]][codecov-url] -[![David deps][david-image]][david-url] [![Known Vulnerabilities][snyk-image]][snyk-url] [![npm download][download-image]][download-url] [npm-image]: https://img.shields.io/npm/v/agentkeepalive.svg?style=flat [npm-url]: https://npmjs.org/package/agentkeepalive -[travis-image]: https://img.shields.io/travis/node-modules/agentkeepalive.svg?style=flat -[travis-url]: https://travis-ci.org/node-modules/agentkeepalive -[appveyor-image]: https://ci.appveyor.com/api/projects/status/k7ct4s47di6m5uy2?svg=true -[appveyor-url]: https://ci.appveyor.com/project/fengmk2/agentkeepalive -[codecov-image]: https://codecov.io/gh/node-modules/agentkeepalive/branch/master/graph/badge.svg -[codecov-url]: https://codecov.io/gh/node-modules/agentkeepalive -[david-image]: https://img.shields.io/david/node-modules/agentkeepalive.svg?style=flat -[david-url]: https://david-dm.org/node-modules/agentkeepalive [snyk-image]: https://snyk.io/test/npm/agentkeepalive/badge.svg?style=flat-square [snyk-url]: https://snyk.io/test/npm/agentkeepalive [download-image]: https://img.shields.io/npm/dm/agentkeepalive.svg?style=flat-square [download-url]: https://npmjs.org/package/agentkeepalive -The Node.js's missing `keep alive` `http.Agent`. Support `http` and `https`. +The enhancement features `keep alive` `http.Agent`. Support `http` and `https`. ## What's different from original `http.Agent`? @@ -31,6 +19,11 @@ The Node.js's missing `keep alive` `http.Agent`. Support `http` and `https`. - Disable Nagle's algorithm: `socket.setNoDelay(true)` - Add free socket timeout: avoid long time inactivity socket leak in the free-sockets queue. - Add active socket timeout: avoid long time inactivity socket leak in the active-sockets queue. +- TTL for active socket. + +## Node.js version required + +Support Node.js >= `8.0.0` ## Install @@ -47,20 +40,20 @@ $ npm install agentkeepalive --save * `keepAliveMsecs` {Number} When using the keepAlive option, specifies the initial delay for TCP Keep-Alive packets. Ignored when the keepAlive option is false or undefined. Defaults to 1000. Default = `1000`. Only relevant if `keepAlive` is set to `true`. - * `freeSocketKeepAliveTimeout`: {Number} Sets the free socket to timeout - after `freeSocketKeepAliveTimeout` milliseconds of inactivity on the free socket. + * `freeSocketTimeout`: {Number} Sets the free socket to timeout + after `freeSocketTimeout` milliseconds of inactivity on the free socket. Default is `15000`. Only relevant if `keepAlive` is set to `true`. * `timeout`: {Number} Sets the working socket to timeout after `timeout` milliseconds of inactivity on the working socket. - Default is `freeSocketKeepAliveTimeout * 2`. + Default is `freeSocketTimeout * 2`. * `maxSockets` {Number} Maximum number of sockets to allow per host. Default = `Infinity`. * `maxFreeSockets` {Number} Maximum number of sockets (per host) to leave open in a free state. Only relevant if `keepAlive` is set to `true`. Default = `256`. * `socketActiveTTL` {Number} Sets the socket active time to live, even if it's in use. - If not setted the behaviour continues the same (the socket will be released only when free) + If not set, the behaviour keeps the same (the socket will be released only when free) Default = `null`. ## Usage @@ -72,8 +65,8 @@ const Agent = require('agentkeepalive'); const keepaliveAgent = new Agent({ maxSockets: 100, maxFreeSockets: 10, - timeout: 60000, - freeSocketKeepAliveTimeout: 30000, // free socket keepalive for 30 seconds + timeout: 60000, // active socket keepalive for 60 seconds + freeSocketTimeout: 30000, // free socket keepalive for 30 seconds }); const options = { @@ -160,6 +153,30 @@ setTimeout(() => { }, 2000); ``` +### Support `req.reusedSocket` + +This agent implements the `req.reusedSocket` to determine whether a request is send through a reused socket. + +When server closes connection at unfortunate time ([keep-alive race](https://code-examples.net/en/q/28a8069)), the http client will throw a `ECONNRESET` error. Under this circumstance, `req.reusedSocket` is useful when we want to retry the request automatically. + +```js +const http = require('http'); +const Agent = require('agentkeepalive'); +const agent = new Agent(); + +const req = http + .get('http://localhost:3000', { agent }, (res) => { + // ... + }) + .on('error', (err) => { + if (req.reusedSocket && err.code === 'ECONNRESET') { + // retry the request or anything else... + } + }) +``` + +This behavior is consistent with Node.js core. But through `agentkeepalive`, you can use this feature in older Node.js version. + ## [Benchmark](https://github.com/node-modules/agentkeepalive/tree/master/benchmark) run the benchmark: @@ -211,7 +228,7 @@ Shortest transaction: 0.00 Socket created: -``` +```bash [proxy.js:120000] keepalive, 50 created, 60000 requestFinished, 1200 req/socket, 0 requests, 0 sockets, 0 unusedSockets, 50 timeout {" <10ms":662," <15ms":17825," <20ms":20552," <30ms":17646," <40ms":2315," <50ms":567," <100ms":377," <150ms":56," <200ms":0," >=200ms+":0} ---------------------------------------------------------------- @@ -221,28 +238,4 @@ Socket created: ## License -``` -(The MIT License) - -Copyright(c) node-modules and other contributors. -Copyright(c) 2012 - 2015 fengmk2 - -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. -``` +[MIT](LICENSE) diff --git a/deps/npm/node_modules/agentkeepalive/index.d.ts b/deps/npm/node_modules/agentkeepalive/index.d.ts index c11636f7ca116e..33734c6aea7b87 100644 --- a/deps/npm/node_modules/agentkeepalive/index.d.ts +++ b/deps/npm/node_modules/agentkeepalive/index.d.ts @@ -1,43 +1,62 @@ -declare module "agentkeepalive" { - import * as http from 'http'; - import * as https from 'https'; - - interface AgentStatus { - createSocketCount: number, - createSocketErrorCount: number, - closeSocketCount: number, - errorSocketCount: number, - timeoutSocketCount: number, - requestCount: number, - freeSockets: object, - sockets: object, - requests: object, - } +import * as http from 'http'; +import * as https from 'https'; - interface HttpOptions extends http.AgentOptions { - freeSocketKeepAliveTimeout?: number; - timeout?: number; - socketActiveTTL?: number; +interface PlainObject { + [key: string]: any; +} + +declare class HttpAgent extends http.Agent { + constructor(opts?: AgentKeepAlive.HttpOptions); + readonly statusChanged: boolean; + createSocket(req: http.IncomingMessage, options: http.RequestOptions, cb: Function): void; + getCurrentStatus(): AgentKeepAlive.AgentStatus; +} + +interface Constants { + CURRENT_ID: Symbol; + CREATE_ID: Symbol; + INIT_SOCKET: Symbol; + CREATE_HTTPS_CONNECTION: Symbol; + SOCKET_CREATED_TIME: Symbol; + SOCKET_NAME: Symbol; + SOCKET_REQUEST_COUNT: Symbol; + SOCKET_REQUEST_FINISHED_COUNT: Symbol; +} + +declare class AgentKeepAlive extends HttpAgent {} + +declare namespace AgentKeepAlive { + export interface AgentStatus { + createSocketCount: number; + createSocketErrorCount: number; + closeSocketCount: number; + errorSocketCount: number; + timeoutSocketCount: number; + requestCount: number; + freeSockets: PlainObject; + sockets: PlainObject; + requests: PlainObject; } - interface HttpsOptions extends https.AgentOptions { + interface CommonHttpOption { + keepAlive?: boolean; + freeSocketTimeout?: number; freeSocketKeepAliveTimeout?: number; timeout?: number; socketActiveTTL?: number; } - class internal extends http.Agent { + export interface HttpOptions extends http.AgentOptions, CommonHttpOption { } + export interface HttpsOptions extends https.AgentOptions, CommonHttpOption { } + + export class HttpsAgent extends https.Agent { constructor(opts?: HttpOptions); readonly statusChanged: boolean; createSocket(req: http.IncomingMessage, options: http.RequestOptions, cb: Function): void; getCurrentStatus(): AgentStatus; } - namespace internal { - export class HttpsAgent extends internal { - constructor(opts?: HttpsOptions); - } - } - - export = internal; + export const constants: Constants; } + +export = AgentKeepAlive; diff --git a/deps/npm/node_modules/agentkeepalive/index.js b/deps/npm/node_modules/agentkeepalive/index.js index 6138131a9b99d3..6ca1513463724d 100644 --- a/deps/npm/node_modules/agentkeepalive/index.js +++ b/deps/npm/node_modules/agentkeepalive/index.js @@ -2,3 +2,4 @@ module.exports = require('./lib/agent'); module.exports.HttpsAgent = require('./lib/https_agent'); +module.exports.constants = require('./lib/constants'); diff --git a/deps/npm/node_modules/agentkeepalive/lib/_http_agent.js b/deps/npm/node_modules/agentkeepalive/lib/_http_agent.js deleted file mode 100644 index c324b7f875ec31..00000000000000 --- a/deps/npm/node_modules/agentkeepalive/lib/_http_agent.js +++ /dev/null @@ -1,416 +0,0 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - -// patch from https://github.com/nodejs/node/blob/v7.2.1/lib/_http_agent.js - -'use strict'; - -const net = require('net'); -const util = require('util'); -const EventEmitter = require('events'); -const debug = util.debuglog('http'); - -// New Agent code. - -// The largest departure from the previous implementation is that -// an Agent instance holds connections for a variable number of host:ports. -// Surprisingly, this is still API compatible as far as third parties are -// concerned. The only code that really notices the difference is the -// request object. - -// Another departure is that all code related to HTTP parsing is in -// ClientRequest.onSocket(). The Agent is now *strictly* -// concerned with managing a connection pool. - -function Agent(options) { - if (!(this instanceof Agent)) - return new Agent(options); - - EventEmitter.call(this); - - var self = this; - - self.defaultPort = 80; - self.protocol = 'http:'; - - self.options = util._extend({}, options); - - // don't confuse net and make it think that we're connecting to a pipe - self.options.path = null; - self.requests = {}; - self.sockets = {}; - self.freeSockets = {}; - self.keepAliveMsecs = self.options.keepAliveMsecs || 1000; - self.keepAlive = self.options.keepAlive || false; - self.maxSockets = self.options.maxSockets || Agent.defaultMaxSockets; - self.maxFreeSockets = self.options.maxFreeSockets || 256; - - // [patch start] - // free keep-alive socket timeout. By default free socket do not have a timeout. - self.freeSocketKeepAliveTimeout = self.options.freeSocketKeepAliveTimeout || 0; - // working socket timeout. By default working socket do not have a timeout. - self.timeout = self.options.timeout || 0; - // the socket active time to live, even if it's in use - this.socketActiveTTL = this.options.socketActiveTTL || null; - // [patch end] - - self.on('free', function(socket, options) { - var name = self.getName(options); - debug('agent.on(free)', name); - - if (socket.writable && - self.requests[name] && self.requests[name].length) { - // [patch start] - debug('continue handle next request'); - // [patch end] - self.requests[name].shift().onSocket(socket); - if (self.requests[name].length === 0) { - // don't leak - delete self.requests[name]; - } - } else { - // If there are no pending requests, then put it in - // the freeSockets pool, but only if we're allowed to do so. - var req = socket._httpMessage; - if (req && - req.shouldKeepAlive && - socket.writable && - self.keepAlive) { - var freeSockets = self.freeSockets[name]; - var freeLen = freeSockets ? freeSockets.length : 0; - var count = freeLen; - if (self.sockets[name]) - count += self.sockets[name].length; - - if (count > self.maxSockets || freeLen >= self.maxFreeSockets) { - socket.destroy(); - } else { - freeSockets = freeSockets || []; - self.freeSockets[name] = freeSockets; - socket.setKeepAlive(true, self.keepAliveMsecs); - socket.unref(); - socket._httpMessage = null; - self.removeSocket(socket, options); - freeSockets.push(socket); - - // [patch start] - // Add a default error handler to avoid Unhandled 'error' event throw on idle socket - // https://github.com/node-modules/agentkeepalive/issues/25 - // https://github.com/nodejs/node/pull/4482 (fixed in >= 4.4.0 and >= 5.4.0) - if (socket.listeners('error').length === 0) { - socket.once('error', freeSocketErrorListener); - } - // set free keepalive timer - // try to use socket custom freeSocketKeepAliveTimeout first - const freeSocketKeepAliveTimeout = socket.freeSocketKeepAliveTimeout || self.freeSocketKeepAliveTimeout; - socket.setTimeout(freeSocketKeepAliveTimeout); - debug(`push to free socket queue and wait for ${freeSocketKeepAliveTimeout}ms`); - // [patch end] - } - } else { - socket.destroy(); - } - } - }); -} - -util.inherits(Agent, EventEmitter); -exports.Agent = Agent; - -// [patch start] -function freeSocketErrorListener(err) { - var socket = this; - debug('SOCKET ERROR on FREE socket:', err.message, err.stack); - socket.destroy(); - socket.emit('agentRemove'); -} -// [patch end] - -Agent.defaultMaxSockets = Infinity; - -Agent.prototype.createConnection = net.createConnection; - -// Get the key for a given set of request options -Agent.prototype.getName = function getName(options) { - var name = options.host || 'localhost'; - - name += ':'; - if (options.port) - name += options.port; - - name += ':'; - if (options.localAddress) - name += options.localAddress; - - // Pacify parallel/test-http-agent-getname by only appending - // the ':' when options.family is set. - if (options.family === 4 || options.family === 6) - name += ':' + options.family; - - return name; -}; - -// [patch start] -function handleSocketCreation(req) { - return function(err, newSocket) { - if (err) { - process.nextTick(function() { - req.emit('error', err); - }); - return; - } - req.onSocket(newSocket); - } -} -// [patch end] - -Agent.prototype.addRequest = function addRequest(req, options, port/*legacy*/, - localAddress/*legacy*/) { - // Legacy API: addRequest(req, host, port, localAddress) - if (typeof options === 'string') { - options = { - host: options, - port, - localAddress - }; - } - - options = util._extend({}, options); - options = util._extend(options, this.options); - - if (!options.servername) - options.servername = calculateServerName(options, req); - - var name = this.getName(options); - if (!this.sockets[name]) { - this.sockets[name] = []; - } - - var freeLen = this.freeSockets[name] ? this.freeSockets[name].length : 0; - var sockLen = freeLen + this.sockets[name].length; - - if (freeLen) { - // we have a free socket, so use that. - var socket = this.freeSockets[name].shift(); - debug('have free socket'); - - // [patch start] - // remove free socket error event handler - socket.removeListener('error', freeSocketErrorListener); - // restart the default timer - socket.setTimeout(this.timeout); - - if (this.socketActiveTTL && Date.now() - socket.createdTime > this.socketActiveTTL) { - debug(`socket ${socket.createdTime} expired`); - socket.destroy(); - return this.createSocket(req, options, handleSocketCreation(req)); - } - // [patch end] - - // don't leak - if (!this.freeSockets[name].length) - delete this.freeSockets[name]; - - socket.ref(); - req.onSocket(socket); - this.sockets[name].push(socket); - } else if (sockLen < this.maxSockets) { - debug('call onSocket', sockLen, freeLen); - // If we are under maxSockets create a new one. - // [patch start] - this.createSocket(req, options, handleSocketCreation(req)); - // [patch end] - } else { - debug('wait for socket'); - // We are over limit so we'll add it to the queue. - if (!this.requests[name]) { - this.requests[name] = []; - } - this.requests[name].push(req); - } -}; - -Agent.prototype.createSocket = function createSocket(req, options, cb) { - var self = this; - options = util._extend({}, options); - options = util._extend(options, self.options); - - if (!options.servername) - options.servername = calculateServerName(options, req); - - var name = self.getName(options); - options._agentKey = name; - - debug('createConnection', name, options); - options.encoding = null; - var called = false; - const newSocket = self.createConnection(options, oncreate); - // [patch start] - if (newSocket) { - oncreate(null, Object.assign(newSocket, { createdTime: Date.now() })); - } - // [patch end] - function oncreate(err, s) { - if (called) - return; - called = true; - if (err) - return cb(err); - if (!self.sockets[name]) { - self.sockets[name] = []; - } - self.sockets[name].push(s); - debug('sockets', name, self.sockets[name].length); - - function onFree() { - self.emit('free', s, options); - } - s.on('free', onFree); - - function onClose(err) { - debug('CLIENT socket onClose'); - // This is the only place where sockets get removed from the Agent. - // If you want to remove a socket from the pool, just close it. - // All socket errors end in a close event anyway. - self.removeSocket(s, options); - - // [patch start] - self.emit('close'); - // [patch end] - } - s.on('close', onClose); - - // [patch start] - // start socket timeout handler - function onTimeout() { - debug('CLIENT socket onTimeout'); - s.destroy(); - // Remove it from freeSockets immediately to prevent new requests from being sent through this socket. - self.removeSocket(s, options); - self.emit('timeout'); - } - s.on('timeout', onTimeout); - // set the default timer - s.setTimeout(self.timeout); - // [patch end] - - function onRemove() { - // We need this function for cases like HTTP 'upgrade' - // (defined by WebSockets) where we need to remove a socket from the - // pool because it'll be locked up indefinitely - debug('CLIENT socket onRemove'); - self.removeSocket(s, options); - s.removeListener('close', onClose); - s.removeListener('free', onFree); - s.removeListener('agentRemove', onRemove); - - // [patch start] - // remove socket timeout handler - s.setTimeout(0, onTimeout); - // [patch end] - } - s.on('agentRemove', onRemove); - cb(null, s); - } -}; - -function calculateServerName(options, req) { - let servername = options.host; - const hostHeader = req.getHeader('host'); - if (hostHeader) { - // abc => abc - // abc:123 => abc - // [::1] => ::1 - // [::1]:123 => ::1 - if (hostHeader.startsWith('[')) { - const index = hostHeader.indexOf(']'); - if (index === -1) { - // Leading '[', but no ']'. Need to do something... - servername = hostHeader; - } else { - servername = hostHeader.substr(1, index - 1); - } - } else { - servername = hostHeader.split(':', 1)[0]; - } - } - return servername; -} - -Agent.prototype.removeSocket = function removeSocket(s, options) { - var name = this.getName(options); - debug('removeSocket', name, 'writable:', s.writable); - var sets = [this.sockets]; - - // If the socket was destroyed, remove it from the free buffers too. - if (!s.writable) - sets.push(this.freeSockets); - - for (var sk = 0; sk < sets.length; sk++) { - var sockets = sets[sk]; - - if (sockets[name]) { - var index = sockets[name].indexOf(s); - if (index !== -1) { - sockets[name].splice(index, 1); - // Don't leak - if (sockets[name].length === 0) - delete sockets[name]; - } - } - } - - // [patch start] - var freeLen = this.freeSockets[name] ? this.freeSockets[name].length : 0; - var sockLen = freeLen + (this.sockets[name] ? this.sockets[name].length : 0); - // [patch end] - - if (this.requests[name] && this.requests[name].length && sockLen < this.maxSockets) { - debug('removeSocket, have a request, make a socket'); - var req = this.requests[name][0]; - // If we have pending requests and a socket gets closed make a new one - this.createSocket(req, options, function(err, newSocket) { - if (err) { - process.nextTick(function() { - req.emit('error', err); - }); - return; - } - newSocket.emit('free'); - }); - } -}; - -Agent.prototype.destroy = function destroy() { - var sets = [this.freeSockets, this.sockets]; - for (var s = 0; s < sets.length; s++) { - var set = sets[s]; - var keys = Object.keys(set); - for (var v = 0; v < keys.length; v++) { - var setName = set[keys[v]]; - for (var n = 0; n < setName.length; n++) { - setName[n].destroy(); - } - } - } -}; - -exports.globalAgent = new Agent(); diff --git a/deps/npm/node_modules/agentkeepalive/lib/agent.js b/deps/npm/node_modules/agentkeepalive/lib/agent.js index a51ad597bc3cb8..d0294a69f429ca 100644 --- a/deps/npm/node_modules/agentkeepalive/lib/agent.js +++ b/deps/npm/node_modules/agentkeepalive/lib/agent.js @@ -1,43 +1,70 @@ -/** - * refer: - * * @atimb "Real keep-alive HTTP agent": https://gist.github.com/2963672 - * * https://github.com/joyent/node/blob/master/lib/http.js - * * https://github.com/joyent/node/blob/master/lib/https.js - * * https://github.com/joyent/node/blob/master/lib/_http_agent.js - */ - 'use strict'; -const OriginalAgent = require('./_http_agent').Agent; +const OriginalAgent = require('http').Agent; const ms = require('humanize-ms'); +const debug = require('debug')('agentkeepalive'); +const deprecate = require('depd')('agentkeepalive'); +const { + INIT_SOCKET, + CURRENT_ID, + CREATE_ID, + SOCKET_CREATED_TIME, + SOCKET_NAME, + SOCKET_REQUEST_COUNT, + SOCKET_REQUEST_FINISHED_COUNT, +} = require('./constants'); + +// OriginalAgent come from +// - https://github.com/nodejs/node/blob/v8.12.0/lib/_http_agent.js +// - https://github.com/nodejs/node/blob/v10.12.0/lib/_http_agent.js + +// node <= 10 +let defaultTimeoutListenerCount = 1; +const majorVersion = parseInt(process.version.split('.', 1)[0].substring(1)); +if (majorVersion >= 11 && majorVersion <= 12) { + defaultTimeoutListenerCount = 2; +} else if (majorVersion >= 13) { + defaultTimeoutListenerCount = 3; +} class Agent extends OriginalAgent { constructor(options) { options = options || {}; options.keepAlive = options.keepAlive !== false; // default is keep-alive and 15s free socket timeout - if (options.freeSocketKeepAliveTimeout === undefined) { - options.freeSocketKeepAliveTimeout = 15000; + if (options.freeSocketTimeout === undefined) { + options.freeSocketTimeout = 15000; } - // Legacy API: keepAliveTimeout should be rename to `freeSocketKeepAliveTimeout` + // Legacy API: keepAliveTimeout should be rename to `freeSocketTimeout` if (options.keepAliveTimeout) { - options.freeSocketKeepAliveTimeout = options.keepAliveTimeout; + deprecate('options.keepAliveTimeout is deprecated, please use options.freeSocketTimeout instead'); + options.freeSocketTimeout = options.keepAliveTimeout; + delete options.keepAliveTimeout; + } + // Legacy API: freeSocketKeepAliveTimeout should be rename to `freeSocketTimeout` + if (options.freeSocketKeepAliveTimeout) { + deprecate('options.freeSocketKeepAliveTimeout is deprecated, please use options.freeSocketTimeout instead'); + options.freeSocketTimeout = options.freeSocketKeepAliveTimeout; + delete options.freeSocketKeepAliveTimeout; } - options.freeSocketKeepAliveTimeout = ms(options.freeSocketKeepAliveTimeout); // Sets the socket to timeout after timeout milliseconds of inactivity on the socket. - // By default is double free socket keepalive timeout. + // By default is double free socket timeout. if (options.timeout === undefined) { - options.timeout = options.freeSocketKeepAliveTimeout * 2; // make sure socket default inactivity timeout >= 30s - if (options.timeout < 30000) { - options.timeout = 30000; - } + options.timeout = Math.max(options.freeSocketTimeout * 2, 30000); } + + // support humanize format options.timeout = ms(options.timeout); + options.freeSocketTimeout = ms(options.freeSocketTimeout); + options.socketActiveTTL = options.socketActiveTTL ? ms(options.socketActiveTTL) : 0; super(options); + this[CURRENT_ID] = 0; + + // create socket success counter this.createSocketCount = 0; this.createSocketCountLastCheck = 0; @@ -51,42 +78,157 @@ class Agent extends OriginalAgent { this.errorSocketCount = 0; this.errorSocketCountLastCheck = 0; + // request finished counter this.requestCount = 0; this.requestCountLastCheck = 0; + // including free socket timeout counter this.timeoutSocketCount = 0; this.timeoutSocketCountLastCheck = 0; - this.on('free', s => { - this.requestCount++; - // last enter free queue timestamp - s.lastFreeTime = Date.now(); - }); - this.on('timeout', () => { - this.timeoutSocketCount++; - }); - this.on('close', () => { - this.closeSocketCount++; - }); - this.on('error', () => { - this.errorSocketCount++; + this.on('free', socket => { + // https://github.com/nodejs/node/pull/32000 + // Node.js native agent will check socket timeout eqs agent.options.timeout. + // Use the ttl or freeSocketTimeout to overwrite. + const timeout = this.calcSocketTimeout(socket); + if (timeout > 0 && socket.timeout !== timeout) { + socket.setTimeout(timeout); + } }); } - createSocket(req, options, cb) { - super.createSocket(req, options, (err, socket) => { + get freeSocketKeepAliveTimeout() { + deprecate('agent.freeSocketKeepAliveTimeout is deprecated, please use agent.options.freeSocketTimeout instead'); + return this.options.freeSocketTimeout; + } + + get timeout() { + deprecate('agent.timeout is deprecated, please use agent.options.timeout instead'); + return this.options.timeout; + } + + get socketActiveTTL() { + deprecate('agent.socketActiveTTL is deprecated, please use agent.options.socketActiveTTL instead'); + return this.options.socketActiveTTL; + } + + calcSocketTimeout(socket) { + /** + * return <= 0: should free socket + * return > 0: should update socket timeout + * return undefined: not find custom timeout + */ + let freeSocketTimeout = this.options.freeSocketTimeout; + const socketActiveTTL = this.options.socketActiveTTL; + if (socketActiveTTL) { + // check socketActiveTTL + const aliveTime = Date.now() - socket[SOCKET_CREATED_TIME]; + const diff = socketActiveTTL - aliveTime; + if (diff <= 0) { + return diff; + } + if (freeSocketTimeout && diff < freeSocketTimeout) { + freeSocketTimeout = diff; + } + } + // set freeSocketTimeout + if (freeSocketTimeout) { + // set free keepalive timer + // try to use socket custom freeSocketTimeout first, support headers['keep-alive'] + // https://github.com/node-modules/urllib/blob/b76053020923f4d99a1c93cf2e16e0c5ba10bacf/lib/urllib.js#L498 + const customFreeSocketTimeout = socket.freeSocketTimeout || socket.freeSocketKeepAliveTimeout; + return customFreeSocketTimeout || freeSocketTimeout; + } + } + + keepSocketAlive(socket) { + const result = super.keepSocketAlive(socket); + // should not keepAlive, do nothing + if (!result) return result; + + const customTimeout = this.calcSocketTimeout(socket); + if (typeof customTimeout === 'undefined') { + return true; + } + if (customTimeout <= 0) { + debug('%s(requests: %s, finished: %s) free but need to destroy by TTL, request count %s, diff is %s', + socket[SOCKET_NAME], socket[SOCKET_REQUEST_COUNT], socket[SOCKET_REQUEST_FINISHED_COUNT], customTimeout); + return false; + } + if (socket.timeout !== customTimeout) { + socket.setTimeout(customTimeout); + } + return true; + } + + // only call on addRequest + reuseSocket(...args) { + // reuseSocket(socket, req) + super.reuseSocket(...args); + const socket = args[0]; + const req = args[1]; + req.reusedSocket = true; + const agentTimeout = this.options.timeout; + if (getSocketTimeout(socket) !== agentTimeout) { + // reset timeout before use + socket.setTimeout(agentTimeout); + debug('%s reset timeout to %sms', socket[SOCKET_NAME], agentTimeout); + } + socket[SOCKET_REQUEST_COUNT]++; + debug('%s(requests: %s, finished: %s) reuse on addRequest, timeout %sms', + socket[SOCKET_NAME], socket[SOCKET_REQUEST_COUNT], socket[SOCKET_REQUEST_FINISHED_COUNT], + getSocketTimeout(socket)); + } + + [CREATE_ID]() { + const id = this[CURRENT_ID]++; + if (this[CURRENT_ID] === Number.MAX_SAFE_INTEGER) this[CURRENT_ID] = 0; + return id; + } + + [INIT_SOCKET](socket, options) { + // bugfix here. + // https on node 8, 10 won't set agent.options.timeout by default + // TODO: need to fix on node itself + if (options.timeout) { + const timeout = getSocketTimeout(socket); + if (!timeout) { + socket.setTimeout(options.timeout); + } + } + + if (this.options.keepAlive) { + // Disable Nagle's algorithm: http://blog.caustik.com/2012/04/08/scaling-node-js-to-100k-concurrent-connections/ + // https://fengmk2.com/benchmark/nagle-algorithm-delayed-ack-mock.html + socket.setNoDelay(true); + } + this.createSocketCount++; + if (this.options.socketActiveTTL) { + socket[SOCKET_CREATED_TIME] = Date.now(); + } + // don't show the hole '-----BEGIN CERTIFICATE----' key string + socket[SOCKET_NAME] = `sock[${this[CREATE_ID]()}#${options._agentKey}]`.split('-----BEGIN', 1)[0]; + socket[SOCKET_REQUEST_COUNT] = 1; + socket[SOCKET_REQUEST_FINISHED_COUNT] = 0; + installListeners(this, socket, options); + } + + createConnection(options, oncreate) { + let called = false; + const onNewCreate = (err, socket) => { + if (called) return; + called = true; + if (err) { this.createSocketErrorCount++; - return cb(err); + return oncreate(err); } - if (this.keepAlive) { - // Disable Nagle's algorithm: http://blog.caustik.com/2012/04/08/scaling-node-js-to-100k-concurrent-connections/ - // https://fengmk2.com/benchmark/nagle-algorithm-delayed-ack-mock.html - socket.setNoDelay(true); - } - this.createSocketCount++; - cb(null, socket); - }); + this[INIT_SOCKET](socket, options); + oncreate(err, socket); + }; + + const newSocket = super.createConnection(options, onNewCreate); + if (newSocket) onNewCreate(null, newSocket); } get statusChanged() { @@ -122,6 +264,128 @@ class Agent extends OriginalAgent { } } +// node 8 don't has timeout attribute on socket +// https://github.com/nodejs/node/pull/21204/files#diff-e6ef024c3775d787c38487a6309e491dR408 +function getSocketTimeout(socket) { + return socket.timeout || socket._idleTimeout; +} + +function installListeners(agent, socket, options) { + debug('%s create, timeout %sms', socket[SOCKET_NAME], getSocketTimeout(socket)); + + // listener socket events: close, timeout, error, free + function onFree() { + // create and socket.emit('free') logic + // https://github.com/nodejs/node/blob/master/lib/_http_agent.js#L311 + // no req on the socket, it should be the new socket + if (!socket._httpMessage && socket[SOCKET_REQUEST_COUNT] === 1) return; + + socket[SOCKET_REQUEST_FINISHED_COUNT]++; + agent.requestCount++; + debug('%s(requests: %s, finished: %s) free', + socket[SOCKET_NAME], socket[SOCKET_REQUEST_COUNT], socket[SOCKET_REQUEST_FINISHED_COUNT]); + + // should reuse on pedding requests? + const name = agent.getName(options); + if (socket.writable && agent.requests[name] && agent.requests[name].length) { + // will be reuse on agent free listener + socket[SOCKET_REQUEST_COUNT]++; + debug('%s(requests: %s, finished: %s) will be reuse on agent free event', + socket[SOCKET_NAME], socket[SOCKET_REQUEST_COUNT], socket[SOCKET_REQUEST_FINISHED_COUNT]); + } + } + socket.on('free', onFree); + + function onClose(isError) { + debug('%s(requests: %s, finished: %s) close, isError: %s', + socket[SOCKET_NAME], socket[SOCKET_REQUEST_COUNT], socket[SOCKET_REQUEST_FINISHED_COUNT], isError); + agent.closeSocketCount++; + } + socket.on('close', onClose); + + // start socket timeout handler + function onTimeout() { + // onTimeout and emitRequestTimeout(_http_client.js) + // https://github.com/nodejs/node/blob/v12.x/lib/_http_client.js#L711 + const listenerCount = socket.listeners('timeout').length; + // node <= 10, default listenerCount is 1, onTimeout + // 11 < node <= 12, default listenerCount is 2, onTimeout and emitRequestTimeout + // node >= 13, default listenerCount is 3, onTimeout, + // onTimeout(https://github.com/nodejs/node/pull/32000/files#diff-5f7fb0850412c6be189faeddea6c5359R333) + // and emitRequestTimeout + const timeout = getSocketTimeout(socket); + const req = socket._httpMessage; + const reqTimeoutListenerCount = req && req.listeners('timeout').length || 0; + debug('%s(requests: %s, finished: %s) timeout after %sms, listeners %s, defaultTimeoutListenerCount %s, hasHttpRequest %s, HttpRequest timeoutListenerCount %s', + socket[SOCKET_NAME], socket[SOCKET_REQUEST_COUNT], socket[SOCKET_REQUEST_FINISHED_COUNT], + timeout, listenerCount, defaultTimeoutListenerCount, !!req, reqTimeoutListenerCount); + if (debug.enabled) { + debug('timeout listeners: %s', socket.listeners('timeout').map(f => f.name).join(', ')); + } + agent.timeoutSocketCount++; + const name = agent.getName(options); + if (agent.freeSockets[name] && agent.freeSockets[name].indexOf(socket) !== -1) { + // free socket timeout, destroy quietly + socket.destroy(); + // Remove it from freeSockets list immediately to prevent new requests + // from being sent through this socket. + agent.removeSocket(socket, options); + debug('%s is free, destroy quietly', socket[SOCKET_NAME]); + } else { + // if there is no any request socket timeout handler, + // agent need to handle socket timeout itself. + // + // custom request socket timeout handle logic must follow these rules: + // 1. Destroy socket first + // 2. Must emit socket 'agentRemove' event tell agent remove socket + // from freeSockets list immediately. + // Otherise you may be get 'socket hang up' error when reuse + // free socket and timeout happen in the same time. + if (reqTimeoutListenerCount === 0) { + const error = new Error('Socket timeout'); + error.code = 'ERR_SOCKET_TIMEOUT'; + error.timeout = timeout; + // must manually call socket.end() or socket.destroy() to end the connection. + // https://nodejs.org/dist/latest-v10.x/docs/api/net.html#net_socket_settimeout_timeout_callback + socket.destroy(error); + agent.removeSocket(socket, options); + debug('%s destroy with timeout error', socket[SOCKET_NAME]); + } + } + } + socket.on('timeout', onTimeout); + + function onError(err) { + const listenerCount = socket.listeners('error').length; + debug('%s(requests: %s, finished: %s) error: %s, listenerCount: %s', + socket[SOCKET_NAME], socket[SOCKET_REQUEST_COUNT], socket[SOCKET_REQUEST_FINISHED_COUNT], + err, listenerCount); + agent.errorSocketCount++; + if (listenerCount === 1) { + // if socket don't contain error event handler, don't catch it, emit it again + debug('%s emit uncaught error event', socket[SOCKET_NAME]); + socket.removeListener('error', onError); + socket.emit('error', err); + } + } + socket.on('error', onError); + + function onRemove() { + debug('%s(requests: %s, finished: %s) agentRemove', + socket[SOCKET_NAME], + socket[SOCKET_REQUEST_COUNT], socket[SOCKET_REQUEST_FINISHED_COUNT]); + // We need this function for cases like HTTP 'upgrade' + // (defined by WebSockets) where we need to remove a socket from the + // pool because it'll be locked up indefinitely + socket.removeListener('close', onClose); + socket.removeListener('error', onError); + socket.removeListener('free', onFree); + socket.removeListener('timeout', onTimeout); + socket.removeListener('agentRemove', onRemove); + } + socket.on('agentRemove', onRemove); +} + module.exports = Agent; function inspect(obj) { diff --git a/deps/npm/node_modules/agentkeepalive/lib/constants.js b/deps/npm/node_modules/agentkeepalive/lib/constants.js new file mode 100644 index 00000000000000..ca7ab97eacd9c9 --- /dev/null +++ b/deps/npm/node_modules/agentkeepalive/lib/constants.js @@ -0,0 +1,14 @@ +'use strict'; + +module.exports = { + // agent + CURRENT_ID: Symbol('agentkeepalive#currentId'), + CREATE_ID: Symbol('agentkeepalive#createId'), + INIT_SOCKET: Symbol('agentkeepalive#initSocket'), + CREATE_HTTPS_CONNECTION: Symbol('agentkeepalive#createHttpsConnection'), + // socket + SOCKET_CREATED_TIME: Symbol('agentkeepalive#socketCreatedTime'), + SOCKET_NAME: Symbol('agentkeepalive#socketName'), + SOCKET_REQUEST_COUNT: Symbol('agentkeepalive#socketRequestCount'), + SOCKET_REQUEST_FINISHED_COUNT: Symbol('agentkeepalive#socketRequestFinishedCount'), +}; diff --git a/deps/npm/node_modules/agentkeepalive/lib/https_agent.js b/deps/npm/node_modules/agentkeepalive/lib/https_agent.js index e6d58a3df9274e..73f529d65e7ffe 100644 --- a/deps/npm/node_modules/agentkeepalive/lib/https_agent.js +++ b/deps/npm/node_modules/agentkeepalive/lib/https_agent.js @@ -1,12 +1,11 @@ -/** - * Https Agent base on custom http agent - */ - 'use strict'; -const https = require('https'); +const OriginalHttpsAgent = require('https').Agent; const HttpAgent = require('./agent'); -const OriginalHttpsAgent = https.Agent; +const { + INIT_SOCKET, + CREATE_HTTPS_CONNECTION, +} = require('./constants'); class HttpsAgent extends HttpAgent { constructor(options) { @@ -15,6 +14,7 @@ class HttpsAgent extends HttpAgent { this.defaultPort = 443; this.protocol = 'https:'; this.maxCachedSessions = this.options.maxCachedSessions; + /* istanbul ignore next */ if (this.maxCachedSessions === undefined) { this.maxCachedSessions = 100; } @@ -24,16 +24,25 @@ class HttpsAgent extends HttpAgent { list: [], }; } + + createConnection(options) { + const socket = this[CREATE_HTTPS_CONNECTION](options); + this[INIT_SOCKET](socket, options); + return socket; + } } +// https://github.com/nodejs/node/blob/master/lib/https.js#L89 +HttpsAgent.prototype[CREATE_HTTPS_CONNECTION] = OriginalHttpsAgent.prototype.createConnection; + [ - 'createConnection', 'getName', '_getSession', '_cacheSession', // https://github.com/nodejs/node/pull/4982 '_evictSession', ].forEach(function(method) { + /* istanbul ignore next */ if (typeof OriginalHttpsAgent.prototype[method] === 'function') { HttpsAgent.prototype[method] = OriginalHttpsAgent.prototype[method]; } diff --git a/deps/npm/node_modules/agentkeepalive/package.json b/deps/npm/node_modules/agentkeepalive/package.json index ba6470dba8a135..6dfcf8918ff231 100644 --- a/deps/npm/node_modules/agentkeepalive/package.json +++ b/deps/npm/node_modules/agentkeepalive/package.json @@ -1,83 +1,66 @@ { - "_from": "agentkeepalive@^3.4.1", - "_id": "agentkeepalive@3.5.2", - "_inBundle": false, - "_integrity": "sha512-e0L/HNe6qkQ7H19kTlRRqUibEAwDK5AFk6y3PtMsuut2VAH6+Q4xZml1tNDJD7kSAyqmbG/K08K5WEJYtUrSlQ==", - "_location": "/agentkeepalive", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "agentkeepalive@^3.4.1", - "name": "agentkeepalive", - "escapedName": "agentkeepalive", - "rawSpec": "^3.4.1", - "saveSpec": null, - "fetchSpec": "^3.4.1" - }, - "_requiredBy": [ - "/make-fetch-happen" - ], - "_resolved": "https://registry.npmjs.org/agentkeepalive/-/agentkeepalive-3.5.2.tgz", - "_shasum": "a113924dd3fa24a0bc3b78108c450c2abee00f67", - "_spec": "agentkeepalive@^3.4.1", - "_where": "/Users/isaacs/dev/npm/cli/node_modules/make-fetch-happen", - "author": { - "name": "fengmk2", - "email": "fengmk2@gmail.com", - "url": "https://fengmk2.com" - }, - "browser": "browser.js", - "bugs": { - "url": "https://github.com/node-modules/agentkeepalive/issues" - }, - "bundleDependencies": false, - "ci": { - "version": "4, 6, 8, 10" - }, - "dependencies": { - "humanize-ms": "^1.2.1" - }, - "deprecated": false, + "name": "agentkeepalive", + "version": "4.1.3", "description": "Missing keepalive http.Agent", - "devDependencies": { - "autod": "^3.0.1", - "egg-bin": "^1.11.1", - "egg-ci": "^1.8.0", - "eslint": "^4.19.1", - "eslint-config-egg": "^6.0.0", - "pedding": "^1.1.0" - }, - "engines": { - "node": ">= 4.0.0" - }, + "main": "index.js", + "browser": "browser.js", "files": [ "index.js", "index.d.ts", "browser.js", "lib" ], - "homepage": "https://github.com/node-modules/agentkeepalive#readme", + "scripts": { + "test": "npm run lint && egg-bin test --full-trace", + "test-local": "egg-bin test --full-trace", + "cov": "cross-env DEBUG=agentkeepalive egg-bin cov --full-trace", + "ci": "npm run lint && npm run cov", + "lint": "eslint lib test index.js", + "autod": "autod" + }, + "repository": { + "type": "git", + "url": "git://github.com/node-modules/agentkeepalive.git" + }, + "bugs": { + "url": "https://github.com/node-modules/agentkeepalive/issues" + }, "keywords": [ "http", "https", "agent", "keepalive", - "agentkeepalive" + "agentkeepalive", + "HttpAgent", + "HttpsAgent" ], - "license": "MIT", - "main": "index.js", - "name": "agentkeepalive", - "repository": { - "type": "git", - "url": "git://github.com/node-modules/agentkeepalive.git" + "dependencies": { + "debug": "^4.1.0", + "depd": "^1.1.2", + "humanize-ms": "^1.2.1" }, - "scripts": { - "autod": "autod", - "ci": "npm run lint && npm run cov", - "cov": "egg-bin cov", - "lint": "eslint lib test index.js", - "test": "egg-bin test" + "devDependencies": { + "autod": "^3.0.1", + "coffee": "^5.3.0", + "cross-env": "^6.0.3", + "egg-bin": "^4.9.0", + "egg-ci": "^1.10.0", + "eslint": "^5.7.0", + "eslint-config-egg": "^7.1.0", + "mm": "^2.4.1", + "pedding": "^1.1.0", + "typescript": "^3.8.3" + }, + "engines": { + "node": ">= 8.0.0" + }, + "ci": { + "type": "github", + "os": { + "github": "linux" + }, + "version": "8, 10, 12, 14" }, - "version": "3.5.2" + "author": "fengmk2 (https://fengmk2.com)", + "license": "MIT" } diff --git a/deps/npm/node_modules/aggregate-error/index.d.ts b/deps/npm/node_modules/aggregate-error/index.d.ts new file mode 100644 index 00000000000000..502bf7ad1d0dfb --- /dev/null +++ b/deps/npm/node_modules/aggregate-error/index.d.ts @@ -0,0 +1,51 @@ +/** +Create an error from multiple errors. +*/ +declare class AggregateError extends Error implements Iterable { + readonly name: 'AggregateError'; + + /** + @param errors - If a string, a new `Error` is created with the string as the error message. If a non-Error object, a new `Error` is created with all properties from the object copied over. + @returns An Error that is also an [`Iterable`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Iterators_and_Generators#Iterables) for the individual errors. + + @example + ``` + import AggregateError = require('aggregate-error'); + + const error = new AggregateError([new Error('foo'), 'bar', {message: 'baz'}]); + + throw error; + + // AggregateError: + // Error: foo + // at Object. (/Users/sindresorhus/dev/aggregate-error/example.js:3:33) + // Error: bar + // at Object. (/Users/sindresorhus/dev/aggregate-error/example.js:3:13) + // Error: baz + // at Object. (/Users/sindresorhus/dev/aggregate-error/example.js:3:13) + // at AggregateError (/Users/sindresorhus/dev/aggregate-error/index.js:19:3) + // at Object. (/Users/sindresorhus/dev/aggregate-error/example.js:3:13) + // at Module._compile (module.js:556:32) + // at Object.Module._extensions..js (module.js:565:10) + // at Module.load (module.js:473:32) + // at tryModuleLoad (module.js:432:12) + // at Function.Module._load (module.js:424:3) + // at Module.runMain (module.js:590:10) + // at run (bootstrap_node.js:394:7) + // at startup (bootstrap_node.js:149:9) + + + for (const individualError of error) { + console.log(individualError); + } + //=> [Error: foo] + //=> [Error: bar] + //=> [Error: baz] + ``` + */ + constructor(errors: ReadonlyArray); + + [Symbol.iterator](): IterableIterator; +} + +export = AggregateError; diff --git a/deps/npm/node_modules/aggregate-error/index.js b/deps/npm/node_modules/aggregate-error/index.js new file mode 100644 index 00000000000000..ba5bf022116855 --- /dev/null +++ b/deps/npm/node_modules/aggregate-error/index.js @@ -0,0 +1,47 @@ +'use strict'; +const indentString = require('indent-string'); +const cleanStack = require('clean-stack'); + +const cleanInternalStack = stack => stack.replace(/\s+at .*aggregate-error\/index.js:\d+:\d+\)?/g, ''); + +class AggregateError extends Error { + constructor(errors) { + if (!Array.isArray(errors)) { + throw new TypeError(`Expected input to be an Array, got ${typeof errors}`); + } + + errors = [...errors].map(error => { + if (error instanceof Error) { + return error; + } + + if (error !== null && typeof error === 'object') { + // Handle plain error objects with message property and/or possibly other metadata + return Object.assign(new Error(error.message), error); + } + + return new Error(error); + }); + + let message = errors + .map(error => { + // The `stack` property is not standardized, so we can't assume it exists + return typeof error.stack === 'string' ? cleanInternalStack(cleanStack(error.stack)) : String(error); + }) + .join('\n'); + message = '\n' + indentString(message, 4); + super(message); + + this.name = 'AggregateError'; + + Object.defineProperty(this, '_errors', {value: errors}); + } + + * [Symbol.iterator]() { + for (const error of this._errors) { + yield error; + } + } +} + +module.exports = AggregateError; diff --git a/deps/npm/node_modules/boxen/license b/deps/npm/node_modules/aggregate-error/license similarity index 100% rename from deps/npm/node_modules/boxen/license rename to deps/npm/node_modules/aggregate-error/license diff --git a/deps/npm/node_modules/aggregate-error/package.json b/deps/npm/node_modules/aggregate-error/package.json new file mode 100644 index 00000000000000..74fcc37611e642 --- /dev/null +++ b/deps/npm/node_modules/aggregate-error/package.json @@ -0,0 +1,41 @@ +{ + "name": "aggregate-error", + "version": "3.1.0", + "description": "Create an error from multiple errors", + "license": "MIT", + "repository": "sindresorhus/aggregate-error", + "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": [ + "aggregate", + "error", + "combine", + "multiple", + "many", + "collection", + "iterable", + "iterator" + ], + "dependencies": { + "clean-stack": "^2.0.0", + "indent-string": "^4.0.0" + }, + "devDependencies": { + "ava": "^2.4.0", + "tsd": "^0.7.1", + "xo": "^0.25.3" + } +} diff --git a/deps/npm/node_modules/aggregate-error/readme.md b/deps/npm/node_modules/aggregate-error/readme.md new file mode 100644 index 00000000000000..850de98a8e8f4f --- /dev/null +++ b/deps/npm/node_modules/aggregate-error/readme.md @@ -0,0 +1,61 @@ +# aggregate-error [![Build Status](https://travis-ci.org/sindresorhus/aggregate-error.svg?branch=master)](https://travis-ci.org/sindresorhus/aggregate-error) + +> Create an error from multiple errors + + +## Install + +``` +$ npm install aggregate-error +``` + + +## Usage + +```js +const AggregateError = require('aggregate-error'); + +const error = new AggregateError([new Error('foo'), 'bar', {message: 'baz'}]); + +throw error; +/* +AggregateError: + Error: foo + at Object. (/Users/sindresorhus/dev/aggregate-error/example.js:3:33) + Error: bar + at Object. (/Users/sindresorhus/dev/aggregate-error/example.js:3:13) + Error: baz + at Object. (/Users/sindresorhus/dev/aggregate-error/example.js:3:13) + at AggregateError (/Users/sindresorhus/dev/aggregate-error/index.js:19:3) + at Object. (/Users/sindresorhus/dev/aggregate-error/example.js:3:13) + at Module._compile (module.js:556:32) + at Object.Module._extensions..js (module.js:565:10) + at Module.load (module.js:473:32) + at tryModuleLoad (module.js:432:12) + at Function.Module._load (module.js:424:3) + at Module.runMain (module.js:590:10) + at run (bootstrap_node.js:394:7) + at startup (bootstrap_node.js:149:9) +*/ + +for (const individualError of error) { + console.log(individualError); +} +//=> [Error: foo] +//=> [Error: bar] +//=> [Error: baz] +``` + + +## API + +### AggregateError(errors) + +Returns an `Error` that is also an [`Iterable`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Iterators_and_Generators#Iterables) for the individual errors. + +#### errors + +Type: `Array` + +If a string, a new `Error` is created with the string as the error message.
    +If a non-Error object, a new `Error` is created with all properties from the object copied over. diff --git a/deps/npm/node_modules/ajv/LICENSE b/deps/npm/node_modules/ajv/LICENSE index 810539685b8aec..96ee719987f778 100644 --- a/deps/npm/node_modules/ajv/LICENSE +++ b/deps/npm/node_modules/ajv/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2015 Evgeny Poberezkin +Copyright (c) 2015-2017 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/deps/npm/node_modules/ajv/README.md b/deps/npm/node_modules/ajv/README.md index 387c81d8ca6750..3a88820d82c481 100644 --- a/deps/npm/node_modules/ajv/README.md +++ b/deps/npm/node_modules/ajv/README.md @@ -1,31 +1,77 @@ -Ajv logo +Ajv logo # Ajv: Another JSON Schema Validator -The fastest JSON Schema validator for Node.js and browser with draft 6 support. +The fastest JSON Schema validator for Node.js and browser. Supports draft-04/06/07. - -[![Build Status](https://travis-ci.org/epoberezkin/ajv.svg?branch=master)](https://travis-ci.org/epoberezkin/ajv) -[![npm version](https://badge.fury.io/js/ajv.svg)](https://www.npmjs.com/package/ajv) -[![npm@beta](https://img.shields.io/npm/v/ajv/beta.svg)](https://github.com/epoberezkin/ajv/tree/beta) +[![Build Status](https://travis-ci.org/ajv-validator/ajv.svg?branch=master)](https://travis-ci.org/ajv-validator/ajv) +[![npm](https://img.shields.io/npm/v/ajv.svg)](https://www.npmjs.com/package/ajv) [![npm downloads](https://img.shields.io/npm/dm/ajv.svg)](https://www.npmjs.com/package/ajv) -[![Coverage Status](https://coveralls.io/repos/epoberezkin/ajv/badge.svg?branch=master&service=github)](https://coveralls.io/github/epoberezkin/ajv?branch=master) -[![Greenkeeper badge](https://badges.greenkeeper.io/epoberezkin/ajv.svg)](https://greenkeeper.io/) +[![Coverage Status](https://coveralls.io/repos/github/ajv-validator/ajv/badge.svg?branch=master)](https://coveralls.io/github/ajv-validator/ajv?branch=master) [![Gitter](https://img.shields.io/gitter/room/ajv-validator/ajv.svg)](https://gitter.im/ajv-validator/ajv) +[![GitHub Sponsors](https://img.shields.io/badge/$-sponsors-brightgreen)](https://github.com/sponsors/epoberezkin) + + +## 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/) + +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](https://tools.ietf.org/html/draft-ucarion-json-type-definition-04). + +Ajv also joined [OpenJS Foundation](https://openjsf.org/) – having this support will help ensure the longevity and stability of Ajv for all its users. + +This [blog post](https://www.poberezkin.com/posts/2020-08-14-ajv-json-validator-mozilla-open-source-grant-openjs-foundation.html) has more details. + +I am looking for the long term maintainers of Ajv – working with [ReadySet](https://www.thereadyset.co/), also sponsored by Mozilla, to establish clear guidelines for the role of a "maintainer" and the contribution standards, and to encourage a wider, more inclusive, contribution from the community. + + +## Please [sponsor Ajv development](https://github.com/sponsors/epoberezkin) + +Since I asked to support Ajv development 40 people and 6 organizations contributed via GitHub and OpenCollective - this support helped receiving the MOSS grant! + +Your continuing support is very important - the funds will be used to develop and maintain Ajv once the next major version is released. + +Please sponsor Ajv via: +- [GitHub sponsors page](https://github.com/sponsors/epoberezkin) (GitHub will match it) +- [Ajv Open Collective️](https://opencollective.com/ajv) + +Thank you. + + +#### Open Collective sponsors + -__Please note__: Ajv [version 6](https://github.com/epoberezkin/ajv/tree/beta) with [JSON Schema draft-07](http://json-schema.org/work-in-progress) support is released. Use `npm install ajv@beta` to install. + + + + + + + + + + -## Using version 5 +## Using version 6 -[JSON Schema draft-06](https://trac.tools.ietf.org/html/draft-wright-json-schema-validation-01) is published. +[JSON Schema draft-07](http://json-schema.org/latest/json-schema-validation.html) is published. -[Ajv version 5.0.0](https://github.com/epoberezkin/ajv/releases/tag/5.0.0) that supports draft-06 is released. It may require either migrating your schemas or updating your code (to continue using draft-04 and v5 schemas). +[Ajv version 6.0.0](https://github.com/ajv-validator/ajv/releases/tag/v6.0.0) that supports draft-07 is released. It may require either migrating your schemas or updating your code (to continue using draft-04 and v5 schemas, draft-06 schemas will be supported without changes). -__Please note__: To use Ajv with draft-04 schemas you need to explicitly add meta-schema to the validator instance: +__Please note__: To use Ajv with draft-06 schemas you need to explicitly add the meta-schema to the validator instance: ```javascript +ajv.addMetaSchema(require('ajv/lib/refs/json-schema-draft-06.json')); +``` + +To use Ajv with draft-04 schemas in addition to explicitly adding meta-schema you also need to use option schemaId: + +```javascript +var ajv = new Ajv({schemaId: 'id'}); +// If you want to use both draft-04 and draft-06/07 schemas: +// var ajv = new Ajv({schemaId: 'auto'}); ajv.addMetaSchema(require('ajv/lib/refs/json-schema-draft-04.json')); ``` @@ -35,11 +81,13 @@ ajv.addMetaSchema(require('ajv/lib/refs/json-schema-draft-04.json')); - [Performance](#performance) - [Features](#features) - [Getting started](#getting-started) -- [Frequently Asked Questions](https://github.com/epoberezkin/ajv/blob/master/FAQ.md) +- [Frequently Asked Questions](https://github.com/ajv-validator/ajv/blob/master/FAQ.md) - [Using in browser](#using-in-browser) + - [Ajv and Content Security Policies (CSP)](#ajv-and-content-security-policies-csp) - [Command line interface](#command-line-interface) - Validation - [Keywords](#validation-keywords) + - [Annotation keywords](#annotation-keywords) - [Formats](#formats) - [Combining schemas with $ref](#ref) - [$data reference](#data-reference) @@ -47,6 +95,12 @@ ajv.addMetaSchema(require('ajv/lib/refs/json-schema-draft-04.json')); - [Defining custom keywords](#defining-custom-keywords) - [Asynchronous schema compilation](#asynchronous-schema-compilation) - [Asynchronous validation](#asynchronous-validation) +- [Security considerations](#security-considerations) + - [Security contact](#security-contact) + - [Untrusted schemas](#untrusted-schemas) + - [Circular references in objects](#circular-references-in-javascript-objects) + - [Trusted schemas](#security-risks-of-trusted-schemas) + - [ReDoS attack](#redos-attack) - Modifying data during validation - [Filtering data](#filtering-data) - [Assigning defaults](#assigning-defaults) @@ -55,14 +109,16 @@ ajv.addMetaSchema(require('ajv/lib/refs/json-schema-draft-04.json')); - [Methods](#api) - [Options](#options) - [Validation errors](#validation-errors) +- [Plugins](#plugins) - [Related packages](#related-packages) -- [Packages using Ajv](#some-packages-using-ajv) -- [Tests, Contributing, History, License](#tests) +- [Some packages using Ajv](#some-packages-using-ajv) +- [Tests, Contributing, Changes history](#tests) +- [Support, Code of conduct, License](#open-source-software-support) ## Performance -Ajv generates code using [doT templates](https://github.com/olado/doT) to turn JSON schemas into super-fast validation functions that are efficient for v8 optimization. +Ajv generates code using [doT templates](https://github.com/olado/doT) to turn JSON Schemas into super-fast validation functions that are efficient for v8 optimization. Currently Ajv is the fastest and the most standard compliant validator according to these benchmarks: @@ -79,30 +135,28 @@ Performance of different validators by [json-schema-benchmark](https://github.co ## Features -- Ajv implements full JSON Schema [draft 6](http://json-schema.org/) and draft 4 standards: - - all validation keywords (see [JSON Schema validation keywords](https://github.com/epoberezkin/ajv/blob/master/KEYWORDS.md)) +- Ajv implements full JSON Schema [draft-06/07](http://json-schema.org/) and draft-04 standards: + - all validation keywords (see [JSON Schema validation keywords](https://github.com/ajv-validator/ajv/blob/master/KEYWORDS.md)) - full support of remote refs (remote schemas have to be added with `addSchema` or compiled to be available) - support of circular references between schemas - correct string lengths for strings with unicode pairs (can be turned off) - - [formats](#formats) defined by JSON Schema draft 4 standard and custom formats (can be turned off) + - [formats](#formats) defined by JSON Schema draft-07 standard and custom formats (can be turned off) - [validates schemas against meta-schema](#api-validateschema) -- supports [browsers](#using-in-browser) and Node.js 0.10-8.x +- supports [browsers](#using-in-browser) and Node.js 0.10-14.x - [asynchronous loading](#asynchronous-schema-compilation) of referenced schemas during compilation - "All errors" validation mode with [option allErrors](#options) - [error messages with parameters](#validation-errors) describing error reasons to allow creating custom error messages -- i18n error messages support with [ajv-i18n](https://github.com/epoberezkin/ajv-i18n) package +- i18n error messages support with [ajv-i18n](https://github.com/ajv-validator/ajv-i18n) package - [filtering data](#filtering-data) from additional properties - [assigning defaults](#assigning-defaults) to missing properties and items - [coercing data](#coercing-data-types) to the types specified in `type` keywords - [custom keywords](#defining-custom-keywords) -- draft-6 keywords `const`, `contains` and `propertyNames` -- draft-6 boolean schemas (`true`/`false` as a schema to always pass/fail). -- keywords `switch`, `patternRequired`, `formatMaximum` / `formatMinimum` and `formatExclusiveMaximum` / `formatExclusiveMinimum` from [JSON-schema extension proposals](https://github.com/json-schema/json-schema/wiki/v5-Proposals) with [ajv-keywords](https://github.com/epoberezkin/ajv-keywords) package +- draft-06/07 keywords `const`, `contains`, `propertyNames` and `if/then/else` +- draft-06 boolean schemas (`true`/`false` as a schema to always pass/fail). +- keywords `switch`, `patternRequired`, `formatMaximum` / `formatMinimum` and `formatExclusiveMaximum` / `formatExclusiveMinimum` from [JSON Schema extension proposals](https://github.com/json-schema/json-schema/wiki/v5-Proposals) with [ajv-keywords](https://github.com/ajv-validator/ajv-keywords) package - [$data reference](#data-reference) to use values from the validated data as values for the schema keywords - [asynchronous validation](#asynchronous-validation) of custom formats and keywords -Currently Ajv is the only validator that passes all the tests from [JSON Schema Test Suite](https://github.com/json-schema/JSON-Schema-Test-Suite) (according to [json-schema-benchmark](https://github.com/ebdrup/json-schema-benchmark), apart from the test that requires that `1.0` is not an integer that is impossible to satisfy in JavaScript). - ## Install @@ -110,12 +164,6 @@ Currently Ajv is the only validator that passes all the tests from [JSON Schema npm install ajv ``` -or to install [version 6](https://github.com/epoberezkin/ajv/tree/beta): - -``` -npm install ajv@beta -``` - ## Getting started @@ -125,7 +173,11 @@ Try it in the Node.js REPL: https://tonicdev.com/npm/ajv The fastest validation call: ```javascript +// Node.js require: var Ajv = require('ajv'); +// or ESM/TypeScript import +import Ajv from 'ajv'; + var ajv = new Ajv(); // options can be passed, e.g. {allErrors: true} var validate = ajv.compile(schema); var valid = validate(data); @@ -159,6 +211,10 @@ The best performance is achieved when using compiled functions returned by `comp __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](#validation-errors) +__Note for TypeScript users__: `ajv` provides its own TypeScript declarations +out of the box, so you don't need to install the deprecated `@types/ajv` +module. + ## Using in browser @@ -179,56 +235,85 @@ Ajv is tested with these browsers: [![Sauce Test Status](https://saucelabs.com/browser-matrix/epoberezkin.svg)](https://saucelabs.com/u/epoberezkin) -__Please note__: some frameworks, e.g. Dojo, may redefine global require in such way that is not compatible with CommonJS module format. In such case Ajv bundle has to be loaded before the framework and then you can use global Ajv (see issue [#234](https://github.com/epoberezkin/ajv/issues/234)). +__Please note__: some frameworks, e.g. Dojo, may redefine global require in such way that is not compatible with CommonJS module format. In such 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)). + + +### Ajv and Content Security Policies (CSP) + +If you're using Ajv to compile a schema (the typical use) in a browser document that is loaded with a Content Security Policy (CSP), that policy will require a `script-src` directive that includes the value `'unsafe-eval'`. +:warning: NOTE, however, that `unsafe-eval` is NOT recommended in a secure CSP[[1]](https://developer.chrome.com/extensions/contentSecurityPolicy#relaxing-eval), as it has the potential to open the document to cross-site scripting (XSS) attacks. + +In order to make use of Ajv without easing your CSP, you can [pre-compile a schema using the CLI](https://github.com/ajv-validator/ajv-cli#compile-schemas). This will transpile the schema JSON into a JavaScript file that exports a `validate` function that works simlarly to a schema compiled at runtime. + +Note that pre-compilation of schemas is performed using [ajv-pack](https://github.com/ajv-validator/ajv-pack) and there are [some limitations to the schema features it can compile](https://github.com/ajv-validator/ajv-pack#limitations). A successfully pre-compiled schema is equivalent to the same schema compiled at runtime. ## Command line interface -CLI is available as a separate npm package [ajv-cli](https://github.com/jessedc/ajv-cli). It supports: +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 -- BETA: generating standalone module exporting a validation function to be used without Ajv (using [ajv-pack](https://github.com/epoberezkin/ajv-pack)) -- migrate schemas to draft-06 (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 +- compiling JSON Schemas to test their validity +- BETA: generating standalone module exporting a validation function to be used without Ajv (using [ajv-pack](https://github.com/ajv-validator/ajv-pack)) +- migrate schemas to draft-07 (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 - custom meta-schemas -- files in JSON and JavaScript format +- files in JSON, JSON5, YAML, and JavaScript format - all Ajv options - reporting changes in data after validation in [JSON-patch](https://tools.ietf.org/html/rfc6902) format ## Validation keywords -Ajv supports all validation keywords from draft 4 of JSON-schema standard: +Ajv supports all validation keywords from draft-07 of JSON Schema standard: -- [type](https://github.com/epoberezkin/ajv/blob/master/KEYWORDS.md#type) -- [for numbers](https://github.com/epoberezkin/ajv/blob/master/KEYWORDS.md#keywords-for-numbers) - maximum, minimum, exclusiveMaximum, exclusiveMinimum, multipleOf -- [for strings](https://github.com/epoberezkin/ajv/blob/master/KEYWORDS.md#keywords-for-strings) - maxLength, minLength, pattern, format -- [for arrays](https://github.com/epoberezkin/ajv/blob/master/KEYWORDS.md#keywords-for-arrays) - maxItems, minItems, uniqueItems, items, additionalItems, [contains](https://github.com/epoberezkin/ajv/blob/master/KEYWORDS.md#contains) -- [for objects](https://github.com/epoberezkin/ajv/blob/master/KEYWORDS.md#keywords-for-objects) - maxProperties, minProperties, required, properties, patternProperties, additionalProperties, dependencies, [propertyNames](https://github.com/epoberezkin/ajv/blob/master/KEYWORDS.md#propertynames) -- [for all types](https://github.com/epoberezkin/ajv/blob/master/KEYWORDS.md#keywords-for-all-types) - enum, [const](https://github.com/epoberezkin/ajv/blob/master/KEYWORDS.md#const) -- [compound keywords](https://github.com/epoberezkin/ajv/blob/master/KEYWORDS.md#compound-keywords) - not, oneOf, anyOf, allOf +- [type](https://github.com/ajv-validator/ajv/blob/master/KEYWORDS.md#type) +- [for numbers](https://github.com/ajv-validator/ajv/blob/master/KEYWORDS.md#keywords-for-numbers) - maximum, minimum, exclusiveMaximum, exclusiveMinimum, multipleOf +- [for strings](https://github.com/ajv-validator/ajv/blob/master/KEYWORDS.md#keywords-for-strings) - maxLength, minLength, pattern, format +- [for arrays](https://github.com/ajv-validator/ajv/blob/master/KEYWORDS.md#keywords-for-arrays) - maxItems, minItems, uniqueItems, items, additionalItems, [contains](https://github.com/ajv-validator/ajv/blob/master/KEYWORDS.md#contains) +- [for objects](https://github.com/ajv-validator/ajv/blob/master/KEYWORDS.md#keywords-for-objects) - maxProperties, minProperties, required, properties, patternProperties, additionalProperties, dependencies, [propertyNames](https://github.com/ajv-validator/ajv/blob/master/KEYWORDS.md#propertynames) +- [for all types](https://github.com/ajv-validator/ajv/blob/master/KEYWORDS.md#keywords-for-all-types) - enum, [const](https://github.com/ajv-validator/ajv/blob/master/KEYWORDS.md#const) +- [compound keywords](https://github.com/ajv-validator/ajv/blob/master/KEYWORDS.md#compound-keywords) - not, oneOf, anyOf, allOf, [if/then/else](https://github.com/ajv-validator/ajv/blob/master/KEYWORDS.md#ifthenelse) -With [ajv-keywords](https://github.com/epoberezkin/ajv-keywords) package Ajv also supports validation keywords from [JSON Schema extension proposals](https://github.com/json-schema/json-schema/wiki/v5-Proposals) for JSON-schema standard: +With [ajv-keywords](https://github.com/ajv-validator/ajv-keywords) package Ajv also supports validation keywords from [JSON Schema extension proposals](https://github.com/json-schema/json-schema/wiki/v5-Proposals) for JSON Schema standard: -- [switch](https://github.com/epoberezkin/ajv/blob/master/KEYWORDS.md#switch-proposed) - conditional validation with a sequence of if/then clauses -- [patternRequired](https://github.com/epoberezkin/ajv/blob/master/KEYWORDS.md#patternrequired-proposed) - like `required` but with patterns that some property should match. -- [formatMaximum, formatMinimum, formatExclusiveMaximum, formatExclusiveMinimum](https://github.com/epoberezkin/ajv/blob/master/KEYWORDS.md#formatmaximum--formatminimum-and-exclusiveformatmaximum--exclusiveformatminimum-proposed) - setting limits for date, time, etc. +- [patternRequired](https://github.com/ajv-validator/ajv/blob/master/KEYWORDS.md#patternrequired-proposed) - like `required` but with patterns that some property should match. +- [formatMaximum, formatMinimum, formatExclusiveMaximum, formatExclusiveMinimum](https://github.com/ajv-validator/ajv/blob/master/KEYWORDS.md#formatmaximum--formatminimum-and-exclusiveformatmaximum--exclusiveformatminimum-proposed) - setting limits for date, time, etc. -See [JSON Schema validation keywords](https://github.com/epoberezkin/ajv/blob/master/KEYWORDS.md) for more details. +See [JSON Schema validation keywords](https://github.com/ajv-validator/ajv/blob/master/KEYWORDS.md) for more details. + + +## Annotation keywords + +JSON Schema specification defines several annotation keywords that describe schema itself but do not perform any validation. + +- `title` and `description`: information about the data represented by that schema +- `$comment` (NEW in draft-07): information for developers. With option `$comment` Ajv logs or passes the comment string to the user-supplied function. See [Options](#options). +- `default`: a default value of the data instance, see [Assigning defaults](#assigning-defaults). +- `examples` (NEW in draft-06): an array of data instances. Ajv does not check the validity of these instances against the schema. +- `readOnly` and `writeOnly` (NEW in draft-07): marks data-instance as read-only or write-only in relation to the source of the data (database, api, etc.). +- `contentEncoding`: [RFC 2045](https://tools.ietf.org/html/rfc2045#section-6.1 ), e.g., "base64". +- `contentMediaType`: [RFC 2046](https://tools.ietf.org/html/rfc2046), e.g., "image/png". + +__Please note__: Ajv does not implement validation of the keywords `examples`, `contentEncoding` and `contentMediaType` but it reserves them. If you want to create a plugin that implements some of them, it should remove these keywords from the instance. ## Formats -The following formats are supported for string validation with "format" keyword: +Ajv implements formats defined by JSON Schema specification and several other formats. It is recommended NOT to use "format" keyword implementations with untrusted data, as they use potentially unsafe regular expressions - see [ReDoS attack](#redos-attack). + +__Please note__: if you need to use "format" keyword to validate untrusted data, you MUST assess their suitability and safety for your validation scenarios. + +The following formats are implemented for string validation with "format" keyword: - _date_: full-date according to [RFC3339](http://tools.ietf.org/html/rfc3339#section-5.6). - _time_: time with optional time-zone. - _date-time_: date-time from the same source (time-zone is mandatory). `date`, `time` and `date-time` validate ranges in `full` mode and only regexp in `fast` mode (see [options](#options)). -- _uri_: full uri with optional protocol. -- _url_: [URL record](https://url.spec.whatwg.org/#concept-url). +- _uri_: full URI. +- _uri-reference_: URI reference, including full and relative URIs. - _uri-template_: URI template according to [RFC6570](https://tools.ietf.org/html/rfc6570) +- _url_ (deprecated): [URL record](https://url.spec.whatwg.org/#concept-url). - _email_: email address. - _hostname_: host name according to [RFC1034](http://tools.ietf.org/html/rfc1034#section-3.5). - _ipv4_: IP address v4. @@ -238,13 +323,15 @@ The following formats are supported for string validation with "format" keyword: - _json-pointer_: JSON-pointer according to [RFC6901](https://tools.ietf.org/html/rfc6901). - _relative-json-pointer_: relative JSON-pointer according to [this draft](http://tools.ietf.org/html/draft-luff-relative-json-pointer-00). -There are two modes of format validation: `fast` and `full`. This mode affects formats `date`, `time`, `date-time`, `uri`, `email`, and `hostname`. See [Options](#options) for details. +__Please note__: JSON Schema draft-07 also defines formats `iri`, `iri-reference`, `idn-hostname` and `idn-email` for URLs, hostnames and emails with international characters. Ajv does not implement these formats. If you create Ajv plugin that implements them please make a PR to mention this plugin here. + +There are two modes of format validation: `fast` and `full`. This mode affects formats `date`, `time`, `date-time`, `uri`, `uri-reference`, and `email`. See [Options](#options) for details. You can add additional formats and replace any of the formats above using [addFormat](#api-addformat) method. -The option `unknownFormats` allows changing the default behaviour when an unknown format is encountered. In this case Ajv can either fail schema compilation (default) or ignore it (default in versions before 5.0.0). You also can whitelist specific format(s) to be ignored. See [Options](#options) for details. +The option `unknownFormats` allows changing the default behaviour when an unknown format is encountered. In this case Ajv can either fail schema compilation (default) or ignore it (default in versions before 5.0.0). You also can allow specific format(s) that will be ignored. See [Options](#options) for details. -You can find patterns used for format validation and the sources that were used in [formats.js](https://github.com/epoberezkin/ajv/blob/master/lib/compile/formats.js). +You can find regular expressions used for format validation and the sources that were used in [formats.js](https://github.com/ajv-validator/ajv/blob/master/lib/compile/formats.js). ## Combining schemas with $ref @@ -301,7 +388,7 @@ __Please note__: ## $data reference -With `$data` option you can use values from the validated data as the values for the schema keywords. See [proposal](https://github.com/json-schema/json-schema/wiki/$data-(v5-proposal)) for more information about how it works. +With `$data` option you can use values from the validated data as the values for the schema keywords. See [proposal](https://github.com/json-schema-org/json-schema-spec/issues/51) for more information about how it works. `$data` reference is supported in the keywords: const, enum, format, maximum/minimum, exclusiveMaximum / exclusiveMinimum, maxLength / minLength, maxItems / minItems, maxProperties / minProperties, formatMaximum / formatMinimum, formatExclusiveMaximum / formatExclusiveMinimum, multipleOf, pattern, required, uniqueItems. @@ -353,7 +440,7 @@ var validData = { ## $merge and $patch keywords -With the package [ajv-merge-patch](https://github.com/epoberezkin/ajv-merge-patch) you can use the keywords `$merge` and `$patch` that allow extending JSON-schemas with patches using formats [JSON Merge Patch (RFC 7396)](https://tools.ietf.org/html/rfc7396) and [JSON Patch (RFC 6902)](https://tools.ietf.org/html/rfc6902). +With the package [ajv-merge-patch](https://github.com/ajv-validator/ajv-merge-patch) you can use the keywords `$merge` and `$patch` that allow extending JSON Schemas with patches using formats [JSON Merge Patch (RFC 7396)](https://tools.ietf.org/html/rfc7396) and [JSON Patch (RFC 6902)](https://tools.ietf.org/html/rfc6902). To add keywords `$merge` and `$patch` to Ajv instance use this code: @@ -412,7 +499,7 @@ The schemas above are equivalent to this schema: The properties `source` and `with` in the keywords `$merge` and `$patch` can use absolute or relative `$ref` to point to other schemas previously added to the Ajv instance or to the fragments of the current schema. -See the package [ajv-merge-patch](https://github.com/epoberezkin/ajv-merge-patch) for more information. +See the package [ajv-merge-patch](https://github.com/ajv-validator/ajv-merge-patch) for more information. ## Defining custom keywords @@ -427,7 +514,7 @@ The advantages of using custom keywords are: If a keyword is used only for side-effects and its validation result is pre-defined, use option `valid: true/false` in keyword definition to simplify both generated code (no error handling in case of `valid: true`) and your keyword functions (no need to return any validation result). -The concerns you have to be aware of when extending JSON-schema standard with custom keywords are the portability and understanding of your schemas. You will have to support these custom keywords on other platforms and to properly document these keywords so that everybody can understand them in your schemas. +The concerns you have to be aware of when extending JSON Schema standard with custom keywords are the portability and understanding of your schemas. You will have to support these custom keywords on other platforms and to properly document these keywords so that everybody can understand them in your schemas. You can define custom keywords with [addKeyword](#api-addkeyword) method. Keywords are defined on the `ajv` instance level - new instances will not have previously defined keywords. @@ -460,9 +547,9 @@ console.log(validate(2)); // false console.log(validate(4)); // false ``` -Several custom keywords (typeof, instanceof, range and propertyNames) are defined in [ajv-keywords](https://github.com/epoberezkin/ajv-keywords) package - they can be used for your schemas and as a starting point for your own custom keywords. +Several custom keywords (typeof, instanceof, range and propertyNames) are defined in [ajv-keywords](https://github.com/ajv-validator/ajv-keywords) package - they can be used for your schemas and as a starting point for your own custom keywords. -See [Defining custom keywords](https://github.com/epoberezkin/ajv/blob/master/CUSTOM.md) for more details. +See [Defining custom keywords](https://github.com/ajv-validator/ajv/blob/master/CUSTOM.md) for more details. ## Asynchronous schema compilation @@ -501,17 +588,11 @@ If your schema uses asynchronous formats/keywords or refers to some schema that __Please note__: all asynchronous subschemas that are referenced from the current or other schemas should have `"$async": true` keyword as well, otherwise the schema compilation will fail. -Validation function for an asynchronous custom format/keyword should return a promise that resolves with `true` or `false` (or rejects with `new Ajv.ValidationError(errors)` if you want to return custom errors from the keyword function). Ajv compiles asynchronous schemas to either [es7 async functions](http://tc39.github.io/ecmascript-asyncawait/) that can optionally be transpiled with [nodent](https://github.com/MatAtBread/nodent) or with [regenerator](https://github.com/facebook/regenerator) or to [generator functions](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/function*) that can be optionally transpiled with regenerator as well. You can also supply any other transpiler as a function. See [Options](#options). +Validation function for an asynchronous custom format/keyword should return a promise that resolves with `true` or `false` (or rejects with `new Ajv.ValidationError(errors)` if you want to return custom errors from the keyword function). -The compiled validation function has `$async: true` property (if the schema is asynchronous), so you can differentiate these functions if you are using both synchronous and asynchronous schemas. - -If you are using generators, the compiled validation function can be either wrapped with [co](https://github.com/tj/co) (default) or returned as generator function, that can be used directly, e.g. in [koa](http://koajs.com/) 1.0. `co` is a small library, it is included in Ajv (both as npm dependency and in the browser bundle). - -Async functions are currently supported in Chrome 55, Firefox 52, Node.js 7 (with --harmony-async-await) and MS Edge 13 (with flag). - -Generator functions are currently supported in Chrome, Firefox and Node.js. +Ajv compiles asynchronous schemas to [es7 async functions](http://tc39.github.io/ecmascript-asyncawait/) that can optionally be transpiled with [nodent](https://github.com/MatAtBread/nodent). Async functions are supported in Node.js 7+ and all modern browsers. You can also supply any other transpiler as a function via `processCode` option. See [Options](#options). -If you are using Ajv in other browsers or in older versions of Node.js you should use one of available transpiling options. All provided async modes use global Promise class. If your platform does not have Promise you should use a polyfill that defines it. +The compiled validation function has `$async: true` property (if the schema is asynchronous), so you can differentiate these functions if you are using both synchronous and asynchronous schemas. Validation result will be a promise that resolves with validated data or rejects with an exception `Ajv.ValidationError` that contains the array of validation errors in `errors` property. @@ -519,21 +600,8 @@ Validation result will be a promise that resolves with validated data or rejects Example: ```javascript -/** - * Default mode is non-transpiled generator function wrapped with `co`. - * Using package ajv-async (https://github.com/epoberezkin/ajv-async) - * you can auto-detect the best async mode. - * In this case, without "async" and "transpile" options - * (or with option {async: true}) - * Ajv will choose the first supported/installed option in this order: - * 1. native async function - * 2. native generator function wrapped with co - * 3. es7 async functions transpiled with nodent - * 4. es7 async functions transpiled with regenerator - */ - -var setupAsync = require('ajv-async'); -var ajv = setupAsync(new Ajv); +var ajv = new Ajv; +// require('ajv-async')(ajv); ajv.addKeyword('idExists', { async: true, @@ -580,66 +648,108 @@ validate({ userId: 1, postId: 19 }) ### Using transpilers with asynchronous validation functions. -To use a transpiler you should separately install it (or load its bundle in the browser). - -Ajv npm package includes minified browser bundles of regenerator and nodent in dist folder. +[ajv-async](https://github.com/ajv-validator/ajv-async) uses [nodent](https://github.com/MatAtBread/nodent) to transpile async functions. To use another transpiler you should separately install it (or load its bundle in the browser). #### Using nodent ```javascript -var setupAsync = require('ajv-async'); -var ajv = new Ajv({ /* async: 'es7', */ transpile: 'nodent' }); -setupAsync(ajv); +var ajv = new Ajv; +require('ajv-async')(ajv); +// in the browser if you want to load ajv-async bundle separately you can: +// window.ajvAsync(ajv); var validate = ajv.compile(schema); // transpiled es7 async function validate(data).then(successFunc).catch(errorFunc); ``` -`npm install nodent` or use `nodent.min.js` from dist folder of npm package. - -#### Using regenerator +#### Using other transpilers ```javascript -var setupAsync = require('ajv-async'); -var ajv = new Ajv({ /* async: 'es7', */ transpile: 'regenerator' }); -setupAsync(ajv); +var ajv = new Ajv({ processCode: transpileFunc }); var validate = ajv.compile(schema); // transpiled es7 async function validate(data).then(successFunc).catch(errorFunc); ``` -`npm install regenerator` or use `regenerator.min.js` from dist folder of npm package. +See [Options](#options). -#### Using other transpilers +## Security considerations + +JSON Schema, if properly used, can replace data sanitisation. It doesn't replace other API security considerations. It also introduces additional security aspects to consider. + + +##### Security contact + +To report a security vulnerability, please use the +[Tidelift security contact](https://tidelift.com/security). +Tidelift will coordinate the fix and disclosure. Please do NOT report security vulnerabilities via GitHub issues. + + +##### Untrusted schemas + +Ajv treats JSON schemas as trusted as your application code. This security model is based on the most common use case, when the schemas are static and bundled together with the application. + +If your schemas are received from untrusted sources (or generated from untrusted data) there are several scenarios you need to prevent: +- compiling schemas can cause stack overflow (if they are too deep) +- compiling schemas can be slow (e.g. [#557](https://github.com/ajv-validator/ajv/issues/557)) +- validating certain data can be slow + +It is difficult to predict all the scenarios, but at the very least it may help to limit the size of untrusted schemas (e.g. limit JSON string length) and also the maximum schema object depth (that can be high for relatively small JSON strings). You also may want to mitigate slow regular expressions in `pattern` and `patternProperties` keywords. + +Regardless the measures you take, using untrusted schemas increases security risks. + + +##### Circular references in JavaScript objects + +Ajv does not support schemas and validated data that have circular references in objects. See [issue #802](https://github.com/ajv-validator/ajv/issues/802). + +An attempt to compile such schemas or validate such data would cause stack overflow (or will not complete in case of asynchronous validation). Depending on the parser you use, untrusted data can lead to circular references. + + +##### Security risks of trusted schemas + +Some keywords in JSON Schemas can lead to very slow validation for certain data. These keywords include (but may be not limited to): + +- `pattern` and `format` for large strings - in some cases using `maxLength` can help mitigate it, but certain regular expressions can lead to exponential validation time even with relatively short strings (see [ReDoS attack](#redos-attack)). +- `patternProperties` for large property names - use `propertyNames` to mitigate, but some regular expressions can have exponential evaluation time as well. +- `uniqueItems` for large non-scalar arrays - use `maxItems` to mitigate + +__Please note__: The suggestions above to prevent slow validation would only work if you do NOT use `allErrors: true` in production code (using it would continue validation after validation errors). + +You can validate your JSON schemas against [this meta-schema](https://github.com/ajv-validator/ajv/blob/master/lib/refs/json-schema-secure.json) to check that these recommendations are followed: ```javascript -var ajv = new Ajv({ async: 'es7', processCode: transpileFunc }); -var validate = ajv.compile(schema); // transpiled es7 async function -validate(data).then(successFunc).catch(errorFunc); +const isSchemaSecure = ajv.compile(require('ajv/lib/refs/json-schema-secure.json')); + +const schema1 = {format: 'email'}; +isSchemaSecure(schema1); // false + +const schema2 = {format: 'email', maxLength: MAX_LENGTH}; +isSchemaSecure(schema2); // true ``` -See [Options](#options). +__Please note__: following all these recommendation is not a guarantee that validation of untrusted data is safe - it can still lead to some undesirable results. + + +##### Content Security Policies (CSP) +See [Ajv and Content Security Policies (CSP)](#ajv-and-content-security-policies-csp) -#### Comparison of async modes +## ReDoS attack -|mode|transpile
    speed*|run-time
    speed*|bundle
    size| -|---|:-:|:-:|:-:| -|es7 async
    (native)|-|0.75|-| -|generators
    (native)|-|1.0|-| -|es7.nodent|1.35|1.1|215Kb| -|es7.regenerator|1.0|2.7|1109Kb| -|regenerator|1.0|3.2|1109Kb| +Certain regular expressions can lead to the exponential evaluation time even with relatively short strings. -\* Relative performance in Node.js 7.x — smaller is better. +Please assess the regular expressions you use in the schemas on their vulnerability to this attack - see [safe-regex](https://github.com/substack/safe-regex), for example. -[nodent](https://github.com/MatAtBread/nodent) has several advantages: +__Please note__: some formats that Ajv implements use [regular expressions](https://github.com/ajv-validator/ajv/blob/master/lib/compile/formats.js) that can be vulnerable to ReDoS attack, so if you use Ajv to validate data from untrusted sources __it is strongly recommended__ to consider the following: -- much smaller browser bundle than regenerator -- almost the same performance of generated code as native generators in Node.js and the latest Chrome -- much better performance than native generators in other browsers -- works in IE 9 (regenerator does not) +- making assessment of "format" implementations in Ajv. +- using `format: 'fast'` option that simplifies some of the regular expressions (although it does not guarantee that they are safe). +- replacing format implementations provided by Ajv with your own implementations of "format" keyword that either uses different regular expressions or another approach to format validation. Please see [addFormat](#api-addformat) method. +- disabling format validation by ignoring "format" keyword with option `format: false` + +Whatever mitigation you choose, please assume all formats provided by Ajv as potentially unsafe and make your own assessment of their suitability for your validation scenarios. ## Filtering data @@ -712,7 +822,7 @@ The intention of the schema above is to allow objects with either the string pro With the option `removeAdditional: true` the validation will pass for the object `{ "foo": "abc"}` but will fail for the object `{"bar": 1}`. It happens because while the first subschema in `oneOf` is validated, the property `bar` is removed because it is an additional property according to the standard (because it is not included in `properties` keyword in the same schema). -While this behaviour is unexpected (issues [#129](https://github.com/epoberezkin/ajv/issues/129), [#134](https://github.com/epoberezkin/ajv/issues/134)), it is correct. To have the expected behaviour (both objects are allowed and additional properties are removed) the schema has to be refactored in this way: +While this behaviour is unexpected (issues [#129](https://github.com/ajv-validator/ajv/issues/129), [#134](https://github.com/ajv-validator/ajv/issues/134)), it is correct. To have the expected behaviour (both objects are allowed and additional properties are removed) the schema has to be refactored in this way: ```json { @@ -736,13 +846,11 @@ The schema above is also more efficient - it will compile into a faster function With [option `useDefaults`](#options) Ajv will assign values from `default` keyword in the schemas of `properties` and `items` (when it is the array of schemas) to the missing properties and items. -This option modifies original data. - -__Please note__: by default the default value is inserted in the generated validation code as a literal (starting from v4.0), so the value inserted in the data will be the deep clone of the default in the schema. +With the option value `"empty"` properties and items equal to `null` or `""` (empty string) will be considered missing and assigned defaults. -If you need to insert the default value in the data by reference pass the option `useDefaults: "shared"`. +This option modifies original data. -Inserting defaults by reference can be faster (in case you have an object in `default`) and it allows to have dynamic values in defaults, e.g. timestamp, without recompiling the schema. The side effect is that modifying the default value in any validated data instance will change the default in the schema and in other validated data instances. See example 3 below. +__Please note__: the default value is inserted in the generated validation code as a literal, so the value inserted in the data will be the deep clone of the default in the schema. Example 1 (`default` in `properties`): @@ -785,39 +893,15 @@ console.log(validate(data)); // true console.log(data); // [ 1, "foo" ] ``` -Example 3 (inserting "defaults" by reference): - -```javascript -var ajv = new Ajv({ useDefaults: 'shared' }); - -var schema = { - properties: { - foo: { - default: { bar: 1 } - } - } -} - -var validate = ajv.compile(schema); - -var data = {}; -console.log(validate(data)); // true -console.log(data); // { foo: { bar: 1 } } - -data.foo.bar = 2; - -var data2 = {}; -console.log(validate(data2)); // true -console.log(data2); // { foo: { bar: 2 } } -``` - `default` keywords in other cases are ignored: - not in `properties` or `items` subschemas -- in schemas inside `anyOf`, `oneOf` and `not` (see [#42](https://github.com/epoberezkin/ajv/issues/42)) +- in schemas inside `anyOf`, `oneOf` and `not` (see [#42](https://github.com/ajv-validator/ajv/issues/42)) - in `if` subschema of `switch` keyword - in schemas generated by custom macro keywords +The [`strictDefaults` option](#options) customizes Ajv's behavior for the defaults that Ajv ignores (`true` raises an error, and `"log"` outputs a warning). + ## Coercing data types @@ -870,7 +954,7 @@ console.log(data); // { "foo": [1], "bar": false } The coercion rules, as you can see from the example, are different from JavaScript both to validate user input as expected and to have the coercion reversible (to correctly validate cases where different types are defined in subschemas of "anyOf" and other compound keywords). -See [Coercion rules](https://github.com/epoberezkin/ajv/blob/master/COERCION.md) for details. +See [Coercion rules](https://github.com/ajv-validator/ajv/blob/master/COERCION.md) for details. ## API @@ -884,9 +968,9 @@ Create Ajv instance. Generate validating function and cache the compiled schema for future use. -Validating function returns boolean and has properties `errors` with the errors from the last validation (`null` if there were no errors) and `schema` with the reference to the original schema. +Validating function returns a boolean value. This function has properties `errors` and `schema`. Errors encountered during the last validation are assigned to `errors` property (it is assigned `null` if there was no errors). `schema` property contains the reference to the original schema. -Unless the option `validateSchema` is false, the schema will be validated against meta-schema and if schema is invalid the error will be thrown. See [options](#options). +The schema passed to this method will be validated against meta-schema unless `validateSchema` option is false. If schema is invalid, an error will be thrown. See [options](#options). ##### .compileAsync(Object schema [, Boolean meta] [, Function callback]) -> Promise @@ -937,13 +1021,13 @@ This allows you to do nice things like the following. ```javascript var validate = new Ajv().addSchema(schema).addFormat(name, regex).getSchema(uri); -``` +``` ##### .addMetaSchema(Array<Object>|Object schema [, String key]) -> Ajv Adds meta schema(s) that can be used to validate other schemas. That function should be used instead of `addSchema` because there may be instance options that would compile a meta schema incorrectly (at the moment it is `removeAdditional` option). -There is no need to explicitly add draft 6 meta schema (http://json-schema.org/draft-06/schema and http://json-schema.org/schema) - it is added by default, unless option `meta` is set to `false`. You only need to use it if you have a changed meta-schema that you want to use to validate your schemas. See `validateSchema`. +There is no need to explicitly add draft-07 meta schema (http://json-schema.org/draft-07/schema) - it is added by default, unless option `meta` is set to `false`. You only need to use it if you have a changed meta-schema that you want to use to validate your schemas. See `validateSchema`. ##### .validateSchema(Object schema) -> Boolean @@ -988,9 +1072,9 @@ Function should return validation result as `true` or `false`. If object is passed it should have properties `validate`, `compare` and `async`: - _validate_: a string, RegExp or a function as described above. -- _compare_: an optional comparison function that accepts two strings and compares them according to the format meaning. This function is used with keywords `formatMaximum`/`formatMinimum` (defined in [ajv-keywords](https://github.com/epoberezkin/ajv-keywords) package). It should return `1` if the first value is bigger than the second value, `-1` if it is smaller and `0` if it is equal. +- _compare_: an optional comparison function that accepts two strings and compares them according to the format meaning. This function is used with keywords `formatMaximum`/`formatMinimum` (defined in [ajv-keywords](https://github.com/ajv-validator/ajv-keywords) package). It should return `1` if the first value is bigger than the second value, `-1` if it is smaller and `0` if it is equal. - _async_: an optional `true` value if `validate` is an asynchronous function; in this case it should return a promise that resolves with a value `true` or `false`. -- _type_: an optional type of data that the format applies to. It can be `"string"` (default) or `"number"` (see https://github.com/epoberezkin/ajv/issues/291#issuecomment-259923858). If the type of data is different, the validation will pass. +- _type_: an optional type of data that the format applies to. It can be `"string"` (default) or `"number"` (see https://github.com/ajv-validator/ajv/issues/291#issuecomment-259923858). If the type of data is different, the validation will pass. Custom formats can be also added via `formats` option. @@ -999,14 +1083,14 @@ Custom formats can be also added via `formats` option. Add custom validation keyword to Ajv instance. -Keyword should be different from all standard JSON schema keywords and different from previously defined keywords. There is no way to redefine keywords or to remove keyword definition from the instance. +Keyword should be different from all standard JSON Schema keywords and different from previously defined keywords. There is no way to redefine keywords or to remove keyword definition from the instance. Keyword must start with a letter, `_` or `$`, and may continue with letters, numbers, `_`, `$`, or `-`. It is recommended to use an application-specific prefix for keywords to avoid current and future name collisions. Example Keywords: - `"xyz-example"`: valid, and uses prefix for the xyz project to avoid name collisions. -- `"example"`: valid, but not recommended as it could collide with future versions of JSON schema etc. +- `"example"`: valid, but not recommended as it could collide with future versions of JSON Schema etc. - `"3-example"`: invalid as numbers are not allowed to be the first character in a keyword Keyword definition is an object with the following properties: @@ -1018,11 +1102,13 @@ Keyword definition is an object with the following properties: - _inline_: compiling function that returns code (as string) - _schema_: an optional `false` value used with "validate" keyword to not pass schema - _metaSchema_: an optional meta-schema for keyword schema +- _dependencies_: an optional list of properties that must be present in the parent schema - it will be checked during schema compilation - _modifying_: `true` MUST be passed if keyword modifies data +- _statements_: `true` can be passed in case inline keyword generates statements (as opposed to expression) - _valid_: pass `true`/`false` to pre-define validation result, the result returned from validation function will be ignored. This option cannot be used with macro keywords. - _$data_: an optional `true` value to support [$data reference](#data-reference) as the value of custom keyword. The reference will be resolved at validation time. If the keyword has meta-schema it would be extended to allow $data and it will be used to validate the resolved value. Supporting $data reference requires that keyword has validating function (as the only option or in addition to compile, macro or inline function). - _async_: an optional `true` value if the validation function is asynchronous (whether it is compiled or passed in _validate_ property); in this case it should return a promise that resolves with a value `true` or `false`. This option is ignored in case of "macro" and "inline" keywords. -- _errors_: an optional boolean indicating whether keyword returns errors. If this property is not set Ajv will determine if the errors were set in case of failed validation. +- _errors_: an optional boolean or string `"full"` indicating whether keyword returns errors. If this property is not set Ajv will determine if the errors were set in case of failed validation. _compile_, _macro_ and _inline_ are mutually exclusive, only one should be used at a time. _validate_ can be used separately or in addition to them to support $data reference. @@ -1062,16 +1148,18 @@ Defaults: $data: false, allErrors: false, verbose: false, + $comment: false, // NEW in Ajv version 6.0 jsonPointers: false, uniqueItems: true, unicode: true, + nullable: false, format: 'fast', formats: {}, unknownFormats: true, schemas: {}, logger: undefined, // referenced schema options: - schemaId: undefined // recommended '$id' + schemaId: '$id', missingRefs: true, extendRefs: 'ignore', // recommended 'fail' loadSchema: undefined, // function(uri: string): Promise {} @@ -1079,8 +1167,11 @@ Defaults: removeAdditional: false, useDefaults: false, coerceTypes: false, + // strict mode options + strictDefaults: false, + strictKeywords: false, + strictNumbers: false, // asynchronous validation options: - async: 'co*', transpile: undefined, // requires ajv-async package // advanced options: meta: true, @@ -1091,10 +1182,10 @@ Defaults: loopRequired: Infinity, ownProperties: false, multipleOfPrecision: false, - errorDataPath: 'object', + errorDataPath: 'object', // deprecated messages: true, sourceCode: false, - processCode: undefined, // function (str: string): string {} + processCode: undefined, // function (str: string, schema: object): string {} cache: new Cache, serialize: undefined } @@ -1105,17 +1196,26 @@ Defaults: - _$data_: support [$data references](#data-reference). Draft 6 meta-schema that is added by default will be extended to allow them. If you want to use another meta-schema you need to use $dataMetaSchema method to add support for $data reference. See [API](#api). - _allErrors_: check all rules collecting all errors. Default is to return after the first error. - _verbose_: include the reference to the part of the schema (`schema` and `parentSchema`) and validated data in errors (false by default). +- _$comment_ (NEW in Ajv version 6.0): log or pass the value of `$comment` keyword to a function. Option values: + - `false` (default): ignore $comment keyword. + - `true`: log the keyword value to console. + - function: pass the keyword value, its schema path and root schema to the specified function - _jsonPointers_: set `dataPath` property of errors using [JSON Pointers](https://tools.ietf.org/html/rfc6901) instead of JavaScript property access notation. - _uniqueItems_: validate `uniqueItems` keyword (true by default). - _unicode_: calculate correct length of strings with unicode pairs (true by default). Pass `false` to use `.length` of strings that is faster, but gives "incorrect" lengths of strings with unicode pairs - each unicode pair is counted as two characters. -- _format_: formats validation mode ('fast' by default). Pass 'full' for more correct and slow validation or `false` not to validate formats at all. E.g., 25:00:00 and 2015/14/33 will be invalid time and date in 'full' mode but it will be valid in 'fast' mode. +- _nullable_: support keyword "nullable" from [Open API 3 specification](https://swagger.io/docs/specification/data-models/data-types/). +- _format_: formats validation mode. Option values: + - `"fast"` (default) - simplified and fast validation (see [Formats](#formats) for details of which formats are available and affected by this option). + - `"full"` - more restrictive and slow validation. E.g., 25:00:00 and 2015/14/33 will be invalid time and date in 'full' mode but it will be valid in 'fast' mode. + - `false` - ignore all format keywords. - _formats_: an object with custom formats. Keys and values will be passed to `addFormat` method. +- _keywords_: an object with custom keywords. Keys and values will be passed to `addKeyword` method. - _unknownFormats_: handling of unknown formats. Option values: - `true` (default) - if an unknown format is encountered the exception is thrown during schema compilation. If `format` keyword value is [$data reference](#data-reference) and it is unknown the validation will fail. - `[String]` - an array of unknown format names that will be ignored. This option can be used to allow usage of third party schemas with format(s) for which you don't have definitions, but still fail if another unknown format is used. If `format` keyword value is [$data reference](#data-reference) and it is not in this array the validation will fail. - - `"ignore"` - to log warning during schema compilation and always pass validation (the default behaviour in versions before 5.0.0). This option is not recommended, as it allows to mistype format name and it won't be validated without any error message. This behaviour is required by JSON-schema specification. + - `"ignore"` - to log warning during schema compilation and always pass validation (the default behaviour in versions before 5.0.0). This option is not recommended, as it allows to mistype format name and it won't be validated without any error message. This behaviour is required by JSON Schema specification. - _schemas_: an array or object of schemas that will be added to the instance. In case you pass the array the schemas must have IDs in them. When the object is passed the method `addSchema(value, key)` will be called for each schema in this object. -- _logger_: sets the logging method. Default is the global `console` object that should have methods `log`, `warn` and `error`. Option values: +- _logger_: sets the logging method. Default is the global `console` object that should have methods `log`, `warn` and `error`. See [Error logging](#error-logging). Option values: - custom logger - it should have methods `log`, `warn` and `error`. If any of these methods is missing an exception will be thrown. - `false` - logging is disabled. @@ -1123,9 +1223,9 @@ Defaults: ##### Referenced schema options - _schemaId_: this option defines which keywords are used as schema URI. Option value: - - `"$id"` (recommended) - only use `$id` keyword as schema URI (as specified in JSON Schema draft-06), ignore `id` keyword (if it is present a warning will be logged). + - `"$id"` (default) - only use `$id` keyword as schema URI (as specified in JSON Schema draft-06/07), ignore `id` keyword (if it is present a warning will be logged). - `"id"` - only use `id` keyword as schema URI (as specified in JSON Schema draft-04), ignore `$id` keyword (if it is present a warning will be logged). - - `undefined` (default) - use both `$id` and `id` keywords as schema URI. If both are present (in the same schema object) and different the exception will be thrown during schema compilation. + - `"auto"` - use both `$id` and `id` keywords as schema URI. If both are present (in the same schema object) and different the exception will be thrown during schema compilation. - _missingRefs_: handling of missing referenced schemas. Option values: - `true` (default) - if the reference cannot be resolved during compilation the exception is thrown. The thrown error has properties `missingRef` (with hash fragment) and `missingSchema` (without it). Both properties are resolved relative to the current base id (usually schema id, unless it was substituted). - `"ignore"` - to log error during compilation and always pass validation. @@ -1144,42 +1244,43 @@ Defaults: - `"all"` - all additional properties are removed, regardless of `additionalProperties` keyword in schema (and no validation is made for them). - `true` - only additional properties with `additionalProperties` keyword equal to `false` are removed. - `"failing"` - additional properties that fail schema validation will be removed (where `additionalProperties` keyword is `false` or schema). -- _useDefaults_: replace missing properties and items with the values from corresponding `default` keywords. Default behaviour is to ignore `default` keywords. This option is not used if schema is added with `addMetaSchema` method. See examples in [Assigning defaults](#assigning-defaults). Option values: +- _useDefaults_: replace missing or undefined properties and items with the values from corresponding `default` keywords. Default behaviour is to ignore `default` keywords. This option is not used if schema is added with `addMetaSchema` method. See examples in [Assigning defaults](#assigning-defaults). Option values: - `false` (default) - do not use defaults - - `true` - insert defaults by value (safer and slower, object literal is used). - - `"shared"` - insert defaults by reference (faster). If the default is an object, it will be shared by all instances of validated data. If you modify the inserted default in the validated data, it will be modified in the schema as well. -- _coerceTypes_: change data type of data to match `type` keyword. See the example in [Coercing data types](#coercing-data-types) and [coercion rules](https://github.com/epoberezkin/ajv/blob/master/COERCION.md). Option values: + - `true` - insert defaults by value (object literal is used). + - `"empty"` - in addition to missing or undefined, use defaults for properties and items that are equal to `null` or `""` (an empty string). + - `"shared"` (deprecated) - insert defaults by reference. If the default is an object, it will be shared by all instances of validated data. If you modify the inserted default in the validated data, it will be modified in the schema as well. +- _coerceTypes_: change data type of data to match `type` keyword. See the example in [Coercing data types](#coercing-data-types) and [coercion rules](https://github.com/ajv-validator/ajv/blob/master/COERCION.md). Option values: - `false` (default) - no type coercion. - `true` - coerce scalar data types. - `"array"` - in addition to coercions between scalar types, coerce scalar data to an array with one element and vice versa (as required by the schema). +##### Strict mode options + +- _strictDefaults_: report ignored `default` keywords in schemas. Option values: + - `false` (default) - ignored defaults are not reported + - `true` - if an ignored default is present, throw an error + - `"log"` - if an ignored default is present, log warning +- _strictKeywords_: report unknown keywords in schemas. Option values: + - `false` (default) - unknown keywords are not reported + - `true` - if an unknown keyword is present, throw an error + - `"log"` - if an unknown keyword is present, log warning +- _strictNumbers_: validate numbers strictly, failing validation for NaN and Infinity. Option values: + - `false` (default) - NaN or Infinity will pass validation for numeric types + - `true` - NaN or Infinity will not pass validation for numeric types + ##### Asynchronous validation options -- _async_: determines how Ajv compiles asynchronous schemas (see [Asynchronous validation](#asynchronous-validation)) to functions. Option values: - - `"*"` / `"co*"` (default) - compile to generator function ("co*" - wrapped with `co.wrap`). If generators are not supported and you don't provide `processCode` option (or `transpile` option if you use [ajv-async](https://github.com/epoberezkin/ajv-async) package), the exception will be thrown when async schema is compiled. - - `"es7"` - compile to es7 async function. Unless your platform supports them you need to provide `processCode` or `transpile` option. According to [compatibility table](http://kangax.github.io/compat-table/es7/)) async functions are supported by: - - Firefox 52, - - Chrome 55, - - Node.js 7 (with `--harmony-async-await`), - - MS Edge 13 (with flag). - - `undefined`/`true` - auto-detect async mode. It requires [ajv-async](https://github.com/epoberezkin/ajv-async) package. If `transpile` option is not passed, ajv-async will choose the first of supported/installed async/transpile modes in this order: - - "es7" (native async functions), - - "co*" (native generators with co.wrap), - - "es7"/"nodent", - - "co*"/"regenerator" during the creation of the Ajv instance. - - If none of the options is available the exception will be thrown. -- _transpile_: Requires [ajv-async](https://github.com/epoberezkin/ajv-async) package. It determines whether Ajv transpiles compiled asynchronous validation function. Option values: - - `"nodent"` - transpile with [nodent](https://github.com/MatAtBread/nodent). If nodent is not installed, the exception will be thrown. nodent can only transpile es7 async functions; it will enforce this mode. - - `"regenerator"` - transpile with [regenerator](https://github.com/facebook/regenerator). If regenerator is not installed, the exception will be thrown. - - a function - this function should accept the code of validation function as a string and return transpiled code. This option allows you to use any other transpiler you prefer. If you are passing a function, you can simply pass it to `processCode` option without using ajv-async. +- _transpile_: Requires [ajv-async](https://github.com/ajv-validator/ajv-async) package. It determines whether Ajv transpiles compiled asynchronous validation function. Option values: + - `undefined` (default) - transpile with [nodent](https://github.com/MatAtBread/nodent) if async functions are not supported. + - `true` - always transpile with nodent. + - `false` - do not transpile; if async functions are not supported an exception will be thrown. ##### Advanced options - _meta_: add [meta-schema](http://json-schema.org/documentation.html) so it can be used by other schemas (true by default). If an object is passed, it will be used as the default meta-schema for schemas that have no `$schema` keyword. This default meta-schema MUST have `$schema` keyword. -- _validateSchema_: validate added/compiled schemas against meta-schema (true by default). `$schema` property in the schema can either be http://json-schema.org/schema or http://json-schema.org/draft-04/schema or absent (draft-4 meta-schema will be used) or can be a reference to the schema previously added with `addMetaSchema` method. Option values: +- _validateSchema_: validate added/compiled schemas against meta-schema (true by default). `$schema` property in the schema can be http://json-schema.org/draft-07/schema or absent (draft-07 meta-schema will be used) or can be a reference to the schema previously added with `addMetaSchema` method. Option values: - `true` (default) - if the validation fails, throw the exception. - `"log"` - if the validation fails, log error. - `false` - skip schema validation. @@ -1191,13 +1292,13 @@ Defaults: - _passContext_: pass validation context to custom keyword functions. If this option is `true` and you pass some context to the compiled validation function with `validate.call(context, data)`, the `context` will be available as `this` in your custom keywords. By default `this` is Ajv instance. - _loopRequired_: by default `required` keyword is compiled into a single expression (or a sequence of statements in `allErrors` mode). In case of a very large number of properties in this keyword it may result in a very big validation function. Pass integer to set the number of properties above which `required` keyword will be validated in a loop - smaller validation function size but also worse performance. - _ownProperties_: by default Ajv iterates over all enumerable object properties; when this option is `true` only own enumerable object properties (i.e. found directly on the object rather than on its prototype) are iterated. Contributed by @mbroadst. -- _multipleOfPrecision_: by default `multipleOf` keyword is validated by comparing the result of division with parseInt() of that result. It works for dividers that are bigger than 1. For small dividers such as 0.01 the result of the division is usually not integer (even when it should be integer, see issue [#84](https://github.com/epoberezkin/ajv/issues/84)). If you need to use fractional dividers set this option to some positive integer N to have `multipleOf` validated using this formula: `Math.abs(Math.round(division) - division) < 1e-N` (it is slower but allows for float arithmetics deviations). -- _errorDataPath_: set `dataPath` to point to 'object' (default) or to 'property' when validating keywords `required`, `additionalProperties` and `dependencies`. -- _messages_: Include human-readable messages in errors. `true` by default. `false` can be passed when custom messages are used (e.g. with [ajv-i18n](https://github.com/epoberezkin/ajv-i18n)). +- _multipleOfPrecision_: by default `multipleOf` keyword is validated by comparing the result of division with parseInt() of that result. It works for dividers that are bigger than 1. For small dividers such as 0.01 the result of the division is usually not integer (even when it should be integer, see issue [#84](https://github.com/ajv-validator/ajv/issues/84)). If you need to use fractional dividers set this option to some positive integer N to have `multipleOf` validated using this formula: `Math.abs(Math.round(division) - division) < 1e-N` (it is slower but allows for float arithmetics deviations). +- _errorDataPath_ (deprecated): set `dataPath` to point to 'object' (default) or to 'property' when validating keywords `required`, `additionalProperties` and `dependencies`. +- _messages_: Include human-readable messages in errors. `true` by default. `false` can be passed when custom messages are used (e.g. with [ajv-i18n](https://github.com/ajv-validator/ajv-i18n)). - _sourceCode_: add `sourceCode` property to validating function (for debugging; this code can be different from the result of toString call). - _processCode_: an optional function to process generated code before it is passed to Function constructor. It can be used to either beautify (the validating function is generated without line-breaks) or to transpile code. Starting from version 5.0.0 this option replaced options: - - `beautify` that formatted the generated function using [js-beautify](https://github.com/beautify-web/js-beautify). If you want to beautify the generated code pass `require('js-beautify').js_beautify`. - - `transpile` that transpiled asynchronous validation function. You can still use `transpile` option with [ajv-async](https://github.com/epoberezkin/ajv-async) package. See [Asynchronous validation](#asynchronous-validation) for more information. + - `beautify` that formatted the generated function using [js-beautify](https://github.com/beautify-web/js-beautify). If you want to beautify the generated code pass a function calling `require('js-beautify').js_beautify` as `processCode: code => js_beautify(code)`. + - `transpile` that transpiled asynchronous validation function. You can still use `transpile` option with [ajv-async](https://github.com/ajv-validator/ajv-async) package. See [Asynchronous validation](#asynchronous-validation) for more information. - _cache_: an optional instance of cache to store compiled schemas using stable-stringified schema as a key. For example, set-associative cache [sacjs](https://github.com/epoberezkin/sacjs) can be used. If not passed then a simple hash is used which is good enough for the common use case (a limited number of statically defined schemas). Cache should have methods `put(key, value)`, `get(key)`, `del(key)` and `clear()`. - _serialize_: an optional function to serialize schema to cache key. Pass `false` to use schema itself as a key (e.g., if WeakMap used as a cache). By default [fast-json-stable-stringify](https://github.com/epoberezkin/fast-json-stable-stringify) is used. @@ -1214,7 +1315,7 @@ Each error is an object with the following properties: - _keyword_: validation keyword. - _dataPath_: the path to the part of the data that was validated. By default `dataPath` uses JavaScript property access notation (e.g., `".prop[1].subProp"`). When the option `jsonPointers` is true (see [Options](#options)) `dataPath` will be set using JSON pointer standard (e.g., `"/prop/1/subProp"`). - _schemaPath_: the path (JSON-pointer as a URI fragment) to the schema of the keyword that failed validation. -- _params_: the object with the additional information about error that can be used to create custom error messages (e.g., using [ajv-i18n](https://github.com/epoberezkin/ajv-i18n) package). See below for parameters set by all keywords. +- _params_: the object with the additional information about error that can be used to create custom error messages (e.g., using [ajv-i18n](https://github.com/ajv-validator/ajv-i18n) package). See below for parameters set by all keywords. - _message_: the standard error message (can be excluded with option `messages` set to false). - _schema_: the schema of the keyword (added with `verbose` option). - _parentSchema_: the schema containing the keyword (added with `verbose` option) @@ -1247,22 +1348,58 @@ Properties of `params` object in errors depend on the keyword that failed valida - `patternRequired` (in ajv-keywords) - property `missingPattern` (required pattern that did not match any property). - `type` - property `type` (required type(s), a string, can be a comma-separated list) - `uniqueItems` - properties `i` and `j` (indices of duplicate items). +- `const` - property `allowedValue` pointing to the value (the schema of the keyword). - `enum` - property `allowedValues` pointing to the array of values (the schema of the keyword). - `$ref` - property `ref` with the referenced schema URI. +- `oneOf` - property `passingSchemas` (array of indices of passing schemas, null if no schema passes). - custom keywords (in case keyword definition doesn't create errors) - property `keyword` (the keyword name). +### Error logging + +Using the `logger` option when initiallizing Ajv will allow you to define custom logging. Here you can build upon the exisiting logging. The use of other logging packages is supported as long as the package or its associated wrapper exposes the required methods. If any of the required methods are missing an exception will be thrown. +- **Required Methods**: `log`, `warn`, `error` + +```javascript +var otherLogger = new OtherLogger(); +var ajv = new Ajv({ + logger: { + log: console.log.bind(console), + warn: function warn() { + otherLogger.logWarn.apply(otherLogger, arguments); + }, + error: function error() { + otherLogger.logError.apply(otherLogger, arguments); + console.error.apply(console, arguments); + } + } +}); +``` + + +## Plugins + +Ajv can be extended with plugins that add custom keywords, formats or functions to process generated code. When such plugin is published as npm package it is recommended that it follows these conventions: + +- it exports a function +- this function accepts ajv instance as the first parameter and returns the same instance to allow chaining +- this function can accept an optional configuration as the second parameter + +If you have published a useful plugin please submit a PR to add it to the next section. + + ## Related packages -- [ajv-async](https://github.com/epoberezkin/ajv-async) - configure async validation mode +- [ajv-async](https://github.com/ajv-validator/ajv-async) - plugin to configure async validation mode +- [ajv-bsontype](https://github.com/BoLaMN/ajv-bsontype) - plugin to validate mongodb's bsonType formats - [ajv-cli](https://github.com/jessedc/ajv-cli) - command line interface -- [ajv-errors](https://github.com/epoberezkin/ajv-errors) - custom error messages -- [ajv-i18n](https://github.com/epoberezkin/ajv-i18n) - internationalised error messages -- [ajv-istanbul](https://github.com/epoberezkin/ajv-istanbul) - instrument generated validation code to measure test coverage of your schemas -- [ajv-keywords](https://github.com/epoberezkin/ajv-keywords) - custom validation keywords (if/then/else, select, typeof, etc.) -- [ajv-merge-patch](https://github.com/epoberezkin/ajv-merge-patch) - keywords $merge and $patch -- [ajv-pack](https://github.com/epoberezkin/ajv-pack) - produces a compact module exporting validation functions - +- [ajv-errors](https://github.com/ajv-validator/ajv-errors) - plugin for custom error messages +- [ajv-i18n](https://github.com/ajv-validator/ajv-i18n) - internationalised error messages +- [ajv-istanbul](https://github.com/ajv-validator/ajv-istanbul) - plugin to instrument generated validation code to measure test coverage of your schemas +- [ajv-keywords](https://github.com/ajv-validator/ajv-keywords) - plugin with custom validation keywords (select, typeof, etc.) +- [ajv-merge-patch](https://github.com/ajv-validator/ajv-merge-patch) - plugin with keywords $merge and $patch +- [ajv-pack](https://github.com/ajv-validator/ajv-pack) - produces a compact module exporting validation functions +- [ajv-formats-draft2019](https://github.com/luzlab/ajv-formats-draft2019) - format validators for draft2019 that aren't already included in ajv (ie. `idn-hostname`, `idn-email`, `iri`, `iri-reference` and `duration`). ## Some packages using Ajv @@ -1271,7 +1408,7 @@ Properties of `params` object in errors depend on the keyword that failed valida - [osprey-method-handler](https://github.com/mulesoft-labs/osprey-method-handler) - Express middleware for validating requests and responses based on a RAML method object, used in [osprey](https://github.com/mulesoft/osprey) - validating API proxy generated from a RAML definition - [har-validator](https://github.com/ahmadnassri/har-validator) - HTTP Archive (HAR) validator - [jsoneditor](https://github.com/josdejong/jsoneditor) - a web-based tool to view, edit, format, and validate JSON http://jsoneditoronline.org -- [JSON Schema Lint](https://github.com/nickcmaynard/jsonschemalint) - a web tool to validate JSON/YAML document against a single JSON-schema http://jsonschemalint.com +- [JSON Schema Lint](https://github.com/nickcmaynard/jsonschemalint) - a web tool to validate JSON/YAML document against a single JSON Schema http://jsonschemalint.com - [objection](https://github.com/vincit/objection.js) - SQL-friendly ORM for Node.js - [table](https://github.com/gajus/table) - formats data into a string table - [ripple-lib](https://github.com/ripple/ripple-lib) - a JavaScript API for interacting with [Ripple](https://ripple.com) in Node.js and the browser @@ -1280,12 +1417,13 @@ Properties of `params` object in errors depend on the keyword that failed valida - [react-form-controlled](https://github.com/seeden/react-form-controlled) - React controlled form components with validation - [rabbitmq-schema](https://github.com/tjmehta/rabbitmq-schema) - a schema definition module for RabbitMQ graphs and messages - [@query/schema](https://www.npmjs.com/package/@query/schema) - stream filtering with a URI-safe query syntax parsing to JSON Schema -- [chai-ajv-json-schema](https://github.com/peon374/chai-ajv-json-schema) - chai plugin to us JSON-schema with expect in mocha tests +- [chai-ajv-json-schema](https://github.com/peon374/chai-ajv-json-schema) - chai plugin to us JSON Schema with expect in mocha tests - [grunt-jsonschema-ajv](https://github.com/SignpostMarv/grunt-jsonschema-ajv) - Grunt plugin for validating files against JSON Schema - [extract-text-webpack-plugin](https://github.com/webpack-contrib/extract-text-webpack-plugin) - extract text from bundle into a file - [electron-builder](https://github.com/electron-userland/electron-builder) - a solution to package and build a ready for distribution Electron app - [addons-linter](https://github.com/mozilla/addons-linter) - Mozilla Add-ons Linter - [gh-pages-generator](https://github.com/epoberezkin/gh-pages-generator) - multi-page site generator converting markdown files to GitHub pages +- [ESLint](https://github.com/eslint/eslint) - the pluggable linting utility for JavaScript and JSX ## Tests @@ -1298,30 +1436,42 @@ npm test ## Contributing -All validation functions are generated using doT templates in [dot](https://github.com/epoberezkin/ajv/tree/master/lib/dot) folder. Templates are precompiled so doT is not a run-time dependency. +All validation functions are generated using doT templates in [dot](https://github.com/ajv-validator/ajv/tree/master/lib/dot) folder. Templates are precompiled so doT is not a run-time dependency. -`npm run build` - compiles templates to [dotjs](https://github.com/epoberezkin/ajv/tree/master/lib/dotjs) folder. +`npm run build` - compiles templates to [dotjs](https://github.com/ajv-validator/ajv/tree/master/lib/dotjs) folder. `npm run watch` - automatically compiles templates when files in dot folder change -Please see [Contributing guidelines](https://github.com/epoberezkin/ajv/blob/master/CONTRIBUTING.md) +Please see [Contributing guidelines](https://github.com/ajv-validator/ajv/blob/master/CONTRIBUTING.md) ## Changes history -See https://github.com/epoberezkin/ajv/releases +See https://github.com/ajv-validator/ajv/releases + +__Please note__: [Changes in version 6.0.0](https://github.com/ajv-validator/ajv/releases/tag/v6.0.0). + +[Version 5.0.0](https://github.com/ajv-validator/ajv/releases/tag/5.0.0). + +[Version 4.0.0](https://github.com/ajv-validator/ajv/releases/tag/4.0.0). + +[Version 3.0.0](https://github.com/ajv-validator/ajv/releases/tag/3.0.0). + +[Version 2.0.0](https://github.com/ajv-validator/ajv/releases/tag/2.0.0). + + +## Code of conduct -__Please note__: [Changes in version 5.0.0](https://github.com/epoberezkin/ajv/releases/tag/5.0.0). +Please review and follow the [Code of conduct](https://github.com/ajv-validator/ajv/blob/master/CODE_OF_CONDUCT.md). -[Changes in version 4.6.0](https://github.com/epoberezkin/ajv/releases/tag/4.6.0). +Please report any unacceptable behaviour to ajv.validator@gmail.com - it will be reviewed by the project team. -[Changes in version 4.0.0](https://github.com/epoberezkin/ajv/releases/tag/4.0.0). -[Changes in version 3.0.0](https://github.com/epoberezkin/ajv/releases/tag/3.0.0). +## Open-source software support -[Changes in version 2.0.0](https://github.com/epoberezkin/ajv/releases/tag/2.0.0). +Ajv is a part of [Tidelift subscription](https://tidelift.com/subscription/pkg/npm-ajv?utm_source=npm-ajv&utm_medium=referral&utm_campaign=readme) - it provides a centralised support to open-source software users, in addition to the support provided by software maintainers. ## License -[MIT](https://github.com/epoberezkin/ajv/blob/master/LICENSE) +[MIT](https://github.com/ajv-validator/ajv/blob/master/LICENSE) diff --git a/deps/npm/node_modules/ajv/dist/ajv.bundle.js b/deps/npm/node_modules/ajv/dist/ajv.bundle.js index 01d56327e693b3..2a34a771fd6f29 100644 --- a/deps/npm/node_modules/ajv/dist/ajv.bundle.js +++ b/deps/npm/node_modules/ajv/dist/ajv.bundle.js @@ -1,55 +1,4 @@ -(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.Ajv = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@| // var URL = /^(?:(?:https?|ftp):\/\/)(?:\S+(?::\S*)?@)?(?:(?!10(?:\.\d{1,3}){3})(?!127(?:\.\d{1,3}){3})(?!169\.254(?:\.\d{1,3}){2})(?!192\.168(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u{00a1}-\u{ffff}0-9]+-?)*[a-z\u{00a1}-\u{ffff}0-9]+)(?:\.(?:[a-z\u{00a1}-\u{ffff}0-9]+-?)*[a-z\u{00a1}-\u{ffff}0-9]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu; var URL = /^(?:(?:http[s\u017F]?|ftp):\/\/)(?:(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+(?::(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?@)?(?:(?!10(?:\.[0-9]{1,3}){3})(?!127(?:\.[0-9]{1,3}){3})(?!169\.254(?:\.[0-9]{1,3}){2})(?!192\.168(?:\.[0-9]{1,3}){2})(?!172\.(?:1[6-9]|2[0-9]|3[01])(?:\.[0-9]{1,3}){2})(?:[1-9][0-9]?|1[0-9][0-9]|2[01][0-9]|22[0-3])(?:\.(?:1?[0-9]{1,2}|2[0-4][0-9]|25[0-5])){2}(?:\.(?:[1-9][0-9]?|1[0-9][0-9]|2[0-4][0-9]|25[0-4]))|(?:(?:(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-?)*(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)(?:\.(?:(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-?)*(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)*(?:\.(?:(?:[KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]){2,})))(?::[0-9]{2,5})?(?:\/(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?$/i; var UUID = /^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i; -var JSON_POINTER = /^(?:\/(?:[^~/]|~0|~1)*)*$|^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i; +var JSON_POINTER = /^(?:\/(?:[^~/]|~0|~1)*)*$/; +var JSON_POINTER_URI_FRAGMENT = /^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i; var RELATIVE_JSON_POINTER = /^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/; @@ -273,11 +190,11 @@ formats.fast = { // date: http://tools.ietf.org/html/rfc3339#section-5.6 date: /^\d\d\d\d-[0-1]\d-[0-3]\d$/, // date-time: http://tools.ietf.org/html/rfc3339#section-5.6 - time: /^[0-2]\d:[0-5]\d:[0-5]\d(?:\.\d+)?(?:z|[+-]\d\d:\d\d)?$/i, - 'date-time': /^\d\d\d\d-[0-1]\d-[0-3]\d[t\s][0-2]\d:[0-5]\d:[0-5]\d(?:\.\d+)?(?:z|[+-]\d\d:\d\d)$/i, + time: /^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i, + 'date-time': /^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i, // uri: https://github.com/mafintosh/is-my-json-valid/blob/master/formats.js - uri: /^(?:[a-z][a-z0-9+-.]*)(?::|\/)\/?[^\s]*$/i, - 'uri-reference': /^(?:(?:[a-z][a-z0-9+-.]*:)?\/\/)?[^\s]*$/i, + uri: /^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i, + 'uri-reference': /^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i, 'uri-template': URITEMPLATE, url: URL, // email (sources from jsen validator): @@ -295,6 +212,7 @@ formats.fast = { // JSON-pointer: https://tools.ietf.org/html/rfc6901 // uri fragment: https://tools.ietf.org/html/rfc3986#appendix-A 'json-pointer': JSON_POINTER, + 'json-pointer-uri-fragment': JSON_POINTER_URI_FRAGMENT, // relative JSON-pointer: http://tools.ietf.org/html/draft-luff-relative-json-pointer-00 'relative-json-pointer': RELATIVE_JSON_POINTER }; @@ -308,25 +226,35 @@ formats.full = { 'uri-reference': URIREF, 'uri-template': URITEMPLATE, url: URL, - email: /^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&''*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i, - hostname: hostname, + email: /^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i, + hostname: HOSTNAME, ipv4: /^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/, ipv6: /^\s*(?:(?:(?:[0-9a-f]{1,4}:){7}(?:[0-9a-f]{1,4}|:))|(?:(?:[0-9a-f]{1,4}:){6}(?::[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){5}(?:(?:(?::[0-9a-f]{1,4}){1,2})|:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){4}(?:(?:(?::[0-9a-f]{1,4}){1,3})|(?:(?::[0-9a-f]{1,4})?:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){3}(?:(?:(?::[0-9a-f]{1,4}){1,4})|(?:(?::[0-9a-f]{1,4}){0,2}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){2}(?:(?:(?::[0-9a-f]{1,4}){1,5})|(?:(?::[0-9a-f]{1,4}){0,3}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){1}(?:(?:(?::[0-9a-f]{1,4}){1,6})|(?:(?::[0-9a-f]{1,4}){0,4}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?::(?:(?:(?::[0-9a-f]{1,4}){1,7})|(?:(?::[0-9a-f]{1,4}){0,5}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(?:%.+)?\s*$/i, regex: regex, uuid: UUID, 'json-pointer': JSON_POINTER, + 'json-pointer-uri-fragment': JSON_POINTER_URI_FRAGMENT, 'relative-json-pointer': RELATIVE_JSON_POINTER }; +function isLeapYear(year) { + // https://tools.ietf.org/html/rfc3339#appendix-C + return year % 4 === 0 && (year % 100 !== 0 || year % 400 === 0); +} + + function date(str) { // full-date from http://tools.ietf.org/html/rfc3339#section-5.6 var matches = str.match(DATE); if (!matches) return false; - var month = +matches[1]; - var day = +matches[2]; - return month >= 1 && month <= 12 && day >= 1 && day <= DAYS[month]; + var year = +matches[1]; + var month = +matches[2]; + var day = +matches[3]; + + return month >= 1 && month <= 12 && day >= 1 && + day <= (month == 2 && isLeapYear(year) ? 29 : DAYS[month]); } @@ -338,7 +266,9 @@ function time(str, full) { var minute = matches[2]; var second = matches[3]; var timeZone = matches[5]; - return hour <= 23 && minute <= 59 && second <= 59 && (!full || timeZone); + return ((hour <= 23 && minute <= 59 && second <= 59) || + (hour == 23 && minute == 59 && second == 60)) && + (!full || timeZone); } @@ -350,13 +280,6 @@ function date_time(str) { } -function hostname(str) { - // https://tools.ietf.org/html/rfc1034#section-3.5 - // https://tools.ietf.org/html/rfc1123#section-2 - return str.length <= 255 && HOSTNAME.test(str); -} - - var NOT_URI_FRAGMENT = /\/|:/; function uri(str) { // http://jmrware.com/articles/2009/uri_regexp/URI_regex.html + optional protocol + required "." @@ -375,7 +298,7 @@ function regex(str) { } } -},{"./util":12}],7:[function(require,module,exports){ +},{"./util":10}],5:[function(require,module,exports){ 'use strict'; var resolve = require('./resolve') @@ -389,7 +312,6 @@ var validateGenerator = require('../dotjs/validate'); * Functions below are used inside compiled validations function */ -var co = require('co'); var ucs2length = util.ucs2length; var equal = require('fast-deep-equal'); @@ -448,9 +370,11 @@ function compile(schema, root, localRefs, baseId) { endCompiling.call(this, schema, root, baseId); } + /* @this {*} - custom context, see passContext option */ function callValidate() { + /* jshint validthis: true */ var validate = compilation.validate; - var result = validate.apply(null, arguments); + var result = validate.apply(this, arguments); callValidate.errors = validate.errors; return result; } @@ -490,7 +414,7 @@ function compile(schema, root, localRefs, baseId) { + vars(defaults, defaultCode) + vars(customRules, customRuleCode) + sourceCode; - if (opts.processCode) sourceCode = opts.processCode(sourceCode); + if (opts.processCode) sourceCode = opts.processCode(sourceCode, _schema); // console.log('\n\n\n *** \n', JSON.stringify(sourceCode)); var validate; try { @@ -502,7 +426,6 @@ function compile(schema, root, localRefs, baseId) { 'refVal', 'defaults', 'customRules', - 'co', 'equal', 'ucs2length', 'ValidationError', @@ -517,7 +440,6 @@ function compile(schema, root, localRefs, baseId) { refVal, defaults, customRules, - co, equal, ucs2length, ValidationError @@ -602,7 +524,7 @@ function compile(schema, root, localRefs, baseId) { function resolvedRef(refVal, code) { return typeof refVal == 'object' || typeof refVal == 'boolean' ? { code: code, schema: refVal, inline: true } - : { code: code, $async: refVal && refVal.$async }; + : { code: code, $async: refVal && !!refVal.$async }; } function usePattern(regexStr) { @@ -634,13 +556,21 @@ function compile(schema, root, localRefs, baseId) { } function useCustomRule(rule, schema, parentSchema, it) { - var validateSchema = rule.definition.validateSchema; - if (validateSchema && self._opts.validateSchema !== false) { - var valid = validateSchema(schema); - if (!valid) { - var message = 'keyword schema is invalid: ' + self.errorsText(validateSchema.errors); - if (self._opts.validateSchema == 'log') self.logger.error(message); - else throw new Error(message); + if (self._opts.validateSchema !== false) { + var deps = rule.definition.dependencies; + if (deps && !deps.every(function(keyword) { + return Object.prototype.hasOwnProperty.call(parentSchema, keyword); + })) + throw new Error('parent schema must have all required keywords: ' + deps.join(',')); + + var validateSchema = rule.definition.validateSchema; + if (validateSchema) { + var valid = validateSchema(schema); + if (!valid) { + var message = 'keyword schema is invalid: ' + self.errorsText(validateSchema.errors); + if (self._opts.validateSchema == 'log') self.logger.error(message); + else throw new Error(message); + } } } @@ -757,10 +687,10 @@ function vars(arr, statement) { return code; } -},{"../dotjs/validate":35,"./error_classes":5,"./resolve":8,"./util":12,"co":40,"fast-deep-equal":41,"fast-json-stable-stringify":42}],8:[function(require,module,exports){ +},{"../dotjs/validate":38,"./error_classes":3,"./resolve":6,"./util":10,"fast-deep-equal":42,"fast-json-stable-stringify":43}],6:[function(require,module,exports){ 'use strict'; -var url = require('url') +var URI = require('uri-js') , equal = require('fast-deep-equal') , util = require('./util') , SchemaObject = require('./schema_obj') @@ -827,10 +757,10 @@ function resolve(compile, root, ref) { */ function resolveSchema(root, ref) { /* jshint validthis: true */ - var p = url.parse(ref, false, true) + var p = URI.parse(ref) , refPath = _getFullPath(p) , baseId = getFullPath(this._getId(root.schema)); - if (refPath !== baseId) { + if (Object.keys(root.schema).length === 0 || refPath !== baseId) { var id = normalizeId(refPath); var refVal = this._refs[id]; if (typeof refVal == 'string') { @@ -875,9 +805,9 @@ var PREVENT_SCOPE_CHANGE = util.toHash(['properties', 'patternProperties', 'enum /* @this Ajv */ function getJsonPointer(parsedRef, baseId, schema, root) { /* jshint validthis: true */ - parsedRef.hash = parsedRef.hash || ''; - if (parsedRef.hash.slice(0,2) != '#/') return; - var parts = parsedRef.hash.split('/'); + parsedRef.fragment = parsedRef.fragment || ''; + if (parsedRef.fragment.slice(0,1) != '/') return; + var parts = parsedRef.fragment.split('/'); for (var i = 1; i < parts.length; i++) { var part = parts[i]; @@ -966,14 +896,13 @@ function countKeys(schema) { function getFullPath(id, normalize) { if (normalize !== false) id = normalizeId(id); - var p = url.parse(id, false, true); + var p = URI.parse(id); return _getFullPath(p); } function _getFullPath(p) { - var protocolSeparator = p.protocol || p.href.slice(0,2) == '//' ? '//' : ''; - return (p.protocol||'') + protocolSeparator + (p.host||'') + (p.path||'') + '#'; + return URI.serialize(p).split('#')[0] + '#'; } @@ -985,7 +914,7 @@ function normalizeId(id) { function resolveUrl(baseId, id) { id = normalizeId(id); - return url.resolve(baseId, id); + return URI.resolve(baseId, id); } @@ -1006,7 +935,7 @@ function resolveIds(schema) { fullPath += '/' + (typeof keyIndex == 'number' ? keyIndex : util.escapeFragment(keyIndex)); if (typeof id == 'string') { - id = baseId = normalizeId(baseId ? url.resolve(baseId, id) : id); + id = baseId = normalizeId(baseId ? URI.resolve(baseId, id) : id); var refVal = self._refs[id]; if (typeof refVal == 'string') refVal = self._refs[refVal]; @@ -1030,10 +959,10 @@ function resolveIds(schema) { return localRefs; } -},{"./schema_obj":10,"./util":12,"fast-deep-equal":41,"json-schema-traverse":43,"url":48}],9:[function(require,module,exports){ +},{"./schema_obj":8,"./util":10,"fast-deep-equal":42,"json-schema-traverse":44,"uri-js":45}],7:[function(require,module,exports){ 'use strict'; -var ruleModules = require('./_rules') +var ruleModules = require('../dotjs') , toHash = require('./util').toHash; module.exports = function rules() { @@ -1044,17 +973,20 @@ module.exports = function rules() { { type: 'string', rules: [ 'maxLength', 'minLength', 'pattern', 'format' ] }, { type: 'array', - rules: [ 'maxItems', 'minItems', 'uniqueItems', 'contains', 'items' ] }, + rules: [ 'maxItems', 'minItems', 'items', 'contains', 'uniqueItems' ] }, { type: 'object', rules: [ 'maxProperties', 'minProperties', 'required', 'dependencies', 'propertyNames', { 'properties': ['additionalProperties', 'patternProperties'] } ] }, - { rules: [ '$ref', 'const', 'enum', 'not', 'anyOf', 'oneOf', 'allOf' ] } + { rules: [ '$ref', 'const', 'enum', 'not', 'anyOf', 'oneOf', 'allOf', 'if' ] } ]; - var ALL = [ 'type' ]; + var ALL = [ 'type', '$comment' ]; var KEYWORDS = [ - 'additionalItems', '$schema', '$id', 'id', 'title', - 'description', 'default', 'definitions' + '$schema', '$id', 'id', '$data', '$async', 'title', + 'description', 'default', 'definitions', + 'examples', 'readOnly', 'writeOnly', + 'contentMediaType', 'contentEncoding', + 'additionalItems', 'then', 'else' ]; var TYPES = [ 'number', 'integer', 'string', 'array', 'object', 'boolean', 'null' ]; RULES.all = toHash(ALL); @@ -1081,6 +1013,11 @@ module.exports = function rules() { return rule; }); + RULES.all.$comment = { + keyword: '$comment', + code: ruleModules.$comment + }; + if (group.type) RULES.types[group.type] = group; }); @@ -1090,7 +1027,7 @@ module.exports = function rules() { return RULES; }; -},{"./_rules":3,"./util":12}],10:[function(require,module,exports){ +},{"../dotjs":27,"./util":10}],8:[function(require,module,exports){ 'use strict'; var util = require('./util'); @@ -1101,7 +1038,7 @@ function SchemaObject(obj) { util.copy(obj, this); } -},{"./util":12}],11:[function(require,module,exports){ +},{"./util":10}],9:[function(require,module,exports){ 'use strict'; // https://mathiasbynens.be/notes/javascript-encoding @@ -1123,7 +1060,7 @@ module.exports = function ucs2length(str) { return length; }; -},{}],12:[function(require,module,exports){ +},{}],10:[function(require,module,exports){ 'use strict'; @@ -1139,10 +1076,9 @@ module.exports = { ucs2length: require('./ucs2length'), varOccurences: varOccurences, varReplace: varReplace, - cleanUpCode: cleanUpCode, - finalCleanUpCode: finalCleanUpCode, schemaHasRules: schemaHasRules, schemaHasRulesExcept: schemaHasRulesExcept, + schemaUnknownRules: schemaUnknownRules, toQuotedString: toQuotedString, getPathExpr: getPathExpr, getPath: getPath, @@ -1161,7 +1097,7 @@ function copy(o, to) { } -function checkDataType(dataType, data, negate) { +function checkDataType(dataType, data, strictNumbers, negate) { var EQUAL = negate ? ' !== ' : ' === ' , AND = negate ? ' || ' : ' && ' , OK = negate ? '!' : '' @@ -1174,15 +1110,18 @@ function checkDataType(dataType, data, negate) { NOT + 'Array.isArray(' + data + '))'; case 'integer': return '(typeof ' + data + EQUAL + '"number"' + AND + NOT + '(' + data + ' % 1)' + - AND + data + EQUAL + data + ')'; + AND + data + EQUAL + data + + (strictNumbers ? (AND + OK + 'isFinite(' + data + ')') : '') + ')'; + case 'number': return '(typeof ' + data + EQUAL + '"' + dataType + '"' + + (strictNumbers ? (AND + OK + 'isFinite(' + data + ')') : '') + ')'; default: return 'typeof ' + data + EQUAL + '"' + dataType + '"'; } } -function checkDataTypes(dataTypes, data) { +function checkDataTypes(dataTypes, data, strictNumbers) { switch (dataTypes.length) { - case 1: return checkDataType(dataTypes[0], data, true); + case 1: return checkDataType(dataTypes[0], data, strictNumbers, true); default: var code = ''; var types = toHash(dataTypes); @@ -1195,7 +1134,7 @@ function checkDataTypes(dataTypes, data) { } if (types.number) delete types.integer; for (var t in types) - code += (code ? ' && ' : '' ) + checkDataType(t, data, true); + code += (code ? ' && ' : '' ) + checkDataType(t, data, strictNumbers, true); return code; } @@ -1261,42 +1200,6 @@ function varReplace(str, dataVar, expr) { } -var EMPTY_ELSE = /else\s*{\s*}/g - , EMPTY_IF_NO_ELSE = /if\s*\([^)]+\)\s*\{\s*\}(?!\s*else)/g - , EMPTY_IF_WITH_ELSE = /if\s*\(([^)]+)\)\s*\{\s*\}\s*else(?!\s*if)/g; -function cleanUpCode(out) { - return out.replace(EMPTY_ELSE, '') - .replace(EMPTY_IF_NO_ELSE, '') - .replace(EMPTY_IF_WITH_ELSE, 'if (!($1))'); -} - - -var ERRORS_REGEXP = /[^v.]errors/g - , REMOVE_ERRORS = /var errors = 0;|var vErrors = null;|validate.errors = vErrors;/g - , REMOVE_ERRORS_ASYNC = /var errors = 0;|var vErrors = null;/g - , RETURN_VALID = 'return errors === 0;' - , RETURN_TRUE = 'validate.errors = null; return true;' - , RETURN_ASYNC = /if \(errors === 0\) return data;\s*else throw new ValidationError\(vErrors\);/ - , RETURN_DATA_ASYNC = 'return data;' - , ROOTDATA_REGEXP = /[^A-Za-z_$]rootData[^A-Za-z0-9_$]/g - , REMOVE_ROOTDATA = /if \(rootData === undefined\) rootData = data;/; - -function finalCleanUpCode(out, async) { - var matches = out.match(ERRORS_REGEXP); - if (matches && matches.length == 2) { - out = async - ? out.replace(REMOVE_ERRORS_ASYNC, '') - .replace(RETURN_ASYNC, RETURN_DATA_ASYNC) - : out.replace(REMOVE_ERRORS, '') - .replace(RETURN_VALID, RETURN_TRUE); - } - - matches = out.match(ROOTDATA_REGEXP); - if (!matches || matches.length !== 3) return out; - return out.replace(REMOVE_ROOTDATA, ''); -} - - function schemaHasRules(schema, rules) { if (typeof schema == 'boolean') return !schema; for (var key in schema) if (rules[key]) return true; @@ -1309,6 +1212,12 @@ function schemaHasRulesExcept(schema, rules, exceptKeyword) { } +function schemaUnknownRules(schema, rules) { + if (typeof schema == 'boolean') return; + for (var key in schema) if (!rules[key]) return key; +} + + function toQuotedString(str) { return '\'' + escapeQuotes(str) + '\''; } @@ -1369,7 +1278,7 @@ function getData($data, lvl, paths) { function joinPaths (a, b) { if (a == '""') return b; - return (a + ' + ' + b).replace(/' \+ '/g, ''); + return (a + ' + ' + b).replace(/([^\\])' \+ '/g, '$1'); } @@ -1392,7 +1301,97 @@ function unescapeJsonPointer(str) { return str.replace(/~1/g, '/').replace(/~0/g, '~'); } -},{"./ucs2length":11,"fast-deep-equal":41}],13:[function(require,module,exports){ +},{"./ucs2length":9,"fast-deep-equal":42}],11:[function(require,module,exports){ +'use strict'; + +var KEYWORDS = [ + 'multipleOf', + 'maximum', + 'exclusiveMaximum', + 'minimum', + 'exclusiveMinimum', + 'maxLength', + 'minLength', + 'pattern', + 'additionalItems', + 'maxItems', + 'minItems', + 'uniqueItems', + 'maxProperties', + 'minProperties', + 'required', + 'additionalProperties', + 'enum', + 'format', + 'const' +]; + +module.exports = function (metaSchema, keywordsJsonPointers) { + for (var i=0; i', $notOp = $isMax ? '>' : '<', $errorKeyword = undefined; + if (!($isData || typeof $schema == 'number' || $schema === undefined)) { + throw new Error($keyword + ' must be number'); + } + if (!($isDataExcl || $schemaExcl === undefined || typeof $schemaExcl == 'number' || typeof $schemaExcl == 'boolean')) { + throw new Error($exclusiveKeyword + ' must be number or boolean'); + } if ($isDataExcl) { var $schemaValueExcl = it.util.getData($schemaExcl.$data, $dataLvl, it.dataPathArr), $exclusive = 'exclusive' + $lvl, @@ -1447,7 +1452,8 @@ module.exports = function generate__limit(it, $keyword, $ruleType) { } var __err = out; out = $$outStack.pop(); - if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ if (it.async) { out += ' throw new ValidationError([' + (__err) + ']); '; } else { @@ -1460,7 +1466,13 @@ module.exports = function generate__limit(it, $keyword, $ruleType) { if ($isData) { out += ' (' + ($schemaValue) + ' !== undefined && typeof ' + ($schemaValue) + ' != \'number\') || '; } - out += ' ' + ($exclType) + ' == \'number\' ? ( (' + ($exclusive) + ' = ' + ($schemaValue) + ' === undefined || ' + ($schemaValueExcl) + ' ' + ($op) + '= ' + ($schemaValue) + ') ? ' + ($data) + ' ' + ($notOp) + '= ' + ($schemaValueExcl) + ' : ' + ($data) + ' ' + ($notOp) + ' ' + ($schemaValue) + ' ) : ( (' + ($exclusive) + ' = ' + ($schemaValueExcl) + ' === true) ? ' + ($data) + ' ' + ($notOp) + '= ' + ($schemaValue) + ' : ' + ($data) + ' ' + ($notOp) + ' ' + ($schemaValue) + ' ) || ' + ($data) + ' !== ' + ($data) + ') { var op' + ($lvl) + ' = ' + ($exclusive) + ' ? \'' + ($op) + '\' : \'' + ($op) + '=\';'; + out += ' ' + ($exclType) + ' == \'number\' ? ( (' + ($exclusive) + ' = ' + ($schemaValue) + ' === undefined || ' + ($schemaValueExcl) + ' ' + ($op) + '= ' + ($schemaValue) + ') ? ' + ($data) + ' ' + ($notOp) + '= ' + ($schemaValueExcl) + ' : ' + ($data) + ' ' + ($notOp) + ' ' + ($schemaValue) + ' ) : ( (' + ($exclusive) + ' = ' + ($schemaValueExcl) + ' === true) ? ' + ($data) + ' ' + ($notOp) + '= ' + ($schemaValue) + ' : ' + ($data) + ' ' + ($notOp) + ' ' + ($schemaValue) + ' ) || ' + ($data) + ' !== ' + ($data) + ') { var op' + ($lvl) + ' = ' + ($exclusive) + ' ? \'' + ($op) + '\' : \'' + ($op) + '=\'; '; + if ($schema === undefined) { + $errorKeyword = $exclusiveKeyword; + $errSchemaPath = it.errSchemaPath + '/' + $exclusiveKeyword; + $schemaValue = $schemaValueExcl; + $isData = $isDataExcl; + } } else { var $exclIsNumber = typeof $schemaExcl == 'number', $opStr = $op; @@ -1527,7 +1539,8 @@ module.exports = function generate__limit(it, $keyword, $ruleType) { } var __err = out; out = $$outStack.pop(); - if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ if (it.async) { out += ' throw new ValidationError([' + (__err) + ']); '; } else { @@ -1563,6 +1576,9 @@ module.exports = function generate__limitItems(it, $keyword, $ruleType) { } else { $schemaValue = $schema; } + if (!($isData || typeof $schema == 'number')) { + throw new Error($keyword + ' must be number'); + } var $op = $keyword == 'maxItems' ? '>' : '<'; out += 'if ( '; if ($isData) { @@ -1580,7 +1596,7 @@ module.exports = function generate__limitItems(it, $keyword, $ruleType) { if ($keyword == 'maxItems') { out += 'more'; } else { - out += 'less'; + out += 'fewer'; } out += ' than '; if ($isData) { @@ -1605,7 +1621,8 @@ module.exports = function generate__limitItems(it, $keyword, $ruleType) { } var __err = out; out = $$outStack.pop(); - if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ if (it.async) { out += ' throw new ValidationError([' + (__err) + ']); '; } else { @@ -1641,6 +1658,9 @@ module.exports = function generate__limitLength(it, $keyword, $ruleType) { } else { $schemaValue = $schema; } + if (!($isData || typeof $schema == 'number')) { + throw new Error($keyword + ' must be number'); + } var $op = $keyword == 'maxLength' ? '>' : '<'; out += 'if ( '; if ($isData) { @@ -1688,7 +1708,8 @@ module.exports = function generate__limitLength(it, $keyword, $ruleType) { } var __err = out; out = $$outStack.pop(); - if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ if (it.async) { out += ' throw new ValidationError([' + (__err) + ']); '; } else { @@ -1724,6 +1745,9 @@ module.exports = function generate__limitProperties(it, $keyword, $ruleType) { } else { $schemaValue = $schema; } + if (!($isData || typeof $schema == 'number')) { + throw new Error($keyword + ' must be number'); + } var $op = $keyword == 'maxProperties' ? '>' : '<'; out += 'if ( '; if ($isData) { @@ -1741,7 +1765,7 @@ module.exports = function generate__limitProperties(it, $keyword, $ruleType) { if ($keyword == 'maxProperties') { out += 'more'; } else { - out += 'less'; + out += 'fewer'; } out += ' than '; if ($isData) { @@ -1766,7 +1790,8 @@ module.exports = function generate__limitProperties(it, $keyword, $ruleType) { } var __err = out; out = $$outStack.pop(); - if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ if (it.async) { out += ' throw new ValidationError([' + (__err) + ']); '; } else { @@ -1802,7 +1827,7 @@ module.exports = function generate_allOf(it, $keyword, $ruleType) { l1 = arr1.length - 1; while ($i < l1) { $sch = arr1[$i += 1]; - if (it.util.schemaHasRules($sch, it.RULES.all)) { + if ((it.opts.strictKeywords ? (typeof $sch == 'object' && Object.keys($sch).length > 0) || $sch === false : it.util.schemaHasRules($sch, it.RULES.all))) { $allSchemasEmpty = false; $it.schema = $sch; $it.schemaPath = $schemaPath + '[' + $i + ']'; @@ -1823,7 +1848,6 @@ module.exports = function generate_allOf(it, $keyword, $ruleType) { out += ' ' + ($closingBraces.slice(0, -1)) + ' '; } } - out = it.util.cleanUpCode(out); return out; } @@ -1845,7 +1869,7 @@ module.exports = function generate_anyOf(it, $keyword, $ruleType) { $it.level++; var $nextValid = 'valid' + $it.level; var $noEmptySchema = $schema.every(function($sch) { - return it.util.schemaHasRules($sch, it.RULES.all); + return (it.opts.strictKeywords ? (typeof $sch == 'object' && Object.keys($sch).length > 0) || $sch === false : it.util.schemaHasRules($sch, it.RULES.all)); }); if ($noEmptySchema) { var $currentBaseId = $it.baseId; @@ -1882,7 +1906,8 @@ module.exports = function generate_anyOf(it, $keyword, $ruleType) { out += ' {} '; } out += '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; - if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ if (it.async) { out += ' throw new ValidationError(vErrors); '; } else { @@ -1893,7 +1918,6 @@ module.exports = function generate_anyOf(it, $keyword, $ruleType) { if (it.opts.allErrors) { out += ' } '; } - out = it.util.cleanUpCode(out); } else { if ($breakOnError) { out += ' if (true) { '; @@ -1904,6 +1928,22 @@ module.exports = function generate_anyOf(it, $keyword, $ruleType) { },{}],19:[function(require,module,exports){ 'use strict'; +module.exports = function generate_comment(it, $keyword, $ruleType) { + var out = ' '; + var $schema = it.schema[$keyword]; + var $errSchemaPath = it.errSchemaPath + '/' + $keyword; + var $breakOnError = !it.opts.allErrors; + var $comment = it.util.toQuotedString($schema); + if (it.opts.$comment === true) { + out += ' console.log(' + ($comment) + ');'; + } else if (typeof it.opts.$comment == 'function') { + out += ' self._opts.$comment(' + ($comment) + ', ' + (it.util.toQuotedString($errSchemaPath)) + ', validate.root.schema);'; + } + return out; +} + +},{}],20:[function(require,module,exports){ +'use strict'; module.exports = function generate_const(it, $keyword, $ruleType) { var out = ' '; var $lvl = it.level; @@ -1930,7 +1970,7 @@ module.exports = function generate_const(it, $keyword, $ruleType) { $$outStack.push(out); out = ''; /* istanbul ignore else */ if (it.createErrors !== false) { - out += ' { keyword: \'' + ('const') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: {} '; + out += ' { keyword: \'' + ('const') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { allowedValue: schema' + ($lvl) + ' } '; if (it.opts.messages !== false) { out += ' , message: \'should be equal to constant\' '; } @@ -1943,7 +1983,8 @@ module.exports = function generate_const(it, $keyword, $ruleType) { } var __err = out; out = $$outStack.pop(); - if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ if (it.async) { out += ' throw new ValidationError([' + (__err) + ']); '; } else { @@ -1959,7 +2000,7 @@ module.exports = function generate_const(it, $keyword, $ruleType) { return out; } -},{}],20:[function(require,module,exports){ +},{}],21:[function(require,module,exports){ 'use strict'; module.exports = function generate_contains(it, $keyword, $ruleType) { var out = ' '; @@ -1980,7 +2021,7 @@ module.exports = function generate_contains(it, $keyword, $ruleType) { $dataNxt = $it.dataLevel = it.dataLevel + 1, $nextData = 'data' + $dataNxt, $currentBaseId = it.baseId, - $nonEmptySchema = it.util.schemaHasRules($schema, it.RULES.all); + $nonEmptySchema = (it.opts.strictKeywords ? (typeof $schema == 'object' && Object.keys($schema).length > 0) || $schema === false : it.util.schemaHasRules($schema, it.RULES.all)); out += 'var ' + ($errs) + ' = errors;var ' + ($valid) + ';'; if ($nonEmptySchema) { var $wasComposite = it.compositeRule; @@ -2022,7 +2063,8 @@ module.exports = function generate_contains(it, $keyword, $ruleType) { } var __err = out; out = $$outStack.pop(); - if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ if (it.async) { out += ' throw new ValidationError([' + (__err) + ']); '; } else { @@ -2038,11 +2080,10 @@ module.exports = function generate_contains(it, $keyword, $ruleType) { if (it.opts.allErrors) { out += ' } '; } - out = it.util.cleanUpCode(out); return out; } -},{}],21:[function(require,module,exports){ +},{}],22:[function(require,module,exports){ 'use strict'; module.exports = function generate_custom(it, $keyword, $ruleType) { var out = ' '; @@ -2144,13 +2185,13 @@ module.exports = function generate_custom(it, $keyword, $ruleType) { if ($rDef.errors === false) { out += ' ' + ($valid) + ' = '; if ($asyncKeyword) { - out += '' + (it.yieldAwait); + out += 'await '; } out += '' + (def_callRuleValidate) + '; '; } else { if ($asyncKeyword) { $ruleErrs = 'customErrors' + $lvl; - out += ' var ' + ($ruleErrs) + ' = null; try { ' + ($valid) + ' = ' + (it.yieldAwait) + (def_callRuleValidate) + '; } catch (e) { ' + ($valid) + ' = false; if (e instanceof ValidationError) ' + ($ruleErrs) + ' = e.errors; else throw e; } '; + out += ' var ' + ($ruleErrs) + ' = null; try { ' + ($valid) + ' = await ' + (def_callRuleValidate) + '; } catch (e) { ' + ($valid) + ' = false; if (e instanceof ValidationError) ' + ($ruleErrs) + ' = e.errors; else throw e; } '; } else { out += ' ' + ($ruleErrs) + ' = null; ' + ($valid) + ' = ' + (def_callRuleValidate) + '; '; } @@ -2198,7 +2239,8 @@ module.exports = function generate_custom(it, $keyword, $ruleType) { } var __err = out; out = $$outStack.pop(); - if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ if (it.async) { out += ' throw new ValidationError([' + (__err) + ']); '; } else { @@ -2244,7 +2286,8 @@ module.exports = function generate_custom(it, $keyword, $ruleType) { out += ' {} '; } out += '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; - if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ if (it.async) { out += ' throw new ValidationError(vErrors); '; } else { @@ -2270,7 +2313,7 @@ module.exports = function generate_custom(it, $keyword, $ruleType) { return out; } -},{}],22:[function(require,module,exports){ +},{}],23:[function(require,module,exports){ 'use strict'; module.exports = function generate_dependencies(it, $keyword, $ruleType) { var out = ' '; @@ -2290,6 +2333,7 @@ module.exports = function generate_dependencies(it, $keyword, $ruleType) { $propertyDeps = {}, $ownProperties = it.opts.ownProperties; for ($property in $schema) { + if ($property == '__proto__') continue; var $sch = $schema[$property]; var $deps = Array.isArray($sch) ? $propertyDeps : $schemaDeps; $deps[$property] = $sch; @@ -2353,7 +2397,8 @@ module.exports = function generate_dependencies(it, $keyword, $ruleType) { } var __err = out; out = $$outStack.pop(); - if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ if (it.async) { out += ' throw new ValidationError([' + (__err) + ']); '; } else { @@ -2414,7 +2459,7 @@ module.exports = function generate_dependencies(it, $keyword, $ruleType) { var $currentBaseId = $it.baseId; for (var $property in $schemaDeps) { var $sch = $schemaDeps[$property]; - if (it.util.schemaHasRules($sch, it.RULES.all)) { + if ((it.opts.strictKeywords ? (typeof $sch == 'object' && Object.keys($sch).length > 0) || $sch === false : it.util.schemaHasRules($sch, it.RULES.all))) { out += ' ' + ($nextValid) + ' = true; if ( ' + ($data) + (it.util.getProperty($property)) + ' !== undefined '; if ($ownProperties) { out += ' && Object.prototype.hasOwnProperty.call(' + ($data) + ', \'' + (it.util.escapeQuotes($property)) + '\') '; @@ -2435,11 +2480,10 @@ module.exports = function generate_dependencies(it, $keyword, $ruleType) { if ($breakOnError) { out += ' ' + ($closingBraces) + ' if (' + ($errs) + ' == errors) {'; } - out = it.util.cleanUpCode(out); return out; } -},{}],23:[function(require,module,exports){ +},{}],24:[function(require,module,exports){ 'use strict'; module.exports = function generate_enum(it, $keyword, $ruleType) { var out = ' '; @@ -2490,7 +2534,8 @@ module.exports = function generate_enum(it, $keyword, $ruleType) { } var __err = out; out = $$outStack.pop(); - if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ if (it.async) { out += ' throw new ValidationError([' + (__err) + ']); '; } else { @@ -2506,7 +2551,7 @@ module.exports = function generate_enum(it, $keyword, $ruleType) { return out; } -},{}],24:[function(require,module,exports){ +},{}],25:[function(require,module,exports){ 'use strict'; module.exports = function generate_format(it, $keyword, $ruleType) { var out = ' '; @@ -2555,7 +2600,7 @@ module.exports = function generate_format(it, $keyword, $ruleType) { } out += ' (' + ($format) + ' && ' + ($formatType) + ' == \'' + ($ruleType) + '\' && !(typeof ' + ($format) + ' == \'function\' ? '; if (it.async) { - out += ' (async' + ($lvl) + ' ? ' + (it.yieldAwait) + ' ' + ($format) + '(' + ($data) + ') : ' + ($format) + '(' + ($data) + ')) '; + out += ' (async' + ($lvl) + ' ? await ' + ($format) + '(' + ($data) + ') : ' + ($format) + '(' + ($data) + ')) '; } else { out += ' ' + ($format) + '(' + ($data) + ') '; } @@ -2593,7 +2638,7 @@ module.exports = function generate_format(it, $keyword, $ruleType) { if ($async) { if (!it.async) throw new Error('async format in sync schema'); var $formatRef = 'formats' + it.util.getProperty($schema) + '.validate'; - out += ' if (!(' + (it.yieldAwait) + ' ' + ($formatRef) + '(' + ($data) + '))) { '; + out += ' if (!(await ' + ($formatRef) + '(' + ($data) + '))) { '; } else { out += ' if (! '; var $formatRef = 'formats' + it.util.getProperty($schema); @@ -2641,7 +2686,8 @@ module.exports = function generate_format(it, $keyword, $ruleType) { } var __err = out; out = $$outStack.pop(); - if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ if (it.async) { out += ' throw new ValidationError([' + (__err) + ']); '; } else { @@ -2657,7 +2703,147 @@ module.exports = function generate_format(it, $keyword, $ruleType) { return out; } -},{}],25:[function(require,module,exports){ +},{}],26:[function(require,module,exports){ +'use strict'; +module.exports = function generate_if(it, $keyword, $ruleType) { + var out = ' '; + var $lvl = it.level; + var $dataLvl = it.dataLevel; + var $schema = it.schema[$keyword]; + var $schemaPath = it.schemaPath + it.util.getProperty($keyword); + var $errSchemaPath = it.errSchemaPath + '/' + $keyword; + var $breakOnError = !it.opts.allErrors; + var $data = 'data' + ($dataLvl || ''); + var $valid = 'valid' + $lvl; + var $errs = 'errs__' + $lvl; + var $it = it.util.copy(it); + $it.level++; + var $nextValid = 'valid' + $it.level; + var $thenSch = it.schema['then'], + $elseSch = it.schema['else'], + $thenPresent = $thenSch !== undefined && (it.opts.strictKeywords ? (typeof $thenSch == 'object' && Object.keys($thenSch).length > 0) || $thenSch === false : it.util.schemaHasRules($thenSch, it.RULES.all)), + $elsePresent = $elseSch !== undefined && (it.opts.strictKeywords ? (typeof $elseSch == 'object' && Object.keys($elseSch).length > 0) || $elseSch === false : it.util.schemaHasRules($elseSch, it.RULES.all)), + $currentBaseId = $it.baseId; + if ($thenPresent || $elsePresent) { + var $ifClause; + $it.createErrors = false; + $it.schema = $schema; + $it.schemaPath = $schemaPath; + $it.errSchemaPath = $errSchemaPath; + out += ' var ' + ($errs) + ' = errors; var ' + ($valid) + ' = true; '; + var $wasComposite = it.compositeRule; + it.compositeRule = $it.compositeRule = true; + out += ' ' + (it.validate($it)) + ' '; + $it.baseId = $currentBaseId; + $it.createErrors = true; + out += ' errors = ' + ($errs) + '; if (vErrors !== null) { if (' + ($errs) + ') vErrors.length = ' + ($errs) + '; else vErrors = null; } '; + it.compositeRule = $it.compositeRule = $wasComposite; + if ($thenPresent) { + out += ' if (' + ($nextValid) + ') { '; + $it.schema = it.schema['then']; + $it.schemaPath = it.schemaPath + '.then'; + $it.errSchemaPath = it.errSchemaPath + '/then'; + out += ' ' + (it.validate($it)) + ' '; + $it.baseId = $currentBaseId; + out += ' ' + ($valid) + ' = ' + ($nextValid) + '; '; + if ($thenPresent && $elsePresent) { + $ifClause = 'ifClause' + $lvl; + out += ' var ' + ($ifClause) + ' = \'then\'; '; + } else { + $ifClause = '\'then\''; + } + out += ' } '; + if ($elsePresent) { + out += ' else { '; + } + } else { + out += ' if (!' + ($nextValid) + ') { '; + } + if ($elsePresent) { + $it.schema = it.schema['else']; + $it.schemaPath = it.schemaPath + '.else'; + $it.errSchemaPath = it.errSchemaPath + '/else'; + out += ' ' + (it.validate($it)) + ' '; + $it.baseId = $currentBaseId; + out += ' ' + ($valid) + ' = ' + ($nextValid) + '; '; + if ($thenPresent && $elsePresent) { + $ifClause = 'ifClause' + $lvl; + out += ' var ' + ($ifClause) + ' = \'else\'; '; + } else { + $ifClause = '\'else\''; + } + out += ' } '; + } + out += ' if (!' + ($valid) + ') { var err = '; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ('if') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { failingKeyword: ' + ($ifClause) + ' } '; + if (it.opts.messages !== false) { + out += ' , message: \'should match "\' + ' + ($ifClause) + ' + \'" schema\' '; + } + if (it.opts.verbose) { + out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + out += '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError(vErrors); '; + } else { + out += ' validate.errors = vErrors; return false; '; + } + } + out += ' } '; + if ($breakOnError) { + out += ' else { '; + } + } else { + if ($breakOnError) { + out += ' if (true) { '; + } + } + return out; +} + +},{}],27:[function(require,module,exports){ +'use strict'; + +//all requires must be explicit because browserify won't work with dynamic requires +module.exports = { + '$ref': require('./ref'), + allOf: require('./allOf'), + anyOf: require('./anyOf'), + '$comment': require('./comment'), + const: require('./const'), + contains: require('./contains'), + dependencies: require('./dependencies'), + 'enum': require('./enum'), + format: require('./format'), + 'if': require('./if'), + items: require('./items'), + maximum: require('./_limit'), + minimum: require('./_limit'), + maxItems: require('./_limitItems'), + minItems: require('./_limitItems'), + maxLength: require('./_limitLength'), + minLength: require('./_limitLength'), + maxProperties: require('./_limitProperties'), + minProperties: require('./_limitProperties'), + multipleOf: require('./multipleOf'), + not: require('./not'), + oneOf: require('./oneOf'), + pattern: require('./pattern'), + properties: require('./properties'), + propertyNames: require('./propertyNames'), + required: require('./required'), + uniqueItems: require('./uniqueItems'), + validate: require('./validate') +}; + +},{"./_limit":13,"./_limitItems":14,"./_limitLength":15,"./_limitProperties":16,"./allOf":17,"./anyOf":18,"./comment":19,"./const":20,"./contains":21,"./dependencies":23,"./enum":24,"./format":25,"./if":26,"./items":28,"./multipleOf":29,"./not":30,"./oneOf":31,"./pattern":32,"./properties":33,"./propertyNames":34,"./ref":35,"./required":36,"./uniqueItems":37,"./validate":38}],28:[function(require,module,exports){ 'use strict'; module.exports = function generate_items(it, $keyword, $ruleType) { var out = ' '; @@ -2703,7 +2889,8 @@ module.exports = function generate_items(it, $keyword, $ruleType) { } var __err = out; out = $$outStack.pop(); - if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ if (it.async) { out += ' throw new ValidationError([' + (__err) + ']); '; } else { @@ -2725,7 +2912,7 @@ module.exports = function generate_items(it, $keyword, $ruleType) { l1 = arr1.length - 1; while ($i < l1) { $sch = arr1[$i += 1]; - if (it.util.schemaHasRules($sch, it.RULES.all)) { + if ((it.opts.strictKeywords ? (typeof $sch == 'object' && Object.keys($sch).length > 0) || $sch === false : it.util.schemaHasRules($sch, it.RULES.all))) { out += ' ' + ($nextValid) + ' = true; if (' + ($data) + '.length > ' + ($i) + ') { '; var $passData = $data + '[' + $i + ']'; $it.schema = $sch; @@ -2748,7 +2935,7 @@ module.exports = function generate_items(it, $keyword, $ruleType) { } } } - if (typeof $additionalItems == 'object' && it.util.schemaHasRules($additionalItems, it.RULES.all)) { + if (typeof $additionalItems == 'object' && (it.opts.strictKeywords ? (typeof $additionalItems == 'object' && Object.keys($additionalItems).length > 0) || $additionalItems === false : it.util.schemaHasRules($additionalItems, it.RULES.all))) { $it.schema = $additionalItems; $it.schemaPath = it.schemaPath + '.additionalItems'; $it.errSchemaPath = it.errSchemaPath + '/additionalItems'; @@ -2772,7 +2959,7 @@ module.exports = function generate_items(it, $keyword, $ruleType) { $closingBraces += '}'; } } - } else if (it.util.schemaHasRules($schema, it.RULES.all)) { + } else if ((it.opts.strictKeywords ? (typeof $schema == 'object' && Object.keys($schema).length > 0) || $schema === false : it.util.schemaHasRules($schema, it.RULES.all))) { $it.schema = $schema; $it.schemaPath = $schemaPath; $it.errSchemaPath = $errSchemaPath; @@ -2795,11 +2982,10 @@ module.exports = function generate_items(it, $keyword, $ruleType) { if ($breakOnError) { out += ' ' + ($closingBraces) + ' if (' + ($errs) + ' == errors) {'; } - out = it.util.cleanUpCode(out); return out; } -},{}],26:[function(require,module,exports){ +},{}],29:[function(require,module,exports){ 'use strict'; module.exports = function generate_multipleOf(it, $keyword, $ruleType) { var out = ' '; @@ -2818,6 +3004,9 @@ module.exports = function generate_multipleOf(it, $keyword, $ruleType) { } else { $schemaValue = $schema; } + if (!($isData || typeof $schema == 'number')) { + throw new Error($keyword + ' must be number'); + } out += 'var division' + ($lvl) + ';if ('; if ($isData) { out += ' ' + ($schemaValue) + ' !== undefined && ( typeof ' + ($schemaValue) + ' != \'number\' || '; @@ -2861,7 +3050,8 @@ module.exports = function generate_multipleOf(it, $keyword, $ruleType) { } var __err = out; out = $$outStack.pop(); - if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ if (it.async) { out += ' throw new ValidationError([' + (__err) + ']); '; } else { @@ -2877,7 +3067,7 @@ module.exports = function generate_multipleOf(it, $keyword, $ruleType) { return out; } -},{}],27:[function(require,module,exports){ +},{}],30:[function(require,module,exports){ 'use strict'; module.exports = function generate_not(it, $keyword, $ruleType) { var out = ' '; @@ -2892,7 +3082,7 @@ module.exports = function generate_not(it, $keyword, $ruleType) { var $it = it.util.copy(it); $it.level++; var $nextValid = 'valid' + $it.level; - if (it.util.schemaHasRules($schema, it.RULES.all)) { + if ((it.opts.strictKeywords ? (typeof $schema == 'object' && Object.keys($schema).length > 0) || $schema === false : it.util.schemaHasRules($schema, it.RULES.all))) { $it.schema = $schema; $it.schemaPath = $schemaPath; $it.errSchemaPath = $errSchemaPath; @@ -2927,7 +3117,8 @@ module.exports = function generate_not(it, $keyword, $ruleType) { } var __err = out; out = $$outStack.pop(); - if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ if (it.async) { out += ' throw new ValidationError([' + (__err) + ']); '; } else { @@ -2962,7 +3153,7 @@ module.exports = function generate_not(it, $keyword, $ruleType) { return out; } -},{}],28:[function(require,module,exports){ +},{}],31:[function(require,module,exports){ 'use strict'; module.exports = function generate_oneOf(it, $keyword, $ruleType) { var out = ' '; @@ -2979,8 +3170,10 @@ module.exports = function generate_oneOf(it, $keyword, $ruleType) { var $closingBraces = ''; $it.level++; var $nextValid = 'valid' + $it.level; - out += 'var ' + ($errs) + ' = errors;var prevValid' + ($lvl) + ' = false;var ' + ($valid) + ' = false;'; - var $currentBaseId = $it.baseId; + var $currentBaseId = $it.baseId, + $prevValid = 'prevValid' + $lvl, + $passingSchemas = 'passingSchemas' + $lvl; + out += 'var ' + ($errs) + ' = errors , ' + ($prevValid) + ' = false , ' + ($valid) + ' = false , ' + ($passingSchemas) + ' = null; '; var $wasComposite = it.compositeRule; it.compositeRule = $it.compositeRule = true; var arr1 = $schema; @@ -2989,7 +3182,7 @@ module.exports = function generate_oneOf(it, $keyword, $ruleType) { l1 = arr1.length - 1; while ($i < l1) { $sch = arr1[$i += 1]; - if (it.util.schemaHasRules($sch, it.RULES.all)) { + if ((it.opts.strictKeywords ? (typeof $sch == 'object' && Object.keys($sch).length > 0) || $sch === false : it.util.schemaHasRules($sch, it.RULES.all))) { $it.schema = $sch; $it.schemaPath = $schemaPath + '[' + $i + ']'; $it.errSchemaPath = $errSchemaPath + '/' + $i; @@ -2999,16 +3192,16 @@ module.exports = function generate_oneOf(it, $keyword, $ruleType) { out += ' var ' + ($nextValid) + ' = true; '; } if ($i) { - out += ' if (' + ($nextValid) + ' && prevValid' + ($lvl) + ') ' + ($valid) + ' = false; else { '; + out += ' if (' + ($nextValid) + ' && ' + ($prevValid) + ') { ' + ($valid) + ' = false; ' + ($passingSchemas) + ' = [' + ($passingSchemas) + ', ' + ($i) + ']; } else { '; $closingBraces += '}'; } - out += ' if (' + ($nextValid) + ') ' + ($valid) + ' = prevValid' + ($lvl) + ' = true;'; + out += ' if (' + ($nextValid) + ') { ' + ($valid) + ' = ' + ($prevValid) + ' = true; ' + ($passingSchemas) + ' = ' + ($i) + '; }'; } } it.compositeRule = $it.compositeRule = $wasComposite; out += '' + ($closingBraces) + 'if (!' + ($valid) + ') { var err = '; /* istanbul ignore else */ if (it.createErrors !== false) { - out += ' { keyword: \'' + ('oneOf') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: {} '; + out += ' { keyword: \'' + ('oneOf') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { passingSchemas: ' + ($passingSchemas) + ' } '; if (it.opts.messages !== false) { out += ' , message: \'should match exactly one schema in oneOf\' '; } @@ -3020,7 +3213,8 @@ module.exports = function generate_oneOf(it, $keyword, $ruleType) { out += ' {} '; } out += '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; - if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ if (it.async) { out += ' throw new ValidationError(vErrors); '; } else { @@ -3034,7 +3228,7 @@ module.exports = function generate_oneOf(it, $keyword, $ruleType) { return out; } -},{}],29:[function(require,module,exports){ +},{}],32:[function(require,module,exports){ 'use strict'; module.exports = function generate_pattern(it, $keyword, $ruleType) { var out = ' '; @@ -3094,7 +3288,8 @@ module.exports = function generate_pattern(it, $keyword, $ruleType) { } var __err = out; out = $$outStack.pop(); - if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ if (it.async) { out += ' throw new ValidationError([' + (__err) + ']); '; } else { @@ -3110,7 +3305,7 @@ module.exports = function generate_pattern(it, $keyword, $ruleType) { return out; } -},{}],30:[function(require,module,exports){ +},{}],33:[function(require,module,exports){ 'use strict'; module.exports = function generate_properties(it, $keyword, $ruleType) { var out = ' '; @@ -3121,7 +3316,6 @@ module.exports = function generate_properties(it, $keyword, $ruleType) { var $errSchemaPath = it.errSchemaPath + '/' + $keyword; var $breakOnError = !it.opts.allErrors; var $data = 'data' + ($dataLvl || ''); - var $valid = 'valid' + $lvl; var $errs = 'errs__' + $lvl; var $it = it.util.copy(it); var $closingBraces = ''; @@ -3132,9 +3326,9 @@ module.exports = function generate_properties(it, $keyword, $ruleType) { $dataNxt = $it.dataLevel = it.dataLevel + 1, $nextData = 'data' + $dataNxt, $dataProperties = 'dataProperties' + $lvl; - var $schemaKeys = Object.keys($schema || {}), + var $schemaKeys = Object.keys($schema || {}).filter(notProto), $pProperties = it.schema.patternProperties || {}, - $pPropertyKeys = Object.keys($pProperties), + $pPropertyKeys = Object.keys($pProperties).filter(notProto), $aProperties = it.schema.additionalProperties, $someProperties = $schemaKeys.length || $pPropertyKeys.length, $noAdditional = $aProperties === false, @@ -3144,10 +3338,12 @@ module.exports = function generate_properties(it, $keyword, $ruleType) { $ownProperties = it.opts.ownProperties, $currentBaseId = it.baseId; var $required = it.schema.required; - if ($required && !(it.opts.v5 && $required.$data) && $required.length < it.opts.loopRequired) var $requiredHash = it.util.toHash($required); - if (it.opts.patternGroups) { - var $pgProperties = it.schema.patternGroups || {}, - $pgPropertyKeys = Object.keys($pgProperties); + if ($required && !(it.opts.$data && $required.$data) && $required.length < it.opts.loopRequired) { + var $requiredHash = it.util.toHash($required); + } + + function notProto(p) { + return p !== '__proto__'; } out += 'var ' + ($errs) + ' = errors;var ' + ($nextValid) + ' = true;'; if ($ownProperties) { @@ -3162,8 +3358,8 @@ module.exports = function generate_properties(it, $keyword, $ruleType) { if ($someProperties) { out += ' var isAdditional' + ($lvl) + ' = !(false '; if ($schemaKeys.length) { - if ($schemaKeys.length > 5) { - out += ' || validate.schema' + ($schemaPath) + '[' + ($key) + '] '; + if ($schemaKeys.length > 8) { + out += ' || validate.schema' + ($schemaPath) + '.hasOwnProperty(' + ($key) + ') '; } else { var arr1 = $schemaKeys; if (arr1) { @@ -3187,17 +3383,6 @@ module.exports = function generate_properties(it, $keyword, $ruleType) { } } } - if (it.opts.patternGroups && $pgPropertyKeys.length) { - var arr3 = $pgPropertyKeys; - if (arr3) { - var $pgProperty, $i = -1, - l3 = arr3.length - 1; - while ($i < l3) { - $pgProperty = arr3[$i += 1]; - out += ' || ' + (it.usePattern($pgProperty)) + '.test(' + ($key) + ') '; - } - } - } out += ' ); if (isAdditional' + ($lvl) + ') { '; } if ($removeAdditional == 'all') { @@ -3221,7 +3406,13 @@ module.exports = function generate_properties(it, $keyword, $ruleType) { if (it.createErrors !== false) { out += ' { keyword: \'' + ('additionalProperties') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { additionalProperty: \'' + ($additionalProperty) + '\' } '; if (it.opts.messages !== false) { - out += ' , message: \'should NOT have additional properties\' '; + out += ' , message: \''; + if (it.opts._errorDataPathProperty) { + out += 'is an invalid additional property'; + } else { + out += 'should NOT have additional properties'; + } + out += '\' '; } if (it.opts.verbose) { out += ' , schema: false , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; @@ -3232,7 +3423,8 @@ module.exports = function generate_properties(it, $keyword, $ruleType) { } var __err = out; out = $$outStack.pop(); - if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ if (it.async) { out += ' throw new ValidationError([' + (__err) + ']); '; } else { @@ -3298,14 +3490,14 @@ module.exports = function generate_properties(it, $keyword, $ruleType) { } var $useDefaults = it.opts.useDefaults && !it.compositeRule; if ($schemaKeys.length) { - var arr4 = $schemaKeys; - if (arr4) { - var $propertyKey, i4 = -1, - l4 = arr4.length - 1; - while (i4 < l4) { - $propertyKey = arr4[i4 += 1]; + var arr3 = $schemaKeys; + if (arr3) { + var $propertyKey, i3 = -1, + l3 = arr3.length - 1; + while (i3 < l3) { + $propertyKey = arr3[i3 += 1]; var $sch = $schema[$propertyKey]; - if (it.util.schemaHasRules($sch, it.RULES.all)) { + if ((it.opts.strictKeywords ? (typeof $sch == 'object' && Object.keys($sch).length > 0) || $sch === false : it.util.schemaHasRules($sch, it.RULES.all))) { var $prop = it.util.getProperty($propertyKey), $passData = $data + $prop, $hasDefault = $useDefaults && $sch.default !== undefined; @@ -3362,7 +3554,8 @@ module.exports = function generate_properties(it, $keyword, $ruleType) { } var __err = out; out = $$outStack.pop(); - if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ if (it.async) { out += ' throw new ValidationError([' + (__err) + ']); '; } else { @@ -3400,14 +3593,14 @@ module.exports = function generate_properties(it, $keyword, $ruleType) { } } if ($pPropertyKeys.length) { - var arr5 = $pPropertyKeys; - if (arr5) { - var $pProperty, i5 = -1, - l5 = arr5.length - 1; - while (i5 < l5) { - $pProperty = arr5[i5 += 1]; + var arr4 = $pPropertyKeys; + if (arr4) { + var $pProperty, i4 = -1, + l4 = arr4.length - 1; + while (i4 < l4) { + $pProperty = arr4[i4 += 1]; var $sch = $pProperties[$pProperty]; - if (it.util.schemaHasRules($sch, it.RULES.all)) { + if ((it.opts.strictKeywords ? (typeof $sch == 'object' && Object.keys($sch).length > 0) || $sch === false : it.util.schemaHasRules($sch, it.RULES.all))) { $it.schema = $sch; $it.schemaPath = it.schemaPath + '.patternProperties' + it.util.getProperty($pProperty); $it.errSchemaPath = it.errSchemaPath + '/patternProperties/' + it.util.escapeFragment($pProperty); @@ -3443,144 +3636,13 @@ module.exports = function generate_properties(it, $keyword, $ruleType) { } } } - if (it.opts.patternGroups && $pgPropertyKeys.length) { - var arr6 = $pgPropertyKeys; - if (arr6) { - var $pgProperty, i6 = -1, - l6 = arr6.length - 1; - while (i6 < l6) { - $pgProperty = arr6[i6 += 1]; - var $pgSchema = $pgProperties[$pgProperty], - $sch = $pgSchema.schema; - if (it.util.schemaHasRules($sch, it.RULES.all)) { - $it.schema = $sch; - $it.schemaPath = it.schemaPath + '.patternGroups' + it.util.getProperty($pgProperty) + '.schema'; - $it.errSchemaPath = it.errSchemaPath + '/patternGroups/' + it.util.escapeFragment($pgProperty) + '/schema'; - out += ' var pgPropCount' + ($lvl) + ' = 0; '; - if ($ownProperties) { - out += ' ' + ($dataProperties) + ' = ' + ($dataProperties) + ' || Object.keys(' + ($data) + '); for (var ' + ($idx) + '=0; ' + ($idx) + '<' + ($dataProperties) + '.length; ' + ($idx) + '++) { var ' + ($key) + ' = ' + ($dataProperties) + '[' + ($idx) + ']; '; - } else { - out += ' for (var ' + ($key) + ' in ' + ($data) + ') { '; - } - out += ' if (' + (it.usePattern($pgProperty)) + '.test(' + ($key) + ')) { pgPropCount' + ($lvl) + '++; '; - $it.errorPath = it.util.getPathExpr(it.errorPath, $key, it.opts.jsonPointers); - var $passData = $data + '[' + $key + ']'; - $it.dataPathArr[$dataNxt] = $key; - var $code = it.validate($it); - $it.baseId = $currentBaseId; - if (it.util.varOccurences($code, $nextData) < 2) { - out += ' ' + (it.util.varReplace($code, $nextData, $passData)) + ' '; - } else { - out += ' var ' + ($nextData) + ' = ' + ($passData) + '; ' + ($code) + ' '; - } - if ($breakOnError) { - out += ' if (!' + ($nextValid) + ') break; '; - } - out += ' } '; - if ($breakOnError) { - out += ' else ' + ($nextValid) + ' = true; '; - } - out += ' } '; - if ($breakOnError) { - out += ' if (' + ($nextValid) + ') { '; - $closingBraces += '}'; - } - var $pgMin = $pgSchema.minimum, - $pgMax = $pgSchema.maximum; - if ($pgMin !== undefined || $pgMax !== undefined) { - out += ' var ' + ($valid) + ' = true; '; - var $currErrSchemaPath = $errSchemaPath; - if ($pgMin !== undefined) { - var $limit = $pgMin, - $reason = 'minimum', - $moreOrLess = 'less'; - out += ' ' + ($valid) + ' = pgPropCount' + ($lvl) + ' >= ' + ($pgMin) + '; '; - $errSchemaPath = it.errSchemaPath + '/patternGroups/minimum'; - out += ' if (!' + ($valid) + ') { '; - var $$outStack = $$outStack || []; - $$outStack.push(out); - out = ''; /* istanbul ignore else */ - if (it.createErrors !== false) { - out += ' { keyword: \'' + ('patternGroups') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { reason: \'' + ($reason) + '\', limit: ' + ($limit) + ', pattern: \'' + (it.util.escapeQuotes($pgProperty)) + '\' } '; - if (it.opts.messages !== false) { - out += ' , message: \'should NOT have ' + ($moreOrLess) + ' than ' + ($limit) + ' properties matching pattern "' + (it.util.escapeQuotes($pgProperty)) + '"\' '; - } - if (it.opts.verbose) { - out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; - } - out += ' } '; - } else { - out += ' {} '; - } - var __err = out; - out = $$outStack.pop(); - if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ - if (it.async) { - out += ' throw new ValidationError([' + (__err) + ']); '; - } else { - out += ' validate.errors = [' + (__err) + ']; return false; '; - } - } else { - out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; - } - out += ' } '; - if ($pgMax !== undefined) { - out += ' else '; - } - } - if ($pgMax !== undefined) { - var $limit = $pgMax, - $reason = 'maximum', - $moreOrLess = 'more'; - out += ' ' + ($valid) + ' = pgPropCount' + ($lvl) + ' <= ' + ($pgMax) + '; '; - $errSchemaPath = it.errSchemaPath + '/patternGroups/maximum'; - out += ' if (!' + ($valid) + ') { '; - var $$outStack = $$outStack || []; - $$outStack.push(out); - out = ''; /* istanbul ignore else */ - if (it.createErrors !== false) { - out += ' { keyword: \'' + ('patternGroups') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { reason: \'' + ($reason) + '\', limit: ' + ($limit) + ', pattern: \'' + (it.util.escapeQuotes($pgProperty)) + '\' } '; - if (it.opts.messages !== false) { - out += ' , message: \'should NOT have ' + ($moreOrLess) + ' than ' + ($limit) + ' properties matching pattern "' + (it.util.escapeQuotes($pgProperty)) + '"\' '; - } - if (it.opts.verbose) { - out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; - } - out += ' } '; - } else { - out += ' {} '; - } - var __err = out; - out = $$outStack.pop(); - if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ - if (it.async) { - out += ' throw new ValidationError([' + (__err) + ']); '; - } else { - out += ' validate.errors = [' + (__err) + ']; return false; '; - } - } else { - out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; - } - out += ' } '; - } - $errSchemaPath = $currErrSchemaPath; - if ($breakOnError) { - out += ' if (' + ($valid) + ') { '; - $closingBraces += '}'; - } - } - } - } - } - } if ($breakOnError) { out += ' ' + ($closingBraces) + ' if (' + ($errs) + ' == errors) {'; } - out = it.util.cleanUpCode(out); return out; } -},{}],31:[function(require,module,exports){ +},{}],34:[function(require,module,exports){ 'use strict'; module.exports = function generate_propertyNames(it, $keyword, $ruleType) { var out = ' '; @@ -3596,7 +3658,8 @@ module.exports = function generate_propertyNames(it, $keyword, $ruleType) { var $closingBraces = ''; $it.level++; var $nextValid = 'valid' + $it.level; - if (it.util.schemaHasRules($schema, it.RULES.all)) { + out += 'var ' + ($errs) + ' = errors;'; + if ((it.opts.strictKeywords ? (typeof $schema == 'object' && Object.keys($schema).length > 0) || $schema === false : it.util.schemaHasRules($schema, it.RULES.all))) { $it.schema = $schema; $it.schemaPath = $schemaPath; $it.errSchemaPath = $errSchemaPath; @@ -3609,7 +3672,6 @@ module.exports = function generate_propertyNames(it, $keyword, $ruleType) { $dataProperties = 'dataProperties' + $lvl, $ownProperties = it.opts.ownProperties, $currentBaseId = it.baseId; - out += ' var ' + ($errs) + ' = errors; '; if ($ownProperties) { out += ' var ' + ($dataProperties) + ' = undefined; '; } @@ -3644,7 +3706,8 @@ module.exports = function generate_propertyNames(it, $keyword, $ruleType) { out += ' {} '; } out += '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; - if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ if (it.async) { out += ' throw new ValidationError(vErrors); '; } else { @@ -3659,11 +3722,10 @@ module.exports = function generate_propertyNames(it, $keyword, $ruleType) { if ($breakOnError) { out += ' ' + ($closingBraces) + ' if (' + ($errs) + ' == errors) {'; } - out = it.util.cleanUpCode(out); return out; } -},{}],32:[function(require,module,exports){ +},{}],35:[function(require,module,exports){ 'use strict'; module.exports = function generate_ref(it, $keyword, $ruleType) { var out = ' '; @@ -3706,7 +3768,8 @@ module.exports = function generate_ref(it, $keyword, $ruleType) { } var __err = out; out = $$outStack.pop(); - if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ if (it.async) { out += ' throw new ValidationError([' + (__err) + ']); '; } else { @@ -3739,7 +3802,7 @@ module.exports = function generate_ref(it, $keyword, $ruleType) { out += ' if (' + ($nextValid) + ') { '; } } else { - $async = $refVal.$async === true; + $async = $refVal.$async === true || (it.async && $refVal.$async !== false); $refCode = $refVal.code; } } @@ -3766,7 +3829,7 @@ module.exports = function generate_ref(it, $keyword, $ruleType) { if ($breakOnError) { out += ' var ' + ($valid) + '; '; } - out += ' try { ' + (it.yieldAwait) + ' ' + (__callValidate) + '; '; + out += ' try { await ' + (__callValidate) + '; '; if ($breakOnError) { out += ' ' + ($valid) + ' = true; '; } @@ -3788,7 +3851,7 @@ module.exports = function generate_ref(it, $keyword, $ruleType) { return out; } -},{}],33:[function(require,module,exports){ +},{}],36:[function(require,module,exports){ 'use strict'; module.exports = function generate_required(it, $keyword, $ruleType) { var out = ' '; @@ -3819,7 +3882,7 @@ module.exports = function generate_required(it, $keyword, $ruleType) { while (i1 < l1) { $property = arr1[i1 += 1]; var $propertySch = it.schema.properties[$property]; - if (!($propertySch && it.util.schemaHasRules($propertySch, it.RULES.all))) { + if (!($propertySch && (it.opts.strictKeywords ? (typeof $propertySch == 'object' && Object.keys($propertySch).length > 0) || $propertySch === false : it.util.schemaHasRules($propertySch, it.RULES.all)))) { $required[$required.length] = $property; } } @@ -3880,7 +3943,8 @@ module.exports = function generate_required(it, $keyword, $ruleType) { } var __err = out; out = $$outStack.pop(); - if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ if (it.async) { out += ' throw new ValidationError([' + (__err) + ']); '; } else { @@ -3939,7 +4003,8 @@ module.exports = function generate_required(it, $keyword, $ruleType) { } var __err = out; out = $$outStack.pop(); - if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ if (it.async) { out += ' throw new ValidationError([' + (__err) + ']); '; } else { @@ -4058,7 +4123,7 @@ module.exports = function generate_required(it, $keyword, $ruleType) { return out; } -},{}],34:[function(require,module,exports){ +},{}],37:[function(require,module,exports){ 'use strict'; module.exports = function generate_uniqueItems(it, $keyword, $ruleType) { var out = ' '; @@ -4082,7 +4147,21 @@ module.exports = function generate_uniqueItems(it, $keyword, $ruleType) { if ($isData) { out += ' var ' + ($valid) + '; if (' + ($schemaValue) + ' === false || ' + ($schemaValue) + ' === undefined) ' + ($valid) + ' = true; else if (typeof ' + ($schemaValue) + ' != \'boolean\') ' + ($valid) + ' = false; else { '; } - out += ' var ' + ($valid) + ' = true; if (' + ($data) + '.length > 1) { var i = ' + ($data) + '.length, j; outer: for (;i--;) { for (j = i; j--;) { if (equal(' + ($data) + '[i], ' + ($data) + '[j])) { ' + ($valid) + ' = false; break outer; } } } } '; + out += ' var i = ' + ($data) + '.length , ' + ($valid) + ' = true , j; if (i > 1) { '; + var $itemType = it.schema.items && it.schema.items.type, + $typeIsArray = Array.isArray($itemType); + if (!$itemType || $itemType == 'object' || $itemType == 'array' || ($typeIsArray && ($itemType.indexOf('object') >= 0 || $itemType.indexOf('array') >= 0))) { + out += ' outer: for (;i--;) { for (j = i; j--;) { if (equal(' + ($data) + '[i], ' + ($data) + '[j])) { ' + ($valid) + ' = false; break outer; } } } '; + } else { + out += ' var itemIndices = {}, item; for (;i--;) { var item = ' + ($data) + '[i]; '; + var $method = 'checkDataType' + ($typeIsArray ? 's' : ''); + out += ' if (' + (it.util[$method]($itemType, 'item', it.opts.strictNumbers, true)) + ') continue; '; + if ($typeIsArray) { + out += ' if (typeof item == \'string\') item = \'"\' + item; '; + } + out += ' if (typeof itemIndices[item] == \'number\') { ' + ($valid) + ' = false; j = itemIndices[item]; break; } itemIndices[item] = i; } '; + } + out += ' } '; if ($isData) { out += ' } '; } @@ -4110,7 +4189,8 @@ module.exports = function generate_uniqueItems(it, $keyword, $ruleType) { } var __err = out; out = $$outStack.pop(); - if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ if (it.async) { out += ' throw new ValidationError([' + (__err) + ']); '; } else { @@ -4131,33 +4211,28 @@ module.exports = function generate_uniqueItems(it, $keyword, $ruleType) { return out; } -},{}],35:[function(require,module,exports){ +},{}],38:[function(require,module,exports){ 'use strict'; module.exports = function generate_validate(it, $keyword, $ruleType) { var out = ''; var $async = it.schema.$async === true, $refKeywords = it.util.schemaHasRulesExcept(it.schema, it.RULES.all, '$ref'), $id = it.self._getId(it.schema); - if (it.isTop) { - if ($async) { - it.async = true; - var $es7 = it.opts.async == 'es7'; - it.yieldAwait = $es7 ? 'await' : 'yield'; + if (it.opts.strictKeywords) { + var $unknownKwd = it.util.schemaUnknownRules(it.schema, it.RULES.keywords); + if ($unknownKwd) { + var $keywordsMsg = 'unknown keyword: ' + $unknownKwd; + if (it.opts.strictKeywords === 'log') it.logger.warn($keywordsMsg); + else throw new Error($keywordsMsg); } + } + if (it.isTop) { out += ' var validate = '; if ($async) { - if ($es7) { - out += ' (async function '; - } else { - if (it.opts.async != '*') { - out += 'co.wrap'; - } - out += '(function* '; - } - } else { - out += ' (function '; + it.async = true; + out += 'async '; } - out += ' (data, dataPath, parentData, parentDataProperty, rootData) { \'use strict\'; '; + out += 'function(data, dataPath, parentData, parentDataProperty, rootData) { \'use strict\'; '; if ($id && (it.opts.sourceCode || it.opts.processCode)) { out += ' ' + ('/\*# sourceURL=' + $id + ' */') + ' '; } @@ -4196,7 +4271,8 @@ module.exports = function generate_validate(it, $keyword, $ruleType) { } var __err = out; out = $$outStack.pop(); - if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ if (it.async) { out += ' throw new ValidationError([' + (__err) + ']); '; } else { @@ -4217,7 +4293,7 @@ module.exports = function generate_validate(it, $keyword, $ruleType) { } } if (it.isTop) { - out += ' }); return validate; '; + out += ' }; return validate; '; } return out; } @@ -4229,7 +4305,12 @@ module.exports = function generate_validate(it, $keyword, $ruleType) { it.rootId = it.resolve.fullPath(it.self._getId(it.root.schema)); it.baseId = it.baseId || it.rootId; delete it.isTop; - it.dataPathArr = [undefined]; + it.dataPathArr = [""]; + if (it.schema.default !== undefined && it.opts.useDefaults && it.opts.strictDefaults) { + var $defaultMsg = 'default is ignored in the schema root'; + if (it.opts.strictDefaults === 'log') it.logger.warn($defaultMsg); + else throw new Error($defaultMsg); + } out += ' var vErrors = null; '; out += ' var errors = 0; '; out += ' if (rootData === undefined) rootData = data; '; @@ -4248,6 +4329,14 @@ module.exports = function generate_validate(it, $keyword, $ruleType) { var $errorKeyword; var $typeSchema = it.schema.type, $typeIsArray = Array.isArray($typeSchema); + if ($typeSchema && it.opts.nullable && it.schema.nullable === true) { + if ($typeIsArray) { + if ($typeSchema.indexOf('null') == -1) $typeSchema = $typeSchema.concat('null'); + } else if ($typeSchema != 'null') { + $typeSchema = [$typeSchema, 'null']; + $typeIsArray = true; + } + } if ($typeIsArray && $typeSchema.length == 1) { $typeSchema = $typeSchema[0]; $typeIsArray = false; @@ -4260,6 +4349,9 @@ module.exports = function generate_validate(it, $keyword, $ruleType) { it.logger.warn('$ref: keywords ignored in schema at path "' + it.errSchemaPath + '"'); } } + if (it.schema.$comment && it.opts.$comment) { + out += ' ' + (it.RULES.all.$comment.code(it, '$comment')); + } if ($typeSchema) { if (it.opts.coerceTypes) { var $coerceToTypes = it.util.coerceToTypes(it.opts.coerceTypes, $typeSchema); @@ -4271,47 +4363,39 @@ module.exports = function generate_validate(it, $keyword, $ruleType) { var $schemaPath = it.schemaPath + '.type', $errSchemaPath = it.errSchemaPath + '/type', $method = $typeIsArray ? 'checkDataTypes' : 'checkDataType'; - out += ' if (' + (it.util[$method]($typeSchema, $data, true)) + ') { '; + out += ' if (' + (it.util[$method]($typeSchema, $data, it.opts.strictNumbers, true)) + ') { '; if ($coerceToTypes) { var $dataType = 'dataType' + $lvl, $coerced = 'coerced' + $lvl; - out += ' var ' + ($dataType) + ' = typeof ' + ($data) + '; '; + out += ' var ' + ($dataType) + ' = typeof ' + ($data) + '; var ' + ($coerced) + ' = undefined; '; if (it.opts.coerceTypes == 'array') { - out += ' if (' + ($dataType) + ' == \'object\' && Array.isArray(' + ($data) + ')) ' + ($dataType) + ' = \'array\'; '; + out += ' if (' + ($dataType) + ' == \'object\' && Array.isArray(' + ($data) + ') && ' + ($data) + '.length == 1) { ' + ($data) + ' = ' + ($data) + '[0]; ' + ($dataType) + ' = typeof ' + ($data) + '; if (' + (it.util.checkDataType(it.schema.type, $data, it.opts.strictNumbers)) + ') ' + ($coerced) + ' = ' + ($data) + '; } '; } - out += ' var ' + ($coerced) + ' = undefined; '; - var $bracesCoercion = ''; + out += ' if (' + ($coerced) + ' !== undefined) ; '; var arr1 = $coerceToTypes; if (arr1) { var $type, $i = -1, l1 = arr1.length - 1; while ($i < l1) { $type = arr1[$i += 1]; - if ($i) { - out += ' if (' + ($coerced) + ' === undefined) { '; - $bracesCoercion += '}'; - } - if (it.opts.coerceTypes == 'array' && $type != 'array') { - out += ' if (' + ($dataType) + ' == \'array\' && ' + ($data) + '.length == 1) { ' + ($coerced) + ' = ' + ($data) + ' = ' + ($data) + '[0]; ' + ($dataType) + ' = typeof ' + ($data) + '; } '; - } if ($type == 'string') { - out += ' if (' + ($dataType) + ' == \'number\' || ' + ($dataType) + ' == \'boolean\') ' + ($coerced) + ' = \'\' + ' + ($data) + '; else if (' + ($data) + ' === null) ' + ($coerced) + ' = \'\'; '; + out += ' else if (' + ($dataType) + ' == \'number\' || ' + ($dataType) + ' == \'boolean\') ' + ($coerced) + ' = \'\' + ' + ($data) + '; else if (' + ($data) + ' === null) ' + ($coerced) + ' = \'\'; '; } else if ($type == 'number' || $type == 'integer') { - out += ' if (' + ($dataType) + ' == \'boolean\' || ' + ($data) + ' === null || (' + ($dataType) + ' == \'string\' && ' + ($data) + ' && ' + ($data) + ' == +' + ($data) + ' '; + out += ' else if (' + ($dataType) + ' == \'boolean\' || ' + ($data) + ' === null || (' + ($dataType) + ' == \'string\' && ' + ($data) + ' && ' + ($data) + ' == +' + ($data) + ' '; if ($type == 'integer') { out += ' && !(' + ($data) + ' % 1)'; } out += ')) ' + ($coerced) + ' = +' + ($data) + '; '; } else if ($type == 'boolean') { - out += ' if (' + ($data) + ' === \'false\' || ' + ($data) + ' === 0 || ' + ($data) + ' === null) ' + ($coerced) + ' = false; else if (' + ($data) + ' === \'true\' || ' + ($data) + ' === 1) ' + ($coerced) + ' = true; '; + out += ' else if (' + ($data) + ' === \'false\' || ' + ($data) + ' === 0 || ' + ($data) + ' === null) ' + ($coerced) + ' = false; else if (' + ($data) + ' === \'true\' || ' + ($data) + ' === 1) ' + ($coerced) + ' = true; '; } else if ($type == 'null') { - out += ' if (' + ($data) + ' === \'\' || ' + ($data) + ' === 0 || ' + ($data) + ' === false) ' + ($coerced) + ' = null; '; + out += ' else if (' + ($data) + ' === \'\' || ' + ($data) + ' === 0 || ' + ($data) + ' === false) ' + ($coerced) + ' = null; '; } else if (it.opts.coerceTypes == 'array' && $type == 'array') { - out += ' if (' + ($dataType) + ' == \'string\' || ' + ($dataType) + ' == \'number\' || ' + ($dataType) + ' == \'boolean\' || ' + ($data) + ' == null) ' + ($coerced) + ' = [' + ($data) + ']; '; + out += ' else if (' + ($dataType) + ' == \'string\' || ' + ($dataType) + ' == \'number\' || ' + ($dataType) + ' == \'boolean\' || ' + ($data) + ' == null) ' + ($coerced) + ' = [' + ($data) + ']; '; } } } - out += ' ' + ($bracesCoercion) + ' if (' + ($coerced) + ' === undefined) { '; + out += ' else { '; var $$outStack = $$outStack || []; $$outStack.push(out); out = ''; /* istanbul ignore else */ @@ -4341,7 +4425,8 @@ module.exports = function generate_validate(it, $keyword, $ruleType) { } var __err = out; out = $$outStack.pop(); - if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ if (it.async) { out += ' throw new ValidationError([' + (__err) + ']); '; } else { @@ -4350,7 +4435,7 @@ module.exports = function generate_validate(it, $keyword, $ruleType) { } else { out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; } - out += ' } else { '; + out += ' } if (' + ($coerced) + ' !== undefined) { '; var $parentData = $dataLvl ? 'data' + (($dataLvl - 1) || '') : 'parentData', $parentDataProperty = $dataLvl ? it.dataPathArr[$dataLvl] : 'parentDataProperty'; out += ' ' + ($data) + ' = ' + ($coerced) + '; '; @@ -4388,7 +4473,8 @@ module.exports = function generate_validate(it, $keyword, $ruleType) { } var __err = out; out = $$outStack.pop(); - if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ if (it.async) { out += ' throw new ValidationError([' + (__err) + ']); '; } else { @@ -4414,9 +4500,6 @@ module.exports = function generate_validate(it, $keyword, $ruleType) { $closingBraces2 += '}'; } } else { - if (it.opts.v5 && it.schema.patternGroups) { - it.logger.warn('keyword "patternGroups" is deprecated and disabled. Use option patternGroups: true to enable.'); - } var arr2 = it.RULES; if (arr2) { var $rulesGroup, i2 = -1, @@ -4425,9 +4508,9 @@ module.exports = function generate_validate(it, $keyword, $ruleType) { $rulesGroup = arr2[i2 += 1]; if ($shouldUseGroup($rulesGroup)) { if ($rulesGroup.type) { - out += ' if (' + (it.util.checkDataType($rulesGroup.type, $data)) + ') { '; + out += ' if (' + (it.util.checkDataType($rulesGroup.type, $data, it.opts.strictNumbers)) + ') { '; } - if (it.opts.useDefaults && !it.compositeRule) { + if (it.opts.useDefaults) { if ($rulesGroup.type == 'object' && it.schema.properties) { var $schema = it.schema.properties, $schemaKeys = Object.keys($schema); @@ -4440,13 +4523,25 @@ module.exports = function generate_validate(it, $keyword, $ruleType) { var $sch = $schema[$propertyKey]; if ($sch.default !== undefined) { var $passData = $data + it.util.getProperty($propertyKey); - out += ' if (' + ($passData) + ' === undefined) ' + ($passData) + ' = '; - if (it.opts.useDefaults == 'shared') { - out += ' ' + (it.useDefault($sch.default)) + ' '; + if (it.compositeRule) { + if (it.opts.strictDefaults) { + var $defaultMsg = 'default is ignored for: ' + $passData; + if (it.opts.strictDefaults === 'log') it.logger.warn($defaultMsg); + else throw new Error($defaultMsg); + } } else { - out += ' ' + (JSON.stringify($sch.default)) + ' '; + out += ' if (' + ($passData) + ' === undefined '; + if (it.opts.useDefaults == 'empty') { + out += ' || ' + ($passData) + ' === null || ' + ($passData) + ' === \'\' '; + } + out += ' ) ' + ($passData) + ' = '; + if (it.opts.useDefaults == 'shared') { + out += ' ' + (it.useDefault($sch.default)) + ' '; + } else { + out += ' ' + (JSON.stringify($sch.default)) + ' '; + } + out += '; '; } - out += '; '; } } } @@ -4459,13 +4554,25 @@ module.exports = function generate_validate(it, $keyword, $ruleType) { $sch = arr4[$i += 1]; if ($sch.default !== undefined) { var $passData = $data + '[' + $i + ']'; - out += ' if (' + ($passData) + ' === undefined) ' + ($passData) + ' = '; - if (it.opts.useDefaults == 'shared') { - out += ' ' + (it.useDefault($sch.default)) + ' '; + if (it.compositeRule) { + if (it.opts.strictDefaults) { + var $defaultMsg = 'default is ignored for: ' + $passData; + if (it.opts.strictDefaults === 'log') it.logger.warn($defaultMsg); + else throw new Error($defaultMsg); + } } else { - out += ' ' + (JSON.stringify($sch.default)) + ' '; + out += ' if (' + ($passData) + ' === undefined '; + if (it.opts.useDefaults == 'empty') { + out += ' || ' + ($passData) + ' === null || ' + ($passData) + ' === \'\' '; + } + out += ' ) ' + ($passData) + ' = '; + if (it.opts.useDefaults == 'shared') { + out += ' ' + (it.useDefault($sch.default)) + ' '; + } else { + out += ' ' + (JSON.stringify($sch.default)) + ' '; + } + out += '; '; } - out += '; '; } } } @@ -4527,7 +4634,8 @@ module.exports = function generate_validate(it, $keyword, $ruleType) { } var __err = out; out = $$outStack.pop(); - if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ if (it.async) { out += ' throw new ValidationError([' + (__err) + ']); '; } else { @@ -4564,14 +4672,10 @@ module.exports = function generate_validate(it, $keyword, $ruleType) { out += ' validate.errors = vErrors; '; out += ' return errors === 0; '; } - out += ' }); return validate;'; + out += ' }; return validate;'; } else { out += ' var ' + ($valid) + ' = errors === errs_' + ($lvl) + ';'; } - out = it.util.cleanUpCode(out); - if ($top) { - out = it.util.finalCleanUpCode(out, $async); - } function $shouldUseGroup($rulesGroup) { var rules = $rulesGroup.rules; @@ -4591,18 +4695,21 @@ module.exports = function generate_validate(it, $keyword, $ruleType) { return out; } -},{}],36:[function(require,module,exports){ +},{}],39:[function(require,module,exports){ 'use strict'; var IDENTIFIER = /^[a-z_$][a-z0-9_$-]*$/i; var customRuleCode = require('./dotjs/custom'); +var definitionSchema = require('./definition_schema'); module.exports = { add: addKeyword, get: getKeyword, - remove: removeKeyword + remove: removeKeyword, + validate: validateKeyword }; + /** * Define custom keyword * @this Ajv @@ -4614,7 +4721,6 @@ function addKeyword(keyword, definition) { /* jshint validthis: true */ /* eslint no-shadow: 0 */ var RULES = this.RULES; - if (RULES.keywords[keyword]) throw new Error('Keyword ' + keyword + ' is already defined'); @@ -4622,30 +4728,23 @@ function addKeyword(keyword, definition) { throw new Error('Keyword ' + keyword + ' is not a valid identifier'); if (definition) { - if (definition.macro && definition.valid !== undefined) - throw new Error('"valid" option cannot be used with macro keywords'); + this.validateKeyword(definition, true); var dataType = definition.type; if (Array.isArray(dataType)) { - var i, len = dataType.length; - for (i=0; i 2) res = slice.call(arguments, 1); - resolve(res); - }); - }); -} + var cmp = opts.cmp && (function (f) { + return function (node) { + return function (a, b) { + var aobj = { key: a, value: node[a] }; + var bobj = { key: b, value: node[b] }; + return f(aobj, bobj); + }; + }; + })(opts.cmp); -/** - * Convert an array of "yieldables" to a promise. - * Uses `Promise.all()` internally. - * - * @param {Array} obj - * @return {Promise} - * @api private - */ + var seen = []; + return (function stringify (node) { + if (node && node.toJSON && typeof node.toJSON === 'function') { + node = node.toJSON(); + } -function arrayToPromise(obj) { - return Promise.all(obj.map(toPromise, this)); -} + if (node === undefined) return; + if (typeof node == 'number') return isFinite(node) ? '' + node : 'null'; + if (typeof node !== 'object') return JSON.stringify(node); -/** - * Convert an object of "yieldables" to a promise. - * Uses `Promise.all()` internally. - * - * @param {Object} obj - * @return {Promise} - * @api private - */ + var i, out; + if (Array.isArray(node)) { + out = '['; + for (i = 0; i < node.length; i++) { + if (i) out += ','; + out += stringify(node[i]) || 'null'; + } + return out + ']'; + } -function objectToPromise(obj){ - var results = new obj.constructor(); - var keys = Object.keys(obj); - var promises = []; - for (var i = 0; i < keys.length; i++) { - var key = keys[i]; - var promise = toPromise.call(this, obj[key]); - if (promise && isPromise(promise)) defer(promise, key); - else results[key] = obj[key]; - } - return Promise.all(promises).then(function () { - return results; - }); + if (node === null) return 'null'; - function defer(promise, key) { - // predefine the key in the result - results[key] = undefined; - promises.push(promise.then(function (res) { - results[key] = res; - })); - } -} - -/** - * Check if `obj` is a promise. - * - * @param {Object} obj - * @return {Boolean} - * @api private - */ - -function isPromise(obj) { - return 'function' == typeof obj.then; -} - -/** - * Check if `obj` is a generator. - * - * @param {Mixed} obj - * @return {Boolean} - * @api private - */ - -function isGenerator(obj) { - return 'function' == typeof obj.next && 'function' == typeof obj.throw; -} - -/** - * Check if `obj` is a generator function. - * - * @param {Mixed} obj - * @return {Boolean} - * @api private - */ -function isGeneratorFunction(obj) { - var constructor = obj.constructor; - if (!constructor) return false; - if ('GeneratorFunction' === constructor.name || 'GeneratorFunction' === constructor.displayName) return true; - return isGenerator(constructor.prototype); -} - -/** - * Check for plain object. - * - * @param {Mixed} val - * @return {Boolean} - * @api private - */ - -function isObject(val) { - return Object == val.constructor; -} - -},{}],41:[function(require,module,exports){ -'use strict'; - -module.exports = function equal(a, b) { - if (a === b) return true; - - var arrA = Array.isArray(a) - , arrB = Array.isArray(b) - , i; - - if (arrA && arrB) { - if (a.length != b.length) return false; - for (i = 0; i < a.length; i++) - if (!equal(a[i], b[i])) return false; - return true; - } - - if (arrA != arrB) return false; - - if (a && b && typeof a === 'object' && typeof b === 'object') { - var keys = Object.keys(a); - if (keys.length !== Object.keys(b).length) return false; - - var dateA = a instanceof Date - , dateB = b instanceof Date; - if (dateA && dateB) return a.getTime() == b.getTime(); - if (dateA != dateB) return false; - - var regexpA = a instanceof RegExp - , regexpB = b instanceof RegExp; - if (regexpA && regexpB) return a.toString() == b.toString(); - if (regexpA != regexpB) return false; - - for (i = 0; i < keys.length; i++) - if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false; - - for (i = 0; i < keys.length; i++) - if(!equal(a[keys[i]], b[keys[i]])) return false; - - return true; - } - - return false; -}; - -},{}],42:[function(require,module,exports){ -'use strict'; - -module.exports = function (data, opts) { - if (!opts) opts = {}; - if (typeof opts === 'function') opts = { cmp: opts }; - var cycles = (typeof opts.cycles === 'boolean') ? opts.cycles : false; - - var cmp = opts.cmp && (function (f) { - return function (node) { - return function (a, b) { - var aobj = { key: a, value: node[a] }; - var bobj = { key: b, value: node[b] }; - return f(aobj, bobj); - }; - }; - })(opts.cmp); - - var seen = []; - return (function stringify (node) { - if (node && node.toJSON && typeof node.toJSON === 'function') { - node = node.toJSON(); - } - - if (node === undefined) return; - if (typeof node == 'number') return isFinite(node) ? '' + node : 'null'; - if (typeof node !== 'object') return JSON.stringify(node); - - var i, out; - if (Array.isArray(node)) { - out = '['; - for (i = 0; i < node.length; i++) { - if (i) out += ','; - out += stringify(node[i]) || 'null'; - } - return out + ']'; - } - - if (node === null) return 'null'; - - if (seen.indexOf(node) !== -1) { - if (cycles) return JSON.stringify('__cycle__'); - throw new TypeError('Converting circular structure to JSON'); - } + if (seen.indexOf(node) !== -1) { + if (cycles) return JSON.stringify('__cycle__'); + throw new TypeError('Converting circular structure to JSON'); + } var seenIndex = seen.push(node) - 1; var keys = Object.keys(node).sort(cmp && cmp(node)); @@ -5286,15 +5141,21 @@ module.exports = function (data, opts) { })(data); }; -},{}],43:[function(require,module,exports){ +},{}],44:[function(require,module,exports){ 'use strict'; var traverse = module.exports = function (schema, opts, cb) { + // Legacy support for v0.3.1 and earlier. if (typeof opts == 'function') { cb = opts; opts = {}; } - _traverse(opts, cb, schema, '', schema); + + cb = opts.cb || cb; + var pre = (typeof cb == 'function') ? cb : cb.pre || function() {}; + var post = cb.post || function() {}; + + _traverse(opts, pre, post, schema, '', schema); }; @@ -5322,6 +5183,7 @@ traverse.propsKeywords = { }; traverse.skipKeywords = { + default: true, enum: true, const: true, required: true, @@ -5342,25 +5204,26 @@ traverse.skipKeywords = { }; -function _traverse(opts, cb, schema, jsonPtr, rootSchema, parentJsonPtr, parentKeyword, parentSchema, keyIndex) { +function _traverse(opts, pre, post, schema, jsonPtr, rootSchema, parentJsonPtr, parentKeyword, parentSchema, keyIndex) { if (schema && typeof schema == 'object' && !Array.isArray(schema)) { - cb(schema, jsonPtr, rootSchema, parentJsonPtr, parentKeyword, parentSchema, keyIndex); + pre(schema, jsonPtr, rootSchema, parentJsonPtr, parentKeyword, parentSchema, keyIndex); for (var key in schema) { var sch = schema[key]; if (Array.isArray(sch)) { if (key in traverse.arrayKeywords) { for (var i=0; i= 0x80 (not a basic code point)', - 'invalid-input': 'Invalid input' - }, - - /** Convenience shortcuts */ - baseMinusTMin = base - tMin, - floor = Math.floor, - stringFromCharCode = String.fromCharCode, - - /** Temporary variable */ - key; - - /*--------------------------------------------------------------------------*/ - - /** - * A generic error utility function. - * @private - * @param {String} type The error type. - * @returns {Error} Throws a `RangeError` with the applicable error message. - */ - function error(type) { - throw new RangeError(errors[type]); - } - - /** - * A generic `Array#map` utility function. - * @private - * @param {Array} array The array to iterate over. - * @param {Function} callback The function that gets called for every array - * item. - * @returns {Array} A new array of values returned by the callback function. - */ - function map(array, fn) { - var length = array.length; - var result = []; - while (length--) { - result[length] = fn(array[length]); - } - return result; - } - - /** - * A simple `Array#map`-like wrapper to work with domain name strings or email - * addresses. - * @private - * @param {String} domain The domain name or email address. - * @param {Function} callback The function that gets called for every - * character. - * @returns {Array} A new string of characters returned by the callback - * function. - */ - function mapDomain(string, fn) { - var parts = string.split('@'); - var result = ''; - if (parts.length > 1) { - // In email addresses, only the domain name should be punycoded. Leave - // the local part (i.e. everything up to `@`) intact. - result = parts[0] + '@'; - string = parts[1]; - } - // Avoid `split(regex)` for IE8 compatibility. See #17. - string = string.replace(regexSeparators, '\x2E'); - var labels = string.split('.'); - var encoded = map(labels, fn).join('.'); - return result + encoded; - } - - /** - * Creates an array containing the numeric code points of each Unicode - * character in the string. While JavaScript uses UCS-2 internally, - * this function will convert a pair of surrogate halves (each of which - * UCS-2 exposes as separate characters) into a single code point, - * matching UTF-16. - * @see `punycode.ucs2.encode` - * @see - * @memberOf punycode.ucs2 - * @name decode - * @param {String} string The Unicode input string (UCS-2). - * @returns {Array} The new array of code points. - */ - function ucs2decode(string) { - var output = [], - counter = 0, - length = string.length, - value, - extra; - while (counter < length) { - value = string.charCodeAt(counter++); - if (value >= 0xD800 && value <= 0xDBFF && counter < length) { - // high surrogate, and there is a next character - extra = string.charCodeAt(counter++); - if ((extra & 0xFC00) == 0xDC00) { // low surrogate - output.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000); - } else { - // unmatched surrogate; only append this code unit, in case the next - // code unit is the high surrogate of a surrogate pair - output.push(value); - counter--; - } - } else { - output.push(value); - } - } - return output; - } - - /** - * Creates a string based on an array of numeric code points. - * @see `punycode.ucs2.decode` - * @memberOf punycode.ucs2 - * @name encode - * @param {Array} codePoints The array of numeric code points. - * @returns {String} The new Unicode string (UCS-2). - */ - function ucs2encode(array) { - return map(array, function(value) { - var output = ''; - if (value > 0xFFFF) { - value -= 0x10000; - output += stringFromCharCode(value >>> 10 & 0x3FF | 0xD800); - value = 0xDC00 | value & 0x3FF; - } - output += stringFromCharCode(value); - return output; - }).join(''); - } - - /** - * Converts a basic code point into a digit/integer. - * @see `digitToBasic()` - * @private - * @param {Number} codePoint The basic numeric code point value. - * @returns {Number} The numeric value of a basic code point (for use in - * representing integers) in the range `0` to `base - 1`, or `base` if - * the code point does not represent a value. - */ - function basicToDigit(codePoint) { - if (codePoint - 48 < 10) { - return codePoint - 22; - } - if (codePoint - 65 < 26) { - return codePoint - 65; - } - if (codePoint - 97 < 26) { - return codePoint - 97; - } - return base; - } - - /** - * Converts a digit/integer into a basic code point. - * @see `basicToDigit()` - * @private - * @param {Number} digit The numeric value of a basic code point. - * @returns {Number} The basic code point whose value (when used for - * representing integers) is `digit`, which needs to be in the range - * `0` to `base - 1`. If `flag` is non-zero, the uppercase form is - * used; else, the lowercase form is used. The behavior is undefined - * if `flag` is non-zero and `digit` has no uppercase form. - */ - function digitToBasic(digit, flag) { - // 0..25 map to ASCII a..z or A..Z - // 26..35 map to ASCII 0..9 - return digit + 22 + 75 * (digit < 26) - ((flag != 0) << 5); - } - - /** - * Bias adaptation function as per section 3.4 of RFC 3492. - * https://tools.ietf.org/html/rfc3492#section-3.4 - * @private - */ - function adapt(delta, numPoints, firstTime) { - var k = 0; - delta = firstTime ? floor(delta / damp) : delta >> 1; - delta += floor(delta / numPoints); - for (/* no initialization */; delta > baseMinusTMin * tMax >> 1; k += base) { - delta = floor(delta / baseMinusTMin); - } - return floor(k + (baseMinusTMin + 1) * delta / (delta + skew)); - } - - /** - * Converts a Punycode string of ASCII-only symbols to a string of Unicode - * symbols. - * @memberOf punycode - * @param {String} input The Punycode string of ASCII-only symbols. - * @returns {String} The resulting string of Unicode symbols. - */ - function decode(input) { - // Don't use UCS-2 - var output = [], - inputLength = input.length, - out, - i = 0, - n = initialN, - bias = initialBias, - basic, - j, - index, - oldi, - w, - k, - digit, - t, - /** Cached calculation results */ - baseMinusT; - - // Handle the basic code points: let `basic` be the number of input code - // points before the last delimiter, or `0` if there is none, then copy - // the first basic code points to the output. - - basic = input.lastIndexOf(delimiter); - if (basic < 0) { - basic = 0; - } - - for (j = 0; j < basic; ++j) { - // if it's not a basic code point - if (input.charCodeAt(j) >= 0x80) { - error('not-basic'); - } - output.push(input.charCodeAt(j)); - } - - // Main decoding loop: start just after the last delimiter if any basic code - // points were copied; start at the beginning otherwise. - - for (index = basic > 0 ? basic + 1 : 0; index < inputLength; /* no final expression */) { - - // `index` is the index of the next character to be consumed. - // Decode a generalized variable-length integer into `delta`, - // which gets added to `i`. The overflow checking is easier - // if we increase `i` as we go, then subtract off its starting - // value at the end to obtain `delta`. - for (oldi = i, w = 1, k = base; /* no condition */; k += base) { - - if (index >= inputLength) { - error('invalid-input'); - } - - digit = basicToDigit(input.charCodeAt(index++)); - - if (digit >= base || digit > floor((maxInt - i) / w)) { - error('overflow'); - } +},{}],45:[function(require,module,exports){ +/** @license URI.js v4.4.0 (c) 2011 Gary Court. License: http://github.com/garycourt/uri-js */ +(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : + typeof define === 'function' && define.amd ? define(['exports'], factory) : + (factory((global.URI = global.URI || {}))); +}(this, (function (exports) { 'use strict'; + +function merge() { + for (var _len = arguments.length, sets = Array(_len), _key = 0; _key < _len; _key++) { + sets[_key] = arguments[_key]; + } + + if (sets.length > 1) { + sets[0] = sets[0].slice(0, -1); + var xl = sets.length - 1; + for (var x = 1; x < xl; ++x) { + sets[x] = sets[x].slice(1, -1); + } + sets[xl] = sets[xl].slice(1); + return sets.join(''); + } else { + return sets[0]; + } +} +function subexp(str) { + return "(?:" + str + ")"; +} +function typeOf(o) { + return o === undefined ? "undefined" : o === null ? "null" : Object.prototype.toString.call(o).split(" ").pop().split("]").shift().toLowerCase(); +} +function toUpperCase(str) { + return str.toUpperCase(); +} +function toArray(obj) { + return obj !== undefined && obj !== null ? obj instanceof Array ? obj : typeof obj.length !== "number" || obj.split || obj.setInterval || obj.call ? [obj] : Array.prototype.slice.call(obj) : []; +} +function assign(target, source) { + var obj = target; + if (source) { + for (var key in source) { + obj[key] = source[key]; + } + } + return obj; +} - i += digit * w; - t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias); +function buildExps(isIRI) { + var ALPHA$$ = "[A-Za-z]", + CR$ = "[\\x0D]", + DIGIT$$ = "[0-9]", + DQUOTE$$ = "[\\x22]", + HEXDIG$$ = merge(DIGIT$$, "[A-Fa-f]"), + //case-insensitive + LF$$ = "[\\x0A]", + SP$$ = "[\\x20]", + PCT_ENCODED$ = subexp(subexp("%[EFef]" + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$) + "|" + subexp("%[89A-Fa-f]" + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$) + "|" + subexp("%" + HEXDIG$$ + HEXDIG$$)), + //expanded + GEN_DELIMS$$ = "[\\:\\/\\?\\#\\[\\]\\@]", + SUB_DELIMS$$ = "[\\!\\$\\&\\'\\(\\)\\*\\+\\,\\;\\=]", + RESERVED$$ = merge(GEN_DELIMS$$, SUB_DELIMS$$), + UCSCHAR$$ = isIRI ? "[\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]" : "[]", + //subset, excludes bidi control characters + IPRIVATE$$ = isIRI ? "[\\uE000-\\uF8FF]" : "[]", + //subset + UNRESERVED$$ = merge(ALPHA$$, DIGIT$$, "[\\-\\.\\_\\~]", UCSCHAR$$), + SCHEME$ = subexp(ALPHA$$ + merge(ALPHA$$, DIGIT$$, "[\\+\\-\\.]") + "*"), + USERINFO$ = subexp(subexp(PCT_ENCODED$ + "|" + merge(UNRESERVED$$, SUB_DELIMS$$, "[\\:]")) + "*"), + DEC_OCTET$ = subexp(subexp("25[0-5]") + "|" + subexp("2[0-4]" + DIGIT$$) + "|" + subexp("1" + DIGIT$$ + DIGIT$$) + "|" + subexp("[1-9]" + DIGIT$$) + "|" + DIGIT$$), + DEC_OCTET_RELAXED$ = subexp(subexp("25[0-5]") + "|" + subexp("2[0-4]" + DIGIT$$) + "|" + subexp("1" + DIGIT$$ + DIGIT$$) + "|" + subexp("0?[1-9]" + DIGIT$$) + "|0?0?" + DIGIT$$), + //relaxed parsing rules + IPV4ADDRESS$ = subexp(DEC_OCTET_RELAXED$ + "\\." + DEC_OCTET_RELAXED$ + "\\." + DEC_OCTET_RELAXED$ + "\\." + DEC_OCTET_RELAXED$), + H16$ = subexp(HEXDIG$$ + "{1,4}"), + LS32$ = subexp(subexp(H16$ + "\\:" + H16$) + "|" + IPV4ADDRESS$), + IPV6ADDRESS1$ = subexp(subexp(H16$ + "\\:") + "{6}" + LS32$), + // 6( h16 ":" ) ls32 + IPV6ADDRESS2$ = subexp("\\:\\:" + subexp(H16$ + "\\:") + "{5}" + LS32$), + // "::" 5( h16 ":" ) ls32 + IPV6ADDRESS3$ = subexp(subexp(H16$) + "?\\:\\:" + subexp(H16$ + "\\:") + "{4}" + LS32$), + //[ h16 ] "::" 4( h16 ":" ) ls32 + IPV6ADDRESS4$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,1}" + H16$) + "?\\:\\:" + subexp(H16$ + "\\:") + "{3}" + LS32$), + //[ *1( h16 ":" ) h16 ] "::" 3( h16 ":" ) ls32 + IPV6ADDRESS5$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,2}" + H16$) + "?\\:\\:" + subexp(H16$ + "\\:") + "{2}" + LS32$), + //[ *2( h16 ":" ) h16 ] "::" 2( h16 ":" ) ls32 + IPV6ADDRESS6$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,3}" + H16$) + "?\\:\\:" + H16$ + "\\:" + LS32$), + //[ *3( h16 ":" ) h16 ] "::" h16 ":" ls32 + IPV6ADDRESS7$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,4}" + H16$) + "?\\:\\:" + LS32$), + //[ *4( h16 ":" ) h16 ] "::" ls32 + IPV6ADDRESS8$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,5}" + H16$) + "?\\:\\:" + H16$), + //[ *5( h16 ":" ) h16 ] "::" h16 + IPV6ADDRESS9$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,6}" + H16$) + "?\\:\\:"), + //[ *6( h16 ":" ) h16 ] "::" + IPV6ADDRESS$ = subexp([IPV6ADDRESS1$, IPV6ADDRESS2$, IPV6ADDRESS3$, IPV6ADDRESS4$, IPV6ADDRESS5$, IPV6ADDRESS6$, IPV6ADDRESS7$, IPV6ADDRESS8$, IPV6ADDRESS9$].join("|")), + ZONEID$ = subexp(subexp(UNRESERVED$$ + "|" + PCT_ENCODED$) + "+"), + //RFC 6874 + IPV6ADDRZ$ = subexp(IPV6ADDRESS$ + "\\%25" + ZONEID$), + //RFC 6874 + IPV6ADDRZ_RELAXED$ = subexp(IPV6ADDRESS$ + subexp("\\%25|\\%(?!" + HEXDIG$$ + "{2})") + ZONEID$), + //RFC 6874, with relaxed parsing rules + IPVFUTURE$ = subexp("[vV]" + HEXDIG$$ + "+\\." + merge(UNRESERVED$$, SUB_DELIMS$$, "[\\:]") + "+"), + IP_LITERAL$ = subexp("\\[" + subexp(IPV6ADDRZ_RELAXED$ + "|" + IPV6ADDRESS$ + "|" + IPVFUTURE$) + "\\]"), + //RFC 6874 + REG_NAME$ = subexp(subexp(PCT_ENCODED$ + "|" + merge(UNRESERVED$$, SUB_DELIMS$$)) + "*"), + HOST$ = subexp(IP_LITERAL$ + "|" + IPV4ADDRESS$ + "(?!" + REG_NAME$ + ")" + "|" + REG_NAME$), + PORT$ = subexp(DIGIT$$ + "*"), + AUTHORITY$ = subexp(subexp(USERINFO$ + "@") + "?" + HOST$ + subexp("\\:" + PORT$) + "?"), + PCHAR$ = subexp(PCT_ENCODED$ + "|" + merge(UNRESERVED$$, SUB_DELIMS$$, "[\\:\\@]")), + SEGMENT$ = subexp(PCHAR$ + "*"), + SEGMENT_NZ$ = subexp(PCHAR$ + "+"), + SEGMENT_NZ_NC$ = subexp(subexp(PCT_ENCODED$ + "|" + merge(UNRESERVED$$, SUB_DELIMS$$, "[\\@]")) + "+"), + PATH_ABEMPTY$ = subexp(subexp("\\/" + SEGMENT$) + "*"), + PATH_ABSOLUTE$ = subexp("\\/" + subexp(SEGMENT_NZ$ + PATH_ABEMPTY$) + "?"), + //simplified + PATH_NOSCHEME$ = subexp(SEGMENT_NZ_NC$ + PATH_ABEMPTY$), + //simplified + PATH_ROOTLESS$ = subexp(SEGMENT_NZ$ + PATH_ABEMPTY$), + //simplified + PATH_EMPTY$ = "(?!" + PCHAR$ + ")", + PATH$ = subexp(PATH_ABEMPTY$ + "|" + PATH_ABSOLUTE$ + "|" + PATH_NOSCHEME$ + "|" + PATH_ROOTLESS$ + "|" + PATH_EMPTY$), + QUERY$ = subexp(subexp(PCHAR$ + "|" + merge("[\\/\\?]", IPRIVATE$$)) + "*"), + FRAGMENT$ = subexp(subexp(PCHAR$ + "|[\\/\\?]") + "*"), + HIER_PART$ = subexp(subexp("\\/\\/" + AUTHORITY$ + PATH_ABEMPTY$) + "|" + PATH_ABSOLUTE$ + "|" + PATH_ROOTLESS$ + "|" + PATH_EMPTY$), + URI$ = subexp(SCHEME$ + "\\:" + HIER_PART$ + subexp("\\?" + QUERY$) + "?" + subexp("\\#" + FRAGMENT$) + "?"), + RELATIVE_PART$ = subexp(subexp("\\/\\/" + AUTHORITY$ + PATH_ABEMPTY$) + "|" + PATH_ABSOLUTE$ + "|" + PATH_NOSCHEME$ + "|" + PATH_EMPTY$), + RELATIVE$ = subexp(RELATIVE_PART$ + subexp("\\?" + QUERY$) + "?" + subexp("\\#" + FRAGMENT$) + "?"), + URI_REFERENCE$ = subexp(URI$ + "|" + RELATIVE$), + ABSOLUTE_URI$ = subexp(SCHEME$ + "\\:" + HIER_PART$ + subexp("\\?" + QUERY$) + "?"), + GENERIC_REF$ = "^(" + SCHEME$ + ")\\:" + subexp(subexp("\\/\\/(" + subexp("(" + USERINFO$ + ")@") + "?(" + HOST$ + ")" + subexp("\\:(" + PORT$ + ")") + "?)") + "?(" + PATH_ABEMPTY$ + "|" + PATH_ABSOLUTE$ + "|" + PATH_ROOTLESS$ + "|" + PATH_EMPTY$ + ")") + subexp("\\?(" + QUERY$ + ")") + "?" + subexp("\\#(" + FRAGMENT$ + ")") + "?$", + RELATIVE_REF$ = "^(){0}" + subexp(subexp("\\/\\/(" + subexp("(" + USERINFO$ + ")@") + "?(" + HOST$ + ")" + subexp("\\:(" + PORT$ + ")") + "?)") + "?(" + PATH_ABEMPTY$ + "|" + PATH_ABSOLUTE$ + "|" + PATH_NOSCHEME$ + "|" + PATH_EMPTY$ + ")") + subexp("\\?(" + QUERY$ + ")") + "?" + subexp("\\#(" + FRAGMENT$ + ")") + "?$", + ABSOLUTE_REF$ = "^(" + SCHEME$ + ")\\:" + subexp(subexp("\\/\\/(" + subexp("(" + USERINFO$ + ")@") + "?(" + HOST$ + ")" + subexp("\\:(" + PORT$ + ")") + "?)") + "?(" + PATH_ABEMPTY$ + "|" + PATH_ABSOLUTE$ + "|" + PATH_ROOTLESS$ + "|" + PATH_EMPTY$ + ")") + subexp("\\?(" + QUERY$ + ")") + "?$", + SAMEDOC_REF$ = "^" + subexp("\\#(" + FRAGMENT$ + ")") + "?$", + AUTHORITY_REF$ = "^" + subexp("(" + USERINFO$ + ")@") + "?(" + HOST$ + ")" + subexp("\\:(" + PORT$ + ")") + "?$"; + return { + NOT_SCHEME: new RegExp(merge("[^]", ALPHA$$, DIGIT$$, "[\\+\\-\\.]"), "g"), + NOT_USERINFO: new RegExp(merge("[^\\%\\:]", UNRESERVED$$, SUB_DELIMS$$), "g"), + NOT_HOST: new RegExp(merge("[^\\%\\[\\]\\:]", UNRESERVED$$, SUB_DELIMS$$), "g"), + NOT_PATH: new RegExp(merge("[^\\%\\/\\:\\@]", UNRESERVED$$, SUB_DELIMS$$), "g"), + NOT_PATH_NOSCHEME: new RegExp(merge("[^\\%\\/\\@]", UNRESERVED$$, SUB_DELIMS$$), "g"), + NOT_QUERY: new RegExp(merge("[^\\%]", UNRESERVED$$, SUB_DELIMS$$, "[\\:\\@\\/\\?]", IPRIVATE$$), "g"), + NOT_FRAGMENT: new RegExp(merge("[^\\%]", UNRESERVED$$, SUB_DELIMS$$, "[\\:\\@\\/\\?]"), "g"), + ESCAPE: new RegExp(merge("[^]", UNRESERVED$$, SUB_DELIMS$$), "g"), + UNRESERVED: new RegExp(UNRESERVED$$, "g"), + OTHER_CHARS: new RegExp(merge("[^\\%]", UNRESERVED$$, RESERVED$$), "g"), + PCT_ENCODED: new RegExp(PCT_ENCODED$, "g"), + IPV4ADDRESS: new RegExp("^(" + IPV4ADDRESS$ + ")$"), + IPV6ADDRESS: new RegExp("^\\[?(" + IPV6ADDRESS$ + ")" + subexp(subexp("\\%25|\\%(?!" + HEXDIG$$ + "{2})") + "(" + ZONEID$ + ")") + "?\\]?$") //RFC 6874, with relaxed parsing rules + }; +} +var URI_PROTOCOL = buildExps(false); - if (digit < t) { - break; - } +var IRI_PROTOCOL = buildExps(true); - baseMinusT = base - t; - if (w > floor(maxInt / baseMinusT)) { - error('overflow'); - } +var slicedToArray = function () { + function sliceIterator(arr, i) { + var _arr = []; + var _n = true; + var _d = false; + var _e = undefined; - w *= baseMinusT; + try { + for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { + _arr.push(_s.value); - } + if (i && _arr.length === i) break; + } + } catch (err) { + _d = true; + _e = err; + } finally { + try { + if (!_n && _i["return"]) _i["return"](); + } finally { + if (_d) throw _e; + } + } - out = output.length + 1; - bias = adapt(i - oldi, out, oldi == 0); + return _arr; + } - // `i` was supposed to wrap around from `out` to `0`, - // incrementing `n` each time, so we'll fix that now: - if (floor(i / out) > maxInt - n) { - error('overflow'); - } + return function (arr, i) { + if (Array.isArray(arr)) { + return arr; + } else if (Symbol.iterator in Object(arr)) { + return sliceIterator(arr, i); + } else { + throw new TypeError("Invalid attempt to destructure non-iterable instance"); + } + }; +}(); - n += floor(i / out); - i %= out; - // Insert `n` at position `i` of the output - output.splice(i++, 0, n); - } - return ucs2encode(output); - } - /** - * Converts a string of Unicode symbols (e.g. a domain name label) to a - * Punycode string of ASCII-only symbols. - * @memberOf punycode - * @param {String} input The string of Unicode symbols. - * @returns {String} The resulting Punycode string of ASCII-only symbols. - */ - function encode(input) { - var n, - delta, - handledCPCount, - basicLength, - bias, - j, - m, - q, - k, - t, - currentValue, - output = [], - /** `inputLength` will hold the number of code points in `input`. */ - inputLength, - /** Cached calculation results */ - handledCPCountPlusOne, - baseMinusT, - qMinusT; - - // Convert the input in UCS-2 to Unicode - input = ucs2decode(input); - - // Cache the length - inputLength = input.length; - - // Initialize the state - n = initialN; - delta = 0; - bias = initialBias; - - // Handle the basic code points - for (j = 0; j < inputLength; ++j) { - currentValue = input[j]; - if (currentValue < 0x80) { - output.push(stringFromCharCode(currentValue)); - } - } - handledCPCount = basicLength = output.length; - // `handledCPCount` is the number of code points that have been handled; - // `basicLength` is the number of basic code points. - // Finish the basic string - if it is not empty - with a delimiter - if (basicLength) { - output.push(delimiter); - } - // Main encoding loop: - while (handledCPCount < inputLength) { - // All non-basic code points < n have been handled already. Find the next - // larger one: - for (m = maxInt, j = 0; j < inputLength; ++j) { - currentValue = input[j]; - if (currentValue >= n && currentValue < m) { - m = currentValue; - } - } - // Increase `delta` enough to advance the decoder's state to , - // but guard against overflow - handledCPCountPlusOne = handledCPCount + 1; - if (m - n > floor((maxInt - delta) / handledCPCountPlusOne)) { - error('overflow'); - } - delta += (m - n) * handledCPCountPlusOne; - n = m; - for (j = 0; j < inputLength; ++j) { - currentValue = input[j]; +var toConsumableArray = function (arr) { + if (Array.isArray(arr)) { + for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) arr2[i] = arr[i]; - if (currentValue < n && ++delta > maxInt) { - error('overflow'); - } + return arr2; + } else { + return Array.from(arr); + } +}; - if (currentValue == n) { - // Represent delta as a generalized variable-length integer - for (q = delta, k = base; /* no condition */; k += base) { - t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias); - if (q < t) { - break; - } - qMinusT = q - t; - baseMinusT = base - t; - output.push( - stringFromCharCode(digitToBasic(t + qMinusT % baseMinusT, 0)) - ); - q = floor(qMinusT / baseMinusT); - } +/** Highest positive signed 32-bit float value */ + +var maxInt = 2147483647; // aka. 0x7FFFFFFF or 2^31-1 + +/** Bootstring parameters */ +var base = 36; +var tMin = 1; +var tMax = 26; +var skew = 38; +var damp = 700; +var initialBias = 72; +var initialN = 128; // 0x80 +var delimiter = '-'; // '\x2D' + +/** Regular expressions */ +var regexPunycode = /^xn--/; +var regexNonASCII = /[^\0-\x7E]/; // non-ASCII chars +var regexSeparators = /[\x2E\u3002\uFF0E\uFF61]/g; // RFC 3490 separators + +/** Error messages */ +var errors = { + 'overflow': 'Overflow: input needs wider integers to process', + 'not-basic': 'Illegal input >= 0x80 (not a basic code point)', + 'invalid-input': 'Invalid input' +}; - output.push(stringFromCharCode(digitToBasic(q, 0))); - bias = adapt(delta, handledCPCountPlusOne, handledCPCount == basicLength); - delta = 0; - ++handledCPCount; - } - } +/** Convenience shortcuts */ +var baseMinusTMin = base - tMin; +var floor = Math.floor; +var stringFromCharCode = String.fromCharCode; - ++delta; - ++n; +/*--------------------------------------------------------------------------*/ - } - return output.join(''); - } +/** + * A generic error utility function. + * @private + * @param {String} type The error type. + * @returns {Error} Throws a `RangeError` with the applicable error message. + */ +function error$1(type) { + throw new RangeError(errors[type]); +} - /** - * Converts a Punycode string representing a domain name or an email address - * to Unicode. Only the Punycoded parts of the input will be converted, i.e. - * it doesn't matter if you call it on a string that has already been - * converted to Unicode. - * @memberOf punycode - * @param {String} input The Punycoded domain name or email address to - * convert to Unicode. - * @returns {String} The Unicode representation of the given Punycode - * string. - */ - function toUnicode(input) { - return mapDomain(input, function(string) { - return regexPunycode.test(string) - ? decode(string.slice(4).toLowerCase()) - : string; - }); +/** + * A generic `Array#map` utility function. + * @private + * @param {Array} array The array to iterate over. + * @param {Function} callback The function that gets called for every array + * item. + * @returns {Array} A new array of values returned by the callback function. + */ +function map(array, fn) { + var result = []; + var length = array.length; + while (length--) { + result[length] = fn(array[length]); } + return result; +} - /** - * Converts a Unicode string representing a domain name or an email address to - * Punycode. Only the non-ASCII parts of the domain name will be converted, - * i.e. it doesn't matter if you call it with a domain that's already in - * ASCII. - * @memberOf punycode - * @param {String} input The domain name or email address to convert, as a - * Unicode string. - * @returns {String} The Punycode representation of the given domain name or - * email address. - */ - function toASCII(input) { - return mapDomain(input, function(string) { - return regexNonASCII.test(string) - ? 'xn--' + encode(string) - : string; - }); +/** + * A simple `Array#map`-like wrapper to work with domain name strings or email + * addresses. + * @private + * @param {String} domain The domain name or email address. + * @param {Function} callback The function that gets called for every + * character. + * @returns {Array} A new string of characters returned by the callback + * function. + */ +function mapDomain(string, fn) { + var parts = string.split('@'); + var result = ''; + if (parts.length > 1) { + // In email addresses, only the domain name should be punycoded. Leave + // the local part (i.e. everything up to `@`) intact. + result = parts[0] + '@'; + string = parts[1]; } + // Avoid `split(regex)` for IE8 compatibility. See #17. + string = string.replace(regexSeparators, '\x2E'); + var labels = string.split('.'); + var encoded = map(labels, fn).join('.'); + return result + encoded; +} - /*--------------------------------------------------------------------------*/ - - /** Define the public API */ - punycode = { - /** - * A string representing the current Punycode.js version number. - * @memberOf punycode - * @type String - */ - 'version': '1.4.1', - /** - * An object of methods to convert from JavaScript's internal character - * representation (UCS-2) to Unicode code points, and back. - * @see - * @memberOf punycode - * @type Object - */ - 'ucs2': { - 'decode': ucs2decode, - 'encode': ucs2encode - }, - 'decode': decode, - 'encode': encode, - 'toASCII': toASCII, - 'toUnicode': toUnicode - }; - - /** Expose `punycode` */ - // Some AMD build optimizers, like r.js, check for specific condition patterns - // like the following: - if ( - typeof define == 'function' && - typeof define.amd == 'object' && - define.amd - ) { - define('punycode', function() { - return punycode; - }); - } else if (freeExports && freeModule) { - if (module.exports == freeExports) { - // in Node.js, io.js, or RingoJS v0.8.0+ - freeModule.exports = punycode; - } else { - // in Narwhal or RingoJS v0.7.0- - for (key in punycode) { - punycode.hasOwnProperty(key) && (freeExports[key] = punycode[key]); +/** + * Creates an array containing the numeric code points of each Unicode + * character in the string. While JavaScript uses UCS-2 internally, + * this function will convert a pair of surrogate halves (each of which + * UCS-2 exposes as separate characters) into a single code point, + * matching UTF-16. + * @see `punycode.ucs2.encode` + * @see + * @memberOf punycode.ucs2 + * @name decode + * @param {String} string The Unicode input string (UCS-2). + * @returns {Array} The new array of code points. + */ +function ucs2decode(string) { + var output = []; + var counter = 0; + var length = string.length; + while (counter < length) { + var value = string.charCodeAt(counter++); + if (value >= 0xD800 && value <= 0xDBFF && counter < length) { + // It's a high surrogate, and there is a next character. + var extra = string.charCodeAt(counter++); + if ((extra & 0xFC00) == 0xDC00) { + // Low surrogate. + output.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000); + } else { + // It's an unmatched surrogate; only append this code unit, in case the + // next code unit is the high surrogate of a surrogate pair. + output.push(value); + counter--; } + } else { + output.push(value); } - } else { - // in Rhino or a web browser - root.punycode = punycode; } - -}(this)); - -}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{}],45:[function(require,module,exports){ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - -'use strict'; - -// If obj.hasOwnProperty has been overridden, then calling -// obj.hasOwnProperty(prop) will break. -// See: https://github.com/joyent/node/issues/1707 -function hasOwnProperty(obj, prop) { - return Object.prototype.hasOwnProperty.call(obj, prop); + return output; } -module.exports = function(qs, sep, eq, options) { - sep = sep || '&'; - eq = eq || '='; - var obj = {}; - - if (typeof qs !== 'string' || qs.length === 0) { - return obj; - } - - var regexp = /\+/g; - qs = qs.split(sep); - - var maxKeys = 1000; - if (options && typeof options.maxKeys === 'number') { - maxKeys = options.maxKeys; - } - - var len = qs.length; - // maxKeys <= 0 means that we should not limit keys count - if (maxKeys > 0 && len > maxKeys) { - len = maxKeys; - } - - for (var i = 0; i < len; ++i) { - var x = qs[i].replace(regexp, '%20'), - idx = x.indexOf(eq), - kstr, vstr, k, v; - - if (idx >= 0) { - kstr = x.substr(0, idx); - vstr = x.substr(idx + 1); - } else { - kstr = x; - vstr = ''; - } - - k = decodeURIComponent(kstr); - v = decodeURIComponent(vstr); - - if (!hasOwnProperty(obj, k)) { - obj[k] = v; - } else if (isArray(obj[k])) { - obj[k].push(v); - } else { - obj[k] = [obj[k], v]; - } - } - - return obj; +/** + * Creates a string based on an array of numeric code points. + * @see `punycode.ucs2.decode` + * @memberOf punycode.ucs2 + * @name encode + * @param {Array} codePoints The array of numeric code points. + * @returns {String} The new Unicode string (UCS-2). + */ +var ucs2encode = function ucs2encode(array) { + return String.fromCodePoint.apply(String, toConsumableArray(array)); }; -var isArray = Array.isArray || function (xs) { - return Object.prototype.toString.call(xs) === '[object Array]'; +/** + * Converts a basic code point into a digit/integer. + * @see `digitToBasic()` + * @private + * @param {Number} codePoint The basic numeric code point value. + * @returns {Number} The numeric value of a basic code point (for use in + * representing integers) in the range `0` to `base - 1`, or `base` if + * the code point does not represent a value. + */ +var basicToDigit = function basicToDigit(codePoint) { + if (codePoint - 0x30 < 0x0A) { + return codePoint - 0x16; + } + if (codePoint - 0x41 < 0x1A) { + return codePoint - 0x41; + } + if (codePoint - 0x61 < 0x1A) { + return codePoint - 0x61; + } + return base; }; -},{}],46:[function(require,module,exports){ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - -'use strict'; - -var stringifyPrimitive = function(v) { - switch (typeof v) { - case 'string': - return v; - - case 'boolean': - return v ? 'true' : 'false'; - - case 'number': - return isFinite(v) ? v : ''; - - default: - return ''; - } +/** + * Converts a digit/integer into a basic code point. + * @see `basicToDigit()` + * @private + * @param {Number} digit The numeric value of a basic code point. + * @returns {Number} The basic code point whose value (when used for + * representing integers) is `digit`, which needs to be in the range + * `0` to `base - 1`. If `flag` is non-zero, the uppercase form is + * used; else, the lowercase form is used. The behavior is undefined + * if `flag` is non-zero and `digit` has no uppercase form. + */ +var digitToBasic = function digitToBasic(digit, flag) { + // 0..25 map to ASCII a..z or A..Z + // 26..35 map to ASCII 0..9 + return digit + 22 + 75 * (digit < 26) - ((flag != 0) << 5); }; -module.exports = function(obj, sep, eq, name) { - sep = sep || '&'; - eq = eq || '='; - if (obj === null) { - obj = undefined; - } +/** + * Bias adaptation function as per section 3.4 of RFC 3492. + * https://tools.ietf.org/html/rfc3492#section-3.4 + * @private + */ +var adapt = function adapt(delta, numPoints, firstTime) { + var k = 0; + delta = firstTime ? floor(delta / damp) : delta >> 1; + delta += floor(delta / numPoints); + for (; /* no initialization */delta > baseMinusTMin * tMax >> 1; k += base) { + delta = floor(delta / baseMinusTMin); + } + return floor(k + (baseMinusTMin + 1) * delta / (delta + skew)); +}; - if (typeof obj === 'object') { - return map(objectKeys(obj), function(k) { - var ks = encodeURIComponent(stringifyPrimitive(k)) + eq; - if (isArray(obj[k])) { - return map(obj[k], function(v) { - return ks + encodeURIComponent(stringifyPrimitive(v)); - }).join(sep); - } else { - return ks + encodeURIComponent(stringifyPrimitive(obj[k])); - } - }).join(sep); +/** + * Converts a Punycode string of ASCII-only symbols to a string of Unicode + * symbols. + * @memberOf punycode + * @param {String} input The Punycode string of ASCII-only symbols. + * @returns {String} The resulting string of Unicode symbols. + */ +var decode = function decode(input) { + // Don't use UCS-2. + var output = []; + var inputLength = input.length; + var i = 0; + var n = initialN; + var bias = initialBias; + + // Handle the basic code points: let `basic` be the number of input code + // points before the last delimiter, or `0` if there is none, then copy + // the first basic code points to the output. + + var basic = input.lastIndexOf(delimiter); + if (basic < 0) { + basic = 0; + } - } + for (var j = 0; j < basic; ++j) { + // if it's not a basic code point + if (input.charCodeAt(j) >= 0x80) { + error$1('not-basic'); + } + output.push(input.charCodeAt(j)); + } - if (!name) return ''; - return encodeURIComponent(stringifyPrimitive(name)) + eq + - encodeURIComponent(stringifyPrimitive(obj)); -}; + // Main decoding loop: start just after the last delimiter if any basic code + // points were copied; start at the beginning otherwise. -var isArray = Array.isArray || function (xs) { - return Object.prototype.toString.call(xs) === '[object Array]'; -}; + for (var index = basic > 0 ? basic + 1 : 0; index < inputLength;) /* no final expression */{ -function map (xs, f) { - if (xs.map) return xs.map(f); - var res = []; - for (var i = 0; i < xs.length; i++) { - res.push(f(xs[i], i)); - } - return res; -} + // `index` is the index of the next character to be consumed. + // Decode a generalized variable-length integer into `delta`, + // which gets added to `i`. The overflow checking is easier + // if we increase `i` as we go, then subtract off its starting + // value at the end to obtain `delta`. + var oldi = i; + for (var w = 1, k = base;; /* no condition */k += base) { -var objectKeys = Object.keys || function (obj) { - var res = []; - for (var key in obj) { - if (Object.prototype.hasOwnProperty.call(obj, key)) res.push(key); - } - return res; -}; + if (index >= inputLength) { + error$1('invalid-input'); + } -},{}],47:[function(require,module,exports){ -'use strict'; + var digit = basicToDigit(input.charCodeAt(index++)); -exports.decode = exports.parse = require('./decode'); -exports.encode = exports.stringify = require('./encode'); - -},{"./decode":45,"./encode":46}],48:[function(require,module,exports){ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. + if (digit >= base || digit > floor((maxInt - i) / w)) { + error$1('overflow'); + } -'use strict'; + i += digit * w; + var t = k <= bias ? tMin : k >= bias + tMax ? tMax : k - bias; -var punycode = require('punycode'); -var util = require('./util'); + if (digit < t) { + break; + } -exports.parse = urlParse; -exports.resolve = urlResolve; -exports.resolveObject = urlResolveObject; -exports.format = urlFormat; - -exports.Url = Url; - -function Url() { - this.protocol = null; - this.slashes = null; - this.auth = null; - this.host = null; - this.port = null; - this.hostname = null; - this.hash = null; - this.search = null; - this.query = null; - this.pathname = null; - this.path = null; - this.href = null; -} - -// Reference: RFC 3986, RFC 1808, RFC 2396 - -// define these here so at least they only have to be -// compiled once on the first module load. -var protocolPattern = /^([a-z0-9.+-]+:)/i, - portPattern = /:[0-9]*$/, - - // Special case for a simple path URL - simplePathPattern = /^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/, - - // RFC 2396: characters reserved for delimiting URLs. - // We actually just auto-escape these. - delims = ['<', '>', '"', '`', ' ', '\r', '\n', '\t'], - - // RFC 2396: characters not allowed for various reasons. - unwise = ['{', '}', '|', '\\', '^', '`'].concat(delims), - - // Allowed by RFCs, but cause of XSS attacks. Always escape these. - autoEscape = ['\''].concat(unwise), - // Characters that are never ever allowed in a hostname. - // Note that any invalid chars are also handled, but these - // are the ones that are *expected* to be seen, so we fast-path - // them. - nonHostChars = ['%', '/', '?', ';', '#'].concat(autoEscape), - hostEndingChars = ['/', '?', '#'], - hostnameMaxLen = 255, - hostnamePartPattern = /^[+a-z0-9A-Z_-]{0,63}$/, - hostnamePartStart = /^([+a-z0-9A-Z_-]{0,63})(.*)$/, - // protocols that can allow "unsafe" and "unwise" chars. - unsafeProtocol = { - 'javascript': true, - 'javascript:': true - }, - // protocols that never have a hostname. - hostlessProtocol = { - 'javascript': true, - 'javascript:': true - }, - // protocols that always contain a // bit. - slashedProtocol = { - 'http': true, - 'https': true, - 'ftp': true, - 'gopher': true, - 'file': true, - 'http:': true, - 'https:': true, - 'ftp:': true, - 'gopher:': true, - 'file:': true - }, - querystring = require('querystring'); - -function urlParse(url, parseQueryString, slashesDenoteHost) { - if (url && util.isObject(url) && url instanceof Url) return url; - - var u = new Url; - u.parse(url, parseQueryString, slashesDenoteHost); - return u; -} - -Url.prototype.parse = function(url, parseQueryString, slashesDenoteHost) { - if (!util.isString(url)) { - throw new TypeError("Parameter 'url' must be a string, not " + typeof url); - } - - // Copy chrome, IE, opera backslash-handling behavior. - // Back slashes before the query string get converted to forward slashes - // See: https://code.google.com/p/chromium/issues/detail?id=25916 - var queryIndex = url.indexOf('?'), - splitter = - (queryIndex !== -1 && queryIndex < url.indexOf('#')) ? '?' : '#', - uSplit = url.split(splitter), - slashRegex = /\\/g; - uSplit[0] = uSplit[0].replace(slashRegex, '/'); - url = uSplit.join(splitter); - - var rest = url; - - // trim before proceeding. - // This is to support parse stuff like " http://foo.com \n" - rest = rest.trim(); - - if (!slashesDenoteHost && url.split('#').length === 1) { - // Try fast path regexp - var simplePath = simplePathPattern.exec(rest); - if (simplePath) { - this.path = rest; - this.href = rest; - this.pathname = simplePath[1]; - if (simplePath[2]) { - this.search = simplePath[2]; - if (parseQueryString) { - this.query = querystring.parse(this.search.substr(1)); - } else { - this.query = this.search.substr(1); - } - } else if (parseQueryString) { - this.search = ''; - this.query = {}; - } - return this; - } - } + var baseMinusT = base - t; + if (w > floor(maxInt / baseMinusT)) { + error$1('overflow'); + } - var proto = protocolPattern.exec(rest); - if (proto) { - proto = proto[0]; - var lowerProto = proto.toLowerCase(); - this.protocol = lowerProto; - rest = rest.substr(proto.length); - } + w *= baseMinusT; + } - // figure out if it's got a host - // user@server is *always* interpreted as a hostname, and url - // resolution will treat //foo/bar as host=foo,path=bar because that's - // how the browser resolves relative URLs. - if (slashesDenoteHost || proto || rest.match(/^\/\/[^@\/]+@[^@\/]+/)) { - var slashes = rest.substr(0, 2) === '//'; - if (slashes && !(proto && hostlessProtocol[proto])) { - rest = rest.substr(2); - this.slashes = true; - } - } + var out = output.length + 1; + bias = adapt(i - oldi, out, oldi == 0); - if (!hostlessProtocol[proto] && - (slashes || (proto && !slashedProtocol[proto]))) { + // `i` was supposed to wrap around from `out` to `0`, + // incrementing `n` each time, so we'll fix that now: + if (floor(i / out) > maxInt - n) { + error$1('overflow'); + } - // there's a hostname. - // the first instance of /, ?, ;, or # ends the host. - // - // If there is an @ in the hostname, then non-host chars *are* allowed - // to the left of the last @ sign, unless some host-ending character - // comes *before* the @-sign. - // URLs are obnoxious. - // - // ex: - // http://a@b@c/ => user:a@b host:c - // http://a@b?@c => user:a host:c path:/?@c + n += floor(i / out); + i %= out; - // v0.12 TODO(isaacs): This is not quite how Chrome does things. - // Review our test case against browsers more comprehensively. + // Insert `n` at position `i` of the output. + output.splice(i++, 0, n); + } - // find the first instance of any hostEndingChars - var hostEnd = -1; - for (var i = 0; i < hostEndingChars.length; i++) { - var hec = rest.indexOf(hostEndingChars[i]); - if (hec !== -1 && (hostEnd === -1 || hec < hostEnd)) - hostEnd = hec; - } + return String.fromCodePoint.apply(String, output); +}; - // at this point, either we have an explicit point where the - // auth portion cannot go past, or the last @ char is the decider. - var auth, atSign; - if (hostEnd === -1) { - // atSign can be anywhere. - atSign = rest.lastIndexOf('@'); - } else { - // atSign must be in auth portion. - // http://a@b/c@d => host:b auth:a path:/c@d - atSign = rest.lastIndexOf('@', hostEnd); - } - - // Now we have a portion which is definitely the auth. - // Pull that off. - if (atSign !== -1) { - auth = rest.slice(0, atSign); - rest = rest.slice(atSign + 1); - this.auth = decodeURIComponent(auth); - } - - // the host is the remaining to the left of the first non-host char - hostEnd = -1; - for (var i = 0; i < nonHostChars.length; i++) { - var hec = rest.indexOf(nonHostChars[i]); - if (hec !== -1 && (hostEnd === -1 || hec < hostEnd)) - hostEnd = hec; - } - // if we still have not hit it, then the entire thing is a host. - if (hostEnd === -1) - hostEnd = rest.length; - - this.host = rest.slice(0, hostEnd); - rest = rest.slice(hostEnd); - - // pull out port. - this.parseHost(); - - // we've indicated that there is a hostname, - // so even if it's empty, it has to be present. - this.hostname = this.hostname || ''; - - // if hostname begins with [ and ends with ] - // assume that it's an IPv6 address. - var ipv6Hostname = this.hostname[0] === '[' && - this.hostname[this.hostname.length - 1] === ']'; - - // validate a little. - if (!ipv6Hostname) { - var hostparts = this.hostname.split(/\./); - for (var i = 0, l = hostparts.length; i < l; i++) { - var part = hostparts[i]; - if (!part) continue; - if (!part.match(hostnamePartPattern)) { - var newpart = ''; - for (var j = 0, k = part.length; j < k; j++) { - if (part.charCodeAt(j) > 127) { - // we replace non-ASCII char with a temporary placeholder - // we need this to make sure size of hostname is not - // broken by replacing non-ASCII by nothing - newpart += 'x'; - } else { - newpart += part[j]; - } - } - // we test again with ASCII char only - if (!newpart.match(hostnamePartPattern)) { - var validParts = hostparts.slice(0, i); - var notHost = hostparts.slice(i + 1); - var bit = part.match(hostnamePartStart); - if (bit) { - validParts.push(bit[1]); - notHost.unshift(bit[2]); - } - if (notHost.length) { - rest = '/' + notHost.join('.') + rest; - } - this.hostname = validParts.join('.'); - break; - } - } - } - } +/** + * Converts a string of Unicode symbols (e.g. a domain name label) to a + * Punycode string of ASCII-only symbols. + * @memberOf punycode + * @param {String} input The string of Unicode symbols. + * @returns {String} The resulting Punycode string of ASCII-only symbols. + */ +var encode = function encode(input) { + var output = []; - if (this.hostname.length > hostnameMaxLen) { - this.hostname = ''; - } else { - // hostnames are always lower case. - this.hostname = this.hostname.toLowerCase(); - } + // Convert the input in UCS-2 to an array of Unicode code points. + input = ucs2decode(input); - if (!ipv6Hostname) { - // IDNA Support: Returns a punycoded representation of "domain". - // It only converts parts of the domain name that - // have non-ASCII characters, i.e. it doesn't matter if - // you call it with a domain that already is ASCII-only. - this.hostname = punycode.toASCII(this.hostname); - } + // Cache the length. + var inputLength = input.length; - var p = this.port ? ':' + this.port : ''; - var h = this.hostname || ''; - this.host = h + p; - this.href += this.host; + // Initialize the state. + var n = initialN; + var delta = 0; + var bias = initialBias; - // strip [ and ] from the hostname - // the host field still retains them, though - if (ipv6Hostname) { - this.hostname = this.hostname.substr(1, this.hostname.length - 2); - if (rest[0] !== '/') { - rest = '/' + rest; - } - } - } + // Handle the basic code points. + var _iteratorNormalCompletion = true; + var _didIteratorError = false; + var _iteratorError = undefined; - // now rest is set to the post-host stuff. - // chop off any delim chars. - if (!unsafeProtocol[lowerProto]) { + try { + for (var _iterator = input[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { + var _currentValue2 = _step.value; - // First, make 100% sure that any "autoEscape" chars get - // escaped, even if encodeURIComponent doesn't think they - // need to be. - for (var i = 0, l = autoEscape.length; i < l; i++) { - var ae = autoEscape[i]; - if (rest.indexOf(ae) === -1) - continue; - var esc = encodeURIComponent(ae); - if (esc === ae) { - esc = escape(ae); - } - rest = rest.split(ae).join(esc); - } - } + if (_currentValue2 < 0x80) { + output.push(stringFromCharCode(_currentValue2)); + } + } + } catch (err) { + _didIteratorError = true; + _iteratorError = err; + } finally { + try { + if (!_iteratorNormalCompletion && _iterator.return) { + _iterator.return(); + } + } finally { + if (_didIteratorError) { + throw _iteratorError; + } + } + } + var basicLength = output.length; + var handledCPCount = basicLength; - // chop off from the tail first. - var hash = rest.indexOf('#'); - if (hash !== -1) { - // got a fragment string. - this.hash = rest.substr(hash); - rest = rest.slice(0, hash); - } - var qm = rest.indexOf('?'); - if (qm !== -1) { - this.search = rest.substr(qm); - this.query = rest.substr(qm + 1); - if (parseQueryString) { - this.query = querystring.parse(this.query); - } - rest = rest.slice(0, qm); - } else if (parseQueryString) { - // no query string, but parseQueryString still requested - this.search = ''; - this.query = {}; - } - if (rest) this.pathname = rest; - if (slashedProtocol[lowerProto] && - this.hostname && !this.pathname) { - this.pathname = '/'; - } + // `handledCPCount` is the number of code points that have been handled; + // `basicLength` is the number of basic code points. - //to support http.request - if (this.pathname || this.search) { - var p = this.pathname || ''; - var s = this.search || ''; - this.path = p + s; - } + // Finish the basic string with a delimiter unless it's empty. + if (basicLength) { + output.push(delimiter); + } - // finally, reconstruct the href based on what has been validated. - this.href = this.format(); - return this; -}; + // Main encoding loop: + while (handledCPCount < inputLength) { -// format a parsed object into a url string -function urlFormat(obj) { - // ensure it's an object, and not a string url. - // If it's an obj, this is a no-op. - // this way, you can call url_format() on strings - // to clean up potentially wonky urls. - if (util.isString(obj)) obj = urlParse(obj); - if (!(obj instanceof Url)) return Url.prototype.format.call(obj); - return obj.format(); -} + // All non-basic code points < n have been handled already. Find the next + // larger one: + var m = maxInt; + var _iteratorNormalCompletion2 = true; + var _didIteratorError2 = false; + var _iteratorError2 = undefined; -Url.prototype.format = function() { - var auth = this.auth || ''; - if (auth) { - auth = encodeURIComponent(auth); - auth = auth.replace(/%3A/i, ':'); - auth += '@'; - } + try { + for (var _iterator2 = input[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) { + var currentValue = _step2.value; - var protocol = this.protocol || '', - pathname = this.pathname || '', - hash = this.hash || '', - host = false, - query = ''; + if (currentValue >= n && currentValue < m) { + m = currentValue; + } + } - if (this.host) { - host = auth + this.host; - } else if (this.hostname) { - host = auth + (this.hostname.indexOf(':') === -1 ? - this.hostname : - '[' + this.hostname + ']'); - if (this.port) { - host += ':' + this.port; - } - } + // Increase `delta` enough to advance the decoder's state to , + // but guard against overflow. + } catch (err) { + _didIteratorError2 = true; + _iteratorError2 = err; + } finally { + try { + if (!_iteratorNormalCompletion2 && _iterator2.return) { + _iterator2.return(); + } + } finally { + if (_didIteratorError2) { + throw _iteratorError2; + } + } + } - if (this.query && - util.isObject(this.query) && - Object.keys(this.query).length) { - query = querystring.stringify(this.query); - } + var handledCPCountPlusOne = handledCPCount + 1; + if (m - n > floor((maxInt - delta) / handledCPCountPlusOne)) { + error$1('overflow'); + } - var search = this.search || (query && ('?' + query)) || ''; + delta += (m - n) * handledCPCountPlusOne; + n = m; - if (protocol && protocol.substr(-1) !== ':') protocol += ':'; + var _iteratorNormalCompletion3 = true; + var _didIteratorError3 = false; + var _iteratorError3 = undefined; - // only the slashedProtocols get the //. Not mailto:, xmpp:, etc. - // unless they had them to begin with. - if (this.slashes || - (!protocol || slashedProtocol[protocol]) && host !== false) { - host = '//' + (host || ''); - if (pathname && pathname.charAt(0) !== '/') pathname = '/' + pathname; - } else if (!host) { - host = ''; - } + try { + for (var _iterator3 = input[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) { + var _currentValue = _step3.value; - if (hash && hash.charAt(0) !== '#') hash = '#' + hash; - if (search && search.charAt(0) !== '?') search = '?' + search; + if (_currentValue < n && ++delta > maxInt) { + error$1('overflow'); + } + if (_currentValue == n) { + // Represent delta as a generalized variable-length integer. + var q = delta; + for (var k = base;; /* no condition */k += base) { + var t = k <= bias ? tMin : k >= bias + tMax ? tMax : k - bias; + if (q < t) { + break; + } + var qMinusT = q - t; + var baseMinusT = base - t; + output.push(stringFromCharCode(digitToBasic(t + qMinusT % baseMinusT, 0))); + q = floor(qMinusT / baseMinusT); + } - pathname = pathname.replace(/[?#]/g, function(match) { - return encodeURIComponent(match); - }); - search = search.replace('#', '%23'); + output.push(stringFromCharCode(digitToBasic(q, 0))); + bias = adapt(delta, handledCPCountPlusOne, handledCPCount == basicLength); + delta = 0; + ++handledCPCount; + } + } + } catch (err) { + _didIteratorError3 = true; + _iteratorError3 = err; + } finally { + try { + if (!_iteratorNormalCompletion3 && _iterator3.return) { + _iterator3.return(); + } + } finally { + if (_didIteratorError3) { + throw _iteratorError3; + } + } + } - return protocol + host + pathname + search + hash; + ++delta; + ++n; + } + return output.join(''); }; -function urlResolve(source, relative) { - return urlParse(source, false, true).resolve(relative); -} +/** + * Converts a Punycode string representing a domain name or an email address + * to Unicode. Only the Punycoded parts of the input will be converted, i.e. + * it doesn't matter if you call it on a string that has already been + * converted to Unicode. + * @memberOf punycode + * @param {String} input The Punycoded domain name or email address to + * convert to Unicode. + * @returns {String} The Unicode representation of the given Punycode + * string. + */ +var toUnicode = function toUnicode(input) { + return mapDomain(input, function (string) { + return regexPunycode.test(string) ? decode(string.slice(4).toLowerCase()) : string; + }); +}; -Url.prototype.resolve = function(relative) { - return this.resolveObject(urlParse(relative, false, true)).format(); +/** + * Converts a Unicode string representing a domain name or an email address to + * Punycode. Only the non-ASCII parts of the domain name will be converted, + * i.e. it doesn't matter if you call it with a domain that's already in + * ASCII. + * @memberOf punycode + * @param {String} input The domain name or email address to convert, as a + * Unicode string. + * @returns {String} The Punycode representation of the given domain name or + * email address. + */ +var toASCII = function toASCII(input) { + return mapDomain(input, function (string) { + return regexNonASCII.test(string) ? 'xn--' + encode(string) : string; + }); }; -function urlResolveObject(source, relative) { - if (!source) return relative; - return urlParse(source, false, true).resolveObject(relative); -} +/*--------------------------------------------------------------------------*/ -Url.prototype.resolveObject = function(relative) { - if (util.isString(relative)) { - var rel = new Url(); - rel.parse(relative, false, true); - relative = rel; - } +/** Define the public API */ +var punycode = { + /** + * A string representing the current Punycode.js version number. + * @memberOf punycode + * @type String + */ + 'version': '2.1.0', + /** + * An object of methods to convert from JavaScript's internal character + * representation (UCS-2) to Unicode code points, and back. + * @see + * @memberOf punycode + * @type Object + */ + 'ucs2': { + 'decode': ucs2decode, + 'encode': ucs2encode + }, + 'decode': decode, + 'encode': encode, + 'toASCII': toASCII, + 'toUnicode': toUnicode +}; - var result = new Url(); - var tkeys = Object.keys(this); - for (var tk = 0; tk < tkeys.length; tk++) { - var tkey = tkeys[tk]; - result[tkey] = this[tkey]; - } +/** + * URI.js + * + * @fileoverview An RFC 3986 compliant, scheme extendable URI parsing/validating/resolving library for JavaScript. + * @author Gary Court + * @see http://github.com/garycourt/uri-js + */ +/** + * Copyright 2011 Gary Court. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY GARY COURT ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GARY COURT OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of Gary Court. + */ +var SCHEMES = {}; +function pctEncChar(chr) { + var c = chr.charCodeAt(0); + var e = void 0; + if (c < 16) e = "%0" + c.toString(16).toUpperCase();else if (c < 128) e = "%" + c.toString(16).toUpperCase();else if (c < 2048) e = "%" + (c >> 6 | 192).toString(16).toUpperCase() + "%" + (c & 63 | 128).toString(16).toUpperCase();else e = "%" + (c >> 12 | 224).toString(16).toUpperCase() + "%" + (c >> 6 & 63 | 128).toString(16).toUpperCase() + "%" + (c & 63 | 128).toString(16).toUpperCase(); + return e; +} +function pctDecChars(str) { + var newStr = ""; + var i = 0; + var il = str.length; + while (i < il) { + var c = parseInt(str.substr(i + 1, 2), 16); + if (c < 128) { + newStr += String.fromCharCode(c); + i += 3; + } else if (c >= 194 && c < 224) { + if (il - i >= 6) { + var c2 = parseInt(str.substr(i + 4, 2), 16); + newStr += String.fromCharCode((c & 31) << 6 | c2 & 63); + } else { + newStr += str.substr(i, 6); + } + i += 6; + } else if (c >= 224) { + if (il - i >= 9) { + var _c = parseInt(str.substr(i + 4, 2), 16); + var c3 = parseInt(str.substr(i + 7, 2), 16); + newStr += String.fromCharCode((c & 15) << 12 | (_c & 63) << 6 | c3 & 63); + } else { + newStr += str.substr(i, 9); + } + i += 9; + } else { + newStr += str.substr(i, 3); + i += 3; + } + } + return newStr; +} +function _normalizeComponentEncoding(components, protocol) { + function decodeUnreserved(str) { + var decStr = pctDecChars(str); + return !decStr.match(protocol.UNRESERVED) ? str : decStr; + } + if (components.scheme) components.scheme = String(components.scheme).replace(protocol.PCT_ENCODED, decodeUnreserved).toLowerCase().replace(protocol.NOT_SCHEME, ""); + if (components.userinfo !== undefined) components.userinfo = String(components.userinfo).replace(protocol.PCT_ENCODED, decodeUnreserved).replace(protocol.NOT_USERINFO, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase); + if (components.host !== undefined) components.host = String(components.host).replace(protocol.PCT_ENCODED, decodeUnreserved).toLowerCase().replace(protocol.NOT_HOST, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase); + if (components.path !== undefined) components.path = String(components.path).replace(protocol.PCT_ENCODED, decodeUnreserved).replace(components.scheme ? protocol.NOT_PATH : protocol.NOT_PATH_NOSCHEME, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase); + if (components.query !== undefined) components.query = String(components.query).replace(protocol.PCT_ENCODED, decodeUnreserved).replace(protocol.NOT_QUERY, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase); + if (components.fragment !== undefined) components.fragment = String(components.fragment).replace(protocol.PCT_ENCODED, decodeUnreserved).replace(protocol.NOT_FRAGMENT, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase); + return components; +} - // hash is always overridden, no matter what. - // even href="" will remove it. - result.hash = relative.hash; +function _stripLeadingZeros(str) { + return str.replace(/^0*(.*)/, "$1") || "0"; +} +function _normalizeIPv4(host, protocol) { + var matches = host.match(protocol.IPV4ADDRESS) || []; - // if the relative url is empty, then there's nothing left to do here. - if (relative.href === '') { - result.href = result.format(); - return result; - } + var _matches = slicedToArray(matches, 2), + address = _matches[1]; - // hrefs like //foo/bar always cut to the protocol. - if (relative.slashes && !relative.protocol) { - // take everything except the protocol from relative - var rkeys = Object.keys(relative); - for (var rk = 0; rk < rkeys.length; rk++) { - var rkey = rkeys[rk]; - if (rkey !== 'protocol') - result[rkey] = relative[rkey]; + if (address) { + return address.split(".").map(_stripLeadingZeros).join("."); + } else { + return host; } - - //urlParse appends trailing / to urls like http://www.example.com - if (slashedProtocol[result.protocol] && - result.hostname && !result.pathname) { - result.path = result.pathname = '/'; +} +function _normalizeIPv6(host, protocol) { + var matches = host.match(protocol.IPV6ADDRESS) || []; + + var _matches2 = slicedToArray(matches, 3), + address = _matches2[1], + zone = _matches2[2]; + + if (address) { + var _address$toLowerCase$ = address.toLowerCase().split('::').reverse(), + _address$toLowerCase$2 = slicedToArray(_address$toLowerCase$, 2), + last = _address$toLowerCase$2[0], + first = _address$toLowerCase$2[1]; + + var firstFields = first ? first.split(":").map(_stripLeadingZeros) : []; + var lastFields = last.split(":").map(_stripLeadingZeros); + var isLastFieldIPv4Address = protocol.IPV4ADDRESS.test(lastFields[lastFields.length - 1]); + var fieldCount = isLastFieldIPv4Address ? 7 : 8; + var lastFieldsStart = lastFields.length - fieldCount; + var fields = Array(fieldCount); + for (var x = 0; x < fieldCount; ++x) { + fields[x] = firstFields[x] || lastFields[lastFieldsStart + x] || ''; + } + if (isLastFieldIPv4Address) { + fields[fieldCount - 1] = _normalizeIPv4(fields[fieldCount - 1], protocol); + } + var allZeroFields = fields.reduce(function (acc, field, index) { + if (!field || field === "0") { + var lastLongest = acc[acc.length - 1]; + if (lastLongest && lastLongest.index + lastLongest.length === index) { + lastLongest.length++; + } else { + acc.push({ index: index, length: 1 }); + } + } + return acc; + }, []); + var longestZeroFields = allZeroFields.sort(function (a, b) { + return b.length - a.length; + })[0]; + var newHost = void 0; + if (longestZeroFields && longestZeroFields.length > 1) { + var newFirst = fields.slice(0, longestZeroFields.index); + var newLast = fields.slice(longestZeroFields.index + longestZeroFields.length); + newHost = newFirst.join(":") + "::" + newLast.join(":"); + } else { + newHost = fields.join(":"); + } + if (zone) { + newHost += "%" + zone; + } + return newHost; + } else { + return host; + } +} +var URI_PARSE = /^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i; +var NO_MATCH_IS_UNDEFINED = "".match(/(){0}/)[1] === undefined; +function parse(uriString) { + var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + + var components = {}; + var protocol = options.iri !== false ? IRI_PROTOCOL : URI_PROTOCOL; + if (options.reference === "suffix") uriString = (options.scheme ? options.scheme + ":" : "") + "//" + uriString; + var matches = uriString.match(URI_PARSE); + if (matches) { + if (NO_MATCH_IS_UNDEFINED) { + //store each component + components.scheme = matches[1]; + components.userinfo = matches[3]; + components.host = matches[4]; + components.port = parseInt(matches[5], 10); + components.path = matches[6] || ""; + components.query = matches[7]; + components.fragment = matches[8]; + //fix port number + if (isNaN(components.port)) { + components.port = matches[5]; + } + } else { + //IE FIX for improper RegExp matching + //store each component + components.scheme = matches[1] || undefined; + components.userinfo = uriString.indexOf("@") !== -1 ? matches[3] : undefined; + components.host = uriString.indexOf("//") !== -1 ? matches[4] : undefined; + components.port = parseInt(matches[5], 10); + components.path = matches[6] || ""; + components.query = uriString.indexOf("?") !== -1 ? matches[7] : undefined; + components.fragment = uriString.indexOf("#") !== -1 ? matches[8] : undefined; + //fix port number + if (isNaN(components.port)) { + components.port = uriString.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/) ? matches[4] : undefined; + } + } + if (components.host) { + //normalize IP hosts + components.host = _normalizeIPv6(_normalizeIPv4(components.host, protocol), protocol); + } + //determine reference type + if (components.scheme === undefined && components.userinfo === undefined && components.host === undefined && components.port === undefined && !components.path && components.query === undefined) { + components.reference = "same-document"; + } else if (components.scheme === undefined) { + components.reference = "relative"; + } else if (components.fragment === undefined) { + components.reference = "absolute"; + } else { + components.reference = "uri"; + } + //check for reference errors + if (options.reference && options.reference !== "suffix" && options.reference !== components.reference) { + components.error = components.error || "URI is not a " + options.reference + " reference."; + } + //find scheme handler + var schemeHandler = SCHEMES[(options.scheme || components.scheme || "").toLowerCase()]; + //check if scheme can't handle IRIs + if (!options.unicodeSupport && (!schemeHandler || !schemeHandler.unicodeSupport)) { + //if host component is a domain name + if (components.host && (options.domainHost || schemeHandler && schemeHandler.domainHost)) { + //convert Unicode IDN -> ASCII IDN + try { + components.host = punycode.toASCII(components.host.replace(protocol.PCT_ENCODED, pctDecChars).toLowerCase()); + } catch (e) { + components.error = components.error || "Host's domain name can not be converted to ASCII via punycode: " + e; + } + } + //convert IRI -> URI + _normalizeComponentEncoding(components, URI_PROTOCOL); + } else { + //normalize encodings + _normalizeComponentEncoding(components, protocol); + } + //perform scheme specific parsing + if (schemeHandler && schemeHandler.parse) { + schemeHandler.parse(components, options); + } + } else { + components.error = components.error || "URI can not be parsed."; } + return components; +} - result.href = result.format(); - return result; - } +function _recomposeAuthority(components, options) { + var protocol = options.iri !== false ? IRI_PROTOCOL : URI_PROTOCOL; + var uriTokens = []; + if (components.userinfo !== undefined) { + uriTokens.push(components.userinfo); + uriTokens.push("@"); + } + if (components.host !== undefined) { + //normalize IP hosts, add brackets and escape zone separator for IPv6 + uriTokens.push(_normalizeIPv6(_normalizeIPv4(String(components.host), protocol), protocol).replace(protocol.IPV6ADDRESS, function (_, $1, $2) { + return "[" + $1 + ($2 ? "%25" + $2 : "") + "]"; + })); + } + if (typeof components.port === "number" || typeof components.port === "string") { + uriTokens.push(":"); + uriTokens.push(String(components.port)); + } + return uriTokens.length ? uriTokens.join("") : undefined; +} - if (relative.protocol && relative.protocol !== result.protocol) { - // if it's a known url protocol, then changing - // the protocol does weird things - // first, if it's not file:, then we MUST have a host, - // and if there was a path - // to begin with, then we MUST have a path. - // if it is file:, then the host is dropped, - // because that's known to be hostless. - // anything else is assumed to be absolute. - if (!slashedProtocol[relative.protocol]) { - var keys = Object.keys(relative); - for (var v = 0; v < keys.length; v++) { - var k = keys[v]; - result[k] = relative[k]; - } - result.href = result.format(); - return result; - } - - result.protocol = relative.protocol; - if (!relative.host && !hostlessProtocol[relative.protocol]) { - var relPath = (relative.pathname || '').split('/'); - while (relPath.length && !(relative.host = relPath.shift())); - if (!relative.host) relative.host = ''; - if (!relative.hostname) relative.hostname = ''; - if (relPath[0] !== '') relPath.unshift(''); - if (relPath.length < 2) relPath.unshift(''); - result.pathname = relPath.join('/'); - } else { - result.pathname = relative.pathname; - } - result.search = relative.search; - result.query = relative.query; - result.host = relative.host || ''; - result.auth = relative.auth; - result.hostname = relative.hostname || relative.host; - result.port = relative.port; - // to support http.request - if (result.pathname || result.search) { - var p = result.pathname || ''; - var s = result.search || ''; - result.path = p + s; - } - result.slashes = result.slashes || relative.slashes; - result.href = result.format(); - return result; - } +var RDS1 = /^\.\.?\//; +var RDS2 = /^\/\.(\/|$)/; +var RDS3 = /^\/\.\.(\/|$)/; +var RDS5 = /^\/?(?:.|\n)*?(?=\/|$)/; +function removeDotSegments(input) { + var output = []; + while (input.length) { + if (input.match(RDS1)) { + input = input.replace(RDS1, ""); + } else if (input.match(RDS2)) { + input = input.replace(RDS2, "/"); + } else if (input.match(RDS3)) { + input = input.replace(RDS3, "/"); + output.pop(); + } else if (input === "." || input === "..") { + input = ""; + } else { + var im = input.match(RDS5); + if (im) { + var s = im[0]; + input = input.slice(s.length); + output.push(s); + } else { + throw new Error("Unexpected dot segment condition"); + } + } + } + return output.join(""); +} - var isSourceAbs = (result.pathname && result.pathname.charAt(0) === '/'), - isRelAbs = ( - relative.host || - relative.pathname && relative.pathname.charAt(0) === '/' - ), - mustEndAbs = (isRelAbs || isSourceAbs || - (result.host && relative.pathname)), - removeAllDots = mustEndAbs, - srcPath = result.pathname && result.pathname.split('/') || [], - relPath = relative.pathname && relative.pathname.split('/') || [], - psychotic = result.protocol && !slashedProtocol[result.protocol]; - - // if the url is a non-slashed url, then relative - // links like ../.. should be able - // to crawl up to the hostname, as well. This is strange. - // result.protocol has already been set by now. - // Later on, put the first path part into the host field. - if (psychotic) { - result.hostname = ''; - result.port = null; - if (result.host) { - if (srcPath[0] === '') srcPath[0] = result.host; - else srcPath.unshift(result.host); - } - result.host = ''; - if (relative.protocol) { - relative.hostname = null; - relative.port = null; - if (relative.host) { - if (relPath[0] === '') relPath[0] = relative.host; - else relPath.unshift(relative.host); - } - relative.host = null; - } - mustEndAbs = mustEndAbs && (relPath[0] === '' || srcPath[0] === ''); - } - - if (isRelAbs) { - // it's absolute. - result.host = (relative.host || relative.host === '') ? - relative.host : result.host; - result.hostname = (relative.hostname || relative.hostname === '') ? - relative.hostname : result.hostname; - result.search = relative.search; - result.query = relative.query; - srcPath = relPath; - // fall through to the dot-handling below. - } else if (relPath.length) { - // it's relative - // throw away the existing file, and take the new path instead. - if (!srcPath) srcPath = []; - srcPath.pop(); - srcPath = srcPath.concat(relPath); - result.search = relative.search; - result.query = relative.query; - } else if (!util.isNullOrUndefined(relative.search)) { - // just pull out the search. - // like href='?foo'. - // Put this after the other two cases because it simplifies the booleans - if (psychotic) { - result.hostname = result.host = srcPath.shift(); - //occationaly the auth can get stuck only in host - //this especially happens in cases like - //url.resolveObject('mailto:local1@domain1', 'local2@domain2') - var authInHost = result.host && result.host.indexOf('@') > 0 ? - result.host.split('@') : false; - if (authInHost) { - result.auth = authInHost.shift(); - result.host = result.hostname = authInHost.shift(); - } +function serialize(components) { + var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + + var protocol = options.iri ? IRI_PROTOCOL : URI_PROTOCOL; + var uriTokens = []; + //find scheme handler + var schemeHandler = SCHEMES[(options.scheme || components.scheme || "").toLowerCase()]; + //perform scheme specific serialization + if (schemeHandler && schemeHandler.serialize) schemeHandler.serialize(components, options); + if (components.host) { + //if host component is an IPv6 address + if (protocol.IPV6ADDRESS.test(components.host)) {} + //TODO: normalize IPv6 address as per RFC 5952 + + //if host component is a domain name + else if (options.domainHost || schemeHandler && schemeHandler.domainHost) { + //convert IDN via punycode + try { + components.host = !options.iri ? punycode.toASCII(components.host.replace(protocol.PCT_ENCODED, pctDecChars).toLowerCase()) : punycode.toUnicode(components.host); + } catch (e) { + components.error = components.error || "Host's domain name can not be converted to " + (!options.iri ? "ASCII" : "Unicode") + " via punycode: " + e; + } + } } - result.search = relative.search; - result.query = relative.query; - //to support http.request - if (!util.isNull(result.pathname) || !util.isNull(result.search)) { - result.path = (result.pathname ? result.pathname : '') + - (result.search ? result.search : ''); + //normalize encoding + _normalizeComponentEncoding(components, protocol); + if (options.reference !== "suffix" && components.scheme) { + uriTokens.push(components.scheme); + uriTokens.push(":"); } - result.href = result.format(); - return result; - } + var authority = _recomposeAuthority(components, options); + if (authority !== undefined) { + if (options.reference !== "suffix") { + uriTokens.push("//"); + } + uriTokens.push(authority); + if (components.path && components.path.charAt(0) !== "/") { + uriTokens.push("/"); + } + } + if (components.path !== undefined) { + var s = components.path; + if (!options.absolutePath && (!schemeHandler || !schemeHandler.absolutePath)) { + s = removeDotSegments(s); + } + if (authority === undefined) { + s = s.replace(/^\/\//, "/%2F"); //don't allow the path to start with "//" + } + uriTokens.push(s); + } + if (components.query !== undefined) { + uriTokens.push("?"); + uriTokens.push(components.query); + } + if (components.fragment !== undefined) { + uriTokens.push("#"); + uriTokens.push(components.fragment); + } + return uriTokens.join(""); //merge tokens into a string +} - if (!srcPath.length) { - // no path at all. easy. - // we've already handled the other stuff above. - result.pathname = null; - //to support http.request - if (result.search) { - result.path = '/' + result.search; +function resolveComponents(base, relative) { + var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; + var skipNormalization = arguments[3]; + + var target = {}; + if (!skipNormalization) { + base = parse(serialize(base, options), options); //normalize base components + relative = parse(serialize(relative, options), options); //normalize relative components + } + options = options || {}; + if (!options.tolerant && relative.scheme) { + target.scheme = relative.scheme; + //target.authority = relative.authority; + target.userinfo = relative.userinfo; + target.host = relative.host; + target.port = relative.port; + target.path = removeDotSegments(relative.path || ""); + target.query = relative.query; } else { - result.path = null; + if (relative.userinfo !== undefined || relative.host !== undefined || relative.port !== undefined) { + //target.authority = relative.authority; + target.userinfo = relative.userinfo; + target.host = relative.host; + target.port = relative.port; + target.path = removeDotSegments(relative.path || ""); + target.query = relative.query; + } else { + if (!relative.path) { + target.path = base.path; + if (relative.query !== undefined) { + target.query = relative.query; + } else { + target.query = base.query; + } + } else { + if (relative.path.charAt(0) === "/") { + target.path = removeDotSegments(relative.path); + } else { + if ((base.userinfo !== undefined || base.host !== undefined || base.port !== undefined) && !base.path) { + target.path = "/" + relative.path; + } else if (!base.path) { + target.path = relative.path; + } else { + target.path = base.path.slice(0, base.path.lastIndexOf("/") + 1) + relative.path; + } + target.path = removeDotSegments(target.path); + } + target.query = relative.query; + } + //target.authority = base.authority; + target.userinfo = base.userinfo; + target.host = base.host; + target.port = base.port; + } + target.scheme = base.scheme; } - result.href = result.format(); - return result; - } + target.fragment = relative.fragment; + return target; +} - // if a url ENDs in . or .., then it must get a trailing slash. - // however, if it ends in anything else non-slashy, - // then it must NOT get a trailing slash. - var last = srcPath.slice(-1)[0]; - var hasTrailingSlash = ( - (result.host || relative.host || srcPath.length > 1) && - (last === '.' || last === '..') || last === ''); +function resolve(baseURI, relativeURI, options) { + var schemelessOptions = assign({ scheme: 'null' }, options); + return serialize(resolveComponents(parse(baseURI, schemelessOptions), parse(relativeURI, schemelessOptions), schemelessOptions, true), schemelessOptions); +} - // strip single dots, resolve double dots to parent dir - // if the path tries to go above the root, `up` ends up > 0 - var up = 0; - for (var i = srcPath.length; i >= 0; i--) { - last = srcPath[i]; - if (last === '.') { - srcPath.splice(i, 1); - } else if (last === '..') { - srcPath.splice(i, 1); - up++; - } else if (up) { - srcPath.splice(i, 1); - up--; +function normalize(uri, options) { + if (typeof uri === "string") { + uri = serialize(parse(uri, options), options); + } else if (typeOf(uri) === "object") { + uri = parse(serialize(uri, options), options); } - } + return uri; +} - // if the path is allowed to go above the root, restore leading ..s - if (!mustEndAbs && !removeAllDots) { - for (; up--; up) { - srcPath.unshift('..'); +function equal(uriA, uriB, options) { + if (typeof uriA === "string") { + uriA = serialize(parse(uriA, options), options); + } else if (typeOf(uriA) === "object") { + uriA = serialize(uriA, options); } - } - - if (mustEndAbs && srcPath[0] !== '' && - (!srcPath[0] || srcPath[0].charAt(0) !== '/')) { - srcPath.unshift(''); - } + if (typeof uriB === "string") { + uriB = serialize(parse(uriB, options), options); + } else if (typeOf(uriB) === "object") { + uriB = serialize(uriB, options); + } + return uriA === uriB; +} - if (hasTrailingSlash && (srcPath.join('/').substr(-1) !== '/')) { - srcPath.push(''); - } +function escapeComponent(str, options) { + return str && str.toString().replace(!options || !options.iri ? URI_PROTOCOL.ESCAPE : IRI_PROTOCOL.ESCAPE, pctEncChar); +} - var isAbsolute = srcPath[0] === '' || - (srcPath[0] && srcPath[0].charAt(0) === '/'); +function unescapeComponent(str, options) { + return str && str.toString().replace(!options || !options.iri ? URI_PROTOCOL.PCT_ENCODED : IRI_PROTOCOL.PCT_ENCODED, pctDecChars); +} - // put the host back - if (psychotic) { - result.hostname = result.host = isAbsolute ? '' : - srcPath.length ? srcPath.shift() : ''; - //occationaly the auth can get stuck only in host - //this especially happens in cases like - //url.resolveObject('mailto:local1@domain1', 'local2@domain2') - var authInHost = result.host && result.host.indexOf('@') > 0 ? - result.host.split('@') : false; - if (authInHost) { - result.auth = authInHost.shift(); - result.host = result.hostname = authInHost.shift(); +var handler = { + scheme: "http", + domainHost: true, + parse: function parse(components, options) { + //report missing host + if (!components.host) { + components.error = components.error || "HTTP URIs must have a host."; + } + return components; + }, + serialize: function serialize(components, options) { + var secure = String(components.scheme).toLowerCase() === "https"; + //normalize the default port + if (components.port === (secure ? 443 : 80) || components.port === "") { + components.port = undefined; + } + //normalize the empty path + if (!components.path) { + components.path = "/"; + } + //NOTE: We do not parse query strings for HTTP URIs + //as WWW Form Url Encoded query strings are part of the HTML4+ spec, + //and not the HTTP spec. + return components; } - } - - mustEndAbs = mustEndAbs || (result.host && srcPath.length); +}; - if (mustEndAbs && !isAbsolute) { - srcPath.unshift(''); - } +var handler$1 = { + scheme: "https", + domainHost: handler.domainHost, + parse: handler.parse, + serialize: handler.serialize +}; - if (!srcPath.length) { - result.pathname = null; - result.path = null; - } else { - result.pathname = srcPath.join('/'); - } +function isSecure(wsComponents) { + return typeof wsComponents.secure === 'boolean' ? wsComponents.secure : String(wsComponents.scheme).toLowerCase() === "wss"; +} +//RFC 6455 +var handler$2 = { + scheme: "ws", + domainHost: true, + parse: function parse(components, options) { + var wsComponents = components; + //indicate if the secure flag is set + wsComponents.secure = isSecure(wsComponents); + //construct resouce name + wsComponents.resourceName = (wsComponents.path || '/') + (wsComponents.query ? '?' + wsComponents.query : ''); + wsComponents.path = undefined; + wsComponents.query = undefined; + return wsComponents; + }, + serialize: function serialize(wsComponents, options) { + //normalize the default port + if (wsComponents.port === (isSecure(wsComponents) ? 443 : 80) || wsComponents.port === "") { + wsComponents.port = undefined; + } + //ensure scheme matches secure flag + if (typeof wsComponents.secure === 'boolean') { + wsComponents.scheme = wsComponents.secure ? 'wss' : 'ws'; + wsComponents.secure = undefined; + } + //reconstruct path from resource name + if (wsComponents.resourceName) { + var _wsComponents$resourc = wsComponents.resourceName.split('?'), + _wsComponents$resourc2 = slicedToArray(_wsComponents$resourc, 2), + path = _wsComponents$resourc2[0], + query = _wsComponents$resourc2[1]; + + wsComponents.path = path && path !== '/' ? path : undefined; + wsComponents.query = query; + wsComponents.resourceName = undefined; + } + //forbid fragment component + wsComponents.fragment = undefined; + return wsComponents; + } +}; - //to support request.http - if (!util.isNull(result.pathname) || !util.isNull(result.search)) { - result.path = (result.pathname ? result.pathname : '') + - (result.search ? result.search : ''); - } - result.auth = relative.auth || result.auth; - result.slashes = result.slashes || relative.slashes; - result.href = result.format(); - return result; +var handler$3 = { + scheme: "wss", + domainHost: handler$2.domainHost, + parse: handler$2.parse, + serialize: handler$2.serialize }; -Url.prototype.parseHost = function() { - var host = this.host; - var port = portPattern.exec(host); - if (port) { - port = port[0]; - if (port !== ':') { - this.port = port.substr(1); +var O = {}; +var isIRI = true; +//RFC 3986 +var UNRESERVED$$ = "[A-Za-z0-9\\-\\.\\_\\~" + (isIRI ? "\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF" : "") + "]"; +var HEXDIG$$ = "[0-9A-Fa-f]"; //case-insensitive +var PCT_ENCODED$ = subexp(subexp("%[EFef]" + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$) + "|" + subexp("%[89A-Fa-f]" + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$) + "|" + subexp("%" + HEXDIG$$ + HEXDIG$$)); //expanded +//RFC 5322, except these symbols as per RFC 6068: @ : / ? # [ ] & ; = +//const ATEXT$$ = "[A-Za-z0-9\\!\\#\\$\\%\\&\\'\\*\\+\\-\\/\\=\\?\\^\\_\\`\\{\\|\\}\\~]"; +//const WSP$$ = "[\\x20\\x09]"; +//const OBS_QTEXT$$ = "[\\x01-\\x08\\x0B\\x0C\\x0E-\\x1F\\x7F]"; //(%d1-8 / %d11-12 / %d14-31 / %d127) +//const QTEXT$$ = merge("[\\x21\\x23-\\x5B\\x5D-\\x7E]", OBS_QTEXT$$); //%d33 / %d35-91 / %d93-126 / obs-qtext +//const VCHAR$$ = "[\\x21-\\x7E]"; +//const WSP$$ = "[\\x20\\x09]"; +//const OBS_QP$ = subexp("\\\\" + merge("[\\x00\\x0D\\x0A]", OBS_QTEXT$$)); //%d0 / CR / LF / obs-qtext +//const FWS$ = subexp(subexp(WSP$$ + "*" + "\\x0D\\x0A") + "?" + WSP$$ + "+"); +//const QUOTED_PAIR$ = subexp(subexp("\\\\" + subexp(VCHAR$$ + "|" + WSP$$)) + "|" + OBS_QP$); +//const QUOTED_STRING$ = subexp('\\"' + subexp(FWS$ + "?" + QCONTENT$) + "*" + FWS$ + "?" + '\\"'); +var ATEXT$$ = "[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]"; +var QTEXT$$ = "[\\!\\$\\%\\'\\(\\)\\*\\+\\,\\-\\.0-9\\<\\>A-Z\\x5E-\\x7E]"; +var VCHAR$$ = merge(QTEXT$$, "[\\\"\\\\]"); +var SOME_DELIMS$$ = "[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]"; +var UNRESERVED = new RegExp(UNRESERVED$$, "g"); +var PCT_ENCODED = new RegExp(PCT_ENCODED$, "g"); +var NOT_LOCAL_PART = new RegExp(merge("[^]", ATEXT$$, "[\\.]", '[\\"]', VCHAR$$), "g"); +var NOT_HFNAME = new RegExp(merge("[^]", UNRESERVED$$, SOME_DELIMS$$), "g"); +var NOT_HFVALUE = NOT_HFNAME; +function decodeUnreserved(str) { + var decStr = pctDecChars(str); + return !decStr.match(UNRESERVED) ? str : decStr; +} +var handler$4 = { + scheme: "mailto", + parse: function parse$$1(components, options) { + var mailtoComponents = components; + var to = mailtoComponents.to = mailtoComponents.path ? mailtoComponents.path.split(",") : []; + mailtoComponents.path = undefined; + if (mailtoComponents.query) { + var unknownHeaders = false; + var headers = {}; + var hfields = mailtoComponents.query.split("&"); + for (var x = 0, xl = hfields.length; x < xl; ++x) { + var hfield = hfields[x].split("="); + switch (hfield[0]) { + case "to": + var toAddrs = hfield[1].split(","); + for (var _x = 0, _xl = toAddrs.length; _x < _xl; ++_x) { + to.push(toAddrs[_x]); + } + break; + case "subject": + mailtoComponents.subject = unescapeComponent(hfield[1], options); + break; + case "body": + mailtoComponents.body = unescapeComponent(hfield[1], options); + break; + default: + unknownHeaders = true; + headers[unescapeComponent(hfield[0], options)] = unescapeComponent(hfield[1], options); + break; + } + } + if (unknownHeaders) mailtoComponents.headers = headers; + } + mailtoComponents.query = undefined; + for (var _x2 = 0, _xl2 = to.length; _x2 < _xl2; ++_x2) { + var addr = to[_x2].split("@"); + addr[0] = unescapeComponent(addr[0]); + if (!options.unicodeSupport) { + //convert Unicode IDN -> ASCII IDN + try { + addr[1] = punycode.toASCII(unescapeComponent(addr[1], options).toLowerCase()); + } catch (e) { + mailtoComponents.error = mailtoComponents.error || "Email address's domain name can not be converted to ASCII via punycode: " + e; + } + } else { + addr[1] = unescapeComponent(addr[1], options).toLowerCase(); + } + to[_x2] = addr.join("@"); + } + return mailtoComponents; + }, + serialize: function serialize$$1(mailtoComponents, options) { + var components = mailtoComponents; + var to = toArray(mailtoComponents.to); + if (to) { + for (var x = 0, xl = to.length; x < xl; ++x) { + var toAddr = String(to[x]); + var atIdx = toAddr.lastIndexOf("@"); + var localPart = toAddr.slice(0, atIdx).replace(PCT_ENCODED, decodeUnreserved).replace(PCT_ENCODED, toUpperCase).replace(NOT_LOCAL_PART, pctEncChar); + var domain = toAddr.slice(atIdx + 1); + //convert IDN via punycode + try { + domain = !options.iri ? punycode.toASCII(unescapeComponent(domain, options).toLowerCase()) : punycode.toUnicode(domain); + } catch (e) { + components.error = components.error || "Email address's domain name can not be converted to " + (!options.iri ? "ASCII" : "Unicode") + " via punycode: " + e; + } + to[x] = localPart + "@" + domain; + } + components.path = to.join(","); + } + var headers = mailtoComponents.headers = mailtoComponents.headers || {}; + if (mailtoComponents.subject) headers["subject"] = mailtoComponents.subject; + if (mailtoComponents.body) headers["body"] = mailtoComponents.body; + var fields = []; + for (var name in headers) { + if (headers[name] !== O[name]) { + fields.push(name.replace(PCT_ENCODED, decodeUnreserved).replace(PCT_ENCODED, toUpperCase).replace(NOT_HFNAME, pctEncChar) + "=" + headers[name].replace(PCT_ENCODED, decodeUnreserved).replace(PCT_ENCODED, toUpperCase).replace(NOT_HFVALUE, pctEncChar)); + } + } + if (fields.length) { + components.query = fields.join("&"); + } + return components; } - host = host.substr(0, host.length - port.length); - } - if (host) this.hostname = host; }; -},{"./util":49,"punycode":44,"querystring":47}],49:[function(require,module,exports){ -'use strict'; +var URN_PARSE = /^([^\:]+)\:(.*)/; +//RFC 2141 +var handler$5 = { + scheme: "urn", + parse: function parse$$1(components, options) { + var matches = components.path && components.path.match(URN_PARSE); + var urnComponents = components; + if (matches) { + var scheme = options.scheme || urnComponents.scheme || "urn"; + var nid = matches[1].toLowerCase(); + var nss = matches[2]; + var urnScheme = scheme + ":" + (options.nid || nid); + var schemeHandler = SCHEMES[urnScheme]; + urnComponents.nid = nid; + urnComponents.nss = nss; + urnComponents.path = undefined; + if (schemeHandler) { + urnComponents = schemeHandler.parse(urnComponents, options); + } + } else { + urnComponents.error = urnComponents.error || "URN can not be parsed."; + } + return urnComponents; + }, + serialize: function serialize$$1(urnComponents, options) { + var scheme = options.scheme || urnComponents.scheme || "urn"; + var nid = urnComponents.nid; + var urnScheme = scheme + ":" + (options.nid || nid); + var schemeHandler = SCHEMES[urnScheme]; + if (schemeHandler) { + urnComponents = schemeHandler.serialize(urnComponents, options); + } + var uriComponents = urnComponents; + var nss = urnComponents.nss; + uriComponents.path = (nid || options.nid) + ":" + nss; + return uriComponents; + } +}; -module.exports = { - isString: function(arg) { - return typeof(arg) === 'string'; - }, - isObject: function(arg) { - return typeof(arg) === 'object' && arg !== null; - }, - isNull: function(arg) { - return arg === null; - }, - isNullOrUndefined: function(arg) { - return arg == null; - } +var UUID = /^[0-9A-Fa-f]{8}(?:\-[0-9A-Fa-f]{4}){3}\-[0-9A-Fa-f]{12}$/; +//RFC 4122 +var handler$6 = { + scheme: "urn:uuid", + parse: function parse(urnComponents, options) { + var uuidComponents = urnComponents; + uuidComponents.uuid = uuidComponents.nss; + uuidComponents.nss = undefined; + if (!options.tolerant && (!uuidComponents.uuid || !uuidComponents.uuid.match(UUID))) { + uuidComponents.error = uuidComponents.error || "UUID is not valid."; + } + return uuidComponents; + }, + serialize: function serialize(uuidComponents, options) { + var urnComponents = uuidComponents; + //normalize UUID + urnComponents.nss = (uuidComponents.uuid || "").toLowerCase(); + return urnComponents; + } }; +SCHEMES[handler.scheme] = handler; +SCHEMES[handler$1.scheme] = handler$1; +SCHEMES[handler$2.scheme] = handler$2; +SCHEMES[handler$3.scheme] = handler$3; +SCHEMES[handler$4.scheme] = handler$4; +SCHEMES[handler$5.scheme] = handler$5; +SCHEMES[handler$6.scheme] = handler$6; + +exports.SCHEMES = SCHEMES; +exports.pctEncChar = pctEncChar; +exports.pctDecChars = pctDecChars; +exports.parse = parse; +exports.removeDotSegments = removeDotSegments; +exports.serialize = serialize; +exports.resolveComponents = resolveComponents; +exports.resolve = resolve; +exports.normalize = normalize; +exports.equal = equal; +exports.escapeComponent = escapeComponent; +exports.unescapeComponent = unescapeComponent; + +Object.defineProperty(exports, '__esModule', { value: true }); + +}))); + + },{}],"ajv":[function(require,module,exports){ 'use strict'; @@ -6847,10 +6687,8 @@ var compileSchema = require('./compile') , stableStringify = require('fast-json-stable-stringify') , formats = require('./compile/formats') , rules = require('./compile/rules') - , $dataMetaSchema = require('./$data') - , patternGroups = require('./patternGroups') - , util = require('./compile/util') - , co = require('co'); + , $dataMetaSchema = require('./data') + , util = require('./compile/util'); module.exports = Ajv; @@ -6872,15 +6710,16 @@ var customKeyword = require('./keyword'); Ajv.prototype.addKeyword = customKeyword.add; Ajv.prototype.getKeyword = customKeyword.get; Ajv.prototype.removeKeyword = customKeyword.remove; +Ajv.prototype.validateKeyword = customKeyword.validate; var errorClasses = require('./compile/error_classes'); Ajv.ValidationError = errorClasses.Validation; Ajv.MissingRefError = errorClasses.MissingRef; Ajv.$dataMetaSchema = $dataMetaSchema; -var META_SCHEMA_ID = 'http://json-schema.org/draft-06/schema'; +var META_SCHEMA_ID = 'http://json-schema.org/draft-07/schema'; -var META_IGNORE_OPTIONS = [ 'removeAdditional', 'useDefaults', 'coerceTypes' ]; +var META_IGNORE_OPTIONS = [ 'removeAdditional', 'useDefaults', 'coerceTypes', 'strictDefaults' ]; var META_SUPPORT_DATA = ['/properties']; /** @@ -6897,8 +6736,6 @@ function Ajv(opts) { this._refs = {}; this._fragments = {}; this._formats = formats(opts.format); - var schemaUriFormat = this._schemaUriFormat = this._formats['uri-reference']; - this._schemaUriFormatFunc = function (str) { return schemaUriFormat.test(str); }; this._cache = opts.cache || new Cache; this._loadingSchemas = {}; @@ -6912,10 +6749,11 @@ function Ajv(opts) { this._metaOpts = getMetaSchemaOptions(this); if (opts.formats) addInitialFormats(this); - addDraft6MetaSchema(this); + if (opts.keywords) addInitialKeywords(this); + addDefaultMetaSchema(this); if (typeof opts.meta == 'object') this.addMetaSchema(opts.meta); + if (opts.nullable) this.addKeyword('nullable', {metaSchema: {type: 'boolean'}}); addInitialSchemas(this); - if (opts.patternGroups) patternGroups(this); } @@ -6939,9 +6777,7 @@ function validate(schemaKeyRef, data) { } var valid = v(data); - if (v.$async === true) - return this._opts.async == '*' ? co(valid) : valid; - this.errors = v.errors; + if (v.$async !== true) this.errors = v.errors; return valid; } @@ -7015,13 +6851,7 @@ function validateSchema(schema, throwOrLogError) { this.errors = null; return true; } - var currentUriFormat = this._formats.uri; - this._formats.uri = typeof currentUriFormat == 'function' - ? this._schemaUriFormatFunc - : this._schemaUriFormat; - var valid; - try { valid = this.validate($schema, schema); } - finally { this._formats.uri = currentUriFormat; } + var valid = this.validate($schema, schema); if (!valid && throwOrLogError) { var message = 'schema is invalid: ' + this.errorsText(); if (this._opts.validateSchema == 'log') this.logger.error(message); @@ -7196,6 +7026,10 @@ function _compile(schemaObj, root) { var v; try { v = compileSchema.call(this, schemaObj.schema, root, schemaObj.localRefs); } + catch(e) { + delete schemaObj.validate; + throw e; + } finally { schemaObj.compiling = false; if (schemaObj.meta) this._opts = currentOpts; @@ -7208,9 +7042,11 @@ function _compile(schemaObj, root) { return v; + /* @this {*} - custom context, see passContext option */ function callValidate() { + /* jshint validthis: true */ var _validate = schemaObj.validate; - var result = _validate.apply(null, arguments); + var result = _validate.apply(this, arguments); callValidate.errors = _validate.errors; return result; } @@ -7219,9 +7055,9 @@ function _compile(schemaObj, root) { function chooseGetId(opts) { switch (opts.schemaId) { - case '$id': return _get$Id; + case 'auto': return _get$IdOrId; case 'id': return _getId; - default: return _get$IdOrId; + default: return _get$Id; } } @@ -7282,14 +7118,14 @@ function addFormat(name, format) { } -function addDraft6MetaSchema(self) { +function addDefaultMetaSchema(self) { var $dataSchema; if (self._opts.$data) { - $dataSchema = require('./refs/$data.json'); + $dataSchema = require('./refs/data.json'); self.addMetaSchema($dataSchema, $dataSchema.$id, true); } if (self._opts.meta === false) return; - var metaSchema = require('./refs/json-schema-draft-06.json'); + var metaSchema = require('./refs/json-schema-draft-07.json'); if (self._opts.$data) metaSchema = $dataMetaSchema(metaSchema, META_SUPPORT_DATA); self.addMetaSchema(metaSchema, META_SCHEMA_ID, true); self._refs['http://json-schema.org/schema'] = META_SCHEMA_ID; @@ -7312,6 +7148,14 @@ function addInitialFormats(self) { } +function addInitialKeywords(self) { + for (var name in self._opts.keywords) { + var keyword = self._opts.keywords[name]; + self.addKeyword(name, keyword); + } +} + + function checkUnique(self, id) { if (self._schemas[id] || self._refs[id]) throw new Error('schema with key or id "' + id + '" already exists'); @@ -7341,5 +7185,5 @@ function setLogger(self) { function noop() {} -},{"./$data":1,"./cache":2,"./compile":7,"./compile/async":4,"./compile/error_classes":5,"./compile/formats":6,"./compile/resolve":8,"./compile/rules":9,"./compile/schema_obj":10,"./compile/util":12,"./keyword":36,"./patternGroups":37,"./refs/$data.json":38,"./refs/json-schema-draft-06.json":39,"co":40,"fast-json-stable-stringify":42}]},{},[])("ajv") -}); \ No newline at end of file +},{"./cache":1,"./compile":5,"./compile/async":2,"./compile/error_classes":3,"./compile/formats":4,"./compile/resolve":6,"./compile/rules":7,"./compile/schema_obj":8,"./compile/util":10,"./data":11,"./keyword":39,"./refs/data.json":40,"./refs/json-schema-draft-07.json":41,"fast-json-stable-stringify":43}]},{},[])("ajv") +}); diff --git a/deps/npm/node_modules/ajv/dist/ajv.min.js b/deps/npm/node_modules/ajv/dist/ajv.min.js index f5267c9a5ab86a..d02ec10a7feaee 100644 --- a/deps/npm/node_modules/ajv/dist/ajv.min.js +++ b/deps/npm/node_modules/ajv/dist/ajv.min.js @@ -1,3 +1,3 @@ -/* ajv 5.5.2: Another JSON Schema Validator */ -!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).Ajv=e()}}(function(){return function e(r,t,a){function s(i,n){if(!t[i]){if(!r[i]){var l="function"==typeof require&&require;if(!n&&l)return l(i,!0);if(o)return o(i,!0);var h=new Error("Cannot find module '"+i+"'");throw h.code="MODULE_NOT_FOUND",h}var u=t[i]={exports:{}};r[i][0].call(u.exports,function(e){var t=r[i][1][e];return s(t||e)},u,u.exports,e,r,t,a)}return t[i].exports}for(var o="function"==typeof require&&require,i=0;i=1&&t<=12&&a>=1&&a<=h[t]}function o(e,r){var t=e.match(u);if(!t)return!1;return t[1]<=23&&t[2]<=59&&t[3]<=59&&(!r||t[5])}function i(e){if(E.test(e))return!1;try{return new RegExp(e),!0}catch(e){return!1}}var n=e("./util"),l=/^\d\d\d\d-(\d\d)-(\d\d)$/,h=[0,31,29,31,30,31,30,31,31,30,31,30,31],u=/^(\d\d):(\d\d):(\d\d)(\.\d+)?(z|[+-]\d\d:\d\d)?$/i,c=/^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*$/i,d=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,f=/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,p=/^(?:(?:http[s\u017F]?|ftp):\/\/)(?:(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+(?::(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?@)?(?:(?!10(?:\.[0-9]{1,3}){3})(?!127(?:\.[0-9]{1,3}){3})(?!169\.254(?:\.[0-9]{1,3}){2})(?!192\.168(?:\.[0-9]{1,3}){2})(?!172\.(?:1[6-9]|2[0-9]|3[01])(?:\.[0-9]{1,3}){2})(?:[1-9][0-9]?|1[0-9][0-9]|2[01][0-9]|22[0-3])(?:\.(?:1?[0-9]{1,2}|2[0-4][0-9]|25[0-5])){2}(?:\.(?:[1-9][0-9]?|1[0-9][0-9]|2[0-4][0-9]|25[0-4]))|(?:(?:(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-?)*(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)(?:\.(?:(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-?)*(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)*(?:\.(?:(?:[KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]){2,})))(?::[0-9]{2,5})?(?:\/(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?$/i,m=/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,v=/^(?:\/(?:[^~/]|~0|~1)*)*$|^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,y=/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/;r.exports=a,a.fast={date:/^\d\d\d\d-[0-1]\d-[0-3]\d$/,time:/^[0-2]\d:[0-5]\d:[0-5]\d(?:\.\d+)?(?:z|[+-]\d\d:\d\d)?$/i,"date-time":/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s][0-2]\d:[0-5]\d:[0-5]\d(?:\.\d+)?(?:z|[+-]\d\d:\d\d)$/i,uri:/^(?:[a-z][a-z0-9+-.]*)(?::|\/)\/?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+-.]*:)?\/\/)?[^\s]*$/i,"uri-template":f,url:p,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i,hostname:c,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,ipv6:/^\s*(?:(?:(?:[0-9a-f]{1,4}:){7}(?:[0-9a-f]{1,4}|:))|(?:(?:[0-9a-f]{1,4}:){6}(?::[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){5}(?:(?:(?::[0-9a-f]{1,4}){1,2})|:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){4}(?:(?:(?::[0-9a-f]{1,4}){1,3})|(?:(?::[0-9a-f]{1,4})?:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){3}(?:(?:(?::[0-9a-f]{1,4}){1,4})|(?:(?::[0-9a-f]{1,4}){0,2}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){2}(?:(?:(?::[0-9a-f]{1,4}){1,5})|(?:(?::[0-9a-f]{1,4}){0,3}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){1}(?:(?:(?::[0-9a-f]{1,4}){1,6})|(?:(?::[0-9a-f]{1,4}){0,4}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?::(?:(?:(?::[0-9a-f]{1,4}){1,7})|(?:(?::[0-9a-f]{1,4}){0,5}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(?:%.+)?\s*$/i,regex:i,uuid:m,"json-pointer":v,"relative-json-pointer":y},a.full={date:s,time:o,"date-time":function(e){var r=e.split(g);return 2==r.length&&s(r[0])&&o(r[1],!0)},uri:function(e){return P.test(e)&&d.test(e)},"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":f,url:p,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&''*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:function(e){return e.length<=255&&c.test(e)},ipv4:/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,ipv6:/^\s*(?:(?:(?:[0-9a-f]{1,4}:){7}(?:[0-9a-f]{1,4}|:))|(?:(?:[0-9a-f]{1,4}:){6}(?::[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){5}(?:(?:(?::[0-9a-f]{1,4}){1,2})|:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){4}(?:(?:(?::[0-9a-f]{1,4}){1,3})|(?:(?::[0-9a-f]{1,4})?:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){3}(?:(?:(?::[0-9a-f]{1,4}){1,4})|(?:(?::[0-9a-f]{1,4}){0,2}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){2}(?:(?:(?::[0-9a-f]{1,4}){1,5})|(?:(?::[0-9a-f]{1,4}){0,3}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){1}(?:(?:(?::[0-9a-f]{1,4}){1,6})|(?:(?::[0-9a-f]{1,4}){0,4}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?::(?:(?:(?::[0-9a-f]{1,4}){1,7})|(?:(?::[0-9a-f]{1,4}){0,5}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(?:%.+)?\s*$/i,regex:i,uuid:m,"json-pointer":v,"relative-json-pointer":y};var g=/t|\s/i,P=/\/|:/,E=/[^\\]\\Z/},{"./util":12}],7:[function(e,r,t){"use strict";function a(e,r,t,P){function E(){var e=C.validate,r=e.apply(null,arguments);return E.errors=e.errors,r}function w(e,t,s,f){var P=!t||t&&t.schema==e;if(t.schema!=r.schema)return a.call($,e,t,s,f);var E=!0===e.$async,w=p({isTop:!0,schema:e,isRoot:P,baseId:f,root:t,schemaPath:"",errSchemaPath:"#",errorPath:'""',MissingRefError:d.MissingRef,RULES:U,validate:p,util:c,resolve:u,resolveRef:b,usePattern:_,useDefault:x,useCustomRule:F,opts:R,formats:Q,logger:$.logger,self:$});w=h(O,n)+h(I,o)+h(k,i)+h(L,l)+w,R.processCode&&(w=R.processCode(w));var S;try{S=new Function("self","RULES","formats","root","refVal","defaults","customRules","co","equal","ucs2length","ValidationError",w)($,U,Q,r,O,k,L,m,y,v,g),O[0]=S}catch(e){throw $.logger.error("Error compiling schema, function code:",w),e}return S.schema=e,S.errors=null,S.refs=D,S.refVal=O,S.root=P?S:t,E&&(S.$async=!0),!0===R.sourceCode&&(S.source={code:w,patterns:I,defaults:k}),S}function b(e,s,o){s=u.url(e,s);var i,n,l=D[s];if(void 0!==l)return i=O[l],n="refVal["+l+"]",j(i,n);if(!o&&r.refs){var h=r.refs[s];if(void 0!==h)return i=r.refVal[h],n=S(s,i),j(i,n)}n=S(s);var c=u.call($,w,r,s);if(void 0===c){var d=t&&t[s];d&&(c=u.inlineRef(d,R.inlineRefs)?d:a.call($,d,r,t,e))}if(void 0!==c)return function(e,r){O[D[e]]=r}(s,c),j(c,n);!function(e){delete D[e]}(s)}function S(e,r){var t=O.length;return O[t]=r,D[e]=t,"refVal"+t}function j(e,r){return"object"==typeof e||"boolean"==typeof e?{code:r,schema:e,inline:!0}:{code:r,$async:e&&e.$async}}function _(e){var r=A[e];return void 0===r&&(r=A[e]=I.length,I[r]=e),"pattern"+r}function x(e){switch(typeof e){case"boolean":case"number":return""+e;case"string":return c.toQuotedString(e);case"object":if(null===e)return"null";var r=f(e),t=q[r];return void 0===t&&(t=q[r]=k.length,k[t]=e),"default"+t}}function F(e,r,t,a){var s=e.definition.validateSchema;if(s&&!1!==$._opts.validateSchema){if(!s(r)){var o="keyword schema is invalid: "+$.errorsText(s.errors);if("log"!=$._opts.validateSchema)throw new Error(o);$.logger.error(o)}}var i,n=e.definition.compile,l=e.definition.inline,h=e.definition.macro;if(n)i=n.call($,r,t,a);else if(h)i=h.call($,r,t,a),!1!==R.validateSchema&&$.validateSchema(i,!0);else if(l)i=l.call($,a,e.keyword,r,t);else if(!(i=e.definition.validate))return;if(void 0===i)throw new Error('custom keyword "'+e.keyword+'"failed to compile');var u=L.length;return L[u]=i,{code:"customRule"+u,validate:i}}var $=this,R=this._opts,O=[void 0],D={},I=[],A={},k=[],q={},L=[],z=function(e,r,t){var a=s.call(this,e,r,t);return a>=0?{index:a,compiling:!0}:(a=this._compilations.length,this._compilations[a]={schema:e,root:r,baseId:t},{index:a,compiling:!1})}.call(this,e,r=r||{schema:e,refVal:O,refs:D},P),C=this._compilations[z.index];if(z.compiling)return C.callValidate=E;var Q=this._formats,U=this.RULES;try{var V=w(e,r,t,P);C.validate=V;var N=C.callValidate;return N&&(N.schema=V.schema,N.errors=null,N.refs=V.refs,N.refVal=V.refVal,N.root=V.root,N.$async=V.$async,R.sourceCode&&(N.source=V.source)),V}finally{(function(e,r,t){var a=s.call(this,e,r,t);a>=0&&this._compilations.splice(a,1)}).call(this,e,r,P)}}function s(e,r,t){for(var a=0;a=55296&&r<=56319&&s=r)throw new Error("Cannot access property/index "+a+" levels up, current level is "+r);return t[r-a]}if(a>r)throw new Error("Cannot access data "+a+" levels up, current level is "+r);if(i="data"+(r-a||""),!s)return i}for(var l=i,h=s.split("/"),c=0;c",y=f?">":"<",g=void 0;if(e.opts.$data&&m&&m.$data){var P=e.util.getData(m.$data,i,e.dataPathArr),E="exclusive"+o,w="exclType"+o,b="exclIsNumber"+o,S="' + "+(_="op"+o)+" + '";s+=" var schemaExcl"+o+" = "+P+"; ",s+=" var "+E+"; var "+w+" = typeof "+(P="schemaExcl"+o)+"; if ("+w+" != 'boolean' && "+w+" != 'undefined' && "+w+" != 'number') { ";g=p;(x=x||[]).push(s),s="",!1!==e.createErrors?(s+=" { keyword: '"+(g||"_exclusiveLimit")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(h)+" , params: {} ",!1!==e.opts.messages&&(s+=" , message: '"+p+" should be boolean' "),e.opts.verbose&&(s+=" , schema: validate.schema"+l+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),s+=" } "):s+=" {} ";var j=s;s=x.pop(),s+=!e.compositeRule&&u?e.async?" throw new ValidationError(["+j+"]); ":" validate.errors = ["+j+"]; return false; ":" var err = "+j+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",s+=" } else if ( ",d&&(s+=" ("+a+" !== undefined && typeof "+a+" != 'number') || "),s+=" "+w+" == 'number' ? ( ("+E+" = "+a+" === undefined || "+P+" "+v+"= "+a+") ? "+c+" "+y+"= "+P+" : "+c+" "+y+" "+a+" ) : ( ("+E+" = "+P+" === true) ? "+c+" "+y+"= "+a+" : "+c+" "+y+" "+a+" ) || "+c+" !== "+c+") { var op"+o+" = "+E+" ? '"+v+"' : '"+v+"=';"}else{S=v;if((b="number"==typeof m)&&d){var _="'"+S+"'";s+=" if ( ",d&&(s+=" ("+a+" !== undefined && typeof "+a+" != 'number') || "),s+=" ( "+a+" === undefined || "+m+" "+v+"= "+a+" ? "+c+" "+y+"= "+m+" : "+c+" "+y+" "+a+" ) || "+c+" !== "+c+") { "}else{b&&void 0===n?(E=!0,g=p,h=e.errSchemaPath+"/"+p,a=m,y+="="):(b&&(a=Math[f?"min":"max"](m,n)),m===(!b||a)?(E=!0,g=p,h=e.errSchemaPath+"/"+p,y+="="):(E=!1,S+="="));_="'"+S+"'";s+=" if ( ",d&&(s+=" ("+a+" !== undefined && typeof "+a+" != 'number') || "),s+=" "+c+" "+y+" "+a+" || "+c+" !== "+c+") { "}}g=g||r;var x;(x=x||[]).push(s),s="",!1!==e.createErrors?(s+=" { keyword: '"+(g||"_limit")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(h)+" , params: { comparison: "+_+", limit: "+a+", exclusive: "+E+" } ",!1!==e.opts.messages&&(s+=" , message: 'should be "+S+" ",s+=d?"' + "+a:a+"'"),e.opts.verbose&&(s+=" , schema: ",s+=d?"validate.schema"+l:""+n,s+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),s+=" } "):s+=" {} ";j=s;return s=x.pop(),s+=!e.compositeRule&&u?e.async?" throw new ValidationError(["+j+"]); ":" validate.errors = ["+j+"]; return false; ":" var err = "+j+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",s+=" } ",u&&(s+=" else { "),s}},{}],14:[function(e,r,t){"use strict";r.exports=function(e,r,t){var a,s=" ",o=e.level,i=e.dataLevel,n=e.schema[r],l=e.schemaPath+e.util.getProperty(r),h=e.errSchemaPath+"/"+r,u=!e.opts.allErrors,c="data"+(i||""),d=e.opts.$data&&n&&n.$data;d?(s+=" var schema"+o+" = "+e.util.getData(n.$data,i,e.dataPathArr)+"; ",a="schema"+o):a=n;s+="if ( ",d&&(s+=" ("+a+" !== undefined && typeof "+a+" != 'number') || "),s+=" "+c+".length "+("maxItems"==r?">":"<")+" "+a+") { ";var f=r,p=p||[];p.push(s),s="",!1!==e.createErrors?(s+=" { keyword: '"+(f||"_limitItems")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(h)+" , params: { limit: "+a+" } ",!1!==e.opts.messages&&(s+=" , message: 'should NOT have ",s+="maxItems"==r?"more":"less",s+=" than ",s+=d?"' + "+a+" + '":""+n,s+=" items' "),e.opts.verbose&&(s+=" , schema: ",s+=d?"validate.schema"+l:""+n,s+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),s+=" } "):s+=" {} ";var m=s;return s=p.pop(),s+=!e.compositeRule&&u?e.async?" throw new ValidationError(["+m+"]); ":" validate.errors = ["+m+"]; return false; ":" var err = "+m+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",s+="} ",u&&(s+=" else { "),s}},{}],15:[function(e,r,t){"use strict";r.exports=function(e,r,t){var a,s=" ",o=e.level,i=e.dataLevel,n=e.schema[r],l=e.schemaPath+e.util.getProperty(r),h=e.errSchemaPath+"/"+r,u=!e.opts.allErrors,c="data"+(i||""),d=e.opts.$data&&n&&n.$data;d?(s+=" var schema"+o+" = "+e.util.getData(n.$data,i,e.dataPathArr)+"; ",a="schema"+o):a=n;s+="if ( ",d&&(s+=" ("+a+" !== undefined && typeof "+a+" != 'number') || "),s+=!1===e.opts.unicode?" "+c+".length ":" ucs2length("+c+") ",s+=" "+("maxLength"==r?">":"<")+" "+a+") { ";var f=r,p=p||[];p.push(s),s="",!1!==e.createErrors?(s+=" { keyword: '"+(f||"_limitLength")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(h)+" , params: { limit: "+a+" } ",!1!==e.opts.messages&&(s+=" , message: 'should NOT be ",s+="maxLength"==r?"longer":"shorter",s+=" than ",s+=d?"' + "+a+" + '":""+n,s+=" characters' "),e.opts.verbose&&(s+=" , schema: ",s+=d?"validate.schema"+l:""+n,s+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),s+=" } "):s+=" {} ";var m=s;return s=p.pop(),s+=!e.compositeRule&&u?e.async?" throw new ValidationError(["+m+"]); ":" validate.errors = ["+m+"]; return false; ":" var err = "+m+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",s+="} ",u&&(s+=" else { "),s}},{}],16:[function(e,r,t){"use strict";r.exports=function(e,r,t){var a,s=" ",o=e.level,i=e.dataLevel,n=e.schema[r],l=e.schemaPath+e.util.getProperty(r),h=e.errSchemaPath+"/"+r,u=!e.opts.allErrors,c="data"+(i||""),d=e.opts.$data&&n&&n.$data;d?(s+=" var schema"+o+" = "+e.util.getData(n.$data,i,e.dataPathArr)+"; ",a="schema"+o):a=n;s+="if ( ",d&&(s+=" ("+a+" !== undefined && typeof "+a+" != 'number') || "),s+=" Object.keys("+c+").length "+("maxProperties"==r?">":"<")+" "+a+") { ";var f=r,p=p||[];p.push(s),s="",!1!==e.createErrors?(s+=" { keyword: '"+(f||"_limitProperties")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(h)+" , params: { limit: "+a+" } ",!1!==e.opts.messages&&(s+=" , message: 'should NOT have ",s+="maxProperties"==r?"more":"less",s+=" than ",s+=d?"' + "+a+" + '":""+n,s+=" properties' "),e.opts.verbose&&(s+=" , schema: ",s+=d?"validate.schema"+l:""+n,s+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),s+=" } "):s+=" {} ";var m=s;return s=p.pop(),s+=!e.compositeRule&&u?e.async?" throw new ValidationError(["+m+"]); ":" validate.errors = ["+m+"]; return false; ":" var err = "+m+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",s+="} ",u&&(s+=" else { "),s}},{}],17:[function(e,r,t){"use strict";r.exports=function(e,r,t){var a=" ",s=e.schema[r],o=e.schemaPath+e.util.getProperty(r),i=e.errSchemaPath+"/"+r,n=!e.opts.allErrors,l=e.util.copy(e),h="";l.level++;var u="valid"+l.level,c=l.baseId,d=!0,f=s;if(f)for(var p,m=-1,v=f.length-1;m=0)return h&&(a+=" if (true) { "),a;throw new Error('unknown format "'+i+'" is used in schema at path "'+e.errSchemaPath+'"')}var v,y=(v="object"==typeof m&&!(m instanceof RegExp)&&m.validate)&&m.type||"string";if(v){var g=!0===m.async;m=m.validate}if(y!=t)return h&&(a+=" if (true) { "),a;if(g){if(!e.async)throw new Error("async format in sync schema");var P="formats"+e.util.getProperty(i)+".validate";a+=" if (!("+e.yieldAwait+" "+P+"("+u+"))) { "}else{a+=" if (! ";P="formats"+e.util.getProperty(i);v&&(P+=".validate"),a+="function"==typeof m?" "+P+"("+u+") ":" "+P+".test("+u+") ",a+=") { "}}var E=E||[];E.push(a),a="",!1!==e.createErrors?(a+=" { keyword: 'format' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { format: ",a+=d?""+c:""+e.util.toQuotedString(i),a+=" } ",!1!==e.opts.messages&&(a+=" , message: 'should match format \"",a+=d?"' + "+c+" + '":""+e.util.escapeQuotes(i),a+="\"' "),e.opts.verbose&&(a+=" , schema: ",a+=d?"validate.schema"+n:""+e.util.toQuotedString(i),a+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+u+" "),a+=" } "):a+=" {} ";var w=a;return a=E.pop(),a+=!e.compositeRule&&h?e.async?" throw new ValidationError(["+w+"]); ":" validate.errors = ["+w+"]; return false; ":" var err = "+w+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",a+=" } ",h&&(a+=" else { "),a}},{}],25:[function(e,r,t){"use strict";r.exports=function(e,r,t){var a=" ",s=e.level,o=e.dataLevel,i=e.schema[r],n=e.schemaPath+e.util.getProperty(r),l=e.errSchemaPath+"/"+r,h=!e.opts.allErrors,u="data"+(o||""),c="valid"+s,d="errs__"+s,f=e.util.copy(e),p="";f.level++;var m="valid"+f.level,v="i"+s,y=f.dataLevel=e.dataLevel+1,g="data"+y,P=e.baseId;if(a+="var "+d+" = errors;var "+c+";",Array.isArray(i)){var E=e.schema.additionalItems;if(!1===E){a+=" "+c+" = "+u+".length <= "+i.length+"; ";var w=l;l=e.errSchemaPath+"/additionalItems",a+=" if (!"+c+") { ";var b=b||[];b.push(a),a="",!1!==e.createErrors?(a+=" { keyword: 'additionalItems' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { limit: "+i.length+" } ",!1!==e.opts.messages&&(a+=" , message: 'should NOT have more than "+i.length+" items' "),e.opts.verbose&&(a+=" , schema: false , parentSchema: validate.schema"+e.schemaPath+" , data: "+u+" "),a+=" } "):a+=" {} ";var S=a;a=b.pop(),a+=!e.compositeRule&&h?e.async?" throw new ValidationError(["+S+"]); ":" validate.errors = ["+S+"]; return false; ":" var err = "+S+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",a+=" } ",l=w,h&&(p+="}",a+=" else { ")}var j=i;if(j)for(var _,x=-1,F=j.length-1;x "+x+") { ";var $=u+"["+x+"]";f.schema=_,f.schemaPath=n+"["+x+"]",f.errSchemaPath=l+"/"+x,f.errorPath=e.util.getPathExpr(e.errorPath,x,e.opts.jsonPointers,!0),f.dataPathArr[y]=x;var R=e.validate(f);f.baseId=P,e.util.varOccurences(R,g)<2?a+=" "+e.util.varReplace(R,g,$)+" ":a+=" var "+g+" = "+$+"; "+R+" ",a+=" } ",h&&(a+=" if ("+m+") { ",p+="}")}if("object"==typeof E&&e.util.schemaHasRules(E,e.RULES.all)){f.schema=E,f.schemaPath=e.schemaPath+".additionalItems",f.errSchemaPath=e.errSchemaPath+"/additionalItems",a+=" "+m+" = true; if ("+u+".length > "+i.length+") { for (var "+v+" = "+i.length+"; "+v+" < "+u+".length; "+v+"++) { ",f.errorPath=e.util.getPathExpr(e.errorPath,v,e.opts.jsonPointers,!0);$=u+"["+v+"]";f.dataPathArr[y]=v;R=e.validate(f);f.baseId=P,e.util.varOccurences(R,g)<2?a+=" "+e.util.varReplace(R,g,$)+" ":a+=" var "+g+" = "+$+"; "+R+" ",h&&(a+=" if (!"+m+") break; "),a+=" } } ",h&&(a+=" if ("+m+") { ",p+="}")}}else if(e.util.schemaHasRules(i,e.RULES.all)){f.schema=i,f.schemaPath=n,f.errSchemaPath=l,a+=" for (var "+v+" = 0; "+v+" < "+u+".length; "+v+"++) { ",f.errorPath=e.util.getPathExpr(e.errorPath,v,e.opts.jsonPointers,!0);$=u+"["+v+"]";f.dataPathArr[y]=v;R=e.validate(f);f.baseId=P,e.util.varOccurences(R,g)<2?a+=" "+e.util.varReplace(R,g,$)+" ":a+=" var "+g+" = "+$+"; "+R+" ",h&&(a+=" if (!"+m+") break; "),a+=" }"}return h&&(a+=" "+p+" if ("+d+" == errors) {"),a=e.util.cleanUpCode(a)}},{}],26:[function(e,r,t){"use strict";r.exports=function(e,r,t){var a,s=" ",o=e.level,i=e.dataLevel,n=e.schema[r],l=e.schemaPath+e.util.getProperty(r),h=e.errSchemaPath+"/"+r,u=!e.opts.allErrors,c="data"+(i||""),d=e.opts.$data&&n&&n.$data;d?(s+=" var schema"+o+" = "+e.util.getData(n.$data,i,e.dataPathArr)+"; ",a="schema"+o):a=n,s+="var division"+o+";if (",d&&(s+=" "+a+" !== undefined && ( typeof "+a+" != 'number' || "),s+=" (division"+o+" = "+c+" / "+a+", ",s+=e.opts.multipleOfPrecision?" Math.abs(Math.round(division"+o+") - division"+o+") > 1e-"+e.opts.multipleOfPrecision+" ":" division"+o+" !== parseInt(division"+o+") ",s+=" ) ",d&&(s+=" ) "),s+=" ) { ";var f=f||[];f.push(s),s="",!1!==e.createErrors?(s+=" { keyword: 'multipleOf' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(h)+" , params: { multipleOf: "+a+" } ",!1!==e.opts.messages&&(s+=" , message: 'should be multiple of ",s+=d?"' + "+a:a+"'"),e.opts.verbose&&(s+=" , schema: ",s+=d?"validate.schema"+l:""+n,s+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),s+=" } "):s+=" {} ";var p=s;return s=f.pop(),s+=!e.compositeRule&&u?e.async?" throw new ValidationError(["+p+"]); ":" validate.errors = ["+p+"]; return false; ":" var err = "+p+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",s+="} ",u&&(s+=" else { "),s}},{}],27:[function(e,r,t){"use strict";r.exports=function(e,r,t){var a=" ",s=e.level,o=e.dataLevel,i=e.schema[r],n=e.schemaPath+e.util.getProperty(r),l=e.errSchemaPath+"/"+r,h=!e.opts.allErrors,u="data"+(o||""),c="errs__"+s,d=e.util.copy(e);d.level++;var f="valid"+d.level;if(e.util.schemaHasRules(i,e.RULES.all)){d.schema=i,d.schemaPath=n,d.errSchemaPath=l,a+=" var "+c+" = errors; ";var p=e.compositeRule;e.compositeRule=d.compositeRule=!0,d.createErrors=!1;var m;d.opts.allErrors&&(m=d.opts.allErrors,d.opts.allErrors=!1),a+=" "+e.validate(d)+" ",d.createErrors=!0,m&&(d.opts.allErrors=m),e.compositeRule=d.compositeRule=p,a+=" if ("+f+") { ";var v=v||[];v.push(a),a="",!1!==e.createErrors?(a+=" { keyword: 'not' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: {} ",!1!==e.opts.messages&&(a+=" , message: 'should NOT be valid' "),e.opts.verbose&&(a+=" , schema: validate.schema"+n+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+u+" "),a+=" } "):a+=" {} ";var y=a;a=v.pop(),a+=!e.compositeRule&&h?e.async?" throw new ValidationError(["+y+"]); ":" validate.errors = ["+y+"]; return false; ":" var err = "+y+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",a+=" } else { errors = "+c+"; if (vErrors !== null) { if ("+c+") vErrors.length = "+c+"; else vErrors = null; } ",e.opts.allErrors&&(a+=" } ")}else a+=" var err = ",!1!==e.createErrors?(a+=" { keyword: 'not' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: {} ",!1!==e.opts.messages&&(a+=" , message: 'should NOT be valid' "),e.opts.verbose&&(a+=" , schema: validate.schema"+n+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+u+" "),a+=" } "):a+=" {} ",a+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",h&&(a+=" if (false) { ");return a}},{}],28:[function(e,r,t){"use strict";r.exports=function(e,r,t){var a=" ",s=e.level,o=e.dataLevel,i=e.schema[r],n=e.schemaPath+e.util.getProperty(r),l=e.errSchemaPath+"/"+r,h=!e.opts.allErrors,u="data"+(o||""),c="valid"+s,d="errs__"+s,f=e.util.copy(e),p="";f.level++;var m="valid"+f.level;a+="var "+d+" = errors;var prevValid"+s+" = false;var "+c+" = false;";var v=f.baseId,y=e.compositeRule;e.compositeRule=f.compositeRule=!0;var g=i;if(g)for(var P,E=-1,w=g.length-1;E5)a+=" || validate.schema"+n+"["+v+"] ";else{var L=w;if(L)for(var z=-1,C=L.length-1;z= "+ve+"; ",l=e.errSchemaPath+"/patternGroups/minimum",a+=" if (!"+c+") { ";(we=we||[]).push(a),a="",!1!==e.createErrors?(a+=" { keyword: 'patternGroups' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { reason: '"+Pe+"', limit: "+ge+", pattern: '"+e.util.escapeQuotes(ce)+"' } ",!1!==e.opts.messages&&(a+=" , message: 'should NOT have "+Ee+" than "+ge+' properties matching pattern "'+e.util.escapeQuotes(ce)+"\"' "),e.opts.verbose&&(a+=" , schema: validate.schema"+n+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+u+" "),a+=" } "):a+=" {} ";B=a;a=we.pop(),a+=!e.compositeRule&&h?e.async?" throw new ValidationError(["+B+"]); ":" validate.errors = ["+B+"]; return false; ":" var err = "+B+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",a+=" } ",void 0!==ye&&(a+=" else ")}if(void 0!==ye){ge=ye,Pe="maximum",Ee="more";a+=" "+c+" = pgPropCount"+s+" <= "+ye+"; ",l=e.errSchemaPath+"/patternGroups/maximum",a+=" if (!"+c+") { ";var we;(we=we||[]).push(a),a="",!1!==e.createErrors?(a+=" { keyword: 'patternGroups' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { reason: '"+Pe+"', limit: "+ge+", pattern: '"+e.util.escapeQuotes(ce)+"' } ",!1!==e.opts.messages&&(a+=" , message: 'should NOT have "+Ee+" than "+ge+' properties matching pattern "'+e.util.escapeQuotes(ce)+"\"' "),e.opts.verbose&&(a+=" , schema: validate.schema"+n+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+u+" "),a+=" } "):a+=" {} ";B=a;a=we.pop(),a+=!e.compositeRule&&h?e.async?" throw new ValidationError(["+B+"]); ":" validate.errors = ["+B+"]; return false; ":" var err = "+B+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",a+=" } "}l=K,h&&(a+=" if ("+c+") { ",p+="}")}}}}return h&&(a+=" "+p+" if ("+d+" == errors) {"),a=e.util.cleanUpCode(a)}},{}],31:[function(e,r,t){"use strict";r.exports=function(e,r,t){var a=" ",s=e.level,o=e.dataLevel,i=e.schema[r],n=e.schemaPath+e.util.getProperty(r),l=e.errSchemaPath+"/"+r,h=!e.opts.allErrors,u="data"+(o||""),c="errs__"+s,d=e.util.copy(e);d.level++;var f="valid"+d.level;if(e.util.schemaHasRules(i,e.RULES.all)){d.schema=i,d.schemaPath=n,d.errSchemaPath=l;var p="key"+s,m="idx"+s,v="i"+s,y="' + "+p+" + '",g="data"+(d.dataLevel=e.dataLevel+1),P="dataProperties"+s,E=e.opts.ownProperties,w=e.baseId;a+=" var "+c+" = errors; ",E&&(a+=" var "+P+" = undefined; "),a+=E?" "+P+" = "+P+" || Object.keys("+u+"); for (var "+m+"=0; "+m+"<"+P+".length; "+m+"++) { var "+p+" = "+P+"["+m+"]; ":" for (var "+p+" in "+u+") { ",a+=" var startErrs"+s+" = errors; ";var b=p,S=e.compositeRule;e.compositeRule=d.compositeRule=!0;var j=e.validate(d);d.baseId=w,e.util.varOccurences(j,g)<2?a+=" "+e.util.varReplace(j,g,b)+" ":a+=" var "+g+" = "+b+"; "+j+" ",e.compositeRule=d.compositeRule=S,a+=" if (!"+f+") { for (var "+v+"=startErrs"+s+"; "+v+"=e.opts.loopRequired,b=e.opts.ownProperties;if(h)if(a+=" var missing"+s+"; ",w){d||(a+=" var "+f+" = validate.schema"+n+"; ");var S="' + "+(R="schema"+s+"["+(x="i"+s)+"]")+" + '";e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPathExpr(E,R,e.opts.jsonPointers)),a+=" var "+c+" = true; ",d&&(a+=" if (schema"+s+" === undefined) "+c+" = true; else if (!Array.isArray(schema"+s+")) "+c+" = false; else {"),a+=" for (var "+x+" = 0; "+x+" < "+f+".length; "+x+"++) { "+c+" = "+u+"["+f+"["+x+"]] !== undefined ",b&&(a+=" && Object.prototype.hasOwnProperty.call("+u+", "+f+"["+x+"]) "),a+="; if (!"+c+") break; } ",d&&(a+=" } "),a+=" if (!"+c+") { ";($=$||[]).push(a),a="",!1!==e.createErrors?(a+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { missingProperty: '"+S+"' } ",!1!==e.opts.messages&&(a+=" , message: '",a+=e.opts._errorDataPathProperty?"is a required property":"should have required property \\'"+S+"\\'",a+="' "),e.opts.verbose&&(a+=" , schema: validate.schema"+n+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+u+" "),a+=" } "):a+=" {} ";var j=a;a=$.pop(),a+=!e.compositeRule&&h?e.async?" throw new ValidationError(["+j+"]); ":" validate.errors = ["+j+"]; return false; ":" var err = "+j+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",a+=" } else { "}else{a+=" if ( ";var _=p;if(_)for(var x=-1,F=_.length-1;x 1) { var i = "+c+".length, j; outer: for (;i--;) { for (j = i; j--;) { if (equal("+c+"[i], "+c+"[j])) { "+d+" = false; break outer; } } } } ",f&&(s+=" } "),s+=" if (!"+d+") { ";var p=p||[];p.push(s),s="",!1!==e.createErrors?(s+=" { keyword: 'uniqueItems' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(h)+" , params: { i: i, j: j } ",!1!==e.opts.messages&&(s+=" , message: 'should NOT have duplicate items (items ## ' + j + ' and ' + i + ' are identical)' "),e.opts.verbose&&(s+=" , schema: ",s+=f?"validate.schema"+l:""+n,s+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),s+=" } "):s+=" {} ";var m=s;s=p.pop(),s+=!e.compositeRule&&u?e.async?" throw new ValidationError(["+m+"]); ":" validate.errors = ["+m+"]; return false; ":" var err = "+m+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",s+=" } ",u&&(s+=" else { ")}else u&&(s+=" if (true) { ");return s}},{}],35:[function(e,r,t){"use strict";r.exports=function(e,r,t){function a(e){for(var r=e.rules,t=0;t2&&(r=n.call(arguments,1)),t(r)})})}.call(this,e):Array.isArray(e)?function(e){return Promise.all(e.map(s,this))}.call(this,e):function(e){return Object==e.constructor}(e)?function(e){for(var r=new e.constructor,t=Object.keys(e),a=[],i=0;i1&&(a=t[0]+"@",e=t[1]);return a+o((e=e.replace(O,".")).split("."),r).join(".")}function n(e){for(var r,t,a=[],s=0,o=e.length;s=55296&&r<=56319&&s65535&&(r+=k((e-=65536)>>>10&1023|55296),e=56320|1023&e),r+=k(e)}).join("")}function h(e){return e-48<10?e-22:e-65<26?e-65:e-97<26?e-97:E}function u(e,r){return e+22+75*(e<26)-((0!=r)<<5)}function c(e,r,t){var a=0;for(e=t?A(e/j):e>>1,e+=A(e/r);e>I*b>>1;a+=E)e=A(e/I);return A(a+(I+1)*e/(e+S))}function d(e){var r,t,a,o,i,n,u,d,f,p,m=[],v=e.length,y=0,g=x,S=_;for((t=e.lastIndexOf(F))<0&&(t=0),a=0;a=128&&s("not-basic"),m.push(e.charCodeAt(a));for(o=t>0?t+1:0;o=v&&s("invalid-input"),((d=h(e.charCodeAt(o++)))>=E||d>A((P-y)/n))&&s("overflow"),y+=d*n,f=u<=S?w:u>=S+b?b:u-S,!(dA(P/(p=E-f))&&s("overflow"),n*=p;S=c(y-i,r=m.length+1,0==i),A(y/r)>P-g&&s("overflow"),g+=A(y/r),y%=r,m.splice(y++,0,g)}return l(m)}function f(e){var r,t,a,o,i,l,h,d,f,p,m,v,y,g,S,j=[];for(v=(e=n(e)).length,r=x,t=0,i=_,l=0;l=r&&mA((P-t)/(y=a+1))&&s("overflow"),t+=(h-r)*y,r=h,l=0;lP&&s("overflow"),m==r){for(d=t,f=E;p=f<=i?w:f>=i+b?b:f-i,!(d= 0x80 (not a basic code point)","invalid-input":"Invalid input"},I=E-w,A=Math.floor,k=String.fromCharCode;if(y={version:"1.4.1",ucs2:{decode:n,encode:l},decode:d,encode:f,toASCII:function(e){return i(e,function(e){return R.test(e)?"xn--"+f(e):e})},toUnicode:function(e){return i(e,function(e){return $.test(e)?d(e.slice(4).toLowerCase()):e})}},p&&m)if(r.exports==p)m.exports=y;else for(g in y)y.hasOwnProperty(g)&&(p[g]=y[g]);else a.punycode=y}(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],45:[function(e,r,t){"use strict";function a(e,r){return Object.prototype.hasOwnProperty.call(e,r)}r.exports=function(e,r,t,o){r=r||"&",t=t||"=";var i={};if("string"!=typeof e||0===e.length)return i;var n=/\+/g;e=e.split(r);var l=1e3;o&&"number"==typeof o.maxKeys&&(l=o.maxKeys);var h=e.length;l>0&&h>l&&(h=l);for(var u=0;u=0?(c=m.substr(0,v),d=m.substr(v+1)):(c=m,d=""),f=decodeURIComponent(c),p=decodeURIComponent(d),a(i,f)?s(i[f])?i[f].push(p):i[f]=[i[f],p]:i[f]=p}return i};var s=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)}},{}],46:[function(e,r,t){"use strict";function a(e,r){if(e.map)return e.map(r);for(var t=[],a=0;a",'"',"`"," ","\r","\n","\t"]),c=["'"].concat(u),d=["%","/","?",";","#"].concat(c),f=["/","?","#"],p=/^[+a-z0-9A-Z_-]{0,63}$/,m=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,v={javascript:!0,"javascript:":!0},y={javascript:!0,"javascript:":!0},g={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},P=e("querystring");a.prototype.parse=function(e,r,t){if(!i.isString(e))throw new TypeError("Parameter 'url' must be a string, not "+typeof e);var a=e.indexOf("?"),s=-1!==a&&a127?A+="x":A+=I[k];if(!A.match(p)){var L=O.slice(0,_),z=O.slice(_+1),C=I.match(m);C&&(L.push(C[1]),z.unshift(C[2])),z.length&&(u="/"+z.join(".")+u),this.hostname=L.join(".");break}}}this.hostname=this.hostname.length>255?"":this.hostname.toLowerCase(),R||(this.hostname=o.toASCII(this.hostname));var Q=this.port?":"+this.port:"";this.host=(this.hostname||"")+Q,this.href+=this.host,R&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==u[0]&&(u="/"+u))}if(!v[b])for(_=0,D=c.length;_0)&&t.host.split("@"))&&(t.auth=$.shift(),t.host=t.hostname=$.shift())}return t.search=e.search,t.query=e.query,i.isNull(t.pathname)&&i.isNull(t.search)||(t.path=(t.pathname?t.pathname:"")+(t.search?t.search:"")),t.href=t.format(),t}if(!w.length)return t.pathname=null,t.path=t.search?"/"+t.search:null,t.href=t.format(),t;for(var S=w.slice(-1)[0],j=(t.host||e.host||w.length>1)&&("."===S||".."===S)||""===S,_=0,x=w.length;x>=0;x--)"."===(S=w[x])?w.splice(x,1):".."===S?(w.splice(x,1),_++):_&&(w.splice(x,1),_--);if(!P&&!E)for(;_--;_)w.unshift("..");!P||""===w[0]||w[0]&&"/"===w[0].charAt(0)||w.unshift(""),j&&"/"!==w.join("/").substr(-1)&&w.push("");var F=""===w[0]||w[0]&&"/"===w[0].charAt(0);if(b){t.hostname=t.host=F?"":w.length?w.shift():"";var $;($=!!(t.host&&t.host.indexOf("@")>0)&&t.host.split("@"))&&(t.auth=$.shift(),t.host=t.hostname=$.shift())}return(P=P||t.host&&w.length)&&!F&&w.unshift(""),w.length?t.pathname=w.join("/"):(t.pathname=null,t.path=null),i.isNull(t.pathname)&&i.isNull(t.search)||(t.path=(t.pathname?t.pathname:"")+(t.search?t.search:"")),t.auth=e.auth||t.auth,t.slashes=t.slashes||e.slashes,t.href=t.format(),t},a.prototype.parseHost=function(){var e=this.host,r=l.exec(e);r&&(":"!==(r=r[0])&&(this.port=r.substr(1)),e=e.substr(0,e.length-r.length)),e&&(this.hostname=e)}},{"./util":49,punycode:44,querystring:47}],49:[function(e,r,t){"use strict";r.exports={isString:function(e){return"string"==typeof e},isObject:function(e){return"object"==typeof e&&null!==e},isNull:function(e){return null===e},isNullOrUndefined:function(e){return null==e}}},{}],ajv:[function(e,r,t){"use strict";function a(r){if(!(this instanceof a))return new a(r);r=this._opts=E.copy(r)||{},function(e){var r=e._opts.logger;if(!1===r)e.logger={log:u,warn:u,error:u};else{if(void 0===r&&(r=console),!("object"==typeof r&&r.log&&r.warn&&r.error))throw new Error("logger must implement log, warn and error methods");e.logger=r}}(this),this._schemas={},this._refs={},this._fragments={},this._formats=v(r.format);var t=this._schemaUriFormat=this._formats["uri-reference"];this._schemaUriFormatFunc=function(e){return t.test(e)},this._cache=r.cache||new f,this._loadingSchemas={},this._compilations=[],this.RULES=y(),this._getId=function(e){switch(e.schemaId){case"$id":return n;case"id":return i;default:return l}}(r),r.loopRequired=r.loopRequired||1/0,"property"==r.errorDataPath&&(r._errorDataPathProperty=!0),void 0===r.serialize&&(r.serialize=m),this._metaOpts=function(e){for(var r=E.copy(e._opts),t=0;t<_.length;t++)delete r[_[t]];return r}(this),r.formats&&function(e){for(var r in e._opts.formats){var t=e._opts.formats[r];e.addFormat(r,t)}}(this),function(r){var t;r._opts.$data&&(t=e("./refs/$data.json"),r.addMetaSchema(t,t.$id,!0));if(!1===r._opts.meta)return;var a=e("./refs/json-schema-draft-06.json");r._opts.$data&&(a=g(a,x));r.addMetaSchema(a,j,!0),r._refs["http://json-schema.org/schema"]=j}(this),"object"==typeof r.meta&&this.addMetaSchema(r.meta),function(e){var r=e._opts.schemas;if(!r)return;if(Array.isArray(r))e.addSchema(r);else for(var t in r)e.addSchema(r[t],t)}(this),r.patternGroups&&P(this)}function s(e,r){return r=d.normalizeId(r),e._schemas[r]||e._refs[r]||e._fragments[r]}function o(e,r,t){for(var a in r){var s=r[a];s.meta||t&&!t.test(a)||(e._cache.del(s.cacheKey),delete r[a])}}function i(e){return e.$id&&this.logger.warn("schema $id ignored",e.$id),e.id}function n(e){return e.id&&this.logger.warn("schema id ignored",e.id),e.$id}function l(e){if(e.$id&&e.id&&e.$id!=e.id)throw new Error("schema $id is different from id");return e.$id||e.id}function h(e,r){if(e._schemas[r]||e._refs[r])throw new Error('schema with key or id "'+r+'" already exists')}function u(){}var c=e("./compile"),d=e("./compile/resolve"),f=e("./cache"),p=e("./compile/schema_obj"),m=e("fast-json-stable-stringify"),v=e("./compile/formats"),y=e("./compile/rules"),g=e("./$data"),P=e("./patternGroups"),E=e("./compile/util"),w=e("co");r.exports=a,a.prototype.validate=function(e,r){var t;if("string"==typeof e){if(!(t=this.getSchema(e)))throw new Error('no schema with key or ref "'+e+'"')}else{var a=this._addSchema(e);t=a.validate||this._compile(a)}var s=t(r);return!0===t.$async?"*"==this._opts.async?w(s):s:(this.errors=t.errors,s)},a.prototype.compile=function(e,r){var t=this._addSchema(e,void 0,r);return t.validate||this._compile(t)},a.prototype.addSchema=function(e,r,t,a){if(Array.isArray(e)){for(var s=0;s%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,u=/^(?:(?:http[s\u017F]?|ftp):\/\/)(?:(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+(?::(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?@)?(?:(?!10(?:\.[0-9]{1,3}){3})(?!127(?:\.[0-9]{1,3}){3})(?!169\.254(?:\.[0-9]{1,3}){2})(?!192\.168(?:\.[0-9]{1,3}){2})(?!172\.(?:1[6-9]|2[0-9]|3[01])(?:\.[0-9]{1,3}){2})(?:[1-9][0-9]?|1[0-9][0-9]|2[01][0-9]|22[0-3])(?:\.(?:1?[0-9]{1,2}|2[0-4][0-9]|25[0-5])){2}(?:\.(?:[1-9][0-9]?|1[0-9][0-9]|2[0-4][0-9]|25[0-4]))|(?:(?:(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-?)*(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)(?:\.(?:(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-?)*(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)*(?:\.(?:(?:[KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]){2,})))(?::[0-9]{2,5})?(?:\/(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?$/i,h=/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,d=/^(?:\/(?:[^~/]|~0|~1)*)*$/,p=/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,f=/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/;function m(e){return a.copy(m[e="full"==e?"full":"fast"])}function v(e){var r=e.match(o);if(!r)return!1;var t,a=+r[2],s=+r[3];return 1<=a&&a<=12&&1<=s&&s<=(2!=a||((t=+r[1])%4!=0||t%100==0&&t%400!=0)?i[a]:29)}function y(e,r){var t=e.match(n);if(!t)return!1;var a=t[1],s=t[2],o=t[3];return(a<=23&&s<=59&&o<=59||23==a&&59==s&&60==o)&&(!r||t[5])}(r.exports=m).fast={date:/^\d\d\d\d-[0-1]\d-[0-3]\d$/,time:/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,"date-time":/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,"uri-template":c,url:u,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i,hostname:s,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,ipv6:/^\s*(?:(?:(?:[0-9a-f]{1,4}:){7}(?:[0-9a-f]{1,4}|:))|(?:(?:[0-9a-f]{1,4}:){6}(?::[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){5}(?:(?:(?::[0-9a-f]{1,4}){1,2})|:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){4}(?:(?:(?::[0-9a-f]{1,4}){1,3})|(?:(?::[0-9a-f]{1,4})?:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){3}(?:(?:(?::[0-9a-f]{1,4}){1,4})|(?:(?::[0-9a-f]{1,4}){0,2}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){2}(?:(?:(?::[0-9a-f]{1,4}){1,5})|(?:(?::[0-9a-f]{1,4}){0,3}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){1}(?:(?:(?::[0-9a-f]{1,4}){1,6})|(?:(?::[0-9a-f]{1,4}){0,4}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?::(?:(?:(?::[0-9a-f]{1,4}){1,7})|(?:(?::[0-9a-f]{1,4}){0,5}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(?:%.+)?\s*$/i,regex:w,uuid:h,"json-pointer":d,"json-pointer-uri-fragment":p,"relative-json-pointer":f},m.full={date:v,time:y,"date-time":function(e){var r=e.split(g);return 2==r.length&&v(r[0])&&y(r[1],!0)},uri:function(e){return P.test(e)&&l.test(e)},"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":c,url:u,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:s,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,ipv6:/^\s*(?:(?:(?:[0-9a-f]{1,4}:){7}(?:[0-9a-f]{1,4}|:))|(?:(?:[0-9a-f]{1,4}:){6}(?::[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){5}(?:(?:(?::[0-9a-f]{1,4}){1,2})|:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){4}(?:(?:(?::[0-9a-f]{1,4}){1,3})|(?:(?::[0-9a-f]{1,4})?:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){3}(?:(?:(?::[0-9a-f]{1,4}){1,4})|(?:(?::[0-9a-f]{1,4}){0,2}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){2}(?:(?:(?::[0-9a-f]{1,4}){1,5})|(?:(?::[0-9a-f]{1,4}){0,3}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){1}(?:(?:(?::[0-9a-f]{1,4}){1,6})|(?:(?::[0-9a-f]{1,4}){0,4}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?::(?:(?:(?::[0-9a-f]{1,4}){1,7})|(?:(?::[0-9a-f]{1,4}){0,5}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(?:%.+)?\s*$/i,regex:w,uuid:h,"json-pointer":d,"json-pointer-uri-fragment":p,"relative-json-pointer":f};var g=/t|\s/i;var P=/\/|:/;var E=/[^\\]\\Z/;function w(e){if(E.test(e))return!1;try{return new RegExp(e),!0}catch(e){return!1}}},{"./util":10}],5:[function(e,r,t){"use strict";var R=e("./resolve"),$=e("./util"),j=e("./error_classes"),D=e("fast-json-stable-stringify"),O=e("../dotjs/validate"),I=$.ucs2length,A=e("fast-deep-equal"),k=j.Validation;function C(e,c,u,r){var d=this,p=this._opts,h=[void 0],f={},l=[],t={},m=[],a={},v=[],s=function(e,r,t){var a=L.call(this,e,r,t);return 0<=a?{index:a,compiling:!0}:{index:a=this._compilations.length,compiling:!(this._compilations[a]={schema:e,root:r,baseId:t})}}.call(this,e,c=c||{schema:e,refVal:h,refs:f},r),o=this._compilations[s.index];if(s.compiling)return o.callValidate=P;var y=this._formats,g=this.RULES;try{var i=E(e,c,u,r);o.validate=i;var n=o.callValidate;return n&&(n.schema=i.schema,n.errors=null,n.refs=i.refs,n.refVal=i.refVal,n.root=i.root,n.$async=i.$async,p.sourceCode&&(n.source=i.source)),i}finally{(function(e,r,t){var a=L.call(this,e,r,t);0<=a&&this._compilations.splice(a,1)}).call(this,e,c,r)}function P(){var e=o.validate,r=e.apply(this,arguments);return P.errors=e.errors,r}function E(e,r,t,a){var s=!r||r&&r.schema==e;if(r.schema!=c.schema)return C.call(d,e,r,t,a);var o=!0===e.$async,i=O({isTop:!0,schema:e,isRoot:s,baseId:a,root:r,schemaPath:"",errSchemaPath:"#",errorPath:'""',MissingRefError:j.MissingRef,RULES:g,validate:O,util:$,resolve:R,resolveRef:w,usePattern:_,useDefault:F,useCustomRule:x,opts:p,formats:y,logger:d.logger,self:d}),i=Q(h,z)+Q(l,N)+Q(m,q)+Q(v,T)+i;p.processCode&&(i=p.processCode(i,e));try{var n=new Function("self","RULES","formats","root","refVal","defaults","customRules","equal","ucs2length","ValidationError",i)(d,g,y,c,h,m,v,A,I,k);h[0]=n}catch(e){throw d.logger.error("Error compiling schema, function code:",i),e}return n.schema=e,n.errors=null,n.refs=f,n.refVal=h,n.root=s?n:r,o&&(n.$async=!0),!0===p.sourceCode&&(n.source={code:i,patterns:l,defaults:m}),n}function w(e,r,t){r=R.url(e,r);var a,s,o=f[r];if(void 0!==o)return S(a=h[o],s="refVal["+o+"]");if(!t&&c.refs){var i=c.refs[r];if(void 0!==i)return S(a=c.refVal[i],s=b(r,a))}s=b(r);var n,l=R.call(d,E,c,r);if(void 0!==l||(n=u&&u[r])&&(l=R.inlineRef(n,p.inlineRefs)?n:C.call(d,n,c,u,e)),void 0!==l)return S(h[f[r]]=l,s);delete f[r]}function b(e,r){var t=h.length;return h[t]=r,"refVal"+(f[e]=t)}function S(e,r){return"object"==typeof e||"boolean"==typeof e?{code:r,schema:e,inline:!0}:{code:r,$async:e&&!!e.$async}}function _(e){var r=t[e];return void 0===r&&(r=t[e]=l.length,l[r]=e),"pattern"+r}function F(e){switch(typeof e){case"boolean":case"number":return""+e;case"string":return $.toQuotedString(e);case"object":if(null===e)return"null";var r=D(e),t=a[r];return void 0===t&&(t=a[r]=m.length,m[t]=e),"default"+t}}function x(e,r,t,a){if(!1!==d._opts.validateSchema){var s=e.definition.dependencies;if(s&&!s.every(function(e){return Object.prototype.hasOwnProperty.call(t,e)}))throw new Error("parent schema must have all required keywords: "+s.join(","));var o=e.definition.validateSchema;if(o)if(!o(r)){var i="keyword schema is invalid: "+d.errorsText(o.errors);if("log"!=d._opts.validateSchema)throw new Error(i);d.logger.error(i)}}var n,l=e.definition.compile,c=e.definition.inline,u=e.definition.macro;if(l)n=l.call(d,r,t,a);else if(u)n=u.call(d,r,t,a),!1!==p.validateSchema&&d.validateSchema(n,!0);else if(c)n=c.call(d,a,e.keyword,r,t);else if(!(n=e.definition.validate))return;if(void 0===n)throw new Error('custom keyword "'+e.keyword+'"failed to compile');var h=v.length;return{code:"customRule"+h,validate:v[h]=n}}}function L(e,r,t){for(var a=0;a",_=P?">":"<",F=void 0;if(!y&&"number"!=typeof d&&void 0!==d)throw new Error(r+" must be number");if(!b&&void 0!==w&&"number"!=typeof w&&"boolean"!=typeof w)throw new Error(E+" must be number or boolean");b?(o="exclIsNumber"+u,i="' + "+(n="op"+u)+" + '",c+=" var schemaExcl"+u+" = "+(t=e.util.getData(w.$data,h,e.dataPathArr))+"; ",F=E,(l=l||[]).push(c+=" var "+(a="exclusive"+u)+"; var "+(s="exclType"+u)+" = typeof "+(t="schemaExcl"+u)+"; if ("+s+" != 'boolean' && "+s+" != 'undefined' && "+s+" != 'number') { "),c="",!1!==e.createErrors?(c+=" { keyword: '"+(F||"_exclusiveLimit")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(f)+" , params: {} ",!1!==e.opts.messages&&(c+=" , message: '"+E+" should be boolean' "),e.opts.verbose&&(c+=" , schema: validate.schema"+p+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+v+" "),c+=" } "):c+=" {} ",x=c,c=l.pop(),c+=!e.compositeRule&&m?e.async?" throw new ValidationError(["+x+"]); ":" validate.errors = ["+x+"]; return false; ":" var err = "+x+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",c+=" } else if ( ",y&&(c+=" ("+g+" !== undefined && typeof "+g+" != 'number') || "),c+=" "+s+" == 'number' ? ( ("+a+" = "+g+" === undefined || "+t+" "+S+"= "+g+") ? "+v+" "+_+"= "+t+" : "+v+" "+_+" "+g+" ) : ( ("+a+" = "+t+" === true) ? "+v+" "+_+"= "+g+" : "+v+" "+_+" "+g+" ) || "+v+" !== "+v+") { var op"+u+" = "+a+" ? '"+S+"' : '"+S+"='; ",void 0===d&&(f=e.errSchemaPath+"/"+(F=E),g=t,y=b)):(i=S,(o="number"==typeof w)&&y?(n="'"+i+"'",c+=" if ( ",y&&(c+=" ("+g+" !== undefined && typeof "+g+" != 'number') || "),c+=" ( "+g+" === undefined || "+w+" "+S+"= "+g+" ? "+v+" "+_+"= "+w+" : "+v+" "+_+" "+g+" ) || "+v+" !== "+v+") { "):(o&&void 0===d?(a=!0,f=e.errSchemaPath+"/"+(F=E),g=w,_+="="):(o&&(g=Math[P?"min":"max"](w,d)),w===(!o||g)?(a=!0,f=e.errSchemaPath+"/"+(F=E),_+="="):(a=!1,i+="=")),n="'"+i+"'",c+=" if ( ",y&&(c+=" ("+g+" !== undefined && typeof "+g+" != 'number') || "),c+=" "+v+" "+_+" "+g+" || "+v+" !== "+v+") { ")),F=F||r,(l=l||[]).push(c),c="",!1!==e.createErrors?(c+=" { keyword: '"+(F||"_limit")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(f)+" , params: { comparison: "+n+", limit: "+g+", exclusive: "+a+" } ",!1!==e.opts.messages&&(c+=" , message: 'should be "+i+" ",c+=y?"' + "+g:g+"'"),e.opts.verbose&&(c+=" , schema: ",c+=y?"validate.schema"+p:""+d,c+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+v+" "),c+=" } "):c+=" {} ";var x=c;return c=l.pop(),c+=!e.compositeRule&&m?e.async?" throw new ValidationError(["+x+"]); ":" validate.errors = ["+x+"]; return false; ":" var err = "+x+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",c+=" } ",m&&(c+=" else { "),c}},{}],14:[function(e,r,t){"use strict";r.exports=function(e,r){var t=" ",a=e.level,s=e.dataLevel,o=e.schema[r],i=e.schemaPath+e.util.getProperty(r),n=e.errSchemaPath+"/"+r,l=!e.opts.allErrors,c="data"+(s||""),u=e.opts.$data&&o&&o.$data,h=u?(t+=" var schema"+a+" = "+e.util.getData(o.$data,s,e.dataPathArr)+"; ","schema"+a):o;if(!u&&"number"!=typeof o)throw new Error(r+" must be number");t+="if ( ",u&&(t+=" ("+h+" !== undefined && typeof "+h+" != 'number') || ");var d=r,p=p||[];p.push(t+=" "+c+".length "+("maxItems"==r?">":"<")+" "+h+") { "),t="",!1!==e.createErrors?(t+=" { keyword: '"+(d||"_limitItems")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(n)+" , params: { limit: "+h+" } ",!1!==e.opts.messages&&(t+=" , message: 'should NOT have ",t+="maxItems"==r?"more":"fewer",t+=" than ",t+=u?"' + "+h+" + '":""+o,t+=" items' "),e.opts.verbose&&(t+=" , schema: ",t+=u?"validate.schema"+i:""+o,t+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),t+=" } "):t+=" {} ";var f=t,t=p.pop();return t+=!e.compositeRule&&l?e.async?" throw new ValidationError(["+f+"]); ":" validate.errors = ["+f+"]; return false; ":" var err = "+f+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",t+="} ",l&&(t+=" else { "),t}},{}],15:[function(e,r,t){"use strict";r.exports=function(e,r){var t=" ",a=e.level,s=e.dataLevel,o=e.schema[r],i=e.schemaPath+e.util.getProperty(r),n=e.errSchemaPath+"/"+r,l=!e.opts.allErrors,c="data"+(s||""),u=e.opts.$data&&o&&o.$data,h=u?(t+=" var schema"+a+" = "+e.util.getData(o.$data,s,e.dataPathArr)+"; ","schema"+a):o;if(!u&&"number"!=typeof o)throw new Error(r+" must be number");t+="if ( ",u&&(t+=" ("+h+" !== undefined && typeof "+h+" != 'number') || "),t+=!1===e.opts.unicode?" "+c+".length ":" ucs2length("+c+") ";var d=r,p=p||[];p.push(t+=" "+("maxLength"==r?">":"<")+" "+h+") { "),t="",!1!==e.createErrors?(t+=" { keyword: '"+(d||"_limitLength")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(n)+" , params: { limit: "+h+" } ",!1!==e.opts.messages&&(t+=" , message: 'should NOT be ",t+="maxLength"==r?"longer":"shorter",t+=" than ",t+=u?"' + "+h+" + '":""+o,t+=" characters' "),e.opts.verbose&&(t+=" , schema: ",t+=u?"validate.schema"+i:""+o,t+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),t+=" } "):t+=" {} ";var f=t,t=p.pop();return t+=!e.compositeRule&&l?e.async?" throw new ValidationError(["+f+"]); ":" validate.errors = ["+f+"]; return false; ":" var err = "+f+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",t+="} ",l&&(t+=" else { "),t}},{}],16:[function(e,r,t){"use strict";r.exports=function(e,r){var t=" ",a=e.level,s=e.dataLevel,o=e.schema[r],i=e.schemaPath+e.util.getProperty(r),n=e.errSchemaPath+"/"+r,l=!e.opts.allErrors,c="data"+(s||""),u=e.opts.$data&&o&&o.$data,h=u?(t+=" var schema"+a+" = "+e.util.getData(o.$data,s,e.dataPathArr)+"; ","schema"+a):o;if(!u&&"number"!=typeof o)throw new Error(r+" must be number");t+="if ( ",u&&(t+=" ("+h+" !== undefined && typeof "+h+" != 'number') || ");var d=r,p=p||[];p.push(t+=" Object.keys("+c+").length "+("maxProperties"==r?">":"<")+" "+h+") { "),t="",!1!==e.createErrors?(t+=" { keyword: '"+(d||"_limitProperties")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(n)+" , params: { limit: "+h+" } ",!1!==e.opts.messages&&(t+=" , message: 'should NOT have ",t+="maxProperties"==r?"more":"fewer",t+=" than ",t+=u?"' + "+h+" + '":""+o,t+=" properties' "),e.opts.verbose&&(t+=" , schema: ",t+=u?"validate.schema"+i:""+o,t+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),t+=" } "):t+=" {} ";var f=t,t=p.pop();return t+=!e.compositeRule&&l?e.async?" throw new ValidationError(["+f+"]); ":" validate.errors = ["+f+"]; return false; ":" var err = "+f+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",t+="} ",l&&(t+=" else { "),t}},{}],17:[function(e,r,t){"use strict";r.exports=function(e,r){var t=" ",a=e.schema[r],s=e.schemaPath+e.util.getProperty(r),o=e.errSchemaPath+"/"+r,i=!e.opts.allErrors,n=e.util.copy(e),l="";n.level++;var c="valid"+n.level,u=n.baseId,h=!0,d=a;if(d)for(var p,f=-1,m=d.length-1;f "+_+") { ",x=c+"["+_+"]",d.schema=$,d.schemaPath=i+"["+_+"]",d.errSchemaPath=n+"/"+_,d.errorPath=e.util.getPathExpr(e.errorPath,_,e.opts.jsonPointers,!0),d.dataPathArr[v]=_,R=e.validate(d),d.baseId=g,e.util.varOccurences(R,y)<2?t+=" "+e.util.varReplace(R,y,x)+" ":t+=" var "+y+" = "+x+"; "+R+" ",t+=" } ",l&&(t+=" if ("+f+") { ",p+="}"))}"object"==typeof b&&(e.opts.strictKeywords?"object"==typeof b&&0 "+o.length+") { for (var "+m+" = "+o.length+"; "+m+" < "+c+".length; "+m+"++) { ",d.errorPath=e.util.getPathExpr(e.errorPath,m,e.opts.jsonPointers,!0),x=c+"["+m+"]",d.dataPathArr[v]=m,R=e.validate(d),d.baseId=g,e.util.varOccurences(R,y)<2?t+=" "+e.util.varReplace(R,y,x)+" ":t+=" var "+y+" = "+x+"; "+R+" ",l&&(t+=" if (!"+f+") break; "),t+=" } } ",l&&(t+=" if ("+f+") { ",p+="}"))}else{(e.opts.strictKeywords?"object"==typeof o&&0 1e-"+e.opts.multipleOfPrecision+" ":" division"+a+" !== parseInt(division"+a+") ",t+=" ) ",u&&(t+=" ) ");var d=d||[];d.push(t+=" ) { "),t="",!1!==e.createErrors?(t+=" { keyword: 'multipleOf' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(n)+" , params: { multipleOf: "+h+" } ",!1!==e.opts.messages&&(t+=" , message: 'should be multiple of ",t+=u?"' + "+h:h+"'"),e.opts.verbose&&(t+=" , schema: ",t+=u?"validate.schema"+i:""+o,t+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),t+=" } "):t+=" {} ";var p=t,t=d.pop();return t+=!e.compositeRule&&l?e.async?" throw new ValidationError(["+p+"]); ":" validate.errors = ["+p+"]; return false; ":" var err = "+p+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",t+="} ",l&&(t+=" else { "),t}},{}],30:[function(e,r,t){"use strict";r.exports=function(e,r){var t=" ",a=e.level,s=e.dataLevel,o=e.schema[r],i=e.schemaPath+e.util.getProperty(r),n=e.errSchemaPath+"/"+r,l=!e.opts.allErrors,c="data"+(s||""),u="errs__"+a,h=e.util.copy(e);h.level++;var d,p,f,m,v="valid"+h.level;return(e.opts.strictKeywords?"object"==typeof o&&0 1) { ",t=e.schema.items&&e.schema.items.type,a=Array.isArray(t),!t||"object"==t||"array"==t||a&&(0<=t.indexOf("object")||0<=t.indexOf("array"))?i+=" outer: for (;i--;) { for (j = i; j--;) { if (equal("+p+"[i], "+p+"[j])) { "+f+" = false; break outer; } } } ":(i+=" var itemIndices = {}, item; for (;i--;) { var item = "+p+"[i]; ",i+=" if ("+e.util["checkDataType"+(a?"s":"")](t,"item",e.opts.strictNumbers,!0)+") continue; ",a&&(i+=" if (typeof item == 'string') item = '\"' + item; "),i+=" if (typeof itemIndices[item] == 'number') { "+f+" = false; j = itemIndices[item]; break; } itemIndices[item] = i; } "),i+=" } ",m&&(i+=" } "),(s=s||[]).push(i+=" if (!"+f+") { "),i="",!1!==e.createErrors?(i+=" { keyword: 'uniqueItems' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(h)+" , params: { i: i, j: j } ",!1!==e.opts.messages&&(i+=" , message: 'should NOT have duplicate items (items ## ' + j + ' and ' + i + ' are identical)' "),e.opts.verbose&&(i+=" , schema: ",i+=m?"validate.schema"+u:""+c,i+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),i+=" } "):i+=" {} ",o=i,i=s.pop(),i+=!e.compositeRule&&d?e.async?" throw new ValidationError(["+o+"]); ":" validate.errors = ["+o+"]; return false; ":" var err = "+o+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+=" } ",d&&(i+=" else { ")):d&&(i+=" if (true) { "),i}},{}],38:[function(e,r,t){"use strict";r.exports=function(a,e){var r="",t=!0===a.schema.$async,s=a.util.schemaHasRulesExcept(a.schema,a.RULES.all,"$ref"),o=a.self._getId(a.schema);if(a.opts.strictKeywords){var i=a.util.schemaUnknownRules(a.schema,a.RULES.keywords);if(i){var n="unknown keyword: "+i;if("log"!==a.opts.strictKeywords)throw new Error(n);a.logger.warn(n)}}if(a.isTop&&(r+=" var validate = ",t&&(a.async=!0,r+="async "),r+="function(data, dataPath, parentData, parentDataProperty, rootData) { 'use strict'; ",o&&(a.opts.sourceCode||a.opts.processCode)&&(r+=" /*# sourceURL="+o+" */ ")),"boolean"==typeof a.schema||!s&&!a.schema.$ref){var l=a.level,c=a.dataLevel,u=a.schema[e="false schema"],h=a.schemaPath+a.util.getProperty(e),d=a.errSchemaPath+"/"+e,p=!a.opts.allErrors,f="data"+(c||""),m="valid"+l;return!1===a.schema?(a.isTop?p=!0:r+=" var "+m+" = false; ",(U=U||[]).push(r),r="",!1!==a.createErrors?(r+=" { keyword: 'false schema' , dataPath: (dataPath || '') + "+a.errorPath+" , schemaPath: "+a.util.toQuotedString(d)+" , params: {} ",!1!==a.opts.messages&&(r+=" , message: 'boolean schema is false' "),a.opts.verbose&&(r+=" , schema: false , parentSchema: validate.schema"+a.schemaPath+" , data: "+f+" "),r+=" } "):r+=" {} ",D=r,r=U.pop(),r+=!a.compositeRule&&p?a.async?" throw new ValidationError(["+D+"]); ":" validate.errors = ["+D+"]; return false; ":" var err = "+D+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "):r+=a.isTop?t?" return data; ":" validate.errors = null; return true; ":" var "+m+" = true; ",a.isTop&&(r+=" }; return validate; "),r}if(a.isTop){var v=a.isTop,l=a.level=0,c=a.dataLevel=0,f="data";if(a.rootId=a.resolve.fullPath(a.self._getId(a.root.schema)),a.baseId=a.baseId||a.rootId,delete a.isTop,a.dataPathArr=[""],void 0!==a.schema.default&&a.opts.useDefaults&&a.opts.strictDefaults){var y="default is ignored in the schema root";if("log"!==a.opts.strictDefaults)throw new Error(y);a.logger.warn(y)}r+=" var vErrors = null; ",r+=" var errors = 0; ",r+=" if (rootData === undefined) rootData = data; "}else{l=a.level,f="data"+((c=a.dataLevel)||"");if(o&&(a.baseId=a.resolve.url(a.baseId,o)),t&&!a.async)throw new Error("async schema in sync schema");r+=" var errs_"+l+" = errors;"}var g,m="valid"+l,p=!a.opts.allErrors,P="",E="",w=a.schema.type,b=Array.isArray(w);if(w&&a.opts.nullable&&!0===a.schema.nullable&&(b?-1==w.indexOf("null")&&(w=w.concat("null")):"null"!=w&&(w=[w,"null"],b=!0)),b&&1==w.length&&(w=w[0],b=!1),a.schema.$ref&&s){if("fail"==a.opts.extendRefs)throw new Error('$ref: validation keywords used in schema at path "'+a.errSchemaPath+'" (see option extendRefs)');!0!==a.opts.extendRefs&&(s=!1,a.logger.warn('$ref: keywords ignored in schema at path "'+a.errSchemaPath+'"'))}if(a.schema.$comment&&a.opts.$comment&&(r+=" "+a.RULES.all.$comment.code(a,"$comment")),w){a.opts.coerceTypes&&(g=a.util.coerceToTypes(a.opts.coerceTypes,w));var S=a.RULES.types[w];if(g||b||!0===S||S&&!Z(S)){h=a.schemaPath+".type",d=a.errSchemaPath+"/type",h=a.schemaPath+".type",d=a.errSchemaPath+"/type";if(r+=" if ("+a.util[b?"checkDataTypes":"checkDataType"](w,f,a.opts.strictNumbers,!0)+") { ",g){var _="dataType"+l,F="coerced"+l;r+=" var "+_+" = typeof "+f+"; var "+F+" = undefined; ","array"==a.opts.coerceTypes&&(r+=" if ("+_+" == 'object' && Array.isArray("+f+") && "+f+".length == 1) { "+f+" = "+f+"[0]; "+_+" = typeof "+f+"; if ("+a.util.checkDataType(a.schema.type,f,a.opts.strictNumbers)+") "+F+" = "+f+"; } "),r+=" if ("+F+" !== undefined) ; ";var x=g;if(x)for(var R,$=-1,j=x.length-1;$= 0x80 (not a basic code point)","invalid-input":"Invalid input"},k=Math.floor,C=String.fromCharCode;function L(e){throw new RangeError(i[e])}function n(e,r){var t=e.split("@"),a="";return 1>1,e+=k(e/r);455k((A-a)/h))&&L("overflow"),a+=p*h;var f=d<=o?1:o+26<=d?26:d-o;if(pk(A/m)&&L("overflow"),h*=m}var v=r.length+1,o=z(a-u,v,0==u);k(a/v)>A-s&&L("overflow"),s+=k(a/v),a%=v,r.splice(a++,0,s)}return String.fromCodePoint.apply(String,r)}function c(e){var r=[],t=(e=N(e)).length,a=128,s=0,o=72,i=!0,n=!1,l=void 0;try{for(var c,u=e[Symbol.iterator]();!(i=(c=u.next()).done);i=!0){var h=c.value;h<128&&r.push(C(h))}}catch(e){n=!0,l=e}finally{try{!i&&u.return&&u.return()}finally{if(n)throw l}}var d=r.length,p=d;for(d&&r.push("-");pk((A-s)/w)&&L("overflow"),s+=(f-a)*w,a=f;var b=!0,S=!1,_=void 0;try{for(var F,x=e[Symbol.iterator]();!(b=(F=x.next()).done);b=!0){var R=F.value;if(RA&&L("overflow"),R==a){for(var $=s,j=36;;j+=36){var D=j<=o?1:o+26<=j?26:j-o;if($>6|192).toString(16).toUpperCase()+"%"+(63&r|128).toString(16).toUpperCase():"%"+(r>>12|224).toString(16).toUpperCase()+"%"+(r>>6&63|128).toString(16).toUpperCase()+"%"+(63&r|128).toString(16).toUpperCase()}function p(e){for(var r="",t=0,a=e.length;tA-Z\\x5E-\\x7E]",'[\\"\\\\]')),Y=new RegExp(M,"g"),W=new RegExp("(?:(?:%[EFef][0-9A-Fa-f]%[0-9A-Fa-f][0-9A-Fa-f]%[0-9A-Fa-f][0-9A-Fa-f])|(?:%[89A-Fa-f][0-9A-Fa-f]%[0-9A-Fa-f][0-9A-Fa-f])|(?:%[0-9A-Fa-f][0-9A-Fa-f]))","g"),X=new RegExp(J("[^]","[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]","[\\.]",'[\\"]',G),"g"),ee=new RegExp(J("[^]",M,"[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]"),"g"),re=ee;function te(e){var r=p(e);return r.match(Y)?r:e}var ae={scheme:"mailto",parse:function(e,r){var t=e,a=t.to=t.path?t.path.split(","):[];if(t.path=void 0,t.query){for(var s=!1,o={},i=t.query.split("&"),n=0,l=i.length;n=t}function i(e,t,n){var r=t.input.slice(t.start);return n&&(r=r.replace(l,"$1 $3")),e.test(r)}function s(e,t,n,r){var i=new e.constructor(e.options,e.input,t);if(n)for(var s in n)i[s]=n[s];var o=e,a=i;return["inFunction","inAsyncFunction","inAsync","inGenerator","inModule"].forEach(function(e){e in o&&(a[e]=o[e])}),r&&(i.options.preserveParens=!0),i.nextToken(),i}var o={},a=/^async[\t ]+(return|throw)/,u=/^async[\t ]+function/,c=/^\s*[():;]/,l=/([^\n])\/\*(\*(?!\/)|[^\n*])*\*\/([^\n])/g,p=/\s*(get|set)\s*\(/;t.exports=function(e,t){var n=function(){};e.extend("initialContext",function(r){return function(){return this.options.ecmaVersion<7&&(n=function(t){e.raise(t.start,"async/await keywords only available when ecmaVersion>=7")}),this.reservedWords=new RegExp(this.reservedWords.toString().replace(/await|async/g,"").replace("|/","/").replace("/|","/").replace("||","|")),this.reservedWordsStrict=new RegExp(this.reservedWordsStrict.toString().replace(/await|async/g,"").replace("|/","/").replace("/|","/").replace("||","|")),this.reservedWordsStrictBind=new RegExp(this.reservedWordsStrictBind.toString().replace(/await|async/g,"").replace("|/","/").replace("/|","/").replace("||","|")),this.inAsyncFunction=t.inAsyncFunction,t.awaitAnywhere&&t.inAsyncFunction&&e.raise(node.start,"The options awaitAnywhere and inAsyncFunction are mutually exclusive"),r.apply(this,arguments)}}),e.extend("shouldParseExportStatement",function(e){return function(){return!("name"!==this.type.label||"async"!==this.value||!i(u,this))||e.apply(this,arguments)}}),e.extend("parseStatement",function(e){return function(n,r){var s=this.start,o=this.startLoc;if("name"===this.type.label)if(i(u,this,!0)){var c=this.inAsyncFunction;try{return this.inAsyncFunction=!0,this.next(),(l=this.parseStatement(n,r)).async=!0,l.start=s,l.loc&&(l.loc.start=o),l.range&&(l.range[0]=s),l}finally{this.inAsyncFunction=c}}else if("object"==typeof t&&t.asyncExits&&i(a,this)){this.next();var l;return(l=this.parseStatement(n,r)).async=!0,l.start=s,l.loc&&(l.loc.start=o),l.range&&(l.range[0]=s),l}return e.apply(this,arguments)}}),e.extend("parseIdent",function(e){return function(t){var n=e.apply(this,arguments);return this.inAsyncFunction&&"await"===n.name&&0===arguments.length&&this.raise(n.start,"'await' is reserved within async functions"),n}}),e.extend("parseExprAtom",function(e){return function(i){var a,u=this.start,l=this.startLoc,p=e.apply(this,arguments);if("Identifier"===p.type)if("async"!==p.name||r(this,p.end)){if("await"===p.name){var h=this.startNodeAt(p.start,p.loc&&p.loc.start);if(this.inAsyncFunction)return a=this.parseExprSubscripts(),h.operator="await",h.argument=a,h=this.finishNodeAt(h,"AwaitExpression",a.end,a.loc&&a.loc.end),n(h),h;if(this.input.slice(p.end).match(c))return t.awaitAnywhere||"module"!==this.options.sourceType?p:this.raise(p.start,"'await' is reserved within modules");if("object"==typeof t&&t.awaitAnywhere&&(u=this.start,(a=s(this,u-4).parseExprSubscripts()).end<=u))return a=s(this,u).parseExprSubscripts(),h.operator="await",h.argument=a,h=this.finishNodeAt(h,"AwaitExpression",a.end,a.loc&&a.loc.end),this.pos=a.end,this.end=a.end,this.endLoc=a.endLoc,this.next(),n(h),h;if(!t.awaitAnywhere&&"module"===this.options.sourceType)return this.raise(p.start,"'await' is reserved within modules")}}else{var f=this.inAsyncFunction;try{this.inAsyncFunction=!0;var d=this,y=!1,m={parseFunctionBody:function(e,t){try{var n=y;return y=!0,d.parseFunctionBody.apply(this,arguments)}finally{y=n}},raise:function(){try{return d.raise.apply(this,arguments)}catch(e){throw y?e:o}}};if("SequenceExpression"===(a=s(this,this.start,m,!0).parseExpression()).type&&(a=a.expressions[0]),"CallExpression"===a.type&&(a=a.callee),"FunctionExpression"===a.type||"FunctionDeclaration"===a.type||"ArrowFunctionExpression"===a.type)return"SequenceExpression"===(a=s(this,this.start,m).parseExpression()).type&&(a=a.expressions[0]),"CallExpression"===a.type&&(a=a.callee),a.async=!0,a.start=u,a.loc&&(a.loc.start=l),a.range&&(a.range[0]=u),this.pos=a.end,this.end=a.end,this.endLoc=a.endLoc,this.next(),n(a),a}catch(e){if(e!==o)throw e}finally{this.inAsyncFunction=f}}return p}}),e.extend("finishNodeAt",function(e){return function(t,n,r,i){return t.__asyncValue&&(delete t.__asyncValue,t.value.async=!0),e.apply(this,arguments)}}),e.extend("finishNode",function(e){return function(t,n){return t.__asyncValue&&(delete t.__asyncValue,t.value.async=!0),e.apply(this,arguments)}}),e.extend("parsePropertyName",function(e){return function(t){t.key&&t.key.name;var i=e.apply(this,arguments);return"Identifier"!==i.type||"async"!==i.name||r(this,i.end)||this.input.slice(i.end).match(c)||(p.test(this.input.slice(i.end))?(i=e.apply(this,arguments),t.__asyncValue=!0):(n(t),"set"===t.kind&&this.raise(i.start,"'set (value)' cannot be be async"),"Identifier"===(i=e.apply(this,arguments)).type&&"set"===i.name&&this.raise(i.start,"'set (value)' cannot be be async"),t.__asyncValue=!0)),i}}),e.extend("parseClassMethod",function(e){return function(t,n,r){var i;n.__asyncValue&&("constructor"===n.kind&&this.raise(n.start,"class constructor() cannot be be async"),i=this.inAsyncFunction,this.inAsyncFunction=!0);var s=e.apply(this,arguments);return this.inAsyncFunction=i,s}}),e.extend("parseMethod",function(e){return function(t){var n;this.__currentProperty&&this.__currentProperty.__asyncValue&&(n=this.inAsyncFunction,this.inAsyncFunction=!0);var r=e.apply(this,arguments);return this.inAsyncFunction=n,r}}),e.extend("parsePropertyValue",function(e){return function(t,n,r,i,s,o){var a=this.__currentProperty;this.__currentProperty=t;var u;t.__asyncValue&&(u=this.inAsyncFunction,this.inAsyncFunction=!0);var c=e.apply(this,arguments);return this.inAsyncFunction=u,this.__currentProperty=a,c}})}},{}],3:[function(e,t,n){function r(e,t,n){var r=new e.constructor(e.options,e.input,t);if(n)for(var i in n)r[i]=n[i];var s=e,o=r;return["inFunction","inAsync","inGenerator","inModule"].forEach(function(e){e in s&&(o[e]=s[e])}),r.nextToken(),r}var i=/^async[\t ]+(return|throw)/,s=/^\s*[):;]/,o=/([^\n])\/\*(\*(?!\/)|[^\n*])*\*\/([^\n])/g;t.exports=function(e,t){t&&"object"==typeof t||(t={}),e.extend("parse",function(n){return function(){return this.inAsync=t.inAsyncFunction,t.awaitAnywhere&&t.inAsyncFunction&&e.raise(node.start,"The options awaitAnywhere and inAsyncFunction are mutually exclusive"),n.apply(this,arguments)}}),e.extend("parseStatement",function(e){return function(n,r){var s=this.start,a=this.startLoc;if("name"===this.type.label&&t.asyncExits&&function(e,t,n){var r=t.input.slice(t.start);return n&&(r=r.replace(o,"$1 $3")),e.test(r)}(i,this)){this.next();var u=this.parseStatement(n,r);return u.async=!0,u.start=s,u.loc&&(u.loc.start=a),u.range&&(u.range[0]=s),u}return e.apply(this,arguments)}}),e.extend("parseIdent",function(e){return function(n){return"module"===this.options.sourceType&&this.options.ecmaVersion>=8&&t.awaitAnywhere?e.call(this,!0):e.apply(this,arguments)}}),e.extend("parseExprAtom",function(e){var n={};return function(i){var s,o=this.start,a=(this.startLoc,e.apply(this,arguments));if("Identifier"===a.type&&"await"===a.name&&!this.inAsync&&t.awaitAnywhere){var u=this.startNodeAt(a.start,a.loc&&a.loc.start);o=this.start;var c={raise:function(){try{return pp.raise.apply(this,arguments)}catch(e){throw n}}};try{if((s=r(this,o-4,c).parseExprSubscripts()).end<=o)return s=r(this,o,c).parseExprSubscripts(),u.argument=s,u=this.finishNodeAt(u,"AwaitExpression",s.end,s.loc&&s.loc.end),this.pos=s.end,this.end=s.end,this.endLoc=s.endLoc,this.next(),u}catch(e){if(e===n)return a;throw e}}return a}});var n={undefined:!0,get:!0,set:!0,static:!0,async:!0,constructor:!0};e.extend("parsePropertyName",function(e){return function(t){var r=t.key&&t.key.name,i=e.apply(this,arguments);return"get"===this.value&&(t.__maybeStaticAsyncGetter=!0),n[this.value]?i:("Identifier"!==i.type||"async"!==i.name&&"async"!==r||function(e,t){return e.lineStart>=t}(this,i.end)||this.input.slice(i.end).match(s)?delete t.__maybeStaticAsyncGetter:"set"===t.kind||"set"===i.name?this.raise(i.start,"'set (value)' cannot be be async"):(this.__isAsyncProp=!0,"Identifier"===(i=e.apply(this,arguments)).type&&"set"===i.name&&this.raise(i.start,"'set (value)' cannot be be async")),i)}}),e.extend("parseClassMethod",function(e){return function(t,n,r){var i=e.apply(this,arguments);return n.__maybeStaticAsyncGetter&&(delete n.__maybeStaticAsyncGetter,"get"!==n.key.name&&(n.kind="get")),i}}),e.extend("parseFunctionBody",function(e){return function(t,n){var r=this.inAsync;this.__isAsyncProp&&(t.async=!0,this.inAsync=!0,delete this.__isAsyncProp);var i=e.apply(this,arguments);return this.inAsync=r,i}})}},{}],4:[function(e,t,n){!function(e,r){"object"==typeof n&&void 0!==t?r(n):"function"==typeof define&&define.amd?define(["exports"],r):r(e.acorn=e.acorn||{})}(this,function(e){"use strict";function t(e,t){for(var n=65536,r=0;re)return!1;if((n+=t[r+1])>=e)return!0}}function n(e,n){return e<65?36===e:e<91||(e<97?95===e:e<123||(e<=65535?e>=170&&x.test(String.fromCharCode(e)):!1!==n&&t(e,E)))}function r(e,n){return e<48?36===e:e<58||!(e<65)&&(e<91||(e<97?95===e:e<123||(e<=65535?e>=170&&w.test(String.fromCharCode(e)):!1!==n&&(t(e,E)||t(e,S)))))}function i(e,t){return new k(e,{beforeExpr:!0,binop:t})}function s(e,t){return void 0===t&&(t={}),t.keyword=e,_[e]=new k(e,t)}function o(e){return 10===e||13===e||8232===e||8233===e}function a(e,t){return $.call(e,t)}function u(e,t){for(var n=1,r=0;;){T.lastIndex=r;var i=T.exec(e);if(!(i&&i.index=2015&&(t.ecmaVersion-=2009),null==t.allowReserved&&(t.allowReserved=t.ecmaVersion<5),R(t.onToken)){var r=t.onToken;t.onToken=function(e){return r.push(e)}}return R(t.onComment)&&(t.onComment=function(e,t){return function(n,r,i,s,o,a){var u={type:n?"Block":"Line",value:r,start:i,end:s};e.locations&&(u.loc=new j(this,o,a)),e.ranges&&(u.range=[i,s]),t.push(u)}}(t,t.onComment)),t}function l(e){return new RegExp("^(?:"+e.replace(/ /g,"|")+")$")}function p(){this.shorthandAssign=this.trailingComma=this.parenthesizedAssign=this.parenthesizedBind=-1}function h(e,t,n,r){return e.type=t,e.end=n,this.options.locations&&(e.loc.end=r),this.options.ranges&&(e.range[1]=n),e}function f(e,t,n,r){try{return new RegExp(e,t)}catch(e){if(void 0!==n)throw e instanceof SyntaxError&&r.raise(n,"Error parsing regular expression: "+e.message),e}}function d(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode(55296+(e>>10),56320+(1023&e)))}var y={3:"abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile",5:"class enum extends super const export import",6:"enum",strict:"implements interface let package private protected public static yield",strictBind:"eval arguments"},m="break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this",g={5:m,6:m+" const class extends export import super"},v="ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԯԱ-Ֆՙա-ևא-תװ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࢠ-ࢴࢶ-ࢽऄ-हऽॐक़-ॡॱ-ঀঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡૹଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-హఽౘ-ౚౠౡಀಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೞೠೡೱೲഅ-ഌഎ-ഐഒ-ഺഽൎൔ-ൖൟ-ൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄງຈຊຍດ-ທນ-ຟມ-ຣລວສຫອ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏽᏸ-ᏽᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜌᜎ-ᜑᜠ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡷᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᥐ-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭋᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᲀ-ᲈᳩ-ᳬᳮ-ᳱᳵᳶᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕ℘-ℝℤΩℨK-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖ゛-ゟァ-ヺー-ヿㄅ-ㄭㄱ-ㆎㆠ-ㆺㇰ-ㇿ㐀-䶵一-鿕ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚝꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-ꞮꞰ-ꞷꟷ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꣽꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꧠ-ꧤꧦ-ꧯꧺ-ꧾꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꩾ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭥꭰ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ",b="‌‍·̀-ͯ·҃-֑҇-ׇֽֿׁׂׅׄؐ-ًؚ-٩ٰۖ-ۜ۟-۪ۤۧۨ-ۭ۰-۹ܑܰ-݊ަ-ް߀-߉߫-߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛ࣔ-ࣣ࣡-ःऺ-़ा-ॏ॑-ॗॢॣ०-९ঁ-ঃ়া-ৄেৈো-্ৗৢৣ০-৯ਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑ੦-ੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢૣ૦-૯ଁ-ଃ଼ା-ୄେୈୋ-୍ୖୗୢୣ୦-୯ஂா-ூெ-ைொ-்ௗ௦-௯ఀ-ఃా-ౄె-ైొ-్ౕౖౢౣ౦-౯ಁ-ಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢೣ೦-೯ഁ-ഃാ-ൄെ-ൈൊ-്ൗൢൣ൦-൯ංඃ්ා-ුූෘ-ෟ෦-෯ෲෳัิ-ฺ็-๎๐-๙ັິ-ູົຼ່-ໍ໐-໙༘༙༠-༩༹༵༷༾༿ཱ-྄྆྇ྍ-ྗྙ-ྼ࿆ါ-ှ၀-၉ၖ-ၙၞ-ၠၢ-ၤၧ-ၭၱ-ၴႂ-ႍႏ-ႝ፝-፟፩-፱ᜒ-᜔ᜲ-᜴ᝒᝓᝲᝳ឴-៓៝០-៩᠋-᠍᠐-᠙ᢩᤠ-ᤫᤰ-᤻᥆-᥏᧐-᧚ᨗ-ᨛᩕ-ᩞ᩠-᩿᩼-᪉᪐-᪙᪰-᪽ᬀ-ᬄ᬴-᭄᭐-᭙᭫-᭳ᮀ-ᮂᮡ-ᮭ᮰-᮹᯦-᯳ᰤ-᰷᱀-᱉᱐-᱙᳐-᳔᳒-᳨᳭ᳲ-᳴᳸᳹᷀-᷵᷻-᷿‿⁀⁔⃐-⃥⃜⃡-⃰⳯-⵿⳱ⷠ-〪ⷿ-゙゚〯꘠-꘩꙯ꙴ-꙽ꚞꚟ꛰꛱ꠂ꠆ꠋꠣ-ꠧꢀꢁꢴ-ꣅ꣐-꣙꣠-꣱꤀-꤉ꤦ-꤭ꥇ-꥓ꦀ-ꦃ꦳-꧀꧐-꧙ꧥ꧰-꧹ꨩ-ꨶꩃꩌꩍ꩐-꩙ꩻ-ꩽꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꫫ-ꫯꫵ꫶ꯣ-ꯪ꯬꯭꯰-꯹ﬞ︀-️︠-︯︳︴﹍-﹏0-9_",x=new RegExp("["+v+"]"),w=new RegExp("["+v+b+"]");v=b=null;var E=[0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,17,26,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,157,310,10,21,11,7,153,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,71,55,7,1,65,0,16,3,2,2,2,26,45,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,785,52,76,44,33,24,27,35,42,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,85,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,159,52,19,3,54,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,86,25,391,63,32,0,449,56,264,8,2,36,18,0,50,29,881,921,103,110,18,195,2749,1070,4050,582,8634,568,8,30,114,29,19,47,17,3,32,20,6,18,881,68,12,0,67,12,65,0,32,6124,20,754,9486,1,3071,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,4149,196,60,67,1213,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42710,42,4148,12,221,3,5761,10591,541],S=[509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,1306,2,54,14,32,9,16,3,46,10,54,9,7,2,37,13,2,9,52,0,13,2,49,13,10,2,4,9,83,11,7,0,161,11,6,9,7,3,57,0,2,6,3,1,3,2,10,0,11,1,3,6,4,4,193,17,10,9,87,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,84,14,5,9,423,9,838,7,2,7,17,9,57,21,2,13,19882,9,135,4,60,6,26,9,1016,45,17,3,19723,1,5319,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,2214,6,110,6,6,9,792487,239],k=function(e,t){void 0===t&&(t={}),this.label=e,this.keyword=t.keyword,this.beforeExpr=!!t.beforeExpr,this.startsExpr=!!t.startsExpr,this.isLoop=!!t.isLoop,this.isAssign=!!t.isAssign,this.prefix=!!t.prefix,this.postfix=!!t.postfix,this.binop=t.binop||null,this.updateContext=null},A={beforeExpr:!0},C={startsExpr:!0},_={},L={num:new k("num",C),regexp:new k("regexp",C),string:new k("string",C),name:new k("name",C),eof:new k("eof"),bracketL:new k("[",{beforeExpr:!0,startsExpr:!0}),bracketR:new k("]"),braceL:new k("{",{beforeExpr:!0,startsExpr:!0}),braceR:new k("}"),parenL:new k("(",{beforeExpr:!0,startsExpr:!0}),parenR:new k(")"),comma:new k(",",A),semi:new k(";",A),colon:new k(":",A),dot:new k("."),question:new k("?",A),arrow:new k("=>",A),template:new k("template"),invalidTemplate:new k("invalidTemplate"),ellipsis:new k("...",A),backQuote:new k("`",C),dollarBraceL:new k("${",{beforeExpr:!0,startsExpr:!0}),eq:new k("=",{beforeExpr:!0,isAssign:!0}),assign:new k("_=",{beforeExpr:!0,isAssign:!0}),incDec:new k("++/--",{prefix:!0,postfix:!0,startsExpr:!0}),prefix:new k("!/~",{beforeExpr:!0,prefix:!0,startsExpr:!0}),logicalOR:i("||",1),logicalAND:i("&&",2),bitwiseOR:i("|",3),bitwiseXOR:i("^",4),bitwiseAND:i("&",5),equality:i("==/!=/===/!==",6),relational:i("/<=/>=",7),bitShift:i("<>/>>>",8),plusMin:new k("+/-",{beforeExpr:!0,binop:9,prefix:!0,startsExpr:!0}),modulo:i("%",10),star:i("*",10),slash:i("/",10),starstar:new k("**",{beforeExpr:!0}),_break:s("break"),_case:s("case",A),_catch:s("catch"),_continue:s("continue"),_debugger:s("debugger"),_default:s("default",A),_do:s("do",{isLoop:!0,beforeExpr:!0}),_else:s("else",A),_finally:s("finally"),_for:s("for",{isLoop:!0}),_function:s("function",C),_if:s("if"),_return:s("return",A),_switch:s("switch"),_throw:s("throw",A),_try:s("try"),_var:s("var"),_const:s("const"),_while:s("while",{isLoop:!0}),_with:s("with"),_new:s("new",{beforeExpr:!0,startsExpr:!0}),_this:s("this",C),_super:s("super",C),_class:s("class",C),_extends:s("extends",A),_export:s("export"),_import:s("import"),_null:s("null",C),_true:s("true",C),_false:s("false",C),_in:s("in",{beforeExpr:!0,binop:7}),_instanceof:s("instanceof",{beforeExpr:!0,binop:7}),_typeof:s("typeof",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_void:s("void",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_delete:s("delete",{beforeExpr:!0,prefix:!0,startsExpr:!0})},O=/\r\n?|\n|\u2028|\u2029/,T=new RegExp(O.source,"g"),N=/[\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff]/,P=/(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g,F=Object.prototype,$=F.hasOwnProperty,B=F.toString,R=Array.isArray||function(e){return"[object Array]"===B.call(e)},I=function(e,t){this.line=e,this.column=t};I.prototype.offset=function(e){return new I(this.line,this.column+e)};var j=function(e,t,n){this.start=t,this.end=n,null!==e.sourceFile&&(this.source=e.sourceFile)},D={ecmaVersion:7,sourceType:"script",onInsertedSemicolon:null,onTrailingComma:null,allowReserved:null,allowReturnOutsideFunction:!1,allowImportExportEverywhere:!1,allowHashBang:!1,locations:!1,onToken:null,onComment:null,ranges:!1,program:null,sourceFile:null,directSourceFile:null,preserveParens:!1,plugins:{}},M={},V=function(e,t,n){this.options=e=c(e),this.sourceFile=e.sourceFile,this.keywords=l(g[e.ecmaVersion>=6?6:5]);var r="";if(!e.allowReserved){for(var i=e.ecmaVersion;!(r=y[i]);i--);"module"==e.sourceType&&(r+=" await")}this.reservedWords=l(r);var s=(r?r+" ":"")+y.strict;this.reservedWordsStrict=l(s),this.reservedWordsStrictBind=l(s+" "+y.strictBind),this.input=String(t),this.containsEsc=!1,this.loadPlugins(e.plugins),n?(this.pos=n,this.lineStart=this.input.lastIndexOf("\n",n-1)+1,this.curLine=this.input.slice(0,this.lineStart).split(O).length):(this.pos=this.lineStart=0,this.curLine=1),this.type=L.eof,this.value=null,this.start=this.end=this.pos,this.startLoc=this.endLoc=this.curPosition(),this.lastTokEndLoc=this.lastTokStartLoc=null,this.lastTokStart=this.lastTokEnd=this.pos,this.context=this.initialContext(),this.exprAllowed=!0,this.inModule="module"===e.sourceType,this.strict=this.inModule||this.strictDirective(this.pos),this.potentialArrowAt=-1,this.inFunction=this.inGenerator=this.inAsync=!1,this.yieldPos=this.awaitPos=0,this.labels=[],0===this.pos&&e.allowHashBang&&"#!"===this.input.slice(0,2)&&this.skipLineComment(2),this.scopeStack=[],this.enterFunctionScope()};V.prototype.isKeyword=function(e){return this.keywords.test(e)},V.prototype.isReservedWord=function(e){return this.reservedWords.test(e)},V.prototype.extend=function(e,t){this[e]=t(this[e])},V.prototype.loadPlugins=function(e){for(var t in e){var n=M[t];if(!n)throw new Error("Plugin '"+t+"' not found");n(this,e[t])}},V.prototype.parse=function(){var e=this.options.program||this.startNode();return this.nextToken(),this.parseTopLevel(e)};var q=V.prototype,U=/^(?:'((?:\\.|[^'])*?)'|"((?:\\.|[^"])*?)"|;)/;q.strictDirective=function(e){for(;;){P.lastIndex=e,e+=P.exec(this.input)[0].length;var t=U.exec(this.input.slice(e));if(!t)return!1;if("use strict"==(t[1]||t[2]))return!0;e+=t[0].length}},q.eat=function(e){return this.type===e&&(this.next(),!0)},q.isContextual=function(e){return this.type===L.name&&this.value===e},q.eatContextual=function(e){return this.value===e&&this.eat(L.name)},q.expectContextual=function(e){this.eatContextual(e)||this.unexpected()},q.canInsertSemicolon=function(){return this.type===L.eof||this.type===L.braceR||O.test(this.input.slice(this.lastTokEnd,this.start))},q.insertSemicolon=function(){if(this.canInsertSemicolon())return this.options.onInsertedSemicolon&&this.options.onInsertedSemicolon(this.lastTokEnd,this.lastTokEndLoc),!0},q.semicolon=function(){this.eat(L.semi)||this.insertSemicolon()||this.unexpected()},q.afterTrailingComma=function(e,t){if(this.type==e)return this.options.onTrailingComma&&this.options.onTrailingComma(this.lastTokStart,this.lastTokStartLoc),t||this.next(),!0},q.expect=function(e){this.eat(e)||this.unexpected()},q.unexpected=function(e){this.raise(null!=e?e:this.start,"Unexpected token")},q.checkPatternErrors=function(e,t){if(e){e.trailingComma>-1&&this.raiseRecoverable(e.trailingComma,"Comma is not permitted after the rest element");var n=t?e.parenthesizedAssign:e.parenthesizedBind;n>-1&&this.raiseRecoverable(n,"Parenthesized pattern")}},q.checkExpressionErrors=function(e,t){var n=e?e.shorthandAssign:-1;if(!t)return n>=0;n>-1&&this.raise(n,"Shorthand property assignments are valid only in destructuring patterns")},q.checkYieldAwaitInDefaultParams=function(){this.yieldPos&&(!this.awaitPos||this.yieldPos=6&&(e.sourceType=this.options.sourceType),this.finishNode(e,"Program")};var W={kind:"loop"},G={kind:"switch"};z.isLet=function(){if(this.type!==L.name||this.options.ecmaVersion<6||"let"!=this.value)return!1;P.lastIndex=this.pos;var e=P.exec(this.input),t=this.pos+e[0].length,i=this.input.charCodeAt(t);if(91===i||123==i)return!0;if(n(i,!0)){for(var s=t+1;r(this.input.charCodeAt(s),!0);)++s;var o=this.input.slice(t,s);if(!this.isKeyword(o))return!0}return!1},z.isAsyncFunction=function(){if(this.type!==L.name||this.options.ecmaVersion<8||"async"!=this.value)return!1;P.lastIndex=this.pos;var e=P.exec(this.input),t=this.pos+e[0].length;return!(O.test(this.input.slice(this.pos,t))||"function"!==this.input.slice(t,t+8)||t+8!=this.input.length&&r(this.input.charAt(t+8)))},z.parseStatement=function(e,t,n){var r,i=this.type,s=this.startNode();switch(this.isLet()&&(i=L._var,r="let"),i){case L._break:case L._continue:return this.parseBreakContinueStatement(s,i.keyword);case L._debugger:return this.parseDebuggerStatement(s);case L._do:return this.parseDoStatement(s);case L._for:return this.parseForStatement(s);case L._function:return!e&&this.options.ecmaVersion>=6&&this.unexpected(),this.parseFunctionStatement(s,!1);case L._class:return e||this.unexpected(),this.parseClass(s,!0);case L._if:return this.parseIfStatement(s);case L._return:return this.parseReturnStatement(s);case L._switch:return this.parseSwitchStatement(s);case L._throw:return this.parseThrowStatement(s);case L._try:return this.parseTryStatement(s);case L._const:case L._var:return r=r||this.value,e||"var"==r||this.unexpected(),this.parseVarStatement(s,r);case L._while:return this.parseWhileStatement(s);case L._with:return this.parseWithStatement(s);case L.braceL:return this.parseBlock();case L.semi:return this.parseEmptyStatement(s);case L._export:case L._import:return this.options.allowImportExportEverywhere||(t||this.raise(this.start,"'import' and 'export' may only appear at the top level"),this.inModule||this.raise(this.start,"'import' and 'export' may appear only with 'sourceType: module'")),i===L._import?this.parseImport(s):this.parseExport(s,n);default:if(this.isAsyncFunction()&&e)return this.next(),this.parseFunctionStatement(s,!0);var o=this.value,a=this.parseExpression();return i===L.name&&"Identifier"===a.type&&this.eat(L.colon)?this.parseLabeledStatement(s,o,a):this.parseExpressionStatement(s,a)}},z.parseBreakContinueStatement=function(e,t){var n="break"==t;this.next(),this.eat(L.semi)||this.insertSemicolon()?e.label=null:this.type!==L.name?this.unexpected():(e.label=this.parseIdent(),this.semicolon());for(var r=0;r=6?this.eat(L.semi):this.semicolon(),this.finishNode(e,"DoWhileStatement")},z.parseForStatement=function(e){if(this.next(),this.labels.push(W),this.enterLexicalScope(),this.expect(L.parenL),this.type===L.semi)return this.parseFor(e,null);var t=this.isLet();if(this.type===L._var||this.type===L._const||t){var n=this.startNode(),r=t?"let":this.value;return this.next(),this.parseVar(n,!0,r),this.finishNode(n,"VariableDeclaration"),!(this.type===L._in||this.options.ecmaVersion>=6&&this.isContextual("of"))||1!==n.declarations.length||"var"!==r&&n.declarations[0].init?this.parseFor(e,n):this.parseForIn(e,n)}var i=new p,s=this.parseExpression(!0,i);return this.type===L._in||this.options.ecmaVersion>=6&&this.isContextual("of")?(this.toAssignable(s),this.checkLVal(s),this.checkPatternErrors(i,!0),this.parseForIn(e,s)):(this.checkExpressionErrors(i,!0),this.parseFor(e,s))},z.parseFunctionStatement=function(e,t){return this.next(),this.parseFunction(e,!0,!1,t)},z.isFunction=function(){return this.type===L._function||this.isAsyncFunction()},z.parseIfStatement=function(e){return this.next(),e.test=this.parseParenExpression(),e.consequent=this.parseStatement(!this.strict&&this.isFunction()),e.alternate=this.eat(L._else)?this.parseStatement(!this.strict&&this.isFunction()):null,this.finishNode(e,"IfStatement")},z.parseReturnStatement=function(e){return this.inFunction||this.options.allowReturnOutsideFunction||this.raise(this.start,"'return' outside of function"),this.next(),this.eat(L.semi)||this.insertSemicolon()?e.argument=null:(e.argument=this.parseExpression(),this.semicolon()),this.finishNode(e,"ReturnStatement")},z.parseSwitchStatement=function(e){this.next(),e.discriminant=this.parseParenExpression(),e.cases=[],this.expect(L.braceL),this.labels.push(G),this.enterLexicalScope();for(var t,n=!1;this.type!=L.braceR;)if(this.type===L._case||this.type===L._default){var r=this.type===L._case;t&&this.finishNode(t,"SwitchCase"),e.cases.push(t=this.startNode()),t.consequent=[],this.next(),r?t.test=this.parseExpression():(n&&this.raiseRecoverable(this.lastTokStart,"Multiple default clauses"),n=!0,t.test=null),this.expect(L.colon)}else t||this.unexpected(),t.consequent.push(this.parseStatement(!0));return this.exitLexicalScope(),t&&this.finishNode(t,"SwitchCase"),this.next(),this.labels.pop(),this.finishNode(e,"SwitchStatement")},z.parseThrowStatement=function(e){return this.next(),O.test(this.input.slice(this.lastTokEnd,this.start))&&this.raise(this.lastTokEnd,"Illegal newline after throw"),e.argument=this.parseExpression(),this.semicolon(),this.finishNode(e,"ThrowStatement")};var J=[];z.parseTryStatement=function(e){if(this.next(),e.block=this.parseBlock(),e.handler=null,this.type===L._catch){var t=this.startNode();this.next(),this.expect(L.parenL),t.param=this.parseBindingAtom(),this.enterLexicalScope(),this.checkLVal(t.param,"let"),this.expect(L.parenR),t.body=this.parseBlock(!1),this.exitLexicalScope(),e.handler=this.finishNode(t,"CatchClause")}return e.finalizer=this.eat(L._finally)?this.parseBlock():null,e.handler||e.finalizer||this.raise(e.start,"Missing catch or finally clause"),this.finishNode(e,"TryStatement")},z.parseVarStatement=function(e,t){return this.next(),this.parseVar(e,!1,t),this.semicolon(),this.finishNode(e,"VariableDeclaration")},z.parseWhileStatement=function(e){return this.next(),e.test=this.parseParenExpression(),this.labels.push(W),e.body=this.parseStatement(!1),this.labels.pop(),this.finishNode(e,"WhileStatement")},z.parseWithStatement=function(e){return this.strict&&this.raise(this.start,"'with' in strict mode"),this.next(),e.object=this.parseParenExpression(),e.body=this.parseStatement(!1),this.finishNode(e,"WithStatement")},z.parseEmptyStatement=function(e){return this.next(),this.finishNode(e,"EmptyStatement")},z.parseLabeledStatement=function(e,t,n){for(var r=0,i=this.labels;r=0;o--){var a=this.labels[o];if(a.statementStart!=e.start)break;a.statementStart=this.start,a.kind=s}return this.labels.push({name:t,kind:s,statementStart:this.start}),e.body=this.parseStatement(!0),("ClassDeclaration"==e.body.type||"VariableDeclaration"==e.body.type&&"var"!=e.body.kind||"FunctionDeclaration"==e.body.type&&(this.strict||e.body.generator))&&this.raiseRecoverable(e.body.start,"Invalid labeled declaration"),this.labels.pop(),e.label=n,this.finishNode(e,"LabeledStatement")},z.parseExpressionStatement=function(e,t){return e.expression=t,this.semicolon(),this.finishNode(e,"ExpressionStatement")},z.parseBlock=function(e){void 0===e&&(e=!0);var t=this.startNode();for(t.body=[],this.expect(L.braceL),e&&this.enterLexicalScope();!this.eat(L.braceR);){var n=this.parseStatement(!0);t.body.push(n)}return e&&this.exitLexicalScope(),this.finishNode(t,"BlockStatement")},z.parseFor=function(e,t){return e.init=t,this.expect(L.semi),e.test=this.type===L.semi?null:this.parseExpression(),this.expect(L.semi),e.update=this.type===L.parenR?null:this.parseExpression(),this.expect(L.parenR),this.exitLexicalScope(),e.body=this.parseStatement(!1),this.labels.pop(),this.finishNode(e,"ForStatement")},z.parseForIn=function(e,t){var n=this.type===L._in?"ForInStatement":"ForOfStatement";return this.next(),e.left=t,e.right=this.parseExpression(),this.expect(L.parenR),this.exitLexicalScope(),e.body=this.parseStatement(!1),this.labels.pop(),this.finishNode(e,n)},z.parseVar=function(e,t,n){for(e.declarations=[],e.kind=n;;){var r=this.startNode();if(this.parseVarId(r,n),this.eat(L.eq)?r.init=this.parseMaybeAssign(t):"const"!==n||this.type===L._in||this.options.ecmaVersion>=6&&this.isContextual("of")?"Identifier"==r.id.type||t&&(this.type===L._in||this.isContextual("of"))?r.init=null:this.raise(this.lastTokEnd,"Complex binding patterns require an initialization value"):this.unexpected(),e.declarations.push(this.finishNode(r,"VariableDeclarator")),!this.eat(L.comma))break}return e},z.parseVarId=function(e,t){e.id=this.parseBindingAtom(t),this.checkLVal(e.id,t,!1)},z.parseFunction=function(e,t,n,r){this.initFunction(e),this.options.ecmaVersion>=6&&!r&&(e.generator=this.eat(L.star)),this.options.ecmaVersion>=8&&(e.async=!!r),t&&(e.id="nullableID"===t&&this.type!=L.name?null:this.parseIdent(),e.id&&this.checkLVal(e.id,"var"));var i=this.inGenerator,s=this.inAsync,o=this.yieldPos,a=this.awaitPos,u=this.inFunction;return this.inGenerator=e.generator,this.inAsync=e.async,this.yieldPos=0,this.awaitPos=0,this.inFunction=!0,this.enterFunctionScope(),t||(e.id=this.type==L.name?this.parseIdent():null),this.parseFunctionParams(e),this.parseFunctionBody(e,n),this.inGenerator=i,this.inAsync=s,this.yieldPos=o,this.awaitPos=a,this.inFunction=u,this.finishNode(e,t?"FunctionDeclaration":"FunctionExpression")},z.parseFunctionParams=function(e){this.expect(L.parenL),e.params=this.parseBindingList(L.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams()},z.parseClass=function(e,t){this.next(),this.parseClassId(e,t),this.parseClassSuper(e);var n=this.startNode(),r=!1;for(n.body=[],this.expect(L.braceL);!this.eat(L.braceR);)if(!this.eat(L.semi)){var i=this.startNode(),s=this.eat(L.star),o=!1,a=this.type===L.name&&"static"===this.value;this.parsePropertyName(i),i.static=a&&this.type!==L.parenL,i.static&&(s&&this.unexpected(),s=this.eat(L.star),this.parsePropertyName(i)),this.options.ecmaVersion>=8&&!s&&!i.computed&&"Identifier"===i.key.type&&"async"===i.key.name&&this.type!==L.parenL&&!this.canInsertSemicolon()&&(o=!0,this.parsePropertyName(i)),i.kind="method";var u=!1;if(!i.computed){var c=i.key;s||o||"Identifier"!==c.type||this.type===L.parenL||"get"!==c.name&&"set"!==c.name||(u=!0,i.kind=c.name,c=this.parsePropertyName(i)),!i.static&&("Identifier"===c.type&&"constructor"===c.name||"Literal"===c.type&&"constructor"===c.value)&&(r&&this.raise(c.start,"Duplicate constructor in the same class"),u&&this.raise(c.start,"Constructor can't have get/set modifier"),s&&this.raise(c.start,"Constructor can't be a generator"),o&&this.raise(c.start,"Constructor can't be an async method"),i.kind="constructor",r=!0)}if(this.parseClassMethod(n,i,s,o),u){var l="get"===i.kind?0:1;if(i.value.params.length!==l){var p=i.value.start;"get"===i.kind?this.raiseRecoverable(p,"getter should have no params"):this.raiseRecoverable(p,"setter should have exactly one param")}else"set"===i.kind&&"RestElement"===i.value.params[0].type&&this.raiseRecoverable(i.value.params[0].start,"Setter cannot use rest params")}}return e.body=this.finishNode(n,"ClassBody"),this.finishNode(e,t?"ClassDeclaration":"ClassExpression")},z.parseClassMethod=function(e,t,n,r){t.value=this.parseMethod(n,r),e.body.push(this.finishNode(t,"MethodDefinition"))},z.parseClassId=function(e,t){e.id=this.type===L.name?this.parseIdent():!0===t?this.unexpected():null},z.parseClassSuper=function(e){e.superClass=this.eat(L._extends)?this.parseExprSubscripts():null},z.parseExport=function(e,t){if(this.next(),this.eat(L.star))return this.expectContextual("from"),e.source=this.type===L.string?this.parseExprAtom():this.unexpected(),this.semicolon(),this.finishNode(e,"ExportAllDeclaration");if(this.eat(L._default)){this.checkExport(t,"default",this.lastTokStart);var n;if(this.type===L._function||(n=this.isAsyncFunction())){var r=this.startNode();this.next(),n&&this.next(),e.declaration=this.parseFunction(r,"nullableID",!1,n)}else if(this.type===L._class){var i=this.startNode();e.declaration=this.parseClass(i,"nullableID")}else e.declaration=this.parseMaybeAssign(),this.semicolon();return this.finishNode(e,"ExportDefaultDeclaration")}if(this.shouldParseExportStatement())e.declaration=this.parseStatement(!0),"VariableDeclaration"===e.declaration.type?this.checkVariableExport(t,e.declaration.declarations):this.checkExport(t,e.declaration.id.name,e.declaration.id.start),e.specifiers=[],e.source=null;else{if(e.declaration=null,e.specifiers=this.parseExportSpecifiers(t),this.eatContextual("from"))e.source=this.type===L.string?this.parseExprAtom():this.unexpected();else{for(var s=0,o=e.specifiers;s=6&&e)switch(e.type){case"Identifier":this.inAsync&&"await"===e.name&&this.raise(e.start,"Can not use 'await' as identifier inside an async function");break;case"ObjectPattern":case"ArrayPattern":break;case"ObjectExpression":e.type="ObjectPattern";for(var n=0,r=e.properties;n=6&&(e.computed||e.method||e.shorthand))){var n,r=e.key;switch(r.type){case"Identifier":n=r.name;break;case"Literal":n=String(r.value);break;default:return}var i=e.kind;if(this.options.ecmaVersion>=6)"__proto__"===n&&"init"===i&&(t.proto&&this.raiseRecoverable(r.start,"Redefinition of __proto__ property"),t.proto=!0);else{var s=t[n="$"+n];if(s){("init"===i?this.strict&&s.init||s.get||s.set:s.init||s[i])&&this.raiseRecoverable(r.start,"Redefinition of property")}else s=t[n]={init:!1,get:!1,set:!1};s[i]=!0}}},Y.parseExpression=function(e,t){var n=this.start,r=this.startLoc,i=this.parseMaybeAssign(e,t);if(this.type===L.comma){var s=this.startNodeAt(n,r);for(s.expressions=[i];this.eat(L.comma);)s.expressions.push(this.parseMaybeAssign(e,t));return this.finishNode(s,"SequenceExpression")}return i},Y.parseMaybeAssign=function(e,t,n){if(this.inGenerator&&this.isContextual("yield"))return this.parseYield();var r=!1,i=-1,s=-1;t?(i=t.parenthesizedAssign,s=t.trailingComma,t.parenthesizedAssign=t.trailingComma=-1):(t=new p,r=!0);var o=this.start,a=this.startLoc;this.type!=L.parenL&&this.type!=L.name||(this.potentialArrowAt=this.start);var u=this.parseMaybeConditional(e,t);if(n&&(u=n.call(this,u,o,a)),this.type.isAssign){this.checkPatternErrors(t,!0),r||p.call(t);var c=this.startNodeAt(o,a);return c.operator=this.value,c.left=this.type===L.eq?this.toAssignable(u):u,t.shorthandAssign=-1,this.checkLVal(u),this.next(),c.right=this.parseMaybeAssign(e),this.finishNode(c,"AssignmentExpression")}return r&&this.checkExpressionErrors(t,!0),i>-1&&(t.parenthesizedAssign=i),s>-1&&(t.trailingComma=s),u},Y.parseMaybeConditional=function(e,t){var n=this.start,r=this.startLoc,i=this.parseExprOps(e,t);if(this.checkExpressionErrors(t))return i;if(this.eat(L.question)){var s=this.startNodeAt(n,r);return s.test=i,s.consequent=this.parseMaybeAssign(),this.expect(L.colon),s.alternate=this.parseMaybeAssign(e),this.finishNode(s,"ConditionalExpression")}return i},Y.parseExprOps=function(e,t){var n=this.start,r=this.startLoc,i=this.parseMaybeUnary(t,!1);return this.checkExpressionErrors(t)?i:i.start==n&&"ArrowFunctionExpression"===i.type?i:this.parseExprOp(i,n,r,-1,e)},Y.parseExprOp=function(e,t,n,r,i){var s=this.type.binop;if(null!=s&&(!i||this.type!==L._in)&&s>r){var o=this.type===L.logicalOR||this.type===L.logicalAND,a=this.value;this.next();var u=this.start,c=this.startLoc,l=this.parseExprOp(this.parseMaybeUnary(null,!1),u,c,s,i),p=this.buildBinary(t,n,e,l,a,o);return this.parseExprOp(p,t,n,r,i)}return e},Y.buildBinary=function(e,t,n,r,i,s){var o=this.startNodeAt(e,t);return o.left=n,o.operator=i,o.right=r,this.finishNode(o,s?"LogicalExpression":"BinaryExpression")},Y.parseMaybeUnary=function(e,t){var n,r=this.start,i=this.startLoc;if(this.inAsync&&this.isContextual("await"))n=this.parseAwait(),t=!0;else if(this.type.prefix){var s=this.startNode(),o=this.type===L.incDec;s.operator=this.value,s.prefix=!0,this.next(),s.argument=this.parseMaybeUnary(null,!0),this.checkExpressionErrors(e,!0),o?this.checkLVal(s.argument):this.strict&&"delete"===s.operator&&"Identifier"===s.argument.type?this.raiseRecoverable(s.start,"Deleting local variable in strict mode"):t=!0,n=this.finishNode(s,o?"UpdateExpression":"UnaryExpression")}else{if(n=this.parseExprSubscripts(e),this.checkExpressionErrors(e))return n;for(;this.type.postfix&&!this.canInsertSemicolon();){var a=this.startNodeAt(r,i);a.operator=this.value,a.prefix=!1,a.argument=n,this.checkLVal(n),this.next(),n=this.finishNode(a,"UpdateExpression")}}return!t&&this.eat(L.starstar)?this.buildBinary(r,i,n,this.parseMaybeUnary(null,!1),"**",!1):n},Y.parseExprSubscripts=function(e){var t=this.start,n=this.startLoc,r=this.parseExprAtom(e),i="ArrowFunctionExpression"===r.type&&")"!==this.input.slice(this.lastTokStart,this.lastTokEnd);if(this.checkExpressionErrors(e)||i)return r;var s=this.parseSubscripts(r,t,n);return e&&"MemberExpression"===s.type&&(e.parenthesizedAssign>=s.start&&(e.parenthesizedAssign=-1),e.parenthesizedBind>=s.start&&(e.parenthesizedBind=-1)),s},Y.parseSubscripts=function(e,t,n,r){for(var i=this.options.ecmaVersion>=8&&"Identifier"===e.type&&"async"===e.name&&this.lastTokEnd==e.end&&!this.canInsertSemicolon(),s=void 0;;)if((s=this.eat(L.bracketL))||this.eat(L.dot)){var o=this.startNodeAt(t,n);o.object=e,o.property=s?this.parseExpression():this.parseIdent(!0),o.computed=!!s,s&&this.expect(L.bracketR),e=this.finishNode(o,"MemberExpression")}else if(!r&&this.eat(L.parenL)){var a=new p,u=this.yieldPos,c=this.awaitPos;this.yieldPos=0,this.awaitPos=0;var l=this.parseExprList(L.parenR,this.options.ecmaVersion>=8,!1,a);if(i&&!this.canInsertSemicolon()&&this.eat(L.arrow))return this.checkPatternErrors(a,!1),this.checkYieldAwaitInDefaultParams(),this.yieldPos=u,this.awaitPos=c,this.parseArrowExpression(this.startNodeAt(t,n),l,!0);this.checkExpressionErrors(a,!0),this.yieldPos=u||this.yieldPos,this.awaitPos=c||this.awaitPos;var h=this.startNodeAt(t,n);h.callee=e,h.arguments=l,e=this.finishNode(h,"CallExpression")}else{if(this.type!==L.backQuote)return e;var f=this.startNodeAt(t,n);f.tag=e,f.quasi=this.parseTemplate({isTagged:!0}),e=this.finishNode(f,"TaggedTemplateExpression")}},Y.parseExprAtom=function(e){var t,n=this.potentialArrowAt==this.start;switch(this.type){case L._super:return this.inFunction||this.raise(this.start,"'super' outside of function or class"),t=this.startNode(),this.next(),this.type!==L.dot&&this.type!==L.bracketL&&this.type!==L.parenL&&this.unexpected(),this.finishNode(t,"Super");case L._this:return t=this.startNode(),this.next(),this.finishNode(t,"ThisExpression");case L.name:var r=this.start,i=this.startLoc,s=this.parseIdent(this.type!==L.name);if(this.options.ecmaVersion>=8&&"async"===s.name&&!this.canInsertSemicolon()&&this.eat(L._function))return this.parseFunction(this.startNodeAt(r,i),!1,!1,!0);if(n&&!this.canInsertSemicolon()){if(this.eat(L.arrow))return this.parseArrowExpression(this.startNodeAt(r,i),[s],!1);if(this.options.ecmaVersion>=8&&"async"===s.name&&this.type===L.name)return s=this.parseIdent(),!this.canInsertSemicolon()&&this.eat(L.arrow)||this.unexpected(),this.parseArrowExpression(this.startNodeAt(r,i),[s],!0)}return s;case L.regexp:var o=this.value;return t=this.parseLiteral(o.value),t.regex={pattern:o.pattern,flags:o.flags},t;case L.num:case L.string:return this.parseLiteral(this.value);case L._null:case L._true:case L._false:return t=this.startNode(),t.value=this.type===L._null?null:this.type===L._true,t.raw=this.type.keyword,this.next(),this.finishNode(t,"Literal");case L.parenL:var a=this.start,u=this.parseParenAndDistinguishExpression(n);return e&&(e.parenthesizedAssign<0&&!this.isSimpleAssignTarget(u)&&(e.parenthesizedAssign=a),e.parenthesizedBind<0&&(e.parenthesizedBind=a)),u;case L.bracketL:return t=this.startNode(),this.next(),t.elements=this.parseExprList(L.bracketR,!0,!0,e),this.finishNode(t,"ArrayExpression");case L.braceL:return this.parseObj(!1,e);case L._function:return t=this.startNode(),this.next(),this.parseFunction(t,!1);case L._class:return this.parseClass(this.startNode(),!1);case L._new:return this.parseNew();case L.backQuote:return this.parseTemplate();default:this.unexpected()}},Y.parseLiteral=function(e){var t=this.startNode();return t.value=e,t.raw=this.input.slice(this.start,this.end),this.next(),this.finishNode(t,"Literal")},Y.parseParenExpression=function(){this.expect(L.parenL);var e=this.parseExpression();return this.expect(L.parenR),e},Y.parseParenAndDistinguishExpression=function(e){var t,n=this.start,r=this.startLoc,i=this.options.ecmaVersion>=8;if(this.options.ecmaVersion>=6){this.next();var s,o,a=this.start,u=this.startLoc,c=[],l=!0,h=!1,f=new p,d=this.yieldPos,y=this.awaitPos;for(this.yieldPos=0,this.awaitPos=0;this.type!==L.parenR;){if(l?l=!1:this.expect(L.comma),i&&this.afterTrailingComma(L.parenR,!0)){h=!0;break}if(this.type===L.ellipsis){s=this.start,c.push(this.parseParenItem(this.parseRestBinding())),this.type===L.comma&&this.raise(this.start,"Comma is not permitted after the rest element");break}this.type!==L.parenL||o||(o=this.start),c.push(this.parseMaybeAssign(!1,f,this.parseParenItem))}var m=this.start,g=this.startLoc;if(this.expect(L.parenR),e&&!this.canInsertSemicolon()&&this.eat(L.arrow))return this.checkPatternErrors(f,!1),this.checkYieldAwaitInDefaultParams(),o&&this.unexpected(o),this.yieldPos=d,this.awaitPos=y,this.parseParenArrowList(n,r,c);c.length&&!h||this.unexpected(this.lastTokStart),s&&this.unexpected(s),this.checkExpressionErrors(f,!0),this.yieldPos=d||this.yieldPos,this.awaitPos=y||this.awaitPos,c.length>1?((t=this.startNodeAt(a,u)).expressions=c,this.finishNodeAt(t,"SequenceExpression",m,g)):t=c[0]}else t=this.parseParenExpression();if(this.options.preserveParens){var v=this.startNodeAt(n,r);return v.expression=t,this.finishNode(v,"ParenthesizedExpression")}return t},Y.parseParenItem=function(e){return e},Y.parseParenArrowList=function(e,t,n){return this.parseArrowExpression(this.startNodeAt(e,t),n)};var Q=[];Y.parseNew=function(){var e=this.startNode(),t=this.parseIdent(!0);if(this.options.ecmaVersion>=6&&this.eat(L.dot))return e.meta=t,e.property=this.parseIdent(!0),"target"!==e.property.name&&this.raiseRecoverable(e.property.start,"The only valid meta property for new is new.target"),this.inFunction||this.raiseRecoverable(e.start,"new.target can only be used in functions"),this.finishNode(e,"MetaProperty");var n=this.start,r=this.startLoc;return e.callee=this.parseSubscripts(this.parseExprAtom(),n,r,!0),this.eat(L.parenL)?e.arguments=this.parseExprList(L.parenR,this.options.ecmaVersion>=8,!1):e.arguments=Q,this.finishNode(e,"NewExpression")},Y.parseTemplateElement=function(e){var t=e.isTagged,n=this.startNode();return this.type===L.invalidTemplate?(t||this.raiseRecoverable(this.start,"Bad escape sequence in untagged template literal"),n.value={raw:this.value,cooked:null}):n.value={raw:this.input.slice(this.start,this.end).replace(/\r\n?/g,"\n"),cooked:this.value},this.next(),n.tail=this.type===L.backQuote,this.finishNode(n,"TemplateElement")},Y.parseTemplate=function(e){void 0===e&&(e={});var t=e.isTagged;void 0===t&&(t=!1);var n=this.startNode();this.next(),n.expressions=[];var r=this.parseTemplateElement({isTagged:t});for(n.quasis=[r];!r.tail;)this.expect(L.dollarBraceL),n.expressions.push(this.parseExpression()),this.expect(L.braceR),n.quasis.push(r=this.parseTemplateElement({isTagged:t}));return this.next(),this.finishNode(n,"TemplateLiteral")},Y.isAsyncProp=function(e){return!e.computed&&"Identifier"===e.key.type&&"async"===e.key.name&&(this.type===L.name||this.type===L.num||this.type===L.string||this.type===L.bracketL||this.type.keyword)&&!O.test(this.input.slice(this.lastTokEnd,this.start))},Y.parseObj=function(e,t){var n=this.startNode(),r=!0,i={};for(n.properties=[],this.next();!this.eat(L.braceR);){if(r)r=!1;else if(this.expect(L.comma),this.afterTrailingComma(L.braceR))break;var s=this.parseProperty(e,t);this.checkPropClash(s,i),n.properties.push(s)}return this.finishNode(n,e?"ObjectPattern":"ObjectExpression")},Y.parseProperty=function(e,t){var n,r,i,s,o=this.startNode();return this.options.ecmaVersion>=6&&(o.method=!1,o.shorthand=!1,(e||t)&&(i=this.start,s=this.startLoc),e||(n=this.eat(L.star))),this.parsePropertyName(o),!e&&this.options.ecmaVersion>=8&&!n&&this.isAsyncProp(o)?(r=!0,this.parsePropertyName(o,t)):r=!1,this.parsePropertyValue(o,e,n,r,i,s,t),this.finishNode(o,"Property")},Y.parsePropertyValue=function(e,t,n,r,i,s,o){if((n||r)&&this.type===L.colon&&this.unexpected(),this.eat(L.colon))e.value=t?this.parseMaybeDefault(this.start,this.startLoc):this.parseMaybeAssign(!1,o),e.kind="init";else if(this.options.ecmaVersion>=6&&this.type===L.parenL)t&&this.unexpected(),e.kind="init",e.method=!0,e.value=this.parseMethod(n,r);else if(t||!(this.options.ecmaVersion>=5)||e.computed||"Identifier"!==e.key.type||"get"!==e.key.name&&"set"!==e.key.name||this.type==L.comma||this.type==L.braceR)this.options.ecmaVersion>=6&&!e.computed&&"Identifier"===e.key.type?(this.checkUnreserved(e.key),e.kind="init",t?e.value=this.parseMaybeDefault(i,s,e.key):this.type===L.eq&&o?(o.shorthandAssign<0&&(o.shorthandAssign=this.start),e.value=this.parseMaybeDefault(i,s,e.key)):e.value=e.key,e.shorthand=!0):this.unexpected();else{(n||r)&&this.unexpected(),e.kind=e.key.name,this.parsePropertyName(e),e.value=this.parseMethod(!1);var a="get"===e.kind?0:1;if(e.value.params.length!==a){var u=e.value.start;"get"===e.kind?this.raiseRecoverable(u,"getter should have no params"):this.raiseRecoverable(u,"setter should have exactly one param")}else"set"===e.kind&&"RestElement"===e.value.params[0].type&&this.raiseRecoverable(e.value.params[0].start,"Setter cannot use rest params")}},Y.parsePropertyName=function(e){if(this.options.ecmaVersion>=6){if(this.eat(L.bracketL))return e.computed=!0,e.key=this.parseMaybeAssign(),this.expect(L.bracketR),e.key;e.computed=!1}return e.key=this.type===L.num||this.type===L.string?this.parseExprAtom():this.parseIdent(!0)},Y.initFunction=function(e){e.id=null,this.options.ecmaVersion>=6&&(e.generator=!1,e.expression=!1),this.options.ecmaVersion>=8&&(e.async=!1)},Y.parseMethod=function(e,t){var n=this.startNode(),r=this.inGenerator,i=this.inAsync,s=this.yieldPos,o=this.awaitPos,a=this.inFunction;return this.initFunction(n),this.options.ecmaVersion>=6&&(n.generator=e),this.options.ecmaVersion>=8&&(n.async=!!t),this.inGenerator=n.generator,this.inAsync=n.async,this.yieldPos=0,this.awaitPos=0,this.inFunction=!0,this.enterFunctionScope(),this.expect(L.parenL),n.params=this.parseBindingList(L.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams(),this.parseFunctionBody(n,!1),this.inGenerator=r,this.inAsync=i,this.yieldPos=s,this.awaitPos=o,this.inFunction=a,this.finishNode(n,"FunctionExpression")},Y.parseArrowExpression=function(e,t,n){var r=this.inGenerator,i=this.inAsync,s=this.yieldPos,o=this.awaitPos,a=this.inFunction;return this.enterFunctionScope(),this.initFunction(e),this.options.ecmaVersion>=8&&(e.async=!!n),this.inGenerator=!1,this.inAsync=e.async,this.yieldPos=0,this.awaitPos=0,this.inFunction=!0,e.params=this.toAssignableList(t,!0),this.parseFunctionBody(e,!0),this.inGenerator=r,this.inAsync=i,this.yieldPos=s,this.awaitPos=o,this.inFunction=a,this.finishNode(e,"ArrowFunctionExpression")},Y.parseFunctionBody=function(e,t){var n=t&&this.type!==L.braceL,r=this.strict,i=!1;if(n)e.body=this.parseMaybeAssign(),e.expression=!0,this.checkParams(e,!1);else{var s=this.options.ecmaVersion>=7&&!this.isSimpleParamList(e.params);r&&!s||(i=this.strictDirective(this.end))&&s&&this.raiseRecoverable(e.start,"Illegal 'use strict' directive in function with non-simple parameter list");var o=this.labels;this.labels=[],i&&(this.strict=!0),this.checkParams(e,!r&&!i&&!t&&this.isSimpleParamList(e.params)),e.body=this.parseBlock(!1),e.expression=!1,this.adaptDirectivePrologue(e.body.body),this.labels=o}this.exitFunctionScope(),this.strict&&e.id&&this.checkLVal(e.id,"none"),this.strict=r},Y.isSimpleParamList=function(e){for(var t=0,n=e;t0;)t[n]=arguments[n+1];for(var r=0,i=t;r=1;e--){var t=this.context[e];if("function"===t.token)return t.generator}return!1},ie.updateContext=function(e){var t,n=this.type;n.keyword&&e==L.dot?this.exprAllowed=!1:(t=n.updateContext)?t.call(this,e):this.exprAllowed=n.beforeExpr},L.parenR.updateContext=L.braceR.updateContext=function(){if(1!=this.context.length){var e=this.context.pop();e===re.b_stat&&"function"===this.curContext().token&&(e=this.context.pop()),this.exprAllowed=!e.isExpr}else this.exprAllowed=!0},L.braceL.updateContext=function(e){this.context.push(this.braceIsBlock(e)?re.b_stat:re.b_expr),this.exprAllowed=!0},L.dollarBraceL.updateContext=function(){this.context.push(re.b_tmpl),this.exprAllowed=!0},L.parenL.updateContext=function(e){var t=e===L._if||e===L._for||e===L._with||e===L._while;this.context.push(t?re.p_stat:re.p_expr),this.exprAllowed=!0},L.incDec.updateContext=function(){},L._function.updateContext=L._class.updateContext=function(e){e.beforeExpr&&e!==L.semi&&e!==L._else&&(e!==L.colon&&e!==L.braceL||this.curContext()!==re.b_stat)?this.context.push(re.f_expr):this.context.push(re.f_stat),this.exprAllowed=!1},L.backQuote.updateContext=function(){this.curContext()===re.q_tmpl?this.context.pop():this.context.push(re.q_tmpl),this.exprAllowed=!1},L.star.updateContext=function(e){if(e==L._function){var t=this.context.length-1;this.context[t]===re.f_expr?this.context[t]=re.f_expr_gen:this.context[t]=re.f_gen}this.exprAllowed=!0},L.name.updateContext=function(e){var t=!1;this.options.ecmaVersion>=6&&("of"==this.value&&!this.exprAllowed||"yield"==this.value&&this.inGeneratorContext())&&(t=!0),this.exprAllowed=t};var se=function(e){this.type=e.type,this.value=e.value,this.start=e.start,this.end=e.end,e.options.locations&&(this.loc=new j(e,e.startLoc,e.endLoc)),e.options.ranges&&(this.range=[e.start,e.end])},oe=V.prototype,ae="object"==typeof Packages&&"[object JavaPackage]"==Object.prototype.toString.call(Packages);oe.next=function(){this.options.onToken&&this.options.onToken(new se(this)),this.lastTokEnd=this.end,this.lastTokStart=this.start,this.lastTokEndLoc=this.endLoc,this.lastTokStartLoc=this.startLoc,this.nextToken()},oe.getToken=function(){return this.next(),new se(this)},"undefined"!=typeof Symbol&&(oe[Symbol.iterator]=function(){var e=this;return{next:function(){var t=e.getToken();return{done:t.type===L.eof,value:t}}}}),oe.curContext=function(){return this.context[this.context.length-1]},oe.nextToken=function(){var e=this.curContext();return e&&e.preserveSpace||this.skipSpace(),this.start=this.pos,this.options.locations&&(this.startLoc=this.curPosition()),this.pos>=this.input.length?this.finishToken(L.eof):e.override?e.override(this):void this.readToken(this.fullCharCodeAtPos())},oe.readToken=function(e){return n(e,this.options.ecmaVersion>=6)||92===e?this.readWord():this.getTokenFromCode(e)},oe.fullCharCodeAtPos=function(){var e=this.input.charCodeAt(this.pos);if(e<=55295||e>=57344)return e;return(e<<10)+this.input.charCodeAt(this.pos+1)-56613888},oe.skipBlockComment=function(){var e=this.options.onComment&&this.curPosition(),t=this.pos,n=this.input.indexOf("*/",this.pos+=2);if(-1===n&&this.raise(this.pos-2,"Unterminated comment"),this.pos=n+2,this.options.locations){T.lastIndex=t;for(var r;(r=T.exec(this.input))&&r.index8&&e<14||e>=5760&&N.test(String.fromCharCode(e))))break e;++this.pos}}},oe.finishToken=function(e,t){this.end=this.pos,this.options.locations&&(this.endLoc=this.curPosition());var n=this.type;this.type=e,this.value=t,this.updateContext(n)},oe.readToken_dot=function(){var e=this.input.charCodeAt(this.pos+1);if(e>=48&&e<=57)return this.readNumber(!0);var t=this.input.charCodeAt(this.pos+2);return this.options.ecmaVersion>=6&&46===e&&46===t?(this.pos+=3,this.finishToken(L.ellipsis)):(++this.pos,this.finishToken(L.dot))},oe.readToken_slash=function(){var e=this.input.charCodeAt(this.pos+1);return this.exprAllowed?(++this.pos,this.readRegexp()):61===e?this.finishOp(L.assign,2):this.finishOp(L.slash,1)},oe.readToken_mult_modulo_exp=function(e){var t=this.input.charCodeAt(this.pos+1),n=1,r=42===e?L.star:L.modulo;return this.options.ecmaVersion>=7&&42==e&&42===t&&(++n,r=L.starstar,t=this.input.charCodeAt(this.pos+2)),61===t?this.finishOp(L.assign,n+1):this.finishOp(r,n)},oe.readToken_pipe_amp=function(e){var t=this.input.charCodeAt(this.pos+1);return t===e?this.finishOp(124===e?L.logicalOR:L.logicalAND,2):61===t?this.finishOp(L.assign,2):this.finishOp(124===e?L.bitwiseOR:L.bitwiseAND,1)},oe.readToken_caret=function(){return 61===this.input.charCodeAt(this.pos+1)?this.finishOp(L.assign,2):this.finishOp(L.bitwiseXOR,1)},oe.readToken_plus_min=function(e){var t=this.input.charCodeAt(this.pos+1);return t===e?45!=t||this.inModule||62!=this.input.charCodeAt(this.pos+2)||0!==this.lastTokEnd&&!O.test(this.input.slice(this.lastTokEnd,this.pos))?this.finishOp(L.incDec,2):(this.skipLineComment(3),this.skipSpace(),this.nextToken()):61===t?this.finishOp(L.assign,2):this.finishOp(L.plusMin,1)},oe.readToken_lt_gt=function(e){var t=this.input.charCodeAt(this.pos+1),n=1;return t===e?(n=62===e&&62===this.input.charCodeAt(this.pos+2)?3:2,61===this.input.charCodeAt(this.pos+n)?this.finishOp(L.assign,n+1):this.finishOp(L.bitShift,n)):33!=t||60!=e||this.inModule||45!=this.input.charCodeAt(this.pos+2)||45!=this.input.charCodeAt(this.pos+3)?(61===t&&(n=2),this.finishOp(L.relational,n)):(this.skipLineComment(4),this.skipSpace(),this.nextToken())},oe.readToken_eq_excl=function(e){var t=this.input.charCodeAt(this.pos+1);return 61===t?this.finishOp(L.equality,61===this.input.charCodeAt(this.pos+2)?3:2):61===e&&62===t&&this.options.ecmaVersion>=6?(this.pos+=2,this.finishToken(L.arrow)):this.finishOp(61===e?L.eq:L.prefix,1)},oe.getTokenFromCode=function(e){switch(e){case 46:return this.readToken_dot();case 40:return++this.pos,this.finishToken(L.parenL);case 41:return++this.pos,this.finishToken(L.parenR);case 59:return++this.pos,this.finishToken(L.semi);case 44:return++this.pos,this.finishToken(L.comma);case 91:return++this.pos,this.finishToken(L.bracketL);case 93:return++this.pos,this.finishToken(L.bracketR);case 123:return++this.pos,this.finishToken(L.braceL);case 125:return++this.pos,this.finishToken(L.braceR);case 58:return++this.pos,this.finishToken(L.colon);case 63:return++this.pos,this.finishToken(L.question);case 96:if(this.options.ecmaVersion<6)break;return++this.pos,this.finishToken(L.backQuote);case 48:var t=this.input.charCodeAt(this.pos+1);if(120===t||88===t)return this.readRadixNumber(16);if(this.options.ecmaVersion>=6){if(111===t||79===t)return this.readRadixNumber(8);if(98===t||66===t)return this.readRadixNumber(2)}case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return this.readNumber(!1);case 34:case 39:return this.readString(e);case 47:return this.readToken_slash();case 37:case 42:return this.readToken_mult_modulo_exp(e);case 124:case 38:return this.readToken_pipe_amp(e);case 94:return this.readToken_caret();case 43:case 45:return this.readToken_plus_min(e);case 60:case 62:return this.readToken_lt_gt(e);case 61:case 33:return this.readToken_eq_excl(e);case 126:return this.finishOp(L.prefix,1)}this.raise(this.pos,"Unexpected character '"+d(e)+"'")},oe.finishOp=function(e,t){var n=this.input.slice(this.pos,this.pos+t);return this.pos+=t,this.finishToken(e,n)};var ue=!!f("￿","u");oe.readRegexp=function(){for(var e,t,n=this,r=this.pos;;){n.pos>=n.input.length&&n.raise(r,"Unterminated regular expression");var i=n.input.charAt(n.pos);if(O.test(i)&&n.raise(r,"Unterminated regular expression"),e)e=!1;else{if("["===i)t=!0;else if("]"===i&&t)t=!1;else if("/"===i&&!t)break;e="\\"===i}++n.pos}var s=this.input.slice(r,this.pos);++this.pos;var o=this.readWord1(),a=s,u="";if(o){var c=/^[gim]*$/;this.options.ecmaVersion>=6&&(c=/^[gimuy]*$/),c.test(o)||this.raise(r,"Invalid regular expression flag"),o.indexOf("u")>=0&&(ue?u="u":(a=(a=a.replace(/\\u\{([0-9a-fA-F]+)\}/g,function(e,t,i){return(t=Number("0x"+t))>1114111&&n.raise(r+i+3,"Code point out of bounds"),"x"})).replace(/\\u([a-fA-F0-9]{4})|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,"x"),u=u.replace("u","")))}var l=null;return ae||(f(a,u,r,this),l=f(s,o)),this.finishToken(L.regexp,{pattern:s,flags:o,value:l})},oe.readInt=function(e,t){for(var n=this.pos,r=0,i=0,s=null==t?1/0:t;i=97?o-97+10:o>=65?o-65+10:o>=48&&o<=57?o-48:1/0)>=e)break;++this.pos,r=r*e+a}return this.pos===n||null!=t&&this.pos-n!==t?null:r},oe.readRadixNumber=function(e){this.pos+=2;var t=this.readInt(e);return null==t&&this.raise(this.start+2,"Expected number in radix "+e),n(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number"),this.finishToken(L.num,t)},oe.readNumber=function(e){var t=this.pos,r=!1,i=48===this.input.charCodeAt(this.pos);e||null!==this.readInt(10)||this.raise(t,"Invalid number"),i&&this.pos==t+1&&(i=!1);var s=this.input.charCodeAt(this.pos);46!==s||i||(++this.pos,this.readInt(10),r=!0,s=this.input.charCodeAt(this.pos)),69!==s&&101!==s||i||(43!==(s=this.input.charCodeAt(++this.pos))&&45!==s||++this.pos,null===this.readInt(10)&&this.raise(t,"Invalid number"),r=!0),n(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number");var o,a=this.input.slice(t,this.pos);return r?o=parseFloat(a):i&&1!==a.length?this.strict?this.raise(t,"Invalid number"):o=/[89]/.test(a)?parseInt(a,10):parseInt(a,8):o=parseInt(a,10),this.finishToken(L.num,o)},oe.readCodePoint=function(){var e;if(123===this.input.charCodeAt(this.pos)){this.options.ecmaVersion<6&&this.unexpected();var t=++this.pos;e=this.readHexChar(this.input.indexOf("}",this.pos)-this.pos),++this.pos,e>1114111&&this.invalidStringToken(t,"Code point out of bounds")}else e=this.readHexChar(4);return e},oe.readString=function(e){for(var t="",n=++this.pos;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated string constant");var r=this.input.charCodeAt(this.pos);if(r===e)break;92===r?(t+=this.input.slice(n,this.pos),t+=this.readEscapedChar(!1),n=this.pos):(o(r)&&this.raise(this.start,"Unterminated string constant"),++this.pos)}return t+=this.input.slice(n,this.pos++),this.finishToken(L.string,t)};var ce={};oe.tryReadTemplateToken=function(){this.inTemplateElement=!0;try{this.readTmplToken()}catch(e){if(e!==ce)throw e;this.readInvalidTemplateToken()}this.inTemplateElement=!1},oe.invalidStringToken=function(e,t){if(this.inTemplateElement&&this.options.ecmaVersion>=9)throw ce;this.raise(e,t)},oe.readTmplToken=function(){for(var e="",t=this.pos;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated template");var n=this.input.charCodeAt(this.pos);if(96===n||36===n&&123===this.input.charCodeAt(this.pos+1))return this.pos!==this.start||this.type!==L.template&&this.type!==L.invalidTemplate?(e+=this.input.slice(t,this.pos),this.finishToken(L.template,e)):36===n?(this.pos+=2,this.finishToken(L.dollarBraceL)):(++this.pos,this.finishToken(L.backQuote));if(92===n)e+=this.input.slice(t,this.pos),e+=this.readEscapedChar(!0),t=this.pos;else if(o(n)){switch(e+=this.input.slice(t,this.pos),++this.pos,n){case 13:10===this.input.charCodeAt(this.pos)&&++this.pos;case 10:e+="\n";break;default:e+=String.fromCharCode(n)}this.options.locations&&(++this.curLine,this.lineStart=this.pos),t=this.pos}else++this.pos}},oe.readInvalidTemplateToken=function(){for(;this.pos=48&&t<=55){var n=this.input.substr(this.pos-1,3).match(/^[0-7]+/)[0],r=parseInt(n,8);return r>255&&(n=n.slice(0,-1),r=parseInt(n,8)),"0"!==n&&(this.strict||e)&&this.invalidStringToken(this.pos-2,"Octal literal in strict mode"),this.pos+=n.length-1,String.fromCharCode(r)}return String.fromCharCode(t)}},oe.readHexChar=function(e){var t=this.pos,n=this.readInt(16,e);return null===n&&this.invalidStringToken(t,"Bad character escape sequence"),n},oe.readWord1=function(){this.containsEsc=!1;for(var e="",t=!0,i=this.pos,s=this.options.ecmaVersion>=6;this.pos=s)&&a[c](t,n,e),(null==r||t.start==r)&&(null==s||t.end==s)&&o(c,t))throw new i(t,n)}(n,u)}catch(e){if(e instanceof i)return e;throw e}},e.findNodeAround=function(n,r,s,o,a){s=t(s),o||(o=e.base);try{!function e(t,n,a){var u=a||t.type;if(!(t.start>r||t.end=r&&s(u,t))throw new i(t,n);o[u](t,n,e)}}(n,a)}catch(e){if(e instanceof i)return e;throw e}},e.findNodeBefore=function(n,r,s,o,a){s=t(s),o||(o=e.base);var u;return function e(t,n,a){if(!(t.start>r)){var c=a||t.type;t.end<=r&&(!u||u.node.end0)throw new Error("Invalid string. Length must be a multiple of 4");return"="===e[t-2]?2:"="===e[t-1]?1:0}function i(e){return o[e>>18&63]+o[e>>12&63]+o[e>>6&63]+o[63&e]}function s(e,t,n){for(var r,s=[],o=t;o0?c-4:c;var l=0;for(t=0;t>16&255,o[l++]=i>>8&255,o[l++]=255&i;return 2===s?(i=a[e.charCodeAt(t)]<<2|a[e.charCodeAt(t+1)]>>4,o[l++]=255&i):1===s&&(i=a[e.charCodeAt(t)]<<10|a[e.charCodeAt(t+1)]<<4|a[e.charCodeAt(t+2)]>>2,o[l++]=i>>8&255,o[l++]=255&i),o},n.fromByteArray=function(e){for(var t,n=e.length,r=n%3,i="",a=[],u=0,c=n-r;uc?c:u+16383));return 1===r?(t=e[n-1],i+=o[t>>2],i+=o[t<<4&63],i+="=="):2===r&&(t=(e[n-2]<<8)+e[n-1],i+=o[t>>10],i+=o[t>>4&63],i+=o[t<<2&63],i+="="),a.push(i),a.join("")};for(var o=[],a=[],u="undefined"!=typeof Uint8Array?Uint8Array:Array,c="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",l=0,p=c.length;lB)throw new RangeError("Invalid typed array length");var t=new Uint8Array(e);return t.__proto__=i.prototype,t}function i(e,t,n){if("number"==typeof e){if("string"==typeof t)throw new Error("If encoding is specified then the first argument must be a string");return a(e)}return s(e,t,n)}function s(e,t,n){if("number"==typeof e)throw new TypeError('"value" argument must not be a number');return T(e)?function(e,t,n){if(t<0||e.byteLength=B)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+B.toString(16)+" bytes");return 0|e}function l(e,t){if(i.isBuffer(e))return e.length;if(N(e)||T(e))return e.byteLength;"string"!=typeof e&&(e=""+e);var n=e.length;if(0===n)return 0;for(var r=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return _(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return L(e).length;default:if(r)return _(e).length;t=(""+t).toLowerCase(),r=!0}}function p(e,t,n){var r=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if(n>>>=0,t>>>=0,n<=t)return"";for(e||(e="utf8");;)switch(e){case"hex":return function(e,t,n){var r=e.length;(!t||t<0)&&(t=0);(!n||n<0||n>r)&&(n=r);for(var i="",s=t;s2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,P(n)&&(n=s?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(s)return-1;n=e.length-1}else if(n<0){if(!s)return-1;n=0}if("string"==typeof t&&(t=i.from(t,r)),i.isBuffer(t))return 0===t.length?-1:d(e,t,n,r,s);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?s?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):d(e,[t],n,r,s);throw new TypeError("val must be string, number or Buffer")}function d(e,t,n,r,i){function s(e,t){return 1===o?e[t]:e.readUInt16BE(t*o)}var o=1,a=e.length,u=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;o=2,a/=2,u/=2,n/=2}var c;if(i){var l=-1;for(c=n;ca&&(n=a-u),c=n;c>=0;c--){for(var p=!0,h=0;hi&&(r=i):r=i;var s=t.length;if(s%2!=0)throw new TypeError("Invalid hex string");r>s/2&&(r=s/2);for(var o=0;o>8,i=n%256,s.push(i),s.push(r);return s}(t,e.length-n),e,n,r)}function w(e,t,n){n=Math.min(e.length,n);for(var r=[],i=t;i239?4:s>223?3:s>191?2:1;if(i+a<=n){var u,c,l,p;switch(a){case 1:s<128&&(o=s);break;case 2:128==(192&(u=e[i+1]))&&(p=(31&s)<<6|63&u)>127&&(o=p);break;case 3:u=e[i+1],c=e[i+2],128==(192&u)&&128==(192&c)&&(p=(15&s)<<12|(63&u)<<6|63&c)>2047&&(p<55296||p>57343)&&(o=p);break;case 4:u=e[i+1],c=e[i+2],l=e[i+3],128==(192&u)&&128==(192&c)&&128==(192&l)&&(p=(15&s)<<18|(63&u)<<12|(63&c)<<6|63&l)>65535&&p<1114112&&(o=p)}}null===o?(o=65533,a=1):o>65535&&(o-=65536,r.push(o>>>10&1023|55296),o=56320|1023&o),r.push(o),i+=a}return function(e){var t=e.length;if(t<=R)return String.fromCharCode.apply(String,e);var n="",r=0;for(;rn)throw new RangeError("Trying to access beyond buffer length")}function S(e,t,n,r,s,o){if(!i.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>s||te.length)throw new RangeError("Index out of range")}function k(e,t,n,r,i,s){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function A(e,t,n,r,i){return t=+t,n>>>=0,i||k(e,0,n,4),$.write(e,t,n,r,23,4),n+4}function C(e,t,n,r,i){return t=+t,n>>>=0,i||k(e,0,n,8),$.write(e,t,n,r,52,8),n+8}function _(e,t){t=t||1/0;for(var n,r=e.length,i=null,s=[],o=0;o55295&&n<57344){if(!i){if(n>56319){(t-=3)>-1&&s.push(239,191,189);continue}if(o+1===r){(t-=3)>-1&&s.push(239,191,189);continue}i=n;continue}if(n<56320){(t-=3)>-1&&s.push(239,191,189),i=n;continue}n=65536+(i-55296<<10|n-56320)}else i&&(t-=3)>-1&&s.push(239,191,189);if(i=null,n<128){if((t-=1)<0)break;s.push(n)}else if(n<2048){if((t-=2)<0)break;s.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;s.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;s.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return s}function L(e){return F.toByteArray(function(e){if((e=e.trim().replace(I,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function O(e,t,n,r){for(var i=0;i=t.length||i>=e.length);++i)t[i+n]=e[i];return i}function T(e){return e instanceof ArrayBuffer||null!=e&&null!=e.constructor&&"ArrayBuffer"===e.constructor.name&&"number"==typeof e.byteLength}function N(e){return"function"==typeof ArrayBuffer.isView&&ArrayBuffer.isView(e)}function P(e){return e!=e}var F=e("base64-js"),$=e("ieee754");n.Buffer=i,n.SlowBuffer=function(e){return+e!=e&&(e=0),i.alloc(+e)},n.INSPECT_MAX_BYTES=50;var B=2147483647;n.kMaxLength=B,(i.TYPED_ARRAY_SUPPORT=function(){try{var e=new Uint8Array(1);return e.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===e.foo()}catch(e){return!1}}())||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),"undefined"!=typeof Symbol&&Symbol.species&&i[Symbol.species]===i&&Object.defineProperty(i,Symbol.species,{value:null,configurable:!0,enumerable:!1,writable:!1}),i.poolSize=8192,i.from=function(e,t,n){return s(e,t,n)},i.prototype.__proto__=Uint8Array.prototype,i.__proto__=Uint8Array,i.alloc=function(e,t,n){return function(e,t,n){return o(e),e<=0?r(e):void 0!==t?"string"==typeof n?r(e).fill(t,n):r(e).fill(t):r(e)}(e,t,n)},i.allocUnsafe=function(e){return a(e)},i.allocUnsafeSlow=function(e){return a(e)},i.isBuffer=function(e){return null!=e&&!0===e._isBuffer},i.compare=function(e,t){if(!i.isBuffer(e)||!i.isBuffer(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var n=e.length,r=t.length,s=0,o=Math.min(n,r);s0&&(e=this.toString("hex",0,t).match(/.{2}/g).join(" "),this.length>t&&(e+=" ... ")),""},i.prototype.compare=function(e,t,n,r,s){if(!i.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===r&&(r=0),void 0===s&&(s=this.length),t<0||n>e.length||r<0||s>this.length)throw new RangeError("out of range index");if(r>=s&&t>=n)return 0;if(r>=s)return-1;if(t>=n)return 1;if(t>>>=0,n>>>=0,r>>>=0,s>>>=0,this===e)return 0;for(var o=s-r,a=n-t,u=Math.min(o,a),c=this.slice(r,s),l=e.slice(t,n),p=0;p>>=0,isFinite(n)?(n>>>=0,void 0===r&&(r="utf8")):(r=n,n=void 0)}var i=this.length-t;if((void 0===n||n>i)&&(n=i),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var s=!1;;)switch(r){case"hex":return y(this,e,t,n);case"utf8":case"utf-8":return m(this,e,t,n);case"ascii":return g(this,e,t,n);case"latin1":case"binary":return v(this,e,t,n);case"base64":return b(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return x(this,e,t,n);default:if(s)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),s=!0}},i.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var R=4096;i.prototype.slice=function(e,t){var n=this.length;e=~~e,t=void 0===t?n:~~t,e<0?(e+=n)<0&&(e=0):e>n&&(e=n),t<0?(t+=n)<0&&(t=0):t>n&&(t=n),t>>=0,t>>>=0,n||E(e,t,this.length);for(var r=this[e],i=1,s=0;++s>>=0,t>>>=0,n||E(e,t,this.length);for(var r=this[e+--t],i=1;t>0&&(i*=256);)r+=this[e+--t]*i;return r},i.prototype.readUInt8=function(e,t){return e>>>=0,t||E(e,1,this.length),this[e]},i.prototype.readUInt16LE=function(e,t){return e>>>=0,t||E(e,2,this.length),this[e]|this[e+1]<<8},i.prototype.readUInt16BE=function(e,t){return e>>>=0,t||E(e,2,this.length),this[e]<<8|this[e+1]},i.prototype.readUInt32LE=function(e,t){return e>>>=0,t||E(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},i.prototype.readUInt32BE=function(e,t){return e>>>=0,t||E(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},i.prototype.readIntLE=function(e,t,n){e>>>=0,t>>>=0,n||E(e,t,this.length);for(var r=this[e],i=1,s=0;++s=i&&(r-=Math.pow(2,8*t)),r},i.prototype.readIntBE=function(e,t,n){e>>>=0,t>>>=0,n||E(e,t,this.length);for(var r=t,i=1,s=this[e+--r];r>0&&(i*=256);)s+=this[e+--r]*i;return i*=128,s>=i&&(s-=Math.pow(2,8*t)),s},i.prototype.readInt8=function(e,t){return e>>>=0,t||E(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},i.prototype.readInt16LE=function(e,t){e>>>=0,t||E(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},i.prototype.readInt16BE=function(e,t){e>>>=0,t||E(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},i.prototype.readInt32LE=function(e,t){return e>>>=0,t||E(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},i.prototype.readInt32BE=function(e,t){return e>>>=0,t||E(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},i.prototype.readFloatLE=function(e,t){return e>>>=0,t||E(e,4,this.length),$.read(this,e,!0,23,4)},i.prototype.readFloatBE=function(e,t){return e>>>=0,t||E(e,4,this.length),$.read(this,e,!1,23,4)},i.prototype.readDoubleLE=function(e,t){return e>>>=0,t||E(e,8,this.length),$.read(this,e,!0,52,8)},i.prototype.readDoubleBE=function(e,t){return e>>>=0,t||E(e,8,this.length),$.read(this,e,!1,52,8)},i.prototype.writeUIntLE=function(e,t,n,r){if(e=+e,t>>>=0,n>>>=0,!r){S(this,e,t,n,Math.pow(2,8*n)-1,0)}var i=1,s=0;for(this[t]=255&e;++s>>=0,n>>>=0,!r){S(this,e,t,n,Math.pow(2,8*n)-1,0)}var i=n-1,s=1;for(this[t+i]=255&e;--i>=0&&(s*=256);)this[t+i]=e/s&255;return t+n},i.prototype.writeUInt8=function(e,t,n){return e=+e,t>>>=0,n||S(this,e,t,1,255,0),this[t]=255&e,t+1},i.prototype.writeUInt16LE=function(e,t,n){return e=+e,t>>>=0,n||S(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},i.prototype.writeUInt16BE=function(e,t,n){return e=+e,t>>>=0,n||S(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},i.prototype.writeUInt32LE=function(e,t,n){return e=+e,t>>>=0,n||S(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},i.prototype.writeUInt32BE=function(e,t,n){return e=+e,t>>>=0,n||S(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},i.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t>>>=0,!r){var i=Math.pow(2,8*n-1);S(this,e,t,n,i-1,-i)}var s=0,o=1,a=0;for(this[t]=255&e;++s>0)-a&255;return t+n},i.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t>>>=0,!r){var i=Math.pow(2,8*n-1);S(this,e,t,n,i-1,-i)}var s=n-1,o=1,a=0;for(this[t+s]=255&e;--s>=0&&(o*=256);)e<0&&0===a&&0!==this[t+s+1]&&(a=1),this[t+s]=(e/o>>0)-a&255;return t+n},i.prototype.writeInt8=function(e,t,n){return e=+e,t>>>=0,n||S(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},i.prototype.writeInt16LE=function(e,t,n){return e=+e,t>>>=0,n||S(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},i.prototype.writeInt16BE=function(e,t,n){return e=+e,t>>>=0,n||S(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},i.prototype.writeInt32LE=function(e,t,n){return e=+e,t>>>=0,n||S(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},i.prototype.writeInt32BE=function(e,t,n){return e=+e,t>>>=0,n||S(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},i.prototype.writeFloatLE=function(e,t,n){return A(this,e,t,!0,n)},i.prototype.writeFloatBE=function(e,t,n){return A(this,e,t,!1,n)},i.prototype.writeDoubleLE=function(e,t,n){return C(this,e,t,!0,n)},i.prototype.writeDoubleBE=function(e,t,n){return C(this,e,t,!1,n)},i.prototype.copy=function(e,t,n,r){if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t=0;--i)e[i+t]=this[i+n];else if(s<1e3)for(i=0;i>>=0,n=void 0===n?this.length:n>>>0,e||(e=0);var o;if("number"==typeof e)for(o=t;o>1,l=-7,p=n?i-1:0,h=n?-1:1,f=e[t+p];for(p+=h,s=f&(1<<-l)-1,f>>=-l,l+=a;l>0;s=256*s+e[t+p],p+=h,l-=8);for(o=s&(1<<-l)-1,s>>=-l,l+=r;l>0;o=256*o+e[t+p],p+=h,l-=8);if(0===s)s=1-c;else{if(s===u)return o?NaN:1/0*(f?-1:1);o+=Math.pow(2,r),s-=c}return(f?-1:1)*o*Math.pow(2,s-r)},n.write=function(e,t,n,r,i,s){var o,a,u,c=8*s-i-1,l=(1<>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,f=r?0:s-1,d=r?1:-1,y=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,o=l):(o=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-o))<1&&(o--,u*=2),(t+=o+p>=1?h/u:h*Math.pow(2,1-p))*u>=2&&(o++,u/=2),o+p>=l?(a=0,o=l):o+p>=1?(a=(t*u-1)*Math.pow(2,i),o+=p):(a=t*Math.pow(2,p-1)*Math.pow(2,i),o=0));i>=8;e[n+f]=255&a,f+=d,a/=256,i-=8);for(o=o<0;e[n+f]=255&o,f+=d,o/=256,c-=8);e[n+f-d]|=128*y}},{}],10:[function(e,t,n){(function(n){function r(){}function i(e){this.covers={},this._ident=i.prototype.version+"_"+Math.random(),this.setOptions(e||{})}var s=e("./lib/parser"),o=e("./lib/arboriculture"),a=e("./lib/output");i.prototype.smCache={},i.prototype.setOptions=function(e){return this.log=!1===e.log?r:e.log||this.log,this.options=function(e){var t={};return e.forEach(function(e){if(e&&"object"==typeof e)for(var n in e)t[n]=e[n]}),t}([this.options,e]),delete this.options.log,this},i.prototype.version=e("./package.json").version,i.prototype.isThenable=function(e){return e&&e instanceof Object&&"function"==typeof e.then},i.prototype.compile=function(e,t,n,s){"object"==typeof n&&void 0===s&&(s=n),s=s||{};for(var o in i.initialCodeGenOpts)o in s||(s[o]=i.initialCodeGenOpts[o]);var a=this.parse(e,t,null,s);return this.asynchronize(a,null,s,this.log||r),this.prettyPrint(a,s),a},i.prototype.parse=function(e,t,n,r){"object"==typeof n&&void 0===r&&(r=n);var i={origCode:e.toString(),filename:t};try{return i.ast=s.parse(i.origCode,r&&r.parser),r.babelTree&&s.treeWalker(i.ast,function(e,t,n){"Literal"===e.type?n[0].replace(o.babelLiteralNode(e.value)):"Property"===e.type&&("ClassBody"===n[0].parent.type?e.type="ClassProperty":e.type="ObjectProperty"),t()}),i}catch(e){if(e instanceof SyntaxError){var a=i.origCode.substr(e.pos-e.loc.column);a=a.split("\n")[0],e.message+=" "+t+" (nodent)\n"+a+"\n"+a.replace(/[\S ]/g,"-").substring(0,e.loc.column)+"^",e.stack=""}throw e}},i.prototype.asynchronize=o.asynchronize,i.prototype.printNode=o.printNode,i.prototype.prettyPrint=function(t,r){var i=t.filename?t.filename.split("/"):["anonymous"],s=i.pop(),o=a(t.ast,r&&r.sourcemap?{map:{startLine:r.mapStartLine||0,file:s+"(original)",sourceMapRoot:i.join("/"),sourceContent:t.origCode}}:null,t.origCode);if(r&&r.sourcemap)try{var u="",c=o.map.toJSON();if(c){var l=e("source-map").SourceMapConsumer;t.sourcemap=c,this.smCache[t.filename]={map:c,smc:new l(c)},u="\n\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,"+function(e){return(e instanceof n?e:new n(e.toString(),"binary")).toString("base64")}(JSON.stringify(c))+"\n"}t.code=o.code+u}catch(e){t.code=o}else t.code=o;return t},i.prototype.getDefaultCompileOptions=void 0,Object.defineProperty(i.prototype,"Promise",{get:function(){return initOpts.log("Warning: nodent.Promise is deprecated. Use nodent.Thenable instead"),Thenable},enumerable:!1,configurable:!1}),i.initialCodeGenOpts={noRuntime:!1,lazyThenables:!1,es6target:!1,noUseDirective:!1,wrapAwait:null,mapStartLine:0,sourcemap:!0,engine:!1,parser:{sourceType:"script"},$return:"$return",$error:"$error",$arguments:"$args",$asyncspawn:"$asyncspawn",$asyncbind:"$asyncbind",generatedSymbolPrefix:"$",$makeThenable:"$makeThenable"},t.exports=i}).call(this,e("buffer").Buffer)},{"./lib/arboriculture":11,"./lib/output":12,"./lib/parser":13,"./package.json":25,buffer:8,"source-map":24}],11:[function(e,t,n){"use strict";function r(e){if(!e)return"";if(Array.isArray(e))return e.map(r).join("|\n");try{return m(e)}catch(t){return t.message+": "+(e&&e.type)}}function i(e){if(Array.isArray(e))return e.map(function(e){return i(e)});var t={};return Object.keys(e).forEach(function(n){t[n]=e[n]}),t}function s(e,t){e!==t&&(e.__proto__=Object.getPrototypeOf(t),Object.keys(e).forEach(function(t){t in g||delete e[t]}),Object.keys(t).forEach(function(n){n in e||(e[n]=t[n])}))}function o(){}function a(e){return e?(b.node=e,b):{}}function u(e,t,n){if(!e)return null;if(t&&"object"==typeof t){var r=Object.keys(t);return u(e,function(e){return r.every(function(n){return e[n]==t[n]})})}var i,s={};if(Array.isArray(e)){for(var o=0;o0){if(!o)return t(e);delete e.async}return void(!o&&i?t():(e.type="ReturnStatement",e.$mapped=!0,e.argument={type:"CallExpression",callee:k(s,[n]).$error,arguments:[e.argument]}))}return"TryStatement"===e.type?(i++,t(e),void i--):a(e).isFunction?(r++,t(e),void r--):void t(e)}if(r>0){if(!a(e).isAsync)return t(e);delete e.async}return e.$mapped=!0,void(a(e.argument).isUnaryExpression&&"void"===e.argument.operator?e.argument=e.argument.argument:e.argument={type:"CallExpression",callee:k(s,[n]).$return,arguments:e.argument?[e.argument]:[]})},t)}function P(e,t){return Array.isArray(e)?e.map(function(e){return P(e,t)}):(y.treeWalker(e,function(e,t,n){if(t(),"ConditionalExpression"===e.type&&(c(e.alternate)||c(e.consequent))){h(E("condOp"));s(e,_(y.part("if ($0) return $1 ; return $2",[e.test,e.consequent,e.alternate]).body))}},t),e)}function F(e,t){return Array.isArray(e)?e.map(function(e){return F(e,t)}):(y.treeWalker(e,function(e,t,n){if(t(),"LogicalExpression"===e.type&&c(e.right)){var r,i=h(E("logical"+("&&"===e.operator?"And":"Or")));if("||"===e.operator)r="var $0; if (!($0 = $1)) {$0 = $2} return $0";else{if("&&"!==e.operator)throw new Error(v(e)+"Illegal logical operator: "+e.operator);r="var $0; if ($0 = $1) {$0 = $2} return $0"}s(e,_(y.part(r,[i,e.left,e.right]).body))}},t),e)}function $(e,t,n){if("SwitchCase"!==e.type&&a(e).isBlockStatement)for(var r=0;r { $$setMapped: while (q) { if (q.then) "+(1===i?" return void q.then($idTrampoline, $exit); ":" return q.then($idTrampoline, $exit); ")+" try { if (q.pop) if (q.length) return q.pop() ? $idContinuation.call(this) : q; else q = $idStep; else q = q.call(this) } catch (_exception) { return $exit(_exception); } } }))($idIter)":"($idTrampoline = (function (q) { $$setMapped: while (q) { if (q.then) "+(1===i?" return void q.then($idTrampoline, $exit); ":" return q.then($idTrampoline, $exit); ")+" try { if (q.pop) if (q.length) return q.pop() ? $idContinuation.call(this) : q; else q = $idStep; else q = q.call(this) } catch (_exception) { return $exit(_exception); } } }).bind(this))($idIter)",{setMapped:function(e){return e.$mapped=!0,e},idTrampoline:w,exit:P,idIter:E,idContinuation:A,idStep:S}).expr:y.part("(Function.$0.trampoline(this,$1,$2,$3,$5)($4))",[pe.asyncbind,A,S,P,E,b(1===i)]).expr,o.push({type:"ReturnStatement",argument:N}),o.push({$label:e.$label,type:"FunctionDeclaration",id:E,params:[],body:{type:"BlockStatement",body:d}}),f&&o.push({type:"FunctionDeclaration",id:S,params:[],body:{type:"BlockStatement",body:[f,L]}}),!l||"VariableDeclaration"!==l.type||"let"!==l.kind&&"const"!==l.kind?(o.push(v),t[0].replace(o.map(r))):("const"===l.kind&&(l.kind="let"),t[0].replace([{type:"BlockStatement",body:o.map(r)},r(v)]))}}function G(e){if(!a(e).isFunction)throw new Error("Cannot examine non-Function node types for async exits");return u(e.body,function(e){return"Identifier"===e.type&&(e.name===n.$return||e.name===n.$error)||I(e)&&a(e).isAsync},function(e){return!(a(e).isFunction&&(e.$wasAsync||a(e).isAsync))})}function J(t){return y.treeWalker(t,function(t,r,i){var s=x(t);if(r(),s&&a(s).isAsync){if("set"==t.kind){var o=new SyntaxError(v(s)+"method 'async set' cannot be invoked",e.filename,t.start);throw o.pos=t.start,o.loc=t.loc.start,o}s.async=!1;var u=w(s);G(s)||0!==s.body.body.length&&"ReturnStatement"===s.body.body[s.body.body.length-1].type||s.body.body.push({type:"ReturnStatement"});var c=m(S({type:"FunctionExpression",params:[pe.return,pe.error],body:J(N(s.body,i)),$wasAsync:!0},n),n.promises||n.generators||n.engine?null:b(!n.lazyThenables||0));n.promises?s.body={type:"BlockStatement",body:[{type:"ReturnStatement",argument:{type:"NewExpression",callee:h("Promise"),arguments:[c]}}]}:s.body={type:"BlockStatement",body:[{type:"ReturnStatement",argument:c}]},u&&D(s.body.body,[he])}})}function H(e){return y.treeWalker(e,function(e,t,r){if(t(),a(e).isAsync&&a(e).isFunction){var i;(i=x(r[0].parent))&&a(i).isAsync&&"get"===r[0].parent.kind&&X(r[0].parent.key),delete e.async;var s=w(e),o=S({type:"FunctionExpression",params:[pe.return,pe.error],$wasAsync:!0},n),u=[{self:o}].concat(r);return a(e.body).isBlockStatement?(G(e)||0!==e.body.body.length&&"ReturnStatement"===e.body.body[e.body.body.length-1].type||e.body.body.push({type:"ReturnStatement"}),o.body={type:"BlockStatement",body:e.body.body.map(function(e){return N(e,u)})}):(o.body={type:"BlockStatement",body:[N({type:"ReturnStatement",argument:e.body},u)]},e.expression=!1),o=m(o,n.promises||n.generators||n.engine?null:b(!n.lazyThenables||0)),n.promises&&(o={type:"NewExpression",callee:h("Promise"),arguments:[o]}),o={type:"BlockStatement",body:[{type:"ReturnStatement",loc:e.loc,argument:o}]},s&&D(o.body,[he]),void(e.body=o)}}),e}function Y(e){if(Array.isArray(e))return e.map(Y);var t=0;return y.treeWalker(e,function(e,n,r){if("ThrowStatement"!==e.type&&"ReturnStatement"!==e.type||e.$mapped){if(a(e).isFunction)return t++,n(e),void t--}else if(t>0&&a(e).isAsync)return delete e.async,e.argument={type:"CallExpression",callee:"ThrowStatement"===e.type?pe.error:pe.return,arguments:e.argument?[e.argument]:[]},void(e.type="ReturnStatement");n(e)})}function Q(e,t){if(n.noRuntime)throw new Error("Nodent: 'noRuntime' option only compatible with -promise and -engine modes");return y.part("{ return (function*($return,$error){ $:body }).$asyncspawn(Promise,this) }",{return:pe.return,error:pe.error,asyncspawn:pe.asyncspawn,body:Y(e).concat(t?[{type:"ReturnStatement",argument:pe.return}]:[])}).body[0]}function X(e){e.$asyncgetwarninig||(e.$asyncgetwarninig=!0,d(v(e)+"'async get "+r(e)+"(){...}' is non-standard. See https://github.com/MatAtBread/nodent#differences-from-the-es7-specification"))}function Z(e,t){function r(e,t){y.treeWalker(e,function(n,r,i){n!==e&&a(n).isFunction||(a(n).isAwait?t?(n.$hidden=!0,r()):(delete n.operator,n.delegate=!1,n.type="YieldExpression",r()):r())})}function o(e){var t=n.promises;n.promises=!0,A(e,!0),n.promises=t}function u(e){return"BlockStatement"!==e.body.type&&(e.body={type:"BlockStatement",body:[{type:"ReturnStatement",argument:e.body}]}),e}function c(e,n){n.$asyncexitwarninig||(n.$asyncexitwarninig=!0,d(v(e)+"'async "+{ReturnStatement:"return",ThrowStatement:"throw"}[e.type]+"' not possible in "+(t?"engine":"generator")+" mode. Using Promises for function at "+v(n)))}y.treeWalker(e,function(e,n,i){n();var l,p,h;if(a(e).isAsync&&a(e).isFunction){var f;(f=x(i[0].parent))&&a(f).isAsync&&"get"===i[0].parent.kind&&X(i[0].parent.key),(p=G(e))?(c(p,e.body),o(e)):t?"get"!==i[0].parent.kind&&r(e,!0):(delete(l=e).async,h=w(l),r(l,!1),(l=u(l)).body=Q(l.body.body,p),h&&D(l.body.body,[he]),l.id&&"ExpressionStatement"===i[0].parent.type?(l.type="FunctionDeclaration",i[1].replace(l)):i[0].replace(l))}else(l=x(e))&&a(l).isAsync&&((p=G(l))?(c(p,l),o(e)):t&&"get"!==e.kind||(t?o(e):(e.async=!1,h=w(l),r(l,!1),s(l,u(l)),l.body=Q(l.body.body,p)),h&&D(l.body.body,[he])))});var l=i(n);return n.engine=!1,n.generators=!1,ie(e),ne(e),j(e,l.engine),F(e),P(e),V(e,[M,W,B,R,$]),q(e,"warn"),n.engine=l.engine,n.generators=l.generators,e}function K(e,t,n){var r=[];return y.treeWalker(e,function(i,s,o){if(i===e)return s();t(i,o)?r.push([].concat(o)):n||a(i).isScope||s()}),r}function ee(e,t){var n=[],r={};if((e=e.filter(function(e){return"ExportNamedDeclaration"!==e[0].parent.type})).length){var s={};e.forEach(function(e){function t(e){e in s?r[e]=o.declarations[u]:s[e]=o.declarations[u]}for(var n=e[0],o=n.self,a=(o.kind,[]),u=0;u1?{type:"SequenceExpression",expressions:a}:a[0];"For"!==n.parent.type.slice(0,3)&&(p={type:"ExpressionStatement",expression:p}),n.replace(p)}});var o=Object.keys(s);o.length&&(o=o.map(function(e){return{type:"VariableDeclarator",id:h(e),loc:s[e].loc,start:s[e].start,end:s[e].end}}),n[0]&&"VariableDeclaration"===n[0].type?n[0].declarations=n[0].declarations.concat(o):n.unshift({type:"VariableDeclaration",kind:t,declarations:o}))}return{decls:n,duplicates:r}}function te(e){if(!e)return[];if(Array.isArray(e))return e.reduce(function(e,t){return e.concat(te(t.id))},[]);switch(e.type){case"Identifier":return[e.name];case"AssignmentPattern":return te(e.left);case"ArrayPattern":return e.elements.reduce(function(e,t){return e.concat(te(t))},[]);case"ObjectPattern":return e.properties.reduce(function(e,t){return e.concat(te(t))},[]);case"ObjectProperty":case"Property":return te(e.value);case"RestElement":case"RestProperty":return te(e.argument)}}function ne(e){function t(e){return u(e,function(e){return"AssignmentExpression"===e.type})}function n(e){return function(t,n){if("VariableDeclaration"===t.type&&(t.kind=t.kind||"var")&&e.indexOf(t.kind)>=0){var r=n[0];return("left"!=r.field||"ForInStatement"!==r.parent.type&&"ForOfStatement"!==r.parent.type)&&("init"!=r.field||"ForStatement"!==r.parent.type||"const"!==t.kind&&"let"!==t.kind)}}}function o(e,t){return!("FunctionDeclaration"!==e.type||!e.id)&&(a(e).isAsync||!e.$continuation)}var l={TemplateLiteral:function(e){return e.expressions},NewExpression:function(e){return e.arguments},CallExpression:function(e){return e.arguments},SequenceExpression:function(e){return e.expressions},ArrayExpression:function(e){return e.elements},ObjectExpression:function(e){return e.properties.map(function(e){return e.value})}};y.treeWalker(e,function(e,n,r){function o(e){h.length&&(e.argument={type:"SequenceExpression",expressions:h.map(function(e){var t=i(e);return s(e,e.left),t}).concat(e.argument)},h=[])}var u;if(n(),e.type in l&&!e.$hoisted){var p=l[e.type](e),h=[];for(u=0;u0;u--)if(e.declarations[u]&&e.declarations[u].init&&c(e.declarations[u].init)){var f={type:"VariableDeclaration",kind:e.kind,declarations:e.declarations.splice(u)},d=r[0];if(!("index"in d))throw new Error("VariableDeclaration not in a block");d.parent[d.field].splice(d.index+1,0,f)}}),function(e){function t(e){d(v(e)+"Possible assignment to 'const "+r(e)+"'")}function n(e){switch(e.type){case"Identifier":"const"===i[e.name]&&t(e);break;case"ArrayPattern":e.elements.forEach(function(e){"const"===i[e.name]&&t(e)});break;case"ObjectPattern":e.properties.forEach(function(e){"const"===i[e.key.name]&&t(e)})}}var i={};y.treeWalker(e,function(e,t,r){var s=a(e).isBlockStatement;if(s){i=Object.create(i);for(var o=0;o=0&&"ReturnStatement"===r[1].self.type){var s=e.$thisCallName,o=i(ce[s].def.body.body);ce[s].$inlined=!0,a(r[1].self).isJump||o.push({type:"ReturnStatement"}),r[1].replace(o)}});var n=Object.keys(ce).map(function(e){return ce[e].$inlined&&ce[e].def});y.treeWalker(e,function(e,t,r){t(),n.indexOf(e)>=0&&r[0].remove()})}if(!("Program"===e.type&&"module"===e.sourceType||u(e,function(e){return a(e).isES6},!0))){var r=oe(e);!function(e){y.treeWalker(e,function(e,t,n){if("Program"===e.type||"FunctionDeclaration"===e.type||"FunctionExpression"===e.type){var i=r;if(r=r||oe(e)){t();var s="Program"===e.type?e:e.body,o=K(s,function(e,t){if("FunctionDeclaration"===e.type)return t[0].parent!==s});o=o.map(function(e){return e[0].remove()}),[].push.apply(s.body,o)}else t();r=i}else t()})}(e)}return y.treeWalker(e,function(e,t,n){t(),Object.keys(e).filter(function(e){return"$"===e[0]}).forEach(function(t){delete e[t]})}),e}var ce={},le=1,pe={};Object.keys(n).filter(function(e){return"$"===e[0]}).forEach(function(e){pe[e.slice(1)]=h(n[e])});var he=y.part("var $0 = arguments",[pe.arguments]).body[0];return n.engine?(e.ast=re(e.ast,!0),e.ast=Z(e.ast,n.engine),e.ast=se(e.ast),ue(e.ast)):n.generators?(e.ast=re(e.ast),e.ast=Z(e.ast),e.ast=se(e.ast),ue(e.ast)):(e.ast=re(e.ast),A(e.ast)),n.babelTree&&y.treeWalker(e.ast,function(e,t,n){t(),"Literal"===e.type&&s(e,b(e.value))}),e}var y=e("./parser"),m=e("./output"),g={start:!0,end:!0,loc:!0,range:!0},v={getScope:function(){return"FunctionDeclaration"===this.node.type||"FunctionExpression"===this.node.type||"Function"===this.node.type||"ObjectMethod"===this.node.type||"ClassMethod"===this.node.type||"ArrowFunctionExpression"===this.node.type&&"BlockStatement"===this.node.body.type?this.node.body.body:"Program"===this.node.type?this.node.body:null},isScope:function(){return"FunctionDeclaration"===this.node.type||"FunctionExpression"===this.node.type||"Function"===this.node.type||"Program"===this.node.type||"ObjectMethod"===this.node.type||"ClassMethod"===this.node.type||"ArrowFunctionExpression"===this.node.type&&"BlockStatement"===this.node.body.type},isFunction:function(){return"FunctionDeclaration"===this.node.type||"FunctionExpression"===this.node.type||"Function"===this.node.type||"ObjectMethod"===this.node.type||"ClassMethod"===this.node.type||"ArrowFunctionExpression"===this.node.type},isClass:function(){return"ClassDeclaration"===this.node.type||"ClassExpression"===this.node.type},isBlockStatement:function(){return"ClassBody"===this.node.type||"Program"===this.node.type||"BlockStatement"===this.node.type?this.node.body:"SwitchCase"===this.node.type&&this.node.consequent},isExpressionStatement:function(){return"ExpressionStatement"===this.node.type},isLiteral:function(){return"Literal"===this.node.type||"BooleanLiteral"===this.node.type||"RegExpLiteral"===this.node.type||"NumericLiteral"===this.node.type||"StringLiteral"===this.node.type||"NullLiteral"===this.node.type},isDirective:function(){return"ExpressionStatement"===this.node.type&&("StringLiteral"===this.node.expression.type||"Literal"===this.node.expression.type&&"string"==typeof this.node.expression.value)},isUnaryExpression:function(){return"UnaryExpression"===this.node.type},isAwait:function(){return"AwaitExpression"===this.node.type&&!this.node.$hidden},isAsync:function(){return this.node.async},isStatement:function(){return null!==this.node.type.match(/[a-zA-Z]+Declaration/)||null!==this.node.type.match(/[a-zA-Z]+Statement/)},isExpression:function(){return null!==this.node.type.match(/[a-zA-Z]+Expression/)},isLoop:function(){return"ForStatement"===this.node.type||"WhileStatement"===this.node.type||"DoWhileStatement"===this.node.type},isJump:function(){return"ReturnStatement"===this.node.type||"ThrowStatement"===this.node.type||"BreakStatement"===this.node.type||"ContinueStatement"===this.node.type},isES6:function(){switch(this.node.type){case"ExportNamedDeclaration":case"ExportSpecifier":case"ExportDefaultDeclaration":case"ExportAllDeclaration":case"ImportDeclaration":case"ImportSpecifier":case"ImportDefaultSpecifier":case"ImportNamespaceSpecifier":case"ArrowFunctionExpression":case"ForOfStatement":case"YieldExpression":case"Super":case"RestElement":case"RestProperty":case"SpreadElement":case"TemplateLiteral":case"ClassDeclaration":case"ClassExpression":return!0;case"VariableDeclaration":return this.node.kind&&"var"!==this.node.kind;case"FunctionDeclaration":case"FunctionExpression":return!!this.node.generator}}},b={};Object.keys(v).forEach(function(e){Object.defineProperty(b,e,{get:v[e]})}),t.exports={printNode:r,babelLiteralNode:p,asynchronize:function(e,t,n,r){try{return d(e,0,n,r)}catch(t){if(t instanceof SyntaxError){var i=e.origCode.substr(t.pos-t.loc.column);i=i.split("\n")[0],t.message+=" (nodent)\n"+i+"\n"+i.replace(/[\S ]/g,"-").substring(0,t.loc.column)+"^",t.stack=""}throw t}}}},{"./output":12,"./parser":13}],12:[function(e,t,n){"use strict";function r(e){if("NewExpression"===e.type&&e.arguments&&e.arguments.length)return 19;var t=h[e.type]||h[e.type+e.operator]||h[e.type+e.operator+(e.prefix?"prefix":"")];return void 0!==t?t:20}var i,s,o,a,u,c,l=e("source-map").SourceMapGenerator;if("".repeat)c=function(e,t){return t&&e?e.repeat(t):""};else{var p={};c=function(e,t){if(!t||!e)return"";var n=""+e+t;if(!p[n]){for(var r=[];t--;)r.push(e);p[n]=r.join("")}return p[n]}}var h={ExpressionStatement:-1,Identifier:21,Literal:21,BooleanLiteral:21,RegExpLiteral:21,NumericLiteral:21,StringLiteral:21,NullLiteral:21,ThisExpression:21,SuperExpression:21,ObjectExpression:21,ClassExpression:21,MemberExpression:19,CallExpression:18,NewExpression:18,ArrayExpression:17.5,FunctionExpression:17.5,FunctionDeclaration:17.5,ArrowFunctionExpression:17.5,"UpdateExpression++":17,"UpdateExpression--":17,"UpdateExpression++prefix":16,"UpdateExpression--prefix":16,UnaryExpression:16,AwaitExpression:16,"BinaryExpression**":15,"BinaryExpression*":15,"BinaryExpression/":15,"BinaryExpression%":15,"BinaryExpression+":14,"BinaryExpression-":14,"BinaryExpression<<":13,"BinaryExpression>>":13,"BinaryExpression>>>":13,"BinaryExpression<":12,"BinaryExpression<=":12,"BinaryExpression>":12,"BinaryExpression>=":12,BinaryExpressionin:12,BinaryExpressioninstanceof:12,"BinaryExpression==":11,"BinaryExpression===":11,"BinaryExpression!=":11,"BinaryExpression!==":11,"BinaryExpression&":10,"BinaryExpression^":9,"BinaryExpression|":8,"LogicalExpression&&":7,"LogicalExpression||":6,ConditionalExpression:5,AssignmentPattern:4,AssignmentExpression:4,yield:3,YieldExpression:3,SpreadElement:2,"comma-separated-list":1.5,SequenceExpression:1},f={type:"comma-separated-list"},d={out:function(e,t,n){var r=this[n||e.type];r?r.call(this,e,t):t.write(e,"/*"+e.type+"?*/ "+t.sourceAt(e.start,e.end))},expr:function(e,t,n,i){2===i||r(n)0)for(var r=n.length,i=0;i0){this.out(e[0],t,e[0].type);for(var r=1,i=e.length;r0){t.write(null,s);for(var a=0,u=n.length;a0){this.out(n[0],t,"VariableDeclarator");for(var i=1;i0){for(var s=0;s0)for(var r=0;r ")):(this.formatParameters(e.params,t),t.write(e,"=> ")),"ObjectExpression"===e.body.type||"SequenceExpression"===e.body.type?(t.write(null,"("),this.out(e.body,t,e.body.type),t.write(null,")")):this.out(e.body,t,e.body.type)},ThisExpression:function(e,t){t.write(e,"this")},Super:function(e,t){t.write(e,"super")},RestElement:s=function(e,t){t.write(e,"..."),this.out(e.argument,t,e.argument.type)},SpreadElement:s,YieldExpression:function(e,t){t.write(e,e.delegate?"yield*":"yield"),e.argument&&(t.write(null," "),this.expr(t,e,e.argument))},AwaitExpression:function(e,t){t.write(e,"await "),this.expr(t,e,e.argument)},TemplateLiteral:function(e,t){var n,r=e.quasis,i=e.expressions;t.write(e,"`");for(var s=0,o=i.length;s0)for(var n=e.elements,r=n.length,i=0;;){var s=n[i];if(s&&this.expr(t,f,s),((i+=1)=r)break;t.lineLength()>t.wrapColumn&&t.write(null,t.lineEnd,c(t.indent,t.indentLevel+1))}t.write(null,"]")},ArrayPattern:a,ObjectExpression:function(e,t){var n,r=c(t.indent,t.indentLevel++),i=t.lineEnd,s=r+t.indent;if(t.write(e,"{"),e.properties.length>0){t.write(null,i);for(var o=e.properties,a=o.length,u=0;n=o[u],t.write(null,s),this.out(n,t,"Property"),++ut.wrapColumn&&t.write(null,t.lineEnd,c(t.indent,t.indentLevel+1));t.write(null,i,r,"}")}else t.write(null,"}");t.indentLevel--},Property:function(e,t){e.method||"get"===e.kind||"set"===e.kind?this.MethodDefinition(e,t):(e.shorthand||(e.computed?(t.write(null,"["),this.out(e.key,t,e.key.type),t.write(null,"]")):this.out(e.key,t,e.key.type),t.write(null,": ")),this.expr(t,f,e.value))},ObjectPattern:function(e,t){if(t.write(e,"{"),e.properties.length>0)for(var n=e.properties,r=n.length,i=0;this.out(n[i],t,"Property"),++i0)for(var i=r.length,s=0;s1&&t.write(e," "),this.expr(t,e,e.argument,!0)):(this.expr(t,e,e.argument),t.write(e,e.operator))},UpdateExpression:function(e,t){e.prefix?(t.write(e,e.operator),this.out(e.argument,t,e.argument.type)):(this.out(e.argument,t,e.argument.type),t.write(e,e.operator))},BinaryExpression:o=function(e,t){var n=e.operator;"in"===n&&t.inForInit&&t.write(null,"("),this.expr(t,e,e.left),t.write(e," ",n," "),this.expr(t,e,e.right,"ArrowFunctionExpression"===e.right.type?2:0),"in"===n&&t.inForInit&&t.write(null,")")},LogicalExpression:o,AssignmentExpression:function(e,t){"ObjectPattern"===e.left.type&&t.write(null,"("),this.BinaryExpression(e,t),"ObjectPattern"===e.left.type&&t.write(null,")")},AssignmentPattern:function(e,t){this.expr(t,e,e.left),t.write(e," = "),this.expr(t,e,e.right)},ConditionalExpression:function(e,t){this.expr(t,e,e.test,!0),t.write(e," ? "),this.expr(t,e,e.consequent),t.write(null," : "),this.expr(t,e,e.alternate)},NewExpression:function(e,t){t.write(e,"new "),this.expr(t,e,e.callee,"CallExpression"===e.callee.type||"ObjectExpression"===e.callee.type?2:0),this.argumentList(e,t)},CallExpression:function(e,t){this.expr(t,e,e.callee,"ObjectExpression"===e.callee.type?2:0),this.argumentList(e,t)},MemberExpression:function(e,t){!("ObjectExpression"===e.object.type||e.object.type.match(/Literal$/)&&e.object.raw&&e.object.raw.match(/^[0-9]/))&&("ArrayExpression"===e.object.type||"CallExpression"===e.object.type||"NewExpression"===e.object.type||r(e)<=r(e.object))?this.out(e.object,t,e.object.type):(t.write(null,"("),this.out(e.object,t,e.object.type),t.write(null,")")),e.computed?(t.write(e,"["),this.out(e.property,t,e.property.type),t.write(null,"]")):(t.write(e,"."),this.out(e.property,t,e.property.type))},Identifier:function(e,t){t.write(e,e.name)},Literal:function(e,t){t.write(e,e.raw)},NullLiteral:function(e,t){t.write(e,"null")},BooleanLiteral:function(e,t){t.write(e,JSON.stringify(e.value))},StringLiteral:function(e,t){t.write(e,JSON.stringify(e.value))},RegExpLiteral:function(e,t){t.write(e,e.extra.raw||"/"+e.pattern+"/"+e.flags)},NumericLiteral:function(e,t){t.write(e,JSON.stringify(e.value))}};t.exports=function(e,t,n){var r="",i=[],s=(t=t||{}).map&&new l(t.map);s&&t.map.sourceContent&&s.setSourceContent(t.map.file,t.map.sourceContent);var o="",a=[],u=[],p={inForInit:0,lineLength:function(){return r.length},sourceAt:function(e,t){return n?n.substring(e,t):"/* Omitted Non-standard node */"},write:function(e){o=arguments[arguments.length-1];for(var n=1;n=0&&r({self:i,parent:e,field:u[c],index:!0}):l instanceof Object&&i===l&&r({self:i,parent:e,field:u[c]})}})},n),e}function s(t,n){var r=[],s={ecmaVersion:8,allowHashBang:!0,allowReturnOutsideFunction:!0,allowImportExportEverywhere:!0,locations:!0,onComment:r};if((!n||!n.noNodentExtensions||parseInt(o.version)<4)&&(c||(parseInt(o.version)<4&&console.warn("Nodent: Warning - noNodentExtensions option requires acorn >=v4.x. Extensions installed."),e("acorn-es7-plugin")(o),c=!0),s.plugins=s.plugins||{},s.plugins.asyncawait={asyncExits:!0,awaitAnywhere:!0}),n)for(var a in n)"noNodentExtensions"!==a&&(s[a]=n[a]);var u=o.parse(t,s);return i(u,function(e,t,n){for(t();r.length&&e.loc&&e.loc.start.line>=r[0].loc.start.line&&e.loc.end.line>=r[0].loc.end.line;)e.$comments=e.$comments||[],e.$comments.push(r.shift())}),u}var o=e("acorn"),a=e("acorn/dist/walk").make({AwaitExpression:function(e,t,n){n(e.argument,t,"Expression")},SwitchStatement:function(e,t,n){n(e.discriminant,t,"Expression");for(var r=0;r=0)return t}else{var n=i.toSetString(e);if(s.call(this._set,n))return this._set[n]}throw new Error('"'+e+'" is not in the set.')},r.prototype.at=function(e){if(e>=0&&e>>=5)>0&&(t|=32),n+=r.encode(t)}while(i>0);return n},n.decode=function(e,t,n){var i,s,o=e.length,a=0,u=0;do{if(t>=o)throw new Error("Expected more digits in base 64 VLQ value.");if(-1===(s=r.decode(e.charCodeAt(t++))))throw new Error("Invalid base64 digit: "+e.charAt(t-1));i=!!(32&s),a+=(s&=31)<>1;return 1==(1&e)?-t:t}(a),n.rest=t}},{"./base64":16}],16:[function(e,t,n){var r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");n.encode=function(e){if(0<=e&&e0?t-u>1?r(u,t,i,s,o,a):a==n.LEAST_UPPER_BOUND?t1?r(e,u,i,s,o,a):a==n.LEAST_UPPER_BOUND?u:e<0?-1:e}n.GREATEST_LOWER_BOUND=1,n.LEAST_UPPER_BOUND=2,n.search=function(e,t,i,s){if(0===t.length)return-1;var o=r(-1,t.length,e,t,i,s||n.GREATEST_LOWER_BOUND);if(o<0)return-1;for(;o-1>=0&&0===i(t[o],t[o-1],!0);)--o;return o}},{}],18:[function(e,t,n){function r(){this._array=[],this._sorted=!0,this._last={generatedLine:-1,generatedColumn:0}}var i=e("./util");r.prototype.unsortedForEach=function(e,t){this._array.forEach(e,t)},r.prototype.add=function(e){!function(e,t){var n=e.generatedLine,r=t.generatedLine,s=e.generatedColumn,o=t.generatedColumn;return r>n||r==n&&o>=s||i.compareByGeneratedPositionsInflated(e,t)<=0}(this._last,e)?(this._sorted=!1,this._array.push(e)):(this._last=e,this._array.push(e))},r.prototype.toArray=function(){return this._sorted||(this._array.sort(i.compareByGeneratedPositionsInflated),this._sorted=!0),this._array},n.MappingList=r},{"./util":23}],19:[function(e,t,n){function r(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function i(e,t,n,s){if(n=0){var s=this._originalMappings[i];if(void 0===e.column)for(var o=s.originalLine;s&&s.originalLine===o;)r.push({line:a.getArg(s,"generatedLine",null),column:a.getArg(s,"generatedColumn",null),lastColumn:a.getArg(s,"lastGeneratedColumn",null)}),s=this._originalMappings[++i];else for(var c=s.originalColumn;s&&s.originalLine===t&&s.originalColumn==c;)r.push({line:a.getArg(s,"generatedLine",null),column:a.getArg(s,"generatedColumn",null),lastColumn:a.getArg(s,"lastGeneratedColumn",null)}),s=this._originalMappings[++i]}return r},n.SourceMapConsumer=r,(i.prototype=Object.create(r.prototype)).consumer=r,i.fromSourceMap=function(e){var t=Object.create(i.prototype),n=t._names=c.fromArray(e._names.toArray(),!0),r=t._sources=c.fromArray(e._sources.toArray(),!0);t.sourceRoot=e._sourceRoot,t.sourcesContent=e._generateSourcesContent(t._sources.toArray(),t.sourceRoot),t.file=e._file;for(var o=e._mappings.toArray().slice(),u=t.__generatedMappings=[],l=t.__originalMappings=[],h=0,f=o.length;h1&&(n.source=y+i[1],y+=i[1],n.originalLine=f+i[2],f=n.originalLine,n.originalLine+=1,n.originalColumn=d+i[3],d=n.originalColumn,i.length>4&&(n.name=m+i[4],m+=i[4])),E.push(n),"number"==typeof n.originalLine&&w.push(n)}p(E,a.compareByGeneratedPositionsDeflated),this.__generatedMappings=E,p(w,a.compareByOriginalPositions),this.__originalMappings=w},i.prototype._findMapping=function(e,t,n,r,i,s){if(e[n]<=0)throw new TypeError("Line must be greater than or equal to 1, got "+e[n]);if(e[r]<0)throw new TypeError("Column must be greater than or equal to 0, got "+e[r]);return u.search(e,t,i,s)},i.prototype.computeColumnSpans=function(){for(var e=0;e=0){var i=this._generatedMappings[n];if(i.generatedLine===t.generatedLine){var s=a.getArg(i,"source",null);null!==s&&(s=this._sources.at(s),null!=this.sourceRoot&&(s=a.join(this.sourceRoot,s)));var o=a.getArg(i,"name",null);return null!==o&&(o=this._names.at(o)),{source:s,line:a.getArg(i,"originalLine",null),column:a.getArg(i,"originalColumn",null),name:o}}}return{source:null,line:null,column:null,name:null}},i.prototype.hasContentsOfAllSources=function(){return!!this.sourcesContent&&(this.sourcesContent.length>=this._sources.size()&&!this.sourcesContent.some(function(e){return null==e}))},i.prototype.sourceContentFor=function(e,t){if(!this.sourcesContent)return null;if(null!=this.sourceRoot&&(e=a.relative(this.sourceRoot,e)),this._sources.has(e))return this.sourcesContent[this._sources.indexOf(e)];var n;if(null!=this.sourceRoot&&(n=a.urlParse(this.sourceRoot))){var r=e.replace(/^file:\/\//,"");if("file"==n.scheme&&this._sources.has(r))return this.sourcesContent[this._sources.indexOf(r)];if((!n.path||"/"==n.path)&&this._sources.has("/"+e))return this.sourcesContent[this._sources.indexOf("/"+e)]}if(t)return null;throw new Error('"'+e+'" is not in the SourceMap.')},i.prototype.generatedPositionFor=function(e){var t=a.getArg(e,"source");if(null!=this.sourceRoot&&(t=a.relative(this.sourceRoot,t)),!this._sources.has(t))return{line:null,column:null,lastColumn:null};var n={source:t=this._sources.indexOf(t),originalLine:a.getArg(e,"line"),originalColumn:a.getArg(e,"column")},i=this._findMapping(n,this._originalMappings,"originalLine","originalColumn",a.compareByOriginalPositions,a.getArg(e,"bias",r.GREATEST_LOWER_BOUND));if(i>=0){var s=this._originalMappings[i];if(s.source===n.source)return{line:a.getArg(s,"generatedLine",null),column:a.getArg(s,"generatedColumn",null),lastColumn:a.getArg(s,"lastGeneratedColumn",null)}}return{line:null,column:null,lastColumn:null}},n.BasicSourceMapConsumer=i,(o.prototype=Object.create(r.prototype)).constructor=r,o.prototype._version=3,Object.defineProperty(o.prototype,"sources",{get:function(){for(var e=[],t=0;t0&&e.column>=0)||t||n||r)&&!(e&&"line"in e&&"column"in e&&t&&"line"in t&&"column"in t&&e.line>0&&e.column>=0&&t.line>0&&t.column>=0&&n))throw new Error("Invalid mapping: "+JSON.stringify({generated:e,source:n,original:t,name:r}))},r.prototype._serializeMappings=function(){for(var e,t,n,r,o=0,a=1,u=0,c=0,l=0,p=0,h="",f=this._mappings.toArray(),d=0,y=f.length;d0){if(!s.compareByGeneratedPositionsInflated(t,f[d-1]))continue;e+=","}e+=i.encode(t.generatedColumn-o),o=t.generatedColumn,null!=t.source&&(r=this._sources.indexOf(t.source),e+=i.encode(r-p),p=r,e+=i.encode(t.originalLine-1-c),c=t.originalLine-1,e+=i.encode(t.originalColumn-u),u=t.originalColumn,null!=t.name&&(n=this._names.indexOf(t.name),e+=i.encode(n-l),l=n)),h+=e}return h},r.prototype._generateSourcesContent=function(e,t){return e.map(function(e){if(!this._sourcesContents)return null;null!=t&&(e=s.relative(t,e));var n=s.toSetString(e);return Object.prototype.hasOwnProperty.call(this._sourcesContents,n)?this._sourcesContents[n]:null},this)},r.prototype.toJSON=function(){var e={version:this._version,sources:this._sources.toArray(),names:this._names.toArray(),mappings:this._serializeMappings()};return null!=this._file&&(e.file=this._file),null!=this._sourceRoot&&(e.sourceRoot=this._sourceRoot),this._sourcesContents&&(e.sourcesContent=this._generateSourcesContent(e.sources,e.sourceRoot)),e},r.prototype.toString=function(){return JSON.stringify(this.toJSON())},n.SourceMapGenerator=r},{"./array-set":14,"./base64-vlq":15,"./mapping-list":18,"./util":23}],22:[function(e,t,n){function r(e,t,n,r,i){this.children=[],this.sourceContents={},this.line=null==e?null:e,this.column=null==t?null:t,this.source=null==n?null:n,this.name=null==i?null:i,this[a]=!0,null!=r&&this.add(r)}var i=e("./source-map-generator").SourceMapGenerator,s=e("./util"),o=/(\r?\n)/,a="$$$isSourceNode$$$";r.fromStringWithSourceMap=function(e,t,n){function i(e,t){if(null===e||void 0===e.source)a.add(t);else{var i=n?s.join(n,e.source):e.source;a.add(new r(e.originalLine,e.originalColumn,i,t,e.name))}}var a=new r,u=e.split(o),c=0,l=function(){function e(){return c=0;t--)this.prepend(e[t]);else{if(!e[a]&&"string"!=typeof e)throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+e);this.children.unshift(e)}return this},r.prototype.walk=function(e){for(var t,n=0,r=this.children.length;n0){for(t=[],n=0;n=0;l--)"."===(o=u[l])?u.splice(l,1):".."===o?c++:c>0&&(""===o?(u.splice(l+1,c),c=0):(u.splice(l,2),c--));return""===(t=u.join("/"))&&(t=a?"/":"."),s?(s.path=t,i(s)):t}function o(e){return e}function a(e){if(!e)return!1;var t=e.length;if(t<9)return!1;if(95!==e.charCodeAt(t-1)||95!==e.charCodeAt(t-2)||111!==e.charCodeAt(t-3)||116!==e.charCodeAt(t-4)||111!==e.charCodeAt(t-5)||114!==e.charCodeAt(t-6)||112!==e.charCodeAt(t-7)||95!==e.charCodeAt(t-8)||95!==e.charCodeAt(t-9))return!1;for(var n=t-10;n>=0;n--)if(36!==e.charCodeAt(n))return!1;return!0}function u(e,t){return e===t?0:e>t?1:-1}n.getArg=function(e,t,n){if(t in e)return e[t];if(3===arguments.length)return n;throw new Error('"'+t+'" is a required argument.')};var c=/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.]*)(?::(\d+))?(\S*)$/,l=/^data:.+\,.+$/;n.urlParse=r,n.urlGenerate=i,n.normalize=s,n.join=function(e,t){""===e&&(e="."),""===t&&(t=".");var n=r(t),o=r(e);if(o&&(e=o.path||"/"),n&&!n.scheme)return o&&(n.scheme=o.scheme),i(n);if(n||t.match(l))return t;if(o&&!o.host&&!o.path)return o.host=t,i(o);var a="/"===t.charAt(0)?t:s(e.replace(/\/+$/,"")+"/"+t);return o?(o.path=a,i(o)):a},n.isAbsolute=function(e){return"/"===e.charAt(0)||!!e.match(c)},n.relative=function(e,t){""===e&&(e="."),e=e.replace(/\/$/,"");for(var n=0;0!==t.indexOf(e+"/");){var r=e.lastIndexOf("/");if(r<0)return t;if((e=e.slice(0,r)).match(/^([^\/]+:\/)?\/*$/))return t;++n}return Array(n+1).join("../")+t.substr(e.length+1)};var p=!("__proto__"in Object.create(null));n.toSetString=p?o:function(e){return a(e)?"$"+e:e},n.fromSetString=p?o:function(e){return a(e)?e.slice(1):e},n.compareByOriginalPositions=function(e,t,n){var r=e.source-t.source;return 0!==r?r:0!=(r=e.originalLine-t.originalLine)?r:0!=(r=e.originalColumn-t.originalColumn)||n?r:0!=(r=e.generatedColumn-t.generatedColumn)?r:0!=(r=e.generatedLine-t.generatedLine)?r:e.name-t.name},n.compareByGeneratedPositionsDeflated=function(e,t,n){var r=e.generatedLine-t.generatedLine;return 0!==r?r:0!=(r=e.generatedColumn-t.generatedColumn)||n?r:0!=(r=e.source-t.source)?r:0!=(r=e.originalLine-t.originalLine)?r:0!=(r=e.originalColumn-t.originalColumn)?r:e.name-t.name},n.compareByGeneratedPositionsInflated=function(e,t){var n=e.generatedLine-t.generatedLine;return 0!==n?n:0!=(n=e.generatedColumn-t.generatedColumn)?n:0!==(n=u(e.source,t.source))?n:0!=(n=e.originalLine-t.originalLine)?n:0!=(n=e.originalColumn-t.originalColumn)?n:u(e.name,t.name)}},{}],24:[function(e,t,n){n.SourceMapGenerator=e("./lib/source-map-generator").SourceMapGenerator,n.SourceMapConsumer=e("./lib/source-map-consumer").SourceMapConsumer,n.SourceNode=e("./lib/source-node").SourceNode},{"./lib/source-map-consumer":20,"./lib/source-map-generator":21,"./lib/source-node":22}],25:[function(e,t,n){t.exports={_args:[[{raw:"nodent-compiler@>=3.1.5",scope:null,escapedName:"nodent-compiler",name:"nodent-compiler",rawSpec:">=3.1.5",spec:">=3.1.5",type:"range"},"/Users/evgenypoberezkin/Documents/JSON/ajv/node_modules/nodent"]],_from:"nodent-compiler@>=3.1.5",_id:"nodent-compiler@3.1.5",_inCache:!0,_location:"/nodent-compiler",_nodeVersion:"8.9.1",_npmOperationalInternal:{host:"s3://npm-registry-packages",tmp:"tmp/nodent-compiler-3.1.5.tgz_1511792299537_0.15715787676163018"},_npmUser:{name:"matatbread",email:"npm@mailed.me.uk"},_npmVersion:"5.5.1",_phantomChildren:{},_requested:{raw:"nodent-compiler@>=3.1.5",scope:null,escapedName:"nodent-compiler",name:"nodent-compiler",rawSpec:">=3.1.5",spec:">=3.1.5",type:"range"},_requiredBy:["/nodent"],_resolved:"https://registry.npmjs.org/nodent-compiler/-/nodent-compiler-3.1.5.tgz",_shasum:"8c09289eacf7256bda89c2b88941681d5cccf80c",_shrinkwrap:null,_spec:"nodent-compiler@>=3.1.5",_where:"/Users/evgenypoberezkin/Documents/JSON/ajv/node_modules/nodent",author:{name:"Mat At Bread",email:"nodent@mailed.me.uk"},bugs:{url:"https://github.com/MatAtBread/nodent/issues"},dependencies:{acorn:">=2.5.2","acorn-es7-plugin":">=1.1.6","source-map":"^0.5.6"},description:"NoDent - Asynchronous Javascript language extensions",devDependencies:{},directories:{},dist:{integrity:"sha512-Istg796un2lALiy/eFNnLbAEMovQqrtpVqXVY8PKs6ycsyBbK480D55misJBQ1QxvstcJ7Hk9xbSVkV8lIi+tg==",shasum:"8c09289eacf7256bda89c2b88941681d5cccf80c",tarball:"https://registry.npmjs.org/nodent-compiler/-/nodent-compiler-3.1.5.tgz"},engines:"node >= 0.10.0",gitHead:"93054f019902e2b107e7be681836273f35a02614",homepage:"https://github.com/MatAtBread/nodent-compiler#readme",keywords:["Javascript","ES7","async","await","language","extensions","Node","callback","generator","Promise","asynchronous"],license:"BSD-2-Clause",main:"compiler.js",maintainers:[{name:"matatbread",email:"npm@mailed.me.uk"}],name:"nodent-compiler",optionalDependencies:{},readme:"ERROR: No README data found!",repository:{type:"git",url:"git+https://github.com/MatAtBread/nodent-compiler.git"},scripts:{test:"node tests/basic.js # Please install 'nodent' and test the compiler fully from there."},version:"3.1.5"}},{}],26:[function(e,t,n){"use strict";function r(e,t){if(Function.prototype.$asyncspawn||Object.defineProperty(Function.prototype,"$asyncspawn",{value:r,enumerable:!1,configurable:!0,writable:!0}),this instanceof Function){var n=this;return new e(function(e,r){function i(t,n){var o;try{if((o=t.call(s,n)).done){if(o.value!==e){if(o.value&&o.value===o.value.then)return o.value(e,r);e&&e(o.value),e=null}return}o.value.then?o.value.then(function(e){i(s.next,e)},function(e){i(s.throw,e)}):i(s.next,o.value)}catch(e){return r&&r(e),void(r=null)}}var s=n.call(t,e,r);i(s.next)})}}var i=function(e,t){for(var n=t.toString(),r="return "+n,i=n.match(/.*\(([^)]*)\)/)[1],s=/['"]!!!([^'"]*)['"]/g,o=[];;){var a=s.exec(r);if(!a)break;o.push(a)}return o.reverse().forEach(function(t){r=r.slice(0,t.index)+e[t[1]]+r.substr(t.index+t[0].length)}),r=r.replace(/\/\*[^*]*\*\//g," ").replace(/\s+/g," "),new Function(i,r)()}({zousan:e("./zousan").toString(),thenable:e("./thenableFactory").toString()},function e(t,n){function r(){return i.apply(t,arguments)}Function.prototype.$asyncbind||Object.defineProperty(Function.prototype,"$asyncbind",{value:e,enumerable:!1,configurable:!0,writable:!0}),e.trampoline||(e.trampoline=function(e,t,n,r,i){return function s(o){for(;o;){if(o.then)return o=o.then(s,r),i?void 0:o;try{if(o.pop){if(o.length)return o.pop()?t.call(e):o;o=n}else o=o.call(e)}catch(e){return r(e)}}}}),e.LazyThenable||(e.LazyThenable="!!!thenable"(),e.EagerThenable=e.Thenable=(e.EagerThenableFactory="!!!zousan")());var i=this;switch(n){case!0:return new e.Thenable(r);case 0:return new e.LazyThenable(r);case void 0:return r.then=r,r;default:return function(){try{return i.apply(t,arguments)}catch(e){return n(e)}}}});i(),r(),t.exports={$asyncbind:i,$asyncspawn:r}},{"./thenableFactory":27,"./zousan":28}],27:[function(e,t,n){t.exports=function(){function e(e){return e&&e instanceof Object&&"function"==typeof e.then}function t(n,r,i){try{var s=i?i(r):r;if(n===s)return n.reject(new TypeError("Promise resolution loop"));e(s)?s.then(function(e){t(n,e)},function(e){n.reject(e)}):n.resolve(s)}catch(e){n.reject(e)}}function n(){}function r(e){}function i(r,i){var s=new n;try{this._resolver(function(n){return e(n)?n.then(r,i):t(s,n,r)},function(e){t(s,e,i)})}catch(e){t(s,e,i)}return s}function s(e){this._resolver=e,this.then=i}return n.prototype={resolve:r,reject:r,then:function(e,t){this.resolve=e,this.reject=t}},s.resolve=function(e){return s.isThenable(e)?e:{then:function(t){return t(e)}}},s.isThenable=e,s}},{}],28:[function(e,t,n){(function(e){"use strict";t.exports=function(t){function n(e){if(e){var t=this;e(function(e){t.resolve(e)},function(e){t.reject(e)})}}function r(e,t){if("function"==typeof e.y)try{var n=e.y.call(void 0,t);e.p.resolve(n)}catch(t){e.p.reject(t)}else e.p.resolve(t)}function i(e,t){if("function"==typeof e.n)try{var n=e.n.call(void 0,t);e.p.resolve(n)}catch(t){e.p.reject(t)}else e.p.reject(t)}t=t||"object"==typeof e&&e.nextTick||"function"==typeof setImmediate&&setImmediate||function(e){setTimeout(e,0)};var s=function(){function e(){for(;n.length-r;){try{n[r]()}catch(e){}n[r++]=void 0,r===i&&(n.splice(0,i),r=0)}}var n=[],r=0,i=1024;return function(i){n.push(i),n.length-r==1&&t(e)}}();return n.prototype={resolve:function(e){if(void 0===this.state){if(e===this)return this.reject(new TypeError("Attempt to resolve promise with self"));var t=this;if(e&&("function"==typeof e||"object"==typeof e))try{var n=0,i=e.then;if("function"==typeof i)return void i.call(e,function(e){n++||t.resolve(e)},function(e){n++||t.reject(e)})}catch(e){return void(n||this.reject(e))}this.state=r,this.v=e,t.c&&s(function(){for(var n=0,i=t.c.length;n]*>)(.*)/i,/(.*)(<\/script>)(.*)/i],o=0,a=!0;t=t.split("\n");for(var u=0;u=0;r--){var i=e[r];"."===i?e.splice(r,1):".."===i?(e.splice(r,1),n++):n&&(e.splice(r,1),n--)}if(t)for(;n--;n)e.unshift("..");return e}function r(e,t){if(e.filter)return e.filter(t);for(var n=[],r=0;r=-1&&!i;s--){var o=s>=0?arguments[s]:e.cwd();if("string"!=typeof o)throw new TypeError("Arguments to path.resolve must be strings");o&&(n=o+"/"+n,i="/"===o.charAt(0))}return n=t(r(n.split("/"),function(e){return!!e}),!i).join("/"),(i?"/":"")+n||"."},n.normalize=function(e){var i=n.isAbsolute(e),s="/"===o(e,-1);return(e=t(r(e.split("/"),function(e){return!!e}),!i).join("/"))||i||(e="."),e&&s&&(e+="/"),(i?"/":"")+e},n.isAbsolute=function(e){return"/"===e.charAt(0)},n.join=function(){var e=Array.prototype.slice.call(arguments,0);return n.normalize(r(e,function(e,t){if("string"!=typeof e)throw new TypeError("Arguments to path.join must be strings");return e}).join("/"))},n.relative=function(e,t){function r(e){for(var t=0;t=0&&""===e[n];n--);return t>n?[]:e.slice(t,n-t+1)}e=n.resolve(e).substr(1),t=n.resolve(t).substr(1);for(var i=r(e.split("/")),s=r(t.split("/")),o=Math.min(i.length,s.length),a=o,u=0;u1)for(var n=1;n= 8.8",https:!0,_http_server:">= 0.11",_linklist:"< 8",module:!0,net:!0,os:!0,path:!0,perf_hooks:">= 8.5",process:">= 1",punycode:!0,querystring:!0,readline:!0,repl:!0,stream:!0,string_decoder:!0,sys:!0,timers:!0,tls:!0,tty:!0,url:!0,util:!0,v8:">= 1",vm:!0,zlib:!0}},{}],37:[function(e,t,n){(function(n){function r(e){if(!0===e)return!0;for(var t=e.split(" "),n=t[0],r=t[1].split("."),s=0;s<3;++s){var o=Number(i[s]||0),a=Number(r[s]||0);if(o!==a)return"<"===n?o="===n&&o>=a}return!1}var i=n.versions&&n.versions.node&&n.versions.node.split(".")||[],s=e("./core.json"),o={};for(var a in s)Object.prototype.hasOwnProperty.call(s,a)&&(o[a]=r(s[a]));t.exports=o}).call(this,e("_process"))},{"./core.json":36,_process:32}],38:[function(e,t,n){var r=e("path"),i=e("fs"),s=r.parse||e("path-parse");t.exports=function(e,t){var n=t&&t.moduleDirectory?[].concat(t.moduleDirectory):["node_modules"],o=r.resolve(e);if(t&&!1===t.preserveSymlinks)try{o=i.realpathSync(o)}catch(e){if("ENOENT"!==e.code)throw e}var a="/";/^([A-Za-z]:)/.test(o)?a="":/^\\\\/.test(o)&&(a="\\\\");for(var u=[o],c=s(o);c.dir!==u[u.length-1];)u.push(c.dir),c=s(c.dir);var l=u.reduce(function(e,t){return e.concat(n.map(function(e){return r.join(a,t,e)}))},[]);return t&&t.paths?l.concat(t.paths):l}},{fs:7,path:30,"path-parse":31}],39:[function(e,t,n){var r=e("./core"),i=e("fs"),s=e("path"),o=e("./caller.js"),a=e("./node-modules-paths.js");t.exports=function(e,t){function n(e){if(l(e))return e;for(var t=0;t"))}return Object.keys(hostOptions).forEach(function(k){"host"===parseOpts[k]&&(parseOpts[k]=function(){try{return eval(hostOptions[k]),!0}catch(e){return!1}}())}),parseOpts.promises||parseOpts.es7||parseOpts.generators||parseOpts.engine?((parseOpts.promises||parseOpts.es7)&&parseOpts.generators&&(log("No valid 'use nodent' directive, assumed -es7 mode"),parseOpts=optionSets.es7),(parseOpts.generators||parseOpts.engine)&&(parseOpts.promises=!0),parseOpts.promises&&(parseOpts.es7=!0),parseOpts):null}function stripBOM(e){return 65279===e.charCodeAt(0)&&(e=e.slice(1)),"#!"===e.substring(0,2)&&(e="//"+e),e}function compileNodentedFile(e,t){return t=t||e.log,function(n,r,i){var s=stripBOM(fs.readFileSync(r,"utf8")),o=e.parse(s,r,i);i=i||parseCompilerOptions(o.ast,t,r),e.asynchronize(o,void 0,i,t),e.prettyPrint(o,i),n._compile(o.code,o.filename)}}function asyncify(e){return e=e||Thenable,function(t,n,r){if(Array.isArray(n)){var i=n;n=function(e,t){return i.indexOf(e)>=0}}else n=n||function(e,t){return!(e.match(/Sync$/)&&e.replace(/Sync$/,"")in t)};r||(r="");var s=Object.create(t);for(var o in s)!function(){var i=o;try{"function"!=typeof t[i]||s[i+r]&&s[i+r].isAsync||!n(i,s)||(s[i+r]=function(){var n=Array.prototype.slice.call(arguments);return new e(function(e,r){var s=function(t,n){if(t)return r(t);switch(arguments.length){case 0:return e();case 2:return e(n);default:return e(Array.prototype.slice.call(arguments,1))}};n.length>t[i].length?n.push(s):n[t[i].length-1]=s;t[i].apply(t,n)})},s[i+r].isAsync=!0)}catch(e){}}();return s.super=t,s}}function generateRequestHandler(e,t,n){var r={},i=this;t||(t=/\.njs$/),n?n.compiler||(n.compiler={}):n={compiler:{}};var s=copyObj([NodentCompiler.initialCodeGenOpts,n.compiler]);return function(o,a,u){function c(e){a.statusCode=500,a.write(e.toString()),a.end()}if(r[o.url])return a.setHeader("Content-Type",r[o.url].contentType),n.setHeaders&&n.setHeaders(a),a.write(r[o.url].output),void a.end();if(!(o.url.match(t)||n.htmlScriptRegex&&o.url.match(n.htmlScriptRegex)))return u&&u();var l=e+o.url;if(n.extensions&&!fs.existsSync(l))for(var p=0;p=0?this.covers[n]=require(e):this.covers[n]=require(__dirname+"/covers/"+e)),this.covers[n](this,t)}function prepareMappedStackTrace(e,t){return e+t.map(function(e){var t=e.getFileName();if(t&&NodentCompiler.prototype.smCache[t]){var n=NodentCompiler.prototype.smCache[t].smc.originalPositionFor({line:e.getLineNumber(),column:e.getColumnNumber()});if(n&&n.line){var r=e.toString();return"\n at "+r.substring(0,r.length-1)+" => …"+n.source+":"+n.line+":"+n.column+(e.getFunctionName()?")":"")}}return"\n at "+e}).join("")}function setGlobalEnvironment(e){var t={};t[defaultCodeGenOpts.$asyncbind]={value:$asyncbind,writable:!0,enumerable:!1,configurable:!0},t[defaultCodeGenOpts.$asyncspawn]={value:$asyncspawn,writable:!0,enumerable:!1,configurable:!0};try{Object.defineProperties(Function.prototype,t)}catch(t){e.log("Function prototypes already assigned: ",t.messsage)}defaultCodeGenOpts[defaultCodeGenOpts.$error]in global||(global[defaultCodeGenOpts[defaultCodeGenOpts.$error]]=globalErrorHandler),e.augmentObject&&Object.defineProperties(Object.prototype,{asyncify:{value:function(e,t,n){return asyncify(e)(this,t,n)},writable:!0,configurable:!0},isThenable:{value:function(){return Thenable.isThenable(this)},writable:!0,configurable:!0}}),Object[defaultCodeGenOpts.$makeThenable]=Thenable.resolve}function initialize(e){function t(n,r){if(!r.match(/nodent\/nodent\.js$/)){if(r.match(/node_modules\/nodent\/.*\.js$/))return stdJSLoader(n,r);for(var o=0;ot[n])return 1}return 0}(u.version,NodentCompiler.prototype.version)<0&&(u.originalNodentLoader=n.exports,n.exports=function(){var t=require.extensions[".js"],n=u.originalNodentLoader.apply(this,arguments);return u.jsCompiler=require.extensions[".js"],require.extensions[".js"]=t,setGlobalEnvironment(e),n},Object.keys(u.originalNodentLoader).forEach(function(e){n.exports[e]=u.originalNodentLoader[e]}),i.push(u),i=i.sort(function(e,t){return t.path.length-e.path.length})))}function n(t){if(Array.isArray(t))return t.forEach(n);if(require.extensions[t]){Object.keys(e).filter(function(t){return compiler[t]!=e[t]}).length&&e.log("File extension "+t+" already configured for async/await compilation.")}require.extensions[t]=compileNodentedFile(compiler,e.log)}if(e){for(var r in e)if("use"!==r&&!config.hasOwnProperty(r))throw new Error("NoDent: unknown option: "+r+"="+JSON.stringify(e[r]))}else e={};compiler?compiler.setOptions(e):(Object.keys(config).forEach(function(t){t in e||(e[t]=config[t])}),compiler=new NodentCompiler(e)),e.dontMapStackTraces||(Error.prepareStackTrace=prepareMappedStackTrace),setGlobalEnvironment(e);var i=[];if(!e.dontInstallRequireHook){if(!stdJSLoader){stdJSLoader=require.extensions[".js"];var s=compileNodentedFile(compiler,e.log);require.extensions[".js"]=t}e.extension&&n(e.extension)}return e.use&&(Array.isArray(e.use)?(e.log("Warning: nodent({use:[...]}) is deprecated. Use nodent.require(module,options)\n"+(new Error).stack.split("\n")[2]),e.use.length&&e.use.forEach(function(e){compiler[e]=compiler.require(e)})):(e.log("Warning: nodent({use:{...}}) is deprecated. Use nodent.require(module,options)\n"+(new Error).stack.split("\n")[2]),Object.keys(e.use).forEach(function(t){compiler[t]=compiler.require(t,e.use[t])}))),compiler}function runFromCLI(){function e(e,n){try{var s,o;if(r.fromast){if(e=JSON.parse(e),s={origCode:"",filename:t,ast:e},!(o=parseCompilerOptions(e,i.log))){var a=r.use?'"use nodent-'+r.use+'";':'"use nodent";';o=parseCompilerOptions(a,i.log),console.warn("/* "+t+": No 'use nodent*' directive, assumed "+a+" */")}}else(o=parseCompilerOptions(r.use?'"use nodent-'+r.use+'";':e,i.log))||(o=parseCompilerOptions('"use nodent";',i.log),r.dest||console.warn("/* "+t+": 'use nodent*' directive missing/ignored, assumed 'use nodent;' */")),s=i.parse(e,t,o);if(r.parseast||r.pretty||i.asynchronize(s,void 0,o,i.log),i.prettyPrint(s,o),r.out||r.pretty||r.dest){if(r.dest&&!n)throw new Error("Can't write unknown file to "+r.dest);var u="";r.runtime&&(u+="Function.prototype.$asyncbind = "+Function.prototype.$asyncbind.toString()+";\n",u+="global.$error = global.$error || "+global.$error.toString()+";\n"),u+=s.code,n&&r.dest?(fs.writeFileSync(r.dest+n,u),console.log("Compiled",r.dest+n)):console.log(u)}(r.minast||r.parseast)&&console.log(JSON.stringify(s.ast,function(e,t){return"$"===e[0]||e.match(/^(start|end|loc)$/)?void 0:t},2,null)),r.ast&&console.log(JSON.stringify(s.ast,function(e,t){return"$"===e[0]?void 0:t},0)),r.exec&&new Function(s.code)()}catch(e){console.error(e)}}var t,n=require("path"),r=(process.env.NODENT_OPTS&&JSON.parse(process.env.NODENT_OPTS),function(e){for(var t=[],n=e||2;n0",engine:"(async ()=>0)",noRuntime:"Promise"};NodentCompiler.prototype.Thenable=Thenable,NodentCompiler.prototype.EagerThenable=$asyncbind.EagerThenableFactory,NodentCompiler.prototype.asyncify=asyncify,NodentCompiler.prototype.require=requireCover,NodentCompiler.prototype.generateRequestHandler=generateRequestHandler,NodentCompiler.prototype.$asyncspawn=$asyncspawn,NodentCompiler.prototype.$asyncbind=$asyncbind,NodentCompiler.prototype.parseCompilerOptions=parseCompilerOptions,$asyncbind.call($asyncbind);var compiler;initialize.setDefaultCompileOptions=function(e,t){return e&&Object.keys(e).forEach(function(t){if(!(t in defaultCodeGenOpts))throw new Error("NoDent: unknown compiler option: "+t);defaultCodeGenOpts[t]=e[t]}),t&&Object.keys(t).forEach(function(e){if(!(e in t))throw new Error("NoDent: unknown configuration option: "+e);config[e]=t[e]}),initialize},initialize.setCompileOptions=function(e,t){return optionSet[e]=optionSet[e]||copyObj([defaultCodeGenOpts]),t&&Object.keys(t).forEach(function(n){if(!(n in defaultCodeGenOpts))throw new Error("NoDent: unknown compiler option: "+n);optionSet[e][n]=t[n]}),initialize},initialize.asyncify=asyncify,initialize.Thenable=$asyncbind.Thenable,initialize.EagerThenable=$asyncbind.EagerThenableFactory,module.exports=initialize,require.main===module&&process.argv.length>=3&&runFromCLI()}).call(this,require("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},"/node_modules/nodent")},{"./htmlScriptParser":29,_process:32,fs:7,"nodent-compiler":10,"nodent-runtime":26,path:30,resolve:33}]},{},[]); \ No newline at end of file diff --git a/deps/npm/node_modules/ajv/dist/regenerator.min.js b/deps/npm/node_modules/ajv/dist/regenerator.min.js deleted file mode 100644 index ef3b8bed543ce8..00000000000000 --- a/deps/npm/node_modules/ajv/dist/regenerator.min.js +++ /dev/null @@ -1,2 +0,0 @@ -/* regenerator 0.12.2: Source transformer enabling ECMAScript 6 generator functions (yield) in JavaScript-of-today (ES5) */ -require=function e(t,r,n){function i(a,o){if(!r[a]){if(!t[a]){var u="function"==typeof require&&require;if(!o&&u)return u(a,!0);if(s)return s(a,!0);var l=new Error("Cannot find module '"+a+"'");throw l.code="MODULE_NOT_FOUND",l}var c=r[a]={exports:{}};t[a][0].call(c.exports,function(e){var r=t[a][1][e];return i(r||e)},c,c.exports,e,t,r,n)}return r[a].exports}for(var s="function"==typeof require&&require,a=0;a=0;o--)if(u[o]!==l[o])return!1;for(o=u.length-1;o>=0;o--)if(a=u[o],!h(e[a],t[a],r,n))return!1;return!0}(e,t,r,o))}return r?e===t:e==t}function f(e){return"[object Arguments]"==Object.prototype.toString.call(e)}function d(e,t,r){h(e,t,!0)&&c(e,t,r,"notDeepStrictEqual",d)}function m(e,t){if(!e||!t)return!1;if("[object RegExp]"==Object.prototype.toString.call(t))return t.test(e);try{if(e instanceof t)return!0}catch(e){}return!Error.isPrototypeOf(t)&&!0===t.call({},e)}function y(e,t,r,n){var i;if("function"!=typeof t)throw new TypeError('"block" argument must be a function');"string"==typeof r&&(n=r,r=null),i=function(e){var t;try{e()}catch(e){t=e}return t}(t),n=(r&&r.name?" ("+r.name+").":".")+(n?" "+n:"."),e&&!i&&c(i,r,"Missing expected exception"+n);var s="string"==typeof n,a=!e&&g.isError(i),o=!e&&i&&!r;if((a&&s&&m(i,r)||o)&&c(i,r,"Got unwanted exception"+n),e&&i&&r&&!m(i,r)||!e&&i)throw i}var g=e("util/"),b=Object.prototype.hasOwnProperty,v=Array.prototype.slice,x="foo"===function(){}.name,E=t.exports=p,A=/\s*function\s+([^\(\s]*)\s*/;E.AssertionError=function(e){this.name="AssertionError",this.actual=e.actual,this.expected=e.expected,this.operator=e.operator,e.message?(this.message=e.message,this.generatedMessage=!1):(this.message=function(e){return u(l(e.actual),128)+" "+e.operator+" "+u(l(e.expected),128)}(this),this.generatedMessage=!0);var t=e.stackStartFunction||c;if(Error.captureStackTrace)Error.captureStackTrace(this,t);else{var r=new Error;if(r.stack){var n=r.stack,i=o(t),s=n.indexOf("\n"+i);if(s>=0){var a=n.indexOf("\n",s+1);n=n.substring(a+1)}this.stack=n}}},g.inherits(E.AssertionError,Error),E.fail=c,E.ok=p,E.equal=function(e,t,r){e!=t&&c(e,t,r,"==",E.equal)},E.notEqual=function(e,t,r){e==t&&c(e,t,r,"!=",E.notEqual)},E.deepEqual=function(e,t,r){h(e,t,!1)||c(e,t,r,"deepEqual",E.deepEqual)},E.deepStrictEqual=function(e,t,r){h(e,t,!0)||c(e,t,r,"deepStrictEqual",E.deepStrictEqual)},E.notDeepEqual=function(e,t,r){h(e,t,!1)&&c(e,t,r,"notDeepEqual",E.notDeepEqual)},E.notDeepStrictEqual=d,E.strictEqual=function(e,t,r){e!==t&&c(e,t,r,"===",E.strictEqual)},E.notStrictEqual=function(e,t,r){e===t&&c(e,t,r,"!==",E.notStrictEqual)},E.throws=function(e,t,r){y(!0,e,t,r)},E.doesNotThrow=function(e,t,r){y(!1,e,t,r)},E.ifError=function(e){if(e)throw e};var D=Object.keys||function(e){var t=[];for(var r in e)b.call(e,r)&&t.push(r);return t}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"util/":613}],2:[function(e,t,r){t.exports=function(t){t.use(e("./es7"));var r=t.use(e("../lib/types")),n=t.use(e("../lib/shared")).defaults,i=r.Type.def,s=r.Type.or;i("Noop").bases("Node").build(),i("DoExpression").bases("Expression").build("body").field("body",[i("Statement")]),i("Super").bases("Expression").build(),i("BindExpression").bases("Expression").build("object","callee").field("object",s(i("Expression"),null)).field("callee",i("Expression")),i("Decorator").bases("Node").build("expression").field("expression",i("Expression")),i("Property").field("decorators",s([i("Decorator")],null),n.null),i("MethodDefinition").field("decorators",s([i("Decorator")],null),n.null),i("MetaProperty").bases("Expression").build("meta","property").field("meta",i("Identifier")).field("property",i("Identifier")),i("ParenthesizedExpression").bases("Expression").build("expression").field("expression",i("Expression")),i("ImportSpecifier").bases("ModuleSpecifier").build("imported","local").field("imported",i("Identifier")),i("ImportDefaultSpecifier").bases("ModuleSpecifier").build("local"),i("ImportNamespaceSpecifier").bases("ModuleSpecifier").build("local"),i("ExportDefaultDeclaration").bases("Declaration").build("declaration").field("declaration",s(i("Declaration"),i("Expression"))),i("ExportNamedDeclaration").bases("Declaration").build("declaration","specifiers","source").field("declaration",s(i("Declaration"),null)).field("specifiers",[i("ExportSpecifier")],n.emptyArray).field("source",s(i("Literal"),null),n.null),i("ExportSpecifier").bases("ModuleSpecifier").build("local","exported").field("exported",i("Identifier")),i("ExportNamespaceSpecifier").bases("Specifier").build("exported").field("exported",i("Identifier")),i("ExportDefaultSpecifier").bases("Specifier").build("exported").field("exported",i("Identifier")),i("ExportAllDeclaration").bases("Declaration").build("exported","source").field("exported",s(i("Identifier"),null)).field("source",i("Literal")),i("CommentBlock").bases("Comment").build("value","leading","trailing"),i("CommentLine").bases("Comment").build("value","leading","trailing")}},{"../lib/shared":18,"../lib/types":19,"./es7":7}],3:[function(e,t,r){t.exports=function(t){t.use(e("./babel")),t.use(e("./flow"));var r=t.use(e("../lib/types")),n=t.use(e("../lib/shared")).defaults,i=r.Type.def,s=r.Type.or;i("Directive").bases("Node").build("value").field("value",i("DirectiveLiteral")),i("DirectiveLiteral").bases("Node","Expression").build("value").field("value",String,n["use strict"]),i("BlockStatement").bases("Statement").build("body").field("body",[i("Statement")]).field("directives",[i("Directive")],n.emptyArray),i("Program").bases("Node").build("body").field("body",[i("Statement")]).field("directives",[i("Directive")],n.emptyArray),i("StringLiteral").bases("Literal").build("value").field("value",String),i("NumericLiteral").bases("Literal").build("value").field("value",Number),i("NullLiteral").bases("Literal").build(),i("BooleanLiteral").bases("Literal").build("value").field("value",Boolean),i("RegExpLiteral").bases("Literal").build("pattern","flags").field("pattern",String).field("flags",String);var a=s(i("Property"),i("ObjectMethod"),i("ObjectProperty"),i("SpreadProperty"));i("ObjectExpression").bases("Expression").build("properties").field("properties",[a]),i("ObjectMethod").bases("Node","Function").build("kind","key","params","body","computed").field("kind",s("method","get","set")).field("key",s(i("Literal"),i("Identifier"),i("Expression"))).field("params",[i("Pattern")]).field("body",i("BlockStatement")).field("computed",Boolean,n.false).field("generator",Boolean,n.false).field("async",Boolean,n.false).field("decorators",s([i("Decorator")],null),n.null),i("ObjectProperty").bases("Node").build("key","value").field("key",s(i("Literal"),i("Identifier"),i("Expression"))).field("value",s(i("Expression"),i("Pattern"))).field("computed",Boolean,n.false);var o=s(i("MethodDefinition"),i("VariableDeclarator"),i("ClassPropertyDefinition"),i("ClassProperty"),i("ClassMethod"));i("ClassBody").bases("Declaration").build("body").field("body",[o]),i("ClassMethod").bases("Declaration","Function").build("kind","key","params","body","computed","static").field("kind",s("get","set","method","constructor")).field("key",s(i("Literal"),i("Identifier"),i("Expression"))).field("params",[i("Pattern")]).field("body",i("BlockStatement")).field("computed",Boolean,n.false).field("static",Boolean,n.false).field("generator",Boolean,n.false).field("async",Boolean,n.false).field("decorators",s([i("Decorator")],null),n.null);var u=s(i("Property"),i("PropertyPattern"),i("SpreadPropertyPattern"),i("SpreadProperty"),i("ObjectProperty"),i("RestProperty"));i("ObjectPattern").bases("Pattern").build("properties").field("properties",[u]).field("decorators",s([i("Decorator")],null),n.null),i("SpreadProperty").bases("Node").build("argument").field("argument",i("Expression")),i("RestProperty").bases("Node").build("argument").field("argument",i("Expression")),i("ForAwaitStatement").bases("Statement").build("left","right","body").field("left",s(i("VariableDeclaration"),i("Expression"))).field("right",i("Expression")).field("body",i("Statement")),i("Import").bases("Expression").build()}},{"../lib/shared":18,"../lib/types":19,"./babel":2,"./flow":9}],4:[function(e,t,r){t.exports=function(t){var r=t.use(e("../lib/types")).Type,n=r.def,i=r.or,s=t.use(e("../lib/shared")),a=s.defaults,o=s.geq;n("Printable").field("loc",i(n("SourceLocation"),null),a.null,!0),n("Node").bases("Printable").field("type",String).field("comments",i([n("Comment")],null),a.null,!0),n("SourceLocation").build("start","end","source").field("start",n("Position")).field("end",n("Position")).field("source",i(String,null),a.null),n("Position").build("line","column").field("line",o(1)).field("column",o(0)),n("File").bases("Node").build("program","name").field("program",n("Program")).field("name",i(String,null),a.null),n("Program").bases("Node").build("body").field("body",[n("Statement")]),n("Function").bases("Node").field("id",i(n("Identifier"),null),a.null).field("params",[n("Pattern")]).field("body",n("BlockStatement")),n("Statement").bases("Node"),n("EmptyStatement").bases("Statement").build(),n("BlockStatement").bases("Statement").build("body").field("body",[n("Statement")]),n("ExpressionStatement").bases("Statement").build("expression").field("expression",n("Expression")),n("IfStatement").bases("Statement").build("test","consequent","alternate").field("test",n("Expression")).field("consequent",n("Statement")).field("alternate",i(n("Statement"),null),a.null),n("LabeledStatement").bases("Statement").build("label","body").field("label",n("Identifier")).field("body",n("Statement")),n("BreakStatement").bases("Statement").build("label").field("label",i(n("Identifier"),null),a.null),n("ContinueStatement").bases("Statement").build("label").field("label",i(n("Identifier"),null),a.null),n("WithStatement").bases("Statement").build("object","body").field("object",n("Expression")).field("body",n("Statement")),n("SwitchStatement").bases("Statement").build("discriminant","cases","lexical").field("discriminant",n("Expression")).field("cases",[n("SwitchCase")]).field("lexical",Boolean,a.false),n("ReturnStatement").bases("Statement").build("argument").field("argument",i(n("Expression"),null)),n("ThrowStatement").bases("Statement").build("argument").field("argument",n("Expression")),n("TryStatement").bases("Statement").build("block","handler","finalizer").field("block",n("BlockStatement")).field("handler",i(n("CatchClause"),null),function(){return this.handlers&&this.handlers[0]||null}).field("handlers",[n("CatchClause")],function(){return this.handler?[this.handler]:[]},!0).field("guardedHandlers",[n("CatchClause")],a.emptyArray).field("finalizer",i(n("BlockStatement"),null),a.null),n("CatchClause").bases("Node").build("param","guard","body").field("param",n("Pattern")).field("guard",i(n("Expression"),null),a.null).field("body",n("BlockStatement")),n("WhileStatement").bases("Statement").build("test","body").field("test",n("Expression")).field("body",n("Statement")),n("DoWhileStatement").bases("Statement").build("body","test").field("body",n("Statement")).field("test",n("Expression")),n("ForStatement").bases("Statement").build("init","test","update","body").field("init",i(n("VariableDeclaration"),n("Expression"),null)).field("test",i(n("Expression"),null)).field("update",i(n("Expression"),null)).field("body",n("Statement")),n("ForInStatement").bases("Statement").build("left","right","body").field("left",i(n("VariableDeclaration"),n("Expression"))).field("right",n("Expression")).field("body",n("Statement")),n("DebuggerStatement").bases("Statement").build(),n("Declaration").bases("Statement"),n("FunctionDeclaration").bases("Function","Declaration").build("id","params","body").field("id",n("Identifier")),n("FunctionExpression").bases("Function","Expression").build("id","params","body"),n("VariableDeclaration").bases("Declaration").build("kind","declarations").field("kind",i("var","let","const")).field("declarations",[n("VariableDeclarator")]),n("VariableDeclarator").bases("Node").build("id","init").field("id",n("Pattern")).field("init",i(n("Expression"),null)),n("Expression").bases("Node","Pattern"),n("ThisExpression").bases("Expression").build(),n("ArrayExpression").bases("Expression").build("elements").field("elements",[i(n("Expression"),null)]),n("ObjectExpression").bases("Expression").build("properties").field("properties",[n("Property")]),n("Property").bases("Node").build("kind","key","value").field("kind",i("init","get","set")).field("key",i(n("Literal"),n("Identifier"))).field("value",n("Expression")),n("SequenceExpression").bases("Expression").build("expressions").field("expressions",[n("Expression")]);var u=i("-","+","!","~","typeof","void","delete");n("UnaryExpression").bases("Expression").build("operator","argument","prefix").field("operator",u).field("argument",n("Expression")).field("prefix",Boolean,a.true);var l=i("==","!=","===","!==","<","<=",">",">=","<<",">>",">>>","+","-","*","/","%","&","|","^","in","instanceof","..");n("BinaryExpression").bases("Expression").build("operator","left","right").field("operator",l).field("left",n("Expression")).field("right",n("Expression"));var c=i("=","+=","-=","*=","/=","%=","<<=",">>=",">>>=","|=","^=","&=");n("AssignmentExpression").bases("Expression").build("operator","left","right").field("operator",c).field("left",n("Pattern")).field("right",n("Expression"));var p=i("++","--");n("UpdateExpression").bases("Expression").build("operator","argument","prefix").field("operator",p).field("argument",n("Expression")).field("prefix",Boolean);var h=i("||","&&");n("LogicalExpression").bases("Expression").build("operator","left","right").field("operator",h).field("left",n("Expression")).field("right",n("Expression")),n("ConditionalExpression").bases("Expression").build("test","consequent","alternate").field("test",n("Expression")).field("consequent",n("Expression")).field("alternate",n("Expression")),n("NewExpression").bases("Expression").build("callee","arguments").field("callee",n("Expression")).field("arguments",[n("Expression")]),n("CallExpression").bases("Expression").build("callee","arguments").field("callee",n("Expression")).field("arguments",[n("Expression")]),n("MemberExpression").bases("Expression").build("object","property","computed").field("object",n("Expression")).field("property",i(n("Identifier"),n("Expression"))).field("computed",Boolean,function(){var e=this.property.type;return"Literal"===e||"MemberExpression"===e||"BinaryExpression"===e}),n("Pattern").bases("Node"),n("SwitchCase").bases("Node").build("test","consequent").field("test",i(n("Expression"),null)).field("consequent",[n("Statement")]),n("Identifier").bases("Node","Expression","Pattern").build("name").field("name",String),n("Literal").bases("Node","Expression").build("value").field("value",i(String,Boolean,null,Number,RegExp)).field("regex",i({pattern:String,flags:String},null),function(){if(this.value instanceof RegExp){var e="";return this.value.ignoreCase&&(e+="i"),this.value.multiline&&(e+="m"),this.value.global&&(e+="g"),{pattern:this.value.source,flags:e}}return null}),n("Comment").bases("Printable").field("value",String).field("leading",Boolean,a.true).field("trailing",Boolean,a.false)}},{"../lib/shared":18,"../lib/types":19}],5:[function(e,t,r){t.exports=function(t){t.use(e("./core"));var r=t.use(e("../lib/types")),n=r.Type.def,i=r.Type.or;n("XMLDefaultDeclaration").bases("Declaration").field("namespace",n("Expression")),n("XMLAnyName").bases("Expression"),n("XMLQualifiedIdentifier").bases("Expression").field("left",i(n("Identifier"),n("XMLAnyName"))).field("right",i(n("Identifier"),n("Expression"))).field("computed",Boolean),n("XMLFunctionQualifiedIdentifier").bases("Expression").field("right",i(n("Identifier"),n("Expression"))).field("computed",Boolean),n("XMLAttributeSelector").bases("Expression").field("attribute",n("Expression")),n("XMLFilterExpression").bases("Expression").field("left",n("Expression")).field("right",n("Expression")),n("XMLElement").bases("XML","Expression").field("contents",[n("XML")]),n("XMLList").bases("XML","Expression").field("contents",[n("XML")]),n("XML").bases("Node"),n("XMLEscape").bases("XML").field("expression",n("Expression")),n("XMLText").bases("XML").field("text",String),n("XMLStartTag").bases("XML").field("contents",[n("XML")]),n("XMLEndTag").bases("XML").field("contents",[n("XML")]),n("XMLPointTag").bases("XML").field("contents",[n("XML")]),n("XMLName").bases("XML").field("contents",i(String,[n("XML")])),n("XMLAttribute").bases("XML").field("value",String),n("XMLCdata").bases("XML").field("contents",String),n("XMLComment").bases("XML").field("contents",String),n("XMLProcessingInstruction").bases("XML").field("target",String).field("contents",i(String,null))}},{"../lib/types":19,"./core":4}],6:[function(e,t,r){t.exports=function(t){t.use(e("./core"));var r=t.use(e("../lib/types")),n=r.Type.def,i=r.Type.or,s=t.use(e("../lib/shared")).defaults;n("Function").field("generator",Boolean,s.false).field("expression",Boolean,s.false).field("defaults",[i(n("Expression"),null)],s.emptyArray).field("rest",i(n("Identifier"),null),s.null),n("RestElement").bases("Pattern").build("argument").field("argument",n("Pattern")),n("SpreadElementPattern").bases("Pattern").build("argument").field("argument",n("Pattern")),n("FunctionDeclaration").build("id","params","body","generator","expression"),n("FunctionExpression").build("id","params","body","generator","expression"),n("ArrowFunctionExpression").bases("Function","Expression").build("params","body","expression").field("id",null,s.null).field("body",i(n("BlockStatement"),n("Expression"))).field("generator",!1,s.false),n("YieldExpression").bases("Expression").build("argument","delegate").field("argument",i(n("Expression"),null)).field("delegate",Boolean,s.false),n("GeneratorExpression").bases("Expression").build("body","blocks","filter").field("body",n("Expression")).field("blocks",[n("ComprehensionBlock")]).field("filter",i(n("Expression"),null)),n("ComprehensionExpression").bases("Expression").build("body","blocks","filter").field("body",n("Expression")).field("blocks",[n("ComprehensionBlock")]).field("filter",i(n("Expression"),null)),n("ComprehensionBlock").bases("Node").build("left","right","each").field("left",n("Pattern")).field("right",n("Expression")).field("each",Boolean),n("Property").field("key",i(n("Literal"),n("Identifier"),n("Expression"))).field("value",i(n("Expression"),n("Pattern"))).field("method",Boolean,s.false).field("shorthand",Boolean,s.false).field("computed",Boolean,s.false),n("PropertyPattern").bases("Pattern").build("key","pattern").field("key",i(n("Literal"),n("Identifier"),n("Expression"))).field("pattern",n("Pattern")).field("computed",Boolean,s.false),n("ObjectPattern").bases("Pattern").build("properties").field("properties",[i(n("PropertyPattern"),n("Property"))]),n("ArrayPattern").bases("Pattern").build("elements").field("elements",[i(n("Pattern"),null)]),n("MethodDefinition").bases("Declaration").build("kind","key","value","static").field("kind",i("constructor","method","get","set")).field("key",i(n("Literal"),n("Identifier"),n("Expression"))).field("value",n("Function")).field("computed",Boolean,s.false).field("static",Boolean,s.false),n("SpreadElement").bases("Node").build("argument").field("argument",n("Expression")),n("ArrayExpression").field("elements",[i(n("Expression"),n("SpreadElement"),n("RestElement"),null)]),n("NewExpression").field("arguments",[i(n("Expression"),n("SpreadElement"))]),n("CallExpression").field("arguments",[i(n("Expression"),n("SpreadElement"))]),n("AssignmentPattern").bases("Pattern").build("left","right").field("left",n("Pattern")).field("right",n("Expression"));var a=i(n("MethodDefinition"),n("VariableDeclarator"),n("ClassPropertyDefinition"),n("ClassProperty"));n("ClassProperty").bases("Declaration").build("key").field("key",i(n("Literal"),n("Identifier"),n("Expression"))).field("computed",Boolean,s.false),n("ClassPropertyDefinition").bases("Declaration").build("definition").field("definition",a),n("ClassBody").bases("Declaration").build("body").field("body",[a]),n("ClassDeclaration").bases("Declaration").build("id","body","superClass").field("id",i(n("Identifier"),null)).field("body",n("ClassBody")).field("superClass",i(n("Expression"),null),s.null),n("ClassExpression").bases("Expression").build("id","body","superClass").field("id",i(n("Identifier"),null),s.null).field("body",n("ClassBody")).field("superClass",i(n("Expression"),null),s.null).field("implements",[n("ClassImplements")],s.emptyArray),n("ClassImplements").bases("Node").build("id").field("id",n("Identifier")).field("superClass",i(n("Expression"),null),s.null),n("Specifier").bases("Node"),n("ModuleSpecifier").bases("Specifier").field("local",i(n("Identifier"),null),s.null).field("id",i(n("Identifier"),null),s.null).field("name",i(n("Identifier"),null),s.null),n("TaggedTemplateExpression").bases("Expression").build("tag","quasi").field("tag",n("Expression")).field("quasi",n("TemplateLiteral")),n("TemplateLiteral").bases("Expression").build("quasis","expressions").field("quasis",[n("TemplateElement")]).field("expressions",[n("Expression")]),n("TemplateElement").bases("Node").build("value","tail").field("value",{cooked:String,raw:String}).field("tail",Boolean)}},{"../lib/shared":18,"../lib/types":19,"./core":4}],7:[function(e,t,r){t.exports=function(t){t.use(e("./es6"));var r=t.use(e("../lib/types")),n=r.Type.def,i=r.Type.or,s=(r.builtInTypes,t.use(e("../lib/shared")).defaults);n("Function").field("async",Boolean,s.false),n("SpreadProperty").bases("Node").build("argument").field("argument",n("Expression")),n("ObjectExpression").field("properties",[i(n("Property"),n("SpreadProperty"))]),n("SpreadPropertyPattern").bases("Pattern").build("argument").field("argument",n("Pattern")),n("ObjectPattern").field("properties",[i(n("Property"),n("PropertyPattern"),n("SpreadPropertyPattern"))]),n("AwaitExpression").bases("Expression").build("argument","all").field("argument",i(n("Expression"),null)).field("all",Boolean,s.false)}},{"../lib/shared":18,"../lib/types":19,"./es6":6}],8:[function(e,t,r){t.exports=function(t){t.use(e("./es7"));var r=t.use(e("../lib/types")),n=t.use(e("../lib/shared")).defaults,i=r.Type.def,s=r.Type.or;i("VariableDeclaration").field("declarations",[s(i("VariableDeclarator"),i("Identifier"))]),i("Property").field("value",s(i("Expression"),i("Pattern"))),i("ArrayPattern").field("elements",[s(i("Pattern"),i("SpreadElement"),null)]),i("ObjectPattern").field("properties",[s(i("Property"),i("PropertyPattern"),i("SpreadPropertyPattern"),i("SpreadProperty"))]),i("ExportSpecifier").bases("ModuleSpecifier").build("id","name"),i("ExportBatchSpecifier").bases("Specifier").build(),i("ImportSpecifier").bases("ModuleSpecifier").build("id","name"),i("ImportNamespaceSpecifier").bases("ModuleSpecifier").build("id"),i("ImportDefaultSpecifier").bases("ModuleSpecifier").build("id"),i("ExportDeclaration").bases("Declaration").build("default","declaration","specifiers","source").field("default",Boolean).field("declaration",s(i("Declaration"),i("Expression"),null)).field("specifiers",[s(i("ExportSpecifier"),i("ExportBatchSpecifier"))],n.emptyArray).field("source",s(i("Literal"),null),n.null),i("ImportDeclaration").bases("Declaration").build("specifiers","source","importKind").field("specifiers",[s(i("ImportSpecifier"),i("ImportNamespaceSpecifier"),i("ImportDefaultSpecifier"))],n.emptyArray).field("source",i("Literal")).field("importKind",s("value","type"),function(){return"value"}),i("Block").bases("Comment").build("value","leading","trailing"),i("Line").bases("Comment").build("value","leading","trailing")}},{"../lib/shared":18,"../lib/types":19,"./es7":7}],9:[function(e,t,r){t.exports=function(t){t.use(e("./es7"));var r=t.use(e("../lib/types")),n=r.Type.def,i=r.Type.or,s=t.use(e("../lib/shared")).defaults;n("Type").bases("Node"),n("AnyTypeAnnotation").bases("Type").build(),n("EmptyTypeAnnotation").bases("Type").build(),n("MixedTypeAnnotation").bases("Type").build(),n("VoidTypeAnnotation").bases("Type").build(),n("NumberTypeAnnotation").bases("Type").build(),n("NumberLiteralTypeAnnotation").bases("Type").build("value","raw").field("value",Number).field("raw",String),n("NumericLiteralTypeAnnotation").bases("Type").build("value","raw").field("value",Number).field("raw",String),n("StringTypeAnnotation").bases("Type").build(),n("StringLiteralTypeAnnotation").bases("Type").build("value","raw").field("value",String).field("raw",String),n("BooleanTypeAnnotation").bases("Type").build(),n("BooleanLiteralTypeAnnotation").bases("Type").build("value","raw").field("value",Boolean).field("raw",String),n("TypeAnnotation").bases("Node").build("typeAnnotation").field("typeAnnotation",n("Type")),n("NullableTypeAnnotation").bases("Type").build("typeAnnotation").field("typeAnnotation",n("Type")),n("NullLiteralTypeAnnotation").bases("Type").build(),n("NullTypeAnnotation").bases("Type").build(),n("ThisTypeAnnotation").bases("Type").build(),n("ExistsTypeAnnotation").bases("Type").build(),n("ExistentialTypeParam").bases("Type").build(),n("FunctionTypeAnnotation").bases("Type").build("params","returnType","rest","typeParameters").field("params",[n("FunctionTypeParam")]).field("returnType",n("Type")).field("rest",i(n("FunctionTypeParam"),null)).field("typeParameters",i(n("TypeParameterDeclaration"),null)),n("FunctionTypeParam").bases("Node").build("name","typeAnnotation","optional").field("name",n("Identifier")).field("typeAnnotation",n("Type")).field("optional",Boolean),n("ArrayTypeAnnotation").bases("Type").build("elementType").field("elementType",n("Type")),n("ObjectTypeAnnotation").bases("Type").build("properties","indexers","callProperties").field("properties",[n("ObjectTypeProperty")]).field("indexers",[n("ObjectTypeIndexer")],s.emptyArray).field("callProperties",[n("ObjectTypeCallProperty")],s.emptyArray).field("exact",Boolean,s.false),n("ObjectTypeProperty").bases("Node").build("key","value","optional").field("key",i(n("Literal"),n("Identifier"))).field("value",n("Type")).field("optional",Boolean).field("variance",i("plus","minus",null),s.null),n("ObjectTypeIndexer").bases("Node").build("id","key","value").field("id",n("Identifier")).field("key",n("Type")).field("value",n("Type")).field("variance",i("plus","minus",null),s.null),n("ObjectTypeCallProperty").bases("Node").build("value").field("value",n("FunctionTypeAnnotation")).field("static",Boolean,s.false),n("QualifiedTypeIdentifier").bases("Node").build("qualification","id").field("qualification",i(n("Identifier"),n("QualifiedTypeIdentifier"))).field("id",n("Identifier")),n("GenericTypeAnnotation").bases("Type").build("id","typeParameters").field("id",i(n("Identifier"),n("QualifiedTypeIdentifier"))).field("typeParameters",i(n("TypeParameterInstantiation"),null)),n("MemberTypeAnnotation").bases("Type").build("object","property").field("object",n("Identifier")).field("property",i(n("MemberTypeAnnotation"),n("GenericTypeAnnotation"))),n("UnionTypeAnnotation").bases("Type").build("types").field("types",[n("Type")]),n("IntersectionTypeAnnotation").bases("Type").build("types").field("types",[n("Type")]),n("TypeofTypeAnnotation").bases("Type").build("argument").field("argument",n("Type")),n("Identifier").field("typeAnnotation",i(n("TypeAnnotation"),null),s.null),n("TypeParameterDeclaration").bases("Node").build("params").field("params",[n("TypeParameter")]),n("TypeParameterInstantiation").bases("Node").build("params").field("params",[n("Type")]),n("TypeParameter").bases("Type").build("name","variance","bound").field("name",String).field("variance",i("plus","minus",null),s.null).field("bound",i(n("TypeAnnotation"),null),s.null),n("Function").field("returnType",i(n("TypeAnnotation"),null),s.null).field("typeParameters",i(n("TypeParameterDeclaration"),null),s.null),n("ClassProperty").build("key","value","typeAnnotation","static").field("value",i(n("Expression"),null)).field("typeAnnotation",i(n("TypeAnnotation"),null)).field("static",Boolean,s.false).field("variance",i("plus","minus",null),s.null),n("ClassImplements").field("typeParameters",i(n("TypeParameterInstantiation"),null),s.null),n("InterfaceDeclaration").bases("Declaration").build("id","body","extends").field("id",n("Identifier")).field("typeParameters",i(n("TypeParameterDeclaration"),null),s.null).field("body",n("ObjectTypeAnnotation")).field("extends",[n("InterfaceExtends")]),n("DeclareInterface").bases("InterfaceDeclaration").build("id","body","extends"),n("InterfaceExtends").bases("Node").build("id").field("id",n("Identifier")).field("typeParameters",i(n("TypeParameterInstantiation"),null)),n("TypeAlias").bases("Declaration").build("id","typeParameters","right").field("id",n("Identifier")).field("typeParameters",i(n("TypeParameterDeclaration"),null)).field("right",n("Type")),n("DeclareTypeAlias").bases("TypeAlias").build("id","typeParameters","right"),n("TypeCastExpression").bases("Expression").build("expression","typeAnnotation").field("expression",n("Expression")).field("typeAnnotation",n("TypeAnnotation")),n("TupleTypeAnnotation").bases("Type").build("types").field("types",[n("Type")]),n("DeclareVariable").bases("Statement").build("id").field("id",n("Identifier")),n("DeclareFunction").bases("Statement").build("id").field("id",n("Identifier")),n("DeclareClass").bases("InterfaceDeclaration").build("id"),n("DeclareModule").bases("Statement").build("id","body").field("id",i(n("Identifier"),n("Literal"))).field("body",n("BlockStatement")),n("DeclareModuleExports").bases("Statement").build("typeAnnotation").field("typeAnnotation",n("Type")),n("DeclareExportDeclaration").bases("Declaration").build("default","declaration","specifiers","source").field("default",Boolean).field("declaration",i(n("DeclareVariable"),n("DeclareFunction"),n("DeclareClass"),n("Type"),null)).field("specifiers",[i(n("ExportSpecifier"),n("ExportBatchSpecifier"))],s.emptyArray).field("source",i(n("Literal"),null),s.null),n("DeclareExportAllDeclaration").bases("Declaration").build("source").field("source",i(n("Literal"),null),s.null)}},{"../lib/shared":18,"../lib/types":19,"./es7":7}],10:[function(e,t,r){t.exports=function(t){t.use(e("./es7"));var r=t.use(e("../lib/types")),n=r.Type.def,i=r.Type.or,s=t.use(e("../lib/shared")).defaults;n("JSXAttribute").bases("Node").build("name","value").field("name",i(n("JSXIdentifier"),n("JSXNamespacedName"))).field("value",i(n("Literal"),n("JSXExpressionContainer"),null),s.null),n("JSXIdentifier").bases("Identifier").build("name").field("name",String),n("JSXNamespacedName").bases("Node").build("namespace","name").field("namespace",n("JSXIdentifier")).field("name",n("JSXIdentifier")),n("JSXMemberExpression").bases("MemberExpression").build("object","property").field("object",i(n("JSXIdentifier"),n("JSXMemberExpression"))).field("property",n("JSXIdentifier")).field("computed",Boolean,s.false);var a=i(n("JSXIdentifier"),n("JSXNamespacedName"),n("JSXMemberExpression"));n("JSXSpreadAttribute").bases("Node").build("argument").field("argument",n("Expression"));var o=[i(n("JSXAttribute"),n("JSXSpreadAttribute"))];n("JSXExpressionContainer").bases("Expression").build("expression").field("expression",n("Expression")),n("JSXElement").bases("Expression").build("openingElement","closingElement","children").field("openingElement",n("JSXOpeningElement")).field("closingElement",i(n("JSXClosingElement"),null),s.null).field("children",[i(n("JSXElement"),n("JSXExpressionContainer"),n("JSXText"),n("Literal"))],s.emptyArray).field("name",a,function(){return this.openingElement.name},!0).field("selfClosing",Boolean,function(){return this.openingElement.selfClosing},!0).field("attributes",o,function(){return this.openingElement.attributes},!0),n("JSXOpeningElement").bases("Node").build("name","attributes","selfClosing").field("name",a).field("attributes",o,s.emptyArray).field("selfClosing",Boolean,s.false),n("JSXClosingElement").bases("Node").build("name").field("name",a),n("JSXText").bases("Literal").build("value").field("value",String),n("JSXEmptyExpression").bases("Expression").build()}},{"../lib/shared":18,"../lib/types":19,"./es7":7}],11:[function(e,t,r){t.exports=function(t){t.use(e("./core"));var r=t.use(e("../lib/types")),n=r.Type.def,i=r.Type.or,s=t.use(e("../lib/shared")),a=s.geq,o=s.defaults;n("Function").field("body",i(n("BlockStatement"),n("Expression"))),n("ForInStatement").build("left","right","body","each").field("each",Boolean,o.false),n("ForOfStatement").bases("Statement").build("left","right","body").field("left",i(n("VariableDeclaration"),n("Expression"))).field("right",n("Expression")).field("body",n("Statement")),n("LetStatement").bases("Statement").build("head","body").field("head",[n("VariableDeclarator")]).field("body",n("Statement")),n("LetExpression").bases("Expression").build("head","body").field("head",[n("VariableDeclarator")]).field("body",n("Expression")),n("GraphExpression").bases("Expression").build("index","expression").field("index",a(0)).field("expression",n("Literal")),n("GraphIndexExpression").bases("Expression").build("index").field("index",a(0))}},{"../lib/shared":18,"../lib/types":19,"./core":4}],12:[function(e,t,r){t.exports=function(t){function r(e){var t=n.indexOf(e);return-1===t&&(t=n.length,n.push(e),i[t]=e(s)),i[t]}var n=[],i=[],s={};s.use=r;var a=r(e("./lib/types"));t.forEach(r),a.finalize();var o={Type:a.Type,builtInTypes:a.builtInTypes,namedTypes:a.namedTypes,builders:a.builders,defineMethod:a.defineMethod,getFieldNames:a.getFieldNames,getFieldValue:a.getFieldValue,eachField:a.eachField,someField:a.someField,getSupertypeNames:a.getSupertypeNames,astNodesAreEquivalent:r(e("./lib/equiv")),finalize:a.finalize,Path:r(e("./lib/path")),NodePath:r(e("./lib/node-path")),PathVisitor:r(e("./lib/path-visitor")),use:r};return o.visit=o.PathVisitor.visit,o}},{"./lib/equiv":13,"./lib/node-path":14,"./lib/path":16,"./lib/path-visitor":15,"./lib/types":19}],13:[function(e,t,r){t.exports=function(t){function r(e,t,r){return u.check(r)?r.length=0:r=null,i(e,t,r)}function n(e){return/[_$a-z][_$a-z0-9]*/i.test(e)?"."+e:"["+JSON.stringify(e)+"]"}function i(e,t,r){return e===t||(u.check(e)?function(e,t,r){u.assert(e);var n=e.length;if(!u.check(t)||t.length!==n)return r&&r.push("length"),!1;for(var s=0;su)return!0;if(s===u&&"right"===this.name){if(r.right!==t)throw new Error("Nodes must be equal");return!0}default:return!1}case"SequenceExpression":switch(r.type){case"ForStatement":return!1;case"ExpressionStatement":return"expression"!==this.name;default:return!0}case"YieldExpression":switch(r.type){case"BinaryExpression":case"LogicalExpression":case"UnaryExpression":case"SpreadElement":case"SpreadProperty":case"CallExpression":case"MemberExpression":case"NewExpression":case"ConditionalExpression":case"YieldExpression":return!0;default:return!1}case"Literal":return"MemberExpression"===r.type&&l.check(t.value)&&"object"===this.name&&r.object===t;case"AssignmentExpression":case"ConditionalExpression":switch(r.type){case"UnaryExpression":case"SpreadElement":case"SpreadProperty":case"BinaryExpression":case"LogicalExpression":return!0;case"CallExpression":return"callee"===this.name&&r.callee===t;case"ConditionalExpression":return"test"===this.name&&r.test===t;case"MemberExpression":return"object"===this.name&&r.object===t;default:return!1}default:if("NewExpression"===r.type&&"callee"===this.name&&r.callee===t)return i(t)}return!(!0===e||this.canBeFirstInStatement()||!this.firstInStatement())};var d={};return[["||"],["&&"],["|"],["^"],["&"],["==","===","!=","!=="],["<",">","<=",">=","in","instanceof"],[">>","<<",">>>"],["+","-"],["*","/","%"]].forEach(function(e,t){e.forEach(function(e){d[e]=t})}),f.canBeFirstInStatement=function(){var e=this.node;return!o.FunctionExpression.check(e)&&!o.ObjectExpression.check(e)},f.firstInStatement=function(){return function(e){for(var t,r;e.parent;e=e.parent){if(t=e.node,r=e.parent.node,o.BlockStatement.check(r)&&"body"===e.parent.name&&0===e.name){if(r.body[0]!==t)throw new Error("Nodes must be equal");return!0}if(o.ExpressionStatement.check(r)&&"expression"===e.name){if(r.expression!==t)throw new Error("Nodes must be equal");return!0}if(o.SequenceExpression.check(r)&&"expressions"===e.parent.name&&0===e.name){if(r.expressions[0]!==t)throw new Error("Nodes must be equal")}else if(o.CallExpression.check(r)&&"callee"===e.name){if(r.callee!==t)throw new Error("Nodes must be equal")}else if(o.MemberExpression.check(r)&&"object"===e.name){if(r.object!==t)throw new Error("Nodes must be equal")}else if(o.ConditionalExpression.check(r)&&"test"===e.name){if(r.test!==t)throw new Error("Nodes must be equal")}else if(n(r)&&"left"===e.name){if(r.left!==t)throw new Error("Nodes must be equal")}else{if(!o.UnaryExpression.check(r)||r.prefix||"argument"!==e.name)return!1;if(r.argument!==t)throw new Error("Nodes must be equal")}}return!0}(this)},r}},{"./path":16,"./scope":17,"./types":19}],15:[function(e,t,r){var n=Object.prototype.hasOwnProperty;t.exports=function(t){function r(){if(!(this instanceof r))throw new Error("PathVisitor constructor cannot be invoked without 'new'");this._reusableContextStack=[],this._methodNameTable=function(e){var t=Object.create(null);for(var r in e)/^visit[A-Z]/.test(r)&&(t[r.slice("visit".length)]=!0);for(var n=a.computeSupertypeLookupTable(t),i=Object.create(null),s=(t=Object.keys(n)).length,o=0;o=0&&(s[e.name=a]=e)}else i[e.name]=e.value,s[e.name]=e;if(i[e.name]!==e.value)throw new Error("");if(e.parentPath.get(e.name)!==e)throw new Error("")}(this),l.check(i)){for(var u=i.length,c=o(this.parentPath,a-1,this.name+1),p=[this.name,1],h=0;h=e},a+" >= "+e)},r.defaults={null:function(){return null},emptyArray:function(){return[]},false:function(){return!1},true:function(){return!0},undefined:function(){}};var o=i.or(s.string,s.number,s.boolean,s.null,s.undefined);return r.isPrimitive=new i(function(e){if(null===e)return!0;var t=typeof e;return!("object"===t||"function"===t)},o.toString()),r}},{"../lib/types":19}],19:[function(e,t,r){var n=Array.prototype,i=n.slice,s=(n.map,n.forEach,Object.prototype),a=s.toString,o=a.call(function(){}),u=a.call(""),l=s.hasOwnProperty;t.exports=function(){function e(t,r){var n=this;if(!(n instanceof e))throw new Error("Type constructor cannot be invoked without 'new'");if(a.call(t)!==o)throw new Error(t+" is not a function");var i=a.call(r);if(i!==o&&i!==u)throw new Error(r+" is neither a function nor a string");Object.defineProperties(n,{name:{value:r},check:{value:function(e,r){var i=t.call(n,e,r);return!i&&r&&a.call(r)===o&&r(n,e),i}}})}function t(e){return S.check(e)?"{"+Object.keys(e).map(function(t){return t+": "+e[t]}).join(", ")+"}":D.check(e)?"["+e.map(t).join(", ")+"]":JSON.stringify(e)}function r(t,r){var n=a.call(t),i=new e(function(e){return a.call(e)===n},r);return x[r]=i,t&&"function"==typeof t.constructor&&(b.push(t.constructor),v.push(i)),i}function n(t,r){if(t instanceof e)return t;if(t instanceof c)return t.type;if(D.check(t))return e.fromArray(t);if(S.check(t))return e.fromObject(t);if(A.check(t)){var n=b.indexOf(t);return n>=0?v[n]:new e(t,r)}return new e(function(e){return e===t},_.check(r)?function(){return t+""}:r)}function s(e,t,r,i){if(!(this instanceof s))throw new Error("Field constructor cannot be invoked without 'new'");E.assert(e);var a={name:{value:e},type:{value:t=n(t)},hidden:{value:!!i}};A.check(r)&&(a.defaultFn={value:r}),Object.defineProperties(this,a)}function c(t){var r=this;if(!(r instanceof c))throw new Error("Def constructor cannot be invoked without 'new'");Object.defineProperties(r,{typeName:{value:t},baseNames:{value:[]},ownFields:{value:Object.create(null)},allSupertypes:{value:Object.create(null)},supertypeList:{value:[]},allFields:{value:Object.create(null)},fieldNames:{value:[]},type:{value:new e(function(e,t){return r.check(e,t)},t)}})}function p(e){return e.replace(/^[A-Z]+/,function(e){var t=e.length;switch(t){case 0:return"";case 1:return e.toLowerCase();default:return e.slice(0,t-1).toLowerCase()+e.charAt(t-1)}})}function h(e){return(e=p(e)).replace(/(Expression)?$/,"Statement")}function f(e){var t=c.fromValue(e);if(t)return t.fieldNames.slice(0);if("type"in e)throw new Error("did not recognize object of type "+JSON.stringify(e.type));return Object.keys(e)}function d(e,t){var r=c.fromValue(e);if(r){var n=r.allFields[t];if(n)return n.getValue(e)}return e&&e[t]}function m(e,t){return Object.keys(t).forEach(function(r){e[r]=t[r]}),e}var y={},g=e.prototype;y.Type=e,g.assert=function(e,r){if(!this.check(e,r)){var n=t(e);throw new Error(n+" does not match type "+this)}return!0},g.toString=function(){var e=this.name;return E.check(e)?e:A.check(e)?e.call(this)+"":e+" type"};var b=[],v=[],x={};y.builtInTypes=x;var E=r("truthy","string"),A=r(function(){},"function"),D=r([],"array"),S=r({},"object"),C=(r(/./,"RegExp"),r(new Date,"Date"),r(3,"number")),_=(r(!0,"boolean"),r(null,"null"),r(void 0,"undefined"));e.or=function(){for(var t=[],r=arguments.length,i=0;i=0&&function(e){var t=h(e);if(!T[t]){var r=T[p(e)];r&&(T[t]=function(){return T.expressionStatement(r.apply(T,arguments))})}}(e.typeName)}},y.finalize=function(){Object.keys(k).forEach(function(e){k[e].finalize()})},y}},{}],20:[function(e,t,r){t.exports=e("./fork")([e("./def/core"),e("./def/es6"),e("./def/es7"),e("./def/mozilla"),e("./def/e4x"),e("./def/jsx"),e("./def/flow"),e("./def/esprima"),e("./def/babel"),e("./def/babel6")])},{"./def/babel":2,"./def/babel6":3,"./def/core":4,"./def/e4x":5,"./def/es6":6,"./def/es7":7,"./def/esprima":8,"./def/flow":9,"./def/jsx":10,"./def/mozilla":11,"./fork":12}],21:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){return t.replace(a.default,function(){for(var t=arguments.length,r=Array(t),n=0;n3&&void 0!==arguments[3]?arguments[3]:{};r=Math.max(r,0);var s=n.highlightCode&&u.default.supportsColor||n.forceColor,a=u.default;n.forceColor&&(a=new u.default.constructor({enabled:!0}));var o=function(e,t){return s?e(t):t},c=function(e){return{keyword:e.cyan,capitalized:e.yellow,jsx_tag:e.yellow,punctuator:e.yellow,number:e.magenta,string:e.green,regex:e.magenta,comment:e.grey,invalid:e.white.bgRed.bold,gutter:e.grey,marker:e.red.bold}}(a);s&&(e=i(c,e));var p=n.linesAbove||2,h=n.linesBelow||3,f=e.split(l),d=Math.max(t-(p+1),0),m=Math.min(f.length,t+h);t||r||(d=0,m=f.length);var y=String(m).length,g=f.slice(d,m).map(function(e,n){var i=d+1+n,s=" "+(" "+i).slice(-y)+" | ";if(i===t){var a="";if(r){var u=e.slice(0,r-1).replace(/[^\t]/g," ");a=["\n ",o(c.gutter,s.replace(/\d/g," ")),u,o(c.marker,"^")].join("")}return[o(c.marker,">"),o(c.gutter,s),e,a].join("")}return" "+o(c.gutter,s)+e}).join("\n");return s?a.reset(g):g};var s=e("js-tokens"),a=n(s),o=n(e("esutils")),u=n(e("chalk")),l=/\r\n|[\n\r\u2028\u2029]/,c=/^[a-z][\w-]*$/i,p=/^[()\[\]{}]$/;t.exports=r.default},{chalk:24,esutils:28,"js-tokens":322}],22:[function(e,t,r){"use strict";t.exports=function(){return/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-PRZcf-nqry=><]/g}},{}],23:[function(e,t,r){"use strict";Object.defineProperty(t,"exports",{enumerable:!0,get:function(){var e={modifiers:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},colors:{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]},bgColors:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49]}};return e.colors.grey=e.colors.gray,Object.keys(e).forEach(function(t){var r=e[t];Object.keys(r).forEach(function(t){var n=r[t];e[t]=r[t]={open:"["+n[0]+"m",close:"["+n[1]+"m"}}),Object.defineProperty(e,t,{value:r,enumerable:!1})}),e}})},{}],24:[function(e,t,r){(function(r){"use strict";function n(e){this.enabled=e&&void 0!==e.enabled?e.enabled:l}function i(e){var t=function(){return function(){var e=arguments,t=e.length,r=0!==t&&String(arguments[0]);if(t>1)for(var n=1;n=97&&o<=122||o>=65&&o<=90||36===o||95===o;for(a=new Array(128),o=0;o<128;++o)a[o]=o>=97&&o<=122||o>=65&&o<=90||o>=48&&o<=57||36===o||95===o;t.exports={isDecimalDigit:function(e){return 48<=e&&e<=57},isHexDigit:function(e){return 48<=e&&e<=57||97<=e&&e<=102||65<=e&&e<=70},isOctalDigit:function(e){return e>=48&&e<=55},isWhiteSpace:function(e){return 32===e||9===e||11===e||12===e||160===e||e>=5760&&i.indexOf(e)>=0},isLineTerminator:function(e){return 10===e||13===e||8232===e||8233===e},isIdentifierStartES5:function(t){return t<128?s[t]:n.NonAsciiIdentifierStart.test(e(t))},isIdentifierPartES5:function(t){return t<128?a[t]:n.NonAsciiIdentifierPart.test(e(t))},isIdentifierStartES6:function(t){return t<128?s[t]:r.NonAsciiIdentifierStart.test(e(t))},isIdentifierPartES6:function(t){return t<128?a[t]:r.NonAsciiIdentifierPart.test(e(t))}}}()},{}],27:[function(e,t,r){!function(){"use strict";function r(e,t){return!(!t&&"yield"===e)&&n(e,t)}function n(e,t){if(t&&function(e){switch(e){case"implements":case"interface":case"package":case"private":case"protected":case"public":case"static":case"let":return!0;default:return!1}}(e))return!0;switch(e.length){case 2:return"if"===e||"in"===e||"do"===e;case 3:return"var"===e||"for"===e||"new"===e||"try"===e;case 4:return"this"===e||"else"===e||"case"===e||"void"===e||"with"===e||"enum"===e;case 5:return"while"===e||"break"===e||"catch"===e||"throw"===e||"const"===e||"yield"===e||"class"===e||"super"===e;case 6:return"return"===e||"typeof"===e||"delete"===e||"switch"===e||"export"===e||"import"===e;case 7:return"default"===e||"finally"===e||"extends"===e;case 8:return"function"===e||"continue"===e||"debugger"===e;case 10:return"instanceof"===e;default:return!1}}function i(e,t){return"null"===e||"true"===e||"false"===e||r(e,t)}function s(e,t){return"null"===e||"true"===e||"false"===e||n(e,t)}function a(e){var t,r,n;if(0===e.length)return!1;if(n=e.charCodeAt(0),!l.isIdentifierStartES5(n))return!1;for(t=1,r=e.length;t=r)return!1;if(!(56320<=(i=e.charCodeAt(t))&&i<=57343))return!1;n=o(n,i)}if(!s(n))return!1;s=l.isIdentifierPartES6}return!0}var l=e("./code");t.exports={isKeywordES5:r,isKeywordES6:n,isReservedWordES5:i,isReservedWordES6:s,isRestrictedWord:function(e){return"eval"===e||"arguments"===e},isIdentifierNameES5:a,isIdentifierNameES6:u,isIdentifierES5:function(e,t){return a(e)&&!i(e,t)},isIdentifierES6:function(e,t){return u(e)&&!s(e,t)}}}()},{"./code":26}],28:[function(e,t,r){!function(){"use strict";r.ast=e("./ast"),r.code=e("./code"),r.keyword=e("./keyword")}()},{"./ast":25,"./code":26,"./keyword":27}],29:[function(e,t,r){"use strict";var n=e("ansi-regex")();t.exports=function(e){return"string"==typeof e?e.replace(n,""):e}},{"ansi-regex":22}],30:[function(e,t,r){(function(e){"use strict";var r=e.argv,n=r.indexOf("--"),i=function(e){e="--"+e;var t=r.indexOf(e);return-1!==t&&(-1===n||t1&&void 0!==arguments[1]?arguments[1]:{};return t.filename=e,x(h.default.readFileSync(e,"utf8"),t)};var h=i(e("fs")),f=n(e("../util")),d=n(e("babel-messages")),m=n(e("babel-types")),y=i(e("babel-traverse")),g=i(e("../transformation/file/options/option-manager")),b=i(e("../transformation/pipeline"));r.util=f,r.messages=d,r.types=m,r.traverse=y.default,r.OptionManager=g.default,r.Pipeline=b.default;var v=new b.default,x=(r.analyse=v.analyse.bind(v),r.transform=v.transform.bind(v));r.transformFromAst=v.transformFromAst.bind(v)},{"../../package":73,"../helpers/resolve-plugin":38,"../helpers/resolve-preset":39,"../tools/build-external-helpers":42,"../transformation/file":43,"../transformation/file/options/config":47,"../transformation/file/options/option-manager":49,"../transformation/pipeline":54,"../util":57,"babel-messages":110,"babel-template":139,"babel-traverse":143,"babel-types":180,fs:193}],33:[function(e,t,r){"use strict";r.__esModule=!0,r.default=function(e){return["babel-plugin-"+e,e]},t.exports=r.default},{}],34:[function(e,t,r){"use strict";r.__esModule=!0,r.default=function(e){var t=["babel-preset-"+e,e],r=e.match(/^(@[^/]+)\/(.+)$/);if(r){var n=r[1],i=r[2];t.push(n+"/babel-preset-"+i)}return t},t.exports=r.default},{}],35:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}r.__esModule=!0;var i=n(e("babel-runtime/core-js/get-iterator"));r.default=function(e,t){if(e&&t)return(0,s.default)(e,t,function(e,t){if(t&&Array.isArray(e)){var r=t.slice(0),n=e,s=Array.isArray(n),a=0;for(n=s?n:(0,i.default)(n);;){var o;if(s){if(a>=n.length)break;o=n[a++]}else{if((a=n.next()).done)break;o=a.value}var u=o;r.indexOf(u)<0&&r.push(u)}return r}})};var s=n(e("lodash/mergeWith"));t.exports=r.default},{"babel-runtime/core-js/get-iterator":120,"lodash/mergeWith":527}],36:[function(e,t,r){"use strict";r.__esModule=!0,r.default=function(e,t,r){if(e){if("Program"===e.type)return n.file(e,t||[],r||[]);if("File"===e.type)return e}throw new Error("Not a valid ast?")};var n=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(e("babel-types"));t.exports=r.default},{"babel-types":180}],37:[function(e,t,r){"use strict";r.__esModule=!0,r.default=function(e,t){return e.reduce(function(e,r){return e||(0,n.default)(r,t)},null)};var n=function(e){return e&&e.__esModule?e:{default:e}}(e("./resolve"));t.exports=r.default},{"./resolve":40}],38:[function(e,t,r){(function(n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}r.__esModule=!0,r.default=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:n.cwd();return(0,s.default)((0,a.default)(e),t)};var s=i(e("./resolve-from-possible-names")),a=i(e("./get-possible-plugin-names"));t.exports=r.default}).call(this,e("_process"))},{"./get-possible-plugin-names":33,"./resolve-from-possible-names":37,_process:550}],39:[function(e,t,r){(function(n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}r.__esModule=!0,r.default=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:n.cwd();return(0,s.default)((0,a.default)(e),t)};var s=i(e("./resolve-from-possible-names")),a=i(e("./get-possible-preset-names"));t.exports=r.default}).call(this,e("_process"))},{"./get-possible-preset-names":34,"./resolve-from-possible-names":37,_process:550}],40:[function(e,t,r){(function(n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}r.__esModule=!0;var s=i(e("babel-runtime/helpers/typeof"));r.default=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:n.cwd();if("object"===(void 0===a.default?"undefined":(0,s.default)(a.default)))return null;var r=u[t];if(!r){r=new a.default;var i=o.default.join(t,".babelrc");r.id=i,r.filename=i,r.paths=a.default._nodeModulePaths(t),u[t]=r}try{return a.default._resolveFilename(e,r)}catch(e){return null}};var a=i(e("module")),o=i(e("path")),u={};t.exports=r.default}).call(this,e("_process"))},{_process:550,"babel-runtime/helpers/typeof":138,module:193,path:546}],41:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}r.__esModule=!0;var i=n(e("babel-runtime/core-js/map")),s=n(e("babel-runtime/helpers/classCallCheck")),a=n(e("babel-runtime/helpers/possibleConstructorReturn")),o=n(e("babel-runtime/helpers/inherits")),u=function(e){function t(){(0,s.default)(this,t);var r=(0,a.default)(this,e.call(this));return r.dynamicData={},r}return(0,o.default)(t,e),t.prototype.setDynamic=function(e,t){this.dynamicData[e]=t},t.prototype.get=function(t){if(this.has(t))return e.prototype.get.call(this,t);if(Object.prototype.hasOwnProperty.call(this.dynamicData,t)){var r=this.dynamicData[t]();return this.set(t,r),r}},t}(i.default);r.default=u,t.exports=r.default},{"babel-runtime/core-js/map":122,"babel-runtime/helpers/classCallCheck":134,"babel-runtime/helpers/inherits":135,"babel-runtime/helpers/possibleConstructorReturn":137}],42:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}function s(e,t){var r=[],n=h.functionExpression(null,[h.identifier("global")],h.blockStatement(r)),i=h.program([h.expressionStatement(h.callExpression(n,[u.get("selfGlobal")]))]);return r.push(h.variableDeclaration("var",[h.variableDeclarator(e,h.assignmentExpression("=",h.memberExpression(h.identifier("global"),e),h.objectExpression([])))])),t(r),i}function a(e,t){var r=[];return r.push(h.variableDeclaration("var",[h.variableDeclarator(e,h.identifier("global"))])),t(r),h.program([f({FACTORY_PARAMETERS:h.identifier("global"),BROWSER_ARGUMENTS:h.assignmentExpression("=",h.memberExpression(h.identifier("root"),e),h.objectExpression([])),COMMON_ARGUMENTS:h.identifier("exports"),AMD_ARGUMENTS:h.arrayExpression([h.stringLiteral("exports")]),FACTORY_BODY:r,UMD_ROOT:h.identifier("this")})])}function o(e,t){var r=[];return r.push(h.variableDeclaration("var",[h.variableDeclarator(e,h.objectExpression([]))])),t(r),r.push(h.expressionStatement(e)),h.program(r)}r.__esModule=!0,r.default=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"global",r=h.identifier("babelHelpers"),n=void 0,i={global:s,umd:a,var:o}[t];if(!i)throw new Error(c.get("unsupportedOutputType",t));return n=i(r,function(t){return function(e,t,r){u.list.forEach(function(n){if(!(r&&r.indexOf(n)<0)){var i=h.identifier(n);e.push(h.expressionStatement(h.assignmentExpression("=",h.memberExpression(t,i),u.get(n))))}})}(t,r,e)}),(0,l.default)(n).code};var u=i(e("babel-helpers")),l=n(e("babel-generator")),c=i(e("babel-messages")),p=n(e("babel-template")),h=i(e("babel-types")),f=(0,p.default)('\n (function (root, factory) {\n if (typeof define === "function" && define.amd) {\n define(AMD_ARGUMENTS, factory);\n } else if (typeof exports === "object") {\n factory(COMMON_ARGUMENTS);\n } else {\n factory(BROWSER_ARGUMENTS);\n }\n })(UMD_ROOT, function (FACTORY_PARAMETERS) {\n FACTORY_BODY\n });\n');t.exports=r.default},{"babel-generator":85,"babel-helpers":109,"babel-messages":110,"babel-template":139,"babel-types":180}],43:[function(e,t,r){(function(t){"use strict";function n(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}function i(e){return e&&e.__esModule?e:{default:e}}r.__esModule=!0,r.File=void 0;var s=i(e("babel-runtime/core-js/get-iterator")),a=i(e("babel-runtime/core-js/object/create")),o=i(e("babel-runtime/core-js/object/assign")),u=i(e("babel-runtime/helpers/classCallCheck")),l=i(e("babel-runtime/helpers/possibleConstructorReturn")),c=i(e("babel-runtime/helpers/inherits")),p=i(e("babel-helpers")),h=n(e("./metadata")),f=i(e("convert-source-map")),d=i(e("./options/option-manager")),m=i(e("../plugin-pass")),y=e("babel-traverse"),g=i(y),b=i(e("source-map")),v=i(e("babel-generator")),x=i(e("babel-code-frame")),E=i(e("lodash/defaults")),A=i(e("./logger")),D=i(e("../../store")),S=e("babylon"),C=n(e("../../util")),_=i(e("path")),w=n(e("babel-types")),k=i(e("../../helpers/resolve")),F=i(e("../internal-plugins/block-hoist")),T=i(e("../internal-plugins/shadow-functions")),P=/^#!.*/,B=[[F.default],[T.default]],O={enter:function(e,t){var r=e.node.loc;r&&(t.loc=r,e.stop())}},N=function(r){function n(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments[1];(0,u.default)(this,n);var i=(0,l.default)(this,r.call(this));return i.pipeline=t,i.log=new A.default(i,e.filename||"unknown"),i.opts=i.initOptions(e),i.parserOpts={sourceType:i.opts.sourceType,sourceFileName:i.opts.filename,plugins:[]},i.pluginVisitors=[],i.pluginPasses=[],i.buildPluginsForOptions(i.opts),i.opts.passPerPreset&&(i.perPresetOpts=[],i.opts.presets.forEach(function(e){var t=(0,o.default)((0,a.default)(i.opts),e);i.perPresetOpts.push(t),i.buildPluginsForOptions(t)})),i.metadata={usedHelpers:[],marked:[],modules:{imports:[],exports:{exported:[],specifiers:[]}}},i.dynamicImportTypes={},i.dynamicImportIds={},i.dynamicImports=[],i.declarations={},i.usedHelpers={},i.path=null,i.ast={},i.code="",i.shebang="",i.hub=new y.Hub(i),i}return(0,c.default)(n,r),n.prototype.getMetadata=function(){var e=!1,t=this.ast.program.body,r=Array.isArray(t),n=0;for(t=r?t:(0,s.default)(t);;){var i;if(r){if(n>=t.length)break;i=t[n++]}else{if((n=t.next()).done)break;i=n.value}var a=i;if(w.isModuleDeclaration(a)){e=!0;break}}e&&this.path.traverse(h,this)},n.prototype.initOptions=function(e){(e=new d.default(this.log,this.pipeline).init(e)).inputSourceMap&&(e.sourceMaps=!0),e.moduleId&&(e.moduleIds=!0),e.basename=_.default.basename(e.filename,_.default.extname(e.filename)),e.ignore=C.arrayify(e.ignore,C.regexify),e.only&&(e.only=C.arrayify(e.only,C.regexify)),(0,E.default)(e,{moduleRoot:e.sourceRoot}),(0,E.default)(e,{sourceRoot:e.moduleRoot}),(0,E.default)(e,{filenameRelative:e.filename});var t=_.default.basename(e.filenameRelative);return(0,E.default)(e,{sourceFileName:t,sourceMapTarget:t}),e},n.prototype.buildPluginsForOptions=function(e){if(Array.isArray(e.plugins)){var t=[],r=[],n=e.plugins.concat(B),i=Array.isArray(n),a=0;for(n=i?n:(0,s.default)(n);;){var o;if(i){if(a>=n.length)break;o=n[a++]}else{if((a=n.next()).done)break;o=a.value}var u=o,l=u[0],c=u[1];t.push(l.visitor),r.push(new m.default(this,l,c)),l.manipulateOptions&&l.manipulateOptions(e,this.parserOpts,this)}this.pluginVisitors.push(t),this.pluginPasses.push(r)}},n.prototype.getModuleName=function(){var e=this.opts;if(!e.moduleIds)return null;if(null!=e.moduleId&&!e.getModuleId)return e.moduleId;var t=e.filenameRelative,r="";if(null!=e.moduleRoot&&(r=e.moduleRoot+"/"),!e.filenameRelative)return r+e.filename.replace(/^\//,"");if(null!=e.sourceRoot){var n=new RegExp("^"+e.sourceRoot+"/?");t=t.replace(n,"")}return t=t.replace(/\.(\w*?)$/,""),r+=t,r=r.replace(/\\/g,"/"),e.getModuleId?e.getModuleId(r)||r:r},n.prototype.resolveModuleSource=function(e){var t=this.opts.resolveModuleSource;return t&&(e=t(e,this.opts.filename)),e},n.prototype.addImport=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t,n=e+":"+t,i=this.dynamicImportIds[n];if(!i){e=this.resolveModuleSource(e),i=this.dynamicImportIds[n]=this.scope.generateUidIdentifier(r);var s=[];"*"===t?s.push(w.importNamespaceSpecifier(i)):"default"===t?s.push(w.importDefaultSpecifier(i)):s.push(w.importSpecifier(i,w.identifier(t)));var a=w.importDeclaration(s,w.stringLiteral(e));a._blockHoist=3,this.path.unshiftContainer("body",a)}return i},n.prototype.addHelper=function(e){var t=this.declarations[e];if(t)return t;this.usedHelpers[e]||(this.metadata.usedHelpers.push(e),this.usedHelpers[e]=!0);var r=this.get("helperGenerator"),n=this.get("helpersNamespace");if(r){var i=r(e);if(i)return i}else if(n)return w.memberExpression(n,w.identifier(e));var s=(0,p.default)(e),a=this.declarations[e]=this.scope.generateUidIdentifier(e);return w.isFunctionExpression(s)&&!s.id?(s.body._compact=!0,s._generated=!0,s.id=a,s.type="FunctionDeclaration",this.path.unshiftContainer("body",s)):(s._compact=!0,this.scope.push({id:a,init:s,unique:!0})),a},n.prototype.addTemplateObject=function(e,t,r){var n=r.elements.map(function(e){return e.value}),i=e+"_"+r.elements.length+"_"+n.join(","),s=this.declarations[i];if(s)return s;var a=this.declarations[i]=this.scope.generateUidIdentifier("templateObject"),o=this.addHelper(e),u=w.callExpression(o,[t,r]);return u._compact=!0,this.scope.push({id:a,init:u,_blockHoist:1.9}),a},n.prototype.buildCodeFrameError=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:SyntaxError,n=e&&(e.loc||e._loc),i=new r(t);return n?i.loc=n.start:((0,g.default)(e,O,this.scope,i),i.message+=" (This is an error on an internal node. Probably an internal error",i.loc&&(i.message+=". Location has been estimated."),i.message+=")"),i},n.prototype.mergeSourceMap=function(e){var t=this.opts.inputSourceMap;if(t){var r=new b.default.SourceMapConsumer(t),n=new b.default.SourceMapConsumer(e),i=new b.default.SourceMapGenerator({file:r.file,sourceRoot:r.sourceRoot}),s=n.sources[0];r.eachMapping(function(e){var t=n.generatedPositionFor({line:e.generatedLine,column:e.generatedColumn,source:s});null!=t.column&&i.addMapping({source:e.source,original:null==e.source?null:{line:e.originalLine,column:e.originalColumn},generated:t})});var a=i.toJSON();return t.mappings=a.mappings,t}return e},n.prototype.parse=function(r){var n=S.parse,i=this.opts.parserOpts;if(i&&(i=(0,o.default)({},this.parserOpts,i)).parser){if("string"==typeof i.parser){var s=_.default.dirname(this.opts.filename)||t.cwd(),a=(0,k.default)(i.parser,s);if(!a)throw new Error("Couldn't find parser "+i.parser+' with "parse" method relative to directory '+s);n=e(a).parse}else n=i.parser;i.parser={parse:function(e){return(0,S.parse)(e,i)}}}this.log.debug("Parse start");var u=n(r,i||this.parserOpts);return this.log.debug("Parse stop"),u},n.prototype._addAst=function(e){this.path=y.NodePath.get({hub:this.hub,parentPath:null,parent:e,container:e,key:"program"}).setContext(),this.scope=this.path.scope,this.ast=e,this.getMetadata()},n.prototype.addAst=function(e){this.log.debug("Start set AST"),this._addAst(e),this.log.debug("End set AST")},n.prototype.transform=function(){for(var e=0;e=r.length)break;a=r[i++]}else{if((i=r.next()).done)break;a=i.value}var o=a,u=o.plugin[e];u&&u.call(o,this)}},n.prototype.parseInputSourceMap=function(e){var t=this.opts;if(!1!==t.inputSourceMap){var r=f.default.fromSource(e);r&&(t.inputSourceMap=r.toObject(),e=f.default.removeComments(e))}return e},n.prototype.parseShebang=function(){var e=P.exec(this.code);e&&(this.shebang=e[0],this.code=this.code.replace(P,""))},n.prototype.makeResult=function(e){var t=e.code,r=e.map,n=e.ast,i=e.ignored,s={metadata:null,options:this.opts,ignored:!!i,code:null,ast:null,map:r||null};return this.opts.code&&(s.code=t),this.opts.ast&&(s.ast=n),this.opts.metadata&&(s.metadata=this.metadata),s},n.prototype.generate=function(){var r=this.opts,n=this.ast,i={ast:n};if(!r.code)return this.makeResult(i);var s=v.default;if(r.generatorOpts.generator&&"string"==typeof(s=r.generatorOpts.generator)){var a=_.default.dirname(this.opts.filename)||t.cwd(),u=(0,k.default)(s,a);if(!u)throw new Error("Couldn't find generator "+s+' with "print" method relative to directory '+a);s=e(u).print}this.log.debug("Generation start");var l=s(n,r.generatorOpts?(0,o.default)(r,r.generatorOpts):r,this.code);return i.code=l.code,i.map=l.map,this.log.debug("Generation end"),this.shebang&&(i.code=this.shebang+"\n"+i.code),i.map&&(i.map=this.mergeSourceMap(i.map)),"inline"!==r.sourceMaps&&"both"!==r.sourceMaps||(i.code+="\n"+f.default.fromObject(i.map).toComment()),"inline"===r.sourceMaps&&(i.map=null),this.makeResult(i)},n}(D.default);r.default=N,r.File=N}).call(this,e("_process"))},{"../../helpers/resolve":40,"../../store":41,"../../util":57,"../internal-plugins/block-hoist":52,"../internal-plugins/shadow-functions":53,"../plugin-pass":55,"./logger":44,"./metadata":45,"./options/option-manager":49,_process:550,"babel-code-frame":21,"babel-generator":85,"babel-helpers":109,"babel-runtime/core-js/get-iterator":120,"babel-runtime/core-js/object/assign":124,"babel-runtime/core-js/object/create":125,"babel-runtime/helpers/classCallCheck":134,"babel-runtime/helpers/inherits":135,"babel-runtime/helpers/possibleConstructorReturn":137,"babel-traverse":143,"babel-types":180,babylon:188,"convert-source-map":58,"lodash/defaults":495,path:546,"source-map":72}],44:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}r.__esModule=!0;var i=n(e("babel-runtime/helpers/classCallCheck")),s=n(e("debug/node")),a=(0,s.default)("babel:verbose"),o=(0,s.default)("babel"),u=[],l=function(){function e(t,r){(0,i.default)(this,e),this.filename=r,this.file=t}return e.prototype._buildMessage=function(e){var t="[BABEL] "+this.filename;return e&&(t+=": "+e),t},e.prototype.warn=function(e){console.warn(this._buildMessage(e))},e.prototype.error=function(e){throw new(arguments.length>1&&void 0!==arguments[1]?arguments[1]:Error)(this._buildMessage(e))},e.prototype.deprecate=function(e){this.file.opts&&this.file.opts.suppressDeprecationMessages||(e=this._buildMessage(e),u.indexOf(e)>=0||(u.push(e),console.error(e)))},e.prototype.verbose=function(e){a.enabled&&a(this._buildMessage(e))},e.prototype.debug=function(e){o.enabled&&o(this._buildMessage(e))},e.prototype.deopt=function(e,t){this.debug(t)},e}();r.default=l,t.exports=r.default},{"babel-runtime/helpers/classCallCheck":134,"debug/node":59}],45:[function(e,t,r){"use strict";r.__esModule=!0,r.ImportDeclaration=r.ModuleDeclaration=void 0;var n=function(e){return e&&e.__esModule?e:{default:e}}(e("babel-runtime/core-js/get-iterator"));r.ExportDeclaration=function(e,t){var r=e.node,s=r.source?r.source.value:null,a=t.metadata.modules.exports,o=e.get("declaration");if(o.isStatement()){var u=o.getBindingIdentifiers();for(var l in u)a.exported.push(l),a.specifiers.push({kind:"local",local:l,exported:e.isExportDefaultDeclaration()?"default":l})}if(e.isExportNamedDeclaration()&&r.specifiers){var c=r.specifiers,p=Array.isArray(c),h=0;for(c=p?c:(0,n.default)(c);;){var f;if(p){if(h>=c.length)break;f=c[h++]}else{if((h=c.next()).done)break;f=h.value}var d=f,m=d.exported.name;a.exported.push(m),i.isExportDefaultSpecifier(d)&&a.specifiers.push({kind:"external",local:m,exported:m,source:s}),i.isExportNamespaceSpecifier(d)&&a.specifiers.push({kind:"external-namespace",exported:m,source:s});var y=d.local;y&&(s&&a.specifiers.push({kind:"external",local:y.name,exported:m,source:s}),s||a.specifiers.push({kind:"local",local:y.name,exported:m}))}}e.isExportAllDeclaration()&&a.specifiers.push({kind:"external-all",source:s})},r.Scope=function(e){e.skip()};var i=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(e("babel-types"));r.ModuleDeclaration={enter:function(e,t){var r=e.node;r.source&&(r.source.value=t.resolveModuleSource(r.source.value))}},r.ImportDeclaration={exit:function(e,t){var r=e.node,i=[],s=[];t.metadata.modules.imports.push({source:r.source.value,imported:s,specifiers:i});var a=e.get("specifiers"),o=Array.isArray(a),u=0;for(a=o?a:(0,n.default)(a);;){var l;if(o){if(u>=a.length)break;l=a[u++]}else{if((u=a.next()).done)break;l=u.value}var c=l,p=c.node.local.name;if(c.isImportDefaultSpecifier()&&(s.push("default"),i.push({kind:"named",imported:"default",local:p})),c.isImportSpecifier()){var h=c.node.imported.name;s.push(h),i.push({kind:"named",imported:h,local:p})}c.isImportNamespaceSpecifier()&&(s.push("*"),i.push({kind:"namespace",local:p}))}}}},{"babel-runtime/core-js/get-iterator":120,"babel-types":180}],46:[function(e,t,r){(function(n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function s(e){var t=f[e];return null==t?f[e]=h.default.existsSync(e):t}r.__esModule=!0;var a=i(e("babel-runtime/core-js/object/assign")),o=i(e("babel-runtime/helpers/classCallCheck"));r.default=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments[1],r=e.filename,n=new m(t);return!1!==e.babelrc&&n.findConfigs(r),n.mergeConfig({options:e,alias:"base",dirname:r&&p.default.dirname(r)}),n.configs};var u=i(e("../../../helpers/resolve")),l=i(e("json5")),c=i(e("path-is-absolute")),p=i(e("path")),h=i(e("fs")),f={},d={},m=function(){function e(t){(0,o.default)(this,e),this.resolvedConfigs=[],this.configs=[],this.log=t}return e.prototype.findConfigs=function(e){if(e){(0,c.default)(e)||(e=p.default.join(n.cwd(),e));for(var t=!1,r=!1;e!==(e=p.default.dirname(e));){if(!t){var i=p.default.join(e,".babelrc");s(i)&&(this.addConfig(i),t=!0);var a=p.default.join(e,"package.json");!t&&s(a)&&(t=this.addConfig(a,"babel",JSON))}if(!r){var o=p.default.join(e,".babelignore");s(o)&&(this.addIgnoreConfig(o),r=!0)}if(r&&t)return}}},e.prototype.addIgnoreConfig=function(e){var t=h.default.readFileSync(e,"utf8").split("\n");(t=t.map(function(e){return e.replace(/#(.*?)$/,"").trim()}).filter(function(e){return!!e})).length&&this.mergeConfig({options:{ignore:t},alias:e,dirname:p.default.dirname(e)})},e.prototype.addConfig=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:l.default;if(this.resolvedConfigs.indexOf(e)>=0)return!1;this.resolvedConfigs.push(e);var n=h.default.readFileSync(e,"utf8"),i=void 0;try{i=d[n]=d[n]||r.parse(n),t&&(i=i[t])}catch(t){throw t.message=e+": Error while parsing JSON - "+t.message,t}return this.mergeConfig({options:i,alias:e,dirname:p.default.dirname(e)}),!!i},e.prototype.mergeConfig=function(e){var t=e.options,r=e.alias,i=e.loc,s=e.dirname;if(!t)return!1;if(t=(0,a.default)({},t),s=s||n.cwd(),i=i||r,t.extends){var o=(0,u.default)(t.extends,s);o?this.addConfig(o):this.log&&this.log.error("Couldn't resolve extends clause of "+t.extends+" in "+r),delete t.extends}this.configs.push({options:t,alias:r,loc:i,dirname:s});var l=void 0,c=n.env.BABEL_ENV||n.env.NODE_ENV||"development";t.env&&(l=t.env[c],delete t.env),this.mergeConfig({options:l,alias:r+".env."+c,dirname:s})},e}();t.exports=r.default}).call(this,e("_process"))},{"../../../helpers/resolve":40,_process:550,"babel-runtime/core-js/object/assign":124,"babel-runtime/helpers/classCallCheck":134,fs:193,json5:324,path:546,"path-is-absolute":547}],47:[function(e,t,r){"use strict";t.exports={filename:{type:"filename",description:"filename to use when reading from stdin - this will be used in source-maps, errors etc",default:"unknown",shorthand:"f"},filenameRelative:{hidden:!0,type:"string"},inputSourceMap:{hidden:!0},env:{hidden:!0,default:{}},mode:{description:"",hidden:!0},retainLines:{type:"boolean",default:!1,description:"retain line numbers - will result in really ugly code"},highlightCode:{description:"enable/disable ANSI syntax highlighting of code frames (on by default)",type:"boolean",default:!0},suppressDeprecationMessages:{type:"boolean",default:!1,hidden:!0},presets:{type:"list",description:"",default:[]},plugins:{type:"list",default:[],description:""},ignore:{type:"list",description:"list of glob paths to **not** compile",default:[]},only:{type:"list",description:"list of glob paths to **only** compile"},code:{hidden:!0,default:!0,type:"boolean"},metadata:{hidden:!0,default:!0,type:"boolean"},ast:{hidden:!0,default:!0,type:"boolean"},extends:{type:"string",hidden:!0},comments:{type:"boolean",default:!0,description:"write comments to generated output (true by default)"},shouldPrintComment:{hidden:!0,description:"optional callback to control whether a comment should be inserted, when this is used the comments option is ignored"},wrapPluginVisitorMethod:{hidden:!0,description:"optional callback to wrap all visitor methods"},compact:{type:"booleanString",default:"auto",description:"do not include superfluous whitespace characters and line terminators [true|false|auto]"},minified:{type:"boolean",default:!1,description:"save as much bytes when printing [true|false]"},sourceMap:{alias:"sourceMaps",hidden:!0},sourceMaps:{type:"booleanString",description:"[true|false|inline]",default:!1,shorthand:"s"},sourceMapTarget:{type:"string",description:"set `file` on returned source map"},sourceFileName:{type:"string",description:"set `sources[0]` on returned source map"},sourceRoot:{type:"filename",description:"the root from which all sources are relative"},babelrc:{description:"Whether or not to look up .babelrc and .babelignore files",type:"boolean",default:!0},sourceType:{description:"",default:"module"},auxiliaryCommentBefore:{type:"string",description:"print a comment before any injected non-user code"},auxiliaryCommentAfter:{type:"string",description:"print a comment after any injected non-user code"},resolveModuleSource:{hidden:!0},getModuleId:{hidden:!0},moduleRoot:{type:"filename",description:"optional prefix for the AMD module formatter that will be prepend to the filename on module definitions"},moduleIds:{type:"boolean",default:!1,shorthand:"M",description:"insert an explicit id for modules"},moduleId:{description:"specify a custom name for module ids",type:"string"},passPerPreset:{description:"Whether to spawn a traversal pass per a preset. By default all presets are merged.",type:"boolean",default:!1,hidden:!0},parserOpts:{description:"Options to pass into the parser, or to change parsers (parserOpts.parser)",default:!1},generatorOpts:{description:"Options to pass into the generator, or to change generators (generatorOpts.generator)",default:!1}}},{}],48:[function(e,t,r){"use strict";r.__esModule=!0,r.config=void 0,r.normaliseOptions=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};for(var t in e){var r=e[t];if(null!=r){var s=i.default[t];if(s&&s.alias&&(s=i.default[s.alias]),s){var a=n[s.type];a&&(r=a(r)),e[t]=r}}}return e};var n=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(e("./parsers")),i=function(e){return e&&e.__esModule?e:{default:e}}(e("./config"));r.config=i.default},{"./config":47,"./parsers":50}],49:[function(e,t,r){(function(n){"use strict";function i(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}function s(e){return e&&e.__esModule?e:{default:e}}r.__esModule=!0;var a=s(e("babel-runtime/helpers/objectWithoutProperties")),o=s(e("babel-runtime/core-js/json/stringify")),u=s(e("babel-runtime/core-js/object/assign")),l=s(e("babel-runtime/core-js/get-iterator")),c=s(e("babel-runtime/helpers/typeof")),p=s(e("babel-runtime/helpers/classCallCheck")),h=i(e("../../../api/node")),f=s(e("../../plugin")),d=i(e("babel-messages")),m=e("./index"),y=s(e("../../../helpers/resolve-plugin")),g=s(e("../../../helpers/resolve-preset")),b=s(e("lodash/cloneDeepWith")),v=s(e("lodash/clone")),x=s(e("../../../helpers/merge")),E=s(e("./config")),A=s(e("./removed")),D=s(e("./build-config-chain")),S=s(e("path")),C=function(){function t(e){(0,p.default)(this,t),this.resolvedConfigs=[],this.options=t.createBareOptions(),this.log=e}return t.memoisePluginContainer=function(e,r,n,i){var s=t.memoisedPlugins,a=Array.isArray(s),o=0;for(s=a?s:(0,l.default)(s);;){var u;if(a){if(o>=s.length)break;u=s[o++]}else{if((o=s.next()).done)break;u=o.value}var p=u;if(p.container===e)return p.plugin}var m=void 0;if("object"===(void 0===(m="function"==typeof e?e(h):e)?"undefined":(0,c.default)(m))){var y=new f.default(m,i);return t.memoisedPlugins.push({container:e,plugin:y}),y}throw new TypeError(d.get("pluginNotObject",r,n,void 0===m?"undefined":(0,c.default)(m))+r+n)},t.createBareOptions=function(){var e={};for(var t in E.default){var r=E.default[t];e[t]=(0,v.default)(r.default)}return e},t.normalisePlugin=function(e,r,n,i){if(!((e=e.__esModule?e.default:e)instanceof f.default)){if("function"!=typeof e&&"object"!==(void 0===e?"undefined":(0,c.default)(e)))throw new TypeError(d.get("pluginNotFunction",r,n,void 0===e?"undefined":(0,c.default)(e)));e=t.memoisePluginContainer(e,r,n,i)}return e.init(r,n),e},t.normalisePlugins=function(r,n,i){return i.map(function(i,s){var a=void 0,o=void 0;if(!i)throw new TypeError("Falsy value found in plugins");Array.isArray(i)?(a=i[0],o=i[1]):a=i;var u="string"==typeof a?a:r+"$"+s;if("string"==typeof a){var l=(0,y.default)(a,n);if(!l)throw new ReferenceError(d.get("pluginUnknown",a,r,s,n));a=e(l)}return a=t.normalisePlugin(a,r,s,u),[a,o]})},t.prototype.mergeOptions=function(e){var r=this,i=e.options,s=e.extending,a=e.alias,o=e.loc,l=e.dirname;if(a=a||"foreign",i){("object"!==(void 0===i?"undefined":(0,c.default)(i))||Array.isArray(i))&&this.log.error("Invalid options type for "+a,TypeError);var p=(0,b.default)(i,function(e){if(e instanceof f.default)return e});l=l||n.cwd(),o=o||a;for(var h in p){if(!E.default[h]&&this.log)if(A.default[h])this.log.error("Using removed Babel 5 option: "+a+"."+h+" - "+A.default[h].message,ReferenceError);else{var d="Unknown option: "+a+"."+h+". Check out http://babeljs.io/docs/usage/options/ for more information about options.";this.log.error(d+"\n\nA common cause of this error is the presence of a configuration options object without the corresponding preset name. Example:\n\nInvalid:\n `{ presets: [{option: value}] }`\nValid:\n `{ presets: [['presetName', {option: value}]] }`\n\nFor more detailed information on preset configuration, please see http://babeljs.io/docs/plugins/#pluginpresets-options.",ReferenceError)}}(0,m.normaliseOptions)(p),p.plugins&&(p.plugins=t.normalisePlugins(o,l,p.plugins)),p.presets&&(p.passPerPreset?p.presets=this.resolvePresets(p.presets,l,function(e,t){r.mergeOptions({options:e,extending:e,alias:t,loc:t,dirname:l})}):(this.mergePresets(p.presets,l),delete p.presets)),i===s?(0,u.default)(s,p):(0,x.default)(s||this.options,p)}},t.prototype.mergePresets=function(e,t){var r=this;this.resolvePresets(e,t,function(e,t){r.mergeOptions({options:e,alias:t,loc:t,dirname:S.default.dirname(t||"")})})},t.prototype.resolvePresets=function(t,r,n){return t.map(function(t){var i=void 0;if(Array.isArray(t)){if(t.length>2)throw new Error("Unexpected extra options "+(0,o.default)(t.slice(2))+" passed to preset.");var s=t;t=s[0],i=s[1]}var u=void 0;try{if("string"==typeof t){if(!(u=(0,g.default)(t,r)))throw new Error("Couldn't find preset "+(0,o.default)(t)+" relative to directory "+(0,o.default)(r));t=e(u)}if("object"===(void 0===t?"undefined":(0,c.default)(t))&&t.__esModule)if(t.default)t=t.default;else{var l=t;l.__esModule;t=(0,a.default)(l,["__esModule"])}if("object"===(void 0===t?"undefined":(0,c.default)(t))&&t.buildPreset&&(t=t.buildPreset),"function"!=typeof t&&void 0!==i)throw new Error("Options "+(0,o.default)(i)+" passed to "+(u||"a preset")+" which does not accept options.");if("function"==typeof t&&(t=t(h,i,{dirname:r})),"object"!==(void 0===t?"undefined":(0,c.default)(t)))throw new Error("Unsupported preset format: "+t+".");n&&n(t,u)}catch(e){throw u&&(e.message+=" (While processing preset: "+(0,o.default)(u)+")"),e}return t})},t.prototype.normaliseOptions=function(){var e=this.options;for(var t in E.default){var r=E.default[t],n=e[t];!n&&r.optional||(r.alias?e[r.alias]=e[r.alias]||n:e[t]=n)}},t.prototype.init=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=(0,D.default)(e,this.log),r=Array.isArray(t),n=0;for(t=r?t:(0,l.default)(t);;){var i;if(r){if(n>=t.length)break;i=t[n++]}else{if((n=t.next()).done)break;i=n.value}var s=i;this.mergeOptions(s)}return this.normaliseOptions(e),this.options},t}();r.default=C,C.memoisedPlugins=[],t.exports=r.default}).call(this,e("_process"))},{"../../../api/node":32,"../../../helpers/merge":35,"../../../helpers/resolve-plugin":38,"../../../helpers/resolve-preset":39,"../../plugin":56,"./build-config-chain":46,"./config":47,"./index":48,"./removed":51,_process:550,"babel-messages":110,"babel-runtime/core-js/get-iterator":120,"babel-runtime/core-js/json/stringify":121,"babel-runtime/core-js/object/assign":124,"babel-runtime/helpers/classCallCheck":134,"babel-runtime/helpers/objectWithoutProperties":136,"babel-runtime/helpers/typeof":138,"lodash/clone":491,"lodash/cloneDeepWith":493,path:546}],50:[function(e,t,r){"use strict";r.__esModule=!0,r.filename=void 0,r.boolean=function(e){return!!e},r.booleanString=function(e){return i.booleanify(e)},r.list=function(e){return i.list(e)};var n=function(e){return e&&e.__esModule?e:{default:e}}(e("slash")),i=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(e("../../../util"));r.filename=n.default},{"../../../util":57,slash:603}],51:[function(e,t,r){"use strict";t.exports={auxiliaryComment:{message:"Use `auxiliaryCommentBefore` or `auxiliaryCommentAfter`"},blacklist:{message:"Put the specific transforms you want in the `plugins` option"},breakConfig:{message:"This is not a necessary option in Babel 6"},experimental:{message:"Put the specific transforms you want in the `plugins` option"},externalHelpers:{message:"Use the `external-helpers` plugin instead. Check out http://babeljs.io/docs/plugins/external-helpers/"},extra:{message:""},jsxPragma:{message:"use the `pragma` option in the `react-jsx` plugin . Check out http://babeljs.io/docs/plugins/transform-react-jsx/"},loose:{message:"Specify the `loose` option for the relevant plugin you are using or use a preset that sets the option."},metadataUsedHelpers:{message:"Not required anymore as this is enabled by default"},modules:{message:"Use the corresponding module transform plugin in the `plugins` option. Check out http://babeljs.io/docs/plugins/#modules"},nonStandard:{message:"Use the `react-jsx` and `flow-strip-types` plugins to support JSX and Flow. Also check out the react preset http://babeljs.io/docs/plugins/preset-react/"},optional:{message:"Put the specific transforms you want in the `plugins` option"},sourceMapName:{message:"Use the `sourceMapTarget` option"},stage:{message:"Check out the corresponding stage-x presets http://babeljs.io/docs/plugins/#presets"},whitelist:{message:"Put the specific transforms you want in the `plugins` option"}}},{}],52:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}r.__esModule=!0;var i=n(e("../plugin")),s=n(e("lodash/sortBy"));r.default=new i.default({name:"internal.blockHoist",visitor:{Block:{exit:function(e){for(var t=e.node,r=!1,n=0;n1&&void 0!==arguments[1]?arguments[1]:{};return t.code=!1,t.mode="lint",this.transform(e,t)},e.prototype.pretransform=function(e,t){var r=new o.default(t,this);return r.wrap(e,function(){return r.addCode(e),r.parseCode(e),r})},e.prototype.transform=function(e,t){var r=new o.default(t,this);return r.wrap(e,function(){return r.addCode(e),r.parseCode(e),r.transform()})},e.prototype.analyse=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments[2];return t.code=!1,r&&(t.plugins=t.plugins||[],t.plugins.push(new a.default({visitor:r}))),this.transform(e,t).metadata},e.prototype.transformFromAst=function(e,t,r){e=(0,s.default)(e);var n=new o.default(r,this);return n.wrap(t,function(){return n.addCode(t),n.addAst(e),n.transform()})},e}();r.default=u,t.exports=r.default},{"../helpers/normalize-ast":36,"./file":43,"./plugin":56,"babel-runtime/helpers/classCallCheck":134}],55:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}r.__esModule=!0;var i=n(e("babel-runtime/helpers/classCallCheck")),s=n(e("babel-runtime/helpers/possibleConstructorReturn")),a=n(e("babel-runtime/helpers/inherits")),o=n(e("../store")),u=(n(e("./file")),function(e){function t(r,n){var a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};(0,i.default)(this,t);var o=(0,s.default)(this,e.call(this));return o.plugin=n,o.key=n.key,o.file=r,o.opts=a,o}return(0,a.default)(t,e),t.prototype.addHelper=function(){var e;return(e=this.file).addHelper.apply(e,arguments)},t.prototype.addImport=function(){var e;return(e=this.file).addImport.apply(e,arguments)},t.prototype.getModuleName=function(){var e;return(e=this.file).getModuleName.apply(e,arguments)},t.prototype.buildCodeFrameError=function(){var e;return(e=this.file).buildCodeFrameError.apply(e,arguments)},t}(o.default));r.default=u,t.exports=r.default},{"../store":41,"./file":43,"babel-runtime/helpers/classCallCheck":134,"babel-runtime/helpers/inherits":135,"babel-runtime/helpers/possibleConstructorReturn":137}],56:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}r.__esModule=!0;var i=n(e("babel-runtime/core-js/get-iterator")),s=n(e("babel-runtime/helpers/classCallCheck")),a=n(e("babel-runtime/helpers/possibleConstructorReturn")),o=n(e("babel-runtime/helpers/inherits")),u=n(e("./file/options/option-manager")),l=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(e("babel-messages")),c=n(e("../store")),p=n(e("babel-traverse")),h=n(e("lodash/assign")),f=n(e("lodash/clone")),d=["enter","exit"],m=function(e){function t(r,n){(0,s.default)(this,t);var i=(0,a.default)(this,e.call(this));return i.initialized=!1,i.raw=(0,h.default)({},r),i.key=i.take("name")||n,i.manipulateOptions=i.take("manipulateOptions"),i.post=i.take("post"),i.pre=i.take("pre"),i.visitor=i.normaliseVisitor((0,f.default)(i.take("visitor"))||{}),i}return(0,o.default)(t,e),t.prototype.take=function(e){var t=this.raw[e];return delete this.raw[e],t},t.prototype.chain=function(e,t){if(!e[t])return this[t];if(!this[t])return e[t];var r=[e[t],this[t]];return function(){for(var e=void 0,t=arguments.length,n=Array(t),s=0;s=a.length)break;l=a[u++]}else{if((u=a.next()).done)break;l=u.value}if(l){var c=l.apply(this,n);null!=c&&(e=c)}}return e}},t.prototype.maybeInherit=function(e){var t=this.take("inherits");t&&(t=u.default.normalisePlugin(t,e,"inherits"),this.manipulateOptions=this.chain(t,"manipulateOptions"),this.post=this.chain(t,"post"),this.pre=this.chain(t,"pre"),this.visitor=p.default.visitors.merge([t.visitor,this.visitor]))},t.prototype.init=function(e,t){if(!this.initialized){this.initialized=!0,this.maybeInherit(e);for(var r in this.raw)throw new Error(l.get("pluginInvalidProperty",e,t,r))}},t.prototype.normaliseVisitor=function(e){var t=d,r=Array.isArray(t),n=0;for(t=r?t:(0,i.default)(t);;){var s;if(r){if(n>=t.length)break;s=t[n++]}else{if((n=t.next()).done)break;s=n.value}if(e[s])throw new Error("Plugins aren't allowed to specify catch-all enter/exit handlers. Please target individual nodes.")}return p.default.explode(e),e},t}(c.default);r.default=m,t.exports=r.default},{"../store":41,"./file/options/option-manager":49,"babel-messages":110,"babel-runtime/core-js/get-iterator":120,"babel-runtime/helpers/classCallCheck":134,"babel-runtime/helpers/inherits":135,"babel-runtime/helpers/possibleConstructorReturn":137,"babel-traverse":143,"lodash/assign":488,"lodash/clone":491}],57:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){var r=t||i.EXTENSIONS,n=m.default.extname(e);return(0,f.default)(r,n)}function s(e){return e?Array.isArray(e)?e:"string"==typeof e?e.split(","):[e]:[]}function a(e,t){return e?"boolean"==typeof e?a([e],t):"string"==typeof e?a(s(e),t):Array.isArray(e)?(t&&(e=e.map(t)),e):[e]:[]}function o(e,t){return"function"==typeof e?e(t):e.test(t)}r.__esModule=!0,r.inspect=r.inherits=void 0;var u=n(e("babel-runtime/core-js/get-iterator")),l=e("util");Object.defineProperty(r,"inherits",{enumerable:!0,get:function(){return l.inherits}}),Object.defineProperty(r,"inspect",{enumerable:!0,get:function(){return l.inspect}}),r.canCompile=i,r.list=s,r.regexify=function(e){if(!e)return new RegExp(/.^/);if(Array.isArray(e)&&(e=new RegExp(e.map(c.default).join("|"),"i")),"string"==typeof e){e=(0,y.default)(e),((0,p.default)(e,"./")||(0,p.default)(e,"*/"))&&(e=e.slice(2)),(0,p.default)(e,"**/")&&(e=e.slice(3));var t=h.default.makeRe(e,{nocase:!0});return new RegExp(t.source.slice(1,-1),"i")}if((0,d.default)(e))return e;throw new TypeError("illegal type for regexify")},r.arrayify=a,r.booleanify=function(e){return"true"===e||1==e||!("false"===e||0==e||!e)&&e},r.shouldIgnore=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=arguments[2];if(e=e.replace(/\\/g,"/"),r){var n=r,i=Array.isArray(n),s=0;for(n=i?n:(0,u.default)(n);;){var a;if(i){if(s>=n.length)break;a=n[s++]}else{if((s=n.next()).done)break;a=s.value}if(o(a,e))return!1}return!0}if(t.length){var l=t,c=Array.isArray(l),p=0;for(l=c?l:(0,u.default)(l);;){var h;if(c){if(p>=l.length)break;h=l[p++]}else{if((p=l.next()).done)break;h=p.value}if(o(h,e))return!0}}return!1};var c=n(e("lodash/escapeRegExp")),p=n(e("lodash/startsWith")),h=n(e("minimatch")),f=n(e("lodash/includes")),d=n(e("lodash/isRegExp")),m=n(e("path")),y=n(e("slash"));i.EXTENSIONS=[".js",".jsx",".es6",".es"]},{"babel-runtime/core-js/get-iterator":120,"lodash/escapeRegExp":497,"lodash/includes":507,"lodash/isRegExp":519,"lodash/startsWith":532,minimatch:542,path:546,slash:603,util:613}],58:[function(e,t,r){(function(t){"use strict";function n(e,n){(n=n||{}).isFileComment&&(e=function(e,t){var n=r.mapFileCommentRegex.exec(e),a=n[1]||n[2],o=s.resolve(t,a);try{return i.readFileSync(o,"utf8")}catch(e){throw new Error("An error occurred while trying to read the map file at "+o+"\n"+e)}}(e,n.commentFileDir)),n.hasComment&&(e=function(e){return e.split(",").pop()}(e)),n.isEncoded&&(e=function(e){return new t(e,"base64").toString()}(e)),(n.isJSON||n.isEncoded)&&(e=JSON.parse(e)),this.sourcemap=e}var i=e("fs"),s=e("path");Object.defineProperty(r,"commentRegex",{get:function(){return/^\s*\/(?:\/|\*)[@#]\s+sourceMappingURL=data:(?:application|text)\/json;(?:charset[:=]\S+?;)?base64,(?:.*)$/gm}}),Object.defineProperty(r,"mapFileCommentRegex",{get:function(){return/(?:\/\/[@#][ \t]+sourceMappingURL=([^\s'"`]+?)[ \t]*$)|(?:\/\*[@#][ \t]+sourceMappingURL=([^\*]+?)[ \t]*(?:\*\/){1}[ \t]*$)/gm}}),n.prototype.toJSON=function(e){return JSON.stringify(this.sourcemap,null,e)},n.prototype.toBase64=function(){var e=this.toJSON();return new t(e).toString("base64")},n.prototype.toComment=function(e){var t="sourceMappingURL=data:application/json;charset=utf-8;base64,"+this.toBase64();return e&&e.multiline?"/*# "+t+" */":"//# "+t},n.prototype.toObject=function(){return JSON.parse(this.toJSON())},n.prototype.addProperty=function(e,t){if(this.sourcemap.hasOwnProperty(e))throw new Error('property "'+e+'" already exists on the sourcemap, use set property instead');return this.setProperty(e,t)},n.prototype.setProperty=function(e,t){return this.sourcemap[e]=t,this},n.prototype.getProperty=function(e){return this.sourcemap[e]},r.fromObject=function(e){return new n(e)},r.fromJSON=function(e){return new n(e,{isJSON:!0})},r.fromBase64=function(e){return new n(e,{isEncoded:!0})},r.fromComment=function(e){return e=e.replace(/^\/\*/g,"//").replace(/\*\/$/g,""),new n(e,{isEncoded:!0,hasComment:!0})},r.fromMapFileComment=function(e,t){return new n(e,{commentFileDir:t,isFileComment:!0,isJSON:!0})},r.fromSource=function(e){var t=e.match(r.commentRegex);return t?r.fromComment(t.pop()):null},r.fromMapFileSource=function(e,t){var n=e.match(r.mapFileCommentRegex);return n?r.fromMapFileComment(n.pop(),t):null},r.removeComments=function(e){return e.replace(r.commentRegex,"")},r.removeMapFileComments=function(e){return e.replace(r.mapFileCommentRegex,"")},r.generateMapFileComment=function(e,t){var r="sourceMappingURL="+e;return t&&t.multiline?"/*# "+r+" */":"//# "+r}}).call(this,e("buffer").Buffer)},{buffer:194,fs:193,path:546}],59:[function(e,t,r){t.exports=e("./src/node")},{"./src/node":61}],60:[function(e,t,r){function n(e){function t(){if(t.enabled){var e=t,n=+new Date,s=n-(i||n);e.diff=s,e.prev=i,e.curr=n,i=n;for(var a=new Array(arguments.length),o=0;o=0)return t}else{var r=i.toSetString(e);if(s.call(this._set,r))return this._set[r]}throw new Error('"'+e+'" is not in the set.')},n.prototype.at=function(e){if(e>=0&&e>>=5)>0&&(t|=32),r+=n.encode(t)}while(i>0);return r},r.decode=function(e,t,r){var i,s,a=e.length,o=0,u=0;do{if(t>=a)throw new Error("Expected more digits in base 64 VLQ value.");if(-1===(s=n.decode(e.charCodeAt(t++))))throw new Error("Invalid base64 digit: "+e.charAt(t-1));i=!!(32&s),o+=(s&=31)<>1;return 1==(1&e)?-t:t}(o),r.rest=t}},{"./base64":64}],64:[function(e,t,r){var n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");r.encode=function(e){if(0<=e&&e0?t-u>1?n(u,t,i,s,a,o):o==r.LEAST_UPPER_BOUND?t1?n(e,u,i,s,a,o):o==r.LEAST_UPPER_BOUND?u:e<0?-1:e}r.GREATEST_LOWER_BOUND=1,r.LEAST_UPPER_BOUND=2,r.search=function(e,t,i,s){if(0===t.length)return-1;var a=n(-1,t.length,e,t,i,s||r.GREATEST_LOWER_BOUND);if(a<0)return-1;for(;a-1>=0&&0===i(t[a],t[a-1],!0);)--a;return a}},{}],66:[function(e,t,r){function n(){this._array=[],this._sorted=!0,this._last={generatedLine:-1,generatedColumn:0}}var i=e("./util");n.prototype.unsortedForEach=function(e,t){this._array.forEach(e,t)},n.prototype.add=function(e){!function(e,t){var r=e.generatedLine,n=t.generatedLine,s=e.generatedColumn,a=t.generatedColumn;return n>r||n==r&&a>=s||i.compareByGeneratedPositionsInflated(e,t)<=0}(this._last,e)?(this._sorted=!1,this._array.push(e)):(this._last=e,this._array.push(e))},n.prototype.toArray=function(){return this._sorted||(this._array.sort(i.compareByGeneratedPositionsInflated),this._sorted=!0),this._array},r.MappingList=n},{"./util":71}],67:[function(e,t,r){function n(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function i(e,t,r,s){if(r=0){var s=this._originalMappings[i];if(void 0===e.column)for(var a=s.originalLine;s&&s.originalLine===a;)n.push({line:o.getArg(s,"generatedLine",null),column:o.getArg(s,"generatedColumn",null),lastColumn:o.getArg(s,"lastGeneratedColumn",null)}),s=this._originalMappings[++i];else for(var l=s.originalColumn;s&&s.originalLine===t&&s.originalColumn==l;)n.push({line:o.getArg(s,"generatedLine",null),column:o.getArg(s,"generatedColumn",null),lastColumn:o.getArg(s,"lastGeneratedColumn",null)}),s=this._originalMappings[++i]}return n},r.SourceMapConsumer=n,(i.prototype=Object.create(n.prototype)).consumer=n,i.fromSourceMap=function(e){var t=Object.create(i.prototype),r=t._names=l.fromArray(e._names.toArray(),!0),n=t._sources=l.fromArray(e._sources.toArray(),!0);t.sourceRoot=e._sourceRoot,t.sourcesContent=e._generateSourcesContent(t._sources.toArray(),t.sourceRoot),t.file=e._file;for(var a=e._mappings.toArray().slice(),u=t.__generatedMappings=[],c=t.__originalMappings=[],h=0,f=a.length;h1&&(r.source=m+i[1],m+=i[1],r.originalLine=f+i[2],f=r.originalLine,r.originalLine+=1,r.originalColumn=d+i[3],d=r.originalColumn,i.length>4&&(r.name=y+i[4],y+=i[4])),A.push(r),"number"==typeof r.originalLine&&E.push(r)}p(A,o.compareByGeneratedPositionsDeflated),this.__generatedMappings=A,p(E,o.compareByOriginalPositions),this.__originalMappings=E},i.prototype._findMapping=function(e,t,r,n,i,s){if(e[r]<=0)throw new TypeError("Line must be greater than or equal to 1, got "+e[r]);if(e[n]<0)throw new TypeError("Column must be greater than or equal to 0, got "+e[n]);return u.search(e,t,i,s)},i.prototype.computeColumnSpans=function(){for(var e=0;e=0){var i=this._generatedMappings[r];if(i.generatedLine===t.generatedLine){var s=o.getArg(i,"source",null);null!==s&&(s=this._sources.at(s),null!=this.sourceRoot&&(s=o.join(this.sourceRoot,s)));var a=o.getArg(i,"name",null);return null!==a&&(a=this._names.at(a)),{source:s,line:o.getArg(i,"originalLine",null),column:o.getArg(i,"originalColumn",null),name:a}}}return{source:null,line:null,column:null,name:null}},i.prototype.hasContentsOfAllSources=function(){return!!this.sourcesContent&&(this.sourcesContent.length>=this._sources.size()&&!this.sourcesContent.some(function(e){return null==e}))},i.prototype.sourceContentFor=function(e,t){if(!this.sourcesContent)return null;if(null!=this.sourceRoot&&(e=o.relative(this.sourceRoot,e)),this._sources.has(e))return this.sourcesContent[this._sources.indexOf(e)];var r;if(null!=this.sourceRoot&&(r=o.urlParse(this.sourceRoot))){var n=e.replace(/^file:\/\//,"");if("file"==r.scheme&&this._sources.has(n))return this.sourcesContent[this._sources.indexOf(n)];if((!r.path||"/"==r.path)&&this._sources.has("/"+e))return this.sourcesContent[this._sources.indexOf("/"+e)]}if(t)return null;throw new Error('"'+e+'" is not in the SourceMap.')},i.prototype.generatedPositionFor=function(e){var t=o.getArg(e,"source");if(null!=this.sourceRoot&&(t=o.relative(this.sourceRoot,t)),!this._sources.has(t))return{line:null,column:null,lastColumn:null};var r={source:t=this._sources.indexOf(t),originalLine:o.getArg(e,"line"),originalColumn:o.getArg(e,"column")},i=this._findMapping(r,this._originalMappings,"originalLine","originalColumn",o.compareByOriginalPositions,o.getArg(e,"bias",n.GREATEST_LOWER_BOUND));if(i>=0){var s=this._originalMappings[i];if(s.source===r.source)return{line:o.getArg(s,"generatedLine",null),column:o.getArg(s,"generatedColumn",null),lastColumn:o.getArg(s,"lastGeneratedColumn",null)}}return{line:null,column:null,lastColumn:null}},r.BasicSourceMapConsumer=i,(a.prototype=Object.create(n.prototype)).constructor=n,a.prototype._version=3,Object.defineProperty(a.prototype,"sources",{get:function(){for(var e=[],t=0;t0&&e.column>=0)||t||r||n)&&!(e&&"line"in e&&"column"in e&&t&&"line"in t&&"column"in t&&e.line>0&&e.column>=0&&t.line>0&&t.column>=0&&r))throw new Error("Invalid mapping: "+JSON.stringify({generated:e,source:r,original:t,name:n}))},n.prototype._serializeMappings=function(){for(var e,t,r,n,a=0,o=1,u=0,l=0,c=0,p=0,h="",f=this._mappings.toArray(),d=0,m=f.length;d0){if(!s.compareByGeneratedPositionsInflated(t,f[d-1]))continue;e+=","}e+=i.encode(t.generatedColumn-a),a=t.generatedColumn,null!=t.source&&(n=this._sources.indexOf(t.source),e+=i.encode(n-p),p=n,e+=i.encode(t.originalLine-1-l),l=t.originalLine-1,e+=i.encode(t.originalColumn-u),u=t.originalColumn,null!=t.name&&(r=this._names.indexOf(t.name),e+=i.encode(r-c),c=r)),h+=e}return h},n.prototype._generateSourcesContent=function(e,t){return e.map(function(e){if(!this._sourcesContents)return null;null!=t&&(e=s.relative(t,e));var r=s.toSetString(e);return Object.prototype.hasOwnProperty.call(this._sourcesContents,r)?this._sourcesContents[r]:null},this)},n.prototype.toJSON=function(){var e={version:this._version,sources:this._sources.toArray(),names:this._names.toArray(),mappings:this._serializeMappings()};return null!=this._file&&(e.file=this._file),null!=this._sourceRoot&&(e.sourceRoot=this._sourceRoot),this._sourcesContents&&(e.sourcesContent=this._generateSourcesContent(e.sources,e.sourceRoot)),e},n.prototype.toString=function(){return JSON.stringify(this.toJSON())},r.SourceMapGenerator=n},{"./array-set":62,"./base64-vlq":63,"./mapping-list":66,"./util":71}],70:[function(e,t,r){function n(e,t,r,n,i){this.children=[],this.sourceContents={},this.line=null==e?null:e,this.column=null==t?null:t,this.source=null==r?null:r,this.name=null==i?null:i,this[o]=!0,null!=n&&this.add(n)}var i=e("./source-map-generator").SourceMapGenerator,s=e("./util"),a=/(\r?\n)/,o="$$$isSourceNode$$$";n.fromStringWithSourceMap=function(e,t,r){function i(e,t){if(null===e||void 0===e.source)o.add(t);else{var i=r?s.join(r,e.source):e.source;o.add(new n(e.originalLine,e.originalColumn,i,t,e.name))}}var o=new n,u=e.split(a),l=0,c=function(){function e(){return l=0;t--)this.prepend(e[t]);else{if(!e[o]&&"string"!=typeof e)throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+e);this.children.unshift(e)}return this},n.prototype.walk=function(e){for(var t,r=0,n=this.children.length;r0){for(t=[],r=0;r=0;c--)"."===(a=u[c])?u.splice(c,1):".."===a?l++:l>0&&(""===a?(u.splice(c+1,l),l=0):(u.splice(c,2),l--));return""===(t=u.join("/"))&&(t=o?"/":"."),s?(s.path=t,i(s)):t}function a(e){return e}function o(e){if(!e)return!1;var t=e.length;if(t<9)return!1;if(95!==e.charCodeAt(t-1)||95!==e.charCodeAt(t-2)||111!==e.charCodeAt(t-3)||116!==e.charCodeAt(t-4)||111!==e.charCodeAt(t-5)||114!==e.charCodeAt(t-6)||112!==e.charCodeAt(t-7)||95!==e.charCodeAt(t-8)||95!==e.charCodeAt(t-9))return!1;for(var r=t-10;r>=0;r--)if(36!==e.charCodeAt(r))return!1;return!0}function u(e,t){return e===t?0:e>t?1:-1}r.getArg=function(e,t,r){if(t in e)return e[t];if(3===arguments.length)return r;throw new Error('"'+t+'" is a required argument.')};var l=/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.]*)(?::(\d+))?(\S*)$/,c=/^data:.+\,.+$/;r.urlParse=n,r.urlGenerate=i,r.normalize=s,r.join=function(e,t){""===e&&(e="."),""===t&&(t=".");var r=n(t),a=n(e);if(a&&(e=a.path||"/"),r&&!r.scheme)return a&&(r.scheme=a.scheme),i(r);if(r||t.match(c))return t;if(a&&!a.host&&!a.path)return a.host=t,i(a);var o="/"===t.charAt(0)?t:s(e.replace(/\/+$/,"")+"/"+t);return a?(a.path=o,i(a)):o},r.isAbsolute=function(e){return"/"===e.charAt(0)||!!e.match(l)},r.relative=function(e,t){""===e&&(e="."),e=e.replace(/\/$/,"");for(var r=0;0!==t.indexOf(e+"/");){var n=e.lastIndexOf("/");if(n<0)return t;if((e=e.slice(0,n)).match(/^([^\/]+:\/)?\/*$/))return t;++r}return Array(r+1).join("../")+t.substr(e.length+1)};var p=!("__proto__"in Object.create(null));r.toSetString=p?a:function(e){return o(e)?"$"+e:e},r.fromSetString=p?a:function(e){return o(e)?e.slice(1):e},r.compareByOriginalPositions=function(e,t,r){var n=e.source-t.source;return 0!==n?n:0!=(n=e.originalLine-t.originalLine)?n:0!=(n=e.originalColumn-t.originalColumn)||r?n:0!=(n=e.generatedColumn-t.generatedColumn)?n:0!=(n=e.generatedLine-t.generatedLine)?n:e.name-t.name},r.compareByGeneratedPositionsDeflated=function(e,t,r){var n=e.generatedLine-t.generatedLine;return 0!==n?n:0!=(n=e.generatedColumn-t.generatedColumn)||r?n:0!=(n=e.source-t.source)?n:0!=(n=e.originalLine-t.originalLine)?n:0!=(n=e.originalColumn-t.originalColumn)?n:e.name-t.name},r.compareByGeneratedPositionsInflated=function(e,t){var r=e.generatedLine-t.generatedLine;return 0!==r?r:0!=(r=e.generatedColumn-t.generatedColumn)?r:0!==(r=u(e.source,t.source))?r:0!=(r=e.originalLine-t.originalLine)?r:0!=(r=e.originalColumn-t.originalColumn)?r:u(e.name,t.name)}},{}],72:[function(e,t,r){r.SourceMapGenerator=e("./lib/source-map-generator").SourceMapGenerator,r.SourceMapConsumer=e("./lib/source-map-consumer").SourceMapConsumer,r.SourceNode=e("./lib/source-node").SourceNode},{"./lib/source-map-consumer":68,"./lib/source-map-generator":69,"./lib/source-node":70}],73:[function(e,t,r){t.exports={_args:[[{raw:"babel-core@^6.18.2",scope:null,escapedName:"babel-core",name:"babel-core",rawSpec:"^6.18.2",spec:">=6.18.2 <7.0.0",type:"range"},"/Users/evgenypoberezkin/Documents/JSON/ajv/node_modules/regenerator"]],_from:"babel-core@>=6.18.2 <7.0.0",_id:"babel-core@6.26.0",_inCache:!0,_location:"/babel-core",_nodeVersion:"6.9.0",_npmOperationalInternal:{host:"s3://npm-registry-packages",tmp:"tmp/babel-core-6.26.0.tgz_1502898861183_0.43529116874560714"},_npmUser:{name:"hzoo",email:"hi@henryzoo.com"},_npmVersion:"4.6.1",_phantomChildren:{ms:"2.0.0"},_requested:{raw:"babel-core@^6.18.2",scope:null,escapedName:"babel-core",name:"babel-core",rawSpec:"^6.18.2",spec:">=6.18.2 <7.0.0",type:"range"},_requiredBy:["/babel-register","/regenerator"],_resolved:"https://registry.npmjs.org/babel-core/-/babel-core-6.26.0.tgz",_shasum:"af32f78b31a6fcef119c87b0fd8d9753f03a0bb8",_shrinkwrap:null,_spec:"babel-core@^6.18.2",_where:"/Users/evgenypoberezkin/Documents/JSON/ajv/node_modules/regenerator",author:{name:"Sebastian McKenzie",email:"sebmck@gmail.com"},dependencies:{"babel-code-frame":"^6.26.0","babel-generator":"^6.26.0","babel-helpers":"^6.24.1","babel-messages":"^6.23.0","babel-register":"^6.26.0","babel-runtime":"^6.26.0","babel-template":"^6.26.0","babel-traverse":"^6.26.0","babel-types":"^6.26.0",babylon:"^6.18.0","convert-source-map":"^1.5.0",debug:"^2.6.8",json5:"^0.5.1",lodash:"^4.17.4",minimatch:"^3.0.4","path-is-absolute":"^1.0.1",private:"^0.1.7",slash:"^1.0.0","source-map":"^0.5.6"},description:"Babel compiler core.",devDependencies:{"babel-helper-fixtures":"^6.26.0","babel-helper-transform-fixture-test-runner":"^6.26.0","babel-polyfill":"^6.26.0"},directories:{},dist:{shasum:"af32f78b31a6fcef119c87b0fd8d9753f03a0bb8",tarball:"https://registry.npmjs.org/babel-core/-/babel-core-6.26.0.tgz"},homepage:"https://babeljs.io/",keywords:["6to5","babel","classes","const","es6","harmony","let","modules","transpile","transpiler","var","babel-core","compiler"],license:"MIT",maintainers:[{name:"thejameskyle",email:"me@thejameskyle.com"},{name:"sebmck",email:"sebmck@gmail.com"},{name:"danez",email:"daniel@tschinder.de"},{name:"hzoo",email:"hi@henryzoo.com"},{name:"loganfsmyth",email:"loganfsmyth@gmail.com"}],name:"babel-core",optionalDependencies:{},readme:"ERROR: No README data found!",repository:{type:"git",url:"https://github.com/babel/babel/tree/master/packages/babel-core"},scripts:{bench:"make bench",test:"make test"},version:"6.26.0"}},{}],74:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}r.__esModule=!0;var i=n(e("babel-runtime/helpers/classCallCheck")),s=n(e("trim-right")),a=/^[ \t]+$/,o=function(){function e(t){(0,i.default)(this,e),this._map=null,this._buf=[],this._last="",this._queue=[],this._position={line:1,column:0},this._sourcePosition={identifierName:null,line:null,column:null,filename:null},this._map=t}return e.prototype.get=function(){this._flush();var e=this._map,t={code:(0,s.default)(this._buf.join("")),map:null,rawMappings:e&&e.getRawMappings()};return e&&Object.defineProperty(t,"map",{configurable:!0,enumerable:!0,get:function(){return this.map=e.get()},set:function(e){Object.defineProperty(this,"map",{value:e,writable:!0})}}),t},e.prototype.append=function(e){this._flush();var t=this._sourcePosition,r=t.line,n=t.column,i=t.filename,s=t.identifierName;this._append(e,r,n,s,i)},e.prototype.queue=function(e){if("\n"===e)for(;this._queue.length>0&&a.test(this._queue[0][0]);)this._queue.shift();var t=this._sourcePosition,r=t.line,n=t.column,i=t.filename,s=t.identifierName;this._queue.unshift([e,r,n,s,i])},e.prototype._flush=function(){for(var e=void 0;e=this._queue.pop();)this._append.apply(this,e)},e.prototype._append=function(e,t,r,n,i){this._map&&"\n"!==e[0]&&this._map.mark(this._position.line,this._position.column,t,r,n,i),this._buf.push(e),this._last=e[e.length-1];for(var s=0;s0&&"\n"===this._queue[0][0]&&this._queue.shift()},e.prototype.removeLastSemicolon=function(){this._queue.length>0&&";"===this._queue[0][0]&&this._queue.shift()},e.prototype.endsWith=function(e){if(1===e.length){var t=void 0;if(this._queue.length>0){var r=this._queue[0][0];t=r[r.length-1]}else t=this._last;return t===e}var n=this._last+this._queue.reduce(function(e,t){return t[0]+e},"");return e.length<=n.length&&n.slice(-e.length)===e},e.prototype.hasContent=function(){return this._queue.length>0||!!this._last},e.prototype.source=function(e,t){if(!e||t){var r=t?t[e]:null;this._sourcePosition.identifierName=t&&t.identifierName||null,this._sourcePosition.line=r?r.line:null,this._sourcePosition.column=r?r.column:null,this._sourcePosition.filename=t&&t.filename||null}},e.prototype.withSource=function(e,t,r){if(!this._map)return r();var n=this._sourcePosition.line,i=this._sourcePosition.column,s=this._sourcePosition.filename,a=this._sourcePosition.identifierName;this.source(e,t),r(),this._sourcePosition.line=n,this._sourcePosition.column=i,this._sourcePosition.filename=s,this._sourcePosition.identifierName=a},e.prototype.getCurrentColumn=function(){var e=this._queue.reduce(function(e,t){return t[0]+e},""),t=e.lastIndexOf("\n");return-1===t?this._position.column+e.length:e.length-1-t},e.prototype.getCurrentLine=function(){for(var e=this._queue.reduce(function(e,t){return t[0]+e},""),t=0,r=0;r")}function a(){this.space(),this.token("|"),this.space()}r.__esModule=!0,r.TypeParameterDeclaration=r.StringLiteralTypeAnnotation=r.NumericLiteralTypeAnnotation=r.GenericTypeAnnotation=r.ClassImplements=void 0,r.AnyTypeAnnotation=function(){this.word("any")},r.ArrayTypeAnnotation=function(e){this.print(e.elementType,e),this.token("["),this.token("]")},r.BooleanTypeAnnotation=function(){this.word("boolean")},r.BooleanLiteralTypeAnnotation=function(e){this.word(e.value?"true":"false")},r.NullLiteralTypeAnnotation=function(){this.word("null")},r.DeclareClass=function(e,t){u.isDeclareExportDeclaration(t)||(this.word("declare"),this.space()),this.word("class"),this.space(),this._interfaceish(e)},r.DeclareFunction=function(e,t){u.isDeclareExportDeclaration(t)||(this.word("declare"),this.space()),this.word("function"),this.space(),this.print(e.id,e),this.print(e.id.typeAnnotation.typeAnnotation,e),this.semicolon()},r.DeclareInterface=function(e){this.word("declare"),this.space(),this.InterfaceDeclaration(e)},r.DeclareModule=function(e){this.word("declare"),this.space(),this.word("module"),this.space(),this.print(e.id,e),this.space(),this.print(e.body,e)},r.DeclareModuleExports=function(e){this.word("declare"),this.space(),this.word("module"),this.token("."),this.word("exports"),this.print(e.typeAnnotation,e)},r.DeclareTypeAlias=function(e){this.word("declare"),this.space(),this.TypeAlias(e)},r.DeclareOpaqueType=function(e,t){u.isDeclareExportDeclaration(t)||(this.word("declare"),this.space()),this.OpaqueType(e)},r.DeclareVariable=function(e,t){u.isDeclareExportDeclaration(t)||(this.word("declare"),this.space()),this.word("var"),this.space(),this.print(e.id,e),this.print(e.id.typeAnnotation,e),this.semicolon()},r.DeclareExportDeclaration=function(e){this.word("declare"),this.space(),this.word("export"),this.space(),e.default&&(this.word("default"),this.space()),function(e){if(e.declaration){var t=e.declaration;this.print(t,e),u.isStatement(t)||this.semicolon()}else this.token("{"),e.specifiers.length&&(this.space(),this.printList(e.specifiers,e),this.space()),this.token("}"),e.source&&(this.space(),this.word("from"),this.space(),this.print(e.source,e)),this.semicolon()}.apply(this,arguments)},r.ExistentialTypeParam=function(){this.token("*")},r.FunctionTypeAnnotation=function(e,t){this.print(e.typeParameters,e),this.token("("),this.printList(e.params,e),e.rest&&(e.params.length&&(this.token(","),this.space()),this.token("..."),this.print(e.rest,e)),this.token(")"),"ObjectTypeCallProperty"===t.type||"DeclareFunction"===t.type?this.token(":"):(this.space(),this.token("=>")),this.space(),this.print(e.returnType,e)},r.FunctionTypeParam=function(e){this.print(e.name,e),e.optional&&this.token("?"),this.token(":"),this.space(),this.print(e.typeAnnotation,e)},r.InterfaceExtends=n,r._interfaceish=function(e){this.print(e.id,e),this.print(e.typeParameters,e),e.extends.length&&(this.space(),this.word("extends"),this.space(),this.printList(e.extends,e)),e.mixins&&e.mixins.length&&(this.space(),this.word("mixins"),this.space(),this.printList(e.mixins,e)),this.space(),this.print(e.body,e)},r._variance=function(e){"plus"===e.variance?this.token("+"):"minus"===e.variance&&this.token("-")},r.InterfaceDeclaration=function(e){this.word("interface"),this.space(),this._interfaceish(e)},r.IntersectionTypeAnnotation=function(e){this.printJoin(e.types,e,{separator:i})},r.MixedTypeAnnotation=function(){this.word("mixed")},r.EmptyTypeAnnotation=function(){this.word("empty")},r.NullableTypeAnnotation=function(e){this.token("?"),this.print(e.typeAnnotation,e)};var o=e("./types");Object.defineProperty(r,"NumericLiteralTypeAnnotation",{enumerable:!0,get:function(){return o.NumericLiteral}}),Object.defineProperty(r,"StringLiteralTypeAnnotation",{enumerable:!0,get:function(){return o.StringLiteral}}),r.NumberTypeAnnotation=function(){this.word("number")},r.StringTypeAnnotation=function(){this.word("string")},r.ThisTypeAnnotation=function(){this.word("this")},r.TupleTypeAnnotation=function(e){this.token("["),this.printList(e.types,e),this.token("]")},r.TypeofTypeAnnotation=function(e){this.word("typeof"),this.space(),this.print(e.argument,e)},r.TypeAlias=function(e){this.word("type"),this.space(),this.print(e.id,e),this.print(e.typeParameters,e),this.space(),this.token("="),this.space(),this.print(e.right,e),this.semicolon()},r.OpaqueType=function(e){this.word("opaque"),this.space(),this.word("type"),this.space(),this.print(e.id,e),this.print(e.typeParameters,e),e.supertype&&(this.token(":"),this.space(),this.print(e.supertype,e)),e.impltype&&(this.space(),this.token("="),this.space(),this.print(e.impltype,e)),this.semicolon()},r.TypeAnnotation=function(e){this.token(":"),this.space(),e.optional&&this.token("?"),this.print(e.typeAnnotation,e)},r.TypeParameter=function(e){this._variance(e),this.word(e.name),e.bound&&this.print(e.bound,e),e.default&&(this.space(),this.token("="),this.space(),this.print(e.default,e))},r.TypeParameterInstantiation=s,r.ObjectTypeAnnotation=function(e){var t=this;e.exact?this.token("{|"):this.token("{");var r=e.properties.concat(e.callProperties,e.indexers);r.length&&(this.space(),this.printJoin(r,e,{addNewlines:function(e){if(e&&!r[0])return 1},indent:!0,statement:!0,iterator:function(){1!==r.length&&(t.format.flowCommaSeparator?t.token(","):t.semicolon(),t.space())}}),this.space()),e.exact?this.token("|}"):this.token("}")},r.ObjectTypeCallProperty=function(e){e.static&&(this.word("static"),this.space()),this.print(e.value,e)},r.ObjectTypeIndexer=function(e){e.static&&(this.word("static"),this.space()),this._variance(e),this.token("["),this.print(e.id,e),this.token(":"),this.space(),this.print(e.key,e),this.token("]"),this.token(":"),this.space(),this.print(e.value,e)},r.ObjectTypeProperty=function(e){e.static&&(this.word("static"),this.space()),this._variance(e),this.print(e.key,e),e.optional&&this.token("?"),this.token(":"),this.space(),this.print(e.value,e)},r.ObjectTypeSpreadProperty=function(e){this.token("..."),this.print(e.argument,e)},r.QualifiedTypeIdentifier=function(e){this.print(e.qualification,e),this.token("."),this.print(e.id,e)},r.UnionTypeAnnotation=function(e){this.printJoin(e.types,e,{separator:a})},r.TypeCastExpression=function(e){this.token("("),this.print(e.expression,e),this.print(e.typeAnnotation,e),this.token(")")},r.VoidTypeAnnotation=function(){this.word("void")};var u=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(e("babel-types"));r.ClassImplements=n,r.GenericTypeAnnotation=n,r.TypeParameterDeclaration=s},{"./types":84,"babel-types":180}],79:[function(e,t,r){"use strict";function n(){this.space()}r.__esModule=!0;var i=function(e){return e&&e.__esModule?e:{default:e}}(e("babel-runtime/core-js/get-iterator"));r.JSXAttribute=function(e){this.print(e.name,e),e.value&&(this.token("="),this.print(e.value,e))},r.JSXIdentifier=function(e){this.word(e.name)},r.JSXNamespacedName=function(e){this.print(e.namespace,e),this.token(":"),this.print(e.name,e)},r.JSXMemberExpression=function(e){this.print(e.object,e),this.token("."),this.print(e.property,e)},r.JSXSpreadAttribute=function(e){this.token("{"),this.token("..."),this.print(e.argument,e),this.token("}")},r.JSXExpressionContainer=function(e){this.token("{"),this.print(e.expression,e),this.token("}")},r.JSXSpreadChild=function(e){this.token("{"),this.token("..."),this.print(e.expression,e),this.token("}")},r.JSXText=function(e){this.token(e.value)},r.JSXElement=function(e){var t=e.openingElement;if(this.print(t,e),!t.selfClosing){this.indent();var r=e.children,n=Array.isArray(r),s=0;for(r=n?r:(0,i.default)(r);;){var a;if(n){if(s>=r.length)break;a=r[s++]}else{if((s=r.next()).done)break;a=s.value}var o=a;this.print(o,e)}this.dedent(),this.print(e.closingElement,e)}},r.JSXOpeningElement=function(e){this.token("<"),this.print(e.name,e),e.attributes.length>0&&(this.space(),this.printJoin(e.attributes,e,{separator:n})),e.selfClosing?(this.space(),this.token("/>")):this.token(">")},r.JSXClosingElement=function(e){this.token("")},r.JSXEmptyExpression=function(){}},{"babel-runtime/core-js/get-iterator":120}],80:[function(e,t,r){"use strict";function n(e){e.async&&(this.word("async"),this.space()),this.word("function"),e.generator&&this.token("*"),e.id?(this.space(),this.print(e.id,e)):this.space(),this._params(e),this.space(),this.print(e.body,e)}r.__esModule=!0,r.FunctionDeclaration=void 0,r._params=function(e){var t=this;this.print(e.typeParameters,e),this.token("("),this.printList(e.params,e,{iterator:function(e){e.optional&&t.token("?"),t.print(e.typeAnnotation,e)}}),this.token(")"),e.returnType&&this.print(e.returnType,e)},r._method=function(e){var t=e.kind,r=e.key;"method"!==t&&"init"!==t||e.generator&&this.token("*"),"get"!==t&&"set"!==t||(this.word(t),this.space()),e.async&&(this.word("async"),this.space()),e.computed?(this.token("["),this.print(r,e),this.token("]")):this.print(r,e),this._params(e),this.space(),this.print(e.body,e)},r.FunctionExpression=n,r.ArrowFunctionExpression=function(e){e.async&&(this.word("async"),this.space());var t=e.params[0];1===e.params.length&&i.isIdentifier(t)&&!function(e,t){return e.typeParameters||e.returnType||t.typeAnnotation||t.optional||t.trailingComments}(e,t)?this.print(t,e):this._params(e),this.space(),this.token("=>"),this.space(),this.print(e.body,e)};var i=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(e("babel-types"));r.FunctionDeclaration=n},{"babel-types":180}],81:[function(e,t,r){"use strict";function n(e){if(e.declaration){var t=e.declaration;this.print(t,e),i.isStatement(t)||this.semicolon()}else{"type"===e.exportKind&&(this.word("type"),this.space());for(var r=e.specifiers.slice(0),n=!1;;){var s=r[0];if(!i.isExportDefaultSpecifier(s)&&!i.isExportNamespaceSpecifier(s))break;n=!0,this.print(r.shift(),e),r.length&&(this.token(","),this.space())}(r.length||!r.length&&!n)&&(this.token("{"),r.length&&(this.space(),this.printList(r,e),this.space()),this.token("}")),e.source&&(this.space(),this.word("from"),this.space(),this.print(e.source,e)),this.semicolon()}}r.__esModule=!0,r.ImportSpecifier=function(e){"type"!==e.importKind&&"typeof"!==e.importKind||(this.word(e.importKind),this.space()),this.print(e.imported,e),e.local&&e.local.name!==e.imported.name&&(this.space(),this.word("as"),this.space(),this.print(e.local,e))},r.ImportDefaultSpecifier=function(e){this.print(e.local,e)},r.ExportDefaultSpecifier=function(e){this.print(e.exported,e)},r.ExportSpecifier=function(e){this.print(e.local,e),e.exported&&e.local.name!==e.exported.name&&(this.space(),this.word("as"),this.space(),this.print(e.exported,e))},r.ExportNamespaceSpecifier=function(e){this.token("*"),this.space(),this.word("as"),this.space(),this.print(e.exported,e)},r.ExportAllDeclaration=function(e){this.word("export"),this.space(),this.token("*"),this.space(),this.word("from"),this.space(),this.print(e.source,e),this.semicolon()},r.ExportNamedDeclaration=function(){this.word("export"),this.space(),n.apply(this,arguments)},r.ExportDefaultDeclaration=function(){this.word("export"),this.space(),this.word("default"),this.space(),n.apply(this,arguments)},r.ImportDeclaration=function(e){this.word("import"),this.space(),"type"!==e.importKind&&"typeof"!==e.importKind||(this.word(e.importKind),this.space());var t=e.specifiers.slice(0);if(t&&t.length){for(;;){var r=t[0];if(!i.isImportDefaultSpecifier(r)&&!i.isImportNamespaceSpecifier(r))break;this.print(t.shift(),e),t.length&&(this.token(","),this.space())}t.length&&(this.token("{"),this.space(),this.printList(t,e),this.space(),this.token("}")),this.space(),this.word("from"),this.space()}this.print(e.source,e),this.semicolon()},r.ImportNamespaceSpecifier=function(e){this.token("*"),this.space(),this.word("as"),this.space(),this.print(e.local,e)};var i=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(e("babel-types"))},{"babel-types":180}],82:[function(e,t,r){"use strict";function n(e){return u.isStatement(e.body)?n(e.body):e}function i(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"label";return function(r){this.word(e);var n=r[t];if(n){this.space();var i=this.startTerminatorless();this.print(n,r),this.endTerminatorless(i)}this.semicolon()}}function s(){if(this.token(","),this.newline(),this.endsWith("\n"))for(var e=0;e<4;e++)this.space(!0)}function a(){if(this.token(","),this.newline(),this.endsWith("\n"))for(var e=0;e<6;e++)this.space(!0)}r.__esModule=!0,r.ThrowStatement=r.BreakStatement=r.ReturnStatement=r.ContinueStatement=r.ForAwaitStatement=r.ForOfStatement=r.ForInStatement=void 0;var o=function(e){return e&&e.__esModule?e:{default:e}}(e("babel-runtime/core-js/get-iterator"));r.WithStatement=function(e){this.word("with"),this.space(),this.token("("),this.print(e.object,e),this.token(")"),this.printBlock(e)},r.IfStatement=function(e){this.word("if"),this.space(),this.token("("),this.print(e.test,e),this.token(")"),this.space();var t=e.alternate&&u.isIfStatement(n(e.consequent));t&&(this.token("{"),this.newline(),this.indent()),this.printAndIndentOnComments(e.consequent,e),t&&(this.dedent(),this.newline(),this.token("}")),e.alternate&&(this.endsWith("}")&&this.space(),this.word("else"),this.space(),this.printAndIndentOnComments(e.alternate,e))},r.ForStatement=function(e){this.word("for"),this.space(),this.token("("),this.inForStatementInitCounter++,this.print(e.init,e),this.inForStatementInitCounter--,this.token(";"),e.test&&(this.space(),this.print(e.test,e)),this.token(";"),e.update&&(this.space(),this.print(e.update,e)),this.token(")"),this.printBlock(e)},r.WhileStatement=function(e){this.word("while"),this.space(),this.token("("),this.print(e.test,e),this.token(")"),this.printBlock(e)},r.DoWhileStatement=function(e){this.word("do"),this.space(),this.print(e.body,e),this.space(),this.word("while"),this.space(),this.token("("),this.print(e.test,e),this.token(")"),this.semicolon()},r.LabeledStatement=function(e){this.print(e.label,e),this.token(":"),this.space(),this.print(e.body,e)},r.TryStatement=function(e){this.word("try"),this.space(),this.print(e.block,e),this.space(),e.handlers?this.print(e.handlers[0],e):this.print(e.handler,e),e.finalizer&&(this.space(),this.word("finally"),this.space(),this.print(e.finalizer,e))},r.CatchClause=function(e){this.word("catch"),this.space(),this.token("("),this.print(e.param,e),this.token(")"),this.space(),this.print(e.body,e)},r.SwitchStatement=function(e){this.word("switch"),this.space(),this.token("("),this.print(e.discriminant,e),this.token(")"),this.space(),this.token("{"),this.printSequence(e.cases,e,{indent:!0,addNewlines:function(t,r){if(!t&&e.cases[e.cases.length-1]===r)return-1}}),this.token("}")},r.SwitchCase=function(e){e.test?(this.word("case"),this.space(),this.print(e.test,e),this.token(":")):(this.word("default"),this.token(":")),e.consequent.length&&(this.newline(),this.printSequence(e.consequent,e,{indent:!0}))},r.DebuggerStatement=function(){this.word("debugger"),this.semicolon()},r.VariableDeclaration=function(e,t){this.word(e.kind),this.space();var r=!1;if(!u.isFor(t)){var n=e.declarations,i=Array.isArray(n),l=0;for(n=i?n:(0,o.default)(n);;){var c;if(i){if(l>=n.length)break;c=n[l++]}else{if((l=n.next()).done)break;c=l.value}c.init&&(r=!0)}}var p=void 0;r&&(p="const"===e.kind?a:s),this.printList(e.declarations,e,{separator:p}),(!u.isFor(t)||t.left!==e&&t.init!==e)&&this.semicolon()},r.VariableDeclarator=function(e){this.print(e.id,e),this.print(e.id.typeAnnotation,e),e.init&&(this.space(),this.token("="),this.space(),this.print(e.init,e))};var u=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(e("babel-types")),l=function(e){return function(t){this.word("for"),this.space(),"await"===e&&(this.word("await"),this.space()),this.token("("),this.print(t.left,t),this.space(),this.word("await"===e?"of":e),this.space(),this.print(t.right,t),this.token(")"),this.printBlock(t)}};r.ForInStatement=l("in"),r.ForOfStatement=l("of"),r.ForAwaitStatement=l("await"),r.ContinueStatement=i("continue"),r.ReturnStatement=i("return","argument"),r.BreakStatement=i("break"),r.ThrowStatement=i("throw","argument")},{"babel-runtime/core-js/get-iterator":120,"babel-types":180}],83:[function(e,t,r){"use strict";r.__esModule=!0,r.TaggedTemplateExpression=function(e){this.print(e.tag,e),this.print(e.quasi,e)},r.TemplateElement=function(e,t){var r=t.quasis[0]===e,n=t.quasis[t.quasis.length-1]===e,i=(r?"`":"}")+e.value.raw+(n?"`":"${");this.token(i)},r.TemplateLiteral=function(e){for(var t=e.quasis,r=0;r0&&this.space(),this.print(i,e),n1&&void 0!==arguments[1]?arguments[1]:{},a=arguments[2];(0,i.default)(this,t);var c=r.tokens||[],p=function(e,t,r){var n=" ";if(e&&"string"==typeof e){var i=(0,o.default)(e).indent;i&&" "!==i&&(n=i)}var s={auxiliaryCommentBefore:t.auxiliaryCommentBefore,auxiliaryCommentAfter:t.auxiliaryCommentAfter,shouldPrintComment:t.shouldPrintComment,retainLines:t.retainLines,retainFunctionParens:t.retainFunctionParens,comments:null==t.comments||t.comments,compact:t.compact,minified:t.minified,concise:t.concise,quotes:t.quotes||function(e,t){if(!e)return"double";for(var r={single:0,double:0},n=0,i=0;i=3)break}}return r.single>r.double?"single":"double"}(e,r),jsonCompatibleStrings:t.jsonCompatibleStrings,indent:{adjustMultilineComment:!0,style:n,base:0},flowCommaSeparator:t.flowCommaSeparator};return s.minified?(s.compact=!0,s.shouldPrintComment=s.shouldPrintComment||function(){return s.comments}):s.shouldPrintComment=s.shouldPrintComment||function(e){return s.comments||e.indexOf("@license")>=0||e.indexOf("@preserve")>=0},"auto"===s.compact&&(s.compact=e.length>5e5,s.compact&&console.error("[BABEL] "+l.get("codeGeneratorDeopt",t.filename,"500KB"))),s.compact&&(s.indent.adjustMultilineComment=!1),s}(a,n,c),h=n.sourceMaps?new u.default(n,a):null,f=(0,s.default)(this,e.call(this,p,h,c));return f.ast=r,f}return(0,a.default)(t,e),t.prototype.generate=function(){return e.prototype.generate.call(this,this.ast)},t}(n(e("./printer")).default);r.CodeGenerator=function(){function e(t,r,n){(0,i.default)(this,e),this._generator=new c(t,r,n)}return e.prototype.generate=function(){return this._generator.generate()},e}()},{"./printer":89,"./source-map":90,"babel-messages":110,"babel-runtime/helpers/classCallCheck":134,"babel-runtime/helpers/inherits":135,"babel-runtime/helpers/possibleConstructorReturn":137,"detect-indent":311}],86:[function(e,t,r){"use strict";function n(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}function i(e){return e&&e.__esModule?e:{default:e}}function s(e){function t(e,t){var n=r[e];r[e]=n?function(e,r,i){var s=n(e,r,i);return null==s?t(e,r,i):s}:t}var r={},n=(0,c.default)(e),i=Array.isArray(n),s=0;for(n=i?n:(0,l.default)(n);;){var a;if(i){if(s>=n.length)break;a=n[s++]}else{if((s=n.next()).done)break;a=s.value}var o=a,u=f.FLIPPED_ALIAS_KEYS[o];if(u){var p=u,h=Array.isArray(p),d=0;for(p=h?p:(0,l.default)(p);;){var m;if(h){if(d>=p.length)break;m=p[d++]}else{if((d=p.next()).done)break;m=d.value}t(m,e[o])}}else t(o,e[o])}return r}function a(e,t,r,n){var i=e[t.type];return i?i(t,r,n):null}function o(e){return!!f.isCallExpression(e)||!!f.isMemberExpression(e)&&(o(e.object)||!e.computed&&o(e.property))}function u(e,t,r){if(!e)return 0;f.isExpressionStatement(e)&&(e=e.expression);var n=a(m,e,t);if(!n){var i=a(y,e,t);if(i)for(var s=0;s1&&void 0!==arguments[1]?arguments[1]:{},r=t.considerArrow,n=void 0!==r&&r,i=t.considerDefaultExports,s=void 0!==i&&i,a=e.length-1,o=e[a],l=e[--a];a>0;){if(u.isExpressionStatement(l,{expression:o})||u.isTaggedTemplateExpression(l)||s&&u.isExportDefaultDeclaration(l,{declaration:o})||n&&u.isArrowFunctionExpression(l,{body:o}))return!0;if(!(u.isCallExpression(l,{callee:o})||u.isSequenceExpression(l)&&l.expressions[0]===o||u.isMemberExpression(l,{object:o})||u.isConditional(l,{test:o})||u.isBinary(l,{left:o})||u.isAssignmentExpression(l,{left:o})))return!1;o=l,l=e[--a]}return!1}r.__esModule=!0,r.AwaitExpression=r.FunctionTypeAnnotation=void 0,r.NullableTypeAnnotation=n,r.UpdateExpression=function(e,t){return u.isMemberExpression(t)&&t.object===e},r.ObjectExpression=function(e,t,r){return o(r,{considerArrow:!0})},r.DoExpression=function(e,t,r){return o(r)},r.Binary=function(e,t){if((u.isCallExpression(t)||u.isNewExpression(t))&&t.callee===e||u.isUnaryLike(t)||u.isMemberExpression(t)&&t.object===e||u.isAwaitExpression(t))return!0;if(u.isBinary(t)){var r=t.operator,n=l[r],i=e.operator,s=l[i];if(n===s&&t.right===e&&!u.isLogicalExpression(t)||n>s)return!0}return!1},r.BinaryExpression=function(e,t){return"in"===e.operator&&(u.isVariableDeclarator(t)||u.isFor(t))},r.SequenceExpression=function(e,t){return!(u.isForStatement(t)||u.isThrowStatement(t)||u.isReturnStatement(t)||u.isIfStatement(t)&&t.test===e||u.isWhileStatement(t)&&t.test===e||u.isForInStatement(t)&&t.right===e||u.isSwitchStatement(t)&&t.discriminant===e||u.isExpressionStatement(t)&&t.expression===e)},r.YieldExpression=i,r.ClassExpression=function(e,t,r){return o(r,{considerDefaultExports:!0})},r.UnaryLike=s,r.FunctionExpression=function(e,t,r){return o(r,{considerDefaultExports:!0})},r.ArrowFunctionExpression=function(e,t){return!!(u.isExportDeclaration(t)||u.isBinaryExpression(t)||u.isLogicalExpression(t)||u.isUnaryExpression(t)||u.isTaggedTemplateExpression(t))||s(e,t)},r.ConditionalExpression=a,r.AssignmentExpression=function(e){return!!u.isObjectPattern(e.left)||a.apply(void 0,arguments)};var u=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(e("babel-types")),l={"||":0,"&&":1,"|":2,"^":3,"&":4,"==":5,"===":5,"!=":5,"!==":5,"<":6,">":6,"<=":6,">=":6,in:6,instanceof:6,">>":7,"<<":7,">>>":7,"+":8,"-":8,"*":9,"/":9,"%":9,"**":10};r.FunctionTypeAnnotation=n,r.AwaitExpression=i},{"babel-types":180}],88:[function(e,t,r){"use strict";function n(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return o.isMemberExpression(e)?(n(e.object,t),e.computed&&n(e.property,t)):o.isBinary(e)||o.isAssignmentExpression(e)?(n(e.left,t),n(e.right,t)):o.isCallExpression(e)?(t.hasCall=!0,n(e.callee,t)):o.isFunction(e)?t.hasFunction=!0:o.isIdentifier(e)&&(t.hasHelper=t.hasHelper||i(e.callee)),t}function i(e){return o.isMemberExpression(e)?i(e.object)||i(e.property):o.isIdentifier(e)?"require"===e.name||"_"===e.name[0]:o.isCallExpression(e)?i(e.callee):!(!o.isBinary(e)&&!o.isAssignmentExpression(e))&&(o.isIdentifier(e.left)&&i(e.left)||i(e.right))}function s(e){return o.isLiteral(e)||o.isObjectExpression(e)||o.isArrayExpression(e)||o.isIdentifier(e)||o.isMemberExpression(e)}var a=function(e){return e&&e.__esModule?e:{default:e}}(e("lodash/map")),o=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(e("babel-types"));r.nodes={AssignmentExpression:function(e){var t=n(e.right);if(t.hasCall&&t.hasHelper||t.hasFunction)return{before:t.hasFunction,after:!0}},SwitchCase:function(e,t){return{before:e.consequent.length||t.cases[0]===e}},LogicalExpression:function(e){if(o.isFunction(e.left)||o.isFunction(e.right))return{after:!0}},Literal:function(e){if("use strict"===e.value)return{after:!0}},CallExpression:function(e){if(o.isFunction(e.callee)||i(e))return{before:!0,after:!0}},VariableDeclaration:function(e){for(var t=0;t0?new g.default(n):null}return e.prototype.generate=function(e){return this.print(e),this._maybeAddAuxComment(),this._buf.get()},e.prototype.indent=function(){this.format.compact||this.format.concise||this._indent++},e.prototype.dedent=function(){this.format.compact||this.format.concise||this._indent--},e.prototype.semicolon=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this._maybeAddAuxComment(),this._append(";",!e)},e.prototype.rightBrace=function(){this.format.minified&&this._buf.removeLastSemicolon(),this.token("}")},e.prototype.space=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.format.compact||(this._buf.hasContent()&&!this.endsWith(" ")&&!this.endsWith("\n")||e)&&this._space()},e.prototype.word=function(e){this._endsWithWord&&this._space(),this._maybeAddAuxComment(),this._append(e),this._endsWithWord=!0},e.prototype.number=function(e){this.word(e),this._endsWithInteger=(0,f.default)(+e)&&!E.test(e)&&!v.test(e)&&!x.test(e)&&"."!==e[e.length-1]},e.prototype.token=function(e){("--"===e&&this.endsWith("!")||"+"===e[0]&&this.endsWith("+")||"-"===e[0]&&this.endsWith("-")||"."===e[0]&&this._endsWithInteger)&&this._space(),this._maybeAddAuxComment(),this._append(e)},e.prototype.newline=function(e){if(!this.format.retainLines&&!this.format.compact)if(this.format.concise)this.space();else if(!(this.endsWith("\n\n")||("number"!=typeof e&&(e=1),e=Math.min(2,e),(this.endsWith("{\n")||this.endsWith(":\n"))&&e--,e<=0)))for(var t=0;t1&&void 0!==arguments[1]&&arguments[1];this._maybeAddParen(e),this._maybeIndent(e),t?this._buf.queue(e):this._buf.append(e),this._endsWithWord=!1,this._endsWithInteger=!1},e.prototype._maybeIndent=function(e){this._indent&&this.endsWith("\n")&&"\n"!==e[0]&&this._buf.queue(this._getIndent())},e.prototype._maybeAddParen=function(e){var t=this._parenPushNewlineState;if(t){this._parenPushNewlineState=null;var r=void 0;for(r=0;r2&&void 0!==arguments[2]?arguments[2]:{};if(e&&e.length){r.indent&&this.indent();for(var n={addNewlines:r.addNewlines},i=0;i1&&void 0!==arguments[1])||arguments[1];e.innerComments&&(t&&this.indent(),this._printComments(e.innerComments),t&&this.dedent())},e.prototype.printSequence=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return r.statement=!0,this.printJoin(e,t,r)},e.prototype.printList=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return null==r.separator&&(r.separator=s),this.printJoin(e,t,r)},e.prototype._printNewline=function(e,t,r,n){var i=this;if(!this.format.retainLines&&!this.format.compact)if(this.format.concise)this.space();else{var s=0;if(null!=t.start&&!t._ignoreUserWhitespace&&this._whitespace)if(e){var a=t.leadingComments,o=a&&(0,p.default)(a,function(e){return!!e.loc&&i.format.shouldPrintComment(e.value)});s=this._whitespace.getNewlinesBefore(o||t)}else{var u=t.trailingComments,l=u&&(0,h.default)(u,function(e){return!!e.loc&&i.format.shouldPrintComment(e.value)});s=this._whitespace.getNewlinesAfter(l||t)}else{e||s++,n.addNewlines&&(s+=n.addNewlines(e,t)||0);var c=y.needsWhitespaceAfter;e&&(c=y.needsWhitespaceBefore),c(t,r)&&s++,this._buf.hasContent()||(s=0)}this.newline(s)}},e.prototype._getComments=function(e,t){return t&&(e?t.leadingComments:t.trailingComments)||[]},e.prototype._printComment=function(e){var t=this;if(this.format.shouldPrintComment(e.value)&&!e.ignore&&!this._printedComments.has(e)){if(this._printedComments.add(e),null!=e.start){if(this._printedCommentStarts[e.start])return;this._printedCommentStarts[e.start]=!0}this.newline(this._whitespace?this._whitespace.getNewlinesBefore(e):0),this.endsWith("[")||this.endsWith("{")||this.space();var r="CommentLine"===e.type?"//"+e.value+"\n":"/*"+e.value+"*/";if("CommentBlock"===e.type&&this.format.indent.adjustMultilineComment){var n=e.loc&&e.loc.start.column;if(n){var i=new RegExp("\\n\\s{1,"+n+"}","g");r=r.replace(i,"\n")}var s=Math.max(this._getIndent().length,this._buf.getCurrentColumn());r=r.replace(/\n(?!$)/g,"\n"+(0,d.default)(" ",s))}this.withSource("start",e.loc,function(){t._append(r)}),this.newline((this._whitespace?this._whitespace.getNewlinesAfter(e):0)+("CommentLine"===e.type?-1:0))}},e.prototype._printComments=function(e){if(e&&e.length){var t=e,r=Array.isArray(t),n=0;for(t=r?t:(0,o.default)(t);;){var i;if(r){if(n>=t.length)break;i=t[n++]}else{if((n=t.next()).done)break;i=n.value}var s=i;this._printComment(s)}}},e}();r.default=A;for(var D=[e("./generators/template-literals"),e("./generators/expressions"),e("./generators/statements"),e("./generators/classes"),e("./generators/methods"),e("./generators/modules"),e("./generators/types"),e("./generators/flow"),e("./generators/base"),e("./generators/jsx")],S=0;S=0){for(;i&&e.start===n[i-1].start;)--i;t=n[i-1],r=n[i]}return this._getNewlinesBetween(t,r)},e.prototype.getNewlinesAfter=function(e){var t=void 0,r=void 0,n=this.tokens,i=this._findToken(function(t){return t.end-e.end},0,n.length);if(i>=0){for(;i&&e.end===n[i-1].end;)--i;t=n[i],","===(r=n[i+1]).type.label&&(r=n[i+2])}return r&&"eof"===r.type.label?1:this._getNewlinesBetween(t,r)},e.prototype._getNewlinesBetween=function(e,t){if(!t||!t.loc)return 0;for(var r=e?e.loc.end.line:1,n=t.loc.start.line,i=0,s=r;s=r)return-1;var n=t+r>>>1,i=e(this.tokens[n]);return i<0?this._findToken(e,n+1,r):i>0?this._findToken(e,t,n):0===i?n:-1},e}();r.default=i,t.exports=r.default},{"babel-runtime/helpers/classCallCheck":134}],92:[function(e,t,r){arguments[4][62][0].apply(r,arguments)},{"./util":101,dup:62}],93:[function(e,t,r){arguments[4][63][0].apply(r,arguments)},{"./base64":94,dup:63}],94:[function(e,t,r){arguments[4][64][0].apply(r,arguments)},{dup:64}],95:[function(e,t,r){arguments[4][65][0].apply(r,arguments)},{dup:65}],96:[function(e,t,r){arguments[4][66][0].apply(r,arguments)},{"./util":101,dup:66}],97:[function(e,t,r){arguments[4][67][0].apply(r,arguments)},{dup:67}],98:[function(e,t,r){arguments[4][68][0].apply(r,arguments)},{"./array-set":92,"./base64-vlq":93,"./binary-search":95,"./quick-sort":97,"./util":101,dup:68}],99:[function(e,t,r){arguments[4][69][0].apply(r,arguments)},{"./array-set":92,"./base64-vlq":93,"./mapping-list":96,"./util":101,dup:69}],100:[function(e,t,r){arguments[4][70][0].apply(r,arguments)},{"./source-map-generator":99,"./util":101,dup:70}],101:[function(e,t,r){arguments[4][71][0].apply(r,arguments)},{dup:71}],102:[function(e,t,r){arguments[4][72][0].apply(r,arguments)},{"./lib/source-map-consumer":98,"./lib/source-map-generator":99,"./lib/source-node":100,dup:72}],103:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e){var t=u.objectExpression([]);return(0,s.default)(e).forEach(function(r){var n=e[r],i=u.objectExpression([]),a=u.objectProperty(n._key,i,n._computed);(0,s.default)(n).forEach(function(e){var t=n[e];if("_"!==e[0]){var r=t;(u.isClassMethod(t)||u.isClassProperty(t))&&(t=t.value);var s=u.objectProperty(u.identifier(e),t);u.inheritsComments(s,r),u.removeComments(r),i.properties.push(s)}}),t.properties.push(a)}),t}r.__esModule=!0;var s=n(e("babel-runtime/core-js/object/keys"));r.push=function(e,t,r,n,i){var s=u.toKeyAlias(t),l={};if((0,o.default)(e,s)&&(l=e[s]),e[s]=l,l._inherits=l._inherits||[],l._inherits.push(t),l._key=t.key,t.computed&&(l._computed=!0),t.decorators){var c=l.decorators=l.decorators||u.arrayExpression([]);c.elements=c.elements.concat(t.decorators.map(function(e){return e.expression}).reverse())}if(l.value||l.initializer)throw n.buildCodeFrameError(t,"Key conflict with sibling node");var p=void 0,h=void 0;(u.isObjectProperty(t)||u.isObjectMethod(t)||u.isClassMethod(t))&&(p=u.toComputedKey(t,t.key)),u.isObjectProperty(t)||u.isClassProperty(t)?h=t.value:(u.isObjectMethod(t)||u.isClassMethod(t))&&((h=u.functionExpression(null,t.params,t.body,t.generator,t.async)).returnType=t.returnType);var f=function(e){return!u.isClassMethod(e)&&!u.isObjectMethod(e)||"get"!==e.kind&&"set"!==e.kind?"value":e.kind}(t);return r&&"value"===f||(r=f),i&&u.isStringLiteral(p)&&("value"===r||"initializer"===r)&&u.isFunctionExpression(h)&&(h=(0,a.default)({id:p,node:h,scope:i})),h&&(u.inheritsComments(h,t),l[r]=h),l},r.hasComputed=function(e){for(var t in e)if(e[t]._computed)return!0;return!1},r.toComputedObjectFromClass=function(e){for(var t=u.arrayExpression([]),r=0;r1&&void 0!==arguments[1]&&arguments[1];(0,o.default)(this,e),this.forceSuperMemoisation=t.forceSuperMemoisation,this.methodPath=t.methodPath,this.methodNode=t.methodNode,this.superRef=t.superRef,this.isStatic=t.isStatic,this.hasSuper=!1,this.inClass=r,this.isLoose=t.isLoose,this.scope=this.methodPath.scope,this.file=t.file,this.opts=t,this.bareSupers=[],this.returns=[],this.thises=[]}return e.prototype.getObjectRef=function(){return this.opts.objectRef||this.opts.getObjectRef()},e.prototype.setSuperProperty=function(e,t,r){return p.callExpression(this.file.addHelper("set"),[a(this.getObjectRef(),this.isStatic),r?e:p.stringLiteral(e.name),t,p.thisExpression()])},e.prototype.getSuperProperty=function(e,t){return p.callExpression(this.file.addHelper("get"),[a(this.getObjectRef(),this.isStatic),t?e:p.stringLiteral(e.name),p.thisExpression()])},e.prototype.replace=function(){this.methodPath.traverse(f,this)},e.prototype.getLooseSuperProperty=function(e,t){var r=this.methodNode,n=this.superRef||p.identifier("Function");return t.property===e?void 0:p.isCallExpression(t,{callee:e})?void 0:p.isMemberExpression(t)&&!r.static?p.memberExpression(n,p.identifier("prototype")):n},e.prototype.looseHandle=function(e){var t=e.node;if(e.isSuper())return this.getLooseSuperProperty(t,e.parent);if(e.isCallExpression()){var r=t.callee;if(!p.isMemberExpression(r))return;if(!p.isSuper(r.object))return;return p.appendToMemberExpression(r,p.identifier("call")),t.arguments.unshift(p.thisExpression()),!0}},e.prototype.specHandleAssignmentExpression=function(e,t,r){return"="===r.operator?this.setSuperProperty(r.left.property,r.right,r.left.computed):(e=e||t.scope.generateUidIdentifier("ref"),[p.variableDeclaration("var",[p.variableDeclarator(e,r.left)]),p.expressionStatement(p.assignmentExpression("=",r.left,p.binaryExpression(r.operator[0],e,r.right)))])},e.prototype.specHandle=function(e){var t=void 0,r=void 0,n=void 0,i=e.parent,a=e.node;if(function(e,t){return!!p.isSuper(e)&&!p.isMemberExpression(t,{computed:!1})&&!p.isCallExpression(t,{callee:e})}(a,i))throw e.buildCodeFrameError(c.get("classesIllegalBareSuper"));if(p.isCallExpression(a)){var o=a.callee;if(p.isSuper(o))return;s(o)&&(t=o.property,r=o.computed,n=a.arguments)}else if(p.isMemberExpression(a)&&p.isSuper(a.object))t=a.property,r=a.computed;else{if(p.isUpdateExpression(a)&&s(a.argument)){var u=p.binaryExpression(a.operator[0],a.argument,p.numericLiteral(1));if(a.prefix)return this.specHandleAssignmentExpression(null,e,u);var l=e.scope.generateUidIdentifier("ref");return this.specHandleAssignmentExpression(l,e,u).concat(p.expressionStatement(l))}if(p.isAssignmentExpression(a)&&s(a.left))return this.specHandleAssignmentExpression(null,e,a)}if(t){var h=this.getSuperProperty(t,r);return n?this.optimiseCall(h,n):h}},e.prototype.optimiseCall=function(e,t){var r=p.thisExpression();return r[h]=!0,(0,l.default)(e,r,t)},e}();r.default=d,t.exports=r.default},{"babel-helper-optimise-call-expression":106,"babel-messages":110,"babel-runtime/core-js/symbol":129,"babel-runtime/helpers/classCallCheck":134,"babel-types":180}],108:[function(e,t,r){"use strict";r.__esModule=!0;var n=function(e){return e&&e.__esModule?e:{default:e}}(e("babel-template")),i={};r.default=i,i.typeof=(0,n.default)('\n (typeof Symbol === "function" && typeof Symbol.iterator === "symbol")\n ? function (obj) { return typeof obj; }\n : function (obj) {\n return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype\n ? "symbol"\n : typeof obj;\n };\n'),i.jsx=(0,n.default)('\n (function () {\n var REACT_ELEMENT_TYPE = (typeof Symbol === "function" && Symbol.for && Symbol.for("react.element")) || 0xeac7;\n\n return function createRawReactElement (type, props, key, children) {\n var defaultProps = type && type.defaultProps;\n var childrenLength = arguments.length - 3;\n\n if (!props && childrenLength !== 0) {\n // If we\'re going to assign props.children, we create a new object now\n // to avoid mutating defaultProps.\n props = {};\n }\n if (props && defaultProps) {\n for (var propName in defaultProps) {\n if (props[propName] === void 0) {\n props[propName] = defaultProps[propName];\n }\n }\n } else if (!props) {\n props = defaultProps || {};\n }\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 3];\n }\n props.children = childArray;\n }\n\n return {\n $$typeof: REACT_ELEMENT_TYPE,\n type: type,\n key: key === undefined ? null : \'\' + key,\n ref: null,\n props: props,\n _owner: null,\n };\n };\n\n })()\n'),i.asyncIterator=(0,n.default)('\n (function (iterable) {\n if (typeof Symbol === "function") {\n if (Symbol.asyncIterator) {\n var method = iterable[Symbol.asyncIterator];\n if (method != null) return method.call(iterable);\n }\n if (Symbol.iterator) {\n return iterable[Symbol.iterator]();\n }\n }\n throw new TypeError("Object is not async iterable");\n })\n'),i.asyncGenerator=(0,n.default)('\n (function () {\n function AwaitValue(value) {\n this.value = value;\n }\n\n function AsyncGenerator(gen) {\n var front, back;\n\n function send(key, arg) {\n return new Promise(function (resolve, reject) {\n var request = {\n key: key,\n arg: arg,\n resolve: resolve,\n reject: reject,\n next: null\n };\n\n if (back) {\n back = back.next = request;\n } else {\n front = back = request;\n resume(key, arg);\n }\n });\n }\n\n function resume(key, arg) {\n try {\n var result = gen[key](arg)\n var value = result.value;\n if (value instanceof AwaitValue) {\n Promise.resolve(value.value).then(\n function (arg) { resume("next", arg); },\n function (arg) { resume("throw", arg); });\n } else {\n settle(result.done ? "return" : "normal", result.value);\n }\n } catch (err) {\n settle("throw", err);\n }\n }\n\n function settle(type, value) {\n switch (type) {\n case "return":\n front.resolve({ value: value, done: true });\n break;\n case "throw":\n front.reject(value);\n break;\n default:\n front.resolve({ value: value, done: false });\n break;\n }\n\n front = front.next;\n if (front) {\n resume(front.key, front.arg);\n } else {\n back = null;\n }\n }\n\n this._invoke = send;\n\n // Hide "return" method if generator return is not supported\n if (typeof gen.return !== "function") {\n this.return = undefined;\n }\n }\n\n if (typeof Symbol === "function" && Symbol.asyncIterator) {\n AsyncGenerator.prototype[Symbol.asyncIterator] = function () { return this; };\n }\n\n AsyncGenerator.prototype.next = function (arg) { return this._invoke("next", arg); };\n AsyncGenerator.prototype.throw = function (arg) { return this._invoke("throw", arg); };\n AsyncGenerator.prototype.return = function (arg) { return this._invoke("return", arg); };\n\n return {\n wrap: function (fn) {\n return function () {\n return new AsyncGenerator(fn.apply(this, arguments));\n };\n },\n await: function (value) {\n return new AwaitValue(value);\n }\n };\n\n })()\n'),i.asyncGeneratorDelegate=(0,n.default)('\n (function (inner, awaitWrap) {\n var iter = {}, waiting = false;\n\n function pump(key, value) {\n waiting = true;\n value = new Promise(function (resolve) { resolve(inner[key](value)); });\n return { done: false, value: awaitWrap(value) };\n };\n\n if (typeof Symbol === "function" && Symbol.iterator) {\n iter[Symbol.iterator] = function () { return this; };\n }\n\n iter.next = function (value) {\n if (waiting) {\n waiting = false;\n return value;\n }\n return pump("next", value);\n };\n\n if (typeof inner.throw === "function") {\n iter.throw = function (value) {\n if (waiting) {\n waiting = false;\n throw value;\n }\n return pump("throw", value);\n };\n }\n\n if (typeof inner.return === "function") {\n iter.return = function (value) {\n return pump("return", value);\n };\n }\n\n return iter;\n })\n'),i.asyncToGenerator=(0,n.default)('\n (function (fn) {\n return function () {\n var gen = fn.apply(this, arguments);\n return new Promise(function (resolve, reject) {\n function step(key, arg) {\n try {\n var info = gen[key](arg);\n var value = info.value;\n } catch (error) {\n reject(error);\n return;\n }\n\n if (info.done) {\n resolve(value);\n } else {\n return Promise.resolve(value).then(function (value) {\n step("next", value);\n }, function (err) {\n step("throw", err);\n });\n }\n }\n\n return step("next");\n });\n };\n })\n'),i.classCallCheck=(0,n.default)('\n (function (instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError("Cannot call a class as a function");\n }\n });\n'),i.createClass=(0,n.default)('\n (function() {\n function defineProperties(target, props) {\n for (var i = 0; i < props.length; i ++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if ("value" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n }\n\n return function (Constructor, protoProps, staticProps) {\n if (protoProps) defineProperties(Constructor.prototype, protoProps);\n if (staticProps) defineProperties(Constructor, staticProps);\n return Constructor;\n };\n })()\n'),i.defineEnumerableProperties=(0,n.default)('\n (function (obj, descs) {\n for (var key in descs) {\n var desc = descs[key];\n desc.configurable = desc.enumerable = true;\n if ("value" in desc) desc.writable = true;\n Object.defineProperty(obj, key, desc);\n }\n return obj;\n })\n'),i.defaults=(0,n.default)("\n (function (obj, defaults) {\n var keys = Object.getOwnPropertyNames(defaults);\n for (var i = 0; i < keys.length; i++) {\n var key = keys[i];\n var value = Object.getOwnPropertyDescriptor(defaults, key);\n if (value && value.configurable && obj[key] === undefined) {\n Object.defineProperty(obj, key, value);\n }\n }\n return obj;\n })\n"),i.defineProperty=(0,n.default)("\n (function (obj, key, value) {\n // Shortcircuit the slow defineProperty path when possible.\n // We are trying to avoid issues where setters defined on the\n // prototype cause side effects under the fast path of simple\n // assignment. By checking for existence of the property with\n // the in operator, we can optimize most of this overhead away.\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n return obj;\n });\n"),i.extends=(0,n.default)("\n Object.assign || (function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n return target;\n })\n"),i.get=(0,n.default)('\n (function get(object, property, receiver) {\n if (object === null) object = Function.prototype;\n\n var desc = Object.getOwnPropertyDescriptor(object, property);\n\n if (desc === undefined) {\n var parent = Object.getPrototypeOf(object);\n\n if (parent === null) {\n return undefined;\n } else {\n return get(parent, property, receiver);\n }\n } else if ("value" in desc) {\n return desc.value;\n } else {\n var getter = desc.get;\n\n if (getter === undefined) {\n return undefined;\n }\n\n return getter.call(receiver);\n }\n });\n'),i.inherits=(0,n.default)('\n (function (subClass, superClass) {\n if (typeof superClass !== "function" && superClass !== null) {\n throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);\n }\n subClass.prototype = Object.create(superClass && superClass.prototype, {\n constructor: {\n value: subClass,\n enumerable: false,\n writable: true,\n configurable: true\n }\n });\n if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;\n })\n'),i.instanceof=(0,n.default)('\n (function (left, right) {\n if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) {\n return right[Symbol.hasInstance](left);\n } else {\n return left instanceof right;\n }\n });\n'),i.interopRequireDefault=(0,n.default)("\n (function (obj) {\n return obj && obj.__esModule ? obj : { default: obj };\n })\n"),i.interopRequireWildcard=(0,n.default)("\n (function (obj) {\n if (obj && obj.__esModule) {\n return obj;\n } else {\n var newObj = {};\n if (obj != null) {\n for (var key in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key];\n }\n }\n newObj.default = obj;\n return newObj;\n }\n })\n"),i.newArrowCheck=(0,n.default)('\n (function (innerThis, boundThis) {\n if (innerThis !== boundThis) {\n throw new TypeError("Cannot instantiate an arrow function");\n }\n });\n'),i.objectDestructuringEmpty=(0,n.default)('\n (function (obj) {\n if (obj == null) throw new TypeError("Cannot destructure undefined");\n });\n'),i.objectWithoutProperties=(0,n.default)("\n (function (obj, keys) {\n var target = {};\n for (var i in obj) {\n if (keys.indexOf(i) >= 0) continue;\n if (!Object.prototype.hasOwnProperty.call(obj, i)) continue;\n target[i] = obj[i];\n }\n return target;\n })\n"),i.possibleConstructorReturn=(0,n.default)('\n (function (self, call) {\n if (!self) {\n throw new ReferenceError("this hasn\'t been initialised - super() hasn\'t been called");\n }\n return call && (typeof call === "object" || typeof call === "function") ? call : self;\n });\n'),i.selfGlobal=(0,n.default)('\n typeof global === "undefined" ? self : global\n'),i.set=(0,n.default)('\n (function set(object, property, value, receiver) {\n var desc = Object.getOwnPropertyDescriptor(object, property);\n\n if (desc === undefined) {\n var parent = Object.getPrototypeOf(object);\n\n if (parent !== null) {\n set(parent, property, value, receiver);\n }\n } else if ("value" in desc && desc.writable) {\n desc.value = value;\n } else {\n var setter = desc.set;\n\n if (setter !== undefined) {\n setter.call(receiver, value);\n }\n }\n\n return value;\n });\n'),i.slicedToArray=(0,n.default)('\n (function () {\n // Broken out into a separate function to avoid deoptimizations due to the try/catch for the\n // array iterator case.\n function sliceIterator(arr, i) {\n // this is an expanded form of `for...of` that properly supports abrupt completions of\n // iterators etc. variable names have been minimised to reduce the size of this massive\n // helper. sometimes spec compliancy is annoying :(\n //\n // _n = _iteratorNormalCompletion\n // _d = _didIteratorError\n // _e = _iteratorError\n // _i = _iterator\n // _s = _step\n\n var _arr = [];\n var _n = true;\n var _d = false;\n var _e = undefined;\n try {\n for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {\n _arr.push(_s.value);\n if (i && _arr.length === i) break;\n }\n } catch (err) {\n _d = true;\n _e = err;\n } finally {\n try {\n if (!_n && _i["return"]) _i["return"]();\n } finally {\n if (_d) throw _e;\n }\n }\n return _arr;\n }\n\n return function (arr, i) {\n if (Array.isArray(arr)) {\n return arr;\n } else if (Symbol.iterator in Object(arr)) {\n return sliceIterator(arr, i);\n } else {\n throw new TypeError("Invalid attempt to destructure non-iterable instance");\n }\n };\n })();\n'),i.slicedToArrayLoose=(0,n.default)('\n (function (arr, i) {\n if (Array.isArray(arr)) {\n return arr;\n } else if (Symbol.iterator in Object(arr)) {\n var _arr = [];\n for (var _iterator = arr[Symbol.iterator](), _step; !(_step = _iterator.next()).done;) {\n _arr.push(_step.value);\n if (i && _arr.length === i) break;\n }\n return _arr;\n } else {\n throw new TypeError("Invalid attempt to destructure non-iterable instance");\n }\n });\n'),i.taggedTemplateLiteral=(0,n.default)("\n (function (strings, raw) {\n return Object.freeze(Object.defineProperties(strings, {\n raw: { value: Object.freeze(raw) }\n }));\n });\n"),i.taggedTemplateLiteralLoose=(0,n.default)("\n (function (strings, raw) {\n strings.raw = raw;\n return strings;\n });\n"),i.temporalRef=(0,n.default)('\n (function (val, name, undef) {\n if (val === undef) {\n throw new ReferenceError(name + " is not defined - temporal dead zone");\n } else {\n return val;\n }\n })\n'),i.temporalUndefined=(0,n.default)("\n ({})\n"),i.toArray=(0,n.default)("\n (function (arr) {\n return Array.isArray(arr) ? arr : Array.from(arr);\n });\n"),i.toConsumableArray=(0,n.default)("\n (function (arr) {\n if (Array.isArray(arr)) {\n for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) arr2[i] = arr[i];\n return arr2;\n } else {\n return Array.from(arr);\n }\n });\n"),t.exports=r.default},{"babel-template":139}],109:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e){var t=a.default[e];if(!t)throw new ReferenceError("Unknown helper "+e);return t().expression}r.__esModule=!0,r.list=void 0;var s=n(e("babel-runtime/core-js/object/keys"));r.get=i;var a=n(e("./helpers"));r.list=(0,s.default)(a.default).map(function(e){return e.replace(/^_/,"")}).filter(function(e){return"__esModule"!==e});r.default=i},{"./helpers":108,"babel-runtime/core-js/object/keys":127}],110:[function(e,t,r){"use strict";function n(e){return e.map(function(e){if(null!=e&&e.inspect)return e.inspect();try{return(0,i.default)(e)||e+""}catch(t){return s.inspect(e)}})}r.__esModule=!0,r.MESSAGES=void 0;var i=function(e){return e&&e.__esModule?e:{default:e}}(e("babel-runtime/core-js/json/stringify"));r.get=function(e){for(var t=arguments.length,r=Array(t>1?t-1:0),s=1;s4&&void 0!==arguments[4]&&arguments[4];if(t||(t=e.node),!h.isFor(r))for(var s=0;s0&&e.traverse(g,t),e.skip()}},p.visitor]),g=c.default.visitors.merge([{ReferencedIdentifier:function(e,t){var r=t.letReferences[e.node.name];if(r){var n=e.scope.getBindingIdentifier(e.node.name);n&&n!==r||(t.closurify=!0)}}},p.visitor]),b={enter:function(e,t){var r=e.node;e.parent;if(e.isForStatement()){if(a(r.init)){var n=t.pushDeclar(r.init);1===n.length?r.init=n[0]:r.init=h.sequenceExpression(n)}}else if(e.isFor())a(r.left)&&(t.pushDeclar(r.left),r.left=r.left.declarations[0].id);else if(a(r))e.replaceWithMultiple(t.pushDeclar(r).map(function(e){return h.expressionStatement(e)}));else if(e.isFunction())return e.skip()}},v={LabeledStatement:function(e,t){var r=e.node;t.innerLabels.push(r.label.name)}},x={enter:function(e,t){if(e.isAssignmentExpression()||e.isUpdateExpression()){var r=e.getBindingIdentifiers();for(var n in r)t.outsideReferences[n]===e.scope.getBindingIdentifier(n)&&(t.reassignments[n]=!0)}}},E={Loop:function(e,t){var r=t.ignoreLabeless;t.ignoreLabeless=!0,e.traverse(E,t),t.ignoreLabeless=r,e.skip()},Function:function(e){e.skip()},SwitchCase:function(e,t){var r=t.inSwitchCase;t.inSwitchCase=!0,e.traverse(E,t),t.inSwitchCase=r,e.skip()},"BreakStatement|ContinueStatement|ReturnStatement":function(e,t){var r=e.node,n=e.parent,i=e.scope;if(!r[this.LOOP_IGNORE]){var s=void 0,a=function(e){return h.isBreakStatement(e)?"break":h.isContinueStatement(e)?"continue":void 0}(r);if(a){if(r.label){if(t.innerLabels.indexOf(r.label.name)>=0)return;a=a+"|"+r.label.name}else{if(t.ignoreLabeless)return;if(t.inSwitchCase)return;if(h.isBreakStatement(r)&&h.isSwitchCase(n))return}t.hasBreakContinue=!0,t.map[a]=r,s=h.stringLiteral(a)}e.isReturnStatement()&&(t.hasReturn=!0,s=h.objectExpression([h.objectProperty(h.identifier("v"),r.argument||i.buildUndefinedNode())])),s&&((s=h.returnStatement(s))[this.LOOP_IGNORE]=!0,e.skip(),e.replaceWith(h.inherits(s,r)))}}},A=function(){function e(t,r,n,i,s){(0,l.default)(this,e),this.parent=n,this.scope=i,this.file=s,this.blockPath=r,this.block=r.node,this.outsideLetReferences=(0,u.default)(null),this.hasLetReferences=!1,this.letReferences=(0,u.default)(null),this.body=[],t&&(this.loopParent=t.parent,this.loopLabel=h.isLabeledStatement(this.loopParent)&&this.loopParent.label,this.loopPath=t,this.loop=t.node)}return e.prototype.run=function(){var e=this.block;if(!e._letDone){e._letDone=!0;var t=this.getLetReferences();if(h.isFunction(this.parent)||h.isProgram(this.block))this.updateScopeInfo();else if(this.hasLetReferences)return t?this.wrapClosure():this.remap(),this.updateScopeInfo(t),this.loopLabel&&!h.isLabeledStatement(this.loopParent)?h.labeledStatement(this.loopLabel,this.loop):void 0}},e.prototype.updateScopeInfo=function(e){var t=this.scope,r=t.getFunctionParent(),n=this.letReferences;for(var i in n){var s=n[i],a=t.getBinding(s.name);a&&("let"!==a.kind&&"const"!==a.kind||(a.kind="var",e?t.removeBinding(s.name):t.moveBindingTo(s.name,r)))}},e.prototype.remap=function(){var e=this.letReferences,t=this.scope;for(var r in e){var n=e[r];(t.parentHasBinding(r)||t.hasGlobal(r))&&(t.hasOwnBinding(r)&&t.rename(n.name),this.blockPath.scope.hasOwnBinding(r)&&this.blockPath.scope.rename(n.name))}},e.prototype.wrapClosure=function(){if(this.file.opts.throwIfClosureRequired)throw this.blockPath.buildCodeFrameError("Compiling let/const in this block would add a closure (throwIfClosureRequired).");var e=this.block,t=this.outsideLetReferences;if(this.loop)for(var r in t){var n=t[r];(this.scope.hasGlobal(n.name)||this.scope.parentHasBinding(n.name))&&(delete t[n.name],delete this.letReferences[n.name],this.scope.rename(n.name),this.letReferences[n.name]=n,t[n.name]=n)}this.has=this.checkLoop(),this.hoistVarDeclarations();var i=(0,f.default)(t),s=(0,f.default)(t),a=this.blockPath.isSwitchStatement(),o=h.functionExpression(null,i,h.blockStatement(a?[e]:e.body));o.shadow=!0,this.addContinuations(o);var u=o;this.loop&&(u=this.scope.generateUidIdentifier("loop"),this.loopPath.insertBefore(h.variableDeclaration("var",[h.variableDeclarator(u,o)])));var l=h.callExpression(u,s),p=this.scope.generateUidIdentifier("ret");c.default.hasType(o.body,this.scope,"YieldExpression",h.FUNCTION_TYPES)&&(o.generator=!0,l=h.yieldExpression(l,!0));c.default.hasType(o.body,this.scope,"AwaitExpression",h.FUNCTION_TYPES)&&(o.async=!0,l=h.awaitExpression(l)),this.buildClosure(p,l),a?this.blockPath.replaceWithMultiple(this.body):e.body=this.body},e.prototype.buildClosure=function(e,t){var r=this.has;r.hasReturn||r.hasBreakContinue?this.buildHas(e,t):this.body.push(h.expressionStatement(t))},e.prototype.addContinuations=function(e){var t={reassignments:{},outsideReferences:this.outsideLetReferences};this.scope.traverse(e,x,t);for(var r=0;r2&&void 0!==arguments[2]?arguments[2]:"value",n=arguments[3],i=void 0;e.static?(this.hasStaticDescriptors=!0,i=this.staticMutatorMap):(this.hasInstanceDescriptors=!0,i=this.instanceMutatorMap);var s=c.push(i,e,r,this.file,n);return t&&(s.enumerable=h.booleanLiteral(!0)),s},e.prototype.constructorMeMaybe=function(){var e=!1,t=this.path.get("body.body"),r=Array.isArray(t),n=0;for(t=r?t:(0,s.default)(t);;){var i;if(r){if(n>=t.length)break;i=t[n++]}else{if((n=t.next()).done)break;i=n.value}if(e=i.equals("kind","constructor"))break}if(!e){var a=void 0,o=void 0;if(this.isDerived){var u=f().expression;a=u.params,o=u.body}else a=[],o=h.blockStatement([]);this.path.get("body").unshiftContainer("body",h.classMethod("constructor",h.identifier("constructor"),a,o))}},e.prototype.buildBody=function(){if(this.constructorMeMaybe(),this.pushBody(),this.verifyConstructor(),this.userConstructor){var e=this.constructorBody;e.body=e.body.concat(this.userConstructor.body.body),h.inherits(this.constructor,this.userConstructor),h.inherits(e,this.userConstructor.body)}this.pushDescriptors()},e.prototype.pushBody=function(){var e=this.path.get("body.body"),t=Array.isArray(e),r=0;for(e=t?e:(0,s.default)(e);;){var n;if(t){if(r>=e.length)break;n=e[r++]}else{if((r=e.next()).done)break;n=r.value}var i=n,a=i.node;if(i.isClassProperty())throw i.buildCodeFrameError("Missing class properties transform.");if(a.decorators)throw i.buildCodeFrameError("Method has decorators, put the decorator plugin before the classes one.");if(h.isClassMethod(a)){var o="constructor"===a.kind;if(o&&(i.traverse(m,this),!this.hasBareSuper&&this.isDerived))throw i.buildCodeFrameError("missing super() call in constructor");var l=new u.default({forceSuperMemoisation:o,methodPath:i,methodNode:a,objectRef:this.classRef,superRef:this.superName,isStatic:a.static,isLoose:this.isLoose,scope:this.scope,file:this.file},!0);l.replace(),o?this.pushConstructor(l,a,i):this.pushMethod(a,i)}}},e.prototype.clearDescriptors=function(){this.hasInstanceDescriptors=!1,this.hasStaticDescriptors=!1,this.instanceMutatorMap={},this.staticMutatorMap={}},e.prototype.pushDescriptors=function(){this.pushInherits();var e=this.body,t=void 0,r=void 0;if(this.hasInstanceDescriptors&&(t=c.toClassObject(this.instanceMutatorMap)),this.hasStaticDescriptors&&(r=c.toClassObject(this.staticMutatorMap)),t||r){t&&(t=c.toComputedObjectFromClass(t)),r&&(r=c.toComputedObjectFromClass(r));var n=h.nullLiteral(),i=[this.classRef,n,n,n,n];t&&(i[1]=t),r&&(i[2]=r),this.instanceInitializersId&&(i[3]=this.instanceInitializersId,e.unshift(this.buildObjectAssignment(this.instanceInitializersId))),this.staticInitializersId&&(i[4]=this.staticInitializersId,e.unshift(this.buildObjectAssignment(this.staticInitializersId)));for(var s=0,a=0;a=o.length)break;c=o[l++]}else{if((l=o.next()).done)break;c=l.value}var p=c;this.wrapSuperCall(p,i,a,r),n&&p.find(function(e){return e===t||(e.isLoop()||e.isConditional()?(n=!1,!0):void 0)})}var f=this.superThises,d=Array.isArray(f),m=0;for(f=d?f:(0,s.default)(f);;){var g;if(d){if(m>=f.length)break;g=f[m++]}else{if((m=f.next()).done)break;g=m.value}g.replaceWith(a)}var b=function(t){return h.callExpression(e.file.addHelper("possibleConstructorReturn"),[a].concat(t||[]))},v=r.get("body");v.length&&!v.pop().isReturnStatement()&&r.pushContainer("body",h.returnStatement(n?a:b()));var x=this.superReturns,E=Array.isArray(x),A=0;for(x=E?x:(0,s.default)(x);;){var D;if(E){if(A>=x.length)break;D=x[A++]}else{if((A=x.next()).done)break;D=A.value}var S=D;if(S.node.argument){var C=S.scope.generateDeclaredUidIdentifier("ret");S.get("argument").replaceWithMultiple([h.assignmentExpression("=",C,S.node.argument),b(C)])}else S.get("argument").replaceWith(b())}}},e.prototype.pushMethod=function(e,t){var r=t?t.scope:this.scope;"method"===e.kind&&this._processMethod(e,r)||this.pushToMap(e,!1,null,r)},e.prototype._processMethod=function(){return!1},e.prototype.pushConstructor=function(e,t,r){this.bareSupers=e.bareSupers,this.superReturns=e.returns,r.scope.hasOwnBinding(this.classRef.name)&&r.scope.rename(this.classRef.name);var n=this.constructor;this.userConstructorPath=r,this.userConstructor=t,this.hasConstructor=!0,h.inheritsComments(n,t),n._ignoreUserWhitespace=!0,n.params=t.params,h.inherits(n.body,t.body),n.body.directives=t.body.directives,this._pushConstructor()},e.prototype._pushConstructor=function(){this.pushedConstructor||(this.pushedConstructor=!0,(this.hasInstanceDescriptors||this.hasStaticDescriptors)&&this.pushDescriptors(),this.body.push(this.constructor),this.pushInherits())},e.prototype.pushInherits=function(){this.isDerived&&!this.pushedInherits&&(this.pushedInherits=!0,this.body.unshift(h.expressionStatement(h.callExpression(this.file.addHelper("inherits"),[this.classRef,this.superName]))))},e}();r.default=g,t.exports=r.default},{"babel-helper-define-map":103,"babel-helper-optimise-call-expression":106,"babel-helper-replace-supers":107,"babel-runtime/core-js/get-iterator":120,"babel-runtime/helpers/classCallCheck":134,"babel-template":139,"babel-traverse":143,"babel-types":180}],119:[function(e,t,r){"use strict";r.__esModule=!0,r.default=function(e){function t(e){var t=e.node,r=e.scope,n=[],i=t.right;if(!a.isIdentifier(i)||!r.hasBinding(i.name)){var s=r.generateUidIdentifier("arr");n.push(a.variableDeclaration("var",[a.variableDeclarator(s,i)])),i=s}var u=r.generateUidIdentifier("i"),l=o({BODY:t.body,KEY:u,ARR:i});a.inherits(l,t),a.ensureBlock(l);var c=a.memberExpression(i,u,!0),p=t.left;return a.isVariableDeclaration(p)?(p.declarations[0].init=c,l.body.body.unshift(p)):l.body.body.unshift(a.expressionStatement(a.assignmentExpression("=",p,c))),e.parentPath.isLabeledStatement()&&(l=a.labeledStatement(e.parentPath.node.label,l)),n.push(l),n}function r(e,t){var r=e.node,n=e.scope,s=e.parent,o=r.left,l=void 0,c=void 0;if(a.isIdentifier(o)||a.isPattern(o)||a.isMemberExpression(o))c=o;else{if(!a.isVariableDeclaration(o))throw t.buildCodeFrameError(o,i.get("unknownForHead",o.type));c=n.generateUidIdentifier("ref"),l=a.variableDeclaration(o.kind,[a.variableDeclarator(o.declarations[0].id,c)])}var p=n.generateUidIdentifier("iterator"),h=n.generateUidIdentifier("isArray"),f=u({LOOP_OBJECT:p,IS_ARRAY:h,OBJECT:r.right,INDEX:n.generateUidIdentifier("i"),ID:c});l||f.body.body.shift();var d=a.isLabeledStatement(s),m=void 0;return d&&(m=a.labeledStatement(s.label,f)),{replaceParent:d,declar:l,node:m||f,loop:f}}function n(e,t){var r=e.node,n=e.scope,s=e.parent,o=r.left,u=void 0,c=n.generateUidIdentifier("step"),p=a.memberExpression(c,a.identifier("value"));if(a.isIdentifier(o)||a.isPattern(o)||a.isMemberExpression(o))u=a.expressionStatement(a.assignmentExpression("=",o,p));else{if(!a.isVariableDeclaration(o))throw t.buildCodeFrameError(o,i.get("unknownForHead",o.type));u=a.variableDeclaration(o.kind,[a.variableDeclarator(o.declarations[0].id,p)])}var h=n.generateUidIdentifier("iterator"),f=l({ITERATOR_HAD_ERROR_KEY:n.generateUidIdentifier("didIteratorError"),ITERATOR_COMPLETION:n.generateUidIdentifier("iteratorNormalCompletion"),ITERATOR_ERROR_KEY:n.generateUidIdentifier("iteratorError"),ITERATOR_KEY:h,STEP_KEY:c,OBJECT:r.right,BODY:null}),d=a.isLabeledStatement(s),m=f[3].block.body,y=m[0];return d&&(m[0]=a.labeledStatement(s.label,y)),{replaceParent:d,declar:u,loop:y,node:f}}var i=e.messages,s=e.template,a=e.types,o=s("\n for (var KEY = 0; KEY < ARR.length; KEY++) BODY;\n "),u=s("\n for (var LOOP_OBJECT = OBJECT,\n IS_ARRAY = Array.isArray(LOOP_OBJECT),\n INDEX = 0,\n LOOP_OBJECT = IS_ARRAY ? LOOP_OBJECT : LOOP_OBJECT[Symbol.iterator]();;) {\n var ID;\n if (IS_ARRAY) {\n if (INDEX >= LOOP_OBJECT.length) break;\n ID = LOOP_OBJECT[INDEX++];\n } else {\n INDEX = LOOP_OBJECT.next();\n if (INDEX.done) break;\n ID = INDEX.value;\n }\n }\n "),l=s("\n var ITERATOR_COMPLETION = true;\n var ITERATOR_HAD_ERROR_KEY = false;\n var ITERATOR_ERROR_KEY = undefined;\n try {\n for (var ITERATOR_KEY = OBJECT[Symbol.iterator](), STEP_KEY; !(ITERATOR_COMPLETION = (STEP_KEY = ITERATOR_KEY.next()).done); ITERATOR_COMPLETION = true) {\n }\n } catch (err) {\n ITERATOR_HAD_ERROR_KEY = true;\n ITERATOR_ERROR_KEY = err;\n } finally {\n try {\n if (!ITERATOR_COMPLETION && ITERATOR_KEY.return) {\n ITERATOR_KEY.return();\n }\n } finally {\n if (ITERATOR_HAD_ERROR_KEY) {\n throw ITERATOR_ERROR_KEY;\n }\n }\n }\n ");return{visitor:{ForOfStatement:function(e,i){if(e.get("right").isArrayExpression())return e.parentPath.isLabeledStatement()?e.parentPath.replaceWithMultiple(t(e)):e.replaceWithMultiple(t(e));var s=n;i.opts.loose&&(s=r);var o=e.node,u=s(e,i),l=u.declar,c=u.loop,p=c.body;e.ensureBlock(),l&&p.body.push(l),p.body=p.body.concat(o.body.body),a.inherits(c,o),a.inherits(c.body,o.body),u.replaceParent?(e.parentPath.replaceWithMultiple(u.node),e.remove()):e.replaceWithMultiple(u.node)}}}},t.exports=r.default},{}],120:[function(e,t,r){t.exports={default:e("core-js/library/fn/get-iterator"),__esModule:!0}},{"core-js/library/fn/get-iterator":196}],121:[function(e,t,r){t.exports={default:e("core-js/library/fn/json/stringify"),__esModule:!0}},{"core-js/library/fn/json/stringify":197}],122:[function(e,t,r){t.exports={default:e("core-js/library/fn/map"),__esModule:!0}},{"core-js/library/fn/map":198}],123:[function(e,t,r){t.exports={default:e("core-js/library/fn/number/max-safe-integer"),__esModule:!0}},{"core-js/library/fn/number/max-safe-integer":199}],124:[function(e,t,r){t.exports={default:e("core-js/library/fn/object/assign"),__esModule:!0}},{"core-js/library/fn/object/assign":200}],125:[function(e,t,r){t.exports={default:e("core-js/library/fn/object/create"),__esModule:!0}},{"core-js/library/fn/object/create":201}],126:[function(e,t,r){t.exports={default:e("core-js/library/fn/object/get-own-property-symbols"),__esModule:!0}},{"core-js/library/fn/object/get-own-property-symbols":202}],127:[function(e,t,r){t.exports={default:e("core-js/library/fn/object/keys"),__esModule:!0}},{"core-js/library/fn/object/keys":203}],128:[function(e,t,r){t.exports={default:e("core-js/library/fn/object/set-prototype-of"),__esModule:!0}},{"core-js/library/fn/object/set-prototype-of":204}],129:[function(e,t,r){t.exports={default:e("core-js/library/fn/symbol"),__esModule:!0}},{"core-js/library/fn/symbol":206}],130:[function(e,t,r){t.exports={default:e("core-js/library/fn/symbol/for"),__esModule:!0}},{"core-js/library/fn/symbol/for":205}],131:[function(e,t,r){t.exports={default:e("core-js/library/fn/symbol/iterator"),__esModule:!0}},{"core-js/library/fn/symbol/iterator":207}],132:[function(e,t,r){t.exports={default:e("core-js/library/fn/weak-map"),__esModule:!0}},{"core-js/library/fn/weak-map":208}],133:[function(e,t,r){t.exports={default:e("core-js/library/fn/weak-set"),__esModule:!0}},{"core-js/library/fn/weak-set":209}],134:[function(e,t,r){"use strict";r.__esModule=!0,r.default=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}},{}],135:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}r.__esModule=!0;var i=n(e("../core-js/object/set-prototype-of")),s=n(e("../core-js/object/create")),a=n(e("../helpers/typeof"));r.default=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+(void 0===t?"undefined":(0,a.default)(t)));e.prototype=(0,s.default)(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(i.default?(0,i.default)(e,t):e.__proto__=t)}},{"../core-js/object/create":125,"../core-js/object/set-prototype-of":128,"../helpers/typeof":138}],136:[function(e,t,r){"use strict";r.__esModule=!0,r.default=function(e,t){var r={};for(var n in e)t.indexOf(n)>=0||Object.prototype.hasOwnProperty.call(e,n)&&(r[n]=e[n]);return r}},{}],137:[function(e,t,r){"use strict";r.__esModule=!0;var n=function(e){return e&&e.__esModule?e:{default:e}}(e("../helpers/typeof"));r.default=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==(void 0===t?"undefined":(0,n.default)(t))&&"function"!=typeof t?e:t}},{"../helpers/typeof":138}],138:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}r.__esModule=!0;var i=n(e("../core-js/symbol/iterator")),s=n(e("../core-js/symbol")),a="function"==typeof s.default&&"symbol"==typeof i.default?function(e){return typeof e}:function(e){return e&&"function"==typeof s.default&&e.constructor===s.default&&e!==s.default.prototype?"symbol":typeof e};r.default="function"==typeof s.default&&"symbol"===a(i.default)?function(e){return void 0===e?"undefined":a(e)}:function(e){return e&&"function"==typeof s.default&&e.constructor===s.default&&e!==s.default.prototype?"symbol":void 0===e?"undefined":a(e)}},{"../core-js/symbol":129,"../core-js/symbol/iterator":131}],139:[function(e,t,r){"use strict";function n(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}function i(e){return e&&e.__esModule?e:{default:e}}r.__esModule=!0;var s=i(e("babel-runtime/core-js/symbol"));r.default=function(e,t){var r=void 0;try{throw new Error}catch(e){e.stack&&(r=e.stack.split("\n").slice(1).join("\n"))}t=(0,o.default)({allowReturnOutsideFunction:!0,allowSuperOutsideMethod:!0,preserveComments:!1},t);var n=function(){var i=void 0;try{i=c.parse(e,t),i=l.default.removeProperties(i,{preserveComments:t.preserveComments}),l.default.cheap(i,function(e){e[h]=!0})}catch(e){throw e.stack=e.stack+"from\n"+r,e}return n=function(){return i},i};return function(){for(var e=arguments.length,t=Array(e),r=0;r1?r.body:r.body[0]}(n(),t)}};var a=i(e("lodash/cloneDeep")),o=i(e("lodash/assign")),u=i(e("lodash/has")),l=i(e("babel-traverse")),c=n(e("babylon")),p=n(e("babel-types")),h="_fromTemplate",f=(0,s.default)(),d={noScope:!0,enter:function(e,t){var r=e.node;if(r[f])return e.skip();p.isExpressionStatement(r)&&(r=r.expression);var n=void 0;if(p.isIdentifier(r)&&r[h])if((0,u.default)(t[0],r.name))n=t[0][r.name];else if("$"===r.name[0]){var i=+r.name.slice(1);t[i]&&(n=t[i])}null===n&&e.remove(),n&&(n[f]=!0,e.replaceInline(n))},exit:function(e){var t=e.node;t.loc||l.default.clearNode(t)}};t.exports=r.default},{"babel-runtime/core-js/symbol":129,"babel-traverse":143,"babel-types":180,babylon:188,"lodash/assign":488,"lodash/cloneDeep":492,"lodash/has":504}],140:[function(e,t,r){"use strict";function n(){r.path=new s.default}function i(){r.scope=new s.default}r.__esModule=!0,r.scope=r.path=void 0;var s=function(e){return e&&e.__esModule?e:{default:e}}(e("babel-runtime/core-js/weak-map"));r.clear=function(){n(),i()},r.clearPath=n,r.clearScope=i;r.path=new s.default,r.scope=new s.default},{"babel-runtime/core-js/weak-map":132}],141:[function(e,t,r){(function(n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}r.__esModule=!0;var s=i(e("babel-runtime/core-js/get-iterator")),a=i(e("babel-runtime/helpers/classCallCheck")),o=i(e("./path")),u=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(e("babel-types")),l="test"===n.env.NODE_ENV,c=function(){function e(t,r,n,i){(0,a.default)(this,e),this.queue=null,this.parentPath=i,this.scope=t,this.state=n,this.opts=r}return e.prototype.shouldVisit=function(e){var t=this.opts;if(t.enter||t.exit)return!0;if(t[e.type])return!0;var r=u.VISITOR_KEYS[e.type];if(!r||!r.length)return!1;var n=r,i=Array.isArray(n),a=0;for(n=i?n:(0,s.default)(n);;){var o;if(i){if(a>=n.length)break;o=n[a++]}else{if((a=n.next()).done)break;o=a.value}if(e[o])return!0}return!1},e.prototype.create=function(e,t,r,n){return o.default.get({parentPath:this.parentPath,parent:e,container:t,key:r,listKey:n})},e.prototype.maybeQueue=function(e,t){if(this.trap)throw new Error("Infinite cycle detected");this.queue&&(t?this.queue.push(e):this.priorityQueue.push(e))},e.prototype.visitMultiple=function(e,t,r){if(0===e.length)return!1;for(var n=[],i=0;i=n.length)break;o=n[a++]}else{if((a=n.next()).done)break;o=a.value}var u=o;if(u.resync(),0!==u.contexts.length&&u.contexts[u.contexts.length-1]===this||u.pushContext(this),null!==u.key&&(l&&e.length>=1e4&&(this.trap=!0),!(t.indexOf(u.node)>=0))){if(t.push(u.node),u.visit()){r=!0;break}if(this.priorityQueue.length&&(r=this.visitQueue(this.priorityQueue),this.priorityQueue=[],this.queue=e,r))break}}var c=e,p=Array.isArray(c),h=0;for(c=p?c:(0,s.default)(c);;){var f;if(p){if(h>=c.length)break;f=c[h++]}else{if((h=c.next()).done)break;f=h.value}f.popContext()}return this.queue=null,r},e.prototype.visit=function(e,t){var r=e[t];return!!r&&(Array.isArray(r)?this.visitMultiple(r,e,t):this.visitSingle(e,t))},e}();r.default=c,t.exports=r.default}).call(this,e("_process"))},{"./path":150,_process:550,"babel-runtime/core-js/get-iterator":120,"babel-runtime/helpers/classCallCheck":134,"babel-types":180}],142:[function(e,t,r){"use strict";r.__esModule=!0;var n=function(e){return e&&e.__esModule?e:{default:e}}(e("babel-runtime/helpers/classCallCheck"));r.default=function e(t,r){(0,n.default)(this,e),this.file=t,this.options=r},t.exports=r.default},{"babel-runtime/helpers/classCallCheck":134}],143:[function(e,t,r){"use strict";function n(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}function i(e){return e&&e.__esModule?e:{default:e}}function s(e,t,r,n,i){if(e){if(t||(t={}),!t.noScope&&!r&&"Program"!==e.type&&"File"!==e.type)throw new Error(f.get("traverseNeedsParent",e.type));h.explode(t),s.node(e,t,r,n,i)}}function a(e,t){e.node.type===t.type&&(t.has=!0,e.stop())}r.__esModule=!0,r.visitors=r.Hub=r.Scope=r.NodePath=void 0;var o=i(e("babel-runtime/core-js/get-iterator")),u=e("./path");Object.defineProperty(r,"NodePath",{enumerable:!0,get:function(){return i(u).default}});var l=e("./scope");Object.defineProperty(r,"Scope",{enumerable:!0,get:function(){return i(l).default}});var c=e("./hub");Object.defineProperty(r,"Hub",{enumerable:!0,get:function(){return i(c).default}}),r.default=s;var p=i(e("./context")),h=n(e("./visitors")),f=n(e("babel-messages")),d=i(e("lodash/includes")),m=n(e("babel-types")),y=n(e("./cache"));r.visitors=h,s.visitors=h,s.verify=h.verify,s.explode=h.explode,s.NodePath=e("./path"),s.Scope=e("./scope"),s.Hub=e("./hub"),s.cheap=function(e,t){return m.traverseFast(e,t)},s.node=function(e,t,r,n,i,s){var a=m.VISITOR_KEYS[e.type];if(a){var u=new p.default(r,t,n,i),l=a,c=Array.isArray(l),h=0;for(l=c?l:(0,o.default)(l);;){var f;if(c){if(h>=l.length)break;f=l[h++]}else{if((h=l.next()).done)break;f=h.value}var d=f;if((!s||!s[d])&&u.visit(e,d))return}}},s.clearNode=function(e,t){m.removeProperties(e,t),y.path.delete(e)},s.removeProperties=function(e,t){return m.traverseFast(e,s.clearNode,t),e},s.hasType=function(e,t,r,n){if((0,d.default)(n,e.type))return!1;if(e.type===r)return!0;var i={has:!1,type:r};return s(e,{blacklist:n,enter:a},t,i),i.has},(s.clearCache=function(){y.clear()}).clearPath=y.clearPath,s.clearCache.clearScope=y.clearScope,s.copyCache=function(e,t){y.path.has(e)&&y.path.set(t,y.path.get(e))}},{"./cache":140,"./context":141,"./hub":142,"./path":150,"./scope":162,"./visitors":164,"babel-messages":110,"babel-runtime/core-js/get-iterator":120,"babel-types":180,"lodash/includes":507}],144:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}r.__esModule=!0;var i=n(e("babel-runtime/core-js/get-iterator"));r.findParent=function(e){for(var t=this;t=t.parentPath;)if(e(t))return t;return null},r.find=function(e){var t=this;do{if(e(t))return t}while(t=t.parentPath);return null},r.getFunctionParent=function(){return this.findParent(function(e){return e.isFunction()||e.isProgram()})},r.getStatementParent=function(){var e=this;do{if(Array.isArray(e.container))return e}while(e=e.parentPath)},r.getEarliestCommonAncestorFrom=function(e){return this.getDeepestCommonAncestorFrom(e,function(e,t,r){var n=void 0,a=s.VISITOR_KEYS[e.type],o=r,u=Array.isArray(o),l=0;for(o=u?o:(0,i.default)(o);;){var c;if(u){if(l>=o.length)break;c=o[l++]}else{if((l=o.next()).done)break;c=l.value}var p=c[t+1];n?p.listKey&&n.listKey===p.listKey&&p.keya.indexOf(p.parentKey)&&(n=p):n=p}return n})},r.getDeepestCommonAncestorFrom=function(e,t){var r=this;if(!e.length)return this;if(1===e.length)return e[0];var n=1/0,s=void 0,a=void 0,o=e.map(function(e){var t=[];do{t.unshift(e)}while((e=e.parentPath)&&e!==r);return t.length=p.length)break;d=p[f++]}else{if((f=p.next()).done)break;d=f.value}if(d[l]!==c)break e}s=l,a=c}if(a)return t?t(a,s,o):a;throw new Error("Couldn't find intersection")},r.getAncestry=function(){var e=this,t=[];do{t.push(e)}while(e=e.parentPath);return t},r.isAncestor=function(e){return e.isDescendant(this)},r.isDescendant=function(e){return!!this.findParent(function(t){return t===e})},r.inType=function(){for(var e=this;e;){var t=arguments,r=Array.isArray(t),n=0;for(t=r?t:(0,i.default)(t);;){var s;if(r){if(n>=t.length)break;s=t[n++]}else{if((n=t.next()).done)break;s=n.value}var a=s;if(e.node.type===a)return!0}e=e.parentPath}return!1},r.inShadow=function(e){var t=this.isFunction()?this:this.findParent(function(e){return e.isFunction()});if(t){if(t.isFunctionExpression()||t.isFunctionDeclaration()){var r=t.node.shadow;if(r&&(!e||!1!==r[e]))return t}else if(t.isArrowFunctionExpression())return t;return null}};var s=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(e("babel-types"));n(e("./index"))},{"./index":150,"babel-runtime/core-js/get-iterator":120,"babel-types":180}],145:[function(e,t,r){"use strict";r.__esModule=!0,r.shareCommentsWithSiblings=function(){if("string"!=typeof this.key){var e=this.node;if(e){var t=e.trailingComments,r=e.leadingComments;if(t||r){var n=this.getSibling(this.key-1),i=this.getSibling(this.key+1);n.node||(n=i),i.node||(i=n),n.addComments("trailing",r),i.addComments("leading",t)}}}},r.addComment=function(e,t,r){this.addComments(e,[{type:r?"CommentLine":"CommentBlock",value:t}])},r.addComments=function(e,t){if(t){var r=this.node;if(r){var n=e+"Comments";r[n]?r[n]=r[n].concat(t):r[n]=t}}}},{}],146:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}r.__esModule=!0;var i=n(e("babel-runtime/core-js/get-iterator"));r.call=function(e){var t=this.opts;return this.debug(function(){return e}),!(!this.node||!this._call(t[e]))||!!this.node&&this._call(t[this.node.type]&&t[this.node.type][e])},r._call=function(e){if(!e)return!1;var t=e,r=Array.isArray(t),n=0;for(t=r?t:(0,i.default)(t);;){var s;if(r){if(n>=t.length)break;s=t[n++]}else{if((n=t.next()).done)break;s=n.value}var a=s;if(a){var o=this.node;if(!o)return!0;if(a.call(this.state,this,this.state))throw new Error("Unexpected return value from visitor method "+a);if(this.node!==o)return!0;if(this.shouldStop||this.shouldSkip||this.removed)return!0}}return!1},r.isBlacklisted=function(){var e=this.opts.blacklist;return e&&e.indexOf(this.node.type)>-1},r.visit=function(){return!!this.node&&!this.isBlacklisted()&&(!this.opts.shouldSkip||!this.opts.shouldSkip(this))&&(this.call("enter")||this.shouldSkip?(this.debug(function(){return"Skip..."}),this.shouldStop):(this.debug(function(){return"Recursing into..."}),s.default.node(this.node,this.opts,this.scope,this.state,this,this.skipKeys),this.call("exit"),this.shouldStop))},r.skip=function(){this.shouldSkip=!0},r.skipKey=function(e){this.skipKeys[e]=!0},r.stop=function(){this.shouldStop=!0,this.shouldSkip=!0},r.setScope=function(){if(!this.opts||!this.opts.noScope){var e=this.context&&this.context.scope;if(!e)for(var t=this.parentPath;t&&!e;){if(t.opts&&t.opts.noScope)return;e=t.scope,t=t.parentPath}this.scope=this.getScope(e),this.scope&&this.scope.init()}},r.setContext=function(e){return this.shouldSkip=!1,this.shouldStop=!1,this.removed=!1,this.skipKeys={},e&&(this.context=e,this.state=e.state,this.opts=e.opts),this.setScope(),this},r.resync=function(){this.removed||(this._resyncParent(),this._resyncList(),this._resyncKey())},r._resyncParent=function(){this.parentPath&&(this.parent=this.parentPath.node)},r._resyncKey=function(){if(this.container&&this.node!==this.container[this.key]){if(Array.isArray(this.container)){for(var e=0;e0&&void 0!==arguments[0]?arguments[0]:this;if(!e.removed){var t=this.contexts,r=Array.isArray(t),n=0;for(t=r?t:(0,i.default)(t);;){var s;if(r){if(n>=t.length)break;s=t[n++]}else{if((n=t.next()).done)break;s=n.value}s.maybeQueue(e)}}},r._getQueueContexts=function(){for(var e=this,t=this.contexts;!t.length;)t=(e=e.parentPath).contexts;return t};var s=n(e("../index"))},{"../index":143,"babel-runtime/core-js/get-iterator":120}],147:[function(e,t,r){"use strict";r.__esModule=!0,r.toComputedKey=function(){var e=this.node,t=void 0;if(this.isMemberExpression())t=e.property;else{if(!this.isProperty()&&!this.isMethod())throw new ReferenceError("todo");t=e.key}return e.computed||n.isIdentifier(t)&&(t=n.stringLiteral(t.name)),t},r.ensureBlock=function(){return n.ensureBlock(this.node)},r.arrowFunctionToShadowed=function(){if(this.isArrowFunctionExpression()){this.ensureBlock();var e=this.node;e.expression=!1,e.type="FunctionExpression",e.shadow=e.shadow||!0}};var n=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(e("babel-types"))},{"babel-types":180}],148:[function(e,t,r){(function(t){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}r.__esModule=!0;var i=n(e("babel-runtime/helpers/typeof")),s=n(e("babel-runtime/core-js/get-iterator")),a=n(e("babel-runtime/core-js/map"));r.evaluateTruthy=function(){var e=this.evaluate();if(e.confident)return!!e.value},r.evaluate=function(){function e(e){n&&(l=e,n=!1)}function r(a){var l=a.node;if(c.has(l)){var p=c.get(l);return p.resolved?p.value:void e(a)}var h={resolved:!1};c.set(l,h);var f=function(a){if(n){var l=a.node;if(a.isSequenceExpression()){var c=a.get("expressions");return r(c[c.length-1])}if(a.isStringLiteral()||a.isNumericLiteral()||a.isBooleanLiteral())return l.value;if(a.isNullLiteral())return null;if(a.isTemplateLiteral()){for(var p="",h=0,f=a.get("expressions"),d=l.quasis,m=Array.isArray(d),y=0,d=m?d:(0,s.default)(d);;){var g;if(m){if(y>=d.length)break;g=d[y++]}else{if((y=d.next()).done)break;g=y.value}var b=g;if(!n)break;p+=b.value.cooked;var v=f[h++];v&&(p+=String(r(v)))}if(!n)return;return p}if(a.isConditionalExpression()){var x=r(a.get("test"));if(!n)return;return r(x?a.get("consequent"):a.get("alternate"))}if(a.isExpressionWrapper())return r(a.get("expression"));if(a.isMemberExpression()&&!a.parentPath.isCallExpression({callee:l})){var E=a.get("property"),A=a.get("object");if(A.isLiteral()&&E.isIdentifier()){var D=A.node.value,S=void 0===D?"undefined":(0,i.default)(D);if("number"===S||"string"===S)return D[E.node.name]}}if(a.isReferencedIdentifier()){var C=a.scope.getBinding(l.name);if(C&&C.constantViolations.length>0)return e(C.path);if(C&&a.node.start=P.length)break;N=P[O++]}else{if((O=P.next()).done)break;N=O.value}var j=N;if(!(j=j.evaluate()).confident)return e(j);F.push(j.value)}return F}if(a.isObjectExpression()){for(var I={},L=a.get("properties"),M=L,R=Array.isArray(M),V=0,M=R?M:(0,s.default)(M);;){var U;if(R){if(V>=M.length)break;U=M[V++]}else{if((V=M.next()).done)break;U=V.value}var q=U;if(q.isObjectMethod()||q.isSpreadProperty())return e(q);var G=q.get("key"),X=G;if(q.node.computed){if(!(X=X.evaluate()).confident)return e(G);X=X.value}else X=X.isIdentifier()?X.node.name:X.node.value;var J=q.get("value"),W=J.evaluate();if(!W.confident)return e(J);W=W.value,I[X]=W}return I}if(a.isLogicalExpression()){var K=n,z=r(a.get("left")),Y=n;n=K;var H=r(a.get("right")),$=n;switch(n=Y&&$,l.operator){case"||":if(z&&Y)return n=!0,z;if(!n)return;return z||H;case"&&":if((!z&&Y||!H&&$)&&(n=!0),!n)return;return z&&H}}if(a.isBinaryExpression()){var Q=r(a.get("left"));if(!n)return;var Z=r(a.get("right"));if(!n)return;switch(l.operator){case"-":return Q-Z;case"+":return Q+Z;case"/":return Q/Z;case"*":return Q*Z;case"%":return Q%Z;case"**":return Math.pow(Q,Z);case"<":return Q":return Q>Z;case"<=":return Q<=Z;case">=":return Q>=Z;case"==":return Q==Z;case"!=":return Q!=Z;case"===":return Q===Z;case"!==":return Q!==Z;case"|":return Q|Z;case"&":return Q&Z;case"^":return Q^Z;case"<<":return Q<>":return Q>>Z;case">>>":return Q>>>Z}}if(a.isCallExpression()){var ee=a.get("callee"),te=void 0,re=void 0;if(ee.isIdentifier()&&!a.scope.getBinding(ee.node.name,!0)&&o.indexOf(ee.node.name)>=0&&(re=t[l.callee.name]),ee.isMemberExpression()){var ne=ee.get("object"),ie=ee.get("property");if(ne.isIdentifier()&&ie.isIdentifier()&&o.indexOf(ne.node.name)>=0&&u.indexOf(ie.node.name)<0&&(te=t[ne.node.name],re=te[ie.node.name]),ne.isLiteral()&&ie.isIdentifier()){var se=(0,i.default)(ne.node.value);"string"!==se&&"number"!==se||(te=ne.node.value,re=te[ie.node.name])}}if(re){var ae=a.get("arguments").map(r);if(!n)return;return re.apply(te,ae)}}e(a)}}(a);return n&&(h.resolved=!0,h.value=f),f}var n=!0,l=void 0,c=new a.default,p=r(this);return n||(p=void 0),{confident:n,deopt:l,value:p}};var o=["String","Number","Math"],u=["random"]}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"babel-runtime/core-js/get-iterator":120,"babel-runtime/core-js/map":122,"babel-runtime/helpers/typeof":138}],149:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}r.__esModule=!0;var i=n(e("babel-runtime/core-js/object/create")),s=n(e("babel-runtime/core-js/get-iterator"));r.getStatementParent=function(){var e=this;do{if(!e.parentPath||Array.isArray(e.container)&&e.isStatement())break;e=e.parentPath}while(e);if(e&&(e.isProgram()||e.isFile()))throw new Error("File/Program node, we can't possibly find a statement parent to this");return e},r.getOpposite=function(){return"left"===this.key?this.getSibling("right"):"right"===this.key?this.getSibling("left"):void 0},r.getCompletionRecords=function(){var e=[],t=function(t){t&&(e=e.concat(t.getCompletionRecords()))};if(this.isIfStatement())t(this.get("consequent")),t(this.get("alternate"));else if(this.isDoExpression()||this.isFor()||this.isWhile())t(this.get("body"));else if(this.isProgram()||this.isBlockStatement())t(this.get("body").pop());else{if(this.isFunction())return this.get("body").getCompletionRecords();this.isTryStatement()?(t(this.get("block")),t(this.get("handler")),t(this.get("finalizer"))):e.push(this)}return e},r.getSibling=function(e){return a.default.get({parentPath:this.parentPath,parent:this.parent,container:this.container,listKey:this.listKey,key:e})},r.getPrevSibling=function(){return this.getSibling(this.key-1)},r.getNextSibling=function(){return this.getSibling(this.key+1)},r.getAllNextSiblings=function(){for(var e=this.key,t=this.getSibling(++e),r=[];t.node;)r.push(t),t=this.getSibling(++e);return r},r.getAllPrevSiblings=function(){for(var e=this.key,t=this.getSibling(--e),r=[];t.node;)r.push(t),t=this.getSibling(--e);return r},r.get=function(e,t){!0===t&&(t=this.context);var r=e.split(".");return 1===r.length?this._getKey(e,t):this._getPattern(r,t)},r._getKey=function(e,t){var r=this,n=this.node,i=n[e];return Array.isArray(i)?i.map(function(s,o){return a.default.get({listKey:e,parentPath:r,parent:n,container:i,key:o}).setContext(t)}):a.default.get({parentPath:this,parent:n,container:n,key:e}).setContext(t)},r._getPattern=function(e,t){var r=this,n=e,i=Array.isArray(n),a=0;for(n=i?n:(0,s.default)(n);;){var o;if(i){if(a>=n.length)break;o=n[a++]}else{if((a=n.next()).done)break;o=a.value}var u=o;r="."===u?r.parentPath:Array.isArray(r)?r[u]:r.get(u,t)}return r},r.getBindingIdentifiers=function(e){return o.getBindingIdentifiers(this.node,e)},r.getOuterBindingIdentifiers=function(e){return o.getOuterBindingIdentifiers(this.node,e)},r.getBindingIdentifierPaths=function(){for(var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=[].concat(this),n=(0,i.default)(null);r.length;){var s=r.shift();if(s&&s.node){var a=o.getBindingIdentifiers.keys[s.node.type];if(s.isIdentifier())e?(n[s.node.name]=n[s.node.name]||[]).push(s):n[s.node.name]=s;else if(s.isExportDeclaration()){var u=s.get("declaration");u.isDeclaration()&&r.push(u)}else{if(t){if(s.isFunctionDeclaration()){r.push(s.get("id"));continue}if(s.isFunctionExpression())continue}if(a)for(var l=0;l1&&void 0!==arguments[1]?arguments[1]:SyntaxError;return this.hub.file.buildCodeFrameError(this.node,e,t)},e.prototype.traverse=function(e,t){(0,c.default)(this.node,e,this.scope,t,this)},e.prototype.mark=function(e,t){this.hub.file.metadata.marked.push({type:e,message:t,loc:this.node.loc})},e.prototype.set=function(e,t){f.validate(this.node,e,t),this.node[e]=t},e.prototype.getPathLocation=function(){var e=[],t=this;do{var r=t.key;t.inList&&(r=t.listKey+"["+r+"]"),e.unshift(r)}while(t=t.parentPath);return e.join(".")},e.prototype.debug=function(e){m.enabled&&m(this.getPathLocation()+" "+this.type+": "+e())},e}();r.default=y,(0,p.default)(y.prototype,e("./ancestry")),(0,p.default)(y.prototype,e("./inference")),(0,p.default)(y.prototype,e("./replacement")),(0,p.default)(y.prototype,e("./evaluation")),(0,p.default)(y.prototype,e("./conversion")),(0,p.default)(y.prototype,e("./introspection")),(0,p.default)(y.prototype,e("./context")),(0,p.default)(y.prototype,e("./removal")),(0,p.default)(y.prototype,e("./modification")),(0,p.default)(y.prototype,e("./family")),(0,p.default)(y.prototype,e("./comments"));var g=function(){if(v){if(x>=b.length)return"break";E=b[x++]}else{if((x=b.next()).done)return"break";E=x.value}var e=E,t="is"+e;y.prototype[t]=function(e){return f[t](this.node,e)},y.prototype["assert"+e]=function(r){if(!this[t](r))throw new TypeError("Expected node path of type "+e)}},b=f.TYPES,v=Array.isArray(b),x=0;for(b=v?b:(0,s.default)(b);;){var E;if("break"===g())break}var A=function(e){if("_"===e[0])return"continue";f.TYPES.indexOf(e)<0&&f.TYPES.push(e);var t=o[e];y.prototype["is"+e]=function(e){return t.checkPath(this,e)}};for(var D in o){A(D)}t.exports=r.default},{"../cache":140,"../index":143,"../scope":162,"./ancestry":144,"./comments":145,"./context":146,"./conversion":147,"./evaluation":148,"./family":149,"./inference":151,"./introspection":154,"./lib/virtual-types":157,"./modification":158,"./removal":159,"./replacement":160,"babel-runtime/core-js/get-iterator":120,"babel-runtime/helpers/classCallCheck":134,"babel-types":180,debug:165,invariant:318,"lodash/assign":488}],151:[function(e,t,r){"use strict";function n(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}function i(e,t,r){if("string"===e)return o.isStringTypeAnnotation(t);if("number"===e)return o.isNumberTypeAnnotation(t);if("boolean"===e)return o.isBooleanTypeAnnotation(t);if("any"===e)return o.isAnyTypeAnnotation(t);if("mixed"===e)return o.isMixedTypeAnnotation(t);if("empty"===e)return o.isEmptyTypeAnnotation(t);if("void"===e)return o.isVoidTypeAnnotation(t);if(r)return!1;throw new Error("Unknown base type "+e)}r.__esModule=!0;var s=function(e){return e&&e.__esModule?e:{default:e}}(e("babel-runtime/core-js/get-iterator"));r.getTypeAnnotation=function(){if(this.typeAnnotation)return this.typeAnnotation;var e=this._getTypeAnnotation()||o.anyTypeAnnotation();return o.isTypeAnnotation(e)&&(e=e.typeAnnotation),this.typeAnnotation=e},r._getTypeAnnotation=function(){var e=this.node;if(e){if(e.typeAnnotation)return e.typeAnnotation;var t=a[e.type];return t?t.call(this,e):(t=a[this.parentPath.type])&&t.validParent?this.parentPath.getTypeAnnotation():void 0}if("init"===this.key&&this.parentPath.isVariableDeclarator()){var r=this.parentPath.parentPath,n=r.parentPath;return"left"===r.key&&n.isForInStatement()?o.stringTypeAnnotation():"left"===r.key&&n.isForOfStatement()?o.anyTypeAnnotation():o.voidTypeAnnotation()}},r.isBaseType=function(e,t){return i(e,this.getTypeAnnotation(),t)},r.couldBeBaseType=function(e){var t=this.getTypeAnnotation();if(o.isAnyTypeAnnotation(t))return!0;if(o.isUnionTypeAnnotation(t)){var r=t.types,n=Array.isArray(r),a=0;for(r=n?r:(0,s.default)(r);;){var u;if(n){if(a>=r.length)break;u=r[a++]}else{if((a=r.next()).done)break;u=a.value}var l=u;if(o.isAnyTypeAnnotation(l)||i(e,l,!0))return!0}return!1}return i(e,t,!0)},r.baseTypeStrictlyMatches=function(e){var t=this.getTypeAnnotation();if(e=e.getTypeAnnotation(),!o.isAnyTypeAnnotation(t)&&o.isFlowBaseAnnotation(t))return e.type===t.type},r.isGenericType=function(e){var t=this.getTypeAnnotation();return o.isGenericTypeAnnotation(t)&&o.isIdentifier(t.id,{name:e})};var a=n(e("./inferers")),o=n(e("babel-types"))},{"./inferers":153,"babel-runtime/core-js/get-iterator":120,"babel-types":180}],152:[function(e,t,r){"use strict";function n(e,t,r){var n=e.constantViolations.slice();return n.unshift(e.path),n.filter(function(e){var n=(e=e.resolve())._guessExecutionStatusRelativeTo(t);return r&&"function"===n&&r.push(e),"before"===n})}function i(e,t){var r=t.node.operator,n=t.get("right").resolve(),i=t.get("left").resolve(),s=void 0;if(i.isIdentifier({name:e})?s=n:n.isIdentifier({name:e})&&(s=i),s)return"==="===r?s.getTypeAnnotation():o.BOOLEAN_NUMBER_BINARY_OPERATORS.indexOf(r)>=0?o.numberTypeAnnotation():void 0;if("==="===r){var a=void 0,u=void 0;if(i.isUnaryExpression({operator:"typeof"})?(a=i,u=n):n.isUnaryExpression({operator:"typeof"})&&(a=n,u=i),(u||a)&&(u=u.resolve()).isLiteral()){if("string"==typeof u.node.value&&a.get("argument").isIdentifier({name:e}))return o.createTypeAnnotationBasedOnTypeof(u.node.value)}}}function s(e,t){var r=function(e){for(var t=void 0;t=e.parentPath;){if(t.isIfStatement()||t.isConditionalExpression())return"test"===e.key?void 0:t;e=t}}(e);if(r){var n=[r.get("test")],a=[];do{var u=n.shift().resolve();if(u.isLogicalExpression()&&(n.push(u.get("left")),n.push(u.get("right"))),u.isBinaryExpression()){var l=i(t,u);l&&a.push(l)}}while(n.length);return a.length?{typeAnnotation:o.createUnionTypeAnnotation(a),ifStatement:r}:s(r,t)}}r.__esModule=!0;var a=function(e){return e&&e.__esModule?e:{default:e}}(e("babel-runtime/core-js/get-iterator"));r.default=function(e){if(this.isReferenced()){var t=this.scope.getBinding(e.name);return t?t.identifier.typeAnnotation?t.identifier.typeAnnotation:function(e,t){var r=e.scope.getBinding(t),i=[];e.typeAnnotation=o.unionTypeAnnotation(i);var u=[],l=n(r,e,u),c=s(e,t);if(c){var p=n(r,c.ifStatement);l=l.filter(function(e){return p.indexOf(e)<0}),i.push(c.typeAnnotation)}if(l.length){var h=l=l.concat(u),f=Array.isArray(h),d=0;for(h=f?h:(0,a.default)(h);;){var m;if(f){if(d>=h.length)break;m=h[d++]}else{if((d=h.next()).done)break;m=d.value}var y=m;i.push(y.getTypeAnnotation())}}if(i.length)return o.createUnionTypeAnnotation(i)}(this,e.name):"undefined"===e.name?o.voidTypeAnnotation():"NaN"===e.name||"Infinity"===e.name?o.numberTypeAnnotation():void e.name}};var o=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(e("babel-types"));t.exports=r.default},{"babel-runtime/core-js/get-iterator":120,"babel-types":180}],153:[function(e,t,r){"use strict";function n(e){return e.typeAnnotation}function i(){return l.genericTypeAnnotation(l.identifier("Array"))}function s(){return i()}function a(){return l.genericTypeAnnotation(l.identifier("Function"))}function o(e){if((e=e.resolve()).isFunction()){if(e.is("async"))return e.is("generator")?l.genericTypeAnnotation(l.identifier("AsyncIterator")):l.genericTypeAnnotation(l.identifier("Promise"));if(e.node.returnType)return e.node.returnType}}r.__esModule=!0,r.ClassDeclaration=r.ClassExpression=r.FunctionDeclaration=r.ArrowFunctionExpression=r.FunctionExpression=r.Identifier=void 0;var u=e("./inferer-reference");Object.defineProperty(r,"Identifier",{enumerable:!0,get:function(){return function(e){return e&&e.__esModule?e:{default:e}}(u).default}}),r.VariableDeclarator=function(){return this.get("id").isIdentifier()?this.get("init").getTypeAnnotation():void 0},r.TypeCastExpression=n,r.NewExpression=function(e){if(this.get("callee").isIdentifier())return l.genericTypeAnnotation(e.callee)},r.TemplateLiteral=function(){return l.stringTypeAnnotation()},r.UnaryExpression=function(e){var t=e.operator;return"void"===t?l.voidTypeAnnotation():l.NUMBER_UNARY_OPERATORS.indexOf(t)>=0?l.numberTypeAnnotation():l.STRING_UNARY_OPERATORS.indexOf(t)>=0?l.stringTypeAnnotation():l.BOOLEAN_UNARY_OPERATORS.indexOf(t)>=0?l.booleanTypeAnnotation():void 0},r.BinaryExpression=function(e){var t=e.operator;if(l.NUMBER_BINARY_OPERATORS.indexOf(t)>=0)return l.numberTypeAnnotation();if(l.BOOLEAN_BINARY_OPERATORS.indexOf(t)>=0)return l.booleanTypeAnnotation();if("+"===t){var r=this.get("right"),n=this.get("left");return n.isBaseType("number")&&r.isBaseType("number")?l.numberTypeAnnotation():n.isBaseType("string")||r.isBaseType("string")?l.stringTypeAnnotation():l.unionTypeAnnotation([l.stringTypeAnnotation(),l.numberTypeAnnotation()])}},r.LogicalExpression=function(){return l.createUnionTypeAnnotation([this.get("left").getTypeAnnotation(),this.get("right").getTypeAnnotation()])},r.ConditionalExpression=function(){return l.createUnionTypeAnnotation([this.get("consequent").getTypeAnnotation(),this.get("alternate").getTypeAnnotation()])},r.SequenceExpression=function(){return this.get("expressions").pop().getTypeAnnotation()},r.AssignmentExpression=function(){return this.get("right").getTypeAnnotation()},r.UpdateExpression=function(e){var t=e.operator;if("++"===t||"--"===t)return l.numberTypeAnnotation()},r.StringLiteral=function(){return l.stringTypeAnnotation()},r.NumericLiteral=function(){return l.numberTypeAnnotation()},r.BooleanLiteral=function(){return l.booleanTypeAnnotation()},r.NullLiteral=function(){return l.nullLiteralTypeAnnotation()},r.RegExpLiteral=function(){return l.genericTypeAnnotation(l.identifier("RegExp"))},r.ObjectExpression=function(){return l.genericTypeAnnotation(l.identifier("Object"))},r.ArrayExpression=i,r.RestElement=s,r.CallExpression=function(){return o(this.get("callee"))},r.TaggedTemplateExpression=function(){return o(this.get("tag"))};var l=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(e("babel-types"));n.validParent=!0,s.validParent=!0,r.FunctionExpression=a,r.ArrowFunctionExpression=a,r.FunctionDeclaration=a,r.ClassExpression=a,r.ClassDeclaration=a},{"./inferer-reference":152,"babel-types":180}],154:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e){var t=this.node&&this.node[e];return t&&Array.isArray(t)?!!t.length:!!t}r.__esModule=!0,r.is=void 0;var s=n(e("babel-runtime/core-js/get-iterator"));r.matchesPattern=function(e,t){function r(e){var t=n[s];return"*"===t||e===t}if(!this.isMemberExpression())return!1;for(var n=e.split("."),i=[this.node],s=0;i.length;){var a=i.shift();if(t&&s===n.length)return!0;if(o.isIdentifier(a)){if(!r(a.name))return!1}else if(o.isLiteral(a)){if(!r(a.value))return!1}else{if(o.isMemberExpression(a)){if(a.computed&&!o.isLiteral(a.property))return!1;i.unshift(a.property),i.unshift(a.object);continue}if(!o.isThisExpression(a))return!1;if(!r("this"))return!1}if(++s>n.length)return!1}return s===n.length},r.has=i,r.isStatic=function(){return this.scope.isStatic(this.node)},r.isnt=function(e){return!this.has(e)},r.equals=function(e,t){return this.node[e]===t},r.isNodeType=function(e){return o.isType(this.type,e)},r.canHaveVariableDeclarationOrExpression=function(){return("init"===this.key||"left"===this.key)&&this.parentPath.isFor()},r.canSwapBetweenExpressionAndStatement=function(e){return!("body"!==this.key||!this.parentPath.isArrowFunctionExpression())&&(this.isExpression()?o.isBlockStatement(e):!!this.isBlockStatement()&&o.isExpression(e))},r.isCompletionRecord=function(e){var t=this,r=!0;do{var n=t.container;if(t.isFunction()&&!r)return!!e;if(r=!1,Array.isArray(n)&&t.key!==n.length-1)return!1}while((t=t.parentPath)&&!t.isProgram());return!0},r.isStatementOrBlock=function(){return!this.parentPath.isLabeledStatement()&&!o.isBlockStatement(this.container)&&(0,a.default)(o.STATEMENT_OR_BLOCK_KEYS,this.key)},r.referencesImport=function(e,t){if(!this.isReferencedIdentifier())return!1;var r=this.scope.getBinding(this.node.name);if(!r||"module"!==r.kind)return!1;var n=r.path,i=n.parentPath;return!(!i.isImportDeclaration()||i.node.source.value!==e||t&&(!n.isImportDefaultSpecifier()||"default"!==t)&&(!n.isImportNamespaceSpecifier()||"*"!==t)&&(!n.isImportSpecifier()||n.node.imported.name!==t))},r.getSource=function(){var e=this.node;return e.end?this.hub.file.code.slice(e.start,e.end):""},r.willIMaybeExecuteBefore=function(e){return"after"!==this._guessExecutionStatusRelativeTo(e)},r._guessExecutionStatusRelativeTo=function(e){var t=e.scope.getFunctionParent(),r=this.scope.getFunctionParent();if(t.node!==r.node){var n=this._guessExecutionStatusRelativeToDifferentFunctions(t);if(n)return n;e=t.path}var i=e.getAncestry();if(i.indexOf(this)>=0)return"after";var s=this.getAncestry(),a=void 0,u=void 0,l=void 0;for(l=0;l=0){a=c;break}}if(!a)return"before";var p=i[u-1],h=s[l-1];return p&&h?p.listKey&&p.container===h.container?p.key>h.key?"before":"after":o.VISITOR_KEYS[p.type].indexOf(p.key)>o.VISITOR_KEYS[h.type].indexOf(h.key)?"before":"after":"before"},r._guessExecutionStatusRelativeToDifferentFunctions=function(e){var t=e.path;if(t.isFunctionDeclaration()){var r=t.scope.getBinding(t.node.id.name);if(!r.references)return"before";var n=r.referencePaths,i=n,a=Array.isArray(i),o=0;for(i=a?i:(0,s.default)(i);;){var u;if(a){if(o>=i.length)break;u=i[o++]}else{if((o=i.next()).done)break;u=o.value}var l=u;if("callee"!==l.key||!l.parentPath.isCallExpression())return}var c=void 0,p=n,h=Array.isArray(p),f=0;for(p=h?p:(0,s.default)(p);;){var d;if(h){if(f>=p.length)break;d=p[f++]}else{if((f=p.next()).done)break;d=f.value}var m=d;if(!m.find(function(e){return e.node===t.node})){var y=this._guessExecutionStatusRelativeTo(m);if(c){if(c!==y)return}else c=y}}return c}},r.resolve=function(e,t){return this._resolve(e,t)||this},r._resolve=function(e,t){if(!(t&&t.indexOf(this)>=0))if((t=t||[]).push(this),this.isVariableDeclarator()){if(this.get("id").isIdentifier())return this.get("init").resolve(e,t)}else if(this.isReferencedIdentifier()){var r=this.scope.getBinding(this.node.name);if(!r)return;if(!r.constant)return;if("module"===r.kind)return;if(r.path!==this){var n=r.path.resolve(e,t);if(this.find(function(e){return e.node===n.node}))return;return n}}else{if(this.isTypeCastExpression())return this.get("expression").resolve(e,t);if(e&&this.isMemberExpression()){var i=this.toComputedKey();if(!o.isLiteral(i))return;var a=i.value,u=this.get("object").resolve(e,t);if(u.isObjectExpression()){var l=u.get("properties"),c=Array.isArray(l),p=0;for(l=c?l:(0,s.default)(l);;){var h;if(c){if(p>=l.length)break;h=l[p++]}else{if((p=l.next()).done)break;h=p.value}var f=h;if(f.isProperty()){var d=f.get("key"),m=f.isnt("computed")&&d.isIdentifier({name:a});if(m=m||d.isLiteral({value:a}))return f.get("value").resolve(e,t)}}}else if(u.isArrayExpression()&&!isNaN(+a)){var y=u.get("elements")[a];if(y)return y.resolve(e,t)}}}};var a=n(e("lodash/includes")),o=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(e("babel-types"));r.is=i},{"babel-runtime/core-js/get-iterator":120,"babel-types":180,"lodash/includes":507}],155:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}r.__esModule=!0;var i=n(e("babel-runtime/core-js/get-iterator")),s=n(e("babel-runtime/helpers/classCallCheck")),a=e("babel-types"),o=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(a),u={ReferencedIdentifier:function(e,t){if(!e.isJSXIdentifier()||!a.react.isCompatTag(e.node.name)||e.parentPath.isJSXMemberExpression()){if("this"===e.node.name){var r=e.scope;do{if(r.path.isFunction()&&!r.path.isArrowFunctionExpression())break}while(r=r.parent);r&&t.breakOnScopePaths.push(r.path)}var n=e.scope.getBinding(e.node.name);n&&n===t.scope.getBinding(e.node.name)&&(t.bindings[e.node.name]=n)}}},l=function(){function e(t,r){(0,s.default)(this,e),this.breakOnScopePaths=[],this.bindings={},this.scopes=[],this.scope=r,this.path=t,this.attachAfter=!1}return e.prototype.isCompatibleScope=function(e){for(var t in this.bindings){var r=this.bindings[t];if(!e.bindingIdentifierEquals(t,r.identifier))return!1}return!0},e.prototype.getCompatibleScopes=function(){var e=this.path.scope;do{if(!this.isCompatibleScope(e))break;if(this.scopes.push(e),this.breakOnScopePaths.indexOf(e.path)>=0)break}while(e=e.parent)},e.prototype.getAttachmentPath=function(){var e=this._getAttachmentPath();if(e){var t=e.scope;if(t.path===e&&(t=e.scope.parent),t.path.isProgram()||t.path.isFunction())for(var r in this.bindings)if(t.hasOwnBinding(r)){var n=this.bindings[r];if("param"!==n.kind&&this.getAttachmentParentForPath(n.path).key>e.key){this.attachAfter=!0,e=n.path;var s=n.constantViolations,a=Array.isArray(s),o=0;for(s=a?s:(0,i.default)(s);;){var u;if(a){if(o>=s.length)break;u=s[o++]}else{if((o=s.next()).done)break;u=o.value}var l=u;this.getAttachmentParentForPath(l).key>e.key&&(e=l)}}}return e.parentPath.isExportDeclaration()&&(e=e.parentPath),e}},e.prototype._getAttachmentPath=function(){var e=this.scopes.pop();if(e){if(e.path.isFunction()){if(this.hasOwnParamBindings(e)){if(this.scope===e)return;return e.path.get("body").get("body")[0]}return this.getNextScopeAttachmentParent()}return e.path.isProgram()?this.getNextScopeAttachmentParent():void 0}},e.prototype.getNextScopeAttachmentParent=function(){var e=this.scopes.pop();if(e)return this.getAttachmentParentForPath(e.path)},e.prototype.getAttachmentParentForPath=function(e){do{if(!e.parentPath||Array.isArray(e.container)&&e.isStatement()||e.isVariableDeclarator()&&null!==e.parentPath.node&&e.parentPath.node.declarations.length>1)return e}while(e=e.parentPath)},e.prototype.hasOwnParamBindings=function(e){for(var t in this.bindings)if(e.hasOwnBinding(t)){var r=this.bindings[t];if("param"===r.kind&&r.constant)return!0}return!1},e.prototype.run=function(){var e=this.path.node;if(!e._hoisted){e._hoisted=!0,this.path.traverse(u,this),this.getCompatibleScopes();var t=this.getAttachmentPath();if(t&&t.getFunctionParent()!==this.path.getFunctionParent()){var r=t.scope.generateUidIdentifier("ref"),n=o.variableDeclarator(r,this.path.node);t[this.attachAfter?"insertAfter":"insertBefore"]([t.isVariableDeclarator()?n:o.variableDeclaration("var",[n])]);var i=this.path.parentPath;i.isJSXElement()&&this.path.container===i.node.children&&(r=o.JSXExpressionContainer(r)),this.path.replaceWith(r)}}},e}();r.default=l,t.exports=r.default},{"babel-runtime/core-js/get-iterator":120,"babel-runtime/helpers/classCallCheck":134,"babel-types":180}],156:[function(e,t,r){"use strict";r.__esModule=!0;r.hooks=[function(e,t){if("test"===e.key&&(t.isWhile()||t.isSwitchCase())||"declaration"===e.key&&t.isExportDeclaration()||"body"===e.key&&t.isLabeledStatement()||"declarations"===e.listKey&&t.isVariableDeclaration()&&1===t.node.declarations.length||"expression"===e.key&&t.isExpressionStatement())return t.remove(),!0},function(e,t){if(t.isSequenceExpression()&&1===t.node.expressions.length)return t.replaceWith(t.node.expressions[0]),!0},function(e,t){if(t.isBinary())return"left"===e.key?t.replaceWith(t.node.right):t.replaceWith(t.node.left),!0},function(e,t){if(t.isIfStatement()&&("consequent"===e.key||"alternate"===e.key)||"body"===e.key&&(t.isLoop()||t.isArrowFunctionExpression()))return e.replaceWith({type:"BlockStatement",body:[]}),!0}]},{}],157:[function(e,t,r){"use strict";r.__esModule=!0,r.Flow=r.Pure=r.Generated=r.User=r.Var=r.BlockScoped=r.Referenced=r.Scope=r.Expression=r.Statement=r.BindingIdentifier=r.ReferencedMemberExpression=r.ReferencedIdentifier=void 0;var n=e("babel-types"),i=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(n);r.ReferencedIdentifier={types:["Identifier","JSXIdentifier"],checkPath:function(e,t){var r=e.node,s=e.parent;if(!i.isIdentifier(r,t)&&!i.isJSXMemberExpression(s,t)){if(!i.isJSXIdentifier(r,t))return!1;if(n.react.isCompatTag(r.name))return!1}return i.isReferenced(r,s)}},r.ReferencedMemberExpression={types:["MemberExpression"],checkPath:function(e){var t=e.node,r=e.parent;return i.isMemberExpression(t)&&i.isReferenced(t,r)}},r.BindingIdentifier={types:["Identifier"],checkPath:function(e){var t=e.node,r=e.parent;return i.isIdentifier(t)&&i.isBinding(t,r)}},r.Statement={types:["Statement"],checkPath:function(e){var t=e.node,r=e.parent;if(i.isStatement(t)){if(i.isVariableDeclaration(t)){if(i.isForXStatement(r,{left:t}))return!1;if(i.isForStatement(r,{init:t}))return!1}return!0}return!1}},r.Expression={types:["Expression"],checkPath:function(e){return e.isIdentifier()?e.isReferencedIdentifier():i.isExpression(e.node)}},r.Scope={types:["Scopable"],checkPath:function(e){return i.isScope(e.node,e.parent)}},r.Referenced={checkPath:function(e){return i.isReferenced(e.node,e.parent)}},r.BlockScoped={checkPath:function(e){return i.isBlockScoped(e.node)}},r.Var={types:["VariableDeclaration"],checkPath:function(e){return i.isVar(e.node)}},r.User={checkPath:function(e){return e.node&&!!e.node.loc}},r.Generated={checkPath:function(e){return!e.isUser()}},r.Pure={checkPath:function(e,t){return e.scope.isPure(e.node,t)}},r.Flow={types:["Flow","ImportDeclaration","ExportDeclaration","ImportSpecifier"],checkPath:function(e){var t=e.node;return!!i.isFlow(t)||(i.isImportDeclaration(t)?"type"===t.importKind||"typeof"===t.importKind:i.isExportDeclaration(t)?"type"===t.exportKind:!!i.isImportSpecifier(t)&&("type"===t.importKind||"typeof"===t.importKind))}}},{"babel-types":180}],158:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}r.__esModule=!0;var i=n(e("babel-runtime/helpers/typeof")),s=n(e("babel-runtime/core-js/get-iterator"));r.insertBefore=function(e){if(this._assertUnremoved(),e=this._verifyNodeList(e),this.parentPath.isExpressionStatement()||this.parentPath.isLabeledStatement())return this.parentPath.insertBefore(e);if(this.isNodeType("Expression")||this.parentPath.isForStatement()&&"init"===this.key)this.node&&e.push(this.node),this.replaceExpressionWithStatements(e);else{if(this._maybePopFromStatements(e),Array.isArray(this.container))return this._containerInsertBefore(e);if(!this.isStatementOrBlock())throw new Error("We don't know what to do with this node type. We were previously a Statement but we can't fit in here?");this.node&&e.push(this.node),this._replaceWith(l.blockStatement(e))}return[this]},r._containerInsert=function(e,t){this.updateSiblingKeys(e,t.length);for(var r=[],n=0;n=c.length)break;f=c[h++]}else{if((h=c.next()).done)break;f=h.value}var d=f;d.setScope(),d.debug(function(){return"Inserted."});var m=l,y=Array.isArray(m),g=0;for(m=y?m:(0,s.default)(m);;){var b;if(y){if(g>=m.length)break;b=m[g++]}else{if((g=m.next()).done)break;b=g.value}b.maybeQueue(d,!0)}}return r},r._containerInsertBefore=function(e){return this._containerInsert(this.key,e)},r._containerInsertAfter=function(e){return this._containerInsert(this.key+1,e)},r._maybePopFromStatements=function(e){var t=e[e.length-1];(l.isIdentifier(t)||l.isExpressionStatement(t)&&l.isIdentifier(t.expression))&&!this.isCompletionRecord()&&e.pop()},r.insertAfter=function(e){if(this._assertUnremoved(),e=this._verifyNodeList(e),this.parentPath.isExpressionStatement()||this.parentPath.isLabeledStatement())return this.parentPath.insertAfter(e);if(this.isNodeType("Expression")||this.parentPath.isForStatement()&&"init"===this.key){if(this.node){var t=this.scope.generateDeclaredUidIdentifier();e.unshift(l.expressionStatement(l.assignmentExpression("=",t,this.node))),e.push(l.expressionStatement(t))}this.replaceExpressionWithStatements(e)}else{if(this._maybePopFromStatements(e),Array.isArray(this.container))return this._containerInsertAfter(e);if(!this.isStatementOrBlock())throw new Error("We don't know what to do with this node type. We were previously a Statement but we can't fit in here?");this.node&&e.unshift(this.node),this._replaceWith(l.blockStatement(e))}return[this]},r.updateSiblingKeys=function(e,t){if(this.parent)for(var r=a.path.get(this.parent),n=0;n=e&&(i.key+=t)}},r._verifyNodeList=function(e){if(!e)return[];e.constructor!==Array&&(e=[e]);for(var t=0;t0&&void 0!==arguments[0]?arguments[0]:this.scope;return new o.default(this,e).run()};var a=e("../cache"),o=n(e("./lib/hoister")),u=n(e("./index")),l=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(e("babel-types"))},{"../cache":140,"./index":150,"./lib/hoister":155,"babel-runtime/core-js/get-iterator":120,"babel-runtime/helpers/typeof":138,"babel-types":180}],159:[function(e,t,r){"use strict";r.__esModule=!0;var n=function(e){return e&&e.__esModule?e:{default:e}}(e("babel-runtime/core-js/get-iterator"));r.remove=function(){this._assertUnremoved(),this.resync(),this._callRemovalHooks()?this._markRemoved():(this.shareCommentsWithSiblings(),this._remove(),this._markRemoved())},r._callRemovalHooks=function(){var e=i.hooks,t=Array.isArray(e),r=0;for(e=t?e:(0,n.default)(e);;){var s;if(t){if(r>=e.length)break;s=e[r++]}else{if((r=e.next()).done)break;s=r.value}if(s(this,this.parentPath))return!0}},r._remove=function(){Array.isArray(this.container)?(this.container.splice(this.key,1),this.updateSiblingKeys(this.key,-1)):this._replaceWith(null)},r._markRemoved=function(){this.shouldSkip=!0,this.removed=!0,this.node=null},r._assertUnremoved=function(){if(this.removed)throw this.buildCodeFrameError("NodePath has been removed so is read-only.")};var i=e("./lib/removal-hooks")},{"./lib/removal-hooks":156,"babel-runtime/core-js/get-iterator":120}],160:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}r.__esModule=!0;var i=n(e("babel-runtime/core-js/get-iterator"));r.replaceWithMultiple=function(e){this.resync(),e=this._verifyNodeList(e),l.inheritLeadingComments(e[0],this.node),l.inheritTrailingComments(e[e.length-1],this.node),this.node=this.container[this.key]=null,this.insertAfter(e),this.node?this.requeue():this.remove()},r.replaceWithSourceString=function(e){this.resync();try{e="("+e+")",e=(0,u.parse)(e)}catch(r){var t=r.loc;throw t&&(r.message+=" - make sure this is an expression.",r.message+="\n"+(0,s.default)(e,t.line,t.column+1)),r}return e=e.program.body[0].expression,a.default.removeProperties(e),this.replaceWith(e)},r.replaceWith=function(e){if(this.resync(),this.removed)throw new Error("You can't replace this node, we've already removed it");if(e instanceof o.default&&(e=e.node),!e)throw new Error("You passed `path.replaceWith()` a falsy node, use `path.remove()` instead");if(this.node!==e){if(this.isProgram()&&!l.isProgram(e))throw new Error("You can only replace a Program root node with another Program node");if(Array.isArray(e))throw new Error("Don't use `path.replaceWith()` with an array of nodes, use `path.replaceWithMultiple()`");if("string"==typeof e)throw new Error("Don't use `path.replaceWith()` with a source string, use `path.replaceWithSourceString()`");if(this.isNodeType("Statement")&&l.isExpression(e)&&(this.canHaveVariableDeclarationOrExpression()||this.canSwapBetweenExpressionAndStatement(e)||this.parentPath.isExportDefaultDeclaration()||(e=l.expressionStatement(e))),this.isNodeType("Expression")&&l.isStatement(e)&&!this.canHaveVariableDeclarationOrExpression()&&!this.canSwapBetweenExpressionAndStatement(e))return this.replaceExpressionWithStatements([e]);var t=this.node;t&&(l.inheritsComments(e,t),l.removeComments(t)),this._replaceWith(e),this.type=e.type,this.setScope(),this.requeue()}},r._replaceWith=function(e){if(!this.container)throw new ReferenceError("Container is falsy");this.inList?l.validate(this.parent,this.key,[e]):l.validate(this.parent,this.key,e),this.debug(function(){return"Replace with "+(e&&e.type)}),this.node=this.container[this.key]=e},r.replaceExpressionWithStatements=function(e){this.resync();var t=l.toSequenceExpression(e,this.scope);if(l.isSequenceExpression(t)){var r=t.expressions;r.length>=2&&this.parentPath.isExpressionStatement()&&this._maybePopFromStatements(r),1===r.length?this.replaceWith(r[0]):this.replaceWith(t)}else{if(!t){var n=l.functionExpression(null,[],l.blockStatement(e));n.shadow=!0,this.replaceWith(l.callExpression(n,[])),this.traverse(c);var s=this.get("callee").getCompletionRecords(),a=Array.isArray(s),o=0;for(s=a?s:(0,i.default)(s);;){var u;if(a){if(o>=s.length)break;u=s[o++]}else{if((o=s.next()).done)break;u=o.value}var p=u;if(p.isExpressionStatement()){var h=p.findParent(function(e){return e.isLoop()});if(h){var f=h.getData("expressionReplacementReturnUid");if(f)f=l.identifier(f.name);else{var d=this.get("callee");f=d.scope.generateDeclaredUidIdentifier("ret"),d.get("body").pushContainer("body",l.returnStatement(f)),h.setData("expressionReplacementReturnUid",f)}p.get("expression").replaceWith(l.assignmentExpression("=",f,p.node.expression))}else p.replaceWith(l.returnStatement(p.node.expression))}}return this.node}this.replaceWith(t)}},r.replaceInline=function(e){return this.resync(),Array.isArray(e)?Array.isArray(this.container)?(e=this._verifyNodeList(e),this._containerInsertAfter(e),this.remove()):this.replaceWithMultiple(e):this.replaceWith(e)};var s=n(e("babel-code-frame")),a=n(e("../index")),o=n(e("./index")),u=e("babylon"),l=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(e("babel-types")),c={Function:function(e){e.skip()},VariableDeclaration:function(e){if("var"===e.node.kind){var t=e.getBindingIdentifiers();for(var r in t)e.scope.push({id:t[r]});var n=[],s=e.node.declarations,a=Array.isArray(s),o=0;for(s=a?s:(0,i.default)(s);;){var u;if(a){if(o>=s.length)break;u=s[o++]}else{if((o=s.next()).done)break;u=o.value}var c=u;c.init&&n.push(l.expressionStatement(l.assignmentExpression("=",c.id,c.init)))}e.replaceWithMultiple(n)}}}},{"../index":143,"./index":150,"babel-code-frame":21,"babel-runtime/core-js/get-iterator":120,"babel-types":180,babylon:188}],161:[function(e,t,r){"use strict";r.__esModule=!0;var n=function(e){return e&&e.__esModule?e:{default:e}}(e("babel-runtime/helpers/classCallCheck")),i=function(){function e(t){var r=t.existing,i=t.identifier,s=t.scope,a=t.path,o=t.kind;(0,n.default)(this,e),this.identifier=i,this.scope=s,this.path=a,this.kind=o,this.constantViolations=[],this.constant=!0,this.referencePaths=[],this.referenced=!1,this.references=0,this.clearValue(),r&&(this.constantViolations=[].concat(r.path,r.constantViolations,this.constantViolations))}return e.prototype.deoptValue=function(){this.clearValue(),this.hasDeoptedValue=!0},e.prototype.setValue=function(e){this.hasDeoptedValue||(this.hasValue=!0,this.value=e)},e.prototype.clearValue=function(){this.hasDeoptedValue=!1,this.hasValue=!1,this.value=null},e.prototype.reassign=function(e){this.constant=!1,-1===this.constantViolations.indexOf(e)&&this.constantViolations.push(e)},e.prototype.reference=function(e){-1===this.referencePaths.indexOf(e)&&(this.referenced=!0,this.references++,this.referencePaths.push(e))},e.prototype.dereference=function(){this.references--,this.referenced=!!this.references},e}();r.default=i,t.exports=r.default},{"babel-runtime/helpers/classCallCheck":134}],162:[function(e,t,r){"use strict";function n(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}function i(e){return e&&e.__esModule?e:{default:e}}function s(e,t){if(v.isModuleDeclaration(e))if(e.source)s(e.source,t);else if(e.specifiers&&e.specifiers.length){var r=e.specifiers,n=Array.isArray(r),i=0;for(r=n?r:(0,c.default)(r);;){var a;if(n){if(i>=r.length)break;a=r[i++]}else{if((i=r.next()).done)break;a=i.value}s(a,t)}}else e.declaration&&s(e.declaration,t);else if(v.isModuleSpecifier(e))s(e.local,t);else if(v.isMemberExpression(e))s(e.object,t),s(e.property,t);else if(v.isIdentifier(e))t.push(e.name);else if(v.isLiteral(e))t.push(e.value);else if(v.isCallExpression(e))s(e.callee,t);else if(v.isObjectExpression(e)||v.isObjectPattern(e)){var o=e.properties,u=Array.isArray(o),l=0;for(o=u?o:(0,c.default)(o);;){var p;if(u){if(l>=o.length)break;p=o[l++]}else{if((l=o.next()).done)break;p=l.value}var h=p;s(h.key||h.argument,t)}}}r.__esModule=!0;var a=i(e("babel-runtime/core-js/object/keys")),o=i(e("babel-runtime/core-js/object/create")),u=i(e("babel-runtime/core-js/map")),l=i(e("babel-runtime/helpers/classCallCheck")),c=i(e("babel-runtime/core-js/get-iterator")),p=i(e("lodash/includes")),h=i(e("lodash/repeat")),f=i(e("./lib/renamer")),d=i(e("../index")),m=i(e("lodash/defaults")),y=n(e("babel-messages")),g=i(e("./binding")),b=i(e("globals")),v=n(e("babel-types")),x=e("../cache"),E=0,A={For:function(e){var t=v.FOR_INIT_KEYS,r=Array.isArray(t),n=0;for(t=r?t:(0,c.default)(t);;){var i;if(r){if(n>=t.length)break;i=t[n++]}else{if((n=t.next()).done)break;i=n.value}var s=i,a=e.get(s);a.isVar()&&e.scope.getFunctionParent().registerBinding("var",a)}},Declaration:function(e){e.isBlockScoped()||e.isExportDeclaration()&&e.get("declaration").isDeclaration()||e.scope.getFunctionParent().registerDeclaration(e)},ReferencedIdentifier:function(e,t){t.references.push(e)},ForXStatement:function(e,t){var r=e.get("left");(r.isPattern()||r.isIdentifier())&&t.constantViolations.push(r)},ExportDeclaration:{exit:function(e){var t=e.node,r=e.scope,n=t.declaration;if(v.isClassDeclaration(n)||v.isFunctionDeclaration(n)){var i=n.id;if(!i)return;var s=r.getBinding(i.name);s&&s.reference(e)}else if(v.isVariableDeclaration(n)){var a=n.declarations,o=Array.isArray(a),u=0;for(a=o?a:(0,c.default)(a);;){var l;if(o){if(u>=a.length)break;l=a[u++]}else{if((u=a.next()).done)break;l=u.value}var p=l,h=v.getBindingIdentifiers(p);for(var f in h){var d=r.getBinding(f);d&&d.reference(e)}}}}},LabeledStatement:function(e){e.scope.getProgramParent().addGlobal(e.node),e.scope.getBlockParent().registerDeclaration(e)},AssignmentExpression:function(e,t){t.assignments.push(e)},UpdateExpression:function(e,t){t.constantViolations.push(e.get("argument"))},UnaryExpression:function(e,t){"delete"===e.node.operator&&t.constantViolations.push(e.get("argument"))},BlockScoped:function(e){var t=e.scope;t.path===e&&(t=t.parent),t.getBlockParent().registerDeclaration(e)},ClassDeclaration:function(e){var t=e.node.id;if(t){var r=t.name;e.scope.bindings[r]=e.scope.getBinding(r)}},Block:function(e){var t=e.get("body"),r=Array.isArray(t),n=0;for(t=r?t:(0,c.default)(t);;){var i;if(r){if(n>=t.length)break;i=t[n++]}else{if((n=t.next()).done)break;i=n.value}var s=i;s.isFunctionDeclaration()&&e.scope.getBlockParent().registerDeclaration(s)}}},D=0,S=function(){function e(t,r){if((0,l.default)(this,e),r&&r.block===t.node)return r;var n=function(e,t,r){var n=x.scope.get(e.node)||[],i=n,s=Array.isArray(i),a=0;for(i=s?i:(0,c.default)(i);;){var o;if(s){if(a>=i.length)break;o=i[a++]}else{if((a=i.next()).done)break;o=a.value}var u=o;if(u.parent===t&&u.path===e)return u}n.push(r),x.scope.has(e.node)||x.scope.set(e.node,n)}(t,r,this);if(n)return n;this.uid=D++,this.parent=r,this.hub=t.hub,this.parentBlock=t.parent,this.block=t.node,this.path=t,this.labels=new u.default}return e.prototype.traverse=function(e,t,r){(0,d.default)(e,t,this,r,this.path)},e.prototype.generateDeclaredUidIdentifier=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"temp",t=this.generateUidIdentifier(e);return this.push({id:t}),t},e.prototype.generateUidIdentifier=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"temp";return v.identifier(this.generateUid(e))},e.prototype.generateUid=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"temp";e=v.toIdentifier(e).replace(/^_+/,"").replace(/[0-9]+$/g,"");var t=void 0,r=0;do{t=this._generateUid(e,r),r++}while(this.hasLabel(t)||this.hasBinding(t)||this.hasGlobal(t)||this.hasReference(t));var n=this.getProgramParent();return n.references[t]=!0,n.uids[t]=!0,t},e.prototype._generateUid=function(e,t){var r=e;return t>1&&(r+=t),"_"+r},e.prototype.generateUidIdentifierBasedOnNode=function(e,t){var r=e;v.isAssignmentExpression(e)?r=e.left:v.isVariableDeclarator(e)?r=e.id:(v.isObjectProperty(r)||v.isObjectMethod(r))&&(r=r.key);var n=[];s(r,n);var i=n.join("$");return i=i.replace(/^_/,"")||t||"ref",this.generateUidIdentifier(i.slice(0,20))},e.prototype.isStatic=function(e){if(v.isThisExpression(e)||v.isSuper(e))return!0;if(v.isIdentifier(e)){var t=this.getBinding(e.name);return t?t.constant:this.hasBinding(e.name)}return!1},e.prototype.maybeGenerateMemoised=function(e,t){if(this.isStatic(e))return null;var r=this.generateUidIdentifierBasedOnNode(e);return t||this.push({id:r}),r},e.prototype.checkBlockScopedCollisions=function(e,t,r,n){if("param"!==t&&("hoisted"!==t||"let"!==e.kind)){if("let"===t||"let"===e.kind||"const"===e.kind||"module"===e.kind||"param"===e.kind&&("let"===t||"const"===t))throw this.hub.file.buildCodeFrameError(n,y.get("scopeDuplicateDeclaration",r),TypeError)}},e.prototype.rename=function(e,t,r){var n=this.getBinding(e);if(n)return t=t||this.generateUidIdentifier(e).name,new f.default(n,e,t).rename(r)},e.prototype._renameFromMap=function(e,t,r,n){e[t]&&(e[r]=n,e[t]=null)},e.prototype.dump=function(){var e=(0,h.default)("-",60);console.log(e);var t=this;do{console.log("#",t.block.type);for(var r in t.bindings){var n=t.bindings[r];console.log(" -",r,{constant:n.constant,references:n.references,violations:n.constantViolations.length,kind:n.kind})}}while(t=t.parent);console.log(e)},e.prototype.toArray=function(e,t){var r=this.hub.file;if(v.isIdentifier(e)){var n=this.getBinding(e.name);if(n&&n.constant&&n.path.isGenericType("Array"))return e}if(v.isArrayExpression(e))return e;if(v.isIdentifier(e,{name:"arguments"}))return v.callExpression(v.memberExpression(v.memberExpression(v.memberExpression(v.identifier("Array"),v.identifier("prototype")),v.identifier("slice")),v.identifier("call")),[e]);var i="toArray",s=[e];return!0===t?i="toConsumableArray":t&&(s.push(v.numericLiteral(t)),i="slicedToArray"),v.callExpression(r.addHelper(i),s)},e.prototype.hasLabel=function(e){return!!this.getLabel(e)},e.prototype.getLabel=function(e){return this.labels.get(e)},e.prototype.registerLabel=function(e){this.labels.set(e.node.label.name,e)},e.prototype.registerDeclaration=function(e){if(e.isLabeledStatement())this.registerLabel(e);else if(e.isFunctionDeclaration())this.registerBinding("hoisted",e.get("id"),e);else if(e.isVariableDeclaration()){var t=e.get("declarations"),r=Array.isArray(t),n=0;for(t=r?t:(0,c.default)(t);;){var i;if(r){if(n>=t.length)break;i=t[n++]}else{if((n=t.next()).done)break;i=n.value}var s=i;this.registerBinding(e.node.kind,s)}}else if(e.isClassDeclaration())this.registerBinding("let",e);else if(e.isImportDeclaration()){var a=e.get("specifiers"),o=Array.isArray(a),u=0;for(a=o?a:(0,c.default)(a);;){var l;if(o){if(u>=a.length)break;l=a[u++]}else{if((u=a.next()).done)break;l=u.value}var p=l;this.registerBinding("module",p)}}else if(e.isExportDeclaration()){var h=e.get("declaration");(h.isClassDeclaration()||h.isFunctionDeclaration()||h.isVariableDeclaration())&&this.registerDeclaration(h)}else this.registerBinding("unknown",e)},e.prototype.buildUndefinedNode=function(){return this.hasBinding("undefined")?v.unaryExpression("void",v.numericLiteral(0),!0):v.identifier("undefined")},e.prototype.registerConstantViolation=function(e){var t=e.getBindingIdentifiers();for(var r in t){var n=this.getBinding(r);n&&n.reassign(e)}},e.prototype.registerBinding=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t;if(!e)throw new ReferenceError("no `kind`");if(t.isVariableDeclaration()){var n=t.get("declarations"),i=Array.isArray(n),s=0;for(n=i?n:(0,c.default)(n);;){var a;if(i){if(s>=n.length)break;a=n[s++]}else{if((s=n.next()).done)break;a=s.value}var o=a;this.registerBinding(e,o)}}else{var u=this.getProgramParent(),l=t.getBindingIdentifiers(!0);for(var p in l){var h=l[p],f=Array.isArray(h),d=0;for(h=f?h:(0,c.default)(h);;){var m;if(f){if(d>=h.length)break;m=h[d++]}else{if((d=h.next()).done)break;m=d.value}var y=m,b=this.getOwnBinding(p);if(b){if(b.identifier===y)continue;this.checkBlockScopedCollisions(b,e,p,y)}b&&b.path.isFlow()&&(b=null),u.references[p]=!0,this.bindings[p]=new g.default({identifier:y,existing:b,scope:this,path:r,kind:e})}}}},e.prototype.addGlobal=function(e){this.globals[e.name]=e},e.prototype.hasUid=function(e){var t=this;do{if(t.uids[e])return!0}while(t=t.parent);return!1},e.prototype.hasGlobal=function(e){var t=this;do{if(t.globals[e])return!0}while(t=t.parent);return!1},e.prototype.hasReference=function(e){var t=this;do{if(t.references[e])return!0}while(t=t.parent);return!1},e.prototype.isPure=function(e,t){if(v.isIdentifier(e)){var r=this.getBinding(e.name);return!!r&&(!t||r.constant)}if(v.isClass(e))return!(e.superClass&&!this.isPure(e.superClass,t))&&this.isPure(e.body,t);if(v.isClassBody(e)){var n=e.body,i=Array.isArray(n),s=0;for(n=i?n:(0,c.default)(n);;){var a;if(i){if(s>=n.length)break;a=n[s++]}else{if((s=n.next()).done)break;a=s.value}var o=a;if(!this.isPure(o,t))return!1}return!0}if(v.isBinary(e))return this.isPure(e.left,t)&&this.isPure(e.right,t);if(v.isArrayExpression(e)){var u=e.elements,l=Array.isArray(u),p=0;for(u=l?u:(0,c.default)(u);;){var h;if(l){if(p>=u.length)break;h=u[p++]}else{if((p=u.next()).done)break;h=p.value}var f=h;if(!this.isPure(f,t))return!1}return!0}if(v.isObjectExpression(e)){var d=e.properties,m=Array.isArray(d),y=0;for(d=m?d:(0,c.default)(d);;){var g;if(m){if(y>=d.length)break;g=d[y++]}else{if((y=d.next()).done)break;g=y.value}var b=g;if(!this.isPure(b,t))return!1}return!0}return v.isClassMethod(e)?!(e.computed&&!this.isPure(e.key,t))&&("get"!==e.kind&&"set"!==e.kind):v.isClassProperty(e)||v.isObjectProperty(e)?!(e.computed&&!this.isPure(e.key,t))&&this.isPure(e.value,t):v.isUnaryExpression(e)?this.isPure(e.argument,t):v.isPureish(e)},e.prototype.setData=function(e,t){return this.data[e]=t},e.prototype.getData=function(e){var t=this;do{var r=t.data[e];if(null!=r)return r}while(t=t.parent)},e.prototype.removeData=function(e){var t=this;do{null!=t.data[e]&&(t.data[e]=null)}while(t=t.parent)},e.prototype.init=function(){this.references||this.crawl()},e.prototype.crawl=function(){E++,this._crawl(),E--},e.prototype._crawl=function(){var e=this.path;if(this.references=(0,o.default)(null),this.bindings=(0,o.default)(null),this.globals=(0,o.default)(null),this.uids=(0,o.default)(null),this.data=(0,o.default)(null),e.isLoop()){var t=v.FOR_INIT_KEYS,r=Array.isArray(t),n=0;for(t=r?t:(0,c.default)(t);;){var i;if(r){if(n>=t.length)break;i=t[n++]}else{if((n=t.next()).done)break;i=n.value}var s=i,a=e.get(s);a.isBlockScoped()&&this.registerBinding(a.node.kind,a)}}if(e.isFunctionExpression()&&e.has("id")&&(e.get("id").node[v.NOT_LOCAL_BINDING]||this.registerBinding("local",e.get("id"),e)),e.isClassExpression()&&e.has("id")&&(e.get("id").node[v.NOT_LOCAL_BINDING]||this.registerBinding("local",e)),e.isFunction()){var u=e.get("params"),l=Array.isArray(u),p=0;for(u=l?u:(0,c.default)(u);;){var h;if(l){if(p>=u.length)break;h=u[p++]}else{if((p=u.next()).done)break;h=p.value}var f=h;this.registerBinding("param",f)}}e.isCatchClause()&&this.registerBinding("let",e);if(!this.getProgramParent().crawling){var d={references:[],constantViolations:[],assignments:[]};this.crawling=!0,e.traverse(A,d),this.crawling=!1;var m=d.assignments,y=Array.isArray(m),g=0;for(m=y?m:(0,c.default)(m);;){var b;if(y){if(g>=m.length)break;b=m[g++]}else{if((g=m.next()).done)break;b=g.value}var x=b,E=x.getBindingIdentifiers(),D=void 0;for(var S in E)x.scope.getBinding(S)||(D=D||x.scope.getProgramParent()).addGlobal(E[S]);x.scope.registerConstantViolation(x)}var C=d.references,_=Array.isArray(C),w=0;for(C=_?C:(0,c.default)(C);;){var k;if(_){if(w>=C.length)break;k=C[w++]}else{if((w=C.next()).done)break;k=w.value}var F=k,T=F.scope.getBinding(F.node.name);T?T.reference(F):F.scope.getProgramParent().addGlobal(F.node)}var P=d.constantViolations,B=Array.isArray(P),O=0;for(P=B?P:(0,c.default)(P);;){var N;if(B){if(O>=P.length)break;N=P[O++]}else{if((O=P.next()).done)break;N=O.value}var j=N;j.scope.registerConstantViolation(j)}}},e.prototype.push=function(e){var t=this.path;t.isBlockStatement()||t.isProgram()||(t=this.getBlockParent().path),t.isSwitchStatement()&&(t=this.getFunctionParent().path),(t.isLoop()||t.isCatchClause()||t.isFunction())&&(v.ensureBlock(t.node),t=t.get("body"));var r=e.unique,n=e.kind||"var",i=null==e._blockHoist?2:e._blockHoist,s="declaration:"+n+":"+i,a=!r&&t.getData(s);if(!a){var o=v.variableDeclaration(n,[]);o._generated=!0,o._blockHoist=i;a=t.unshiftContainer("body",[o])[0],r||t.setData(s,a)}var u=v.variableDeclarator(e.id,e.init);a.node.declarations.push(u),this.registerBinding(n,a.get("declarations").pop())},e.prototype.getProgramParent=function(){var e=this;do{if(e.path.isProgram())return e}while(e=e.parent);throw new Error("We couldn't find a Function or Program...")},e.prototype.getFunctionParent=function(){var e=this;do{if(e.path.isFunctionParent())return e}while(e=e.parent);throw new Error("We couldn't find a Function or Program...")},e.prototype.getBlockParent=function(){var e=this;do{if(e.path.isBlockParent())return e}while(e=e.parent);throw new Error("We couldn't find a BlockStatement, For, Switch, Function, Loop or Program...")},e.prototype.getAllBindings=function(){var e=(0,o.default)(null),t=this;do{(0,m.default)(e,t.bindings),t=t.parent}while(t);return e},e.prototype.getAllBindingsOfKind=function(){var e=(0,o.default)(null),t=arguments,r=Array.isArray(t),n=0;for(t=r?t:(0,c.default)(t);;){var i;if(r){if(n>=t.length)break;i=t[n++]}else{if((n=t.next()).done)break;i=n.value}var s=i,a=this;do{for(var u in a.bindings){var l=a.bindings[u];l.kind===s&&(e[u]=l)}a=a.parent}while(a)}return e},e.prototype.bindingIdentifierEquals=function(e,t){return this.getBindingIdentifier(e)===t},e.prototype.warnOnFlowBinding=function(e){return 0===E&&e&&e.path.isFlow()&&console.warn("\n You or one of the Babel plugins you are using are using Flow declarations as bindings.\n Support for this will be removed in version 7. To find out the caller, grep for this\n message and change it to a `console.trace()`.\n "),e},e.prototype.getBinding=function(e){var t=this;do{var r=t.getOwnBinding(e);if(r)return this.warnOnFlowBinding(r)}while(t=t.parent)},e.prototype.getOwnBinding=function(e){return this.warnOnFlowBinding(this.bindings[e])},e.prototype.getBindingIdentifier=function(e){var t=this.getBinding(e);return t&&t.identifier},e.prototype.getOwnBindingIdentifier=function(e){var t=this.bindings[e];return t&&t.identifier},e.prototype.hasOwnBinding=function(e){return!!this.getOwnBinding(e)},e.prototype.hasBinding=function(t,r){return!!t&&(!!this.hasOwnBinding(t)||(!!this.parentHasBinding(t,r)||(!!this.hasUid(t)||(!(r||!(0,p.default)(e.globals,t))||!(r||!(0,p.default)(e.contextVariables,t))))))},e.prototype.parentHasBinding=function(e,t){return this.parent&&this.parent.hasBinding(e,t)},e.prototype.moveBindingTo=function(e,t){var r=this.getBinding(e);r&&(r.scope.removeOwnBinding(e),r.scope=t,t.bindings[e]=r)},e.prototype.removeOwnBinding=function(e){delete this.bindings[e]},e.prototype.removeBinding=function(e){var t=this.getBinding(e);t&&t.scope.removeOwnBinding(e);var r=this;do{r.uids[e]&&(r.uids[e]=!1)}while(r=r.parent)},e}();S.globals=(0,a.default)(b.default.builtin),S.contextVariables=["arguments","undefined","Infinity","NaN"],r.default=S,t.exports=r.default},{"../cache":140,"../index":143,"./binding":161,"./lib/renamer":163,"babel-messages":110,"babel-runtime/core-js/get-iterator":120,"babel-runtime/core-js/map":122,"babel-runtime/core-js/object/create":125,"babel-runtime/core-js/object/keys":127,"babel-runtime/helpers/classCallCheck":134,"babel-types":180,globals:168,"lodash/defaults":495,"lodash/includes":507,"lodash/repeat":530}],163:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}r.__esModule=!0;var i=n(e("babel-runtime/helpers/classCallCheck")),s=(n(e("../binding")),function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(e("babel-types"))),a={ReferencedIdentifier:function(e,t){var r=e.node;r.name===t.oldName&&(r.name=t.newName)},Scope:function(e,t){e.scope.bindingIdentifierEquals(t.oldName,t.binding.identifier)||e.skip()},"AssignmentExpression|Declaration":function(e,t){var r=e.getOuterBindingIdentifiers();for(var n in r)n===t.oldName&&(r[n].name=t.newName)}},o=function(){function e(t,r,n){(0,i.default)(this,e),this.newName=n,this.oldName=r,this.binding=t}return e.prototype.maybeConvertFromExportDeclaration=function(e){var t=e.parentPath.isExportDeclaration()&&e.parentPath;if(t){var r=t.isExportDefaultDeclaration();r&&(e.isFunctionDeclaration()||e.isClassDeclaration())&&!e.node.id&&(e.node.id=e.scope.generateUidIdentifier("default"));var n=e.getOuterBindingIdentifiers(),i=[];for(var a in n){var o=a===this.oldName?this.newName:a,u=r?"default":a;i.push(s.exportSpecifier(s.identifier(o),s.identifier(u)))}if(i.length){var l=s.exportNamedDeclaration(null,i);e.isFunctionDeclaration()&&(l._blockHoist=3),t.insertAfter(l),t.replaceWith(e.node)}}},e.prototype.rename=function(e){var t=this.binding,r=this.oldName,n=this.newName,i=t.scope,s=t.path.find(function(e){return e.isDeclaration()||e.isFunctionExpression()});s&&this.maybeConvertFromExportDeclaration(s),i.traverse(e||i.block,a,this),e||(i.removeOwnBinding(r),i.bindings[n]=t,this.binding.identifier.name=n),t.type},e}();r.default=o,t.exports=r.default},{"../binding":161,"babel-runtime/helpers/classCallCheck":134,"babel-types":180}],164:[function(e,t,r){"use strict";function n(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}function i(e){return e&&e.__esModule?e:{default:e}}function s(e){if(e._exploded)return e;e._exploded=!0;for(var t in e)if(!l(t)){var r=t.split("|");if(1!==r.length){var n=e[t];delete e[t];var i=r,s=Array.isArray(i),o=0;for(i=s?i:(0,f.default)(i);;){var p;if(s){if(o>=i.length)break;p=i[o++]}else{if((o=i.next()).done)break;p=o.value}e[p]=n}}}a(e),delete e.__esModule,function(e){for(var t in e)if(!l(t)){var r=e[t];"function"==typeof r&&(e[t]={enter:r})}}(e),u(e);var m=(0,h.default)(e),b=Array.isArray(m),v=0;for(m=b?m:(0,f.default)(m);;){var x;if(b){if(v>=m.length)break;x=m[v++]}else{if((v=m.next()).done)break;x=v.value}var E=x;if(!l(E)){var A=d[E];if(A){var D=e[E];for(var S in D)D[S]=function(e,t){var r=function(r){if(e.checkPath(r))return t.apply(this,arguments)};return r.toString=function(){return t.toString()},r}(A,D[S]);if(delete e[E],A.types){var C=A.types,_=Array.isArray(C),w=0;for(C=_?C:(0,f.default)(C);;){var k;if(_){if(w>=C.length)break;k=C[w++]}else{if((w=C.next()).done)break;k=w.value}var F=k;e[F]?c(e[F],D):e[F]=D}}else c(e,D)}}}for(var T in e)if(!l(T)){var P=e[T],B=y.FLIPPED_ALIAS_KEYS[T],O=y.DEPRECATED_KEYS[T];if(O&&(console.trace("Visitor defined for "+T+" but it has been renamed to "+O),B=[O]),B){delete e[T];var N=B,j=Array.isArray(N),I=0;for(N=j?N:(0,f.default)(N);;){var L;if(j){if(I>=N.length)break;L=N[I++]}else{if((I=N.next()).done)break;L=I.value}var M=L,R=e[M];R?c(R,P):e[M]=(0,g.default)(P)}}}for(var V in e)l(V)||u(e[V]);return e}function a(e){if(!e._verified){if("function"==typeof e)throw new Error(m.get("traverseVerifyRootFunction"));for(var t in e)if("enter"!==t&&"exit"!==t||o(t,e[t]),!l(t)){if(y.TYPES.indexOf(t)<0)throw new Error(m.get("traverseVerifyNodeType",t));var r=e[t];if("object"===(void 0===r?"undefined":(0,p.default)(r)))for(var n in r){if("enter"!==n&&"exit"!==n)throw new Error(m.get("traverseVerifyVisitorProperty",t,n));o(t+"."+n,r[n])}}e._verified=!0}}function o(e,t){var r=[].concat(t),n=Array.isArray(r),i=0;for(r=n?r:(0,f.default)(r);;){var s;if(n){if(i>=r.length)break;s=r[i++]}else{if((i=r.next()).done)break;s=i.value}var a=s;if("function"!=typeof a)throw new TypeError("Non-function found defined in "+e+" with type "+(void 0===a?"undefined":(0,p.default)(a)))}}function u(e){e.enter&&!Array.isArray(e.enter)&&(e.enter=[e.enter]),e.exit&&!Array.isArray(e.exit)&&(e.exit=[e.exit])}function l(e){return"_"===e[0]||("enter"===e||"exit"===e||"shouldSkip"===e||("blacklist"===e||"noScope"===e||"skipKeys"===e))}function c(e,t){for(var r in t)e[r]=[].concat(e[r]||[],t[r])}r.__esModule=!0;var p=i(e("babel-runtime/helpers/typeof")),h=i(e("babel-runtime/core-js/object/keys")),f=i(e("babel-runtime/core-js/get-iterator"));r.explode=s,r.verify=a,r.merge=function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=arguments[2],n={},i=0;i=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},r.storage="undefined"!=typeof chrome&&void 0!==chrome.storage?chrome.storage.local:function(){try{return window.localStorage}catch(e){}}(),r.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"],r.formatters.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}},r.enable(i())}).call(this,e("_process"))},{"./debug":166,_process:550}],166:[function(e,t,r){arguments[4][60][0].apply(r,arguments)},{dup:60,ms:543}],167:[function(e,t,r){t.exports={builtin:{Array:!1,ArrayBuffer:!1,Boolean:!1,constructor:!1,DataView:!1,Date:!1,decodeURI:!1,decodeURIComponent:!1,encodeURI:!1,encodeURIComponent:!1,Error:!1,escape:!1,eval:!1,EvalError:!1,Float32Array:!1,Float64Array:!1,Function:!1,hasOwnProperty:!1,Infinity:!1,Int16Array:!1,Int32Array:!1,Int8Array:!1,isFinite:!1,isNaN:!1,isPrototypeOf:!1,JSON:!1,Map:!1,Math:!1,NaN:!1,Number:!1,Object:!1,parseFloat:!1,parseInt:!1,Promise:!1,propertyIsEnumerable:!1,Proxy:!1,RangeError:!1,ReferenceError:!1,Reflect:!1,RegExp:!1,Set:!1,String:!1,Symbol:!1,SyntaxError:!1,System:!1,toLocaleString:!1,toString:!1,TypeError:!1,Uint16Array:!1,Uint32Array:!1,Uint8Array:!1,Uint8ClampedArray:!1,undefined:!1,unescape:!1,URIError:!1,valueOf:!1,WeakMap:!1,WeakSet:!1},es5:{Array:!1,Boolean:!1,constructor:!1,Date:!1,decodeURI:!1,decodeURIComponent:!1,encodeURI:!1,encodeURIComponent:!1,Error:!1,escape:!1,eval:!1,EvalError:!1,Function:!1,hasOwnProperty:!1,Infinity:!1,isFinite:!1,isNaN:!1,isPrototypeOf:!1,JSON:!1,Math:!1,NaN:!1,Number:!1,Object:!1,parseFloat:!1,parseInt:!1,propertyIsEnumerable:!1,RangeError:!1,ReferenceError:!1,RegExp:!1,String:!1,SyntaxError:!1,toLocaleString:!1,toString:!1,TypeError:!1,undefined:!1,unescape:!1,URIError:!1,valueOf:!1},es6:{Array:!1,ArrayBuffer:!1,Boolean:!1,constructor:!1,DataView:!1,Date:!1,decodeURI:!1,decodeURIComponent:!1,encodeURI:!1,encodeURIComponent:!1,Error:!1,escape:!1,eval:!1,EvalError:!1,Float32Array:!1,Float64Array:!1,Function:!1,hasOwnProperty:!1,Infinity:!1,Int16Array:!1,Int32Array:!1,Int8Array:!1,isFinite:!1,isNaN:!1,isPrototypeOf:!1,JSON:!1,Map:!1,Math:!1,NaN:!1,Number:!1,Object:!1,parseFloat:!1,parseInt:!1,Promise:!1,propertyIsEnumerable:!1,Proxy:!1,RangeError:!1,ReferenceError:!1,Reflect:!1,RegExp:!1,Set:!1,String:!1,Symbol:!1,SyntaxError:!1,System:!1,toLocaleString:!1,toString:!1,TypeError:!1,Uint16Array:!1,Uint32Array:!1,Uint8Array:!1,Uint8ClampedArray:!1,undefined:!1,unescape:!1,URIError:!1,valueOf:!1,WeakMap:!1,WeakSet:!1},browser:{addEventListener:!1,alert:!1,AnalyserNode:!1,Animation:!1,AnimationEffectReadOnly:!1,AnimationEffectTiming:!1,AnimationEffectTimingReadOnly:!1,AnimationEvent:!1,AnimationPlaybackEvent:!1,AnimationTimeline:!1,applicationCache:!1,ApplicationCache:!1,ApplicationCacheErrorEvent:!1,atob:!1,Attr:!1,Audio:!1,AudioBuffer:!1,AudioBufferSourceNode:!1,AudioContext:!1,AudioDestinationNode:!1,AudioListener:!1,AudioNode:!1,AudioParam:!1,AudioProcessingEvent:!1,AutocompleteErrorEvent:!1,BarProp:!1,BatteryManager:!1,BeforeUnloadEvent:!1,BiquadFilterNode:!1,Blob:!1,blur:!1,btoa:!1,Cache:!1,caches:!1,CacheStorage:!1,cancelAnimationFrame:!1,cancelIdleCallback:!1,CanvasGradient:!1,CanvasPattern:!1,CanvasRenderingContext2D:!1,CDATASection:!1,ChannelMergerNode:!1,ChannelSplitterNode:!1,CharacterData:!1,clearInterval:!1,clearTimeout:!1,clientInformation:!1,ClientRect:!1,ClientRectList:!1,ClipboardEvent:!1,close:!1,closed:!1,CloseEvent:!1,Comment:!1,CompositionEvent:!1,confirm:!1,console:!1,ConvolverNode:!1,createImageBitmap:!1,Credential:!1,CredentialsContainer:!1,crypto:!1,Crypto:!1,CryptoKey:!1,CSS:!1,CSSAnimation:!1,CSSFontFaceRule:!1,CSSImportRule:!1,CSSKeyframeRule:!1,CSSKeyframesRule:!1,CSSMediaRule:!1,CSSPageRule:!1,CSSRule:!1,CSSRuleList:!1,CSSStyleDeclaration:!1,CSSStyleRule:!1,CSSStyleSheet:!1,CSSSupportsRule:!1,CSSTransition:!1,CSSUnknownRule:!1,CSSViewportRule:!1,customElements:!1,CustomEvent:!1,DataTransfer:!1,DataTransferItem:!1,DataTransferItemList:!1,Debug:!1,defaultStatus:!1,defaultstatus:!1,DelayNode:!1,DeviceMotionEvent:!1,DeviceOrientationEvent:!1,devicePixelRatio:!1,dispatchEvent:!1,document:!1,Document:!1,DocumentFragment:!1,DocumentTimeline:!1,DocumentType:!1,DOMError:!1,DOMException:!1,DOMImplementation:!1,DOMParser:!1,DOMSettableTokenList:!1,DOMStringList:!1,DOMStringMap:!1,DOMTokenList:!1,DragEvent:!1,DynamicsCompressorNode:!1,Element:!1,ElementTimeControl:!1,ErrorEvent:!1,event:!1,Event:!1,EventSource:!1,EventTarget:!1,external:!1,FederatedCredential:!1,fetch:!1,File:!1,FileError:!1,FileList:!1,FileReader:!1,find:!1,focus:!1,FocusEvent:!1,FontFace:!1,FormData:!1,frameElement:!1,frames:!1,GainNode:!1,Gamepad:!1,GamepadButton:!1,GamepadEvent:!1,getComputedStyle:!1,getSelection:!1,HashChangeEvent:!1,Headers:!1,history:!1,History:!1,HTMLAllCollection:!1,HTMLAnchorElement:!1,HTMLAppletElement:!1,HTMLAreaElement:!1,HTMLAudioElement:!1,HTMLBaseElement:!1,HTMLBlockquoteElement:!1,HTMLBodyElement:!1,HTMLBRElement:!1,HTMLButtonElement:!1,HTMLCanvasElement:!1,HTMLCollection:!1,HTMLContentElement:!1,HTMLDataListElement:!1,HTMLDetailsElement:!1,HTMLDialogElement:!1,HTMLDirectoryElement:!1,HTMLDivElement:!1,HTMLDListElement:!1,HTMLDocument:!1,HTMLElement:!1,HTMLEmbedElement:!1,HTMLFieldSetElement:!1,HTMLFontElement:!1,HTMLFormControlsCollection:!1,HTMLFormElement:!1,HTMLFrameElement:!1,HTMLFrameSetElement:!1,HTMLHeadElement:!1,HTMLHeadingElement:!1,HTMLHRElement:!1,HTMLHtmlElement:!1,HTMLIFrameElement:!1,HTMLImageElement:!1,HTMLInputElement:!1,HTMLIsIndexElement:!1,HTMLKeygenElement:!1,HTMLLabelElement:!1,HTMLLayerElement:!1,HTMLLegendElement:!1,HTMLLIElement:!1,HTMLLinkElement:!1,HTMLMapElement:!1,HTMLMarqueeElement:!1,HTMLMediaElement:!1,HTMLMenuElement:!1,HTMLMetaElement:!1,HTMLMeterElement:!1,HTMLModElement:!1,HTMLObjectElement:!1,HTMLOListElement:!1,HTMLOptGroupElement:!1,HTMLOptionElement:!1,HTMLOptionsCollection:!1,HTMLOutputElement:!1,HTMLParagraphElement:!1,HTMLParamElement:!1,HTMLPictureElement:!1,HTMLPreElement:!1,HTMLProgressElement:!1,HTMLQuoteElement:!1,HTMLScriptElement:!1,HTMLSelectElement:!1,HTMLShadowElement:!1,HTMLSourceElement:!1,HTMLSpanElement:!1,HTMLStyleElement:!1,HTMLTableCaptionElement:!1,HTMLTableCellElement:!1,HTMLTableColElement:!1,HTMLTableElement:!1,HTMLTableRowElement:!1,HTMLTableSectionElement:!1,HTMLTemplateElement:!1,HTMLTextAreaElement:!1,HTMLTitleElement:!1,HTMLTrackElement:!1,HTMLUListElement:!1,HTMLUnknownElement:!1,HTMLVideoElement:!1,IDBCursor:!1,IDBCursorWithValue:!1,IDBDatabase:!1,IDBEnvironment:!1,IDBFactory:!1,IDBIndex:!1,IDBKeyRange:!1,IDBObjectStore:!1,IDBOpenDBRequest:!1,IDBRequest:!1,IDBTransaction:!1,IDBVersionChangeEvent:!1,Image:!1,ImageBitmap:!1,ImageData:!1,indexedDB:!1,innerHeight:!1,innerWidth:!1,InputEvent:!1,InputMethodContext:!1,IntersectionObserver:!1,IntersectionObserverEntry:!1,Intl:!1,KeyboardEvent:!1,KeyframeEffect:!1,KeyframeEffectReadOnly:!1,length:!1,localStorage:!1,location:!1,Location:!1,locationbar:!1,matchMedia:!1,MediaElementAudioSourceNode:!1,MediaEncryptedEvent:!1,MediaError:!1,MediaKeyError:!1,MediaKeyEvent:!1,MediaKeyMessageEvent:!1,MediaKeys:!1,MediaKeySession:!1,MediaKeyStatusMap:!1,MediaKeySystemAccess:!1,MediaList:!1,MediaQueryList:!1,MediaQueryListEvent:!1,MediaSource:!1,MediaRecorder:!1,MediaStream:!1,MediaStreamAudioDestinationNode:!1,MediaStreamAudioSourceNode:!1,MediaStreamEvent:!1,MediaStreamTrack:!1,menubar:!1,MessageChannel:!1,MessageEvent:!1,MessagePort:!1,MIDIAccess:!1,MIDIConnectionEvent:!1,MIDIInput:!1,MIDIInputMap:!1,MIDIMessageEvent:!1,MIDIOutput:!1,MIDIOutputMap:!1,MIDIPort:!1,MimeType:!1,MimeTypeArray:!1,MouseEvent:!1,moveBy:!1,moveTo:!1,MutationEvent:!1,MutationObserver:!1,MutationRecord:!1,name:!1,NamedNodeMap:!1,navigator:!1,Navigator:!1,Node:!1,NodeFilter:!1,NodeIterator:!1,NodeList:!1,Notification:!1,OfflineAudioCompletionEvent:!1,OfflineAudioContext:!1,offscreenBuffering:!1,onbeforeunload:!0,onblur:!0,onerror:!0,onfocus:!0,onload:!0,onresize:!0,onunload:!0,open:!1,openDatabase:!1,opener:!1,opera:!1,Option:!1,OscillatorNode:!1,outerHeight:!1,outerWidth:!1,PageTransitionEvent:!1,pageXOffset:!1,pageYOffset:!1,parent:!1,PasswordCredential:!1,Path2D:!1,performance:!1,Performance:!1,PerformanceEntry:!1,PerformanceMark:!1,PerformanceMeasure:!1,PerformanceNavigation:!1,PerformanceResourceTiming:!1,PerformanceTiming:!1,PeriodicWave:!1,Permissions:!1,PermissionStatus:!1,personalbar:!1,Plugin:!1,PluginArray:!1,PopStateEvent:!1,postMessage:!1,print:!1,ProcessingInstruction:!1,ProgressEvent:!1,PromiseRejectionEvent:!1,prompt:!1,PushManager:!1,PushSubscription:!1,RadioNodeList:!1,Range:!1,ReadableByteStream:!1,ReadableStream:!1,removeEventListener:!1,Request:!1,requestAnimationFrame:!1,requestIdleCallback:!1,resizeBy:!1,resizeTo:!1,Response:!1,RTCIceCandidate:!1,RTCSessionDescription:!1,RTCPeerConnection:!1,screen:!1,Screen:!1,screenLeft:!1,ScreenOrientation:!1,screenTop:!1,screenX:!1,screenY:!1,ScriptProcessorNode:!1,scroll:!1,scrollbars:!1,scrollBy:!1,scrollTo:!1,scrollX:!1,scrollY:!1,SecurityPolicyViolationEvent:!1,Selection:!1,self:!1,ServiceWorker:!1,ServiceWorkerContainer:!1,ServiceWorkerRegistration:!1,sessionStorage:!1,setInterval:!1,setTimeout:!1,ShadowRoot:!1,SharedKeyframeList:!1,SharedWorker:!1,showModalDialog:!1,SiteBoundCredential:!1,speechSynthesis:!1,SpeechSynthesisEvent:!1,SpeechSynthesisUtterance:!1,status:!1,statusbar:!1,stop:!1,Storage:!1,StorageEvent:!1,styleMedia:!1,StyleSheet:!1,StyleSheetList:!1,SubtleCrypto:!1,SVGAElement:!1,SVGAltGlyphDefElement:!1,SVGAltGlyphElement:!1,SVGAltGlyphItemElement:!1,SVGAngle:!1,SVGAnimateColorElement:!1,SVGAnimatedAngle:!1,SVGAnimatedBoolean:!1,SVGAnimatedEnumeration:!1,SVGAnimatedInteger:!1,SVGAnimatedLength:!1,SVGAnimatedLengthList:!1,SVGAnimatedNumber:!1,SVGAnimatedNumberList:!1,SVGAnimatedPathData:!1,SVGAnimatedPoints:!1,SVGAnimatedPreserveAspectRatio:!1,SVGAnimatedRect:!1,SVGAnimatedString:!1,SVGAnimatedTransformList:!1,SVGAnimateElement:!1,SVGAnimateMotionElement:!1,SVGAnimateTransformElement:!1,SVGAnimationElement:!1,SVGCircleElement:!1,SVGClipPathElement:!1,SVGColor:!1,SVGColorProfileElement:!1,SVGColorProfileRule:!1,SVGComponentTransferFunctionElement:!1,SVGCSSRule:!1,SVGCursorElement:!1,SVGDefsElement:!1,SVGDescElement:!1,SVGDiscardElement:!1,SVGDocument:!1,SVGElement:!1,SVGElementInstance:!1,SVGElementInstanceList:!1,SVGEllipseElement:!1,SVGEvent:!1,SVGExternalResourcesRequired:!1,SVGFEBlendElement:!1,SVGFEColorMatrixElement:!1,SVGFEComponentTransferElement:!1,SVGFECompositeElement:!1,SVGFEConvolveMatrixElement:!1,SVGFEDiffuseLightingElement:!1,SVGFEDisplacementMapElement:!1,SVGFEDistantLightElement:!1,SVGFEDropShadowElement:!1,SVGFEFloodElement:!1,SVGFEFuncAElement:!1,SVGFEFuncBElement:!1,SVGFEFuncGElement:!1,SVGFEFuncRElement:!1,SVGFEGaussianBlurElement:!1,SVGFEImageElement:!1,SVGFEMergeElement:!1,SVGFEMergeNodeElement:!1,SVGFEMorphologyElement:!1,SVGFEOffsetElement:!1,SVGFEPointLightElement:!1,SVGFESpecularLightingElement:!1,SVGFESpotLightElement:!1,SVGFETileElement:!1,SVGFETurbulenceElement:!1,SVGFilterElement:!1,SVGFilterPrimitiveStandardAttributes:!1,SVGFitToViewBox:!1,SVGFontElement:!1,SVGFontFaceElement:!1,SVGFontFaceFormatElement:!1,SVGFontFaceNameElement:!1,SVGFontFaceSrcElement:!1,SVGFontFaceUriElement:!1,SVGForeignObjectElement:!1,SVGGElement:!1,SVGGeometryElement:!1,SVGGlyphElement:!1,SVGGlyphRefElement:!1,SVGGradientElement:!1,SVGGraphicsElement:!1,SVGHKernElement:!1,SVGICCColor:!1,SVGImageElement:!1,SVGLangSpace:!1,SVGLength:!1,SVGLengthList:!1,SVGLinearGradientElement:!1,SVGLineElement:!1,SVGLocatable:!1,SVGMarkerElement:!1,SVGMaskElement:!1,SVGMatrix:!1,SVGMetadataElement:!1,SVGMissingGlyphElement:!1,SVGMPathElement:!1,SVGNumber:!1,SVGNumberList:!1,SVGPaint:!1,SVGPathElement:!1,SVGPathSeg:!1,SVGPathSegArcAbs:!1,SVGPathSegArcRel:!1,SVGPathSegClosePath:!1,SVGPathSegCurvetoCubicAbs:!1,SVGPathSegCurvetoCubicRel:!1,SVGPathSegCurvetoCubicSmoothAbs:!1,SVGPathSegCurvetoCubicSmoothRel:!1,SVGPathSegCurvetoQuadraticAbs:!1,SVGPathSegCurvetoQuadraticRel:!1,SVGPathSegCurvetoQuadraticSmoothAbs:!1,SVGPathSegCurvetoQuadraticSmoothRel:!1,SVGPathSegLinetoAbs:!1,SVGPathSegLinetoHorizontalAbs:!1,SVGPathSegLinetoHorizontalRel:!1,SVGPathSegLinetoRel:!1,SVGPathSegLinetoVerticalAbs:!1,SVGPathSegLinetoVerticalRel:!1,SVGPathSegList:!1,SVGPathSegMovetoAbs:!1,SVGPathSegMovetoRel:!1,SVGPatternElement:!1,SVGPoint:!1,SVGPointList:!1,SVGPolygonElement:!1,SVGPolylineElement:!1,SVGPreserveAspectRatio:!1,SVGRadialGradientElement:!1,SVGRect:!1,SVGRectElement:!1,SVGRenderingIntent:!1,SVGScriptElement:!1,SVGSetElement:!1,SVGStopElement:!1,SVGStringList:!1,SVGStylable:!1,SVGStyleElement:!1,SVGSVGElement:!1,SVGSwitchElement:!1,SVGSymbolElement:!1,SVGTests:!1,SVGTextContentElement:!1,SVGTextElement:!1,SVGTextPathElement:!1,SVGTextPositioningElement:!1,SVGTitleElement:!1,SVGTransform:!1,SVGTransformable:!1,SVGTransformList:!1,SVGTRefElement:!1,SVGTSpanElement:!1,SVGUnitTypes:!1,SVGURIReference:!1,SVGUseElement:!1,SVGViewElement:!1,SVGViewSpec:!1,SVGVKernElement:!1,SVGZoomAndPan:!1,SVGZoomEvent:!1,Text:!1,TextDecoder:!1,TextEncoder:!1,TextEvent:!1,TextMetrics:!1,TextTrack:!1,TextTrackCue:!1,TextTrackCueList:!1,TextTrackList:!1,TimeEvent:!1,TimeRanges:!1,toolbar:!1,top:!1,Touch:!1,TouchEvent:!1,TouchList:!1,TrackEvent:!1,TransitionEvent:!1,TreeWalker:!1,UIEvent:!1,URL:!1,URLSearchParams:!1,ValidityState:!1,VTTCue:!1,WaveShaperNode:!1,WebGLActiveInfo:!1,WebGLBuffer:!1,WebGLContextEvent:!1,WebGLFramebuffer:!1,WebGLProgram:!1,WebGLRenderbuffer:!1,WebGLRenderingContext:!1,WebGLShader:!1,WebGLShaderPrecisionFormat:!1,WebGLTexture:!1,WebGLUniformLocation:!1,WebSocket:!1,WheelEvent:!1,window:!1,Window:!1,Worker:!1,XDomainRequest:!1,XMLDocument:!1,XMLHttpRequest:!1,XMLHttpRequestEventTarget:!1,XMLHttpRequestProgressEvent:!1,XMLHttpRequestUpload:!1,XMLSerializer:!1,XPathEvaluator:!1,XPathException:!1,XPathExpression:!1,XPathNamespace:!1,XPathNSResolver:!1,XPathResult:!1,XSLTProcessor:!1},worker:{applicationCache:!1,atob:!1,Blob:!1,BroadcastChannel:!1,btoa:!1,Cache:!1,caches:!1,clearInterval:!1,clearTimeout:!1,close:!0,console:!1,fetch:!1,FileReaderSync:!1,FormData:!1,Headers:!1,IDBCursor:!1,IDBCursorWithValue:!1,IDBDatabase:!1,IDBFactory:!1,IDBIndex:!1,IDBKeyRange:!1,IDBObjectStore:!1,IDBOpenDBRequest:!1,IDBRequest:!1,IDBTransaction:!1,IDBVersionChangeEvent:!1,ImageData:!1,importScripts:!0,indexedDB:!1,location:!1,MessageChannel:!1,MessagePort:!1,name:!1,navigator:!1,Notification:!1,onclose:!0,onconnect:!0,onerror:!0,onlanguagechange:!0,onmessage:!0,onoffline:!0,ononline:!0,onrejectionhandled:!0,onunhandledrejection:!0,performance:!1,Performance:!1,PerformanceEntry:!1,PerformanceMark:!1,PerformanceMeasure:!1,PerformanceNavigation:!1,PerformanceResourceTiming:!1,PerformanceTiming:!1,postMessage:!0,Promise:!1,Request:!1,Response:!1,self:!0,ServiceWorkerRegistration:!1,setInterval:!1,setTimeout:!1,TextDecoder:!1,TextEncoder:!1,URL:!1,URLSearchParams:!1,WebSocket:!1,Worker:!1,XMLHttpRequest:!1},node:{__dirname:!1,__filename:!1,arguments:!1,Buffer:!1,clearImmediate:!1,clearInterval:!1,clearTimeout:!1,console:!1,exports:!0,GLOBAL:!1,global:!1,Intl:!1,module:!1,process:!1,require:!1,root:!1,setImmediate:!1,setInterval:!1,setTimeout:!1},commonjs:{exports:!0,module:!1,require:!1,global:!1},amd:{define:!1,require:!1},mocha:{after:!1,afterEach:!1,before:!1,beforeEach:!1,context:!1,describe:!1,it:!1,mocha:!1,run:!1,setup:!1,specify:!1,suite:!1,suiteSetup:!1,suiteTeardown:!1,teardown:!1,test:!1,xcontext:!1,xdescribe:!1,xit:!1,xspecify:!1},jasmine:{afterAll:!1,afterEach:!1,beforeAll:!1,beforeEach:!1,describe:!1,expect:!1,fail:!1,fdescribe:!1,fit:!1,it:!1,jasmine:!1,pending:!1,runs:!1,spyOn:!1,spyOnProperty:!1,waits:!1,waitsFor:!1,xdescribe:!1,xit:!1},jest:{afterAll:!1,afterEach:!1,beforeAll:!1,beforeEach:!1,check:!1,describe:!1,expect:!1,gen:!1,it:!1,fdescribe:!1,fit:!1,jest:!1,pit:!1,require:!1,test:!1,xdescribe:!1,xit:!1,xtest:!1},qunit:{asyncTest:!1,deepEqual:!1,equal:!1,expect:!1,module:!1,notDeepEqual:!1,notEqual:!1,notOk:!1,notPropEqual:!1,notStrictEqual:!1,ok:!1,propEqual:!1,QUnit:!1,raises:!1,start:!1,stop:!1,strictEqual:!1,test:!1,throws:!1},phantomjs:{console:!0,exports:!0,phantom:!0,require:!0,WebPage:!0},couch:{emit:!1,exports:!1,getRow:!1,log:!1,module:!1,provides:!1,require:!1,respond:!1,send:!1,start:!1,sum:!1},rhino:{defineClass:!1,deserialize:!1,gc:!1,help:!1,importClass:!1,importPackage:!1,java:!1,load:!1,loadClass:!1,Packages:!1,print:!1,quit:!1,readFile:!1,readUrl:!1,runCommand:!1,seal:!1,serialize:!1,spawn:!1,sync:!1,toint32:!1,version:!1},nashorn:{__DIR__:!1,__FILE__:!1,__LINE__:!1,com:!1,edu:!1,exit:!1,Java:!1,java:!1,javafx:!1,JavaImporter:!1,javax:!1,JSAdapter:!1,load:!1,loadWithNewGlobal:!1,org:!1,Packages:!1,print:!1,quit:!1},wsh:{ActiveXObject:!0,Enumerator:!0,GetObject:!0,ScriptEngine:!0,ScriptEngineBuildVersion:!0,ScriptEngineMajorVersion:!0,ScriptEngineMinorVersion:!0,VBArray:!0,WScript:!0,WSH:!0,XDomainRequest:!0},jquery:{$:!1,jQuery:!1},yui:{Y:!1,YUI:!1,YUI_config:!1},shelljs:{cat:!1,cd:!1,chmod:!1,config:!1,cp:!1,dirs:!1,echo:!1,env:!1,error:!1,exec:!1,exit:!1,find:!1,grep:!1,ls:!1,ln:!1,mkdir:!1,mv:!1,popd:!1,pushd:!1,pwd:!1,rm:!1,sed:!1,set:!1,target:!1,tempdir:!1,test:!1,touch:!1,which:!1},prototypejs:{$:!1,$$:!1,$A:!1,$break:!1,$continue:!1,$F:!1,$H:!1,$R:!1,$w:!1,Abstract:!1,Ajax:!1,Autocompleter:!1,Builder:!1,Class:!1,Control:!1,Draggable:!1,Draggables:!1,Droppables:!1,Effect:!1,Element:!1,Enumerable:!1,Event:!1,Field:!1,Form:!1,Hash:!1,Insertion:!1,ObjectRange:!1,PeriodicalExecuter:!1,Position:!1,Prototype:!1,Scriptaculous:!1,Selector:!1,Sortable:!1,SortableObserver:!1,Sound:!1,Template:!1,Toggle:!1,Try:!1},meteor:{$:!1,_:!1,Accounts:!1,AccountsClient:!1,AccountsServer:!1,AccountsCommon:!1,App:!1,Assets:!1,Blaze:!1,check:!1,Cordova:!1,DDP:!1,DDPServer:!1,DDPRateLimiter:!1,Deps:!1,EJSON:!1,Email:!1,HTTP:!1,Log:!1,Match:!1,Meteor:!1,Mongo:!1,MongoInternals:!1,Npm:!1,Package:!1,Plugin:!1,process:!1,Random:!1,ReactiveDict:!1,ReactiveVar:!1,Router:!1,ServiceConfiguration:!1,Session:!1,share:!1,Spacebars:!1,Template:!1,Tinytest:!1,Tracker:!1,UI:!1,Utils:!1,WebApp:!1,WebAppInternals:!1},mongo:{_isWindows:!1,_rand:!1,BulkWriteResult:!1,cat:!1,cd:!1,connect:!1,db:!1,getHostName:!1,getMemInfo:!1,hostname:!1,ISODate:!1,listFiles:!1,load:!1,ls:!1,md5sumFile:!1,mkdir:!1,Mongo:!1,NumberInt:!1,NumberLong:!1,ObjectId:!1,PlanCache:!1,print:!1,printjson:!1,pwd:!1,quit:!1,removeFile:!1,rs:!1,sh:!1,UUID:!1,version:!1,WriteResult:!1},applescript:{$:!1,Application:!1,Automation:!1,console:!1,delay:!1,Library:!1,ObjC:!1,ObjectSpecifier:!1,Path:!1,Progress:!1,Ref:!1},serviceworker:{caches:!1,Cache:!1,CacheStorage:!1,Client:!1,clients:!1,Clients:!1,ExtendableEvent:!1,ExtendableMessageEvent:!1,FetchEvent:!1,importScripts:!1,registration:!1,self:!1,ServiceWorker:!1,ServiceWorkerContainer:!1,ServiceWorkerGlobalScope:!1,ServiceWorkerMessageEvent:!1,ServiceWorkerRegistration:!1,skipWaiting:!1,WindowClient:!1},atomtest:{advanceClock:!1,fakeClearInterval:!1,fakeClearTimeout:!1,fakeSetInterval:!1,fakeSetTimeout:!1,resetTimeouts:!1,waitsForPromise:!1},embertest:{andThen:!1,click:!1,currentPath:!1,currentRouteName:!1,currentURL:!1,fillIn:!1,find:!1,findWithAssert:!1,keyEvent:!1,pauseTest:!1,resumeTest:!1,triggerEvent:!1,visit:!1},protractor:{$:!1,$$:!1,browser:!1,By:!1,by:!1,DartObject:!1,element:!1,protractor:!1},"shared-node-browser":{clearInterval:!1,clearTimeout:!1,console:!1,setInterval:!1,setTimeout:!1},webextensions:{browser:!1,chrome:!1,opr:!1},greasemonkey:{GM_addStyle:!1,GM_deleteValue:!1,GM_getResourceText:!1,GM_getResourceURL:!1,GM_getValue:!1,GM_info:!1,GM_listValues:!1,GM_log:!1,GM_openInTab:!1,GM_registerMenuCommand:!1,GM_setClipboard:!1,GM_setValue:!1,GM_xmlhttpRequest:!1,unsafeWindow:!1}}},{}],168:[function(e,t,r){t.exports=e("./globals.json")},{"./globals.json":167}],169:[function(e,t,r){"use strict";r.__esModule=!0,r.NOT_LOCAL_BINDING=r.BLOCK_SCOPED_SYMBOL=r.INHERIT_KEYS=r.UNARY_OPERATORS=r.STRING_UNARY_OPERATORS=r.NUMBER_UNARY_OPERATORS=r.BOOLEAN_UNARY_OPERATORS=r.BINARY_OPERATORS=r.NUMBER_BINARY_OPERATORS=r.BOOLEAN_BINARY_OPERATORS=r.COMPARISON_BINARY_OPERATORS=r.EQUALITY_BINARY_OPERATORS=r.BOOLEAN_NUMBER_BINARY_OPERATORS=r.UPDATE_OPERATORS=r.LOGICAL_OPERATORS=r.COMMENT_KEYS=r.FOR_INIT_KEYS=r.FLATTENABLE_KEYS=r.STATEMENT_OR_BLOCK_KEYS=void 0;var n=function(e){return e&&e.__esModule?e:{default:e}}(e("babel-runtime/core-js/symbol/for")),i=(r.STATEMENT_OR_BLOCK_KEYS=["consequent","body","alternate"],r.FLATTENABLE_KEYS=["body","expressions"],r.FOR_INIT_KEYS=["left","init"],r.COMMENT_KEYS=["leadingComments","trailingComments","innerComments"],r.LOGICAL_OPERATORS=["||","&&"],r.UPDATE_OPERATORS=["++","--"],r.BOOLEAN_NUMBER_BINARY_OPERATORS=[">","<",">=","<="]),s=r.EQUALITY_BINARY_OPERATORS=["==","===","!=","!=="],a=r.COMPARISON_BINARY_OPERATORS=[].concat(s,["in","instanceof"]),o=r.BOOLEAN_BINARY_OPERATORS=[].concat(a,i),u=r.NUMBER_BINARY_OPERATORS=["-","/","%","*","**","&","|",">>",">>>","<<","^"],l=(r.BINARY_OPERATORS=["+"].concat(u,o),r.BOOLEAN_UNARY_OPERATORS=["delete","!"]),c=r.NUMBER_UNARY_OPERATORS=["+","-","++","--","~"],p=r.STRING_UNARY_OPERATORS=["typeof"];r.UNARY_OPERATORS=["void"].concat(l,c,p),r.INHERIT_KEYS={optional:["typeAnnotation","typeParameters","returnType"],force:["start","loc","end"]},r.BLOCK_SCOPED_SYMBOL=(0,n.default)("var used to be block scoped"),r.NOT_LOCAL_BINDING=(0,n.default)("should not be considered a local binding")},{"babel-runtime/core-js/symbol/for":130}],170:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t,r){var n=[],s=!0,a=e,o=Array.isArray(a),u=0;for(a=o?a:(0,l.default)(a);;){var c;if(o){if(u>=a.length)break;c=a[u++]}else{if((u=a.next()).done)break;c=u.value}var p=c;if(s=!1,h.isExpression(p))n.push(p);else if(h.isExpressionStatement(p))n.push(p.expression);else if(h.isVariableDeclaration(p)){if("var"!==p.kind)return;var f=p.declarations,d=Array.isArray(f),m=0;for(f=d?f:(0,l.default)(f);;){var y;if(d){if(m>=f.length)break;y=f[m++]}else{if((m=f.next()).done)break;y=m.value}var g=y,b=h.getBindingIdentifiers(g);for(var v in b)r.push({kind:p.kind,id:b[v]});g.init&&n.push(h.assignmentExpression("=",g.id,g.init))}s=!0}else if(h.isIfStatement(p)){var x=p.consequent?i([p.consequent],t,r):t.buildUndefinedNode(),E=p.alternate?i([p.alternate],t,r):t.buildUndefinedNode();if(!x||!E)return;n.push(h.conditionalExpression(p.test,x,E))}else if(h.isBlockStatement(p)){var A=i(p.body,t,r);if(!A)return;n.push(A)}else{if(!h.isEmptyStatement(p))return;s=!0}}return s&&n.push(t.buildUndefinedNode()),1===n.length?n[0]:h.sequenceExpression(n)}function s(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e.key,r=void 0;return"method"===e.kind?s.increment()+"":(r=h.isIdentifier(t)?t.name:h.isStringLiteral(t)?(0,u.default)(t.value):(0,u.default)(h.removePropertiesDeep(h.cloneDeep(t))),e.computed&&(r="["+r+"]"),e.static&&(r="static:"+r),r)}function a(e){return e+="",e=e.replace(/[^a-zA-Z0-9$_]/g,"-"),e=e.replace(/^[-0-9]+/,""),e=e.replace(/[-\s]+(.)?/g,function(e,t){return t?t.toUpperCase():""}),h.isValidIdentifier(e)||(e="_"+e),e||"_"}r.__esModule=!0;var o=n(e("babel-runtime/core-js/number/max-safe-integer")),u=n(e("babel-runtime/core-js/json/stringify")),l=n(e("babel-runtime/core-js/get-iterator"));r.toComputedKey=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e.key||e.property;return e.computed||h.isIdentifier(t)&&(t=h.stringLiteral(t.name)),t},r.toSequenceExpression=function(e,t){if(e&&e.length){var r=[],n=i(e,t,r);if(n){var s=r,a=Array.isArray(s),o=0;for(s=a?s:(0,l.default)(s);;){var u;if(a){if(o>=s.length)break;u=s[o++]}else{if((o=s.next()).done)break;u=o.value}var c=u;t.push(c)}return n}}},r.toKeyAlias=s,r.toIdentifier=a,r.toBindingIdentifierName=function(e){return"eval"!==(e=a(e))&&"arguments"!==e||(e="_"+e),e},r.toStatement=function(e,t){if(h.isStatement(e))return e;var r=!1,n=void 0;if(h.isClass(e))r=!0,n="ClassDeclaration";else if(h.isFunction(e))r=!0,n="FunctionDeclaration";else if(h.isAssignmentExpression(e))return h.expressionStatement(e);if(r&&!e.id&&(n=!1),!n){if(t)return!1;throw new Error("cannot turn "+e.type+" to a statement")}return e.type=n,e},r.toExpression=function(e){if(h.isExpressionStatement(e)&&(e=e.expression),h.isExpression(e))return e;if(h.isClass(e)?e.type="ClassExpression":h.isFunction(e)&&(e.type="FunctionExpression"),!h.isExpression(e))throw new Error("cannot turn "+e.type+" to an expression");return e},r.toBlock=function(e,t){return h.isBlockStatement(e)?e:(h.isEmptyStatement(e)&&(e=[]),Array.isArray(e)||(h.isStatement(e)||(e=h.isFunction(t)?h.returnStatement(e):h.expressionStatement(e)),e=[e]),h.blockStatement(e))},r.valueToNode=function(e){if(void 0===e)return h.identifier("undefined");if(!0===e||!1===e)return h.booleanLiteral(e);if(null===e)return h.nullLiteral();if("string"==typeof e)return h.stringLiteral(e);if("number"==typeof e)return h.numericLiteral(e);if((0,p.default)(e)){var t=e.source,r=e.toString().match(/\/([a-z]+|)$/)[1];return h.regExpLiteral(t,r)}if(Array.isArray(e))return h.arrayExpression(e.map(h.valueToNode));if((0,c.default)(e)){var n=[];for(var i in e){var s=void 0;s=h.isValidIdentifier(i)?h.identifier(i):h.stringLiteral(i),n.push(h.objectProperty(s,h.valueToNode(e[i])))}return h.objectExpression(n)}throw new Error("don't know how to turn this value into a node")};var c=n(e("lodash/isPlainObject")),p=n(e("lodash/isRegExp")),h=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(e("./index"));s.uid=0,s.increment=function(){return s.uid>=o.default?s.uid=0:s.uid++}},{"./index":180,"babel-runtime/core-js/get-iterator":120,"babel-runtime/core-js/json/stringify":121,"babel-runtime/core-js/number/max-safe-integer":123,"lodash/isPlainObject":518,"lodash/isRegExp":519}],171:[function(e,t,r){"use strict";var n=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(e("../index")),i=e("../constants"),s=e("./index"),a=function(e){return e&&e.__esModule?e:{default:e}}(s);(0,a.default)("ArrayExpression",{fields:{elements:{validate:(0,s.chain)((0,s.assertValueType)("array"),(0,s.assertEach)((0,s.assertNodeOrValueType)("null","Expression","SpreadElement"))),default:[]}},visitor:["elements"],aliases:["Expression"]}),(0,a.default)("AssignmentExpression",{fields:{operator:{validate:(0,s.assertValueType)("string")},left:{validate:(0,s.assertNodeType)("LVal")},right:{validate:(0,s.assertNodeType)("Expression")}},builder:["operator","left","right"],visitor:["left","right"],aliases:["Expression"]}),(0,a.default)("BinaryExpression",{builder:["operator","left","right"],fields:{operator:{validate:s.assertOneOf.apply(void 0,i.BINARY_OPERATORS)},left:{validate:(0,s.assertNodeType)("Expression")},right:{validate:(0,s.assertNodeType)("Expression")}},visitor:["left","right"],aliases:["Binary","Expression"]}),(0,a.default)("Directive",{visitor:["value"],fields:{value:{validate:(0,s.assertNodeType)("DirectiveLiteral")}}}),(0,a.default)("DirectiveLiteral",{builder:["value"],fields:{value:{validate:(0,s.assertValueType)("string")}}}),(0,a.default)("BlockStatement",{builder:["body","directives"],visitor:["directives","body"],fields:{directives:{validate:(0,s.chain)((0,s.assertValueType)("array"),(0,s.assertEach)((0,s.assertNodeType)("Directive"))),default:[]},body:{validate:(0,s.chain)((0,s.assertValueType)("array"),(0,s.assertEach)((0,s.assertNodeType)("Statement")))}},aliases:["Scopable","BlockParent","Block","Statement"]}),(0,a.default)("BreakStatement",{visitor:["label"],fields:{label:{validate:(0,s.assertNodeType)("Identifier"),optional:!0}},aliases:["Statement","Terminatorless","CompletionStatement"]}),(0,a.default)("CallExpression",{visitor:["callee","arguments"],fields:{callee:{validate:(0,s.assertNodeType)("Expression")},arguments:{validate:(0,s.chain)((0,s.assertValueType)("array"),(0,s.assertEach)((0,s.assertNodeType)("Expression","SpreadElement")))}},aliases:["Expression"]}),(0,a.default)("CatchClause",{visitor:["param","body"],fields:{param:{validate:(0,s.assertNodeType)("Identifier")},body:{validate:(0,s.assertNodeType)("BlockStatement")}},aliases:["Scopable"]}),(0,a.default)("ConditionalExpression",{visitor:["test","consequent","alternate"],fields:{test:{validate:(0,s.assertNodeType)("Expression")},consequent:{validate:(0,s.assertNodeType)("Expression")},alternate:{validate:(0,s.assertNodeType)("Expression")}},aliases:["Expression","Conditional"]}),(0,a.default)("ContinueStatement",{visitor:["label"],fields:{label:{validate:(0,s.assertNodeType)("Identifier"),optional:!0}},aliases:["Statement","Terminatorless","CompletionStatement"]}),(0,a.default)("DebuggerStatement",{aliases:["Statement"]}),(0,a.default)("DoWhileStatement",{visitor:["test","body"],fields:{test:{validate:(0,s.assertNodeType)("Expression")},body:{validate:(0,s.assertNodeType)("Statement")}},aliases:["Statement","BlockParent","Loop","While","Scopable"]}),(0,a.default)("EmptyStatement",{aliases:["Statement"]}),(0,a.default)("ExpressionStatement",{visitor:["expression"],fields:{expression:{validate:(0,s.assertNodeType)("Expression")}},aliases:["Statement","ExpressionWrapper"]}),(0,a.default)("File",{builder:["program","comments","tokens"],visitor:["program"],fields:{program:{validate:(0,s.assertNodeType)("Program")}}}),(0,a.default)("ForInStatement",{visitor:["left","right","body"],aliases:["Scopable","Statement","For","BlockParent","Loop","ForXStatement"],fields:{left:{validate:(0,s.assertNodeType)("VariableDeclaration","LVal")},right:{validate:(0,s.assertNodeType)("Expression")},body:{validate:(0,s.assertNodeType)("Statement")}}}),(0,a.default)("ForStatement",{visitor:["init","test","update","body"],aliases:["Scopable","Statement","For","BlockParent","Loop"],fields:{init:{validate:(0,s.assertNodeType)("VariableDeclaration","Expression"),optional:!0},test:{validate:(0,s.assertNodeType)("Expression"),optional:!0},update:{validate:(0,s.assertNodeType)("Expression"),optional:!0},body:{validate:(0,s.assertNodeType)("Statement")}}}),(0,a.default)("FunctionDeclaration",{builder:["id","params","body","generator","async"],visitor:["id","params","body","returnType","typeParameters"],fields:{id:{validate:(0,s.assertNodeType)("Identifier")},params:{validate:(0,s.chain)((0,s.assertValueType)("array"),(0,s.assertEach)((0,s.assertNodeType)("LVal")))},body:{validate:(0,s.assertNodeType)("BlockStatement")},generator:{default:!1,validate:(0,s.assertValueType)("boolean")},async:{default:!1,validate:(0,s.assertValueType)("boolean")}},aliases:["Scopable","Function","BlockParent","FunctionParent","Statement","Pureish","Declaration"]}),(0,a.default)("FunctionExpression",{inherits:"FunctionDeclaration",aliases:["Scopable","Function","BlockParent","FunctionParent","Expression","Pureish"],fields:{id:{validate:(0,s.assertNodeType)("Identifier"),optional:!0},params:{validate:(0,s.chain)((0,s.assertValueType)("array"),(0,s.assertEach)((0,s.assertNodeType)("LVal")))},body:{validate:(0,s.assertNodeType)("BlockStatement")},generator:{default:!1,validate:(0,s.assertValueType)("boolean")},async:{default:!1,validate:(0,s.assertValueType)("boolean")}}}),(0,a.default)("Identifier",{builder:["name"],visitor:["typeAnnotation"],aliases:["Expression","LVal"],fields:{name:{validate:function(e,t,r){n.isValidIdentifier(r)}},decorators:{validate:(0,s.chain)((0,s.assertValueType)("array"),(0,s.assertEach)((0,s.assertNodeType)("Decorator")))}}}),(0,a.default)("IfStatement",{visitor:["test","consequent","alternate"],aliases:["Statement","Conditional"],fields:{test:{validate:(0,s.assertNodeType)("Expression")},consequent:{validate:(0,s.assertNodeType)("Statement")},alternate:{optional:!0,validate:(0,s.assertNodeType)("Statement")}}}),(0,a.default)("LabeledStatement",{visitor:["label","body"],aliases:["Statement"],fields:{label:{validate:(0,s.assertNodeType)("Identifier")},body:{validate:(0,s.assertNodeType)("Statement")}}}),(0,a.default)("StringLiteral",{builder:["value"],fields:{value:{validate:(0,s.assertValueType)("string")}},aliases:["Expression","Pureish","Literal","Immutable"]}),(0,a.default)("NumericLiteral",{builder:["value"],deprecatedAlias:"NumberLiteral",fields:{value:{validate:(0,s.assertValueType)("number")}},aliases:["Expression","Pureish","Literal","Immutable"]}),(0,a.default)("NullLiteral",{aliases:["Expression","Pureish","Literal","Immutable"]}),(0,a.default)("BooleanLiteral",{builder:["value"],fields:{value:{validate:(0,s.assertValueType)("boolean")}},aliases:["Expression","Pureish","Literal","Immutable"]}),(0,a.default)("RegExpLiteral",{builder:["pattern","flags"],deprecatedAlias:"RegexLiteral",aliases:["Expression","Literal"],fields:{pattern:{validate:(0,s.assertValueType)("string")},flags:{validate:(0,s.assertValueType)("string"),default:""}}}),(0,a.default)("LogicalExpression",{builder:["operator","left","right"],visitor:["left","right"],aliases:["Binary","Expression"],fields:{operator:{validate:s.assertOneOf.apply(void 0,i.LOGICAL_OPERATORS)},left:{validate:(0,s.assertNodeType)("Expression")},right:{validate:(0,s.assertNodeType)("Expression")}}}),(0,a.default)("MemberExpression",{builder:["object","property","computed"],visitor:["object","property"],aliases:["Expression","LVal"],fields:{object:{validate:(0,s.assertNodeType)("Expression")},property:{validate:function(e,t,r){var n=e.computed?"Expression":"Identifier";(0,s.assertNodeType)(n)(e,t,r)}},computed:{default:!1}}}),(0,a.default)("NewExpression",{visitor:["callee","arguments"],aliases:["Expression"],fields:{callee:{validate:(0,s.assertNodeType)("Expression")},arguments:{validate:(0,s.chain)((0,s.assertValueType)("array"),(0,s.assertEach)((0,s.assertNodeType)("Expression","SpreadElement")))}}}),(0,a.default)("Program",{visitor:["directives","body"],builder:["body","directives"],fields:{directives:{validate:(0,s.chain)((0,s.assertValueType)("array"),(0,s.assertEach)((0,s.assertNodeType)("Directive"))),default:[]},body:{validate:(0,s.chain)((0,s.assertValueType)("array"),(0,s.assertEach)((0,s.assertNodeType)("Statement")))}},aliases:["Scopable","BlockParent","Block","FunctionParent"]}),(0,a.default)("ObjectExpression",{visitor:["properties"],aliases:["Expression"],fields:{properties:{validate:(0,s.chain)((0,s.assertValueType)("array"),(0,s.assertEach)((0,s.assertNodeType)("ObjectMethod","ObjectProperty","SpreadProperty")))}}}),(0,a.default)("ObjectMethod",{builder:["kind","key","params","body","computed"],fields:{kind:{validate:(0,s.chain)((0,s.assertValueType)("string"),(0,s.assertOneOf)("method","get","set")),default:"method"},computed:{validate:(0,s.assertValueType)("boolean"),default:!1},key:{validate:function(e,t,r){var n=e.computed?["Expression"]:["Identifier","StringLiteral","NumericLiteral"];s.assertNodeType.apply(void 0,n)(e,t,r)}},decorators:{validate:(0,s.chain)((0,s.assertValueType)("array"),(0,s.assertEach)((0,s.assertNodeType)("Decorator")))},body:{validate:(0,s.assertNodeType)("BlockStatement")},generator:{default:!1,validate:(0,s.assertValueType)("boolean")},async:{default:!1,validate:(0,s.assertValueType)("boolean")}},visitor:["key","params","body","decorators","returnType","typeParameters"],aliases:["UserWhitespacable","Function","Scopable","BlockParent","FunctionParent","Method","ObjectMember"]}),(0,a.default)("ObjectProperty",{builder:["key","value","computed","shorthand","decorators"],fields:{computed:{validate:(0,s.assertValueType)("boolean"),default:!1},key:{validate:function(e,t,r){var n=e.computed?["Expression"]:["Identifier","StringLiteral","NumericLiteral"];s.assertNodeType.apply(void 0,n)(e,t,r)}},value:{validate:(0,s.assertNodeType)("Expression","Pattern","RestElement")},shorthand:{validate:(0,s.assertValueType)("boolean"),default:!1},decorators:{validate:(0,s.chain)((0,s.assertValueType)("array"),(0,s.assertEach)((0,s.assertNodeType)("Decorator"))),optional:!0}},visitor:["key","value","decorators"],aliases:["UserWhitespacable","Property","ObjectMember"]}),(0,a.default)("RestElement",{visitor:["argument","typeAnnotation"],aliases:["LVal"],fields:{argument:{validate:(0,s.assertNodeType)("LVal")},decorators:{validate:(0,s.chain)((0,s.assertValueType)("array"),(0,s.assertEach)((0,s.assertNodeType)("Decorator")))}}}),(0,a.default)("ReturnStatement",{visitor:["argument"],aliases:["Statement","Terminatorless","CompletionStatement"],fields:{argument:{validate:(0,s.assertNodeType)("Expression"),optional:!0}}}),(0,a.default)("SequenceExpression",{visitor:["expressions"],fields:{expressions:{validate:(0,s.chain)((0,s.assertValueType)("array"),(0,s.assertEach)((0,s.assertNodeType)("Expression")))}},aliases:["Expression"]}),(0,a.default)("SwitchCase",{visitor:["test","consequent"],fields:{test:{validate:(0,s.assertNodeType)("Expression"),optional:!0},consequent:{validate:(0,s.chain)((0,s.assertValueType)("array"),(0,s.assertEach)((0,s.assertNodeType)("Statement")))}}}),(0,a.default)("SwitchStatement",{visitor:["discriminant","cases"],aliases:["Statement","BlockParent","Scopable"],fields:{discriminant:{validate:(0,s.assertNodeType)("Expression")},cases:{validate:(0,s.chain)((0,s.assertValueType)("array"),(0,s.assertEach)((0,s.assertNodeType)("SwitchCase")))}}}),(0,a.default)("ThisExpression",{aliases:["Expression"]}),(0,a.default)("ThrowStatement",{visitor:["argument"],aliases:["Statement","Terminatorless","CompletionStatement"],fields:{argument:{validate:(0,s.assertNodeType)("Expression")}}}),(0,a.default)("TryStatement",{visitor:["block","handler","finalizer"],aliases:["Statement"],fields:{body:{validate:(0,s.assertNodeType)("BlockStatement")},handler:{optional:!0,handler:(0,s.assertNodeType)("BlockStatement")},finalizer:{optional:!0,validate:(0,s.assertNodeType)("BlockStatement")}}}),(0,a.default)("UnaryExpression",{builder:["operator","argument","prefix"],fields:{prefix:{default:!0},argument:{validate:(0,s.assertNodeType)("Expression")},operator:{validate:s.assertOneOf.apply(void 0,i.UNARY_OPERATORS)}},visitor:["argument"],aliases:["UnaryLike","Expression"]}),(0,a.default)("UpdateExpression",{builder:["operator","argument","prefix"],fields:{prefix:{default:!1},argument:{validate:(0,s.assertNodeType)("Expression")},operator:{validate:s.assertOneOf.apply(void 0,i.UPDATE_OPERATORS)}},visitor:["argument"],aliases:["Expression"]}),(0,a.default)("VariableDeclaration",{builder:["kind","declarations"],visitor:["declarations"],aliases:["Statement","Declaration"],fields:{kind:{validate:(0,s.chain)((0,s.assertValueType)("string"),(0,s.assertOneOf)("var","let","const"))},declarations:{validate:(0,s.chain)((0,s.assertValueType)("array"),(0,s.assertEach)((0,s.assertNodeType)("VariableDeclarator")))}}}),(0,a.default)("VariableDeclarator",{visitor:["id","init"],fields:{id:{validate:(0,s.assertNodeType)("LVal")},init:{optional:!0,validate:(0,s.assertNodeType)("Expression")}}}),(0,a.default)("WhileStatement",{visitor:["test","body"],aliases:["Statement","BlockParent","Loop","While","Scopable"],fields:{test:{validate:(0,s.assertNodeType)("Expression")},body:{validate:(0,s.assertNodeType)("BlockStatement","Statement")}}}),(0,a.default)("WithStatement",{visitor:["object","body"],aliases:["Statement"],fields:{object:{object:(0,s.assertNodeType)("Expression")},body:{validate:(0,s.assertNodeType)("BlockStatement","Statement")}}})},{"../constants":169,"../index":180,"./index":175}],172:[function(e,t,r){"use strict";var n=e("./index"),i=function(e){return e&&e.__esModule?e:{default:e}}(n);(0,i.default)("AssignmentPattern",{visitor:["left","right"],aliases:["Pattern","LVal"],fields:{left:{validate:(0,n.assertNodeType)("Identifier")},right:{validate:(0,n.assertNodeType)("Expression")},decorators:{validate:(0,n.chain)((0,n.assertValueType)("array"),(0,n.assertEach)((0,n.assertNodeType)("Decorator")))}}}),(0,i.default)("ArrayPattern",{visitor:["elements","typeAnnotation"],aliases:["Pattern","LVal"],fields:{elements:{validate:(0,n.chain)((0,n.assertValueType)("array"),(0,n.assertEach)((0,n.assertNodeType)("Identifier","Pattern","RestElement")))},decorators:{validate:(0,n.chain)((0,n.assertValueType)("array"),(0,n.assertEach)((0,n.assertNodeType)("Decorator")))}}}),(0,i.default)("ArrowFunctionExpression",{builder:["params","body","async"],visitor:["params","body","returnType","typeParameters"],aliases:["Scopable","Function","BlockParent","FunctionParent","Expression","Pureish"],fields:{params:{validate:(0,n.chain)((0,n.assertValueType)("array"),(0,n.assertEach)((0,n.assertNodeType)("LVal")))},body:{validate:(0,n.assertNodeType)("BlockStatement","Expression")},async:{validate:(0,n.assertValueType)("boolean"),default:!1}}}),(0,i.default)("ClassBody",{visitor:["body"],fields:{body:{validate:(0,n.chain)((0,n.assertValueType)("array"),(0,n.assertEach)((0,n.assertNodeType)("ClassMethod","ClassProperty")))}}}),(0,i.default)("ClassDeclaration",{builder:["id","superClass","body","decorators"],visitor:["id","body","superClass","mixins","typeParameters","superTypeParameters","implements","decorators"],aliases:["Scopable","Class","Statement","Declaration","Pureish"],fields:{id:{validate:(0,n.assertNodeType)("Identifier")},body:{validate:(0,n.assertNodeType)("ClassBody")},superClass:{optional:!0,validate:(0,n.assertNodeType)("Expression")},decorators:{validate:(0,n.chain)((0,n.assertValueType)("array"),(0,n.assertEach)((0,n.assertNodeType)("Decorator")))}}}),(0,i.default)("ClassExpression",{inherits:"ClassDeclaration",aliases:["Scopable","Class","Expression","Pureish"],fields:{id:{optional:!0,validate:(0,n.assertNodeType)("Identifier")},body:{validate:(0,n.assertNodeType)("ClassBody")},superClass:{optional:!0,validate:(0,n.assertNodeType)("Expression")},decorators:{validate:(0,n.chain)((0,n.assertValueType)("array"),(0,n.assertEach)((0,n.assertNodeType)("Decorator")))}}}),(0,i.default)("ExportAllDeclaration",{visitor:["source"],aliases:["Statement","Declaration","ModuleDeclaration","ExportDeclaration"],fields:{source:{validate:(0,n.assertNodeType)("StringLiteral")}}}),(0,i.default)("ExportDefaultDeclaration",{visitor:["declaration"],aliases:["Statement","Declaration","ModuleDeclaration","ExportDeclaration"],fields:{declaration:{validate:(0,n.assertNodeType)("FunctionDeclaration","ClassDeclaration","Expression")}}}),(0,i.default)("ExportNamedDeclaration",{visitor:["declaration","specifiers","source"],aliases:["Statement","Declaration","ModuleDeclaration","ExportDeclaration"],fields:{declaration:{validate:(0,n.assertNodeType)("Declaration"),optional:!0},specifiers:{validate:(0,n.chain)((0,n.assertValueType)("array"),(0,n.assertEach)((0,n.assertNodeType)("ExportSpecifier")))},source:{validate:(0,n.assertNodeType)("StringLiteral"),optional:!0}}}),(0,i.default)("ExportSpecifier",{visitor:["local","exported"],aliases:["ModuleSpecifier"],fields:{local:{validate:(0,n.assertNodeType)("Identifier")},exported:{validate:(0,n.assertNodeType)("Identifier")}}}),(0,i.default)("ForOfStatement",{visitor:["left","right","body"],aliases:["Scopable","Statement","For","BlockParent","Loop","ForXStatement"],fields:{left:{validate:(0,n.assertNodeType)("VariableDeclaration","LVal")},right:{validate:(0,n.assertNodeType)("Expression")},body:{validate:(0,n.assertNodeType)("Statement")}}}),(0,i.default)("ImportDeclaration",{visitor:["specifiers","source"],aliases:["Statement","Declaration","ModuleDeclaration"],fields:{specifiers:{validate:(0,n.chain)((0,n.assertValueType)("array"),(0,n.assertEach)((0,n.assertNodeType)("ImportSpecifier","ImportDefaultSpecifier","ImportNamespaceSpecifier")))},source:{validate:(0,n.assertNodeType)("StringLiteral")}}}),(0,i.default)("ImportDefaultSpecifier",{visitor:["local"],aliases:["ModuleSpecifier"],fields:{local:{validate:(0,n.assertNodeType)("Identifier")}}}),(0,i.default)("ImportNamespaceSpecifier",{visitor:["local"],aliases:["ModuleSpecifier"],fields:{local:{validate:(0,n.assertNodeType)("Identifier")}}}),(0,i.default)("ImportSpecifier",{visitor:["local","imported"],aliases:["ModuleSpecifier"],fields:{local:{validate:(0,n.assertNodeType)("Identifier")},imported:{validate:(0,n.assertNodeType)("Identifier")},importKind:{validate:(0,n.assertOneOf)(null,"type","typeof")}}}),(0,i.default)("MetaProperty",{visitor:["meta","property"],aliases:["Expression"],fields:{meta:{validate:(0,n.assertValueType)("string")},property:{validate:(0,n.assertValueType)("string")}}}),(0,i.default)("ClassMethod",{aliases:["Function","Scopable","BlockParent","FunctionParent","Method"],builder:["kind","key","params","body","computed","static"],visitor:["key","params","body","decorators","returnType","typeParameters"],fields:{kind:{validate:(0,n.chain)((0,n.assertValueType)("string"),(0,n.assertOneOf)("get","set","method","constructor")),default:"method"},computed:{default:!1,validate:(0,n.assertValueType)("boolean")},static:{default:!1,validate:(0,n.assertValueType)("boolean")},key:{validate:function(e,t,r){var i=e.computed?["Expression"]:["Identifier","StringLiteral","NumericLiteral"];n.assertNodeType.apply(void 0,i)(e,t,r)}},params:{validate:(0,n.chain)((0,n.assertValueType)("array"),(0,n.assertEach)((0,n.assertNodeType)("LVal")))},body:{validate:(0,n.assertNodeType)("BlockStatement")},generator:{default:!1,validate:(0,n.assertValueType)("boolean")},async:{default:!1,validate:(0,n.assertValueType)("boolean")}}}),(0,i.default)("ObjectPattern",{visitor:["properties","typeAnnotation"],aliases:["Pattern","LVal"],fields:{properties:{validate:(0,n.chain)((0,n.assertValueType)("array"),(0,n.assertEach)((0,n.assertNodeType)("RestProperty","Property")))},decorators:{validate:(0,n.chain)((0,n.assertValueType)("array"),(0,n.assertEach)((0,n.assertNodeType)("Decorator")))}}}),(0,i.default)("SpreadElement",{visitor:["argument"],aliases:["UnaryLike"],fields:{argument:{validate:(0,n.assertNodeType)("Expression")}}}),(0,i.default)("Super",{aliases:["Expression"]}),(0,i.default)("TaggedTemplateExpression",{visitor:["tag","quasi"],aliases:["Expression"],fields:{tag:{validate:(0,n.assertNodeType)("Expression")},quasi:{validate:(0,n.assertNodeType)("TemplateLiteral")}}}),(0,i.default)("TemplateElement",{builder:["value","tail"],fields:{value:{},tail:{validate:(0,n.assertValueType)("boolean"),default:!1}}}),(0,i.default)("TemplateLiteral",{visitor:["quasis","expressions"],aliases:["Expression","Literal"],fields:{quasis:{validate:(0,n.chain)((0,n.assertValueType)("array"),(0,n.assertEach)((0,n.assertNodeType)("TemplateElement")))},expressions:{validate:(0,n.chain)((0,n.assertValueType)("array"),(0,n.assertEach)((0,n.assertNodeType)("Expression")))}}}),(0,i.default)("YieldExpression",{builder:["argument","delegate"],visitor:["argument"],aliases:["Expression","Terminatorless"],fields:{delegate:{validate:(0,n.assertValueType)("boolean"),default:!1},argument:{optional:!0,validate:(0,n.assertNodeType)("Expression")}}})},{"./index":175}],173:[function(e,t,r){"use strict";var n=e("./index"),i=function(e){return e&&e.__esModule?e:{default:e}}(n);(0,i.default)("AwaitExpression",{builder:["argument"],visitor:["argument"],aliases:["Expression","Terminatorless"],fields:{argument:{validate:(0,n.assertNodeType)("Expression")}}}),(0,i.default)("ForAwaitStatement",{visitor:["left","right","body"],aliases:["Scopable","Statement","For","BlockParent","Loop","ForXStatement"],fields:{left:{validate:(0,n.assertNodeType)("VariableDeclaration","LVal")},right:{validate:(0,n.assertNodeType)("Expression")},body:{validate:(0,n.assertNodeType)("Statement")}}}),(0,i.default)("BindExpression",{visitor:["object","callee"],aliases:["Expression"],fields:{}}),(0,i.default)("Import",{aliases:["Expression"]}),(0,i.default)("Decorator",{visitor:["expression"],fields:{expression:{validate:(0,n.assertNodeType)("Expression")}}}),(0,i.default)("DoExpression",{visitor:["body"],aliases:["Expression"],fields:{body:{validate:(0,n.assertNodeType)("BlockStatement")}}}),(0,i.default)("ExportDefaultSpecifier",{visitor:["exported"],aliases:["ModuleSpecifier"],fields:{exported:{validate:(0,n.assertNodeType)("Identifier")}}}),(0,i.default)("ExportNamespaceSpecifier",{visitor:["exported"],aliases:["ModuleSpecifier"],fields:{exported:{validate:(0,n.assertNodeType)("Identifier")}}}),(0,i.default)("RestProperty",{visitor:["argument"],aliases:["UnaryLike"],fields:{argument:{validate:(0,n.assertNodeType)("LVal")}}}),(0,i.default)("SpreadProperty",{visitor:["argument"],aliases:["UnaryLike"],fields:{argument:{validate:(0,n.assertNodeType)("Expression")}}})},{"./index":175}],174:[function(e,t,r){"use strict";var n=e("./index"),i=function(e){return e&&e.__esModule?e:{default:e}}(n);(0,i.default)("AnyTypeAnnotation",{aliases:["Flow","FlowBaseAnnotation"],fields:{}}),(0,i.default)("ArrayTypeAnnotation",{visitor:["elementType"],aliases:["Flow"],fields:{}}),(0,i.default)("BooleanTypeAnnotation",{aliases:["Flow","FlowBaseAnnotation"],fields:{}}),(0,i.default)("BooleanLiteralTypeAnnotation",{aliases:["Flow"],fields:{}}),(0,i.default)("NullLiteralTypeAnnotation",{aliases:["Flow","FlowBaseAnnotation"],fields:{}}),(0,i.default)("ClassImplements",{visitor:["id","typeParameters"],aliases:["Flow"],fields:{}}),(0,i.default)("ClassProperty",{visitor:["key","value","typeAnnotation","decorators"],builder:["key","value","typeAnnotation","decorators","computed"],aliases:["Property"],fields:{computed:{validate:(0,n.assertValueType)("boolean"),default:!1}}}),(0,i.default)("DeclareClass",{visitor:["id","typeParameters","extends","body"],aliases:["Flow","FlowDeclaration","Statement","Declaration"],fields:{}}),(0,i.default)("DeclareFunction",{visitor:["id"],aliases:["Flow","FlowDeclaration","Statement","Declaration"],fields:{}}),(0,i.default)("DeclareInterface",{visitor:["id","typeParameters","extends","body"],aliases:["Flow","FlowDeclaration","Statement","Declaration"],fields:{}}),(0,i.default)("DeclareModule",{visitor:["id","body"],aliases:["Flow","FlowDeclaration","Statement","Declaration"],fields:{}}),(0,i.default)("DeclareModuleExports",{visitor:["typeAnnotation"],aliases:["Flow","FlowDeclaration","Statement","Declaration"],fields:{}}),(0,i.default)("DeclareTypeAlias",{visitor:["id","typeParameters","right"],aliases:["Flow","FlowDeclaration","Statement","Declaration"],fields:{}}),(0,i.default)("DeclareOpaqueType",{visitor:["id","typeParameters","supertype"],aliases:["Flow","FlowDeclaration","Statement","Declaration"],fields:{}}),(0,i.default)("DeclareVariable",{visitor:["id"],aliases:["Flow","FlowDeclaration","Statement","Declaration"],fields:{}}),(0,i.default)("DeclareExportDeclaration",{visitor:["declaration","specifiers","source"],aliases:["Flow","FlowDeclaration","Statement","Declaration"],fields:{}}),(0,i.default)("ExistentialTypeParam",{aliases:["Flow"]}),(0,i.default)("FunctionTypeAnnotation",{visitor:["typeParameters","params","rest","returnType"],aliases:["Flow"],fields:{}}),(0,i.default)("FunctionTypeParam",{visitor:["name","typeAnnotation"],aliases:["Flow"],fields:{}}),(0,i.default)("GenericTypeAnnotation",{visitor:["id","typeParameters"],aliases:["Flow"],fields:{}}),(0,i.default)("InterfaceExtends",{visitor:["id","typeParameters"],aliases:["Flow"],fields:{}}),(0,i.default)("InterfaceDeclaration",{visitor:["id","typeParameters","extends","body"],aliases:["Flow","FlowDeclaration","Statement","Declaration"],fields:{}}),(0,i.default)("IntersectionTypeAnnotation",{visitor:["types"],aliases:["Flow"],fields:{}}),(0,i.default)("MixedTypeAnnotation",{aliases:["Flow","FlowBaseAnnotation"]}),(0,i.default)("EmptyTypeAnnotation",{aliases:["Flow","FlowBaseAnnotation"]}),(0,i.default)("NullableTypeAnnotation",{visitor:["typeAnnotation"],aliases:["Flow"],fields:{}}),(0,i.default)("NumericLiteralTypeAnnotation",{aliases:["Flow"],fields:{}}),(0,i.default)("NumberTypeAnnotation",{aliases:["Flow","FlowBaseAnnotation"],fields:{}}),(0,i.default)("StringLiteralTypeAnnotation",{aliases:["Flow"],fields:{}}),(0,i.default)("StringTypeAnnotation",{aliases:["Flow","FlowBaseAnnotation"],fields:{}}),(0,i.default)("ThisTypeAnnotation",{aliases:["Flow","FlowBaseAnnotation"],fields:{}}),(0,i.default)("TupleTypeAnnotation",{visitor:["types"],aliases:["Flow"],fields:{}}),(0,i.default)("TypeofTypeAnnotation",{visitor:["argument"],aliases:["Flow"],fields:{}}),(0,i.default)("TypeAlias",{visitor:["id","typeParameters","right"],aliases:["Flow","FlowDeclaration","Statement","Declaration"],fields:{}}),(0,i.default)("OpaqueType",{visitor:["id","typeParameters","impltype","supertype"],aliases:["Flow","FlowDeclaration","Statement","Declaration"],fields:{}}),(0,i.default)("TypeAnnotation",{visitor:["typeAnnotation"],aliases:["Flow"],fields:{}}),(0,i.default)("TypeCastExpression",{visitor:["expression","typeAnnotation"],aliases:["Flow","ExpressionWrapper","Expression"],fields:{}}),(0,i.default)("TypeParameter",{visitor:["bound"],aliases:["Flow"],fields:{}}),(0,i.default)("TypeParameterDeclaration",{visitor:["params"],aliases:["Flow"],fields:{}}),(0,i.default)("TypeParameterInstantiation",{visitor:["params"],aliases:["Flow"],fields:{}}),(0,i.default)("ObjectTypeAnnotation",{visitor:["properties","indexers","callProperties"],aliases:["Flow"],fields:{}}),(0,i.default)("ObjectTypeCallProperty",{visitor:["value"],aliases:["Flow","UserWhitespacable"],fields:{}}),(0,i.default)("ObjectTypeIndexer",{visitor:["id","key","value"],aliases:["Flow","UserWhitespacable"],fields:{}}),(0,i.default)("ObjectTypeProperty",{visitor:["key","value"],aliases:["Flow","UserWhitespacable"],fields:{}}),(0,i.default)("ObjectTypeSpreadProperty",{visitor:["argument"],aliases:["Flow","UserWhitespacable"],fields:{}}),(0,i.default)("QualifiedTypeIdentifier",{visitor:["id","qualification"],aliases:["Flow"],fields:{}}),(0,i.default)("UnionTypeAnnotation",{visitor:["types"],aliases:["Flow"],fields:{}}),(0,i.default)("VoidTypeAnnotation",{aliases:["Flow","FlowBaseAnnotation"],fields:{}})},{"./index":175}],175:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e){return Array.isArray(e)?"array":null===e?"null":void 0===e?"undefined":void 0===e?"undefined":(0,u.default)(e)}function s(e){function t(t,r,n){if(!(i(n)===e))throw new TypeError("Property "+r+" expected type of "+e+" but got "+i(n))}return t.type=e,t}r.__esModule=!0,r.DEPRECATED_KEYS=r.BUILDER_KEYS=r.NODE_FIELDS=r.ALIAS_KEYS=r.VISITOR_KEYS=void 0;var a=n(e("babel-runtime/core-js/get-iterator")),o=n(e("babel-runtime/core-js/json/stringify")),u=n(e("babel-runtime/helpers/typeof"));r.assertEach=function(e){function t(t,r,n){if(Array.isArray(n))for(var i=0;i=s.length)break;p=s[c++]}else{if((c=s.next()).done)break;p=c.value}var h=p;if(l.is(h,n)){i=!0;break}}if(!i)throw new TypeError("Property "+t+" of "+e.type+" expected node to be of a type "+(0,o.default)(r)+" but instead got "+(0,o.default)(n&&n.type))}for(var t=arguments.length,r=Array(t),n=0;n=u.length)break;h=u[p++]}else{if((p=u.next()).done)break;h=p.value}var f=h;if(i(n)===f||l.is(f,n)){s=!0;break}}if(!s)throw new TypeError("Property "+t+" of "+e.type+" expected node to be of a type "+(0,o.default)(r)+" but instead got "+(0,o.default)(n&&n.type))}for(var t=arguments.length,r=Array(t),n=0;n=e.length)break;i=e[n++]}else{if((n=e.next()).done)break;i=n.value}i.apply(void 0,arguments)}}for(var t=arguments.length,r=Array(t),n=0;n1&&void 0!==arguments[1]?arguments[1]:{},r=t.inherits&&m[t.inherits]||{};t.fields=t.fields||r.fields||{},t.visitor=t.visitor||r.visitor||[],t.aliases=t.aliases||r.aliases||[],t.builder=t.builder||r.builder||t.visitor||[],t.deprecatedAlias&&(d[t.deprecatedAlias]=e);var n=t.visitor.concat(t.builder),o=Array.isArray(n),u=0;for(n=o?n:(0,a.default)(n);;){var l;if(o){if(u>=n.length)break;l=n[u++]}else{if((u=n.next()).done)break;l=u.value}var y=l;t.fields[y]=t.fields[y]||{}}for(var g in t.fields){var b=t.fields[g];-1===t.builder.indexOf(g)&&(b.optional=!0),void 0===b.default?b.default=null:b.validate||(b.validate=s(i(b.default)))}c[e]=t.visitor,f[e]=t.builder,h[e]=t.fields,p[e]=t.aliases,m[e]=t};var l=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(e("../index")),c=r.VISITOR_KEYS={},p=r.ALIAS_KEYS={},h=r.NODE_FIELDS={},f=r.BUILDER_KEYS={},d=r.DEPRECATED_KEYS={},m={}},{"../index":180,"babel-runtime/core-js/get-iterator":120,"babel-runtime/core-js/json/stringify":121,"babel-runtime/helpers/typeof":138}],176:[function(e,t,r){"use strict";e("./index"),e("./core"),e("./es2015"),e("./flow"),e("./jsx"),e("./misc"),e("./experimental")},{"./core":171,"./es2015":172,"./experimental":173,"./flow":174,"./index":175,"./jsx":177,"./misc":178}],177:[function(e,t,r){"use strict";var n=e("./index"),i=function(e){return e&&e.__esModule?e:{default:e}}(n);(0,i.default)("JSXAttribute",{visitor:["name","value"],aliases:["JSX","Immutable"],fields:{name:{validate:(0,n.assertNodeType)("JSXIdentifier","JSXNamespacedName")},value:{optional:!0,validate:(0,n.assertNodeType)("JSXElement","StringLiteral","JSXExpressionContainer")}}}),(0,i.default)("JSXClosingElement",{visitor:["name"],aliases:["JSX","Immutable"],fields:{name:{validate:(0,n.assertNodeType)("JSXIdentifier","JSXMemberExpression")}}}),(0,i.default)("JSXElement",{builder:["openingElement","closingElement","children","selfClosing"],visitor:["openingElement","children","closingElement"],aliases:["JSX","Immutable","Expression"],fields:{openingElement:{validate:(0,n.assertNodeType)("JSXOpeningElement")},closingElement:{optional:!0,validate:(0,n.assertNodeType)("JSXClosingElement")},children:{validate:(0,n.chain)((0,n.assertValueType)("array"),(0,n.assertEach)((0,n.assertNodeType)("JSXText","JSXExpressionContainer","JSXSpreadChild","JSXElement")))}}}),(0,i.default)("JSXEmptyExpression",{aliases:["JSX","Expression"]}),(0,i.default)("JSXExpressionContainer",{visitor:["expression"],aliases:["JSX","Immutable"],fields:{expression:{validate:(0,n.assertNodeType)("Expression")}}}),(0,i.default)("JSXSpreadChild",{visitor:["expression"],aliases:["JSX","Immutable"],fields:{expression:{validate:(0,n.assertNodeType)("Expression")}}}),(0,i.default)("JSXIdentifier",{builder:["name"],aliases:["JSX","Expression"],fields:{name:{validate:(0,n.assertValueType)("string")}}}),(0,i.default)("JSXMemberExpression",{visitor:["object","property"],aliases:["JSX","Expression"],fields:{object:{validate:(0,n.assertNodeType)("JSXMemberExpression","JSXIdentifier")},property:{validate:(0,n.assertNodeType)("JSXIdentifier")}}}),(0,i.default)("JSXNamespacedName",{visitor:["namespace","name"],aliases:["JSX"],fields:{namespace:{validate:(0,n.assertNodeType)("JSXIdentifier")},name:{validate:(0,n.assertNodeType)("JSXIdentifier")}}}),(0,i.default)("JSXOpeningElement",{builder:["name","attributes","selfClosing"],visitor:["name","attributes"],aliases:["JSX","Immutable"],fields:{name:{validate:(0,n.assertNodeType)("JSXIdentifier","JSXMemberExpression")},selfClosing:{default:!1,validate:(0,n.assertValueType)("boolean")},attributes:{validate:(0,n.chain)((0,n.assertValueType)("array"),(0,n.assertEach)((0,n.assertNodeType)("JSXAttribute","JSXSpreadAttribute")))}}}),(0,i.default)("JSXSpreadAttribute",{visitor:["argument"],aliases:["JSX"],fields:{argument:{validate:(0,n.assertNodeType)("Expression")}}}),(0,i.default)("JSXText",{aliases:["JSX","Immutable"],builder:["value"],fields:{value:{validate:(0,n.assertValueType)("string")}}})},{"./index":175}],178:[function(e,t,r){"use strict";var n=e("./index"),i=function(e){return e&&e.__esModule?e:{default:e}}(n);(0,i.default)("Noop",{visitor:[]}),(0,i.default)("ParenthesizedExpression",{visitor:["expression"],aliases:["Expression","ExpressionWrapper"],fields:{expression:{validate:(0,n.assertNodeType)("Expression")}}})},{"./index":175}],179:[function(e,t,r){"use strict";function n(e){for(var t={},r={},s=[],a=[],o=0;o=0)){if(i.isAnyTypeAnnotation(u))return[u];if(i.isFlowBaseAnnotation(u))r[u.type]=u;else if(i.isUnionTypeAnnotation(u))s.indexOf(u.types)<0&&(e=e.concat(u.types),s.push(u.types));else if(i.isGenericTypeAnnotation(u)){var l=u.id.name;if(t[l]){var c=t[l];c.typeParameters?u.typeParameters&&(c.typeParameters.params=n(c.typeParameters.params.concat(u.typeParameters.params))):c=u.typeParameters}else t[l]=u}else a.push(u)}}for(var p in r)a.push(r[p]);for(var h in t)a.push(t[h]);return a}r.__esModule=!0,r.createUnionTypeAnnotation=function(e){var t=n(e);return 1===t.length?t[0]:i.unionTypeAnnotation(t)},r.removeTypeDuplicates=n,r.createTypeAnnotationBasedOnTypeof=function(e){if("string"===e)return i.stringTypeAnnotation();if("number"===e)return i.numberTypeAnnotation();if("undefined"===e)return i.voidTypeAnnotation();if("boolean"===e)return i.booleanTypeAnnotation();if("function"===e)return i.genericTypeAnnotation(i.identifier("Function"));if("object"===e)return i.genericTypeAnnotation(i.identifier("Object"));if("symbol"===e)return i.genericTypeAnnotation(i.identifier("Symbol"));throw new Error("Invalid typeof value")};var i=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(e("./index"))},{"./index":180}],180:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e){var t=F["is"+e];t||(t=F["is"+e]=function(t,r){return F.is(e,t,r)}),F["assert"+e]=function(r,n){if(n=n||{},!t(r,n))throw new Error("Expected type "+(0,b.default)(e)+" with option "+(0,b.default)(n))}}function s(e,t){if(e===t)return!0;if(F.ALIAS_KEYS[t])return!1;var r=F.FLIPPED_ALIAS_KEYS[t];if(r){if(r[0]===e)return!0;var n=r,i=Array.isArray(n),s=0;for(n=i?n:(0,y.default)(n);;){var a;if(i){if(s>=n.length)break;a=n[s++]}else{if((s=n.next()).done)break;a=s.value}if(e===a)return!0}}return!1}function a(e,t,r){if(e){var n=F.NODE_FIELDS[e.type];if(n){var i=n[t];i&&i.validate&&(i.optional&&null==r||i.validate(e,t,r))}}}function o(e){if(!e)return e;var t={};for(var r in e)"_"!==r[0]&&(t[r]=e[r]);return t}function u(e,t){p("trailingComments",e,t)}function l(e,t){p("leadingComments",e,t)}function c(e,t){p("innerComments",e,t)}function p(e,t,r){t&&r&&(t[e]=(0,_.default)([].concat(t[e],r[e]).filter(Boolean)))}function h(e){return!(!e||!w.VISITOR_KEYS[e.type])}function f(e,t,r){if(e){var n=F.VISITOR_KEYS[e.type];if(n){t(e,r=r||{});var i=n,s=Array.isArray(i),a=0;for(i=s?i:(0,y.default)(i);;){var o;if(s){if(a>=i.length)break;o=i[a++]}else{if((a=i.next()).done)break;o=a.value}var u=e[o];if(Array.isArray(u)){var l=u,c=Array.isArray(l),p=0;for(l=c?l:(0,y.default)(l);;){var h;if(c){if(p>=l.length)break;h=l[p++]}else{if((p=l.next()).done)break;h=p.value}f(h,t,r)}}else f(u,t,r)}}}}function d(e,t){var r=(t=t||{}).preserveComments?O:N,n=Array.isArray(r),i=0;for(r=n?r:(0,y.default)(r);;){var s;if(n){if(i>=r.length)break;s=r[i++]}else{if((i=r.next()).done)break;s=i.value}var a=s;null!=e[a]&&(e[a]=void 0)}for(var o in e)"_"===o[0]&&null!=e[o]&&(e[o]=void 0);var u=(0,m.default)(e),l=Array.isArray(u),c=0;for(u=l?u:(0,y.default)(u);;){var p;if(l){if(c>=u.length)break;p=u[c++]}else{if((c=u.next()).done)break;p=c.value}e[p]=null}}r.__esModule=!0,r.createTypeAnnotationBasedOnTypeof=r.removeTypeDuplicates=r.createUnionTypeAnnotation=r.valueToNode=r.toBlock=r.toExpression=r.toStatement=r.toBindingIdentifierName=r.toIdentifier=r.toKeyAlias=r.toSequenceExpression=r.toComputedKey=r.isNodesEquivalent=r.isImmutable=r.isScope=r.isSpecifierDefault=r.isVar=r.isBlockScoped=r.isLet=r.isValidIdentifier=r.isReferenced=r.isBinding=r.getOuterBindingIdentifiers=r.getBindingIdentifiers=r.TYPES=r.react=r.DEPRECATED_KEYS=r.BUILDER_KEYS=r.NODE_FIELDS=r.ALIAS_KEYS=r.VISITOR_KEYS=r.NOT_LOCAL_BINDING=r.BLOCK_SCOPED_SYMBOL=r.INHERIT_KEYS=r.UNARY_OPERATORS=r.STRING_UNARY_OPERATORS=r.NUMBER_UNARY_OPERATORS=r.BOOLEAN_UNARY_OPERATORS=r.BINARY_OPERATORS=r.NUMBER_BINARY_OPERATORS=r.BOOLEAN_BINARY_OPERATORS=r.COMPARISON_BINARY_OPERATORS=r.EQUALITY_BINARY_OPERATORS=r.BOOLEAN_NUMBER_BINARY_OPERATORS=r.UPDATE_OPERATORS=r.LOGICAL_OPERATORS=r.COMMENT_KEYS=r.FOR_INIT_KEYS=r.FLATTENABLE_KEYS=r.STATEMENT_OR_BLOCK_KEYS=void 0;var m=n(e("babel-runtime/core-js/object/get-own-property-symbols")),y=n(e("babel-runtime/core-js/get-iterator")),g=n(e("babel-runtime/core-js/object/keys")),b=n(e("babel-runtime/core-js/json/stringify")),v=e("./constants");Object.defineProperty(r,"STATEMENT_OR_BLOCK_KEYS",{enumerable:!0,get:function(){return v.STATEMENT_OR_BLOCK_KEYS}}),Object.defineProperty(r,"FLATTENABLE_KEYS",{enumerable:!0,get:function(){return v.FLATTENABLE_KEYS}}),Object.defineProperty(r,"FOR_INIT_KEYS",{enumerable:!0,get:function(){return v.FOR_INIT_KEYS}}),Object.defineProperty(r,"COMMENT_KEYS",{enumerable:!0,get:function(){return v.COMMENT_KEYS}}),Object.defineProperty(r,"LOGICAL_OPERATORS",{enumerable:!0,get:function(){return v.LOGICAL_OPERATORS}}),Object.defineProperty(r,"UPDATE_OPERATORS",{enumerable:!0,get:function(){return v.UPDATE_OPERATORS}}),Object.defineProperty(r,"BOOLEAN_NUMBER_BINARY_OPERATORS",{enumerable:!0,get:function(){return v.BOOLEAN_NUMBER_BINARY_OPERATORS}}),Object.defineProperty(r,"EQUALITY_BINARY_OPERATORS",{enumerable:!0,get:function(){return v.EQUALITY_BINARY_OPERATORS}}),Object.defineProperty(r,"COMPARISON_BINARY_OPERATORS",{enumerable:!0,get:function(){return v.COMPARISON_BINARY_OPERATORS}}),Object.defineProperty(r,"BOOLEAN_BINARY_OPERATORS",{enumerable:!0,get:function(){return v.BOOLEAN_BINARY_OPERATORS}}),Object.defineProperty(r,"NUMBER_BINARY_OPERATORS",{enumerable:!0,get:function(){return v.NUMBER_BINARY_OPERATORS}}),Object.defineProperty(r,"BINARY_OPERATORS",{enumerable:!0,get:function(){return v.BINARY_OPERATORS}}),Object.defineProperty(r,"BOOLEAN_UNARY_OPERATORS",{enumerable:!0,get:function(){return v.BOOLEAN_UNARY_OPERATORS}}),Object.defineProperty(r,"NUMBER_UNARY_OPERATORS",{enumerable:!0,get:function(){return v.NUMBER_UNARY_OPERATORS}}),Object.defineProperty(r,"STRING_UNARY_OPERATORS",{enumerable:!0,get:function(){return v.STRING_UNARY_OPERATORS}}),Object.defineProperty(r,"UNARY_OPERATORS",{enumerable:!0,get:function(){return v.UNARY_OPERATORS}}),Object.defineProperty(r,"INHERIT_KEYS",{enumerable:!0,get:function(){return v.INHERIT_KEYS}}),Object.defineProperty(r,"BLOCK_SCOPED_SYMBOL",{enumerable:!0,get:function(){return v.BLOCK_SCOPED_SYMBOL}}),Object.defineProperty(r,"NOT_LOCAL_BINDING",{enumerable:!0,get:function(){return v.NOT_LOCAL_BINDING}}),r.is=function(e,t,r){return!!t&&!!s(t.type,e)&&(void 0===r||F.shallowEqual(t,r))},r.isType=s,r.validate=a,r.shallowEqual=function(e,t){var r=(0,g.default)(t),n=Array.isArray(r),i=0;for(r=n?r:(0,y.default)(r);;){var s;if(n){if(i>=r.length)break;s=r[i++]}else{if((i=r.next()).done)break;s=i.value}var a=s;if(e[a]!==t[a])return!1}return!0},r.appendToMemberExpression=function(e,t,r){return e.object=F.memberExpression(e.object,e.property,e.computed),e.property=t,e.computed=!!r,e},r.prependToMemberExpression=function(e,t){return e.object=F.memberExpression(t,e.object),e},r.ensureBlock=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"body";return e[t]=F.toBlock(e[t],e)},r.clone=o,r.cloneWithoutLoc=function(e){var t=o(e);return delete t.loc,t},r.cloneDeep=function(e){if(!e)return e;var t={};for(var r in e)if("_"!==r[0]){var n=e[r];n&&(n.type?n=F.cloneDeep(n):Array.isArray(n)&&(n=n.map(F.cloneDeep))),t[r]=n}return t},r.buildMatchMemberExpression=function(e,t){var r=e.split(".");return function(e){if(!F.isMemberExpression(e))return!1;for(var n=[e],i=0;n.length;){var s=n.shift();if(t&&i===r.length)return!0;if(F.isIdentifier(s)){if(r[i]!==s.name)return!1}else{if(!F.isStringLiteral(s)){if(F.isMemberExpression(s)){if(s.computed&&!F.isStringLiteral(s.property))return!1;n.push(s.object),n.push(s.property);continue}return!1}if(r[i]!==s.value)return!1}if(++i>r.length)return!1}return!0}},r.removeComments=function(e){var t=F.COMMENT_KEYS,r=Array.isArray(t),n=0;for(t=r?t:(0,y.default)(t);;){var i;if(r){if(n>=t.length)break;i=t[n++]}else{if((n=t.next()).done)break;i=n.value}delete e[i]}return e},r.inheritsComments=function(e,t){return u(e,t),l(e,t),c(e,t),e},r.inheritTrailingComments=u,r.inheritLeadingComments=l,r.inheritInnerComments=c,r.inherits=function(e,t){if(!e||!t)return e;var r=F.INHERIT_KEYS.optional,n=Array.isArray(r),i=0;for(r=n?r:(0,y.default)(r);;){var s;if(n){if(i>=r.length)break;s=r[i++]}else{if((i=r.next()).done)break;s=i.value}var a=s;null==e[a]&&(e[a]=t[a])}for(var o in t)"_"===o[0]&&(e[o]=t[o]);var u=F.INHERIT_KEYS.force,l=Array.isArray(u),c=0;for(u=l?u:(0,y.default)(u);;){var p;if(l){if(c>=u.length)break;p=u[c++]}else{if((c=u.next()).done)break;p=c.value}var h=p;e[h]=t[h]}return F.inheritsComments(e,t),e},r.assertNode=function(e){if(!h(e))throw new TypeError("Not a valid node "+(e&&e.type))},r.isNode=h,r.traverseFast=f,r.removeProperties=d,r.removePropertiesDeep=function(e,t){return f(e,d,t),e};var x=e("./retrievers");Object.defineProperty(r,"getBindingIdentifiers",{enumerable:!0,get:function(){return x.getBindingIdentifiers}}),Object.defineProperty(r,"getOuterBindingIdentifiers",{enumerable:!0,get:function(){return x.getOuterBindingIdentifiers}});var E=e("./validators");Object.defineProperty(r,"isBinding",{enumerable:!0,get:function(){return E.isBinding}}),Object.defineProperty(r,"isReferenced",{enumerable:!0,get:function(){return E.isReferenced}}),Object.defineProperty(r,"isValidIdentifier",{enumerable:!0,get:function(){return E.isValidIdentifier}}),Object.defineProperty(r,"isLet",{enumerable:!0,get:function(){return E.isLet}}),Object.defineProperty(r,"isBlockScoped",{enumerable:!0,get:function(){return E.isBlockScoped}}),Object.defineProperty(r,"isVar",{enumerable:!0,get:function(){return E.isVar}}),Object.defineProperty(r,"isSpecifierDefault",{enumerable:!0,get:function(){return E.isSpecifierDefault}}),Object.defineProperty(r,"isScope",{enumerable:!0,get:function(){return E.isScope}}),Object.defineProperty(r,"isImmutable",{enumerable:!0,get:function(){return E.isImmutable}}),Object.defineProperty(r,"isNodesEquivalent",{enumerable:!0,get:function(){return E.isNodesEquivalent}});var A=e("./converters");Object.defineProperty(r,"toComputedKey",{enumerable:!0,get:function(){return A.toComputedKey}}),Object.defineProperty(r,"toSequenceExpression",{enumerable:!0,get:function(){return A.toSequenceExpression}}),Object.defineProperty(r,"toKeyAlias",{enumerable:!0,get:function(){return A.toKeyAlias}}),Object.defineProperty(r,"toIdentifier",{enumerable:!0,get:function(){return A.toIdentifier}}),Object.defineProperty(r,"toBindingIdentifierName",{enumerable:!0,get:function(){return A.toBindingIdentifierName}}),Object.defineProperty(r,"toStatement",{enumerable:!0,get:function(){return A.toStatement}}),Object.defineProperty(r,"toExpression",{enumerable:!0,get:function(){return A.toExpression}}),Object.defineProperty(r,"toBlock",{enumerable:!0,get:function(){return A.toBlock}}),Object.defineProperty(r,"valueToNode",{enumerable:!0,get:function(){return A.valueToNode}});var D=e("./flow");Object.defineProperty(r,"createUnionTypeAnnotation",{enumerable:!0,get:function(){return D.createUnionTypeAnnotation}}),Object.defineProperty(r,"removeTypeDuplicates",{enumerable:!0,get:function(){return D.removeTypeDuplicates}}),Object.defineProperty(r,"createTypeAnnotationBasedOnTypeof",{enumerable:!0,get:function(){return D.createTypeAnnotationBasedOnTypeof}});var S=n(e("to-fast-properties")),C=n(e("lodash/clone")),_=n(e("lodash/uniq"));e("./definitions/init");var w=e("./definitions"),k=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(e("./react")),F=r;r.VISITOR_KEYS=w.VISITOR_KEYS,r.ALIAS_KEYS=w.ALIAS_KEYS,r.NODE_FIELDS=w.NODE_FIELDS,r.BUILDER_KEYS=w.BUILDER_KEYS,r.DEPRECATED_KEYS=w.DEPRECATED_KEYS,r.react=k;for(var T in F.VISITOR_KEYS)i(T);F.FLIPPED_ALIAS_KEYS={},(0,g.default)(F.ALIAS_KEYS).forEach(function(e){F.ALIAS_KEYS[e].forEach(function(t){(F.FLIPPED_ALIAS_KEYS[t]=F.FLIPPED_ALIAS_KEYS[t]||[]).push(e)})}),(0,g.default)(F.FLIPPED_ALIAS_KEYS).forEach(function(e){F[e.toUpperCase()+"_TYPES"]=F.FLIPPED_ALIAS_KEYS[e],i(e)});r.TYPES=(0,g.default)(F.VISITOR_KEYS).concat((0,g.default)(F.FLIPPED_ALIAS_KEYS)).concat((0,g.default)(F.DEPRECATED_KEYS));(0,g.default)(F.BUILDER_KEYS).forEach(function(e){function t(){if(arguments.length>r.length)throw new Error("t."+e+": Too many arguments passed. Received "+arguments.length+" but can receive no more than "+r.length);var t={};t.type=e;var n=0,i=r,s=Array.isArray(i),o=0;for(i=s?i:(0,y.default)(i);;){var u;if(s){if(o>=i.length)break;u=i[o++]}else{if((o=i.next()).done)break;u=o.value}var l=u,c=F.NODE_FIELDS[e][l],p=arguments[n++];void 0===p&&(p=(0,C.default)(c.default)),t[l]=p}for(var h in t)a(t,h,t[h]);return t}var r=F.BUILDER_KEYS[e];F[e]=t,F[e[0].toLowerCase()+e.slice(1)]=t});var P=function(e){function t(t){return function(){return console.trace("The node type "+e+" has been renamed to "+r),t.apply(this,arguments)}}var r=F.DEPRECATED_KEYS[e];F[e]=F[e[0].toLowerCase()+e.slice(1)]=t(F[r]),F["is"+e]=t(F["is"+r]),F["assert"+e]=t(F["assert"+r])};for(var B in F.DEPRECATED_KEYS)P(B);(0,S.default)(F),(0,S.default)(F.VISITOR_KEYS);var O=["tokens","start","end","loc","raw","rawValue"],N=F.COMMENT_KEYS.concat(["comments"]).concat(O)},{"./constants":169,"./converters":170,"./definitions":175,"./definitions/init":176,"./flow":179,"./react":181,"./retrievers":182,"./validators":183,"babel-runtime/core-js/get-iterator":120,"babel-runtime/core-js/json/stringify":121,"babel-runtime/core-js/object/get-own-property-symbols":126,"babel-runtime/core-js/object/keys":127,"lodash/clone":491,"lodash/uniq":540,"to-fast-properties":607}],181:[function(e,t,r){"use strict";function n(e,t){for(var r=e.value.split(/\r\n|\n|\r/),n=0,s=0;s=r.length)break;l=r[u++]}else{if((u=r.next()).done)break;l=u.value}var p=l;if((0,a.default)(e[p])!==(0,a.default)(t[p]))return!1;if(Array.isArray(e[p])){if(!Array.isArray(t[p]))return!1;if(e[p].length!==t[p].length)return!1;for(var h=0;h=0)return!0}else if(i===e)return!0}return!1},r.isReferenced=function(e,t){switch(t.type){case"BindExpression":return t.object===e||t.callee===e;case"MemberExpression":case"JSXMemberExpression":return!(t.property!==e||!t.computed)||t.object===e;case"MetaProperty":return!1;case"ObjectProperty":if(t.key===e)return t.computed;case"VariableDeclarator":return t.id!==e;case"ArrowFunctionExpression":case"FunctionDeclaration":case"FunctionExpression":var r=t.params,n=Array.isArray(r),i=0;for(r=n?r:(0,o.default)(r);;){var s;if(n){if(i>=r.length)break;s=r[i++]}else{if((i=r.next()).done)break;s=i.value}if(s===e)return!1}return t.id!==e;case"ExportSpecifier":return!t.source&&t.local===e;case"ExportNamespaceSpecifier":case"ExportDefaultSpecifier":return!1;case"JSXAttribute":return t.name!==e;case"ClassProperty":return t.key===e?t.computed:t.value===e;case"ImportDefaultSpecifier":case"ImportNamespaceSpecifier":case"ImportSpecifier":return!1;case"ClassDeclaration":case"ClassExpression":return t.id!==e;case"ClassMethod":case"ObjectMethod":return t.key===e&&t.computed;case"LabeledStatement":return!1;case"CatchClause":return t.param!==e;case"RestElement":return!1;case"AssignmentExpression":case"AssignmentPattern":return t.right===e;case"ObjectPattern":case"ArrayPattern":return!1}return!0},r.isValidIdentifier=function(e){return"string"==typeof e&&!l.default.keyword.isReservedWordES6(e,!0)&&"await"!==e&&l.default.keyword.isIdentifierNameES6(e)},r.isLet=function(e){return c.isVariableDeclaration(e)&&("var"!==e.kind||e[p.BLOCK_SCOPED_SYMBOL])},r.isBlockScoped=function(e){return c.isFunctionDeclaration(e)||c.isClassDeclaration(e)||c.isLet(e)},r.isVar=function(e){return c.isVariableDeclaration(e,{kind:"var"})&&!e[p.BLOCK_SCOPED_SYMBOL]},r.isSpecifierDefault=function(e){return c.isImportDefaultSpecifier(e)||c.isIdentifier(e.imported||e.exported,{name:"default"})},r.isScope=function(e,t){return(!c.isBlockStatement(e)||!c.isFunction(t,{body:e}))&&c.isScopable(e)},r.isImmutable=function(e){return!!c.isType(e.type,"Immutable")||!!c.isIdentifier(e)&&"undefined"===e.name},r.isNodesEquivalent=i;var u=e("./retrievers"),l=n(e("esutils")),c=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(e("./index")),p=e("./constants")},{"./constants":169,"./index":180,"./retrievers":182,"babel-runtime/core-js/get-iterator":120,"babel-runtime/core-js/object/keys":127,"babel-runtime/helpers/typeof":138,esutils:187}],184:[function(e,t,r){arguments[4][25][0].apply(r,arguments)},{dup:25}],185:[function(e,t,r){arguments[4][26][0].apply(r,arguments)},{dup:26}],186:[function(e,t,r){arguments[4][27][0].apply(r,arguments)},{"./code":185,dup:27}],187:[function(e,t,r){arguments[4][28][0].apply(r,arguments)},{"./ast":184,"./code":185,"./keyword":186,dup:28}],188:[function(e,t,r){"use strict";function n(e){return e=e.split(" "),function(t){return e.indexOf(t)>=0}}function i(e,t){for(var r=65536,n=0;ne)return!1;if((r+=t[n+1])>=e)return!0}}function s(e){return e<65?36===e:e<91||(e<97?95===e:e<123||(e<=65535?e>=170&&g.test(String.fromCharCode(e)):i(e,v)))}function a(e){return e<48?36===e:e<58||!(e<65)&&(e<91||(e<97?95===e:e<123||(e<=65535?e>=170&&b.test(String.fromCharCode(e)):i(e,v)||i(e,x))))}function o(e){return 10===e||13===e||8232===e||8233===e}function u(e){return e<=65535?String.fromCharCode(e):String.fromCharCode(55296+(e-65536>>10),56320+(e-65536&1023))}function l(e,t,r,n){return e.type=t,e.end=r,e.loc.end=n,this.processComment(e),e}function c(e){return e[e.length-1]}function p(e){return e&&"Property"===e.type&&"init"===e.kind&&!1===e.method}function h(e){return"JSXIdentifier"===e.type?e.name:"JSXNamespacedName"===e.type?e.namespace.name+":"+e.name.name:"JSXMemberExpression"===e.type?h(e.object)+"."+h(e.property):void 0}Object.defineProperty(r,"__esModule",{value:!0});var f={6:n("enum await"),strict:n("implements interface let package private protected public static yield"),strictBind:n("eval arguments")},d=n("break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this let const class extends export import yield super"),m="ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԯԱ-Ֆՙա-ևא-תװ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࢠ-ࢴࢶ-ࢽऄ-हऽॐक़-ॡॱ-ঀঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡૹଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-హఽౘ-ౚౠౡಀಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೞೠೡೱೲഅ-ഌഎ-ഐഒ-ഺഽൎൔ-ൖൟ-ൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄງຈຊຍດ-ທນ-ຟມ-ຣລວສຫອ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏽᏸ-ᏽᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜌᜎ-ᜑᜠ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡷᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᥐ-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭋᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᲀ-ᲈᳩ-ᳬᳮ-ᳱᳵᳶᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕ℘-ℝℤΩℨK-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖ゛-ゟァ-ヺー-ヿㄅ-ㄭㄱ-ㆎㆠ-ㆺㇰ-ㇿ㐀-䶵一-鿕ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚝꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-ꞮꞰ-ꞷꟷ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꣽꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꧠ-ꧤꧦ-ꧯꧺ-ꧾꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꩾ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭥꭰ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ",y="‌‍·̀-ͯ·҃-֑҇-ׇֽֿׁׂׅׄؐ-ًؚ-٩ٰۖ-ۜ۟-۪ۤۧۨ-ۭ۰-۹ܑܰ-݊ަ-ް߀-߉߫-߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛ࣔ-ࣣ࣡-ःऺ-़ा-ॏ॑-ॗॢॣ०-९ঁ-ঃ়া-ৄেৈো-্ৗৢৣ০-৯ਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑ੦-ੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢૣ૦-૯ଁ-ଃ଼ା-ୄେୈୋ-୍ୖୗୢୣ୦-୯ஂா-ூெ-ைொ-்ௗ௦-௯ఀ-ఃా-ౄె-ైొ-్ౕౖౢౣ౦-౯ಁ-ಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢೣ೦-೯ഁ-ഃാ-ൄെ-ൈൊ-്ൗൢൣ൦-൯ංඃ්ා-ුූෘ-ෟ෦-෯ෲෳัิ-ฺ็-๎๐-๙ັິ-ູົຼ່-ໍ໐-໙༘༙༠-༩༹༵༷༾༿ཱ-྄྆྇ྍ-ྗྙ-ྼ࿆ါ-ှ၀-၉ၖ-ၙၞ-ၠၢ-ၤၧ-ၭၱ-ၴႂ-ႍႏ-ႝ፝-፟፩-፱ᜒ-᜔ᜲ-᜴ᝒᝓᝲᝳ឴-៓៝០-៩᠋-᠍᠐-᠙ᢩᤠ-ᤫᤰ-᤻᥆-᥏᧐-᧚ᨗ-ᨛᩕ-ᩞ᩠-᩿᩼-᪉᪐-᪙᪰-᪽ᬀ-ᬄ᬴-᭄᭐-᭙᭫-᭳ᮀ-ᮂᮡ-ᮭ᮰-᮹᯦-᯳ᰤ-᰷᱀-᱉᱐-᱙᳐-᳔᳒-᳨᳭ᳲ-᳴᳸᳹᷀-᷵᷻-᷿‿⁀⁔⃐-⃥⃜⃡-⃰⳯-⵿⳱ⷠ-〪ⷿ-゙゚〯꘠-꘩꙯ꙴ-꙽ꚞꚟ꛰꛱ꠂ꠆ꠋꠣ-ꠧꢀꢁꢴ-ꣅ꣐-꣙꣠-꣱꤀-꤉ꤦ-꤭ꥇ-꥓ꦀ-ꦃ꦳-꧀꧐-꧙ꧥ꧰-꧹ꨩ-ꨶꩃꩌꩍ꩐-꩙ꩻ-ꩽꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꫫ-ꫯꫵ꫶ꯣ-ꯪ꯬꯭꯰-꯹ﬞ︀-️︠-︯︳︴﹍-﹏0-9_",g=new RegExp("["+m+"]"),b=new RegExp("["+m+y+"]");m=y=null;var v=[0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,17,26,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,157,310,10,21,11,7,153,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,71,55,7,1,65,0,16,3,2,2,2,26,45,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,785,52,76,44,33,24,27,35,42,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,85,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,159,52,19,3,54,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,86,25,391,63,32,0,449,56,264,8,2,36,18,0,50,29,881,921,103,110,18,195,2749,1070,4050,582,8634,568,8,30,114,29,19,47,17,3,32,20,6,18,881,68,12,0,67,12,65,0,32,6124,20,754,9486,1,3071,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,4149,196,60,67,1213,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42710,42,4148,12,221,3,5761,10591,541],x=[509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,1306,2,54,14,32,9,16,3,46,10,54,9,7,2,37,13,2,9,52,0,13,2,49,13,10,2,4,9,83,11,7,0,161,11,6,9,7,3,57,0,2,6,3,1,3,2,10,0,11,1,3,6,4,4,193,17,10,9,87,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,84,14,5,9,423,9,838,7,2,7,17,9,57,21,2,13,19882,9,135,4,60,6,26,9,1016,45,17,3,19723,1,5319,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,2214,6,110,6,6,9,792487,239],E={sourceType:"script",sourceFilename:void 0,startLine:1,allowReturnOutsideFunction:!1,allowImportExportEverywhere:!1,allowSuperOutsideMethod:!1,plugins:[],strictMode:null},A="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},D=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},S=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)},C=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t},_=!0,w=function e(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};D(this,e),this.label=t,this.keyword=r.keyword,this.beforeExpr=!!r.beforeExpr,this.startsExpr=!!r.startsExpr,this.rightAssociative=!!r.rightAssociative,this.isLoop=!!r.isLoop,this.isAssign=!!r.isAssign,this.prefix=!!r.prefix,this.postfix=!!r.postfix,this.binop=r.binop||null,this.updateContext=null},k=function(e){function t(r){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return D(this,t),n.keyword=r,C(this,e.call(this,r,n))}return S(t,e),t}(w),F=function(e){function t(r,n){return D(this,t),C(this,e.call(this,r,{beforeExpr:_,binop:n}))}return S(t,e),t}(w),T={num:new w("num",{startsExpr:!0}),regexp:new w("regexp",{startsExpr:!0}),string:new w("string",{startsExpr:!0}),name:new w("name",{startsExpr:!0}),eof:new w("eof"),bracketL:new w("[",{beforeExpr:_,startsExpr:!0}),bracketR:new w("]"),braceL:new w("{",{beforeExpr:_,startsExpr:!0}),braceBarL:new w("{|",{beforeExpr:_,startsExpr:!0}),braceR:new w("}"),braceBarR:new w("|}"),parenL:new w("(",{beforeExpr:_,startsExpr:!0}),parenR:new w(")"),comma:new w(",",{beforeExpr:_}),semi:new w(";",{beforeExpr:_}),colon:new w(":",{beforeExpr:_}),doubleColon:new w("::",{beforeExpr:_}),dot:new w("."),question:new w("?",{beforeExpr:_}),arrow:new w("=>",{beforeExpr:_}),template:new w("template"),ellipsis:new w("...",{beforeExpr:_}),backQuote:new w("`",{startsExpr:!0}),dollarBraceL:new w("${",{beforeExpr:_,startsExpr:!0}),at:new w("@"),eq:new w("=",{beforeExpr:_,isAssign:!0}),assign:new w("_=",{beforeExpr:_,isAssign:!0}),incDec:new w("++/--",{prefix:!0,postfix:!0,startsExpr:!0}),prefix:new w("prefix",{beforeExpr:_,prefix:!0,startsExpr:!0}),logicalOR:new F("||",1),logicalAND:new F("&&",2),bitwiseOR:new F("|",3),bitwiseXOR:new F("^",4),bitwiseAND:new F("&",5),equality:new F("==/!=",6),relational:new F("",7),bitShift:new F("<>",8),plusMin:new w("+/-",{beforeExpr:_,binop:9,prefix:!0,startsExpr:!0}),modulo:new F("%",10),star:new F("*",10),slash:new F("/",10),exponent:new w("**",{beforeExpr:_,binop:11,rightAssociative:!0})},P={break:new k("break"),case:new k("case",{beforeExpr:_}),catch:new k("catch"),continue:new k("continue"),debugger:new k("debugger"),default:new k("default",{beforeExpr:_}),do:new k("do",{isLoop:!0,beforeExpr:_}),else:new k("else",{beforeExpr:_}),finally:new k("finally"),for:new k("for",{isLoop:!0}),function:new k("function",{startsExpr:!0}),if:new k("if"),return:new k("return",{beforeExpr:_}),switch:new k("switch"),throw:new k("throw",{beforeExpr:_}),try:new k("try"),var:new k("var"),let:new k("let"),const:new k("const"),while:new k("while",{isLoop:!0}),with:new k("with"),new:new k("new",{beforeExpr:_,startsExpr:!0}),this:new k("this",{startsExpr:!0}),super:new k("super",{startsExpr:!0}),class:new k("class"),extends:new k("extends",{beforeExpr:_}),export:new k("export"),import:new k("import",{startsExpr:!0}),yield:new k("yield",{beforeExpr:_,startsExpr:!0}),null:new k("null",{startsExpr:!0}),true:new k("true",{startsExpr:!0}),false:new k("false",{startsExpr:!0}),in:new k("in",{beforeExpr:_,binop:7}),instanceof:new k("instanceof",{beforeExpr:_,binop:7}),typeof:new k("typeof",{beforeExpr:_,prefix:!0,startsExpr:!0}),void:new k("void",{beforeExpr:_,prefix:!0,startsExpr:!0}),delete:new k("delete",{beforeExpr:_,prefix:!0,startsExpr:!0})};Object.keys(P).forEach(function(e){T["_"+e]=P[e]});var B=/\r\n?|\n|\u2028|\u2029/,O=new RegExp(B.source,"g"),N=/[\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff]/,j=function e(t,r,n,i){D(this,e),this.token=t,this.isExpr=!!r,this.preserveSpace=!!n,this.override=i},I={braceStatement:new j("{",!1),braceExpression:new j("{",!0),templateQuasi:new j("${",!0),parenStatement:new j("(",!1),parenExpression:new j("(",!0),template:new j("`",!0,!0,function(e){return e.readTmplToken()}),functionExpression:new j("function",!0)};T.parenR.updateContext=T.braceR.updateContext=function(){if(1!==this.state.context.length){var e=this.state.context.pop();e===I.braceStatement&&this.curContext()===I.functionExpression?(this.state.context.pop(),this.state.exprAllowed=!1):e===I.templateQuasi?this.state.exprAllowed=!0:this.state.exprAllowed=!e.isExpr}else this.state.exprAllowed=!0},T.name.updateContext=function(e){this.state.exprAllowed=!1,e!==T._let&&e!==T._const&&e!==T._var||B.test(this.input.slice(this.state.end))&&(this.state.exprAllowed=!0)},T.braceL.updateContext=function(e){this.state.context.push(this.braceIsBlock(e)?I.braceStatement:I.braceExpression),this.state.exprAllowed=!0},T.dollarBraceL.updateContext=function(){this.state.context.push(I.templateQuasi),this.state.exprAllowed=!0},T.parenL.updateContext=function(e){var t=e===T._if||e===T._for||e===T._with||e===T._while;this.state.context.push(t?I.parenStatement:I.parenExpression),this.state.exprAllowed=!0},T.incDec.updateContext=function(){},T._function.updateContext=function(){this.curContext()!==I.braceStatement&&this.state.context.push(I.functionExpression),this.state.exprAllowed=!1},T.backQuote.updateContext=function(){this.curContext()===I.template?this.state.context.pop():this.state.context.push(I.template),this.state.exprAllowed=!1};var L=function e(t,r){D(this,e),this.line=t,this.column=r},M=function e(t,r){D(this,e),this.start=t,this.end=r},R=function(){function e(){D(this,e)}return e.prototype.init=function(e,t){return this.strict=!1!==e.strictMode&&"module"===e.sourceType,this.input=t,this.potentialArrowAt=-1,this.inMethod=this.inFunction=this.inGenerator=this.inAsync=this.inPropertyName=this.inType=this.inClassProperty=this.noAnonFunctionType=!1,this.labels=[],this.decorators=[],this.tokens=[],this.comments=[],this.trailingComments=[],this.leadingComments=[],this.commentStack=[],this.pos=this.lineStart=0,this.curLine=e.startLine,this.type=T.eof,this.value=null,this.start=this.end=this.pos,this.startLoc=this.endLoc=this.curPosition(),this.lastTokEndLoc=this.lastTokStartLoc=null,this.lastTokStart=this.lastTokEnd=this.pos,this.context=[I.braceStatement],this.exprAllowed=!0,this.containsEsc=this.containsOctal=!1,this.octalPosition=null,this.invalidTemplateEscapePosition=null,this.exportedIdentifiers=[],this},e.prototype.curPosition=function(){return new L(this.curLine,this.pos-this.lineStart)},e.prototype.clone=function(t){var r=new e;for(var n in this){var i=this[n];t&&"context"!==n||!Array.isArray(i)||(i=i.slice()),r[n]=i}return r},e}(),V={},U=["jsx","doExpressions","objectRestSpread","decorators","classProperties","exportExtensions","asyncGenerators","functionBind","functionSent","dynamicImport","flow"],q=function(e){function t(r,n){D(this,t),r=function(e){var t={};for(var r in E)t[r]=e&&r in e?e[r]:E[r];return t}(r);var i=C(this,e.call(this,r,n));return i.options=r,i.inModule="module"===i.options.sourceType,i.input=n,i.plugins=i.loadPlugins(i.options.plugins),i.filename=r.sourceFilename,0===i.state.pos&&"#"===i.input[0]&&"!"===i.input[1]&&i.skipLineComment(2),i}return S(t,e),t.prototype.isReservedWord=function(e){return"await"===e?this.inModule:f[6](e)},t.prototype.hasPlugin=function(e){return!!(this.plugins["*"]&&U.indexOf(e)>-1)||!!this.plugins[e]},t.prototype.extend=function(e,t){this[e]=t(this[e])},t.prototype.loadAllPlugins=function(){var e=this,t=Object.keys(V).filter(function(e){return"flow"!==e&&"estree"!==e});t.push("flow"),t.forEach(function(t){var r=V[t];r&&r(e)})},t.prototype.loadPlugins=function(e){if(e.indexOf("*")>=0)return this.loadAllPlugins(),{"*":!0};var t={};e.indexOf("flow")>=0&&(e=e.filter(function(e){return"flow"!==e})).push("flow"),e.indexOf("estree")>=0&&(e=e.filter(function(e){return"estree"!==e})).unshift("estree");var r=e,n=Array.isArray(r),i=0;for(r=n?r:r[Symbol.iterator]();;){var s;if(n){if(i>=r.length)break;s=r[i++]}else{if((i=r.next()).done)break;s=i.value}var a=s;if(!t[a]){t[a]=!0;var o=V[a];o&&o(this)}}return t},t.prototype.parse=function(){var e=this.startNode(),t=this.startNode();return this.nextToken(),this.parseTopLevel(e,t)},t}(function(){function e(t,r){D(this,e),this.state=new R,this.state.init(t,r)}return e.prototype.next=function(){this.isLookahead||this.state.tokens.push(new function e(t){D(this,e),this.type=t.type,this.value=t.value,this.start=t.start,this.end=t.end,this.loc=new M(t.startLoc,t.endLoc)}(this.state)),this.state.lastTokEnd=this.state.end,this.state.lastTokStart=this.state.start,this.state.lastTokEndLoc=this.state.endLoc,this.state.lastTokStartLoc=this.state.startLoc,this.nextToken()},e.prototype.eat=function(e){return!!this.match(e)&&(this.next(),!0)},e.prototype.match=function(e){return this.state.type===e},e.prototype.isKeyword=function(e){return d(e)},e.prototype.lookahead=function(){var e=this.state;this.state=e.clone(!0),this.isLookahead=!0,this.next(),this.isLookahead=!1;var t=this.state.clone(!0);return this.state=e,t},e.prototype.setStrict=function(e){if(this.state.strict=e,this.match(T.num)||this.match(T.string)){for(this.state.pos=this.state.start;this.state.pos=this.input.length?this.finishToken(T.eof):e.override?e.override(this):this.readToken(this.fullCharCodeAtPos())},e.prototype.readToken=function(e){return s(e)||92===e?this.readWord():this.getTokenFromCode(e)},e.prototype.fullCharCodeAtPos=function(){var e=this.input.charCodeAt(this.state.pos);if(e<=55295||e>=57344)return e;return(e<<10)+this.input.charCodeAt(this.state.pos+1)-56613888},e.prototype.pushComment=function(e,t,r,n,i,s){var a={type:e?"CommentBlock":"CommentLine",value:t,start:r,end:n,loc:new M(i,s)};this.isLookahead||(this.state.tokens.push(a),this.state.comments.push(a),this.addComment(a))},e.prototype.skipBlockComment=function(){var e=this.state.curPosition(),t=this.state.pos,r=this.input.indexOf("*/",this.state.pos+=2);-1===r&&this.raise(this.state.pos-2,"Unterminated comment"),this.state.pos=r+2,O.lastIndex=t;for(var n=void 0;(n=O.exec(this.input))&&n.index8&&e<14||e>=5760&&N.test(String.fromCharCode(e))))break e;++this.state.pos}}},e.prototype.finishToken=function(e,t){this.state.end=this.state.pos,this.state.endLoc=this.state.curPosition();var r=this.state.type;this.state.type=e,this.state.value=t,this.updateContext(r)},e.prototype.readToken_dot=function(){var e=this.input.charCodeAt(this.state.pos+1);if(e>=48&&e<=57)return this.readNumber(!0);var t=this.input.charCodeAt(this.state.pos+2);return 46===e&&46===t?(this.state.pos+=3,this.finishToken(T.ellipsis)):(++this.state.pos,this.finishToken(T.dot))},e.prototype.readToken_slash=function(){if(this.state.exprAllowed)return++this.state.pos,this.readRegexp();return 61===this.input.charCodeAt(this.state.pos+1)?this.finishOp(T.assign,2):this.finishOp(T.slash,1)},e.prototype.readToken_mult_modulo=function(e){var t=42===e?T.star:T.modulo,r=1,n=this.input.charCodeAt(this.state.pos+1);return 42===n&&(r++,n=this.input.charCodeAt(this.state.pos+2),t=T.exponent),61===n&&(r++,t=T.assign),this.finishOp(t,r)},e.prototype.readToken_pipe_amp=function(e){var t=this.input.charCodeAt(this.state.pos+1);return t===e?this.finishOp(124===e?T.logicalOR:T.logicalAND,2):61===t?this.finishOp(T.assign,2):124===e&&125===t&&this.hasPlugin("flow")?this.finishOp(T.braceBarR,2):this.finishOp(124===e?T.bitwiseOR:T.bitwiseAND,1)},e.prototype.readToken_caret=function(){return 61===this.input.charCodeAt(this.state.pos+1)?this.finishOp(T.assign,2):this.finishOp(T.bitwiseXOR,1)},e.prototype.readToken_plus_min=function(e){var t=this.input.charCodeAt(this.state.pos+1);return t===e?45===t&&62===this.input.charCodeAt(this.state.pos+2)&&B.test(this.input.slice(this.state.lastTokEnd,this.state.pos))?(this.skipLineComment(3),this.skipSpace(),this.nextToken()):this.finishOp(T.incDec,2):61===t?this.finishOp(T.assign,2):this.finishOp(T.plusMin,1)},e.prototype.readToken_lt_gt=function(e){var t=this.input.charCodeAt(this.state.pos+1),r=1;return t===e?(r=62===e&&62===this.input.charCodeAt(this.state.pos+2)?3:2,61===this.input.charCodeAt(this.state.pos+r)?this.finishOp(T.assign,r+1):this.finishOp(T.bitShift,r)):33===t&&60===e&&45===this.input.charCodeAt(this.state.pos+2)&&45===this.input.charCodeAt(this.state.pos+3)?(this.inModule&&this.unexpected(),this.skipLineComment(4),this.skipSpace(),this.nextToken()):(61===t&&(r=2),this.finishOp(T.relational,r))},e.prototype.readToken_eq_excl=function(e){var t=this.input.charCodeAt(this.state.pos+1);return 61===t?this.finishOp(T.equality,61===this.input.charCodeAt(this.state.pos+2)?3:2):61===e&&62===t?(this.state.pos+=2,this.finishToken(T.arrow)):this.finishOp(61===e?T.eq:T.prefix,1)},e.prototype.getTokenFromCode=function(e){switch(e){case 46:return this.readToken_dot();case 40:return++this.state.pos,this.finishToken(T.parenL);case 41:return++this.state.pos,this.finishToken(T.parenR);case 59:return++this.state.pos,this.finishToken(T.semi);case 44:return++this.state.pos,this.finishToken(T.comma);case 91:return++this.state.pos,this.finishToken(T.bracketL);case 93:return++this.state.pos,this.finishToken(T.bracketR);case 123:return this.hasPlugin("flow")&&124===this.input.charCodeAt(this.state.pos+1)?this.finishOp(T.braceBarL,2):(++this.state.pos,this.finishToken(T.braceL));case 125:return++this.state.pos,this.finishToken(T.braceR);case 58:return this.hasPlugin("functionBind")&&58===this.input.charCodeAt(this.state.pos+1)?this.finishOp(T.doubleColon,2):(++this.state.pos,this.finishToken(T.colon));case 63:return++this.state.pos,this.finishToken(T.question);case 64:return++this.state.pos,this.finishToken(T.at);case 96:return++this.state.pos,this.finishToken(T.backQuote);case 48:var t=this.input.charCodeAt(this.state.pos+1);if(120===t||88===t)return this.readRadixNumber(16);if(111===t||79===t)return this.readRadixNumber(8);if(98===t||66===t)return this.readRadixNumber(2);case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return this.readNumber(!1);case 34:case 39:return this.readString(e);case 47:return this.readToken_slash();case 37:case 42:return this.readToken_mult_modulo(e);case 124:case 38:return this.readToken_pipe_amp(e);case 94:return this.readToken_caret();case 43:case 45:return this.readToken_plus_min(e);case 60:case 62:return this.readToken_lt_gt(e);case 61:case 33:return this.readToken_eq_excl(e);case 126:return this.finishOp(T.prefix,1)}this.raise(this.state.pos,"Unexpected character '"+u(e)+"'")},e.prototype.finishOp=function(e,t){var r=this.input.slice(this.state.pos,this.state.pos+t);return this.state.pos+=t,this.finishToken(e,r)},e.prototype.readRegexp=function(){for(var e=this.state.pos,t=void 0,r=void 0;;){this.state.pos>=this.input.length&&this.raise(e,"Unterminated regular expression");var n=this.input.charAt(this.state.pos);if(B.test(n)&&this.raise(e,"Unterminated regular expression"),t)t=!1;else{if("["===n)r=!0;else if("]"===n&&r)r=!1;else if("/"===n&&!r)break;t="\\"===n}++this.state.pos}var i=this.input.slice(e,this.state.pos);++this.state.pos;var s=this.readWord1();if(s){/^[gmsiyu]*$/.test(s)||this.raise(e,"Invalid regular expression flag")}return this.finishToken(T.regexp,{pattern:i,flags:s})},e.prototype.readInt=function(e,t){for(var r=this.state.pos,n=0,i=0,s=null==t?1/0:t;i=97?a-97+10:a>=65?a-65+10:a>=48&&a<=57?a-48:1/0)>=e)break;++this.state.pos,n=n*e+o}return this.state.pos===r||null!=t&&this.state.pos-r!==t?null:n},e.prototype.readRadixNumber=function(e){this.state.pos+=2;var t=this.readInt(e);return null==t&&this.raise(this.state.start+2,"Expected number in radix "+e),s(this.fullCharCodeAtPos())&&this.raise(this.state.pos,"Identifier directly after number"),this.finishToken(T.num,t)},e.prototype.readNumber=function(e){var t=this.state.pos,r=48===this.input.charCodeAt(t),n=!1;e||null!==this.readInt(10)||this.raise(t,"Invalid number"),r&&this.state.pos==t+1&&(r=!1);var i=this.input.charCodeAt(this.state.pos);46!==i||r||(++this.state.pos,this.readInt(10),n=!0,i=this.input.charCodeAt(this.state.pos)),69!==i&&101!==i||r||(43!==(i=this.input.charCodeAt(++this.state.pos))&&45!==i||++this.state.pos,null===this.readInt(10)&&this.raise(t,"Invalid number"),n=!0),s(this.fullCharCodeAtPos())&&this.raise(this.state.pos,"Identifier directly after number");var a=this.input.slice(t,this.state.pos),o=void 0;return n?o=parseFloat(a):r&&1!==a.length?this.state.strict?this.raise(t,"Invalid number"):o=/[89]/.test(a)?parseInt(a,10):parseInt(a,8):o=parseInt(a,10),this.finishToken(T.num,o)},e.prototype.readCodePoint=function(e){var t=void 0;if(123===this.input.charCodeAt(this.state.pos)){var r=++this.state.pos;if(t=this.readHexChar(this.input.indexOf("}",this.state.pos)-this.state.pos,e),++this.state.pos,null===t)--this.state.invalidTemplateEscapePosition;else if(t>1114111){if(!e)return this.state.invalidTemplateEscapePosition=r-2,null;this.raise(r,"Code point out of bounds")}}else t=this.readHexChar(4,e);return t},e.prototype.readString=function(e){for(var t="",r=++this.state.pos;;){this.state.pos>=this.input.length&&this.raise(this.state.start,"Unterminated string constant");var n=this.input.charCodeAt(this.state.pos);if(n===e)break;92===n?(t+=this.input.slice(r,this.state.pos),t+=this.readEscapedChar(!1),r=this.state.pos):(o(n)&&this.raise(this.state.start,"Unterminated string constant"),++this.state.pos)}return t+=this.input.slice(r,this.state.pos++),this.finishToken(T.string,t)},e.prototype.readTmplToken=function(){for(var e="",t=this.state.pos,r=!1;;){this.state.pos>=this.input.length&&this.raise(this.state.start,"Unterminated template");var n=this.input.charCodeAt(this.state.pos);if(96===n||36===n&&123===this.input.charCodeAt(this.state.pos+1))return this.state.pos===this.state.start&&this.match(T.template)?36===n?(this.state.pos+=2,this.finishToken(T.dollarBraceL)):(++this.state.pos,this.finishToken(T.backQuote)):(e+=this.input.slice(t,this.state.pos),this.finishToken(T.template,r?null:e));if(92===n){e+=this.input.slice(t,this.state.pos);var i=this.readEscapedChar(!0);null===i?r=!0:e+=i,t=this.state.pos}else if(o(n)){switch(e+=this.input.slice(t,this.state.pos),++this.state.pos,n){case 13:10===this.input.charCodeAt(this.state.pos)&&++this.state.pos;case 10:e+="\n";break;default:e+=String.fromCharCode(n)}++this.state.curLine,this.state.lineStart=this.state.pos,t=this.state.pos}else++this.state.pos}},e.prototype.readEscapedChar=function(e){var t=!e,r=this.input.charCodeAt(++this.state.pos);switch(++this.state.pos,r){case 110:return"\n";case 114:return"\r";case 120:var n=this.readHexChar(2,t);return null===n?null:String.fromCharCode(n);case 117:var i=this.readCodePoint(t);return null===i?null:u(i);case 116:return"\t";case 98:return"\b";case 118:return"\v";case 102:return"\f";case 13:10===this.input.charCodeAt(this.state.pos)&&++this.state.pos;case 10:return this.state.lineStart=this.state.pos,++this.state.curLine,"";default:if(r>=48&&r<=55){var s=this.state.pos-1,a=this.input.substr(this.state.pos-1,3).match(/^[0-7]+/)[0],o=parseInt(a,8);if(o>255&&(a=a.slice(0,-1),o=parseInt(a,8)),o>0){if(e)return this.state.invalidTemplateEscapePosition=s,null;this.state.strict?this.raise(s,"Octal literal in strict mode"):this.state.containsOctal||(this.state.containsOctal=!0,this.state.octalPosition=s)}return this.state.pos+=a.length-1,String.fromCharCode(o)}return String.fromCharCode(r)}},e.prototype.readHexChar=function(e,t){var r=this.state.pos,n=this.readInt(16,e);return null===n&&(t?this.raise(r,"Bad character escape sequence"):(this.state.pos=r-1,this.state.invalidTemplateEscapePosition=r-1)),n},e.prototype.readWord1=function(){this.state.containsEsc=!1;for(var e="",t=!0,r=this.state.pos;this.state.pos1&&void 0!==arguments[1]?arguments[1]:"Unexpected token";t&&"object"===(void 0===t?"undefined":A(t))&&t.label&&(t="Unexpected token, expected "+t.label),this.raise(null!=e?e:this.state.start,t)};var X=q.prototype;X.parseTopLevel=function(e,t){return t.sourceType=this.options.sourceType,this.parseBlockBody(t,!0,!0,T.eof),e.program=this.finishNode(t,"Program"),e.comments=this.state.comments,e.tokens=this.state.tokens,this.finishNode(e,"File")};var J={kind:"loop"},W={kind:"switch"};X.stmtToDirective=function(e){var t=e.expression,r=this.startNodeAt(t.start,t.loc.start),n=this.startNodeAt(e.start,e.loc.start),i=this.input.slice(t.start,t.end),s=r.value=i.slice(1,-1);return this.addExtra(r,"raw",i),this.addExtra(r,"rawValue",s),n.value=this.finishNodeAt(r,"DirectiveLiteral",t.end,t.loc.end),this.finishNodeAt(n,"Directive",e.end,e.loc.end)},X.parseStatement=function(e,t){this.match(T.at)&&this.parseDecorators(!0);var r=this.state.type,n=this.startNode();switch(r){case T._break:case T._continue:return this.parseBreakContinueStatement(n,r.keyword);case T._debugger:return this.parseDebuggerStatement(n);case T._do:return this.parseDoStatement(n);case T._for:return this.parseForStatement(n);case T._function:return e||this.unexpected(),this.parseFunctionStatement(n);case T._class:return e||this.unexpected(),this.parseClass(n,!0);case T._if:return this.parseIfStatement(n);case T._return:return this.parseReturnStatement(n);case T._switch:return this.parseSwitchStatement(n);case T._throw:return this.parseThrowStatement(n);case T._try:return this.parseTryStatement(n);case T._let:case T._const:e||this.unexpected();case T._var:return this.parseVarStatement(n,r);case T._while:return this.parseWhileStatement(n);case T._with:return this.parseWithStatement(n);case T.braceL:return this.parseBlock();case T.semi:return this.parseEmptyStatement(n);case T._export:case T._import:if(this.hasPlugin("dynamicImport")&&this.lookahead().type===T.parenL)break;return this.options.allowImportExportEverywhere||(t||this.raise(this.state.start,"'import' and 'export' may only appear at the top level"),this.inModule||this.raise(this.state.start,"'import' and 'export' may appear only with 'sourceType: \"module\"'")),r===T._import?this.parseImport(n):this.parseExport(n);case T.name:if("async"===this.state.value){var i=this.state.clone();if(this.next(),this.match(T._function)&&!this.canInsertSemicolon())return this.expect(T._function),this.parseFunction(n,!0,!1,!0);this.state=i}}var s=this.state.value,a=this.parseExpression();return r===T.name&&"Identifier"===a.type&&this.eat(T.colon)?this.parseLabeledStatement(n,s,a):this.parseExpressionStatement(n,a)},X.takeDecorators=function(e){this.state.decorators.length&&(e.decorators=this.state.decorators,this.state.decorators=[])},X.parseDecorators=function(e){for(;this.match(T.at);){var t=this.parseDecorator();this.state.decorators.push(t)}e&&this.match(T._export)||this.match(T._class)||this.raise(this.state.start,"Leading decorators must be attached to a class declaration")},X.parseDecorator=function(){this.hasPlugin("decorators")||this.unexpected();var e=this.startNode();return this.next(),e.expression=this.parseMaybeAssign(),this.finishNode(e,"Decorator")},X.parseBreakContinueStatement=function(e,t){var r="break"===t;this.next(),this.isLineTerminator()?e.label=null:this.match(T.name)?(e.label=this.parseIdentifier(),this.semicolon()):this.unexpected();var n=void 0;for(n=0;n=n.length)break;a=n[s++]}else{if((s=n.next()).done)break;a=s.value}a.name===t&&this.raise(r.start,"Label '"+t+"' is already declared")}for(var o=this.state.type.isLoop?"loop":this.match(T._switch)?"switch":null,u=this.state.labels.length-1;u>=0;u--){var l=this.state.labels[u];if(l.statementStart!==e.start)break;l.statementStart=this.state.start,l.kind=o}return this.state.labels.push({name:t,kind:o,statementStart:this.state.start}),e.body=this.parseStatement(!0),this.state.labels.pop(),e.label=r,this.finishNode(e,"LabeledStatement")},X.parseExpressionStatement=function(e,t){return e.expression=t,this.semicolon(),this.finishNode(e,"ExpressionStatement")},X.parseBlock=function(e){var t=this.startNode();return this.expect(T.braceL),this.parseBlockBody(t,e,!1,T.braceR),this.finishNode(t,"BlockStatement")},X.isValidDirective=function(e){return"ExpressionStatement"===e.type&&"StringLiteral"===e.expression.type&&!e.expression.extra.parenthesized},X.parseBlockBody=function(e,t,r,n){e.body=[],e.directives=[];for(var i=!1,s=void 0,a=void 0;!this.eat(n);){i||!this.state.containsOctal||a||(a=this.state.octalPosition);var o=this.parseStatement(!0,r);if(t&&!i&&this.isValidDirective(o)){var u=this.stmtToDirective(o);e.directives.push(u),void 0===s&&"use strict"===u.value.value&&(s=this.state.strict,this.setStrict(!0),a&&this.raise(a,"Octal literal in strict mode"))}else i=!0,e.body.push(o)}!1===s&&this.setStrict(!1)},X.parseFor=function(e,t){return e.init=t,this.expect(T.semi),e.test=this.match(T.semi)?null:this.parseExpression(),this.expect(T.semi),e.update=this.match(T.parenR)?null:this.parseExpression(),this.expect(T.parenR),e.body=this.parseStatement(!1),this.state.labels.pop(),this.finishNode(e,"ForStatement")},X.parseForIn=function(e,t,r){var n=void 0;return r?(this.eatContextual("of"),n="ForAwaitStatement"):(n=this.match(T._in)?"ForInStatement":"ForOfStatement",this.next()),e.left=t,e.right=this.parseExpression(),this.expect(T.parenR),e.body=this.parseStatement(!1),this.state.labels.pop(),this.finishNode(e,n)},X.parseVar=function(e,t,r){for(e.declarations=[],e.kind=r.keyword;;){var n=this.startNode();if(this.parseVarHead(n),this.eat(T.eq)?n.init=this.parseMaybeAssign(t):r!==T._const||this.match(T._in)||this.isContextual("of")?"Identifier"===n.id.type||t&&(this.match(T._in)||this.isContextual("of"))?n.init=null:this.raise(this.state.lastTokEnd,"Complex binding patterns require an initialization value"):this.unexpected(),e.declarations.push(this.finishNode(n,"VariableDeclarator")),!this.eat(T.comma))break}return e},X.parseVarHead=function(e){e.id=this.parseBindingAtom(),this.checkLVal(e.id,!0,void 0,"variable declaration")},X.parseFunction=function(e,t,r,n,i){var s=this.state.inMethod;return this.state.inMethod=!1,this.initFunction(e,n),this.match(T.star)&&(e.async&&!this.hasPlugin("asyncGenerators")?this.unexpected():(e.generator=!0,this.next())),!t||i||this.match(T.name)||this.match(T._yield)||this.unexpected(),(this.match(T.name)||this.match(T._yield))&&(e.id=this.parseBindingIdentifier()),this.parseFunctionParams(e),this.parseFunctionBody(e,r),this.state.inMethod=s,this.finishNode(e,t?"FunctionDeclaration":"FunctionExpression")},X.parseFunctionParams=function(e){this.expect(T.parenL),e.params=this.parseBindingList(T.parenR)},X.parseClass=function(e,t,r){return this.next(),this.takeDecorators(e),this.parseClassId(e,t,r),this.parseClassSuper(e),this.parseClassBody(e),this.finishNode(e,t?"ClassDeclaration":"ClassExpression")},X.isClassProperty=function(){return this.match(T.eq)||this.match(T.semi)||this.match(T.braceR)},X.isClassMethod=function(){return this.match(T.parenL)},X.isNonstaticConstructor=function(e){return!(e.computed||e.static||"constructor"!==e.key.name&&"constructor"!==e.key.value)},X.parseClassBody=function(e){var t=this.state.strict;this.state.strict=!0;var r=!1,n=!1,i=[],s=this.startNode();for(s.body=[],this.expect(T.braceL);!this.eat(T.braceR);)if(this.eat(T.semi))i.length>0&&this.raise(this.state.lastTokEnd,"Decorators must not be followed by a semicolon");else if(this.match(T.at))i.push(this.parseDecorator());else{var a=this.startNode();if(i.length&&(a.decorators=i,i=[]),a.static=!1,this.match(T.name)&&"static"===this.state.value){var o=this.parseIdentifier(!0);if(this.isClassMethod()){a.kind="method",a.computed=!1,a.key=o,this.parseClassMethod(s,a,!1,!1);continue}if(this.isClassProperty()){a.computed=!1,a.key=o,s.body.push(this.parseClassProperty(a));continue}a.static=!0}if(this.eat(T.star))a.kind="method",this.parsePropertyName(a),this.isNonstaticConstructor(a)&&this.raise(a.key.start,"Constructor can't be a generator"),a.computed||!a.static||"prototype"!==a.key.name&&"prototype"!==a.key.value||this.raise(a.key.start,"Classes may not have static property named prototype"),this.parseClassMethod(s,a,!0,!1);else{var u=this.match(T.name),l=this.parsePropertyName(a);if(a.computed||!a.static||"prototype"!==a.key.name&&"prototype"!==a.key.value||this.raise(a.key.start,"Classes may not have static property named prototype"),this.isClassMethod())this.isNonstaticConstructor(a)?(n?this.raise(l.start,"Duplicate constructor in the same class"):a.decorators&&this.raise(a.start,"You can't attach decorators to a class constructor"),n=!0,a.kind="constructor"):a.kind="method",this.parseClassMethod(s,a,!1,!1);else if(this.isClassProperty())this.isNonstaticConstructor(a)&&this.raise(a.key.start,"Classes may not have a non-static field named 'constructor'"),s.body.push(this.parseClassProperty(a));else if(u&&"async"===l.name&&!this.isLineTerminator()){var c=this.hasPlugin("asyncGenerators")&&this.eat(T.star);a.kind="method",this.parsePropertyName(a),this.isNonstaticConstructor(a)&&this.raise(a.key.start,"Constructor can't be an async function"),this.parseClassMethod(s,a,c,!0)}else!u||"get"!==l.name&&"set"!==l.name||this.isLineTerminator()&&this.match(T.star)?this.hasPlugin("classConstructorCall")&&u&&"call"===l.name&&this.match(T.name)&&"constructor"===this.state.value?(r?this.raise(a.start,"Duplicate constructor call in the same class"):a.decorators&&this.raise(a.start,"You can't attach decorators to a class constructor"),r=!0,a.kind="constructorCall",this.parsePropertyName(a),this.parseClassMethod(s,a,!1,!1)):this.isLineTerminator()?(this.isNonstaticConstructor(a)&&this.raise(a.key.start,"Classes may not have a non-static field named 'constructor'"),s.body.push(this.parseClassProperty(a))):this.unexpected():(a.kind=l.name,this.parsePropertyName(a),this.isNonstaticConstructor(a)&&this.raise(a.key.start,"Constructor can't have get/set modifier"),this.parseClassMethod(s,a,!1,!1),this.checkGetterSetterParamCount(a))}}i.length&&this.raise(this.state.start,"You have trailing decorators with no method"),e.body=this.finishNode(s,"ClassBody"),this.state.strict=t},X.parseClassProperty=function(e){return this.state.inClassProperty=!0,this.match(T.eq)?(this.hasPlugin("classProperties")||this.unexpected(),this.next(),e.value=this.parseMaybeAssign()):e.value=null,this.semicolon(),this.state.inClassProperty=!1,this.finishNode(e,"ClassProperty")},X.parseClassMethod=function(e,t,r,n){this.parseMethod(t,r,n),e.body.push(this.finishNode(t,"ClassMethod"))},X.parseClassId=function(e,t,r){this.match(T.name)?e.id=this.parseIdentifier():r||!t?e.id=null:this.unexpected()},X.parseClassSuper=function(e){e.superClass=this.eat(T._extends)?this.parseExprSubscripts():null},X.parseExport=function(e){if(this.next(),this.match(T.star)){var t=this.startNode();if(this.next(),!this.hasPlugin("exportExtensions")||!this.eatContextual("as"))return this.parseExportFrom(e,!0),this.finishNode(e,"ExportAllDeclaration");t.exported=this.parseIdentifier(),e.specifiers=[this.finishNode(t,"ExportNamespaceSpecifier")],this.parseExportSpecifiersMaybe(e),this.parseExportFrom(e,!0)}else if(this.hasPlugin("exportExtensions")&&this.isExportDefaultSpecifier()){var r=this.startNode();if(r.exported=this.parseIdentifier(!0),e.specifiers=[this.finishNode(r,"ExportDefaultSpecifier")],this.match(T.comma)&&this.lookahead().type===T.star){this.expect(T.comma);var n=this.startNode();this.expect(T.star),this.expectContextual("as"),n.exported=this.parseIdentifier(),e.specifiers.push(this.finishNode(n,"ExportNamespaceSpecifier"))}else this.parseExportSpecifiersMaybe(e);this.parseExportFrom(e,!0)}else{if(this.eat(T._default)){var i=this.startNode(),s=!1;return this.eat(T._function)?i=this.parseFunction(i,!0,!1,!1,!0):this.match(T._class)?i=this.parseClass(i,!0,!0):(s=!0,i=this.parseMaybeAssign()),e.declaration=i,s&&this.semicolon(),this.checkExport(e,!0,!0),this.finishNode(e,"ExportDefaultDeclaration")}this.shouldParseExportDeclaration()?(e.specifiers=[],e.source=null,e.declaration=this.parseExportDeclaration(e)):(e.declaration=null,e.specifiers=this.parseExportSpecifiers(),this.parseExportFrom(e))}return this.checkExport(e,!0),this.finishNode(e,"ExportNamedDeclaration")},X.parseExportDeclaration=function(){return this.parseStatement(!0)},X.isExportDefaultSpecifier=function(){if(this.match(T.name))return"async"!==this.state.value;if(!this.match(T._default))return!1;var e=this.lookahead();return e.type===T.comma||e.type===T.name&&"from"===e.value},X.parseExportSpecifiersMaybe=function(e){this.eat(T.comma)&&(e.specifiers=e.specifiers.concat(this.parseExportSpecifiers()))},X.parseExportFrom=function(e,t){this.eatContextual("from")?(e.source=this.match(T.string)?this.parseExprAtom():this.unexpected(),this.checkExport(e)):t?this.unexpected():e.source=null,this.semicolon()},X.shouldParseExportDeclaration=function(){return"var"===this.state.type.keyword||"const"===this.state.type.keyword||"let"===this.state.type.keyword||"function"===this.state.type.keyword||"class"===this.state.type.keyword||this.isContextual("async")},X.checkExport=function(e,t,r){if(t)if(r)this.checkDuplicateExports(e,"default");else if(e.specifiers&&e.specifiers.length){var n=e.specifiers,i=Array.isArray(n),s=0;for(n=i?n:n[Symbol.iterator]();;){var a;if(i){if(s>=n.length)break;a=n[s++]}else{if((s=n.next()).done)break;a=s.value}var o=a;this.checkDuplicateExports(o,o.exported.name)}}else if(e.declaration)if("FunctionDeclaration"===e.declaration.type||"ClassDeclaration"===e.declaration.type)this.checkDuplicateExports(e,e.declaration.id.name);else if("VariableDeclaration"===e.declaration.type){var u=e.declaration.declarations,l=Array.isArray(u),c=0;for(u=l?u:u[Symbol.iterator]();;){var p;if(l){if(c>=u.length)break;p=u[c++]}else{if((c=u.next()).done)break;p=c.value}var h=p;this.checkDeclaration(h.id)}}if(this.state.decorators.length){var f=e.declaration&&("ClassDeclaration"===e.declaration.type||"ClassExpression"===e.declaration.type);e.declaration&&f||this.raise(e.start,"You can only use decorators on an export when exporting a class"),this.takeDecorators(e.declaration)}},X.checkDeclaration=function(e){if("ObjectPattern"===e.type){var t=e.properties,r=Array.isArray(t),n=0;for(t=r?t:t[Symbol.iterator]();;){var i;if(r){if(n>=t.length)break;i=t[n++]}else{if((n=t.next()).done)break;i=n.value}var s=i;this.checkDeclaration(s)}}else if("ArrayPattern"===e.type){var a=e.elements,o=Array.isArray(a),u=0;for(a=o?a:a[Symbol.iterator]();;){var l;if(o){if(u>=a.length)break;l=a[u++]}else{if((u=a.next()).done)break;l=u.value}var c=l;c&&this.checkDeclaration(c)}}else"ObjectProperty"===e.type?this.checkDeclaration(e.value):"RestElement"===e.type||"RestProperty"===e.type?this.checkDeclaration(e.argument):"Identifier"===e.type&&this.checkDuplicateExports(e,e.name)},X.checkDuplicateExports=function(e,t){this.state.exportedIdentifiers.indexOf(t)>-1&&this.raiseDuplicateExportError(e,t),this.state.exportedIdentifiers.push(t)},X.raiseDuplicateExportError=function(e,t){this.raise(e.start,"default"===t?"Only one default export allowed per module.":"`"+t+"` has already been exported. Exported identifiers must be unique.")},X.parseExportSpecifiers=function(){var e=[],t=!0,r=void 0;for(this.expect(T.braceL);!this.eat(T.braceR);){if(t)t=!1;else if(this.expect(T.comma),this.eat(T.braceR))break;var n=this.match(T._default);n&&!r&&(r=!0);var i=this.startNode();i.local=this.parseIdentifier(n),i.exported=this.eatContextual("as")?this.parseIdentifier(!0):i.local.__clone(),e.push(this.finishNode(i,"ExportSpecifier"))}return r&&!this.isContextual("from")&&this.unexpected(),e},X.parseImport=function(e){return this.eat(T._import),this.match(T.string)?(e.specifiers=[],e.source=this.parseExprAtom()):(e.specifiers=[],this.parseImportSpecifiers(e),this.expectContextual("from"),e.source=this.match(T.string)?this.parseExprAtom():this.unexpected()),this.semicolon(),this.finishNode(e,"ImportDeclaration")},X.parseImportSpecifiers=function(e){var t=!0;if(this.match(T.name)){var r=this.state.start,n=this.state.startLoc;if(e.specifiers.push(this.parseImportSpecifierDefault(this.parseIdentifier(),r,n)),!this.eat(T.comma))return}if(this.match(T.star)){var i=this.startNode();return this.next(),this.expectContextual("as"),i.local=this.parseIdentifier(),this.checkLVal(i.local,!0,void 0,"import namespace specifier"),void e.specifiers.push(this.finishNode(i,"ImportNamespaceSpecifier"))}for(this.expect(T.braceL);!this.eat(T.braceR);){if(t)t=!1;else if(this.eat(T.colon)&&this.unexpected(null,"ES2015 named imports do not destructure. Use another statement for destructuring after the import."),this.expect(T.comma),this.eat(T.braceR))break;this.parseImportSpecifier(e)}},X.parseImportSpecifier=function(e){var t=this.startNode();t.imported=this.parseIdentifier(!0),this.eatContextual("as")?t.local=this.parseIdentifier():(this.checkReservedWord(t.imported.name,t.start,!0,!0),t.local=t.imported.__clone()),this.checkLVal(t.local,!0,void 0,"import specifier"),e.specifiers.push(this.finishNode(t,"ImportSpecifier"))},X.parseImportSpecifierDefault=function(e,t,r){var n=this.startNodeAt(t,r);return n.local=e,this.checkLVal(n.local,!0,void 0,"default import specifier"),this.finishNode(n,"ImportDefaultSpecifier")};var z=q.prototype;z.toAssignable=function(e,t,r){if(e)switch(e.type){case"Identifier":case"ObjectPattern":case"ArrayPattern":case"AssignmentPattern":break;case"ObjectExpression":e.type="ObjectPattern";var n=e.properties,i=Array.isArray(n),s=0;for(n=i?n:n[Symbol.iterator]();;){var a;if(i){if(s>=n.length)break;a=n[s++]}else{if((s=n.next()).done)break;a=s.value}var o=a;"ObjectMethod"===o.type?"get"===o.kind||"set"===o.kind?this.raise(o.key.start,"Object pattern can't contain getter or setter"):this.raise(o.key.start,"Object pattern can't contain methods"):this.toAssignable(o,t,"object destructuring pattern")}break;case"ObjectProperty":this.toAssignable(e.value,t,r);break;case"SpreadProperty":e.type="RestProperty";var u=e.argument;this.toAssignable(u,t,r);break;case"ArrayExpression":e.type="ArrayPattern",this.toAssignableList(e.elements,t,r);break;case"AssignmentExpression":"="===e.operator?(e.type="AssignmentPattern",delete e.operator):this.raise(e.left.end,"Only '=' operator can be used for specifying default value.");break;case"MemberExpression":if(!t)break;default:var l="Invalid left-hand side"+(r?" in "+r:"expression");this.raise(e.start,l)}return e},z.toAssignableList=function(e,t,r){var n=e.length;if(n){var i=e[n-1];if(i&&"RestElement"===i.type)--n;else if(i&&"SpreadElement"===i.type){i.type="RestElement";var s=i.argument;this.toAssignable(s,t,r),"Identifier"!==s.type&&"MemberExpression"!==s.type&&"ArrayPattern"!==s.type&&this.unexpected(s.start),--n}}for(var a=0;a=s.length)break;u=s[o++]}else{if((o=s.next()).done)break;u=o.value}var l=u;"ObjectProperty"===l.type&&(l=l.value),this.checkLVal(l,t,r,"object destructuring pattern")}break;case"ArrayPattern":var c=e.elements,p=Array.isArray(c),h=0;for(c=p?c:c[Symbol.iterator]();;){var f;if(p){if(h>=c.length)break;f=c[h++]}else{if((h=c.next()).done)break;f=h.value}var d=f;d&&this.checkLVal(d,t,r,"array destructuring pattern")}break;case"AssignmentPattern":this.checkLVal(e.left,t,r,"assignment pattern");break;case"RestProperty":this.checkLVal(e.argument,t,r,"rest property");break;case"RestElement":this.checkLVal(e.argument,t,r,"rest element");break;default:var m=(t?"Binding invalid":"Invalid")+" left-hand side"+(n?" in "+n:"expression");this.raise(e.start,m)}};var Y=q.prototype;Y.checkPropClash=function(e,t){if(!e.computed&&!e.kind){var r=e.key;"__proto__"===("Identifier"===r.type?r.name:String(r.value))&&(t.proto&&this.raise(r.start,"Redefinition of __proto__ property"),t.proto=!0)}},Y.getExpression=function(){this.nextToken();var e=this.parseExpression();return this.match(T.eof)||this.unexpected(),e},Y.parseExpression=function(e,t){var r=this.state.start,n=this.state.startLoc,i=this.parseMaybeAssign(e,t);if(this.match(T.comma)){var s=this.startNodeAt(r,n);for(s.expressions=[i];this.eat(T.comma);)s.expressions.push(this.parseMaybeAssign(e,t));return this.toReferencedList(s.expressions),this.finishNode(s,"SequenceExpression")}return i},Y.parseMaybeAssign=function(e,t,r,n){var i=this.state.start,s=this.state.startLoc;if(this.match(T._yield)&&this.state.inGenerator){var a=this.parseYield();return r&&(a=r.call(this,a,i,s)),a}var o=void 0;t?o=!1:(t={start:0},o=!0),(this.match(T.parenL)||this.match(T.name))&&(this.state.potentialArrowAt=this.state.start);var u=this.parseMaybeConditional(e,t,n);if(r&&(u=r.call(this,u,i,s)),this.state.type.isAssign){var l=this.startNodeAt(i,s);if(l.operator=this.state.value,l.left=this.match(T.eq)?this.toAssignable(u,void 0,"assignment expression"):u,t.start=0,this.checkLVal(u,void 0,void 0,"assignment expression"),u.extra&&u.extra.parenthesized){var c=void 0;"ObjectPattern"===u.type?c="`({a}) = 0` use `({a} = 0)`":"ArrayPattern"===u.type&&(c="`([a]) = 0` use `([a] = 0)`"),c&&this.raise(u.start,"You're trying to assign to a parenthesized expression, eg. instead of "+c)}return this.next(),l.right=this.parseMaybeAssign(e),this.finishNode(l,"AssignmentExpression")}return o&&t.start&&this.unexpected(t.start),u},Y.parseMaybeConditional=function(e,t,r){var n=this.state.start,i=this.state.startLoc,s=this.parseExprOps(e,t);return t&&t.start?s:this.parseConditional(s,e,n,i,r)},Y.parseConditional=function(e,t,r,n){if(this.eat(T.question)){var i=this.startNodeAt(r,n);return i.test=e,i.consequent=this.parseMaybeAssign(),this.expect(T.colon),i.alternate=this.parseMaybeAssign(t),this.finishNode(i,"ConditionalExpression")}return e},Y.parseExprOps=function(e,t){var r=this.state.start,n=this.state.startLoc,i=this.parseMaybeUnary(t);return t&&t.start?i:this.parseExprOp(i,r,n,-1,e)},Y.parseExprOp=function(e,t,r,n,i){var s=this.state.type.binop;if(!(null==s||i&&this.match(T._in))&&s>n){var a=this.startNodeAt(t,r);a.left=e,a.operator=this.state.value,"**"!==a.operator||"UnaryExpression"!==e.type||!e.extra||e.extra.parenthesizedArgument||e.extra.parenthesized||this.raise(e.argument.start,"Illegal expression. Wrap left hand side or entire exponentiation in parentheses.");var o=this.state.type;this.next();var u=this.state.start,l=this.state.startLoc;return a.right=this.parseExprOp(this.parseMaybeUnary(),u,l,o.rightAssociative?s-1:s,i),this.finishNode(a,o===T.logicalOR||o===T.logicalAND?"LogicalExpression":"BinaryExpression"),this.parseExprOp(a,t,r,n,i)}return e},Y.parseMaybeUnary=function(e){if(this.state.type.prefix){var t=this.startNode(),r=this.match(T.incDec);t.operator=this.state.value,t.prefix=!0,this.next();var n=this.state.type;return t.argument=this.parseMaybeUnary(),this.addExtra(t,"parenthesizedArgument",!(n!==T.parenL||t.argument.extra&&t.argument.extra.parenthesized)),e&&e.start&&this.unexpected(e.start),r?this.checkLVal(t.argument,void 0,void 0,"prefix operation"):this.state.strict&&"delete"===t.operator&&"Identifier"===t.argument.type&&this.raise(t.start,"Deleting local variable in strict mode"),this.finishNode(t,r?"UpdateExpression":"UnaryExpression")}var i=this.state.start,s=this.state.startLoc,a=this.parseExprSubscripts(e);if(e&&e.start)return a;for(;this.state.type.postfix&&!this.canInsertSemicolon();){var o=this.startNodeAt(i,s);o.operator=this.state.value,o.prefix=!1,o.argument=a,this.checkLVal(a,void 0,void 0,"postfix operation"),this.next(),a=this.finishNode(o,"UpdateExpression")}return a},Y.parseExprSubscripts=function(e){var t=this.state.start,r=this.state.startLoc,n=this.state.potentialArrowAt,i=this.parseExprAtom(e);return"ArrowFunctionExpression"===i.type&&i.start===n?i:e&&e.start?i:this.parseSubscripts(i,t,r)},Y.parseSubscripts=function(e,t,r,n){for(;;){if(!n&&this.eat(T.doubleColon)){var i=this.startNodeAt(t,r);return i.object=e,i.callee=this.parseNoCallExpr(),this.parseSubscripts(this.finishNode(i,"BindExpression"),t,r,n)}if(this.eat(T.dot)){var s=this.startNodeAt(t,r);s.object=e,s.property=this.parseIdentifier(!0),s.computed=!1,e=this.finishNode(s,"MemberExpression")}else if(this.eat(T.bracketL)){var a=this.startNodeAt(t,r);a.object=e,a.property=this.parseExpression(),a.computed=!0,this.expect(T.bracketR),e=this.finishNode(a,"MemberExpression")}else if(!n&&this.match(T.parenL)){var o=this.state.potentialArrowAt===e.start&&"Identifier"===e.type&&"async"===e.name&&!this.canInsertSemicolon();this.next();var u=this.startNodeAt(t,r);if(u.callee=e,u.arguments=this.parseCallExpressionArguments(T.parenR,o),"Import"===u.callee.type&&1!==u.arguments.length&&this.raise(u.start,"import() requires exactly one argument"),e=this.finishNode(u,"CallExpression"),o&&this.shouldParseAsyncArrow())return this.parseAsyncArrowFromCallExpression(this.startNodeAt(t,r),u);this.toReferencedList(u.arguments)}else{if(!this.match(T.backQuote))return e;var l=this.startNodeAt(t,r);l.tag=e,l.quasi=this.parseTemplate(!0),e=this.finishNode(l,"TaggedTemplateExpression")}}},Y.parseCallExpressionArguments=function(e,t){for(var r=[],n=void 0,i=!0;!this.eat(e);){if(i)i=!1;else if(this.expect(T.comma),this.eat(e))break;this.match(T.parenL)&&!n&&(n=this.state.start),r.push(this.parseExprListItem(!1,t?{start:0}:void 0,t?{start:0}:void 0))}return t&&n&&this.shouldParseAsyncArrow()&&this.unexpected(),r},Y.shouldParseAsyncArrow=function(){return this.match(T.arrow)},Y.parseAsyncArrowFromCallExpression=function(e,t){return this.expect(T.arrow),this.parseArrowExpression(e,t.arguments,!0)},Y.parseNoCallExpr=function(){var e=this.state.start,t=this.state.startLoc;return this.parseSubscripts(this.parseExprAtom(),e,t,!0)},Y.parseExprAtom=function(e){var t=this.state.potentialArrowAt===this.state.start,r=void 0;switch(this.state.type){case T._super:return this.state.inMethod||this.state.inClassProperty||this.options.allowSuperOutsideMethod||this.raise(this.state.start,"'super' outside of function or class"),r=this.startNode(),this.next(),this.match(T.parenL)||this.match(T.bracketL)||this.match(T.dot)||this.unexpected(),this.match(T.parenL)&&"constructor"!==this.state.inMethod&&!this.options.allowSuperOutsideMethod&&this.raise(r.start,"super() outside of class constructor"),this.finishNode(r,"Super");case T._import:return this.hasPlugin("dynamicImport")||this.unexpected(),r=this.startNode(),this.next(),this.match(T.parenL)||this.unexpected(null,T.parenL),this.finishNode(r,"Import");case T._this:return r=this.startNode(),this.next(),this.finishNode(r,"ThisExpression");case T._yield:this.state.inGenerator&&this.unexpected();case T.name:r=this.startNode();var n="await"===this.state.value&&this.state.inAsync,i=this.shouldAllowYieldIdentifier(),s=this.parseIdentifier(n||i);if("await"===s.name){if(this.state.inAsync||this.inModule)return this.parseAwait(r)}else{if("async"===s.name&&this.match(T._function)&&!this.canInsertSemicolon())return this.next(),this.parseFunction(r,!1,!1,!0);if(t&&"async"===s.name&&this.match(T.name)){var a=[this.parseIdentifier()];return this.expect(T.arrow),this.parseArrowExpression(r,a,!0)}}return t&&!this.canInsertSemicolon()&&this.eat(T.arrow)?this.parseArrowExpression(r,[s]):s;case T._do:if(this.hasPlugin("doExpressions")){var o=this.startNode();this.next();var u=this.state.inFunction,l=this.state.labels;return this.state.labels=[],this.state.inFunction=!1,o.body=this.parseBlock(!1,!0),this.state.inFunction=u,this.state.labels=l,this.finishNode(o,"DoExpression")}case T.regexp:var c=this.state.value;return r=this.parseLiteral(c.value,"RegExpLiteral"),r.pattern=c.pattern,r.flags=c.flags,r;case T.num:return this.parseLiteral(this.state.value,"NumericLiteral");case T.string:return this.parseLiteral(this.state.value,"StringLiteral");case T._null:return r=this.startNode(),this.next(),this.finishNode(r,"NullLiteral");case T._true:case T._false:return r=this.startNode(),r.value=this.match(T._true),this.next(),this.finishNode(r,"BooleanLiteral");case T.parenL:return this.parseParenAndDistinguishExpression(null,null,t);case T.bracketL:return r=this.startNode(),this.next(),r.elements=this.parseExprList(T.bracketR,!0,e),this.toReferencedList(r.elements),this.finishNode(r,"ArrayExpression");case T.braceL:return this.parseObj(!1,e);case T._function:return this.parseFunctionExpression();case T.at:this.parseDecorators();case T._class:return r=this.startNode(),this.takeDecorators(r),this.parseClass(r,!1);case T._new:return this.parseNew();case T.backQuote:return this.parseTemplate(!1);case T.doubleColon:r=this.startNode(),this.next(),r.object=null;var p=r.callee=this.parseNoCallExpr();if("MemberExpression"===p.type)return this.finishNode(r,"BindExpression");this.raise(p.start,"Binding should be performed on object property.");default:this.unexpected()}},Y.parseFunctionExpression=function(){var e=this.startNode(),t=this.parseIdentifier(!0);return this.state.inGenerator&&this.eat(T.dot)&&this.hasPlugin("functionSent")?this.parseMetaProperty(e,t,"sent"):this.parseFunction(e,!1)},Y.parseMetaProperty=function(e,t,r){return e.meta=t,e.property=this.parseIdentifier(!0),e.property.name!==r&&this.raise(e.property.start,"The only valid meta property for new is "+t.name+"."+r),this.finishNode(e,"MetaProperty")},Y.parseLiteral=function(e,t,r,n){r=r||this.state.start,n=n||this.state.startLoc;var i=this.startNodeAt(r,n);return this.addExtra(i,"rawValue",e),this.addExtra(i,"raw",this.input.slice(r,this.state.end)),i.value=e,this.next(),this.finishNode(i,t)},Y.parseParenExpression=function(){this.expect(T.parenL);var e=this.parseExpression();return this.expect(T.parenR),e},Y.parseParenAndDistinguishExpression=function(e,t,r){e=e||this.state.start,t=t||this.state.startLoc;var n=void 0;this.expect(T.parenL);for(var i=this.state.start,s=this.state.startLoc,a=[],o={start:0},u={start:0},l=!0,c=void 0,p=void 0;!this.match(T.parenR);){if(l)l=!1;else if(this.expect(T.comma,u.start||null),this.match(T.parenR)){p=this.state.start;break}if(this.match(T.ellipsis)){var h=this.state.start,f=this.state.startLoc;c=this.state.start,a.push(this.parseParenItem(this.parseRest(),h,f));break}a.push(this.parseMaybeAssign(!1,o,this.parseParenItem,u))}var d=this.state.start,m=this.state.startLoc;this.expect(T.parenR);var y=this.startNodeAt(e,t);if(r&&this.shouldParseArrow()&&(y=this.parseArrow(y))){var g=a,b=Array.isArray(g),v=0;for(g=b?g:g[Symbol.iterator]();;){var x;if(b){if(v>=g.length)break;x=g[v++]}else{if((v=g.next()).done)break;x=v.value}var E=x;E.extra&&E.extra.parenthesized&&this.unexpected(E.extra.parenStart)}return this.parseArrowExpression(y,a)}return a.length||this.unexpected(this.state.lastTokStart),p&&this.unexpected(p),c&&this.unexpected(c),o.start&&this.unexpected(o.start),u.start&&this.unexpected(u.start),a.length>1?((n=this.startNodeAt(i,s)).expressions=a,this.toReferencedList(n.expressions),this.finishNodeAt(n,"SequenceExpression",d,m)):n=a[0],this.addExtra(n,"parenthesized",!0),this.addExtra(n,"parenStart",e),n},Y.shouldParseArrow=function(){return!this.canInsertSemicolon()},Y.parseArrow=function(e){if(this.eat(T.arrow))return e},Y.parseParenItem=function(e){return e},Y.parseNew=function(){var e=this.startNode(),t=this.parseIdentifier(!0);if(this.eat(T.dot)){var r=this.parseMetaProperty(e,t,"target");return this.state.inFunction||this.raise(r.property.start,"new.target can only be used in functions"),r}return e.callee=this.parseNoCallExpr(),this.eat(T.parenL)?(e.arguments=this.parseExprList(T.parenR),this.toReferencedList(e.arguments)):e.arguments=[],this.finishNode(e,"NewExpression")},Y.parseTemplateElement=function(e){var t=this.startNode();return null===this.state.value&&(e&&this.hasPlugin("templateInvalidEscapes")?this.state.invalidTemplateEscapePosition=null:this.raise(this.state.invalidTemplateEscapePosition,"Invalid escape sequence in template")),t.value={raw:this.input.slice(this.state.start,this.state.end).replace(/\r\n?/g,"\n"),cooked:this.state.value},this.next(),t.tail=this.match(T.backQuote),this.finishNode(t,"TemplateElement")},Y.parseTemplate=function(e){var t=this.startNode();this.next(),t.expressions=[];var r=this.parseTemplateElement(e);for(t.quasis=[r];!r.tail;)this.expect(T.dollarBraceL),t.expressions.push(this.parseExpression()),this.expect(T.braceR),t.quasis.push(r=this.parseTemplateElement(e));return this.next(),this.finishNode(t,"TemplateLiteral")},Y.parseObj=function(e,t){var r=[],n=Object.create(null),i=!0,s=this.startNode();s.properties=[],this.next();for(var a=null;!this.eat(T.braceR);){if(i)i=!1;else if(this.expect(T.comma),this.eat(T.braceR))break;for(;this.match(T.at);)r.push(this.parseDecorator());var o=this.startNode(),u=!1,l=!1,c=void 0,p=void 0;if(r.length&&(o.decorators=r,r=[]),this.hasPlugin("objectRestSpread")&&this.match(T.ellipsis)){if(o=this.parseSpread(e?{start:0}:void 0),o.type=e?"RestProperty":"SpreadProperty",e&&this.toAssignable(o.argument,!0,"object pattern"),s.properties.push(o),!e)continue;var h=this.state.start;if(null===a){if(this.eat(T.braceR))break;if(this.match(T.comma)&&this.lookahead().type===T.braceR)continue;a=h;continue}this.unexpected(a,"Cannot have multiple rest elements when destructuring")}if(o.method=!1,o.shorthand=!1,(e||t)&&(c=this.state.start,p=this.state.startLoc),e||(u=this.eat(T.star)),!e&&this.isContextual("async")){u&&this.unexpected();var f=this.parseIdentifier();this.match(T.colon)||this.match(T.parenL)||this.match(T.braceR)||this.match(T.eq)||this.match(T.comma)?(o.key=f,o.computed=!1):(l=!0,this.hasPlugin("asyncGenerators")&&(u=this.eat(T.star)),this.parsePropertyName(o))}else this.parsePropertyName(o);this.parseObjPropValue(o,c,p,u,l,e,t),this.checkPropClash(o,n),o.shorthand&&this.addExtra(o,"shorthand",!0),s.properties.push(o)}return null!==a&&this.unexpected(a,"The rest element has to be the last element when destructuring"),r.length&&this.raise(this.state.start,"You have trailing decorators with no property"),this.finishNode(s,e?"ObjectPattern":"ObjectExpression")},Y.isGetterOrSetterMethod=function(e,t){return!t&&!e.computed&&"Identifier"===e.key.type&&("get"===e.key.name||"set"===e.key.name)&&(this.match(T.string)||this.match(T.num)||this.match(T.bracketL)||this.match(T.name)||this.state.type.keyword)},Y.checkGetterSetterParamCount=function(e){var t="get"===e.kind?0:1;if(e.params.length!==t){var r=e.start;"get"===e.kind?this.raise(r,"getter should have no params"):this.raise(r,"setter should have exactly one param")}},Y.parseObjectMethod=function(e,t,r,n){return r||t||this.match(T.parenL)?(n&&this.unexpected(),e.kind="method",e.method=!0,this.parseMethod(e,t,r),this.finishNode(e,"ObjectMethod")):this.isGetterOrSetterMethod(e,n)?((t||r)&&this.unexpected(),e.kind=e.key.name,this.parsePropertyName(e),this.parseMethod(e),this.checkGetterSetterParamCount(e),this.finishNode(e,"ObjectMethod")):void 0},Y.parseObjectProperty=function(e,t,r,n,i){return this.eat(T.colon)?(e.value=n?this.parseMaybeDefault(this.state.start,this.state.startLoc):this.parseMaybeAssign(!1,i),this.finishNode(e,"ObjectProperty")):e.computed||"Identifier"!==e.key.type?void 0:(this.checkReservedWord(e.key.name,e.key.start,!0,!0),n?e.value=this.parseMaybeDefault(t,r,e.key.__clone()):this.match(T.eq)&&i?(i.start||(i.start=this.state.start),e.value=this.parseMaybeDefault(t,r,e.key.__clone())):e.value=e.key.__clone(),e.shorthand=!0,this.finishNode(e,"ObjectProperty"))},Y.parseObjPropValue=function(e,t,r,n,i,s,a){var o=this.parseObjectMethod(e,n,i,s)||this.parseObjectProperty(e,t,r,s,a);return o||this.unexpected(),o},Y.parsePropertyName=function(e){if(this.eat(T.bracketL))e.computed=!0,e.key=this.parseMaybeAssign(),this.expect(T.bracketR);else{e.computed=!1;var t=this.state.inPropertyName;this.state.inPropertyName=!0,e.key=this.match(T.num)||this.match(T.string)?this.parseExprAtom():this.parseIdentifier(!0),this.state.inPropertyName=t}return e.key},Y.initFunction=function(e,t){e.id=null,e.generator=!1,e.expression=!1,e.async=!!t},Y.parseMethod=function(e,t,r){var n=this.state.inMethod;return this.state.inMethod=e.kind||!0,this.initFunction(e,r),this.expect(T.parenL),e.params=this.parseBindingList(T.parenR),e.generator=!!t,this.parseFunctionBody(e),this.state.inMethod=n,e},Y.parseArrowExpression=function(e,t,r){return this.initFunction(e,r),e.params=this.toAssignableList(t,!0,"arrow function parameters"),this.parseFunctionBody(e,!0),this.finishNode(e,"ArrowFunctionExpression")},Y.isStrictBody=function(e,t){if(!t&&e.body.directives.length){var r=e.body.directives,n=Array.isArray(r),i=0;for(r=n?r:r[Symbol.iterator]();;){var s;if(n){if(i>=r.length)break;s=r[i++]}else{if((i=r.next()).done)break;s=i.value}if("use strict"===s.value.value)return!0}}return!1},Y.parseFunctionBody=function(e,t){var r=t&&!this.match(T.braceL),n=this.state.inAsync;if(this.state.inAsync=e.async,r)e.body=this.parseMaybeAssign(),e.expression=!0;else{var i=this.state.inFunction,s=this.state.inGenerator,a=this.state.labels;this.state.inFunction=!0,this.state.inGenerator=e.generator,this.state.labels=[],e.body=this.parseBlock(!0),e.expression=!1,this.state.inFunction=i,this.state.inGenerator=s,this.state.labels=a}this.state.inAsync=n;var o=this.isStrictBody(e,r),u=this.state.strict||t||o;if(o&&e.id&&"Identifier"===e.id.type&&"yield"===e.id.name&&this.raise(e.id.start,"Binding yield in strict mode"),u){var l=Object.create(null),c=this.state.strict;o&&(this.state.strict=!0),e.id&&this.checkLVal(e.id,!0,void 0,"function name");var p=e.params,h=Array.isArray(p),f=0;for(p=h?p:p[Symbol.iterator]();;){var d;if(h){if(f>=p.length)break;d=p[f++]}else{if((f=p.next()).done)break;d=f.value}var m=d;o&&"Identifier"!==m.type&&this.raise(m.start,"Non-simple parameter in strict mode"),this.checkLVal(m,!0,l,"function parameter list")}this.state.strict=c}},Y.parseExprList=function(e,t,r){for(var n=[],i=!0;!this.eat(e);){if(i)i=!1;else if(this.expect(T.comma),this.eat(e))break;n.push(this.parseExprListItem(t,r))}return n},Y.parseExprListItem=function(e,t,r){return e&&this.match(T.comma)?null:this.match(T.ellipsis)?this.parseSpread(t):this.parseMaybeAssign(!1,t,this.parseParenItem,r)},Y.parseIdentifier=function(e){var t=this.startNode();return e||this.checkReservedWord(this.state.value,this.state.start,!!this.state.type.keyword,!1),this.match(T.name)?t.name=this.state.value:this.state.type.keyword?t.name=this.state.type.keyword:this.unexpected(),!e&&"await"===t.name&&this.state.inAsync&&this.raise(t.start,"invalid use of await inside of an async function"),t.loc.identifierName=t.name,this.next(),this.finishNode(t,"Identifier")},Y.checkReservedWord=function(e,t,r,n){(this.isReservedWord(e)||r&&this.isKeyword(e))&&this.raise(t,e+" is a reserved word"),this.state.strict&&(f.strict(e)||n&&f.strictBind(e))&&this.raise(t,e+" is a reserved word in strict mode")},Y.parseAwait=function(e){return this.state.inAsync||this.unexpected(),this.match(T.star)&&this.raise(e.start,"await* has been removed from the async functions proposal. Use Promise.all() instead."),e.argument=this.parseMaybeUnary(),this.finishNode(e,"AwaitExpression")},Y.parseYield=function(){var e=this.startNode();return this.next(),this.match(T.semi)||this.canInsertSemicolon()||!this.match(T.star)&&!this.state.type.startsExpr?(e.delegate=!1,e.argument=null):(e.delegate=this.eat(T.star),e.argument=this.parseMaybeAssign()),this.finishNode(e,"YieldExpression")};var H=q.prototype,$=["leadingComments","trailingComments","innerComments"],Q=function(){function e(t,r,n){D(this,e),this.type="",this.start=t,this.end=0,this.loc=new M(r),n&&(this.loc.filename=n)}return e.prototype.__clone=function(){var t=new e;for(var r in this)$.indexOf(r)<0&&(t[r]=this[r]);return t},e}();H.startNode=function(){return new Q(this.state.start,this.state.startLoc,this.filename)},H.startNodeAt=function(e,t){return new Q(e,t,this.filename)},H.finishNode=function(e,t){return l.call(this,e,t,this.state.lastTokEnd,this.state.lastTokEndLoc)},H.finishNodeAt=function(e,t,r,n){return l.call(this,e,t,r,n)};q.prototype.raise=function(e,t){var r=function(e,t){for(var r=1,n=0;;){O.lastIndex=n;var i=O.exec(e);if(!(i&&i.index0)){var t=this.state.commentStack,r=void 0,n=void 0,i=void 0,s=void 0,a=void 0;if(this.state.trailingComments.length>0)this.state.trailingComments[0].start>=e.end?(i=this.state.trailingComments,this.state.trailingComments=[]):this.state.trailingComments.length=0;else{var o=c(t);t.length>0&&o.trailingComments&&o.trailingComments[0].start>=e.end&&(i=o.trailingComments,o.trailingComments=null)}for(t.length>0&&c(t).start>=e.start&&(r=t.pop());t.length>0&&c(t).start>=e.start;)n=t.pop();if(!n&&r&&(n=r),r&&this.state.leadingComments.length>0){var u=c(this.state.leadingComments);if("ObjectProperty"===r.type){if(u.start>=e.start&&this.state.commentPreviousNode){for(a=0;a0&&(r.trailingComments=this.state.leadingComments,this.state.leadingComments=[])}}else if("CallExpression"===e.type&&e.arguments&&e.arguments.length){var l=c(e.arguments);l&&u.start>=l.start&&u.end<=e.end&&this.state.commentPreviousNode&&this.state.leadingComments.length>0&&(l.trailingComments=this.state.leadingComments,this.state.leadingComments=[])}}if(n){if(n.leadingComments)if(n!==e&&c(n.leadingComments).end<=e.start)e.leadingComments=n.leadingComments,n.leadingComments=null;else for(s=n.leadingComments.length-2;s>=0;--s)if(n.leadingComments[s].end<=e.start){e.leadingComments=n.leadingComments.splice(0,s+1);break}}else if(this.state.leadingComments.length>0)if(c(this.state.leadingComments).end<=e.start){if(this.state.commentPreviousNode)for(a=0;a0&&(e.leadingComments=this.state.leadingComments,this.state.leadingComments=[])}else{for(s=0;se.start);s++);e.leadingComments=this.state.leadingComments.slice(0,s),0===e.leadingComments.length&&(e.leadingComments=null),0===(i=this.state.leadingComments.slice(s)).length&&(i=null)}this.state.commentPreviousNode=e,i&&(i.length&&i[0].start>=e.start&&c(i).end<=e.end?e.innerComments=i:e.trailingComments=i),t.push(e)}};var ee=q.prototype;ee.estreeParseRegExpLiteral=function(e){var t=e.pattern,r=e.flags,n=null;try{n=new RegExp(t,r)}catch(e){}var i=this.estreeParseLiteral(n);return i.regex={pattern:t,flags:r},i},ee.estreeParseLiteral=function(e){return this.parseLiteral(e,"Literal")},ee.directiveToStmt=function(e){var t=e.value,r=this.startNodeAt(e.start,e.loc.start),n=this.startNodeAt(t.start,t.loc.start);return n.value=t.value,n.raw=t.extra.raw,r.expression=this.finishNodeAt(n,"Literal",t.end,t.loc.end),r.directive=t.extra.raw.slice(1,-1),this.finishNodeAt(r,"ExpressionStatement",e.end,e.loc.end)};var te=["any","mixed","empty","bool","boolean","number","string","void","null"],re=q.prototype;re.flowParseTypeInitialiser=function(e){var t=this.state.inType;this.state.inType=!0,this.expect(e||T.colon);var r=this.flowParseType();return this.state.inType=t,r},re.flowParsePredicate=function(){var e=this.startNode(),t=this.state.startLoc,r=this.state.start;this.expect(T.modulo);var n=this.state.startLoc;return this.expectContextual("checks"),t.line===n.line&&t.column===n.column-1||this.raise(r,"Spaces between ´%´ and ´checks´ are not allowed here."),this.eat(T.parenL)?(e.expression=this.parseExpression(),this.expect(T.parenR),this.finishNode(e,"DeclaredPredicate")):this.finishNode(e,"InferredPredicate")},re.flowParseTypeAndPredicateInitialiser=function(){var e=this.state.inType;this.state.inType=!0,this.expect(T.colon);var t=null,r=null;return this.match(T.modulo)?(this.state.inType=e,r=this.flowParsePredicate()):(t=this.flowParseType(),this.state.inType=e,this.match(T.modulo)&&(r=this.flowParsePredicate())),[t,r]},re.flowParseDeclareClass=function(e){return this.next(),this.flowParseInterfaceish(e,!0),this.finishNode(e,"DeclareClass")},re.flowParseDeclareFunction=function(e){this.next();var t=e.id=this.parseIdentifier(),r=this.startNode(),n=this.startNode();this.isRelational("<")?r.typeParameters=this.flowParseTypeParameterDeclaration():r.typeParameters=null,this.expect(T.parenL);var i=this.flowParseFunctionTypeParams();r.params=i.params,r.rest=i.rest,this.expect(T.parenR);var s=null,a=this.flowParseTypeAndPredicateInitialiser();return r.returnType=a[0],s=a[1],n.typeAnnotation=this.finishNode(r,"FunctionTypeAnnotation"),n.predicate=s,t.typeAnnotation=this.finishNode(n,"TypeAnnotation"),this.finishNode(t,t.type),this.semicolon(),this.finishNode(e,"DeclareFunction")},re.flowParseDeclare=function(e){return this.match(T._class)?this.flowParseDeclareClass(e):this.match(T._function)?this.flowParseDeclareFunction(e):this.match(T._var)?this.flowParseDeclareVariable(e):this.isContextual("module")?this.lookahead().type===T.dot?this.flowParseDeclareModuleExports(e):this.flowParseDeclareModule(e):this.isContextual("type")?this.flowParseDeclareTypeAlias(e):this.isContextual("opaque")?this.flowParseDeclareOpaqueType(e):this.isContextual("interface")?this.flowParseDeclareInterface(e):this.match(T._export)?this.flowParseDeclareExportDeclaration(e):void this.unexpected()},re.flowParseDeclareExportDeclaration=function(e){if(this.expect(T._export),this.isContextual("opaque"))return e.declaration=this.flowParseDeclare(this.startNode()),e.default=!1,this.finishNode(e,"DeclareExportDeclaration");throw this.unexpected()},re.flowParseDeclareVariable=function(e){return this.next(),e.id=this.flowParseTypeAnnotatableIdentifier(),this.semicolon(),this.finishNode(e,"DeclareVariable")},re.flowParseDeclareModule=function(e){this.next(),this.match(T.string)?e.id=this.parseExprAtom():e.id=this.parseIdentifier();var t=e.body=this.startNode(),r=t.body=[];for(this.expect(T.braceL);!this.match(T.braceR);){var n=this.startNode();if(this.match(T._import)){var i=this.lookahead();"type"!==i.value&&"typeof"!==i.value&&this.unexpected(null,"Imports within a `declare module` body must always be `import type` or `import typeof`"),this.parseImport(n)}else this.expectContextual("declare","Only declares and type imports are allowed inside declare module"),n=this.flowParseDeclare(n,!0);r.push(n)}return this.expect(T.braceR),this.finishNode(t,"BlockStatement"),this.finishNode(e,"DeclareModule")},re.flowParseDeclareModuleExports=function(e){return this.expectContextual("module"),this.expect(T.dot),this.expectContextual("exports"),e.typeAnnotation=this.flowParseTypeAnnotation(),this.semicolon(),this.finishNode(e,"DeclareModuleExports")},re.flowParseDeclareTypeAlias=function(e){return this.next(),this.flowParseTypeAlias(e),this.finishNode(e,"DeclareTypeAlias")},re.flowParseDeclareOpaqueType=function(e){return this.next(),this.flowParseOpaqueType(e,!0),this.finishNode(e,"DeclareOpaqueType")},re.flowParseDeclareInterface=function(e){return this.next(),this.flowParseInterfaceish(e),this.finishNode(e,"DeclareInterface")},re.flowParseInterfaceish=function(e){if(e.id=this.parseIdentifier(),this.isRelational("<")?e.typeParameters=this.flowParseTypeParameterDeclaration():e.typeParameters=null,e.extends=[],e.mixins=[],this.eat(T._extends))do{e.extends.push(this.flowParseInterfaceExtends())}while(this.eat(T.comma));if(this.isContextual("mixins")){this.next();do{e.mixins.push(this.flowParseInterfaceExtends())}while(this.eat(T.comma))}e.body=this.flowParseObjectType(!0,!1,!1)},re.flowParseInterfaceExtends=function(){var e=this.startNode();return e.id=this.flowParseQualifiedTypeIdentifier(),this.isRelational("<")?e.typeParameters=this.flowParseTypeParameterInstantiation():e.typeParameters=null,this.finishNode(e,"InterfaceExtends")},re.flowParseInterface=function(e){return this.flowParseInterfaceish(e,!1),this.finishNode(e,"InterfaceDeclaration")},re.flowParseRestrictedIdentifier=function(e){return te.indexOf(this.state.value)>-1&&this.raise(this.state.start,"Cannot overwrite primitive type "+this.state.value),this.parseIdentifier(e)},re.flowParseTypeAlias=function(e){return e.id=this.flowParseRestrictedIdentifier(),this.isRelational("<")?e.typeParameters=this.flowParseTypeParameterDeclaration():e.typeParameters=null,e.right=this.flowParseTypeInitialiser(T.eq),this.semicolon(),this.finishNode(e,"TypeAlias")},re.flowParseOpaqueType=function(e,t){return this.expectContextual("type"),e.id=this.flowParseRestrictedIdentifier(),this.isRelational("<")?e.typeParameters=this.flowParseTypeParameterDeclaration():e.typeParameters=null,e.supertype=null,this.match(T.colon)&&(e.supertype=this.flowParseTypeInitialiser(T.colon)),e.impltype=null,t||(e.impltype=this.flowParseTypeInitialiser(T.eq)),this.semicolon(),this.finishNode(e,"OpaqueType")},re.flowParseTypeParameter=function(){var e=this.startNode(),t=this.flowParseVariance(),r=this.flowParseTypeAnnotatableIdentifier();return e.name=r.name,e.variance=t,e.bound=r.typeAnnotation,this.match(T.eq)&&(this.eat(T.eq),e.default=this.flowParseType()),this.finishNode(e,"TypeParameter")},re.flowParseTypeParameterDeclaration=function(){var e=this.state.inType,t=this.startNode();t.params=[],this.state.inType=!0,this.isRelational("<")||this.match(T.jsxTagStart)?this.next():this.unexpected();do{t.params.push(this.flowParseTypeParameter()),this.isRelational(">")||this.expect(T.comma)}while(!this.isRelational(">"));return this.expectRelational(">"),this.state.inType=e,this.finishNode(t,"TypeParameterDeclaration")},re.flowParseTypeParameterInstantiation=function(){var e=this.startNode(),t=this.state.inType;for(e.params=[],this.state.inType=!0,this.expectRelational("<");!this.isRelational(">");)e.params.push(this.flowParseType()),this.isRelational(">")||this.expect(T.comma);return this.expectRelational(">"),this.state.inType=t,this.finishNode(e,"TypeParameterInstantiation")},re.flowParseObjectPropertyKey=function(){return this.match(T.num)||this.match(T.string)?this.parseExprAtom():this.parseIdentifier(!0)},re.flowParseObjectTypeIndexer=function(e,t,r){return e.static=t,this.expect(T.bracketL),this.lookahead().type===T.colon?(e.id=this.flowParseObjectPropertyKey(),e.key=this.flowParseTypeInitialiser()):(e.id=null,e.key=this.flowParseType()),this.expect(T.bracketR),e.value=this.flowParseTypeInitialiser(),e.variance=r,this.flowObjectTypeSemicolon(),this.finishNode(e,"ObjectTypeIndexer")},re.flowParseObjectTypeMethodish=function(e){for(e.params=[],e.rest=null,e.typeParameters=null,this.isRelational("<")&&(e.typeParameters=this.flowParseTypeParameterDeclaration()),this.expect(T.parenL);!this.match(T.parenR)&&!this.match(T.ellipsis);)e.params.push(this.flowParseFunctionTypeParam()),this.match(T.parenR)||this.expect(T.comma);return this.eat(T.ellipsis)&&(e.rest=this.flowParseFunctionTypeParam()),this.expect(T.parenR),e.returnType=this.flowParseTypeInitialiser(),this.finishNode(e,"FunctionTypeAnnotation")},re.flowParseObjectTypeMethod=function(e,t,r,n){var i=this.startNodeAt(e,t);return i.value=this.flowParseObjectTypeMethodish(this.startNodeAt(e,t)),i.static=r,i.key=n,i.optional=!1,this.flowObjectTypeSemicolon(),this.finishNode(i,"ObjectTypeProperty")},re.flowParseObjectTypeCallProperty=function(e,t){var r=this.startNode();return e.static=t,e.value=this.flowParseObjectTypeMethodish(r),this.flowObjectTypeSemicolon(),this.finishNode(e,"ObjectTypeCallProperty")},re.flowParseObjectType=function(e,t,r){var n=this.state.inType;this.state.inType=!0;var i=this.startNode(),s=void 0,a=void 0,o=!1;i.callProperties=[],i.properties=[],i.indexers=[];var u=void 0,l=void 0;for(t&&this.match(T.braceBarL)?(this.expect(T.braceBarL),u=T.braceBarR,l=!0):(this.expect(T.braceL),u=T.braceR,l=!1),i.exact=l;!this.match(u);){var c=!1,p=this.state.start,h=this.state.startLoc;s=this.startNode(),e&&this.isContextual("static")&&this.lookahead().type!==T.colon&&(this.next(),o=!0);var f=this.state.start,d=this.flowParseVariance();this.match(T.bracketL)?i.indexers.push(this.flowParseObjectTypeIndexer(s,o,d)):this.match(T.parenL)||this.isRelational("<")?(d&&this.unexpected(f),i.callProperties.push(this.flowParseObjectTypeCallProperty(s,o))):this.match(T.ellipsis)?(r||this.unexpected(null,"Spread operator cannot appear in class or interface definitions"),d&&this.unexpected(d.start,"Spread properties cannot have variance"),this.expect(T.ellipsis),s.argument=this.flowParseType(),this.flowObjectTypeSemicolon(),i.properties.push(this.finishNode(s,"ObjectTypeSpreadProperty"))):(a=this.flowParseObjectPropertyKey(),this.isRelational("<")||this.match(T.parenL)?(d&&this.unexpected(d.start),i.properties.push(this.flowParseObjectTypeMethod(p,h,o,a))):(this.eat(T.question)&&(c=!0),s.key=a,s.value=this.flowParseTypeInitialiser(),s.optional=c,s.static=o,s.variance=d,this.flowObjectTypeSemicolon(),i.properties.push(this.finishNode(s,"ObjectTypeProperty")))),o=!1}this.expect(u);var m=this.finishNode(i,"ObjectTypeAnnotation");return this.state.inType=n,m},re.flowObjectTypeSemicolon=function(){this.eat(T.semi)||this.eat(T.comma)||this.match(T.braceR)||this.match(T.braceBarR)||this.unexpected()},re.flowParseQualifiedTypeIdentifier=function(e,t,r){e=e||this.state.start,t=t||this.state.startLoc;for(var n=r||this.parseIdentifier();this.eat(T.dot);){var i=this.startNodeAt(e,t);i.qualification=n,i.id=this.parseIdentifier(),n=this.finishNode(i,"QualifiedTypeIdentifier")}return n},re.flowParseGenericType=function(e,t,r){var n=this.startNodeAt(e,t);return n.typeParameters=null,n.id=this.flowParseQualifiedTypeIdentifier(e,t,r),this.isRelational("<")&&(n.typeParameters=this.flowParseTypeParameterInstantiation()),this.finishNode(n,"GenericTypeAnnotation")},re.flowParseTypeofType=function(){var e=this.startNode();return this.expect(T._typeof),e.argument=this.flowParsePrimaryType(),this.finishNode(e,"TypeofTypeAnnotation")},re.flowParseTupleType=function(){var e=this.startNode();for(e.types=[],this.expect(T.bracketL);this.state.pos0&&void 0!==arguments[0]?arguments[0]:[],rest:null};!this.match(T.parenR)&&!this.match(T.ellipsis);)e.params.push(this.flowParseFunctionTypeParam()),this.match(T.parenR)||this.expect(T.comma);return this.eat(T.ellipsis)&&(e.rest=this.flowParseFunctionTypeParam()),e},re.flowIdentToTypeAnnotation=function(e,t,r,n){switch(n.name){case"any":return this.finishNode(r,"AnyTypeAnnotation");case"void":return this.finishNode(r,"VoidTypeAnnotation");case"bool":case"boolean":return this.finishNode(r,"BooleanTypeAnnotation");case"mixed":return this.finishNode(r,"MixedTypeAnnotation");case"empty":return this.finishNode(r,"EmptyTypeAnnotation");case"number":return this.finishNode(r,"NumberTypeAnnotation");case"string":return this.finishNode(r,"StringTypeAnnotation");default:return this.flowParseGenericType(e,t,n)}},re.flowParsePrimaryType=function(){var e=this.state.start,t=this.state.startLoc,r=this.startNode(),n=void 0,i=void 0,s=!1,a=this.state.noAnonFunctionType;switch(this.state.type){case T.name:return this.flowIdentToTypeAnnotation(e,t,r,this.parseIdentifier());case T.braceL:return this.flowParseObjectType(!1,!1,!0);case T.braceBarL:return this.flowParseObjectType(!1,!0,!0);case T.bracketL:return this.flowParseTupleType();case T.relational:if("<"===this.state.value)return r.typeParameters=this.flowParseTypeParameterDeclaration(),this.expect(T.parenL),n=this.flowParseFunctionTypeParams(),r.params=n.params,r.rest=n.rest,this.expect(T.parenR),this.expect(T.arrow),r.returnType=this.flowParseType(),this.finishNode(r,"FunctionTypeAnnotation");break;case T.parenL:if(this.next(),!this.match(T.parenR)&&!this.match(T.ellipsis))if(this.match(T.name)){var o=this.lookahead().type;s=o!==T.question&&o!==T.colon}else s=!0;if(s){if(this.state.noAnonFunctionType=!1,i=this.flowParseType(),this.state.noAnonFunctionType=a,this.state.noAnonFunctionType||!(this.match(T.comma)||this.match(T.parenR)&&this.lookahead().type===T.arrow))return this.expect(T.parenR),i;this.eat(T.comma)}return n=i?this.flowParseFunctionTypeParams([this.reinterpretTypeAsFunctionTypeParam(i)]):this.flowParseFunctionTypeParams(),r.params=n.params,r.rest=n.rest,this.expect(T.parenR),this.expect(T.arrow),r.returnType=this.flowParseType(),r.typeParameters=null,this.finishNode(r,"FunctionTypeAnnotation");case T.string:return this.parseLiteral(this.state.value,"StringLiteralTypeAnnotation");case T._true:case T._false:return r.value=this.match(T._true),this.next(),this.finishNode(r,"BooleanLiteralTypeAnnotation");case T.plusMin:if("-"===this.state.value)return this.next(),this.match(T.num)||this.unexpected(null,"Unexpected token, expected number"),this.parseLiteral(-this.state.value,"NumericLiteralTypeAnnotation",r.start,r.loc.start);this.unexpected();case T.num:return this.parseLiteral(this.state.value,"NumericLiteralTypeAnnotation");case T._null:return r.value=this.match(T._null),this.next(),this.finishNode(r,"NullLiteralTypeAnnotation");case T._this:return r.value=this.match(T._this),this.next(),this.finishNode(r,"ThisTypeAnnotation");case T.star:return this.next(),this.finishNode(r,"ExistentialTypeParam");default:if("typeof"===this.state.type.keyword)return this.flowParseTypeofType()}this.unexpected()},re.flowParsePostfixType=function(){for(var e=this.state.start,t=this.state.startLoc,r=this.flowParsePrimaryType();!this.canInsertSemicolon()&&this.match(T.bracketL);){var n=this.startNodeAt(e,t);n.elementType=r,this.expect(T.bracketL),this.expect(T.bracketR),r=this.finishNode(n,"ArrayTypeAnnotation")}return r},re.flowParsePrefixType=function(){var e=this.startNode();return this.eat(T.question)?(e.typeAnnotation=this.flowParsePrefixType(),this.finishNode(e,"NullableTypeAnnotation")):this.flowParsePostfixType()},re.flowParseAnonFunctionWithoutParens=function(){var e=this.flowParsePrefixType();if(!this.state.noAnonFunctionType&&this.eat(T.arrow)){var t=this.startNodeAt(e.start,e.loc.start);return t.params=[this.reinterpretTypeAsFunctionTypeParam(e)],t.rest=null,t.returnType=this.flowParseType(),t.typeParameters=null,this.finishNode(t,"FunctionTypeAnnotation")}return e},re.flowParseIntersectionType=function(){var e=this.startNode();this.eat(T.bitwiseAND);var t=this.flowParseAnonFunctionWithoutParens();for(e.types=[t];this.eat(T.bitwiseAND);)e.types.push(this.flowParseAnonFunctionWithoutParens());return 1===e.types.length?t:this.finishNode(e,"IntersectionTypeAnnotation")},re.flowParseUnionType=function(){var e=this.startNode();this.eat(T.bitwiseOR);var t=this.flowParseIntersectionType();for(e.types=[t];this.eat(T.bitwiseOR);)e.types.push(this.flowParseIntersectionType());return 1===e.types.length?t:this.finishNode(e,"UnionTypeAnnotation")},re.flowParseType=function(){var e=this.state.inType;this.state.inType=!0;var t=this.flowParseUnionType();return this.state.inType=e,t},re.flowParseTypeAnnotation=function(){var e=this.startNode();return e.typeAnnotation=this.flowParseTypeInitialiser(),this.finishNode(e,"TypeAnnotation")},re.flowParseTypeAndPredicateAnnotation=function(){var e=this.startNode(),t=this.flowParseTypeAndPredicateInitialiser();return e.typeAnnotation=t[0],e.predicate=t[1],this.finishNode(e,"TypeAnnotation")},re.flowParseTypeAnnotatableIdentifier=function(){var e=this.flowParseRestrictedIdentifier();return this.match(T.colon)&&(e.typeAnnotation=this.flowParseTypeAnnotation(),this.finishNode(e,e.type)),e},re.typeCastToParameter=function(e){return e.expression.typeAnnotation=e.typeAnnotation,this.finishNodeAt(e.expression,e.expression.type,e.typeAnnotation.end,e.typeAnnotation.loc.end)},re.flowParseVariance=function(){var e=null;return this.match(T.plusMin)&&("+"===this.state.value?e="plus":"-"===this.state.value&&(e="minus"),this.next()),e};var ne=String.fromCodePoint;if(!ne){var ie=String.fromCharCode,se=Math.floor;ne=function(){var e=[],t=void 0,r=void 0,n=-1,i=arguments.length;if(!i)return"";for(var s="";++n1114111||se(a)!=a)throw RangeError("Invalid code point: "+a);a<=65535?e.push(a):(t=55296+((a-=65536)>>10),r=a%1024+56320,e.push(t,r)),(n+1==i||e.length>16384)&&(s+=ie.apply(null,e),e.length=0)}return s}}var ae=ne,oe={quot:'"',amp:"&",apos:"'",lt:"<",gt:">",nbsp:" ",iexcl:"¡",cent:"¢",pound:"£",curren:"¤",yen:"¥",brvbar:"¦",sect:"§",uml:"¨",copy:"©",ordf:"ª",laquo:"«",not:"¬",shy:"­",reg:"®",macr:"¯",deg:"°",plusmn:"±",sup2:"²",sup3:"³",acute:"´",micro:"µ",para:"¶",middot:"·",cedil:"¸",sup1:"¹",ordm:"º",raquo:"»",frac14:"¼",frac12:"½",frac34:"¾",iquest:"¿",Agrave:"À",Aacute:"Á",Acirc:"Â",Atilde:"Ã",Auml:"Ä",Aring:"Å",AElig:"Æ",Ccedil:"Ç",Egrave:"È",Eacute:"É",Ecirc:"Ê",Euml:"Ë",Igrave:"Ì",Iacute:"Í",Icirc:"Î",Iuml:"Ï",ETH:"Ð",Ntilde:"Ñ",Ograve:"Ò",Oacute:"Ó",Ocirc:"Ô",Otilde:"Õ",Ouml:"Ö",times:"×",Oslash:"Ø",Ugrave:"Ù",Uacute:"Ú",Ucirc:"Û",Uuml:"Ü",Yacute:"Ý",THORN:"Þ",szlig:"ß",agrave:"à",aacute:"á",acirc:"â",atilde:"ã",auml:"ä",aring:"å",aelig:"æ",ccedil:"ç",egrave:"è",eacute:"é",ecirc:"ê",euml:"ë",igrave:"ì",iacute:"í",icirc:"î",iuml:"ï",eth:"ð",ntilde:"ñ",ograve:"ò",oacute:"ó",ocirc:"ô",otilde:"õ",ouml:"ö",divide:"÷",oslash:"ø",ugrave:"ù",uacute:"ú",ucirc:"û",uuml:"ü",yacute:"ý",thorn:"þ",yuml:"ÿ",OElig:"Œ",oelig:"œ",Scaron:"Š",scaron:"š",Yuml:"Ÿ",fnof:"ƒ",circ:"ˆ",tilde:"˜",Alpha:"Α",Beta:"Β",Gamma:"Γ",Delta:"Δ",Epsilon:"Ε",Zeta:"Ζ",Eta:"Η",Theta:"Θ",Iota:"Ι",Kappa:"Κ",Lambda:"Λ",Mu:"Μ",Nu:"Ν",Xi:"Ξ",Omicron:"Ο",Pi:"Π",Rho:"Ρ",Sigma:"Σ",Tau:"Τ",Upsilon:"Υ",Phi:"Φ",Chi:"Χ",Psi:"Ψ",Omega:"Ω",alpha:"α",beta:"β",gamma:"γ",delta:"δ",epsilon:"ε",zeta:"ζ",eta:"η",theta:"θ",iota:"ι",kappa:"κ",lambda:"λ",mu:"μ",nu:"ν",xi:"ξ",omicron:"ο",pi:"π",rho:"ρ",sigmaf:"ς",sigma:"σ",tau:"τ",upsilon:"υ",phi:"φ",chi:"χ",psi:"ψ",omega:"ω",thetasym:"ϑ",upsih:"ϒ",piv:"ϖ",ensp:" ",emsp:" ",thinsp:" ",zwnj:"‌",zwj:"‍",lrm:"‎",rlm:"‏",ndash:"–",mdash:"—",lsquo:"‘",rsquo:"’",sbquo:"‚",ldquo:"“",rdquo:"”",bdquo:"„",dagger:"†",Dagger:"‡",bull:"•",hellip:"…",permil:"‰",prime:"′",Prime:"″",lsaquo:"‹",rsaquo:"›",oline:"‾",frasl:"⁄",euro:"€",image:"ℑ",weierp:"℘",real:"ℜ",trade:"™",alefsym:"ℵ",larr:"←",uarr:"↑",rarr:"→",darr:"↓",harr:"↔",crarr:"↵",lArr:"⇐",uArr:"⇑",rArr:"⇒",dArr:"⇓",hArr:"⇔",forall:"∀",part:"∂",exist:"∃",empty:"∅",nabla:"∇",isin:"∈",notin:"∉",ni:"∋",prod:"∏",sum:"∑",minus:"−",lowast:"∗",radic:"√",prop:"∝",infin:"∞",ang:"∠",and:"∧",or:"∨",cap:"∩",cup:"∪",int:"∫",there4:"∴",sim:"∼",cong:"≅",asymp:"≈",ne:"≠",equiv:"≡",le:"≤",ge:"≥",sub:"⊂",sup:"⊃",nsub:"⊄",sube:"⊆",supe:"⊇",oplus:"⊕",otimes:"⊗",perp:"⊥",sdot:"⋅",lceil:"⌈",rceil:"⌉",lfloor:"⌊",rfloor:"⌋",lang:"〈",rang:"〉",loz:"◊",spades:"♠",clubs:"♣",hearts:"♥",diams:"♦"},ue=/^[\da-fA-F]+$/,le=/^\d+$/;I.j_oTag=new j("...
    ",!0,!0),T.jsxName=new w("jsxName"),T.jsxText=new w("jsxText",{beforeExpr:!0}),T.jsxTagStart=new w("jsxTagStart",{startsExpr:!0}),T.jsxTagEnd=new w("jsxTagEnd"),T.jsxTagStart.updateContext=function(){this.state.context.push(I.j_expr),this.state.context.push(I.j_oTag),this.state.exprAllowed=!1},T.jsxTagEnd.updateContext=function(e){var t=this.state.context.pop();t===I.j_oTag&&e===T.slash||t===I.j_cTag?(this.state.context.pop(),this.state.exprAllowed=this.curContext()===I.j_expr):this.state.exprAllowed=!0};var ce=q.prototype;ce.jsxReadToken=function(){for(var e="",t=this.state.pos;;){this.state.pos>=this.input.length&&this.raise(this.state.start,"Unterminated JSX contents");var r=this.input.charCodeAt(this.state.pos);switch(r){case 60:case 123:return this.state.pos===this.state.start?60===r&&this.state.exprAllowed?(++this.state.pos,this.finishToken(T.jsxTagStart)):this.getTokenFromCode(r):(e+=this.input.slice(t,this.state.pos),this.finishToken(T.jsxText,e));case 38:e+=this.input.slice(t,this.state.pos),e+=this.jsxReadEntity(),t=this.state.pos;break;default:o(r)?(e+=this.input.slice(t,this.state.pos),e+=this.jsxReadNewLine(!0),t=this.state.pos):++this.state.pos}}},ce.jsxReadNewLine=function(e){var t=this.input.charCodeAt(this.state.pos),r=void 0;return++this.state.pos,13===t&&10===this.input.charCodeAt(this.state.pos)?(++this.state.pos,r=e?"\n":"\r\n"):r=String.fromCharCode(t),++this.state.curLine,this.state.lineStart=this.state.pos,r},ce.jsxReadString=function(e){for(var t="",r=++this.state.pos;;){this.state.pos>=this.input.length&&this.raise(this.state.start,"Unterminated string constant");var n=this.input.charCodeAt(this.state.pos);if(n===e)break;38===n?(t+=this.input.slice(r,this.state.pos),t+=this.jsxReadEntity(),r=this.state.pos):o(n)?(t+=this.input.slice(r,this.state.pos),t+=this.jsxReadNewLine(!1),r=this.state.pos):++this.state.pos}return t+=this.input.slice(r,this.state.pos++),this.finishToken(T.string,t)},ce.jsxReadEntity=function(){for(var e="",t=0,r=void 0,n=this.input[this.state.pos],i=++this.state.pos;this.state.pos")}return r.openingElement=i,r.closingElement=s,r.children=n,this.match(T.relational)&&"<"===this.state.value&&this.raise(this.state.start,"Adjacent JSX elements must be wrapped in an enclosing tag"),this.finishNode(r,"JSXElement")},ce.jsxParseElement=function(){var e=this.state.start,t=this.state.startLoc;return this.next(),this.jsxParseElementAt(e,t)};V.estree=function(e){e.extend("checkDeclaration",function(e){return function(t){p(t)?this.checkDeclaration(t.value):e.call(this,t)}}),e.extend("checkGetterSetterParamCount",function(){return function(e){var t="get"===e.kind?0:1;if(e.value.params.length!==t){var r=e.start;"get"===e.kind?this.raise(r,"getter should have no params"):this.raise(r,"setter should have exactly one param")}}}),e.extend("checkLVal",function(e){return function(t,r,n){var i=this;switch(t.type){case"ObjectPattern":t.properties.forEach(function(e){i.checkLVal("Property"===e.type?e.value:e,r,n,"object destructuring pattern")});break;default:for(var s=arguments.length,a=Array(s>3?s-3:0),o=3;o0){var r=e.body.body,n=Array.isArray(r),i=0;for(r=n?r:r[Symbol.iterator]();;){var s;if(n){if(i>=r.length)break;s=r[i++]}else{if((i=r.next()).done)break;s=i.value}var a=s;if("ExpressionStatement"!==a.type||"Literal"!==a.expression.type)break;if("use strict"===a.expression.value)return!0}}return!1}}),e.extend("isValidDirective",function(){return function(e){return!("ExpressionStatement"!==e.type||"Literal"!==e.expression.type||"string"!=typeof e.expression.value||e.expression.extra&&e.expression.extra.parenthesized)}}),e.extend("stmtToDirective",function(e){return function(t){var r=e.call(this,t),n=t.expression.value;return r.value.value=n,r}}),e.extend("parseBlockBody",function(e){return function(t){for(var r=this,n=arguments.length,i=Array(n>1?n-1:0),s=1;s1?n-1:0),s=1;s2?n-2:0),s=2;s=a.length)break;l=a[u++]}else{if((u=a.next()).done)break;l=u.value}var c=l;"get"===c.kind||"set"===c.kind?this.raise(c.key.start,"Object pattern can't contain getter or setter"):c.method?this.raise(c.key.start,"Object pattern can't contain methods"):this.toAssignable(c,r,"object destructuring pattern")}return t}return e.call.apply(e,[this,t,r].concat(i))}})},V.flow=function(e){e.extend("parseFunctionBody",function(e){return function(t,r){return this.match(T.colon)&&!r&&(t.returnType=this.flowParseTypeAndPredicateAnnotation()),e.call(this,t,r)}}),e.extend("parseStatement",function(e){return function(t,r){if(this.state.strict&&this.match(T.name)&&"interface"===this.state.value){var n=this.startNode();return this.next(),this.flowParseInterface(n)}return e.call(this,t,r)}}),e.extend("parseExpressionStatement",function(e){return function(t,r){if("Identifier"===r.type)if("declare"===r.name){if(this.match(T._class)||this.match(T.name)||this.match(T._function)||this.match(T._var)||this.match(T._export))return this.flowParseDeclare(t)}else if(this.match(T.name)){if("interface"===r.name)return this.flowParseInterface(t);if("type"===r.name)return this.flowParseTypeAlias(t);if("opaque"===r.name)return this.flowParseOpaqueType(t,!1)}return e.call(this,t,r)}}),e.extend("shouldParseExportDeclaration",function(e){return function(){return this.isContextual("type")||this.isContextual("interface")||this.isContextual("opaque")||e.call(this)}}),e.extend("isExportDefaultSpecifier",function(e){return function(){return(!this.match(T.name)||"type"!==this.state.value&&"interface"!==this.state.value&&"opaque"!==this.state.value)&&e.call(this)}}),e.extend("parseConditional",function(e){return function(t,r,n,i,s){if(s&&this.match(T.question)){var a=this.state.clone();try{return e.call(this,t,r,n,i)}catch(e){if(e instanceof SyntaxError)return this.state=a,s.start=e.pos||this.state.start,t;throw e}}return e.call(this,t,r,n,i)}}),e.extend("parseParenItem",function(e){return function(t,r,n){if(t=e.call(this,t,r,n),this.eat(T.question)&&(t.optional=!0),this.match(T.colon)){var i=this.startNodeAt(r,n);return i.expression=t,i.typeAnnotation=this.flowParseTypeAnnotation(),this.finishNode(i,"TypeCastExpression")}return t}}),e.extend("parseExport",function(e){return function(t){return"ExportNamedDeclaration"===(t=e.call(this,t)).type&&(t.exportKind=t.exportKind||"value"),t}}),e.extend("parseExportDeclaration",function(e){return function(t){if(this.isContextual("type")){t.exportKind="type";var r=this.startNode();return this.next(),this.match(T.braceL)?(t.specifiers=this.parseExportSpecifiers(),this.parseExportFrom(t),null):this.flowParseTypeAlias(r)}if(this.isContextual("opaque")){t.exportKind="type";var n=this.startNode();return this.next(),this.flowParseOpaqueType(n,!1)}if(this.isContextual("interface")){t.exportKind="type";var i=this.startNode();return this.next(),this.flowParseInterface(i)}return e.call(this,t)}}),e.extend("parseClassId",function(e){return function(t){e.apply(this,arguments),this.isRelational("<")&&(t.typeParameters=this.flowParseTypeParameterDeclaration())}}),e.extend("isKeyword",function(e){return function(t){return(!this.state.inType||"void"!==t)&&e.call(this,t)}}),e.extend("readToken",function(e){return function(t){return!this.state.inType||62!==t&&60!==t?e.call(this,t):this.finishOp(T.relational,1)}}),e.extend("jsx_readToken",function(e){return function(){if(!this.state.inType)return e.call(this)}}),e.extend("toAssignable",function(e){return function(t,r,n){return"TypeCastExpression"===t.type?e.call(this,this.typeCastToParameter(t),r,n):e.call(this,t,r,n)}}),e.extend("toAssignableList",function(e){return function(t,r,n){for(var i=0;i2?n-2:0),s=2;s=0&&l>0){for(n=[],s=r.length;c>=0&&!o;)c==u?(n.push(c),u=r.indexOf(e,c+1)):1==n.length?o=[n.pop(),l]:((i=n.pop())=0?u:l;n.length&&(o=[s,a])}return o}t.exports=n,n.range=s},{}],190:[function(e,t,r){"use strict";function n(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");return"="===e[t-2]?2:"="===e[t-1]?1:0}function i(e){return a[e>>18&63]+a[e>>12&63]+a[e>>6&63]+a[63&e]}function s(e,t,r){for(var n,s=[],a=t;a0?l-4:l;var c=0;for(t=0;t>16&255,a[c++]=i>>8&255,a[c++]=255&i;return 2===s?(i=o[e.charCodeAt(t)]<<2|o[e.charCodeAt(t+1)]>>4,a[c++]=255&i):1===s&&(i=o[e.charCodeAt(t)]<<10|o[e.charCodeAt(t+1)]<<4|o[e.charCodeAt(t+2)]>>2,a[c++]=i>>8&255,a[c++]=255&i),a},r.fromByteArray=function(e){for(var t,r=e.length,n=r%3,i="",o=[],u=0,l=r-n;ul?l:u+16383));return 1===n?(t=e[r-1],i+=a[t>>2],i+=a[t<<4&63],i+="=="):2===n&&(t=(e[r-2]<<8)+e[r-1],i+=a[t>>10],i+=a[t>>4&63],i+=a[t<<2&63],i+="="),o.push(i),o.join("")};for(var a=[],o=[],u="undefined"!=typeof Uint8Array?Uint8Array:Array,l="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",c=0,p=l.length;c=t}function c(e,t){var r=[],i=h("{","}",e);if(!i||/\$$/.test(i.pre))return[e];var f=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(i.body),d=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(i.body),y=f||d,g=i.body.indexOf(",")>=0;if(!y&&!g)return i.post.match(/,.*\}/)?(e=i.pre+"{"+i.body+m+i.post,c(e)):[e];var b;if(y)b=i.body.split(/\.\./);else if(1===(b=s(i.body)).length&&1===(b=c(b[0],!1).map(a)).length){return(E=i.post.length?c(i.post,!1):[""]).map(function(e){return i.pre+b[0]+e})}var v,x=i.pre,E=i.post.length?c(i.post,!1):[""];if(y){var A=n(b[0]),D=n(b[1]),S=Math.max(b[0].length,b[1].length),C=3==b.length?Math.abs(n(b[2])):1,_=u;D0){var P=new Array(T+1).join("0");F=k<0?"-"+P+F.slice(1):P+F}}v.push(F)}}else v=p(b,function(e){return c(e,!1)});for(var B=0;Bj)throw new RangeError("Invalid typed array length");var t=new Uint8Array(e);return t.__proto__=i.prototype,t}function i(e,t,r){if("number"==typeof e){if("string"==typeof t)throw new Error("If encoding is specified then the first argument must be a string");return o(e)}return s(e,t,r)}function s(e,t,r){if("number"==typeof e)throw new TypeError('"value" argument must not be a number');return T(e)?function(e,t,r){if(t<0||e.byteLength=j)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+j.toString(16)+" bytes");return 0|e}function c(e,t){if(i.isBuffer(e))return e.length;if(P(e)||T(e))return e.byteLength;"string"!=typeof e&&(e=""+e);var r=e.length;if(0===r)return 0;for(var n=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return w(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return k(e).length;default:if(n)return w(e).length;t=(""+t).toLowerCase(),n=!0}}function p(e,t,r){var n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if(r>>>=0,t>>>=0,r<=t)return"";for(e||(e="utf8");;)switch(e){case"hex":return function(e,t,r){var n=e.length;(!t||t<0)&&(t=0);(!r||r<0||r>n)&&(r=n);for(var i="",s=t;s2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,B(r)&&(r=s?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(s)return-1;r=e.length-1}else if(r<0){if(!s)return-1;r=0}if("string"==typeof t&&(t=i.from(t,n)),i.isBuffer(t))return 0===t.length?-1:d(e,t,r,n,s);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?s?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):d(e,[t],r,n,s);throw new TypeError("val must be string, number or Buffer")}function d(e,t,r,n,i){function s(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}var a=1,o=e.length,u=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;a=2,o/=2,u/=2,r/=2}var l;if(i){var c=-1;for(l=r;lo&&(r=o-u),l=r;l>=0;l--){for(var p=!0,h=0;hi&&(n=i):n=i;var s=t.length;if(s%2!=0)throw new TypeError("Invalid hex string");n>s/2&&(n=s/2);for(var a=0;a>8,i=r%256,s.push(i),s.push(n);return s}(t,e.length-r),e,r,n)}function E(e,t,r){r=Math.min(e.length,r);for(var n=[],i=t;i239?4:s>223?3:s>191?2:1;if(i+o<=r){var u,l,c,p;switch(o){case 1:s<128&&(a=s);break;case 2:128==(192&(u=e[i+1]))&&(p=(31&s)<<6|63&u)>127&&(a=p);break;case 3:u=e[i+1],l=e[i+2],128==(192&u)&&128==(192&l)&&(p=(15&s)<<12|(63&u)<<6|63&l)>2047&&(p<55296||p>57343)&&(a=p);break;case 4:u=e[i+1],l=e[i+2],c=e[i+3],128==(192&u)&&128==(192&l)&&128==(192&c)&&(p=(15&s)<<18|(63&u)<<12|(63&l)<<6|63&c)>65535&&p<1114112&&(a=p)}}null===a?(a=65533,o=1):a>65535&&(a-=65536,n.push(a>>>10&1023|55296),a=56320|1023&a),n.push(a),i+=o}return function(e){var t=e.length;if(t<=I)return String.fromCharCode.apply(String,e);var r="",n=0;for(;nr)throw new RangeError("Trying to access beyond buffer length")}function D(e,t,r,n,s,a){if(!i.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>s||te.length)throw new RangeError("Index out of range")}function S(e,t,r,n,i,s){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function C(e,t,r,n,i){return t=+t,r>>>=0,i||S(e,0,r,4),N.write(e,t,r,n,23,4),r+4}function _(e,t,r,n,i){return t=+t,r>>>=0,i||S(e,0,r,8),N.write(e,t,r,n,52,8),r+8}function w(e,t){t=t||1/0;for(var r,n=e.length,i=null,s=[],a=0;a55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&s.push(239,191,189);continue}if(a+1===n){(t-=3)>-1&&s.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&s.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(t-=3)>-1&&s.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;s.push(r)}else if(r<2048){if((t-=2)<0)break;s.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;s.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;s.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return s}function k(e){return O.toByteArray(function(e){if((e=e.trim().replace(L,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function F(e,t,r,n){for(var i=0;i=t.length||i>=e.length);++i)t[i+r]=e[i];return i}function T(e){return e instanceof ArrayBuffer||null!=e&&null!=e.constructor&&"ArrayBuffer"===e.constructor.name&&"number"==typeof e.byteLength}function P(e){return"function"==typeof ArrayBuffer.isView&&ArrayBuffer.isView(e)}function B(e){return e!=e}var O=e("base64-js"),N=e("ieee754");r.Buffer=i,r.SlowBuffer=function(e){return+e!=e&&(e=0),i.alloc(+e)},r.INSPECT_MAX_BYTES=50;var j=2147483647;r.kMaxLength=j,(i.TYPED_ARRAY_SUPPORT=function(){try{var e=new Uint8Array(1);return e.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===e.foo()}catch(e){return!1}}())||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),"undefined"!=typeof Symbol&&Symbol.species&&i[Symbol.species]===i&&Object.defineProperty(i,Symbol.species,{value:null,configurable:!0,enumerable:!1,writable:!1}),i.poolSize=8192,i.from=function(e,t,r){return s(e,t,r)},i.prototype.__proto__=Uint8Array.prototype,i.__proto__=Uint8Array,i.alloc=function(e,t,r){return function(e,t,r){return a(e),e<=0?n(e):void 0!==t?"string"==typeof r?n(e).fill(t,r):n(e).fill(t):n(e)}(e,t,r)},i.allocUnsafe=function(e){return o(e)},i.allocUnsafeSlow=function(e){return o(e)},i.isBuffer=function(e){return null!=e&&!0===e._isBuffer},i.compare=function(e,t){if(!i.isBuffer(e)||!i.isBuffer(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var r=e.length,n=t.length,s=0,a=Math.min(r,n);s0&&(e=this.toString("hex",0,t).match(/.{2}/g).join(" "),this.length>t&&(e+=" ... ")),""},i.prototype.compare=function(e,t,r,n,s){if(!i.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===s&&(s=this.length),t<0||r>e.length||n<0||s>this.length)throw new RangeError("out of range index");if(n>=s&&t>=r)return 0;if(n>=s)return-1;if(t>=r)return 1;if(t>>>=0,r>>>=0,n>>>=0,s>>>=0,this===e)return 0;for(var a=s-n,o=r-t,u=Math.min(a,o),l=this.slice(n,s),c=e.slice(t,r),p=0;p>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var i=this.length-t;if((void 0===r||r>i)&&(r=i),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var s=!1;;)switch(n){case"hex":return m(this,e,t,r);case"utf8":case"utf-8":return y(this,e,t,r);case"ascii":return g(this,e,t,r);case"latin1":case"binary":return b(this,e,t,r);case"base64":return v(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return x(this,e,t,r);default:if(s)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),s=!0}},i.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var I=4096;i.prototype.slice=function(e,t){var r=this.length;e=~~e,t=void 0===t?r:~~t,e<0?(e+=r)<0&&(e=0):e>r&&(e=r),t<0?(t+=r)<0&&(t=0):t>r&&(t=r),t>>=0,t>>>=0,r||A(e,t,this.length);for(var n=this[e],i=1,s=0;++s>>=0,t>>>=0,r||A(e,t,this.length);for(var n=this[e+--t],i=1;t>0&&(i*=256);)n+=this[e+--t]*i;return n},i.prototype.readUInt8=function(e,t){return e>>>=0,t||A(e,1,this.length),this[e]},i.prototype.readUInt16LE=function(e,t){return e>>>=0,t||A(e,2,this.length),this[e]|this[e+1]<<8},i.prototype.readUInt16BE=function(e,t){return e>>>=0,t||A(e,2,this.length),this[e]<<8|this[e+1]},i.prototype.readUInt32LE=function(e,t){return e>>>=0,t||A(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},i.prototype.readUInt32BE=function(e,t){return e>>>=0,t||A(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},i.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||A(e,t,this.length);for(var n=this[e],i=1,s=0;++s=i&&(n-=Math.pow(2,8*t)),n},i.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||A(e,t,this.length);for(var n=t,i=1,s=this[e+--n];n>0&&(i*=256);)s+=this[e+--n]*i;return i*=128,s>=i&&(s-=Math.pow(2,8*t)),s},i.prototype.readInt8=function(e,t){return e>>>=0,t||A(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},i.prototype.readInt16LE=function(e,t){e>>>=0,t||A(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},i.prototype.readInt16BE=function(e,t){e>>>=0,t||A(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},i.prototype.readInt32LE=function(e,t){return e>>>=0,t||A(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},i.prototype.readInt32BE=function(e,t){return e>>>=0,t||A(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},i.prototype.readFloatLE=function(e,t){return e>>>=0,t||A(e,4,this.length),N.read(this,e,!0,23,4)},i.prototype.readFloatBE=function(e,t){return e>>>=0,t||A(e,4,this.length),N.read(this,e,!1,23,4)},i.prototype.readDoubleLE=function(e,t){return e>>>=0,t||A(e,8,this.length),N.read(this,e,!0,52,8)},i.prototype.readDoubleBE=function(e,t){return e>>>=0,t||A(e,8,this.length),N.read(this,e,!1,52,8)},i.prototype.writeUIntLE=function(e,t,r,n){if(e=+e,t>>>=0,r>>>=0,!n){D(this,e,t,r,Math.pow(2,8*r)-1,0)}var i=1,s=0;for(this[t]=255&e;++s>>=0,r>>>=0,!n){D(this,e,t,r,Math.pow(2,8*r)-1,0)}var i=r-1,s=1;for(this[t+i]=255&e;--i>=0&&(s*=256);)this[t+i]=e/s&255;return t+r},i.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||D(this,e,t,1,255,0),this[t]=255&e,t+1},i.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||D(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},i.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||D(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},i.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||D(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},i.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||D(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},i.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t>>>=0,!n){var i=Math.pow(2,8*r-1);D(this,e,t,r,i-1,-i)}var s=0,a=1,o=0;for(this[t]=255&e;++s>0)-o&255;return t+r},i.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t>>>=0,!n){var i=Math.pow(2,8*r-1);D(this,e,t,r,i-1,-i)}var s=r-1,a=1,o=0;for(this[t+s]=255&e;--s>=0&&(a*=256);)e<0&&0===o&&0!==this[t+s+1]&&(o=1),this[t+s]=(e/a>>0)-o&255;return t+r},i.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||D(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},i.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||D(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},i.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||D(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},i.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||D(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},i.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||D(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},i.prototype.writeFloatLE=function(e,t,r){return C(this,e,t,!0,r)},i.prototype.writeFloatBE=function(e,t,r){return C(this,e,t,!1,r)},i.prototype.writeDoubleLE=function(e,t,r){return _(this,e,t,!0,r)},i.prototype.writeDoubleBE=function(e,t,r){return _(this,e,t,!1,r)},i.prototype.copy=function(e,t,r,n){if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t=0;--i)e[i+t]=this[i+r];else if(s<1e3)for(i=0;i>>=0,r=void 0===r?this.length:r>>>0,e||(e=0);var a;if("number"==typeof e)for(a=t;ac;)if((o=u[c++])!=o)return!0}else for(;l>c;c++)if((e||c in u)&&u[c]===r)return e||c||0;return!e&&-1}}},{"./_to-absolute-index":275,"./_to-iobject":277,"./_to-length":278}],216:[function(e,t,r){var n=e("./_ctx"),i=e("./_iobject"),s=e("./_to-object"),a=e("./_to-length"),o=e("./_array-species-create");t.exports=function(e,t){var r=1==e,u=2==e,l=3==e,c=4==e,p=6==e,h=5==e||p,f=t||o;return function(t,o,d){for(var m,y,g=s(t),b=i(g),v=n(o,d,3),x=a(b.length),E=0,A=r?f(t,x):u?f(t,0):void 0;x>E;E++)if((h||E in b)&&(m=b[E],y=v(m,E,g),e))if(r)A[E]=y;else if(y)switch(e){case 3:return!0;case 5:return m;case 6:return E;case 2:A.push(m)}else if(c)return!1;return p?-1:l||c?c:A}}},{"./_array-species-create":218,"./_ctx":226,"./_iobject":240,"./_to-length":278,"./_to-object":279}],217:[function(e,t,r){var n=e("./_is-object"),i=e("./_is-array"),s=e("./_wks")("species");t.exports=function(e){var t;return i(e)&&("function"!=typeof(t=e.constructor)||t!==Array&&!i(t.prototype)||(t=void 0),n(t)&&null===(t=t[s])&&(t=void 0)),void 0===t?Array:t}},{"./_is-array":242,"./_is-object":243,"./_wks":285}],218:[function(e,t,r){var n=e("./_array-species-constructor");t.exports=function(e,t){return new(n(e))(t)}},{"./_array-species-constructor":217}],219:[function(e,t,r){var n=e("./_cof"),i=e("./_wks")("toStringTag"),s="Arguments"==n(function(){return arguments}());t.exports=function(e){var t,r,a;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(r=function(e,t){try{return e[t]}catch(e){}}(t=Object(e),i))?r:s?n(t):"Object"==(a=n(t))&&"function"==typeof t.callee?"Arguments":a}},{"./_cof":220,"./_wks":285}],220:[function(e,t,r){var n={}.toString;t.exports=function(e){return n.call(e).slice(8,-1)}},{}],221:[function(e,t,r){"use strict";var n=e("./_object-dp").f,i=e("./_object-create"),s=e("./_redefine-all"),a=e("./_ctx"),o=e("./_an-instance"),u=e("./_for-of"),l=e("./_iter-define"),c=e("./_iter-step"),p=e("./_set-species"),h=e("./_descriptors"),f=e("./_meta").fastKey,d=e("./_validate-collection"),m=h?"_s":"size",y=function(e,t){var r,n=f(t);if("F"!==n)return e._i[n];for(r=e._f;r;r=r.n)if(r.k==t)return r};t.exports={getConstructor:function(e,t,r,l){var c=e(function(e,n){o(e,c,t,"_i"),e._t=t,e._i=i(null),e._f=void 0,e._l=void 0,e[m]=0,void 0!=n&&u(n,r,e[l],e)});return s(c.prototype,{clear:function(){for(var e=d(this,t),r=e._i,n=e._f;n;n=n.n)n.r=!0,n.p&&(n.p=n.p.n=void 0),delete r[n.i];e._f=e._l=void 0,e[m]=0},delete:function(e){var r=d(this,t),n=y(r,e);if(n){var i=n.n,s=n.p;delete r._i[n.i],n.r=!0,s&&(s.n=i),i&&(i.p=s),r._f==n&&(r._f=i),r._l==n&&(r._l=s),r[m]--}return!!n},forEach:function(e){d(this,t);for(var r,n=a(e,arguments.length>1?arguments[1]:void 0,3);r=r?r.n:this._f;)for(n(r.v,r.k,this);r&&r.r;)r=r.p},has:function(e){return!!y(d(this,t),e)}}),h&&n(c.prototype,"size",{get:function(){return d(this,t)[m]}}),c},def:function(e,t,r){var n,i,s=y(e,t);return s?s.v=r:(e._l=s={i:i=f(t,!0),k:t,v:r,p:n=e._l,n:void 0,r:!1},e._f||(e._f=s),n&&(n.n=s),e[m]++,"F"!==i&&(e._i[i]=s)),e},getEntry:y,setStrong:function(e,t,r){l(e,t,function(e,r){this._t=d(e,t),this._k=r,this._l=void 0},function(){for(var e=this._k,t=this._l;t&&t.r;)t=t.p;return this._t&&(this._l=t=t?t.n:this._t._f)?c(0,"keys"==e?t.k:"values"==e?t.v:[t.k,t.v]):(this._t=void 0,c(1))},r?"entries":"values",!r,!0),p(t)}}},{"./_an-instance":212,"./_ctx":226,"./_descriptors":228,"./_for-of":234,"./_iter-define":246,"./_iter-step":247,"./_meta":250,"./_object-create":252,"./_object-dp":253,"./_redefine-all":265,"./_set-species":270,"./_validate-collection":282}],222:[function(e,t,r){var n=e("./_classof"),i=e("./_array-from-iterable");t.exports=function(e){return function(){if(n(this)!=e)throw TypeError(e+"#toJSON isn't generic");return i(this)}}},{"./_array-from-iterable":214,"./_classof":219}],223:[function(e,t,r){"use strict";var n=e("./_redefine-all"),i=e("./_meta").getWeak,s=e("./_an-object"),a=e("./_is-object"),o=e("./_an-instance"),u=e("./_for-of"),l=e("./_array-methods"),c=e("./_has"),p=e("./_validate-collection"),h=l(5),f=l(6),d=0,m=function(e){return e._l||(e._l=new y)},y=function(){this.a=[]},g=function(e,t){return h(e.a,function(e){return e[0]===t})};y.prototype={get:function(e){var t=g(this,e);if(t)return t[1]},has:function(e){return!!g(this,e)},set:function(e,t){var r=g(this,e);r?r[1]=t:this.a.push([e,t])},delete:function(e){var t=f(this.a,function(t){return t[0]===e});return~t&&this.a.splice(t,1),!!~t}},t.exports={getConstructor:function(e,t,r,s){var l=e(function(e,n){o(e,l,t,"_i"),e._t=t,e._i=d++,e._l=void 0,void 0!=n&&u(n,r,e[s],e)});return n(l.prototype,{delete:function(e){if(!a(e))return!1;var r=i(e);return!0===r?m(p(this,t)).delete(e):r&&c(r,this._i)&&delete r[this._i]},has:function(e){if(!a(e))return!1;var r=i(e);return!0===r?m(p(this,t)).has(e):r&&c(r,this._i)}}),l},def:function(e,t,r){var n=i(s(t),!0);return!0===n?m(e).set(t,r):n[e._i]=r,e},ufstore:m}},{"./_an-instance":212,"./_an-object":213,"./_array-methods":216,"./_for-of":234,"./_has":236,"./_is-object":243,"./_meta":250,"./_redefine-all":265,"./_validate-collection":282}],224:[function(e,t,r){"use strict";var n=e("./_global"),i=e("./_export"),s=e("./_meta"),a=e("./_fails"),o=e("./_hide"),u=e("./_redefine-all"),l=e("./_for-of"),c=e("./_an-instance"),p=e("./_is-object"),h=e("./_set-to-string-tag"),f=e("./_object-dp").f,d=e("./_array-methods")(0),m=e("./_descriptors");t.exports=function(e,t,r,y,g,b){var v=n[e],x=v,E=g?"set":"add",A=x&&x.prototype,D={};return m&&"function"==typeof x&&(b||A.forEach&&!a(function(){(new x).entries().next()}))?(x=t(function(t,r){c(t,x,e,"_c"),t._c=new v,void 0!=r&&l(r,g,t[E],t)}),d("add,clear,delete,forEach,get,has,set,keys,values,entries,toJSON".split(","),function(e){var t="add"==e||"set"==e;e in A&&(!b||"clear"!=e)&&o(x.prototype,e,function(r,n){if(c(this,x,e),!t&&b&&!p(r))return"get"==e&&void 0;var i=this._c[e](0===r?0:r,n);return t?this:i})}),b||f(x.prototype,"size",{get:function(){return this._c.size}})):(x=y.getConstructor(t,e,g,E),u(x.prototype,r),s.NEED=!0),h(x,e),D[e]=x,i(i.G+i.W+i.F,D),b||y.setStrong(x,e,g),x}},{"./_an-instance":212,"./_array-methods":216,"./_descriptors":228,"./_export":232,"./_fails":233,"./_for-of":234,"./_global":235,"./_hide":237,"./_is-object":243,"./_meta":250,"./_object-dp":253,"./_redefine-all":265,"./_set-to-string-tag":271}],225:[function(e,t,r){var n=t.exports={version:"2.5.3"};"number"==typeof __e&&(__e=n)},{}],226:[function(e,t,r){var n=e("./_a-function");t.exports=function(e,t,r){if(n(e),void 0===t)return e;switch(r){case 1:return function(r){return e.call(t,r)};case 2:return function(r,n){return e.call(t,r,n)};case 3:return function(r,n,i){return e.call(t,r,n,i)}}return function(){return e.apply(t,arguments)}}},{"./_a-function":210}],227:[function(e,t,r){t.exports=function(e){if(void 0==e)throw TypeError("Can't call method on "+e);return e}},{}],228:[function(e,t,r){t.exports=!e("./_fails")(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},{"./_fails":233}],229:[function(e,t,r){var n=e("./_is-object"),i=e("./_global").document,s=n(i)&&n(i.createElement);t.exports=function(e){return s?i.createElement(e):{}}},{"./_global":235,"./_is-object":243}],230:[function(e,t,r){t.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},{}],231:[function(e,t,r){var n=e("./_object-keys"),i=e("./_object-gops"),s=e("./_object-pie");t.exports=function(e){var t=n(e),r=i.f;if(r)for(var a,o=r(e),u=s.f,l=0;o.length>l;)u.call(e,a=o[l++])&&t.push(a);return t}},{"./_object-gops":258,"./_object-keys":261,"./_object-pie":262}],232:[function(e,t,r){var n=e("./_global"),i=e("./_core"),s=e("./_ctx"),a=e("./_hide"),o="prototype",u=function(e,t,r){var l,c,p,h=e&u.F,f=e&u.G,d=e&u.S,m=e&u.P,y=e&u.B,g=e&u.W,b=f?i:i[t]||(i[t]={}),v=b[o],x=f?n:d?n[t]:(n[t]||{})[o];f&&(r=t);for(l in r)(c=!h&&x&&void 0!==x[l])&&l in b||(p=c?x[l]:r[l],b[l]=f&&"function"!=typeof x[l]?r[l]:y&&c?s(p,n):g&&x[l]==p?function(e){var t=function(t,r,n){if(this instanceof e){switch(arguments.length){case 0:return new e;case 1:return new e(t);case 2:return new e(t,r)}return new e(t,r,n)}return e.apply(this,arguments)};return t[o]=e[o],t}(p):m&&"function"==typeof p?s(Function.call,p):p,m&&((b.virtual||(b.virtual={}))[l]=p,e&u.R&&v&&!v[l]&&a(v,l,p)))};u.F=1,u.G=2,u.S=4,u.P=8,u.B=16,u.W=32,u.U=64,u.R=128,t.exports=u},{"./_core":225,"./_ctx":226,"./_global":235,"./_hide":237}],233:[function(e,t,r){t.exports=function(e){try{return!!e()}catch(e){return!0}}},{}],234:[function(e,t,r){var n=e("./_ctx"),i=e("./_iter-call"),s=e("./_is-array-iter"),a=e("./_an-object"),o=e("./_to-length"),u=e("./core.get-iterator-method"),l={},c={};(r=t.exports=function(e,t,r,p,h){var f,d,m,y,g=h?function(){return e}:u(e),b=n(r,p,t?2:1),v=0;if("function"!=typeof g)throw TypeError(e+" is not iterable!");if(s(g)){for(f=o(e.length);f>v;v++)if((y=t?b(a(d=e[v])[0],d[1]):b(e[v]))===l||y===c)return y}else for(m=g.call(e);!(d=m.next()).done;)if((y=i(m,b,d.value,t))===l||y===c)return y}).BREAK=l,r.RETURN=c},{"./_an-object":213,"./_ctx":226,"./_is-array-iter":241,"./_iter-call":244,"./_to-length":278,"./core.get-iterator-method":286}],235:[function(e,t,r){var n=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n)},{}],236:[function(e,t,r){var n={}.hasOwnProperty;t.exports=function(e,t){return n.call(e,t)}},{}],237:[function(e,t,r){var n=e("./_object-dp"),i=e("./_property-desc");t.exports=e("./_descriptors")?function(e,t,r){return n.f(e,t,i(1,r))}:function(e,t,r){return e[t]=r,e}},{"./_descriptors":228,"./_object-dp":253,"./_property-desc":264}],238:[function(e,t,r){var n=e("./_global").document;t.exports=n&&n.documentElement},{"./_global":235}],239:[function(e,t,r){t.exports=!e("./_descriptors")&&!e("./_fails")(function(){return 7!=Object.defineProperty(e("./_dom-create")("div"),"a",{get:function(){return 7}}).a})},{"./_descriptors":228,"./_dom-create":229,"./_fails":233}],240:[function(e,t,r){var n=e("./_cof");t.exports=Object("z").propertyIsEnumerable(0)?Object:function(e){return"String"==n(e)?e.split(""):Object(e)}},{"./_cof":220}],241:[function(e,t,r){var n=e("./_iterators"),i=e("./_wks")("iterator"),s=Array.prototype;t.exports=function(e){return void 0!==e&&(n.Array===e||s[i]===e)}},{"./_iterators":248,"./_wks":285}],242:[function(e,t,r){var n=e("./_cof");t.exports=Array.isArray||function(e){return"Array"==n(e)}},{"./_cof":220}],243:[function(e,t,r){t.exports=function(e){return"object"==typeof e?null!==e:"function"==typeof e}},{}],244:[function(e,t,r){var n=e("./_an-object");t.exports=function(e,t,r,i){try{return i?t(n(r)[0],r[1]):t(r)}catch(t){var s=e.return;throw void 0!==s&&n(s.call(e)),t}}},{"./_an-object":213}],245:[function(e,t,r){"use strict";var n=e("./_object-create"),i=e("./_property-desc"),s=e("./_set-to-string-tag"),a={};e("./_hide")(a,e("./_wks")("iterator"),function(){return this}),t.exports=function(e,t,r){e.prototype=n(a,{next:i(1,r)}),s(e,t+" Iterator")}},{"./_hide":237,"./_object-create":252,"./_property-desc":264,"./_set-to-string-tag":271,"./_wks":285}],246:[function(e,t,r){"use strict";var n=e("./_library"),i=e("./_export"),s=e("./_redefine"),a=e("./_hide"),o=e("./_has"),u=e("./_iterators"),l=e("./_iter-create"),c=e("./_set-to-string-tag"),p=e("./_object-gpo"),h=e("./_wks")("iterator"),f=!([].keys&&"next"in[].keys()),d=function(){return this};t.exports=function(e,t,r,m,y,g,b){l(r,t,m);var v,x,E,A=function(e){if(!f&&e in _)return _[e];switch(e){case"keys":case"values":return function(){return new r(this,e)}}return function(){return new r(this,e)}},D=t+" Iterator",S="values"==y,C=!1,_=e.prototype,w=_[h]||_["@@iterator"]||y&&_[y],k=!f&&w||A(y),F=y?S?A("entries"):k:void 0,T="Array"==t?_.entries||w:w;if(T&&(E=p(T.call(new e)))!==Object.prototype&&E.next&&(c(E,D,!0),n||o(E,h)||a(E,h,d)),S&&w&&"values"!==w.name&&(C=!0,k=function(){return w.call(this)}),n&&!b||!f&&!C&&_[h]||a(_,h,k),u[t]=k,u[D]=d,y)if(v={values:S?k:A("values"),keys:g?k:A("keys"),entries:F},b)for(x in v)x in _||s(_,x,v[x]);else i(i.P+i.F*(f||C),t,v);return v}},{"./_export":232,"./_has":236,"./_hide":237,"./_iter-create":245,"./_iterators":248,"./_library":249,"./_object-gpo":259,"./_redefine":266,"./_set-to-string-tag":271,"./_wks":285}],247:[function(e,t,r){t.exports=function(e,t){return{value:t,done:!!e}}},{}],248:[function(e,t,r){t.exports={}},{}],249:[function(e,t,r){t.exports=!0},{}],250:[function(e,t,r){var n=e("./_uid")("meta"),i=e("./_is-object"),s=e("./_has"),a=e("./_object-dp").f,o=0,u=Object.isExtensible||function(){return!0},l=!e("./_fails")(function(){return u(Object.preventExtensions({}))}),c=function(e){a(e,n,{value:{i:"O"+ ++o,w:{}}})},p=t.exports={KEY:n,NEED:!1,fastKey:function(e,t){if(!i(e))return"symbol"==typeof e?e:("string"==typeof e?"S":"P")+e;if(!s(e,n)){if(!u(e))return"F";if(!t)return"E";c(e)}return e[n].i},getWeak:function(e,t){if(!s(e,n)){if(!u(e))return!0;if(!t)return!1;c(e)}return e[n].w},onFreeze:function(e){return l&&p.NEED&&u(e)&&!s(e,n)&&c(e),e}}},{"./_fails":233,"./_has":236,"./_is-object":243,"./_object-dp":253,"./_uid":281}],251:[function(e,t,r){"use strict";var n=e("./_object-keys"),i=e("./_object-gops"),s=e("./_object-pie"),a=e("./_to-object"),o=e("./_iobject"),u=Object.assign;t.exports=!u||e("./_fails")(function(){var e={},t={},r=Symbol(),n="abcdefghijklmnopqrst";return e[r]=7,n.split("").forEach(function(e){t[e]=e}),7!=u({},e)[r]||Object.keys(u({},t)).join("")!=n})?function(e,t){for(var r=a(e),u=arguments.length,l=1,c=i.f,p=s.f;u>l;)for(var h,f=o(arguments[l++]),d=c?n(f).concat(c(f)):n(f),m=d.length,y=0;m>y;)p.call(f,h=d[y++])&&(r[h]=f[h]);return r}:u},{"./_fails":233,"./_iobject":240,"./_object-gops":258,"./_object-keys":261,"./_object-pie":262,"./_to-object":279}],252:[function(e,t,r){var n=e("./_an-object"),i=e("./_object-dps"),s=e("./_enum-bug-keys"),a=e("./_shared-key")("IE_PROTO"),o=function(){},u=function(){var t,r=e("./_dom-create")("iframe"),n=s.length;for(r.style.display="none",e("./_html").appendChild(r),r.src="javascript:",(t=r.contentWindow.document).open(),t.write(" - - - - - - -``` - -## Node.js - -To install: - -```sh -yarn add es6-promise -``` - -or - -```sh -npm install es6-promise -``` - -To use: - -```js -var Promise = require('es6-promise').Promise; -``` - - -## Usage in IE<9 - -`catch` and `finally` are reserved keywords in IE<9, meaning -`promise.catch(func)` or `promise.finally(func)` throw a syntax error. To work -around this, you can use a string to access the property as shown in the -following example. - -However most minifiers will automatically fix this for you, making the -resulting code safe for old browsers and production: - -```js -promise['catch'](function(err) { - // ... -}); -``` - -```js -promise['finally'](function() { - // ... -}); -``` - -## Auto-polyfill - -To polyfill the global environment (either in Node or in the browser via CommonJS) use the following code snippet: - -```js -require('es6-promise').polyfill(); -``` - -Alternatively - -```js -require('es6-promise/auto'); -``` - -Notice that we don't assign the result of `polyfill()` to any variable. The `polyfill()` method will patch the global environment (in this case to the `Promise` name) when called. - -## Building & Testing - -You will need to have PhantomJS installed globally in order to run the tests. - -`npm install -g phantomjs` - -* `npm run build` to build -* `npm test` to run tests -* `npm start` to run a build watcher, and webserver to test -* `npm run test:server` for a testem test runner and watching builder diff --git a/deps/npm/node_modules/es6-promise/auto.js b/deps/npm/node_modules/es6-promise/auto.js deleted file mode 100644 index 92bbf36e586a18..00000000000000 --- a/deps/npm/node_modules/es6-promise/auto.js +++ /dev/null @@ -1,4 +0,0 @@ -// This file can be required in Browserify and Node.js for automatic polyfill -// To use it: require('es6-promise/auto'); -'use strict'; -module.exports = require('./').polyfill(); diff --git a/deps/npm/node_modules/es6-promise/dist/es6-promise.auto.js b/deps/npm/node_modules/es6-promise/dist/es6-promise.auto.js deleted file mode 100644 index 7ad1de569011e0..00000000000000 --- a/deps/npm/node_modules/es6-promise/dist/es6-promise.auto.js +++ /dev/null @@ -1,1176 +0,0 @@ -/*! - * @overview es6-promise - a tiny implementation of Promises/A+. - * @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors (Conversion to ES6 API by Jake Archibald) - * @license Licensed under MIT license - * See https://raw.githubusercontent.com/stefanpenner/es6-promise/master/LICENSE - * @version v4.2.8+1e68dce6 - */ - -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : - typeof define === 'function' && define.amd ? define(factory) : - (global.ES6Promise = factory()); -}(this, (function () { 'use strict'; - -function objectOrFunction(x) { - var type = typeof x; - return x !== null && (type === 'object' || type === 'function'); -} - -function isFunction(x) { - return typeof x === 'function'; -} - - - -var _isArray = void 0; -if (Array.isArray) { - _isArray = Array.isArray; -} else { - _isArray = function (x) { - return Object.prototype.toString.call(x) === '[object Array]'; - }; -} - -var isArray = _isArray; - -var len = 0; -var vertxNext = void 0; -var customSchedulerFn = void 0; - -var asap = function asap(callback, arg) { - queue[len] = callback; - queue[len + 1] = arg; - len += 2; - if (len === 2) { - // If len is 2, that means that we need to schedule an async flush. - // If additional callbacks are queued before the queue is flushed, they - // will be processed by this flush that we are scheduling. - if (customSchedulerFn) { - customSchedulerFn(flush); - } else { - scheduleFlush(); - } - } -}; - -function setScheduler(scheduleFn) { - customSchedulerFn = scheduleFn; -} - -function setAsap(asapFn) { - asap = asapFn; -} - -var browserWindow = typeof window !== 'undefined' ? window : undefined; -var browserGlobal = browserWindow || {}; -var BrowserMutationObserver = browserGlobal.MutationObserver || browserGlobal.WebKitMutationObserver; -var isNode = typeof self === 'undefined' && typeof process !== 'undefined' && {}.toString.call(process) === '[object process]'; - -// test for web worker but not in IE10 -var isWorker = typeof Uint8ClampedArray !== 'undefined' && typeof importScripts !== 'undefined' && typeof MessageChannel !== 'undefined'; - -// node -function useNextTick() { - // node version 0.10.x displays a deprecation warning when nextTick is used recursively - // see https://github.com/cujojs/when/issues/410 for details - return function () { - return process.nextTick(flush); - }; -} - -// vertx -function useVertxTimer() { - if (typeof vertxNext !== 'undefined') { - return function () { - vertxNext(flush); - }; - } - - return useSetTimeout(); -} - -function useMutationObserver() { - var iterations = 0; - var observer = new BrowserMutationObserver(flush); - var node = document.createTextNode(''); - observer.observe(node, { characterData: true }); - - return function () { - node.data = iterations = ++iterations % 2; - }; -} - -// web worker -function useMessageChannel() { - var channel = new MessageChannel(); - channel.port1.onmessage = flush; - return function () { - return channel.port2.postMessage(0); - }; -} - -function useSetTimeout() { - // Store setTimeout reference so es6-promise will be unaffected by - // other code modifying setTimeout (like sinon.useFakeTimers()) - var globalSetTimeout = setTimeout; - return function () { - return globalSetTimeout(flush, 1); - }; -} - -var queue = new Array(1000); -function flush() { - for (var i = 0; i < len; i += 2) { - var callback = queue[i]; - var arg = queue[i + 1]; - - callback(arg); - - queue[i] = undefined; - queue[i + 1] = undefined; - } - - len = 0; -} - -function attemptVertx() { - try { - var vertx = Function('return this')().require('vertx'); - vertxNext = vertx.runOnLoop || vertx.runOnContext; - return useVertxTimer(); - } catch (e) { - return useSetTimeout(); - } -} - -var scheduleFlush = void 0; -// Decide what async method to use to triggering processing of queued callbacks: -if (isNode) { - scheduleFlush = useNextTick(); -} else if (BrowserMutationObserver) { - scheduleFlush = useMutationObserver(); -} else if (isWorker) { - scheduleFlush = useMessageChannel(); -} else if (browserWindow === undefined && typeof require === 'function') { - scheduleFlush = attemptVertx(); -} else { - scheduleFlush = useSetTimeout(); -} - -function then(onFulfillment, onRejection) { - var parent = this; - - var child = new this.constructor(noop); - - if (child[PROMISE_ID] === undefined) { - makePromise(child); - } - - var _state = parent._state; - - - if (_state) { - var callback = arguments[_state - 1]; - asap(function () { - return invokeCallback(_state, child, callback, parent._result); - }); - } else { - subscribe(parent, child, onFulfillment, onRejection); - } - - return child; -} - -/** - `Promise.resolve` returns a promise that will become resolved with the - passed `value`. It is shorthand for the following: - - ```javascript - let promise = new Promise(function(resolve, reject){ - resolve(1); - }); - - promise.then(function(value){ - // value === 1 - }); - ``` - - Instead of writing the above, your code now simply becomes the following: - - ```javascript - let promise = Promise.resolve(1); - - promise.then(function(value){ - // value === 1 - }); - ``` - - @method resolve - @static - @param {Any} value value that the returned promise will be resolved with - Useful for tooling. - @return {Promise} a promise that will become fulfilled with the given - `value` -*/ -function resolve$1(object) { - /*jshint validthis:true */ - var Constructor = this; - - if (object && typeof object === 'object' && object.constructor === Constructor) { - return object; - } - - var promise = new Constructor(noop); - resolve(promise, object); - return promise; -} - -var PROMISE_ID = Math.random().toString(36).substring(2); - -function noop() {} - -var PENDING = void 0; -var FULFILLED = 1; -var REJECTED = 2; - -function selfFulfillment() { - return new TypeError("You cannot resolve a promise with itself"); -} - -function cannotReturnOwn() { - return new TypeError('A promises callback cannot return that same promise.'); -} - -function tryThen(then$$1, value, fulfillmentHandler, rejectionHandler) { - try { - then$$1.call(value, fulfillmentHandler, rejectionHandler); - } catch (e) { - return e; - } -} - -function handleForeignThenable(promise, thenable, then$$1) { - asap(function (promise) { - var sealed = false; - var error = tryThen(then$$1, thenable, function (value) { - if (sealed) { - return; - } - sealed = true; - if (thenable !== value) { - resolve(promise, value); - } else { - fulfill(promise, value); - } - }, function (reason) { - if (sealed) { - return; - } - sealed = true; - - reject(promise, reason); - }, 'Settle: ' + (promise._label || ' unknown promise')); - - if (!sealed && error) { - sealed = true; - reject(promise, error); - } - }, promise); -} - -function handleOwnThenable(promise, thenable) { - if (thenable._state === FULFILLED) { - fulfill(promise, thenable._result); - } else if (thenable._state === REJECTED) { - reject(promise, thenable._result); - } else { - subscribe(thenable, undefined, function (value) { - return resolve(promise, value); - }, function (reason) { - return reject(promise, reason); - }); - } -} - -function handleMaybeThenable(promise, maybeThenable, then$$1) { - if (maybeThenable.constructor === promise.constructor && then$$1 === then && maybeThenable.constructor.resolve === resolve$1) { - handleOwnThenable(promise, maybeThenable); - } else { - if (then$$1 === undefined) { - fulfill(promise, maybeThenable); - } else if (isFunction(then$$1)) { - handleForeignThenable(promise, maybeThenable, then$$1); - } else { - fulfill(promise, maybeThenable); - } - } -} - -function resolve(promise, value) { - if (promise === value) { - reject(promise, selfFulfillment()); - } else if (objectOrFunction(value)) { - var then$$1 = void 0; - try { - then$$1 = value.then; - } catch (error) { - reject(promise, error); - return; - } - handleMaybeThenable(promise, value, then$$1); - } else { - fulfill(promise, value); - } -} - -function publishRejection(promise) { - if (promise._onerror) { - promise._onerror(promise._result); - } - - publish(promise); -} - -function fulfill(promise, value) { - if (promise._state !== PENDING) { - return; - } - - promise._result = value; - promise._state = FULFILLED; - - if (promise._subscribers.length !== 0) { - asap(publish, promise); - } -} - -function reject(promise, reason) { - if (promise._state !== PENDING) { - return; - } - promise._state = REJECTED; - promise._result = reason; - - asap(publishRejection, promise); -} - -function subscribe(parent, child, onFulfillment, onRejection) { - var _subscribers = parent._subscribers; - var length = _subscribers.length; - - - parent._onerror = null; - - _subscribers[length] = child; - _subscribers[length + FULFILLED] = onFulfillment; - _subscribers[length + REJECTED] = onRejection; - - if (length === 0 && parent._state) { - asap(publish, parent); - } -} - -function publish(promise) { - var subscribers = promise._subscribers; - var settled = promise._state; - - if (subscribers.length === 0) { - return; - } - - var child = void 0, - callback = void 0, - detail = promise._result; - - for (var i = 0; i < subscribers.length; i += 3) { - child = subscribers[i]; - callback = subscribers[i + settled]; - - if (child) { - invokeCallback(settled, child, callback, detail); - } else { - callback(detail); - } - } - - promise._subscribers.length = 0; -} - -function invokeCallback(settled, promise, callback, detail) { - var hasCallback = isFunction(callback), - value = void 0, - error = void 0, - succeeded = true; - - if (hasCallback) { - try { - value = callback(detail); - } catch (e) { - succeeded = false; - error = e; - } - - if (promise === value) { - reject(promise, cannotReturnOwn()); - return; - } - } else { - value = detail; - } - - if (promise._state !== PENDING) { - // noop - } else if (hasCallback && succeeded) { - resolve(promise, value); - } else if (succeeded === false) { - reject(promise, error); - } else if (settled === FULFILLED) { - fulfill(promise, value); - } else if (settled === REJECTED) { - reject(promise, value); - } -} - -function initializePromise(promise, resolver) { - try { - resolver(function resolvePromise(value) { - resolve(promise, value); - }, function rejectPromise(reason) { - reject(promise, reason); - }); - } catch (e) { - reject(promise, e); - } -} - -var id = 0; -function nextId() { - return id++; -} - -function makePromise(promise) { - promise[PROMISE_ID] = id++; - promise._state = undefined; - promise._result = undefined; - promise._subscribers = []; -} - -function validationError() { - return new Error('Array Methods must be provided an Array'); -} - -var Enumerator = function () { - function Enumerator(Constructor, input) { - this._instanceConstructor = Constructor; - this.promise = new Constructor(noop); - - if (!this.promise[PROMISE_ID]) { - makePromise(this.promise); - } - - if (isArray(input)) { - this.length = input.length; - this._remaining = input.length; - - this._result = new Array(this.length); - - if (this.length === 0) { - fulfill(this.promise, this._result); - } else { - this.length = this.length || 0; - this._enumerate(input); - if (this._remaining === 0) { - fulfill(this.promise, this._result); - } - } - } else { - reject(this.promise, validationError()); - } - } - - Enumerator.prototype._enumerate = function _enumerate(input) { - for (var i = 0; this._state === PENDING && i < input.length; i++) { - this._eachEntry(input[i], i); - } - }; - - Enumerator.prototype._eachEntry = function _eachEntry(entry, i) { - var c = this._instanceConstructor; - var resolve$$1 = c.resolve; - - - if (resolve$$1 === resolve$1) { - var _then = void 0; - var error = void 0; - var didError = false; - try { - _then = entry.then; - } catch (e) { - didError = true; - error = e; - } - - if (_then === then && entry._state !== PENDING) { - this._settledAt(entry._state, i, entry._result); - } else if (typeof _then !== 'function') { - this._remaining--; - this._result[i] = entry; - } else if (c === Promise$2) { - var promise = new c(noop); - if (didError) { - reject(promise, error); - } else { - handleMaybeThenable(promise, entry, _then); - } - this._willSettleAt(promise, i); - } else { - this._willSettleAt(new c(function (resolve$$1) { - return resolve$$1(entry); - }), i); - } - } else { - this._willSettleAt(resolve$$1(entry), i); - } - }; - - Enumerator.prototype._settledAt = function _settledAt(state, i, value) { - var promise = this.promise; - - - if (promise._state === PENDING) { - this._remaining--; - - if (state === REJECTED) { - reject(promise, value); - } else { - this._result[i] = value; - } - } - - if (this._remaining === 0) { - fulfill(promise, this._result); - } - }; - - Enumerator.prototype._willSettleAt = function _willSettleAt(promise, i) { - var enumerator = this; - - subscribe(promise, undefined, function (value) { - return enumerator._settledAt(FULFILLED, i, value); - }, function (reason) { - return enumerator._settledAt(REJECTED, i, reason); - }); - }; - - return Enumerator; -}(); - -/** - `Promise.all` accepts an array of promises, and returns a new promise which - is fulfilled with an array of fulfillment values for the passed promises, or - rejected with the reason of the first passed promise to be rejected. It casts all - elements of the passed iterable to promises as it runs this algorithm. - - Example: - - ```javascript - let promise1 = resolve(1); - let promise2 = resolve(2); - let promise3 = resolve(3); - let promises = [ promise1, promise2, promise3 ]; - - Promise.all(promises).then(function(array){ - // The array here would be [ 1, 2, 3 ]; - }); - ``` - - If any of the `promises` given to `all` are rejected, the first promise - that is rejected will be given as an argument to the returned promises's - rejection handler. For example: - - Example: - - ```javascript - let promise1 = resolve(1); - let promise2 = reject(new Error("2")); - let promise3 = reject(new Error("3")); - let promises = [ promise1, promise2, promise3 ]; - - Promise.all(promises).then(function(array){ - // Code here never runs because there are rejected promises! - }, function(error) { - // error.message === "2" - }); - ``` - - @method all - @static - @param {Array} entries array of promises - @param {String} label optional string for labeling the promise. - Useful for tooling. - @return {Promise} promise that is fulfilled when all `promises` have been - fulfilled, or rejected if any of them become rejected. - @static -*/ -function all(entries) { - return new Enumerator(this, entries).promise; -} - -/** - `Promise.race` returns a new promise which is settled in the same way as the - first passed promise to settle. - - Example: - - ```javascript - let promise1 = new Promise(function(resolve, reject){ - setTimeout(function(){ - resolve('promise 1'); - }, 200); - }); - - let promise2 = new Promise(function(resolve, reject){ - setTimeout(function(){ - resolve('promise 2'); - }, 100); - }); - - Promise.race([promise1, promise2]).then(function(result){ - // result === 'promise 2' because it was resolved before promise1 - // was resolved. - }); - ``` - - `Promise.race` is deterministic in that only the state of the first - settled promise matters. For example, even if other promises given to the - `promises` array argument are resolved, but the first settled promise has - become rejected before the other promises became fulfilled, the returned - promise will become rejected: - - ```javascript - let promise1 = new Promise(function(resolve, reject){ - setTimeout(function(){ - resolve('promise 1'); - }, 200); - }); - - let promise2 = new Promise(function(resolve, reject){ - setTimeout(function(){ - reject(new Error('promise 2')); - }, 100); - }); - - Promise.race([promise1, promise2]).then(function(result){ - // Code here never runs - }, function(reason){ - // reason.message === 'promise 2' because promise 2 became rejected before - // promise 1 became fulfilled - }); - ``` - - An example real-world use case is implementing timeouts: - - ```javascript - Promise.race([ajax('foo.json'), timeout(5000)]) - ``` - - @method race - @static - @param {Array} promises array of promises to observe - Useful for tooling. - @return {Promise} a promise which settles in the same way as the first passed - promise to settle. -*/ -function race(entries) { - /*jshint validthis:true */ - var Constructor = this; - - if (!isArray(entries)) { - return new Constructor(function (_, reject) { - return reject(new TypeError('You must pass an array to race.')); - }); - } else { - return new Constructor(function (resolve, reject) { - var length = entries.length; - for (var i = 0; i < length; i++) { - Constructor.resolve(entries[i]).then(resolve, reject); - } - }); - } -} - -/** - `Promise.reject` returns a promise rejected with the passed `reason`. - It is shorthand for the following: - - ```javascript - let promise = new Promise(function(resolve, reject){ - reject(new Error('WHOOPS')); - }); - - promise.then(function(value){ - // Code here doesn't run because the promise is rejected! - }, function(reason){ - // reason.message === 'WHOOPS' - }); - ``` - - Instead of writing the above, your code now simply becomes the following: - - ```javascript - let promise = Promise.reject(new Error('WHOOPS')); - - promise.then(function(value){ - // Code here doesn't run because the promise is rejected! - }, function(reason){ - // reason.message === 'WHOOPS' - }); - ``` - - @method reject - @static - @param {Any} reason value that the returned promise will be rejected with. - Useful for tooling. - @return {Promise} a promise rejected with the given `reason`. -*/ -function reject$1(reason) { - /*jshint validthis:true */ - var Constructor = this; - var promise = new Constructor(noop); - reject(promise, reason); - return promise; -} - -function needsResolver() { - throw new TypeError('You must pass a resolver function as the first argument to the promise constructor'); -} - -function needsNew() { - throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function."); -} - -/** - Promise objects represent the eventual result of an asynchronous operation. The - primary way of interacting with a promise is through its `then` method, which - registers callbacks to receive either a promise's eventual value or the reason - why the promise cannot be fulfilled. - - Terminology - ----------- - - - `promise` is an object or function with a `then` method whose behavior conforms to this specification. - - `thenable` is an object or function that defines a `then` method. - - `value` is any legal JavaScript value (including undefined, a thenable, or a promise). - - `exception` is a value that is thrown using the throw statement. - - `reason` is a value that indicates why a promise was rejected. - - `settled` the final resting state of a promise, fulfilled or rejected. - - A promise can be in one of three states: pending, fulfilled, or rejected. - - Promises that are fulfilled have a fulfillment value and are in the fulfilled - state. Promises that are rejected have a rejection reason and are in the - rejected state. A fulfillment value is never a thenable. - - Promises can also be said to *resolve* a value. If this value is also a - promise, then the original promise's settled state will match the value's - settled state. So a promise that *resolves* a promise that rejects will - itself reject, and a promise that *resolves* a promise that fulfills will - itself fulfill. - - - Basic Usage: - ------------ - - ```js - let promise = new Promise(function(resolve, reject) { - // on success - resolve(value); - - // on failure - reject(reason); - }); - - promise.then(function(value) { - // on fulfillment - }, function(reason) { - // on rejection - }); - ``` - - Advanced Usage: - --------------- - - Promises shine when abstracting away asynchronous interactions such as - `XMLHttpRequest`s. - - ```js - function getJSON(url) { - return new Promise(function(resolve, reject){ - let xhr = new XMLHttpRequest(); - - xhr.open('GET', url); - xhr.onreadystatechange = handler; - xhr.responseType = 'json'; - xhr.setRequestHeader('Accept', 'application/json'); - xhr.send(); - - function handler() { - if (this.readyState === this.DONE) { - if (this.status === 200) { - resolve(this.response); - } else { - reject(new Error('getJSON: `' + url + '` failed with status: [' + this.status + ']')); - } - } - }; - }); - } - - getJSON('/posts.json').then(function(json) { - // on fulfillment - }, function(reason) { - // on rejection - }); - ``` - - Unlike callbacks, promises are great composable primitives. - - ```js - Promise.all([ - getJSON('/posts'), - getJSON('/comments') - ]).then(function(values){ - values[0] // => postsJSON - values[1] // => commentsJSON - - return values; - }); - ``` - - @class Promise - @param {Function} resolver - Useful for tooling. - @constructor -*/ - -var Promise$2 = function () { - function Promise(resolver) { - this[PROMISE_ID] = nextId(); - this._result = this._state = undefined; - this._subscribers = []; - - if (noop !== resolver) { - typeof resolver !== 'function' && needsResolver(); - this instanceof Promise ? initializePromise(this, resolver) : needsNew(); - } - } - - /** - The primary way of interacting with a promise is through its `then` method, - which registers callbacks to receive either a promise's eventual value or the - reason why the promise cannot be fulfilled. - ```js - findUser().then(function(user){ - // user is available - }, function(reason){ - // user is unavailable, and you are given the reason why - }); - ``` - Chaining - -------- - The return value of `then` is itself a promise. This second, 'downstream' - promise is resolved with the return value of the first promise's fulfillment - or rejection handler, or rejected if the handler throws an exception. - ```js - findUser().then(function (user) { - return user.name; - }, function (reason) { - return 'default name'; - }).then(function (userName) { - // If `findUser` fulfilled, `userName` will be the user's name, otherwise it - // will be `'default name'` - }); - findUser().then(function (user) { - throw new Error('Found user, but still unhappy'); - }, function (reason) { - throw new Error('`findUser` rejected and we're unhappy'); - }).then(function (value) { - // never reached - }, function (reason) { - // if `findUser` fulfilled, `reason` will be 'Found user, but still unhappy'. - // If `findUser` rejected, `reason` will be '`findUser` rejected and we're unhappy'. - }); - ``` - If the downstream promise does not specify a rejection handler, rejection reasons will be propagated further downstream. - ```js - findUser().then(function (user) { - throw new PedagogicalException('Upstream error'); - }).then(function (value) { - // never reached - }).then(function (value) { - // never reached - }, function (reason) { - // The `PedgagocialException` is propagated all the way down to here - }); - ``` - Assimilation - ------------ - Sometimes the value you want to propagate to a downstream promise can only be - retrieved asynchronously. This can be achieved by returning a promise in the - fulfillment or rejection handler. The downstream promise will then be pending - until the returned promise is settled. This is called *assimilation*. - ```js - findUser().then(function (user) { - return findCommentsByAuthor(user); - }).then(function (comments) { - // The user's comments are now available - }); - ``` - If the assimliated promise rejects, then the downstream promise will also reject. - ```js - findUser().then(function (user) { - return findCommentsByAuthor(user); - }).then(function (comments) { - // If `findCommentsByAuthor` fulfills, we'll have the value here - }, function (reason) { - // If `findCommentsByAuthor` rejects, we'll have the reason here - }); - ``` - Simple Example - -------------- - Synchronous Example - ```javascript - let result; - try { - result = findResult(); - // success - } catch(reason) { - // failure - } - ``` - Errback Example - ```js - findResult(function(result, err){ - if (err) { - // failure - } else { - // success - } - }); - ``` - Promise Example; - ```javascript - findResult().then(function(result){ - // success - }, function(reason){ - // failure - }); - ``` - Advanced Example - -------------- - Synchronous Example - ```javascript - let author, books; - try { - author = findAuthor(); - books = findBooksByAuthor(author); - // success - } catch(reason) { - // failure - } - ``` - Errback Example - ```js - function foundBooks(books) { - } - function failure(reason) { - } - findAuthor(function(author, err){ - if (err) { - failure(err); - // failure - } else { - try { - findBoooksByAuthor(author, function(books, err) { - if (err) { - failure(err); - } else { - try { - foundBooks(books); - } catch(reason) { - failure(reason); - } - } - }); - } catch(error) { - failure(err); - } - // success - } - }); - ``` - Promise Example; - ```javascript - findAuthor(). - then(findBooksByAuthor). - then(function(books){ - // found books - }).catch(function(reason){ - // something went wrong - }); - ``` - @method then - @param {Function} onFulfilled - @param {Function} onRejected - Useful for tooling. - @return {Promise} - */ - - /** - `catch` is simply sugar for `then(undefined, onRejection)` which makes it the same - as the catch block of a try/catch statement. - ```js - function findAuthor(){ - throw new Error('couldn't find that author'); - } - // synchronous - try { - findAuthor(); - } catch(reason) { - // something went wrong - } - // async with promises - findAuthor().catch(function(reason){ - // something went wrong - }); - ``` - @method catch - @param {Function} onRejection - Useful for tooling. - @return {Promise} - */ - - - Promise.prototype.catch = function _catch(onRejection) { - return this.then(null, onRejection); - }; - - /** - `finally` will be invoked regardless of the promise's fate just as native - try/catch/finally behaves - - Synchronous example: - - ```js - findAuthor() { - if (Math.random() > 0.5) { - throw new Error(); - } - return new Author(); - } - - try { - return findAuthor(); // succeed or fail - } catch(error) { - return findOtherAuther(); - } finally { - // always runs - // doesn't affect the return value - } - ``` - - Asynchronous example: - - ```js - findAuthor().catch(function(reason){ - return findOtherAuther(); - }).finally(function(){ - // author was either found, or not - }); - ``` - - @method finally - @param {Function} callback - @return {Promise} - */ - - - Promise.prototype.finally = function _finally(callback) { - var promise = this; - var constructor = promise.constructor; - - if (isFunction(callback)) { - return promise.then(function (value) { - return constructor.resolve(callback()).then(function () { - return value; - }); - }, function (reason) { - return constructor.resolve(callback()).then(function () { - throw reason; - }); - }); - } - - return promise.then(callback, callback); - }; - - return Promise; -}(); - -Promise$2.prototype.then = then; -Promise$2.all = all; -Promise$2.race = race; -Promise$2.resolve = resolve$1; -Promise$2.reject = reject$1; -Promise$2._setScheduler = setScheduler; -Promise$2._setAsap = setAsap; -Promise$2._asap = asap; - -/*global self*/ -function polyfill() { - var local = void 0; - - if (typeof global !== 'undefined') { - local = global; - } else if (typeof self !== 'undefined') { - local = self; - } else { - try { - local = Function('return this')(); - } catch (e) { - throw new Error('polyfill failed because global object is unavailable in this environment'); - } - } - - var P = local.Promise; - - if (P) { - var promiseToString = null; - try { - promiseToString = Object.prototype.toString.call(P.resolve()); - } catch (e) { - // silently ignored - } - - if (promiseToString === '[object Promise]' && !P.cast) { - return; - } - } - - local.Promise = Promise$2; -} - -// Strange compat.. -Promise$2.polyfill = polyfill; -Promise$2.Promise = Promise$2; - -Promise$2.polyfill(); - -return Promise$2; - -}))); - - - -//# sourceMappingURL=es6-promise.auto.map diff --git a/deps/npm/node_modules/es6-promise/dist/es6-promise.auto.map b/deps/npm/node_modules/es6-promise/dist/es6-promise.auto.map deleted file mode 100644 index a5abce99f41051..00000000000000 --- a/deps/npm/node_modules/es6-promise/dist/es6-promise.auto.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["config/versionTemplate.txt","lib/es6-promise/utils.js","lib/es6-promise/asap.js","lib/es6-promise/then.js","lib/es6-promise/promise/resolve.js","lib/es6-promise/-internal.js","lib/es6-promise/enumerator.js","lib/es6-promise/promise/all.js","lib/es6-promise/promise/race.js","lib/es6-promise/promise/reject.js","lib/es6-promise/promise.js","lib/es6-promise/polyfill.js","lib/es6-promise.js","lib/es6-promise.auto.js"],"sourcesContent":["/*!\n * @overview es6-promise - a tiny implementation of Promises/A+.\n * @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors (Conversion to ES6 API by Jake Archibald)\n * @license Licensed under MIT license\n * See https://raw.githubusercontent.com/stefanpenner/es6-promise/master/LICENSE\n * @version v4.2.8+1e68dce6\n */\n","export function objectOrFunction(x) {\n var type = typeof x;\n return x !== null && (type === 'object' || type === 'function');\n}\n\nexport function isFunction(x) {\n return typeof x === 'function';\n}\n\nexport function isMaybeThenable(x) {\n return x !== null && typeof x === 'object';\n}\n\nvar _isArray = void 0;\nif (Array.isArray) {\n _isArray = Array.isArray;\n} else {\n _isArray = function (x) {\n return Object.prototype.toString.call(x) === '[object Array]';\n };\n}\n\nexport var isArray = _isArray;","var len = 0;\nvar vertxNext = void 0;\nvar customSchedulerFn = void 0;\n\nexport var asap = function asap(callback, arg) {\n queue[len] = callback;\n queue[len + 1] = arg;\n len += 2;\n if (len === 2) {\n // If len is 2, that means that we need to schedule an async flush.\n // If additional callbacks are queued before the queue is flushed, they\n // will be processed by this flush that we are scheduling.\n if (customSchedulerFn) {\n customSchedulerFn(flush);\n } else {\n scheduleFlush();\n }\n }\n};\n\nexport function setScheduler(scheduleFn) {\n customSchedulerFn = scheduleFn;\n}\n\nexport function setAsap(asapFn) {\n asap = asapFn;\n}\n\nvar browserWindow = typeof window !== 'undefined' ? window : undefined;\nvar browserGlobal = browserWindow || {};\nvar BrowserMutationObserver = browserGlobal.MutationObserver || browserGlobal.WebKitMutationObserver;\nvar isNode = typeof self === 'undefined' && typeof process !== 'undefined' && {}.toString.call(process) === '[object process]';\n\n// test for web worker but not in IE10\nvar isWorker = typeof Uint8ClampedArray !== 'undefined' && typeof importScripts !== 'undefined' && typeof MessageChannel !== 'undefined';\n\n// node\nfunction useNextTick() {\n // node version 0.10.x displays a deprecation warning when nextTick is used recursively\n // see https://github.com/cujojs/when/issues/410 for details\n return function () {\n return process.nextTick(flush);\n };\n}\n\n// vertx\nfunction useVertxTimer() {\n if (typeof vertxNext !== 'undefined') {\n return function () {\n vertxNext(flush);\n };\n }\n\n return useSetTimeout();\n}\n\nfunction useMutationObserver() {\n var iterations = 0;\n var observer = new BrowserMutationObserver(flush);\n var node = document.createTextNode('');\n observer.observe(node, { characterData: true });\n\n return function () {\n node.data = iterations = ++iterations % 2;\n };\n}\n\n// web worker\nfunction useMessageChannel() {\n var channel = new MessageChannel();\n channel.port1.onmessage = flush;\n return function () {\n return channel.port2.postMessage(0);\n };\n}\n\nfunction useSetTimeout() {\n // Store setTimeout reference so es6-promise will be unaffected by\n // other code modifying setTimeout (like sinon.useFakeTimers())\n var globalSetTimeout = setTimeout;\n return function () {\n return globalSetTimeout(flush, 1);\n };\n}\n\nvar queue = new Array(1000);\nfunction flush() {\n for (var i = 0; i < len; i += 2) {\n var callback = queue[i];\n var arg = queue[i + 1];\n\n callback(arg);\n\n queue[i] = undefined;\n queue[i + 1] = undefined;\n }\n\n len = 0;\n}\n\nfunction attemptVertx() {\n try {\n var vertx = Function('return this')().require('vertx');\n vertxNext = vertx.runOnLoop || vertx.runOnContext;\n return useVertxTimer();\n } catch (e) {\n return useSetTimeout();\n }\n}\n\nvar scheduleFlush = void 0;\n// Decide what async method to use to triggering processing of queued callbacks:\nif (isNode) {\n scheduleFlush = useNextTick();\n} else if (BrowserMutationObserver) {\n scheduleFlush = useMutationObserver();\n} else if (isWorker) {\n scheduleFlush = useMessageChannel();\n} else if (browserWindow === undefined && typeof require === 'function') {\n scheduleFlush = attemptVertx();\n} else {\n scheduleFlush = useSetTimeout();\n}","import { invokeCallback, subscribe, FULFILLED, REJECTED, noop, makePromise, PROMISE_ID } from './-internal';\n\nimport { asap } from './asap';\n\nexport default function then(onFulfillment, onRejection) {\n var parent = this;\n\n var child = new this.constructor(noop);\n\n if (child[PROMISE_ID] === undefined) {\n makePromise(child);\n }\n\n var _state = parent._state;\n\n\n if (_state) {\n var callback = arguments[_state - 1];\n asap(function () {\n return invokeCallback(_state, child, callback, parent._result);\n });\n } else {\n subscribe(parent, child, onFulfillment, onRejection);\n }\n\n return child;\n}","import { noop, resolve as _resolve } from '../-internal';\n\n/**\n `Promise.resolve` returns a promise that will become resolved with the\n passed `value`. It is shorthand for the following:\n\n ```javascript\n let promise = new Promise(function(resolve, reject){\n resolve(1);\n });\n\n promise.then(function(value){\n // value === 1\n });\n ```\n\n Instead of writing the above, your code now simply becomes the following:\n\n ```javascript\n let promise = Promise.resolve(1);\n\n promise.then(function(value){\n // value === 1\n });\n ```\n\n @method resolve\n @static\n @param {Any} value value that the returned promise will be resolved with\n Useful for tooling.\n @return {Promise} a promise that will become fulfilled with the given\n `value`\n*/\nexport default function resolve(object) {\n /*jshint validthis:true */\n var Constructor = this;\n\n if (object && typeof object === 'object' && object.constructor === Constructor) {\n return object;\n }\n\n var promise = new Constructor(noop);\n _resolve(promise, object);\n return promise;\n}","import { objectOrFunction, isFunction } from './utils';\n\nimport { asap } from './asap';\n\nimport originalThen from './then';\nimport originalResolve from './promise/resolve';\n\nexport var PROMISE_ID = Math.random().toString(36).substring(2);\n\nfunction noop() {}\n\nvar PENDING = void 0;\nvar FULFILLED = 1;\nvar REJECTED = 2;\n\nfunction selfFulfillment() {\n return new TypeError(\"You cannot resolve a promise with itself\");\n}\n\nfunction cannotReturnOwn() {\n return new TypeError('A promises callback cannot return that same promise.');\n}\n\nfunction tryThen(then, value, fulfillmentHandler, rejectionHandler) {\n try {\n then.call(value, fulfillmentHandler, rejectionHandler);\n } catch (e) {\n return e;\n }\n}\n\nfunction handleForeignThenable(promise, thenable, then) {\n asap(function (promise) {\n var sealed = false;\n var error = tryThen(then, thenable, function (value) {\n if (sealed) {\n return;\n }\n sealed = true;\n if (thenable !== value) {\n resolve(promise, value);\n } else {\n fulfill(promise, value);\n }\n }, function (reason) {\n if (sealed) {\n return;\n }\n sealed = true;\n\n reject(promise, reason);\n }, 'Settle: ' + (promise._label || ' unknown promise'));\n\n if (!sealed && error) {\n sealed = true;\n reject(promise, error);\n }\n }, promise);\n}\n\nfunction handleOwnThenable(promise, thenable) {\n if (thenable._state === FULFILLED) {\n fulfill(promise, thenable._result);\n } else if (thenable._state === REJECTED) {\n reject(promise, thenable._result);\n } else {\n subscribe(thenable, undefined, function (value) {\n return resolve(promise, value);\n }, function (reason) {\n return reject(promise, reason);\n });\n }\n}\n\nfunction handleMaybeThenable(promise, maybeThenable, then) {\n if (maybeThenable.constructor === promise.constructor && then === originalThen && maybeThenable.constructor.resolve === originalResolve) {\n handleOwnThenable(promise, maybeThenable);\n } else {\n if (then === undefined) {\n fulfill(promise, maybeThenable);\n } else if (isFunction(then)) {\n handleForeignThenable(promise, maybeThenable, then);\n } else {\n fulfill(promise, maybeThenable);\n }\n }\n}\n\nfunction resolve(promise, value) {\n if (promise === value) {\n reject(promise, selfFulfillment());\n } else if (objectOrFunction(value)) {\n var then = void 0;\n try {\n then = value.then;\n } catch (error) {\n reject(promise, error);\n return;\n }\n handleMaybeThenable(promise, value, then);\n } else {\n fulfill(promise, value);\n }\n}\n\nfunction publishRejection(promise) {\n if (promise._onerror) {\n promise._onerror(promise._result);\n }\n\n publish(promise);\n}\n\nfunction fulfill(promise, value) {\n if (promise._state !== PENDING) {\n return;\n }\n\n promise._result = value;\n promise._state = FULFILLED;\n\n if (promise._subscribers.length !== 0) {\n asap(publish, promise);\n }\n}\n\nfunction reject(promise, reason) {\n if (promise._state !== PENDING) {\n return;\n }\n promise._state = REJECTED;\n promise._result = reason;\n\n asap(publishRejection, promise);\n}\n\nfunction subscribe(parent, child, onFulfillment, onRejection) {\n var _subscribers = parent._subscribers;\n var length = _subscribers.length;\n\n\n parent._onerror = null;\n\n _subscribers[length] = child;\n _subscribers[length + FULFILLED] = onFulfillment;\n _subscribers[length + REJECTED] = onRejection;\n\n if (length === 0 && parent._state) {\n asap(publish, parent);\n }\n}\n\nfunction publish(promise) {\n var subscribers = promise._subscribers;\n var settled = promise._state;\n\n if (subscribers.length === 0) {\n return;\n }\n\n var child = void 0,\n callback = void 0,\n detail = promise._result;\n\n for (var i = 0; i < subscribers.length; i += 3) {\n child = subscribers[i];\n callback = subscribers[i + settled];\n\n if (child) {\n invokeCallback(settled, child, callback, detail);\n } else {\n callback(detail);\n }\n }\n\n promise._subscribers.length = 0;\n}\n\nfunction invokeCallback(settled, promise, callback, detail) {\n var hasCallback = isFunction(callback),\n value = void 0,\n error = void 0,\n succeeded = true;\n\n if (hasCallback) {\n try {\n value = callback(detail);\n } catch (e) {\n succeeded = false;\n error = e;\n }\n\n if (promise === value) {\n reject(promise, cannotReturnOwn());\n return;\n }\n } else {\n value = detail;\n }\n\n if (promise._state !== PENDING) {\n // noop\n } else if (hasCallback && succeeded) {\n resolve(promise, value);\n } else if (succeeded === false) {\n reject(promise, error);\n } else if (settled === FULFILLED) {\n fulfill(promise, value);\n } else if (settled === REJECTED) {\n reject(promise, value);\n }\n}\n\nfunction initializePromise(promise, resolver) {\n try {\n resolver(function resolvePromise(value) {\n resolve(promise, value);\n }, function rejectPromise(reason) {\n reject(promise, reason);\n });\n } catch (e) {\n reject(promise, e);\n }\n}\n\nvar id = 0;\nfunction nextId() {\n return id++;\n}\n\nfunction makePromise(promise) {\n promise[PROMISE_ID] = id++;\n promise._state = undefined;\n promise._result = undefined;\n promise._subscribers = [];\n}\n\nexport { nextId, makePromise, noop, resolve, reject, fulfill, subscribe, publish, publishRejection, initializePromise, invokeCallback, FULFILLED, REJECTED, PENDING, handleMaybeThenable };","function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nimport { isArray, isMaybeThenable } from './utils';\nimport { noop, reject, fulfill, subscribe, FULFILLED, REJECTED, PENDING, handleMaybeThenable } from './-internal';\n\nimport then from './then';\nimport Promise from './promise';\nimport originalResolve from './promise/resolve';\nimport originalThen from './then';\nimport { makePromise, PROMISE_ID } from './-internal';\n\nfunction validationError() {\n return new Error('Array Methods must be provided an Array');\n};\n\nvar Enumerator = function () {\n function Enumerator(Constructor, input) {\n this._instanceConstructor = Constructor;\n this.promise = new Constructor(noop);\n\n if (!this.promise[PROMISE_ID]) {\n makePromise(this.promise);\n }\n\n if (isArray(input)) {\n this.length = input.length;\n this._remaining = input.length;\n\n this._result = new Array(this.length);\n\n if (this.length === 0) {\n fulfill(this.promise, this._result);\n } else {\n this.length = this.length || 0;\n this._enumerate(input);\n if (this._remaining === 0) {\n fulfill(this.promise, this._result);\n }\n }\n } else {\n reject(this.promise, validationError());\n }\n }\n\n Enumerator.prototype._enumerate = function _enumerate(input) {\n for (var i = 0; this._state === PENDING && i < input.length; i++) {\n this._eachEntry(input[i], i);\n }\n };\n\n Enumerator.prototype._eachEntry = function _eachEntry(entry, i) {\n var c = this._instanceConstructor;\n var resolve = c.resolve;\n\n\n if (resolve === originalResolve) {\n var _then = void 0;\n var error = void 0;\n var didError = false;\n try {\n _then = entry.then;\n } catch (e) {\n didError = true;\n error = e;\n }\n\n if (_then === originalThen && entry._state !== PENDING) {\n this._settledAt(entry._state, i, entry._result);\n } else if (typeof _then !== 'function') {\n this._remaining--;\n this._result[i] = entry;\n } else if (c === Promise) {\n var promise = new c(noop);\n if (didError) {\n reject(promise, error);\n } else {\n handleMaybeThenable(promise, entry, _then);\n }\n this._willSettleAt(promise, i);\n } else {\n this._willSettleAt(new c(function (resolve) {\n return resolve(entry);\n }), i);\n }\n } else {\n this._willSettleAt(resolve(entry), i);\n }\n };\n\n Enumerator.prototype._settledAt = function _settledAt(state, i, value) {\n var promise = this.promise;\n\n\n if (promise._state === PENDING) {\n this._remaining--;\n\n if (state === REJECTED) {\n reject(promise, value);\n } else {\n this._result[i] = value;\n }\n }\n\n if (this._remaining === 0) {\n fulfill(promise, this._result);\n }\n };\n\n Enumerator.prototype._willSettleAt = function _willSettleAt(promise, i) {\n var enumerator = this;\n\n subscribe(promise, undefined, function (value) {\n return enumerator._settledAt(FULFILLED, i, value);\n }, function (reason) {\n return enumerator._settledAt(REJECTED, i, reason);\n });\n };\n\n return Enumerator;\n}();\n\nexport default Enumerator;\n;","import Enumerator from '../enumerator';\n\n/**\n `Promise.all` accepts an array of promises, and returns a new promise which\n is fulfilled with an array of fulfillment values for the passed promises, or\n rejected with the reason of the first passed promise to be rejected. It casts all\n elements of the passed iterable to promises as it runs this algorithm.\n\n Example:\n\n ```javascript\n let promise1 = resolve(1);\n let promise2 = resolve(2);\n let promise3 = resolve(3);\n let promises = [ promise1, promise2, promise3 ];\n\n Promise.all(promises).then(function(array){\n // The array here would be [ 1, 2, 3 ];\n });\n ```\n\n If any of the `promises` given to `all` are rejected, the first promise\n that is rejected will be given as an argument to the returned promises's\n rejection handler. For example:\n\n Example:\n\n ```javascript\n let promise1 = resolve(1);\n let promise2 = reject(new Error(\"2\"));\n let promise3 = reject(new Error(\"3\"));\n let promises = [ promise1, promise2, promise3 ];\n\n Promise.all(promises).then(function(array){\n // Code here never runs because there are rejected promises!\n }, function(error) {\n // error.message === \"2\"\n });\n ```\n\n @method all\n @static\n @param {Array} entries array of promises\n @param {String} label optional string for labeling the promise.\n Useful for tooling.\n @return {Promise} promise that is fulfilled when all `promises` have been\n fulfilled, or rejected if any of them become rejected.\n @static\n*/\nexport default function all(entries) {\n return new Enumerator(this, entries).promise;\n}","import { isArray } from \"../utils\";\n\n/**\n `Promise.race` returns a new promise which is settled in the same way as the\n first passed promise to settle.\n\n Example:\n\n ```javascript\n let promise1 = new Promise(function(resolve, reject){\n setTimeout(function(){\n resolve('promise 1');\n }, 200);\n });\n\n let promise2 = new Promise(function(resolve, reject){\n setTimeout(function(){\n resolve('promise 2');\n }, 100);\n });\n\n Promise.race([promise1, promise2]).then(function(result){\n // result === 'promise 2' because it was resolved before promise1\n // was resolved.\n });\n ```\n\n `Promise.race` is deterministic in that only the state of the first\n settled promise matters. For example, even if other promises given to the\n `promises` array argument are resolved, but the first settled promise has\n become rejected before the other promises became fulfilled, the returned\n promise will become rejected:\n\n ```javascript\n let promise1 = new Promise(function(resolve, reject){\n setTimeout(function(){\n resolve('promise 1');\n }, 200);\n });\n\n let promise2 = new Promise(function(resolve, reject){\n setTimeout(function(){\n reject(new Error('promise 2'));\n }, 100);\n });\n\n Promise.race([promise1, promise2]).then(function(result){\n // Code here never runs\n }, function(reason){\n // reason.message === 'promise 2' because promise 2 became rejected before\n // promise 1 became fulfilled\n });\n ```\n\n An example real-world use case is implementing timeouts:\n\n ```javascript\n Promise.race([ajax('foo.json'), timeout(5000)])\n ```\n\n @method race\n @static\n @param {Array} promises array of promises to observe\n Useful for tooling.\n @return {Promise} a promise which settles in the same way as the first passed\n promise to settle.\n*/\nexport default function race(entries) {\n /*jshint validthis:true */\n var Constructor = this;\n\n if (!isArray(entries)) {\n return new Constructor(function (_, reject) {\n return reject(new TypeError('You must pass an array to race.'));\n });\n } else {\n return new Constructor(function (resolve, reject) {\n var length = entries.length;\n for (var i = 0; i < length; i++) {\n Constructor.resolve(entries[i]).then(resolve, reject);\n }\n });\n }\n}","import { noop, reject as _reject } from '../-internal';\n\n/**\n `Promise.reject` returns a promise rejected with the passed `reason`.\n It is shorthand for the following:\n\n ```javascript\n let promise = new Promise(function(resolve, reject){\n reject(new Error('WHOOPS'));\n });\n\n promise.then(function(value){\n // Code here doesn't run because the promise is rejected!\n }, function(reason){\n // reason.message === 'WHOOPS'\n });\n ```\n\n Instead of writing the above, your code now simply becomes the following:\n\n ```javascript\n let promise = Promise.reject(new Error('WHOOPS'));\n\n promise.then(function(value){\n // Code here doesn't run because the promise is rejected!\n }, function(reason){\n // reason.message === 'WHOOPS'\n });\n ```\n\n @method reject\n @static\n @param {Any} reason value that the returned promise will be rejected with.\n Useful for tooling.\n @return {Promise} a promise rejected with the given `reason`.\n*/\nexport default function reject(reason) {\n /*jshint validthis:true */\n var Constructor = this;\n var promise = new Constructor(noop);\n _reject(promise, reason);\n return promise;\n}","function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nimport { isFunction } from './utils';\nimport { noop, nextId, PROMISE_ID, initializePromise } from './-internal';\nimport { asap, setAsap, setScheduler } from './asap';\n\nimport all from './promise/all';\nimport race from './promise/race';\nimport Resolve from './promise/resolve';\nimport Reject from './promise/reject';\nimport then from './then';\n\nfunction needsResolver() {\n throw new TypeError('You must pass a resolver function as the first argument to the promise constructor');\n}\n\nfunction needsNew() {\n throw new TypeError(\"Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.\");\n}\n\n/**\n Promise objects represent the eventual result of an asynchronous operation. The\n primary way of interacting with a promise is through its `then` method, which\n registers callbacks to receive either a promise's eventual value or the reason\n why the promise cannot be fulfilled.\n\n Terminology\n -----------\n\n - `promise` is an object or function with a `then` method whose behavior conforms to this specification.\n - `thenable` is an object or function that defines a `then` method.\n - `value` is any legal JavaScript value (including undefined, a thenable, or a promise).\n - `exception` is a value that is thrown using the throw statement.\n - `reason` is a value that indicates why a promise was rejected.\n - `settled` the final resting state of a promise, fulfilled or rejected.\n\n A promise can be in one of three states: pending, fulfilled, or rejected.\n\n Promises that are fulfilled have a fulfillment value and are in the fulfilled\n state. Promises that are rejected have a rejection reason and are in the\n rejected state. A fulfillment value is never a thenable.\n\n Promises can also be said to *resolve* a value. If this value is also a\n promise, then the original promise's settled state will match the value's\n settled state. So a promise that *resolves* a promise that rejects will\n itself reject, and a promise that *resolves* a promise that fulfills will\n itself fulfill.\n\n\n Basic Usage:\n ------------\n\n ```js\n let promise = new Promise(function(resolve, reject) {\n // on success\n resolve(value);\n\n // on failure\n reject(reason);\n });\n\n promise.then(function(value) {\n // on fulfillment\n }, function(reason) {\n // on rejection\n });\n ```\n\n Advanced Usage:\n ---------------\n\n Promises shine when abstracting away asynchronous interactions such as\n `XMLHttpRequest`s.\n\n ```js\n function getJSON(url) {\n return new Promise(function(resolve, reject){\n let xhr = new XMLHttpRequest();\n\n xhr.open('GET', url);\n xhr.onreadystatechange = handler;\n xhr.responseType = 'json';\n xhr.setRequestHeader('Accept', 'application/json');\n xhr.send();\n\n function handler() {\n if (this.readyState === this.DONE) {\n if (this.status === 200) {\n resolve(this.response);\n } else {\n reject(new Error('getJSON: `' + url + '` failed with status: [' + this.status + ']'));\n }\n }\n };\n });\n }\n\n getJSON('/posts.json').then(function(json) {\n // on fulfillment\n }, function(reason) {\n // on rejection\n });\n ```\n\n Unlike callbacks, promises are great composable primitives.\n\n ```js\n Promise.all([\n getJSON('/posts'),\n getJSON('/comments')\n ]).then(function(values){\n values[0] // => postsJSON\n values[1] // => commentsJSON\n\n return values;\n });\n ```\n\n @class Promise\n @param {Function} resolver\n Useful for tooling.\n @constructor\n*/\n\nvar Promise = function () {\n function Promise(resolver) {\n this[PROMISE_ID] = nextId();\n this._result = this._state = undefined;\n this._subscribers = [];\n\n if (noop !== resolver) {\n typeof resolver !== 'function' && needsResolver();\n this instanceof Promise ? initializePromise(this, resolver) : needsNew();\n }\n }\n\n /**\n The primary way of interacting with a promise is through its `then` method,\n which registers callbacks to receive either a promise's eventual value or the\n reason why the promise cannot be fulfilled.\n ```js\n findUser().then(function(user){\n // user is available\n }, function(reason){\n // user is unavailable, and you are given the reason why\n });\n ```\n Chaining\n --------\n The return value of `then` is itself a promise. This second, 'downstream'\n promise is resolved with the return value of the first promise's fulfillment\n or rejection handler, or rejected if the handler throws an exception.\n ```js\n findUser().then(function (user) {\n return user.name;\n }, function (reason) {\n return 'default name';\n }).then(function (userName) {\n // If `findUser` fulfilled, `userName` will be the user's name, otherwise it\n // will be `'default name'`\n });\n findUser().then(function (user) {\n throw new Error('Found user, but still unhappy');\n }, function (reason) {\n throw new Error('`findUser` rejected and we're unhappy');\n }).then(function (value) {\n // never reached\n }, function (reason) {\n // if `findUser` fulfilled, `reason` will be 'Found user, but still unhappy'.\n // If `findUser` rejected, `reason` will be '`findUser` rejected and we're unhappy'.\n });\n ```\n If the downstream promise does not specify a rejection handler, rejection reasons will be propagated further downstream.\n ```js\n findUser().then(function (user) {\n throw new PedagogicalException('Upstream error');\n }).then(function (value) {\n // never reached\n }).then(function (value) {\n // never reached\n }, function (reason) {\n // The `PedgagocialException` is propagated all the way down to here\n });\n ```\n Assimilation\n ------------\n Sometimes the value you want to propagate to a downstream promise can only be\n retrieved asynchronously. This can be achieved by returning a promise in the\n fulfillment or rejection handler. The downstream promise will then be pending\n until the returned promise is settled. This is called *assimilation*.\n ```js\n findUser().then(function (user) {\n return findCommentsByAuthor(user);\n }).then(function (comments) {\n // The user's comments are now available\n });\n ```\n If the assimliated promise rejects, then the downstream promise will also reject.\n ```js\n findUser().then(function (user) {\n return findCommentsByAuthor(user);\n }).then(function (comments) {\n // If `findCommentsByAuthor` fulfills, we'll have the value here\n }, function (reason) {\n // If `findCommentsByAuthor` rejects, we'll have the reason here\n });\n ```\n Simple Example\n --------------\n Synchronous Example\n ```javascript\n let result;\n try {\n result = findResult();\n // success\n } catch(reason) {\n // failure\n }\n ```\n Errback Example\n ```js\n findResult(function(result, err){\n if (err) {\n // failure\n } else {\n // success\n }\n });\n ```\n Promise Example;\n ```javascript\n findResult().then(function(result){\n // success\n }, function(reason){\n // failure\n });\n ```\n Advanced Example\n --------------\n Synchronous Example\n ```javascript\n let author, books;\n try {\n author = findAuthor();\n books = findBooksByAuthor(author);\n // success\n } catch(reason) {\n // failure\n }\n ```\n Errback Example\n ```js\n function foundBooks(books) {\n }\n function failure(reason) {\n }\n findAuthor(function(author, err){\n if (err) {\n failure(err);\n // failure\n } else {\n try {\n findBoooksByAuthor(author, function(books, err) {\n if (err) {\n failure(err);\n } else {\n try {\n foundBooks(books);\n } catch(reason) {\n failure(reason);\n }\n }\n });\n } catch(error) {\n failure(err);\n }\n // success\n }\n });\n ```\n Promise Example;\n ```javascript\n findAuthor().\n then(findBooksByAuthor).\n then(function(books){\n // found books\n }).catch(function(reason){\n // something went wrong\n });\n ```\n @method then\n @param {Function} onFulfilled\n @param {Function} onRejected\n Useful for tooling.\n @return {Promise}\n */\n\n /**\n `catch` is simply sugar for `then(undefined, onRejection)` which makes it the same\n as the catch block of a try/catch statement.\n ```js\n function findAuthor(){\n throw new Error('couldn't find that author');\n }\n // synchronous\n try {\n findAuthor();\n } catch(reason) {\n // something went wrong\n }\n // async with promises\n findAuthor().catch(function(reason){\n // something went wrong\n });\n ```\n @method catch\n @param {Function} onRejection\n Useful for tooling.\n @return {Promise}\n */\n\n\n Promise.prototype.catch = function _catch(onRejection) {\n return this.then(null, onRejection);\n };\n\n /**\n `finally` will be invoked regardless of the promise's fate just as native\n try/catch/finally behaves\n \n Synchronous example:\n \n ```js\n findAuthor() {\n if (Math.random() > 0.5) {\n throw new Error();\n }\n return new Author();\n }\n \n try {\n return findAuthor(); // succeed or fail\n } catch(error) {\n return findOtherAuther();\n } finally {\n // always runs\n // doesn't affect the return value\n }\n ```\n \n Asynchronous example:\n \n ```js\n findAuthor().catch(function(reason){\n return findOtherAuther();\n }).finally(function(){\n // author was either found, or not\n });\n ```\n \n @method finally\n @param {Function} callback\n @return {Promise}\n */\n\n\n Promise.prototype.finally = function _finally(callback) {\n var promise = this;\n var constructor = promise.constructor;\n\n if (isFunction(callback)) {\n return promise.then(function (value) {\n return constructor.resolve(callback()).then(function () {\n return value;\n });\n }, function (reason) {\n return constructor.resolve(callback()).then(function () {\n throw reason;\n });\n });\n }\n\n return promise.then(callback, callback);\n };\n\n return Promise;\n}();\n\nPromise.prototype.then = then;\nexport default Promise;\nPromise.all = all;\nPromise.race = race;\nPromise.resolve = Resolve;\nPromise.reject = Reject;\nPromise._setScheduler = setScheduler;\nPromise._setAsap = setAsap;\nPromise._asap = asap;","/*global self*/\nimport Promise from './promise';\n\nexport default function polyfill() {\n var local = void 0;\n\n if (typeof global !== 'undefined') {\n local = global;\n } else if (typeof self !== 'undefined') {\n local = self;\n } else {\n try {\n local = Function('return this')();\n } catch (e) {\n throw new Error('polyfill failed because global object is unavailable in this environment');\n }\n }\n\n var P = local.Promise;\n\n if (P) {\n var promiseToString = null;\n try {\n promiseToString = Object.prototype.toString.call(P.resolve());\n } catch (e) {\n // silently ignored\n }\n\n if (promiseToString === '[object Promise]' && !P.cast) {\n return;\n }\n }\n\n local.Promise = Promise;\n}","import Promise from './es6-promise/promise';\nimport polyfill from './es6-promise/polyfill';\n\n// Strange compat..\nPromise.polyfill = polyfill;\nPromise.Promise = Promise;\nexport default Promise;","import Promise from './es6-promise';\nPromise.polyfill();\nexport default Promise;"],"names":["resolve","_resolve","then","originalThen","originalResolve","Promise","reject","_reject","Resolve","Reject"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACNO,SAAS,gBAAgB,CAAC,CAAC,EAAE;EAClC,IAAI,IAAI,GAAG,OAAO,CAAC,CAAC;EACpB,OAAO,CAAC,KAAK,IAAI,KAAK,IAAI,KAAK,QAAQ,IAAI,IAAI,KAAK,UAAU,CAAC,CAAC;CACjE;;AAED,AAAO,SAAS,UAAU,CAAC,CAAC,EAAE;EAC5B,OAAO,OAAO,CAAC,KAAK,UAAU,CAAC;CAChC;;AAED,AAEC;;AAED,IAAI,QAAQ,GAAG,KAAK,CAAC,CAAC;AACtB,IAAI,KAAK,CAAC,OAAO,EAAE;EACjB,QAAQ,GAAG,KAAK,CAAC,OAAO,CAAC;CAC1B,MAAM;EACL,QAAQ,GAAG,UAAU,CAAC,EAAE;IACtB,OAAO,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,gBAAgB,CAAC;GAC/D,CAAC;CACH;;AAED,AAAO,IAAI,OAAO,GAAG,QAAQ;;ACtB7B,IAAI,GAAG,GAAG,CAAC,CAAC;AACZ,IAAI,SAAS,GAAG,KAAK,CAAC,CAAC;AACvB,IAAI,iBAAiB,GAAG,KAAK,CAAC,CAAC;;AAE/B,AAAO,IAAI,IAAI,GAAG,SAAS,IAAI,CAAC,QAAQ,EAAE,GAAG,EAAE;EAC7C,KAAK,CAAC,GAAG,CAAC,GAAG,QAAQ,CAAC;EACtB,KAAK,CAAC,GAAG,GAAG,CAAC,CAAC,GAAG,GAAG,CAAC;EACrB,GAAG,IAAI,CAAC,CAAC;EACT,IAAI,GAAG,KAAK,CAAC,EAAE;;;;IAIb,IAAI,iBAAiB,EAAE;MACrB,iBAAiB,CAAC,KAAK,CAAC,CAAC;KAC1B,MAAM;MACL,aAAa,EAAE,CAAC;KACjB;GACF;CACF,CAAC;;AAEF,AAAO,SAAS,YAAY,CAAC,UAAU,EAAE;EACvC,iBAAiB,GAAG,UAAU,CAAC;CAChC;;AAED,AAAO,SAAS,OAAO,CAAC,MAAM,EAAE;EAC9B,IAAI,GAAG,MAAM,CAAC;CACf;;AAED,IAAI,aAAa,GAAG,OAAO,MAAM,KAAK,WAAW,GAAG,MAAM,GAAG,SAAS,CAAC;AACvE,IAAI,aAAa,GAAG,aAAa,IAAI,EAAE,CAAC;AACxC,IAAI,uBAAuB,GAAG,aAAa,CAAC,gBAAgB,IAAI,aAAa,CAAC,sBAAsB,CAAC;AACrG,IAAI,MAAM,GAAG,OAAO,IAAI,KAAK,WAAW,IAAI,OAAO,OAAO,KAAK,WAAW,IAAI,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,kBAAkB,CAAC;;;AAG/H,IAAI,QAAQ,GAAG,OAAO,iBAAiB,KAAK,WAAW,IAAI,OAAO,aAAa,KAAK,WAAW,IAAI,OAAO,cAAc,KAAK,WAAW,CAAC;;;AAGzI,SAAS,WAAW,GAAG;;;EAGrB,OAAO,YAAY;IACjB,OAAO,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;GAChC,CAAC;CACH;;;AAGD,SAAS,aAAa,GAAG;EACvB,IAAI,OAAO,SAAS,KAAK,WAAW,EAAE;IACpC,OAAO,YAAY;MACjB,SAAS,CAAC,KAAK,CAAC,CAAC;KAClB,CAAC;GACH;;EAED,OAAO,aAAa,EAAE,CAAC;CACxB;;AAED,SAAS,mBAAmB,GAAG;EAC7B,IAAI,UAAU,GAAG,CAAC,CAAC;EACnB,IAAI,QAAQ,GAAG,IAAI,uBAAuB,CAAC,KAAK,CAAC,CAAC;EAClD,IAAI,IAAI,GAAG,QAAQ,CAAC,cAAc,CAAC,EAAE,CAAC,CAAC;EACvC,QAAQ,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,aAAa,EAAE,IAAI,EAAE,CAAC,CAAC;;EAEhD,OAAO,YAAY;IACjB,IAAI,CAAC,IAAI,GAAG,UAAU,GAAG,EAAE,UAAU,GAAG,CAAC,CAAC;GAC3C,CAAC;CACH;;;AAGD,SAAS,iBAAiB,GAAG;EAC3B,IAAI,OAAO,GAAG,IAAI,cAAc,EAAE,CAAC;EACnC,OAAO,CAAC,KAAK,CAAC,SAAS,GAAG,KAAK,CAAC;EAChC,OAAO,YAAY;IACjB,OAAO,OAAO,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;GACrC,CAAC;CACH;;AAED,SAAS,aAAa,GAAG;;;EAGvB,IAAI,gBAAgB,GAAG,UAAU,CAAC;EAClC,OAAO,YAAY;IACjB,OAAO,gBAAgB,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;GACnC,CAAC;CACH;;AAED,IAAI,KAAK,GAAG,IAAI,KAAK,CAAC,IAAI,CAAC,CAAC;AAC5B,SAAS,KAAK,GAAG;EACf,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,GAAG,EAAE,CAAC,IAAI,CAAC,EAAE;IAC/B,IAAI,QAAQ,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;IACxB,IAAI,GAAG,GAAG,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;;IAEvB,QAAQ,CAAC,GAAG,CAAC,CAAC;;IAEd,KAAK,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC;IACrB,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,SAAS,CAAC;GAC1B;;EAED,GAAG,GAAG,CAAC,CAAC;CACT;;AAED,SAAS,YAAY,GAAG;EACtB,IAAI;IACF,IAAI,KAAK,GAAG,QAAQ,CAAC,aAAa,CAAC,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;IACvD,SAAS,GAAG,KAAK,CAAC,SAAS,IAAI,KAAK,CAAC,YAAY,CAAC;IAClD,OAAO,aAAa,EAAE,CAAC;GACxB,CAAC,OAAO,CAAC,EAAE;IACV,OAAO,aAAa,EAAE,CAAC;GACxB;CACF;;AAED,IAAI,aAAa,GAAG,KAAK,CAAC,CAAC;;AAE3B,IAAI,MAAM,EAAE;EACV,aAAa,GAAG,WAAW,EAAE,CAAC;CAC/B,MAAM,IAAI,uBAAuB,EAAE;EAClC,aAAa,GAAG,mBAAmB,EAAE,CAAC;CACvC,MAAM,IAAI,QAAQ,EAAE;EACnB,aAAa,GAAG,iBAAiB,EAAE,CAAC;CACrC,MAAM,IAAI,aAAa,KAAK,SAAS,IAAI,OAAO,OAAO,KAAK,UAAU,EAAE;EACvE,aAAa,GAAG,YAAY,EAAE,CAAC;CAChC,MAAM;EACL,aAAa,GAAG,aAAa,EAAE,CAAC;;;CACjC,DCtHc,SAAS,IAAI,CAAC,aAAa,EAAE,WAAW,EAAE;EACvD,IAAI,MAAM,GAAG,IAAI,CAAC;;EAElB,IAAI,KAAK,GAAG,IAAI,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;;EAEvC,IAAI,KAAK,CAAC,UAAU,CAAC,KAAK,SAAS,EAAE;IACnC,WAAW,CAAC,KAAK,CAAC,CAAC;GACpB;;EAED,IAAI,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;;;EAG3B,IAAI,MAAM,EAAE;IACV,IAAI,QAAQ,GAAG,SAAS,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;IACrC,IAAI,CAAC,YAAY;MACf,OAAO,cAAc,CAAC,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC;KAChE,CAAC,CAAC;GACJ,MAAM;IACL,SAAS,CAAC,MAAM,EAAE,KAAK,EAAE,aAAa,EAAE,WAAW,CAAC,CAAC;GACtD;;EAED,OAAO,KAAK,CAAC;;;CACd,DCxBD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+BA,AAAe,SAASA,SAAO,CAAC,MAAM,EAAE;;EAEtC,IAAI,WAAW,GAAG,IAAI,CAAC;;EAEvB,IAAI,MAAM,IAAI,OAAO,MAAM,KAAK,QAAQ,IAAI,MAAM,CAAC,WAAW,KAAK,WAAW,EAAE;IAC9E,OAAO,MAAM,CAAC;GACf;;EAED,IAAI,OAAO,GAAG,IAAI,WAAW,CAAC,IAAI,CAAC,CAAC;EACpCC,OAAQ,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;EAC1B,OAAO,OAAO,CAAC;;;CAChB,DCrCM,IAAI,UAAU,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;;AAEhE,SAAS,IAAI,GAAG,EAAE;;AAElB,IAAI,OAAO,GAAG,KAAK,CAAC,CAAC;AACrB,IAAI,SAAS,GAAG,CAAC,CAAC;AAClB,IAAI,QAAQ,GAAG,CAAC,CAAC;;AAEjB,SAAS,eAAe,GAAG;EACzB,OAAO,IAAI,SAAS,CAAC,0CAA0C,CAAC,CAAC;CAClE;;AAED,SAAS,eAAe,GAAG;EACzB,OAAO,IAAI,SAAS,CAAC,sDAAsD,CAAC,CAAC;CAC9E;;AAED,SAAS,OAAO,CAACC,OAAI,EAAE,KAAK,EAAE,kBAAkB,EAAE,gBAAgB,EAAE;EAClE,IAAI;IACFA,OAAI,CAAC,IAAI,CAAC,KAAK,EAAE,kBAAkB,EAAE,gBAAgB,CAAC,CAAC;GACxD,CAAC,OAAO,CAAC,EAAE;IACV,OAAO,CAAC,CAAC;GACV;CACF;;AAED,SAAS,qBAAqB,CAAC,OAAO,EAAE,QAAQ,EAAEA,OAAI,EAAE;EACtD,IAAI,CAAC,UAAU,OAAO,EAAE;IACtB,IAAI,MAAM,GAAG,KAAK,CAAC;IACnB,IAAI,KAAK,GAAG,OAAO,CAACA,OAAI,EAAE,QAAQ,EAAE,UAAU,KAAK,EAAE;MACnD,IAAI,MAAM,EAAE;QACV,OAAO;OACR;MACD,MAAM,GAAG,IAAI,CAAC;MACd,IAAI,QAAQ,KAAK,KAAK,EAAE;QACtB,OAAO,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;OACzB,MAAM;QACL,OAAO,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;OACzB;KACF,EAAE,UAAU,MAAM,EAAE;MACnB,IAAI,MAAM,EAAE;QACV,OAAO;OACR;MACD,MAAM,GAAG,IAAI,CAAC;;MAEd,MAAM,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;KACzB,EAAE,UAAU,IAAI,OAAO,CAAC,MAAM,IAAI,kBAAkB,CAAC,CAAC,CAAC;;IAExD,IAAI,CAAC,MAAM,IAAI,KAAK,EAAE;MACpB,MAAM,GAAG,IAAI,CAAC;MACd,MAAM,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;KACxB;GACF,EAAE,OAAO,CAAC,CAAC;CACb;;AAED,SAAS,iBAAiB,CAAC,OAAO,EAAE,QAAQ,EAAE;EAC5C,IAAI,QAAQ,CAAC,MAAM,KAAK,SAAS,EAAE;IACjC,OAAO,CAAC,OAAO,EAAE,QAAQ,CAAC,OAAO,CAAC,CAAC;GACpC,MAAM,IAAI,QAAQ,CAAC,MAAM,KAAK,QAAQ,EAAE;IACvC,MAAM,CAAC,OAAO,EAAE,QAAQ,CAAC,OAAO,CAAC,CAAC;GACnC,MAAM;IACL,SAAS,CAAC,QAAQ,EAAE,SAAS,EAAE,UAAU,KAAK,EAAE;MAC9C,OAAO,OAAO,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;KAChC,EAAE,UAAU,MAAM,EAAE;MACnB,OAAO,MAAM,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;KAChC,CAAC,CAAC;GACJ;CACF;;AAED,SAAS,mBAAmB,CAAC,OAAO,EAAE,aAAa,EAAEA,OAAI,EAAE;EACzD,IAAI,aAAa,CAAC,WAAW,KAAK,OAAO,CAAC,WAAW,IAAIA,OAAI,KAAKC,IAAY,IAAI,aAAa,CAAC,WAAW,CAAC,OAAO,KAAKC,SAAe,EAAE;IACvI,iBAAiB,CAAC,OAAO,EAAE,aAAa,CAAC,CAAC;GAC3C,MAAM;IACL,IAAIF,OAAI,KAAK,SAAS,EAAE;MACtB,OAAO,CAAC,OAAO,EAAE,aAAa,CAAC,CAAC;KACjC,MAAM,IAAI,UAAU,CAACA,OAAI,CAAC,EAAE;MAC3B,qBAAqB,CAAC,OAAO,EAAE,aAAa,EAAEA,OAAI,CAAC,CAAC;KACrD,MAAM;MACL,OAAO,CAAC,OAAO,EAAE,aAAa,CAAC,CAAC;KACjC;GACF;CACF;;AAED,SAAS,OAAO,CAAC,OAAO,EAAE,KAAK,EAAE;EAC/B,IAAI,OAAO,KAAK,KAAK,EAAE;IACrB,MAAM,CAAC,OAAO,EAAE,eAAe,EAAE,CAAC,CAAC;GACpC,MAAM,IAAI,gBAAgB,CAAC,KAAK,CAAC,EAAE;IAClC,IAAIA,OAAI,GAAG,KAAK,CAAC,CAAC;IAClB,IAAI;MACFA,OAAI,GAAG,KAAK,CAAC,IAAI,CAAC;KACnB,CAAC,OAAO,KAAK,EAAE;MACd,MAAM,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;MACvB,OAAO;KACR;IACD,mBAAmB,CAAC,OAAO,EAAE,KAAK,EAAEA,OAAI,CAAC,CAAC;GAC3C,MAAM;IACL,OAAO,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;GACzB;CACF;;AAED,SAAS,gBAAgB,CAAC,OAAO,EAAE;EACjC,IAAI,OAAO,CAAC,QAAQ,EAAE;IACpB,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;GACnC;;EAED,OAAO,CAAC,OAAO,CAAC,CAAC;CAClB;;AAED,SAAS,OAAO,CAAC,OAAO,EAAE,KAAK,EAAE;EAC/B,IAAI,OAAO,CAAC,MAAM,KAAK,OAAO,EAAE;IAC9B,OAAO;GACR;;EAED,OAAO,CAAC,OAAO,GAAG,KAAK,CAAC;EACxB,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC;;EAE3B,IAAI,OAAO,CAAC,YAAY,CAAC,MAAM,KAAK,CAAC,EAAE;IACrC,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;GACxB;CACF;;AAED,SAAS,MAAM,CAAC,OAAO,EAAE,MAAM,EAAE;EAC/B,IAAI,OAAO,CAAC,MAAM,KAAK,OAAO,EAAE;IAC9B,OAAO;GACR;EACD,OAAO,CAAC,MAAM,GAAG,QAAQ,CAAC;EAC1B,OAAO,CAAC,OAAO,GAAG,MAAM,CAAC;;EAEzB,IAAI,CAAC,gBAAgB,EAAE,OAAO,CAAC,CAAC;CACjC;;AAED,SAAS,SAAS,CAAC,MAAM,EAAE,KAAK,EAAE,aAAa,EAAE,WAAW,EAAE;EAC5D,IAAI,YAAY,GAAG,MAAM,CAAC,YAAY,CAAC;EACvC,IAAI,MAAM,GAAG,YAAY,CAAC,MAAM,CAAC;;;EAGjC,MAAM,CAAC,QAAQ,GAAG,IAAI,CAAC;;EAEvB,YAAY,CAAC,MAAM,CAAC,GAAG,KAAK,CAAC;EAC7B,YAAY,CAAC,MAAM,GAAG,SAAS,CAAC,GAAG,aAAa,CAAC;EACjD,YAAY,CAAC,MAAM,GAAG,QAAQ,CAAC,GAAG,WAAW,CAAC;;EAE9C,IAAI,MAAM,KAAK,CAAC,IAAI,MAAM,CAAC,MAAM,EAAE;IACjC,IAAI,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;GACvB;CACF;;AAED,SAAS,OAAO,CAAC,OAAO,EAAE;EACxB,IAAI,WAAW,GAAG,OAAO,CAAC,YAAY,CAAC;EACvC,IAAI,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC;;EAE7B,IAAI,WAAW,CAAC,MAAM,KAAK,CAAC,EAAE;IAC5B,OAAO;GACR;;EAED,IAAI,KAAK,GAAG,KAAK,CAAC;MACd,QAAQ,GAAG,KAAK,CAAC;MACjB,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;;EAE7B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,WAAW,CAAC,MAAM,EAAE,CAAC,IAAI,CAAC,EAAE;IAC9C,KAAK,GAAG,WAAW,CAAC,CAAC,CAAC,CAAC;IACvB,QAAQ,GAAG,WAAW,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC;;IAEpC,IAAI,KAAK,EAAE;MACT,cAAc,CAAC,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC;KAClD,MAAM;MACL,QAAQ,CAAC,MAAM,CAAC,CAAC;KAClB;GACF;;EAED,OAAO,CAAC,YAAY,CAAC,MAAM,GAAG,CAAC,CAAC;CACjC;;AAED,SAAS,cAAc,CAAC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE;EAC1D,IAAI,WAAW,GAAG,UAAU,CAAC,QAAQ,CAAC;MAClC,KAAK,GAAG,KAAK,CAAC;MACd,KAAK,GAAG,KAAK,CAAC;MACd,SAAS,GAAG,IAAI,CAAC;;EAErB,IAAI,WAAW,EAAE;IACf,IAAI;MACF,KAAK,GAAG,QAAQ,CAAC,MAAM,CAAC,CAAC;KAC1B,CAAC,OAAO,CAAC,EAAE;MACV,SAAS,GAAG,KAAK,CAAC;MAClB,KAAK,GAAG,CAAC,CAAC;KACX;;IAED,IAAI,OAAO,KAAK,KAAK,EAAE;MACrB,MAAM,CAAC,OAAO,EAAE,eAAe,EAAE,CAAC,CAAC;MACnC,OAAO;KACR;GACF,MAAM;IACL,KAAK,GAAG,MAAM,CAAC;GAChB;;EAED,IAAI,OAAO,CAAC,MAAM,KAAK,OAAO,EAAE;;GAE/B,MAAM,IAAI,WAAW,IAAI,SAAS,EAAE;IACnC,OAAO,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;GACzB,MAAM,IAAI,SAAS,KAAK,KAAK,EAAE;IAC9B,MAAM,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;GACxB,MAAM,IAAI,OAAO,KAAK,SAAS,EAAE;IAChC,OAAO,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;GACzB,MAAM,IAAI,OAAO,KAAK,QAAQ,EAAE;IAC/B,MAAM,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;GACxB;CACF;;AAED,SAAS,iBAAiB,CAAC,OAAO,EAAE,QAAQ,EAAE;EAC5C,IAAI;IACF,QAAQ,CAAC,SAAS,cAAc,CAAC,KAAK,EAAE;MACtC,OAAO,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;KACzB,EAAE,SAAS,aAAa,CAAC,MAAM,EAAE;MAChC,MAAM,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;KACzB,CAAC,CAAC;GACJ,CAAC,OAAO,CAAC,EAAE;IACV,MAAM,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC;GACpB;CACF;;AAED,IAAI,EAAE,GAAG,CAAC,CAAC;AACX,SAAS,MAAM,GAAG;EAChB,OAAO,EAAE,EAAE,CAAC;CACb;;AAED,SAAS,WAAW,CAAC,OAAO,EAAE;EAC5B,OAAO,CAAC,UAAU,CAAC,GAAG,EAAE,EAAE,CAAC;EAC3B,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC;EAC3B,OAAO,CAAC,OAAO,GAAG,SAAS,CAAC;EAC5B,OAAO,CAAC,YAAY,GAAG,EAAE,CAAC;CAC3B;;AChOD,SAAS,eAAe,GAAG;EACzB,OAAO,IAAI,KAAK,CAAC,yCAAyC,CAAC,CAAC;CAC7D,AAAC;;AAEF,IAAI,UAAU,GAAG,YAAY;EAC3B,SAAS,UAAU,CAAC,WAAW,EAAE,KAAK,EAAE;IACtC,IAAI,CAAC,oBAAoB,GAAG,WAAW,CAAC;IACxC,IAAI,CAAC,OAAO,GAAG,IAAI,WAAW,CAAC,IAAI,CAAC,CAAC;;IAErC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,EAAE;MAC7B,WAAW,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;KAC3B;;IAED,IAAI,OAAO,CAAC,KAAK,CAAC,EAAE;MAClB,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC;MAC3B,IAAI,CAAC,UAAU,GAAG,KAAK,CAAC,MAAM,CAAC;;MAE/B,IAAI,CAAC,OAAO,GAAG,IAAI,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;;MAEtC,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,EAAE;QACrB,OAAO,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;OACrC,MAAM;QACL,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,IAAI,CAAC,CAAC;QAC/B,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;QACvB,IAAI,IAAI,CAAC,UAAU,KAAK,CAAC,EAAE;UACzB,OAAO,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;SACrC;OACF;KACF,MAAM;MACL,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,eAAe,EAAE,CAAC,CAAC;KACzC;GACF;;EAED,UAAU,CAAC,SAAS,CAAC,UAAU,GAAG,SAAS,UAAU,CAAC,KAAK,EAAE;IAC3D,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,IAAI,CAAC,MAAM,KAAK,OAAO,IAAI,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;MAChE,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;KAC9B;GACF,CAAC;;EAEF,UAAU,CAAC,SAAS,CAAC,UAAU,GAAG,SAAS,UAAU,CAAC,KAAK,EAAE,CAAC,EAAE;IAC9D,IAAI,CAAC,GAAG,IAAI,CAAC,oBAAoB,CAAC;IAClC,IAAIF,UAAO,GAAG,CAAC,CAAC,OAAO,CAAC;;;IAGxB,IAAIA,UAAO,KAAKI,SAAe,EAAE;MAC/B,IAAI,KAAK,GAAG,KAAK,CAAC,CAAC;MACnB,IAAI,KAAK,GAAG,KAAK,CAAC,CAAC;MACnB,IAAI,QAAQ,GAAG,KAAK,CAAC;MACrB,IAAI;QACF,KAAK,GAAG,KAAK,CAAC,IAAI,CAAC;OACpB,CAAC,OAAO,CAAC,EAAE;QACV,QAAQ,GAAG,IAAI,CAAC;QAChB,KAAK,GAAG,CAAC,CAAC;OACX;;MAED,IAAI,KAAK,KAAKD,IAAY,IAAI,KAAK,CAAC,MAAM,KAAK,OAAO,EAAE;QACtD,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC;OACjD,MAAM,IAAI,OAAO,KAAK,KAAK,UAAU,EAAE;QACtC,IAAI,CAAC,UAAU,EAAE,CAAC;QAClB,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC;OACzB,MAAM,IAAI,CAAC,KAAKE,SAAO,EAAE;QACxB,IAAI,OAAO,GAAG,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC;QAC1B,IAAI,QAAQ,EAAE;UACZ,MAAM,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;SACxB,MAAM;UACL,mBAAmB,CAAC,OAAO,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;SAC5C;QACD,IAAI,CAAC,aAAa,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC;OAChC,MAAM;QACL,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC,UAAUL,UAAO,EAAE;UAC1C,OAAOA,UAAO,CAAC,KAAK,CAAC,CAAC;SACvB,CAAC,EAAE,CAAC,CAAC,CAAC;OACR;KACF,MAAM;MACL,IAAI,CAAC,aAAa,CAACA,UAAO,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC;KACvC;GACF,CAAC;;EAEF,UAAU,CAAC,SAAS,CAAC,UAAU,GAAG,SAAS,UAAU,CAAC,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE;IACrE,IAAI,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC;;;IAG3B,IAAI,OAAO,CAAC,MAAM,KAAK,OAAO,EAAE;MAC9B,IAAI,CAAC,UAAU,EAAE,CAAC;;MAElB,IAAI,KAAK,KAAK,QAAQ,EAAE;QACtB,MAAM,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;OACxB,MAAM;QACL,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC;OACzB;KACF;;IAED,IAAI,IAAI,CAAC,UAAU,KAAK,CAAC,EAAE;MACzB,OAAO,CAAC,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;KAChC;GACF,CAAC;;EAEF,UAAU,CAAC,SAAS,CAAC,aAAa,GAAG,SAAS,aAAa,CAAC,OAAO,EAAE,CAAC,EAAE;IACtE,IAAI,UAAU,GAAG,IAAI,CAAC;;IAEtB,SAAS,CAAC,OAAO,EAAE,SAAS,EAAE,UAAU,KAAK,EAAE;MAC7C,OAAO,UAAU,CAAC,UAAU,CAAC,SAAS,EAAE,CAAC,EAAE,KAAK,CAAC,CAAC;KACnD,EAAE,UAAU,MAAM,EAAE;MACnB,OAAO,UAAU,CAAC,UAAU,CAAC,QAAQ,EAAE,CAAC,EAAE,MAAM,CAAC,CAAC;KACnD,CAAC,CAAC;GACJ,CAAC;;EAEF,OAAO,UAAU,CAAC;CACnB,EAAE;;ACrHH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+CA,AAAe,SAAS,GAAG,CAAC,OAAO,EAAE;EACnC,OAAO,IAAI,UAAU,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC,OAAO,CAAC;;;CAC9C,DCjDD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiEA,AAAe,SAAS,IAAI,CAAC,OAAO,EAAE;;EAEpC,IAAI,WAAW,GAAG,IAAI,CAAC;;EAEvB,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE;IACrB,OAAO,IAAI,WAAW,CAAC,UAAU,CAAC,EAAE,MAAM,EAAE;MAC1C,OAAO,MAAM,CAAC,IAAI,SAAS,CAAC,iCAAiC,CAAC,CAAC,CAAC;KACjE,CAAC,CAAC;GACJ,MAAM;IACL,OAAO,IAAI,WAAW,CAAC,UAAU,OAAO,EAAE,MAAM,EAAE;MAChD,IAAI,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;MAC5B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,EAAE,CAAC,EAAE,EAAE;QAC/B,WAAW,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;OACvD;KACF,CAAC,CAAC;GACJ;;;CACF,DCjFD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkCA,AAAe,SAASM,QAAM,CAAC,MAAM,EAAE;;EAErC,IAAI,WAAW,GAAG,IAAI,CAAC;EACvB,IAAI,OAAO,GAAG,IAAI,WAAW,CAAC,IAAI,CAAC,CAAC;EACpCC,MAAO,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;EACzB,OAAO,OAAO,CAAC;;;CAChB,DC9BD,SAAS,aAAa,GAAG;EACvB,MAAM,IAAI,SAAS,CAAC,oFAAoF,CAAC,CAAC;CAC3G;;AAED,SAAS,QAAQ,GAAG;EAClB,MAAM,IAAI,SAAS,CAAC,uHAAuH,CAAC,CAAC;CAC9I;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0GD,IAAIF,SAAO,GAAG,YAAY;EACxB,SAAS,OAAO,CAAC,QAAQ,EAAE;IACzB,IAAI,CAAC,UAAU,CAAC,GAAG,MAAM,EAAE,CAAC;IAC5B,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,MAAM,GAAG,SAAS,CAAC;IACvC,IAAI,CAAC,YAAY,GAAG,EAAE,CAAC;;IAEvB,IAAI,IAAI,KAAK,QAAQ,EAAE;MACrB,OAAO,QAAQ,KAAK,UAAU,IAAI,aAAa,EAAE,CAAC;MAClD,IAAI,YAAY,OAAO,GAAG,iBAAiB,CAAC,IAAI,EAAE,QAAQ,CAAC,GAAG,QAAQ,EAAE,CAAC;KAC1E;GACF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA4LD,OAAO,CAAC,SAAS,CAAC,KAAK,GAAG,SAAS,MAAM,CAAC,WAAW,EAAE;IACrD,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,WAAW,CAAC,CAAC;GACrC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA0CF,OAAO,CAAC,SAAS,CAAC,OAAO,GAAG,SAAS,QAAQ,CAAC,QAAQ,EAAE;IACtD,IAAI,OAAO,GAAG,IAAI,CAAC;IACnB,IAAI,WAAW,GAAG,OAAO,CAAC,WAAW,CAAC;;IAEtC,IAAI,UAAU,CAAC,QAAQ,CAAC,EAAE;MACxB,OAAO,OAAO,CAAC,IAAI,CAAC,UAAU,KAAK,EAAE;QACnC,OAAO,WAAW,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAC,IAAI,CAAC,YAAY;UACtD,OAAO,KAAK,CAAC;SACd,CAAC,CAAC;OACJ,EAAE,UAAU,MAAM,EAAE;QACnB,OAAO,WAAW,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAC,IAAI,CAAC,YAAY;UACtD,MAAM,MAAM,CAAC;SACd,CAAC,CAAC;OACJ,CAAC,CAAC;KACJ;;IAED,OAAO,OAAO,CAAC,IAAI,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;GACzC,CAAC;;EAEF,OAAO,OAAO,CAAC;CAChB,EAAE,CAAC;;AAEJA,SAAO,CAAC,SAAS,CAAC,IAAI,GAAG,IAAI,CAAC;AAC9B,AACAA,SAAO,CAAC,GAAG,GAAG,GAAG,CAAC;AAClBA,SAAO,CAAC,IAAI,GAAG,IAAI,CAAC;AACpBA,SAAO,CAAC,OAAO,GAAGG,SAAO,CAAC;AAC1BH,SAAO,CAAC,MAAM,GAAGI,QAAM,CAAC;AACxBJ,SAAO,CAAC,aAAa,GAAG,YAAY,CAAC;AACrCA,SAAO,CAAC,QAAQ,GAAG,OAAO,CAAC;AAC3BA,SAAO,CAAC,KAAK,GAAG,IAAI;;AC5YpB;AACA,AAEe,SAAS,QAAQ,GAAG;EACjC,IAAI,KAAK,GAAG,KAAK,CAAC,CAAC;;EAEnB,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE;IACjC,KAAK,GAAG,MAAM,CAAC;GAChB,MAAM,IAAI,OAAO,IAAI,KAAK,WAAW,EAAE;IACtC,KAAK,GAAG,IAAI,CAAC;GACd,MAAM;IACL,IAAI;MACF,KAAK,GAAG,QAAQ,CAAC,aAAa,CAAC,EAAE,CAAC;KACnC,CAAC,OAAO,CAAC,EAAE;MACV,MAAM,IAAI,KAAK,CAAC,0EAA0E,CAAC,CAAC;KAC7F;GACF;;EAED,IAAI,CAAC,GAAG,KAAK,CAAC,OAAO,CAAC;;EAEtB,IAAI,CAAC,EAAE;IACL,IAAI,eAAe,GAAG,IAAI,CAAC;IAC3B,IAAI;MACF,eAAe,GAAG,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC;KAC/D,CAAC,OAAO,CAAC,EAAE;;KAEX;;IAED,IAAI,eAAe,KAAK,kBAAkB,IAAI,CAAC,CAAC,CAAC,IAAI,EAAE;MACrD,OAAO;KACR;GACF;;EAED,KAAK,CAAC,OAAO,GAAGA,SAAO,CAAC;;;CACzB,DC/BD;AACAA,SAAO,CAAC,QAAQ,GAAG,QAAQ,CAAC;AAC5BA,SAAO,CAAC,OAAO,GAAGA,SAAO,CAAC;;ACJ1BA,SAAO,CAAC,QAAQ,EAAE,CAAC;;;;;;;;","file":"es6-promise.auto.js"} \ No newline at end of file diff --git a/deps/npm/node_modules/es6-promise/dist/es6-promise.auto.min.js b/deps/npm/node_modules/es6-promise/dist/es6-promise.auto.min.js deleted file mode 100644 index 5a44a3b086e844..00000000000000 --- a/deps/npm/node_modules/es6-promise/dist/es6-promise.auto.min.js +++ /dev/null @@ -1 +0,0 @@ -!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.ES6Promise=e()}(this,function(){"use strict";function t(t){var e=typeof t;return null!==t&&("object"===e||"function"===e)}function e(t){return"function"==typeof t}function n(t){W=t}function r(t){z=t}function o(){return function(){return process.nextTick(a)}}function i(){return"undefined"!=typeof U?function(){U(a)}:c()}function s(){var t=0,e=new H(a),n=document.createTextNode("");return e.observe(n,{characterData:!0}),function(){n.data=t=++t%2}}function u(){var t=new MessageChannel;return t.port1.onmessage=a,function(){return t.port2.postMessage(0)}}function c(){var t=setTimeout;return function(){return t(a,1)}}function a(){for(var t=0;t postsJSON\n values[1] // => commentsJSON\n\n return values;\n });\n ```\n\n @class Promise\n @param {Function} resolver\n Useful for tooling.\n @constructor\n*/\n\nvar Promise = function () {\n function Promise(resolver) {\n this[PROMISE_ID] = nextId();\n this._result = this._state = undefined;\n this._subscribers = [];\n\n if (noop !== resolver) {\n typeof resolver !== 'function' && needsResolver();\n this instanceof Promise ? initializePromise(this, resolver) : needsNew();\n }\n }\n\n /**\n The primary way of interacting with a promise is through its `then` method,\n which registers callbacks to receive either a promise's eventual value or the\n reason why the promise cannot be fulfilled.\n ```js\n findUser().then(function(user){\n // user is available\n }, function(reason){\n // user is unavailable, and you are given the reason why\n });\n ```\n Chaining\n --------\n The return value of `then` is itself a promise. This second, 'downstream'\n promise is resolved with the return value of the first promise's fulfillment\n or rejection handler, or rejected if the handler throws an exception.\n ```js\n findUser().then(function (user) {\n return user.name;\n }, function (reason) {\n return 'default name';\n }).then(function (userName) {\n // If `findUser` fulfilled, `userName` will be the user's name, otherwise it\n // will be `'default name'`\n });\n findUser().then(function (user) {\n throw new Error('Found user, but still unhappy');\n }, function (reason) {\n throw new Error('`findUser` rejected and we're unhappy');\n }).then(function (value) {\n // never reached\n }, function (reason) {\n // if `findUser` fulfilled, `reason` will be 'Found user, but still unhappy'.\n // If `findUser` rejected, `reason` will be '`findUser` rejected and we're unhappy'.\n });\n ```\n If the downstream promise does not specify a rejection handler, rejection reasons will be propagated further downstream.\n ```js\n findUser().then(function (user) {\n throw new PedagogicalException('Upstream error');\n }).then(function (value) {\n // never reached\n }).then(function (value) {\n // never reached\n }, function (reason) {\n // The `PedgagocialException` is propagated all the way down to here\n });\n ```\n Assimilation\n ------------\n Sometimes the value you want to propagate to a downstream promise can only be\n retrieved asynchronously. This can be achieved by returning a promise in the\n fulfillment or rejection handler. The downstream promise will then be pending\n until the returned promise is settled. This is called *assimilation*.\n ```js\n findUser().then(function (user) {\n return findCommentsByAuthor(user);\n }).then(function (comments) {\n // The user's comments are now available\n });\n ```\n If the assimliated promise rejects, then the downstream promise will also reject.\n ```js\n findUser().then(function (user) {\n return findCommentsByAuthor(user);\n }).then(function (comments) {\n // If `findCommentsByAuthor` fulfills, we'll have the value here\n }, function (reason) {\n // If `findCommentsByAuthor` rejects, we'll have the reason here\n });\n ```\n Simple Example\n --------------\n Synchronous Example\n ```javascript\n let result;\n try {\n result = findResult();\n // success\n } catch(reason) {\n // failure\n }\n ```\n Errback Example\n ```js\n findResult(function(result, err){\n if (err) {\n // failure\n } else {\n // success\n }\n });\n ```\n Promise Example;\n ```javascript\n findResult().then(function(result){\n // success\n }, function(reason){\n // failure\n });\n ```\n Advanced Example\n --------------\n Synchronous Example\n ```javascript\n let author, books;\n try {\n author = findAuthor();\n books = findBooksByAuthor(author);\n // success\n } catch(reason) {\n // failure\n }\n ```\n Errback Example\n ```js\n function foundBooks(books) {\n }\n function failure(reason) {\n }\n findAuthor(function(author, err){\n if (err) {\n failure(err);\n // failure\n } else {\n try {\n findBoooksByAuthor(author, function(books, err) {\n if (err) {\n failure(err);\n } else {\n try {\n foundBooks(books);\n } catch(reason) {\n failure(reason);\n }\n }\n });\n } catch(error) {\n failure(err);\n }\n // success\n }\n });\n ```\n Promise Example;\n ```javascript\n findAuthor().\n then(findBooksByAuthor).\n then(function(books){\n // found books\n }).catch(function(reason){\n // something went wrong\n });\n ```\n @method then\n @param {Function} onFulfilled\n @param {Function} onRejected\n Useful for tooling.\n @return {Promise}\n */\n\n /**\n `catch` is simply sugar for `then(undefined, onRejection)` which makes it the same\n as the catch block of a try/catch statement.\n ```js\n function findAuthor(){\n throw new Error('couldn't find that author');\n }\n // synchronous\n try {\n findAuthor();\n } catch(reason) {\n // something went wrong\n }\n // async with promises\n findAuthor().catch(function(reason){\n // something went wrong\n });\n ```\n @method catch\n @param {Function} onRejection\n Useful for tooling.\n @return {Promise}\n */\n\n\n Promise.prototype.catch = function _catch(onRejection) {\n return this.then(null, onRejection);\n };\n\n /**\n `finally` will be invoked regardless of the promise's fate just as native\n try/catch/finally behaves\n \n Synchronous example:\n \n ```js\n findAuthor() {\n if (Math.random() > 0.5) {\n throw new Error();\n }\n return new Author();\n }\n \n try {\n return findAuthor(); // succeed or fail\n } catch(error) {\n return findOtherAuther();\n } finally {\n // always runs\n // doesn't affect the return value\n }\n ```\n \n Asynchronous example:\n \n ```js\n findAuthor().catch(function(reason){\n return findOtherAuther();\n }).finally(function(){\n // author was either found, or not\n });\n ```\n \n @method finally\n @param {Function} callback\n @return {Promise}\n */\n\n\n Promise.prototype.finally = function _finally(callback) {\n var promise = this;\n var constructor = promise.constructor;\n\n if (isFunction(callback)) {\n return promise.then(function (value) {\n return constructor.resolve(callback()).then(function () {\n return value;\n });\n }, function (reason) {\n return constructor.resolve(callback()).then(function () {\n throw reason;\n });\n });\n }\n\n return promise.then(callback, callback);\n };\n\n return Promise;\n}();\n\nPromise.prototype.then = then;\nexport default Promise;\nPromise.all = all;\nPromise.race = race;\nPromise.resolve = Resolve;\nPromise.reject = Reject;\nPromise._setScheduler = setScheduler;\nPromise._setAsap = setAsap;\nPromise._asap = asap;","/*global self*/\nimport Promise from './promise';\n\nexport default function polyfill() {\n var local = void 0;\n\n if (typeof global !== 'undefined') {\n local = global;\n } else if (typeof self !== 'undefined') {\n local = self;\n } else {\n try {\n local = Function('return this')();\n } catch (e) {\n throw new Error('polyfill failed because global object is unavailable in this environment');\n }\n }\n\n var P = local.Promise;\n\n if (P) {\n var promiseToString = null;\n try {\n promiseToString = Object.prototype.toString.call(P.resolve());\n } catch (e) {\n // silently ignored\n }\n\n if (promiseToString === '[object Promise]' && !P.cast) {\n return;\n }\n }\n\n local.Promise = Promise;\n}","import Promise from './es6-promise/promise';\nimport polyfill from './es6-promise/polyfill';\n\n// Strange compat..\nPromise.polyfill = polyfill;\nPromise.Promise = Promise;\nexport default Promise;","import Promise from './es6-promise';\nPromise.polyfill();\nexport default Promise;"],"names":["resolve","_resolve","then","originalThen","originalResolve","Promise","reject","_reject","Resolve","Reject"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACNO,SAAS,gBAAgB,CAAC,CAAC,EAAE;EAClC,IAAI,IAAI,GAAG,OAAO,CAAC,CAAC;EACpB,OAAO,CAAC,KAAK,IAAI,KAAK,IAAI,KAAK,QAAQ,IAAI,IAAI,KAAK,UAAU,CAAC,CAAC;CACjE;;AAED,AAAO,SAAS,UAAU,CAAC,CAAC,EAAE;EAC5B,OAAO,OAAO,CAAC,KAAK,UAAU,CAAC;CAChC;;AAED,AAEC;;AAED,IAAI,QAAQ,GAAG,KAAK,CAAC,CAAC;AACtB,IAAI,KAAK,CAAC,OAAO,EAAE;EACjB,QAAQ,GAAG,KAAK,CAAC,OAAO,CAAC;CAC1B,MAAM;EACL,QAAQ,GAAG,UAAU,CAAC,EAAE;IACtB,OAAO,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,gBAAgB,CAAC;GAC/D,CAAC;CACH;;AAED,AAAO,IAAI,OAAO,GAAG,QAAQ;;ACtB7B,IAAI,GAAG,GAAG,CAAC,CAAC;AACZ,IAAI,SAAS,GAAG,KAAK,CAAC,CAAC;AACvB,IAAI,iBAAiB,GAAG,KAAK,CAAC,CAAC;;AAE/B,AAAO,IAAI,IAAI,GAAG,SAAS,IAAI,CAAC,QAAQ,EAAE,GAAG,EAAE;EAC7C,KAAK,CAAC,GAAG,CAAC,GAAG,QAAQ,CAAC;EACtB,KAAK,CAAC,GAAG,GAAG,CAAC,CAAC,GAAG,GAAG,CAAC;EACrB,GAAG,IAAI,CAAC,CAAC;EACT,IAAI,GAAG,KAAK,CAAC,EAAE;;;;IAIb,IAAI,iBAAiB,EAAE;MACrB,iBAAiB,CAAC,KAAK,CAAC,CAAC;KAC1B,MAAM;MACL,aAAa,EAAE,CAAC;KACjB;GACF;CACF,CAAC;;AAEF,AAAO,SAAS,YAAY,CAAC,UAAU,EAAE;EACvC,iBAAiB,GAAG,UAAU,CAAC;CAChC;;AAED,AAAO,SAAS,OAAO,CAAC,MAAM,EAAE;EAC9B,IAAI,GAAG,MAAM,CAAC;CACf;;AAED,IAAI,aAAa,GAAG,OAAO,MAAM,KAAK,WAAW,GAAG,MAAM,GAAG,SAAS,CAAC;AACvE,IAAI,aAAa,GAAG,aAAa,IAAI,EAAE,CAAC;AACxC,IAAI,uBAAuB,GAAG,aAAa,CAAC,gBAAgB,IAAI,aAAa,CAAC,sBAAsB,CAAC;AACrG,IAAI,MAAM,GAAG,OAAO,IAAI,KAAK,WAAW,IAAI,OAAO,OAAO,KAAK,WAAW,IAAI,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,kBAAkB,CAAC;;;AAG/H,IAAI,QAAQ,GAAG,OAAO,iBAAiB,KAAK,WAAW,IAAI,OAAO,aAAa,KAAK,WAAW,IAAI,OAAO,cAAc,KAAK,WAAW,CAAC;;;AAGzI,SAAS,WAAW,GAAG;;;EAGrB,OAAO,YAAY;IACjB,OAAO,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;GAChC,CAAC;CACH;;;AAGD,SAAS,aAAa,GAAG;EACvB,IAAI,OAAO,SAAS,KAAK,WAAW,EAAE;IACpC,OAAO,YAAY;MACjB,SAAS,CAAC,KAAK,CAAC,CAAC;KAClB,CAAC;GACH;;EAED,OAAO,aAAa,EAAE,CAAC;CACxB;;AAED,SAAS,mBAAmB,GAAG;EAC7B,IAAI,UAAU,GAAG,CAAC,CAAC;EACnB,IAAI,QAAQ,GAAG,IAAI,uBAAuB,CAAC,KAAK,CAAC,CAAC;EAClD,IAAI,IAAI,GAAG,QAAQ,CAAC,cAAc,CAAC,EAAE,CAAC,CAAC;EACvC,QAAQ,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,aAAa,EAAE,IAAI,EAAE,CAAC,CAAC;;EAEhD,OAAO,YAAY;IACjB,IAAI,CAAC,IAAI,GAAG,UAAU,GAAG,EAAE,UAAU,GAAG,CAAC,CAAC;GAC3C,CAAC;CACH;;;AAGD,SAAS,iBAAiB,GAAG;EAC3B,IAAI,OAAO,GAAG,IAAI,cAAc,EAAE,CAAC;EACnC,OAAO,CAAC,KAAK,CAAC,SAAS,GAAG,KAAK,CAAC;EAChC,OAAO,YAAY;IACjB,OAAO,OAAO,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;GACrC,CAAC;CACH;;AAED,SAAS,aAAa,GAAG;;;EAGvB,IAAI,gBAAgB,GAAG,UAAU,CAAC;EAClC,OAAO,YAAY;IACjB,OAAO,gBAAgB,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;GACnC,CAAC;CACH;;AAED,IAAI,KAAK,GAAG,IAAI,KAAK,CAAC,IAAI,CAAC,CAAC;AAC5B,SAAS,KAAK,GAAG;EACf,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,GAAG,EAAE,CAAC,IAAI,CAAC,EAAE;IAC/B,IAAI,QAAQ,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;IACxB,IAAI,GAAG,GAAG,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;;IAEvB,QAAQ,CAAC,GAAG,CAAC,CAAC;;IAEd,KAAK,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC;IACrB,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,SAAS,CAAC;GAC1B;;EAED,GAAG,GAAG,CAAC,CAAC;CACT;;AAED,SAAS,YAAY,GAAG;EACtB,IAAI;IACF,IAAI,KAAK,GAAG,QAAQ,CAAC,aAAa,CAAC,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;IACvD,SAAS,GAAG,KAAK,CAAC,SAAS,IAAI,KAAK,CAAC,YAAY,CAAC;IAClD,OAAO,aAAa,EAAE,CAAC;GACxB,CAAC,OAAO,CAAC,EAAE;IACV,OAAO,aAAa,EAAE,CAAC;GACxB;CACF;;AAED,IAAI,aAAa,GAAG,KAAK,CAAC,CAAC;;AAE3B,IAAI,MAAM,EAAE;EACV,aAAa,GAAG,WAAW,EAAE,CAAC;CAC/B,MAAM,IAAI,uBAAuB,EAAE;EAClC,aAAa,GAAG,mBAAmB,EAAE,CAAC;CACvC,MAAM,IAAI,QAAQ,EAAE;EACnB,aAAa,GAAG,iBAAiB,EAAE,CAAC;CACrC,MAAM,IAAI,aAAa,KAAK,SAAS,IAAI,OAAO,OAAO,KAAK,UAAU,EAAE;EACvE,aAAa,GAAG,YAAY,EAAE,CAAC;CAChC,MAAM;EACL,aAAa,GAAG,aAAa,EAAE,CAAC;;;CACjC,DCtHc,SAAS,IAAI,CAAC,aAAa,EAAE,WAAW,EAAE;EACvD,IAAI,MAAM,GAAG,IAAI,CAAC;;EAElB,IAAI,KAAK,GAAG,IAAI,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;;EAEvC,IAAI,KAAK,CAAC,UAAU,CAAC,KAAK,SAAS,EAAE;IACnC,WAAW,CAAC,KAAK,CAAC,CAAC;GACpB;;EAED,IAAI,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;;;EAG3B,IAAI,MAAM,EAAE;IACV,IAAI,QAAQ,GAAG,SAAS,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;IACrC,IAAI,CAAC,YAAY;MACf,OAAO,cAAc,CAAC,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC;KAChE,CAAC,CAAC;GACJ,MAAM;IACL,SAAS,CAAC,MAAM,EAAE,KAAK,EAAE,aAAa,EAAE,WAAW,CAAC,CAAC;GACtD;;EAED,OAAO,KAAK,CAAC;;;CACd,DCxBD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+BA,AAAe,SAASA,SAAO,CAAC,MAAM,EAAE;;EAEtC,IAAI,WAAW,GAAG,IAAI,CAAC;;EAEvB,IAAI,MAAM,IAAI,OAAO,MAAM,KAAK,QAAQ,IAAI,MAAM,CAAC,WAAW,KAAK,WAAW,EAAE;IAC9E,OAAO,MAAM,CAAC;GACf;;EAED,IAAI,OAAO,GAAG,IAAI,WAAW,CAAC,IAAI,CAAC,CAAC;EACpCC,OAAQ,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;EAC1B,OAAO,OAAO,CAAC;;;CAChB,DCrCM,IAAI,UAAU,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;;AAEhE,SAAS,IAAI,GAAG,EAAE;;AAElB,IAAI,OAAO,GAAG,KAAK,CAAC,CAAC;AACrB,IAAI,SAAS,GAAG,CAAC,CAAC;AAClB,IAAI,QAAQ,GAAG,CAAC,CAAC;;AAEjB,SAAS,eAAe,GAAG;EACzB,OAAO,IAAI,SAAS,CAAC,0CAA0C,CAAC,CAAC;CAClE;;AAED,SAAS,eAAe,GAAG;EACzB,OAAO,IAAI,SAAS,CAAC,sDAAsD,CAAC,CAAC;CAC9E;;AAED,SAAS,OAAO,CAACC,OAAI,EAAE,KAAK,EAAE,kBAAkB,EAAE,gBAAgB,EAAE;EAClE,IAAI;IACFA,OAAI,CAAC,IAAI,CAAC,KAAK,EAAE,kBAAkB,EAAE,gBAAgB,CAAC,CAAC;GACxD,CAAC,OAAO,CAAC,EAAE;IACV,OAAO,CAAC,CAAC;GACV;CACF;;AAED,SAAS,qBAAqB,CAAC,OAAO,EAAE,QAAQ,EAAEA,OAAI,EAAE;EACtD,IAAI,CAAC,UAAU,OAAO,EAAE;IACtB,IAAI,MAAM,GAAG,KAAK,CAAC;IACnB,IAAI,KAAK,GAAG,OAAO,CAACA,OAAI,EAAE,QAAQ,EAAE,UAAU,KAAK,EAAE;MACnD,IAAI,MAAM,EAAE;QACV,OAAO;OACR;MACD,MAAM,GAAG,IAAI,CAAC;MACd,IAAI,QAAQ,KAAK,KAAK,EAAE;QACtB,OAAO,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;OACzB,MAAM;QACL,OAAO,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;OACzB;KACF,EAAE,UAAU,MAAM,EAAE;MACnB,IAAI,MAAM,EAAE;QACV,OAAO;OACR;MACD,MAAM,GAAG,IAAI,CAAC;;MAEd,MAAM,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;KACzB,EAAE,UAAU,IAAI,OAAO,CAAC,MAAM,IAAI,kBAAkB,CAAC,CAAC,CAAC;;IAExD,IAAI,CAAC,MAAM,IAAI,KAAK,EAAE;MACpB,MAAM,GAAG,IAAI,CAAC;MACd,MAAM,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;KACxB;GACF,EAAE,OAAO,CAAC,CAAC;CACb;;AAED,SAAS,iBAAiB,CAAC,OAAO,EAAE,QAAQ,EAAE;EAC5C,IAAI,QAAQ,CAAC,MAAM,KAAK,SAAS,EAAE;IACjC,OAAO,CAAC,OAAO,EAAE,QAAQ,CAAC,OAAO,CAAC,CAAC;GACpC,MAAM,IAAI,QAAQ,CAAC,MAAM,KAAK,QAAQ,EAAE;IACvC,MAAM,CAAC,OAAO,EAAE,QAAQ,CAAC,OAAO,CAAC,CAAC;GACnC,MAAM;IACL,SAAS,CAAC,QAAQ,EAAE,SAAS,EAAE,UAAU,KAAK,EAAE;MAC9C,OAAO,OAAO,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;KAChC,EAAE,UAAU,MAAM,EAAE;MACnB,OAAO,MAAM,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;KAChC,CAAC,CAAC;GACJ;CACF;;AAED,SAAS,mBAAmB,CAAC,OAAO,EAAE,aAAa,EAAEA,OAAI,EAAE;EACzD,IAAI,aAAa,CAAC,WAAW,KAAK,OAAO,CAAC,WAAW,IAAIA,OAAI,KAAKC,IAAY,IAAI,aAAa,CAAC,WAAW,CAAC,OAAO,KAAKC,SAAe,EAAE;IACvI,iBAAiB,CAAC,OAAO,EAAE,aAAa,CAAC,CAAC;GAC3C,MAAM;IACL,IAAIF,OAAI,KAAK,SAAS,EAAE;MACtB,OAAO,CAAC,OAAO,EAAE,aAAa,CAAC,CAAC;KACjC,MAAM,IAAI,UAAU,CAACA,OAAI,CAAC,EAAE;MAC3B,qBAAqB,CAAC,OAAO,EAAE,aAAa,EAAEA,OAAI,CAAC,CAAC;KACrD,MAAM;MACL,OAAO,CAAC,OAAO,EAAE,aAAa,CAAC,CAAC;KACjC;GACF;CACF;;AAED,SAAS,OAAO,CAAC,OAAO,EAAE,KAAK,EAAE;EAC/B,IAAI,OAAO,KAAK,KAAK,EAAE;IACrB,MAAM,CAAC,OAAO,EAAE,eAAe,EAAE,CAAC,CAAC;GACpC,MAAM,IAAI,gBAAgB,CAAC,KAAK,CAAC,EAAE;IAClC,IAAIA,OAAI,GAAG,KAAK,CAAC,CAAC;IAClB,IAAI;MACFA,OAAI,GAAG,KAAK,CAAC,IAAI,CAAC;KACnB,CAAC,OAAO,KAAK,EAAE;MACd,MAAM,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;MACvB,OAAO;KACR;IACD,mBAAmB,CAAC,OAAO,EAAE,KAAK,EAAEA,OAAI,CAAC,CAAC;GAC3C,MAAM;IACL,OAAO,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;GACzB;CACF;;AAED,SAAS,gBAAgB,CAAC,OAAO,EAAE;EACjC,IAAI,OAAO,CAAC,QAAQ,EAAE;IACpB,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;GACnC;;EAED,OAAO,CAAC,OAAO,CAAC,CAAC;CAClB;;AAED,SAAS,OAAO,CAAC,OAAO,EAAE,KAAK,EAAE;EAC/B,IAAI,OAAO,CAAC,MAAM,KAAK,OAAO,EAAE;IAC9B,OAAO;GACR;;EAED,OAAO,CAAC,OAAO,GAAG,KAAK,CAAC;EACxB,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC;;EAE3B,IAAI,OAAO,CAAC,YAAY,CAAC,MAAM,KAAK,CAAC,EAAE;IACrC,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;GACxB;CACF;;AAED,SAAS,MAAM,CAAC,OAAO,EAAE,MAAM,EAAE;EAC/B,IAAI,OAAO,CAAC,MAAM,KAAK,OAAO,EAAE;IAC9B,OAAO;GACR;EACD,OAAO,CAAC,MAAM,GAAG,QAAQ,CAAC;EAC1B,OAAO,CAAC,OAAO,GAAG,MAAM,CAAC;;EAEzB,IAAI,CAAC,gBAAgB,EAAE,OAAO,CAAC,CAAC;CACjC;;AAED,SAAS,SAAS,CAAC,MAAM,EAAE,KAAK,EAAE,aAAa,EAAE,WAAW,EAAE;EAC5D,IAAI,YAAY,GAAG,MAAM,CAAC,YAAY,CAAC;EACvC,IAAI,MAAM,GAAG,YAAY,CAAC,MAAM,CAAC;;;EAGjC,MAAM,CAAC,QAAQ,GAAG,IAAI,CAAC;;EAEvB,YAAY,CAAC,MAAM,CAAC,GAAG,KAAK,CAAC;EAC7B,YAAY,CAAC,MAAM,GAAG,SAAS,CAAC,GAAG,aAAa,CAAC;EACjD,YAAY,CAAC,MAAM,GAAG,QAAQ,CAAC,GAAG,WAAW,CAAC;;EAE9C,IAAI,MAAM,KAAK,CAAC,IAAI,MAAM,CAAC,MAAM,EAAE;IACjC,IAAI,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;GACvB;CACF;;AAED,SAAS,OAAO,CAAC,OAAO,EAAE;EACxB,IAAI,WAAW,GAAG,OAAO,CAAC,YAAY,CAAC;EACvC,IAAI,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC;;EAE7B,IAAI,WAAW,CAAC,MAAM,KAAK,CAAC,EAAE;IAC5B,OAAO;GACR;;EAED,IAAI,KAAK,GAAG,KAAK,CAAC;MACd,QAAQ,GAAG,KAAK,CAAC;MACjB,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;;EAE7B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,WAAW,CAAC,MAAM,EAAE,CAAC,IAAI,CAAC,EAAE;IAC9C,KAAK,GAAG,WAAW,CAAC,CAAC,CAAC,CAAC;IACvB,QAAQ,GAAG,WAAW,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC;;IAEpC,IAAI,KAAK,EAAE;MACT,cAAc,CAAC,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC;KAClD,MAAM;MACL,QAAQ,CAAC,MAAM,CAAC,CAAC;KAClB;GACF;;EAED,OAAO,CAAC,YAAY,CAAC,MAAM,GAAG,CAAC,CAAC;CACjC;;AAED,SAAS,cAAc,CAAC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE;EAC1D,IAAI,WAAW,GAAG,UAAU,CAAC,QAAQ,CAAC;MAClC,KAAK,GAAG,KAAK,CAAC;MACd,KAAK,GAAG,KAAK,CAAC;MACd,SAAS,GAAG,IAAI,CAAC;;EAErB,IAAI,WAAW,EAAE;IACf,IAAI;MACF,KAAK,GAAG,QAAQ,CAAC,MAAM,CAAC,CAAC;KAC1B,CAAC,OAAO,CAAC,EAAE;MACV,SAAS,GAAG,KAAK,CAAC;MAClB,KAAK,GAAG,CAAC,CAAC;KACX;;IAED,IAAI,OAAO,KAAK,KAAK,EAAE;MACrB,MAAM,CAAC,OAAO,EAAE,eAAe,EAAE,CAAC,CAAC;MACnC,OAAO;KACR;GACF,MAAM;IACL,KAAK,GAAG,MAAM,CAAC;GAChB;;EAED,IAAI,OAAO,CAAC,MAAM,KAAK,OAAO,EAAE;;GAE/B,MAAM,IAAI,WAAW,IAAI,SAAS,EAAE;IACnC,OAAO,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;GACzB,MAAM,IAAI,SAAS,KAAK,KAAK,EAAE;IAC9B,MAAM,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;GACxB,MAAM,IAAI,OAAO,KAAK,SAAS,EAAE;IAChC,OAAO,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;GACzB,MAAM,IAAI,OAAO,KAAK,QAAQ,EAAE;IAC/B,MAAM,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;GACxB;CACF;;AAED,SAAS,iBAAiB,CAAC,OAAO,EAAE,QAAQ,EAAE;EAC5C,IAAI;IACF,QAAQ,CAAC,SAAS,cAAc,CAAC,KAAK,EAAE;MACtC,OAAO,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;KACzB,EAAE,SAAS,aAAa,CAAC,MAAM,EAAE;MAChC,MAAM,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;KACzB,CAAC,CAAC;GACJ,CAAC,OAAO,CAAC,EAAE;IACV,MAAM,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC;GACpB;CACF;;AAED,IAAI,EAAE,GAAG,CAAC,CAAC;AACX,SAAS,MAAM,GAAG;EAChB,OAAO,EAAE,EAAE,CAAC;CACb;;AAED,SAAS,WAAW,CAAC,OAAO,EAAE;EAC5B,OAAO,CAAC,UAAU,CAAC,GAAG,EAAE,EAAE,CAAC;EAC3B,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC;EAC3B,OAAO,CAAC,OAAO,GAAG,SAAS,CAAC;EAC5B,OAAO,CAAC,YAAY,GAAG,EAAE,CAAC;CAC3B;;AChOD,SAAS,eAAe,GAAG;EACzB,OAAO,IAAI,KAAK,CAAC,yCAAyC,CAAC,CAAC;CAC7D,AAAC;;AAEF,IAAI,UAAU,GAAG,YAAY;EAC3B,SAAS,UAAU,CAAC,WAAW,EAAE,KAAK,EAAE;IACtC,IAAI,CAAC,oBAAoB,GAAG,WAAW,CAAC;IACxC,IAAI,CAAC,OAAO,GAAG,IAAI,WAAW,CAAC,IAAI,CAAC,CAAC;;IAErC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,EAAE;MAC7B,WAAW,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;KAC3B;;IAED,IAAI,OAAO,CAAC,KAAK,CAAC,EAAE;MAClB,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC;MAC3B,IAAI,CAAC,UAAU,GAAG,KAAK,CAAC,MAAM,CAAC;;MAE/B,IAAI,CAAC,OAAO,GAAG,IAAI,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;;MAEtC,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,EAAE;QACrB,OAAO,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;OACrC,MAAM;QACL,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,IAAI,CAAC,CAAC;QAC/B,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;QACvB,IAAI,IAAI,CAAC,UAAU,KAAK,CAAC,EAAE;UACzB,OAAO,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;SACrC;OACF;KACF,MAAM;MACL,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,eAAe,EAAE,CAAC,CAAC;KACzC;GACF;;EAED,UAAU,CAAC,SAAS,CAAC,UAAU,GAAG,SAAS,UAAU,CAAC,KAAK,EAAE;IAC3D,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,IAAI,CAAC,MAAM,KAAK,OAAO,IAAI,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;MAChE,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;KAC9B;GACF,CAAC;;EAEF,UAAU,CAAC,SAAS,CAAC,UAAU,GAAG,SAAS,UAAU,CAAC,KAAK,EAAE,CAAC,EAAE;IAC9D,IAAI,CAAC,GAAG,IAAI,CAAC,oBAAoB,CAAC;IAClC,IAAIF,UAAO,GAAG,CAAC,CAAC,OAAO,CAAC;;;IAGxB,IAAIA,UAAO,KAAKI,SAAe,EAAE;MAC/B,IAAI,KAAK,GAAG,KAAK,CAAC,CAAC;MACnB,IAAI,KAAK,GAAG,KAAK,CAAC,CAAC;MACnB,IAAI,QAAQ,GAAG,KAAK,CAAC;MACrB,IAAI;QACF,KAAK,GAAG,KAAK,CAAC,IAAI,CAAC;OACpB,CAAC,OAAO,CAAC,EAAE;QACV,QAAQ,GAAG,IAAI,CAAC;QAChB,KAAK,GAAG,CAAC,CAAC;OACX;;MAED,IAAI,KAAK,KAAKD,IAAY,IAAI,KAAK,CAAC,MAAM,KAAK,OAAO,EAAE;QACtD,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC;OACjD,MAAM,IAAI,OAAO,KAAK,KAAK,UAAU,EAAE;QACtC,IAAI,CAAC,UAAU,EAAE,CAAC;QAClB,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC;OACzB,MAAM,IAAI,CAAC,KAAKE,SAAO,EAAE;QACxB,IAAI,OAAO,GAAG,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC;QAC1B,IAAI,QAAQ,EAAE;UACZ,MAAM,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;SACxB,MAAM;UACL,mBAAmB,CAAC,OAAO,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;SAC5C;QACD,IAAI,CAAC,aAAa,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC;OAChC,MAAM;QACL,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC,UAAUL,UAAO,EAAE;UAC1C,OAAOA,UAAO,CAAC,KAAK,CAAC,CAAC;SACvB,CAAC,EAAE,CAAC,CAAC,CAAC;OACR;KACF,MAAM;MACL,IAAI,CAAC,aAAa,CAACA,UAAO,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC;KACvC;GACF,CAAC;;EAEF,UAAU,CAAC,SAAS,CAAC,UAAU,GAAG,SAAS,UAAU,CAAC,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE;IACrE,IAAI,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC;;;IAG3B,IAAI,OAAO,CAAC,MAAM,KAAK,OAAO,EAAE;MAC9B,IAAI,CAAC,UAAU,EAAE,CAAC;;MAElB,IAAI,KAAK,KAAK,QAAQ,EAAE;QACtB,MAAM,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;OACxB,MAAM;QACL,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC;OACzB;KACF;;IAED,IAAI,IAAI,CAAC,UAAU,KAAK,CAAC,EAAE;MACzB,OAAO,CAAC,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;KAChC;GACF,CAAC;;EAEF,UAAU,CAAC,SAAS,CAAC,aAAa,GAAG,SAAS,aAAa,CAAC,OAAO,EAAE,CAAC,EAAE;IACtE,IAAI,UAAU,GAAG,IAAI,CAAC;;IAEtB,SAAS,CAAC,OAAO,EAAE,SAAS,EAAE,UAAU,KAAK,EAAE;MAC7C,OAAO,UAAU,CAAC,UAAU,CAAC,SAAS,EAAE,CAAC,EAAE,KAAK,CAAC,CAAC;KACnD,EAAE,UAAU,MAAM,EAAE;MACnB,OAAO,UAAU,CAAC,UAAU,CAAC,QAAQ,EAAE,CAAC,EAAE,MAAM,CAAC,CAAC;KACnD,CAAC,CAAC;GACJ,CAAC;;EAEF,OAAO,UAAU,CAAC;CACnB,EAAE;;ACrHH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+CA,AAAe,SAAS,GAAG,CAAC,OAAO,EAAE;EACnC,OAAO,IAAI,UAAU,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC,OAAO,CAAC;;;CAC9C,DCjDD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiEA,AAAe,SAAS,IAAI,CAAC,OAAO,EAAE;;EAEpC,IAAI,WAAW,GAAG,IAAI,CAAC;;EAEvB,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE;IACrB,OAAO,IAAI,WAAW,CAAC,UAAU,CAAC,EAAE,MAAM,EAAE;MAC1C,OAAO,MAAM,CAAC,IAAI,SAAS,CAAC,iCAAiC,CAAC,CAAC,CAAC;KACjE,CAAC,CAAC;GACJ,MAAM;IACL,OAAO,IAAI,WAAW,CAAC,UAAU,OAAO,EAAE,MAAM,EAAE;MAChD,IAAI,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;MAC5B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,EAAE,CAAC,EAAE,EAAE;QAC/B,WAAW,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;OACvD;KACF,CAAC,CAAC;GACJ;;;CACF,DCjFD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkCA,AAAe,SAASM,QAAM,CAAC,MAAM,EAAE;;EAErC,IAAI,WAAW,GAAG,IAAI,CAAC;EACvB,IAAI,OAAO,GAAG,IAAI,WAAW,CAAC,IAAI,CAAC,CAAC;EACpCC,MAAO,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;EACzB,OAAO,OAAO,CAAC;;;CAChB,DC9BD,SAAS,aAAa,GAAG;EACvB,MAAM,IAAI,SAAS,CAAC,oFAAoF,CAAC,CAAC;CAC3G;;AAED,SAAS,QAAQ,GAAG;EAClB,MAAM,IAAI,SAAS,CAAC,uHAAuH,CAAC,CAAC;CAC9I;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0GD,IAAIF,SAAO,GAAG,YAAY;EACxB,SAAS,OAAO,CAAC,QAAQ,EAAE;IACzB,IAAI,CAAC,UAAU,CAAC,GAAG,MAAM,EAAE,CAAC;IAC5B,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,MAAM,GAAG,SAAS,CAAC;IACvC,IAAI,CAAC,YAAY,GAAG,EAAE,CAAC;;IAEvB,IAAI,IAAI,KAAK,QAAQ,EAAE;MACrB,OAAO,QAAQ,KAAK,UAAU,IAAI,aAAa,EAAE,CAAC;MAClD,IAAI,YAAY,OAAO,GAAG,iBAAiB,CAAC,IAAI,EAAE,QAAQ,CAAC,GAAG,QAAQ,EAAE,CAAC;KAC1E;GACF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA4LD,OAAO,CAAC,SAAS,CAAC,KAAK,GAAG,SAAS,MAAM,CAAC,WAAW,EAAE;IACrD,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,WAAW,CAAC,CAAC;GACrC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA0CF,OAAO,CAAC,SAAS,CAAC,OAAO,GAAG,SAAS,QAAQ,CAAC,QAAQ,EAAE;IACtD,IAAI,OAAO,GAAG,IAAI,CAAC;IACnB,IAAI,WAAW,GAAG,OAAO,CAAC,WAAW,CAAC;;IAEtC,IAAI,UAAU,CAAC,QAAQ,CAAC,EAAE;MACxB,OAAO,OAAO,CAAC,IAAI,CAAC,UAAU,KAAK,EAAE;QACnC,OAAO,WAAW,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAC,IAAI,CAAC,YAAY;UACtD,OAAO,KAAK,CAAC;SACd,CAAC,CAAC;OACJ,EAAE,UAAU,MAAM,EAAE;QACnB,OAAO,WAAW,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAC,IAAI,CAAC,YAAY;UACtD,MAAM,MAAM,CAAC;SACd,CAAC,CAAC;OACJ,CAAC,CAAC;KACJ;;IAED,OAAO,OAAO,CAAC,IAAI,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;GACzC,CAAC;;EAEF,OAAO,OAAO,CAAC;CAChB,EAAE,CAAC;;AAEJA,SAAO,CAAC,SAAS,CAAC,IAAI,GAAG,IAAI,CAAC;AAC9B,AACAA,SAAO,CAAC,GAAG,GAAG,GAAG,CAAC;AAClBA,SAAO,CAAC,IAAI,GAAG,IAAI,CAAC;AACpBA,SAAO,CAAC,OAAO,GAAGG,SAAO,CAAC;AAC1BH,SAAO,CAAC,MAAM,GAAGI,QAAM,CAAC;AACxBJ,SAAO,CAAC,aAAa,GAAG,YAAY,CAAC;AACrCA,SAAO,CAAC,QAAQ,GAAG,OAAO,CAAC;AAC3BA,SAAO,CAAC,KAAK,GAAG,IAAI;;AC5YpB;AACA,AAEe,SAAS,QAAQ,GAAG;EACjC,IAAI,KAAK,GAAG,KAAK,CAAC,CAAC;;EAEnB,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE;IACjC,KAAK,GAAG,MAAM,CAAC;GAChB,MAAM,IAAI,OAAO,IAAI,KAAK,WAAW,EAAE;IACtC,KAAK,GAAG,IAAI,CAAC;GACd,MAAM;IACL,IAAI;MACF,KAAK,GAAG,QAAQ,CAAC,aAAa,CAAC,EAAE,CAAC;KACnC,CAAC,OAAO,CAAC,EAAE;MACV,MAAM,IAAI,KAAK,CAAC,0EAA0E,CAAC,CAAC;KAC7F;GACF;;EAED,IAAI,CAAC,GAAG,KAAK,CAAC,OAAO,CAAC;;EAEtB,IAAI,CAAC,EAAE;IACL,IAAI,eAAe,GAAG,IAAI,CAAC;IAC3B,IAAI;MACF,eAAe,GAAG,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC;KAC/D,CAAC,OAAO,CAAC,EAAE;;KAEX;;IAED,IAAI,eAAe,KAAK,kBAAkB,IAAI,CAAC,CAAC,CAAC,IAAI,EAAE;MACrD,OAAO;KACR;GACF;;EAED,KAAK,CAAC,OAAO,GAAGA,SAAO,CAAC;;;CACzB,DC/BD;AACAA,SAAO,CAAC,QAAQ,GAAG,QAAQ,CAAC;AAC5BA,SAAO,CAAC,OAAO,GAAGA,SAAO,CAAC;;ACJ1BA,SAAO,CAAC,QAAQ,EAAE,CAAC;;;;;;;;","file":"es6-promise.auto.min.js"} \ No newline at end of file diff --git a/deps/npm/node_modules/es6-promise/dist/es6-promise.js b/deps/npm/node_modules/es6-promise/dist/es6-promise.js deleted file mode 100644 index 72fa0da4d3ed7b..00000000000000 --- a/deps/npm/node_modules/es6-promise/dist/es6-promise.js +++ /dev/null @@ -1,1174 +0,0 @@ -/*! - * @overview es6-promise - a tiny implementation of Promises/A+. - * @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors (Conversion to ES6 API by Jake Archibald) - * @license Licensed under MIT license - * See https://raw.githubusercontent.com/stefanpenner/es6-promise/master/LICENSE - * @version v4.2.8+1e68dce6 - */ - -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : - typeof define === 'function' && define.amd ? define(factory) : - (global.ES6Promise = factory()); -}(this, (function () { 'use strict'; - -function objectOrFunction(x) { - var type = typeof x; - return x !== null && (type === 'object' || type === 'function'); -} - -function isFunction(x) { - return typeof x === 'function'; -} - - - -var _isArray = void 0; -if (Array.isArray) { - _isArray = Array.isArray; -} else { - _isArray = function (x) { - return Object.prototype.toString.call(x) === '[object Array]'; - }; -} - -var isArray = _isArray; - -var len = 0; -var vertxNext = void 0; -var customSchedulerFn = void 0; - -var asap = function asap(callback, arg) { - queue[len] = callback; - queue[len + 1] = arg; - len += 2; - if (len === 2) { - // If len is 2, that means that we need to schedule an async flush. - // If additional callbacks are queued before the queue is flushed, they - // will be processed by this flush that we are scheduling. - if (customSchedulerFn) { - customSchedulerFn(flush); - } else { - scheduleFlush(); - } - } -}; - -function setScheduler(scheduleFn) { - customSchedulerFn = scheduleFn; -} - -function setAsap(asapFn) { - asap = asapFn; -} - -var browserWindow = typeof window !== 'undefined' ? window : undefined; -var browserGlobal = browserWindow || {}; -var BrowserMutationObserver = browserGlobal.MutationObserver || browserGlobal.WebKitMutationObserver; -var isNode = typeof self === 'undefined' && typeof process !== 'undefined' && {}.toString.call(process) === '[object process]'; - -// test for web worker but not in IE10 -var isWorker = typeof Uint8ClampedArray !== 'undefined' && typeof importScripts !== 'undefined' && typeof MessageChannel !== 'undefined'; - -// node -function useNextTick() { - // node version 0.10.x displays a deprecation warning when nextTick is used recursively - // see https://github.com/cujojs/when/issues/410 for details - return function () { - return process.nextTick(flush); - }; -} - -// vertx -function useVertxTimer() { - if (typeof vertxNext !== 'undefined') { - return function () { - vertxNext(flush); - }; - } - - return useSetTimeout(); -} - -function useMutationObserver() { - var iterations = 0; - var observer = new BrowserMutationObserver(flush); - var node = document.createTextNode(''); - observer.observe(node, { characterData: true }); - - return function () { - node.data = iterations = ++iterations % 2; - }; -} - -// web worker -function useMessageChannel() { - var channel = new MessageChannel(); - channel.port1.onmessage = flush; - return function () { - return channel.port2.postMessage(0); - }; -} - -function useSetTimeout() { - // Store setTimeout reference so es6-promise will be unaffected by - // other code modifying setTimeout (like sinon.useFakeTimers()) - var globalSetTimeout = setTimeout; - return function () { - return globalSetTimeout(flush, 1); - }; -} - -var queue = new Array(1000); -function flush() { - for (var i = 0; i < len; i += 2) { - var callback = queue[i]; - var arg = queue[i + 1]; - - callback(arg); - - queue[i] = undefined; - queue[i + 1] = undefined; - } - - len = 0; -} - -function attemptVertx() { - try { - var vertx = Function('return this')().require('vertx'); - vertxNext = vertx.runOnLoop || vertx.runOnContext; - return useVertxTimer(); - } catch (e) { - return useSetTimeout(); - } -} - -var scheduleFlush = void 0; -// Decide what async method to use to triggering processing of queued callbacks: -if (isNode) { - scheduleFlush = useNextTick(); -} else if (BrowserMutationObserver) { - scheduleFlush = useMutationObserver(); -} else if (isWorker) { - scheduleFlush = useMessageChannel(); -} else if (browserWindow === undefined && typeof require === 'function') { - scheduleFlush = attemptVertx(); -} else { - scheduleFlush = useSetTimeout(); -} - -function then(onFulfillment, onRejection) { - var parent = this; - - var child = new this.constructor(noop); - - if (child[PROMISE_ID] === undefined) { - makePromise(child); - } - - var _state = parent._state; - - - if (_state) { - var callback = arguments[_state - 1]; - asap(function () { - return invokeCallback(_state, child, callback, parent._result); - }); - } else { - subscribe(parent, child, onFulfillment, onRejection); - } - - return child; -} - -/** - `Promise.resolve` returns a promise that will become resolved with the - passed `value`. It is shorthand for the following: - - ```javascript - let promise = new Promise(function(resolve, reject){ - resolve(1); - }); - - promise.then(function(value){ - // value === 1 - }); - ``` - - Instead of writing the above, your code now simply becomes the following: - - ```javascript - let promise = Promise.resolve(1); - - promise.then(function(value){ - // value === 1 - }); - ``` - - @method resolve - @static - @param {Any} value value that the returned promise will be resolved with - Useful for tooling. - @return {Promise} a promise that will become fulfilled with the given - `value` -*/ -function resolve$1(object) { - /*jshint validthis:true */ - var Constructor = this; - - if (object && typeof object === 'object' && object.constructor === Constructor) { - return object; - } - - var promise = new Constructor(noop); - resolve(promise, object); - return promise; -} - -var PROMISE_ID = Math.random().toString(36).substring(2); - -function noop() {} - -var PENDING = void 0; -var FULFILLED = 1; -var REJECTED = 2; - -function selfFulfillment() { - return new TypeError("You cannot resolve a promise with itself"); -} - -function cannotReturnOwn() { - return new TypeError('A promises callback cannot return that same promise.'); -} - -function tryThen(then$$1, value, fulfillmentHandler, rejectionHandler) { - try { - then$$1.call(value, fulfillmentHandler, rejectionHandler); - } catch (e) { - return e; - } -} - -function handleForeignThenable(promise, thenable, then$$1) { - asap(function (promise) { - var sealed = false; - var error = tryThen(then$$1, thenable, function (value) { - if (sealed) { - return; - } - sealed = true; - if (thenable !== value) { - resolve(promise, value); - } else { - fulfill(promise, value); - } - }, function (reason) { - if (sealed) { - return; - } - sealed = true; - - reject(promise, reason); - }, 'Settle: ' + (promise._label || ' unknown promise')); - - if (!sealed && error) { - sealed = true; - reject(promise, error); - } - }, promise); -} - -function handleOwnThenable(promise, thenable) { - if (thenable._state === FULFILLED) { - fulfill(promise, thenable._result); - } else if (thenable._state === REJECTED) { - reject(promise, thenable._result); - } else { - subscribe(thenable, undefined, function (value) { - return resolve(promise, value); - }, function (reason) { - return reject(promise, reason); - }); - } -} - -function handleMaybeThenable(promise, maybeThenable, then$$1) { - if (maybeThenable.constructor === promise.constructor && then$$1 === then && maybeThenable.constructor.resolve === resolve$1) { - handleOwnThenable(promise, maybeThenable); - } else { - if (then$$1 === undefined) { - fulfill(promise, maybeThenable); - } else if (isFunction(then$$1)) { - handleForeignThenable(promise, maybeThenable, then$$1); - } else { - fulfill(promise, maybeThenable); - } - } -} - -function resolve(promise, value) { - if (promise === value) { - reject(promise, selfFulfillment()); - } else if (objectOrFunction(value)) { - var then$$1 = void 0; - try { - then$$1 = value.then; - } catch (error) { - reject(promise, error); - return; - } - handleMaybeThenable(promise, value, then$$1); - } else { - fulfill(promise, value); - } -} - -function publishRejection(promise) { - if (promise._onerror) { - promise._onerror(promise._result); - } - - publish(promise); -} - -function fulfill(promise, value) { - if (promise._state !== PENDING) { - return; - } - - promise._result = value; - promise._state = FULFILLED; - - if (promise._subscribers.length !== 0) { - asap(publish, promise); - } -} - -function reject(promise, reason) { - if (promise._state !== PENDING) { - return; - } - promise._state = REJECTED; - promise._result = reason; - - asap(publishRejection, promise); -} - -function subscribe(parent, child, onFulfillment, onRejection) { - var _subscribers = parent._subscribers; - var length = _subscribers.length; - - - parent._onerror = null; - - _subscribers[length] = child; - _subscribers[length + FULFILLED] = onFulfillment; - _subscribers[length + REJECTED] = onRejection; - - if (length === 0 && parent._state) { - asap(publish, parent); - } -} - -function publish(promise) { - var subscribers = promise._subscribers; - var settled = promise._state; - - if (subscribers.length === 0) { - return; - } - - var child = void 0, - callback = void 0, - detail = promise._result; - - for (var i = 0; i < subscribers.length; i += 3) { - child = subscribers[i]; - callback = subscribers[i + settled]; - - if (child) { - invokeCallback(settled, child, callback, detail); - } else { - callback(detail); - } - } - - promise._subscribers.length = 0; -} - -function invokeCallback(settled, promise, callback, detail) { - var hasCallback = isFunction(callback), - value = void 0, - error = void 0, - succeeded = true; - - if (hasCallback) { - try { - value = callback(detail); - } catch (e) { - succeeded = false; - error = e; - } - - if (promise === value) { - reject(promise, cannotReturnOwn()); - return; - } - } else { - value = detail; - } - - if (promise._state !== PENDING) { - // noop - } else if (hasCallback && succeeded) { - resolve(promise, value); - } else if (succeeded === false) { - reject(promise, error); - } else if (settled === FULFILLED) { - fulfill(promise, value); - } else if (settled === REJECTED) { - reject(promise, value); - } -} - -function initializePromise(promise, resolver) { - try { - resolver(function resolvePromise(value) { - resolve(promise, value); - }, function rejectPromise(reason) { - reject(promise, reason); - }); - } catch (e) { - reject(promise, e); - } -} - -var id = 0; -function nextId() { - return id++; -} - -function makePromise(promise) { - promise[PROMISE_ID] = id++; - promise._state = undefined; - promise._result = undefined; - promise._subscribers = []; -} - -function validationError() { - return new Error('Array Methods must be provided an Array'); -} - -var Enumerator = function () { - function Enumerator(Constructor, input) { - this._instanceConstructor = Constructor; - this.promise = new Constructor(noop); - - if (!this.promise[PROMISE_ID]) { - makePromise(this.promise); - } - - if (isArray(input)) { - this.length = input.length; - this._remaining = input.length; - - this._result = new Array(this.length); - - if (this.length === 0) { - fulfill(this.promise, this._result); - } else { - this.length = this.length || 0; - this._enumerate(input); - if (this._remaining === 0) { - fulfill(this.promise, this._result); - } - } - } else { - reject(this.promise, validationError()); - } - } - - Enumerator.prototype._enumerate = function _enumerate(input) { - for (var i = 0; this._state === PENDING && i < input.length; i++) { - this._eachEntry(input[i], i); - } - }; - - Enumerator.prototype._eachEntry = function _eachEntry(entry, i) { - var c = this._instanceConstructor; - var resolve$$1 = c.resolve; - - - if (resolve$$1 === resolve$1) { - var _then = void 0; - var error = void 0; - var didError = false; - try { - _then = entry.then; - } catch (e) { - didError = true; - error = e; - } - - if (_then === then && entry._state !== PENDING) { - this._settledAt(entry._state, i, entry._result); - } else if (typeof _then !== 'function') { - this._remaining--; - this._result[i] = entry; - } else if (c === Promise$1) { - var promise = new c(noop); - if (didError) { - reject(promise, error); - } else { - handleMaybeThenable(promise, entry, _then); - } - this._willSettleAt(promise, i); - } else { - this._willSettleAt(new c(function (resolve$$1) { - return resolve$$1(entry); - }), i); - } - } else { - this._willSettleAt(resolve$$1(entry), i); - } - }; - - Enumerator.prototype._settledAt = function _settledAt(state, i, value) { - var promise = this.promise; - - - if (promise._state === PENDING) { - this._remaining--; - - if (state === REJECTED) { - reject(promise, value); - } else { - this._result[i] = value; - } - } - - if (this._remaining === 0) { - fulfill(promise, this._result); - } - }; - - Enumerator.prototype._willSettleAt = function _willSettleAt(promise, i) { - var enumerator = this; - - subscribe(promise, undefined, function (value) { - return enumerator._settledAt(FULFILLED, i, value); - }, function (reason) { - return enumerator._settledAt(REJECTED, i, reason); - }); - }; - - return Enumerator; -}(); - -/** - `Promise.all` accepts an array of promises, and returns a new promise which - is fulfilled with an array of fulfillment values for the passed promises, or - rejected with the reason of the first passed promise to be rejected. It casts all - elements of the passed iterable to promises as it runs this algorithm. - - Example: - - ```javascript - let promise1 = resolve(1); - let promise2 = resolve(2); - let promise3 = resolve(3); - let promises = [ promise1, promise2, promise3 ]; - - Promise.all(promises).then(function(array){ - // The array here would be [ 1, 2, 3 ]; - }); - ``` - - If any of the `promises` given to `all` are rejected, the first promise - that is rejected will be given as an argument to the returned promises's - rejection handler. For example: - - Example: - - ```javascript - let promise1 = resolve(1); - let promise2 = reject(new Error("2")); - let promise3 = reject(new Error("3")); - let promises = [ promise1, promise2, promise3 ]; - - Promise.all(promises).then(function(array){ - // Code here never runs because there are rejected promises! - }, function(error) { - // error.message === "2" - }); - ``` - - @method all - @static - @param {Array} entries array of promises - @param {String} label optional string for labeling the promise. - Useful for tooling. - @return {Promise} promise that is fulfilled when all `promises` have been - fulfilled, or rejected if any of them become rejected. - @static -*/ -function all(entries) { - return new Enumerator(this, entries).promise; -} - -/** - `Promise.race` returns a new promise which is settled in the same way as the - first passed promise to settle. - - Example: - - ```javascript - let promise1 = new Promise(function(resolve, reject){ - setTimeout(function(){ - resolve('promise 1'); - }, 200); - }); - - let promise2 = new Promise(function(resolve, reject){ - setTimeout(function(){ - resolve('promise 2'); - }, 100); - }); - - Promise.race([promise1, promise2]).then(function(result){ - // result === 'promise 2' because it was resolved before promise1 - // was resolved. - }); - ``` - - `Promise.race` is deterministic in that only the state of the first - settled promise matters. For example, even if other promises given to the - `promises` array argument are resolved, but the first settled promise has - become rejected before the other promises became fulfilled, the returned - promise will become rejected: - - ```javascript - let promise1 = new Promise(function(resolve, reject){ - setTimeout(function(){ - resolve('promise 1'); - }, 200); - }); - - let promise2 = new Promise(function(resolve, reject){ - setTimeout(function(){ - reject(new Error('promise 2')); - }, 100); - }); - - Promise.race([promise1, promise2]).then(function(result){ - // Code here never runs - }, function(reason){ - // reason.message === 'promise 2' because promise 2 became rejected before - // promise 1 became fulfilled - }); - ``` - - An example real-world use case is implementing timeouts: - - ```javascript - Promise.race([ajax('foo.json'), timeout(5000)]) - ``` - - @method race - @static - @param {Array} promises array of promises to observe - Useful for tooling. - @return {Promise} a promise which settles in the same way as the first passed - promise to settle. -*/ -function race(entries) { - /*jshint validthis:true */ - var Constructor = this; - - if (!isArray(entries)) { - return new Constructor(function (_, reject) { - return reject(new TypeError('You must pass an array to race.')); - }); - } else { - return new Constructor(function (resolve, reject) { - var length = entries.length; - for (var i = 0; i < length; i++) { - Constructor.resolve(entries[i]).then(resolve, reject); - } - }); - } -} - -/** - `Promise.reject` returns a promise rejected with the passed `reason`. - It is shorthand for the following: - - ```javascript - let promise = new Promise(function(resolve, reject){ - reject(new Error('WHOOPS')); - }); - - promise.then(function(value){ - // Code here doesn't run because the promise is rejected! - }, function(reason){ - // reason.message === 'WHOOPS' - }); - ``` - - Instead of writing the above, your code now simply becomes the following: - - ```javascript - let promise = Promise.reject(new Error('WHOOPS')); - - promise.then(function(value){ - // Code here doesn't run because the promise is rejected! - }, function(reason){ - // reason.message === 'WHOOPS' - }); - ``` - - @method reject - @static - @param {Any} reason value that the returned promise will be rejected with. - Useful for tooling. - @return {Promise} a promise rejected with the given `reason`. -*/ -function reject$1(reason) { - /*jshint validthis:true */ - var Constructor = this; - var promise = new Constructor(noop); - reject(promise, reason); - return promise; -} - -function needsResolver() { - throw new TypeError('You must pass a resolver function as the first argument to the promise constructor'); -} - -function needsNew() { - throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function."); -} - -/** - Promise objects represent the eventual result of an asynchronous operation. The - primary way of interacting with a promise is through its `then` method, which - registers callbacks to receive either a promise's eventual value or the reason - why the promise cannot be fulfilled. - - Terminology - ----------- - - - `promise` is an object or function with a `then` method whose behavior conforms to this specification. - - `thenable` is an object or function that defines a `then` method. - - `value` is any legal JavaScript value (including undefined, a thenable, or a promise). - - `exception` is a value that is thrown using the throw statement. - - `reason` is a value that indicates why a promise was rejected. - - `settled` the final resting state of a promise, fulfilled or rejected. - - A promise can be in one of three states: pending, fulfilled, or rejected. - - Promises that are fulfilled have a fulfillment value and are in the fulfilled - state. Promises that are rejected have a rejection reason and are in the - rejected state. A fulfillment value is never a thenable. - - Promises can also be said to *resolve* a value. If this value is also a - promise, then the original promise's settled state will match the value's - settled state. So a promise that *resolves* a promise that rejects will - itself reject, and a promise that *resolves* a promise that fulfills will - itself fulfill. - - - Basic Usage: - ------------ - - ```js - let promise = new Promise(function(resolve, reject) { - // on success - resolve(value); - - // on failure - reject(reason); - }); - - promise.then(function(value) { - // on fulfillment - }, function(reason) { - // on rejection - }); - ``` - - Advanced Usage: - --------------- - - Promises shine when abstracting away asynchronous interactions such as - `XMLHttpRequest`s. - - ```js - function getJSON(url) { - return new Promise(function(resolve, reject){ - let xhr = new XMLHttpRequest(); - - xhr.open('GET', url); - xhr.onreadystatechange = handler; - xhr.responseType = 'json'; - xhr.setRequestHeader('Accept', 'application/json'); - xhr.send(); - - function handler() { - if (this.readyState === this.DONE) { - if (this.status === 200) { - resolve(this.response); - } else { - reject(new Error('getJSON: `' + url + '` failed with status: [' + this.status + ']')); - } - } - }; - }); - } - - getJSON('/posts.json').then(function(json) { - // on fulfillment - }, function(reason) { - // on rejection - }); - ``` - - Unlike callbacks, promises are great composable primitives. - - ```js - Promise.all([ - getJSON('/posts'), - getJSON('/comments') - ]).then(function(values){ - values[0] // => postsJSON - values[1] // => commentsJSON - - return values; - }); - ``` - - @class Promise - @param {Function} resolver - Useful for tooling. - @constructor -*/ - -var Promise$1 = function () { - function Promise(resolver) { - this[PROMISE_ID] = nextId(); - this._result = this._state = undefined; - this._subscribers = []; - - if (noop !== resolver) { - typeof resolver !== 'function' && needsResolver(); - this instanceof Promise ? initializePromise(this, resolver) : needsNew(); - } - } - - /** - The primary way of interacting with a promise is through its `then` method, - which registers callbacks to receive either a promise's eventual value or the - reason why the promise cannot be fulfilled. - ```js - findUser().then(function(user){ - // user is available - }, function(reason){ - // user is unavailable, and you are given the reason why - }); - ``` - Chaining - -------- - The return value of `then` is itself a promise. This second, 'downstream' - promise is resolved with the return value of the first promise's fulfillment - or rejection handler, or rejected if the handler throws an exception. - ```js - findUser().then(function (user) { - return user.name; - }, function (reason) { - return 'default name'; - }).then(function (userName) { - // If `findUser` fulfilled, `userName` will be the user's name, otherwise it - // will be `'default name'` - }); - findUser().then(function (user) { - throw new Error('Found user, but still unhappy'); - }, function (reason) { - throw new Error('`findUser` rejected and we're unhappy'); - }).then(function (value) { - // never reached - }, function (reason) { - // if `findUser` fulfilled, `reason` will be 'Found user, but still unhappy'. - // If `findUser` rejected, `reason` will be '`findUser` rejected and we're unhappy'. - }); - ``` - If the downstream promise does not specify a rejection handler, rejection reasons will be propagated further downstream. - ```js - findUser().then(function (user) { - throw new PedagogicalException('Upstream error'); - }).then(function (value) { - // never reached - }).then(function (value) { - // never reached - }, function (reason) { - // The `PedgagocialException` is propagated all the way down to here - }); - ``` - Assimilation - ------------ - Sometimes the value you want to propagate to a downstream promise can only be - retrieved asynchronously. This can be achieved by returning a promise in the - fulfillment or rejection handler. The downstream promise will then be pending - until the returned promise is settled. This is called *assimilation*. - ```js - findUser().then(function (user) { - return findCommentsByAuthor(user); - }).then(function (comments) { - // The user's comments are now available - }); - ``` - If the assimliated promise rejects, then the downstream promise will also reject. - ```js - findUser().then(function (user) { - return findCommentsByAuthor(user); - }).then(function (comments) { - // If `findCommentsByAuthor` fulfills, we'll have the value here - }, function (reason) { - // If `findCommentsByAuthor` rejects, we'll have the reason here - }); - ``` - Simple Example - -------------- - Synchronous Example - ```javascript - let result; - try { - result = findResult(); - // success - } catch(reason) { - // failure - } - ``` - Errback Example - ```js - findResult(function(result, err){ - if (err) { - // failure - } else { - // success - } - }); - ``` - Promise Example; - ```javascript - findResult().then(function(result){ - // success - }, function(reason){ - // failure - }); - ``` - Advanced Example - -------------- - Synchronous Example - ```javascript - let author, books; - try { - author = findAuthor(); - books = findBooksByAuthor(author); - // success - } catch(reason) { - // failure - } - ``` - Errback Example - ```js - function foundBooks(books) { - } - function failure(reason) { - } - findAuthor(function(author, err){ - if (err) { - failure(err); - // failure - } else { - try { - findBoooksByAuthor(author, function(books, err) { - if (err) { - failure(err); - } else { - try { - foundBooks(books); - } catch(reason) { - failure(reason); - } - } - }); - } catch(error) { - failure(err); - } - // success - } - }); - ``` - Promise Example; - ```javascript - findAuthor(). - then(findBooksByAuthor). - then(function(books){ - // found books - }).catch(function(reason){ - // something went wrong - }); - ``` - @method then - @param {Function} onFulfilled - @param {Function} onRejected - Useful for tooling. - @return {Promise} - */ - - /** - `catch` is simply sugar for `then(undefined, onRejection)` which makes it the same - as the catch block of a try/catch statement. - ```js - function findAuthor(){ - throw new Error('couldn't find that author'); - } - // synchronous - try { - findAuthor(); - } catch(reason) { - // something went wrong - } - // async with promises - findAuthor().catch(function(reason){ - // something went wrong - }); - ``` - @method catch - @param {Function} onRejection - Useful for tooling. - @return {Promise} - */ - - - Promise.prototype.catch = function _catch(onRejection) { - return this.then(null, onRejection); - }; - - /** - `finally` will be invoked regardless of the promise's fate just as native - try/catch/finally behaves - - Synchronous example: - - ```js - findAuthor() { - if (Math.random() > 0.5) { - throw new Error(); - } - return new Author(); - } - - try { - return findAuthor(); // succeed or fail - } catch(error) { - return findOtherAuther(); - } finally { - // always runs - // doesn't affect the return value - } - ``` - - Asynchronous example: - - ```js - findAuthor().catch(function(reason){ - return findOtherAuther(); - }).finally(function(){ - // author was either found, or not - }); - ``` - - @method finally - @param {Function} callback - @return {Promise} - */ - - - Promise.prototype.finally = function _finally(callback) { - var promise = this; - var constructor = promise.constructor; - - if (isFunction(callback)) { - return promise.then(function (value) { - return constructor.resolve(callback()).then(function () { - return value; - }); - }, function (reason) { - return constructor.resolve(callback()).then(function () { - throw reason; - }); - }); - } - - return promise.then(callback, callback); - }; - - return Promise; -}(); - -Promise$1.prototype.then = then; -Promise$1.all = all; -Promise$1.race = race; -Promise$1.resolve = resolve$1; -Promise$1.reject = reject$1; -Promise$1._setScheduler = setScheduler; -Promise$1._setAsap = setAsap; -Promise$1._asap = asap; - -/*global self*/ -function polyfill() { - var local = void 0; - - if (typeof global !== 'undefined') { - local = global; - } else if (typeof self !== 'undefined') { - local = self; - } else { - try { - local = Function('return this')(); - } catch (e) { - throw new Error('polyfill failed because global object is unavailable in this environment'); - } - } - - var P = local.Promise; - - if (P) { - var promiseToString = null; - try { - promiseToString = Object.prototype.toString.call(P.resolve()); - } catch (e) { - // silently ignored - } - - if (promiseToString === '[object Promise]' && !P.cast) { - return; - } - } - - local.Promise = Promise$1; -} - -// Strange compat.. -Promise$1.polyfill = polyfill; -Promise$1.Promise = Promise$1; - -return Promise$1; - -}))); - - - -//# sourceMappingURL=es6-promise.map diff --git a/deps/npm/node_modules/es6-promise/dist/es6-promise.map b/deps/npm/node_modules/es6-promise/dist/es6-promise.map deleted file mode 100644 index 27db4142fdcd78..00000000000000 --- a/deps/npm/node_modules/es6-promise/dist/es6-promise.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["config/versionTemplate.txt","lib/es6-promise/utils.js","lib/es6-promise/asap.js","lib/es6-promise/then.js","lib/es6-promise/promise/resolve.js","lib/es6-promise/-internal.js","lib/es6-promise/enumerator.js","lib/es6-promise/promise/all.js","lib/es6-promise/promise/race.js","lib/es6-promise/promise/reject.js","lib/es6-promise/promise.js","lib/es6-promise/polyfill.js","lib/es6-promise.js"],"sourcesContent":["/*!\n * @overview es6-promise - a tiny implementation of Promises/A+.\n * @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors (Conversion to ES6 API by Jake Archibald)\n * @license Licensed under MIT license\n * See https://raw.githubusercontent.com/stefanpenner/es6-promise/master/LICENSE\n * @version v4.2.8+1e68dce6\n */\n","export function objectOrFunction(x) {\n var type = typeof x;\n return x !== null && (type === 'object' || type === 'function');\n}\n\nexport function isFunction(x) {\n return typeof x === 'function';\n}\n\nexport function isMaybeThenable(x) {\n return x !== null && typeof x === 'object';\n}\n\nvar _isArray = void 0;\nif (Array.isArray) {\n _isArray = Array.isArray;\n} else {\n _isArray = function (x) {\n return Object.prototype.toString.call(x) === '[object Array]';\n };\n}\n\nexport var isArray = _isArray;","var len = 0;\nvar vertxNext = void 0;\nvar customSchedulerFn = void 0;\n\nexport var asap = function asap(callback, arg) {\n queue[len] = callback;\n queue[len + 1] = arg;\n len += 2;\n if (len === 2) {\n // If len is 2, that means that we need to schedule an async flush.\n // If additional callbacks are queued before the queue is flushed, they\n // will be processed by this flush that we are scheduling.\n if (customSchedulerFn) {\n customSchedulerFn(flush);\n } else {\n scheduleFlush();\n }\n }\n};\n\nexport function setScheduler(scheduleFn) {\n customSchedulerFn = scheduleFn;\n}\n\nexport function setAsap(asapFn) {\n asap = asapFn;\n}\n\nvar browserWindow = typeof window !== 'undefined' ? window : undefined;\nvar browserGlobal = browserWindow || {};\nvar BrowserMutationObserver = browserGlobal.MutationObserver || browserGlobal.WebKitMutationObserver;\nvar isNode = typeof self === 'undefined' && typeof process !== 'undefined' && {}.toString.call(process) === '[object process]';\n\n// test for web worker but not in IE10\nvar isWorker = typeof Uint8ClampedArray !== 'undefined' && typeof importScripts !== 'undefined' && typeof MessageChannel !== 'undefined';\n\n// node\nfunction useNextTick() {\n // node version 0.10.x displays a deprecation warning when nextTick is used recursively\n // see https://github.com/cujojs/when/issues/410 for details\n return function () {\n return process.nextTick(flush);\n };\n}\n\n// vertx\nfunction useVertxTimer() {\n if (typeof vertxNext !== 'undefined') {\n return function () {\n vertxNext(flush);\n };\n }\n\n return useSetTimeout();\n}\n\nfunction useMutationObserver() {\n var iterations = 0;\n var observer = new BrowserMutationObserver(flush);\n var node = document.createTextNode('');\n observer.observe(node, { characterData: true });\n\n return function () {\n node.data = iterations = ++iterations % 2;\n };\n}\n\n// web worker\nfunction useMessageChannel() {\n var channel = new MessageChannel();\n channel.port1.onmessage = flush;\n return function () {\n return channel.port2.postMessage(0);\n };\n}\n\nfunction useSetTimeout() {\n // Store setTimeout reference so es6-promise will be unaffected by\n // other code modifying setTimeout (like sinon.useFakeTimers())\n var globalSetTimeout = setTimeout;\n return function () {\n return globalSetTimeout(flush, 1);\n };\n}\n\nvar queue = new Array(1000);\nfunction flush() {\n for (var i = 0; i < len; i += 2) {\n var callback = queue[i];\n var arg = queue[i + 1];\n\n callback(arg);\n\n queue[i] = undefined;\n queue[i + 1] = undefined;\n }\n\n len = 0;\n}\n\nfunction attemptVertx() {\n try {\n var vertx = Function('return this')().require('vertx');\n vertxNext = vertx.runOnLoop || vertx.runOnContext;\n return useVertxTimer();\n } catch (e) {\n return useSetTimeout();\n }\n}\n\nvar scheduleFlush = void 0;\n// Decide what async method to use to triggering processing of queued callbacks:\nif (isNode) {\n scheduleFlush = useNextTick();\n} else if (BrowserMutationObserver) {\n scheduleFlush = useMutationObserver();\n} else if (isWorker) {\n scheduleFlush = useMessageChannel();\n} else if (browserWindow === undefined && typeof require === 'function') {\n scheduleFlush = attemptVertx();\n} else {\n scheduleFlush = useSetTimeout();\n}","import { invokeCallback, subscribe, FULFILLED, REJECTED, noop, makePromise, PROMISE_ID } from './-internal';\n\nimport { asap } from './asap';\n\nexport default function then(onFulfillment, onRejection) {\n var parent = this;\n\n var child = new this.constructor(noop);\n\n if (child[PROMISE_ID] === undefined) {\n makePromise(child);\n }\n\n var _state = parent._state;\n\n\n if (_state) {\n var callback = arguments[_state - 1];\n asap(function () {\n return invokeCallback(_state, child, callback, parent._result);\n });\n } else {\n subscribe(parent, child, onFulfillment, onRejection);\n }\n\n return child;\n}","import { noop, resolve as _resolve } from '../-internal';\n\n/**\n `Promise.resolve` returns a promise that will become resolved with the\n passed `value`. It is shorthand for the following:\n\n ```javascript\n let promise = new Promise(function(resolve, reject){\n resolve(1);\n });\n\n promise.then(function(value){\n // value === 1\n });\n ```\n\n Instead of writing the above, your code now simply becomes the following:\n\n ```javascript\n let promise = Promise.resolve(1);\n\n promise.then(function(value){\n // value === 1\n });\n ```\n\n @method resolve\n @static\n @param {Any} value value that the returned promise will be resolved with\n Useful for tooling.\n @return {Promise} a promise that will become fulfilled with the given\n `value`\n*/\nexport default function resolve(object) {\n /*jshint validthis:true */\n var Constructor = this;\n\n if (object && typeof object === 'object' && object.constructor === Constructor) {\n return object;\n }\n\n var promise = new Constructor(noop);\n _resolve(promise, object);\n return promise;\n}","import { objectOrFunction, isFunction } from './utils';\n\nimport { asap } from './asap';\n\nimport originalThen from './then';\nimport originalResolve from './promise/resolve';\n\nexport var PROMISE_ID = Math.random().toString(36).substring(2);\n\nfunction noop() {}\n\nvar PENDING = void 0;\nvar FULFILLED = 1;\nvar REJECTED = 2;\n\nfunction selfFulfillment() {\n return new TypeError(\"You cannot resolve a promise with itself\");\n}\n\nfunction cannotReturnOwn() {\n return new TypeError('A promises callback cannot return that same promise.');\n}\n\nfunction tryThen(then, value, fulfillmentHandler, rejectionHandler) {\n try {\n then.call(value, fulfillmentHandler, rejectionHandler);\n } catch (e) {\n return e;\n }\n}\n\nfunction handleForeignThenable(promise, thenable, then) {\n asap(function (promise) {\n var sealed = false;\n var error = tryThen(then, thenable, function (value) {\n if (sealed) {\n return;\n }\n sealed = true;\n if (thenable !== value) {\n resolve(promise, value);\n } else {\n fulfill(promise, value);\n }\n }, function (reason) {\n if (sealed) {\n return;\n }\n sealed = true;\n\n reject(promise, reason);\n }, 'Settle: ' + (promise._label || ' unknown promise'));\n\n if (!sealed && error) {\n sealed = true;\n reject(promise, error);\n }\n }, promise);\n}\n\nfunction handleOwnThenable(promise, thenable) {\n if (thenable._state === FULFILLED) {\n fulfill(promise, thenable._result);\n } else if (thenable._state === REJECTED) {\n reject(promise, thenable._result);\n } else {\n subscribe(thenable, undefined, function (value) {\n return resolve(promise, value);\n }, function (reason) {\n return reject(promise, reason);\n });\n }\n}\n\nfunction handleMaybeThenable(promise, maybeThenable, then) {\n if (maybeThenable.constructor === promise.constructor && then === originalThen && maybeThenable.constructor.resolve === originalResolve) {\n handleOwnThenable(promise, maybeThenable);\n } else {\n if (then === undefined) {\n fulfill(promise, maybeThenable);\n } else if (isFunction(then)) {\n handleForeignThenable(promise, maybeThenable, then);\n } else {\n fulfill(promise, maybeThenable);\n }\n }\n}\n\nfunction resolve(promise, value) {\n if (promise === value) {\n reject(promise, selfFulfillment());\n } else if (objectOrFunction(value)) {\n var then = void 0;\n try {\n then = value.then;\n } catch (error) {\n reject(promise, error);\n return;\n }\n handleMaybeThenable(promise, value, then);\n } else {\n fulfill(promise, value);\n }\n}\n\nfunction publishRejection(promise) {\n if (promise._onerror) {\n promise._onerror(promise._result);\n }\n\n publish(promise);\n}\n\nfunction fulfill(promise, value) {\n if (promise._state !== PENDING) {\n return;\n }\n\n promise._result = value;\n promise._state = FULFILLED;\n\n if (promise._subscribers.length !== 0) {\n asap(publish, promise);\n }\n}\n\nfunction reject(promise, reason) {\n if (promise._state !== PENDING) {\n return;\n }\n promise._state = REJECTED;\n promise._result = reason;\n\n asap(publishRejection, promise);\n}\n\nfunction subscribe(parent, child, onFulfillment, onRejection) {\n var _subscribers = parent._subscribers;\n var length = _subscribers.length;\n\n\n parent._onerror = null;\n\n _subscribers[length] = child;\n _subscribers[length + FULFILLED] = onFulfillment;\n _subscribers[length + REJECTED] = onRejection;\n\n if (length === 0 && parent._state) {\n asap(publish, parent);\n }\n}\n\nfunction publish(promise) {\n var subscribers = promise._subscribers;\n var settled = promise._state;\n\n if (subscribers.length === 0) {\n return;\n }\n\n var child = void 0,\n callback = void 0,\n detail = promise._result;\n\n for (var i = 0; i < subscribers.length; i += 3) {\n child = subscribers[i];\n callback = subscribers[i + settled];\n\n if (child) {\n invokeCallback(settled, child, callback, detail);\n } else {\n callback(detail);\n }\n }\n\n promise._subscribers.length = 0;\n}\n\nfunction invokeCallback(settled, promise, callback, detail) {\n var hasCallback = isFunction(callback),\n value = void 0,\n error = void 0,\n succeeded = true;\n\n if (hasCallback) {\n try {\n value = callback(detail);\n } catch (e) {\n succeeded = false;\n error = e;\n }\n\n if (promise === value) {\n reject(promise, cannotReturnOwn());\n return;\n }\n } else {\n value = detail;\n }\n\n if (promise._state !== PENDING) {\n // noop\n } else if (hasCallback && succeeded) {\n resolve(promise, value);\n } else if (succeeded === false) {\n reject(promise, error);\n } else if (settled === FULFILLED) {\n fulfill(promise, value);\n } else if (settled === REJECTED) {\n reject(promise, value);\n }\n}\n\nfunction initializePromise(promise, resolver) {\n try {\n resolver(function resolvePromise(value) {\n resolve(promise, value);\n }, function rejectPromise(reason) {\n reject(promise, reason);\n });\n } catch (e) {\n reject(promise, e);\n }\n}\n\nvar id = 0;\nfunction nextId() {\n return id++;\n}\n\nfunction makePromise(promise) {\n promise[PROMISE_ID] = id++;\n promise._state = undefined;\n promise._result = undefined;\n promise._subscribers = [];\n}\n\nexport { nextId, makePromise, noop, resolve, reject, fulfill, subscribe, publish, publishRejection, initializePromise, invokeCallback, FULFILLED, REJECTED, PENDING, handleMaybeThenable };","function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nimport { isArray, isMaybeThenable } from './utils';\nimport { noop, reject, fulfill, subscribe, FULFILLED, REJECTED, PENDING, handleMaybeThenable } from './-internal';\n\nimport then from './then';\nimport Promise from './promise';\nimport originalResolve from './promise/resolve';\nimport originalThen from './then';\nimport { makePromise, PROMISE_ID } from './-internal';\n\nfunction validationError() {\n return new Error('Array Methods must be provided an Array');\n};\n\nvar Enumerator = function () {\n function Enumerator(Constructor, input) {\n this._instanceConstructor = Constructor;\n this.promise = new Constructor(noop);\n\n if (!this.promise[PROMISE_ID]) {\n makePromise(this.promise);\n }\n\n if (isArray(input)) {\n this.length = input.length;\n this._remaining = input.length;\n\n this._result = new Array(this.length);\n\n if (this.length === 0) {\n fulfill(this.promise, this._result);\n } else {\n this.length = this.length || 0;\n this._enumerate(input);\n if (this._remaining === 0) {\n fulfill(this.promise, this._result);\n }\n }\n } else {\n reject(this.promise, validationError());\n }\n }\n\n Enumerator.prototype._enumerate = function _enumerate(input) {\n for (var i = 0; this._state === PENDING && i < input.length; i++) {\n this._eachEntry(input[i], i);\n }\n };\n\n Enumerator.prototype._eachEntry = function _eachEntry(entry, i) {\n var c = this._instanceConstructor;\n var resolve = c.resolve;\n\n\n if (resolve === originalResolve) {\n var _then = void 0;\n var error = void 0;\n var didError = false;\n try {\n _then = entry.then;\n } catch (e) {\n didError = true;\n error = e;\n }\n\n if (_then === originalThen && entry._state !== PENDING) {\n this._settledAt(entry._state, i, entry._result);\n } else if (typeof _then !== 'function') {\n this._remaining--;\n this._result[i] = entry;\n } else if (c === Promise) {\n var promise = new c(noop);\n if (didError) {\n reject(promise, error);\n } else {\n handleMaybeThenable(promise, entry, _then);\n }\n this._willSettleAt(promise, i);\n } else {\n this._willSettleAt(new c(function (resolve) {\n return resolve(entry);\n }), i);\n }\n } else {\n this._willSettleAt(resolve(entry), i);\n }\n };\n\n Enumerator.prototype._settledAt = function _settledAt(state, i, value) {\n var promise = this.promise;\n\n\n if (promise._state === PENDING) {\n this._remaining--;\n\n if (state === REJECTED) {\n reject(promise, value);\n } else {\n this._result[i] = value;\n }\n }\n\n if (this._remaining === 0) {\n fulfill(promise, this._result);\n }\n };\n\n Enumerator.prototype._willSettleAt = function _willSettleAt(promise, i) {\n var enumerator = this;\n\n subscribe(promise, undefined, function (value) {\n return enumerator._settledAt(FULFILLED, i, value);\n }, function (reason) {\n return enumerator._settledAt(REJECTED, i, reason);\n });\n };\n\n return Enumerator;\n}();\n\nexport default Enumerator;\n;","import Enumerator from '../enumerator';\n\n/**\n `Promise.all` accepts an array of promises, and returns a new promise which\n is fulfilled with an array of fulfillment values for the passed promises, or\n rejected with the reason of the first passed promise to be rejected. It casts all\n elements of the passed iterable to promises as it runs this algorithm.\n\n Example:\n\n ```javascript\n let promise1 = resolve(1);\n let promise2 = resolve(2);\n let promise3 = resolve(3);\n let promises = [ promise1, promise2, promise3 ];\n\n Promise.all(promises).then(function(array){\n // The array here would be [ 1, 2, 3 ];\n });\n ```\n\n If any of the `promises` given to `all` are rejected, the first promise\n that is rejected will be given as an argument to the returned promises's\n rejection handler. For example:\n\n Example:\n\n ```javascript\n let promise1 = resolve(1);\n let promise2 = reject(new Error(\"2\"));\n let promise3 = reject(new Error(\"3\"));\n let promises = [ promise1, promise2, promise3 ];\n\n Promise.all(promises).then(function(array){\n // Code here never runs because there are rejected promises!\n }, function(error) {\n // error.message === \"2\"\n });\n ```\n\n @method all\n @static\n @param {Array} entries array of promises\n @param {String} label optional string for labeling the promise.\n Useful for tooling.\n @return {Promise} promise that is fulfilled when all `promises` have been\n fulfilled, or rejected if any of them become rejected.\n @static\n*/\nexport default function all(entries) {\n return new Enumerator(this, entries).promise;\n}","import { isArray } from \"../utils\";\n\n/**\n `Promise.race` returns a new promise which is settled in the same way as the\n first passed promise to settle.\n\n Example:\n\n ```javascript\n let promise1 = new Promise(function(resolve, reject){\n setTimeout(function(){\n resolve('promise 1');\n }, 200);\n });\n\n let promise2 = new Promise(function(resolve, reject){\n setTimeout(function(){\n resolve('promise 2');\n }, 100);\n });\n\n Promise.race([promise1, promise2]).then(function(result){\n // result === 'promise 2' because it was resolved before promise1\n // was resolved.\n });\n ```\n\n `Promise.race` is deterministic in that only the state of the first\n settled promise matters. For example, even if other promises given to the\n `promises` array argument are resolved, but the first settled promise has\n become rejected before the other promises became fulfilled, the returned\n promise will become rejected:\n\n ```javascript\n let promise1 = new Promise(function(resolve, reject){\n setTimeout(function(){\n resolve('promise 1');\n }, 200);\n });\n\n let promise2 = new Promise(function(resolve, reject){\n setTimeout(function(){\n reject(new Error('promise 2'));\n }, 100);\n });\n\n Promise.race([promise1, promise2]).then(function(result){\n // Code here never runs\n }, function(reason){\n // reason.message === 'promise 2' because promise 2 became rejected before\n // promise 1 became fulfilled\n });\n ```\n\n An example real-world use case is implementing timeouts:\n\n ```javascript\n Promise.race([ajax('foo.json'), timeout(5000)])\n ```\n\n @method race\n @static\n @param {Array} promises array of promises to observe\n Useful for tooling.\n @return {Promise} a promise which settles in the same way as the first passed\n promise to settle.\n*/\nexport default function race(entries) {\n /*jshint validthis:true */\n var Constructor = this;\n\n if (!isArray(entries)) {\n return new Constructor(function (_, reject) {\n return reject(new TypeError('You must pass an array to race.'));\n });\n } else {\n return new Constructor(function (resolve, reject) {\n var length = entries.length;\n for (var i = 0; i < length; i++) {\n Constructor.resolve(entries[i]).then(resolve, reject);\n }\n });\n }\n}","import { noop, reject as _reject } from '../-internal';\n\n/**\n `Promise.reject` returns a promise rejected with the passed `reason`.\n It is shorthand for the following:\n\n ```javascript\n let promise = new Promise(function(resolve, reject){\n reject(new Error('WHOOPS'));\n });\n\n promise.then(function(value){\n // Code here doesn't run because the promise is rejected!\n }, function(reason){\n // reason.message === 'WHOOPS'\n });\n ```\n\n Instead of writing the above, your code now simply becomes the following:\n\n ```javascript\n let promise = Promise.reject(new Error('WHOOPS'));\n\n promise.then(function(value){\n // Code here doesn't run because the promise is rejected!\n }, function(reason){\n // reason.message === 'WHOOPS'\n });\n ```\n\n @method reject\n @static\n @param {Any} reason value that the returned promise will be rejected with.\n Useful for tooling.\n @return {Promise} a promise rejected with the given `reason`.\n*/\nexport default function reject(reason) {\n /*jshint validthis:true */\n var Constructor = this;\n var promise = new Constructor(noop);\n _reject(promise, reason);\n return promise;\n}","function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nimport { isFunction } from './utils';\nimport { noop, nextId, PROMISE_ID, initializePromise } from './-internal';\nimport { asap, setAsap, setScheduler } from './asap';\n\nimport all from './promise/all';\nimport race from './promise/race';\nimport Resolve from './promise/resolve';\nimport Reject from './promise/reject';\nimport then from './then';\n\nfunction needsResolver() {\n throw new TypeError('You must pass a resolver function as the first argument to the promise constructor');\n}\n\nfunction needsNew() {\n throw new TypeError(\"Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.\");\n}\n\n/**\n Promise objects represent the eventual result of an asynchronous operation. The\n primary way of interacting with a promise is through its `then` method, which\n registers callbacks to receive either a promise's eventual value or the reason\n why the promise cannot be fulfilled.\n\n Terminology\n -----------\n\n - `promise` is an object or function with a `then` method whose behavior conforms to this specification.\n - `thenable` is an object or function that defines a `then` method.\n - `value` is any legal JavaScript value (including undefined, a thenable, or a promise).\n - `exception` is a value that is thrown using the throw statement.\n - `reason` is a value that indicates why a promise was rejected.\n - `settled` the final resting state of a promise, fulfilled or rejected.\n\n A promise can be in one of three states: pending, fulfilled, or rejected.\n\n Promises that are fulfilled have a fulfillment value and are in the fulfilled\n state. Promises that are rejected have a rejection reason and are in the\n rejected state. A fulfillment value is never a thenable.\n\n Promises can also be said to *resolve* a value. If this value is also a\n promise, then the original promise's settled state will match the value's\n settled state. So a promise that *resolves* a promise that rejects will\n itself reject, and a promise that *resolves* a promise that fulfills will\n itself fulfill.\n\n\n Basic Usage:\n ------------\n\n ```js\n let promise = new Promise(function(resolve, reject) {\n // on success\n resolve(value);\n\n // on failure\n reject(reason);\n });\n\n promise.then(function(value) {\n // on fulfillment\n }, function(reason) {\n // on rejection\n });\n ```\n\n Advanced Usage:\n ---------------\n\n Promises shine when abstracting away asynchronous interactions such as\n `XMLHttpRequest`s.\n\n ```js\n function getJSON(url) {\n return new Promise(function(resolve, reject){\n let xhr = new XMLHttpRequest();\n\n xhr.open('GET', url);\n xhr.onreadystatechange = handler;\n xhr.responseType = 'json';\n xhr.setRequestHeader('Accept', 'application/json');\n xhr.send();\n\n function handler() {\n if (this.readyState === this.DONE) {\n if (this.status === 200) {\n resolve(this.response);\n } else {\n reject(new Error('getJSON: `' + url + '` failed with status: [' + this.status + ']'));\n }\n }\n };\n });\n }\n\n getJSON('/posts.json').then(function(json) {\n // on fulfillment\n }, function(reason) {\n // on rejection\n });\n ```\n\n Unlike callbacks, promises are great composable primitives.\n\n ```js\n Promise.all([\n getJSON('/posts'),\n getJSON('/comments')\n ]).then(function(values){\n values[0] // => postsJSON\n values[1] // => commentsJSON\n\n return values;\n });\n ```\n\n @class Promise\n @param {Function} resolver\n Useful for tooling.\n @constructor\n*/\n\nvar Promise = function () {\n function Promise(resolver) {\n this[PROMISE_ID] = nextId();\n this._result = this._state = undefined;\n this._subscribers = [];\n\n if (noop !== resolver) {\n typeof resolver !== 'function' && needsResolver();\n this instanceof Promise ? initializePromise(this, resolver) : needsNew();\n }\n }\n\n /**\n The primary way of interacting with a promise is through its `then` method,\n which registers callbacks to receive either a promise's eventual value or the\n reason why the promise cannot be fulfilled.\n ```js\n findUser().then(function(user){\n // user is available\n }, function(reason){\n // user is unavailable, and you are given the reason why\n });\n ```\n Chaining\n --------\n The return value of `then` is itself a promise. This second, 'downstream'\n promise is resolved with the return value of the first promise's fulfillment\n or rejection handler, or rejected if the handler throws an exception.\n ```js\n findUser().then(function (user) {\n return user.name;\n }, function (reason) {\n return 'default name';\n }).then(function (userName) {\n // If `findUser` fulfilled, `userName` will be the user's name, otherwise it\n // will be `'default name'`\n });\n findUser().then(function (user) {\n throw new Error('Found user, but still unhappy');\n }, function (reason) {\n throw new Error('`findUser` rejected and we're unhappy');\n }).then(function (value) {\n // never reached\n }, function (reason) {\n // if `findUser` fulfilled, `reason` will be 'Found user, but still unhappy'.\n // If `findUser` rejected, `reason` will be '`findUser` rejected and we're unhappy'.\n });\n ```\n If the downstream promise does not specify a rejection handler, rejection reasons will be propagated further downstream.\n ```js\n findUser().then(function (user) {\n throw new PedagogicalException('Upstream error');\n }).then(function (value) {\n // never reached\n }).then(function (value) {\n // never reached\n }, function (reason) {\n // The `PedgagocialException` is propagated all the way down to here\n });\n ```\n Assimilation\n ------------\n Sometimes the value you want to propagate to a downstream promise can only be\n retrieved asynchronously. This can be achieved by returning a promise in the\n fulfillment or rejection handler. The downstream promise will then be pending\n until the returned promise is settled. This is called *assimilation*.\n ```js\n findUser().then(function (user) {\n return findCommentsByAuthor(user);\n }).then(function (comments) {\n // The user's comments are now available\n });\n ```\n If the assimliated promise rejects, then the downstream promise will also reject.\n ```js\n findUser().then(function (user) {\n return findCommentsByAuthor(user);\n }).then(function (comments) {\n // If `findCommentsByAuthor` fulfills, we'll have the value here\n }, function (reason) {\n // If `findCommentsByAuthor` rejects, we'll have the reason here\n });\n ```\n Simple Example\n --------------\n Synchronous Example\n ```javascript\n let result;\n try {\n result = findResult();\n // success\n } catch(reason) {\n // failure\n }\n ```\n Errback Example\n ```js\n findResult(function(result, err){\n if (err) {\n // failure\n } else {\n // success\n }\n });\n ```\n Promise Example;\n ```javascript\n findResult().then(function(result){\n // success\n }, function(reason){\n // failure\n });\n ```\n Advanced Example\n --------------\n Synchronous Example\n ```javascript\n let author, books;\n try {\n author = findAuthor();\n books = findBooksByAuthor(author);\n // success\n } catch(reason) {\n // failure\n }\n ```\n Errback Example\n ```js\n function foundBooks(books) {\n }\n function failure(reason) {\n }\n findAuthor(function(author, err){\n if (err) {\n failure(err);\n // failure\n } else {\n try {\n findBoooksByAuthor(author, function(books, err) {\n if (err) {\n failure(err);\n } else {\n try {\n foundBooks(books);\n } catch(reason) {\n failure(reason);\n }\n }\n });\n } catch(error) {\n failure(err);\n }\n // success\n }\n });\n ```\n Promise Example;\n ```javascript\n findAuthor().\n then(findBooksByAuthor).\n then(function(books){\n // found books\n }).catch(function(reason){\n // something went wrong\n });\n ```\n @method then\n @param {Function} onFulfilled\n @param {Function} onRejected\n Useful for tooling.\n @return {Promise}\n */\n\n /**\n `catch` is simply sugar for `then(undefined, onRejection)` which makes it the same\n as the catch block of a try/catch statement.\n ```js\n function findAuthor(){\n throw new Error('couldn't find that author');\n }\n // synchronous\n try {\n findAuthor();\n } catch(reason) {\n // something went wrong\n }\n // async with promises\n findAuthor().catch(function(reason){\n // something went wrong\n });\n ```\n @method catch\n @param {Function} onRejection\n Useful for tooling.\n @return {Promise}\n */\n\n\n Promise.prototype.catch = function _catch(onRejection) {\n return this.then(null, onRejection);\n };\n\n /**\n `finally` will be invoked regardless of the promise's fate just as native\n try/catch/finally behaves\n \n Synchronous example:\n \n ```js\n findAuthor() {\n if (Math.random() > 0.5) {\n throw new Error();\n }\n return new Author();\n }\n \n try {\n return findAuthor(); // succeed or fail\n } catch(error) {\n return findOtherAuther();\n } finally {\n // always runs\n // doesn't affect the return value\n }\n ```\n \n Asynchronous example:\n \n ```js\n findAuthor().catch(function(reason){\n return findOtherAuther();\n }).finally(function(){\n // author was either found, or not\n });\n ```\n \n @method finally\n @param {Function} callback\n @return {Promise}\n */\n\n\n Promise.prototype.finally = function _finally(callback) {\n var promise = this;\n var constructor = promise.constructor;\n\n if (isFunction(callback)) {\n return promise.then(function (value) {\n return constructor.resolve(callback()).then(function () {\n return value;\n });\n }, function (reason) {\n return constructor.resolve(callback()).then(function () {\n throw reason;\n });\n });\n }\n\n return promise.then(callback, callback);\n };\n\n return Promise;\n}();\n\nPromise.prototype.then = then;\nexport default Promise;\nPromise.all = all;\nPromise.race = race;\nPromise.resolve = Resolve;\nPromise.reject = Reject;\nPromise._setScheduler = setScheduler;\nPromise._setAsap = setAsap;\nPromise._asap = asap;","/*global self*/\nimport Promise from './promise';\n\nexport default function polyfill() {\n var local = void 0;\n\n if (typeof global !== 'undefined') {\n local = global;\n } else if (typeof self !== 'undefined') {\n local = self;\n } else {\n try {\n local = Function('return this')();\n } catch (e) {\n throw new Error('polyfill failed because global object is unavailable in this environment');\n }\n }\n\n var P = local.Promise;\n\n if (P) {\n var promiseToString = null;\n try {\n promiseToString = Object.prototype.toString.call(P.resolve());\n } catch (e) {\n // silently ignored\n }\n\n if (promiseToString === '[object Promise]' && !P.cast) {\n return;\n }\n }\n\n local.Promise = Promise;\n}","import Promise from './es6-promise/promise';\nimport polyfill from './es6-promise/polyfill';\n\n// Strange compat..\nPromise.polyfill = polyfill;\nPromise.Promise = Promise;\nexport default Promise;"],"names":["resolve","_resolve","then","originalThen","originalResolve","Promise","reject","_reject","Resolve","Reject"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACNO,SAAS,gBAAgB,CAAC,CAAC,EAAE;EAClC,IAAI,IAAI,GAAG,OAAO,CAAC,CAAC;EACpB,OAAO,CAAC,KAAK,IAAI,KAAK,IAAI,KAAK,QAAQ,IAAI,IAAI,KAAK,UAAU,CAAC,CAAC;CACjE;;AAED,AAAO,SAAS,UAAU,CAAC,CAAC,EAAE;EAC5B,OAAO,OAAO,CAAC,KAAK,UAAU,CAAC;CAChC;;AAED,AAEC;;AAED,IAAI,QAAQ,GAAG,KAAK,CAAC,CAAC;AACtB,IAAI,KAAK,CAAC,OAAO,EAAE;EACjB,QAAQ,GAAG,KAAK,CAAC,OAAO,CAAC;CAC1B,MAAM;EACL,QAAQ,GAAG,UAAU,CAAC,EAAE;IACtB,OAAO,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,gBAAgB,CAAC;GAC/D,CAAC;CACH;;AAED,AAAO,IAAI,OAAO,GAAG,QAAQ;;ACtB7B,IAAI,GAAG,GAAG,CAAC,CAAC;AACZ,IAAI,SAAS,GAAG,KAAK,CAAC,CAAC;AACvB,IAAI,iBAAiB,GAAG,KAAK,CAAC,CAAC;;AAE/B,AAAO,IAAI,IAAI,GAAG,SAAS,IAAI,CAAC,QAAQ,EAAE,GAAG,EAAE;EAC7C,KAAK,CAAC,GAAG,CAAC,GAAG,QAAQ,CAAC;EACtB,KAAK,CAAC,GAAG,GAAG,CAAC,CAAC,GAAG,GAAG,CAAC;EACrB,GAAG,IAAI,CAAC,CAAC;EACT,IAAI,GAAG,KAAK,CAAC,EAAE;;;;IAIb,IAAI,iBAAiB,EAAE;MACrB,iBAAiB,CAAC,KAAK,CAAC,CAAC;KAC1B,MAAM;MACL,aAAa,EAAE,CAAC;KACjB;GACF;CACF,CAAC;;AAEF,AAAO,SAAS,YAAY,CAAC,UAAU,EAAE;EACvC,iBAAiB,GAAG,UAAU,CAAC;CAChC;;AAED,AAAO,SAAS,OAAO,CAAC,MAAM,EAAE;EAC9B,IAAI,GAAG,MAAM,CAAC;CACf;;AAED,IAAI,aAAa,GAAG,OAAO,MAAM,KAAK,WAAW,GAAG,MAAM,GAAG,SAAS,CAAC;AACvE,IAAI,aAAa,GAAG,aAAa,IAAI,EAAE,CAAC;AACxC,IAAI,uBAAuB,GAAG,aAAa,CAAC,gBAAgB,IAAI,aAAa,CAAC,sBAAsB,CAAC;AACrG,IAAI,MAAM,GAAG,OAAO,IAAI,KAAK,WAAW,IAAI,OAAO,OAAO,KAAK,WAAW,IAAI,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,kBAAkB,CAAC;;;AAG/H,IAAI,QAAQ,GAAG,OAAO,iBAAiB,KAAK,WAAW,IAAI,OAAO,aAAa,KAAK,WAAW,IAAI,OAAO,cAAc,KAAK,WAAW,CAAC;;;AAGzI,SAAS,WAAW,GAAG;;;EAGrB,OAAO,YAAY;IACjB,OAAO,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;GAChC,CAAC;CACH;;;AAGD,SAAS,aAAa,GAAG;EACvB,IAAI,OAAO,SAAS,KAAK,WAAW,EAAE;IACpC,OAAO,YAAY;MACjB,SAAS,CAAC,KAAK,CAAC,CAAC;KAClB,CAAC;GACH;;EAED,OAAO,aAAa,EAAE,CAAC;CACxB;;AAED,SAAS,mBAAmB,GAAG;EAC7B,IAAI,UAAU,GAAG,CAAC,CAAC;EACnB,IAAI,QAAQ,GAAG,IAAI,uBAAuB,CAAC,KAAK,CAAC,CAAC;EAClD,IAAI,IAAI,GAAG,QAAQ,CAAC,cAAc,CAAC,EAAE,CAAC,CAAC;EACvC,QAAQ,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,aAAa,EAAE,IAAI,EAAE,CAAC,CAAC;;EAEhD,OAAO,YAAY;IACjB,IAAI,CAAC,IAAI,GAAG,UAAU,GAAG,EAAE,UAAU,GAAG,CAAC,CAAC;GAC3C,CAAC;CACH;;;AAGD,SAAS,iBAAiB,GAAG;EAC3B,IAAI,OAAO,GAAG,IAAI,cAAc,EAAE,CAAC;EACnC,OAAO,CAAC,KAAK,CAAC,SAAS,GAAG,KAAK,CAAC;EAChC,OAAO,YAAY;IACjB,OAAO,OAAO,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;GACrC,CAAC;CACH;;AAED,SAAS,aAAa,GAAG;;;EAGvB,IAAI,gBAAgB,GAAG,UAAU,CAAC;EAClC,OAAO,YAAY;IACjB,OAAO,gBAAgB,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;GACnC,CAAC;CACH;;AAED,IAAI,KAAK,GAAG,IAAI,KAAK,CAAC,IAAI,CAAC,CAAC;AAC5B,SAAS,KAAK,GAAG;EACf,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,GAAG,EAAE,CAAC,IAAI,CAAC,EAAE;IAC/B,IAAI,QAAQ,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;IACxB,IAAI,GAAG,GAAG,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;;IAEvB,QAAQ,CAAC,GAAG,CAAC,CAAC;;IAEd,KAAK,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC;IACrB,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,SAAS,CAAC;GAC1B;;EAED,GAAG,GAAG,CAAC,CAAC;CACT;;AAED,SAAS,YAAY,GAAG;EACtB,IAAI;IACF,IAAI,KAAK,GAAG,QAAQ,CAAC,aAAa,CAAC,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;IACvD,SAAS,GAAG,KAAK,CAAC,SAAS,IAAI,KAAK,CAAC,YAAY,CAAC;IAClD,OAAO,aAAa,EAAE,CAAC;GACxB,CAAC,OAAO,CAAC,EAAE;IACV,OAAO,aAAa,EAAE,CAAC;GACxB;CACF;;AAED,IAAI,aAAa,GAAG,KAAK,CAAC,CAAC;;AAE3B,IAAI,MAAM,EAAE;EACV,aAAa,GAAG,WAAW,EAAE,CAAC;CAC/B,MAAM,IAAI,uBAAuB,EAAE;EAClC,aAAa,GAAG,mBAAmB,EAAE,CAAC;CACvC,MAAM,IAAI,QAAQ,EAAE;EACnB,aAAa,GAAG,iBAAiB,EAAE,CAAC;CACrC,MAAM,IAAI,aAAa,KAAK,SAAS,IAAI,OAAO,OAAO,KAAK,UAAU,EAAE;EACvE,aAAa,GAAG,YAAY,EAAE,CAAC;CAChC,MAAM;EACL,aAAa,GAAG,aAAa,EAAE,CAAC;;;CACjC,DCtHc,SAAS,IAAI,CAAC,aAAa,EAAE,WAAW,EAAE;EACvD,IAAI,MAAM,GAAG,IAAI,CAAC;;EAElB,IAAI,KAAK,GAAG,IAAI,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;;EAEvC,IAAI,KAAK,CAAC,UAAU,CAAC,KAAK,SAAS,EAAE;IACnC,WAAW,CAAC,KAAK,CAAC,CAAC;GACpB;;EAED,IAAI,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;;;EAG3B,IAAI,MAAM,EAAE;IACV,IAAI,QAAQ,GAAG,SAAS,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;IACrC,IAAI,CAAC,YAAY;MACf,OAAO,cAAc,CAAC,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC;KAChE,CAAC,CAAC;GACJ,MAAM;IACL,SAAS,CAAC,MAAM,EAAE,KAAK,EAAE,aAAa,EAAE,WAAW,CAAC,CAAC;GACtD;;EAED,OAAO,KAAK,CAAC;;;CACd,DCxBD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+BA,AAAe,SAASA,SAAO,CAAC,MAAM,EAAE;;EAEtC,IAAI,WAAW,GAAG,IAAI,CAAC;;EAEvB,IAAI,MAAM,IAAI,OAAO,MAAM,KAAK,QAAQ,IAAI,MAAM,CAAC,WAAW,KAAK,WAAW,EAAE;IAC9E,OAAO,MAAM,CAAC;GACf;;EAED,IAAI,OAAO,GAAG,IAAI,WAAW,CAAC,IAAI,CAAC,CAAC;EACpCC,OAAQ,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;EAC1B,OAAO,OAAO,CAAC;;;CAChB,DCrCM,IAAI,UAAU,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;;AAEhE,SAAS,IAAI,GAAG,EAAE;;AAElB,IAAI,OAAO,GAAG,KAAK,CAAC,CAAC;AACrB,IAAI,SAAS,GAAG,CAAC,CAAC;AAClB,IAAI,QAAQ,GAAG,CAAC,CAAC;;AAEjB,SAAS,eAAe,GAAG;EACzB,OAAO,IAAI,SAAS,CAAC,0CAA0C,CAAC,CAAC;CAClE;;AAED,SAAS,eAAe,GAAG;EACzB,OAAO,IAAI,SAAS,CAAC,sDAAsD,CAAC,CAAC;CAC9E;;AAED,SAAS,OAAO,CAACC,OAAI,EAAE,KAAK,EAAE,kBAAkB,EAAE,gBAAgB,EAAE;EAClE,IAAI;IACFA,OAAI,CAAC,IAAI,CAAC,KAAK,EAAE,kBAAkB,EAAE,gBAAgB,CAAC,CAAC;GACxD,CAAC,OAAO,CAAC,EAAE;IACV,OAAO,CAAC,CAAC;GACV;CACF;;AAED,SAAS,qBAAqB,CAAC,OAAO,EAAE,QAAQ,EAAEA,OAAI,EAAE;EACtD,IAAI,CAAC,UAAU,OAAO,EAAE;IACtB,IAAI,MAAM,GAAG,KAAK,CAAC;IACnB,IAAI,KAAK,GAAG,OAAO,CAACA,OAAI,EAAE,QAAQ,EAAE,UAAU,KAAK,EAAE;MACnD,IAAI,MAAM,EAAE;QACV,OAAO;OACR;MACD,MAAM,GAAG,IAAI,CAAC;MACd,IAAI,QAAQ,KAAK,KAAK,EAAE;QACtB,OAAO,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;OACzB,MAAM;QACL,OAAO,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;OACzB;KACF,EAAE,UAAU,MAAM,EAAE;MACnB,IAAI,MAAM,EAAE;QACV,OAAO;OACR;MACD,MAAM,GAAG,IAAI,CAAC;;MAEd,MAAM,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;KACzB,EAAE,UAAU,IAAI,OAAO,CAAC,MAAM,IAAI,kBAAkB,CAAC,CAAC,CAAC;;IAExD,IAAI,CAAC,MAAM,IAAI,KAAK,EAAE;MACpB,MAAM,GAAG,IAAI,CAAC;MACd,MAAM,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;KACxB;GACF,EAAE,OAAO,CAAC,CAAC;CACb;;AAED,SAAS,iBAAiB,CAAC,OAAO,EAAE,QAAQ,EAAE;EAC5C,IAAI,QAAQ,CAAC,MAAM,KAAK,SAAS,EAAE;IACjC,OAAO,CAAC,OAAO,EAAE,QAAQ,CAAC,OAAO,CAAC,CAAC;GACpC,MAAM,IAAI,QAAQ,CAAC,MAAM,KAAK,QAAQ,EAAE;IACvC,MAAM,CAAC,OAAO,EAAE,QAAQ,CAAC,OAAO,CAAC,CAAC;GACnC,MAAM;IACL,SAAS,CAAC,QAAQ,EAAE,SAAS,EAAE,UAAU,KAAK,EAAE;MAC9C,OAAO,OAAO,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;KAChC,EAAE,UAAU,MAAM,EAAE;MACnB,OAAO,MAAM,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;KAChC,CAAC,CAAC;GACJ;CACF;;AAED,SAAS,mBAAmB,CAAC,OAAO,EAAE,aAAa,EAAEA,OAAI,EAAE;EACzD,IAAI,aAAa,CAAC,WAAW,KAAK,OAAO,CAAC,WAAW,IAAIA,OAAI,KAAKC,IAAY,IAAI,aAAa,CAAC,WAAW,CAAC,OAAO,KAAKC,SAAe,EAAE;IACvI,iBAAiB,CAAC,OAAO,EAAE,aAAa,CAAC,CAAC;GAC3C,MAAM;IACL,IAAIF,OAAI,KAAK,SAAS,EAAE;MACtB,OAAO,CAAC,OAAO,EAAE,aAAa,CAAC,CAAC;KACjC,MAAM,IAAI,UAAU,CAACA,OAAI,CAAC,EAAE;MAC3B,qBAAqB,CAAC,OAAO,EAAE,aAAa,EAAEA,OAAI,CAAC,CAAC;KACrD,MAAM;MACL,OAAO,CAAC,OAAO,EAAE,aAAa,CAAC,CAAC;KACjC;GACF;CACF;;AAED,SAAS,OAAO,CAAC,OAAO,EAAE,KAAK,EAAE;EAC/B,IAAI,OAAO,KAAK,KAAK,EAAE;IACrB,MAAM,CAAC,OAAO,EAAE,eAAe,EAAE,CAAC,CAAC;GACpC,MAAM,IAAI,gBAAgB,CAAC,KAAK,CAAC,EAAE;IAClC,IAAIA,OAAI,GAAG,KAAK,CAAC,CAAC;IAClB,IAAI;MACFA,OAAI,GAAG,KAAK,CAAC,IAAI,CAAC;KACnB,CAAC,OAAO,KAAK,EAAE;MACd,MAAM,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;MACvB,OAAO;KACR;IACD,mBAAmB,CAAC,OAAO,EAAE,KAAK,EAAEA,OAAI,CAAC,CAAC;GAC3C,MAAM;IACL,OAAO,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;GACzB;CACF;;AAED,SAAS,gBAAgB,CAAC,OAAO,EAAE;EACjC,IAAI,OAAO,CAAC,QAAQ,EAAE;IACpB,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;GACnC;;EAED,OAAO,CAAC,OAAO,CAAC,CAAC;CAClB;;AAED,SAAS,OAAO,CAAC,OAAO,EAAE,KAAK,EAAE;EAC/B,IAAI,OAAO,CAAC,MAAM,KAAK,OAAO,EAAE;IAC9B,OAAO;GACR;;EAED,OAAO,CAAC,OAAO,GAAG,KAAK,CAAC;EACxB,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC;;EAE3B,IAAI,OAAO,CAAC,YAAY,CAAC,MAAM,KAAK,CAAC,EAAE;IACrC,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;GACxB;CACF;;AAED,SAAS,MAAM,CAAC,OAAO,EAAE,MAAM,EAAE;EAC/B,IAAI,OAAO,CAAC,MAAM,KAAK,OAAO,EAAE;IAC9B,OAAO;GACR;EACD,OAAO,CAAC,MAAM,GAAG,QAAQ,CAAC;EAC1B,OAAO,CAAC,OAAO,GAAG,MAAM,CAAC;;EAEzB,IAAI,CAAC,gBAAgB,EAAE,OAAO,CAAC,CAAC;CACjC;;AAED,SAAS,SAAS,CAAC,MAAM,EAAE,KAAK,EAAE,aAAa,EAAE,WAAW,EAAE;EAC5D,IAAI,YAAY,GAAG,MAAM,CAAC,YAAY,CAAC;EACvC,IAAI,MAAM,GAAG,YAAY,CAAC,MAAM,CAAC;;;EAGjC,MAAM,CAAC,QAAQ,GAAG,IAAI,CAAC;;EAEvB,YAAY,CAAC,MAAM,CAAC,GAAG,KAAK,CAAC;EAC7B,YAAY,CAAC,MAAM,GAAG,SAAS,CAAC,GAAG,aAAa,CAAC;EACjD,YAAY,CAAC,MAAM,GAAG,QAAQ,CAAC,GAAG,WAAW,CAAC;;EAE9C,IAAI,MAAM,KAAK,CAAC,IAAI,MAAM,CAAC,MAAM,EAAE;IACjC,IAAI,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;GACvB;CACF;;AAED,SAAS,OAAO,CAAC,OAAO,EAAE;EACxB,IAAI,WAAW,GAAG,OAAO,CAAC,YAAY,CAAC;EACvC,IAAI,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC;;EAE7B,IAAI,WAAW,CAAC,MAAM,KAAK,CAAC,EAAE;IAC5B,OAAO;GACR;;EAED,IAAI,KAAK,GAAG,KAAK,CAAC;MACd,QAAQ,GAAG,KAAK,CAAC;MACjB,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;;EAE7B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,WAAW,CAAC,MAAM,EAAE,CAAC,IAAI,CAAC,EAAE;IAC9C,KAAK,GAAG,WAAW,CAAC,CAAC,CAAC,CAAC;IACvB,QAAQ,GAAG,WAAW,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC;;IAEpC,IAAI,KAAK,EAAE;MACT,cAAc,CAAC,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC;KAClD,MAAM;MACL,QAAQ,CAAC,MAAM,CAAC,CAAC;KAClB;GACF;;EAED,OAAO,CAAC,YAAY,CAAC,MAAM,GAAG,CAAC,CAAC;CACjC;;AAED,SAAS,cAAc,CAAC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE;EAC1D,IAAI,WAAW,GAAG,UAAU,CAAC,QAAQ,CAAC;MAClC,KAAK,GAAG,KAAK,CAAC;MACd,KAAK,GAAG,KAAK,CAAC;MACd,SAAS,GAAG,IAAI,CAAC;;EAErB,IAAI,WAAW,EAAE;IACf,IAAI;MACF,KAAK,GAAG,QAAQ,CAAC,MAAM,CAAC,CAAC;KAC1B,CAAC,OAAO,CAAC,EAAE;MACV,SAAS,GAAG,KAAK,CAAC;MAClB,KAAK,GAAG,CAAC,CAAC;KACX;;IAED,IAAI,OAAO,KAAK,KAAK,EAAE;MACrB,MAAM,CAAC,OAAO,EAAE,eAAe,EAAE,CAAC,CAAC;MACnC,OAAO;KACR;GACF,MAAM;IACL,KAAK,GAAG,MAAM,CAAC;GAChB;;EAED,IAAI,OAAO,CAAC,MAAM,KAAK,OAAO,EAAE;;GAE/B,MAAM,IAAI,WAAW,IAAI,SAAS,EAAE;IACnC,OAAO,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;GACzB,MAAM,IAAI,SAAS,KAAK,KAAK,EAAE;IAC9B,MAAM,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;GACxB,MAAM,IAAI,OAAO,KAAK,SAAS,EAAE;IAChC,OAAO,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;GACzB,MAAM,IAAI,OAAO,KAAK,QAAQ,EAAE;IAC/B,MAAM,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;GACxB;CACF;;AAED,SAAS,iBAAiB,CAAC,OAAO,EAAE,QAAQ,EAAE;EAC5C,IAAI;IACF,QAAQ,CAAC,SAAS,cAAc,CAAC,KAAK,EAAE;MACtC,OAAO,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;KACzB,EAAE,SAAS,aAAa,CAAC,MAAM,EAAE;MAChC,MAAM,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;KACzB,CAAC,CAAC;GACJ,CAAC,OAAO,CAAC,EAAE;IACV,MAAM,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC;GACpB;CACF;;AAED,IAAI,EAAE,GAAG,CAAC,CAAC;AACX,SAAS,MAAM,GAAG;EAChB,OAAO,EAAE,EAAE,CAAC;CACb;;AAED,SAAS,WAAW,CAAC,OAAO,EAAE;EAC5B,OAAO,CAAC,UAAU,CAAC,GAAG,EAAE,EAAE,CAAC;EAC3B,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC;EAC3B,OAAO,CAAC,OAAO,GAAG,SAAS,CAAC;EAC5B,OAAO,CAAC,YAAY,GAAG,EAAE,CAAC;CAC3B;;AChOD,SAAS,eAAe,GAAG;EACzB,OAAO,IAAI,KAAK,CAAC,yCAAyC,CAAC,CAAC;CAC7D,AAAC;;AAEF,IAAI,UAAU,GAAG,YAAY;EAC3B,SAAS,UAAU,CAAC,WAAW,EAAE,KAAK,EAAE;IACtC,IAAI,CAAC,oBAAoB,GAAG,WAAW,CAAC;IACxC,IAAI,CAAC,OAAO,GAAG,IAAI,WAAW,CAAC,IAAI,CAAC,CAAC;;IAErC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,EAAE;MAC7B,WAAW,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;KAC3B;;IAED,IAAI,OAAO,CAAC,KAAK,CAAC,EAAE;MAClB,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC;MAC3B,IAAI,CAAC,UAAU,GAAG,KAAK,CAAC,MAAM,CAAC;;MAE/B,IAAI,CAAC,OAAO,GAAG,IAAI,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;;MAEtC,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,EAAE;QACrB,OAAO,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;OACrC,MAAM;QACL,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,IAAI,CAAC,CAAC;QAC/B,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;QACvB,IAAI,IAAI,CAAC,UAAU,KAAK,CAAC,EAAE;UACzB,OAAO,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;SACrC;OACF;KACF,MAAM;MACL,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,eAAe,EAAE,CAAC,CAAC;KACzC;GACF;;EAED,UAAU,CAAC,SAAS,CAAC,UAAU,GAAG,SAAS,UAAU,CAAC,KAAK,EAAE;IAC3D,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,IAAI,CAAC,MAAM,KAAK,OAAO,IAAI,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;MAChE,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;KAC9B;GACF,CAAC;;EAEF,UAAU,CAAC,SAAS,CAAC,UAAU,GAAG,SAAS,UAAU,CAAC,KAAK,EAAE,CAAC,EAAE;IAC9D,IAAI,CAAC,GAAG,IAAI,CAAC,oBAAoB,CAAC;IAClC,IAAIF,UAAO,GAAG,CAAC,CAAC,OAAO,CAAC;;;IAGxB,IAAIA,UAAO,KAAKI,SAAe,EAAE;MAC/B,IAAI,KAAK,GAAG,KAAK,CAAC,CAAC;MACnB,IAAI,KAAK,GAAG,KAAK,CAAC,CAAC;MACnB,IAAI,QAAQ,GAAG,KAAK,CAAC;MACrB,IAAI;QACF,KAAK,GAAG,KAAK,CAAC,IAAI,CAAC;OACpB,CAAC,OAAO,CAAC,EAAE;QACV,QAAQ,GAAG,IAAI,CAAC;QAChB,KAAK,GAAG,CAAC,CAAC;OACX;;MAED,IAAI,KAAK,KAAKD,IAAY,IAAI,KAAK,CAAC,MAAM,KAAK,OAAO,EAAE;QACtD,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC;OACjD,MAAM,IAAI,OAAO,KAAK,KAAK,UAAU,EAAE;QACtC,IAAI,CAAC,UAAU,EAAE,CAAC;QAClB,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC;OACzB,MAAM,IAAI,CAAC,KAAKE,SAAO,EAAE;QACxB,IAAI,OAAO,GAAG,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC;QAC1B,IAAI,QAAQ,EAAE;UACZ,MAAM,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;SACxB,MAAM;UACL,mBAAmB,CAAC,OAAO,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;SAC5C;QACD,IAAI,CAAC,aAAa,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC;OAChC,MAAM;QACL,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC,UAAUL,UAAO,EAAE;UAC1C,OAAOA,UAAO,CAAC,KAAK,CAAC,CAAC;SACvB,CAAC,EAAE,CAAC,CAAC,CAAC;OACR;KACF,MAAM;MACL,IAAI,CAAC,aAAa,CAACA,UAAO,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC;KACvC;GACF,CAAC;;EAEF,UAAU,CAAC,SAAS,CAAC,UAAU,GAAG,SAAS,UAAU,CAAC,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE;IACrE,IAAI,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC;;;IAG3B,IAAI,OAAO,CAAC,MAAM,KAAK,OAAO,EAAE;MAC9B,IAAI,CAAC,UAAU,EAAE,CAAC;;MAElB,IAAI,KAAK,KAAK,QAAQ,EAAE;QACtB,MAAM,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;OACxB,MAAM;QACL,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC;OACzB;KACF;;IAED,IAAI,IAAI,CAAC,UAAU,KAAK,CAAC,EAAE;MACzB,OAAO,CAAC,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;KAChC;GACF,CAAC;;EAEF,UAAU,CAAC,SAAS,CAAC,aAAa,GAAG,SAAS,aAAa,CAAC,OAAO,EAAE,CAAC,EAAE;IACtE,IAAI,UAAU,GAAG,IAAI,CAAC;;IAEtB,SAAS,CAAC,OAAO,EAAE,SAAS,EAAE,UAAU,KAAK,EAAE;MAC7C,OAAO,UAAU,CAAC,UAAU,CAAC,SAAS,EAAE,CAAC,EAAE,KAAK,CAAC,CAAC;KACnD,EAAE,UAAU,MAAM,EAAE;MACnB,OAAO,UAAU,CAAC,UAAU,CAAC,QAAQ,EAAE,CAAC,EAAE,MAAM,CAAC,CAAC;KACnD,CAAC,CAAC;GACJ,CAAC;;EAEF,OAAO,UAAU,CAAC;CACnB,EAAE;;ACrHH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+CA,AAAe,SAAS,GAAG,CAAC,OAAO,EAAE;EACnC,OAAO,IAAI,UAAU,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC,OAAO,CAAC;;;CAC9C,DCjDD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiEA,AAAe,SAAS,IAAI,CAAC,OAAO,EAAE;;EAEpC,IAAI,WAAW,GAAG,IAAI,CAAC;;EAEvB,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE;IACrB,OAAO,IAAI,WAAW,CAAC,UAAU,CAAC,EAAE,MAAM,EAAE;MAC1C,OAAO,MAAM,CAAC,IAAI,SAAS,CAAC,iCAAiC,CAAC,CAAC,CAAC;KACjE,CAAC,CAAC;GACJ,MAAM;IACL,OAAO,IAAI,WAAW,CAAC,UAAU,OAAO,EAAE,MAAM,EAAE;MAChD,IAAI,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;MAC5B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,EAAE,CAAC,EAAE,EAAE;QAC/B,WAAW,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;OACvD;KACF,CAAC,CAAC;GACJ;;;CACF,DCjFD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkCA,AAAe,SAASM,QAAM,CAAC,MAAM,EAAE;;EAErC,IAAI,WAAW,GAAG,IAAI,CAAC;EACvB,IAAI,OAAO,GAAG,IAAI,WAAW,CAAC,IAAI,CAAC,CAAC;EACpCC,MAAO,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;EACzB,OAAO,OAAO,CAAC;;;CAChB,DC9BD,SAAS,aAAa,GAAG;EACvB,MAAM,IAAI,SAAS,CAAC,oFAAoF,CAAC,CAAC;CAC3G;;AAED,SAAS,QAAQ,GAAG;EAClB,MAAM,IAAI,SAAS,CAAC,uHAAuH,CAAC,CAAC;CAC9I;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0GD,IAAIF,SAAO,GAAG,YAAY;EACxB,SAAS,OAAO,CAAC,QAAQ,EAAE;IACzB,IAAI,CAAC,UAAU,CAAC,GAAG,MAAM,EAAE,CAAC;IAC5B,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,MAAM,GAAG,SAAS,CAAC;IACvC,IAAI,CAAC,YAAY,GAAG,EAAE,CAAC;;IAEvB,IAAI,IAAI,KAAK,QAAQ,EAAE;MACrB,OAAO,QAAQ,KAAK,UAAU,IAAI,aAAa,EAAE,CAAC;MAClD,IAAI,YAAY,OAAO,GAAG,iBAAiB,CAAC,IAAI,EAAE,QAAQ,CAAC,GAAG,QAAQ,EAAE,CAAC;KAC1E;GACF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA4LD,OAAO,CAAC,SAAS,CAAC,KAAK,GAAG,SAAS,MAAM,CAAC,WAAW,EAAE;IACrD,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,WAAW,CAAC,CAAC;GACrC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA0CF,OAAO,CAAC,SAAS,CAAC,OAAO,GAAG,SAAS,QAAQ,CAAC,QAAQ,EAAE;IACtD,IAAI,OAAO,GAAG,IAAI,CAAC;IACnB,IAAI,WAAW,GAAG,OAAO,CAAC,WAAW,CAAC;;IAEtC,IAAI,UAAU,CAAC,QAAQ,CAAC,EAAE;MACxB,OAAO,OAAO,CAAC,IAAI,CAAC,UAAU,KAAK,EAAE;QACnC,OAAO,WAAW,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAC,IAAI,CAAC,YAAY;UACtD,OAAO,KAAK,CAAC;SACd,CAAC,CAAC;OACJ,EAAE,UAAU,MAAM,EAAE;QACnB,OAAO,WAAW,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAC,IAAI,CAAC,YAAY;UACtD,MAAM,MAAM,CAAC;SACd,CAAC,CAAC;OACJ,CAAC,CAAC;KACJ;;IAED,OAAO,OAAO,CAAC,IAAI,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;GACzC,CAAC;;EAEF,OAAO,OAAO,CAAC;CAChB,EAAE,CAAC;;AAEJA,SAAO,CAAC,SAAS,CAAC,IAAI,GAAG,IAAI,CAAC;AAC9B,AACAA,SAAO,CAAC,GAAG,GAAG,GAAG,CAAC;AAClBA,SAAO,CAAC,IAAI,GAAG,IAAI,CAAC;AACpBA,SAAO,CAAC,OAAO,GAAGG,SAAO,CAAC;AAC1BH,SAAO,CAAC,MAAM,GAAGI,QAAM,CAAC;AACxBJ,SAAO,CAAC,aAAa,GAAG,YAAY,CAAC;AACrCA,SAAO,CAAC,QAAQ,GAAG,OAAO,CAAC;AAC3BA,SAAO,CAAC,KAAK,GAAG,IAAI;;AC5YpB;AACA,AAEe,SAAS,QAAQ,GAAG;EACjC,IAAI,KAAK,GAAG,KAAK,CAAC,CAAC;;EAEnB,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE;IACjC,KAAK,GAAG,MAAM,CAAC;GAChB,MAAM,IAAI,OAAO,IAAI,KAAK,WAAW,EAAE;IACtC,KAAK,GAAG,IAAI,CAAC;GACd,MAAM;IACL,IAAI;MACF,KAAK,GAAG,QAAQ,CAAC,aAAa,CAAC,EAAE,CAAC;KACnC,CAAC,OAAO,CAAC,EAAE;MACV,MAAM,IAAI,KAAK,CAAC,0EAA0E,CAAC,CAAC;KAC7F;GACF;;EAED,IAAI,CAAC,GAAG,KAAK,CAAC,OAAO,CAAC;;EAEtB,IAAI,CAAC,EAAE;IACL,IAAI,eAAe,GAAG,IAAI,CAAC;IAC3B,IAAI;MACF,eAAe,GAAG,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC;KAC/D,CAAC,OAAO,CAAC,EAAE;;KAEX;;IAED,IAAI,eAAe,KAAK,kBAAkB,IAAI,CAAC,CAAC,CAAC,IAAI,EAAE;MACrD,OAAO;KACR;GACF;;EAED,KAAK,CAAC,OAAO,GAAGA,SAAO,CAAC;;;CACzB,DC/BD;AACAA,SAAO,CAAC,QAAQ,GAAG,QAAQ,CAAC;AAC5BA,SAAO,CAAC,OAAO,GAAGA,SAAO,CAAC;;;;;;;;","file":"es6-promise.js"} \ No newline at end of file diff --git a/deps/npm/node_modules/es6-promise/dist/es6-promise.min.js b/deps/npm/node_modules/es6-promise/dist/es6-promise.min.js deleted file mode 100644 index 6af5903ab58134..00000000000000 --- a/deps/npm/node_modules/es6-promise/dist/es6-promise.min.js +++ /dev/null @@ -1 +0,0 @@ -!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.ES6Promise=e()}(this,function(){"use strict";function t(t){var e=typeof t;return null!==t&&("object"===e||"function"===e)}function e(t){return"function"==typeof t}function n(t){W=t}function r(t){z=t}function o(){return function(){return process.nextTick(a)}}function i(){return"undefined"!=typeof U?function(){U(a)}:c()}function s(){var t=0,e=new H(a),n=document.createTextNode("");return e.observe(n,{characterData:!0}),function(){n.data=t=++t%2}}function u(){var t=new MessageChannel;return t.port1.onmessage=a,function(){return t.port2.postMessage(0)}}function c(){var t=setTimeout;return function(){return t(a,1)}}function a(){for(var t=0;t postsJSON\n values[1] // => commentsJSON\n\n return values;\n });\n ```\n\n @class Promise\n @param {Function} resolver\n Useful for tooling.\n @constructor\n*/\n\nvar Promise = function () {\n function Promise(resolver) {\n this[PROMISE_ID] = nextId();\n this._result = this._state = undefined;\n this._subscribers = [];\n\n if (noop !== resolver) {\n typeof resolver !== 'function' && needsResolver();\n this instanceof Promise ? initializePromise(this, resolver) : needsNew();\n }\n }\n\n /**\n The primary way of interacting with a promise is through its `then` method,\n which registers callbacks to receive either a promise's eventual value or the\n reason why the promise cannot be fulfilled.\n ```js\n findUser().then(function(user){\n // user is available\n }, function(reason){\n // user is unavailable, and you are given the reason why\n });\n ```\n Chaining\n --------\n The return value of `then` is itself a promise. This second, 'downstream'\n promise is resolved with the return value of the first promise's fulfillment\n or rejection handler, or rejected if the handler throws an exception.\n ```js\n findUser().then(function (user) {\n return user.name;\n }, function (reason) {\n return 'default name';\n }).then(function (userName) {\n // If `findUser` fulfilled, `userName` will be the user's name, otherwise it\n // will be `'default name'`\n });\n findUser().then(function (user) {\n throw new Error('Found user, but still unhappy');\n }, function (reason) {\n throw new Error('`findUser` rejected and we're unhappy');\n }).then(function (value) {\n // never reached\n }, function (reason) {\n // if `findUser` fulfilled, `reason` will be 'Found user, but still unhappy'.\n // If `findUser` rejected, `reason` will be '`findUser` rejected and we're unhappy'.\n });\n ```\n If the downstream promise does not specify a rejection handler, rejection reasons will be propagated further downstream.\n ```js\n findUser().then(function (user) {\n throw new PedagogicalException('Upstream error');\n }).then(function (value) {\n // never reached\n }).then(function (value) {\n // never reached\n }, function (reason) {\n // The `PedgagocialException` is propagated all the way down to here\n });\n ```\n Assimilation\n ------------\n Sometimes the value you want to propagate to a downstream promise can only be\n retrieved asynchronously. This can be achieved by returning a promise in the\n fulfillment or rejection handler. The downstream promise will then be pending\n until the returned promise is settled. This is called *assimilation*.\n ```js\n findUser().then(function (user) {\n return findCommentsByAuthor(user);\n }).then(function (comments) {\n // The user's comments are now available\n });\n ```\n If the assimliated promise rejects, then the downstream promise will also reject.\n ```js\n findUser().then(function (user) {\n return findCommentsByAuthor(user);\n }).then(function (comments) {\n // If `findCommentsByAuthor` fulfills, we'll have the value here\n }, function (reason) {\n // If `findCommentsByAuthor` rejects, we'll have the reason here\n });\n ```\n Simple Example\n --------------\n Synchronous Example\n ```javascript\n let result;\n try {\n result = findResult();\n // success\n } catch(reason) {\n // failure\n }\n ```\n Errback Example\n ```js\n findResult(function(result, err){\n if (err) {\n // failure\n } else {\n // success\n }\n });\n ```\n Promise Example;\n ```javascript\n findResult().then(function(result){\n // success\n }, function(reason){\n // failure\n });\n ```\n Advanced Example\n --------------\n Synchronous Example\n ```javascript\n let author, books;\n try {\n author = findAuthor();\n books = findBooksByAuthor(author);\n // success\n } catch(reason) {\n // failure\n }\n ```\n Errback Example\n ```js\n function foundBooks(books) {\n }\n function failure(reason) {\n }\n findAuthor(function(author, err){\n if (err) {\n failure(err);\n // failure\n } else {\n try {\n findBoooksByAuthor(author, function(books, err) {\n if (err) {\n failure(err);\n } else {\n try {\n foundBooks(books);\n } catch(reason) {\n failure(reason);\n }\n }\n });\n } catch(error) {\n failure(err);\n }\n // success\n }\n });\n ```\n Promise Example;\n ```javascript\n findAuthor().\n then(findBooksByAuthor).\n then(function(books){\n // found books\n }).catch(function(reason){\n // something went wrong\n });\n ```\n @method then\n @param {Function} onFulfilled\n @param {Function} onRejected\n Useful for tooling.\n @return {Promise}\n */\n\n /**\n `catch` is simply sugar for `then(undefined, onRejection)` which makes it the same\n as the catch block of a try/catch statement.\n ```js\n function findAuthor(){\n throw new Error('couldn't find that author');\n }\n // synchronous\n try {\n findAuthor();\n } catch(reason) {\n // something went wrong\n }\n // async with promises\n findAuthor().catch(function(reason){\n // something went wrong\n });\n ```\n @method catch\n @param {Function} onRejection\n Useful for tooling.\n @return {Promise}\n */\n\n\n Promise.prototype.catch = function _catch(onRejection) {\n return this.then(null, onRejection);\n };\n\n /**\n `finally` will be invoked regardless of the promise's fate just as native\n try/catch/finally behaves\n \n Synchronous example:\n \n ```js\n findAuthor() {\n if (Math.random() > 0.5) {\n throw new Error();\n }\n return new Author();\n }\n \n try {\n return findAuthor(); // succeed or fail\n } catch(error) {\n return findOtherAuther();\n } finally {\n // always runs\n // doesn't affect the return value\n }\n ```\n \n Asynchronous example:\n \n ```js\n findAuthor().catch(function(reason){\n return findOtherAuther();\n }).finally(function(){\n // author was either found, or not\n });\n ```\n \n @method finally\n @param {Function} callback\n @return {Promise}\n */\n\n\n Promise.prototype.finally = function _finally(callback) {\n var promise = this;\n var constructor = promise.constructor;\n\n if (isFunction(callback)) {\n return promise.then(function (value) {\n return constructor.resolve(callback()).then(function () {\n return value;\n });\n }, function (reason) {\n return constructor.resolve(callback()).then(function () {\n throw reason;\n });\n });\n }\n\n return promise.then(callback, callback);\n };\n\n return Promise;\n}();\n\nPromise.prototype.then = then;\nexport default Promise;\nPromise.all = all;\nPromise.race = race;\nPromise.resolve = Resolve;\nPromise.reject = Reject;\nPromise._setScheduler = setScheduler;\nPromise._setAsap = setAsap;\nPromise._asap = asap;","/*global self*/\nimport Promise from './promise';\n\nexport default function polyfill() {\n var local = void 0;\n\n if (typeof global !== 'undefined') {\n local = global;\n } else if (typeof self !== 'undefined') {\n local = self;\n } else {\n try {\n local = Function('return this')();\n } catch (e) {\n throw new Error('polyfill failed because global object is unavailable in this environment');\n }\n }\n\n var P = local.Promise;\n\n if (P) {\n var promiseToString = null;\n try {\n promiseToString = Object.prototype.toString.call(P.resolve());\n } catch (e) {\n // silently ignored\n }\n\n if (promiseToString === '[object Promise]' && !P.cast) {\n return;\n }\n }\n\n local.Promise = Promise;\n}","import Promise from './es6-promise/promise';\nimport polyfill from './es6-promise/polyfill';\n\n// Strange compat..\nPromise.polyfill = polyfill;\nPromise.Promise = Promise;\nexport default Promise;"],"names":["resolve","_resolve","then","originalThen","originalResolve","Promise","reject","_reject","Resolve","Reject"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACNO,SAAS,gBAAgB,CAAC,CAAC,EAAE;EAClC,IAAI,IAAI,GAAG,OAAO,CAAC,CAAC;EACpB,OAAO,CAAC,KAAK,IAAI,KAAK,IAAI,KAAK,QAAQ,IAAI,IAAI,KAAK,UAAU,CAAC,CAAC;CACjE;;AAED,AAAO,SAAS,UAAU,CAAC,CAAC,EAAE;EAC5B,OAAO,OAAO,CAAC,KAAK,UAAU,CAAC;CAChC;;AAED,AAEC;;AAED,IAAI,QAAQ,GAAG,KAAK,CAAC,CAAC;AACtB,IAAI,KAAK,CAAC,OAAO,EAAE;EACjB,QAAQ,GAAG,KAAK,CAAC,OAAO,CAAC;CAC1B,MAAM;EACL,QAAQ,GAAG,UAAU,CAAC,EAAE;IACtB,OAAO,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,gBAAgB,CAAC;GAC/D,CAAC;CACH;;AAED,AAAO,IAAI,OAAO,GAAG,QAAQ;;ACtB7B,IAAI,GAAG,GAAG,CAAC,CAAC;AACZ,IAAI,SAAS,GAAG,KAAK,CAAC,CAAC;AACvB,IAAI,iBAAiB,GAAG,KAAK,CAAC,CAAC;;AAE/B,AAAO,IAAI,IAAI,GAAG,SAAS,IAAI,CAAC,QAAQ,EAAE,GAAG,EAAE;EAC7C,KAAK,CAAC,GAAG,CAAC,GAAG,QAAQ,CAAC;EACtB,KAAK,CAAC,GAAG,GAAG,CAAC,CAAC,GAAG,GAAG,CAAC;EACrB,GAAG,IAAI,CAAC,CAAC;EACT,IAAI,GAAG,KAAK,CAAC,EAAE;;;;IAIb,IAAI,iBAAiB,EAAE;MACrB,iBAAiB,CAAC,KAAK,CAAC,CAAC;KAC1B,MAAM;MACL,aAAa,EAAE,CAAC;KACjB;GACF;CACF,CAAC;;AAEF,AAAO,SAAS,YAAY,CAAC,UAAU,EAAE;EACvC,iBAAiB,GAAG,UAAU,CAAC;CAChC;;AAED,AAAO,SAAS,OAAO,CAAC,MAAM,EAAE;EAC9B,IAAI,GAAG,MAAM,CAAC;CACf;;AAED,IAAI,aAAa,GAAG,OAAO,MAAM,KAAK,WAAW,GAAG,MAAM,GAAG,SAAS,CAAC;AACvE,IAAI,aAAa,GAAG,aAAa,IAAI,EAAE,CAAC;AACxC,IAAI,uBAAuB,GAAG,aAAa,CAAC,gBAAgB,IAAI,aAAa,CAAC,sBAAsB,CAAC;AACrG,IAAI,MAAM,GAAG,OAAO,IAAI,KAAK,WAAW,IAAI,OAAO,OAAO,KAAK,WAAW,IAAI,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,kBAAkB,CAAC;;;AAG/H,IAAI,QAAQ,GAAG,OAAO,iBAAiB,KAAK,WAAW,IAAI,OAAO,aAAa,KAAK,WAAW,IAAI,OAAO,cAAc,KAAK,WAAW,CAAC;;;AAGzI,SAAS,WAAW,GAAG;;;EAGrB,OAAO,YAAY;IACjB,OAAO,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;GAChC,CAAC;CACH;;;AAGD,SAAS,aAAa,GAAG;EACvB,IAAI,OAAO,SAAS,KAAK,WAAW,EAAE;IACpC,OAAO,YAAY;MACjB,SAAS,CAAC,KAAK,CAAC,CAAC;KAClB,CAAC;GACH;;EAED,OAAO,aAAa,EAAE,CAAC;CACxB;;AAED,SAAS,mBAAmB,GAAG;EAC7B,IAAI,UAAU,GAAG,CAAC,CAAC;EACnB,IAAI,QAAQ,GAAG,IAAI,uBAAuB,CAAC,KAAK,CAAC,CAAC;EAClD,IAAI,IAAI,GAAG,QAAQ,CAAC,cAAc,CAAC,EAAE,CAAC,CAAC;EACvC,QAAQ,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,aAAa,EAAE,IAAI,EAAE,CAAC,CAAC;;EAEhD,OAAO,YAAY;IACjB,IAAI,CAAC,IAAI,GAAG,UAAU,GAAG,EAAE,UAAU,GAAG,CAAC,CAAC;GAC3C,CAAC;CACH;;;AAGD,SAAS,iBAAiB,GAAG;EAC3B,IAAI,OAAO,GAAG,IAAI,cAAc,EAAE,CAAC;EACnC,OAAO,CAAC,KAAK,CAAC,SAAS,GAAG,KAAK,CAAC;EAChC,OAAO,YAAY;IACjB,OAAO,OAAO,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;GACrC,CAAC;CACH;;AAED,SAAS,aAAa,GAAG;;;EAGvB,IAAI,gBAAgB,GAAG,UAAU,CAAC;EAClC,OAAO,YAAY;IACjB,OAAO,gBAAgB,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;GACnC,CAAC;CACH;;AAED,IAAI,KAAK,GAAG,IAAI,KAAK,CAAC,IAAI,CAAC,CAAC;AAC5B,SAAS,KAAK,GAAG;EACf,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,GAAG,EAAE,CAAC,IAAI,CAAC,EAAE;IAC/B,IAAI,QAAQ,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;IACxB,IAAI,GAAG,GAAG,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;;IAEvB,QAAQ,CAAC,GAAG,CAAC,CAAC;;IAEd,KAAK,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC;IACrB,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,SAAS,CAAC;GAC1B;;EAED,GAAG,GAAG,CAAC,CAAC;CACT;;AAED,SAAS,YAAY,GAAG;EACtB,IAAI;IACF,IAAI,KAAK,GAAG,QAAQ,CAAC,aAAa,CAAC,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;IACvD,SAAS,GAAG,KAAK,CAAC,SAAS,IAAI,KAAK,CAAC,YAAY,CAAC;IAClD,OAAO,aAAa,EAAE,CAAC;GACxB,CAAC,OAAO,CAAC,EAAE;IACV,OAAO,aAAa,EAAE,CAAC;GACxB;CACF;;AAED,IAAI,aAAa,GAAG,KAAK,CAAC,CAAC;;AAE3B,IAAI,MAAM,EAAE;EACV,aAAa,GAAG,WAAW,EAAE,CAAC;CAC/B,MAAM,IAAI,uBAAuB,EAAE;EAClC,aAAa,GAAG,mBAAmB,EAAE,CAAC;CACvC,MAAM,IAAI,QAAQ,EAAE;EACnB,aAAa,GAAG,iBAAiB,EAAE,CAAC;CACrC,MAAM,IAAI,aAAa,KAAK,SAAS,IAAI,OAAO,OAAO,KAAK,UAAU,EAAE;EACvE,aAAa,GAAG,YAAY,EAAE,CAAC;CAChC,MAAM;EACL,aAAa,GAAG,aAAa,EAAE,CAAC;;;CACjC,DCtHc,SAAS,IAAI,CAAC,aAAa,EAAE,WAAW,EAAE;EACvD,IAAI,MAAM,GAAG,IAAI,CAAC;;EAElB,IAAI,KAAK,GAAG,IAAI,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;;EAEvC,IAAI,KAAK,CAAC,UAAU,CAAC,KAAK,SAAS,EAAE;IACnC,WAAW,CAAC,KAAK,CAAC,CAAC;GACpB;;EAED,IAAI,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;;;EAG3B,IAAI,MAAM,EAAE;IACV,IAAI,QAAQ,GAAG,SAAS,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;IACrC,IAAI,CAAC,YAAY;MACf,OAAO,cAAc,CAAC,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC;KAChE,CAAC,CAAC;GACJ,MAAM;IACL,SAAS,CAAC,MAAM,EAAE,KAAK,EAAE,aAAa,EAAE,WAAW,CAAC,CAAC;GACtD;;EAED,OAAO,KAAK,CAAC;;;CACd,DCxBD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+BA,AAAe,SAASA,SAAO,CAAC,MAAM,EAAE;;EAEtC,IAAI,WAAW,GAAG,IAAI,CAAC;;EAEvB,IAAI,MAAM,IAAI,OAAO,MAAM,KAAK,QAAQ,IAAI,MAAM,CAAC,WAAW,KAAK,WAAW,EAAE;IAC9E,OAAO,MAAM,CAAC;GACf;;EAED,IAAI,OAAO,GAAG,IAAI,WAAW,CAAC,IAAI,CAAC,CAAC;EACpCC,OAAQ,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;EAC1B,OAAO,OAAO,CAAC;;;CAChB,DCrCM,IAAI,UAAU,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;;AAEhE,SAAS,IAAI,GAAG,EAAE;;AAElB,IAAI,OAAO,GAAG,KAAK,CAAC,CAAC;AACrB,IAAI,SAAS,GAAG,CAAC,CAAC;AAClB,IAAI,QAAQ,GAAG,CAAC,CAAC;;AAEjB,SAAS,eAAe,GAAG;EACzB,OAAO,IAAI,SAAS,CAAC,0CAA0C,CAAC,CAAC;CAClE;;AAED,SAAS,eAAe,GAAG;EACzB,OAAO,IAAI,SAAS,CAAC,sDAAsD,CAAC,CAAC;CAC9E;;AAED,SAAS,OAAO,CAACC,OAAI,EAAE,KAAK,EAAE,kBAAkB,EAAE,gBAAgB,EAAE;EAClE,IAAI;IACFA,OAAI,CAAC,IAAI,CAAC,KAAK,EAAE,kBAAkB,EAAE,gBAAgB,CAAC,CAAC;GACxD,CAAC,OAAO,CAAC,EAAE;IACV,OAAO,CAAC,CAAC;GACV;CACF;;AAED,SAAS,qBAAqB,CAAC,OAAO,EAAE,QAAQ,EAAEA,OAAI,EAAE;EACtD,IAAI,CAAC,UAAU,OAAO,EAAE;IACtB,IAAI,MAAM,GAAG,KAAK,CAAC;IACnB,IAAI,KAAK,GAAG,OAAO,CAACA,OAAI,EAAE,QAAQ,EAAE,UAAU,KAAK,EAAE;MACnD,IAAI,MAAM,EAAE;QACV,OAAO;OACR;MACD,MAAM,GAAG,IAAI,CAAC;MACd,IAAI,QAAQ,KAAK,KAAK,EAAE;QACtB,OAAO,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;OACzB,MAAM;QACL,OAAO,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;OACzB;KACF,EAAE,UAAU,MAAM,EAAE;MACnB,IAAI,MAAM,EAAE;QACV,OAAO;OACR;MACD,MAAM,GAAG,IAAI,CAAC;;MAEd,MAAM,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;KACzB,EAAE,UAAU,IAAI,OAAO,CAAC,MAAM,IAAI,kBAAkB,CAAC,CAAC,CAAC;;IAExD,IAAI,CAAC,MAAM,IAAI,KAAK,EAAE;MACpB,MAAM,GAAG,IAAI,CAAC;MACd,MAAM,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;KACxB;GACF,EAAE,OAAO,CAAC,CAAC;CACb;;AAED,SAAS,iBAAiB,CAAC,OAAO,EAAE,QAAQ,EAAE;EAC5C,IAAI,QAAQ,CAAC,MAAM,KAAK,SAAS,EAAE;IACjC,OAAO,CAAC,OAAO,EAAE,QAAQ,CAAC,OAAO,CAAC,CAAC;GACpC,MAAM,IAAI,QAAQ,CAAC,MAAM,KAAK,QAAQ,EAAE;IACvC,MAAM,CAAC,OAAO,EAAE,QAAQ,CAAC,OAAO,CAAC,CAAC;GACnC,MAAM;IACL,SAAS,CAAC,QAAQ,EAAE,SAAS,EAAE,UAAU,KAAK,EAAE;MAC9C,OAAO,OAAO,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;KAChC,EAAE,UAAU,MAAM,EAAE;MACnB,OAAO,MAAM,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;KAChC,CAAC,CAAC;GACJ;CACF;;AAED,SAAS,mBAAmB,CAAC,OAAO,EAAE,aAAa,EAAEA,OAAI,EAAE;EACzD,IAAI,aAAa,CAAC,WAAW,KAAK,OAAO,CAAC,WAAW,IAAIA,OAAI,KAAKC,IAAY,IAAI,aAAa,CAAC,WAAW,CAAC,OAAO,KAAKC,SAAe,EAAE;IACvI,iBAAiB,CAAC,OAAO,EAAE,aAAa,CAAC,CAAC;GAC3C,MAAM;IACL,IAAIF,OAAI,KAAK,SAAS,EAAE;MACtB,OAAO,CAAC,OAAO,EAAE,aAAa,CAAC,CAAC;KACjC,MAAM,IAAI,UAAU,CAACA,OAAI,CAAC,EAAE;MAC3B,qBAAqB,CAAC,OAAO,EAAE,aAAa,EAAEA,OAAI,CAAC,CAAC;KACrD,MAAM;MACL,OAAO,CAAC,OAAO,EAAE,aAAa,CAAC,CAAC;KACjC;GACF;CACF;;AAED,SAAS,OAAO,CAAC,OAAO,EAAE,KAAK,EAAE;EAC/B,IAAI,OAAO,KAAK,KAAK,EAAE;IACrB,MAAM,CAAC,OAAO,EAAE,eAAe,EAAE,CAAC,CAAC;GACpC,MAAM,IAAI,gBAAgB,CAAC,KAAK,CAAC,EAAE;IAClC,IAAIA,OAAI,GAAG,KAAK,CAAC,CAAC;IAClB,IAAI;MACFA,OAAI,GAAG,KAAK,CAAC,IAAI,CAAC;KACnB,CAAC,OAAO,KAAK,EAAE;MACd,MAAM,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;MACvB,OAAO;KACR;IACD,mBAAmB,CAAC,OAAO,EAAE,KAAK,EAAEA,OAAI,CAAC,CAAC;GAC3C,MAAM;IACL,OAAO,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;GACzB;CACF;;AAED,SAAS,gBAAgB,CAAC,OAAO,EAAE;EACjC,IAAI,OAAO,CAAC,QAAQ,EAAE;IACpB,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;GACnC;;EAED,OAAO,CAAC,OAAO,CAAC,CAAC;CAClB;;AAED,SAAS,OAAO,CAAC,OAAO,EAAE,KAAK,EAAE;EAC/B,IAAI,OAAO,CAAC,MAAM,KAAK,OAAO,EAAE;IAC9B,OAAO;GACR;;EAED,OAAO,CAAC,OAAO,GAAG,KAAK,CAAC;EACxB,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC;;EAE3B,IAAI,OAAO,CAAC,YAAY,CAAC,MAAM,KAAK,CAAC,EAAE;IACrC,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;GACxB;CACF;;AAED,SAAS,MAAM,CAAC,OAAO,EAAE,MAAM,EAAE;EAC/B,IAAI,OAAO,CAAC,MAAM,KAAK,OAAO,EAAE;IAC9B,OAAO;GACR;EACD,OAAO,CAAC,MAAM,GAAG,QAAQ,CAAC;EAC1B,OAAO,CAAC,OAAO,GAAG,MAAM,CAAC;;EAEzB,IAAI,CAAC,gBAAgB,EAAE,OAAO,CAAC,CAAC;CACjC;;AAED,SAAS,SAAS,CAAC,MAAM,EAAE,KAAK,EAAE,aAAa,EAAE,WAAW,EAAE;EAC5D,IAAI,YAAY,GAAG,MAAM,CAAC,YAAY,CAAC;EACvC,IAAI,MAAM,GAAG,YAAY,CAAC,MAAM,CAAC;;;EAGjC,MAAM,CAAC,QAAQ,GAAG,IAAI,CAAC;;EAEvB,YAAY,CAAC,MAAM,CAAC,GAAG,KAAK,CAAC;EAC7B,YAAY,CAAC,MAAM,GAAG,SAAS,CAAC,GAAG,aAAa,CAAC;EACjD,YAAY,CAAC,MAAM,GAAG,QAAQ,CAAC,GAAG,WAAW,CAAC;;EAE9C,IAAI,MAAM,KAAK,CAAC,IAAI,MAAM,CAAC,MAAM,EAAE;IACjC,IAAI,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;GACvB;CACF;;AAED,SAAS,OAAO,CAAC,OAAO,EAAE;EACxB,IAAI,WAAW,GAAG,OAAO,CAAC,YAAY,CAAC;EACvC,IAAI,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC;;EAE7B,IAAI,WAAW,CAAC,MAAM,KAAK,CAAC,EAAE;IAC5B,OAAO;GACR;;EAED,IAAI,KAAK,GAAG,KAAK,CAAC;MACd,QAAQ,GAAG,KAAK,CAAC;MACjB,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;;EAE7B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,WAAW,CAAC,MAAM,EAAE,CAAC,IAAI,CAAC,EAAE;IAC9C,KAAK,GAAG,WAAW,CAAC,CAAC,CAAC,CAAC;IACvB,QAAQ,GAAG,WAAW,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC;;IAEpC,IAAI,KAAK,EAAE;MACT,cAAc,CAAC,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC;KAClD,MAAM;MACL,QAAQ,CAAC,MAAM,CAAC,CAAC;KAClB;GACF;;EAED,OAAO,CAAC,YAAY,CAAC,MAAM,GAAG,CAAC,CAAC;CACjC;;AAED,SAAS,cAAc,CAAC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE;EAC1D,IAAI,WAAW,GAAG,UAAU,CAAC,QAAQ,CAAC;MAClC,KAAK,GAAG,KAAK,CAAC;MACd,KAAK,GAAG,KAAK,CAAC;MACd,SAAS,GAAG,IAAI,CAAC;;EAErB,IAAI,WAAW,EAAE;IACf,IAAI;MACF,KAAK,GAAG,QAAQ,CAAC,MAAM,CAAC,CAAC;KAC1B,CAAC,OAAO,CAAC,EAAE;MACV,SAAS,GAAG,KAAK,CAAC;MAClB,KAAK,GAAG,CAAC,CAAC;KACX;;IAED,IAAI,OAAO,KAAK,KAAK,EAAE;MACrB,MAAM,CAAC,OAAO,EAAE,eAAe,EAAE,CAAC,CAAC;MACnC,OAAO;KACR;GACF,MAAM;IACL,KAAK,GAAG,MAAM,CAAC;GAChB;;EAED,IAAI,OAAO,CAAC,MAAM,KAAK,OAAO,EAAE;;GAE/B,MAAM,IAAI,WAAW,IAAI,SAAS,EAAE;IACnC,OAAO,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;GACzB,MAAM,IAAI,SAAS,KAAK,KAAK,EAAE;IAC9B,MAAM,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;GACxB,MAAM,IAAI,OAAO,KAAK,SAAS,EAAE;IAChC,OAAO,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;GACzB,MAAM,IAAI,OAAO,KAAK,QAAQ,EAAE;IAC/B,MAAM,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;GACxB;CACF;;AAED,SAAS,iBAAiB,CAAC,OAAO,EAAE,QAAQ,EAAE;EAC5C,IAAI;IACF,QAAQ,CAAC,SAAS,cAAc,CAAC,KAAK,EAAE;MACtC,OAAO,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;KACzB,EAAE,SAAS,aAAa,CAAC,MAAM,EAAE;MAChC,MAAM,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;KACzB,CAAC,CAAC;GACJ,CAAC,OAAO,CAAC,EAAE;IACV,MAAM,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC;GACpB;CACF;;AAED,IAAI,EAAE,GAAG,CAAC,CAAC;AACX,SAAS,MAAM,GAAG;EAChB,OAAO,EAAE,EAAE,CAAC;CACb;;AAED,SAAS,WAAW,CAAC,OAAO,EAAE;EAC5B,OAAO,CAAC,UAAU,CAAC,GAAG,EAAE,EAAE,CAAC;EAC3B,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC;EAC3B,OAAO,CAAC,OAAO,GAAG,SAAS,CAAC;EAC5B,OAAO,CAAC,YAAY,GAAG,EAAE,CAAC;CAC3B;;AChOD,SAAS,eAAe,GAAG;EACzB,OAAO,IAAI,KAAK,CAAC,yCAAyC,CAAC,CAAC;CAC7D,AAAC;;AAEF,IAAI,UAAU,GAAG,YAAY;EAC3B,SAAS,UAAU,CAAC,WAAW,EAAE,KAAK,EAAE;IACtC,IAAI,CAAC,oBAAoB,GAAG,WAAW,CAAC;IACxC,IAAI,CAAC,OAAO,GAAG,IAAI,WAAW,CAAC,IAAI,CAAC,CAAC;;IAErC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,EAAE;MAC7B,WAAW,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;KAC3B;;IAED,IAAI,OAAO,CAAC,KAAK,CAAC,EAAE;MAClB,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC;MAC3B,IAAI,CAAC,UAAU,GAAG,KAAK,CAAC,MAAM,CAAC;;MAE/B,IAAI,CAAC,OAAO,GAAG,IAAI,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;;MAEtC,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,EAAE;QACrB,OAAO,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;OACrC,MAAM;QACL,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,IAAI,CAAC,CAAC;QAC/B,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;QACvB,IAAI,IAAI,CAAC,UAAU,KAAK,CAAC,EAAE;UACzB,OAAO,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;SACrC;OACF;KACF,MAAM;MACL,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,eAAe,EAAE,CAAC,CAAC;KACzC;GACF;;EAED,UAAU,CAAC,SAAS,CAAC,UAAU,GAAG,SAAS,UAAU,CAAC,KAAK,EAAE;IAC3D,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,IAAI,CAAC,MAAM,KAAK,OAAO,IAAI,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;MAChE,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;KAC9B;GACF,CAAC;;EAEF,UAAU,CAAC,SAAS,CAAC,UAAU,GAAG,SAAS,UAAU,CAAC,KAAK,EAAE,CAAC,EAAE;IAC9D,IAAI,CAAC,GAAG,IAAI,CAAC,oBAAoB,CAAC;IAClC,IAAIF,UAAO,GAAG,CAAC,CAAC,OAAO,CAAC;;;IAGxB,IAAIA,UAAO,KAAKI,SAAe,EAAE;MAC/B,IAAI,KAAK,GAAG,KAAK,CAAC,CAAC;MACnB,IAAI,KAAK,GAAG,KAAK,CAAC,CAAC;MACnB,IAAI,QAAQ,GAAG,KAAK,CAAC;MACrB,IAAI;QACF,KAAK,GAAG,KAAK,CAAC,IAAI,CAAC;OACpB,CAAC,OAAO,CAAC,EAAE;QACV,QAAQ,GAAG,IAAI,CAAC;QAChB,KAAK,GAAG,CAAC,CAAC;OACX;;MAED,IAAI,KAAK,KAAKD,IAAY,IAAI,KAAK,CAAC,MAAM,KAAK,OAAO,EAAE;QACtD,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC;OACjD,MAAM,IAAI,OAAO,KAAK,KAAK,UAAU,EAAE;QACtC,IAAI,CAAC,UAAU,EAAE,CAAC;QAClB,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC;OACzB,MAAM,IAAI,CAAC,KAAKE,SAAO,EAAE;QACxB,IAAI,OAAO,GAAG,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC;QAC1B,IAAI,QAAQ,EAAE;UACZ,MAAM,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;SACxB,MAAM;UACL,mBAAmB,CAAC,OAAO,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;SAC5C;QACD,IAAI,CAAC,aAAa,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC;OAChC,MAAM;QACL,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC,UAAUL,UAAO,EAAE;UAC1C,OAAOA,UAAO,CAAC,KAAK,CAAC,CAAC;SACvB,CAAC,EAAE,CAAC,CAAC,CAAC;OACR;KACF,MAAM;MACL,IAAI,CAAC,aAAa,CAACA,UAAO,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC;KACvC;GACF,CAAC;;EAEF,UAAU,CAAC,SAAS,CAAC,UAAU,GAAG,SAAS,UAAU,CAAC,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE;IACrE,IAAI,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC;;;IAG3B,IAAI,OAAO,CAAC,MAAM,KAAK,OAAO,EAAE;MAC9B,IAAI,CAAC,UAAU,EAAE,CAAC;;MAElB,IAAI,KAAK,KAAK,QAAQ,EAAE;QACtB,MAAM,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;OACxB,MAAM;QACL,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC;OACzB;KACF;;IAED,IAAI,IAAI,CAAC,UAAU,KAAK,CAAC,EAAE;MACzB,OAAO,CAAC,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;KAChC;GACF,CAAC;;EAEF,UAAU,CAAC,SAAS,CAAC,aAAa,GAAG,SAAS,aAAa,CAAC,OAAO,EAAE,CAAC,EAAE;IACtE,IAAI,UAAU,GAAG,IAAI,CAAC;;IAEtB,SAAS,CAAC,OAAO,EAAE,SAAS,EAAE,UAAU,KAAK,EAAE;MAC7C,OAAO,UAAU,CAAC,UAAU,CAAC,SAAS,EAAE,CAAC,EAAE,KAAK,CAAC,CAAC;KACnD,EAAE,UAAU,MAAM,EAAE;MACnB,OAAO,UAAU,CAAC,UAAU,CAAC,QAAQ,EAAE,CAAC,EAAE,MAAM,CAAC,CAAC;KACnD,CAAC,CAAC;GACJ,CAAC;;EAEF,OAAO,UAAU,CAAC;CACnB,EAAE;;ACrHH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+CA,AAAe,SAAS,GAAG,CAAC,OAAO,EAAE;EACnC,OAAO,IAAI,UAAU,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC,OAAO,CAAC;;;CAC9C,DCjDD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiEA,AAAe,SAAS,IAAI,CAAC,OAAO,EAAE;;EAEpC,IAAI,WAAW,GAAG,IAAI,CAAC;;EAEvB,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE;IACrB,OAAO,IAAI,WAAW,CAAC,UAAU,CAAC,EAAE,MAAM,EAAE;MAC1C,OAAO,MAAM,CAAC,IAAI,SAAS,CAAC,iCAAiC,CAAC,CAAC,CAAC;KACjE,CAAC,CAAC;GACJ,MAAM;IACL,OAAO,IAAI,WAAW,CAAC,UAAU,OAAO,EAAE,MAAM,EAAE;MAChD,IAAI,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;MAC5B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,EAAE,CAAC,EAAE,EAAE;QAC/B,WAAW,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;OACvD;KACF,CAAC,CAAC;GACJ;;;CACF,DCjFD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkCA,AAAe,SAASM,QAAM,CAAC,MAAM,EAAE;;EAErC,IAAI,WAAW,GAAG,IAAI,CAAC;EACvB,IAAI,OAAO,GAAG,IAAI,WAAW,CAAC,IAAI,CAAC,CAAC;EACpCC,MAAO,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;EACzB,OAAO,OAAO,CAAC;;;CAChB,DC9BD,SAAS,aAAa,GAAG;EACvB,MAAM,IAAI,SAAS,CAAC,oFAAoF,CAAC,CAAC;CAC3G;;AAED,SAAS,QAAQ,GAAG;EAClB,MAAM,IAAI,SAAS,CAAC,uHAAuH,CAAC,CAAC;CAC9I;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0GD,IAAIF,SAAO,GAAG,YAAY;EACxB,SAAS,OAAO,CAAC,QAAQ,EAAE;IACzB,IAAI,CAAC,UAAU,CAAC,GAAG,MAAM,EAAE,CAAC;IAC5B,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,MAAM,GAAG,SAAS,CAAC;IACvC,IAAI,CAAC,YAAY,GAAG,EAAE,CAAC;;IAEvB,IAAI,IAAI,KAAK,QAAQ,EAAE;MACrB,OAAO,QAAQ,KAAK,UAAU,IAAI,aAAa,EAAE,CAAC;MAClD,IAAI,YAAY,OAAO,GAAG,iBAAiB,CAAC,IAAI,EAAE,QAAQ,CAAC,GAAG,QAAQ,EAAE,CAAC;KAC1E;GACF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA4LD,OAAO,CAAC,SAAS,CAAC,KAAK,GAAG,SAAS,MAAM,CAAC,WAAW,EAAE;IACrD,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,WAAW,CAAC,CAAC;GACrC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA0CF,OAAO,CAAC,SAAS,CAAC,OAAO,GAAG,SAAS,QAAQ,CAAC,QAAQ,EAAE;IACtD,IAAI,OAAO,GAAG,IAAI,CAAC;IACnB,IAAI,WAAW,GAAG,OAAO,CAAC,WAAW,CAAC;;IAEtC,IAAI,UAAU,CAAC,QAAQ,CAAC,EAAE;MACxB,OAAO,OAAO,CAAC,IAAI,CAAC,UAAU,KAAK,EAAE;QACnC,OAAO,WAAW,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAC,IAAI,CAAC,YAAY;UACtD,OAAO,KAAK,CAAC;SACd,CAAC,CAAC;OACJ,EAAE,UAAU,MAAM,EAAE;QACnB,OAAO,WAAW,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAC,IAAI,CAAC,YAAY;UACtD,MAAM,MAAM,CAAC;SACd,CAAC,CAAC;OACJ,CAAC,CAAC;KACJ;;IAED,OAAO,OAAO,CAAC,IAAI,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;GACzC,CAAC;;EAEF,OAAO,OAAO,CAAC;CAChB,EAAE,CAAC;;AAEJA,SAAO,CAAC,SAAS,CAAC,IAAI,GAAG,IAAI,CAAC;AAC9B,AACAA,SAAO,CAAC,GAAG,GAAG,GAAG,CAAC;AAClBA,SAAO,CAAC,IAAI,GAAG,IAAI,CAAC;AACpBA,SAAO,CAAC,OAAO,GAAGG,SAAO,CAAC;AAC1BH,SAAO,CAAC,MAAM,GAAGI,QAAM,CAAC;AACxBJ,SAAO,CAAC,aAAa,GAAG,YAAY,CAAC;AACrCA,SAAO,CAAC,QAAQ,GAAG,OAAO,CAAC;AAC3BA,SAAO,CAAC,KAAK,GAAG,IAAI;;AC5YpB;AACA,AAEe,SAAS,QAAQ,GAAG;EACjC,IAAI,KAAK,GAAG,KAAK,CAAC,CAAC;;EAEnB,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE;IACjC,KAAK,GAAG,MAAM,CAAC;GAChB,MAAM,IAAI,OAAO,IAAI,KAAK,WAAW,EAAE;IACtC,KAAK,GAAG,IAAI,CAAC;GACd,MAAM;IACL,IAAI;MACF,KAAK,GAAG,QAAQ,CAAC,aAAa,CAAC,EAAE,CAAC;KACnC,CAAC,OAAO,CAAC,EAAE;MACV,MAAM,IAAI,KAAK,CAAC,0EAA0E,CAAC,CAAC;KAC7F;GACF;;EAED,IAAI,CAAC,GAAG,KAAK,CAAC,OAAO,CAAC;;EAEtB,IAAI,CAAC,EAAE;IACL,IAAI,eAAe,GAAG,IAAI,CAAC;IAC3B,IAAI;MACF,eAAe,GAAG,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC;KAC/D,CAAC,OAAO,CAAC,EAAE;;KAEX;;IAED,IAAI,eAAe,KAAK,kBAAkB,IAAI,CAAC,CAAC,CAAC,IAAI,EAAE;MACrD,OAAO;KACR;GACF;;EAED,KAAK,CAAC,OAAO,GAAGA,SAAO,CAAC;;;CACzB,DC/BD;AACAA,SAAO,CAAC,QAAQ,GAAG,QAAQ,CAAC;AAC5BA,SAAO,CAAC,OAAO,GAAGA,SAAO,CAAC;;;;;;;;","file":"es6-promise.min.js"} \ No newline at end of file diff --git a/deps/npm/node_modules/es6-promise/es6-promise.d.ts b/deps/npm/node_modules/es6-promise/es6-promise.d.ts deleted file mode 100644 index e4200dfd0d0f6f..00000000000000 --- a/deps/npm/node_modules/es6-promise/es6-promise.d.ts +++ /dev/null @@ -1,85 +0,0 @@ -export interface Thenable { - then (onFulfilled?: (value: R) => U | Thenable, onRejected?: (error: any) => U | Thenable): Thenable; - then (onFulfilled?: (value: R) => U | Thenable, onRejected?: (error: any) => void): Thenable; -} - -export class Promise implements Thenable { - /** - * If you call resolve in the body of the callback passed to the constructor, - * your promise is fulfilled with result object passed to resolve. - * If you call reject your promise is rejected with the object passed to resolve. - * For consistency and debugging (eg stack traces), obj should be an instanceof Error. - * Any errors thrown in the constructor callback will be implicitly passed to reject(). - */ - constructor (callback: (resolve : (value?: R | Thenable) => void, reject: (error?: any) => void) => void); - - /** - * onFulfilled is called when/if "promise" resolves. onRejected is called when/if "promise" rejects. - * Both are optional, if either/both are omitted the next onFulfilled/onRejected in the chain is called. - * Both callbacks have a single parameter , the fulfillment value or rejection reason. - * "then" returns a new promise equivalent to the value you return from onFulfilled/onRejected after being passed through Promise.resolve. - * If an error is thrown in the callback, the returned promise rejects with that error. - * - * @param onFulfilled called when/if "promise" resolves - * @param onRejected called when/if "promise" rejects - */ - then (onFulfilled?: (value: R) => U | Thenable, onRejected?: (error: any) => U | Thenable): Promise; - then (onFulfilled?: (value: R) => U | Thenable, onRejected?: (error: any) => void): Promise; - - /** - * Sugar for promise.then(undefined, onRejected) - * - * @param onRejected called when/if "promise" rejects - */ - catch (onRejected?: (error: any) => U | Thenable): Promise; - - /** - * onSettled is invoked when/if the "promise" settles (either rejects or fulfills). - * The returned promise is settled when the `Thenable` returned by `onFinally` settles; - * it is rejected if `onFinally` throws or rejects; otherwise it assumes the state of the - * original Promise. - * - * @param onFinally called when/if "promise" settles - - */ - finally (onFinally?: () => any | Thenable): Promise; - - /** - * Make a new promise from the thenable. - * A thenable is promise-like in as far as it has a "then" method. - */ - static resolve (): Promise; - static resolve (value: R | Thenable): Promise; - - /** - * Make a promise that rejects to obj. For consistency and debugging (eg stack traces), obj should be an instanceof Error - */ - static reject (error: any): Promise; - - /** - * Make a promise that fulfills when every item in the array fulfills, and rejects if (and when) any item rejects. - * the array passed to all can be a mixture of promise-like objects and other objects. - * The fulfillment value is an array (in order) of fulfillment values. The rejection value is the first rejection value. - */ - static all(values: [T1 | Thenable, T2 | Thenable, T3 | Thenable, T4 | Thenable , T5 | Thenable, T6 | Thenable, T7 | Thenable, T8 | Thenable, T9 | Thenable, T10 | Thenable]): Promise<[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10]>; - static all(values: [T1 | Thenable, T2 | Thenable, T3 | Thenable, T4 | Thenable , T5 | Thenable, T6 | Thenable, T7 | Thenable, T8 | Thenable, T9 | Thenable]): Promise<[T1, T2, T3, T4, T5, T6, T7, T8, T9]>; - static all(values: [T1 | Thenable, T2 | Thenable, T3 | Thenable, T4 | Thenable , T5 | Thenable, T6 | Thenable, T7 | Thenable, T8 | Thenable]): Promise<[T1, T2, T3, T4, T5, T6, T7, T8]>; - static all(values: [T1 | Thenable, T2 | Thenable, T3 | Thenable, T4 | Thenable , T5 | Thenable, T6 | Thenable, T7 | Thenable]): Promise<[T1, T2, T3, T4, T5, T6, T7]>; - static all(values: [T1 | Thenable, T2 | Thenable, T3 | Thenable, T4 | Thenable , T5 | Thenable, T6 | Thenable]): Promise<[T1, T2, T3, T4, T5, T6]>; - static all(values: [T1 | Thenable, T2 | Thenable, T3 | Thenable, T4 | Thenable , T5 | Thenable]): Promise<[T1, T2, T3, T4, T5]>; - static all(values: [T1 | Thenable, T2 | Thenable, T3 | Thenable, T4 | Thenable ]): Promise<[T1, T2, T3, T4]>; - static all(values: [T1 | Thenable, T2 | Thenable, T3 | Thenable]): Promise<[T1, T2, T3]>; - static all(values: [T1 | Thenable, T2 | Thenable]): Promise<[T1, T2]>; - static all(values: [T1 | Thenable]): Promise<[T1]>; - static all(values: Array>): Promise; - - /** - * Make a Promise that fulfills when any item fulfills, and rejects if any item rejects. - */ - static race (promises: (R | Thenable)[]): Promise; -} - -/** - * The polyfill method will patch the global environment (in this case to the Promise name) when called. - */ -export function polyfill (): void; diff --git a/deps/npm/node_modules/es6-promise/lib/es6-promise.auto.js b/deps/npm/node_modules/es6-promise/lib/es6-promise.auto.js deleted file mode 100644 index 77997866f825a1..00000000000000 --- a/deps/npm/node_modules/es6-promise/lib/es6-promise.auto.js +++ /dev/null @@ -1,3 +0,0 @@ -import Promise from './es6-promise'; -Promise.polyfill(); -export default Promise; diff --git a/deps/npm/node_modules/es6-promise/lib/es6-promise.js b/deps/npm/node_modules/es6-promise/lib/es6-promise.js deleted file mode 100644 index 4f4d840d09b53c..00000000000000 --- a/deps/npm/node_modules/es6-promise/lib/es6-promise.js +++ /dev/null @@ -1,7 +0,0 @@ -import Promise from './es6-promise/promise'; -import polyfill from './es6-promise/polyfill'; - -// Strange compat.. -Promise.polyfill = polyfill; -Promise.Promise = Promise; -export default Promise; diff --git a/deps/npm/node_modules/es6-promise/lib/es6-promise/-internal.js b/deps/npm/node_modules/es6-promise/lib/es6-promise/-internal.js deleted file mode 100644 index 6bd75a82c309da..00000000000000 --- a/deps/npm/node_modules/es6-promise/lib/es6-promise/-internal.js +++ /dev/null @@ -1,243 +0,0 @@ -import { - objectOrFunction, - isFunction -} from './utils'; - -import { - asap -} from './asap'; - -import originalThen from './then'; -import originalResolve from './promise/resolve'; - -export const PROMISE_ID = Math.random().toString(36).substring(2); - -function noop() {} - -const PENDING = void 0; -const FULFILLED = 1; -const REJECTED = 2; - -function selfFulfillment() { - return new TypeError("You cannot resolve a promise with itself"); -} - -function cannotReturnOwn() { - return new TypeError('A promises callback cannot return that same promise.'); -} - -function tryThen(then, value, fulfillmentHandler, rejectionHandler) { - try { - then.call(value, fulfillmentHandler, rejectionHandler); - } catch(e) { - return e; - } -} - -function handleForeignThenable(promise, thenable, then) { - asap(promise => { - let sealed = false; - let error = tryThen(then, thenable, value => { - if (sealed) { return; } - sealed = true; - if (thenable !== value) { - resolve(promise, value); - } else { - fulfill(promise, value); - } - }, reason => { - if (sealed) { return; } - sealed = true; - - reject(promise, reason); - }, 'Settle: ' + (promise._label || ' unknown promise')); - - if (!sealed && error) { - sealed = true; - reject(promise, error); - } - }, promise); -} - -function handleOwnThenable(promise, thenable) { - if (thenable._state === FULFILLED) { - fulfill(promise, thenable._result); - } else if (thenable._state === REJECTED) { - reject(promise, thenable._result); - } else { - subscribe(thenable, undefined, value => resolve(promise, value), - reason => reject(promise, reason)) - } -} - -function handleMaybeThenable(promise, maybeThenable, then) { - if (maybeThenable.constructor === promise.constructor && - then === originalThen && - maybeThenable.constructor.resolve === originalResolve) { - handleOwnThenable(promise, maybeThenable); - } else { - if (then === undefined) { - fulfill(promise, maybeThenable); - } else if (isFunction(then)) { - handleForeignThenable(promise, maybeThenable, then); - } else { - fulfill(promise, maybeThenable); - } - } -} - -function resolve(promise, value) { - if (promise === value) { - reject(promise, selfFulfillment()); - } else if (objectOrFunction(value)) { - let then; - try { - then = value.then; - } catch (error) { - reject(promise, error); - return; - } - handleMaybeThenable(promise, value, then); - } else { - fulfill(promise, value); - } -} - -function publishRejection(promise) { - if (promise._onerror) { - promise._onerror(promise._result); - } - - publish(promise); -} - -function fulfill(promise, value) { - if (promise._state !== PENDING) { return; } - - promise._result = value; - promise._state = FULFILLED; - - if (promise._subscribers.length !== 0) { - asap(publish, promise); - } -} - -function reject(promise, reason) { - if (promise._state !== PENDING) { return; } - promise._state = REJECTED; - promise._result = reason; - - asap(publishRejection, promise); -} - -function subscribe(parent, child, onFulfillment, onRejection) { - let { _subscribers } = parent; - let { length } = _subscribers; - - parent._onerror = null; - - _subscribers[length] = child; - _subscribers[length + FULFILLED] = onFulfillment; - _subscribers[length + REJECTED] = onRejection; - - if (length === 0 && parent._state) { - asap(publish, parent); - } -} - -function publish(promise) { - let subscribers = promise._subscribers; - let settled = promise._state; - - if (subscribers.length === 0) { return; } - - let child, callback, detail = promise._result; - - for (let i = 0; i < subscribers.length; i += 3) { - child = subscribers[i]; - callback = subscribers[i + settled]; - - if (child) { - invokeCallback(settled, child, callback, detail); - } else { - callback(detail); - } - } - - promise._subscribers.length = 0; -} - -function invokeCallback(settled, promise, callback, detail) { - let hasCallback = isFunction(callback), - value, error, succeeded = true; - - if (hasCallback) { - try { - value = callback(detail); - } catch (e) { - succeeded = false; - error = e; - } - - if (promise === value) { - reject(promise, cannotReturnOwn()); - return; - } - } else { - value = detail; - } - - if (promise._state !== PENDING) { - // noop - } else if (hasCallback && succeeded) { - resolve(promise, value); - } else if (succeeded === false) { - reject(promise, error); - } else if (settled === FULFILLED) { - fulfill(promise, value); - } else if (settled === REJECTED) { - reject(promise, value); - } -} - -function initializePromise(promise, resolver) { - try { - resolver(function resolvePromise(value){ - resolve(promise, value); - }, function rejectPromise(reason) { - reject(promise, reason); - }); - } catch(e) { - reject(promise, e); - } -} - -let id = 0; -function nextId() { - return id++; -} - -function makePromise(promise) { - promise[PROMISE_ID] = id++; - promise._state = undefined; - promise._result = undefined; - promise._subscribers = []; -} - -export { - nextId, - makePromise, - noop, - resolve, - reject, - fulfill, - subscribe, - publish, - publishRejection, - initializePromise, - invokeCallback, - FULFILLED, - REJECTED, - PENDING, - handleMaybeThenable -}; diff --git a/deps/npm/node_modules/es6-promise/lib/es6-promise/asap.js b/deps/npm/node_modules/es6-promise/lib/es6-promise/asap.js deleted file mode 100644 index 0483201dc944c3..00000000000000 --- a/deps/npm/node_modules/es6-promise/lib/es6-promise/asap.js +++ /dev/null @@ -1,119 +0,0 @@ -let len = 0; -let vertxNext; -let customSchedulerFn; - -export var asap = function asap(callback, arg) { - queue[len] = callback; - queue[len + 1] = arg; - len += 2; - if (len === 2) { - // If len is 2, that means that we need to schedule an async flush. - // If additional callbacks are queued before the queue is flushed, they - // will be processed by this flush that we are scheduling. - if (customSchedulerFn) { - customSchedulerFn(flush); - } else { - scheduleFlush(); - } - } -} - -export function setScheduler(scheduleFn) { - customSchedulerFn = scheduleFn; -} - -export function setAsap(asapFn) { - asap = asapFn; -} - -const browserWindow = (typeof window !== 'undefined') ? window : undefined; -const browserGlobal = browserWindow || {}; -const BrowserMutationObserver = browserGlobal.MutationObserver || browserGlobal.WebKitMutationObserver; -const isNode = typeof self === 'undefined' && typeof process !== 'undefined' && {}.toString.call(process) === '[object process]'; - -// test for web worker but not in IE10 -const isWorker = typeof Uint8ClampedArray !== 'undefined' && - typeof importScripts !== 'undefined' && - typeof MessageChannel !== 'undefined'; - -// node -function useNextTick() { - // node version 0.10.x displays a deprecation warning when nextTick is used recursively - // see https://github.com/cujojs/when/issues/410 for details - return () => process.nextTick(flush); -} - -// vertx -function useVertxTimer() { - if (typeof vertxNext !== 'undefined') { - return function() { - vertxNext(flush); - }; - } - - return useSetTimeout(); -} - -function useMutationObserver() { - let iterations = 0; - const observer = new BrowserMutationObserver(flush); - const node = document.createTextNode(''); - observer.observe(node, { characterData: true }); - - return () => { - node.data = (iterations = ++iterations % 2); - }; -} - -// web worker -function useMessageChannel() { - const channel = new MessageChannel(); - channel.port1.onmessage = flush; - return () => channel.port2.postMessage(0); -} - -function useSetTimeout() { - // Store setTimeout reference so es6-promise will be unaffected by - // other code modifying setTimeout (like sinon.useFakeTimers()) - const globalSetTimeout = setTimeout; - return () => globalSetTimeout(flush, 1); -} - -const queue = new Array(1000); -function flush() { - for (let i = 0; i < len; i+=2) { - let callback = queue[i]; - let arg = queue[i+1]; - - callback(arg); - - queue[i] = undefined; - queue[i+1] = undefined; - } - - len = 0; -} - -function attemptVertx() { - try { - const vertx = Function('return this')().require('vertx'); - vertxNext = vertx.runOnLoop || vertx.runOnContext; - return useVertxTimer(); - } catch(e) { - return useSetTimeout(); - } -} - -let scheduleFlush; -// Decide what async method to use to triggering processing of queued callbacks: -if (isNode) { - scheduleFlush = useNextTick(); -} else if (BrowserMutationObserver) { - scheduleFlush = useMutationObserver(); -} else if (isWorker) { - scheduleFlush = useMessageChannel(); -} else if (browserWindow === undefined && typeof require === 'function') { - scheduleFlush = attemptVertx(); -} else { - scheduleFlush = useSetTimeout(); -} diff --git a/deps/npm/node_modules/es6-promise/lib/es6-promise/enumerator.js b/deps/npm/node_modules/es6-promise/lib/es6-promise/enumerator.js deleted file mode 100644 index be2e0938a99874..00000000000000 --- a/deps/npm/node_modules/es6-promise/lib/es6-promise/enumerator.js +++ /dev/null @@ -1,124 +0,0 @@ -import { - isArray, - isMaybeThenable -} from './utils'; -import { - noop, - reject, - fulfill, - subscribe, - FULFILLED, - REJECTED, - PENDING, - handleMaybeThenable -} from './-internal'; - -import then from './then'; -import Promise from './promise'; -import originalResolve from './promise/resolve'; -import originalThen from './then'; -import { makePromise, PROMISE_ID } from './-internal'; - -function validationError() { - return new Error('Array Methods must be provided an Array'); -}; - -export default class Enumerator { - constructor(Constructor, input) { - this._instanceConstructor = Constructor; - this.promise = new Constructor(noop); - - if (!this.promise[PROMISE_ID]) { - makePromise(this.promise); - } - - if (isArray(input)) { - this.length = input.length; - this._remaining = input.length; - - this._result = new Array(this.length); - - if (this.length === 0) { - fulfill(this.promise, this._result); - } else { - this.length = this.length || 0; - this._enumerate(input); - if (this._remaining === 0) { - fulfill(this.promise, this._result); - } - } - } else { - reject(this.promise, validationError()); - } - } - _enumerate(input) { - for (let i = 0; this._state === PENDING && i < input.length; i++) { - this._eachEntry(input[i], i); - } - } - - _eachEntry(entry, i) { - let c = this._instanceConstructor; - let { resolve } = c; - - if (resolve === originalResolve) { - let then; - let error; - let didError = false; - try { - then = entry.then; - } catch (e) { - didError = true; - error = e; - } - - if (then === originalThen && - entry._state !== PENDING) { - this._settledAt(entry._state, i, entry._result); - } else if (typeof then !== 'function') { - this._remaining--; - this._result[i] = entry; - } else if (c === Promise) { - let promise = new c(noop); - if (didError) { - reject(promise, error); - } else { - handleMaybeThenable(promise, entry, then); - } - this._willSettleAt(promise, i); - } else { - this._willSettleAt(new c(resolve => resolve(entry)), i); - } - } else { - this._willSettleAt(resolve(entry), i); - } - } - - _settledAt(state, i, value) { - let { promise } = this; - - if (promise._state === PENDING) { - this._remaining--; - - if (state === REJECTED) { - reject(promise, value); - } else { - this._result[i] = value; - } - } - - if (this._remaining === 0) { - fulfill(promise, this._result); - } - } - - _willSettleAt(promise, i) { - let enumerator = this; - - subscribe( - promise, undefined, - value => enumerator._settledAt(FULFILLED, i, value), - reason => enumerator._settledAt(REJECTED, i, reason) - ); - } -}; diff --git a/deps/npm/node_modules/es6-promise/lib/es6-promise/polyfill.js b/deps/npm/node_modules/es6-promise/lib/es6-promise/polyfill.js deleted file mode 100644 index 30db73c9d01365..00000000000000 --- a/deps/npm/node_modules/es6-promise/lib/es6-promise/polyfill.js +++ /dev/null @@ -1,35 +0,0 @@ -/*global self*/ -import Promise from './promise'; - -export default function polyfill() { - let local; - - if (typeof global !== 'undefined') { - local = global; - } else if (typeof self !== 'undefined') { - local = self; - } else { - try { - local = Function('return this')(); - } catch (e) { - throw new Error('polyfill failed because global object is unavailable in this environment'); - } - } - - let P = local.Promise; - - if (P) { - var promiseToString = null; - try { - promiseToString = Object.prototype.toString.call(P.resolve()); - } catch(e) { - // silently ignored - } - - if (promiseToString === '[object Promise]' && !P.cast){ - return; - } - } - - local.Promise = Promise; -} diff --git a/deps/npm/node_modules/es6-promise/lib/es6-promise/promise.js b/deps/npm/node_modules/es6-promise/lib/es6-promise/promise.js deleted file mode 100644 index ae1703638d710d..00000000000000 --- a/deps/npm/node_modules/es6-promise/lib/es6-promise/promise.js +++ /dev/null @@ -1,431 +0,0 @@ -import { - isFunction -} from './utils'; -import { - noop, - nextId, - PROMISE_ID, - initializePromise -} from './-internal'; -import { - asap, - setAsap, - setScheduler -} from './asap'; - -import all from './promise/all'; -import race from './promise/race'; -import Resolve from './promise/resolve'; -import Reject from './promise/reject'; -import then from './then'; - -function needsResolver() { - throw new TypeError('You must pass a resolver function as the first argument to the promise constructor'); -} - -function needsNew() { - throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function."); -} - -/** - Promise objects represent the eventual result of an asynchronous operation. The - primary way of interacting with a promise is through its `then` method, which - registers callbacks to receive either a promise's eventual value or the reason - why the promise cannot be fulfilled. - - Terminology - ----------- - - - `promise` is an object or function with a `then` method whose behavior conforms to this specification. - - `thenable` is an object or function that defines a `then` method. - - `value` is any legal JavaScript value (including undefined, a thenable, or a promise). - - `exception` is a value that is thrown using the throw statement. - - `reason` is a value that indicates why a promise was rejected. - - `settled` the final resting state of a promise, fulfilled or rejected. - - A promise can be in one of three states: pending, fulfilled, or rejected. - - Promises that are fulfilled have a fulfillment value and are in the fulfilled - state. Promises that are rejected have a rejection reason and are in the - rejected state. A fulfillment value is never a thenable. - - Promises can also be said to *resolve* a value. If this value is also a - promise, then the original promise's settled state will match the value's - settled state. So a promise that *resolves* a promise that rejects will - itself reject, and a promise that *resolves* a promise that fulfills will - itself fulfill. - - - Basic Usage: - ------------ - - ```js - let promise = new Promise(function(resolve, reject) { - // on success - resolve(value); - - // on failure - reject(reason); - }); - - promise.then(function(value) { - // on fulfillment - }, function(reason) { - // on rejection - }); - ``` - - Advanced Usage: - --------------- - - Promises shine when abstracting away asynchronous interactions such as - `XMLHttpRequest`s. - - ```js - function getJSON(url) { - return new Promise(function(resolve, reject){ - let xhr = new XMLHttpRequest(); - - xhr.open('GET', url); - xhr.onreadystatechange = handler; - xhr.responseType = 'json'; - xhr.setRequestHeader('Accept', 'application/json'); - xhr.send(); - - function handler() { - if (this.readyState === this.DONE) { - if (this.status === 200) { - resolve(this.response); - } else { - reject(new Error('getJSON: `' + url + '` failed with status: [' + this.status + ']')); - } - } - }; - }); - } - - getJSON('/posts.json').then(function(json) { - // on fulfillment - }, function(reason) { - // on rejection - }); - ``` - - Unlike callbacks, promises are great composable primitives. - - ```js - Promise.all([ - getJSON('/posts'), - getJSON('/comments') - ]).then(function(values){ - values[0] // => postsJSON - values[1] // => commentsJSON - - return values; - }); - ``` - - @class Promise - @param {Function} resolver - Useful for tooling. - @constructor -*/ - -class Promise { - constructor(resolver) { - this[PROMISE_ID] = nextId(); - this._result = this._state = undefined; - this._subscribers = []; - - if (noop !== resolver) { - typeof resolver !== 'function' && needsResolver(); - this instanceof Promise ? initializePromise(this, resolver) : needsNew(); - } - } - - /** - The primary way of interacting with a promise is through its `then` method, - which registers callbacks to receive either a promise's eventual value or the - reason why the promise cannot be fulfilled. - - ```js - findUser().then(function(user){ - // user is available - }, function(reason){ - // user is unavailable, and you are given the reason why - }); - ``` - - Chaining - -------- - - The return value of `then` is itself a promise. This second, 'downstream' - promise is resolved with the return value of the first promise's fulfillment - or rejection handler, or rejected if the handler throws an exception. - - ```js - findUser().then(function (user) { - return user.name; - }, function (reason) { - return 'default name'; - }).then(function (userName) { - // If `findUser` fulfilled, `userName` will be the user's name, otherwise it - // will be `'default name'` - }); - - findUser().then(function (user) { - throw new Error('Found user, but still unhappy'); - }, function (reason) { - throw new Error('`findUser` rejected and we're unhappy'); - }).then(function (value) { - // never reached - }, function (reason) { - // if `findUser` fulfilled, `reason` will be 'Found user, but still unhappy'. - // If `findUser` rejected, `reason` will be '`findUser` rejected and we're unhappy'. - }); - ``` - If the downstream promise does not specify a rejection handler, rejection reasons will be propagated further downstream. - - ```js - findUser().then(function (user) { - throw new PedagogicalException('Upstream error'); - }).then(function (value) { - // never reached - }).then(function (value) { - // never reached - }, function (reason) { - // The `PedgagocialException` is propagated all the way down to here - }); - ``` - - Assimilation - ------------ - - Sometimes the value you want to propagate to a downstream promise can only be - retrieved asynchronously. This can be achieved by returning a promise in the - fulfillment or rejection handler. The downstream promise will then be pending - until the returned promise is settled. This is called *assimilation*. - - ```js - findUser().then(function (user) { - return findCommentsByAuthor(user); - }).then(function (comments) { - // The user's comments are now available - }); - ``` - - If the assimliated promise rejects, then the downstream promise will also reject. - - ```js - findUser().then(function (user) { - return findCommentsByAuthor(user); - }).then(function (comments) { - // If `findCommentsByAuthor` fulfills, we'll have the value here - }, function (reason) { - // If `findCommentsByAuthor` rejects, we'll have the reason here - }); - ``` - - Simple Example - -------------- - - Synchronous Example - - ```javascript - let result; - - try { - result = findResult(); - // success - } catch(reason) { - // failure - } - ``` - - Errback Example - - ```js - findResult(function(result, err){ - if (err) { - // failure - } else { - // success - } - }); - ``` - - Promise Example; - - ```javascript - findResult().then(function(result){ - // success - }, function(reason){ - // failure - }); - ``` - - Advanced Example - -------------- - - Synchronous Example - - ```javascript - let author, books; - - try { - author = findAuthor(); - books = findBooksByAuthor(author); - // success - } catch(reason) { - // failure - } - ``` - - Errback Example - - ```js - - function foundBooks(books) { - - } - - function failure(reason) { - - } - - findAuthor(function(author, err){ - if (err) { - failure(err); - // failure - } else { - try { - findBoooksByAuthor(author, function(books, err) { - if (err) { - failure(err); - } else { - try { - foundBooks(books); - } catch(reason) { - failure(reason); - } - } - }); - } catch(error) { - failure(err); - } - // success - } - }); - ``` - - Promise Example; - - ```javascript - findAuthor(). - then(findBooksByAuthor). - then(function(books){ - // found books - }).catch(function(reason){ - // something went wrong - }); - ``` - - @method then - @param {Function} onFulfilled - @param {Function} onRejected - Useful for tooling. - @return {Promise} - */ - - /** - `catch` is simply sugar for `then(undefined, onRejection)` which makes it the same - as the catch block of a try/catch statement. - - ```js - function findAuthor(){ - throw new Error('couldn't find that author'); - } - - // synchronous - try { - findAuthor(); - } catch(reason) { - // something went wrong - } - - // async with promises - findAuthor().catch(function(reason){ - // something went wrong - }); - ``` - - @method catch - @param {Function} onRejection - Useful for tooling. - @return {Promise} - */ - catch(onRejection) { - return this.then(null, onRejection); - } - -/** - `finally` will be invoked regardless of the promise's fate just as native - try/catch/finally behaves - - Synchronous example: - - ```js - findAuthor() { - if (Math.random() > 0.5) { - throw new Error(); - } - return new Author(); - } - - try { - return findAuthor(); // succeed or fail - } catch(error) { - return findOtherAuther(); - } finally { - // always runs - // doesn't affect the return value - } - ``` - - Asynchronous example: - - ```js - findAuthor().catch(function(reason){ - return findOtherAuther(); - }).finally(function(){ - // author was either found, or not - }); - ``` - - @method finally - @param {Function} callback - @return {Promise} -*/ - finally(callback) { - let promise = this; - let constructor = promise.constructor; - - if ( isFunction(callback) ) { - return promise.then(value => constructor.resolve(callback()).then(() => value), - reason => constructor.resolve(callback()).then(() => { throw reason; })); - } - - return promise.then(callback, callback); - } -} - -Promise.prototype.then = then; -export default Promise; -Promise.all = all; -Promise.race = race; -Promise.resolve = Resolve; -Promise.reject = Reject; -Promise._setScheduler = setScheduler; -Promise._setAsap = setAsap; -Promise._asap = asap; - diff --git a/deps/npm/node_modules/es6-promise/lib/es6-promise/promise/all.js b/deps/npm/node_modules/es6-promise/lib/es6-promise/promise/all.js deleted file mode 100644 index 9ca3c063aa2f62..00000000000000 --- a/deps/npm/node_modules/es6-promise/lib/es6-promise/promise/all.js +++ /dev/null @@ -1,52 +0,0 @@ -import Enumerator from '../enumerator'; - -/** - `Promise.all` accepts an array of promises, and returns a new promise which - is fulfilled with an array of fulfillment values for the passed promises, or - rejected with the reason of the first passed promise to be rejected. It casts all - elements of the passed iterable to promises as it runs this algorithm. - - Example: - - ```javascript - let promise1 = resolve(1); - let promise2 = resolve(2); - let promise3 = resolve(3); - let promises = [ promise1, promise2, promise3 ]; - - Promise.all(promises).then(function(array){ - // The array here would be [ 1, 2, 3 ]; - }); - ``` - - If any of the `promises` given to `all` are rejected, the first promise - that is rejected will be given as an argument to the returned promises's - rejection handler. For example: - - Example: - - ```javascript - let promise1 = resolve(1); - let promise2 = reject(new Error("2")); - let promise3 = reject(new Error("3")); - let promises = [ promise1, promise2, promise3 ]; - - Promise.all(promises).then(function(array){ - // Code here never runs because there are rejected promises! - }, function(error) { - // error.message === "2" - }); - ``` - - @method all - @static - @param {Array} entries array of promises - @param {String} label optional string for labeling the promise. - Useful for tooling. - @return {Promise} promise that is fulfilled when all `promises` have been - fulfilled, or rejected if any of them become rejected. - @static -*/ -export default function all(entries) { - return new Enumerator(this, entries).promise; -} diff --git a/deps/npm/node_modules/es6-promise/lib/es6-promise/promise/race.js b/deps/npm/node_modules/es6-promise/lib/es6-promise/promise/race.js deleted file mode 100644 index 166dc820b5827e..00000000000000 --- a/deps/npm/node_modules/es6-promise/lib/es6-promise/promise/race.js +++ /dev/null @@ -1,84 +0,0 @@ -import { - isArray -} from "../utils"; - -/** - `Promise.race` returns a new promise which is settled in the same way as the - first passed promise to settle. - - Example: - - ```javascript - let promise1 = new Promise(function(resolve, reject){ - setTimeout(function(){ - resolve('promise 1'); - }, 200); - }); - - let promise2 = new Promise(function(resolve, reject){ - setTimeout(function(){ - resolve('promise 2'); - }, 100); - }); - - Promise.race([promise1, promise2]).then(function(result){ - // result === 'promise 2' because it was resolved before promise1 - // was resolved. - }); - ``` - - `Promise.race` is deterministic in that only the state of the first - settled promise matters. For example, even if other promises given to the - `promises` array argument are resolved, but the first settled promise has - become rejected before the other promises became fulfilled, the returned - promise will become rejected: - - ```javascript - let promise1 = new Promise(function(resolve, reject){ - setTimeout(function(){ - resolve('promise 1'); - }, 200); - }); - - let promise2 = new Promise(function(resolve, reject){ - setTimeout(function(){ - reject(new Error('promise 2')); - }, 100); - }); - - Promise.race([promise1, promise2]).then(function(result){ - // Code here never runs - }, function(reason){ - // reason.message === 'promise 2' because promise 2 became rejected before - // promise 1 became fulfilled - }); - ``` - - An example real-world use case is implementing timeouts: - - ```javascript - Promise.race([ajax('foo.json'), timeout(5000)]) - ``` - - @method race - @static - @param {Array} promises array of promises to observe - Useful for tooling. - @return {Promise} a promise which settles in the same way as the first passed - promise to settle. -*/ -export default function race(entries) { - /*jshint validthis:true */ - let Constructor = this; - - if (!isArray(entries)) { - return new Constructor((_, reject) => reject(new TypeError('You must pass an array to race.'))); - } else { - return new Constructor((resolve, reject) => { - let length = entries.length; - for (let i = 0; i < length; i++) { - Constructor.resolve(entries[i]).then(resolve, reject); - } - }); - } -} diff --git a/deps/npm/node_modules/es6-promise/lib/es6-promise/promise/reject.js b/deps/npm/node_modules/es6-promise/lib/es6-promise/promise/reject.js deleted file mode 100644 index cd55faabf537ca..00000000000000 --- a/deps/npm/node_modules/es6-promise/lib/es6-promise/promise/reject.js +++ /dev/null @@ -1,46 +0,0 @@ -import { - noop, - reject as _reject -} from '../-internal'; - -/** - `Promise.reject` returns a promise rejected with the passed `reason`. - It is shorthand for the following: - - ```javascript - let promise = new Promise(function(resolve, reject){ - reject(new Error('WHOOPS')); - }); - - promise.then(function(value){ - // Code here doesn't run because the promise is rejected! - }, function(reason){ - // reason.message === 'WHOOPS' - }); - ``` - - Instead of writing the above, your code now simply becomes the following: - - ```javascript - let promise = Promise.reject(new Error('WHOOPS')); - - promise.then(function(value){ - // Code here doesn't run because the promise is rejected! - }, function(reason){ - // reason.message === 'WHOOPS' - }); - ``` - - @method reject - @static - @param {Any} reason value that the returned promise will be rejected with. - Useful for tooling. - @return {Promise} a promise rejected with the given `reason`. -*/ -export default function reject(reason) { - /*jshint validthis:true */ - let Constructor = this; - let promise = new Constructor(noop); - _reject(promise, reason); - return promise; -} diff --git a/deps/npm/node_modules/es6-promise/lib/es6-promise/promise/resolve.js b/deps/npm/node_modules/es6-promise/lib/es6-promise/promise/resolve.js deleted file mode 100644 index f4642b630e0517..00000000000000 --- a/deps/npm/node_modules/es6-promise/lib/es6-promise/promise/resolve.js +++ /dev/null @@ -1,48 +0,0 @@ -import { - noop, - resolve as _resolve -} from '../-internal'; - -/** - `Promise.resolve` returns a promise that will become resolved with the - passed `value`. It is shorthand for the following: - - ```javascript - let promise = new Promise(function(resolve, reject){ - resolve(1); - }); - - promise.then(function(value){ - // value === 1 - }); - ``` - - Instead of writing the above, your code now simply becomes the following: - - ```javascript - let promise = Promise.resolve(1); - - promise.then(function(value){ - // value === 1 - }); - ``` - - @method resolve - @static - @param {Any} value value that the returned promise will be resolved with - Useful for tooling. - @return {Promise} a promise that will become fulfilled with the given - `value` -*/ -export default function resolve(object) { - /*jshint validthis:true */ - let Constructor = this; - - if (object && typeof object === 'object' && object.constructor === Constructor) { - return object; - } - - let promise = new Constructor(noop); - _resolve(promise, object); - return promise; -} diff --git a/deps/npm/node_modules/es6-promise/lib/es6-promise/then.js b/deps/npm/node_modules/es6-promise/lib/es6-promise/then.js deleted file mode 100644 index b2b79f0a14a4d8..00000000000000 --- a/deps/npm/node_modules/es6-promise/lib/es6-promise/then.js +++ /dev/null @@ -1,32 +0,0 @@ -import { - invokeCallback, - subscribe, - FULFILLED, - REJECTED, - noop, - makePromise, - PROMISE_ID -} from './-internal'; - -import { asap } from './asap'; - -export default function then(onFulfillment, onRejection) { - const parent = this; - - const child = new this.constructor(noop); - - if (child[PROMISE_ID] === undefined) { - makePromise(child); - } - - const { _state } = parent; - - if (_state) { - const callback = arguments[_state - 1]; - asap(() => invokeCallback(_state, child, callback, parent._result)); - } else { - subscribe(parent, child, onFulfillment, onRejection); - } - - return child; -} diff --git a/deps/npm/node_modules/es6-promise/lib/es6-promise/utils.js b/deps/npm/node_modules/es6-promise/lib/es6-promise/utils.js deleted file mode 100644 index 72545c5e97c7eb..00000000000000 --- a/deps/npm/node_modules/es6-promise/lib/es6-promise/utils.js +++ /dev/null @@ -1,21 +0,0 @@ -export function objectOrFunction(x) { - let type = typeof x; - return x !== null && (type === 'object' || type === 'function'); -} - -export function isFunction(x) { - return typeof x === 'function'; -} - -export function isMaybeThenable(x) { - return x !== null && typeof x === 'object'; -} - -let _isArray; -if (Array.isArray) { - _isArray = Array.isArray; -} else { - _isArray = x => Object.prototype.toString.call(x) === '[object Array]'; -} - -export const isArray = _isArray; diff --git a/deps/npm/node_modules/es6-promise/package.json b/deps/npm/node_modules/es6-promise/package.json deleted file mode 100644 index 9095197841815c..00000000000000 --- a/deps/npm/node_modules/es6-promise/package.json +++ /dev/null @@ -1,106 +0,0 @@ -{ - "_from": "es6-promise@^4.0.3", - "_id": "es6-promise@4.2.8", - "_inBundle": false, - "_integrity": "sha512-HJDGx5daxeIvxdBxvG2cb9g4tEvwIk3i8+nhX0yGrYmZUzbkdg8QbDevheDB8gd0//uPj4c1EQua8Q+MViT0/w==", - "_location": "/es6-promise", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "es6-promise@^4.0.3", - "name": "es6-promise", - "escapedName": "es6-promise", - "rawSpec": "^4.0.3", - "saveSpec": null, - "fetchSpec": "^4.0.3" - }, - "_requiredBy": [ - "/es6-promisify" - ], - "_resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-4.2.8.tgz", - "_shasum": "4eb21594c972bc40553d276e510539143db53e0a", - "_spec": "es6-promise@^4.0.3", - "_where": "/Users/isaacs/dev/npm/cli/node_modules/es6-promisify", - "author": { - "name": "Yehuda Katz, Tom Dale, Stefan Penner and contributors", - "url": "Conversion to ES6 API by Jake Archibald" - }, - "browser": { - "vertx": false - }, - "bugs": { - "url": "https://github.com/stefanpenner/es6-promise/issues" - }, - "bundleDependencies": false, - "dependencies": {}, - "deprecated": false, - "description": "A lightweight library that provides tools for organizing asynchronous code", - "devDependencies": { - "babel-plugin-transform-es2015-arrow-functions": "^6.22.0", - "babel-plugin-transform-es2015-block-scoping": "^6.24.1", - "babel-plugin-transform-es2015-classes": "^6.24.1", - "babel-plugin-transform-es2015-computed-properties": "^6.24.1", - "babel-plugin-transform-es2015-constants": "^6.1.4", - "babel-plugin-transform-es2015-destructuring": "^6.23.0", - "babel-plugin-transform-es2015-parameters": "^6.24.1", - "babel-plugin-transform-es2015-shorthand-properties": "^6.24.1", - "babel-plugin-transform-es2015-spread": "^6.22.0", - "babel-plugin-transform-es2015-template-literals": "^6.22.0", - "babel6-plugin-strip-class-callcheck": "^6.0.0", - "broccoli-babel-transpiler": "^6.0.0", - "broccoli-concat": "^3.1.0", - "broccoli-merge-trees": "^2.0.0", - "broccoli-rollup": "^2.0.0", - "broccoli-stew": "^1.5.0", - "broccoli-uglify-js": "^0.2.0", - "broccoli-watchify": "^1.0.1", - "ember-cli": "2.18.0-beta.2", - "ember-cli-dependency-checker": "^2.1.0", - "git-repo-version": "1.0.1", - "json3": "^3.3.2", - "mocha": "^4.0.1", - "promises-aplus-tests-phantom": "^2.1.0-revise" - }, - "directories": { - "lib": "lib" - }, - "files": [ - "dist", - "lib", - "es6-promise.d.ts", - "auto.js", - "!dist/test" - ], - "homepage": "https://github.com/stefanpenner/es6-promise", - "jsdelivr": "dist/es6-promise.auto.min.js", - "keywords": [ - "futures", - "polyfill", - "promise", - "promises" - ], - "license": "MIT", - "main": "dist/es6-promise.js", - "name": "es6-promise", - "namespace": "es6-promise", - "repository": { - "type": "git", - "url": "git://github.com/stefanpenner/es6-promise.git" - }, - "scripts": { - "build": "ember build --environment production", - "prepublishOnly": "ember build --environment production", - "start": "ember s", - "test": "ember test", - "test:browser": "ember test --launch PhantomJS", - "test:node": "ember test --launch Mocha", - "test:server": "ember test --server" - }, - "spm": { - "main": "dist/es6-promise.js" - }, - "typings": "es6-promise.d.ts", - "unpkg": "dist/es6-promise.auto.min.js", - "version": "4.2.8" -} diff --git a/deps/npm/node_modules/es6-promisify/README.md b/deps/npm/node_modules/es6-promisify/README.md deleted file mode 100644 index 4141cc840f257e..00000000000000 --- a/deps/npm/node_modules/es6-promisify/README.md +++ /dev/null @@ -1,89 +0,0 @@ -[![Travis CI](https://travis-ci.org/digitaldesignlabs/es6-promisify.svg)](https://travis-ci.org/digitaldesignlabs/es6-promisify) - -# es6-promisify - -Converts callback-based functions to Promise-based functions. - -## Install - -Install with [npm](https://npmjs.org/package/es6-promisify) - -```bash -npm install --save es6-promisify -``` - -## Example - -```js -"use strict"; - -// Declare variables -const promisify = require("es6-promisify"); -const fs = require("fs"); - -// Convert the stat function -const stat = promisify(fs.stat); - -// Now usable as a promise! -stat("example.txt").then(function (stats) { - console.log("Got stats", stats); -}).catch(function (err) { - console.error("Yikes!", err); -}); -``` - -## Promisify methods -```js -"use strict"; - -// Declare variables -const promisify = require("es6-promisify"); -const redis = require("redis").createClient(6379, "localhost"); - -// Create a promise-based version of send_command -const client = promisify(redis.send_command, redis); - -// Send commands to redis and get a promise back -client("ping").then(function (pong) { - console.log("Got", pong); -}).catch(function (err) { - console.error("Unexpected error", err); -}).then(function () { - redis.quit(); -}); -``` - -## Handle callback multiple arguments -```js -"use strict"; - -// Declare functions -function test(cb) { - return cb(undefined, 1, 2, 3); -} - -// Declare variables -const promisify = require("es6-promisify"); - -// Create promise-based version of test -const single = promisify(test); -const multi = promisify(test, {multiArgs: true}); - -// Discards additional arguments -single().then(function (result) { - console.log(result); // 1 -}); - -// Returns all arguments as an array -multi().then(function (result) { - console.log(result); // [1, 2, 3] -}); -``` - -### Tests -Test with nodeunit -```bash -$ npm test -``` - -Published under the [MIT License](http://opensource.org/licenses/MIT). diff --git a/deps/npm/node_modules/es6-promisify/dist/promise.js b/deps/npm/node_modules/es6-promisify/dist/promise.js deleted file mode 100644 index 2fe5c6103b2fa3..00000000000000 --- a/deps/npm/node_modules/es6-promisify/dist/promise.js +++ /dev/null @@ -1,73 +0,0 @@ -"use strict"; - -/* global self, window, module, global, require */ -module.exports = function () { - - "use strict"; - - var globalObject = void 0; - - function isFunction(x) { - return typeof x === "function"; - } - - // Seek the global object - if (global !== undefined) { - globalObject = global; - } else if (window !== undefined && window.document) { - globalObject = window; - } else { - globalObject = self; - } - - // Test for any native promise implementation, and if that - // implementation appears to conform to the specificaton. - // This code mostly nicked from the es6-promise module polyfill - // and then fooled with. - var hasPromiseSupport = function () { - - // No promise object at all, and it's a non-starter - if (!globalObject.hasOwnProperty("Promise")) { - return false; - } - - // There is a Promise object. Does it conform to the spec? - var P = globalObject.Promise; - - // Some of these methods are missing from - // Firefox/Chrome experimental implementations - if (!P.hasOwnProperty("resolve") || !P.hasOwnProperty("reject")) { - return false; - } - - if (!P.hasOwnProperty("all") || !P.hasOwnProperty("race")) { - return false; - } - - // Older version of the spec had a resolver object - // as the arg rather than a function - return function () { - - var resolve = void 0; - - var p = new globalObject.Promise(function (r) { - resolve = r; - }); - - if (p) { - return isFunction(resolve); - } - - return false; - }(); - }(); - - // Export the native Promise implementation if it - // looks like it matches the spec - if (hasPromiseSupport) { - return globalObject.Promise; - } - - // Otherwise, return the es6-promise polyfill by @jaffathecake. - return require("es6-promise").Promise; -}(); \ No newline at end of file diff --git a/deps/npm/node_modules/es6-promisify/dist/promisify.js b/deps/npm/node_modules/es6-promisify/dist/promisify.js deleted file mode 100644 index ce38041b07e24b..00000000000000 --- a/deps/npm/node_modules/es6-promisify/dist/promisify.js +++ /dev/null @@ -1,85 +0,0 @@ -"use strict"; - -/* global module, require */ -module.exports = function () { - - "use strict"; - - // Get a promise object. This may be native, or it may be polyfilled - - var ES6Promise = require("./promise.js"); - - /** - * thatLooksLikeAPromiseToMe() - * - * Duck-types a promise. - * - * @param {object} o - * @return {bool} True if this resembles a promise - */ - function thatLooksLikeAPromiseToMe(o) { - return o && typeof o.then === "function" && typeof o.catch === "function"; - } - - /** - * promisify() - * - * Transforms callback-based function -- func(arg1, arg2 .. argN, callback) -- into - * an ES6-compatible Promise. Promisify provides a default callback of the form (error, result) - * and rejects when `error` is truthy. You can also supply settings object as the second argument. - * - * @param {function} original - The function to promisify - * @param {object} settings - Settings object - * @param {object} settings.thisArg - A `this` context to use. If not set, assume `settings` _is_ `thisArg` - * @param {bool} settings.multiArgs - Should multiple arguments be returned as an array? - * @return {function} A promisified version of `original` - */ - return function promisify(original, settings) { - - return function () { - for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - - var returnMultipleArguments = settings && settings.multiArgs; - - var target = void 0; - if (settings && settings.thisArg) { - target = settings.thisArg; - } else if (settings) { - target = settings; - } - - // Return the promisified function - return new ES6Promise(function (resolve, reject) { - - // Append the callback bound to the context - args.push(function callback(err) { - - if (err) { - return reject(err); - } - - for (var _len2 = arguments.length, values = Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) { - values[_key2 - 1] = arguments[_key2]; - } - - if (false === !!returnMultipleArguments) { - return resolve(values[0]); - } - - resolve(values); - }); - - // Call the function - var response = original.apply(target, args); - - // If it looks like original already returns a promise, - // then just resolve with that promise. Hopefully, the callback function we added will just be ignored. - if (thatLooksLikeAPromiseToMe(response)) { - resolve(response); - } - }); - }; - }; -}(); \ No newline at end of file diff --git a/deps/npm/node_modules/es6-promisify/package.json b/deps/npm/node_modules/es6-promisify/package.json deleted file mode 100644 index c66b9667f641b5..00000000000000 --- a/deps/npm/node_modules/es6-promisify/package.json +++ /dev/null @@ -1,72 +0,0 @@ -{ - "_from": "es6-promisify@^5.0.0", - "_id": "es6-promisify@5.0.0", - "_inBundle": false, - "_integrity": "sha1-UQnWLz5W6pZ8S2NQWu8IKRyKUgM=", - "_location": "/es6-promisify", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "es6-promisify@^5.0.0", - "name": "es6-promisify", - "escapedName": "es6-promisify", - "rawSpec": "^5.0.0", - "saveSpec": null, - "fetchSpec": "^5.0.0" - }, - "_requiredBy": [ - "/agent-base" - ], - "_resolved": "https://registry.npmjs.org/es6-promisify/-/es6-promisify-5.0.0.tgz", - "_shasum": "5109d62f3e56ea967c4b63505aef08291c8a5203", - "_spec": "es6-promisify@^5.0.0", - "_where": "/Users/rebecca/code/npm/node_modules/agent-base", - "author": { - "name": "Mike Hall", - "email": "mikehall314@gmail.com" - }, - "bugs": { - "url": "http://github.com/digitaldesignlabs/es6-promisify/issues" - }, - "bundleDependencies": false, - "dependencies": { - "es6-promise": "^4.0.3" - }, - "deprecated": false, - "description": "Converts callback-based functions to ES6 Promises", - "devDependencies": { - "babel-preset-es2015": "^6.9.0", - "eslint": "^2.13.1", - "gulp": "^3.9.1", - "gulp-babel": "^6.1.2", - "nodeunit": "^0.10.0" - }, - "files": [ - "dist/promisify.js", - "dist/promise.js" - ], - "greenkeeper": { - "ignore": [ - "eslint" - ] - }, - "homepage": "https://github.com/digitaldesignlabs/es6-promisify#readme", - "keywords": [ - "promises", - "es6", - "promisify" - ], - "license": "MIT", - "main": "dist/promisify.js", - "name": "es6-promisify", - "repository": { - "type": "git", - "url": "git+https://github.com/digitaldesignlabs/es6-promisify.git" - }, - "scripts": { - "pretest": "./node_modules/eslint/bin/eslint.js ./lib/*.js ./tests/*.js", - "test": "gulp && nodeunit tests" - }, - "version": "5.0.0" -} diff --git a/deps/npm/node_modules/escape-string-regexp/index.js b/deps/npm/node_modules/escape-string-regexp/index.js deleted file mode 100644 index 7834bf9b24c481..00000000000000 --- a/deps/npm/node_modules/escape-string-regexp/index.js +++ /dev/null @@ -1,11 +0,0 @@ -'use strict'; - -var matchOperatorsRe = /[|\\{}()[\]^$+*?.]/g; - -module.exports = function (str) { - if (typeof str !== 'string') { - throw new TypeError('Expected a string'); - } - - return str.replace(matchOperatorsRe, '\\$&'); -}; diff --git a/deps/npm/node_modules/escape-string-regexp/license b/deps/npm/node_modules/escape-string-regexp/license deleted file mode 100644 index 654d0bfe943437..00000000000000 --- a/deps/npm/node_modules/escape-string-regexp/license +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -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/deps/npm/node_modules/escape-string-regexp/package.json b/deps/npm/node_modules/escape-string-regexp/package.json deleted file mode 100644 index 154bce30d98f5f..00000000000000 --- a/deps/npm/node_modules/escape-string-regexp/package.json +++ /dev/null @@ -1,84 +0,0 @@ -{ - "_from": "escape-string-regexp@^1.0.5", - "_id": "escape-string-regexp@1.0.5", - "_inBundle": false, - "_integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", - "_location": "/escape-string-regexp", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "escape-string-regexp@^1.0.5", - "name": "escape-string-regexp", - "escapedName": "escape-string-regexp", - "rawSpec": "^1.0.5", - "saveSpec": null, - "fetchSpec": "^1.0.5" - }, - "_requiredBy": [ - "/babel-code-frame/chalk", - "/chalk", - "/figures", - "/tap-mocha-reporter" - ], - "_resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "_shasum": "1b61c0562190a8dff6ae3bb2cf0200ca130b86d4", - "_spec": "escape-string-regexp@^1.0.5", - "_where": "/Users/rebecca/code/npm/node_modules/chalk", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "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" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/sindresorhus/escape-string-regexp#readme", - "keywords": [ - "escape", - "regex", - "regexp", - "re", - "regular", - "expression", - "string", - "str", - "special", - "characters" - ], - "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" -} diff --git a/deps/npm/node_modules/escape-string-regexp/readme.md b/deps/npm/node_modules/escape-string-regexp/readme.md deleted file mode 100644 index 87ac82d5ef8bc9..00000000000000 --- a/deps/npm/node_modules/escape-string-regexp/readme.md +++ /dev/null @@ -1,27 +0,0 @@ -# escape-string-regexp [![Build Status](https://travis-ci.org/sindresorhus/escape-string-regexp.svg?branch=master)](https://travis-ci.org/sindresorhus/escape-string-regexp) - -> Escape RegExp special characters - - -## Install - -``` -$ npm install --save escape-string-regexp -``` - - -## Usage - -```js -const escapeStringRegexp = require('escape-string-regexp'); - -const escapedString = escapeStringRegexp('how much $ for a unicorn?'); -//=> 'how much \$ for a unicorn\?' - -new RegExp(escapedString); -``` - - -## License - -MIT © [Sindre Sorhus](http://sindresorhus.com) diff --git a/deps/npm/node_modules/execa/index.js b/deps/npm/node_modules/execa/index.js deleted file mode 100644 index 74ba8ee2de8bcc..00000000000000 --- a/deps/npm/node_modules/execa/index.js +++ /dev/null @@ -1,309 +0,0 @@ -'use strict'; -const childProcess = require('child_process'); -const util = require('util'); -const crossSpawn = require('cross-spawn'); -const stripEof = require('strip-eof'); -const npmRunPath = require('npm-run-path'); -const isStream = require('is-stream'); -const _getStream = require('get-stream'); -const pFinally = require('p-finally'); -const onExit = require('signal-exit'); -const errname = require('./lib/errname'); -const stdio = require('./lib/stdio'); - -const TEN_MEGABYTES = 1000 * 1000 * 10; - -function handleArgs(cmd, args, opts) { - let parsed; - - if (opts && opts.env && opts.extendEnv !== false) { - opts.env = Object.assign({}, process.env, opts.env); - } - - if (opts && opts.__winShell === true) { - delete opts.__winShell; - parsed = { - command: cmd, - args, - options: opts, - file: cmd, - original: cmd - }; - } else { - parsed = crossSpawn._parse(cmd, args, opts); - } - - opts = Object.assign({ - maxBuffer: TEN_MEGABYTES, - stripEof: true, - preferLocal: true, - localDir: parsed.options.cwd || process.cwd(), - encoding: 'utf8', - reject: true, - cleanup: true - }, parsed.options); - - opts.stdio = stdio(opts); - - if (opts.preferLocal) { - opts.env = npmRunPath.env(Object.assign({}, opts, {cwd: opts.localDir})); - } - - return { - cmd: parsed.command, - args: parsed.args, - opts, - parsed - }; -} - -function handleInput(spawned, opts) { - const input = opts.input; - - if (input === null || input === undefined) { - return; - } - - if (isStream(input)) { - input.pipe(spawned.stdin); - } else { - spawned.stdin.end(input); - } -} - -function handleOutput(opts, val) { - if (val && opts.stripEof) { - val = stripEof(val); - } - - return val; -} - -function handleShell(fn, cmd, opts) { - let file = '/bin/sh'; - let args = ['-c', cmd]; - - opts = Object.assign({}, opts); - - if (process.platform === 'win32') { - opts.__winShell = true; - file = process.env.comspec || 'cmd.exe'; - args = ['/s', '/c', `"${cmd}"`]; - opts.windowsVerbatimArguments = true; - } - - if (opts.shell) { - file = opts.shell; - delete opts.shell; - } - - return fn(file, args, opts); -} - -function getStream(process, stream, encoding, maxBuffer) { - if (!process[stream]) { - return null; - } - - let ret; - - if (encoding) { - ret = _getStream(process[stream], { - encoding, - maxBuffer - }); - } else { - ret = _getStream.buffer(process[stream], {maxBuffer}); - } - - return ret.catch(err => { - err.stream = stream; - err.message = `${stream} ${err.message}`; - throw err; - }); -} - -module.exports = (cmd, args, opts) => { - let joinedCmd = cmd; - - if (Array.isArray(args) && args.length > 0) { - joinedCmd += ' ' + args.join(' '); - } - - const parsed = handleArgs(cmd, args, opts); - const encoding = parsed.opts.encoding; - const maxBuffer = parsed.opts.maxBuffer; - - let spawned; - try { - spawned = childProcess.spawn(parsed.cmd, parsed.args, parsed.opts); - } catch (err) { - return Promise.reject(err); - } - - let removeExitHandler; - if (parsed.opts.cleanup) { - removeExitHandler = onExit(() => { - spawned.kill(); - }); - } - - let timeoutId = null; - let timedOut = false; - - const cleanupTimeout = () => { - if (timeoutId) { - clearTimeout(timeoutId); - timeoutId = null; - } - }; - - if (parsed.opts.timeout > 0) { - timeoutId = setTimeout(() => { - timeoutId = null; - timedOut = true; - spawned.kill(parsed.opts.killSignal); - }, parsed.opts.timeout); - } - - const processDone = new Promise(resolve => { - spawned.on('exit', (code, signal) => { - cleanupTimeout(); - resolve({code, signal}); - }); - - spawned.on('error', err => { - cleanupTimeout(); - resolve({err}); - }); - - if (spawned.stdin) { - spawned.stdin.on('error', err => { - cleanupTimeout(); - resolve({err}); - }); - } - }); - - function destroy() { - if (spawned.stdout) { - spawned.stdout.destroy(); - } - - if (spawned.stderr) { - spawned.stderr.destroy(); - } - } - - const promise = pFinally(Promise.all([ - processDone, - getStream(spawned, 'stdout', encoding, maxBuffer), - getStream(spawned, 'stderr', encoding, maxBuffer) - ]).then(arr => { - const result = arr[0]; - const stdout = arr[1]; - const stderr = arr[2]; - - let err = result.err; - const code = result.code; - const signal = result.signal; - - if (removeExitHandler) { - removeExitHandler(); - } - - if (err || code !== 0 || signal !== null) { - if (!err) { - let output = ''; - - if (Array.isArray(parsed.opts.stdio)) { - if (parsed.opts.stdio[2] !== 'inherit') { - output += output.length > 0 ? stderr : `\n${stderr}`; - } - - if (parsed.opts.stdio[1] !== 'inherit') { - output += `\n${stdout}`; - } - } else if (parsed.opts.stdio !== 'inherit') { - output = `\n${stderr}${stdout}`; - } - - err = new Error(`Command failed: ${joinedCmd}${output}`); - err.code = code < 0 ? errname(code) : code; - } - - // TODO: missing some timeout logic for killed - // https://github.com/nodejs/node/blob/master/lib/child_process.js#L203 - // err.killed = spawned.killed || killed; - err.killed = err.killed || spawned.killed; - - err.stdout = stdout; - err.stderr = stderr; - err.failed = true; - err.signal = signal || null; - err.cmd = joinedCmd; - err.timedOut = timedOut; - - if (!parsed.opts.reject) { - return err; - } - - throw err; - } - - return { - stdout: handleOutput(parsed.opts, stdout), - stderr: handleOutput(parsed.opts, stderr), - code: 0, - failed: false, - killed: false, - signal: null, - cmd: joinedCmd, - timedOut: false - }; - }), destroy); - - crossSpawn._enoent.hookChildProcess(spawned, parsed.parsed); - - handleInput(spawned, parsed.opts); - - spawned.then = promise.then.bind(promise); - spawned.catch = promise.catch.bind(promise); - - return spawned; -}; - -module.exports.stdout = function () { - // TODO: set `stderr: 'ignore'` when that option is implemented - return module.exports.apply(null, arguments).then(x => x.stdout); -}; - -module.exports.stderr = function () { - // TODO: set `stdout: 'ignore'` when that option is implemented - return module.exports.apply(null, arguments).then(x => x.stderr); -}; - -module.exports.shell = (cmd, opts) => handleShell(module.exports, cmd, opts); - -module.exports.sync = (cmd, args, opts) => { - const parsed = handleArgs(cmd, args, opts); - - if (isStream(parsed.opts.input)) { - throw new TypeError('The `input` option cannot be a stream in sync mode'); - } - - const result = childProcess.spawnSync(parsed.cmd, parsed.args, parsed.opts); - - if (result.error || result.status !== 0) { - throw (result.error || new Error(result.stderr === '' ? result.stdout : result.stderr)); - } - - result.stdout = handleOutput(parsed.opts, result.stdout); - result.stderr = handleOutput(parsed.opts, result.stderr); - - return result; -}; - -module.exports.shellSync = (cmd, opts) => handleShell(module.exports.sync, cmd, opts); - -module.exports.spawn = util.deprecate(module.exports, 'execa.spawn() is deprecated. Use execa() instead.'); diff --git a/deps/npm/node_modules/execa/lib/errname.js b/deps/npm/node_modules/execa/lib/errname.js deleted file mode 100644 index 328f3e35da0dc0..00000000000000 --- a/deps/npm/node_modules/execa/lib/errname.js +++ /dev/null @@ -1,37 +0,0 @@ -'use strict'; -// The Node team wants to deprecate `process.bind(...)`. -// https://github.com/nodejs/node/pull/2768 -// -// However, we need the 'uv' binding for errname support. -// This is a defensive wrapper around it so `execa` will not fail entirely if it stops working someday. -// -// If this ever stops working. See: https://github.com/sindresorhus/execa/issues/31#issuecomment-215939939 for another possible solution. -let uv; - -try { - uv = process.binding('uv'); - - if (typeof uv.errname !== 'function') { - throw new TypeError('uv.errname is not a function'); - } -} catch (err) { - console.error('execa/lib/errname: unable to establish process.binding(\'uv\')', err); - uv = null; -} - -function errname(uv, code) { - if (uv) { - return uv.errname(code); - } - - if (!(code < 0)) { - throw new Error('err >= 0'); - } - - return `Unknown system error ${code}`; -} - -module.exports = code => errname(uv, code); - -// Used for testing the fallback behavior -module.exports.__test__ = errname; diff --git a/deps/npm/node_modules/execa/lib/stdio.js b/deps/npm/node_modules/execa/lib/stdio.js deleted file mode 100644 index a82d46838ac9b9..00000000000000 --- a/deps/npm/node_modules/execa/lib/stdio.js +++ /dev/null @@ -1,41 +0,0 @@ -'use strict'; -const alias = ['stdin', 'stdout', 'stderr']; - -const hasAlias = opts => alias.some(x => Boolean(opts[x])); - -module.exports = opts => { - if (!opts) { - return null; - } - - if (opts.stdio && hasAlias(opts)) { - throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${alias.map(x => `\`${x}\``).join(', ')}`); - } - - if (typeof opts.stdio === 'string') { - return opts.stdio; - } - - const stdio = opts.stdio || []; - - if (!Array.isArray(stdio)) { - throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof stdio}\``); - } - - const result = []; - const len = Math.max(stdio.length, alias.length); - - for (let i = 0; i < len; i++) { - let value = null; - - if (stdio[i] !== undefined) { - value = stdio[i]; - } else if (opts[alias[i]] !== undefined) { - value = opts[alias[i]]; - } - - result[i] = value; - } - - return result; -}; diff --git a/deps/npm/node_modules/execa/node_modules/get-stream/buffer-stream.js b/deps/npm/node_modules/execa/node_modules/get-stream/buffer-stream.js deleted file mode 100644 index ae45d3d9e74179..00000000000000 --- a/deps/npm/node_modules/execa/node_modules/get-stream/buffer-stream.js +++ /dev/null @@ -1,51 +0,0 @@ -'use strict'; -const PassThrough = require('stream').PassThrough; - -module.exports = opts => { - opts = Object.assign({}, opts); - - const array = opts.array; - let encoding = opts.encoding; - const buffer = encoding === 'buffer'; - let objectMode = false; - - if (array) { - objectMode = !(encoding || buffer); - } else { - encoding = encoding || 'utf8'; - } - - if (buffer) { - encoding = null; - } - - let len = 0; - const ret = []; - const stream = new PassThrough({objectMode}); - - if (encoding) { - stream.setEncoding(encoding); - } - - stream.on('data', chunk => { - ret.push(chunk); - - if (objectMode) { - len = ret.length; - } else { - len += chunk.length; - } - }); - - stream.getBufferedValue = () => { - if (array) { - return ret; - } - - return buffer ? Buffer.concat(ret, len) : ret.join(''); - }; - - stream.getBufferedLength = () => len; - - return stream; -}; diff --git a/deps/npm/node_modules/execa/node_modules/get-stream/index.js b/deps/npm/node_modules/execa/node_modules/get-stream/index.js deleted file mode 100644 index 2dc5ee96af2d95..00000000000000 --- a/deps/npm/node_modules/execa/node_modules/get-stream/index.js +++ /dev/null @@ -1,51 +0,0 @@ -'use strict'; -const bufferStream = require('./buffer-stream'); - -function getStream(inputStream, opts) { - if (!inputStream) { - return Promise.reject(new Error('Expected a stream')); - } - - opts = Object.assign({maxBuffer: Infinity}, opts); - - const maxBuffer = opts.maxBuffer; - let stream; - let clean; - - const p = new Promise((resolve, reject) => { - const error = err => { - if (err) { // null check - err.bufferedData = stream.getBufferedValue(); - } - - reject(err); - }; - - stream = bufferStream(opts); - inputStream.once('error', error); - inputStream.pipe(stream); - - stream.on('data', () => { - if (stream.getBufferedLength() > maxBuffer) { - reject(new Error('maxBuffer exceeded')); - } - }); - stream.once('error', error); - stream.on('end', resolve); - - clean = () => { - // some streams doesn't implement the `stream.Readable` interface correctly - if (inputStream.unpipe) { - inputStream.unpipe(stream); - } - }; - }); - - p.then(clean, clean); - - return p.then(() => stream.getBufferedValue()); -} - -module.exports = getStream; -module.exports.buffer = (stream, opts) => getStream(stream, Object.assign({}, opts, {encoding: 'buffer'})); -module.exports.array = (stream, opts) => getStream(stream, Object.assign({}, opts, {array: true})); diff --git a/deps/npm/node_modules/execa/node_modules/get-stream/license b/deps/npm/node_modules/execa/node_modules/get-stream/license deleted file mode 100644 index 654d0bfe943437..00000000000000 --- a/deps/npm/node_modules/execa/node_modules/get-stream/license +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -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/deps/npm/node_modules/execa/node_modules/get-stream/package.json b/deps/npm/node_modules/execa/node_modules/get-stream/package.json deleted file mode 100644 index 987588836554a7..00000000000000 --- a/deps/npm/node_modules/execa/node_modules/get-stream/package.json +++ /dev/null @@ -1,80 +0,0 @@ -{ - "_from": "get-stream@^3.0.0", - "_id": "get-stream@3.0.0", - "_inBundle": false, - "_integrity": "sha1-jpQ9E1jcN1VQVOy+LtsFqhdO3hQ=", - "_location": "/execa/get-stream", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "get-stream@^3.0.0", - "name": "get-stream", - "escapedName": "get-stream", - "rawSpec": "^3.0.0", - "saveSpec": null, - "fetchSpec": "^3.0.0" - }, - "_requiredBy": [ - "/execa" - ], - "_resolved": "http://registry.npmjs.org/get-stream/-/get-stream-3.0.0.tgz", - "_shasum": "8e943d1358dc37555054ecbe2edb05aa174ede14", - "_spec": "get-stream@^3.0.0", - "_where": "/Users/zkat/Documents/code/work/npm/node_modules/execa", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "bugs": { - "url": "https://github.com/sindresorhus/get-stream/issues" - }, - "bundleDependencies": false, - "deprecated": false, - "description": "Get a stream as a string, buffer, or array", - "devDependencies": { - "ava": "*", - "into-stream": "^3.0.0", - "xo": "*" - }, - "engines": { - "node": ">=4" - }, - "files": [ - "index.js", - "buffer-stream.js" - ], - "homepage": "https://github.com/sindresorhus/get-stream#readme", - "keywords": [ - "get", - "stream", - "promise", - "concat", - "string", - "str", - "text", - "buffer", - "read", - "data", - "consume", - "readable", - "readablestream", - "array", - "object", - "obj" - ], - "license": "MIT", - "name": "get-stream", - "repository": { - "type": "git", - "url": "git+https://github.com/sindresorhus/get-stream.git" - }, - "scripts": { - "test": "xo && ava" - }, - "version": "3.0.0", - "xo": { - "esnext": true - } -} diff --git a/deps/npm/node_modules/execa/node_modules/get-stream/readme.md b/deps/npm/node_modules/execa/node_modules/get-stream/readme.md deleted file mode 100644 index 73b188fb420f2a..00000000000000 --- a/deps/npm/node_modules/execa/node_modules/get-stream/readme.md +++ /dev/null @@ -1,117 +0,0 @@ -# get-stream [![Build Status](https://travis-ci.org/sindresorhus/get-stream.svg?branch=master)](https://travis-ci.org/sindresorhus/get-stream) - -> Get a stream as a string, buffer, or array - - -## Install - -``` -$ npm install --save get-stream -``` - - -## Usage - -```js -const fs = require('fs'); -const getStream = require('get-stream'); -const stream = fs.createReadStream('unicorn.txt'); - -getStream(stream).then(str => { - console.log(str); - /* - ,,))))))));, - __)))))))))))))), - \|/ -\(((((''''((((((((. - -*-==//////(('' . `)))))), - /|\ ))| o ;-. '((((( ,(, - ( `| / ) ;))))' ,_))^;(~ - | | | ,))((((_ _____------~~~-. %,;(;(>';'~ - o_); ; )))(((` ~---~ `:: \ %%~~)(v;(`('~ - ; ''''```` `: `:::|\,__,%% );`'; ~ - | _ ) / `:|`----' `-' - ______/\/~ | / / - /~;;.____/;;' / ___--,-( `;;;/ - / // _;______;'------~~~~~ /;;/\ / - // | | / ; \;;,\ - (<_ | ; /',/-----' _> - \_| ||_ //~;~~~~~~~~~ - `\_| (,~~ - \~\ - ~~ - */ -}); -``` - - -## API - -The methods returns a promise that resolves when the `end` event fires on the stream, indicating that there is no more data to be read. The stream is switched to flowing mode. - -### getStream(stream, [options]) - -Get the `stream` as a string. - -#### options - -##### encoding - -Type: `string`
    -Default: `utf8` - -[Encoding](https://nodejs.org/api/buffer.html#buffer_buffer) of the incoming stream. - -##### maxBuffer - -Type: `number`
    -Default: `Infinity` - -Maximum length of the returned string. If it exceeds this value before the stream ends, the promise will be rejected. - -### getStream.buffer(stream, [options]) - -Get the `stream` as a buffer. - -It honors the `maxBuffer` option as above, but it refers to byte length rather than string length. - -### getStream.array(stream, [options]) - -Get the `stream` as an array of values. - -It honors both the `maxBuffer` and `encoding` options. The behavior changes slightly based on the encoding chosen: - -- When `encoding` is unset, it assumes an [object mode stream](https://nodesource.com/blog/understanding-object-streams/) and collects values emitted from `stream` unmodified. In this case `maxBuffer` refers to the number of items in the array (not the sum of their sizes). - -- When `encoding` is set to `buffer`, it collects an array of buffers. `maxBuffer` refers to the summed byte lengths of every buffer in the array. - -- When `encoding` is set to anything else, it collects an array of strings. `maxBuffer` refers to the summed character lengths of every string in the array. - - -## Errors - -If the input stream emits an `error` event, the promise will be rejected with the error. The buffered data will be attached to the `bufferedData` property of the error. - -```js -getStream(streamThatErrorsAtTheEnd('unicorn')) - .catch(err => { - console.log(err.bufferedData); - //=> 'unicorn' - }); -``` - - -## FAQ - -### How is this different from [`concat-stream`](https://github.com/maxogden/concat-stream)? - -This module accepts a stream instead of being one and returns a promise instead of using a callback. The API is simpler and it only supports returning a string, buffer, or array. It doesn't have a fragile type inference. You explicitly choose what you want. And it doesn't depend on the huge `readable-stream` package. - - -## Related - -- [get-stdin](https://github.com/sindresorhus/get-stdin) - Get stdin as a string or buffer - - -## License - -MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/deps/npm/node_modules/execa/package.json b/deps/npm/node_modules/execa/package.json deleted file mode 100644 index 632267d116cbc4..00000000000000 --- a/deps/npm/node_modules/execa/package.json +++ /dev/null @@ -1,109 +0,0 @@ -{ - "_from": "execa@^0.7.0", - "_id": "execa@0.7.0", - "_inBundle": false, - "_integrity": "sha1-lEvs00zEHuMqY6n68nrVpl/Fl3c=", - "_location": "/execa", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "execa@^0.7.0", - "name": "execa", - "escapedName": "execa", - "rawSpec": "^0.7.0", - "saveSpec": null, - "fetchSpec": "^0.7.0" - }, - "_requiredBy": [ - "/os-locale", - "/term-size" - ], - "_resolved": "https://registry.npmjs.org/execa/-/execa-0.7.0.tgz", - "_shasum": "944becd34cc41ee32a63a9faf27ad5a65fc59777", - "_spec": "execa@^0.7.0", - "_where": "/Users/rebecca/code/npm/node_modules/term-size", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "bugs": { - "url": "https://github.com/sindresorhus/execa/issues" - }, - "bundleDependencies": false, - "dependencies": { - "cross-spawn": "^5.0.1", - "get-stream": "^3.0.0", - "is-stream": "^1.1.0", - "npm-run-path": "^2.0.0", - "p-finally": "^1.0.0", - "signal-exit": "^3.0.0", - "strip-eof": "^1.0.0" - }, - "deprecated": false, - "description": "A better `child_process`", - "devDependencies": { - "ava": "*", - "cat-names": "^1.0.2", - "coveralls": "^2.11.9", - "delay": "^2.0.0", - "is-running": "^2.0.0", - "nyc": "^11.0.2", - "tempfile": "^2.0.0", - "xo": "*" - }, - "engines": { - "node": ">=4" - }, - "files": [ - "index.js", - "lib" - ], - "homepage": "https://github.com/sindresorhus/execa#readme", - "keywords": [ - "exec", - "child", - "process", - "execute", - "fork", - "execfile", - "spawn", - "file", - "shell", - "bin", - "binary", - "binaries", - "npm", - "path", - "local" - ], - "license": "MIT", - "maintainers": [ - { - "name": "James Talmage", - "email": "james@talmage.io", - "url": "github.com/jamestalmage" - } - ], - "name": "execa", - "nyc": { - "reporter": [ - "text", - "lcov" - ], - "exclude": [ - "**/fixtures/**", - "**/test.js", - "**/test/**" - ] - }, - "repository": { - "type": "git", - "url": "git+https://github.com/sindresorhus/execa.git" - }, - "scripts": { - "test": "xo && nyc ava" - }, - "version": "0.7.0" -} diff --git a/deps/npm/node_modules/execa/readme.md b/deps/npm/node_modules/execa/readme.md deleted file mode 100644 index 18c808aa6902c0..00000000000000 --- a/deps/npm/node_modules/execa/readme.md +++ /dev/null @@ -1,279 +0,0 @@ -# execa [![Build Status: Linux](https://travis-ci.org/sindresorhus/execa.svg?branch=master)](https://travis-ci.org/sindresorhus/execa) [![Build status: Windows](https://ci.appveyor.com/api/projects/status/x5ajamxtjtt93cqv/branch/master?svg=true)](https://ci.appveyor.com/project/sindresorhus/execa/branch/master) [![Coverage Status](https://coveralls.io/repos/github/sindresorhus/execa/badge.svg?branch=master)](https://coveralls.io/github/sindresorhus/execa?branch=master) - -> A better [`child_process`](https://nodejs.org/api/child_process.html) - - -## Why - -- Promise interface. -- [Strips EOF](https://github.com/sindresorhus/strip-eof) from the output so you don't have to `stdout.trim()`. -- Supports [shebang](https://en.wikipedia.org/wiki/Shebang_(Unix)) binaries cross-platform. -- [Improved Windows support.](https://github.com/IndigoUnited/node-cross-spawn#why) -- Higher max buffer. 10 MB instead of 200 KB. -- [Executes locally installed binaries by name.](#preferlocal) -- [Cleans up spawned processes when the parent process dies.](#cleanup) - - -## Install - -``` -$ npm install --save execa -``` - - -## Usage - -```js -const execa = require('execa'); - -execa('echo', ['unicorns']).then(result => { - console.log(result.stdout); - //=> 'unicorns' -}); - -// pipe the child process stdout to the current stdout -execa('echo', ['unicorns']).stdout.pipe(process.stdout); - -execa.shell('echo unicorns').then(result => { - console.log(result.stdout); - //=> 'unicorns' -}); - -// example of catching an error -execa.shell('exit 3').catch(error => { - console.log(error); - /* - { - message: 'Command failed: /bin/sh -c exit 3' - killed: false, - code: 3, - signal: null, - cmd: '/bin/sh -c exit 3', - stdout: '', - stderr: '', - timedOut: false - } - */ -}); -``` - - -## API - -### execa(file, [arguments], [options]) - -Execute a file. - -Think of this as a mix of `child_process.execFile` and `child_process.spawn`. - -Returns a [`child_process` instance](https://nodejs.org/api/child_process.html#child_process_class_childprocess), which is enhanced to also be a `Promise` for a result `Object` with `stdout` and `stderr` properties. - -### execa.stdout(file, [arguments], [options]) - -Same as `execa()`, but returns only `stdout`. - -### execa.stderr(file, [arguments], [options]) - -Same as `execa()`, but returns only `stderr`. - -### execa.shell(command, [options]) - -Execute a command through the system shell. Prefer `execa()` whenever possible, as it's both faster and safer. - -Returns a [`child_process` instance](https://nodejs.org/api/child_process.html#child_process_class_childprocess). - -The `child_process` instance is enhanced to also be promise for a result object with `stdout` and `stderr` properties. - -### execa.sync(file, [arguments], [options]) - -Execute a file synchronously. - -Returns the same result object as [`child_process.spawnSync`](https://nodejs.org/api/child_process.html#child_process_child_process_spawnsync_command_args_options). - -This method throws an `Error` if the command fails. - -### execa.shellSync(file, [options]) - -Execute a command synchronously through the system shell. - -Returns the same result object as [`child_process.spawnSync`](https://nodejs.org/api/child_process.html#child_process_child_process_spawnsync_command_args_options). - -### options - -Type: `Object` - -#### cwd - -Type: `string`
    -Default: `process.cwd()` - -Current working directory of the child process. - -#### env - -Type: `Object`
    -Default: `process.env` - -Environment key-value pairs. Extends automatically from `process.env`. Set `extendEnv` to `false` if you don't want this. - -#### extendEnv - -Type: `boolean`
    -Default: `true` - -Set to `false` if you don't want to extend the environment variables when providing the `env` property. - -#### argv0 - -Type: `string` - -Explicitly set the value of `argv[0]` sent to the child process. This will be set to `command` or `file` if not specified. - -#### stdio - -Type: `Array` `string`
    -Default: `pipe` - -Child's [stdio](https://nodejs.org/api/child_process.html#child_process_options_stdio) configuration. - -#### detached - -Type: `boolean` - -Prepare child to run independently of its parent process. Specific behavior [depends on the platform](https://nodejs.org/api/child_process.html#child_process_options_detached). - -#### uid - -Type: `number` - -Sets the user identity of the process. - -#### gid - -Type: `number` - -Sets the group identity of the process. - -#### shell - -Type: `boolean` `string`
    -Default: `false` - -If `true`, runs `command` inside of a shell. Uses `/bin/sh` on UNIX and `cmd.exe` on Windows. A different shell can be specified as a string. The shell should understand the `-c` switch on UNIX or `/d /s /c` on Windows. - -#### stripEof - -Type: `boolean`
    -Default: `true` - -[Strip EOF](https://github.com/sindresorhus/strip-eof) (last newline) from the output. - -#### preferLocal - -Type: `boolean`
    -Default: `true` - -Prefer locally installed binaries when looking for a binary to execute.
    -If you `$ npm install foo`, you can then `execa('foo')`. - -#### localDir - -Type: `string`
    -Default: `process.cwd()` - -Preferred path to find locally installed binaries in (use with `preferLocal`). - -#### input - -Type: `string` `Buffer` `stream.Readable` - -Write some input to the `stdin` of your binary.
    -Streams are not allowed when using the synchronous methods. - -#### reject - -Type: `boolean`
    -Default: `true` - -Setting this to `false` resolves the promise with the error instead of rejecting it. - -#### cleanup - -Type: `boolean`
    -Default: `true` - -Keep track of the spawned process and `kill` it when the parent process exits. - -#### encoding - -Type: `string`
    -Default: `utf8` - -Specify the character encoding used to decode the `stdout` and `stderr` output. - -#### timeout - -Type: `number`
    -Default: `0` - -If timeout is greater than `0`, the parent will send the signal identified by the `killSignal` property (the default is `SIGTERM`) if the child runs longer than timeout milliseconds. - -#### maxBuffer - -Type: `number`
    -Default: `10000000` (10MB) - -Largest amount of data in bytes allowed on `stdout` or `stderr`. - -#### killSignal - -Type: `string` `number`
    -Default: `SIGTERM` - -Signal value to be used when the spawned process will be killed. - -#### stdin - -Type: `string` `number` `Stream` `undefined` `null`
    -Default: `pipe` - -Same options as [`stdio`](https://nodejs.org/dist/latest-v6.x/docs/api/child_process.html#child_process_options_stdio). - -#### stdout - -Type: `string` `number` `Stream` `undefined` `null`
    -Default: `pipe` - -Same options as [`stdio`](https://nodejs.org/dist/latest-v6.x/docs/api/child_process.html#child_process_options_stdio). - -#### stderr - -Type: `string` `number` `Stream` `undefined` `null`
    -Default: `pipe` - -Same options as [`stdio`](https://nodejs.org/dist/latest-v6.x/docs/api/child_process.html#child_process_options_stdio). - - -## Tips - -### Save and pipe output from a child process - -Let's say you want to show the output of a child process in real-time while also saving it to a variable. - -```js -const execa = require('execa'); -const getStream = require('get-stream'); - -const stream = execa('echo', ['foo']).stdout; - -stream.pipe(process.stdout); - -getStream(stream).then(value => { - console.log('child output:', value); -}); -``` - - -## License - -MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/deps/npm/node_modules/extend/package.json b/deps/npm/node_modules/extend/package.json index 5753534127fcc3..85279f78054e5c 100644 --- a/deps/npm/node_modules/extend/package.json +++ b/deps/npm/node_modules/extend/package.json @@ -1,78 +1,42 @@ { - "_from": "extend@3.0.2", - "_id": "extend@3.0.2", - "_inBundle": false, - "_integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==", - "_location": "/extend", - "_phantomChildren": {}, - "_requested": { - "type": "version", - "registry": true, - "raw": "extend@3.0.2", - "name": "extend", - "escapedName": "extend", - "rawSpec": "3.0.2", - "saveSpec": null, - "fetchSpec": "3.0.2" - }, - "_requiredBy": [ - "#USER", - "/", - "/cloudant-follow/request", - "/nano/request" - ], - "_resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", - "_shasum": "f8b1136b4071fbd8eb140aff858b1019ec2915fa", - "_spec": "extend@3.0.2", - "_where": "/Users/zkat/Documents/code/work/npm", - "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" + "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" } diff --git a/deps/npm/node_modules/extsprintf/package.json b/deps/npm/node_modules/extsprintf/package.json index c96db9bb20c3d9..b788895cd3f16d 100644 --- a/deps/npm/node_modules/extsprintf/package.json +++ b/deps/npm/node_modules/extsprintf/package.json @@ -1,44 +1,14 @@ { - "_from": "extsprintf@1.3.0", - "_id": "extsprintf@1.3.0", - "_inBundle": false, - "_integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=", - "_location": "/extsprintf", - "_phantomChildren": {}, - "_requested": { - "type": "version", - "registry": true, - "raw": "extsprintf@1.3.0", - "name": "extsprintf", - "escapedName": "extsprintf", - "rawSpec": "1.3.0", - "saveSpec": null, - "fetchSpec": "1.3.0" - }, - "_requiredBy": [ - "/jsprim", - "/verror" - ], - "_resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", - "_shasum": "96918440e3041a7a414f8c52e3c574eb3c3e1e05", - "_spec": "extsprintf@1.3.0", - "_where": "/Users/rebecca/code/npm/node_modules/jsprim", - "bugs": { - "url": "https://github.com/davepacheco/node-extsprintf/issues" - }, - "bundleDependencies": false, - "deprecated": false, - "description": "extended POSIX-style sprintf", - "engines": [ - "node >=0.6.0" - ], - "homepage": "https://github.com/davepacheco/node-extsprintf#readme", - "license": "MIT", - "main": "./lib/extsprintf.js", - "name": "extsprintf", - "repository": { - "type": "git", - "url": "git://github.com/davepacheco/node-extsprintf.git" - }, - "version": "1.3.0" + "name": "extsprintf", + "version": "1.3.0", + "description": "extended POSIX-style sprintf", + "main": "./lib/extsprintf.js", + "repository": { + "type": "git", + "url": "git://github.com/davepacheco/node-extsprintf.git" + }, + "engines": [ + "node >=0.6.0" + ], + "license": "MIT" } diff --git a/deps/npm/node_modules/fast-deep-equal/README.md b/deps/npm/node_modules/fast-deep-equal/README.md index ee83edd45428e2..d3f4ffcc316f96 100644 --- a/deps/npm/node_modules/fast-deep-equal/README.md +++ b/deps/npm/node_modules/fast-deep-equal/README.md @@ -1,8 +1,8 @@ # fast-deep-equal -The fastest deep equal +The fastest deep equal with ES6 Map, Set and Typed arrays support. [![Build Status](https://travis-ci.org/epoberezkin/fast-deep-equal.svg?branch=master)](https://travis-ci.org/epoberezkin/fast-deep-equal) -[![npm version](https://badge.fury.io/js/fast-deep-equal.svg)](http://badge.fury.io/js/fast-deep-equal) +[![npm](https://img.shields.io/npm/v/fast-deep-equal.svg)](https://www.npmjs.com/package/fast-deep-equal) [![Coverage Status](https://coveralls.io/repos/github/epoberezkin/fast-deep-equal/badge.svg?branch=master)](https://coveralls.io/github/epoberezkin/fast-deep-equal?branch=master) @@ -16,9 +16,14 @@ npm install fast-deep-equal ## Features - ES5 compatible -- works in node.js (0.10+) and browsers (IE9+) +- works in node.js (8+) and browsers (IE9+) - checks equality of Date and RegExp objects by value. +ES6 equal (`require('fast-deep-equal/es6')`) also supports: +- Maps +- Sets +- Typed arrays + ## Usage @@ -27,28 +32,64 @@ var equal = require('fast-deep-equal'); console.log(equal({foo: 'bar'}, {foo: 'bar'})); // true ``` +To support ES6 Maps, Sets and Typed arrays equality use: + +```javascript +var equal = require('fast-deep-equal/es6'); +console.log(equal(Int16Array([1, 2]), Int16Array([1, 2]))); // true +``` + +To use with React (avoiding the traversal of React elements' _owner +property that contains circular references and is not needed when +comparing the elements - borrowed from [react-fast-compare](https://github.com/FormidableLabs/react-fast-compare)): + +```javascript +var equal = require('fast-deep-equal/react'); +var equal = require('fast-deep-equal/es6/react'); +``` + ## Performance benchmark +Node.js v12.6.0: + ``` -fast-deep-equal x 82,915 ops/sec ±0.63% (89 runs sampled) -nano-equal x 50,506 ops/sec ±2.23% (86 runs sampled) -shallow-equal-fuzzy x 14,873 ops/sec ±3.19% (83 runs sampled) -underscore.isEqual x 16,055 ops/sec ±2.29% (85 runs sampled) -lodash.isEqual x 10,740 ops/sec ±1.04% (89 runs sampled) -deep-equal x 12,276 ops/sec ±2.44% (84 runs sampled) -deep-eql x 10,565 ops/sec ±0.89% (90 runs sampled) -assert.deepStrictEqual x 965 ops/sec ±2.99% (81 runs sampled) +fast-deep-equal x 261,950 ops/sec ±0.52% (89 runs sampled) +fast-deep-equal/es6 x 212,991 ops/sec ±0.34% (92 runs sampled) +fast-equals x 230,957 ops/sec ±0.83% (85 runs sampled) +nano-equal x 187,995 ops/sec ±0.53% (88 runs sampled) +shallow-equal-fuzzy x 138,302 ops/sec ±0.49% (90 runs sampled) +underscore.isEqual x 74,423 ops/sec ±0.38% (89 runs sampled) +lodash.isEqual x 36,637 ops/sec ±0.72% (90 runs sampled) +deep-equal x 2,310 ops/sec ±0.37% (90 runs sampled) +deep-eql x 35,312 ops/sec ±0.67% (91 runs sampled) +ramda.equals x 12,054 ops/sec ±0.40% (91 runs sampled) +util.isDeepStrictEqual x 46,440 ops/sec ±0.43% (90 runs sampled) +assert.deepStrictEqual x 456 ops/sec ±0.71% (88 runs sampled) + The fastest is fast-deep-equal ``` To run benchmark (requires node.js 6+): ```bash -npm install -node benchmark +npm run benchmark ``` +__Please note__: this benchmark runs against the available test cases. To choose the most performant library for your application, it is recommended to benchmark against your data and to NOT expect this benchmark to reflect the performance difference in your application. + + +## Enterprise support + +fast-deep-equal package is a part of [Tidelift enterprise subscription](https://tidelift.com/subscription/pkg/npm-fast-deep-equal?utm_source=npm-fast-deep-equal&utm_medium=referral&utm_campaign=enterprise&utm_term=repo) - it provides a centralised commercial support to open-source software users, in addition to the support provided by software maintainers. + + +## Security contact + +To report a security vulnerability, please use the +[Tidelift security contact](https://tidelift.com/security). +Tidelift will coordinate the fix and disclosure. Please do NOT report security vulnerability via GitHub issues. + ## License diff --git a/deps/npm/node_modules/fast-deep-equal/es6/index.d.ts b/deps/npm/node_modules/fast-deep-equal/es6/index.d.ts new file mode 100644 index 00000000000000..c7eb9c79694ccc --- /dev/null +++ b/deps/npm/node_modules/fast-deep-equal/es6/index.d.ts @@ -0,0 +1,2 @@ +declare const equal: (a: any, b: any) => boolean; +export = equal; diff --git a/deps/npm/node_modules/fast-deep-equal/es6/index.js b/deps/npm/node_modules/fast-deep-equal/es6/index.js new file mode 100644 index 00000000000000..d980be2575b7f0 --- /dev/null +++ b/deps/npm/node_modules/fast-deep-equal/es6/index.js @@ -0,0 +1,72 @@ +'use strict'; + +// do not edit .js files directly - edit src/index.jst + + + var envHasBigInt64Array = typeof BigInt64Array !== 'undefined'; + + +module.exports = function equal(a, b) { + if (a === b) return true; + + if (a && b && typeof a == 'object' && typeof b == 'object') { + if (a.constructor !== b.constructor) return false; + + var length, i, keys; + if (Array.isArray(a)) { + length = a.length; + if (length != b.length) return false; + for (i = length; i-- !== 0;) + if (!equal(a[i], b[i])) return false; + return true; + } + + + if ((a instanceof Map) && (b instanceof Map)) { + if (a.size !== b.size) return false; + for (i of a.entries()) + if (!b.has(i[0])) return false; + for (i of a.entries()) + if (!equal(i[1], b.get(i[0]))) return false; + return true; + } + + if ((a instanceof Set) && (b instanceof Set)) { + if (a.size !== b.size) return false; + for (i of a.entries()) + if (!b.has(i[0])) return false; + return true; + } + + if (ArrayBuffer.isView(a) && ArrayBuffer.isView(b)) { + length = a.length; + if (length != b.length) return false; + for (i = length; i-- !== 0;) + if (a[i] !== b[i]) return false; + return true; + } + + + if (a.constructor === RegExp) return a.source === b.source && a.flags === b.flags; + if (a.valueOf !== Object.prototype.valueOf) return a.valueOf() === b.valueOf(); + if (a.toString !== Object.prototype.toString) return a.toString() === b.toString(); + + keys = Object.keys(a); + length = keys.length; + if (length !== Object.keys(b).length) return false; + + for (i = length; i-- !== 0;) + if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false; + + for (i = length; i-- !== 0;) { + var key = keys[i]; + + if (!equal(a[key], b[key])) return false; + } + + return true; + } + + // true if both NaN, false otherwise + return a!==a && b!==b; +}; diff --git a/deps/npm/node_modules/fast-deep-equal/es6/react.d.ts b/deps/npm/node_modules/fast-deep-equal/es6/react.d.ts new file mode 100644 index 00000000000000..c7eb9c79694ccc --- /dev/null +++ b/deps/npm/node_modules/fast-deep-equal/es6/react.d.ts @@ -0,0 +1,2 @@ +declare const equal: (a: any, b: any) => boolean; +export = equal; diff --git a/deps/npm/node_modules/fast-deep-equal/es6/react.js b/deps/npm/node_modules/fast-deep-equal/es6/react.js new file mode 100644 index 00000000000000..98e2f9b71aa8bb --- /dev/null +++ b/deps/npm/node_modules/fast-deep-equal/es6/react.js @@ -0,0 +1,79 @@ +'use strict'; + +// do not edit .js files directly - edit src/index.jst + + + var envHasBigInt64Array = typeof BigInt64Array !== 'undefined'; + + +module.exports = function equal(a, b) { + if (a === b) return true; + + if (a && b && typeof a == 'object' && typeof b == 'object') { + if (a.constructor !== b.constructor) return false; + + var length, i, keys; + if (Array.isArray(a)) { + length = a.length; + if (length != b.length) return false; + for (i = length; i-- !== 0;) + if (!equal(a[i], b[i])) return false; + return true; + } + + + if ((a instanceof Map) && (b instanceof Map)) { + if (a.size !== b.size) return false; + for (i of a.entries()) + if (!b.has(i[0])) return false; + for (i of a.entries()) + if (!equal(i[1], b.get(i[0]))) return false; + return true; + } + + if ((a instanceof Set) && (b instanceof Set)) { + if (a.size !== b.size) return false; + for (i of a.entries()) + if (!b.has(i[0])) return false; + return true; + } + + if (ArrayBuffer.isView(a) && ArrayBuffer.isView(b)) { + length = a.length; + if (length != b.length) return false; + for (i = length; i-- !== 0;) + if (a[i] !== b[i]) return false; + return true; + } + + + if (a.constructor === RegExp) return a.source === b.source && a.flags === b.flags; + if (a.valueOf !== Object.prototype.valueOf) return a.valueOf() === b.valueOf(); + if (a.toString !== Object.prototype.toString) return a.toString() === b.toString(); + + keys = Object.keys(a); + length = keys.length; + if (length !== Object.keys(b).length) return false; + + for (i = length; i-- !== 0;) + if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false; + + for (i = length; i-- !== 0;) { + var key = keys[i]; + + if (key === '_owner' && a.$$typeof) { + // React-specific: avoid traversing React elements' _owner. + // _owner contains circular references + // and is not needed when comparing the actual elements (and not their owners) + continue; + } + + if (!equal(a[key], b[key])) return false; + } + + return true; + } + + // true if both NaN, false otherwise + return a!==a && b!==b; +}; diff --git a/deps/npm/node_modules/fast-deep-equal/index.js b/deps/npm/node_modules/fast-deep-equal/index.js index 7aaaba3f6c1678..30dd1ba78cb498 100644 --- a/deps/npm/node_modules/fast-deep-equal/index.js +++ b/deps/npm/node_modules/fast-deep-equal/index.js @@ -1,55 +1,46 @@ 'use strict'; -var isArray = Array.isArray; -var keyList = Object.keys; -var hasProp = Object.prototype.hasOwnProperty; +// do not edit .js files directly - edit src/index.jst + + module.exports = function equal(a, b) { if (a === b) return true; - var arrA = isArray(a) - , arrB = isArray(b) - , i - , length - , key; - - if (arrA && arrB) { - length = a.length; - if (length != b.length) return false; - for (i = 0; i < length; i++) - if (!equal(a[i], b[i])) return false; - return true; - } + if (a && b && typeof a == 'object' && typeof b == 'object') { + if (a.constructor !== b.constructor) return false; + + var length, i, keys; + if (Array.isArray(a)) { + length = a.length; + if (length != b.length) return false; + for (i = length; i-- !== 0;) + if (!equal(a[i], b[i])) return false; + return true; + } - if (arrA != arrB) return false; - var dateA = a instanceof Date - , dateB = b instanceof Date; - if (dateA != dateB) return false; - if (dateA && dateB) return a.getTime() == b.getTime(); - var regexpA = a instanceof RegExp - , regexpB = b instanceof RegExp; - if (regexpA != regexpB) return false; - if (regexpA && regexpB) return a.toString() == b.toString(); + if (a.constructor === RegExp) return a.source === b.source && a.flags === b.flags; + if (a.valueOf !== Object.prototype.valueOf) return a.valueOf() === b.valueOf(); + if (a.toString !== Object.prototype.toString) return a.toString() === b.toString(); - if (a instanceof Object && b instanceof Object) { - var keys = keyList(a); + keys = Object.keys(a); length = keys.length; + if (length !== Object.keys(b).length) return false; - if (length !== keyList(b).length) - return false; + for (i = length; i-- !== 0;) + if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false; - for (i = 0; i < length; i++) - if (!hasProp.call(b, keys[i])) return false; + for (i = length; i-- !== 0;) { + var key = keys[i]; - for (i = 0; i < length; i++) { - key = keys[i]; if (!equal(a[key], b[key])) return false; } return true; } - return false; + // true if both NaN, false otherwise + return a!==a && b!==b; }; diff --git a/deps/npm/node_modules/fast-deep-equal/package.json b/deps/npm/node_modules/fast-deep-equal/package.json index d084012d2d0090..3cfe66c68e832b 100644 --- a/deps/npm/node_modules/fast-deep-equal/package.json +++ b/deps/npm/node_modules/fast-deep-equal/package.json @@ -1,64 +1,45 @@ { - "_from": "fast-deep-equal@^1.0.0", - "_id": "fast-deep-equal@1.1.0", - "_inBundle": false, - "_integrity": "sha1-wFNHeBfIa1HaqFPIHgWbcz0CNhQ=", - "_location": "/fast-deep-equal", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "fast-deep-equal@^1.0.0", - "name": "fast-deep-equal", - "escapedName": "fast-deep-equal", - "rawSpec": "^1.0.0", - "saveSpec": null, - "fetchSpec": "^1.0.0" - }, - "_requiredBy": [ - "/ajv" - ], - "_resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-1.1.0.tgz", - "_shasum": "c053477817c86b51daa853c81e059b733d023614", - "_spec": "fast-deep-equal@^1.0.0", - "_where": "/Users/rebecca/code/npm/node_modules/ajv", - "author": { - "name": "Evgeny Poberezkin" - }, - "bugs": { - "url": "https://github.com/epoberezkin/fast-deep-equal/issues" - }, - "bundleDependencies": false, - "deprecated": false, + "name": "fast-deep-equal", + "version": "3.1.3", "description": "Fast deep equal", - "devDependencies": { - "benchmark": "^2.1.4", - "coveralls": "^2.13.1", - "deep-eql": "^2.0.2", - "deep-equal": "^1.0.1", - "eslint": "^4.0.0", - "lodash": "^4.17.4", - "mocha": "^3.4.2", - "nano-equal": "^1.0.1", - "nyc": "^11.0.2", - "pre-commit": "^1.2.2", - "shallow-equal-fuzzy": "0.0.2", - "typescript": "^2.6.1", - "underscore": "^1.8.3" + "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" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/epoberezkin/fast-deep-equal.git" }, - "files": [ - "index.js", - "index.d.ts" - ], - "homepage": "https://github.com/epoberezkin/fast-deep-equal#readme", "keywords": [ "fast", "equal", "deep-equal" ], + "author": "Evgeny Poberezkin", "license": "MIT", - "main": "index.js", - "name": "fast-deep-equal", + "bugs": { + "url": "https://github.com/epoberezkin/fast-deep-equal/issues" + }, + "homepage": "https://github.com/epoberezkin/fast-deep-equal#readme", + "devDependencies": { + "coveralls": "^3.1.0", + "dot": "^1.1.2", + "eslint": "^7.2.0", + "mocha": "^7.2.0", + "nyc": "^15.1.0", + "pre-commit": "^1.2.2", + "react": "^16.12.0", + "react-test-renderer": "^16.12.0", + "sinon": "^9.0.2", + "typescript": "^3.9.5" + }, "nyc": { "exclude": [ "**/spec/**", @@ -69,17 +50,12 @@ "text-summary" ] }, - "repository": { - "type": "git", - "url": "git+https://github.com/epoberezkin/fast-deep-equal.git" - }, - "scripts": { - "eslint": "eslint *.js benchmark spec", - "test": "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": "1.1.0" + "files": [ + "index.js", + "index.d.ts", + "react.js", + "react.d.ts", + "es6/" + ], + "types": "index.d.ts" } diff --git a/deps/npm/node_modules/fast-deep-equal/react.d.ts b/deps/npm/node_modules/fast-deep-equal/react.d.ts new file mode 100644 index 00000000000000..c7eb9c79694ccc --- /dev/null +++ b/deps/npm/node_modules/fast-deep-equal/react.d.ts @@ -0,0 +1,2 @@ +declare const equal: (a: any, b: any) => boolean; +export = equal; diff --git a/deps/npm/node_modules/fast-deep-equal/react.js b/deps/npm/node_modules/fast-deep-equal/react.js new file mode 100644 index 00000000000000..3489b9833f3808 --- /dev/null +++ b/deps/npm/node_modules/fast-deep-equal/react.js @@ -0,0 +1,53 @@ +'use strict'; + +// do not edit .js files directly - edit src/index.jst + + + +module.exports = function equal(a, b) { + if (a === b) return true; + + if (a && b && typeof a == 'object' && typeof b == 'object') { + if (a.constructor !== b.constructor) return false; + + var length, i, keys; + if (Array.isArray(a)) { + length = a.length; + if (length != b.length) return false; + for (i = length; i-- !== 0;) + if (!equal(a[i], b[i])) return false; + return true; + } + + + + if (a.constructor === RegExp) return a.source === b.source && a.flags === b.flags; + if (a.valueOf !== Object.prototype.valueOf) return a.valueOf() === b.valueOf(); + if (a.toString !== Object.prototype.toString) return a.toString() === b.toString(); + + keys = Object.keys(a); + length = keys.length; + if (length !== Object.keys(b).length) return false; + + for (i = length; i-- !== 0;) + if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false; + + for (i = length; i-- !== 0;) { + var key = keys[i]; + + if (key === '_owner' && a.$$typeof) { + // React-specific: avoid traversing React elements' _owner. + // _owner contains circular references + // and is not needed when comparing the actual elements (and not their owners) + continue; + } + + if (!equal(a[key], b[key])) return false; + } + + return true; + } + + // true if both NaN, false otherwise + return a!==a && b!==b; +}; diff --git a/deps/npm/node_modules/fast-json-stable-stringify/.github/FUNDING.yml b/deps/npm/node_modules/fast-json-stable-stringify/.github/FUNDING.yml new file mode 100644 index 00000000000000..61f9daa955b012 --- /dev/null +++ b/deps/npm/node_modules/fast-json-stable-stringify/.github/FUNDING.yml @@ -0,0 +1 @@ +tidelift: "npm/fast-json-stable-stringify" diff --git a/deps/npm/node_modules/fast-json-stable-stringify/.npmignore b/deps/npm/node_modules/fast-json-stable-stringify/.npmignore deleted file mode 100644 index 899d7360ba2001..00000000000000 --- a/deps/npm/node_modules/fast-json-stable-stringify/.npmignore +++ /dev/null @@ -1,4 +0,0 @@ -node_modules -.nyc_output/ -coverage/ -.DS_Store diff --git a/deps/npm/node_modules/fast-json-stable-stringify/.travis.yml b/deps/npm/node_modules/fast-json-stable-stringify/.travis.yml index 7ddce74b841994..b61e8f0dc9dccd 100644 --- a/deps/npm/node_modules/fast-json-stable-stringify/.travis.yml +++ b/deps/npm/node_modules/fast-json-stable-stringify/.travis.yml @@ -1,8 +1,8 @@ language: node_js node_js: - - "4" - - "6" - - "7" - "8" + - "10" + - "12" + - "13" after_script: - coveralls < coverage/lcov.info diff --git a/deps/npm/node_modules/fast-json-stable-stringify/LICENSE b/deps/npm/node_modules/fast-json-stable-stringify/LICENSE index ee27ba4b4412b0..c932223b1e2c2f 100644 --- a/deps/npm/node_modules/fast-json-stable-stringify/LICENSE +++ b/deps/npm/node_modules/fast-json-stable-stringify/LICENSE @@ -1,5 +1,8 @@ This software is released under the MIT license: +Copyright (c) 2017 Evgeny Poberezkin +Copyright (c) 2013 James Halliday + 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 diff --git a/deps/npm/node_modules/fast-json-stable-stringify/README.md b/deps/npm/node_modules/fast-json-stable-stringify/README.md index 0f43b4a7e034e4..02cf49ff385b8b 100644 --- a/deps/npm/node_modules/fast-json-stable-stringify/README.md +++ b/deps/npm/node_modules/fast-json-stable-stringify/README.md @@ -114,6 +114,18 @@ The fastest is fast-stable-stringify ``` +## Enterprise support + +fast-json-stable-stringify package is a part of [Tidelift enterprise subscription](https://tidelift.com/subscription/pkg/npm-fast-json-stable-stringify?utm_source=npm-fast-json-stable-stringify&utm_medium=referral&utm_campaign=enterprise&utm_term=repo) - it provides a centralised commercial support to open-source software users, in addition to the support provided by software maintainers. + + +## Security contact + +To report a security vulnerability, please use the +[Tidelift security contact](https://tidelift.com/security). +Tidelift will coordinate the fix and disclosure. Please do NOT report security vulnerability via GitHub issues. + + # license [MIT](https://github.com/epoberezkin/fast-json-stable-stringify/blob/master/LICENSE) diff --git a/deps/npm/node_modules/fast-json-stable-stringify/index.d.ts b/deps/npm/node_modules/fast-json-stable-stringify/index.d.ts new file mode 100644 index 00000000000000..23e46cafc140a3 --- /dev/null +++ b/deps/npm/node_modules/fast-json-stable-stringify/index.d.ts @@ -0,0 +1,4 @@ +declare module 'fast-json-stable-stringify' { + function stringify(obj: any): string; + export = stringify; +} diff --git a/deps/npm/node_modules/fast-json-stable-stringify/package.json b/deps/npm/node_modules/fast-json-stable-stringify/package.json index 965546480e965b..ad2c8bff7c94e2 100644 --- a/deps/npm/node_modules/fast-json-stable-stringify/package.json +++ b/deps/npm/node_modules/fast-json-stable-stringify/package.json @@ -1,48 +1,29 @@ { - "_from": "fast-json-stable-stringify@^2.0.0", - "_id": "fast-json-stable-stringify@2.0.0", - "_inBundle": false, - "_integrity": "sha1-1RQsDK7msRifh9OnYREGT4bIu/I=", - "_location": "/fast-json-stable-stringify", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "fast-json-stable-stringify@^2.0.0", - "name": "fast-json-stable-stringify", - "escapedName": "fast-json-stable-stringify", - "rawSpec": "^2.0.0", - "saveSpec": null, - "fetchSpec": "^2.0.0" - }, - "_requiredBy": [ - "/ajv" - ], - "_resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz", - "_shasum": "d5142c0caee6b1189f87d3a76111064f86c8bbf2", - "_spec": "fast-json-stable-stringify@^2.0.0", - "_where": "/Users/rebecca/code/npm/node_modules/ajv", - "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, - "deprecated": false, + "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", + "dependencies": {}, "devDependencies": { "benchmark": "^2.1.4", "coveralls": "^3.0.0", - "eslint": "^4.9.0", + "eslint": "^6.7.0", "fast-stable-stringify": "latest", "faster-stable-stringify": "latest", "json-stable-stringify": "latest", - "nyc": "^11.2.1", + "nyc": "^14.1.0", "pre-commit": "^1.2.2", - "tape": "~1.0.4" + "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": [ @@ -52,9 +33,12 @@ "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", @@ -64,15 +48,5 @@ "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" - }, - "version": "2.0.0" + } } diff --git a/deps/npm/node_modules/figgy-pudding/CHANGELOG.md b/deps/npm/node_modules/figgy-pudding/CHANGELOG.md deleted file mode 100644 index 038f9c06506644..00000000000000 --- a/deps/npm/node_modules/figgy-pudding/CHANGELOG.md +++ /dev/null @@ -1,151 +0,0 @@ -# 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.5.1](https://github.com/zkat/figgy-pudding/compare/v3.5.0...v3.5.1) (2018-08-25) - - - - -# [3.5.0](https://github.com/zkat/figgy-pudding/compare/v3.4.1...v3.5.0) (2018-08-25) - - -### Bug Fixes - -* **node:** get rid of Object.entries to add node6 support back ([074f779](https://github.com/zkat/figgy-pudding/commit/074f779)) - - -### Features - -* **node:** add node@10 to CI config ([78b8937](https://github.com/zkat/figgy-pudding/commit/78b8937)) - - - - -## [3.4.1](https://github.com/zkat/figgy-pudding/compare/v3.4.0...v3.4.1) (2018-08-16) - - -### Bug Fixes - -* **forEach:** get forEach to behave like a normal forEach ([c064755](https://github.com/zkat/figgy-pudding/commit/c064755)) -* **has:** get `in` keyword working right ([fafc5a8](https://github.com/zkat/figgy-pudding/commit/fafc5a8)) -* **iteration:** fix and test iteration of opts.other keys ([7a76217](https://github.com/zkat/figgy-pudding/commit/7a76217)) -* **iteration:** use proper args for forEach/toJSON ([974e879](https://github.com/zkat/figgy-pudding/commit/974e879)) -* **proxy:** make sure proxy corner-cases work ok ([8c66e45](https://github.com/zkat/figgy-pudding/commit/8c66e45)) -* **set:** fix and test the exceptions to writing ([206793b](https://github.com/zkat/figgy-pudding/commit/206793b)) - - - - -# [3.4.0](https://github.com/zkat/figgy-pudding/compare/v3.3.0...v3.4.0) (2018-08-16) - - -### Features - -* **iterator:** allow iteration over "other" keys ([3c53323](https://github.com/zkat/figgy-pudding/commit/3c53323)) - - - - -# [3.3.0](https://github.com/zkat/figgy-pudding/compare/v3.2.1...v3.3.0) (2018-08-16) - - -### Bug Fixes - -* **props:** allow symbols to pass through ([97b3464](https://github.com/zkat/figgy-pudding/commit/97b3464)) - - -### Features - -* **pudding:** iteration and serialization support ([0aaa50d](https://github.com/zkat/figgy-pudding/commit/0aaa50d)) - - - - -## [3.2.1](https://github.com/zkat/figgy-pudding/compare/v3.2.0...v3.2.1) (2018-08-15) - - -### Bug Fixes - -* **aliases:** make reverse aliases work correctly ([76a255e](https://github.com/zkat/figgy-pudding/commit/76a255e)) - - - - -# [3.2.0](https://github.com/zkat/figgy-pudding/compare/v3.1.0...v3.2.0) (2018-07-26) - - -### Bug Fixes - -* **concat:** have concat spit out a proxy, too ([64e3495](https://github.com/zkat/figgy-pudding/commit/64e3495)) - - -### Features - -* **default:** pass the pudding itself to default fns ([d9d9e09](https://github.com/zkat/figgy-pudding/commit/d9d9e09)) - - - - -# [3.1.0](https://github.com/zkat/figgy-pudding/compare/v3.0.0...v3.1.0) (2018-04-08) - - -### Features - -* **opts:** allow direct option fetching without .get() ([ca77aad](https://github.com/zkat/figgy-pudding/commit/ca77aad)) - - - - -# [3.0.0](https://github.com/zkat/figgy-pudding/compare/v2.0.1...v3.0.0) (2018-04-06) - - -### Bug Fixes - -* **ci:** oops -- forgot to update CI config ([7a40563](https://github.com/zkat/figgy-pudding/commit/7a40563)) -* **get:** make provider lookup order like Object.assign ([33ff89b](https://github.com/zkat/figgy-pudding/commit/33ff89b)) - - -### Features - -* **concat:** add .concat() method to opts ([d310fce](https://github.com/zkat/figgy-pudding/commit/d310fce)) - - -### meta - -* drop support for node@4 and node@7 ([9f8a61c](https://github.com/zkat/figgy-pudding/commit/9f8a61c)) - - -### BREAKING CHANGES - -* node@4 and node@7 are no longer supported -* **get:** shadow order for properties in providers is reversed - - - - -## [2.0.1](https://github.com/zkat/figgy-pudding/compare/v2.0.0...v2.0.1) (2018-03-16) - - -### Bug Fixes - -* **opts:** ignore non-object providers ([7b9c0f8](https://github.com/zkat/figgy-pudding/commit/7b9c0f8)) - - - - -# [2.0.0](https://github.com/zkat/figgy-pudding/compare/v1.0.0...v2.0.0) (2018-03-16) - - -### Features - -* **api:** overhauled API with new opt handling concept ([e6cc929](https://github.com/zkat/figgy-pudding/commit/e6cc929)) -* **license:** relicense to ISC ([87479aa](https://github.com/zkat/figgy-pudding/commit/87479aa)) - - -### BREAKING CHANGES - -* **license:** the license has been changed from CC0-1.0 to ISC. -* **api:** this is a completely different approach than previously -used by this library. See the readme for the new API and an explanation. diff --git a/deps/npm/node_modules/figgy-pudding/LICENSE.md b/deps/npm/node_modules/figgy-pudding/LICENSE.md deleted file mode 100644 index 8d28acf866d932..00000000000000 --- a/deps/npm/node_modules/figgy-pudding/LICENSE.md +++ /dev/null @@ -1,16 +0,0 @@ -ISC License - -Copyright (c) npm, Inc. - -Permission to use, copy, modify, and/or distribute this software for -any purpose with or without fee is hereby granted, provided that the -above copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE COPYRIGHT HOLDER DISCLAIMS -ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE -COPYRIGHT HOLDER BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR -CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS -OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE -OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE -USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/deps/npm/node_modules/figgy-pudding/README.md b/deps/npm/node_modules/figgy-pudding/README.md deleted file mode 100644 index 3d0591c1e622e2..00000000000000 --- a/deps/npm/node_modules/figgy-pudding/README.md +++ /dev/null @@ -1,260 +0,0 @@ -# figgy-pudding [![npm version](https://img.shields.io/npm/v/figgy-pudding.svg)](https://npm.im/figgy-pudding) [![license](https://img.shields.io/npm/l/figgy-pudding.svg)](https://npm.im/figgy-pudding) [![Travis](https://img.shields.io/travis/zkat/figgy-pudding.svg)](https://travis-ci.org/zkat/figgy-pudding) [![AppVeyor](https://ci.appveyor.com/api/projects/status/github/zkat/figgy-pudding?svg=true)](https://ci.appveyor.com/project/zkat/figgy-pudding) [![Coverage Status](https://coveralls.io/repos/github/zkat/figgy-pudding/badge.svg?branch=latest)](https://coveralls.io/github/zkat/figgy-pudding?branch=latest) - -[`figgy-pudding`](https://github.com/zkat/figgy-pudding) is a small JavaScript -library for managing and composing cascading options objects -- hiding what -needs to be hidden from each layer, without having to do a lot of manual munging -and passing of options. - -### The God Object is Dead! -### Now Bring Us Some Figgy Pudding! - -## Install - -`$ npm install figgy-pudding` - -## Table of Contents - -* [Example](#example) -* [Features](#features) -* [API](#api) - * [`figgyPudding(spec)`](#figgy-pudding) - * [`PuddingFactory(values)`](#pudding-factory) - * [`opts.get()`](#opts-get) - * [`opts.concat()`](#opts-concat) - * [`opts.toJSON()`](#opts-to-json) - * [`opts.forEach()`](#opts-for-each) - * [`opts[Symbol.iterator]()`](#opts-symbol-iterator) - * [`opts.entries()`](#opts-entries) - * [`opts.keys()`](#opts-keys) - * [`opts.value()`](#opts-values) - -### Example - -```javascript -// print-package.js -const fetch = require('./fetch.js') -const puddin = require('figgy-pudding') - -const PrintOpts = puddin({ - json: { default: false } -}) - -async function printPkg (name, opts) { - // Expected pattern is to call this in every interface function. If `opts` is - // not passed in, it will automatically create an (empty) object for it. - opts = PrintOpts(opts) - const uri = `https://registry.npmjs.com/${name}` - const res = await fetch(uri, opts.concat({ - // Add or override any passed-in configs and pass them down. - log: customLogger - })) - // The following would throw an error, because it's not in PrintOpts: - // console.log(opts.log) - if (opts.json) { - return res.json() - } else { - return res.text() - } -} - -console.log(await printPkg('figgy', { - // Pass in *all* configs at the toplevel, as a regular object. - json: true, - cache: './tmp-cache' -})) -``` - -```javascript -// fetch.js -const puddin = require('figgy-pudding') - -const FetchOpts = puddin({ - log: { default: require('npmlog') }, - cache: {} -}) - -module.exports = async function (..., opts) { - opts = FetchOpts(opts) -} -``` - -### Features - -* hide options from layer that didn't ask for it -* shared multi-layer options -* make sure `opts` argument is available -* transparent key access like normal keys, through a Proxy. No need for`.get()`! -* default values -* key aliases -* arbitrary key filter functions -* key/value iteration -* serialization -* 100% test coverage using `tap --100` - -### API - -#### `> figgyPudding({ key: { default: val } | String }, [opts]) -> PuddingFactory` - -Defines an Options constructor that can be used to collect only the needed -options. - -An optional `default` property for specs can be used to specify default values -if nothing was passed in. - -If the value for a spec is a string, it will be treated as an alias to that -other key. - -##### Example - -```javascript -const MyAppOpts = figgyPudding({ - lg: 'log', - log: { - default: () => require('npmlog') - }, - cache: {} -}) -``` - -#### `> PuddingFactory(...providers) -> FiggyPudding{}` - -Instantiates an options object defined by `figgyPudding()`, which uses -`providers`, in order, to find requested properties. - -Each provider can be either a plain object, a `Map`-like object (that is, one -with a `.get()` method) or another figgyPudding `Opts` object. - -When nesting `Opts` objects, their properties will not become available to the -new object, but any further nested `Opts` that reference that property _will_ be -able to read from their grandparent, as long as they define that key. Default -values for nested `Opts` parents will be used, if found. - -##### Example - -```javascript -const ReqOpts = figgyPudding({ - follow: {} -}) - -const opts = ReqOpts({ - follow: true, - log: require('npmlog') -}) - -opts.follow // => true -opts.log // => Error: ReqOpts does not define `log` - -const MoreOpts = figgyPudding({ - log: {} -}) -MoreOpts(opts).log // => npmlog object (passed in from original plain obj) -MoreOpts(opts).follow // => Error: MoreOpts does not define `follow` -``` - -#### `> opts.get(key) -> Value` - -Gets a value from the options object. - -##### Example - -```js -const opts = MyOpts(config) -opts.get('foo') // value of `foo` -opts.foo // Proxy-based access through `.get()` -``` - -#### `> opts.concat(...moreProviders) -> FiggyPudding{}` - -Creates a new opts object of the same type as `opts` with additional providers. -Providers further to the right shadow providers to the left, with properties in -the original `opts` being shadows by the new providers. - -##### Example - -```js -const opts = MyOpts({x: 1}) -opts.get('x') // 1 -opts.concat({x: 2}).get('x') // 2 -opts.get('x') // 1 (original opts object left intact) -``` - -#### `> opts.toJSON() -> Value` - -Converts `opts` to a plain, JSON-stringifiable JavaScript value. Used internally -by JavaScript to get `JSON.stringify()` working. - -Only keys that are readable by the current pudding type will be serialized. - -##### Example - -```js -const opts = MyOpts({x: 1}) -opts.toJSON() // {x: 1} -JSON.stringify(opts) // '{"x":1}' -``` - -#### `> opts.forEach((value, key, opts) => {}, thisArg) -> undefined` - -Iterates over the values of `opts`, limited to the keys readable by the current -pudding type. `thisArg` will be used to set the `this` argument when calling the -`fn`. - -##### Example - -```js -const opts = MyOpts({x: 1, y: 2}) -opts.forEach((value, key) => console.log(key, '=', value)) -``` - -#### `> opts.entries() -> Iterator<[[key, value], ...]>` - -Returns an iterator that iterates over the keys and values in `opts`, limited to -the keys readable by the current pudding type. Each iteration returns an array -of `[key, value]`. - -##### Example - -```js -const opts = MyOpts({x: 1, y: 2}) -[...opts({x: 1, y: 2}).entries()] // [['x', 1], ['y', 2]] -``` - -#### `> opts[Symbol.iterator]() -> Iterator<[[key, value], ...]>` - -Returns an iterator that iterates over the keys and values in `opts`, limited to -the keys readable by the current pudding type. Each iteration returns an array -of `[key, value]`. Makes puddings work natively with JS iteration mechanisms. - -##### Example - -```js -const opts = MyOpts({x: 1, y: 2}) -[...opts({x: 1, y: 2})] // [['x', 1], ['y', 2]] -for (let [key, value] of opts({x: 1, y: 2})) { - console.log(key, '=', value) -} -``` - -#### `> opts.keys() -> Iterator<[key, ...]>` - -Returns an iterator that iterates over the keys in `opts`, limited to the keys -readable by the current pudding type. - -##### Example - -```js -const opts = MyOpts({x: 1, y: 2}) -[...opts({x: 1, y: 2}).keys()] // ['x', 'y'] -``` - -#### `> opts.values() -> Iterator<[value, ...]>` - -Returns an iterator that iterates over the values in `opts`, limited to the keys -readable by the current pudding type. - -##### Example -' -```js -const opts = MyOpts({x: 1, y: 2}) -[...opts({x: 1, y: 2}).values()] // [1, 2] -``` diff --git a/deps/npm/node_modules/figgy-pudding/index.js b/deps/npm/node_modules/figgy-pudding/index.js deleted file mode 100644 index bb7d5711bc18da..00000000000000 --- a/deps/npm/node_modules/figgy-pudding/index.js +++ /dev/null @@ -1,197 +0,0 @@ -'use strict' - -class FiggyPudding { - constructor (specs, opts, providers) { - this.__specs = specs || {} - Object.keys(this.__specs).forEach(alias => { - if (typeof this.__specs[alias] === 'string') { - const key = this.__specs[alias] - const realSpec = this.__specs[key] - if (realSpec) { - const aliasArr = realSpec.aliases || [] - aliasArr.push(alias, key) - realSpec.aliases = [...(new Set(aliasArr))] - this.__specs[alias] = realSpec - } else { - throw new Error(`Alias refers to invalid key: ${key} -> ${alias}`) - } - } - }) - this.__opts = opts || {} - this.__providers = reverse((providers).filter( - x => x != null && typeof x === 'object' - )) - this.__isFiggyPudding = true - } - get (key) { - return pudGet(this, key, true) - } - get [Symbol.toStringTag] () { return 'FiggyPudding' } - forEach (fn, thisArg = this) { - for (let [key, value] of this.entries()) { - fn.call(thisArg, value, key, this) - } - } - toJSON () { - const obj = {} - this.forEach((val, key) => { - obj[key] = val - }) - return obj - } - * entries (_matcher) { - for (let key of Object.keys(this.__specs)) { - yield [key, this.get(key)] - } - const matcher = _matcher || this.__opts.other - if (matcher) { - const seen = new Set() - for (let p of this.__providers) { - const iter = p.entries ? p.entries(matcher) : entries(p) - for (let [key, val] of iter) { - if (matcher(key) && !seen.has(key)) { - seen.add(key) - yield [key, val] - } - } - } - } - } - * [Symbol.iterator] () { - for (let [key, value] of this.entries()) { - yield [key, value] - } - } - * keys () { - for (let [key] of this.entries()) { - yield key - } - } - * values () { - for (let [, value] of this.entries()) { - yield value - } - } - concat (...moreConfig) { - return new Proxy(new FiggyPudding( - this.__specs, - this.__opts, - reverse(this.__providers).concat(moreConfig) - ), proxyHandler) - } -} -try { - const util = require('util') - FiggyPudding.prototype[util.inspect.custom] = function (depth, opts) { - return ( - this[Symbol.toStringTag] + ' ' - ) + util.inspect(this.toJSON(), opts) - } -} catch (e) {} - -function BadKeyError (key) { - throw Object.assign(new Error( - `invalid config key requested: ${key}` - ), {code: 'EBADKEY'}) -} - -function pudGet (pud, key, validate) { - let spec = pud.__specs[key] - if (validate && !spec && (!pud.__opts.other || !pud.__opts.other(key))) { - BadKeyError(key) - } else { - if (!spec) { spec = {} } - let ret - for (let p of pud.__providers) { - ret = tryGet(key, p) - if (ret === undefined && spec.aliases && spec.aliases.length) { - for (let alias of spec.aliases) { - if (alias === key) { continue } - ret = tryGet(alias, p) - if (ret !== undefined) { - break - } - } - } - if (ret !== undefined) { - break - } - } - if (ret === undefined && spec.default !== undefined) { - if (typeof spec.default === 'function') { - return spec.default(pud) - } else { - return spec.default - } - } else { - return ret - } - } -} - -function tryGet (key, p) { - let ret - if (p.__isFiggyPudding) { - ret = pudGet(p, key, false) - } else if (typeof p.get === 'function') { - ret = p.get(key) - } else { - ret = p[key] - } - return ret -} - -const proxyHandler = { - has (obj, prop) { - return prop in obj.__specs && pudGet(obj, prop, false) !== undefined - }, - ownKeys (obj) { - return Object.keys(obj.__specs) - }, - get (obj, prop) { - if ( - typeof prop === 'symbol' || - prop.slice(0, 2) === '__' || - prop in FiggyPudding.prototype - ) { - return obj[prop] - } - return obj.get(prop) - }, - set (obj, prop, value) { - if ( - typeof prop === 'symbol' || - prop.slice(0, 2) === '__' - ) { - obj[prop] = value - return true - } else { - throw new Error('figgyPudding options cannot be modified. Use .concat() instead.') - } - }, - deleteProperty () { - throw new Error('figgyPudding options cannot be deleted. Use .concat() and shadow them instead.') - } -} - -module.exports = figgyPudding -function figgyPudding (specs, opts) { - function factory (...providers) { - return new Proxy(new FiggyPudding( - specs, - opts, - providers - ), proxyHandler) - } - return factory -} - -function reverse (arr) { - const ret = [] - arr.forEach(x => ret.unshift(x)) - return ret -} - -function entries (obj) { - return Object.keys(obj).map(k => [k, obj[k]]) -} diff --git a/deps/npm/node_modules/figgy-pudding/package.json b/deps/npm/node_modules/figgy-pudding/package.json deleted file mode 100644 index 4f268f6ff01eaf..00000000000000 --- a/deps/npm/node_modules/figgy-pudding/package.json +++ /dev/null @@ -1,77 +0,0 @@ -{ - "_from": "figgy-pudding@latest", - "_id": "figgy-pudding@3.5.1", - "_inBundle": false, - "_integrity": "sha512-vNKxJHTEKNThjfrdJwHc7brvM6eVevuO5nTj6ez8ZQ1qbXTvGthucRF7S4vf2cr71QVnT70V34v0S1DyQsti0w==", - "_location": "/figgy-pudding", - "_phantomChildren": {}, - "_requested": { - "type": "tag", - "registry": true, - "raw": "figgy-pudding@latest", - "name": "figgy-pudding", - "escapedName": "figgy-pudding", - "rawSpec": "latest", - "saveSpec": null, - "fetchSpec": "latest" - }, - "_requiredBy": [ - "#USER", - "/", - "/cacache", - "/libnpmhook", - "/libnpmorg", - "/libnpmteam", - "/npm-registry-fetch", - "/pacote" - ], - "_resolved": "https://registry.npmjs.org/figgy-pudding/-/figgy-pudding-3.5.1.tgz", - "_shasum": "862470112901c727a0e495a80744bd5baa1d6790", - "_spec": "figgy-pudding@latest", - "_where": "/Users/zkat/Documents/code/work/npm", - "author": { - "name": "Kat Marchán", - "email": "kzm@sykosomatic.org" - }, - "bugs": { - "url": "https://github.com/zkat/figgy-pudding/issues" - }, - "bundleDependencies": false, - "dependencies": {}, - "deprecated": false, - "description": "Delicious, festive, cascading config/opts definitions", - "devDependencies": { - "standard": "^11.0.1", - "standard-version": "^4.4.0", - "tap": "^12.0.1", - "weallbehave": "^1.2.0", - "weallcontribute": "^1.0.8" - }, - "files": [ - "*.js", - "lib" - ], - "homepage": "https://github.com/zkat/figgy-pudding#readme", - "keywords": [ - "config", - "options", - "yummy" - ], - "license": "ISC", - "main": "index.js", - "name": "figgy-pudding", - "repository": { - "type": "git", - "url": "git+https://github.com/zkat/figgy-pudding.git" - }, - "scripts": { - "postrelease": "npm publish && git push --follow-tags", - "prerelease": "npm t", - "pretest": "standard", - "release": "standard-version -s", - "test": "tap -J --100 --coverage test/*.js", - "update-coc": "weallbehave -o . && git add CODE_OF_CONDUCT.md && git commit -m 'docs(coc): updated CODE_OF_CONDUCT.md'", - "update-contrib": "weallcontribute -o . && git add CONTRIBUTING.md && git commit -m 'docs(contributing): updated CONTRIBUTING.md'" - }, - "version": "3.5.1" -} diff --git a/deps/npm/node_modules/find-npm-prefix/README.md b/deps/npm/node_modules/find-npm-prefix/README.md deleted file mode 100644 index 26d3337065df8f..00000000000000 --- a/deps/npm/node_modules/find-npm-prefix/README.md +++ /dev/null @@ -1,28 +0,0 @@ -# find-npm-prefix - -Find the npm project directory associated with for a given directory - -## USAGE - -``` -const findPrefix = require('find-npm-prefix') - -findPrefix(process.cwd).then(prefix => { - … -}) -``` - -## findPrefix(dir) → Promise(prefix) - -This computes the npm prefix, that is, the directory that npm adds and -removes modules from for a given path. - -It takes a directory as an argument and returns a promise of the associated -prefix directory. - -## Algorithm - -1. If the directory is a `node_modules` folder, scan up the tree till you find a non-`node_modules` directory and return that. -2. Else, look for the first parent directory that contains a `node_modules` or a `package.json` - 1. If one is found, that's the prefix. - 2. If none are found, return the original directory we were given diff --git a/deps/npm/node_modules/find-npm-prefix/find-prefix.js b/deps/npm/node_modules/find-npm-prefix/find-prefix.js deleted file mode 100644 index d5e271322be226..00000000000000 --- a/deps/npm/node_modules/find-npm-prefix/find-prefix.js +++ /dev/null @@ -1,56 +0,0 @@ -'use strict' -// try to find the most reasonable prefix to use - -module.exports = findPrefix - -const fs = require('fs') -const path = require('path') - -function findPrefix (dir) { - return new Promise((resolve, reject) => { - dir = path.resolve(dir) - - // this is a weird special case where an infinite recurse of - // node_modules folders resolves to the level that contains the - // very first node_modules folder - let walkedUp = false - while (path.basename(dir) === 'node_modules') { - dir = path.dirname(dir) - walkedUp = true - } - if (walkedUp) { - resolve(dir) - } else { - resolve(findPrefix_(dir)) - } - }) -} - -function findPrefix_ (dir, original) { - if (!original) original = dir - - const parent = path.dirname(dir) - // this is a platform independent way of checking if we're in the root - // directory - if (parent === dir) return Promise.resolve(original) - - return new Promise((resolve, reject) => { - fs.readdir(dir, (err, files) => { - if (err) { - // an error right away is a bad sign. - // unless the prefix was simply a non - // existent directory. - if (err && dir === original && err.code !== 'ENOENT') { - reject(err) - } else { - resolve(original) - } - } else if (files.indexOf('node_modules') !== -1 || - files.indexOf('package.json') !== -1) { - resolve(dir) - } else { - resolve(findPrefix_(parent, original)) - } - }) - }) -} diff --git a/deps/npm/node_modules/find-npm-prefix/package.json b/deps/npm/node_modules/find-npm-prefix/package.json deleted file mode 100644 index e9344afe54d206..00000000000000 --- a/deps/npm/node_modules/find-npm-prefix/package.json +++ /dev/null @@ -1,62 +0,0 @@ -{ - "_args": [ - [ - "find-npm-prefix@1.0.2", - "/Users/rebecca/code/npm" - ] - ], - "_from": "find-npm-prefix@1.0.2", - "_id": "find-npm-prefix@1.0.2", - "_inBundle": false, - "_integrity": "sha512-KEftzJ+H90x6pcKtdXZEPsQse8/y/UnvzRKrOSQFprnrGaFuJ62fVkP34Iu2IYuMvyauCyoLTNkJZgrrGA2wkA==", - "_location": "/find-npm-prefix", - "_phantomChildren": {}, - "_requested": { - "type": "version", - "registry": true, - "raw": "find-npm-prefix@1.0.2", - "name": "find-npm-prefix", - "escapedName": "find-npm-prefix", - "rawSpec": "1.0.2", - "saveSpec": null, - "fetchSpec": "1.0.2" - }, - "_requiredBy": [ - "/", - "/libcipm" - ], - "_resolved": "https://registry.npmjs.org/find-npm-prefix/-/find-npm-prefix-1.0.2.tgz", - "_spec": "1.0.2", - "_where": "/Users/rebecca/code/npm", - "author": { - "name": "Rebecca Turner", - "email": "me@re-becca.org", - "url": "http://re-becca.org/" - }, - "bugs": { - "url": "https://github.com/npm/find-npm-prefix/issues" - }, - "dependencies": {}, - "description": "Find the npm project directory associated with for a given directory", - "devDependencies": { - "require-inject": "^1.4.2", - "standard": "^10.0.3", - "tap": "^10.7.3" - }, - "directories": { - "test": "test" - }, - "homepage": "https://github.com/npm/find-npm-prefix#readme", - "keywords": [], - "license": "ISC", - "main": "find-prefix.js", - "name": "find-npm-prefix", - "repository": { - "type": "git", - "url": "git+https://github.com/npm/find-npm-prefix.git" - }, - "scripts": { - "test": "standard && tap --100 test" - }, - "version": "1.0.2" -} diff --git a/deps/npm/node_modules/find-npm-prefix/test/find-prefix.js b/deps/npm/node_modules/find-npm-prefix/test/find-prefix.js deleted file mode 100644 index de2ab41cb9df12..00000000000000 --- a/deps/npm/node_modules/find-npm-prefix/test/find-prefix.js +++ /dev/null @@ -1,79 +0,0 @@ -'use strict' -const Bluebird = require('bluebird') -const test = require('tap').test -const requireInject = require('require-inject') -const findPrefix = requireInject('../find-prefix.js', { - fs: { - readdir: mockReaddir - } -}) - -test('find-prefix', t => { - const tests = { - '/Users/example/code/test1/node_modules': '/Users/example/code/test1', - '/Users/example/code/test1/node_modules/node_modules': '/Users/example/code/test1', - '/Users/example/code/test1/sub1': '/Users/example/code/test1', - '/Users/example/code/test1/sub1/sub1a': '/Users/example/code/test1', - '/Users/example/code/test2': '/Users/example/code/test2', - '/Users/example/code/test2/sub2': '/Users/example/code/test2', - '/Users/example/code': '/Users/example/code', - '/Users/example': '/Users/example', - '/does/not/exist': '/does/not/exist' - } - t.plan(Object.keys(tests).length) - return Bluebird.map(Object.keys(tests), dir => { - return findPrefix(dir).then(pre => { - t.is(pre, tests[dir], dir) - }) - }) -}) - -test('fail-prefix', t => { - return findPrefix('/Users/example/eperm').then(pre => { - t.fail('no eperm') - }).catch(err => { - t.is(err.code, 'EPERM', 'got perm error') - }) -}) - -const fixture = { - 'Users': { - 'example': { - 'code': { - 'test1': { - 'node_modules': { - 'node_modules': {} - }, - 'sub1': { - 'sub1a': {} - } - }, - 'test2': { - 'package.json': {}, - 'sub2': {} - } - } - } - } -} - -function mockReaddir (dir, cb) { - if (/eperm/.test(dir)) { - const err = new Error('Can not read: ' + dir) - err.code = 'EPERM' - return cb(err) - } - const parts = dir.split(/\//).slice(1) - let cwd = fixture - let part - while ((part = parts.shift())) { - if (part in cwd) { - cwd = cwd[part] - } else { - const err = new Error('Does not exist: ' + dir + ' * ' + part) - err.code = 'ENOENT' - return cb(err) - } - } - return cb(null, Object.keys(cwd)) -} diff --git a/deps/npm/node_modules/flush-write-stream/.travis.yml b/deps/npm/node_modules/flush-write-stream/.travis.yml deleted file mode 100644 index c0428217037e47..00000000000000 --- a/deps/npm/node_modules/flush-write-stream/.travis.yml +++ /dev/null @@ -1,6 +0,0 @@ -language: node_js -node_js: - - '0.10' - - '0.12' - - '4.0' - - '5.0' diff --git a/deps/npm/node_modules/flush-write-stream/LICENSE b/deps/npm/node_modules/flush-write-stream/LICENSE deleted file mode 100644 index 66a4d2a149a666..00000000000000 --- a/deps/npm/node_modules/flush-write-stream/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2015 Mathias Buus - -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/flush-write-stream/README.md b/deps/npm/node_modules/flush-write-stream/README.md deleted file mode 100644 index 7ea7b699b84f04..00000000000000 --- a/deps/npm/node_modules/flush-write-stream/README.md +++ /dev/null @@ -1,59 +0,0 @@ -# flush-write-stream - -A write stream constructor that supports a flush function that is called before `finish` is emitted - -``` -npm install flush-write-stream -``` - -[![build status](http://img.shields.io/travis/mafintosh/flush-write-stream.svg?style=flat)](http://travis-ci.org/mafintosh/flush-write-stream) - -## Usage - -``` js -var writer = require('flush-write-stream') - -var ws = writer(write, flush) - -ws.on('finish', function () { - console.log('finished') -}) - -ws.write('hello') -ws.write('world') -ws.end() - -function write (data, enc, cb) { - // i am your normal ._write method - console.log('writing', data.toString()) - cb() -} - -function flush (cb) { - // i am called before finish is emitted - setTimeout(cb, 1000) // wait 1 sec -} -``` - -If you run the above it will produce the following output - -``` -writing hello -writing world -(nothing happens for 1 sec) -finished -``` - -## API - -#### `var ws = writer([options], write, [flush])` - -Create a new writable stream. Options are forwarded to the stream constructor. - -#### `var ws = writer.obj([options], write, [flush])` - -Same as the above except `objectMode` is set to `true` per default. - -## License - -MIT diff --git a/deps/npm/node_modules/flush-write-stream/example.js b/deps/npm/node_modules/flush-write-stream/example.js deleted file mode 100644 index fa6b5dab25578c..00000000000000 --- a/deps/npm/node_modules/flush-write-stream/example.js +++ /dev/null @@ -1,22 +0,0 @@ -var writer = require('./') - -var ws = writer(write, flush) - -ws.on('finish', function () { - console.log('finished') -}) - -ws.write('hello') -ws.write('world') -ws.end() - -function write (data, enc, cb) { - // i am your normal ._write method - console.log('writing', data.toString()) - cb() -} - -function flush (cb) { - // i am called before finish is emitted - setTimeout(cb, 1000) // wait 1 sec -} diff --git a/deps/npm/node_modules/flush-write-stream/index.js b/deps/npm/node_modules/flush-write-stream/index.js deleted file mode 100644 index d7c62095626432..00000000000000 --- a/deps/npm/node_modules/flush-write-stream/index.js +++ /dev/null @@ -1,54 +0,0 @@ -var stream = require('readable-stream') -var inherits = require('inherits') - -var SIGNAL_FLUSH =(Buffer.from && Buffer.from !== Uint8Array.from) - ? Buffer.from([0]) - : new Buffer([0]) - -module.exports = WriteStream - -function WriteStream (opts, write, flush) { - if (!(this instanceof WriteStream)) return new WriteStream(opts, write, flush) - - if (typeof opts === 'function') { - flush = write - write = opts - opts = {} - } - - stream.Writable.call(this, opts) - - this.destroyed = false - this._worker = write || null - this._flush = flush || null -} - -inherits(WriteStream, stream.Writable) - -WriteStream.obj = function (opts, worker, flush) { - if (typeof opts === 'function') return WriteStream.obj(null, opts, worker) - if (!opts) opts = {} - opts.objectMode = true - return new WriteStream(opts, worker, flush) -} - -WriteStream.prototype._write = function (data, enc, cb) { - if (SIGNAL_FLUSH === data) this._flush(cb) - else this._worker(data, enc, cb) -} - -WriteStream.prototype.end = function (data, enc, cb) { - if (!this._flush) return stream.Writable.prototype.end.apply(this, arguments) - if (typeof data === 'function') return this.end(null, null, data) - if (typeof enc === 'function') return this.end(data, null, enc) - if (data) this.write(data) - if (!this._writableState.ending) this.write(SIGNAL_FLUSH) - return stream.Writable.prototype.end.call(this, cb) -} - -WriteStream.prototype.destroy = function (err) { - if (this.destroyed) return - this.destroyed = true - if (err) this.emit('error', err) - this.emit('close') -} diff --git a/deps/npm/node_modules/flush-write-stream/node_modules/readable-stream/.travis.yml b/deps/npm/node_modules/flush-write-stream/node_modules/readable-stream/.travis.yml deleted file mode 100644 index 40992555bf5cc0..00000000000000 --- a/deps/npm/node_modules/flush-write-stream/node_modules/readable-stream/.travis.yml +++ /dev/null @@ -1,55 +0,0 @@ -sudo: false -language: node_js -before_install: - - npm install -g npm@2 - - test $NPM_LEGACY && npm install -g npm@latest-3 || npm install npm -g -notifications: - email: false -matrix: - fast_finish: true - include: - - node_js: '0.8' - env: - - TASK=test - - NPM_LEGACY=true - - node_js: '0.10' - env: - - TASK=test - - NPM_LEGACY=true - - node_js: '0.11' - env: - - TASK=test - - NPM_LEGACY=true - - node_js: '0.12' - env: - - TASK=test - - NPM_LEGACY=true - - node_js: 1 - env: - - TASK=test - - NPM_LEGACY=true - - node_js: 2 - env: - - TASK=test - - NPM_LEGACY=true - - node_js: 3 - env: - - TASK=test - - NPM_LEGACY=true - - node_js: 4 - env: TASK=test - - node_js: 5 - env: TASK=test - - node_js: 6 - env: TASK=test - - node_js: 7 - env: TASK=test - - node_js: 8 - env: TASK=test - - node_js: 9 - env: TASK=test -script: "npm run $TASK" -env: - global: - - secure: rE2Vvo7vnjabYNULNyLFxOyt98BoJexDqsiOnfiD6kLYYsiQGfr/sbZkPMOFm9qfQG7pjqx+zZWZjGSswhTt+626C0t/njXqug7Yps4c3dFblzGfreQHp7wNX5TFsvrxd6dAowVasMp61sJcRnB2w8cUzoe3RAYUDHyiHktwqMc= - - secure: g9YINaKAdMatsJ28G9jCGbSaguXCyxSTy+pBO6Ch0Cf57ZLOTka3HqDj8p3nV28LUIHZ3ut5WO43CeYKwt4AUtLpBS3a0dndHdY6D83uY6b2qh5hXlrcbeQTq2cvw2y95F7hm4D1kwrgZ7ViqaKggRcEupAL69YbJnxeUDKWEdI= diff --git a/deps/npm/node_modules/flush-write-stream/node_modules/readable-stream/GOVERNANCE.md b/deps/npm/node_modules/flush-write-stream/node_modules/readable-stream/GOVERNANCE.md deleted file mode 100644 index 16ffb93f24bece..00000000000000 --- a/deps/npm/node_modules/flush-write-stream/node_modules/readable-stream/GOVERNANCE.md +++ /dev/null @@ -1,136 +0,0 @@ -### Streams Working Group - -The Node.js Streams is jointly governed by a Working Group -(WG) -that is responsible for high-level guidance of the project. - -The WG has final authority over this project including: - -* Technical direction -* Project governance and process (including this policy) -* Contribution policy -* GitHub repository hosting -* Conduct guidelines -* Maintaining the list of additional Collaborators - -For the current list of WG members, see the project -[README.md](./README.md#current-project-team-members). - -### Collaborators - -The readable-stream GitHub repository is -maintained by the WG and additional Collaborators who are added by the -WG on an ongoing basis. - -Individuals making significant and valuable contributions are made -Collaborators and given commit-access to the project. These -individuals are identified by the WG and their addition as -Collaborators is discussed during the WG meeting. - -_Note:_ If you make a significant contribution and are not considered -for commit-access log an issue or contact a WG member directly and it -will be brought up in the next WG meeting. - -Modifications of the contents of the readable-stream repository are -made on -a collaborative basis. Anybody with a GitHub account may propose a -modification via pull request and it will be considered by the project -Collaborators. All pull requests must be reviewed and accepted by a -Collaborator with sufficient expertise who is able to take full -responsibility for the change. In the case of pull requests proposed -by an existing Collaborator, an additional Collaborator is required -for sign-off. Consensus should be sought if additional Collaborators -participate and there is disagreement around a particular -modification. See _Consensus Seeking Process_ below for further detail -on the consensus model used for governance. - -Collaborators may opt to elevate significant or controversial -modifications, or modifications that have not found consensus to the -WG for discussion by assigning the ***WG-agenda*** tag to a pull -request or issue. The WG should serve as the final arbiter where -required. - -For the current list of Collaborators, see the project -[README.md](./README.md#members). - -### WG Membership - -WG seats are not time-limited. There is no fixed size of the WG. -However, the expected target is between 6 and 12, to ensure adequate -coverage of important areas of expertise, balanced with the ability to -make decisions efficiently. - -There is no specific set of requirements or qualifications for WG -membership beyond these rules. - -The WG may add additional members to the WG by unanimous consensus. - -A WG member may be removed from the WG by voluntary resignation, or by -unanimous consensus of all other WG members. - -Changes to WG membership should be posted in the agenda, and may be -suggested as any other agenda item (see "WG Meetings" below). - -If an addition or removal is proposed during a meeting, and the full -WG is not in attendance to participate, then the addition or removal -is added to the agenda for the subsequent meeting. This is to ensure -that all members are given the opportunity to participate in all -membership decisions. If a WG member is unable to attend a meeting -where a planned membership decision is being made, then their consent -is assumed. - -No more than 1/3 of the WG members may be affiliated with the same -employer. If removal or resignation of a WG member, or a change of -employment by a WG member, creates a situation where more than 1/3 of -the WG membership shares an employer, then the situation must be -immediately remedied by the resignation or removal of one or more WG -members affiliated with the over-represented employer(s). - -### WG Meetings - -The WG meets occasionally on a Google Hangout On Air. A designated moderator -approved by the WG runs the meeting. Each meeting should be -published to YouTube. - -Items are added to the WG agenda that are considered contentious or -are modifications of governance, contribution policy, WG membership, -or release process. - -The intention of the agenda is not to approve or review all patches; -that should happen continuously on GitHub and be handled by the larger -group of Collaborators. - -Any community member or contributor can ask that something be added to -the next meeting's agenda by logging a GitHub Issue. Any Collaborator, -WG member or the moderator can add the item to the agenda by adding -the ***WG-agenda*** tag to the issue. - -Prior to each WG meeting the moderator will share the Agenda with -members of the WG. WG members can add any items they like to the -agenda at the beginning of each meeting. The moderator and the WG -cannot veto or remove items. - -The WG may invite persons or representatives from certain projects to -participate in a non-voting capacity. - -The moderator is responsible for summarizing the discussion of each -agenda item and sends it as a pull request after the meeting. - -### Consensus Seeking Process - -The WG follows a -[Consensus -Seeking](http://en.wikipedia.org/wiki/Consensus-seeking_decision-making) -decision-making model. - -When an agenda item has appeared to reach a consensus the moderator -will ask "Does anyone object?" as a final call for dissent from the -consensus. - -If an agenda item cannot reach a consensus a WG member can call for -either a closing vote or a vote to table the issue to the next -meeting. The call for a vote must be seconded by a majority of the WG -or else the discussion will continue. Simple majority wins. - -Note that changes to WG membership require a majority consensus. See -"WG Membership" above. diff --git a/deps/npm/node_modules/flush-write-stream/node_modules/readable-stream/LICENSE b/deps/npm/node_modules/flush-write-stream/node_modules/readable-stream/LICENSE deleted file mode 100644 index 2873b3b2e59507..00000000000000 --- a/deps/npm/node_modules/flush-write-stream/node_modules/readable-stream/LICENSE +++ /dev/null @@ -1,47 +0,0 @@ -Node.js is licensed for use as follows: - -""" -Copyright Node.js contributors. All rights reserved. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to -deal in the Software without restriction, including without limitation the -rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -sell copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -IN THE SOFTWARE. -""" - -This license applies to parts of Node.js originating from the -https://github.com/joyent/node repository: - -""" -Copyright Joyent, Inc. and other Node contributors. All rights reserved. -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to -deal in the Software without restriction, including without limitation the -rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -sell copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -IN THE SOFTWARE. -""" diff --git a/deps/npm/node_modules/flush-write-stream/node_modules/readable-stream/README.md b/deps/npm/node_modules/flush-write-stream/node_modules/readable-stream/README.md deleted file mode 100644 index 23fe3f3e3009a2..00000000000000 --- a/deps/npm/node_modules/flush-write-stream/node_modules/readable-stream/README.md +++ /dev/null @@ -1,58 +0,0 @@ -# readable-stream - -***Node-core v8.11.1 streams for userland*** [![Build Status](https://travis-ci.org/nodejs/readable-stream.svg?branch=master)](https://travis-ci.org/nodejs/readable-stream) - - -[![NPM](https://nodei.co/npm/readable-stream.png?downloads=true&downloadRank=true)](https://nodei.co/npm/readable-stream/) -[![NPM](https://nodei.co/npm-dl/readable-stream.png?&months=6&height=3)](https://nodei.co/npm/readable-stream/) - - -[![Sauce Test Status](https://saucelabs.com/browser-matrix/readable-stream.svg)](https://saucelabs.com/u/readable-stream) - -```bash -npm install --save readable-stream -``` - -***Node-core streams for userland*** - -This package is a mirror of the Streams2 and Streams3 implementations in -Node-core. - -Full documentation may be found on the [Node.js website](https://nodejs.org/dist/v8.11.1/docs/api/stream.html). - -If you want to guarantee a stable streams base, regardless of what version of -Node you, or the users of your libraries are using, use **readable-stream** *only* and avoid the *"stream"* module in Node-core, for background see [this blogpost](http://r.va.gg/2014/06/why-i-dont-use-nodes-core-stream-module.html). - -As of version 2.0.0 **readable-stream** uses semantic versioning. - -# Streams Working Group - -`readable-stream` is maintained by the Streams Working Group, which -oversees the development and maintenance of the Streams API within -Node.js. The responsibilities of the Streams Working Group include: - -* Addressing stream issues on the Node.js issue tracker. -* Authoring and editing stream documentation within the Node.js project. -* Reviewing changes to stream subclasses within the Node.js project. -* Redirecting changes to streams from the Node.js project to this - project. -* Assisting in the implementation of stream providers within Node.js. -* Recommending versions of `readable-stream` to be included in Node.js. -* Messaging about the future of streams to give the community advance - notice of changes. - - -## Team Members - -* **Chris Dickinson** ([@chrisdickinson](https://github.com/chrisdickinson)) <christopher.s.dickinson@gmail.com> - - Release GPG key: 9554F04D7259F04124DE6B476D5A82AC7E37093B -* **Calvin Metcalf** ([@calvinmetcalf](https://github.com/calvinmetcalf)) <calvin.metcalf@gmail.com> - - Release GPG key: F3EF5F62A87FC27A22E643F714CE4FF5015AA242 -* **Rod Vagg** ([@rvagg](https://github.com/rvagg)) <rod@vagg.org> - - Release GPG key: DD8F2338BAE7501E3DD5AC78C273792F7D83545D -* **Sam Newman** ([@sonewman](https://github.com/sonewman)) <newmansam@outlook.com> -* **Mathias Buus** ([@mafintosh](https://github.com/mafintosh)) <mathiasbuus@gmail.com> -* **Domenic Denicola** ([@domenic](https://github.com/domenic)) <d@domenic.me> -* **Matteo Collina** ([@mcollina](https://github.com/mcollina)) <matteo.collina@gmail.com> - - Release GPG key: 3ABC01543F22DD2239285CDD818674489FBC127E -* **Irina Shestak** ([@lrlna](https://github.com/lrlna)) <shestak.irina@gmail.com> diff --git a/deps/npm/node_modules/flush-write-stream/node_modules/readable-stream/doc/wg-meetings/2015-01-30.md b/deps/npm/node_modules/flush-write-stream/node_modules/readable-stream/doc/wg-meetings/2015-01-30.md deleted file mode 100644 index 83275f192e4077..00000000000000 --- a/deps/npm/node_modules/flush-write-stream/node_modules/readable-stream/doc/wg-meetings/2015-01-30.md +++ /dev/null @@ -1,60 +0,0 @@ -# streams WG Meeting 2015-01-30 - -## Links - -* **Google Hangouts Video**: http://www.youtube.com/watch?v=I9nDOSGfwZg -* **GitHub Issue**: https://github.com/iojs/readable-stream/issues/106 -* **Original Minutes Google Doc**: https://docs.google.com/document/d/17aTgLnjMXIrfjgNaTUnHQO7m3xgzHR2VXBTmi03Qii4/ - -## Agenda - -Extracted from https://github.com/iojs/readable-stream/labels/wg-agenda prior to meeting. - -* adopt a charter [#105](https://github.com/iojs/readable-stream/issues/105) -* release and versioning strategy [#101](https://github.com/iojs/readable-stream/issues/101) -* simpler stream creation [#102](https://github.com/iojs/readable-stream/issues/102) -* proposal: deprecate implicit flowing of streams [#99](https://github.com/iojs/readable-stream/issues/99) - -## Minutes - -### adopt a charter - -* group: +1's all around - -### What versioning scheme should be adopted? -* group: +1’s 3.0.0 -* domenic+group: pulling in patches from other sources where appropriate -* mikeal: version independently, suggesting versions for io.js -* mikeal+domenic: work with TC to notify in advance of changes -simpler stream creation - -### streamline creation of streams -* sam: streamline creation of streams -* domenic: nice simple solution posted - but, we lose the opportunity to change the model - may not be backwards incompatible (double check keys) - - **action item:** domenic will check - -### remove implicit flowing of streams on(‘data’) -* add isFlowing / isPaused -* mikeal: worrying that we’re documenting polyfill methods – confuses users -* domenic: more reflective API is probably good, with warning labels for users -* new section for mad scientists (reflective stream access) -* calvin: name the “third state” -* mikeal: maybe borrow the name from whatwg? -* domenic: we’re missing the “third state” -* consensus: kind of difficult to name the third state -* mikeal: figure out differences in states / compat -* mathias: always flow on data – eliminates third state - * explore what it breaks - -**action items:** -* ask isaac for ability to list packages by what public io.js APIs they use (esp. Stream) -* ask rod/build for infrastructure -* **chris**: explore the “flow on data” approach -* add isPaused/isFlowing -* add new docs section -* move isPaused to that section - - diff --git a/deps/npm/node_modules/flush-write-stream/node_modules/readable-stream/duplex-browser.js b/deps/npm/node_modules/flush-write-stream/node_modules/readable-stream/duplex-browser.js deleted file mode 100644 index f8b2db83dbe733..00000000000000 --- a/deps/npm/node_modules/flush-write-stream/node_modules/readable-stream/duplex-browser.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./lib/_stream_duplex.js'); diff --git a/deps/npm/node_modules/flush-write-stream/node_modules/readable-stream/duplex.js b/deps/npm/node_modules/flush-write-stream/node_modules/readable-stream/duplex.js deleted file mode 100644 index 46924cbfdf5387..00000000000000 --- a/deps/npm/node_modules/flush-write-stream/node_modules/readable-stream/duplex.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./readable').Duplex diff --git a/deps/npm/node_modules/flush-write-stream/node_modules/readable-stream/lib/_stream_duplex.js b/deps/npm/node_modules/flush-write-stream/node_modules/readable-stream/lib/_stream_duplex.js deleted file mode 100644 index a1ca813e5acbd8..00000000000000 --- a/deps/npm/node_modules/flush-write-stream/node_modules/readable-stream/lib/_stream_duplex.js +++ /dev/null @@ -1,131 +0,0 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - -// a duplex stream is just a stream that is both readable and writable. -// Since JS doesn't have multiple prototypal inheritance, this class -// prototypally inherits from Readable, and then parasitically from -// Writable. - -'use strict'; - -/**/ - -var pna = require('process-nextick-args'); -/**/ - -/**/ -var objectKeys = Object.keys || function (obj) { - var keys = []; - for (var key in obj) { - keys.push(key); - }return keys; -}; -/**/ - -module.exports = Duplex; - -/**/ -var util = require('core-util-is'); -util.inherits = require('inherits'); -/**/ - -var Readable = require('./_stream_readable'); -var Writable = require('./_stream_writable'); - -util.inherits(Duplex, Readable); - -{ - // avoid scope creep, the keys array can then be collected - var keys = objectKeys(Writable.prototype); - for (var v = 0; v < keys.length; v++) { - var method = keys[v]; - if (!Duplex.prototype[method]) Duplex.prototype[method] = Writable.prototype[method]; - } -} - -function Duplex(options) { - if (!(this instanceof Duplex)) return new Duplex(options); - - Readable.call(this, options); - Writable.call(this, options); - - if (options && options.readable === false) this.readable = false; - - if (options && options.writable === false) this.writable = false; - - this.allowHalfOpen = true; - if (options && options.allowHalfOpen === false) this.allowHalfOpen = false; - - this.once('end', onend); -} - -Object.defineProperty(Duplex.prototype, 'writableHighWaterMark', { - // making it explicit this property is not enumerable - // because otherwise some prototype manipulation in - // userland will fail - enumerable: false, - get: function () { - return this._writableState.highWaterMark; - } -}); - -// the no-half-open enforcer -function onend() { - // if we allow half-open state, or if the writable side ended, - // then we're ok. - if (this.allowHalfOpen || this._writableState.ended) return; - - // no more data can be written. - // But allow more writes to happen in this tick. - pna.nextTick(onEndNT, this); -} - -function onEndNT(self) { - self.end(); -} - -Object.defineProperty(Duplex.prototype, 'destroyed', { - get: function () { - if (this._readableState === undefined || this._writableState === undefined) { - return false; - } - return this._readableState.destroyed && this._writableState.destroyed; - }, - set: function (value) { - // we ignore the value if the stream - // has not been initialized yet - if (this._readableState === undefined || this._writableState === undefined) { - return; - } - - // backward compatibility, the user is explicitly - // managing destroyed - this._readableState.destroyed = value; - this._writableState.destroyed = value; - } -}); - -Duplex.prototype._destroy = function (err, cb) { - this.push(null); - this.end(); - - pna.nextTick(cb, err); -}; \ No newline at end of file diff --git a/deps/npm/node_modules/flush-write-stream/node_modules/readable-stream/lib/_stream_passthrough.js b/deps/npm/node_modules/flush-write-stream/node_modules/readable-stream/lib/_stream_passthrough.js deleted file mode 100644 index a9c835884828d8..00000000000000 --- a/deps/npm/node_modules/flush-write-stream/node_modules/readable-stream/lib/_stream_passthrough.js +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - -// a passthrough stream. -// basically just the most minimal sort of Transform stream. -// Every written chunk gets output as-is. - -'use strict'; - -module.exports = PassThrough; - -var Transform = require('./_stream_transform'); - -/**/ -var util = require('core-util-is'); -util.inherits = require('inherits'); -/**/ - -util.inherits(PassThrough, Transform); - -function PassThrough(options) { - if (!(this instanceof PassThrough)) return new PassThrough(options); - - Transform.call(this, options); -} - -PassThrough.prototype._transform = function (chunk, encoding, cb) { - cb(null, chunk); -}; \ No newline at end of file diff --git a/deps/npm/node_modules/flush-write-stream/node_modules/readable-stream/lib/_stream_readable.js b/deps/npm/node_modules/flush-write-stream/node_modules/readable-stream/lib/_stream_readable.js deleted file mode 100644 index bf34ac65e1108f..00000000000000 --- a/deps/npm/node_modules/flush-write-stream/node_modules/readable-stream/lib/_stream_readable.js +++ /dev/null @@ -1,1019 +0,0 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - -'use strict'; - -/**/ - -var pna = require('process-nextick-args'); -/**/ - -module.exports = Readable; - -/**/ -var isArray = require('isarray'); -/**/ - -/**/ -var Duplex; -/**/ - -Readable.ReadableState = ReadableState; - -/**/ -var EE = require('events').EventEmitter; - -var EElistenerCount = function (emitter, type) { - return emitter.listeners(type).length; -}; -/**/ - -/**/ -var Stream = require('./internal/streams/stream'); -/**/ - -/**/ - -var Buffer = require('safe-buffer').Buffer; -var OurUint8Array = global.Uint8Array || function () {}; -function _uint8ArrayToBuffer(chunk) { - return Buffer.from(chunk); -} -function _isUint8Array(obj) { - return Buffer.isBuffer(obj) || obj instanceof OurUint8Array; -} - -/**/ - -/**/ -var util = require('core-util-is'); -util.inherits = require('inherits'); -/**/ - -/**/ -var debugUtil = require('util'); -var debug = void 0; -if (debugUtil && debugUtil.debuglog) { - debug = debugUtil.debuglog('stream'); -} else { - debug = function () {}; -} -/**/ - -var BufferList = require('./internal/streams/BufferList'); -var destroyImpl = require('./internal/streams/destroy'); -var StringDecoder; - -util.inherits(Readable, Stream); - -var kProxyEvents = ['error', 'close', 'destroy', 'pause', 'resume']; - -function prependListener(emitter, event, fn) { - // Sadly this is not cacheable as some libraries bundle their own - // event emitter implementation with them. - if (typeof emitter.prependListener === 'function') return emitter.prependListener(event, fn); - - // This is a hack to make sure that our error handler is attached before any - // userland ones. NEVER DO THIS. This is here only because this code needs - // to continue to work with older versions of Node.js that do not include - // the prependListener() method. The goal is to eventually remove this hack. - if (!emitter._events || !emitter._events[event]) emitter.on(event, fn);else if (isArray(emitter._events[event])) emitter._events[event].unshift(fn);else emitter._events[event] = [fn, emitter._events[event]]; -} - -function ReadableState(options, stream) { - Duplex = Duplex || require('./_stream_duplex'); - - options = options || {}; - - // Duplex streams are both readable and writable, but share - // the same options object. - // However, some cases require setting options to different - // values for the readable and the writable sides of the duplex stream. - // These options can be provided separately as readableXXX and writableXXX. - var isDuplex = stream instanceof Duplex; - - // object stream flag. Used to make read(n) ignore n and to - // make all the buffer merging and length checks go away - this.objectMode = !!options.objectMode; - - if (isDuplex) this.objectMode = this.objectMode || !!options.readableObjectMode; - - // the point at which it stops calling _read() to fill the buffer - // Note: 0 is a valid value, means "don't call _read preemptively ever" - var hwm = options.highWaterMark; - var readableHwm = options.readableHighWaterMark; - var defaultHwm = this.objectMode ? 16 : 16 * 1024; - - if (hwm || hwm === 0) this.highWaterMark = hwm;else if (isDuplex && (readableHwm || readableHwm === 0)) this.highWaterMark = readableHwm;else this.highWaterMark = defaultHwm; - - // cast to ints. - this.highWaterMark = Math.floor(this.highWaterMark); - - // A linked list is used to store data chunks instead of an array because the - // linked list can remove elements from the beginning faster than - // array.shift() - this.buffer = new BufferList(); - this.length = 0; - this.pipes = null; - this.pipesCount = 0; - this.flowing = null; - this.ended = false; - this.endEmitted = false; - this.reading = false; - - // a flag to be able to tell if the event 'readable'/'data' is emitted - // immediately, or on a later tick. We set this to true at first, because - // any actions that shouldn't happen until "later" should generally also - // not happen before the first read call. - this.sync = true; - - // whenever we return null, then we set a flag to say - // that we're awaiting a 'readable' event emission. - this.needReadable = false; - this.emittedReadable = false; - this.readableListening = false; - this.resumeScheduled = false; - - // has it been destroyed - this.destroyed = false; - - // Crypto is kind of old and crusty. Historically, its default string - // encoding is 'binary' so we have to make this configurable. - // Everything else in the universe uses 'utf8', though. - this.defaultEncoding = options.defaultEncoding || 'utf8'; - - // the number of writers that are awaiting a drain event in .pipe()s - this.awaitDrain = 0; - - // if true, a maybeReadMore has been scheduled - this.readingMore = false; - - this.decoder = null; - this.encoding = null; - if (options.encoding) { - if (!StringDecoder) StringDecoder = require('string_decoder/').StringDecoder; - this.decoder = new StringDecoder(options.encoding); - this.encoding = options.encoding; - } -} - -function Readable(options) { - Duplex = Duplex || require('./_stream_duplex'); - - if (!(this instanceof Readable)) return new Readable(options); - - this._readableState = new ReadableState(options, this); - - // legacy - this.readable = true; - - if (options) { - if (typeof options.read === 'function') this._read = options.read; - - if (typeof options.destroy === 'function') this._destroy = options.destroy; - } - - Stream.call(this); -} - -Object.defineProperty(Readable.prototype, 'destroyed', { - get: function () { - if (this._readableState === undefined) { - return false; - } - return this._readableState.destroyed; - }, - set: function (value) { - // we ignore the value if the stream - // has not been initialized yet - if (!this._readableState) { - return; - } - - // backward compatibility, the user is explicitly - // managing destroyed - this._readableState.destroyed = value; - } -}); - -Readable.prototype.destroy = destroyImpl.destroy; -Readable.prototype._undestroy = destroyImpl.undestroy; -Readable.prototype._destroy = function (err, cb) { - this.push(null); - cb(err); -}; - -// Manually shove something into the read() buffer. -// This returns true if the highWaterMark has not been hit yet, -// similar to how Writable.write() returns true if you should -// write() some more. -Readable.prototype.push = function (chunk, encoding) { - var state = this._readableState; - var skipChunkCheck; - - if (!state.objectMode) { - if (typeof chunk === 'string') { - encoding = encoding || state.defaultEncoding; - if (encoding !== state.encoding) { - chunk = Buffer.from(chunk, encoding); - encoding = ''; - } - skipChunkCheck = true; - } - } else { - skipChunkCheck = true; - } - - return readableAddChunk(this, chunk, encoding, false, skipChunkCheck); -}; - -// Unshift should *always* be something directly out of read() -Readable.prototype.unshift = function (chunk) { - return readableAddChunk(this, chunk, null, true, false); -}; - -function readableAddChunk(stream, chunk, encoding, addToFront, skipChunkCheck) { - var state = stream._readableState; - if (chunk === null) { - state.reading = false; - onEofChunk(stream, state); - } else { - var er; - if (!skipChunkCheck) er = chunkInvalid(state, chunk); - if (er) { - stream.emit('error', er); - } else if (state.objectMode || chunk && chunk.length > 0) { - if (typeof chunk !== 'string' && !state.objectMode && Object.getPrototypeOf(chunk) !== Buffer.prototype) { - chunk = _uint8ArrayToBuffer(chunk); - } - - if (addToFront) { - if (state.endEmitted) stream.emit('error', new Error('stream.unshift() after end event'));else addChunk(stream, state, chunk, true); - } else if (state.ended) { - stream.emit('error', new Error('stream.push() after EOF')); - } else { - state.reading = false; - if (state.decoder && !encoding) { - chunk = state.decoder.write(chunk); - if (state.objectMode || chunk.length !== 0) addChunk(stream, state, chunk, false);else maybeReadMore(stream, state); - } else { - addChunk(stream, state, chunk, false); - } - } - } else if (!addToFront) { - state.reading = false; - } - } - - return needMoreData(state); -} - -function addChunk(stream, state, chunk, addToFront) { - if (state.flowing && state.length === 0 && !state.sync) { - stream.emit('data', chunk); - stream.read(0); - } else { - // update the buffer info. - state.length += state.objectMode ? 1 : chunk.length; - if (addToFront) state.buffer.unshift(chunk);else state.buffer.push(chunk); - - if (state.needReadable) emitReadable(stream); - } - maybeReadMore(stream, state); -} - -function chunkInvalid(state, chunk) { - var er; - if (!_isUint8Array(chunk) && typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) { - er = new TypeError('Invalid non-string/buffer chunk'); - } - return er; -} - -// if it's past the high water mark, we can push in some more. -// Also, if we have no data yet, we can stand some -// more bytes. This is to work around cases where hwm=0, -// such as the repl. Also, if the push() triggered a -// readable event, and the user called read(largeNumber) such that -// needReadable was set, then we ought to push more, so that another -// 'readable' event will be triggered. -function needMoreData(state) { - return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0); -} - -Readable.prototype.isPaused = function () { - return this._readableState.flowing === false; -}; - -// backwards compatibility. -Readable.prototype.setEncoding = function (enc) { - if (!StringDecoder) StringDecoder = require('string_decoder/').StringDecoder; - this._readableState.decoder = new StringDecoder(enc); - this._readableState.encoding = enc; - return this; -}; - -// Don't raise the hwm > 8MB -var MAX_HWM = 0x800000; -function computeNewHighWaterMark(n) { - if (n >= MAX_HWM) { - n = MAX_HWM; - } else { - // Get the next highest power of 2 to prevent increasing hwm excessively in - // tiny amounts - n--; - n |= n >>> 1; - n |= n >>> 2; - n |= n >>> 4; - n |= n >>> 8; - n |= n >>> 16; - n++; - } - return n; -} - -// This function is designed to be inlinable, so please take care when making -// changes to the function body. -function howMuchToRead(n, state) { - if (n <= 0 || state.length === 0 && state.ended) return 0; - if (state.objectMode) return 1; - if (n !== n) { - // Only flow one buffer at a time - if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length; - } - // If we're asking for more than the current hwm, then raise the hwm. - if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n); - if (n <= state.length) return n; - // Don't have enough - if (!state.ended) { - state.needReadable = true; - return 0; - } - return state.length; -} - -// you can override either this method, or the async _read(n) below. -Readable.prototype.read = function (n) { - debug('read', n); - n = parseInt(n, 10); - var state = this._readableState; - var nOrig = n; - - if (n !== 0) state.emittedReadable = false; - - // if we're doing read(0) to trigger a readable event, but we - // already have a bunch of data in the buffer, then just trigger - // the 'readable' event and move on. - if (n === 0 && state.needReadable && (state.length >= state.highWaterMark || state.ended)) { - debug('read: emitReadable', state.length, state.ended); - if (state.length === 0 && state.ended) endReadable(this);else emitReadable(this); - return null; - } - - n = howMuchToRead(n, state); - - // if we've ended, and we're now clear, then finish it up. - if (n === 0 && state.ended) { - if (state.length === 0) endReadable(this); - return null; - } - - // All the actual chunk generation logic needs to be - // *below* the call to _read. The reason is that in certain - // synthetic stream cases, such as passthrough streams, _read - // may be a completely synchronous operation which may change - // the state of the read buffer, providing enough data when - // before there was *not* enough. - // - // So, the steps are: - // 1. Figure out what the state of things will be after we do - // a read from the buffer. - // - // 2. If that resulting state will trigger a _read, then call _read. - // Note that this may be asynchronous, or synchronous. Yes, it is - // deeply ugly to write APIs this way, but that still doesn't mean - // that the Readable class should behave improperly, as streams are - // designed to be sync/async agnostic. - // Take note if the _read call is sync or async (ie, if the read call - // has returned yet), so that we know whether or not it's safe to emit - // 'readable' etc. - // - // 3. Actually pull the requested chunks out of the buffer and return. - - // if we need a readable event, then we need to do some reading. - var doRead = state.needReadable; - debug('need readable', doRead); - - // if we currently have less than the highWaterMark, then also read some - if (state.length === 0 || state.length - n < state.highWaterMark) { - doRead = true; - debug('length less than watermark', doRead); - } - - // however, if we've ended, then there's no point, and if we're already - // reading, then it's unnecessary. - if (state.ended || state.reading) { - doRead = false; - debug('reading or ended', doRead); - } else if (doRead) { - debug('do read'); - state.reading = true; - state.sync = true; - // if the length is currently zero, then we *need* a readable event. - if (state.length === 0) state.needReadable = true; - // call internal read method - this._read(state.highWaterMark); - state.sync = false; - // If _read pushed data synchronously, then `reading` will be false, - // and we need to re-evaluate how much data we can return to the user. - if (!state.reading) n = howMuchToRead(nOrig, state); - } - - var ret; - if (n > 0) ret = fromList(n, state);else ret = null; - - if (ret === null) { - state.needReadable = true; - n = 0; - } else { - state.length -= n; - } - - if (state.length === 0) { - // If we have nothing in the buffer, then we want to know - // as soon as we *do* get something into the buffer. - if (!state.ended) state.needReadable = true; - - // If we tried to read() past the EOF, then emit end on the next tick. - if (nOrig !== n && state.ended) endReadable(this); - } - - if (ret !== null) this.emit('data', ret); - - return ret; -}; - -function onEofChunk(stream, state) { - if (state.ended) return; - if (state.decoder) { - var chunk = state.decoder.end(); - if (chunk && chunk.length) { - state.buffer.push(chunk); - state.length += state.objectMode ? 1 : chunk.length; - } - } - state.ended = true; - - // emit 'readable' now to make sure it gets picked up. - emitReadable(stream); -} - -// Don't emit readable right away in sync mode, because this can trigger -// another read() call => stack overflow. This way, it might trigger -// a nextTick recursion warning, but that's not so bad. -function emitReadable(stream) { - var state = stream._readableState; - state.needReadable = false; - if (!state.emittedReadable) { - debug('emitReadable', state.flowing); - state.emittedReadable = true; - if (state.sync) pna.nextTick(emitReadable_, stream);else emitReadable_(stream); - } -} - -function emitReadable_(stream) { - debug('emit readable'); - stream.emit('readable'); - flow(stream); -} - -// at this point, the user has presumably seen the 'readable' event, -// and called read() to consume some data. that may have triggered -// in turn another _read(n) call, in which case reading = true if -// it's in progress. -// However, if we're not ended, or reading, and the length < hwm, -// then go ahead and try to read some more preemptively. -function maybeReadMore(stream, state) { - if (!state.readingMore) { - state.readingMore = true; - pna.nextTick(maybeReadMore_, stream, state); - } -} - -function maybeReadMore_(stream, state) { - var len = state.length; - while (!state.reading && !state.flowing && !state.ended && state.length < state.highWaterMark) { - debug('maybeReadMore read 0'); - stream.read(0); - if (len === state.length) - // didn't get any data, stop spinning. - break;else len = state.length; - } - state.readingMore = false; -} - -// abstract method. to be overridden in specific implementation classes. -// call cb(er, data) where data is <= n in length. -// for virtual (non-string, non-buffer) streams, "length" is somewhat -// arbitrary, and perhaps not very meaningful. -Readable.prototype._read = function (n) { - this.emit('error', new Error('_read() is not implemented')); -}; - -Readable.prototype.pipe = function (dest, pipeOpts) { - var src = this; - var state = this._readableState; - - switch (state.pipesCount) { - case 0: - state.pipes = dest; - break; - case 1: - state.pipes = [state.pipes, dest]; - break; - default: - state.pipes.push(dest); - break; - } - state.pipesCount += 1; - debug('pipe count=%d opts=%j', state.pipesCount, pipeOpts); - - var doEnd = (!pipeOpts || pipeOpts.end !== false) && dest !== process.stdout && dest !== process.stderr; - - var endFn = doEnd ? onend : unpipe; - if (state.endEmitted) pna.nextTick(endFn);else src.once('end', endFn); - - dest.on('unpipe', onunpipe); - function onunpipe(readable, unpipeInfo) { - debug('onunpipe'); - if (readable === src) { - if (unpipeInfo && unpipeInfo.hasUnpiped === false) { - unpipeInfo.hasUnpiped = true; - cleanup(); - } - } - } - - function onend() { - debug('onend'); - dest.end(); - } - - // when the dest drains, it reduces the awaitDrain counter - // on the source. This would be more elegant with a .once() - // handler in flow(), but adding and removing repeatedly is - // too slow. - var ondrain = pipeOnDrain(src); - dest.on('drain', ondrain); - - var cleanedUp = false; - function cleanup() { - debug('cleanup'); - // cleanup event handlers once the pipe is broken - dest.removeListener('close', onclose); - dest.removeListener('finish', onfinish); - dest.removeListener('drain', ondrain); - dest.removeListener('error', onerror); - dest.removeListener('unpipe', onunpipe); - src.removeListener('end', onend); - src.removeListener('end', unpipe); - src.removeListener('data', ondata); - - cleanedUp = true; - - // if the reader is waiting for a drain event from this - // specific writer, then it would cause it to never start - // flowing again. - // So, if this is awaiting a drain, then we just call it now. - // If we don't know, then assume that we are waiting for one. - if (state.awaitDrain && (!dest._writableState || dest._writableState.needDrain)) ondrain(); - } - - // If the user pushes more data while we're writing to dest then we'll end up - // in ondata again. However, we only want to increase awaitDrain once because - // dest will only emit one 'drain' event for the multiple writes. - // => Introduce a guard on increasing awaitDrain. - var increasedAwaitDrain = false; - src.on('data', ondata); - function ondata(chunk) { - debug('ondata'); - increasedAwaitDrain = false; - var ret = dest.write(chunk); - if (false === ret && !increasedAwaitDrain) { - // If the user unpiped during `dest.write()`, it is possible - // to get stuck in a permanently paused state if that write - // also returned false. - // => Check whether `dest` is still a piping destination. - if ((state.pipesCount === 1 && state.pipes === dest || state.pipesCount > 1 && indexOf(state.pipes, dest) !== -1) && !cleanedUp) { - debug('false write response, pause', src._readableState.awaitDrain); - src._readableState.awaitDrain++; - increasedAwaitDrain = true; - } - src.pause(); - } - } - - // if the dest has an error, then stop piping into it. - // however, don't suppress the throwing behavior for this. - function onerror(er) { - debug('onerror', er); - unpipe(); - dest.removeListener('error', onerror); - if (EElistenerCount(dest, 'error') === 0) dest.emit('error', er); - } - - // Make sure our error handler is attached before userland ones. - prependListener(dest, 'error', onerror); - - // Both close and finish should trigger unpipe, but only once. - function onclose() { - dest.removeListener('finish', onfinish); - unpipe(); - } - dest.once('close', onclose); - function onfinish() { - debug('onfinish'); - dest.removeListener('close', onclose); - unpipe(); - } - dest.once('finish', onfinish); - - function unpipe() { - debug('unpipe'); - src.unpipe(dest); - } - - // tell the dest that it's being piped to - dest.emit('pipe', src); - - // start the flow if it hasn't been started already. - if (!state.flowing) { - debug('pipe resume'); - src.resume(); - } - - return dest; -}; - -function pipeOnDrain(src) { - return function () { - var state = src._readableState; - debug('pipeOnDrain', state.awaitDrain); - if (state.awaitDrain) state.awaitDrain--; - if (state.awaitDrain === 0 && EElistenerCount(src, 'data')) { - state.flowing = true; - flow(src); - } - }; -} - -Readable.prototype.unpipe = function (dest) { - var state = this._readableState; - var unpipeInfo = { hasUnpiped: false }; - - // if we're not piping anywhere, then do nothing. - if (state.pipesCount === 0) return this; - - // just one destination. most common case. - if (state.pipesCount === 1) { - // passed in one, but it's not the right one. - if (dest && dest !== state.pipes) return this; - - if (!dest) dest = state.pipes; - - // got a match. - state.pipes = null; - state.pipesCount = 0; - state.flowing = false; - if (dest) dest.emit('unpipe', this, unpipeInfo); - return this; - } - - // slow case. multiple pipe destinations. - - if (!dest) { - // remove all. - var dests = state.pipes; - var len = state.pipesCount; - state.pipes = null; - state.pipesCount = 0; - state.flowing = false; - - for (var i = 0; i < len; i++) { - dests[i].emit('unpipe', this, unpipeInfo); - }return this; - } - - // try to find the right one. - var index = indexOf(state.pipes, dest); - if (index === -1) return this; - - state.pipes.splice(index, 1); - state.pipesCount -= 1; - if (state.pipesCount === 1) state.pipes = state.pipes[0]; - - dest.emit('unpipe', this, unpipeInfo); - - return this; -}; - -// set up data events if they are asked for -// Ensure readable listeners eventually get something -Readable.prototype.on = function (ev, fn) { - var res = Stream.prototype.on.call(this, ev, fn); - - if (ev === 'data') { - // Start flowing on next tick if stream isn't explicitly paused - if (this._readableState.flowing !== false) this.resume(); - } else if (ev === 'readable') { - var state = this._readableState; - if (!state.endEmitted && !state.readableListening) { - state.readableListening = state.needReadable = true; - state.emittedReadable = false; - if (!state.reading) { - pna.nextTick(nReadingNextTick, this); - } else if (state.length) { - emitReadable(this); - } - } - } - - return res; -}; -Readable.prototype.addListener = Readable.prototype.on; - -function nReadingNextTick(self) { - debug('readable nexttick read 0'); - self.read(0); -} - -// pause() and resume() are remnants of the legacy readable stream API -// If the user uses them, then switch into old mode. -Readable.prototype.resume = function () { - var state = this._readableState; - if (!state.flowing) { - debug('resume'); - state.flowing = true; - resume(this, state); - } - return this; -}; - -function resume(stream, state) { - if (!state.resumeScheduled) { - state.resumeScheduled = true; - pna.nextTick(resume_, stream, state); - } -} - -function resume_(stream, state) { - if (!state.reading) { - debug('resume read 0'); - stream.read(0); - } - - state.resumeScheduled = false; - state.awaitDrain = 0; - stream.emit('resume'); - flow(stream); - if (state.flowing && !state.reading) stream.read(0); -} - -Readable.prototype.pause = function () { - debug('call pause flowing=%j', this._readableState.flowing); - if (false !== this._readableState.flowing) { - debug('pause'); - this._readableState.flowing = false; - this.emit('pause'); - } - return this; -}; - -function flow(stream) { - var state = stream._readableState; - debug('flow', state.flowing); - while (state.flowing && stream.read() !== null) {} -} - -// wrap an old-style stream as the async data source. -// This is *not* part of the readable stream interface. -// It is an ugly unfortunate mess of history. -Readable.prototype.wrap = function (stream) { - var _this = this; - - var state = this._readableState; - var paused = false; - - stream.on('end', function () { - debug('wrapped end'); - if (state.decoder && !state.ended) { - var chunk = state.decoder.end(); - if (chunk && chunk.length) _this.push(chunk); - } - - _this.push(null); - }); - - stream.on('data', function (chunk) { - debug('wrapped data'); - if (state.decoder) chunk = state.decoder.write(chunk); - - // don't skip over falsy values in objectMode - if (state.objectMode && (chunk === null || chunk === undefined)) return;else if (!state.objectMode && (!chunk || !chunk.length)) return; - - var ret = _this.push(chunk); - if (!ret) { - paused = true; - stream.pause(); - } - }); - - // proxy all the other methods. - // important when wrapping filters and duplexes. - for (var i in stream) { - if (this[i] === undefined && typeof stream[i] === 'function') { - this[i] = function (method) { - return function () { - return stream[method].apply(stream, arguments); - }; - }(i); - } - } - - // proxy certain important events. - for (var n = 0; n < kProxyEvents.length; n++) { - stream.on(kProxyEvents[n], this.emit.bind(this, kProxyEvents[n])); - } - - // when we try to consume some more bytes, simply unpause the - // underlying stream. - this._read = function (n) { - debug('wrapped _read', n); - if (paused) { - paused = false; - stream.resume(); - } - }; - - return this; -}; - -Object.defineProperty(Readable.prototype, 'readableHighWaterMark', { - // making it explicit this property is not enumerable - // because otherwise some prototype manipulation in - // userland will fail - enumerable: false, - get: function () { - return this._readableState.highWaterMark; - } -}); - -// exposed for testing purposes only. -Readable._fromList = fromList; - -// Pluck off n bytes from an array of buffers. -// Length is the combined lengths of all the buffers in the list. -// This function is designed to be inlinable, so please take care when making -// changes to the function body. -function fromList(n, state) { - // nothing buffered - if (state.length === 0) return null; - - var ret; - if (state.objectMode) ret = state.buffer.shift();else if (!n || n >= state.length) { - // read it all, truncate the list - if (state.decoder) ret = state.buffer.join('');else if (state.buffer.length === 1) ret = state.buffer.head.data;else ret = state.buffer.concat(state.length); - state.buffer.clear(); - } else { - // read part of list - ret = fromListPartial(n, state.buffer, state.decoder); - } - - return ret; -} - -// Extracts only enough buffered data to satisfy the amount requested. -// This function is designed to be inlinable, so please take care when making -// changes to the function body. -function fromListPartial(n, list, hasStrings) { - var ret; - if (n < list.head.data.length) { - // slice is the same for buffers and strings - ret = list.head.data.slice(0, n); - list.head.data = list.head.data.slice(n); - } else if (n === list.head.data.length) { - // first chunk is a perfect match - ret = list.shift(); - } else { - // result spans more than one buffer - ret = hasStrings ? copyFromBufferString(n, list) : copyFromBuffer(n, list); - } - return ret; -} - -// Copies a specified amount of characters from the list of buffered data -// chunks. -// This function is designed to be inlinable, so please take care when making -// changes to the function body. -function copyFromBufferString(n, list) { - var p = list.head; - var c = 1; - var ret = p.data; - n -= ret.length; - while (p = p.next) { - var str = p.data; - var nb = n > str.length ? str.length : n; - if (nb === str.length) ret += str;else ret += str.slice(0, n); - n -= nb; - if (n === 0) { - if (nb === str.length) { - ++c; - if (p.next) list.head = p.next;else list.head = list.tail = null; - } else { - list.head = p; - p.data = str.slice(nb); - } - break; - } - ++c; - } - list.length -= c; - return ret; -} - -// Copies a specified amount of bytes from the list of buffered data chunks. -// This function is designed to be inlinable, so please take care when making -// changes to the function body. -function copyFromBuffer(n, list) { - var ret = Buffer.allocUnsafe(n); - var p = list.head; - var c = 1; - p.data.copy(ret); - n -= p.data.length; - while (p = p.next) { - var buf = p.data; - var nb = n > buf.length ? buf.length : n; - buf.copy(ret, ret.length - n, 0, nb); - n -= nb; - if (n === 0) { - if (nb === buf.length) { - ++c; - if (p.next) list.head = p.next;else list.head = list.tail = null; - } else { - list.head = p; - p.data = buf.slice(nb); - } - break; - } - ++c; - } - list.length -= c; - return ret; -} - -function endReadable(stream) { - var state = stream._readableState; - - // If we get here before consuming all the bytes, then that is a - // bug in node. Should never happen. - if (state.length > 0) throw new Error('"endReadable()" called on non-empty stream'); - - if (!state.endEmitted) { - state.ended = true; - pna.nextTick(endReadableNT, state, stream); - } -} - -function endReadableNT(state, stream) { - // Check that we didn't get one last unshift. - if (!state.endEmitted && state.length === 0) { - state.endEmitted = true; - stream.readable = false; - stream.emit('end'); - } -} - -function indexOf(xs, x) { - for (var i = 0, l = xs.length; i < l; i++) { - if (xs[i] === x) return i; - } - return -1; -} \ No newline at end of file diff --git a/deps/npm/node_modules/flush-write-stream/node_modules/readable-stream/lib/_stream_transform.js b/deps/npm/node_modules/flush-write-stream/node_modules/readable-stream/lib/_stream_transform.js deleted file mode 100644 index 5d1f8b876d98c7..00000000000000 --- a/deps/npm/node_modules/flush-write-stream/node_modules/readable-stream/lib/_stream_transform.js +++ /dev/null @@ -1,214 +0,0 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - -// a transform stream is a readable/writable stream where you do -// something with the data. Sometimes it's called a "filter", -// but that's not a great name for it, since that implies a thing where -// some bits pass through, and others are simply ignored. (That would -// be a valid example of a transform, of course.) -// -// While the output is causally related to the input, it's not a -// necessarily symmetric or synchronous transformation. For example, -// a zlib stream might take multiple plain-text writes(), and then -// emit a single compressed chunk some time in the future. -// -// Here's how this works: -// -// The Transform stream has all the aspects of the readable and writable -// stream classes. When you write(chunk), that calls _write(chunk,cb) -// internally, and returns false if there's a lot of pending writes -// buffered up. When you call read(), that calls _read(n) until -// there's enough pending readable data buffered up. -// -// In a transform stream, the written data is placed in a buffer. When -// _read(n) is called, it transforms the queued up data, calling the -// buffered _write cb's as it consumes chunks. If consuming a single -// written chunk would result in multiple output chunks, then the first -// outputted bit calls the readcb, and subsequent chunks just go into -// the read buffer, and will cause it to emit 'readable' if necessary. -// -// This way, back-pressure is actually determined by the reading side, -// since _read has to be called to start processing a new chunk. However, -// a pathological inflate type of transform can cause excessive buffering -// here. For example, imagine a stream where every byte of input is -// interpreted as an integer from 0-255, and then results in that many -// bytes of output. Writing the 4 bytes {ff,ff,ff,ff} would result in -// 1kb of data being output. In this case, you could write a very small -// amount of input, and end up with a very large amount of output. In -// such a pathological inflating mechanism, there'd be no way to tell -// the system to stop doing the transform. A single 4MB write could -// cause the system to run out of memory. -// -// However, even in such a pathological case, only a single written chunk -// would be consumed, and then the rest would wait (un-transformed) until -// the results of the previous transformed chunk were consumed. - -'use strict'; - -module.exports = Transform; - -var Duplex = require('./_stream_duplex'); - -/**/ -var util = require('core-util-is'); -util.inherits = require('inherits'); -/**/ - -util.inherits(Transform, Duplex); - -function afterTransform(er, data) { - var ts = this._transformState; - ts.transforming = false; - - var cb = ts.writecb; - - if (!cb) { - return this.emit('error', new Error('write callback called multiple times')); - } - - ts.writechunk = null; - ts.writecb = null; - - if (data != null) // single equals check for both `null` and `undefined` - this.push(data); - - cb(er); - - var rs = this._readableState; - rs.reading = false; - if (rs.needReadable || rs.length < rs.highWaterMark) { - this._read(rs.highWaterMark); - } -} - -function Transform(options) { - if (!(this instanceof Transform)) return new Transform(options); - - Duplex.call(this, options); - - this._transformState = { - afterTransform: afterTransform.bind(this), - needTransform: false, - transforming: false, - writecb: null, - writechunk: null, - writeencoding: null - }; - - // start out asking for a readable event once data is transformed. - this._readableState.needReadable = true; - - // we have implemented the _read method, and done the other things - // that Readable wants before the first _read call, so unset the - // sync guard flag. - this._readableState.sync = false; - - if (options) { - if (typeof options.transform === 'function') this._transform = options.transform; - - if (typeof options.flush === 'function') this._flush = options.flush; - } - - // When the writable side finishes, then flush out anything remaining. - this.on('prefinish', prefinish); -} - -function prefinish() { - var _this = this; - - if (typeof this._flush === 'function') { - this._flush(function (er, data) { - done(_this, er, data); - }); - } else { - done(this, null, null); - } -} - -Transform.prototype.push = function (chunk, encoding) { - this._transformState.needTransform = false; - return Duplex.prototype.push.call(this, chunk, encoding); -}; - -// This is the part where you do stuff! -// override this function in implementation classes. -// 'chunk' is an input chunk. -// -// Call `push(newChunk)` to pass along transformed output -// to the readable side. You may call 'push' zero or more times. -// -// Call `cb(err)` when you are done with this chunk. If you pass -// an error, then that'll put the hurt on the whole operation. If you -// never call cb(), then you'll never get another chunk. -Transform.prototype._transform = function (chunk, encoding, cb) { - throw new Error('_transform() is not implemented'); -}; - -Transform.prototype._write = function (chunk, encoding, cb) { - var ts = this._transformState; - ts.writecb = cb; - ts.writechunk = chunk; - ts.writeencoding = encoding; - if (!ts.transforming) { - var rs = this._readableState; - if (ts.needTransform || rs.needReadable || rs.length < rs.highWaterMark) this._read(rs.highWaterMark); - } -}; - -// Doesn't matter what the args are here. -// _transform does all the work. -// That we got here means that the readable side wants more data. -Transform.prototype._read = function (n) { - var ts = this._transformState; - - if (ts.writechunk !== null && ts.writecb && !ts.transforming) { - ts.transforming = true; - this._transform(ts.writechunk, ts.writeencoding, ts.afterTransform); - } else { - // mark that we need a transform, so that any data that comes in - // will get processed, now that we've asked for it. - ts.needTransform = true; - } -}; - -Transform.prototype._destroy = function (err, cb) { - var _this2 = this; - - Duplex.prototype._destroy.call(this, err, function (err2) { - cb(err2); - _this2.emit('close'); - }); -}; - -function done(stream, er, data) { - if (er) return stream.emit('error', er); - - if (data != null) // single equals check for both `null` and `undefined` - stream.push(data); - - // if there's nothing in the write buffer, then that means - // that nothing more will ever be provided - if (stream._writableState.length) throw new Error('Calling transform done when ws.length != 0'); - - if (stream._transformState.transforming) throw new Error('Calling transform done when still transforming'); - - return stream.push(null); -} \ No newline at end of file diff --git a/deps/npm/node_modules/flush-write-stream/node_modules/readable-stream/lib/_stream_writable.js b/deps/npm/node_modules/flush-write-stream/node_modules/readable-stream/lib/_stream_writable.js deleted file mode 100644 index b3f4e85a2f6e35..00000000000000 --- a/deps/npm/node_modules/flush-write-stream/node_modules/readable-stream/lib/_stream_writable.js +++ /dev/null @@ -1,687 +0,0 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - -// A bit simpler than readable streams. -// Implement an async ._write(chunk, encoding, cb), and it'll handle all -// the drain event emission and buffering. - -'use strict'; - -/**/ - -var pna = require('process-nextick-args'); -/**/ - -module.exports = Writable; - -/* */ -function WriteReq(chunk, encoding, cb) { - this.chunk = chunk; - this.encoding = encoding; - this.callback = cb; - this.next = null; -} - -// It seems a linked list but it is not -// there will be only 2 of these for each stream -function CorkedRequest(state) { - var _this = this; - - this.next = null; - this.entry = null; - this.finish = function () { - onCorkedFinish(_this, state); - }; -} -/* */ - -/**/ -var asyncWrite = !process.browser && ['v0.10', 'v0.9.'].indexOf(process.version.slice(0, 5)) > -1 ? setImmediate : pna.nextTick; -/**/ - -/**/ -var Duplex; -/**/ - -Writable.WritableState = WritableState; - -/**/ -var util = require('core-util-is'); -util.inherits = require('inherits'); -/**/ - -/**/ -var internalUtil = { - deprecate: require('util-deprecate') -}; -/**/ - -/**/ -var Stream = require('./internal/streams/stream'); -/**/ - -/**/ - -var Buffer = require('safe-buffer').Buffer; -var OurUint8Array = global.Uint8Array || function () {}; -function _uint8ArrayToBuffer(chunk) { - return Buffer.from(chunk); -} -function _isUint8Array(obj) { - return Buffer.isBuffer(obj) || obj instanceof OurUint8Array; -} - -/**/ - -var destroyImpl = require('./internal/streams/destroy'); - -util.inherits(Writable, Stream); - -function nop() {} - -function WritableState(options, stream) { - Duplex = Duplex || require('./_stream_duplex'); - - options = options || {}; - - // Duplex streams are both readable and writable, but share - // the same options object. - // However, some cases require setting options to different - // values for the readable and the writable sides of the duplex stream. - // These options can be provided separately as readableXXX and writableXXX. - var isDuplex = stream instanceof Duplex; - - // object stream flag to indicate whether or not this stream - // contains buffers or objects. - this.objectMode = !!options.objectMode; - - if (isDuplex) this.objectMode = this.objectMode || !!options.writableObjectMode; - - // the point at which write() starts returning false - // Note: 0 is a valid value, means that we always return false if - // the entire buffer is not flushed immediately on write() - var hwm = options.highWaterMark; - var writableHwm = options.writableHighWaterMark; - var defaultHwm = this.objectMode ? 16 : 16 * 1024; - - if (hwm || hwm === 0) this.highWaterMark = hwm;else if (isDuplex && (writableHwm || writableHwm === 0)) this.highWaterMark = writableHwm;else this.highWaterMark = defaultHwm; - - // cast to ints. - this.highWaterMark = Math.floor(this.highWaterMark); - - // if _final has been called - this.finalCalled = false; - - // drain event flag. - this.needDrain = false; - // at the start of calling end() - this.ending = false; - // when end() has been called, and returned - this.ended = false; - // when 'finish' is emitted - this.finished = false; - - // has it been destroyed - this.destroyed = false; - - // should we decode strings into buffers before passing to _write? - // this is here so that some node-core streams can optimize string - // handling at a lower level. - var noDecode = options.decodeStrings === false; - this.decodeStrings = !noDecode; - - // Crypto is kind of old and crusty. Historically, its default string - // encoding is 'binary' so we have to make this configurable. - // Everything else in the universe uses 'utf8', though. - this.defaultEncoding = options.defaultEncoding || 'utf8'; - - // not an actual buffer we keep track of, but a measurement - // of how much we're waiting to get pushed to some underlying - // socket or file. - this.length = 0; - - // a flag to see when we're in the middle of a write. - this.writing = false; - - // when true all writes will be buffered until .uncork() call - this.corked = 0; - - // a flag to be able to tell if the onwrite cb is called immediately, - // or on a later tick. We set this to true at first, because any - // actions that shouldn't happen until "later" should generally also - // not happen before the first write call. - this.sync = true; - - // a flag to know if we're processing previously buffered items, which - // may call the _write() callback in the same tick, so that we don't - // end up in an overlapped onwrite situation. - this.bufferProcessing = false; - - // the callback that's passed to _write(chunk,cb) - this.onwrite = function (er) { - onwrite(stream, er); - }; - - // the callback that the user supplies to write(chunk,encoding,cb) - this.writecb = null; - - // the amount that is being written when _write is called. - this.writelen = 0; - - this.bufferedRequest = null; - this.lastBufferedRequest = null; - - // number of pending user-supplied write callbacks - // this must be 0 before 'finish' can be emitted - this.pendingcb = 0; - - // emit prefinish if the only thing we're waiting for is _write cbs - // This is relevant for synchronous Transform streams - this.prefinished = false; - - // True if the error was already emitted and should not be thrown again - this.errorEmitted = false; - - // count buffered requests - this.bufferedRequestCount = 0; - - // allocate the first CorkedRequest, there is always - // one allocated and free to use, and we maintain at most two - this.corkedRequestsFree = new CorkedRequest(this); -} - -WritableState.prototype.getBuffer = function getBuffer() { - var current = this.bufferedRequest; - var out = []; - while (current) { - out.push(current); - current = current.next; - } - return out; -}; - -(function () { - try { - Object.defineProperty(WritableState.prototype, 'buffer', { - get: internalUtil.deprecate(function () { - return this.getBuffer(); - }, '_writableState.buffer is deprecated. Use _writableState.getBuffer ' + 'instead.', 'DEP0003') - }); - } catch (_) {} -})(); - -// Test _writableState for inheritance to account for Duplex streams, -// whose prototype chain only points to Readable. -var realHasInstance; -if (typeof Symbol === 'function' && Symbol.hasInstance && typeof Function.prototype[Symbol.hasInstance] === 'function') { - realHasInstance = Function.prototype[Symbol.hasInstance]; - Object.defineProperty(Writable, Symbol.hasInstance, { - value: function (object) { - if (realHasInstance.call(this, object)) return true; - if (this !== Writable) return false; - - return object && object._writableState instanceof WritableState; - } - }); -} else { - realHasInstance = function (object) { - return object instanceof this; - }; -} - -function Writable(options) { - Duplex = Duplex || require('./_stream_duplex'); - - // Writable ctor is applied to Duplexes, too. - // `realHasInstance` is necessary because using plain `instanceof` - // would return false, as no `_writableState` property is attached. - - // Trying to use the custom `instanceof` for Writable here will also break the - // Node.js LazyTransform implementation, which has a non-trivial getter for - // `_writableState` that would lead to infinite recursion. - if (!realHasInstance.call(Writable, this) && !(this instanceof Duplex)) { - return new Writable(options); - } - - this._writableState = new WritableState(options, this); - - // legacy. - this.writable = true; - - if (options) { - if (typeof options.write === 'function') this._write = options.write; - - if (typeof options.writev === 'function') this._writev = options.writev; - - if (typeof options.destroy === 'function') this._destroy = options.destroy; - - if (typeof options.final === 'function') this._final = options.final; - } - - Stream.call(this); -} - -// Otherwise people can pipe Writable streams, which is just wrong. -Writable.prototype.pipe = function () { - this.emit('error', new Error('Cannot pipe, not readable')); -}; - -function writeAfterEnd(stream, cb) { - var er = new Error('write after end'); - // TODO: defer error events consistently everywhere, not just the cb - stream.emit('error', er); - pna.nextTick(cb, er); -} - -// Checks that a user-supplied chunk is valid, especially for the particular -// mode the stream is in. Currently this means that `null` is never accepted -// and undefined/non-string values are only allowed in object mode. -function validChunk(stream, state, chunk, cb) { - var valid = true; - var er = false; - - if (chunk === null) { - er = new TypeError('May not write null values to stream'); - } else if (typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) { - er = new TypeError('Invalid non-string/buffer chunk'); - } - if (er) { - stream.emit('error', er); - pna.nextTick(cb, er); - valid = false; - } - return valid; -} - -Writable.prototype.write = function (chunk, encoding, cb) { - var state = this._writableState; - var ret = false; - var isBuf = !state.objectMode && _isUint8Array(chunk); - - if (isBuf && !Buffer.isBuffer(chunk)) { - chunk = _uint8ArrayToBuffer(chunk); - } - - if (typeof encoding === 'function') { - cb = encoding; - encoding = null; - } - - if (isBuf) encoding = 'buffer';else if (!encoding) encoding = state.defaultEncoding; - - if (typeof cb !== 'function') cb = nop; - - if (state.ended) writeAfterEnd(this, cb);else if (isBuf || validChunk(this, state, chunk, cb)) { - state.pendingcb++; - ret = writeOrBuffer(this, state, isBuf, chunk, encoding, cb); - } - - return ret; -}; - -Writable.prototype.cork = function () { - var state = this._writableState; - - state.corked++; -}; - -Writable.prototype.uncork = function () { - var state = this._writableState; - - if (state.corked) { - state.corked--; - - if (!state.writing && !state.corked && !state.finished && !state.bufferProcessing && state.bufferedRequest) clearBuffer(this, state); - } -}; - -Writable.prototype.setDefaultEncoding = function setDefaultEncoding(encoding) { - // node::ParseEncoding() requires lower case. - if (typeof encoding === 'string') encoding = encoding.toLowerCase(); - if (!(['hex', 'utf8', 'utf-8', 'ascii', 'binary', 'base64', 'ucs2', 'ucs-2', 'utf16le', 'utf-16le', 'raw'].indexOf((encoding + '').toLowerCase()) > -1)) throw new TypeError('Unknown encoding: ' + encoding); - this._writableState.defaultEncoding = encoding; - return this; -}; - -function decodeChunk(state, chunk, encoding) { - if (!state.objectMode && state.decodeStrings !== false && typeof chunk === 'string') { - chunk = Buffer.from(chunk, encoding); - } - return chunk; -} - -Object.defineProperty(Writable.prototype, 'writableHighWaterMark', { - // making it explicit this property is not enumerable - // because otherwise some prototype manipulation in - // userland will fail - enumerable: false, - get: function () { - return this._writableState.highWaterMark; - } -}); - -// if we're already writing something, then just put this -// in the queue, and wait our turn. Otherwise, call _write -// If we return false, then we need a drain event, so set that flag. -function writeOrBuffer(stream, state, isBuf, chunk, encoding, cb) { - if (!isBuf) { - var newChunk = decodeChunk(state, chunk, encoding); - if (chunk !== newChunk) { - isBuf = true; - encoding = 'buffer'; - chunk = newChunk; - } - } - var len = state.objectMode ? 1 : chunk.length; - - state.length += len; - - var ret = state.length < state.highWaterMark; - // we must ensure that previous needDrain will not be reset to false. - if (!ret) state.needDrain = true; - - if (state.writing || state.corked) { - var last = state.lastBufferedRequest; - state.lastBufferedRequest = { - chunk: chunk, - encoding: encoding, - isBuf: isBuf, - callback: cb, - next: null - }; - if (last) { - last.next = state.lastBufferedRequest; - } else { - state.bufferedRequest = state.lastBufferedRequest; - } - state.bufferedRequestCount += 1; - } else { - doWrite(stream, state, false, len, chunk, encoding, cb); - } - - return ret; -} - -function doWrite(stream, state, writev, len, chunk, encoding, cb) { - state.writelen = len; - state.writecb = cb; - state.writing = true; - state.sync = true; - if (writev) stream._writev(chunk, state.onwrite);else stream._write(chunk, encoding, state.onwrite); - state.sync = false; -} - -function onwriteError(stream, state, sync, er, cb) { - --state.pendingcb; - - if (sync) { - // defer the callback if we are being called synchronously - // to avoid piling up things on the stack - pna.nextTick(cb, er); - // this can emit finish, and it will always happen - // after error - pna.nextTick(finishMaybe, stream, state); - stream._writableState.errorEmitted = true; - stream.emit('error', er); - } else { - // the caller expect this to happen before if - // it is async - cb(er); - stream._writableState.errorEmitted = true; - stream.emit('error', er); - // this can emit finish, but finish must - // always follow error - finishMaybe(stream, state); - } -} - -function onwriteStateUpdate(state) { - state.writing = false; - state.writecb = null; - state.length -= state.writelen; - state.writelen = 0; -} - -function onwrite(stream, er) { - var state = stream._writableState; - var sync = state.sync; - var cb = state.writecb; - - onwriteStateUpdate(state); - - if (er) onwriteError(stream, state, sync, er, cb);else { - // Check if we're actually ready to finish, but don't emit yet - var finished = needFinish(state); - - if (!finished && !state.corked && !state.bufferProcessing && state.bufferedRequest) { - clearBuffer(stream, state); - } - - if (sync) { - /**/ - asyncWrite(afterWrite, stream, state, finished, cb); - /**/ - } else { - afterWrite(stream, state, finished, cb); - } - } -} - -function afterWrite(stream, state, finished, cb) { - if (!finished) onwriteDrain(stream, state); - state.pendingcb--; - cb(); - finishMaybe(stream, state); -} - -// Must force callback to be called on nextTick, so that we don't -// emit 'drain' before the write() consumer gets the 'false' return -// value, and has a chance to attach a 'drain' listener. -function onwriteDrain(stream, state) { - if (state.length === 0 && state.needDrain) { - state.needDrain = false; - stream.emit('drain'); - } -} - -// if there's something in the buffer waiting, then process it -function clearBuffer(stream, state) { - state.bufferProcessing = true; - var entry = state.bufferedRequest; - - if (stream._writev && entry && entry.next) { - // Fast case, write everything using _writev() - var l = state.bufferedRequestCount; - var buffer = new Array(l); - var holder = state.corkedRequestsFree; - holder.entry = entry; - - var count = 0; - var allBuffers = true; - while (entry) { - buffer[count] = entry; - if (!entry.isBuf) allBuffers = false; - entry = entry.next; - count += 1; - } - buffer.allBuffers = allBuffers; - - doWrite(stream, state, true, state.length, buffer, '', holder.finish); - - // doWrite is almost always async, defer these to save a bit of time - // as the hot path ends with doWrite - state.pendingcb++; - state.lastBufferedRequest = null; - if (holder.next) { - state.corkedRequestsFree = holder.next; - holder.next = null; - } else { - state.corkedRequestsFree = new CorkedRequest(state); - } - state.bufferedRequestCount = 0; - } else { - // Slow case, write chunks one-by-one - while (entry) { - var chunk = entry.chunk; - var encoding = entry.encoding; - var cb = entry.callback; - var len = state.objectMode ? 1 : chunk.length; - - doWrite(stream, state, false, len, chunk, encoding, cb); - entry = entry.next; - state.bufferedRequestCount--; - // if we didn't call the onwrite immediately, then - // it means that we need to wait until it does. - // also, that means that the chunk and cb are currently - // being processed, so move the buffer counter past them. - if (state.writing) { - break; - } - } - - if (entry === null) state.lastBufferedRequest = null; - } - - state.bufferedRequest = entry; - state.bufferProcessing = false; -} - -Writable.prototype._write = function (chunk, encoding, cb) { - cb(new Error('_write() is not implemented')); -}; - -Writable.prototype._writev = null; - -Writable.prototype.end = function (chunk, encoding, cb) { - var state = this._writableState; - - if (typeof chunk === 'function') { - cb = chunk; - chunk = null; - encoding = null; - } else if (typeof encoding === 'function') { - cb = encoding; - encoding = null; - } - - if (chunk !== null && chunk !== undefined) this.write(chunk, encoding); - - // .end() fully uncorks - if (state.corked) { - state.corked = 1; - this.uncork(); - } - - // ignore unnecessary end() calls. - if (!state.ending && !state.finished) endWritable(this, state, cb); -}; - -function needFinish(state) { - return state.ending && state.length === 0 && state.bufferedRequest === null && !state.finished && !state.writing; -} -function callFinal(stream, state) { - stream._final(function (err) { - state.pendingcb--; - if (err) { - stream.emit('error', err); - } - state.prefinished = true; - stream.emit('prefinish'); - finishMaybe(stream, state); - }); -} -function prefinish(stream, state) { - if (!state.prefinished && !state.finalCalled) { - if (typeof stream._final === 'function') { - state.pendingcb++; - state.finalCalled = true; - pna.nextTick(callFinal, stream, state); - } else { - state.prefinished = true; - stream.emit('prefinish'); - } - } -} - -function finishMaybe(stream, state) { - var need = needFinish(state); - if (need) { - prefinish(stream, state); - if (state.pendingcb === 0) { - state.finished = true; - stream.emit('finish'); - } - } - return need; -} - -function endWritable(stream, state, cb) { - state.ending = true; - finishMaybe(stream, state); - if (cb) { - if (state.finished) pna.nextTick(cb);else stream.once('finish', cb); - } - state.ended = true; - stream.writable = false; -} - -function onCorkedFinish(corkReq, state, err) { - var entry = corkReq.entry; - corkReq.entry = null; - while (entry) { - var cb = entry.callback; - state.pendingcb--; - cb(err); - entry = entry.next; - } - if (state.corkedRequestsFree) { - state.corkedRequestsFree.next = corkReq; - } else { - state.corkedRequestsFree = corkReq; - } -} - -Object.defineProperty(Writable.prototype, 'destroyed', { - get: function () { - if (this._writableState === undefined) { - return false; - } - return this._writableState.destroyed; - }, - set: function (value) { - // we ignore the value if the stream - // has not been initialized yet - if (!this._writableState) { - return; - } - - // backward compatibility, the user is explicitly - // managing destroyed - this._writableState.destroyed = value; - } -}); - -Writable.prototype.destroy = destroyImpl.destroy; -Writable.prototype._undestroy = destroyImpl.undestroy; -Writable.prototype._destroy = function (err, cb) { - this.end(); - cb(err); -}; \ No newline at end of file diff --git a/deps/npm/node_modules/flush-write-stream/node_modules/readable-stream/lib/internal/streams/BufferList.js b/deps/npm/node_modules/flush-write-stream/node_modules/readable-stream/lib/internal/streams/BufferList.js deleted file mode 100644 index aefc68bd90b9c2..00000000000000 --- a/deps/npm/node_modules/flush-write-stream/node_modules/readable-stream/lib/internal/streams/BufferList.js +++ /dev/null @@ -1,79 +0,0 @@ -'use strict'; - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -var Buffer = require('safe-buffer').Buffer; -var util = require('util'); - -function copyBuffer(src, target, offset) { - src.copy(target, offset); -} - -module.exports = function () { - function BufferList() { - _classCallCheck(this, BufferList); - - this.head = null; - this.tail = null; - this.length = 0; - } - - BufferList.prototype.push = function push(v) { - var entry = { data: v, next: null }; - if (this.length > 0) this.tail.next = entry;else this.head = entry; - this.tail = entry; - ++this.length; - }; - - BufferList.prototype.unshift = function unshift(v) { - var entry = { data: v, next: this.head }; - if (this.length === 0) this.tail = entry; - this.head = entry; - ++this.length; - }; - - BufferList.prototype.shift = function shift() { - if (this.length === 0) return; - var ret = this.head.data; - if (this.length === 1) this.head = this.tail = null;else this.head = this.head.next; - --this.length; - return ret; - }; - - BufferList.prototype.clear = function clear() { - this.head = this.tail = null; - this.length = 0; - }; - - BufferList.prototype.join = function join(s) { - if (this.length === 0) return ''; - var p = this.head; - var ret = '' + p.data; - while (p = p.next) { - ret += s + p.data; - }return ret; - }; - - BufferList.prototype.concat = function concat(n) { - if (this.length === 0) return Buffer.alloc(0); - if (this.length === 1) return this.head.data; - var ret = Buffer.allocUnsafe(n >>> 0); - var p = this.head; - var i = 0; - while (p) { - copyBuffer(p.data, ret, i); - i += p.data.length; - p = p.next; - } - return ret; - }; - - return BufferList; -}(); - -if (util && util.inspect && util.inspect.custom) { - module.exports.prototype[util.inspect.custom] = function () { - var obj = util.inspect({ length: this.length }); - return this.constructor.name + ' ' + obj; - }; -} \ No newline at end of file diff --git a/deps/npm/node_modules/flush-write-stream/node_modules/readable-stream/lib/internal/streams/destroy.js b/deps/npm/node_modules/flush-write-stream/node_modules/readable-stream/lib/internal/streams/destroy.js deleted file mode 100644 index 5a0a0d88cec6f3..00000000000000 --- a/deps/npm/node_modules/flush-write-stream/node_modules/readable-stream/lib/internal/streams/destroy.js +++ /dev/null @@ -1,74 +0,0 @@ -'use strict'; - -/**/ - -var pna = require('process-nextick-args'); -/**/ - -// undocumented cb() API, needed for core, not for public API -function destroy(err, cb) { - var _this = this; - - var readableDestroyed = this._readableState && this._readableState.destroyed; - var writableDestroyed = this._writableState && this._writableState.destroyed; - - if (readableDestroyed || writableDestroyed) { - if (cb) { - cb(err); - } else if (err && (!this._writableState || !this._writableState.errorEmitted)) { - pna.nextTick(emitErrorNT, this, err); - } - return this; - } - - // we set destroyed to true before firing error callbacks in order - // to make it re-entrance safe in case destroy() is called within callbacks - - if (this._readableState) { - this._readableState.destroyed = true; - } - - // if this is a duplex stream mark the writable part as destroyed as well - if (this._writableState) { - this._writableState.destroyed = true; - } - - this._destroy(err || null, function (err) { - if (!cb && err) { - pna.nextTick(emitErrorNT, _this, err); - if (_this._writableState) { - _this._writableState.errorEmitted = true; - } - } else if (cb) { - cb(err); - } - }); - - return this; -} - -function undestroy() { - if (this._readableState) { - this._readableState.destroyed = false; - this._readableState.reading = false; - this._readableState.ended = false; - this._readableState.endEmitted = false; - } - - if (this._writableState) { - this._writableState.destroyed = false; - this._writableState.ended = false; - this._writableState.ending = false; - this._writableState.finished = false; - this._writableState.errorEmitted = false; - } -} - -function emitErrorNT(self, err) { - self.emit('error', err); -} - -module.exports = { - destroy: destroy, - undestroy: undestroy -}; \ No newline at end of file diff --git a/deps/npm/node_modules/flush-write-stream/node_modules/readable-stream/lib/internal/streams/stream-browser.js b/deps/npm/node_modules/flush-write-stream/node_modules/readable-stream/lib/internal/streams/stream-browser.js deleted file mode 100644 index 9332a3fdae7060..00000000000000 --- a/deps/npm/node_modules/flush-write-stream/node_modules/readable-stream/lib/internal/streams/stream-browser.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('events').EventEmitter; diff --git a/deps/npm/node_modules/flush-write-stream/node_modules/readable-stream/lib/internal/streams/stream.js b/deps/npm/node_modules/flush-write-stream/node_modules/readable-stream/lib/internal/streams/stream.js deleted file mode 100644 index ce2ad5b6ee57f4..00000000000000 --- a/deps/npm/node_modules/flush-write-stream/node_modules/readable-stream/lib/internal/streams/stream.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('stream'); diff --git a/deps/npm/node_modules/flush-write-stream/node_modules/readable-stream/package.json b/deps/npm/node_modules/flush-write-stream/node_modules/readable-stream/package.json deleted file mode 100644 index d6f84bde6b982b..00000000000000 --- a/deps/npm/node_modules/flush-write-stream/node_modules/readable-stream/package.json +++ /dev/null @@ -1,81 +0,0 @@ -{ - "_from": "readable-stream@^2.0.4", - "_id": "readable-stream@2.3.6", - "_inBundle": false, - "_integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", - "_location": "/flush-write-stream/readable-stream", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "readable-stream@^2.0.4", - "name": "readable-stream", - "escapedName": "readable-stream", - "rawSpec": "^2.0.4", - "saveSpec": null, - "fetchSpec": "^2.0.4" - }, - "_requiredBy": [ - "/flush-write-stream" - ], - "_resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", - "_shasum": "b11c27d88b8ff1fbe070643cf94b0c79ae1b0aaf", - "_spec": "readable-stream@^2.0.4", - "_where": "/Users/aeschright/code/cli/node_modules/flush-write-stream", - "browser": { - "util": false, - "./readable.js": "./readable-browser.js", - "./writable.js": "./writable-browser.js", - "./duplex.js": "./duplex-browser.js", - "./lib/internal/streams/stream.js": "./lib/internal/streams/stream-browser.js" - }, - "bugs": { - "url": "https://github.com/nodejs/readable-stream/issues" - }, - "bundleDependencies": false, - "dependencies": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - }, - "deprecated": false, - "description": "Streams3, a user-land copy of the stream library from Node.js", - "devDependencies": { - "assert": "^1.4.0", - "babel-polyfill": "^6.9.1", - "buffer": "^4.9.0", - "lolex": "^2.3.2", - "nyc": "^6.4.0", - "tap": "^0.7.0", - "tape": "^4.8.0" - }, - "homepage": "https://github.com/nodejs/readable-stream#readme", - "keywords": [ - "readable", - "stream", - "pipe" - ], - "license": "MIT", - "main": "readable.js", - "name": "readable-stream", - "nyc": { - "include": [ - "lib/**.js" - ] - }, - "repository": { - "type": "git", - "url": "git://github.com/nodejs/readable-stream.git" - }, - "scripts": { - "ci": "tap test/parallel/*.js test/ours/*.js --tap | tee test.tap && node test/verify-dependencies.js", - "cover": "nyc npm test", - "report": "nyc report --reporter=lcov", - "test": "tap test/parallel/*.js test/ours/*.js && node test/verify-dependencies.js" - }, - "version": "2.3.6" -} diff --git a/deps/npm/node_modules/flush-write-stream/node_modules/readable-stream/passthrough.js b/deps/npm/node_modules/flush-write-stream/node_modules/readable-stream/passthrough.js deleted file mode 100644 index ffd791d7ff275a..00000000000000 --- a/deps/npm/node_modules/flush-write-stream/node_modules/readable-stream/passthrough.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./readable').PassThrough diff --git a/deps/npm/node_modules/flush-write-stream/node_modules/readable-stream/readable-browser.js b/deps/npm/node_modules/flush-write-stream/node_modules/readable-stream/readable-browser.js deleted file mode 100644 index e50372592ee6c6..00000000000000 --- a/deps/npm/node_modules/flush-write-stream/node_modules/readable-stream/readable-browser.js +++ /dev/null @@ -1,7 +0,0 @@ -exports = module.exports = require('./lib/_stream_readable.js'); -exports.Stream = exports; -exports.Readable = exports; -exports.Writable = require('./lib/_stream_writable.js'); -exports.Duplex = require('./lib/_stream_duplex.js'); -exports.Transform = require('./lib/_stream_transform.js'); -exports.PassThrough = require('./lib/_stream_passthrough.js'); diff --git a/deps/npm/node_modules/flush-write-stream/node_modules/readable-stream/readable.js b/deps/npm/node_modules/flush-write-stream/node_modules/readable-stream/readable.js deleted file mode 100644 index ec89ec53306497..00000000000000 --- a/deps/npm/node_modules/flush-write-stream/node_modules/readable-stream/readable.js +++ /dev/null @@ -1,19 +0,0 @@ -var Stream = require('stream'); -if (process.env.READABLE_STREAM === 'disable' && Stream) { - module.exports = Stream; - exports = module.exports = Stream.Readable; - exports.Readable = Stream.Readable; - exports.Writable = Stream.Writable; - exports.Duplex = Stream.Duplex; - exports.Transform = Stream.Transform; - exports.PassThrough = Stream.PassThrough; - exports.Stream = Stream; -} else { - exports = module.exports = require('./lib/_stream_readable.js'); - exports.Stream = Stream || exports; - exports.Readable = exports; - exports.Writable = require('./lib/_stream_writable.js'); - exports.Duplex = require('./lib/_stream_duplex.js'); - exports.Transform = require('./lib/_stream_transform.js'); - exports.PassThrough = require('./lib/_stream_passthrough.js'); -} diff --git a/deps/npm/node_modules/flush-write-stream/node_modules/readable-stream/transform.js b/deps/npm/node_modules/flush-write-stream/node_modules/readable-stream/transform.js deleted file mode 100644 index b1baba26da03dc..00000000000000 --- a/deps/npm/node_modules/flush-write-stream/node_modules/readable-stream/transform.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./readable').Transform diff --git a/deps/npm/node_modules/flush-write-stream/node_modules/readable-stream/writable-browser.js b/deps/npm/node_modules/flush-write-stream/node_modules/readable-stream/writable-browser.js deleted file mode 100644 index ebdde6a85dcb19..00000000000000 --- a/deps/npm/node_modules/flush-write-stream/node_modules/readable-stream/writable-browser.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./lib/_stream_writable.js'); diff --git a/deps/npm/node_modules/flush-write-stream/node_modules/readable-stream/writable.js b/deps/npm/node_modules/flush-write-stream/node_modules/readable-stream/writable.js deleted file mode 100644 index 3211a6f80d1abc..00000000000000 --- a/deps/npm/node_modules/flush-write-stream/node_modules/readable-stream/writable.js +++ /dev/null @@ -1,8 +0,0 @@ -var Stream = require("stream") -var Writable = require("./lib/_stream_writable.js") - -if (process.env.READABLE_STREAM === 'disable') { - module.exports = Stream && Stream.Writable || Writable -} else { - module.exports = Writable -} diff --git a/deps/npm/node_modules/flush-write-stream/node_modules/string_decoder/.travis.yml b/deps/npm/node_modules/flush-write-stream/node_modules/string_decoder/.travis.yml deleted file mode 100644 index 3347a725465058..00000000000000 --- a/deps/npm/node_modules/flush-write-stream/node_modules/string_decoder/.travis.yml +++ /dev/null @@ -1,50 +0,0 @@ -sudo: false -language: node_js -before_install: - - npm install -g npm@2 - - test $NPM_LEGACY && npm install -g npm@latest-3 || npm install npm -g -notifications: - email: false -matrix: - fast_finish: true - include: - - node_js: '0.8' - env: - - TASK=test - - NPM_LEGACY=true - - node_js: '0.10' - env: - - TASK=test - - NPM_LEGACY=true - - node_js: '0.11' - env: - - TASK=test - - NPM_LEGACY=true - - node_js: '0.12' - env: - - TASK=test - - NPM_LEGACY=true - - node_js: 1 - env: - - TASK=test - - NPM_LEGACY=true - - node_js: 2 - env: - - TASK=test - - NPM_LEGACY=true - - node_js: 3 - env: - - TASK=test - - NPM_LEGACY=true - - node_js: 4 - env: TASK=test - - node_js: 5 - env: TASK=test - - node_js: 6 - env: TASK=test - - node_js: 7 - env: TASK=test - - node_js: 8 - env: TASK=test - - node_js: 9 - env: TASK=test diff --git a/deps/npm/node_modules/flush-write-stream/node_modules/string_decoder/LICENSE b/deps/npm/node_modules/flush-write-stream/node_modules/string_decoder/LICENSE deleted file mode 100644 index 778edb20730ef4..00000000000000 --- a/deps/npm/node_modules/flush-write-stream/node_modules/string_decoder/LICENSE +++ /dev/null @@ -1,48 +0,0 @@ -Node.js is licensed for use as follows: - -""" -Copyright Node.js contributors. All rights reserved. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to -deal in the Software without restriction, including without limitation the -rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -sell copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -IN THE SOFTWARE. -""" - -This license applies to parts of Node.js originating from the -https://github.com/joyent/node repository: - -""" -Copyright Joyent, Inc. and other Node contributors. All rights reserved. -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to -deal in the Software without restriction, including without limitation the -rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -sell copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -IN THE SOFTWARE. -""" - diff --git a/deps/npm/node_modules/flush-write-stream/node_modules/string_decoder/README.md b/deps/npm/node_modules/flush-write-stream/node_modules/string_decoder/README.md deleted file mode 100644 index 5fd58315ed5880..00000000000000 --- a/deps/npm/node_modules/flush-write-stream/node_modules/string_decoder/README.md +++ /dev/null @@ -1,47 +0,0 @@ -# string_decoder - -***Node-core v8.9.4 string_decoder for userland*** - - -[![NPM](https://nodei.co/npm/string_decoder.png?downloads=true&downloadRank=true)](https://nodei.co/npm/string_decoder/) -[![NPM](https://nodei.co/npm-dl/string_decoder.png?&months=6&height=3)](https://nodei.co/npm/string_decoder/) - - -```bash -npm install --save string_decoder -``` - -***Node-core string_decoder for userland*** - -This package is a mirror of the string_decoder implementation in Node-core. - -Full documentation may be found on the [Node.js website](https://nodejs.org/dist/v8.9.4/docs/api/). - -As of version 1.0.0 **string_decoder** uses semantic versioning. - -## Previous versions - -Previous version numbers match the versions found in Node core, e.g. 0.10.24 matches Node 0.10.24, likewise 0.11.10 matches Node 0.11.10. - -## Update - -The *build/* directory contains a build script that will scrape the source from the [nodejs/node](https://github.com/nodejs/node) repo given a specific Node version. - -## Streams Working Group - -`string_decoder` is maintained by the Streams Working Group, which -oversees the development and maintenance of the Streams API within -Node.js. The responsibilities of the Streams Working Group include: - -* Addressing stream issues on the Node.js issue tracker. -* Authoring and editing stream documentation within the Node.js project. -* Reviewing changes to stream subclasses within the Node.js project. -* Redirecting changes to streams from the Node.js project to this - project. -* Assisting in the implementation of stream providers within Node.js. -* Recommending versions of `readable-stream` to be included in Node.js. -* Messaging about the future of streams to give the community advance - notice of changes. - -See [readable-stream](https://github.com/nodejs/readable-stream) for -more details. diff --git a/deps/npm/node_modules/flush-write-stream/node_modules/string_decoder/lib/string_decoder.js b/deps/npm/node_modules/flush-write-stream/node_modules/string_decoder/lib/string_decoder.js deleted file mode 100644 index 2e89e63f7933e4..00000000000000 --- a/deps/npm/node_modules/flush-write-stream/node_modules/string_decoder/lib/string_decoder.js +++ /dev/null @@ -1,296 +0,0 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - -'use strict'; - -/**/ - -var Buffer = require('safe-buffer').Buffer; -/**/ - -var isEncoding = Buffer.isEncoding || function (encoding) { - encoding = '' + encoding; - switch (encoding && encoding.toLowerCase()) { - case 'hex':case 'utf8':case 'utf-8':case 'ascii':case 'binary':case 'base64':case 'ucs2':case 'ucs-2':case 'utf16le':case 'utf-16le':case 'raw': - return true; - default: - return false; - } -}; - -function _normalizeEncoding(enc) { - if (!enc) return 'utf8'; - var retried; - while (true) { - switch (enc) { - case 'utf8': - case 'utf-8': - return 'utf8'; - case 'ucs2': - case 'ucs-2': - case 'utf16le': - case 'utf-16le': - return 'utf16le'; - case 'latin1': - case 'binary': - return 'latin1'; - case 'base64': - case 'ascii': - case 'hex': - return enc; - default: - if (retried) return; // undefined - enc = ('' + enc).toLowerCase(); - retried = true; - } - } -}; - -// Do not cache `Buffer.isEncoding` when checking encoding names as some -// modules monkey-patch it to support additional encodings -function normalizeEncoding(enc) { - var nenc = _normalizeEncoding(enc); - if (typeof nenc !== 'string' && (Buffer.isEncoding === isEncoding || !isEncoding(enc))) throw new Error('Unknown encoding: ' + enc); - return nenc || enc; -} - -// StringDecoder provides an interface for efficiently splitting a series of -// buffers into a series of JS strings without breaking apart multi-byte -// characters. -exports.StringDecoder = StringDecoder; -function StringDecoder(encoding) { - this.encoding = normalizeEncoding(encoding); - var nb; - switch (this.encoding) { - case 'utf16le': - this.text = utf16Text; - this.end = utf16End; - nb = 4; - break; - case 'utf8': - this.fillLast = utf8FillLast; - nb = 4; - break; - case 'base64': - this.text = base64Text; - this.end = base64End; - nb = 3; - break; - default: - this.write = simpleWrite; - this.end = simpleEnd; - return; - } - this.lastNeed = 0; - this.lastTotal = 0; - this.lastChar = Buffer.allocUnsafe(nb); -} - -StringDecoder.prototype.write = function (buf) { - if (buf.length === 0) return ''; - var r; - var i; - if (this.lastNeed) { - r = this.fillLast(buf); - if (r === undefined) return ''; - i = this.lastNeed; - this.lastNeed = 0; - } else { - i = 0; - } - if (i < buf.length) return r ? r + this.text(buf, i) : this.text(buf, i); - return r || ''; -}; - -StringDecoder.prototype.end = utf8End; - -// Returns only complete characters in a Buffer -StringDecoder.prototype.text = utf8Text; - -// Attempts to complete a partial non-UTF-8 character using bytes from a Buffer -StringDecoder.prototype.fillLast = function (buf) { - if (this.lastNeed <= buf.length) { - buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, this.lastNeed); - return this.lastChar.toString(this.encoding, 0, this.lastTotal); - } - buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, buf.length); - this.lastNeed -= buf.length; -}; - -// Checks the type of a UTF-8 byte, whether it's ASCII, a leading byte, or a -// continuation byte. If an invalid byte is detected, -2 is returned. -function utf8CheckByte(byte) { - if (byte <= 0x7F) return 0;else if (byte >> 5 === 0x06) return 2;else if (byte >> 4 === 0x0E) return 3;else if (byte >> 3 === 0x1E) return 4; - return byte >> 6 === 0x02 ? -1 : -2; -} - -// Checks at most 3 bytes at the end of a Buffer in order to detect an -// incomplete multi-byte UTF-8 character. The total number of bytes (2, 3, or 4) -// needed to complete the UTF-8 character (if applicable) are returned. -function utf8CheckIncomplete(self, buf, i) { - var j = buf.length - 1; - if (j < i) return 0; - var nb = utf8CheckByte(buf[j]); - if (nb >= 0) { - if (nb > 0) self.lastNeed = nb - 1; - return nb; - } - if (--j < i || nb === -2) return 0; - nb = utf8CheckByte(buf[j]); - if (nb >= 0) { - if (nb > 0) self.lastNeed = nb - 2; - return nb; - } - if (--j < i || nb === -2) return 0; - nb = utf8CheckByte(buf[j]); - if (nb >= 0) { - if (nb > 0) { - if (nb === 2) nb = 0;else self.lastNeed = nb - 3; - } - return nb; - } - return 0; -} - -// Validates as many continuation bytes for a multi-byte UTF-8 character as -// needed or are available. If we see a non-continuation byte where we expect -// one, we "replace" the validated continuation bytes we've seen so far with -// a single UTF-8 replacement character ('\ufffd'), to match v8's UTF-8 decoding -// behavior. The continuation byte check is included three times in the case -// where all of the continuation bytes for a character exist in the same buffer. -// It is also done this way as a slight performance increase instead of using a -// loop. -function utf8CheckExtraBytes(self, buf, p) { - if ((buf[0] & 0xC0) !== 0x80) { - self.lastNeed = 0; - return '\ufffd'; - } - if (self.lastNeed > 1 && buf.length > 1) { - if ((buf[1] & 0xC0) !== 0x80) { - self.lastNeed = 1; - return '\ufffd'; - } - if (self.lastNeed > 2 && buf.length > 2) { - if ((buf[2] & 0xC0) !== 0x80) { - self.lastNeed = 2; - return '\ufffd'; - } - } - } -} - -// Attempts to complete a multi-byte UTF-8 character using bytes from a Buffer. -function utf8FillLast(buf) { - var p = this.lastTotal - this.lastNeed; - var r = utf8CheckExtraBytes(this, buf, p); - if (r !== undefined) return r; - if (this.lastNeed <= buf.length) { - buf.copy(this.lastChar, p, 0, this.lastNeed); - return this.lastChar.toString(this.encoding, 0, this.lastTotal); - } - buf.copy(this.lastChar, p, 0, buf.length); - this.lastNeed -= buf.length; -} - -// Returns all complete UTF-8 characters in a Buffer. If the Buffer ended on a -// partial character, the character's bytes are buffered until the required -// number of bytes are available. -function utf8Text(buf, i) { - var total = utf8CheckIncomplete(this, buf, i); - if (!this.lastNeed) return buf.toString('utf8', i); - this.lastTotal = total; - var end = buf.length - (total - this.lastNeed); - buf.copy(this.lastChar, 0, end); - return buf.toString('utf8', i, end); -} - -// For UTF-8, a replacement character is added when ending on a partial -// character. -function utf8End(buf) { - var r = buf && buf.length ? this.write(buf) : ''; - if (this.lastNeed) return r + '\ufffd'; - return r; -} - -// UTF-16LE typically needs two bytes per character, but even if we have an even -// number of bytes available, we need to check if we end on a leading/high -// surrogate. In that case, we need to wait for the next two bytes in order to -// decode the last character properly. -function utf16Text(buf, i) { - if ((buf.length - i) % 2 === 0) { - var r = buf.toString('utf16le', i); - if (r) { - var c = r.charCodeAt(r.length - 1); - if (c >= 0xD800 && c <= 0xDBFF) { - this.lastNeed = 2; - this.lastTotal = 4; - this.lastChar[0] = buf[buf.length - 2]; - this.lastChar[1] = buf[buf.length - 1]; - return r.slice(0, -1); - } - } - return r; - } - this.lastNeed = 1; - this.lastTotal = 2; - this.lastChar[0] = buf[buf.length - 1]; - return buf.toString('utf16le', i, buf.length - 1); -} - -// For UTF-16LE we do not explicitly append special replacement characters if we -// end on a partial character, we simply let v8 handle that. -function utf16End(buf) { - var r = buf && buf.length ? this.write(buf) : ''; - if (this.lastNeed) { - var end = this.lastTotal - this.lastNeed; - return r + this.lastChar.toString('utf16le', 0, end); - } - return r; -} - -function base64Text(buf, i) { - var n = (buf.length - i) % 3; - if (n === 0) return buf.toString('base64', i); - this.lastNeed = 3 - n; - this.lastTotal = 3; - if (n === 1) { - this.lastChar[0] = buf[buf.length - 1]; - } else { - this.lastChar[0] = buf[buf.length - 2]; - this.lastChar[1] = buf[buf.length - 1]; - } - return buf.toString('base64', i, buf.length - n); -} - -function base64End(buf) { - var r = buf && buf.length ? this.write(buf) : ''; - if (this.lastNeed) return r + this.lastChar.toString('base64', 0, 3 - this.lastNeed); - return r; -} - -// Pass bytes on through for single-byte encodings (e.g. ascii, latin1, hex) -function simpleWrite(buf) { - return buf.toString(this.encoding); -} - -function simpleEnd(buf) { - return buf && buf.length ? this.write(buf) : ''; -} \ No newline at end of file diff --git a/deps/npm/node_modules/flush-write-stream/node_modules/string_decoder/package.json b/deps/npm/node_modules/flush-write-stream/node_modules/string_decoder/package.json deleted file mode 100644 index 56012b0108109e..00000000000000 --- a/deps/npm/node_modules/flush-write-stream/node_modules/string_decoder/package.json +++ /dev/null @@ -1,59 +0,0 @@ -{ - "_from": "string_decoder@~1.1.1", - "_id": "string_decoder@1.1.1", - "_inBundle": false, - "_integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "_location": "/flush-write-stream/string_decoder", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "string_decoder@~1.1.1", - "name": "string_decoder", - "escapedName": "string_decoder", - "rawSpec": "~1.1.1", - "saveSpec": null, - "fetchSpec": "~1.1.1" - }, - "_requiredBy": [ - "/flush-write-stream/readable-stream" - ], - "_resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "_shasum": "9cf1611ba62685d7030ae9e4ba34149c3af03fc8", - "_spec": "string_decoder@~1.1.1", - "_where": "/Users/aeschright/code/cli/node_modules/flush-write-stream/node_modules/readable-stream", - "bugs": { - "url": "https://github.com/nodejs/string_decoder/issues" - }, - "bundleDependencies": false, - "dependencies": { - "safe-buffer": "~5.1.0" - }, - "deprecated": false, - "description": "The string_decoder module from Node core", - "devDependencies": { - "babel-polyfill": "^6.23.0", - "core-util-is": "^1.0.2", - "inherits": "^2.0.3", - "tap": "~0.4.8" - }, - "homepage": "https://github.com/nodejs/string_decoder", - "keywords": [ - "string", - "decoder", - "browser", - "browserify" - ], - "license": "MIT", - "main": "lib/string_decoder.js", - "name": "string_decoder", - "repository": { - "type": "git", - "url": "git://github.com/nodejs/string_decoder.git" - }, - "scripts": { - "ci": "tap test/parallel/*.js test/ours/*.js --tap | tee test.tap && node test/verify-dependencies.js", - "test": "tap test/parallel/*.js && node test/verify-dependencies" - }, - "version": "1.1.1" -} diff --git a/deps/npm/node_modules/flush-write-stream/package.json b/deps/npm/node_modules/flush-write-stream/package.json deleted file mode 100644 index 408f39da35ad28..00000000000000 --- a/deps/npm/node_modules/flush-write-stream/package.json +++ /dev/null @@ -1,57 +0,0 @@ -{ - "_from": "flush-write-stream@^1.0.0", - "_id": "flush-write-stream@1.0.3", - "_inBundle": false, - "_integrity": "sha512-calZMC10u0FMUqoiunI2AiGIIUtUIvifNwkHhNupZH4cbNnW1Itkoh/Nf5HFYmDrwWPjrUxpkZT0KhuCq0jmGw==", - "_location": "/flush-write-stream", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "flush-write-stream@^1.0.0", - "name": "flush-write-stream", - "escapedName": "flush-write-stream", - "rawSpec": "^1.0.0", - "saveSpec": null, - "fetchSpec": "^1.0.0" - }, - "_requiredBy": [ - "/mississippi", - "/npm-profile/cacache/mississippi", - "/npm-profile/mississippi", - "/npm-registry-fetch/cacache/mississippi" - ], - "_resolved": "https://registry.npmjs.org/flush-write-stream/-/flush-write-stream-1.0.3.tgz", - "_shasum": "c5d586ef38af6097650b49bc41b55fabb19f35bd", - "_spec": "flush-write-stream@^1.0.0", - "_where": "/Users/rebecca/code/npm/node_modules/mississippi", - "author": { - "name": "Mathias Buus", - "url": "@mafintosh" - }, - "bugs": { - "url": "https://github.com/mafintosh/flush-write-stream/issues" - }, - "bundleDependencies": false, - "dependencies": { - "inherits": "^2.0.1", - "readable-stream": "^2.0.4" - }, - "deprecated": false, - "description": "A write stream constructor that supports a flush function that is called before finish is emitted", - "devDependencies": { - "tape": "^4.2.2" - }, - "homepage": "https://github.com/mafintosh/flush-write-stream", - "license": "MIT", - "main": "index.js", - "name": "flush-write-stream", - "repository": { - "type": "git", - "url": "git+https://github.com/mafintosh/flush-write-stream.git" - }, - "scripts": { - "test": "tape test.js" - }, - "version": "1.0.3" -} diff --git a/deps/npm/node_modules/flush-write-stream/test.js b/deps/npm/node_modules/flush-write-stream/test.js deleted file mode 100644 index 6cd0c20e1f795a..00000000000000 --- a/deps/npm/node_modules/flush-write-stream/test.js +++ /dev/null @@ -1,85 +0,0 @@ -var tape = require('tape') -var writer = require('./') - -tape('is a write stream', function (t) { - var expected = ['hello', 'world', 'verden'] - var ws = writer.obj(write) - - ws.write('hello') - ws.write('world') - ws.write('verden') - ws.end(function () { - t.same(expected.length, 0) - t.end() - }) - - function write (data, enc, cb) { - t.same(data, expected.shift()) - cb() - } -}) - -tape('is flushable', function (t) { - var expected = ['hello', 'world', 'verden'] - var flushed = false - - var ws = writer.obj(write, flush) - - ws.write('hello') - ws.write('world') - ws.write('verden') - ws.end(function () { - t.same(expected.length, 0) - t.ok(flushed, 'was flushed') - t.end() - }) - - function write (data, enc, cb) { - t.same(data, expected.shift()) - cb() - } - - function flush (cb) { - flushed = true - process.nextTick(cb) - } -}) - -tape('can pass options', function (t) { - var expected = ['hello', 'world', 'verden'] - var flushed = false - - var ws = writer({objectMode: true}, write, flush) - - ws.write('hello') - ws.write('world') - ws.write('verden') - ws.end(function () { - t.same(expected.length, 0) - t.ok(flushed, 'was flushed') - t.end() - }) - - function write (data, enc, cb) { - t.same(data, expected.shift()) - cb() - } - - function flush (cb) { - flushed = true - process.nextTick(cb) - } -}) - -tape('emits error on destroy', function (t) { - var expected = new Error() - - var ws = writer({objectMode: true}, function () {}) - - ws.on('error', function (err) { - t.equal(err, expected) - }) - ws.on('close', t.end) - - ws.destroy(expected) -}) diff --git a/deps/npm/node_modules/forever-agent/package.json b/deps/npm/node_modules/forever-agent/package.json index e338b5721cfd49..f76062980324bf 100644 --- a/deps/npm/node_modules/forever-agent/package.json +++ b/deps/npm/node_modules/forever-agent/package.json @@ -1,50 +1,17 @@ { - "_from": "forever-agent@~0.6.1", - "_id": "forever-agent@0.6.1", - "_inBundle": false, - "_integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=", - "_location": "/forever-agent", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "forever-agent@~0.6.1", - "name": "forever-agent", - "escapedName": "forever-agent", - "rawSpec": "~0.6.1", - "saveSpec": null, - "fetchSpec": "~0.6.1" - }, - "_requiredBy": [ - "/request" - ], - "_resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", - "_shasum": "fbc71f0c41adeb37f96c577ad1ed42d8fdacca91", - "_spec": "forever-agent@~0.6.1", - "_where": "/Users/rebecca/code/npm/node_modules/request", - "author": { - "name": "Mikeal Rogers", - "email": "mikeal.rogers@gmail.com", - "url": "http://www.futurealoof.com" - }, - "bugs": { - "url": "https://github.com/mikeal/forever-agent/issues" + "author": "Mikeal Rogers (http://www.futurealoof.com)", + "name": "forever-agent", + "description": "HTTP Agent that keeps socket connections alive between keep-alive requests. Formerly part of mikeal/request, now a standalone module.", + "version": "0.6.1", + "license": "Apache-2.0", + "repository": { + "url": "https://github.com/mikeal/forever-agent" }, - "bundleDependencies": false, + "main": "index.js", "dependencies": {}, - "deprecated": false, - "description": "HTTP Agent that keeps socket connections alive between keep-alive requests. Formerly part of mikeal/request, now a standalone module.", "devDependencies": {}, + "optionalDependencies": {}, "engines": { "node": "*" - }, - "homepage": "https://github.com/mikeal/forever-agent#readme", - "license": "Apache-2.0", - "main": "index.js", - "name": "forever-agent", - "optionalDependencies": {}, - "repository": { - "url": "git+https://github.com/mikeal/forever-agent.git" - }, - "version": "0.6.1" + } } diff --git a/deps/npm/node_modules/form-data/README.md b/deps/npm/node_modules/form-data/README.md index cb421fbb40fdd6..d7809364fba882 100644 --- a/deps/npm/node_modules/form-data/README.md +++ b/deps/npm/node_modules/form-data/README.md @@ -6,11 +6,11 @@ The API of this library is inspired by the [XMLHttpRequest-2 FormData Interface] [xhr2-fd]: http://dev.w3.org/2006/webapi/XMLHttpRequest-2/Overview.html#the-formdata-interface -[![Linux Build](https://img.shields.io/travis/form-data/form-data/v2.3.2.svg?label=linux:4.x-9.x)](https://travis-ci.org/form-data/form-data) -[![MacOS Build](https://img.shields.io/travis/form-data/form-data/v2.3.2.svg?label=macos:4.x-9.x)](https://travis-ci.org/form-data/form-data) -[![Windows Build](https://img.shields.io/appveyor/ci/alexindigo/form-data/v2.3.2.svg?label=windows:4.x-9.x)](https://ci.appveyor.com/project/alexindigo/form-data) +[![Linux Build](https://img.shields.io/travis/form-data/form-data/v2.3.3.svg?label=linux:4.x-9.x)](https://travis-ci.org/form-data/form-data) +[![MacOS Build](https://img.shields.io/travis/form-data/form-data/v2.3.3.svg?label=macos:4.x-9.x)](https://travis-ci.org/form-data/form-data) +[![Windows Build](https://img.shields.io/appveyor/ci/alexindigo/form-data/v2.3.3.svg?label=windows:4.x-9.x)](https://ci.appveyor.com/project/alexindigo/form-data) -[![Coverage Status](https://img.shields.io/coveralls/form-data/form-data/v2.3.2.svg?label=code+coverage)](https://coveralls.io/github/form-data/form-data?branch=master) +[![Coverage Status](https://img.shields.io/coveralls/form-data/form-data/v2.3.3.svg?label=code+coverage)](https://coveralls.io/github/form-data/form-data?branch=master) [![Dependency Status](https://img.shields.io/david/form-data/form-data.svg)](https://david-dm.org/form-data/form-data) [![bitHound Overall Score](https://www.bithound.io/github/form-data/form-data/badges/score.svg)](https://www.bithound.io/github/form-data/form-data) diff --git a/deps/npm/node_modules/form-data/package.json b/deps/npm/node_modules/form-data/package.json index 9f2e8f891e196b..adacbae78f2531 100644 --- a/deps/npm/node_modules/form-data/package.json +++ b/deps/npm/node_modules/form-data/package.json @@ -1,44 +1,46 @@ { - "_from": "form-data@~2.3.1", - "_id": "form-data@2.3.2", - "_inBundle": false, - "_integrity": "sha1-SXBJi+YEwgwAXU9cI67NIda0kJk=", - "_location": "/form-data", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "form-data@~2.3.1", - "name": "form-data", - "escapedName": "form-data", - "rawSpec": "~2.3.1", - "saveSpec": null, - "fetchSpec": "~2.3.1" - }, - "_requiredBy": [ - "/request" - ], - "_resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.2.tgz", - "_shasum": "4970498be604c20c005d4f5c23aecd21d6b49099", - "_spec": "form-data@~2.3.1", - "_where": "/Users/zkat/Documents/code/work/npm/node_modules/request", - "author": { - "name": "Felix Geisendörfer", - "email": "felix@debuggable.com", - "url": "http://debuggable.com/" + "author": "Felix Geisendörfer (http://debuggable.com/)", + "name": "form-data", + "description": "A library to create readable \"multipart/form-data\" streams. Can be used to submit forms and file uploads to other web applications.", + "version": "2.3.3", + "repository": { + "type": "git", + "url": "git://github.com/form-data/form-data.git" }, + "main": "./lib/form_data", "browser": "./lib/browser", - "bugs": { - "url": "https://github.com/form-data/form-data/issues" + "scripts": { + "pretest": "rimraf coverage test/tmp", + "test": "istanbul cover test/run.js", + "posttest": "istanbul report lcov text", + "lint": "eslint lib/*.js test/*.js test/integration/*.js", + "report": "istanbul report lcov text", + "ci-lint": "is-node-modern 6 && npm run lint || is-node-not-modern 6", + "ci-test": "npm run test && npm run browser && npm run report", + "predebug": "rimraf coverage test/tmp", + "debug": "verbose=1 ./test/run.js", + "browser": "browserify -t browserify-istanbul test/run-browser.js | obake --coverage", + "check": "istanbul check-coverage coverage/coverage*.json", + "files": "pkgfiles --sort=name", + "get-version": "node -e \"console.log(require('./package.json').version)\"", + "update-readme": "sed -i.bak 's/\\/master\\.svg/\\/v'$(npm --silent run get-version)'.svg/g' README.md", + "restore-readme": "mv README.md.bak README.md", + "prepublish": "in-publish && npm run update-readme || not-in-publish", + "postpublish": "npm run restore-readme" + }, + "pre-commit": [ + "lint", + "ci-test", + "check" + ], + "engines": { + "node": ">= 0.12" }, - "bundleDependencies": false, "dependencies": { "asynckit": "^0.4.0", - "combined-stream": "1.0.6", + "combined-stream": "^1.0.6", "mime-types": "^2.1.12" }, - "deprecated": false, - "description": "A library to create readable \"multipart/form-data\" streams. Can be used to submit forms and file uploads to other web applications.", "devDependencies": { "browserify": "^13.1.1", "browserify-istanbul": "^2.0.0", @@ -59,40 +61,5 @@ "rimraf": "^2.5.4", "tape": "^4.6.2" }, - "engines": { - "node": ">= 0.12" - }, - "homepage": "https://github.com/form-data/form-data#readme", - "license": "MIT", - "main": "./lib/form_data", - "name": "form-data", - "pre-commit": [ - "lint", - "ci-test", - "check" - ], - "repository": { - "type": "git", - "url": "git://github.com/form-data/form-data.git" - }, - "scripts": { - "browser": "browserify -t browserify-istanbul test/run-browser.js | obake --coverage", - "check": "istanbul check-coverage coverage/coverage*.json", - "ci-lint": "is-node-modern 6 && npm run lint || is-node-not-modern 6", - "ci-test": "npm run test && npm run browser && npm run report", - "debug": "verbose=1 ./test/run.js", - "files": "pkgfiles --sort=name", - "get-version": "node -e \"console.log(require('./package.json').version)\"", - "lint": "eslint lib/*.js test/*.js test/integration/*.js", - "postpublish": "npm run restore-readme", - "posttest": "istanbul report lcov text", - "predebug": "rimraf coverage test/tmp", - "prepublish": "in-publish && npm run update-readme || not-in-publish", - "pretest": "rimraf coverage test/tmp", - "report": "istanbul report lcov text", - "restore-readme": "mv README.md.bak README.md", - "test": "istanbul cover test/run.js", - "update-readme": "sed -i.bak 's/\\/master\\.svg/\\/v'$(npm --silent run get-version)'.svg/g' README.md" - }, - "version": "2.3.2" + "license": "MIT" } diff --git a/deps/npm/node_modules/form-data/yarn.lock b/deps/npm/node_modules/form-data/yarn.lock new file mode 100644 index 00000000000000..ab55059c10eb8c --- /dev/null +++ b/deps/npm/node_modules/form-data/yarn.lock @@ -0,0 +1,2662 @@ +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. +# yarn lockfile v1 + + +JSONStream@^1.0.3: + version "1.3.2" + resolved "https://registry.yarnpkg.com/JSONStream/-/JSONStream-1.3.2.tgz#c102371b6ec3a7cf3b847ca00c20bb0fce4c6dea" + dependencies: + jsonparse "^1.2.0" + through ">=2.2.7 <3" + +abbrev@1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/abbrev/-/abbrev-1.1.1.tgz#f8f2c887ad10bf67f634f005b6987fed3179aac8" + +abbrev@1.0.x: + version "1.0.9" + resolved "https://registry.yarnpkg.com/abbrev/-/abbrev-1.0.9.tgz#91b4792588a7738c25f35dd6f63752a2f8776135" + +acorn-jsx@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-3.0.1.tgz#afdf9488fb1ecefc8348f6fb22f464e32a58b36b" + dependencies: + acorn "^3.0.4" + +acorn-node@^1.2.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/acorn-node/-/acorn-node-1.3.0.tgz#5f86d73346743810ef1269b901dbcbded020861b" + dependencies: + acorn "^5.4.1" + xtend "^4.0.1" + +acorn@^3.0.4: + version "3.3.0" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-3.3.0.tgz#45e37fb39e8da3f25baee3ff5369e2bb5f22017a" + +acorn@^4.0.3: + version "4.0.13" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-4.0.13.tgz#105495ae5361d697bd195c825192e1ad7f253787" + +acorn@^5.2.1, acorn@^5.4.0, acorn@^5.4.1: + version "5.4.1" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-5.4.1.tgz#fdc58d9d17f4a4e98d102ded826a9b9759125102" + +ajv-keywords@^1.0.0: + version "1.5.1" + resolved "https://registry.yarnpkg.com/ajv-keywords/-/ajv-keywords-1.5.1.tgz#314dd0a4b3368fad3dfcdc54ede6171b886daf3c" + +ajv@^4.7.0: + version "4.11.8" + resolved "https://registry.yarnpkg.com/ajv/-/ajv-4.11.8.tgz#82ffb02b29e662ae53bdc20af15947706739c536" + dependencies: + co "^4.6.0" + json-stable-stringify "^1.0.1" + +ajv@^5.1.0: + version "5.5.2" + resolved "https://registry.yarnpkg.com/ajv/-/ajv-5.5.2.tgz#73b5eeca3fab653e3d3f9422b341ad42205dc965" + dependencies: + co "^4.6.0" + fast-deep-equal "^1.0.0" + fast-json-stable-stringify "^2.0.0" + json-schema-traverse "^0.3.0" + +align-text@^0.1.1, align-text@^0.1.3: + version "0.1.4" + resolved "https://registry.yarnpkg.com/align-text/-/align-text-0.1.4.tgz#0cd90a561093f35d0a99256c22b7069433fad117" + dependencies: + kind-of "^3.0.2" + longest "^1.0.1" + repeat-string "^1.5.2" + +amdefine@>=0.0.4: + version "1.0.1" + resolved "https://registry.yarnpkg.com/amdefine/-/amdefine-1.0.1.tgz#4a5282ac164729e93619bcfd3ad151f817ce91f5" + +ansi-escapes@^1.1.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-1.4.0.tgz#d3a8a83b319aa67793662b13e761c7911422306e" + +ansi-regex@^2.0.0: + version "2.1.1" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df" + +ansi-regex@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-3.0.0.tgz#ed0317c322064f79466c02966bddb605ab37d998" + +ansi-styles@^2.2.1: + version "2.2.1" + resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-2.2.1.tgz#b432dd3358b634cf75e1e4664368240533c1ddbe" + +argparse@^1.0.7: + version "1.0.9" + resolved "https://registry.yarnpkg.com/argparse/-/argparse-1.0.9.tgz#73d83bc263f86e97f8cc4f6bae1b0e90a7d22c86" + dependencies: + sprintf-js "~1.0.2" + +array-filter@~0.0.0: + version "0.0.1" + resolved "https://registry.yarnpkg.com/array-filter/-/array-filter-0.0.1.tgz#7da8cf2e26628ed732803581fd21f67cacd2eeec" + +array-map@~0.0.0: + version "0.0.0" + resolved "https://registry.yarnpkg.com/array-map/-/array-map-0.0.0.tgz#88a2bab73d1cf7bcd5c1b118a003f66f665fa662" + +array-reduce@~0.0.0: + version "0.0.0" + resolved "https://registry.yarnpkg.com/array-reduce/-/array-reduce-0.0.0.tgz#173899d3ffd1c7d9383e4479525dbe278cab5f2b" + +array-union@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/array-union/-/array-union-1.0.2.tgz#9a34410e4f4e3da23dea375be5be70f24778ec39" + dependencies: + array-uniq "^1.0.1" + +array-uniq@^1.0.1: + version "1.0.3" + resolved "https://registry.yarnpkg.com/array-uniq/-/array-uniq-1.0.3.tgz#af6ac877a25cc7f74e058894753858dfdb24fdb6" + +arrify@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/arrify/-/arrify-1.0.1.tgz#898508da2226f380df904728456849c1501a4b0d" + +asn1.js@^4.0.0: + version "4.9.2" + resolved "https://registry.yarnpkg.com/asn1.js/-/asn1.js-4.9.2.tgz#8117ef4f7ed87cd8f89044b5bff97ac243a16c9a" + dependencies: + bn.js "^4.0.0" + inherits "^2.0.1" + minimalistic-assert "^1.0.0" + +asn1@~0.2.3: + version "0.2.3" + resolved "https://registry.yarnpkg.com/asn1/-/asn1-0.2.3.tgz#dac8787713c9966849fc8180777ebe9c1ddf3b86" + +assert-plus@1.0.0, assert-plus@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/assert-plus/-/assert-plus-1.0.0.tgz#f12e0f3c5d77b0b1cdd9146942e4e96c1e4dd525" + +assert-plus@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/assert-plus/-/assert-plus-0.2.0.tgz#d74e1b87e7affc0db8aadb7021f3fe48101ab234" + +assert@^1.4.0: + version "1.4.1" + resolved "https://registry.yarnpkg.com/assert/-/assert-1.4.1.tgz#99912d591836b5a6f5b345c0f07eefc08fc65d91" + dependencies: + util "0.10.3" + +astw@^2.0.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/astw/-/astw-2.2.0.tgz#7bd41784d32493987aeb239b6b4e1c57a873b917" + dependencies: + acorn "^4.0.3" + +async@1.x, async@^1.4.0: + version "1.5.2" + resolved "https://registry.yarnpkg.com/async/-/async-1.5.2.tgz#ec6a61ae56480c0c3cb241c95618e20892f9672a" + +async@~0.1.22: + version "0.1.22" + resolved "https://registry.yarnpkg.com/async/-/async-0.1.22.tgz#0fc1aaa088a0e3ef0ebe2d8831bab0dcf8845061" + +asynckit@^0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" + +aws-sign2@~0.6.0: + version "0.6.0" + resolved "https://registry.yarnpkg.com/aws-sign2/-/aws-sign2-0.6.0.tgz#14342dd38dbcc94d0e5b87d763cd63612c0e794f" + +aws-sign2@~0.7.0: + version "0.7.0" + resolved "https://registry.yarnpkg.com/aws-sign2/-/aws-sign2-0.7.0.tgz#b46e890934a9591f2d2f6f86d7e6a9f1b3fe76a8" + +aws4@^1.2.1, aws4@^1.6.0: + version "1.6.0" + resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.6.0.tgz#83ef5ca860b2b32e4a0deedee8c771b9db57471e" + +babel-code-frame@^6.16.0: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-code-frame/-/babel-code-frame-6.26.0.tgz#63fd43f7dc1e3bb7ce35947db8fe369a3f58c74b" + dependencies: + chalk "^1.1.3" + esutils "^2.0.2" + js-tokens "^3.0.2" + +balanced-match@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767" + +base64-js@^1.0.2: + version "1.2.1" + resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.2.1.tgz#a91947da1f4a516ea38e5b4ec0ec3773675e0886" + +bcrypt-pbkdf@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.1.tgz#63bc5dcb61331b92bc05fd528953c33462a06f8d" + dependencies: + tweetnacl "^0.14.3" + +bn.js@^4.0.0, bn.js@^4.1.0, bn.js@^4.1.1, bn.js@^4.4.0: + version "4.11.8" + resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-4.11.8.tgz#2cde09eb5ee341f484746bb0309b3253b1b1442f" + +boom@2.x.x: + version "2.10.1" + resolved "https://registry.yarnpkg.com/boom/-/boom-2.10.1.tgz#39c8918ceff5799f83f9492a848f625add0c766f" + dependencies: + hoek "2.x.x" + +boom@4.x.x: + version "4.3.1" + resolved "https://registry.yarnpkg.com/boom/-/boom-4.3.1.tgz#4f8a3005cb4a7e3889f749030fd25b96e01d2e31" + dependencies: + hoek "4.x.x" + +boom@5.x.x: + version "5.2.0" + resolved "https://registry.yarnpkg.com/boom/-/boom-5.2.0.tgz#5dd9da6ee3a5f302077436290cb717d3f4a54e02" + dependencies: + hoek "4.x.x" + +brace-expansion@^1.1.7: + version "1.1.11" + resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" + dependencies: + balanced-match "^1.0.0" + concat-map "0.0.1" + +brorand@^1.0.1: + version "1.1.0" + resolved "https://registry.yarnpkg.com/brorand/-/brorand-1.1.0.tgz#12c25efe40a45e3c323eb8675a0a0ce57b22371f" + +browser-pack@^6.0.1: + version "6.0.4" + resolved "https://registry.yarnpkg.com/browser-pack/-/browser-pack-6.0.4.tgz#9a73beb3b48f9e36868be007b64400102c04a99f" + dependencies: + JSONStream "^1.0.3" + combine-source-map "~0.8.0" + defined "^1.0.0" + safe-buffer "^5.1.1" + through2 "^2.0.0" + umd "^3.0.0" + +browser-resolve@^1.11.0, browser-resolve@^1.7.0: + version "1.11.2" + resolved "https://registry.yarnpkg.com/browser-resolve/-/browser-resolve-1.11.2.tgz#8ff09b0a2c421718a1051c260b32e48f442938ce" + dependencies: + resolve "1.1.7" + +browserify-aes@^1.0.0, browserify-aes@^1.0.4: + version "1.1.1" + resolved "https://registry.yarnpkg.com/browserify-aes/-/browserify-aes-1.1.1.tgz#38b7ab55edb806ff2dcda1a7f1620773a477c49f" + dependencies: + buffer-xor "^1.0.3" + cipher-base "^1.0.0" + create-hash "^1.1.0" + evp_bytestokey "^1.0.3" + inherits "^2.0.1" + safe-buffer "^5.0.1" + +browserify-cipher@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/browserify-cipher/-/browserify-cipher-1.0.0.tgz#9988244874bf5ed4e28da95666dcd66ac8fc363a" + dependencies: + browserify-aes "^1.0.4" + browserify-des "^1.0.0" + evp_bytestokey "^1.0.0" + +browserify-des@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/browserify-des/-/browserify-des-1.0.0.tgz#daa277717470922ed2fe18594118a175439721dd" + dependencies: + cipher-base "^1.0.1" + des.js "^1.0.0" + inherits "^2.0.1" + +browserify-istanbul@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/browserify-istanbul/-/browserify-istanbul-2.0.0.tgz#85a4b425da1f7c09e02ba32a3b44f6535d38c257" + dependencies: + minimatch "^3.0.0" + through "^2.3.8" + +browserify-rsa@^4.0.0: + version "4.0.1" + resolved "https://registry.yarnpkg.com/browserify-rsa/-/browserify-rsa-4.0.1.tgz#21e0abfaf6f2029cf2fafb133567a701d4135524" + dependencies: + bn.js "^4.1.0" + randombytes "^2.0.1" + +browserify-sign@^4.0.0: + version "4.0.4" + resolved "https://registry.yarnpkg.com/browserify-sign/-/browserify-sign-4.0.4.tgz#aa4eb68e5d7b658baa6bf6a57e630cbd7a93d298" + dependencies: + bn.js "^4.1.1" + browserify-rsa "^4.0.0" + create-hash "^1.1.0" + create-hmac "^1.1.2" + elliptic "^6.0.0" + inherits "^2.0.1" + parse-asn1 "^5.0.0" + +browserify-zlib@~0.1.2: + version "0.1.4" + resolved "https://registry.yarnpkg.com/browserify-zlib/-/browserify-zlib-0.1.4.tgz#bb35f8a519f600e0fa6b8485241c979d0141fb2d" + dependencies: + pako "~0.2.0" + +browserify@^13.1.1: + version "13.3.0" + resolved "https://registry.yarnpkg.com/browserify/-/browserify-13.3.0.tgz#b5a9c9020243f0c70e4675bec8223bc627e415ce" + dependencies: + JSONStream "^1.0.3" + assert "^1.4.0" + browser-pack "^6.0.1" + browser-resolve "^1.11.0" + browserify-zlib "~0.1.2" + buffer "^4.1.0" + cached-path-relative "^1.0.0" + concat-stream "~1.5.1" + console-browserify "^1.1.0" + constants-browserify "~1.0.0" + crypto-browserify "^3.0.0" + defined "^1.0.0" + deps-sort "^2.0.0" + domain-browser "~1.1.0" + duplexer2 "~0.1.2" + events "~1.1.0" + glob "^7.1.0" + has "^1.0.0" + htmlescape "^1.1.0" + https-browserify "~0.0.0" + inherits "~2.0.1" + insert-module-globals "^7.0.0" + labeled-stream-splicer "^2.0.0" + module-deps "^4.0.8" + os-browserify "~0.1.1" + parents "^1.0.1" + path-browserify "~0.0.0" + process "~0.11.0" + punycode "^1.3.2" + querystring-es3 "~0.2.0" + read-only-stream "^2.0.0" + readable-stream "^2.0.2" + resolve "^1.1.4" + shasum "^1.0.0" + shell-quote "^1.6.1" + stream-browserify "^2.0.0" + stream-http "^2.0.0" + string_decoder "~0.10.0" + subarg "^1.0.0" + syntax-error "^1.1.1" + through2 "^2.0.0" + timers-browserify "^1.0.1" + tty-browserify "~0.0.0" + url "~0.11.0" + util "~0.10.1" + vm-browserify "~0.0.1" + xtend "^4.0.0" + +buffer-xor@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/buffer-xor/-/buffer-xor-1.0.3.tgz#26e61ed1422fb70dd42e6e36729ed51d855fe8d9" + +buffer@^4.1.0: + version "4.9.1" + resolved "https://registry.yarnpkg.com/buffer/-/buffer-4.9.1.tgz#6d1bb601b07a4efced97094132093027c95bc298" + dependencies: + base64-js "^1.0.2" + ieee754 "^1.1.4" + isarray "^1.0.0" + +builtin-status-codes@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/builtin-status-codes/-/builtin-status-codes-3.0.0.tgz#85982878e21b98e1c66425e03d0174788f569ee8" + +cached-path-relative@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/cached-path-relative/-/cached-path-relative-1.0.1.tgz#d09c4b52800aa4c078e2dd81a869aac90d2e54e7" + +caller-path@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/caller-path/-/caller-path-0.1.0.tgz#94085ef63581ecd3daa92444a8fe94e82577751f" + dependencies: + callsites "^0.2.0" + +callsites@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/callsites/-/callsites-0.2.0.tgz#afab96262910a7f33c19a5775825c69f34e350ca" + +camelcase@^1.0.2: + version "1.2.1" + resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-1.2.1.tgz#9bb5304d2e0b56698b2c758b08a3eaa9daa58a39" + +caseless@~0.11.0: + version "0.11.0" + resolved "https://registry.yarnpkg.com/caseless/-/caseless-0.11.0.tgz#715b96ea9841593cc33067923f5ec60ebda4f7d7" + +caseless@~0.12.0: + version "0.12.0" + resolved "https://registry.yarnpkg.com/caseless/-/caseless-0.12.0.tgz#1b681c21ff84033c826543090689420d187151dc" + +center-align@^0.1.1: + version "0.1.3" + resolved "https://registry.yarnpkg.com/center-align/-/center-align-0.1.3.tgz#aa0d32629b6ee972200411cbd4461c907bc2b7ad" + dependencies: + align-text "^0.1.3" + lazy-cache "^1.0.3" + +chalk@^1.0.0, chalk@^1.1.1, chalk@^1.1.3: + version "1.1.3" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-1.1.3.tgz#a8115c55e4a702fe4d150abd3872822a7e09fc98" + dependencies: + ansi-styles "^2.2.1" + escape-string-regexp "^1.0.2" + has-ansi "^2.0.0" + strip-ansi "^3.0.0" + supports-color "^2.0.0" + +cipher-base@^1.0.0, cipher-base@^1.0.1, cipher-base@^1.0.3: + version "1.0.4" + resolved "https://registry.yarnpkg.com/cipher-base/-/cipher-base-1.0.4.tgz#8760e4ecc272f4c363532f926d874aae2c1397de" + dependencies: + inherits "^2.0.1" + safe-buffer "^5.0.1" + +circular-json@^0.3.1: + version "0.3.3" + resolved "https://registry.yarnpkg.com/circular-json/-/circular-json-0.3.3.tgz#815c99ea84f6809529d2f45791bdf82711352d66" + +cli-cursor@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/cli-cursor/-/cli-cursor-1.0.2.tgz#64da3f7d56a54412e59794bd62dc35295e8f2987" + dependencies: + restore-cursor "^1.0.1" + +cli-width@^2.0.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/cli-width/-/cli-width-2.2.0.tgz#ff19ede8a9a5e579324147b0c11f0fbcbabed639" + +cliui@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/cliui/-/cliui-2.1.0.tgz#4b475760ff80264c762c3a1719032e91c7fea0d1" + dependencies: + center-align "^0.1.1" + right-align "^0.1.1" + wordwrap "0.0.2" + +clone@^1.0.2: + version "1.0.3" + resolved "https://registry.yarnpkg.com/clone/-/clone-1.0.3.tgz#298d7e2231660f40c003c2ed3140decf3f53085f" + +co@^4.6.0: + version "4.6.0" + resolved "https://registry.yarnpkg.com/co/-/co-4.6.0.tgz#6ea6bdf3d853ae54ccb8e47bfa0bf3f9031fb184" + +code-point-at@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/code-point-at/-/code-point-at-1.1.0.tgz#0d070b4d043a5bea33a2f1a40e2edb3d9a4ccf77" + +columnify@^1.5.4: + version "1.5.4" + resolved "https://registry.yarnpkg.com/columnify/-/columnify-1.5.4.tgz#4737ddf1c7b69a8a7c340570782e947eec8e78bb" + dependencies: + strip-ansi "^3.0.0" + wcwidth "^1.0.0" + +combine-source-map@~0.7.1: + version "0.7.2" + resolved "https://registry.yarnpkg.com/combine-source-map/-/combine-source-map-0.7.2.tgz#0870312856b307a87cc4ac486f3a9a62aeccc09e" + dependencies: + convert-source-map "~1.1.0" + inline-source-map "~0.6.0" + lodash.memoize "~3.0.3" + source-map "~0.5.3" + +combine-source-map@~0.8.0: + version "0.8.0" + resolved "https://registry.yarnpkg.com/combine-source-map/-/combine-source-map-0.8.0.tgz#a58d0df042c186fcf822a8e8015f5450d2d79a8b" + dependencies: + convert-source-map "~1.1.0" + inline-source-map "~0.6.0" + lodash.memoize "~3.0.3" + source-map "~0.5.3" + +combined-stream@1.0.6: + version "1.0.6" + resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.6.tgz#723e7df6e801ac5613113a7e445a9b69cb632818" + dependencies: + delayed-stream "~1.0.0" + +combined-stream@^1.0.5, combined-stream@~1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.5.tgz#938370a57b4a51dea2c77c15d5c5fdf895164009" + dependencies: + delayed-stream "~1.0.0" + +commander@^2.9.0: + version "2.14.1" + resolved "https://registry.yarnpkg.com/commander/-/commander-2.14.1.tgz#2235123e37af8ca3c65df45b026dbd357b01b9aa" + +concat-map@0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" + +concat-stream@1.6.0, concat-stream@^1.4.7, concat-stream@^1.4.8, concat-stream@^1.5.2: + version "1.6.0" + resolved "https://registry.yarnpkg.com/concat-stream/-/concat-stream-1.6.0.tgz#0aac662fd52be78964d5532f694784e70110acf7" + dependencies: + inherits "^2.0.3" + readable-stream "^2.2.2" + typedarray "^0.0.6" + +concat-stream@~1.5.0, concat-stream@~1.5.1: + version "1.5.2" + resolved "https://registry.yarnpkg.com/concat-stream/-/concat-stream-1.5.2.tgz#708978624d856af41a5a741defdd261da752c266" + dependencies: + inherits "~2.0.1" + readable-stream "~2.0.0" + typedarray "~0.0.5" + +console-browserify@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/console-browserify/-/console-browserify-1.1.0.tgz#f0241c45730a9fc6323b206dbf38edc741d0bb10" + dependencies: + date-now "^0.1.4" + +constants-browserify@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/constants-browserify/-/constants-browserify-1.0.0.tgz#c20b96d8c617748aaf1c16021760cd27fcb8cb75" + +convert-source-map@^1.0.0: + version "1.5.1" + resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.5.1.tgz#b8278097b9bc229365de5c62cf5fcaed8b5599e5" + +convert-source-map@~1.1.0: + version "1.1.3" + resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.1.3.tgz#4829c877e9fe49b3161f3bf3673888e204699860" + +core-util-is@1.0.2, core-util-is@~1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7" + +coveralls@^2.11.14: + version "2.13.3" + resolved "https://registry.yarnpkg.com/coveralls/-/coveralls-2.13.3.tgz#9ad7c2ae527417f361e8b626483f48ee92dd2bc7" + dependencies: + js-yaml "3.6.1" + lcov-parse "0.0.10" + log-driver "1.2.5" + minimist "1.2.0" + request "2.79.0" + +create-ecdh@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/create-ecdh/-/create-ecdh-4.0.0.tgz#888c723596cdf7612f6498233eebd7a35301737d" + dependencies: + bn.js "^4.1.0" + elliptic "^6.0.0" + +create-hash@^1.1.0, create-hash@^1.1.2: + version "1.1.3" + resolved "https://registry.yarnpkg.com/create-hash/-/create-hash-1.1.3.tgz#606042ac8b9262750f483caddab0f5819172d8fd" + dependencies: + cipher-base "^1.0.1" + inherits "^2.0.1" + ripemd160 "^2.0.0" + sha.js "^2.4.0" + +create-hmac@^1.1.0, create-hmac@^1.1.2, create-hmac@^1.1.4: + version "1.1.6" + resolved "https://registry.yarnpkg.com/create-hmac/-/create-hmac-1.1.6.tgz#acb9e221a4e17bdb076e90657c42b93e3726cf06" + dependencies: + cipher-base "^1.0.3" + create-hash "^1.1.0" + inherits "^2.0.1" + ripemd160 "^2.0.0" + safe-buffer "^5.0.1" + sha.js "^2.4.8" + +cross-spawn@^4.0.2: + version "4.0.2" + resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-4.0.2.tgz#7b9247621c23adfdd3856004a823cbe397424d41" + dependencies: + lru-cache "^4.0.1" + which "^1.2.9" + +cross-spawn@^5.0.1: + version "5.1.0" + resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-5.1.0.tgz#e8bd0efee58fcff6f8f94510a0a554bbfa235449" + dependencies: + lru-cache "^4.0.1" + shebang-command "^1.2.0" + which "^1.2.9" + +cryptiles@2.x.x: + version "2.0.5" + resolved "https://registry.yarnpkg.com/cryptiles/-/cryptiles-2.0.5.tgz#3bdfecdc608147c1c67202fa291e7dca59eaa3b8" + dependencies: + boom "2.x.x" + +cryptiles@3.x.x: + version "3.1.2" + resolved "https://registry.yarnpkg.com/cryptiles/-/cryptiles-3.1.2.tgz#a89fbb220f5ce25ec56e8c4aa8a4fd7b5b0d29fe" + dependencies: + boom "5.x.x" + +crypto-browserify@^3.0.0: + version "3.12.0" + resolved "https://registry.yarnpkg.com/crypto-browserify/-/crypto-browserify-3.12.0.tgz#396cf9f3137f03e4b8e532c58f698254e00f80ec" + dependencies: + browserify-cipher "^1.0.0" + browserify-sign "^4.0.0" + create-ecdh "^4.0.0" + create-hash "^1.1.0" + create-hmac "^1.1.0" + diffie-hellman "^5.0.0" + inherits "^2.0.1" + pbkdf2 "^3.0.3" + public-encrypt "^4.0.0" + randombytes "^2.0.0" + randomfill "^1.0.3" + +d@1: + version "1.0.0" + resolved "https://registry.yarnpkg.com/d/-/d-1.0.0.tgz#754bb5bfe55451da69a58b94d45f4c5b0462d58f" + dependencies: + es5-ext "^0.10.9" + +dashdash@^1.12.0: + version "1.14.1" + resolved "https://registry.yarnpkg.com/dashdash/-/dashdash-1.14.1.tgz#853cfa0f7cbe2fed5de20326b8dd581035f6e2f0" + dependencies: + assert-plus "^1.0.0" + +date-now@^0.1.4: + version "0.1.4" + resolved "https://registry.yarnpkg.com/date-now/-/date-now-0.1.4.tgz#eaf439fd4d4848ad74e5cc7dbef200672b9e345b" + +debug@2.6.9, debug@^2.1.1: + version "2.6.9" + resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f" + dependencies: + ms "2.0.0" + +decamelize@^1.0.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290" + +deep-equal@~1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/deep-equal/-/deep-equal-1.0.1.tgz#f5d260292b660e084eff4cdbc9f08ad3247448b5" + +deep-is@~0.1.3: + version "0.1.3" + resolved "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.3.tgz#b369d6fb5dbc13eecf524f91b070feedc357cf34" + +deeply@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/deeply/-/deeply-1.0.0.tgz#ed573160b5c91ff5138917bf701e5453b19f574b" + +defaults@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/defaults/-/defaults-1.0.3.tgz#c656051e9817d9ff08ed881477f3fe4019f3ef7d" + dependencies: + clone "^1.0.2" + +define-properties@^1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/define-properties/-/define-properties-1.1.2.tgz#83a73f2fea569898fb737193c8f873caf6d45c94" + dependencies: + foreach "^2.0.5" + object-keys "^1.0.8" + +defined@^1.0.0, defined@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/defined/-/defined-1.0.0.tgz#c98d9bcef75674188e110969151199e39b1fa693" + +del@^2.0.2: + version "2.2.2" + resolved "https://registry.yarnpkg.com/del/-/del-2.2.2.tgz#c12c981d067846c84bcaf862cff930d907ffd1a8" + dependencies: + globby "^5.0.0" + is-path-cwd "^1.0.0" + is-path-in-cwd "^1.0.0" + object-assign "^4.0.1" + pify "^2.0.0" + pinkie-promise "^2.0.0" + rimraf "^2.2.8" + +delayed-stream@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619" + +deps-sort@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/deps-sort/-/deps-sort-2.0.0.tgz#091724902e84658260eb910748cccd1af6e21fb5" + dependencies: + JSONStream "^1.0.3" + shasum "^1.0.0" + subarg "^1.0.0" + through2 "^2.0.0" + +des.js@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/des.js/-/des.js-1.0.0.tgz#c074d2e2aa6a8a9a07dbd61f9a15c2cd83ec8ecc" + dependencies: + inherits "^2.0.1" + minimalistic-assert "^1.0.0" + +detective@^4.0.0: + version "4.7.1" + resolved "https://registry.yarnpkg.com/detective/-/detective-4.7.1.tgz#0eca7314338442febb6d65da54c10bb1c82b246e" + dependencies: + acorn "^5.2.1" + defined "^1.0.0" + +diffie-hellman@^5.0.0: + version "5.0.2" + resolved "https://registry.yarnpkg.com/diffie-hellman/-/diffie-hellman-5.0.2.tgz#b5835739270cfe26acf632099fded2a07f209e5e" + dependencies: + bn.js "^4.1.0" + miller-rabin "^4.0.0" + randombytes "^2.0.0" + +doctrine@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-2.1.0.tgz#5cd01fc101621b42c4cd7f5d1a66243716d3f39d" + dependencies: + esutils "^2.0.2" + +domain-browser@~1.1.0: + version "1.1.7" + resolved "https://registry.yarnpkg.com/domain-browser/-/domain-browser-1.1.7.tgz#867aa4b093faa05f1de08c06f4d7b21fdf8698bc" + +du@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/du/-/du-0.1.0.tgz#f26e340a09c7bc5b6fd69af6dbadea60fa8c6f4d" + dependencies: + async "~0.1.22" + +duplexer2@^0.1.2, duplexer2@~0.1.0, duplexer2@~0.1.2: + version "0.1.4" + resolved "https://registry.yarnpkg.com/duplexer2/-/duplexer2-0.1.4.tgz#8b12dab878c0d69e3e7891051662a32fc6bddcc1" + dependencies: + readable-stream "^2.0.2" + +ecc-jsbn@~0.1.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/ecc-jsbn/-/ecc-jsbn-0.1.1.tgz#0fc73a9ed5f0d53c38193398523ef7e543777505" + dependencies: + jsbn "~0.1.0" + +elliptic@^6.0.0: + version "6.4.0" + resolved "https://registry.yarnpkg.com/elliptic/-/elliptic-6.4.0.tgz#cac9af8762c85836187003c8dfe193e5e2eae5df" + dependencies: + bn.js "^4.4.0" + brorand "^1.0.1" + hash.js "^1.0.0" + hmac-drbg "^1.0.0" + inherits "^2.0.1" + minimalistic-assert "^1.0.0" + minimalistic-crypto-utils "^1.0.0" + +envar@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/envar/-/envar-2.0.0.tgz#44f7cdafbf976b732b73ad1acb2e8808ecf8876e" + dependencies: + deeply "^1.0.0" + minimist "^1.2.0" + +es-abstract@^1.5.0: + version "1.10.0" + resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.10.0.tgz#1ecb36c197842a00d8ee4c2dfd8646bb97d60864" + dependencies: + es-to-primitive "^1.1.1" + function-bind "^1.1.1" + has "^1.0.1" + is-callable "^1.1.3" + is-regex "^1.0.4" + +es-to-primitive@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/es-to-primitive/-/es-to-primitive-1.1.1.tgz#45355248a88979034b6792e19bb81f2b7975dd0d" + dependencies: + is-callable "^1.1.1" + is-date-object "^1.0.1" + is-symbol "^1.0.1" + +es5-ext@^0.10.14, es5-ext@^0.10.35, es5-ext@^0.10.9, es5-ext@~0.10.14: + version "0.10.38" + resolved "https://registry.yarnpkg.com/es5-ext/-/es5-ext-0.10.38.tgz#fa7d40d65bbc9bb8a67e1d3f9cc656a00530eed3" + dependencies: + es6-iterator "~2.0.3" + es6-symbol "~3.1.1" + +es6-iterator@^2.0.1, es6-iterator@~2.0.1, es6-iterator@~2.0.3: + version "2.0.3" + resolved "https://registry.yarnpkg.com/es6-iterator/-/es6-iterator-2.0.3.tgz#a7de889141a05a94b0854403b2d0a0fbfa98f3b7" + dependencies: + d "1" + es5-ext "^0.10.35" + es6-symbol "^3.1.1" + +es6-map@^0.1.3: + version "0.1.5" + resolved "https://registry.yarnpkg.com/es6-map/-/es6-map-0.1.5.tgz#9136e0503dcc06a301690f0bb14ff4e364e949f0" + dependencies: + d "1" + es5-ext "~0.10.14" + es6-iterator "~2.0.1" + es6-set "~0.1.5" + es6-symbol "~3.1.1" + event-emitter "~0.3.5" + +es6-promise@^4.0.3: + version "4.2.4" + resolved "https://registry.yarnpkg.com/es6-promise/-/es6-promise-4.2.4.tgz#dc4221c2b16518760bd8c39a52d8f356fc00ed29" + +es6-set@~0.1.5: + version "0.1.5" + resolved "https://registry.yarnpkg.com/es6-set/-/es6-set-0.1.5.tgz#d2b3ec5d4d800ced818db538d28974db0a73ccb1" + dependencies: + d "1" + es5-ext "~0.10.14" + es6-iterator "~2.0.1" + es6-symbol "3.1.1" + event-emitter "~0.3.5" + +es6-symbol@3.1.1, es6-symbol@^3.1.1, es6-symbol@~3.1.1: + version "3.1.1" + resolved "https://registry.yarnpkg.com/es6-symbol/-/es6-symbol-3.1.1.tgz#bf00ef4fdab6ba1b46ecb7b629b4c7ed5715cc77" + dependencies: + d "1" + es5-ext "~0.10.14" + +es6-weak-map@^2.0.1: + version "2.0.2" + resolved "https://registry.yarnpkg.com/es6-weak-map/-/es6-weak-map-2.0.2.tgz#5e3ab32251ffd1538a1f8e5ffa1357772f92d96f" + dependencies: + d "1" + es5-ext "^0.10.14" + es6-iterator "^2.0.1" + es6-symbol "^3.1.1" + +escape-string-regexp@^1.0.2, escape-string-regexp@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" + +escodegen@1.8.x: + version "1.8.1" + resolved "https://registry.yarnpkg.com/escodegen/-/escodegen-1.8.1.tgz#5a5b53af4693110bebb0867aa3430dd3b70a1018" + dependencies: + esprima "^2.7.1" + estraverse "^1.9.1" + esutils "^2.0.2" + optionator "^0.8.1" + optionalDependencies: + source-map "~0.2.0" + +escope@^3.6.0: + version "3.6.0" + resolved "https://registry.yarnpkg.com/escope/-/escope-3.6.0.tgz#e01975e812781a163a6dadfdd80398dc64c889c3" + dependencies: + es6-map "^0.1.3" + es6-weak-map "^2.0.1" + esrecurse "^4.1.0" + estraverse "^4.1.1" + +eslint@^3.9.1: + version "3.19.0" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-3.19.0.tgz#c8fc6201c7f40dd08941b87c085767386a679acc" + dependencies: + babel-code-frame "^6.16.0" + chalk "^1.1.3" + concat-stream "^1.5.2" + debug "^2.1.1" + doctrine "^2.0.0" + escope "^3.6.0" + espree "^3.4.0" + esquery "^1.0.0" + estraverse "^4.2.0" + esutils "^2.0.2" + file-entry-cache "^2.0.0" + glob "^7.0.3" + globals "^9.14.0" + ignore "^3.2.0" + imurmurhash "^0.1.4" + inquirer "^0.12.0" + is-my-json-valid "^2.10.0" + is-resolvable "^1.0.0" + js-yaml "^3.5.1" + json-stable-stringify "^1.0.0" + levn "^0.3.0" + lodash "^4.0.0" + mkdirp "^0.5.0" + natural-compare "^1.4.0" + optionator "^0.8.2" + path-is-inside "^1.0.1" + pluralize "^1.2.1" + progress "^1.1.8" + require-uncached "^1.0.2" + shelljs "^0.7.5" + strip-bom "^3.0.0" + strip-json-comments "~2.0.1" + table "^3.7.8" + text-table "~0.2.0" + user-home "^2.0.0" + +espree@^3.4.0: + version "3.5.3" + resolved "https://registry.yarnpkg.com/espree/-/espree-3.5.3.tgz#931e0af64e7fbbed26b050a29daad1fc64799fa6" + dependencies: + acorn "^5.4.0" + acorn-jsx "^3.0.0" + +esprima@2.7.x, esprima@^2.6.0, esprima@^2.7.1: + version "2.7.3" + resolved "https://registry.yarnpkg.com/esprima/-/esprima-2.7.3.tgz#96e3b70d5779f6ad49cd032673d1c312767ba581" + +esprima@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.0.tgz#4499eddcd1110e0b218bacf2fa7f7f59f55ca804" + +esquery@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/esquery/-/esquery-1.0.0.tgz#cfba8b57d7fba93f17298a8a006a04cda13d80fa" + dependencies: + estraverse "^4.0.0" + +esrecurse@^4.1.0: + version "4.2.0" + resolved "https://registry.yarnpkg.com/esrecurse/-/esrecurse-4.2.0.tgz#fa9568d98d3823f9a41d91e902dcab9ea6e5b163" + dependencies: + estraverse "^4.1.0" + object-assign "^4.0.1" + +estraverse@^1.9.1: + version "1.9.3" + resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-1.9.3.tgz#af67f2dc922582415950926091a4005d29c9bb44" + +estraverse@^4.0.0, estraverse@^4.1.0, estraverse@^4.1.1, estraverse@^4.2.0: + version "4.2.0" + resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-4.2.0.tgz#0dee3fed31fcd469618ce7342099fc1afa0bdb13" + +esutils@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.2.tgz#0abf4f1caa5bcb1f7a9d8acc6dea4faaa04bac9b" + +event-emitter@~0.3.5: + version "0.3.5" + resolved "https://registry.yarnpkg.com/event-emitter/-/event-emitter-0.3.5.tgz#df8c69eef1647923c7157b9ce83840610b02cc39" + dependencies: + d "1" + es5-ext "~0.10.14" + +events@~1.1.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/events/-/events-1.1.1.tgz#9ebdb7635ad099c70dcc4c2a1f5004288e8bd924" + +evp_bytestokey@^1.0.0, evp_bytestokey@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/evp_bytestokey/-/evp_bytestokey-1.0.3.tgz#7fcbdb198dc71959432efe13842684e0525acb02" + dependencies: + md5.js "^1.3.4" + safe-buffer "^5.1.1" + +exit-hook@^1.0.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/exit-hook/-/exit-hook-1.1.1.tgz#f05ca233b48c05d54fff07765df8507e95c02ff8" + +extend@~3.0.0, extend@~3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.1.tgz#a755ea7bc1adfcc5a31ce7e762dbaadc5e636444" + +extract-zip@^1.6.5: + version "1.6.6" + resolved "https://registry.yarnpkg.com/extract-zip/-/extract-zip-1.6.6.tgz#1290ede8d20d0872b429fd3f351ca128ec5ef85c" + dependencies: + concat-stream "1.6.0" + debug "2.6.9" + mkdirp "0.5.0" + yauzl "2.4.1" + +extsprintf@1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.3.0.tgz#96918440e3041a7a414f8c52e3c574eb3c3e1e05" + +extsprintf@^1.2.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.4.0.tgz#e2689f8f356fad62cca65a3a91c5df5f9551692f" + +fake@^0.2.2: + version "0.2.2" + resolved "https://registry.yarnpkg.com/fake/-/fake-0.2.2.tgz#68fe672725ff0f5c89ba92c539b31111f122d1f3" + +far@^0.0.7: + version "0.0.7" + resolved "https://registry.yarnpkg.com/far/-/far-0.0.7.tgz#01c1fd362bcd26ce9cf161af3938aa34619f79a7" + dependencies: + oop "0.0.3" + +fast-deep-equal@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-1.0.0.tgz#96256a3bc975595eb36d82e9929d060d893439ff" + +fast-json-stable-stringify@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz#d5142c0caee6b1189f87d3a76111064f86c8bbf2" + +fast-levenshtein@~2.0.4: + version "2.0.6" + resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917" + +fd-slicer@~1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/fd-slicer/-/fd-slicer-1.0.1.tgz#8b5bcbd9ec327c5041bf9ab023fd6750f1177e65" + dependencies: + pend "~1.2.0" + +figures@^1.3.5: + version "1.7.0" + resolved "https://registry.yarnpkg.com/figures/-/figures-1.7.0.tgz#cbe1e3affcf1cd44b80cadfed28dc793a9701d2e" + dependencies: + escape-string-regexp "^1.0.5" + object-assign "^4.1.0" + +file-entry-cache@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/file-entry-cache/-/file-entry-cache-2.0.0.tgz#c392990c3e684783d838b8c84a45d8a048458361" + dependencies: + flat-cache "^1.2.1" + object-assign "^4.0.1" + +flat-cache@^1.2.1: + version "1.3.0" + resolved "https://registry.yarnpkg.com/flat-cache/-/flat-cache-1.3.0.tgz#d3030b32b38154f4e3b7e9c709f490f7ef97c481" + dependencies: + circular-json "^0.3.1" + del "^2.0.2" + graceful-fs "^4.1.2" + write "^0.2.1" + +for-each@~0.3.2: + version "0.3.2" + resolved "https://registry.yarnpkg.com/for-each/-/for-each-0.3.2.tgz#2c40450b9348e97f281322593ba96704b9abd4d4" + dependencies: + is-function "~1.0.0" + +foreach@^2.0.5: + version "2.0.5" + resolved "https://registry.yarnpkg.com/foreach/-/foreach-2.0.5.tgz#0bee005018aeb260d0a3af3ae658dd0136ec1b99" + +forever-agent@~0.6.1: + version "0.6.1" + resolved "https://registry.yarnpkg.com/forever-agent/-/forever-agent-0.6.1.tgz#fbc71f0c41adeb37f96c577ad1ed42d8fdacca91" + +form-data@~2.1.1: + version "2.1.4" + resolved "https://registry.yarnpkg.com/form-data/-/form-data-2.1.4.tgz#33c183acf193276ecaa98143a69e94bfee1750d1" + dependencies: + asynckit "^0.4.0" + combined-stream "^1.0.5" + mime-types "^2.1.12" + +form-data@~2.3.1: + version "2.3.1" + resolved "https://registry.yarnpkg.com/form-data/-/form-data-2.3.1.tgz#6fb94fbd71885306d73d15cc497fe4cc4ecd44bf" + dependencies: + asynckit "^0.4.0" + combined-stream "^1.0.5" + mime-types "^2.1.12" + +formidable@^1.0.17: + version "1.1.1" + resolved "https://registry.yarnpkg.com/formidable/-/formidable-1.1.1.tgz#96b8886f7c3c3508b932d6bd70c4d3a88f35f1a9" + +fs-extra@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-1.0.0.tgz#cd3ce5f7e7cb6145883fcae3191e9877f8587950" + dependencies: + graceful-fs "^4.1.2" + jsonfile "^2.1.0" + klaw "^1.0.0" + +fs.realpath@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" + +fstream-ignore@^1.0.0: + version "1.0.5" + resolved "https://registry.yarnpkg.com/fstream-ignore/-/fstream-ignore-1.0.5.tgz#9c31dae34767018fe1d249b24dada67d092da105" + dependencies: + fstream "^1.0.0" + inherits "2" + minimatch "^3.0.0" + +fstream-npm@^1.2.0: + version "1.2.1" + resolved "https://registry.yarnpkg.com/fstream-npm/-/fstream-npm-1.2.1.tgz#08c4a452f789dcbac4c89a4563c902b2c862fd5b" + dependencies: + fstream-ignore "^1.0.0" + inherits "2" + +fstream@^1.0.0: + version "1.0.11" + resolved "https://registry.yarnpkg.com/fstream/-/fstream-1.0.11.tgz#5c1fb1f117477114f0632a0eb4b71b3cb0fd3171" + dependencies: + graceful-fs "^4.1.2" + inherits "~2.0.0" + mkdirp ">=0.5 0" + rimraf "2" + +function-bind@^1.0.2, function-bind@^1.1.1, function-bind@~1.1.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.1.tgz#a56899d3ea3c9bab874bb9773b7c5ede92f4895d" + +generate-function@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/generate-function/-/generate-function-2.0.0.tgz#6858fe7c0969b7d4e9093337647ac79f60dfbe74" + +generate-object-property@^1.1.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/generate-object-property/-/generate-object-property-1.2.0.tgz#9c0e1c40308ce804f4783618b937fa88f99d50d0" + dependencies: + is-property "^1.0.0" + +getpass@^0.1.1: + version "0.1.7" + resolved "https://registry.yarnpkg.com/getpass/-/getpass-0.1.7.tgz#5eff8e3e684d569ae4cb2b1282604e8ba62149fa" + dependencies: + assert-plus "^1.0.0" + +ghostface@^1.5.0: + version "1.5.0" + resolved "https://registry.yarnpkg.com/ghostface/-/ghostface-1.5.0.tgz#b93e7ab6560ec93b4509032fdd43a4bec93044fd" + dependencies: + chalk "^1.0.0" + concat-stream "^1.4.8" + convert-source-map "^1.0.0" + minimist "^1.1.1" + semver "^4.3.3" + source-map "^0.4.2" + which "^1.0.9" + +glob@^5.0.15: + version "5.0.15" + resolved "https://registry.yarnpkg.com/glob/-/glob-5.0.15.tgz#1bc936b9e02f4a603fcc222ecf7633d30b8b93b1" + dependencies: + inflight "^1.0.4" + inherits "2" + minimatch "2 || 3" + once "^1.3.0" + path-is-absolute "^1.0.0" + +glob@^7.0.0, glob@^7.0.3, glob@^7.0.5, glob@^7.1.0, glob@~7.1.2: + version "7.1.2" + resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.2.tgz#c19c9df9a028702d678612384a6552404c636d15" + dependencies: + fs.realpath "^1.0.0" + inflight "^1.0.4" + inherits "2" + minimatch "^3.0.4" + once "^1.3.0" + path-is-absolute "^1.0.0" + +globals@^9.14.0: + version "9.18.0" + resolved "https://registry.yarnpkg.com/globals/-/globals-9.18.0.tgz#aa3896b3e69b487f17e31ed2143d69a8e30c2d8a" + +globby@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/globby/-/globby-5.0.0.tgz#ebd84667ca0dbb330b99bcfc68eac2bc54370e0d" + dependencies: + array-union "^1.0.1" + arrify "^1.0.0" + glob "^7.0.3" + object-assign "^4.0.1" + pify "^2.0.0" + pinkie-promise "^2.0.0" + +graceful-fs@^4.1.2, graceful-fs@^4.1.6, graceful-fs@^4.1.9: + version "4.1.11" + resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.1.11.tgz#0e8bdfe4d1ddb8854d64e04ea7c00e2a026e5658" + +handlebars@^4.0.1: + version "4.0.11" + resolved "https://registry.yarnpkg.com/handlebars/-/handlebars-4.0.11.tgz#630a35dfe0294bc281edae6ffc5d329fc7982dcc" + dependencies: + async "^1.4.0" + optimist "^0.6.1" + source-map "^0.4.4" + optionalDependencies: + uglify-js "^2.6" + +har-schema@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/har-schema/-/har-schema-2.0.0.tgz#a94c2224ebcac04782a0d9035521f24735b7ec92" + +har-validator@~2.0.6: + version "2.0.6" + resolved "https://registry.yarnpkg.com/har-validator/-/har-validator-2.0.6.tgz#cdcbc08188265ad119b6a5a7c8ab70eecfb5d27d" + dependencies: + chalk "^1.1.1" + commander "^2.9.0" + is-my-json-valid "^2.12.4" + pinkie-promise "^2.0.0" + +har-validator@~5.0.3: + version "5.0.3" + resolved "https://registry.yarnpkg.com/har-validator/-/har-validator-5.0.3.tgz#ba402c266194f15956ef15e0fcf242993f6a7dfd" + dependencies: + ajv "^5.1.0" + har-schema "^2.0.0" + +has-ansi@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/has-ansi/-/has-ansi-2.0.0.tgz#34f5049ce1ecdf2b0649af3ef24e45ed35416d91" + dependencies: + ansi-regex "^2.0.0" + +has-flag@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-1.0.0.tgz#9d9e793165ce017a00f00418c43f942a7b1d11fa" + +has@^1.0.0, has@^1.0.1, has@~1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/has/-/has-1.0.1.tgz#8461733f538b0837c9361e39a9ab9e9704dc2f28" + dependencies: + function-bind "^1.0.2" + +hash-base@^2.0.0: + version "2.0.2" + resolved "https://registry.yarnpkg.com/hash-base/-/hash-base-2.0.2.tgz#66ea1d856db4e8a5470cadf6fce23ae5244ef2e1" + dependencies: + inherits "^2.0.1" + +hash-base@^3.0.0: + version "3.0.4" + resolved "https://registry.yarnpkg.com/hash-base/-/hash-base-3.0.4.tgz#5fc8686847ecd73499403319a6b0a3f3f6ae4918" + dependencies: + inherits "^2.0.1" + safe-buffer "^5.0.1" + +hash.js@^1.0.0, hash.js@^1.0.3: + version "1.1.3" + resolved "https://registry.yarnpkg.com/hash.js/-/hash.js-1.1.3.tgz#340dedbe6290187151c1ea1d777a3448935df846" + dependencies: + inherits "^2.0.3" + minimalistic-assert "^1.0.0" + +hasha@^2.2.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/hasha/-/hasha-2.2.0.tgz#78d7cbfc1e6d66303fe79837365984517b2f6ee1" + dependencies: + is-stream "^1.0.1" + pinkie-promise "^2.0.0" + +hawk@~3.1.3: + version "3.1.3" + resolved "https://registry.yarnpkg.com/hawk/-/hawk-3.1.3.tgz#078444bd7c1640b0fe540d2c9b73d59678e8e1c4" + dependencies: + boom "2.x.x" + cryptiles "2.x.x" + hoek "2.x.x" + sntp "1.x.x" + +hawk@~6.0.2: + version "6.0.2" + resolved "https://registry.yarnpkg.com/hawk/-/hawk-6.0.2.tgz#af4d914eb065f9b5ce4d9d11c1cb2126eecc3038" + dependencies: + boom "4.x.x" + cryptiles "3.x.x" + hoek "4.x.x" + sntp "2.x.x" + +hmac-drbg@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/hmac-drbg/-/hmac-drbg-1.0.1.tgz#d2745701025a6c775a6c545793ed502fc0c649a1" + dependencies: + hash.js "^1.0.3" + minimalistic-assert "^1.0.0" + minimalistic-crypto-utils "^1.0.1" + +hoek@2.x.x: + version "2.16.3" + resolved "https://registry.yarnpkg.com/hoek/-/hoek-2.16.3.tgz#20bb7403d3cea398e91dc4710a8ff1b8274a25ed" + +hoek@4.x.x: + version "4.2.0" + resolved "https://registry.yarnpkg.com/hoek/-/hoek-4.2.0.tgz#72d9d0754f7fe25ca2d01ad8f8f9a9449a89526d" + +htmlescape@^1.1.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/htmlescape/-/htmlescape-1.1.1.tgz#3a03edc2214bca3b66424a3e7959349509cb0351" + +http-signature@~1.1.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/http-signature/-/http-signature-1.1.1.tgz#df72e267066cd0ac67fb76adf8e134a8fbcf91bf" + dependencies: + assert-plus "^0.2.0" + jsprim "^1.2.2" + sshpk "^1.7.0" + +http-signature@~1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/http-signature/-/http-signature-1.2.0.tgz#9aecd925114772f3d95b65a60abb8f7c18fbace1" + dependencies: + assert-plus "^1.0.0" + jsprim "^1.2.2" + sshpk "^1.7.0" + +https-browserify@~0.0.0: + version "0.0.1" + resolved "https://registry.yarnpkg.com/https-browserify/-/https-browserify-0.0.1.tgz#3f91365cabe60b77ed0ebba24b454e3e09d95a82" + +ieee754@^1.1.4: + version "1.1.8" + resolved "https://registry.yarnpkg.com/ieee754/-/ieee754-1.1.8.tgz#be33d40ac10ef1926701f6f08a2d86fbfd1ad3e4" + +ignore@^3.2.0: + version "3.3.7" + resolved "https://registry.yarnpkg.com/ignore/-/ignore-3.3.7.tgz#612289bfb3c220e186a58118618d5be8c1bab021" + +imurmurhash@^0.1.4: + version "0.1.4" + resolved "https://registry.yarnpkg.com/imurmurhash/-/imurmurhash-0.1.4.tgz#9218b9b2b928a238b13dc4fb6b6d576f231453ea" + +in-publish@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/in-publish/-/in-publish-2.0.0.tgz#e20ff5e3a2afc2690320b6dc552682a9c7fadf51" + +indexof@0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/indexof/-/indexof-0.0.1.tgz#82dc336d232b9062179d05ab3293a66059fd435d" + +inflight@^1.0.4: + version "1.0.6" + resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" + dependencies: + once "^1.3.0" + wrappy "1" + +inherits@2, inherits@^2.0.1, inherits@^2.0.3, inherits@~2.0.0, inherits@~2.0.1, inherits@~2.0.3: + version "2.0.3" + resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" + +inherits@2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.1.tgz#b17d08d326b4423e568eff719f91b0b1cbdf69f1" + +inline-source-map@~0.6.0: + version "0.6.2" + resolved "https://registry.yarnpkg.com/inline-source-map/-/inline-source-map-0.6.2.tgz#f9393471c18a79d1724f863fa38b586370ade2a5" + dependencies: + source-map "~0.5.3" + +inquirer@^0.12.0: + version "0.12.0" + resolved "https://registry.yarnpkg.com/inquirer/-/inquirer-0.12.0.tgz#1ef2bfd63504df0bc75785fff8c2c41df12f077e" + dependencies: + ansi-escapes "^1.1.0" + ansi-regex "^2.0.0" + chalk "^1.0.0" + cli-cursor "^1.0.1" + cli-width "^2.0.0" + figures "^1.3.5" + lodash "^4.3.0" + readline2 "^1.0.1" + run-async "^0.1.0" + rx-lite "^3.1.2" + string-width "^1.0.1" + strip-ansi "^3.0.0" + through "^2.3.6" + +insert-module-globals@^7.0.0: + version "7.0.1" + resolved "https://registry.yarnpkg.com/insert-module-globals/-/insert-module-globals-7.0.1.tgz#c03bf4e01cb086d5b5e5ace8ad0afe7889d638c3" + dependencies: + JSONStream "^1.0.3" + combine-source-map "~0.7.1" + concat-stream "~1.5.1" + is-buffer "^1.1.0" + lexical-scope "^1.2.0" + process "~0.11.0" + through2 "^2.0.0" + xtend "^4.0.0" + +interpret@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/interpret/-/interpret-1.1.0.tgz#7ed1b1410c6a0e0f78cf95d3b8440c63f78b8614" + +is-buffer@^1.1.0, is-buffer@^1.1.5: + version "1.1.6" + resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.6.tgz#efaa2ea9daa0d7ab2ea13a97b2b8ad51fefbe8be" + +is-callable@^1.1.1, is-callable@^1.1.3: + version "1.1.3" + resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.1.3.tgz#86eb75392805ddc33af71c92a0eedf74ee7604b2" + +is-date-object@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/is-date-object/-/is-date-object-1.0.1.tgz#9aa20eb6aeebbff77fbd33e74ca01b33581d3a16" + +is-fullwidth-code-point@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz#ef9e31386f031a7f0d643af82fde50c457ef00cb" + dependencies: + number-is-nan "^1.0.0" + +is-fullwidth-code-point@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz#a3b30a5c4f199183167aaab93beefae3ddfb654f" + +is-function@~1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/is-function/-/is-function-1.0.1.tgz#12cfb98b65b57dd3d193a3121f5f6e2f437602b5" + +is-my-json-valid@^2.10.0, is-my-json-valid@^2.12.4: + version "2.17.1" + resolved "https://registry.yarnpkg.com/is-my-json-valid/-/is-my-json-valid-2.17.1.tgz#3da98914a70a22f0a8563ef1511a246c6fc55471" + dependencies: + generate-function "^2.0.0" + generate-object-property "^1.1.0" + jsonpointer "^4.0.0" + xtend "^4.0.0" + +is-node-modern@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-node-modern/-/is-node-modern-1.0.0.tgz#cfe2607be7403b05b28a566f66cbf8a583d4fc63" + +is-path-cwd@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-path-cwd/-/is-path-cwd-1.0.0.tgz#d225ec23132e89edd38fda767472e62e65f1106d" + +is-path-in-cwd@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-path-in-cwd/-/is-path-in-cwd-1.0.0.tgz#6477582b8214d602346094567003be8a9eac04dc" + dependencies: + is-path-inside "^1.0.0" + +is-path-inside@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/is-path-inside/-/is-path-inside-1.0.1.tgz#8ef5b7de50437a3fdca6b4e865ef7aa55cb48036" + dependencies: + path-is-inside "^1.0.1" + +is-property@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/is-property/-/is-property-1.0.2.tgz#57fe1c4e48474edd65b09911f26b1cd4095dda84" + +is-regex@^1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/is-regex/-/is-regex-1.0.4.tgz#5517489b547091b0930e095654ced25ee97e9491" + dependencies: + has "^1.0.1" + +is-resolvable@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/is-resolvable/-/is-resolvable-1.1.0.tgz#fb18f87ce1feb925169c9a407c19318a3206ed88" + +is-stream@^1.0.1: + version "1.1.0" + resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-1.1.0.tgz#12d4a3dd4e68e0b79ceb8dbc84173ae80d91ca44" + +is-symbol@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/is-symbol/-/is-symbol-1.0.1.tgz#3cc59f00025194b6ab2e38dbae6689256b660572" + +is-typedarray@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-typedarray/-/is-typedarray-1.0.0.tgz#e479c80858df0c1b11ddda6940f96011fcda4a9a" + +isarray@^1.0.0, isarray@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" + +isarray@~0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/isarray/-/isarray-0.0.1.tgz#8a18acfca9a8f4177e09abfc6038939b05d1eedf" + +isexe@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" + +isstream@~0.1.2: + version "0.1.2" + resolved "https://registry.yarnpkg.com/isstream/-/isstream-0.1.2.tgz#47e63f7af55afa6f92e1500e690eb8b8529c099a" + +istanbul@^0.4.5: + version "0.4.5" + resolved "https://registry.yarnpkg.com/istanbul/-/istanbul-0.4.5.tgz#65c7d73d4c4da84d4f3ac310b918fb0b8033733b" + dependencies: + abbrev "1.0.x" + async "1.x" + escodegen "1.8.x" + esprima "2.7.x" + glob "^5.0.15" + handlebars "^4.0.1" + js-yaml "3.x" + mkdirp "0.5.x" + nopt "3.x" + once "1.x" + resolve "1.1.x" + supports-color "^3.1.0" + which "^1.1.1" + wordwrap "^1.0.0" + +js-tokens@^3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-3.0.2.tgz#9866df395102130e38f7f996bceb65443209c25b" + +js-yaml@3.6.1: + version "3.6.1" + resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.6.1.tgz#6e5fe67d8b205ce4d22fad05b7781e8dadcc4b30" + dependencies: + argparse "^1.0.7" + esprima "^2.6.0" + +js-yaml@3.x, js-yaml@^3.5.1: + version "3.10.0" + resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.10.0.tgz#2e78441646bd4682e963f22b6e92823c309c62dc" + dependencies: + argparse "^1.0.7" + esprima "^4.0.0" + +jsbn@~0.1.0: + version "0.1.1" + resolved "https://registry.yarnpkg.com/jsbn/-/jsbn-0.1.1.tgz#a5e654c2e5a2deb5f201d96cefbca80c0ef2f513" + +json-schema-traverse@^0.3.0: + version "0.3.1" + resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-0.3.1.tgz#349a6d44c53a51de89b40805c5d5e59b417d3340" + +json-schema@0.2.3: + version "0.2.3" + resolved "https://registry.yarnpkg.com/json-schema/-/json-schema-0.2.3.tgz#b480c892e59a2f05954ce727bd3f2a4e882f9e13" + +json-stable-stringify@^1.0.0, json-stable-stringify@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/json-stable-stringify/-/json-stable-stringify-1.0.1.tgz#9a759d39c5f2ff503fd5300646ed445f88c4f9af" + dependencies: + jsonify "~0.0.0" + +json-stable-stringify@~0.0.0: + version "0.0.1" + resolved "https://registry.yarnpkg.com/json-stable-stringify/-/json-stable-stringify-0.0.1.tgz#611c23e814db375527df851193db59dd2af27f45" + dependencies: + jsonify "~0.0.0" + +json-stringify-safe@~5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz#1296a2d58fd45f19a0f6ce01d65701e2c735b6eb" + +jsonfile@^2.1.0: + version "2.4.0" + resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-2.4.0.tgz#3736a2b428b87bbda0cc83b53fa3d633a35c2ae8" + optionalDependencies: + graceful-fs "^4.1.6" + +jsonify@~0.0.0: + version "0.0.0" + resolved "https://registry.yarnpkg.com/jsonify/-/jsonify-0.0.0.tgz#2c74b6ee41d93ca51b7b5aaee8f503631d252a73" + +jsonparse@^1.2.0: + version "1.3.1" + resolved "https://registry.yarnpkg.com/jsonparse/-/jsonparse-1.3.1.tgz#3f4dae4a91fac315f71062f8521cc239f1366280" + +jsonpointer@^4.0.0: + version "4.0.1" + resolved "https://registry.yarnpkg.com/jsonpointer/-/jsonpointer-4.0.1.tgz#4fd92cb34e0e9db3c89c8622ecf51f9b978c6cb9" + +jsprim@^1.2.2: + version "1.4.1" + resolved "https://registry.yarnpkg.com/jsprim/-/jsprim-1.4.1.tgz#313e66bc1e5cc06e438bc1b7499c2e5c56acb6a2" + dependencies: + assert-plus "1.0.0" + extsprintf "1.3.0" + json-schema "0.2.3" + verror "1.10.0" + +kew@^0.7.0: + version "0.7.0" + resolved "https://registry.yarnpkg.com/kew/-/kew-0.7.0.tgz#79d93d2d33363d6fdd2970b335d9141ad591d79b" + +kind-of@^3.0.2: + version "3.2.2" + resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-3.2.2.tgz#31ea21a734bab9bbb0f32466d893aea51e4a3c64" + dependencies: + is-buffer "^1.1.5" + +klaw@^1.0.0: + version "1.3.1" + resolved "https://registry.yarnpkg.com/klaw/-/klaw-1.3.1.tgz#4088433b46b3b1ba259d78785d8e96f73ba02439" + optionalDependencies: + graceful-fs "^4.1.9" + +labeled-stream-splicer@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/labeled-stream-splicer/-/labeled-stream-splicer-2.0.0.tgz#a52e1d138024c00b86b1c0c91f677918b8ae0a59" + dependencies: + inherits "^2.0.1" + isarray "~0.0.1" + stream-splicer "^2.0.0" + +lazy-cache@^1.0.3: + version "1.0.4" + resolved "https://registry.yarnpkg.com/lazy-cache/-/lazy-cache-1.0.4.tgz#a1d78fc3a50474cb80845d3b3b6e1da49a446e8e" + +lcov-parse@0.0.10: + version "0.0.10" + resolved "https://registry.yarnpkg.com/lcov-parse/-/lcov-parse-0.0.10.tgz#1b0b8ff9ac9c7889250582b70b71315d9da6d9a3" + +levn@^0.3.0, levn@~0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/levn/-/levn-0.3.0.tgz#3b09924edf9f083c0490fdd4c0bc4421e04764ee" + dependencies: + prelude-ls "~1.1.2" + type-check "~0.3.2" + +lexical-scope@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/lexical-scope/-/lexical-scope-1.2.0.tgz#fcea5edc704a4b3a8796cdca419c3a0afaf22df4" + dependencies: + astw "^2.0.0" + +lodash.memoize@~3.0.3: + version "3.0.4" + resolved "https://registry.yarnpkg.com/lodash.memoize/-/lodash.memoize-3.0.4.tgz#2dcbd2c287cbc0a55cc42328bd0c736150d53e3f" + +lodash@^4.0.0, lodash@^4.3.0: + version "4.17.5" + resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.5.tgz#99a92d65c0272debe8c96b6057bc8fbfa3bed511" + +log-driver@1.2.5: + version "1.2.5" + resolved "https://registry.yarnpkg.com/log-driver/-/log-driver-1.2.5.tgz#7ae4ec257302fd790d557cb10c97100d857b0056" + +longest@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/longest/-/longest-1.0.1.tgz#30a0b2da38f73770e8294a0d22e6625ed77d0097" + +lru-cache@^4.0.1: + version "4.1.1" + resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-4.1.1.tgz#622e32e82488b49279114a4f9ecf45e7cd6bba55" + dependencies: + pseudomap "^1.0.2" + yallist "^2.1.2" + +map-limit@0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/map-limit/-/map-limit-0.0.1.tgz#eb7961031c0f0e8d001bf2d56fab685d58822f38" + dependencies: + once "~1.3.0" + +md5.js@^1.3.4: + version "1.3.4" + resolved "https://registry.yarnpkg.com/md5.js/-/md5.js-1.3.4.tgz#e9bdbde94a20a5ac18b04340fc5764d5b09d901d" + dependencies: + hash-base "^3.0.0" + inherits "^2.0.1" + +miller-rabin@^4.0.0: + version "4.0.1" + resolved "https://registry.yarnpkg.com/miller-rabin/-/miller-rabin-4.0.1.tgz#f080351c865b0dc562a8462966daa53543c78a4d" + dependencies: + bn.js "^4.0.0" + brorand "^1.0.1" + +mime-db@~1.30.0: + version "1.30.0" + resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.30.0.tgz#74c643da2dd9d6a45399963465b26d5ca7d71f01" + +mime-types@^2.1.12, mime-types@~2.1.17, mime-types@~2.1.7: + version "2.1.17" + resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.17.tgz#09d7a393f03e995a79f8af857b70a9e0ab16557a" + dependencies: + mime-db "~1.30.0" + +minimalistic-assert@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/minimalistic-assert/-/minimalistic-assert-1.0.0.tgz#702be2dda6b37f4836bcb3f5db56641b64a1d3d3" + +minimalistic-crypto-utils@^1.0.0, minimalistic-crypto-utils@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz#f6c00c1c0b082246e5c4d99dfb8c7c083b2b582a" + +"minimatch@2 || 3", minimatch@^3.0.0, minimatch@^3.0.4: + version "3.0.4" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" + dependencies: + brace-expansion "^1.1.7" + +minimist@0.0.8: + version "0.0.8" + resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d" + +minimist@1.2.0, minimist@^1.1.0, minimist@^1.1.1, minimist@^1.2.0, minimist@~1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.0.tgz#a35008b20f41383eec1fb914f4cd5df79a264284" + +minimist@~0.0.1: + version "0.0.10" + resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.10.tgz#de3f98543dbf96082be48ad1a0c7cda836301dcf" + +mkdirp@0.5.0: + version "0.5.0" + resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.0.tgz#1d73076a6df986cd9344e15e71fcc05a4c9abf12" + dependencies: + minimist "0.0.8" + +mkdirp@0.5.x, "mkdirp@>=0.5 0", mkdirp@^0.5.0, mkdirp@^0.5.1: + version "0.5.1" + resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.1.tgz#30057438eac6cf7f8c4767f38648d6697d75c903" + dependencies: + minimist "0.0.8" + +module-deps@^4.0.8: + version "4.1.1" + resolved "https://registry.yarnpkg.com/module-deps/-/module-deps-4.1.1.tgz#23215833f1da13fd606ccb8087b44852dcb821fd" + dependencies: + JSONStream "^1.0.3" + browser-resolve "^1.7.0" + cached-path-relative "^1.0.0" + concat-stream "~1.5.0" + defined "^1.0.0" + detective "^4.0.0" + duplexer2 "^0.1.2" + inherits "^2.0.1" + parents "^1.0.0" + readable-stream "^2.0.2" + resolve "^1.1.3" + stream-combiner2 "^1.1.1" + subarg "^1.0.0" + through2 "^2.0.0" + xtend "^4.0.0" + +ms@2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8" + +mute-stream@0.0.5: + version "0.0.5" + resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-0.0.5.tgz#8fbfabb0a98a253d3184331f9e8deb7372fac6c0" + +natural-compare@^1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7" + +node-uuid@~1.4.7: + version "1.4.8" + resolved "https://registry.yarnpkg.com/node-uuid/-/node-uuid-1.4.8.tgz#b040eb0923968afabf8d32fb1f17f1167fdab907" + +nopt@3.x: + version "3.0.6" + resolved "https://registry.yarnpkg.com/nopt/-/nopt-3.0.6.tgz#c6465dbf08abcd4db359317f79ac68a646b28ff9" + dependencies: + abbrev "1" + +number-is-nan@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/number-is-nan/-/number-is-nan-1.0.1.tgz#097b602b53422a522c1afb8790318336941a011d" + +oauth-sign@~0.8.1, oauth-sign@~0.8.2: + version "0.8.2" + resolved "https://registry.yarnpkg.com/oauth-sign/-/oauth-sign-0.8.2.tgz#46a6ab7f0aead8deae9ec0565780b7d4efeb9d43" + +obake@^0.1.2: + version "0.1.2" + resolved "https://registry.yarnpkg.com/obake/-/obake-0.1.2.tgz#64a477c9ddfbbccc18cff3a750924974d22c29d3" + dependencies: + envar "^2.0.0" + ghostface "^1.5.0" + +object-assign@^4.0.1, object-assign@^4.1.0: + version "4.1.1" + resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" + +object-inspect@~1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.3.0.tgz#5b1eb8e6742e2ee83342a637034d844928ba2f6d" + +object-keys@^1.0.8: + version "1.0.11" + resolved "https://registry.yarnpkg.com/object-keys/-/object-keys-1.0.11.tgz#c54601778ad560f1142ce0e01bcca8b56d13426d" + +once@1.x, once@^1.3.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" + dependencies: + wrappy "1" + +once@~1.3.0: + version "1.3.3" + resolved "https://registry.yarnpkg.com/once/-/once-1.3.3.tgz#b2e261557ce4c314ec8304f3fa82663e4297ca20" + dependencies: + wrappy "1" + +onetime@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/onetime/-/onetime-1.1.0.tgz#a1f7838f8314c516f05ecefcbc4ccfe04b4ed789" + +oop@0.0.3: + version "0.0.3" + resolved "https://registry.yarnpkg.com/oop/-/oop-0.0.3.tgz#70fa405a5650891a194fdc82ca68dad6dabf4401" + +optimist@^0.6.1: + version "0.6.1" + resolved "https://registry.yarnpkg.com/optimist/-/optimist-0.6.1.tgz#da3ea74686fa21a19a111c326e90eb15a0196686" + dependencies: + minimist "~0.0.1" + wordwrap "~0.0.2" + +optionator@^0.8.1, optionator@^0.8.2: + version "0.8.2" + resolved "https://registry.yarnpkg.com/optionator/-/optionator-0.8.2.tgz#364c5e409d3f4d6301d6c0b4c05bba50180aeb64" + dependencies: + deep-is "~0.1.3" + fast-levenshtein "~2.0.4" + levn "~0.3.0" + prelude-ls "~1.1.2" + type-check "~0.3.2" + wordwrap "~1.0.0" + +os-browserify@~0.1.1: + version "0.1.2" + resolved "https://registry.yarnpkg.com/os-browserify/-/os-browserify-0.1.2.tgz#49ca0293e0b19590a5f5de10c7f265a617d8fe54" + +os-homedir@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/os-homedir/-/os-homedir-1.0.2.tgz#ffbc4988336e0e833de0c168c7ef152121aa7fb3" + +os-shim@^0.1.2: + version "0.1.3" + resolved "https://registry.yarnpkg.com/os-shim/-/os-shim-0.1.3.tgz#6b62c3791cf7909ea35ed46e17658bb417cb3917" + +pako@~0.2.0: + version "0.2.9" + resolved "https://registry.yarnpkg.com/pako/-/pako-0.2.9.tgz#f3f7522f4ef782348da8161bad9ecfd51bf83a75" + +parents@^1.0.0, parents@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/parents/-/parents-1.0.1.tgz#fedd4d2bf193a77745fe71e371d73c3307d9c751" + dependencies: + path-platform "~0.11.15" + +parse-asn1@^5.0.0: + version "5.1.0" + resolved "https://registry.yarnpkg.com/parse-asn1/-/parse-asn1-5.1.0.tgz#37c4f9b7ed3ab65c74817b5f2480937fbf97c712" + dependencies: + asn1.js "^4.0.0" + browserify-aes "^1.0.0" + create-hash "^1.1.0" + evp_bytestokey "^1.0.0" + pbkdf2 "^3.0.3" + +path-browserify@~0.0.0: + version "0.0.0" + resolved "https://registry.yarnpkg.com/path-browserify/-/path-browserify-0.0.0.tgz#a0b870729aae214005b7d5032ec2cbbb0fb4451a" + +path-is-absolute@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" + +path-is-inside@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/path-is-inside/-/path-is-inside-1.0.2.tgz#365417dede44430d1c11af61027facf074bdfc53" + +path-parse@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.5.tgz#3c1adf871ea9cd6c9431b6ea2bd74a0ff055c4c1" + +path-platform@~0.11.15: + version "0.11.15" + resolved "https://registry.yarnpkg.com/path-platform/-/path-platform-0.11.15.tgz#e864217f74c36850f0852b78dc7bf7d4a5721bf2" + +pbkdf2@^3.0.3: + version "3.0.14" + resolved "https://registry.yarnpkg.com/pbkdf2/-/pbkdf2-3.0.14.tgz#a35e13c64799b06ce15320f459c230e68e73bade" + dependencies: + create-hash "^1.1.2" + create-hmac "^1.1.4" + ripemd160 "^2.0.1" + safe-buffer "^5.0.1" + sha.js "^2.4.8" + +pend@~1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/pend/-/pend-1.2.0.tgz#7a57eb550a6783f9115331fcf4663d5c8e007a50" + +performance-now@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/performance-now/-/performance-now-2.1.0.tgz#6309f4e0e5fa913ec1c69307ae364b4b377c9e7b" + +phantomjs-prebuilt@^2.1.13: + version "2.1.16" + resolved "https://registry.yarnpkg.com/phantomjs-prebuilt/-/phantomjs-prebuilt-2.1.16.tgz#efd212a4a3966d3647684ea8ba788549be2aefef" + dependencies: + es6-promise "^4.0.3" + extract-zip "^1.6.5" + fs-extra "^1.0.0" + hasha "^2.2.0" + kew "^0.7.0" + progress "^1.1.8" + request "^2.81.0" + request-progress "^2.0.1" + which "^1.2.10" + +pify@^2.0.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/pify/-/pify-2.3.0.tgz#ed141a6ac043a849ea588498e7dca8b15330e90c" + +pinkie-promise@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/pinkie-promise/-/pinkie-promise-2.0.1.tgz#2135d6dfa7a358c069ac9b178776288228450ffa" + dependencies: + pinkie "^2.0.0" + +pinkie@^2.0.0: + version "2.0.4" + resolved "https://registry.yarnpkg.com/pinkie/-/pinkie-2.0.4.tgz#72556b80cfa0d48a974e80e77248e80ed4f7f870" + +pkgfiles@^2.3.0: + version "2.3.2" + resolved "https://registry.yarnpkg.com/pkgfiles/-/pkgfiles-2.3.2.tgz#1b54a7a8dbe32caa84b0955f44917e1500d33d05" + dependencies: + columnify "^1.5.4" + du "^0.1.0" + fstream-npm "^1.2.0" + map-limit "0.0.1" + minimist "^1.2.0" + pkgresolve "^1.1.4" + pretty-bytes "^4.0.2" + +pkgresolve@^1.1.4: + version "1.1.4" + resolved "https://registry.yarnpkg.com/pkgresolve/-/pkgresolve-1.1.4.tgz#0fa499ca366888c31e97357446c6053025ae47b6" + dependencies: + minimist "~1.2.0" + +pluralize@^1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/pluralize/-/pluralize-1.2.1.tgz#d1a21483fd22bb41e58a12fa3421823140897c45" + +pre-commit@^1.1.3: + version "1.2.2" + resolved "https://registry.yarnpkg.com/pre-commit/-/pre-commit-1.2.2.tgz#dbcee0ee9de7235e57f79c56d7ce94641a69eec6" + dependencies: + cross-spawn "^5.0.1" + spawn-sync "^1.0.15" + which "1.2.x" + +prelude-ls@~1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.1.2.tgz#21932a549f5e52ffd9a827f570e04be62a97da54" + +pretty-bytes@^4.0.2: + version "4.0.2" + resolved "https://registry.yarnpkg.com/pretty-bytes/-/pretty-bytes-4.0.2.tgz#b2bf82e7350d65c6c33aa95aaa5a4f6327f61cd9" + +process-nextick-args@~1.0.6: + version "1.0.7" + resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-1.0.7.tgz#150e20b756590ad3f91093f25a4f2ad8bff30ba3" + +process-nextick-args@~2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-2.0.0.tgz#a37d732f4271b4ab1ad070d35508e8290788ffaa" + +process@~0.11.0: + version "0.11.10" + resolved "https://registry.yarnpkg.com/process/-/process-0.11.10.tgz#7332300e840161bda3e69a1d1d91a7d4bc16f182" + +progress@^1.1.8: + version "1.1.8" + resolved "https://registry.yarnpkg.com/progress/-/progress-1.1.8.tgz#e260c78f6161cdd9b0e56cc3e0a85de17c7a57be" + +pseudomap@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/pseudomap/-/pseudomap-1.0.2.tgz#f052a28da70e618917ef0a8ac34c1ae5a68286b3" + +public-encrypt@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/public-encrypt/-/public-encrypt-4.0.0.tgz#39f699f3a46560dd5ebacbca693caf7c65c18cc6" + dependencies: + bn.js "^4.1.0" + browserify-rsa "^4.0.0" + create-hash "^1.1.0" + parse-asn1 "^5.0.0" + randombytes "^2.0.1" + +punycode@1.3.2: + version "1.3.2" + resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.3.2.tgz#9653a036fb7c1ee42342f2325cceefea3926c48d" + +punycode@^1.3.2, punycode@^1.4.1: + version "1.4.1" + resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.4.1.tgz#c0d5a63b2718800ad8e1eb0fa5269c84dd41845e" + +qs@~6.3.0: + version "6.3.2" + resolved "https://registry.yarnpkg.com/qs/-/qs-6.3.2.tgz#e75bd5f6e268122a2a0e0bda630b2550c166502c" + +qs@~6.5.1: + version "6.5.1" + resolved "https://registry.yarnpkg.com/qs/-/qs-6.5.1.tgz#349cdf6eef89ec45c12d7d5eb3fc0c870343a6d8" + +querystring-es3@~0.2.0: + version "0.2.1" + resolved "https://registry.yarnpkg.com/querystring-es3/-/querystring-es3-0.2.1.tgz#9ec61f79049875707d69414596fd907a4d711e73" + +querystring@0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/querystring/-/querystring-0.2.0.tgz#b209849203bb25df820da756e747005878521620" + +randombytes@^2.0.0, randombytes@^2.0.1, randombytes@^2.0.5: + version "2.0.6" + resolved "https://registry.yarnpkg.com/randombytes/-/randombytes-2.0.6.tgz#d302c522948588848a8d300c932b44c24231da80" + dependencies: + safe-buffer "^5.1.0" + +randomfill@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/randomfill/-/randomfill-1.0.3.tgz#b96b7df587f01dd91726c418f30553b1418e3d62" + dependencies: + randombytes "^2.0.5" + safe-buffer "^5.1.0" + +read-only-stream@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/read-only-stream/-/read-only-stream-2.0.0.tgz#2724fd6a8113d73764ac288d4386270c1dbf17f0" + dependencies: + readable-stream "^2.0.2" + +readable-stream@^2.0.2, readable-stream@^2.1.5, readable-stream@^2.2.2, readable-stream@^2.3.3: + version "2.3.4" + resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.4.tgz#c946c3f47fa7d8eabc0b6150f4a12f69a4574071" + dependencies: + core-util-is "~1.0.0" + inherits "~2.0.3" + isarray "~1.0.0" + process-nextick-args "~2.0.0" + safe-buffer "~5.1.1" + string_decoder "~1.0.3" + util-deprecate "~1.0.1" + +readable-stream@~2.0.0: + version "2.0.6" + resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.0.6.tgz#8f90341e68a53ccc928788dacfcd11b36eb9b78e" + dependencies: + core-util-is "~1.0.0" + inherits "~2.0.1" + isarray "~1.0.0" + process-nextick-args "~1.0.6" + string_decoder "~0.10.x" + util-deprecate "~1.0.1" + +readline2@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/readline2/-/readline2-1.0.1.tgz#41059608ffc154757b715d9989d199ffbf372e35" + dependencies: + code-point-at "^1.0.0" + is-fullwidth-code-point "^1.0.0" + mute-stream "0.0.5" + +rechoir@^0.6.2: + version "0.6.2" + resolved "https://registry.yarnpkg.com/rechoir/-/rechoir-0.6.2.tgz#85204b54dba82d5742e28c96756ef43af50e3384" + dependencies: + resolve "^1.1.6" + +repeat-string@^1.5.2: + version "1.6.1" + resolved "https://registry.yarnpkg.com/repeat-string/-/repeat-string-1.6.1.tgz#8dcae470e1c88abc2d600fff4a776286da75e637" + +request-progress@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/request-progress/-/request-progress-2.0.1.tgz#5d36bb57961c673aa5b788dbc8141fdf23b44e08" + dependencies: + throttleit "^1.0.0" + +request@2.76.0: + version "2.76.0" + resolved "https://registry.yarnpkg.com/request/-/request-2.76.0.tgz#be44505afef70360a0436955106be3945d95560e" + dependencies: + aws-sign2 "~0.6.0" + aws4 "^1.2.1" + caseless "~0.11.0" + combined-stream "~1.0.5" + extend "~3.0.0" + forever-agent "~0.6.1" + form-data "~2.1.1" + har-validator "~2.0.6" + hawk "~3.1.3" + http-signature "~1.1.0" + is-typedarray "~1.0.0" + isstream "~0.1.2" + json-stringify-safe "~5.0.1" + mime-types "~2.1.7" + node-uuid "~1.4.7" + oauth-sign "~0.8.1" + qs "~6.3.0" + stringstream "~0.0.4" + tough-cookie "~2.3.0" + tunnel-agent "~0.4.1" + +request@2.79.0: + version "2.79.0" + resolved "https://registry.yarnpkg.com/request/-/request-2.79.0.tgz#4dfe5bf6be8b8cdc37fcf93e04b65577722710de" + dependencies: + aws-sign2 "~0.6.0" + aws4 "^1.2.1" + caseless "~0.11.0" + combined-stream "~1.0.5" + extend "~3.0.0" + forever-agent "~0.6.1" + form-data "~2.1.1" + har-validator "~2.0.6" + hawk "~3.1.3" + http-signature "~1.1.0" + is-typedarray "~1.0.0" + isstream "~0.1.2" + json-stringify-safe "~5.0.1" + mime-types "~2.1.7" + oauth-sign "~0.8.1" + qs "~6.3.0" + stringstream "~0.0.4" + tough-cookie "~2.3.0" + tunnel-agent "~0.4.1" + uuid "^3.0.0" + +request@^2.81.0: + version "2.83.0" + resolved "https://registry.yarnpkg.com/request/-/request-2.83.0.tgz#ca0b65da02ed62935887808e6f510381034e3356" + dependencies: + aws-sign2 "~0.7.0" + aws4 "^1.6.0" + caseless "~0.12.0" + combined-stream "~1.0.5" + extend "~3.0.1" + forever-agent "~0.6.1" + form-data "~2.3.1" + har-validator "~5.0.3" + hawk "~6.0.2" + http-signature "~1.2.0" + is-typedarray "~1.0.0" + isstream "~0.1.2" + json-stringify-safe "~5.0.1" + mime-types "~2.1.17" + oauth-sign "~0.8.2" + performance-now "^2.1.0" + qs "~6.5.1" + safe-buffer "^5.1.1" + stringstream "~0.0.5" + tough-cookie "~2.3.3" + tunnel-agent "^0.6.0" + uuid "^3.1.0" + +require-uncached@^1.0.2: + version "1.0.3" + resolved "https://registry.yarnpkg.com/require-uncached/-/require-uncached-1.0.3.tgz#4e0d56d6c9662fd31e43011c4b95aa49955421d3" + dependencies: + caller-path "^0.1.0" + resolve-from "^1.0.0" + +resolve-from@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-1.0.1.tgz#26cbfe935d1aeeeabb29bc3fe5aeb01e93d44226" + +resolve@1.1.7, resolve@1.1.x: + version "1.1.7" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.1.7.tgz#203114d82ad2c5ed9e8e0411b3932875e889e97b" + +resolve@^1.1.3, resolve@^1.1.4, resolve@^1.1.6: + version "1.5.0" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.5.0.tgz#1f09acce796c9a762579f31b2c1cc4c3cddf9f36" + dependencies: + path-parse "^1.0.5" + +resolve@~1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.4.0.tgz#a75be01c53da25d934a98ebd0e4c4a7312f92a86" + dependencies: + path-parse "^1.0.5" + +restore-cursor@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/restore-cursor/-/restore-cursor-1.0.1.tgz#34661f46886327fed2991479152252df92daa541" + dependencies: + exit-hook "^1.0.0" + onetime "^1.0.0" + +resumer@~0.0.0: + version "0.0.0" + resolved "https://registry.yarnpkg.com/resumer/-/resumer-0.0.0.tgz#f1e8f461e4064ba39e82af3cdc2a8c893d076759" + dependencies: + through "~2.3.4" + +right-align@^0.1.1: + version "0.1.3" + resolved "https://registry.yarnpkg.com/right-align/-/right-align-0.1.3.tgz#61339b722fe6a3515689210d24e14c96148613ef" + dependencies: + align-text "^0.1.1" + +rimraf@2, rimraf@^2.2.8, rimraf@^2.5.4: + version "2.6.2" + resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.6.2.tgz#2ed8150d24a16ea8651e6d6ef0f47c4158ce7a36" + dependencies: + glob "^7.0.5" + +ripemd160@^2.0.0, ripemd160@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/ripemd160/-/ripemd160-2.0.1.tgz#0f4584295c53a3628af7e6d79aca21ce57d1c6e7" + dependencies: + hash-base "^2.0.0" + inherits "^2.0.1" + +run-async@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/run-async/-/run-async-0.1.0.tgz#c8ad4a5e110661e402a7d21b530e009f25f8e389" + dependencies: + once "^1.3.0" + +rx-lite@^3.1.2: + version "3.1.2" + resolved "https://registry.yarnpkg.com/rx-lite/-/rx-lite-3.1.2.tgz#19ce502ca572665f3b647b10939f97fd1615f102" + +safe-buffer@^5.0.1, safe-buffer@^5.1.0, safe-buffer@^5.1.1, safe-buffer@~5.1.0, safe-buffer@~5.1.1: + version "5.1.1" + resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.1.tgz#893312af69b2123def71f57889001671eeb2c853" + +semver@^4.3.3: + version "4.3.6" + resolved "https://registry.yarnpkg.com/semver/-/semver-4.3.6.tgz#300bc6e0e86374f7ba61068b5b1ecd57fc6532da" + +sha.js@^2.4.0, sha.js@^2.4.8, sha.js@~2.4.4: + version "2.4.10" + resolved "https://registry.yarnpkg.com/sha.js/-/sha.js-2.4.10.tgz#b1fde5cd7d11a5626638a07c604ab909cfa31f9b" + dependencies: + inherits "^2.0.1" + safe-buffer "^5.0.1" + +shasum@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/shasum/-/shasum-1.0.2.tgz#e7012310d8f417f4deb5712150e5678b87ae565f" + dependencies: + json-stable-stringify "~0.0.0" + sha.js "~2.4.4" + +shebang-command@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-1.2.0.tgz#44aac65b695b03398968c39f363fee5deafdf1ea" + dependencies: + shebang-regex "^1.0.0" + +shebang-regex@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-1.0.0.tgz#da42f49740c0b42db2ca9728571cb190c98efea3" + +shell-quote@^1.6.1: + version "1.6.1" + resolved "https://registry.yarnpkg.com/shell-quote/-/shell-quote-1.6.1.tgz#f4781949cce402697127430ea3b3c5476f481767" + dependencies: + array-filter "~0.0.0" + array-map "~0.0.0" + array-reduce "~0.0.0" + jsonify "~0.0.0" + +shelljs@^0.7.5: + version "0.7.8" + resolved "https://registry.yarnpkg.com/shelljs/-/shelljs-0.7.8.tgz#decbcf874b0d1e5fb72e14b164a9683048e9acb3" + dependencies: + glob "^7.0.0" + interpret "^1.0.0" + rechoir "^0.6.2" + +slice-ansi@0.0.4: + version "0.0.4" + resolved "https://registry.yarnpkg.com/slice-ansi/-/slice-ansi-0.0.4.tgz#edbf8903f66f7ce2f8eafd6ceed65e264c831b35" + +sntp@1.x.x: + version "1.0.9" + resolved "https://registry.yarnpkg.com/sntp/-/sntp-1.0.9.tgz#6541184cc90aeea6c6e7b35e2659082443c66198" + dependencies: + hoek "2.x.x" + +sntp@2.x.x: + version "2.1.0" + resolved "https://registry.yarnpkg.com/sntp/-/sntp-2.1.0.tgz#2c6cec14fedc2222739caf9b5c3d85d1cc5a2cc8" + dependencies: + hoek "4.x.x" + +source-map@^0.4.2, source-map@^0.4.4: + version "0.4.4" + resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.4.4.tgz#eba4f5da9c0dc999de68032d8b4f76173652036b" + dependencies: + amdefine ">=0.0.4" + +source-map@~0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.2.0.tgz#dab73fbcfc2ba819b4de03bd6f6eaa48164b3f9d" + dependencies: + amdefine ">=0.0.4" + +source-map@~0.5.1, source-map@~0.5.3: + version "0.5.7" + resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.7.tgz#8a039d2d1021d22d1ea14c80d8ea468ba2ef3fcc" + +spawn-sync@^1.0.15: + version "1.0.15" + resolved "https://registry.yarnpkg.com/spawn-sync/-/spawn-sync-1.0.15.tgz#b00799557eb7fb0c8376c29d44e8a1ea67e57476" + dependencies: + concat-stream "^1.4.7" + os-shim "^0.1.2" + +sprintf-js@~1.0.2: + version "1.0.3" + resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c" + +sshpk@^1.7.0: + version "1.13.1" + resolved "https://registry.yarnpkg.com/sshpk/-/sshpk-1.13.1.tgz#512df6da6287144316dc4c18fe1cf1d940739be3" + dependencies: + asn1 "~0.2.3" + assert-plus "^1.0.0" + dashdash "^1.12.0" + getpass "^0.1.1" + optionalDependencies: + bcrypt-pbkdf "^1.0.0" + ecc-jsbn "~0.1.1" + jsbn "~0.1.0" + tweetnacl "~0.14.0" + +stream-browserify@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/stream-browserify/-/stream-browserify-2.0.1.tgz#66266ee5f9bdb9940a4e4514cafb43bb71e5c9db" + dependencies: + inherits "~2.0.1" + readable-stream "^2.0.2" + +stream-combiner2@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/stream-combiner2/-/stream-combiner2-1.1.1.tgz#fb4d8a1420ea362764e21ad4780397bebcb41cbe" + dependencies: + duplexer2 "~0.1.0" + readable-stream "^2.0.2" + +stream-http@^2.0.0: + version "2.8.0" + resolved "https://registry.yarnpkg.com/stream-http/-/stream-http-2.8.0.tgz#fd86546dac9b1c91aff8fc5d287b98fafb41bc10" + dependencies: + builtin-status-codes "^3.0.0" + inherits "^2.0.1" + readable-stream "^2.3.3" + to-arraybuffer "^1.0.0" + xtend "^4.0.0" + +stream-splicer@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/stream-splicer/-/stream-splicer-2.0.0.tgz#1b63be438a133e4b671cc1935197600175910d83" + dependencies: + inherits "^2.0.1" + readable-stream "^2.0.2" + +string-width@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-1.0.2.tgz#118bdf5b8cdc51a2a7e70d211e07e2b0b9b107d3" + dependencies: + code-point-at "^1.0.0" + is-fullwidth-code-point "^1.0.0" + strip-ansi "^3.0.0" + +string-width@^2.0.0: + version "2.1.1" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-2.1.1.tgz#ab93f27a8dc13d28cac815c462143a6d9012ae9e" + dependencies: + is-fullwidth-code-point "^2.0.0" + strip-ansi "^4.0.0" + +string.prototype.trim@~1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/string.prototype.trim/-/string.prototype.trim-1.1.2.tgz#d04de2c89e137f4d7d206f086b5ed2fae6be8cea" + dependencies: + define-properties "^1.1.2" + es-abstract "^1.5.0" + function-bind "^1.0.2" + +string_decoder@~0.10.0, string_decoder@~0.10.x: + version "0.10.31" + resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-0.10.31.tgz#62e203bc41766c6c28c9fc84301dab1c5310fa94" + +string_decoder@~1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.0.3.tgz#0fc67d7c141825de94282dd536bec6b9bce860ab" + dependencies: + safe-buffer "~5.1.0" + +stringstream@~0.0.4, stringstream@~0.0.5: + version "0.0.5" + resolved "https://registry.yarnpkg.com/stringstream/-/stringstream-0.0.5.tgz#4e484cd4de5a0bbbee18e46307710a8a81621878" + +strip-ansi@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-3.0.1.tgz#6a385fb8853d952d5ff05d0e8aaf94278dc63dcf" + dependencies: + ansi-regex "^2.0.0" + +strip-ansi@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-4.0.0.tgz#a8479022eb1ac368a871389b635262c505ee368f" + dependencies: + ansi-regex "^3.0.0" + +strip-bom@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-3.0.0.tgz#2334c18e9c759f7bdd56fdef7e9ae3d588e68ed3" + +strip-json-comments@~2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a" + +subarg@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/subarg/-/subarg-1.0.0.tgz#f62cf17581e996b48fc965699f54c06ae268b8d2" + dependencies: + minimist "^1.1.0" + +supports-color@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-2.0.0.tgz#535d045ce6b6363fa40117084629995e9df324c7" + +supports-color@^3.1.0: + version "3.2.3" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-3.2.3.tgz#65ac0504b3954171d8a64946b2ae3cbb8a5f54f6" + dependencies: + has-flag "^1.0.0" + +syntax-error@^1.1.1: + version "1.4.0" + resolved "https://registry.yarnpkg.com/syntax-error/-/syntax-error-1.4.0.tgz#2d9d4ff5c064acb711594a3e3b95054ad51d907c" + dependencies: + acorn-node "^1.2.0" + +table@^3.7.8: + version "3.8.3" + resolved "https://registry.yarnpkg.com/table/-/table-3.8.3.tgz#2bbc542f0fda9861a755d3947fefd8b3f513855f" + dependencies: + ajv "^4.7.0" + ajv-keywords "^1.0.0" + chalk "^1.1.1" + lodash "^4.0.0" + slice-ansi "0.0.4" + string-width "^2.0.0" + +tape@^4.6.2: + version "4.8.0" + resolved "https://registry.yarnpkg.com/tape/-/tape-4.8.0.tgz#f6a9fec41cc50a1de50fa33603ab580991f6068e" + dependencies: + deep-equal "~1.0.1" + defined "~1.0.0" + for-each "~0.3.2" + function-bind "~1.1.0" + glob "~7.1.2" + has "~1.0.1" + inherits "~2.0.3" + minimist "~1.2.0" + object-inspect "~1.3.0" + resolve "~1.4.0" + resumer "~0.0.0" + string.prototype.trim "~1.1.2" + through "~2.3.8" + +text-table@~0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/text-table/-/text-table-0.2.0.tgz#7f5ee823ae805207c00af2df4a84ec3fcfa570b4" + +throttleit@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/throttleit/-/throttleit-1.0.0.tgz#9e785836daf46743145a5984b6268d828528ac6c" + +through2@^2.0.0: + version "2.0.3" + resolved "https://registry.yarnpkg.com/through2/-/through2-2.0.3.tgz#0004569b37c7c74ba39c43f3ced78d1ad94140be" + dependencies: + readable-stream "^2.1.5" + xtend "~4.0.1" + +"through@>=2.2.7 <3", through@^2.3.6, through@^2.3.8, through@~2.3.4, through@~2.3.8: + version "2.3.8" + resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5" + +timers-browserify@^1.0.1: + version "1.4.2" + resolved "https://registry.yarnpkg.com/timers-browserify/-/timers-browserify-1.4.2.tgz#c9c58b575be8407375cb5e2462dacee74359f41d" + dependencies: + process "~0.11.0" + +to-arraybuffer@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/to-arraybuffer/-/to-arraybuffer-1.0.1.tgz#7d229b1fcc637e466ca081180836a7aabff83f43" + +tough-cookie@~2.3.0, tough-cookie@~2.3.3: + version "2.3.3" + resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-2.3.3.tgz#0b618a5565b6dea90bf3425d04d55edc475a7561" + dependencies: + punycode "^1.4.1" + +tty-browserify@~0.0.0: + version "0.0.1" + resolved "https://registry.yarnpkg.com/tty-browserify/-/tty-browserify-0.0.1.tgz#3f05251ee17904dfd0677546670db9651682b811" + +tunnel-agent@^0.6.0: + version "0.6.0" + resolved "https://registry.yarnpkg.com/tunnel-agent/-/tunnel-agent-0.6.0.tgz#27a5dea06b36b04a0a9966774b290868f0fc40fd" + dependencies: + safe-buffer "^5.0.1" + +tunnel-agent@~0.4.1: + version "0.4.3" + resolved "https://registry.yarnpkg.com/tunnel-agent/-/tunnel-agent-0.4.3.tgz#6373db76909fe570e08d73583365ed828a74eeeb" + +tweetnacl@^0.14.3, tweetnacl@~0.14.0: + version "0.14.5" + resolved "https://registry.yarnpkg.com/tweetnacl/-/tweetnacl-0.14.5.tgz#5ae68177f192d4456269d108afa93ff8743f4f64" + +type-check@~0.3.2: + version "0.3.2" + resolved "https://registry.yarnpkg.com/type-check/-/type-check-0.3.2.tgz#5884cab512cf1d355e3fb784f30804b2b520db72" + dependencies: + prelude-ls "~1.1.2" + +typedarray@^0.0.6, typedarray@~0.0.5: + version "0.0.6" + resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" + +uglify-js@^2.6: + version "2.8.29" + resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-2.8.29.tgz#29c5733148057bb4e1f75df35b7a9cb72e6a59dd" + dependencies: + source-map "~0.5.1" + yargs "~3.10.0" + optionalDependencies: + uglify-to-browserify "~1.0.0" + +uglify-to-browserify@~1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/uglify-to-browserify/-/uglify-to-browserify-1.0.2.tgz#6e0924d6bda6b5afe349e39a6d632850a0f882b7" + +umd@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/umd/-/umd-3.0.1.tgz#8ae556e11011f63c2596708a8837259f01b3d60e" + +url@~0.11.0: + version "0.11.0" + resolved "https://registry.yarnpkg.com/url/-/url-0.11.0.tgz#3838e97cfc60521eb73c525a8e55bfdd9e2e28f1" + dependencies: + punycode "1.3.2" + querystring "0.2.0" + +user-home@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/user-home/-/user-home-2.0.0.tgz#9c70bfd8169bc1dcbf48604e0f04b8b49cde9e9f" + dependencies: + os-homedir "^1.0.0" + +util-deprecate@~1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" + +util@0.10.3, util@~0.10.1: + version "0.10.3" + resolved "https://registry.yarnpkg.com/util/-/util-0.10.3.tgz#7afb1afe50805246489e3db7fe0ed379336ac0f9" + dependencies: + inherits "2.0.1" + +uuid@^3.0.0, uuid@^3.1.0: + version "3.2.1" + resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.2.1.tgz#12c528bb9d58d0b9265d9a2f6f0fe8be17ff1f14" + +verror@1.10.0: + version "1.10.0" + resolved "https://registry.yarnpkg.com/verror/-/verror-1.10.0.tgz#3a105ca17053af55d6e270c1f8288682e18da400" + dependencies: + assert-plus "^1.0.0" + core-util-is "1.0.2" + extsprintf "^1.2.0" + +vm-browserify@~0.0.1: + version "0.0.4" + resolved "https://registry.yarnpkg.com/vm-browserify/-/vm-browserify-0.0.4.tgz#5d7ea45bbef9e4a6ff65f95438e0a87c357d5a73" + dependencies: + indexof "0.0.1" + +wcwidth@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/wcwidth/-/wcwidth-1.0.1.tgz#f0b0dcf915bc5ff1528afadb2c0e17b532da2fe8" + dependencies: + defaults "^1.0.3" + +which@1.2.x: + version "1.2.14" + resolved "https://registry.yarnpkg.com/which/-/which-1.2.14.tgz#9a87c4378f03e827cecaf1acdf56c736c01c14e5" + dependencies: + isexe "^2.0.0" + +which@^1.0.9, which@^1.1.1, which@^1.2.10, which@^1.2.9: + version "1.3.0" + resolved "https://registry.yarnpkg.com/which/-/which-1.3.0.tgz#ff04bdfc010ee547d780bec38e1ac1c2777d253a" + dependencies: + isexe "^2.0.0" + +window-size@0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/window-size/-/window-size-0.1.0.tgz#5438cd2ea93b202efa3a19fe8887aee7c94f9c9d" + +wordwrap@0.0.2: + version "0.0.2" + resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-0.0.2.tgz#b79669bb42ecb409f83d583cad52ca17eaa1643f" + +wordwrap@^1.0.0, wordwrap@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-1.0.0.tgz#27584810891456a4171c8d0226441ade90cbcaeb" + +wordwrap@~0.0.2: + version "0.0.3" + resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-0.0.3.tgz#a3d5da6cd5c0bc0008d37234bbaf1bed63059107" + +wrappy@1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" + +write@^0.2.1: + version "0.2.1" + resolved "https://registry.yarnpkg.com/write/-/write-0.2.1.tgz#5fc03828e264cea3fe91455476f7a3c566cb0757" + dependencies: + mkdirp "^0.5.1" + +xtend@^4.0.0, xtend@^4.0.1, xtend@~4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/xtend/-/xtend-4.0.1.tgz#a5c6d532be656e23db820efb943a1f04998d63af" + +yallist@^2.1.2: + version "2.1.2" + resolved "https://registry.yarnpkg.com/yallist/-/yallist-2.1.2.tgz#1c11f9218f076089a47dd512f93c6699a6a81d52" + +yargs@~3.10.0: + version "3.10.0" + resolved "https://registry.yarnpkg.com/yargs/-/yargs-3.10.0.tgz#f7ee7bd857dd7c1d2d38c0e74efbd681d1431fd1" + dependencies: + camelcase "^1.0.2" + cliui "^2.1.0" + decamelize "^1.0.0" + window-size "0.1.0" + +yauzl@2.4.1: + version "2.4.1" + resolved "https://registry.yarnpkg.com/yauzl/-/yauzl-2.4.1.tgz#9528f442dab1b2284e58b4379bb194e22e0c4005" + dependencies: + fd-slicer "~1.0.1" diff --git a/deps/npm/node_modules/from2/.travis.yml b/deps/npm/node_modules/from2/.travis.yml deleted file mode 100644 index b03ffabcabda22..00000000000000 --- a/deps/npm/node_modules/from2/.travis.yml +++ /dev/null @@ -1,8 +0,0 @@ -language: node_js -before_install: - - npm install -g npm -node_js: - - "0.8" - - "0.10" - - "0.12" - - "iojs" diff --git a/deps/npm/node_modules/from2/LICENSE.md b/deps/npm/node_modules/from2/LICENSE.md deleted file mode 100644 index 146cb32a7ded92..00000000000000 --- a/deps/npm/node_modules/from2/LICENSE.md +++ /dev/null @@ -1,21 +0,0 @@ -## The MIT License (MIT) ## - -Copyright (c) 2014 Hugh Kennedy - -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/from2/README.md b/deps/npm/node_modules/from2/README.md deleted file mode 100644 index 3e041a412acd4b..00000000000000 --- a/deps/npm/node_modules/from2/README.md +++ /dev/null @@ -1,70 +0,0 @@ -# from2 [![Flattr this!](https://api.flattr.com/button/flattr-badge-large.png)](https://flattr.com/submit/auto?user_id=hughskennedy&url=http://github.com/hughsk/from2&title=from2&description=hughsk/from2%20on%20GitHub&language=en_GB&tags=flattr,github,javascript&category=software)[![experimental](http://hughsk.github.io/stability-badges/dist/experimental.svg)](http://github.com/hughsk/stability-badges) # - -`from2` is a high-level module for creating readable streams that properly handle backpressure. - -Convience wrapper for -[readable-stream](http://github.com/isaacs/readable-stream)'s `ReadableStream` -base class, with an API lifted from -[from](http://github.com/dominictarr/from) and -[through2](http://github.com/rvagg/through2). - -## Usage ## - -[![from2](https://nodei.co/npm/from2.png?mini=true)](https://nodei.co/npm/from2) - -### `stream = from2([opts], read)` ### - -Where `opts` are the options to pass on to the `ReadableStream` constructor, -and `read(size, next)` is called when data is requested from the stream. - -* `size` is the recommended amount of data (in bytes) to retrieve. -* `next(err)` should be called when you're ready to emit more data. - -For example, here's a readable stream that emits the contents of a given -string: - -``` javascript -var from = require('from2') - -function fromString(string) { - return from(function(size, next) { - // if there's no more content - // left in the string, close the stream. - if (string.length <= 0) return next(null, null) - - // Pull in a new chunk of text, - // removing it from the string. - var chunk = string.slice(0, size) - string = string.slice(size) - - // Emit "chunk" from the stream. - next(null, chunk) - }) -} - -// pipe "hello world" out -// to stdout. -fromString('hello world').pipe(process.stdout) -``` - -### `stream = from2.obj([opts], read)` ### - -Shorthand for `from2({ objectMode: true }, read)`. - -### `createStream = from2.ctor([opts], read)` ### - -If you're creating similar streams in quick succession you can improve -performance by generating a stream **constructor** that you can reuse instead -of creating one-off streams on each call. - -Takes the same options as `from2`, instead returning a constructor which you -can use to create new streams. - -### See Also - -- [from2-array](https://github.com/binocarlos/from2-array) - Create a from2 stream based on an array of source values. -- [from2-string](https://github.com/yoshuawuyts/from2-string) - Create a stream from a string. Sugary wrapper around from2. - -## License ## - -MIT. See [LICENSE.md](http://github.com/hughsk/from2/blob/master/LICENSE.md) for details. diff --git a/deps/npm/node_modules/from2/index.js b/deps/npm/node_modules/from2/index.js deleted file mode 100644 index cb200c610aea3a..00000000000000 --- a/deps/npm/node_modules/from2/index.js +++ /dev/null @@ -1,103 +0,0 @@ -var Readable = require('readable-stream').Readable -var inherits = require('inherits') - -module.exports = from2 - -from2.ctor = ctor -from2.obj = obj - -var Proto = ctor() - -function toFunction(list) { - list = list.slice() - return function (_, cb) { - var err = null - var item = list.length ? list.shift() : null - if (item instanceof Error) { - err = item - item = null - } - - cb(err, item) - } -} - -function from2(opts, read) { - if (typeof opts !== 'object' || Array.isArray(opts)) { - read = opts - opts = {} - } - - var rs = new Proto(opts) - rs._from = Array.isArray(read) ? toFunction(read) : (read || noop) - return rs -} - -function ctor(opts, read) { - if (typeof opts === 'function') { - read = opts - opts = {} - } - - opts = defaults(opts) - - inherits(Class, Readable) - function Class(override) { - if (!(this instanceof Class)) return new Class(override) - this._reading = false - this._callback = check - this.destroyed = false - Readable.call(this, override || opts) - - var self = this - var hwm = this._readableState.highWaterMark - - function check(err, data) { - if (self.destroyed) return - if (err) return self.destroy(err) - if (data === null) return self.push(null) - self._reading = false - if (self.push(data)) self._read(hwm) - } - } - - Class.prototype._from = read || noop - Class.prototype._read = function(size) { - if (this._reading || this.destroyed) return - this._reading = true - this._from(size, this._callback) - } - - Class.prototype.destroy = function(err) { - if (this.destroyed) return - this.destroyed = true - - var self = this - process.nextTick(function() { - if (err) self.emit('error', err) - self.emit('close') - }) - } - - return Class -} - -function obj(opts, read) { - if (typeof opts === 'function' || Array.isArray(opts)) { - read = opts - opts = {} - } - - opts = defaults(opts) - opts.objectMode = true - opts.highWaterMark = 16 - - return from2(opts, read) -} - -function noop () {} - -function defaults(opts) { - opts = opts || {} - return opts -} diff --git a/deps/npm/node_modules/from2/node_modules/readable-stream/.travis.yml b/deps/npm/node_modules/from2/node_modules/readable-stream/.travis.yml deleted file mode 100644 index 40992555bf5cc0..00000000000000 --- a/deps/npm/node_modules/from2/node_modules/readable-stream/.travis.yml +++ /dev/null @@ -1,55 +0,0 @@ -sudo: false -language: node_js -before_install: - - npm install -g npm@2 - - test $NPM_LEGACY && npm install -g npm@latest-3 || npm install npm -g -notifications: - email: false -matrix: - fast_finish: true - include: - - node_js: '0.8' - env: - - TASK=test - - NPM_LEGACY=true - - node_js: '0.10' - env: - - TASK=test - - NPM_LEGACY=true - - node_js: '0.11' - env: - - TASK=test - - NPM_LEGACY=true - - node_js: '0.12' - env: - - TASK=test - - NPM_LEGACY=true - - node_js: 1 - env: - - TASK=test - - NPM_LEGACY=true - - node_js: 2 - env: - - TASK=test - - NPM_LEGACY=true - - node_js: 3 - env: - - TASK=test - - NPM_LEGACY=true - - node_js: 4 - env: TASK=test - - node_js: 5 - env: TASK=test - - node_js: 6 - env: TASK=test - - node_js: 7 - env: TASK=test - - node_js: 8 - env: TASK=test - - node_js: 9 - env: TASK=test -script: "npm run $TASK" -env: - global: - - secure: rE2Vvo7vnjabYNULNyLFxOyt98BoJexDqsiOnfiD6kLYYsiQGfr/sbZkPMOFm9qfQG7pjqx+zZWZjGSswhTt+626C0t/njXqug7Yps4c3dFblzGfreQHp7wNX5TFsvrxd6dAowVasMp61sJcRnB2w8cUzoe3RAYUDHyiHktwqMc= - - secure: g9YINaKAdMatsJ28G9jCGbSaguXCyxSTy+pBO6Ch0Cf57ZLOTka3HqDj8p3nV28LUIHZ3ut5WO43CeYKwt4AUtLpBS3a0dndHdY6D83uY6b2qh5hXlrcbeQTq2cvw2y95F7hm4D1kwrgZ7ViqaKggRcEupAL69YbJnxeUDKWEdI= diff --git a/deps/npm/node_modules/from2/node_modules/readable-stream/GOVERNANCE.md b/deps/npm/node_modules/from2/node_modules/readable-stream/GOVERNANCE.md deleted file mode 100644 index 16ffb93f24bece..00000000000000 --- a/deps/npm/node_modules/from2/node_modules/readable-stream/GOVERNANCE.md +++ /dev/null @@ -1,136 +0,0 @@ -### Streams Working Group - -The Node.js Streams is jointly governed by a Working Group -(WG) -that is responsible for high-level guidance of the project. - -The WG has final authority over this project including: - -* Technical direction -* Project governance and process (including this policy) -* Contribution policy -* GitHub repository hosting -* Conduct guidelines -* Maintaining the list of additional Collaborators - -For the current list of WG members, see the project -[README.md](./README.md#current-project-team-members). - -### Collaborators - -The readable-stream GitHub repository is -maintained by the WG and additional Collaborators who are added by the -WG on an ongoing basis. - -Individuals making significant and valuable contributions are made -Collaborators and given commit-access to the project. These -individuals are identified by the WG and their addition as -Collaborators is discussed during the WG meeting. - -_Note:_ If you make a significant contribution and are not considered -for commit-access log an issue or contact a WG member directly and it -will be brought up in the next WG meeting. - -Modifications of the contents of the readable-stream repository are -made on -a collaborative basis. Anybody with a GitHub account may propose a -modification via pull request and it will be considered by the project -Collaborators. All pull requests must be reviewed and accepted by a -Collaborator with sufficient expertise who is able to take full -responsibility for the change. In the case of pull requests proposed -by an existing Collaborator, an additional Collaborator is required -for sign-off. Consensus should be sought if additional Collaborators -participate and there is disagreement around a particular -modification. See _Consensus Seeking Process_ below for further detail -on the consensus model used for governance. - -Collaborators may opt to elevate significant or controversial -modifications, or modifications that have not found consensus to the -WG for discussion by assigning the ***WG-agenda*** tag to a pull -request or issue. The WG should serve as the final arbiter where -required. - -For the current list of Collaborators, see the project -[README.md](./README.md#members). - -### WG Membership - -WG seats are not time-limited. There is no fixed size of the WG. -However, the expected target is between 6 and 12, to ensure adequate -coverage of important areas of expertise, balanced with the ability to -make decisions efficiently. - -There is no specific set of requirements or qualifications for WG -membership beyond these rules. - -The WG may add additional members to the WG by unanimous consensus. - -A WG member may be removed from the WG by voluntary resignation, or by -unanimous consensus of all other WG members. - -Changes to WG membership should be posted in the agenda, and may be -suggested as any other agenda item (see "WG Meetings" below). - -If an addition or removal is proposed during a meeting, and the full -WG is not in attendance to participate, then the addition or removal -is added to the agenda for the subsequent meeting. This is to ensure -that all members are given the opportunity to participate in all -membership decisions. If a WG member is unable to attend a meeting -where a planned membership decision is being made, then their consent -is assumed. - -No more than 1/3 of the WG members may be affiliated with the same -employer. If removal or resignation of a WG member, or a change of -employment by a WG member, creates a situation where more than 1/3 of -the WG membership shares an employer, then the situation must be -immediately remedied by the resignation or removal of one or more WG -members affiliated with the over-represented employer(s). - -### WG Meetings - -The WG meets occasionally on a Google Hangout On Air. A designated moderator -approved by the WG runs the meeting. Each meeting should be -published to YouTube. - -Items are added to the WG agenda that are considered contentious or -are modifications of governance, contribution policy, WG membership, -or release process. - -The intention of the agenda is not to approve or review all patches; -that should happen continuously on GitHub and be handled by the larger -group of Collaborators. - -Any community member or contributor can ask that something be added to -the next meeting's agenda by logging a GitHub Issue. Any Collaborator, -WG member or the moderator can add the item to the agenda by adding -the ***WG-agenda*** tag to the issue. - -Prior to each WG meeting the moderator will share the Agenda with -members of the WG. WG members can add any items they like to the -agenda at the beginning of each meeting. The moderator and the WG -cannot veto or remove items. - -The WG may invite persons or representatives from certain projects to -participate in a non-voting capacity. - -The moderator is responsible for summarizing the discussion of each -agenda item and sends it as a pull request after the meeting. - -### Consensus Seeking Process - -The WG follows a -[Consensus -Seeking](http://en.wikipedia.org/wiki/Consensus-seeking_decision-making) -decision-making model. - -When an agenda item has appeared to reach a consensus the moderator -will ask "Does anyone object?" as a final call for dissent from the -consensus. - -If an agenda item cannot reach a consensus a WG member can call for -either a closing vote or a vote to table the issue to the next -meeting. The call for a vote must be seconded by a majority of the WG -or else the discussion will continue. Simple majority wins. - -Note that changes to WG membership require a majority consensus. See -"WG Membership" above. diff --git a/deps/npm/node_modules/from2/node_modules/readable-stream/LICENSE b/deps/npm/node_modules/from2/node_modules/readable-stream/LICENSE deleted file mode 100644 index 2873b3b2e59507..00000000000000 --- a/deps/npm/node_modules/from2/node_modules/readable-stream/LICENSE +++ /dev/null @@ -1,47 +0,0 @@ -Node.js is licensed for use as follows: - -""" -Copyright Node.js contributors. All rights reserved. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to -deal in the Software without restriction, including without limitation the -rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -sell copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -IN THE SOFTWARE. -""" - -This license applies to parts of Node.js originating from the -https://github.com/joyent/node repository: - -""" -Copyright Joyent, Inc. and other Node contributors. All rights reserved. -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to -deal in the Software without restriction, including without limitation the -rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -sell copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -IN THE SOFTWARE. -""" diff --git a/deps/npm/node_modules/from2/node_modules/readable-stream/README.md b/deps/npm/node_modules/from2/node_modules/readable-stream/README.md deleted file mode 100644 index 23fe3f3e3009a2..00000000000000 --- a/deps/npm/node_modules/from2/node_modules/readable-stream/README.md +++ /dev/null @@ -1,58 +0,0 @@ -# readable-stream - -***Node-core v8.11.1 streams for userland*** [![Build Status](https://travis-ci.org/nodejs/readable-stream.svg?branch=master)](https://travis-ci.org/nodejs/readable-stream) - - -[![NPM](https://nodei.co/npm/readable-stream.png?downloads=true&downloadRank=true)](https://nodei.co/npm/readable-stream/) -[![NPM](https://nodei.co/npm-dl/readable-stream.png?&months=6&height=3)](https://nodei.co/npm/readable-stream/) - - -[![Sauce Test Status](https://saucelabs.com/browser-matrix/readable-stream.svg)](https://saucelabs.com/u/readable-stream) - -```bash -npm install --save readable-stream -``` - -***Node-core streams for userland*** - -This package is a mirror of the Streams2 and Streams3 implementations in -Node-core. - -Full documentation may be found on the [Node.js website](https://nodejs.org/dist/v8.11.1/docs/api/stream.html). - -If you want to guarantee a stable streams base, regardless of what version of -Node you, or the users of your libraries are using, use **readable-stream** *only* and avoid the *"stream"* module in Node-core, for background see [this blogpost](http://r.va.gg/2014/06/why-i-dont-use-nodes-core-stream-module.html). - -As of version 2.0.0 **readable-stream** uses semantic versioning. - -# Streams Working Group - -`readable-stream` is maintained by the Streams Working Group, which -oversees the development and maintenance of the Streams API within -Node.js. The responsibilities of the Streams Working Group include: - -* Addressing stream issues on the Node.js issue tracker. -* Authoring and editing stream documentation within the Node.js project. -* Reviewing changes to stream subclasses within the Node.js project. -* Redirecting changes to streams from the Node.js project to this - project. -* Assisting in the implementation of stream providers within Node.js. -* Recommending versions of `readable-stream` to be included in Node.js. -* Messaging about the future of streams to give the community advance - notice of changes. - - -## Team Members - -* **Chris Dickinson** ([@chrisdickinson](https://github.com/chrisdickinson)) <christopher.s.dickinson@gmail.com> - - Release GPG key: 9554F04D7259F04124DE6B476D5A82AC7E37093B -* **Calvin Metcalf** ([@calvinmetcalf](https://github.com/calvinmetcalf)) <calvin.metcalf@gmail.com> - - Release GPG key: F3EF5F62A87FC27A22E643F714CE4FF5015AA242 -* **Rod Vagg** ([@rvagg](https://github.com/rvagg)) <rod@vagg.org> - - Release GPG key: DD8F2338BAE7501E3DD5AC78C273792F7D83545D -* **Sam Newman** ([@sonewman](https://github.com/sonewman)) <newmansam@outlook.com> -* **Mathias Buus** ([@mafintosh](https://github.com/mafintosh)) <mathiasbuus@gmail.com> -* **Domenic Denicola** ([@domenic](https://github.com/domenic)) <d@domenic.me> -* **Matteo Collina** ([@mcollina](https://github.com/mcollina)) <matteo.collina@gmail.com> - - Release GPG key: 3ABC01543F22DD2239285CDD818674489FBC127E -* **Irina Shestak** ([@lrlna](https://github.com/lrlna)) <shestak.irina@gmail.com> diff --git a/deps/npm/node_modules/from2/node_modules/readable-stream/doc/wg-meetings/2015-01-30.md b/deps/npm/node_modules/from2/node_modules/readable-stream/doc/wg-meetings/2015-01-30.md deleted file mode 100644 index 83275f192e4077..00000000000000 --- a/deps/npm/node_modules/from2/node_modules/readable-stream/doc/wg-meetings/2015-01-30.md +++ /dev/null @@ -1,60 +0,0 @@ -# streams WG Meeting 2015-01-30 - -## Links - -* **Google Hangouts Video**: http://www.youtube.com/watch?v=I9nDOSGfwZg -* **GitHub Issue**: https://github.com/iojs/readable-stream/issues/106 -* **Original Minutes Google Doc**: https://docs.google.com/document/d/17aTgLnjMXIrfjgNaTUnHQO7m3xgzHR2VXBTmi03Qii4/ - -## Agenda - -Extracted from https://github.com/iojs/readable-stream/labels/wg-agenda prior to meeting. - -* adopt a charter [#105](https://github.com/iojs/readable-stream/issues/105) -* release and versioning strategy [#101](https://github.com/iojs/readable-stream/issues/101) -* simpler stream creation [#102](https://github.com/iojs/readable-stream/issues/102) -* proposal: deprecate implicit flowing of streams [#99](https://github.com/iojs/readable-stream/issues/99) - -## Minutes - -### adopt a charter - -* group: +1's all around - -### What versioning scheme should be adopted? -* group: +1’s 3.0.0 -* domenic+group: pulling in patches from other sources where appropriate -* mikeal: version independently, suggesting versions for io.js -* mikeal+domenic: work with TC to notify in advance of changes -simpler stream creation - -### streamline creation of streams -* sam: streamline creation of streams -* domenic: nice simple solution posted - but, we lose the opportunity to change the model - may not be backwards incompatible (double check keys) - - **action item:** domenic will check - -### remove implicit flowing of streams on(‘data’) -* add isFlowing / isPaused -* mikeal: worrying that we’re documenting polyfill methods – confuses users -* domenic: more reflective API is probably good, with warning labels for users -* new section for mad scientists (reflective stream access) -* calvin: name the “third state” -* mikeal: maybe borrow the name from whatwg? -* domenic: we’re missing the “third state” -* consensus: kind of difficult to name the third state -* mikeal: figure out differences in states / compat -* mathias: always flow on data – eliminates third state - * explore what it breaks - -**action items:** -* ask isaac for ability to list packages by what public io.js APIs they use (esp. Stream) -* ask rod/build for infrastructure -* **chris**: explore the “flow on data” approach -* add isPaused/isFlowing -* add new docs section -* move isPaused to that section - - diff --git a/deps/npm/node_modules/from2/node_modules/readable-stream/duplex-browser.js b/deps/npm/node_modules/from2/node_modules/readable-stream/duplex-browser.js deleted file mode 100644 index f8b2db83dbe733..00000000000000 --- a/deps/npm/node_modules/from2/node_modules/readable-stream/duplex-browser.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./lib/_stream_duplex.js'); diff --git a/deps/npm/node_modules/from2/node_modules/readable-stream/duplex.js b/deps/npm/node_modules/from2/node_modules/readable-stream/duplex.js deleted file mode 100644 index 46924cbfdf5387..00000000000000 --- a/deps/npm/node_modules/from2/node_modules/readable-stream/duplex.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./readable').Duplex diff --git a/deps/npm/node_modules/from2/node_modules/readable-stream/lib/_stream_duplex.js b/deps/npm/node_modules/from2/node_modules/readable-stream/lib/_stream_duplex.js deleted file mode 100644 index a1ca813e5acbd8..00000000000000 --- a/deps/npm/node_modules/from2/node_modules/readable-stream/lib/_stream_duplex.js +++ /dev/null @@ -1,131 +0,0 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - -// a duplex stream is just a stream that is both readable and writable. -// Since JS doesn't have multiple prototypal inheritance, this class -// prototypally inherits from Readable, and then parasitically from -// Writable. - -'use strict'; - -/**/ - -var pna = require('process-nextick-args'); -/**/ - -/**/ -var objectKeys = Object.keys || function (obj) { - var keys = []; - for (var key in obj) { - keys.push(key); - }return keys; -}; -/**/ - -module.exports = Duplex; - -/**/ -var util = require('core-util-is'); -util.inherits = require('inherits'); -/**/ - -var Readable = require('./_stream_readable'); -var Writable = require('./_stream_writable'); - -util.inherits(Duplex, Readable); - -{ - // avoid scope creep, the keys array can then be collected - var keys = objectKeys(Writable.prototype); - for (var v = 0; v < keys.length; v++) { - var method = keys[v]; - if (!Duplex.prototype[method]) Duplex.prototype[method] = Writable.prototype[method]; - } -} - -function Duplex(options) { - if (!(this instanceof Duplex)) return new Duplex(options); - - Readable.call(this, options); - Writable.call(this, options); - - if (options && options.readable === false) this.readable = false; - - if (options && options.writable === false) this.writable = false; - - this.allowHalfOpen = true; - if (options && options.allowHalfOpen === false) this.allowHalfOpen = false; - - this.once('end', onend); -} - -Object.defineProperty(Duplex.prototype, 'writableHighWaterMark', { - // making it explicit this property is not enumerable - // because otherwise some prototype manipulation in - // userland will fail - enumerable: false, - get: function () { - return this._writableState.highWaterMark; - } -}); - -// the no-half-open enforcer -function onend() { - // if we allow half-open state, or if the writable side ended, - // then we're ok. - if (this.allowHalfOpen || this._writableState.ended) return; - - // no more data can be written. - // But allow more writes to happen in this tick. - pna.nextTick(onEndNT, this); -} - -function onEndNT(self) { - self.end(); -} - -Object.defineProperty(Duplex.prototype, 'destroyed', { - get: function () { - if (this._readableState === undefined || this._writableState === undefined) { - return false; - } - return this._readableState.destroyed && this._writableState.destroyed; - }, - set: function (value) { - // we ignore the value if the stream - // has not been initialized yet - if (this._readableState === undefined || this._writableState === undefined) { - return; - } - - // backward compatibility, the user is explicitly - // managing destroyed - this._readableState.destroyed = value; - this._writableState.destroyed = value; - } -}); - -Duplex.prototype._destroy = function (err, cb) { - this.push(null); - this.end(); - - pna.nextTick(cb, err); -}; \ No newline at end of file diff --git a/deps/npm/node_modules/from2/node_modules/readable-stream/lib/_stream_passthrough.js b/deps/npm/node_modules/from2/node_modules/readable-stream/lib/_stream_passthrough.js deleted file mode 100644 index a9c835884828d8..00000000000000 --- a/deps/npm/node_modules/from2/node_modules/readable-stream/lib/_stream_passthrough.js +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - -// a passthrough stream. -// basically just the most minimal sort of Transform stream. -// Every written chunk gets output as-is. - -'use strict'; - -module.exports = PassThrough; - -var Transform = require('./_stream_transform'); - -/**/ -var util = require('core-util-is'); -util.inherits = require('inherits'); -/**/ - -util.inherits(PassThrough, Transform); - -function PassThrough(options) { - if (!(this instanceof PassThrough)) return new PassThrough(options); - - Transform.call(this, options); -} - -PassThrough.prototype._transform = function (chunk, encoding, cb) { - cb(null, chunk); -}; \ No newline at end of file diff --git a/deps/npm/node_modules/from2/node_modules/readable-stream/lib/_stream_readable.js b/deps/npm/node_modules/from2/node_modules/readable-stream/lib/_stream_readable.js deleted file mode 100644 index bf34ac65e1108f..00000000000000 --- a/deps/npm/node_modules/from2/node_modules/readable-stream/lib/_stream_readable.js +++ /dev/null @@ -1,1019 +0,0 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - -'use strict'; - -/**/ - -var pna = require('process-nextick-args'); -/**/ - -module.exports = Readable; - -/**/ -var isArray = require('isarray'); -/**/ - -/**/ -var Duplex; -/**/ - -Readable.ReadableState = ReadableState; - -/**/ -var EE = require('events').EventEmitter; - -var EElistenerCount = function (emitter, type) { - return emitter.listeners(type).length; -}; -/**/ - -/**/ -var Stream = require('./internal/streams/stream'); -/**/ - -/**/ - -var Buffer = require('safe-buffer').Buffer; -var OurUint8Array = global.Uint8Array || function () {}; -function _uint8ArrayToBuffer(chunk) { - return Buffer.from(chunk); -} -function _isUint8Array(obj) { - return Buffer.isBuffer(obj) || obj instanceof OurUint8Array; -} - -/**/ - -/**/ -var util = require('core-util-is'); -util.inherits = require('inherits'); -/**/ - -/**/ -var debugUtil = require('util'); -var debug = void 0; -if (debugUtil && debugUtil.debuglog) { - debug = debugUtil.debuglog('stream'); -} else { - debug = function () {}; -} -/**/ - -var BufferList = require('./internal/streams/BufferList'); -var destroyImpl = require('./internal/streams/destroy'); -var StringDecoder; - -util.inherits(Readable, Stream); - -var kProxyEvents = ['error', 'close', 'destroy', 'pause', 'resume']; - -function prependListener(emitter, event, fn) { - // Sadly this is not cacheable as some libraries bundle their own - // event emitter implementation with them. - if (typeof emitter.prependListener === 'function') return emitter.prependListener(event, fn); - - // This is a hack to make sure that our error handler is attached before any - // userland ones. NEVER DO THIS. This is here only because this code needs - // to continue to work with older versions of Node.js that do not include - // the prependListener() method. The goal is to eventually remove this hack. - if (!emitter._events || !emitter._events[event]) emitter.on(event, fn);else if (isArray(emitter._events[event])) emitter._events[event].unshift(fn);else emitter._events[event] = [fn, emitter._events[event]]; -} - -function ReadableState(options, stream) { - Duplex = Duplex || require('./_stream_duplex'); - - options = options || {}; - - // Duplex streams are both readable and writable, but share - // the same options object. - // However, some cases require setting options to different - // values for the readable and the writable sides of the duplex stream. - // These options can be provided separately as readableXXX and writableXXX. - var isDuplex = stream instanceof Duplex; - - // object stream flag. Used to make read(n) ignore n and to - // make all the buffer merging and length checks go away - this.objectMode = !!options.objectMode; - - if (isDuplex) this.objectMode = this.objectMode || !!options.readableObjectMode; - - // the point at which it stops calling _read() to fill the buffer - // Note: 0 is a valid value, means "don't call _read preemptively ever" - var hwm = options.highWaterMark; - var readableHwm = options.readableHighWaterMark; - var defaultHwm = this.objectMode ? 16 : 16 * 1024; - - if (hwm || hwm === 0) this.highWaterMark = hwm;else if (isDuplex && (readableHwm || readableHwm === 0)) this.highWaterMark = readableHwm;else this.highWaterMark = defaultHwm; - - // cast to ints. - this.highWaterMark = Math.floor(this.highWaterMark); - - // A linked list is used to store data chunks instead of an array because the - // linked list can remove elements from the beginning faster than - // array.shift() - this.buffer = new BufferList(); - this.length = 0; - this.pipes = null; - this.pipesCount = 0; - this.flowing = null; - this.ended = false; - this.endEmitted = false; - this.reading = false; - - // a flag to be able to tell if the event 'readable'/'data' is emitted - // immediately, or on a later tick. We set this to true at first, because - // any actions that shouldn't happen until "later" should generally also - // not happen before the first read call. - this.sync = true; - - // whenever we return null, then we set a flag to say - // that we're awaiting a 'readable' event emission. - this.needReadable = false; - this.emittedReadable = false; - this.readableListening = false; - this.resumeScheduled = false; - - // has it been destroyed - this.destroyed = false; - - // Crypto is kind of old and crusty. Historically, its default string - // encoding is 'binary' so we have to make this configurable. - // Everything else in the universe uses 'utf8', though. - this.defaultEncoding = options.defaultEncoding || 'utf8'; - - // the number of writers that are awaiting a drain event in .pipe()s - this.awaitDrain = 0; - - // if true, a maybeReadMore has been scheduled - this.readingMore = false; - - this.decoder = null; - this.encoding = null; - if (options.encoding) { - if (!StringDecoder) StringDecoder = require('string_decoder/').StringDecoder; - this.decoder = new StringDecoder(options.encoding); - this.encoding = options.encoding; - } -} - -function Readable(options) { - Duplex = Duplex || require('./_stream_duplex'); - - if (!(this instanceof Readable)) return new Readable(options); - - this._readableState = new ReadableState(options, this); - - // legacy - this.readable = true; - - if (options) { - if (typeof options.read === 'function') this._read = options.read; - - if (typeof options.destroy === 'function') this._destroy = options.destroy; - } - - Stream.call(this); -} - -Object.defineProperty(Readable.prototype, 'destroyed', { - get: function () { - if (this._readableState === undefined) { - return false; - } - return this._readableState.destroyed; - }, - set: function (value) { - // we ignore the value if the stream - // has not been initialized yet - if (!this._readableState) { - return; - } - - // backward compatibility, the user is explicitly - // managing destroyed - this._readableState.destroyed = value; - } -}); - -Readable.prototype.destroy = destroyImpl.destroy; -Readable.prototype._undestroy = destroyImpl.undestroy; -Readable.prototype._destroy = function (err, cb) { - this.push(null); - cb(err); -}; - -// Manually shove something into the read() buffer. -// This returns true if the highWaterMark has not been hit yet, -// similar to how Writable.write() returns true if you should -// write() some more. -Readable.prototype.push = function (chunk, encoding) { - var state = this._readableState; - var skipChunkCheck; - - if (!state.objectMode) { - if (typeof chunk === 'string') { - encoding = encoding || state.defaultEncoding; - if (encoding !== state.encoding) { - chunk = Buffer.from(chunk, encoding); - encoding = ''; - } - skipChunkCheck = true; - } - } else { - skipChunkCheck = true; - } - - return readableAddChunk(this, chunk, encoding, false, skipChunkCheck); -}; - -// Unshift should *always* be something directly out of read() -Readable.prototype.unshift = function (chunk) { - return readableAddChunk(this, chunk, null, true, false); -}; - -function readableAddChunk(stream, chunk, encoding, addToFront, skipChunkCheck) { - var state = stream._readableState; - if (chunk === null) { - state.reading = false; - onEofChunk(stream, state); - } else { - var er; - if (!skipChunkCheck) er = chunkInvalid(state, chunk); - if (er) { - stream.emit('error', er); - } else if (state.objectMode || chunk && chunk.length > 0) { - if (typeof chunk !== 'string' && !state.objectMode && Object.getPrototypeOf(chunk) !== Buffer.prototype) { - chunk = _uint8ArrayToBuffer(chunk); - } - - if (addToFront) { - if (state.endEmitted) stream.emit('error', new Error('stream.unshift() after end event'));else addChunk(stream, state, chunk, true); - } else if (state.ended) { - stream.emit('error', new Error('stream.push() after EOF')); - } else { - state.reading = false; - if (state.decoder && !encoding) { - chunk = state.decoder.write(chunk); - if (state.objectMode || chunk.length !== 0) addChunk(stream, state, chunk, false);else maybeReadMore(stream, state); - } else { - addChunk(stream, state, chunk, false); - } - } - } else if (!addToFront) { - state.reading = false; - } - } - - return needMoreData(state); -} - -function addChunk(stream, state, chunk, addToFront) { - if (state.flowing && state.length === 0 && !state.sync) { - stream.emit('data', chunk); - stream.read(0); - } else { - // update the buffer info. - state.length += state.objectMode ? 1 : chunk.length; - if (addToFront) state.buffer.unshift(chunk);else state.buffer.push(chunk); - - if (state.needReadable) emitReadable(stream); - } - maybeReadMore(stream, state); -} - -function chunkInvalid(state, chunk) { - var er; - if (!_isUint8Array(chunk) && typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) { - er = new TypeError('Invalid non-string/buffer chunk'); - } - return er; -} - -// if it's past the high water mark, we can push in some more. -// Also, if we have no data yet, we can stand some -// more bytes. This is to work around cases where hwm=0, -// such as the repl. Also, if the push() triggered a -// readable event, and the user called read(largeNumber) such that -// needReadable was set, then we ought to push more, so that another -// 'readable' event will be triggered. -function needMoreData(state) { - return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0); -} - -Readable.prototype.isPaused = function () { - return this._readableState.flowing === false; -}; - -// backwards compatibility. -Readable.prototype.setEncoding = function (enc) { - if (!StringDecoder) StringDecoder = require('string_decoder/').StringDecoder; - this._readableState.decoder = new StringDecoder(enc); - this._readableState.encoding = enc; - return this; -}; - -// Don't raise the hwm > 8MB -var MAX_HWM = 0x800000; -function computeNewHighWaterMark(n) { - if (n >= MAX_HWM) { - n = MAX_HWM; - } else { - // Get the next highest power of 2 to prevent increasing hwm excessively in - // tiny amounts - n--; - n |= n >>> 1; - n |= n >>> 2; - n |= n >>> 4; - n |= n >>> 8; - n |= n >>> 16; - n++; - } - return n; -} - -// This function is designed to be inlinable, so please take care when making -// changes to the function body. -function howMuchToRead(n, state) { - if (n <= 0 || state.length === 0 && state.ended) return 0; - if (state.objectMode) return 1; - if (n !== n) { - // Only flow one buffer at a time - if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length; - } - // If we're asking for more than the current hwm, then raise the hwm. - if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n); - if (n <= state.length) return n; - // Don't have enough - if (!state.ended) { - state.needReadable = true; - return 0; - } - return state.length; -} - -// you can override either this method, or the async _read(n) below. -Readable.prototype.read = function (n) { - debug('read', n); - n = parseInt(n, 10); - var state = this._readableState; - var nOrig = n; - - if (n !== 0) state.emittedReadable = false; - - // if we're doing read(0) to trigger a readable event, but we - // already have a bunch of data in the buffer, then just trigger - // the 'readable' event and move on. - if (n === 0 && state.needReadable && (state.length >= state.highWaterMark || state.ended)) { - debug('read: emitReadable', state.length, state.ended); - if (state.length === 0 && state.ended) endReadable(this);else emitReadable(this); - return null; - } - - n = howMuchToRead(n, state); - - // if we've ended, and we're now clear, then finish it up. - if (n === 0 && state.ended) { - if (state.length === 0) endReadable(this); - return null; - } - - // All the actual chunk generation logic needs to be - // *below* the call to _read. The reason is that in certain - // synthetic stream cases, such as passthrough streams, _read - // may be a completely synchronous operation which may change - // the state of the read buffer, providing enough data when - // before there was *not* enough. - // - // So, the steps are: - // 1. Figure out what the state of things will be after we do - // a read from the buffer. - // - // 2. If that resulting state will trigger a _read, then call _read. - // Note that this may be asynchronous, or synchronous. Yes, it is - // deeply ugly to write APIs this way, but that still doesn't mean - // that the Readable class should behave improperly, as streams are - // designed to be sync/async agnostic. - // Take note if the _read call is sync or async (ie, if the read call - // has returned yet), so that we know whether or not it's safe to emit - // 'readable' etc. - // - // 3. Actually pull the requested chunks out of the buffer and return. - - // if we need a readable event, then we need to do some reading. - var doRead = state.needReadable; - debug('need readable', doRead); - - // if we currently have less than the highWaterMark, then also read some - if (state.length === 0 || state.length - n < state.highWaterMark) { - doRead = true; - debug('length less than watermark', doRead); - } - - // however, if we've ended, then there's no point, and if we're already - // reading, then it's unnecessary. - if (state.ended || state.reading) { - doRead = false; - debug('reading or ended', doRead); - } else if (doRead) { - debug('do read'); - state.reading = true; - state.sync = true; - // if the length is currently zero, then we *need* a readable event. - if (state.length === 0) state.needReadable = true; - // call internal read method - this._read(state.highWaterMark); - state.sync = false; - // If _read pushed data synchronously, then `reading` will be false, - // and we need to re-evaluate how much data we can return to the user. - if (!state.reading) n = howMuchToRead(nOrig, state); - } - - var ret; - if (n > 0) ret = fromList(n, state);else ret = null; - - if (ret === null) { - state.needReadable = true; - n = 0; - } else { - state.length -= n; - } - - if (state.length === 0) { - // If we have nothing in the buffer, then we want to know - // as soon as we *do* get something into the buffer. - if (!state.ended) state.needReadable = true; - - // If we tried to read() past the EOF, then emit end on the next tick. - if (nOrig !== n && state.ended) endReadable(this); - } - - if (ret !== null) this.emit('data', ret); - - return ret; -}; - -function onEofChunk(stream, state) { - if (state.ended) return; - if (state.decoder) { - var chunk = state.decoder.end(); - if (chunk && chunk.length) { - state.buffer.push(chunk); - state.length += state.objectMode ? 1 : chunk.length; - } - } - state.ended = true; - - // emit 'readable' now to make sure it gets picked up. - emitReadable(stream); -} - -// Don't emit readable right away in sync mode, because this can trigger -// another read() call => stack overflow. This way, it might trigger -// a nextTick recursion warning, but that's not so bad. -function emitReadable(stream) { - var state = stream._readableState; - state.needReadable = false; - if (!state.emittedReadable) { - debug('emitReadable', state.flowing); - state.emittedReadable = true; - if (state.sync) pna.nextTick(emitReadable_, stream);else emitReadable_(stream); - } -} - -function emitReadable_(stream) { - debug('emit readable'); - stream.emit('readable'); - flow(stream); -} - -// at this point, the user has presumably seen the 'readable' event, -// and called read() to consume some data. that may have triggered -// in turn another _read(n) call, in which case reading = true if -// it's in progress. -// However, if we're not ended, or reading, and the length < hwm, -// then go ahead and try to read some more preemptively. -function maybeReadMore(stream, state) { - if (!state.readingMore) { - state.readingMore = true; - pna.nextTick(maybeReadMore_, stream, state); - } -} - -function maybeReadMore_(stream, state) { - var len = state.length; - while (!state.reading && !state.flowing && !state.ended && state.length < state.highWaterMark) { - debug('maybeReadMore read 0'); - stream.read(0); - if (len === state.length) - // didn't get any data, stop spinning. - break;else len = state.length; - } - state.readingMore = false; -} - -// abstract method. to be overridden in specific implementation classes. -// call cb(er, data) where data is <= n in length. -// for virtual (non-string, non-buffer) streams, "length" is somewhat -// arbitrary, and perhaps not very meaningful. -Readable.prototype._read = function (n) { - this.emit('error', new Error('_read() is not implemented')); -}; - -Readable.prototype.pipe = function (dest, pipeOpts) { - var src = this; - var state = this._readableState; - - switch (state.pipesCount) { - case 0: - state.pipes = dest; - break; - case 1: - state.pipes = [state.pipes, dest]; - break; - default: - state.pipes.push(dest); - break; - } - state.pipesCount += 1; - debug('pipe count=%d opts=%j', state.pipesCount, pipeOpts); - - var doEnd = (!pipeOpts || pipeOpts.end !== false) && dest !== process.stdout && dest !== process.stderr; - - var endFn = doEnd ? onend : unpipe; - if (state.endEmitted) pna.nextTick(endFn);else src.once('end', endFn); - - dest.on('unpipe', onunpipe); - function onunpipe(readable, unpipeInfo) { - debug('onunpipe'); - if (readable === src) { - if (unpipeInfo && unpipeInfo.hasUnpiped === false) { - unpipeInfo.hasUnpiped = true; - cleanup(); - } - } - } - - function onend() { - debug('onend'); - dest.end(); - } - - // when the dest drains, it reduces the awaitDrain counter - // on the source. This would be more elegant with a .once() - // handler in flow(), but adding and removing repeatedly is - // too slow. - var ondrain = pipeOnDrain(src); - dest.on('drain', ondrain); - - var cleanedUp = false; - function cleanup() { - debug('cleanup'); - // cleanup event handlers once the pipe is broken - dest.removeListener('close', onclose); - dest.removeListener('finish', onfinish); - dest.removeListener('drain', ondrain); - dest.removeListener('error', onerror); - dest.removeListener('unpipe', onunpipe); - src.removeListener('end', onend); - src.removeListener('end', unpipe); - src.removeListener('data', ondata); - - cleanedUp = true; - - // if the reader is waiting for a drain event from this - // specific writer, then it would cause it to never start - // flowing again. - // So, if this is awaiting a drain, then we just call it now. - // If we don't know, then assume that we are waiting for one. - if (state.awaitDrain && (!dest._writableState || dest._writableState.needDrain)) ondrain(); - } - - // If the user pushes more data while we're writing to dest then we'll end up - // in ondata again. However, we only want to increase awaitDrain once because - // dest will only emit one 'drain' event for the multiple writes. - // => Introduce a guard on increasing awaitDrain. - var increasedAwaitDrain = false; - src.on('data', ondata); - function ondata(chunk) { - debug('ondata'); - increasedAwaitDrain = false; - var ret = dest.write(chunk); - if (false === ret && !increasedAwaitDrain) { - // If the user unpiped during `dest.write()`, it is possible - // to get stuck in a permanently paused state if that write - // also returned false. - // => Check whether `dest` is still a piping destination. - if ((state.pipesCount === 1 && state.pipes === dest || state.pipesCount > 1 && indexOf(state.pipes, dest) !== -1) && !cleanedUp) { - debug('false write response, pause', src._readableState.awaitDrain); - src._readableState.awaitDrain++; - increasedAwaitDrain = true; - } - src.pause(); - } - } - - // if the dest has an error, then stop piping into it. - // however, don't suppress the throwing behavior for this. - function onerror(er) { - debug('onerror', er); - unpipe(); - dest.removeListener('error', onerror); - if (EElistenerCount(dest, 'error') === 0) dest.emit('error', er); - } - - // Make sure our error handler is attached before userland ones. - prependListener(dest, 'error', onerror); - - // Both close and finish should trigger unpipe, but only once. - function onclose() { - dest.removeListener('finish', onfinish); - unpipe(); - } - dest.once('close', onclose); - function onfinish() { - debug('onfinish'); - dest.removeListener('close', onclose); - unpipe(); - } - dest.once('finish', onfinish); - - function unpipe() { - debug('unpipe'); - src.unpipe(dest); - } - - // tell the dest that it's being piped to - dest.emit('pipe', src); - - // start the flow if it hasn't been started already. - if (!state.flowing) { - debug('pipe resume'); - src.resume(); - } - - return dest; -}; - -function pipeOnDrain(src) { - return function () { - var state = src._readableState; - debug('pipeOnDrain', state.awaitDrain); - if (state.awaitDrain) state.awaitDrain--; - if (state.awaitDrain === 0 && EElistenerCount(src, 'data')) { - state.flowing = true; - flow(src); - } - }; -} - -Readable.prototype.unpipe = function (dest) { - var state = this._readableState; - var unpipeInfo = { hasUnpiped: false }; - - // if we're not piping anywhere, then do nothing. - if (state.pipesCount === 0) return this; - - // just one destination. most common case. - if (state.pipesCount === 1) { - // passed in one, but it's not the right one. - if (dest && dest !== state.pipes) return this; - - if (!dest) dest = state.pipes; - - // got a match. - state.pipes = null; - state.pipesCount = 0; - state.flowing = false; - if (dest) dest.emit('unpipe', this, unpipeInfo); - return this; - } - - // slow case. multiple pipe destinations. - - if (!dest) { - // remove all. - var dests = state.pipes; - var len = state.pipesCount; - state.pipes = null; - state.pipesCount = 0; - state.flowing = false; - - for (var i = 0; i < len; i++) { - dests[i].emit('unpipe', this, unpipeInfo); - }return this; - } - - // try to find the right one. - var index = indexOf(state.pipes, dest); - if (index === -1) return this; - - state.pipes.splice(index, 1); - state.pipesCount -= 1; - if (state.pipesCount === 1) state.pipes = state.pipes[0]; - - dest.emit('unpipe', this, unpipeInfo); - - return this; -}; - -// set up data events if they are asked for -// Ensure readable listeners eventually get something -Readable.prototype.on = function (ev, fn) { - var res = Stream.prototype.on.call(this, ev, fn); - - if (ev === 'data') { - // Start flowing on next tick if stream isn't explicitly paused - if (this._readableState.flowing !== false) this.resume(); - } else if (ev === 'readable') { - var state = this._readableState; - if (!state.endEmitted && !state.readableListening) { - state.readableListening = state.needReadable = true; - state.emittedReadable = false; - if (!state.reading) { - pna.nextTick(nReadingNextTick, this); - } else if (state.length) { - emitReadable(this); - } - } - } - - return res; -}; -Readable.prototype.addListener = Readable.prototype.on; - -function nReadingNextTick(self) { - debug('readable nexttick read 0'); - self.read(0); -} - -// pause() and resume() are remnants of the legacy readable stream API -// If the user uses them, then switch into old mode. -Readable.prototype.resume = function () { - var state = this._readableState; - if (!state.flowing) { - debug('resume'); - state.flowing = true; - resume(this, state); - } - return this; -}; - -function resume(stream, state) { - if (!state.resumeScheduled) { - state.resumeScheduled = true; - pna.nextTick(resume_, stream, state); - } -} - -function resume_(stream, state) { - if (!state.reading) { - debug('resume read 0'); - stream.read(0); - } - - state.resumeScheduled = false; - state.awaitDrain = 0; - stream.emit('resume'); - flow(stream); - if (state.flowing && !state.reading) stream.read(0); -} - -Readable.prototype.pause = function () { - debug('call pause flowing=%j', this._readableState.flowing); - if (false !== this._readableState.flowing) { - debug('pause'); - this._readableState.flowing = false; - this.emit('pause'); - } - return this; -}; - -function flow(stream) { - var state = stream._readableState; - debug('flow', state.flowing); - while (state.flowing && stream.read() !== null) {} -} - -// wrap an old-style stream as the async data source. -// This is *not* part of the readable stream interface. -// It is an ugly unfortunate mess of history. -Readable.prototype.wrap = function (stream) { - var _this = this; - - var state = this._readableState; - var paused = false; - - stream.on('end', function () { - debug('wrapped end'); - if (state.decoder && !state.ended) { - var chunk = state.decoder.end(); - if (chunk && chunk.length) _this.push(chunk); - } - - _this.push(null); - }); - - stream.on('data', function (chunk) { - debug('wrapped data'); - if (state.decoder) chunk = state.decoder.write(chunk); - - // don't skip over falsy values in objectMode - if (state.objectMode && (chunk === null || chunk === undefined)) return;else if (!state.objectMode && (!chunk || !chunk.length)) return; - - var ret = _this.push(chunk); - if (!ret) { - paused = true; - stream.pause(); - } - }); - - // proxy all the other methods. - // important when wrapping filters and duplexes. - for (var i in stream) { - if (this[i] === undefined && typeof stream[i] === 'function') { - this[i] = function (method) { - return function () { - return stream[method].apply(stream, arguments); - }; - }(i); - } - } - - // proxy certain important events. - for (var n = 0; n < kProxyEvents.length; n++) { - stream.on(kProxyEvents[n], this.emit.bind(this, kProxyEvents[n])); - } - - // when we try to consume some more bytes, simply unpause the - // underlying stream. - this._read = function (n) { - debug('wrapped _read', n); - if (paused) { - paused = false; - stream.resume(); - } - }; - - return this; -}; - -Object.defineProperty(Readable.prototype, 'readableHighWaterMark', { - // making it explicit this property is not enumerable - // because otherwise some prototype manipulation in - // userland will fail - enumerable: false, - get: function () { - return this._readableState.highWaterMark; - } -}); - -// exposed for testing purposes only. -Readable._fromList = fromList; - -// Pluck off n bytes from an array of buffers. -// Length is the combined lengths of all the buffers in the list. -// This function is designed to be inlinable, so please take care when making -// changes to the function body. -function fromList(n, state) { - // nothing buffered - if (state.length === 0) return null; - - var ret; - if (state.objectMode) ret = state.buffer.shift();else if (!n || n >= state.length) { - // read it all, truncate the list - if (state.decoder) ret = state.buffer.join('');else if (state.buffer.length === 1) ret = state.buffer.head.data;else ret = state.buffer.concat(state.length); - state.buffer.clear(); - } else { - // read part of list - ret = fromListPartial(n, state.buffer, state.decoder); - } - - return ret; -} - -// Extracts only enough buffered data to satisfy the amount requested. -// This function is designed to be inlinable, so please take care when making -// changes to the function body. -function fromListPartial(n, list, hasStrings) { - var ret; - if (n < list.head.data.length) { - // slice is the same for buffers and strings - ret = list.head.data.slice(0, n); - list.head.data = list.head.data.slice(n); - } else if (n === list.head.data.length) { - // first chunk is a perfect match - ret = list.shift(); - } else { - // result spans more than one buffer - ret = hasStrings ? copyFromBufferString(n, list) : copyFromBuffer(n, list); - } - return ret; -} - -// Copies a specified amount of characters from the list of buffered data -// chunks. -// This function is designed to be inlinable, so please take care when making -// changes to the function body. -function copyFromBufferString(n, list) { - var p = list.head; - var c = 1; - var ret = p.data; - n -= ret.length; - while (p = p.next) { - var str = p.data; - var nb = n > str.length ? str.length : n; - if (nb === str.length) ret += str;else ret += str.slice(0, n); - n -= nb; - if (n === 0) { - if (nb === str.length) { - ++c; - if (p.next) list.head = p.next;else list.head = list.tail = null; - } else { - list.head = p; - p.data = str.slice(nb); - } - break; - } - ++c; - } - list.length -= c; - return ret; -} - -// Copies a specified amount of bytes from the list of buffered data chunks. -// This function is designed to be inlinable, so please take care when making -// changes to the function body. -function copyFromBuffer(n, list) { - var ret = Buffer.allocUnsafe(n); - var p = list.head; - var c = 1; - p.data.copy(ret); - n -= p.data.length; - while (p = p.next) { - var buf = p.data; - var nb = n > buf.length ? buf.length : n; - buf.copy(ret, ret.length - n, 0, nb); - n -= nb; - if (n === 0) { - if (nb === buf.length) { - ++c; - if (p.next) list.head = p.next;else list.head = list.tail = null; - } else { - list.head = p; - p.data = buf.slice(nb); - } - break; - } - ++c; - } - list.length -= c; - return ret; -} - -function endReadable(stream) { - var state = stream._readableState; - - // If we get here before consuming all the bytes, then that is a - // bug in node. Should never happen. - if (state.length > 0) throw new Error('"endReadable()" called on non-empty stream'); - - if (!state.endEmitted) { - state.ended = true; - pna.nextTick(endReadableNT, state, stream); - } -} - -function endReadableNT(state, stream) { - // Check that we didn't get one last unshift. - if (!state.endEmitted && state.length === 0) { - state.endEmitted = true; - stream.readable = false; - stream.emit('end'); - } -} - -function indexOf(xs, x) { - for (var i = 0, l = xs.length; i < l; i++) { - if (xs[i] === x) return i; - } - return -1; -} \ No newline at end of file diff --git a/deps/npm/node_modules/from2/node_modules/readable-stream/lib/_stream_transform.js b/deps/npm/node_modules/from2/node_modules/readable-stream/lib/_stream_transform.js deleted file mode 100644 index 5d1f8b876d98c7..00000000000000 --- a/deps/npm/node_modules/from2/node_modules/readable-stream/lib/_stream_transform.js +++ /dev/null @@ -1,214 +0,0 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - -// a transform stream is a readable/writable stream where you do -// something with the data. Sometimes it's called a "filter", -// but that's not a great name for it, since that implies a thing where -// some bits pass through, and others are simply ignored. (That would -// be a valid example of a transform, of course.) -// -// While the output is causally related to the input, it's not a -// necessarily symmetric or synchronous transformation. For example, -// a zlib stream might take multiple plain-text writes(), and then -// emit a single compressed chunk some time in the future. -// -// Here's how this works: -// -// The Transform stream has all the aspects of the readable and writable -// stream classes. When you write(chunk), that calls _write(chunk,cb) -// internally, and returns false if there's a lot of pending writes -// buffered up. When you call read(), that calls _read(n) until -// there's enough pending readable data buffered up. -// -// In a transform stream, the written data is placed in a buffer. When -// _read(n) is called, it transforms the queued up data, calling the -// buffered _write cb's as it consumes chunks. If consuming a single -// written chunk would result in multiple output chunks, then the first -// outputted bit calls the readcb, and subsequent chunks just go into -// the read buffer, and will cause it to emit 'readable' if necessary. -// -// This way, back-pressure is actually determined by the reading side, -// since _read has to be called to start processing a new chunk. However, -// a pathological inflate type of transform can cause excessive buffering -// here. For example, imagine a stream where every byte of input is -// interpreted as an integer from 0-255, and then results in that many -// bytes of output. Writing the 4 bytes {ff,ff,ff,ff} would result in -// 1kb of data being output. In this case, you could write a very small -// amount of input, and end up with a very large amount of output. In -// such a pathological inflating mechanism, there'd be no way to tell -// the system to stop doing the transform. A single 4MB write could -// cause the system to run out of memory. -// -// However, even in such a pathological case, only a single written chunk -// would be consumed, and then the rest would wait (un-transformed) until -// the results of the previous transformed chunk were consumed. - -'use strict'; - -module.exports = Transform; - -var Duplex = require('./_stream_duplex'); - -/**/ -var util = require('core-util-is'); -util.inherits = require('inherits'); -/**/ - -util.inherits(Transform, Duplex); - -function afterTransform(er, data) { - var ts = this._transformState; - ts.transforming = false; - - var cb = ts.writecb; - - if (!cb) { - return this.emit('error', new Error('write callback called multiple times')); - } - - ts.writechunk = null; - ts.writecb = null; - - if (data != null) // single equals check for both `null` and `undefined` - this.push(data); - - cb(er); - - var rs = this._readableState; - rs.reading = false; - if (rs.needReadable || rs.length < rs.highWaterMark) { - this._read(rs.highWaterMark); - } -} - -function Transform(options) { - if (!(this instanceof Transform)) return new Transform(options); - - Duplex.call(this, options); - - this._transformState = { - afterTransform: afterTransform.bind(this), - needTransform: false, - transforming: false, - writecb: null, - writechunk: null, - writeencoding: null - }; - - // start out asking for a readable event once data is transformed. - this._readableState.needReadable = true; - - // we have implemented the _read method, and done the other things - // that Readable wants before the first _read call, so unset the - // sync guard flag. - this._readableState.sync = false; - - if (options) { - if (typeof options.transform === 'function') this._transform = options.transform; - - if (typeof options.flush === 'function') this._flush = options.flush; - } - - // When the writable side finishes, then flush out anything remaining. - this.on('prefinish', prefinish); -} - -function prefinish() { - var _this = this; - - if (typeof this._flush === 'function') { - this._flush(function (er, data) { - done(_this, er, data); - }); - } else { - done(this, null, null); - } -} - -Transform.prototype.push = function (chunk, encoding) { - this._transformState.needTransform = false; - return Duplex.prototype.push.call(this, chunk, encoding); -}; - -// This is the part where you do stuff! -// override this function in implementation classes. -// 'chunk' is an input chunk. -// -// Call `push(newChunk)` to pass along transformed output -// to the readable side. You may call 'push' zero or more times. -// -// Call `cb(err)` when you are done with this chunk. If you pass -// an error, then that'll put the hurt on the whole operation. If you -// never call cb(), then you'll never get another chunk. -Transform.prototype._transform = function (chunk, encoding, cb) { - throw new Error('_transform() is not implemented'); -}; - -Transform.prototype._write = function (chunk, encoding, cb) { - var ts = this._transformState; - ts.writecb = cb; - ts.writechunk = chunk; - ts.writeencoding = encoding; - if (!ts.transforming) { - var rs = this._readableState; - if (ts.needTransform || rs.needReadable || rs.length < rs.highWaterMark) this._read(rs.highWaterMark); - } -}; - -// Doesn't matter what the args are here. -// _transform does all the work. -// That we got here means that the readable side wants more data. -Transform.prototype._read = function (n) { - var ts = this._transformState; - - if (ts.writechunk !== null && ts.writecb && !ts.transforming) { - ts.transforming = true; - this._transform(ts.writechunk, ts.writeencoding, ts.afterTransform); - } else { - // mark that we need a transform, so that any data that comes in - // will get processed, now that we've asked for it. - ts.needTransform = true; - } -}; - -Transform.prototype._destroy = function (err, cb) { - var _this2 = this; - - Duplex.prototype._destroy.call(this, err, function (err2) { - cb(err2); - _this2.emit('close'); - }); -}; - -function done(stream, er, data) { - if (er) return stream.emit('error', er); - - if (data != null) // single equals check for both `null` and `undefined` - stream.push(data); - - // if there's nothing in the write buffer, then that means - // that nothing more will ever be provided - if (stream._writableState.length) throw new Error('Calling transform done when ws.length != 0'); - - if (stream._transformState.transforming) throw new Error('Calling transform done when still transforming'); - - return stream.push(null); -} \ No newline at end of file diff --git a/deps/npm/node_modules/from2/node_modules/readable-stream/lib/_stream_writable.js b/deps/npm/node_modules/from2/node_modules/readable-stream/lib/_stream_writable.js deleted file mode 100644 index b3f4e85a2f6e35..00000000000000 --- a/deps/npm/node_modules/from2/node_modules/readable-stream/lib/_stream_writable.js +++ /dev/null @@ -1,687 +0,0 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - -// A bit simpler than readable streams. -// Implement an async ._write(chunk, encoding, cb), and it'll handle all -// the drain event emission and buffering. - -'use strict'; - -/**/ - -var pna = require('process-nextick-args'); -/**/ - -module.exports = Writable; - -/* */ -function WriteReq(chunk, encoding, cb) { - this.chunk = chunk; - this.encoding = encoding; - this.callback = cb; - this.next = null; -} - -// It seems a linked list but it is not -// there will be only 2 of these for each stream -function CorkedRequest(state) { - var _this = this; - - this.next = null; - this.entry = null; - this.finish = function () { - onCorkedFinish(_this, state); - }; -} -/* */ - -/**/ -var asyncWrite = !process.browser && ['v0.10', 'v0.9.'].indexOf(process.version.slice(0, 5)) > -1 ? setImmediate : pna.nextTick; -/**/ - -/**/ -var Duplex; -/**/ - -Writable.WritableState = WritableState; - -/**/ -var util = require('core-util-is'); -util.inherits = require('inherits'); -/**/ - -/**/ -var internalUtil = { - deprecate: require('util-deprecate') -}; -/**/ - -/**/ -var Stream = require('./internal/streams/stream'); -/**/ - -/**/ - -var Buffer = require('safe-buffer').Buffer; -var OurUint8Array = global.Uint8Array || function () {}; -function _uint8ArrayToBuffer(chunk) { - return Buffer.from(chunk); -} -function _isUint8Array(obj) { - return Buffer.isBuffer(obj) || obj instanceof OurUint8Array; -} - -/**/ - -var destroyImpl = require('./internal/streams/destroy'); - -util.inherits(Writable, Stream); - -function nop() {} - -function WritableState(options, stream) { - Duplex = Duplex || require('./_stream_duplex'); - - options = options || {}; - - // Duplex streams are both readable and writable, but share - // the same options object. - // However, some cases require setting options to different - // values for the readable and the writable sides of the duplex stream. - // These options can be provided separately as readableXXX and writableXXX. - var isDuplex = stream instanceof Duplex; - - // object stream flag to indicate whether or not this stream - // contains buffers or objects. - this.objectMode = !!options.objectMode; - - if (isDuplex) this.objectMode = this.objectMode || !!options.writableObjectMode; - - // the point at which write() starts returning false - // Note: 0 is a valid value, means that we always return false if - // the entire buffer is not flushed immediately on write() - var hwm = options.highWaterMark; - var writableHwm = options.writableHighWaterMark; - var defaultHwm = this.objectMode ? 16 : 16 * 1024; - - if (hwm || hwm === 0) this.highWaterMark = hwm;else if (isDuplex && (writableHwm || writableHwm === 0)) this.highWaterMark = writableHwm;else this.highWaterMark = defaultHwm; - - // cast to ints. - this.highWaterMark = Math.floor(this.highWaterMark); - - // if _final has been called - this.finalCalled = false; - - // drain event flag. - this.needDrain = false; - // at the start of calling end() - this.ending = false; - // when end() has been called, and returned - this.ended = false; - // when 'finish' is emitted - this.finished = false; - - // has it been destroyed - this.destroyed = false; - - // should we decode strings into buffers before passing to _write? - // this is here so that some node-core streams can optimize string - // handling at a lower level. - var noDecode = options.decodeStrings === false; - this.decodeStrings = !noDecode; - - // Crypto is kind of old and crusty. Historically, its default string - // encoding is 'binary' so we have to make this configurable. - // Everything else in the universe uses 'utf8', though. - this.defaultEncoding = options.defaultEncoding || 'utf8'; - - // not an actual buffer we keep track of, but a measurement - // of how much we're waiting to get pushed to some underlying - // socket or file. - this.length = 0; - - // a flag to see when we're in the middle of a write. - this.writing = false; - - // when true all writes will be buffered until .uncork() call - this.corked = 0; - - // a flag to be able to tell if the onwrite cb is called immediately, - // or on a later tick. We set this to true at first, because any - // actions that shouldn't happen until "later" should generally also - // not happen before the first write call. - this.sync = true; - - // a flag to know if we're processing previously buffered items, which - // may call the _write() callback in the same tick, so that we don't - // end up in an overlapped onwrite situation. - this.bufferProcessing = false; - - // the callback that's passed to _write(chunk,cb) - this.onwrite = function (er) { - onwrite(stream, er); - }; - - // the callback that the user supplies to write(chunk,encoding,cb) - this.writecb = null; - - // the amount that is being written when _write is called. - this.writelen = 0; - - this.bufferedRequest = null; - this.lastBufferedRequest = null; - - // number of pending user-supplied write callbacks - // this must be 0 before 'finish' can be emitted - this.pendingcb = 0; - - // emit prefinish if the only thing we're waiting for is _write cbs - // This is relevant for synchronous Transform streams - this.prefinished = false; - - // True if the error was already emitted and should not be thrown again - this.errorEmitted = false; - - // count buffered requests - this.bufferedRequestCount = 0; - - // allocate the first CorkedRequest, there is always - // one allocated and free to use, and we maintain at most two - this.corkedRequestsFree = new CorkedRequest(this); -} - -WritableState.prototype.getBuffer = function getBuffer() { - var current = this.bufferedRequest; - var out = []; - while (current) { - out.push(current); - current = current.next; - } - return out; -}; - -(function () { - try { - Object.defineProperty(WritableState.prototype, 'buffer', { - get: internalUtil.deprecate(function () { - return this.getBuffer(); - }, '_writableState.buffer is deprecated. Use _writableState.getBuffer ' + 'instead.', 'DEP0003') - }); - } catch (_) {} -})(); - -// Test _writableState for inheritance to account for Duplex streams, -// whose prototype chain only points to Readable. -var realHasInstance; -if (typeof Symbol === 'function' && Symbol.hasInstance && typeof Function.prototype[Symbol.hasInstance] === 'function') { - realHasInstance = Function.prototype[Symbol.hasInstance]; - Object.defineProperty(Writable, Symbol.hasInstance, { - value: function (object) { - if (realHasInstance.call(this, object)) return true; - if (this !== Writable) return false; - - return object && object._writableState instanceof WritableState; - } - }); -} else { - realHasInstance = function (object) { - return object instanceof this; - }; -} - -function Writable(options) { - Duplex = Duplex || require('./_stream_duplex'); - - // Writable ctor is applied to Duplexes, too. - // `realHasInstance` is necessary because using plain `instanceof` - // would return false, as no `_writableState` property is attached. - - // Trying to use the custom `instanceof` for Writable here will also break the - // Node.js LazyTransform implementation, which has a non-trivial getter for - // `_writableState` that would lead to infinite recursion. - if (!realHasInstance.call(Writable, this) && !(this instanceof Duplex)) { - return new Writable(options); - } - - this._writableState = new WritableState(options, this); - - // legacy. - this.writable = true; - - if (options) { - if (typeof options.write === 'function') this._write = options.write; - - if (typeof options.writev === 'function') this._writev = options.writev; - - if (typeof options.destroy === 'function') this._destroy = options.destroy; - - if (typeof options.final === 'function') this._final = options.final; - } - - Stream.call(this); -} - -// Otherwise people can pipe Writable streams, which is just wrong. -Writable.prototype.pipe = function () { - this.emit('error', new Error('Cannot pipe, not readable')); -}; - -function writeAfterEnd(stream, cb) { - var er = new Error('write after end'); - // TODO: defer error events consistently everywhere, not just the cb - stream.emit('error', er); - pna.nextTick(cb, er); -} - -// Checks that a user-supplied chunk is valid, especially for the particular -// mode the stream is in. Currently this means that `null` is never accepted -// and undefined/non-string values are only allowed in object mode. -function validChunk(stream, state, chunk, cb) { - var valid = true; - var er = false; - - if (chunk === null) { - er = new TypeError('May not write null values to stream'); - } else if (typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) { - er = new TypeError('Invalid non-string/buffer chunk'); - } - if (er) { - stream.emit('error', er); - pna.nextTick(cb, er); - valid = false; - } - return valid; -} - -Writable.prototype.write = function (chunk, encoding, cb) { - var state = this._writableState; - var ret = false; - var isBuf = !state.objectMode && _isUint8Array(chunk); - - if (isBuf && !Buffer.isBuffer(chunk)) { - chunk = _uint8ArrayToBuffer(chunk); - } - - if (typeof encoding === 'function') { - cb = encoding; - encoding = null; - } - - if (isBuf) encoding = 'buffer';else if (!encoding) encoding = state.defaultEncoding; - - if (typeof cb !== 'function') cb = nop; - - if (state.ended) writeAfterEnd(this, cb);else if (isBuf || validChunk(this, state, chunk, cb)) { - state.pendingcb++; - ret = writeOrBuffer(this, state, isBuf, chunk, encoding, cb); - } - - return ret; -}; - -Writable.prototype.cork = function () { - var state = this._writableState; - - state.corked++; -}; - -Writable.prototype.uncork = function () { - var state = this._writableState; - - if (state.corked) { - state.corked--; - - if (!state.writing && !state.corked && !state.finished && !state.bufferProcessing && state.bufferedRequest) clearBuffer(this, state); - } -}; - -Writable.prototype.setDefaultEncoding = function setDefaultEncoding(encoding) { - // node::ParseEncoding() requires lower case. - if (typeof encoding === 'string') encoding = encoding.toLowerCase(); - if (!(['hex', 'utf8', 'utf-8', 'ascii', 'binary', 'base64', 'ucs2', 'ucs-2', 'utf16le', 'utf-16le', 'raw'].indexOf((encoding + '').toLowerCase()) > -1)) throw new TypeError('Unknown encoding: ' + encoding); - this._writableState.defaultEncoding = encoding; - return this; -}; - -function decodeChunk(state, chunk, encoding) { - if (!state.objectMode && state.decodeStrings !== false && typeof chunk === 'string') { - chunk = Buffer.from(chunk, encoding); - } - return chunk; -} - -Object.defineProperty(Writable.prototype, 'writableHighWaterMark', { - // making it explicit this property is not enumerable - // because otherwise some prototype manipulation in - // userland will fail - enumerable: false, - get: function () { - return this._writableState.highWaterMark; - } -}); - -// if we're already writing something, then just put this -// in the queue, and wait our turn. Otherwise, call _write -// If we return false, then we need a drain event, so set that flag. -function writeOrBuffer(stream, state, isBuf, chunk, encoding, cb) { - if (!isBuf) { - var newChunk = decodeChunk(state, chunk, encoding); - if (chunk !== newChunk) { - isBuf = true; - encoding = 'buffer'; - chunk = newChunk; - } - } - var len = state.objectMode ? 1 : chunk.length; - - state.length += len; - - var ret = state.length < state.highWaterMark; - // we must ensure that previous needDrain will not be reset to false. - if (!ret) state.needDrain = true; - - if (state.writing || state.corked) { - var last = state.lastBufferedRequest; - state.lastBufferedRequest = { - chunk: chunk, - encoding: encoding, - isBuf: isBuf, - callback: cb, - next: null - }; - if (last) { - last.next = state.lastBufferedRequest; - } else { - state.bufferedRequest = state.lastBufferedRequest; - } - state.bufferedRequestCount += 1; - } else { - doWrite(stream, state, false, len, chunk, encoding, cb); - } - - return ret; -} - -function doWrite(stream, state, writev, len, chunk, encoding, cb) { - state.writelen = len; - state.writecb = cb; - state.writing = true; - state.sync = true; - if (writev) stream._writev(chunk, state.onwrite);else stream._write(chunk, encoding, state.onwrite); - state.sync = false; -} - -function onwriteError(stream, state, sync, er, cb) { - --state.pendingcb; - - if (sync) { - // defer the callback if we are being called synchronously - // to avoid piling up things on the stack - pna.nextTick(cb, er); - // this can emit finish, and it will always happen - // after error - pna.nextTick(finishMaybe, stream, state); - stream._writableState.errorEmitted = true; - stream.emit('error', er); - } else { - // the caller expect this to happen before if - // it is async - cb(er); - stream._writableState.errorEmitted = true; - stream.emit('error', er); - // this can emit finish, but finish must - // always follow error - finishMaybe(stream, state); - } -} - -function onwriteStateUpdate(state) { - state.writing = false; - state.writecb = null; - state.length -= state.writelen; - state.writelen = 0; -} - -function onwrite(stream, er) { - var state = stream._writableState; - var sync = state.sync; - var cb = state.writecb; - - onwriteStateUpdate(state); - - if (er) onwriteError(stream, state, sync, er, cb);else { - // Check if we're actually ready to finish, but don't emit yet - var finished = needFinish(state); - - if (!finished && !state.corked && !state.bufferProcessing && state.bufferedRequest) { - clearBuffer(stream, state); - } - - if (sync) { - /**/ - asyncWrite(afterWrite, stream, state, finished, cb); - /**/ - } else { - afterWrite(stream, state, finished, cb); - } - } -} - -function afterWrite(stream, state, finished, cb) { - if (!finished) onwriteDrain(stream, state); - state.pendingcb--; - cb(); - finishMaybe(stream, state); -} - -// Must force callback to be called on nextTick, so that we don't -// emit 'drain' before the write() consumer gets the 'false' return -// value, and has a chance to attach a 'drain' listener. -function onwriteDrain(stream, state) { - if (state.length === 0 && state.needDrain) { - state.needDrain = false; - stream.emit('drain'); - } -} - -// if there's something in the buffer waiting, then process it -function clearBuffer(stream, state) { - state.bufferProcessing = true; - var entry = state.bufferedRequest; - - if (stream._writev && entry && entry.next) { - // Fast case, write everything using _writev() - var l = state.bufferedRequestCount; - var buffer = new Array(l); - var holder = state.corkedRequestsFree; - holder.entry = entry; - - var count = 0; - var allBuffers = true; - while (entry) { - buffer[count] = entry; - if (!entry.isBuf) allBuffers = false; - entry = entry.next; - count += 1; - } - buffer.allBuffers = allBuffers; - - doWrite(stream, state, true, state.length, buffer, '', holder.finish); - - // doWrite is almost always async, defer these to save a bit of time - // as the hot path ends with doWrite - state.pendingcb++; - state.lastBufferedRequest = null; - if (holder.next) { - state.corkedRequestsFree = holder.next; - holder.next = null; - } else { - state.corkedRequestsFree = new CorkedRequest(state); - } - state.bufferedRequestCount = 0; - } else { - // Slow case, write chunks one-by-one - while (entry) { - var chunk = entry.chunk; - var encoding = entry.encoding; - var cb = entry.callback; - var len = state.objectMode ? 1 : chunk.length; - - doWrite(stream, state, false, len, chunk, encoding, cb); - entry = entry.next; - state.bufferedRequestCount--; - // if we didn't call the onwrite immediately, then - // it means that we need to wait until it does. - // also, that means that the chunk and cb are currently - // being processed, so move the buffer counter past them. - if (state.writing) { - break; - } - } - - if (entry === null) state.lastBufferedRequest = null; - } - - state.bufferedRequest = entry; - state.bufferProcessing = false; -} - -Writable.prototype._write = function (chunk, encoding, cb) { - cb(new Error('_write() is not implemented')); -}; - -Writable.prototype._writev = null; - -Writable.prototype.end = function (chunk, encoding, cb) { - var state = this._writableState; - - if (typeof chunk === 'function') { - cb = chunk; - chunk = null; - encoding = null; - } else if (typeof encoding === 'function') { - cb = encoding; - encoding = null; - } - - if (chunk !== null && chunk !== undefined) this.write(chunk, encoding); - - // .end() fully uncorks - if (state.corked) { - state.corked = 1; - this.uncork(); - } - - // ignore unnecessary end() calls. - if (!state.ending && !state.finished) endWritable(this, state, cb); -}; - -function needFinish(state) { - return state.ending && state.length === 0 && state.bufferedRequest === null && !state.finished && !state.writing; -} -function callFinal(stream, state) { - stream._final(function (err) { - state.pendingcb--; - if (err) { - stream.emit('error', err); - } - state.prefinished = true; - stream.emit('prefinish'); - finishMaybe(stream, state); - }); -} -function prefinish(stream, state) { - if (!state.prefinished && !state.finalCalled) { - if (typeof stream._final === 'function') { - state.pendingcb++; - state.finalCalled = true; - pna.nextTick(callFinal, stream, state); - } else { - state.prefinished = true; - stream.emit('prefinish'); - } - } -} - -function finishMaybe(stream, state) { - var need = needFinish(state); - if (need) { - prefinish(stream, state); - if (state.pendingcb === 0) { - state.finished = true; - stream.emit('finish'); - } - } - return need; -} - -function endWritable(stream, state, cb) { - state.ending = true; - finishMaybe(stream, state); - if (cb) { - if (state.finished) pna.nextTick(cb);else stream.once('finish', cb); - } - state.ended = true; - stream.writable = false; -} - -function onCorkedFinish(corkReq, state, err) { - var entry = corkReq.entry; - corkReq.entry = null; - while (entry) { - var cb = entry.callback; - state.pendingcb--; - cb(err); - entry = entry.next; - } - if (state.corkedRequestsFree) { - state.corkedRequestsFree.next = corkReq; - } else { - state.corkedRequestsFree = corkReq; - } -} - -Object.defineProperty(Writable.prototype, 'destroyed', { - get: function () { - if (this._writableState === undefined) { - return false; - } - return this._writableState.destroyed; - }, - set: function (value) { - // we ignore the value if the stream - // has not been initialized yet - if (!this._writableState) { - return; - } - - // backward compatibility, the user is explicitly - // managing destroyed - this._writableState.destroyed = value; - } -}); - -Writable.prototype.destroy = destroyImpl.destroy; -Writable.prototype._undestroy = destroyImpl.undestroy; -Writable.prototype._destroy = function (err, cb) { - this.end(); - cb(err); -}; \ No newline at end of file diff --git a/deps/npm/node_modules/from2/node_modules/readable-stream/lib/internal/streams/BufferList.js b/deps/npm/node_modules/from2/node_modules/readable-stream/lib/internal/streams/BufferList.js deleted file mode 100644 index aefc68bd90b9c2..00000000000000 --- a/deps/npm/node_modules/from2/node_modules/readable-stream/lib/internal/streams/BufferList.js +++ /dev/null @@ -1,79 +0,0 @@ -'use strict'; - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -var Buffer = require('safe-buffer').Buffer; -var util = require('util'); - -function copyBuffer(src, target, offset) { - src.copy(target, offset); -} - -module.exports = function () { - function BufferList() { - _classCallCheck(this, BufferList); - - this.head = null; - this.tail = null; - this.length = 0; - } - - BufferList.prototype.push = function push(v) { - var entry = { data: v, next: null }; - if (this.length > 0) this.tail.next = entry;else this.head = entry; - this.tail = entry; - ++this.length; - }; - - BufferList.prototype.unshift = function unshift(v) { - var entry = { data: v, next: this.head }; - if (this.length === 0) this.tail = entry; - this.head = entry; - ++this.length; - }; - - BufferList.prototype.shift = function shift() { - if (this.length === 0) return; - var ret = this.head.data; - if (this.length === 1) this.head = this.tail = null;else this.head = this.head.next; - --this.length; - return ret; - }; - - BufferList.prototype.clear = function clear() { - this.head = this.tail = null; - this.length = 0; - }; - - BufferList.prototype.join = function join(s) { - if (this.length === 0) return ''; - var p = this.head; - var ret = '' + p.data; - while (p = p.next) { - ret += s + p.data; - }return ret; - }; - - BufferList.prototype.concat = function concat(n) { - if (this.length === 0) return Buffer.alloc(0); - if (this.length === 1) return this.head.data; - var ret = Buffer.allocUnsafe(n >>> 0); - var p = this.head; - var i = 0; - while (p) { - copyBuffer(p.data, ret, i); - i += p.data.length; - p = p.next; - } - return ret; - }; - - return BufferList; -}(); - -if (util && util.inspect && util.inspect.custom) { - module.exports.prototype[util.inspect.custom] = function () { - var obj = util.inspect({ length: this.length }); - return this.constructor.name + ' ' + obj; - }; -} \ No newline at end of file diff --git a/deps/npm/node_modules/from2/node_modules/readable-stream/lib/internal/streams/destroy.js b/deps/npm/node_modules/from2/node_modules/readable-stream/lib/internal/streams/destroy.js deleted file mode 100644 index 5a0a0d88cec6f3..00000000000000 --- a/deps/npm/node_modules/from2/node_modules/readable-stream/lib/internal/streams/destroy.js +++ /dev/null @@ -1,74 +0,0 @@ -'use strict'; - -/**/ - -var pna = require('process-nextick-args'); -/**/ - -// undocumented cb() API, needed for core, not for public API -function destroy(err, cb) { - var _this = this; - - var readableDestroyed = this._readableState && this._readableState.destroyed; - var writableDestroyed = this._writableState && this._writableState.destroyed; - - if (readableDestroyed || writableDestroyed) { - if (cb) { - cb(err); - } else if (err && (!this._writableState || !this._writableState.errorEmitted)) { - pna.nextTick(emitErrorNT, this, err); - } - return this; - } - - // we set destroyed to true before firing error callbacks in order - // to make it re-entrance safe in case destroy() is called within callbacks - - if (this._readableState) { - this._readableState.destroyed = true; - } - - // if this is a duplex stream mark the writable part as destroyed as well - if (this._writableState) { - this._writableState.destroyed = true; - } - - this._destroy(err || null, function (err) { - if (!cb && err) { - pna.nextTick(emitErrorNT, _this, err); - if (_this._writableState) { - _this._writableState.errorEmitted = true; - } - } else if (cb) { - cb(err); - } - }); - - return this; -} - -function undestroy() { - if (this._readableState) { - this._readableState.destroyed = false; - this._readableState.reading = false; - this._readableState.ended = false; - this._readableState.endEmitted = false; - } - - if (this._writableState) { - this._writableState.destroyed = false; - this._writableState.ended = false; - this._writableState.ending = false; - this._writableState.finished = false; - this._writableState.errorEmitted = false; - } -} - -function emitErrorNT(self, err) { - self.emit('error', err); -} - -module.exports = { - destroy: destroy, - undestroy: undestroy -}; \ No newline at end of file diff --git a/deps/npm/node_modules/from2/node_modules/readable-stream/lib/internal/streams/stream-browser.js b/deps/npm/node_modules/from2/node_modules/readable-stream/lib/internal/streams/stream-browser.js deleted file mode 100644 index 9332a3fdae7060..00000000000000 --- a/deps/npm/node_modules/from2/node_modules/readable-stream/lib/internal/streams/stream-browser.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('events').EventEmitter; diff --git a/deps/npm/node_modules/from2/node_modules/readable-stream/lib/internal/streams/stream.js b/deps/npm/node_modules/from2/node_modules/readable-stream/lib/internal/streams/stream.js deleted file mode 100644 index ce2ad5b6ee57f4..00000000000000 --- a/deps/npm/node_modules/from2/node_modules/readable-stream/lib/internal/streams/stream.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('stream'); diff --git a/deps/npm/node_modules/from2/node_modules/readable-stream/package.json b/deps/npm/node_modules/from2/node_modules/readable-stream/package.json deleted file mode 100644 index 699ff7e6743065..00000000000000 --- a/deps/npm/node_modules/from2/node_modules/readable-stream/package.json +++ /dev/null @@ -1,81 +0,0 @@ -{ - "_from": "readable-stream@^2.0.0", - "_id": "readable-stream@2.3.6", - "_inBundle": false, - "_integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", - "_location": "/from2/readable-stream", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "readable-stream@^2.0.0", - "name": "readable-stream", - "escapedName": "readable-stream", - "rawSpec": "^2.0.0", - "saveSpec": null, - "fetchSpec": "^2.0.0" - }, - "_requiredBy": [ - "/from2" - ], - "_resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", - "_shasum": "b11c27d88b8ff1fbe070643cf94b0c79ae1b0aaf", - "_spec": "readable-stream@^2.0.0", - "_where": "/Users/aeschright/code/cli/node_modules/from2", - "browser": { - "util": false, - "./readable.js": "./readable-browser.js", - "./writable.js": "./writable-browser.js", - "./duplex.js": "./duplex-browser.js", - "./lib/internal/streams/stream.js": "./lib/internal/streams/stream-browser.js" - }, - "bugs": { - "url": "https://github.com/nodejs/readable-stream/issues" - }, - "bundleDependencies": false, - "dependencies": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - }, - "deprecated": false, - "description": "Streams3, a user-land copy of the stream library from Node.js", - "devDependencies": { - "assert": "^1.4.0", - "babel-polyfill": "^6.9.1", - "buffer": "^4.9.0", - "lolex": "^2.3.2", - "nyc": "^6.4.0", - "tap": "^0.7.0", - "tape": "^4.8.0" - }, - "homepage": "https://github.com/nodejs/readable-stream#readme", - "keywords": [ - "readable", - "stream", - "pipe" - ], - "license": "MIT", - "main": "readable.js", - "name": "readable-stream", - "nyc": { - "include": [ - "lib/**.js" - ] - }, - "repository": { - "type": "git", - "url": "git://github.com/nodejs/readable-stream.git" - }, - "scripts": { - "ci": "tap test/parallel/*.js test/ours/*.js --tap | tee test.tap && node test/verify-dependencies.js", - "cover": "nyc npm test", - "report": "nyc report --reporter=lcov", - "test": "tap test/parallel/*.js test/ours/*.js && node test/verify-dependencies.js" - }, - "version": "2.3.6" -} diff --git a/deps/npm/node_modules/from2/node_modules/readable-stream/passthrough.js b/deps/npm/node_modules/from2/node_modules/readable-stream/passthrough.js deleted file mode 100644 index ffd791d7ff275a..00000000000000 --- a/deps/npm/node_modules/from2/node_modules/readable-stream/passthrough.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./readable').PassThrough diff --git a/deps/npm/node_modules/from2/node_modules/readable-stream/readable-browser.js b/deps/npm/node_modules/from2/node_modules/readable-stream/readable-browser.js deleted file mode 100644 index e50372592ee6c6..00000000000000 --- a/deps/npm/node_modules/from2/node_modules/readable-stream/readable-browser.js +++ /dev/null @@ -1,7 +0,0 @@ -exports = module.exports = require('./lib/_stream_readable.js'); -exports.Stream = exports; -exports.Readable = exports; -exports.Writable = require('./lib/_stream_writable.js'); -exports.Duplex = require('./lib/_stream_duplex.js'); -exports.Transform = require('./lib/_stream_transform.js'); -exports.PassThrough = require('./lib/_stream_passthrough.js'); diff --git a/deps/npm/node_modules/from2/node_modules/readable-stream/readable.js b/deps/npm/node_modules/from2/node_modules/readable-stream/readable.js deleted file mode 100644 index ec89ec53306497..00000000000000 --- a/deps/npm/node_modules/from2/node_modules/readable-stream/readable.js +++ /dev/null @@ -1,19 +0,0 @@ -var Stream = require('stream'); -if (process.env.READABLE_STREAM === 'disable' && Stream) { - module.exports = Stream; - exports = module.exports = Stream.Readable; - exports.Readable = Stream.Readable; - exports.Writable = Stream.Writable; - exports.Duplex = Stream.Duplex; - exports.Transform = Stream.Transform; - exports.PassThrough = Stream.PassThrough; - exports.Stream = Stream; -} else { - exports = module.exports = require('./lib/_stream_readable.js'); - exports.Stream = Stream || exports; - exports.Readable = exports; - exports.Writable = require('./lib/_stream_writable.js'); - exports.Duplex = require('./lib/_stream_duplex.js'); - exports.Transform = require('./lib/_stream_transform.js'); - exports.PassThrough = require('./lib/_stream_passthrough.js'); -} diff --git a/deps/npm/node_modules/from2/node_modules/readable-stream/transform.js b/deps/npm/node_modules/from2/node_modules/readable-stream/transform.js deleted file mode 100644 index b1baba26da03dc..00000000000000 --- a/deps/npm/node_modules/from2/node_modules/readable-stream/transform.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./readable').Transform diff --git a/deps/npm/node_modules/from2/node_modules/readable-stream/writable-browser.js b/deps/npm/node_modules/from2/node_modules/readable-stream/writable-browser.js deleted file mode 100644 index ebdde6a85dcb19..00000000000000 --- a/deps/npm/node_modules/from2/node_modules/readable-stream/writable-browser.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./lib/_stream_writable.js'); diff --git a/deps/npm/node_modules/from2/node_modules/readable-stream/writable.js b/deps/npm/node_modules/from2/node_modules/readable-stream/writable.js deleted file mode 100644 index 3211a6f80d1abc..00000000000000 --- a/deps/npm/node_modules/from2/node_modules/readable-stream/writable.js +++ /dev/null @@ -1,8 +0,0 @@ -var Stream = require("stream") -var Writable = require("./lib/_stream_writable.js") - -if (process.env.READABLE_STREAM === 'disable') { - module.exports = Stream && Stream.Writable || Writable -} else { - module.exports = Writable -} diff --git a/deps/npm/node_modules/from2/node_modules/string_decoder/.travis.yml b/deps/npm/node_modules/from2/node_modules/string_decoder/.travis.yml deleted file mode 100644 index 3347a725465058..00000000000000 --- a/deps/npm/node_modules/from2/node_modules/string_decoder/.travis.yml +++ /dev/null @@ -1,50 +0,0 @@ -sudo: false -language: node_js -before_install: - - npm install -g npm@2 - - test $NPM_LEGACY && npm install -g npm@latest-3 || npm install npm -g -notifications: - email: false -matrix: - fast_finish: true - include: - - node_js: '0.8' - env: - - TASK=test - - NPM_LEGACY=true - - node_js: '0.10' - env: - - TASK=test - - NPM_LEGACY=true - - node_js: '0.11' - env: - - TASK=test - - NPM_LEGACY=true - - node_js: '0.12' - env: - - TASK=test - - NPM_LEGACY=true - - node_js: 1 - env: - - TASK=test - - NPM_LEGACY=true - - node_js: 2 - env: - - TASK=test - - NPM_LEGACY=true - - node_js: 3 - env: - - TASK=test - - NPM_LEGACY=true - - node_js: 4 - env: TASK=test - - node_js: 5 - env: TASK=test - - node_js: 6 - env: TASK=test - - node_js: 7 - env: TASK=test - - node_js: 8 - env: TASK=test - - node_js: 9 - env: TASK=test diff --git a/deps/npm/node_modules/from2/node_modules/string_decoder/LICENSE b/deps/npm/node_modules/from2/node_modules/string_decoder/LICENSE deleted file mode 100644 index 778edb20730ef4..00000000000000 --- a/deps/npm/node_modules/from2/node_modules/string_decoder/LICENSE +++ /dev/null @@ -1,48 +0,0 @@ -Node.js is licensed for use as follows: - -""" -Copyright Node.js contributors. All rights reserved. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to -deal in the Software without restriction, including without limitation the -rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -sell copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -IN THE SOFTWARE. -""" - -This license applies to parts of Node.js originating from the -https://github.com/joyent/node repository: - -""" -Copyright Joyent, Inc. and other Node contributors. All rights reserved. -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to -deal in the Software without restriction, including without limitation the -rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -sell copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -IN THE SOFTWARE. -""" - diff --git a/deps/npm/node_modules/from2/node_modules/string_decoder/README.md b/deps/npm/node_modules/from2/node_modules/string_decoder/README.md deleted file mode 100644 index 5fd58315ed5880..00000000000000 --- a/deps/npm/node_modules/from2/node_modules/string_decoder/README.md +++ /dev/null @@ -1,47 +0,0 @@ -# string_decoder - -***Node-core v8.9.4 string_decoder for userland*** - - -[![NPM](https://nodei.co/npm/string_decoder.png?downloads=true&downloadRank=true)](https://nodei.co/npm/string_decoder/) -[![NPM](https://nodei.co/npm-dl/string_decoder.png?&months=6&height=3)](https://nodei.co/npm/string_decoder/) - - -```bash -npm install --save string_decoder -``` - -***Node-core string_decoder for userland*** - -This package is a mirror of the string_decoder implementation in Node-core. - -Full documentation may be found on the [Node.js website](https://nodejs.org/dist/v8.9.4/docs/api/). - -As of version 1.0.0 **string_decoder** uses semantic versioning. - -## Previous versions - -Previous version numbers match the versions found in Node core, e.g. 0.10.24 matches Node 0.10.24, likewise 0.11.10 matches Node 0.11.10. - -## Update - -The *build/* directory contains a build script that will scrape the source from the [nodejs/node](https://github.com/nodejs/node) repo given a specific Node version. - -## Streams Working Group - -`string_decoder` is maintained by the Streams Working Group, which -oversees the development and maintenance of the Streams API within -Node.js. The responsibilities of the Streams Working Group include: - -* Addressing stream issues on the Node.js issue tracker. -* Authoring and editing stream documentation within the Node.js project. -* Reviewing changes to stream subclasses within the Node.js project. -* Redirecting changes to streams from the Node.js project to this - project. -* Assisting in the implementation of stream providers within Node.js. -* Recommending versions of `readable-stream` to be included in Node.js. -* Messaging about the future of streams to give the community advance - notice of changes. - -See [readable-stream](https://github.com/nodejs/readable-stream) for -more details. diff --git a/deps/npm/node_modules/from2/node_modules/string_decoder/lib/string_decoder.js b/deps/npm/node_modules/from2/node_modules/string_decoder/lib/string_decoder.js deleted file mode 100644 index 2e89e63f7933e4..00000000000000 --- a/deps/npm/node_modules/from2/node_modules/string_decoder/lib/string_decoder.js +++ /dev/null @@ -1,296 +0,0 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - -'use strict'; - -/**/ - -var Buffer = require('safe-buffer').Buffer; -/**/ - -var isEncoding = Buffer.isEncoding || function (encoding) { - encoding = '' + encoding; - switch (encoding && encoding.toLowerCase()) { - case 'hex':case 'utf8':case 'utf-8':case 'ascii':case 'binary':case 'base64':case 'ucs2':case 'ucs-2':case 'utf16le':case 'utf-16le':case 'raw': - return true; - default: - return false; - } -}; - -function _normalizeEncoding(enc) { - if (!enc) return 'utf8'; - var retried; - while (true) { - switch (enc) { - case 'utf8': - case 'utf-8': - return 'utf8'; - case 'ucs2': - case 'ucs-2': - case 'utf16le': - case 'utf-16le': - return 'utf16le'; - case 'latin1': - case 'binary': - return 'latin1'; - case 'base64': - case 'ascii': - case 'hex': - return enc; - default: - if (retried) return; // undefined - enc = ('' + enc).toLowerCase(); - retried = true; - } - } -}; - -// Do not cache `Buffer.isEncoding` when checking encoding names as some -// modules monkey-patch it to support additional encodings -function normalizeEncoding(enc) { - var nenc = _normalizeEncoding(enc); - if (typeof nenc !== 'string' && (Buffer.isEncoding === isEncoding || !isEncoding(enc))) throw new Error('Unknown encoding: ' + enc); - return nenc || enc; -} - -// StringDecoder provides an interface for efficiently splitting a series of -// buffers into a series of JS strings without breaking apart multi-byte -// characters. -exports.StringDecoder = StringDecoder; -function StringDecoder(encoding) { - this.encoding = normalizeEncoding(encoding); - var nb; - switch (this.encoding) { - case 'utf16le': - this.text = utf16Text; - this.end = utf16End; - nb = 4; - break; - case 'utf8': - this.fillLast = utf8FillLast; - nb = 4; - break; - case 'base64': - this.text = base64Text; - this.end = base64End; - nb = 3; - break; - default: - this.write = simpleWrite; - this.end = simpleEnd; - return; - } - this.lastNeed = 0; - this.lastTotal = 0; - this.lastChar = Buffer.allocUnsafe(nb); -} - -StringDecoder.prototype.write = function (buf) { - if (buf.length === 0) return ''; - var r; - var i; - if (this.lastNeed) { - r = this.fillLast(buf); - if (r === undefined) return ''; - i = this.lastNeed; - this.lastNeed = 0; - } else { - i = 0; - } - if (i < buf.length) return r ? r + this.text(buf, i) : this.text(buf, i); - return r || ''; -}; - -StringDecoder.prototype.end = utf8End; - -// Returns only complete characters in a Buffer -StringDecoder.prototype.text = utf8Text; - -// Attempts to complete a partial non-UTF-8 character using bytes from a Buffer -StringDecoder.prototype.fillLast = function (buf) { - if (this.lastNeed <= buf.length) { - buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, this.lastNeed); - return this.lastChar.toString(this.encoding, 0, this.lastTotal); - } - buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, buf.length); - this.lastNeed -= buf.length; -}; - -// Checks the type of a UTF-8 byte, whether it's ASCII, a leading byte, or a -// continuation byte. If an invalid byte is detected, -2 is returned. -function utf8CheckByte(byte) { - if (byte <= 0x7F) return 0;else if (byte >> 5 === 0x06) return 2;else if (byte >> 4 === 0x0E) return 3;else if (byte >> 3 === 0x1E) return 4; - return byte >> 6 === 0x02 ? -1 : -2; -} - -// Checks at most 3 bytes at the end of a Buffer in order to detect an -// incomplete multi-byte UTF-8 character. The total number of bytes (2, 3, or 4) -// needed to complete the UTF-8 character (if applicable) are returned. -function utf8CheckIncomplete(self, buf, i) { - var j = buf.length - 1; - if (j < i) return 0; - var nb = utf8CheckByte(buf[j]); - if (nb >= 0) { - if (nb > 0) self.lastNeed = nb - 1; - return nb; - } - if (--j < i || nb === -2) return 0; - nb = utf8CheckByte(buf[j]); - if (nb >= 0) { - if (nb > 0) self.lastNeed = nb - 2; - return nb; - } - if (--j < i || nb === -2) return 0; - nb = utf8CheckByte(buf[j]); - if (nb >= 0) { - if (nb > 0) { - if (nb === 2) nb = 0;else self.lastNeed = nb - 3; - } - return nb; - } - return 0; -} - -// Validates as many continuation bytes for a multi-byte UTF-8 character as -// needed or are available. If we see a non-continuation byte where we expect -// one, we "replace" the validated continuation bytes we've seen so far with -// a single UTF-8 replacement character ('\ufffd'), to match v8's UTF-8 decoding -// behavior. The continuation byte check is included three times in the case -// where all of the continuation bytes for a character exist in the same buffer. -// It is also done this way as a slight performance increase instead of using a -// loop. -function utf8CheckExtraBytes(self, buf, p) { - if ((buf[0] & 0xC0) !== 0x80) { - self.lastNeed = 0; - return '\ufffd'; - } - if (self.lastNeed > 1 && buf.length > 1) { - if ((buf[1] & 0xC0) !== 0x80) { - self.lastNeed = 1; - return '\ufffd'; - } - if (self.lastNeed > 2 && buf.length > 2) { - if ((buf[2] & 0xC0) !== 0x80) { - self.lastNeed = 2; - return '\ufffd'; - } - } - } -} - -// Attempts to complete a multi-byte UTF-8 character using bytes from a Buffer. -function utf8FillLast(buf) { - var p = this.lastTotal - this.lastNeed; - var r = utf8CheckExtraBytes(this, buf, p); - if (r !== undefined) return r; - if (this.lastNeed <= buf.length) { - buf.copy(this.lastChar, p, 0, this.lastNeed); - return this.lastChar.toString(this.encoding, 0, this.lastTotal); - } - buf.copy(this.lastChar, p, 0, buf.length); - this.lastNeed -= buf.length; -} - -// Returns all complete UTF-8 characters in a Buffer. If the Buffer ended on a -// partial character, the character's bytes are buffered until the required -// number of bytes are available. -function utf8Text(buf, i) { - var total = utf8CheckIncomplete(this, buf, i); - if (!this.lastNeed) return buf.toString('utf8', i); - this.lastTotal = total; - var end = buf.length - (total - this.lastNeed); - buf.copy(this.lastChar, 0, end); - return buf.toString('utf8', i, end); -} - -// For UTF-8, a replacement character is added when ending on a partial -// character. -function utf8End(buf) { - var r = buf && buf.length ? this.write(buf) : ''; - if (this.lastNeed) return r + '\ufffd'; - return r; -} - -// UTF-16LE typically needs two bytes per character, but even if we have an even -// number of bytes available, we need to check if we end on a leading/high -// surrogate. In that case, we need to wait for the next two bytes in order to -// decode the last character properly. -function utf16Text(buf, i) { - if ((buf.length - i) % 2 === 0) { - var r = buf.toString('utf16le', i); - if (r) { - var c = r.charCodeAt(r.length - 1); - if (c >= 0xD800 && c <= 0xDBFF) { - this.lastNeed = 2; - this.lastTotal = 4; - this.lastChar[0] = buf[buf.length - 2]; - this.lastChar[1] = buf[buf.length - 1]; - return r.slice(0, -1); - } - } - return r; - } - this.lastNeed = 1; - this.lastTotal = 2; - this.lastChar[0] = buf[buf.length - 1]; - return buf.toString('utf16le', i, buf.length - 1); -} - -// For UTF-16LE we do not explicitly append special replacement characters if we -// end on a partial character, we simply let v8 handle that. -function utf16End(buf) { - var r = buf && buf.length ? this.write(buf) : ''; - if (this.lastNeed) { - var end = this.lastTotal - this.lastNeed; - return r + this.lastChar.toString('utf16le', 0, end); - } - return r; -} - -function base64Text(buf, i) { - var n = (buf.length - i) % 3; - if (n === 0) return buf.toString('base64', i); - this.lastNeed = 3 - n; - this.lastTotal = 3; - if (n === 1) { - this.lastChar[0] = buf[buf.length - 1]; - } else { - this.lastChar[0] = buf[buf.length - 2]; - this.lastChar[1] = buf[buf.length - 1]; - } - return buf.toString('base64', i, buf.length - n); -} - -function base64End(buf) { - var r = buf && buf.length ? this.write(buf) : ''; - if (this.lastNeed) return r + this.lastChar.toString('base64', 0, 3 - this.lastNeed); - return r; -} - -// Pass bytes on through for single-byte encodings (e.g. ascii, latin1, hex) -function simpleWrite(buf) { - return buf.toString(this.encoding); -} - -function simpleEnd(buf) { - return buf && buf.length ? this.write(buf) : ''; -} \ No newline at end of file diff --git a/deps/npm/node_modules/from2/node_modules/string_decoder/package.json b/deps/npm/node_modules/from2/node_modules/string_decoder/package.json deleted file mode 100644 index feec8efa23be6c..00000000000000 --- a/deps/npm/node_modules/from2/node_modules/string_decoder/package.json +++ /dev/null @@ -1,59 +0,0 @@ -{ - "_from": "string_decoder@~1.1.1", - "_id": "string_decoder@1.1.1", - "_inBundle": false, - "_integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "_location": "/from2/string_decoder", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "string_decoder@~1.1.1", - "name": "string_decoder", - "escapedName": "string_decoder", - "rawSpec": "~1.1.1", - "saveSpec": null, - "fetchSpec": "~1.1.1" - }, - "_requiredBy": [ - "/from2/readable-stream" - ], - "_resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "_shasum": "9cf1611ba62685d7030ae9e4ba34149c3af03fc8", - "_spec": "string_decoder@~1.1.1", - "_where": "/Users/aeschright/code/cli/node_modules/from2/node_modules/readable-stream", - "bugs": { - "url": "https://github.com/nodejs/string_decoder/issues" - }, - "bundleDependencies": false, - "dependencies": { - "safe-buffer": "~5.1.0" - }, - "deprecated": false, - "description": "The string_decoder module from Node core", - "devDependencies": { - "babel-polyfill": "^6.23.0", - "core-util-is": "^1.0.2", - "inherits": "^2.0.3", - "tap": "~0.4.8" - }, - "homepage": "https://github.com/nodejs/string_decoder", - "keywords": [ - "string", - "decoder", - "browser", - "browserify" - ], - "license": "MIT", - "main": "lib/string_decoder.js", - "name": "string_decoder", - "repository": { - "type": "git", - "url": "git://github.com/nodejs/string_decoder.git" - }, - "scripts": { - "ci": "tap test/parallel/*.js test/ours/*.js --tap | tee test.tap && node test/verify-dependencies.js", - "test": "tap test/parallel/*.js && node test/verify-dependencies" - }, - "version": "1.1.1" -} diff --git a/deps/npm/node_modules/from2/package.json b/deps/npm/node_modules/from2/package.json deleted file mode 100644 index d5431768f07b91..00000000000000 --- a/deps/npm/node_modules/from2/package.json +++ /dev/null @@ -1,72 +0,0 @@ -{ - "_from": "from2@^2.1.0", - "_id": "from2@2.3.0", - "_inBundle": false, - "_integrity": "sha1-i/tVAr3kpNNs/e6gB/zKIdfjgq8=", - "_location": "/from2", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "from2@^2.1.0", - "name": "from2", - "escapedName": "from2", - "rawSpec": "^2.1.0", - "saveSpec": null, - "fetchSpec": "^2.1.0" - }, - "_requiredBy": [ - "/mississippi", - "/npm-profile/cacache/mississippi", - "/npm-profile/mississippi", - "/npm-registry-fetch/cacache/mississippi" - ], - "_resolved": "https://registry.npmjs.org/from2/-/from2-2.3.0.tgz", - "_shasum": "8bfb5502bde4a4d36cfdeea007fcca21d7e382af", - "_spec": "from2@^2.1.0", - "_where": "/Users/rebecca/code/npm/node_modules/mississippi", - "author": { - "name": "Hugh Kennedy", - "email": "hughskennedy@gmail.com", - "url": "http://hughsk.io/" - }, - "bugs": { - "url": "https://github.com/hughsk/from2/issues" - }, - "bundleDependencies": false, - "contributors": [ - { - "name": "Mathias Buus", - "email": "mathiasbuus@gmail.com" - } - ], - "dependencies": { - "inherits": "^2.0.1", - "readable-stream": "^2.0.0" - }, - "deprecated": false, - "description": "Convenience wrapper for ReadableStream, with an API lifted from \"from\" and \"through2\"", - "devDependencies": { - "tape": "^4.0.0" - }, - "homepage": "https://github.com/hughsk/from2", - "keywords": [ - "from", - "stream", - "readable", - "pull", - "convenience", - "wrapper" - ], - "license": "MIT", - "main": "index.js", - "name": "from2", - "repository": { - "type": "git", - "url": "git://github.com/hughsk/from2.git" - }, - "scripts": { - "test": "node test" - }, - "version": "2.3.0" -} diff --git a/deps/npm/node_modules/from2/test.js b/deps/npm/node_modules/from2/test.js deleted file mode 100644 index b11bd6cd86be26..00000000000000 --- a/deps/npm/node_modules/from2/test.js +++ /dev/null @@ -1,123 +0,0 @@ -var test = require('tape') -var path = require('path') -var from = require('./') -var fs = require('fs') - -var tmp = path.resolve( - __dirname, 'tmp.txt' -) - -function fromString(string) { - return from(function(size, next) { - if (string.length <= 0) return next(null, null) - var chunk = string.slice(0, size) - string = string.slice(size) - next(null, chunk) - }) -} - -test('from2', function(t) { - var contents = fs.readFileSync(__filename, 'utf8') - var stream = fromString(contents) - - stream - .pipe(fs.createWriteStream(tmp)) - .on('close', function() { - t.equal(fs.readFileSync(tmp, 'utf8'), contents) - fs.unlinkSync(tmp) - t.end() - }) -}) - -test('old mode', function(t) { - var contents = fs.readFileSync(__filename, 'utf8') - var stream = fromString(contents) - var buffer = '' - - stream.on('data', function(data) { - buffer += data - }).on('end', function() { - t.equal(buffer, contents) - t.end() - }) -}) - -test('destroy', function(t) { - var stream = from(function(size, next) { - process.nextTick(function() { - next(null, 'no') - }) - }) - - stream.on('data', function(data) { - t.ok(false) - }).on('close', function() { - t.ok(true) - t.end() - }) - - stream.destroy() -}) - -test('arrays', function (t) { - var input = ['a', 'b', 'c'] - var stream = from(input) - var output = [] - stream.on('data', function (letter) { - output.push(letter.toString()) - }) - stream.on('end', function () { - t.deepEqual(input, output) - t.end() - }) -}) - -test('obj arrays', function (t) { - var input = [{foo:'a'}, {foo:'b'}, {foo:'c'}] - var stream = from.obj(input) - var output = [] - stream.on('data', function (letter) { - output.push(letter) - }) - stream.on('end', function () { - t.deepEqual(input, output) - t.end() - }) -}) - - -test('arrays can emit errors', function (t) { - var input = ['a', 'b', new Error('ooops'), 'c'] - var stream = from(input) - var output = [] - stream.on('data', function (letter) { - output.push(letter.toString()) - }) - stream.on('error', function(e){ - t.deepEqual(['a', 'b'], output) - t.equal('ooops', e.message) - t.end() - }) - stream.on('end', function () { - t.fail('the stream should have errored') - }) -}) - -test('obj arrays can emit errors', function (t) { - var input = [{foo:'a'}, {foo:'b'}, new Error('ooops'), {foo:'c'}] - var stream = from.obj(input) - var output = [] - stream.on('data', function (letter) { - output.push(letter) - }) - stream.on('error', function(e){ - t.deepEqual([{foo:'a'}, {foo:'b'}], output) - t.equal('ooops', e.message) - t.end() - }) - stream.on('end', function () { - t.fail('the stream should have errored') - }) -}) - - diff --git a/deps/npm/node_modules/fs-minipass/index.js b/deps/npm/node_modules/fs-minipass/index.js index cd585a83c59b8d..9b0779c80c55ea 100644 --- a/deps/npm/node_modules/fs-minipass/index.js +++ b/deps/npm/node_modules/fs-minipass/index.js @@ -3,11 +3,21 @@ const MiniPass = require('minipass') const EE = require('events').EventEmitter const fs = require('fs') -// for writev -const binding = process.binding('fs') -const writeBuffers = binding.writeBuffers +let writev = fs.writev /* istanbul ignore next */ -const FSReqWrap = binding.FSReqWrap || binding.FSReqCallback +if (!writev) { + // This entire block can be removed if support for earlier than Node.js + // 12.9.0 is not needed. + const binding = process.binding('fs') + const FSReqWrap = binding.FSReqWrap || binding.FSReqCallback + + writev = (fd, iovec, pos, cb) => { + const done = (er, bw) => cb(er, bw, iovec) + const req = new FSReqWrap() + req.oncomplete = done + binding.writeBuffers(fd, iovec, pos, req) + } +} const _autoClose = Symbol('_autoClose') const _close = Symbol('_close') @@ -36,17 +46,20 @@ const _size = Symbol('_size') const _write = Symbol('_write') const _writing = Symbol('_writing') const _defaultFlag = Symbol('_defaultFlag') +const _errored = Symbol('_errored') class ReadStream extends MiniPass { constructor (path, opt) { opt = opt || {} super(opt) + this.readable = true this.writable = false if (typeof path !== 'string') throw new TypeError('path must be a string') + this[_errored] = false this[_fd] = typeof opt.fd === 'number' ? opt.fd : null this[_path] = path this[_readSize] = opt.readSize || 16*1024*1024 @@ -96,7 +109,8 @@ class ReadStream extends MiniPass { this[_reading] = true const buf = this[_makeBuf]() /* istanbul ignore if */ - if (buf.length === 0) return process.nextTick(() => this[_onread](null, 0, buf)) + if (buf.length === 0) + return process.nextTick(() => this[_onread](null, 0, buf)) fs.read(this[_fd], buf, 0, buf.length, null, (er, br, buf) => this[_onread](er, br, buf)) } @@ -112,8 +126,9 @@ class ReadStream extends MiniPass { [_close] () { if (this[_autoClose] && typeof this[_fd] === 'number') { - fs.close(this[_fd], _ => this.emit('close')) + const fd = this[_fd] this[_fd] = null + fs.close(fd, er => er ? this.emit('error', er) : this.emit('close')) } } @@ -150,6 +165,12 @@ class ReadStream extends MiniPass { this[_read]() break + case 'error': + if (this[_errored]) + return + this[_errored] = true + return super.emit(ev, data) + default: return super.emit(ev, data) } @@ -176,7 +197,8 @@ class ReadStreamSync extends ReadStream { do { const buf = this[_makeBuf]() /* istanbul ignore next */ - const br = buf.length === 0 ? 0 : fs.readSync(this[_fd], buf, 0, buf.length, null) + const br = buf.length === 0 ? 0 + : fs.readSync(this[_fd], buf, 0, buf.length, null) if (!this[_handleChunk](br, buf)) break } while (true) @@ -191,10 +213,9 @@ class ReadStreamSync extends ReadStream { [_close] () { if (this[_autoClose] && typeof this[_fd] === 'number') { - try { - fs.closeSync(this[_fd]) - } catch (er) {} + const fd = this[_fd] this[_fd] = null + fs.closeSync(fd) this.emit('close') } } @@ -205,6 +226,8 @@ class WriteStream extends EE { opt = opt || {} super(opt) this.readable = false + this.writable = true + this[_errored] = false this[_writing] = false this[_ended] = false this[_needDrain] = false @@ -225,6 +248,16 @@ class WriteStream extends EE { this[_open]() } + emit (ev, data) { + if (ev === 'error') { + if (this[_errored]) + return + this[_errored] = true + } + return super.emit(ev, data) + } + + get fd () { return this[_fd] } get path () { return this[_path] } @@ -264,11 +297,12 @@ class WriteStream extends EE { if (!this[_writing] && !this[_queue].length && typeof this[_fd] === 'number') this[_onwrite](null, 0) + return this } write (buf, enc) { if (typeof buf === 'string') - buf = new Buffer(buf, enc) + buf = Buffer.from(buf, enc) if (this[_ended]) { this.emit('error', new Error('write() after end()')) @@ -330,8 +364,9 @@ class WriteStream extends EE { [_close] () { if (this[_autoClose] && typeof this[_fd] === 'number') { - fs.close(this[_fd], _ => this.emit('close')) + const fd = this[_fd] this[_fd] = null + fs.close(fd, er => er ? this.emit('error', er) : this.emit('close')) } } } @@ -339,47 +374,47 @@ class WriteStream extends EE { class WriteStreamSync extends WriteStream { [_open] () { let fd - try { + // only wrap in a try{} block if we know we'll retry, to avoid + // the rethrow obscuring the error's source frame in most cases. + if (this[_defaultFlag] && this[_flags] === 'r+') { + try { + fd = fs.openSync(this[_path], this[_flags], this[_mode]) + } catch (er) { + if (er.code === 'ENOENT') { + this[_flags] = 'w' + return this[_open]() + } else + throw er + } + } else fd = fs.openSync(this[_path], this[_flags], this[_mode]) - } catch (er) { - if (this[_defaultFlag] && - this[_flags] === 'r+' && - er && er.code === 'ENOENT') { - this[_flags] = 'w' - return this[_open]() - } else - throw er - } + this[_onopen](null, fd) } [_close] () { if (this[_autoClose] && typeof this[_fd] === 'number') { - try { - fs.closeSync(this[_fd]) - } catch (er) {} + const fd = this[_fd] this[_fd] = null + fs.closeSync(fd) this.emit('close') } } [_write] (buf) { + // throw the original, but try to close if it fails + let threw = true try { this[_onwrite](null, fs.writeSync(this[_fd], buf, 0, buf.length, this[_pos])) - } catch (er) { - this[_onwrite](er, 0) + threw = false + } finally { + if (threw) + try { this[_close]() } catch (_) {} } } } -const writev = (fd, iovec, pos, cb) => { - const done = (er, bw) => cb(er, bw, iovec) - const req = new FSReqWrap() - req.oncomplete = done - binding.writeBuffers(fd, iovec, pos, req) -} - exports.ReadStream = ReadStream exports.ReadStreamSync = ReadStreamSync diff --git a/deps/npm/node_modules/fs-minipass/node_modules/minipass/README.md b/deps/npm/node_modules/fs-minipass/node_modules/minipass/README.md deleted file mode 100644 index c989beea0e6d97..00000000000000 --- a/deps/npm/node_modules/fs-minipass/node_modules/minipass/README.md +++ /dev/null @@ -1,606 +0,0 @@ -# minipass - -A _very_ minimal implementation of a [PassThrough -stream](https://nodejs.org/api/stream.html#stream_class_stream_passthrough) - -[It's very -fast](https://docs.google.com/spreadsheets/d/1oObKSrVwLX_7Ut4Z6g3fZW-AX1j1-k6w-cDsrkaSbHM/edit#gid=0) -for objects, strings, and buffers. - -Supports pipe()ing (including multi-pipe() and backpressure -transmission), buffering data until either a `data` event handler or -`pipe()` is added (so you don't lose the first chunk), and most other -cases where PassThrough is a good idea. - -There is a `read()` method, but it's much more efficient to consume -data from this stream via `'data'` events or by calling `pipe()` into -some other stream. Calling `read()` requires the buffer to be -flattened in some cases, which requires copying memory. - -There is also no `unpipe()` method. Once you start piping, there is -no stopping it! - -If you set `objectMode: true` in the options, then whatever is written -will be emitted. Otherwise, it'll do a minimal amount of Buffer -copying to ensure proper Streams semantics when `read(n)` is called. - -`objectMode` can also be set by doing `stream.objectMode = true`, or by -writing any non-string/non-buffer data. `objectMode` cannot be set to -false once it is set. - -This is not a `through` or `through2` stream. It doesn't transform -the data, it just passes it right through. If you want to transform -the data, extend the class, and override the `write()` method. Once -you're done transforming the data however you want, call -`super.write()` with the transform output. - -For some examples of streams that extend Minipass in various ways, check -out: - -- [minizlib](http://npm.im/minizlib) -- [fs-minipass](http://npm.im/fs-minipass) -- [tar](http://npm.im/tar) -- [minipass-collect](http://npm.im/minipass-collect) -- [minipass-flush](http://npm.im/minipass-flush) -- [minipass-pipeline](http://npm.im/minipass-pipeline) -- [tap](http://npm.im/tap) -- [tap-parser](http://npm.im/tap) -- [treport](http://npm.im/tap) - -## Differences from Node.js Streams - -There are several things that make Minipass streams different from (and in -some ways superior to) Node.js core streams. - -Please read these caveats if you are familiar with noode-core streams and -intend to use Minipass streams in your programs. - -### Timing - -Minipass streams are designed to support synchronous use-cases. Thus, data -is emitted as soon as it is available, always. It is buffered until read, -but no longer. Another way to look at it is that Minipass streams are -exactly as synchronous as the logic that writes into them. - -This can be surprising if your code relies on `PassThrough.write()` always -providing data on the next tick rather than the current one, or being able -to call `resume()` and not have the entire buffer disappear immediately. - -However, without this synchronicity guarantee, there would be no way for -Minipass to achieve the speeds it does, or support the synchronous use -cases that it does. Simply put, waiting takes time. - -This non-deferring approach makes Minipass streams much easier to reason -about, especially in the context of Promises and other flow-control -mechanisms. - -### No High/Low Water Marks - -Node.js core streams will optimistically fill up a buffer, returning `true` -on all writes until the limit is hit, even if the data has nowhere to go. -Then, they will not attempt to draw more data in until the buffer size dips -below a minimum value. - -Minipass streams are much simpler. The `write()` method will return `true` -if the data has somewhere to go (which is to say, given the timing -guarantees, that the data is already there by the time `write()` returns). - -If the data has nowhere to go, then `write()` returns false, and the data -sits in a buffer, to be drained out immediately as soon as anyone consumes -it. - -### Hazards of Buffering (or: Why Minipass Is So Fast) - -Since data written to a Minipass stream is immediately written all the way -through the pipeline, and `write()` always returns true/false based on -whether the data was fully flushed, backpressure is communicated -immediately to the upstream caller. This minimizes buffering. - -Consider this case: - -```js -const {PassThrough} = require('stream') -const p1 = new PassThrough({ highWaterMark: 1024 }) -const p2 = new PassThrough({ highWaterMark: 1024 }) -const p3 = new PassThrough({ highWaterMark: 1024 }) -const p4 = new PassThrough({ highWaterMark: 1024 }) - -p1.pipe(p2).pipe(p3).pipe(p4) -p4.on('data', () => console.log('made it through')) - -// this returns false and buffers, then writes to p2 on next tick (1) -// p2 returns false and buffers, pausing p1, then writes to p3 on next tick (2) -// p3 returns false and buffers, pausing p2, then writes to p4 on next tick (3) -// p4 returns false and buffers, pausing p3, then emits 'data' and 'drain' -// on next tick (4) -// p3 sees p4's 'drain' event, and calls resume(), emitting 'resume' and -// 'drain' on next tick (5) -// p2 sees p3's 'drain', calls resume(), emits 'resume' and 'drain' on next tick (6) -// p1 sees p2's 'drain', calls resume(), emits 'resume' and 'drain' on next -// tick (7) - -p1.write(Buffer.alloc(2048)) // returns false -``` - -Along the way, the data was buffered and deferred at each stage, and -multiple event deferrals happened, for an unblocked pipeline where it was -perfectly safe to write all the way through! - -Furthermore, setting a `highWaterMark` of `1024` might lead someone reading -the code to think an advisory maximum of 1KiB is being set for the -pipeline. However, the actual advisory buffering level is the _sum_ of -`highWaterMark` values, since each one has its own bucket. - -Consider the Minipass case: - -```js -const m1 = new Minipass() -const m2 = new Minipass() -const m3 = new Minipass() -const m4 = new Minipass() - -m1.pipe(m2).pipe(m3).pipe(m4) -m4.on('data', () => console.log('made it through')) - -// m1 is flowing, so it writes the data to m2 immediately -// m2 is flowing, so it writes the data to m3 immediately -// m3 is flowing, so it writes the data to m4 immediately -// m4 is flowing, so it fires the 'data' event immediately, returns true -// m4's write returned true, so m3 is still flowing, returns true -// m3's write returned true, so m2 is still flowing, returns true -// m2's write returned true, so m1 is still flowing, returns true -// No event deferrals or buffering along the way! - -m1.write(Buffer.alloc(2048)) // returns true -``` - -It is extremely unlikely that you _don't_ want to buffer any data written, -or _ever_ buffer data that can be flushed all the way through. Neither -node-core streams nor Minipass ever fail to buffer written data, but -node-core streams do a lot of unnecessary buffering and pausing. - -As always, the faster implementation is the one that does less stuff and -waits less time to do it. - -### Immediately emit `end` for empty streams (when not paused) - -If a stream is not paused, and `end()` is called before writing any data -into it, then it will emit `end` immediately. - -If you have logic that occurs on the `end` event which you don't want to -potentially happen immediately (for example, closing file descriptors, -moving on to the next entry in an archive parse stream, etc.) then be sure -to call `stream.pause()` on creation, and then `stream.resume()` once you -are ready to respond to the `end` event. - -### Emit `end` When Asked - -One hazard of immediately emitting `'end'` is that you may not yet have had -a chance to add a listener. In order to avoid this hazard, Minipass -streams safely re-emit the `'end'` event if a new listener is added after -`'end'` has been emitted. - -Ie, if you do `stream.on('end', someFunction)`, and the stream has already -emitted `end`, then it will call the handler right away. (You can think of -this somewhat like attaching a new `.then(fn)` to a previously-resolved -Promise.) - -To prevent calling handlers multiple times who would not expect multiple -ends to occur, all listeners are removed from the `'end'` event whenever it -is emitted. - -### Impact of "immediate flow" on Tee-streams - -A "tee stream" is a stream piping to multiple destinations: - -```js -const tee = new Minipass() -t.pipe(dest1) -t.pipe(dest2) -t.write('foo') // goes to both destinations -``` - -Since Minipass streams _immediately_ process any pending data through the -pipeline when a new pipe destination is added, this can have surprising -effects, especially when a stream comes in from some other function and may -or may not have data in its buffer. - -```js -// WARNING! WILL LOSE DATA! -const src = new Minipass() -src.write('foo') -src.pipe(dest1) // 'foo' chunk flows to dest1 immediately, and is gone -src.pipe(dest2) // gets nothing! -``` - -The solution is to create a dedicated tee-stream junction that pipes to -both locations, and then pipe to _that_ instead. - -```js -// Safe example: tee to both places -const src = new Minipass() -src.write('foo') -const tee = new Minipass() -tee.pipe(dest1) -tee.pipe(dest2) -stream.pipe(tee) // tee gets 'foo', pipes to both locations -``` - -The same caveat applies to `on('data')` event listeners. The first one -added will _immediately_ receive all of the data, leaving nothing for the -second: - -```js -// WARNING! WILL LOSE DATA! -const src = new Minipass() -src.write('foo') -src.on('data', handler1) // receives 'foo' right away -src.on('data', handler2) // nothing to see here! -``` - -Using a dedicated tee-stream can be used in this case as well: - -```js -// Safe example: tee to both data handlers -const src = new Minipass() -src.write('foo') -const tee = new Minipass() -tee.on('data', handler1) -tee.on('data', handler2) -src.pipe(tee) -``` - -## USAGE - -It's a stream! Use it like a stream and it'll most likely do what you want. - -```js -const Minipass = require('minipass') -const mp = new Minipass(options) // optional: { encoding, objectMode } -mp.write('foo') -mp.pipe(someOtherStream) -mp.end('bar') -``` - -### OPTIONS - -* `encoding` How would you like the data coming _out_ of the stream to be - encoded? Accepts any values that can be passed to `Buffer.toString()`. -* `objectMode` Emit data exactly as it comes in. This will be flipped on - by default if you write() something other than a string or Buffer at any - point. Setting `objectMode: true` will prevent setting any encoding - value. - -### API - -Implements the user-facing portions of Node.js's `Readable` and `Writable` -streams. - -### Methods - -* `write(chunk, [encoding], [callback])` - Put data in. (Note that, in the - base Minipass class, the same data will come out.) Returns `false` if - the stream will buffer the next write, or true if it's still in - "flowing" mode. -* `end([chunk, [encoding]], [callback])` - Signal that you have no more - data to write. This will queue an `end` event to be fired when all the - data has been consumed. -* `setEncoding(encoding)` - Set the encoding for data coming of the - stream. This can only be done once. -* `pause()` - No more data for a while, please. This also prevents `end` - from being emitted for empty streams until the stream is resumed. -* `resume()` - Resume the stream. If there's data in the buffer, it is - all discarded. Any buffered events are immediately emitted. -* `pipe(dest)` - Send all output to the stream provided. There is no way - to unpipe. When data is emitted, it is immediately written to any and - all pipe destinations. -* `on(ev, fn)`, `emit(ev, fn)` - Minipass streams are EventEmitters. - Some events are given special treatment, however. (See below under - "events".) -* `promise()` - Returns a Promise that resolves when the stream emits - `end`, or rejects if the stream emits `error`. -* `collect()` - Return a Promise that resolves on `end` with an array - containing each chunk of data that was emitted, or rejects if the - stream emits `error`. Note that this consumes the stream data. -* `concat()` - Same as `collect()`, but concatenates the data into a - single Buffer object. Will reject the returned promise if the stream is - in objectMode, or if it goes into objectMode by the end of the data. -* `read(n)` - Consume `n` bytes of data out of the buffer. If `n` is not - provided, then consume all of it. If `n` bytes are not available, then - it returns null. **Note** consuming streams in this way is less - efficient, and can lead to unnecessary Buffer copying. -* `destroy([er])` - Destroy the stream. If an error is provided, then an - `'error'` event is emitted. If the stream has a `close()` method, and - has not emitted a `'close'` event yet, then `stream.close()` will be - called. Any Promises returned by `.promise()`, `.collect()` or - `.concat()` will be rejected. After being destroyed, writing to the - stream will emit an error. No more data will be emitted if the stream is - destroyed, even if it was previously buffered. - -### Properties - -* `bufferLength` Read-only. Total number of bytes buffered, or in the case - of objectMode, the total number of objects. -* `encoding` The encoding that has been set. (Setting this is equivalent - to calling `setEncoding(enc)` and has the same prohibition against - setting multiple times.) -* `flowing` Read-only. Boolean indicating whether a chunk written to the - stream will be immediately emitted. -* `emittedEnd` Read-only. Boolean indicating whether the end-ish events - (ie, `end`, `prefinish`, `finish`) have been emitted. Note that - listening on any end-ish event will immediateyl re-emit it if it has - already been emitted. -* `writable` Whether the stream is writable. Default `true`. Set to - `false` when `end()` -* `readable` Whether the stream is readable. Default `true`. -* `buffer` A [yallist](http://npm.im/yallist) linked list of chunks written - to the stream that have not yet been emitted. (It's probably a bad idea - to mess with this.) -* `pipes` A [yallist](http://npm.im/yallist) linked list of streams that - this stream is piping into. (It's probably a bad idea to mess with - this.) -* `destroyed` A getter that indicates whether the stream was destroyed. -* `paused` True if the stream has been explicitly paused, otherwise false. -* `objectMode` Indicates whether the stream is in `objectMode`. Once set - to `true`, it cannot be set to `false`. - -### Events - -* `data` Emitted when there's data to read. Argument is the data to read. - This is never emitted while not flowing. If a listener is attached, that - will resume the stream. -* `end` Emitted when there's no more data to read. This will be emitted - immediately for empty streams when `end()` is called. If a listener is - attached, and `end` was already emitted, then it will be emitted again. - All listeners are removed when `end` is emitted. -* `prefinish` An end-ish event that follows the same logic as `end` and is - emitted in the same conditions where `end` is emitted. Emitted after - `'end'`. -* `finish` An end-ish event that follows the same logic as `end` and is - emitted in the same conditions where `end` is emitted. Emitted after - `'prefinish'`. -* `close` An indication that an underlying resource has been released. - Minipass does not emit this event, but will defer it until after `end` - has been emitted, since it throws off some stream libraries otherwise. -* `drain` Emitted when the internal buffer empties, and it is again - suitable to `write()` into the stream. -* `readable` Emitted when data is buffered and ready to be read by a - consumer. -* `resume` Emitted when stream changes state from buffering to flowing - mode. (Ie, when `resume` is called, `pipe` is called, or a `data` event - listener is added.) - -### Static Methods - -* `Minipass.isStream(stream)` Returns `true` if the argument is a stream, - and false otherwise. To be considered a stream, the object must be - either an instance of Minipass, or an EventEmitter that has either a - `pipe()` method, or both `write()` and `end()` methods. (Pretty much any - stream in node-land will return `true` for this.) - -## EXAMPLES - -Here are some examples of things you can do with Minipass streams. - -### simple "are you done yet" promise - -```js -mp.promise().then(() => { - // stream is finished -}, er => { - // stream emitted an error -}) -``` - -### collecting - -```js -mp.collect().then(all => { - // all is an array of all the data emitted - // encoding is supported in this case, so - // so the result will be a collection of strings if - // an encoding is specified, or buffers/objects if not. - // - // In an async function, you may do - // const data = await stream.collect() -}) -``` - -### collecting into a single blob - -This is a bit slower because it concatenates the data into one chunk for -you, but if you're going to do it yourself anyway, it's convenient this -way: - -```js -mp.concat().then(onebigchunk => { - // onebigchunk is a string if the stream - // had an encoding set, or a buffer otherwise. -}) -``` - -### iteration - -You can iterate over streams synchronously or asynchronously in -platforms that support it. - -Synchronous iteration will end when the currently available data is -consumed, even if the `end` event has not been reached. In string and -buffer mode, the data is concatenated, so unless multiple writes are -occurring in the same tick as the `read()`, sync iteration loops will -generally only have a single iteration. - -To consume chunks in this way exactly as they have been written, with -no flattening, create the stream with the `{ objectMode: true }` -option. - -```js -const mp = new Minipass({ objectMode: true }) -mp.write('a') -mp.write('b') -for (let letter of mp) { - console.log(letter) // a, b -} -mp.write('c') -mp.write('d') -for (let letter of mp) { - console.log(letter) // c, d -} -mp.write('e') -mp.end() -for (let letter of mp) { - console.log(letter) // e -} -for (let letter of mp) { - console.log(letter) // nothing -} -``` - -Asynchronous iteration will continue until the end event is reached, -consuming all of the data. - -```js -const mp = new Minipass({ encoding: 'utf8' }) - -// some source of some data -let i = 5 -const inter = setInterval(() => { - if (i --> 0) - mp.write(Buffer.from('foo\n', 'utf8')) - else { - mp.end() - clearInterval(inter) - } -}, 100) - -// consume the data with asynchronous iteration -async function consume () { - for await (let chunk of mp) { - console.log(chunk) - } - return 'ok' -} - -consume().then(res => console.log(res)) -// logs `foo\n` 5 times, and then `ok` -``` - -### subclass that `console.log()`s everything written into it - -```js -class Logger extends Minipass { - write (chunk, encoding, callback) { - console.log('WRITE', chunk, encoding) - return super.write(chunk, encoding, callback) - } - end (chunk, encoding, callback) { - console.log('END', chunk, encoding) - return super.end(chunk, encoding, callback) - } -} - -someSource.pipe(new Logger()).pipe(someDest) -``` - -### same thing, but using an inline anonymous class - -```js -// js classes are fun -someSource - .pipe(new (class extends Minipass { - emit (ev, ...data) { - // let's also log events, because debugging some weird thing - console.log('EMIT', ev) - return super.emit(ev, ...data) - } - write (chunk, encoding, callback) { - console.log('WRITE', chunk, encoding) - return super.write(chunk, encoding, callback) - } - end (chunk, encoding, callback) { - console.log('END', chunk, encoding) - return super.end(chunk, encoding, callback) - } - })) - .pipe(someDest) -``` - -### subclass that defers 'end' for some reason - -```js -class SlowEnd extends Minipass { - emit (ev, ...args) { - if (ev === 'end') { - console.log('going to end, hold on a sec') - setTimeout(() => { - console.log('ok, ready to end now') - super.emit('end', ...args) - }, 100) - } else { - return super.emit(ev, ...args) - } - } -} -``` - -### transform that creates newline-delimited JSON - -```js -class NDJSONEncode extends Minipass { - write (obj, cb) { - try { - // JSON.stringify can throw, emit an error on that - return super.write(JSON.stringify(obj) + '\n', 'utf8', cb) - } catch (er) { - this.emit('error', er) - } - } - end (obj, cb) { - if (typeof obj === 'function') { - cb = obj - obj = undefined - } - if (obj !== undefined) { - this.write(obj) - } - return super.end(cb) - } -} -``` - -### transform that parses newline-delimited JSON - -```js -class NDJSONDecode extends Minipass { - constructor (options) { - // always be in object mode, as far as Minipass is concerned - super({ objectMode: true }) - this._jsonBuffer = '' - } - write (chunk, encoding, cb) { - if (typeof chunk === 'string' && - typeof encoding === 'string' && - encoding !== 'utf8') { - chunk = Buffer.from(chunk, encoding).toString() - } else if (Buffer.isBuffer(chunk)) - chunk = chunk.toString() - } - if (typeof encoding === 'function') { - cb = encoding - } - const jsonData = (this._jsonBuffer + chunk).split('\n') - this._jsonBuffer = jsonData.pop() - for (let i = 0; i < jsonData.length; i++) { - let parsed - try { - super.write(parsed) - } catch (er) { - this.emit('error', er) - continue - } - } - if (cb) - cb() - } -} -``` diff --git a/deps/npm/node_modules/fs-minipass/node_modules/minipass/index.js b/deps/npm/node_modules/fs-minipass/node_modules/minipass/index.js deleted file mode 100644 index c072352d448a97..00000000000000 --- a/deps/npm/node_modules/fs-minipass/node_modules/minipass/index.js +++ /dev/null @@ -1,537 +0,0 @@ -'use strict' -const EE = require('events') -const Yallist = require('yallist') -const SD = require('string_decoder').StringDecoder - -const EOF = Symbol('EOF') -const MAYBE_EMIT_END = Symbol('maybeEmitEnd') -const EMITTED_END = Symbol('emittedEnd') -const EMITTING_END = Symbol('emittingEnd') -const CLOSED = Symbol('closed') -const READ = Symbol('read') -const FLUSH = Symbol('flush') -const FLUSHCHUNK = Symbol('flushChunk') -const ENCODING = Symbol('encoding') -const DECODER = Symbol('decoder') -const FLOWING = Symbol('flowing') -const PAUSED = Symbol('paused') -const RESUME = Symbol('resume') -const BUFFERLENGTH = Symbol('bufferLength') -const BUFFERPUSH = Symbol('bufferPush') -const BUFFERSHIFT = Symbol('bufferShift') -const OBJECTMODE = Symbol('objectMode') -const DESTROYED = Symbol('destroyed') - -// TODO remove when Node v8 support drops -const doIter = global._MP_NO_ITERATOR_SYMBOLS_ !== '1' -const ASYNCITERATOR = doIter && Symbol.asyncIterator - || Symbol('asyncIterator not implemented') -const ITERATOR = doIter && Symbol.iterator - || Symbol('iterator not implemented') - -// Buffer in node 4.x < 4.5.0 doesn't have working Buffer.from -// or Buffer.alloc, and Buffer in node 10 deprecated the ctor. -// .M, this is fine .\^/M.. -const B = Buffer.alloc ? Buffer - : /* istanbul ignore next */ require('safe-buffer').Buffer - -// events that mean 'the stream is over' -// these are treated specially, and re-emitted -// if they are listened for after emitting. -const isEndish = ev => - ev === 'end' || - ev === 'finish' || - ev === 'prefinish' - -const isArrayBuffer = b => b instanceof ArrayBuffer || - typeof b === 'object' && - b.constructor && - b.constructor.name === 'ArrayBuffer' && - b.byteLength >= 0 - -const isArrayBufferView = b => !B.isBuffer(b) && ArrayBuffer.isView(b) - -module.exports = class Minipass extends EE { - constructor (options) { - super() - this[FLOWING] = false - // whether we're explicitly paused - this[PAUSED] = false - this.pipes = new Yallist() - this.buffer = new Yallist() - this[OBJECTMODE] = options && options.objectMode || false - if (this[OBJECTMODE]) - this[ENCODING] = null - else - this[ENCODING] = options && options.encoding || null - if (this[ENCODING] === 'buffer') - this[ENCODING] = null - this[DECODER] = this[ENCODING] ? new SD(this[ENCODING]) : null - this[EOF] = false - this[EMITTED_END] = false - this[EMITTING_END] = false - this[CLOSED] = false - this.writable = true - this.readable = true - this[BUFFERLENGTH] = 0 - this[DESTROYED] = false - } - - get bufferLength () { return this[BUFFERLENGTH] } - - get encoding () { return this[ENCODING] } - set encoding (enc) { - if (this[OBJECTMODE]) - throw new Error('cannot set encoding in objectMode') - - if (this[ENCODING] && enc !== this[ENCODING] && - (this[DECODER] && this[DECODER].lastNeed || this[BUFFERLENGTH])) - throw new Error('cannot change encoding') - - if (this[ENCODING] !== enc) { - this[DECODER] = enc ? new SD(enc) : null - if (this.buffer.length) - this.buffer = this.buffer.map(chunk => this[DECODER].write(chunk)) - } - - this[ENCODING] = enc - } - - setEncoding (enc) { - this.encoding = enc - } - - get objectMode () { return this[OBJECTMODE] } - set objectMode (ॐ ) { this[OBJECTMODE] = this[OBJECTMODE] || !!ॐ } - - write (chunk, encoding, cb) { - if (this[EOF]) - throw new Error('write after end') - - if (this[DESTROYED]) { - this.emit('error', Object.assign( - new Error('Cannot call write after a stream was destroyed'), - { code: 'ERR_STREAM_DESTROYED' } - )) - return true - } - - if (typeof encoding === 'function') - cb = encoding, encoding = 'utf8' - - if (!encoding) - encoding = 'utf8' - - // convert array buffers and typed array views into buffers - // at some point in the future, we may want to do the opposite! - // leave strings and buffers as-is - // anything else switches us into object mode - if (!this[OBJECTMODE] && !B.isBuffer(chunk)) { - if (isArrayBufferView(chunk)) - chunk = B.from(chunk.buffer, chunk.byteOffset, chunk.byteLength) - else if (isArrayBuffer(chunk)) - chunk = B.from(chunk) - else if (typeof chunk !== 'string') - // use the setter so we throw if we have encoding set - this.objectMode = true - } - - // this ensures at this point that the chunk is a buffer or string - // don't buffer it up or send it to the decoder - if (!this.objectMode && !chunk.length) { - const ret = this.flowing - if (this[BUFFERLENGTH] !== 0) - this.emit('readable') - if (cb) - cb() - return ret - } - - // fast-path writing strings of same encoding to a stream with - // an empty buffer, skipping the buffer/decoder dance - if (typeof chunk === 'string' && !this[OBJECTMODE] && - // unless it is a string already ready for us to use - !(encoding === this[ENCODING] && !this[DECODER].lastNeed)) { - chunk = B.from(chunk, encoding) - } - - if (B.isBuffer(chunk) && this[ENCODING]) - chunk = this[DECODER].write(chunk) - - try { - return this.flowing - ? (this.emit('data', chunk), this.flowing) - : (this[BUFFERPUSH](chunk), false) - } finally { - if (this[BUFFERLENGTH] !== 0) - this.emit('readable') - if (cb) - cb() - } - } - - read (n) { - if (this[DESTROYED]) - return null - - try { - if (this[BUFFERLENGTH] === 0 || n === 0 || n > this[BUFFERLENGTH]) - return null - - if (this[OBJECTMODE]) - n = null - - if (this.buffer.length > 1 && !this[OBJECTMODE]) { - if (this.encoding) - this.buffer = new Yallist([ - Array.from(this.buffer).join('') - ]) - else - this.buffer = new Yallist([ - B.concat(Array.from(this.buffer), this[BUFFERLENGTH]) - ]) - } - - return this[READ](n || null, this.buffer.head.value) - } finally { - this[MAYBE_EMIT_END]() - } - } - - [READ] (n, chunk) { - if (n === chunk.length || n === null) - this[BUFFERSHIFT]() - else { - this.buffer.head.value = chunk.slice(n) - chunk = chunk.slice(0, n) - this[BUFFERLENGTH] -= n - } - - this.emit('data', chunk) - - if (!this.buffer.length && !this[EOF]) - this.emit('drain') - - return chunk - } - - end (chunk, encoding, cb) { - if (typeof chunk === 'function') - cb = chunk, chunk = null - if (typeof encoding === 'function') - cb = encoding, encoding = 'utf8' - if (chunk) - this.write(chunk, encoding) - if (cb) - this.once('end', cb) - this[EOF] = true - this.writable = false - - // if we haven't written anything, then go ahead and emit, - // even if we're not reading. - // we'll re-emit if a new 'end' listener is added anyway. - // This makes MP more suitable to write-only use cases. - if (this.flowing || !this[PAUSED]) - this[MAYBE_EMIT_END]() - return this - } - - // don't let the internal resume be overwritten - [RESUME] () { - if (this[DESTROYED]) - return - - this[PAUSED] = false - this[FLOWING] = true - this.emit('resume') - if (this.buffer.length) - this[FLUSH]() - else if (this[EOF]) - this[MAYBE_EMIT_END]() - else - this.emit('drain') - } - - resume () { - return this[RESUME]() - } - - pause () { - this[FLOWING] = false - this[PAUSED] = true - } - - get destroyed () { - return this[DESTROYED] - } - - get flowing () { - return this[FLOWING] - } - - get paused () { - return this[PAUSED] - } - - [BUFFERPUSH] (chunk) { - if (this[OBJECTMODE]) - this[BUFFERLENGTH] += 1 - else - this[BUFFERLENGTH] += chunk.length - return this.buffer.push(chunk) - } - - [BUFFERSHIFT] () { - if (this.buffer.length) { - if (this[OBJECTMODE]) - this[BUFFERLENGTH] -= 1 - else - this[BUFFERLENGTH] -= this.buffer.head.value.length - } - return this.buffer.shift() - } - - [FLUSH] () { - do {} while (this[FLUSHCHUNK](this[BUFFERSHIFT]())) - - if (!this.buffer.length && !this[EOF]) - this.emit('drain') - } - - [FLUSHCHUNK] (chunk) { - return chunk ? (this.emit('data', chunk), this.flowing) : false - } - - pipe (dest, opts) { - if (this[DESTROYED]) - return - - const ended = this[EMITTED_END] - opts = opts || {} - if (dest === process.stdout || dest === process.stderr) - opts.end = false - else - opts.end = opts.end !== false - - const p = { dest: dest, opts: opts, ondrain: _ => this[RESUME]() } - this.pipes.push(p) - - dest.on('drain', p.ondrain) - this[RESUME]() - // piping an ended stream ends immediately - if (ended && p.opts.end) - p.dest.end() - return dest - } - - addListener (ev, fn) { - return this.on(ev, fn) - } - - on (ev, fn) { - try { - return super.on(ev, fn) - } finally { - if (ev === 'data' && !this.pipes.length && !this.flowing) - this[RESUME]() - else if (isEndish(ev) && this[EMITTED_END]) { - super.emit(ev) - this.removeAllListeners(ev) - } - } - } - - get emittedEnd () { - return this[EMITTED_END] - } - - [MAYBE_EMIT_END] () { - if (!this[EMITTING_END] && - !this[EMITTED_END] && - !this[DESTROYED] && - this.buffer.length === 0 && - this[EOF]) { - this[EMITTING_END] = true - this.emit('end') - this.emit('prefinish') - this.emit('finish') - if (this[CLOSED]) - this.emit('close') - this[EMITTING_END] = false - } - } - - emit (ev, data) { - // error and close are only events allowed after calling destroy() - if (ev !== 'error' && ev !== 'close' && ev !== DESTROYED && this[DESTROYED]) - return - else if (ev === 'data') { - if (!data) - return - - if (this.pipes.length) - this.pipes.forEach(p => - p.dest.write(data) === false && this.pause()) - } else if (ev === 'end') { - // only actual end gets this treatment - if (this[EMITTED_END] === true) - return - - this[EMITTED_END] = true - this.readable = false - - if (this[DECODER]) { - data = this[DECODER].end() - if (data) { - this.pipes.forEach(p => p.dest.write(data)) - super.emit('data', data) - } - } - - this.pipes.forEach(p => { - p.dest.removeListener('drain', p.ondrain) - if (p.opts.end) - p.dest.end() - }) - } else if (ev === 'close') { - this[CLOSED] = true - // don't emit close before 'end' and 'finish' - if (!this[EMITTED_END] && !this[DESTROYED]) - return - } - - // TODO: replace with a spread operator when Node v4 support drops - const args = new Array(arguments.length) - args[0] = ev - args[1] = data - if (arguments.length > 2) { - for (let i = 2; i < arguments.length; i++) { - args[i] = arguments[i] - } - } - - try { - return super.emit.apply(this, args) - } finally { - if (!isEndish(ev)) - this[MAYBE_EMIT_END]() - else - this.removeAllListeners(ev) - } - } - - // const all = await stream.collect() - collect () { - const buf = [] - buf.dataLength = 0 - this.on('data', c => { - buf.push(c) - buf.dataLength += c.length - }) - return this.promise().then(() => buf) - } - - // const data = await stream.concat() - concat () { - return this[OBJECTMODE] - ? Promise.reject(new Error('cannot concat in objectMode')) - : this.collect().then(buf => - this[OBJECTMODE] - ? Promise.reject(new Error('cannot concat in objectMode')) - : this[ENCODING] ? buf.join('') : B.concat(buf, buf.dataLength)) - } - - // stream.promise().then(() => done, er => emitted error) - promise () { - return new Promise((resolve, reject) => { - this.on(DESTROYED, () => reject(new Error('stream destroyed'))) - this.on('end', () => resolve()) - this.on('error', er => reject(er)) - }) - } - - // for await (let chunk of stream) - [ASYNCITERATOR] () { - const next = () => { - const res = this.read() - if (res !== null) - return Promise.resolve({ done: false, value: res }) - - if (this[EOF]) - return Promise.resolve({ done: true }) - - let resolve = null - let reject = null - const onerr = er => { - this.removeListener('data', ondata) - this.removeListener('end', onend) - reject(er) - } - const ondata = value => { - this.removeListener('error', onerr) - this.removeListener('end', onend) - this.pause() - resolve({ value: value, done: !!this[EOF] }) - } - const onend = () => { - this.removeListener('error', onerr) - this.removeListener('data', ondata) - resolve({ done: true }) - } - const ondestroy = () => onerr(new Error('stream destroyed')) - return new Promise((res, rej) => { - reject = rej - resolve = res - this.once(DESTROYED, ondestroy) - this.once('error', onerr) - this.once('end', onend) - this.once('data', ondata) - }) - } - - return { next } - } - - // for (let chunk of stream) - [ITERATOR] () { - const next = () => { - const value = this.read() - const done = value === null - return { value, done } - } - return { next } - } - - destroy (er) { - if (this[DESTROYED]) { - if (er) - this.emit('error', er) - else - this.emit(DESTROYED) - return this - } - - this[DESTROYED] = true - - // throw away all buffered data, it's never coming out - this.buffer = new Yallist() - this[BUFFERLENGTH] = 0 - - if (typeof this.close === 'function' && !this[CLOSED]) - this.close() - - if (er) - this.emit('error', er) - else // if no error to emit, still reject pending promises - this.emit(DESTROYED) - - return this - } - - static isStream (s) { - return !!s && (s instanceof Minipass || s instanceof EE && ( - typeof s.pipe === 'function' || // readable - (typeof s.write === 'function' && typeof s.end === 'function') // writable - )) - } -} diff --git a/deps/npm/node_modules/fs-minipass/node_modules/minipass/package.json b/deps/npm/node_modules/fs-minipass/node_modules/minipass/package.json deleted file mode 100644 index 416e231c9c6a21..00000000000000 --- a/deps/npm/node_modules/fs-minipass/node_modules/minipass/package.json +++ /dev/null @@ -1,70 +0,0 @@ -{ - "_from": "minipass@^2.6.0", - "_id": "minipass@2.9.0", - "_inBundle": false, - "_integrity": "sha512-wxfUjg9WebH+CUDX/CdbRlh5SmfZiy/hpkxaRI16Y9W56Pa75sWgd/rvFilSgrauD9NyFymP/+JFV3KwzIsJeg==", - "_location": "/fs-minipass/minipass", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "minipass@^2.6.0", - "name": "minipass", - "escapedName": "minipass", - "rawSpec": "^2.6.0", - "saveSpec": null, - "fetchSpec": "^2.6.0" - }, - "_requiredBy": [ - "/fs-minipass" - ], - "_resolved": "https://registry.npmjs.org/minipass/-/minipass-2.9.0.tgz", - "_shasum": "e713762e7d3e32fed803115cf93e04bca9fcc9a6", - "_spec": "minipass@^2.6.0", - "_where": "/Users/mperrotte/npminc/cli/node_modules/fs-minipass", - "author": { - "name": "Isaac Z. Schlueter", - "email": "i@izs.me", - "url": "http://blog.izs.me/" - }, - "bugs": { - "url": "https://github.com/isaacs/minipass/issues" - }, - "bundleDependencies": false, - "dependencies": { - "safe-buffer": "^5.1.2", - "yallist": "^3.0.0" - }, - "deprecated": false, - "description": "minimal implementation of a PassThrough stream", - "devDependencies": { - "end-of-stream": "^1.4.0", - "tap": "^14.6.5", - "through2": "^2.0.3" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/isaacs/minipass#readme", - "keywords": [ - "passthrough", - "stream" - ], - "license": "ISC", - "main": "index.js", - "name": "minipass", - "repository": { - "type": "git", - "url": "git+https://github.com/isaacs/minipass.git" - }, - "scripts": { - "postpublish": "git push origin --follow-tags", - "postversion": "npm publish", - "preversion": "npm test", - "test": "tap" - }, - "tap": { - "check-coverage": true - }, - "version": "2.9.0" -} diff --git a/deps/npm/node_modules/fs-minipass/package.json b/deps/npm/node_modules/fs-minipass/package.json index 870d08f6fb963b..2f2436cb5c3b1a 100644 --- a/deps/npm/node_modules/fs-minipass/package.json +++ b/deps/npm/node_modules/fs-minipass/package.json @@ -1,44 +1,28 @@ { - "_from": "fs-minipass@^1.2.5", - "_id": "fs-minipass@1.2.7", - "_inBundle": false, - "_integrity": "sha512-GWSSJGFy4e9GUeCcbIkED+bgAoFyj7XF1mV8rma3QW4NIqX9Kyx79N/PF61H5udOV3aY1IaMLs6pGbH71nlCTA==", - "_location": "/fs-minipass", - "_phantomChildren": { - "safe-buffer": "5.1.2", - "yallist": "3.0.3" - }, - "_requested": { - "type": "range", - "registry": true, - "raw": "fs-minipass@^1.2.5", - "name": "fs-minipass", - "escapedName": "fs-minipass", - "rawSpec": "^1.2.5", - "saveSpec": null, - "fetchSpec": "^1.2.5" + "name": "fs-minipass", + "version": "2.1.0", + "main": "index.js", + "scripts": { + "test": "tap", + "preversion": "npm test", + "postversion": "npm publish", + "postpublish": "git push origin --follow-tags" }, - "_requiredBy": [ - "/tar" - ], - "_resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-1.2.7.tgz", - "_shasum": "ccff8570841e7fe4265693da88936c55aed7f7c7", - "_spec": "fs-minipass@^1.2.5", - "_where": "/Users/mperrotte/npminc/cli/node_modules/tar", - "author": { - "name": "Isaac Z. Schlueter", - "email": "i@izs.me", - "url": "http://blog.izs.me/" + "keywords": [], + "author": "Isaac Z. Schlueter (http://blog.izs.me/)", + "license": "ISC", + "repository": { + "type": "git", + "url": "git+https://github.com/npm/fs-minipass.git" }, "bugs": { "url": "https://github.com/npm/fs-minipass/issues" }, - "bundleDependencies": false, + "homepage": "https://github.com/npm/fs-minipass#readme", + "description": "fs read and write streams based on minipass", "dependencies": { - "minipass": "^2.6.0" + "minipass": "^3.0.0" }, - "deprecated": false, - "description": "fs read and write streams based on minipass", "devDependencies": { "mutate-fs": "^2.0.1", "tap": "^14.6.4" @@ -46,23 +30,10 @@ "files": [ "index.js" ], - "homepage": "https://github.com/npm/fs-minipass#readme", - "keywords": [], - "license": "ISC", - "main": "index.js", - "name": "fs-minipass", - "repository": { - "type": "git", - "url": "git+https://github.com/npm/fs-minipass.git" - }, - "scripts": { - "postpublish": "git push origin --follow-tags", - "postversion": "npm publish", - "preversion": "npm test", - "test": "tap" - }, "tap": { "check-coverage": true }, - "version": "1.2.7" + "engines": { + "node": ">= 8" + } } diff --git a/deps/npm/node_modules/fs-vacuum/.eslintrc b/deps/npm/node_modules/fs-vacuum/.eslintrc deleted file mode 100644 index 5c39c67eca02a9..00000000000000 --- a/deps/npm/node_modules/fs-vacuum/.eslintrc +++ /dev/null @@ -1,18 +0,0 @@ -{ - "env" : { - "node" : true - }, - "rules" : { - "curly" : 0, - "no-lonely-if" : 1, - "no-mixed-requires" : 0, - "no-underscore-dangle" : 0, - "no-unused-vars" : [2, {"vars" : "all", "args" : "after-used"}], - "no-use-before-define" : [2, "nofunc"], - "quotes" : [1, "double", "avoid-escape"], - "semi" : [2, "never"], - "space-after-keywords" : 1, - "space-infix-ops" : 0, - "strict" : 0 - } -} diff --git a/deps/npm/node_modules/fs-vacuum/.npmignore b/deps/npm/node_modules/fs-vacuum/.npmignore deleted file mode 100644 index 3c3629e647f5dd..00000000000000 --- a/deps/npm/node_modules/fs-vacuum/.npmignore +++ /dev/null @@ -1 +0,0 @@ -node_modules diff --git a/deps/npm/node_modules/fs-vacuum/.travis.yml b/deps/npm/node_modules/fs-vacuum/.travis.yml deleted file mode 100644 index 2325eae022b67f..00000000000000 --- a/deps/npm/node_modules/fs-vacuum/.travis.yml +++ /dev/null @@ -1,14 +0,0 @@ -language: node_js -node_js: - - "5" - - "4" - - iojs - - "0.12" - - "0.10" - - "0.8" -sudo: false -script: "npm test" -before_install: - - "npm -g install npm" -notifications: - slack: npm-inc:kRqQjto7YbINqHPb1X6nS3g8 diff --git a/deps/npm/node_modules/fs-vacuum/LICENSE b/deps/npm/node_modules/fs-vacuum/LICENSE deleted file mode 100644 index d07fa9743a0f31..00000000000000 --- a/deps/npm/node_modules/fs-vacuum/LICENSE +++ /dev/null @@ -1,13 +0,0 @@ -Copyright (c) 2015, Forrest L Norvell - -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/fs-vacuum/README.md b/deps/npm/node_modules/fs-vacuum/README.md deleted file mode 100644 index 8af1cb2485fe76..00000000000000 --- a/deps/npm/node_modules/fs-vacuum/README.md +++ /dev/null @@ -1,33 +0,0 @@ -# fs-vacuum - -Remove the empty branches of a directory tree, optionally up to (but not -including) a specified base directory. Optionally nukes the leaf directory. - -## Usage - -```javascript -var logger = require("npmlog"); -var vacuum = require("fs-vacuum"); - -var options = { - base : "/path/to/my/tree/root", - purge : true, - log : logger.silly.bind(logger, "myCleanup") -}; - -/* Assuming there are no other files or directories in "out", "to", or "my", - * the final path will just be "/path/to/my/tree/root". - */ -vacuum("/path/to/my/tree/root/out/to/my/files", options, function (error) { - if (error) console.error("Unable to cleanly vacuum:", error.message); -}); -``` -# vacuum(directory, options, callback) - -* `directory` {String} Leaf node to remove. **Must be a directory, symlink, or file.** -* `options` {Object} - * `base` {String} No directories at or above this level of the filesystem will be removed. - * `purge` {Boolean} If set, nuke the whole leaf directory, including its contents. - * `log` {Function} A logging function that takes `npmlog`-compatible argument lists. -* `callback` {Function} Function to call once vacuuming is complete. - * `error` {Error} What went wrong along the way, if anything. diff --git a/deps/npm/node_modules/fs-vacuum/package.json b/deps/npm/node_modules/fs-vacuum/package.json deleted file mode 100644 index 69529764dd5e95..00000000000000 --- a/deps/npm/node_modules/fs-vacuum/package.json +++ /dev/null @@ -1,69 +0,0 @@ -{ - "_args": [ - [ - "fs-vacuum@1.2.10", - "/Users/rebecca/code/npm" - ] - ], - "_from": "fs-vacuum@1.2.10", - "_id": "fs-vacuum@1.2.10", - "_inBundle": false, - "_integrity": "sha1-t2Kb7AekAxolSP35n17PHMizHjY=", - "_location": "/fs-vacuum", - "_phantomChildren": {}, - "_requested": { - "type": "version", - "registry": true, - "raw": "fs-vacuum@1.2.10", - "name": "fs-vacuum", - "escapedName": "fs-vacuum", - "rawSpec": "1.2.10", - "saveSpec": null, - "fetchSpec": "1.2.10" - }, - "_requiredBy": [ - "/", - "/gentle-fs" - ], - "_resolved": "https://registry.npmjs.org/fs-vacuum/-/fs-vacuum-1.2.10.tgz", - "_spec": "1.2.10", - "_where": "/Users/rebecca/code/npm", - "author": { - "name": "Forrest L Norvell", - "email": "ogd@aoaioxxysz.net" - }, - "bugs": { - "url": "https://github.com/npm/fs-vacuum/issues" - }, - "dependencies": { - "graceful-fs": "^4.1.2", - "path-is-inside": "^1.0.1", - "rimraf": "^2.5.2" - }, - "description": "recursively remove empty directories -- to a point", - "devDependencies": { - "errno": "~0.1.0", - "mkdirp": "^0.5.1", - "require-inject": "~1.3.0", - "standard": "^6.0.8", - "tap": "^5.7.1", - "tmp": "0.0.28" - }, - "homepage": "https://github.com/npm/fs-vacuum", - "keywords": [ - "rm", - "rimraf", - "clean" - ], - "license": "ISC", - "main": "vacuum.js", - "name": "fs-vacuum", - "repository": { - "type": "git", - "url": "git+https://github.com/npm/fs-vacuum.git" - }, - "scripts": { - "test": "standard && tap test/*.js" - }, - "version": "1.2.10" -} diff --git a/deps/npm/node_modules/fs-vacuum/test/arguments.js b/deps/npm/node_modules/fs-vacuum/test/arguments.js deleted file mode 100644 index 17ff2ee5988fb9..00000000000000 --- a/deps/npm/node_modules/fs-vacuum/test/arguments.js +++ /dev/null @@ -1,24 +0,0 @@ -var test = require('tap').test - -var vacuum = require('../vacuum.js') - -test('vacuum throws on missing parameters', function (t) { - t.throws(vacuum, 'called with no parameters') - t.throws(function () { vacuum('directory', {}) }, 'called with no callback') - - t.end() -}) - -test('vacuum throws on incorrect types ("Forrest is pedantic" section)', function (t) { - t.throws(function () { - vacuum({}, {}, function () {}) - }, 'called with path parameter of incorrect type') - t.throws(function () { - vacuum('directory', 'directory', function () {}) - }, 'called with options of wrong type') - t.throws(function () { - vacuum('directory', {}, 'whoops') - }, "called with callback that isn't callable") - - t.end() -}) diff --git a/deps/npm/node_modules/fs-vacuum/test/base-leaf-mismatch.js b/deps/npm/node_modules/fs-vacuum/test/base-leaf-mismatch.js deleted file mode 100644 index 1a6c53565d3067..00000000000000 --- a/deps/npm/node_modules/fs-vacuum/test/base-leaf-mismatch.js +++ /dev/null @@ -1,16 +0,0 @@ -var test = require('tap').test - -var vacuum = require('../vacuum.js') - -test('vacuum errors when base is set and path is not under it', function (t) { - vacuum('/a/made/up/path', {base: '/root/elsewhere'}, function (er) { - t.ok(er, 'got an error') - t.equal( - er.message, - '/a/made/up/path is not a child of /root/elsewhere', - 'got the expected error message' - ) - - t.end() - }) -}) diff --git a/deps/npm/node_modules/fs-vacuum/test/no-entries-file-no-purge.js b/deps/npm/node_modules/fs-vacuum/test/no-entries-file-no-purge.js deleted file mode 100644 index 819adcdcb3bcf5..00000000000000 --- a/deps/npm/node_modules/fs-vacuum/test/no-entries-file-no-purge.js +++ /dev/null @@ -1,78 +0,0 @@ -var path = require('path') - -var test = require('tap').test -var statSync = require('graceful-fs').statSync -var writeFile = require('graceful-fs').writeFile -var readdirSync = require('graceful-fs').readdirSync -var mkdtemp = require('tmp').dir -var mkdirp = require('mkdirp') - -var vacuum = require('../vacuum.js') - -// CONSTANTS -var TEMP_OPTIONS = { - unsafeCleanup: true, - mode: '0700' -} -var SHORT_PATH = path.join('i', 'am', 'a', 'path') -var PARTIAL_PATH = path.join(SHORT_PATH, 'that', 'ends', 'at', 'a') -var FULL_PATH = path.join(PARTIAL_PATH, 'file') - -var messages = [] -function log () { messages.push(Array.prototype.slice.call(arguments).join(' ')) } - -var testBase, partialPath, fullPath -test('xXx setup xXx', function (t) { - mkdtemp(TEMP_OPTIONS, function (er, tmpdir) { - t.ifError(er, 'temp directory exists') - - testBase = path.resolve(tmpdir, SHORT_PATH) - partialPath = path.resolve(tmpdir, PARTIAL_PATH) - fullPath = path.resolve(tmpdir, FULL_PATH) - - mkdirp(partialPath, function (er) { - t.ifError(er, 'made test path') - - writeFile(fullPath, new Buffer('hi'), function (er) { - t.ifError(er, 'made file') - - t.end() - }) - }) - }) -}) - -test('remove up to a point', function (t) { - vacuum(fullPath, {purge: false, base: testBase, log: log}, function (er) { - t.ifError(er, 'cleaned up to base') - - t.equal(messages.length, 6, 'got 5 removal & 1 finish message') - t.equal(messages[5], 'finished vacuuming up to ' + testBase) - - var stat - var verifyPath = fullPath - - function verify () { stat = statSync(verifyPath) } - - // handle the file separately - t.throws(verify, verifyPath + ' cannot be statted') - t.notOk(stat && stat.isFile(), verifyPath + ' is totally gone') - verifyPath = path.dirname(verifyPath) - - for (var i = 0; i < 4; i++) { - t.throws(verify, verifyPath + ' cannot be statted') - t.notOk(stat && stat.isDirectory(), verifyPath + ' is totally gone') - verifyPath = path.dirname(verifyPath) - } - - t.doesNotThrow(function () { - stat = statSync(testBase) - }, testBase + ' can be statted') - t.ok(stat && stat.isDirectory(), testBase + ' is still a directory') - - var files = readdirSync(testBase) - t.equal(files.length, 0, 'nothing left in base directory') - - t.end() - }) -}) diff --git a/deps/npm/node_modules/fs-vacuum/test/no-entries-link-no-purge.js b/deps/npm/node_modules/fs-vacuum/test/no-entries-link-no-purge.js deleted file mode 100644 index 833d970d60524d..00000000000000 --- a/deps/npm/node_modules/fs-vacuum/test/no-entries-link-no-purge.js +++ /dev/null @@ -1,78 +0,0 @@ -var path = require('path') - -var test = require('tap').test -var statSync = require('graceful-fs').statSync -var symlinkSync = require('graceful-fs').symlinkSync -var readdirSync = require('graceful-fs').readdirSync -var mkdtemp = require('tmp').dir -var mkdirp = require('mkdirp') - -var vacuum = require('../vacuum.js') - -// CONSTANTS -var TEMP_OPTIONS = { - unsafeCleanup: true, - mode: '0700' -} -var SHORT_PATH = path.join('i', 'am', 'a', 'path') -var TARGET_PATH = path.join('target-link', 'in', 'the', 'middle') -var PARTIAL_PATH = path.join(SHORT_PATH, 'with', 'a') -var FULL_PATH = path.join(PARTIAL_PATH, 'link') -var EXPANDO_PATH = path.join(SHORT_PATH, 'with', 'a', 'link', 'in', 'the', 'middle') - -var messages = [] -function log () { messages.push(Array.prototype.slice.call(arguments).join(' ')) } - -var testBase, targetPath, partialPath, fullPath, expandoPath -test('xXx setup xXx', function (t) { - mkdtemp(TEMP_OPTIONS, function (er, tmpdir) { - t.ifError(er, 'temp directory exists') - - testBase = path.resolve(tmpdir, SHORT_PATH) - targetPath = path.resolve(tmpdir, TARGET_PATH) - partialPath = path.resolve(tmpdir, PARTIAL_PATH) - fullPath = path.resolve(tmpdir, FULL_PATH) - expandoPath = path.resolve(tmpdir, EXPANDO_PATH) - - mkdirp(partialPath, function (er) { - t.ifError(er, 'made test path') - - mkdirp(targetPath, function (er) { - t.ifError(er, 'made target path') - - symlinkSync(path.join(tmpdir, 'target-link'), fullPath) - - t.end() - }) - }) - }) -}) - -test('remove up to a point', function (t) { - vacuum(expandoPath, {purge: false, base: testBase, log: log}, function (er) { - t.ifError(er, 'cleaned up to base') - - t.equal(messages.length, 7, 'got 6 removal & 1 finish message') - t.equal(messages[6], 'finished vacuuming up to ' + testBase) - - var stat - var verifyPath = expandoPath - function verify () { stat = statSync(verifyPath) } - - for (var i = 0; i < 6; i++) { - t.throws(verify, verifyPath + ' cannot be statted') - t.notOk(stat && stat.isDirectory(), verifyPath + ' is totally gone') - verifyPath = path.dirname(verifyPath) - } - - t.doesNotThrow(function () { - stat = statSync(testBase) - }, testBase + ' can be statted') - t.ok(stat && stat.isDirectory(), testBase + ' is still a directory') - - var files = readdirSync(testBase) - t.equal(files.length, 0, 'nothing left in base directory') - - t.end() - }) -}) diff --git a/deps/npm/node_modules/fs-vacuum/test/no-entries-no-purge.js b/deps/npm/node_modules/fs-vacuum/test/no-entries-no-purge.js deleted file mode 100644 index 03c17923c356e2..00000000000000 --- a/deps/npm/node_modules/fs-vacuum/test/no-entries-no-purge.js +++ /dev/null @@ -1,61 +0,0 @@ -var path = require('path') - -var test = require('tap').test -var statSync = require('graceful-fs').statSync -var mkdtemp = require('tmp').dir -var mkdirp = require('mkdirp') - -var vacuum = require('../vacuum.js') - -// CONSTANTS -var TEMP_OPTIONS = { - unsafeCleanup: true, - mode: '0700' -} -var SHORT_PATH = path.join('i', 'am', 'a', 'path') -var LONG_PATH = path.join(SHORT_PATH, 'of', 'a', 'certain', 'length') - -var messages = [] -function log () { messages.push(Array.prototype.slice.call(arguments).join(' ')) } - -var testPath, testBase -test('xXx setup xXx', function (t) { - mkdtemp(TEMP_OPTIONS, function (er, tmpdir) { - t.ifError(er, 'temp directory exists') - - testBase = path.resolve(tmpdir, SHORT_PATH) - testPath = path.resolve(tmpdir, LONG_PATH) - - mkdirp(testPath, function (er) { - t.ifError(er, 'made test path') - - t.end() - }) - }) -}) - -test('remove up to a point', function (t) { - vacuum(testPath, {purge: false, base: testBase, log: log}, function (er) { - t.ifError(er, 'cleaned up to base') - - t.equal(messages.length, 5, 'got 4 removal & 1 finish message') - t.equal(messages[4], 'finished vacuuming up to ' + testBase) - - var stat - var verifyPath = testPath - function verify () { stat = statSync(verifyPath) } - - for (var i = 0; i < 4; i++) { - t.throws(verify, verifyPath + ' cannot be statted') - t.notOk(stat && stat.isDirectory(), verifyPath + ' is totally gone') - verifyPath = path.dirname(verifyPath) - } - - t.doesNotThrow(function () { - stat = statSync(testBase) - }, testBase + ' can be statted') - t.ok(stat && stat.isDirectory(), testBase + ' is still a directory') - - t.end() - }) -}) diff --git a/deps/npm/node_modules/fs-vacuum/test/no-entries-with-link-purge.js b/deps/npm/node_modules/fs-vacuum/test/no-entries-with-link-purge.js deleted file mode 100644 index 990b69d8a38eff..00000000000000 --- a/deps/npm/node_modules/fs-vacuum/test/no-entries-with-link-purge.js +++ /dev/null @@ -1,78 +0,0 @@ -var path = require('path') - -var test = require('tap').test -var statSync = require('graceful-fs').statSync -var writeFileSync = require('graceful-fs').writeFileSync -var symlinkSync = require('graceful-fs').symlinkSync -var mkdtemp = require('tmp').dir -var mkdirp = require('mkdirp') - -var vacuum = require('../vacuum.js') - -// CONSTANTS -var TEMP_OPTIONS = { - unsafeCleanup: true, - mode: '0700' -} -var SHORT_PATH = path.join('i', 'am', 'a', 'path') -var TARGET_PATH = 'link-target' -var FIRST_FILE = path.join(TARGET_PATH, 'monsieurs') -var SECOND_FILE = path.join(TARGET_PATH, 'mesdames') -var PARTIAL_PATH = path.join(SHORT_PATH, 'with', 'a', 'definite') -var FULL_PATH = path.join(PARTIAL_PATH, 'target') - -var messages = [] -function log () { messages.push(Array.prototype.slice.call(arguments).join(' ')) } - -var testBase, partialPath, fullPath, targetPath -test('xXx setup xXx', function (t) { - mkdtemp(TEMP_OPTIONS, function (er, tmpdir) { - t.ifError(er, 'temp directory exists') - - testBase = path.resolve(tmpdir, SHORT_PATH) - targetPath = path.resolve(tmpdir, TARGET_PATH) - partialPath = path.resolve(tmpdir, PARTIAL_PATH) - fullPath = path.resolve(tmpdir, FULL_PATH) - - mkdirp(partialPath, function (er) { - t.ifError(er, 'made test path') - - mkdirp(targetPath, function (er) { - t.ifError(er, 'made target path') - - writeFileSync(path.resolve(tmpdir, FIRST_FILE), new Buffer("c'est vraiment joli")) - writeFileSync(path.resolve(tmpdir, SECOND_FILE), new Buffer('oui oui')) - symlinkSync(targetPath, fullPath) - - t.end() - }) - }) - }) -}) - -test('remove up to a point', function (t) { - vacuum(fullPath, {purge: true, base: testBase, log: log}, function (er) { - t.ifError(er, 'cleaned up to base') - - t.equal(messages.length, 5, 'got 4 removal & 1 finish message') - t.equal(messages[0], 'purging ' + fullPath) - t.equal(messages[4], 'finished vacuuming up to ' + testBase) - - var stat - var verifyPath = fullPath - function verify () { stat = statSync(verifyPath) } - - for (var i = 0; i < 4; i++) { - t.throws(verify, verifyPath + ' cannot be statted') - t.notOk(stat && stat.isDirectory(), verifyPath + ' is totally gone') - verifyPath = path.dirname(verifyPath) - } - - t.doesNotThrow(function () { - stat = statSync(testBase) - }, testBase + ' can be statted') - t.ok(stat && stat.isDirectory(), testBase + ' is still a directory') - - t.end() - }) -}) diff --git a/deps/npm/node_modules/fs-vacuum/test/no-entries-with-purge.js b/deps/npm/node_modules/fs-vacuum/test/no-entries-with-purge.js deleted file mode 100644 index d3ab0c2b6c570e..00000000000000 --- a/deps/npm/node_modules/fs-vacuum/test/no-entries-with-purge.js +++ /dev/null @@ -1,67 +0,0 @@ -var path = require('path') - -var test = require('tap').test -var statSync = require('graceful-fs').statSync -var writeFileSync = require('graceful-fs').writeFileSync -var mkdtemp = require('tmp').dir -var mkdirp = require('mkdirp') - -var vacuum = require('../vacuum.js') - -// CONSTANTS -var TEMP_OPTIONS = { - unsafeCleanup: true, - mode: '0700' -} -var SHORT_PATH = path.join('i', 'am', 'a', 'path') -var LONG_PATH = path.join(SHORT_PATH, 'of', 'a', 'certain', 'kind') -var FIRST_FILE = path.join(LONG_PATH, 'monsieurs') -var SECOND_FILE = path.join(LONG_PATH, 'mesdames') - -var messages = [] -function log () { messages.push(Array.prototype.slice.call(arguments).join(' ')) } - -var testPath, testBase -test('xXx setup xXx', function (t) { - mkdtemp(TEMP_OPTIONS, function (er, tmpdir) { - t.ifError(er, 'temp directory exists') - - testBase = path.resolve(tmpdir, SHORT_PATH) - testPath = path.resolve(tmpdir, LONG_PATH) - - mkdirp(testPath, function (er) { - t.ifError(er, 'made test path') - - writeFileSync(path.resolve(tmpdir, FIRST_FILE), new Buffer("c'est vraiment joli")) - writeFileSync(path.resolve(tmpdir, SECOND_FILE), new Buffer('oui oui')) - t.end() - }) - }) -}) - -test('remove up to a point', function (t) { - vacuum(testPath, {purge: true, base: testBase, log: log}, function (er) { - t.ifError(er, 'cleaned up to base') - - t.equal(messages.length, 5, 'got 4 removal & 1 finish message') - t.equal(messages[0], 'purging ' + testPath) - t.equal(messages[4], 'finished vacuuming up to ' + testBase) - - var stat - var verifyPath = testPath - function verify () { stat = statSync(verifyPath) } - - for (var i = 0; i < 4; i++) { - t.throws(verify, verifyPath + ' cannot be statted') - t.notOk(stat && stat.isDirectory(), verifyPath + ' is totally gone') - verifyPath = path.dirname(verifyPath) - } - - t.doesNotThrow(function () { - stat = statSync(testBase) - }, testBase + ' can be statted') - t.ok(stat && stat.isDirectory(), testBase + ' is still a directory') - - t.end() - }) -}) diff --git a/deps/npm/node_modules/fs-vacuum/test/not-remove-home-directory.js b/deps/npm/node_modules/fs-vacuum/test/not-remove-home-directory.js deleted file mode 100644 index 8cab009455ce3e..00000000000000 --- a/deps/npm/node_modules/fs-vacuum/test/not-remove-home-directory.js +++ /dev/null @@ -1,46 +0,0 @@ -var path = require('path') - -var test = require('tap').test -var mkdtemp = require('tmp').dir -var mkdirp = require('mkdirp') - -var vacuum = require('../vacuum.js') - -// CONSTANTS -var TEMP_OPTIONS = { - unsafeCleanup: true, - mode: '0700' -} - -var BASE_PATH = path.join('foo') -var HOME_PATH = path.join(BASE_PATH, 'foo', 'bar') - -var messages = [] -function log () { messages.push(Array.prototype.slice.call(arguments).join(' ')) } - -var homePath, basePath, realHome -test('xXx setup xXx', function (t) { - mkdtemp(TEMP_OPTIONS, function (er, tmpdir) { - t.ifError(er, 'temp directory exists') - - homePath = path.resolve(tmpdir, HOME_PATH) - basePath = path.resolve(tmpdir, BASE_PATH) - - realHome = process.env.HOME - process.env.HOME = homePath - - mkdirp(homePath, function (er) { - t.ifError(er, 'made test path') - t.end() - }) - }) -}) - -test('do not remove home directory', function (t) { - vacuum(homePath, {purge: false, base: basePath, log: log}, function (er) { - t.ifError(er, 'cleaned up to base') - t.equal(messages[0], 'quitting because cannot remove home directory ' + homePath) - process.env.HOME = realHome - t.end() - }) -}) diff --git a/deps/npm/node_modules/fs-vacuum/test/other-directories-no-purge.js b/deps/npm/node_modules/fs-vacuum/test/other-directories-no-purge.js deleted file mode 100644 index b18f7eb27d228b..00000000000000 --- a/deps/npm/node_modules/fs-vacuum/test/other-directories-no-purge.js +++ /dev/null @@ -1,76 +0,0 @@ -var path = require('path') - -var test = require('tap').test -var statSync = require('graceful-fs').statSync -var mkdtemp = require('tmp').dir -var mkdirp = require('mkdirp') - -var vacuum = require('../vacuum.js') - -// CONSTANTS -var TEMP_OPTIONS = { - unsafeCleanup: true, - mode: '0700' -} -var SHORT_PATH = path.join('i', 'am', 'a', 'path') -var REMOVE_PATH = path.join(SHORT_PATH, 'of', 'a', 'certain', 'length') -var OTHER_PATH = path.join(SHORT_PATH, 'of', 'no', 'qualities') - -var messages = [] -function log () { messages.push(Array.prototype.slice.call(arguments).join(' ')) } - -var testBase, testPath, otherPath -test('xXx setup xXx', function (t) { - mkdtemp(TEMP_OPTIONS, function (er, tmpdir) { - t.ifError(er, 'temp directory exists') - - testBase = path.resolve(tmpdir, SHORT_PATH) - testPath = path.resolve(tmpdir, REMOVE_PATH) - otherPath = path.resolve(tmpdir, OTHER_PATH) - - mkdirp(testPath, function (er) { - t.ifError(er, 'made test path') - - mkdirp(otherPath, function (er) { - t.ifError(er, 'made other path') - - t.end() - }) - }) - }) -}) - -test('remove up to a point', function (t) { - vacuum(testPath, {purge: false, base: testBase, log: log}, function (er) { - t.ifError(er, 'cleaned up to base') - - t.equal(messages.length, 4, 'got 3 removal & 1 finish message') - t.equal( - messages[3], 'quitting because other entries in ' + testBase + '/of', - 'got expected final message' - ) - - var stat - var verifyPath = testPath - function verify () { stat = statSync(verifyPath) } - - for (var i = 0; i < 3; i++) { - t.throws(verify, verifyPath + ' cannot be statted') - t.notOk(stat && stat.isDirectory(), verifyPath + ' is totally gone') - verifyPath = path.dirname(verifyPath) - } - - t.doesNotThrow(function () { - stat = statSync(otherPath) - }, otherPath + ' can be statted') - t.ok(stat && stat.isDirectory(), otherPath + ' is still a directory') - - var intersection = path.join(testBase, 'of') - t.doesNotThrow(function () { - stat = statSync(intersection) - }, intersection + ' can be statted') - t.ok(stat && stat.isDirectory(), intersection + ' is still a directory') - - t.end() - }) -}) diff --git a/deps/npm/node_modules/fs-vacuum/test/racy-entries-eexist.js b/deps/npm/node_modules/fs-vacuum/test/racy-entries-eexist.js deleted file mode 100644 index d467e996df79ab..00000000000000 --- a/deps/npm/node_modules/fs-vacuum/test/racy-entries-eexist.js +++ /dev/null @@ -1,119 +0,0 @@ -var path = require('path') - -var test = require('tap').test - -var readdir = require('graceful-fs').readdir -var readdirSync = require('graceful-fs').readdirSync -var rmdir = require('graceful-fs').rmdir -var statSync = require('graceful-fs').statSync -var writeFile = require('graceful-fs').writeFile -var mkdirp = require('mkdirp') -var mkdtemp = require('tmp').dir -var tmpFile = require('tmp').file -var EEXIST = require('errno').code.EEXIST -var ENOTEMPTY = require('errno').code.ENOTEMPTY - -var requireInject = require('require-inject') -var vacuum = requireInject('../vacuum.js', { - 'graceful-fs': { - 'lstat': require('graceful-fs').lstat, - 'readdir': function (dir, cb) { - readdir(dir, function (err, files) { - // Simulate racy removal by creating a file after vacuum - // thinks the directory is empty - if (dir === partialPath && files.length === 0) { - tmpFile({dir: dir}, function (err, path, fd) { - if (err) throw err - cb(err, files) - }) - } else { - cb(err, files) - } - }) - }, - 'rmdir': function (dir, cb) { - rmdir(dir, function (err) { - // Force EEXIST error from rmdir if the directory is non-empty - var mockErr = EEXIST - if (err) { - if (err.code === ENOTEMPTY.code) { - err.code = err.errno = mockErr.code - err.message = mockErr.code + ': ' + mockErr.description + ', ' + err.syscall + ' \'' + dir + '\'' - } - } - cb(err) - }) - }, - 'unlink': require('graceful-fs').unlink - } -}) - -// CONSTANTS -var TEMP_OPTIONS = { - unsafeCleanup: true, - mode: '0700' -} -var SHORT_PATH = path.join('i', 'am', 'a', 'path') -var PARTIAL_PATH = path.join(SHORT_PATH, 'that', 'ends', 'at', 'a') -var FULL_PATH = path.join(PARTIAL_PATH, 'file') - -var messages = [] -function log () { messages.push(Array.prototype.slice.call(arguments).join(' ')) } - -var testBase, partialPath, fullPath -test('xXx setup xXx', function (t) { - mkdtemp(TEMP_OPTIONS, function (er, tmpdir) { - t.ifError(er, 'temp directory exists') - - testBase = path.resolve(tmpdir, SHORT_PATH) - partialPath = path.resolve(tmpdir, PARTIAL_PATH) - fullPath = path.resolve(tmpdir, FULL_PATH) - - mkdirp(partialPath, function (er) { - t.ifError(er, 'made test path') - - writeFile(fullPath, new Buffer('hi'), function (er) { - t.ifError(er, 'made file') - - t.end() - }) - }) - }) -}) - -test('racy removal should quit gracefully', function (t) { - vacuum(fullPath, {purge: false, base: testBase, log: log}, function (er) { - t.ifError(er, 'cleaned up to base') - - t.equal(messages.length, 3, 'got 2 removal & 1 quit message') - t.equal(messages[2], 'quitting because new (racy) entries in ' + partialPath) - - var stat - var verifyPath = fullPath - - function verify () { stat = statSync(verifyPath) } - - // handle the file separately - t.throws(verify, verifyPath + ' cannot be statted') - t.notOk(stat && stat.isFile(), verifyPath + ' is totally gone') - verifyPath = path.dirname(verifyPath) - - for (var i = 0; i < 4; i++) { - t.doesNotThrow(function () { - stat = statSync(verifyPath) - }, verifyPath + ' can be statted') - t.ok(stat && stat.isDirectory(), verifyPath + ' is still a directory') - verifyPath = path.dirname(verifyPath) - } - - t.doesNotThrow(function () { - stat = statSync(testBase) - }, testBase + ' can be statted') - t.ok(stat && stat.isDirectory(), testBase + ' is still a directory') - - var files = readdirSync(testBase) - t.equal(files.length, 1, 'base directory untouched') - - t.end() - }) -}) diff --git a/deps/npm/node_modules/fs-vacuum/test/racy-entries-enotempty.js b/deps/npm/node_modules/fs-vacuum/test/racy-entries-enotempty.js deleted file mode 100644 index decc3807dcdb3e..00000000000000 --- a/deps/npm/node_modules/fs-vacuum/test/racy-entries-enotempty.js +++ /dev/null @@ -1,119 +0,0 @@ -var path = require('path') - -var test = require('tap').test - -var readdir = require('graceful-fs').readdir -var readdirSync = require('graceful-fs').readdirSync -var rmdir = require('graceful-fs').rmdir -var statSync = require('graceful-fs').statSync -var writeFile = require('graceful-fs').writeFile -var mkdirp = require('mkdirp') -var mkdtemp = require('tmp').dir -var tmpFile = require('tmp').file -var EEXIST = require('errno').code.EEXIST -var ENOTEMPTY = require('errno').code.ENOTEMPTY - -var requireInject = require('require-inject') -var vacuum = requireInject('../vacuum.js', { - 'graceful-fs': { - 'lstat': require('graceful-fs').lstat, - 'readdir': function (dir, cb) { - readdir(dir, function (err, files) { - // Simulate racy removal by creating a file after vacuum - // thinks the directory is empty - if (dir === partialPath && files.length === 0) { - tmpFile({dir: dir}, function (err, path, fd) { - if (err) throw err - cb(err, files) - }) - } else { - cb(err, files) - } - }) - }, - 'rmdir': function (dir, cb) { - rmdir(dir, function (err) { - // Force ENOTEMPTY error from rmdir if the directory is non-empty - var mockErr = ENOTEMPTY - if (err) { - if (err.code === EEXIST.code) { - err.code = err.errno = mockErr.code - err.message = mockErr.code + ': ' + mockErr.description + ', ' + err.syscall + ' \'' + dir + '\'' - } - } - cb(err) - }) - }, - 'unlink': require('graceful-fs').unlink - } -}) - -// CONSTANTS -var TEMP_OPTIONS = { - unsafeCleanup: true, - mode: '0700' -} -var SHORT_PATH = path.join('i', 'am', 'a', 'path') -var PARTIAL_PATH = path.join(SHORT_PATH, 'that', 'ends', 'at', 'a') -var FULL_PATH = path.join(PARTIAL_PATH, 'file') - -var messages = [] -function log () { messages.push(Array.prototype.slice.call(arguments).join(' ')) } - -var testBase, partialPath, fullPath -test('xXx setup xXx', function (t) { - mkdtemp(TEMP_OPTIONS, function (er, tmpdir) { - t.ifError(er, 'temp directory exists') - - testBase = path.resolve(tmpdir, SHORT_PATH) - partialPath = path.resolve(tmpdir, PARTIAL_PATH) - fullPath = path.resolve(tmpdir, FULL_PATH) - - mkdirp(partialPath, function (er) { - t.ifError(er, 'made test path') - - writeFile(fullPath, new Buffer('hi'), function (er) { - t.ifError(er, 'made file') - - t.end() - }) - }) - }) -}) - -test('racy removal should quit gracefully', function (t) { - vacuum(fullPath, {purge: false, base: testBase, log: log}, function (er) { - t.ifError(er, 'cleaned up to base') - - t.equal(messages.length, 3, 'got 2 removal & 1 quit message') - t.equal(messages[2], 'quitting because new (racy) entries in ' + partialPath) - - var stat - var verifyPath = fullPath - - function verify () { stat = statSync(verifyPath) } - - // handle the file separately - t.throws(verify, verifyPath + ' cannot be statted') - t.notOk(stat && stat.isFile(), verifyPath + ' is totally gone') - verifyPath = path.dirname(verifyPath) - - for (var i = 0; i < 4; i++) { - t.doesNotThrow(function () { - stat = statSync(verifyPath) - }, verifyPath + ' can be statted') - t.ok(stat && stat.isDirectory(), verifyPath + ' is still a directory') - verifyPath = path.dirname(verifyPath) - } - - t.doesNotThrow(function () { - stat = statSync(testBase) - }, testBase + ' can be statted') - t.ok(stat && stat.isDirectory(), testBase + ' is still a directory') - - var files = readdirSync(testBase) - t.equal(files.length, 1, 'base directory untouched') - - t.end() - }) -}) diff --git a/deps/npm/node_modules/fs-vacuum/test/racy-entries.js b/deps/npm/node_modules/fs-vacuum/test/racy-entries.js deleted file mode 100644 index c0ed53243de07a..00000000000000 --- a/deps/npm/node_modules/fs-vacuum/test/racy-entries.js +++ /dev/null @@ -1,104 +0,0 @@ -var path = require('path') - -var test = require('tap').test - -var readdir = require('graceful-fs').readdir -var readdirSync = require('graceful-fs').readdirSync -var statSync = require('graceful-fs').statSync -var writeFile = require('graceful-fs').writeFile -var mkdirp = require('mkdirp') -var mkdtemp = require('tmp').dir -var tmpFile = require('tmp').file - -var requireInject = require('require-inject') -var vacuum = requireInject('../vacuum.js', { - 'graceful-fs': { - 'lstat': require('graceful-fs').lstat, - 'readdir': function (dir, cb) { - readdir(dir, function (err, files) { - // Simulate racy removal by creating a file after vacuum - // thinks the directory is empty - if (dir === partialPath && files.length === 0) { - tmpFile({dir: dir}, function (err, path, fd) { - if (err) throw err - cb(err, files) - }) - } else { - cb(err, files) - } - }) - }, - 'rmdir': require('graceful-fs').rmdir, - 'unlink': require('graceful-fs').unlink - } -}) - -// CONSTANTS -var TEMP_OPTIONS = { - unsafeCleanup: true, - mode: '0700' -} -var SHORT_PATH = path.join('i', 'am', 'a', 'path') -var PARTIAL_PATH = path.join(SHORT_PATH, 'that', 'ends', 'at', 'a') -var FULL_PATH = path.join(PARTIAL_PATH, 'file') - -var messages = [] -function log () { messages.push(Array.prototype.slice.call(arguments).join(' ')) } - -var testBase, partialPath, fullPath -test('xXx setup xXx', function (t) { - mkdtemp(TEMP_OPTIONS, function (er, tmpdir) { - t.ifError(er, 'temp directory exists') - - testBase = path.resolve(tmpdir, SHORT_PATH) - partialPath = path.resolve(tmpdir, PARTIAL_PATH) - fullPath = path.resolve(tmpdir, FULL_PATH) - - mkdirp(partialPath, function (er) { - t.ifError(er, 'made test path') - - writeFile(fullPath, new Buffer('hi'), function (er) { - t.ifError(er, 'made file') - - t.end() - }) - }) - }) -}) - -test('racy removal should quit gracefully', function (t) { - vacuum(fullPath, {purge: false, base: testBase, log: log}, function (er) { - t.ifError(er, 'cleaned up to base') - - t.equal(messages.length, 3, 'got 2 removal & 1 quit message') - t.equal(messages[2], 'quitting because new (racy) entries in ' + partialPath) - - var stat - var verifyPath = fullPath - - function verify () { stat = statSync(verifyPath) } - - // handle the file separately - t.throws(verify, verifyPath + ' cannot be statted') - t.notOk(stat && stat.isFile(), verifyPath + ' is totally gone') - verifyPath = path.dirname(verifyPath) - - for (var i = 0; i < 4; i++) { - t.doesNotThrow(function () { - stat = statSync(verifyPath) - }, verifyPath + ' can be statted') - t.ok(stat && stat.isDirectory(), verifyPath + ' is still a directory') - verifyPath = path.dirname(verifyPath) - } - - t.doesNotThrow(function () { - stat = statSync(testBase) - }, testBase + ' can be statted') - t.ok(stat && stat.isDirectory(), testBase + ' is still a directory') - - var files = readdirSync(testBase) - t.equal(files.length, 1, 'base directory untouched') - - t.end() - }) -}) diff --git a/deps/npm/node_modules/fs-vacuum/vacuum.js b/deps/npm/node_modules/fs-vacuum/vacuum.js deleted file mode 100644 index 050f8701864d8a..00000000000000 --- a/deps/npm/node_modules/fs-vacuum/vacuum.js +++ /dev/null @@ -1,117 +0,0 @@ -var assert = require('assert') -var dirname = require('path').dirname -var resolve = require('path').resolve -var isInside = require('path-is-inside') - -var rimraf = require('rimraf') -var lstat = require('graceful-fs').lstat -var readdir = require('graceful-fs').readdir -var rmdir = require('graceful-fs').rmdir -var unlink = require('graceful-fs').unlink - -module.exports = vacuum - -function vacuum (leaf, options, cb) { - assert(typeof leaf === 'string', 'must pass in path to remove') - assert(typeof cb === 'function', 'must pass in callback') - - if (!options) options = {} - assert(typeof options === 'object', 'options must be an object') - - var log = options.log ? options.log : function () {} - - leaf = leaf && resolve(leaf) - var base = options.base && resolve(options.base) - if (base && !isInside(leaf, base)) { - return cb(new Error(leaf + ' is not a child of ' + base)) - } - - lstat(leaf, function (error, stat) { - if (error) { - if (error.code === 'ENOENT') return cb(null) - - log(error.stack) - return cb(error) - } - - if (!(stat && (stat.isDirectory() || stat.isSymbolicLink() || stat.isFile()))) { - log(leaf, 'is not a directory, file, or link') - return cb(new Error(leaf + ' is not a directory, file, or link')) - } - - if (options.purge) { - log('purging', leaf) - rimraf(leaf, function (error) { - if (error) return cb(error) - - next(dirname(leaf)) - }) - } else if (!stat.isDirectory()) { - log('removing', leaf) - unlink(leaf, function (error) { - if (error) return cb(error) - - next(dirname(leaf)) - }) - } else { - next(leaf) - } - }) - - function next (branch) { - branch = branch && resolve(branch) - // either we've reached the base or we've reached the root - if ((base && branch === base) || branch === dirname(branch)) { - log('finished vacuuming up to', branch) - return cb(null) - } - - readdir(branch, function (error, files) { - if (error) { - if (error.code === 'ENOENT') return cb(null) - - log('unable to check directory', branch, 'due to', error.message) - return cb(error) - } - - if (files.length > 0) { - log('quitting because other entries in', branch) - return cb(null) - } - - if (branch === process.env.HOME) { - log('quitting because cannot remove home directory', branch) - return cb(null) - } - - log('removing', branch) - lstat(branch, function (error, stat) { - if (error) { - if (error.code === 'ENOENT') return cb(null) - - log('unable to lstat', branch, 'due to', error.message) - return cb(error) - } - - var remove = stat.isDirectory() ? rmdir : unlink - remove(branch, function (error) { - if (error) { - if (error.code === 'ENOENT') { - log('quitting because lost the race to remove', branch) - return cb(null) - } - if (error.code === 'ENOTEMPTY' || error.code === 'EEXIST') { - log('quitting because new (racy) entries in', branch) - return cb(null) - } - - log('unable to remove', branch, 'due to', error.message) - return cb(error) - } - - next(dirname(branch)) - }) - }) - }) - } -} diff --git a/deps/npm/node_modules/fs-write-stream-atomic/.npmignore b/deps/npm/node_modules/fs-write-stream-atomic/.npmignore deleted file mode 100644 index 2f24c57c382e41..00000000000000 --- a/deps/npm/node_modules/fs-write-stream-atomic/.npmignore +++ /dev/null @@ -1,3 +0,0 @@ -node_modules/ -coverage/ -.nyc_output/ diff --git a/deps/npm/node_modules/fs-write-stream-atomic/.travis.yml b/deps/npm/node_modules/fs-write-stream-atomic/.travis.yml deleted file mode 100644 index 68946625271c27..00000000000000 --- a/deps/npm/node_modules/fs-write-stream-atomic/.travis.yml +++ /dev/null @@ -1,11 +0,0 @@ -language: node_js -sudo: false -before_install: - - "npm -g install npm" -node_js: - - "0.8" - - "0.10" - - "0.12" - - "iojs" - - "4" - - "5" diff --git a/deps/npm/node_modules/fs-write-stream-atomic/README.md b/deps/npm/node_modules/fs-write-stream-atomic/README.md deleted file mode 100644 index 9a15d056764ba7..00000000000000 --- a/deps/npm/node_modules/fs-write-stream-atomic/README.md +++ /dev/null @@ -1,35 +0,0 @@ -# fs-write-stream-atomic - -Like `fs.createWriteStream(...)`, but atomic. - -Writes to a tmp file and does an atomic `fs.rename` to move it into -place when it's done. - -First rule of debugging: **It's always a race condition.** - -## USAGE - -```javascript -var fsWriteStreamAtomic = require('fs-write-stream-atomic') -// options are optional. -var write = fsWriteStreamAtomic('output.txt', options) -var read = fs.createReadStream('input.txt') -read.pipe(write) - -// When the write stream emits a 'finish' or 'close' event, -// you can be sure that it is moved into place, and contains -// all the bytes that were written to it, even if something else -// was writing to `output.txt` at the same time. -``` - -### `fsWriteStreamAtomic(filename, [options])` - -* `filename` {String} The file we want to write to -* `options` {Object} - * `chown` {Object} User and group to set ownership after write - * `uid` {Number} - * `gid` {Number} - * `encoding` {String} default = 'utf8' - * `mode` {Number} default = `0666` - * `flags` {String} default = `'w'` - diff --git a/deps/npm/node_modules/fs-write-stream-atomic/index.js b/deps/npm/node_modules/fs-write-stream-atomic/index.js deleted file mode 100644 index 1690ff5ae7af8b..00000000000000 --- a/deps/npm/node_modules/fs-write-stream-atomic/index.js +++ /dev/null @@ -1,176 +0,0 @@ -var fs = require('graceful-fs') -var Writable = require('readable-stream').Writable -var util = require('util') -var MurmurHash3 = require('imurmurhash') -var iferr = require('iferr') -var crypto = require('crypto') - -function murmurhex () { - var hash = MurmurHash3('') - for (var ii = 0; ii < arguments.length; ++ii) { - hash.hash('' + arguments[ii]) - } - return hash.result() -} - -var invocations = 0 -function getTmpname (filename) { - return filename + '.' + murmurhex(__filename, process.pid, ++invocations) -} - -var setImmediate = global.setImmediate || setTimeout - -module.exports = WriteStreamAtomic - -// Requirements: -// 1. Write everything written to the stream to a temp file. -// 2. If there are no errors: -// a. moves the temp file into its final destination -// b. emits `finish` & `closed` ONLY after the file is -// fully flushed and renamed. -// 3. If there's an error, removes the temp file. - -util.inherits(WriteStreamAtomic, Writable) -function WriteStreamAtomic (path, options) { - if (!(this instanceof WriteStreamAtomic)) { - return new WriteStreamAtomic(path, options) - } - Writable.call(this, options) - - this.__isWin = options && options.hasOwnProperty('isWin') ? options.isWin : process.platform === 'win32' - - this.__atomicTarget = path - this.__atomicTmp = getTmpname(path) - - this.__atomicChown = options && options.chown - - this.__atomicClosed = false - - this.__atomicStream = fs.WriteStream(this.__atomicTmp, options) - - this.__atomicStream.once('open', handleOpen(this)) - this.__atomicStream.once('close', handleClose(this)) - this.__atomicStream.once('error', handleError(this)) -} - -// We have to suppress default finish emitting, because ordinarily it -// would happen as soon as `end` is called on us and all of the -// data has been written to our target stream. So we suppress -// finish from being emitted here, and only emit it after our -// target stream is closed and we've moved everything around. -WriteStreamAtomic.prototype.emit = function (event) { - if (event === 'finish') return this.__atomicStream.end() - return Writable.prototype.emit.apply(this, arguments) -} - -WriteStreamAtomic.prototype._write = function (buffer, encoding, cb) { - var flushed = this.__atomicStream.write(buffer, encoding) - if (flushed) return cb() - this.__atomicStream.once('drain', cb) -} - -function handleOpen (writeStream) { - return function (fd) { - writeStream.emit('open', fd) - } -} - -function handleClose (writeStream) { - return function () { - if (writeStream.__atomicClosed) return - writeStream.__atomicClosed = true - if (writeStream.__atomicChown) { - var uid = writeStream.__atomicChown.uid - var gid = writeStream.__atomicChown.gid - return fs.chown(writeStream.__atomicTmp, uid, gid, iferr(cleanup, moveIntoPlace)) - } else { - moveIntoPlace() - } - } - - function moveIntoPlace () { - fs.rename(writeStream.__atomicTmp, writeStream.__atomicTarget, iferr(trapWindowsEPERM, end)) - } - - function trapWindowsEPERM (err) { - if (writeStream.__isWin && - err.syscall && err.syscall === 'rename' && - err.code && err.code === 'EPERM' - ) { - checkFileHashes(err) - } else { - cleanup(err) - } - } - - function checkFileHashes (eperm) { - var inprocess = 2 - var tmpFileHash = crypto.createHash('sha512') - var targetFileHash = crypto.createHash('sha512') - - fs.createReadStream(writeStream.__atomicTmp) - .on('data', function (data, enc) { tmpFileHash.update(data, enc) }) - .on('error', fileHashError) - .on('end', fileHashComplete) - fs.createReadStream(writeStream.__atomicTarget) - .on('data', function (data, enc) { targetFileHash.update(data, enc) }) - .on('error', fileHashError) - .on('end', fileHashComplete) - - function fileHashError () { - if (inprocess === 0) return - inprocess = 0 - cleanup(eperm) - } - - function fileHashComplete () { - if (inprocess === 0) return - if (--inprocess) return - if (tmpFileHash.digest('hex') === targetFileHash.digest('hex')) { - return cleanup() - } else { - return cleanup(eperm) - } - } - } - - function cleanup (err) { - fs.unlink(writeStream.__atomicTmp, function () { - if (err) { - writeStream.emit('error', err) - writeStream.emit('close') - } else { - end() - } - }) - } - - function end () { - // We have to use our parent class directly because we suppress `finish` - // events fired via our own emit method. - Writable.prototype.emit.call(writeStream, 'finish') - - // Delay the close to provide the same temporal separation a physical - // file operation would have– that is, the close event is emitted only - // after the async close operation completes. - setImmediate(function () { - writeStream.emit('close') - }) - } -} - -function handleError (writeStream) { - return function (er) { - cleanupSync() - writeStream.emit('error', er) - writeStream.__atomicClosed = true - writeStream.emit('close') - } - function cleanupSync () { - try { - fs.unlinkSync(writeStream.__atomicTmp) - } finally { - return - } - } -} diff --git a/deps/npm/node_modules/fs-write-stream-atomic/node_modules/iferr/.npmignore b/deps/npm/node_modules/fs-write-stream-atomic/node_modules/iferr/.npmignore deleted file mode 100644 index 3c3629e647f5dd..00000000000000 --- a/deps/npm/node_modules/fs-write-stream-atomic/node_modules/iferr/.npmignore +++ /dev/null @@ -1 +0,0 @@ -node_modules diff --git a/deps/npm/node_modules/fs-write-stream-atomic/node_modules/iferr/LICENSE b/deps/npm/node_modules/fs-write-stream-atomic/node_modules/iferr/LICENSE deleted file mode 100644 index 19d5f4bce547ba..00000000000000 --- a/deps/npm/node_modules/fs-write-stream-atomic/node_modules/iferr/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2014 Nadav Ivgi - -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/deps/npm/node_modules/fs-write-stream-atomic/node_modules/iferr/README.md b/deps/npm/node_modules/fs-write-stream-atomic/node_modules/iferr/README.md deleted file mode 100644 index 0940763fa94137..00000000000000 --- a/deps/npm/node_modules/fs-write-stream-atomic/node_modules/iferr/README.md +++ /dev/null @@ -1,40 +0,0 @@ -# iferr - -Higher-order functions for easier error handling. - -`if (err) return cb(err);` be gone! - -## Install -```bash -npm install iferr -``` - -## Use - -### JavaScript example -```js -var iferr = require('iferr'); - -function get_friends_count(id, cb) { - User.load_user(id, iferr(cb, function(user) { - user.load_friends(iferr(cb, function(friends) { - cb(null, friends.length); - })); - })); -} -``` - -### CoffeeScript example -```coffee -iferr = require 'iferr' - -get_friends_count = (id, cb) -> - User.load_user id, iferr cb, (user) -> - user.load_friends iferr cb, (friends) -> - cb null, friends.length -``` - -(TODO: document tiferr, throwerr and printerr) - -## License -MIT diff --git a/deps/npm/node_modules/fs-write-stream-atomic/node_modules/iferr/index.coffee b/deps/npm/node_modules/fs-write-stream-atomic/node_modules/iferr/index.coffee deleted file mode 100644 index da6d00719f10c4..00000000000000 --- a/deps/npm/node_modules/fs-write-stream-atomic/node_modules/iferr/index.coffee +++ /dev/null @@ -1,24 +0,0 @@ -# Delegates to `succ` on sucecss or to `fail` on error -# ex: Thing.load 123, iferr cb, (thing) -> ... -iferr = (fail, succ) -> (err, a...) -> - if err? then fail err - else succ? a... - -# Like iferr, but also catches errors thrown from `succ` and passes to `fail` -tiferr = (fail, succ) -> iferr fail, (a...) -> - try succ a... - catch err then fail err - -# Delegate to the success function on success, or throw the error otherwise -# ex: Thing.load 123, throwerr (thing) -> ... -throwerr = iferr.bind null, (err) -> throw err - -# Prints errors when one is passed, or does nothing otherwise -# ex: thing.save printerr -printerr = iferr (err) -> console.error err.stack or err - -module.exports = exports = iferr -exports.iferr = iferr -exports.tiferr = tiferr -exports.throwerr = throwerr -exports.printerr = printerr diff --git a/deps/npm/node_modules/fs-write-stream-atomic/node_modules/iferr/index.js b/deps/npm/node_modules/fs-write-stream-atomic/node_modules/iferr/index.js deleted file mode 100644 index 78fce3d2b0965a..00000000000000 --- a/deps/npm/node_modules/fs-write-stream-atomic/node_modules/iferr/index.js +++ /dev/null @@ -1,49 +0,0 @@ -// Generated by CoffeeScript 1.7.1 -(function() { - var exports, iferr, printerr, throwerr, tiferr, - __slice = [].slice; - - iferr = function(fail, succ) { - return function() { - var a, err; - err = arguments[0], a = 2 <= arguments.length ? __slice.call(arguments, 1) : []; - if (err != null) { - return fail(err); - } else { - return typeof succ === "function" ? succ.apply(null, a) : void 0; - } - }; - }; - - tiferr = function(fail, succ) { - return iferr(fail, function() { - var a, err; - a = 1 <= arguments.length ? __slice.call(arguments, 0) : []; - try { - return succ.apply(null, a); - } catch (_error) { - err = _error; - return fail(err); - } - }); - }; - - throwerr = iferr.bind(null, function(err) { - throw err; - }); - - printerr = iferr(function(err) { - return console.error(err.stack || err); - }); - - module.exports = exports = iferr; - - exports.iferr = iferr; - - exports.tiferr = tiferr; - - exports.throwerr = throwerr; - - exports.printerr = printerr; - -}).call(this); diff --git a/deps/npm/node_modules/fs-write-stream-atomic/node_modules/iferr/package.json b/deps/npm/node_modules/fs-write-stream-atomic/node_modules/iferr/package.json deleted file mode 100644 index 5ac59fc8ee7473..00000000000000 --- a/deps/npm/node_modules/fs-write-stream-atomic/node_modules/iferr/package.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "_from": "iferr@^0.1.5", - "_id": "iferr@0.1.5", - "_inBundle": false, - "_integrity": "sha1-xg7taebY/bazEEofy8ocGS3FtQE=", - "_location": "/fs-write-stream-atomic/iferr", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "iferr@^0.1.5", - "name": "iferr", - "escapedName": "iferr", - "rawSpec": "^0.1.5", - "saveSpec": null, - "fetchSpec": "^0.1.5" - }, - "_requiredBy": [ - "/fs-write-stream-atomic" - ], - "_resolved": "https://registry.npmjs.org/iferr/-/iferr-0.1.5.tgz", - "_shasum": "c60eed69e6d8fdb6b3104a1fcbca1c192dc5b501", - "_spec": "iferr@^0.1.5", - "_where": "/Users/rebecca/code/npm/node_modules/fs-write-stream-atomic", - "author": { - "name": "Nadav Ivgi" - }, - "bugs": { - "url": "https://github.com/shesek/iferr/issues" - }, - "bundleDependencies": false, - "deprecated": false, - "description": "Higher-order functions for easier error handling", - "devDependencies": { - "coffee-script": "^1.7.1", - "mocha": "^1.18.2" - }, - "homepage": "https://github.com/shesek/iferr", - "keywords": [ - "error", - "errors" - ], - "license": "MIT", - "main": "index.js", - "name": "iferr", - "repository": { - "type": "git", - "url": "git+https://github.com/shesek/iferr.git" - }, - "scripts": { - "prepublish": "coffee -c index.coffee", - "test": "mocha" - }, - "version": "0.1.5" -} diff --git a/deps/npm/node_modules/fs-write-stream-atomic/node_modules/iferr/test/index.coffee b/deps/npm/node_modules/fs-write-stream-atomic/node_modules/iferr/test/index.coffee deleted file mode 100644 index be0bc56fdf1b96..00000000000000 --- a/deps/npm/node_modules/fs-write-stream-atomic/node_modules/iferr/test/index.coffee +++ /dev/null @@ -1,42 +0,0 @@ -{ iferr, tiferr, throwerr } = require '../index.coffee' -{ equal: eq, throws } = require 'assert' - -invoke_fail = (cb) -> cb new Error 'callback error' -invoke_succ = (cb) -> cb null -throw_error = -> throw new Error 'thrown' - -describe 'iferr', -> - it 'calls the error callback on errors', (done) -> - invoke_fail iferr( - (err) -> - eq err.message, 'callback error' - do done - -> - done new Error 'shouldn\'t call the success callback' - ) - - it 'calls the success callback on success', (done) -> - invoke_succ iferr( - -> done new Error 'shouldn\'t call the error callback' - done - ) - -describe 'tiferr', -> - it 'catches errors in the success callback', (done) -> - invoke_succ tiferr( - (err) -> - eq err.message, 'thrown' - do done - throw_error - ) - -describe 'throwerr', -> - it 'throws errors passed to the callback', (done)-> - try invoke_fail throwerr -> - done 'shouldn\'t call the success callback' - catch err - eq err.message, 'callback error' - do done - - it 'delegates to the success callback otherwise', (done) -> - invoke_succ throwerr done diff --git a/deps/npm/node_modules/fs-write-stream-atomic/node_modules/iferr/test/mocha.opts b/deps/npm/node_modules/fs-write-stream-atomic/node_modules/iferr/test/mocha.opts deleted file mode 100644 index 019defcf152a84..00000000000000 --- a/deps/npm/node_modules/fs-write-stream-atomic/node_modules/iferr/test/mocha.opts +++ /dev/null @@ -1,2 +0,0 @@ ---compilers coffee:coffee-script/register ---reporter spec diff --git a/deps/npm/node_modules/fs-write-stream-atomic/node_modules/readable-stream/.travis.yml b/deps/npm/node_modules/fs-write-stream-atomic/node_modules/readable-stream/.travis.yml deleted file mode 100644 index 40992555bf5cc0..00000000000000 --- a/deps/npm/node_modules/fs-write-stream-atomic/node_modules/readable-stream/.travis.yml +++ /dev/null @@ -1,55 +0,0 @@ -sudo: false -language: node_js -before_install: - - npm install -g npm@2 - - test $NPM_LEGACY && npm install -g npm@latest-3 || npm install npm -g -notifications: - email: false -matrix: - fast_finish: true - include: - - node_js: '0.8' - env: - - TASK=test - - NPM_LEGACY=true - - node_js: '0.10' - env: - - TASK=test - - NPM_LEGACY=true - - node_js: '0.11' - env: - - TASK=test - - NPM_LEGACY=true - - node_js: '0.12' - env: - - TASK=test - - NPM_LEGACY=true - - node_js: 1 - env: - - TASK=test - - NPM_LEGACY=true - - node_js: 2 - env: - - TASK=test - - NPM_LEGACY=true - - node_js: 3 - env: - - TASK=test - - NPM_LEGACY=true - - node_js: 4 - env: TASK=test - - node_js: 5 - env: TASK=test - - node_js: 6 - env: TASK=test - - node_js: 7 - env: TASK=test - - node_js: 8 - env: TASK=test - - node_js: 9 - env: TASK=test -script: "npm run $TASK" -env: - global: - - secure: rE2Vvo7vnjabYNULNyLFxOyt98BoJexDqsiOnfiD6kLYYsiQGfr/sbZkPMOFm9qfQG7pjqx+zZWZjGSswhTt+626C0t/njXqug7Yps4c3dFblzGfreQHp7wNX5TFsvrxd6dAowVasMp61sJcRnB2w8cUzoe3RAYUDHyiHktwqMc= - - secure: g9YINaKAdMatsJ28G9jCGbSaguXCyxSTy+pBO6Ch0Cf57ZLOTka3HqDj8p3nV28LUIHZ3ut5WO43CeYKwt4AUtLpBS3a0dndHdY6D83uY6b2qh5hXlrcbeQTq2cvw2y95F7hm4D1kwrgZ7ViqaKggRcEupAL69YbJnxeUDKWEdI= diff --git a/deps/npm/node_modules/fs-write-stream-atomic/node_modules/readable-stream/GOVERNANCE.md b/deps/npm/node_modules/fs-write-stream-atomic/node_modules/readable-stream/GOVERNANCE.md deleted file mode 100644 index 16ffb93f24bece..00000000000000 --- a/deps/npm/node_modules/fs-write-stream-atomic/node_modules/readable-stream/GOVERNANCE.md +++ /dev/null @@ -1,136 +0,0 @@ -### Streams Working Group - -The Node.js Streams is jointly governed by a Working Group -(WG) -that is responsible for high-level guidance of the project. - -The WG has final authority over this project including: - -* Technical direction -* Project governance and process (including this policy) -* Contribution policy -* GitHub repository hosting -* Conduct guidelines -* Maintaining the list of additional Collaborators - -For the current list of WG members, see the project -[README.md](./README.md#current-project-team-members). - -### Collaborators - -The readable-stream GitHub repository is -maintained by the WG and additional Collaborators who are added by the -WG on an ongoing basis. - -Individuals making significant and valuable contributions are made -Collaborators and given commit-access to the project. These -individuals are identified by the WG and their addition as -Collaborators is discussed during the WG meeting. - -_Note:_ If you make a significant contribution and are not considered -for commit-access log an issue or contact a WG member directly and it -will be brought up in the next WG meeting. - -Modifications of the contents of the readable-stream repository are -made on -a collaborative basis. Anybody with a GitHub account may propose a -modification via pull request and it will be considered by the project -Collaborators. All pull requests must be reviewed and accepted by a -Collaborator with sufficient expertise who is able to take full -responsibility for the change. In the case of pull requests proposed -by an existing Collaborator, an additional Collaborator is required -for sign-off. Consensus should be sought if additional Collaborators -participate and there is disagreement around a particular -modification. See _Consensus Seeking Process_ below for further detail -on the consensus model used for governance. - -Collaborators may opt to elevate significant or controversial -modifications, or modifications that have not found consensus to the -WG for discussion by assigning the ***WG-agenda*** tag to a pull -request or issue. The WG should serve as the final arbiter where -required. - -For the current list of Collaborators, see the project -[README.md](./README.md#members). - -### WG Membership - -WG seats are not time-limited. There is no fixed size of the WG. -However, the expected target is between 6 and 12, to ensure adequate -coverage of important areas of expertise, balanced with the ability to -make decisions efficiently. - -There is no specific set of requirements or qualifications for WG -membership beyond these rules. - -The WG may add additional members to the WG by unanimous consensus. - -A WG member may be removed from the WG by voluntary resignation, or by -unanimous consensus of all other WG members. - -Changes to WG membership should be posted in the agenda, and may be -suggested as any other agenda item (see "WG Meetings" below). - -If an addition or removal is proposed during a meeting, and the full -WG is not in attendance to participate, then the addition or removal -is added to the agenda for the subsequent meeting. This is to ensure -that all members are given the opportunity to participate in all -membership decisions. If a WG member is unable to attend a meeting -where a planned membership decision is being made, then their consent -is assumed. - -No more than 1/3 of the WG members may be affiliated with the same -employer. If removal or resignation of a WG member, or a change of -employment by a WG member, creates a situation where more than 1/3 of -the WG membership shares an employer, then the situation must be -immediately remedied by the resignation or removal of one or more WG -members affiliated with the over-represented employer(s). - -### WG Meetings - -The WG meets occasionally on a Google Hangout On Air. A designated moderator -approved by the WG runs the meeting. Each meeting should be -published to YouTube. - -Items are added to the WG agenda that are considered contentious or -are modifications of governance, contribution policy, WG membership, -or release process. - -The intention of the agenda is not to approve or review all patches; -that should happen continuously on GitHub and be handled by the larger -group of Collaborators. - -Any community member or contributor can ask that something be added to -the next meeting's agenda by logging a GitHub Issue. Any Collaborator, -WG member or the moderator can add the item to the agenda by adding -the ***WG-agenda*** tag to the issue. - -Prior to each WG meeting the moderator will share the Agenda with -members of the WG. WG members can add any items they like to the -agenda at the beginning of each meeting. The moderator and the WG -cannot veto or remove items. - -The WG may invite persons or representatives from certain projects to -participate in a non-voting capacity. - -The moderator is responsible for summarizing the discussion of each -agenda item and sends it as a pull request after the meeting. - -### Consensus Seeking Process - -The WG follows a -[Consensus -Seeking](http://en.wikipedia.org/wiki/Consensus-seeking_decision-making) -decision-making model. - -When an agenda item has appeared to reach a consensus the moderator -will ask "Does anyone object?" as a final call for dissent from the -consensus. - -If an agenda item cannot reach a consensus a WG member can call for -either a closing vote or a vote to table the issue to the next -meeting. The call for a vote must be seconded by a majority of the WG -or else the discussion will continue. Simple majority wins. - -Note that changes to WG membership require a majority consensus. See -"WG Membership" above. diff --git a/deps/npm/node_modules/fs-write-stream-atomic/node_modules/readable-stream/LICENSE b/deps/npm/node_modules/fs-write-stream-atomic/node_modules/readable-stream/LICENSE deleted file mode 100644 index 2873b3b2e59507..00000000000000 --- a/deps/npm/node_modules/fs-write-stream-atomic/node_modules/readable-stream/LICENSE +++ /dev/null @@ -1,47 +0,0 @@ -Node.js is licensed for use as follows: - -""" -Copyright Node.js contributors. All rights reserved. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to -deal in the Software without restriction, including without limitation the -rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -sell copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -IN THE SOFTWARE. -""" - -This license applies to parts of Node.js originating from the -https://github.com/joyent/node repository: - -""" -Copyright Joyent, Inc. and other Node contributors. All rights reserved. -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to -deal in the Software without restriction, including without limitation the -rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -sell copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -IN THE SOFTWARE. -""" diff --git a/deps/npm/node_modules/fs-write-stream-atomic/node_modules/readable-stream/README.md b/deps/npm/node_modules/fs-write-stream-atomic/node_modules/readable-stream/README.md deleted file mode 100644 index 23fe3f3e3009a2..00000000000000 --- a/deps/npm/node_modules/fs-write-stream-atomic/node_modules/readable-stream/README.md +++ /dev/null @@ -1,58 +0,0 @@ -# readable-stream - -***Node-core v8.11.1 streams for userland*** [![Build Status](https://travis-ci.org/nodejs/readable-stream.svg?branch=master)](https://travis-ci.org/nodejs/readable-stream) - - -[![NPM](https://nodei.co/npm/readable-stream.png?downloads=true&downloadRank=true)](https://nodei.co/npm/readable-stream/) -[![NPM](https://nodei.co/npm-dl/readable-stream.png?&months=6&height=3)](https://nodei.co/npm/readable-stream/) - - -[![Sauce Test Status](https://saucelabs.com/browser-matrix/readable-stream.svg)](https://saucelabs.com/u/readable-stream) - -```bash -npm install --save readable-stream -``` - -***Node-core streams for userland*** - -This package is a mirror of the Streams2 and Streams3 implementations in -Node-core. - -Full documentation may be found on the [Node.js website](https://nodejs.org/dist/v8.11.1/docs/api/stream.html). - -If you want to guarantee a stable streams base, regardless of what version of -Node you, or the users of your libraries are using, use **readable-stream** *only* and avoid the *"stream"* module in Node-core, for background see [this blogpost](http://r.va.gg/2014/06/why-i-dont-use-nodes-core-stream-module.html). - -As of version 2.0.0 **readable-stream** uses semantic versioning. - -# Streams Working Group - -`readable-stream` is maintained by the Streams Working Group, which -oversees the development and maintenance of the Streams API within -Node.js. The responsibilities of the Streams Working Group include: - -* Addressing stream issues on the Node.js issue tracker. -* Authoring and editing stream documentation within the Node.js project. -* Reviewing changes to stream subclasses within the Node.js project. -* Redirecting changes to streams from the Node.js project to this - project. -* Assisting in the implementation of stream providers within Node.js. -* Recommending versions of `readable-stream` to be included in Node.js. -* Messaging about the future of streams to give the community advance - notice of changes. - - -## Team Members - -* **Chris Dickinson** ([@chrisdickinson](https://github.com/chrisdickinson)) <christopher.s.dickinson@gmail.com> - - Release GPG key: 9554F04D7259F04124DE6B476D5A82AC7E37093B -* **Calvin Metcalf** ([@calvinmetcalf](https://github.com/calvinmetcalf)) <calvin.metcalf@gmail.com> - - Release GPG key: F3EF5F62A87FC27A22E643F714CE4FF5015AA242 -* **Rod Vagg** ([@rvagg](https://github.com/rvagg)) <rod@vagg.org> - - Release GPG key: DD8F2338BAE7501E3DD5AC78C273792F7D83545D -* **Sam Newman** ([@sonewman](https://github.com/sonewman)) <newmansam@outlook.com> -* **Mathias Buus** ([@mafintosh](https://github.com/mafintosh)) <mathiasbuus@gmail.com> -* **Domenic Denicola** ([@domenic](https://github.com/domenic)) <d@domenic.me> -* **Matteo Collina** ([@mcollina](https://github.com/mcollina)) <matteo.collina@gmail.com> - - Release GPG key: 3ABC01543F22DD2239285CDD818674489FBC127E -* **Irina Shestak** ([@lrlna](https://github.com/lrlna)) <shestak.irina@gmail.com> diff --git a/deps/npm/node_modules/fs-write-stream-atomic/node_modules/readable-stream/doc/wg-meetings/2015-01-30.md b/deps/npm/node_modules/fs-write-stream-atomic/node_modules/readable-stream/doc/wg-meetings/2015-01-30.md deleted file mode 100644 index 83275f192e4077..00000000000000 --- a/deps/npm/node_modules/fs-write-stream-atomic/node_modules/readable-stream/doc/wg-meetings/2015-01-30.md +++ /dev/null @@ -1,60 +0,0 @@ -# streams WG Meeting 2015-01-30 - -## Links - -* **Google Hangouts Video**: http://www.youtube.com/watch?v=I9nDOSGfwZg -* **GitHub Issue**: https://github.com/iojs/readable-stream/issues/106 -* **Original Minutes Google Doc**: https://docs.google.com/document/d/17aTgLnjMXIrfjgNaTUnHQO7m3xgzHR2VXBTmi03Qii4/ - -## Agenda - -Extracted from https://github.com/iojs/readable-stream/labels/wg-agenda prior to meeting. - -* adopt a charter [#105](https://github.com/iojs/readable-stream/issues/105) -* release and versioning strategy [#101](https://github.com/iojs/readable-stream/issues/101) -* simpler stream creation [#102](https://github.com/iojs/readable-stream/issues/102) -* proposal: deprecate implicit flowing of streams [#99](https://github.com/iojs/readable-stream/issues/99) - -## Minutes - -### adopt a charter - -* group: +1's all around - -### What versioning scheme should be adopted? -* group: +1’s 3.0.0 -* domenic+group: pulling in patches from other sources where appropriate -* mikeal: version independently, suggesting versions for io.js -* mikeal+domenic: work with TC to notify in advance of changes -simpler stream creation - -### streamline creation of streams -* sam: streamline creation of streams -* domenic: nice simple solution posted - but, we lose the opportunity to change the model - may not be backwards incompatible (double check keys) - - **action item:** domenic will check - -### remove implicit flowing of streams on(‘data’) -* add isFlowing / isPaused -* mikeal: worrying that we’re documenting polyfill methods – confuses users -* domenic: more reflective API is probably good, with warning labels for users -* new section for mad scientists (reflective stream access) -* calvin: name the “third state” -* mikeal: maybe borrow the name from whatwg? -* domenic: we’re missing the “third state” -* consensus: kind of difficult to name the third state -* mikeal: figure out differences in states / compat -* mathias: always flow on data – eliminates third state - * explore what it breaks - -**action items:** -* ask isaac for ability to list packages by what public io.js APIs they use (esp. Stream) -* ask rod/build for infrastructure -* **chris**: explore the “flow on data” approach -* add isPaused/isFlowing -* add new docs section -* move isPaused to that section - - diff --git a/deps/npm/node_modules/fs-write-stream-atomic/node_modules/readable-stream/duplex-browser.js b/deps/npm/node_modules/fs-write-stream-atomic/node_modules/readable-stream/duplex-browser.js deleted file mode 100644 index f8b2db83dbe733..00000000000000 --- a/deps/npm/node_modules/fs-write-stream-atomic/node_modules/readable-stream/duplex-browser.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./lib/_stream_duplex.js'); diff --git a/deps/npm/node_modules/fs-write-stream-atomic/node_modules/readable-stream/duplex.js b/deps/npm/node_modules/fs-write-stream-atomic/node_modules/readable-stream/duplex.js deleted file mode 100644 index 46924cbfdf5387..00000000000000 --- a/deps/npm/node_modules/fs-write-stream-atomic/node_modules/readable-stream/duplex.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./readable').Duplex diff --git a/deps/npm/node_modules/fs-write-stream-atomic/node_modules/readable-stream/lib/_stream_duplex.js b/deps/npm/node_modules/fs-write-stream-atomic/node_modules/readable-stream/lib/_stream_duplex.js deleted file mode 100644 index a1ca813e5acbd8..00000000000000 --- a/deps/npm/node_modules/fs-write-stream-atomic/node_modules/readable-stream/lib/_stream_duplex.js +++ /dev/null @@ -1,131 +0,0 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - -// a duplex stream is just a stream that is both readable and writable. -// Since JS doesn't have multiple prototypal inheritance, this class -// prototypally inherits from Readable, and then parasitically from -// Writable. - -'use strict'; - -/**/ - -var pna = require('process-nextick-args'); -/**/ - -/**/ -var objectKeys = Object.keys || function (obj) { - var keys = []; - for (var key in obj) { - keys.push(key); - }return keys; -}; -/**/ - -module.exports = Duplex; - -/**/ -var util = require('core-util-is'); -util.inherits = require('inherits'); -/**/ - -var Readable = require('./_stream_readable'); -var Writable = require('./_stream_writable'); - -util.inherits(Duplex, Readable); - -{ - // avoid scope creep, the keys array can then be collected - var keys = objectKeys(Writable.prototype); - for (var v = 0; v < keys.length; v++) { - var method = keys[v]; - if (!Duplex.prototype[method]) Duplex.prototype[method] = Writable.prototype[method]; - } -} - -function Duplex(options) { - if (!(this instanceof Duplex)) return new Duplex(options); - - Readable.call(this, options); - Writable.call(this, options); - - if (options && options.readable === false) this.readable = false; - - if (options && options.writable === false) this.writable = false; - - this.allowHalfOpen = true; - if (options && options.allowHalfOpen === false) this.allowHalfOpen = false; - - this.once('end', onend); -} - -Object.defineProperty(Duplex.prototype, 'writableHighWaterMark', { - // making it explicit this property is not enumerable - // because otherwise some prototype manipulation in - // userland will fail - enumerable: false, - get: function () { - return this._writableState.highWaterMark; - } -}); - -// the no-half-open enforcer -function onend() { - // if we allow half-open state, or if the writable side ended, - // then we're ok. - if (this.allowHalfOpen || this._writableState.ended) return; - - // no more data can be written. - // But allow more writes to happen in this tick. - pna.nextTick(onEndNT, this); -} - -function onEndNT(self) { - self.end(); -} - -Object.defineProperty(Duplex.prototype, 'destroyed', { - get: function () { - if (this._readableState === undefined || this._writableState === undefined) { - return false; - } - return this._readableState.destroyed && this._writableState.destroyed; - }, - set: function (value) { - // we ignore the value if the stream - // has not been initialized yet - if (this._readableState === undefined || this._writableState === undefined) { - return; - } - - // backward compatibility, the user is explicitly - // managing destroyed - this._readableState.destroyed = value; - this._writableState.destroyed = value; - } -}); - -Duplex.prototype._destroy = function (err, cb) { - this.push(null); - this.end(); - - pna.nextTick(cb, err); -}; \ No newline at end of file diff --git a/deps/npm/node_modules/fs-write-stream-atomic/node_modules/readable-stream/lib/_stream_passthrough.js b/deps/npm/node_modules/fs-write-stream-atomic/node_modules/readable-stream/lib/_stream_passthrough.js deleted file mode 100644 index a9c835884828d8..00000000000000 --- a/deps/npm/node_modules/fs-write-stream-atomic/node_modules/readable-stream/lib/_stream_passthrough.js +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - -// a passthrough stream. -// basically just the most minimal sort of Transform stream. -// Every written chunk gets output as-is. - -'use strict'; - -module.exports = PassThrough; - -var Transform = require('./_stream_transform'); - -/**/ -var util = require('core-util-is'); -util.inherits = require('inherits'); -/**/ - -util.inherits(PassThrough, Transform); - -function PassThrough(options) { - if (!(this instanceof PassThrough)) return new PassThrough(options); - - Transform.call(this, options); -} - -PassThrough.prototype._transform = function (chunk, encoding, cb) { - cb(null, chunk); -}; \ No newline at end of file diff --git a/deps/npm/node_modules/fs-write-stream-atomic/node_modules/readable-stream/lib/_stream_readable.js b/deps/npm/node_modules/fs-write-stream-atomic/node_modules/readable-stream/lib/_stream_readable.js deleted file mode 100644 index bf34ac65e1108f..00000000000000 --- a/deps/npm/node_modules/fs-write-stream-atomic/node_modules/readable-stream/lib/_stream_readable.js +++ /dev/null @@ -1,1019 +0,0 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - -'use strict'; - -/**/ - -var pna = require('process-nextick-args'); -/**/ - -module.exports = Readable; - -/**/ -var isArray = require('isarray'); -/**/ - -/**/ -var Duplex; -/**/ - -Readable.ReadableState = ReadableState; - -/**/ -var EE = require('events').EventEmitter; - -var EElistenerCount = function (emitter, type) { - return emitter.listeners(type).length; -}; -/**/ - -/**/ -var Stream = require('./internal/streams/stream'); -/**/ - -/**/ - -var Buffer = require('safe-buffer').Buffer; -var OurUint8Array = global.Uint8Array || function () {}; -function _uint8ArrayToBuffer(chunk) { - return Buffer.from(chunk); -} -function _isUint8Array(obj) { - return Buffer.isBuffer(obj) || obj instanceof OurUint8Array; -} - -/**/ - -/**/ -var util = require('core-util-is'); -util.inherits = require('inherits'); -/**/ - -/**/ -var debugUtil = require('util'); -var debug = void 0; -if (debugUtil && debugUtil.debuglog) { - debug = debugUtil.debuglog('stream'); -} else { - debug = function () {}; -} -/**/ - -var BufferList = require('./internal/streams/BufferList'); -var destroyImpl = require('./internal/streams/destroy'); -var StringDecoder; - -util.inherits(Readable, Stream); - -var kProxyEvents = ['error', 'close', 'destroy', 'pause', 'resume']; - -function prependListener(emitter, event, fn) { - // Sadly this is not cacheable as some libraries bundle their own - // event emitter implementation with them. - if (typeof emitter.prependListener === 'function') return emitter.prependListener(event, fn); - - // This is a hack to make sure that our error handler is attached before any - // userland ones. NEVER DO THIS. This is here only because this code needs - // to continue to work with older versions of Node.js that do not include - // the prependListener() method. The goal is to eventually remove this hack. - if (!emitter._events || !emitter._events[event]) emitter.on(event, fn);else if (isArray(emitter._events[event])) emitter._events[event].unshift(fn);else emitter._events[event] = [fn, emitter._events[event]]; -} - -function ReadableState(options, stream) { - Duplex = Duplex || require('./_stream_duplex'); - - options = options || {}; - - // Duplex streams are both readable and writable, but share - // the same options object. - // However, some cases require setting options to different - // values for the readable and the writable sides of the duplex stream. - // These options can be provided separately as readableXXX and writableXXX. - var isDuplex = stream instanceof Duplex; - - // object stream flag. Used to make read(n) ignore n and to - // make all the buffer merging and length checks go away - this.objectMode = !!options.objectMode; - - if (isDuplex) this.objectMode = this.objectMode || !!options.readableObjectMode; - - // the point at which it stops calling _read() to fill the buffer - // Note: 0 is a valid value, means "don't call _read preemptively ever" - var hwm = options.highWaterMark; - var readableHwm = options.readableHighWaterMark; - var defaultHwm = this.objectMode ? 16 : 16 * 1024; - - if (hwm || hwm === 0) this.highWaterMark = hwm;else if (isDuplex && (readableHwm || readableHwm === 0)) this.highWaterMark = readableHwm;else this.highWaterMark = defaultHwm; - - // cast to ints. - this.highWaterMark = Math.floor(this.highWaterMark); - - // A linked list is used to store data chunks instead of an array because the - // linked list can remove elements from the beginning faster than - // array.shift() - this.buffer = new BufferList(); - this.length = 0; - this.pipes = null; - this.pipesCount = 0; - this.flowing = null; - this.ended = false; - this.endEmitted = false; - this.reading = false; - - // a flag to be able to tell if the event 'readable'/'data' is emitted - // immediately, or on a later tick. We set this to true at first, because - // any actions that shouldn't happen until "later" should generally also - // not happen before the first read call. - this.sync = true; - - // whenever we return null, then we set a flag to say - // that we're awaiting a 'readable' event emission. - this.needReadable = false; - this.emittedReadable = false; - this.readableListening = false; - this.resumeScheduled = false; - - // has it been destroyed - this.destroyed = false; - - // Crypto is kind of old and crusty. Historically, its default string - // encoding is 'binary' so we have to make this configurable. - // Everything else in the universe uses 'utf8', though. - this.defaultEncoding = options.defaultEncoding || 'utf8'; - - // the number of writers that are awaiting a drain event in .pipe()s - this.awaitDrain = 0; - - // if true, a maybeReadMore has been scheduled - this.readingMore = false; - - this.decoder = null; - this.encoding = null; - if (options.encoding) { - if (!StringDecoder) StringDecoder = require('string_decoder/').StringDecoder; - this.decoder = new StringDecoder(options.encoding); - this.encoding = options.encoding; - } -} - -function Readable(options) { - Duplex = Duplex || require('./_stream_duplex'); - - if (!(this instanceof Readable)) return new Readable(options); - - this._readableState = new ReadableState(options, this); - - // legacy - this.readable = true; - - if (options) { - if (typeof options.read === 'function') this._read = options.read; - - if (typeof options.destroy === 'function') this._destroy = options.destroy; - } - - Stream.call(this); -} - -Object.defineProperty(Readable.prototype, 'destroyed', { - get: function () { - if (this._readableState === undefined) { - return false; - } - return this._readableState.destroyed; - }, - set: function (value) { - // we ignore the value if the stream - // has not been initialized yet - if (!this._readableState) { - return; - } - - // backward compatibility, the user is explicitly - // managing destroyed - this._readableState.destroyed = value; - } -}); - -Readable.prototype.destroy = destroyImpl.destroy; -Readable.prototype._undestroy = destroyImpl.undestroy; -Readable.prototype._destroy = function (err, cb) { - this.push(null); - cb(err); -}; - -// Manually shove something into the read() buffer. -// This returns true if the highWaterMark has not been hit yet, -// similar to how Writable.write() returns true if you should -// write() some more. -Readable.prototype.push = function (chunk, encoding) { - var state = this._readableState; - var skipChunkCheck; - - if (!state.objectMode) { - if (typeof chunk === 'string') { - encoding = encoding || state.defaultEncoding; - if (encoding !== state.encoding) { - chunk = Buffer.from(chunk, encoding); - encoding = ''; - } - skipChunkCheck = true; - } - } else { - skipChunkCheck = true; - } - - return readableAddChunk(this, chunk, encoding, false, skipChunkCheck); -}; - -// Unshift should *always* be something directly out of read() -Readable.prototype.unshift = function (chunk) { - return readableAddChunk(this, chunk, null, true, false); -}; - -function readableAddChunk(stream, chunk, encoding, addToFront, skipChunkCheck) { - var state = stream._readableState; - if (chunk === null) { - state.reading = false; - onEofChunk(stream, state); - } else { - var er; - if (!skipChunkCheck) er = chunkInvalid(state, chunk); - if (er) { - stream.emit('error', er); - } else if (state.objectMode || chunk && chunk.length > 0) { - if (typeof chunk !== 'string' && !state.objectMode && Object.getPrototypeOf(chunk) !== Buffer.prototype) { - chunk = _uint8ArrayToBuffer(chunk); - } - - if (addToFront) { - if (state.endEmitted) stream.emit('error', new Error('stream.unshift() after end event'));else addChunk(stream, state, chunk, true); - } else if (state.ended) { - stream.emit('error', new Error('stream.push() after EOF')); - } else { - state.reading = false; - if (state.decoder && !encoding) { - chunk = state.decoder.write(chunk); - if (state.objectMode || chunk.length !== 0) addChunk(stream, state, chunk, false);else maybeReadMore(stream, state); - } else { - addChunk(stream, state, chunk, false); - } - } - } else if (!addToFront) { - state.reading = false; - } - } - - return needMoreData(state); -} - -function addChunk(stream, state, chunk, addToFront) { - if (state.flowing && state.length === 0 && !state.sync) { - stream.emit('data', chunk); - stream.read(0); - } else { - // update the buffer info. - state.length += state.objectMode ? 1 : chunk.length; - if (addToFront) state.buffer.unshift(chunk);else state.buffer.push(chunk); - - if (state.needReadable) emitReadable(stream); - } - maybeReadMore(stream, state); -} - -function chunkInvalid(state, chunk) { - var er; - if (!_isUint8Array(chunk) && typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) { - er = new TypeError('Invalid non-string/buffer chunk'); - } - return er; -} - -// if it's past the high water mark, we can push in some more. -// Also, if we have no data yet, we can stand some -// more bytes. This is to work around cases where hwm=0, -// such as the repl. Also, if the push() triggered a -// readable event, and the user called read(largeNumber) such that -// needReadable was set, then we ought to push more, so that another -// 'readable' event will be triggered. -function needMoreData(state) { - return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0); -} - -Readable.prototype.isPaused = function () { - return this._readableState.flowing === false; -}; - -// backwards compatibility. -Readable.prototype.setEncoding = function (enc) { - if (!StringDecoder) StringDecoder = require('string_decoder/').StringDecoder; - this._readableState.decoder = new StringDecoder(enc); - this._readableState.encoding = enc; - return this; -}; - -// Don't raise the hwm > 8MB -var MAX_HWM = 0x800000; -function computeNewHighWaterMark(n) { - if (n >= MAX_HWM) { - n = MAX_HWM; - } else { - // Get the next highest power of 2 to prevent increasing hwm excessively in - // tiny amounts - n--; - n |= n >>> 1; - n |= n >>> 2; - n |= n >>> 4; - n |= n >>> 8; - n |= n >>> 16; - n++; - } - return n; -} - -// This function is designed to be inlinable, so please take care when making -// changes to the function body. -function howMuchToRead(n, state) { - if (n <= 0 || state.length === 0 && state.ended) return 0; - if (state.objectMode) return 1; - if (n !== n) { - // Only flow one buffer at a time - if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length; - } - // If we're asking for more than the current hwm, then raise the hwm. - if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n); - if (n <= state.length) return n; - // Don't have enough - if (!state.ended) { - state.needReadable = true; - return 0; - } - return state.length; -} - -// you can override either this method, or the async _read(n) below. -Readable.prototype.read = function (n) { - debug('read', n); - n = parseInt(n, 10); - var state = this._readableState; - var nOrig = n; - - if (n !== 0) state.emittedReadable = false; - - // if we're doing read(0) to trigger a readable event, but we - // already have a bunch of data in the buffer, then just trigger - // the 'readable' event and move on. - if (n === 0 && state.needReadable && (state.length >= state.highWaterMark || state.ended)) { - debug('read: emitReadable', state.length, state.ended); - if (state.length === 0 && state.ended) endReadable(this);else emitReadable(this); - return null; - } - - n = howMuchToRead(n, state); - - // if we've ended, and we're now clear, then finish it up. - if (n === 0 && state.ended) { - if (state.length === 0) endReadable(this); - return null; - } - - // All the actual chunk generation logic needs to be - // *below* the call to _read. The reason is that in certain - // synthetic stream cases, such as passthrough streams, _read - // may be a completely synchronous operation which may change - // the state of the read buffer, providing enough data when - // before there was *not* enough. - // - // So, the steps are: - // 1. Figure out what the state of things will be after we do - // a read from the buffer. - // - // 2. If that resulting state will trigger a _read, then call _read. - // Note that this may be asynchronous, or synchronous. Yes, it is - // deeply ugly to write APIs this way, but that still doesn't mean - // that the Readable class should behave improperly, as streams are - // designed to be sync/async agnostic. - // Take note if the _read call is sync or async (ie, if the read call - // has returned yet), so that we know whether or not it's safe to emit - // 'readable' etc. - // - // 3. Actually pull the requested chunks out of the buffer and return. - - // if we need a readable event, then we need to do some reading. - var doRead = state.needReadable; - debug('need readable', doRead); - - // if we currently have less than the highWaterMark, then also read some - if (state.length === 0 || state.length - n < state.highWaterMark) { - doRead = true; - debug('length less than watermark', doRead); - } - - // however, if we've ended, then there's no point, and if we're already - // reading, then it's unnecessary. - if (state.ended || state.reading) { - doRead = false; - debug('reading or ended', doRead); - } else if (doRead) { - debug('do read'); - state.reading = true; - state.sync = true; - // if the length is currently zero, then we *need* a readable event. - if (state.length === 0) state.needReadable = true; - // call internal read method - this._read(state.highWaterMark); - state.sync = false; - // If _read pushed data synchronously, then `reading` will be false, - // and we need to re-evaluate how much data we can return to the user. - if (!state.reading) n = howMuchToRead(nOrig, state); - } - - var ret; - if (n > 0) ret = fromList(n, state);else ret = null; - - if (ret === null) { - state.needReadable = true; - n = 0; - } else { - state.length -= n; - } - - if (state.length === 0) { - // If we have nothing in the buffer, then we want to know - // as soon as we *do* get something into the buffer. - if (!state.ended) state.needReadable = true; - - // If we tried to read() past the EOF, then emit end on the next tick. - if (nOrig !== n && state.ended) endReadable(this); - } - - if (ret !== null) this.emit('data', ret); - - return ret; -}; - -function onEofChunk(stream, state) { - if (state.ended) return; - if (state.decoder) { - var chunk = state.decoder.end(); - if (chunk && chunk.length) { - state.buffer.push(chunk); - state.length += state.objectMode ? 1 : chunk.length; - } - } - state.ended = true; - - // emit 'readable' now to make sure it gets picked up. - emitReadable(stream); -} - -// Don't emit readable right away in sync mode, because this can trigger -// another read() call => stack overflow. This way, it might trigger -// a nextTick recursion warning, but that's not so bad. -function emitReadable(stream) { - var state = stream._readableState; - state.needReadable = false; - if (!state.emittedReadable) { - debug('emitReadable', state.flowing); - state.emittedReadable = true; - if (state.sync) pna.nextTick(emitReadable_, stream);else emitReadable_(stream); - } -} - -function emitReadable_(stream) { - debug('emit readable'); - stream.emit('readable'); - flow(stream); -} - -// at this point, the user has presumably seen the 'readable' event, -// and called read() to consume some data. that may have triggered -// in turn another _read(n) call, in which case reading = true if -// it's in progress. -// However, if we're not ended, or reading, and the length < hwm, -// then go ahead and try to read some more preemptively. -function maybeReadMore(stream, state) { - if (!state.readingMore) { - state.readingMore = true; - pna.nextTick(maybeReadMore_, stream, state); - } -} - -function maybeReadMore_(stream, state) { - var len = state.length; - while (!state.reading && !state.flowing && !state.ended && state.length < state.highWaterMark) { - debug('maybeReadMore read 0'); - stream.read(0); - if (len === state.length) - // didn't get any data, stop spinning. - break;else len = state.length; - } - state.readingMore = false; -} - -// abstract method. to be overridden in specific implementation classes. -// call cb(er, data) where data is <= n in length. -// for virtual (non-string, non-buffer) streams, "length" is somewhat -// arbitrary, and perhaps not very meaningful. -Readable.prototype._read = function (n) { - this.emit('error', new Error('_read() is not implemented')); -}; - -Readable.prototype.pipe = function (dest, pipeOpts) { - var src = this; - var state = this._readableState; - - switch (state.pipesCount) { - case 0: - state.pipes = dest; - break; - case 1: - state.pipes = [state.pipes, dest]; - break; - default: - state.pipes.push(dest); - break; - } - state.pipesCount += 1; - debug('pipe count=%d opts=%j', state.pipesCount, pipeOpts); - - var doEnd = (!pipeOpts || pipeOpts.end !== false) && dest !== process.stdout && dest !== process.stderr; - - var endFn = doEnd ? onend : unpipe; - if (state.endEmitted) pna.nextTick(endFn);else src.once('end', endFn); - - dest.on('unpipe', onunpipe); - function onunpipe(readable, unpipeInfo) { - debug('onunpipe'); - if (readable === src) { - if (unpipeInfo && unpipeInfo.hasUnpiped === false) { - unpipeInfo.hasUnpiped = true; - cleanup(); - } - } - } - - function onend() { - debug('onend'); - dest.end(); - } - - // when the dest drains, it reduces the awaitDrain counter - // on the source. This would be more elegant with a .once() - // handler in flow(), but adding and removing repeatedly is - // too slow. - var ondrain = pipeOnDrain(src); - dest.on('drain', ondrain); - - var cleanedUp = false; - function cleanup() { - debug('cleanup'); - // cleanup event handlers once the pipe is broken - dest.removeListener('close', onclose); - dest.removeListener('finish', onfinish); - dest.removeListener('drain', ondrain); - dest.removeListener('error', onerror); - dest.removeListener('unpipe', onunpipe); - src.removeListener('end', onend); - src.removeListener('end', unpipe); - src.removeListener('data', ondata); - - cleanedUp = true; - - // if the reader is waiting for a drain event from this - // specific writer, then it would cause it to never start - // flowing again. - // So, if this is awaiting a drain, then we just call it now. - // If we don't know, then assume that we are waiting for one. - if (state.awaitDrain && (!dest._writableState || dest._writableState.needDrain)) ondrain(); - } - - // If the user pushes more data while we're writing to dest then we'll end up - // in ondata again. However, we only want to increase awaitDrain once because - // dest will only emit one 'drain' event for the multiple writes. - // => Introduce a guard on increasing awaitDrain. - var increasedAwaitDrain = false; - src.on('data', ondata); - function ondata(chunk) { - debug('ondata'); - increasedAwaitDrain = false; - var ret = dest.write(chunk); - if (false === ret && !increasedAwaitDrain) { - // If the user unpiped during `dest.write()`, it is possible - // to get stuck in a permanently paused state if that write - // also returned false. - // => Check whether `dest` is still a piping destination. - if ((state.pipesCount === 1 && state.pipes === dest || state.pipesCount > 1 && indexOf(state.pipes, dest) !== -1) && !cleanedUp) { - debug('false write response, pause', src._readableState.awaitDrain); - src._readableState.awaitDrain++; - increasedAwaitDrain = true; - } - src.pause(); - } - } - - // if the dest has an error, then stop piping into it. - // however, don't suppress the throwing behavior for this. - function onerror(er) { - debug('onerror', er); - unpipe(); - dest.removeListener('error', onerror); - if (EElistenerCount(dest, 'error') === 0) dest.emit('error', er); - } - - // Make sure our error handler is attached before userland ones. - prependListener(dest, 'error', onerror); - - // Both close and finish should trigger unpipe, but only once. - function onclose() { - dest.removeListener('finish', onfinish); - unpipe(); - } - dest.once('close', onclose); - function onfinish() { - debug('onfinish'); - dest.removeListener('close', onclose); - unpipe(); - } - dest.once('finish', onfinish); - - function unpipe() { - debug('unpipe'); - src.unpipe(dest); - } - - // tell the dest that it's being piped to - dest.emit('pipe', src); - - // start the flow if it hasn't been started already. - if (!state.flowing) { - debug('pipe resume'); - src.resume(); - } - - return dest; -}; - -function pipeOnDrain(src) { - return function () { - var state = src._readableState; - debug('pipeOnDrain', state.awaitDrain); - if (state.awaitDrain) state.awaitDrain--; - if (state.awaitDrain === 0 && EElistenerCount(src, 'data')) { - state.flowing = true; - flow(src); - } - }; -} - -Readable.prototype.unpipe = function (dest) { - var state = this._readableState; - var unpipeInfo = { hasUnpiped: false }; - - // if we're not piping anywhere, then do nothing. - if (state.pipesCount === 0) return this; - - // just one destination. most common case. - if (state.pipesCount === 1) { - // passed in one, but it's not the right one. - if (dest && dest !== state.pipes) return this; - - if (!dest) dest = state.pipes; - - // got a match. - state.pipes = null; - state.pipesCount = 0; - state.flowing = false; - if (dest) dest.emit('unpipe', this, unpipeInfo); - return this; - } - - // slow case. multiple pipe destinations. - - if (!dest) { - // remove all. - var dests = state.pipes; - var len = state.pipesCount; - state.pipes = null; - state.pipesCount = 0; - state.flowing = false; - - for (var i = 0; i < len; i++) { - dests[i].emit('unpipe', this, unpipeInfo); - }return this; - } - - // try to find the right one. - var index = indexOf(state.pipes, dest); - if (index === -1) return this; - - state.pipes.splice(index, 1); - state.pipesCount -= 1; - if (state.pipesCount === 1) state.pipes = state.pipes[0]; - - dest.emit('unpipe', this, unpipeInfo); - - return this; -}; - -// set up data events if they are asked for -// Ensure readable listeners eventually get something -Readable.prototype.on = function (ev, fn) { - var res = Stream.prototype.on.call(this, ev, fn); - - if (ev === 'data') { - // Start flowing on next tick if stream isn't explicitly paused - if (this._readableState.flowing !== false) this.resume(); - } else if (ev === 'readable') { - var state = this._readableState; - if (!state.endEmitted && !state.readableListening) { - state.readableListening = state.needReadable = true; - state.emittedReadable = false; - if (!state.reading) { - pna.nextTick(nReadingNextTick, this); - } else if (state.length) { - emitReadable(this); - } - } - } - - return res; -}; -Readable.prototype.addListener = Readable.prototype.on; - -function nReadingNextTick(self) { - debug('readable nexttick read 0'); - self.read(0); -} - -// pause() and resume() are remnants of the legacy readable stream API -// If the user uses them, then switch into old mode. -Readable.prototype.resume = function () { - var state = this._readableState; - if (!state.flowing) { - debug('resume'); - state.flowing = true; - resume(this, state); - } - return this; -}; - -function resume(stream, state) { - if (!state.resumeScheduled) { - state.resumeScheduled = true; - pna.nextTick(resume_, stream, state); - } -} - -function resume_(stream, state) { - if (!state.reading) { - debug('resume read 0'); - stream.read(0); - } - - state.resumeScheduled = false; - state.awaitDrain = 0; - stream.emit('resume'); - flow(stream); - if (state.flowing && !state.reading) stream.read(0); -} - -Readable.prototype.pause = function () { - debug('call pause flowing=%j', this._readableState.flowing); - if (false !== this._readableState.flowing) { - debug('pause'); - this._readableState.flowing = false; - this.emit('pause'); - } - return this; -}; - -function flow(stream) { - var state = stream._readableState; - debug('flow', state.flowing); - while (state.flowing && stream.read() !== null) {} -} - -// wrap an old-style stream as the async data source. -// This is *not* part of the readable stream interface. -// It is an ugly unfortunate mess of history. -Readable.prototype.wrap = function (stream) { - var _this = this; - - var state = this._readableState; - var paused = false; - - stream.on('end', function () { - debug('wrapped end'); - if (state.decoder && !state.ended) { - var chunk = state.decoder.end(); - if (chunk && chunk.length) _this.push(chunk); - } - - _this.push(null); - }); - - stream.on('data', function (chunk) { - debug('wrapped data'); - if (state.decoder) chunk = state.decoder.write(chunk); - - // don't skip over falsy values in objectMode - if (state.objectMode && (chunk === null || chunk === undefined)) return;else if (!state.objectMode && (!chunk || !chunk.length)) return; - - var ret = _this.push(chunk); - if (!ret) { - paused = true; - stream.pause(); - } - }); - - // proxy all the other methods. - // important when wrapping filters and duplexes. - for (var i in stream) { - if (this[i] === undefined && typeof stream[i] === 'function') { - this[i] = function (method) { - return function () { - return stream[method].apply(stream, arguments); - }; - }(i); - } - } - - // proxy certain important events. - for (var n = 0; n < kProxyEvents.length; n++) { - stream.on(kProxyEvents[n], this.emit.bind(this, kProxyEvents[n])); - } - - // when we try to consume some more bytes, simply unpause the - // underlying stream. - this._read = function (n) { - debug('wrapped _read', n); - if (paused) { - paused = false; - stream.resume(); - } - }; - - return this; -}; - -Object.defineProperty(Readable.prototype, 'readableHighWaterMark', { - // making it explicit this property is not enumerable - // because otherwise some prototype manipulation in - // userland will fail - enumerable: false, - get: function () { - return this._readableState.highWaterMark; - } -}); - -// exposed for testing purposes only. -Readable._fromList = fromList; - -// Pluck off n bytes from an array of buffers. -// Length is the combined lengths of all the buffers in the list. -// This function is designed to be inlinable, so please take care when making -// changes to the function body. -function fromList(n, state) { - // nothing buffered - if (state.length === 0) return null; - - var ret; - if (state.objectMode) ret = state.buffer.shift();else if (!n || n >= state.length) { - // read it all, truncate the list - if (state.decoder) ret = state.buffer.join('');else if (state.buffer.length === 1) ret = state.buffer.head.data;else ret = state.buffer.concat(state.length); - state.buffer.clear(); - } else { - // read part of list - ret = fromListPartial(n, state.buffer, state.decoder); - } - - return ret; -} - -// Extracts only enough buffered data to satisfy the amount requested. -// This function is designed to be inlinable, so please take care when making -// changes to the function body. -function fromListPartial(n, list, hasStrings) { - var ret; - if (n < list.head.data.length) { - // slice is the same for buffers and strings - ret = list.head.data.slice(0, n); - list.head.data = list.head.data.slice(n); - } else if (n === list.head.data.length) { - // first chunk is a perfect match - ret = list.shift(); - } else { - // result spans more than one buffer - ret = hasStrings ? copyFromBufferString(n, list) : copyFromBuffer(n, list); - } - return ret; -} - -// Copies a specified amount of characters from the list of buffered data -// chunks. -// This function is designed to be inlinable, so please take care when making -// changes to the function body. -function copyFromBufferString(n, list) { - var p = list.head; - var c = 1; - var ret = p.data; - n -= ret.length; - while (p = p.next) { - var str = p.data; - var nb = n > str.length ? str.length : n; - if (nb === str.length) ret += str;else ret += str.slice(0, n); - n -= nb; - if (n === 0) { - if (nb === str.length) { - ++c; - if (p.next) list.head = p.next;else list.head = list.tail = null; - } else { - list.head = p; - p.data = str.slice(nb); - } - break; - } - ++c; - } - list.length -= c; - return ret; -} - -// Copies a specified amount of bytes from the list of buffered data chunks. -// This function is designed to be inlinable, so please take care when making -// changes to the function body. -function copyFromBuffer(n, list) { - var ret = Buffer.allocUnsafe(n); - var p = list.head; - var c = 1; - p.data.copy(ret); - n -= p.data.length; - while (p = p.next) { - var buf = p.data; - var nb = n > buf.length ? buf.length : n; - buf.copy(ret, ret.length - n, 0, nb); - n -= nb; - if (n === 0) { - if (nb === buf.length) { - ++c; - if (p.next) list.head = p.next;else list.head = list.tail = null; - } else { - list.head = p; - p.data = buf.slice(nb); - } - break; - } - ++c; - } - list.length -= c; - return ret; -} - -function endReadable(stream) { - var state = stream._readableState; - - // If we get here before consuming all the bytes, then that is a - // bug in node. Should never happen. - if (state.length > 0) throw new Error('"endReadable()" called on non-empty stream'); - - if (!state.endEmitted) { - state.ended = true; - pna.nextTick(endReadableNT, state, stream); - } -} - -function endReadableNT(state, stream) { - // Check that we didn't get one last unshift. - if (!state.endEmitted && state.length === 0) { - state.endEmitted = true; - stream.readable = false; - stream.emit('end'); - } -} - -function indexOf(xs, x) { - for (var i = 0, l = xs.length; i < l; i++) { - if (xs[i] === x) return i; - } - return -1; -} \ No newline at end of file diff --git a/deps/npm/node_modules/fs-write-stream-atomic/node_modules/readable-stream/lib/_stream_transform.js b/deps/npm/node_modules/fs-write-stream-atomic/node_modules/readable-stream/lib/_stream_transform.js deleted file mode 100644 index 5d1f8b876d98c7..00000000000000 --- a/deps/npm/node_modules/fs-write-stream-atomic/node_modules/readable-stream/lib/_stream_transform.js +++ /dev/null @@ -1,214 +0,0 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - -// a transform stream is a readable/writable stream where you do -// something with the data. Sometimes it's called a "filter", -// but that's not a great name for it, since that implies a thing where -// some bits pass through, and others are simply ignored. (That would -// be a valid example of a transform, of course.) -// -// While the output is causally related to the input, it's not a -// necessarily symmetric or synchronous transformation. For example, -// a zlib stream might take multiple plain-text writes(), and then -// emit a single compressed chunk some time in the future. -// -// Here's how this works: -// -// The Transform stream has all the aspects of the readable and writable -// stream classes. When you write(chunk), that calls _write(chunk,cb) -// internally, and returns false if there's a lot of pending writes -// buffered up. When you call read(), that calls _read(n) until -// there's enough pending readable data buffered up. -// -// In a transform stream, the written data is placed in a buffer. When -// _read(n) is called, it transforms the queued up data, calling the -// buffered _write cb's as it consumes chunks. If consuming a single -// written chunk would result in multiple output chunks, then the first -// outputted bit calls the readcb, and subsequent chunks just go into -// the read buffer, and will cause it to emit 'readable' if necessary. -// -// This way, back-pressure is actually determined by the reading side, -// since _read has to be called to start processing a new chunk. However, -// a pathological inflate type of transform can cause excessive buffering -// here. For example, imagine a stream where every byte of input is -// interpreted as an integer from 0-255, and then results in that many -// bytes of output. Writing the 4 bytes {ff,ff,ff,ff} would result in -// 1kb of data being output. In this case, you could write a very small -// amount of input, and end up with a very large amount of output. In -// such a pathological inflating mechanism, there'd be no way to tell -// the system to stop doing the transform. A single 4MB write could -// cause the system to run out of memory. -// -// However, even in such a pathological case, only a single written chunk -// would be consumed, and then the rest would wait (un-transformed) until -// the results of the previous transformed chunk were consumed. - -'use strict'; - -module.exports = Transform; - -var Duplex = require('./_stream_duplex'); - -/**/ -var util = require('core-util-is'); -util.inherits = require('inherits'); -/**/ - -util.inherits(Transform, Duplex); - -function afterTransform(er, data) { - var ts = this._transformState; - ts.transforming = false; - - var cb = ts.writecb; - - if (!cb) { - return this.emit('error', new Error('write callback called multiple times')); - } - - ts.writechunk = null; - ts.writecb = null; - - if (data != null) // single equals check for both `null` and `undefined` - this.push(data); - - cb(er); - - var rs = this._readableState; - rs.reading = false; - if (rs.needReadable || rs.length < rs.highWaterMark) { - this._read(rs.highWaterMark); - } -} - -function Transform(options) { - if (!(this instanceof Transform)) return new Transform(options); - - Duplex.call(this, options); - - this._transformState = { - afterTransform: afterTransform.bind(this), - needTransform: false, - transforming: false, - writecb: null, - writechunk: null, - writeencoding: null - }; - - // start out asking for a readable event once data is transformed. - this._readableState.needReadable = true; - - // we have implemented the _read method, and done the other things - // that Readable wants before the first _read call, so unset the - // sync guard flag. - this._readableState.sync = false; - - if (options) { - if (typeof options.transform === 'function') this._transform = options.transform; - - if (typeof options.flush === 'function') this._flush = options.flush; - } - - // When the writable side finishes, then flush out anything remaining. - this.on('prefinish', prefinish); -} - -function prefinish() { - var _this = this; - - if (typeof this._flush === 'function') { - this._flush(function (er, data) { - done(_this, er, data); - }); - } else { - done(this, null, null); - } -} - -Transform.prototype.push = function (chunk, encoding) { - this._transformState.needTransform = false; - return Duplex.prototype.push.call(this, chunk, encoding); -}; - -// This is the part where you do stuff! -// override this function in implementation classes. -// 'chunk' is an input chunk. -// -// Call `push(newChunk)` to pass along transformed output -// to the readable side. You may call 'push' zero or more times. -// -// Call `cb(err)` when you are done with this chunk. If you pass -// an error, then that'll put the hurt on the whole operation. If you -// never call cb(), then you'll never get another chunk. -Transform.prototype._transform = function (chunk, encoding, cb) { - throw new Error('_transform() is not implemented'); -}; - -Transform.prototype._write = function (chunk, encoding, cb) { - var ts = this._transformState; - ts.writecb = cb; - ts.writechunk = chunk; - ts.writeencoding = encoding; - if (!ts.transforming) { - var rs = this._readableState; - if (ts.needTransform || rs.needReadable || rs.length < rs.highWaterMark) this._read(rs.highWaterMark); - } -}; - -// Doesn't matter what the args are here. -// _transform does all the work. -// That we got here means that the readable side wants more data. -Transform.prototype._read = function (n) { - var ts = this._transformState; - - if (ts.writechunk !== null && ts.writecb && !ts.transforming) { - ts.transforming = true; - this._transform(ts.writechunk, ts.writeencoding, ts.afterTransform); - } else { - // mark that we need a transform, so that any data that comes in - // will get processed, now that we've asked for it. - ts.needTransform = true; - } -}; - -Transform.prototype._destroy = function (err, cb) { - var _this2 = this; - - Duplex.prototype._destroy.call(this, err, function (err2) { - cb(err2); - _this2.emit('close'); - }); -}; - -function done(stream, er, data) { - if (er) return stream.emit('error', er); - - if (data != null) // single equals check for both `null` and `undefined` - stream.push(data); - - // if there's nothing in the write buffer, then that means - // that nothing more will ever be provided - if (stream._writableState.length) throw new Error('Calling transform done when ws.length != 0'); - - if (stream._transformState.transforming) throw new Error('Calling transform done when still transforming'); - - return stream.push(null); -} \ No newline at end of file diff --git a/deps/npm/node_modules/fs-write-stream-atomic/node_modules/readable-stream/lib/_stream_writable.js b/deps/npm/node_modules/fs-write-stream-atomic/node_modules/readable-stream/lib/_stream_writable.js deleted file mode 100644 index b3f4e85a2f6e35..00000000000000 --- a/deps/npm/node_modules/fs-write-stream-atomic/node_modules/readable-stream/lib/_stream_writable.js +++ /dev/null @@ -1,687 +0,0 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - -// A bit simpler than readable streams. -// Implement an async ._write(chunk, encoding, cb), and it'll handle all -// the drain event emission and buffering. - -'use strict'; - -/**/ - -var pna = require('process-nextick-args'); -/**/ - -module.exports = Writable; - -/* */ -function WriteReq(chunk, encoding, cb) { - this.chunk = chunk; - this.encoding = encoding; - this.callback = cb; - this.next = null; -} - -// It seems a linked list but it is not -// there will be only 2 of these for each stream -function CorkedRequest(state) { - var _this = this; - - this.next = null; - this.entry = null; - this.finish = function () { - onCorkedFinish(_this, state); - }; -} -/* */ - -/**/ -var asyncWrite = !process.browser && ['v0.10', 'v0.9.'].indexOf(process.version.slice(0, 5)) > -1 ? setImmediate : pna.nextTick; -/**/ - -/**/ -var Duplex; -/**/ - -Writable.WritableState = WritableState; - -/**/ -var util = require('core-util-is'); -util.inherits = require('inherits'); -/**/ - -/**/ -var internalUtil = { - deprecate: require('util-deprecate') -}; -/**/ - -/**/ -var Stream = require('./internal/streams/stream'); -/**/ - -/**/ - -var Buffer = require('safe-buffer').Buffer; -var OurUint8Array = global.Uint8Array || function () {}; -function _uint8ArrayToBuffer(chunk) { - return Buffer.from(chunk); -} -function _isUint8Array(obj) { - return Buffer.isBuffer(obj) || obj instanceof OurUint8Array; -} - -/**/ - -var destroyImpl = require('./internal/streams/destroy'); - -util.inherits(Writable, Stream); - -function nop() {} - -function WritableState(options, stream) { - Duplex = Duplex || require('./_stream_duplex'); - - options = options || {}; - - // Duplex streams are both readable and writable, but share - // the same options object. - // However, some cases require setting options to different - // values for the readable and the writable sides of the duplex stream. - // These options can be provided separately as readableXXX and writableXXX. - var isDuplex = stream instanceof Duplex; - - // object stream flag to indicate whether or not this stream - // contains buffers or objects. - this.objectMode = !!options.objectMode; - - if (isDuplex) this.objectMode = this.objectMode || !!options.writableObjectMode; - - // the point at which write() starts returning false - // Note: 0 is a valid value, means that we always return false if - // the entire buffer is not flushed immediately on write() - var hwm = options.highWaterMark; - var writableHwm = options.writableHighWaterMark; - var defaultHwm = this.objectMode ? 16 : 16 * 1024; - - if (hwm || hwm === 0) this.highWaterMark = hwm;else if (isDuplex && (writableHwm || writableHwm === 0)) this.highWaterMark = writableHwm;else this.highWaterMark = defaultHwm; - - // cast to ints. - this.highWaterMark = Math.floor(this.highWaterMark); - - // if _final has been called - this.finalCalled = false; - - // drain event flag. - this.needDrain = false; - // at the start of calling end() - this.ending = false; - // when end() has been called, and returned - this.ended = false; - // when 'finish' is emitted - this.finished = false; - - // has it been destroyed - this.destroyed = false; - - // should we decode strings into buffers before passing to _write? - // this is here so that some node-core streams can optimize string - // handling at a lower level. - var noDecode = options.decodeStrings === false; - this.decodeStrings = !noDecode; - - // Crypto is kind of old and crusty. Historically, its default string - // encoding is 'binary' so we have to make this configurable. - // Everything else in the universe uses 'utf8', though. - this.defaultEncoding = options.defaultEncoding || 'utf8'; - - // not an actual buffer we keep track of, but a measurement - // of how much we're waiting to get pushed to some underlying - // socket or file. - this.length = 0; - - // a flag to see when we're in the middle of a write. - this.writing = false; - - // when true all writes will be buffered until .uncork() call - this.corked = 0; - - // a flag to be able to tell if the onwrite cb is called immediately, - // or on a later tick. We set this to true at first, because any - // actions that shouldn't happen until "later" should generally also - // not happen before the first write call. - this.sync = true; - - // a flag to know if we're processing previously buffered items, which - // may call the _write() callback in the same tick, so that we don't - // end up in an overlapped onwrite situation. - this.bufferProcessing = false; - - // the callback that's passed to _write(chunk,cb) - this.onwrite = function (er) { - onwrite(stream, er); - }; - - // the callback that the user supplies to write(chunk,encoding,cb) - this.writecb = null; - - // the amount that is being written when _write is called. - this.writelen = 0; - - this.bufferedRequest = null; - this.lastBufferedRequest = null; - - // number of pending user-supplied write callbacks - // this must be 0 before 'finish' can be emitted - this.pendingcb = 0; - - // emit prefinish if the only thing we're waiting for is _write cbs - // This is relevant for synchronous Transform streams - this.prefinished = false; - - // True if the error was already emitted and should not be thrown again - this.errorEmitted = false; - - // count buffered requests - this.bufferedRequestCount = 0; - - // allocate the first CorkedRequest, there is always - // one allocated and free to use, and we maintain at most two - this.corkedRequestsFree = new CorkedRequest(this); -} - -WritableState.prototype.getBuffer = function getBuffer() { - var current = this.bufferedRequest; - var out = []; - while (current) { - out.push(current); - current = current.next; - } - return out; -}; - -(function () { - try { - Object.defineProperty(WritableState.prototype, 'buffer', { - get: internalUtil.deprecate(function () { - return this.getBuffer(); - }, '_writableState.buffer is deprecated. Use _writableState.getBuffer ' + 'instead.', 'DEP0003') - }); - } catch (_) {} -})(); - -// Test _writableState for inheritance to account for Duplex streams, -// whose prototype chain only points to Readable. -var realHasInstance; -if (typeof Symbol === 'function' && Symbol.hasInstance && typeof Function.prototype[Symbol.hasInstance] === 'function') { - realHasInstance = Function.prototype[Symbol.hasInstance]; - Object.defineProperty(Writable, Symbol.hasInstance, { - value: function (object) { - if (realHasInstance.call(this, object)) return true; - if (this !== Writable) return false; - - return object && object._writableState instanceof WritableState; - } - }); -} else { - realHasInstance = function (object) { - return object instanceof this; - }; -} - -function Writable(options) { - Duplex = Duplex || require('./_stream_duplex'); - - // Writable ctor is applied to Duplexes, too. - // `realHasInstance` is necessary because using plain `instanceof` - // would return false, as no `_writableState` property is attached. - - // Trying to use the custom `instanceof` for Writable here will also break the - // Node.js LazyTransform implementation, which has a non-trivial getter for - // `_writableState` that would lead to infinite recursion. - if (!realHasInstance.call(Writable, this) && !(this instanceof Duplex)) { - return new Writable(options); - } - - this._writableState = new WritableState(options, this); - - // legacy. - this.writable = true; - - if (options) { - if (typeof options.write === 'function') this._write = options.write; - - if (typeof options.writev === 'function') this._writev = options.writev; - - if (typeof options.destroy === 'function') this._destroy = options.destroy; - - if (typeof options.final === 'function') this._final = options.final; - } - - Stream.call(this); -} - -// Otherwise people can pipe Writable streams, which is just wrong. -Writable.prototype.pipe = function () { - this.emit('error', new Error('Cannot pipe, not readable')); -}; - -function writeAfterEnd(stream, cb) { - var er = new Error('write after end'); - // TODO: defer error events consistently everywhere, not just the cb - stream.emit('error', er); - pna.nextTick(cb, er); -} - -// Checks that a user-supplied chunk is valid, especially for the particular -// mode the stream is in. Currently this means that `null` is never accepted -// and undefined/non-string values are only allowed in object mode. -function validChunk(stream, state, chunk, cb) { - var valid = true; - var er = false; - - if (chunk === null) { - er = new TypeError('May not write null values to stream'); - } else if (typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) { - er = new TypeError('Invalid non-string/buffer chunk'); - } - if (er) { - stream.emit('error', er); - pna.nextTick(cb, er); - valid = false; - } - return valid; -} - -Writable.prototype.write = function (chunk, encoding, cb) { - var state = this._writableState; - var ret = false; - var isBuf = !state.objectMode && _isUint8Array(chunk); - - if (isBuf && !Buffer.isBuffer(chunk)) { - chunk = _uint8ArrayToBuffer(chunk); - } - - if (typeof encoding === 'function') { - cb = encoding; - encoding = null; - } - - if (isBuf) encoding = 'buffer';else if (!encoding) encoding = state.defaultEncoding; - - if (typeof cb !== 'function') cb = nop; - - if (state.ended) writeAfterEnd(this, cb);else if (isBuf || validChunk(this, state, chunk, cb)) { - state.pendingcb++; - ret = writeOrBuffer(this, state, isBuf, chunk, encoding, cb); - } - - return ret; -}; - -Writable.prototype.cork = function () { - var state = this._writableState; - - state.corked++; -}; - -Writable.prototype.uncork = function () { - var state = this._writableState; - - if (state.corked) { - state.corked--; - - if (!state.writing && !state.corked && !state.finished && !state.bufferProcessing && state.bufferedRequest) clearBuffer(this, state); - } -}; - -Writable.prototype.setDefaultEncoding = function setDefaultEncoding(encoding) { - // node::ParseEncoding() requires lower case. - if (typeof encoding === 'string') encoding = encoding.toLowerCase(); - if (!(['hex', 'utf8', 'utf-8', 'ascii', 'binary', 'base64', 'ucs2', 'ucs-2', 'utf16le', 'utf-16le', 'raw'].indexOf((encoding + '').toLowerCase()) > -1)) throw new TypeError('Unknown encoding: ' + encoding); - this._writableState.defaultEncoding = encoding; - return this; -}; - -function decodeChunk(state, chunk, encoding) { - if (!state.objectMode && state.decodeStrings !== false && typeof chunk === 'string') { - chunk = Buffer.from(chunk, encoding); - } - return chunk; -} - -Object.defineProperty(Writable.prototype, 'writableHighWaterMark', { - // making it explicit this property is not enumerable - // because otherwise some prototype manipulation in - // userland will fail - enumerable: false, - get: function () { - return this._writableState.highWaterMark; - } -}); - -// if we're already writing something, then just put this -// in the queue, and wait our turn. Otherwise, call _write -// If we return false, then we need a drain event, so set that flag. -function writeOrBuffer(stream, state, isBuf, chunk, encoding, cb) { - if (!isBuf) { - var newChunk = decodeChunk(state, chunk, encoding); - if (chunk !== newChunk) { - isBuf = true; - encoding = 'buffer'; - chunk = newChunk; - } - } - var len = state.objectMode ? 1 : chunk.length; - - state.length += len; - - var ret = state.length < state.highWaterMark; - // we must ensure that previous needDrain will not be reset to false. - if (!ret) state.needDrain = true; - - if (state.writing || state.corked) { - var last = state.lastBufferedRequest; - state.lastBufferedRequest = { - chunk: chunk, - encoding: encoding, - isBuf: isBuf, - callback: cb, - next: null - }; - if (last) { - last.next = state.lastBufferedRequest; - } else { - state.bufferedRequest = state.lastBufferedRequest; - } - state.bufferedRequestCount += 1; - } else { - doWrite(stream, state, false, len, chunk, encoding, cb); - } - - return ret; -} - -function doWrite(stream, state, writev, len, chunk, encoding, cb) { - state.writelen = len; - state.writecb = cb; - state.writing = true; - state.sync = true; - if (writev) stream._writev(chunk, state.onwrite);else stream._write(chunk, encoding, state.onwrite); - state.sync = false; -} - -function onwriteError(stream, state, sync, er, cb) { - --state.pendingcb; - - if (sync) { - // defer the callback if we are being called synchronously - // to avoid piling up things on the stack - pna.nextTick(cb, er); - // this can emit finish, and it will always happen - // after error - pna.nextTick(finishMaybe, stream, state); - stream._writableState.errorEmitted = true; - stream.emit('error', er); - } else { - // the caller expect this to happen before if - // it is async - cb(er); - stream._writableState.errorEmitted = true; - stream.emit('error', er); - // this can emit finish, but finish must - // always follow error - finishMaybe(stream, state); - } -} - -function onwriteStateUpdate(state) { - state.writing = false; - state.writecb = null; - state.length -= state.writelen; - state.writelen = 0; -} - -function onwrite(stream, er) { - var state = stream._writableState; - var sync = state.sync; - var cb = state.writecb; - - onwriteStateUpdate(state); - - if (er) onwriteError(stream, state, sync, er, cb);else { - // Check if we're actually ready to finish, but don't emit yet - var finished = needFinish(state); - - if (!finished && !state.corked && !state.bufferProcessing && state.bufferedRequest) { - clearBuffer(stream, state); - } - - if (sync) { - /**/ - asyncWrite(afterWrite, stream, state, finished, cb); - /**/ - } else { - afterWrite(stream, state, finished, cb); - } - } -} - -function afterWrite(stream, state, finished, cb) { - if (!finished) onwriteDrain(stream, state); - state.pendingcb--; - cb(); - finishMaybe(stream, state); -} - -// Must force callback to be called on nextTick, so that we don't -// emit 'drain' before the write() consumer gets the 'false' return -// value, and has a chance to attach a 'drain' listener. -function onwriteDrain(stream, state) { - if (state.length === 0 && state.needDrain) { - state.needDrain = false; - stream.emit('drain'); - } -} - -// if there's something in the buffer waiting, then process it -function clearBuffer(stream, state) { - state.bufferProcessing = true; - var entry = state.bufferedRequest; - - if (stream._writev && entry && entry.next) { - // Fast case, write everything using _writev() - var l = state.bufferedRequestCount; - var buffer = new Array(l); - var holder = state.corkedRequestsFree; - holder.entry = entry; - - var count = 0; - var allBuffers = true; - while (entry) { - buffer[count] = entry; - if (!entry.isBuf) allBuffers = false; - entry = entry.next; - count += 1; - } - buffer.allBuffers = allBuffers; - - doWrite(stream, state, true, state.length, buffer, '', holder.finish); - - // doWrite is almost always async, defer these to save a bit of time - // as the hot path ends with doWrite - state.pendingcb++; - state.lastBufferedRequest = null; - if (holder.next) { - state.corkedRequestsFree = holder.next; - holder.next = null; - } else { - state.corkedRequestsFree = new CorkedRequest(state); - } - state.bufferedRequestCount = 0; - } else { - // Slow case, write chunks one-by-one - while (entry) { - var chunk = entry.chunk; - var encoding = entry.encoding; - var cb = entry.callback; - var len = state.objectMode ? 1 : chunk.length; - - doWrite(stream, state, false, len, chunk, encoding, cb); - entry = entry.next; - state.bufferedRequestCount--; - // if we didn't call the onwrite immediately, then - // it means that we need to wait until it does. - // also, that means that the chunk and cb are currently - // being processed, so move the buffer counter past them. - if (state.writing) { - break; - } - } - - if (entry === null) state.lastBufferedRequest = null; - } - - state.bufferedRequest = entry; - state.bufferProcessing = false; -} - -Writable.prototype._write = function (chunk, encoding, cb) { - cb(new Error('_write() is not implemented')); -}; - -Writable.prototype._writev = null; - -Writable.prototype.end = function (chunk, encoding, cb) { - var state = this._writableState; - - if (typeof chunk === 'function') { - cb = chunk; - chunk = null; - encoding = null; - } else if (typeof encoding === 'function') { - cb = encoding; - encoding = null; - } - - if (chunk !== null && chunk !== undefined) this.write(chunk, encoding); - - // .end() fully uncorks - if (state.corked) { - state.corked = 1; - this.uncork(); - } - - // ignore unnecessary end() calls. - if (!state.ending && !state.finished) endWritable(this, state, cb); -}; - -function needFinish(state) { - return state.ending && state.length === 0 && state.bufferedRequest === null && !state.finished && !state.writing; -} -function callFinal(stream, state) { - stream._final(function (err) { - state.pendingcb--; - if (err) { - stream.emit('error', err); - } - state.prefinished = true; - stream.emit('prefinish'); - finishMaybe(stream, state); - }); -} -function prefinish(stream, state) { - if (!state.prefinished && !state.finalCalled) { - if (typeof stream._final === 'function') { - state.pendingcb++; - state.finalCalled = true; - pna.nextTick(callFinal, stream, state); - } else { - state.prefinished = true; - stream.emit('prefinish'); - } - } -} - -function finishMaybe(stream, state) { - var need = needFinish(state); - if (need) { - prefinish(stream, state); - if (state.pendingcb === 0) { - state.finished = true; - stream.emit('finish'); - } - } - return need; -} - -function endWritable(stream, state, cb) { - state.ending = true; - finishMaybe(stream, state); - if (cb) { - if (state.finished) pna.nextTick(cb);else stream.once('finish', cb); - } - state.ended = true; - stream.writable = false; -} - -function onCorkedFinish(corkReq, state, err) { - var entry = corkReq.entry; - corkReq.entry = null; - while (entry) { - var cb = entry.callback; - state.pendingcb--; - cb(err); - entry = entry.next; - } - if (state.corkedRequestsFree) { - state.corkedRequestsFree.next = corkReq; - } else { - state.corkedRequestsFree = corkReq; - } -} - -Object.defineProperty(Writable.prototype, 'destroyed', { - get: function () { - if (this._writableState === undefined) { - return false; - } - return this._writableState.destroyed; - }, - set: function (value) { - // we ignore the value if the stream - // has not been initialized yet - if (!this._writableState) { - return; - } - - // backward compatibility, the user is explicitly - // managing destroyed - this._writableState.destroyed = value; - } -}); - -Writable.prototype.destroy = destroyImpl.destroy; -Writable.prototype._undestroy = destroyImpl.undestroy; -Writable.prototype._destroy = function (err, cb) { - this.end(); - cb(err); -}; \ No newline at end of file diff --git a/deps/npm/node_modules/fs-write-stream-atomic/node_modules/readable-stream/lib/internal/streams/BufferList.js b/deps/npm/node_modules/fs-write-stream-atomic/node_modules/readable-stream/lib/internal/streams/BufferList.js deleted file mode 100644 index aefc68bd90b9c2..00000000000000 --- a/deps/npm/node_modules/fs-write-stream-atomic/node_modules/readable-stream/lib/internal/streams/BufferList.js +++ /dev/null @@ -1,79 +0,0 @@ -'use strict'; - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -var Buffer = require('safe-buffer').Buffer; -var util = require('util'); - -function copyBuffer(src, target, offset) { - src.copy(target, offset); -} - -module.exports = function () { - function BufferList() { - _classCallCheck(this, BufferList); - - this.head = null; - this.tail = null; - this.length = 0; - } - - BufferList.prototype.push = function push(v) { - var entry = { data: v, next: null }; - if (this.length > 0) this.tail.next = entry;else this.head = entry; - this.tail = entry; - ++this.length; - }; - - BufferList.prototype.unshift = function unshift(v) { - var entry = { data: v, next: this.head }; - if (this.length === 0) this.tail = entry; - this.head = entry; - ++this.length; - }; - - BufferList.prototype.shift = function shift() { - if (this.length === 0) return; - var ret = this.head.data; - if (this.length === 1) this.head = this.tail = null;else this.head = this.head.next; - --this.length; - return ret; - }; - - BufferList.prototype.clear = function clear() { - this.head = this.tail = null; - this.length = 0; - }; - - BufferList.prototype.join = function join(s) { - if (this.length === 0) return ''; - var p = this.head; - var ret = '' + p.data; - while (p = p.next) { - ret += s + p.data; - }return ret; - }; - - BufferList.prototype.concat = function concat(n) { - if (this.length === 0) return Buffer.alloc(0); - if (this.length === 1) return this.head.data; - var ret = Buffer.allocUnsafe(n >>> 0); - var p = this.head; - var i = 0; - while (p) { - copyBuffer(p.data, ret, i); - i += p.data.length; - p = p.next; - } - return ret; - }; - - return BufferList; -}(); - -if (util && util.inspect && util.inspect.custom) { - module.exports.prototype[util.inspect.custom] = function () { - var obj = util.inspect({ length: this.length }); - return this.constructor.name + ' ' + obj; - }; -} \ No newline at end of file diff --git a/deps/npm/node_modules/fs-write-stream-atomic/node_modules/readable-stream/lib/internal/streams/destroy.js b/deps/npm/node_modules/fs-write-stream-atomic/node_modules/readable-stream/lib/internal/streams/destroy.js deleted file mode 100644 index 5a0a0d88cec6f3..00000000000000 --- a/deps/npm/node_modules/fs-write-stream-atomic/node_modules/readable-stream/lib/internal/streams/destroy.js +++ /dev/null @@ -1,74 +0,0 @@ -'use strict'; - -/**/ - -var pna = require('process-nextick-args'); -/**/ - -// undocumented cb() API, needed for core, not for public API -function destroy(err, cb) { - var _this = this; - - var readableDestroyed = this._readableState && this._readableState.destroyed; - var writableDestroyed = this._writableState && this._writableState.destroyed; - - if (readableDestroyed || writableDestroyed) { - if (cb) { - cb(err); - } else if (err && (!this._writableState || !this._writableState.errorEmitted)) { - pna.nextTick(emitErrorNT, this, err); - } - return this; - } - - // we set destroyed to true before firing error callbacks in order - // to make it re-entrance safe in case destroy() is called within callbacks - - if (this._readableState) { - this._readableState.destroyed = true; - } - - // if this is a duplex stream mark the writable part as destroyed as well - if (this._writableState) { - this._writableState.destroyed = true; - } - - this._destroy(err || null, function (err) { - if (!cb && err) { - pna.nextTick(emitErrorNT, _this, err); - if (_this._writableState) { - _this._writableState.errorEmitted = true; - } - } else if (cb) { - cb(err); - } - }); - - return this; -} - -function undestroy() { - if (this._readableState) { - this._readableState.destroyed = false; - this._readableState.reading = false; - this._readableState.ended = false; - this._readableState.endEmitted = false; - } - - if (this._writableState) { - this._writableState.destroyed = false; - this._writableState.ended = false; - this._writableState.ending = false; - this._writableState.finished = false; - this._writableState.errorEmitted = false; - } -} - -function emitErrorNT(self, err) { - self.emit('error', err); -} - -module.exports = { - destroy: destroy, - undestroy: undestroy -}; \ No newline at end of file diff --git a/deps/npm/node_modules/fs-write-stream-atomic/node_modules/readable-stream/lib/internal/streams/stream-browser.js b/deps/npm/node_modules/fs-write-stream-atomic/node_modules/readable-stream/lib/internal/streams/stream-browser.js deleted file mode 100644 index 9332a3fdae7060..00000000000000 --- a/deps/npm/node_modules/fs-write-stream-atomic/node_modules/readable-stream/lib/internal/streams/stream-browser.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('events').EventEmitter; diff --git a/deps/npm/node_modules/fs-write-stream-atomic/node_modules/readable-stream/lib/internal/streams/stream.js b/deps/npm/node_modules/fs-write-stream-atomic/node_modules/readable-stream/lib/internal/streams/stream.js deleted file mode 100644 index ce2ad5b6ee57f4..00000000000000 --- a/deps/npm/node_modules/fs-write-stream-atomic/node_modules/readable-stream/lib/internal/streams/stream.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('stream'); diff --git a/deps/npm/node_modules/fs-write-stream-atomic/node_modules/readable-stream/package.json b/deps/npm/node_modules/fs-write-stream-atomic/node_modules/readable-stream/package.json deleted file mode 100644 index 6ef1cd32a9de4e..00000000000000 --- a/deps/npm/node_modules/fs-write-stream-atomic/node_modules/readable-stream/package.json +++ /dev/null @@ -1,81 +0,0 @@ -{ - "_from": "readable-stream@1 || 2", - "_id": "readable-stream@2.3.6", - "_inBundle": false, - "_integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", - "_location": "/fs-write-stream-atomic/readable-stream", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "readable-stream@1 || 2", - "name": "readable-stream", - "escapedName": "readable-stream", - "rawSpec": "1 || 2", - "saveSpec": null, - "fetchSpec": "1 || 2" - }, - "_requiredBy": [ - "/fs-write-stream-atomic" - ], - "_resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", - "_shasum": "b11c27d88b8ff1fbe070643cf94b0c79ae1b0aaf", - "_spec": "readable-stream@1 || 2", - "_where": "/Users/aeschright/code/cli/node_modules/fs-write-stream-atomic", - "browser": { - "util": false, - "./readable.js": "./readable-browser.js", - "./writable.js": "./writable-browser.js", - "./duplex.js": "./duplex-browser.js", - "./lib/internal/streams/stream.js": "./lib/internal/streams/stream-browser.js" - }, - "bugs": { - "url": "https://github.com/nodejs/readable-stream/issues" - }, - "bundleDependencies": false, - "dependencies": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - }, - "deprecated": false, - "description": "Streams3, a user-land copy of the stream library from Node.js", - "devDependencies": { - "assert": "^1.4.0", - "babel-polyfill": "^6.9.1", - "buffer": "^4.9.0", - "lolex": "^2.3.2", - "nyc": "^6.4.0", - "tap": "^0.7.0", - "tape": "^4.8.0" - }, - "homepage": "https://github.com/nodejs/readable-stream#readme", - "keywords": [ - "readable", - "stream", - "pipe" - ], - "license": "MIT", - "main": "readable.js", - "name": "readable-stream", - "nyc": { - "include": [ - "lib/**.js" - ] - }, - "repository": { - "type": "git", - "url": "git://github.com/nodejs/readable-stream.git" - }, - "scripts": { - "ci": "tap test/parallel/*.js test/ours/*.js --tap | tee test.tap && node test/verify-dependencies.js", - "cover": "nyc npm test", - "report": "nyc report --reporter=lcov", - "test": "tap test/parallel/*.js test/ours/*.js && node test/verify-dependencies.js" - }, - "version": "2.3.6" -} diff --git a/deps/npm/node_modules/fs-write-stream-atomic/node_modules/readable-stream/passthrough.js b/deps/npm/node_modules/fs-write-stream-atomic/node_modules/readable-stream/passthrough.js deleted file mode 100644 index ffd791d7ff275a..00000000000000 --- a/deps/npm/node_modules/fs-write-stream-atomic/node_modules/readable-stream/passthrough.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./readable').PassThrough diff --git a/deps/npm/node_modules/fs-write-stream-atomic/node_modules/readable-stream/readable-browser.js b/deps/npm/node_modules/fs-write-stream-atomic/node_modules/readable-stream/readable-browser.js deleted file mode 100644 index e50372592ee6c6..00000000000000 --- a/deps/npm/node_modules/fs-write-stream-atomic/node_modules/readable-stream/readable-browser.js +++ /dev/null @@ -1,7 +0,0 @@ -exports = module.exports = require('./lib/_stream_readable.js'); -exports.Stream = exports; -exports.Readable = exports; -exports.Writable = require('./lib/_stream_writable.js'); -exports.Duplex = require('./lib/_stream_duplex.js'); -exports.Transform = require('./lib/_stream_transform.js'); -exports.PassThrough = require('./lib/_stream_passthrough.js'); diff --git a/deps/npm/node_modules/fs-write-stream-atomic/node_modules/readable-stream/readable.js b/deps/npm/node_modules/fs-write-stream-atomic/node_modules/readable-stream/readable.js deleted file mode 100644 index ec89ec53306497..00000000000000 --- a/deps/npm/node_modules/fs-write-stream-atomic/node_modules/readable-stream/readable.js +++ /dev/null @@ -1,19 +0,0 @@ -var Stream = require('stream'); -if (process.env.READABLE_STREAM === 'disable' && Stream) { - module.exports = Stream; - exports = module.exports = Stream.Readable; - exports.Readable = Stream.Readable; - exports.Writable = Stream.Writable; - exports.Duplex = Stream.Duplex; - exports.Transform = Stream.Transform; - exports.PassThrough = Stream.PassThrough; - exports.Stream = Stream; -} else { - exports = module.exports = require('./lib/_stream_readable.js'); - exports.Stream = Stream || exports; - exports.Readable = exports; - exports.Writable = require('./lib/_stream_writable.js'); - exports.Duplex = require('./lib/_stream_duplex.js'); - exports.Transform = require('./lib/_stream_transform.js'); - exports.PassThrough = require('./lib/_stream_passthrough.js'); -} diff --git a/deps/npm/node_modules/fs-write-stream-atomic/node_modules/readable-stream/transform.js b/deps/npm/node_modules/fs-write-stream-atomic/node_modules/readable-stream/transform.js deleted file mode 100644 index b1baba26da03dc..00000000000000 --- a/deps/npm/node_modules/fs-write-stream-atomic/node_modules/readable-stream/transform.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./readable').Transform diff --git a/deps/npm/node_modules/fs-write-stream-atomic/node_modules/readable-stream/writable-browser.js b/deps/npm/node_modules/fs-write-stream-atomic/node_modules/readable-stream/writable-browser.js deleted file mode 100644 index ebdde6a85dcb19..00000000000000 --- a/deps/npm/node_modules/fs-write-stream-atomic/node_modules/readable-stream/writable-browser.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./lib/_stream_writable.js'); diff --git a/deps/npm/node_modules/fs-write-stream-atomic/node_modules/readable-stream/writable.js b/deps/npm/node_modules/fs-write-stream-atomic/node_modules/readable-stream/writable.js deleted file mode 100644 index 3211a6f80d1abc..00000000000000 --- a/deps/npm/node_modules/fs-write-stream-atomic/node_modules/readable-stream/writable.js +++ /dev/null @@ -1,8 +0,0 @@ -var Stream = require("stream") -var Writable = require("./lib/_stream_writable.js") - -if (process.env.READABLE_STREAM === 'disable') { - module.exports = Stream && Stream.Writable || Writable -} else { - module.exports = Writable -} diff --git a/deps/npm/node_modules/fs-write-stream-atomic/node_modules/string_decoder/.travis.yml b/deps/npm/node_modules/fs-write-stream-atomic/node_modules/string_decoder/.travis.yml deleted file mode 100644 index 3347a725465058..00000000000000 --- a/deps/npm/node_modules/fs-write-stream-atomic/node_modules/string_decoder/.travis.yml +++ /dev/null @@ -1,50 +0,0 @@ -sudo: false -language: node_js -before_install: - - npm install -g npm@2 - - test $NPM_LEGACY && npm install -g npm@latest-3 || npm install npm -g -notifications: - email: false -matrix: - fast_finish: true - include: - - node_js: '0.8' - env: - - TASK=test - - NPM_LEGACY=true - - node_js: '0.10' - env: - - TASK=test - - NPM_LEGACY=true - - node_js: '0.11' - env: - - TASK=test - - NPM_LEGACY=true - - node_js: '0.12' - env: - - TASK=test - - NPM_LEGACY=true - - node_js: 1 - env: - - TASK=test - - NPM_LEGACY=true - - node_js: 2 - env: - - TASK=test - - NPM_LEGACY=true - - node_js: 3 - env: - - TASK=test - - NPM_LEGACY=true - - node_js: 4 - env: TASK=test - - node_js: 5 - env: TASK=test - - node_js: 6 - env: TASK=test - - node_js: 7 - env: TASK=test - - node_js: 8 - env: TASK=test - - node_js: 9 - env: TASK=test diff --git a/deps/npm/node_modules/fs-write-stream-atomic/node_modules/string_decoder/LICENSE b/deps/npm/node_modules/fs-write-stream-atomic/node_modules/string_decoder/LICENSE deleted file mode 100644 index 778edb20730ef4..00000000000000 --- a/deps/npm/node_modules/fs-write-stream-atomic/node_modules/string_decoder/LICENSE +++ /dev/null @@ -1,48 +0,0 @@ -Node.js is licensed for use as follows: - -""" -Copyright Node.js contributors. All rights reserved. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to -deal in the Software without restriction, including without limitation the -rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -sell copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -IN THE SOFTWARE. -""" - -This license applies to parts of Node.js originating from the -https://github.com/joyent/node repository: - -""" -Copyright Joyent, Inc. and other Node contributors. All rights reserved. -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to -deal in the Software without restriction, including without limitation the -rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -sell copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -IN THE SOFTWARE. -""" - diff --git a/deps/npm/node_modules/fs-write-stream-atomic/node_modules/string_decoder/README.md b/deps/npm/node_modules/fs-write-stream-atomic/node_modules/string_decoder/README.md deleted file mode 100644 index 5fd58315ed5880..00000000000000 --- a/deps/npm/node_modules/fs-write-stream-atomic/node_modules/string_decoder/README.md +++ /dev/null @@ -1,47 +0,0 @@ -# string_decoder - -***Node-core v8.9.4 string_decoder for userland*** - - -[![NPM](https://nodei.co/npm/string_decoder.png?downloads=true&downloadRank=true)](https://nodei.co/npm/string_decoder/) -[![NPM](https://nodei.co/npm-dl/string_decoder.png?&months=6&height=3)](https://nodei.co/npm/string_decoder/) - - -```bash -npm install --save string_decoder -``` - -***Node-core string_decoder for userland*** - -This package is a mirror of the string_decoder implementation in Node-core. - -Full documentation may be found on the [Node.js website](https://nodejs.org/dist/v8.9.4/docs/api/). - -As of version 1.0.0 **string_decoder** uses semantic versioning. - -## Previous versions - -Previous version numbers match the versions found in Node core, e.g. 0.10.24 matches Node 0.10.24, likewise 0.11.10 matches Node 0.11.10. - -## Update - -The *build/* directory contains a build script that will scrape the source from the [nodejs/node](https://github.com/nodejs/node) repo given a specific Node version. - -## Streams Working Group - -`string_decoder` is maintained by the Streams Working Group, which -oversees the development and maintenance of the Streams API within -Node.js. The responsibilities of the Streams Working Group include: - -* Addressing stream issues on the Node.js issue tracker. -* Authoring and editing stream documentation within the Node.js project. -* Reviewing changes to stream subclasses within the Node.js project. -* Redirecting changes to streams from the Node.js project to this - project. -* Assisting in the implementation of stream providers within Node.js. -* Recommending versions of `readable-stream` to be included in Node.js. -* Messaging about the future of streams to give the community advance - notice of changes. - -See [readable-stream](https://github.com/nodejs/readable-stream) for -more details. diff --git a/deps/npm/node_modules/fs-write-stream-atomic/node_modules/string_decoder/lib/string_decoder.js b/deps/npm/node_modules/fs-write-stream-atomic/node_modules/string_decoder/lib/string_decoder.js deleted file mode 100644 index 2e89e63f7933e4..00000000000000 --- a/deps/npm/node_modules/fs-write-stream-atomic/node_modules/string_decoder/lib/string_decoder.js +++ /dev/null @@ -1,296 +0,0 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - -'use strict'; - -/**/ - -var Buffer = require('safe-buffer').Buffer; -/**/ - -var isEncoding = Buffer.isEncoding || function (encoding) { - encoding = '' + encoding; - switch (encoding && encoding.toLowerCase()) { - case 'hex':case 'utf8':case 'utf-8':case 'ascii':case 'binary':case 'base64':case 'ucs2':case 'ucs-2':case 'utf16le':case 'utf-16le':case 'raw': - return true; - default: - return false; - } -}; - -function _normalizeEncoding(enc) { - if (!enc) return 'utf8'; - var retried; - while (true) { - switch (enc) { - case 'utf8': - case 'utf-8': - return 'utf8'; - case 'ucs2': - case 'ucs-2': - case 'utf16le': - case 'utf-16le': - return 'utf16le'; - case 'latin1': - case 'binary': - return 'latin1'; - case 'base64': - case 'ascii': - case 'hex': - return enc; - default: - if (retried) return; // undefined - enc = ('' + enc).toLowerCase(); - retried = true; - } - } -}; - -// Do not cache `Buffer.isEncoding` when checking encoding names as some -// modules monkey-patch it to support additional encodings -function normalizeEncoding(enc) { - var nenc = _normalizeEncoding(enc); - if (typeof nenc !== 'string' && (Buffer.isEncoding === isEncoding || !isEncoding(enc))) throw new Error('Unknown encoding: ' + enc); - return nenc || enc; -} - -// StringDecoder provides an interface for efficiently splitting a series of -// buffers into a series of JS strings without breaking apart multi-byte -// characters. -exports.StringDecoder = StringDecoder; -function StringDecoder(encoding) { - this.encoding = normalizeEncoding(encoding); - var nb; - switch (this.encoding) { - case 'utf16le': - this.text = utf16Text; - this.end = utf16End; - nb = 4; - break; - case 'utf8': - this.fillLast = utf8FillLast; - nb = 4; - break; - case 'base64': - this.text = base64Text; - this.end = base64End; - nb = 3; - break; - default: - this.write = simpleWrite; - this.end = simpleEnd; - return; - } - this.lastNeed = 0; - this.lastTotal = 0; - this.lastChar = Buffer.allocUnsafe(nb); -} - -StringDecoder.prototype.write = function (buf) { - if (buf.length === 0) return ''; - var r; - var i; - if (this.lastNeed) { - r = this.fillLast(buf); - if (r === undefined) return ''; - i = this.lastNeed; - this.lastNeed = 0; - } else { - i = 0; - } - if (i < buf.length) return r ? r + this.text(buf, i) : this.text(buf, i); - return r || ''; -}; - -StringDecoder.prototype.end = utf8End; - -// Returns only complete characters in a Buffer -StringDecoder.prototype.text = utf8Text; - -// Attempts to complete a partial non-UTF-8 character using bytes from a Buffer -StringDecoder.prototype.fillLast = function (buf) { - if (this.lastNeed <= buf.length) { - buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, this.lastNeed); - return this.lastChar.toString(this.encoding, 0, this.lastTotal); - } - buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, buf.length); - this.lastNeed -= buf.length; -}; - -// Checks the type of a UTF-8 byte, whether it's ASCII, a leading byte, or a -// continuation byte. If an invalid byte is detected, -2 is returned. -function utf8CheckByte(byte) { - if (byte <= 0x7F) return 0;else if (byte >> 5 === 0x06) return 2;else if (byte >> 4 === 0x0E) return 3;else if (byte >> 3 === 0x1E) return 4; - return byte >> 6 === 0x02 ? -1 : -2; -} - -// Checks at most 3 bytes at the end of a Buffer in order to detect an -// incomplete multi-byte UTF-8 character. The total number of bytes (2, 3, or 4) -// needed to complete the UTF-8 character (if applicable) are returned. -function utf8CheckIncomplete(self, buf, i) { - var j = buf.length - 1; - if (j < i) return 0; - var nb = utf8CheckByte(buf[j]); - if (nb >= 0) { - if (nb > 0) self.lastNeed = nb - 1; - return nb; - } - if (--j < i || nb === -2) return 0; - nb = utf8CheckByte(buf[j]); - if (nb >= 0) { - if (nb > 0) self.lastNeed = nb - 2; - return nb; - } - if (--j < i || nb === -2) return 0; - nb = utf8CheckByte(buf[j]); - if (nb >= 0) { - if (nb > 0) { - if (nb === 2) nb = 0;else self.lastNeed = nb - 3; - } - return nb; - } - return 0; -} - -// Validates as many continuation bytes for a multi-byte UTF-8 character as -// needed or are available. If we see a non-continuation byte where we expect -// one, we "replace" the validated continuation bytes we've seen so far with -// a single UTF-8 replacement character ('\ufffd'), to match v8's UTF-8 decoding -// behavior. The continuation byte check is included three times in the case -// where all of the continuation bytes for a character exist in the same buffer. -// It is also done this way as a slight performance increase instead of using a -// loop. -function utf8CheckExtraBytes(self, buf, p) { - if ((buf[0] & 0xC0) !== 0x80) { - self.lastNeed = 0; - return '\ufffd'; - } - if (self.lastNeed > 1 && buf.length > 1) { - if ((buf[1] & 0xC0) !== 0x80) { - self.lastNeed = 1; - return '\ufffd'; - } - if (self.lastNeed > 2 && buf.length > 2) { - if ((buf[2] & 0xC0) !== 0x80) { - self.lastNeed = 2; - return '\ufffd'; - } - } - } -} - -// Attempts to complete a multi-byte UTF-8 character using bytes from a Buffer. -function utf8FillLast(buf) { - var p = this.lastTotal - this.lastNeed; - var r = utf8CheckExtraBytes(this, buf, p); - if (r !== undefined) return r; - if (this.lastNeed <= buf.length) { - buf.copy(this.lastChar, p, 0, this.lastNeed); - return this.lastChar.toString(this.encoding, 0, this.lastTotal); - } - buf.copy(this.lastChar, p, 0, buf.length); - this.lastNeed -= buf.length; -} - -// Returns all complete UTF-8 characters in a Buffer. If the Buffer ended on a -// partial character, the character's bytes are buffered until the required -// number of bytes are available. -function utf8Text(buf, i) { - var total = utf8CheckIncomplete(this, buf, i); - if (!this.lastNeed) return buf.toString('utf8', i); - this.lastTotal = total; - var end = buf.length - (total - this.lastNeed); - buf.copy(this.lastChar, 0, end); - return buf.toString('utf8', i, end); -} - -// For UTF-8, a replacement character is added when ending on a partial -// character. -function utf8End(buf) { - var r = buf && buf.length ? this.write(buf) : ''; - if (this.lastNeed) return r + '\ufffd'; - return r; -} - -// UTF-16LE typically needs two bytes per character, but even if we have an even -// number of bytes available, we need to check if we end on a leading/high -// surrogate. In that case, we need to wait for the next two bytes in order to -// decode the last character properly. -function utf16Text(buf, i) { - if ((buf.length - i) % 2 === 0) { - var r = buf.toString('utf16le', i); - if (r) { - var c = r.charCodeAt(r.length - 1); - if (c >= 0xD800 && c <= 0xDBFF) { - this.lastNeed = 2; - this.lastTotal = 4; - this.lastChar[0] = buf[buf.length - 2]; - this.lastChar[1] = buf[buf.length - 1]; - return r.slice(0, -1); - } - } - return r; - } - this.lastNeed = 1; - this.lastTotal = 2; - this.lastChar[0] = buf[buf.length - 1]; - return buf.toString('utf16le', i, buf.length - 1); -} - -// For UTF-16LE we do not explicitly append special replacement characters if we -// end on a partial character, we simply let v8 handle that. -function utf16End(buf) { - var r = buf && buf.length ? this.write(buf) : ''; - if (this.lastNeed) { - var end = this.lastTotal - this.lastNeed; - return r + this.lastChar.toString('utf16le', 0, end); - } - return r; -} - -function base64Text(buf, i) { - var n = (buf.length - i) % 3; - if (n === 0) return buf.toString('base64', i); - this.lastNeed = 3 - n; - this.lastTotal = 3; - if (n === 1) { - this.lastChar[0] = buf[buf.length - 1]; - } else { - this.lastChar[0] = buf[buf.length - 2]; - this.lastChar[1] = buf[buf.length - 1]; - } - return buf.toString('base64', i, buf.length - n); -} - -function base64End(buf) { - var r = buf && buf.length ? this.write(buf) : ''; - if (this.lastNeed) return r + this.lastChar.toString('base64', 0, 3 - this.lastNeed); - return r; -} - -// Pass bytes on through for single-byte encodings (e.g. ascii, latin1, hex) -function simpleWrite(buf) { - return buf.toString(this.encoding); -} - -function simpleEnd(buf) { - return buf && buf.length ? this.write(buf) : ''; -} \ No newline at end of file diff --git a/deps/npm/node_modules/fs-write-stream-atomic/node_modules/string_decoder/package.json b/deps/npm/node_modules/fs-write-stream-atomic/node_modules/string_decoder/package.json deleted file mode 100644 index 65d08e2cac18f1..00000000000000 --- a/deps/npm/node_modules/fs-write-stream-atomic/node_modules/string_decoder/package.json +++ /dev/null @@ -1,59 +0,0 @@ -{ - "_from": "string_decoder@~1.1.1", - "_id": "string_decoder@1.1.1", - "_inBundle": false, - "_integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "_location": "/fs-write-stream-atomic/string_decoder", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "string_decoder@~1.1.1", - "name": "string_decoder", - "escapedName": "string_decoder", - "rawSpec": "~1.1.1", - "saveSpec": null, - "fetchSpec": "~1.1.1" - }, - "_requiredBy": [ - "/fs-write-stream-atomic/readable-stream" - ], - "_resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "_shasum": "9cf1611ba62685d7030ae9e4ba34149c3af03fc8", - "_spec": "string_decoder@~1.1.1", - "_where": "/Users/aeschright/code/cli/node_modules/fs-write-stream-atomic/node_modules/readable-stream", - "bugs": { - "url": "https://github.com/nodejs/string_decoder/issues" - }, - "bundleDependencies": false, - "dependencies": { - "safe-buffer": "~5.1.0" - }, - "deprecated": false, - "description": "The string_decoder module from Node core", - "devDependencies": { - "babel-polyfill": "^6.23.0", - "core-util-is": "^1.0.2", - "inherits": "^2.0.3", - "tap": "~0.4.8" - }, - "homepage": "https://github.com/nodejs/string_decoder", - "keywords": [ - "string", - "decoder", - "browser", - "browserify" - ], - "license": "MIT", - "main": "lib/string_decoder.js", - "name": "string_decoder", - "repository": { - "type": "git", - "url": "git://github.com/nodejs/string_decoder.git" - }, - "scripts": { - "ci": "tap test/parallel/*.js test/ours/*.js --tap | tee test.tap && node test/verify-dependencies.js", - "test": "tap test/parallel/*.js && node test/verify-dependencies" - }, - "version": "1.1.1" -} diff --git a/deps/npm/node_modules/fs-write-stream-atomic/package.json b/deps/npm/node_modules/fs-write-stream-atomic/package.json deleted file mode 100644 index d6901239751dd6..00000000000000 --- a/deps/npm/node_modules/fs-write-stream-atomic/package.json +++ /dev/null @@ -1,67 +0,0 @@ -{ - "_args": [ - [ - "fs-write-stream-atomic@1.0.10", - "/Users/rebecca/code/npm" - ] - ], - "_from": "fs-write-stream-atomic@1.0.10", - "_id": "fs-write-stream-atomic@1.0.10", - "_inBundle": false, - "_integrity": "sha1-tH31NJPvkR33VzHnCp3tAYnbQMk=", - "_location": "/fs-write-stream-atomic", - "_phantomChildren": {}, - "_requested": { - "type": "version", - "registry": true, - "raw": "fs-write-stream-atomic@1.0.10", - "name": "fs-write-stream-atomic", - "escapedName": "fs-write-stream-atomic", - "rawSpec": "1.0.10", - "saveSpec": null, - "fetchSpec": "1.0.10" - }, - "_requiredBy": [ - "/", - "/copy-concurrently", - "/move-concurrently" - ], - "_resolved": "https://registry.npmjs.org/fs-write-stream-atomic/-/fs-write-stream-atomic-1.0.10.tgz", - "_spec": "1.0.10", - "_where": "/Users/rebecca/code/npm", - "author": { - "name": "Isaac Z. Schlueter", - "email": "i@izs.me", - "url": "http://blog.izs.me/" - }, - "bugs": { - "url": "https://github.com/npm/fs-write-stream-atomic/issues" - }, - "dependencies": { - "graceful-fs": "^4.1.2", - "iferr": "^0.1.5", - "imurmurhash": "^0.1.4", - "readable-stream": "1 || 2" - }, - "description": "Like `fs.createWriteStream(...)`, but atomic.", - "devDependencies": { - "rimraf": "^2.4.4", - "standard": "^5.4.1", - "tap": "^2.3.1" - }, - "directories": { - "test": "test" - }, - "homepage": "https://github.com/npm/fs-write-stream-atomic", - "license": "ISC", - "main": "index.js", - "name": "fs-write-stream-atomic", - "repository": { - "type": "git", - "url": "git+https://github.com/npm/fs-write-stream-atomic.git" - }, - "scripts": { - "test": "standard && tap --coverage test/*.js" - }, - "version": "1.0.10" -} diff --git a/deps/npm/node_modules/fs-write-stream-atomic/test/basic.js b/deps/npm/node_modules/fs-write-stream-atomic/test/basic.js deleted file mode 100644 index d0205e15f4389c..00000000000000 --- a/deps/npm/node_modules/fs-write-stream-atomic/test/basic.js +++ /dev/null @@ -1,97 +0,0 @@ -var fs = require('graceful-fs') -var test = require('tap').test -var path = require('path') -var writeStream = require('../index.js') - -var rename = fs.rename -fs.rename = function (from, to, cb) { - setTimeout(function () { - rename(from, to, cb) - }, 100) -} - -test('basic', function (t) { - // open 10 write streams to the same file. - // then write to each of them, and to the target - // and verify at the end that each of them does their thing - var target = path.resolve(__dirname, 'test.txt') - var n = 10 - - // We run all of our assertions twice: - // once for finish, once for close - // There are 6 assertions, two fixed, plus 4 lines in the file. - t.plan(n * 2 * 6) - - var streams = [] - for (var i = 0; i < n; i++) { - var s = writeStream(target) - s.on('finish', verifier('finish', i)) - s.on('close', verifier('close', i)) - streams.push(s) - } - - function verifier (ev, num) { - return function () { - if (ev === 'close') { - t.equal(this.__emittedFinish, true, num + '. closed only after finish') - } else { - this.__emittedFinish = true - t.equal(ev, 'finish', num + '. finished') - } - - // make sure that one of the atomic streams won. - var res = fs.readFileSync(target, 'utf8') - var lines = res.trim().split(/\n/) - lines.forEach(function (line, lineno) { - var first = lines[0].match(/\d+$/)[0] - var cur = line.match(/\d+$/)[0] - t.equal(cur, first, num + '. line ' + lineno + ' matches') - }) - - var resExpr = /^first write \d+\nsecond write \d+\nthird write \d+\nfinal write \d+\n$/ - t.similar(res, resExpr, num + '. content matches') - } - } - - // now write something to each stream. - streams.forEach(function (stream, i) { - stream.write('first write ' + i + '\n') - }) - - // wait a sec for those writes to go out. - setTimeout(function () { - // write something else to the target. - fs.writeFileSync(target, 'brutality!\n') - - // write some more stuff. - streams.forEach(function (stream, i) { - stream.write('second write ' + i + '\n') - }) - - setTimeout(function () { - // Oops! Deleted the file! - fs.unlinkSync(target) - - // write some more stuff. - streams.forEach(function (stream, i) { - stream.write('third write ' + i + '\n') - }) - - setTimeout(function () { - fs.writeFileSync(target, 'brutality TWO!\n') - streams.forEach(function (stream, i) { - stream.end('final write ' + i + '\n') - }) - }, 50) - }, 50) - }, 50) -}) - -test('cleanup', function (t) { - fs.readdirSync(__dirname).filter(function (f) { - return f.match(/^test.txt/) - }).forEach(function (file) { - fs.unlinkSync(path.resolve(__dirname, file)) - }) - t.end() -}) diff --git a/deps/npm/node_modules/fs-write-stream-atomic/test/chown.js b/deps/npm/node_modules/fs-write-stream-atomic/test/chown.js deleted file mode 100644 index 1733cf27ec2089..00000000000000 --- a/deps/npm/node_modules/fs-write-stream-atomic/test/chown.js +++ /dev/null @@ -1,44 +0,0 @@ -'use strict' -var fs = require('graceful-fs') -var path = require('path') -var test = require('tap').test -var rimraf = require('rimraf') -var writeStream = require('../index.js') - -var target = path.resolve(__dirname, 'test-chown') - -test('chown works', function (t) { - t.plan(1) - var stream = writeStream(target, {chown: {uid: process.getuid(), gid: process.getgid()}}) - var hadError = false - stream.on('error', function (er) { - hadError = true - console.log('#', er) - }) - stream.on('close', function () { - t.is(hadError, false, 'no errors before close') - }) - stream.end() -}) - -test('chown fails', function (t) { - t.plan(1) - fs.chown = function (file, uid, gid, cb) { - cb(new Error('TEST BREAK')) - } - var stream = writeStream(target, {chown: {uid: process.getuid(), gid: process.getgid()}}) - var hadError = false - stream.on('error', function (er) { - hadError = true - console.log('#', er) - }) - stream.on('close', function () { - t.is(hadError, true, 'error before close') - }) - stream.end() -}) - -test('cleanup', function (t) { - rimraf.sync(target) - t.end() -}) diff --git a/deps/npm/node_modules/fs-write-stream-atomic/test/rename-eperm.js b/deps/npm/node_modules/fs-write-stream-atomic/test/rename-eperm.js deleted file mode 100644 index b1be0f3183fade..00000000000000 --- a/deps/npm/node_modules/fs-write-stream-atomic/test/rename-eperm.js +++ /dev/null @@ -1,154 +0,0 @@ -'use strict' -var fs = require('graceful-fs') -var path = require('path') -var test = require('tap').test -var rimraf = require('rimraf') -var writeStream = require('../index.js') - -var target = path.resolve(__dirname, 'test-rename-eperm1') -var target2 = path.resolve(__dirname, 'test-rename-eperm2') -var target3 = path.resolve(__dirname, 'test-rename-eperm3') - -test('rename eperm none existing file', function (t) { - t.plan(2) - - var _rename = fs.rename - fs.existsSync = function (src) { - return true - } - fs.rename = function (src, dest, cb) { - // simulate a failure during rename where the file - // is renamed successfully but the process encounters - // an EPERM error and the target file does not exist - _rename(src, dest, function (e) { - var err = new Error('TEST BREAK') - err.syscall = 'rename' - err.code = 'EPERM' - cb(err) - }) - } - - var stream = writeStream(target, { isWin: true }) - var hadError = false - var calledFinish = false - stream.on('error', function (er) { - hadError = true - console.log('#', er) - }) - stream.on('finish', function () { - calledFinish = true - }) - stream.on('close', function () { - t.is(hadError, true, 'error was caught') - t.is(calledFinish, false, 'finish was called before close') - }) - stream.end() -}) - -// test existing file with diff. content -test('rename eperm existing file different content', function (t) { - t.plan(2) - - var _rename = fs.rename - fs.existsSync = function (src) { - return true - } - fs.rename = function (src, dest, cb) { - // simulate a failure during rename where the file - // is renamed successfully but the process encounters - // an EPERM error and the target file that has another content than the - // destination - _rename(src, dest, function (e) { - fs.writeFile(src, 'dest', function (writeErr) { - if (writeErr) { - return console.log('WRITEERR: ' + writeErr) - } - - fs.writeFile(target2, 'target', function (writeErr) { - if (writeErr) { - return console.log('WRITEERR: ' + writeErr) - } - - var err = new Error('TEST BREAK') - err.syscall = 'rename' - err.code = 'EPERM' - cb(err) - }) - }) - }) - } - - var stream = writeStream(target2, { isWin: true }) - var hadError = false - var calledFinish = false - stream.on('error', function (er) { - hadError = true - console.log('#', er) - }) - stream.on('finish', function () { - calledFinish = true - }) - stream.on('close', function () { - t.is(hadError, true, 'error was caught') - t.is(calledFinish, false, 'finish was called before close') - }) - stream.end() -}) - -// test existing file with the same content -// test existing file with diff. content -test('rename eperm existing file different content', function (t) { - t.plan(2) - - var _rename = fs.rename - fs.existsSync = function (src) { - return true - } - fs.rename = function (src, dest, cb) { - // simulate a failure during rename where the file - // is renamed successfully but the process encounters - // an EPERM error and the target file that has the same content than the - // destination - _rename(src, dest, function (e) { - fs.writeFile(src, 'target2', function (writeErr) { - if (writeErr) { - return console.log('WRITEERR: ' + writeErr) - } - - fs.writeFile(target3, 'target2', function (writeErr) { - if (writeErr) { - return console.log('WRITEERR: ' + writeErr) - } - - var err = new Error('TEST BREAK') - err.syscall = 'rename' - err.code = 'EPERM' - cb(err) - }) - }) - }) - } - - var stream = writeStream(target3, { isWin: true }) - var hadError = false - var calledFinish = false - stream.on('error', function (er) { - hadError = true - console.log('#', er) - }) - stream.on('finish', function () { - calledFinish = true - }) - stream.on('close', function () { - t.is(hadError, false, 'error was caught') - t.is(calledFinish, true, 'finish was called before close') - }) - stream.end() -}) - -test('cleanup', function (t) { - rimraf.sync(target) - rimraf.sync(target2) - rimraf.sync(target3) - t.end() -}) diff --git a/deps/npm/node_modules/fs-write-stream-atomic/test/rename-fail.js b/deps/npm/node_modules/fs-write-stream-atomic/test/rename-fail.js deleted file mode 100644 index 7e27f0bfb0f616..00000000000000 --- a/deps/npm/node_modules/fs-write-stream-atomic/test/rename-fail.js +++ /dev/null @@ -1,30 +0,0 @@ -'use strict' -var fs = require('graceful-fs') -var path = require('path') -var test = require('tap').test -var rimraf = require('rimraf') -var writeStream = require('../index.js') - -var target = path.resolve(__dirname, 'test-rename') - -test('rename fails', function (t) { - t.plan(1) - fs.rename = function (src, dest, cb) { - cb(new Error('TEST BREAK')) - } - var stream = writeStream(target) - var hadError = false - stream.on('error', function (er) { - hadError = true - console.log('#', er) - }) - stream.on('close', function () { - t.is(hadError, true, 'error before close') - }) - stream.end() -}) - -test('cleanup', function (t) { - rimraf.sync(target) - t.end() -}) diff --git a/deps/npm/node_modules/fs-write-stream-atomic/test/slow-close.js b/deps/npm/node_modules/fs-write-stream-atomic/test/slow-close.js deleted file mode 100644 index 9840a6ef0308bf..00000000000000 --- a/deps/npm/node_modules/fs-write-stream-atomic/test/slow-close.js +++ /dev/null @@ -1,40 +0,0 @@ -'use strict' -var fs = require('graceful-fs') -var path = require('path') -var test = require('tap').test -var rimraf = require('rimraf') -var writeStream = require('../index.js') - -var target = path.resolve(__dirname, 'test-chown') - -test('slow close', function (t) { - t.plan(2) - // The goal here is to simulate the "file close" step happening so slowly - // that the whole close/rename process could finish before the file is - // actually closed (and thus buffers truely flushed to the OS). In - // previous versions of this module, this would result in the module - // emitting finish & close before the file was fully written and in - // turn, could break other layers that tried to read the new file. - var realEmit = fs.WriteStream.prototype.emit - var reallyClosed = false - fs.WriteStream.prototype.emit = function (event) { - if (event !== 'close') return realEmit.apply(this, arguments) - setTimeout(function () { - reallyClosed = true - realEmit.call(this, 'close') - }.bind(this), 200) - } - var stream = writeStream(target) - stream.on('finish', function () { - t.is(reallyClosed, true, "didn't finish before target was closed") - }) - stream.on('close', function () { - t.is(reallyClosed, true, "didn't close before target was closed") - }) - stream.end() -}) - -test('cleanup', function (t) { - rimraf.sync(target) - t.end() -}) diff --git a/deps/npm/node_modules/fs-write-stream-atomic/test/toolong.js b/deps/npm/node_modules/fs-write-stream-atomic/test/toolong.js deleted file mode 100644 index f146cc55b1dabc..00000000000000 --- a/deps/npm/node_modules/fs-write-stream-atomic/test/toolong.js +++ /dev/null @@ -1,29 +0,0 @@ -var path = require('path') -var test = require('tap').test -var writeStream = require('../index.js') - -function repeat (times, string) { - var output = '' - for (var ii = 0; ii < times; ++ii) { - output += string - } - return output -} - -var target = path.resolve(__dirname, repeat(1000, 'test')) - -test('name too long', function (t) { - t.plan(2) - var stream = writeStream(target) - var hadError = false - stream.on('error', function (er) { - if (!hadError) { - t.is(er.code, 'ENAMETOOLONG', target.length + ' character name results in ENAMETOOLONG') - hadError = true - } - }) - stream.on('close', function () { - t.ok(hadError, 'got error before close') - }) - stream.end() -}) diff --git a/deps/npm/node_modules/fs.realpath/package.json b/deps/npm/node_modules/fs.realpath/package.json index 4550e22bdc7c7b..3edc57d21c7137 100644 --- a/deps/npm/node_modules/fs.realpath/package.json +++ b/deps/npm/node_modules/fs.realpath/package.json @@ -1,59 +1,26 @@ { - "_from": "fs.realpath@^1.0.0", - "_id": "fs.realpath@1.0.0", - "_inBundle": false, - "_integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", - "_location": "/fs.realpath", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "fs.realpath@^1.0.0", - "name": "fs.realpath", - "escapedName": "fs.realpath", - "rawSpec": "^1.0.0", - "saveSpec": null, - "fetchSpec": "^1.0.0" - }, - "_requiredBy": [ - "/glob" - ], - "_resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "_shasum": "1504ad2523158caa40db4a2787cb01411994ea4f", - "_spec": "fs.realpath@^1.0.0", - "_where": "/Users/rebecca/code/npm/node_modules/glob", - "author": { - "name": "Isaac Z. Schlueter", - "email": "i@izs.me", - "url": "http://blog.izs.me/" - }, - "bugs": { - "url": "https://github.com/isaacs/fs.realpath/issues" - }, - "bundleDependencies": false, - "dependencies": {}, - "deprecated": false, + "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": {}, - "files": [ - "old.js", - "index.js" - ], - "homepage": "https://github.com/isaacs/fs.realpath#readme", + "scripts": { + "test": "tap test/*.js --cov" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/isaacs/fs.realpath.git" + }, "keywords": [ "realpath", "fs", "polyfill" ], + "author": "Isaac Z. Schlueter (http://blog.izs.me/)", "license": "ISC", - "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" + "files": [ + "old.js", + "index.js" + ] } diff --git a/deps/npm/node_modules/function-bind/.editorconfig b/deps/npm/node_modules/function-bind/.editorconfig deleted file mode 100644 index ac29adef0361c6..00000000000000 --- a/deps/npm/node_modules/function-bind/.editorconfig +++ /dev/null @@ -1,20 +0,0 @@ -root = true - -[*] -indent_style = tab -indent_size = 4 -end_of_line = lf -charset = utf-8 -trim_trailing_whitespace = true -insert_final_newline = true -max_line_length = 120 - -[CHANGELOG.md] -indent_style = space -indent_size = 2 - -[*.json] -max_line_length = off - -[Makefile] -max_line_length = off diff --git a/deps/npm/node_modules/function-bind/.jscs.json b/deps/npm/node_modules/function-bind/.jscs.json deleted file mode 100644 index 8c4479480be70d..00000000000000 --- a/deps/npm/node_modules/function-bind/.jscs.json +++ /dev/null @@ -1,176 +0,0 @@ -{ - "es3": true, - - "additionalRules": [], - - "requireSemicolons": true, - - "disallowMultipleSpaces": true, - - "disallowIdentifierNames": [], - - "requireCurlyBraces": { - "allExcept": [], - "keywords": ["if", "else", "for", "while", "do", "try", "catch"] - }, - - "requireSpaceAfterKeywords": ["if", "else", "for", "while", "do", "switch", "return", "try", "catch", "function"], - - "disallowSpaceAfterKeywords": [], - - "disallowSpaceBeforeComma": true, - "disallowSpaceAfterComma": false, - "disallowSpaceBeforeSemicolon": true, - - "disallowNodeTypes": [ - "DebuggerStatement", - "ForInStatement", - "LabeledStatement", - "SwitchCase", - "SwitchStatement", - "WithStatement" - ], - - "requireObjectKeysOnNewLine": { "allExcept": ["sameLine"] }, - - "requireSpacesInAnonymousFunctionExpression": { "beforeOpeningRoundBrace": true, "beforeOpeningCurlyBrace": true }, - "requireSpacesInNamedFunctionExpression": { "beforeOpeningCurlyBrace": true }, - "disallowSpacesInNamedFunctionExpression": { "beforeOpeningRoundBrace": true }, - "requireSpacesInFunctionDeclaration": { "beforeOpeningCurlyBrace": true }, - "disallowSpacesInFunctionDeclaration": { "beforeOpeningRoundBrace": true }, - - "requireSpaceBetweenArguments": true, - - "disallowSpacesInsideParentheses": true, - - "disallowSpacesInsideArrayBrackets": true, - - "disallowQuotedKeysInObjects": { "allExcept": ["reserved"] }, - - "disallowSpaceAfterObjectKeys": true, - - "requireCommaBeforeLineBreak": true, - - "disallowSpaceAfterPrefixUnaryOperators": ["++", "--", "+", "-", "~", "!"], - "requireSpaceAfterPrefixUnaryOperators": [], - - "disallowSpaceBeforePostfixUnaryOperators": ["++", "--"], - "requireSpaceBeforePostfixUnaryOperators": [], - - "disallowSpaceBeforeBinaryOperators": [], - "requireSpaceBeforeBinaryOperators": ["+", "-", "/", "*", "=", "==", "===", "!=", "!=="], - - "requireSpaceAfterBinaryOperators": ["+", "-", "/", "*", "=", "==", "===", "!=", "!=="], - "disallowSpaceAfterBinaryOperators": [], - - "disallowImplicitTypeConversion": ["binary", "string"], - - "disallowKeywords": ["with", "eval"], - - "requireKeywordsOnNewLine": [], - "disallowKeywordsOnNewLine": ["else"], - - "requireLineFeedAtFileEnd": true, - - "disallowTrailingWhitespace": true, - - "disallowTrailingComma": true, - - "excludeFiles": ["node_modules/**", "vendor/**"], - - "disallowMultipleLineStrings": true, - - "requireDotNotation": { "allExcept": ["keywords"] }, - - "requireParenthesesAroundIIFE": true, - - "validateLineBreaks": "LF", - - "validateQuoteMarks": { - "escape": true, - "mark": "'" - }, - - "disallowOperatorBeforeLineBreak": [], - - "requireSpaceBeforeKeywords": [ - "do", - "for", - "if", - "else", - "switch", - "case", - "try", - "catch", - "finally", - "while", - "with", - "return" - ], - - "validateAlignedFunctionParameters": { - "lineBreakAfterOpeningBraces": true, - "lineBreakBeforeClosingBraces": true - }, - - "requirePaddingNewLinesBeforeExport": true, - - "validateNewlineAfterArrayElements": { - "maximum": 8 - }, - - "requirePaddingNewLinesAfterUseStrict": true, - - "disallowArrowFunctions": true, - - "disallowMultiLineTernary": true, - - "validateOrderInObjectKeys": "asc-insensitive", - - "disallowIdenticalDestructuringNames": true, - - "disallowNestedTernaries": { "maxLevel": 1 }, - - "requireSpaceAfterComma": { "allExcept": ["trailing"] }, - "requireAlignedMultilineParams": false, - - "requireSpacesInGenerator": { - "afterStar": true - }, - - "disallowSpacesInGenerator": { - "beforeStar": true - }, - - "disallowVar": false, - - "requireArrayDestructuring": false, - - "requireEnhancedObjectLiterals": false, - - "requireObjectDestructuring": false, - - "requireEarlyReturn": false, - - "requireCapitalizedConstructorsNew": { - "allExcept": ["Function", "String", "Object", "Symbol", "Number", "Date", "RegExp", "Error", "Boolean", "Array"] - }, - - "requireImportAlphabetized": false, - - "requireSpaceBeforeObjectValues": true, - "requireSpaceBeforeDestructuredValues": true, - - "disallowSpacesInsideTemplateStringPlaceholders": true, - - "disallowArrayDestructuringReturn": false, - - "requireNewlineBeforeSingleStatementsInIf": false, - - "disallowUnusedVariables": true, - - "requireSpacesInsideImportedObjectBraces": true, - - "requireUseStrict": true -} - diff --git a/deps/npm/node_modules/function-bind/.npmignore b/deps/npm/node_modules/function-bind/.npmignore deleted file mode 100644 index dbb555fd1f9f59..00000000000000 --- a/deps/npm/node_modules/function-bind/.npmignore +++ /dev/null @@ -1,22 +0,0 @@ -# gitignore -.DS_Store -.monitor -.*.swp -.nodemonignore -releases -*.log -*.err -fleet.json -public/browserify -bin/*.json -.bin -build -compile -.lock-wscript -coverage -node_modules - -# Only apps should have lockfiles -npm-shrinkwrap.json -package-lock.json -yarn.lock diff --git a/deps/npm/node_modules/function-bind/.travis.yml b/deps/npm/node_modules/function-bind/.travis.yml deleted file mode 100644 index 85f70d2464f393..00000000000000 --- a/deps/npm/node_modules/function-bind/.travis.yml +++ /dev/null @@ -1,168 +0,0 @@ -language: node_js -os: - - linux -node_js: - - "8.4" - - "7.10" - - "6.11" - - "5.12" - - "4.8" - - "iojs-v3.3" - - "iojs-v2.5" - - "iojs-v1.8" - - "0.12" - - "0.10" - - "0.8" -before_install: - - 'if [ "${TRAVIS_NODE_VERSION}" = "0.6" ]; then npm install -g npm@1.3 ; elif [ "${TRAVIS_NODE_VERSION}" != "0.9" ]; then case "$(npm --version)" in 1.*) npm install -g npm@1.4.28 ;; 2.*) npm install -g npm@2 ;; esac ; fi' - - 'if [ "${TRAVIS_NODE_VERSION}" != "0.6" ] && [ "${TRAVIS_NODE_VERSION}" != "0.9" ]; then if [ "${TRAVIS_NODE_VERSION%${TRAVIS_NODE_VERSION#[0-9]}}" = "0" ] || [ "${TRAVIS_NODE_VERSION:0:4}" = "iojs" ]; then npm install -g npm@4.5 ; else npm install -g npm; fi; fi' -install: - - 'if [ "${TRAVIS_NODE_VERSION}" = "0.6" ]; then nvm install 0.8 && npm install -g npm@1.3 && npm install -g npm@1.4.28 && npm install -g npm@2 && npm install && nvm use "${TRAVIS_NODE_VERSION}"; else npm install; fi;' -script: - - 'if [ -n "${PRETEST-}" ]; then npm run pretest ; fi' - - 'if [ -n "${POSTTEST-}" ]; then npm run posttest ; fi' - - 'if [ -n "${COVERAGE-}" ]; then npm run coverage ; fi' - - 'if [ -n "${TEST-}" ]; then npm run tests-only ; fi' -sudo: false -env: - - TEST=true -matrix: - fast_finish: true - include: - - node_js: "node" - env: PRETEST=true - - node_js: "4" - env: COVERAGE=true - - node_js: "8.3" - env: TEST=true ALLOW_FAILURE=true - - node_js: "8.2" - env: TEST=true ALLOW_FAILURE=true - - node_js: "8.1" - env: TEST=true ALLOW_FAILURE=true - - node_js: "8.0" - env: TEST=true ALLOW_FAILURE=true - - node_js: "7.9" - env: TEST=true ALLOW_FAILURE=true - - node_js: "7.8" - env: TEST=true ALLOW_FAILURE=true - - node_js: "7.7" - env: TEST=true ALLOW_FAILURE=true - - node_js: "7.6" - env: TEST=true ALLOW_FAILURE=true - - node_js: "7.5" - env: TEST=true ALLOW_FAILURE=true - - node_js: "7.4" - env: TEST=true ALLOW_FAILURE=true - - node_js: "7.3" - env: TEST=true ALLOW_FAILURE=true - - node_js: "7.2" - env: TEST=true ALLOW_FAILURE=true - - node_js: "7.1" - env: TEST=true ALLOW_FAILURE=true - - node_js: "7.0" - env: TEST=true ALLOW_FAILURE=true - - node_js: "6.10" - env: TEST=true ALLOW_FAILURE=true - - node_js: "6.9" - env: TEST=true ALLOW_FAILURE=true - - node_js: "6.8" - env: TEST=true ALLOW_FAILURE=true - - node_js: "6.7" - env: TEST=true ALLOW_FAILURE=true - - node_js: "6.6" - env: TEST=true ALLOW_FAILURE=true - - node_js: "6.5" - env: TEST=true ALLOW_FAILURE=true - - node_js: "6.4" - env: TEST=true ALLOW_FAILURE=true - - node_js: "6.3" - env: TEST=true ALLOW_FAILURE=true - - node_js: "6.2" - env: TEST=true ALLOW_FAILURE=true - - node_js: "6.1" - env: TEST=true ALLOW_FAILURE=true - - node_js: "6.0" - env: TEST=true ALLOW_FAILURE=true - - node_js: "5.11" - env: TEST=true ALLOW_FAILURE=true - - node_js: "5.10" - env: TEST=true ALLOW_FAILURE=true - - node_js: "5.9" - env: TEST=true ALLOW_FAILURE=true - - node_js: "5.8" - env: TEST=true ALLOW_FAILURE=true - - node_js: "5.7" - env: TEST=true ALLOW_FAILURE=true - - node_js: "5.6" - env: TEST=true ALLOW_FAILURE=true - - node_js: "5.5" - env: TEST=true ALLOW_FAILURE=true - - node_js: "5.4" - env: TEST=true ALLOW_FAILURE=true - - node_js: "5.3" - env: TEST=true ALLOW_FAILURE=true - - node_js: "5.2" - env: TEST=true ALLOW_FAILURE=true - - node_js: "5.1" - env: TEST=true ALLOW_FAILURE=true - - node_js: "5.0" - env: TEST=true ALLOW_FAILURE=true - - node_js: "4.7" - env: TEST=true ALLOW_FAILURE=true - - node_js: "4.6" - env: TEST=true ALLOW_FAILURE=true - - node_js: "4.5" - env: TEST=true ALLOW_FAILURE=true - - node_js: "4.4" - env: TEST=true ALLOW_FAILURE=true - - node_js: "4.3" - env: TEST=true ALLOW_FAILURE=true - - node_js: "4.2" - env: TEST=true ALLOW_FAILURE=true - - node_js: "4.1" - env: TEST=true ALLOW_FAILURE=true - - node_js: "4.0" - env: TEST=true ALLOW_FAILURE=true - - node_js: "iojs-v3.2" - env: TEST=true ALLOW_FAILURE=true - - node_js: "iojs-v3.1" - env: TEST=true ALLOW_FAILURE=true - - node_js: "iojs-v3.0" - env: TEST=true ALLOW_FAILURE=true - - node_js: "iojs-v2.4" - env: TEST=true ALLOW_FAILURE=true - - node_js: "iojs-v2.3" - env: TEST=true ALLOW_FAILURE=true - - node_js: "iojs-v2.2" - env: TEST=true ALLOW_FAILURE=true - - node_js: "iojs-v2.1" - env: TEST=true ALLOW_FAILURE=true - - node_js: "iojs-v2.0" - env: TEST=true ALLOW_FAILURE=true - - node_js: "iojs-v1.7" - env: TEST=true ALLOW_FAILURE=true - - node_js: "iojs-v1.6" - env: TEST=true ALLOW_FAILURE=true - - node_js: "iojs-v1.5" - env: TEST=true ALLOW_FAILURE=true - - node_js: "iojs-v1.4" - env: TEST=true ALLOW_FAILURE=true - - node_js: "iojs-v1.3" - env: TEST=true ALLOW_FAILURE=true - - node_js: "iojs-v1.2" - env: TEST=true ALLOW_FAILURE=true - - node_js: "iojs-v1.1" - env: TEST=true ALLOW_FAILURE=true - - node_js: "iojs-v1.0" - env: TEST=true ALLOW_FAILURE=true - - node_js: "0.11" - env: TEST=true ALLOW_FAILURE=true - - node_js: "0.9" - env: TEST=true ALLOW_FAILURE=true - - node_js: "0.6" - env: TEST=true ALLOW_FAILURE=true - - node_js: "0.4" - env: TEST=true ALLOW_FAILURE=true - allow_failures: - - os: osx - - env: TEST=true ALLOW_FAILURE=true diff --git a/deps/npm/node_modules/function-bind/LICENSE b/deps/npm/node_modules/function-bind/LICENSE deleted file mode 100644 index 62d6d237ff179b..00000000000000 --- a/deps/npm/node_modules/function-bind/LICENSE +++ /dev/null @@ -1,20 +0,0 @@ -Copyright (c) 2013 Raynos. - -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/function-bind/README.md b/deps/npm/node_modules/function-bind/README.md deleted file mode 100644 index 81862a02cb940c..00000000000000 --- a/deps/npm/node_modules/function-bind/README.md +++ /dev/null @@ -1,48 +0,0 @@ -# function-bind - - - - - -Implementation of function.prototype.bind - -## Example - -I mainly do this for unit tests I run on phantomjs. -PhantomJS does not have Function.prototype.bind :( - -```js -Function.prototype.bind = require("function-bind") -``` - -## Installation - -`npm install function-bind` - -## Contributors - - - Raynos - -## MIT Licenced - - [travis-svg]: https://travis-ci.org/Raynos/function-bind.svg - [travis-url]: https://travis-ci.org/Raynos/function-bind - [npm-badge-svg]: https://badge.fury.io/js/function-bind.svg - [npm-url]: https://npmjs.org/package/function-bind - [5]: https://coveralls.io/repos/Raynos/function-bind/badge.png - [6]: https://coveralls.io/r/Raynos/function-bind - [7]: https://gemnasium.com/Raynos/function-bind.png - [8]: https://gemnasium.com/Raynos/function-bind - [deps-svg]: https://david-dm.org/Raynos/function-bind.svg - [deps-url]: https://david-dm.org/Raynos/function-bind - [dev-deps-svg]: https://david-dm.org/Raynos/function-bind/dev-status.svg - [dev-deps-url]: https://david-dm.org/Raynos/function-bind#info=devDependencies - [11]: https://ci.testling.com/Raynos/function-bind.png - [12]: https://ci.testling.com/Raynos/function-bind diff --git a/deps/npm/node_modules/function-bind/implementation.js b/deps/npm/node_modules/function-bind/implementation.js deleted file mode 100644 index cc4daec1b080a1..00000000000000 --- a/deps/npm/node_modules/function-bind/implementation.js +++ /dev/null @@ -1,52 +0,0 @@ -'use strict'; - -/* eslint no-invalid-this: 1 */ - -var ERROR_MESSAGE = 'Function.prototype.bind called on incompatible '; -var slice = Array.prototype.slice; -var toStr = Object.prototype.toString; -var funcType = '[object Function]'; - -module.exports = function bind(that) { - var target = this; - if (typeof target !== 'function' || toStr.call(target) !== funcType) { - throw new TypeError(ERROR_MESSAGE + target); - } - var args = slice.call(arguments, 1); - - var bound; - var binder = function () { - if (this instanceof bound) { - var result = target.apply( - this, - args.concat(slice.call(arguments)) - ); - if (Object(result) === result) { - return result; - } - return this; - } else { - return target.apply( - that, - args.concat(slice.call(arguments)) - ); - } - }; - - var boundLength = Math.max(0, target.length - args.length); - var boundArgs = []; - for (var i = 0; i < boundLength; i++) { - boundArgs.push('$' + i); - } - - bound = Function('binder', 'return function (' + boundArgs.join(',') + '){ return binder.apply(this,arguments); }')(binder); - - if (target.prototype) { - var Empty = function Empty() {}; - Empty.prototype = target.prototype; - bound.prototype = new Empty(); - Empty.prototype = null; - } - - return bound; -}; diff --git a/deps/npm/node_modules/function-bind/index.js b/deps/npm/node_modules/function-bind/index.js deleted file mode 100644 index 3bb6b9609889f8..00000000000000 --- a/deps/npm/node_modules/function-bind/index.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; - -var implementation = require('./implementation'); - -module.exports = Function.prototype.bind || implementation; diff --git a/deps/npm/node_modules/function-bind/package.json b/deps/npm/node_modules/function-bind/package.json deleted file mode 100644 index 426db8c4d8705e..00000000000000 --- a/deps/npm/node_modules/function-bind/package.json +++ /dev/null @@ -1,67 +0,0 @@ -{ - "name": "function-bind", - "version": "1.1.1", - "description": "Implementation of Function.prototype.bind", - "keywords": [ - "function", - "bind", - "shim", - "es5" - ], - "author": "Raynos ", - "repository": "git://github.com/Raynos/function-bind.git", - "main": "index", - "homepage": "https://github.com/Raynos/function-bind", - "contributors": [ - { - "name": "Raynos" - }, - { - "name": "Jordan Harband", - "url": "https://github.com/ljharb" - } - ], - "bugs": { - "url": "https://github.com/Raynos/function-bind/issues", - "email": "raynos2@gmail.com" - }, - "dependencies": {}, - "devDependencies": { - "@ljharb/eslint-config": "^12.2.1", - "covert": "^1.1.0", - "eslint": "^4.5.0", - "jscs": "^3.0.7", - "tape": "^4.8.0" - }, - "license": "MIT", - "scripts": { - "pretest": "npm run lint", - "test": "npm run tests-only", - "posttest": "npm run coverage -- --quiet", - "tests-only": "node test", - "coverage": "covert test/*.js", - "lint": "npm run jscs && npm run eslint", - "jscs": "jscs *.js */*.js", - "eslint": "eslint *.js */*.js" - }, - "testling": { - "files": "test/index.js", - "browsers": [ - "ie/8..latest", - "firefox/16..latest", - "firefox/nightly", - "chrome/22..latest", - "chrome/canary", - "opera/12..latest", - "opera/next", - "safari/5.1..latest", - "ipad/6.0..latest", - "iphone/6.0..latest", - "android-browser/4.2..latest" - ] - } - -,"_resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz" -,"_integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==" -,"_from": "function-bind@1.1.1" -} \ No newline at end of file diff --git a/deps/npm/node_modules/function-bind/test/index.js b/deps/npm/node_modules/function-bind/test/index.js deleted file mode 100644 index 2edecce2f0fa5a..00000000000000 --- a/deps/npm/node_modules/function-bind/test/index.js +++ /dev/null @@ -1,252 +0,0 @@ -// jscs:disable requireUseStrict - -var test = require('tape'); - -var functionBind = require('../implementation'); -var getCurrentContext = function () { return this; }; - -test('functionBind is a function', function (t) { - t.equal(typeof functionBind, 'function'); - t.end(); -}); - -test('non-functions', function (t) { - var nonFunctions = [true, false, [], {}, 42, 'foo', NaN, /a/g]; - t.plan(nonFunctions.length); - for (var i = 0; i < nonFunctions.length; ++i) { - try { functionBind.call(nonFunctions[i]); } catch (ex) { - t.ok(ex instanceof TypeError, 'throws when given ' + String(nonFunctions[i])); - } - } - t.end(); -}); - -test('without a context', function (t) { - t.test('binds properly', function (st) { - var args, context; - var namespace = { - func: functionBind.call(function () { - args = Array.prototype.slice.call(arguments); - context = this; - }) - }; - namespace.func(1, 2, 3); - st.deepEqual(args, [1, 2, 3]); - st.equal(context, getCurrentContext.call()); - st.end(); - }); - - t.test('binds properly, and still supplies bound arguments', function (st) { - var args, context; - var namespace = { - func: functionBind.call(function () { - args = Array.prototype.slice.call(arguments); - context = this; - }, undefined, 1, 2, 3) - }; - namespace.func(4, 5, 6); - st.deepEqual(args, [1, 2, 3, 4, 5, 6]); - st.equal(context, getCurrentContext.call()); - st.end(); - }); - - t.test('returns properly', function (st) { - var args; - var namespace = { - func: functionBind.call(function () { - args = Array.prototype.slice.call(arguments); - return this; - }, null) - }; - var context = namespace.func(1, 2, 3); - st.equal(context, getCurrentContext.call(), 'returned context is namespaced context'); - st.deepEqual(args, [1, 2, 3], 'passed arguments are correct'); - st.end(); - }); - - t.test('returns properly with bound arguments', function (st) { - var args; - var namespace = { - func: functionBind.call(function () { - args = Array.prototype.slice.call(arguments); - return this; - }, null, 1, 2, 3) - }; - var context = namespace.func(4, 5, 6); - st.equal(context, getCurrentContext.call(), 'returned context is namespaced context'); - st.deepEqual(args, [1, 2, 3, 4, 5, 6], 'passed arguments are correct'); - st.end(); - }); - - t.test('called as a constructor', function (st) { - var thunkify = function (value) { - return function () { return value; }; - }; - st.test('returns object value', function (sst) { - var expectedReturnValue = [1, 2, 3]; - var Constructor = functionBind.call(thunkify(expectedReturnValue), null); - var result = new Constructor(); - sst.equal(result, expectedReturnValue); - sst.end(); - }); - - st.test('does not return primitive value', function (sst) { - var Constructor = functionBind.call(thunkify(42), null); - var result = new Constructor(); - sst.notEqual(result, 42); - sst.end(); - }); - - st.test('object from bound constructor is instance of original and bound constructor', function (sst) { - var A = function (x) { - this.name = x || 'A'; - }; - var B = functionBind.call(A, null, 'B'); - - var result = new B(); - sst.ok(result instanceof B, 'result is instance of bound constructor'); - sst.ok(result instanceof A, 'result is instance of original constructor'); - sst.end(); - }); - - st.end(); - }); - - t.end(); -}); - -test('with a context', function (t) { - t.test('with no bound arguments', function (st) { - var args, context; - var boundContext = {}; - var namespace = { - func: functionBind.call(function () { - args = Array.prototype.slice.call(arguments); - context = this; - }, boundContext) - }; - namespace.func(1, 2, 3); - st.equal(context, boundContext, 'binds a context properly'); - st.deepEqual(args, [1, 2, 3], 'supplies passed arguments'); - st.end(); - }); - - t.test('with bound arguments', function (st) { - var args, context; - var boundContext = {}; - var namespace = { - func: functionBind.call(function () { - args = Array.prototype.slice.call(arguments); - context = this; - }, boundContext, 1, 2, 3) - }; - namespace.func(4, 5, 6); - st.equal(context, boundContext, 'binds a context properly'); - st.deepEqual(args, [1, 2, 3, 4, 5, 6], 'supplies bound and passed arguments'); - st.end(); - }); - - t.test('returns properly', function (st) { - var boundContext = {}; - var args; - var namespace = { - func: functionBind.call(function () { - args = Array.prototype.slice.call(arguments); - return this; - }, boundContext) - }; - var context = namespace.func(1, 2, 3); - st.equal(context, boundContext, 'returned context is bound context'); - st.notEqual(context, getCurrentContext.call(), 'returned context is not lexical context'); - st.deepEqual(args, [1, 2, 3], 'passed arguments are correct'); - st.end(); - }); - - t.test('returns properly with bound arguments', function (st) { - var boundContext = {}; - var args; - var namespace = { - func: functionBind.call(function () { - args = Array.prototype.slice.call(arguments); - return this; - }, boundContext, 1, 2, 3) - }; - var context = namespace.func(4, 5, 6); - st.equal(context, boundContext, 'returned context is bound context'); - st.notEqual(context, getCurrentContext.call(), 'returned context is not lexical context'); - st.deepEqual(args, [1, 2, 3, 4, 5, 6], 'passed arguments are correct'); - st.end(); - }); - - t.test('passes the correct arguments when called as a constructor', function (st) { - var expected = { name: 'Correct' }; - var namespace = { - Func: functionBind.call(function (arg) { - return arg; - }, { name: 'Incorrect' }) - }; - var returned = new namespace.Func(expected); - st.equal(returned, expected, 'returns the right arg when called as a constructor'); - st.end(); - }); - - t.test('has the new instance\'s context when called as a constructor', function (st) { - var actualContext; - var expectedContext = { foo: 'bar' }; - var namespace = { - Func: functionBind.call(function () { - actualContext = this; - }, expectedContext) - }; - var result = new namespace.Func(); - st.equal(result instanceof namespace.Func, true); - st.notEqual(actualContext, expectedContext); - st.end(); - }); - - t.end(); -}); - -test('bound function length', function (t) { - t.test('sets a correct length without thisArg', function (st) { - var subject = functionBind.call(function (a, b, c) { return a + b + c; }); - st.equal(subject.length, 3); - st.equal(subject(1, 2, 3), 6); - st.end(); - }); - - t.test('sets a correct length with thisArg', function (st) { - var subject = functionBind.call(function (a, b, c) { return a + b + c; }, {}); - st.equal(subject.length, 3); - st.equal(subject(1, 2, 3), 6); - st.end(); - }); - - t.test('sets a correct length without thisArg and first argument', function (st) { - var subject = functionBind.call(function (a, b, c) { return a + b + c; }, undefined, 1); - st.equal(subject.length, 2); - st.equal(subject(2, 3), 6); - st.end(); - }); - - t.test('sets a correct length with thisArg and first argument', function (st) { - var subject = functionBind.call(function (a, b, c) { return a + b + c; }, {}, 1); - st.equal(subject.length, 2); - st.equal(subject(2, 3), 6); - st.end(); - }); - - t.test('sets a correct length without thisArg and too many arguments', function (st) { - var subject = functionBind.call(function (a, b, c) { return a + b + c; }, undefined, 1, 2, 3, 4); - st.equal(subject.length, 0); - st.equal(subject(), 6); - st.end(); - }); - - t.test('sets a correct length with thisArg and too many arguments', function (st) { - var subject = functionBind.call(function (a, b, c) { return a + b + c; }, {}, 1, 2, 3, 4); - st.equal(subject.length, 0); - st.equal(subject(), 6); - st.end(); - }); -}); diff --git a/deps/npm/node_modules/gauge/node_modules/aproba/package.json b/deps/npm/node_modules/gauge/node_modules/aproba/package.json index f654576f8eda8e..f008787bc265e0 100644 --- a/deps/npm/node_modules/gauge/node_modules/aproba/package.json +++ b/deps/npm/node_modules/gauge/node_modules/aproba/package.json @@ -1,62 +1,34 @@ { - "_from": "aproba@^1.0.3", - "_id": "aproba@1.2.0", - "_inBundle": false, - "_integrity": "sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw==", - "_location": "/gauge/aproba", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "aproba@^1.0.3", - "name": "aproba", - "escapedName": "aproba", - "rawSpec": "^1.0.3", - "saveSpec": null, - "fetchSpec": "^1.0.3" - }, - "_requiredBy": [ - "/gauge" - ], - "_resolved": "https://registry.npmjs.org/aproba/-/aproba-1.2.0.tgz", - "_shasum": "6802e6264efd18c790a1b0d517f0f2627bf2c94a", - "_spec": "aproba@^1.0.3", - "_where": "/Users/aeschright/code/cli/node_modules/gauge", - "author": { - "name": "Rebecca Turner", - "email": "me@re-becca.org" - }, - "bugs": { - "url": "https://github.com/iarna/aproba/issues" + "name": "aproba", + "version": "1.2.0", + "description": "A ridiculously light-weight argument validator (now browser friendly)", + "main": "index.js", + "directories": { + "test": "test" }, - "bundleDependencies": false, "dependencies": {}, - "deprecated": false, - "description": "A ridiculously light-weight argument validator (now browser friendly)", "devDependencies": { "standard": "^10.0.3", "tap": "^10.0.2" }, - "directories": { - "test": "test" - }, "files": [ "index.js" ], - "homepage": "https://github.com/iarna/aproba", + "scripts": { + "test": "standard && tap -j3 test/*.js" + }, + "repository": { + "type": "git", + "url": "https://github.com/iarna/aproba" + }, "keywords": [ "argument", "validate" ], + "author": "Rebecca Turner ", "license": "ISC", - "main": "index.js", - "name": "aproba", - "repository": { - "type": "git", - "url": "git+https://github.com/iarna/aproba.git" - }, - "scripts": { - "test": "standard && tap -j3 test/*.js" + "bugs": { + "url": "https://github.com/iarna/aproba/issues" }, - "version": "1.2.0" + "homepage": "https://github.com/iarna/aproba" } diff --git a/deps/npm/node_modules/gauge/node_modules/is-fullwidth-code-point/index.js b/deps/npm/node_modules/gauge/node_modules/is-fullwidth-code-point/index.js new file mode 100644 index 00000000000000..a7d3e3855f1c24 --- /dev/null +++ b/deps/npm/node_modules/gauge/node_modules/is-fullwidth-code-point/index.js @@ -0,0 +1,46 @@ +'use strict'; +var numberIsNan = require('number-is-nan'); + +module.exports = function (x) { + if (numberIsNan(x)) { + return false; + } + + // https://github.com/nodejs/io.js/blob/cff7300a578be1b10001f2d967aaedc88aee6402/lib/readline.js#L1369 + + // code points are derived from: + // http://www.unix.org/Public/UNIDATA/EastAsianWidth.txt + if (x >= 0x1100 && ( + x <= 0x115f || // Hangul Jamo + 0x2329 === x || // LEFT-POINTING ANGLE BRACKET + 0x232a === x || // RIGHT-POINTING ANGLE BRACKET + // CJK Radicals Supplement .. Enclosed CJK Letters and Months + (0x2e80 <= x && x <= 0x3247 && x !== 0x303f) || + // Enclosed CJK Letters and Months .. CJK Unified Ideographs Extension A + 0x3250 <= x && x <= 0x4dbf || + // CJK Unified Ideographs .. Yi Radicals + 0x4e00 <= x && x <= 0xa4c6 || + // Hangul Jamo Extended-A + 0xa960 <= x && x <= 0xa97c || + // Hangul Syllables + 0xac00 <= x && x <= 0xd7a3 || + // CJK Compatibility Ideographs + 0xf900 <= x && x <= 0xfaff || + // Vertical Forms + 0xfe10 <= x && x <= 0xfe19 || + // CJK Compatibility Forms .. Small Form Variants + 0xfe30 <= x && x <= 0xfe6b || + // Halfwidth and Fullwidth Forms + 0xff01 <= x && x <= 0xff60 || + 0xffe0 <= x && x <= 0xffe6 || + // Kana Supplement + 0x1b000 <= x && x <= 0x1b001 || + // Enclosed Ideographic Supplement + 0x1f200 <= x && x <= 0x1f251 || + // CJK Unified Ideographs Extension B .. Tertiary Ideographic Plane + 0x20000 <= x && x <= 0x3fffd)) { + return true; + } + + return false; +} diff --git a/deps/npm/node_modules/camelcase/license b/deps/npm/node_modules/gauge/node_modules/is-fullwidth-code-point/license similarity index 100% rename from deps/npm/node_modules/camelcase/license rename to deps/npm/node_modules/gauge/node_modules/is-fullwidth-code-point/license diff --git a/deps/npm/node_modules/gauge/node_modules/is-fullwidth-code-point/package.json b/deps/npm/node_modules/gauge/node_modules/is-fullwidth-code-point/package.json new file mode 100644 index 00000000000000..b678d40de728c9 --- /dev/null +++ b/deps/npm/node_modules/gauge/node_modules/is-fullwidth-code-point/package.json @@ -0,0 +1,45 @@ +{ + "name": "is-fullwidth-code-point", + "version": "1.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": ">=0.10.0" + }, + "scripts": { + "test": "node test.js" + }, + "files": [ + "index.js" + ], + "keywords": [ + "fullwidth", + "full-width", + "full", + "width", + "unicode", + "character", + "char", + "string", + "str", + "codepoint", + "code", + "point", + "is", + "detect", + "check" + ], + "dependencies": { + "number-is-nan": "^1.0.0" + }, + "devDependencies": { + "ava": "0.0.4", + "code-point-at": "^1.0.0" + } +} diff --git a/deps/npm/node_modules/gauge/node_modules/is-fullwidth-code-point/readme.md b/deps/npm/node_modules/gauge/node_modules/is-fullwidth-code-point/readme.md new file mode 100644 index 00000000000000..4936464b1b4155 --- /dev/null +++ b/deps/npm/node_modules/gauge/node_modules/is-fullwidth-code-point/readme.md @@ -0,0 +1,39 @@ +# is-fullwidth-code-point [![Build Status](https://travis-ci.org/sindresorhus/is-fullwidth-code-point.svg?branch=master)](https://travis-ci.org/sindresorhus/is-fullwidth-code-point) + +> Check if the character represented by a given [Unicode code point](https://en.wikipedia.org/wiki/Code_point) is [fullwidth](https://en.wikipedia.org/wiki/Halfwidth_and_fullwidth_forms) + + +## Install + +``` +$ npm install --save is-fullwidth-code-point +``` + + +## Usage + +```js +var isFullwidthCodePoint = require('is-fullwidth-code-point'); + +isFullwidthCodePoint('谢'.codePointAt()); +//=> true + +isFullwidthCodePoint('a'.codePointAt()); +//=> false +``` + + +## API + +### isFullwidthCodePoint(input) + +#### input + +Type: `number` + +[Code point](https://en.wikipedia.org/wiki/Code_point) of a character. + + +## License + +MIT © [Sindre Sorhus](http://sindresorhus.com) diff --git a/deps/npm/node_modules/gauge/node_modules/string-width/package.json b/deps/npm/node_modules/gauge/node_modules/string-width/package.json index 8b450344af3a15..5ba436166e9afa 100644 --- a/deps/npm/node_modules/gauge/node_modules/string-width/package.json +++ b/deps/npm/node_modules/gauge/node_modules/string-width/package.json @@ -1,54 +1,23 @@ { - "_from": "string-width@^1.0.1", - "_id": "string-width@1.0.2", - "_inBundle": false, - "_integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", - "_location": "/gauge/string-width", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "string-width@^1.0.1", - "name": "string-width", - "escapedName": "string-width", - "rawSpec": "^1.0.1", - "saveSpec": null, - "fetchSpec": "^1.0.1" - }, - "_requiredBy": [ - "/gauge" - ], - "_resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", - "_shasum": "118bdf5b8cdc51a2a7e70d211e07e2b0b9b107d3", - "_spec": "string-width@^1.0.1", - "_where": "/Users/rebecca/code/npm/node_modules/gauge", + "name": "string-width", + "version": "1.0.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" }, - "bugs": { - "url": "https://github.com/sindresorhus/string-width/issues" - }, - "bundleDependencies": false, - "dependencies": { - "code-point-at": "^1.0.0", - "is-fullwidth-code-point": "^1.0.0", - "strip-ansi": "^3.0.0" - }, - "deprecated": false, - "description": "Get the visual width of a string - the number of columns required to display it", - "devDependencies": { - "ava": "*", - "xo": "*" - }, "engines": { "node": ">=0.10.0" }, + "scripts": { + "test": "xo && ava" + }, "files": [ "index.js" ], - "homepage": "https://github.com/sindresorhus/string-width#readme", "keywords": [ "string", "str", @@ -75,14 +44,13 @@ "korean", "fixed-width" ], - "license": "MIT", - "name": "string-width", - "repository": { - "type": "git", - "url": "git+https://github.com/sindresorhus/string-width.git" - }, - "scripts": { - "test": "xo && ava" + "dependencies": { + "code-point-at": "^1.0.0", + "is-fullwidth-code-point": "^1.0.0", + "strip-ansi": "^3.0.0" }, - "version": "1.0.2" + "devDependencies": { + "ava": "*", + "xo": "*" + } } diff --git a/deps/npm/node_modules/gauge/package.json b/deps/npm/node_modules/gauge/package.json index 9900ba9dd51e84..4882cff8390d87 100644 --- a/deps/npm/node_modules/gauge/package.json +++ b/deps/npm/node_modules/gauge/package.json @@ -1,38 +1,27 @@ { - "_from": "gauge@~2.7.3", - "_id": "gauge@2.7.4", - "_inBundle": false, - "_integrity": "sha1-LANAXHU4w51+s3sxcCLjJfsBi/c=", - "_location": "/gauge", - "_phantomChildren": { - "code-point-at": "1.1.0", - "number-is-nan": "1.0.1" + "name": "gauge", + "version": "2.7.4", + "description": "A terminal based horizontal guage", + "main": "index.js", + "scripts": { + "test": "standard && tap test/*.js --coverage", + "prepublish": "rm -f *~" }, - "_requested": { - "type": "range", - "registry": true, - "raw": "gauge@~2.7.3", - "name": "gauge", - "escapedName": "gauge", - "rawSpec": "~2.7.3", - "saveSpec": null, - "fetchSpec": "~2.7.3" + "repository": { + "type": "git", + "url": "https://github.com/iarna/gauge" }, - "_requiredBy": [ - "/npmlog" + "keywords": [ + "progressbar", + "progress", + "gauge" ], - "_resolved": "https://registry.npmjs.org/gauge/-/gauge-2.7.4.tgz", - "_shasum": "2c03405c7538c39d7eb37b317022e325fb018bf7", - "_spec": "gauge@~2.7.3", - "_where": "/Users/rebecca/code/npm/node_modules/npmlog", - "author": { - "name": "Rebecca Turner", - "email": "me@re-becca.org" - }, + "author": "Rebecca Turner ", + "license": "ISC", "bugs": { "url": "https://github.com/iarna/gauge/issues" }, - "bundleDependencies": false, + "homepage": "https://github.com/iarna/gauge", "dependencies": { "aproba": "^1.0.3", "console-control-strings": "^1.0.0", @@ -43,8 +32,6 @@ "strip-ansi": "^3.0.1", "wide-align": "^1.1.0" }, - "deprecated": false, - "description": "A terminal based horizontal guage", "devDependencies": { "readable-stream": "^2.0.6", "require-inject": "^1.4.0", @@ -72,23 +59,5 @@ "theme-set.js", "themes.js", "wide-truncate.js" - ], - "homepage": "https://github.com/iarna/gauge", - "keywords": [ - "progressbar", - "progress", - "gauge" - ], - "license": "ISC", - "main": "index.js", - "name": "gauge", - "repository": { - "type": "git", - "url": "git+https://github.com/iarna/gauge.git" - }, - "scripts": { - "prepublish": "rm -f *~", - "test": "standard && tap test/*.js --coverage" - }, - "version": "2.7.4" + ] } diff --git a/deps/npm/node_modules/genfun/CHANGELOG.md b/deps/npm/node_modules/genfun/CHANGELOG.md deleted file mode 100644 index 461e22fc596261..00000000000000 --- a/deps/npm/node_modules/genfun/CHANGELOG.md +++ /dev/null @@ -1,53 +0,0 @@ -# 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. - - -# [5.0.0](https://github.com/zkat/genfun/compare/v4.0.1...v5.0.0) (2017-12-12) - - -### Bug Fixes - -* **license:** relicense to MIT ([857e720](https://github.com/zkat/genfun/commit/857e720)) -* **platforms:** drop support for node 4 and 7 ([2cdbe32](https://github.com/zkat/genfun/commit/2cdbe32)) - - -### BREAKING CHANGES - -* **platforms:** node 4 and node 7 are no longer officially supported -* **license:** license changed from CC0-1.0 to MIT - - - - -## [4.0.1](https://github.com/zkat/genfun/compare/v4.0.0...v4.0.1) (2017-04-16) - - -### Bug Fixes - -* **cache:** stop side-effecting cached applicableMethods ([09cee84](https://github.com/zkat/genfun/commit/09cee84)) - - - - -# [4.0.0](https://github.com/zkat/genfun/compare/v3.2.1...v4.0.0) (2017-04-16) - - -### Bug Fixes - -* **genfun:** make internal properties private ([e855c72](https://github.com/zkat/genfun/commit/e855c72)) -* **perf:** short-circuit default methods ([7a9b06b](https://github.com/zkat/genfun/commit/7a9b06b)) - - -### Features - -* **addMethod:** default-method shortcut syntax for gf.add ([40a3ebb](https://github.com/zkat/genfun/commit/40a3ebb)) -* **genfun:** default method and name opts + default shortcut ([0a40939](https://github.com/zkat/genfun/commit/0a40939)) -* **genfun:** now with inheritance! ([74abcc2](https://github.com/zkat/genfun/commit/74abcc2)) -* **nextMethod:** arg-based nextMethod calls ([17a0b35](https://github.com/zkat/genfun/commit/17a0b35)) -* **noNext:** allow users to disable nextMethod functionality ([cc00d95](https://github.com/zkat/genfun/commit/cc00d95)) - - -### BREAKING CHANGES - -* **nextMethod:** next methods are now passed in as arguments. context/callNextMethod/etc are all gone. diff --git a/deps/npm/node_modules/genfun/LICENSE b/deps/npm/node_modules/genfun/LICENSE deleted file mode 100644 index ab41caa64b86cf..00000000000000 --- a/deps/npm/node_modules/genfun/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) -Copyright (c) 2017 Kat Marchán - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE -OR OTHER DEALINGS IN THE SOFTWARE. - diff --git a/deps/npm/node_modules/genfun/README.md b/deps/npm/node_modules/genfun/README.md deleted file mode 100644 index 01417ff8797896..00000000000000 --- a/deps/npm/node_modules/genfun/README.md +++ /dev/null @@ -1,223 +0,0 @@ -# Genfun [![Travis](https://img.shields.io/travis/zkat/genfun.svg)](https://travis-ci.org/zkat/genfun) [![npm](https://img.shields.io/npm/v/genfun.svg)](https://npm.im/genfun) [![npm](https://img.shields.io/npm/l/genfun.svg)](https://npm.im/genfun) - -[`genfun`](https://github.com/zkat/genfun) is a Javascript library that lets you -define generic functions: regular-seeming functions that can be invoked just -like any other function, but that automatically dispatch methods based on the -combination of arguments passed to it when it's called, also known as multiple -dispatch. - -It was inspired by [Slate](http://slatelanguage.org/), -[CLOS](http://en.wikipedia.org/wiki/CLOS) and -[Sheeple](http://github.com/zkat/sheeple). - -## Install - -`$ npm install genfun` - -## Table of Contents - -* [Example](#example) -* [API](#api) - * [`Genfun()`](#genfun) - * [`gf.add()`](#addMethod) - * [`Genfun.callNextMethod()`](#callNextMethod) - * [`Genfun.noApplicableMethod()`](#noApplicableMethod) -* [Performance](#performance) - -### Example - -Various examples are available to look at in the examples/ folder included in -this project. Most examples are also runnable by just invoking them with node. - -```javascript -import Genfun from "genfun" - -class Person {} -class Dog {} - -const frobnicate = Genfun() - -frobnicate.add([Person], (person) => { - console.log('Got a person!') -}) - -frobnicate.add([Dog], (dog) => { - console.log('Got a dog!') -}) - -frobnicate.add([String, Person, Dog], (greeting, person, dog) => { - console.log(person, ' greets ', dog, ', \'' + greeting + '\'') -}) - -const person = new Person() -const dog = new Dog() - -frobnicate(person) // Got a person! -frobnicate(dog) // Got a dog! -frobnicate('Hi, dog!', person, dog); // {} greets {}, 'Hi, dog!' -``` - -### API - -The basic API for `Genfun` is fairly simple: You create a new `genfun` by -calling `Genfun()`, and add methods to them. Then you call the `genfun` object -like a regular function, and it takes care of dispatching the appropriate -methods! - -#### `Genfun()` - -Takes no arguments. Simply creates a new `genfun`. A `genfun` is a regular -function object with overriden function call/dispatch behavior. - -When called, it will look at its arguments and determine if a matching method -has been defined that applies to **all** arguments passed in, considered -together. - -New methods may be added to the `genfun` object with [`gf.add()`](#addMethod). - -If no method is found, or none has been defined, it will invoke -[`Genfun.noApplicableMethod`](#noApplicableMethod) with the appropriate -arguments. - -Genfuns preserve the value of `this` if invoked using `.call` or `.apply`. - -##### Example - -```javascript -var gf = Genfun() - -//... add some methods .. - -// These calls are all identical. -gf(1, 2, 3) -gf.call(null, 1, 2, 3) -gf.apply(null, [1, 2, 3]) -``` - -#### `gf.add(, )` - -Adds a new method to `gf` and returns `gf` to allow chaining multiple `add`s. - -`` must be an array of objects that will receive new `Role`s (dispatch -positions) for the method. If an object in the selector is a function, its -`.prototype` field will receive the new `Role`. The array must not contain any -frozen objects. - -When a `genfun` is called (like a function), it will look at its set of added -methods and, based on the `Role`s assigned, and corresponding prototype chains, -will determine which method, if any, will be invoked. On invocation, a method's -`` argument will be the called with the arguments passed to the `genfun`, -including its `this` and `arguments` values`. - -Within the ``, [`Genfun.callNextMethod`](#callNextMethod) may be called. - -##### Example - -```javascript - -var numStr = Genfun() - -numStr.add([String, Number], function (str, num) { - console.log('got a str:', str, 'and a num: ', num) -}) - -numStr.add([Number, String], function (num, str) { - console.log('got a num:', num, 'and a str:', str) -}) - -``` - -#### `Genfun.callNextMethod([...])` - -**NOTE**: This function can only be called synchronously. To call it -asynchronously (for example, in a `Promise` or in a callback), use -[`getContext`](#getContext) - -Calls the "next" applicable method in the method chain. Can only be called -within the body of a method. - -If no arguments are given, `callNextMethod` will pass the current method's -original arguments to the next method. - -If arguments are passed to `callNextMethod`, it will invoke the next applicable -method (based on the **original** method list calculation), with **the given -arguments**, even if they would otherwise not have triggered that method. - -Returns whatever value the next method returns. - -There **must** be a next method available when invoked. This function **will -not** call `noApplicableMethod` when it runs out of methods to call. It will -instead throw an error. - -##### Example - -```javascript -class Foo {} -class Bar extends Foo {} - -var cnm = Genfun() - -cnm.add([Foo], function (foo) { - console.log('calling the method on Foo with', foo) - return foo -}) - -cnm.add([Bar], function (bar) { - console.log('calling the method on Bar with', bar) - return Genfun.callNextMethod('some other value!') -}) - -cnm(new Bar()) -// calling the method on Bar with {} -// calling the method on Foo with "some other value!" -// => 'some other value!' -``` - -#### `Genfun.getContext()` - -The `context` returned by this function will have a `callNextMethod` method -which can be used to invoke the correct next method even during asynchronous -calls (for example, when used in a callback or a `Promise`). - -This function must be called synchronously within the body of the method before -any asynchronous calls, and will error if invoked outside the context of a -method call. - -##### Example - -```javascript -someGenfun.add([MyThing], function (thing) { - const ctx = Genfun.getContext() - return somePromisedCall(thing).then(res => ctx.callNextMethod(res)) -}) -``` - -#### `Genfun.noApplicableMethod(, , )` - -`Genfun.noApplicableMethod` is a `genfun` itself, which is called whenever **any `genfun`** fails to find a matching method for its given arguments. - -It will be called with the `genfun` as its first argument, then the `this` -value, and then the arguments it was called with. - -By default, this will simply throw a NoApplicableMethod error. - -Users may override this behavior for particular `genfun` and `this` -combinations, although `args` will always be an `Array`. The value returned from -the dispatched `noApplicableMethod` method will be returned by `genfun` as if it -had been its original method. Comparable to [Ruby's -`method_missing`](http://ruby-doc.org/core-2.1.0/BasicObject.html#method-i-method_missing). - -### Performance - -`Genfun` pulls a few caching tricks to make sure dispatch, specially for common -cases, is as fast as possible. - -How fast? Well, not much slower than native methods: - -``` -Regular function: 30.402ms -Native method: 28.109ms -Singly-dispatched genfun: 64.467ms -Double-dispatched genfun: 70.052ms -Double-dispatched genfun with string primitive: 76.742ms -``` diff --git a/deps/npm/node_modules/genfun/lib/genfun.js b/deps/npm/node_modules/genfun/lib/genfun.js deleted file mode 100644 index c6ba01ca54bb06..00000000000000 --- a/deps/npm/node_modules/genfun/lib/genfun.js +++ /dev/null @@ -1,296 +0,0 @@ -'use strict' - -const Method = require('./method') -const Role = require('./role') -const util = require('./util') - -const kCache = Symbol('cache') -const kDefaultMethod = Symbol('defaultMethod') -const kMethods = Symbol('methods') -const kNoNext = Symbol('noNext') - -module.exports = function genfun (opts) { - function gf () { - if (!gf[kMethods].length && gf[kDefaultMethod]) { - return gf[kDefaultMethod].func.apply(this, arguments) - } else { - return gf.applyGenfun(this, arguments) - } - } - Object.setPrototypeOf(gf, Genfun.prototype) - gf[kMethods] = [] - gf[kCache] = {key: [], methods: [], state: STATES.UNINITIALIZED} - if (opts && typeof opts === 'function') { - gf.add(opts) - } else if (opts && opts.default) { - gf.add(opts.default) - } - if (opts && opts.name) { - Object.defineProperty(gf, 'name', { - value: opts.name - }) - } - if (opts && opts.noNextMethod) { - gf[kNoNext] = true - } - return gf -} - -class Genfun extends Function {} -Genfun.prototype.isGenfun = true - -const STATES = { - UNINITIALIZED: 0, - MONOMORPHIC: 1, - POLYMORPHIC: 2, - MEGAMORPHIC: 3 -} - -const MAX_CACHE_SIZE = 32 - -/** - * Defines a method on a generic function. - * - * @function - * @param {Array-like} selector - Selector array for dispatching the method. - * @param {Function} methodFunction - Function to execute when the method - * successfully dispatches. - */ -Genfun.prototype.add = function addMethod (selector, func) { - if (!func && typeof selector === 'function') { - func = selector - selector = [] - } - selector = [].slice.call(selector) - for (var i = 0; i < selector.length; i++) { - if (!selector.hasOwnProperty(i)) { - selector[i] = Object.prototype - } - } - this[kCache] = {key: [], methods: [], state: STATES.UNINITIALIZED} - let method = new Method(this, selector, func) - if (selector.length) { - this[kMethods].push(method) - } else { - this[kDefaultMethod] = method - } - return this -} - -/** - * Removes a previously-defined method on `genfun` that matches - * `selector` exactly. - * - * @function - * @param {Genfun} genfun - Genfun to remove a method from. - * @param {Array-like} selector - Objects to match on when finding a - * method to remove. - */ -Genfun.prototype.rm = function removeMethod () { - throw new Error('not yet implemented') -} - -/** - * Returns true if there are methods that apply to the given arguments on - * `genfun`. Additionally, makes sure the cache is warmed up for the given - * arguments. - * - */ -Genfun.prototype.hasMethod = function hasMethod () { - const methods = this.getApplicableMethods(arguments) - return !!(methods && methods.length) -} - -/** - * This generic function is called when `genfun` has been called and no - * applicable method was found. The default method throws an `Error`. - * - * @function - * @param {Genfun} genfun - Generic function instance that was called. - * @param {*} newthis - value of `this` the genfun was called with. - * @param {Array} callArgs - Arguments the genfun was called with. - */ -module.exports.noApplicableMethod = module.exports() -module.exports.noApplicableMethod.add([], (gf, thisArg, args) => { - let msg = - 'No applicable method found when called with arguments of types: (' + - [].map.call(args, (arg) => { - return (/\[object ([a-zA-Z0-9]+)\]/) - .exec(({}).toString.call(arg))[1] - }).join(', ') + ')' - let err = new Error(msg) - err.genfun = gf - err.thisArg = thisArg - err.args = args - throw err -}) - -/* - * Internal - */ -Genfun.prototype.applyGenfun = function applyGenfun (newThis, args) { - let applicableMethods = this.getApplicableMethods(args) - if (applicableMethods.length === 1 || this[kNoNext]) { - return applicableMethods[0].func.apply(newThis, args) - } else if (applicableMethods.length > 1) { - let idx = 0 - const nextMethod = function nextMethod () { - if (arguments.length) { - // Replace args if passed in explicitly - args = arguments - Array.prototype.push.call(args, nextMethod) - } - const next = applicableMethods[idx++] - if (idx >= applicableMethods.length) { - Array.prototype.pop.call(args) - } - return next.func.apply(newThis, args) - } - Array.prototype.push.call(args, nextMethod) - return nextMethod() - } else { - return module.exports.noApplicableMethod(this, newThis, args) - } -} - -Genfun.prototype.getApplicableMethods = function getApplicableMethods (args) { - if (!args.length || !this[kMethods].length) { - return this[kDefaultMethod] ? [this[kDefaultMethod]] : [] - } - let applicableMethods - let maybeMethods = cachedMethods(this, args) - if (maybeMethods) { - applicableMethods = maybeMethods - } else { - applicableMethods = computeApplicableMethods(this, args) - cacheArgs(this, args, applicableMethods) - } - return applicableMethods -} - -function cacheArgs (genfun, args, methods) { - if (genfun[kCache].state === STATES.MEGAMORPHIC) { return } - var key = [] - var proto - for (var i = 0; i < args.length; i++) { - proto = cacheableProto(genfun, args[i]) - if (proto) { - key[i] = proto - } else { - return null - } - } - genfun[kCache].key.unshift(key) - genfun[kCache].methods.unshift(methods) - if (genfun[kCache].key.length === 1) { - genfun[kCache].state = STATES.MONOMORPHIC - } else if (genfun[kCache].key.length < MAX_CACHE_SIZE) { - genfun[kCache].state = STATES.POLYMORPHIC - } else { - genfun[kCache].state = STATES.MEGAMORPHIC - } -} - -function cacheableProto (genfun, arg) { - var dispatchable = util.dispatchableObject(arg) - if (Object.hasOwnProperty.call(dispatchable, Role.roleKeyName)) { - for (var j = 0; j < dispatchable[Role.roleKeyName].length; j++) { - var role = dispatchable[Role.roleKeyName][j] - if (role.method.genfun === genfun) { - return null - } - } - } - return Object.getPrototypeOf(dispatchable) -} - -function cachedMethods (genfun, args) { - if (genfun[kCache].state === STATES.UNINITIALIZED || - genfun[kCache].state === STATES.MEGAMORPHIC) { - return null - } - var protos = [] - var proto - for (var i = 0; i < args.length; i++) { - proto = cacheableProto(genfun, args[i]) - if (proto) { - protos[i] = proto - } else { - return - } - } - for (i = 0; i < genfun[kCache].key.length; i++) { - if (matchCachedMethods(genfun[kCache].key[i], protos)) { - return genfun[kCache].methods[i] - } - } -} - -function matchCachedMethods (key, protos) { - if (key.length !== protos.length) { return false } - for (var i = 0; i < key.length; i++) { - if (key[i] !== protos[i]) { - return false - } - } - return true -} - -function computeApplicableMethods (genfun, args) { - args = [].slice.call(args) - let discoveredMethods = [] - function findAndRankRoles (object, hierarchyPosition, index) { - var roles = Object.hasOwnProperty.call(object, Role.roleKeyName) - ? object[Role.roleKeyName] - : [] - roles.forEach(role => { - if (role.method.genfun === genfun && index === role.position) { - if (discoveredMethods.indexOf(role.method) < 0) { - Method.clearRank(role.method) - discoveredMethods.push(role.method) - } - Method.setRankHierarchyPosition(role.method, index, hierarchyPosition) - } - }) - // When a discovered method would receive more arguments than - // were specialized, we pretend all extra arguments have a role - // on Object.prototype. - if (util.isObjectProto(object)) { - discoveredMethods.forEach(method => { - if (method.minimalSelector <= index) { - Method.setRankHierarchyPosition(method, index, hierarchyPosition) - } - }) - } - } - args.forEach((arg, index) => { - getPrecedenceList(util.dispatchableObject(arg)) - .forEach((obj, hierarchyPosition) => { - findAndRankRoles(obj, hierarchyPosition, index) - }) - }) - let applicableMethods = discoveredMethods.filter(method => { - return (args.length === method._rank.length && - Method.isFullySpecified(method)) - }) - applicableMethods.sort((a, b) => Method.score(a) - Method.score(b)) - if (genfun[kDefaultMethod]) { - applicableMethods.push(genfun[kDefaultMethod]) - } - return applicableMethods -} - -/* - * Helper function for getting an array representing the entire - * inheritance/precedence chain for an object by navigating its - * prototype pointers. - */ -function getPrecedenceList (obj) { - var precedenceList = [] - var nextObj = obj - while (nextObj) { - precedenceList.push(nextObj) - nextObj = Object.getPrototypeOf(nextObj) - } - return precedenceList -} diff --git a/deps/npm/node_modules/genfun/lib/method.js b/deps/npm/node_modules/genfun/lib/method.js deleted file mode 100644 index eddb7d325370ea..00000000000000 --- a/deps/npm/node_modules/genfun/lib/method.js +++ /dev/null @@ -1,82 +0,0 @@ -'use strict' - -/* - * Method - * - * Methods are added, conceptually, to Genfuns, not to objects - * themselves, although the Genfun object does not have any pointers to - * method objects. - * - * The _rank vector is an internal datastructure used during dispatch - * to figure out whether a method is applicable, and if so, how to - * order multiple discovered methods. - * - * Right now, the score method on Method does not take into account any - * ordering, and all arguments to a method are ranked equally for the - * sake of ordering. - * - */ -const Role = require('./role') -const util = require('./util') - -module.exports = Method -function Method (genfun, selector, func) { - var method = this - method.genfun = genfun - method.func = func - method._rank = [] - method.minimalSelector = 0 - - const tmpSelector = selector.length ? selector : [Object.prototype] - for (var object, i = tmpSelector.length - 1; i >= 0; i--) { - object = Object.hasOwnProperty.call(tmpSelector, i) - ? tmpSelector[i] - : Object.prototype - object = util.dispatchableObject(object) - if ( - typeof object === 'function' && - !object.isGenfun - ) { - object = object.prototype - } - if (i > 0 && - !method.minimalSelector && - util.isObjectProto(object)) { - continue - } else { - method.minimalSelector++ - if (!Object.hasOwnProperty.call(object, Role.roleKeyName)) { - // Object.defineProperty is JS 1.8.0+ - Object.defineProperty( - object, Role.roleKeyName, {value: [], enumerable: false}) - } - // XXX HACK - no method replacement now, so we just shove - // it in a place where it'll always show up first. This - // would probably seriously break method combination if we - // had it. - object[Role.roleKeyName].unshift(new Role(method, i)) - } - } -} - -Method.setRankHierarchyPosition = (method, index, hierarchyPosition) => { - method._rank[index] = hierarchyPosition -} - -Method.clearRank = method => { - method._rank = [] -} - -Method.isFullySpecified = method => { - for (var i = 0; i < method.minimalSelector; i++) { - if (!method._rank.hasOwnProperty(i)) { - return false - } - } - return true -} - -Method.score = method => { - // TODO - this makes all items in the list equal - return method._rank.reduce((a, b) => a + b, 0) -} diff --git a/deps/npm/node_modules/genfun/lib/role.js b/deps/npm/node_modules/genfun/lib/role.js deleted file mode 100644 index 69e35c2e585cb7..00000000000000 --- a/deps/npm/node_modules/genfun/lib/role.js +++ /dev/null @@ -1,17 +0,0 @@ -'use strict' - -/* - * Role - * - * A Role encapsulates a particular object's 'role' in a method's - * dispatch. They are added directly to the selector for a method, and thus - * do not prevent the objects a method was defined on from being garbage - * collected. - */ -module.exports = Role -function Role (method, position) { - this.method = method - this.position = position -} - -Role.roleKeyName = Symbol('roles') diff --git a/deps/npm/node_modules/genfun/lib/util.js b/deps/npm/node_modules/genfun/lib/util.js deleted file mode 100644 index 23770629d346f8..00000000000000 --- a/deps/npm/node_modules/genfun/lib/util.js +++ /dev/null @@ -1,37 +0,0 @@ -'use strict' - -module.exports.isObjectProto = isObjectProto -function isObjectProto (obj) { - return obj === Object.prototype -} - -const _null = {} -const _undefined = {} -const Bool = Boolean -const Num = Number -const Str = String -const boolCache = { - true: new Bool(true), - false: new Bool(false) -} -const numCache = {} -const strCache = {} - -/* - * Returns a useful dispatch object for value using a process similar to - * the ToObject operation specified in http://es5.github.com/#x9.9 - */ -module.exports.dispatchableObject = dispatchableObject -function dispatchableObject (value) { - // To shut up jshint, which doesn't let me turn off this warning. - const Obj = Object - if (value === null) { return _null } - if (value === undefined) { return _undefined } - switch (typeof value) { - case 'object': return value - case 'boolean': return boolCache[value] - case 'number': return numCache[value] || (numCache[value] = new Num(value)) - case 'string': return strCache[value] || (strCache[value] = new Str(value)) - default: return new Obj(value) - } -} diff --git a/deps/npm/node_modules/genfun/package.json b/deps/npm/node_modules/genfun/package.json deleted file mode 100644 index 4a557eb45a3f9d..00000000000000 --- a/deps/npm/node_modules/genfun/package.json +++ /dev/null @@ -1,79 +0,0 @@ -{ - "_from": "genfun@^5.0.0", - "_id": "genfun@5.0.0", - "_inBundle": false, - "_integrity": "sha512-KGDOARWVga7+rnB3z9Sd2Letx515owfk0hSxHGuqjANb1M+x2bGZGqHLiozPsYMdM2OubeMni/Hpwmjq6qIUhA==", - "_location": "/genfun", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "genfun@^5.0.0", - "name": "genfun", - "escapedName": "genfun", - "rawSpec": "^5.0.0", - "saveSpec": null, - "fetchSpec": "^5.0.0" - }, - "_requiredBy": [ - "/protoduck" - ], - "_resolved": "https://registry.npmjs.org/genfun/-/genfun-5.0.0.tgz", - "_shasum": "9dd9710a06900a5c4a5bf57aca5da4e52fe76537", - "_spec": "genfun@^5.0.0", - "_where": "/Users/zkat/Documents/code/work/npm/node_modules/protoduck", - "author": { - "name": "Kat Marchán", - "email": "kzm@sykosomatic.org" - }, - "bugs": { - "url": "https://github.com/zkat/genfun/issues" - }, - "bundleDependencies": false, - "dependencies": {}, - "deprecated": false, - "description": "Fast, prototype-friendly multimethods.", - "devDependencies": { - "mocha": "^3.2.0", - "nyc": "^10.2.0", - "standard": "^10.0.2", - "standard-version": "^4.0.0", - "weallbehave": "^1.0.3", - "weallcontribute": "^1.0.8" - }, - "files": [ - "lib/*.js" - ], - "homepage": "http://github.com/zkat/genfun", - "keywords": [ - "clos", - "functional", - "oop", - "util", - "object oriented", - "prototypes", - "multimethod", - "generic functions", - "multiple dispatch", - "polymorphism", - "polymorphic", - "protocols" - ], - "license": "MIT", - "main": "lib/genfun.js", - "name": "genfun", - "repository": { - "type": "git", - "url": "git://github.com/zkat/genfun.git" - }, - "scripts": { - "postrelease": "npm publish && git push --follow-tags", - "prerelease": "npm t", - "pretest": "standard lib", - "release": "standard-version -s", - "test": "nyc -- mocha --reporter spec", - "update-coc": "weallbehave -o . && git add CODE_OF_CONDUCT.md && git commit -m 'docs(coc): updated CODE_OF_CONDUCT.md'", - "update-contrib": "weallcontribute -o . && git add CONTRIBUTING.md && git commit -m 'docs(contributing): updated CONTRIBUTING.md'" - }, - "version": "5.0.0" -} diff --git a/deps/npm/node_modules/gentle-fs/CHANGELOG.md b/deps/npm/node_modules/gentle-fs/CHANGELOG.md deleted file mode 100644 index 116c0118f0efe6..00000000000000 --- a/deps/npm/node_modules/gentle-fs/CHANGELOG.md +++ /dev/null @@ -1,113 +0,0 @@ -# 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. - - -## [2.3.1](https://github.com/npm/gentle-fs/compare/v2.3.0...v2.3.1) (2020-03-25) - - - - -# [2.3.0](https://github.com/npm/gentle-fs/compare/v2.2.1...v2.3.0) (2019-12-11) - - -### Features - -* add option to gently create bin links/shims ([a929196](https://github.com/npm/gentle-fs/commit/a929196)) - - - - -## [2.2.1](https://github.com/npm/gentle-fs/compare/v2.2.0...v2.2.1) (2019-08-15) - - -### Bug Fixes - -* **link:** properly detect that we should chown the link ([1c69beb](https://github.com/npm/gentle-fs/commit/1c69beb)) - - - - -# [2.2.0](https://github.com/npm/gentle-fs/compare/v2.1.0...v2.2.0) (2019-08-14) - - -### Bug Fixes - -* don't chown if we didn't make any dirs ([c4df8a8](https://github.com/npm/gentle-fs/commit/c4df8a8)) - - -### Features - -* export mkdir method ([4891c09](https://github.com/npm/gentle-fs/commit/4891c09)) - - - - -# [2.1.0](https://github.com/npm/gentle-fs/compare/v2.0.1...v2.1.0) (2019-08-14) - - -### Features - -* infer ownership of created dirs and links ([0dd2879](https://github.com/npm/gentle-fs/commit/0dd2879)) - - - - -## [2.0.1](https://github.com/npm/gentle-fs/compare/v2.0.0...v2.0.1) (2017-11-28) - - -### Bug Fixes - -* **pkglock:** regenerate lock to fix version issues ([a41cbd0](https://github.com/npm/gentle-fs/commit/a41cbd0)) -* **rm:** make sure logic for vacuuming matches original npm ([673e82c](https://github.com/npm/gentle-fs/commit/673e82c)) - - - - -# [2.0.0](https://github.com/npm/gentle-fs/compare/v1.0.2...v2.0.0) (2017-10-07) - - -### Features - -* **api:** switch to callbacks for now. ([236e886](https://github.com/npm/gentle-fs/commit/236e886)) - - -### BREAKING CHANGES - -* **api:** switches from Promises to callbacks for async control flow. - - - - -## [1.0.2](https://github.com/npm/gentle-fs/compare/v1.0.1...v1.0.2) (2017-10-07) - - -### Bug Fixes - -* **link:** properly resolve linkIfExists promise ([f06acf2](https://github.com/npm/gentle-fs/commit/f06acf2)) - - - - -## [1.0.1](https://github.com/npm/gentle-fs/compare/v1.0.0...v1.0.1) (2017-09-25) - - -### Bug Fixes - -* **files:** include required lib files in tarball ([e0be6a8](https://github.com/npm/gentle-fs/commit/e0be6a8)) - - - - -# 1.0.0 (2017-09-15) - - -### Bug Fixes - -* **docs:** Flesh out API descriptions. ([b056a34](https://github.com/npm/gentle-fs/commit/b056a34)) -* **docs:** update usage examples ([5517ff5](https://github.com/npm/gentle-fs/commit/5517ff5)) - - -### BREAKING CHANGES - -* **docs:** api docs added diff --git a/deps/npm/node_modules/gentle-fs/LICENSE b/deps/npm/node_modules/gentle-fs/LICENSE deleted file mode 100644 index 0b6c2287459632..00000000000000 --- a/deps/npm/node_modules/gentle-fs/LICENSE +++ /dev/null @@ -1,235 +0,0 @@ -The npm application -Copyright (c) npm, Inc. and Contributors -Licensed on the terms of The Artistic License 2.0 - -Node package dependencies of the npm application -Copyright (c) their respective copyright owners -Licensed on their respective license terms - -The npm public registry at https://registry.npmjs.org -and the npm website at https://www.npmjs.com -Operated by npm, Inc. -Use governed by terms published on https://www.npmjs.com - -"Node.js" -Trademark Joyent, Inc., https://joyent.com -Neither npm nor npm, Inc. are affiliated with Joyent, Inc. - -The Node.js application -Project of Node Foundation, https://nodejs.org - -The npm Logo -Copyright (c) Mathias Pettersson and Brian Hammond - -"Gubblebum Blocky" typeface -Copyright (c) Tjarda Koster, https://jelloween.deviantart.com -Used with permission - - --------- - - -The Artistic License 2.0 - -Copyright (c) 2000-2006, The Perl Foundation. - -Everyone is permitted to copy and distribute verbatim copies -of this license document, but changing it is not allowed. - -Preamble - -This license establishes the terms under which a given free software -Package may be copied, modified, distributed, and/or redistributed. -The intent is that the Copyright Holder maintains some artistic -control over the development of that Package while still keeping the -Package available as open source and free software. - -You are always permitted to make arrangements wholly outside of this -license directly with the Copyright Holder of a given Package. If the -terms of this license do not permit the full use that you propose to -make of the Package, you should contact the Copyright Holder and seek -a different licensing arrangement. - -Definitions - - "Copyright Holder" means the individual(s) or organization(s) - named in the copyright notice for the entire Package. - - "Contributor" means any party that has contributed code or other - material to the Package, in accordance with the Copyright Holder's - procedures. - - "You" and "your" means any person who would like to copy, - distribute, or modify the Package. - - "Package" means the collection of files distributed by the - Copyright Holder, and derivatives of that collection and/or of - those files. A given Package may consist of either the Standard - Version, or a Modified Version. - - "Distribute" means providing a copy of the Package or making it - accessible to anyone else, or in the case of a company or - organization, to others outside of your company or organization. - - "Distributor Fee" means any fee that you charge for Distributing - this Package or providing support for this Package to another - party. It does not mean licensing fees. - - "Standard Version" refers to the Package if it has not been - modified, or has been modified only in ways explicitly requested - by the Copyright Holder. - - "Modified Version" means the Package, if it has been changed, and - such changes were not explicitly requested by the Copyright - Holder. - - "Original License" means this Artistic License as Distributed with - the Standard Version of the Package, in its current version or as - it may be modified by The Perl Foundation in the future. - - "Source" form means the source code, documentation source, and - configuration files for the Package. - - "Compiled" form means the compiled bytecode, object code, binary, - or any other form resulting from mechanical transformation or - translation of the Source form. - - -Permission for Use and Modification Without Distribution - -(1) You are permitted to use the Standard Version and create and use -Modified Versions for any purpose without restriction, provided that -you do not Distribute the Modified Version. - - -Permissions for Redistribution of the Standard Version - -(2) You may Distribute verbatim copies of the Source form of the -Standard Version of this Package in any medium without restriction, -either gratis or for a Distributor Fee, provided that you duplicate -all of the original copyright notices and associated disclaimers. At -your discretion, such verbatim copies may or may not include a -Compiled form of the Package. - -(3) You may apply any bug fixes, portability changes, and other -modifications made available from the Copyright Holder. The resulting -Package will still be considered the Standard Version, and as such -will be subject to the Original License. - - -Distribution of Modified Versions of the Package as Source - -(4) You may Distribute your Modified Version as Source (either gratis -or for a Distributor Fee, and with or without a Compiled form of the -Modified Version) provided that you clearly document how it differs -from the Standard Version, including, but not limited to, documenting -any non-standard features, executables, or modules, and provided that -you do at least ONE of the following: - - (a) make the Modified Version available to the Copyright Holder - of the Standard Version, under the Original License, so that the - Copyright Holder may include your modifications in the Standard - Version. - - (b) ensure that installation of your Modified Version does not - prevent the user installing or running the Standard Version. In - addition, the Modified Version must bear a name that is different - from the name of the Standard Version. - - (c) allow anyone who receives a copy of the Modified Version to - make the Source form of the Modified Version available to others - under - - (i) the Original License or - - (ii) a license that permits the licensee to freely copy, - modify and redistribute the Modified Version using the same - licensing terms that apply to the copy that the licensee - received, and requires that the Source form of the Modified - Version, and of any works derived from it, be made freely - available in that license fees are prohibited but Distributor - Fees are allowed. - - -Distribution of Compiled Forms of the Standard Version -or Modified Versions without the Source - -(5) You may Distribute Compiled forms of the Standard Version without -the Source, provided that you include complete instructions on how to -get the Source of the Standard Version. Such instructions must be -valid at the time of your distribution. If these instructions, at any -time while you are carrying out such distribution, become invalid, you -must provide new instructions on demand or cease further distribution. -If you provide valid instructions or cease distribution within thirty -days after you become aware that the instructions are invalid, then -you do not forfeit any of your rights under this license. - -(6) You may Distribute a Modified Version in Compiled form without -the Source, provided that you comply with Section 4 with respect to -the Source of the Modified Version. - - -Aggregating or Linking the Package - -(7) You may aggregate the Package (either the Standard Version or -Modified Version) with other packages and Distribute the resulting -aggregation provided that you do not charge a licensing fee for the -Package. Distributor Fees are permitted, and licensing fees for other -components in the aggregation are permitted. The terms of this license -apply to the use and Distribution of the Standard or Modified Versions -as included in the aggregation. - -(8) You are permitted to link Modified and Standard Versions with -other works, to embed the Package in a larger work of your own, or to -build stand-alone binary or bytecode versions of applications that -include the Package, and Distribute the result without restriction, -provided the result does not expose a direct interface to the Package. - - -Items That are Not Considered Part of a Modified Version - -(9) Works (including, but not limited to, modules and scripts) that -merely extend or make use of the Package, do not, by themselves, cause -the Package to be a Modified Version. In addition, such works are not -considered parts of the Package itself, and are not subject to the -terms of this license. - - -General Provisions - -(10) Any use, modification, and distribution of the Standard or -Modified Versions is governed by this Artistic License. By using, -modifying or distributing the Package, you accept this license. Do not -use, modify, or distribute the Package, if you do not accept this -license. - -(11) If your Modified Version has been derived from a Modified -Version made by someone other than you, you are nevertheless required -to ensure that your Modified Version complies with the requirements of -this license. - -(12) This license does not grant you the right to use any trademark, -service mark, tradename, or logo of the Copyright Holder. - -(13) This license includes the non-exclusive, worldwide, -free-of-charge patent license to make, have made, use, offer to sell, -sell, import and otherwise transfer the Package with respect to any -patent claims licensable by the Copyright Holder that are necessarily -infringed by the Package. If you institute patent litigation -(including a cross-claim or counterclaim) against any party alleging -that the Package constitutes direct or contributory patent -infringement, then this Artistic License to you shall terminate on the -date that such litigation is filed. - -(14) Disclaimer of Warranty: -THE PACKAGE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS -IS' AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES. THE IMPLIED -WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR -NON-INFRINGEMENT ARE DISCLAIMED TO THE EXTENT PERMITTED BY YOUR LOCAL -LAW. UNLESS REQUIRED BY LAW, NO COPYRIGHT HOLDER OR CONTRIBUTOR WILL -BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL -DAMAGES ARISING IN ANY WAY OUT OF THE USE OF THE PACKAGE, EVEN IF -ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - - --------- diff --git a/deps/npm/node_modules/gentle-fs/README.md b/deps/npm/node_modules/gentle-fs/README.md deleted file mode 100644 index f8a3020ac50937..00000000000000 --- a/deps/npm/node_modules/gentle-fs/README.md +++ /dev/null @@ -1,65 +0,0 @@ -# gentle-fs [![npm version](https://img.shields.io/npm/v/gentle-fs.svg)](https://npm.im/gentle-fs) [![license](https://img.shields.io/npm/l/gentle-fs.svg)](https://npm.im/gentle-fs) [![Travis](https://img.shields.io/travis/npm/gentle-fs.svg)](https://travis-ci.org/npm/gentle-fs) [![AppVeyor](https://ci.appveyor.com/api/projects/status/github/npm/gentle-fs?svg=true)](https://ci.appveyor.com/project/npm/gentle-fs) [![Coverage Status](https://coveralls.io/repos/github/npm/gentle-fs/badge.svg?branch=latest)](https://coveralls.io/github/npm/gentle-fs?branch=latest) - -[`gentle-fs`](https://github.com/npm/gentle-fs) is a standalone library for -"gently" remove or link directories. - -## Install - -`$ npm install gentle-fs` - -## Table of Contents - -* [Example](#example) -* [Features](#features) -* [API](#api) - * [`rm`](#rm) - * [`link`](#link) - * [`linkIfExists`](#linkIfExists) - -### Example - -```javascript -// todo -``` - -### Features - -* Performs filesystem operations "gently". Please see details in the API specs below -for a more precise definition of "gently". - -### API - -#### `> rm(target, opts, cb)` - -Will delete all directories between `target` and `opts.base`, as long as they are empty. -That is, if `target` is `/a/b/c/d/e` and `base` is `/a/b`, but `/a/b/c` has other files -besides the `d` directory inside of it, `/a/b/c` will remain. - -##### Example - -```javascript -rm(target, opts, cb) -``` - -#### `> link(from, to, opts, cb)` - -If `from` is a real directory, and `from` is not the same directory as `to`, will -symlink `from` to `to`, while also gently [`rm`](#rm)ing the `to` directory, -and then call the callback. Otherwise, will call callback with an `Error`. - -##### Example - -```javascript -link(from, to, opts, cb) -``` - -#### `> linkIfExists(from, to, opts, cb)` - -Performs the same operation as [`link`](#link), except does nothing when `from` is the -same as `to`, and calls the callback. - -##### Example - -```javascript -linkIfExists(from, to, opts, cb) -``` diff --git a/deps/npm/node_modules/gentle-fs/index.js b/deps/npm/node_modules/gentle-fs/index.js deleted file mode 100644 index 4aeda1c846bf2b..00000000000000 --- a/deps/npm/node_modules/gentle-fs/index.js +++ /dev/null @@ -1,14 +0,0 @@ -'use strict' - -const rm = require('./lib/rm.js') -const link = require('./lib/link.js') -const mkdir = require('./lib/mkdir.js') -const binLink = require('./lib/bin-link.js') - -exports = module.exports = { - rm: rm, - link: link.link, - linkIfExists: link.linkIfExists, - mkdir: mkdir, - binLink: binLink -} diff --git a/deps/npm/node_modules/gentle-fs/lib/bin-link.js b/deps/npm/node_modules/gentle-fs/lib/bin-link.js deleted file mode 100644 index 104c5b6c935c88..00000000000000 --- a/deps/npm/node_modules/gentle-fs/lib/bin-link.js +++ /dev/null @@ -1,96 +0,0 @@ -'use strict' -// calls linkIfExists on unix, or cmdShimIfExists on Windows -// reads the cmd shim to ensure it's where we need it to be in the case of -// top level global packages - -const readCmdShim = require('read-cmd-shim') -const cmdShim = require('cmd-shim') -const {linkIfExists} = require('./link.js') - -const binLink = (from, to, opts, cb) => { - // just for testing - const platform = opts._FAKE_PLATFORM_ || process.platform - if (platform !== 'win32') { - return linkIfExists(from, to, opts, cb) - } - - if (!opts.clobberLinkGently || - opts.force === true || - !opts.gently || - typeof opts.gently !== 'string') { - // easy, just go ahead and delete anything in the way - return cmdShim.ifExists(from, to, cb) - } - - // read all three shim targets - // if any exist, and are not a shim to our gently folder, then - // exit with a simulated EEXIST error. - - const shimFiles = [ - to, - to + '.cmd', - to + '.ps1' - ] - - // call this once we've checked all three, if we're good - const done = () => cmdShim.ifExists(from, to, cb) - const then = times(3, done, cb) - shimFiles.forEach(to => isClobberable(from, to, opts, then)) -} - -const times = (n, ok, cb) => { - let errState = null - return er => { - if (!errState) { - if (er) { - cb(errState = er) - } else if (--n === 0) { - ok() - } - } - } -} - -const isClobberable = (from, to, opts, cb) => { - readCmdShim(to, (er, target) => { - // either going to get an error, or the target of where this - // cmd shim points. - // shim, not in opts.gently: simulate EEXIST - // not a shim: simulate EEXIST - // ENOENT: fine, move forward - // shim in opts.gently: fine - if (er) { - switch (er.code) { - case 'ENOENT': - // totally fine, nothing there to clobber - return cb() - case 'ENOTASHIM': - // something is there, and it's not one of ours - return cb(simulateEEXIST(from, to)) - default: - // would probably fail this way later anyway - // can't read the file, likely can't write it either - return cb(er) - } - } - // no error, check the target - if (target.indexOf(opts.gently) !== 0) { - return cb(simulateEEXIST(from, to)) - } - // ok! it's one of ours. - return cb() - }) -} - -const simulateEEXIST = (from, to) => { - // simulate the EEXIST we'd get from fs.symlink to the file - const err = new Error('EEXIST: file already exists, cmd shim \'' + - from + '\' -> \'' + to + '\'') - - err.code = 'EEXIST' - err.path = from - err.dest = to - return err -} - -module.exports = binLink diff --git a/deps/npm/node_modules/gentle-fs/lib/chown.js b/deps/npm/node_modules/gentle-fs/lib/chown.js deleted file mode 100644 index 5921e56345769e..00000000000000 --- a/deps/npm/node_modules/gentle-fs/lib/chown.js +++ /dev/null @@ -1,24 +0,0 @@ -'use strict' - -// A module for chowning things we just created, to preserve -// ownership of new links and directories. - -const chownr = require('chownr') - -const selfOwner = { - uid: process.getuid && process.getuid(), - gid: process.getgid && process.getgid() -} - -module.exports = (path, uid, gid, cb) => { - if (selfOwner.uid !== 0 || - uid === undefined || gid === undefined || - (selfOwner.uid === uid && selfOwner.gid === gid)) { - // don't need to, or can't chown anyway, so just leave it. - // this also handles platforms where process.getuid is undefined - return cb() - } - chownr(path, uid, gid, cb) -} - -module.exports.selfOwner = selfOwner diff --git a/deps/npm/node_modules/gentle-fs/lib/link.js b/deps/npm/node_modules/gentle-fs/lib/link.js deleted file mode 100644 index 7cdfef4ca95d39..00000000000000 --- a/deps/npm/node_modules/gentle-fs/lib/link.js +++ /dev/null @@ -1,126 +0,0 @@ -'use strict' - -const path = require('path') -const fs = require('graceful-fs') -const chain = require('slide').chain -const mkdir = require('./mkdir.js') -const rm = require('./rm.js') -const inferOwner = require('infer-owner') -const chown = require('./chown.js') - -exports = module.exports = { - link: link, - linkIfExists: linkIfExists -} - -function linkIfExists (from, to, opts, cb) { - opts.currentIsLink = false - opts.currentExists = false - fs.stat(from, function (er) { - if (er) return cb() - fs.readlink(to, function (er, fromOnDisk) { - if (!er || er.code !== 'ENOENT') { - opts.currentExists = true - } - // if the link already exists and matches what we would do, - // we don't need to do anything - if (!er) { - opts.currentIsLink = true - var toDir = path.dirname(to) - var absoluteFrom = path.resolve(toDir, from) - var absoluteFromOnDisk = path.resolve(toDir, fromOnDisk) - opts.currentTarget = absoluteFromOnDisk - if (absoluteFrom === absoluteFromOnDisk) return cb() - } - link(from, to, opts, cb) - }) - }) -} - -function resolveIfSymlink (maybeSymlinkPath, cb) { - fs.lstat(maybeSymlinkPath, function (err, stat) { - if (err) return cb.apply(this, arguments) - if (!stat.isSymbolicLink()) return cb(null, maybeSymlinkPath) - fs.readlink(maybeSymlinkPath, cb) - }) -} - -function ensureFromIsNotSource (from, to, cb) { - resolveIfSymlink(from, function (err, fromDestination) { - if (err) return cb.apply(this, arguments) - if (path.resolve(path.dirname(from), fromDestination) === path.resolve(to)) { - return cb(new Error('Link target resolves to the same directory as link source: ' + to)) - } - cb.apply(this, arguments) - }) -} - -function link (from, to, opts, cb) { - to = path.resolve(to) - opts.base = path.dirname(to) - var absTarget = path.resolve(opts.base, from) - var relativeTarget = path.relative(opts.base, absTarget) - var target = opts.absolute ? absTarget : relativeTarget - - const tasks = [ - [ensureFromIsNotSource, absTarget, to], - [fs, 'stat', absTarget], - [clobberLinkGently, from, to, opts], - [mkdir, path.dirname(to)], - [fs, 'symlink', target, to, 'junction'] - ] - - if (chown.selfOwner.uid !== 0) { - chain(tasks, cb) - } else { - inferOwner(to).then(owner => { - tasks.push([chown, to, owner.uid, owner.gid]) - chain(tasks, cb) - }) - } -} - -exports._clobberLinkGently = clobberLinkGently -function clobberLinkGently (from, to, opts, cb) { - if (opts.currentExists === false) { - // nothing to clobber! - opts.log.silly('gently link', 'link does not already exist', { - link: to, - target: from - }) - return cb() - } - - if (!opts.clobberLinkGently || - opts.force === true || - !opts.gently || - typeof opts.gently !== 'string') { - opts.log.silly('gently link', 'deleting existing link forcefully', { - link: to, - target: from, - force: opts.force, - gently: opts.gently, - clobberLinkGently: opts.clobberLinkGently - }) - return rm(to, opts, cb) - } - - if (!opts.currentIsLink) { - opts.log.verbose('gently link', 'cannot remove, not a link', to) - // don't delete. it'll fail with EEXIST when it tries to symlink. - return cb() - } - - if (opts.currentTarget.indexOf(opts.gently) === 0) { - opts.log.silly('gently link', 'delete existing link', to) - return rm(to, opts, cb) - } else { - opts.log.verbose('gently link', 'refusing to delete existing link', { - link: to, - currentTarget: opts.currentTarget, - newTarget: from, - gently: opts.gently - }) - return cb() - } -} diff --git a/deps/npm/node_modules/gentle-fs/lib/mkdir.js b/deps/npm/node_modules/gentle-fs/lib/mkdir.js deleted file mode 100644 index 5b419959716bdb..00000000000000 --- a/deps/npm/node_modules/gentle-fs/lib/mkdir.js +++ /dev/null @@ -1,22 +0,0 @@ -'use strict' - -const mkdirp = require('mkdirp') -const inferOwner = require('infer-owner') -const chown = require('./chown.js') - -module.exports = (path, cb) => { - // don't bother chowning if we can't anyway - if (process.platform === 'win32' || chown.selfOwner.uid !== 0) { - return mkdirp(path, cb) - } - - inferOwner(path).then(owner => { - mkdirp(path, (er, made) => { - if (er || !made) { - cb(er, made) - } else { - chown(made || path, owner.uid, owner.gid, cb) - } - }) - }, cb) -} diff --git a/deps/npm/node_modules/gentle-fs/lib/rm.js b/deps/npm/node_modules/gentle-fs/lib/rm.js deleted file mode 100644 index 00760c66f234be..00000000000000 --- a/deps/npm/node_modules/gentle-fs/lib/rm.js +++ /dev/null @@ -1,256 +0,0 @@ -'use strict' - -const path = require('path') -const validate = require('aproba') -const fs = require('graceful-fs') -const isInside = require('path-is-inside') -const vacuum = require('fs-vacuum') -const chain = require('slide').chain -const asyncMap = require('slide').asyncMap -const readCmdShim = require('read-cmd-shim') -const iferr = require('iferr') - -exports = module.exports = rm - -function rm (target, opts, cb) { - var targetPath = path.normalize(path.resolve(opts.prefix, target)) - if (opts.prefixes.indexOf(targetPath) !== -1) { - return cb(new Error('May not delete: ' + targetPath)) - } - var options = {} - if (opts.force) { options.purge = true } - if (opts.base) options.base = path.normalize(path.resolve(opts.prefix, opts.base)) - - if (!opts.gently) { - options.purge = true - return vacuum(targetPath, options, cb) - } - - var parent = options.base = options.base || path.normalize(opts.prefix) - - // Do all the async work we'll need to do in order to tell if this is a - // safe operation - chain([ - [isEverInside, parent, opts.prefixes, opts.log], - [readLinkOrShim, targetPath], - [isEverInside, targetPath, opts.prefixes, opts.log], - [isEverInside, targetPath, [parent], opts.log] - ], function (er, results) { - if (er) { - if (er.code === 'ENOENT') return cb() - return cb(er) - } - var parentInfo = { - path: parent, - managed: results[0] - } - var targetInfo = { - path: targetPath, - symlink: results[1], - managed: results[2], - inParent: results[3] - } - - isSafeToRm(parentInfo, targetInfo, opts.name, opts.log, iferr(cb, thenRemove)) - - function thenRemove (toRemove, removeBase) { - if (!toRemove) return cb() - if (removeBase) options.base = removeBase - return vacuum(toRemove, options, cb) - } - }) -} - -exports._isSafeToRm = isSafeToRm -function isSafeToRm (parent, target, pkgName, log, cb) { - log.silly('gentlyRm', 'parent.path =', parent.path) - log.silly('gentlyRm', 'parent.managed =', - parent.managed && parent.managed.target + ' is in ' + parent.managed.path) - log.silly('gentlyRm', 'target.path = ', target.path) - log.silly('gentlyRm', 'target.symlink =', target.symlink) - log.silly('gentlyRm', 'target.managed =', - target.managed && target.managed.target + ' is in ' + target.managed.path) - log.silly('gentlyRm', 'target.inParent = ', target.inParent) - - // The parent directory or something it symlinks to must eventually be in - // a folder that we maintain. - if (!parent.managed) { - log.info('gentlyRm', parent.path, - 'is not contained in any directory ' + pkgName + ' is known to control or ' + - 'any place they link to') - return cb(clobberFail(target.path, 'containing path ' + parent.path + - " isn't under " + pkgName + "'s control")) - } - - // The target or something it symlinks to must eventually be in the parent - // or something the parent symlinks to - if (target.inParent) { - var actualTarget = target.inParent.target - var targetsParent = target.inParent.path - // if the target.path was what we found in some version of parent, remove - // using that parent as the base - if (target.path === actualTarget) { - return cb(null, target.path, targetsParent) - } else { - // If something the target.path links to was what was found, just - // remove target.path in the location it was found. - return cb(null, target.path, path.dirname(target.path)) - } - } - - // If the target is in a managed directory and is in a symlink, but was - // not in our parent that usually means someone else installed a bin file - // with the same name as one of our bin files. - if (target.managed && target.symlink) { - log.warn('rm', 'not removing', target.path, - "as it wasn't installed by", parent.path) - return cb() - } - - if (target.symlink) { - return cb(clobberFail(target.path, target.symlink + - ' symlink target is not controlled by ' + pkgName + ' ' + parent.path)) - } else { - return cb(clobberFail(target.path, 'is outside ' + parent.path + - ' and not a link')) - } -} - -function clobberFail (target, msg) { - validate('SS', arguments) - var er = new Error('Refusing to delete ' + target + ': ' + msg) - er.code = 'EEXIST' - er.path = target - return er -} - -function isENOENT (err) { - return err && err.code === 'ENOENT' -} - -function notENOENT (err) { - return !isENOENT(err) -} - -function skipENOENT (cb) { - return function (err, value) { - if (isENOENT(err)) { - return cb(null, false) - } else { - return cb(err, value) - } - } -} - -function errorsToValues (fn) { - return function () { - var args = Array.prototype.slice.call(arguments) - var cb = args.pop() - args.push(function (err, value) { - if (err) { - return cb(null, err) - } else { - return cb(null, value) - } - }) - fn.apply(null, args) - } -} - -function isNotError (value) { - return !(value instanceof Error) -} - -exports._isEverInside = isEverInside -// return the first of path, where target (or anything it symlinks to) -// isInside the path (or anything it symlinks to) -function isEverInside (target, paths, log, cb) { - validate('SAOF', arguments) - asyncMap(paths, errorsToValues(readAllLinks), iferr(cb, function (resolvedPaths) { - var errorFree = resolvedPaths.filter(isNotError) - if (errorFree.length === 0) { - var badErrors = resolvedPaths.filter(notENOENT) - if (badErrors.length === 0) { - return cb(null, false) - } else { - return cb(badErrors[0]) - } - } - readAllLinks(target, iferr(skipENOENT(cb), function (targets) { - cb(null, areAnyInsideAny(targets, errorFree, log)) - })) - })) -} - -exports._areAnyInsideAny = areAnyInsideAny -// Return the first path found that any target is inside -function areAnyInsideAny (targets, paths, log) { - validate('AAO', arguments) - var toCheck = [] - paths.forEach(function (path) { - targets.forEach(function (target) { - toCheck.push([target, path]) - }) - }) - for (var ii = 0; ii < toCheck.length; ++ii) { - var target = toCheck[ii][0] - var path = toCheck[ii][1] - var inside = isInside(target, path) - if (!inside) log.silly('isEverInside', target, 'is not inside', path) - if (inside && path) return inside && path && {target: target, path: path} - } - return false -} - -exports._readAllLinks = readAllLinks -// resolves chains of symlinks of unlimited depth, returning a list of paths -// it's seen in the process when it hits either a symlink cycle or a -// non-symlink -function readAllLinks (path, cb) { - validate('SF', arguments) - var seen = {} - _readAllLinks(path) - - function _readAllLinks (path) { - if (seen[path]) return cb(null, Object.keys(seen)) - seen[path] = true - resolveSymlink(path, iferr(cb, _readAllLinks)) - } -} - -exports._resolveSymlink = resolveSymlink -var resolvedPaths = {} -function resolveSymlink (symlink, cb) { - validate('SF', arguments) - var cached = resolvedPaths[symlink] - if (cached) return cb(null, cached) - - readLinkOrShim(symlink, iferr(cb, function (symlinkTarget) { - if (symlinkTarget) { - resolvedPaths[symlink] = path.resolve(path.dirname(symlink), symlinkTarget) - } else { - resolvedPaths[symlink] = symlink - } - return cb(null, resolvedPaths[symlink]) - })) -} - -exports._readLinkOrShim = readLinkOrShim -function readLinkOrShim (path, cb) { - validate('SF', arguments) - fs.lstat(path, iferr(cb, function (stat) { - if (stat.isSymbolicLink()) { - fs.readlink(path, cb) - } else { - readCmdShim(path, function (er, source) { - if (!er) return cb(null, source) - // lstat wouldn't return an error on these, so we don't either. - if (er.code === 'ENOTASHIM' || er.code === 'EISDIR') { - return cb(null, null) - } else { - return cb(er) - } - }) - } - })) -} diff --git a/deps/npm/node_modules/gentle-fs/node_modules/aproba/LICENSE b/deps/npm/node_modules/gentle-fs/node_modules/aproba/LICENSE deleted file mode 100644 index f4be44d881b2d9..00000000000000 --- a/deps/npm/node_modules/gentle-fs/node_modules/aproba/LICENSE +++ /dev/null @@ -1,14 +0,0 @@ -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/gentle-fs/node_modules/aproba/README.md b/deps/npm/node_modules/gentle-fs/node_modules/aproba/README.md deleted file mode 100644 index 0bfc594c56a372..00000000000000 --- a/deps/npm/node_modules/gentle-fs/node_modules/aproba/README.md +++ /dev/null @@ -1,94 +0,0 @@ -aproba -====== - -A ridiculously light-weight function argument validator - -``` -var validate = require("aproba") - -function myfunc(a, b, c) { - // `a` must be a string, `b` a number, `c` a function - validate('SNF', arguments) // [a,b,c] is also valid -} - -myfunc('test', 23, function () {}) // ok -myfunc(123, 23, function () {}) // type error -myfunc('test', 23) // missing arg error -myfunc('test', 23, function () {}, true) // too many args error - -``` - -Valid types are: - -| type | description -| :--: | :---------- -| * | matches any type -| A | `Array.isArray` OR an `arguments` object -| S | typeof == string -| N | typeof == number -| F | typeof == function -| O | typeof == object and not type A and not type E -| B | typeof == boolean -| E | `instanceof Error` OR `null` **(special: see below)** -| Z | == `null` - -Validation failures throw one of three exception types, distinguished by a -`code` property of `EMISSINGARG`, `EINVALIDTYPE` or `ETOOMANYARGS`. - -If you pass in an invalid type then it will throw with a code of -`EUNKNOWNTYPE`. - -If an **error** argument is found and is not null then the remaining -arguments are optional. That is, if you say `ESO` then that's like using a -non-magical `E` in: `E|ESO|ZSO`. - -### But I have optional arguments?! - -You can provide more than one signature by separating them with pipes `|`. -If any signature matches the arguments then they'll be considered valid. - -So for example, say you wanted to write a signature for -`fs.createWriteStream`. The docs for it describe it thusly: - -``` -fs.createWriteStream(path[, options]) -``` - -This would be a signature of `SO|S`. That is, a string and and object, or -just a string. - -Now, if you read the full `fs` docs, you'll see that actually path can ALSO -be a buffer. And options can be a string, that is: -``` -path | -options | -``` - -To reproduce this you have to fully enumerate all of the possible -combinations and that implies a signature of `SO|SS|OO|OS|S|O`. The -awkwardness is a feature: It reminds you of the complexity you're adding to -your API when you do this sort of thing. - - -### Browser support - -This has no dependencies and should work in browsers, though you'll have -noisier stack traces. - -### Why this exists - -I wanted a very simple argument validator. It needed to do two things: - -1. Be more concise and easier to use than assertions - -2. Not encourage an infinite bikeshed of DSLs - -This is why types are specified by a single character and there's no such -thing as an optional argument. - -This is not intended to validate user data. This is specifically about -asserting the interface of your functions. - -If you need greater validation, I encourage you to write them by hand or -look elsewhere. - diff --git a/deps/npm/node_modules/gentle-fs/node_modules/aproba/index.js b/deps/npm/node_modules/gentle-fs/node_modules/aproba/index.js deleted file mode 100644 index 6f3f797c09a750..00000000000000 --- a/deps/npm/node_modules/gentle-fs/node_modules/aproba/index.js +++ /dev/null @@ -1,105 +0,0 @@ -'use strict' - -function isArguments (thingy) { - return thingy != null && typeof thingy === 'object' && thingy.hasOwnProperty('callee') -} - -var types = { - '*': {label: 'any', check: function () { return true }}, - A: {label: 'array', check: function (thingy) { return Array.isArray(thingy) || isArguments(thingy) }}, - S: {label: 'string', check: function (thingy) { return typeof thingy === 'string' }}, - N: {label: 'number', check: function (thingy) { return typeof thingy === 'number' }}, - F: {label: 'function', check: function (thingy) { return typeof thingy === 'function' }}, - O: {label: 'object', check: function (thingy) { return typeof thingy === 'object' && thingy != null && !types.A.check(thingy) && !types.E.check(thingy) }}, - B: {label: 'boolean', check: function (thingy) { return typeof thingy === 'boolean' }}, - E: {label: 'error', check: function (thingy) { return thingy instanceof Error }}, - Z: {label: 'null', check: function (thingy) { return thingy == null }} -} - -function addSchema (schema, arity) { - var group = arity[schema.length] = arity[schema.length] || [] - if (group.indexOf(schema) === -1) group.push(schema) -} - -var validate = module.exports = function (rawSchemas, args) { - if (arguments.length !== 2) throw wrongNumberOfArgs(['SA'], arguments.length) - if (!rawSchemas) throw missingRequiredArg(0, 'rawSchemas') - if (!args) throw missingRequiredArg(1, 'args') - if (!types.S.check(rawSchemas)) throw invalidType(0, ['string'], rawSchemas) - if (!types.A.check(args)) throw invalidType(1, ['array'], args) - var schemas = rawSchemas.split('|') - var arity = {} - - schemas.forEach(function (schema) { - for (var ii = 0; ii < schema.length; ++ii) { - var type = schema[ii] - if (!types[type]) throw unknownType(ii, type) - } - if (/E.*E/.test(schema)) throw moreThanOneError(schema) - addSchema(schema, arity) - if (/E/.test(schema)) { - addSchema(schema.replace(/E.*$/, 'E'), arity) - addSchema(schema.replace(/E/, 'Z'), arity) - if (schema.length === 1) addSchema('', arity) - } - }) - var matching = arity[args.length] - if (!matching) { - throw wrongNumberOfArgs(Object.keys(arity), args.length) - } - for (var ii = 0; ii < args.length; ++ii) { - var newMatching = matching.filter(function (schema) { - var type = schema[ii] - var typeCheck = types[type].check - return typeCheck(args[ii]) - }) - if (!newMatching.length) { - var labels = matching.map(function (schema) { - return types[schema[ii]].label - }).filter(function (schema) { return schema != null }) - throw invalidType(ii, labels, args[ii]) - } - matching = newMatching - } -} - -function missingRequiredArg (num) { - return newException('EMISSINGARG', 'Missing required argument #' + (num + 1)) -} - -function unknownType (num, type) { - return newException('EUNKNOWNTYPE', 'Unknown type ' + type + ' in argument #' + (num + 1)) -} - -function invalidType (num, expectedTypes, value) { - var valueType - Object.keys(types).forEach(function (typeCode) { - if (types[typeCode].check(value)) valueType = types[typeCode].label - }) - return newException('EINVALIDTYPE', 'Argument #' + (num + 1) + ': Expected ' + - englishList(expectedTypes) + ' but got ' + valueType) -} - -function englishList (list) { - return list.join(', ').replace(/, ([^,]+)$/, ' or $1') -} - -function wrongNumberOfArgs (expected, got) { - var english = englishList(expected) - var args = expected.every(function (ex) { return ex.length === 1 }) - ? 'argument' - : 'arguments' - return newException('EWRONGARGCOUNT', 'Expected ' + english + ' ' + args + ' but got ' + got) -} - -function moreThanOneError (schema) { - return newException('ETOOMANYERRORTYPES', - 'Only one error type per argument signature is allowed, more than one found in "' + schema + '"') -} - -function newException (code, msg) { - var e = new Error(msg) - e.code = code - if (Error.captureStackTrace) Error.captureStackTrace(e, validate) - return e -} diff --git a/deps/npm/node_modules/gentle-fs/node_modules/aproba/package.json b/deps/npm/node_modules/gentle-fs/node_modules/aproba/package.json deleted file mode 100644 index 34b51a0df22ae2..00000000000000 --- a/deps/npm/node_modules/gentle-fs/node_modules/aproba/package.json +++ /dev/null @@ -1,62 +0,0 @@ -{ - "_from": "aproba@^1.1.2", - "_id": "aproba@1.2.0", - "_inBundle": false, - "_integrity": "sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw==", - "_location": "/gentle-fs/aproba", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "aproba@^1.1.2", - "name": "aproba", - "escapedName": "aproba", - "rawSpec": "^1.1.2", - "saveSpec": null, - "fetchSpec": "^1.1.2" - }, - "_requiredBy": [ - "/gentle-fs" - ], - "_resolved": "https://registry.npmjs.org/aproba/-/aproba-1.2.0.tgz", - "_shasum": "6802e6264efd18c790a1b0d517f0f2627bf2c94a", - "_spec": "aproba@^1.1.2", - "_where": "/Users/aeschright/code/cli/node_modules/gentle-fs", - "author": { - "name": "Rebecca Turner", - "email": "me@re-becca.org" - }, - "bugs": { - "url": "https://github.com/iarna/aproba/issues" - }, - "bundleDependencies": false, - "dependencies": {}, - "deprecated": false, - "description": "A ridiculously light-weight argument validator (now browser friendly)", - "devDependencies": { - "standard": "^10.0.3", - "tap": "^10.0.2" - }, - "directories": { - "test": "test" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/iarna/aproba", - "keywords": [ - "argument", - "validate" - ], - "license": "ISC", - "main": "index.js", - "name": "aproba", - "repository": { - "type": "git", - "url": "git+https://github.com/iarna/aproba.git" - }, - "scripts": { - "test": "standard && tap -j3 test/*.js" - }, - "version": "1.2.0" -} diff --git a/deps/npm/node_modules/gentle-fs/node_modules/iferr/.npmignore b/deps/npm/node_modules/gentle-fs/node_modules/iferr/.npmignore deleted file mode 100644 index 3c3629e647f5dd..00000000000000 --- a/deps/npm/node_modules/gentle-fs/node_modules/iferr/.npmignore +++ /dev/null @@ -1 +0,0 @@ -node_modules diff --git a/deps/npm/node_modules/gentle-fs/node_modules/iferr/LICENSE b/deps/npm/node_modules/gentle-fs/node_modules/iferr/LICENSE deleted file mode 100644 index 19d5f4bce547ba..00000000000000 --- a/deps/npm/node_modules/gentle-fs/node_modules/iferr/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2014 Nadav Ivgi - -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/deps/npm/node_modules/gentle-fs/node_modules/iferr/README.md b/deps/npm/node_modules/gentle-fs/node_modules/iferr/README.md deleted file mode 100644 index 0940763fa94137..00000000000000 --- a/deps/npm/node_modules/gentle-fs/node_modules/iferr/README.md +++ /dev/null @@ -1,40 +0,0 @@ -# iferr - -Higher-order functions for easier error handling. - -`if (err) return cb(err);` be gone! - -## Install -```bash -npm install iferr -``` - -## Use - -### JavaScript example -```js -var iferr = require('iferr'); - -function get_friends_count(id, cb) { - User.load_user(id, iferr(cb, function(user) { - user.load_friends(iferr(cb, function(friends) { - cb(null, friends.length); - })); - })); -} -``` - -### CoffeeScript example -```coffee -iferr = require 'iferr' - -get_friends_count = (id, cb) -> - User.load_user id, iferr cb, (user) -> - user.load_friends iferr cb, (friends) -> - cb null, friends.length -``` - -(TODO: document tiferr, throwerr and printerr) - -## License -MIT diff --git a/deps/npm/node_modules/gentle-fs/node_modules/iferr/index.coffee b/deps/npm/node_modules/gentle-fs/node_modules/iferr/index.coffee deleted file mode 100644 index da6d00719f10c4..00000000000000 --- a/deps/npm/node_modules/gentle-fs/node_modules/iferr/index.coffee +++ /dev/null @@ -1,24 +0,0 @@ -# Delegates to `succ` on sucecss or to `fail` on error -# ex: Thing.load 123, iferr cb, (thing) -> ... -iferr = (fail, succ) -> (err, a...) -> - if err? then fail err - else succ? a... - -# Like iferr, but also catches errors thrown from `succ` and passes to `fail` -tiferr = (fail, succ) -> iferr fail, (a...) -> - try succ a... - catch err then fail err - -# Delegate to the success function on success, or throw the error otherwise -# ex: Thing.load 123, throwerr (thing) -> ... -throwerr = iferr.bind null, (err) -> throw err - -# Prints errors when one is passed, or does nothing otherwise -# ex: thing.save printerr -printerr = iferr (err) -> console.error err.stack or err - -module.exports = exports = iferr -exports.iferr = iferr -exports.tiferr = tiferr -exports.throwerr = throwerr -exports.printerr = printerr diff --git a/deps/npm/node_modules/gentle-fs/node_modules/iferr/index.js b/deps/npm/node_modules/gentle-fs/node_modules/iferr/index.js deleted file mode 100644 index 78fce3d2b0965a..00000000000000 --- a/deps/npm/node_modules/gentle-fs/node_modules/iferr/index.js +++ /dev/null @@ -1,49 +0,0 @@ -// Generated by CoffeeScript 1.7.1 -(function() { - var exports, iferr, printerr, throwerr, tiferr, - __slice = [].slice; - - iferr = function(fail, succ) { - return function() { - var a, err; - err = arguments[0], a = 2 <= arguments.length ? __slice.call(arguments, 1) : []; - if (err != null) { - return fail(err); - } else { - return typeof succ === "function" ? succ.apply(null, a) : void 0; - } - }; - }; - - tiferr = function(fail, succ) { - return iferr(fail, function() { - var a, err; - a = 1 <= arguments.length ? __slice.call(arguments, 0) : []; - try { - return succ.apply(null, a); - } catch (_error) { - err = _error; - return fail(err); - } - }); - }; - - throwerr = iferr.bind(null, function(err) { - throw err; - }); - - printerr = iferr(function(err) { - return console.error(err.stack || err); - }); - - module.exports = exports = iferr; - - exports.iferr = iferr; - - exports.tiferr = tiferr; - - exports.throwerr = throwerr; - - exports.printerr = printerr; - -}).call(this); diff --git a/deps/npm/node_modules/gentle-fs/node_modules/iferr/package.json b/deps/npm/node_modules/gentle-fs/node_modules/iferr/package.json deleted file mode 100644 index fcddb232460a79..00000000000000 --- a/deps/npm/node_modules/gentle-fs/node_modules/iferr/package.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "_from": "iferr@^0.1.5", - "_id": "iferr@0.1.5", - "_inBundle": false, - "_integrity": "sha1-xg7taebY/bazEEofy8ocGS3FtQE=", - "_location": "/gentle-fs/iferr", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "iferr@^0.1.5", - "name": "iferr", - "escapedName": "iferr", - "rawSpec": "^0.1.5", - "saveSpec": null, - "fetchSpec": "^0.1.5" - }, - "_requiredBy": [ - "/gentle-fs" - ], - "_resolved": "https://registry.npmjs.org/iferr/-/iferr-0.1.5.tgz", - "_shasum": "c60eed69e6d8fdb6b3104a1fcbca1c192dc5b501", - "_spec": "iferr@^0.1.5", - "_where": "/Users/rebecca/code/npm/node_modules/gentle-fs", - "author": { - "name": "Nadav Ivgi" - }, - "bugs": { - "url": "https://github.com/shesek/iferr/issues" - }, - "bundleDependencies": false, - "deprecated": false, - "description": "Higher-order functions for easier error handling", - "devDependencies": { - "coffee-script": "^1.7.1", - "mocha": "^1.18.2" - }, - "homepage": "https://github.com/shesek/iferr", - "keywords": [ - "error", - "errors" - ], - "license": "MIT", - "main": "index.js", - "name": "iferr", - "repository": { - "type": "git", - "url": "git+https://github.com/shesek/iferr.git" - }, - "scripts": { - "prepublish": "coffee -c index.coffee", - "test": "mocha" - }, - "version": "0.1.5" -} diff --git a/deps/npm/node_modules/gentle-fs/node_modules/iferr/test/index.coffee b/deps/npm/node_modules/gentle-fs/node_modules/iferr/test/index.coffee deleted file mode 100644 index be0bc56fdf1b96..00000000000000 --- a/deps/npm/node_modules/gentle-fs/node_modules/iferr/test/index.coffee +++ /dev/null @@ -1,42 +0,0 @@ -{ iferr, tiferr, throwerr } = require '../index.coffee' -{ equal: eq, throws } = require 'assert' - -invoke_fail = (cb) -> cb new Error 'callback error' -invoke_succ = (cb) -> cb null -throw_error = -> throw new Error 'thrown' - -describe 'iferr', -> - it 'calls the error callback on errors', (done) -> - invoke_fail iferr( - (err) -> - eq err.message, 'callback error' - do done - -> - done new Error 'shouldn\'t call the success callback' - ) - - it 'calls the success callback on success', (done) -> - invoke_succ iferr( - -> done new Error 'shouldn\'t call the error callback' - done - ) - -describe 'tiferr', -> - it 'catches errors in the success callback', (done) -> - invoke_succ tiferr( - (err) -> - eq err.message, 'thrown' - do done - throw_error - ) - -describe 'throwerr', -> - it 'throws errors passed to the callback', (done)-> - try invoke_fail throwerr -> - done 'shouldn\'t call the success callback' - catch err - eq err.message, 'callback error' - do done - - it 'delegates to the success callback otherwise', (done) -> - invoke_succ throwerr done diff --git a/deps/npm/node_modules/gentle-fs/node_modules/iferr/test/mocha.opts b/deps/npm/node_modules/gentle-fs/node_modules/iferr/test/mocha.opts deleted file mode 100644 index 019defcf152a84..00000000000000 --- a/deps/npm/node_modules/gentle-fs/node_modules/iferr/test/mocha.opts +++ /dev/null @@ -1,2 +0,0 @@ ---compilers coffee:coffee-script/register ---reporter spec diff --git a/deps/npm/node_modules/gentle-fs/package.json b/deps/npm/node_modules/gentle-fs/package.json deleted file mode 100644 index b01e0c16beeaff..00000000000000 --- a/deps/npm/node_modules/gentle-fs/package.json +++ /dev/null @@ -1,82 +0,0 @@ -{ - "_from": "gentle-fs@2.3.1", - "_id": "gentle-fs@2.3.1", - "_inBundle": false, - "_integrity": "sha512-OlwBBwqCFPcjm33rF2BjW+Pr6/ll2741l+xooiwTCeaX2CA1ZuclavyMBe0/KlR21/XGsgY6hzEQZ15BdNa13Q==", - "_location": "/gentle-fs", - "_phantomChildren": {}, - "_requested": { - "type": "version", - "registry": true, - "raw": "gentle-fs@2.3.1", - "name": "gentle-fs", - "escapedName": "gentle-fs", - "rawSpec": "2.3.1", - "saveSpec": null, - "fetchSpec": "2.3.1" - }, - "_requiredBy": [ - "#USER", - "/", - "/bin-links" - ], - "_resolved": "https://registry.npmjs.org/gentle-fs/-/gentle-fs-2.3.1.tgz", - "_shasum": "11201bf66c18f930ddca72cf69460bdfa05727b1", - "_spec": "gentle-fs@2.3.1", - "_where": "/Users/claudiahdz/npm/cli", - "author": { - "name": "Mike Sherov" - }, - "bugs": { - "url": "https://github.com/npm/gentle-fs/issues" - }, - "bundleDependencies": false, - "dependencies": { - "aproba": "^1.1.2", - "chownr": "^1.1.2", - "cmd-shim": "^3.0.3", - "fs-vacuum": "^1.2.10", - "graceful-fs": "^4.1.11", - "iferr": "^0.1.5", - "infer-owner": "^1.0.4", - "mkdirp": "^0.5.1", - "path-is-inside": "^1.0.2", - "read-cmd-shim": "^1.0.1", - "slide": "^1.1.6" - }, - "deprecated": false, - "description": "Gentle Filesystem operations", - "devDependencies": { - "dezalgo": "^1.0.3", - "nyc": "^11.1.0", - "require-inject": "^1.4.2", - "standard": "^10.0.3", - "standard-version": "^4.2.0", - "tap": "^10.7.2" - }, - "files": [ - "index.js", - "lib" - ], - "homepage": "https://github.com/npm/gentle-fs#readme", - "keywords": [ - "npm", - "gentle", - "fs" - ], - "license": "Artistic-2.0", - "main": "index.js", - "name": "gentle-fs", - "repository": { - "type": "git", - "url": "git://github.com/npm/gentle-fs.git" - }, - "scripts": { - "postrelease": "npm publish && git push --follow-tags", - "posttest": "standard", - "prerelease": "npm t", - "release": "standard-version -s", - "test": "tap -J --nyc-arg=--all --coverage test" - }, - "version": "2.3.1" -} diff --git a/deps/npm/node_modules/get-caller-file/LICENSE.md b/deps/npm/node_modules/get-caller-file/LICENSE.md deleted file mode 100644 index bf3e1c071bae44..00000000000000 --- a/deps/npm/node_modules/get-caller-file/LICENSE.md +++ /dev/null @@ -1,6 +0,0 @@ -ISC License (ISC) -Copyright 2018 Stefan Penner - -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/get-caller-file/README.md b/deps/npm/node_modules/get-caller-file/README.md deleted file mode 100644 index a7d8c079707355..00000000000000 --- a/deps/npm/node_modules/get-caller-file/README.md +++ /dev/null @@ -1,41 +0,0 @@ -# get-caller-file - -[![Build Status](https://travis-ci.org/stefanpenner/get-caller-file.svg?branch=master)](https://travis-ci.org/stefanpenner/get-caller-file) -[![Build status](https://ci.appveyor.com/api/projects/status/ol2q94g1932cy14a/branch/master?svg=true)](https://ci.appveyor.com/project/embercli/get-caller-file/branch/master) - -This is a utility, which allows a function to figure out from which file it was invoked. It does so by inspecting v8's stack trace at the time it is invoked. - -Inspired by http://stackoverflow.com/questions/13227489 - -*note: this relies on Node/V8 specific APIs, as such other runtimes may not work* - -## Installation - -```bash -yarn add get-caller-file -``` - -## Usage - -Given: - -```js -// ./foo.js -const getCallerFile = require('get-caller-file'); - -module.exports = function() { - return getCallerFile(); // figures out who called it -}; -``` - -```js -// index.js -const foo = require('./foo'); - -foo() // => /full/path/to/this/file/index.js -``` - - -## Options: - -* `getCallerFile(position = 2)`: where position is stack frame whos fileName we want. diff --git a/deps/npm/node_modules/get-caller-file/index.d.ts b/deps/npm/node_modules/get-caller-file/index.d.ts deleted file mode 100644 index babed696ae00ee..00000000000000 --- a/deps/npm/node_modules/get-caller-file/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -declare const _default: (position?: number) => any; -export = _default; diff --git a/deps/npm/node_modules/get-caller-file/index.js b/deps/npm/node_modules/get-caller-file/index.js deleted file mode 100644 index 57304f80345dd0..00000000000000 --- a/deps/npm/node_modules/get-caller-file/index.js +++ /dev/null @@ -1,22 +0,0 @@ -"use strict"; -// Call this function in a another function to find out the file from -// which that function was called from. (Inspects the v8 stack trace) -// -// Inspired by http://stackoverflow.com/questions/13227489 -module.exports = function getCallerFile(position) { - if (position === void 0) { position = 2; } - if (position >= Error.stackTraceLimit) { - throw new TypeError('getCallerFile(position) requires position be less then Error.stackTraceLimit but position was: `' + position + '` and Error.stackTraceLimit was: `' + Error.stackTraceLimit + '`'); - } - var oldPrepareStackTrace = Error.prepareStackTrace; - Error.prepareStackTrace = function (_, stack) { return stack; }; - var stack = new Error().stack; - Error.prepareStackTrace = oldPrepareStackTrace; - if (stack !== null && typeof stack === 'object') { - // stack[0] holds this file - // stack[1] holds where this function was called - // stack[2] holds the file we're interested in - return stack[position] ? stack[position].getFileName() : undefined; - } -}; -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/deps/npm/node_modules/get-caller-file/index.js.map b/deps/npm/node_modules/get-caller-file/index.js.map deleted file mode 100644 index 89c655c06da4ac..00000000000000 --- a/deps/npm/node_modules/get-caller-file/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,qEAAqE;AACrE,EAAE;AACF,0DAA0D;AAE1D,iBAAS,SAAS,aAAa,CAAC,QAAY;IAAZ,yBAAA,EAAA,YAAY;IAC1C,IAAI,QAAQ,IAAI,KAAK,CAAC,eAAe,EAAE;QACrC,MAAM,IAAI,SAAS,CAAC,kGAAkG,GAAG,QAAQ,GAAG,oCAAoC,GAAG,KAAK,CAAC,eAAe,GAAG,GAAG,CAAC,CAAC;KACzM;IAED,IAAM,oBAAoB,GAAG,KAAK,CAAC,iBAAiB,CAAC;IACrD,KAAK,CAAC,iBAAiB,GAAG,UAAC,CAAC,EAAE,KAAK,IAAM,OAAA,KAAK,EAAL,CAAK,CAAC;IAC/C,IAAM,KAAK,GAAG,IAAI,KAAK,EAAE,CAAC,KAAK,CAAC;IAChC,KAAK,CAAC,iBAAiB,GAAG,oBAAoB,CAAC;IAG/C,IAAI,KAAK,KAAK,IAAI,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;QAC/C,2BAA2B;QAC3B,gDAAgD;QAChD,8CAA8C;QAC9C,OAAO,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAE,KAAK,CAAC,QAAQ,CAAS,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC;KAC7E;AACH,CAAC,CAAC"} \ No newline at end of file diff --git a/deps/npm/node_modules/get-caller-file/package.json b/deps/npm/node_modules/get-caller-file/package.json deleted file mode 100644 index 5e58bc7cc07a8a..00000000000000 --- a/deps/npm/node_modules/get-caller-file/package.json +++ /dev/null @@ -1,69 +0,0 @@ -{ - "_from": "get-caller-file@^2.0.1", - "_id": "get-caller-file@2.0.5", - "_inBundle": false, - "_integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", - "_location": "/get-caller-file", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "get-caller-file@^2.0.1", - "name": "get-caller-file", - "escapedName": "get-caller-file", - "rawSpec": "^2.0.1", - "saveSpec": null, - "fetchSpec": "^2.0.1" - }, - "_requiredBy": [ - "/yargs" - ], - "_resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", - "_shasum": "4f94412a82db32f36e3b0b9741f8a97feb031f7e", - "_spec": "get-caller-file@^2.0.1", - "_where": "/Users/claudiahdz/npm/cli/node_modules/yargs", - "author": { - "name": "Stefan Penner" - }, - "bugs": { - "url": "https://github.com/stefanpenner/get-caller-file/issues" - }, - "bundleDependencies": false, - "deprecated": false, - "description": "[![Build Status](https://travis-ci.org/stefanpenner/get-caller-file.svg?branch=master)](https://travis-ci.org/stefanpenner/get-caller-file) [![Build status](https://ci.appveyor.com/api/projects/status/ol2q94g1932cy14a/branch/master?svg=true)](https://ci.appveyor.com/project/embercli/get-caller-file/branch/master)", - "devDependencies": { - "@types/chai": "^4.1.7", - "@types/ensure-posix-path": "^1.0.0", - "@types/mocha": "^5.2.6", - "@types/node": "^11.10.5", - "chai": "^4.1.2", - "ensure-posix-path": "^1.0.1", - "mocha": "^5.2.0", - "typescript": "^3.3.3333" - }, - "directories": { - "test": "tests" - }, - "engines": { - "node": "6.* || 8.* || >= 10.*" - }, - "files": [ - "index.js", - "index.js.map", - "index.d.ts" - ], - "homepage": "https://github.com/stefanpenner/get-caller-file#readme", - "license": "ISC", - "main": "index.js", - "name": "get-caller-file", - "repository": { - "type": "git", - "url": "git+https://github.com/stefanpenner/get-caller-file.git" - }, - "scripts": { - "prepare": "tsc", - "test": "mocha test", - "test:debug": "mocha test" - }, - "version": "2.0.5" -} diff --git a/deps/npm/node_modules/get-stream/buffer-stream.js b/deps/npm/node_modules/get-stream/buffer-stream.js deleted file mode 100644 index 4121c8e56f9a37..00000000000000 --- a/deps/npm/node_modules/get-stream/buffer-stream.js +++ /dev/null @@ -1,51 +0,0 @@ -'use strict'; -const {PassThrough} = require('stream'); - -module.exports = options => { - options = Object.assign({}, options); - - const {array} = options; - let {encoding} = options; - const buffer = encoding === 'buffer'; - let objectMode = false; - - if (array) { - objectMode = !(encoding || buffer); - } else { - encoding = encoding || 'utf8'; - } - - if (buffer) { - encoding = null; - } - - let len = 0; - const ret = []; - const stream = new PassThrough({objectMode}); - - if (encoding) { - stream.setEncoding(encoding); - } - - stream.on('data', chunk => { - ret.push(chunk); - - if (objectMode) { - len = ret.length; - } else { - len += chunk.length; - } - }); - - stream.getBufferedValue = () => { - if (array) { - return ret; - } - - return buffer ? Buffer.concat(ret, len) : ret.join(''); - }; - - stream.getBufferedLength = () => len; - - return stream; -}; diff --git a/deps/npm/node_modules/get-stream/index.js b/deps/npm/node_modules/get-stream/index.js deleted file mode 100644 index 7e5584a63df07f..00000000000000 --- a/deps/npm/node_modules/get-stream/index.js +++ /dev/null @@ -1,50 +0,0 @@ -'use strict'; -const pump = require('pump'); -const bufferStream = require('./buffer-stream'); - -class MaxBufferError extends Error { - constructor() { - super('maxBuffer exceeded'); - this.name = 'MaxBufferError'; - } -} - -function getStream(inputStream, options) { - if (!inputStream) { - return Promise.reject(new Error('Expected a stream')); - } - - options = Object.assign({maxBuffer: Infinity}, options); - - const {maxBuffer} = options; - - let stream; - return new Promise((resolve, reject) => { - const rejectPromise = error => { - if (error) { // A null check - error.bufferedData = stream.getBufferedValue(); - } - reject(error); - }; - - stream = pump(inputStream, bufferStream(options), error => { - if (error) { - rejectPromise(error); - return; - } - - resolve(); - }); - - stream.on('data', () => { - if (stream.getBufferedLength() > maxBuffer) { - rejectPromise(new MaxBufferError()); - } - }); - }).then(() => stream.getBufferedValue()); -} - -module.exports = getStream; -module.exports.buffer = (stream, options) => getStream(stream, Object.assign({}, options, {encoding: 'buffer'})); -module.exports.array = (stream, options) => getStream(stream, Object.assign({}, options, {array: true})); -module.exports.MaxBufferError = MaxBufferError; diff --git a/deps/npm/node_modules/get-stream/package.json b/deps/npm/node_modules/get-stream/package.json deleted file mode 100644 index a34aa1daf0bfdc..00000000000000 --- a/deps/npm/node_modules/get-stream/package.json +++ /dev/null @@ -1,86 +0,0 @@ -{ - "_from": "get-stream@", - "_id": "get-stream@4.1.0", - "_inBundle": false, - "_integrity": "sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w==", - "_location": "/get-stream", - "_phantomChildren": {}, - "_requested": { - "type": "tag", - "registry": true, - "raw": "get-stream@", - "name": "get-stream", - "escapedName": "get-stream", - "rawSpec": "", - "saveSpec": null, - "fetchSpec": "latest" - }, - "_requiredBy": [ - "#DEV:/", - "#USER", - "/libnpm/libnpmhook", - "/libnpmaccess", - "/libnpmorg", - "/libnpmpublish", - "/libnpmsearch", - "/libnpmteam", - "/pacote" - ], - "_resolved": "https://registry.npmjs.org/get-stream/-/get-stream-4.1.0.tgz", - "_shasum": "c1b255575f3dc21d59bfc79cd3d2b46b1c3a54b5", - "_spec": "get-stream@", - "_where": "/Users/zkat/Documents/code/work/npm", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "bugs": { - "url": "https://github.com/sindresorhus/get-stream/issues" - }, - "bundleDependencies": false, - "dependencies": { - "pump": "^3.0.0" - }, - "deprecated": false, - "description": "Get a stream as a string, buffer, or array", - "devDependencies": { - "ava": "*", - "into-stream": "^3.0.0", - "xo": "*" - }, - "engines": { - "node": ">=6" - }, - "files": [ - "index.js", - "buffer-stream.js" - ], - "homepage": "https://github.com/sindresorhus/get-stream#readme", - "keywords": [ - "get", - "stream", - "promise", - "concat", - "string", - "text", - "buffer", - "read", - "data", - "consume", - "readable", - "readablestream", - "array", - "object" - ], - "license": "MIT", - "name": "get-stream", - "repository": { - "type": "git", - "url": "git+https://github.com/sindresorhus/get-stream.git" - }, - "scripts": { - "test": "xo && ava" - }, - "version": "4.1.0" -} diff --git a/deps/npm/node_modules/get-stream/readme.md b/deps/npm/node_modules/get-stream/readme.md deleted file mode 100644 index b87a4d37ce5b3e..00000000000000 --- a/deps/npm/node_modules/get-stream/readme.md +++ /dev/null @@ -1,123 +0,0 @@ -# get-stream [![Build Status](https://travis-ci.org/sindresorhus/get-stream.svg?branch=master)](https://travis-ci.org/sindresorhus/get-stream) - -> Get a stream as a string, buffer, or array - - -## Install - -``` -$ npm install get-stream -``` - - -## Usage - -```js -const fs = require('fs'); -const getStream = require('get-stream'); - -(async () => { - const stream = fs.createReadStream('unicorn.txt'); - - console.log(await getStream(stream)); - /* - ,,))))))));, - __)))))))))))))), - \|/ -\(((((''''((((((((. - -*-==//////(('' . `)))))), - /|\ ))| o ;-. '((((( ,(, - ( `| / ) ;))))' ,_))^;(~ - | | | ,))((((_ _____------~~~-. %,;(;(>';'~ - o_); ; )))(((` ~---~ `:: \ %%~~)(v;(`('~ - ; ''''```` `: `:::|\,__,%% );`'; ~ - | _ ) / `:|`----' `-' - ______/\/~ | / / - /~;;.____/;;' / ___--,-( `;;;/ - / // _;______;'------~~~~~ /;;/\ / - // | | / ; \;;,\ - (<_ | ; /',/-----' _> - \_| ||_ //~;~~~~~~~~~ - `\_| (,~~ - \~\ - ~~ - */ -})(); -``` - - -## API - -The methods returns a promise that resolves when the `end` event fires on the stream, indicating that there is no more data to be read. The stream is switched to flowing mode. - -### getStream(stream, [options]) - -Get the `stream` as a string. - -#### options - -Type: `Object` - -##### encoding - -Type: `string`
    -Default: `utf8` - -[Encoding](https://nodejs.org/api/buffer.html#buffer_buffer) of the incoming stream. - -##### maxBuffer - -Type: `number`
    -Default: `Infinity` - -Maximum length of the returned string. If it exceeds this value before the stream ends, the promise will be rejected with a `getStream.MaxBufferError` error. - -### getStream.buffer(stream, [options]) - -Get the `stream` as a buffer. - -It honors the `maxBuffer` option as above, but it refers to byte length rather than string length. - -### getStream.array(stream, [options]) - -Get the `stream` as an array of values. - -It honors both the `maxBuffer` and `encoding` options. The behavior changes slightly based on the encoding chosen: - -- When `encoding` is unset, it assumes an [object mode stream](https://nodesource.com/blog/understanding-object-streams/) and collects values emitted from `stream` unmodified. In this case `maxBuffer` refers to the number of items in the array (not the sum of their sizes). - -- When `encoding` is set to `buffer`, it collects an array of buffers. `maxBuffer` refers to the summed byte lengths of every buffer in the array. - -- When `encoding` is set to anything else, it collects an array of strings. `maxBuffer` refers to the summed character lengths of every string in the array. - - -## Errors - -If the input stream emits an `error` event, the promise will be rejected with the error. The buffered data will be attached to the `bufferedData` property of the error. - -```js -(async () => { - try { - await getStream(streamThatErrorsAtTheEnd('unicorn')); - } catch (error) { - console.log(error.bufferedData); - //=> 'unicorn' - } -})() -``` - - -## FAQ - -### How is this different from [`concat-stream`](https://github.com/maxogden/concat-stream)? - -This module accepts a stream instead of being one and returns a promise instead of using a callback. The API is simpler and it only supports returning a string, buffer, or array. It doesn't have a fragile type inference. You explicitly choose what you want. And it doesn't depend on the huge `readable-stream` package. - - -## Related - -- [get-stdin](https://github.com/sindresorhus/get-stdin) - Get stdin as a string or buffer - - -## License - -MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/deps/npm/node_modules/getpass/package.json b/deps/npm/node_modules/getpass/package.json index 51e481a227fc57..f1638eb3cdd27f 100644 --- a/deps/npm/node_modules/getpass/package.json +++ b/deps/npm/node_modules/getpass/package.json @@ -1,50 +1,18 @@ { - "_from": "getpass@^0.1.1", - "_id": "getpass@0.1.7", - "_inBundle": false, - "_integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=", - "_location": "/getpass", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "getpass@^0.1.1", - "name": "getpass", - "escapedName": "getpass", - "rawSpec": "^0.1.1", - "saveSpec": null, - "fetchSpec": "^0.1.1" - }, - "_requiredBy": [ - "/sshpk" - ], - "_resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", - "_shasum": "5eff8e3e684d569ae4cb2b1282604e8ba62149fa", - "_spec": "getpass@^0.1.1", - "_where": "/Users/rebecca/code/npm/node_modules/sshpk", - "author": { - "name": "Alex Wilson", - "email": "alex.wilson@joyent.com" - }, - "bugs": { - "url": "https://github.com/arekinath/node-getpass/issues" - }, - "bundleDependencies": false, + "name": "getpass", + "version": "0.1.7", + "description": "getpass for node.js", + "main": "lib/index.js", "dependencies": { "assert-plus": "^1.0.0" }, - "deprecated": false, - "description": "getpass for node.js", - "homepage": "https://github.com/arekinath/node-getpass#readme", - "license": "MIT", - "main": "lib/index.js", - "name": "getpass", "repository": { "type": "git", - "url": "git+https://github.com/arekinath/node-getpass.git" + "url": "https://github.com/arekinath/node-getpass.git" }, "scripts": { "test": "tape test/*.test.js" }, - "version": "0.1.7" + "author": "Alex Wilson ", + "license": "MIT" } diff --git a/deps/npm/node_modules/glob/package.json b/deps/npm/node_modules/glob/package.json index 0e1fa5805bccbc..6477c3070cb14e 100644 --- a/deps/npm/node_modules/glob/package.json +++ b/deps/npm/node_modules/glob/package.json @@ -1,49 +1,21 @@ { - "_from": "glob@7.1.6", - "_id": "glob@7.1.6", - "_inBundle": false, - "_integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", - "_location": "/glob", - "_phantomChildren": {}, - "_requested": { - "type": "version", - "registry": true, - "raw": "glob@7.1.6", - "name": "glob", - "escapedName": "glob", - "rawSpec": "7.1.6", - "saveSpec": null, - "fetchSpec": "7.1.6" + "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" }, - "_requiredBy": [ - "#USER", - "/", - "/cacache", - "/deglob", - "/eslint", - "/init-package-json", - "/node-gyp", - "/nyc", - "/pacote", - "/read-package-json", - "/rimraf", - "/tap", - "/tap-mocha-reporter", - "/test-exclude" + "main": "glob.js", + "files": [ + "glob.js", + "sync.js", + "common.js" ], - "_resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", - "_shasum": "141f33b81a7c2492e125594307480c46679278a6", - "_spec": "glob@7.1.6", - "_where": "/Users/darcyclarke/Documents/Repos/npm/cli", - "author": { - "name": "Isaac Z. Schlueter", - "email": "i@izs.me", - "url": "http://blog.izs.me/" - }, - "bugs": { - "url": "https://github.com/isaacs/node-glob/issues" + "engines": { + "node": "*" }, - "bundleDependencies": false, "dependencies": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", @@ -52,41 +24,23 @@ "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" + "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" }, - "version": "7.1.6" + "license": "ISC", + "funding": { + "url": "https://github.com/sponsors/isaacs" + } } diff --git a/deps/npm/node_modules/global-dirs/index.js b/deps/npm/node_modules/global-dirs/index.js deleted file mode 100644 index 2b61d4eae2566f..00000000000000 --- a/deps/npm/node_modules/global-dirs/index.js +++ /dev/null @@ -1,90 +0,0 @@ -'use strict'; -const path = require('path'); -const os = require('os'); -const fs = require('fs'); -const ini = require('ini'); - -const readRc = fp => { - try { - return ini.parse(fs.readFileSync(fp, 'utf8')).prefix; - } catch (err) {} -}; - -const defaultNpmPrefix = (() => { - if (process.env.PREFIX) { - return process.env.PREFIX; - } - - if (process.platform === 'win32') { - // `c:\node\node.exe` → `prefix=c:\node\` - return path.dirname(process.execPath); - } - - // `/usr/local/bin/node` → `prefix=/usr/local` - return path.dirname(path.dirname(process.execPath)); -})(); - -const getNpmPrefix = () => { - if (process.env.PREFIX) { - return process.env.PREFIX; - } - - const homePrefix = readRc(path.join(os.homedir(), '.npmrc')); - if (homePrefix) { - return homePrefix; - } - - const globalConfigPrefix = readRc(path.resolve(defaultNpmPrefix, 'etc', 'npmrc')); - if (globalConfigPrefix) { - return globalConfigPrefix; - } - - if (process.platform === 'win32' && process.env.APPDATA) { - // Hardcoded contents of `c:\Program Files\nodejs\node_modules\npm\.npmrc` - const prefix = path.join(process.env.APPDATA, 'npm'); - if (fs.existsSync(prefix)) { - return prefix; - } - } - - return defaultNpmPrefix; -}; - -const npmPrefix = path.resolve(getNpmPrefix()); - -const getYarnPrefix = () => { - if (process.env.PREFIX) { - return process.env.PREFIX; - } - - if (process.platform === 'win32' && process.env.LOCALAPPDATA) { - const prefix = path.join(process.env.LOCALAPPDATA, 'Yarn'); - if (fs.existsSync(prefix)) { - return prefix; - } - } - - const configPrefix = path.join(os.homedir(), '.config/yarn'); - if (fs.existsSync(configPrefix)) { - return configPrefix; - } - - const homePrefix = path.join(os.homedir(), '.yarn-config'); - if (fs.existsSync(homePrefix)) { - return homePrefix; - } - - // Yarn supports the npm conventions but the inverse is not true - return npmPrefix; -}; - -exports.npm = {}; -exports.npm.prefix = npmPrefix; -exports.npm.packages = path.join(npmPrefix, process.platform === 'win32' ? 'node_modules' : 'lib/node_modules'); -exports.npm.binaries = process.platform === 'win32' ? npmPrefix : path.join(npmPrefix, 'bin'); - -const yarnPrefix = path.resolve(getYarnPrefix()); -exports.yarn = {}; -exports.yarn.prefix = yarnPrefix; -exports.yarn.packages = path.join(yarnPrefix, process.platform === 'win32' ? 'config/global/node_modules' : 'global/node_modules'); -exports.yarn.binaries = path.join(exports.yarn.packages, '.bin'); diff --git a/deps/npm/node_modules/global-dirs/package.json b/deps/npm/node_modules/global-dirs/package.json deleted file mode 100644 index 41f0a2e2d39a48..00000000000000 --- a/deps/npm/node_modules/global-dirs/package.json +++ /dev/null @@ -1,84 +0,0 @@ -{ - "_from": "global-dirs@^0.1.0", - "_id": "global-dirs@0.1.1", - "_inBundle": false, - "_integrity": "sha1-sxnA3UYH81PzvpzKTHL8FIxJ9EU=", - "_location": "/global-dirs", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "global-dirs@^0.1.0", - "name": "global-dirs", - "escapedName": "global-dirs", - "rawSpec": "^0.1.0", - "saveSpec": null, - "fetchSpec": "^0.1.0" - }, - "_requiredBy": [ - "/is-installed-globally" - ], - "_resolved": "https://registry.npmjs.org/global-dirs/-/global-dirs-0.1.1.tgz", - "_shasum": "b319c0dd4607f353f3be9cca4c72fc148c49f445", - "_spec": "global-dirs@^0.1.0", - "_where": "/Users/rebecca/code/npm/node_modules/is-installed-globally", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "bugs": { - "url": "https://github.com/sindresorhus/global-dirs/issues" - }, - "bundleDependencies": false, - "dependencies": { - "ini": "^1.3.4" - }, - "deprecated": false, - "description": "Get the directory of globally installed packages and binaries", - "devDependencies": { - "ava": "*", - "execa": "^0.7.0", - "xo": "*" - }, - "engines": { - "node": ">=4" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/sindresorhus/global-dirs#readme", - "keywords": [ - "global", - "prefix", - "path", - "paths", - "npm", - "yarn", - "node", - "modules", - "node-modules", - "package", - "packages", - "binary", - "binaries", - "bin", - "directory", - "directories", - "npmrc", - "rc", - "config", - "root", - "resolve" - ], - "license": "MIT", - "name": "global-dirs", - "repository": { - "type": "git", - "url": "git+https://github.com/sindresorhus/global-dirs.git" - }, - "scripts": { - "test": "xo && ava" - }, - "version": "0.1.1" -} diff --git a/deps/npm/node_modules/global-dirs/readme.md b/deps/npm/node_modules/global-dirs/readme.md deleted file mode 100644 index 1acea6d739f3ff..00000000000000 --- a/deps/npm/node_modules/global-dirs/readme.md +++ /dev/null @@ -1,69 +0,0 @@ -# global-dirs [![Build Status](https://travis-ci.org/sindresorhus/global-dirs.svg?branch=master)](https://travis-ci.org/sindresorhus/global-dirs) - -> Get the directory of globally installed packages and binaries - -Uses the same resolution logic as `npm` and `yarn`. - - -## Install - -``` -$ npm install global-dirs -``` - - -## Usage - -```js -const globalDirs = require('global-dirs'); - -console.log(globalDirs.npm.prefix); -//=> '/usr/local' - -console.log(globalDirs.npm.packages); -//=> '/usr/local/lib/node_modules' - -console.log(globalDirs.npm.binaries); -//=> '/usr/local/bin' - -console.log(globalDirs.yarn.packages); -//=> '/Users/sindresorhus/.config/yarn/global/node_modules' -``` - - -## API - -### globalDirs - -#### npm -#### yarn - -##### packages - -Directory with globally installed packages. - -Equivalent to `npm root --global`. - -##### binaries - -Directory with globally installed binaries. - -Equivalent to `npm bin --global`. - -##### prefix - -Directory with directories for packages and binaries. You probably want either of the above. - -Equivalent to `npm prefix --global`. - - -## Related - -- [import-global](https://github.com/sindresorhus/import-global) - Import a globally installed module -- [resolve-global](https://github.com/sindresorhus/resolve-global) - Resolve the path of a globally installed module -- [is-installed-globally](https://github.com/sindresorhus/is-installed-globally) - Check if your package was installed globally - - -## License - -MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/deps/npm/node_modules/got/index.js b/deps/npm/node_modules/got/index.js deleted file mode 100644 index 31a64dd08b28d1..00000000000000 --- a/deps/npm/node_modules/got/index.js +++ /dev/null @@ -1,364 +0,0 @@ -'use strict'; -const EventEmitter = require('events'); -const http = require('http'); -const https = require('https'); -const PassThrough = require('stream').PassThrough; -const urlLib = require('url'); -const querystring = require('querystring'); -const duplexer3 = require('duplexer3'); -const isStream = require('is-stream'); -const getStream = require('get-stream'); -const timedOut = require('timed-out'); -const urlParseLax = require('url-parse-lax'); -const lowercaseKeys = require('lowercase-keys'); -const isRedirect = require('is-redirect'); -const unzipResponse = require('unzip-response'); -const createErrorClass = require('create-error-class'); -const isRetryAllowed = require('is-retry-allowed'); -const Buffer = require('safe-buffer').Buffer; -const pkg = require('./package'); - -function requestAsEventEmitter(opts) { - opts = opts || {}; - - const ee = new EventEmitter(); - const requestUrl = opts.href || urlLib.resolve(urlLib.format(opts), opts.path); - let redirectCount = 0; - let retryCount = 0; - let redirectUrl; - - const get = opts => { - const fn = opts.protocol === 'https:' ? https : http; - - const req = fn.request(opts, res => { - const statusCode = res.statusCode; - - if (isRedirect(statusCode) && opts.followRedirect && 'location' in res.headers && (opts.method === 'GET' || opts.method === 'HEAD')) { - res.resume(); - - if (++redirectCount > 10) { - ee.emit('error', new got.MaxRedirectsError(statusCode, opts), null, res); - return; - } - - const bufferString = Buffer.from(res.headers.location, 'binary').toString(); - - redirectUrl = urlLib.resolve(urlLib.format(opts), bufferString); - const redirectOpts = Object.assign({}, opts, urlLib.parse(redirectUrl)); - - ee.emit('redirect', res, redirectOpts); - - get(redirectOpts); - - return; - } - - setImmediate(() => { - const response = typeof unzipResponse === 'function' && req.method !== 'HEAD' ? unzipResponse(res) : res; - response.url = redirectUrl || requestUrl; - response.requestUrl = requestUrl; - - ee.emit('response', response); - }); - }); - - req.once('error', err => { - const backoff = opts.retries(++retryCount, err); - - if (backoff) { - setTimeout(get, backoff, opts); - return; - } - - ee.emit('error', new got.RequestError(err, opts)); - }); - - if (opts.gotTimeout) { - timedOut(req, opts.gotTimeout); - } - - setImmediate(() => { - ee.emit('request', req); - }); - }; - - get(opts); - return ee; -} - -function asPromise(opts) { - return new Promise((resolve, reject) => { - const ee = requestAsEventEmitter(opts); - - ee.on('request', req => { - if (isStream(opts.body)) { - opts.body.pipe(req); - opts.body = undefined; - return; - } - - req.end(opts.body); - }); - - ee.on('response', res => { - const stream = opts.encoding === null ? getStream.buffer(res) : getStream(res, opts); - - stream - .catch(err => reject(new got.ReadError(err, opts))) - .then(data => { - const statusCode = res.statusCode; - const limitStatusCode = opts.followRedirect ? 299 : 399; - - res.body = data; - - if (opts.json && res.body) { - try { - res.body = JSON.parse(res.body); - } catch (e) { - throw new got.ParseError(e, statusCode, opts, data); - } - } - - if (statusCode < 200 || statusCode > limitStatusCode) { - throw new got.HTTPError(statusCode, opts); - } - - resolve(res); - }) - .catch(err => { - Object.defineProperty(err, 'response', {value: res}); - reject(err); - }); - }); - - ee.on('error', reject); - }); -} - -function asStream(opts) { - const input = new PassThrough(); - const output = new PassThrough(); - const proxy = duplexer3(input, output); - - if (opts.json) { - throw new Error('got can not be used as stream when options.json is used'); - } - - if (opts.body) { - proxy.write = () => { - throw new Error('got\'s stream is not writable when options.body is used'); - }; - } - - const ee = requestAsEventEmitter(opts); - - ee.on('request', req => { - proxy.emit('request', req); - - if (isStream(opts.body)) { - opts.body.pipe(req); - return; - } - - if (opts.body) { - req.end(opts.body); - return; - } - - if (opts.method === 'POST' || opts.method === 'PUT' || opts.method === 'PATCH') { - input.pipe(req); - return; - } - - req.end(); - }); - - ee.on('response', res => { - const statusCode = res.statusCode; - - res.pipe(output); - - if (statusCode < 200 || statusCode > 299) { - proxy.emit('error', new got.HTTPError(statusCode, opts), null, res); - return; - } - - proxy.emit('response', res); - }); - - ee.on('redirect', proxy.emit.bind(proxy, 'redirect')); - ee.on('error', proxy.emit.bind(proxy, 'error')); - - return proxy; -} - -function normalizeArguments(url, opts) { - if (typeof url !== 'string' && typeof url !== 'object') { - throw new Error(`Parameter \`url\` must be a string or object, not ${typeof url}`); - } - - if (typeof url === 'string') { - url = url.replace(/^unix:/, 'http://$&'); - url = urlParseLax(url); - - if (url.auth) { - throw new Error('Basic authentication must be done with auth option'); - } - } - - opts = Object.assign( - { - protocol: 'http:', - path: '', - retries: 5 - }, - url, - opts - ); - - opts.headers = Object.assign({ - 'user-agent': `${pkg.name}/${pkg.version} (https://github.com/sindresorhus/got)`, - 'accept-encoding': 'gzip,deflate' - }, lowercaseKeys(opts.headers)); - - const query = opts.query; - - if (query) { - if (typeof query !== 'string') { - opts.query = querystring.stringify(query); - } - - opts.path = `${opts.path.split('?')[0]}?${opts.query}`; - delete opts.query; - } - - if (opts.json && opts.headers.accept === undefined) { - opts.headers.accept = 'application/json'; - } - - let body = opts.body; - - if (body) { - if (typeof body !== 'string' && !(body !== null && typeof body === 'object')) { - throw new Error('options.body must be a ReadableStream, string, Buffer or plain Object'); - } - - opts.method = opts.method || 'POST'; - - if (isStream(body) && typeof body.getBoundary === 'function') { - // Special case for https://github.com/form-data/form-data - opts.headers['content-type'] = opts.headers['content-type'] || `multipart/form-data; boundary=${body.getBoundary()}`; - } else if (body !== null && typeof body === 'object' && !Buffer.isBuffer(body) && !isStream(body)) { - opts.headers['content-type'] = opts.headers['content-type'] || 'application/x-www-form-urlencoded'; - body = opts.body = querystring.stringify(body); - } - - if (opts.headers['content-length'] === undefined && opts.headers['transfer-encoding'] === undefined && !isStream(body)) { - const length = typeof body === 'string' ? Buffer.byteLength(body) : body.length; - opts.headers['content-length'] = length; - } - } - - opts.method = (opts.method || 'GET').toUpperCase(); - - if (opts.hostname === 'unix') { - const matches = /(.+):(.+)/.exec(opts.path); - - if (matches) { - opts.socketPath = matches[1]; - opts.path = matches[2]; - opts.host = null; - } - } - - if (typeof opts.retries !== 'function') { - const retries = opts.retries; - - opts.retries = (iter, err) => { - if (iter > retries || !isRetryAllowed(err)) { - return 0; - } - - const noise = Math.random() * 100; - - return ((1 << iter) * 1000) + noise; - }; - } - - if (opts.followRedirect === undefined) { - opts.followRedirect = true; - } - - if (opts.timeout) { - opts.gotTimeout = opts.timeout; - delete opts.timeout; - } - - return opts; -} - -function got(url, opts) { - try { - return asPromise(normalizeArguments(url, opts)); - } catch (err) { - return Promise.reject(err); - } -} - -const helpers = [ - 'get', - 'post', - 'put', - 'patch', - 'head', - 'delete' -]; - -helpers.forEach(el => { - got[el] = (url, opts) => got(url, Object.assign({}, opts, {method: el})); -}); - -got.stream = (url, opts) => asStream(normalizeArguments(url, opts)); - -for (const el of helpers) { - got.stream[el] = (url, opts) => got.stream(url, Object.assign({}, opts, {method: el})); -} - -function stdError(error, opts) { - if (error.code !== undefined) { - this.code = error.code; - } - - Object.assign(this, { - message: error.message, - host: opts.host, - hostname: opts.hostname, - method: opts.method, - path: opts.path - }); -} - -got.RequestError = createErrorClass('RequestError', stdError); -got.ReadError = createErrorClass('ReadError', stdError); -got.ParseError = createErrorClass('ParseError', function (e, statusCode, opts, data) { - stdError.call(this, e, opts); - this.statusCode = statusCode; - this.statusMessage = http.STATUS_CODES[this.statusCode]; - this.message = `${e.message} in "${urlLib.format(opts)}": \n${data.slice(0, 77)}...`; -}); - -got.HTTPError = createErrorClass('HTTPError', function (statusCode, opts) { - stdError.call(this, {}, opts); - this.statusCode = statusCode; - this.statusMessage = http.STATUS_CODES[this.statusCode]; - this.message = `Response code ${this.statusCode} (${this.statusMessage})`; -}); - -got.MaxRedirectsError = createErrorClass('MaxRedirectsError', function (statusCode, opts) { - stdError.call(this, {}, opts); - this.statusCode = statusCode; - this.statusMessage = http.STATUS_CODES[this.statusCode]; - this.message = 'Redirected 10 times. Aborting.'; -}); - -module.exports = got; diff --git a/deps/npm/node_modules/got/license b/deps/npm/node_modules/got/license deleted file mode 100644 index 654d0bfe943437..00000000000000 --- a/deps/npm/node_modules/got/license +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -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/deps/npm/node_modules/got/node_modules/get-stream/buffer-stream.js b/deps/npm/node_modules/got/node_modules/get-stream/buffer-stream.js deleted file mode 100644 index ae45d3d9e74179..00000000000000 --- a/deps/npm/node_modules/got/node_modules/get-stream/buffer-stream.js +++ /dev/null @@ -1,51 +0,0 @@ -'use strict'; -const PassThrough = require('stream').PassThrough; - -module.exports = opts => { - opts = Object.assign({}, opts); - - const array = opts.array; - let encoding = opts.encoding; - const buffer = encoding === 'buffer'; - let objectMode = false; - - if (array) { - objectMode = !(encoding || buffer); - } else { - encoding = encoding || 'utf8'; - } - - if (buffer) { - encoding = null; - } - - let len = 0; - const ret = []; - const stream = new PassThrough({objectMode}); - - if (encoding) { - stream.setEncoding(encoding); - } - - stream.on('data', chunk => { - ret.push(chunk); - - if (objectMode) { - len = ret.length; - } else { - len += chunk.length; - } - }); - - stream.getBufferedValue = () => { - if (array) { - return ret; - } - - return buffer ? Buffer.concat(ret, len) : ret.join(''); - }; - - stream.getBufferedLength = () => len; - - return stream; -}; diff --git a/deps/npm/node_modules/got/node_modules/get-stream/index.js b/deps/npm/node_modules/got/node_modules/get-stream/index.js deleted file mode 100644 index 2dc5ee96af2d95..00000000000000 --- a/deps/npm/node_modules/got/node_modules/get-stream/index.js +++ /dev/null @@ -1,51 +0,0 @@ -'use strict'; -const bufferStream = require('./buffer-stream'); - -function getStream(inputStream, opts) { - if (!inputStream) { - return Promise.reject(new Error('Expected a stream')); - } - - opts = Object.assign({maxBuffer: Infinity}, opts); - - const maxBuffer = opts.maxBuffer; - let stream; - let clean; - - const p = new Promise((resolve, reject) => { - const error = err => { - if (err) { // null check - err.bufferedData = stream.getBufferedValue(); - } - - reject(err); - }; - - stream = bufferStream(opts); - inputStream.once('error', error); - inputStream.pipe(stream); - - stream.on('data', () => { - if (stream.getBufferedLength() > maxBuffer) { - reject(new Error('maxBuffer exceeded')); - } - }); - stream.once('error', error); - stream.on('end', resolve); - - clean = () => { - // some streams doesn't implement the `stream.Readable` interface correctly - if (inputStream.unpipe) { - inputStream.unpipe(stream); - } - }; - }); - - p.then(clean, clean); - - return p.then(() => stream.getBufferedValue()); -} - -module.exports = getStream; -module.exports.buffer = (stream, opts) => getStream(stream, Object.assign({}, opts, {encoding: 'buffer'})); -module.exports.array = (stream, opts) => getStream(stream, Object.assign({}, opts, {array: true})); diff --git a/deps/npm/node_modules/got/node_modules/get-stream/license b/deps/npm/node_modules/got/node_modules/get-stream/license deleted file mode 100644 index 654d0bfe943437..00000000000000 --- a/deps/npm/node_modules/got/node_modules/get-stream/license +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -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/deps/npm/node_modules/got/node_modules/get-stream/package.json b/deps/npm/node_modules/got/node_modules/get-stream/package.json deleted file mode 100644 index e8eb498409e004..00000000000000 --- a/deps/npm/node_modules/got/node_modules/get-stream/package.json +++ /dev/null @@ -1,80 +0,0 @@ -{ - "_from": "get-stream@^3.0.0", - "_id": "get-stream@3.0.0", - "_inBundle": false, - "_integrity": "sha1-jpQ9E1jcN1VQVOy+LtsFqhdO3hQ=", - "_location": "/got/get-stream", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "get-stream@^3.0.0", - "name": "get-stream", - "escapedName": "get-stream", - "rawSpec": "^3.0.0", - "saveSpec": null, - "fetchSpec": "^3.0.0" - }, - "_requiredBy": [ - "/got" - ], - "_resolved": "http://registry.npmjs.org/get-stream/-/get-stream-3.0.0.tgz", - "_shasum": "8e943d1358dc37555054ecbe2edb05aa174ede14", - "_spec": "get-stream@^3.0.0", - "_where": "/Users/zkat/Documents/code/work/npm/node_modules/got", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "bugs": { - "url": "https://github.com/sindresorhus/get-stream/issues" - }, - "bundleDependencies": false, - "deprecated": false, - "description": "Get a stream as a string, buffer, or array", - "devDependencies": { - "ava": "*", - "into-stream": "^3.0.0", - "xo": "*" - }, - "engines": { - "node": ">=4" - }, - "files": [ - "index.js", - "buffer-stream.js" - ], - "homepage": "https://github.com/sindresorhus/get-stream#readme", - "keywords": [ - "get", - "stream", - "promise", - "concat", - "string", - "str", - "text", - "buffer", - "read", - "data", - "consume", - "readable", - "readablestream", - "array", - "object", - "obj" - ], - "license": "MIT", - "name": "get-stream", - "repository": { - "type": "git", - "url": "git+https://github.com/sindresorhus/get-stream.git" - }, - "scripts": { - "test": "xo && ava" - }, - "version": "3.0.0", - "xo": { - "esnext": true - } -} diff --git a/deps/npm/node_modules/got/node_modules/get-stream/readme.md b/deps/npm/node_modules/got/node_modules/get-stream/readme.md deleted file mode 100644 index 73b188fb420f2a..00000000000000 --- a/deps/npm/node_modules/got/node_modules/get-stream/readme.md +++ /dev/null @@ -1,117 +0,0 @@ -# get-stream [![Build Status](https://travis-ci.org/sindresorhus/get-stream.svg?branch=master)](https://travis-ci.org/sindresorhus/get-stream) - -> Get a stream as a string, buffer, or array - - -## Install - -``` -$ npm install --save get-stream -``` - - -## Usage - -```js -const fs = require('fs'); -const getStream = require('get-stream'); -const stream = fs.createReadStream('unicorn.txt'); - -getStream(stream).then(str => { - console.log(str); - /* - ,,))))))));, - __)))))))))))))), - \|/ -\(((((''''((((((((. - -*-==//////(('' . `)))))), - /|\ ))| o ;-. '((((( ,(, - ( `| / ) ;))))' ,_))^;(~ - | | | ,))((((_ _____------~~~-. %,;(;(>';'~ - o_); ; )))(((` ~---~ `:: \ %%~~)(v;(`('~ - ; ''''```` `: `:::|\,__,%% );`'; ~ - | _ ) / `:|`----' `-' - ______/\/~ | / / - /~;;.____/;;' / ___--,-( `;;;/ - / // _;______;'------~~~~~ /;;/\ / - // | | / ; \;;,\ - (<_ | ; /',/-----' _> - \_| ||_ //~;~~~~~~~~~ - `\_| (,~~ - \~\ - ~~ - */ -}); -``` - - -## API - -The methods returns a promise that resolves when the `end` event fires on the stream, indicating that there is no more data to be read. The stream is switched to flowing mode. - -### getStream(stream, [options]) - -Get the `stream` as a string. - -#### options - -##### encoding - -Type: `string`
    -Default: `utf8` - -[Encoding](https://nodejs.org/api/buffer.html#buffer_buffer) of the incoming stream. - -##### maxBuffer - -Type: `number`
    -Default: `Infinity` - -Maximum length of the returned string. If it exceeds this value before the stream ends, the promise will be rejected. - -### getStream.buffer(stream, [options]) - -Get the `stream` as a buffer. - -It honors the `maxBuffer` option as above, but it refers to byte length rather than string length. - -### getStream.array(stream, [options]) - -Get the `stream` as an array of values. - -It honors both the `maxBuffer` and `encoding` options. The behavior changes slightly based on the encoding chosen: - -- When `encoding` is unset, it assumes an [object mode stream](https://nodesource.com/blog/understanding-object-streams/) and collects values emitted from `stream` unmodified. In this case `maxBuffer` refers to the number of items in the array (not the sum of their sizes). - -- When `encoding` is set to `buffer`, it collects an array of buffers. `maxBuffer` refers to the summed byte lengths of every buffer in the array. - -- When `encoding` is set to anything else, it collects an array of strings. `maxBuffer` refers to the summed character lengths of every string in the array. - - -## Errors - -If the input stream emits an `error` event, the promise will be rejected with the error. The buffered data will be attached to the `bufferedData` property of the error. - -```js -getStream(streamThatErrorsAtTheEnd('unicorn')) - .catch(err => { - console.log(err.bufferedData); - //=> 'unicorn' - }); -``` - - -## FAQ - -### How is this different from [`concat-stream`](https://github.com/maxogden/concat-stream)? - -This module accepts a stream instead of being one and returns a promise instead of using a callback. The API is simpler and it only supports returning a string, buffer, or array. It doesn't have a fragile type inference. You explicitly choose what you want. And it doesn't depend on the huge `readable-stream` package. - - -## Related - -- [get-stdin](https://github.com/sindresorhus/get-stdin) - Get stdin as a string or buffer - - -## License - -MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/deps/npm/node_modules/got/package.json b/deps/npm/node_modules/got/package.json deleted file mode 100644 index 67a0cedf56264b..00000000000000 --- a/deps/npm/node_modules/got/package.json +++ /dev/null @@ -1,110 +0,0 @@ -{ - "_from": "got@^6.7.1", - "_id": "got@6.7.1", - "_inBundle": false, - "_integrity": "sha1-JAzQV4WpoY5WHcG0S0HHY+8ejbA=", - "_location": "/got", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "got@^6.7.1", - "name": "got", - "escapedName": "got", - "rawSpec": "^6.7.1", - "saveSpec": null, - "fetchSpec": "^6.7.1" - }, - "_requiredBy": [ - "/package-json" - ], - "_resolved": "https://registry.npmjs.org/got/-/got-6.7.1.tgz", - "_shasum": "240cd05785a9a18e561dc1b44b41c763ef1e8db0", - "_spec": "got@^6.7.1", - "_where": "/Users/rebecca/code/npm/node_modules/package-json", - "ava": { - "concurrency": 4 - }, - "browser": { - "unzip-response": false - }, - "bugs": { - "url": "https://github.com/sindresorhus/got/issues" - }, - "bundleDependencies": false, - "dependencies": { - "create-error-class": "^3.0.0", - "duplexer3": "^0.1.4", - "get-stream": "^3.0.0", - "is-redirect": "^1.0.0", - "is-retry-allowed": "^1.0.0", - "is-stream": "^1.0.0", - "lowercase-keys": "^1.0.0", - "safe-buffer": "^5.0.1", - "timed-out": "^4.0.0", - "unzip-response": "^2.0.1", - "url-parse-lax": "^1.0.0" - }, - "deprecated": false, - "description": "Simplified HTTP requests", - "devDependencies": { - "ava": "^0.17.0", - "coveralls": "^2.11.4", - "form-data": "^2.1.1", - "get-port": "^2.0.0", - "into-stream": "^3.0.0", - "nyc": "^10.0.0", - "pem": "^1.4.4", - "pify": "^2.3.0", - "tempfile": "^1.1.1", - "xo": "*" - }, - "engines": { - "node": ">=4" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/sindresorhus/got#readme", - "keywords": [ - "http", - "https", - "get", - "got", - "url", - "uri", - "request", - "util", - "utility", - "simple", - "curl", - "wget", - "fetch" - ], - "license": "MIT", - "maintainers": [ - { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - { - "name": "Vsevolod Strukchinsky", - "email": "floatdrop@gmail.com", - "url": "github.com/floatdrop" - } - ], - "name": "got", - "repository": { - "type": "git", - "url": "git+https://github.com/sindresorhus/got.git" - }, - "scripts": { - "coveralls": "nyc report --reporter=text-lcov | coveralls", - "test": "xo && nyc ava" - }, - "version": "6.7.1", - "xo": { - "esnext": true - } -} diff --git a/deps/npm/node_modules/got/readme.md b/deps/npm/node_modules/got/readme.md deleted file mode 100644 index bfab067679b27b..00000000000000 --- a/deps/npm/node_modules/got/readme.md +++ /dev/null @@ -1,335 +0,0 @@ -

    -
    - got -
    -
    -
    -

    - -> Simplified HTTP requests - -[![Build Status](https://travis-ci.org/sindresorhus/got.svg?branch=master)](https://travis-ci.org/sindresorhus/got) [![Coverage Status](https://coveralls.io/repos/github/sindresorhus/got/badge.svg?branch=master)](https://coveralls.io/github/sindresorhus/got?branch=master) [![Downloads](https://img.shields.io/npm/dm/got.svg)](https://npmjs.com/got) - -A nicer interface to the built-in [`http`](http://nodejs.org/api/http.html) module. - -It supports following redirects, promises, streams, retries, automagically handling gzip/deflate and some convenience options. - -Created because [`request`](https://github.com/request/request) is bloated *(several megabytes!)*. - - -## Install - -**WARNING: Node.js 4 or higher is required for got@6 and above.** For older Node.js versions use [got@5](https://github.com/sindresorhus/got/tree/v5.x). - -``` -$ npm install --save got -``` - - -## Usage - -```js -const fs = require('fs'); -const got = require('got'); - -got('todomvc.com') - .then(response => { - console.log(response.body); - //=> ' ...' - }) - .catch(error => { - console.log(error.response.body); - //=> 'Internal server error ...' - }); - -// Streams -got.stream('todomvc.com').pipe(fs.createWriteStream('index.html')); - -// For POST, PUT and PATCH methods got.stream returns a WritableStream -fs.createReadStream('index.html').pipe(got.stream.post('todomvc.com')); -``` - - -### API - -It's a `GET` request by default, but can be changed in `options`. - -#### got(url, [options]) - -Returns a Promise for a `response` object with a `body` property, a `url` property with the request URL or the final URL after redirects, and a `requestUrl` property with the original request URL. - -##### url - -Type: `string`, `object` - -The URL to request or a [`http.request` options](https://nodejs.org/api/http.html#http_http_request_options_callback) object. - -Properties from `options` will override properties in the parsed `url`. - -##### options - -Type: `object` - -Any of the [`http.request`](http://nodejs.org/api/http.html#http_http_request_options_callback) options. - -###### body - -Type: `string`, `buffer`, `readableStream`, `object` - -*This is mutually exclusive with stream mode.* - -Body that will be sent with a `POST` request. - -If present in `options` and `options.method` is not set, `options.method` will be set to `POST`. - -If `content-length` or `transfer-encoding` is not set in `options.headers` and `body` is a string or buffer, `content-length` will be set to the body length. - -If `body` is a plain object, it will be stringified with [`querystring.stringify`](https://nodejs.org/api/querystring.html#querystring_querystring_stringify_obj_sep_eq_options) and sent as `application/x-www-form-urlencoded`. - -###### encoding - -Type: `string`, `null`
    -Default: `'utf8'` - -Encoding to be used on `setEncoding` of the response data. If `null`, the body is returned as a Buffer. - -###### json - -Type: `boolean`
    -Default: `false` - -*This is mutually exclusive with stream mode.* - -Parse response body with `JSON.parse` and set `accept` header to `application/json`. - -###### query - -Type: `string`, `object`
    - -Query string object that will be added to the request URL. This will override the query string in `url`. - -###### timeout - -Type: `number`, `object` - -Milliseconds to wait for a server to send response headers before aborting request with `ETIMEDOUT` error. - -Option accepts `object` with separate `connect` and `socket` fields for connection and socket inactivity timeouts. - -###### retries - -Type: `number`, `function`
    -Default: `5` - -Number of request retries when network errors happens. Delays between retries counts with function `1000 * Math.pow(2, retry) + Math.random() * 100`, where `retry` is attempt number (starts from 0). - -Option accepts `function` with `retry` and `error` arguments. Function must return delay in milliseconds (`0` return value cancels retry). - -**Note:** if `retries` is `number`, `ENOTFOUND` and `ENETUNREACH` error will not be retried (see full list in [`is-retry-allowed`](https://github.com/floatdrop/is-retry-allowed/blob/master/index.js#L12) module). - -###### followRedirect - -Type: `boolean`
    -Default: `true` - -Defines if redirect responses should be followed automatically. - - -#### Streams - -#### got.stream(url, [options]) - -`stream` method will return Duplex stream with additional events: - -##### .on('request', request) - -`request` event to get the request object of the request. - -**Tip**: You can use `request` event to abort request: - -```js -got.stream('github.com') - .on('request', req => setTimeout(() => req.abort(), 50)); -``` - -##### .on('response', response) - -`response` event to get the response object of the final request. - -##### .on('redirect', response, nextOptions) - -`redirect` event to get the response object of a redirect. The second argument is options for the next request to the redirect location. - -##### .on('error', error, body, response) - -`error` event emitted in case of protocol error (like `ENOTFOUND` etc.) or status error (4xx or 5xx). The second argument is the body of the server response in case of status error. The third argument is response object. - -#### got.get(url, [options]) -#### got.post(url, [options]) -#### got.put(url, [options]) -#### got.patch(url, [options]) -#### got.head(url, [options]) -#### got.delete(url, [options]) - -Sets `options.method` to the method name and makes a request. - - -## Errors - -Each error contains (if available) `statusCode`, `statusMessage`, `host`, `hostname`, `method` and `path` properties to make debugging easier. - -In Promise mode, the `response` is attached to the error. - -#### got.RequestError - -When a request fails. Contains a `code` property with error class code, like `ECONNREFUSED`. - -#### got.ReadError - -When reading from response stream fails. - -#### got.ParseError - -When `json` option is enabled and `JSON.parse` fails. - -#### got.HTTPError - -When server response code is not 2xx. Contains `statusCode` and `statusMessage`. - -#### got.MaxRedirectsError - -When server redirects you more than 10 times. - - -## Proxies - -You can use the [`tunnel`](https://github.com/koichik/node-tunnel) module with the `agent` option to work with proxies: - -```js -const got = require('got'); -const tunnel = require('tunnel'); - -got('todomvc.com', { - agent: tunnel.httpOverHttp({ - proxy: { - host: 'localhost' - } - }) -}); -``` - - -## Cookies - -You can use the [`cookie`](https://github.com/jshttp/cookie) module to include cookies in a request: - -```js -const got = require('got'); -const cookie = require('cookie'); - -got('google.com', { - headers: { - cookie: cookie.serialize('foo', 'bar') - } -}); -``` - - -## Form data - -You can use the [`form-data`](https://github.com/form-data/form-data) module to create POST request with form data: - -```js -const fs = require('fs'); -const got = require('got'); -const FormData = require('form-data'); -const form = new FormData(); - -form.append('my_file', fs.createReadStream('/foo/bar.jpg')); - -got.post('google.com', { - body: form -}); -``` - - -## OAuth - -You can use the [`oauth-1.0a`](https://github.com/ddo/oauth-1.0a) module to create a signed OAuth request: - -```js -const got = require('got'); -const crypto = require('crypto'); -const OAuth = require('oauth-1.0a'); - -const oauth = OAuth({ - consumer: { - key: process.env.CONSUMER_KEY, - secret: process.env.CONSUMER_SECRET - }, - signature_method: 'HMAC-SHA1', - hash_function: (baseString, key) => crypto.createHmac('sha1', key).update(baseString).digest('base64') -}); - -const token = { - key: process.env.ACCESS_TOKEN, - secret: process.env.ACCESS_TOKEN_SECRET -}; - -const url = 'https://api.twitter.com/1.1/statuses/home_timeline.json'; - -got(url, { - headers: oauth.toHeader(oauth.authorize({url, method: 'GET'}, token)), - json: true -}); -``` - - -## Unix Domain Sockets - -Requests can also be sent via [unix domain sockets](http://serverfault.com/questions/124517/whats-the-difference-between-unix-socket-and-tcp-ip-socket). Use the following URL scheme: `PROTOCOL://unix:SOCKET:PATH`. - -- `PROTOCOL` - `http` or `https` *(optional)* -- `SOCKET` - absolute path to a unix domain socket, e.g. `/var/run/docker.sock` -- `PATH` - request path, e.g. `/v2/keys` - -```js -got('http://unix:/var/run/docker.sock:/containers/json'); - -// or without protocol (http by default) -got('unix:/var/run/docker.sock:/containers/json'); -``` - - -## Tip - -It's a good idea to set the `'user-agent'` header so the provider can more easily see how their resource is used. By default, it's the URL to this repo. - -```js -const got = require('got'); -const pkg = require('./package.json'); - -got('todomvc.com', { - headers: { - 'user-agent': `my-module/${pkg.version} (https://github.com/username/my-module)` - } -}); -``` - - -## Related - -- [gh-got](https://github.com/sindresorhus/gh-got) - Convenience wrapper for interacting with the GitHub API -- [travis-got](https://github.com/samverschueren/travis-got) - Convenience wrapper for interacting with the Travis API - - -## Created by - -[![Sindre Sorhus](https://avatars.githubusercontent.com/u/170270?v=3&s=100)](https://sindresorhus.com) | [![Vsevolod Strukchinsky](https://avatars.githubusercontent.com/u/365089?v=3&s=100)](https://github.com/floatdrop) ----|--- -[Sindre Sorhus](https://sindresorhus.com) | [Vsevolod Strukchinsky](https://github.com/floatdrop) - - -## License - -MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/deps/npm/node_modules/graceful-fs/package.json b/deps/npm/node_modules/graceful-fs/package.json index 32518904d97418..0a56eb73f37515 100644 --- a/deps/npm/node_modules/graceful-fs/package.json +++ b/deps/npm/node_modules/graceful-fs/package.json @@ -1,74 +1,21 @@ { - "_from": "graceful-fs@4.2.4", - "_id": "graceful-fs@4.2.4", - "_inBundle": false, - "_integrity": "sha512-WjKPNJF79dtJAVniUlGGWHYGz2jWxT6VhN/4m1NdkbZ2nOsEF+cI1Edgql5zCRhs/VsQYRvrXctxktVXZUkixw==", - "_location": "/graceful-fs", - "_phantomChildren": {}, - "_requested": { - "type": "version", - "registry": true, - "raw": "graceful-fs@4.2.4", - "name": "graceful-fs", - "escapedName": "graceful-fs", - "rawSpec": "4.2.4", - "saveSpec": null, - "fetchSpec": "4.2.4" - }, - "_requiredBy": [ - "#USER", - "/", - "/bin-links", - "/cacache", - "/cmd-shim", - "/configstore", - "/cp-file", - "/flat-cache", - "/fs-vacuum", - "/fs-write-stream-atomic", - "/gentle-fs", - "/libcipm", - "/load-json-file", - "/node-gyp", - "/npm-lifecycle", - "/package-hash", - "/pkg-conf/load-json-file", - "/read-cmd-shim", - "/read-installed", - "/read-package-json", - "/readdir-scoped-modules", - "/sha", - "/test-exclude/load-json-file", - "/write-file-atomic" - ], - "_resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.4.tgz", - "_shasum": "2256bde14d3632958c465ebc96dc467ca07a29fb", - "_spec": "graceful-fs@4.2.4", - "_where": "/Users/ruyadorno/Documents/workspace/cli", - "bugs": { - "url": "https://github.com/isaacs/node-graceful-fs/issues" - }, - "bundleDependencies": false, - "dependencies": {}, - "deprecated": false, + "name": "graceful-fs", "description": "A drop-in replacement for fs, making various improvements.", - "devDependencies": { - "import-fresh": "^2.0.0", - "mkdirp": "^0.5.0", - "rimraf": "^2.2.8", - "tap": "^12.7.0" + "version": "4.2.4", + "repository": { + "type": "git", + "url": "https://github.com/isaacs/node-graceful-fs" }, + "main": "graceful-fs.js", "directories": { "test": "test" }, - "files": [ - "fs.js", - "graceful-fs.js", - "legacy-streams.js", - "polyfills.js", - "clone.js" - ], - "homepage": "https://github.com/isaacs/node-graceful-fs#readme", + "scripts": { + "preversion": "npm test", + "postversion": "npm publish", + "postpublish": "git push origin --follow-tags", + "test": "node test.js | tap -" + }, "keywords": [ "fs", "module", @@ -86,17 +33,18 @@ "EACCESS" ], "license": "ISC", - "main": "graceful-fs.js", - "name": "graceful-fs", - "repository": { - "type": "git", - "url": "git+https://github.com/isaacs/node-graceful-fs.git" - }, - "scripts": { - "postpublish": "git push origin --follow-tags", - "postversion": "npm publish", - "preversion": "npm test", - "test": "node test.js | tap -" + "devDependencies": { + "import-fresh": "^2.0.0", + "mkdirp": "^0.5.0", + "rimraf": "^2.2.8", + "tap": "^12.7.0" }, - "version": "4.2.4" + "files": [ + "fs.js", + "graceful-fs.js", + "legacy-streams.js", + "polyfills.js", + "clone.js" + ], + "dependencies": {} } diff --git a/deps/npm/node_modules/har-schema/package.json b/deps/npm/node_modules/har-schema/package.json index b6cec879e1c64b..d14650bd78261d 100644 --- a/deps/npm/node_modules/har-schema/package.json +++ b/deps/npm/node_modules/har-schema/package.json @@ -1,49 +1,47 @@ { - "_from": "har-schema@^2.0.0", - "_id": "har-schema@2.0.0", - "_inBundle": false, - "_integrity": "sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI=", - "_location": "/har-schema", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "har-schema@^2.0.0", - "name": "har-schema", - "escapedName": "har-schema", - "rawSpec": "^2.0.0", - "saveSpec": null, - "fetchSpec": "^2.0.0" + "version": "2.0.0", + "name": "har-schema", + "description": "JSON Schema for HTTP Archive (HAR)", + "author": "Ahmad Nassri (https://www.ahmadnassri.com/)", + "contributors": [ + "Evgeny Poberezkin " + ], + "homepage": "https://github.com/ahmadnassri/har-schema", + "repository": { + "type": "git", + "url": "https://github.com/ahmadnassri/har-schema.git" }, - "_requiredBy": [ - "/har-validator" + "license": "ISC", + "main": "lib/index.js", + "keywords": [ + "har", + "http", + "archive", + "JSON", + "schema", + "JSON-schema" ], - "_resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz", - "_shasum": "a94c2224ebcac04782a0d9035521f24735b7ec92", - "_spec": "har-schema@^2.0.0", - "_where": "/Users/zkat/Documents/code/work/npm/node_modules/har-validator", - "author": { - "name": "Ahmad Nassri", - "email": "ahmad@ahmadnassri.com", - "url": "https://www.ahmadnassri.com/" + "engines": { + "node": ">=4" }, + "files": [ + "lib" + ], "bugs": { "url": "https://github.com/ahmadnassri/har-schema/issues" }, - "bundleDependencies": false, + "scripts": { + "test": "tap test --reporter spec", + "pretest": "snazzy && echint", + "coverage": "tap test --reporter silent --coverage", + "codeclimate": "tap --coverage-report=text-lcov | codeclimate-test-reporter", + "semantic-release": "semantic-release pre && npm publish && semantic-release post" + }, "config": { "commitizen": { "path": "./node_modules/cz-conventional-changelog" } }, - "contributors": [ - { - "name": "Evgeny Poberezkin", - "email": "e.poberezkin@me.com" - } - ], - "deprecated": false, - "description": "JSON Schema for HTTP Archive (HAR)", "devDependencies": { "ajv": "^5.0.0", "codeclimate-test-reporter": "^0.4.0", @@ -52,35 +50,5 @@ "semantic-release": "^6.3.2", "snazzy": "^5.0.0", "tap": "^8.0.1" - }, - "engines": { - "node": ">=4" - }, - "files": [ - "lib" - ], - "homepage": "https://github.com/ahmadnassri/har-schema", - "keywords": [ - "har", - "http", - "archive", - "JSON", - "schema", - "JSON-schema" - ], - "license": "ISC", - "main": "lib/index.js", - "name": "har-schema", - "repository": { - "type": "git", - "url": "git+https://github.com/ahmadnassri/har-schema.git" - }, - "scripts": { - "codeclimate": "tap --coverage-report=text-lcov | codeclimate-test-reporter", - "coverage": "tap test --reporter silent --coverage", - "pretest": "snazzy && echint", - "semantic-release": "semantic-release pre && npm publish && semantic-release post", - "test": "tap test --reporter spec" - }, - "version": "2.0.0" -} + } +} \ No newline at end of file diff --git a/deps/npm/node_modules/har-validator/LICENSE b/deps/npm/node_modules/har-validator/LICENSE index ca55c91af4ec5f..a54526625e0240 100644 --- a/deps/npm/node_modules/har-validator/LICENSE +++ b/deps/npm/node_modules/har-validator/LICENSE @@ -1,13 +1,9 @@ -Copyright (c) 2015, Ahmad Nassri - -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. +MIT License + +Copyright (c) 2018 Ahmad Nassri + +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/har-validator/README.md b/deps/npm/node_modules/har-validator/README.md index fc696349e41e85..ea944cc5c7bd89 100644 --- a/deps/npm/node_modules/har-validator/README.md +++ b/deps/npm/node_modules/har-validator/README.md @@ -1,18 +1,32 @@ -# HAR Validator [![version][npm-version]][npm-url] [![License][license-image]][license-url] +# HAR Validator -> Extremely fast HTTP Archive ([HAR](https://github.com/ahmadnassri/har-spec/blob/master/versions/1.2.md)) validator using JSON Schema. +[![license][license-img]][license-url] +[![version][npm-img]][npm-url] +[![super linter][super-linter-img]][super-linter-url] +[![test][test-img]][test-url] +[![release][release-img]][release-url] + +[license-url]: LICENSE +[license-img]: https://badgen.net/github/license/ahmadnassri/node-har-validator + +[npm-url]: https://www.npmjs.com/package/har-validator +[npm-img]: https://badgen.net/npm/v/har-validator -[![Build Status][travis-image]][travis-url] -[![Downloads][npm-downloads]][npm-url] -[![Code Climate][codeclimate-quality]][codeclimate-url] -[![Coverage Status][codeclimate-coverage]][codeclimate-url] -[![Dependency Status][dependencyci-image]][dependencyci-url] -[![Dependencies][david-image]][david-url] +[super-linter-url]: https://github.com/ahmadnassri/node-har-validator/actions?query=workflow%3Asuper-linter +[super-linter-img]: https://github.com/ahmadnassri/node-har-validator/workflows/super-linter/badge.svg + +[test-url]: https://github.com/ahmadnassri/node-har-validator/actions?query=workflow%3Atest +[test-img]: https://github.com/ahmadnassri/node-har-validator/workflows/test/badge.svg + +[release-url]: https://github.com/ahmadnassri/node-har-validator/actions?query=workflow%3Arelease +[release-img]: https://github.com/ahmadnassri/node-har-validator/workflows/release/badge.svg + +> Extremely fast HTTP Archive ([HAR](https://github.com/ahmadnassri/har-spec/blob/master/versions/1.2.md)) validator using JSON Schema. ## Install ```bash -npm install --only=production --save har-validator +npm install har-validator ``` ## CLI Usage @@ -21,34 +35,9 @@ Please refer to [`har-cli`](https://github.com/ahmadnassri/har-cli) for more inf ## API -**Note**: as of [`v2.0.0`](https://github.com/ahmadnassri/har-validator/releases/tag/v2.0.0) this module defaults to Promise based API. *For backward compatibility with `v1.x` an [async/callback API](docs/async.md) is also provided* +**Note**: as of [`v2.0.0`](https://github.com/ahmadnassri/node-har-validator/releases/tag/v2.0.0) this module defaults to Promise based API. +_For backward compatibility with `v1.x` an [async/callback API](docs/async.md) is also provided_ - [async API](docs/async.md) - [callback API](docs/async.md) -- [Promise API](docs/promise.md) *(default)* - ----- -> :copyright: [ahmadnassri.com](https://www.ahmadnassri.com/)  ·  -> License: [ISC][license-url]  ·  -> Github: [@ahmadnassri](https://github.com/ahmadnassri)  ·  -> Twitter: [@ahmadnassri](https://twitter.com/ahmadnassri) - -[license-url]: http://choosealicense.com/licenses/isc/ -[license-image]: https://img.shields.io/github/license/ahmadnassri/har-validator.svg?style=flat-square - -[travis-url]: https://travis-ci.org/ahmadnassri/har-validator -[travis-image]: https://img.shields.io/travis/ahmadnassri/har-validator.svg?style=flat-square - -[npm-url]: https://www.npmjs.com/package/har-validator -[npm-version]: https://img.shields.io/npm/v/har-validator.svg?style=flat-square -[npm-downloads]: https://img.shields.io/npm/dm/har-validator.svg?style=flat-square - -[codeclimate-url]: https://codeclimate.com/github/ahmadnassri/har-validator -[codeclimate-quality]: https://img.shields.io/codeclimate/github/ahmadnassri/har-validator.svg?style=flat-square -[codeclimate-coverage]: https://img.shields.io/codeclimate/coverage/github/ahmadnassri/har-validator.svg?style=flat-square - -[david-url]: https://david-dm.org/ahmadnassri/har-validator -[david-image]: https://img.shields.io/david/ahmadnassri/har-validator.svg?style=flat-square - -[dependencyci-url]: https://dependencyci.com/github/ahmadnassri/har-validator -[dependencyci-image]: https://dependencyci.com/github/ahmadnassri/har-validator/badge?style=flat-square +- [Promise API](docs/promise.md) _(default)_ diff --git a/deps/npm/node_modules/har-validator/lib/async.js b/deps/npm/node_modules/har-validator/lib/async.js index fc41667e81456a..90701f253f71ed 100644 --- a/deps/npm/node_modules/har-validator/lib/async.js +++ b/deps/npm/node_modules/har-validator/lib/async.js @@ -4,14 +4,21 @@ var schemas = require('har-schema') var ajv +function createAjvInstance () { + var ajv = new Ajv({ + allErrors: true + }) + ajv.addMetaSchema(require('ajv/lib/refs/json-schema-draft-06.json')) + ajv.addSchema(schemas) + + return ajv +} + function validate (name, data, next) { data = data || {} // validator config - ajv = ajv || new Ajv({ - allErrors: true, - schemas: schemas - }) + ajv = ajv || createAjvInstance() var validate = ajv.getSchema(name + '.json') diff --git a/deps/npm/node_modules/har-validator/lib/promise.js b/deps/npm/node_modules/har-validator/lib/promise.js index 1ab308cf7157d7..46f46479786fa3 100644 --- a/deps/npm/node_modules/har-validator/lib/promise.js +++ b/deps/npm/node_modules/har-validator/lib/promise.js @@ -4,14 +4,21 @@ var schemas = require('har-schema') var ajv +function createAjvInstance () { + var ajv = new Ajv({ + allErrors: true + }) + ajv.addMetaSchema(require('ajv/lib/refs/json-schema-draft-06.json')) + ajv.addSchema(schemas) + + return ajv +} + function validate (name, data) { data = data || {} // validator config - ajv = ajv || new Ajv({ - allErrors: true, - schemas: schemas - }) + ajv = ajv || createAjvInstance() var validate = ajv.getSchema(name + '.json') diff --git a/deps/npm/node_modules/har-validator/package.json b/deps/npm/node_modules/har-validator/package.json index 94517703af9a8b..8d1eed1798f910 100644 --- a/deps/npm/node_modules/har-validator/package.json +++ b/deps/npm/node_modules/har-validator/package.json @@ -1,54 +1,15 @@ { - "_from": "har-validator@~5.1.0", - "_id": "har-validator@5.1.0", - "_inBundle": false, - "_integrity": "sha512-+qnmNjI4OfH2ipQ9VQOw23bBd/ibtfbVdK2fYbY4acTDqKTW/YDp9McimZdDbG8iV9fZizUqQMD5xvriB146TA==", - "_location": "/har-validator", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "har-validator@~5.1.0", - "name": "har-validator", - "escapedName": "har-validator", - "rawSpec": "~5.1.0", - "saveSpec": null, - "fetchSpec": "~5.1.0" - }, - "_requiredBy": [ - "/request" - ], - "_resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.1.0.tgz", - "_shasum": "44657f5688a22cfd4b72486e81b3a3fb11742c29", - "_spec": "har-validator@~5.1.0", - "_where": "/Users/zkat/Documents/code/work/npm/node_modules/request", - "author": { - "name": "Ahmad Nassri", - "email": "ahmad@ahmadnassri.com", - "url": "https://www.ahmadnassri.com/" - }, - "bugs": { - "url": "https://github.com/ahmadnassri/har-validator/issues" - }, - "bundleDependencies": false, - "dependencies": { - "ajv": "^5.3.0", - "har-schema": "^2.0.0" - }, - "deprecated": false, + "version": "5.1.5", + "name": "har-validator", "description": "Extremely fast HTTP Archive (HAR) validator using JSON Schema", - "devDependencies": { - "echint": "^4.0.1", - "standard": "^10.0.3", - "tap": "^10.7.2" - }, - "engines": { - "node": ">=4" + "author": "Ahmad Nassri (https://www.ahmadnassri.com/)", + "homepage": "https://github.com/ahmadnassri/node-har-validator", + "repository": { + "type": "git", + "url": "https://github.com/ahmadnassri/node-har-validator.git" }, - "files": [ - "lib" - ], - "homepage": "https://github.com/ahmadnassri/har-validator", + "license": "MIT", + "main": "lib/promise.js", "keywords": [ "har", "cli", @@ -58,18 +19,25 @@ "validate", "validator" ], - "license": "ISC", - "main": "lib/promise.js", - "name": "har-validator", - "repository": { - "type": "git", - "url": "git+https://github.com/ahmadnassri/har-validator.git" + "engines": { + "node": ">=6" + }, + "files": [ + "lib" + ], + "bugs": { + "url": "https://github.com/ahmadnassri/node-har-validator/issues" }, "scripts": { - "coverage": "tap test --reporter silent --coverage", - "lint": "standard && echint", - "pretest": "npm run lint", - "test": "tap test" + "lint": "npx run-p lint:*", + "test": "tap test --no-coverage", + "test:coverage": "tap test --coverage-report=lcov --no-browser" }, - "version": "5.1.0" + "devDependencies": { + "tap": "^14.10.8" + }, + "dependencies": { + "ajv": "^6.12.3", + "har-schema": "^2.0.0" + } } diff --git a/deps/npm/node_modules/has-flag/index.d.ts b/deps/npm/node_modules/has-flag/index.d.ts new file mode 100644 index 00000000000000..a0a48c89112785 --- /dev/null +++ b/deps/npm/node_modules/has-flag/index.d.ts @@ -0,0 +1,39 @@ +/** +Check if [`argv`](https://nodejs.org/docs/latest/api/process.html#process_process_argv) has a specific flag. + +@param flag - CLI flag to look for. The `--` prefix is optional. +@param argv - CLI arguments. Default: `process.argv`. +@returns Whether the flag exists. + +@example +``` +// $ ts-node foo.ts -f --unicorn --foo=bar -- --rainbow + +// foo.ts +import hasFlag = require('has-flag'); + +hasFlag('unicorn'); +//=> true + +hasFlag('--unicorn'); +//=> true + +hasFlag('f'); +//=> true + +hasFlag('-f'); +//=> true + +hasFlag('foo=bar'); +//=> true + +hasFlag('foo'); +//=> false + +hasFlag('rainbow'); +//=> false +``` +*/ +declare function hasFlag(flag: string, argv?: string[]): boolean; + +export = hasFlag; diff --git a/deps/npm/node_modules/has-flag/index.js b/deps/npm/node_modules/has-flag/index.js index 5139728fba6a26..b6f80b1f8ffd76 100644 --- a/deps/npm/node_modules/has-flag/index.js +++ b/deps/npm/node_modules/has-flag/index.js @@ -1,8 +1,8 @@ 'use strict'; -module.exports = (flag, argv) => { - argv = argv || process.argv; + +module.exports = (flag, 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); + const position = argv.indexOf(prefix + flag); + const terminatorPosition = argv.indexOf('--'); + return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition); }; diff --git a/deps/npm/node_modules/has-flag/package.json b/deps/npm/node_modules/has-flag/package.json index 4bcd2125a89c64..a9cba4b856d046 100644 --- a/deps/npm/node_modules/has-flag/package.json +++ b/deps/npm/node_modules/has-flag/package.json @@ -1,76 +1,46 @@ { - "_from": "has-flag@^3.0.0", - "_id": "has-flag@3.0.0", - "_inBundle": false, - "_integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", - "_location": "/has-flag", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "has-flag@^3.0.0", - "name": "has-flag", - "escapedName": "has-flag", - "rawSpec": "^3.0.0", - "saveSpec": null, - "fetchSpec": "^3.0.0" - }, - "_requiredBy": [ - "/supports-color" - ], - "_resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "_shasum": "b5d454dc2199ae225699f3467e5a07f3b955bafd", - "_spec": "has-flag@^3.0.0", - "_where": "/Users/rebecca/code/npm/node_modules/supports-color", - "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" + "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" + } } diff --git a/deps/npm/node_modules/has-flag/readme.md b/deps/npm/node_modules/has-flag/readme.md index 677893c278a2e3..3f72dff29a6961 100644 --- a/deps/npm/node_modules/has-flag/readme.md +++ b/deps/npm/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/deps/npm/node_modules/has-symbols/.npmignore b/deps/npm/node_modules/has-symbols/.npmignore deleted file mode 100644 index 5148e527a7e286..00000000000000 --- a/deps/npm/node_modules/has-symbols/.npmignore +++ /dev/null @@ -1,37 +0,0 @@ -# Logs -logs -*.log -npm-debug.log* - -# Runtime data -pids -*.pid -*.seed - -# Directory for instrumented libs generated by jscoverage/JSCover -lib-cov - -# Coverage directory used by tools like istanbul -coverage - -# nyc test coverage -.nyc_output - -# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) -.grunt - -# node-waf configuration -.lock-wscript - -# Compiled binary addons (http://nodejs.org/api/addons.html) -build/Release - -# Dependency directories -node_modules -jspm_packages - -# Optional npm cache directory -.npm - -# Optional REPL history -.node_repl_history diff --git a/deps/npm/node_modules/has-symbols/.travis.yml b/deps/npm/node_modules/has-symbols/.travis.yml deleted file mode 100644 index 3b3331a3b488a0..00000000000000 --- a/deps/npm/node_modules/has-symbols/.travis.yml +++ /dev/null @@ -1,113 +0,0 @@ -language: node_js -node_js: - - "6.6" - - "6.5" - - "6.4" - - "6.3" - - "6.2" - - "6.1" - - "6.0" - - "5.12" - - "5.11" - - "5.10" - - "5.9" - - "5.8" - - "5.7" - - "5.6" - - "5.5" - - "5.4" - - "5.3" - - "5.2" - - "5.1" - - "5.0" - - "4.5" - - "4.4" - - "4.3" - - "4.2" - - "4.1" - - "4.0" - - "iojs-v3.3" - - "iojs-v3.2" - - "iojs-v3.1" - - "iojs-v3.0" - - "iojs-v2.5" - - "iojs-v2.4" - - "iojs-v2.3" - - "iojs-v2.2" - - "iojs-v2.1" - - "iojs-v2.0" - - "iojs-v1.8" - - "iojs-v1.7" - - "iojs-v1.6" - - "iojs-v1.5" - - "iojs-v1.4" - - "iojs-v1.3" - - "iojs-v1.2" - - "iojs-v1.1" - - "iojs-v1.0" - - "0.12" - - "0.11" - - "0.10" - - "0.9" - - "0.8" - - "0.6" - - "0.4" -before_install: - - 'if [ "${TRAVIS_NODE_VERSION}" != "0.9" ]; then case "$(npm --version)" in 1.*) npm install -g npm@1.4.28 ;; 2.*) npm install -g npm@2 ;; esac ; fi' - - 'if [ "${TRAVIS_NODE_VERSION}" != "0.6" ] && [ "${TRAVIS_NODE_VERSION}" != "0.9" ]; then npm install -g npm; fi' -script: - - 'if [ -n "${LINT-}" ]; then npm run lint ; fi' - - 'if [ -n "${COVERAGE-}" ]; then npm run coverage ; fi' - - 'if [ -n "${TEST-}" ]; then npm run tests-only ; fi' -sudo: false -env: - - TEST=true -matrix: - fast_finish: true - include: - - node_js: "node" - env: LINT=true - allow_failures: - - node_js: "6.5" - - node_js: "6.4" - - node_js: "6.3" - - node_js: "6.2" - - node_js: "6.1" - - node_js: "6.0" - - node_js: "5.11" - - node_js: "5.10" - - node_js: "5.9" - - node_js: "5.8" - - node_js: "5.7" - - node_js: "5.6" - - node_js: "5.5" - - node_js: "5.4" - - node_js: "5.3" - - node_js: "5.2" - - node_js: "5.1" - - node_js: "5.0" - - node_js: "4.4" - - node_js: "4.3" - - node_js: "4.2" - - node_js: "4.1" - - node_js: "4.0" - - node_js: "iojs-v3.2" - - node_js: "iojs-v3.1" - - node_js: "iojs-v3.0" - - node_js: "iojs-v2.4" - - node_js: "iojs-v2.3" - - node_js: "iojs-v2.2" - - node_js: "iojs-v2.1" - - node_js: "iojs-v2.0" - - node_js: "iojs-v1.7" - - node_js: "iojs-v1.6" - - node_js: "iojs-v1.5" - - node_js: "iojs-v1.4" - - node_js: "iojs-v1.3" - - node_js: "iojs-v1.2" - - node_js: "iojs-v1.1" - - node_js: "iojs-v1.0" - - node_js: "0.11" - - node_js: "0.9" - - node_js: "0.6" - - node_js: "0.4" diff --git a/deps/npm/node_modules/has-symbols/CHANGELOG.md b/deps/npm/node_modules/has-symbols/CHANGELOG.md deleted file mode 100644 index da7f9da7ea2077..00000000000000 --- a/deps/npm/node_modules/has-symbols/CHANGELOG.md +++ /dev/null @@ -1,3 +0,0 @@ -1.0.0 / 2016-09-19 -================= - * Initial release. diff --git a/deps/npm/node_modules/has-symbols/LICENSE b/deps/npm/node_modules/has-symbols/LICENSE deleted file mode 100644 index df31cbf3c064d0..00000000000000 --- a/deps/npm/node_modules/has-symbols/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2016 Jordan Harband - -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/has-symbols/README.md b/deps/npm/node_modules/has-symbols/README.md deleted file mode 100644 index b27b31acbc71bc..00000000000000 --- a/deps/npm/node_modules/has-symbols/README.md +++ /dev/null @@ -1,45 +0,0 @@ -# has-symbols [![Version Badge][2]][1] - -[![Build Status][3]][4] -[![dependency status][5]][6] -[![dev dependency status][7]][8] -[![License][license-image]][license-url] -[![Downloads][downloads-image]][downloads-url] - -[![npm badge][11]][1] - -Determine if the JS environment has Symbol support. Supports spec, or shams. - -## Example - -```js -var hasSymbols = require('has-symbols'); - -hasSymbols() === true; // if the environment has native Symbol support. Not polyfillable, not forgeable. - -var hasSymbolsKinda = require('has-symbols/shams'); -hasSymbolsKinda() === true; // if the environment has a Symbol sham that mostly follows the spec. -``` - -## Supported Symbol shams - - get-own-property-symbols [npm](https://www.npmjs.com/package/get-own-property-symbols) | [github](https://github.com/WebReflection/get-own-property-symbols) - - core-js [npm](https://www.npmjs.com/package/core-js) | [github](https://github.com/zloirock/core-js) - -## Tests -Simply clone the repo, `npm install`, and run `npm test` - -[1]: https://npmjs.org/package/has-symbols -[2]: http://versionbadg.es/ljharb/has-symbols.svg -[3]: https://travis-ci.org/ljharb/has-symbols.svg -[4]: https://travis-ci.org/ljharb/has-symbols -[5]: https://david-dm.org/ljharb/has-symbols.svg -[6]: https://david-dm.org/ljharb/has-symbols -[7]: https://david-dm.org/ljharb/has-symbols/dev-status.svg -[8]: https://david-dm.org/ljharb/has-symbols#info=devDependencies -[9]: https://ci.testling.com/ljharb/has-symbols.png -[10]: https://ci.testling.com/ljharb/has-symbols -[11]: https://nodei.co/npm/has-symbols.png?downloads=true&stars=true -[license-image]: http://img.shields.io/npm/l/has-symbols.svg -[license-url]: LICENSE -[downloads-image]: http://img.shields.io/npm/dm/has-symbols.svg -[downloads-url]: http://npm-stat.com/charts.html?package=has-symbols diff --git a/deps/npm/node_modules/has-symbols/index.js b/deps/npm/node_modules/has-symbols/index.js deleted file mode 100644 index f72159e0ac7dcd..00000000000000 --- a/deps/npm/node_modules/has-symbols/index.js +++ /dev/null @@ -1,13 +0,0 @@ -'use strict'; - -var origSymbol = global.Symbol; -var hasSymbolSham = require('./shams'); - -module.exports = function hasNativeSymbols() { - if (typeof origSymbol !== 'function') { return false; } - if (typeof Symbol !== 'function') { return false; } - if (typeof origSymbol('foo') !== 'symbol') { return false; } - if (typeof Symbol('bar') !== 'symbol') { return false; } - - return hasSymbolSham(); -}; diff --git a/deps/npm/node_modules/has-symbols/package.json b/deps/npm/node_modules/has-symbols/package.json deleted file mode 100644 index 0999461218e0d0..00000000000000 --- a/deps/npm/node_modules/has-symbols/package.json +++ /dev/null @@ -1,82 +0,0 @@ -{ - "name": "has-symbols", - "version": "1.0.0", - "author": { - "name": "Jordan Harband", - "email": "ljharb@gmail.com", - "url": "http://ljharb.codes" - }, - "contributors": [ - { - "name": "Jordan Harband", - "email": "ljharb@gmail.com", - "url": "http://ljharb.codes" - } - ], - "description": "Determine if the JS environment has Symbol support. Supports spec, or shams.", - "license": "MIT", - "main": "index.js", - "scripts": { - "prepublish": "safe-publish-latest", - "pretest": "npm run --silent lint", - "test": "npm run --silent tests-only", - "posttest": "npm run --silent security", - "tests-only": "npm run --silent test:stock && npm run --silent test:staging && npm run --silent test:shams", - "test:stock": "node test", - "test:staging": "node --harmony --es-staging test", - "test:shams": "npm run --silent test:shams:getownpropertysymbols && npm run --silent test:shams:corejs", - "test:shams:corejs": "node test/shams/core-js.js", - "test:shams:getownpropertysymbols": "node test/shams/get-own-property-symbols.js", - "lint": "eslint *.js", - "security": "nsp check" - }, - "repository": { - "type": "git", - "url": "git://github.com/ljharb/has-symbols.git" - }, - "keywords": [ - "Symbol", - "symbols", - "typeof", - "sham", - "polyfill", - "native", - "core-js", - "ES6" - ], - "dependencies": {}, - "devDependencies": { - "tape": "^4.6.0", - "nsp": "^2.6.1", - "safe-publish-latest": "^1.0.1", - "eslint": "^3.5.0", - "@ljharb/eslint-config": "^8.0.0", - "get-own-property-symbols": "^0.9.2", - "core-js": "^2.4.1" - }, - "testling": { - "files": "test/index.js", - "browsers": [ - "iexplore/6.0..latest", - "firefox/3.0..6.0", - "firefox/15.0..latest", - "firefox/nightly", - "chrome/4.0..10.0", - "chrome/20.0..latest", - "chrome/canary", - "opera/10.0..latest", - "opera/next", - "safari/4.0..latest", - "ipad/6.0..latest", - "iphone/6.0..latest", - "android-browser/4.2" - ] - }, - "engines": { - "node": ">= 0.4" - } - -,"_resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.0.tgz" -,"_integrity": "sha1-uhqPGvKg/DllD1yFA2dwQSIGO0Q=" -,"_from": "has-symbols@1.0.0" -} \ No newline at end of file diff --git a/deps/npm/node_modules/has-symbols/shams.js b/deps/npm/node_modules/has-symbols/shams.js deleted file mode 100644 index f6c1ff4a236371..00000000000000 --- a/deps/npm/node_modules/has-symbols/shams.js +++ /dev/null @@ -1,42 +0,0 @@ -'use strict'; - -/* eslint complexity: [2, 17], max-statements: [2, 33] */ -module.exports = function hasSymbols() { - if (typeof Symbol !== 'function' || typeof Object.getOwnPropertySymbols !== 'function') { return false; } - if (typeof Symbol.iterator === 'symbol') { return true; } - - var obj = {}; - var sym = Symbol('test'); - var symObj = Object(sym); - if (typeof sym === 'string') { return false; } - - if (Object.prototype.toString.call(sym) !== '[object Symbol]') { return false; } - if (Object.prototype.toString.call(symObj) !== '[object Symbol]') { return false; } - - // temp disabled per https://github.com/ljharb/object.assign/issues/17 - // if (sym instanceof Symbol) { return false; } - // temp disabled per https://github.com/WebReflection/get-own-property-symbols/issues/4 - // if (!(symObj instanceof Symbol)) { return false; } - - // if (typeof Symbol.prototype.toString !== 'function') { return false; } - // if (String(sym) !== Symbol.prototype.toString.call(sym)) { return false; } - - var symVal = 42; - obj[sym] = symVal; - for (sym in obj) { return false; } // eslint-disable-line no-restricted-syntax - if (typeof Object.keys === 'function' && Object.keys(obj).length !== 0) { return false; } - - if (typeof Object.getOwnPropertyNames === 'function' && Object.getOwnPropertyNames(obj).length !== 0) { return false; } - - var syms = Object.getOwnPropertySymbols(obj); - if (syms.length !== 1 || syms[0] !== sym) { return false; } - - if (!Object.prototype.propertyIsEnumerable.call(obj, sym)) { return false; } - - if (typeof Object.getOwnPropertyDescriptor === 'function') { - var descriptor = Object.getOwnPropertyDescriptor(obj, sym); - if (descriptor.value !== symVal || descriptor.enumerable !== true) { return false; } - } - - return true; -}; diff --git a/deps/npm/node_modules/has-symbols/test/index.js b/deps/npm/node_modules/has-symbols/test/index.js deleted file mode 100644 index fc32aff94cbb2d..00000000000000 --- a/deps/npm/node_modules/has-symbols/test/index.js +++ /dev/null @@ -1,22 +0,0 @@ -'use strict'; - -var test = require('tape'); -var hasSymbols = require('../'); -var runSymbolTests = require('./tests'); - -test('interface', function (t) { - t.equal(typeof hasSymbols, 'function', 'is a function'); - t.equal(typeof hasSymbols(), 'boolean', 'returns a boolean'); - t.end(); -}); - -test('Symbols are supported', { skip: !hasSymbols() }, function (t) { - runSymbolTests(t); - t.end(); -}); - -test('Symbols are not supported', { skip: hasSymbols() }, function (t) { - t.equal(typeof Symbol, 'undefined', 'global Symbol is undefined'); - t.equal(typeof Object.getOwnPropertySymbols, 'undefined', 'Object.getOwnPropertySymbols does not exist'); - t.end(); -}); diff --git a/deps/npm/node_modules/has-symbols/test/shams/core-js.js b/deps/npm/node_modules/has-symbols/test/shams/core-js.js deleted file mode 100644 index df5365c23ed741..00000000000000 --- a/deps/npm/node_modules/has-symbols/test/shams/core-js.js +++ /dev/null @@ -1,28 +0,0 @@ -'use strict'; - -var test = require('tape'); - -if (typeof Symbol === 'function' && typeof Symbol() === 'symbol') { - test('has native Symbol support', function (t) { - t.equal(typeof Symbol, 'function'); - t.equal(typeof Symbol(), 'symbol'); - t.end(); - }); - return; -} - -var hasSymbols = require('../../shams'); - -test('polyfilled Symbols', function (t) { - /* eslint-disable global-require */ - t.equal(hasSymbols(), false, 'hasSymbols is false before polyfilling'); - require('core-js/fn/symbol'); - require('core-js/fn/symbol/to-string-tag'); - - require('../tests')(t); - - var hasSymbolsAfter = hasSymbols(); - t.equal(hasSymbolsAfter, true, 'hasSymbols is true after polyfilling'); - /* eslint-enable global-require */ - t.end(); -}); diff --git a/deps/npm/node_modules/has-symbols/test/shams/get-own-property-symbols.js b/deps/npm/node_modules/has-symbols/test/shams/get-own-property-symbols.js deleted file mode 100644 index 9191b248baa14b..00000000000000 --- a/deps/npm/node_modules/has-symbols/test/shams/get-own-property-symbols.js +++ /dev/null @@ -1,28 +0,0 @@ -'use strict'; - -var test = require('tape'); - -if (typeof Symbol === 'function' && typeof Symbol() === 'symbol') { - test('has native Symbol support', function (t) { - t.equal(typeof Symbol, 'function'); - t.equal(typeof Symbol(), 'symbol'); - t.end(); - }); - return; -} - -var hasSymbols = require('../../shams'); - -test('polyfilled Symbols', function (t) { - /* eslint-disable global-require */ - t.equal(hasSymbols(), false, 'hasSymbols is false before polyfilling'); - - require('get-own-property-symbols'); - - require('../tests')(t); - - var hasSymbolsAfter = hasSymbols(); - t.equal(hasSymbolsAfter, true, 'hasSymbols is true after polyfilling'); - /* eslint-enable global-require */ - t.end(); -}); diff --git a/deps/npm/node_modules/has-symbols/test/tests.js b/deps/npm/node_modules/has-symbols/test/tests.js deleted file mode 100644 index 93ff0eae90f039..00000000000000 --- a/deps/npm/node_modules/has-symbols/test/tests.js +++ /dev/null @@ -1,54 +0,0 @@ -'use strict'; - -module.exports = function runSymbolTests(t) { - t.equal(typeof Symbol, 'function', 'global Symbol is a function'); - - if (typeof Symbol !== 'function') { return false }; - - t.notEqual(Symbol(), Symbol(), 'two symbols are not equal'); - - /* - t.equal( - Symbol.prototype.toString.call(Symbol('foo')), - Symbol.prototype.toString.call(Symbol('foo')), - 'two symbols with the same description stringify the same' - ); - */ - - var foo = Symbol('foo'); - - /* - t.notEqual( - String(foo), - String(Symbol('bar')), - 'two symbols with different descriptions do not stringify the same' - ); - */ - - t.equal(typeof Symbol.prototype.toString, 'function', 'Symbol#toString is a function'); - // t.equal(String(foo), Symbol.prototype.toString.call(foo), 'Symbol#toString equals String of the same symbol'); - - t.equal(typeof Object.getOwnPropertySymbols, 'function', 'Object.getOwnPropertySymbols is a function'); - - var obj = {}; - var sym = Symbol('test'); - var symObj = Object(sym); - t.notEqual(typeof sym, 'string', 'Symbol is not a string'); - t.equal(Object.prototype.toString.call(sym), '[object Symbol]', 'symbol primitive Object#toStrings properly'); - t.equal(Object.prototype.toString.call(symObj), '[object Symbol]', 'symbol primitive Object#toStrings properly'); - - var symVal = 42; - obj[sym] = symVal; - for (sym in obj) { t.fail('symbol property key was found in for..in of object'); } - - t.deepEqual(Object.keys(obj), [], 'no enumerable own keys on symbol-valued object'); - t.deepEqual(Object.getOwnPropertyNames(obj), [], 'no own names on symbol-valued object'); - t.deepEqual(Object.getOwnPropertySymbols(obj), [sym], 'one own symbol on symbol-valued object'); - t.equal(Object.prototype.propertyIsEnumerable.call(obj, sym), true, 'symbol is enumerable'); - t.deepEqual(Object.getOwnPropertyDescriptor(obj, sym), { - configurable: true, - enumerable: true, - value: 42, - writable: true - }, 'property descriptor is correct'); -}; diff --git a/deps/npm/node_modules/has-unicode/package.json b/deps/npm/node_modules/has-unicode/package.json index b57ffd53d096b5..ebe9d76d621587 100644 --- a/deps/npm/node_modules/has-unicode/package.json +++ b/deps/npm/node_modules/has-unicode/package.json @@ -1,62 +1,30 @@ { - "_args": [ - [ - "has-unicode@2.0.1", - "/Users/rebecca/code/npm" - ] - ], - "_from": "has-unicode@2.0.1", - "_id": "has-unicode@2.0.1", - "_inBundle": false, - "_integrity": "sha1-4Ob+aijPUROIVeCG0Wkedx3iqLk=", - "_location": "/has-unicode", - "_phantomChildren": {}, - "_requested": { - "type": "version", - "registry": true, - "raw": "has-unicode@2.0.1", - "name": "has-unicode", - "escapedName": "has-unicode", - "rawSpec": "2.0.1", - "saveSpec": null, - "fetchSpec": "2.0.1" - }, - "_requiredBy": [ - "/", - "/gauge" - ], - "_resolved": "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz", - "_spec": "2.0.1", - "_where": "/Users/rebecca/code/npm", - "author": { - "name": "Rebecca Turner", - "email": "me@re-becca.org" - }, - "bugs": { - "url": "https://github.com/iarna/has-unicode/issues" - }, + "name": "has-unicode", + "version": "2.0.1", "description": "Try to guess if your terminal supports unicode", - "devDependencies": { - "require-inject": "^1.3.0", - "tap": "^2.3.1" + "main": "index.js", + "scripts": { + "test": "tap test/*.js" + }, + "repository": { + "type": "git", + "url": "https://github.com/iarna/has-unicode" }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/iarna/has-unicode", "keywords": [ "unicode", "terminal" ], + "files": [ + "index.js" + ], + "author": "Rebecca Turner ", "license": "ISC", - "main": "index.js", - "name": "has-unicode", - "repository": { - "type": "git", - "url": "git+https://github.com/iarna/has-unicode.git" - }, - "scripts": { - "test": "tap test/*.js" + "bugs": { + "url": "https://github.com/iarna/has-unicode/issues" }, - "version": "2.0.1" + "homepage": "https://github.com/iarna/has-unicode", + "devDependencies": { + "require-inject": "^1.3.0", + "tap": "^2.3.1" + } } diff --git a/deps/npm/node_modules/has/LICENSE-MIT b/deps/npm/node_modules/has/LICENSE-MIT deleted file mode 100644 index ae7014d385df3d..00000000000000 --- a/deps/npm/node_modules/has/LICENSE-MIT +++ /dev/null @@ -1,22 +0,0 @@ -Copyright (c) 2013 Thiago de Arruda - -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/has/README.md b/deps/npm/node_modules/has/README.md deleted file mode 100644 index 635e3a4baab00b..00000000000000 --- a/deps/npm/node_modules/has/README.md +++ /dev/null @@ -1,18 +0,0 @@ -# has - -> Object.prototype.hasOwnProperty.call shortcut - -## Installation - -```sh -npm install --save has -``` - -## Usage - -```js -var has = require('has'); - -has({}, 'hasOwnProperty'); // false -has(Object.prototype, 'hasOwnProperty'); // true -``` diff --git a/deps/npm/node_modules/has/package.json b/deps/npm/node_modules/has/package.json deleted file mode 100644 index 86203ce1659660..00000000000000 --- a/deps/npm/node_modules/has/package.json +++ /dev/null @@ -1,52 +0,0 @@ -{ - "name": "has", - "description": "Object.prototype.hasOwnProperty.call shortcut", - "version": "1.0.3", - "homepage": "https://github.com/tarruda/has", - "author": { - "name": "Thiago de Arruda", - "email": "tpadilha84@gmail.com" - }, - "contributors": [ - { - "name": "Jordan Harband", - "email": "ljharb@gmail.com", - "url": "http://ljharb.codes" - } - ], - "repository": { - "type": "git", - "url": "git://github.com/tarruda/has.git" - }, - "bugs": { - "url": "https://github.com/tarruda/has/issues" - }, - "license": "MIT", - "licenses": [ - { - "type": "MIT", - "url": "https://github.com/tarruda/has/blob/master/LICENSE-MIT" - } - ], - "main": "./src", - "dependencies": { - "function-bind": "^1.1.1" - }, - "devDependencies": { - "@ljharb/eslint-config": "^12.2.1", - "eslint": "^4.19.1", - "tape": "^4.9.0" - }, - "engines": { - "node": ">= 0.4.0" - }, - "scripts": { - "lint": "eslint .", - "pretest": "npm run lint", - "test": "tape test" - } - -,"_resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz" -,"_integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==" -,"_from": "has@1.0.3" -} \ No newline at end of file diff --git a/deps/npm/node_modules/has/src/index.js b/deps/npm/node_modules/has/src/index.js deleted file mode 100644 index dd92dd9094edb0..00000000000000 --- a/deps/npm/node_modules/has/src/index.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; - -var bind = require('function-bind'); - -module.exports = bind.call(Function.call, Object.prototype.hasOwnProperty); diff --git a/deps/npm/node_modules/has/test/index.js b/deps/npm/node_modules/has/test/index.js deleted file mode 100644 index 43d480b2c2e763..00000000000000 --- a/deps/npm/node_modules/has/test/index.js +++ /dev/null @@ -1,10 +0,0 @@ -'use strict'; - -var test = require('tape'); -var has = require('../'); - -test('has', function (t) { - t.equal(has({}, 'hasOwnProperty'), false, 'object literal does not have own property "hasOwnProperty"'); - t.equal(has(Object.prototype, 'hasOwnProperty'), true, 'Object.prototype has own property "hasOwnProperty"'); - t.end(); -}); diff --git a/deps/npm/node_modules/hosted-git-info/CHANGELOG.md b/deps/npm/node_modules/hosted-git-info/CHANGELOG.md index 4f86601e029e95..afdd90e138593b 100644 --- a/deps/npm/node_modules/hosted-git-info/CHANGELOG.md +++ b/deps/npm/node_modules/hosted-git-info/CHANGELOG.md @@ -2,45 +2,59 @@ 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. - -## [2.8.8](https://github.com/npm/hosted-git-info/compare/v2.8.7...v2.8.8) (2020-02-29) + +## [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 -* [#61](https://github.com/npm/hosted-git-info/issues/61) & [#65](https://github.com/npm/hosted-git-info/issues/65) addressing issues w/ url.URL implmentation which regressed node 6 support ([5038b18](https://github.com/npm/hosted-git-info/commit/5038b18)), closes [#66](https://github.com/npm/hosted-git-info/issues/66) +* 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) - -## [2.8.7](https://github.com/npm/hosted-git-info/compare/v2.8.6...v2.8.7) (2020-02-26) + + +## [3.0.2](https://github.com/npm/hosted-git-info/compare/v3.0.1...v3.0.2) (2019-10-08) ### Bug Fixes -* Do not attempt to use url.URL when unavailable ([2d0bb66](https://github.com/npm/hosted-git-info/commit/2d0bb66)), closes [#61](https://github.com/npm/hosted-git-info/issues/61) [#62](https://github.com/npm/hosted-git-info/issues/62) -* Do not pass scp-style URLs to the WhatWG url.URL ([f2cdfcf](https://github.com/npm/hosted-git-info/commit/f2cdfcf)), closes [#60](https://github.com/npm/hosted-git-info/issues/60) +* 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) - -## [2.8.6](https://github.com/npm/hosted-git-info/compare/v2.8.5...v2.8.6) (2020-02-25) +### 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)) - -## [2.8.5](https://github.com/npm/hosted-git-info/compare/v2.8.4...v2.8.5) (2019-10-07) + +# [3.0.0](https://github.com/npm/hosted-git-info/compare/v2.8.3...v3.0.0) (2019-08-12) ### Bug Fixes -* updated pathmatch for gitlab ([e8325b5](https://github.com/npm/hosted-git-info/commit/e8325b5)), closes [#51](https://github.com/npm/hosted-git-info/issues/51) -* updated pathmatch for gitlab ([ffe056f](https://github.com/npm/hosted-git-info/commit/ffe056f)) +* **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 - -## [2.8.4](https://github.com/npm/hosted-git-info/compare/v2.8.3...v2.8.4) (2019-08-12) +* **cache:** Drop support for node 0.x 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 9616fbaa6b4af0..f9b1ec74563208 100644 --- a/deps/npm/node_modules/hosted-git-info/git-host.js +++ b/deps/npm/node_modules/hosted-git-info/git-host.js @@ -9,8 +9,8 @@ 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 - var keys = Object.keys(source) - var i = keys.length + const keys = Object.keys(source) + let i = keys.length while (i--) { target[keys[i]] = source[keys[i]] } @@ -56,7 +56,7 @@ GitHost.prototype._fill = function (template, opts) { vars[key] = value.split('/').map(function (pathComponent) { return encodeURIComponent(pathComponent) }).join('/') - } else { + } else if (key !== 'domain') { vars[key] = encodeURIComponent(value) } }) diff --git a/deps/npm/node_modules/hosted-git-info/index.js b/deps/npm/node_modules/hosted-git-info/index.js index 21e53fe3724be1..0b08be1553cae1 100644 --- a/deps/npm/node_modules/hosted-git-info/index.js +++ b/deps/npm/node_modules/hosted-git-info/index.js @@ -2,6 +2,8 @@ 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}) var protocolToRepresentationMap = { 'git+ssh:': 'sshurl', @@ -22,17 +24,15 @@ var authProtocols = { 'git+http:': true } -var cache = {} - module.exports.fromUrl = function (giturl, opts) { if (typeof giturl !== 'string') return var key = giturl + JSON.stringify(opts || {}) - if (!(key in cache)) { - cache[key] = fromUrl(giturl, opts) + if (!cache.has(key)) { + cache.set(key, fromUrl(giturl, opts)) } - return cache[key] + return cache.get(key) } function fromUrl (giturl, opts) { @@ -108,9 +108,7 @@ function parseGitUrl (giturl) { var matched = giturl.match(/^([^@]+)@([^:/]+):[/]?((?:[^/]+[/])?[^/]+?)(?:[.]git)?(#.*)?$/) if (!matched) { var legacy = url.parse(giturl) - // If we don't have url.URL, then sorry, this is just not fixable. - // This affects Node <= 6.12. - if (legacy.auth && typeof url.URL === 'function') { + 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 @@ -120,7 +118,7 @@ function parseGitUrl (giturl) { // 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. - var authmatch = giturl.match(/[^@]+@[^:/]+/) + const authmatch = giturl.match(/[^@]+@[^:/]+/) /* istanbul ignore else - this should be impossible */ if (authmatch) { var whatwg = new url.URL(authmatch[0]) diff --git a/deps/npm/node_modules/hosted-git-info/package.json b/deps/npm/node_modules/hosted-git-info/package.json index 8d9c2b2046c742..407ffe0f9bc1ea 100644 --- a/deps/npm/node_modules/hosted-git-info/package.json +++ b/deps/npm/node_modules/hosted-git-info/package.json @@ -1,41 +1,35 @@ { - "_from": "hosted-git-info@2.8.8", - "_id": "hosted-git-info@2.8.8", - "_inBundle": false, - "_integrity": "sha512-f/wzC2QaWBs7t9IYqB4T3sR1xviIViXJRJTWBlx2Gf3g0Xi5vI7Yy4koXQ1c9OYDGHN9sBy1DQ2AB8fqZBWhUg==", - "_location": "/hosted-git-info", - "_phantomChildren": {}, - "_requested": { - "type": "version", - "registry": true, - "raw": "hosted-git-info@2.8.8", - "name": "hosted-git-info", - "escapedName": "hosted-git-info", - "rawSpec": "2.8.8", - "saveSpec": null, - "fetchSpec": "2.8.8" + "name": "hosted-git-info", + "version": "3.0.5", + "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" }, - "_requiredBy": [ - "#USER", - "/", - "/normalize-package-data", - "/npm-package-arg" + "keywords": [ + "git", + "github", + "bitbucket", + "gitlab" ], - "_resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.8.tgz", - "_shasum": "7539bd4bc1e0e0a895815a2e0262420b12858488", - "_spec": "hosted-git-info@2.8.8", - "_where": "/Users/darcyclarke/Documents/Repos/npm/cli", - "author": { - "name": "Rebecca Turner", - "email": "me@re-becca.org", - "url": "http://re-becca.org" - }, + "author": "Rebecca Turner (http://re-becca.org)", + "license": "ISC", "bugs": { "url": "https://github.com/npm/hosted-git-info/issues" }, - "bundleDependencies": false, - "deprecated": false, - "description": "Provides metadata and conversions from repository urls for Github, Bitbucket and Gitlab", + "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" + }, + "dependencies": { + "lru-cache": "^6.0.0" + }, "devDependencies": { "standard": "^11.0.1", "standard-version": "^4.4.0", @@ -46,27 +40,7 @@ "git-host.js", "git-host-info.js" ], - "homepage": "https://github.com/npm/hosted-git-info", - "keywords": [ - "git", - "github", - "bitbucket", - "gitlab" - ], - "license": "ISC", - "main": "index.js", - "name": "hosted-git-info", - "repository": { - "type": "git", - "url": "git+https://github.com/npm/hosted-git-info.git" - }, - "scripts": { - "postrelease": "npm publish --tag=ancient-legacy-fixes && git push --follow-tags", - "posttest": "standard", - "prerelease": "npm t", - "release": "standard-version -s", - "test": "tap -J --coverage=90 --no-esm test/*.js", - "test:coverage": "tap --coverage-report=html -J --coverage=90 --no-esm test/*.js" - }, - "version": "2.8.8" + "engines": { + "node": ">=10" + } } diff --git a/deps/npm/node_modules/http-cache-semantics/LICENSE b/deps/npm/node_modules/http-cache-semantics/LICENSE new file mode 100644 index 00000000000000..493d2ea29f0882 --- /dev/null +++ b/deps/npm/node_modules/http-cache-semantics/LICENSE @@ -0,0 +1,9 @@ +Copyright 2016-2018 Kornel Lesiński + +Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/deps/npm/node_modules/http-cache-semantics/README.md b/deps/npm/node_modules/http-cache-semantics/README.md index 99069fc8d7c071..685aa55dd3a4b1 100644 --- a/deps/npm/node_modules/http-cache-semantics/README.md +++ b/deps/npm/node_modules/http-cache-semantics/README.md @@ -1,6 +1,8 @@ -# Can I cache this? [![Build Status](https://travis-ci.org/pornel/http-cache-semantics.svg?branch=master)](https://travis-ci.org/pornel/http-cache-semantics) +# Can I cache this? [![Build Status](https://travis-ci.org/kornelski/http-cache-semantics.svg?branch=master)](https://travis-ci.org/kornelski/http-cache-semantics) -`CachePolicy` tells when responses can be reused from a cache, taking into account [HTTP RFC 7234](http://httpwg.org/specs/rfc7234.html) rules for user agents and shared caches. It's aware of many tricky details such as the `Vary` header, proxy revalidation, and authenticated responses. +`CachePolicy` tells when responses can be reused from a cache, taking into account [HTTP RFC 7234](http://httpwg.org/specs/rfc7234.html) rules for user agents and shared caches. +It also implements [RFC 5861](https://tools.ietf.org/html/rfc5861), implementing `stale-if-error` and `stale-while-revalidate`. +It's aware of many tricky details such as the `Vary` header, proxy revalidation, and authenticated responses. ## Usage @@ -16,12 +18,16 @@ if (!policy.storable()) { // Cache the data AND the policy object in your cache // (this is pseudocode, roll your own cache (lru-cache package works)) -letsPretendThisIsSomeCache.set(request.url, {policy, response}, policy.timeToLive()); +letsPretendThisIsSomeCache.set( + request.url, + { policy, response }, + policy.timeToLive() +); ``` ```js // And later, when you receive a new request: -const {policy, response} = letsPretendThisIsSomeCache.get(newRequest.url); +const { policy, response } = letsPretendThisIsSomeCache.get(newRequest.url); // It's not enough that it exists in the cache, it has to match the new request, too: if (policy && policy.satisfiesWithoutRevalidation(newRequest)) { @@ -59,14 +65,14 @@ const response = { const options = { shared: true, cacheHeuristic: 0.1, - immutableMinTimeToLive: 24*3600*1000, // 24h + immutableMinTimeToLive: 24 * 3600 * 1000, // 24h ignoreCargoCult: false, }; ``` -If `options.shared` is `true` (default), then the response is evaluated from a perspective of a shared cache (i.e. `private` is not cacheable and `s-maxage` is respected). If `options.shared` is `false`, then the response is evaluated from a perspective of a single-user cache (i.e. `private` is cacheable and `s-maxage` is ignored). +If `options.shared` is `true` (default), then the response is evaluated from a perspective of a shared cache (i.e. `private` is not cacheable and `s-maxage` is respected). If `options.shared` is `false`, then the response is evaluated from a perspective of a single-user cache (i.e. `private` is cacheable and `s-maxage` is ignored). `shared: true` is recommended for HTTP clients. -`options.cacheHeuristic` is a fraction of response's age that is used as a fallback cache duration. The default is 0.1 (10%), e.g. if a file hasn't been modified for 100 days, it'll be cached for 100*0.1 = 10 days. +`options.cacheHeuristic` is a fraction of response's age that is used as a fallback cache duration. The default is 0.1 (10%), e.g. if a file hasn't been modified for 100 days, it'll be cached for 100\*0.1 = 10 days. `options.immutableMinTimeToLive` is a number of milliseconds to assume as the default time to cache responses with `Cache-Control: immutable`. Note that [per RFC](http://httpwg.org/http-extensions/immutable.html) these can become stale, so `max-age` still overrides the default. @@ -94,9 +100,10 @@ cachedResponse.headers = cachePolicy.responseHeaders(cachedResponse); ### `timeToLive()` -Returns approximate time in *milliseconds* until the response becomes stale (i.e. not fresh). +Returns approximate time in _milliseconds_ until the response becomes stale (i.e. not fresh). After that time (when `timeToLive() <= 0`) the response might not be usable without revalidation. However, there are exceptions, e.g. a client can explicitly allow stale responses, so always check with `satisfiesWithoutRevalidation()`. +`stale-if-error` and `stale-while-revalidate` extend the time to live of the cache, that can still be used if stale. ### `toObject()`/`fromObject(json)` @@ -122,28 +129,37 @@ updateRequest.headers = cachePolicy.revalidationHeaders(updateRequest); Use this method to update the cache after receiving a new response from the origin server. It returns an object with two keys: -* `policy` — A new `CachePolicy` with HTTP headers updated from `revalidationResponse`. You can always replace the old cached `CachePolicy` with the new one. -* `modified` — Boolean indicating whether the response body has changed. - * If `false`, then a valid 304 Not Modified response has been received, and you can reuse the old cached response body. - * If `true`, you should use new response's body (if present), or make another request to the origin server without any conditional headers (i.e. don't use `revalidationHeaders()` this time) to get the new resource. +- `policy` — A new `CachePolicy` with HTTP headers updated from `revalidationResponse`. You can always replace the old cached `CachePolicy` with the new one. +- `modified` — Boolean indicating whether the response body has changed. + - If `false`, then a valid 304 Not Modified response has been received, and you can reuse the old cached response body. This is also affected by `stale-if-error`. + - If `true`, you should use new response's body (if present), or make another request to the origin server without any conditional headers (i.e. don't use `revalidationHeaders()` this time) to get the new resource. ```js // When serving requests from cache: -const {oldPolicy, oldResponse} = letsPretendThisIsSomeCache.get(newRequest.url); +const { oldPolicy, oldResponse } = letsPretendThisIsSomeCache.get( + newRequest.url +); if (!oldPolicy.satisfiesWithoutRevalidation(newRequest)) { // Change the request to ask the origin server if the cached response can be used newRequest.headers = oldPolicy.revalidationHeaders(newRequest); // Send request to the origin server. The server may respond with status 304 - const newResponse = await makeRequest(newResponse); + const newResponse = await makeRequest(newRequest); // Create updated policy and combined response from the old and new data - const {policy, modified} = oldPolicy.revalidatedPolicy(newRequest, newResponse); + const { policy, modified } = oldPolicy.revalidatedPolicy( + newRequest, + newResponse + ); const response = modified ? newResponse : oldResponse; // Update the cache with the newer/fresher response - letsPretendThisIsSomeCache.set(newRequest.url, {policy, response}, policy.timeToLive()); + letsPretendThisIsSomeCache.set( + newRequest.url, + { policy, response }, + policy.timeToLive() + ); // And proceed returning cached response as usual response.headers = policy.responseHeaders(); @@ -157,21 +173,31 @@ if (!oldPolicy.satisfiesWithoutRevalidation(newRequest)) { ## Used by -* [ImageOptim API](https://imageoptim.com/api), [make-fetch-happen](https://github.com/zkat/make-fetch-happen), [cacheable-request](https://www.npmjs.com/package/cacheable-request), [npm/registry-fetch](https://github.com/npm/registry-fetch), [etc.](https://github.com/pornel/http-cache-semantics/network/dependents) +- [ImageOptim API](https://imageoptim.com/api), [make-fetch-happen](https://github.com/zkat/make-fetch-happen), [cacheable-request](https://www.npmjs.com/package/cacheable-request) ([got](https://www.npmjs.com/package/got)), [npm/registry-fetch](https://github.com/npm/registry-fetch), [etc.](https://github.com/kornelski/http-cache-semantics/network/dependents) ## Implemented -* `Cache-Control` response header with all the quirks. -* `Expires` with check for bad clocks. -* `Pragma` response header. -* `Age` response header. -* `Vary` response header. -* Default cacheability of statuses and methods. -* Requests for stale data. -* Filtering of hop-by-hop headers. -* Basic revalidation request +- `Cache-Control` response header with all the quirks. +- `Expires` with check for bad clocks. +- `Pragma` response header. +- `Age` response header. +- `Vary` response header. +- Default cacheability of statuses and methods. +- Requests for stale data. +- Filtering of hop-by-hop headers. +- Basic revalidation request +- `stale-if-error` ## Unimplemented -* Merging of range requests, If-Range (but correctly supports them as non-cacheable) -* Revalidation of multiple representations +- Merging of range requests, `If-Range` (but correctly supports them as non-cacheable) +- Revalidation of multiple representations + +### Trusting server `Date` + +Per the RFC, the cache should take into account the time between server-supplied `Date` and the time it received the response. The RFC-mandated behavior creates two problems: + + * Servers with incorrectly set timezone may add several hours to cache age (or more, if the clock is completely wrong). + * Even reasonably correct clocks may be off by a couple of seconds, breaking `max-age=1` trick (which is useful for reverse proxies on high-traffic servers). + +Previous versions of this library had an option to ignore the server date if it was "too inaccurate". To support the `max-age=1` trick the library also has to ignore dates that pretty accurate. There's no point of having an option to trust dates that are only a bit inaccurate, so this library won't trust any server dates. `max-age` will be interpreted from the time the response has been received, not from when it has been sent. This will affect only [RFC 1149 networks](https://tools.ietf.org/html/rfc1149). diff --git a/deps/npm/node_modules/http-cache-semantics/index.js b/deps/npm/node_modules/http-cache-semantics/index.js new file mode 100644 index 00000000000000..8b7da2412bef46 --- /dev/null +++ b/deps/npm/node_modules/http-cache-semantics/index.js @@ -0,0 +1,673 @@ +'use strict'; +// rfc7231 6.1 +const statusCodeCacheableByDefault = new Set([ + 200, + 203, + 204, + 206, + 300, + 301, + 404, + 405, + 410, + 414, + 501, +]); + +// This implementation does not understand partial responses (206) +const understoodStatuses = new Set([ + 200, + 203, + 204, + 300, + 301, + 302, + 303, + 307, + 308, + 404, + 405, + 410, + 414, + 501, +]); + +const errorStatusCodes = new Set([ + 500, + 502, + 503, + 504, +]); + +const hopByHopHeaders = { + date: true, // included, because we add Age update Date + connection: true, + 'keep-alive': true, + 'proxy-authenticate': true, + 'proxy-authorization': true, + te: true, + trailer: true, + 'transfer-encoding': true, + upgrade: true, +}; + +const excludedFromRevalidationUpdate = { + // Since the old body is reused, it doesn't make sense to change properties of the body + 'content-length': true, + 'content-encoding': true, + 'transfer-encoding': true, + 'content-range': true, +}; + +function toNumberOrZero(s) { + const n = parseInt(s, 10); + return isFinite(n) ? n : 0; +} + +// RFC 5861 +function isErrorResponse(response) { + // consider undefined response as faulty + if(!response) { + return true + } + return errorStatusCodes.has(response.status); +} + +function parseCacheControl(header) { + const cc = {}; + if (!header) return cc; + + // TODO: When there is more than one value present for a given directive (e.g., two Expires header fields, multiple Cache-Control: max-age directives), + // the directive's value is considered invalid. Caches are encouraged to consider responses that have invalid freshness information to be stale + const parts = header.trim().split(/\s*,\s*/); // TODO: lame parsing + for (const part of parts) { + const [k, v] = part.split(/\s*=\s*/, 2); + cc[k] = v === undefined ? true : v.replace(/^"|"$/g, ''); // TODO: lame unquoting + } + + return cc; +} + +function formatCacheControl(cc) { + let parts = []; + for (const k in cc) { + const v = cc[k]; + parts.push(v === true ? k : k + '=' + v); + } + if (!parts.length) { + return undefined; + } + return parts.join(', '); +} + +module.exports = class CachePolicy { + constructor( + req, + res, + { + shared, + cacheHeuristic, + immutableMinTimeToLive, + ignoreCargoCult, + _fromObject, + } = {} + ) { + if (_fromObject) { + this._fromObject(_fromObject); + return; + } + + if (!res || !res.headers) { + throw Error('Response headers missing'); + } + this._assertRequestHasHeaders(req); + + this._responseTime = this.now(); + this._isShared = shared !== false; + this._cacheHeuristic = + undefined !== cacheHeuristic ? cacheHeuristic : 0.1; // 10% matches IE + this._immutableMinTtl = + undefined !== immutableMinTimeToLive + ? immutableMinTimeToLive + : 24 * 3600 * 1000; + + this._status = 'status' in res ? res.status : 200; + this._resHeaders = res.headers; + this._rescc = parseCacheControl(res.headers['cache-control']); + this._method = 'method' in req ? req.method : 'GET'; + this._url = req.url; + this._host = req.headers.host; + this._noAuthorization = !req.headers.authorization; + this._reqHeaders = res.headers.vary ? req.headers : null; // Don't keep all request headers if they won't be used + this._reqcc = parseCacheControl(req.headers['cache-control']); + + // Assume that if someone uses legacy, non-standard uncecessary options they don't understand caching, + // so there's no point stricly adhering to the blindly copy&pasted directives. + if ( + ignoreCargoCult && + 'pre-check' in this._rescc && + 'post-check' in this._rescc + ) { + delete this._rescc['pre-check']; + delete this._rescc['post-check']; + delete this._rescc['no-cache']; + delete this._rescc['no-store']; + delete this._rescc['must-revalidate']; + this._resHeaders = Object.assign({}, this._resHeaders, { + 'cache-control': formatCacheControl(this._rescc), + }); + delete this._resHeaders.expires; + delete this._resHeaders.pragma; + } + + // When the Cache-Control header field is not present in a request, caches MUST consider the no-cache request pragma-directive + // as having the same effect as if "Cache-Control: no-cache" were present (see Section 5.2.1). + if ( + res.headers['cache-control'] == null && + /no-cache/.test(res.headers.pragma) + ) { + this._rescc['no-cache'] = true; + } + } + + now() { + return Date.now(); + } + + storable() { + // The "no-store" request directive indicates that a cache MUST NOT store any part of either this request or any response to it. + return !!( + !this._reqcc['no-store'] && + // A cache MUST NOT store a response to any request, unless: + // The request method is understood by the cache and defined as being cacheable, and + ('GET' === this._method || + 'HEAD' === this._method || + ('POST' === this._method && this._hasExplicitExpiration())) && + // the response status code is understood by the cache, and + understoodStatuses.has(this._status) && + // the "no-store" cache directive does not appear in request or response header fields, and + !this._rescc['no-store'] && + // the "private" response directive does not appear in the response, if the cache is shared, and + (!this._isShared || !this._rescc.private) && + // the Authorization header field does not appear in the request, if the cache is shared, + (!this._isShared || + this._noAuthorization || + this._allowsStoringAuthenticated()) && + // the response either: + // contains an Expires header field, or + (this._resHeaders.expires || + // contains a max-age response directive, or + // contains a s-maxage response directive and the cache is shared, or + // contains a public response directive. + this._rescc['max-age'] || + (this._isShared && this._rescc['s-maxage']) || + this._rescc.public || + // has a status code that is defined as cacheable by default + statusCodeCacheableByDefault.has(this._status)) + ); + } + + _hasExplicitExpiration() { + // 4.2.1 Calculating Freshness Lifetime + return ( + (this._isShared && this._rescc['s-maxage']) || + this._rescc['max-age'] || + this._resHeaders.expires + ); + } + + _assertRequestHasHeaders(req) { + if (!req || !req.headers) { + throw Error('Request headers missing'); + } + } + + satisfiesWithoutRevalidation(req) { + this._assertRequestHasHeaders(req); + + // When presented with a request, a cache MUST NOT reuse a stored response, unless: + // the presented request does not contain the no-cache pragma (Section 5.4), nor the no-cache cache directive, + // unless the stored response is successfully validated (Section 4.3), and + const requestCC = parseCacheControl(req.headers['cache-control']); + if (requestCC['no-cache'] || /no-cache/.test(req.headers.pragma)) { + return false; + } + + if (requestCC['max-age'] && this.age() > requestCC['max-age']) { + return false; + } + + if ( + requestCC['min-fresh'] && + this.timeToLive() < 1000 * requestCC['min-fresh'] + ) { + return false; + } + + // the stored response is either: + // fresh, or allowed to be served stale + if (this.stale()) { + const allowsStale = + requestCC['max-stale'] && + !this._rescc['must-revalidate'] && + (true === requestCC['max-stale'] || + requestCC['max-stale'] > this.age() - this.maxAge()); + if (!allowsStale) { + return false; + } + } + + return this._requestMatches(req, false); + } + + _requestMatches(req, allowHeadMethod) { + // The presented effective request URI and that of the stored response match, and + return ( + (!this._url || this._url === req.url) && + this._host === req.headers.host && + // the request method associated with the stored response allows it to be used for the presented request, and + (!req.method || + this._method === req.method || + (allowHeadMethod && 'HEAD' === req.method)) && + // selecting header fields nominated by the stored response (if any) match those presented, and + this._varyMatches(req) + ); + } + + _allowsStoringAuthenticated() { + // following Cache-Control response directives (Section 5.2.2) have such an effect: must-revalidate, public, and s-maxage. + return ( + this._rescc['must-revalidate'] || + this._rescc.public || + this._rescc['s-maxage'] + ); + } + + _varyMatches(req) { + if (!this._resHeaders.vary) { + return true; + } + + // A Vary header field-value of "*" always fails to match + if (this._resHeaders.vary === '*') { + return false; + } + + const fields = this._resHeaders.vary + .trim() + .toLowerCase() + .split(/\s*,\s*/); + for (const name of fields) { + if (req.headers[name] !== this._reqHeaders[name]) return false; + } + return true; + } + + _copyWithoutHopByHopHeaders(inHeaders) { + const headers = {}; + for (const name in inHeaders) { + if (hopByHopHeaders[name]) continue; + headers[name] = inHeaders[name]; + } + // 9.1. Connection + if (inHeaders.connection) { + const tokens = inHeaders.connection.trim().split(/\s*,\s*/); + for (const name of tokens) { + delete headers[name]; + } + } + if (headers.warning) { + const warnings = headers.warning.split(/,/).filter(warning => { + return !/^\s*1[0-9][0-9]/.test(warning); + }); + if (!warnings.length) { + delete headers.warning; + } else { + headers.warning = warnings.join(',').trim(); + } + } + return headers; + } + + responseHeaders() { + const headers = this._copyWithoutHopByHopHeaders(this._resHeaders); + const age = this.age(); + + // A cache SHOULD generate 113 warning if it heuristically chose a freshness + // lifetime greater than 24 hours and the response's age is greater than 24 hours. + if ( + age > 3600 * 24 && + !this._hasExplicitExpiration() && + this.maxAge() > 3600 * 24 + ) { + headers.warning = + (headers.warning ? `${headers.warning}, ` : '') + + '113 - "rfc7234 5.5.4"'; + } + headers.age = `${Math.round(age)}`; + headers.date = new Date(this.now()).toUTCString(); + return headers; + } + + /** + * Value of the Date response header or current time if Date was invalid + * @return timestamp + */ + date() { + const serverDate = Date.parse(this._resHeaders.date); + if (isFinite(serverDate)) { + return serverDate; + } + return this._responseTime; + } + + /** + * Value of the Age header, in seconds, updated for the current time. + * May be fractional. + * + * @return Number + */ + age() { + let age = this._ageValue(); + + const residentTime = (this.now() - this._responseTime) / 1000; + return age + residentTime; + } + + _ageValue() { + return toNumberOrZero(this._resHeaders.age); + } + + /** + * Value of applicable max-age (or heuristic equivalent) in seconds. This counts since response's `Date`. + * + * For an up-to-date value, see `timeToLive()`. + * + * @return Number + */ + maxAge() { + if (!this.storable() || this._rescc['no-cache']) { + return 0; + } + + // Shared responses with cookies are cacheable according to the RFC, but IMHO it'd be unwise to do so by default + // so this implementation requires explicit opt-in via public header + if ( + this._isShared && + (this._resHeaders['set-cookie'] && + !this._rescc.public && + !this._rescc.immutable) + ) { + return 0; + } + + if (this._resHeaders.vary === '*') { + return 0; + } + + if (this._isShared) { + if (this._rescc['proxy-revalidate']) { + return 0; + } + // if a response includes the s-maxage directive, a shared cache recipient MUST ignore the Expires field. + if (this._rescc['s-maxage']) { + return toNumberOrZero(this._rescc['s-maxage']); + } + } + + // If a response includes a Cache-Control field with the max-age directive, a recipient MUST ignore the Expires field. + if (this._rescc['max-age']) { + return toNumberOrZero(this._rescc['max-age']); + } + + const defaultMinTtl = this._rescc.immutable ? this._immutableMinTtl : 0; + + const serverDate = this.date(); + if (this._resHeaders.expires) { + const expires = Date.parse(this._resHeaders.expires); + // A cache recipient MUST interpret invalid date formats, especially the value "0", as representing a time in the past (i.e., "already expired"). + if (Number.isNaN(expires) || expires < serverDate) { + return 0; + } + return Math.max(defaultMinTtl, (expires - serverDate) / 1000); + } + + if (this._resHeaders['last-modified']) { + const lastModified = Date.parse(this._resHeaders['last-modified']); + if (isFinite(lastModified) && serverDate > lastModified) { + return Math.max( + defaultMinTtl, + ((serverDate - lastModified) / 1000) * this._cacheHeuristic + ); + } + } + + return defaultMinTtl; + } + + timeToLive() { + const age = this.maxAge() - this.age(); + const staleIfErrorAge = age + toNumberOrZero(this._rescc['stale-if-error']); + const staleWhileRevalidateAge = age + toNumberOrZero(this._rescc['stale-while-revalidate']); + return Math.max(0, age, staleIfErrorAge, staleWhileRevalidateAge) * 1000; + } + + stale() { + return this.maxAge() <= this.age(); + } + + _useStaleIfError() { + return this.maxAge() + toNumberOrZero(this._rescc['stale-if-error']) > this.age(); + } + + useStaleWhileRevalidate() { + return this.maxAge() + toNumberOrZero(this._rescc['stale-while-revalidate']) > this.age(); + } + + static fromObject(obj) { + return new this(undefined, undefined, { _fromObject: obj }); + } + + _fromObject(obj) { + if (this._responseTime) throw Error('Reinitialized'); + if (!obj || obj.v !== 1) throw Error('Invalid serialization'); + + this._responseTime = obj.t; + this._isShared = obj.sh; + this._cacheHeuristic = obj.ch; + this._immutableMinTtl = + obj.imm !== undefined ? obj.imm : 24 * 3600 * 1000; + this._status = obj.st; + this._resHeaders = obj.resh; + this._rescc = obj.rescc; + this._method = obj.m; + this._url = obj.u; + this._host = obj.h; + this._noAuthorization = obj.a; + this._reqHeaders = obj.reqh; + this._reqcc = obj.reqcc; + } + + toObject() { + return { + v: 1, + t: this._responseTime, + sh: this._isShared, + ch: this._cacheHeuristic, + imm: this._immutableMinTtl, + st: this._status, + resh: this._resHeaders, + rescc: this._rescc, + m: this._method, + u: this._url, + h: this._host, + a: this._noAuthorization, + reqh: this._reqHeaders, + reqcc: this._reqcc, + }; + } + + /** + * Headers for sending to the origin server to revalidate stale response. + * Allows server to return 304 to allow reuse of the previous response. + * + * Hop by hop headers are always stripped. + * Revalidation headers may be added or removed, depending on request. + */ + revalidationHeaders(incomingReq) { + this._assertRequestHasHeaders(incomingReq); + const headers = this._copyWithoutHopByHopHeaders(incomingReq.headers); + + // This implementation does not understand range requests + delete headers['if-range']; + + if (!this._requestMatches(incomingReq, true) || !this.storable()) { + // revalidation allowed via HEAD + // not for the same resource, or wasn't allowed to be cached anyway + delete headers['if-none-match']; + delete headers['if-modified-since']; + return headers; + } + + /* MUST send that entity-tag in any cache validation request (using If-Match or If-None-Match) if an entity-tag has been provided by the origin server. */ + if (this._resHeaders.etag) { + headers['if-none-match'] = headers['if-none-match'] + ? `${headers['if-none-match']}, ${this._resHeaders.etag}` + : this._resHeaders.etag; + } + + // Clients MAY issue simple (non-subrange) GET requests with either weak validators or strong validators. Clients MUST NOT use weak validators in other forms of request. + const forbidsWeakValidators = + headers['accept-ranges'] || + headers['if-match'] || + headers['if-unmodified-since'] || + (this._method && this._method != 'GET'); + + /* SHOULD send the Last-Modified value in non-subrange cache validation requests (using If-Modified-Since) if only a Last-Modified value has been provided by the origin server. + Note: This implementation does not understand partial responses (206) */ + if (forbidsWeakValidators) { + delete headers['if-modified-since']; + + if (headers['if-none-match']) { + const etags = headers['if-none-match'] + .split(/,/) + .filter(etag => { + return !/^\s*W\//.test(etag); + }); + if (!etags.length) { + delete headers['if-none-match']; + } else { + headers['if-none-match'] = etags.join(',').trim(); + } + } + } else if ( + this._resHeaders['last-modified'] && + !headers['if-modified-since'] + ) { + headers['if-modified-since'] = this._resHeaders['last-modified']; + } + + return headers; + } + + /** + * Creates new CachePolicy with information combined from the previews response, + * and the new revalidation response. + * + * Returns {policy, modified} where modified is a boolean indicating + * whether the response body has been modified, and old cached body can't be used. + * + * @return {Object} {policy: CachePolicy, modified: Boolean} + */ + revalidatedPolicy(request, response) { + this._assertRequestHasHeaders(request); + if(this._useStaleIfError() && isErrorResponse(response)) { // I consider the revalidation request unsuccessful + return { + modified: false, + matches: false, + policy: this, + }; + } + if (!response || !response.headers) { + throw Error('Response headers missing'); + } + + // These aren't going to be supported exactly, since one CachePolicy object + // doesn't know about all the other cached objects. + let matches = false; + if (response.status !== undefined && response.status != 304) { + matches = false; + } else if ( + response.headers.etag && + !/^\s*W\//.test(response.headers.etag) + ) { + // "All of the stored responses with the same strong validator are selected. + // If none of the stored responses contain the same strong validator, + // then the cache MUST NOT use the new response to update any stored responses." + matches = + this._resHeaders.etag && + this._resHeaders.etag.replace(/^\s*W\//, '') === + response.headers.etag; + } else if (this._resHeaders.etag && response.headers.etag) { + // "If the new response contains a weak validator and that validator corresponds + // to one of the cache's stored responses, + // then the most recent of those matching stored responses is selected for update." + matches = + this._resHeaders.etag.replace(/^\s*W\//, '') === + response.headers.etag.replace(/^\s*W\//, ''); + } else if (this._resHeaders['last-modified']) { + matches = + this._resHeaders['last-modified'] === + response.headers['last-modified']; + } else { + // If the new response does not include any form of validator (such as in the case where + // a client generates an If-Modified-Since request from a source other than the Last-Modified + // response header field), and there is only one stored response, and that stored response also + // lacks a validator, then that stored response is selected for update. + if ( + !this._resHeaders.etag && + !this._resHeaders['last-modified'] && + !response.headers.etag && + !response.headers['last-modified'] + ) { + matches = true; + } + } + + if (!matches) { + return { + policy: new this.constructor(request, response), + // Client receiving 304 without body, even if it's invalid/mismatched has no option + // but to reuse a cached body. We don't have a good way to tell clients to do + // error recovery in such case. + modified: response.status != 304, + matches: false, + }; + } + + // use other header fields provided in the 304 (Not Modified) response to replace all instances + // of the corresponding header fields in the stored response. + const headers = {}; + for (const k in this._resHeaders) { + headers[k] = + k in response.headers && !excludedFromRevalidationUpdate[k] + ? response.headers[k] + : this._resHeaders[k]; + } + + const newResponse = Object.assign({}, response, { + status: this._status, + method: this._method, + headers, + }); + return { + policy: new this.constructor(request, newResponse, { + shared: this._isShared, + cacheHeuristic: this._cacheHeuristic, + immutableMinTimeToLive: this._immutableMinTtl, + }), + modified: false, + matches: true, + }; + } +}; diff --git a/deps/npm/node_modules/http-cache-semantics/node4/index.js b/deps/npm/node_modules/http-cache-semantics/node4/index.js deleted file mode 100644 index bcdaebe80f3e3a..00000000000000 --- a/deps/npm/node_modules/http-cache-semantics/node4/index.js +++ /dev/null @@ -1,559 +0,0 @@ -'use strict'; -// rfc7231 6.1 - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -var statusCodeCacheableByDefault = [200, 203, 204, 206, 300, 301, 404, 405, 410, 414, 501]; - -// This implementation does not understand partial responses (206) -var understoodStatuses = [200, 203, 204, 300, 301, 302, 303, 307, 308, 404, 405, 410, 414, 501]; - -var hopByHopHeaders = { 'connection': true, 'keep-alive': true, 'proxy-authenticate': true, 'proxy-authorization': true, 'te': true, 'trailer': true, 'transfer-encoding': true, 'upgrade': true }; -var excludedFromRevalidationUpdate = { - // Since the old body is reused, it doesn't make sense to change properties of the body - 'content-length': true, 'content-encoding': true, 'transfer-encoding': true, - 'content-range': true -}; - -function parseCacheControl(header) { - var cc = {}; - if (!header) return cc; - - // TODO: When there is more than one value present for a given directive (e.g., two Expires header fields, multiple Cache-Control: max-age directives), - // the directive's value is considered invalid. Caches are encouraged to consider responses that have invalid freshness information to be stale - var parts = header.trim().split(/\s*,\s*/); // TODO: lame parsing - for (var _iterator = parts, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) { - var _ref; - - if (_isArray) { - if (_i >= _iterator.length) break; - _ref = _iterator[_i++]; - } else { - _i = _iterator.next(); - if (_i.done) break; - _ref = _i.value; - } - - var part = _ref; - - var _part$split = part.split(/\s*=\s*/, 2), - k = _part$split[0], - v = _part$split[1]; - - cc[k] = v === undefined ? true : v.replace(/^"|"$/g, ''); // TODO: lame unquoting - } - - return cc; -} - -function formatCacheControl(cc) { - var parts = []; - for (var k in cc) { - var v = cc[k]; - parts.push(v === true ? k : k + '=' + v); - } - if (!parts.length) { - return undefined; - } - return parts.join(', '); -} - -module.exports = function () { - function CachePolicy(req, res) { - var _ref2 = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}, - shared = _ref2.shared, - cacheHeuristic = _ref2.cacheHeuristic, - immutableMinTimeToLive = _ref2.immutableMinTimeToLive, - ignoreCargoCult = _ref2.ignoreCargoCult, - _fromObject = _ref2._fromObject; - - _classCallCheck(this, CachePolicy); - - if (_fromObject) { - this._fromObject(_fromObject); - return; - } - - if (!res || !res.headers) { - throw Error("Response headers missing"); - } - this._assertRequestHasHeaders(req); - - this._responseTime = this.now(); - this._isShared = shared !== false; - this._cacheHeuristic = undefined !== cacheHeuristic ? cacheHeuristic : 0.1; // 10% matches IE - this._immutableMinTtl = undefined !== immutableMinTimeToLive ? immutableMinTimeToLive : 24 * 3600 * 1000; - - this._status = 'status' in res ? res.status : 200; - this._resHeaders = res.headers; - this._rescc = parseCacheControl(res.headers['cache-control']); - this._method = 'method' in req ? req.method : 'GET'; - this._url = req.url; - this._host = req.headers.host; - this._noAuthorization = !req.headers.authorization; - this._reqHeaders = res.headers.vary ? req.headers : null; // Don't keep all request headers if they won't be used - this._reqcc = parseCacheControl(req.headers['cache-control']); - - // Assume that if someone uses legacy, non-standard uncecessary options they don't understand caching, - // so there's no point stricly adhering to the blindly copy&pasted directives. - if (ignoreCargoCult && "pre-check" in this._rescc && "post-check" in this._rescc) { - delete this._rescc['pre-check']; - delete this._rescc['post-check']; - delete this._rescc['no-cache']; - delete this._rescc['no-store']; - delete this._rescc['must-revalidate']; - this._resHeaders = Object.assign({}, this._resHeaders, { 'cache-control': formatCacheControl(this._rescc) }); - delete this._resHeaders.expires; - delete this._resHeaders.pragma; - } - - // When the Cache-Control header field is not present in a request, caches MUST consider the no-cache request pragma-directive - // as having the same effect as if "Cache-Control: no-cache" were present (see Section 5.2.1). - if (!res.headers['cache-control'] && /no-cache/.test(res.headers.pragma)) { - this._rescc['no-cache'] = true; - } - } - - CachePolicy.prototype.now = function now() { - return Date.now(); - }; - - CachePolicy.prototype.storable = function storable() { - // The "no-store" request directive indicates that a cache MUST NOT store any part of either this request or any response to it. - return !!(!this._reqcc['no-store'] && ( - // A cache MUST NOT store a response to any request, unless: - // The request method is understood by the cache and defined as being cacheable, and - 'GET' === this._method || 'HEAD' === this._method || 'POST' === this._method && this._hasExplicitExpiration()) && - // the response status code is understood by the cache, and - understoodStatuses.indexOf(this._status) !== -1 && - // the "no-store" cache directive does not appear in request or response header fields, and - !this._rescc['no-store'] && ( - // the "private" response directive does not appear in the response, if the cache is shared, and - !this._isShared || !this._rescc.private) && ( - // the Authorization header field does not appear in the request, if the cache is shared, - !this._isShared || this._noAuthorization || this._allowsStoringAuthenticated()) && ( - // the response either: - - // contains an Expires header field, or - this._resHeaders.expires || - // contains a max-age response directive, or - // contains a s-maxage response directive and the cache is shared, or - // contains a public response directive. - this._rescc.public || this._rescc['max-age'] || this._rescc['s-maxage'] || - // has a status code that is defined as cacheable by default - statusCodeCacheableByDefault.indexOf(this._status) !== -1)); - }; - - CachePolicy.prototype._hasExplicitExpiration = function _hasExplicitExpiration() { - // 4.2.1 Calculating Freshness Lifetime - return this._isShared && this._rescc['s-maxage'] || this._rescc['max-age'] || this._resHeaders.expires; - }; - - CachePolicy.prototype._assertRequestHasHeaders = function _assertRequestHasHeaders(req) { - if (!req || !req.headers) { - throw Error("Request headers missing"); - } - }; - - CachePolicy.prototype.satisfiesWithoutRevalidation = function satisfiesWithoutRevalidation(req) { - this._assertRequestHasHeaders(req); - - // When presented with a request, a cache MUST NOT reuse a stored response, unless: - // the presented request does not contain the no-cache pragma (Section 5.4), nor the no-cache cache directive, - // unless the stored response is successfully validated (Section 4.3), and - var requestCC = parseCacheControl(req.headers['cache-control']); - if (requestCC['no-cache'] || /no-cache/.test(req.headers.pragma)) { - return false; - } - - if (requestCC['max-age'] && this.age() > requestCC['max-age']) { - return false; - } - - if (requestCC['min-fresh'] && this.timeToLive() < 1000 * requestCC['min-fresh']) { - return false; - } - - // the stored response is either: - // fresh, or allowed to be served stale - if (this.stale()) { - var allowsStale = requestCC['max-stale'] && !this._rescc['must-revalidate'] && (true === requestCC['max-stale'] || requestCC['max-stale'] > this.age() - this.maxAge()); - if (!allowsStale) { - return false; - } - } - - return this._requestMatches(req, false); - }; - - CachePolicy.prototype._requestMatches = function _requestMatches(req, allowHeadMethod) { - // The presented effective request URI and that of the stored response match, and - return (!this._url || this._url === req.url) && this._host === req.headers.host && ( - // the request method associated with the stored response allows it to be used for the presented request, and - !req.method || this._method === req.method || allowHeadMethod && 'HEAD' === req.method) && - // selecting header fields nominated by the stored response (if any) match those presented, and - this._varyMatches(req); - }; - - CachePolicy.prototype._allowsStoringAuthenticated = function _allowsStoringAuthenticated() { - // following Cache-Control response directives (Section 5.2.2) have such an effect: must-revalidate, public, and s-maxage. - return this._rescc['must-revalidate'] || this._rescc.public || this._rescc['s-maxage']; - }; - - CachePolicy.prototype._varyMatches = function _varyMatches(req) { - if (!this._resHeaders.vary) { - return true; - } - - // A Vary header field-value of "*" always fails to match - if (this._resHeaders.vary === '*') { - return false; - } - - var fields = this._resHeaders.vary.trim().toLowerCase().split(/\s*,\s*/); - for (var _iterator2 = fields, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : _iterator2[Symbol.iterator]();;) { - var _ref3; - - if (_isArray2) { - if (_i2 >= _iterator2.length) break; - _ref3 = _iterator2[_i2++]; - } else { - _i2 = _iterator2.next(); - if (_i2.done) break; - _ref3 = _i2.value; - } - - var name = _ref3; - - if (req.headers[name] !== this._reqHeaders[name]) return false; - } - return true; - }; - - CachePolicy.prototype._copyWithoutHopByHopHeaders = function _copyWithoutHopByHopHeaders(inHeaders) { - var headers = {}; - for (var name in inHeaders) { - if (hopByHopHeaders[name]) continue; - headers[name] = inHeaders[name]; - } - // 9.1. Connection - if (inHeaders.connection) { - var tokens = inHeaders.connection.trim().split(/\s*,\s*/); - for (var _iterator3 = tokens, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : _iterator3[Symbol.iterator]();;) { - var _ref4; - - if (_isArray3) { - if (_i3 >= _iterator3.length) break; - _ref4 = _iterator3[_i3++]; - } else { - _i3 = _iterator3.next(); - if (_i3.done) break; - _ref4 = _i3.value; - } - - var _name = _ref4; - - delete headers[_name]; - } - } - if (headers.warning) { - var warnings = headers.warning.split(/,/).filter(function (warning) { - return !/^\s*1[0-9][0-9]/.test(warning); - }); - if (!warnings.length) { - delete headers.warning; - } else { - headers.warning = warnings.join(',').trim(); - } - } - return headers; - }; - - CachePolicy.prototype.responseHeaders = function responseHeaders() { - var headers = this._copyWithoutHopByHopHeaders(this._resHeaders); - var age = this.age(); - - // A cache SHOULD generate 113 warning if it heuristically chose a freshness - // lifetime greater than 24 hours and the response's age is greater than 24 hours. - if (age > 3600 * 24 && !this._hasExplicitExpiration() && this.maxAge() > 3600 * 24) { - headers.warning = (headers.warning ? `${headers.warning}, ` : '') + '113 - "rfc7234 5.5.4"'; - } - headers.age = `${Math.round(age)}`; - return headers; - }; - - /** - * Value of the Date response header or current time if Date was demed invalid - * @return timestamp - */ - - - CachePolicy.prototype.date = function date() { - var dateValue = Date.parse(this._resHeaders.date); - var maxClockDrift = 8 * 3600 * 1000; - if (Number.isNaN(dateValue) || dateValue < this._responseTime - maxClockDrift || dateValue > this._responseTime + maxClockDrift) { - return this._responseTime; - } - return dateValue; - }; - - /** - * Value of the Age header, in seconds, updated for the current time. - * May be fractional. - * - * @return Number - */ - - - CachePolicy.prototype.age = function age() { - var age = Math.max(0, (this._responseTime - this.date()) / 1000); - if (this._resHeaders.age) { - var ageValue = this._ageValue(); - if (ageValue > age) age = ageValue; - } - - var residentTime = (this.now() - this._responseTime) / 1000; - return age + residentTime; - }; - - CachePolicy.prototype._ageValue = function _ageValue() { - var ageValue = parseInt(this._resHeaders.age); - return isFinite(ageValue) ? ageValue : 0; - }; - - /** - * Value of applicable max-age (or heuristic equivalent) in seconds. This counts since response's `Date`. - * - * For an up-to-date value, see `timeToLive()`. - * - * @return Number - */ - - - CachePolicy.prototype.maxAge = function maxAge() { - if (!this.storable() || this._rescc['no-cache']) { - return 0; - } - - // Shared responses with cookies are cacheable according to the RFC, but IMHO it'd be unwise to do so by default - // so this implementation requires explicit opt-in via public header - if (this._isShared && this._resHeaders['set-cookie'] && !this._rescc.public && !this._rescc.immutable) { - return 0; - } - - if (this._resHeaders.vary === '*') { - return 0; - } - - if (this._isShared) { - if (this._rescc['proxy-revalidate']) { - return 0; - } - // if a response includes the s-maxage directive, a shared cache recipient MUST ignore the Expires field. - if (this._rescc['s-maxage']) { - return parseInt(this._rescc['s-maxage'], 10); - } - } - - // If a response includes a Cache-Control field with the max-age directive, a recipient MUST ignore the Expires field. - if (this._rescc['max-age']) { - return parseInt(this._rescc['max-age'], 10); - } - - var defaultMinTtl = this._rescc.immutable ? this._immutableMinTtl : 0; - - var dateValue = this.date(); - if (this._resHeaders.expires) { - var expires = Date.parse(this._resHeaders.expires); - // A cache recipient MUST interpret invalid date formats, especially the value "0", as representing a time in the past (i.e., "already expired"). - if (Number.isNaN(expires) || expires < dateValue) { - return 0; - } - return Math.max(defaultMinTtl, (expires - dateValue) / 1000); - } - - if (this._resHeaders['last-modified']) { - var lastModified = Date.parse(this._resHeaders['last-modified']); - if (isFinite(lastModified) && dateValue > lastModified) { - return Math.max(defaultMinTtl, (dateValue - lastModified) / 1000 * this._cacheHeuristic); - } - } - - return defaultMinTtl; - }; - - CachePolicy.prototype.timeToLive = function timeToLive() { - return Math.max(0, this.maxAge() - this.age()) * 1000; - }; - - CachePolicy.prototype.stale = function stale() { - return this.maxAge() <= this.age(); - }; - - CachePolicy.fromObject = function fromObject(obj) { - return new this(undefined, undefined, { _fromObject: obj }); - }; - - CachePolicy.prototype._fromObject = function _fromObject(obj) { - if (this._responseTime) throw Error("Reinitialized"); - if (!obj || obj.v !== 1) throw Error("Invalid serialization"); - - this._responseTime = obj.t; - this._isShared = obj.sh; - this._cacheHeuristic = obj.ch; - this._immutableMinTtl = obj.imm !== undefined ? obj.imm : 24 * 3600 * 1000; - this._status = obj.st; - this._resHeaders = obj.resh; - this._rescc = obj.rescc; - this._method = obj.m; - this._url = obj.u; - this._host = obj.h; - this._noAuthorization = obj.a; - this._reqHeaders = obj.reqh; - this._reqcc = obj.reqcc; - }; - - CachePolicy.prototype.toObject = function toObject() { - return { - v: 1, - t: this._responseTime, - sh: this._isShared, - ch: this._cacheHeuristic, - imm: this._immutableMinTtl, - st: this._status, - resh: this._resHeaders, - rescc: this._rescc, - m: this._method, - u: this._url, - h: this._host, - a: this._noAuthorization, - reqh: this._reqHeaders, - reqcc: this._reqcc - }; - }; - - /** - * Headers for sending to the origin server to revalidate stale response. - * Allows server to return 304 to allow reuse of the previous response. - * - * Hop by hop headers are always stripped. - * Revalidation headers may be added or removed, depending on request. - */ - - - CachePolicy.prototype.revalidationHeaders = function revalidationHeaders(incomingReq) { - this._assertRequestHasHeaders(incomingReq); - var headers = this._copyWithoutHopByHopHeaders(incomingReq.headers); - - // This implementation does not understand range requests - delete headers['if-range']; - - if (!this._requestMatches(incomingReq, true) || !this.storable()) { - // revalidation allowed via HEAD - // not for the same resource, or wasn't allowed to be cached anyway - delete headers['if-none-match']; - delete headers['if-modified-since']; - return headers; - } - - /* MUST send that entity-tag in any cache validation request (using If-Match or If-None-Match) if an entity-tag has been provided by the origin server. */ - if (this._resHeaders.etag) { - headers['if-none-match'] = headers['if-none-match'] ? `${headers['if-none-match']}, ${this._resHeaders.etag}` : this._resHeaders.etag; - } - - // Clients MAY issue simple (non-subrange) GET requests with either weak validators or strong validators. Clients MUST NOT use weak validators in other forms of request. - var forbidsWeakValidators = headers['accept-ranges'] || headers['if-match'] || headers['if-unmodified-since'] || this._method && this._method != 'GET'; - - /* SHOULD send the Last-Modified value in non-subrange cache validation requests (using If-Modified-Since) if only a Last-Modified value has been provided by the origin server. - Note: This implementation does not understand partial responses (206) */ - if (forbidsWeakValidators) { - delete headers['if-modified-since']; - - if (headers['if-none-match']) { - var etags = headers['if-none-match'].split(/,/).filter(function (etag) { - return !/^\s*W\//.test(etag); - }); - if (!etags.length) { - delete headers['if-none-match']; - } else { - headers['if-none-match'] = etags.join(',').trim(); - } - } - } else if (this._resHeaders['last-modified'] && !headers['if-modified-since']) { - headers['if-modified-since'] = this._resHeaders['last-modified']; - } - - return headers; - }; - - /** - * Creates new CachePolicy with information combined from the previews response, - * and the new revalidation response. - * - * Returns {policy, modified} where modified is a boolean indicating - * whether the response body has been modified, and old cached body can't be used. - * - * @return {Object} {policy: CachePolicy, modified: Boolean} - */ - - - CachePolicy.prototype.revalidatedPolicy = function revalidatedPolicy(request, response) { - this._assertRequestHasHeaders(request); - if (!response || !response.headers) { - throw Error("Response headers missing"); - } - - // These aren't going to be supported exactly, since one CachePolicy object - // doesn't know about all the other cached objects. - var matches = false; - if (response.status !== undefined && response.status != 304) { - matches = false; - } else if (response.headers.etag && !/^\s*W\//.test(response.headers.etag)) { - // "All of the stored responses with the same strong validator are selected. - // If none of the stored responses contain the same strong validator, - // then the cache MUST NOT use the new response to update any stored responses." - matches = this._resHeaders.etag && this._resHeaders.etag.replace(/^\s*W\//, '') === response.headers.etag; - } else if (this._resHeaders.etag && response.headers.etag) { - // "If the new response contains a weak validator and that validator corresponds - // to one of the cache's stored responses, - // then the most recent of those matching stored responses is selected for update." - matches = this._resHeaders.etag.replace(/^\s*W\//, '') === response.headers.etag.replace(/^\s*W\//, ''); - } else if (this._resHeaders['last-modified']) { - matches = this._resHeaders['last-modified'] === response.headers['last-modified']; - } else { - // If the new response does not include any form of validator (such as in the case where - // a client generates an If-Modified-Since request from a source other than the Last-Modified - // response header field), and there is only one stored response, and that stored response also - // lacks a validator, then that stored response is selected for update. - if (!this._resHeaders.etag && !this._resHeaders['last-modified'] && !response.headers.etag && !response.headers['last-modified']) { - matches = true; - } - } - - if (!matches) { - return { - policy: new this.constructor(request, response), - modified: true - }; - } - - // use other header fields provided in the 304 (Not Modified) response to replace all instances - // of the corresponding header fields in the stored response. - var headers = {}; - for (var k in this._resHeaders) { - headers[k] = k in response.headers && !excludedFromRevalidationUpdate[k] ? response.headers[k] : this._resHeaders[k]; - } - - var newResponse = Object.assign({}, response, { - status: this._status, - method: this._method, - headers - }); - return { - policy: new this.constructor(request, newResponse), - modified: false - }; - }; - - return CachePolicy; -}(); \ No newline at end of file diff --git a/deps/npm/node_modules/http-cache-semantics/package.json b/deps/npm/node_modules/http-cache-semantics/package.json index 000f357a835d5a..897798d8ccc79c 100644 --- a/deps/npm/node_modules/http-cache-semantics/package.json +++ b/deps/npm/node_modules/http-cache-semantics/package.json @@ -1,60 +1,24 @@ { - "_from": "http-cache-semantics@^3.8.1", - "_id": "http-cache-semantics@3.8.1", - "_inBundle": false, - "_integrity": "sha512-5ai2iksyV8ZXmnZhHH4rWPoxxistEexSi5936zIQ1bnNTW5VnA85B6P/VpXiRM017IgRvb2kKo1a//y+0wSp3w==", - "_location": "/http-cache-semantics", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "http-cache-semantics@^3.8.1", "name": "http-cache-semantics", - "escapedName": "http-cache-semantics", - "rawSpec": "^3.8.1", - "saveSpec": null, - "fetchSpec": "^3.8.1" - }, - "_requiredBy": [ - "/make-fetch-happen", - "/npm-profile/make-fetch-happen", - "/npm-registry-fetch/make-fetch-happen" - ], - "_resolved": "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-3.8.1.tgz", - "_shasum": "39b0e16add9b605bf0a9ef3d9daaf4843b4cacd2", - "_spec": "http-cache-semantics@^3.8.1", - "_where": "/Users/rebecca/code/npm/node_modules/make-fetch-happen", - "author": { - "name": "Kornel Lesiński", - "email": "kornel@geekhood.net", - "url": "https://kornel.ski/" - }, - "bugs": { - "url": "https://github.com/pornel/http-cache-semantics/issues" - }, - "bundleDependencies": false, - "deprecated": false, - "description": "Parses Cache-Control and other headers. Helps building correct HTTP caches and proxies", - "devDependencies": { - "babel-cli": "^6.24.1", - "babel-preset-env": "^1.6.1", - "mocha": "^3.4.2" - }, - "files": [ - "node4/index.js" - ], - "homepage": "https://github.com/pornel/http-cache-semantics#readme", - "license": "BSD-2-Clause", - "main": "node4/index.js", - "name": "http-cache-semantics", - "repository": { - "type": "git", - "url": "git+https://github.com/pornel/http-cache-semantics.git" - }, - "scripts": { - "compile": "babel -d node4/ index.js; babel -d node4/test test", - "prepublish": "npm run compile", - "test": "npm run compile; mocha node4/test" - }, - "version": "3.8.1" + "version": "4.1.0", + "description": "Parses Cache-Control and other headers. Helps building correct HTTP caches and proxies", + "repository": "https://github.com/kornelski/http-cache-semantics.git", + "main": "index.js", + "scripts": { + "test": "mocha" + }, + "files": [ + "index.js" + ], + "author": "Kornel Lesiński (https://kornel.ski/)", + "license": "BSD-2-Clause", + "devDependencies": { + "eslint": "^5.13.0", + "eslint-plugin-prettier": "^3.0.1", + "husky": "^0.14.3", + "lint-staged": "^8.1.3", + "mocha": "^5.1.0", + "prettier": "^1.14.3", + "prettier-eslint-cli": "^4.7.1" + } } diff --git a/deps/npm/node_modules/http-proxy-agent/.travis.yml b/deps/npm/node_modules/http-proxy-agent/.travis.yml deleted file mode 100644 index 805d3d50d2a1fe..00000000000000 --- a/deps/npm/node_modules/http-proxy-agent/.travis.yml +++ /dev/null @@ -1,22 +0,0 @@ -sudo: false - -language: node_js - -node_js: - - "4" - - "5" - - "6" - - "7" - - "8" - -install: - - PATH="`npm bin`:`npm bin -g`:$PATH" - # Install dependencies and build - - npm install - -script: - # Output useful info for debugging - - node --version - - npm --version - # Run tests - - npm test diff --git a/deps/npm/node_modules/http-proxy-agent/History.md b/deps/npm/node_modules/http-proxy-agent/History.md deleted file mode 100644 index 7e3e1e7836cba3..00000000000000 --- a/deps/npm/node_modules/http-proxy-agent/History.md +++ /dev/null @@ -1,101 +0,0 @@ - -2.1.0 / 2018-03-03 -================== - - * Add "engines" to package.json - * Use `Buffer.from()` - * Update package.json - outdated debug version (#7) - -2.0.0 / 2017-06-27 -================== - - * drop support for Node.js < v4 - * update "mocha" to v3 - * update to "agent-base" v4 - * rename http-proxy-agent.js to index.js - * remove `extend` dependency - * test Node.js 4, 5, 6, 7 and 8 on Travis-CI - -1.0.0 / 2015-07-10 -================== - - * http-proxy-agent: use %o debug() formatter - * http-proxy-agent: remove `defaults` merging logic - * package: update "agent-base" to v2 - * test: add an assert() call - * test: use ssl-cert-snakeoil self-signed SSL certs - * README: add note about node-https-proxy-agent - -0.2.7 / 2015-07-06 -================== - - * travis: ensure latest npm before testing - * travis: test node v0.8, v0.10, and v0.12 - * README: use SVG for Travis-CI badge - * package: update "extend" to v3 - * package: update "mocha" to v2 - * package: update "debug" to v2 - -0.2.6 / 2014-06-11 -================== - - * package: update "debug" to v1.0.0 - -0.2.5 / 2014-04-09 -================== - - * package: update outdated deps - -0.2.4 / 2014-01-12 -================== - - * http-proxy-agent: fix using the agent after the first tick of creating the ClientRequest - * http-proxy-agent: use "debug" module - * History: fix whitespace - -0.2.3 / 2013-11-18 -================== - - * https-proxy-agent: allow "https" without trailing colon - -0.2.2 / 2013-11-16 -================== - - * http-proxy-agent: delete the `port` if it matches default port - * http-proxy-agent: don't mix in the `proxy` opts to the endpoint opts - * http-proxy-agent: delete `pathname` from the proxy opts as well - -0.2.1 / 2013-10-28 -================== - - * http-proxy-agent: properly proxy the query-string on request URLs (GH-1) - -0.2.0 / 2013-09-16 -================== - - * http-proxy-agent: update to `agent-base` v1.0.0 API - * http-proxy-agent: rename `secure` option to `secureProxy` - * http-proxy-agent: default the "port" to 80 if not set - * http-proxy-agent: use "extend" module - * test: refactor tests - * test: add 407 auth test - * test: add bad proxy info test - * test: add "secureProxy" option tests - -0.1.0 / 2013-09-03 -================== - - * Add initial "Proxy-Authorization" Basic authentication support - -0.0.2 / 2013-07-11 -================== - - * test: make tests pass, ensure valid IP addresses are returned - * test: add tests - * throw an Error when no proxy info is given - * add support for passing options to net/tls .connect() - -0.0.1 / 2013-07-09 -================== - - * Initial release diff --git a/deps/npm/node_modules/http-proxy-agent/README.md b/deps/npm/node_modules/http-proxy-agent/README.md index 4f1fc372bd125e..d60e20661f86c0 100644 --- a/deps/npm/node_modules/http-proxy-agent/README.md +++ b/deps/npm/node_modules/http-proxy-agent/README.md @@ -1,7 +1,7 @@ http-proxy-agent ================ ### An HTTP(s) proxy `http.Agent` implementation for HTTP -[![Build Status](https://travis-ci.org/TooTallNate/node-http-proxy-agent.svg?branch=master)](https://travis-ci.org/TooTallNate/node-http-proxy-agent) +[![Build Status](https://github.com/TooTallNate/node-http-proxy-agent/workflows/Node%20CI/badge.svg)](https://github.com/TooTallNate/node-http-proxy-agent/actions?workflow=Node+CI) This module provides an `http.Agent` implementation that connects to a specified HTTP or HTTPS proxy server, and can be used with the built-in `http` module. diff --git a/deps/npm/node_modules/http-proxy-agent/dist/agent.d.ts b/deps/npm/node_modules/http-proxy-agent/dist/agent.d.ts new file mode 100644 index 00000000000000..3f043f7f9f7561 --- /dev/null +++ b/deps/npm/node_modules/http-proxy-agent/dist/agent.d.ts @@ -0,0 +1,32 @@ +/// +import net from 'net'; +import { Agent, ClientRequest, RequestOptions } from 'agent-base'; +import { HttpProxyAgentOptions } from '.'; +interface HttpProxyAgentClientRequest extends ClientRequest { + path: string; + output?: string[]; + outputData?: { + data: string; + }[]; + _header?: string | null; + _implicitHeader(): void; +} +/** + * The `HttpProxyAgent` implements an HTTP Agent subclass that connects + * to the specified "HTTP proxy server" in order to proxy HTTP requests. + * + * @api public + */ +export default class HttpProxyAgent extends Agent { + private secureProxy; + private proxy; + constructor(_opts: string | HttpProxyAgentOptions); + /** + * Called when the node-core HTTP client library is creating a + * new HTTP request. + * + * @api protected + */ + callback(req: HttpProxyAgentClientRequest, opts: RequestOptions): Promise; +} +export {}; diff --git a/deps/npm/node_modules/http-proxy-agent/dist/agent.js b/deps/npm/node_modules/http-proxy-agent/dist/agent.js new file mode 100644 index 00000000000000..02528505168192 --- /dev/null +++ b/deps/npm/node_modules/http-proxy-agent/dist/agent.js @@ -0,0 +1,145 @@ +"use strict"; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const net_1 = __importDefault(require("net")); +const tls_1 = __importDefault(require("tls")); +const url_1 = __importDefault(require("url")); +const debug_1 = __importDefault(require("debug")); +const once_1 = __importDefault(require("@tootallnate/once")); +const agent_base_1 = require("agent-base"); +const debug = debug_1.default('http-proxy-agent'); +function isHTTPS(protocol) { + return typeof protocol === 'string' ? /^https:?$/i.test(protocol) : false; +} +/** + * The `HttpProxyAgent` implements an HTTP Agent subclass that connects + * to the specified "HTTP proxy server" in order to proxy HTTP requests. + * + * @api public + */ +class HttpProxyAgent extends agent_base_1.Agent { + constructor(_opts) { + let opts; + if (typeof _opts === 'string') { + opts = url_1.default.parse(_opts); + } + else { + opts = _opts; + } + if (!opts) { + throw new Error('an HTTP(S) proxy server `host` and `port` must be specified!'); + } + debug('Creating new HttpProxyAgent instance: %o', opts); + super(opts); + const proxy = Object.assign({}, opts); + // If `true`, then connect to the proxy server over TLS. + // Defaults to `false`. + this.secureProxy = opts.secureProxy || isHTTPS(proxy.protocol); + // Prefer `hostname` over `host`, and set the `port` if needed. + proxy.host = proxy.hostname || proxy.host; + if (typeof proxy.port === 'string') { + proxy.port = parseInt(proxy.port, 10); + } + if (!proxy.port && proxy.host) { + proxy.port = this.secureProxy ? 443 : 80; + } + if (proxy.host && proxy.path) { + // If both a `host` and `path` are specified then it's most likely + // the result of a `url.parse()` call... we need to remove the + // `path` portion so that `net.connect()` doesn't attempt to open + // that as a Unix socket file. + delete proxy.path; + delete proxy.pathname; + } + this.proxy = proxy; + } + /** + * Called when the node-core HTTP client library is creating a + * new HTTP request. + * + * @api protected + */ + callback(req, opts) { + return __awaiter(this, void 0, void 0, function* () { + const { proxy, secureProxy } = this; + const parsed = url_1.default.parse(req.path); + if (!parsed.protocol) { + parsed.protocol = 'http:'; + } + if (!parsed.hostname) { + parsed.hostname = opts.hostname || opts.host || null; + } + if (parsed.port == null && typeof opts.port) { + parsed.port = String(opts.port); + } + if (parsed.port === '80') { + // if port is 80, then we can remove the port so that the + // ":80" portion is not on the produced URL + delete parsed.port; + } + // Change the `http.ClientRequest` instance's "path" field + // to the absolute path of the URL that will be requested. + req.path = url_1.default.format(parsed); + // Inject the `Proxy-Authorization` header if necessary. + if (proxy.auth) { + req.setHeader('Proxy-Authorization', `Basic ${Buffer.from(proxy.auth).toString('base64')}`); + } + // Create a socket connection to the proxy server. + let socket; + if (secureProxy) { + debug('Creating `tls.Socket`: %o', proxy); + socket = tls_1.default.connect(proxy); + } + else { + debug('Creating `net.Socket`: %o', proxy); + socket = net_1.default.connect(proxy); + } + // At this point, the http ClientRequest's internal `_header` field + // might have already been set. If this is the case then we'll need + // to re-generate the string since we just changed the `req.path`. + if (req._header) { + let first; + let endOfHeaders; + debug('Regenerating stored HTTP header string for request'); + req._header = null; + req._implicitHeader(); + if (req.output && req.output.length > 0) { + // Node < 12 + debug('Patching connection write() output buffer with updated header'); + first = req.output[0]; + endOfHeaders = first.indexOf('\r\n\r\n') + 4; + req.output[0] = req._header + first.substring(endOfHeaders); + debug('Output buffer: %o', req.output); + } + else if (req.outputData && req.outputData.length > 0) { + // Node >= 12 + debug('Patching connection write() output buffer with updated header'); + first = req.outputData[0].data; + endOfHeaders = first.indexOf('\r\n\r\n') + 4; + req.outputData[0].data = + req._header + first.substring(endOfHeaders); + debug('Output buffer: %o', req.outputData[0].data); + } + } + // Wait for the socket's `connect` event, so that this `callback()` + // function throws instead of the `http` request machinery. This is + // important for i.e. `PacProxyAgent` which determines a failed proxy + // connection via the `callback()` function throwing. + yield once_1.default(socket, 'connect'); + return socket; + }); + } +} +exports.default = HttpProxyAgent; +//# sourceMappingURL=agent.js.map \ No newline at end of file diff --git a/deps/npm/node_modules/http-proxy-agent/dist/agent.js.map b/deps/npm/node_modules/http-proxy-agent/dist/agent.js.map new file mode 100644 index 00000000000000..7a407620d8e50a --- /dev/null +++ b/deps/npm/node_modules/http-proxy-agent/dist/agent.js.map @@ -0,0 +1 @@ +{"version":3,"file":"agent.js","sourceRoot":"","sources":["../src/agent.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,8CAAsB;AACtB,8CAAsB;AACtB,8CAAsB;AACtB,kDAAgC;AAChC,6DAAqC;AACrC,2CAAkE;AAGlE,MAAM,KAAK,GAAG,eAAW,CAAC,kBAAkB,CAAC,CAAC;AAY9C,SAAS,OAAO,CAAC,QAAwB;IACxC,OAAO,OAAO,QAAQ,KAAK,QAAQ,CAAC,CAAC,CAAC,YAAY,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;AAC3E,CAAC;AAED;;;;;GAKG;AACH,MAAqB,cAAe,SAAQ,kBAAK;IAIhD,YAAY,KAAqC;QAChD,IAAI,IAA2B,CAAC;QAChC,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;YAC9B,IAAI,GAAG,aAAG,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;SACxB;aAAM;YACN,IAAI,GAAG,KAAK,CAAC;SACb;QACD,IAAI,CAAC,IAAI,EAAE;YACV,MAAM,IAAI,KAAK,CACd,8DAA8D,CAC9D,CAAC;SACF;QACD,KAAK,CAAC,0CAA0C,EAAE,IAAI,CAAC,CAAC;QACxD,KAAK,CAAC,IAAI,CAAC,CAAC;QAEZ,MAAM,KAAK,qBAA+B,IAAI,CAAE,CAAC;QAEjD,wDAAwD;QACxD,uBAAuB;QACvB,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,WAAW,IAAI,OAAO,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;QAE/D,+DAA+D;QAC/D,KAAK,CAAC,IAAI,GAAG,KAAK,CAAC,QAAQ,IAAI,KAAK,CAAC,IAAI,CAAC;QAC1C,IAAI,OAAO,KAAK,CAAC,IAAI,KAAK,QAAQ,EAAE;YACnC,KAAK,CAAC,IAAI,GAAG,QAAQ,CAAC,KAAK,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;SACtC;QACD,IAAI,CAAC,KAAK,CAAC,IAAI,IAAI,KAAK,CAAC,IAAI,EAAE;YAC9B,KAAK,CAAC,IAAI,GAAG,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;SACzC;QAED,IAAI,KAAK,CAAC,IAAI,IAAI,KAAK,CAAC,IAAI,EAAE;YAC7B,kEAAkE;YAClE,8DAA8D;YAC9D,iEAAiE;YACjE,8BAA8B;YAC9B,OAAO,KAAK,CAAC,IAAI,CAAC;YAClB,OAAO,KAAK,CAAC,QAAQ,CAAC;SACtB;QAED,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACpB,CAAC;IAED;;;;;OAKG;IACG,QAAQ,CACb,GAAgC,EAChC,IAAoB;;YAEpB,MAAM,EAAE,KAAK,EAAE,WAAW,EAAE,GAAG,IAAI,CAAC;YACpC,MAAM,MAAM,GAAG,aAAG,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;YAEnC,IAAI,CAAC,MAAM,CAAC,QAAQ,EAAE;gBACrB,MAAM,CAAC,QAAQ,GAAG,OAAO,CAAC;aAC1B;YAED,IAAI,CAAC,MAAM,CAAC,QAAQ,EAAE;gBACrB,MAAM,CAAC,QAAQ,GAAG,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC;aACrD;YAED,IAAI,MAAM,CAAC,IAAI,IAAI,IAAI,IAAI,OAAO,IAAI,CAAC,IAAI,EAAE;gBAC5C,MAAM,CAAC,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;aAChC;YAED,IAAI,MAAM,CAAC,IAAI,KAAK,IAAI,EAAE;gBACzB,yDAAyD;gBACzD,2CAA2C;gBAC3C,OAAO,MAAM,CAAC,IAAI,CAAC;aACnB;YAED,0DAA0D;YAC1D,0DAA0D;YAC1D,GAAG,CAAC,IAAI,GAAG,aAAG,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;YAE9B,wDAAwD;YACxD,IAAI,KAAK,CAAC,IAAI,EAAE;gBACf,GAAG,CAAC,SAAS,CACZ,qBAAqB,EACrB,SAAS,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE,CACrD,CAAC;aACF;YAED,kDAAkD;YAClD,IAAI,MAAkB,CAAC;YACvB,IAAI,WAAW,EAAE;gBAChB,KAAK,CAAC,2BAA2B,EAAE,KAAK,CAAC,CAAC;gBAC1C,MAAM,GAAG,aAAG,CAAC,OAAO,CAAC,KAA8B,CAAC,CAAC;aACrD;iBAAM;gBACN,KAAK,CAAC,2BAA2B,EAAE,KAAK,CAAC,CAAC;gBAC1C,MAAM,GAAG,aAAG,CAAC,OAAO,CAAC,KAA2B,CAAC,CAAC;aAClD;YAED,mEAAmE;YACnE,mEAAmE;YACnE,kEAAkE;YAClE,IAAI,GAAG,CAAC,OAAO,EAAE;gBAChB,IAAI,KAAa,CAAC;gBAClB,IAAI,YAAoB,CAAC;gBACzB,KAAK,CAAC,oDAAoD,CAAC,CAAC;gBAC5D,GAAG,CAAC,OAAO,GAAG,IAAI,CAAC;gBACnB,GAAG,CAAC,eAAe,EAAE,CAAC;gBACtB,IAAI,GAAG,CAAC,MAAM,IAAI,GAAG,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE;oBACxC,YAAY;oBACZ,KAAK,CACJ,+DAA+D,CAC/D,CAAC;oBACF,KAAK,GAAG,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;oBACtB,YAAY,GAAG,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;oBAC7C,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC,OAAO,GAAG,KAAK,CAAC,SAAS,CAAC,YAAY,CAAC,CAAC;oBAC5D,KAAK,CAAC,mBAAmB,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;iBACvC;qBAAM,IAAI,GAAG,CAAC,UAAU,IAAI,GAAG,CAAC,UAAU,CAAC,MAAM,GAAG,CAAC,EAAE;oBACvD,aAAa;oBACb,KAAK,CACJ,+DAA+D,CAC/D,CAAC;oBACF,KAAK,GAAG,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;oBAC/B,YAAY,GAAG,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;oBAC7C,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,IAAI;wBACrB,GAAG,CAAC,OAAO,GAAG,KAAK,CAAC,SAAS,CAAC,YAAY,CAAC,CAAC;oBAC7C,KAAK,CAAC,mBAAmB,EAAE,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;iBACnD;aACD;YAED,mEAAmE;YACnE,mEAAmE;YACnE,qEAAqE;YACrE,qDAAqD;YACrD,MAAM,cAAI,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;YAE9B,OAAO,MAAM,CAAC;QACf,CAAC;KAAA;CACD;AA1ID,iCA0IC"} \ No newline at end of file diff --git a/deps/npm/node_modules/http-proxy-agent/dist/index.d.ts b/deps/npm/node_modules/http-proxy-agent/dist/index.d.ts new file mode 100644 index 00000000000000..24bdb52efcedcb --- /dev/null +++ b/deps/npm/node_modules/http-proxy-agent/dist/index.d.ts @@ -0,0 +1,21 @@ +/// +import net from 'net'; +import tls from 'tls'; +import { Url } from 'url'; +import { AgentOptions } from 'agent-base'; +import _HttpProxyAgent from './agent'; +declare function createHttpProxyAgent(opts: string | createHttpProxyAgent.HttpProxyAgentOptions): _HttpProxyAgent; +declare namespace createHttpProxyAgent { + interface BaseHttpProxyAgentOptions { + secureProxy?: boolean; + host?: string | null; + path?: string | null; + port?: string | number | null; + } + export interface HttpProxyAgentOptions extends AgentOptions, BaseHttpProxyAgentOptions, Partial> { + } + export type HttpProxyAgent = _HttpProxyAgent; + export const HttpProxyAgent: typeof _HttpProxyAgent; + export {}; +} +export = createHttpProxyAgent; diff --git a/deps/npm/node_modules/http-proxy-agent/dist/index.js b/deps/npm/node_modules/http-proxy-agent/dist/index.js new file mode 100644 index 00000000000000..0a71180594605b --- /dev/null +++ b/deps/npm/node_modules/http-proxy-agent/dist/index.js @@ -0,0 +1,14 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +const agent_1 = __importDefault(require("./agent")); +function createHttpProxyAgent(opts) { + return new agent_1.default(opts); +} +(function (createHttpProxyAgent) { + createHttpProxyAgent.HttpProxyAgent = agent_1.default; + createHttpProxyAgent.prototype = agent_1.default.prototype; +})(createHttpProxyAgent || (createHttpProxyAgent = {})); +module.exports = createHttpProxyAgent; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/deps/npm/node_modules/http-proxy-agent/dist/index.js.map b/deps/npm/node_modules/http-proxy-agent/dist/index.js.map new file mode 100644 index 00000000000000..e07dae5b08455a --- /dev/null +++ b/deps/npm/node_modules/http-proxy-agent/dist/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;AAIA,oDAAsC;AAEtC,SAAS,oBAAoB,CAC5B,IAAyD;IAEzD,OAAO,IAAI,eAAe,CAAC,IAAI,CAAC,CAAC;AAClC,CAAC;AAED,WAAU,oBAAoB;IAmBhB,mCAAc,GAAG,eAAe,CAAC;IAE9C,oBAAoB,CAAC,SAAS,GAAG,eAAe,CAAC,SAAS,CAAC;AAC5D,CAAC,EAtBS,oBAAoB,KAApB,oBAAoB,QAsB7B;AAED,iBAAS,oBAAoB,CAAC"} \ No newline at end of file diff --git a/deps/npm/node_modules/http-proxy-agent/index.js b/deps/npm/node_modules/http-proxy-agent/index.js deleted file mode 100644 index f90a5297ca8caa..00000000000000 --- a/deps/npm/node_modules/http-proxy-agent/index.js +++ /dev/null @@ -1,111 +0,0 @@ - -/** - * Module dependencies. - */ - -var net = require('net'); -var tls = require('tls'); -var url = require('url'); -var Agent = require('agent-base'); -var inherits = require('util').inherits; -var debug = require('debug')('http-proxy-agent'); - -/** - * Module exports. - */ - -module.exports = HttpProxyAgent; - -/** - * The `HttpProxyAgent` implements an HTTP Agent subclass that connects to the - * specified "HTTP proxy server" in order to proxy HTTP requests. - * - * @api public - */ - -function HttpProxyAgent (opts) { - if (!(this instanceof HttpProxyAgent)) return new HttpProxyAgent(opts); - if ('string' == typeof opts) opts = url.parse(opts); - if (!opts) throw new Error('an HTTP(S) proxy server `host` and `port` must be specified!'); - debug('creating new HttpProxyAgent instance: %o', opts); - Agent.call(this, opts); - - var proxy = Object.assign({}, opts); - - // if `true`, then connect to the proxy server over TLS. defaults to `false`. - this.secureProxy = proxy.protocol ? /^https:?$/i.test(proxy.protocol) : false; - - // prefer `hostname` over `host`, and set the `port` if needed - proxy.host = proxy.hostname || proxy.host; - proxy.port = +proxy.port || (this.secureProxy ? 443 : 80); - - if (proxy.host && proxy.path) { - // if both a `host` and `path` are specified then it's most likely the - // result of a `url.parse()` call... we need to remove the `path` portion so - // that `net.connect()` doesn't attempt to open that as a unix socket file. - delete proxy.path; - delete proxy.pathname; - } - - this.proxy = proxy; -} -inherits(HttpProxyAgent, Agent); - -/** - * Called when the node-core HTTP client library is creating a new HTTP request. - * - * @api public - */ - -HttpProxyAgent.prototype.callback = function connect (req, opts, fn) { - var proxy = this.proxy; - - // change the `http.ClientRequest` instance's "path" field - // to the absolute path of the URL that will be requested - var parsed = url.parse(req.path); - if (null == parsed.protocol) parsed.protocol = 'http:'; - if (null == parsed.hostname) parsed.hostname = opts.hostname || opts.host; - if (null == parsed.port) parsed.port = opts.port; - if (parsed.port == 80) { - // if port is 80, then we can remove the port so that the - // ":80" portion is not on the produced URL - delete parsed.port; - } - var absolute = url.format(parsed); - req.path = absolute; - - // inject the `Proxy-Authorization` header if necessary - if (proxy.auth) { - req.setHeader( - 'Proxy-Authorization', - 'Basic ' + Buffer.from(proxy.auth).toString('base64') - ); - } - - // create a socket connection to the proxy server - var socket; - if (this.secureProxy) { - socket = tls.connect(proxy); - } else { - socket = net.connect(proxy); - } - - // at this point, the http ClientRequest's internal `_header` field might have - // already been set. If this is the case then we'll need to re-generate the - // string since we just changed the `req.path` - if (req._header) { - debug('regenerating stored HTTP header string for request'); - req._header = null; - req._implicitHeader(); - if (req.output && req.output.length > 0) { - debug('patching connection write() output buffer with updated header'); - // the _header has already been queued to be written to the socket - var first = req.output[0]; - var endOfHeaders = first.indexOf('\r\n\r\n') + 4; - req.output[0] = req._header + first.substring(endOfHeaders); - debug('output buffer: %o', req.output); - } - } - - fn(null, socket); -}; diff --git a/deps/npm/node_modules/http-proxy-agent/package.json b/deps/npm/node_modules/http-proxy-agent/package.json index 99e28fdc6aa59c..870dd5d8af267a 100644 --- a/deps/npm/node_modules/http-proxy-agent/package.json +++ b/deps/npm/node_modules/http-proxy-agent/package.json @@ -1,67 +1,57 @@ { - "_from": "http-proxy-agent@^2.1.0", - "_id": "http-proxy-agent@2.1.0", - "_inBundle": false, - "_integrity": "sha512-qwHbBLV7WviBl0rQsOzH6o5lwyOIvwp/BdFnvVxXORldu5TmjFfjzBcWUWS5kWAZhmv+JtiDhSuQCp4sBfbIgg==", - "_location": "/http-proxy-agent", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "http-proxy-agent@^2.1.0", - "name": "http-proxy-agent", - "escapedName": "http-proxy-agent", - "rawSpec": "^2.1.0", - "saveSpec": null, - "fetchSpec": "^2.1.0" - }, - "_requiredBy": [ - "/make-fetch-happen", - "/npm-profile/make-fetch-happen", - "/npm-registry-fetch/make-fetch-happen" - ], - "_resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-2.1.0.tgz", - "_shasum": "e4821beef5b2142a2026bd73926fe537631c5405", - "_spec": "http-proxy-agent@^2.1.0", - "_where": "/Users/rebecca/code/npm/node_modules/make-fetch-happen", - "author": { - "name": "Nathan Rajlich", - "email": "nathan@tootallnate.net", - "url": "http://n8.io/" - }, - "bugs": { - "url": "https://github.com/TooTallNate/node-http-proxy-agent/issues" - }, - "bundleDependencies": false, - "dependencies": { - "agent-base": "4", - "debug": "3.1.0" - }, - "deprecated": false, + "name": "http-proxy-agent", + "version": "4.0.1", "description": "An HTTP(s) proxy `http.Agent` implementation for HTTP", - "devDependencies": { - "mocha": "3", - "proxy": "~0.2.3" + "main": "./dist/index.js", + "types": "./dist/index.d.ts", + "files": [ + "dist" + ], + "scripts": { + "prebuild": "rimraf dist", + "build": "tsc", + "test": "mocha", + "test-lint": "eslint src --ext .js,.ts", + "prepublishOnly": "npm run build" }, - "engines": { - "node": ">= 4.5.0" + "repository": { + "type": "git", + "url": "git://github.com/TooTallNate/node-http-proxy-agent.git" }, - "homepage": "https://github.com/TooTallNate/node-http-proxy-agent#readme", "keywords": [ "http", "proxy", "endpoint", "agent" ], + "author": "Nathan Rajlich (http://n8.io/)", "license": "MIT", - "main": "./index.js", - "name": "http-proxy-agent", - "repository": { - "type": "git", - "url": "git://github.com/TooTallNate/node-http-proxy-agent.git" + "bugs": { + "url": "https://github.com/TooTallNate/node-http-proxy-agent/issues" }, - "scripts": { - "test": "mocha --reporter spec" + "dependencies": { + "@tootallnate/once": "1", + "agent-base": "6", + "debug": "4" }, - "version": "2.1.0" + "devDependencies": { + "@types/debug": "4", + "@types/node": "^12.12.11", + "@typescript-eslint/eslint-plugin": "1.6.0", + "@typescript-eslint/parser": "1.1.0", + "eslint": "5.16.0", + "eslint-config-airbnb": "17.1.0", + "eslint-config-prettier": "4.1.0", + "eslint-import-resolver-typescript": "1.1.1", + "eslint-plugin-import": "2.16.0", + "eslint-plugin-jsx-a11y": "6.2.1", + "eslint-plugin-react": "7.12.4", + "mocha": "^6.2.2", + "proxy": "1", + "rimraf": "^3.0.0", + "typescript": "^3.5.3" + }, + "engines": { + "node": ">= 6" + } } diff --git a/deps/npm/node_modules/http-proxy-agent/test/ssl-cert-snakeoil.key b/deps/npm/node_modules/http-proxy-agent/test/ssl-cert-snakeoil.key deleted file mode 100644 index fd12501220a564..00000000000000 --- a/deps/npm/node_modules/http-proxy-agent/test/ssl-cert-snakeoil.key +++ /dev/null @@ -1,15 +0,0 @@ ------BEGIN RSA PRIVATE KEY----- -MIICWwIBAAKBgQCzURxIqzer0ACAbX/lHdsn4Gd9PLKrf7EeDYfIdV0HZKPD8WDr -bBx2/fBu0OW2sjnzv/SVZbJ0DAuPE/p0+eT0qb2qC10iz9iTD7ribd7gxhirVb8y -b3fBjXsxc8V8p4Ny1LcvNSqCjwUbJqdRogfoJeTiqPM58z5sNzuv5iq7iwIDAQAB -AoGAPMQy4olrP0UotlzlJ36bowLP70ffgHCwU+/f4NWs5fF78c3du0oSx1w820Dd -Z7E0JF8bgnlJJTxjumPZz0RUCugrEHBKJmzEz3cxF5E3+7NvteZcjKn9D67RrM5x -1/uSZ9cqKE9cYvY4fSuHx18diyZ4axR/wB1Pea2utjjDM+ECQQDb9ZbmmaWMiRpQ -5Up+loxP7BZNPsEVsm+DVJmEFbaFgGfncWBqSIqnPNjMwTwj0OigTwCAEGPkfRVW -T0pbYWCxAkEA0LK7SCTwzyDmhASUalk0x+3uCAA6ryFdwJf/wd8TRAvVOmkTEldX -uJ7ldLvfrONYO3v56uKTU/SoNdZYzKtO+wJAX2KM4ctXYy5BXztPpr2acz4qHa1N -Bh+vBAC34fOYhyQ76r3b1btHhWZ5jbFuZwm9F2erC94Ps5IaoqcX07DSwQJAPKGw -h2U0EPkd/3zVIZCJJQya+vgWFIs9EZcXVtvYXQyTBkVApTN66MhBIYjzkub5205J -bVQmOV37AKklY1DhwQJAA1wos0cYxro02edzatxd0DIR2r4qqOqLkw6BhYHhq6HJ -ZvIcQkHqdSXzdETFc01I1znDGGIrJHcnvKWgBPoEUg== ------END RSA PRIVATE KEY----- diff --git a/deps/npm/node_modules/http-proxy-agent/test/ssl-cert-snakeoil.pem b/deps/npm/node_modules/http-proxy-agent/test/ssl-cert-snakeoil.pem deleted file mode 100644 index b115a5e91498de..00000000000000 --- a/deps/npm/node_modules/http-proxy-agent/test/ssl-cert-snakeoil.pem +++ /dev/null @@ -1,12 +0,0 @@ ------BEGIN CERTIFICATE----- -MIIB1TCCAT4CCQDV5mPlzm9+izANBgkqhkiG9w0BAQUFADAvMS0wKwYDVQQDEyQ3 -NTI3YmQ3Ny1hYjNlLTQ3NGItYWNlNy1lZWQ2MDUzOTMxZTcwHhcNMTUwNzA2MjI0 -NTA3WhcNMjUwNzAzMjI0NTA3WjAvMS0wKwYDVQQDEyQ3NTI3YmQ3Ny1hYjNlLTQ3 -NGItYWNlNy1lZWQ2MDUzOTMxZTcwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGB -ALNRHEirN6vQAIBtf+Ud2yfgZ308sqt/sR4Nh8h1XQdko8PxYOtsHHb98G7Q5bay -OfO/9JVlsnQMC48T+nT55PSpvaoLXSLP2JMPuuJt3uDGGKtVvzJvd8GNezFzxXyn -g3LUty81KoKPBRsmp1GiB+gl5OKo8znzPmw3O6/mKruLAgMBAAEwDQYJKoZIhvcN -AQEFBQADgYEACzoHUF8UV2Z6541Q2wKEA0UFUzmUjf/E1XwBO+1P15ZZ64uw34B4 -1RwMPtAo9RY/PmICTWtNxWGxkzwb2JtDWtnxVER/lF8k2XcXPE76fxTHJF/BKk9J -QU8OTD1dd9gHCBviQB9TqntRZ5X7axjtuWjb2umY+owBYzAHZkp1HKI= ------END CERTIFICATE----- diff --git a/deps/npm/node_modules/http-proxy-agent/test/test.js b/deps/npm/node_modules/http-proxy-agent/test/test.js deleted file mode 100644 index cc320c7fc2c6d7..00000000000000 --- a/deps/npm/node_modules/http-proxy-agent/test/test.js +++ /dev/null @@ -1,303 +0,0 @@ - -/** - * Module dependencies. - */ - -var fs = require('fs'); -var url = require('url'); -var http = require('http'); -var https = require('https'); -var assert = require('assert'); -var Proxy = require('proxy'); -var HttpProxyAgent = require('../'); - -describe('HttpProxyAgent', function () { - - var server; - var serverPort; - - var proxy; - var proxyPort; - - var sslProxy; - var sslProxyPort; - - before(function (done) { - // setup HTTP proxy server - proxy = Proxy(); - proxy.listen(function () { - proxyPort = proxy.address().port; - done(); - }); - }); - - before(function (done) { - // setup target HTTP server - server = http.createServer(); - server.listen(function () { - serverPort = server.address().port; - done(); - }); - }); - - before(function (done) { - // setup SSL HTTP proxy server - var options = { - key: fs.readFileSync(__dirname + '/ssl-cert-snakeoil.key'), - cert: fs.readFileSync(__dirname + '/ssl-cert-snakeoil.pem') - }; - sslProxy = Proxy(https.createServer(options)); - sslProxy.listen(function () { - sslProxyPort = sslProxy.address().port; - done(); - }); - }); - - // shut down test HTTP server - after(function (done) { - proxy.once('close', function () { done(); }); - proxy.close(); - }); - - after(function (done) { - server.once('close', function () { done(); }); - server.close(); - }); - - after(function (done) { - sslProxy.once('close', function () { done(); }); - sslProxy.close(); - }); - - describe('constructor', function () { - it('should throw an Error if no "proxy" argument is given', function () { - assert.throws(function () { - new HttpProxyAgent(); - }); - }); - it('should accept a "string" proxy argument', function () { - var agent = new HttpProxyAgent('http://127.0.0.1:' + proxyPort); - assert.equal('127.0.0.1', agent.proxy.host); - assert.equal(proxyPort, agent.proxy.port); - }); - it('should accept a `url.parse()` result object argument', function () { - var opts = url.parse('http://127.0.0.1:' + proxyPort); - var agent = new HttpProxyAgent(opts); - assert.equal('127.0.0.1', agent.proxy.host); - assert.equal(proxyPort, agent.proxy.port); - }); - describe('secureProxy', function () { - it('should default to `false`', function () { - var agent = new HttpProxyAgent({ port: proxyPort }); - assert.equal(false, agent.secureProxy); - }); - it('should be `false` when "http:" protocol is used', function () { - var agent = new HttpProxyAgent({ port: proxyPort, protocol: 'http:' }); - assert.equal(false, agent.secureProxy); - }); - it('should be `true` when "https:" protocol is used', function () { - var agent = new HttpProxyAgent({ port: proxyPort, protocol: 'https:' }); - assert.equal(true, agent.secureProxy); - }); - it('should be `true` when "https" protocol is used', function () { - var agent = new HttpProxyAgent({ port: proxyPort, protocol: 'https' }); - assert.equal(true, agent.secureProxy); - }); - }); - }); - - describe('"http" module', function () { - it('should work over an HTTP proxy', function (done) { - // set HTTP "request" event handler for this test - server.once('request', function (req, res) { - res.end(JSON.stringify(req.headers)); - }); - - var proxy = process.env.HTTP_PROXY || process.env.http_proxy || 'http://127.0.0.1:' + proxyPort; - var agent = new HttpProxyAgent(proxy); - - var opts = url.parse('http://127.0.0.1:' + serverPort); - opts.agent = agent; - - http.get(opts, function (res) { - var data = ''; - res.setEncoding('utf8'); - res.on('data', function (b) { - data += b; - }); - res.on('end', function () { - data = JSON.parse(data); - assert.equal('127.0.0.1:' + serverPort, data.host); - assert('via' in data); - done(); - }); - }); - }); - it('should work over an HTTPS proxy', function (done) { - // set HTTP "request" event handler for this test - server.once('request', function (req, res) { - res.end(JSON.stringify(req.headers)); - }); - - var proxy = process.env.HTTPS_PROXY || process.env.https_proxy || 'https://127.0.0.1:' + sslProxyPort; - proxy = url.parse(proxy); - proxy.rejectUnauthorized = false; - var agent = new HttpProxyAgent(proxy); - assert.equal(true, agent.secureProxy); - - var opts = url.parse('http://127.0.0.1:' + serverPort); - opts.agent = agent; - - http.get(opts, function (res) { - var data = ''; - res.setEncoding('utf8'); - res.on('data', function (b) { - data += b; - }); - res.on('end', function () { - data = JSON.parse(data); - assert.equal('127.0.0.1:' + serverPort, data.host); - assert('via' in data); - done(); - }); - }); - }); - it('should proxy the query string of the request path', function (done) { - // set HTTP "request" event handler for this test - server.once('request', function (req, res) { - res.end(JSON.stringify({ - url: req.url - })); - }); - - var proxy = process.env.HTTP_PROXY || process.env.http_proxy || 'http://127.0.0.1:' + proxyPort; - var agent = new HttpProxyAgent(proxy); - - var opts = url.parse('http://127.0.0.1:' + serverPort + '/test?foo=bar&1=2'); - opts.agent = agent; - - http.get(opts, function (res) { - var data = ''; - res.setEncoding('utf8'); - res.on('data', function (b) { - data += b; - }); - res.on('end', function () { - data = JSON.parse(data); - assert.equal('/test?foo=bar&1=2', data.url); - done(); - }); - }); - }); - it('should receive the 407 authorization code on the `http.ClientResponse`', function (done) { - // set a proxy authentication function for this test - proxy.authenticate = function (req, fn) { - // reject all requests - fn(null, false); - }; - - var proxyUri = process.env.HTTP_PROXY || process.env.http_proxy || 'http://127.0.0.1:' + proxyPort; - var agent = new HttpProxyAgent(proxyUri); - - var opts = {}; - // `host` and `port` don't really matter since the proxy will reject anyways - opts.host = '127.0.0.1'; - opts.port = 80; - opts.agent = agent; - - http.get(opts, function (res) { - assert.equal(407, res.statusCode); - assert('proxy-authenticate' in res.headers); - delete proxy.authenticate; - done(); - }); - }); - it('should send the "Proxy-Authorization" request header', function (done) { - // set a proxy authentication function for this test - proxy.authenticate = function (req, fn) { - // username:password is "foo:bar" - fn(null, req.headers['proxy-authorization'] == 'Basic Zm9vOmJhcg=='); - }; - - // set HTTP "request" event handler for this test - server.once('request', function (req, res) { - res.end(JSON.stringify(req.headers)); - }); - - var proxyUri = process.env.HTTP_PROXY || process.env.http_proxy || 'http://127.0.0.1:' + proxyPort; - var proxyOpts = url.parse(proxyUri); - proxyOpts.auth = 'foo:bar'; - var agent = new HttpProxyAgent(proxyOpts); - - var opts = url.parse('http://127.0.0.1:' + serverPort); - opts.agent = agent; - - http.get(opts, function (res) { - var data = ''; - res.setEncoding('utf8'); - res.on('data', function (b) { - data += b; - }); - res.on('end', function () { - data = JSON.parse(data); - assert.equal('127.0.0.1:' + serverPort, data.host); - assert('via' in data); - delete proxy.authenticate; - done(); - }); - }); - }); - it('should emit an "error" event on the `http.ClientRequest` if the proxy does not exist', function (done) { - // port 4 is a reserved, but "unassigned" port - var proxyUri = 'http://127.0.0.1:4'; - var agent = new HttpProxyAgent(proxyUri); - - var opts = url.parse('http://nodejs.org'); - opts.agent = agent; - - var req = http.get(opts); - req.once('error', function (err) { - assert.equal('ECONNREFUSED', err.code); - req.abort(); - done(); - }); - }); - it('should work after the first tick of the `http.ClientRequest` instance', function (done) { - // set HTTP "request" event handler for this test - server.once('request', function (req, res) { - res.end(JSON.stringify(req.url)); - }); - - var proxy = process.env.HTTP_PROXY || process.env.http_proxy || 'http://127.0.0.1:' + proxyPort; - var agent = new HttpProxyAgent(proxy); - - var opts = url.parse('http://127.0.0.1:' + serverPort + '/test'); - opts.agent = agent; - - // defer the "connect()" function logic, since calling .end() before the - // "socket" event can cause weirdness since the HTTP header will have been - // cached and the HttpProxyAgent `req.path` patches won't be respected - var callback = agent.callback; - agent.callback = function (req, opts, fn) { - setTimeout(function () { - agent.callback = callback; - agent.callback(req, opts, fn); - }, 10); - }; - - http.get(opts, function (res) { - var data = ''; - res.setEncoding('utf8'); - res.on('data', function (b) { - data += b; - }); - res.on('end', function () { - data = JSON.parse(data); - assert.equal('/test', data); - done(); - }); - }); - }); - }); - -}); diff --git a/deps/npm/node_modules/http-signature/package.json b/deps/npm/node_modules/http-signature/package.json index dd0381bb6c2f53..df07d53d752df0 100644 --- a/deps/npm/node_modules/http-signature/package.json +++ b/deps/npm/node_modules/http-signature/package.json @@ -1,77 +1,39 @@ { - "_from": "http-signature@~1.2.0", - "_id": "http-signature@1.2.0", - "_inBundle": false, - "_integrity": "sha1-muzZJRFHcvPZW2WmCruPfBj7rOE=", - "_location": "/http-signature", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "http-signature@~1.2.0", - "name": "http-signature", - "escapedName": "http-signature", - "rawSpec": "~1.2.0", - "saveSpec": null, - "fetchSpec": "~1.2.0" - }, - "_requiredBy": [ - "/request" - ], - "_resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz", - "_shasum": "9aecd925114772f3d95b65a60abb8f7c18fbace1", - "_spec": "http-signature@~1.2.0", - "_where": "/Users/zkat/Documents/code/work/npm/node_modules/request", - "author": { - "name": "Joyent, Inc" - }, - "bugs": { - "url": "https://github.com/joyent/node-http-signature/issues" - }, - "bundleDependencies": false, + "name": "http-signature", + "description": "Reference implementation of Joyent's HTTP Signature scheme.", + "version": "1.2.0", + "license": "MIT", + "author": "Joyent, Inc", "contributors": [ - { - "name": "Mark Cavage", - "email": "mcavage@gmail.com" - }, - { - "name": "David I. Lehn", - "email": "dil@lehn.org" - }, - { - "name": "Patrick Mooney", - "email": "patrick.f.mooney@gmail.com" - } + "Mark Cavage ", + "David I. Lehn ", + "Patrick Mooney " ], - "dependencies": { - "assert-plus": "^1.0.0", - "jsprim": "^1.2.2", - "sshpk": "^1.7.0" - }, - "deprecated": false, - "description": "Reference implementation of Joyent's HTTP Signature scheme.", - "devDependencies": { - "tap": "0.4.2", - "uuid": "^2.0.2" - }, - "engines": { - "node": ">=0.8", - "npm": ">=1.3.7" + "repository": { + "type": "git", + "url": "git://github.com/joyent/node-http-signature.git" }, "homepage": "https://github.com/joyent/node-http-signature/", + "bugs": "https://github.com/joyent/node-http-signature/issues", "keywords": [ "https", "request" ], - "license": "MIT", - "main": "lib/index.js", - "name": "http-signature", - "repository": { - "type": "git", - "url": "git://github.com/joyent/node-http-signature.git" + "engines": { + "node": ">=0.8", + "npm": ">=1.3.7" }, + "main": "lib/index.js", "scripts": { "test": "tap test/*.js" }, - "version": "1.2.0" + "dependencies": { + "assert-plus": "^1.0.0", + "jsprim": "^1.2.2", + "sshpk": "^1.7.0" + }, + "devDependencies": { + "tap": "0.4.2", + "uuid": "^2.0.2" + } } diff --git a/deps/npm/node_modules/https-proxy-agent/.editorconfig b/deps/npm/node_modules/https-proxy-agent/.editorconfig deleted file mode 100644 index 12b4b9a3b9bffe..00000000000000 --- a/deps/npm/node_modules/https-proxy-agent/.editorconfig +++ /dev/null @@ -1,37 +0,0 @@ -root = true - -[*] -indent_style = tab -indent_size = 4 -tab_width = 4 -end_of_line = lf -charset = utf-8 -trim_trailing_whitespace = true -insert_final_newline = true - -[{*.json,*.json.example,*.gyp,*.yml,*.yaml,*.workflow}] -indent_style = space -indent_size = 2 - -[{*.py,*.asm}] -indent_style = space - -[*.py] -indent_size = 4 - -[*.asm] -indent_size = 8 - -[*.md] -trim_trailing_whitespace = false - -# Ideal settings - some plugins might support these. -[*.js] -quote_type = single - -[{*.c,*.cc,*.h,*.hh,*.cpp,*.hpp,*.m,*.mm,*.mpp,*.js,*.java,*.go,*.rs,*.php,*.ng,*.jsx,*.ts,*.d,*.cs,*.swift}] -curly_bracket_next_line = false -spaces_around_operators = true -spaces_around_brackets = outside -# close enough to 1TB -indent_brace_style = K&R diff --git a/deps/npm/node_modules/https-proxy-agent/.eslintrc.js b/deps/npm/node_modules/https-proxy-agent/.eslintrc.js deleted file mode 100644 index 62743f2c4d1879..00000000000000 --- a/deps/npm/node_modules/https-proxy-agent/.eslintrc.js +++ /dev/null @@ -1,86 +0,0 @@ -module.exports = { - 'extends': [ - 'airbnb', - 'prettier' - ], - 'parser': '@typescript-eslint/parser', - 'parserOptions': { - 'ecmaVersion': 2018, - 'sourceType': 'module', - 'modules': true - }, - 'plugins': [ - '@typescript-eslint' - ], - 'settings': { - 'import/resolver': { - 'typescript': { - } - } - }, - 'rules': { - 'quotes': [ - 2, - 'single', - { - 'allowTemplateLiterals': true - } - ], - 'class-methods-use-this': 0, - 'consistent-return': 0, - 'func-names': 0, - 'global-require': 0, - 'guard-for-in': 0, - 'import/no-duplicates': 0, - 'import/no-dynamic-require': 0, - 'import/no-extraneous-dependencies': 0, - 'import/prefer-default-export': 0, - 'lines-between-class-members': 0, - 'no-await-in-loop': 0, - 'no-bitwise': 0, - 'no-console': 0, - 'no-continue': 0, - 'no-control-regex': 0, - 'no-empty': 0, - 'no-loop-func': 0, - 'no-nested-ternary': 0, - 'no-param-reassign': 0, - 'no-plusplus': 0, - 'no-restricted-globals': 0, - 'no-restricted-syntax': 0, - 'no-shadow': 0, - 'no-underscore-dangle': 0, - 'no-use-before-define': 0, - 'prefer-const': 0, - 'prefer-destructuring': 0, - 'camelcase': 0, - 'no-unused-vars': 0, // in favor of '@typescript-eslint/no-unused-vars' - // 'indent': 0 // in favor of '@typescript-eslint/indent' - '@typescript-eslint/no-unused-vars': 'warn', - // '@typescript-eslint/indent': ['error', 2] // this might conflict with a lot ongoing changes - '@typescript-eslint/no-array-constructor': 'error', - '@typescript-eslint/adjacent-overload-signatures': 'error', - '@typescript-eslint/class-name-casing': 'error', - '@typescript-eslint/interface-name-prefix': 'error', - '@typescript-eslint/no-empty-interface': 'error', - '@typescript-eslint/no-inferrable-types': 'error', - '@typescript-eslint/no-misused-new': 'error', - '@typescript-eslint/no-namespace': 'error', - '@typescript-eslint/no-non-null-assertion': 'error', - '@typescript-eslint/no-parameter-properties': 'error', - '@typescript-eslint/no-triple-slash-reference': 'error', - '@typescript-eslint/prefer-namespace-keyword': 'error', - '@typescript-eslint/type-annotation-spacing': 'error', - // '@typescript-eslint/array-type': 'error', - // '@typescript-eslint/ban-types': 'error', - // '@typescript-eslint/explicit-function-return-type': 'warn', - // '@typescript-eslint/explicit-member-accessibility': 'error', - // '@typescript-eslint/member-delimiter-style': 'error', - // '@typescript-eslint/no-angle-bracket-type-assertion': 'error', - // '@typescript-eslint/no-explicit-any': 'warn', - // '@typescript-eslint/no-object-literal-type-assertion': 'error', - // '@typescript-eslint/no-use-before-define': 'error', - // '@typescript-eslint/no-var-requires': 'error', - // '@typescript-eslint/prefer-interface': 'error' - } -} diff --git a/deps/npm/node_modules/https-proxy-agent/History.md b/deps/npm/node_modules/https-proxy-agent/History.md deleted file mode 100644 index f723812312f879..00000000000000 --- a/deps/npm/node_modules/https-proxy-agent/History.md +++ /dev/null @@ -1,124 +0,0 @@ - -2.2.0 / 2018-03-03 -================== - - * Add "engines" to package.json - requires Node.js >= 4.5.0 - * Use `Buffer.from()` - -2.1.1 / 2017-11-28 -================== - - * Update `debug` - Security Problems with Previous Version (#38) - -2.1.0 / 2017-08-08 -================== - - * only include the port number in the Host header when non-default port (#22) - * set ALPN to "http 1.1" by default when using tlsproxy (#25) - * only set `ALPNProtocols` when the property does not already exist - * support SNI (#14) - -2.0.0 / 2017-06-26 -================== - - * rename https-proxy-agent.js to index.js - * update dependencies and remove semver-specific test case - * update `agent-base` to v4 - * remove `extend` dependency - * :arrow_up: update minimum version of debug dependency - * opts/options - * drop Node versions < v4 from Travis-CI - * test Node.js 5, 6, 7 and 8 on Travis-CI - * README: remove outdated `secureEndpoint` reference - * README: remove `secureEndpoint` docs, add `headers` - * https-proxy-agent: add support for proxy "headers" - -1.0.0 / 2015-07-10 -================== - - * upgrade to "agent-base" v2 API - * test: test case is fixed - * use %o debug() formatter - * README: use SVG for Travis-CI badge - -0.3.6 / 2015-07-06 -================== - - * package: update "extend" to v3 - * package: update "mocha" to v2 - * package: update "debug" to v2 - * travis: test node v0.8, v0.10, and v0.12 - * test: use ssl-cert-snakeoil self-signed SSL certs - -0.3.5 / 2014-06-11 -================== - - * package: update "debug" to v1.0.0 - -0.3.4 / 2014-04-09 -================== - - * gitignore: ignore root level ?.js files - * package: update outdated dependencies - -0.3.3 / 2014-01-13 -================== - - * https-proxy-agnet: use debug() instead of console.error() - * https-proxy-agent: fix debug() call - * History: fix whitespace - -0.3.2 / 2013-11-18 -================== - - * https-proxy-agent: allow "https" without trailing colon - * README: fix typo - -0.3.1 / 2013-11-16 -================== - - * test: enable the HTTPS over HTTPS test on node v0.11.8 - * https-proxy-agent: create the proxy socket connection first - * https-proxy-agent: delete `pathname` from the proxy opts as well - * https-proxy-agent: remove dead "end"-emitting code - -0.3.0 / 2013-09-16 -================== - - * https-proxy-agent: use "debug" module - * https-proxy-agent: update to the "agent-base" v1 API - * https-proxy-agent: default the "port" to 443 if not set - * https-proxy-agent: augment the `opts` object for the `tls.connect` function - * https-proxy-agent: use "extend" module - * https-proxy-agent: remove use of `this` as much as possible - * https-proxy-agent: listen for the "error" event of the socket - * test: refactor of tests to use "proxy" module - * test: add "error" event catching test - * test: add 407 proxy response test - * test: use "semver" module, disable the HTTPS over HTTPS test for node >= v0.11.3 - -0.2.0 / 2013-09-03 -================== - - * Add initial "Proxy-Authorization" Basic authentication support - -0.1.0 / 2013-07-21 -================== - - * rename `secure` to `secureProxy` - * added `secureEndpoint` option - * various optimizations - * README improvements - -0.0.2 / 2013-07-11 -================== - - * test: add mocha tests - * don't use `socket.ondata`, use the official API instead - * throw an Error when no proxy info is given - * add support for passing options to net/tls .connect() - -0.0.1 / 2013-07-09 -================== - - * Initial release diff --git a/deps/npm/node_modules/https-proxy-agent/README.md b/deps/npm/node_modules/https-proxy-agent/README.md index 20fda1e24cf65b..328656a9e048a3 100644 --- a/deps/npm/node_modules/https-proxy-agent/README.md +++ b/deps/npm/node_modules/https-proxy-agent/README.md @@ -1,7 +1,7 @@ https-proxy-agent ================ ### An HTTP(s) proxy `http.Agent` implementation for HTTPS -[![Build Status](https://travis-ci.org/TooTallNate/node-https-proxy-agent.svg?branch=master)](https://travis-ci.org/TooTallNate/node-https-proxy-agent) +[![Build Status](https://github.com/TooTallNate/node-https-proxy-agent/workflows/Node%20CI/badge.svg)](https://github.com/TooTallNate/node-https-proxy-agent/actions?workflow=Node+CI) This module provides an `http.Agent` implementation that connects to a specified HTTP or HTTPS proxy server, and can be used with the built-in `https` module. diff --git a/deps/npm/node_modules/https-proxy-agent/dist/agent.d.ts b/deps/npm/node_modules/https-proxy-agent/dist/agent.d.ts new file mode 100644 index 00000000000000..4f1c63624117f0 --- /dev/null +++ b/deps/npm/node_modules/https-proxy-agent/dist/agent.d.ts @@ -0,0 +1,30 @@ +/// +import net from 'net'; +import { Agent, ClientRequest, RequestOptions } from 'agent-base'; +import { HttpsProxyAgentOptions } from '.'; +/** + * The `HttpsProxyAgent` implements an HTTP Agent subclass that connects to + * the specified "HTTP(s) proxy server" in order to proxy HTTPS requests. + * + * Outgoing HTTP requests are first tunneled through the proxy server using the + * `CONNECT` HTTP request method to establish a connection to the proxy server, + * and then the proxy server connects to the destination target and issues the + * HTTP request from the proxy server. + * + * `https:` requests have their socket connection upgraded to TLS once + * the connection to the proxy server has been established. + * + * @api public + */ +export default class HttpsProxyAgent extends Agent { + private secureProxy; + private proxy; + constructor(_opts: string | HttpsProxyAgentOptions); + /** + * Called when the node-core HTTP client library is creating a + * new HTTP request. + * + * @api protected + */ + callback(req: ClientRequest, opts: RequestOptions): Promise; +} diff --git a/deps/npm/node_modules/https-proxy-agent/dist/agent.js b/deps/npm/node_modules/https-proxy-agent/dist/agent.js new file mode 100644 index 00000000000000..d6665259f91f17 --- /dev/null +++ b/deps/npm/node_modules/https-proxy-agent/dist/agent.js @@ -0,0 +1,180 @@ +"use strict"; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const net_1 = __importDefault(require("net")); +const tls_1 = __importDefault(require("tls")); +const url_1 = __importDefault(require("url")); +const assert_1 = __importDefault(require("assert")); +const debug_1 = __importDefault(require("debug")); +const agent_base_1 = require("agent-base"); +const parse_proxy_response_1 = __importDefault(require("./parse-proxy-response")); +const debug = debug_1.default('https-proxy-agent:agent'); +/** + * The `HttpsProxyAgent` implements an HTTP Agent subclass that connects to + * the specified "HTTP(s) proxy server" in order to proxy HTTPS requests. + * + * Outgoing HTTP requests are first tunneled through the proxy server using the + * `CONNECT` HTTP request method to establish a connection to the proxy server, + * and then the proxy server connects to the destination target and issues the + * HTTP request from the proxy server. + * + * `https:` requests have their socket connection upgraded to TLS once + * the connection to the proxy server has been established. + * + * @api public + */ +class HttpsProxyAgent extends agent_base_1.Agent { + constructor(_opts) { + let opts; + if (typeof _opts === 'string') { + opts = url_1.default.parse(_opts); + } + else { + opts = _opts; + } + if (!opts) { + throw new Error('an HTTP(S) proxy server `host` and `port` must be specified!'); + } + debug('creating new HttpsProxyAgent instance: %o', opts); + super(opts); + const proxy = Object.assign({}, opts); + // If `true`, then connect to the proxy server over TLS. + // Defaults to `false`. + this.secureProxy = opts.secureProxy || isHTTPS(proxy.protocol); + // Prefer `hostname` over `host`, and set the `port` if needed. + proxy.host = proxy.hostname || proxy.host; + if (typeof proxy.port === 'string') { + proxy.port = parseInt(proxy.port, 10); + } + if (!proxy.port && proxy.host) { + proxy.port = this.secureProxy ? 443 : 80; + } + // ALPN is supported by Node.js >= v5. + // attempt to negotiate http/1.1 for proxy servers that support http/2 + if (this.secureProxy && !('ALPNProtocols' in proxy)) { + proxy.ALPNProtocols = ['http 1.1']; + } + if (proxy.host && proxy.path) { + // If both a `host` and `path` are specified then it's most likely + // the result of a `url.parse()` call... we need to remove the + // `path` portion so that `net.connect()` doesn't attempt to open + // that as a Unix socket file. + delete proxy.path; + delete proxy.pathname; + } + this.proxy = proxy; + } + /** + * Called when the node-core HTTP client library is creating a + * new HTTP request. + * + * @api protected + */ + callback(req, opts) { + return __awaiter(this, void 0, void 0, function* () { + const { proxy, secureProxy } = this; + // Create a socket connection to the proxy server. + let socket; + if (secureProxy) { + debug('Creating `tls.Socket`: %o', proxy); + socket = tls_1.default.connect(proxy); + } + else { + debug('Creating `net.Socket`: %o', proxy); + socket = net_1.default.connect(proxy); + } + const headers = Object.assign({}, proxy.headers); + const hostname = `${opts.host}:${opts.port}`; + let payload = `CONNECT ${hostname} HTTP/1.1\r\n`; + // Inject the `Proxy-Authorization` header if necessary. + if (proxy.auth) { + headers['Proxy-Authorization'] = `Basic ${Buffer.from(proxy.auth).toString('base64')}`; + } + // The `Host` header should only include the port + // number when it is not the default port. + let { host, port, secureEndpoint } = opts; + if (!isDefaultPort(port, secureEndpoint)) { + host += `:${port}`; + } + headers.Host = host; + headers.Connection = 'close'; + for (const name of Object.keys(headers)) { + payload += `${name}: ${headers[name]}\r\n`; + } + const proxyResponsePromise = parse_proxy_response_1.default(socket); + socket.write(`${payload}\r\n`); + const { statusCode, buffered } = yield proxyResponsePromise; + if (statusCode === 200) { + req.once('socket', resume); + if (opts.secureEndpoint) { + const servername = opts.servername || opts.host; + if (!servername) { + throw new Error('Could not determine "servername"'); + } + // The proxy is connecting to a TLS server, so upgrade + // this socket connection to a TLS connection. + debug('Upgrading socket connection to TLS'); + return tls_1.default.connect(Object.assign(Object.assign({}, omit(opts, 'host', 'hostname', 'path', 'port')), { socket, + servername })); + } + return socket; + } + // Some other status code that's not 200... need to re-play the HTTP + // header "data" events onto the socket once the HTTP machinery is + // attached so that the node core `http` can parse and handle the + // error status code. + // Close the original socket, and a new "fake" socket is returned + // instead, so that the proxy doesn't get the HTTP request + // written to it (which may contain `Authorization` headers or other + // sensitive data). + // + // See: https://hackerone.com/reports/541502 + socket.destroy(); + const fakeSocket = new net_1.default.Socket(); + fakeSocket.readable = true; + // Need to wait for the "socket" event to re-play the "data" events. + req.once('socket', (s) => { + debug('replaying proxy buffer for failed request'); + assert_1.default(s.listenerCount('data') > 0); + // Replay the "buffered" Buffer onto the fake `socket`, since at + // this point the HTTP module machinery has been hooked up for + // the user. + s.push(buffered); + s.push(null); + }); + return fakeSocket; + }); + } +} +exports.default = HttpsProxyAgent; +function resume(socket) { + socket.resume(); +} +function isDefaultPort(port, secure) { + return Boolean((!secure && port === 80) || (secure && port === 443)); +} +function isHTTPS(protocol) { + return typeof protocol === 'string' ? /^https:?$/i.test(protocol) : false; +} +function omit(obj, ...keys) { + const ret = {}; + let key; + for (key in obj) { + if (!keys.includes(key)) { + ret[key] = obj[key]; + } + } + return ret; +} +//# sourceMappingURL=agent.js.map \ No newline at end of file diff --git a/deps/npm/node_modules/https-proxy-agent/dist/agent.js.map b/deps/npm/node_modules/https-proxy-agent/dist/agent.js.map new file mode 100644 index 00000000000000..d1307cdd8afae6 --- /dev/null +++ b/deps/npm/node_modules/https-proxy-agent/dist/agent.js.map @@ -0,0 +1 @@ +{"version":3,"file":"agent.js","sourceRoot":"","sources":["../src/agent.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,8CAAsB;AACtB,8CAAsB;AACtB,8CAAsB;AACtB,oDAA4B;AAC5B,kDAAgC;AAEhC,2CAAkE;AAElE,kFAAwD;AAExD,MAAM,KAAK,GAAG,eAAW,CAAC,yBAAyB,CAAC,CAAC;AAErD;;;;;;;;;;;;;GAaG;AACH,MAAqB,eAAgB,SAAQ,kBAAK;IAIjD,YAAY,KAAsC;QACjD,IAAI,IAA4B,CAAC;QACjC,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;YAC9B,IAAI,GAAG,aAAG,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;SACxB;aAAM;YACN,IAAI,GAAG,KAAK,CAAC;SACb;QACD,IAAI,CAAC,IAAI,EAAE;YACV,MAAM,IAAI,KAAK,CACd,8DAA8D,CAC9D,CAAC;SACF;QACD,KAAK,CAAC,2CAA2C,EAAE,IAAI,CAAC,CAAC;QACzD,KAAK,CAAC,IAAI,CAAC,CAAC;QAEZ,MAAM,KAAK,qBAAgC,IAAI,CAAE,CAAC;QAElD,wDAAwD;QACxD,uBAAuB;QACvB,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,WAAW,IAAI,OAAO,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;QAE/D,+DAA+D;QAC/D,KAAK,CAAC,IAAI,GAAG,KAAK,CAAC,QAAQ,IAAI,KAAK,CAAC,IAAI,CAAC;QAC1C,IAAI,OAAO,KAAK,CAAC,IAAI,KAAK,QAAQ,EAAE;YACnC,KAAK,CAAC,IAAI,GAAG,QAAQ,CAAC,KAAK,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;SACtC;QACD,IAAI,CAAC,KAAK,CAAC,IAAI,IAAI,KAAK,CAAC,IAAI,EAAE;YAC9B,KAAK,CAAC,IAAI,GAAG,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;SACzC;QAED,sCAAsC;QACtC,sEAAsE;QACtE,IAAI,IAAI,CAAC,WAAW,IAAI,CAAC,CAAC,eAAe,IAAI,KAAK,CAAC,EAAE;YACpD,KAAK,CAAC,aAAa,GAAG,CAAC,UAAU,CAAC,CAAC;SACnC;QAED,IAAI,KAAK,CAAC,IAAI,IAAI,KAAK,CAAC,IAAI,EAAE;YAC7B,kEAAkE;YAClE,8DAA8D;YAC9D,iEAAiE;YACjE,8BAA8B;YAC9B,OAAO,KAAK,CAAC,IAAI,CAAC;YAClB,OAAO,KAAK,CAAC,QAAQ,CAAC;SACtB;QAED,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACpB,CAAC;IAED;;;;;OAKG;IACG,QAAQ,CACb,GAAkB,EAClB,IAAoB;;YAEpB,MAAM,EAAE,KAAK,EAAE,WAAW,EAAE,GAAG,IAAI,CAAC;YAEpC,kDAAkD;YAClD,IAAI,MAAkB,CAAC;YACvB,IAAI,WAAW,EAAE;gBAChB,KAAK,CAAC,2BAA2B,EAAE,KAAK,CAAC,CAAC;gBAC1C,MAAM,GAAG,aAAG,CAAC,OAAO,CAAC,KAA8B,CAAC,CAAC;aACrD;iBAAM;gBACN,KAAK,CAAC,2BAA2B,EAAE,KAAK,CAAC,CAAC;gBAC1C,MAAM,GAAG,aAAG,CAAC,OAAO,CAAC,KAA2B,CAAC,CAAC;aAClD;YAED,MAAM,OAAO,qBAA6B,KAAK,CAAC,OAAO,CAAE,CAAC;YAC1D,MAAM,QAAQ,GAAG,GAAG,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC;YAC7C,IAAI,OAAO,GAAG,WAAW,QAAQ,eAAe,CAAC;YAEjD,wDAAwD;YACxD,IAAI,KAAK,CAAC,IAAI,EAAE;gBACf,OAAO,CAAC,qBAAqB,CAAC,GAAG,SAAS,MAAM,CAAC,IAAI,CACpD,KAAK,CAAC,IAAI,CACV,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE,CAAC;aACvB;YAED,iDAAiD;YACjD,0CAA0C;YAC1C,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,cAAc,EAAE,GAAG,IAAI,CAAC;YAC1C,IAAI,CAAC,aAAa,CAAC,IAAI,EAAE,cAAc,CAAC,EAAE;gBACzC,IAAI,IAAI,IAAI,IAAI,EAAE,CAAC;aACnB;YACD,OAAO,CAAC,IAAI,GAAG,IAAI,CAAC;YAEpB,OAAO,CAAC,UAAU,GAAG,OAAO,CAAC;YAC7B,KAAK,MAAM,IAAI,IAAI,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE;gBACxC,OAAO,IAAI,GAAG,IAAI,KAAK,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC;aAC3C;YAED,MAAM,oBAAoB,GAAG,8BAAkB,CAAC,MAAM,CAAC,CAAC;YAExD,MAAM,CAAC,KAAK,CAAC,GAAG,OAAO,MAAM,CAAC,CAAC;YAE/B,MAAM,EACL,UAAU,EACV,QAAQ,EACR,GAAG,MAAM,oBAAoB,CAAC;YAE/B,IAAI,UAAU,KAAK,GAAG,EAAE;gBACvB,GAAG,CAAC,IAAI,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;gBAE3B,IAAI,IAAI,CAAC,cAAc,EAAE;oBACxB,MAAM,UAAU,GAAG,IAAI,CAAC,UAAU,IAAI,IAAI,CAAC,IAAI,CAAC;oBAChD,IAAI,CAAC,UAAU,EAAE;wBAChB,MAAM,IAAI,KAAK,CAAC,kCAAkC,CAAC,CAAC;qBACpD;oBACD,sDAAsD;oBACtD,8CAA8C;oBAC9C,KAAK,CAAC,oCAAoC,CAAC,CAAC;oBAC5C,OAAO,aAAG,CAAC,OAAO,iCACd,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,CAAC,KACjD,MAAM;wBACN,UAAU,IACT,CAAC;iBACH;gBAED,OAAO,MAAM,CAAC;aACd;YAED,oEAAoE;YACpE,kEAAkE;YAClE,iEAAiE;YACjE,qBAAqB;YAErB,iEAAiE;YACjE,0DAA0D;YAC1D,oEAAoE;YACpE,mBAAmB;YACnB,EAAE;YACF,4CAA4C;YAC5C,MAAM,CAAC,OAAO,EAAE,CAAC;YAEjB,MAAM,UAAU,GAAG,IAAI,aAAG,CAAC,MAAM,EAAE,CAAC;YACpC,UAAU,CAAC,QAAQ,GAAG,IAAI,CAAC;YAE3B,oEAAoE;YACpE,GAAG,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAa,EAAE,EAAE;gBACpC,KAAK,CAAC,2CAA2C,CAAC,CAAC;gBACnD,gBAAM,CAAC,CAAC,CAAC,aAAa,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC;gBAEpC,gEAAgE;gBAChE,8DAA8D;gBAC9D,YAAY;gBACZ,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;gBACjB,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YACd,CAAC,CAAC,CAAC;YAEH,OAAO,UAAU,CAAC;QACnB,CAAC;KAAA;CACD;AA9JD,kCA8JC;AAED,SAAS,MAAM,CAAC,MAAkC;IACjD,MAAM,CAAC,MAAM,EAAE,CAAC;AACjB,CAAC;AAED,SAAS,aAAa,CAAC,IAAY,EAAE,MAAe;IACnD,OAAO,OAAO,CAAC,CAAC,CAAC,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC,IAAI,CAAC,MAAM,IAAI,IAAI,KAAK,GAAG,CAAC,CAAC,CAAC;AACtE,CAAC;AAED,SAAS,OAAO,CAAC,QAAwB;IACxC,OAAO,OAAO,QAAQ,KAAK,QAAQ,CAAC,CAAC,CAAC,YAAY,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;AAC3E,CAAC;AAED,SAAS,IAAI,CACZ,GAAM,EACN,GAAG,IAAO;IAIV,MAAM,GAAG,GAAG,EAEX,CAAC;IACF,IAAI,GAAqB,CAAC;IAC1B,KAAK,GAAG,IAAI,GAAG,EAAE;QAChB,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE;YACxB,GAAG,CAAC,GAAG,CAAC,GAAG,GAAG,CAAC,GAAG,CAAC,CAAC;SACpB;KACD;IACD,OAAO,GAAG,CAAC;AACZ,CAAC"} \ No newline at end of file diff --git a/deps/npm/node_modules/https-proxy-agent/dist/index.d.ts b/deps/npm/node_modules/https-proxy-agent/dist/index.d.ts new file mode 100644 index 00000000000000..0d60062ee20794 --- /dev/null +++ b/deps/npm/node_modules/https-proxy-agent/dist/index.d.ts @@ -0,0 +1,23 @@ +/// +import net from 'net'; +import tls from 'tls'; +import { Url } from 'url'; +import { AgentOptions } from 'agent-base'; +import { OutgoingHttpHeaders } from 'http'; +import _HttpsProxyAgent from './agent'; +declare function createHttpsProxyAgent(opts: string | createHttpsProxyAgent.HttpsProxyAgentOptions): _HttpsProxyAgent; +declare namespace createHttpsProxyAgent { + interface BaseHttpsProxyAgentOptions { + headers?: OutgoingHttpHeaders; + secureProxy?: boolean; + host?: string | null; + path?: string | null; + port?: string | number | null; + } + export interface HttpsProxyAgentOptions extends AgentOptions, BaseHttpsProxyAgentOptions, Partial> { + } + export type HttpsProxyAgent = _HttpsProxyAgent; + export const HttpsProxyAgent: typeof _HttpsProxyAgent; + export {}; +} +export = createHttpsProxyAgent; diff --git a/deps/npm/node_modules/https-proxy-agent/dist/index.js b/deps/npm/node_modules/https-proxy-agent/dist/index.js new file mode 100644 index 00000000000000..b03e7631a45a45 --- /dev/null +++ b/deps/npm/node_modules/https-proxy-agent/dist/index.js @@ -0,0 +1,14 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +const agent_1 = __importDefault(require("./agent")); +function createHttpsProxyAgent(opts) { + return new agent_1.default(opts); +} +(function (createHttpsProxyAgent) { + createHttpsProxyAgent.HttpsProxyAgent = agent_1.default; + createHttpsProxyAgent.prototype = agent_1.default.prototype; +})(createHttpsProxyAgent || (createHttpsProxyAgent = {})); +module.exports = createHttpsProxyAgent; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/deps/npm/node_modules/https-proxy-agent/dist/index.js.map b/deps/npm/node_modules/https-proxy-agent/dist/index.js.map new file mode 100644 index 00000000000000..f3ce559de0200d --- /dev/null +++ b/deps/npm/node_modules/https-proxy-agent/dist/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;AAKA,oDAAuC;AAEvC,SAAS,qBAAqB,CAC7B,IAA2D;IAE3D,OAAO,IAAI,eAAgB,CAAC,IAAI,CAAC,CAAC;AACnC,CAAC;AAED,WAAU,qBAAqB;IAoBjB,qCAAe,GAAG,eAAgB,CAAC;IAEhD,qBAAqB,CAAC,SAAS,GAAG,eAAgB,CAAC,SAAS,CAAC;AAC9D,CAAC,EAvBS,qBAAqB,KAArB,qBAAqB,QAuB9B;AAED,iBAAS,qBAAqB,CAAC"} \ No newline at end of file diff --git a/deps/npm/node_modules/https-proxy-agent/dist/parse-proxy-response.d.ts b/deps/npm/node_modules/https-proxy-agent/dist/parse-proxy-response.d.ts new file mode 100644 index 00000000000000..7565674a338cb1 --- /dev/null +++ b/deps/npm/node_modules/https-proxy-agent/dist/parse-proxy-response.d.ts @@ -0,0 +1,7 @@ +/// +import { Readable } from 'stream'; +export interface ProxyResponse { + statusCode: number; + buffered: Buffer; +} +export default function parseProxyResponse(socket: Readable): Promise; diff --git a/deps/npm/node_modules/https-proxy-agent/dist/parse-proxy-response.js b/deps/npm/node_modules/https-proxy-agent/dist/parse-proxy-response.js new file mode 100644 index 00000000000000..aa5ce3cc2d371f --- /dev/null +++ b/deps/npm/node_modules/https-proxy-agent/dist/parse-proxy-response.js @@ -0,0 +1,66 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const debug_1 = __importDefault(require("debug")); +const debug = debug_1.default('https-proxy-agent:parse-proxy-response'); +function parseProxyResponse(socket) { + return new Promise((resolve, reject) => { + // we need to buffer any HTTP traffic that happens with the proxy before we get + // the CONNECT response, so that if the response is anything other than an "200" + // response code, then we can re-play the "data" events on the socket once the + // HTTP parser is hooked up... + let buffersLength = 0; + const buffers = []; + function read() { + const b = socket.read(); + if (b) + ondata(b); + else + socket.once('readable', read); + } + function cleanup() { + socket.removeListener('end', onend); + socket.removeListener('error', onerror); + socket.removeListener('close', onclose); + socket.removeListener('readable', read); + } + function onclose(err) { + debug('onclose had error %o', err); + } + function onend() { + debug('onend'); + } + function onerror(err) { + cleanup(); + debug('onerror %o', err); + reject(err); + } + function ondata(b) { + buffers.push(b); + buffersLength += b.length; + const buffered = Buffer.concat(buffers, buffersLength); + const endOfHeaders = buffered.indexOf('\r\n\r\n'); + if (endOfHeaders === -1) { + // keep buffering + debug('have not received end of HTTP headers yet...'); + read(); + return; + } + const firstLine = buffered.toString('ascii', 0, buffered.indexOf('\r\n')); + const statusCode = +firstLine.split(' ')[1]; + debug('got proxy server response: %o', firstLine); + resolve({ + statusCode, + buffered + }); + } + socket.on('error', onerror); + socket.on('close', onclose); + socket.on('end', onend); + read(); + }); +} +exports.default = parseProxyResponse; +//# sourceMappingURL=parse-proxy-response.js.map \ No newline at end of file diff --git a/deps/npm/node_modules/https-proxy-agent/dist/parse-proxy-response.js.map b/deps/npm/node_modules/https-proxy-agent/dist/parse-proxy-response.js.map new file mode 100644 index 00000000000000..bacdb84b9ec2fd --- /dev/null +++ b/deps/npm/node_modules/https-proxy-agent/dist/parse-proxy-response.js.map @@ -0,0 +1 @@ +{"version":3,"file":"parse-proxy-response.js","sourceRoot":"","sources":["../src/parse-proxy-response.ts"],"names":[],"mappings":";;;;;AAAA,kDAAgC;AAGhC,MAAM,KAAK,GAAG,eAAW,CAAC,wCAAwC,CAAC,CAAC;AAOpE,SAAwB,kBAAkB,CACzC,MAAgB;IAEhB,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QACtC,+EAA+E;QAC/E,gFAAgF;QAChF,8EAA8E;QAC9E,8BAA8B;QAC9B,IAAI,aAAa,GAAG,CAAC,CAAC;QACtB,MAAM,OAAO,GAAa,EAAE,CAAC;QAE7B,SAAS,IAAI;YACZ,MAAM,CAAC,GAAG,MAAM,CAAC,IAAI,EAAE,CAAC;YACxB,IAAI,CAAC;gBAAE,MAAM,CAAC,CAAC,CAAC,CAAC;;gBACZ,MAAM,CAAC,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC;QACpC,CAAC;QAED,SAAS,OAAO;YACf,MAAM,CAAC,cAAc,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;YACpC,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;YACxC,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;YACxC,MAAM,CAAC,cAAc,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC;QACzC,CAAC;QAED,SAAS,OAAO,CAAC,GAAW;YAC3B,KAAK,CAAC,sBAAsB,EAAE,GAAG,CAAC,CAAC;QACpC,CAAC;QAED,SAAS,KAAK;YACb,KAAK,CAAC,OAAO,CAAC,CAAC;QAChB,CAAC;QAED,SAAS,OAAO,CAAC,GAAU;YAC1B,OAAO,EAAE,CAAC;YACV,KAAK,CAAC,YAAY,EAAE,GAAG,CAAC,CAAC;YACzB,MAAM,CAAC,GAAG,CAAC,CAAC;QACb,CAAC;QAED,SAAS,MAAM,CAAC,CAAS;YACxB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;YAChB,aAAa,IAAI,CAAC,CAAC,MAAM,CAAC;YAE1B,MAAM,QAAQ,GAAG,MAAM,CAAC,MAAM,CAAC,OAAO,EAAE,aAAa,CAAC,CAAC;YACvD,MAAM,YAAY,GAAG,QAAQ,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;YAElD,IAAI,YAAY,KAAK,CAAC,CAAC,EAAE;gBACxB,iBAAiB;gBACjB,KAAK,CAAC,8CAA8C,CAAC,CAAC;gBACtD,IAAI,EAAE,CAAC;gBACP,OAAO;aACP;YAED,MAAM,SAAS,GAAG,QAAQ,CAAC,QAAQ,CAClC,OAAO,EACP,CAAC,EACD,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,CACxB,CAAC;YACF,MAAM,UAAU,GAAG,CAAC,SAAS,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;YAC5C,KAAK,CAAC,+BAA+B,EAAE,SAAS,CAAC,CAAC;YAClD,OAAO,CAAC;gBACP,UAAU;gBACV,QAAQ;aACR,CAAC,CAAC;QACJ,CAAC;QAED,MAAM,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QAC5B,MAAM,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QAC5B,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;QAExB,IAAI,EAAE,CAAC;IACR,CAAC,CAAC,CAAC;AACJ,CAAC;AAvED,qCAuEC"} \ No newline at end of file diff --git a/deps/npm/node_modules/https-proxy-agent/index.d.ts b/deps/npm/node_modules/https-proxy-agent/index.d.ts deleted file mode 100644 index cec35d85e0f614..00000000000000 --- a/deps/npm/node_modules/https-proxy-agent/index.d.ts +++ /dev/null @@ -1,22 +0,0 @@ -declare module 'https-proxy-agent' { - import * as https from 'https'; - - namespace HttpsProxyAgent { - interface HttpsProxyAgentOptions { - host: string; - port: number | string; - secureProxy?: boolean; - headers?: { - [key: string]: string; - }; - [key: string]: any; - } - } - - // HttpsProxyAgent doesnt *actually* extend https.Agent, but for my purposes I want it to pretend that it does - class HttpsProxyAgent extends https.Agent { - constructor(opts: HttpsProxyAgent.HttpsProxyAgentOptions | string); - } - - export = HttpsProxyAgent; -} diff --git a/deps/npm/node_modules/https-proxy-agent/index.js b/deps/npm/node_modules/https-proxy-agent/index.js deleted file mode 100644 index 817a0a9232060c..00000000000000 --- a/deps/npm/node_modules/https-proxy-agent/index.js +++ /dev/null @@ -1,241 +0,0 @@ -/** - * Module dependencies. - */ - -var net = require('net'); -var tls = require('tls'); -var url = require('url'); -var assert = require('assert'); -var Agent = require('agent-base'); -var inherits = require('util').inherits; -var debug = require('debug')('https-proxy-agent'); - -/** - * Module exports. - */ - -module.exports = HttpsProxyAgent; - -/** - * The `HttpsProxyAgent` implements an HTTP Agent subclass that connects to the - * specified "HTTP(s) proxy server" in order to proxy HTTPS requests. - * - * @api public - */ - -function HttpsProxyAgent(opts) { - if (!(this instanceof HttpsProxyAgent)) return new HttpsProxyAgent(opts); - if ('string' == typeof opts) opts = url.parse(opts); - if (!opts) - throw new Error( - 'an HTTP(S) proxy server `host` and `port` must be specified!' - ); - debug('creating new HttpsProxyAgent instance: %o', opts); - Agent.call(this, opts); - - var proxy = Object.assign({}, opts); - - // if `true`, then connect to the proxy server over TLS. defaults to `false`. - this.secureProxy = proxy.protocol - ? /^https:?$/i.test(proxy.protocol) - : false; - - // prefer `hostname` over `host`, and set the `port` if needed - proxy.host = proxy.hostname || proxy.host; - proxy.port = +proxy.port || (this.secureProxy ? 443 : 80); - - // ALPN is supported by Node.js >= v5. - // attempt to negotiate http/1.1 for proxy servers that support http/2 - if (this.secureProxy && !('ALPNProtocols' in proxy)) { - proxy.ALPNProtocols = ['http 1.1']; - } - - if (proxy.host && proxy.path) { - // if both a `host` and `path` are specified then it's most likely the - // result of a `url.parse()` call... we need to remove the `path` portion so - // that `net.connect()` doesn't attempt to open that as a unix socket file. - delete proxy.path; - delete proxy.pathname; - } - - this.proxy = proxy; - this.defaultPort = 443; -} -inherits(HttpsProxyAgent, Agent); - -/** - * Called when the node-core HTTP client library is creating a new HTTP request. - * - * @api public - */ - -HttpsProxyAgent.prototype.callback = function connect(req, opts, fn) { - var proxy = this.proxy; - - // create a socket connection to the proxy server - var socket; - if (this.secureProxy) { - socket = tls.connect(proxy); - } else { - socket = net.connect(proxy); - } - - // we need to buffer any HTTP traffic that happens with the proxy before we get - // the CONNECT response, so that if the response is anything other than an "200" - // response code, then we can re-play the "data" events on the socket once the - // HTTP parser is hooked up... - var buffers = []; - var buffersLength = 0; - - function read() { - var b = socket.read(); - if (b) ondata(b); - else socket.once('readable', read); - } - - function cleanup() { - socket.removeListener('end', onend); - socket.removeListener('error', onerror); - socket.removeListener('close', onclose); - socket.removeListener('readable', read); - } - - function onclose(err) { - debug('onclose had error %o', err); - } - - function onend() { - debug('onend'); - } - - function onerror(err) { - cleanup(); - fn(err); - } - - function ondata(b) { - buffers.push(b); - buffersLength += b.length; - var buffered = Buffer.concat(buffers, buffersLength); - var str = buffered.toString('ascii'); - - if (!~str.indexOf('\r\n\r\n')) { - // keep buffering - debug('have not received end of HTTP headers yet...'); - read(); - return; - } - - var firstLine = str.substring(0, str.indexOf('\r\n')); - var statusCode = +firstLine.split(' ')[1]; - debug('got proxy server response: %o', firstLine); - - if (200 == statusCode) { - // 200 Connected status code! - var sock = socket; - - // nullify the buffered data since we won't be needing it - buffers = buffered = null; - - if (opts.secureEndpoint) { - // since the proxy is connecting to an SSL server, we have - // to upgrade this socket connection to an SSL connection - debug( - 'upgrading proxy-connected socket to TLS connection: %o', - opts.host - ); - opts.socket = socket; - opts.servername = opts.servername || opts.host; - opts.host = null; - opts.hostname = null; - opts.port = null; - sock = tls.connect(opts); - } - - cleanup(); - req.once('socket', resume); - fn(null, sock); - } else { - // some other status code that's not 200... need to re-play the HTTP header - // "data" events onto the socket once the HTTP machinery is attached so - // that the node core `http` can parse and handle the error status code - cleanup(); - - // the original socket is closed, and a new closed socket is - // returned instead, so that the proxy doesn't get the HTTP request - // written to it (which may contain `Authorization` headers or other - // sensitive data). - // - // See: https://hackerone.com/reports/541502 - socket.destroy(); - socket = new net.Socket(); - socket.readable = true; - - - // save a reference to the concat'd Buffer for the `onsocket` callback - buffers = buffered; - - // need to wait for the "socket" event to re-play the "data" events - req.once('socket', onsocket); - - fn(null, socket); - } - } - - function onsocket(socket) { - debug('replaying proxy buffer for failed request'); - assert(socket.listenerCount('data') > 0); - - // replay the "buffers" Buffer onto the `socket`, since at this point - // the HTTP module machinery has been hooked up for the user - socket.push(buffers); - - // nullify the cached Buffer instance - buffers = null; - } - - socket.on('error', onerror); - socket.on('close', onclose); - socket.on('end', onend); - - read(); - - var hostname = opts.host + ':' + opts.port; - var msg = 'CONNECT ' + hostname + ' HTTP/1.1\r\n'; - - var headers = Object.assign({}, proxy.headers); - if (proxy.auth) { - headers['Proxy-Authorization'] = - 'Basic ' + Buffer.from(proxy.auth).toString('base64'); - } - - // the Host header should only include the port - // number when it is a non-standard port - var host = opts.host; - if (!isDefaultPort(opts.port, opts.secureEndpoint)) { - host += ':' + opts.port; - } - headers['Host'] = host; - - headers['Connection'] = 'close'; - Object.keys(headers).forEach(function(name) { - msg += name + ': ' + headers[name] + '\r\n'; - }); - - socket.write(msg + '\r\n'); -}; - -/** - * Resumes a socket. - * - * @param {(net.Socket|tls.Socket)} socket The socket to resume - * @api public - */ - -function resume(socket) { - socket.resume(); -} - -function isDefaultPort(port, secure) { - return Boolean((!secure && port === 80) || (secure && port === 443)); -} diff --git a/deps/npm/node_modules/https-proxy-agent/package.json b/deps/npm/node_modules/https-proxy-agent/package.json index 274df864b2161f..7872bdf902abf8 100644 --- a/deps/npm/node_modules/https-proxy-agent/package.json +++ b/deps/npm/node_modules/https-proxy-agent/package.json @@ -1,66 +1,56 @@ { - "_from": "https-proxy-agent@^2.2.3", - "_id": "https-proxy-agent@2.2.4", - "_inBundle": false, - "_integrity": "sha512-OmvfoQ53WLjtA9HeYP9RNrWMJzzAz1JGaSFr1nijg0PVR1JaD/xbJq1mdEIIlxGpXp9eSe/O2LgU9DJmTPd0Eg==", - "_location": "/https-proxy-agent", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "https-proxy-agent@^2.2.3", - "name": "https-proxy-agent", - "escapedName": "https-proxy-agent", - "rawSpec": "^2.2.3", - "saveSpec": null, - "fetchSpec": "^2.2.3" - }, - "_requiredBy": [ - "/make-fetch-happen" - ], - "_resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-2.2.4.tgz", - "_shasum": "4ee7a737abd92678a293d9b34a1af4d0d08c787b", - "_spec": "https-proxy-agent@^2.2.3", - "_where": "/Users/claudiahdz/npm/cli/node_modules/make-fetch-happen", - "author": { - "name": "Nathan Rajlich", - "email": "nathan@tootallnate.net", - "url": "http://n8.io/" - }, - "bugs": { - "url": "https://github.com/TooTallNate/node-https-proxy-agent/issues" - }, - "bundleDependencies": false, - "dependencies": { - "agent-base": "^4.3.0", - "debug": "^3.1.0" - }, - "deprecated": false, + "name": "https-proxy-agent", + "version": "5.0.0", "description": "An HTTP(s) proxy `http.Agent` implementation for HTTPS", - "devDependencies": { - "mocha": "^6.2.0", - "proxy": "1" + "main": "dist/index", + "types": "dist/index", + "files": [ + "dist" + ], + "scripts": { + "prebuild": "rimraf dist", + "build": "tsc", + "test": "mocha --reporter spec", + "test-lint": "eslint src --ext .js,.ts", + "prepublishOnly": "npm run build" }, - "engines": { - "node": ">= 4.5.0" + "repository": { + "type": "git", + "url": "git://github.com/TooTallNate/node-https-proxy-agent.git" }, - "homepage": "https://github.com/TooTallNate/node-https-proxy-agent#readme", "keywords": [ "https", "proxy", "endpoint", "agent" ], + "author": "Nathan Rajlich (http://n8.io/)", "license": "MIT", - "main": "./index.js", - "name": "https-proxy-agent", - "repository": { - "type": "git", - "url": "git://github.com/TooTallNate/node-https-proxy-agent.git" + "bugs": { + "url": "https://github.com/TooTallNate/node-https-proxy-agent/issues" }, - "scripts": { - "test": "mocha --reporter spec" + "dependencies": { + "agent-base": "6", + "debug": "4" }, - "types": "./index.d.ts", - "version": "2.2.4" + "devDependencies": { + "@types/debug": "4", + "@types/node": "^12.12.11", + "@typescript-eslint/eslint-plugin": "1.6.0", + "@typescript-eslint/parser": "1.1.0", + "eslint": "5.16.0", + "eslint-config-airbnb": "17.1.0", + "eslint-config-prettier": "4.1.0", + "eslint-import-resolver-typescript": "1.1.1", + "eslint-plugin-import": "2.16.0", + "eslint-plugin-jsx-a11y": "6.2.1", + "eslint-plugin-react": "7.12.4", + "mocha": "^6.2.2", + "proxy": "1", + "rimraf": "^3.0.0", + "typescript": "^3.5.3" + }, + "engines": { + "node": ">= 6" + } } diff --git a/deps/npm/node_modules/humanize-ms/package.json b/deps/npm/node_modules/humanize-ms/package.json index 7cb9c4aa837106..da4ab7f571a686 100644 --- a/deps/npm/node_modules/humanize-ms/package.json +++ b/deps/npm/node_modules/humanize-ms/package.json @@ -1,41 +1,31 @@ { - "_from": "humanize-ms@^1.2.1", - "_id": "humanize-ms@1.2.1", - "_inBundle": false, - "_integrity": "sha1-xG4xWaKT9riW2ikxbYtv6Lt5u+0=", - "_location": "/humanize-ms", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "humanize-ms@^1.2.1", - "name": "humanize-ms", - "escapedName": "humanize-ms", - "rawSpec": "^1.2.1", - "saveSpec": null, - "fetchSpec": "^1.2.1" + "name": "humanize-ms", + "version": "1.2.1", + "description": "transform humanize time to ms", + "main": "index.js", + "files": [ + "index.js" + ], + "scripts": { + "test": "make test" }, - "_requiredBy": [ - "/agentkeepalive" + "keywords": [ + "humanize", + "ms" ], - "_resolved": "https://registry.npmjs.org/humanize-ms/-/humanize-ms-1.2.1.tgz", - "_shasum": "c46e3159a293f6b896da29316d8b6fe8bb79bbed", - "_spec": "humanize-ms@^1.2.1", - "_where": "/Users/rebecca/code/npm/node_modules/agentkeepalive", "author": { "name": "dead-horse", "email": "dead_horse@qq.com", "url": "http://deadhorse.me" }, - "bugs": { - "url": "https://github.com/node-modules/humanize-ms/issues" + "repository": { + "type": "git", + "url": "https://github.com/node-modules/humanize-ms" }, - "bundleDependencies": false, + "license": "MIT", "dependencies": { "ms": "^2.0.0" }, - "deprecated": false, - "description": "transform humanize time to ms", "devDependencies": { "autod": "*", "beautify-benchmark": "~0.2.4", @@ -43,24 +33,5 @@ "istanbul": "*", "mocha": "*", "should": "*" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/node-modules/humanize-ms#readme", - "keywords": [ - "humanize", - "ms" - ], - "license": "MIT", - "main": "index.js", - "name": "humanize-ms", - "repository": { - "type": "git", - "url": "git+https://github.com/node-modules/humanize-ms.git" - }, - "scripts": { - "test": "make test" - }, - "version": "1.2.1" + } } diff --git a/deps/npm/node_modules/iconv-lite/.github/dependabot.yml b/deps/npm/node_modules/iconv-lite/.github/dependabot.yml new file mode 100644 index 00000000000000..e4a0e0afdff7c8 --- /dev/null +++ b/deps/npm/node_modules/iconv-lite/.github/dependabot.yml @@ -0,0 +1,11 @@ +# Please see the documentation for all configuration options: +# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates + +version: 2 +updates: + - package-ecosystem: "npm" + directory: "/" + schedule: + interval: "daily" + allow: + - dependency-type: production diff --git a/deps/npm/node_modules/iconv-lite/.travis.yml b/deps/npm/node_modules/iconv-lite/.travis.yml deleted file mode 100644 index 3eab7fdb3fcc6c..00000000000000 --- a/deps/npm/node_modules/iconv-lite/.travis.yml +++ /dev/null @@ -1,23 +0,0 @@ - sudo: false - language: node_js - node_js: - - "0.10" - - "0.11" - - "0.12" - - "iojs" - - "4" - - "6" - - "8" - - "node" - - - env: - - CXX=g++-4.8 - addons: - apt: - sources: - - ubuntu-toolchain-r-test - packages: - - gcc-4.8 - - g++-4.8 - diff --git a/deps/npm/node_modules/iconv-lite/Changelog.md b/deps/npm/node_modules/iconv-lite/Changelog.md index e31cd0c24e1f9c..7935778c87b8a7 100644 --- a/deps/npm/node_modules/iconv-lite/Changelog.md +++ b/deps/npm/node_modules/iconv-lite/Changelog.md @@ -1,46 +1,96 @@ +## 0.6.2 / 2020-07-08 + * Support Uint8Array-s decoding without conversion to Buffers, plus fix an edge case. -# 0.4.23 / 2018-05-07 + +## 0.6.1 / 2020-06-28 + * Support Uint8Array-s directly when decoding (#246, by @gyzerok) + * Unify package.json version ranges to be strictly semver-compatible (#241) + * Fix minor issue in UTF-32 decoder's endianness detection code. + + +## 0.6.0 / 2020-06-08 + * Updated 'gb18030' encoding to :2005 edition (see https://github.com/whatwg/encoding/issues/22). + * Removed `iconv.extendNodeEncodings()` mechanism. It was deprecated 5 years ago and didn't work + in recent Node versions. + * Reworked Streaming API behavior in browser environments to fix #204. Streaming API will be + excluded by default in browser packs, saving ~100Kb bundle size, unless enabled explicitly using + `iconv.enableStreamingAPI(require('stream'))`. + * Updates to development environment & tests: + * Added ./test/webpack private package to test complex new use cases that need custom environment. + It's tested as a separate job in Travis CI. + * Updated generation code for the new EUC-KR index file format from Encoding Standard. + * Removed Buffer() constructor in tests (#197 by @gabrielschulhof). + + +## 0.5.2 / 2020-06-08 + * Added `iconv.getEncoder()` and `iconv.getDecoder()` methods to typescript definitions (#229). + * Fixed semver version to 6.1.2 to support Node 8.x (by @tanandara). + * Capped iconv version to 2.x as 3.x has dropped support for older Node versions. + * Switched from instanbul to c8 for code coverage. + + +## 0.5.1 / 2020-01-18 + + * Added cp720 encoding (#221, by @kr-deps) + * (minor) Changed Changelog.md formatting to use h2. + + +## 0.5.0 / 2019-06-26 + + * Added UTF-32 encoding, both little-endian and big-endian variants (UTF-32LE, UTF32-BE). If endianness + is not provided for decoding, it's deduced automatically from the stream using a heuristic similar to + what we use in UTF-16. (great work in #216 by @kshetline) + * Several minor updates to README (#217 by @oldj, plus some more) + * Added Node versions 10 and 12 to Travis test harness. + + +## 0.4.24 / 2018-08-22 + + * Added MIK encoding (#196, by @Ivan-Kalatchev) + + +## 0.4.23 / 2018-05-07 * Fix deprecation warning in Node v10 due to the last usage of `new Buffer` (#185, by @felixbuenemann) * Switched from NodeBuffer to Buffer in typings (#155 by @felixfbecker, #186 by @larssn) -# 0.4.22 / 2018-05-05 +## 0.4.22 / 2018-05-05 * Use older semver style for dependencies to be compatible with Node version 0.10 (#182, by @dougwilson) * Fix tests to accomodate fixes in Node v10 (#182, by @dougwilson) -# 0.4.21 / 2018-04-06 +## 0.4.21 / 2018-04-06 * Fix encoding canonicalization (#156) * Fix the paths in the "browser" field in package.json (#174 by @LMLB) * Removed "contributors" section in package.json - see Git history instead. -# 0.4.20 / 2018-04-06 +## 0.4.20 / 2018-04-06 * Updated `new Buffer()` usages with recommended replacements as it's being deprecated in Node v10 (#176, #178 by @ChALkeR) -# 0.4.19 / 2017-09-09 +## 0.4.19 / 2017-09-09 * Fixed iso8859-1 codec regression in handling untranslatable characters (#162, caused by #147) * Re-generated windows1255 codec, because it was updated in iconv project * Fixed grammar in error message when iconv-lite is loaded with encoding other than utf8 -# 0.4.18 / 2017-06-13 +## 0.4.18 / 2017-06-13 * Fixed CESU-8 regression in Node v8. -# 0.4.17 / 2017-04-22 +## 0.4.17 / 2017-04-22 * Updated typescript definition file to support Angular 2 AoT mode (#153 by @larssn) -# 0.4.16 / 2017-04-22 +## 0.4.16 / 2017-04-22 * Added support for React Native (#150) * Changed iso8859-1 encoding to usine internal 'binary' encoding, as it's the same thing (#147 by @mscdex) @@ -49,12 +99,12 @@ * Added a warning if iconv-lite is loaded not as utf-8 (see #142) -# 0.4.15 / 2016-11-21 +## 0.4.15 / 2016-11-21 * Fixed typescript type definition (#137) -# 0.4.14 / 2016-11-20 +## 0.4.14 / 2016-11-20 * Preparation for v1.0 * Added Node v6 and latest Node versions to Travis CI test rig @@ -64,12 +114,12 @@ * Add ms prefix to dbcs windows encodings (@rokoroku) -# 0.4.13 / 2015-10-01 +## 0.4.13 / 2015-10-01 * Fix silly mistake in deprecation notice. -# 0.4.12 / 2015-09-26 +## 0.4.12 / 2015-09-26 * Node v4 support: * Added CESU-8 decoding (#106) @@ -77,18 +127,18 @@ * Added Travis tests for Node v4 and io.js latest (#105 by @Mithgol) -# 0.4.11 / 2015-07-03 +## 0.4.11 / 2015-07-03 * Added CESU-8 encoding. -# 0.4.10 / 2015-05-26 +## 0.4.10 / 2015-05-26 * Changed UTF-16 endianness heuristic to take into account any ASCII chars, not just spaces. This should minimize the importance of "default" endianness. -# 0.4.9 / 2015-05-24 +## 0.4.9 / 2015-05-24 * Streamlined BOM handling: strip BOM by default, add BOM when encoding if addBOM: true. Added docs to Readme. @@ -100,12 +150,12 @@ * Use strict mode in all files. -# 0.4.8 / 2015-04-14 +## 0.4.8 / 2015-04-14 * added alias UNICODE-1-1-UTF-7 for UTF-7 encoding (#94) -# 0.4.7 / 2015-02-05 +## 0.4.7 / 2015-02-05 * stop official support of Node.js v0.8. Should still work, but no guarantees. reason: Packages needed for testing are hard to get on Travis CI. @@ -113,40 +163,40 @@ props (#89). -# 0.4.6 / 2015-01-12 +## 0.4.6 / 2015-01-12 * fix rare aliases of single-byte encodings (thanks @mscdex) * double the timeout for dbcs tests to make them less flaky on travis -# 0.4.5 / 2014-11-20 +## 0.4.5 / 2014-11-20 * fix windows-31j and x-sjis encoding support (@nleush) * minor fix: undefined variable reference when internal error happens -# 0.4.4 / 2014-07-16 +## 0.4.4 / 2014-07-16 * added encodings UTF-7 (RFC2152) and UTF-7-IMAP (RFC3501 Section 5.1.3) * fixed streaming base64 encoding -# 0.4.3 / 2014-06-14 +## 0.4.3 / 2014-06-14 * added encodings UTF-16BE and UTF-16 with BOM -# 0.4.2 / 2014-06-12 +## 0.4.2 / 2014-06-12 * don't throw exception if `extendNodeEncodings()` is called more than once -# 0.4.1 / 2014-06-11 +## 0.4.1 / 2014-06-11 * codepage 808 added -# 0.4.0 / 2014-06-10 +## 0.4.0 / 2014-06-10 * code is rewritten from scratch * all widespread encodings are supported diff --git a/deps/npm/node_modules/iconv-lite/README.md b/deps/npm/node_modules/iconv-lite/README.md index c981c3708582a5..aa01122380635a 100644 --- a/deps/npm/node_modules/iconv-lite/README.md +++ b/deps/npm/node_modules/iconv-lite/README.md @@ -1,38 +1,40 @@ -## Pure JS character encoding conversion [![Build Status](https://travis-ci.org/ashtuchkin/iconv-lite.svg?branch=master)](https://travis-ci.org/ashtuchkin/iconv-lite) +## iconv-lite: Pure JS character encoding conversion - * Doesn't need native code compilation. Works on Windows and in sandboxed environments like [Cloud9](http://c9.io). + * No need for native code compilation. Quick to install, works on Windows and in sandboxed environments like [Cloud9](http://c9.io). * Used in popular projects like [Express.js (body_parser)](https://github.com/expressjs/body-parser), [Grunt](http://gruntjs.com/), [Nodemailer](http://www.nodemailer.com/), [Yeoman](http://yeoman.io/) and others. * Faster than [node-iconv](https://github.com/bnoordhuis/node-iconv) (see below for performance comparison). - * Intuitive encode/decode API - * Streaming support for Node v0.10+ - * [Deprecated] Can extend Node.js primitives (buffers, streams) to support all iconv-lite encodings. - * In-browser usage via [Browserify](https://github.com/substack/node-browserify) (~180k gzip compressed with Buffer shim included). + * Intuitive encode/decode API, including Streaming support. + * In-browser usage via [browserify](https://github.com/substack/node-browserify) or [webpack](https://webpack.js.org/) (~180kb gzip compressed with Buffer shim included). * Typescript [type definition file](https://github.com/ashtuchkin/iconv-lite/blob/master/lib/index.d.ts) included. - * React Native is supported (need to explicitly `npm install` two more modules: `buffer` and `stream`). + * React Native is supported (need to install `stream` module to enable Streaming API). * License: MIT. -[![NPM Stats](https://nodei.co/npm/iconv-lite.png?downloads=true&downloadRank=true)](https://npmjs.org/packages/iconv-lite/) +[![NPM Stats](https://nodei.co/npm/iconv-lite.png)](https://npmjs.org/package/iconv-lite/) +[![Build Status](https://travis-ci.org/ashtuchkin/iconv-lite.svg?branch=master)](https://travis-ci.org/ashtuchkin/iconv-lite) +[![npm](https://img.shields.io/npm/v/iconv-lite.svg)](https://npmjs.org/package/iconv-lite/) +[![npm downloads](https://img.shields.io/npm/dm/iconv-lite.svg)](https://npmjs.org/package/iconv-lite/) +[![npm bundle size](https://img.shields.io/bundlephobia/min/iconv-lite.svg)](https://npmjs.org/package/iconv-lite/) ## Usage ### Basic API ```javascript var iconv = require('iconv-lite'); -// Convert from an encoded buffer to js string. +// Convert from an encoded buffer to a js string. str = iconv.decode(Buffer.from([0x68, 0x65, 0x6c, 0x6c, 0x6f]), 'win1251'); -// Convert from js string to an encoded buffer. +// Convert from a js string to an encoded buffer. buf = iconv.encode("Sample input string", 'win1251'); // Check if encoding is supported iconv.encodingExists("us-ascii") ``` -### Streaming API (Node v0.10+) +### Streaming API ```javascript -// Decode stream (from binary stream to js strings) +// Decode stream (from binary data stream to js strings) http.createServer(function(req, res) { var converterStream = iconv.decodeStream('win1251'); req.pipe(converterStream); @@ -57,44 +59,10 @@ http.createServer(function(req, res) { }); ``` -### [Deprecated] Extend Node.js own encodings -> NOTE: This doesn't work on latest Node versions. See [details](https://github.com/ashtuchkin/iconv-lite/wiki/Node-v4-compatibility). - -```javascript -// After this call all Node basic primitives will understand iconv-lite encodings. -iconv.extendNodeEncodings(); - -// Examples: -buf = new Buffer(str, 'win1251'); -buf.write(str, 'gbk'); -str = buf.toString('latin1'); -assert(Buffer.isEncoding('iso-8859-15')); -Buffer.byteLength(str, 'us-ascii'); - -http.createServer(function(req, res) { - req.setEncoding('big5'); - req.collect(function(err, body) { - console.log(body); - }); -}); - -fs.createReadStream("file.txt", "shift_jis"); - -// External modules are also supported (if they use Node primitives, which they probably do). -request = require('request'); -request({ - url: "http://github.com/", - encoding: "cp932" -}); - -// To remove extensions -iconv.undoExtendNodeEncodings(); -``` - ## Supported encodings * All node.js native encodings: utf8, ucs2 / utf16-le, ascii, binary, base64, hex. - * Additional unicode encodings: utf16, utf16-be, utf-7, utf-7-imap. + * Additional unicode encodings: utf16, utf16-be, utf-7, utf-7-imap, utf32, utf32-le, and utf32-be. * All widespread singlebyte encodings: Windows 125x family, ISO-8859 family, IBM/DOS codepages, Macintosh family, KOI8 family, all others supported by iconv library. Aliases like 'latin1', 'us-ascii' also supported. @@ -133,6 +101,12 @@ smart about endianness in the following ways: overridden with `defaultEncoding: 'utf-16be'` option. Strips BOM unless `stripBOM: false`. * Encoding: uses UTF-16LE and writes BOM by default. Use `addBOM: false` to override. +## UTF-32 Encodings + +This library supports UTF-32LE, UTF-32BE and UTF-32 encodings. Like the UTF-16 encoding above, UTF-32 defaults to UTF-32LE, but uses BOM and 'spaces heuristics' to determine input endianness. + * The default of UTF-32LE can be overridden with the `defaultEncoding: 'utf-32be'` option. Strips BOM unless `stripBOM: false`. + * Encoding: uses UTF-32LE and writes BOM by default. Use `addBOM: false` to override. (`defaultEncoding: 'utf-32be'` can also be used here to change encoding.) + ## Other notes When decoding, be sure to supply a Buffer to decode() method, otherwise [bad things usually happen](https://github.com/ashtuchkin/iconv-lite/wiki/Use-Buffers-when-decoding). diff --git a/deps/npm/node_modules/iconv-lite/encodings/dbcs-codec.js b/deps/npm/node_modules/iconv-lite/encodings/dbcs-codec.js index 1fe3e160112aa9..825a4b83d071e6 100644 --- a/deps/npm/node_modules/iconv-lite/encodings/dbcs-codec.js +++ b/deps/npm/node_modules/iconv-lite/encodings/dbcs-codec.js @@ -49,6 +49,48 @@ function DBCSCodec(codecOptions, iconv) { for (var i = 0; i < mappingTable.length; i++) this._addDecodeChunk(mappingTable[i]); + // Load & create GB18030 tables when needed. + if (typeof codecOptions.gb18030 === 'function') { + this.gb18030 = codecOptions.gb18030(); // Load GB18030 ranges. + + // Add GB18030 common decode nodes. + var commonThirdByteNodeIdx = this.decodeTables.length; + this.decodeTables.push(UNASSIGNED_NODE.slice(0)); + + var commonFourthByteNodeIdx = this.decodeTables.length; + this.decodeTables.push(UNASSIGNED_NODE.slice(0)); + + // Fill out the tree + var firstByteNode = this.decodeTables[0]; + for (var i = 0x81; i <= 0xFE; i++) { + var secondByteNode = this.decodeTables[NODE_START - firstByteNode[i]]; + for (var j = 0x30; j <= 0x39; j++) { + if (secondByteNode[j] === UNASSIGNED) { + secondByteNode[j] = NODE_START - commonThirdByteNodeIdx; + } else if (secondByteNode[j] > NODE_START) { + throw new Error("gb18030 decode tables conflict at byte 2"); + } + + var thirdByteNode = this.decodeTables[NODE_START - secondByteNode[j]]; + for (var k = 0x81; k <= 0xFE; k++) { + if (thirdByteNode[k] === UNASSIGNED) { + thirdByteNode[k] = NODE_START - commonFourthByteNodeIdx; + } else if (thirdByteNode[k] === NODE_START - commonFourthByteNodeIdx) { + continue; + } else if (thirdByteNode[k] > NODE_START) { + throw new Error("gb18030 decode tables conflict at byte 3"); + } + + var fourthByteNode = this.decodeTables[NODE_START - thirdByteNode[k]]; + for (var l = 0x30; l <= 0x39; l++) { + if (fourthByteNode[l] === UNASSIGNED) + fourthByteNode[l] = GB18030_CODE; + } + } + } + } + } + this.defaultCharUnicode = iconv.defaultCharUnicode; @@ -92,30 +134,6 @@ function DBCSCodec(codecOptions, iconv) { this.defCharSB = this.encodeTable[0][iconv.defaultCharSingleByte.charCodeAt(0)]; if (this.defCharSB === UNASSIGNED) this.defCharSB = this.encodeTable[0]['?']; if (this.defCharSB === UNASSIGNED) this.defCharSB = "?".charCodeAt(0); - - - // Load & create GB18030 tables when needed. - if (typeof codecOptions.gb18030 === 'function') { - this.gb18030 = codecOptions.gb18030(); // Load GB18030 ranges. - - // Add GB18030 decode tables. - var thirdByteNodeIdx = this.decodeTables.length; - var thirdByteNode = this.decodeTables[thirdByteNodeIdx] = UNASSIGNED_NODE.slice(0); - - var fourthByteNodeIdx = this.decodeTables.length; - var fourthByteNode = this.decodeTables[fourthByteNodeIdx] = UNASSIGNED_NODE.slice(0); - - for (var i = 0x81; i <= 0xFE; i++) { - var secondByteNodeIdx = NODE_START - this.decodeTables[0][i]; - var secondByteNode = this.decodeTables[secondByteNodeIdx]; - for (var j = 0x30; j <= 0x39; j++) - secondByteNode[j] = NODE_START - thirdByteNodeIdx; - } - for (var i = 0x81; i <= 0xFE; i++) - thirdByteNode[i] = NODE_START - fourthByteNodeIdx; - for (var i = 0x30; i <= 0x39; i++) - fourthByteNode[i] = GB18030_CODE - } } DBCSCodec.prototype.encoder = DBCSEncoder; @@ -124,7 +142,7 @@ DBCSCodec.prototype.decoder = DBCSDecoder; // Decoder helpers DBCSCodec.prototype._getDecodeTrieNode = function(addr) { var bytes = []; - for (; addr > 0; addr >>= 8) + for (; addr > 0; addr >>>= 8) bytes.push(addr & 0xFF); if (bytes.length == 0) bytes.push(0); @@ -249,19 +267,32 @@ DBCSCodec.prototype._setEncodeSequence = function(seq, dbcsCode) { DBCSCodec.prototype._fillEncodeTable = function(nodeIdx, prefix, skipEncodeChars) { var node = this.decodeTables[nodeIdx]; + var hasValues = false; + var subNodeEmpty = {}; for (var i = 0; i < 0x100; i++) { var uCode = node[i]; var mbCode = prefix + i; if (skipEncodeChars[mbCode]) continue; - if (uCode >= 0) + if (uCode >= 0) { this._setEncodeChar(uCode, mbCode); - else if (uCode <= NODE_START) - this._fillEncodeTable(NODE_START - uCode, mbCode << 8, skipEncodeChars); - else if (uCode <= SEQ_START) + hasValues = true; + } else if (uCode <= NODE_START) { + var subNodeIdx = NODE_START - uCode; + if (!subNodeEmpty[subNodeIdx]) { // Skip empty subtrees (they are too large in gb18030). + var newPrefix = (mbCode << 8) >>> 0; // NOTE: '>>> 0' keeps 32-bit num positive. + if (this._fillEncodeTable(subNodeIdx, newPrefix, skipEncodeChars)) + hasValues = true; + else + subNodeEmpty[subNodeIdx] = true; + } + } else if (uCode <= SEQ_START) { this._setEncodeSequence(this.decodeTableSeq[SEQ_START - uCode], mbCode); + hasValues = true; + } } + return hasValues; } @@ -388,10 +419,15 @@ DBCSEncoder.prototype.write = function(str) { newBuf[j++] = dbcsCode >> 8; // high byte newBuf[j++] = dbcsCode & 0xFF; // low byte } - else { + else if (dbcsCode < 0x1000000) { newBuf[j++] = dbcsCode >> 16; newBuf[j++] = (dbcsCode >> 8) & 0xFF; newBuf[j++] = dbcsCode & 0xFF; + } else { + newBuf[j++] = dbcsCode >>> 24; + newBuf[j++] = (dbcsCode >>> 16) & 0xFF; + newBuf[j++] = (dbcsCode >>> 8) & 0xFF; + newBuf[j++] = dbcsCode & 0xFF; } } @@ -440,7 +476,7 @@ DBCSEncoder.prototype.findIdx = findIdx; function DBCSDecoder(options, codec) { // Decoder state this.nodeIdx = 0; - this.prevBuf = Buffer.alloc(0); + this.prevBytes = []; // Static data this.decodeTables = codec.decodeTables; @@ -452,15 +488,12 @@ function DBCSDecoder(options, codec) { DBCSDecoder.prototype.write = function(buf) { var newBuf = Buffer.alloc(buf.length*2), nodeIdx = this.nodeIdx, - prevBuf = this.prevBuf, prevBufOffset = this.prevBuf.length, - seqStart = -this.prevBuf.length, // idx of the start of current parsed sequence. + prevBytes = this.prevBytes, prevOffset = this.prevBytes.length, + seqStart = -this.prevBytes.length, // idx of the start of current parsed sequence. uCode; - if (prevBufOffset > 0) // Make prev buf overlap a little to make it easier to slice later. - prevBuf = Buffer.concat([prevBuf, buf.slice(0, 10)]); - for (var i = 0, j = 0; i < buf.length; i++) { - var curByte = (i >= 0) ? buf[i] : prevBuf[i + prevBufOffset]; + var curByte = (i >= 0) ? buf[i] : prevBytes[i + prevOffset]; // Lookup in current trie node. var uCode = this.decodeTables[nodeIdx][curByte]; @@ -470,13 +503,18 @@ DBCSDecoder.prototype.write = function(buf) { } else if (uCode === UNASSIGNED) { // Unknown char. // TODO: Callback with seq. - //var curSeq = (seqStart >= 0) ? buf.slice(seqStart, i+1) : prevBuf.slice(seqStart + prevBufOffset, i+1 + prevBufOffset); - i = seqStart; // Try to parse again, after skipping first byte of the sequence ('i' will be incremented by 'for' cycle). uCode = this.defaultCharUnicode.charCodeAt(0); + i = seqStart; // Skip one byte ('i' will be incremented by the for loop) and try to parse again. } else if (uCode === GB18030_CODE) { - var curSeq = (seqStart >= 0) ? buf.slice(seqStart, i+1) : prevBuf.slice(seqStart + prevBufOffset, i+1 + prevBufOffset); - var ptr = (curSeq[0]-0x81)*12600 + (curSeq[1]-0x30)*1260 + (curSeq[2]-0x81)*10 + (curSeq[3]-0x30); + if (i >= 3) { + var ptr = (buf[i-3]-0x81)*12600 + (buf[i-2]-0x30)*1260 + (buf[i-1]-0x81)*10 + (curByte-0x30); + } else { + var ptr = (prevBytes[i-3+prevOffset]-0x81)*12600 + + (((i-2 >= 0) ? buf[i-2] : prevBytes[i-2+prevOffset])-0x30)*1260 + + (((i-1 >= 0) ? buf[i-1] : prevBytes[i-1+prevOffset])-0x81)*10 + + (curByte-0x30); + } var idx = findIdx(this.gb18030.gbChars, ptr); uCode = this.gb18030.uChars[idx] + ptr - this.gb18030.gbChars[idx]; } @@ -497,13 +535,13 @@ DBCSDecoder.prototype.write = function(buf) { throw new Error("iconv-lite internal error: invalid decoding table value " + uCode + " at " + nodeIdx + "/" + curByte); // Write the character to buffer, handling higher planes using surrogate pair. - if (uCode > 0xFFFF) { + if (uCode >= 0x10000) { uCode -= 0x10000; - var uCodeLead = 0xD800 + Math.floor(uCode / 0x400); + var uCodeLead = 0xD800 | (uCode >> 10); newBuf[j++] = uCodeLead & 0xFF; newBuf[j++] = uCodeLead >> 8; - uCode = 0xDC00 + uCode % 0x400; + uCode = 0xDC00 | (uCode & 0x3FF); } newBuf[j++] = uCode & 0xFF; newBuf[j++] = uCode >> 8; @@ -513,7 +551,10 @@ DBCSDecoder.prototype.write = function(buf) { } this.nodeIdx = nodeIdx; - this.prevBuf = (seqStart >= 0) ? buf.slice(seqStart) : prevBuf.slice(seqStart + prevBufOffset); + this.prevBytes = (seqStart >= 0) + ? Array.prototype.slice.call(buf, seqStart) + : prevBytes.slice(seqStart + prevOffset).concat(Array.prototype.slice.call(buf)); + return newBuf.slice(0, j).toString('ucs2'); } @@ -521,18 +562,19 @@ DBCSDecoder.prototype.end = function() { var ret = ''; // Try to parse all remaining chars. - while (this.prevBuf.length > 0) { + while (this.prevBytes.length > 0) { // Skip 1 character in the buffer. ret += this.defaultCharUnicode; - var buf = this.prevBuf.slice(1); + var bytesArr = this.prevBytes.slice(1); // Parse remaining as usual. - this.prevBuf = Buffer.alloc(0); + this.prevBytes = []; this.nodeIdx = 0; - if (buf.length > 0) - ret += this.write(buf); + if (bytesArr.length > 0) + ret += this.write(bytesArr); } + this.prevBytes = []; this.nodeIdx = 0; return ret; } @@ -544,7 +586,7 @@ function findIdx(table, val) { var l = 0, r = table.length; while (l < r-1) { // always table[l] <= val < table[r] - var mid = l + Math.floor((r-l+1)/2); + var mid = l + ((r-l+1) >> 1); if (table[mid] <= val) l = mid; else diff --git a/deps/npm/node_modules/iconv-lite/encodings/index.js b/deps/npm/node_modules/iconv-lite/encodings/index.js index e30400317c18fb..d95c2441151a93 100644 --- a/deps/npm/node_modules/iconv-lite/encodings/index.js +++ b/deps/npm/node_modules/iconv-lite/encodings/index.js @@ -4,6 +4,7 @@ // We support Browserify by skipping automatic module discovery and requiring modules directly. var modules = [ require("./internal"), + require("./utf32"), require("./utf16"), require("./utf7"), require("./sbcs-codec"), @@ -13,7 +14,7 @@ var modules = [ require("./dbcs-data"), ]; -// Put all encoding/alias/codec definitions to single object and export it. +// Put all encoding/alias/codec definitions to single object and export it. for (var i = 0; i < modules.length; i++) { var module = modules[i]; for (var enc in module) diff --git a/deps/npm/node_modules/iconv-lite/encodings/internal.js b/deps/npm/node_modules/iconv-lite/encodings/internal.js index 05ce38b276eee2..dc1074f04f11a3 100644 --- a/deps/npm/node_modules/iconv-lite/encodings/internal.js +++ b/deps/npm/node_modules/iconv-lite/encodings/internal.js @@ -53,10 +53,20 @@ if (!StringDecoder.prototype.end) // Node v0.8 doesn't have this method. function InternalDecoder(options, codec) { - StringDecoder.call(this, codec.enc); + this.decoder = new StringDecoder(codec.enc); } -InternalDecoder.prototype = StringDecoder.prototype; +InternalDecoder.prototype.write = function(buf) { + if (!Buffer.isBuffer(buf)) { + buf = Buffer.from(buf); + } + + return this.decoder.write(buf); +} + +InternalDecoder.prototype.end = function() { + return this.decoder.end(); +} //------------------------------------------------------------------------------ diff --git a/deps/npm/node_modules/iconv-lite/encodings/sbcs-codec.js b/deps/npm/node_modules/iconv-lite/encodings/sbcs-codec.js index f2258237ba2724..abac5ffaac97da 100644 --- a/deps/npm/node_modules/iconv-lite/encodings/sbcs-codec.js +++ b/deps/npm/node_modules/iconv-lite/encodings/sbcs-codec.js @@ -20,10 +20,10 @@ function SBCSCodec(codecOptions, iconv) { codecOptions.chars = asciiString + codecOptions.chars; } - this.decodeBuf = new Buffer.from(codecOptions.chars, 'ucs2'); + this.decodeBuf = Buffer.from(codecOptions.chars, 'ucs2'); // Encoding buffer. - var encodeBuf = new Buffer.alloc(65536, iconv.defaultCharSingleByte.charCodeAt(0)); + var encodeBuf = Buffer.alloc(65536, iconv.defaultCharSingleByte.charCodeAt(0)); for (var i = 0; i < codecOptions.chars.length; i++) encodeBuf[codecOptions.chars.charCodeAt(i)] = i; diff --git a/deps/npm/node_modules/iconv-lite/encodings/sbcs-data.js b/deps/npm/node_modules/iconv-lite/encodings/sbcs-data.js index 2d6f846ad4600a..066f904e5f1d3e 100644 --- a/deps/npm/node_modules/iconv-lite/encodings/sbcs-data.js +++ b/deps/npm/node_modules/iconv-lite/encodings/sbcs-data.js @@ -17,6 +17,16 @@ module.exports = { "chars": "АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмноп░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀рстуфхцчшщъыьэюяЁёЄєЇїЎў°∙·√№€■ " }, + "mik": { + "type": "_sbcs", + "chars": "АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя└┴┬├─┼╣║╚╔╩╦╠═╬┐░▒▓│┤№§╗╝┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ " + }, + + "cp720": { + "type": "_sbcs", + "chars": "\x80\x81éâ\x84à\x86çêëèïî\x8d\x8e\x8f\x90\u0651\u0652ô¤ـûùءآأؤ£إئابةتثجحخدذرزسشص«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀ضطظعغفµقكلمنهوىي≡\u064b\u064c\u064d\u064e\u064f\u0650≈°∙·√ⁿ²■\u00a0" + }, + // Aliases of generated encodings. "ascii8bit": "ascii", "usascii": "ascii", diff --git a/deps/npm/node_modules/iconv-lite/encodings/tables/gbk-added.json b/deps/npm/node_modules/iconv-lite/encodings/tables/gbk-added.json index 8abfa9f7b987ad..b742e368f56000 100644 --- a/deps/npm/node_modules/iconv-lite/encodings/tables/gbk-added.json +++ b/deps/npm/node_modules/iconv-lite/encodings/tables/gbk-added.json @@ -27,7 +27,7 @@ ["a7c2","",14], ["a7f2","",12], ["a896","",10], -["a8bc",""], +["a8bc","ḿ"], ["a8bf","ǹ"], ["a8c1",""], ["a8ea","",20], @@ -51,5 +51,6 @@ ["fca1","",93], ["fda1","",93], ["fe50","⺁⺄㑳㑇⺈⺋㖞㘚㘎⺌⺗㥮㤘㧏㧟㩳㧐㭎㱮㳠⺧⺪䁖䅟⺮䌷⺳⺶⺷䎱䎬⺻䏝䓖䙡䙌"], -["fe80","䜣䜩䝼䞍⻊䥇䥺䥽䦂䦃䦅䦆䦟䦛䦷䦶䲣䲟䲠䲡䱷䲢䴓",6,"䶮",93] +["fe80","䜣䜩䝼䞍⻊䥇䥺䥽䦂䦃䦅䦆䦟䦛䦷䦶䲣䲟䲠䲡䱷䲢䴓",6,"䶮",93], +["8135f437",""] ] diff --git a/deps/npm/node_modules/iconv-lite/encodings/utf16.js b/deps/npm/node_modules/iconv-lite/encodings/utf16.js index 54765aeee2f11e..97d066925bbd5d 100644 --- a/deps/npm/node_modules/iconv-lite/encodings/utf16.js +++ b/deps/npm/node_modules/iconv-lite/encodings/utf16.js @@ -61,6 +61,7 @@ Utf16BEDecoder.prototype.write = function(buf) { } Utf16BEDecoder.prototype.end = function() { + this.overflowByte = -1; } @@ -103,8 +104,8 @@ Utf16Encoder.prototype.end = function() { function Utf16Decoder(options, codec) { this.decoder = null; - this.initialBytes = []; - this.initialBytesLen = 0; + this.initialBufs = []; + this.initialBufsLen = 0; this.options = options || {}; this.iconv = codec.iconv; @@ -113,17 +114,22 @@ function Utf16Decoder(options, codec) { Utf16Decoder.prototype.write = function(buf) { if (!this.decoder) { // Codec is not chosen yet. Accumulate initial bytes. - this.initialBytes.push(buf); - this.initialBytesLen += buf.length; + this.initialBufs.push(buf); + this.initialBufsLen += buf.length; - if (this.initialBytesLen < 16) // We need more bytes to use space heuristic (see below) + if (this.initialBufsLen < 16) // We need more bytes to use space heuristic (see below) return ''; // We have enough bytes -> detect endianness. - var buf = Buffer.concat(this.initialBytes), - encoding = detectEncoding(buf, this.options.defaultEncoding); + var encoding = detectEncoding(this.initialBufs, this.options.defaultEncoding); this.decoder = this.iconv.getDecoder(encoding, this.options); - this.initialBytes.length = this.initialBytesLen = 0; + + var resStr = ''; + for (var i = 0; i < this.initialBufs.length; i++) + resStr += this.decoder.write(this.initialBufs[i]); + + this.initialBufs.length = this.initialBufsLen = 0; + return resStr; } return this.decoder.write(buf); @@ -131,47 +137,61 @@ Utf16Decoder.prototype.write = function(buf) { Utf16Decoder.prototype.end = function() { if (!this.decoder) { - var buf = Buffer.concat(this.initialBytes), - encoding = detectEncoding(buf, this.options.defaultEncoding); + var encoding = detectEncoding(this.initialBufs, this.options.defaultEncoding); this.decoder = this.iconv.getDecoder(encoding, this.options); - var res = this.decoder.write(buf), - trail = this.decoder.end(); + var resStr = ''; + for (var i = 0; i < this.initialBufs.length; i++) + resStr += this.decoder.write(this.initialBufs[i]); - return trail ? (res + trail) : res; + var trail = this.decoder.end(); + if (trail) + resStr += trail; + + this.initialBufs.length = this.initialBufsLen = 0; + return resStr; } return this.decoder.end(); } -function detectEncoding(buf, defaultEncoding) { - var enc = defaultEncoding || 'utf-16le'; - - if (buf.length >= 2) { - // Check BOM. - if (buf[0] == 0xFE && buf[1] == 0xFF) // UTF-16BE BOM - enc = 'utf-16be'; - else if (buf[0] == 0xFF && buf[1] == 0xFE) // UTF-16LE BOM - enc = 'utf-16le'; - else { - // No BOM found. Try to deduce encoding from initial content. - // Most of the time, the content has ASCII chars (U+00**), but the opposite (U+**00) is uncommon. - // So, we count ASCII as if it was LE or BE, and decide from that. - var asciiCharsLE = 0, asciiCharsBE = 0, // Counts of chars in both positions - _len = Math.min(buf.length - (buf.length % 2), 64); // Len is always even. - - for (var i = 0; i < _len; i += 2) { - if (buf[i] === 0 && buf[i+1] !== 0) asciiCharsBE++; - if (buf[i] !== 0 && buf[i+1] === 0) asciiCharsLE++; +function detectEncoding(bufs, defaultEncoding) { + var b = []; + var charsProcessed = 0; + var asciiCharsLE = 0, asciiCharsBE = 0; // Number of ASCII chars when decoded as LE or BE. + + outer_loop: + for (var i = 0; i < bufs.length; i++) { + var buf = bufs[i]; + for (var j = 0; j < buf.length; j++) { + b.push(buf[j]); + if (b.length === 2) { + if (charsProcessed === 0) { + // Check BOM first. + if (b[0] === 0xFF && b[1] === 0xFE) return 'utf-16le'; + if (b[0] === 0xFE && b[1] === 0xFF) return 'utf-16be'; + } + + if (b[0] === 0 && b[1] !== 0) asciiCharsBE++; + if (b[0] !== 0 && b[1] === 0) asciiCharsLE++; + + b.length = 0; + charsProcessed++; + + if (charsProcessed >= 100) { + break outer_loop; + } } - - if (asciiCharsBE > asciiCharsLE) - enc = 'utf-16be'; - else if (asciiCharsBE < asciiCharsLE) - enc = 'utf-16le'; } } - return enc; + // Make decisions. + // Most of the time, the content has ASCII chars (U+00**), but the opposite (U+**00) is uncommon. + // So, we count ASCII as if it was LE or BE, and decide from that. + if (asciiCharsBE > asciiCharsLE) return 'utf-16be'; + if (asciiCharsBE < asciiCharsLE) return 'utf-16le'; + + // Couldn't decide (likely all zeros or not enough data). + return defaultEncoding || 'utf-16le'; } diff --git a/deps/npm/node_modules/iconv-lite/encodings/utf32.js b/deps/npm/node_modules/iconv-lite/encodings/utf32.js new file mode 100644 index 00000000000000..d3ed794b5f72d3 --- /dev/null +++ b/deps/npm/node_modules/iconv-lite/encodings/utf32.js @@ -0,0 +1,319 @@ +'use strict'; + +var Buffer = require('safer-buffer').Buffer; + +// == UTF32-LE/BE codec. ========================================================== + +exports._utf32 = Utf32Codec; + +function Utf32Codec(codecOptions, iconv) { + this.iconv = iconv; + this.bomAware = true; + this.isLE = codecOptions.isLE; +} + +exports.utf32le = { type: '_utf32', isLE: true }; +exports.utf32be = { type: '_utf32', isLE: false }; + +// Aliases +exports.ucs4le = 'utf32le'; +exports.ucs4be = 'utf32be'; + +Utf32Codec.prototype.encoder = Utf32Encoder; +Utf32Codec.prototype.decoder = Utf32Decoder; + +// -- Encoding + +function Utf32Encoder(options, codec) { + this.isLE = codec.isLE; + this.highSurrogate = 0; +} + +Utf32Encoder.prototype.write = function(str) { + var src = Buffer.from(str, 'ucs2'); + var dst = Buffer.alloc(src.length * 2); + var write32 = this.isLE ? dst.writeUInt32LE : dst.writeUInt32BE; + var offset = 0; + + for (var i = 0; i < src.length; i += 2) { + var code = src.readUInt16LE(i); + var isHighSurrogate = (0xD800 <= code && code < 0xDC00); + var isLowSurrogate = (0xDC00 <= code && code < 0xE000); + + if (this.highSurrogate) { + if (isHighSurrogate || !isLowSurrogate) { + // There shouldn't be two high surrogates in a row, nor a high surrogate which isn't followed by a low + // surrogate. If this happens, keep the pending high surrogate as a stand-alone semi-invalid character + // (technically wrong, but expected by some applications, like Windows file names). + write32.call(dst, this.highSurrogate, offset); + offset += 4; + } + else { + // Create 32-bit value from high and low surrogates; + var codepoint = (((this.highSurrogate - 0xD800) << 10) | (code - 0xDC00)) + 0x10000; + + write32.call(dst, codepoint, offset); + offset += 4; + this.highSurrogate = 0; + + continue; + } + } + + if (isHighSurrogate) + this.highSurrogate = code; + else { + // Even if the current character is a low surrogate, with no previous high surrogate, we'll + // encode it as a semi-invalid stand-alone character for the same reasons expressed above for + // unpaired high surrogates. + write32.call(dst, code, offset); + offset += 4; + this.highSurrogate = 0; + } + } + + if (offset < dst.length) + dst = dst.slice(0, offset); + + return dst; +}; + +Utf32Encoder.prototype.end = function() { + // Treat any leftover high surrogate as a semi-valid independent character. + if (!this.highSurrogate) + return; + + var buf = Buffer.alloc(4); + + if (this.isLE) + buf.writeUInt32LE(this.highSurrogate, 0); + else + buf.writeUInt32BE(this.highSurrogate, 0); + + this.highSurrogate = 0; + + return buf; +}; + +// -- Decoding + +function Utf32Decoder(options, codec) { + this.isLE = codec.isLE; + this.badChar = codec.iconv.defaultCharUnicode.charCodeAt(0); + this.overflow = []; +} + +Utf32Decoder.prototype.write = function(src) { + if (src.length === 0) + return ''; + + var i = 0; + var codepoint = 0; + var dst = Buffer.alloc(src.length + 4); + var offset = 0; + var isLE = this.isLE; + var overflow = this.overflow; + var badChar = this.badChar; + + if (overflow.length > 0) { + for (; i < src.length && overflow.length < 4; i++) + overflow.push(src[i]); + + if (overflow.length === 4) { + // NOTE: codepoint is a signed int32 and can be negative. + // NOTE: We copied this block from below to help V8 optimize it (it works with array, not buffer). + if (isLE) { + codepoint = overflow[i] | (overflow[i+1] << 8) | (overflow[i+2] << 16) | (overflow[i+3] << 24); + } else { + codepoint = overflow[i+3] | (overflow[i+2] << 8) | (overflow[i+1] << 16) | (overflow[i] << 24); + } + overflow.length = 0; + + offset = _writeCodepoint(dst, offset, codepoint, badChar); + } + } + + // Main loop. Should be as optimized as possible. + for (; i < src.length - 3; i += 4) { + // NOTE: codepoint is a signed int32 and can be negative. + if (isLE) { + codepoint = src[i] | (src[i+1] << 8) | (src[i+2] << 16) | (src[i+3] << 24); + } else { + codepoint = src[i+3] | (src[i+2] << 8) | (src[i+1] << 16) | (src[i] << 24); + } + offset = _writeCodepoint(dst, offset, codepoint, badChar); + } + + // Keep overflowing bytes. + for (; i < src.length; i++) { + overflow.push(src[i]); + } + + return dst.slice(0, offset).toString('ucs2'); +}; + +function _writeCodepoint(dst, offset, codepoint, badChar) { + // NOTE: codepoint is signed int32 and can be negative. We keep it that way to help V8 with optimizations. + if (codepoint < 0 || codepoint > 0x10FFFF) { + // Not a valid Unicode codepoint + codepoint = badChar; + } + + // Ephemeral Planes: Write high surrogate. + if (codepoint >= 0x10000) { + codepoint -= 0x10000; + + var high = 0xD800 | (codepoint >> 10); + dst[offset++] = high & 0xff; + dst[offset++] = high >> 8; + + // Low surrogate is written below. + var codepoint = 0xDC00 | (codepoint & 0x3FF); + } + + // Write BMP char or low surrogate. + dst[offset++] = codepoint & 0xff; + dst[offset++] = codepoint >> 8; + + return offset; +}; + +Utf32Decoder.prototype.end = function() { + this.overflow.length = 0; +}; + +// == UTF-32 Auto codec ============================================================= +// Decoder chooses automatically from UTF-32LE and UTF-32BE using BOM and space-based heuristic. +// Defaults to UTF-32LE. http://en.wikipedia.org/wiki/UTF-32 +// Encoder/decoder default can be changed: iconv.decode(buf, 'utf32', {defaultEncoding: 'utf-32be'}); + +// Encoder prepends BOM (which can be overridden with (addBOM: false}). + +exports.utf32 = Utf32AutoCodec; +exports.ucs4 = 'utf32'; + +function Utf32AutoCodec(options, iconv) { + this.iconv = iconv; +} + +Utf32AutoCodec.prototype.encoder = Utf32AutoEncoder; +Utf32AutoCodec.prototype.decoder = Utf32AutoDecoder; + +// -- Encoding + +function Utf32AutoEncoder(options, codec) { + options = options || {}; + + if (options.addBOM === undefined) + options.addBOM = true; + + this.encoder = codec.iconv.getEncoder(options.defaultEncoding || 'utf-32le', options); +} + +Utf32AutoEncoder.prototype.write = function(str) { + return this.encoder.write(str); +}; + +Utf32AutoEncoder.prototype.end = function() { + return this.encoder.end(); +}; + +// -- Decoding + +function Utf32AutoDecoder(options, codec) { + this.decoder = null; + this.initialBufs = []; + this.initialBufsLen = 0; + this.options = options || {}; + this.iconv = codec.iconv; +} + +Utf32AutoDecoder.prototype.write = function(buf) { + if (!this.decoder) { + // Codec is not chosen yet. Accumulate initial bytes. + this.initialBufs.push(buf); + this.initialBufsLen += buf.length; + + if (this.initialBufsLen < 32) // We need more bytes to use space heuristic (see below) + return ''; + + // We have enough bytes -> detect endianness. + var encoding = detectEncoding(this.initialBufs, this.options.defaultEncoding); + this.decoder = this.iconv.getDecoder(encoding, this.options); + + var resStr = ''; + for (var i = 0; i < this.initialBufs.length; i++) + resStr += this.decoder.write(this.initialBufs[i]); + + this.initialBufs.length = this.initialBufsLen = 0; + return resStr; + } + + return this.decoder.write(buf); +}; + +Utf32AutoDecoder.prototype.end = function() { + if (!this.decoder) { + var encoding = detectEncoding(this.initialBufs, this.options.defaultEncoding); + this.decoder = this.iconv.getDecoder(encoding, this.options); + + var resStr = ''; + for (var i = 0; i < this.initialBufs.length; i++) + resStr += this.decoder.write(this.initialBufs[i]); + + var trail = this.decoder.end(); + if (trail) + resStr += trail; + + this.initialBufs.length = this.initialBufsLen = 0; + return resStr; + } + + return this.decoder.end(); +}; + +function detectEncoding(bufs, defaultEncoding) { + var b = []; + var charsProcessed = 0; + var invalidLE = 0, invalidBE = 0; // Number of invalid chars when decoded as LE or BE. + var bmpCharsLE = 0, bmpCharsBE = 0; // Number of BMP chars when decoded as LE or BE. + + outer_loop: + for (var i = 0; i < bufs.length; i++) { + var buf = bufs[i]; + for (var j = 0; j < buf.length; j++) { + b.push(buf[j]); + if (b.length === 4) { + if (charsProcessed === 0) { + // Check BOM first. + if (b[0] === 0xFF && b[1] === 0xFE && b[2] === 0 && b[3] === 0) { + return 'utf-32le'; + } + if (b[0] === 0 && b[1] === 0 && b[2] === 0xFE && b[3] === 0xFF) { + return 'utf-32be'; + } + } + + if (b[0] !== 0 || b[1] > 0x10) invalidBE++; + if (b[3] !== 0 || b[2] > 0x10) invalidLE++; + + if (b[0] === 0 && b[1] === 0 && (b[2] !== 0 || b[3] !== 0)) bmpCharsBE++; + if ((b[0] !== 0 || b[1] !== 0) && b[2] === 0 && b[3] === 0) bmpCharsLE++; + + b.length = 0; + charsProcessed++; + + if (charsProcessed >= 100) { + break outer_loop; + } + } + } + } + + // Make decisions. + if (bmpCharsBE - invalidBE > bmpCharsLE - invalidLE) return 'utf-32be'; + if (bmpCharsBE - invalidBE < bmpCharsLE - invalidLE) return 'utf-32le'; + + // Couldn't decide (likely all zeros or not enough data). + return defaultEncoding || 'utf-32le'; +} diff --git a/deps/npm/node_modules/iconv-lite/encodings/utf7.js b/deps/npm/node_modules/iconv-lite/encodings/utf7.js index b7631c23a801b0..eacae34d5f80d0 100644 --- a/deps/npm/node_modules/iconv-lite/encodings/utf7.js +++ b/deps/npm/node_modules/iconv-lite/encodings/utf7.js @@ -74,7 +74,7 @@ Utf7Decoder.prototype.write = function(buf) { if (i == lastI && buf[i] == minusChar) {// "+-" -> "+" res += "+"; } else { - var b64str = base64Accum + buf.slice(lastI, i).toString(); + var b64str = base64Accum + this.iconv.decode(buf.slice(lastI, i), "ascii"); res += this.iconv.decode(Buffer.from(b64str, 'base64'), "utf16-be"); } @@ -91,7 +91,7 @@ Utf7Decoder.prototype.write = function(buf) { if (!inBase64) { res += this.iconv.decode(buf.slice(lastI), "ascii"); // Write direct chars. } else { - var b64str = base64Accum + buf.slice(lastI).toString(); + var b64str = base64Accum + this.iconv.decode(buf.slice(lastI), "ascii"); var canBeDecoded = b64str.length - (b64str.length % 8); // Minimal chunk: 2 quads -> 2x3 bytes -> 3 chars. base64Accum = b64str.slice(canBeDecoded); // The rest will be decoded in future. @@ -245,7 +245,7 @@ Utf7IMAPDecoder.prototype.write = function(buf) { if (i == lastI && buf[i] == minusChar) { // "&-" -> "&" res += "&"; } else { - var b64str = base64Accum + buf.slice(lastI, i).toString().replace(/,/g, '/'); + var b64str = base64Accum + this.iconv.decode(buf.slice(lastI, i), "ascii").replace(/,/g, '/'); res += this.iconv.decode(Buffer.from(b64str, 'base64'), "utf16-be"); } @@ -262,7 +262,7 @@ Utf7IMAPDecoder.prototype.write = function(buf) { if (!inBase64) { res += this.iconv.decode(buf.slice(lastI), "ascii"); // Write direct chars. } else { - var b64str = base64Accum + buf.slice(lastI).toString().replace(/,/g, '/'); + var b64str = base64Accum + this.iconv.decode(buf.slice(lastI), "ascii").replace(/,/g, '/'); var canBeDecoded = b64str.length - (b64str.length % 8); // Minimal chunk: 2 quads -> 2x3 bytes -> 3 chars. base64Accum = b64str.slice(canBeDecoded); // The rest will be decoded in future. diff --git a/deps/npm/node_modules/iconv-lite/lib/extend-node.js b/deps/npm/node_modules/iconv-lite/lib/extend-node.js deleted file mode 100644 index 87f5394a4b3966..00000000000000 --- a/deps/npm/node_modules/iconv-lite/lib/extend-node.js +++ /dev/null @@ -1,217 +0,0 @@ -"use strict"; -var Buffer = require("buffer").Buffer; -// Note: not polyfilled with safer-buffer on a purpose, as overrides Buffer - -// == Extend Node primitives to use iconv-lite ================================= - -module.exports = function (iconv) { - var original = undefined; // Place to keep original methods. - - // Node authors rewrote Buffer internals to make it compatible with - // Uint8Array and we cannot patch key functions since then. - // Note: this does use older Buffer API on a purpose - iconv.supportsNodeEncodingsExtension = !(Buffer.from || new Buffer(0) instanceof Uint8Array); - - iconv.extendNodeEncodings = function extendNodeEncodings() { - if (original) return; - original = {}; - - if (!iconv.supportsNodeEncodingsExtension) { - console.error("ACTION NEEDED: require('iconv-lite').extendNodeEncodings() is not supported in your version of Node"); - console.error("See more info at https://github.com/ashtuchkin/iconv-lite/wiki/Node-v4-compatibility"); - return; - } - - var nodeNativeEncodings = { - 'hex': true, 'utf8': true, 'utf-8': true, 'ascii': true, 'binary': true, - 'base64': true, 'ucs2': true, 'ucs-2': true, 'utf16le': true, 'utf-16le': true, - }; - - Buffer.isNativeEncoding = function(enc) { - return enc && nodeNativeEncodings[enc.toLowerCase()]; - } - - // -- SlowBuffer ----------------------------------------------------------- - var SlowBuffer = require('buffer').SlowBuffer; - - original.SlowBufferToString = SlowBuffer.prototype.toString; - SlowBuffer.prototype.toString = function(encoding, start, end) { - encoding = String(encoding || 'utf8').toLowerCase(); - - // Use native conversion when possible - if (Buffer.isNativeEncoding(encoding)) - return original.SlowBufferToString.call(this, encoding, start, end); - - // Otherwise, use our decoding method. - if (typeof start == 'undefined') start = 0; - if (typeof end == 'undefined') end = this.length; - return iconv.decode(this.slice(start, end), encoding); - } - - original.SlowBufferWrite = SlowBuffer.prototype.write; - SlowBuffer.prototype.write = function(string, offset, length, encoding) { - // Support both (string, offset, length, encoding) - // and the legacy (string, encoding, offset, length) - if (isFinite(offset)) { - if (!isFinite(length)) { - encoding = length; - length = undefined; - } - } else { // legacy - var swap = encoding; - encoding = offset; - offset = length; - length = swap; - } - - offset = +offset || 0; - var remaining = this.length - offset; - if (!length) { - length = remaining; - } else { - length = +length; - if (length > remaining) { - length = remaining; - } - } - encoding = String(encoding || 'utf8').toLowerCase(); - - // Use native conversion when possible - if (Buffer.isNativeEncoding(encoding)) - return original.SlowBufferWrite.call(this, string, offset, length, encoding); - - if (string.length > 0 && (length < 0 || offset < 0)) - throw new RangeError('attempt to write beyond buffer bounds'); - - // Otherwise, use our encoding method. - var buf = iconv.encode(string, encoding); - if (buf.length < length) length = buf.length; - buf.copy(this, offset, 0, length); - return length; - } - - // -- Buffer --------------------------------------------------------------- - - original.BufferIsEncoding = Buffer.isEncoding; - Buffer.isEncoding = function(encoding) { - return Buffer.isNativeEncoding(encoding) || iconv.encodingExists(encoding); - } - - original.BufferByteLength = Buffer.byteLength; - Buffer.byteLength = SlowBuffer.byteLength = function(str, encoding) { - encoding = String(encoding || 'utf8').toLowerCase(); - - // Use native conversion when possible - if (Buffer.isNativeEncoding(encoding)) - return original.BufferByteLength.call(this, str, encoding); - - // Slow, I know, but we don't have a better way yet. - return iconv.encode(str, encoding).length; - } - - original.BufferToString = Buffer.prototype.toString; - Buffer.prototype.toString = function(encoding, start, end) { - encoding = String(encoding || 'utf8').toLowerCase(); - - // Use native conversion when possible - if (Buffer.isNativeEncoding(encoding)) - return original.BufferToString.call(this, encoding, start, end); - - // Otherwise, use our decoding method. - if (typeof start == 'undefined') start = 0; - if (typeof end == 'undefined') end = this.length; - return iconv.decode(this.slice(start, end), encoding); - } - - original.BufferWrite = Buffer.prototype.write; - Buffer.prototype.write = function(string, offset, length, encoding) { - var _offset = offset, _length = length, _encoding = encoding; - // Support both (string, offset, length, encoding) - // and the legacy (string, encoding, offset, length) - if (isFinite(offset)) { - if (!isFinite(length)) { - encoding = length; - length = undefined; - } - } else { // legacy - var swap = encoding; - encoding = offset; - offset = length; - length = swap; - } - - encoding = String(encoding || 'utf8').toLowerCase(); - - // Use native conversion when possible - if (Buffer.isNativeEncoding(encoding)) - return original.BufferWrite.call(this, string, _offset, _length, _encoding); - - offset = +offset || 0; - var remaining = this.length - offset; - if (!length) { - length = remaining; - } else { - length = +length; - if (length > remaining) { - length = remaining; - } - } - - if (string.length > 0 && (length < 0 || offset < 0)) - throw new RangeError('attempt to write beyond buffer bounds'); - - // Otherwise, use our encoding method. - var buf = iconv.encode(string, encoding); - if (buf.length < length) length = buf.length; - buf.copy(this, offset, 0, length); - return length; - - // TODO: Set _charsWritten. - } - - - // -- Readable ------------------------------------------------------------- - if (iconv.supportsStreams) { - var Readable = require('stream').Readable; - - original.ReadableSetEncoding = Readable.prototype.setEncoding; - Readable.prototype.setEncoding = function setEncoding(enc, options) { - // Use our own decoder, it has the same interface. - // We cannot use original function as it doesn't handle BOM-s. - this._readableState.decoder = iconv.getDecoder(enc, options); - this._readableState.encoding = enc; - } - - Readable.prototype.collect = iconv._collect; - } - } - - // Remove iconv-lite Node primitive extensions. - iconv.undoExtendNodeEncodings = function undoExtendNodeEncodings() { - if (!iconv.supportsNodeEncodingsExtension) - return; - if (!original) - throw new Error("require('iconv-lite').undoExtendNodeEncodings(): Nothing to undo; extendNodeEncodings() is not called.") - - delete Buffer.isNativeEncoding; - - var SlowBuffer = require('buffer').SlowBuffer; - - SlowBuffer.prototype.toString = original.SlowBufferToString; - SlowBuffer.prototype.write = original.SlowBufferWrite; - - Buffer.isEncoding = original.BufferIsEncoding; - Buffer.byteLength = original.BufferByteLength; - Buffer.prototype.toString = original.BufferToString; - Buffer.prototype.write = original.BufferWrite; - - if (iconv.supportsStreams) { - var Readable = require('stream').Readable; - - Readable.prototype.setEncoding = original.ReadableSetEncoding; - delete Readable.prototype.collect; - } - - original = undefined; - } -} diff --git a/deps/npm/node_modules/iconv-lite/lib/index.d.ts b/deps/npm/node_modules/iconv-lite/lib/index.d.ts index 0547eb346b24f4..99f200f4ab04c3 100644 --- a/deps/npm/node_modules/iconv-lite/lib/index.d.ts +++ b/deps/npm/node_modules/iconv-lite/lib/index.d.ts @@ -6,15 +6,22 @@ *--------------------------------------------------------------------------------------------*/ declare module 'iconv-lite' { + // Basic API export function decode(buffer: Buffer, encoding: string, options?: Options): string; export function encode(content: string, encoding: string, options?: Options): Buffer; export function encodingExists(encoding: string): boolean; + // Stream API export function decodeStream(encoding: string, options?: Options): NodeJS.ReadWriteStream; export function encodeStream(encoding: string, options?: Options): NodeJS.ReadWriteStream; + + // Low-level stream APIs + export function getEncoder(encoding: string, options?: Options): EncoderStream; + + export function getDecoder(encoding: string, options?: Options): DecoderStream; } export interface Options { @@ -22,3 +29,13 @@ export interface Options { addBOM?: boolean; defaultEncoding?: string; } + +export interface EncoderStream { + write(str: string): Buffer; + end(): Buffer | undefined; +} + +export interface DecoderStream { + write(buf: Buffer): string; + end(): string | undefined; +} diff --git a/deps/npm/node_modules/iconv-lite/lib/index.js b/deps/npm/node_modules/iconv-lite/lib/index.js index 5391919ca2c631..657701c38d243b 100644 --- a/deps/npm/node_modules/iconv-lite/lib/index.js +++ b/deps/npm/node_modules/iconv-lite/lib/index.js @@ -1,7 +1,5 @@ "use strict"; -// Some environments don't have global Buffer (e.g. React Native). -// Solution would be installing npm modules "buffer" and "stream" explicitly. var Buffer = require("safer-buffer").Buffer; var bomHandling = require("./bom-handling"), @@ -133,21 +131,50 @@ iconv.getDecoder = function getDecoder(encoding, options) { return decoder; } +// Streaming API +// NOTE: Streaming API naturally depends on 'stream' module from Node.js. Unfortunately in browser environments this module can add +// up to 100Kb to the output bundle. To avoid unnecessary code bloat, we don't enable Streaming API in browser by default. +// If you would like to enable it explicitly, please add the following code to your app: +// > iconv.enableStreamingAPI(require('stream')); +iconv.enableStreamingAPI = function enableStreamingAPI(stream_module) { + if (iconv.supportsStreams) + return; + + // Dependency-inject stream module to create IconvLite stream classes. + var streams = require("./streams")(stream_module); + + // Not public API yet, but expose the stream classes. + iconv.IconvLiteEncoderStream = streams.IconvLiteEncoderStream; + iconv.IconvLiteDecoderStream = streams.IconvLiteDecoderStream; + + // Streaming API. + iconv.encodeStream = function encodeStream(encoding, options) { + return new iconv.IconvLiteEncoderStream(iconv.getEncoder(encoding, options), options); + } -// Load extensions in Node. All of them are omitted in Browserify build via 'browser' field in package.json. -var nodeVer = typeof process !== 'undefined' && process.versions && process.versions.node; -if (nodeVer) { - - // Load streaming support in Node v0.10+ - var nodeVerArr = nodeVer.split(".").map(Number); - if (nodeVerArr[0] > 0 || nodeVerArr[1] >= 10) { - require("./streams")(iconv); + iconv.decodeStream = function decodeStream(encoding, options) { + return new iconv.IconvLiteDecoderStream(iconv.getDecoder(encoding, options), options); } - // Load Node primitive extensions. - require("./extend-node")(iconv); + iconv.supportsStreams = true; +} + +// Enable Streaming API automatically if 'stream' module is available and non-empty (the majority of environments). +var stream_module; +try { + stream_module = require("stream"); +} catch (e) {} + +if (stream_module && stream_module.Transform) { + iconv.enableStreamingAPI(stream_module); + +} else { + // In rare cases where 'stream' module is not available by default, throw a helpful exception. + iconv.encodeStream = iconv.decodeStream = function() { + throw new Error("iconv-lite Streaming API is not enabled. Use iconv.enableStreamingAPI(require('stream')); to enable it."); + }; } if ("Ā" != "\u0100") { - console.error("iconv-lite warning: javascript files use encoding different from utf-8. See https://github.com/ashtuchkin/iconv-lite/wiki/Javascript-source-file-encodings for more info."); + console.error("iconv-lite warning: js files use non-utf8 encoding. See https://github.com/ashtuchkin/iconv-lite/wiki/Javascript-source-file-encodings for more info."); } diff --git a/deps/npm/node_modules/iconv-lite/lib/streams.js b/deps/npm/node_modules/iconv-lite/lib/streams.js index 4409552958edca..661767ad6cbc98 100644 --- a/deps/npm/node_modules/iconv-lite/lib/streams.js +++ b/deps/npm/node_modules/iconv-lite/lib/streams.js @@ -1,121 +1,109 @@ "use strict"; -var Buffer = require("buffer").Buffer, - Transform = require("stream").Transform; +var Buffer = require("safer-buffer").Buffer; +// NOTE: Due to 'stream' module being pretty large (~100Kb, significant in browser environments), +// we opt to dependency-inject it instead of creating a hard dependency. +module.exports = function(stream_module) { + var Transform = stream_module.Transform; -// == Exports ================================================================== -module.exports = function(iconv) { - - // Additional Public API. - iconv.encodeStream = function encodeStream(encoding, options) { - return new IconvLiteEncoderStream(iconv.getEncoder(encoding, options), options); + // == Encoder stream ======================================================= + + function IconvLiteEncoderStream(conv, options) { + this.conv = conv; + options = options || {}; + options.decodeStrings = false; // We accept only strings, so we don't need to decode them. + Transform.call(this, options); } - iconv.decodeStream = function decodeStream(encoding, options) { - return new IconvLiteDecoderStream(iconv.getDecoder(encoding, options), options); + IconvLiteEncoderStream.prototype = Object.create(Transform.prototype, { + constructor: { value: IconvLiteEncoderStream } + }); + + IconvLiteEncoderStream.prototype._transform = function(chunk, encoding, done) { + if (typeof chunk != 'string') + return done(new Error("Iconv encoding stream needs strings as its input.")); + try { + var res = this.conv.write(chunk); + if (res && res.length) this.push(res); + done(); + } + catch (e) { + done(e); + } } - iconv.supportsStreams = true; + IconvLiteEncoderStream.prototype._flush = function(done) { + try { + var res = this.conv.end(); + if (res && res.length) this.push(res); + done(); + } + catch (e) { + done(e); + } + } + IconvLiteEncoderStream.prototype.collect = function(cb) { + var chunks = []; + this.on('error', cb); + this.on('data', function(chunk) { chunks.push(chunk); }); + this.on('end', function() { + cb(null, Buffer.concat(chunks)); + }); + return this; + } - // Not published yet. - iconv.IconvLiteEncoderStream = IconvLiteEncoderStream; - iconv.IconvLiteDecoderStream = IconvLiteDecoderStream; - iconv._collect = IconvLiteDecoderStream.prototype.collect; -}; + // == Decoder stream ======================================================= -// == Encoder stream ======================================================= -function IconvLiteEncoderStream(conv, options) { - this.conv = conv; - options = options || {}; - options.decodeStrings = false; // We accept only strings, so we don't need to decode them. - Transform.call(this, options); -} - -IconvLiteEncoderStream.prototype = Object.create(Transform.prototype, { - constructor: { value: IconvLiteEncoderStream } -}); - -IconvLiteEncoderStream.prototype._transform = function(chunk, encoding, done) { - if (typeof chunk != 'string') - return done(new Error("Iconv encoding stream needs strings as its input.")); - try { - var res = this.conv.write(chunk); - if (res && res.length) this.push(res); - done(); - } - catch (e) { - done(e); + function IconvLiteDecoderStream(conv, options) { + this.conv = conv; + options = options || {}; + options.encoding = this.encoding = 'utf8'; // We output strings. + Transform.call(this, options); } -} -IconvLiteEncoderStream.prototype._flush = function(done) { - try { - var res = this.conv.end(); - if (res && res.length) this.push(res); - done(); - } - catch (e) { - done(e); - } -} - -IconvLiteEncoderStream.prototype.collect = function(cb) { - var chunks = []; - this.on('error', cb); - this.on('data', function(chunk) { chunks.push(chunk); }); - this.on('end', function() { - cb(null, Buffer.concat(chunks)); + IconvLiteDecoderStream.prototype = Object.create(Transform.prototype, { + constructor: { value: IconvLiteDecoderStream } }); - return this; -} - - -// == Decoder stream ======================================================= -function IconvLiteDecoderStream(conv, options) { - this.conv = conv; - options = options || {}; - options.encoding = this.encoding = 'utf8'; // We output strings. - Transform.call(this, options); -} - -IconvLiteDecoderStream.prototype = Object.create(Transform.prototype, { - constructor: { value: IconvLiteDecoderStream } -}); - -IconvLiteDecoderStream.prototype._transform = function(chunk, encoding, done) { - if (!Buffer.isBuffer(chunk)) - return done(new Error("Iconv decoding stream needs buffers as its input.")); - try { - var res = this.conv.write(chunk); - if (res && res.length) this.push(res, this.encoding); - done(); - } - catch (e) { - done(e); + + IconvLiteDecoderStream.prototype._transform = function(chunk, encoding, done) { + if (!Buffer.isBuffer(chunk) && !(chunk instanceof Uint8Array)) + return done(new Error("Iconv decoding stream needs buffers as its input.")); + try { + var res = this.conv.write(chunk); + if (res && res.length) this.push(res, this.encoding); + done(); + } + catch (e) { + done(e); + } } -} -IconvLiteDecoderStream.prototype._flush = function(done) { - try { - var res = this.conv.end(); - if (res && res.length) this.push(res, this.encoding); - done(); + IconvLiteDecoderStream.prototype._flush = function(done) { + try { + var res = this.conv.end(); + if (res && res.length) this.push(res, this.encoding); + done(); + } + catch (e) { + done(e); + } } - catch (e) { - done(e); + + IconvLiteDecoderStream.prototype.collect = function(cb) { + var res = ''; + this.on('error', cb); + this.on('data', function(chunk) { res += chunk; }); + this.on('end', function() { + cb(null, res); + }); + return this; } -} - -IconvLiteDecoderStream.prototype.collect = function(cb) { - var res = ''; - this.on('error', cb); - this.on('data', function(chunk) { res += chunk; }); - this.on('end', function() { - cb(null, res); - }); - return this; -} + return { + IconvLiteEncoderStream: IconvLiteEncoderStream, + IconvLiteDecoderStream: IconvLiteDecoderStream, + }; +}; diff --git a/deps/npm/node_modules/iconv-lite/package.json b/deps/npm/node_modules/iconv-lite/package.json index 07f6f1a8e7af78..8f86f9c9bc1f8f 100644 --- a/deps/npm/node_modules/iconv-lite/package.json +++ b/deps/npm/node_modules/iconv-lite/package.json @@ -1,77 +1,44 @@ { - "_from": "iconv-lite@~0.4.13", - "_id": "iconv-lite@0.4.23", - "_inBundle": false, - "_integrity": "sha512-neyTUVFtahjf0mB3dZT77u+8O0QB89jFdnBkd5P1JgYPbPaia3gXXOVL2fq8VyU2gMMD7SaN7QukTB/pmXYvDA==", - "_location": "/iconv-lite", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "iconv-lite@~0.4.13", "name": "iconv-lite", - "escapedName": "iconv-lite", - "rawSpec": "~0.4.13", - "saveSpec": null, - "fetchSpec": "~0.4.13" - }, - "_requiredBy": [ - "/encoding", - "/external-editor" - ], - "_resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.23.tgz", - "_shasum": "297871f63be507adcfbfca715d0cd0eed84e9a63", - "_spec": "iconv-lite@~0.4.13", - "_where": "/Users/rebecca/code/npm/node_modules/encoding", - "author": { - "name": "Alexander Shtuchkin", - "email": "ashtuchkin@gmail.com" - }, - "browser": { - "./lib/extend-node": false, - "./lib/streams": false - }, - "bugs": { - "url": "https://github.com/ashtuchkin/iconv-lite/issues" - }, - "bundleDependencies": false, - "dependencies": { - "safer-buffer": ">= 2.1.2 < 3" - }, - "deprecated": false, - "description": "Convert character encodings in pure javascript.", - "devDependencies": { - "async": "*", - "errto": "*", - "iconv": "*", - "istanbul": "*", - "mocha": "^3.1.0", - "request": "~2.81.0", - "semver": "*", - "unorm": "*" - }, - "engines": { - "node": ">=0.10.0" - }, - "homepage": "https://github.com/ashtuchkin/iconv-lite", - "keywords": [ - "iconv", - "convert", - "charset", - "icu" - ], - "license": "MIT", - "main": "./lib/index.js", - "name": "iconv-lite", - "repository": { - "type": "git", - "url": "git://github.com/ashtuchkin/iconv-lite.git" - }, - "scripts": { - "coverage": "istanbul cover _mocha -- --grep .", - "coverage-open": "open coverage/lcov-report/index.html", - "test": "mocha --reporter spec --grep ." - }, - "typings": "./lib/index.d.ts", - "version": "0.4.23" + "description": "Convert character encodings in pure javascript.", + "version": "0.6.2", + "license": "MIT", + "keywords": [ + "iconv", + "convert", + "charset", + "icu" + ], + "author": "Alexander Shtuchkin ", + "main": "./lib/index.js", + "typings": "./lib/index.d.ts", + "homepage": "https://github.com/ashtuchkin/iconv-lite", + "bugs": "https://github.com/ashtuchkin/iconv-lite/issues", + "repository": { + "type": "git", + "url": "git://github.com/ashtuchkin/iconv-lite.git" + }, + "engines": { + "node": ">=0.10.0" + }, + "scripts": { + "coverage": "c8 _mocha --grep .", + "test": "mocha --reporter spec --grep ." + }, + "browser": { + "stream": false + }, + "devDependencies": { + "async": "^3.2.0", + "c8": "^7.2.0", + "errto": "^0.2.1", + "iconv": "^2.3.5", + "mocha": "^3.5.3", + "request": "^2.88.2", + "semver": "^6.3.0", + "unorm": "^1.6.0" + }, + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3.0.0" + } } diff --git a/deps/npm/node_modules/iferr/LICENSE b/deps/npm/node_modules/iferr/LICENSE deleted file mode 100644 index 19d5f4bce547ba..00000000000000 --- a/deps/npm/node_modules/iferr/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2014 Nadav Ivgi - -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/deps/npm/node_modules/iferr/README.md b/deps/npm/node_modules/iferr/README.md deleted file mode 100644 index 7a24462a88edc2..00000000000000 --- a/deps/npm/node_modules/iferr/README.md +++ /dev/null @@ -1,53 +0,0 @@ -# iferr - -Higher-order functions for easier error handling. - -`if (err) return cb(err);` be gone! - -## Install -```bash -npm install iferr -``` - -## Use - -### JavaScript/ES6 example -```js -var iferr = require('iferr'); - -function get_friends_count(id, cb) { - User.load_user(id, iferr(cb, user => - user.load_friends(iferr(cb, friends => - cb(null, friends.length) - )) - )) -} -``` - -### JavaScript/ES5 example -```js -var iferr = require('iferr'); - -function get_friends_count(id, cb) { - User.load_user(id, iferr(cb, function(user) { - user.load_friends(iferr(cb, function(friends) { - cb(null, friends.length) - })) - })) -} -``` - -### CoffeeScript example -```coffee -iferr = require 'iferr' - -get_friends_count = (id, cb) -> - User.load_user id, iferr cb, (user) -> - user.load_friends iferr cb, (friends) -> - cb null, friends.length -``` - -(TODO: document tiferr, throwerr and printerr) - -## License -MIT diff --git a/deps/npm/node_modules/iferr/iferr.js b/deps/npm/node_modules/iferr/iferr.js deleted file mode 100644 index 028f0e24a3a9df..00000000000000 --- a/deps/npm/node_modules/iferr/iferr.js +++ /dev/null @@ -1,23 +0,0 @@ -// Delegates to `succ` on sucecss or to `fail` on error -// ex: Thing.load(123, iferr(cb, thing => ...)) -const iferr = (fail, succ) => (err, ...a) => err ? fail(err) : succ(...a) - -// Like iferr, but also catches errors thrown from `succ` and passes to `fail` -const tiferr = (fail, succ) => iferr(fail, (...a) => { - try { succ(...a) } - catch (err) { fail(err) } -}) - -// Delegate to the success function on success, throws the error otherwise -// ex: Thing.load(123, throwerr(thing => ...)) -const throwerr = iferr.bind(null, err => { throw err }) - -// Prints errors when one is passed, or does nothing otherwise -// ex: Thing.load(123, printerr) -const printerr = iferr(err => console.error(err), () => {}) - -module.exports = exports = iferr -exports.iferr = iferr -exports.tiferr = tiferr -exports.throwerr = throwerr -exports.printerr = printerr diff --git a/deps/npm/node_modules/iferr/package.json b/deps/npm/node_modules/iferr/package.json deleted file mode 100644 index eead655e6d220d..00000000000000 --- a/deps/npm/node_modules/iferr/package.json +++ /dev/null @@ -1,61 +0,0 @@ -{ - "_from": "iferr@1.0.2", - "_id": "iferr@1.0.2", - "_inBundle": false, - "_integrity": "sha512-9AfeLfji44r5TKInjhz3W9DyZI1zR1JAf2hVBMGhddAKPqBsupb89jGfbCTHIGZd6fGZl9WlHdn4AObygyMKwg==", - "_location": "/iferr", - "_phantomChildren": {}, - "_requested": { - "type": "version", - "registry": true, - "raw": "iferr@1.0.2", - "name": "iferr", - "escapedName": "iferr", - "rawSpec": "1.0.2", - "saveSpec": null, - "fetchSpec": "1.0.2" - }, - "_requiredBy": [ - "#USER", - "/" - ], - "_resolved": "https://registry.npmjs.org/iferr/-/iferr-1.0.2.tgz", - "_shasum": "e9fde49a9da06dc4a4194c6c9ed6d08305037a6d", - "_spec": "iferr@1.0.2", - "_where": "/Users/zkat/Documents/code/work/npm", - "author": { - "name": "Nadav Ivgi" - }, - "bugs": { - "url": "https://github.com/shesek/iferr/issues" - }, - "bundleDependencies": false, - "deprecated": false, - "description": "Higher-order functions for easier error handling", - "devDependencies": { - "coffeescript": "^2.3.1", - "mocha": "^4.0.1" - }, - "engines": { - "node": ">=6.0.0" - }, - "files": [ - "iferr.js" - ], - "homepage": "https://github.com/shesek/iferr", - "keywords": [ - "error", - "errors" - ], - "license": "MIT", - "main": "iferr.js", - "name": "iferr", - "repository": { - "type": "git", - "url": "git+https://github.com/shesek/iferr.git" - }, - "scripts": { - "test": "mocha" - }, - "version": "1.0.2" -} diff --git a/deps/npm/node_modules/ignore-walk/package.json b/deps/npm/node_modules/ignore-walk/package.json index 882c1398b07d64..99d2c2e64de9df 100644 --- a/deps/npm/node_modules/ignore-walk/package.json +++ b/deps/npm/node_modules/ignore-walk/package.json @@ -1,51 +1,20 @@ { - "_from": "ignore-walk@^3.0.1", - "_id": "ignore-walk@3.0.3", - "_inBundle": false, - "_integrity": "sha512-m7o6xuOaT1aqheYHKf8W6J5pYH85ZI9w077erOzLje3JsB1gkafkAhHHY19dqjulgIZHFm32Cp5uNZgcQqdJKw==", - "_location": "/ignore-walk", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "ignore-walk@^3.0.1", - "name": "ignore-walk", - "escapedName": "ignore-walk", - "rawSpec": "^3.0.1", - "saveSpec": null, - "fetchSpec": "^3.0.1" - }, - "_requiredBy": [ - "/npm-packlist" - ], - "_resolved": "https://registry.npmjs.org/ignore-walk/-/ignore-walk-3.0.3.tgz", - "_shasum": "017e2447184bfeade7c238e4aefdd1e8f95b1e37", - "_spec": "ignore-walk@^3.0.1", - "_where": "/Users/mperrotte/npminc/cli/node_modules/npm-packlist", - "author": { - "name": "Isaac Z. Schlueter", - "email": "i@izs.me", - "url": "http://blog.izs.me/" - }, - "bugs": { - "url": "https://github.com/isaacs/ignore-walk/issues" - }, - "bundleDependencies": false, - "dependencies": { - "minimatch": "^3.0.4" - }, - "deprecated": false, + "name": "ignore-walk", + "version": "3.0.3", "description": "Nested/recursive `.gitignore`/`.npmignore` parsing and filtering.", + "main": "index.js", "devDependencies": { "mkdirp": "^0.5.1", "mutate-fs": "^1.1.0", "rimraf": "^2.6.1", "tap": "^14.6.9" }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/isaacs/ignore-walk#readme", + "scripts": { + "test": "tap", + "preversion": "npm test", + "postversion": "npm publish", + "postpublish": "git push origin --all; git push origin --tags" + }, "keywords": [ "ignorefile", "ignore", @@ -54,21 +23,19 @@ ".npmignore", "glob" ], + "author": "Isaac Z. Schlueter (http://blog.izs.me/)", "license": "ISC", - "main": "index.js", - "name": "ignore-walk", "repository": { "type": "git", "url": "git+https://github.com/isaacs/ignore-walk.git" }, - "scripts": { - "postpublish": "git push origin --all; git push origin --tags", - "postversion": "npm publish", - "preversion": "npm test", - "test": "tap" + "files": [ + "index.js" + ], + "dependencies": { + "minimatch": "^3.0.4" }, "tap": { "jobs": 1 - }, - "version": "3.0.3" + } } diff --git a/deps/npm/node_modules/import-lazy/index.js b/deps/npm/node_modules/import-lazy/index.js deleted file mode 100644 index 307f08f393719c..00000000000000 --- a/deps/npm/node_modules/import-lazy/index.js +++ /dev/null @@ -1,53 +0,0 @@ -'use strict'; -const lazy = (mod, fn, id) => mod === undefined ? fn(id) : mod; - -module.exports = fn => { - return id => { - let mod; - - return function () { - if (arguments.length === 0) { - mod = lazy(mod, fn, id); - return mod; - } - - const ret = {}; - - [].forEach.call(arguments, prop => { - Object.defineProperty(ret, prop, { - get: () => { - mod = lazy(mod, fn, id); - if (typeof mod[prop] === 'function') { - return function () { - return mod[prop].apply(mod, arguments); - }; - } - - return mod[prop]; - } - }); - }); - - return ret; - }; - }; -}; - -module.exports.proxy = fn => { - return id => { - let mod; - - const handler = { - get: (target, property) => { - mod = lazy(mod, fn, id); - return Reflect.get(mod, property); - }, - apply: (target, thisArg, argumentsList) => { - mod = lazy(mod, fn, id); - return Reflect.apply(mod, thisArg, argumentsList); - } - }; - - return new Proxy(() => {}, handler); - }; -}; diff --git a/deps/npm/node_modules/import-lazy/license b/deps/npm/node_modules/import-lazy/license deleted file mode 100644 index 654d0bfe943437..00000000000000 --- a/deps/npm/node_modules/import-lazy/license +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -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/deps/npm/node_modules/import-lazy/package.json b/deps/npm/node_modules/import-lazy/package.json deleted file mode 100644 index e0a2a3a2c6b427..00000000000000 --- a/deps/npm/node_modules/import-lazy/package.json +++ /dev/null @@ -1,76 +0,0 @@ -{ - "_from": "import-lazy@^2.1.0", - "_id": "import-lazy@2.1.0", - "_inBundle": false, - "_integrity": "sha1-BWmOPUXIjo1+nZLLBYTnfwlvPkM=", - "_location": "/import-lazy", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "import-lazy@^2.1.0", - "name": "import-lazy", - "escapedName": "import-lazy", - "rawSpec": "^2.1.0", - "saveSpec": null, - "fetchSpec": "^2.1.0" - }, - "_requiredBy": [ - "/update-notifier" - ], - "_resolved": "https://registry.npmjs.org/import-lazy/-/import-lazy-2.1.0.tgz", - "_shasum": "05698e3d45c88e8d7e9d92cb0584e77f096f3e43", - "_spec": "import-lazy@^2.1.0", - "_where": "/Users/rebecca/code/npm/node_modules/update-notifier", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "bugs": { - "url": "https://github.com/sindresorhus/import-lazy/issues" - }, - "bundleDependencies": false, - "contributors": [ - { - "name": "Jorge Bucaran", - "email": "jbucaran@me.com" - } - ], - "deprecated": false, - "description": "Import modules lazily", - "devDependencies": { - "ava": "*", - "xo": "*" - }, - "engines": { - "node": ">=4" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/sindresorhus/import-lazy#readme", - "keywords": [ - "import", - "require", - "load", - "module", - "modules", - "lazy", - "lazily", - "defer", - "deferred", - "proxy", - "proxies" - ], - "license": "MIT", - "name": "import-lazy", - "repository": { - "type": "git", - "url": "git+https://github.com/sindresorhus/import-lazy.git" - }, - "scripts": { - "test": "xo && ava" - }, - "version": "2.1.0" -} diff --git a/deps/npm/node_modules/import-lazy/readme.md b/deps/npm/node_modules/import-lazy/readme.md deleted file mode 100644 index 233e42e23b5e65..00000000000000 --- a/deps/npm/node_modules/import-lazy/readme.md +++ /dev/null @@ -1,64 +0,0 @@ -# import-lazy [![Build Status](https://travis-ci.org/sindresorhus/import-lazy.svg?branch=master)](https://travis-ci.org/sindresorhus/import-lazy) - -> Import modules lazily - - -## Install - -``` -$ npm install --save import-lazy -``` - - -## Usage - -```js -// Pass in `require` or a custom import function -const importLazy = require('import-lazy')(require); -const _ = importLazy('lodash'); - -// Where you would normally do -_.isNumber(2); - -// You now instead call it as a function -_().isNumber(2); - -// It's cached on consecutive calls -_().isString('unicorn'); - -// Extract lazy variations of the props you need -const members = importLazy('lodash')('isNumber', 'isString'); - -// Useful when using destructuring assignment in ES2015 -const {isNumber, isString} = importLazy('lodash')('isNumber', 'isString'); - -// Works out of the box for functions and regular properties -const stuff = importLazy('./math-lib')('sum', 'PHI'); -console.log(stuff.sum(1, 2)); // => 3 -console.log(stuff.PHI); // => 1.618033 -``` - -### Proxy support in Node.js 6 or later - -If you use Node.js 6 or later, you can take advantage of ES2015 proxies and don't need to call it as a function. - -```js -const importLazy = require('import-lazy').proxy(require); -const _ = importLazy('lodash'); - -// No need to call it as a function but still lazily imported -_.isNumber(2); -``` - -## Related - -- [resolve-from](https://github.com/sindresorhus/resolve-from) - Resolve the path of a module from a given path -- [import-from](https://github.com/sindresorhus/import-from) - Import a module from a given path -- [resolve-pkg](https://github.com/sindresorhus/resolve-pkg) - Resolve the path of a package regardless of it having an entry point -- [lazy-value](https://github.com/sindresorhus/lazy-value) - Create a lazily evaluated value -- [define-lazy-prop](https://github.com/sindresorhus/define-lazy-prop) - Define a lazily evaluated property on an object - - -## License - -MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/deps/npm/node_modules/imurmurhash/package.json b/deps/npm/node_modules/imurmurhash/package.json index b84f0ddf96bd48..8a93edb55a2245 100644 --- a/deps/npm/node_modules/imurmurhash/package.json +++ b/deps/npm/node_modules/imurmurhash/package.json @@ -1,57 +1,22 @@ { - "_args": [ - [ - "imurmurhash@0.1.4", - "/Users/rebecca/code/npm" - ] - ], - "_from": "imurmurhash@0.1.4", - "_id": "imurmurhash@0.1.4", - "_inBundle": false, - "_integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=", - "_location": "/imurmurhash", - "_phantomChildren": {}, - "_requested": { - "type": "version", - "registry": true, - "raw": "imurmurhash@0.1.4", - "name": "imurmurhash", - "escapedName": "imurmurhash", - "rawSpec": "0.1.4", - "saveSpec": null, - "fetchSpec": "0.1.4" - }, - "_requiredBy": [ - "/", - "/eslint", - "/fs-write-stream-atomic", - "/unique-slug", - "/write-file-atomic" - ], - "_resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", - "_spec": "0.1.4", - "_where": "/Users/rebecca/code/npm", - "author": { - "name": "Jens Taylor", - "email": "jensyt@gmail.com", - "url": "https://github.com/homebrewing" - }, - "bugs": { - "url": "https://github.com/jensyt/imurmurhash-js/issues" - }, - "dependencies": {}, + "name": "imurmurhash", + "version": "0.1.4", "description": "An incremental implementation of MurmurHash3", - "devDependencies": {}, - "engines": { - "node": ">=0.8.19" - }, + "homepage": "https://github.com/jensyt/imurmurhash-js", + "main": "imurmurhash.js", "files": [ "imurmurhash.js", "imurmurhash.min.js", "package.json", "README.md" ], - "homepage": "https://github.com/jensyt/imurmurhash-js", + "repository": { + "type": "git", + "url": "https://github.com/jensyt/imurmurhash-js" + }, + "bugs": { + "url": "https://github.com/jensyt/imurmurhash-js/issues" + }, "keywords": [ "murmur", "murmurhash", @@ -59,12 +24,17 @@ "hash", "incremental" ], + "author": { + "name": "Jens Taylor", + "email": "jensyt@gmail.com", + "url": "https://github.com/homebrewing" + }, "license": "MIT", - "main": "imurmurhash.js", - "name": "imurmurhash", - "repository": { - "type": "git", - "url": "git+https://github.com/jensyt/imurmurhash-js.git" + "dependencies": { + }, + "devDependencies": { }, - "version": "0.1.4" + "engines": { + "node": ">=0.8.19" + } } diff --git a/deps/npm/node_modules/indent-string/index.d.ts b/deps/npm/node_modules/indent-string/index.d.ts new file mode 100644 index 00000000000000..118523115645a0 --- /dev/null +++ b/deps/npm/node_modules/indent-string/index.d.ts @@ -0,0 +1,42 @@ +declare namespace indentString { + interface Options { + /** + The string to use for the indent. + + @default ' ' + */ + readonly indent?: string; + + /** + Also indent empty lines. + + @default false + */ + readonly includeEmptyLines?: boolean; + } +} + +/** +Indent each line in a string. + +@param string - The string to indent. +@param count - How many times you want `options.indent` repeated. Default: `1`. + +@example +``` +import indentString = require('indent-string'); + +indentString('Unicorns\nRainbows', 4); +//=> ' Unicorns\n Rainbows' + +indentString('Unicorns\nRainbows', 4, {indent: '♥'}); +//=> '♥♥♥♥Unicorns\n♥♥♥♥Rainbows' +``` +*/ +declare function indentString( + string: string, + count?: number, + options?: indentString.Options +): string; + +export = indentString; diff --git a/deps/npm/node_modules/indent-string/index.js b/deps/npm/node_modules/indent-string/index.js new file mode 100644 index 00000000000000..e1ab804f2fd8a1 --- /dev/null +++ b/deps/npm/node_modules/indent-string/index.js @@ -0,0 +1,35 @@ +'use strict'; + +module.exports = (string, count = 1, options) => { + options = { + indent: ' ', + includeEmptyLines: false, + ...options + }; + + if (typeof string !== 'string') { + throw new TypeError( + `Expected \`input\` to be a \`string\`, got \`${typeof string}\`` + ); + } + + if (typeof count !== 'number') { + throw new TypeError( + `Expected \`count\` to be a \`number\`, got \`${typeof count}\`` + ); + } + + if (typeof options.indent !== 'string') { + throw new TypeError( + `Expected \`options.indent\` to be a \`string\`, got \`${typeof options.indent}\`` + ); + } + + if (count === 0) { + return string; + } + + const regex = options.includeEmptyLines ? /^/gm : /^(?!\s*$)/gm; + + return string.replace(regex, options.indent.repeat(count)); +}; diff --git a/deps/npm/node_modules/global-dirs/license b/deps/npm/node_modules/indent-string/license similarity index 100% rename from deps/npm/node_modules/global-dirs/license rename to deps/npm/node_modules/indent-string/license diff --git a/deps/npm/node_modules/indent-string/package.json b/deps/npm/node_modules/indent-string/package.json new file mode 100644 index 00000000000000..497bb83bbd9b7f --- /dev/null +++ b/deps/npm/node_modules/indent-string/package.json @@ -0,0 +1,37 @@ +{ + "name": "indent-string", + "version": "4.0.0", + "description": "Indent each line in a string", + "license": "MIT", + "repository": "sindresorhus/indent-string", + "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": [ + "indent", + "string", + "pad", + "align", + "line", + "text", + "each", + "every" + ], + "devDependencies": { + "ava": "^1.4.1", + "tsd": "^0.7.2", + "xo": "^0.24.0" + } +} diff --git a/deps/npm/node_modules/indent-string/readme.md b/deps/npm/node_modules/indent-string/readme.md new file mode 100644 index 00000000000000..49967de074f2fd --- /dev/null +++ b/deps/npm/node_modules/indent-string/readme.md @@ -0,0 +1,70 @@ +# indent-string [![Build Status](https://travis-ci.org/sindresorhus/indent-string.svg?branch=master)](https://travis-ci.org/sindresorhus/indent-string) + +> Indent each line in a string + + +## Install + +``` +$ npm install indent-string +``` + + +## Usage + +```js +const indentString = require('indent-string'); + +indentString('Unicorns\nRainbows', 4); +//=> ' Unicorns\n Rainbows' + +indentString('Unicorns\nRainbows', 4, {indent: '♥'}); +//=> '♥♥♥♥Unicorns\n♥♥♥♥Rainbows' +``` + + +## API + +### indentString(string, [count], [options]) + +#### string + +Type: `string` + +The string to indent. + +#### count + +Type: `number`
    +Default: `1` + +How many times you want `options.indent` repeated. + +#### options + +Type: `object` + +##### indent + +Type: `string`
    +Default: `' '` + +The string to use for the indent. + +##### includeEmptyLines + +Type: `boolean`
    +Default: `false` + +Also indent empty lines. + + +## Related + +- [indent-string-cli](https://github.com/sindresorhus/indent-string-cli) - CLI for this module +- [strip-indent](https://github.com/sindresorhus/strip-indent) - Strip leading whitespace from every line in a string + + +## License + +MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/deps/npm/node_modules/infer-owner/package.json b/deps/npm/node_modules/infer-owner/package.json index 1b7b3e0509f426..c4b2b6e6df2067 100644 --- a/deps/npm/node_modules/infer-owner/package.json +++ b/deps/npm/node_modules/infer-owner/package.json @@ -1,63 +1,26 @@ { - "_from": "infer-owner@1.0.4", - "_id": "infer-owner@1.0.4", - "_inBundle": false, - "_integrity": "sha512-IClj+Xz94+d7irH5qRyfJonOdfTzuDaifE6ZPWfx0N0+/ATZCbuTPq2prFl526urkQd90WyUKIh1DfBQ2hMz9A==", - "_location": "/infer-owner", - "_phantomChildren": {}, - "_requested": { - "type": "version", - "registry": true, - "raw": "infer-owner@1.0.4", - "name": "infer-owner", - "escapedName": "infer-owner", - "rawSpec": "1.0.4", - "saveSpec": null, - "fetchSpec": "1.0.4" - }, - "_requiredBy": [ - "#USER", - "/" - ], - "_resolved": "https://registry.npmjs.org/infer-owner/-/infer-owner-1.0.4.tgz", - "_shasum": "c4cefcaa8e51051c2a40ba2ce8a3d27295af9467", - "_spec": "infer-owner@1.0.4", - "_where": "/Users/isaacs/dev/npm/cli", - "author": { - "name": "Isaac Z. Schlueter", - "email": "i@izs.me", - "url": "https://izs.me" - }, - "bugs": { - "url": "https://github.com/npm/infer-owner/issues" - }, - "bundleDependencies": false, - "deprecated": false, + "name": "infer-owner", + "version": "1.0.4", "description": "Infer the owner of a path based on the owner of its nearest existing parent", + "author": "Isaac Z. Schlueter (https://izs.me)", + "license": "ISC", + "scripts": { + "test": "tap -J test/*.js --100", + "snap": "TAP_SNAPSHOT=1 tap -J test/*.js --100", + "preversion": "npm test", + "postversion": "npm publish", + "postpublish": "git push origin --follow-tags" + }, "devDependencies": { "mutate-fs": "^2.1.1", "tap": "^12.4.2" }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/npm/infer-owner#readme", - "license": "ISC", "main": "index.js", - "name": "infer-owner", + "repository": "https://github.com/npm/infer-owner", "publishConfig": { "access": "public" }, - "repository": { - "type": "git", - "url": "git+https://github.com/npm/infer-owner.git" - }, - "scripts": { - "postpublish": "git push origin --follow-tags", - "postversion": "npm publish", - "preversion": "npm test", - "snap": "TAP_SNAPSHOT=1 tap -J test/*.js --100", - "test": "tap -J test/*.js --100" - }, - "version": "1.0.4" + "files": [ + "index.js" + ] } diff --git a/deps/npm/node_modules/inflight/package.json b/deps/npm/node_modules/inflight/package.json index d31d230a28b91a..6084d3509a5d6d 100644 --- a/deps/npm/node_modules/inflight/package.json +++ b/deps/npm/node_modules/inflight/package.json @@ -1,62 +1,29 @@ { - "_args": [ - [ - "inflight@1.0.6", - "/Users/rebecca/code/npm" - ] - ], - "_from": "inflight@1.0.6", - "_id": "inflight@1.0.6", - "_inBundle": false, - "_integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", - "_location": "/inflight", - "_phantomChildren": {}, - "_requested": { - "type": "version", - "registry": true, - "raw": "inflight@1.0.6", - "name": "inflight", - "escapedName": "inflight", - "rawSpec": "1.0.6", - "saveSpec": null, - "fetchSpec": "1.0.6" - }, - "_requiredBy": [ - "/", - "/glob" + "name": "inflight", + "version": "1.0.6", + "description": "Add callbacks to requests in flight to avoid async duplication", + "main": "inflight.js", + "files": [ + "inflight.js" ], - "_resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", - "_spec": "1.0.6", - "_where": "/Users/rebecca/code/npm", - "author": { - "name": "Isaac Z. Schlueter", - "email": "i@izs.me", - "url": "http://blog.izs.me/" - }, - "bugs": { - "url": "https://github.com/isaacs/inflight/issues" - }, "dependencies": { "once": "^1.3.0", "wrappy": "1" }, - "description": "Add callbacks to requests in flight to avoid async duplication", "devDependencies": { "tap": "^7.1.2" }, - "files": [ - "inflight.js" - ], - "homepage": "https://github.com/isaacs/inflight", - "license": "ISC", - "main": "inflight.js", - "name": "inflight", + "scripts": { + "test": "tap test.js --100" + }, "repository": { "type": "git", - "url": "git+https://github.com/npm/inflight.git" + "url": "https://github.com/npm/inflight.git" }, - "scripts": { - "test": "tap test.js --100" + "author": "Isaac Z. Schlueter (http://blog.izs.me/)", + "bugs": { + "url": "https://github.com/isaacs/inflight/issues" }, - "version": "1.0.6" + "homepage": "https://github.com/isaacs/inflight", + "license": "ISC" } diff --git a/deps/npm/node_modules/inherits/package.json b/deps/npm/node_modules/inherits/package.json index ab48b2a4b3dbf6..37b4366b83e63e 100644 --- a/deps/npm/node_modules/inherits/package.json +++ b/deps/npm/node_modules/inherits/package.json @@ -1,68 +1,7 @@ { - "_from": "inherits@2.0.4", - "_id": "inherits@2.0.4", - "_inBundle": false, - "_integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", - "_location": "/inherits", - "_phantomChildren": {}, - "_requested": { - "type": "version", - "registry": true, - "raw": "inherits@2.0.4", - "name": "inherits", - "escapedName": "inherits", - "rawSpec": "2.0.4", - "saveSpec": null, - "fetchSpec": "2.0.4" - }, - "_requiredBy": [ - "#USER", - "/", - "/are-we-there-yet/readable-stream", - "/block-stream", - "/cacache/glob", - "/concat-stream", - "/concat-stream/readable-stream", - "/duplexify", - "/duplexify/readable-stream", - "/flush-write-stream", - "/flush-write-stream/readable-stream", - "/from2", - "/from2/readable-stream", - "/fs-write-stream-atomic/readable-stream", - "/fstream", - "/glob", - "/node-gyp/tar", - "/parallel-transform", - "/parallel-transform/readable-stream", - "/pumpify", - "/readable-stream", - "/sorted-union-stream/from2", - "/sorted-union-stream/readable-stream", - "/stream-iterate/readable-stream", - "/tap-mocha-reporter/readable-stream", - "/tar-stream", - "/through2/readable-stream" - ], - "_resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "_shasum": "0fa2c64f932917c3433a0ded55363aae37416b7c", - "_spec": "inherits@2.0.4", - "_where": "/Users/isaacs/dev/npm/cli", - "browser": "./inherits_browser.js", - "bugs": { - "url": "https://github.com/isaacs/inherits/issues" - }, - "bundleDependencies": false, - "deprecated": false, + "name": "inherits", "description": "Browser-friendly inheritance fully compatible with standard node.js inherits()", - "devDependencies": { - "tap": "^14.2.4" - }, - "files": [ - "inherits.js", - "inherits_browser.js" - ], - "homepage": "https://github.com/isaacs/inherits#readme", + "version": "2.0.4", "keywords": [ "inheritance", "class", @@ -73,15 +12,18 @@ "browser", "browserify" ], - "license": "ISC", "main": "./inherits.js", - "name": "inherits", - "repository": { - "type": "git", - "url": "git://github.com/isaacs/inherits.git" - }, + "browser": "./inherits_browser.js", + "repository": "git://github.com/isaacs/inherits", + "license": "ISC", "scripts": { "test": "tap" }, - "version": "2.0.4" + "devDependencies": { + "tap": "^14.2.4" + }, + "files": [ + "inherits.js", + "inherits_browser.js" + ] } diff --git a/deps/npm/node_modules/ini/package.json b/deps/npm/node_modules/ini/package.json index e2d4423dcf76dd..269bc158dd3ab5 100644 --- a/deps/npm/node_modules/ini/package.json +++ b/deps/npm/node_modules/ini/package.json @@ -1,69 +1,30 @@ { - "_args": [ - [ - "ini@1.3.5", - "/Users/rebecca/code/npm" - ] - ], - "_from": "ini@1.3.5", - "_id": "ini@1.3.5", - "_inBundle": false, - "_integrity": "sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw==", - "_location": "/ini", - "_phantomChildren": {}, - "_requested": { - "type": "version", - "registry": true, - "raw": "ini@1.3.5", - "name": "ini", - "escapedName": "ini", - "rawSpec": "1.3.5", - "saveSpec": null, - "fetchSpec": "1.3.5" + "author": "Isaac Z. Schlueter (http://blog.izs.me/)", + "name": "ini", + "description": "An ini encoder/decoder for node", + "version": "1.3.5", + "repository": { + "type": "git", + "url": "git://github.com/isaacs/ini.git" }, - "_requiredBy": [ - "/", - "/config-chain", - "/global-dirs", - "/rc" - ], - "_resolved": "https://registry.npmjs.org/ini/-/ini-1.3.5.tgz", - "_spec": "1.3.5", - "_where": "/Users/rebecca/code/npm", - "author": { - "name": "Isaac Z. Schlueter", - "email": "i@izs.me", - "url": "http://blog.izs.me/" + "main": "ini.js", + "scripts": { + "pretest": "standard ini.js", + "test": "tap test/*.js --100 -J", + "preversion": "npm test", + "postversion": "npm publish", + "postpublish": "git push origin --all; git push origin --tags" }, - "bugs": { - "url": "https://github.com/isaacs/ini/issues" + "engines": { + "node": "*" }, "dependencies": {}, - "description": "An ini encoder/decoder for node", "devDependencies": { "standard": "^10.0.3", "tap": "^10.7.3 || 11" }, - "engines": { - "node": "*" - }, + "license": "ISC", "files": [ "ini.js" - ], - "homepage": "https://github.com/isaacs/ini#readme", - "license": "ISC", - "main": "ini.js", - "name": "ini", - "repository": { - "type": "git", - "url": "git://github.com/isaacs/ini.git" - }, - "scripts": { - "postpublish": "git push origin --all; git push origin --tags", - "postversion": "npm publish", - "pretest": "standard ini.js", - "preversion": "npm test", - "test": "tap test/*.js --100 -J" - }, - "version": "1.3.5" + ] } diff --git a/deps/npm/node_modules/init-package-json/node_modules/hosted-git-info/CHANGELOG.md b/deps/npm/node_modules/init-package-json/node_modules/hosted-git-info/CHANGELOG.md new file mode 100644 index 00000000000000..4f86601e029e95 --- /dev/null +++ b/deps/npm/node_modules/init-package-json/node_modules/hosted-git-info/CHANGELOG.md @@ -0,0 +1,141 @@ +# 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. + + +## [2.8.8](https://github.com/npm/hosted-git-info/compare/v2.8.7...v2.8.8) (2020-02-29) + + +### Bug Fixes + +* [#61](https://github.com/npm/hosted-git-info/issues/61) & [#65](https://github.com/npm/hosted-git-info/issues/65) addressing issues w/ url.URL implmentation which regressed node 6 support ([5038b18](https://github.com/npm/hosted-git-info/commit/5038b18)), closes [#66](https://github.com/npm/hosted-git-info/issues/66) + + + + +## [2.8.7](https://github.com/npm/hosted-git-info/compare/v2.8.6...v2.8.7) (2020-02-26) + + +### Bug Fixes + +* Do not attempt to use url.URL when unavailable ([2d0bb66](https://github.com/npm/hosted-git-info/commit/2d0bb66)), closes [#61](https://github.com/npm/hosted-git-info/issues/61) [#62](https://github.com/npm/hosted-git-info/issues/62) +* Do not pass scp-style URLs to the WhatWG url.URL ([f2cdfcf](https://github.com/npm/hosted-git-info/commit/f2cdfcf)), closes [#60](https://github.com/npm/hosted-git-info/issues/60) + + + + +## [2.8.6](https://github.com/npm/hosted-git-info/compare/v2.8.5...v2.8.6) (2020-02-25) + + + + +## [2.8.5](https://github.com/npm/hosted-git-info/compare/v2.8.4...v2.8.5) (2019-10-07) + + +### Bug Fixes + +* updated pathmatch for gitlab ([e8325b5](https://github.com/npm/hosted-git-info/commit/e8325b5)), closes [#51](https://github.com/npm/hosted-git-info/issues/51) +* updated pathmatch for gitlab ([ffe056f](https://github.com/npm/hosted-git-info/commit/ffe056f)) + + + + +## [2.8.4](https://github.com/npm/hosted-git-info/compare/v2.8.3...v2.8.4) (2019-08-12) + + + + +## [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/init-package-json/node_modules/hosted-git-info/LICENSE b/deps/npm/node_modules/init-package-json/node_modules/hosted-git-info/LICENSE new file mode 100644 index 00000000000000..45055763dc838d --- /dev/null +++ b/deps/npm/node_modules/init-package-json/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/init-package-json/node_modules/hosted-git-info/README.md b/deps/npm/node_modules/init-package-json/node_modules/hosted-git-info/README.md new file mode 100644 index 00000000000000..7b723f6b9e2134 --- /dev/null +++ b/deps/npm/node_modules/init-package-json/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/init-package-json/node_modules/hosted-git-info/git-host-info.js b/deps/npm/node_modules/init-package-json/node_modules/hosted-git-info/git-host-info.js new file mode 100644 index 00000000000000..8147e3348f5e80 --- /dev/null +++ b/deps/npm/node_modules/init-package-json/node_modules/hosted-git-info/git-host-info.js @@ -0,0 +1,79 @@ +'use strict' + +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\?=.*|\/repository\/[^/]+\/archive.tar.gz$)).*?)(?:[.]git|[/])?$/ + }, + gist: { + 'protocols': [ 'git', 'git+ssh', 'git+https', 'ssh', 'https' ], + 'domain': 'gist.github.com', + 'pathmatch': /^[/](?:([^/]+)[/])?([a-z0-9]{32,})(?:[.]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) + } + } +} + +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 +} + +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('|') + '):$') +}) + +function formatHashFragment (fragment) { + return fragment.toLowerCase().replace(/^\W+|\/|\W+$/g, '').replace(/\W+/g, '-') +} diff --git a/deps/npm/node_modules/init-package-json/node_modules/hosted-git-info/git-host.js b/deps/npm/node_modules/init-package-json/node_modules/hosted-git-info/git-host.js new file mode 100644 index 00000000000000..9616fbaa6b4af0 --- /dev/null +++ b/deps/npm/node_modules/init-package-json/node_modules/hosted-git-info/git-host.js @@ -0,0 +1,156 @@ +'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 + + var keys = Object.keys(source) + var i = keys.length + while (i--) { + target[keys[i]] = source[keys[i]] + } + return target +} + +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 || {} +} + +GitHost.prototype.hash = function () { + return this.committish ? '#' + this.committish : '' +} + +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 { + vars[key] = encodeURIComponent(value) + } + }) + 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 + } +} + +GitHost.prototype.ssh = function (opts) { + return this._fill(this.sshtemplate, opts) +} + +GitHost.prototype.sshurl = function (opts) { + return this._fill(this.sshurltemplate, opts) +} + +GitHost.prototype.browse = function (P, F, opts) { + if (typeof P === 'string') { + if (typeof F !== 'string') { + opts = F + F = null + } + return this._fill(this.browsefiletemplate, extend({ + fragment: F, + path: P + }, opts)) + } else { + return this._fill(this.browsetemplate, P) + } +} + +GitHost.prototype.docs = function (opts) { + return this._fill(this.docstemplate, opts) +} + +GitHost.prototype.bugs = function (opts) { + return this._fill(this.bugstemplate, opts) +} + +GitHost.prototype.https = function (opts) { + return this._fill(this.httpstemplate, opts) +} + +GitHost.prototype.git = function (opts) { + return this._fill(this.gittemplate, opts) +} + +GitHost.prototype.shortcut = function (opts) { + return this._fill(this.shortcuttemplate, opts) +} + +GitHost.prototype.path = function (opts) { + return this._fill(this.pathtemplate, opts) +} + +GitHost.prototype.tarball = function (opts_) { + var opts = extend({}, opts_, { noCommittish: false }) + return this._fill(this.tarballtemplate, opts) +} + +GitHost.prototype.file = function (P, opts) { + return this._fill(this.filetemplate, extend({ path: P }, opts)) +} + +GitHost.prototype.getDefaultRepresentation = function () { + return this.default +} + +GitHost.prototype.toString = function (opts) { + if (this.default && typeof this[this.default] === 'function') return this[this.default](opts) + return this.sshurl(opts) +} diff --git a/deps/npm/node_modules/init-package-json/node_modules/hosted-git-info/index.js b/deps/npm/node_modules/init-package-json/node_modules/hosted-git-info/index.js new file mode 100644 index 00000000000000..21e53fe3724be1 --- /dev/null +++ b/deps/npm/node_modules/init-package-json/node_modules/hosted-git-info/index.js @@ -0,0 +1,148 @@ +'use strict' +var url = require('url') +var gitHosts = require('./git-host-info.js') +var GitHost = module.exports = require('./git-host.js') + +var protocolToRepresentationMap = { + 'git+ssh:': 'sshurl', + 'git+https:': 'https', + 'ssh:': 'sshurl', + 'git:': 'git' +} + +function protocolToRepresentation (protocol) { + return protocolToRepresentationMap[protocol] || protocol.slice(0, -1) +} + +var authProtocols = { + 'git:': true, + 'https:': true, + 'git+https:': true, + 'http:': true, + 'git+http:': true +} + +var cache = {} + +module.exports.fromUrl = function (giturl, opts) { + if (typeof giturl !== 'string') return + var key = giturl + JSON.stringify(opts || {}) + + if (!(key in cache)) { + cache[key] = fromUrl(giturl, opts) + } + + return cache[key] +} + +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(new RegExp('^([^:]+):(?:(?:[^@:]+(?:[^@]+)?@)?([^/]*))[/](.+?)(?:[.]git)?($|#)')) + 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 + } + 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]) + 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(/^:/, '')) + } + project = decodeURIComponent(matched[2]) + defaultRepresentation = protocolToRepresentation(parsed.protocol) + } + return new GitHost(gitHostName, user, auth, project, committish, defaultRepresentation, opts) + } catch (ex) { + /* istanbul ignore else */ + if (ex instanceof URIError) { + } else throw ex + } + }).filter(function (gitHostInfo) { return gitHostInfo }) + if (matches.length !== 1) return + return matches[0] +} + +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) +} + +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 + } +} + +function parseGitUrl (giturl) { + var matched = giturl.match(/^([^@]+)@([^:/]+):[/]?((?:[^/]+[/])?[^/]+?)(?:[.]git)?(#.*)?$/) + if (!matched) { + var legacy = url.parse(giturl) + // If we don't have url.URL, then sorry, this is just not fixable. + // This affects Node <= 6.12. + if (legacy.auth && typeof url.URL === 'function') { + // 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. + var 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 + } + } + 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] || '') + } +} diff --git a/deps/npm/node_modules/init-package-json/node_modules/hosted-git-info/package.json b/deps/npm/node_modules/init-package-json/node_modules/hosted-git-info/package.json new file mode 100644 index 00000000000000..e47c096ef2a620 --- /dev/null +++ b/deps/npm/node_modules/init-package-json/node_modules/hosted-git-info/package.json @@ -0,0 +1,40 @@ +{ + "name": "hosted-git-info", + "version": "2.8.8", + "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": { + "prerelease": "npm t", + "postrelease": "npm publish --tag=ancient-legacy-fixes && git push --follow-tags", + "posttest": "standard", + "release": "standard-version -s", + "test:coverage": "tap --coverage-report=html -J --coverage=90 --no-esm test/*.js", + "test": "tap -J --coverage=90 --no-esm test/*.js" + }, + "devDependencies": { + "standard": "^11.0.1", + "standard-version": "^4.4.0", + "tap": "^12.7.0" + }, + "files": [ + "index.js", + "git-host.js", + "git-host-info.js" + ] +} diff --git a/deps/npm/node_modules/init-package-json/node_modules/npm-package-arg/CHANGELOG.md b/deps/npm/node_modules/init-package-json/node_modules/npm-package-arg/CHANGELOG.md new file mode 100644 index 00000000000000..1b3431acced775 --- /dev/null +++ b/deps/npm/node_modules/init-package-json/node_modules/npm-package-arg/CHANGELOG.md @@ -0,0 +1,26 @@ +# 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. + + +## [6.1.1](https://github.com/npm/npm-package-arg/compare/v6.1.0...v6.1.1) (2019-08-21) + + +### Bug Fixes + +* preserve drive letter on windows git file:// urls ([3909203](https://github.com/npm/npm-package-arg/commit/3909203)) + + + + +# [6.1.0](https://github.com/npm/npm-package-arg/compare/v6.0.0...v6.1.0) (2018-04-10) + + +### Bug Fixes + +* **git:** Fix gitRange for git+ssh for private git ([#33](https://github.com/npm/npm-package-arg/issues/33)) ([647a0b3](https://github.com/npm/npm-package-arg/commit/647a0b3)) + + +### Features + +* **alias:** add `npm:` registry alias spec ([#34](https://github.com/npm/npm-package-arg/issues/34)) ([ab99f8e](https://github.com/npm/npm-package-arg/commit/ab99f8e)) diff --git a/deps/npm/node_modules/uid-number/LICENSE b/deps/npm/node_modules/init-package-json/node_modules/npm-package-arg/LICENSE similarity index 100% rename from deps/npm/node_modules/uid-number/LICENSE rename to deps/npm/node_modules/init-package-json/node_modules/npm-package-arg/LICENSE diff --git a/deps/npm/node_modules/init-package-json/node_modules/npm-package-arg/README.md b/deps/npm/node_modules/init-package-json/node_modules/npm-package-arg/README.md new file mode 100644 index 00000000000000..847341b21a3b78 --- /dev/null +++ b/deps/npm/node_modules/init-package-json/node_modules/npm-package-arg/README.md @@ -0,0 +1,83 @@ +# npm-package-arg + +[![Build Status](https://travis-ci.org/npm/npm-package-arg.svg?branch=master)](https://travis-ci.org/npm/npm-package-arg) + +Parses package name and specifier passed to commands like `npm install` or +`npm cache add`, or as found in `package.json` dependency sections. + +## EXAMPLES + +```javascript +var assert = require("assert") +var npa = require("npm-package-arg") + +// Pass in the descriptor, and it'll return an object +try { + var parsed = npa("@bar/foo@1.2") +} catch (ex) { + … +} +``` + +## USING + +`var npa = require('npm-package-arg')` + +### var result = npa(*arg*[, *where*]) + +* *arg* - a string that you might pass to `npm install`, like: +`foo@1.2`, `@bar/foo@1.2`, `foo@user/foo`, `http://x.com/foo.tgz`, +`git+https://github.com/user/foo`, `bitbucket:user/foo`, `foo.tar.gz`, +`../foo/bar/` or `bar`. If the *arg* you provide doesn't have a specifier +part, eg `foo` then the specifier will default to `latest`. +* *where* - Optionally the path to resolve file paths relative to. Defaults to `process.cwd()` + +**Throws** if the package name is invalid, a dist-tag is invalid or a URL's protocol is not supported. + +### var result = npa.resolve(*name*, *spec*[, *where*]) + +* *name* - The name of the module you want to install. For example: `foo` or `@bar/foo`. +* *spec* - The specifier indicating where and how you can get this module. Something like: +`1.2`, `^1.7.17`, `http://x.com/foo.tgz`, `git+https://github.com/user/foo`, +`bitbucket:user/foo`, `file:foo.tar.gz` or `file:../foo/bar/`. If not +included then the default is `latest`. +* *where* - Optionally the path to resolve file paths relative to. Defaults to `process.cwd()` + +**Throws** if the package name is invalid, a dist-tag is invalid or a URL's protocol is not supported. + +## RESULT OBJECT + +The objects that are returned by npm-package-arg contain the following +keys: + +* `type` - One of the following strings: + * `git` - A git repo + * `tag` - A tagged version, like `"foo@latest"` + * `version` - A specific version number, like `"foo@1.2.3"` + * `range` - A version range, like `"foo@2.x"` + * `file` - A local `.tar.gz`, `.tar` or `.tgz` file. + * `directory` - A local directory. + * `remote` - An http url (presumably to a tgz) +* `registry` - If true this specifier refers to a resource hosted on a + registry. This is true for `tag`, `version` and `range` types. +* `name` - If known, the `name` field expected in the resulting pkg. +* `scope` - If a name is something like `@org/module` then the `scope` + field will be set to `@org`. If it doesn't have a scoped name, then + scope is `null`. +* `escapedName` - A version of `name` escaped to match the npm scoped packages + specification. Mostly used when making requests against a registry. When + `name` is `null`, `escapedName` will also be `null`. +* `rawSpec` - The specifier part that was parsed out in calls to `npa(arg)`, + or the value of `spec` in calls to `npa.resolve(name, spec). +* `saveSpec` - The normalized specifier, for saving to package.json files. + `null` for registry dependencies. +* `fetchSpec` - The version of the specifier to be used to fetch this + resource. `null` for shortcuts to hosted git dependencies as there isn't + just one URL to try with them. +* `gitRange` - If set, this is a semver specifier to match against git tags with +* `gitCommittish` - If set, this is the specific committish to use with a git dependency. +* `hosted` - If `from === 'hosted'` then this will be a `hosted-git-info` + object. This property is not included when serializing the object as + JSON. +* `raw` - The original un-modified string that was provided. If called as + `npa.resolve(name, spec)` then this will be `name + '@' + spec`. diff --git a/deps/npm/node_modules/init-package-json/node_modules/npm-package-arg/npa.js b/deps/npm/node_modules/init-package-json/node_modules/npm-package-arg/npa.js new file mode 100644 index 00000000000000..bf2c17cfd513fb --- /dev/null +++ b/deps/npm/node_modules/init-package-json/node_modules/npm-package-arg/npa.js @@ -0,0 +1,301 @@ +'use strict' +module.exports = npa +module.exports.resolve = resolve +module.exports.Result = Result + +let url +let HostedGit +let semver +let path_ +function path () { + if (!path_) path_ = require('path') + return path_ +} +let validatePackageName +let osenv + +const isWindows = process.platform === 'win32' || global.FAKE_WINDOWS +const hasSlashes = isWindows ? /\\|[/]/ : /[/]/ +const isURL = /^(?:git[+])?[a-z]+:/i +const isFilename = /[.](?:tgz|tar.gz|tar)$/i + +function npa (arg, where) { + let name + let spec + if (typeof arg === 'object') { + if (arg instanceof Result && (!where || where === arg.where)) { + return arg + } else if (arg.name && arg.rawSpec) { + return npa.resolve(arg.name, arg.rawSpec, where || arg.where) + } else { + return npa(arg.raw, where || arg.where) + } + } + const nameEndsAt = arg[0] === '@' ? arg.slice(1).indexOf('@') + 1 : arg.indexOf('@') + const namePart = nameEndsAt > 0 ? arg.slice(0, nameEndsAt) : arg + if (isURL.test(arg)) { + spec = arg + } else if (namePart[0] !== '@' && (hasSlashes.test(namePart) || isFilename.test(namePart))) { + spec = arg + } else if (nameEndsAt > 0) { + name = namePart + spec = arg.slice(nameEndsAt + 1) + } else { + if (!validatePackageName) validatePackageName = require('validate-npm-package-name') + const valid = validatePackageName(arg) + if (valid.validForOldPackages) { + name = arg + } else { + spec = arg + } + } + return resolve(name, spec, where, arg) +} + +const isFilespec = isWindows ? /^(?:[.]|~[/]|[/\\]|[a-zA-Z]:)/ : /^(?:[.]|~[/]|[/]|[a-zA-Z]:)/ + +function resolve (name, spec, where, arg) { + const res = new Result({ + raw: arg, + name: name, + rawSpec: spec, + fromArgument: arg != null + }) + + if (name) res.setName(name) + + if (spec && (isFilespec.test(spec) || /^file:/i.test(spec))) { + return fromFile(res, where) + } else if (spec && /^npm:/i.test(spec)) { + return fromAlias(res, where) + } + if (!HostedGit) HostedGit = require('hosted-git-info') + const hosted = HostedGit.fromUrl(spec, {noGitPlus: true, noCommittish: true}) + if (hosted) { + return fromHostedGit(res, hosted) + } else if (spec && isURL.test(spec)) { + return fromURL(res) + } else if (spec && (hasSlashes.test(spec) || isFilename.test(spec))) { + return fromFile(res, where) + } else { + return fromRegistry(res) + } +} + +function invalidPackageName (name, valid) { + const err = new Error(`Invalid package name "${name}": ${valid.errors.join('; ')}`) + err.code = 'EINVALIDPACKAGENAME' + return err +} +function invalidTagName (name) { + const err = new Error(`Invalid tag name "${name}": Tags may not have any characters that encodeURIComponent encodes.`) + err.code = 'EINVALIDTAGNAME' + return err +} + +function Result (opts) { + this.type = opts.type + this.registry = opts.registry + this.where = opts.where + if (opts.raw == null) { + this.raw = opts.name ? opts.name + '@' + opts.rawSpec : opts.rawSpec + } else { + this.raw = opts.raw + } + this.name = undefined + this.escapedName = undefined + this.scope = undefined + this.rawSpec = opts.rawSpec == null ? '' : opts.rawSpec + this.saveSpec = opts.saveSpec + this.fetchSpec = opts.fetchSpec + if (opts.name) this.setName(opts.name) + this.gitRange = opts.gitRange + this.gitCommittish = opts.gitCommittish + this.hosted = opts.hosted +} + +Result.prototype.setName = function (name) { + if (!validatePackageName) validatePackageName = require('validate-npm-package-name') + const valid = validatePackageName(name) + if (!valid.validForOldPackages) { + throw invalidPackageName(name, valid) + } + this.name = name + this.scope = name[0] === '@' ? name.slice(0, name.indexOf('/')) : undefined + // scoped packages in couch must have slash url-encoded, e.g. @foo%2Fbar + this.escapedName = name.replace('/', '%2f') + return this +} + +Result.prototype.toString = function () { + const full = [] + if (this.name != null && this.name !== '') full.push(this.name) + const spec = this.saveSpec || this.fetchSpec || this.rawSpec + if (spec != null && spec !== '') full.push(spec) + return full.length ? full.join('@') : this.raw +} + +Result.prototype.toJSON = function () { + const result = Object.assign({}, this) + delete result.hosted + return result +} + +function setGitCommittish (res, committish) { + if (committish != null && committish.length >= 7 && committish.slice(0, 7) === 'semver:') { + res.gitRange = decodeURIComponent(committish.slice(7)) + res.gitCommittish = null + } else { + res.gitCommittish = committish === '' ? null : committish + } + return res +} + +const isAbsolutePath = /^[/]|^[A-Za-z]:/ + +function resolvePath (where, spec) { + if (isAbsolutePath.test(spec)) return spec + return path().resolve(where, spec) +} + +function isAbsolute (dir) { + if (dir[0] === '/') return true + if (/^[A-Za-z]:/.test(dir)) return true + return false +} + +function fromFile (res, where) { + if (!where) where = process.cwd() + res.type = isFilename.test(res.rawSpec) ? 'file' : 'directory' + res.where = where + + const spec = res.rawSpec.replace(/\\/g, '/') + .replace(/^file:[/]*([A-Za-z]:)/, '$1') // drive name paths on windows + .replace(/^file:(?:[/]*([~./]))?/, '$1') + if (/^~[/]/.test(spec)) { + // this is needed for windows and for file:~/foo/bar + if (!osenv) osenv = require('osenv') + res.fetchSpec = resolvePath(osenv.home(), spec.slice(2)) + res.saveSpec = 'file:' + spec + } else { + res.fetchSpec = resolvePath(where, spec) + if (isAbsolute(spec)) { + res.saveSpec = 'file:' + spec + } else { + res.saveSpec = 'file:' + path().relative(where, res.fetchSpec) + } + } + return res +} + +function fromHostedGit (res, hosted) { + res.type = 'git' + res.hosted = hosted + res.saveSpec = hosted.toString({noGitPlus: false, noCommittish: false}) + res.fetchSpec = hosted.getDefaultRepresentation() === 'shortcut' ? null : hosted.toString() + return setGitCommittish(res, hosted.committish) +} + +function unsupportedURLType (protocol, spec) { + const err = new Error(`Unsupported URL Type "${protocol}": ${spec}`) + err.code = 'EUNSUPPORTEDPROTOCOL' + return err +} + +function matchGitScp (spec) { + // git ssh specifiers are overloaded to also use scp-style git + // specifiers, so we have to parse those out and treat them special. + // They are NOT true URIs, so we can't hand them to `url.parse`. + // + // This regex looks for things that look like: + // git+ssh://git@my.custom.git.com:username/project.git#deadbeef + // + // ...and various combinations. The username in the beginning is *required*. + const matched = spec.match(/^git\+ssh:\/\/([^:#]+:[^#]+(?:\.git)?)(?:#(.*))?$/i) + return matched && !matched[1].match(/:[0-9]+\/?.*$/i) && { + fetchSpec: matched[1], + gitCommittish: matched[2] == null ? null : matched[2] + } +} + +function fromURL (res) { + if (!url) url = require('url') + const urlparse = url.parse(res.rawSpec) + res.saveSpec = res.rawSpec + // check the protocol, and then see if it's git or not + switch (urlparse.protocol) { + case 'git:': + case 'git+http:': + case 'git+https:': + case 'git+rsync:': + case 'git+ftp:': + case 'git+file:': + case 'git+ssh:': + res.type = 'git' + const match = urlparse.protocol === 'git+ssh:' && matchGitScp(res.rawSpec) + if (match) { + setGitCommittish(res, match.gitCommittish) + res.fetchSpec = match.fetchSpec + } else { + setGitCommittish(res, urlparse.hash != null ? urlparse.hash.slice(1) : '') + urlparse.protocol = urlparse.protocol.replace(/^git[+]/, '') + if (urlparse.protocol === 'file:' && /^git\+file:\/\/[a-z]:/i.test(res.rawSpec)) { + // keep the drive letter : on windows file paths + urlparse.host += ':' + urlparse.hostname += ':' + } + delete urlparse.hash + res.fetchSpec = url.format(urlparse) + } + break + case 'http:': + case 'https:': + res.type = 'remote' + res.fetchSpec = res.saveSpec + break + + default: + throw unsupportedURLType(urlparse.protocol, res.rawSpec) + } + + return res +} + +function fromAlias (res, where) { + const subSpec = npa(res.rawSpec.substr(4), where) + if (subSpec.type === 'alias') { + throw new Error('nested aliases not supported') + } + if (!subSpec.registry) { + throw new Error('aliases only work for registry deps') + } + res.subSpec = subSpec + res.registry = true + res.type = 'alias' + res.saveSpec = null + res.fetchSpec = null + return res +} + +function fromRegistry (res) { + res.registry = true + const spec = res.rawSpec === '' ? 'latest' : res.rawSpec + // no save spec for registry components as we save based on the fetched + // version, not on the argument so this can't compute that. + res.saveSpec = null + res.fetchSpec = spec + if (!semver) semver = require('semver') + const version = semver.valid(spec, true) + const range = semver.validRange(spec, true) + if (version) { + res.type = 'version' + } else if (range) { + res.type = 'range' + } else { + if (encodeURIComponent(spec) !== spec) { + throw invalidTagName(spec) + } + res.type = 'tag' + } + return res +} diff --git a/deps/npm/node_modules/init-package-json/node_modules/npm-package-arg/package.json b/deps/npm/node_modules/init-package-json/node_modules/npm-package-arg/package.json new file mode 100644 index 00000000000000..4c11182d2cff7d --- /dev/null +++ b/deps/npm/node_modules/init-package-json/node_modules/npm-package-arg/package.json @@ -0,0 +1,44 @@ +{ + "name": "npm-package-arg", + "version": "6.1.1", + "description": "Parse the things that can be arguments to `npm install`", + "main": "npa.js", + "directories": { + "test": "test" + }, + "files": [ + "npa.js" + ], + "dependencies": { + "hosted-git-info": "^2.7.1", + "osenv": "^0.1.5", + "semver": "^5.6.0", + "validate-npm-package-name": "^3.0.0" + }, + "devDependencies": { + "standard": "^11.0.1", + "standard-version": "^4.4.0", + "tap": "^12.5.0", + "weallbehave": "^1.2.0", + "weallcontribute": "^1.0.8" + }, + "scripts": { + "prerelease": "npm t", + "postrelease": "npm publish && git push --follow-tags", + "pretest": "standard", + "release": "standard-version -s", + "test": "tap --100 -J --coverage test/*.js", + "update-coc": "weallbehave -o . && git add CODE_OF_CONDUCT.md && git commit -m 'docs(coc): updated CODE_OF_CONDUCT.md'", + "update-contrib": "weallcontribute -o . && git add CONTRIBUTING.md && git commit -m 'docs(contributing): updated CONTRIBUTING.md'" + }, + "repository": { + "type": "git", + "url": "https://github.com/npm/npm-package-arg" + }, + "author": "Isaac Z. Schlueter (http://blog.izs.me/)", + "license": "ISC", + "bugs": { + "url": "https://github.com/npm/npm-package-arg/issues" + }, + "homepage": "https://github.com/npm/npm-package-arg" +} diff --git a/deps/npm/node_modules/init-package-json/node_modules/semver/CHANGELOG.md b/deps/npm/node_modules/init-package-json/node_modules/semver/CHANGELOG.md new file mode 100644 index 00000000000000..66304fdd23678a --- /dev/null +++ b/deps/npm/node_modules/init-package-json/node_modules/semver/CHANGELOG.md @@ -0,0 +1,39 @@ +# changes log + +## 5.7 + +* Add `minVersion` method + +## 5.6 + +* Move boolean `loose` param to an options object, with + backwards-compatibility protection. +* Add ability to opt out of special prerelease version handling with + the `includePrerelease` option flag. + +## 5.5 + +* Add version coercion capabilities + +## 5.4 + +* Add intersection checking + +## 5.3 + +* Add `minSatisfying` method + +## 5.2 + +* Add `prerelease(v)` that returns prerelease components + +## 5.1 + +* Add Backus-Naur for ranges +* Remove excessively cute inspection methods + +## 5.0 + +* Remove AMD/Browserified build artifacts +* Fix ltr and gtr when using the `*` range +* Fix for range `*` with a prerelease identifier diff --git a/deps/npm/node_modules/cross-spawn/node_modules/lru-cache/LICENSE b/deps/npm/node_modules/init-package-json/node_modules/semver/LICENSE similarity index 100% rename from deps/npm/node_modules/cross-spawn/node_modules/lru-cache/LICENSE rename to deps/npm/node_modules/init-package-json/node_modules/semver/LICENSE diff --git a/deps/npm/node_modules/init-package-json/node_modules/semver/README.md b/deps/npm/node_modules/init-package-json/node_modules/semver/README.md new file mode 100644 index 00000000000000..f8dfa5a0df5fc4 --- /dev/null +++ b/deps/npm/node_modules/init-package-json/node_modules/semver/README.md @@ -0,0 +1,412 @@ +semver(1) -- The semantic versioner for npm +=========================================== + +## Install + +```bash +npm install --save semver +```` + +## Usage + +As a node module: + +```js +const semver = require('semver') + +semver.valid('1.2.3') // '1.2.3' +semver.valid('a.b.c') // null +semver.clean(' =v1.2.3 ') // '1.2.3' +semver.satisfies('1.2.3', '1.x || >=2.5.0 || 5.0.0 - 7.2.3') // true +semver.gt('1.2.3', '9.8.7') // false +semver.lt('1.2.3', '9.8.7') // true +semver.minVersion('>=1.0.0') // '1.0.0' +semver.valid(semver.coerce('v2')) // '2.0.0' +semver.valid(semver.coerce('42.6.7.9.3-alpha')) // '42.6.7' +``` + +As a command-line utility: + +``` +$ semver -h + +A JavaScript implementation of the https://semver.org/ specification +Copyright Isaac Z. Schlueter + +Usage: semver [options] [ [...]] +Prints valid versions sorted by SemVer precedence + +Options: +-r --range + Print versions that match the specified range. + +-i --increment [] + Increment a version by the specified level. Level can + be one of: major, minor, patch, premajor, preminor, + prepatch, or prerelease. Default level is 'patch'. + Only one version may be specified. + +--preid + Identifier to be used to prefix premajor, preminor, + prepatch or prerelease version increments. + +-l --loose + Interpret versions and ranges loosely + +-p --include-prerelease + Always include prerelease versions in range matching + +-c --coerce + Coerce a string into SemVer if possible + (does not imply --loose) + +Program exits successfully if any valid version satisfies +all supplied ranges, and prints all satisfying versions. + +If no satisfying versions are found, then exits failure. + +Versions are printed in ascending order, so supplying +multiple versions to the utility will just sort them. +``` + +## Versions + +A "version" is described by the `v2.0.0` specification found at +. + +A leading `"="` or `"v"` character is stripped off and ignored. + +## Ranges + +A `version range` is a set of `comparators` which specify versions +that satisfy the range. + +A `comparator` is composed of an `operator` and a `version`. The set +of primitive `operators` is: + +* `<` Less than +* `<=` Less than or equal to +* `>` Greater than +* `>=` Greater than or equal to +* `=` Equal. If no operator is specified, then equality is assumed, + so this operator is optional, but MAY be included. + +For example, the comparator `>=1.2.7` would match the versions +`1.2.7`, `1.2.8`, `2.5.3`, and `1.3.9`, but not the versions `1.2.6` +or `1.1.0`. + +Comparators can be joined by whitespace to form a `comparator set`, +which is satisfied by the **intersection** of all of the comparators +it includes. + +A range is composed of one or more comparator sets, joined by `||`. A +version matches a range if and only if every comparator in at least +one of the `||`-separated comparator sets is satisfied by the version. + +For example, the range `>=1.2.7 <1.3.0` would match the versions +`1.2.7`, `1.2.8`, and `1.2.99`, but not the versions `1.2.6`, `1.3.0`, +or `1.1.0`. + +The range `1.2.7 || >=1.2.9 <2.0.0` would match the versions `1.2.7`, +`1.2.9`, and `1.4.6`, but not the versions `1.2.8` or `2.0.0`. + +### Prerelease Tags + +If a version has a prerelease tag (for example, `1.2.3-alpha.3`) then +it will only be allowed to satisfy comparator sets if at least one +comparator with the same `[major, minor, patch]` tuple also has a +prerelease tag. + +For example, the range `>1.2.3-alpha.3` would be allowed to match the +version `1.2.3-alpha.7`, but it would *not* be satisfied by +`3.4.5-alpha.9`, even though `3.4.5-alpha.9` is technically "greater +than" `1.2.3-alpha.3` according to the SemVer sort rules. The version +range only accepts prerelease tags on the `1.2.3` version. The +version `3.4.5` *would* satisfy the range, because it does not have a +prerelease flag, and `3.4.5` is greater than `1.2.3-alpha.7`. + +The purpose for this behavior is twofold. First, prerelease versions +frequently are updated very quickly, and contain many breaking changes +that are (by the author's design) not yet fit for public consumption. +Therefore, by default, they are excluded from range matching +semantics. + +Second, a user who has opted into using a prerelease version has +clearly indicated the intent to use *that specific* set of +alpha/beta/rc versions. By including a prerelease tag in the range, +the user is indicating that they are aware of the risk. However, it +is still not appropriate to assume that they have opted into taking a +similar risk on the *next* set of prerelease versions. + +Note that this behavior can be suppressed (treating all prerelease +versions as if they were normal versions, for the purpose of range +matching) by setting the `includePrerelease` flag on the options +object to any +[functions](https://github.com/npm/node-semver#functions) that do +range matching. + +#### Prerelease Identifiers + +The method `.inc` takes an additional `identifier` string argument that +will append the value of the string as a prerelease identifier: + +```javascript +semver.inc('1.2.3', 'prerelease', 'beta') +// '1.2.4-beta.0' +``` + +command-line example: + +```bash +$ semver 1.2.3 -i prerelease --preid beta +1.2.4-beta.0 +``` + +Which then can be used to increment further: + +```bash +$ semver 1.2.4-beta.0 -i prerelease +1.2.4-beta.1 +``` + +### Advanced Range Syntax + +Advanced range syntax desugars to primitive comparators in +deterministic ways. + +Advanced ranges may be combined in the same way as primitive +comparators using white space or `||`. + +#### Hyphen Ranges `X.Y.Z - A.B.C` + +Specifies an inclusive set. + +* `1.2.3 - 2.3.4` := `>=1.2.3 <=2.3.4` + +If a partial version is provided as the first version in the inclusive +range, then the missing pieces are replaced with zeroes. + +* `1.2 - 2.3.4` := `>=1.2.0 <=2.3.4` + +If a partial version is provided as the second version in the +inclusive range, then all versions that start with the supplied parts +of the tuple are accepted, but nothing that would be greater than the +provided tuple parts. + +* `1.2.3 - 2.3` := `>=1.2.3 <2.4.0` +* `1.2.3 - 2` := `>=1.2.3 <3.0.0` + +#### X-Ranges `1.2.x` `1.X` `1.2.*` `*` + +Any of `X`, `x`, or `*` may be used to "stand in" for one of the +numeric values in the `[major, minor, patch]` tuple. + +* `*` := `>=0.0.0` (Any version satisfies) +* `1.x` := `>=1.0.0 <2.0.0` (Matching major version) +* `1.2.x` := `>=1.2.0 <1.3.0` (Matching major and minor versions) + +A partial version range is treated as an X-Range, so the special +character is in fact optional. + +* `""` (empty string) := `*` := `>=0.0.0` +* `1` := `1.x.x` := `>=1.0.0 <2.0.0` +* `1.2` := `1.2.x` := `>=1.2.0 <1.3.0` + +#### Tilde Ranges `~1.2.3` `~1.2` `~1` + +Allows patch-level changes if a minor version is specified on the +comparator. Allows minor-level changes if not. + +* `~1.2.3` := `>=1.2.3 <1.(2+1).0` := `>=1.2.3 <1.3.0` +* `~1.2` := `>=1.2.0 <1.(2+1).0` := `>=1.2.0 <1.3.0` (Same as `1.2.x`) +* `~1` := `>=1.0.0 <(1+1).0.0` := `>=1.0.0 <2.0.0` (Same as `1.x`) +* `~0.2.3` := `>=0.2.3 <0.(2+1).0` := `>=0.2.3 <0.3.0` +* `~0.2` := `>=0.2.0 <0.(2+1).0` := `>=0.2.0 <0.3.0` (Same as `0.2.x`) +* `~0` := `>=0.0.0 <(0+1).0.0` := `>=0.0.0 <1.0.0` (Same as `0.x`) +* `~1.2.3-beta.2` := `>=1.2.3-beta.2 <1.3.0` Note that prereleases in + the `1.2.3` version will be allowed, if they are greater than or + equal to `beta.2`. So, `1.2.3-beta.4` would be allowed, but + `1.2.4-beta.2` would not, because it is a prerelease of a + different `[major, minor, patch]` tuple. + +#### Caret Ranges `^1.2.3` `^0.2.5` `^0.0.4` + +Allows changes that do not modify the left-most non-zero digit in the +`[major, minor, patch]` tuple. In other words, this allows patch and +minor updates for versions `1.0.0` and above, patch updates for +versions `0.X >=0.1.0`, and *no* updates for versions `0.0.X`. + +Many authors treat a `0.x` version as if the `x` were the major +"breaking-change" indicator. + +Caret ranges are ideal when an author may make breaking changes +between `0.2.4` and `0.3.0` releases, which is a common practice. +However, it presumes that there will *not* be breaking changes between +`0.2.4` and `0.2.5`. It allows for changes that are presumed to be +additive (but non-breaking), according to commonly observed practices. + +* `^1.2.3` := `>=1.2.3 <2.0.0` +* `^0.2.3` := `>=0.2.3 <0.3.0` +* `^0.0.3` := `>=0.0.3 <0.0.4` +* `^1.2.3-beta.2` := `>=1.2.3-beta.2 <2.0.0` Note that prereleases in + the `1.2.3` version will be allowed, if they are greater than or + equal to `beta.2`. So, `1.2.3-beta.4` would be allowed, but + `1.2.4-beta.2` would not, because it is a prerelease of a + different `[major, minor, patch]` tuple. +* `^0.0.3-beta` := `>=0.0.3-beta <0.0.4` Note that prereleases in the + `0.0.3` version *only* will be allowed, if they are greater than or + equal to `beta`. So, `0.0.3-pr.2` would be allowed. + +When parsing caret ranges, a missing `patch` value desugars to the +number `0`, but will allow flexibility within that value, even if the +major and minor versions are both `0`. + +* `^1.2.x` := `>=1.2.0 <2.0.0` +* `^0.0.x` := `>=0.0.0 <0.1.0` +* `^0.0` := `>=0.0.0 <0.1.0` + +A missing `minor` and `patch` values will desugar to zero, but also +allow flexibility within those values, even if the major version is +zero. + +* `^1.x` := `>=1.0.0 <2.0.0` +* `^0.x` := `>=0.0.0 <1.0.0` + +### Range Grammar + +Putting all this together, here is a Backus-Naur grammar for ranges, +for the benefit of parser authors: + +```bnf +range-set ::= range ( logical-or range ) * +logical-or ::= ( ' ' ) * '||' ( ' ' ) * +range ::= hyphen | simple ( ' ' simple ) * | '' +hyphen ::= partial ' - ' partial +simple ::= primitive | partial | tilde | caret +primitive ::= ( '<' | '>' | '>=' | '<=' | '=' ) partial +partial ::= xr ( '.' xr ( '.' xr qualifier ? )? )? +xr ::= 'x' | 'X' | '*' | nr +nr ::= '0' | ['1'-'9'] ( ['0'-'9'] ) * +tilde ::= '~' partial +caret ::= '^' partial +qualifier ::= ( '-' pre )? ( '+' build )? +pre ::= parts +build ::= parts +parts ::= part ( '.' part ) * +part ::= nr | [-0-9A-Za-z]+ +``` + +## Functions + +All methods and classes take a final `options` object argument. All +options in this object are `false` by default. The options supported +are: + +- `loose` Be more forgiving about not-quite-valid semver strings. + (Any resulting output will always be 100% strict compliant, of + course.) For backwards compatibility reasons, if the `options` + argument is a boolean value instead of an object, it is interpreted + to be the `loose` param. +- `includePrerelease` Set to suppress the [default + behavior](https://github.com/npm/node-semver#prerelease-tags) of + excluding prerelease tagged versions from ranges unless they are + explicitly opted into. + +Strict-mode Comparators and Ranges will be strict about the SemVer +strings that they parse. + +* `valid(v)`: Return the parsed version, or null if it's not valid. +* `inc(v, release)`: Return the version incremented by the release + type (`major`, `premajor`, `minor`, `preminor`, `patch`, + `prepatch`, or `prerelease`), or null if it's not valid + * `premajor` in one call will bump the version up to the next major + version and down to a prerelease of that major version. + `preminor`, and `prepatch` work the same way. + * If called from a non-prerelease version, the `prerelease` will work the + same as `prepatch`. It increments the patch version, then makes a + prerelease. If the input version is already a prerelease it simply + increments it. +* `prerelease(v)`: Returns an array of prerelease components, or null + if none exist. Example: `prerelease('1.2.3-alpha.1') -> ['alpha', 1]` +* `major(v)`: Return the major version number. +* `minor(v)`: Return the minor version number. +* `patch(v)`: Return the patch version number. +* `intersects(r1, r2, loose)`: Return true if the two supplied ranges + or comparators intersect. +* `parse(v)`: Attempt to parse a string as a semantic version, returning either + a `SemVer` object or `null`. + +### Comparison + +* `gt(v1, v2)`: `v1 > v2` +* `gte(v1, v2)`: `v1 >= v2` +* `lt(v1, v2)`: `v1 < v2` +* `lte(v1, v2)`: `v1 <= v2` +* `eq(v1, v2)`: `v1 == v2` This is true if they're logically equivalent, + even if they're not the exact same string. You already know how to + compare strings. +* `neq(v1, v2)`: `v1 != v2` The opposite of `eq`. +* `cmp(v1, comparator, v2)`: Pass in a comparison string, and it'll call + the corresponding function above. `"==="` and `"!=="` do simple + string comparison, but are included for completeness. Throws if an + invalid comparison string is provided. +* `compare(v1, v2)`: Return `0` if `v1 == v2`, or `1` if `v1` is greater, or `-1` if + `v2` is greater. Sorts in ascending order if passed to `Array.sort()`. +* `rcompare(v1, v2)`: The reverse of compare. Sorts an array of versions + in descending order when passed to `Array.sort()`. +* `diff(v1, v2)`: Returns difference between two versions by the release type + (`major`, `premajor`, `minor`, `preminor`, `patch`, `prepatch`, or `prerelease`), + or null if the versions are the same. + +### Comparators + +* `intersects(comparator)`: Return true if the comparators intersect + +### Ranges + +* `validRange(range)`: Return the valid range or null if it's not valid +* `satisfies(version, range)`: Return true if the version satisfies the + range. +* `maxSatisfying(versions, range)`: Return the highest version in the list + that satisfies the range, or `null` if none of them do. +* `minSatisfying(versions, range)`: Return the lowest version in the list + that satisfies the range, or `null` if none of them do. +* `minVersion(range)`: Return the lowest version that can possibly match + the given range. +* `gtr(version, range)`: Return `true` if version is greater than all the + versions possible in the range. +* `ltr(version, range)`: Return `true` if version is less than all the + versions possible in the range. +* `outside(version, range, hilo)`: Return true if the version is outside + the bounds of the range in either the high or low direction. The + `hilo` argument must be either the string `'>'` or `'<'`. (This is + the function called by `gtr` and `ltr`.) +* `intersects(range)`: Return true if any of the ranges comparators intersect + +Note that, since ranges may be non-contiguous, a version might not be +greater than a range, less than a range, *or* satisfy a range! For +example, the range `1.2 <1.2.9 || >2.0.0` would have a hole from `1.2.9` +until `2.0.0`, so the version `1.2.10` would not be greater than the +range (because `2.0.1` satisfies, which is higher), nor less than the +range (since `1.2.8` satisfies, which is lower), and it also does not +satisfy the range. + +If you want to know if a version satisfies or does not satisfy a +range, use the `satisfies(version, range)` function. + +### Coercion + +* `coerce(version)`: Coerces a string to semver if possible + +This aims to provide a very forgiving translation of a non-semver string to +semver. It looks for the first digit in a string, and consumes all +remaining characters which satisfy at least a partial semver (e.g., `1`, +`1.2`, `1.2.3`) up to the max permitted length (256 characters). Longer +versions are simply truncated (`4.6.3.9.2-alpha2` becomes `4.6.3`). All +surrounding text is simply ignored (`v3.4 replaces v3.3.1` becomes +`3.4.0`). Only text which lacks digits will fail coercion (`version one` +is not valid). The maximum length for any semver component considered for +coercion is 16 characters; longer components will be ignored +(`10000000000000000.4.7.4` becomes `4.7.4`). The maximum value for any +semver component is `Number.MAX_SAFE_INTEGER || (2**53 - 1)`; higher value +components are invalid (`9999999999999999.4.7.4` is likely invalid). diff --git a/deps/npm/node_modules/semver/bin/semver b/deps/npm/node_modules/init-package-json/node_modules/semver/bin/semver similarity index 100% rename from deps/npm/node_modules/semver/bin/semver rename to deps/npm/node_modules/init-package-json/node_modules/semver/bin/semver diff --git a/deps/npm/node_modules/init-package-json/node_modules/semver/package.json b/deps/npm/node_modules/init-package-json/node_modules/semver/package.json new file mode 100644 index 00000000000000..69d2db162c9297 --- /dev/null +++ b/deps/npm/node_modules/init-package-json/node_modules/semver/package.json @@ -0,0 +1,28 @@ +{ + "name": "semver", + "version": "5.7.1", + "description": "The semantic version parser used by npm.", + "main": "semver.js", + "scripts": { + "test": "tap", + "preversion": "npm test", + "postversion": "npm publish", + "postpublish": "git push origin --all; git push origin --tags" + }, + "devDependencies": { + "tap": "^13.0.0-rc.18" + }, + "license": "ISC", + "repository": "https://github.com/npm/node-semver", + "bin": { + "semver": "./bin/semver" + }, + "files": [ + "bin", + "range.bnf", + "semver.js" + ], + "tap": { + "check-coverage": true + } +} diff --git a/deps/npm/node_modules/init-package-json/node_modules/semver/range.bnf b/deps/npm/node_modules/init-package-json/node_modules/semver/range.bnf new file mode 100644 index 00000000000000..d4c6ae0d76c9ac --- /dev/null +++ b/deps/npm/node_modules/init-package-json/node_modules/semver/range.bnf @@ -0,0 +1,16 @@ +range-set ::= range ( logical-or range ) * +logical-or ::= ( ' ' ) * '||' ( ' ' ) * +range ::= hyphen | simple ( ' ' simple ) * | '' +hyphen ::= partial ' - ' partial +simple ::= primitive | partial | tilde | caret +primitive ::= ( '<' | '>' | '>=' | '<=' | '=' ) partial +partial ::= xr ( '.' xr ( '.' xr qualifier ? )? )? +xr ::= 'x' | 'X' | '*' | nr +nr ::= '0' | [1-9] ( [0-9] ) * +tilde ::= '~' partial +caret ::= '^' partial +qualifier ::= ( '-' pre )? ( '+' build )? +pre ::= parts +build ::= parts +parts ::= part ( '.' part ) * +part ::= nr | [-0-9A-Za-z]+ diff --git a/deps/npm/node_modules/semver/semver.js b/deps/npm/node_modules/init-package-json/node_modules/semver/semver.js similarity index 100% rename from deps/npm/node_modules/semver/semver.js rename to deps/npm/node_modules/init-package-json/node_modules/semver/semver.js diff --git a/deps/npm/node_modules/init-package-json/package.json b/deps/npm/node_modules/init-package-json/package.json index bd1b8743a88651..ce44c9b7d8154a 100644 --- a/deps/npm/node_modules/init-package-json/package.json +++ b/deps/npm/node_modules/init-package-json/package.json @@ -1,40 +1,20 @@ { - "_args": [ - [ - "init-package-json@1.10.3", - "/Users/rebecca/code/npm" - ] - ], - "_from": "init-package-json@1.10.3", - "_id": "init-package-json@1.10.3", - "_inBundle": false, - "_integrity": "sha512-zKSiXKhQveNteyhcj1CoOP8tqp1QuxPIPBl8Bid99DGLFqA1p87M6lNgfjJHSBoWJJlidGOv5rWjyYKEB3g2Jw==", - "_location": "/init-package-json", - "_phantomChildren": {}, - "_requested": { - "type": "version", - "registry": true, - "raw": "init-package-json@1.10.3", - "name": "init-package-json", - "escapedName": "init-package-json", - "rawSpec": "1.10.3", - "saveSpec": null, - "fetchSpec": "1.10.3" - }, - "_requiredBy": [ - "/" - ], - "_resolved": "https://registry.npmjs.org/init-package-json/-/init-package-json-1.10.3.tgz", - "_spec": "1.10.3", - "_where": "/Users/rebecca/code/npm", - "author": { - "name": "Isaac Z. Schlueter", - "email": "i@izs.me", - "url": "http://blog.izs.me/" + "name": "init-package-json", + "version": "1.10.3", + "main": "init-package-json.js", + "scripts": { + "prerelease": "npm t", + "postrelease": "npm publish && git push --follow-tags", + "release": "standard-version -s", + "test": "tap --nyc-arg=--all --coverage test" }, - "bugs": { - "url": "https://github.com/npm/init-package-json/issues" + "repository": { + "type": "git", + "url": "https://github.com/npm/init-package-json.git" }, + "author": "Isaac Z. Schlueter (http://blog.izs.me/)", + "license": "ISC", + "description": "A node module to get your node module started", "dependencies": { "glob": "^7.1.1", "npm-package-arg": "^4.0.0 || ^5.0.0 || ^6.0.0", @@ -45,7 +25,6 @@ "validate-npm-package-license": "^3.0.1", "validate-npm-package-name": "^3.0.0" }, - "description": "A node module to get your node module started", "devDependencies": { "mkdirp": "^0.5.1", "npm": "^5.7.1", @@ -53,11 +32,6 @@ "standard-version": "^4.3.0", "tap": "^11.1.2" }, - "files": [ - "default-input.js", - "init-package-json.js" - ], - "homepage": "https://github.com/npm/init-package-json#readme", "keywords": [ "init", "package.json", @@ -68,18 +42,8 @@ "prompt", "start" ], - "license": "ISC", - "main": "init-package-json.js", - "name": "init-package-json", - "repository": { - "type": "git", - "url": "git+https://github.com/npm/init-package-json.git" - }, - "scripts": { - "postrelease": "npm publish && git push --follow-tags", - "prerelease": "npm t", - "release": "standard-version -s", - "test": "tap --nyc-arg=--all --coverage test" - }, - "version": "1.10.3" + "files": [ + "default-input.js", + "init-package-json.js" + ] } diff --git a/deps/npm/node_modules/ip-regex/index.d.ts b/deps/npm/node_modules/ip-regex/index.d.ts new file mode 100644 index 00000000000000..0999ed287f790f --- /dev/null +++ b/deps/npm/node_modules/ip-regex/index.d.ts @@ -0,0 +1,70 @@ +declare namespace ip { + interface Options { + /** + Only match an exact string. Useful with `RegExp#test()` to check if a string is an IP address. *(`false` matches any IP address in a string)* + + @default false + */ + readonly exact?: boolean; + + /** + Include boundaries in the regex. When `true`, `192.168.0.2000000000` will report as an invalid IPv4 address. If this option is not set, the mentioned IPv4 address would report as valid (ignoring the trailing zeros). + + @default false + */ + readonly includeBoundaries?: boolean; + } +} + +declare const ip: { + /** + Regular expression for matching IP addresses. + + @returns A regex for matching both IPv4 and IPv6. + + @example + ``` + import ipRegex = require('ip-regex'); + + // Contains an IP address? + ipRegex().test('unicorn 192.168.0.1'); + //=> true + + // Is an IP address? + ipRegex({exact: true}).test('unicorn 192.168.0.1'); + //=> false + + 'unicorn 192.168.0.1 cake 1:2:3:4:5:6:7:8 rainbow'.match(ipRegex()); + //=> ['192.168.0.1', '1:2:3:4:5:6:7:8'] + + // Contains an IP address? + ipRegex({includeBoundaries: true}).test('192.168.0.2000000000'); + //=> false + + // Matches an IP address? + '192.168.0.2000000000'.match(ipRegex({includeBoundaries: true})); + //=> null + ``` + */ + (options?: ip.Options): RegExp; + + /** + @returns A regex for matching IPv4. + */ + v4(options?: ip.Options): RegExp; + + /** + @returns A regex for matching IPv6. + + @example + ``` + import ipRegex = require('ip-regex'); + + ipRegex.v6({exact: true}).test('1:2:3:4:5:6:7:8'); + //=> true + ``` + */ + v6(options?: ip.Options): RegExp; +}; + +export = ip; diff --git a/deps/npm/node_modules/ip-regex/index.js b/deps/npm/node_modules/ip-regex/index.js index 973e5f41c28c70..1ac39f6a91e0a9 100644 --- a/deps/npm/node_modules/ip-regex/index.js +++ b/deps/npm/node_modules/ip-regex/index.js @@ -1,8 +1,13 @@ 'use strict'; -const v4 = '(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])(?:\\.(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])){3}'; +const word = '[a-fA-F\\d:]'; +const b = options => options && options.includeBoundaries ? + `(?:(?<=\\s|^)(?=${word})|(?<=${word})(?=\\s|$))` : + ''; -const v6seg = '[0-9a-fA-F]{1,4}'; +const v4 = '(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}'; + +const v6seg = '[a-fA-F\\d]{1,4}'; const v6 = ` ( (?:${v6seg}:){7}(?:${v6seg}|:)| // 1:2:3:4:5:6:7:: 1:2:3:4:5:6:7:8 @@ -16,9 +21,16 @@ const v6 = ` )(%[0-9a-zA-Z]{1,})? // %eth0 %1 `.replace(/\s*\/\/.*$/gm, '').replace(/\n/g, '').trim(); -const ip = module.exports = opts => opts && opts.exact ? - new RegExp(`(?:^${v4}$)|(?:^${v6}$)`) : - new RegExp(`(?:${v4})|(?:${v6})`, 'g'); +// Pre-compile only the exact regexes because adding a global flag make regexes stateful +const v46Exact = new RegExp(`(?:^${v4}$)|(?:^${v6}$)`); +const v4exact = new RegExp(`^${v4}$`); +const v6exact = new RegExp(`^${v6}$`); + +const ip = options => options && options.exact ? + v46Exact : + new RegExp(`(?:${b(options)}${v4}${b(options)})|(?:${b(options)}${v6}${b(options)})`, 'g'); + +ip.v4 = options => options && options.exact ? v4exact : new RegExp(`${b(options)}${v4}${b(options)}`, 'g'); +ip.v6 = options => options && options.exact ? v6exact : new RegExp(`${b(options)}${v6}${b(options)}`, 'g'); -ip.v4 = opts => opts && opts.exact ? new RegExp(`^${v4}$`) : new RegExp(v4, 'g'); -ip.v6 = opts => opts && opts.exact ? new RegExp(`^${v6}$`) : new RegExp(v6, 'g'); +module.exports = ip; diff --git a/deps/npm/node_modules/ip-regex/license b/deps/npm/node_modules/ip-regex/license index 654d0bfe943437..e7af2f77107d73 100644 --- a/deps/npm/node_modules/ip-regex/license +++ b/deps/npm/node_modules/ip-regex/license @@ -1,21 +1,9 @@ -The MIT License (MIT) +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: +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 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. +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/ip-regex/package.json b/deps/npm/node_modules/ip-regex/package.json index 4d71de6458e2bb..b67a413b608ddb 100644 --- a/deps/npm/node_modules/ip-regex/package.json +++ b/deps/npm/node_modules/ip-regex/package.json @@ -1,77 +1,44 @@ { - "_from": "ip-regex@^2.1.0", - "_id": "ip-regex@2.1.0", - "_inBundle": false, - "_integrity": "sha1-+ni/XS5pE8kRzp+BnuUUa7bYROk=", - "_location": "/ip-regex", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "ip-regex@^2.1.0", - "name": "ip-regex", - "escapedName": "ip-regex", - "rawSpec": "^2.1.0", - "saveSpec": null, - "fetchSpec": "^2.1.0" - }, - "_requiredBy": [ - "/cidr-regex" - ], - "_resolved": "https://registry.npmjs.org/ip-regex/-/ip-regex-2.1.0.tgz", - "_shasum": "fa78bf5d2e6913c911ce9f819ee5146bb6d844e9", - "_spec": "ip-regex@^2.1.0", - "_where": "/Users/rebecca/code/npm/node_modules/cidr-regex", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "bugs": { - "url": "https://github.com/sindresorhus/ip-regex/issues" - }, - "bundleDependencies": false, - "deprecated": false, - "description": "Regular expression for matching IP addresses (IPv4 & IPv6)", - "devDependencies": { - "ava": "*", - "xo": "*" - }, - "engines": { - "node": ">=4" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/sindresorhus/ip-regex#readme", - "keywords": [ - "ip", - "ipv6", - "ipv4", - "regex", - "regexp", - "re", - "match", - "test", - "find", - "text", - "pattern", - "internet", - "protocol", - "address", - "validate" - ], - "license": "MIT", - "name": "ip-regex", - "repository": { - "type": "git", - "url": "git+https://github.com/sindresorhus/ip-regex.git" - }, - "scripts": { - "test": "xo && ava" - }, - "version": "2.1.0", - "xo": { - "esnext": true - } + "name": "ip-regex", + "version": "4.2.0", + "description": "Regular expression for matching IP addresses (IPv4 & IPv6)", + "license": "MIT", + "repository": "sindresorhus/ip-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": [ + "ip", + "ipv6", + "ipv4", + "regex", + "regexp", + "re", + "match", + "test", + "find", + "text", + "pattern", + "internet", + "protocol", + "address", + "validate" + ], + "devDependencies": { + "ava": "^1.4.1", + "tsd": "^0.7.2", + "xo": "^0.24.0" + } } diff --git a/deps/npm/node_modules/ip-regex/readme.md b/deps/npm/node_modules/ip-regex/readme.md index 66bc7f27317b4e..08632c054e54b5 100644 --- a/deps/npm/node_modules/ip-regex/readme.md +++ b/deps/npm/node_modules/ip-regex/readme.md @@ -6,9 +6,11 @@ ## Install ``` -$ npm install --save ip-regex +$ npm install ip-regex ``` +This module targets Node.js 8 or later and the latest version of Chrome, Firefox, and Safari. If you want support for older browsers, use version 2.1.0: `npm install ip-regex@2.1.0` + ## Usage @@ -28,6 +30,14 @@ ipRegex.v6({exact: true}).test('1:2:3:4:5:6:7:8'); 'unicorn 192.168.0.1 cake 1:2:3:4:5:6:7:8 rainbow'.match(ipRegex()); //=> ['192.168.0.1', '1:2:3:4:5:6:7:8'] + +// Contains an IP address? +ipRegex({includeBoundaries: true}).test('192.168.0.2000000000'); +//=> false + +// Matches an IP address? +'192.168.0.2000000000'.match(ipRegex({includeBoundaries: true})); +//=> null ``` @@ -45,17 +55,30 @@ Returns a regex for matching IPv4. Returns a regex for matching IPv6. -#### options.exact +#### options + +Type: `Object` + +##### exact Type: `boolean`
    Default: `false` *(Matches any IP address in a string)* Only match an exact string. Useful with `RegExp#test()` to check if a string is an IP address. +##### includeBoundaries + +Type: `boolean`
    +Default: `false` + +Include boundaries in the regex. When `true`, `192.168.0.2000000000` will report as an invalid IPv4 address. If this option is not set, the mentioned IPv4 address would report as valid (ignoring the trailing zeros). + ## Related - [is-ip](https://github.com/sindresorhus/is-ip) - Check if a string is an IP address +- [is-cidr](https://github.com/silverwind/is-cidr) - Check if a string is an IP address in CIDR notation +- [cidr-regex](https://github.com/silverwind/cidr-regex) - Regular expression for matching IP addresses in CIDR notation ## License diff --git a/deps/npm/node_modules/ip/package.json b/deps/npm/node_modules/ip/package.json index fb58d8c049e97f..c783fdd43767d4 100644 --- a/deps/npm/node_modules/ip/package.json +++ b/deps/npm/node_modules/ip/package.json @@ -1,55 +1,21 @@ { - "_from": "ip@^1.1.5", - "_id": "ip@1.1.5", - "_inBundle": false, - "_integrity": "sha1-vd7XARQpCCjAoDnnLvJfWq7ENUo=", - "_location": "/ip", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "ip@^1.1.5", - "name": "ip", - "escapedName": "ip", - "rawSpec": "^1.1.5", - "saveSpec": null, - "fetchSpec": "^1.1.5" - }, - "_requiredBy": [ - "/npm-profile/socks", - "/npm-registry-fetch/socks", - "/socks" - ], - "_resolved": "https://registry.npmjs.org/ip/-/ip-1.1.5.tgz", - "_shasum": "bdded70114290828c0a039e72ef25f5aaec4354a", - "_spec": "ip@^1.1.5", - "_where": "/Users/rebecca/code/npm/node_modules/socks", - "author": { - "name": "Fedor Indutny", - "email": "fedor@indutny.com" - }, - "bugs": { - "url": "https://github.com/indutny/node-ip/issues" + "name": "ip", + "version": "1.1.5", + "author": "Fedor Indutny ", + "homepage": "https://github.com/indutny/node-ip", + "repository": { + "type": "git", + "url": "http://github.com/indutny/node-ip.git" }, - "bundleDependencies": false, - "deprecated": false, - "description": "[![](https://badge.fury.io/js/ip.svg)](https://www.npmjs.com/package/ip)", + "main": "lib/ip", "devDependencies": { "jscs": "^2.1.1", "jshint": "^2.8.0", "mocha": "~1.3.2" }, - "homepage": "https://github.com/indutny/node-ip", - "license": "MIT", - "main": "lib/ip", - "name": "ip", - "repository": { - "type": "git", - "url": "git+ssh://git@github.com/indutny/node-ip.git" - }, "scripts": { - "fix": "jscs lib/*.js test/*.js --fix", - "test": "jscs lib/*.js test/*.js && jshint lib/*.js && mocha --reporter spec test/*-test.js" + "test": "jscs lib/*.js test/*.js && jshint lib/*.js && mocha --reporter spec test/*-test.js", + "fix": "jscs lib/*.js test/*.js --fix" }, - "version": "1.1.5" + "license": "MIT" } diff --git a/deps/npm/node_modules/is-callable/.editorconfig b/deps/npm/node_modules/is-callable/.editorconfig deleted file mode 100644 index bc228f8269443b..00000000000000 --- a/deps/npm/node_modules/is-callable/.editorconfig +++ /dev/null @@ -1,20 +0,0 @@ -root = true - -[*] -indent_style = tab -indent_size = 4 -end_of_line = lf -charset = utf-8 -trim_trailing_whitespace = true -insert_final_newline = true -max_line_length = 150 - -[CHANGELOG.md] -indent_style = space -indent_size = 2 - -[*.json] -max_line_length = off - -[Makefile] -max_line_length = off diff --git a/deps/npm/node_modules/is-callable/.istanbul.yml b/deps/npm/node_modules/is-callable/.istanbul.yml deleted file mode 100644 index 9affe0bc3e67ab..00000000000000 --- a/deps/npm/node_modules/is-callable/.istanbul.yml +++ /dev/null @@ -1,47 +0,0 @@ -verbose: false -instrumentation: - root: . - extensions: - - .js - - .jsx - default-excludes: true - excludes: [] - variable: __coverage__ - compact: true - preserve-comments: false - complete-copy: false - save-baseline: false - baseline-file: ./coverage/coverage-baseline.raw.json - include-all-sources: false - include-pid: false - es-modules: false - auto-wrap: false -reporting: - print: summary - reports: - - html - dir: ./coverage - summarizer: pkg - report-config: {} - watermarks: - statements: [50, 80] - functions: [50, 80] - branches: [50, 80] - lines: [50, 80] -hooks: - hook-run-in-context: false - post-require-hook: null - handle-sigint: false -check: - global: - statements: 100 - lines: 100 - branches: 100 - functions: 100 - excludes: [] - each: - statements: 100 - lines: 100 - branches: 100 - functions: 100 - excludes: [] diff --git a/deps/npm/node_modules/is-callable/.jscs.json b/deps/npm/node_modules/is-callable/.jscs.json deleted file mode 100644 index b4d9b8b40aebf6..00000000000000 --- a/deps/npm/node_modules/is-callable/.jscs.json +++ /dev/null @@ -1,176 +0,0 @@ -{ - "es3": true, - - "additionalRules": [], - - "requireSemicolons": true, - - "disallowMultipleSpaces": true, - - "disallowIdentifierNames": [], - - "requireCurlyBraces": { - "allExcept": [], - "keywords": ["if", "else", "for", "while", "do", "try", "catch"] - }, - - "requireSpaceAfterKeywords": ["if", "else", "for", "while", "do", "switch", "return", "try", "catch", "function"], - - "disallowSpaceAfterKeywords": [], - - "disallowSpaceBeforeComma": true, - "disallowSpaceAfterComma": false, - "disallowSpaceBeforeSemicolon": true, - - "disallowNodeTypes": [ - "DebuggerStatement", - "ForInStatement", - "LabeledStatement", - "SwitchCase", - "SwitchStatement", - "WithStatement" - ], - - "requireObjectKeysOnNewLine": { "allExcept": ["sameLine"] }, - - "requireSpacesInAnonymousFunctionExpression": { "beforeOpeningRoundBrace": true, "beforeOpeningCurlyBrace": true }, - "requireSpacesInNamedFunctionExpression": { "beforeOpeningCurlyBrace": true }, - "disallowSpacesInNamedFunctionExpression": { "beforeOpeningRoundBrace": true }, - "requireSpacesInFunctionDeclaration": { "beforeOpeningCurlyBrace": true }, - "disallowSpacesInFunctionDeclaration": { "beforeOpeningRoundBrace": true }, - - "requireSpaceBetweenArguments": true, - - "disallowSpacesInsideParentheses": true, - - "disallowSpacesInsideArrayBrackets": true, - - "disallowQuotedKeysInObjects": { "allExcept": ["reserved"] }, - - "disallowSpaceAfterObjectKeys": true, - - "requireCommaBeforeLineBreak": true, - - "disallowSpaceAfterPrefixUnaryOperators": ["++", "--", "+", "-", "~", "!"], - "requireSpaceAfterPrefixUnaryOperators": [], - - "disallowSpaceBeforePostfixUnaryOperators": ["++", "--"], - "requireSpaceBeforePostfixUnaryOperators": [], - - "disallowSpaceBeforeBinaryOperators": [], - "requireSpaceBeforeBinaryOperators": ["+", "-", "/", "*", "=", "==", "===", "!=", "!=="], - - "requireSpaceAfterBinaryOperators": ["+", "-", "/", "*", "=", "==", "===", "!=", "!=="], - "disallowSpaceAfterBinaryOperators": [], - - "disallowImplicitTypeConversion": ["binary", "string"], - - "disallowKeywords": ["with", "eval"], - - "requireKeywordsOnNewLine": [], - "disallowKeywordsOnNewLine": ["else"], - - "requireLineFeedAtFileEnd": true, - - "disallowTrailingWhitespace": true, - - "disallowTrailingComma": true, - - "excludeFiles": ["node_modules/**", "vendor/**"], - - "disallowMultipleLineStrings": true, - - "requireDotNotation": { "allExcept": ["keywords"] }, - - "requireParenthesesAroundIIFE": true, - - "validateLineBreaks": "LF", - - "validateQuoteMarks": { - "escape": true, - "mark": "'" - }, - - "disallowOperatorBeforeLineBreak": [], - - "requireSpaceBeforeKeywords": [ - "do", - "for", - "if", - "else", - "switch", - "case", - "try", - "catch", - "finally", - "while", - "with", - "return" - ], - - "validateAlignedFunctionParameters": { - "lineBreakAfterOpeningBraces": true, - "lineBreakBeforeClosingBraces": true - }, - - "requirePaddingNewLinesBeforeExport": true, - - "validateNewlineAfterArrayElements": { - "maximum": 1 - }, - - "requirePaddingNewLinesAfterUseStrict": true, - - "disallowArrowFunctions": true, - - "disallowMultiLineTernary": true, - - "validateOrderInObjectKeys": "asc-insensitive", - - "disallowIdenticalDestructuringNames": true, - - "disallowNestedTernaries": { "maxLevel": 1 }, - - "requireSpaceAfterComma": { "allExcept": ["trailing"] }, - "requireAlignedMultilineParams": false, - - "requireSpacesInGenerator": { - "afterStar": true - }, - - "disallowSpacesInGenerator": { - "beforeStar": true - }, - - "disallowVar": false, - - "requireArrayDestructuring": false, - - "requireEnhancedObjectLiterals": false, - - "requireObjectDestructuring": false, - - "requireEarlyReturn": false, - - "requireCapitalizedConstructorsNew": { - "allExcept": ["Function", "String", "Object", "Symbol", "Number", "Date", "RegExp", "Error", "Boolean", "Array"] - }, - - "requireImportAlphabetized": false, - - "requireSpaceBeforeObjectValues": true, - "requireSpaceBeforeDestructuredValues": true, - - "disallowSpacesInsideTemplateStringPlaceholders": true, - - "disallowArrayDestructuringReturn": false, - - "requireNewlineBeforeSingleStatementsInIf": false, - - "disallowUnusedVariables": true, - - "requireSpacesInsideImportedObjectBraces": true, - - "requireUseStrict": true -} - diff --git a/deps/npm/node_modules/is-callable/.travis.yml b/deps/npm/node_modules/is-callable/.travis.yml deleted file mode 100644 index 767256c8dd4843..00000000000000 --- a/deps/npm/node_modules/is-callable/.travis.yml +++ /dev/null @@ -1,225 +0,0 @@ -language: node_js -os: - - linux -node_js: - - "10.4" - - "9.11" - - "8.11" - - "7.10" - - "6.14" - - "5.12" - - "4.9" - - "iojs-v3.3" - - "iojs-v2.5" - - "iojs-v1.8" - - "0.12" - - "0.10" - - "0.8" -before_install: - - 'case "${TRAVIS_NODE_VERSION}" in 0.*) export NPM_CONFIG_STRICT_SSL=false ;; esac' - - 'nvm install-latest-npm' -install: - - 'if [ "${TRAVIS_NODE_VERSION}" = "0.6" ] || [ "${TRAVIS_NODE_VERSION}" = "0.9" ]; then nvm install --latest-npm 0.8 && npm install && nvm use "${TRAVIS_NODE_VERSION}"; else npm install; fi;' -script: - - 'if [ -n "${PRETEST-}" ]; then npm run pretest ; fi' - - 'if [ -n "${POSTTEST-}" ]; then npm run posttest ; fi' - - 'if [ -n "${COVERAGE-}" ]; then npm run coverage ; fi' - - 'if [ -n "${TEST-}" ]; then npm run tests-only ; fi' -sudo: false -env: - - TEST=true -matrix: - fast_finish: true - include: - - node_js: "lts/*" - env: PRETEST=true - - node_js: "lts/*" - env: POSTTEST=true - - node_js: "4" - env: COVERAGE=true - - node_js: "10.3" - env: TEST=true ALLOW_FAILURE=true - - node_js: "10.2" - env: TEST=true ALLOW_FAILURE=true - - node_js: "10.1" - env: TEST=true ALLOW_FAILURE=true - - node_js: "10.0" - env: TEST=true ALLOW_FAILURE=true - - node_js: "9.10" - env: TEST=true ALLOW_FAILURE=true - - node_js: "9.9" - env: TEST=true ALLOW_FAILURE=true - - node_js: "9.8" - env: TEST=true ALLOW_FAILURE=true - - node_js: "9.7" - env: TEST=true ALLOW_FAILURE=true - - node_js: "9.6" - env: TEST=true ALLOW_FAILURE=true - - node_js: "9.5" - env: TEST=true ALLOW_FAILURE=true - - node_js: "9.4" - env: TEST=true ALLOW_FAILURE=true - - node_js: "9.3" - env: TEST=true ALLOW_FAILURE=true - - node_js: "9.2" - env: TEST=true ALLOW_FAILURE=true - - node_js: "9.1" - env: TEST=true ALLOW_FAILURE=true - - node_js: "9.0" - env: TEST=true ALLOW_FAILURE=true - - node_js: "8.10" - env: TEST=true ALLOW_FAILURE=true - - node_js: "8.9" - env: TEST=true ALLOW_FAILURE=true - - node_js: "8.8" - env: TEST=true ALLOW_FAILURE=true - - node_js: "8.7" - env: TEST=true ALLOW_FAILURE=true - - node_js: "8.6" - env: TEST=true ALLOW_FAILURE=true - - node_js: "8.5" - env: TEST=true ALLOW_FAILURE=true - - node_js: "8.4" - env: TEST=true ALLOW_FAILURE=true - - node_js: "8.3" - env: TEST=true ALLOW_FAILURE=true - - node_js: "8.2" - env: TEST=true ALLOW_FAILURE=true - - node_js: "8.1" - env: TEST=true ALLOW_FAILURE=true - - node_js: "8.0" - env: TEST=true ALLOW_FAILURE=true - - node_js: "7.9" - env: TEST=true ALLOW_FAILURE=true - - node_js: "7.8" - env: TEST=true ALLOW_FAILURE=true - - node_js: "7.7" - env: TEST=true ALLOW_FAILURE=true - - node_js: "7.6" - env: TEST=true ALLOW_FAILURE=true - - node_js: "7.5" - env: TEST=true ALLOW_FAILURE=true - - node_js: "7.4" - env: TEST=true ALLOW_FAILURE=true - - node_js: "7.3" - env: TEST=true ALLOW_FAILURE=true - - node_js: "7.2" - env: TEST=true ALLOW_FAILURE=true - - node_js: "7.1" - env: TEST=true ALLOW_FAILURE=true - - node_js: "7.0" - env: TEST=true ALLOW_FAILURE=true - - node_js: "6.13" - env: TEST=true ALLOW_FAILURE=true - - node_js: "6.12" - env: TEST=true ALLOW_FAILURE=true - - node_js: "6.11" - env: TEST=true ALLOW_FAILURE=true - - node_js: "6.10" - env: TEST=true ALLOW_FAILURE=true - - node_js: "6.9" - env: TEST=true ALLOW_FAILURE=true - - node_js: "6.8" - env: TEST=true ALLOW_FAILURE=true - - node_js: "6.7" - env: TEST=true ALLOW_FAILURE=true - - node_js: "6.6" - env: TEST=true ALLOW_FAILURE=true - - node_js: "6.5" - env: TEST=true ALLOW_FAILURE=true - - node_js: "6.4" - env: TEST=true ALLOW_FAILURE=true - - node_js: "6.3" - env: TEST=true ALLOW_FAILURE=true - - node_js: "6.2" - env: TEST=true ALLOW_FAILURE=true - - node_js: "6.1" - env: TEST=true ALLOW_FAILURE=true - - node_js: "6.0" - env: TEST=true ALLOW_FAILURE=true - - node_js: "5.11" - env: TEST=true ALLOW_FAILURE=true - - node_js: "5.10" - env: TEST=true ALLOW_FAILURE=true - - node_js: "5.9" - env: TEST=true ALLOW_FAILURE=true - - node_js: "5.8" - env: TEST=true ALLOW_FAILURE=true - - node_js: "5.7" - env: TEST=true ALLOW_FAILURE=true - - node_js: "5.6" - env: TEST=true ALLOW_FAILURE=true - - node_js: "5.5" - env: TEST=true ALLOW_FAILURE=true - - node_js: "5.4" - env: TEST=true ALLOW_FAILURE=true - - node_js: "5.3" - env: TEST=true ALLOW_FAILURE=true - - node_js: "5.2" - env: TEST=true ALLOW_FAILURE=true - - node_js: "5.1" - env: TEST=true ALLOW_FAILURE=true - - node_js: "5.0" - env: TEST=true ALLOW_FAILURE=true - - node_js: "4.8" - env: TEST=true ALLOW_FAILURE=true - - node_js: "4.7" - env: TEST=true ALLOW_FAILURE=true - - node_js: "4.6" - env: TEST=true ALLOW_FAILURE=true - - node_js: "4.5" - env: TEST=true ALLOW_FAILURE=true - - node_js: "4.4" - env: TEST=true ALLOW_FAILURE=true - - node_js: "4.3" - env: TEST=true ALLOW_FAILURE=true - - node_js: "4.2" - env: TEST=true ALLOW_FAILURE=true - - node_js: "4.1" - env: TEST=true ALLOW_FAILURE=true - - node_js: "4.0" - env: TEST=true ALLOW_FAILURE=true - - node_js: "iojs-v3.2" - env: TEST=true ALLOW_FAILURE=true - - node_js: "iojs-v3.1" - env: TEST=true ALLOW_FAILURE=true - - node_js: "iojs-v3.0" - env: TEST=true ALLOW_FAILURE=true - - node_js: "iojs-v2.4" - env: TEST=true ALLOW_FAILURE=true - - node_js: "iojs-v2.3" - env: TEST=true ALLOW_FAILURE=true - - node_js: "iojs-v2.2" - env: TEST=true ALLOW_FAILURE=true - - node_js: "iojs-v2.1" - env: TEST=true ALLOW_FAILURE=true - - node_js: "iojs-v2.0" - env: TEST=true ALLOW_FAILURE=true - - node_js: "iojs-v1.7" - env: TEST=true ALLOW_FAILURE=true - - node_js: "iojs-v1.6" - env: TEST=true ALLOW_FAILURE=true - - node_js: "iojs-v1.5" - env: TEST=true ALLOW_FAILURE=true - - node_js: "iojs-v1.4" - env: TEST=true ALLOW_FAILURE=true - - node_js: "iojs-v1.3" - env: TEST=true ALLOW_FAILURE=true - - node_js: "iojs-v1.2" - env: TEST=true ALLOW_FAILURE=true - - node_js: "iojs-v1.1" - env: TEST=true ALLOW_FAILURE=true - - node_js: "iojs-v1.0" - env: TEST=true ALLOW_FAILURE=true - - node_js: "0.11" - env: TEST=true ALLOW_FAILURE=true - - node_js: "0.9" - env: TEST=true ALLOW_FAILURE=true - - node_js: "0.6" - env: TEST=true ALLOW_FAILURE=true - - node_js: "0.4" - env: TEST=true ALLOW_FAILURE=true - allow_failures: - - os: osx - - env: TEST=true ALLOW_FAILURE=true - - env: COVERAGE=true diff --git a/deps/npm/node_modules/is-callable/CHANGELOG.md b/deps/npm/node_modules/is-callable/CHANGELOG.md deleted file mode 100644 index 58286a0535b74d..00000000000000 --- a/deps/npm/node_modules/is-callable/CHANGELOG.md +++ /dev/null @@ -1,56 +0,0 @@ -1.1.4 / 2018-07-02 -================= - * [Fix] improve `class` and arrow function detection (#30, #31) - * [Tests] on all latest node minors; improve matrix - * [Dev Deps] update all dev deps - -1.1.3 / 2016-02-27 -================= - * [Fix] ensure “class “ doesn’t screw up “class” detection - * [Tests] up to `node` `v5.7`, `v4.3` - * [Dev Deps] update to `eslint` v2, `@ljharb/eslint-config`, `jscs` - -1.1.2 / 2016-01-15 -================= - * [Fix] Make sure comments don’t screw up “class” detection (#4) - * [Tests] up to `node` `v5.3` - * [Tests] Add `parallelshell`, run both `--es-staging` and stock tests at once - * [Dev Deps] update `tape`, `jscs`, `nsp`, `eslint`, `@ljharb/eslint-config` - * [Refactor] convert `isNonES6ClassFn` into `isES6ClassFn` - -1.1.1 / 2015-11-30 -================= - * [Fix] do not throw when a non-function has a function in its [[Prototype]] (#2) - * [Dev Deps] update `tape`, `eslint`, `@ljharb/eslint-config`, `jscs`, `nsp`, `semver` - * [Tests] up to `node` `v5.1` - * [Tests] no longer allow node 0.8 to fail. - * [Tests] fix npm upgrades in older nodes - -1.1.0 / 2015-10-02 -================= - * [Fix] Some browsers report TypedArray constructors as `typeof object` - * [New] return false for "class" constructors, when possible. - * [Tests] up to `io.js` `v3.3`, `node` `v4.1` - * [Dev Deps] update `eslint`, `editorconfig-tools`, `nsp`, `tape`, `semver`, `jscs`, `covert`, `make-arrow-function` - * [Docs] Switch from vb.teelaun.ch to versionbadg.es for the npm version badge SVG - -1.0.4 / 2015-01-30 -================= - * If @@toStringTag is not present, use the old-school Object#toString test. - -1.0.3 / 2015-01-29 -================= - * Add tests to ensure arrow functions are callable. - * Refactor to aid optimization of non-try/catch code. - -1.0.2 / 2015-01-29 -================= - * Fix broken package.json - -1.0.1 / 2015-01-29 -================= - * Add early exit for typeof not "function" - -1.0.0 / 2015-01-29 -================= - * Initial release. diff --git a/deps/npm/node_modules/is-callable/LICENSE b/deps/npm/node_modules/is-callable/LICENSE deleted file mode 100644 index b43df444e51828..00000000000000 --- a/deps/npm/node_modules/is-callable/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2015 Jordan Harband - -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/is-callable/Makefile b/deps/npm/node_modules/is-callable/Makefile deleted file mode 100644 index b9e4fe1aab3dde..00000000000000 --- a/deps/npm/node_modules/is-callable/Makefile +++ /dev/null @@ -1,61 +0,0 @@ -# Since we rely on paths relative to the makefile location, abort if make isn't being run from there. -$(if $(findstring /,$(MAKEFILE_LIST)),$(error Please only invoke this makefile from the directory it resides in)) - - # The files that need updating when incrementing the version number. -VERSIONED_FILES := *.js *.json README* - - -# Add the local npm packages' bin folder to the PATH, so that `make` can find them, when invoked directly. -# Note that rather than using `$(npm bin)` the 'node_modules/.bin' path component is hard-coded, so that invocation works even from an environment -# where npm is (temporarily) unavailable due to having deactivated an nvm instance loaded into the calling shell in order to avoid interference with tests. -export PATH := $(shell printf '%s' "$$PWD/node_modules/.bin:$$PATH") -UTILS := semver -# Make sure that all required utilities can be located. -UTIL_CHECK := $(or $(shell PATH="$(PATH)" which $(UTILS) >/dev/null && echo 'ok'),$(error Did you forget to run `npm install` after cloning the repo? At least one of the required supporting utilities not found: $(UTILS))) - -# Default target (by virtue of being the first non '.'-prefixed in the file). -.PHONY: _no-target-specified -_no-target-specified: - $(error Please specify the target to make - `make list` shows targets. Alternatively, use `npm test` to run the default tests; `npm run` shows all tests) - -# Lists all targets defined in this makefile. -.PHONY: list -list: - @$(MAKE) -pRrn : -f $(MAKEFILE_LIST) 2>/dev/null | awk -v RS= -F: '/^# File/,/^# Finished Make data base/ {if ($$1 !~ "^[#.]") {print $$1}}' | command grep -v -e '^[^[:alnum:]]' -e '^$@$$command ' | sort - -# All-tests target: invokes the specified test suites for ALL shells defined in $(SHELLS). -.PHONY: test -test: - @npm test - -.PHONY: _ensure-tag -_ensure-tag: -ifndef TAG - $(error Please invoke with `make TAG= release`, where is either an increment specifier (patch, minor, major, prepatch, preminor, premajor, prerelease), or an explicit major.minor.patch version number) -endif - -CHANGELOG_ERROR = $(error No CHANGELOG specified) -.PHONY: _ensure-changelog -_ensure-changelog: - @ (git status -sb --porcelain | command grep -E '^( M|[MA] ) CHANGELOG.md' > /dev/null) || (echo no CHANGELOG.md specified && exit 2) - -# Ensures that the git workspace is clean. -.PHONY: _ensure-clean -_ensure-clean: - @[ -z "$$((git status --porcelain --untracked-files=no || echo err) | command grep -v 'CHANGELOG.md')" ] || { echo "Workspace is not clean; please commit changes first." >&2; exit 2; } - -# Makes a release; invoke with `make TAG= release`. -.PHONY: release -release: _ensure-tag _ensure-changelog _ensure-clean - @old_ver=`git describe --abbrev=0 --tags --match 'v[0-9]*.[0-9]*.[0-9]*'` || { echo "Failed to determine current version." >&2; exit 1; }; old_ver=$${old_ver#v}; \ - new_ver=`echo "$(TAG)" | sed 's/^v//'`; new_ver=$${new_ver:-patch}; \ - if printf "$$new_ver" | command grep -q '^[0-9]'; then \ - semver "$$new_ver" >/dev/null || { echo 'Invalid version number specified: $(TAG) - must be major.minor.patch' >&2; exit 2; }; \ - semver -r "> $$old_ver" "$$new_ver" >/dev/null || { echo 'Invalid version number specified: $(TAG) - must be HIGHER than current one.' >&2; exit 2; } \ - else \ - new_ver=`semver -i "$$new_ver" "$$old_ver"` || { echo 'Invalid version-increment specifier: $(TAG)' >&2; exit 2; } \ - fi; \ - printf "=== Bumping version **$$old_ver** to **$$new_ver** before committing and tagging:\n=== TYPE 'proceed' TO PROCEED, anything else to abort: " && read response && [ "$$response" = 'proceed' ] || { echo 'Aborted.' >&2; exit 2; }; \ - replace "$$old_ver" "$$new_ver" -- $(VERSIONED_FILES) && \ - git commit -m "v$$new_ver" $(VERSIONED_FILES) CHANGELOG.md && \ - git tag -a -m "v$$new_ver" "v$$new_ver" diff --git a/deps/npm/node_modules/is-callable/README.md b/deps/npm/node_modules/is-callable/README.md deleted file mode 100644 index 0cb65879972bfb..00000000000000 --- a/deps/npm/node_modules/is-callable/README.md +++ /dev/null @@ -1,59 +0,0 @@ -# is-callable [![Version Badge][2]][1] - -[![Build Status][3]][4] -[![dependency status][5]][6] -[![dev dependency status][7]][8] -[![License][license-image]][license-url] -[![Downloads][downloads-image]][downloads-url] - -[![npm badge][11]][1] - -[![browser support][9]][10] - -Is this JS value callable? Works with Functions and GeneratorFunctions, despite ES6 @@toStringTag. - -## Example - -```js -var isCallable = require('is-callable'); -var assert = require('assert'); - -assert.notOk(isCallable(undefined)); -assert.notOk(isCallable(null)); -assert.notOk(isCallable(false)); -assert.notOk(isCallable(true)); -assert.notOk(isCallable([])); -assert.notOk(isCallable({})); -assert.notOk(isCallable(/a/g)); -assert.notOk(isCallable(new RegExp('a', 'g'))); -assert.notOk(isCallable(new Date())); -assert.notOk(isCallable(42)); -assert.notOk(isCallable(NaN)); -assert.notOk(isCallable(Infinity)); -assert.notOk(isCallable(new Number(42))); -assert.notOk(isCallable('foo')); -assert.notOk(isCallable(Object('foo'))); - -assert.ok(isCallable(function () {})); -assert.ok(isCallable(function* () {})); -assert.ok(isCallable(x => x * x)); -``` - -## Tests -Simply clone the repo, `npm install`, and run `npm test` - -[1]: https://npmjs.org/package/is-callable -[2]: http://versionbadg.es/ljharb/is-callable.svg -[3]: https://travis-ci.org/ljharb/is-callable.svg -[4]: https://travis-ci.org/ljharb/is-callable -[5]: https://david-dm.org/ljharb/is-callable.svg -[6]: https://david-dm.org/ljharb/is-callable -[7]: https://david-dm.org/ljharb/is-callable/dev-status.svg -[8]: https://david-dm.org/ljharb/is-callable#info=devDependencies -[9]: https://ci.testling.com/ljharb/is-callable.png -[10]: https://ci.testling.com/ljharb/is-callable -[11]: https://nodei.co/npm/is-callable.png?downloads=true&stars=true -[license-image]: http://img.shields.io/npm/l/is-callable.svg -[license-url]: LICENSE -[downloads-image]: http://img.shields.io/npm/dm/is-callable.svg -[downloads-url]: http://npm-stat.com/charts.html?package=is-callable diff --git a/deps/npm/node_modules/is-callable/index.js b/deps/npm/node_modules/is-callable/index.js deleted file mode 100644 index d9820b51fd4ad5..00000000000000 --- a/deps/npm/node_modules/is-callable/index.js +++ /dev/null @@ -1,37 +0,0 @@ -'use strict'; - -var fnToStr = Function.prototype.toString; - -var constructorRegex = /^\s*class\b/; -var isES6ClassFn = function isES6ClassFunction(value) { - try { - var fnStr = fnToStr.call(value); - return constructorRegex.test(fnStr); - } catch (e) { - return false; // not a function - } -}; - -var tryFunctionObject = function tryFunctionToStr(value) { - try { - if (isES6ClassFn(value)) { return false; } - fnToStr.call(value); - return true; - } catch (e) { - return false; - } -}; -var toStr = Object.prototype.toString; -var fnClass = '[object Function]'; -var genClass = '[object GeneratorFunction]'; -var hasToStringTag = typeof Symbol === 'function' && typeof Symbol.toStringTag === 'symbol'; - -module.exports = function isCallable(value) { - if (!value) { return false; } - if (typeof value !== 'function' && typeof value !== 'object') { return false; } - if (typeof value === 'function' && !value.prototype) { return true; } - if (hasToStringTag) { return tryFunctionObject(value); } - if (isES6ClassFn(value)) { return false; } - var strClass = toStr.call(value); - return strClass === fnClass || strClass === genClass; -}; diff --git a/deps/npm/node_modules/is-callable/package.json b/deps/npm/node_modules/is-callable/package.json deleted file mode 100644 index 50531dfc901657..00000000000000 --- a/deps/npm/node_modules/is-callable/package.json +++ /dev/null @@ -1,98 +0,0 @@ -{ - "name": "is-callable", - "version": "1.1.4", - "author": { - "name": "Jordan Harband", - "email": "ljharb@gmail.com", - "url": "http://ljharb.codes" - }, - "contributors": [ - { - "name": "Jordan Harband", - "email": "ljharb@gmail.com", - "url": "http://ljharb.codes" - } - ], - "description": "Is this JS value callable? Works with Functions and GeneratorFunctions, despite ES6 @@toStringTag.", - "license": "MIT", - "main": "index.js", - "scripts": { - "pretest": "npm run --silent lint", - "test": "npm run --silent tests-only", - "posttest": "npm run --silent security", - "tests-only": "npm run --silent test:stock && npm run --silent test:staging", - "test:stock": "node test.js", - "test:staging": "node --es-staging test.js", - "coverage": "npm run --silent istanbul", - "covert": "covert test.js", - "covert:quiet": "covert test.js --quiet", - "istanbul": "npm run --silent istanbul:clean && npm run --silent istanbul:std && npm run --silent istanbul:harmony && npm run --silent istanbul:merge && istanbul check", - "istanbul:clean": "rimraf coverage coverage-std coverage-harmony", - "istanbul:merge": "istanbul-merge --out coverage/coverage.raw.json coverage-harmony/coverage.raw.json coverage-std/coverage.raw.json && istanbul report html", - "istanbul:harmony": "node --harmony ./node_modules/istanbul/lib/cli.js cover test.js --dir coverage-harmony", - "istanbul:std": "istanbul cover test.js --report html --dir coverage-std", - "prelint": "editorconfig-tools check *", - "lint": "npm run jscs && npm run eslint", - "jscs": "jscs *.js", - "eslint": "eslint *.js", - "security": "nsp check" - }, - "repository": { - "type": "git", - "url": "git://github.com/ljharb/is-callable.git" - }, - "keywords": [ - "Function", - "function", - "callable", - "generator", - "generator function", - "arrow", - "arrow function", - "ES6", - "toStringTag", - "@@toStringTag" - ], - "dependencies": {}, - "devDependencies": { - "@ljharb/eslint-config": "^12.2.1", - "covert": "^1.1.0", - "editorconfig-tools": "^0.1.1", - "eslint": "^4.19.1", - "foreach": "^2.0.5", - "istanbul": "1.1.0-alpha.1", - "istanbul-merge": "^1.1.1", - "jscs": "^3.0.7", - "make-arrow-function": "^1.1.0", - "make-generator-function": "^1.1.0", - "nsp": "^3.2.1", - "rimraf": "^2.6.2", - "semver": "^5.5.0", - "tape": "^4.9.1" - }, - "testling": { - "files": "test.js", - "browsers": [ - "iexplore/6.0..latest", - "firefox/3.0..6.0", - "firefox/15.0..latest", - "firefox/nightly", - "chrome/4.0..10.0", - "chrome/20.0..latest", - "chrome/canary", - "opera/10.0..latest", - "opera/next", - "safari/4.0..latest", - "ipad/6.0..latest", - "iphone/6.0..latest", - "android-browser/4.2" - ] - }, - "engines": { - "node": ">= 0.4" - } - -,"_resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.1.4.tgz" -,"_integrity": "sha512-r5p9sxJjYnArLjObpjA4xu5EKI3CuKHkJXMhT7kwbpUyIFD1n5PMAsoPvWnvtZiNz7LjkYDRZhd7FlI0eMijEA==" -,"_from": "is-callable@1.1.4" -} \ No newline at end of file diff --git a/deps/npm/node_modules/is-callable/test.js b/deps/npm/node_modules/is-callable/test.js deleted file mode 100644 index f5be51d82e212d..00000000000000 --- a/deps/npm/node_modules/is-callable/test.js +++ /dev/null @@ -1,158 +0,0 @@ -'use strict'; - -/* eslint no-magic-numbers: 1 */ - -var test = require('tape'); -var isCallable = require('./'); -var hasSymbols = typeof Symbol === 'function' && typeof Symbol('foo') === 'symbol'; -var genFn = require('make-generator-function'); -var arrowFn = require('make-arrow-function')(); -var weirdlyCommentedArrowFn; -var asyncFn; -var asyncArrowFn; -try { - /* eslint no-new-func: 0 */ - weirdlyCommentedArrowFn = Function('return cl/*/**/=>/**/ass - 1;')(); - asyncFn = Function('return async function foo() {};')(); - asyncArrowFn = Function('return async () => {};')(); -} catch (e) { /**/ } -var forEach = require('foreach'); - -var noop = function () {}; -var classFake = function classFake() { }; // eslint-disable-line func-name-matching -var returnClass = function () { return ' class '; }; -var return3 = function () { return 3; }; -/* for coverage */ -noop(); -classFake(); -returnClass(); -return3(); -/* end for coverage */ - -var invokeFunction = function invokeFunctionString(str) { - var result; - try { - /* eslint-disable no-new-func */ - var fn = Function(str); - /* eslint-enable no-new-func */ - result = fn(); - } catch (e) {} - return result; -}; - -var classConstructor = invokeFunction('"use strict"; return class Foo {}'); - -var commentedClass = invokeFunction('"use strict"; return class/*kkk*/\n//blah\n Bar\n//blah\n {}'); -var commentedClassOneLine = invokeFunction('"use strict"; return class/**/A{}'); -var classAnonymous = invokeFunction('"use strict"; return class{}'); -var classAnonymousCommentedOneLine = invokeFunction('"use strict"; return class/*/*/{}'); - -test('not callables', function (t) { - t.test('non-number/string primitives', function (st) { - st.notOk(isCallable(), 'undefined is not callable'); - st.notOk(isCallable(null), 'null is not callable'); - st.notOk(isCallable(false), 'false is not callable'); - st.notOk(isCallable(true), 'true is not callable'); - st.end(); - }); - - t.notOk(isCallable([]), 'array is not callable'); - t.notOk(isCallable({}), 'object is not callable'); - t.notOk(isCallable(/a/g), 'regex literal is not callable'); - t.notOk(isCallable(new RegExp('a', 'g')), 'regex object is not callable'); - t.notOk(isCallable(new Date()), 'new Date() is not callable'); - - t.test('numbers', function (st) { - st.notOk(isCallable(42), 'number is not callable'); - st.notOk(isCallable(Object(42)), 'number object is not callable'); - st.notOk(isCallable(NaN), 'NaN is not callable'); - st.notOk(isCallable(Infinity), 'Infinity is not callable'); - st.end(); - }); - - t.test('strings', function (st) { - st.notOk(isCallable('foo'), 'string primitive is not callable'); - st.notOk(isCallable(Object('foo')), 'string object is not callable'); - st.end(); - }); - - t.test('non-function with function in its [[Prototype]] chain', function (st) { - var Foo = function Bar() {}; - Foo.prototype = noop; - st.equal(true, isCallable(Foo), 'sanity check: Foo is callable'); - st.equal(false, isCallable(new Foo()), 'instance of Foo is not callable'); - st.end(); - }); - - t.end(); -}); - -test('@@toStringTag', { skip: !hasSymbols || !Symbol.toStringTag }, function (t) { - var fakeFunction = { - toString: function () { return String(return3); }, - valueOf: return3 - }; - fakeFunction[Symbol.toStringTag] = 'Function'; - t.equal(String(fakeFunction), String(return3)); - t.equal(Number(fakeFunction), return3()); - t.notOk(isCallable(fakeFunction), 'fake Function with @@toStringTag "Function" is not callable'); - t.end(); -}); - -var typedArrayNames = [ - 'Int8Array', - 'Uint8Array', - 'Uint8ClampedArray', - 'Int16Array', - 'Uint16Array', - 'Int32Array', - 'Uint32Array', - 'Float32Array', - 'Float64Array' -]; - -test('Functions', function (t) { - t.ok(isCallable(noop), 'function is callable'); - t.ok(isCallable(classFake), 'function with name containing "class" is callable'); - t.ok(isCallable(returnClass), 'function with string " class " is callable'); - t.ok(isCallable(isCallable), 'isCallable is callable'); - t.end(); -}); - -test('Typed Arrays', function (st) { - forEach(typedArrayNames, function (typedArray) { - /* istanbul ignore if : covered in node 0.6 */ - if (typeof global[typedArray] === 'undefined') { - st.comment('# SKIP typed array "' + typedArray + '" not supported'); - } else { - st.ok(isCallable(global[typedArray]), typedArray + ' is callable'); - } - }); - st.end(); -}); - -test('Generators', { skip: !genFn }, function (t) { - t.ok(isCallable(genFn), 'generator function is callable'); - t.end(); -}); - -test('Arrow functions', { skip: !arrowFn }, function (t) { - t.ok(isCallable(arrowFn), 'arrow function is callable'); - t.ok(isCallable(weirdlyCommentedArrowFn), 'weirdly commented arrow functions are callable'); - t.end(); -}); - -test('"Class" constructors', { skip: !classConstructor || !commentedClass || !commentedClassOneLine || !classAnonymous }, function (t) { - t.notOk(isCallable(classConstructor), 'class constructors are not callable'); - t.notOk(isCallable(commentedClass), 'class constructors with comments in the signature are not callable'); - t.notOk(isCallable(commentedClassOneLine), 'one-line class constructors with comments in the signature are not callable'); - t.notOk(isCallable(classAnonymous), 'anonymous class constructors are not callable'); - t.notOk(isCallable(classAnonymousCommentedOneLine), 'anonymous one-line class constructors with comments in the signature are not callable'); - t.end(); -}); - -test('`async function`s', { skip: !asyncFn }, function (t) { - t.ok(isCallable(asyncFn), '`async function`s are callable'); - t.ok(isCallable(asyncArrowFn), '`async` arrow functions are callable'); - t.end(); -}); diff --git a/deps/npm/node_modules/is-ci/LICENSE b/deps/npm/node_modules/is-ci/LICENSE deleted file mode 100644 index 67846832ecc306..00000000000000 --- a/deps/npm/node_modules/is-ci/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2016-2018 Thomas Watson Steen - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/deps/npm/node_modules/is-ci/README.md b/deps/npm/node_modules/is-ci/README.md deleted file mode 100644 index bc3840a220cfbd..00000000000000 --- a/deps/npm/node_modules/is-ci/README.md +++ /dev/null @@ -1,50 +0,0 @@ -# is-ci - -Returns `true` if the current environment is a Continuous Integration -server. - -Please [open an issue](https://github.com/watson/is-ci/issues) if your -CI server isn't properly detected :) - -[![npm](https://img.shields.io/npm/v/is-ci.svg)](https://www.npmjs.com/package/is-ci) -[![Build status](https://travis-ci.org/watson/is-ci.svg?branch=master)](https://travis-ci.org/watson/is-ci) -[![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat)](https://github.com/feross/standard) - -## Installation - -```bash -npm install is-ci --save -``` - -## Programmatic Usage - -```js -const isCI = require('is-ci') - -if (isCI) { - console.log('The code is running on a CI server') -} -``` - -## CLI Usage - -For CLI usage you need to have the `is-ci` executable in your `PATH`. -There's a few ways to do that: - -- Either install the module globally using `npm install is-ci -g` -- Or add the module as a dependency to your app in which case it can be - used inside your package.json scripts as is -- Or provide the full path to the executable, e.g. - `./node_modules/.bin/is-ci` - -```bash -is-ci && echo "This is a CI server" -``` - -## Supported CI tools - -Refer to [ci-info](https://github.com/watson/ci-info#supported-ci-tools) docs for all supported CI's - -## License - -[MIT](LICENSE) diff --git a/deps/npm/node_modules/is-ci/bin.js b/deps/npm/node_modules/is-ci/bin.js deleted file mode 100755 index 0c56c01f261c86..00000000000000 --- a/deps/npm/node_modules/is-ci/bin.js +++ /dev/null @@ -1,4 +0,0 @@ -#!/usr/bin/env node -'use strict' - -process.exit(require('./') ? 0 : 1) diff --git a/deps/npm/node_modules/is-ci/index.js b/deps/npm/node_modules/is-ci/index.js deleted file mode 100644 index d4cb67aa9b499e..00000000000000 --- a/deps/npm/node_modules/is-ci/index.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict' - -module.exports = require('ci-info').isCI diff --git a/deps/npm/node_modules/is-ci/node_modules/ci-info/CHANGELOG.md b/deps/npm/node_modules/is-ci/node_modules/ci-info/CHANGELOG.md deleted file mode 100644 index 859a0ad12a53b0..00000000000000 --- a/deps/npm/node_modules/is-ci/node_modules/ci-info/CHANGELOG.md +++ /dev/null @@ -1,62 +0,0 @@ -# Changelog - -## v1.6.0 - -* feat: add Sail CI support -* feat: add Buddy support -* feat: add Bitrise support -* feat: detect Jenkins PRs -* feat: detect Drone PRs - -## v1.5.1 - -* fix: use full path to vendors.json - -## v1.5.0 - -* feat: add dsari detection ([#15](https://github.com/watson/ci-info/pull/15)) -* feat: add ci.isPR ([#16](https://github.com/watson/ci-info/pull/16)) - -## v1.4.0 - -* feat: add Cirrus CI detection ([#13](https://github.com/watson/ci-info/pull/13)) -* feat: add Shippable CI detection ([#14](https://github.com/watson/ci-info/pull/14)) - -## v1.3.1 - -* chore: reduce npm package size by not including `.github` folder content ([#11](https://github.com/watson/ci-info/pull/11)) - -## v1.3.0 - -* feat: add support for Strider CD -* chore: deprecate vendor constant `TDDIUM` in favor of `SOLANO` -* docs: add missing vendor constant to docs - -## v1.2.0 - -* feat: detect solano-ci ([#9](https://github.com/watson/ci-info/pull/9)) - -## v1.1.3 - -* fix: fix spelling of Hunson in `ci.name` - -## v1.1.2 - -* fix: no more false positive matches for Jenkins - -## v1.1.1 - -* docs: sort lists of CI servers in README.md -* docs: add missing AWS CodeBuild to the docs - -## v1.1.0 - -* feat: add AWS CodeBuild to CI detection ([#2](https://github.com/watson/ci-info/pull/2)) - -## v1.0.1 - -* chore: reduce npm package size by using an `.npmignore` file ([#3](https://github.com/watson/ci-info/pull/3)) - -## v1.0.0 - -* Initial release diff --git a/deps/npm/node_modules/is-ci/node_modules/ci-info/LICENSE b/deps/npm/node_modules/is-ci/node_modules/ci-info/LICENSE deleted file mode 100644 index 67846832ecc306..00000000000000 --- a/deps/npm/node_modules/is-ci/node_modules/ci-info/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2016-2018 Thomas Watson Steen - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/deps/npm/node_modules/is-ci/node_modules/ci-info/README.md b/deps/npm/node_modules/is-ci/node_modules/ci-info/README.md deleted file mode 100644 index c88be8f82d5df9..00000000000000 --- a/deps/npm/node_modules/is-ci/node_modules/ci-info/README.md +++ /dev/null @@ -1,107 +0,0 @@ -# ci-info - -Get details about the current Continuous Integration environment. - -Please [open an -issue](https://github.com/watson/ci-info/issues/new?template=ci-server-not-detected.md) -if your CI server isn't properly detected :) - -[![npm](https://img.shields.io/npm/v/ci-info.svg)](https://www.npmjs.com/package/ci-info) -[![Build status](https://travis-ci.org/watson/ci-info.svg?branch=master)](https://travis-ci.org/watson/ci-info) -[![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat)](https://github.com/feross/standard) - -## Installation - -```bash -npm install ci-info --save -``` - -## Usage - -```js -var ci = require('ci-info') - -if (ci.isCI) { - console.log('The name of the CI server is:', ci.name) -} else { - console.log('This program is not running on a CI server') -} -``` - -## Supported CI tools - -Officially supported CI servers: - -| Name | Constant | -|------|----------| -| [AWS CodeBuild](https://aws.amazon.com/codebuild/) | `ci.CODEBUILD` | -| [AppVeyor](http://www.appveyor.com) | `ci.APPVEYOR` | -| [Bamboo](https://www.atlassian.com/software/bamboo) by Atlassian | `ci.BAMBOO` | -| [Bitbucket Pipelines](https://bitbucket.org/product/features/pipelines) | `ci.BITBUCKET` | -| [Bitrise](https://www.bitrise.io/) | `ci.BITRISE` | -| [Buddy](https://buddy.works/) | `ci.BUDDY` | -| [Buildkite](https://buildkite.com) | `ci.BUILDKITE` | -| [CircleCI](http://circleci.com) | `ci.CIRCLE` | -| [Cirrus CI](https://cirrus-ci.org) | `ci.CIRRUS` | -| [Codeship](https://codeship.com) | `ci.CODESHIP` | -| [Drone](https://drone.io) | `ci.DRONE` | -| [dsari](https://github.com/rfinnie/dsari) | `ci.DSARI` | -| [GitLab CI](https://about.gitlab.com/gitlab-ci/) | `ci.GITLAB` | -| [GoCD](https://www.go.cd/) | `ci.GOCD` | -| [Hudson](http://hudson-ci.org) | `ci.HUDSON` | -| [Jenkins CI](https://jenkins-ci.org) | `ci.JENKINS` | -| [Magnum CI](https://magnum-ci.com) | `ci.MAGNUM` | -| [Sail CI](https://sail.ci/) | `ci.SAIL` | -| [Semaphore](https://semaphoreci.com) | `ci.SEMAPHORE` | -| [Shippable](https://www.shippable.com/) | `ci.SHIPPABLE` | -| [Solano CI](https://www.solanolabs.com/) | `ci.SOLANO` | -| [Strider CD](https://strider-cd.github.io/) | `ci.STRIDER` | -| [TaskCluster](http://docs.taskcluster.net) | `ci.TASKCLUSTER` | -| [Team Foundation Server](https://www.visualstudio.com/en-us/products/tfs-overview-vs.aspx) by Microsoft | `ci.TFS` | -| [TeamCity](https://www.jetbrains.com/teamcity/) by JetBrains | `ci.TEAMCITY` | -| [Travis CI](http://travis-ci.org) | `ci.TRAVIS` | - -## API - -### `ci.name` - -A string. Will contain the name of the CI server the code is running on. -If not CI server is detected, it will be `null`. - -Don't depend on the value of this string not to change for a specific -vendor. If you find your self writing `ci.name === 'Travis CI'`, you -most likely want to use `ci.TRAVIS` instead. - -### `ci.isCI` - -A boolean. Will be `true` if the code is running on a CI server. -Otherwise `false`. - -Some CI servers not listed here might still trigger the `ci.isCI` -boolean to be set to `true` if they use certain vendor neutral -environment variables. In those cases `ci.name` will be `null` and no -vendor specific boolean will be set to `true`. - -### `ci.isPR` - -A boolean if PR detection is supported for the current CI server. Will -be `true` if a PR is being tested. Otherwise `false`. If PR detection is -not supported for the current CI server, the value will be `null`. - -### `ci.` - -A vendor specific boolean constants is exposed for each support CI -vendor. A constant will be `true` if the code is determined to run on -the given CI server. Otherwise `false`. - -Examples of vendor constants are `ci.TRAVIS` or `ci.APPVEYOR`. For a -complete list, see the support table above. - -Deprecated vendor constants that will be removed in the next major -release: - -- `ci.TDDIUM` (Solano CI) This have been renamed `ci.SOLANO` - -## License - -[MIT](LICENSE) diff --git a/deps/npm/node_modules/is-ci/node_modules/ci-info/index.js b/deps/npm/node_modules/is-ci/node_modules/ci-info/index.js deleted file mode 100644 index 27794d49b3f21e..00000000000000 --- a/deps/npm/node_modules/is-ci/node_modules/ci-info/index.js +++ /dev/null @@ -1,66 +0,0 @@ -'use strict' - -var vendors = require('./vendors.json') - -var env = process.env - -// Used for testinging only -Object.defineProperty(exports, '_vendors', { - value: vendors.map(function (v) { return v.constant }) -}) - -exports.name = null -exports.isPR = null - -vendors.forEach(function (vendor) { - var envs = Array.isArray(vendor.env) ? vendor.env : [vendor.env] - var isCI = envs.every(function (obj) { - return checkEnv(obj) - }) - - exports[vendor.constant] = isCI - - if (isCI) { - exports.name = vendor.name - - switch (typeof vendor.pr) { - case 'string': - // "pr": "CIRRUS_PR" - exports.isPR = !!env[vendor.pr] - break - case 'object': - if ('env' in vendor.pr) { - // "pr": { "env": "BUILDKITE_PULL_REQUEST", "ne": "false" } - exports.isPR = vendor.pr.env in env && env[vendor.pr.env] !== vendor.pr.ne - } else if ('any' in vendor.pr) { - // "pr": { "any": ["ghprbPullId", "CHANGE_ID"] } - exports.isPR = vendor.pr.any.some(function (key) { - return !!env[key] - }) - } else { - // "pr": { "DRONE_BUILD_EVENT": "pull_request" } - exports.isPR = checkEnv(vendor.pr) - } - break - default: - // PR detection not supported for this vendor - exports.isPR = null - } - } -}) - -exports.isCI = !!( - env.CI || // Travis CI, CircleCI, Cirrus CI, Gitlab CI, Appveyor, CodeShip, dsari - env.CONTINUOUS_INTEGRATION || // Travis CI, Cirrus CI - env.BUILD_NUMBER || // Jenkins, TeamCity - env.RUN_ID || // TaskCluster, dsari - exports.name || - false -) - -function checkEnv (obj) { - if (typeof obj === 'string') return !!env[obj] - return Object.keys(obj).every(function (k) { - return env[k] === obj[k] - }) -} diff --git a/deps/npm/node_modules/is-ci/node_modules/ci-info/package.json b/deps/npm/node_modules/is-ci/node_modules/ci-info/package.json deleted file mode 100644 index 3542df9d4100c5..00000000000000 --- a/deps/npm/node_modules/is-ci/node_modules/ci-info/package.json +++ /dev/null @@ -1,65 +0,0 @@ -{ - "_from": "ci-info@^1.0.0", - "_id": "ci-info@1.6.0", - "_inBundle": false, - "_integrity": "sha512-vsGdkwSCDpWmP80ncATX7iea5DWQemg1UgCW5J8tqjU3lYw4FBYuj89J0CTVomA7BEfvSZd84GmHko+MxFQU2A==", - "_location": "/is-ci/ci-info", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "ci-info@^1.0.0", - "name": "ci-info", - "escapedName": "ci-info", - "rawSpec": "^1.0.0", - "saveSpec": null, - "fetchSpec": "^1.0.0" - }, - "_requiredBy": [ - "/is-ci" - ], - "_resolved": "https://registry.npmjs.org/ci-info/-/ci-info-1.6.0.tgz", - "_shasum": "2ca20dbb9ceb32d4524a683303313f0304b1e497", - "_spec": "ci-info@^1.0.0", - "_where": "/Users/aeschright/code/cli/node_modules/is-ci", - "author": { - "name": "Thomas Watson Steen", - "email": "w@tson.dk", - "url": "https://twitter.com/wa7son" - }, - "bugs": { - "url": "https://github.com/watson/ci-info/issues" - }, - "bundleDependencies": false, - "coordinates": [ - 55.778271, - 12.593091 - ], - "dependencies": {}, - "deprecated": false, - "description": "Get details about the current Continuous Integration environment", - "devDependencies": { - "clear-require": "^1.0.1", - "standard": "^12.0.1", - "tape": "^4.9.1" - }, - "homepage": "https://github.com/watson/ci-info", - "keywords": [ - "ci", - "continuous", - "integration", - "test", - "detect" - ], - "license": "MIT", - "main": "index.js", - "name": "ci-info", - "repository": { - "type": "git", - "url": "git+https://github.com/watson/ci-info.git" - }, - "scripts": { - "test": "standard && node test.js" - }, - "version": "1.6.0" -} diff --git a/deps/npm/node_modules/is-ci/node_modules/ci-info/vendors.json b/deps/npm/node_modules/is-ci/node_modules/ci-info/vendors.json deleted file mode 100644 index a157b78cea4af3..00000000000000 --- a/deps/npm/node_modules/is-ci/node_modules/ci-info/vendors.json +++ /dev/null @@ -1,152 +0,0 @@ -[ - { - "name": "AppVeyor", - "constant": "APPVEYOR", - "env": "APPVEYOR", - "pr": "APPVEYOR_PULL_REQUEST_NUMBER" - }, - { - "name": "Bamboo", - "constant": "BAMBOO", - "env": "bamboo_planKey" - }, - { - "name": "Bitbucket Pipelines", - "constant": "BITBUCKET", - "env": "BITBUCKET_COMMIT" - }, - { - "name": "Bitrise", - "constant": "BITRISE", - "env": "BITRISE_IO", - "pr": "BITRISE_PULL_REQUEST" - }, - { - "name": "Buddy", - "constant": "BUDDY", - "env": "BUDDY_WORKSPACE_ID", - "pr": "BUDDY_EXECUTION_PULL_REQUEST_ID" - }, - { - "name": "Buildkite", - "constant": "BUILDKITE", - "env": "BUILDKITE", - "pr": { "env": "BUILDKITE_PULL_REQUEST", "ne": "false" } - }, - { - "name": "CircleCI", - "constant": "CIRCLE", - "env": "CIRCLECI", - "pr": "CIRCLE_PULL_REQUEST" - }, - { - "name": "Cirrus CI", - "constant": "CIRRUS", - "env": "CIRRUS_CI", - "pr": "CIRRUS_PR" - }, - { - "name": "AWS CodeBuild", - "constant": "CODEBUILD", - "env": "CODEBUILD_BUILD_ARN" - }, - { - "name": "Codeship", - "constant": "CODESHIP", - "env": { "CI_NAME": "codeship" } - }, - { - "name": "Drone", - "constant": "DRONE", - "env": "DRONE", - "pr": { "DRONE_BUILD_EVENT": "pull_request" } - }, - { - "name": "dsari", - "constant": "DSARI", - "env": "DSARI" - }, - { - "name": "GitLab CI", - "constant": "GITLAB", - "env": "GITLAB_CI" - }, - { - "name": "GoCD", - "constant": "GOCD", - "env": "GO_PIPELINE_LABEL" - }, - { - "name": "Hudson", - "constant": "HUDSON", - "env": "HUDSON_URL" - }, - { - "name": "Jenkins", - "constant": "JENKINS", - "env": ["JENKINS_URL", "BUILD_ID"], - "pr": { "any": ["ghprbPullId", "CHANGE_ID"] } - }, - { - "name": "Magnum CI", - "constant": "MAGNUM", - "env": "MAGNUM" - }, - { - "name": "Sail CI", - "constant": "SAIL", - "env": "SAILCI", - "pr": "SAIL_PULL_REQUEST_NUMBER" - }, - { - "name": "Semaphore", - "constant": "SEMAPHORE", - "env": "SEMAPHORE", - "pr": "PULL_REQUEST_NUMBER" - }, - { - "name": "Shippable", - "constant": "SHIPPABLE", - "env": "SHIPPABLE", - "pr": { "IS_PULL_REQUEST": "true" } - }, - { - "name": "Solano CI", - "constant": "SOLANO", - "env": "TDDIUM", - "pr": "TDDIUM_PR_ID" - }, - { - "name": "Strider CD", - "constant": "STRIDER", - "env": "STRIDER" - }, - { - "name": "TaskCluster", - "constant": "TASKCLUSTER", - "env": ["TASK_ID", "RUN_ID"] - }, - { - "name": "Solano CI", - "constant": "TDDIUM", - "env": "TDDIUM", - "pr": "TDDIUM_PR_ID", - "deprecated": true - }, - { - "name": "TeamCity", - "constant": "TEAMCITY", - "env": "TEAMCITY_VERSION" - }, - { - "name": "Team Foundation Server", - "constant": "TFS", - "env": "TF_BUILD" - }, - { - "name": "Travis CI", - "constant": "TRAVIS", - "env": "TRAVIS", - "pr": { "env": "TRAVIS_PULL_REQUEST", "ne": "false" } - } -] diff --git a/deps/npm/node_modules/is-ci/package.json b/deps/npm/node_modules/is-ci/package.json deleted file mode 100644 index 344aa2a1f59525..00000000000000 --- a/deps/npm/node_modules/is-ci/package.json +++ /dev/null @@ -1,69 +0,0 @@ -{ - "_from": "is-ci@^1.0.10", - "_id": "is-ci@1.2.1", - "_inBundle": false, - "_integrity": "sha512-s6tfsaQaQi3JNciBH6shVqEDvhGut0SUXr31ag8Pd8BBbVVlcGfWhpPmEOoM6RJ5TFhbypvf5yyRw/VXW1IiWg==", - "_location": "/is-ci", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "is-ci@^1.0.10", - "name": "is-ci", - "escapedName": "is-ci", - "rawSpec": "^1.0.10", - "saveSpec": null, - "fetchSpec": "^1.0.10" - }, - "_requiredBy": [ - "/update-notifier" - ], - "_resolved": "https://registry.npmjs.org/is-ci/-/is-ci-1.2.1.tgz", - "_shasum": "e3779c8ee17fccf428488f6e281187f2e632841c", - "_spec": "is-ci@^1.0.10", - "_where": "/Users/ruyadorno/Documents/workspace/cli/node_modules/update-notifier", - "author": { - "name": "Thomas Watson Steen", - "email": "w@tson.dk", - "url": "https://twitter.com/wa7son" - }, - "bin": { - "is-ci": "bin.js" - }, - "bugs": { - "url": "https://github.com/watson/is-ci/issues" - }, - "bundleDependencies": false, - "coordinates": [ - 55.778255, - 12.593033 - ], - "dependencies": { - "ci-info": "^1.5.0" - }, - "deprecated": false, - "description": "Detect if the current environment is a CI server", - "devDependencies": { - "clear-require": "^1.0.1", - "standard": "^11.0.1" - }, - "homepage": "https://github.com/watson/is-ci", - "keywords": [ - "ci", - "continuous", - "integration", - "test", - "detect" - ], - "license": "MIT", - "main": "index.js", - "name": "is-ci", - "repository": { - "type": "git", - "url": "git+https://github.com/watson/is-ci.git" - }, - "scripts": { - "test": "standard && node test.js" - }, - "version": "1.2.1" -} diff --git a/deps/npm/node_modules/is-cidr/README.md b/deps/npm/node_modules/is-cidr/README.md index 1fa3ee9ede782b..a786cd48145c8a 100644 --- a/deps/npm/node_modules/is-cidr/README.md +++ b/deps/npm/node_modules/is-cidr/README.md @@ -1,6 +1,6 @@ # is-cidr -[![](https://img.shields.io/npm/v/is-cidr.svg?style=flat)](https://www.npmjs.org/package/is-cidr) [![](https://img.shields.io/npm/dm/is-cidr.svg)](https://www.npmjs.org/package/is-cidr) [![](https://api.travis-ci.org/silverwind/is-cidr.svg?style=flat)](https://travis-ci.org/silverwind/is-cidr) +[![](https://img.shields.io/npm/v/is-cidr.svg?style=flat)](https://www.npmjs.org/package/is-cidr) [![](https://img.shields.io/npm/dm/is-cidr.svg)](https://www.npmjs.org/package/is-cidr) > Check if a string is an IP address in CIDR notation @@ -10,21 +10,18 @@ npm i is-cidr ``` - ## Usage ```js -const isCidr = require('is-cidr'); +const isCidr = require("is-cidr"); -isCidr('192.168.0.1/24'); //=> 4 -isCidr('1:2:3:4:5:6:7:8/64'); //=> 6 -isCidr('10.0.0.0'); //=> 0 -isCidr.v6('10.0.0.0/24'); //=> false +isCidr("192.168.0.1/24"); //=> 4 +isCidr("1:2:3:4:5:6:7:8/64"); //=> 6 +isCidr("10.0.0.0"); //=> 0 +isCidr.v6("10.0.0.0/24"); //=> false ``` - ## API - ### isCidr(input) Check if `input` is a IPv4 or IPv6 CIDR address. Returns either `4`, `6` (indicating the IP version) or `0` if the string is not a CIDR. @@ -37,7 +34,6 @@ Check if `input` is a IPv4 CIDR address. Returns a boolean. Check if `input` is a IPv6 CIDR address. Returns a boolean. - ## Related - [cidr-regex](https://github.com/silverwind/cidr-regex) - Regular expression for matching IP addresses in CIDR notation diff --git a/deps/npm/node_modules/is-cidr/index.d.ts b/deps/npm/node_modules/is-cidr/index.d.ts new file mode 100644 index 00000000000000..c4ba96a1fe82bc --- /dev/null +++ b/deps/npm/node_modules/is-cidr/index.d.ts @@ -0,0 +1,31 @@ +declare const isCidr: { + /** + Check if `string` is a IPv4 or IPv6 CIDR address. + @returns Either `4`, `6` (indicating the IP version) or `0` if the string is not a CIDR. + @example + ``` + import isCidr = require('is-cidr'); + isCidr('192.168.0.1/24'); //=> 4 + isCidr('1:2:3:4:5:6:7:8/64'); //=> 6 + isCidr('10.0.0.0'); //=> 0 + ``` + */ + (string: string): 6 | 4 | 0; + + /** + Check if `string` is a IPv4 CIDR address. + */ + v4(string: string): boolean; + + /** + Check if `string` is a IPv6 CIDR address. + @example + ``` + import isCidr = require('is-cidr'); + isCidr.v6('10.0.0.0/24'); //=> false + ``` + */ + v6(string: string): boolean; +}; + +export = isCidr; diff --git a/deps/npm/node_modules/is-cidr/index.js b/deps/npm/node_modules/is-cidr/index.js index 3eaf906c3542e7..8caef5fbb72a38 100644 --- a/deps/npm/node_modules/is-cidr/index.js +++ b/deps/npm/node_modules/is-cidr/index.js @@ -1,13 +1,9 @@ "use strict"; -const cidrRegex = require("cidr-regex"); -const re4 = cidrRegex.v4({exact: true}); -const re6 = cidrRegex.v6({exact: true}); +const {v4, v6} = require("cidr-regex"); -const isCidr = module.exports = str => { - if (re4.test(str)) return 4; - if (re6.test(str)) return 6; - return 0; -}; +const re4 = v4({exact: true}); +const re6 = v6({exact: true}); -isCidr.v4 = str => re4.test(str); -isCidr.v6 = str => re6.test(str); +module.exports = str => re4.test(str) ? 4 : (re6.test(str) ? 6 : 0); +module.exports.v4 = str => re4.test(str); +module.exports.v6 = str => re6.test(str); diff --git a/deps/npm/node_modules/is-cidr/package.json b/deps/npm/node_modules/is-cidr/package.json index 5737794e8c680c..b02775a0e3f6f8 100644 --- a/deps/npm/node_modules/is-cidr/package.json +++ b/deps/npm/node_modules/is-cidr/package.json @@ -1,61 +1,23 @@ { - "_from": "is-cidr@3.0.0", - "_id": "is-cidr@3.0.0", - "_inBundle": false, - "_integrity": "sha512-8Xnnbjsb0x462VoYiGlhEi+drY8SFwrHiSYuzc/CEwco55vkehTaxAyIjEdpi3EMvLPPJAJi9FlzP+h+03gp0Q==", - "_location": "/is-cidr", - "_phantomChildren": {}, - "_requested": { - "type": "version", - "registry": true, - "raw": "is-cidr@3.0.0", - "name": "is-cidr", - "escapedName": "is-cidr", - "rawSpec": "3.0.0", - "saveSpec": null, - "fetchSpec": "3.0.0" - }, - "_requiredBy": [ - "#USER", - "/" - ], - "_resolved": "https://registry.npmjs.org/is-cidr/-/is-cidr-3.0.0.tgz", - "_shasum": "1acf35c9e881063cd5f696d48959b30fed3eed56", - "_spec": "is-cidr@3.0.0", - "_where": "/Users/aeschright/code/cli", - "author": { - "name": "silverwind", - "email": "me@silverwind.io" - }, - "bugs": { - "url": "https://github.com/silverwind/is-cidr/issues" - }, - "bundleDependencies": false, + "name": "is-cidr", + "version": "4.0.2", + "description": "Check if a string is an IP address in CIDR notation", + "author": "silverwind ", "contributors": [ - { - "name": "Felipe Apostol", - "email": "flipjs.io@gmail.com", - "url": "http://flipjs.io/" - } + "Felipe Apostol (http://flipjs.io/)" ], - "dependencies": { - "cidr-regex": "^2.0.10" - }, - "deprecated": false, - "description": "Check if a string is an IP address in CIDR notation", - "devDependencies": { - "eslint": "^5.7.0", - "eslint-config-silverwind": "^2.0.9", - "updates": "^4.5.2", - "ver": "^3.0.0" + "repository": "silverwind/is-cidr", + "license": "BSD-2-Clause", + "scripts": { + "test": "make test" }, "engines": { - "node": ">=6" + "node": ">=10" }, "files": [ - "index.js" + "index.js", + "index.d.ts" ], - "homepage": "https://github.com/silverwind/is-cidr#readme", "keywords": [ "cidr", "regex", @@ -67,14 +29,18 @@ "ip address", "network" ], - "license": "BSD-2-Clause", - "name": "is-cidr", - "repository": { - "type": "git", - "url": "git+https://github.com/silverwind/is-cidr.git" - }, - "scripts": { - "test": "make test" + "dependencies": { + "cidr-regex": "^3.1.1" }, - "version": "3.0.0" + "devDependencies": { + "eslint": "7.10.0", + "eslint-config-silverwind": "18.0.10", + "jest": "26.4.2", + "updates": "11.1.5", + "versions": "8.4.3" + }, + "jest": { + "verbose": false, + "testTimeout": 10000 + } } diff --git a/deps/npm/node_modules/is-date-object/.jscs.json b/deps/npm/node_modules/is-date-object/.jscs.json deleted file mode 100644 index 040bb6806a566c..00000000000000 --- a/deps/npm/node_modules/is-date-object/.jscs.json +++ /dev/null @@ -1,122 +0,0 @@ -{ - "es3": true, - - "additionalRules": [], - - "requireSemicolons": true, - - "disallowMultipleSpaces": true, - - "disallowIdentifierNames": [], - - "requireCurlyBraces": ["if", "else", "for", "while", "do", "try", "catch"], - - "requireSpaceAfterKeywords": ["if", "else", "for", "while", "do", "switch", "return", "try", "catch", "function"], - - "disallowSpaceAfterKeywords": [], - - "disallowSpaceBeforeComma": true, - "disallowSpaceBeforeSemicolon": true, - - "disallowNodeTypes": [ - "DebuggerStatement", - "ForInStatement", - "LabeledStatement", - "SwitchCase", - "SwitchStatement", - "WithStatement" - ], - - "requireSpacesInAnonymousFunctionExpression": { "beforeOpeningRoundBrace": true, "beforeOpeningCurlyBrace": true }, - "requireSpacesInNamedFunctionExpression": { "beforeOpeningCurlyBrace": true }, - "disallowSpacesInNamedFunctionExpression": { "beforeOpeningRoundBrace": true }, - "requireSpacesInFunctionDeclaration": { "beforeOpeningCurlyBrace": true }, - "disallowSpacesInFunctionDeclaration": { "beforeOpeningRoundBrace": true }, - - "requireSpaceBetweenArguments": true, - - "disallowSpacesInsideParentheses": true, - - "disallowSpacesInsideArrayBrackets": true, - - "disallowQuotedKeysInObjects": "allButReserved", - - "disallowSpaceAfterObjectKeys": true, - - "requireCommaBeforeLineBreak": true, - - "disallowSpaceAfterPrefixUnaryOperators": ["++", "--", "+", "-", "~", "!"], - "requireSpaceAfterPrefixUnaryOperators": [], - - "disallowSpaceBeforePostfixUnaryOperators": ["++", "--"], - "requireSpaceBeforePostfixUnaryOperators": [], - - "disallowSpaceBeforeBinaryOperators": [], - "requireSpaceBeforeBinaryOperators": ["+", "-", "/", "*", "=", "==", "===", "!=", "!=="], - - "requireSpaceAfterBinaryOperators": ["+", "-", "/", "*", "=", "==", "===", "!=", "!=="], - "disallowSpaceAfterBinaryOperators": [], - - "disallowImplicitTypeConversion": ["binary", "string"], - - "disallowKeywords": ["with", "eval"], - - "requireKeywordsOnNewLine": [], - "disallowKeywordsOnNewLine": ["else"], - - "requireLineFeedAtFileEnd": true, - - "disallowTrailingWhitespace": true, - - "disallowTrailingComma": true, - - "excludeFiles": ["node_modules/**", "vendor/**"], - - "disallowMultipleLineStrings": true, - - "requireDotNotation": true, - - "requireParenthesesAroundIIFE": true, - - "validateLineBreaks": "LF", - - "validateQuoteMarks": { - "escape": true, - "mark": "'" - }, - - "disallowOperatorBeforeLineBreak": [], - - "requireSpaceBeforeKeywords": [ - "do", - "for", - "if", - "else", - "switch", - "case", - "try", - "catch", - "finally", - "while", - "with", - "return" - ], - - "validateAlignedFunctionParameters": { - "lineBreakAfterOpeningBraces": true, - "lineBreakBeforeClosingBraces": true - }, - - "requirePaddingNewLinesBeforeExport": true, - - "validateNewlineAfterArrayElements": { - "maximum": 1 - }, - - "requirePaddingNewLinesAfterUseStrict": true, - - "disallowArrowFunctions": true, - - "validateOrderInObjectKeys": "asc-insensitive" -} - diff --git a/deps/npm/node_modules/is-date-object/.npmignore b/deps/npm/node_modules/is-date-object/.npmignore deleted file mode 100644 index 59d842baa84c8b..00000000000000 --- a/deps/npm/node_modules/is-date-object/.npmignore +++ /dev/null @@ -1,28 +0,0 @@ -# Logs -logs -*.log - -# Runtime data -pids -*.pid -*.seed - -# Directory for instrumented libs generated by jscoverage/JSCover -lib-cov - -# Coverage directory used by tools like istanbul -coverage - -# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) -.grunt - -# Compiled binary addons (http://nodejs.org/api/addons.html) -build/Release - -# Dependency directory -# Commenting this out is preferred by some people, see -# https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git- -node_modules - -# Users Environment Variables -.lock-wscript diff --git a/deps/npm/node_modules/is-date-object/.travis.yml b/deps/npm/node_modules/is-date-object/.travis.yml deleted file mode 100644 index 4c29ed58ba7fba..00000000000000 --- a/deps/npm/node_modules/is-date-object/.travis.yml +++ /dev/null @@ -1,58 +0,0 @@ -language: node_js -node_js: - - "4.1" - - "4.0" - - "iojs-v3.3" - - "iojs-v3.2" - - "iojs-v3.1" - - "iojs-v3.0" - - "iojs-v2.5" - - "iojs-v2.4" - - "iojs-v2.3" - - "iojs-v2.2" - - "iojs-v2.1" - - "iojs-v2.0" - - "iojs-v1.8" - - "iojs-v1.7" - - "iojs-v1.6" - - "iojs-v1.5" - - "iojs-v1.4" - - "iojs-v1.3" - - "iojs-v1.2" - - "iojs-v1.1" - - "iojs-v1.0" - - "0.12" - - "0.11" - - "0.10" - - "0.9" - - "0.8" - - "0.6" - - "0.4" -before_install: - - '[ "${TRAVIS_NODE_VERSION}" = "0.6" ] || npm install -g npm@1.4.28 && npm install -g npm' -sudo: false -matrix: - fast_finish: true - allow_failures: - - node_js: "4.0" - - node_js: "iojs-v3.2" - - node_js: "iojs-v3.1" - - node_js: "iojs-v3.0" - - node_js: "iojs-v2.4" - - node_js: "iojs-v2.3" - - node_js: "iojs-v2.2" - - node_js: "iojs-v2.1" - - node_js: "iojs-v2.0" - - node_js: "iojs-v1.7" - - node_js: "iojs-v1.6" - - node_js: "iojs-v1.5" - - node_js: "iojs-v1.4" - - node_js: "iojs-v1.3" - - node_js: "iojs-v1.2" - - node_js: "iojs-v1.1" - - node_js: "iojs-v1.0" - - node_js: "0.11" - - node_js: "0.9" - - node_js: "0.8" - - node_js: "0.6" - - node_js: "0.4" diff --git a/deps/npm/node_modules/is-date-object/CHANGELOG.md b/deps/npm/node_modules/is-date-object/CHANGELOG.md deleted file mode 100644 index 4a7eab61bb1b26..00000000000000 --- a/deps/npm/node_modules/is-date-object/CHANGELOG.md +++ /dev/null @@ -1,10 +0,0 @@ -1.0.1 / 2015-09-27 -================= - * [Fix] If `@@toStringTag` is not present, use the old-school `Object#toString` test - * [Docs] Switch from vb.teelaun.ch to versionbadg.es for the npm version badge SVG - * [Dev Deps] update `is`, `eslint`, `@ljharb/eslint-config`, `semver`, `tape`, `jscs`, `nsp`, `covert` - * [Tests] up to `io.js` `v3.3`, `node` `v4.1` - -1.0.0 / 2015-01-28 -================= - * Initial release. diff --git a/deps/npm/node_modules/is-date-object/LICENSE b/deps/npm/node_modules/is-date-object/LICENSE deleted file mode 100644 index b43df444e51828..00000000000000 --- a/deps/npm/node_modules/is-date-object/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2015 Jordan Harband - -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/is-date-object/Makefile b/deps/npm/node_modules/is-date-object/Makefile deleted file mode 100644 index b9e4fe1aab3dde..00000000000000 --- a/deps/npm/node_modules/is-date-object/Makefile +++ /dev/null @@ -1,61 +0,0 @@ -# Since we rely on paths relative to the makefile location, abort if make isn't being run from there. -$(if $(findstring /,$(MAKEFILE_LIST)),$(error Please only invoke this makefile from the directory it resides in)) - - # The files that need updating when incrementing the version number. -VERSIONED_FILES := *.js *.json README* - - -# Add the local npm packages' bin folder to the PATH, so that `make` can find them, when invoked directly. -# Note that rather than using `$(npm bin)` the 'node_modules/.bin' path component is hard-coded, so that invocation works even from an environment -# where npm is (temporarily) unavailable due to having deactivated an nvm instance loaded into the calling shell in order to avoid interference with tests. -export PATH := $(shell printf '%s' "$$PWD/node_modules/.bin:$$PATH") -UTILS := semver -# Make sure that all required utilities can be located. -UTIL_CHECK := $(or $(shell PATH="$(PATH)" which $(UTILS) >/dev/null && echo 'ok'),$(error Did you forget to run `npm install` after cloning the repo? At least one of the required supporting utilities not found: $(UTILS))) - -# Default target (by virtue of being the first non '.'-prefixed in the file). -.PHONY: _no-target-specified -_no-target-specified: - $(error Please specify the target to make - `make list` shows targets. Alternatively, use `npm test` to run the default tests; `npm run` shows all tests) - -# Lists all targets defined in this makefile. -.PHONY: list -list: - @$(MAKE) -pRrn : -f $(MAKEFILE_LIST) 2>/dev/null | awk -v RS= -F: '/^# File/,/^# Finished Make data base/ {if ($$1 !~ "^[#.]") {print $$1}}' | command grep -v -e '^[^[:alnum:]]' -e '^$@$$command ' | sort - -# All-tests target: invokes the specified test suites for ALL shells defined in $(SHELLS). -.PHONY: test -test: - @npm test - -.PHONY: _ensure-tag -_ensure-tag: -ifndef TAG - $(error Please invoke with `make TAG= release`, where is either an increment specifier (patch, minor, major, prepatch, preminor, premajor, prerelease), or an explicit major.minor.patch version number) -endif - -CHANGELOG_ERROR = $(error No CHANGELOG specified) -.PHONY: _ensure-changelog -_ensure-changelog: - @ (git status -sb --porcelain | command grep -E '^( M|[MA] ) CHANGELOG.md' > /dev/null) || (echo no CHANGELOG.md specified && exit 2) - -# Ensures that the git workspace is clean. -.PHONY: _ensure-clean -_ensure-clean: - @[ -z "$$((git status --porcelain --untracked-files=no || echo err) | command grep -v 'CHANGELOG.md')" ] || { echo "Workspace is not clean; please commit changes first." >&2; exit 2; } - -# Makes a release; invoke with `make TAG= release`. -.PHONY: release -release: _ensure-tag _ensure-changelog _ensure-clean - @old_ver=`git describe --abbrev=0 --tags --match 'v[0-9]*.[0-9]*.[0-9]*'` || { echo "Failed to determine current version." >&2; exit 1; }; old_ver=$${old_ver#v}; \ - new_ver=`echo "$(TAG)" | sed 's/^v//'`; new_ver=$${new_ver:-patch}; \ - if printf "$$new_ver" | command grep -q '^[0-9]'; then \ - semver "$$new_ver" >/dev/null || { echo 'Invalid version number specified: $(TAG) - must be major.minor.patch' >&2; exit 2; }; \ - semver -r "> $$old_ver" "$$new_ver" >/dev/null || { echo 'Invalid version number specified: $(TAG) - must be HIGHER than current one.' >&2; exit 2; } \ - else \ - new_ver=`semver -i "$$new_ver" "$$old_ver"` || { echo 'Invalid version-increment specifier: $(TAG)' >&2; exit 2; } \ - fi; \ - printf "=== Bumping version **$$old_ver** to **$$new_ver** before committing and tagging:\n=== TYPE 'proceed' TO PROCEED, anything else to abort: " && read response && [ "$$response" = 'proceed' ] || { echo 'Aborted.' >&2; exit 2; }; \ - replace "$$old_ver" "$$new_ver" -- $(VERSIONED_FILES) && \ - git commit -m "v$$new_ver" $(VERSIONED_FILES) CHANGELOG.md && \ - git tag -a -m "v$$new_ver" "v$$new_ver" diff --git a/deps/npm/node_modules/is-date-object/README.md b/deps/npm/node_modules/is-date-object/README.md deleted file mode 100644 index 55b0c59673e603..00000000000000 --- a/deps/npm/node_modules/is-date-object/README.md +++ /dev/null @@ -1,53 +0,0 @@ -# is-date-object [![Version Badge][2]][1] - -[![Build Status][3]][4] -[![dependency status][5]][6] -[![dev dependency status][7]][8] -[![License][license-image]][license-url] -[![Downloads][downloads-image]][downloads-url] - -[![npm badge][11]][1] - -[![browser support][9]][10] - -Is this value a JS Date object? This module works cross-realm/iframe, and despite ES6 @@toStringTag. - -## Example - -```js -var isDate = require('is-date-object'); -var assert = require('assert'); - -assert.notOk(isDate(undefined)); -assert.notOk(isDate(null)); -assert.notOk(isDate(false)); -assert.notOk(isDate(true)); -assert.notOk(isDate(42)); -assert.notOk(isDate('foo')); -assert.notOk(isDate(function () {})); -assert.notOk(isDate([])); -assert.notOk(isDate({})); -assert.notOk(isDate(/a/g)); -assert.notOk(isDate(new RegExp('a', 'g'))); - -assert.ok(isDate(new Date())); -``` - -## Tests -Simply clone the repo, `npm install`, and run `npm test` - -[1]: https://npmjs.org/package/is-date-object -[2]: http://versionbadg.es/ljharb/is-date-object.svg -[3]: https://travis-ci.org/ljharb/is-date-object.svg -[4]: https://travis-ci.org/ljharb/is-date-object -[5]: https://david-dm.org/ljharb/is-date-object.svg -[6]: https://david-dm.org/ljharb/is-date-object -[7]: https://david-dm.org/ljharb/is-date-object/dev-status.svg -[8]: https://david-dm.org/ljharb/is-date-object#info=devDependencies -[9]: https://ci.testling.com/ljharb/is-date-object.png -[10]: https://ci.testling.com/ljharb/is-date-object -[11]: https://nodei.co/npm/is-date-object.png?downloads=true&stars=true -[license-image]: http://img.shields.io/npm/l/is-date-object.svg -[license-url]: LICENSE -[downloads-image]: http://img.shields.io/npm/dm/is-date-object.svg -[downloads-url]: http://npm-stat.com/charts.html?package=is-date-object diff --git a/deps/npm/node_modules/is-date-object/index.js b/deps/npm/node_modules/is-date-object/index.js deleted file mode 100644 index fe0d7ecd7c145c..00000000000000 --- a/deps/npm/node_modules/is-date-object/index.js +++ /dev/null @@ -1,20 +0,0 @@ -'use strict'; - -var getDay = Date.prototype.getDay; -var tryDateObject = function tryDateObject(value) { - try { - getDay.call(value); - return true; - } catch (e) { - return false; - } -}; - -var toStr = Object.prototype.toString; -var dateClass = '[object Date]'; -var hasToStringTag = typeof Symbol === 'function' && typeof Symbol.toStringTag === 'symbol'; - -module.exports = function isDateObject(value) { - if (typeof value !== 'object' || value === null) { return false; } - return hasToStringTag ? tryDateObject(value) : toStr.call(value) === dateClass; -}; diff --git a/deps/npm/node_modules/is-date-object/package.json b/deps/npm/node_modules/is-date-object/package.json deleted file mode 100644 index 20c0b95086f586..00000000000000 --- a/deps/npm/node_modules/is-date-object/package.json +++ /dev/null @@ -1,66 +0,0 @@ -{ - "name": "is-date-object", - "version": "1.0.1", - "author": "Jordan Harband", - "description": "Is this value a JS Date object? This module works cross-realm/iframe, and despite ES6 @@toStringTag.", - "license": "MIT", - "main": "index.js", - "scripts": { - "test": "npm run lint && node --harmony --es-staging test.js && npm run security", - "coverage": "covert test.js", - "coverage-quiet": "covert test.js --quiet", - "lint": "npm run jscs && npm run eslint", - "jscs": "jscs test.js *.js", - "eslint": "eslint test.js *.js", - "security": "nsp package" - }, - "repository": { - "type": "git", - "url": "git://github.com/ljharb/is-date-object.git" - }, - "keywords": [ - "Date", - "ES6", - "toStringTag", - "@@toStringTag", - "Date object" - ], - "dependencies": {}, - "devDependencies": { - "foreach": "^2.0.5", - "is": "^3.1.0", - "tape": "^4.2.0", - "indexof": "^0.0.1", - "covert": "^1.1.0", - "jscs": "^2.1.1", - "nsp": "^1.1.0", - "eslint": "^1.5.1", - "@ljharb/eslint-config": "^1.2.0", - "semver": "^5.0.3" - }, - "testling": { - "files": "test.js", - "browsers": [ - "iexplore/6.0..latest", - "firefox/3.0..6.0", - "firefox/15.0..latest", - "firefox/nightly", - "chrome/4.0..10.0", - "chrome/20.0..latest", - "chrome/canary", - "opera/10.0..latest", - "opera/next", - "safari/4.0..latest", - "ipad/6.0..latest", - "iphone/6.0..latest", - "android-browser/4.2" - ] - }, - "engines": { - "node": ">= 0.4" - } - -,"_resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.1.tgz" -,"_integrity": "sha1-mqIOtq7rv/d/vTPnTKAbM1gdOhY=" -,"_from": "is-date-object@1.0.1" -} \ No newline at end of file diff --git a/deps/npm/node_modules/is-date-object/test.js b/deps/npm/node_modules/is-date-object/test.js deleted file mode 100644 index 29f0917bc4a33c..00000000000000 --- a/deps/npm/node_modules/is-date-object/test.js +++ /dev/null @@ -1,33 +0,0 @@ -'use strict'; - -var test = require('tape'); -var isDate = require('./'); -var hasSymbols = typeof Symbol === 'function' && typeof Symbol() === 'symbol'; - -test('not Dates', function (t) { - t.notOk(isDate(), 'undefined is not Date'); - t.notOk(isDate(null), 'null is not Date'); - t.notOk(isDate(false), 'false is not Date'); - t.notOk(isDate(true), 'true is not Date'); - t.notOk(isDate(42), 'number is not Date'); - t.notOk(isDate('foo'), 'string is not Date'); - t.notOk(isDate([]), 'array is not Date'); - t.notOk(isDate({}), 'object is not Date'); - t.notOk(isDate(function () {}), 'function is not Date'); - t.notOk(isDate(/a/g), 'regex literal is not Date'); - t.notOk(isDate(new RegExp('a', 'g')), 'regex object is not Date'); - t.end(); -}); - -test('@@toStringTag', { skip: !hasSymbols || !Symbol.toStringTag }, function (t) { - var realDate = new Date(); - var fakeDate = { toString: function () { return String(realDate); }, valueOf: function () { return realDate.getTime(); } }; - fakeDate[Symbol.toStringTag] = 'Date'; - t.notOk(isDate(fakeDate), 'fake Date with @@toStringTag "Date" is not Date'); - t.end(); -}); - -test('Dates', function (t) { - t.ok(isDate(new Date()), 'new Date() is Date'); - t.end(); -}); diff --git a/deps/npm/node_modules/is-fullwidth-code-point/index.js b/deps/npm/node_modules/is-fullwidth-code-point/index.js index a7d3e3855f1c24..d506327c3e5576 100644 --- a/deps/npm/node_modules/is-fullwidth-code-point/index.js +++ b/deps/npm/node_modules/is-fullwidth-code-point/index.js @@ -1,46 +1,46 @@ 'use strict'; -var numberIsNan = require('number-is-nan'); - -module.exports = function (x) { - if (numberIsNan(x)) { +/* eslint-disable yoda */ +module.exports = x => { + if (Number.isNaN(x)) { return false; } - // https://github.com/nodejs/io.js/blob/cff7300a578be1b10001f2d967aaedc88aee6402/lib/readline.js#L1369 - // code points are derived from: // http://www.unix.org/Public/UNIDATA/EastAsianWidth.txt - if (x >= 0x1100 && ( - x <= 0x115f || // Hangul Jamo - 0x2329 === x || // LEFT-POINTING ANGLE BRACKET - 0x232a === x || // RIGHT-POINTING ANGLE BRACKET - // CJK Radicals Supplement .. Enclosed CJK Letters and Months - (0x2e80 <= x && x <= 0x3247 && x !== 0x303f) || - // Enclosed CJK Letters and Months .. CJK Unified Ideographs Extension A - 0x3250 <= x && x <= 0x4dbf || - // CJK Unified Ideographs .. Yi Radicals - 0x4e00 <= x && x <= 0xa4c6 || - // Hangul Jamo Extended-A - 0xa960 <= x && x <= 0xa97c || - // Hangul Syllables - 0xac00 <= x && x <= 0xd7a3 || - // CJK Compatibility Ideographs - 0xf900 <= x && x <= 0xfaff || - // Vertical Forms - 0xfe10 <= x && x <= 0xfe19 || - // CJK Compatibility Forms .. Small Form Variants - 0xfe30 <= x && x <= 0xfe6b || - // Halfwidth and Fullwidth Forms - 0xff01 <= x && x <= 0xff60 || - 0xffe0 <= x && x <= 0xffe6 || - // Kana Supplement - 0x1b000 <= x && x <= 0x1b001 || - // Enclosed Ideographic Supplement - 0x1f200 <= x && x <= 0x1f251 || - // CJK Unified Ideographs Extension B .. Tertiary Ideographic Plane - 0x20000 <= x && x <= 0x3fffd)) { + if ( + x >= 0x1100 && ( + x <= 0x115f || // Hangul Jamo + x === 0x2329 || // LEFT-POINTING ANGLE BRACKET + x === 0x232a || // RIGHT-POINTING ANGLE BRACKET + // CJK Radicals Supplement .. Enclosed CJK Letters and Months + (0x2e80 <= x && x <= 0x3247 && x !== 0x303f) || + // Enclosed CJK Letters and Months .. CJK Unified Ideographs Extension A + (0x3250 <= x && x <= 0x4dbf) || + // CJK Unified Ideographs .. Yi Radicals + (0x4e00 <= x && x <= 0xa4c6) || + // Hangul Jamo Extended-A + (0xa960 <= x && x <= 0xa97c) || + // Hangul Syllables + (0xac00 <= x && x <= 0xd7a3) || + // CJK Compatibility Ideographs + (0xf900 <= x && x <= 0xfaff) || + // Vertical Forms + (0xfe10 <= x && x <= 0xfe19) || + // CJK Compatibility Forms .. Small Form Variants + (0xfe30 <= x && x <= 0xfe6b) || + // Halfwidth and Fullwidth Forms + (0xff01 <= x && x <= 0xff60) || + (0xffe0 <= x && x <= 0xffe6) || + // Kana Supplement + (0x1b000 <= x && x <= 0x1b001) || + // Enclosed Ideographic Supplement + (0x1f200 <= x && x <= 0x1f251) || + // CJK Unified Ideographs Extension B .. Tertiary Ideographic Plane + (0x20000 <= x && x <= 0x3fffd) + ) + ) { return true; } return false; -} +}; diff --git a/deps/npm/node_modules/is-fullwidth-code-point/package.json b/deps/npm/node_modules/is-fullwidth-code-point/package.json index e73475abce72ee..3049d9e030499c 100644 --- a/deps/npm/node_modules/is-fullwidth-code-point/package.json +++ b/deps/npm/node_modules/is-fullwidth-code-point/package.json @@ -1,53 +1,23 @@ { - "_from": "is-fullwidth-code-point@1.0.0", - "_id": "is-fullwidth-code-point@1.0.0", - "_inBundle": false, - "_integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", - "_location": "/is-fullwidth-code-point", - "_phantomChildren": {}, - "_requested": { - "type": "version", - "registry": true, - "raw": "is-fullwidth-code-point@1.0.0", - "name": "is-fullwidth-code-point", - "escapedName": "is-fullwidth-code-point", - "rawSpec": "1.0.0", - "saveSpec": null, - "fetchSpec": "1.0.0" - }, - "_requiredBy": [ - "#USER", - "/" - ], - "_resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", - "_shasum": "ef9e31386f031a7f0d643af82fde50c457ef00cb", - "_spec": "is-fullwidth-code-point@1.0.0", - "_where": "/Users/rebecca/code/npm", + "name": "is-fullwidth-code-point", + "version": "2.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" }, - "bugs": { - "url": "https://github.com/sindresorhus/is-fullwidth-code-point/issues" - }, - "bundleDependencies": false, - "dependencies": { - "number-is-nan": "^1.0.0" - }, - "deprecated": false, - "description": "Check if the character represented by a given Unicode code point is fullwidth", - "devDependencies": { - "ava": "0.0.4", - "code-point-at": "^1.0.0" - }, "engines": { - "node": ">=0.10.0" + "node": ">=4" + }, + "scripts": { + "test": "xo && ava" }, "files": [ "index.js" ], - "homepage": "https://github.com/sindresorhus/is-fullwidth-code-point#readme", "keywords": [ "fullwidth", "full-width", @@ -65,14 +35,11 @@ "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": "node test.js" + "devDependencies": { + "ava": "*", + "xo": "*" }, - "version": "1.0.0" + "xo": { + "esnext": true + } } diff --git a/deps/npm/node_modules/is-fullwidth-code-point/readme.md b/deps/npm/node_modules/is-fullwidth-code-point/readme.md index 4936464b1b4155..093b0281b2c46b 100644 --- a/deps/npm/node_modules/is-fullwidth-code-point/readme.md +++ b/deps/npm/node_modules/is-fullwidth-code-point/readme.md @@ -13,7 +13,7 @@ $ npm install --save is-fullwidth-code-point ## Usage ```js -var isFullwidthCodePoint = require('is-fullwidth-code-point'); +const isFullwidthCodePoint = require('is-fullwidth-code-point'); isFullwidthCodePoint('谢'.codePointAt()); //=> true @@ -36,4 +36,4 @@ Type: `number` ## License -MIT © [Sindre Sorhus](http://sindresorhus.com) +MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/deps/npm/node_modules/is-installed-globally/index.js b/deps/npm/node_modules/is-installed-globally/index.js deleted file mode 100644 index 5092c2b2daa1ef..00000000000000 --- a/deps/npm/node_modules/is-installed-globally/index.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; -const globalDirs = require('global-dirs'); -const isPathInside = require('is-path-inside'); - -module.exports = isPathInside(__dirname, globalDirs.yarn.packages) || isPathInside(__dirname, globalDirs.npm.packages); diff --git a/deps/npm/node_modules/is-installed-globally/package.json b/deps/npm/node_modules/is-installed-globally/package.json deleted file mode 100644 index 04cdf676ffa4d3..00000000000000 --- a/deps/npm/node_modules/is-installed-globally/package.json +++ /dev/null @@ -1,80 +0,0 @@ -{ - "_from": "is-installed-globally@^0.1.0", - "_id": "is-installed-globally@0.1.0", - "_inBundle": false, - "_integrity": "sha1-Df2Y9akRFxbdU13aZJL2e/PSWoA=", - "_location": "/is-installed-globally", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "is-installed-globally@^0.1.0", - "name": "is-installed-globally", - "escapedName": "is-installed-globally", - "rawSpec": "^0.1.0", - "saveSpec": null, - "fetchSpec": "^0.1.0" - }, - "_requiredBy": [ - "/update-notifier" - ], - "_resolved": "https://registry.npmjs.org/is-installed-globally/-/is-installed-globally-0.1.0.tgz", - "_shasum": "0dfd98f5a9111716dd535dda6492f67bf3d25a80", - "_spec": "is-installed-globally@^0.1.0", - "_where": "/Users/rebecca/code/npm/node_modules/update-notifier", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "bugs": { - "url": "https://github.com/sindresorhus/is-installed-globally/issues" - }, - "bundleDependencies": false, - "dependencies": { - "global-dirs": "^0.1.0", - "is-path-inside": "^1.0.0" - }, - "deprecated": false, - "description": "Check if your package was installed globally", - "devDependencies": { - "ava": "*", - "execa": "^0.7.0", - "xo": "*" - }, - "engines": { - "node": ">=4" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/sindresorhus/is-installed-globally#readme", - "keywords": [ - "global", - "package", - "globally", - "module", - "install", - "installed", - "npm", - "yarn", - "is", - "check", - "detect", - "local", - "locally", - "cli", - "bin", - "binary" - ], - "license": "MIT", - "name": "is-installed-globally", - "repository": { - "type": "git", - "url": "git+https://github.com/sindresorhus/is-installed-globally.git" - }, - "scripts": { - "test": "xo && ava" - }, - "version": "0.1.0" -} diff --git a/deps/npm/node_modules/is-installed-globally/readme.md b/deps/npm/node_modules/is-installed-globally/readme.md deleted file mode 100644 index f3c93386d327ae..00000000000000 --- a/deps/npm/node_modules/is-installed-globally/readme.md +++ /dev/null @@ -1,39 +0,0 @@ -# is-installed-globally [![Build Status](https://travis-ci.org/sindresorhus/is-installed-globally.svg?branch=master)](https://travis-ci.org/sindresorhus/is-installed-globally) - -> Check if your package was installed globally - -Can be useful if your CLI needs different behavior when installed globally and locally. - - -## Install - -``` -$ npm install is-installed-globally -``` - - -## Usage - -```js -const isInstalledGlobally = require('is-installed-globally'); - -// With `npm install your-package` -console.log(isInstalledGlobally); -//=> false - -// With `npm install --global your-package` -console.log(isInstalledGlobally); -//=> true -``` - - -## Related - -- [import-global](https://github.com/sindresorhus/import-global) - Import a globally installed module -- [resolve-global](https://github.com/sindresorhus/resolve-global) - Resolve the path of a globally installed module -- [global-dirs](https://github.com/sindresorhus/global-dirs) - Get the directory of globally installed packages and binaries - - -## License - -MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/deps/npm/node_modules/copy-concurrently/node_modules/iferr/.npmignore b/deps/npm/node_modules/is-lambda/.npmignore similarity index 100% rename from deps/npm/node_modules/copy-concurrently/node_modules/iferr/.npmignore rename to deps/npm/node_modules/is-lambda/.npmignore diff --git a/deps/npm/node_modules/is-lambda/.travis.yml b/deps/npm/node_modules/is-lambda/.travis.yml new file mode 100644 index 00000000000000..03dcca57bcc806 --- /dev/null +++ b/deps/npm/node_modules/is-lambda/.travis.yml @@ -0,0 +1,8 @@ +language: node_js +node_js: +- '7' +- '6' +- '5' +- '4' +- '0.12' +- '0.10' diff --git a/deps/npm/node_modules/is-lambda/LICENSE b/deps/npm/node_modules/is-lambda/LICENSE new file mode 100644 index 00000000000000..4a59c94175c2a3 --- /dev/null +++ b/deps/npm/node_modules/is-lambda/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2016-2017 Thomas Watson Steen + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/deps/npm/node_modules/is-lambda/README.md b/deps/npm/node_modules/is-lambda/README.md new file mode 100644 index 00000000000000..31a8f566ca0022 --- /dev/null +++ b/deps/npm/node_modules/is-lambda/README.md @@ -0,0 +1,27 @@ +# is-lambda + +Returns `true` if the current environment is an [AWS +Lambda](https://aws.amazon.com/lambda/) server. + +[![Build status](https://travis-ci.org/watson/is-lambda.svg?branch=master)](https://travis-ci.org/watson/is-lambda) +[![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat)](https://github.com/feross/standard) + +## Installation + +``` +npm install is-lambda +``` + +## Usage + +```js +var isLambda = require('is-lambda') + +if (isLambda) { + console.log('The code is running on a AWS Lambda') +} +``` + +## License + +MIT diff --git a/deps/npm/node_modules/is-lambda/index.js b/deps/npm/node_modules/is-lambda/index.js new file mode 100644 index 00000000000000..b245ab1c68df1a --- /dev/null +++ b/deps/npm/node_modules/is-lambda/index.js @@ -0,0 +1,6 @@ +'use strict' + +module.exports = !!( + (process.env.LAMBDA_TASK_ROOT && process.env.AWS_EXECUTION_ENV) || + false +) diff --git a/deps/npm/node_modules/is-lambda/package.json b/deps/npm/node_modules/is-lambda/package.json new file mode 100644 index 00000000000000..d8550898b4e4d9 --- /dev/null +++ b/deps/npm/node_modules/is-lambda/package.json @@ -0,0 +1,35 @@ +{ + "name": "is-lambda", + "version": "1.0.1", + "description": "Detect if your code is running on an AWS Lambda server", + "main": "index.js", + "dependencies": {}, + "devDependencies": { + "clear-require": "^1.0.1", + "standard": "^10.0.2" + }, + "scripts": { + "test": "standard && node test.js" + }, + "repository": { + "type": "git", + "url": "https://github.com/watson/is-lambda.git" + }, + "keywords": [ + "aws", + "hosting", + "hosted", + "lambda", + "detect" + ], + "author": "Thomas Watson Steen (https://twitter.com/wa7son)", + "license": "MIT", + "bugs": { + "url": "https://github.com/watson/is-lambda/issues" + }, + "homepage": "https://github.com/watson/is-lambda", + "coordinates": [ + 37.3859955, + -122.0838831 + ] +} diff --git a/deps/npm/node_modules/is-lambda/test.js b/deps/npm/node_modules/is-lambda/test.js new file mode 100644 index 00000000000000..e8e73257ad4ad7 --- /dev/null +++ b/deps/npm/node_modules/is-lambda/test.js @@ -0,0 +1,16 @@ +'use strict' + +var assert = require('assert') +var clearRequire = require('clear-require') + +process.env.AWS_EXECUTION_ENV = 'AWS_Lambda_nodejs6.10' +process.env.LAMBDA_TASK_ROOT = '/var/task' + +var isCI = require('./') +assert(isCI) + +delete process.env.AWS_EXECUTION_ENV + +clearRequire('./') +isCI = require('./') +assert(!isCI) diff --git a/deps/npm/node_modules/is-npm/index.js b/deps/npm/node_modules/is-npm/index.js deleted file mode 100644 index b5f3c27ab3ced4..00000000000000 --- a/deps/npm/node_modules/is-npm/index.js +++ /dev/null @@ -1,4 +0,0 @@ -'use strict'; -module.exports = 'npm_config_username' in process.env || - 'npm_package_name' in process.env || - 'npm_config_heading' in process.env; diff --git a/deps/npm/node_modules/is-npm/package.json b/deps/npm/node_modules/is-npm/package.json deleted file mode 100644 index 9e2018a1225615..00000000000000 --- a/deps/npm/node_modules/is-npm/package.json +++ /dev/null @@ -1,64 +0,0 @@ -{ - "_from": "is-npm@^1.0.0", - "_id": "is-npm@1.0.0", - "_inBundle": false, - "_integrity": "sha1-8vtjpl5JBbQGyGBydloaTceTufQ=", - "_location": "/is-npm", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "is-npm@^1.0.0", - "name": "is-npm", - "escapedName": "is-npm", - "rawSpec": "^1.0.0", - "saveSpec": null, - "fetchSpec": "^1.0.0" - }, - "_requiredBy": [ - "/update-notifier" - ], - "_resolved": "https://registry.npmjs.org/is-npm/-/is-npm-1.0.0.tgz", - "_shasum": "f2fb63a65e4905b406c86072765a1a4dc793b9f4", - "_spec": "is-npm@^1.0.0", - "_where": "/Users/rebecca/code/npm/node_modules/update-notifier", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "http://sindresorhus.com" - }, - "bugs": { - "url": "https://github.com/sindresorhus/is-npm/issues" - }, - "bundleDependencies": false, - "deprecated": false, - "description": "Check if your code is running as an npm script", - "devDependencies": { - "ava": "0.0.3" - }, - "engines": { - "node": ">=0.10.0" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/sindresorhus/is-npm#readme", - "keywords": [ - "npm", - "is", - "check", - "detect", - "env", - "environment" - ], - "license": "MIT", - "name": "is-npm", - "repository": { - "type": "git", - "url": "git+https://github.com/sindresorhus/is-npm.git" - }, - "scripts": { - "test": "node test.js" - }, - "version": "1.0.0" -} diff --git a/deps/npm/node_modules/is-npm/readme.md b/deps/npm/node_modules/is-npm/readme.md deleted file mode 100644 index 84833ec65b3bdc..00000000000000 --- a/deps/npm/node_modules/is-npm/readme.md +++ /dev/null @@ -1,30 +0,0 @@ -# is-npm [![Build Status](https://travis-ci.org/sindresorhus/is-npm.svg?branch=master)](https://travis-ci.org/sindresorhus/is-npm) - -> Check if your code is running as an [npm script](https://www.npmjs.org/doc/misc/npm-scripts.html) - - -## Install - -```sh -$ npm install --save is-npm -``` - - -## Usage - -```js -var isNpm = require('is-npm'); -console.log(isNpm); -``` - -```sh -$ node foo.js -#=> false -$ npm run foo -#=> true -``` - - -## License - -MIT © [Sindre Sorhus](http://sindresorhus.com) diff --git a/deps/npm/node_modules/is-obj/index.js b/deps/npm/node_modules/is-obj/index.js deleted file mode 100644 index 4d023bc6903177..00000000000000 --- a/deps/npm/node_modules/is-obj/index.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; -module.exports = function (x) { - var type = typeof x; - return x !== null && (type === 'object' || type === 'function'); -}; diff --git a/deps/npm/node_modules/is-obj/license b/deps/npm/node_modules/is-obj/license deleted file mode 100644 index 654d0bfe943437..00000000000000 --- a/deps/npm/node_modules/is-obj/license +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -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/deps/npm/node_modules/is-obj/package.json b/deps/npm/node_modules/is-obj/package.json deleted file mode 100644 index d9180dbab26fad..00000000000000 --- a/deps/npm/node_modules/is-obj/package.json +++ /dev/null @@ -1,65 +0,0 @@ -{ - "_from": "is-obj@^1.0.0", - "_id": "is-obj@1.0.1", - "_inBundle": false, - "_integrity": "sha1-PkcprB9f3gJc19g6iW2rn09n2w8=", - "_location": "/is-obj", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "is-obj@^1.0.0", - "name": "is-obj", - "escapedName": "is-obj", - "rawSpec": "^1.0.0", - "saveSpec": null, - "fetchSpec": "^1.0.0" - }, - "_requiredBy": [ - "/dot-prop" - ], - "_resolved": "https://registry.npmjs.org/is-obj/-/is-obj-1.0.1.tgz", - "_shasum": "3e4729ac1f5fde025cd7d83a896dab9f4f67db0f", - "_spec": "is-obj@^1.0.0", - "_where": "/Users/rebecca/code/npm/node_modules/dot-prop", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "bugs": { - "url": "https://github.com/sindresorhus/is-obj/issues" - }, - "bundleDependencies": false, - "deprecated": false, - "description": "Check if a value is an object", - "devDependencies": { - "ava": "*", - "xo": "*" - }, - "engines": { - "node": ">=0.10.0" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/sindresorhus/is-obj#readme", - "keywords": [ - "obj", - "object", - "is", - "check", - "test", - "type" - ], - "license": "MIT", - "name": "is-obj", - "repository": { - "type": "git", - "url": "git+https://github.com/sindresorhus/is-obj.git" - }, - "scripts": { - "test": "xo && ava" - }, - "version": "1.0.1" -} diff --git a/deps/npm/node_modules/is-obj/readme.md b/deps/npm/node_modules/is-obj/readme.md deleted file mode 100644 index d311026430ad92..00000000000000 --- a/deps/npm/node_modules/is-obj/readme.md +++ /dev/null @@ -1,34 +0,0 @@ -# is-obj [![Build Status](https://travis-ci.org/sindresorhus/is-obj.svg?branch=master)](https://travis-ci.org/sindresorhus/is-obj) - -> Check if a value is an object - -Keep in mind that array, function, regexp, etc, are objects in JavaScript.
    -See [`is-plain-obj`](https://github.com/sindresorhus/is-plain-obj) if you want to check for plain objects. - - -## Install - -``` -$ npm install --save is-obj -``` - - -## Usage - -```js -const isObj = require('is-obj'); - -isObj({foo: 'bar'}); -//=> true - -isObj([1, 2, 3]); -//=> true - -isObj('foo'); -//=> false -``` - - -## License - -MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/deps/npm/node_modules/is-path-inside/index.js b/deps/npm/node_modules/is-path-inside/index.js deleted file mode 100644 index 0a4d2fd1e58074..00000000000000 --- a/deps/npm/node_modules/is-path-inside/index.js +++ /dev/null @@ -1,14 +0,0 @@ -'use strict'; -var path = require('path'); -var pathIsInside = require('path-is-inside'); - -module.exports = function (a, b) { - a = path.resolve(a); - b = path.resolve(b); - - if (a === b) { - return false; - } - - return pathIsInside(a, b); -}; diff --git a/deps/npm/node_modules/is-path-inside/license b/deps/npm/node_modules/is-path-inside/license deleted file mode 100644 index 654d0bfe943437..00000000000000 --- a/deps/npm/node_modules/is-path-inside/license +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -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/deps/npm/node_modules/is-path-inside/package.json b/deps/npm/node_modules/is-path-inside/package.json deleted file mode 100644 index c76d7e04df7964..00000000000000 --- a/deps/npm/node_modules/is-path-inside/package.json +++ /dev/null @@ -1,70 +0,0 @@ -{ - "_from": "is-path-inside@^1.0.0", - "_id": "is-path-inside@1.0.1", - "_inBundle": false, - "_integrity": "sha1-jvW33lBDej/cprToZe96pVy0gDY=", - "_location": "/is-path-inside", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "is-path-inside@^1.0.0", - "name": "is-path-inside", - "escapedName": "is-path-inside", - "rawSpec": "^1.0.0", - "saveSpec": null, - "fetchSpec": "^1.0.0" - }, - "_requiredBy": [ - "/is-installed-globally", - "/is-path-in-cwd" - ], - "_resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-1.0.1.tgz", - "_shasum": "8ef5b7de50437a3fdca6b4e865ef7aa55cb48036", - "_spec": "is-path-inside@^1.0.0", - "_where": "/Users/rebecca/code/npm/node_modules/is-installed-globally", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "bugs": { - "url": "https://github.com/sindresorhus/is-path-inside/issues" - }, - "bundleDependencies": false, - "dependencies": { - "path-is-inside": "^1.0.1" - }, - "deprecated": false, - "description": "Check if a path is inside another path", - "devDependencies": { - "ava": "*", - "xo": "*" - }, - "engines": { - "node": ">=0.10.0" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/sindresorhus/is-path-inside#readme", - "keywords": [ - "path", - "inside", - "folder", - "directory", - "dir", - "file", - "resolve" - ], - "license": "MIT", - "name": "is-path-inside", - "repository": { - "type": "git", - "url": "git+https://github.com/sindresorhus/is-path-inside.git" - }, - "scripts": { - "test": "xo && ava" - }, - "version": "1.0.1" -} diff --git a/deps/npm/node_modules/is-path-inside/readme.md b/deps/npm/node_modules/is-path-inside/readme.md deleted file mode 100644 index cc5f51625d3e9c..00000000000000 --- a/deps/npm/node_modules/is-path-inside/readme.md +++ /dev/null @@ -1,34 +0,0 @@ -# is-path-inside [![Build Status](https://travis-ci.org/sindresorhus/is-path-inside.svg?branch=master)](https://travis-ci.org/sindresorhus/is-path-inside) - -> Check if a path is inside another path - - -## Install - -``` -$ npm install --save is-path-inside -``` - - -## Usage - -```js -var isPathInside = require('is-path-inside'); - -isPathInside('a/b/c', 'a/b'); -//=> true - -isPathInside('a/b/c', 'x/y'); -//=> false - -isPathInside('a/b/c', 'a/b/c'); -//=> false - -isPathInside('/Users/sindresorhus/dev/unicorn', '/Users/sindresorhus'); -//=> true -``` - - -## License - -MIT © [Sindre Sorhus](http://sindresorhus.com) diff --git a/deps/npm/node_modules/is-redirect/index.js b/deps/npm/node_modules/is-redirect/index.js deleted file mode 100644 index 75ec0090efc54b..00000000000000 --- a/deps/npm/node_modules/is-redirect/index.js +++ /dev/null @@ -1,14 +0,0 @@ -'use strict'; -module.exports = function (x) { - if (typeof x !== 'number') { - throw new TypeError('Expected a number'); - } - - return x === 300 || - x === 301 || - x === 302 || - x === 303 || - x === 305 || - x === 307 || - x === 308; -}; diff --git a/deps/npm/node_modules/is-redirect/license b/deps/npm/node_modules/is-redirect/license deleted file mode 100644 index 654d0bfe943437..00000000000000 --- a/deps/npm/node_modules/is-redirect/license +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -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/deps/npm/node_modules/is-redirect/package.json b/deps/npm/node_modules/is-redirect/package.json deleted file mode 100644 index 4cfb34573188e1..00000000000000 --- a/deps/npm/node_modules/is-redirect/package.json +++ /dev/null @@ -1,67 +0,0 @@ -{ - "_from": "is-redirect@^1.0.0", - "_id": "is-redirect@1.0.0", - "_inBundle": false, - "_integrity": "sha1-HQPd7VO9jbDzDCbk+V02/HyH3CQ=", - "_location": "/is-redirect", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "is-redirect@^1.0.0", - "name": "is-redirect", - "escapedName": "is-redirect", - "rawSpec": "^1.0.0", - "saveSpec": null, - "fetchSpec": "^1.0.0" - }, - "_requiredBy": [ - "/got" - ], - "_resolved": "https://registry.npmjs.org/is-redirect/-/is-redirect-1.0.0.tgz", - "_shasum": "1d03dded53bd8db0f30c26e4f95d36fc7c87dc24", - "_spec": "is-redirect@^1.0.0", - "_where": "/Users/rebecca/code/npm/node_modules/got", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "bugs": { - "url": "https://github.com/sindresorhus/is-redirect/issues" - }, - "bundleDependencies": false, - "deprecated": false, - "description": "Check if a number is a redirect HTTP status code", - "devDependencies": { - "ava": "0.0.4" - }, - "engines": { - "node": ">=0.10.0" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/sindresorhus/is-redirect#readme", - "keywords": [ - "redirect", - "http", - "https", - "status", - "code", - "codes", - "is", - "check", - "detect" - ], - "license": "MIT", - "name": "is-redirect", - "repository": { - "type": "git", - "url": "git+https://github.com/sindresorhus/is-redirect.git" - }, - "scripts": { - "test": "node test.js" - }, - "version": "1.0.0" -} diff --git a/deps/npm/node_modules/is-redirect/readme.md b/deps/npm/node_modules/is-redirect/readme.md deleted file mode 100644 index e9f0a393d2b972..00000000000000 --- a/deps/npm/node_modules/is-redirect/readme.md +++ /dev/null @@ -1,28 +0,0 @@ -# is-redirect [![Build Status](https://travis-ci.org/sindresorhus/is-redirect.svg?branch=master)](https://travis-ci.org/sindresorhus/is-redirect) - -> Check if a number is a [redirect HTTP status code](http://en.wikipedia.org/wiki/List_of_HTTP_status_codes#3xx_Redirection) - - -## Install - -``` -$ npm install --save is-redirect -``` - - -## Usage - -```js -var isRedirect = require('is-redirect'); - -isRedirect(302); -//=> true - -isRedirect(200); -//=> false -``` - - -## License - -MIT © [Sindre Sorhus](http://sindresorhus.com) diff --git a/deps/npm/node_modules/is-regex/.jscs.json b/deps/npm/node_modules/is-regex/.jscs.json deleted file mode 100644 index 3d099c4b1192c4..00000000000000 --- a/deps/npm/node_modules/is-regex/.jscs.json +++ /dev/null @@ -1,176 +0,0 @@ -{ - "es3": true, - - "additionalRules": [], - - "requireSemicolons": true, - - "disallowMultipleSpaces": true, - - "disallowIdentifierNames": [], - - "requireCurlyBraces": { - "allExcept": [], - "keywords": ["if", "else", "for", "while", "do", "try", "catch"] - }, - - "requireSpaceAfterKeywords": ["if", "else", "for", "while", "do", "switch", "return", "try", "catch", "function"], - - "disallowSpaceAfterKeywords": [], - - "disallowSpaceBeforeComma": true, - "disallowSpaceAfterComma": false, - "disallowSpaceBeforeSemicolon": true, - - "disallowNodeTypes": [ - "DebuggerStatement", - "ForInStatement", - "LabeledStatement", - "SwitchCase", - "SwitchStatement", - "WithStatement" - ], - - "requireObjectKeysOnNewLine": { "allExcept": ["sameLine"] }, - - "requireSpacesInAnonymousFunctionExpression": { "beforeOpeningRoundBrace": true, "beforeOpeningCurlyBrace": true }, - "requireSpacesInNamedFunctionExpression": { "beforeOpeningCurlyBrace": true }, - "disallowSpacesInNamedFunctionExpression": { "beforeOpeningRoundBrace": true }, - "requireSpacesInFunctionDeclaration": { "beforeOpeningCurlyBrace": true }, - "disallowSpacesInFunctionDeclaration": { "beforeOpeningRoundBrace": true }, - - "requireSpaceBetweenArguments": true, - - "disallowSpacesInsideParentheses": true, - - "disallowSpacesInsideArrayBrackets": true, - - "disallowQuotedKeysInObjects": { "allExcept": ["reserved"] }, - - "disallowSpaceAfterObjectKeys": true, - - "requireCommaBeforeLineBreak": true, - - "disallowSpaceAfterPrefixUnaryOperators": ["++", "--", "+", "-", "~", "!"], - "requireSpaceAfterPrefixUnaryOperators": [], - - "disallowSpaceBeforePostfixUnaryOperators": ["++", "--"], - "requireSpaceBeforePostfixUnaryOperators": [], - - "disallowSpaceBeforeBinaryOperators": [], - "requireSpaceBeforeBinaryOperators": ["+", "-", "/", "*", "=", "==", "===", "!=", "!=="], - - "requireSpaceAfterBinaryOperators": ["+", "-", "/", "*", "=", "==", "===", "!=", "!=="], - "disallowSpaceAfterBinaryOperators": [], - - "disallowImplicitTypeConversion": ["binary", "string"], - - "disallowKeywords": ["with", "eval"], - - "requireKeywordsOnNewLine": [], - "disallowKeywordsOnNewLine": ["else"], - - "requireLineFeedAtFileEnd": true, - - "disallowTrailingWhitespace": true, - - "disallowTrailingComma": true, - - "excludeFiles": ["node_modules/**", "vendor/**"], - - "disallowMultipleLineStrings": true, - - "requireDotNotation": { "allExcept": ["keywords"] }, - - "requireParenthesesAroundIIFE": true, - - "validateLineBreaks": "LF", - - "validateQuoteMarks": { - "escape": true, - "mark": "'" - }, - - "disallowOperatorBeforeLineBreak": [], - - "requireSpaceBeforeKeywords": [ - "do", - "for", - "if", - "else", - "switch", - "case", - "try", - "catch", - "finally", - "while", - "with", - "return" - ], - - "validateAlignedFunctionParameters": { - "lineBreakAfterOpeningBraces": true, - "lineBreakBeforeClosingBraces": true - }, - - "requirePaddingNewLinesBeforeExport": true, - - "validateNewlineAfterArrayElements": { - "maximum": 1 - }, - - "requirePaddingNewLinesAfterUseStrict": true, - - "disallowArrowFunctions": true, - - "disallowMultiLineTernary": true, - - "validateOrderInObjectKeys": "asc-insensitive", - - "disallowIdenticalDestructuringNames": true, - - "disallowNestedTernaries": { "maxLevel": 1 }, - - "requireSpaceAfterComma": { "allExcept": ["trailing"] }, - "requireAlignedMultilineParams": false, - - "requireSpacesInGenerator": { - "afterStar": true - }, - - "disallowSpacesInGenerator": { - "beforeStar": true - }, - - "disallowVar": false, - - "requireArrayDestructuring": false, - - "requireEnhancedObjectLiterals": false, - - "requireObjectDestructuring": false, - - "requireEarlyReturn": false, - - "requireCapitalizedConstructorsNew": { - "allExcept": ["Function", "String", "Object", "Symbol", "Number", "Date", "RegExp", "Error", "Boolean", "Array"] - }, - - "requireImportAlphabetized": false, - - "requireSpaceBeforeObjectValues": true, - "requireSpaceBeforeDestructuredValues": true, - - "disallowSpacesInsideTemplateStringPlaceholders": true, - - "disallowArrayDestructuringReturn": false, - - "requireNewlineBeforeSingleStatementsInIf": false, - - "disallowUnusedVariables": true, - - "requireSpacesInsideImportedObjectBraces": true, - - "requireUseStrict": true -} - diff --git a/deps/npm/node_modules/is-regex/.npmignore b/deps/npm/node_modules/is-regex/.npmignore deleted file mode 100644 index a72b52ebe89779..00000000000000 --- a/deps/npm/node_modules/is-regex/.npmignore +++ /dev/null @@ -1,15 +0,0 @@ -lib-cov -*.seed -*.log -*.csv -*.dat -*.out -*.pid -*.gz - -pids -logs -results - -npm-debug.log -node_modules diff --git a/deps/npm/node_modules/is-regex/.travis.yml b/deps/npm/node_modules/is-regex/.travis.yml deleted file mode 100644 index 41137a89a59196..00000000000000 --- a/deps/npm/node_modules/is-regex/.travis.yml +++ /dev/null @@ -1,165 +0,0 @@ -language: node_js -os: - - linux -node_js: - - "7.5" - - "6.9" - - "5.12" - - "4.7" - - "iojs-v3.3" - - "iojs-v2.5" - - "iojs-v1.8" - - "0.12" - - "0.10" - - "0.8" -before_install: - - 'if [ "${TRAVIS_NODE_VERSION}" = "0.6" ]; then npm install -g npm@1.3 ; elif [ "${TRAVIS_NODE_VERSION}" != "0.9" ]; then case "$(npm --version)" in 1.*) npm install -g npm@1.4.28 ;; 2.*) npm install -g npm@2 ;; esac ; fi' - - 'if [ "${TRAVIS_NODE_VERSION}" != "0.6" ] && [ "${TRAVIS_NODE_VERSION}" != "0.9" ]; then npm install -g npm; fi' -script: - - 'if [ -n "${PRETEST-}" ]; then npm run pretest ; fi' - - 'if [ -n "${POSTTEST-}" ]; then npm run posttest ; fi' - - 'if [ -n "${COVERAGE-}" ]; then npm run coverage ; fi' - - 'if [ -n "${TEST-}" ]; then npm run tests-only ; fi' -sudo: false -env: - - TEST=true -matrix: - fast_finish: true - include: - - node_js: "node" - env: PRETEST=true - - node_js: "node" - env: POSTTEST=true - - node_js: "7.4" - env: TEST=true ALLOW_FAILURE=true - - node_js: "7.3" - env: TEST=true ALLOW_FAILURE=true - - node_js: "7.2" - env: TEST=true ALLOW_FAILURE=true - - node_js: "7.1" - env: TEST=true ALLOW_FAILURE=true - - node_js: "7.0" - env: TEST=true ALLOW_FAILURE=true - - node_js: "6.8" - env: TEST=true ALLOW_FAILURE=true - - node_js: "6.7" - env: TEST=true ALLOW_FAILURE=true - - node_js: "6.6" - env: TEST=true ALLOW_FAILURE=true - - node_js: "6.5" - env: TEST=true ALLOW_FAILURE=true - - node_js: "6.4" - env: TEST=true ALLOW_FAILURE=true - - node_js: "6.3" - env: TEST=true ALLOW_FAILURE=true - - node_js: "6.2" - env: TEST=true ALLOW_FAILURE=true - - node_js: "6.1" - env: TEST=true ALLOW_FAILURE=true - - node_js: "6.0" - env: TEST=true ALLOW_FAILURE=true - - node_js: "5.11" - env: TEST=true ALLOW_FAILURE=true - - node_js: "5.10" - env: TEST=true ALLOW_FAILURE=true - - node_js: "5.9" - env: TEST=true ALLOW_FAILURE=true - - node_js: "5.8" - env: TEST=true ALLOW_FAILURE=true - - node_js: "5.7" - env: TEST=true ALLOW_FAILURE=true - - node_js: "5.6" - env: TEST=true ALLOW_FAILURE=true - - node_js: "5.5" - env: TEST=true ALLOW_FAILURE=true - - node_js: "5.4" - env: TEST=true ALLOW_FAILURE=true - - node_js: "5.3" - env: TEST=true ALLOW_FAILURE=true - - node_js: "5.2" - env: TEST=true ALLOW_FAILURE=true - - node_js: "5.1" - env: TEST=true ALLOW_FAILURE=true - - node_js: "5.0" - env: TEST=true ALLOW_FAILURE=true - - node_js: "4.6" - env: TEST=true ALLOW_FAILURE=true - - node_js: "4.5" - env: TEST=true ALLOW_FAILURE=true - - node_js: "4.4" - env: TEST=true ALLOW_FAILURE=true - - node_js: "4.3" - env: TEST=true ALLOW_FAILURE=true - - node_js: "4.2" - env: TEST=true ALLOW_FAILURE=true - - node_js: "4.1" - env: TEST=true ALLOW_FAILURE=true - - node_js: "4.0" - env: TEST=true ALLOW_FAILURE=true - - node_js: "iojs-v3.2" - env: TEST=true ALLOW_FAILURE=true - - node_js: "iojs-v3.1" - env: TEST=true ALLOW_FAILURE=true - - node_js: "iojs-v3.0" - env: TEST=true ALLOW_FAILURE=true - - node_js: "iojs-v2.4" - env: TEST=true ALLOW_FAILURE=true - - node_js: "iojs-v2.3" - env: TEST=true ALLOW_FAILURE=true - - node_js: "iojs-v2.2" - env: TEST=true ALLOW_FAILURE=true - - node_js: "iojs-v2.1" - env: TEST=true ALLOW_FAILURE=true - - node_js: "iojs-v2.0" - env: TEST=true ALLOW_FAILURE=true - - node_js: "iojs-v1.7" - env: TEST=true ALLOW_FAILURE=true - - node_js: "iojs-v1.6" - env: TEST=true ALLOW_FAILURE=true - - node_js: "iojs-v1.5" - env: TEST=true ALLOW_FAILURE=true - - node_js: "iojs-v1.4" - env: TEST=true ALLOW_FAILURE=true - - node_js: "iojs-v1.3" - env: TEST=true ALLOW_FAILURE=true - - node_js: "iojs-v1.2" - env: TEST=true ALLOW_FAILURE=true - - node_js: "iojs-v1.1" - env: TEST=true ALLOW_FAILURE=true - - node_js: "iojs-v1.0" - env: TEST=true ALLOW_FAILURE=true - - node_js: "0.11" - env: TEST=true ALLOW_FAILURE=true - - node_js: "0.9" - env: TEST=true ALLOW_FAILURE=true - - node_js: "0.6" - env: TEST=true ALLOW_FAILURE=true - - node_js: "0.4" - env: TEST=true ALLOW_FAILURE=true - - node_js: "7" - env: TEST=true - os: osx - - node_js: "6" - env: TEST=true - os: osx - - node_js: "5" - env: TEST=true - os: osx - - node_js: "4" - env: TEST=true - os: osx - - node_js: "iojs" - env: TEST=true - os: osx - - node_js: "0.12" - env: TEST=true - os: osx - - node_js: "0.10" - env: TEST=true - os: osx - - node_js: "0.8" - env: TEST=true - os: osx - allow_failures: - - os: osx - - env: TEST=true ALLOW_FAILURE=true diff --git a/deps/npm/node_modules/is-regex/CHANGELOG.md b/deps/npm/node_modules/is-regex/CHANGELOG.md deleted file mode 100644 index 6d73800022da37..00000000000000 --- a/deps/npm/node_modules/is-regex/CHANGELOG.md +++ /dev/null @@ -1,27 +0,0 @@ -1.0.4 / 2016-02-18 -================= - * [Fix] ensure that `lastIndex` is not mutated (#3) - * [Refactor] when try/catch is needed, bail early if the value lacks an own `lastIndex` data property - * [Refactor] use an early return instead of a ternary - * [Refactor] bail earlier when the value is falsy - * Switch from vb.teelaun.ch to versionbadg.es for the npm version badge SVG - * [Dev Deps] update `tape`, `jscs`, `editorconfig-tools`, `eslint`, `semver`, `replace`, `nsp`, `covert`, `@ljharb/eslint-config` - * [Tests] on all the node and io.js versions; improve test matri - * [Tests] Fix tests for faked @@toStringTag - -1.0.3 / 2015-01-29 -================= - * If @@toStringTag is not present, use the old-school Object#toString test. - -1.0.2 / 2015-01-29 -================= - * Improve optimization by separating the try/catch, and bailing out early when not typeof "object". - -1.0.1 / 2015-01-28 -================= - * Update `jscs`, `tape`, `covert` - * Use RegExp#exec to test if something is a regex, which works even with ES6 @@toStringTag. - -1.0.0 / 2014-05-19 -================= - * Initial release. diff --git a/deps/npm/node_modules/is-regex/LICENSE b/deps/npm/node_modules/is-regex/LICENSE deleted file mode 100644 index 47b7b5078fce38..00000000000000 --- a/deps/npm/node_modules/is-regex/LICENSE +++ /dev/null @@ -1,20 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2014 Jordan Harband - -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/is-regex/Makefile b/deps/npm/node_modules/is-regex/Makefile deleted file mode 100644 index b9e4fe1aab3dde..00000000000000 --- a/deps/npm/node_modules/is-regex/Makefile +++ /dev/null @@ -1,61 +0,0 @@ -# Since we rely on paths relative to the makefile location, abort if make isn't being run from there. -$(if $(findstring /,$(MAKEFILE_LIST)),$(error Please only invoke this makefile from the directory it resides in)) - - # The files that need updating when incrementing the version number. -VERSIONED_FILES := *.js *.json README* - - -# Add the local npm packages' bin folder to the PATH, so that `make` can find them, when invoked directly. -# Note that rather than using `$(npm bin)` the 'node_modules/.bin' path component is hard-coded, so that invocation works even from an environment -# where npm is (temporarily) unavailable due to having deactivated an nvm instance loaded into the calling shell in order to avoid interference with tests. -export PATH := $(shell printf '%s' "$$PWD/node_modules/.bin:$$PATH") -UTILS := semver -# Make sure that all required utilities can be located. -UTIL_CHECK := $(or $(shell PATH="$(PATH)" which $(UTILS) >/dev/null && echo 'ok'),$(error Did you forget to run `npm install` after cloning the repo? At least one of the required supporting utilities not found: $(UTILS))) - -# Default target (by virtue of being the first non '.'-prefixed in the file). -.PHONY: _no-target-specified -_no-target-specified: - $(error Please specify the target to make - `make list` shows targets. Alternatively, use `npm test` to run the default tests; `npm run` shows all tests) - -# Lists all targets defined in this makefile. -.PHONY: list -list: - @$(MAKE) -pRrn : -f $(MAKEFILE_LIST) 2>/dev/null | awk -v RS= -F: '/^# File/,/^# Finished Make data base/ {if ($$1 !~ "^[#.]") {print $$1}}' | command grep -v -e '^[^[:alnum:]]' -e '^$@$$command ' | sort - -# All-tests target: invokes the specified test suites for ALL shells defined in $(SHELLS). -.PHONY: test -test: - @npm test - -.PHONY: _ensure-tag -_ensure-tag: -ifndef TAG - $(error Please invoke with `make TAG= release`, where is either an increment specifier (patch, minor, major, prepatch, preminor, premajor, prerelease), or an explicit major.minor.patch version number) -endif - -CHANGELOG_ERROR = $(error No CHANGELOG specified) -.PHONY: _ensure-changelog -_ensure-changelog: - @ (git status -sb --porcelain | command grep -E '^( M|[MA] ) CHANGELOG.md' > /dev/null) || (echo no CHANGELOG.md specified && exit 2) - -# Ensures that the git workspace is clean. -.PHONY: _ensure-clean -_ensure-clean: - @[ -z "$$((git status --porcelain --untracked-files=no || echo err) | command grep -v 'CHANGELOG.md')" ] || { echo "Workspace is not clean; please commit changes first." >&2; exit 2; } - -# Makes a release; invoke with `make TAG= release`. -.PHONY: release -release: _ensure-tag _ensure-changelog _ensure-clean - @old_ver=`git describe --abbrev=0 --tags --match 'v[0-9]*.[0-9]*.[0-9]*'` || { echo "Failed to determine current version." >&2; exit 1; }; old_ver=$${old_ver#v}; \ - new_ver=`echo "$(TAG)" | sed 's/^v//'`; new_ver=$${new_ver:-patch}; \ - if printf "$$new_ver" | command grep -q '^[0-9]'; then \ - semver "$$new_ver" >/dev/null || { echo 'Invalid version number specified: $(TAG) - must be major.minor.patch' >&2; exit 2; }; \ - semver -r "> $$old_ver" "$$new_ver" >/dev/null || { echo 'Invalid version number specified: $(TAG) - must be HIGHER than current one.' >&2; exit 2; } \ - else \ - new_ver=`semver -i "$$new_ver" "$$old_ver"` || { echo 'Invalid version-increment specifier: $(TAG)' >&2; exit 2; } \ - fi; \ - printf "=== Bumping version **$$old_ver** to **$$new_ver** before committing and tagging:\n=== TYPE 'proceed' TO PROCEED, anything else to abort: " && read response && [ "$$response" = 'proceed' ] || { echo 'Aborted.' >&2; exit 2; }; \ - replace "$$old_ver" "$$new_ver" -- $(VERSIONED_FILES) && \ - git commit -m "v$$new_ver" $(VERSIONED_FILES) CHANGELOG.md && \ - git tag -a -m "v$$new_ver" "v$$new_ver" diff --git a/deps/npm/node_modules/is-regex/README.md b/deps/npm/node_modules/is-regex/README.md deleted file mode 100644 index 05baa0ebca339b..00000000000000 --- a/deps/npm/node_modules/is-regex/README.md +++ /dev/null @@ -1,54 +0,0 @@ -#is-regex [![Version Badge][2]][1] - -[![Build Status][3]][4] -[![dependency status][5]][6] -[![dev dependency status][7]][8] -[![License][license-image]][license-url] -[![Downloads][downloads-image]][downloads-url] - -[![npm badge][11]][1] - -[![browser support][9]][10] - -Is this value a JS regex? -This module works cross-realm/iframe, and despite ES6 @@toStringTag. - -## Example - -```js -var isRegex = require('is-regex'); -var assert = require('assert'); - -assert.notOk(isRegex(undefined)); -assert.notOk(isRegex(null)); -assert.notOk(isRegex(false)); -assert.notOk(isRegex(true)); -assert.notOk(isRegex(42)); -assert.notOk(isRegex('foo')); -assert.notOk(isRegex(function () {})); -assert.notOk(isRegex([])); -assert.notOk(isRegex({})); - -assert.ok(isRegex(/a/g)); -assert.ok(isRegex(new RegExp('a', 'g'))); -``` - -## Tests -Simply clone the repo, `npm install`, and run `npm test` - -[1]: https://npmjs.org/package/is-regex -[2]: http://versionbadg.es/ljharb/is-regex.svg -[3]: https://travis-ci.org/ljharb/is-regex.svg -[4]: https://travis-ci.org/ljharb/is-regex -[5]: https://david-dm.org/ljharb/is-regex.svg -[6]: https://david-dm.org/ljharb/is-regex -[7]: https://david-dm.org/ljharb/is-regex/dev-status.svg -[8]: https://david-dm.org/ljharb/is-regex#info=devDependencies -[9]: https://ci.testling.com/ljharb/is-regex.png -[10]: https://ci.testling.com/ljharb/is-regex -[11]: https://nodei.co/npm/is-regex.png?downloads=true&stars=true -[license-image]: http://img.shields.io/npm/l/is-regex.svg -[license-url]: LICENSE -[downloads-image]: http://img.shields.io/npm/dm/is-regex.svg -[downloads-url]: http://npm-stat.com/charts.html?package=is-regex - diff --git a/deps/npm/node_modules/is-regex/index.js b/deps/npm/node_modules/is-regex/index.js deleted file mode 100644 index be6513390f7d38..00000000000000 --- a/deps/npm/node_modules/is-regex/index.js +++ /dev/null @@ -1,39 +0,0 @@ -'use strict'; - -var has = require('has'); -var regexExec = RegExp.prototype.exec; -var gOPD = Object.getOwnPropertyDescriptor; - -var tryRegexExecCall = function tryRegexExec(value) { - try { - var lastIndex = value.lastIndex; - value.lastIndex = 0; - - regexExec.call(value); - return true; - } catch (e) { - return false; - } finally { - value.lastIndex = lastIndex; - } -}; -var toStr = Object.prototype.toString; -var regexClass = '[object RegExp]'; -var hasToStringTag = typeof Symbol === 'function' && typeof Symbol.toStringTag === 'symbol'; - -module.exports = function isRegex(value) { - if (!value || typeof value !== 'object') { - return false; - } - if (!hasToStringTag) { - return toStr.call(value) === regexClass; - } - - var descriptor = gOPD(value, 'lastIndex'); - var hasLastIndexDataProperty = descriptor && has(descriptor, 'value'); - if (!hasLastIndexDataProperty) { - return false; - } - - return tryRegexExecCall(value); -}; diff --git a/deps/npm/node_modules/is-regex/package.json b/deps/npm/node_modules/is-regex/package.json deleted file mode 100644 index 697123805ac3e2..00000000000000 --- a/deps/npm/node_modules/is-regex/package.json +++ /dev/null @@ -1,77 +0,0 @@ -{ - "name": "is-regex", - "version": "1.0.4", - "description": "Is this value a JS regex? Works cross-realm/iframe, and despite ES6 @@toStringTag", - "author": "Jordan Harband", - "license": "MIT", - "main": "index.js", - "scripts": { - "pretest": "npm run lint", - "test": "npm run tests-only", - "tests-only": "node --harmony --es-staging test.js", - "posttest": "npm run security", - "coverage": "covert test.js", - "coverage-quiet": "covert test.js --quiet", - "lint": "npm run jscs && npm run eslint", - "jscs": "jscs *.js", - "eslint": "eslint test.js *.js", - "eccheck": "editorconfig-tools check *.js **/*.js > /dev/null", - "security": "nsp check" - }, - "repository": { - "type": "git", - "url": "git://github.com/ljharb/is-regex.git" - }, - "bugs": { - "url": "https://github.com/ljharb/is-regex/issues" - }, - "homepage": "https://github.com/ljharb/is-regex", - "keywords": [ - "regex", - "regexp", - "is", - "regular expression", - "regular", - "expression" - ], - "dependencies": { - "has": "^1.0.1" - }, - "devDependencies": { - "tape": "^4.6.3", - "covert": "^1.1.0", - "jscs": "^3.0.7", - "editorconfig-tools": "^0.1.1", - "nsp": "^2.6.2", - "eslint": "^3.15.0", - "@ljharb/eslint-config": "^11.0.0", - "semver": "^5.3.0", - "replace": "^0.3.0" - }, - "testling": { - "files": "test.js", - "browsers": [ - "iexplore/6.0..latest", - "firefox/3.0..6.0", - "firefox/15.0..latest", - "firefox/nightly", - "chrome/4.0..10.0", - "chrome/20.0..latest", - "chrome/canary", - "opera/10.0..12.0", - "opera/15.0..latest", - "opera/next", - "safari/4.0..latest", - "ipad/6.0..latest", - "iphone/6.0..latest", - "android-browser/4.2" - ] - }, - "engines": { - "node": ">= 0.4" - } - -,"_resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.0.4.tgz" -,"_integrity": "sha1-VRdIm1RwkbCTDglWVM7SXul+lJE=" -,"_from": "is-regex@1.0.4" -} \ No newline at end of file diff --git a/deps/npm/node_modules/is-regex/test.js b/deps/npm/node_modules/is-regex/test.js deleted file mode 100644 index 8d390038dae33d..00000000000000 --- a/deps/npm/node_modules/is-regex/test.js +++ /dev/null @@ -1,58 +0,0 @@ -'use strict'; - -var test = require('tape'); -var isRegex = require('./'); -var hasToStringTag = typeof Symbol === 'function' && typeof Symbol.toStringTag === 'symbol'; - -test('not regexes', function (t) { - t.notOk(isRegex(), 'undefined is not regex'); - t.notOk(isRegex(null), 'null is not regex'); - t.notOk(isRegex(false), 'false is not regex'); - t.notOk(isRegex(true), 'true is not regex'); - t.notOk(isRegex(42), 'number is not regex'); - t.notOk(isRegex('foo'), 'string is not regex'); - t.notOk(isRegex([]), 'array is not regex'); - t.notOk(isRegex({}), 'object is not regex'); - t.notOk(isRegex(function () {}), 'function is not regex'); - t.end(); -}); - -test('@@toStringTag', { skip: !hasToStringTag }, function (t) { - var regex = /a/g; - var fakeRegex = { - toString: function () { return String(regex); }, - valueOf: function () { return regex; } - }; - fakeRegex[Symbol.toStringTag] = 'RegExp'; - t.notOk(isRegex(fakeRegex), 'fake RegExp with @@toStringTag "RegExp" is not regex'); - t.end(); -}); - -test('regexes', function (t) { - t.ok(isRegex(/a/g), 'regex literal is regex'); - t.ok(isRegex(new RegExp('a', 'g')), 'regex object is regex'); - t.end(); -}); - -test('does not mutate regexes', function (t) { - t.test('lastIndex is a marker object', function (st) { - var regex = /a/; - var marker = {}; - regex.lastIndex = marker; - st.equal(regex.lastIndex, marker, 'lastIndex is the marker object'); - st.ok(isRegex(regex), 'is regex'); - st.equal(regex.lastIndex, marker, 'lastIndex is the marker object after isRegex'); - st.end(); - }); - - t.test('lastIndex is nonzero', function (st) { - var regex = /a/; - regex.lastIndex = 3; - st.equal(regex.lastIndex, 3, 'lastIndex is 3'); - st.ok(isRegex(regex), 'is regex'); - st.equal(regex.lastIndex, 3, 'lastIndex is 3 after isRegex'); - st.end(); - }); - - t.end(); -}); diff --git a/deps/npm/node_modules/is-retry-allowed/index.js b/deps/npm/node_modules/is-retry-allowed/index.js deleted file mode 100644 index 3bab6c16b26b9b..00000000000000 --- a/deps/npm/node_modules/is-retry-allowed/index.js +++ /dev/null @@ -1,62 +0,0 @@ -'use strict'; - -var WHITELIST = [ - 'ETIMEDOUT', - 'ECONNRESET', - 'EADDRINUSE', - 'ESOCKETTIMEDOUT', - 'ECONNREFUSED', - 'EPIPE', - 'EHOSTUNREACH', - 'EAI_AGAIN' -]; - -var BLACKLIST = [ - 'ENOTFOUND', - 'ENETUNREACH', - - // SSL errors from https://github.com/nodejs/node/blob/ed3d8b13ee9a705d89f9e0397d9e96519e7e47ac/src/node_crypto.cc#L1950 - 'UNABLE_TO_GET_ISSUER_CERT', - 'UNABLE_TO_GET_CRL', - 'UNABLE_TO_DECRYPT_CERT_SIGNATURE', - 'UNABLE_TO_DECRYPT_CRL_SIGNATURE', - 'UNABLE_TO_DECODE_ISSUER_PUBLIC_KEY', - 'CERT_SIGNATURE_FAILURE', - 'CRL_SIGNATURE_FAILURE', - 'CERT_NOT_YET_VALID', - 'CERT_HAS_EXPIRED', - 'CRL_NOT_YET_VALID', - 'CRL_HAS_EXPIRED', - 'ERROR_IN_CERT_NOT_BEFORE_FIELD', - 'ERROR_IN_CERT_NOT_AFTER_FIELD', - 'ERROR_IN_CRL_LAST_UPDATE_FIELD', - 'ERROR_IN_CRL_NEXT_UPDATE_FIELD', - 'OUT_OF_MEM', - 'DEPTH_ZERO_SELF_SIGNED_CERT', - 'SELF_SIGNED_CERT_IN_CHAIN', - 'UNABLE_TO_GET_ISSUER_CERT_LOCALLY', - 'UNABLE_TO_VERIFY_LEAF_SIGNATURE', - 'CERT_CHAIN_TOO_LONG', - 'CERT_REVOKED', - 'INVALID_CA', - 'PATH_LENGTH_EXCEEDED', - 'INVALID_PURPOSE', - 'CERT_UNTRUSTED', - 'CERT_REJECTED' -]; - -module.exports = function (err) { - if (!err || !err.code) { - return true; - } - - if (WHITELIST.indexOf(err.code) !== -1) { - return true; - } - - if (BLACKLIST.indexOf(err.code) !== -1) { - return false; - } - - return true; -}; diff --git a/deps/npm/node_modules/is-retry-allowed/license b/deps/npm/node_modules/is-retry-allowed/license deleted file mode 100644 index 1aeb74fd25e171..00000000000000 --- a/deps/npm/node_modules/is-retry-allowed/license +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) Vsevolod Strukchinsky (github.com/floatdrop) - -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/is-retry-allowed/package.json b/deps/npm/node_modules/is-retry-allowed/package.json deleted file mode 100644 index 7bae1606a740c7..00000000000000 --- a/deps/npm/node_modules/is-retry-allowed/package.json +++ /dev/null @@ -1,59 +0,0 @@ -{ - "_from": "is-retry-allowed@^1.0.0", - "_id": "is-retry-allowed@1.2.0", - "_inBundle": false, - "_integrity": "sha512-RUbUeKwvm3XG2VYamhJL1xFktgjvPzL0Hq8C+6yrWIswDy3BIXGqCxhxkc30N9jqK311gVU137K8Ei55/zVJRg==", - "_location": "/is-retry-allowed", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "is-retry-allowed@^1.0.0", - "name": "is-retry-allowed", - "escapedName": "is-retry-allowed", - "rawSpec": "^1.0.0", - "saveSpec": null, - "fetchSpec": "^1.0.0" - }, - "_requiredBy": [ - "/got" - ], - "_resolved": "https://registry.npmjs.org/is-retry-allowed/-/is-retry-allowed-1.2.0.tgz", - "_shasum": "d778488bd0a4666a3be8a1482b9f2baafedea8b4", - "_spec": "is-retry-allowed@^1.0.0", - "_where": "/Users/ruyadorno/Documents/workspace/cli/node_modules/got", - "author": { - "name": "Vsevolod Strukchinsky", - "email": "floatdrop@gmail.com", - "url": "github.com/floatdrop" - }, - "bugs": { - "url": "https://github.com/floatdrop/is-retry-allowed/issues" - }, - "bundleDependencies": false, - "dependencies": {}, - "deprecated": false, - "description": "Is retry allowed for Error?", - "devDependencies": { - "ava": "^0.8.0", - "xo": "^0.12.1" - }, - "engines": { - "node": ">=0.10.0" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/floatdrop/is-retry-allowed#readme", - "keywords": [], - "license": "MIT", - "name": "is-retry-allowed", - "repository": { - "type": "git", - "url": "git+https://github.com/floatdrop/is-retry-allowed.git" - }, - "scripts": { - "test": "xo && ava" - }, - "version": "1.2.0" -} diff --git a/deps/npm/node_modules/is-retry-allowed/readme.md b/deps/npm/node_modules/is-retry-allowed/readme.md deleted file mode 100644 index 4212d099b59564..00000000000000 --- a/deps/npm/node_modules/is-retry-allowed/readme.md +++ /dev/null @@ -1,42 +0,0 @@ -# is-retry-allowed [![Build Status](https://travis-ci.org/floatdrop/is-retry-allowed.svg?branch=master)](https://travis-ci.org/floatdrop/is-retry-allowed) - -Is retry allowed for Error? - - -## Install - -``` -$ npm install --save is-retry-allowed -``` - - -## Usage - -```js -const isRetryAllowed = require('is-retry-allowed'); - -isRetryAllowed({code: 'ETIMEDOUT'}); -//=> true - -isRetryAllowed({code: 'ENOTFOUND'}); -//=> false - -isRetryAllowed({}); -//=> true -``` - - -## API - -### isRetryAllowed(error) - -#### error - -Type: `object` - -Object with `code` property, which will be used to determine retry. - - -## License - -MIT © [Vsevolod Strukchinsky](http://github.com/floatdrop) diff --git a/deps/npm/node_modules/is-stream/index.js b/deps/npm/node_modules/is-stream/index.js deleted file mode 100644 index 6f7ec91a4014bb..00000000000000 --- a/deps/npm/node_modules/is-stream/index.js +++ /dev/null @@ -1,21 +0,0 @@ -'use strict'; - -var isStream = module.exports = function (stream) { - return stream !== null && typeof stream === 'object' && typeof stream.pipe === 'function'; -}; - -isStream.writable = function (stream) { - return isStream(stream) && stream.writable !== false && typeof stream._write === 'function' && typeof stream._writableState === 'object'; -}; - -isStream.readable = function (stream) { - return isStream(stream) && stream.readable !== false && typeof stream._read === 'function' && typeof stream._readableState === 'object'; -}; - -isStream.duplex = function (stream) { - return isStream.writable(stream) && isStream.readable(stream); -}; - -isStream.transform = function (stream) { - return isStream.duplex(stream) && typeof stream._transform === 'function' && typeof stream._transformState === 'object'; -}; diff --git a/deps/npm/node_modules/is-stream/license b/deps/npm/node_modules/is-stream/license deleted file mode 100644 index 654d0bfe943437..00000000000000 --- a/deps/npm/node_modules/is-stream/license +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -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/deps/npm/node_modules/is-stream/package.json b/deps/npm/node_modules/is-stream/package.json deleted file mode 100644 index b97097f0deb02e..00000000000000 --- a/deps/npm/node_modules/is-stream/package.json +++ /dev/null @@ -1,72 +0,0 @@ -{ - "_from": "is-stream@^1.1.0", - "_id": "is-stream@1.1.0", - "_inBundle": false, - "_integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=", - "_location": "/is-stream", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "is-stream@^1.1.0", - "name": "is-stream", - "escapedName": "is-stream", - "rawSpec": "^1.1.0", - "saveSpec": null, - "fetchSpec": "^1.1.0" - }, - "_requiredBy": [ - "/execa", - "/got", - "/node-fetch" - ], - "_resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", - "_shasum": "12d4a3dd4e68e0b79ceb8dbc84173ae80d91ca44", - "_spec": "is-stream@^1.1.0", - "_where": "/Users/rebecca/code/npm/node_modules/execa", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "bugs": { - "url": "https://github.com/sindresorhus/is-stream/issues" - }, - "bundleDependencies": false, - "deprecated": false, - "description": "Check if something is a Node.js stream", - "devDependencies": { - "ava": "*", - "tempfile": "^1.1.0", - "xo": "*" - }, - "engines": { - "node": ">=0.10.0" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/sindresorhus/is-stream#readme", - "keywords": [ - "stream", - "type", - "streams", - "writable", - "readable", - "duplex", - "transform", - "check", - "detect", - "is" - ], - "license": "MIT", - "name": "is-stream", - "repository": { - "type": "git", - "url": "git+https://github.com/sindresorhus/is-stream.git" - }, - "scripts": { - "test": "xo && ava" - }, - "version": "1.1.0" -} diff --git a/deps/npm/node_modules/is-stream/readme.md b/deps/npm/node_modules/is-stream/readme.md deleted file mode 100644 index d8afce81d216eb..00000000000000 --- a/deps/npm/node_modules/is-stream/readme.md +++ /dev/null @@ -1,42 +0,0 @@ -# is-stream [![Build Status](https://travis-ci.org/sindresorhus/is-stream.svg?branch=master)](https://travis-ci.org/sindresorhus/is-stream) - -> Check if something is a [Node.js stream](https://nodejs.org/api/stream.html) - - -## Install - -``` -$ npm install --save is-stream -``` - - -## Usage - -```js -const fs = require('fs'); -const isStream = require('is-stream'); - -isStream(fs.createReadStream('unicorn.png')); -//=> true - -isStream({}); -//=> false -``` - - -## API - -### isStream(stream) - -#### isStream.writable(stream) - -#### isStream.readable(stream) - -#### isStream.duplex(stream) - -#### isStream.transform(stream) - - -## License - -MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/deps/npm/node_modules/is-symbol/.editorconfig b/deps/npm/node_modules/is-symbol/.editorconfig deleted file mode 100644 index eaa214161f5cdb..00000000000000 --- a/deps/npm/node_modules/is-symbol/.editorconfig +++ /dev/null @@ -1,13 +0,0 @@ -root = true - -[*] -indent_style = tab; -insert_final_newline = true; -quote_type = auto; -space_after_anonymous_functions = true; -space_after_control_statements = true; -spaces_around_operators = true; -trim_trailing_whitespace = true; -spaces_in_brackets = false; -end_of_line = lf; - diff --git a/deps/npm/node_modules/is-symbol/.jscs.json b/deps/npm/node_modules/is-symbol/.jscs.json deleted file mode 100644 index b4d9b8b40aebf6..00000000000000 --- a/deps/npm/node_modules/is-symbol/.jscs.json +++ /dev/null @@ -1,176 +0,0 @@ -{ - "es3": true, - - "additionalRules": [], - - "requireSemicolons": true, - - "disallowMultipleSpaces": true, - - "disallowIdentifierNames": [], - - "requireCurlyBraces": { - "allExcept": [], - "keywords": ["if", "else", "for", "while", "do", "try", "catch"] - }, - - "requireSpaceAfterKeywords": ["if", "else", "for", "while", "do", "switch", "return", "try", "catch", "function"], - - "disallowSpaceAfterKeywords": [], - - "disallowSpaceBeforeComma": true, - "disallowSpaceAfterComma": false, - "disallowSpaceBeforeSemicolon": true, - - "disallowNodeTypes": [ - "DebuggerStatement", - "ForInStatement", - "LabeledStatement", - "SwitchCase", - "SwitchStatement", - "WithStatement" - ], - - "requireObjectKeysOnNewLine": { "allExcept": ["sameLine"] }, - - "requireSpacesInAnonymousFunctionExpression": { "beforeOpeningRoundBrace": true, "beforeOpeningCurlyBrace": true }, - "requireSpacesInNamedFunctionExpression": { "beforeOpeningCurlyBrace": true }, - "disallowSpacesInNamedFunctionExpression": { "beforeOpeningRoundBrace": true }, - "requireSpacesInFunctionDeclaration": { "beforeOpeningCurlyBrace": true }, - "disallowSpacesInFunctionDeclaration": { "beforeOpeningRoundBrace": true }, - - "requireSpaceBetweenArguments": true, - - "disallowSpacesInsideParentheses": true, - - "disallowSpacesInsideArrayBrackets": true, - - "disallowQuotedKeysInObjects": { "allExcept": ["reserved"] }, - - "disallowSpaceAfterObjectKeys": true, - - "requireCommaBeforeLineBreak": true, - - "disallowSpaceAfterPrefixUnaryOperators": ["++", "--", "+", "-", "~", "!"], - "requireSpaceAfterPrefixUnaryOperators": [], - - "disallowSpaceBeforePostfixUnaryOperators": ["++", "--"], - "requireSpaceBeforePostfixUnaryOperators": [], - - "disallowSpaceBeforeBinaryOperators": [], - "requireSpaceBeforeBinaryOperators": ["+", "-", "/", "*", "=", "==", "===", "!=", "!=="], - - "requireSpaceAfterBinaryOperators": ["+", "-", "/", "*", "=", "==", "===", "!=", "!=="], - "disallowSpaceAfterBinaryOperators": [], - - "disallowImplicitTypeConversion": ["binary", "string"], - - "disallowKeywords": ["with", "eval"], - - "requireKeywordsOnNewLine": [], - "disallowKeywordsOnNewLine": ["else"], - - "requireLineFeedAtFileEnd": true, - - "disallowTrailingWhitespace": true, - - "disallowTrailingComma": true, - - "excludeFiles": ["node_modules/**", "vendor/**"], - - "disallowMultipleLineStrings": true, - - "requireDotNotation": { "allExcept": ["keywords"] }, - - "requireParenthesesAroundIIFE": true, - - "validateLineBreaks": "LF", - - "validateQuoteMarks": { - "escape": true, - "mark": "'" - }, - - "disallowOperatorBeforeLineBreak": [], - - "requireSpaceBeforeKeywords": [ - "do", - "for", - "if", - "else", - "switch", - "case", - "try", - "catch", - "finally", - "while", - "with", - "return" - ], - - "validateAlignedFunctionParameters": { - "lineBreakAfterOpeningBraces": true, - "lineBreakBeforeClosingBraces": true - }, - - "requirePaddingNewLinesBeforeExport": true, - - "validateNewlineAfterArrayElements": { - "maximum": 1 - }, - - "requirePaddingNewLinesAfterUseStrict": true, - - "disallowArrowFunctions": true, - - "disallowMultiLineTernary": true, - - "validateOrderInObjectKeys": "asc-insensitive", - - "disallowIdenticalDestructuringNames": true, - - "disallowNestedTernaries": { "maxLevel": 1 }, - - "requireSpaceAfterComma": { "allExcept": ["trailing"] }, - "requireAlignedMultilineParams": false, - - "requireSpacesInGenerator": { - "afterStar": true - }, - - "disallowSpacesInGenerator": { - "beforeStar": true - }, - - "disallowVar": false, - - "requireArrayDestructuring": false, - - "requireEnhancedObjectLiterals": false, - - "requireObjectDestructuring": false, - - "requireEarlyReturn": false, - - "requireCapitalizedConstructorsNew": { - "allExcept": ["Function", "String", "Object", "Symbol", "Number", "Date", "RegExp", "Error", "Boolean", "Array"] - }, - - "requireImportAlphabetized": false, - - "requireSpaceBeforeObjectValues": true, - "requireSpaceBeforeDestructuredValues": true, - - "disallowSpacesInsideTemplateStringPlaceholders": true, - - "disallowArrayDestructuringReturn": false, - - "requireNewlineBeforeSingleStatementsInIf": false, - - "disallowUnusedVariables": true, - - "requireSpacesInsideImportedObjectBraces": true, - - "requireUseStrict": true -} - diff --git a/deps/npm/node_modules/is-symbol/.nvmrc b/deps/npm/node_modules/is-symbol/.nvmrc deleted file mode 100644 index 64f5a0a6813a4f..00000000000000 --- a/deps/npm/node_modules/is-symbol/.nvmrc +++ /dev/null @@ -1 +0,0 @@ -node diff --git a/deps/npm/node_modules/is-symbol/.travis.yml b/deps/npm/node_modules/is-symbol/.travis.yml deleted file mode 100644 index c671d5ea89c498..00000000000000 --- a/deps/npm/node_modules/is-symbol/.travis.yml +++ /dev/null @@ -1,241 +0,0 @@ -language: node_js -os: - - linux -node_js: - - "10.11" - - "9.11" - - "8.12" - - "7.10" - - "6.14" - - "5.12" - - "4.9" - - "iojs-v3.3" - - "iojs-v2.5" - - "iojs-v1.8" - - "0.12" - - "0.10" - - "0.8" -before_install: - - 'case "${TRAVIS_NODE_VERSION}" in 0.*) export NPM_CONFIG_STRICT_SSL=false ;; esac' - - 'nvm install-latest-npm' -install: - - 'if [ "${TRAVIS_NODE_VERSION}" = "0.6" ] || [ "${TRAVIS_NODE_VERSION}" = "0.9" ]; then nvm install --latest-npm 0.8 && npm install && nvm use "${TRAVIS_NODE_VERSION}"; else npm install; fi;' -script: - - 'if [ -n "${PRETEST-}" ]; then npm run pretest ; fi' - - 'if [ -n "${POSTTEST-}" ]; then npm run posttest ; fi' - - 'if [ -n "${COVERAGE-}" ]; then npm run coverage ; fi' - - 'if [ -n "${TEST-}" ]; then npm run tests-only ; fi' -sudo: false -env: - - TEST=true -matrix: - fast_finish: true - include: - - node_js: "lts/*" - env: PRETEST=true - - node_js: "lts/*" - env: POSTTEST=true - - node_js: "4" - env: COVERAGE=true - - node_js: "10.10" - env: TEST=true ALLOW_FAILURE=true - - node_js: "10.9" - env: TEST=true ALLOW_FAILURE=true - - node_js: "10.8" - env: TEST=true ALLOW_FAILURE=true - - node_js: "10.7" - env: TEST=true ALLOW_FAILURE=true - - node_js: "10.6" - env: TEST=true ALLOW_FAILURE=true - - node_js: "10.5" - env: TEST=true ALLOW_FAILURE=true - - node_js: "10.4" - env: TEST=true ALLOW_FAILURE=true - - node_js: "10.3" - env: TEST=true ALLOW_FAILURE=true - - node_js: "10.2" - env: TEST=true ALLOW_FAILURE=true - - node_js: "10.1" - env: TEST=true ALLOW_FAILURE=true - - node_js: "10.0" - env: TEST=true ALLOW_FAILURE=true - - node_js: "9.10" - env: TEST=true ALLOW_FAILURE=true - - node_js: "9.9" - env: TEST=true ALLOW_FAILURE=true - - node_js: "9.8" - env: TEST=true ALLOW_FAILURE=true - - node_js: "9.7" - env: TEST=true ALLOW_FAILURE=true - - node_js: "9.6" - env: TEST=true ALLOW_FAILURE=true - - node_js: "9.5" - env: TEST=true ALLOW_FAILURE=true - - node_js: "9.4" - env: TEST=true ALLOW_FAILURE=true - - node_js: "9.3" - env: TEST=true ALLOW_FAILURE=true - - node_js: "9.2" - env: TEST=true ALLOW_FAILURE=true - - node_js: "9.1" - env: TEST=true ALLOW_FAILURE=true - - node_js: "9.0" - env: TEST=true ALLOW_FAILURE=true - - node_js: "8.11" - env: TEST=true ALLOW_FAILURE=true - - node_js: "8.10" - env: TEST=true ALLOW_FAILURE=true - - node_js: "8.9" - env: TEST=true ALLOW_FAILURE=true - - node_js: "8.8" - env: TEST=true ALLOW_FAILURE=true - - node_js: "8.7" - env: TEST=true ALLOW_FAILURE=true - - node_js: "8.6" - env: TEST=true ALLOW_FAILURE=true - - node_js: "8.5" - env: TEST=true ALLOW_FAILURE=true - - node_js: "8.4" - env: TEST=true ALLOW_FAILURE=true - - node_js: "8.3" - env: TEST=true ALLOW_FAILURE=true - - node_js: "8.2" - env: TEST=true ALLOW_FAILURE=true - - node_js: "8.1" - env: TEST=true ALLOW_FAILURE=true - - node_js: "8.0" - env: TEST=true ALLOW_FAILURE=true - - node_js: "7.9" - env: TEST=true ALLOW_FAILURE=true - - node_js: "7.8" - env: TEST=true ALLOW_FAILURE=true - - node_js: "7.7" - env: TEST=true ALLOW_FAILURE=true - - node_js: "7.6" - env: TEST=true ALLOW_FAILURE=true - - node_js: "7.5" - env: TEST=true ALLOW_FAILURE=true - - node_js: "7.4" - env: TEST=true ALLOW_FAILURE=true - - node_js: "7.3" - env: TEST=true ALLOW_FAILURE=true - - node_js: "7.2" - env: TEST=true ALLOW_FAILURE=true - - node_js: "7.1" - env: TEST=true ALLOW_FAILURE=true - - node_js: "7.0" - env: TEST=true ALLOW_FAILURE=true - - node_js: "6.13" - env: TEST=true ALLOW_FAILURE=true - - node_js: "6.12" - env: TEST=true ALLOW_FAILURE=true - - node_js: "6.11" - env: TEST=true ALLOW_FAILURE=true - - node_js: "6.10" - env: TEST=true ALLOW_FAILURE=true - - node_js: "6.9" - env: TEST=true ALLOW_FAILURE=true - - node_js: "6.8" - env: TEST=true ALLOW_FAILURE=true - - node_js: "6.7" - env: TEST=true ALLOW_FAILURE=true - - node_js: "6.6" - env: TEST=true ALLOW_FAILURE=true - - node_js: "6.5" - env: TEST=true ALLOW_FAILURE=true - - node_js: "6.4" - env: TEST=true ALLOW_FAILURE=true - - node_js: "6.3" - env: TEST=true ALLOW_FAILURE=true - - node_js: "6.2" - env: TEST=true ALLOW_FAILURE=true - - node_js: "6.1" - env: TEST=true ALLOW_FAILURE=true - - node_js: "6.0" - env: TEST=true ALLOW_FAILURE=true - - node_js: "5.11" - env: TEST=true ALLOW_FAILURE=true - - node_js: "5.10" - env: TEST=true ALLOW_FAILURE=true - - node_js: "5.9" - env: TEST=true ALLOW_FAILURE=true - - node_js: "5.8" - env: TEST=true ALLOW_FAILURE=true - - node_js: "5.7" - env: TEST=true ALLOW_FAILURE=true - - node_js: "5.6" - env: TEST=true ALLOW_FAILURE=true - - node_js: "5.5" - env: TEST=true ALLOW_FAILURE=true - - node_js: "5.4" - env: TEST=true ALLOW_FAILURE=true - - node_js: "5.3" - env: TEST=true ALLOW_FAILURE=true - - node_js: "5.2" - env: TEST=true ALLOW_FAILURE=true - - node_js: "5.1" - env: TEST=true ALLOW_FAILURE=true - - node_js: "5.0" - env: TEST=true ALLOW_FAILURE=true - - node_js: "4.8" - env: TEST=true ALLOW_FAILURE=true - - node_js: "4.7" - env: TEST=true ALLOW_FAILURE=true - - node_js: "4.6" - env: TEST=true ALLOW_FAILURE=true - - node_js: "4.5" - env: TEST=true ALLOW_FAILURE=true - - node_js: "4.4" - env: TEST=true ALLOW_FAILURE=true - - node_js: "4.3" - env: TEST=true ALLOW_FAILURE=true - - node_js: "4.2" - env: TEST=true ALLOW_FAILURE=true - - node_js: "4.1" - env: TEST=true ALLOW_FAILURE=true - - node_js: "4.0" - env: TEST=true ALLOW_FAILURE=true - - node_js: "iojs-v3.2" - env: TEST=true ALLOW_FAILURE=true - - node_js: "iojs-v3.1" - env: TEST=true ALLOW_FAILURE=true - - node_js: "iojs-v3.0" - env: TEST=true ALLOW_FAILURE=true - - node_js: "iojs-v2.4" - env: TEST=true ALLOW_FAILURE=true - - node_js: "iojs-v2.3" - env: TEST=true ALLOW_FAILURE=true - - node_js: "iojs-v2.2" - env: TEST=true ALLOW_FAILURE=true - - node_js: "iojs-v2.1" - env: TEST=true ALLOW_FAILURE=true - - node_js: "iojs-v2.0" - env: TEST=true ALLOW_FAILURE=true - - node_js: "iojs-v1.7" - env: TEST=true ALLOW_FAILURE=true - - node_js: "iojs-v1.6" - env: TEST=true ALLOW_FAILURE=true - - node_js: "iojs-v1.5" - env: TEST=true ALLOW_FAILURE=true - - node_js: "iojs-v1.4" - env: TEST=true ALLOW_FAILURE=true - - node_js: "iojs-v1.3" - env: TEST=true ALLOW_FAILURE=true - - node_js: "iojs-v1.2" - env: TEST=true ALLOW_FAILURE=true - - node_js: "iojs-v1.1" - env: TEST=true ALLOW_FAILURE=true - - node_js: "iojs-v1.0" - env: TEST=true ALLOW_FAILURE=true - - node_js: "0.11" - env: TEST=true ALLOW_FAILURE=true - - node_js: "0.9" - env: TEST=true ALLOW_FAILURE=true - - node_js: "0.6" - env: TEST=true ALLOW_FAILURE=true - - node_js: "0.4" - env: TEST=true ALLOW_FAILURE=true - allow_failures: - - os: osx - - env: TEST=true ALLOW_FAILURE=true - - env: COVERAGE=true diff --git a/deps/npm/node_modules/is-symbol/CHANGELOG.md b/deps/npm/node_modules/is-symbol/CHANGELOG.md deleted file mode 100644 index a7b8baf8db733f..00000000000000 --- a/deps/npm/node_modules/is-symbol/CHANGELOG.md +++ /dev/null @@ -1,12 +0,0 @@ -1.0.2 / 2018-09-20 -================= - * [Refactor] use `has-symbols` and `object-inspect` - * [Tests] test on all the node minor versions - -1.0.1 / 2015-01-26 -================= - * Corrected description - -1.0.0 / 2015-01-24 -================= - * Initial release diff --git a/deps/npm/node_modules/is-symbol/LICENSE b/deps/npm/node_modules/is-symbol/LICENSE deleted file mode 100644 index b43df444e51828..00000000000000 --- a/deps/npm/node_modules/is-symbol/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2015 Jordan Harband - -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/is-symbol/Makefile b/deps/npm/node_modules/is-symbol/Makefile deleted file mode 100644 index b9e4fe1aab3dde..00000000000000 --- a/deps/npm/node_modules/is-symbol/Makefile +++ /dev/null @@ -1,61 +0,0 @@ -# Since we rely on paths relative to the makefile location, abort if make isn't being run from there. -$(if $(findstring /,$(MAKEFILE_LIST)),$(error Please only invoke this makefile from the directory it resides in)) - - # The files that need updating when incrementing the version number. -VERSIONED_FILES := *.js *.json README* - - -# Add the local npm packages' bin folder to the PATH, so that `make` can find them, when invoked directly. -# Note that rather than using `$(npm bin)` the 'node_modules/.bin' path component is hard-coded, so that invocation works even from an environment -# where npm is (temporarily) unavailable due to having deactivated an nvm instance loaded into the calling shell in order to avoid interference with tests. -export PATH := $(shell printf '%s' "$$PWD/node_modules/.bin:$$PATH") -UTILS := semver -# Make sure that all required utilities can be located. -UTIL_CHECK := $(or $(shell PATH="$(PATH)" which $(UTILS) >/dev/null && echo 'ok'),$(error Did you forget to run `npm install` after cloning the repo? At least one of the required supporting utilities not found: $(UTILS))) - -# Default target (by virtue of being the first non '.'-prefixed in the file). -.PHONY: _no-target-specified -_no-target-specified: - $(error Please specify the target to make - `make list` shows targets. Alternatively, use `npm test` to run the default tests; `npm run` shows all tests) - -# Lists all targets defined in this makefile. -.PHONY: list -list: - @$(MAKE) -pRrn : -f $(MAKEFILE_LIST) 2>/dev/null | awk -v RS= -F: '/^# File/,/^# Finished Make data base/ {if ($$1 !~ "^[#.]") {print $$1}}' | command grep -v -e '^[^[:alnum:]]' -e '^$@$$command ' | sort - -# All-tests target: invokes the specified test suites for ALL shells defined in $(SHELLS). -.PHONY: test -test: - @npm test - -.PHONY: _ensure-tag -_ensure-tag: -ifndef TAG - $(error Please invoke with `make TAG= release`, where is either an increment specifier (patch, minor, major, prepatch, preminor, premajor, prerelease), or an explicit major.minor.patch version number) -endif - -CHANGELOG_ERROR = $(error No CHANGELOG specified) -.PHONY: _ensure-changelog -_ensure-changelog: - @ (git status -sb --porcelain | command grep -E '^( M|[MA] ) CHANGELOG.md' > /dev/null) || (echo no CHANGELOG.md specified && exit 2) - -# Ensures that the git workspace is clean. -.PHONY: _ensure-clean -_ensure-clean: - @[ -z "$$((git status --porcelain --untracked-files=no || echo err) | command grep -v 'CHANGELOG.md')" ] || { echo "Workspace is not clean; please commit changes first." >&2; exit 2; } - -# Makes a release; invoke with `make TAG= release`. -.PHONY: release -release: _ensure-tag _ensure-changelog _ensure-clean - @old_ver=`git describe --abbrev=0 --tags --match 'v[0-9]*.[0-9]*.[0-9]*'` || { echo "Failed to determine current version." >&2; exit 1; }; old_ver=$${old_ver#v}; \ - new_ver=`echo "$(TAG)" | sed 's/^v//'`; new_ver=$${new_ver:-patch}; \ - if printf "$$new_ver" | command grep -q '^[0-9]'; then \ - semver "$$new_ver" >/dev/null || { echo 'Invalid version number specified: $(TAG) - must be major.minor.patch' >&2; exit 2; }; \ - semver -r "> $$old_ver" "$$new_ver" >/dev/null || { echo 'Invalid version number specified: $(TAG) - must be HIGHER than current one.' >&2; exit 2; } \ - else \ - new_ver=`semver -i "$$new_ver" "$$old_ver"` || { echo 'Invalid version-increment specifier: $(TAG)' >&2; exit 2; } \ - fi; \ - printf "=== Bumping version **$$old_ver** to **$$new_ver** before committing and tagging:\n=== TYPE 'proceed' TO PROCEED, anything else to abort: " && read response && [ "$$response" = 'proceed' ] || { echo 'Aborted.' >&2; exit 2; }; \ - replace "$$old_ver" "$$new_ver" -- $(VERSIONED_FILES) && \ - git commit -m "v$$new_ver" $(VERSIONED_FILES) CHANGELOG.md && \ - git tag -a -m "v$$new_ver" "v$$new_ver" diff --git a/deps/npm/node_modules/is-symbol/README.md b/deps/npm/node_modules/is-symbol/README.md deleted file mode 100644 index 8544c8c0937c1a..00000000000000 --- a/deps/npm/node_modules/is-symbol/README.md +++ /dev/null @@ -1,46 +0,0 @@ -#is-symbol [![Version Badge][2]][1] - -[![Build Status][3]][4] -[![dependency status][5]][6] -[![dev dependency status][7]][8] -[![License][license-image]][license-url] -[![Downloads][downloads-image]][downloads-url] - -[![npm badge][11]][1] - -[![browser support][9]][10] - -Is this an ES6 Symbol value? - -## Example - -```js -var isSymbol = require('is-symbol'); -assert(!isSymbol(function () {})); -assert(!isSymbol(null)); -assert(!isSymbol(function* () { yield 42; return Infinity; }); - -assert(isSymbol(Symbol.iterator)); -assert(isSymbol(Symbol('foo'))); -assert(isSymbol(Symbol.for('foo'))); -assert(isSymbol(Object(Symbol('foo')))); -``` - -## Tests -Simply clone the repo, `npm install`, and run `npm test` - -[1]: https://npmjs.org/package/is-symbol -[2]: http://versionbadg.es/ljharb/is-symbol.svg -[3]: https://travis-ci.org/ljharb/is-symbol.svg -[4]: https://travis-ci.org/ljharb/is-symbol -[5]: https://david-dm.org/ljharb/is-symbol.svg -[6]: https://david-dm.org/ljharb/is-symbol -[7]: https://david-dm.org/ljharb/is-symbol/dev-status.svg -[8]: https://david-dm.org/ljharb/is-symbol#info=devDependencies -[9]: https://ci.testling.com/ljharb/is-symbol.png -[10]: https://ci.testling.com/ljharb/is-symbol -[11]: https://nodei.co/npm/is-symbol.png?downloads=true&stars=true -[license-image]: http://img.shields.io/npm/l/is-symbol.svg -[license-url]: LICENSE -[downloads-image]: http://img.shields.io/npm/dm/is-symbol.svg -[downloads-url]: http://npm-stat.com/charts.html?package=is-symbol diff --git a/deps/npm/node_modules/is-symbol/index.js b/deps/npm/node_modules/is-symbol/index.js deleted file mode 100644 index 3d653e27f5fc63..00000000000000 --- a/deps/npm/node_modules/is-symbol/index.js +++ /dev/null @@ -1,35 +0,0 @@ -'use strict'; - -var toStr = Object.prototype.toString; -var hasSymbols = require('has-symbols')(); - -if (hasSymbols) { - var symToStr = Symbol.prototype.toString; - var symStringRegex = /^Symbol\(.*\)$/; - var isSymbolObject = function isRealSymbolObject(value) { - if (typeof value.valueOf() !== 'symbol') { - return false; - } - return symStringRegex.test(symToStr.call(value)); - }; - - module.exports = function isSymbol(value) { - if (typeof value === 'symbol') { - return true; - } - if (toStr.call(value) !== '[object Symbol]') { - return false; - } - try { - return isSymbolObject(value); - } catch (e) { - return false; - } - }; -} else { - - module.exports = function isSymbol(value) { - // this environment does not support Symbols. - return false && value; - }; -} diff --git a/deps/npm/node_modules/is-symbol/package.json b/deps/npm/node_modules/is-symbol/package.json deleted file mode 100644 index 5e124e2194a73d..00000000000000 --- a/deps/npm/node_modules/is-symbol/package.json +++ /dev/null @@ -1,72 +0,0 @@ -{ - "name": "is-symbol", - "version": "1.0.2", - "description": "Determine if a value is an ES6 Symbol or not.", - "main": "index.js", - "scripts": { - "prepublish": "safe-publish-latest", - "pretest": "npm run lint", - "tests-only": "node --es-staging --harmony test", - "test": "npm run tests-only", - "posttest": "npm run security", - "coverage": "covert test", - "lint": "npm run jscs && npm run eslint", - "jscs": "jscs *.js */*.js", - "eslint": "eslint *.js */*.js", - "security": "nsp check" - }, - "repository": { - "type": "git", - "url": "git://github.com/ljharb/is-symbol.git" - }, - "keywords": [ - "symbol", - "es6", - "is", - "Symbol" - ], - "author": "Jordan Harband", - "license": "MIT", - "bugs": { - "url": "https://github.com/ljharb/is-symbol/issues" - }, - "dependencies": { - "has-symbols": "^1.0.0" - }, - "devDependencies": { - "@ljharb/eslint-config": "^12.2.1", - "covert": "^1.1.0", - "eslint": "^4.19.1", - "jscs": "^3.0.7", - "nsp": "^3.2.1", - "object-inspect": "^1.6.0", - "safe-publish-latest": "^1.1.2", - "semver": "^5.5.0", - "tape": "^4.9.0" - }, - "testling": { - "files": "test/index.js", - "browsers": [ - "iexplore/6.0..latest", - "firefox/3.0..6.0", - "firefox/15.0..latest", - "firefox/nightly", - "chrome/4.0..10.0", - "chrome/20.0..latest", - "chrome/canary", - "opera/10.0..latest", - "opera/next", - "safari/4.0..latest", - "ipad/6.0..latest", - "iphone/6.0..latest", - "android-browser/4.2" - ] - }, - "engines": { - "node": ">= 0.4" - } - -,"_resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.2.tgz" -,"_integrity": "sha512-HS8bZ9ox60yCJLH9snBpIwv9pYUAkcuLhSA1oero1UB5y9aiQpRA8y2ex945AOtCZL1lJDeIk3G5LthswI46Lw==" -,"_from": "is-symbol@1.0.2" -} \ No newline at end of file diff --git a/deps/npm/node_modules/is-symbol/test/index.js b/deps/npm/node_modules/is-symbol/test/index.js deleted file mode 100644 index e01f035c8ca3ab..00000000000000 --- a/deps/npm/node_modules/is-symbol/test/index.js +++ /dev/null @@ -1,92 +0,0 @@ -'use strict'; - -var test = require('tape'); -var isSymbol = require('../index'); - -var forEach = function (arr, func) { - var i; - for (i = 0; i < arr.length; ++i) { - func(arr[i], i, arr); - } -}; - -var hasSymbols = require('has-symbols')(); -var inspect = require('object-inspect'); -var debug = function (v, m) { return inspect(v) + ' ' + m; }; - -test('non-symbol values', function (t) { - var nonSymbols = [ - true, - false, - Object(true), - Object(false), - null, - undefined, - {}, - [], - /a/g, - 'string', - 42, - new Date(), - function () {}, - NaN - ]; - t.plan(nonSymbols.length); - forEach(nonSymbols, function (nonSymbol) { - t.equal(false, isSymbol(nonSymbol), debug(nonSymbol, 'is not a symbol')); - }); - t.end(); -}); - -test('faked symbol values', function (t) { - t.test('real symbol valueOf', { skip: !hasSymbols }, function (st) { - var fakeSymbol = { valueOf: function () { return Symbol('foo'); } }; - st.equal(false, isSymbol(fakeSymbol), 'object with valueOf returning a symbol is not a symbol'); - st.end(); - }); - - t.test('faked @@toStringTag', { skip: !hasSymbols || !Symbol.toStringTag }, function (st) { - var fakeSymbol = { valueOf: function () { return Symbol('foo'); } }; - fakeSymbol[Symbol.toStringTag] = 'Symbol'; - st.equal(false, isSymbol(fakeSymbol), 'object with fake Symbol @@toStringTag and valueOf returning a symbol is not a symbol'); - var notSoFakeSymbol = { valueOf: function () { return 42; } }; - notSoFakeSymbol[Symbol.toStringTag] = 'Symbol'; - st.equal(false, isSymbol(notSoFakeSymbol), 'object with fake Symbol @@toStringTag and valueOf not returning a symbol is not a symbol'); - st.end(); - }); - - var fakeSymbolString = { toString: function () { return 'Symbol(foo)'; } }; - t.equal(false, isSymbol(fakeSymbolString), 'object with toString returning Symbol(foo) is not a symbol'); - - t.end(); -}); - -test('Symbol support', { skip: !hasSymbols }, function (t) { - t.test('well-known Symbols', function (st) { - var isWellKnown = function filterer(name) { - return name !== 'for' && name !== 'keyFor' && !(name in filterer); - }; - var wellKnownSymbols = Object.getOwnPropertyNames(Symbol).filter(isWellKnown); - wellKnownSymbols.forEach(function (name) { - var sym = Symbol[name]; - st.equal(true, isSymbol(sym), debug(sym, ' is a symbol')); - }); - st.end(); - }); - - t.test('user-created symbols', function (st) { - var symbols = [ - Symbol(), - Symbol('foo'), - Symbol['for']('foo'), - Object(Symbol('object')) - ]; - symbols.forEach(function (sym) { - st.equal(true, isSymbol(sym), debug(sym, ' is a symbol')); - }); - st.end(); - }); - - t.end(); -}); - diff --git a/deps/npm/node_modules/is-typedarray/package.json b/deps/npm/node_modules/is-typedarray/package.json index 56e9107077743a..37f7ae31c1111a 100644 --- a/deps/npm/node_modules/is-typedarray/package.json +++ b/deps/npm/node_modules/is-typedarray/package.json @@ -1,43 +1,21 @@ { - "_from": "is-typedarray@~1.0.0", - "_id": "is-typedarray@1.0.0", - "_inBundle": false, - "_integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=", - "_location": "/is-typedarray", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "is-typedarray@~1.0.0", - "name": "is-typedarray", - "escapedName": "is-typedarray", - "rawSpec": "~1.0.0", - "saveSpec": null, - "fetchSpec": "~1.0.0" - }, - "_requiredBy": [ - "/request" - ], - "_resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", - "_shasum": "e479c80858df0c1b11ddda6940f96011fcda4a9a", - "_spec": "is-typedarray@~1.0.0", - "_where": "/Users/rebecca/code/npm/node_modules/request", - "author": { - "name": "Hugh Kennedy", - "email": "hughskennedy@gmail.com", - "url": "http://hughsk.io/" - }, - "bugs": { - "url": "https://github.com/hughsk/is-typedarray/issues" + "name": "is-typedarray", + "version": "1.0.0", + "description": "Detect whether or not an object is a Typed Array", + "main": "index.js", + "scripts": { + "test": "node test" }, - "bundleDependencies": false, + "author": "Hugh Kennedy (http://hughsk.io/)", + "license": "MIT", "dependencies": {}, - "deprecated": false, - "description": "Detect whether or not an object is a Typed Array", "devDependencies": { "tape": "^2.13.1" }, - "homepage": "https://github.com/hughsk/is-typedarray", + "repository": { + "type": "git", + "url": "git://github.com/hughsk/is-typedarray.git" + }, "keywords": [ "typed", "array", @@ -45,15 +23,8 @@ "is", "util" ], - "license": "MIT", - "main": "index.js", - "name": "is-typedarray", - "repository": { - "type": "git", - "url": "git://github.com/hughsk/is-typedarray.git" - }, - "scripts": { - "test": "node test" + "bugs": { + "url": "https://github.com/hughsk/is-typedarray/issues" }, - "version": "1.0.0" + "homepage": "https://github.com/hughsk/is-typedarray" } diff --git a/deps/npm/node_modules/isarray/package.json b/deps/npm/node_modules/isarray/package.json index f9a5ecd5f37ae2..1a4317a9c41c73 100644 --- a/deps/npm/node_modules/isarray/package.json +++ b/deps/npm/node_modules/isarray/package.json @@ -1,59 +1,28 @@ { - "_from": "isarray@~1.0.0", - "_id": "isarray@1.0.0", - "_inBundle": false, - "_integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", - "_location": "/isarray", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "isarray@~1.0.0", - "name": "isarray", - "escapedName": "isarray", - "rawSpec": "~1.0.0", - "saveSpec": null, - "fetchSpec": "~1.0.0" - }, - "_requiredBy": [ - "/eslint-plugin-import/doctrine", - "/readable-stream" - ], - "_resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "_shasum": "bb935d48582cba168c06834957a54a3e07124f11", - "_spec": "isarray@~1.0.0", - "_where": "/Users/rebecca/code/npm/node_modules/readable-stream", - "author": { - "name": "Julian Gruber", - "email": "mail@juliangruber.com", - "url": "http://juliangruber.com" - }, - "bugs": { - "url": "https://github.com/juliangruber/isarray/issues" + "name": "isarray", + "description": "Array#isArray for older browsers", + "version": "1.0.0", + "repository": { + "type": "git", + "url": "git://github.com/juliangruber/isarray.git" }, - "bundleDependencies": false, + "homepage": "https://github.com/juliangruber/isarray", + "main": "index.js", "dependencies": {}, - "deprecated": false, - "description": "Array#isArray for older browsers", "devDependencies": { "tape": "~2.13.4" }, - "homepage": "https://github.com/juliangruber/isarray", "keywords": [ "browser", "isarray", "array" ], - "license": "MIT", - "main": "index.js", - "name": "isarray", - "repository": { - "type": "git", - "url": "git://github.com/juliangruber/isarray.git" - }, - "scripts": { - "test": "tape test.js" + "author": { + "name": "Julian Gruber", + "email": "mail@juliangruber.com", + "url": "http://juliangruber.com" }, + "license": "MIT", "testling": { "files": "test.js", "browsers": [ @@ -70,5 +39,7 @@ "android-browser/4.2..latest" ] }, - "version": "1.0.0" + "scripts": { + "test": "tape test.js" + } } diff --git a/deps/npm/node_modules/isexe/package.json b/deps/npm/node_modules/isexe/package.json index 681a27a49510ee..e452689442f201 100644 --- a/deps/npm/node_modules/isexe/package.json +++ b/deps/npm/node_modules/isexe/package.json @@ -1,61 +1,31 @@ { - "_from": "isexe@^2.0.0", - "_id": "isexe@2.0.0", - "_inBundle": false, - "_integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", - "_location": "/isexe", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "isexe@^2.0.0", - "name": "isexe", - "escapedName": "isexe", - "rawSpec": "^2.0.0", - "saveSpec": null, - "fetchSpec": "^2.0.0" - }, - "_requiredBy": [ - "/tap", - "/which" - ], - "_resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "_shasum": "e8fbf374dc556ff8947a10dcb0572d633f2cfa10", - "_spec": "isexe@^2.0.0", - "_where": "/Users/rebecca/code/npm/node_modules/which", - "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, + "name": "isexe", + "version": "2.0.0", "description": "Minimal module to check if a file is executable.", + "main": "index.js", + "directories": { + "test": "test" + }, "devDependencies": { "mkdirp": "^0.5.1", "rimraf": "^2.5.0", "tap": "^10.3.0" }, - "directories": { - "test": "test" + "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/isexe#readme", - "keywords": [], + "author": "Isaac Z. Schlueter (http://blog.izs.me/)", "license": "ISC", - "main": "index.js", - "name": "isexe", "repository": { "type": "git", "url": "git+https://github.com/isaacs/isexe.git" }, - "scripts": { - "postpublish": "git push origin --all; git push origin --tags", - "postversion": "npm publish", - "preversion": "npm test", - "test": "tap test/*.js --100" + "keywords": [], + "bugs": { + "url": "https://github.com/isaacs/isexe/issues" }, - "version": "2.0.0" + "homepage": "https://github.com/isaacs/isexe#readme" } diff --git a/deps/npm/node_modules/isstream/package.json b/deps/npm/node_modules/isstream/package.json index 2a74102f679664..9ee8bf82463aae 100644 --- a/deps/npm/node_modules/isstream/package.json +++ b/deps/npm/node_modules/isstream/package.json @@ -1,45 +1,15 @@ { - "_from": "isstream@~0.1.2", - "_id": "isstream@0.1.2", - "_inBundle": false, - "_integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=", - "_location": "/isstream", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "isstream@~0.1.2", - "name": "isstream", - "escapedName": "isstream", - "rawSpec": "~0.1.2", - "saveSpec": null, - "fetchSpec": "~0.1.2" - }, - "_requiredBy": [ - "/request" - ], - "_resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", - "_shasum": "47e63f7af55afa6f92e1500e690eb8b8529c099a", - "_spec": "isstream@~0.1.2", - "_where": "/Users/rebecca/code/npm/node_modules/request", - "author": { - "name": "Rod Vagg", - "email": "rod@vagg.org" - }, - "bugs": { - "url": "https://github.com/rvagg/isstream/issues" - }, - "bundleDependencies": false, - "deprecated": false, + "name": "isstream", + "version": "0.1.2", "description": "Determine if an object is a Stream", - "devDependencies": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.1", - "isarray": "0.0.1", - "string_decoder": "~0.10.x", - "tape": "~2.12.3" + "main": "isstream.js", + "scripts": { + "test": "tar --xform 's/^package/readable-stream-1.0/' -zxf readable-stream-1.0.*.tgz && tar --xform 's/^package/readable-stream-1.1/' -zxf readable-stream-1.1.*.tgz && node test.js; rm -rf readable-stream-1.?/" + }, + "repository": { + "type": "git", + "url": "https://github.com/rvagg/isstream.git" }, - "homepage": "https://github.com/rvagg/isstream", "keywords": [ "stream", "type", @@ -47,15 +17,17 @@ "readable-stream", "hippo" ], - "license": "MIT", - "main": "isstream.js", - "name": "isstream", - "repository": { - "type": "git", - "url": "git+https://github.com/rvagg/isstream.git" + "devDependencies": { + "tape": "~2.12.3", + "core-util-is": "~1.0.0", + "isarray": "0.0.1", + "string_decoder": "~0.10.x", + "inherits": "~2.0.1" }, - "scripts": { - "test": "tar --xform 's/^package/readable-stream-1.0/' -zxf readable-stream-1.0.*.tgz && tar --xform 's/^package/readable-stream-1.1/' -zxf readable-stream-1.1.*.tgz && node test.js; rm -rf readable-stream-1.?/" + "author": "Rod Vagg ", + "license": "MIT", + "bugs": { + "url": "https://github.com/rvagg/isstream/issues" }, - "version": "0.1.2" + "homepage": "https://github.com/rvagg/isstream" } diff --git a/deps/npm/node_modules/jsbn/package.json b/deps/npm/node_modules/jsbn/package.json index 765736fea674c9..7220c19f575eb7 100644 --- a/deps/npm/node_modules/jsbn/package.json +++ b/deps/npm/node_modules/jsbn/package.json @@ -1,53 +1,21 @@ { - "_from": "jsbn@~0.1.0", - "_id": "jsbn@0.1.1", - "_inBundle": false, - "_integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=", - "_location": "/jsbn", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "jsbn@~0.1.0", - "name": "jsbn", - "escapedName": "jsbn", - "rawSpec": "~0.1.0", - "saveSpec": null, - "fetchSpec": "~0.1.0" - }, - "_requiredBy": [ - "/ecc-jsbn", - "/sshpk" - ], - "_resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", - "_shasum": "a5e654c2e5a2deb5f201d96cefbca80c0ef2f513", - "_spec": "jsbn@~0.1.0", - "_where": "/Users/rebecca/code/npm/node_modules/sshpk", - "author": { - "name": "Tom Wu" + "name": "jsbn", + "version": "0.1.1", + "description": "The jsbn library is a fast, portable implementation of large-number math in pure JavaScript, enabling public-key crypto and other applications on desktop and mobile browsers.", + "main": "index.js", + "scripts": { + "test": "mocha test.js" }, - "bugs": { - "url": "https://github.com/andyperlitch/jsbn/issues" + "repository": { + "type": "git", + "url": "https://github.com/andyperlitch/jsbn.git" }, - "bundleDependencies": false, - "deprecated": false, - "description": "The jsbn library is a fast, portable implementation of large-number math in pure JavaScript, enabling public-key crypto and other applications on desktop and mobile browsers.", - "homepage": "https://github.com/andyperlitch/jsbn#readme", "keywords": [ "biginteger", "bignumber", "big", "integer" ], - "license": "MIT", - "main": "index.js", - "name": "jsbn", - "repository": { - "type": "git", - "url": "git+https://github.com/andyperlitch/jsbn.git" - }, - "scripts": { - "test": "mocha test.js" - }, - "version": "0.1.1" + "author": "Tom Wu", + "license": "MIT" } diff --git a/deps/npm/node_modules/json-parse-better-errors/CHANGELOG.md b/deps/npm/node_modules/json-parse-better-errors/CHANGELOG.md deleted file mode 100644 index b1d212de439089..00000000000000 --- a/deps/npm/node_modules/json-parse-better-errors/CHANGELOG.md +++ /dev/null @@ -1,46 +0,0 @@ -# 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. - - -## [1.0.2](https://github.com/zkat/json-parse-better-errors/compare/v1.0.1...v1.0.2) (2018-03-30) - - -### Bug Fixes - -* **messages:** More friendly messages for non-string ([#1](https://github.com/zkat/json-parse-better-errors/issues/1)) ([a476d42](https://github.com/zkat/json-parse-better-errors/commit/a476d42)) - - - - -## [1.0.1](https://github.com/zkat/json-parse-better-errors/compare/v1.0.0...v1.0.1) (2017-08-16) - - -### Bug Fixes - -* **license:** oops. Forgot to update license.md ([efe2958](https://github.com/zkat/json-parse-better-errors/commit/efe2958)) - - - - -# 1.0.0 (2017-08-15) - - -### Features - -* **init:** Initial Commit ([562c977](https://github.com/zkat/json-parse-better-errors/commit/562c977)) - - -### BREAKING CHANGES - -* **init:** This is the first commit! - - - - -# 0.1.0 (2017-08-15) - - -### Features - -* **init:** Initial Commit ([9dd1a19](https://github.com/zkat/json-parse-better-errors/commit/9dd1a19)) diff --git a/deps/npm/node_modules/json-parse-better-errors/LICENSE.md b/deps/npm/node_modules/json-parse-better-errors/LICENSE.md deleted file mode 100644 index c51842cc4ab3c2..00000000000000 --- a/deps/npm/node_modules/json-parse-better-errors/LICENSE.md +++ /dev/null @@ -1,7 +0,0 @@ -Copyright 2017 Kat Marchán - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/deps/npm/node_modules/json-parse-better-errors/README.md b/deps/npm/node_modules/json-parse-better-errors/README.md deleted file mode 100644 index a1f0f0a592ad3a..00000000000000 --- a/deps/npm/node_modules/json-parse-better-errors/README.md +++ /dev/null @@ -1,46 +0,0 @@ -# json-parse-better-errors [![npm version](https://img.shields.io/npm/v/json-parse-better-errors.svg)](https://npm.im/json-parse-better-errors) [![license](https://img.shields.io/npm/l/json-parse-better-errors.svg)](https://npm.im/json-parse-better-errors) [![Travis](https://img.shields.io/travis/zkat/json-parse-better-errors.svg)](https://travis-ci.org/zkat/json-parse-better-errors) [![AppVeyor](https://ci.appveyor.com/api/projects/status/github/zkat/json-parse-better-errors?svg=true)](https://ci.appveyor.com/project/zkat/json-parse-better-errors) [![Coverage Status](https://coveralls.io/repos/github/zkat/json-parse-better-errors/badge.svg?branch=latest)](https://coveralls.io/github/zkat/json-parse-better-errors?branch=latest) - -[`json-parse-better-errors`](https://github.com/zkat/json-parse-better-errors) is a Node.js library for -getting nicer errors out of `JSON.parse()`, including context and position of the parse errors. - -## Install - -`$ npm install --save json-parse-better-errors` - -## Table of Contents - -* [Example](#example) -* [Features](#features) -* [Contributing](#contributing) -* [API](#api) - * [`parse`](#parse) - -### Example - -```javascript -const parseJson = require('json-parse-better-errors') - -parseJson('"foo"') -parseJson('garbage') // more useful error message -``` - -### Features - -* Like JSON.parse, but the errors are better. - -### Contributing - -The npm team enthusiastically welcomes contributions and project participation! There's a bunch of things you can do if you want to contribute! The [Contributor Guide](CONTRIBUTING.md) has all the information you need for everything from reporting bugs to contributing entire new features. Please don't hesitate to jump in if you'd like to, or even ask us questions if something isn't clear. - -All participants and maintainers in this project are expected to follow [Code of Conduct](CODE_OF_CONDUCT.md), and just generally be excellent to each other. - -Please refer to the [Changelog](CHANGELOG.md) for project history details, too. - -Happy hacking! - -### API - -#### `> parse(txt, ?reviver, ?context=20)` - -Works just like `JSON.parse`, but will include a bit more information when an -error happens. diff --git a/deps/npm/node_modules/json-parse-better-errors/index.js b/deps/npm/node_modules/json-parse-better-errors/index.js deleted file mode 100644 index 14644c2f1a813e..00000000000000 --- a/deps/npm/node_modules/json-parse-better-errors/index.js +++ /dev/null @@ -1,38 +0,0 @@ -'use strict' - -module.exports = parseJson -function parseJson (txt, reviver, context) { - context = context || 20 - try { - return JSON.parse(txt, reviver) - } catch (e) { - if (typeof txt !== 'string') { - const isEmptyArray = Array.isArray(txt) && txt.length === 0 - const errorMessage = 'Cannot parse ' + - (isEmptyArray ? 'an empty array' : String(txt)) - throw new TypeError(errorMessage) - } - const syntaxErr = e.message.match(/^Unexpected token.*position\s+(\d+)/i) - const errIdx = syntaxErr - ? +syntaxErr[1] - : e.message.match(/^Unexpected end of JSON.*/i) - ? txt.length - 1 - : null - if (errIdx != null) { - const start = errIdx <= context - ? 0 - : errIdx - context - const end = errIdx + context >= txt.length - ? txt.length - : errIdx + context - e.message += ` while parsing near '${ - start === 0 ? '' : '...' - }${txt.slice(start, end)}${ - end === txt.length ? '' : '...' - }'` - } else { - e.message += ` while parsing '${txt.slice(0, context * 2)}'` - } - throw e - } -} diff --git a/deps/npm/node_modules/json-parse-better-errors/package.json b/deps/npm/node_modules/json-parse-better-errors/package.json deleted file mode 100644 index e63bf6b0bf2c59..00000000000000 --- a/deps/npm/node_modules/json-parse-better-errors/package.json +++ /dev/null @@ -1,82 +0,0 @@ -{ - "_args": [ - [ - "json-parse-better-errors@1.0.2", - "/Users/rebecca/code/npm" - ] - ], - "_from": "json-parse-better-errors@1.0.2", - "_id": "json-parse-better-errors@1.0.2", - "_inBundle": false, - "_integrity": "sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==", - "_location": "/json-parse-better-errors", - "_phantomChildren": {}, - "_requested": { - "type": "version", - "registry": true, - "raw": "json-parse-better-errors@1.0.2", - "name": "json-parse-better-errors", - "escapedName": "json-parse-better-errors", - "rawSpec": "1.0.2", - "saveSpec": null, - "fetchSpec": "1.0.2" - }, - "_requiredBy": [ - "/", - "/node-fetch-npm", - "/pkg-conf/parse-json", - "/read-package-json" - ], - "_resolved": "https://registry.npmjs.org/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz", - "_spec": "1.0.2", - "_where": "/Users/rebecca/code/npm", - "author": { - "name": "Kat Marchán", - "email": "kzm@zkat.tech" - }, - "bugs": { - "url": "https://github.com/zkat/json-parse-better-errors/issues" - }, - "config": { - "nyc": { - "exclude": [ - "node_modules/**", - "test/**" - ] - } - }, - "description": "JSON.parse with context information on error", - "devDependencies": { - "nyc": "^10.3.2", - "standard": "^9.0.2", - "standard-version": "^4.1.0", - "tap": "^10.3.3", - "weallbehave": "^1.2.0", - "weallcontribute": "^1.0.8" - }, - "files": [ - "*.js" - ], - "homepage": "https://github.com/zkat/json-parse-better-errors#readme", - "keywords": [ - "JSON", - "parser" - ], - "license": "MIT", - "main": "index.js", - "name": "json-parse-better-errors", - "repository": { - "type": "git", - "url": "git+https://github.com/zkat/json-parse-better-errors.git" - }, - "scripts": { - "postrelease": "npm publish && git push --follow-tags", - "prerelease": "npm t", - "pretest": "standard", - "release": "standard-version -s", - "test": "tap -J --coverage test/*.js", - "update-coc": "weallbehave -o . && git add CODE_OF_CONDUCT.md && git commit -m 'docs(coc): updated CODE_OF_CONDUCT.md'", - "update-contrib": "weallcontribute -o . && git add CONTRIBUTING.md && git commit -m 'docs(contributing): updated CONTRIBUTING.md'" - }, - "version": "1.0.2" -} diff --git a/deps/npm/node_modules/json-parse-even-better-errors/CHANGELOG.md b/deps/npm/node_modules/json-parse-even-better-errors/CHANGELOG.md new file mode 100644 index 00000000000000..dfd67330a6aba1 --- /dev/null +++ b/deps/npm/node_modules/json-parse-even-better-errors/CHANGELOG.md @@ -0,0 +1,50 @@ +# 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. + +## 2.0.0 + +* Add custom error classes + + +## [1.0.2](https://github.com/npm/json-parse-even-better-errors/compare/v1.0.1...v1.0.2) (2018-03-30) + + +### Bug Fixes + +* **messages:** More friendly messages for non-string ([#1](https://github.com/npm/json-parse-even-better-errors/issues/1)) ([a476d42](https://github.com/npm/json-parse-even-better-errors/commit/a476d42)) + + + + +## [1.0.1](https://github.com/npm/json-parse-even-better-errors/compare/v1.0.0...v1.0.1) (2017-08-16) + + +### Bug Fixes + +* **license:** oops. Forgot to update license.md ([efe2958](https://github.com/npm/json-parse-even-better-errors/commit/efe2958)) + + + + +# 1.0.0 (2017-08-15) + + +### Features + +* **init:** Initial Commit ([562c977](https://github.com/npm/json-parse-even-better-errors/commit/562c977)) + + +### BREAKING CHANGES + +* **init:** This is the first commit! + + + + +# 0.1.0 (2017-08-15) + + +### Features + +* **init:** Initial Commit ([9dd1a19](https://github.com/npm/json-parse-even-better-errors/commit/9dd1a19)) diff --git a/deps/npm/node_modules/json-parse-even-better-errors/LICENSE.md b/deps/npm/node_modules/json-parse-even-better-errors/LICENSE.md new file mode 100644 index 00000000000000..6991b7cbb89db9 --- /dev/null +++ b/deps/npm/node_modules/json-parse-even-better-errors/LICENSE.md @@ -0,0 +1,25 @@ +Copyright 2017 Kat Marchán +Copyright npm, Inc. + +Permission is hereby granted, free of charge, to any person obtaining a +copy of this software and associated documentation files (the "Software"), +to deal in the Software without restriction, including without limitation +the rights to use, copy, modify, merge, publish, distribute, sublicense, +and/or sell copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. + +--- + +This library is a fork of 'better-json-errors' by Kat Marchán, extended and +distributed under the terms of the MIT license above. diff --git a/deps/npm/node_modules/json-parse-even-better-errors/README.md b/deps/npm/node_modules/json-parse-even-better-errors/README.md new file mode 100644 index 00000000000000..2799efe69ec844 --- /dev/null +++ b/deps/npm/node_modules/json-parse-even-better-errors/README.md @@ -0,0 +1,96 @@ +# json-parse-even-better-errors + +[`json-parse-even-better-errors`](https://github.com/npm/json-parse-even-better-errors) +is a Node.js library for getting nicer errors out of `JSON.parse()`, +including context and position of the parse errors. + +It also preserves the newline and indentation styles of the JSON data, by +putting them in the object or array in the `Symbol.for('indent')` and +`Symbol.for('newline')` properties. + +## Install + +`$ npm install --save json-parse-even-better-errors` + +## Table of Contents + +* [Example](#example) +* [Features](#features) +* [Contributing](#contributing) +* [API](#api) + * [`parse`](#parse) + +### Example + +```javascript +const parseJson = require('json-parse-even-better-errors') + +parseJson('"foo"') // returns the string 'foo' +parseJson('garbage') // more useful error message +parseJson.noExceptions('garbage') // returns undefined +``` + +### Features + +* Like JSON.parse, but the errors are better. +* Strips a leading byte-order-mark that you sometimes get reading files. +* Has a `noExceptions` method that returns undefined rather than throwing. +* Attaches the newline character(s) used to the `Symbol.for('newline')` + property on objects and arrays. +* Attaches the indentation character(s) used to the `Symbol.for('indent')` + property on objects and arrays. + +## Indentation + +To preserve indentation when the file is saved back to disk, use +`data[Symbol.for('indent')]` as the third argument to `JSON.stringify`, and +if you want to preserve windows `\r\n` newlines, replace the `\n` chars in +the string with `data[Symbol.for('newline')]`. + +For example: + +```js +const txt = await readFile('./package.json', 'utf8') +const data = parseJsonEvenBetterErrors(txt) +const indent = Symbol.for('indent') +const newline = Symbol.for('newline') +// .. do some stuff to the data .. +const string = JSON.stringify(data, null, data[indent]) + '\n' +const eolFixed = data[newline] === '\n' ? string + : string.replace(/\n/g, data[newline]) +await writeFile('./package.json', eolFixed) +``` + +Indentation is determined by looking at the whitespace between the initial +`{` and `[` and the character that follows it. If you have lots of weird +inconsistent indentation, then it won't track that or give you any way to +preserve it. Whether this is a bug or a feature is debatable ;) + +### API + +#### `parse(txt, reviver = null, context = 20)` + +Works just like `JSON.parse`, but will include a bit more information when +an error happens, and attaches a `Symbol.for('indent')` and +`Symbol.for('newline')` on objects and arrays. This throws a +`JSONParseError`. + +#### `parse.noExceptions(txt, reviver = null)` + +Works just like `JSON.parse`, but will return `undefined` rather than +throwing an error. + +#### `class JSONParseError(er, text, context = 20, caller = null)` + +Extends the JavaScript `SyntaxError` class to parse the message and provide +better metadata. + +Pass in the error thrown by the built-in `JSON.parse`, and the text being +parsed, and it'll parse out the bits needed to be helpful. + +`context` defaults to 20. + +Set a `caller` function to trim internal implementation details out of the +stack trace. When calling `parseJson`, this is set to the `parseJson` +function. If not set, then the constructor defaults to itself, so the +stack trace will point to the spot where you call `new JSONParseError`. diff --git a/deps/npm/node_modules/json-parse-even-better-errors/index.js b/deps/npm/node_modules/json-parse-even-better-errors/index.js new file mode 100644 index 00000000000000..86a1fdc1ae8093 --- /dev/null +++ b/deps/npm/node_modules/json-parse-even-better-errors/index.js @@ -0,0 +1,121 @@ +'use strict' + +const hexify = char => { + const h = char.charCodeAt(0).toString(16).toUpperCase() + return '0x' + (h.length % 2 ? '0' : '') + h +} + +const parseError = (e, txt, context) => { + if (!txt) { + return { + message: e.message + ' while parsing empty string', + position: 0, + } + } + const badToken = e.message.match(/^Unexpected token (.) .*position\s+(\d+)/i) + const errIdx = badToken ? +badToken[2] + : e.message.match(/^Unexpected end of JSON.*/i) ? txt.length - 1 + : null + + const msg = badToken ? e.message.replace(/^Unexpected token ./, `Unexpected token ${ + JSON.stringify(badToken[1]) + } (${hexify(badToken[1])})`) + : e.message + + if (errIdx !== null && errIdx !== undefined) { + const start = errIdx <= context ? 0 + : errIdx - context + + const end = errIdx + context >= txt.length ? txt.length + : errIdx + context + + const slice = (start === 0 ? '' : '...') + + txt.slice(start, end) + + (end === txt.length ? '' : '...') + + const near = txt === slice ? '' : 'near ' + + return { + message: msg + ` while parsing ${near}${JSON.stringify(slice)}`, + position: errIdx, + } + } else { + return { + message: msg + ` while parsing '${txt.slice(0, context * 2)}'`, + position: 0, + } + } +} + +class JSONParseError extends SyntaxError { + constructor (er, txt, context, caller) { + context = context || 20 + const metadata = parseError(er, txt, context) + super(metadata.message) + Object.assign(this, metadata) + this.code = 'EJSONPARSE' + this.systemError = er + Error.captureStackTrace(this, caller || this.constructor) + } + get name () { return this.constructor.name } + set name (n) {} + get [Symbol.toStringTag] () { return this.constructor.name } +} + +const kIndent = Symbol.for('indent') +const kNewline = Symbol.for('newline') +// only respect indentation if we got a line break, otherwise squash it +// things other than objects and arrays aren't indented, so ignore those +// Important: in both of these regexps, the $1 capture group is the newline +// or undefined, and the $2 capture group is the indent, or undefined. +const formatRE = /^\s*[{\[]((?:\r?\n)+)([\s\t]*)/ +const emptyRE = /^(?:\{\}|\[\])((?:\r?\n)+)?$/ + +const parseJson = (txt, reviver, context) => { + const parseText = stripBOM(txt) + context = context || 20 + try { + // get the indentation so that we can save it back nicely + // if the file starts with {" then we have an indent of '', ie, none + // otherwise, pick the indentation of the next line after the first \n + // If the pattern doesn't match, then it means no indentation. + // JSON.stringify ignores symbols, so this is reasonably safe. + // if the string is '{}' or '[]', then use the default 2-space indent. + const [, newline = '\n', indent = ' '] = parseText.match(emptyRE) || + parseText.match(formatRE) || + [, '', ''] + + const result = JSON.parse(parseText, reviver) + if (result && typeof result === 'object') { + result[kNewline] = newline + result[kIndent] = indent + } + return result + } catch (e) { + if (typeof txt !== 'string' && !Buffer.isBuffer(txt)) { + const isEmptyArray = Array.isArray(txt) && txt.length === 0 + throw Object.assign(new TypeError( + `Cannot parse ${isEmptyArray ? 'an empty array' : String(txt)}` + ), { + code: 'EJSONPARSE', + systemError: e, + }) + } + + throw new JSONParseError(e, parseText, context, parseJson) + } +} + +// Remove byte order marker. This catches EF BB BF (the UTF-8 BOM) +// because the buffer-to-string conversion in `fs.readFileSync()` +// translates it to FEFF, the UTF-16 BOM. +const stripBOM = txt => String(txt).replace(/^\uFEFF/, '') + +module.exports = parseJson +parseJson.JSONParseError = JSONParseError + +parseJson.noExceptions = (txt, reviver) => { + try { + return JSON.parse(stripBOM(txt), reviver) + } catch (e) {} +} diff --git a/deps/npm/node_modules/json-parse-even-better-errors/package.json b/deps/npm/node_modules/json-parse-even-better-errors/package.json new file mode 100644 index 00000000000000..ed0fdaf2e0f6fb --- /dev/null +++ b/deps/npm/node_modules/json-parse-even-better-errors/package.json @@ -0,0 +1,33 @@ +{ + "name": "json-parse-even-better-errors", + "version": "2.3.1", + "description": "JSON.parse with context information on error", + "main": "index.js", + "files": [ + "*.js" + ], + "scripts": { + "preversion": "npm t", + "postversion": "npm publish", + "prepublishOnly": "git push --follow-tags", + "test": "tap", + "snap": "tap" + }, + "repository": "https://github.com/npm/json-parse-even-better-errors", + "keywords": [ + "JSON", + "parser" + ], + "author": { + "name": "Kat Marchán", + "email": "kzm@zkat.tech", + "twitter": "maybekatz" + }, + "license": "MIT", + "devDependencies": { + "tap": "^14.6.5" + }, + "tap": { + "check-coverage": true + } +} diff --git a/deps/npm/node_modules/json-schema-traverse/.npmignore b/deps/npm/node_modules/json-schema-traverse/.npmignore deleted file mode 100644 index d0935579303a75..00000000000000 --- a/deps/npm/node_modules/json-schema-traverse/.npmignore +++ /dev/null @@ -1,60 +0,0 @@ -# Logs -logs -*.log -npm-debug.log* -yarn-debug.log* -yarn-error.log* - -# Runtime data -pids -*.pid -*.seed -*.pid.lock - -# Directory for instrumented libs generated by jscoverage/JSCover -lib-cov - -# Coverage directory used by tools like istanbul -coverage - -# nyc test coverage -.nyc_output - -# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) -.grunt - -# Bower dependency directory (https://bower.io/) -bower_components - -# node-waf configuration -.lock-wscript - -# Compiled binary addons (http://nodejs.org/api/addons.html) -build/Release - -# Dependency directories -node_modules/ -jspm_packages/ - -# Typescript v1 declaration files -typings/ - -# Optional npm cache directory -.npm - -# Optional eslint cache -.eslintcache - -# Optional REPL history -.node_repl_history - -# Output of 'npm pack' -*.tgz - -# Yarn Integrity file -.yarn-integrity - -# dotenv environment variables file -.env - -.DS_Store diff --git a/deps/npm/node_modules/json-schema-traverse/README.md b/deps/npm/node_modules/json-schema-traverse/README.md index d4286a23b389c3..d5ccaf450a2a2b 100644 --- a/deps/npm/node_modules/json-schema-traverse/README.md +++ b/deps/npm/node_modules/json-schema-traverse/README.md @@ -24,14 +24,28 @@ const schema = { } }; -traverse(schema, cb); +traverse(schema, {cb}); // cb is called 3 times with: // 1. root schema // 2. {type: 'string'} // 3. {type: 'integer'} + +// Or: + +traverse(schema, {cb: {pre, post}}); +// pre is called 3 times with: +// 1. root schema +// 2. {type: 'string'} +// 3. {type: 'integer'} +// +// post is called 3 times with: +// 1. {type: 'string'} +// 2. {type: 'integer'} +// 3. root schema + ``` -Callback function is called for each schema object (not including draft-06 boolean schemas), including the root schema. Schema references ($ref) are not resolved, they are passed as is. +Callback function `cb` is called for each schema object (not including draft-06 boolean schemas), including the root schema, in pre-order traversal. Schema references ($ref) are not resolved, they are passed as is. Alternatively, you can pass a `{pre, post}` object as `cb`, and then `pre` will be called before traversing child elements, and `post` will be called after all child elements have been traversed. Callback is passed these parameters: @@ -55,7 +69,7 @@ const schema = { } }; -traverse(schema, {allKeys: true}, cb); +traverse(schema, {allKeys: true, cb}); // cb is called 2 times with: // 1. root schema // 2. mySchema diff --git a/deps/npm/node_modules/json-schema-traverse/index.js b/deps/npm/node_modules/json-schema-traverse/index.js index 79eeb6a05e74d7..d4a18dfc7b1c53 100644 --- a/deps/npm/node_modules/json-schema-traverse/index.js +++ b/deps/npm/node_modules/json-schema-traverse/index.js @@ -1,11 +1,17 @@ 'use strict'; var traverse = module.exports = function (schema, opts, cb) { + // Legacy support for v0.3.1 and earlier. if (typeof opts == 'function') { cb = opts; opts = {}; } - _traverse(opts, cb, schema, '', schema); + + cb = opts.cb || cb; + var pre = (typeof cb == 'function') ? cb : cb.pre || function() {}; + var post = cb.post || function() {}; + + _traverse(opts, pre, post, schema, '', schema); }; @@ -33,6 +39,7 @@ traverse.propsKeywords = { }; traverse.skipKeywords = { + default: true, enum: true, const: true, required: true, @@ -53,25 +60,26 @@ traverse.skipKeywords = { }; -function _traverse(opts, cb, schema, jsonPtr, rootSchema, parentJsonPtr, parentKeyword, parentSchema, keyIndex) { +function _traverse(opts, pre, post, schema, jsonPtr, rootSchema, parentJsonPtr, parentKeyword, parentSchema, keyIndex) { if (schema && typeof schema == 'object' && !Array.isArray(schema)) { - cb(schema, jsonPtr, rootSchema, parentJsonPtr, parentKeyword, parentSchema, keyIndex); + pre(schema, jsonPtr, rootSchema, parentJsonPtr, parentKeyword, parentSchema, keyIndex); for (var key in schema) { var sch = schema[key]; if (Array.isArray(sch)) { if (key in traverse.arrayKeywords) { for (var i=0; i + key === 'a' ? { hello: '📞 yes', 'this is': '🐕', ...val } : val + +console.log(stringify(obj, replacer, '📞🐶')) + +/* output: +{ +📞🐶"y": "z", +📞🐶"yy": "a", +📞🐶"z": 1, +📞🐶"a": { +📞🐶📞🐶"b": 1, +📞🐶📞🐶"hello": "📞 yes", +📞🐶📞🐶"this is": "🐕", +📞🐶📞🐶"a": { +📞🐶📞🐶📞🐶"hello": "📞 yes", +📞🐶📞🐶📞🐶"nested": true, +📞🐶📞🐶📞🐶"this is": "🐕" +📞🐶📞🐶} +📞🐶}, +📞🐶"obj": { +📞🐶📞🐶"b": "x", +📞🐶📞🐶"a": { +📞🐶📞🐶📞🐶"hello": "📞 yes", +📞🐶📞🐶📞🐶"this is": "🐕" +📞🐶📞🐶} +📞🐶} +} +*/ +``` diff --git a/deps/npm/node_modules/json-stringify-nice/index.js b/deps/npm/node_modules/json-stringify-nice/index.js new file mode 100644 index 00000000000000..1ca7e14fa0c668 --- /dev/null +++ b/deps/npm/node_modules/json-stringify-nice/index.js @@ -0,0 +1,38 @@ +const isObj = val => val && !Array.isArray(val) && typeof val === 'object' + +const compare = (ak, bk, prefKeys) => + prefKeys.includes(ak) && !prefKeys.includes(bk) ? -1 + : prefKeys.includes(bk) && !prefKeys.includes(ak) ? 1 + : prefKeys.includes(ak) && prefKeys.includes(bk) + ? prefKeys.indexOf(ak) - prefKeys.indexOf(bk) + : ak.localeCompare(bk) + +const sort = (replacer, seen) => (key, val) => { + const prefKeys = Array.isArray(replacer) ? replacer : [] + + if (typeof replacer === 'function') + val = replacer(key, val) + + if (!isObj(val)) + return val + + if (seen.has(val)) + return seen.get(val) + + const ret = Object.entries(val).sort( + ([ak, av], [bk, bv]) => + isObj(av) === isObj(bv) ? compare(ak, bk, prefKeys) + : isObj(av) ? 1 + : -1 + ).reduce((set, [k, v]) => { + set[k] = v + return set + }, {}) + + seen.set(val, ret) + return ret +} + +module.exports = (obj, replacer, space = 2) => + JSON.stringify(obj, sort(replacer, new Map()), space) + + (space ? '\n' : '') diff --git a/deps/npm/node_modules/json-stringify-nice/package.json b/deps/npm/node_modules/json-stringify-nice/package.json new file mode 100644 index 00000000000000..e060b2ed70e6d1 --- /dev/null +++ b/deps/npm/node_modules/json-stringify-nice/package.json @@ -0,0 +1,24 @@ +{ + "name": "json-stringify-nice", + "version": "1.1.1", + "description": "Stringify an object sorting scalars before objects, and defaulting to 2-space indent", + "author": "Isaac Z. Schlueter (https://izs.me)", + "license": "ISC", + "scripts": { + "test": "tap", + "snap": "tap", + "preversion": "npm test", + "postversion": "npm publish", + "postpublish": "git push origin --follow-tags" + }, + "tap": { + "check-coverage": true + }, + "devDependencies": { + "tap": "^14.9.2" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + }, + "repository": "https://github.com/isaacs/json-stringify-nice" +} diff --git a/deps/npm/node_modules/json-stringify-nice/tap-snapshots/test-basic.js-TAP.test.js b/deps/npm/node_modules/json-stringify-nice/tap-snapshots/test-basic.js-TAP.test.js new file mode 100644 index 00000000000000..53d5fda6c3a145 --- /dev/null +++ b/deps/npm/node_modules/json-stringify-nice/tap-snapshots/test-basic.js-TAP.test.js @@ -0,0 +1,127 @@ +/* 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/basic.js TAP basic sorting operation with default 2-space indent > mix of objects and out of order keys 1`] = ` +{ + "y": "z", + "yy": "a", + "z": 1, + "a": { + "a": 2, + "b": 1 + }, + "obj": { + "b": "x", + "a": {} + } +} + +` + +exports[`test/basic.js TAP replacer function is used > replace a val with phone doggo 1`] = ` +{ + "y": "z", + "yy": "a", + "z": 1, + "a": { + "b": 1, + "hello": "📞 yes", + "this is": "🐕", + "a": { + "hello": "📞 yes", + "nested": true, + "this is": "🐕" + } + }, + "obj": { + "b": "x", + "a": { + "hello": "📞 yes", + "this is": "🐕" + } + } +} + +` + +exports[`test/basic.js TAP sort keys explicitly with a preference list > replace a val with preferences 1`] = ` +{ + "z": 1, + "yy": "a", + "y": "z", + "obj": { + "b": "x", + "a": {} + }, + "a": { + "b": 1, + "a": { + "nested": true + } + } +} + +` + +exports[`test/basic.js TAP spaces can be set > boolean false 1`] = ` +{"y":"z","yy":"a","z":1,"a":{"a":2,"b":1},"obj":{"b":"x","a":{}}} +` + +exports[`test/basic.js TAP spaces can be set > empty string 1`] = ` +{"y":"z","yy":"a","z":1,"a":{"a":2,"b":1},"obj":{"b":"x","a":{}}} +` + +exports[`test/basic.js TAP spaces can be set > space face 1`] = ` +{ + ^_^ "y": "z", + ^_^ "yy": "a", + ^_^ "z": 1, + ^_^ "a": { + ^_^ ^_^ "a": 2, + ^_^ ^_^ "b": 1 + ^_^ }, + ^_^ "obj": { + ^_^ ^_^ "b": "x", + ^_^ ^_^ "a": {} + ^_^ } +} + +` + +exports[`test/basic.js TAP spaces can be set > tab 1`] = ` +{ + "y": "z", + "yy": "a", + "z": 1, + "a": { + "a": 2, + "b": 1 + }, + "obj": { + "b": "x", + "a": {} + } +} + +` + +exports[`test/basic.js TAP spaces can be set > the number 3 1`] = ` +{ + "y": "z", + "yy": "a", + "z": 1, + "a": { + "a": 2, + "b": 1 + }, + "obj": { + "b": "x", + "a": {} + } +} + +` diff --git a/deps/npm/node_modules/json-stringify-nice/test/basic.js b/deps/npm/node_modules/json-stringify-nice/test/basic.js new file mode 100644 index 00000000000000..23c3ceb3845202 --- /dev/null +++ b/deps/npm/node_modules/json-stringify-nice/test/basic.js @@ -0,0 +1,68 @@ +const t = require('tap') +const stringify = require('../') + +t.test('basic sorting operation with default 2-space indent', t => { + t.plan(1) + t.matchSnapshot(stringify({ + z: 1, + y: 'z', + obj: { a: {}, b: 'x' }, + a: { b: 1, a: 2}, + yy: 'a', + }), 'mix of objects and out of order keys') +}) + +t.test('throws same error on cycles as JSON.stringify', t => { + t.plan(1) + const cycle = { a: { b: { c: {} } } } + cycle.a.b.c = cycle.a + try { + JSON.stringify(cycle) + } catch (builtinEr) { + t.throws(() => stringify(cycle), builtinEr, 'same error as builtin') + } +}) + +t.test('spaces can be set', t => { + t.plan(5) + const obj = { + z: 1, + y: 'z', + obj: { a: {}, b: 'x' }, + a: { b: 1, a: 2}, + yy: 'a', + } + t.matchSnapshot(stringify(obj, 0, '\t'), 'tab') + t.matchSnapshot(stringify(obj, null, ' ^_^ '), 'space face') + t.matchSnapshot(stringify(obj, false, 3), 'the number 3') + t.matchSnapshot(stringify(obj, false, ''), 'empty string') + t.matchSnapshot(stringify(obj, false, false), 'boolean false') +}) + +t.test('replacer function is used', t => { + t.plan(1) + const obj = { + z: 1, + y: 'z', + obj: { a: {}, b: 'x' }, + a: { b: 1, a: { nested: true} }, + yy: 'a', + } + const replacer = (key, val) => + key === 'a' ? { hello: '📞 yes', 'this is': '🐕', ...val } + : val + t.matchSnapshot(stringify(obj, replacer), 'replace a val with phone doggo') +}) + +t.test('sort keys explicitly with a preference list', t => { + t.plan(1) + const obj = { + z: 1, + y: 'z', + obj: { a: {}, b: 'x' }, + a: { b: 1, a: { nested: true} }, + yy: 'a', + } + const preference = ['obj', 'z', 'yy'] + t.matchSnapshot(stringify(obj, preference), 'replace a val with preferences') +}) diff --git a/deps/npm/node_modules/json-stringify-safe/package.json b/deps/npm/node_modules/json-stringify-safe/package.json index cafc4c9a28e053..8e17b1266a9a1c 100644 --- a/deps/npm/node_modules/json-stringify-safe/package.json +++ b/deps/npm/node_modules/json-stringify-safe/package.json @@ -1,66 +1,31 @@ { - "_from": "json-stringify-safe@~5.0.1", - "_id": "json-stringify-safe@5.0.1", - "_inBundle": false, - "_integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=", - "_location": "/json-stringify-safe", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "json-stringify-safe@~5.0.1", - "name": "json-stringify-safe", - "escapedName": "json-stringify-safe", - "rawSpec": "~5.0.1", - "saveSpec": null, - "fetchSpec": "~5.0.1" - }, - "_requiredBy": [ - "/request" - ], - "_resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", - "_shasum": "1296a2d58fd45f19a0f6ce01d65701e2c735b6eb", - "_spec": "json-stringify-safe@~5.0.1", - "_where": "/Users/rebecca/code/npm/node_modules/request", - "author": { - "name": "Isaac Z. Schlueter", - "email": "i@izs.me", - "url": "http://blog.izs.me" - }, - "bugs": { - "url": "https://github.com/isaacs/json-stringify-safe/issues" - }, - "bundleDependencies": false, - "contributors": [ - { - "name": "Andri Möll", - "email": "andri@dot.ee", - "url": "http://themoll.com" - } - ], - "deprecated": false, + "name": "json-stringify-safe", + "version": "5.0.1", "description": "Like JSON.stringify, but doesn't blow up on circular refs.", - "devDependencies": { - "mocha": ">= 2.1.0 < 3", - "must": ">= 0.12 < 0.13", - "sinon": ">= 1.12.2 < 2" - }, - "homepage": "https://github.com/isaacs/json-stringify-safe", "keywords": [ "json", "stringify", "circular", "safe" ], + "homepage": "https://github.com/isaacs/json-stringify-safe", + "bugs": "https://github.com/isaacs/json-stringify-safe/issues", + "author": "Isaac Z. Schlueter (http://blog.izs.me)", + "contributors": [ + "Andri Möll (http://themoll.com)" + ], "license": "ISC", - "main": "stringify.js", - "name": "json-stringify-safe", "repository": { "type": "git", - "url": "git://github.com/isaacs/json-stringify-safe.git" + "url": "git://github.com/isaacs/json-stringify-safe" }, + "main": "stringify.js", "scripts": { "test": "node test.js" }, - "version": "5.0.1" + "devDependencies": { + "mocha": ">= 2.1.0 < 3", + "must": ">= 0.12 < 0.13", + "sinon": ">= 1.12.2 < 2" + } } diff --git a/deps/npm/node_modules/jsonparse/package.json b/deps/npm/node_modules/jsonparse/package.json index b4136f11e6ebc2..a2312ee094ca26 100644 --- a/deps/npm/node_modules/jsonparse/package.json +++ b/deps/npm/node_modules/jsonparse/package.json @@ -1,58 +1,22 @@ { - "_from": "jsonparse@^1.2.0", - "_id": "jsonparse@1.3.1", - "_inBundle": false, - "_integrity": "sha1-P02uSpH6wxX3EGL4UhzCOfE2YoA=", - "_location": "/jsonparse", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "jsonparse@^1.2.0", - "name": "jsonparse", - "escapedName": "jsonparse", - "rawSpec": "^1.2.0", - "saveSpec": null, - "fetchSpec": "^1.2.0" - }, - "_requiredBy": [ - "/JSONStream" - ], - "_resolved": "https://registry.npmjs.org/jsonparse/-/jsonparse-1.3.1.tgz", - "_shasum": "3f4dae4a91fac315f71062f8521cc239f1366280", - "_spec": "jsonparse@^1.2.0", - "_where": "/Users/rebecca/code/npm/node_modules/JSONStream", - "author": { - "name": "Tim Caswell", - "email": "tim@creationix.com" - }, - "bugs": { - "url": "http://github.com/creationix/jsonparse/issues" - }, - "bundleDependencies": false, - "deprecated": false, - "description": "This is a pure-js JSON streaming parser for node.js", - "devDependencies": { - "tap": "~0.3.3", - "tape": "~0.1.1" - }, - "engines": [ - "node >= 0.2.0" - ], - "homepage": "https://github.com/creationix/jsonparse#readme", - "license": "MIT", - "main": "jsonparse.js", "name": "jsonparse", + "description": "This is a pure-js JSON streaming parser for node.js", + "tags": ["json", "stream"], + "version": "1.3.1", + "author": "Tim Caswell ", "repository": { "type": "git", - "url": "git+ssh://git@github.com/creationix/jsonparse.git" + "url": "http://github.com/creationix/jsonparse.git" + }, + "devDependencies": { + "tape": "~0.1.1", + "tap": "~0.3.3" }, "scripts": { "test": "tap test/*.js" }, - "tags": [ - "json", - "stream" - ], - "version": "1.3.1" + "bugs": "http://github.com/creationix/jsonparse/issues", + "engines": ["node >= 0.2.0"], + "license": "MIT", + "main": "jsonparse.js" } diff --git a/deps/npm/node_modules/jsprim/CONTRIBUTING.md b/deps/npm/node_modules/jsprim/CONTRIBUTING.md new file mode 100644 index 00000000000000..750cef8dfd54a6 --- /dev/null +++ b/deps/npm/node_modules/jsprim/CONTRIBUTING.md @@ -0,0 +1,19 @@ +# Contributing + +This repository uses [cr.joyent.us](https://cr.joyent.us) (Gerrit) for new +changes. Anyone can submit changes. To get started, see the [cr.joyent.us user +guide](https://github.com/joyent/joyent-gerrit/blob/master/docs/user/README.md). +This repo does not use GitHub pull requests. + +See the [Joyent Engineering +Guidelines](https://github.com/joyent/eng/blob/master/docs/index.md) for general +best practices expected in this repository. + +Contributions should be "make prepush" clean. The "prepush" target runs the +"check" target, which requires these separate tools: + +* https://github.com/davepacheco/jsstyle +* https://github.com/davepacheco/javascriptlint + +If you're changing something non-trivial or user-facing, you may want to submit +an issue first. diff --git a/deps/npm/node_modules/jsprim/package.json b/deps/npm/node_modules/jsprim/package.json index d83416b2f510a5..25345ee04964cd 100644 --- a/deps/npm/node_modules/jsprim/package.json +++ b/deps/npm/node_modules/jsprim/package.json @@ -1,49 +1,20 @@ { - "_from": "jsprim@^1.2.2", - "_id": "jsprim@1.4.1", - "_inBundle": false, - "_integrity": "sha1-MT5mvB5cwG5Di8G3SZwuXFastqI=", - "_location": "/jsprim", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "jsprim@^1.2.2", - "name": "jsprim", - "escapedName": "jsprim", - "rawSpec": "^1.2.2", - "saveSpec": null, - "fetchSpec": "^1.2.2" - }, - "_requiredBy": [ - "/http-signature" - ], - "_resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.1.tgz", - "_shasum": "313e66bc1e5cc06e438bc1b7499c2e5c56acb6a2", - "_spec": "jsprim@^1.2.2", - "_where": "/Users/rebecca/code/npm/node_modules/http-signature", - "bugs": { - "url": "https://github.com/joyent/node-jsprim/issues" - }, - "bundleDependencies": false, - "dependencies": { - "assert-plus": "1.0.0", - "extsprintf": "1.3.0", - "json-schema": "0.2.3", - "verror": "1.10.0" - }, - "deprecated": false, - "description": "utilities for primitive JavaScript types", - "engines": [ - "node >=0.6.0" - ], - "homepage": "https://github.com/joyent/node-jsprim#readme", - "license": "MIT", - "main": "./lib/jsprim.js", - "name": "jsprim", - "repository": { - "type": "git", - "url": "git://github.com/joyent/node-jsprim.git" - }, - "version": "1.4.1" + "name": "jsprim", + "version": "1.4.1", + "description": "utilities for primitive JavaScript types", + "main": "./lib/jsprim.js", + "repository": { + "type": "git", + "url": "git://github.com/joyent/node-jsprim.git" + }, + "dependencies": { + "assert-plus": "1.0.0", + "extsprintf": "1.3.0", + "json-schema": "0.2.3", + "verror": "1.10.0" + }, + "engines": [ + "node >=0.6.0" + ], + "license": "MIT" } diff --git a/deps/npm/node_modules/just-diff-apply/LICENSE b/deps/npm/node_modules/just-diff-apply/LICENSE new file mode 100644 index 00000000000000..5d2c6e577af72c --- /dev/null +++ b/deps/npm/node_modules/just-diff-apply/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2016 angus croll + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/deps/npm/node_modules/just-diff-apply/README.md b/deps/npm/node_modules/just-diff-apply/README.md new file mode 100644 index 00000000000000..2068a483062b7a --- /dev/null +++ b/deps/npm/node_modules/just-diff-apply/README.md @@ -0,0 +1,52 @@ +## just-diff-apply + +Part of a [library](../../../../) of zero-dependency npm modules that do just do one thing. +Guilt-free utilities for every occasion. + +[Try it now](http://anguscroll.com/just/just-diff-apply) + +Apply a diff object to an object. +Pass converter to apply a http://jsonpatch.com standard patch + +```js + import diffApply from 'just-diff-apply'; + + const obj1 = {a: 3, b: 5}; + diffApply(obj1, + [ + { "op": "remove", "path": ['b'] }, + { "op": "replace", "path": ['a'], "value": 4 }, + { "op": "add", "path": ['c'], "value": 5 } + ] + ); + obj1; // {a: 4, c: 5} + + // using converter to apply jsPatch standard paths + // see http://jsonpatch.com + import {diffApply, jsonPatchPathConverter} from 'just-diff-apply' + const obj2 = {a: 3, b: 5}; + diffApply(obj2, [ + { "op": "remove", "path": '/b' }, + { "op": "replace", "path": '/a', "value": 4 } + { "op": "add", "path": '/c', "value": 5 } + ], jsonPatchPathConverter); + obj2; // {a: 4, c: 5} + + // arrays (array key can be string or numeric) + const obj3 = {a: 4, b: [1, 2, 3]}; + diffApply(obj3, [ + { "op": "replace", "path": ['a'], "value": 3 } + { "op": "replace", "path": ['b', 2], "value": 4 } + { "op": "add", "path": ['b', 3], "value": 9 } + ]); + obj3; // {a: 3, b: [1, 2, 4, 9]} + + // nested paths + const obj4 = {a: 4, b: {c: 3}}; + diffApply(obj4, [ + { "op": "replace", "path": ['a'], "value": 5 } + { "op": "remove", "path": ['b', 'c']} + { "op": "add", "path": ['b', 'd'], "value": 4 } + ]); + obj4; // {a: 5, b: {d: 4}} +``` diff --git a/deps/npm/node_modules/just-diff-apply/index.js b/deps/npm/node_modules/just-diff-apply/index.js new file mode 100644 index 00000000000000..ceb32681172a8a --- /dev/null +++ b/deps/npm/node_modules/just-diff-apply/index.js @@ -0,0 +1,105 @@ +module.exports = { + diffApply: diffApply, + jsonPatchPathConverter: jsonPatchPathConverter, +}; + +/* + const obj1 = {a: 3, b: 5}; + diffApply(obj1, + [ + { "op": "remove", "path": ['b'] }, + { "op": "replace", "path": ['a'], "value": 4 }, + { "op": "add", "path": ['c'], "value": 5 } + ] + ); + obj1; // {a: 4, c: 5} + + // using converter to apply jsPatch standard paths + // see http://jsonpatch.com + import {diff, jsonPatchPathConverter} from 'just-diff' + const obj2 = {a: 3, b: 5}; + diffApply(obj2, [ + { "op": "remove", "path": '/b' }, + { "op": "replace", "path": '/a', "value": 4 } + { "op": "add", "path": '/c', "value": 5 } + ], jsonPatchPathConverter); + obj2; // {a: 4, c: 5} + + // arrays + const obj3 = {a: 4, b: [1, 2, 3]}; + diffApply(obj3, [ + { "op": "replace", "path": ['a'], "value": 3 } + { "op": "replace", "path": ['b', 2], "value": 4 } + { "op": "add", "path": ['b', 3], "value": 9 } + ]); + obj3; // {a: 3, b: [1, 2, 4, 9]} + + // nested paths + const obj4 = {a: 4, b: {c: 3}}; + diffApply(obj4, [ + { "op": "replace", "path": ['a'], "value": 5 } + { "op": "remove", "path": ['b', 'c']} + { "op": "add", "path": ['b', 'd'], "value": 4 } + ]); + obj4; // {a: 5, b: {d: 4}} +*/ + +var REMOVE = 'remove'; +var REPLACE = 'replace'; +var ADD = 'add'; + +function diffApply(obj, diff, pathConverter) { + if (!obj || typeof obj != 'object') { + throw new Error('base object must be an object or an array'); + } + + if (!Array.isArray(diff)) { + throw new Error('diff must be an array'); + } + + var diffLength = diff.length; + for (var i = 0; i < diffLength; i++) { + var thisDiff = diff[i]; + var subObject = obj; + var thisOp = thisDiff.op; + var thisPath = thisDiff.path; + if (pathConverter) { + thisPath = pathConverter(thisPath); + if (!Array.isArray(thisPath)) { + throw new Error('pathConverter must return an array'); + } + } else { + if (!Array.isArray(thisPath)) { + throw new Error('diff path must be an array, consider supplying a path converter'); + } + } + var pathCopy = thisPath.slice(); + var lastProp = pathCopy.pop(); + if (lastProp == null) { + return false; + } + var thisProp; + while (((thisProp = pathCopy.shift())) != null) { + if (!(thisProp in subObject)) { + subObject[thisProp] = {}; + } + subObject = subObject[thisProp]; + } + if (thisOp === REMOVE || thisOp === REPLACE) { + if (!subObject.hasOwnProperty(lastProp)) { + throw new Error(['expected to find property', thisDiff.path, 'in object', obj].join(' ')); + } + } + if (thisOp === REMOVE) { + Array.isArray(subObject) ? subObject.splice(lastProp, 1) : delete subObject[lastProp]; + } + if (thisOp === REPLACE || thisOp === ADD) { + subObject[lastProp] = thisDiff.value; + } + } + return subObject; +} + +function jsonPatchPathConverter(stringPath) { + return stringPath.split('/').slice(1); +} diff --git a/deps/npm/node_modules/just-diff-apply/package.json b/deps/npm/node_modules/just-diff-apply/package.json new file mode 100644 index 00000000000000..a5cc8a1feee9ec --- /dev/null +++ b/deps/npm/node_modules/just-diff-apply/package.json @@ -0,0 +1,23 @@ +{ + "name": "just-diff-apply", + "version": "3.0.0", + "description": "Apply a diff to an object. Optionally supports jsonPatch protocol", + "main": "index.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "repository": "https://github.com/angus-c/just", + "keywords": [ + "object", + "diff", + "apply", + "jsonPatch", + "no-dependencies", + "just" + ], + "author": "Angus Croll", + "license": "MIT", + "bugs": { + "url": "https://github.com/angus-c/just/issues" + } +} diff --git a/deps/npm/node_modules/just-diff/LICENSE b/deps/npm/node_modules/just-diff/LICENSE new file mode 100644 index 00000000000000..5d2c6e577af72c --- /dev/null +++ b/deps/npm/node_modules/just-diff/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2016 angus croll + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/deps/npm/node_modules/just-diff/README.md b/deps/npm/node_modules/just-diff/README.md new file mode 100644 index 00000000000000..f33a8cd8290648 --- /dev/null +++ b/deps/npm/node_modules/just-diff/README.md @@ -0,0 +1,76 @@ +## just-diff + +Part of a [library](../../../../) of zero-dependency npm modules that do just do one thing. +Guilt-free utilities for every occasion. + +[Try it now](http://anguscroll.com/just/just-diff) + +Return an object representing the difference between two other objects +Pass converter to format as http://jsonpatch.com + +```js +import {diff} from 'just-diff'; + +const obj1 = {a: 4, b: 5}; +const obj2 = {a: 3, b: 5}; +const obj3 = {a: 4, c: 5}; + +diff(obj1, obj2); +[ + { "op": "replace", "path": ['a'], "value": 3 } +] + +diff(obj2, obj3); +[ + { "op": "remove", "path": ['b'] }, + { "op": "replace", "path": ['a'], "value": 4 } + { "op": "add", "path": ['c'], "value": 5 } +] + +// using converter to generate jsPatch standard paths +import {diff, jsonPatchPathConverter} from 'just-diff' +diff(obj1, obj2, jsonPatchPathConverter); +[ + { "op": "replace", "path": '/a', "value": 3 } +] + +diff(obj2, obj3, jsonPatchPathConverter); +[ + { "op": "remove", "path": '/b' }, + { "op": "replace", "path": '/a', "value": 4 } + { "op": "add", "path": '/c', "value": 5 } +] + +// arrays +const obj4 = {a: 4, b: [1, 2, 3]}; +const obj5 = {a: 3, b: [1, 2, 4]}; +const obj6 = {a: 3, b: [1, 2, 4, 5]}; + +diff(obj4, obj5); +[ + { "op": "replace", "path": ['a'], "value": 3 } + { "op": "replace", "path": ['b', 2], "value": 4 } +] + +diff(obj5, obj6); +[ + { "op": "add", "path": ['b', 3], "value": 5 } +] + +// nested paths +const obj7 = {a: 4, b: {c: 3}}; +const obj8 = {a: 4, b: {c: 4}}; +const obj9 = {a: 5, b: {d: 4}}; + +diff(obj7, obj8); +[ + { "op": "replace", "path": ['b', 'c'], "value": 4 } +] + +diff(obj8, obj9); +[ + { "op": "replace", "path": ['a'], "value": 5 } + { "op": "remove", "path": ['b', 'c']} + { "op": "add", "path": ['b', 'd'], "value": 4 } +] +``` diff --git a/deps/npm/node_modules/just-diff/index.js b/deps/npm/node_modules/just-diff/index.js new file mode 100644 index 00000000000000..b49bed14662e03 --- /dev/null +++ b/deps/npm/node_modules/just-diff/index.js @@ -0,0 +1,152 @@ +module.exports = { + diff: diff, + jsonPatchPathConverter: jsonPatchPathConverter, +}; + +/* + const obj1 = {a: 4, b: 5}; + const obj2 = {a: 3, b: 5}; + const obj3 = {a: 4, c: 5}; + + diff(obj1, obj2); + [ + { "op": "replace", "path": ['a'], "value": 3 } + ] + + diff(obj2, obj3); + [ + { "op": "remove", "path": ['b'] }, + { "op": "replace", "path": ['a'], "value": 4 } + { "op": "add", "path": ['c'], "value": 5 } + ] + + // using converter to generate jsPatch standard paths + // see http://jsonpatch.com + import {diff, jsonPatchPathConverter} from 'just-diff' + diff(obj1, obj2, jsonPatchPathConverter); + [ + { "op": "replace", "path": '/a', "value": 3 } + ] + + diff(obj2, obj3, jsonPatchPathConverter); + [ + { "op": "remove", "path": '/b' }, + { "op": "replace", "path": '/a', "value": 4 } + { "op": "add", "path": '/c', "value": 5 } + ] + + // arrays + const obj4 = {a: 4, b: [1, 2, 3]}; + const obj5 = {a: 3, b: [1, 2, 4]}; + const obj6 = {a: 3, b: [1, 2, 4, 5]}; + + diff(obj4, obj5); + [ + { "op": "replace", "path": ['a'], "value": 3 } + { "op": "replace", "path": ['b', 2], "value": 4 } + ] + + diff(obj5, obj6); + [ + { "op": "add", "path": ['b', 3], "value": 5 } + ] + + // nested paths + const obj7 = {a: 4, b: {c: 3}}; + const obj8 = {a: 4, b: {c: 4}}; + const obj9 = {a: 5, b: {d: 4}}; + + diff(obj7, obj8); + [ + { "op": "replace", "path": ['b', 'c'], "value": 4 } + ] + + diff(obj8, obj9); + [ + { "op": "replace", "path": ['a'], "value": 5 } + { "op": "remove", "path": ['b', 'c']} + { "op": "add", "path": ['b', 'd'], "value": 4 } + ] +*/ + +function diff(obj1, obj2, pathConverter) { + if (!obj1 || typeof obj1 != 'object' || !obj2 || typeof obj2 != 'object') { + throw new Error('both arguments must be objects or arrays'); + } + + pathConverter || + (pathConverter = function(arr) { + return arr; + }); + + function getDiff(obj1, obj2, basePath, diffs) { + var obj1Keys = Object.keys(obj1); + var obj1KeysLength = obj1Keys.length; + var obj2Keys = Object.keys(obj2); + var obj2KeysLength = obj2Keys.length; + var path; + + for (var i = 0; i < obj1KeysLength; i++) { + var key = Array.isArray(obj1) ? Number(obj1Keys[i]) : obj1Keys[i]; + if (!(key in obj2)) { + path = basePath.concat(key); + diffs.remove.push({ + op: 'remove', + path: pathConverter(path), + }); + } + } + + for (var i = 0; i < obj2KeysLength; i++) { + var key = Array.isArray(obj2) ? Number(obj2Keys[i]) : obj2Keys[i]; + var obj1AtKey = obj1[key]; + var obj2AtKey = obj2[key]; + if (!(key in obj1)) { + path = basePath.concat(key); + var obj2Value = obj2[key]; + diffs.add.push({ + op: 'add', + path: pathConverter(path), + value: obj2Value, + }); + } else if (obj1AtKey !== obj2AtKey) { + if ( + Object(obj1AtKey) !== obj1AtKey || + Object(obj2AtKey) !== obj2AtKey + ) { + path = pushReplace(path, basePath, key, diffs, pathConverter, obj2); + } else { + if ( + !Object.keys(obj1AtKey).length && + !Object.keys(obj2AtKey).length && + String(obj1AtKey) != String(obj2AtKey) + ) { + path = pushReplace(path, basePath, key, diffs, pathConverter, obj2); + } else { + getDiff(obj1[key], obj2[key], basePath.concat(key), diffs); + } + } + } + } + + return diffs.remove + .reverse() + .concat(diffs.replace) + .concat(diffs.add); + } + return getDiff(obj1, obj2, [], {remove: [], replace: [], add: []}); +} + +function pushReplace(path, basePath, key, diffs, pathConverter, obj2) { + path = basePath.concat(key); + diffs.replace.push({ + op: 'replace', + path: pathConverter(path), + value: obj2[key], + }); + return path; +} + +function jsonPatchPathConverter(arrayPath) { + return [''].concat(arrayPath).join('/'); +} diff --git a/deps/npm/node_modules/just-diff/package.json b/deps/npm/node_modules/just-diff/package.json new file mode 100644 index 00000000000000..dbe3aa2ba9ceab --- /dev/null +++ b/deps/npm/node_modules/just-diff/package.json @@ -0,0 +1,22 @@ +{ + "name": "just-diff", + "version": "3.0.2", + "description": "Return an object representing the diffs between two objects. Supports jsonPatch protocol", + "main": "index.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "repository": "https://github.com/angus-c/just", + "keywords": [ + "object", + "diff", + "jsonPatch", + "no-dependencies", + "just" + ], + "author": "Angus Croll", + "license": "MIT", + "bugs": { + "url": "https://github.com/angus-c/just/issues" + } +} diff --git a/deps/npm/node_modules/latest-version/index.js b/deps/npm/node_modules/latest-version/index.js deleted file mode 100644 index bfb79d1c5126a9..00000000000000 --- a/deps/npm/node_modules/latest-version/index.js +++ /dev/null @@ -1,4 +0,0 @@ -'use strict'; -const packageJson = require('package-json'); - -module.exports = name => packageJson(name.toLowerCase()).then(data => data.version); diff --git a/deps/npm/node_modules/latest-version/license b/deps/npm/node_modules/latest-version/license deleted file mode 100644 index 654d0bfe943437..00000000000000 --- a/deps/npm/node_modules/latest-version/license +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -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/deps/npm/node_modules/latest-version/package.json b/deps/npm/node_modules/latest-version/package.json deleted file mode 100644 index 1f663b9867f5aa..00000000000000 --- a/deps/npm/node_modules/latest-version/package.json +++ /dev/null @@ -1,71 +0,0 @@ -{ - "_from": "latest-version@^3.0.0", - "_id": "latest-version@3.1.0", - "_inBundle": false, - "_integrity": "sha1-ogU4P+oyKzO1rjsYq+4NwvNW7hU=", - "_location": "/latest-version", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "latest-version@^3.0.0", - "name": "latest-version", - "escapedName": "latest-version", - "rawSpec": "^3.0.0", - "saveSpec": null, - "fetchSpec": "^3.0.0" - }, - "_requiredBy": [ - "/update-notifier" - ], - "_resolved": "https://registry.npmjs.org/latest-version/-/latest-version-3.1.0.tgz", - "_shasum": "a205383fea322b33b5ae3b18abee0dc2f356ee15", - "_spec": "latest-version@^3.0.0", - "_where": "/Users/rebecca/code/npm/node_modules/update-notifier", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "bugs": { - "url": "https://github.com/sindresorhus/latest-version/issues" - }, - "bundleDependencies": false, - "dependencies": { - "package-json": "^4.0.0" - }, - "deprecated": false, - "description": "Get the latest version of an npm package", - "devDependencies": { - "ava": "*", - "semver-regex": "^1.0.0", - "xo": "*" - }, - "engines": { - "node": ">=4" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/sindresorhus/latest-version#readme", - "keywords": [ - "latest", - "version", - "npm", - "pkg", - "package", - "package.json", - "current", - "module" - ], - "license": "MIT", - "name": "latest-version", - "repository": { - "type": "git", - "url": "git+https://github.com/sindresorhus/latest-version.git" - }, - "scripts": { - "test": "xo && ava" - }, - "version": "3.1.0" -} diff --git a/deps/npm/node_modules/latest-version/readme.md b/deps/npm/node_modules/latest-version/readme.md deleted file mode 100644 index 3fcffdd0d1548d..00000000000000 --- a/deps/npm/node_modules/latest-version/readme.md +++ /dev/null @@ -1,40 +0,0 @@ -# latest-version [![Build Status](https://travis-ci.org/sindresorhus/latest-version.svg?branch=master)](https://travis-ci.org/sindresorhus/latest-version) - -> Get the latest version of an npm package - -Fetches the version directly from the registry instead of depending on the massive [npm](https://github.com/npm/npm/blob/8b5e7b6ae5b4cd2d7d62eaf93b1428638b387072/package.json#L37-L85) module like the [latest](https://github.com/bahamas10/node-latest) module does. - - -## Install - -``` -$ npm install --save latest-version -``` - - -## Usage - -```js -const latestVersion = require('latest-version'); - -latestVersion('ava').then(version => { - console.log(version); - //=> '0.18.0' -}); - -latestVersion('@sindresorhus/df').then(version => { - console.log(version); - //=> '1.0.1' -}); -``` - - -## Related - -- [latest-version-cli](https://github.com/sindresorhus/latest-version-cli) - CLI for this module -- [package-json](https://github.com/sindresorhus/package-json) - Get the package.json of a package from the npm registry - - -## License - -MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/deps/npm/node_modules/lazy-property/.npmignore b/deps/npm/node_modules/lazy-property/.npmignore deleted file mode 100644 index 038e0242ebf828..00000000000000 --- a/deps/npm/node_modules/lazy-property/.npmignore +++ /dev/null @@ -1,16 +0,0 @@ -lib-cov -*.seed -*.log -*.csv -*.dat -*.out -*.pid -*.gz - -pids -logs -results - -npm-debug.log -node_modules/* -test/* \ No newline at end of file diff --git a/deps/npm/node_modules/lazy-property/LICENSE b/deps/npm/node_modules/lazy-property/LICENSE deleted file mode 100644 index 8ce206a84544ae..00000000000000 --- a/deps/npm/node_modules/lazy-property/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ - -The MIT License (MIT) - -Copyright (c) 2013 Mikola Lysenko - -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/lazy-property/README.md b/deps/npm/node_modules/lazy-property/README.md deleted file mode 100644 index d339c8f460e73b..00000000000000 --- a/deps/npm/node_modules/lazy-property/README.md +++ /dev/null @@ -1,44 +0,0 @@ -lazy-property -============= -Adds a lazily initialized property to an object. - -## Example - -```javascript -var addLazyProperty = require("lazy-property") - -var obj = {} - -addLazyProperty(obj, "foo", function() { - console.log("initialized!") - return "bar" -}) - -//Access the property -console.log(obj.foo) -console.log(obj.foo) - -//Prints out: -// -// initialized! -// bar -// bar -// -``` - -## Install - - npm install lazy-property - -## API - -### `require("lazy-property")(obj, name, init[, enumerable])` -Adds a lazily initialized property to the object. - -* `obj` is the object to add the property to -* `name` is the name of the property -* `init` is a function that computes the value of the property -* `enumerable` if the property is enumerable (default `false`) - -## Credits -(c) 2013 Mikola Lysenko. MIT License diff --git a/deps/npm/node_modules/lazy-property/component.json b/deps/npm/node_modules/lazy-property/component.json deleted file mode 100644 index 142938e496837b..00000000000000 --- a/deps/npm/node_modules/lazy-property/component.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": "lazy-property", - "version": "0.0.2", - "description": "Lazily initialized properties for objects", - "main": "lazyProperty.js", - "scripts": ["lazyProperty.js"] -} diff --git a/deps/npm/node_modules/lazy-property/lazyProperty.js b/deps/npm/node_modules/lazy-property/lazyProperty.js deleted file mode 100644 index 20e5fe191295bc..00000000000000 --- a/deps/npm/node_modules/lazy-property/lazyProperty.js +++ /dev/null @@ -1,19 +0,0 @@ -"use strict" - -function addLazyProperty(object, name, initializer, enumerable) { - Object.defineProperty(object, name, { - get: function() { - var v = initializer.call(this) - Object.defineProperty(this, name, { value: v, enumerable: !!enumerable, writable: true }) - return v - }, - set: function(v) { - Object.defineProperty(this, name, { value: v, enumerable: !!enumerable, writable: true }) - return v - }, - enumerable: !!enumerable, - configurable: true - }) -} - -module.exports = addLazyProperty diff --git a/deps/npm/node_modules/lazy-property/package.json b/deps/npm/node_modules/lazy-property/package.json deleted file mode 100644 index 3c36554297e8dc..00000000000000 --- a/deps/npm/node_modules/lazy-property/package.json +++ /dev/null @@ -1,65 +0,0 @@ -{ - "_args": [ - [ - "lazy-property@1.0.0", - "/Users/rebecca/code/npm" - ] - ], - "_from": "lazy-property@1.0.0", - "_id": "lazy-property@1.0.0", - "_inBundle": false, - "_integrity": "sha1-hN3Es3Bnm6i9TNz6TAa0PVcREUc=", - "_location": "/lazy-property", - "_phantomChildren": {}, - "_requested": { - "type": "version", - "registry": true, - "raw": "lazy-property@1.0.0", - "name": "lazy-property", - "escapedName": "lazy-property", - "rawSpec": "1.0.0", - "saveSpec": null, - "fetchSpec": "1.0.0" - }, - "_requiredBy": [ - "/" - ], - "_resolved": "https://registry.npmjs.org/lazy-property/-/lazy-property-1.0.0.tgz", - "_spec": "1.0.0", - "_where": "/Users/rebecca/code/npm", - "author": { - "name": "Mikola Lysenko" - }, - "bugs": { - "url": "https://github.com/mikolalysenko/lazy-property/issues" - }, - "dependencies": {}, - "description": "Lazily initialized properties for objects", - "devDependencies": { - "tape": "^2.12.3" - }, - "directories": { - "test": "test" - }, - "gitHead": "850a27f710ec72f05b534805c31f095ff590f1ea", - "homepage": "https://github.com/mikolalysenko/lazy-property#readme", - "keywords": [ - "lazy", - "property", - "object", - "initialize", - "array", - "dictionary" - ], - "license": "MIT", - "main": "lazyProperty.js", - "name": "lazy-property", - "repository": { - "type": "git", - "url": "git://github.com/mikolalysenko/lazy-property.git" - }, - "scripts": { - "test": "tape test/*.js" - }, - "version": "1.0.0" -} diff --git a/deps/npm/node_modules/leven/index.d.ts b/deps/npm/node_modules/leven/index.d.ts new file mode 100644 index 00000000000000..571833ae44b7d6 --- /dev/null +++ b/deps/npm/node_modules/leven/index.d.ts @@ -0,0 +1,21 @@ +declare const leven: { + /** + Measure the difference between two strings. + + @example + ``` + import leven = require('leven'); + + leven('cat', 'cow'); + //=> 2 + ``` + */ + (left: string, right: string): number; + + // TODO: Remove this for the next major release, refactor the whole definition to: + // declare function leven(left: string, right: string): number; + // export = leven; + default: typeof leven; +}; + +export = leven; diff --git a/deps/npm/node_modules/leven/index.js b/deps/npm/node_modules/leven/index.js new file mode 100644 index 00000000000000..25f5a3d5c8bd4d --- /dev/null +++ b/deps/npm/node_modules/leven/index.js @@ -0,0 +1,77 @@ +'use strict'; +const array = []; +const charCodeCache = []; + +const leven = (left, right) => { + if (left === right) { + return 0; + } + + const swap = left; + + // Swapping the strings if `a` is longer than `b` so we know which one is the + // shortest & which one is the longest + if (left.length > right.length) { + left = right; + right = swap; + } + + let leftLength = left.length; + let rightLength = right.length; + + // Performing suffix trimming: + // We can linearly drop suffix common to both strings since they + // don't increase distance at all + // Note: `~-` is the bitwise way to perform a `- 1` operation + while (leftLength > 0 && (left.charCodeAt(~-leftLength) === right.charCodeAt(~-rightLength))) { + leftLength--; + rightLength--; + } + + // Performing prefix trimming + // We can linearly drop prefix common to both strings since they + // don't increase distance at all + let start = 0; + + while (start < leftLength && (left.charCodeAt(start) === right.charCodeAt(start))) { + start++; + } + + leftLength -= start; + rightLength -= start; + + if (leftLength === 0) { + return rightLength; + } + + let bCharCode; + let result; + let temp; + let temp2; + let i = 0; + let j = 0; + + while (i < leftLength) { + charCodeCache[i] = left.charCodeAt(start + i); + array[i] = ++i; + } + + while (j < rightLength) { + bCharCode = right.charCodeAt(start + j); + temp = j++; + result = j; + + for (i = 0; i < leftLength; i++) { + temp2 = bCharCode === charCodeCache[i] ? temp : temp + 1; + temp = array[i]; + // eslint-disable-next-line no-multi-assign + result = array[i] = temp > result ? temp2 > result ? result + 1 : temp2 : temp2 > temp ? temp + 1 : temp2; + } + } + + return result; +}; + +module.exports = leven; +// TODO: Remove this for the next major release +module.exports.default = leven; diff --git a/deps/npm/node_modules/is-installed-globally/license b/deps/npm/node_modules/leven/license similarity index 100% rename from deps/npm/node_modules/is-installed-globally/license rename to deps/npm/node_modules/leven/license diff --git a/deps/npm/node_modules/leven/package.json b/deps/npm/node_modules/leven/package.json new file mode 100644 index 00000000000000..e1b3d8ee0cb25a --- /dev/null +++ b/deps/npm/node_modules/leven/package.json @@ -0,0 +1,57 @@ +{ + "name": "leven", + "version": "3.1.0", + "description": "Measure the difference between two strings using the fastest JS implementation of the Levenshtein distance algorithm", + "license": "MIT", + "repository": "sindresorhus/leven", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "engines": { + "node": ">=6" + }, + "scripts": { + "test": "xo && ava && tsd", + "bench": "matcha bench.js" + }, + "files": [ + "index.js", + "index.d.ts" + ], + "keywords": [ + "leven", + "levenshtein", + "distance", + "algorithm", + "algo", + "string", + "difference", + "diff", + "fast", + "fuzzy", + "similar", + "similarity", + "compare", + "comparison", + "edit", + "text", + "match", + "matching" + ], + "devDependencies": { + "ava": "^1.4.1", + "fast-levenshtein": "^2.0.6", + "ld": "^0.1.0", + "levdist": "^2.2.9", + "levenshtein": "^1.0.5", + "levenshtein-component": "^0.0.1", + "levenshtein-edit-distance": "^2.0.3", + "matcha": "^0.7.0", + "natural": "^0.6.3", + "talisman": "^0.21.0", + "tsd": "^0.7.2", + "xo": "^0.24.0" + } +} diff --git a/deps/npm/node_modules/leven/readme.md b/deps/npm/node_modules/leven/readme.md new file mode 100644 index 00000000000000..33625c46f00595 --- /dev/null +++ b/deps/npm/node_modules/leven/readme.md @@ -0,0 +1,50 @@ +# leven [![Build Status](https://travis-ci.org/sindresorhus/leven.svg?branch=master)](https://travis-ci.org/sindresorhus/leven) + +> Measure the difference between two strings
    +> One of the fastest JS implementations of the [Levenshtein distance](https://en.wikipedia.org/wiki/Levenshtein_distance) algorithm + + +## Install + +``` +$ npm install leven +``` + + +## Usage + +```js +const leven = require('leven'); + +leven('cat', 'cow'); +//=> 2 +``` + + +## Benchmark + +``` +$ npm run bench +``` + +``` + 165,926 op/s » leven + 164,398 op/s » talisman + 1,044 op/s » levenshtein-edit-distance + 628 op/s » fast-levenshtein + 497 op/s » levenshtein-component + 195 op/s » ld + 190 op/s » levenshtein + 168 op/s » levdist + 10 op/s » natural +``` + + +## Related + +- [leven-cli](https://github.com/sindresorhus/leven-cli) - CLI for this module + + +## License + +MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/deps/npm/node_modules/libcipm/CHANGELOG.md b/deps/npm/node_modules/libcipm/CHANGELOG.md deleted file mode 100644 index 985d6df39e5f76..00000000000000 --- a/deps/npm/node_modules/libcipm/CHANGELOG.md +++ /dev/null @@ -1,518 +0,0 @@ -# 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. - - -## [4.0.8](https://github.com/npm/libcipm/compare/v4.0.7...v4.0.8) (2020-03-25) - - -### Bug Fixes - -* add repo to bin pkg, bump to 2.0.1 ([ed2d735](https://github.com/npm/libcipm/commit/ed2d735)) - - - - -## [4.0.7](https://github.com/npm/libcipm/compare/v4.0.4...v4.0.7) (2019-10-09) - - -### Bug Fixes - -* delete node_modules contents but keep the dir itself ([f668181](https://github.com/npm/libcipm/commit/f668181)), closes [#3](https://github.com/npm/libcipm/issues/3) - - -## [4.0.4](https://github.com/npm/libcipm/compare/v4.0.3...v4.0.4) (2019-09-24) - - -### Bug Fixes - -* pack git directories properly ([576ab36](https://github.com/npm/libcipm/commit/576ab36)), closes [#4](https://github.com/npm/libcipm/issues/4) - - - - -## [4.0.3](https://github.com/npm/libcipm/compare/v4.0.2...v4.0.3) (2019-08-12) - - -### Bug Fixes - -* do not pass opts.log to lifecycle ([46b2101](https://github.com/npm/libcipm/commit/46b2101)) - - - - -## [4.0.2](https://github.com/npm/libcipm/compare/v4.0.1...v4.0.2) (2019-08-12) - - - - -## [4.0.1](https://github.com/npm/libcipm/compare/v4.0.0...v4.0.1) (2019-08-12) - - -### Bug Fixes - -* respect and retain all configs passed in ([20b7372](https://github.com/npm/libcipm/commit/20b7372)) - - - - -# [4.0.0](https://github.com/npm/libcipm/compare/v3.0.3...v4.0.0) (2019-07-10) - - -* npm-lifecycle@3.0.0 ([84b8d7e](https://github.com/npm/libcipm/commit/84b8d7e)) - - -### Bug Fixes - -* **lifecycle:** remove warning from bluebird ([#59](https://github.com/npm/libcipm/issues/59)) ([7af39e6](https://github.com/npm/libcipm/commit/7af39e6)), closes [#58](https://github.com/npm/libcipm/issues/58) - - -### BREAKING CHANGES - -* requires updating node-gyp in npm/cli - - - - -## [3.0.3](https://github.com/npm/libcipm/compare/v3.0.2...v3.0.3) (2019-01-22) - - -### Bug Fixes - -* **scripts:** pass in opts.dir directly ([018df27](https://github.com/npm/libcipm/commit/018df27)) - - - - -## [3.0.2](https://github.com/npm/libcipm/compare/v3.0.1...v3.0.2) (2018-08-31) - - -### Bug Fixes - -* **worker:** missed a spot ([4371558](https://github.com/npm/libcipm/commit/4371558)) - - - - -## [3.0.1](https://github.com/npm/libcipm/compare/v3.0.0...v3.0.1) (2018-08-31) - - -### Bug Fixes - -* **workers:** disable workers for now ([64db490](https://github.com/npm/libcipm/commit/64db490)) - - - - -# [3.0.0](https://github.com/npm/libcipm/compare/v2.0.2...v3.0.0) (2018-08-31) - - -### Features - -* **config:** switch to modern, figgy-pudding configuration ([#57](https://github.com/npm/libcipm/issues/57)) ([161f6b2](https://github.com/npm/libcipm/commit/161f6b2)) - - -### BREAKING CHANGES - -* **config:** this updates cipm to use pacote@9, which consumes npm-style config objects, not pacoteOpts()-style objects. - - - - -## [2.0.2](https://github.com/npm/libcipm/compare/v2.0.1...v2.0.2) (2018-08-10) - - -### Bug Fixes - -* **child:** only override dirPacker if opts.dirPacker is defined ([#55](https://github.com/npm/libcipm/issues/55)) ([13ab2f0](https://github.com/npm/libcipm/commit/13ab2f0)) - - - - -## [2.0.1](https://github.com/npm/libcipm/compare/v2.0.0...v2.0.1) (2018-07-27) - - -### Bug Fixes - -* **deps:** move mkdirp to prod deps ([6878f39](https://github.com/npm/libcipm/commit/6878f39)) - - - - -# [2.0.0](https://github.com/npm/libcipm/compare/v1.6.3...v2.0.0) (2018-05-24) - - -### meta - -* update node version support ([694b4d3](https://github.com/npm/libcipm/commit/694b4d3)) - - -### BREAKING CHANGES - -* node@4 is no longer supported - - - - -## [1.6.3](https://github.com/npm/libcipm/compare/v1.6.2...v1.6.3) (2018-05-24) - - - - -## [1.6.2](https://github.com/npm/libcipm/compare/v1.6.1...v1.6.2) (2018-04-08) - - -### Bug Fixes - -* **lifecycle:** detect binding.gyp for default install lifecycle ([#46](https://github.com/npm/libcipm/issues/46)) ([9149631](https://github.com/npm/libcipm/commit/9149631)), closes [#45](https://github.com/npm/libcipm/issues/45) - - - - -## [1.6.1](https://github.com/npm/libcipm/compare/v1.6.0...v1.6.1) (2018-03-13) - - -### Bug Fixes - -* **bin:** Set non-zero exit code on error ([#41](https://github.com/npm/libcipm/issues/41)) ([54d0106](https://github.com/npm/libcipm/commit/54d0106)) -* **lifecycle:** defer to lifecycle’s internal logic as to whether or not to execute a run-script ([#42](https://github.com/npm/libcipm/issues/42)) ([7f27a52](https://github.com/npm/libcipm/commit/7f27a52)), closes [npm/npm#19258](https://github.com/npm/npm/issues/19258) -* **prefix:** don't reference prefix before computing it ([#40](https://github.com/npm/libcipm/issues/40)) ([08ed1cc](https://github.com/npm/libcipm/commit/08ed1cc)) -* **prefix:** Resolve to promise when passing --prefix to npm ci ([#43](https://github.com/npm/libcipm/issues/43)) ([401d466](https://github.com/npm/libcipm/commit/401d466)) - - - - -# [1.6.0](https://github.com/npm/libcipm/compare/v1.5.1...v1.6.0) (2018-03-01) - - -### Bug Fixes - -* **bin:** cli.js was being excluded ([d62668e](https://github.com/npm/libcipm/commit/d62668e)) - - -### Features - -* **libcipm:** working standalone cipm release! ([a3383fd](https://github.com/npm/libcipm/commit/a3383fd)) - - - - -## [1.5.1](https://github.com/npm/libcipm/compare/v1.5.0...v1.5.1) (2018-03-01) - - -### Bug Fixes - -* **_from:** do not add _from to directory deps ([7405360](https://github.com/npm/libcipm/commit/7405360)) - - - - -# [1.5.0](https://github.com/npm/libcipm/compare/v1.4.1...v1.5.0) (2018-03-01) - - -### Bug Fixes - -* **errors:** handle aggregate errors better ([6239499](https://github.com/npm/libcipm/commit/6239499)) - - -### Features - -* **logger:** rudimentary progress bar update ([c5d9dc7](https://github.com/npm/libcipm/commit/c5d9dc7)) - - - - -## [1.4.1](https://github.com/npm/libcipm/compare/v1.4.0...v1.4.1) (2018-02-27) - - -### Bug Fixes - -* **buildTree:** linking in parallel causes hoist-clobbering ([5ffbc0e](https://github.com/npm/libcipm/commit/5ffbc0e)), closes [#39](https://github.com/npm/libcipm/issues/39) -* **buildTree:** use checkDepEnv here too ([41a4634](https://github.com/npm/libcipm/commit/41a4634)) -* **perf:** split up updateJson and buildTree ([df5aba0](https://github.com/npm/libcipm/commit/df5aba0)) -* **perf:** stop using the readPackageJson version to update packages ([8da3d5a](https://github.com/npm/libcipm/commit/8da3d5a)) - - - - -# [1.4.0](https://github.com/npm/libcipm/compare/v1.3.3...v1.4.0) (2018-02-21) - - -### Features - -* **extract:** add support for --only and --also ([ad143ae](https://github.com/npm/libcipm/commit/ad143ae)) - - - - -## [1.3.3](https://github.com/npm/libcipm/compare/v1.3.2...v1.3.3) (2018-02-21) - - -### Bug Fixes - -* **extract:** stop extracting deps before parent :\ ([c6847dc](https://github.com/npm/libcipm/commit/c6847dc)) - - - - -## [1.3.2](https://github.com/npm/libcipm/compare/v1.3.1...v1.3.2) (2018-02-15) - - - - -## [1.3.1](https://github.com/npm/libcipm/compare/v1.3.0...v1.3.1) (2018-02-15) - - - - -# [1.3.0](https://github.com/npm/libcipm/compare/v1.2.0...v1.3.0) (2018-02-13) - - -### Features - -* **extract:** link directory deps and install missing bundle deps ([8334e9e](https://github.com/npm/libcipm/commit/8334e9e)) - - - - -# [1.2.0](https://github.com/npm/libcipm/compare/v1.1.2...v1.2.0) (2018-02-07) - - -### Features - -* **metadata:** add _resolved, _integrity, and _from on install ([36642dc](https://github.com/npm/libcipm/commit/36642dc)) - - - - -## [1.1.2](https://github.com/npm/libcipm/compare/v1.1.1...v1.1.2) (2018-01-19) - - - - -## [1.1.1](https://github.com/npm/libcipm/compare/v1.1.0...v1.1.1) (2018-01-19) - - - - -# [1.1.0](https://github.com/npm/libcipm/compare/v1.0.1...v1.1.0) (2018-01-07) - - -### Features - -* **log:** add some helpful log output ([f443f03](https://github.com/npm/libcipm/commit/f443f03)) - - - - -## [1.0.1](https://github.com/npm/libcipm/compare/v1.0.0...v1.0.1) (2018-01-07) - - -### Bug Fixes - -* **deps:** added protoduck to pkgjson ([ecbe719](https://github.com/npm/libcipm/commit/ecbe719)) - - - - -# [1.0.0](https://github.com/npm/libcipm/compare/v0.9.1...v1.0.0) (2018-01-07) - - -### Features - -* **cli:** splitting off CLI into a separate tool ([cff65c1](https://github.com/npm/libcipm/commit/cff65c1)) - - -### BREAKING CHANGES - -* **cli:** libcipm is its own library now, - - - - -## [0.9.1](https://github.com/npm/libcipm/compare/v0.9.0...v0.9.1) (2018-01-07) - - -### Bug Fixes - -* **prefix:** oops @ prefix ([cc5adac](https://github.com/npm/libcipm/commit/cc5adac)) - - - - -# [0.9.0](https://github.com/npm/libcipm/compare/v0.8.0...v0.9.0) (2018-01-07) - - -### Bug Fixes - -* **package:** add pacote to bundleDependencies ([#36](https://github.com/npm/libcipm/issues/36)) ([a69742e](https://github.com/npm/libcipm/commit/a69742e)) - - -### Features - -* **config:** allow injection of npm configs ([#35](https://github.com/npm/libcipm/issues/35)) ([1f5694b](https://github.com/npm/libcipm/commit/1f5694b)) - - - - -# [0.8.0](https://github.com/npm/libcipm/compare/v0.7.2...v0.8.0) (2017-11-28) - - -### Features - -* **gyp:** new npm-lifecycle[@2](https://github.com/2) with included node-gyp ([a4ed938](https://github.com/npm/libcipm/commit/a4ed938)) - - - - -## [0.7.2](https://github.com/npm/libcipm/compare/v0.7.1...v0.7.2) (2017-10-13) - - -### Bug Fixes - -* **extract:** idk why this was breaking. Seriously. ([433a2be](https://github.com/npm/libcipm/commit/433a2be)) -* **tree:** pass through a custom Promise to logiTree ([2d29efb](https://github.com/npm/libcipm/commit/2d29efb)) - - -### Performance Improvements - -* zoomzoom. Even more concurrency! ([db9c2e0](https://github.com/npm/libcipm/commit/db9c2e0)) - - - - -## [0.7.1](https://github.com/npm/libcipm/compare/v0.7.0...v0.7.1) (2017-10-13) - - -### Bug Fixes - -* **scripts:** separate extract and build and fix ordering ([eb072a5](https://github.com/npm/libcipm/commit/eb072a5)) - - - - -# [0.7.0](https://github.com/npm/libcipm/compare/v0.6.0...v0.7.0) (2017-10-12) - - -### Bug Fixes - -* **lockfile:** npm-shrinkwrap takes precedence over package-lock (#28) ([3b98fb3](https://github.com/npm/libcipm/commit/3b98fb3)) - - -### Features - -* **optional:** ignore failed optional deps (#27) ([a654629](https://github.com/npm/libcipm/commit/a654629)) - - - - -# [0.6.0](https://github.com/npm/libcipm/compare/v0.5.1...v0.6.0) (2017-10-09) - - -### Features - -* **scripts:** run prepare and prepublish scripts in the root (#26) ([e0e35a3](https://github.com/npm/libcipm/commit/e0e35a3)) - - - - -## [0.5.1](https://github.com/npm/libcipm/compare/v0.5.0...v0.5.1) (2017-10-09) - - - - -# [0.5.0](https://github.com/npm/libcipm/compare/v0.4.0...v0.5.0) (2017-10-09) - - -### Bug Fixes - -* **output:** npm does not punctuate this ([e7ba976](https://github.com/npm/libcipm/commit/e7ba976)) -* **shutdown:** make sure workers close ([7ab57d0](https://github.com/npm/libcipm/commit/7ab57d0)) - - -### Features - -* **bin:** link bins and run scripts (#25) ([fab74bf](https://github.com/npm/libcipm/commit/fab74bf)) -* **lifecycle:** run scripts in dep order (#23) ([68ecfac](https://github.com/npm/libcipm/commit/68ecfac)) - - - - -# [0.4.0](https://github.com/npm/libcipm/compare/v0.3.2...v0.4.0) (2017-10-04) - - -### Features - -* **opts:** support full range of relevant CLI opts (#19) ([6f2bd51](https://github.com/npm/libcipm/commit/6f2bd51)) - - - - -## [0.3.2](https://github.com/npm/libcipm/compare/v0.3.1...v0.3.2) (2017-09-06) - - -### Bug Fixes - -* **bin:** make cli executable by default (#13) ([14a9a5f](https://github.com/npm/libcipm/commit/14a9a5f)) -* **config:** use npm.cmd on win32 and fix tests (#12) ([d912d16](https://github.com/npm/libcipm/commit/d912d16)), closes [#12](https://github.com/npm/libcipm/issues/12) -* **json:** strip BOM when reading JSON files (#8) ([2529149](https://github.com/npm/libcipm/commit/2529149)) - - - - -## [0.3.1](https://github.com/npm/libcipm/compare/v0.3.0...v0.3.1) (2017-09-05) - - - - -# [0.3.0](https://github.com/npm/libcipm/compare/v0.2.0...v0.3.0) (2017-09-05) - - -### Features - -* **lockfile:** verify that lockfile matches package.json (#5) ([f631203](https://github.com/npm/libcipm/commit/f631203)) -* **scripts:** support --ignore-scripts option (#9) ([213ca02](https://github.com/npm/libcipm/commit/213ca02)) - - - - -# [0.2.0](https://github.com/npm/libcipm/compare/v0.1.1...v0.2.0) (2017-09-01) - - -### Bug Fixes - -* **main:** default --prefix ([ff06a31](https://github.com/npm/libcipm/commit/ff06a31)) - - -### Features - -* **lifecycle:** actually run lifecycle scripts correctly ([7f8933e](https://github.com/npm/libcipm/commit/7f8933e)) - - - - -## [0.1.1](https://github.com/npm/libcipm/compare/v0.1.0...v0.1.1) (2017-08-30) - - -### Bug Fixes - -* **files:** oops. forgot to include new files in tarball ([1ee85c9](https://github.com/npm/libcipm/commit/1ee85c9)) - - - - -# 0.1.0 (2017-08-30) - - -### Bug Fixes - -* **config:** pipe stdout ([08e6af8](https://github.com/npm/libcipm/commit/08e6af8)) -* **extract:** make sure to extract properly ([9643583](https://github.com/npm/libcipm/commit/9643583)) -* **license:** switch to MIT ([0d10d0d](https://github.com/npm/libcipm/commit/0d10d0d)) - - -### Features - -* **impl:** rough prototype ([2970e43](https://github.com/npm/libcipm/commit/2970e43)) -* **lifecycle:** Run lifecycle events, implement prefix option, add unit tests (#1) ([d6629be](https://github.com/npm/libcipm/commit/d6629be)), closes [#1](https://github.com/npm/libcipm/issues/1) -* **opts:** add usage string and --help ([efcc48d](https://github.com/npm/libcipm/commit/efcc48d)) diff --git a/deps/npm/node_modules/libcipm/LICENSE.md b/deps/npm/node_modules/libcipm/LICENSE.md deleted file mode 100644 index 2ed9c0311c9974..00000000000000 --- a/deps/npm/node_modules/libcipm/LICENSE.md +++ /dev/null @@ -1,19 +0,0 @@ -Copyright npm, Inc., Kat Marchán, and Contributors - -Permission is hereby granted, free of charge, to any person obtaining a -copy of this software and associated documentation files (the "Software"), -to deal in the Software without restriction, including without limitation -the rights to use, copy, modify, merge, publish, distribute, sublicense, -and/or sell copies of the Software, and to permit persons to whom the -Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -DEALINGS IN THE SOFTWARE. diff --git a/deps/npm/node_modules/libcipm/README.md b/deps/npm/node_modules/libcipm/README.md deleted file mode 100644 index 2316f0eaabf855..00000000000000 --- a/deps/npm/node_modules/libcipm/README.md +++ /dev/null @@ -1,32 +0,0 @@ -# Note: pending imminent deprecation - -**This module will be deprecated once npm v7 is released. Please do not rely -on it more than absolutely necessary.** - ----- - -[`libcipm`](https://github.com/npm/libcipm) installs npm projects in a way that's -optimized for continuous integration/deployment/etc scenarios. It gives up -the ability to build its own trees or install packages individually, as well -as other user-oriented features, in exchange for speed, and being more strict -about project state. - -For documentation about the associated command-line tool, see -[`cipm`](https://npm.im/cipm). - -## Install - -`$ npm install libcipm` - -## Table of Contents - -* [Features](#features) -* [API](#api) - -### Features - -* npm-compatible project installation -* lifecycle script support -* blazing fast -* npm-compatible caching -* errors if `package.json` and `package-lock.json` are out of sync, instead of fixing it like npm does. Essentially provides a `--frozen` install. diff --git a/deps/npm/node_modules/libcipm/index.js b/deps/npm/node_modules/libcipm/index.js deleted file mode 100644 index 42d05e1f8931c3..00000000000000 --- a/deps/npm/node_modules/libcipm/index.js +++ /dev/null @@ -1,429 +0,0 @@ -'use strict' - -const BB = require('bluebird') - -const binLink = require('bin-links') -const buildLogicalTree = require('npm-logical-tree') -const extract = require('./lib/extract.js') -const figgyPudding = require('figgy-pudding') -const fs = require('graceful-fs') -const getPrefix = require('find-npm-prefix') -const lifecycle = require('npm-lifecycle') -const lockVerify = require('lock-verify') -const mkdirp = BB.promisify(require('mkdirp')) -const npa = require('npm-package-arg') -const path = require('path') -const readPkgJson = BB.promisify(require('read-package-json')) -const rimraf = BB.promisify(require('rimraf')) - -const readFileAsync = BB.promisify(fs.readFile) -const statAsync = BB.promisify(fs.stat) -const symlinkAsync = BB.promisify(fs.symlink) -const writeFileAsync = BB.promisify(fs.writeFile) - -const LifecycleOpts = figgyPudding({ - config: {}, - 'script-shell': {}, - scriptShell: 'script-shell', - 'ignore-scripts': {}, - ignoreScripts: 'ignore-scripts', - 'ignore-prepublish': {}, - ignorePrepublish: 'ignore-prepublish', - 'scripts-prepend-node-path': {}, - scriptsPrependNodePath: 'scripts-prepend-node-path', - 'unsafe-perm': {}, - unsafePerm: 'unsafe-perm', - prefix: {}, - dir: 'prefix', - failOk: { default: false } -}, { other () { return true } }) - -class Installer { - constructor (opts) { - this.opts = opts - - // Stats - this.startTime = Date.now() - this.runTime = 0 - this.timings = { scripts: 0 } - this.pkgCount = 0 - - // Misc - this.log = this.opts.log || require('./lib/silentlog.js') - this.pkg = null - this.tree = null - this.failedDeps = new Set() - } - - timedStage (name) { - const start = Date.now() - return BB.resolve(this[name].apply(this, [].slice.call(arguments, 1))) - .tap(() => { - this.timings[name] = Date.now() - start - this.log.info(name, `Done in ${this.timings[name] / 1000}s`) - }) - } - - run () { - return this.timedStage('prepare') - .then(() => this.timedStage('extractTree', this.tree)) - .then(() => this.timedStage('updateJson', this.tree)) - .then(pkgJsons => this.timedStage('buildTree', this.tree, pkgJsons)) - .then(() => this.timedStage('garbageCollect', this.tree)) - .then(() => this.timedStage('runScript', 'prepublish', this.pkg, this.prefix)) - .then(() => this.timedStage('runScript', 'prepare', this.pkg, this.prefix)) - .then(() => this.timedStage('teardown')) - .then(() => { - this.runTime = Date.now() - this.startTime - this.log.info( - 'run-scripts', - `total script time: ${this.timings.scripts / 1000}s` - ) - this.log.info( - 'run-time', - `total run time: ${this.runTime / 1000}s` - ) - }) - .catch(err => { - this.timedStage('teardown') - if (err.message.match(/aggregate error/)) { - throw err[0] - } else { - throw err - } - }) - .then(() => this) - } - - prepare () { - this.log.info('prepare', 'initializing installer') - this.log.level = this.opts.loglevel - this.log.verbose('prepare', 'starting workers') - extract.startWorkers() - - return ( - this.opts.prefix && this.opts.global - ? BB.resolve(this.opts.prefix) - // There's some Special™ logic around the `--prefix` config when it - // comes from a config file or env vs when it comes from the CLI - : process.argv.some(arg => arg.match(/^\s*--prefix\s*/i)) - ? BB.resolve(this.opts.prefix) - : getPrefix(process.cwd()) - ) - .then(prefix => { - this.prefix = prefix - this.log.verbose('prepare', 'installation prefix: ' + prefix) - return BB.join( - readJson(prefix, 'package.json'), - readJson(prefix, 'package-lock.json', true), - readJson(prefix, 'npm-shrinkwrap.json', true), - (pkg, lock, shrink) => { - if (shrink) { - this.log.verbose('prepare', 'using npm-shrinkwrap.json') - } else if (lock) { - this.log.verbose('prepare', 'using package-lock.json') - } - pkg._shrinkwrap = shrink || lock - this.pkg = pkg - } - ) - }) - .then(() => statAsync( - path.join(this.prefix, 'node_modules') - ).catch(err => { if (err.code !== 'ENOENT') { throw err } })) - .then(stat => { - stat && this.log.warn( - 'prepare', 'removing existing node_modules/ before installation' - ) - return BB.join( - this.checkLock(), - stat && rimraf(path.join(this.prefix, 'node_modules/*')) - ) - }).then(() => { - // This needs to happen -after- we've done checkLock() - this.tree = buildLogicalTree(this.pkg, this.pkg._shrinkwrap) - this.log.silly('tree', this.tree) - this.expectedTotal = 0 - this.tree.forEach((dep, next) => { - this.expectedTotal++ - next() - }) - }) - } - - teardown () { - this.log.verbose('teardown', 'shutting down workers.') - return extract.stopWorkers() - } - - checkLock () { - this.log.verbose('checkLock', 'verifying package-lock data') - const pkg = this.pkg - const prefix = this.prefix - if (!pkg._shrinkwrap || !pkg._shrinkwrap.lockfileVersion) { - return BB.reject( - new Error(`cipm can only install packages with an existing package-lock.json or npm-shrinkwrap.json with lockfileVersion >= 1. Run an install with npm@5 or later to generate it, then try again.`) - ) - } - return lockVerify(prefix).then(result => { - if (result.status) { - result.warnings.forEach(w => this.log.warn('lockfile', w)) - } else { - throw new Error( - 'cipm can only install packages when your package.json and package-lock.json or ' + - 'npm-shrinkwrap.json are in sync. Please update your lock file with `npm install` ' + - 'before continuing.\n\n' + - result.warnings.map(w => 'Warning: ' + w).join('\n') + '\n' + - result.errors.join('\n') + '\n' - ) - } - }).catch(err => { - throw err - }) - } - - extractTree (tree) { - this.log.verbose('extractTree', 'extracting dependencies to node_modules/') - const cg = this.log.newItem('extractTree', this.expectedTotal) - return tree.forEachAsync((dep, next) => { - if (!this.checkDepEnv(dep)) { return } - const depPath = dep.path(this.prefix) - const spec = npa.resolve(dep.name, dep.version, this.prefix) - if (dep.isRoot) { - return next() - } else if (spec.type === 'directory') { - const relative = path.relative(path.dirname(depPath), spec.fetchSpec) - this.log.silly('extractTree', `${dep.name}@${spec.fetchSpec} -> ${depPath} (symlink)`) - return mkdirp(path.dirname(depPath)) - .then(() => symlinkAsync(relative, depPath, 'junction')) - .catch( - () => rimraf(depPath) - .then(() => symlinkAsync(relative, depPath, 'junction')) - ).then(() => next()) - .then(() => { - this.pkgCount++ - cg.completeWork(1) - }) - } else { - this.log.silly('extractTree', `${dep.name}@${dep.version} -> ${depPath}`) - return ( - dep.bundled - ? statAsync(path.join(depPath, 'package.json')).catch(err => { - if (err.code !== 'ENOENT') { throw err } - }) - : BB.resolve(false) - ) - .then(wasBundled => { - // Don't extract if a bundled dep is actually present - if (wasBundled) { - cg.completeWork(1) - return next() - } else { - return BB.resolve(extract.child( - dep.name, dep, depPath, this.opts - )) - .then(() => cg.completeWork(1)) - .then(() => { this.pkgCount++ }) - .then(next) - } - }) - } - }, {concurrency: 50, Promise: BB}) - .then(() => cg.finish()) - } - - checkDepEnv (dep) { - const includeDev = ( - // Covers --dev and --development (from npm config itself) - this.opts.dev || - ( - !/^prod(uction)?$/.test(this.opts.only) && - !this.opts.production - ) || - /^dev(elopment)?$/.test(this.opts.only) || - /^dev(elopment)?$/.test(this.opts.also) - ) - const includeProd = !/^dev(elopment)?$/.test(this.opts.only) - const includeOptional = includeProd && this.opts.optional - return (dep.dev && includeDev) || - (dep.optional && includeOptional) || - (!dep.dev && !dep.optional && includeProd) - } - - updateJson (tree) { - this.log.verbose('updateJson', 'updating json deps to include _from') - const pkgJsons = new Map() - return tree.forEachAsync((dep, next) => { - if (!this.checkDepEnv(dep)) { return } - const spec = npa.resolve(dep.name, dep.version) - const depPath = dep.path(this.prefix) - return next() - .then(() => readJson(depPath, 'package.json')) - .then(pkg => (spec.registry || spec.type === 'directory') - ? pkg - : this.updateFromField(dep, pkg).then(() => pkg) - ) - .then(pkg => (pkg.scripts && pkg.scripts.install) - ? pkg - : this.updateInstallScript(dep, pkg).then(() => pkg) - ) - .tap(pkg => { pkgJsons.set(dep, pkg) }) - }, {concurrency: 100, Promise: BB}) - .then(() => pkgJsons) - } - - buildTree (tree, pkgJsons) { - this.log.verbose('buildTree', 'finalizing tree and running scripts') - return tree.forEachAsync((dep, next) => { - if (!this.checkDepEnv(dep)) { return } - const spec = npa.resolve(dep.name, dep.version) - const depPath = dep.path(this.prefix) - const pkg = pkgJsons.get(dep) - this.log.silly('buildTree', `linking ${spec}`) - return this.runScript('preinstall', pkg, depPath) - .then(next) // build children between preinstall and binLink - // Don't link root bins - .then(() => { - if ( - dep.isRoot || - !(pkg.bin || pkg.man || (pkg.directories && pkg.directories.bin)) - ) { - // We skip the relatively expensive readPkgJson if there's no way - // we'll actually be linking any bins or mans - return - } - return readPkgJson(path.join(depPath, 'package.json')) - .then(pkg => binLink(pkg, depPath, false, { - force: this.opts.force, - ignoreScripts: this.opts['ignore-scripts'], - log: Object.assign({}, this.log, { info: () => {} }), - name: pkg.name, - pkgId: pkg.name + '@' + pkg.version, - prefix: this.prefix, - prefixes: [this.prefix], - umask: this.opts.umask - }), e => { - this.log.verbose('buildTree', `error linking ${spec}: ${e.message} ${e.stack}`) - }) - }) - .then(() => this.runScript('install', pkg, depPath)) - .then(() => this.runScript('postinstall', pkg, depPath)) - .then(() => this) - .catch(e => { - if (dep.optional) { - this.failedDeps.add(dep) - } else { - throw e - } - }) - }, {concurrency: 1, Promise: BB}) - } - - updateFromField (dep, pkg) { - const depPath = dep.path(this.prefix) - const depPkgPath = path.join(depPath, 'package.json') - const parent = dep.requiredBy.values().next().value - return readJson(parent.path(this.prefix), 'package.json') - .then(ppkg => - (ppkg.dependencies && ppkg.dependencies[dep.name]) || - (ppkg.devDependencies && ppkg.devDependencies[dep.name]) || - (ppkg.optionalDependencies && ppkg.optionalDependencies[dep.name]) - ) - .then(from => npa.resolve(dep.name, from)) - .then(from => { pkg._from = from.toString() }) - .then(() => writeFileAsync(depPkgPath, JSON.stringify(pkg, null, 2))) - .then(() => pkg) - } - - updateInstallScript (dep, pkg) { - const depPath = dep.path(this.prefix) - return statAsync(path.join(depPath, 'binding.gyp')) - .catch(err => { if (err.code !== 'ENOENT') { throw err } }) - .then(stat => { - if (stat) { - if (!pkg.scripts) { - pkg.scripts = {} - } - pkg.scripts.install = 'node-gyp rebuild' - } - }) - .then(() => pkg) - } - - // A cute little mark-and-sweep collector! - garbageCollect (tree) { - if (!this.failedDeps.size) { return } - return sweep( - tree, - this.prefix, - mark(tree, this.failedDeps) - ) - .then(purged => { - this.purgedDeps = purged - this.pkgCount -= purged.size - }) - } - - runScript (stage, pkg, pkgPath) { - const start = Date.now() - if (!this.opts['ignore-scripts']) { - // TODO(mikesherov): remove pkg._id when npm-lifecycle no longer relies on it - pkg._id = pkg.name + '@' + pkg.version - return BB.resolve(lifecycle( - pkg, stage, pkgPath, LifecycleOpts(this.opts).concat({ - // TODO: can be removed once npm-lifecycle is updated to modern - // config practices. - config: Object.assign({}, this.opts, { - log: null, - dirPacker: null - }), - dir: this.prefix - })) - ).tap(() => { this.timings.scripts += Date.now() - start }) - } - return BB.resolve() - } -} -module.exports = Installer - -function mark (tree, failed) { - const liveDeps = new Set() - tree.forEach((dep, next) => { - if (!failed.has(dep)) { - liveDeps.add(dep) - next() - } - }) - return liveDeps -} - -function sweep (tree, prefix, liveDeps) { - const purged = new Set() - return tree.forEachAsync((dep, next) => { - return next().then(() => { - if ( - !dep.isRoot && // never purge root! 🙈 - !liveDeps.has(dep) && - !purged.has(dep) - ) { - purged.add(dep) - return rimraf(dep.path(prefix)) - } - }) - }, {concurrency: 50, Promise: BB}).then(() => purged) -} - -function stripBOM (str) { - return str.replace(/^\uFEFF/, '') -} - -module.exports._readJson = readJson -function readJson (jsonPath, name, ignoreMissing) { - return readFileAsync(path.join(jsonPath, name), 'utf8') - .then(str => JSON.parse(stripBOM(str))) - .catch({code: 'ENOENT'}, err => { - if (!ignoreMissing) { - throw err - } - }) -} diff --git a/deps/npm/node_modules/libcipm/lib/config/npm-config.js b/deps/npm/node_modules/libcipm/lib/config/npm-config.js deleted file mode 100644 index a0511906199255..00000000000000 --- a/deps/npm/node_modules/libcipm/lib/config/npm-config.js +++ /dev/null @@ -1,84 +0,0 @@ -'use strict' - -const BB = require('bluebird') - -const fs = require('fs') -const figgyPudding = require('figgy-pudding') -const ini = require('ini') -const path = require('path') -const spawn = require('child_process').spawn - -const readFileAsync = BB.promisify(fs.readFile) - -const NpmConfig = figgyPudding({ - cache: { default: '' }, - then: {}, - userconfig: {} -}) - -module.exports = NpmConfig - -module.exports.fromNpm = getNpmConfig -function getNpmConfig (argv) { - return new BB((resolve, reject) => { - const npmBin = process.platform === 'win32' ? 'npm.cmd' : 'npm' - const child = spawn(npmBin, [ - 'config', 'ls', '--json', '-l' - // We add argv here to get npm to parse those options for us :D - ].concat(argv || []), { - env: process.env, - cwd: process.cwd(), - stdio: [0, 'pipe', 2] - }) - - let stdout = '' - if (child.stdout) { - child.stdout.on('data', (chunk) => { - stdout += chunk - }) - } - - child.on('error', reject) - child.on('close', (code) => { - if (code === 127) { - reject(new Error('`npm` command not found. Please ensure you have npm@5.4.0 or later installed.')) - } else { - try { - resolve(JSON.parse(stdout)) - } catch (e) { - reject(new Error('`npm config ls --json` failed to output json. Please ensure you have npm@5.4.0 or later installed.')) - } - } - }) - }).then(opts => { - return BB.all( - process.cwd().split(path.sep).reduce((acc, next) => { - acc.path = path.join(acc.path, next) - acc.promises.push(maybeReadIni(path.join(acc.path, '.npmrc'))) - acc.promises.push(maybeReadIni(path.join(acc.path, 'npmrc'))) - return acc - }, { - path: '', - promises: [] - }).promises.concat( - opts.userconfig ? maybeReadIni(opts.userconfig) : {} - ) - ).then(configs => NpmConfig(...configs, opts)) - }).then(opts => { - if (opts.cache) { - return opts.concat({ cache: path.join(opts.cache, '_cacache') }) - } else { - return opts - } - }) -} - -function maybeReadIni (f) { - return readFileAsync(f, 'utf8').catch(err => { - if (err.code === 'ENOENT') { - return '' - } else { - throw err - } - }).then(ini.parse) -} diff --git a/deps/npm/node_modules/libcipm/lib/extract.js b/deps/npm/node_modules/libcipm/lib/extract.js deleted file mode 100644 index f87d2c791d40e7..00000000000000 --- a/deps/npm/node_modules/libcipm/lib/extract.js +++ /dev/null @@ -1,67 +0,0 @@ -'use strict' - -const BB = require('bluebird') - -const extractionWorker = require('./worker.js') -const figgyPudding = require('figgy-pudding') -const npa = require('npm-package-arg') -const WORKER_PATH = require.resolve('./worker.js') -let workerFarm - -// Broken for now, cause too many issues on some systems. -const ENABLE_WORKERS = false - -const ExtractOpts = figgyPudding({ - log: {}, - dirPacker: {} -}) - -module.exports = { - startWorkers () { - if (ENABLE_WORKERS) { - if (!workerFarm) { workerFarm = require('worker-farm') } - this._workers = workerFarm({ - maxConcurrentCallsPerWorker: 20, - maxRetries: 1 - }, WORKER_PATH) - } - }, - - stopWorkers () { - if (ENABLE_WORKERS) { - if (!workerFarm) { workerFarm = require('worker-farm') } - workerFarm.end(this._workers) - } - }, - - child (name, child, childPath, opts) { - opts = ExtractOpts(opts) - const spec = npa.resolve(name, child.version) - let childOpts = opts.concat({ - integrity: child.integrity, - resolved: child.resolved - }) - const args = [spec, childPath, childOpts] - return BB.fromNode((cb) => { - let launcher = extractionWorker - let msg = args - const spec = typeof args[0] === 'string' ? npa(args[0]) : args[0] - if (ENABLE_WORKERS && (spec.registry || spec.type === 'remote')) { - if (!workerFarm) { workerFarm = require('worker-farm') } - // We can't serialize these options - childOpts = childOpts.concat({ - log: null, - dirPacker: null - }) - // workers will run things in parallel! - launcher = this._workers - try { - msg = JSON.stringify(msg) - } catch (e) { - return cb(e) - } - } - launcher(msg, cb) - }) - } -} diff --git a/deps/npm/node_modules/libcipm/lib/silentlog.js b/deps/npm/node_modules/libcipm/lib/silentlog.js deleted file mode 100644 index 4c9d6c57e8b7d3..00000000000000 --- a/deps/npm/node_modules/libcipm/lib/silentlog.js +++ /dev/null @@ -1,13 +0,0 @@ -'use strict' - -const noop = Function.prototype -module.exports = { - error: noop, - warn: noop, - info: noop, - verbose: noop, - silly: noop, - http: noop, - pause: noop, - resume: noop -} diff --git a/deps/npm/node_modules/libcipm/lib/worker.js b/deps/npm/node_modules/libcipm/lib/worker.js deleted file mode 100644 index bab607e5278796..00000000000000 --- a/deps/npm/node_modules/libcipm/lib/worker.js +++ /dev/null @@ -1,16 +0,0 @@ -'use strict' - -const BB = require('bluebird') - -// const log = require('npmlog') -const pacote = require('pacote') - -module.exports = (args, cb) => { - const parsed = typeof args === 'string' ? JSON.parse(args) : args - const spec = parsed[0] - const extractTo = parsed[1] - const opts = parsed[2] - // opts.log = log - // log.level = opts.loglevel - return BB.resolve(pacote.extract(spec, extractTo, opts)).nodeify(cb) -} diff --git a/deps/npm/node_modules/libcipm/package.json b/deps/npm/node_modules/libcipm/package.json deleted file mode 100644 index f2317ba5f5fe83..00000000000000 --- a/deps/npm/node_modules/libcipm/package.json +++ /dev/null @@ -1,96 +0,0 @@ -{ - "_from": "libcipm@4.0.8", - "_id": "libcipm@4.0.8", - "_inBundle": false, - "_integrity": "sha512-IN3hh2yDJQtZZ5paSV4fbvJg4aHxCCg5tcZID/dSVlTuUiWktsgaldVljJv6Z5OUlYspx6xQkbR0efNodnIrOA==", - "_location": "/libcipm", - "_phantomChildren": {}, - "_requested": { - "type": "version", - "registry": true, - "raw": "libcipm@4.0.8", - "name": "libcipm", - "escapedName": "libcipm", - "rawSpec": "4.0.8", - "saveSpec": null, - "fetchSpec": "4.0.8" - }, - "_requiredBy": [ - "#USER", - "/" - ], - "_resolved": "https://registry.npmjs.org/libcipm/-/libcipm-4.0.8.tgz", - "_shasum": "dcea4919e10dfbce420327e63901613b9141bc89", - "_spec": "libcipm@4.0.8", - "_where": "/Users/claudiahdz/npm/cli", - "author": { - "name": "Kat Marchán", - "email": "kzm@sykosomatic.org" - }, - "bugs": { - "url": "https://github.com/npm/libcipm/issues" - }, - "bundleDependencies": false, - "config": { - "nyc": { - "exclude": [ - "node_modules/**", - "test/**" - ] - } - }, - "dependencies": { - "bin-links": "^1.1.2", - "bluebird": "^3.5.1", - "figgy-pudding": "^3.5.1", - "find-npm-prefix": "^1.0.2", - "graceful-fs": "^4.1.11", - "ini": "^1.3.5", - "lock-verify": "^2.1.0", - "mkdirp": "^0.5.1", - "npm-lifecycle": "^3.0.0", - "npm-logical-tree": "^1.2.1", - "npm-package-arg": "^6.1.0", - "pacote": "^9.1.0", - "read-package-json": "^2.0.13", - "rimraf": "^2.6.2", - "worker-farm": "^1.6.0" - }, - "deprecated": false, - "description": "programmatic API for cipm: a ci-oriented package installer for npm", - "devDependencies": { - "npmlog": "^4.1.2", - "nyc": "^11.8.0", - "require-inject": "^1.4.3", - "standard": "^11.0.1", - "standard-version": "^4.4.0", - "tacks": "^1.2.6", - "tap": "^12.0.1" - }, - "files": [ - "*.js", - "lib" - ], - "homepage": "https://github.com/npm/libcipm#readme", - "keywords": [ - "npm", - "package manager", - "caching", - "downloader" - ], - "license": "MIT", - "main": "index.js", - "name": "libcipm", - "repository": { - "type": "git", - "url": "git+https://github.com/npm/libcipm.git" - }, - "scripts": { - "postrelease": "npm publish && git push --follow-tags", - "prerelease": "npm t", - "pretest": "standard", - "release": "standard-version -s", - "test": "tap -J --nyc-arg=--all --coverage test/specs" - }, - "version": "4.0.8" -} diff --git a/deps/npm/node_modules/libnpm/CHANGELOG.md b/deps/npm/node_modules/libnpm/CHANGELOG.md deleted file mode 100644 index bb3a52a36f93d6..00000000000000 --- a/deps/npm/node_modules/libnpm/CHANGELOG.md +++ /dev/null @@ -1,113 +0,0 @@ -# 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.1](https://github.com/npm/libnpm/compare/v3.0.0...v3.0.1) (2019-07-16) - - - - -# [3.0.0](https://github.com/npm/libnpm/compare/v2.0.1...v3.0.0) (2019-07-10) - - -* npm-lifecycle@3.0.0 ([56cc8e5](https://github.com/npm/libnpm/commit/56cc8e5)) - - -### BREAKING CHANGES - -* requires updating node-gyp in npm/cli - - - - -## [2.0.1](https://github.com/npm/libnpm/compare/v2.0.0...v2.0.1) (2018-12-05) - - -### Bug Fixes - -* **read-json:** use bluebird for promisification ([8dddde6](https://github.com/npm/libnpm/commit/8dddde6)) - - - - -# [2.0.0](https://github.com/npm/libnpm/compare/v1.5.0...v2.0.0) (2018-11-27) - - -### deps - -* bump all libs ([83ae929](https://github.com/npm/libnpm/commit/83ae929)) - - -### BREAKING CHANGES - -* This includes a breaking libnpmaccess patch - - - - -# [1.5.0](https://github.com/npm/libnpm/compare/v1.4.0...v1.5.0) (2018-11-26) - - -### Features - -* **pacote:** minimal requires for pacote-related APIs ([e19ce11](https://github.com/npm/libnpm/commit/e19ce11)) - - - - -# [1.4.0](https://github.com/npm/libnpm/compare/v1.3.0...v1.4.0) (2018-11-13) - - -### Features - -* **libnpm:** add support for partial requires ([7ba10a7](https://github.com/npm/libnpm/commit/7ba10a7)) - - - - -# [1.3.0](https://github.com/npm/libnpm/compare/v1.2.0...v1.3.0) (2018-11-07) - - -### Features - -* **bin:** add binLinks lib ([2f4d551](https://github.com/npm/libnpm/commit/2f4d551)) - - - - -# [1.2.0](https://github.com/npm/libnpm/compare/v1.1.0...v1.2.0) (2018-11-07) - - -### Features - -* **log:** add npmlog to the bundle ([c20abd1](https://github.com/npm/libnpm/commit/c20abd1)) - - - - -# [1.1.0](https://github.com/npm/libnpm/compare/v1.0.0...v1.1.0) (2018-11-07) - - -### Features - -* **config:** add libnpmconfig ([6a44725](https://github.com/npm/libnpm/commit/6a44725)) -* **json+tree:** add read-package-json and npm-logical-tree ([0198a91](https://github.com/npm/libnpm/commit/0198a91)) -* **lock+prefix:** add lock-verify and find-npm-prefix ([00750c9](https://github.com/npm/libnpm/commit/00750c9)) -* **parseArg:** add npm-package-arg ([5712614](https://github.com/npm/libnpm/commit/5712614)) -* **stringify:** add stringify-package ([0ec5bba](https://github.com/npm/libnpm/commit/0ec5bba)) - - - - -# [1.0.0](https://github.com/npm/libnpm/compare/v0.0.1...v1.0.0) (2018-08-31) - - -### Features - -* **api:** document and export libnpm api ([f85f8f8](https://github.com/npm/libnpm/commit/f85f8f8)) - - - - -## 0.0.1 (2018-04-04) diff --git a/deps/npm/node_modules/libnpm/LICENSE.md b/deps/npm/node_modules/libnpm/LICENSE.md deleted file mode 100644 index 8d28acf866d932..00000000000000 --- a/deps/npm/node_modules/libnpm/LICENSE.md +++ /dev/null @@ -1,16 +0,0 @@ -ISC License - -Copyright (c) npm, Inc. - -Permission to use, copy, modify, and/or distribute this software for -any purpose with or without fee is hereby granted, provided that the -above copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE COPYRIGHT HOLDER DISCLAIMS -ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE -COPYRIGHT HOLDER BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR -CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS -OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE -OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE -USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/deps/npm/node_modules/libnpm/README.md b/deps/npm/node_modules/libnpm/README.md deleted file mode 100644 index ce35f5da1995d9..00000000000000 --- a/deps/npm/node_modules/libnpm/README.md +++ /dev/null @@ -1,57 +0,0 @@ -# libnpm - -[`libnpm`](https://github.com/npm/libnpm) is the programmatic API for npm. - -For bug reports and support, please head over to [npm.community](https://npm.community). - - -## Install - -`$ npm install libnpm` - -## Table of Contents - -* [Example](#example) -* [Features](#features) -* [API](#api) - * Fetching Packages and Their Info - * [`manifest`](https://www.npmjs.com/package/pacote#manifest) - * [`packument`](https://www.npmjs.com/package/pacote#packument) - * [`tarball`](https://www.npmjs.com/package/pacote#tarball) - * [`extract`](https://www.npmjs.com/package/pacote#extract) - * [`search`](https://npm.im/libnpmsearch) - * Package-related Registry APIs - * [`publish`]() - * [`unpublish`](#unpublish) - * [`access`](https://npm.im/libnpmaccess) - * Account-related Registry APIs - * [`login`](https://www.npmjs.com/package/npm-profile#login) - * [`adduser`](https://www.npmjs.com/package/npm-profile#adduser) - * [`profile`](https://npm.im/npm-profile) - * [`hook`](https://npm.im/libnpmhook) - * [`team`](https://npm.im/libnpmteam) - * [`org`](https://npm.im/libnpmorg) - * Miscellaneous - * [`parseArg`](https://npm.im/npm-package-arg) - * [`config`](https://npm.im/libnpmconfig) - * [`readJSON`](https://npm.im/read-package-json) - * [`verifyLock`](https://npm.im/lock-verify) - * [`getPrefix`](https://npm.im/find-npm-prefix) - * [`logicalTree`](https://npm.im/npm-logical-tree) - * [`stringifyPackage`](https://npm.im/stringify-package) - * [`runScript`](https://www.npmjs.com/package/npm-lifecycle) - * [`log`](https://npm.im/npmlog) - * [`fetch`](https://npm.im/npm-registry-fetch) (plain ol' client for registry interaction) - * [`linkBin`](https://npm.im/bin-links) - -### Example - -```javascript -await libnpm.manifest('libnpm') // => Manifest { name: 'libnpm', ... } -``` - -### API - -This package re-exports the APIs from other packages for convenience. Refer to -the [table of contents](#table-of-contents) for detailed documentation on each -individual exported API. diff --git a/deps/npm/node_modules/libnpm/access.js b/deps/npm/node_modules/libnpm/access.js deleted file mode 100644 index 4b164226a31f6a..00000000000000 --- a/deps/npm/node_modules/libnpm/access.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict' - -module.exports = require('libnpmaccess') diff --git a/deps/npm/node_modules/libnpm/adduser.js b/deps/npm/node_modules/libnpm/adduser.js deleted file mode 100644 index e57dbeaf9baf2e..00000000000000 --- a/deps/npm/node_modules/libnpm/adduser.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict' - -module.exports = require('npm-profile').adduser diff --git a/deps/npm/node_modules/libnpm/config.js b/deps/npm/node_modules/libnpm/config.js deleted file mode 100644 index 51ff1edee8b7c3..00000000000000 --- a/deps/npm/node_modules/libnpm/config.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict' - -module.exports = require('libnpmconfig') diff --git a/deps/npm/node_modules/libnpm/extract.js b/deps/npm/node_modules/libnpm/extract.js deleted file mode 100644 index 4f3aa3d7065c40..00000000000000 --- a/deps/npm/node_modules/libnpm/extract.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict' - -module.exports = require('pacote/extract') diff --git a/deps/npm/node_modules/libnpm/fetch.js b/deps/npm/node_modules/libnpm/fetch.js deleted file mode 100644 index 0e5ccd8804297c..00000000000000 --- a/deps/npm/node_modules/libnpm/fetch.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict' - -module.exports = require('npm-registry-fetch') diff --git a/deps/npm/node_modules/libnpm/get-prefix.js b/deps/npm/node_modules/libnpm/get-prefix.js deleted file mode 100644 index 86bf85862c734a..00000000000000 --- a/deps/npm/node_modules/libnpm/get-prefix.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict' - -module.exports = require('find-npm-prefix') diff --git a/deps/npm/node_modules/libnpm/hook.js b/deps/npm/node_modules/libnpm/hook.js deleted file mode 100644 index a45644beeaa6cd..00000000000000 --- a/deps/npm/node_modules/libnpm/hook.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict' - -module.exports = require('libnpmhook') diff --git a/deps/npm/node_modules/libnpm/index.js b/deps/npm/node_modules/libnpm/index.js deleted file mode 100644 index 19c0419e8917ff..00000000000000 --- a/deps/npm/node_modules/libnpm/index.js +++ /dev/null @@ -1,29 +0,0 @@ -'use strict' - -module.exports = { - config: require('./config.js'), - parseArg: require('./parse-arg.js'), - readJSON: require('./read-json.js'), - logicalTree: require('./logical-tree.js'), - getPrefix: require('./get-prefix.js'), - verifyLock: require('./verify-lock.js'), - stringifyPackage: require('./stringify-package.js'), - manifest: require('./manifest.js'), - tarball: require('./tarball.js'), - extract: require('./extract.js'), - packument: require('./packument.js'), - hook: require('./hook.js'), - access: require('./access.js'), - search: require('./search.js'), - team: require('./team.js'), - org: require('./org.js'), - fetch: require('./fetch.js'), - login: require('./login.js'), - adduser: require('./adduser.js'), - profile: require('./profile.js'), - publish: require('./publish.js'), - unpublish: require('./unpublish.js'), - runScript: require('./run-script.js'), - log: require('./log.js'), - linkBin: require('./link-bin.js') -} diff --git a/deps/npm/node_modules/libnpm/link-bin.js b/deps/npm/node_modules/libnpm/link-bin.js deleted file mode 100644 index 4d7d35c7315f87..00000000000000 --- a/deps/npm/node_modules/libnpm/link-bin.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict' - -module.exports = require('bin-links') diff --git a/deps/npm/node_modules/libnpm/log.js b/deps/npm/node_modules/libnpm/log.js deleted file mode 100644 index f935c6242dd74c..00000000000000 --- a/deps/npm/node_modules/libnpm/log.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict' - -module.exports = require('npmlog') diff --git a/deps/npm/node_modules/libnpm/logical-tree.js b/deps/npm/node_modules/libnpm/logical-tree.js deleted file mode 100644 index a08e7737a62ce9..00000000000000 --- a/deps/npm/node_modules/libnpm/logical-tree.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict' - -module.exports = require('npm-logical-tree') diff --git a/deps/npm/node_modules/libnpm/login.js b/deps/npm/node_modules/libnpm/login.js deleted file mode 100644 index fbd61e9a2f8da5..00000000000000 --- a/deps/npm/node_modules/libnpm/login.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict' - -module.exports = require('npm-profile').login diff --git a/deps/npm/node_modules/libnpm/manifest.js b/deps/npm/node_modules/libnpm/manifest.js deleted file mode 100644 index 863b004e7f27d9..00000000000000 --- a/deps/npm/node_modules/libnpm/manifest.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict' - -module.exports = require('pacote/manifest') diff --git a/deps/npm/node_modules/libnpm/org.js b/deps/npm/node_modules/libnpm/org.js deleted file mode 100644 index 96b15aac0d815c..00000000000000 --- a/deps/npm/node_modules/libnpm/org.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict' - -module.exports = require('libnpmorg') diff --git a/deps/npm/node_modules/libnpm/package.json b/deps/npm/node_modules/libnpm/package.json deleted file mode 100644 index 9fb5641b2d9a11..00000000000000 --- a/deps/npm/node_modules/libnpm/package.json +++ /dev/null @@ -1,94 +0,0 @@ -{ - "_from": "libnpm@3.0.1", - "_id": "libnpm@3.0.1", - "_inBundle": false, - "_integrity": "sha512-d7jU5ZcMiTfBqTUJVZ3xid44fE5ERBm9vBnmhp2ECD2Ls+FNXWxHSkO7gtvrnbLO78gwPdNPz1HpsF3W4rjkBQ==", - "_location": "/libnpm", - "_phantomChildren": {}, - "_requested": { - "type": "version", - "registry": true, - "raw": "libnpm@3.0.1", - "name": "libnpm", - "escapedName": "libnpm", - "rawSpec": "3.0.1", - "saveSpec": null, - "fetchSpec": "3.0.1" - }, - "_requiredBy": [ - "#USER", - "/" - ], - "_resolved": "https://registry.npmjs.org/libnpm/-/libnpm-3.0.1.tgz", - "_shasum": "0be11b4c9dd4d1ffd7d95c786e92e55d65be77a2", - "_spec": "libnpm@3.0.1", - "_where": "/Users/isaacs/dev/npm/cli", - "author": { - "name": "Kat Marchán", - "email": "kzm@zkat.tech" - }, - "bugs": { - "url": "https://github.com/npm/libnpm/issues" - }, - "bundleDependencies": false, - "dependencies": { - "bin-links": "^1.1.2", - "bluebird": "^3.5.3", - "find-npm-prefix": "^1.0.2", - "libnpmaccess": "^3.0.2", - "libnpmconfig": "^1.2.1", - "libnpmhook": "^5.0.3", - "libnpmorg": "^1.0.1", - "libnpmpublish": "^1.1.2", - "libnpmsearch": "^2.0.2", - "libnpmteam": "^1.0.2", - "lock-verify": "^2.0.2", - "npm-lifecycle": "^3.0.0", - "npm-logical-tree": "^1.2.1", - "npm-package-arg": "^6.1.0", - "npm-profile": "^4.0.2", - "npm-registry-fetch": "^4.0.0", - "npmlog": "^4.1.2", - "pacote": "^9.5.3", - "read-package-json": "^2.0.13", - "stringify-package": "^1.0.0" - }, - "deprecated": false, - "description": "Collection of programmatic APIs for the npm CLI", - "devDependencies": { - "nock": "^9.2.3", - "standard": "^11.0.1", - "standard-version": "^4.3.0", - "tap": "^12.0.1", - "weallbehave": "^1.2.0", - "weallcontribute": "^1.0.8" - }, - "files": [ - "*.js", - "lib" - ], - "homepage": "https://github.com/npm/libnpm#readme", - "keywords": [ - "npm", - "api", - "package manager", - "lib" - ], - "license": "ISC", - "main": "index.js", - "name": "libnpm", - "repository": { - "type": "git", - "url": "git+https://github.com/npm/libnpm.git" - }, - "scripts": { - "postrelease": "npm publish && git push --follow-tags", - "prerelease": "npm t", - "pretest": "standard", - "release": "standard-version -s", - "test": "tap -J --coverage test/*.js", - "update-coc": "weallbehave -o . && git add CODE_OF_CONDUCT.md && git commit -m 'docs(coc): updated CODE_OF_CONDUCT.md'", - "update-contrib": "weallcontribute -o . && git add CONTRIBUTING.md && git commit -m 'docs(contributing): updated CONTRIBUTING.md'" - }, - "version": "3.0.1" -} diff --git a/deps/npm/node_modules/libnpm/packument.js b/deps/npm/node_modules/libnpm/packument.js deleted file mode 100644 index f852a3fe26b609..00000000000000 --- a/deps/npm/node_modules/libnpm/packument.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict' - -module.exports = require('pacote/packument') diff --git a/deps/npm/node_modules/libnpm/parse-arg.js b/deps/npm/node_modules/libnpm/parse-arg.js deleted file mode 100644 index 6db5201504f394..00000000000000 --- a/deps/npm/node_modules/libnpm/parse-arg.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict' - -module.exports = require('npm-package-arg') diff --git a/deps/npm/node_modules/libnpm/profile.js b/deps/npm/node_modules/libnpm/profile.js deleted file mode 100644 index 6df6b5e23abc97..00000000000000 --- a/deps/npm/node_modules/libnpm/profile.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict' - -module.exports = require('npm-profile') diff --git a/deps/npm/node_modules/libnpm/publish.js b/deps/npm/node_modules/libnpm/publish.js deleted file mode 100644 index bcdbdeb2a8ebdd..00000000000000 --- a/deps/npm/node_modules/libnpm/publish.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict' - -module.exports = require('libnpmpublish').publish diff --git a/deps/npm/node_modules/libnpm/read-json.js b/deps/npm/node_modules/libnpm/read-json.js deleted file mode 100644 index b59eb9d45a0be1..00000000000000 --- a/deps/npm/node_modules/libnpm/read-json.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict' - -module.exports = require('bluebird').promisify(require('read-package-json')) diff --git a/deps/npm/node_modules/libnpm/run-script.js b/deps/npm/node_modules/libnpm/run-script.js deleted file mode 100644 index 11765d40ae5539..00000000000000 --- a/deps/npm/node_modules/libnpm/run-script.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict' - -module.exports = require('npm-lifecycle') diff --git a/deps/npm/node_modules/libnpm/search.js b/deps/npm/node_modules/libnpm/search.js deleted file mode 100644 index 172b10b7caf16b..00000000000000 --- a/deps/npm/node_modules/libnpm/search.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict' - -module.exports = require('libnpmsearch') diff --git a/deps/npm/node_modules/libnpm/stringify-package.js b/deps/npm/node_modules/libnpm/stringify-package.js deleted file mode 100644 index e7f3bfcbb719e1..00000000000000 --- a/deps/npm/node_modules/libnpm/stringify-package.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict' - -module.exports = require('stringify-package') diff --git a/deps/npm/node_modules/libnpm/tarball.js b/deps/npm/node_modules/libnpm/tarball.js deleted file mode 100644 index cc1b2e54a49fb9..00000000000000 --- a/deps/npm/node_modules/libnpm/tarball.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict' - -module.exports = require('pacote/tarball') diff --git a/deps/npm/node_modules/libnpm/team.js b/deps/npm/node_modules/libnpm/team.js deleted file mode 100644 index d407f796f4e44d..00000000000000 --- a/deps/npm/node_modules/libnpm/team.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict' - -module.exports = require('libnpmteam') diff --git a/deps/npm/node_modules/libnpm/unpublish.js b/deps/npm/node_modules/libnpm/unpublish.js deleted file mode 100644 index bc0d34c9a09cbb..00000000000000 --- a/deps/npm/node_modules/libnpm/unpublish.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict' - -module.exports = require('libnpmpublish').unpublish diff --git a/deps/npm/node_modules/libnpm/verify-lock.js b/deps/npm/node_modules/libnpm/verify-lock.js deleted file mode 100644 index e396756419c7ac..00000000000000 --- a/deps/npm/node_modules/libnpm/verify-lock.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict' - -module.exports = require('lock-verify') diff --git a/deps/npm/node_modules/libnpmaccess/.github/settings.yml b/deps/npm/node_modules/libnpmaccess/.github/settings.yml new file mode 100644 index 00000000000000..4aaa0dd57e4ad0 --- /dev/null +++ b/deps/npm/node_modules/libnpmaccess/.github/settings.yml @@ -0,0 +1,2 @@ +--- +_extends: 'open-source-project-boilerplate' diff --git a/deps/npm/node_modules/libnpmaccess/.github/workflows/ci.yml b/deps/npm/node_modules/libnpmaccess/.github/workflows/ci.yml new file mode 100644 index 00000000000000..71189bae7b9627 --- /dev/null +++ b/deps/npm/node_modules/libnpmaccess/.github/workflows/ci.yml @@ -0,0 +1,94 @@ +--- +################################################################################ +# Template - Node CI +# +# Description: +# This contains the basic information to: install dependencies, run tests, +# get coverage, and run linting on a nodejs project. This template will run +# over the MxN matrix of all operating systems, and all current LTS versions +# of NodeJS. +# +# Dependencies: +# This template assumes that your project is using the `tap` module for +# testing. If you're not using this module, then the step that runs your +# coverage will need to be adjusted. +# +################################################################################ +name: Node CI + +on: [push, pull_request] + +jobs: + build: + strategy: + fail-fast: false + matrix: + node-version: [10.x, 12.x, 13.x] + os: [ubuntu-latest, windows-latest, macOS-latest] + + runs-on: ${{ matrix.os }} + + steps: + # Checkout the repository + - uses: actions/checkout@v2 + # Installs the specific version of Node.js + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v1 + with: + node-version: ${{ matrix.node-version }} + + ################################################################################ + # Install Dependencies + # + # ASSUMPTIONS: + # - The project has a package-lock.json file + # + # Simply run the tests for the project. + ################################################################################ + - name: Install dependencies + run: npm ci + + ################################################################################ + # Run Testing + # + # ASSUMPTIONS: + # - The project has `tap` as a devDependency + # - There is a script called "test" in the package.json + # + # Simply run the tests for the project. + ################################################################################ + - name: Run tests + run: npm test -- --no-coverage + + ################################################################################ + # Run coverage check + # + # ASSUMPTIONS: + # - The project has `tap` as a devDependency + # - There is a script called "coverage" in the package.json + # + # Coverage should only be posted once, we are choosing the latest LTS of + # node, and ubuntu as the matrix point to post coverage from. We limit + # to the 'push' event so that coverage ins't posted twice from the + # pull-request event, and push event (line 3). + ################################################################################ + - name: Run coverage report + if: github.event_name == 'push' && matrix.node-version == '12.x' && matrix.os == 'ubuntu-latest' + run: npm test + env: + # The environment variable name is leveraged by `tap` + COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }} + + ################################################################################ + # Run linting + # + # ASSUMPTIONS: + # - There is a script called "lint" in the package.json + # + # We run linting AFTER we run testing and coverage checks, because if a step + # fails in an GitHub Action, all other steps are not run. We don't want to + # fail to run tests or coverage because of linting. It should be the lowest + # priority of all the steps. + ################################################################################ + - name: Run linter + run: npm run lint diff --git a/deps/npm/node_modules/libnpmaccess/.travis.yml b/deps/npm/node_modules/libnpmaccess/.travis.yml deleted file mode 100644 index db5ea8b0186403..00000000000000 --- a/deps/npm/node_modules/libnpmaccess/.travis.yml +++ /dev/null @@ -1,7 +0,0 @@ -language: node_js -sudo: false -node_js: - - "10" - - "9" - - "8" - - "6" diff --git a/deps/npm/node_modules/libnpmaccess/CHANGELOG.md b/deps/npm/node_modules/libnpmaccess/CHANGELOG.md index cbec879a7db2e9..6d8036a9daf06d 100644 --- a/deps/npm/node_modules/libnpmaccess/CHANGELOG.md +++ b/deps/npm/node_modules/libnpmaccess/CHANGELOG.md @@ -1,5 +1,42 @@ # Change Log + +## [4.0.0](https://github.com/npm/libnpmaccess/compare/v3.0.2...v4.0.0) (2020-03-02) + +### BREAKING CHANGES +- `25ac61b` fix: remove figgy-pudding ([@claudiahdz](https://github.com/claudiahdz)) +- `8d6f692` chore: rename opts.mapJson to opts.mapJSON ([@mikemimik](https://github.com/mikemimik)) + +### Features +- `257879a` chore: removed standard-version as a dep; updated scripts for version/publishing ([@mikemimik](https://github.com/mikemimik)) +- `46c6740` fix: pull-request feedback; read full commit message ([@mikemimik](https://github.com/mikemimik)) +- `778c102` chore: updated test, made case more clear ([@mikemimik](https://github.com/mikemimik)) +- `6dc9852` fix: refactored 'pwrap' function out of code base; use native promises ([@mikemimik](https://github.com/mikemimik)) +- `d2e7219` chore: updated package scripts; update CI workflow ([@mikemimik](https://github.com/mikemimik)) +- `5872364` chore: renamed test/util/ to test/fixture/; tap will ignore now ([@mikemimik](https://github.com/mikemimik)) +- `3c6b71d` chore: linted test file; made tap usage 'better' ([@mikemimik](https://github.com/mikemimik)) +- `20f0858` fix: added default values to params for API functions (with tests) ([@mikemimik](https://github.com/mikemimik)) +- `3218289` feat: replace get-stream with minipass ([@mikemimik](https://github.com/mikemimik)) + +### Documentation +- `6c8ffa0` docs: removed opts.Promise from docs; no longer in use ([@mikemimik](https://github.com/mikemimik)) +- `311bff5` chore: added return types to function docs in README ([@mikemimik](https://github.com/mikemimik)) +- `823726a` chore: removed travis badge, added github actions badge ([@mikemimik](https://github.com/mikemimik)) +- `80e80ac` chore: updated README ([@mikemimik](https://github.com/mikemimik)) + +### Dependencies +- `baed2b9` deps: standard-version@7.1.0 (audit fix) ([@mikemimik](https://github.com/mikemimik)) +- `65c2204` deps: nock@12.0.1 (audit fix) ([@mikemimik](https://github.com/mikemimik)) +- `2668386` deps: npm-registry-fetch@8.0.0 ([@mikemimik](https://github.com/mikemimik)) +- `ef093e2` deps: tap@14.10.6 ([@mikemimik](https://github.com/mikemimik)) + +### Miscellanieous +- `8e33902` chore: basic project updates ([@claudiahdz](https://github.com/claudiahdz)) +- `50e1433` fix: update return value; add tests ([@mikemimik](https://github.com/mikemimik)) +- `36d5c80` chore: updated gitignore; includes coverage folder ([@mikemimik](https://github.com/mikemimik)) + +--- + 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. diff --git a/deps/npm/node_modules/libnpmaccess/PULL_REQUEST_TEMPLATE b/deps/npm/node_modules/libnpmaccess/PULL_REQUEST_TEMPLATE deleted file mode 100644 index 9471c6d325f7eb..00000000000000 --- a/deps/npm/node_modules/libnpmaccess/PULL_REQUEST_TEMPLATE +++ /dev/null @@ -1,7 +0,0 @@ - diff --git a/deps/npm/node_modules/libnpmaccess/README.md b/deps/npm/node_modules/libnpmaccess/README.md index 2b639823a06415..c079344597968a 100644 --- a/deps/npm/node_modules/libnpmaccess/README.md +++ b/deps/npm/node_modules/libnpmaccess/README.md @@ -1,4 +1,9 @@ -# libnpmaccess [![npm version](https://img.shields.io/npm/v/libnpmaccess.svg)](https://npm.im/libnpmaccess) [![license](https://img.shields.io/npm/l/libnpmaccess.svg)](https://npm.im/libnpmaccess) [![Travis](https://img.shields.io/travis/npm/libnpmaccess/latest.svg)](https://travis-ci.org/npm/libnpmaccess) [![AppVeyor](https://img.shields.io/appveyor/ci/zkat/libnpmaccess/latest.svg)](https://ci.appveyor.com/project/zkat/libnpmaccess) [![Coverage Status](https://coveralls.io/repos/github/npm/libnpmaccess/badge.svg?branch=latest)](https://coveralls.io/github/npm/libnpmaccess?branch=latest) +# libnpmaccess + +[![npm version](https://img.shields.io/npm/v/libnpmaccess.svg)](https://npm.im/libnpmaccess) +[![license](https://img.shields.io/npm/l/libnpmaccess.svg)](https://npm.im/libnpmaccess) +[![GitHub Actions](https://github.com/npm/libnpmaccess/workflows/Node%20CI/badge.svg)](https://github.com/npm/libnpmaccess/actions?query=workflow%3A%22Node+CI%22) +[![Coverage Status](https://coveralls.io/repos/github/npm/libnpmaccess/badge.svg?branch=latest)](https://coveralls.io/github/npm/libnpmaccess?branch=latest) [`libnpmaccess`](https://github.com/npm/libnpmaccess) is a Node.js library that provides programmatic access to the guts of the npm CLI's `npm @@ -37,21 +42,6 @@ console.log(Object.keys(await access.lsPackages('zkat'))) `$ npm install libnpmaccess` -### Contributing - -The npm team enthusiastically welcomes contributions and project participation! -There's a bunch of things you can do if you want to contribute! The [Contributor -Guide](CONTRIBUTING.md) has all the information you need for everything from -reporting bugs to contributing entire new features. Please don't hesitate to -jump in if you'd like to, or even ask us questions if something isn't clear. - -All participants and maintainers in this project are expected to follow [Code of -Conduct](CODE_OF_CONDUCT.md), and just generally be excellent to each other. - -Please refer to the [Changelog](CHANGELOG.md) for project history details, too. - -Happy hacking! - ### API #### `opts` for `libnpmaccess` commands @@ -66,9 +56,8 @@ A couple of options of note for those in a hurry: * `opts.token` - can be passed in and will be used as the authentication token for the registry. For other ways to pass in auth details, see the n-r-f docs. * `opts.otp` - certain operations will require an OTP token to be passed in. If a `libnpmaccess` command fails with `err.code === EOTP`, please retry the request with `{otp: <2fa token>}` -* `opts.Promise` - If you pass this in, the Promises returned by `libnpmaccess` commands will use this Promise class instead. For example: `{Promise: require('bluebird')}` -#### `> access.public(spec, [opts]) -> Promise` +#### `> access.public(spec, [opts]) -> Promise` `spec` must be an [`npm-package-arg`](https://npm.im/npm-package-arg)-compatible registry spec. @@ -82,7 +71,7 @@ await access.public('@foo/bar', {token: 'myregistrytoken'}) // `@foo/bar` is now public ``` -#### `> access.restricted(spec, [opts]) -> Promise` +#### `> access.restricted(spec, [opts]) -> Promise` `spec` must be an [`npm-package-arg`](https://npm.im/npm-package-arg)-compatible registry spec. @@ -96,7 +85,7 @@ await access.restricted('@foo/bar', {token: 'myregistrytoken'}) // `@foo/bar` is now private ``` -#### `> access.grant(spec, team, permissions, [opts]) -> Promise` +#### `> access.grant(spec, team, permissions, [opts]) -> Promise` `spec` must be an [`npm-package-arg`](https://npm.im/npm-package-arg)-compatible registry spec. `team` must be a fully-qualified team name, in the `scope:team` @@ -114,7 +103,7 @@ await access.grant('@foo/bar', '@foo:myteam', 'read-write', { // `@foo/bar` is now read/write enabled for the @foo:myteam team. ``` -#### `> access.revoke(spec, team, [opts]) -> Promise` +#### `> access.revoke(spec, team, [opts]) -> Promise` `spec` must be an [`npm-package-arg`](https://npm.im/npm-package-arg)-compatible registry spec. `team` must be a fully-qualified team name, in the `scope:team` @@ -132,7 +121,7 @@ await access.revoke('@foo/bar', '@foo:myteam', { // @foo:myteam can no longer access `@foo/bar` ``` -#### `> access.tfaRequired(spec, [opts]) -> Promise` +#### `> access.tfaRequired(spec, [opts]) -> Promise` `spec` must be an [`npm-package-arg`](https://npm.im/npm-package-arg)-compatible registry spec. @@ -147,7 +136,7 @@ await access.tfaRequires('lodash', {token: 'myregistrytoken'}) // Publishing or changing dist-tags on `lodash` now require OTP to be enabled. ``` -#### `> access.tfaNotRequired(spec, [opts]) -> Promise` +#### `> access.tfaNotRequired(spec, [opts]) -> Promise` `spec` must be an [`npm-package-arg`](https://npm.im/npm-package-arg)-compatible registry spec. @@ -163,7 +152,7 @@ await access.tfaNotRequired('lodash', {otp: '123654', token: 'myregistrytoken'}) // enabled. ``` -#### `> access.lsPackages(entity, [opts]) -> Promise` +#### `> access.lsPackages(entity, [opts]) -> Promise` `entity` must be either a valid org or user name, or a fully-qualified team name in the `scope:team` format, with or without the `@` prefix. @@ -213,7 +202,7 @@ for await (let [pkg, perm] of access.lsPackages.stream('zkat')) { // zkat has read-only access to @npmcorp/secret ``` -#### `> access.lsCollaborators(spec, [user], [opts]) -> Promise` +#### `> access.lsCollaborators(spec, [user], [opts]) -> Promise` `spec` must be an [`npm-package-arg`](https://npm.im/npm-package-arg)-compatible registry spec. `user` must be a valid user name, with or without the `@` diff --git a/deps/npm/node_modules/libnpmaccess/appveyor.yml b/deps/npm/node_modules/libnpmaccess/appveyor.yml deleted file mode 100644 index 9cc64c58e02f96..00000000000000 --- a/deps/npm/node_modules/libnpmaccess/appveyor.yml +++ /dev/null @@ -1,22 +0,0 @@ -environment: - matrix: - - nodejs_version: "10" - - nodejs_version: "9" - - nodejs_version: "8" - - nodejs_version: "6" - -platform: - - x64 - -install: - - ps: Install-Product node $env:nodejs_version $env:platform - - npm config set spin false - - npm install - -test_script: - - npm test - -matrix: - fast_finish: true - -build: off diff --git a/deps/npm/node_modules/libnpmaccess/index.js b/deps/npm/node_modules/libnpmaccess/index.js index e241fcbfc68a22..883110b2899186 100644 --- a/deps/npm/node_modules/libnpmaccess/index.js +++ b/deps/npm/node_modules/libnpmaccess/index.js @@ -1,16 +1,10 @@ 'use strict' -const figgyPudding = require('figgy-pudding') -const getStream = require('get-stream') +const Minipass = require('minipass') const npa = require('npm-package-arg') const npmFetch = require('npm-registry-fetch') -const {PassThrough} = require('stream') const validate = require('aproba') -const AccessConfig = figgyPudding({ - Promise: {default: () => Promise} -}) - const eu = encodeURIComponent const npar = spec => { spec = npa(spec) @@ -19,129 +13,130 @@ const npar = spec => { } return spec } +const mapJSON = (value, [key]) => { + if (value === 'read') { + return [key, 'read-only'] + } else if (value === 'write') { + return [key, 'read-write'] + } else { + return [key, value] + } +} const cmd = module.exports = {} cmd.public = (spec, opts) => setAccess(spec, 'public', opts) cmd.restricted = (spec, opts) => setAccess(spec, 'restricted', opts) -function setAccess (spec, access, opts) { - opts = AccessConfig(opts) - return pwrap(opts, () => { +function setAccess (spec, access, opts = {}) { + return Promise.resolve().then(() => { spec = npar(spec) validate('OSO', [spec, access, opts]) const uri = `/-/package/${eu(spec.name)}/access` - return npmFetch(uri, opts.concat({ + return npmFetch(uri, { + ...opts, method: 'POST', - body: {access}, + body: { access }, spec - })) - }).then(res => res.body.resume() && true) + }).then(() => true) + }) } -cmd.grant = (spec, entity, permissions, opts) => { - opts = AccessConfig(opts) - return pwrap(opts, () => { +cmd.grant = (spec, entity, permissions, opts = {}) => { + return Promise.resolve().then(() => { spec = npar(spec) - const {scope, team} = splitEntity(entity) + const { scope, team } = splitEntity(entity) validate('OSSSO', [spec, scope, team, permissions, opts]) if (permissions !== 'read-write' && permissions !== 'read-only') { throw new Error('`permissions` must be `read-write` or `read-only`. Got `' + permissions + '` instead') } const uri = `/-/team/${eu(scope)}/${eu(team)}/package` - return npmFetch(uri, opts.concat({ + return npmFetch(uri, { + ...opts, method: 'PUT', - body: {package: spec.name, permissions}, + body: { package: spec.name, permissions }, scope, spec, ignoreBody: true - })) - }).then(() => true) + }) + .then(() => true) + }) } -cmd.revoke = (spec, entity, opts) => { - opts = AccessConfig(opts) - return pwrap(opts, () => { +cmd.revoke = (spec, entity, opts = {}) => { + return Promise.resolve().then(() => { spec = npar(spec) - const {scope, team} = splitEntity(entity) + const { scope, team } = splitEntity(entity) validate('OSSO', [spec, scope, team, opts]) const uri = `/-/team/${eu(scope)}/${eu(team)}/package` - return npmFetch(uri, opts.concat({ + return npmFetch(uri, { + ...opts, method: 'DELETE', - body: {package: spec.name}, + body: { package: spec.name }, scope, spec, ignoreBody: true - })) - }).then(() => true) + }) + .then(() => true) + }) } cmd.lsPackages = (entity, opts) => { - opts = AccessConfig(opts) - return pwrap(opts, () => { - return getStream.array( - cmd.lsPackages.stream(entity, opts) - ).then(data => data.reduce((acc, [key, val]) => { - if (!acc) { - acc = {} - } - acc[key] = val - return acc - }, null)) - }) + return cmd.lsPackages.stream(entity, opts) + .collect() + .then(data => { + return data.reduce((acc, [key, val]) => { + if (!acc) { + acc = {} + } + acc[key] = val + return acc + }, null) + }) } -cmd.lsPackages.stream = (entity, opts) => { +cmd.lsPackages.stream = (entity, opts = {}) => { validate('SO|SZ', [entity, opts]) - opts = AccessConfig(opts) - const {scope, team} = splitEntity(entity) + const { scope, team } = splitEntity(entity) let uri if (team) { uri = `/-/team/${eu(scope)}/${eu(team)}/package` } else { uri = `/-/org/${eu(scope)}/package` } - opts = opts.concat({ - query: {format: 'cli'}, - mapJson (value, [key]) { - if (value === 'read') { - return [key, 'read-only'] - } else if (value === 'write') { - return [key, 'read-write'] + const nextOpts = { + ...opts, + query: { format: 'cli' }, + mapJSON + } + const ret = new Minipass({ objectMode: true }) + npmFetch.json.stream(uri, '*', nextOpts) + .on('error', err => { + if (err.code === 'E404' && !team) { + uri = `/-/user/${eu(scope)}/package` + npmFetch.json.stream(uri, '*', nextOpts) + .on('error', err => ret.emit('error', err)) + .pipe(ret) } else { - return [key, value] + ret.emit('error', err) } - } - }) - const ret = new PassThrough({objectMode: true}) - npmFetch.json.stream(uri, '*', opts).on('error', err => { - if (err.code === 'E404' && !team) { - uri = `/-/user/${eu(scope)}/package` - npmFetch.json.stream(uri, '*', opts).on( - 'error', err => ret.emit('error', err) - ).pipe(ret) - } else { - ret.emit('error', err) - } - }).pipe(ret) + }) + .pipe(ret) return ret } cmd.lsCollaborators = (spec, user, opts) => { - if (typeof user === 'object' && !opts) { - opts = user - user = undefined - } - opts = AccessConfig(opts) - return pwrap(opts, () => { - return getStream.array( - cmd.lsCollaborators.stream(spec, user, opts) - ).then(data => data.reduce((acc, [key, val]) => { - if (!acc) { - acc = {} - } - acc[key] = val - return acc - }, null)) + return Promise.resolve().then(() => { + return cmd.lsCollaborators.stream(spec, user, opts) + .collect() + .then(data => { + return data.reduce((acc, [key, val]) => { + if (!acc) { + acc = {} + } + acc[key] = val + return acc + }, null) + }) }) } @@ -149,40 +144,34 @@ cmd.lsCollaborators.stream = (spec, user, opts) => { if (typeof user === 'object' && !opts) { opts = user user = undefined + } else if (!opts) { + opts = {} } - opts = AccessConfig(opts) spec = npar(spec) validate('OSO|OZO', [spec, user, opts]) const uri = `/-/package/${eu(spec.name)}/collaborators` - return npmFetch.json.stream(uri, '*', opts.concat({ - query: {format: 'cli', user: user || undefined}, - mapJson (value, [key]) { - if (value === 'read') { - return [key, 'read-only'] - } else if (value === 'write') { - return [key, 'read-write'] - } else { - return [key, value] - } - } - })) + return npmFetch.json.stream(uri, '*', { + ...opts, + query: { format: 'cli', user: user || undefined }, + mapJSON + }) } cmd.tfaRequired = (spec, opts) => setRequires2fa(spec, true, opts) cmd.tfaNotRequired = (spec, opts) => setRequires2fa(spec, false, opts) -function setRequires2fa (spec, required, opts) { - opts = AccessConfig(opts) - return new opts.Promise((resolve, reject) => { +function setRequires2fa (spec, required, opts = {}) { + return Promise.resolve().then(() => { spec = npar(spec) validate('OBO', [spec, required, opts]) const uri = `/-/package/${eu(spec.name)}/access` - return npmFetch(uri, opts.concat({ + return npmFetch(uri, { + ...opts, method: 'POST', - body: {publish_requires_tfa: required}, + body: { publish_requires_tfa: required }, spec, ignoreBody: true - })).then(resolve, reject) - }).then(() => true) + }).then(() => true) + }) } cmd.edit = () => { @@ -190,12 +179,6 @@ cmd.edit = () => { } function splitEntity (entity = '') { - let [, scope, team] = entity.match(/^@?([^:]+)(?::(.*))?$/) || [] - return {scope, team} -} - -function pwrap (opts, fn) { - return new opts.Promise((resolve, reject) => { - fn().then(resolve, reject) - }) + const [, scope, team] = entity.match(/^@?([^:]+)(?::(.*))?$/) || [] + return { scope, team } } diff --git a/deps/npm/node_modules/libnpmaccess/package.json b/deps/npm/node_modules/libnpmaccess/package.json index 943b0aeb46a24b..a727e187214745 100644 --- a/deps/npm/node_modules/libnpmaccess/package.json +++ b/deps/npm/node_modules/libnpmaccess/package.json @@ -1,67 +1,37 @@ { - "_from": "libnpmaccess@3.0.2", - "_id": "libnpmaccess@3.0.2", - "_inBundle": false, - "_integrity": "sha512-01512AK7MqByrI2mfC7h5j8N9V4I7MHJuk9buo8Gv+5QgThpOgpjB7sQBDDkeZqRteFb1QM/6YNdHfG7cDvfAQ==", - "_location": "/libnpmaccess", - "_phantomChildren": {}, - "_requested": { - "type": "version", - "registry": true, - "raw": "libnpmaccess@3.0.2", - "name": "libnpmaccess", - "escapedName": "libnpmaccess", - "rawSpec": "3.0.2", - "saveSpec": null, - "fetchSpec": "3.0.2" - }, - "_requiredBy": [ - "#USER", - "/" - ], - "_resolved": "https://registry.npmjs.org/libnpmaccess/-/libnpmaccess-3.0.2.tgz", - "_shasum": "8b2d72345ba3bef90d3b4f694edd5c0417f58923", - "_spec": "libnpmaccess@3.0.2", - "_where": "/Users/isaacs/dev/npm/cli", - "author": { - "name": "Kat Marchán", - "email": "kzm@zkat.tech" - }, - "bugs": { - "url": "https://github.com/npm/libnpmaccess/issues" - }, - "bundleDependencies": false, - "dependencies": { - "aproba": "^2.0.0", - "get-stream": "^4.0.0", - "npm-package-arg": "^6.1.0", - "npm-registry-fetch": "^4.0.0" - }, - "deprecated": false, + "name": "libnpmaccess", + "version": "4.0.0", "description": "programmatic library for `npm access` commands", + "author": "Kat Marchán ", + "license": "ISC", + "scripts": { + "preversion": "npm test", + "postversion": "npm publish", + "postpublish": "git push origin --follow-tags", + "lint": "standard", + "test": "tap" + }, "devDependencies": { - "nock": "^9.6.1", - "standard": "*", - "standard-version": "*", - "tap": "*", - "weallbehave": "*", - "weallcontribute": "*" + "nock": "^12.0.1", + "standard": "^14.3.0", + "tap": "^14.10.6" }, - "homepage": "https://npmjs.com/package/libnpmaccess", - "license": "ISC", - "name": "libnpmaccess", "repository": { "type": "git", - "url": "git+https://github.com/npm/libnpmaccess.git" + "url": "https://github.com/npm/libnpmaccess.git" }, - "scripts": { - "postrelease": "npm publish && git push --follow-tags", - "prerelease": "npm t", - "pretest": "standard", - "release": "standard-version -s", - "test": "tap -J --100 test/*.js", - "update-coc": "weallbehave -o . && git add CODE_OF_CONDUCT.md && git commit -m 'docs(coc): updated CODE_OF_CONDUCT.md'", - "update-contrib": "weallcontribute -o . && git add CONTRIBUTING.md && git commit -m 'docs(contributing): updated CONTRIBUTING.md'" + "bugs": "https://github.com/npm/libnpmaccess/issues", + "homepage": "https://npmjs.com/package/libnpmaccess", + "dependencies": { + "aproba": "^2.0.0", + "minipass": "^3.1.1", + "npm-package-arg": "^8.0.0", + "npm-registry-fetch": "^8.0.0" + }, + "engines": { + "node": ">=10" }, - "version": "3.0.2" + "tap": { + "check-coverage": true + } } diff --git a/deps/npm/node_modules/libnpmaccess/test/util/tnock.js b/deps/npm/node_modules/libnpmaccess/test/fixtures/tnock.js similarity index 100% rename from deps/npm/node_modules/libnpmaccess/test/util/tnock.js rename to deps/npm/node_modules/libnpmaccess/test/fixtures/tnock.js diff --git a/deps/npm/node_modules/libnpmaccess/test/index.js b/deps/npm/node_modules/libnpmaccess/test/index.js index b48815e79a1fb3..c6d939c3d8c55c 100644 --- a/deps/npm/node_modules/libnpmaccess/test/index.js +++ b/deps/npm/node_modules/libnpmaccess/test/index.js @@ -1,54 +1,72 @@ 'use strict' -const figgyPudding = require('figgy-pudding') -const getStream = require('get-stream') -const {test} = require('tap') -const tnock = require('./util/tnock.js') +const t = require('tap') +const tnock = require('./fixtures/tnock.js') const access = require('../index.js') const REG = 'http://localhost:1337' -const OPTS = figgyPudding({})({ +const OPTS = { registry: REG -}) +} -test('access public', t => { +t.test('access public', t => { tnock(t, REG).post( - '/-/package/%40foo%2Fbar/access', {access: 'public'} + '/-/package/%40foo%2Fbar/access', { access: 'public' } ).reply(200) return access.public('@foo/bar', OPTS).then(ret => { t.deepEqual(ret, true, 'request succeeded') }) }) -test('access restricted', t => { +t.test('access public - failure', t => { + tnock(t, REG).post( + '/-/package/%40foo%2Fbar/access', { access: 'public' } + ).reply(418) + return access.public('@foo/bar', OPTS) + .catch(err => { + t.equals(err.statusCode, 418, 'fails with code from registry') + }) +}) + +t.test('access restricted', t => { tnock(t, REG).post( - '/-/package/%40foo%2Fbar/access', {access: 'restricted'} + '/-/package/%40foo%2Fbar/access', { access: 'restricted' } ).reply(200) return access.restricted('@foo/bar', OPTS).then(ret => { t.deepEqual(ret, true, 'request succeeded') }) }) -test('access 2fa-required', t => { +t.test('access restricted - failure', t => { + tnock(t, REG).post( + '/-/package/%40foo%2Fbar/access', { access: 'restricted' } + ).reply(418) + return access.restricted('@foo/bar', OPTS) + .catch(err => { + t.equals(err.statusCode, 418, 'fails with code from registry') + }) +}) + +t.test('access 2fa-required', t => { tnock(t, REG).post('/-/package/%40foo%2Fbar/access', { publish_requires_tfa: true - }).reply(200, {ok: true}) + }).reply(200, { ok: true }) return access.tfaRequired('@foo/bar', OPTS).then(ret => { t.deepEqual(ret, true, 'request succeeded') }) }) -test('access 2fa-not-required', t => { +t.test('access 2fa-not-required', t => { tnock(t, REG).post('/-/package/%40foo%2Fbar/access', { publish_requires_tfa: false - }).reply(200, {ok: true}) + }).reply(200, { ok: true }) return access.tfaNotRequired('@foo/bar', OPTS).then(ret => { t.deepEqual(ret, true, 'request succeeded') }) }) -test('access grant basic read-write', t => { +t.test('access grant basic read-write', t => { tnock(t, REG).put('/-/team/myorg/myteam/package', { package: '@foo/bar', permissions: 'read-write' @@ -60,7 +78,7 @@ test('access grant basic read-write', t => { }) }) -test('access grant basic read-only', t => { +t.test('access grant basic read-only', t => { tnock(t, REG).put('/-/team/myorg/myteam/package', { package: '@foo/bar', permissions: 'read-only' @@ -72,7 +90,7 @@ test('access grant basic read-only', t => { }) }) -test('access grant bad perm', t => { +t.test('access grant bad perm', t => { return access.grant( '@foo/bar', 'myorg:myteam', 'unknown', OPTS ).then(ret => { @@ -86,7 +104,7 @@ test('access grant bad perm', t => { }) }) -test('access grant no entity', t => { +t.test('access grant no entity', t => { return access.grant( '@foo/bar', undefined, 'read-write', OPTS ).then(ret => { @@ -100,7 +118,7 @@ test('access grant no entity', t => { }) }) -test('access grant basic unscoped', t => { +t.test('access grant basic unscoped', t => { tnock(t, REG).put('/-/team/myorg/myteam/package', { package: 'bar', permissions: 'read-write' @@ -112,7 +130,22 @@ test('access grant basic unscoped', t => { }) }) -test('access revoke basic', t => { +t.test('access grant no opts passed', t => { + // NOTE: mocking real url, because no opts variable means `registry` value + // will be defauled to real registry url + tnock(t, 'https://registry.npmjs.org') + .put('/-/team/myorg/myteam/package', { + package: 'bar', + permissions: 'read-write' + }) + .reply(201) + return access.grant('bar', 'myorg:myteam', 'read-write') + .then(ret => { + t.equals(ret, true, 'request succeeded') + }) +}) + +t.test('access revoke basic', t => { tnock(t, REG).delete('/-/team/myorg/myteam/package', { package: '@foo/bar' }).reply(200) @@ -121,16 +154,30 @@ test('access revoke basic', t => { }) }) -test('access revoke basic unscoped', t => { +t.test('access revoke basic unscoped', t => { tnock(t, REG).delete('/-/team/myorg/myteam/package', { package: 'bar' - }).reply(200, {accessChanged: true}) + }).reply(200, { accessChanged: true }) return access.revoke('bar', 'myorg:myteam', OPTS).then(ret => { t.deepEqual(ret, true, 'request succeeded') }) }) -test('ls-packages on team', t => { +t.test('access revoke no opts passed', t => { + // NOTE: mocking real url, because no opts variable means `registry` value + // will be defauled to real registry url + tnock(t, 'https://registry.npmjs.org') + .delete('/-/team/myorg/myteam/package', { + package: 'bar' + }) + .reply(201) + return access.revoke('bar', 'myorg:myteam') + .then(ret => { + t.equals(ret, true, 'request succeeded') + }) +}) + +t.test('ls-packages on team', t => { const serverPackages = { '@foo/bar': 'write', '@foo/util': 'read', @@ -149,7 +196,7 @@ test('ls-packages on team', t => { }) }) -test('ls-packages on org', t => { +t.test('ls-packages on org', t => { const serverPackages = { '@foo/bar': 'write', '@foo/util': 'read', @@ -168,7 +215,7 @@ test('ls-packages on org', t => { }) }) -test('ls-packages on user', t => { +t.test('ls-packages on user', t => { const serverPackages = { '@foo/bar': 'write', '@foo/util': 'read', @@ -180,14 +227,14 @@ test('ls-packages on user', t => { '@foo/other': 'shrödinger' } const srv = tnock(t, REG) - srv.get('/-/org/myuser/package?format=cli').reply(404, {error: 'not found'}) + srv.get('/-/org/myuser/package?format=cli').reply(404, { error: 'not found' }) srv.get('/-/user/myuser/package?format=cli').reply(200, serverPackages) return access.lsPackages('myuser', OPTS).then(data => { t.deepEqual(data, clientPackages, 'got client package info') }) }) -test('ls-packages error on team', t => { +t.test('ls-packages error on team', t => { tnock(t, REG).get('/-/team/myorg/myteam/package?format=cli').reply(404) return access.lsPackages('myorg:myteam', OPTS).then( () => { throw new Error('should not have succeeded') }, @@ -195,17 +242,17 @@ test('ls-packages error on team', t => { ) }) -test('ls-packages error on user', t => { +t.test('ls-packages error on user', t => { const srv = tnock(t, REG) - srv.get('/-/org/myuser/package?format=cli').reply(404, {error: 'not found'}) - srv.get('/-/user/myuser/package?format=cli').reply(404, {error: 'not found'}) + srv.get('/-/org/myuser/package?format=cli').reply(404, { error: 'not found' }) + srv.get('/-/user/myuser/package?format=cli').reply(404, { error: 'not found' }) return access.lsPackages('myuser', OPTS).then( () => { throw new Error('should not have succeeded') }, err => t.equal(err.code, 'E404', 'spit out 404 if both reqs fail') ) }) -test('ls-packages bad response', t => { +t.test('ls-packages bad response', t => { tnock(t, REG).get( '/-/team/myorg/myteam/package?format=cli' ).reply(200, JSON.stringify(null)) @@ -214,7 +261,7 @@ test('ls-packages bad response', t => { }) }) -test('ls-packages stream', t => { +t.test('ls-packages stream', t => { const serverPackages = { '@foo/bar': 'write', '@foo/util': 'read', @@ -228,14 +275,37 @@ test('ls-packages stream', t => { tnock(t, REG).get( '/-/team/myorg/myteam/package?format=cli' ).reply(200, serverPackages) - return getStream.array( - access.lsPackages.stream('myorg:myteam', OPTS) - ).then(data => { - t.deepEqual(data, clientPackages, 'got streamed client package info') - }) + return access.lsPackages.stream('myorg:myteam', OPTS) + .collect() + .then(data => { + t.deepEqual(data, clientPackages, 'got streamed client package info') + }) +}) + +t.test('ls-packages stream no opts', t => { + const serverPackages = { + '@foo/bar': 'write', + '@foo/util': 'read', + '@foo/other': 'shrödinger' + } + const clientPackages = [ + ['@foo/bar', 'read-write'], + ['@foo/util', 'read-only'], + ['@foo/other', 'shrödinger'] + ] + // NOTE: mocking real url, because no opts variable means `registry` value + // will be defauled to real registry url + tnock(t, 'https://registry.npmjs.org') + .get('/-/team/myorg/myteam/package?format=cli') + .reply(200, serverPackages) + return access.lsPackages.stream('myorg:myteam') + .collect() + .then(data => { + t.deepEqual(data, clientPackages, 'got streamed client package info') + }) }) -test('ls-collaborators', t => { +t.test('ls-collaborators', t => { const serverCollaborators = { 'myorg:myteam': 'write', 'myorg:anotherteam': 'read', @@ -254,7 +324,7 @@ test('ls-collaborators', t => { }) }) -test('ls-collaborators stream', t => { +t.test('ls-collaborators stream', t => { const serverCollaborators = { 'myorg:myteam': 'write', 'myorg:anotherteam': 'read', @@ -268,14 +338,14 @@ test('ls-collaborators stream', t => { tnock(t, REG).get( '/-/package/%40foo%2Fbar/collaborators?format=cli' ).reply(200, serverCollaborators) - return getStream.array( - access.lsCollaborators.stream('@foo/bar', OPTS) - ).then(data => { - t.deepEqual(data, clientCollaborators, 'got collaborators') - }) + return access.lsCollaborators.stream('@foo/bar', OPTS) + .collect() + .then(data => { + t.deepEqual(data, clientCollaborators, 'got collaborators') + }) }) -test('ls-collaborators w/scope', t => { +t.test('ls-collaborators w/scope', t => { const serverCollaborators = { 'myorg:myteam': 'write', 'myorg:anotherteam': 'read', @@ -294,7 +364,7 @@ test('ls-collaborators w/scope', t => { }) }) -test('ls-collaborators w/o scope', t => { +t.test('ls-collaborators w/o scope', t => { const serverCollaborators = { 'myorg:myteam': 'write', 'myorg:anotherteam': 'read', @@ -313,7 +383,7 @@ test('ls-collaborators w/o scope', t => { }) }) -test('ls-collaborators bad response', t => { +t.test('ls-collaborators bad response', t => { tnock(t, REG).get( '/-/package/%40foo%2Fbar/collaborators?format=cli' ).reply(200, JSON.stringify(null)) @@ -322,13 +392,13 @@ test('ls-collaborators bad response', t => { }) }) -test('error on non-registry specs', t => { +t.test('error on non-registry specs', t => { const resolve = () => { throw new Error('should not succeed') } const reject = err => t.match( err.message, /spec.*must be a registry spec/, 'registry spec required' ) return Promise.all([ - access.public('foo/bar').then(resolve, reject), + access.public('githubusername/reponame').then(resolve, reject), access.restricted('foo/bar').then(resolve, reject), access.grant('foo/bar', 'myorg', 'myteam', 'read-only').then(resolve, reject), access.revoke('foo/bar', 'myorg', 'myteam').then(resolve, reject), @@ -338,7 +408,7 @@ test('error on non-registry specs', t => { ]) }) -test('edit', t => { +t.test('edit', t => { t.equal(typeof access.edit, 'function', 'access.edit exists') t.throws(() => { access.edit() diff --git a/deps/npm/node_modules/libnpmconfig/CHANGELOG.md b/deps/npm/node_modules/libnpmconfig/CHANGELOG.md deleted file mode 100644 index a5708cc7ca50df..00000000000000 --- a/deps/npm/node_modules/libnpmconfig/CHANGELOG.md +++ /dev/null @@ -1,51 +0,0 @@ -# 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. - - -## [1.2.1](https://github.com/npm/libnpmconfig/compare/v1.2.0...v1.2.1) (2018-11-13) - - -### Bug Fixes - -* **proj:** make sure proj object exists ([8fe2663](https://github.com/npm/libnpmconfig/commit/8fe2663)) - - - - -# [1.2.0](https://github.com/npm/libnpmconfig/compare/v1.1.1...v1.2.0) (2018-11-13) - - -### Features - -* **cache:** improved cache parsing/handling ([63ba3bb](https://github.com/npm/libnpmconfig/commit/63ba3bb)) - - - - -## [1.1.1](https://github.com/npm/libnpmconfig/compare/v1.1.0...v1.1.1) (2018-11-04) - - -### Bug Fixes - -* **config:** rework load order and support builtin configs ([5ef1ac5](https://github.com/npm/libnpmconfig/commit/5ef1ac5)) - - - - -# [1.1.0](https://github.com/npm/libnpmconfig/compare/v1.0.0...v1.1.0) (2018-11-04) - - -### Features - -* **userconfig:** allow passing in userconfig from env ([f613877](https://github.com/npm/libnpmconfig/commit/f613877)) - - - - -# 1.0.0 (2018-11-04) - - -### Features - -* **api:** add read() function ([710426b](https://github.com/npm/libnpmconfig/commit/710426b)) diff --git a/deps/npm/node_modules/libnpmconfig/PULL_REQUEST_TEMPLATE b/deps/npm/node_modules/libnpmconfig/PULL_REQUEST_TEMPLATE deleted file mode 100644 index 9471c6d325f7eb..00000000000000 --- a/deps/npm/node_modules/libnpmconfig/PULL_REQUEST_TEMPLATE +++ /dev/null @@ -1,7 +0,0 @@ - diff --git a/deps/npm/node_modules/libnpmconfig/README.md b/deps/npm/node_modules/libnpmconfig/README.md deleted file mode 100644 index 91bac0d1717508..00000000000000 --- a/deps/npm/node_modules/libnpmconfig/README.md +++ /dev/null @@ -1,40 +0,0 @@ -# libnpmconfig [![npm version](https://img.shields.io/npm/v/libnpmconfig.svg)](https://npm.im/libnpmconfig) [![license](https://img.shields.io/npm/l/libnpmconfig.svg)](https://npm.im/libnpmconfig) [![Travis](https://img.shields.io/travis/npm/libnpmconfig.svg)](https://travis-ci.org/npm/libnpmconfig) [![AppVeyor](https://ci.appveyor.com/api/projects/status/github/zkat/libnpmconfig?svg=true)](https://ci.appveyor.com/project/zkat/libnpmconfig) [![Coverage Status](https://coveralls.io/repos/github/npm/libnpmconfig/badge.svg?branch=latest)](https://coveralls.io/github/npm/libnpmconfig?branch=latest) - -[`libnpmconfig`](https://github.com/npm/libnpmconfig) is a Node.js library for -programmatically managing npm's configuration files and data. - -## Example - -```js -const config = require('libnpmconfig') - -console.log('configured registry:', config.read({ - registry: 'https://default.registry/' -})) -// => configured registry: https://registry.npmjs.org -``` - -## Install - -`$ npm install libnpmconfig` - -## Table of Contents - -* [Example](#example) -* [Install](#install) -* [API](#api) - -### API - -##### `> read(cliOpts, builtinOpts)` - -Reads configurations from the filesystem and the env and returns a -[`figgy-pudding`](https://npm.im/figgy-pudding) object with the configuration -values. - -If `cliOpts` is provided, it will be merged with the returned config pudding, -shadowing any read values. These are intended as CLI-provided options. Do your -own `process.argv` parsing, though. - -If `builtinOpts.cwd` is provided, it will be used instead of `process.cwd()` as -the starting point for config searching. diff --git a/deps/npm/node_modules/libnpmconfig/index.js b/deps/npm/node_modules/libnpmconfig/index.js deleted file mode 100644 index 5501e26b75e7e6..00000000000000 --- a/deps/npm/node_modules/libnpmconfig/index.js +++ /dev/null @@ -1,107 +0,0 @@ -'use strict' - -const fs = require('fs') -const figgyPudding = require('figgy-pudding') -const findUp = require('find-up') -const ini = require('ini') -const os = require('os') -const path = require('path') - -const NpmConfig = figgyPudding({}, { - // Open up the pudding object. - other () { return true } -}) - -const ConfigOpts = figgyPudding({ - cache: { default: path.join(os.homedir(), '.npm') }, - configNames: { default: ['npmrc', '.npmrc'] }, - envPrefix: { default: /^npm_config_/i }, - cwd: { default: () => process.cwd() }, - globalconfig: { - default: () => path.join(getGlobalPrefix(), 'etc', 'npmrc') - }, - userconfig: { default: path.join(os.homedir(), '.npmrc') } -}) - -module.exports.read = getNpmConfig -function getNpmConfig (_opts, _builtin) { - const builtin = ConfigOpts(_builtin) - const env = {} - for (let key of Object.keys(process.env)) { - if (!key.match(builtin.envPrefix)) continue - const newKey = key.toLowerCase() - .replace(builtin.envPrefix, '') - .replace(/(?!^)_/g, '-') - env[newKey] = process.env[key] - } - const cli = NpmConfig(_opts) - const userConfPath = ( - builtin.userconfig || - cli.userconfig || - env.userconfig - ) - const user = userConfPath && maybeReadIni(userConfPath) - const globalConfPath = ( - builtin.globalconfig || - cli.globalconfig || - env.globalconfig - ) - const global = globalConfPath && maybeReadIni(globalConfPath) - const projConfPath = findUp.sync(builtin.configNames, { cwd: builtin.cwd }) - let proj = {} - if (projConfPath && projConfPath !== userConfPath) { - proj = maybeReadIni(projConfPath) - } - const newOpts = NpmConfig(builtin, global, user, proj, env, cli) - if (newOpts.cache) { - return newOpts.concat({ - cache: path.resolve( - ( - (cli.cache || env.cache) - ? builtin.cwd - : proj.cache - ? path.dirname(projConfPath) - : user.cache - ? path.dirname(userConfPath) - : global.cache - ? path.dirname(globalConfPath) - : path.dirname(userConfPath) - ), - newOpts.cache - ) - }) - } else { - return newOpts - } -} - -function maybeReadIni (f) { - let txt - try { - txt = fs.readFileSync(f, 'utf8') - } catch (err) { - if (err.code === 'ENOENT') { - return '' - } else { - throw err - } - } - return ini.parse(txt) -} - -function getGlobalPrefix () { - if (process.env.PREFIX) { - return process.env.PREFIX - } else if (process.platform === 'win32') { - // c:\node\node.exe --> prefix=c:\node\ - return path.dirname(process.execPath) - } else { - // /usr/local/bin/node --> prefix=/usr/local - let pref = path.dirname(path.dirname(process.execPath)) - // destdir only is respected on Unix - if (process.env.DESTDIR) { - pref = path.join(process.env.DESTDIR, pref) - } - return pref - } -} diff --git a/deps/npm/node_modules/libnpmconfig/node_modules/find-up/index.js b/deps/npm/node_modules/libnpmconfig/node_modules/find-up/index.js deleted file mode 100644 index 8e83819cea5a95..00000000000000 --- a/deps/npm/node_modules/libnpmconfig/node_modules/find-up/index.js +++ /dev/null @@ -1,46 +0,0 @@ -'use strict'; -const path = require('path'); -const locatePath = require('locate-path'); - -module.exports = (filename, opts = {}) => { - const startDir = path.resolve(opts.cwd || ''); - const {root} = path.parse(startDir); - - const filenames = [].concat(filename); - - return new Promise(resolve => { - (function find(dir) { - locatePath(filenames, {cwd: dir}).then(file => { - if (file) { - resolve(path.join(dir, file)); - } else if (dir === root) { - resolve(null); - } else { - find(path.dirname(dir)); - } - }); - })(startDir); - }); -}; - -module.exports.sync = (filename, opts = {}) => { - let dir = path.resolve(opts.cwd || ''); - const {root} = path.parse(dir); - - const filenames = [].concat(filename); - - // eslint-disable-next-line no-constant-condition - while (true) { - const file = locatePath.sync(filenames, {cwd: dir}); - - if (file) { - return path.join(dir, file); - } - - if (dir === root) { - return null; - } - - dir = path.dirname(dir); - } -}; diff --git a/deps/npm/node_modules/libnpmconfig/node_modules/find-up/license b/deps/npm/node_modules/libnpmconfig/node_modules/find-up/license deleted file mode 100644 index e7af2f77107d73..00000000000000 --- a/deps/npm/node_modules/libnpmconfig/node_modules/find-up/license +++ /dev/null @@ -1,9 +0,0 @@ -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/deps/npm/node_modules/libnpmconfig/node_modules/find-up/package.json b/deps/npm/node_modules/libnpmconfig/node_modules/find-up/package.json deleted file mode 100644 index d18dba3f17cec1..00000000000000 --- a/deps/npm/node_modules/libnpmconfig/node_modules/find-up/package.json +++ /dev/null @@ -1,82 +0,0 @@ -{ - "_from": "find-up@^3.0.0", - "_id": "find-up@3.0.0", - "_inBundle": false, - "_integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", - "_location": "/libnpmconfig/find-up", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "find-up@^3.0.0", - "name": "find-up", - "escapedName": "find-up", - "rawSpec": "^3.0.0", - "saveSpec": null, - "fetchSpec": "^3.0.0" - }, - "_requiredBy": [ - "/libnpmconfig" - ], - "_resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", - "_shasum": "49169f1d7993430646da61ecc5ae355c21c97b73", - "_spec": "find-up@^3.0.0", - "_where": "/Users/zkat/Documents/code/work/npm/node_modules/libnpmconfig", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "bugs": { - "url": "https://github.com/sindresorhus/find-up/issues" - }, - "bundleDependencies": false, - "dependencies": { - "locate-path": "^3.0.0" - }, - "deprecated": false, - "description": "Find a file or directory by walking up parent directories", - "devDependencies": { - "ava": "*", - "tempy": "^0.2.1", - "xo": "*" - }, - "engines": { - "node": ">=6" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/sindresorhus/find-up#readme", - "keywords": [ - "find", - "up", - "find-up", - "findup", - "look-up", - "look", - "file", - "search", - "match", - "package", - "resolve", - "parent", - "parents", - "folder", - "directory", - "dir", - "walk", - "walking", - "path" - ], - "license": "MIT", - "name": "find-up", - "repository": { - "type": "git", - "url": "git+https://github.com/sindresorhus/find-up.git" - }, - "scripts": { - "test": "xo && ava" - }, - "version": "3.0.0" -} diff --git a/deps/npm/node_modules/libnpmconfig/node_modules/find-up/readme.md b/deps/npm/node_modules/libnpmconfig/node_modules/find-up/readme.md deleted file mode 100644 index 810ad7ceb52766..00000000000000 --- a/deps/npm/node_modules/libnpmconfig/node_modules/find-up/readme.md +++ /dev/null @@ -1,87 +0,0 @@ -# find-up [![Build Status: Linux and macOS](https://travis-ci.org/sindresorhus/find-up.svg?branch=master)](https://travis-ci.org/sindresorhus/find-up) [![Build Status: Windows](https://ci.appveyor.com/api/projects/status/l0cyjmvh5lq72vq2/branch/master?svg=true)](https://ci.appveyor.com/project/sindresorhus/find-up/branch/master) - -> Find a file or directory by walking up parent directories - - -## Install - -``` -$ npm install find-up -``` - - -## Usage - -``` -/ -└── Users - └── sindresorhus - ├── unicorn.png - └── foo - └── bar - ├── baz - └── example.js -``` - -`example.js` - -```js -const findUp = require('find-up'); - -(async () => { - console.log(await findUp('unicorn.png')); - //=> '/Users/sindresorhus/unicorn.png' - - console.log(await findUp(['rainbow.png', 'unicorn.png'])); - //=> '/Users/sindresorhus/unicorn.png' -})(); -``` - - -## API - -### findUp(filename, [options]) - -Returns a `Promise` for either the filepath or `null` if it couldn't be found. - -### findUp([filenameA, filenameB], [options]) - -Returns a `Promise` for either the first filepath found (by respecting the order) or `null` if none could be found. - -### findUp.sync(filename, [options]) - -Returns a filepath or `null`. - -### findUp.sync([filenameA, filenameB], [options]) - -Returns the first filepath found (by respecting the order) or `null`. - -#### filename - -Type: `string` - -Filename of the file to find. - -#### options - -Type: `Object` - -##### cwd - -Type: `string`
    -Default: `process.cwd()` - -Directory to start from. - - -## Related - -- [find-up-cli](https://github.com/sindresorhus/find-up-cli) - CLI for this module -- [pkg-up](https://github.com/sindresorhus/pkg-up) - Find the closest package.json file -- [pkg-dir](https://github.com/sindresorhus/pkg-dir) - Find the root directory of an npm package -- [resolve-from](https://github.com/sindresorhus/resolve-from) - Resolve the path of a module like `require.resolve()` but from a given path - - -## License - -MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/deps/npm/node_modules/libnpmconfig/node_modules/locate-path/index.js b/deps/npm/node_modules/libnpmconfig/node_modules/locate-path/index.js deleted file mode 100644 index 5aae6ee4ad0277..00000000000000 --- a/deps/npm/node_modules/libnpmconfig/node_modules/locate-path/index.js +++ /dev/null @@ -1,24 +0,0 @@ -'use strict'; -const path = require('path'); -const pathExists = require('path-exists'); -const pLocate = require('p-locate'); - -module.exports = (iterable, options) => { - options = Object.assign({ - cwd: process.cwd() - }, options); - - return pLocate(iterable, el => pathExists(path.resolve(options.cwd, el)), options); -}; - -module.exports.sync = (iterable, options) => { - options = Object.assign({ - cwd: process.cwd() - }, options); - - for (const el of iterable) { - if (pathExists.sync(path.resolve(options.cwd, el))) { - return el; - } - } -}; diff --git a/deps/npm/node_modules/libnpmconfig/node_modules/locate-path/license b/deps/npm/node_modules/libnpmconfig/node_modules/locate-path/license deleted file mode 100644 index e7af2f77107d73..00000000000000 --- a/deps/npm/node_modules/libnpmconfig/node_modules/locate-path/license +++ /dev/null @@ -1,9 +0,0 @@ -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/deps/npm/node_modules/libnpmconfig/node_modules/locate-path/package.json b/deps/npm/node_modules/libnpmconfig/node_modules/locate-path/package.json deleted file mode 100644 index 54600c0c483dcf..00000000000000 --- a/deps/npm/node_modules/libnpmconfig/node_modules/locate-path/package.json +++ /dev/null @@ -1,76 +0,0 @@ -{ - "_from": "locate-path@^3.0.0", - "_id": "locate-path@3.0.0", - "_inBundle": false, - "_integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", - "_location": "/libnpmconfig/locate-path", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "locate-path@^3.0.0", - "name": "locate-path", - "escapedName": "locate-path", - "rawSpec": "^3.0.0", - "saveSpec": null, - "fetchSpec": "^3.0.0" - }, - "_requiredBy": [ - "/libnpmconfig/find-up" - ], - "_resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", - "_shasum": "dbec3b3ab759758071b58fe59fc41871af21400e", - "_spec": "locate-path@^3.0.0", - "_where": "/Users/zkat/Documents/code/work/npm/node_modules/libnpmconfig/node_modules/find-up", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "bugs": { - "url": "https://github.com/sindresorhus/locate-path/issues" - }, - "bundleDependencies": false, - "dependencies": { - "p-locate": "^3.0.0", - "path-exists": "^3.0.0" - }, - "deprecated": false, - "description": "Get the first path that exists on disk of multiple paths", - "devDependencies": { - "ava": "*", - "xo": "*" - }, - "engines": { - "node": ">=6" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/sindresorhus/locate-path#readme", - "keywords": [ - "locate", - "path", - "paths", - "file", - "files", - "exists", - "find", - "finder", - "search", - "searcher", - "array", - "iterable", - "iterator" - ], - "license": "MIT", - "name": "locate-path", - "repository": { - "type": "git", - "url": "git+https://github.com/sindresorhus/locate-path.git" - }, - "scripts": { - "test": "xo && ava" - }, - "version": "3.0.0" -} diff --git a/deps/npm/node_modules/libnpmconfig/node_modules/locate-path/readme.md b/deps/npm/node_modules/libnpmconfig/node_modules/locate-path/readme.md deleted file mode 100644 index a1d2e628328c2b..00000000000000 --- a/deps/npm/node_modules/libnpmconfig/node_modules/locate-path/readme.md +++ /dev/null @@ -1,99 +0,0 @@ -# locate-path [![Build Status](https://travis-ci.org/sindresorhus/locate-path.svg?branch=master)](https://travis-ci.org/sindresorhus/locate-path) - -> Get the first path that exists on disk of multiple paths - - -## Install - -``` -$ npm install locate-path -``` - - -## Usage - -Here we find the first file that exists on disk, in array order. - -```js -const locatePath = require('locate-path'); - -const files = [ - 'unicorn.png', - 'rainbow.png', // Only this one actually exists on disk - 'pony.png' -]; - -(async () => { - console(await locatePath(files)); - //=> 'rainbow' -})(); -``` - - -## API - -### locatePath(input, [options]) - -Returns a `Promise` for the first path that exists or `undefined` if none exists. - -#### input - -Type: `Iterable` - -Paths to check. - -#### options - -Type: `Object` - -##### concurrency - -Type: `number`
    -Default: `Infinity`
    -Minimum: `1` - -Number of concurrently pending promises. - -##### preserveOrder - -Type: `boolean`
    -Default: `true` - -Preserve `input` order when searching. - -Disable this to improve performance if you don't care about the order. - -##### cwd - -Type: `string`
    -Default: `process.cwd()` - -Current working directory. - -### locatePath.sync(input, [options]) - -Returns the first path that exists or `undefined` if none exists. - -#### input - -Type: `Iterable` - -Paths to check. - -#### options - -Type: `Object` - -##### cwd - -Same as above. - - -## Related - -- [path-exists](https://github.com/sindresorhus/path-exists) - Check if a path exists - - -## License - -MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/deps/npm/node_modules/libnpmconfig/node_modules/p-limit/index.d.ts b/deps/npm/node_modules/libnpmconfig/node_modules/p-limit/index.d.ts deleted file mode 100644 index 02988aaf89f999..00000000000000 --- a/deps/npm/node_modules/libnpmconfig/node_modules/p-limit/index.d.ts +++ /dev/null @@ -1,29 +0,0 @@ -export interface Limit { - /** - * @param fn - Promise-returning/async function. - * @param arguments - Any arguments to pass through to `fn`. Support for passing arguments on to the `fn` is provided in order to be able to avoid creating unnecessary closures. You probably don't need this optimization unless you're pushing a lot of functions. - * @returns The promise returned by calling `fn(...arguments)`. - */ - ( - fn: (...arguments: Arguments) => PromiseLike | ReturnType, - ...arguments: Arguments - ): Promise; - - /** - * The number of promises that are currently running. - */ - readonly activeCount: number; - - /** - * The number of promises that are waiting to run (i.e. their internal `fn` was not called yet). - */ - readonly pendingCount: number; -} - -/** - * Run multiple promise-returning & async functions with limited concurrency. - * - * @param concurrency - Concurrency limit. Minimum: `1`. - * @returns A `limit` function. - */ -export default function pLimit(concurrency: number): Limit; diff --git a/deps/npm/node_modules/libnpmconfig/node_modules/p-limit/index.js b/deps/npm/node_modules/libnpmconfig/node_modules/p-limit/index.js deleted file mode 100644 index d22fbe8a49d0ac..00000000000000 --- a/deps/npm/node_modules/libnpmconfig/node_modules/p-limit/index.js +++ /dev/null @@ -1,52 +0,0 @@ -'use strict'; -const pTry = require('p-try'); - -const pLimit = concurrency => { - if (concurrency < 1) { - throw new TypeError('Expected `concurrency` to be a number from 1 and up'); - } - - const queue = []; - let activeCount = 0; - - const next = () => { - activeCount--; - - if (queue.length > 0) { - queue.shift()(); - } - }; - - const run = (fn, resolve, ...args) => { - activeCount++; - - const result = pTry(fn, ...args); - - resolve(result); - - result.then(next, next); - }; - - const enqueue = (fn, resolve, ...args) => { - if (activeCount < concurrency) { - run(fn, resolve, ...args); - } else { - queue.push(run.bind(null, fn, resolve, ...args)); - } - }; - - const generator = (fn, ...args) => new Promise(resolve => enqueue(fn, resolve, ...args)); - Object.defineProperties(generator, { - activeCount: { - get: () => activeCount - }, - pendingCount: { - get: () => queue.length - } - }); - - return generator; -}; - -module.exports = pLimit; -module.exports.default = pLimit; diff --git a/deps/npm/node_modules/libnpmconfig/node_modules/p-limit/license b/deps/npm/node_modules/libnpmconfig/node_modules/p-limit/license deleted file mode 100644 index e7af2f77107d73..00000000000000 --- a/deps/npm/node_modules/libnpmconfig/node_modules/p-limit/license +++ /dev/null @@ -1,9 +0,0 @@ -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/deps/npm/node_modules/libnpmconfig/node_modules/p-limit/package.json b/deps/npm/node_modules/libnpmconfig/node_modules/p-limit/package.json deleted file mode 100644 index 9c9c7d9ffc077e..00000000000000 --- a/deps/npm/node_modules/libnpmconfig/node_modules/p-limit/package.json +++ /dev/null @@ -1,83 +0,0 @@ -{ - "_from": "p-limit@^2.0.0", - "_id": "p-limit@2.2.0", - "_inBundle": false, - "_integrity": "sha512-pZbTJpoUsCzV48Mc9Nh51VbwO0X9cuPFE8gYwx9BTCt9SF8/b7Zljd2fVgOxhIF/HDTKgpVzs+GPhyKfjLLFRQ==", - "_location": "/libnpmconfig/p-limit", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "p-limit@^2.0.0", - "name": "p-limit", - "escapedName": "p-limit", - "rawSpec": "^2.0.0", - "saveSpec": null, - "fetchSpec": "^2.0.0" - }, - "_requiredBy": [ - "/libnpmconfig/p-locate" - ], - "_resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.2.0.tgz", - "_shasum": "417c9941e6027a9abcba5092dd2904e255b5fbc2", - "_spec": "p-limit@^2.0.0", - "_where": "/Users/isaacs/dev/npm/cli/node_modules/libnpmconfig/node_modules/p-locate", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "bugs": { - "url": "https://github.com/sindresorhus/p-limit/issues" - }, - "bundleDependencies": false, - "dependencies": { - "p-try": "^2.0.0" - }, - "deprecated": false, - "description": "Run multiple promise-returning & async functions with limited concurrency", - "devDependencies": { - "ava": "^1.2.1", - "delay": "^4.1.0", - "in-range": "^1.0.0", - "random-int": "^1.0.0", - "time-span": "^2.0.0", - "tsd-check": "^0.3.0", - "xo": "^0.24.0" - }, - "engines": { - "node": ">=6" - }, - "files": [ - "index.js", - "index.d.ts" - ], - "homepage": "https://github.com/sindresorhus/p-limit#readme", - "keywords": [ - "promise", - "limit", - "limited", - "concurrency", - "throttle", - "throat", - "rate", - "batch", - "ratelimit", - "task", - "queue", - "async", - "await", - "promises", - "bluebird" - ], - "license": "MIT", - "name": "p-limit", - "repository": { - "type": "git", - "url": "git+https://github.com/sindresorhus/p-limit.git" - }, - "scripts": { - "test": "xo && ava && tsd-check" - }, - "version": "2.2.0" -} diff --git a/deps/npm/node_modules/libnpmconfig/node_modules/p-limit/readme.md b/deps/npm/node_modules/libnpmconfig/node_modules/p-limit/readme.md deleted file mode 100644 index b87f3e0c9c3153..00000000000000 --- a/deps/npm/node_modules/libnpmconfig/node_modules/p-limit/readme.md +++ /dev/null @@ -1,90 +0,0 @@ -# p-limit [![Build Status](https://travis-ci.org/sindresorhus/p-limit.svg?branch=master)](https://travis-ci.org/sindresorhus/p-limit) - -> Run multiple promise-returning & async functions with limited concurrency - - -## Install - -``` -$ npm install p-limit -``` - - -## Usage - -```js -const pLimit = require('p-limit'); - -const limit = pLimit(1); - -const input = [ - limit(() => fetchSomething('foo')), - limit(() => fetchSomething('bar')), - limit(() => doSomething()) -]; - -(async () => { - // Only one promise is run at once - const result = await Promise.all(input); - console.log(result); -})(); -``` - - -## API - -### pLimit(concurrency) - -Returns a `limit` function. - -#### concurrency - -Type: `number`
    -Minimum: `1` - -Concurrency limit. - -### limit(fn, ...args) - -Returns the promise returned by calling `fn(...args)`. - -#### fn - -Type: `Function` - -Promise-returning/async function. - -#### args - -Any arguments to pass through to `fn`. - -Support for passing arguments on to the `fn` is provided in order to be able to avoid creating unnecessary closures. You probably don't need this optimization unless you're pushing a *lot* of functions. - -### limit.activeCount - -The number of promises that are currently running. - -### limit.pendingCount - -The number of promises that are waiting to run (i.e. their internal `fn` was not called yet). - - -## FAQ - -### How is this different from the [`p-queue`](https://github.com/sindresorhus/p-queue) package? - -This package is only about limiting the number of concurrent executions, while `p-queue` is a fully featured queue implementation with lots of different options, introspection, and ability to pause and clear the queue. - - -## Related - -- [p-queue](https://github.com/sindresorhus/p-queue) - Promise queue with concurrency control -- [p-throttle](https://github.com/sindresorhus/p-throttle) - Throttle promise-returning & async functions -- [p-debounce](https://github.com/sindresorhus/p-debounce) - Debounce promise-returning & async functions -- [p-all](https://github.com/sindresorhus/p-all) - Run promise-returning & async functions concurrently with optional limited concurrency -- [More…](https://github.com/sindresorhus/promise-fun) - - -## License - -MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/deps/npm/node_modules/libnpmconfig/node_modules/p-locate/index.js b/deps/npm/node_modules/libnpmconfig/node_modules/p-locate/index.js deleted file mode 100644 index 4bd08aad193128..00000000000000 --- a/deps/npm/node_modules/libnpmconfig/node_modules/p-locate/index.js +++ /dev/null @@ -1,34 +0,0 @@ -'use strict'; -const pLimit = require('p-limit'); - -class EndError extends Error { - constructor(value) { - super(); - this.value = value; - } -} - -// The input can also be a promise, so we `Promise.resolve()` it -const testElement = (el, tester) => Promise.resolve(el).then(tester); - -// The input can also be a promise, so we `Promise.all()` them both -const finder = el => Promise.all(el).then(val => val[1] === true && Promise.reject(new EndError(val[0]))); - -module.exports = (iterable, tester, opts) => { - opts = Object.assign({ - concurrency: Infinity, - preserveOrder: true - }, opts); - - const limit = pLimit(opts.concurrency); - - // Start all the promises concurrently with optional limit - const items = [...iterable].map(el => [el, limit(testElement, el, tester)]); - - // Check the promises either serially or concurrently - const checkLimit = pLimit(opts.preserveOrder ? 1 : Infinity); - - return Promise.all(items.map(el => checkLimit(finder, el))) - .then(() => {}) - .catch(err => err instanceof EndError ? err.value : Promise.reject(err)); -}; diff --git a/deps/npm/node_modules/libnpmconfig/node_modules/p-locate/license b/deps/npm/node_modules/libnpmconfig/node_modules/p-locate/license deleted file mode 100644 index e7af2f77107d73..00000000000000 --- a/deps/npm/node_modules/libnpmconfig/node_modules/p-locate/license +++ /dev/null @@ -1,9 +0,0 @@ -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/deps/npm/node_modules/libnpmconfig/node_modules/p-locate/package.json b/deps/npm/node_modules/libnpmconfig/node_modules/p-locate/package.json deleted file mode 100644 index d49e3027e1e689..00000000000000 --- a/deps/npm/node_modules/libnpmconfig/node_modules/p-locate/package.json +++ /dev/null @@ -1,83 +0,0 @@ -{ - "_from": "p-locate@^3.0.0", - "_id": "p-locate@3.0.0", - "_inBundle": false, - "_integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", - "_location": "/libnpmconfig/p-locate", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "p-locate@^3.0.0", - "name": "p-locate", - "escapedName": "p-locate", - "rawSpec": "^3.0.0", - "saveSpec": null, - "fetchSpec": "^3.0.0" - }, - "_requiredBy": [ - "/libnpmconfig/locate-path" - ], - "_resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz", - "_shasum": "322d69a05c0264b25997d9f40cd8a891ab0064a4", - "_spec": "p-locate@^3.0.0", - "_where": "/Users/zkat/Documents/code/work/npm/node_modules/libnpmconfig/node_modules/locate-path", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "bugs": { - "url": "https://github.com/sindresorhus/p-locate/issues" - }, - "bundleDependencies": false, - "dependencies": { - "p-limit": "^2.0.0" - }, - "deprecated": false, - "description": "Get the first fulfilled promise that satisfies the provided testing function", - "devDependencies": { - "ava": "*", - "delay": "^3.0.0", - "in-range": "^1.0.0", - "time-span": "^2.0.0", - "xo": "*" - }, - "engines": { - "node": ">=6" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/sindresorhus/p-locate#readme", - "keywords": [ - "promise", - "locate", - "find", - "finder", - "search", - "searcher", - "test", - "array", - "collection", - "iterable", - "iterator", - "race", - "fulfilled", - "fastest", - "async", - "await", - "promises", - "bluebird" - ], - "license": "MIT", - "name": "p-locate", - "repository": { - "type": "git", - "url": "git+https://github.com/sindresorhus/p-locate.git" - }, - "scripts": { - "test": "xo && ava" - }, - "version": "3.0.0" -} diff --git a/deps/npm/node_modules/libnpmconfig/node_modules/p-locate/readme.md b/deps/npm/node_modules/libnpmconfig/node_modules/p-locate/readme.md deleted file mode 100644 index 3b0173bc4ea784..00000000000000 --- a/deps/npm/node_modules/libnpmconfig/node_modules/p-locate/readme.md +++ /dev/null @@ -1,88 +0,0 @@ -# p-locate [![Build Status](https://travis-ci.org/sindresorhus/p-locate.svg?branch=master)](https://travis-ci.org/sindresorhus/p-locate) - -> Get the first fulfilled promise that satisfies the provided testing function - -Think of it like an async version of [`Array#find`](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Array/find). - - -## Install - -``` -$ npm install p-locate -``` - - -## Usage - -Here we find the first file that exists on disk, in array order. - -```js -const pathExists = require('path-exists'); -const pLocate = require('p-locate'); - -const files = [ - 'unicorn.png', - 'rainbow.png', // Only this one actually exists on disk - 'pony.png' -]; - -(async () => { - const foundPath = await pLocate(files, file => pathExists(file)); - - console.log(foundPath); - //=> 'rainbow' -})(); -``` - -*The above is just an example. Use [`locate-path`](https://github.com/sindresorhus/locate-path) if you need this.* - - -## API - -### pLocate(input, tester, [options]) - -Returns a `Promise` that is fulfilled when `tester` resolves to `true` or the iterable is done, or rejects if any of the promises reject. The fulfilled value is the current iterable value or `undefined` if `tester` never resolved to `true`. - -#### input - -Type: `Iterable` - -#### tester(element) - -Type: `Function` - -Expected to return a `Promise` or boolean. - -#### options - -Type: `Object` - -##### concurrency - -Type: `number`
    -Default: `Infinity`
    -Minimum: `1` - -Number of concurrently pending promises returned by `tester`. - -##### preserveOrder - -Type: `boolean`
    -Default: `true` - -Preserve `input` order when searching. - -Disable this to improve performance if you don't care about the order. - - -## Related - -- [p-map](https://github.com/sindresorhus/p-map) - Map over promises concurrently -- [p-filter](https://github.com/sindresorhus/p-filter) - Filter promises concurrently -- [p-any](https://github.com/sindresorhus/p-any) - Wait for any promise to be fulfilled -- [More…](https://github.com/sindresorhus/promise-fun) - - -## License - -MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/deps/npm/node_modules/libnpmconfig/node_modules/p-try/index.d.ts b/deps/npm/node_modules/libnpmconfig/node_modules/p-try/index.d.ts deleted file mode 100644 index 2a7319ec2a5568..00000000000000 --- a/deps/npm/node_modules/libnpmconfig/node_modules/p-try/index.d.ts +++ /dev/null @@ -1,39 +0,0 @@ -declare const pTry: { - /** - Start a promise chain. - - @param fn - The function to run to start the promise chain. - @param arguments - Arguments to pass to `fn`. - @returns The value of calling `fn(...arguments)`. If the function throws an error, the returned `Promise` will be rejected with that error. - - @example - ``` - import pTry = require('p-try'); - - (async () => { - try { - const value = await pTry(() => { - return synchronousFunctionThatMightThrow(); - }); - console.log(value); - } catch (error) { - console.error(error); - } - })(); - ``` - */ - ( - fn: (...arguments: ArgumentsType) => PromiseLike | ValueType, - ...arguments: ArgumentsType - ): Promise; - - // TODO: remove this in the next major version, refactor the whole definition to: - // declare function pTry( - // fn: (...arguments: ArgumentsType) => PromiseLike | ValueType, - // ...arguments: ArgumentsType - // ): Promise; - // export = pTry; - default: typeof pTry; -}; - -export = pTry; diff --git a/deps/npm/node_modules/libnpmconfig/node_modules/p-try/index.js b/deps/npm/node_modules/libnpmconfig/node_modules/p-try/index.js deleted file mode 100644 index db858da29252b8..00000000000000 --- a/deps/npm/node_modules/libnpmconfig/node_modules/p-try/index.js +++ /dev/null @@ -1,9 +0,0 @@ -'use strict'; - -const pTry = (fn, ...arguments_) => new Promise(resolve => { - resolve(fn(...arguments_)); -}); - -module.exports = pTry; -// TODO: remove this in the next major version -module.exports.default = pTry; diff --git a/deps/npm/node_modules/libnpmconfig/node_modules/p-try/license b/deps/npm/node_modules/libnpmconfig/node_modules/p-try/license deleted file mode 100644 index e7af2f77107d73..00000000000000 --- a/deps/npm/node_modules/libnpmconfig/node_modules/p-try/license +++ /dev/null @@ -1,9 +0,0 @@ -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/deps/npm/node_modules/libnpmconfig/node_modules/p-try/package.json b/deps/npm/node_modules/libnpmconfig/node_modules/p-try/package.json deleted file mode 100644 index af14d60c3680e7..00000000000000 --- a/deps/npm/node_modules/libnpmconfig/node_modules/p-try/package.json +++ /dev/null @@ -1,74 +0,0 @@ -{ - "_from": "p-try@^2.0.0", - "_id": "p-try@2.2.0", - "_inBundle": false, - "_integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", - "_location": "/libnpmconfig/p-try", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "p-try@^2.0.0", - "name": "p-try", - "escapedName": "p-try", - "rawSpec": "^2.0.0", - "saveSpec": null, - "fetchSpec": "^2.0.0" - }, - "_requiredBy": [ - "/libnpmconfig/p-limit" - ], - "_resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", - "_shasum": "cb2868540e313d61de58fafbe35ce9004d5540e6", - "_spec": "p-try@^2.0.0", - "_where": "/Users/isaacs/dev/npm/cli/node_modules/libnpmconfig/node_modules/p-limit", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "bugs": { - "url": "https://github.com/sindresorhus/p-try/issues" - }, - "bundleDependencies": false, - "deprecated": false, - "description": "`Start a promise chain", - "devDependencies": { - "ava": "^1.4.1", - "tsd": "^0.7.1", - "xo": "^0.24.0" - }, - "engines": { - "node": ">=6" - }, - "files": [ - "index.js", - "index.d.ts" - ], - "homepage": "https://github.com/sindresorhus/p-try#readme", - "keywords": [ - "promise", - "try", - "resolve", - "function", - "catch", - "async", - "await", - "promises", - "settled", - "ponyfill", - "polyfill", - "shim", - "bluebird" - ], - "license": "MIT", - "name": "p-try", - "repository": { - "type": "git", - "url": "git+https://github.com/sindresorhus/p-try.git" - }, - "scripts": { - "test": "xo && ava && tsd" - }, - "version": "2.2.0" -} diff --git a/deps/npm/node_modules/libnpmconfig/node_modules/p-try/readme.md b/deps/npm/node_modules/libnpmconfig/node_modules/p-try/readme.md deleted file mode 100644 index 4d7bd64dfcb8ba..00000000000000 --- a/deps/npm/node_modules/libnpmconfig/node_modules/p-try/readme.md +++ /dev/null @@ -1,58 +0,0 @@ -# p-try [![Build Status](https://travis-ci.org/sindresorhus/p-try.svg?branch=master)](https://travis-ci.org/sindresorhus/p-try) - -> Start a promise chain - -[How is it useful?](http://cryto.net/~joepie91/blog/2016/05/11/what-is-promise-try-and-why-does-it-matter/) - - -## Install - -``` -$ npm install p-try -``` - - -## Usage - -```js -const pTry = require('p-try'); - -(async () => { - try { - const value = await pTry(() => { - return synchronousFunctionThatMightThrow(); - }); - console.log(value); - } catch (error) { - console.error(error); - } -})(); -``` - - -## API - -### pTry(fn, ...arguments) - -Returns a `Promise` resolved with the value of calling `fn(...arguments)`. If the function throws an error, the returned `Promise` will be rejected with that error. - -Support for passing arguments on to the `fn` is provided in order to be able to avoid creating unnecessary closures. You probably don't need this optimization unless you're pushing a *lot* of functions. - -#### fn - -The function to run to start the promise chain. - -#### arguments - -Arguments to pass to `fn`. - - -## Related - -- [p-finally](https://github.com/sindresorhus/p-finally) - `Promise#finally()` ponyfill - Invoked when the promise is settled regardless of outcome -- [More…](https://github.com/sindresorhus/promise-fun) - - -## License - -MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/deps/npm/node_modules/libnpmconfig/package.json b/deps/npm/node_modules/libnpmconfig/package.json deleted file mode 100644 index d272290b32fa40..00000000000000 --- a/deps/npm/node_modules/libnpmconfig/package.json +++ /dev/null @@ -1,66 +0,0 @@ -{ - "_from": "libnpmconfig@^1.1.1", - "_id": "libnpmconfig@1.2.1", - "_inBundle": false, - "_integrity": "sha512-9esX8rTQAHqarx6qeZqmGQKBNZR5OIbl/Ayr0qQDy3oXja2iFVQQI81R6GZ2a02bSNZ9p3YOGX1O6HHCb1X7kA==", - "_location": "/libnpmconfig", - "_phantomChildren": { - "path-exists": "3.0.0" - }, - "_requested": { - "type": "range", - "registry": true, - "raw": "libnpmconfig@^1.1.1", - "name": "libnpmconfig", - "escapedName": "libnpmconfig", - "rawSpec": "^1.1.1", - "saveSpec": null, - "fetchSpec": "^1.1.1" - }, - "_requiredBy": [ - "/libnpm" - ], - "_resolved": "https://registry.npmjs.org/libnpmconfig/-/libnpmconfig-1.2.1.tgz", - "_shasum": "c0c2f793a74e67d4825e5039e7a02a0044dfcbc0", - "_spec": "libnpmconfig@^1.1.1", - "_where": "/Users/zkat/Documents/code/work/npm/node_modules/libnpm", - "author": { - "name": "Kat Marchán", - "email": "kzm@zkat.tech" - }, - "bugs": { - "url": "https://github.com/npm/libnpmconfig/issues" - }, - "bundleDependencies": false, - "dependencies": { - "figgy-pudding": "^3.5.1", - "find-up": "^3.0.0", - "ini": "^1.3.5" - }, - "deprecated": false, - "description": "Standalone library for reading/writing/managing npm configurations", - "devDependencies": { - "standard": "*", - "standard-version": "*", - "tap": "*", - "weallbehave": "*", - "weallcontribute": "*" - }, - "homepage": "https://npmjs.com/package/libnpmconfig", - "license": "ISC", - "name": "libnpmconfig", - "repository": { - "type": "git", - "url": "git+https://github.com/npm/libnpmconfig.git" - }, - "scripts": { - "postrelease": "npm publish && git push --follow-tags", - "prerelease": "npm t", - "pretest": "standard", - "release": "standard-version -s", - "test": "tap -J --100 test/*.js", - "update-coc": "weallbehave -o . && git add CODE_OF_CONDUCT.md && git commit -m 'docs(coc): updated CODE_OF_CONDUCT.md'", - "update-contrib": "weallcontribute -o . && git add CONTRIBUTING.md && git commit -m 'docs(contributing): updated CONTRIBUTING.md'" - }, - "version": "1.2.1" -} diff --git a/deps/npm/node_modules/libnpmfund/CHANGELOG.md b/deps/npm/node_modules/libnpmfund/CHANGELOG.md new file mode 100644 index 00000000000000..a50779fcdc430c --- /dev/null +++ b/deps/npm/node_modules/libnpmfund/CHANGELOG.md @@ -0,0 +1,5 @@ +# Changelog + +## 0.0.0-pre.0 + +- Initial pre-release. diff --git a/deps/npm/node_modules/libnpmfund/LICENSE b/deps/npm/node_modules/libnpmfund/LICENSE new file mode 100644 index 00000000000000..dedcd7d2f9daec --- /dev/null +++ b/deps/npm/node_modules/libnpmfund/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) npm Inc. + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/deps/npm/node_modules/libnpmfund/README.md b/deps/npm/node_modules/libnpmfund/README.md new file mode 100644 index 00000000000000..c373a9ceb7dd57 --- /dev/null +++ b/deps/npm/node_modules/libnpmfund/README.md @@ -0,0 +1,129 @@ +# libnpmfund + +[![npm version](https://img.shields.io/npm/v/libnpmfund.svg)](https://npm.im/libnpmfund) +[![license](https://img.shields.io/npm/l/libnpmfund.svg)](https://npm.im/libnpmfund) +[![GitHub Actions](https://github.com/npm/libnpmfund/workflows/node-ci/badge.svg)](https://github.com/npm/libnpmfund/actions?query=workflow%3Anode-ci) +[![Coverage Status](https://coveralls.io/repos/github/npm/libnpmfund/badge.svg?branch=master)](https://coveralls.io/github/npm/libnpmfund?branch=master) + +[`libnpmfund`](https://github.com/npm/libnpmfund) is a Node.js library for +retrieving **funding** information for packages installed using +[`arborist`](https://github.com/npm/arborist). + +## Table of Contents + +* [Example](#example) +* [Install](#install) +* [Contributing](#contributing) +* [API](#api) +* [LICENSE](#license) + +## Example + +```js +const { read } = require('libnpmfund') + +const fundingInfo = await read() +console.log( + JSON.stringify(fundingInfo, null, 2) +) +// => { + length: 2, + name: 'foo', + version: '1.0.0', + funding: { url: 'https://example.com' }, + dependencies: { + bar: { + version: '1.0.0', + funding: { url: 'http://collective.example.com' } + } + } +} +``` + +## Install + +`$ npm install libnpmfund` + +### Contributing + +The npm team enthusiastically welcomes contributions and project participation! +There's a bunch of things you can do if you want to contribute! The +[Contributor Guide](https://github.com/npm/cli/blob/latest/CONTRIBUTING.md) +outlines the process for community interaction and contribution. Please don't +hesitate to jump in if you'd like to, or even ask us questions if something +isn't clear. + +All participants and maintainers in this project are expected to follow the +[npm Code of Conduct](https://www.npmjs.com/policies/conduct), and just +generally be excellent to each other. + +Please refer to the [Changelog](CHANGELOG.md) for project history details, too. + +Happy hacking! + +### API + +##### `> fund.read([opts]) -> Promise` + +Reads **funding** info from a npm install and returns a promise for a +tree object that only contains packages in which funding info is defined. + +Options: + +- `countOnly`: Uses the tree-traversal logic from **npm fund** but skips over +any obj definition and just returns an obj containing `{ length }` - useful for +things such as printing a `6 packages are looking for funding` msg. +- `path`: Location to current working directory + +##### `> fund.readTree(tree, [opts]) -> Promise` + +Reads **funding** info from a given install tree and returns a tree object +that only contains packages in which funding info is defined. + +- `tree`: An [`arborist`](https://github.com/npm/arborist) tree to be used, e.g: + +```js +const Arborist = require('@npmcli/arborist') +const { readTree } = require('libnpmfund') + +const arb = new Arborist({ path: process.cwd() }) +const tree = await arb.loadActual() + +return readTree(tree, { countOnly: false }) +``` + +Options: + +- `countOnly`: Uses the tree-traversal logic from **npm fund** but skips over +any obj definition and just returns an obj containing `{ length }` - useful for +things such as printing a `6 packages are looking for funding` msg. + +##### `> fund.normalizeFunding(funding) -> Object` + +From a `funding` ``, retrieves normalized funding objects +containing a `url` property. + +e.g: + +```js +normalizeFunding('http://example.com') +// => { + url: 'http://example.com' +} +``` + +##### `> fund.isValidFunding(funding) -> Boolean` + +Returns `` if `funding` is a valid funding object, e.g: + +```js +isValidFunding({ foo: 'not a valid funding obj' }) +// => false + +isValidFunding('http://example.com') +// => true +``` + +## LICENSE + +[ISC](./LICENSE) diff --git a/deps/npm/node_modules/libnpmfund/index.js b/deps/npm/node_modules/libnpmfund/index.js new file mode 100644 index 00000000000000..58aba028e36221 --- /dev/null +++ b/deps/npm/node_modules/libnpmfund/index.js @@ -0,0 +1,183 @@ +'use strict' + +const URL = require('url').URL +const Arborist = require('@npmcli/arborist') + +// supports object funding and string shorthand, or an array of these +// if original was an array, returns an array; else returns the lone item +function normalizeFunding (funding) { + const normalizeItem = item => + typeof item === 'string' ? { url: item } : item + const sources = [].concat(funding || []).map(normalizeItem) + return Array.isArray(funding) ? sources : sources[0] +} + +// Is the value of a `funding` property of a `package.json` +// a valid type+url for `npm fund` to display? +function isValidFunding (funding) { + if (!funding) return false + + if (Array.isArray(funding)) { + return funding.every(f => !Array.isArray(f) && isValidFunding(f)) + } + + try { + var parsed = new URL(funding.url || funding) + } catch (error) { + return false + } + + if ( + parsed.protocol !== 'https:' && + parsed.protocol !== 'http:' + ) return false + + return Boolean(parsed.host) +} + +const empty = () => Object.create(null) + +function readTree (tree, opts) { + let packageWithFundingCount = 0 + const seen = new Set() + const { countOnly } = opts || {} + const _trailingDependencies = Symbol('trailingDependencies') + + function tracked (name, version) { + const key = String(name) + String(version) + if (seen.has(key)) { + return true + } + seen.add(key) + } + + function retrieveDependencies (dependencies) { + const trailing = dependencies[_trailingDependencies] + + if (trailing) { + return Object.assign( + empty(), + dependencies, + trailing + ) + } + + return dependencies + } + + function hasDependencies (dependencies) { + return dependencies && ( + Object.keys(dependencies).length || + dependencies[_trailingDependencies] + ) + } + + function attachFundingInfo (target, funding) { + if (funding && isValidFunding(funding)) { + target.funding = normalizeFunding(funding) + packageWithFundingCount++ + } + } + + function getFundingDependencies (tree) { + const edges = tree && tree.edgesOut && tree.edgesOut.values() + if (!edges) return empty() + + const directDepsWithFunding = Array.from(edges).map(edge => { + if (!edge || !edge.to) return empty() + + const node = edge.to.target || edge.to + if (!node.package) return empty() + + const { name, funding, version } = node.package + + // avoids duplicated items within the funding tree + if (tracked(name, version)) return empty() + + const fundingItem = {} + + if (version) { + fundingItem.version = version + } + + attachFundingInfo(fundingItem, funding) + + return { + node, + fundingItem + } + }) + + return directDepsWithFunding.reduce( + (res, { node, fundingItem }, i) => { + if (!fundingItem || + fundingItem.length === 0 || + !node) return res + + // recurse + const transitiveDependencies = node.edgesOut && + node.edgesOut.size > 0 && + getFundingDependencies(node) + + // if we're only counting items there's no need + // to add all the data to the resulting object + if (countOnly) return null + + if (hasDependencies(transitiveDependencies)) { + fundingItem.dependencies = + retrieveDependencies(transitiveDependencies) + } + + if (isValidFunding(fundingItem.funding)) { + res[node.package.name] = fundingItem + } else if (hasDependencies(fundingItem.dependencies)) { + res[_trailingDependencies] = + Object.assign( + empty(), + res[_trailingDependencies], + fundingItem.dependencies + ) + } + + return res + }, countOnly ? null : empty()) + } + + const treeDependencies = getFundingDependencies(tree) + const result = { + length: packageWithFundingCount + } + + if (!countOnly) { + const name = + (tree && tree.package && tree.package.name) || + (tree && tree.name) + result.name = name || (tree && tree.path) + + if (tree && tree.package && tree.package.version) { + result.version = tree.package.version + } + + if (tree && tree.package && tree.package.funding) { + result.funding = normalizeFunding(tree.package.funding) + } + + result.dependencies = retrieveDependencies(treeDependencies) + } + + return result +} + +async function read (opts) { + const arb = new Arborist(opts) + const tree = await arb.loadActual() + + return readTree(tree, opts) +} + +module.exports = { + read, + readTree, + normalizeFunding, + isValidFunding +} diff --git a/deps/npm/node_modules/libnpmfund/package.json b/deps/npm/node_modules/libnpmfund/package.json new file mode 100644 index 00000000000000..4710accd3cf513 --- /dev/null +++ b/deps/npm/node_modules/libnpmfund/package.json @@ -0,0 +1,52 @@ +{ + "name": "libnpmfund", + "version": "0.0.0", + "files": [ + "index.js" + ], + "description": "Programmatic API for npm fund", + "repository": "https://github.com/npm/libnpmfund", + "keywords": [ + "npm", + "npmcli", + "libnpm", + "cli", + "git", + "fund", + "gitfund" + ], + "author": "npm Inc. ", + "contributors": [ + { + "name": "Ruy Adorno", + "url": "https://ruyadorno.com", + "twitter": "ruyadorno" + } + ], + "license": "ISC", + "scripts": { + "lint": "standard", + "pretest": "npm run lint", + "test": "tap", + "snap": "tap", + "preversion": "npm test", + "postversion": "npm publish", + "prepublishOnly": "git push origin --follow-tags" + }, + "tap": { + "check-coverage": true + }, + "standard": { + "ignore": [ + "/tap-snapshots/" + ] + }, + "devDependencies": { + "require-inject": "^1.4.4", + "standard": "^14.3.4", + "tap": "^14.10.7" + }, + "dependencies": { + "@npmcli/arborist": "1 || 0" + } +} diff --git a/deps/npm/node_modules/libnpmhook/CHANGELOG.md b/deps/npm/node_modules/libnpmhook/CHANGELOG.md index 4121122e0b7355..05572749722598 100644 --- a/deps/npm/node_modules/libnpmhook/CHANGELOG.md +++ b/deps/npm/node_modules/libnpmhook/CHANGELOG.md @@ -1,11 +1,20 @@ # 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. + +# [6.0.0](https://github.com/npm/libnpmhook/compare/v5.0.2...v6.0.0) (2020-02-26) + +### Breaking Changes + +* [`aa629b4`](https://github.com/npm/libnpmhook/commit/aa629b4) fix: remove figgy-pudding ([@claudiahdz](https://github.com/claudiahdz)) - -## [5.0.3](https://github.com/npm/libnpmhook/compare/v5.0.2...v5.0.3) (2019-07-16) +### Miscellaneuous +* [`ea795fb`](https://github.com/npm/libnpmhook/commit/ea795fb) chore: basic project updates ([@claudiahdz](https://github.com/claudiahdz)) +* [`a0fdf7e`](https://github.com/npm/libnpmhook/commit/a0fdf7e) chore: cleanup badges, contrib, readme ([@ruyadorno](https://github.com/ruyadorno)) +--- + +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. ## [5.0.2](https://github.com/npm/libnpmhook/compare/v5.0.1...v5.0.2) (2018-08-24) diff --git a/deps/npm/node_modules/libnpmhook/README.md b/deps/npm/node_modules/libnpmhook/README.md index 9a13d055317a51..ce6e8c1a519898 100644 --- a/deps/npm/node_modules/libnpmhook/README.md +++ b/deps/npm/node_modules/libnpmhook/README.md @@ -1,4 +1,8 @@ -# libnpmhook [![npm version](https://img.shields.io/npm/v/libnpmhook.svg)](https://npm.im/libnpmhook) [![license](https://img.shields.io/npm/l/libnpmhook.svg)](https://npm.im/libnpmhook) [![Travis](https://img.shields.io/travis/npm/libnpmhook.svg)](https://travis-ci.org/npm/libnpmhook) [![AppVeyor](https://ci.appveyor.com/api/projects/status/github/zkat/libnpmhook?svg=true)](https://ci.appveyor.com/project/zkat/libnpmhook) [![Coverage Status](https://coveralls.io/repos/github/npm/libnpmhook/badge.svg?branch=latest)](https://coveralls.io/github/npm/libnpmhook?branch=latest) +# libnpmhook + +[![npm version](https://img.shields.io/npm/v/libnpmhook.svg)](https://npm.im/libnpmhook) +[![license](https://img.shields.io/npm/l/libnpmhook.svg)](https://npm.im/libnpmhook) +[![Coverage Status](https://coveralls.io/repos/github/npm/libnpmhook/badge.svg?branch=latest)](https://coveralls.io/github/npm/libnpmhook?branch=latest) [`libnpmhook`](https://github.com/npm/libnpmhook) is a Node.js library for programmatically managing the npm registry's server-side hooks. @@ -6,6 +10,19 @@ programmatically managing the npm registry's server-side hooks. For a more general introduction to managing hooks, see [the introductory blog post](https://blog.npmjs.org/post/145260155635/introducing-hooks-get-notifications-of-npm). +## Table of Contents + +* [Example](#example) +* [Install](#install) +* [Contributing](#contributing) +* [API](#api) + * [hook opts](#opts) + * [`add()`](#add) + * [`rm()`](#rm) + * [`ls()`](#ls) + * [`ls.stream()`](#ls-stream) + * [`update()`](#update) + ## Example ```js @@ -19,18 +36,6 @@ console.log(await hooks.ls('mypkg', {token: 'deadbeef'})) `$ npm install libnpmhook` -## Table of Contents - -* [Example](#example) -* [Install](#install) -* [API](#api) - * [hook opts](#opts) - * [`add()`](#add) - * [`rm()`](#rm) - * [`ls()`](#ls) - * [`ls.stream()`](#ls-stream) - * [`update()`](#update) - ### API #### `opts` for `libnpmhook` commands @@ -45,7 +50,6 @@ A couple of options of note for those in a hurry: * `opts.token` - can be passed in and will be used as the authentication token for the registry. For other ways to pass in auth details, see the n-r-f docs. * `opts.otp` - certain operations will require an OTP token to be passed in. If a `libnpmhook` command fails with `err.code === EOTP`, please retry the request with `{otp: <2fa token>}` -* `opts.Promise` - If you pass this in, the Promises returned by `libnpmhook` commands will use this Promise class instead. For example: `{Promise: require('bluebird')}` #### `> hooks.add(name, endpoint, secret, [opts]) -> Promise` @@ -68,7 +72,7 @@ See also: [`POST ##### Example ```javascript -await hooks.add('~zkat', 'https://zkat.tech/api/added', 'supersekrit', { +await hooks.add('~zkat', 'https://example.com/api/added', 'supersekrit', { token: 'myregistrytoken', otp: '694207' }) @@ -78,7 +82,7 @@ await hooks.add('~zkat', 'https://zkat.tech/api/added', 'supersekrit', { { id: '16f7xoal', username: 'zkat', name: 'zkat', - endpoint: 'https://zkat.tech/api/added', + endpoint: 'https://example.com/api/added', secret: 'supersekrit', type: 'owner', created: '2018-08-21T20:05:25.125Z', @@ -110,7 +114,7 @@ await hooks.find('16f7xoal', {token: 'myregistrytoken'}) { id: '16f7xoal', username: 'zkat', name: 'zkat', - endpoint: 'https://zkat.tech/api/added', + endpoint: 'https://example.com/api/added', secret: 'supersekrit', type: 'owner', created: '2018-08-21T20:05:25.125Z', @@ -145,7 +149,7 @@ await hooks.rm('16f7xoal', { { id: '16f7xoal', username: 'zkat', name: 'zkat', - endpoint: 'https://zkat.tech/api/added', + endpoint: 'https://example.com/api/added', secret: 'supersekrit', type: 'owner', created: '2018-08-21T20:05:25.125Z', @@ -183,7 +187,7 @@ See also: [`PUT ##### Example ```javascript -await hooks.update('16fxoal', 'https://zkat.tech/api/other', 'newsekrit', { +await hooks.update('16fxoal', 'https://example.com/api/other', 'newsekrit', { token: 'myregistrytoken', otp: '694207' }) @@ -193,7 +197,7 @@ await hooks.update('16fxoal', 'https://zkat.tech/api/other', 'newsekrit', { { id: '16f7xoal', username: 'zkat', name: 'zkat', - endpoint: 'https://zkat.tech/api/other', + endpoint: 'https://example.com/api/other', secret: 'newsekrit', type: 'owner', created: '2018-08-21T20:05:25.125Z', diff --git a/deps/npm/node_modules/libnpmhook/index.js b/deps/npm/node_modules/libnpmhook/index.js index b489294951dd0f..262fcc083a6e6f 100644 --- a/deps/npm/node_modules/libnpmhook/index.js +++ b/deps/npm/node_modules/libnpmhook/index.js @@ -1,21 +1,11 @@ 'use strict' const fetch = require('npm-registry-fetch') -const figgyPudding = require('figgy-pudding') -const getStream = require('get-stream') const validate = require('aproba') -const HooksConfig = figgyPudding({ - package: {}, - limit: {}, - offset: {}, - Promise: {default: () => Promise} -}) - const eu = encodeURIComponent const cmd = module.exports = {} -cmd.add = (name, endpoint, secret, opts) => { - opts = HooksConfig(opts) +cmd.add = (name, endpoint, secret, opts = {}) => { validate('SSSO', [name, endpoint, secret, opts]) let type = 'package' if (name.match(/^@[^/]+$/)) { @@ -25,18 +15,19 @@ cmd.add = (name, endpoint, secret, opts) => { type = 'owner' name = name.substr(1) } - return fetch.json('/-/npm/v1/hooks/hook', opts.concat({ + return fetch.json('/-/npm/v1/hooks/hook', { + ...opts, method: 'POST', body: { type, name, endpoint, secret } - })) + }) } -cmd.rm = (id, opts) => { - opts = HooksConfig(opts) +cmd.rm = (id, opts = {}) => { validate('SO', [id, opts]) - return fetch.json(`/-/npm/v1/hooks/hook/${eu(id)}`, opts.concat({ + return fetch.json(`/-/npm/v1/hooks/hook/${eu(id)}`, { + ...opts, method: 'DELETE' - }, opts)).catch(err => { + }).catch(err => { if (err.code === 'E404') { return null } else { @@ -45,36 +36,35 @@ cmd.rm = (id, opts) => { }) } -cmd.update = (id, endpoint, secret, opts) => { - opts = HooksConfig(opts) +cmd.update = (id, endpoint, secret, opts = {}) => { validate('SSSO', [id, endpoint, secret, opts]) - return fetch.json(`/-/npm/v1/hooks/hook/${eu(id)}`, opts.concat({ + return fetch.json(`/-/npm/v1/hooks/hook/${eu(id)}`, { + ...opts, method: 'PUT', body: {endpoint, secret} - }, opts)) + }) } -cmd.find = (id, opts) => { - opts = HooksConfig(opts) +cmd.find = (id, opts = {}) => { validate('SO', [id, opts]) return fetch.json(`/-/npm/v1/hooks/hook/${eu(id)}`, opts) } -cmd.ls = (opts) => { - return getStream.array(cmd.ls.stream(opts)) +cmd.ls = (opts = {}) => { + return cmd.ls.stream(opts).collect() } -cmd.ls.stream = (opts) => { - opts = HooksConfig(opts) - const {package: pkg, limit, offset} = opts +cmd.ls.stream = (opts = {}) => { + const { package: pkg, limit, offset } = opts validate('S|Z', [pkg]) validate('N|Z', [limit]) validate('N|Z', [offset]) - return fetch.json.stream('/-/npm/v1/hooks', 'objects.*', opts.concat({ + return fetch.json.stream('/-/npm/v1/hooks', 'objects.*', { + ...opts, query: { package: pkg, limit, offset } - })) + }) } diff --git a/deps/npm/node_modules/libnpmhook/package.json b/deps/npm/node_modules/libnpmhook/package.json index 20f5e288687889..d8c5c687d5b898 100644 --- a/deps/npm/node_modules/libnpmhook/package.json +++ b/deps/npm/node_modules/libnpmhook/package.json @@ -1,78 +1,42 @@ { - "_from": "libnpmhook@5.0.3", - "_id": "libnpmhook@5.0.3", - "_inBundle": false, - "_integrity": "sha512-UdNLMuefVZra/wbnBXECZPefHMGsVDTq5zaM/LgKNE9Keyl5YXQTnGAzEo+nFOpdRqTWI9LYi4ApqF9uVCCtuA==", - "_location": "/libnpmhook", - "_phantomChildren": {}, - "_requested": { - "type": "version", - "registry": true, - "raw": "libnpmhook@5.0.3", - "name": "libnpmhook", - "escapedName": "libnpmhook", - "rawSpec": "5.0.3", - "saveSpec": null, - "fetchSpec": "5.0.3" - }, - "_requiredBy": [ - "#USER", - "/" - ], - "_resolved": "https://registry.npmjs.org/libnpmhook/-/libnpmhook-5.0.3.tgz", - "_shasum": "4020c0f5edbf08ebe395325caa5ea01885b928f7", - "_spec": "libnpmhook@5.0.3", - "_where": "/Users/isaacs/dev/npm/cli", - "author": { - "name": "Kat Marchán", - "email": "kzm@sykosomatic.org" - }, - "bugs": { - "url": "https://github.com/npm/libnpmhook/issues" - }, - "bundleDependencies": false, - "dependencies": { - "aproba": "^2.0.0", - "figgy-pudding": "^3.4.1", - "get-stream": "^4.0.0", - "npm-registry-fetch": "^4.0.0" - }, - "deprecated": false, + "name": "libnpmhook", + "version": "6.0.0", "description": "programmatic API for managing npm registry hooks", - "devDependencies": { - "nock": "^9.6.1", - "standard": "^11.0.1", - "standard-version": "^4.4.0", - "tap": "^12.0.1", - "weallbehave": "^1.2.0", - "weallcontribute": "^1.0.8" - }, + "main": "index.js", "files": [ "*.js", "lib" ], - "homepage": "https://github.com/npm/libnpmhook#readme", + "scripts": { + "prerelease": "npm t", + "postrelease": "npm publish && git push --follow-tags", + "pretest": "standard", + "release": "standard-version -s", + "test": "tap" + }, + "tap": { + "check-coverage": true + }, + "repository": "https://github.com/npm/libnpmhook", "keywords": [ "npm", "hooks", "registry", "npm api" ], + "author": "Kat Marchán ", "license": "ISC", - "main": "index.js", - "name": "libnpmhook", - "repository": { - "type": "git", - "url": "git+https://github.com/npm/libnpmhook.git" + "dependencies": { + "aproba": "^2.0.0", + "npm-registry-fetch": "^8.0.0" }, - "scripts": { - "postrelease": "npm publish && git push --follow-tags", - "prerelease": "npm t", - "pretest": "standard", - "release": "standard-version -s", - "test": "tap -J --100 --coverage test/*.js", - "update-coc": "weallbehave -o . && git add CODE_OF_CONDUCT.md && git commit -m 'docs(coc): updated CODE_OF_CONDUCT.md'", - "update-contrib": "weallcontribute -o . && git add CONTRIBUTING.md && git commit -m 'docs(contributing): updated CONTRIBUTING.md'" + "devDependencies": { + "nock": "^9.6.1", + "standard": "^11.0.1", + "standard-version": "^4.4.0", + "tap": "^14.10.6" }, - "version": "5.0.3" + "engines": { + "node": ">=10" + } } diff --git a/deps/npm/node_modules/libnpmorg/.travis.yml b/deps/npm/node_modules/libnpmorg/.travis.yml deleted file mode 100644 index db5ea8b0186403..00000000000000 --- a/deps/npm/node_modules/libnpmorg/.travis.yml +++ /dev/null @@ -1,7 +0,0 @@ -language: node_js -sudo: false -node_js: - - "10" - - "9" - - "8" - - "6" diff --git a/deps/npm/node_modules/libnpmorg/CHANGELOG.md b/deps/npm/node_modules/libnpmorg/CHANGELOG.md index 3d70c79c5614b6..4cd5cd1cd68a1c 100644 --- a/deps/npm/node_modules/libnpmorg/CHANGELOG.md +++ b/deps/npm/node_modules/libnpmorg/CHANGELOG.md @@ -1,5 +1,17 @@ # Change Log +## 2.0.0 (2020-03-02) + +### BREAKING CHANGE +- Removed `figgy-pudding` as a dependecy +- Using native promises +- Require node >= v10 + +### Feature +- Updated stream interface to `minipass` type stream + +--- + 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. diff --git a/deps/npm/node_modules/libnpmorg/PULL_REQUEST_TEMPLATE b/deps/npm/node_modules/libnpmorg/PULL_REQUEST_TEMPLATE deleted file mode 100644 index 9471c6d325f7eb..00000000000000 --- a/deps/npm/node_modules/libnpmorg/PULL_REQUEST_TEMPLATE +++ /dev/null @@ -1,7 +0,0 @@ - diff --git a/deps/npm/node_modules/libnpmorg/README.md b/deps/npm/node_modules/libnpmorg/README.md index 6244794eda016f..b2e1ed589b8e98 100644 --- a/deps/npm/node_modules/libnpmorg/README.md +++ b/deps/npm/node_modules/libnpmorg/README.md @@ -1,9 +1,26 @@ -# libnpmorg [![npm version](https://img.shields.io/npm/v/libnpmorg.svg)](https://npm.im/libnpmorg) [![license](https://img.shields.io/npm/l/libnpmorg.svg)](https://npm.im/libnpmorg) [![Travis](https://img.shields.io/travis/npm/libnpmorg.svg)](https://travis-ci.org/npm/libnpmorg) [![AppVeyor](https://ci.appveyor.com/api/projects/status/github/zkat/libnpmorg?svg=true)](https://ci.appveyor.com/project/zkat/libnpmorg) [![Coverage Status](https://coveralls.io/repos/github/npm/libnpmorg/badge.svg?branch=latest)](https://coveralls.io/github/npm/libnpmorg?branch=latest) +# libnpmorg + +[![npm version](https://img.shields.io/npm/v/libnpmorg.svg)](https://npm.im/libnpmorg) +[![license](https://img.shields.io/npm/l/libnpmorg.svg)](https://npm.im/libnpmorg) +[![GitHub Actions](https://github.com/npm/libnpmorg/workflows/Node%20CI/badge.svg)](https://github.com/npm/libnpmorg/workflows/Node%20CI/badge.svg) +[![Coverage Status](https://coveralls.io/repos/github/npm/libnpmorg/badge.svg?branch=latest)](https://coveralls.io/github/npm/libnpmorg?branch=latest) [`libnpmorg`](https://github.com/npm/libnpmorg) is a Node.js library for programmatically accessing the [npm Org membership API](https://github.com/npm/registry/blob/master/docs/orgs/memberships.md#membership-detail). +## Table of Contents + +* [Example](#example) +* [Install](#install) +* [Contributing](#contributing) +* [API](#api) + * [hook opts](#opts) + * [`set()`](#set) + * [`rm()`](#rm) + * [`ls()`](#ls) + * [`ls.stream()`](#ls-stream) + ## Example ```js @@ -22,17 +39,6 @@ Roster { `$ npm install libnpmorg` -## Table of Contents - -* [Example](#example) -* [Install](#install) -* [API](#api) - * [hook opts](#opts) - * [`set()`](#set) - * [`rm()`](#rm) - * [`ls()`](#ls) - * [`ls.stream()`](#ls-stream) - ### API #### `opts` for `libnpmorg` commands @@ -47,7 +53,6 @@ A couple of options of note for those in a hurry: * `opts.token` - can be passed in and will be used as the authentication token for the registry. For other ways to pass in auth details, see the n-r-f docs. * `opts.otp` - certain operations will require an OTP token to be passed in. If a `libnpmorg` command fails with `err.code === EOTP`, please retry the request with `{otp: <2fa token>}` -* `opts.Promise` - If you pass this in, the Promises returned by `libnpmorg` commands will use this Promise class instead. For example: `{Promise: require('bluebird')}` #### `> org.set(org, user, [role], [opts]) -> Promise` diff --git a/deps/npm/node_modules/libnpmorg/appveyor.yml b/deps/npm/node_modules/libnpmorg/appveyor.yml deleted file mode 100644 index 9cc64c58e02f96..00000000000000 --- a/deps/npm/node_modules/libnpmorg/appveyor.yml +++ /dev/null @@ -1,22 +0,0 @@ -environment: - matrix: - - nodejs_version: "10" - - nodejs_version: "9" - - nodejs_version: "8" - - nodejs_version: "6" - -platform: - - x64 - -install: - - ps: Install-Product node $env:nodejs_version $env:platform - - npm config set spin false - - npm install - -test_script: - - npm test - -matrix: - fast_finish: true - -build: off diff --git a/deps/npm/node_modules/libnpmorg/index.js b/deps/npm/node_modules/libnpmorg/index.js index cd3e51e6ad1722..208542b31e8c81 100644 --- a/deps/npm/node_modules/libnpmorg/index.js +++ b/deps/npm/node_modules/libnpmorg/index.js @@ -2,70 +2,63 @@ const eu = encodeURIComponent const fetch = require('npm-registry-fetch') -const figgyPudding = require('figgy-pudding') -const getStream = require('get-stream') const validate = require('aproba') -const OrgConfig = figgyPudding({ - Promise: { default: () => Promise } -}) - // From https://github.com/npm/registry/blob/master/docs/orgs/memberships.md -const cmd = module.exports = {} +const cmd = module.exports class MembershipDetail {} -cmd.set = (org, user, role, opts) => { - if (typeof role === 'object' && !opts) { +cmd.set = (org, user, role, opts = {}) => { + if ( + typeof role === 'object' && + Object.keys(opts).length === 0 + ) { opts = role role = undefined } - opts = OrgConfig(opts) - return new opts.Promise((resolve, reject) => { - validate('SSSO|SSZO', [org, user, role, opts]) - user = user.replace(/^@?/, '') - org = org.replace(/^@?/, '') - fetch.json(`/-/org/${eu(org)}/user`, opts.concat({ - method: 'PUT', - body: { user, role } - })).then(resolve, reject) + validate('SSSO|SSZO', [org, user, role, opts]) + user = user.replace(/^@?/, '') + org = org.replace(/^@?/, '') + return fetch.json(`/-/org/${eu(org)}/user`, { + ...opts, + method: 'PUT', + body: { user, role } }).then(ret => Object.assign(new MembershipDetail(), ret)) } -cmd.rm = (org, user, opts) => { - opts = OrgConfig(opts) - return new opts.Promise((resolve, reject) => { - validate('SSO', [org, user, opts]) - user = user.replace(/^@?/, '') - org = org.replace(/^@?/, '') - fetch(`/-/org/${eu(org)}/user`, opts.concat({ - method: 'DELETE', - body: { user }, - ignoreBody: true - })).then(resolve, reject) +cmd.rm = (org, user, opts = {}) => { + validate('SSO', [org, user, opts]) + user = user.replace(/^@?/, '') + org = org.replace(/^@?/, '') + return fetch(`/-/org/${eu(org)}/user`, { + ...opts, + method: 'DELETE', + body: { user }, + ignoreBody: true }).then(() => null) } class Roster {} -cmd.ls = (org, opts) => { - opts = OrgConfig(opts) - return new opts.Promise((resolve, reject) => { - getStream.array(cmd.ls.stream(org, opts)).then(entries => { - const obj = {} - for (let [key, val] of entries) { - obj[key] = val +cmd.ls = (org, opts = {}) => { + return cmd.ls.stream(org, opts) + .collect() + .then(data => data.reduce((acc, [key, val]) => { + if (!acc) { + acc = {} } - return obj - }).then(resolve, reject) - }).then(ret => Object.assign(new Roster(), ret)) + acc[key] = val + return acc + }, null)) + .then(ret => Object.assign(new Roster(), ret)) } -cmd.ls.stream = (org, opts) => { - opts = OrgConfig(opts) +cmd.ls.stream = (org, opts = {}) => { validate('SO', [org, opts]) org = org.replace(/^@?/, '') - return fetch.json.stream(`/-/org/${eu(org)}/user`, '*', opts.concat({ - mapJson (value, [key]) { + return fetch.json.stream(`/-/org/${eu(org)}/user`, '*', { + ...opts, + mapJSON: (value, [key]) => { return [key, value] } - })) + }) } diff --git a/deps/npm/node_modules/libnpmorg/package.json b/deps/npm/node_modules/libnpmorg/package.json index e93fc52a05d57c..f18c43adafaad6 100644 --- a/deps/npm/node_modules/libnpmorg/package.json +++ b/deps/npm/node_modules/libnpmorg/package.json @@ -1,53 +1,8 @@ { - "_from": "libnpmorg@1.0.1", - "_id": "libnpmorg@1.0.1", - "_inBundle": false, - "_integrity": "sha512-0sRUXLh+PLBgZmARvthhYXQAWn0fOsa6T5l3JSe2n9vKG/lCVK4nuG7pDsa7uMq+uTt2epdPK+a2g6btcY11Ww==", - "_location": "/libnpmorg", - "_phantomChildren": {}, - "_requested": { - "type": "version", - "registry": true, - "raw": "libnpmorg@1.0.1", - "name": "libnpmorg", - "escapedName": "libnpmorg", - "rawSpec": "1.0.1", - "saveSpec": null, - "fetchSpec": "1.0.1" - }, - "_requiredBy": [ - "#USER", - "/" - ], - "_resolved": "https://registry.npmjs.org/libnpmorg/-/libnpmorg-1.0.1.tgz", - "_shasum": "5d2503f6ceb57f33dbdcc718e6698fea6d5ad087", - "_spec": "libnpmorg@1.0.1", - "_where": "/Users/isaacs/dev/npm/cli", - "author": { - "name": "Kat Marchán", - "email": "kzm@zkat.tech" - }, - "bugs": { - "url": "https://github.com/npm/libnpmorg/issues" - }, - "bundleDependencies": false, - "dependencies": { - "aproba": "^2.0.0", - "figgy-pudding": "^3.4.1", - "get-stream": "^4.0.0", - "npm-registry-fetch": "^4.0.0" - }, - "deprecated": false, + "name": "libnpmorg", + "version": "2.0.0", "description": "Programmatic api for `npm org` commands", - "devDependencies": { - "nock": "^9.6.1", - "standard": "^12.0.0", - "standard-version": "*", - "tap": "*", - "weallbehave": "*", - "weallcontribute": "*" - }, - "homepage": "https://npmjs.com/package/libnpmorg", + "author": "Kat Marchán ", "keywords": [ "libnpm", "npm", @@ -57,19 +12,37 @@ "teams" ], "license": "ISC", - "name": "libnpmorg", + "scripts": { + "preversion": "npm test", + "postversion": "npm publish", + "prepublishOnly": "git push origin --follow-tags", + "lint": "standard", + "test": "tap", + "posttest": "npm run lint" + }, + "files": [ + "index.js" + ], + "tap": { + "check-coverage": true + }, + "devDependencies": { + "minipass": "^3.1.1", + "nock": "^12.0.1", + "standard": "^14.3.1", + "tap": "^14.10.6" + }, "repository": { "type": "git", - "url": "git+https://github.com/npm/libnpmorg.git" + "url": "https://github.com/npm/libnpmorg.git" }, - "scripts": { - "postrelease": "npm publish && git push --follow-tags", - "prerelease": "npm t", - "pretest": "standard", - "release": "standard-version -s", - "test": "tap -J --100 test/*.js", - "update-coc": "weallbehave -o . && git add CODE_OF_CONDUCT.md && git commit -m 'docs(coc): updated CODE_OF_CONDUCT.md'", - "update-contrib": "weallcontribute -o . && git add CONTRIBUTING.md && git commit -m 'docs(contributing): updated CONTRIBUTING.md'" + "bugs": "https://github.com/npm/libnpmorg/issues", + "homepage": "https://npmjs.com/package/libnpmorg", + "dependencies": { + "aproba": "^2.0.0", + "npm-registry-fetch": "^8.0.0" }, - "version": "1.0.1" + "engines": { + "node": ">=10" + } } diff --git a/deps/npm/node_modules/libnpmorg/test/index.js b/deps/npm/node_modules/libnpmorg/test/index.js deleted file mode 100644 index e6ec33ab8a6c49..00000000000000 --- a/deps/npm/node_modules/libnpmorg/test/index.js +++ /dev/null @@ -1,81 +0,0 @@ -'use strict' - -const figgyPudding = require('figgy-pudding') -const getStream = require('get-stream') -const test = require('tap').test -const tnock = require('./util/tnock.js') - -const org = require('../index.js') - -const OPTS = figgyPudding({ registry: {} })({ - registry: 'https://mock.reg/' -}) - -test('set', t => { - const memDeets = { - org: { - name: 'myorg', - size: 15 - }, - user: 'myuser', - role: 'admin' - } - tnock(t, OPTS.registry).put('/-/org/myorg/user', { - user: 'myuser', - role: 'admin' - }).reply(201, memDeets) - return org.set('myorg', 'myuser', 'admin', OPTS).then(res => { - t.deepEqual(res, memDeets, 'got a membership details object back') - }) -}) - -test('optional role for set', t => { - const memDeets = { - org: { - name: 'myorg', - size: 15 - }, - user: 'myuser', - role: 'developer' - } - tnock(t, OPTS.registry).put('/-/org/myorg/user', { - user: 'myuser' - }).reply(201, memDeets) - return org.set('myorg', 'myuser', OPTS).then(res => { - t.deepEqual(res, memDeets, 'got a membership details object back') - }) -}) - -test('rm', t => { - tnock(t, OPTS.registry).delete('/-/org/myorg/user', { - user: 'myuser' - }).reply(204) - return org.rm('myorg', 'myuser', OPTS).then(() => { - t.ok(true, 'request succeeded') - }) -}) - -test('ls', t => { - const roster = { - 'zkat': 'developer', - 'iarna': 'admin', - 'isaacs': 'owner' - } - tnock(t, OPTS.registry).get('/-/org/myorg/user').reply(200, roster) - return org.ls('myorg', OPTS).then(res => { - t.deepEqual(res, roster, 'got back a roster') - }) -}) - -test('ls stream', t => { - const roster = { - 'zkat': 'developer', - 'iarna': 'admin', - 'isaacs': 'owner' - } - const rosterArr = Object.keys(roster).map(k => [k, roster[k]]) - tnock(t, OPTS.registry).get('/-/org/myorg/user').reply(200, roster) - return getStream.array(org.ls.stream('myorg', OPTS)).then(res => { - t.deepEqual(res, rosterArr, 'got back a roster, in entries format') - }) -}) diff --git a/deps/npm/node_modules/libnpmorg/test/util/tnock.js b/deps/npm/node_modules/libnpmorg/test/util/tnock.js deleted file mode 100644 index 00b6e160e10192..00000000000000 --- a/deps/npm/node_modules/libnpmorg/test/util/tnock.js +++ /dev/null @@ -1,12 +0,0 @@ -'use strict' - -const nock = require('nock') - -module.exports = tnock -function tnock (t, host) { - const server = nock(host) - t.tearDown(function () { - server.done() - }) - return server -} diff --git a/deps/npm/node_modules/libnpmpack/CHANGELOG.md b/deps/npm/node_modules/libnpmpack/CHANGELOG.md new file mode 100644 index 00000000000000..25daf9e3342bb4 --- /dev/null +++ b/deps/npm/node_modules/libnpmpack/CHANGELOG.md @@ -0,0 +1,17 @@ +# Change Log + + +# [2.0.0](https://github.com/npm/libnpmpublish/compare/v1.0.0...v2.0.0) (2020-03-27) + +### Breaking Changes + +* [`cb2ecf2`](https://github.com/npm/libnpmpack/commit/cb2ecf2) feat: resolve to tarball data Buffer ([@claudiahdz](https://github.com/claudiahdz)) + + +# 1.0.0 (2020-03-26) + +### Features + +* [`a35c590`](https://github.com/npm/libnpmpack/commit/a35c590) feat: pack tarballs from local dir or registry spec ([@claudiahdz](https://github.com/claudiahdz)) + +* [`6d72149`](https://github.com/npm/libnpmpack/commit/6d72149) feat: sorted tarball contents ([@eridal](https://github.com/eridal)) diff --git a/deps/npm/node_modules/libnpmconfig/LICENSE b/deps/npm/node_modules/libnpmpack/LICENSE similarity index 100% rename from deps/npm/node_modules/libnpmconfig/LICENSE rename to deps/npm/node_modules/libnpmpack/LICENSE diff --git a/deps/npm/node_modules/libnpmpack/README.md b/deps/npm/node_modules/libnpmpack/README.md new file mode 100644 index 00000000000000..15c911a1eaaa88 --- /dev/null +++ b/deps/npm/node_modules/libnpmpack/README.md @@ -0,0 +1,56 @@ +# libnpmpack + +[![npm version](https://img.shields.io/npm/v/libnpmpack.svg)](https://npm.im/libnpmpack) +[![license](https://img.shields.io/npm/l/libnpmpack.svg)](https://npm.im/libnpmpack) +[![GitHub Actions](https://github.com/npm/libnpmpack/workflows/Node%20CI/badge.svg)](https://github.com/npm/libnpmpack/actions?query=workflow%3A%22Node+CI%22) +[![Coverage Status](https://coveralls.io/repos/github/npm/libnpmpack/badge.svg?branch=latest)](https://coveralls.io/github/npm/libnpmpack?branch=latest) + +[`libnpmpack`](https://github.com/npm/libnpmpack) is a Node.js library for +programmatically packing tarballs from a local directory or from a registry or github spec. If packing from a local source, `libnpmpack` will also run the `prepack` and `postpack` lifecycles. + +## Table of Contents + +* [Example](#example) +* [Install](#install) +* [API](#api) + * [`pack()`](#pack) + +## Example + +```js +const pack = require('libnpmpack') +``` + +## Install + +`$ npm install libnpmpack` + +### API + +#### `> pack(spec, [opts]) -> Promise` + +Packs a tarball from a local directory or from a registry or github spec and returns a Promise that resolves to the tarball data Buffer, with from, resolved, and integrity fields attached. + +If no options are passed, the tarball file will be saved on the same directory from which `pack` was called in. + +`libnpmpack` uses [`pacote`](https://npm.im/pacote). +Most options are passed through directly to that library, so please refer to +[its own `opts` +documentation](https://www.npmjs.com/package/pacote#options) +for options that can be passed in. + +##### Examples + +```javascript +// packs from cwd +const tarball = await pack() + +// packs from a local directory +const localTar = await pack('/Users/claudiahdz/projects/my-cool-pkg') + +// packs from a registry spec +const registryTar = await pack('abbrev@1.0.3') + +// packs from a github spec +const githubTar = await pack('isaacs/rimraf#PR-192') +``` diff --git a/deps/npm/node_modules/libnpmpack/index.js b/deps/npm/node_modules/libnpmpack/index.js new file mode 100644 index 00000000000000..a756ebca03dffd --- /dev/null +++ b/deps/npm/node_modules/libnpmpack/index.js @@ -0,0 +1,48 @@ +'use strict' + +const pacote = require('pacote') +const npa = require('npm-package-arg') +const runScript = require('@npmcli/run-script') + +module.exports = pack +async function pack (spec = 'file:.', opts = {}) { + // gets spec + spec = npa(spec) + + const manifest = await pacote.manifest(spec, opts) + + if (spec.type === 'directory') { + // prepack + await runScript({ + ...opts, + event: 'prepack', + path: spec.fetchSpec, + stdio: 'inherit', + pkg: manifest + }) + } + + // packs tarball + const tarball = await pacote.tarball(manifest._resolved, { + ...opts, + integrity: manifest._integrity + }) + + if (spec.type === 'directory') { + // postpack + await runScript({ + ...opts, + event: 'postpack', + path: spec.fetchSpec, + stdio: 'inherit', + pkg: manifest, + env: { + npm_package_from: tarball.from, + npm_package_resolved: tarball.resolved, + npm_package_integrity: tarball.integrity + } + }) + } + + return tarball +} diff --git a/deps/npm/node_modules/libnpmpack/package.json b/deps/npm/node_modules/libnpmpack/package.json new file mode 100644 index 00000000000000..dc789edbaf3ec2 --- /dev/null +++ b/deps/npm/node_modules/libnpmpack/package.json @@ -0,0 +1,44 @@ +{ + "name": "libnpmpack", + "version": "2.0.0", + "description": "Programmatic API for the bits behind npm pack", + "author": "npm Inc. ", + "contributors": [ + "Claudia Hernández " + ], + "main": "index.js", + "files": [ + "*.js" + ], + "license": "ISC", + "scripts": { + "preversion": "npm test", + "postversion": "npm publish", + "prepublishOnly": "git push origin --follow-tags", + "lint": "standard", + "test": "tap", + "posttest": "npm run lint" + }, + "tap": { + "check-coverage": true + }, + "devDependencies": { + "nock": "^12.0.2", + "standard": "^14.3.1", + "tap": "^14.10.6" + }, + "repository": { + "type": "git", + "url": "https://github.com/npm/libnpmpack.git" + }, + "bugs": "https://github.com/npm/libnpmpack/issues", + "homepage": "https://npmjs.com/package/libnpmpack", + "dependencies": { + "@npmcli/run-script": "^1.3.0", + "npm-package-arg": "^8.0.0", + "pacote": "^11.1.4" + }, + "engines": { + "node": ">=10" + } +} diff --git a/deps/npm/node_modules/libnpmpublish/.travis.yml b/deps/npm/node_modules/libnpmpublish/.travis.yml deleted file mode 100644 index db5ea8b0186403..00000000000000 --- a/deps/npm/node_modules/libnpmpublish/.travis.yml +++ /dev/null @@ -1,7 +0,0 @@ -language: node_js -sudo: false -node_js: - - "10" - - "9" - - "8" - - "6" diff --git a/deps/npm/node_modules/libnpmpublish/CHANGELOG.md b/deps/npm/node_modules/libnpmpublish/CHANGELOG.md index 974b3fd308a6b4..57d21f8400c5bd 100644 --- a/deps/npm/node_modules/libnpmpublish/CHANGELOG.md +++ b/deps/npm/node_modules/libnpmpublish/CHANGELOG.md @@ -1,7 +1,43 @@ # Change Log + +# [3.0.1](https://github.com/npm/libnpmpublish/compare/v3.0.0...v3.0.1) (2020-03-27) + +### Features + +* [`3e02307`](https://github.com/npm/libnpmpublish/commit/3e02307) chore: pack tarballs using libnpmpack ([@claudiahdz](https://github.com/claudiahdz)) + + +# [3.0.0](https://github.com/npm/libnpmpublish/compare/v2.0.0...v3.0.0) (2020-03-09) + +### Breaking Changes + +* [`ecaeb0b`](https://github.com/npm/libnpmpublish/commit/ecaeb0b) feat: pack tarballs from source code using pacote v10 ([@claudiahdz](https://github.com/claudiahdz)) + +* [`f6bf2b8`](https://github.com/npm/libnpmpublish/commit/f6bf2b8) feat: unpublish code refactor ([@claudiahdz](https://github.com/claudiahdz)) + +### Miscellaneuous + +* [`5cea10f`](https://github.com/npm/libnpmpublish/commit/5cea10f) chore: basic project updates ([@claudiahdz](https://github.com/claudiahdz)) +* [`3010b93`](https://github.com/npm/libnpmpublish/commit/3010b93) chore: cleanup badges + contributing ([@ruyadorno](https://github.com/ruyadorno)) + +--- + 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. +## [2.0.0](https://github.com/npm/libnpmpublish/compare/v1.1.3...v2.0.0) (2019-09-18) + + +### ⚠ BREAKING CHANGES + +* This drops support for Node.js version 6. + +### Bug Fixes + +* audit warnings, drop support for Node.js v6 ([d9a1fb6](https://github.com/npm/libnpmpublish/commit/d9a1fb6)) + +### [1.1.3](https://github.com/npm/libnpmpublish/compare/v1.1.2...v1.1.3) (2019-09-18) + ## [1.1.2](https://github.com/npm/libnpmpublish/compare/v1.1.1...v1.1.2) (2019-07-16) diff --git a/deps/npm/node_modules/libnpmpublish/PULL_REQUEST_TEMPLATE b/deps/npm/node_modules/libnpmpublish/PULL_REQUEST_TEMPLATE deleted file mode 100644 index 9471c6d325f7eb..00000000000000 --- a/deps/npm/node_modules/libnpmpublish/PULL_REQUEST_TEMPLATE +++ /dev/null @@ -1,7 +0,0 @@ - diff --git a/deps/npm/node_modules/libnpmpublish/README.md b/deps/npm/node_modules/libnpmpublish/README.md index 1511b7c14e9267..7d66958c9c0f4b 100644 --- a/deps/npm/node_modules/libnpmpublish/README.md +++ b/deps/npm/node_modules/libnpmpublish/README.md @@ -1,9 +1,22 @@ -# libnpmpublish [![npm version](https://img.shields.io/npm/v/libnpmpublish.svg)](https://npm.im/libnpmpublish) [![license](https://img.shields.io/npm/l/libnpmpublish.svg)](https://npm.im/libnpmpublish) [![Travis](https://img.shields.io/travis/npm/libnpmpublish.svg)](https://travis-ci.org/npm/libnpmpublish) [![AppVeyor](https://ci.appveyor.com/api/projects/status/github/zkat/libnpmpublish?svg=true)](https://ci.appveyor.com/project/zkat/libnpmpublish) [![Coverage Status](https://coveralls.io/repos/github/npm/libnpmpublish/badge.svg?branch=latest)](https://coveralls.io/github/npm/libnpmpublish?branch=latest) +# libnpmpublish + +[![npm version](https://img.shields.io/npm/v/libnpmpublish.svg)](https://npm.im/libnpmpublish) +[![license](https://img.shields.io/npm/l/libnpmpublish.svg)](https://npm.im/libnpmpublish) +[![GitHub Actions](https://github.com/npm/libnpmpublish/workflows/Node%20CI/badge.svg)](https://github.com/npm/libnpmpublish/actions?query=workflow%3A%22Node+CI%22) +[![Coverage Status](https://coveralls.io/repos/github/npm/libnpmpublish/badge.svg?branch=latest)](https://coveralls.io/github/npm/libnpmpublish?branch=latest) [`libnpmpublish`](https://github.com/npm/libnpmpublish) is a Node.js library for -programmatically publishing and unpublishing npm packages. It does not take care -of packing tarballs from source code, but once you have a tarball, it can take -care of putting it up on a nice registry for you. +programmatically publishing and unpublishing npm packages. It takes care +of packing tarballs from source code and putting it up on a nice registry for you. + +## Table of Contents + +* [Example](#example) +* [Install](#install) +* [API](#api) + * [publish/unpublish opts](#opts) + * [`publish()`](#publish) + * [`unpublish()`](#unpublish) ## Example @@ -16,15 +29,6 @@ const { publish, unpublish } = require('libnpmpublish') `$ npm install libnpmpublish` -## Table of Contents - -* [Example](#example) -* [Install](#install) -* [API](#api) - * [publish/unpublish opts](#opts) - * [`publish()`](#publish) - * [`unpublish()`](#unpublish) - ### API #### `opts` for `libnpmpublish` commands @@ -36,29 +40,17 @@ documentation](https://www.npmjs.com/package/npm-registry-fetch#fetch-options) for options that can be passed in. A couple of options of note for those in a hurry: +* `opts.defaultTag` - registers the published package with the given tag, defaults to `latest`. + +* `opts.access` - tells the registry whether this package should be published as public or restricted. Only applies to scoped packages, which default to restricted. * `opts.token` - can be passed in and will be used as the authentication token for the registry. For other ways to pass in auth details, see the n-r-f docs. -* `opts.Promise` - If you pass this in, the Promises returned by `libnpmpublish` commands will use this Promise class instead. For example: `{Promise: require('bluebird')}` -#### `> libpub.publish(pkgJson, tarData, [opts]) -> Promise` +#### `> libpub.publish(path, pkgJson, [opts]) -> Promise` -Publishes `tarData` to the appropriate configured registry. `pkgJson` should be +Packs a tarball located in `path` and publishes to the appropriate configured registry. `pkgJson` should be the parsed `package.json` for the package that is being published. -`tarData` can be a Buffer, a base64-encoded string, or a binary stream of data. -Note that publishing itself can't be streamed, so the entire stream will be -consumed into RAM before publishing (and are thus limited in how big they can -be). - -Since `libnpmpublish` does not generate tarballs itself, one way to build your -own tarball for publishing is to do `npm pack` in the directory you wish to -pack. You can then `fs.createReadStream('my-proj-1.0.0.tgz')` and pass that to -`libnpmpublish`, along with `require('./package.json')`. - -`publish()` does its best to emulate legacy publish logic in the standard npm -client, and so should generally be compatible with any registry the npm CLI has -been able to publish to in the past. - If `opts.npmVersion` is passed in, it will be used as the `_npmVersion` field in the outgoing packument. It's recommended you add your own user agent string in there! @@ -69,19 +61,14 @@ end up with `dist.integrity = 'sha512-deadbeefbadc0ffee'`. Any algorithm supported by your current node version is allowed -- npm clients that do not support those algorithms will simply ignore the unsupported hashes. -If `opts.access` is passed in, it must be one of `public` or `restricted`. -Unscoped packages cannot be `restricted`, and the registry may agree or disagree -with whether you're allowed to publish a restricted package. - ##### Example ```javascript -const pkg = require('./dist/package.json') -const tarball = fs.createReadStream('./dist/pkg-1.0.1.tgz') -await libpub.publish(pkg, tarball, { +const path = '/a/path/to/your/source/code' +await libpub.publish(path, { npmVersion: 'my-pub-script@1.0.2', token: 'my-auth-token-here' -}) +}, opts) // Package has been published to the npm registry. ``` diff --git a/deps/npm/node_modules/libnpmpublish/appveyor.yml b/deps/npm/node_modules/libnpmpublish/appveyor.yml deleted file mode 100644 index 9cc64c58e02f96..00000000000000 --- a/deps/npm/node_modules/libnpmpublish/appveyor.yml +++ /dev/null @@ -1,22 +0,0 @@ -environment: - matrix: - - nodejs_version: "10" - - nodejs_version: "9" - - nodejs_version: "8" - - nodejs_version: "6" - -platform: - - x64 - -install: - - ps: Install-Product node $env:nodejs_version $env:platform - - npm config set spin false - - npm install - -test_script: - - npm test - -matrix: - fast_finish: true - -build: off diff --git a/deps/npm/node_modules/libnpmpublish/package.json b/deps/npm/node_modules/libnpmpublish/package.json index 58eda1a5089281..16236da75b6657 100644 --- a/deps/npm/node_modules/libnpmpublish/package.json +++ b/deps/npm/node_modules/libnpmpublish/package.json @@ -1,73 +1,49 @@ { - "_from": "libnpmpublish@^1.1.2", - "_id": "libnpmpublish@1.1.2", - "_inBundle": false, - "_integrity": "sha512-2yIwaXrhTTcF7bkJKIKmaCV9wZOALf/gsTDxVSu/Gu/6wiG3fA8ce8YKstiWKTxSFNC0R7isPUb6tXTVFZHt2g==", - "_location": "/libnpmpublish", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "libnpmpublish@^1.1.2", - "name": "libnpmpublish", - "escapedName": "libnpmpublish", - "rawSpec": "^1.1.2", - "saveSpec": null, - "fetchSpec": "^1.1.2" - }, - "_requiredBy": [ - "/libnpm" + "name": "libnpmpublish", + "version": "3.0.1", + "description": "Programmatic API for the bits behind npm publish and unpublish", + "author": "npm Inc. ", + "contributors": [ + "Kat Marchán ", + "Claudia Hernández " ], - "_resolved": "https://registry.npmjs.org/libnpmpublish/-/libnpmpublish-1.1.2.tgz", - "_shasum": "4201cfc4a69c44e6f454ec548fa1cd90f10df0a0", - "_spec": "libnpmpublish@^1.1.2", - "_where": "/Users/isaacs/dev/npm/cli/node_modules/libnpm", - "author": { - "name": "Kat Marchán", - "email": "kzm@zkat.tech" - }, - "bugs": { - "url": "https://github.com/npm/libnpmpublish/issues" + "main": "index.js", + "files": [ + "*.js" + ], + "license": "ISC", + "scripts": { + "preversion": "npm test", + "postversion": "npm publish", + "prepublishOnly": "git push origin --follow-tags", + "lint": "standard", + "test": "tap", + "posttest": "npm run lint" }, - "bundleDependencies": false, - "dependencies": { - "aproba": "^2.0.0", - "figgy-pudding": "^3.5.1", - "get-stream": "^4.0.0", - "lodash.clonedeep": "^4.5.0", - "normalize-package-data": "^2.4.0", - "npm-package-arg": "^6.1.0", - "npm-registry-fetch": "^4.0.0", - "semver": "^5.5.1", - "ssri": "^6.0.1" + "tap": { + "check-coverage": true }, - "deprecated": false, - "description": "Programmatic API for the bits behind npm publish and unpublish", "devDependencies": { - "bluebird": "^3.5.1", - "nock": "^9.6.1", - "standard": "*", - "standard-version": "*", - "tap": "*", - "tar-stream": "^1.6.1", - "weallbehave": "*", - "weallcontribute": "*" + "nock": "^12.0.2", + "standard": "^14.3.1", + "tap": "^14.10.6" }, - "homepage": "https://npmjs.com/package/libnpmpublish", - "license": "ISC", - "name": "libnpmpublish", "repository": { "type": "git", - "url": "git+https://github.com/npm/libnpmpublish.git" + "url": "https://github.com/npm/libnpmpublish.git" }, - "scripts": { - "postrelease": "npm publish && git push --follow-tags", - "prerelease": "npm t", - "pretest": "standard", - "release": "standard-version -s", - "test": "tap -J --100 test/*.js", - "update-coc": "weallbehave -o . && git add CODE_OF_CONDUCT.md && git commit -m 'docs(coc): updated CODE_OF_CONDUCT.md'", - "update-contrib": "weallcontribute -o . && git add CONTRIBUTING.md && git commit -m 'docs(contributing): updated CONTRIBUTING.md'" + "bugs": "https://github.com/npm/libnpmpublish/issues", + "homepage": "https://npmjs.com/package/libnpmpublish", + "dependencies": { + "libnpmpack": "^2.0.0", + "lodash.clonedeep": "^4.5.0", + "normalize-package-data": "^2.5.0", + "npm-package-arg": "^8.0.0", + "npm-registry-fetch": "^8.0.0", + "semver": "^7.1.3", + "ssri": "^8.0.0" }, - "version": "1.1.2" + "engines": { + "node": ">=10" + } } diff --git a/deps/npm/node_modules/libnpmpublish/publish.js b/deps/npm/node_modules/libnpmpublish/publish.js index de5af4f5d3d6b2..8a382e4ad9a9c3 100644 --- a/deps/npm/node_modules/libnpmpublish/publish.js +++ b/deps/npm/node_modules/libnpmpublish/publish.js @@ -1,96 +1,98 @@ 'use strict' -const cloneDeep = require('lodash.clonedeep') -const figgyPudding = require('figgy-pudding') const { fixer } = require('normalize-package-data') -const getStream = require('get-stream') -const npa = require('npm-package-arg') -const npmAuth = require('npm-registry-fetch/auth.js') const npmFetch = require('npm-registry-fetch') +const cloneDeep = require('lodash.clonedeep') +const npa = require('npm-package-arg') +const pack = require('libnpmpack') const semver = require('semver') +const { URL } = require('url') +const util = require('util') const ssri = require('ssri') -const url = require('url') -const validate = require('aproba') -const PublishConfig = figgyPudding({ - access: {}, - algorithms: { default: ['sha512'] }, - npmVersion: {}, - tag: { default: 'latest' }, - Promise: { default: () => Promise } -}) +const statAsync = util.promisify(require('fs').stat) module.exports = publish -function publish (manifest, tarball, opts) { - opts = PublishConfig(opts) - return new opts.Promise(resolve => resolve()).then(() => { - validate('OSO|OOO', [manifest, tarball, opts]) - if (manifest.private) { - throw Object.assign(new Error( - 'This package has been marked as private\n' + - "Remove the 'private' field from the package.json to publish it." - ), { code: 'EPRIVATE' }) - } - const spec = npa.resolve(manifest.name, manifest.version) - // NOTE: spec is used to pick the appropriate registry/auth combo. - opts = opts.concat(manifest.publishConfig, { spec }) - const reg = npmFetch.pickRegistry(spec, opts) - const auth = npmAuth(reg, opts) - const pubManifest = patchedManifest(spec, auth, manifest, opts) - - // registry-frontdoor cares about the access level, which is only - // configurable for scoped packages - if (!spec.scope && opts.access === 'restricted') { - throw Object.assign( - new Error("Can't restrict access to unscoped packages."), - { code: 'EUNSCOPED' } - ) - } +async function publish (folder, manifest, opts) { + if (manifest.private) { + throw Object.assign( + new Error( + `This package has been marked as private\n + Remove the 'private' field from the package.json to publish it.` + ), + { code: 'EPRIVATE' } + ) + } - return slurpTarball(tarball, opts).then(tardata => { - const metadata = buildMetadata( - spec, auth, reg, pubManifest, tardata, opts - ) - return npmFetch(spec.escapedName, opts.concat({ - method: 'PUT', - body: metadata, - ignoreBody: true - })).catch(err => { - if (err.code !== 'E409') { throw err } - return npmFetch.json(spec.escapedName, opts.concat({ - query: { write: true } - })).then( - current => patchMetadata(current, metadata, opts) - ).then(newMetadata => { - return npmFetch(spec.escapedName, opts.concat({ - method: 'PUT', - body: newMetadata, - ignoreBody: true - })) - }) - }) + // spec is used to pick the appropriate registry/auth combo + const spec = npa.resolve(manifest.name, manifest.version) + opts = { + defaultTag: 'latest', + // if scoped, restricted by default + access: spec.scope ? 'restricted' : 'public', + algorithms: ['sha512'], + ...opts, + spec + } + + const stat = await statAsync(folder) + // checks if it's a dir + if (!stat.isDirectory()) { + throw Object.assign( + new Error('not a directory'), + { code: 'ENOTDIR' } + ) + } + + const reg = npmFetch.pickRegistry(spec, opts) + const pubManifest = patchManifest(manifest, opts) + + // registry-frontdoor cares about the access level, + // which is only configurable for scoped packages + if (!spec.scope && opts.access === 'restricted') { + throw Object.assign( + new Error("Can't restrict access to unscoped packages."), + { code: 'EUNSCOPED' } + ) + } + + const tarballData = await pack(`file:${folder}`, { ...opts }) + const metadata = buildMetadata(reg, pubManifest, tarballData, opts) + + try { + return await npmFetch(spec.escapedName, { + ...opts, + method: 'PUT', + body: metadata, + ignoreBody: true }) - }).then(() => true) + } catch (err) { + if (err.code !== 'E409') { throw err } + // if E409, we attempt exactly ONE retry, to protect us + // against malicious activity like trying to publish + // a bunch of new versions of a package at the same time + // and/or spamming the registry + const current = await npmFetch.json(spec.escapedName, { + ...opts, + query: { write: true } + }) + const newMetadata = patchMetadata(current, metadata, opts) + return npmFetch(spec.escapedName, { + ...opts, + method: 'PUT', + body: newMetadata, + ignoreBody: true + }) + } } -function patchedManifest (spec, auth, base, opts) { - const manifest = cloneDeep(base) +function patchManifest (_manifest, opts) { + const { npmVersion } = opts + const manifest = cloneDeep(_manifest) + manifest._nodeVersion = process.versions.node - if (opts.npmVersion) { - manifest._npmVersion = opts.npmVersion - } - if (auth.username || auth.email) { - // NOTE: This is basically pointless, but reproduced because it's what - // legacy does: tl;dr `auth.username` and `auth.email` are going to be - // undefined in any auth situation that uses tokens instead of plain - // auth. I can only assume some registries out there decided that - // _npmUser would be of any use to them, but _npmUser in packuments - // currently gets filled in by the npm registry itself, based on auth - // information. - manifest._npmUser = { - name: auth.username, - email: auth.email - } + if (npmVersion) { + manifest._npmVersion = npmVersion } fixer.fixNameField(manifest, { strict: true, allowLegacyCase: true }) @@ -105,53 +107,52 @@ function patchedManifest (spec, auth, base, opts) { return manifest } -function buildMetadata (spec, auth, registry, manifest, tardata, opts) { +function buildMetadata (registry, manifest, tarballData, opts) { + const { access, defaultTag, algorithms } = opts const root = { _id: manifest.name, name: manifest.name, description: manifest.description, 'dist-tags': {}, versions: {}, + access, readme: manifest.readme || '' } - if (opts.access) root.access = opts.access - - if (!auth.token) { - root.maintainers = [{ name: auth.username, email: auth.email }] - manifest.maintainers = JSON.parse(JSON.stringify(root.maintainers)) - } - - root.versions[ manifest.version ] = manifest - const tag = manifest.tag || opts.tag + root.versions[manifest.version] = manifest + const tag = manifest.tag || defaultTag root['dist-tags'][tag] = manifest.version - const tbName = manifest.name + '-' + manifest.version + '.tgz' - const tbURI = manifest.name + '/-/' + tbName - const integrity = ssri.fromData(tardata, { - algorithms: [...new Set(['sha1'].concat(opts.algorithms))] + const tarballName = `${manifest.name}-${manifest.version}.tgz` + const tarballURI = `${manifest.name}/-/${tarballName}` + const integrity = ssri.fromData(tarballData, { + algorithms: [...new Set(['sha1'].concat(algorithms))] }) - manifest._id = manifest.name + '@' + manifest.version - manifest.dist = manifest.dist || {} + manifest._id = `${manifest.name}@${manifest.version}` + manifest.dist = { ...manifest.dist } // Don't bother having sha1 in the actual integrity field - manifest.dist.integrity = integrity['sha512'][0].toString() + manifest.dist.integrity = integrity.sha512[0].toString() // Legacy shasum support - manifest.dist.shasum = integrity['sha1'][0].hexDigest() - manifest.dist.tarball = url.resolve(registry, tbURI) + manifest.dist.shasum = integrity.sha1[0].hexDigest() + + // NB: the CLI always fetches via HTTPS if the registry is HTTPS, + // regardless of what's here. This makes it so that installing + // from an HTTP-only mirror doesn't cause problems, though. + manifest.dist.tarball = new URL(tarballURI, registry).href .replace(/^https:\/\//, 'http://') root._attachments = {} - root._attachments[ tbName ] = { - 'content_type': 'application/octet-stream', - 'data': tardata.toString('base64'), - 'length': tardata.length + root._attachments[tarballName] = { + content_type: 'application/octet-stream', + data: tarballData.toString('base64'), + length: tarballData.length } return root } -function patchMetadata (current, newData, opts) { +function patchMetadata (current, newData) { const curVers = Object.keys(current.versions || {}).map(v => { return semver.clean(v, true) }).concat(Object.keys(current.time || {}).map(v => { @@ -161,7 +162,15 @@ function patchMetadata (current, newData, opts) { const newVersion = Object.keys(newData.versions)[0] if (curVers.indexOf(newVersion) !== -1) { - throw ConflictError(newData.name, newData.version) + const { name: pkgid, version } = newData + throw Object.assign( + new Error( + `Cannot publish ${pkgid}@${version} over existing version.` + ), { + code: 'EPUBLISHCONFLICT', + pkgid, + version + }) } current.versions = current.versions || {} @@ -178,41 +187,11 @@ function patchMetadata (current, newData, opts) { } break - // ignore these - case 'maintainers': - break - // copy default: current[i] = newData[i] } } - const maint = newData.maintainers && JSON.parse(JSON.stringify(newData.maintainers)) - newData.versions[newVersion].maintainers = maint - return current -} - -function slurpTarball (tarSrc, opts) { - if (Buffer.isBuffer(tarSrc)) { - return opts.Promise.resolve(tarSrc) - } else if (typeof tarSrc === 'string') { - return opts.Promise.resolve(Buffer.from(tarSrc, 'base64')) - } else if (typeof tarSrc.pipe === 'function') { - return getStream.buffer(tarSrc) - } else { - return opts.Promise.reject(Object.assign( - new Error('invalid tarball argument. Must be a Buffer, a base64 string, or a binary stream'), { - code: 'EBADTAR' - })) - } -} -function ConflictError (pkgid, version) { - return Object.assign(new Error( - `Cannot publish ${pkgid}@${version} over existing version.` - ), { - code: 'EPUBLISHCONFLICT', - pkgid, - version - }) + return current } diff --git a/deps/npm/node_modules/libnpmpublish/test/publish.js b/deps/npm/node_modules/libnpmpublish/test/publish.js deleted file mode 100644 index 23eef2181f1fb5..00000000000000 --- a/deps/npm/node_modules/libnpmpublish/test/publish.js +++ /dev/null @@ -1,1048 +0,0 @@ -'use strict' - -const crypto = require('crypto') -const cloneDeep = require('lodash.clonedeep') -const figgyPudding = require('figgy-pudding') -const mockTar = require('./util/mock-tarball.js') -const { PassThrough } = require('stream') -const ssri = require('ssri') -const { test } = require('tap') -const tnock = require('./util/tnock.js') - -const publish = require('../publish.js') - -const OPTS = figgyPudding({ registry: {} })({ - registry: 'https://mock.reg/' -}) - -const REG = OPTS.registry - -test('basic publish', t => { - const manifest = { - name: 'libnpmpublish', - version: '1.0.0', - description: 'some stuff' - } - return mockTar({ - 'package.json': JSON.stringify(manifest), - 'index.js': 'console.log("hello world")' - }).then(tarData => { - const shasum = crypto.createHash('sha1').update(tarData).digest('hex') - const integrity = ssri.fromData(tarData, { algorithms: ['sha512'] }) - const packument = { - name: 'libnpmpublish', - description: 'some stuff', - readme: '', - _id: 'libnpmpublish', - 'dist-tags': { - latest: '1.0.0' - }, - versions: { - '1.0.0': { - _id: 'libnpmpublish@1.0.0', - _nodeVersion: process.versions.node, - name: 'libnpmpublish', - version: '1.0.0', - description: 'some stuff', - dist: { - shasum, - integrity: integrity.toString(), - tarball: `http://mock.reg/libnpmpublish/-/libnpmpublish-1.0.0.tgz` - } - } - }, - _attachments: { - 'libnpmpublish-1.0.0.tgz': { - 'content_type': 'application/octet-stream', - data: tarData.toString('base64'), - length: tarData.length - } - } - } - const srv = tnock(t, REG) - srv.put('/libnpmpublish', body => { - t.deepEqual(body, packument, 'posted packument matches expectations') - return true - }, { - authorization: 'Bearer deadbeef' - }).reply(201, {}) - - return publish(manifest, tarData, OPTS.concat({ - token: 'deadbeef' - })).then(ret => { - t.ok(ret, 'publish succeeded') - }) - }) -}) - -test('scoped publish', t => { - const manifest = { - name: '@zkat/libnpmpublish', - version: '1.0.0', - description: 'some stuff' - } - return mockTar({ - 'package.json': JSON.stringify(manifest), - 'index.js': 'console.log("hello world")' - }).then(tarData => { - const shasum = crypto.createHash('sha1').update(tarData).digest('hex') - const integrity = ssri.fromData(tarData, { algorithms: ['sha512'] }) - const packument = { - name: '@zkat/libnpmpublish', - description: 'some stuff', - readme: '', - _id: '@zkat/libnpmpublish', - 'dist-tags': { - latest: '1.0.0' - }, - versions: { - '1.0.0': { - _id: '@zkat/libnpmpublish@1.0.0', - _nodeVersion: process.versions.node, - _npmVersion: '6.9.0', - name: '@zkat/libnpmpublish', - version: '1.0.0', - description: 'some stuff', - dist: { - shasum, - integrity: integrity.toString(), - tarball: `http://mock.reg/@zkat/libnpmpublish/-/@zkat/libnpmpublish-1.0.0.tgz` - } - } - }, - _attachments: { - '@zkat/libnpmpublish-1.0.0.tgz': { - 'content_type': 'application/octet-stream', - data: tarData.toString('base64'), - length: tarData.length - } - } - } - const srv = tnock(t, REG) - srv.put('/@zkat%2flibnpmpublish', body => { - t.deepEqual(body, packument, 'posted packument matches expectations') - return true - }, { - authorization: 'Bearer deadbeef' - }).reply(201, {}) - - return publish(manifest, tarData, OPTS.concat({ - npmVersion: '6.9.0', - token: 'deadbeef' - })).then(() => { - t.ok(true, 'publish succeeded') - }) - }) -}) - -test('retry after a conflict', t => { - const REV = '72-47f2986bfd8e8b55068b204588bbf484' - const manifest = { - name: 'libnpmpublish', - version: '1.0.0', - description: 'some stuff' - } - return mockTar({ - 'package.json': JSON.stringify(manifest), - 'index.js': 'console.log("hello world")' - }).then(tarData => { - const shasum = crypto.createHash('sha1').update(tarData).digest('hex') - const integrity = ssri.fromData(tarData, { algorithms: ['sha512'] }) - const basePackument = { - name: 'libnpmpublish', - description: 'some stuff', - readme: '', - _id: 'libnpmpublish', - 'dist-tags': {}, - versions: {}, - _attachments: {} - } - const currentPackument = cloneDeep(Object.assign({}, basePackument, { - time: { - modified: new Date().toISOString(), - created: new Date().toISOString(), - '1.0.1': new Date().toISOString() - }, - 'dist-tags': { latest: '1.0.1' }, - maintainers: [{ name: 'zkat', email: 'idk@idk.tech' }], - versions: { - '1.0.1': { - _id: 'libnpmpublish@1.0.1', - _nodeVersion: process.versions.node, - _npmVersion: '6.9.0', - name: 'libnpmpublish', - version: '1.0.1', - description: 'some stuff', - dist: { - shasum, - integrity: integrity.toString(), - tarball: `http://mock.reg/libnpmpublish/-/libnpmpublish-1.0.1.tgz` - } - } - }, - _attachments: { - 'libnpmpublish-1.0.1.tgz': { - 'content_type': 'application/octet-stream', - data: tarData.toString('base64'), - length: tarData.length - } - } - })) - const newPackument = cloneDeep(Object.assign({}, basePackument, { - 'dist-tags': { latest: '1.0.0' }, - maintainers: [{ name: 'other', email: 'other@idk.tech' }], - versions: { - '1.0.0': { - _id: 'libnpmpublish@1.0.0', - _nodeVersion: process.versions.node, - _npmVersion: '6.9.0', - _npmUser: { - name: 'other', - email: 'other@idk.tech' - }, - name: 'libnpmpublish', - version: '1.0.0', - description: 'some stuff', - maintainers: [{ name: 'other', email: 'other@idk.tech' }], - dist: { - shasum, - integrity: integrity.toString(), - tarball: `http://mock.reg/libnpmpublish/-/libnpmpublish-1.0.0.tgz` - } - } - }, - _attachments: { - 'libnpmpublish-1.0.0.tgz': { - 'content_type': 'application/octet-stream', - data: tarData.toString('base64'), - length: tarData.length - } - } - })) - const mergedPackument = cloneDeep(Object.assign({}, basePackument, { - time: currentPackument.time, - 'dist-tags': { latest: '1.0.0' }, - maintainers: currentPackument.maintainers, - versions: Object.assign({}, currentPackument.versions, newPackument.versions), - _attachments: Object.assign({}, currentPackument._attachments, newPackument._attachments) - })) - const srv = tnock(t, REG) - srv.put('/libnpmpublish', body => { - t.notOk(body._rev, 'no _rev in initial post') - t.deepEqual(body, newPackument, 'got conflicting packument') - return true - }).reply(409, { error: 'gimme _rev plz' }) - srv.get('/libnpmpublish?write=true').reply(200, Object.assign({ - _rev: REV - }, currentPackument)) - srv.put('/libnpmpublish', body => { - t.deepEqual(body, Object.assign({ - _rev: REV - }, mergedPackument), 'posted packument includes _rev and a merged version') - return true - }).reply(201, {}) - return publish(manifest, tarData, OPTS.concat({ - npmVersion: '6.9.0', - username: 'other', - email: 'other@idk.tech' - })).then(() => { - t.ok(true, 'publish succeeded') - }) - }) -}) - -test('retry after a conflict -- no versions on remote', t => { - const REV = '72-47f2986bfd8e8b55068b204588bbf484' - const manifest = { - name: 'libnpmpublish', - version: '1.0.0', - description: 'some stuff' - } - return mockTar({ - 'package.json': JSON.stringify(manifest), - 'index.js': 'console.log("hello world")' - }).then(tarData => { - const shasum = crypto.createHash('sha1').update(tarData).digest('hex') - const integrity = ssri.fromData(tarData, { algorithms: ['sha512'] }) - const basePackument = { - name: 'libnpmpublish', - description: 'some stuff', - readme: '', - _id: 'libnpmpublish' - } - const currentPackument = cloneDeep(Object.assign({}, basePackument, { - maintainers: [{ name: 'zkat', email: 'idk@idk.tech' }] - })) - const newPackument = cloneDeep(Object.assign({}, basePackument, { - 'dist-tags': { latest: '1.0.0' }, - maintainers: [{ name: 'other', email: 'other@idk.tech' }], - versions: { - '1.0.0': { - _id: 'libnpmpublish@1.0.0', - _nodeVersion: process.versions.node, - _npmVersion: '6.9.0', - _npmUser: { - name: 'other', - email: 'other@idk.tech' - }, - name: 'libnpmpublish', - version: '1.0.0', - description: 'some stuff', - maintainers: [{ name: 'other', email: 'other@idk.tech' }], - dist: { - shasum, - integrity: integrity.toString(), - tarball: `http://mock.reg/libnpmpublish/-/libnpmpublish-1.0.0.tgz` - } - } - }, - _attachments: { - 'libnpmpublish-1.0.0.tgz': { - 'content_type': 'application/octet-stream', - data: tarData.toString('base64'), - length: tarData.length - } - } - })) - const mergedPackument = cloneDeep(Object.assign({}, basePackument, { - 'dist-tags': { latest: '1.0.0' }, - maintainers: currentPackument.maintainers, - versions: Object.assign({}, currentPackument.versions, newPackument.versions), - _attachments: Object.assign({}, currentPackument._attachments, newPackument._attachments) - })) - const srv = tnock(t, REG) - srv.put('/libnpmpublish', body => { - t.notOk(body._rev, 'no _rev in initial post') - t.deepEqual(body, newPackument, 'got conflicting packument') - return true - }).reply(409, { error: 'gimme _rev plz' }) - srv.get('/libnpmpublish?write=true').reply(200, Object.assign({ - _rev: REV - }, currentPackument)) - srv.put('/libnpmpublish', body => { - t.deepEqual(body, Object.assign({ - _rev: REV - }, mergedPackument), 'posted packument includes _rev and a merged version') - return true - }).reply(201, {}) - return publish(manifest, tarData, OPTS.concat({ - npmVersion: '6.9.0', - username: 'other', - email: 'other@idk.tech' - })).then(() => { - t.ok(true, 'publish succeeded') - }) - }) -}) -test('version conflict', t => { - const REV = '72-47f2986bfd8e8b55068b204588bbf484' - const manifest = { - name: 'libnpmpublish', - version: '1.0.0', - description: 'some stuff' - } - return mockTar({ - 'package.json': JSON.stringify(manifest), - 'index.js': 'console.log("hello world")' - }).then(tarData => { - const shasum = crypto.createHash('sha1').update(tarData).digest('hex') - const integrity = ssri.fromData(tarData, { algorithms: ['sha512'] }) - const basePackument = { - name: 'libnpmpublish', - description: 'some stuff', - readme: '', - _id: 'libnpmpublish', - 'dist-tags': {}, - versions: {}, - _attachments: {} - } - const newPackument = cloneDeep(Object.assign({}, basePackument, { - 'dist-tags': { latest: '1.0.0' }, - versions: { - '1.0.0': { - _id: 'libnpmpublish@1.0.0', - _nodeVersion: process.versions.node, - _npmVersion: '6.9.0', - name: 'libnpmpublish', - version: '1.0.0', - description: 'some stuff', - dist: { - shasum, - integrity: integrity.toString(), - tarball: `http://mock.reg/libnpmpublish/-/libnpmpublish-1.0.0.tgz` - } - } - }, - _attachments: { - 'libnpmpublish-1.0.0.tgz': { - 'content_type': 'application/octet-stream', - data: tarData.toString('base64'), - length: tarData.length - } - } - })) - const srv = tnock(t, REG) - srv.put('/libnpmpublish', body => { - t.notOk(body._rev, 'no _rev in initial post') - t.deepEqual(body, newPackument, 'got conflicting packument') - return true - }).reply(409, { error: 'gimme _rev plz' }) - srv.get('/libnpmpublish?write=true').reply(200, Object.assign({ - _rev: REV - }, newPackument)) - return publish(manifest, tarData, OPTS.concat({ - npmVersion: '6.9.0', - token: 'deadbeef' - })).then( - () => { throw new Error('should not succeed') }, - err => { - t.equal(err.code, 'EPUBLISHCONFLICT', 'got publish conflict code') - } - ) - }) -}) - -test('publish with basic auth', t => { - const manifest = { - name: 'libnpmpublish', - version: '1.0.0', - description: 'some stuff' - } - return mockTar({ - 'package.json': JSON.stringify(manifest), - 'index.js': 'console.log("hello world")' - }).then(tarData => { - const shasum = crypto.createHash('sha1').update(tarData).digest('hex') - const integrity = ssri.fromData(tarData, { algorithms: ['sha512'] }) - const packument = { - name: 'libnpmpublish', - description: 'some stuff', - readme: '', - _id: 'libnpmpublish', - 'dist-tags': { - latest: '1.0.0' - }, - maintainers: [{ - name: 'zkat', - email: 'kat@example.tech' - }], - versions: { - '1.0.0': { - _id: 'libnpmpublish@1.0.0', - _nodeVersion: process.versions.node, - _npmVersion: '6.9.0', - _npmUser: { - name: 'zkat', - email: 'kat@example.tech' - }, - maintainers: [{ - name: 'zkat', - email: 'kat@example.tech' - }], - name: 'libnpmpublish', - version: '1.0.0', - description: 'some stuff', - dist: { - shasum, - integrity: integrity.toString(), - tarball: `http://mock.reg/libnpmpublish/-/libnpmpublish-1.0.0.tgz` - } - } - }, - _attachments: { - 'libnpmpublish-1.0.0.tgz': { - 'content_type': 'application/octet-stream', - data: tarData.toString('base64'), - length: tarData.length - } - } - } - const srv = tnock(t, REG) - srv.put('/libnpmpublish', body => { - t.deepEqual(body, packument, 'posted packument matches expectations') - return true - }, { - authorization: /^Basic / - }).reply(201, {}) - - return publish(manifest, tarData, OPTS.concat({ - npmVersion: '6.9.0', - username: 'zkat', - email: 'kat@example.tech' - })).then(() => { - t.ok(true, 'publish succeeded') - }) - }) -}) - -test('publish base64 string', t => { - const manifest = { - name: 'libnpmpublish', - version: '1.0.0', - description: 'some stuff' - } - return mockTar({ - 'package.json': JSON.stringify(manifest), - 'index.js': 'console.log("hello world")' - }).then(tarData => { - const shasum = crypto.createHash('sha1').update(tarData).digest('hex') - const integrity = ssri.fromData(tarData, { algorithms: ['sha512'] }) - const packument = { - name: 'libnpmpublish', - description: 'some stuff', - readme: '', - _id: 'libnpmpublish', - 'dist-tags': { - latest: '1.0.0' - }, - versions: { - '1.0.0': { - _id: 'libnpmpublish@1.0.0', - _nodeVersion: process.versions.node, - _npmVersion: '6.9.0', - name: 'libnpmpublish', - version: '1.0.0', - description: 'some stuff', - dist: { - shasum, - integrity: integrity.toString(), - tarball: `http://mock.reg/libnpmpublish/-/libnpmpublish-1.0.0.tgz` - } - } - }, - _attachments: { - 'libnpmpublish-1.0.0.tgz': { - 'content_type': 'application/octet-stream', - data: tarData.toString('base64'), - length: tarData.length - } - } - } - const srv = tnock(t, REG) - srv.put('/libnpmpublish', body => { - t.deepEqual(body, packument, 'posted packument matches expectations') - return true - }, { - authorization: 'Bearer deadbeef' - }).reply(201, {}) - - return publish(manifest, tarData.toString('base64'), OPTS.concat({ - npmVersion: '6.9.0', - token: 'deadbeef' - })).then(() => { - t.ok(true, 'publish succeeded') - }) - }) -}) - -test('publish tar stream', t => { - const manifest = { - name: 'libnpmpublish', - version: '1.0.0', - description: 'some stuff' - } - return mockTar({ - 'package.json': JSON.stringify(manifest), - 'index.js': 'console.log("hello world")' - }).then(tarData => { - const shasum = crypto.createHash('sha1').update(tarData).digest('hex') - const integrity = ssri.fromData(tarData, { algorithms: ['sha512'] }) - const packument = { - name: 'libnpmpublish', - description: 'some stuff', - readme: '', - _id: 'libnpmpublish', - 'dist-tags': { - latest: '1.0.0' - }, - versions: { - '1.0.0': { - _id: 'libnpmpublish@1.0.0', - _nodeVersion: process.versions.node, - _npmVersion: '6.9.0', - name: 'libnpmpublish', - version: '1.0.0', - description: 'some stuff', - dist: { - shasum, - integrity: integrity.toString(), - tarball: `http://mock.reg/libnpmpublish/-/libnpmpublish-1.0.0.tgz` - } - } - }, - _attachments: { - 'libnpmpublish-1.0.0.tgz': { - 'content_type': 'application/octet-stream', - data: tarData.toString('base64'), - length: tarData.length - } - } - } - const srv = tnock(t, REG) - srv.put('/libnpmpublish', body => { - t.deepEqual(body, packument, 'posted packument matches expectations') - return true - }, { - authorization: 'Bearer deadbeef' - }).reply(201, {}) - - const stream = new PassThrough() - setTimeout(() => stream.end(tarData), 0) - return publish(manifest, stream, OPTS.concat({ - npmVersion: '6.9.0', - token: 'deadbeef' - })).then(() => { - t.ok(true, 'publish succeeded') - }) - }) -}) - -test('refuse if package marked private', t => { - const manifest = { - name: 'libnpmpublish', - version: '1.0.0', - description: 'some stuff', - private: true - } - return mockTar({ - 'package.json': JSON.stringify(manifest), - 'index.js': 'console.log("hello world")' - }).then(tarData => { - return publish(manifest, tarData, OPTS.concat({ - npmVersion: '6.9.0', - token: 'deadbeef' - })).then( - () => { throw new Error('should not have succeeded') }, - err => { - t.equal(err.code, 'EPRIVATE', 'got correct error code') - } - ) - }) -}) - -test('publish includes access', t => { - const manifest = { - name: 'libnpmpublish', - version: '1.0.0', - description: 'some stuff' - } - return mockTar({ - 'package.json': JSON.stringify(manifest), - 'index.js': 'console.log("hello world")' - }).then(tarData => { - const shasum = crypto.createHash('sha1').update(tarData).digest('hex') - const integrity = ssri.fromData(tarData, { algorithms: ['sha512'] }) - const packument = { - name: 'libnpmpublish', - description: 'some stuff', - readme: '', - access: 'public', - _id: 'libnpmpublish', - 'dist-tags': { - latest: '1.0.0' - }, - versions: { - '1.0.0': { - _id: 'libnpmpublish@1.0.0', - _nodeVersion: process.versions.node, - name: 'libnpmpublish', - version: '1.0.0', - description: 'some stuff', - dist: { - shasum, - integrity: integrity.toString(), - tarball: `http://mock.reg/libnpmpublish/-/libnpmpublish-1.0.0.tgz` - } - } - }, - _attachments: { - 'libnpmpublish-1.0.0.tgz': { - 'content_type': 'application/octet-stream', - data: tarData.toString('base64'), - length: tarData.length - } - } - } - const srv = tnock(t, REG) - srv.put('/libnpmpublish', body => { - t.deepEqual(body, packument, 'posted packument matches expectations') - return true - }, { - authorization: 'Bearer deadbeef' - }).reply(201, {}) - - return publish(manifest, tarData, OPTS.concat({ - token: 'deadbeef', - access: 'public' - })).then(() => { - t.ok(true, 'publish succeeded') - }) - }) -}) - -test('refuse if package is unscoped plus `restricted` access', t => { - const manifest = { - name: 'libnpmpublish', - version: '1.0.0', - description: 'some stuff' - } - return mockTar({ - 'package.json': JSON.stringify(manifest), - 'index.js': 'console.log("hello world")' - }).then(tarData => { - return publish(manifest, tarData, OPTS.concat({ - npmVersion: '6.9.0', - access: 'restricted' - })).then( - () => { throw new Error('should not have succeeded') }, - err => { - t.equal(err.code, 'EUNSCOPED', 'got correct error code') - } - ) - }) -}) - -test('refuse if tarball is wrong type', t => { - const manifest = { - name: 'libnpmpublish', - version: '1.0.0', - description: 'some stuff' - } - return publish(manifest, { data: 42 }, OPTS.concat({ - npmVersion: '6.9.0', - token: 'deadbeef' - })).then( - () => { throw new Error('should not have succeeded') }, - err => { - t.equal(err.code, 'EBADTAR', 'got correct error code') - } - ) -}) - -test('refuse if bad semver on manifest', t => { - const manifest = { - name: 'libnpmpublish', - version: 'lmao', - description: 'some stuff' - } - return publish(manifest, 'deadbeef', OPTS).then( - () => { throw new Error('should not have succeeded') }, - err => { - t.equal(err.code, 'EBADSEMVER', 'got correct error code') - } - ) -}) - -test('other error code', t => { - const manifest = { - name: 'libnpmpublish', - version: '1.0.0', - description: 'some stuff' - } - return mockTar({ - 'package.json': JSON.stringify(manifest), - 'index.js': 'console.log("hello world")' - }).then(tarData => { - const shasum = crypto.createHash('sha1').update(tarData).digest('hex') - const integrity = ssri.fromData(tarData, { algorithms: ['sha512'] }) - const packument = { - name: 'libnpmpublish', - description: 'some stuff', - readme: '', - _id: 'libnpmpublish', - 'dist-tags': { - latest: '1.0.0' - }, - versions: { - '1.0.0': { - _id: 'libnpmpublish@1.0.0', - _nodeVersion: process.versions.node, - _npmVersion: '6.9.0', - name: 'libnpmpublish', - version: '1.0.0', - description: 'some stuff', - dist: { - shasum, - integrity: integrity.toString(), - tarball: `http://mock.reg/libnpmpublish/-/libnpmpublish-1.0.0.tgz` - } - } - }, - _attachments: { - 'libnpmpublish-1.0.0.tgz': { - 'content_type': 'application/octet-stream', - data: tarData.toString('base64'), - length: tarData.length - } - } - } - const srv = tnock(t, REG) - srv.put('/libnpmpublish', body => { - t.deepEqual(body, packument, 'posted packument matches expectations') - return true - }, { - authorization: 'Bearer deadbeef' - }).reply(500, { error: 'go away' }) - - return publish(manifest, tarData, OPTS.concat({ - npmVersion: '6.9.0', - token: 'deadbeef' - })).then( - () => { throw new Error('should not succeed') }, - err => { - t.match(err.message, /go away/, 'no retry on non-409') - } - ) - }) -}) - -test('publish includes access', t => { - const manifest = { - name: 'libnpmpublish', - version: '1.0.0', - description: 'some stuff' - } - return mockTar({ - 'package.json': JSON.stringify(manifest), - 'index.js': 'console.log("hello world")' - }).then(tarData => { - const shasum = crypto.createHash('sha1').update(tarData).digest('hex') - const integrity = ssri.fromData(tarData, { algorithms: ['sha512'] }) - const packument = { - name: 'libnpmpublish', - description: 'some stuff', - readme: '', - access: 'public', - _id: 'libnpmpublish', - 'dist-tags': { - latest: '1.0.0' - }, - versions: { - '1.0.0': { - _id: 'libnpmpublish@1.0.0', - _nodeVersion: process.versions.node, - name: 'libnpmpublish', - version: '1.0.0', - description: 'some stuff', - dist: { - shasum, - integrity: integrity.toString(), - tarball: `http://mock.reg/libnpmpublish/-/libnpmpublish-1.0.0.tgz` - } - } - }, - _attachments: { - 'libnpmpublish-1.0.0.tgz': { - 'content_type': 'application/octet-stream', - data: tarData.toString('base64'), - length: tarData.length - } - } - } - const srv = tnock(t, REG) - srv.put('/libnpmpublish', body => { - t.deepEqual(body, packument, 'posted packument matches expectations') - return true - }, { - authorization: 'Bearer deadbeef' - }).reply(201, {}) - - return publish(manifest, tarData, OPTS.concat({ - token: 'deadbeef', - access: 'public' - })).then(() => { - t.ok(true, 'publish succeeded') - }) - }) -}) - -test('publishConfig on manifest', t => { - const manifest = { - name: 'libnpmpublish', - version: '1.0.0', - description: 'some stuff', - publishConfig: { - registry: REG - } - } - return mockTar({ - 'package.json': JSON.stringify(manifest), - 'index.js': 'console.log("hello world")' - }).then(tarData => { - const shasum = crypto.createHash('sha1').update(tarData).digest('hex') - const integrity = ssri.fromData(tarData, { algorithms: ['sha512'] }) - const packument = { - name: 'libnpmpublish', - description: 'some stuff', - readme: '', - _id: 'libnpmpublish', - 'dist-tags': { - latest: '1.0.0' - }, - versions: { - '1.0.0': { - _id: 'libnpmpublish@1.0.0', - _nodeVersion: process.versions.node, - name: 'libnpmpublish', - version: '1.0.0', - description: 'some stuff', - dist: { - shasum, - integrity: integrity.toString(), - tarball: `http://mock.reg/libnpmpublish/-/libnpmpublish-1.0.0.tgz` - }, - publishConfig: { - registry: REG - } - } - }, - _attachments: { - 'libnpmpublish-1.0.0.tgz': { - 'content_type': 'application/octet-stream', - data: tarData.toString('base64'), - length: tarData.length - } - } - } - const srv = tnock(t, REG) - srv.put('/libnpmpublish', body => { - t.deepEqual(body, packument, 'posted packument matches expectations') - return true - }, { - authorization: 'Bearer deadbeef' - }).reply(201, {}) - - return publish(manifest, tarData, { token: 'deadbeef' }).then(ret => { - t.ok(ret, 'publish succeeded') - }) - }) -}) - -test('publish with encoded _auth', t => { - const manifest = { - name: 'libnpmpublish', - version: '1.0.0', - description: 'some stuff' - } - return mockTar({ - 'package.json': JSON.stringify(manifest), - 'index.js': 'console.log("hello world")' - }).then(tarData => { - const shasum = crypto.createHash('sha1').update(tarData).digest('hex') - const integrity = ssri.fromData(tarData, { algorithms: ['sha512'] }) - const packument = { - name: 'libnpmpublish', - description: 'some stuff', - readme: '', - _id: 'libnpmpublish', - 'dist-tags': { - latest: '1.0.0' - }, - maintainers: [ - { name: 'myuser', email: 'my@ema.il' } - ], - versions: { - '1.0.0': { - _id: 'libnpmpublish@1.0.0', - _npmUser: { - name: 'myuser', - email: 'my@ema.il' - }, - maintainers: [ - { name: 'myuser', email: 'my@ema.il' } - ], - _nodeVersion: process.versions.node, - name: 'libnpmpublish', - version: '1.0.0', - description: 'some stuff', - dist: { - shasum, - integrity: integrity.toString(), - tarball: `http://mock.reg/libnpmpublish/-/libnpmpublish-1.0.0.tgz` - } - } - }, - _attachments: { - 'libnpmpublish-1.0.0.tgz': { - 'content_type': 'application/octet-stream', - data: tarData.toString('base64'), - length: tarData.length - } - } - } - const srv = tnock(t, REG) - srv.put('/libnpmpublish', body => { - t.deepEqual(body, packument, 'posted packument matches expectations') - return true - }, { - authorization: 'Bearer deadbeef' - }).reply(201, {}) - - return publish(manifest, tarData, OPTS.concat({ - _auth: Buffer.from('myuser:mypassword', 'utf8').toString('base64'), - email: 'my@ema.il' - })).then(ret => { - t.ok(ret, 'publish succeeded using _auth') - }) - }) -}) - -test('publish with 302 redirect', t => { - const manifest = { - name: 'libnpmpublish', - version: '1.0.0', - description: 'some stuff' - } - return mockTar({ - 'package.json': JSON.stringify(manifest), - 'index.js': 'console.log("hello world")' - }).then(tarData => { - const shasum = crypto.createHash('sha1').update(tarData).digest('hex') - const integrity = ssri.fromData(tarData, { algorithms: ['sha512'] }) - const packument = { - name: 'libnpmpublish', - description: 'some stuff', - readme: '', - _id: 'libnpmpublish', - 'dist-tags': { - latest: '1.0.0' - }, - versions: { - '1.0.0': { - _id: 'libnpmpublish@1.0.0', - _nodeVersion: process.versions.node, - name: 'libnpmpublish', - version: '1.0.0', - description: 'some stuff', - dist: { - shasum, - integrity: integrity.toString(), - tarball: `http://mock.reg/libnpmpublish/-/libnpmpublish-1.0.0.tgz` - } - } - }, - _attachments: { - 'libnpmpublish-1.0.0.tgz': { - 'content_type': 'application/octet-stream', - data: tarData.toString('base64'), - length: tarData.length - } - } - } - tnock(t, REG).put('/libnpmpublish').reply(302, '', { - location: 'http://blah.net/libnpmpublish' - }) - tnock(t, 'http://blah.net').put('/libnpmpublish', body => { - t.deepEqual(body, packument, 'posted packument matches expectations') - return true - }, { - authorization: 'Bearer deadbeef' - }).reply(201, {}) - - return publish(manifest, tarData, OPTS.concat({ - token: 'deadbeef' - })).then(ret => { - t.ok(ret, 'publish succeeded') - }) - }) -}) diff --git a/deps/npm/node_modules/libnpmpublish/test/unpublish.js b/deps/npm/node_modules/libnpmpublish/test/unpublish.js deleted file mode 100644 index 19ac464a3b7322..00000000000000 --- a/deps/npm/node_modules/libnpmpublish/test/unpublish.js +++ /dev/null @@ -1,249 +0,0 @@ -'use strict' - -const figgyPudding = require('figgy-pudding') -const test = require('tap').test -const tnock = require('./util/tnock.js') - -const OPTS = figgyPudding({ registry: {} })({ - registry: 'https://mock.reg/' -}) - -const REG = OPTS.registry -const REV = '72-47f2986bfd8e8b55068b204588bbf484' -const unpub = require('../unpublish.js') - -test('basic test', t => { - const doc = { - _id: 'foo', - _rev: REV, - name: 'foo', - 'dist-tags': { - latest: '1.0.0' - }, - versions: { - '1.0.0': { - name: 'foo', - dist: { - tarball: `${REG}/foo/-/foo-1.0.0.tgz` - } - } - } - } - const srv = tnock(t, REG) - srv.get('/foo?write=true').reply(200, doc) - srv.delete(`/foo/-rev/${REV}`).reply(201) - return unpub('foo', OPTS).then(ret => { - t.ok(ret, 'foo was unpublished') - }) -}) - -test('scoped basic test', t => { - const doc = { - _id: '@foo/bar', - _rev: REV, - name: '@foo/bar', - 'dist-tags': { - latest: '1.0.0' - }, - versions: { - '1.0.0': { - name: '@foo/bar', - dist: { - tarball: `${REG}/@foo/bar/-/foo-1.0.0.tgz` - } - } - } - } - const srv = tnock(t, REG) - srv.get('/@foo%2fbar?write=true').reply(200, doc) - srv.delete(`/@foo%2fbar/-rev/${REV}`).reply(201) - return unpub('@foo/bar', OPTS).then(() => { - t.ok(true, 'foo was unpublished') - }) -}) - -test('unpublish specific, last version', t => { - const doc = { - _id: 'foo', - _rev: REV, - name: 'foo', - 'dist-tags': { - latest: '1.0.0' - }, - versions: { - '1.0.0': { - name: 'foo', - dist: { - tarball: `${REG}/foo/-/foo-1.0.0.tgz` - } - } - } - } - const srv = tnock(t, REG) - srv.get('/foo?write=true').reply(200, doc) - srv.delete(`/foo/-rev/${REV}`).reply(201) - return unpub('foo@1.0.0', OPTS).then(() => { - t.ok(true, 'foo was unpublished') - }) -}) - -test('unpublish specific version', t => { - const doc = { - _id: 'foo', - _rev: REV, - _revisions: [1, 2, 3], - _attachments: [1, 2, 3], - name: 'foo', - 'dist-tags': { - latest: '1.0.1' - }, - versions: { - '1.0.0': { - name: 'foo', - dist: { - tarball: `${REG}/foo/-/foo-1.0.0.tgz` - } - }, - '1.0.1': { - name: 'foo', - dist: { - tarball: `${REG}/foo/-/foo-1.0.1.tgz` - } - } - } - } - const postEdit = { - _id: 'foo', - _rev: REV, - name: 'foo', - 'dist-tags': { - latest: '1.0.0' - }, - versions: { - '1.0.0': { - name: 'foo', - dist: { - tarball: `${REG}/foo/-/foo-1.0.0.tgz` - } - } - } - } - - const srv = tnock(t, REG) - srv.get('/foo?write=true').reply(200, doc) - srv.put(`/foo/-rev/${REV}`, postEdit).reply(200) - srv.get('/foo?write=true').reply(200, postEdit) - srv.delete(`/foo/-/foo-1.0.1.tgz/-rev/${REV}`).reply(200) - return unpub('foo@1.0.1', OPTS).then(() => { - t.ok(true, 'foo was unpublished') - }) -}) - -test('404 considered a success', t => { - const srv = tnock(t, REG) - srv.get('/foo?write=true').reply(404) - return unpub('foo', OPTS).then(() => { - t.ok(true, 'foo was unpublished') - }) -}) - -test('non-404 errors', t => { - const srv = tnock(t, REG) - srv.get('/foo?write=true').reply(500) - return unpub('foo', OPTS).then( - () => { throw new Error('should not have succeeded') }, - err => { t.equal(err.code, 'E500', 'got right error from server') } - ) -}) - -test('packument with missing versions unpublishes whole thing', t => { - const doc = { - _id: 'foo', - _rev: REV, - name: 'foo', - 'dist-tags': { - latest: '1.0.0' - } - } - const srv = tnock(t, REG) - srv.get('/foo?write=true').reply(200, doc) - srv.delete(`/foo/-rev/${REV}`).reply(201) - return unpub('foo@1.0.0', OPTS).then(() => { - t.ok(true, 'foo was unpublished') - }) -}) - -test('packument with missing specific version assumed unpublished', t => { - const doc = { - _id: 'foo', - _rev: REV, - name: 'foo', - 'dist-tags': { - latest: '1.0.0' - }, - versions: { - '1.0.0': { - name: 'foo', - dist: { - tarball: `${REG}/foo/-/foo-1.0.0.tgz` - } - } - } - } - const srv = tnock(t, REG) - srv.get('/foo?write=true').reply(200, doc) - return unpub('foo@1.0.1', OPTS).then(() => { - t.ok(true, 'foo was unpublished') - }) -}) - -test('unpublish specific version without dist-tag update', t => { - const doc = { - _id: 'foo', - _rev: REV, - _revisions: [1, 2, 3], - _attachments: [1, 2, 3], - name: 'foo', - 'dist-tags': { - latest: '1.0.0' - }, - versions: { - '1.0.0': { - name: 'foo', - dist: { - tarball: `${REG}/foo/-/foo-1.0.0.tgz` - } - }, - '1.0.1': { - name: 'foo', - dist: { - tarball: `${REG}/foo/-/foo-1.0.1.tgz` - } - } - } - } - const postEdit = { - _id: 'foo', - _rev: REV, - name: 'foo', - 'dist-tags': { - latest: '1.0.0' - }, - versions: { - '1.0.0': { - name: 'foo', - dist: { - tarball: `${REG}/foo/-/foo-1.0.0.tgz` - } - } - } - } - const srv = tnock(t, REG) - srv.get('/foo?write=true').reply(200, doc) - srv.put(`/foo/-rev/${REV}`, postEdit).reply(200) - srv.get('/foo?write=true').reply(200, postEdit) - srv.delete(`/foo/-/foo-1.0.1.tgz/-rev/${REV}`).reply(200) - return unpub('foo@1.0.1', OPTS).then(() => { - t.ok(true, 'foo was unpublished') - }) -}) diff --git a/deps/npm/node_modules/libnpmpublish/test/util/mock-tarball.js b/deps/npm/node_modules/libnpmpublish/test/util/mock-tarball.js deleted file mode 100644 index c6253cd218f5b9..00000000000000 --- a/deps/npm/node_modules/libnpmpublish/test/util/mock-tarball.js +++ /dev/null @@ -1,47 +0,0 @@ -'use strict' - -const BB = require('bluebird') - -const getStream = require('get-stream') -const tar = require('tar-stream') -const zlib = require('zlib') - -module.exports = makeTarball -function makeTarball (files, opts) { - opts = opts || {} - const pack = tar.pack() - Object.keys(files).forEach(function (filename) { - const entry = files[filename] - pack.entry({ - name: (opts.noPrefix ? '' : 'package/') + filename, - type: entry.type, - size: entry.size, - mode: entry.mode, - mtime: entry.mtime || new Date(0), - linkname: entry.linkname, - uid: entry.uid, - gid: entry.gid, - uname: entry.uname, - gname: entry.gname - }, typeof files[filename] === 'string' - ? files[filename] - : files[filename].data) - }) - pack.finalize() - return BB.try(() => { - if (opts.stream && opts.gzip) { - const gz = zlib.createGzip() - pack.on('error', err => gz.emit('error', err)).pipe(gz) - } else if (opts.stream) { - return pack - } else { - return getStream.buffer(pack).then(ret => { - if (opts.gzip) { - return BB.fromNode(cb => zlib.gzip(ret, cb)) - } else { - return ret - } - }) - } - }) -} diff --git a/deps/npm/node_modules/libnpmpublish/test/util/tnock.js b/deps/npm/node_modules/libnpmpublish/test/util/tnock.js deleted file mode 100644 index 00b6e160e10192..00000000000000 --- a/deps/npm/node_modules/libnpmpublish/test/util/tnock.js +++ /dev/null @@ -1,12 +0,0 @@ -'use strict' - -const nock = require('nock') - -module.exports = tnock -function tnock (t, host) { - const server = nock(host) - t.tearDown(function () { - server.done() - }) - return server -} diff --git a/deps/npm/node_modules/libnpmpublish/unpublish.js b/deps/npm/node_modules/libnpmpublish/unpublish.js index d7d98243c6b093..3fe3860420bbfb 100644 --- a/deps/npm/node_modules/libnpmpublish/unpublish.js +++ b/deps/npm/node_modules/libnpmpublish/unpublish.js @@ -1,86 +1,100 @@ 'use strict' -const figgyPudding = require('figgy-pudding') const npa = require('npm-package-arg') const npmFetch = require('npm-registry-fetch') const semver = require('semver') -const url = require('url') - -const UnpublishConfig = figgyPudding({ - force: { default: false }, - Promise: { default: () => Promise } -}) +const { URL } = require('url') module.exports = unpublish -function unpublish (spec, opts) { - opts = UnpublishConfig(opts) - return new opts.Promise(resolve => resolve()).then(() => { - spec = npa(spec) - // NOTE: spec is used to pick the appropriate registry/auth combo. - opts = opts.concat({ spec }) +async function unpublish (spec, opts) { + spec = npa(spec) + // spec is used to pick the appropriate registry/auth combo. + opts = { + force: false, + ...opts, + spec + } + + try { const pkgUri = spec.escapedName - return npmFetch.json(pkgUri, opts.concat({ + const pkg = await npmFetch.json(pkgUri, { + ...opts, query: { write: true } - })).then(pkg => { - if (!spec.rawSpec || spec.rawSpec === '*') { - return npmFetch(`${pkgUri}/-rev/${pkg._rev}`, opts.concat({ - method: 'DELETE', - ignoreBody: true - })) - } else { - const version = spec.rawSpec - const allVersions = pkg.versions || {} - const versionPublic = allVersions[version] - let dist - if (versionPublic) { - dist = allVersions[version].dist - } - delete allVersions[version] - // if it was the only version, then delete the whole package. - if (!Object.keys(allVersions).length) { - return npmFetch(`${pkgUri}/-rev/${pkg._rev}`, opts.concat({ - method: 'DELETE', - ignoreBody: true - })) - } else if (versionPublic) { - const latestVer = pkg['dist-tags'].latest - Object.keys(pkg['dist-tags']).forEach(tag => { - if (pkg['dist-tags'][tag] === version) { - delete pkg['dist-tags'][tag] - } - }) + }) + + const version = spec.rawSpec + const allVersions = pkg.versions || {} + const versionData = allVersions[version] + + const rawSpecs = (!spec.rawSpec || spec.rawSpec === '*') + const onlyVersion = Object.keys(allVersions).length === 1 + const noVersions = !Object.keys(allVersions).length + + // if missing specific version, + // assumed unpublished + if (!versionData && !rawSpecs && !noVersions) { + return true + } - if (latestVer === version) { - pkg['dist-tags'].latest = Object.keys( - allVersions - ).sort(semver.compareLoose).pop() - } + // unpublish all versions of a package: + // - no specs supplied "npm unpublish foo" + // - all specs ("*") "npm unpublish foo@*" + // - there was only one version + // - has no versions field on packument + if (rawSpecs || onlyVersion || noVersions) { + await npmFetch(`${pkgUri}/-rev/${pkg._rev}`, { + ...opts, + method: 'DELETE', + ignoreBody: true + }) + return true + } else { + const dist = allVersions[version].dist + delete allVersions[version] - delete pkg._revisions - delete pkg._attachments - // Update packument with removed versions - return npmFetch(`${pkgUri}/-rev/${pkg._rev}`, opts.concat({ - method: 'PUT', - body: pkg, - ignoreBody: true - })).then(() => { - // Remove the tarball itself - return npmFetch.json(pkgUri, opts.concat({ - query: { write: true } - })).then(({ _rev, _id }) => { - const tarballUrl = url.parse(dist.tarball).pathname.substr(1) - return npmFetch(`${tarballUrl}/-rev/${_rev}`, opts.concat({ - method: 'DELETE', - ignoreBody: true - })) - }) - }) + const latestVer = pkg['dist-tags'].latest + + // deleting dist tags associated to version + Object.keys(pkg['dist-tags']).forEach(tag => { + if (pkg['dist-tags'][tag] === version) { + delete pkg['dist-tags'][tag] } + }) + + if (latestVer === version) { + pkg['dist-tags'].latest = Object.keys( + allVersions + ).sort(semver.compareLoose).pop() } - }, err => { - if (err.code !== 'E404') { - throw err - } - }) - }).then(() => true) + + delete pkg._revisions + delete pkg._attachments + + // Update packument with removed versions + await npmFetch(`${pkgUri}/-rev/${pkg._rev}`, { + ...opts, + method: 'PUT', + body: pkg, + ignoreBody: true + }) + + // Remove the tarball itself + const { _rev } = await npmFetch.json(pkgUri, { + ...opts, + query: { write: true } + }) + const tarballUrl = new URL(dist.tarball).pathname.substr(1) + await npmFetch(`${tarballUrl}/-rev/${_rev}`, { + ...opts, + method: 'DELETE', + ignoreBody: true + }) + return true + } + } catch (err) { + if (err.code !== 'E404') { + throw err + } + return true + } } diff --git a/deps/npm/node_modules/libnpmsearch/.travis.yml b/deps/npm/node_modules/libnpmsearch/.travis.yml deleted file mode 100644 index db5ea8b0186403..00000000000000 --- a/deps/npm/node_modules/libnpmsearch/.travis.yml +++ /dev/null @@ -1,7 +0,0 @@ -language: node_js -sudo: false -node_js: - - "10" - - "9" - - "8" - - "6" diff --git a/deps/npm/node_modules/libnpmsearch/CHANGELOG.md b/deps/npm/node_modules/libnpmsearch/CHANGELOG.md index 1adf2d0db52ce7..03b7fedc5bf0d0 100644 --- a/deps/npm/node_modules/libnpmsearch/CHANGELOG.md +++ b/deps/npm/node_modules/libnpmsearch/CHANGELOG.md @@ -1,5 +1,20 @@ # Change Log + +# [3.0.0](https://github.com/npm/libnpmhook/compare/v2.0.2...v3.0.0) (2020-02-26) + +### Breaking Changes + +* [`45f4db1`](https://github.com/npm/libnpmsearch/commit/45f4db1) fix: remove figgy-pudding ([@claudiahdz](https://github.com/claudiahdz)) + +### Miscellaneuous + +* [`b413aae`](https://github.com/npm/libnpmsearch/commit/b413aae) chore: basic project updates ([@claudiahdz](https://github.com/claudiahdz)) +* [`534983c`](https://github.com/npm/libnpmsearch/commit/534983c) chore: remove pr temmsearch ([@ruyadorno](https://github.com/ruyadorno)) +* [`c503a89`](https://github.com/npm/libnpmsearch/commit/c503a89) chore: cleanup badges + contributing ([@ruyadorno](https://github.com/ruyadorno)) + +--- + 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. diff --git a/deps/npm/node_modules/libnpmsearch/PULL_REQUEST_TEMPLATE b/deps/npm/node_modules/libnpmsearch/PULL_REQUEST_TEMPLATE deleted file mode 100644 index 9471c6d325f7eb..00000000000000 --- a/deps/npm/node_modules/libnpmsearch/PULL_REQUEST_TEMPLATE +++ /dev/null @@ -1,7 +0,0 @@ - diff --git a/deps/npm/node_modules/libnpmsearch/README.md b/deps/npm/node_modules/libnpmsearch/README.md index a83988cc2867d4..31f44fe247923d 100644 --- a/deps/npm/node_modules/libnpmsearch/README.md +++ b/deps/npm/node_modules/libnpmsearch/README.md @@ -1,9 +1,23 @@ -# libnpmsearch [![npm version](https://img.shields.io/npm/v/libnpmsearch.svg)](https://npm.im/libnpmsearch) [![license](https://img.shields.io/npm/l/libnpmsearch.svg)](https://npm.im/libnpmsearch) [![Travis](https://img.shields.io/travis/npm/libnpmsearch.svg)](https://travis-ci.org/npm/libnpmsearch) [![AppVeyor](https://ci.appveyor.com/api/projects/status/github/zkat/libnpmsearch?svg=true)](https://ci.appveyor.com/project/zkat/libnpmsearch) [![Coverage Status](https://coveralls.io/repos/github/npm/libnpmsearch/badge.svg?branch=latest)](https://coveralls.io/github/npm/libnpmsearch?branch=latest) +# libnpmsearch + +[![npm version](https://img.shields.io/npm/v/libnpmsearch.svg)](https://npm.im/libnpmsearch) +[![license](https://img.shields.io/npm/l/libnpmsearch.svg)](https://npm.im/libnpmsearch) +[![Coverage Status](https://coveralls.io/repos/github/npm/libnpmsearch/badge.svg?branch=latest)](https://coveralls.io/github/npm/libnpmsearch?branch=latest) [`libnpmsearch`](https://github.com/npm/libnpmsearch) is a Node.js library for programmatically accessing the npm search endpoint. It does **not** support legacy search through `/-/all`. +## Table of Contents + +* [Example](#example) +* [Install](#install) +* [Contributing](#contributing) +* [API](#api) + * [search opts](#opts) + * [`search()`](#search) + * [`search.stream()`](#search-stream) + ## Example ```js @@ -30,15 +44,6 @@ console.log(await search('libnpm')) `$ npm install libnpmsearch` -## Table of Contents - -* [Example](#example) -* [Install](#install) -* [API](#api) - * [search opts](#opts) - * [`search()`](#search) - * [`search.stream()`](#search-stream) - ### API #### `opts` for `libnpmsearch` commands @@ -62,7 +67,6 @@ for options that can be passed in. A couple of options of note for those in a hurry: * `opts.token` - can be passed in and will be used as the authentication token for the registry. For other ways to pass in auth details, see the n-r-f docs. -* `opts.Promise` - If you pass this in, the Promises returned by `libnpmsearch` commands will use this Promise class instead. For example: `{Promise: require('bluebird')}` #### `> search(query, [opts]) -> Promise` diff --git a/deps/npm/node_modules/libnpmsearch/appveyor.yml b/deps/npm/node_modules/libnpmsearch/appveyor.yml deleted file mode 100644 index 9cc64c58e02f96..00000000000000 --- a/deps/npm/node_modules/libnpmsearch/appveyor.yml +++ /dev/null @@ -1,22 +0,0 @@ -environment: - matrix: - - nodejs_version: "10" - - nodejs_version: "9" - - nodejs_version: "8" - - nodejs_version: "6" - -platform: - - x64 - -install: - - ps: Install-Product node $env:nodejs_version $env:platform - - npm config set spin false - - npm install - -test_script: - - npm test - -matrix: - fast_finish: true - -build: off diff --git a/deps/npm/node_modules/libnpmsearch/index.js b/deps/npm/node_modules/libnpmsearch/index.js index 995549aeee03d6..43889e5377e629 100644 --- a/deps/npm/node_modules/libnpmsearch/index.js +++ b/deps/npm/node_modules/libnpmsearch/index.js @@ -1,62 +1,52 @@ 'use strict' -const figgyPudding = require('figgy-pudding') -const getStream = require('get-stream') const npmFetch = require('npm-registry-fetch') -const SearchOpts = figgyPudding({ - detailed: { default: false }, - limit: { default: 20 }, - from: { default: 0 }, - quality: { default: 0.65 }, - popularity: { default: 0.98 }, - maintenance: { default: 0.5 }, - sortBy: {} -}) - module.exports = search function search (query, opts) { - return getStream.array(search.stream(query, opts)) + return search.stream(query, opts).collect() } search.stream = searchStream -function searchStream (query, opts) { - opts = SearchOpts(opts) +function searchStream (query, opts = {}) { + opts = { + detailed: false, + limit: 20, + from: 0, + quality: 0.65, + popularity: 0.98, + maintenance: 0.5, + ...opts + } + switch (opts.sortBy) { case 'optimal': { - opts = opts.concat({ - quality: 0.65, - popularity: 0.98, - maintenance: 0.5 - }) + opts.quality = 0.65 + opts.popularity = 0.98 + opts.maintenance = 0.5 break } case 'quality': { - opts = opts.concat({ - quality: 1, - popularity: 0, - maintenance: 0 - }) + opts.quality = 1 + opts.popularity = 0 + opts.maintenance = 0 break } case 'popularity': { - opts = opts.concat({ - quality: 0, - popularity: 1, - maintenance: 0 - }) + opts.quality = 0 + opts.popularity = 1 + opts.maintenance = 0 break } case 'maintenance': { - opts = opts.concat({ - quality: 0, - popularity: 0, - maintenance: 1 - }) + opts.quality = 0 + opts.popularity = 0 + opts.maintenance = 1 break } } return npmFetch.json.stream('/-/v1/search', 'objects.*', - opts.concat({ + { + ...opts, query: { text: Array.isArray(query) ? query.join(' ') : query, size: opts.limit, @@ -65,7 +55,7 @@ function searchStream (query, opts) { popularity: opts.popularity, maintenance: opts.maintenance }, - mapJson (obj) { + mapJSON: (obj) => { if (obj.package.date) { obj.package.date = new Date(obj.package.date) } @@ -75,6 +65,6 @@ function searchStream (query, opts) { return obj.package } } - }) + } ) } diff --git a/deps/npm/node_modules/libnpmsearch/package.json b/deps/npm/node_modules/libnpmsearch/package.json index 3ad48cb72f593f..0007a7fcc4a8d4 100644 --- a/deps/npm/node_modules/libnpmsearch/package.json +++ b/deps/npm/node_modules/libnpmsearch/package.json @@ -1,52 +1,12 @@ { - "_from": "libnpmsearch@2.0.2", - "_id": "libnpmsearch@2.0.2", - "_inBundle": false, - "_integrity": "sha512-VTBbV55Q6fRzTdzziYCr64+f8AopQ1YZ+BdPOv16UegIEaE8C0Kch01wo4s3kRTFV64P121WZJwgmBwrq68zYg==", - "_location": "/libnpmsearch", - "_phantomChildren": {}, - "_requested": { - "type": "version", - "registry": true, - "raw": "libnpmsearch@2.0.2", - "name": "libnpmsearch", - "escapedName": "libnpmsearch", - "rawSpec": "2.0.2", - "saveSpec": null, - "fetchSpec": "2.0.2" - }, - "_requiredBy": [ - "#USER", - "/" - ], - "_resolved": "https://registry.npmjs.org/libnpmsearch/-/libnpmsearch-2.0.2.tgz", - "_shasum": "9a4f059102d38e3dd44085bdbfe5095f2a5044cf", - "_spec": "libnpmsearch@2.0.2", - "_where": "/Users/isaacs/dev/npm/cli", - "author": { - "name": "Kat Marchán", - "email": "kzm@zkat.tech" - }, - "bugs": { - "url": "https://github.com/npm/libnpmsearch/issues" - }, - "bundleDependencies": false, - "dependencies": { - "figgy-pudding": "^3.5.1", - "get-stream": "^4.0.0", - "npm-registry-fetch": "^4.0.0" - }, - "deprecated": false, + "name": "libnpmsearch", + "version": "3.0.0", "description": "Programmatic API for searching in npm and compatible registries.", - "devDependencies": { - "nock": "^9.6.1", - "standard": "^12.0.0", - "standard-version": "*", - "tap": "^12.0.1", - "weallbehave": "*", - "weallcontribute": "*" - }, - "homepage": "https://npmjs.com/package/libnpmsearch", + "author": "Kat Marchán ", + "files": [ + "*.js", + "lib" + ], "keywords": [ "npm", "search", @@ -54,19 +14,32 @@ "libnpm" ], "license": "ISC", - "name": "libnpmsearch", - "repository": { - "type": "git", - "url": "git+https://github.com/npm/libnpmsearch.git" - }, "scripts": { - "postrelease": "npm publish && git push --follow-tags", "prerelease": "npm t", - "pretest": "standard", "release": "standard-version -s", - "test": "tap -J --100 test/*.js", - "update-coc": "weallbehave -o . && git add CODE_OF_CONDUCT.md && git commit -m 'docs(coc): updated CODE_OF_CONDUCT.md'", - "update-contrib": "weallcontribute -o . && git add CONTRIBUTING.md && git commit -m 'docs(contributing): updated CONTRIBUTING.md'" + "postrelease": "npm publish && git push --follow-tags", + "pretest": "standard", + "test": "tap" + }, + "tap": { + "check-coverage": true + }, + "devDependencies": { + "nock": "^9.6.1", + "standard": "^12.0.0", + "standard-version": "*", + "tap": "^14.10.6" + }, + "repository": { + "type": "git", + "url": "https://github.com/npm/libnpmsearch.git" + }, + "bugs": "https://github.com/npm/libnpmsearch/issues", + "homepage": "https://npmjs.com/package/libnpmsearch", + "dependencies": { + "npm-registry-fetch": "^8.0.0" }, - "version": "2.0.2" + "engines": { + "node": ">=10" + } } diff --git a/deps/npm/node_modules/libnpmsearch/test/index.js b/deps/npm/node_modules/libnpmsearch/test/index.js deleted file mode 100644 index bec5c70e46424d..00000000000000 --- a/deps/npm/node_modules/libnpmsearch/test/index.js +++ /dev/null @@ -1,300 +0,0 @@ -'use strict' - -const figgyPudding = require('figgy-pudding') -const getStream = require('get-stream') -const qs = require('querystring') -const test = require('tap').test -const tnock = require('./util/tnock.js') - -const OPTS = figgyPudding({ registry: {} })({ - registry: 'https://mock.reg/' -}) - -const REG = OPTS.registry -const search = require('../index.js') - -test('basic test', t => { - const query = qs.stringify({ - text: 'oo', - size: 20, - from: 0, - quality: 0.65, - popularity: 0.98, - maintenance: 0.5 - }) - tnock(t, REG).get(`/-/v1/search?${query}`).once().reply(200, { - objects: [ - { package: { name: 'cool', version: '1.0.0' } }, - { package: { name: 'foo', version: '2.0.0' } } - ] - }) - return search('oo', OPTS).then(results => { - t.similar(results, [{ - name: 'cool', - version: '1.0.0' - }, { - name: 'foo', - version: '2.0.0' - }], 'got back an array of search results') - }) -}) - -test('search.stream', t => { - const query = qs.stringify({ - text: 'oo', - size: 20, - from: 0, - quality: 0.65, - popularity: 0.98, - maintenance: 0.5 - }) - tnock(t, REG).get(`/-/v1/search?${query}`).once().reply(200, { - objects: [ - { package: { name: 'cool', version: '1.0.0', date: new Date().toISOString() } }, - { package: { name: 'foo', version: '2.0.0' } } - ] - }) - return getStream.array( - search.stream('oo', OPTS) - ).then(results => { - t.similar(results, [{ - name: 'cool', - version: '1.0.0' - }, { - name: 'foo', - version: '2.0.0' - }], 'has a stream-based API function with identical results') - }) -}) - -test('accepts a limit option', t => { - const query = qs.stringify({ - text: 'oo', - size: 3, - from: 0, - quality: 0.65, - popularity: 0.98, - maintenance: 0.5 - }) - tnock(t, REG).get(`/-/v1/search?${query}`).once().reply(200, { - objects: [ - { package: { name: 'cool', version: '1.0.0' } }, - { package: { name: 'cool', version: '1.0.0' } }, - { package: { name: 'cool', version: '1.0.0' } }, - { package: { name: 'cool', version: '1.0.0' } } - ] - }) - return search('oo', OPTS.concat({ limit: 3 })).then(results => { - t.equal(results.length, 4, 'returns more results if endpoint does so') - }) -}) - -test('accepts a from option', t => { - const query = qs.stringify({ - text: 'oo', - size: 20, - from: 1, - quality: 0.65, - popularity: 0.98, - maintenance: 0.5 - }) - tnock(t, REG).get(`/-/v1/search?${query}`).once().reply(200, { - objects: [ - { package: { name: 'cool', version: '1.0.0' } }, - { package: { name: 'cool', version: '1.1.0' } }, - { package: { name: 'cool', version: '1.0.0' } }, - { package: { name: 'cool', version: '1.0.0' } } - ] - }) - return search('oo', OPTS.concat({ from: 1 })).then(results => { - t.equal(results.length, 4, 'returns more results if endpoint does so') - }) -}) - -test('accepts quality/mainenance/popularity options', t => { - const query = qs.stringify({ - text: 'oo', - size: 20, - from: 0, - quality: 1, - popularity: 2, - maintenance: 3 - }) - tnock(t, REG).get(`/-/v1/search?${query}`).once().reply(200, { - objects: [ - { package: { name: 'cool', version: '1.0.0' } }, - { package: { name: 'cool', version: '1.0.0' } }, - { package: { name: 'cool', version: '1.0.0' } }, - { package: { name: 'cool', version: '1.0.0' } } - ] - }) - return search('oo', OPTS.concat({ - quality: 1, - popularity: 2, - maintenance: 3 - })).then(results => { - t.equal(results.length, 4, 'returns more results if endpoint does so') - }) -}) - -test('sortBy: quality', t => { - const query = qs.stringify({ - text: 'oo', - size: 20, - from: 0, - quality: 1, - popularity: 0, - maintenance: 0 - }) - tnock(t, REG).get(`/-/v1/search?${query}`).once().reply(200, { - objects: [ - { package: { name: 'cool', version: '1.0.0' } }, - { package: { name: 'cool', version: '1.0.0' } }, - { package: { name: 'cool', version: '1.0.0' } }, - { package: { name: 'cool', version: '1.0.0' } } - ] - }) - return search('oo', OPTS.concat({ - sortBy: 'quality' - })).then(results => { - t.equal(results.length, 4, 'returns more results if endpoint does so') - }) -}) - -test('sortBy: popularity', t => { - const query = qs.stringify({ - text: 'oo', - size: 20, - from: 0, - quality: 0, - popularity: 1, - maintenance: 0 - }) - tnock(t, REG).get(`/-/v1/search?${query}`).once().reply(200, { - objects: [ - { package: { name: 'cool', version: '1.0.0' } }, - { package: { name: 'cool', version: '1.0.0' } }, - { package: { name: 'cool', version: '1.0.0' } }, - { package: { name: 'cool', version: '1.0.0' } } - ] - }) - return search('oo', OPTS.concat({ - sortBy: 'popularity' - })).then(results => { - t.equal(results.length, 4, 'returns more results if endpoint does so') - }) -}) - -test('sortBy: maintenance', t => { - const query = qs.stringify({ - text: 'oo', - size: 20, - from: 0, - quality: 0, - popularity: 0, - maintenance: 1 - }) - tnock(t, REG).get(`/-/v1/search?${query}`).once().reply(200, { - objects: [ - { package: { name: 'cool', version: '1.0.0' } }, - { package: { name: 'cool', version: '1.0.0' } }, - { package: { name: 'cool', version: '1.0.0' } }, - { package: { name: 'cool', version: '1.0.0' } } - ] - }) - return search('oo', OPTS.concat({ - sortBy: 'maintenance' - })).then(results => { - t.equal(results.length, 4, 'returns more results if endpoint does so') - }) -}) - -test('sortBy: optimal', t => { - const query = qs.stringify({ - text: 'oo', - size: 20, - from: 0, - quality: 0.65, - popularity: 0.98, - maintenance: 0.5 - }) - tnock(t, REG).get(`/-/v1/search?${query}`).once().reply(200, { - objects: [ - { package: { name: 'cool', version: '1.0.0' } }, - { package: { name: 'cool', version: '1.0.0' } }, - { package: { name: 'cool', version: '1.0.0' } }, - { package: { name: 'cool', version: '1.0.0' } } - ] - }) - return search('oo', OPTS.concat({ - sortBy: 'optimal' - })).then(results => { - t.equal(results.length, 4, 'returns more results if endpoint does so') - }) -}) - -test('detailed format', t => { - const query = qs.stringify({ - text: 'oo', - size: 20, - from: 0, - quality: 0, - popularity: 0, - maintenance: 1 - }) - const results = [ - { - package: { name: 'cool', version: '1.0.0' }, - score: { - final: 0.9237841281241451, - detail: { - quality: 0.9270640902288084, - popularity: 0.8484861649808381, - maintenance: 0.9962706951777409 - } - }, - searchScore: 100000.914 - }, - { - package: { name: 'ok', version: '2.0.0' }, - score: { - final: 0.9237841281451, - detail: { - quality: 0.9270602288084, - popularity: 0.8461649808381, - maintenance: 0.9706951777409 - } - }, - searchScore: 1000.91 - } - ] - tnock(t, REG).get(`/-/v1/search?${query}`).once().reply(200, { - objects: results - }) - return search('oo', OPTS.concat({ - sortBy: 'maintenance', - detailed: true - })).then(res => { - t.deepEqual(res, results, 'return full-format results with opts.detailed') - }) -}) - -test('space-separates and URI-encodes multiple search params', t => { - const query = qs.stringify({ - text: 'foo bar:baz quux?=', - size: 1, - from: 0, - quality: 1, - popularity: 2, - maintenance: 3 - }) - tnock(t, REG).get(`/-/v1/search?${query}`).reply(200, { objects: [] }) - return search(['foo', 'bar:baz', 'quux?='], OPTS.concat({ - limit: 1, - quality: 1, - popularity: 2, - maintenance: 3 - })).then( - () => t.ok(true, 'sent parameters correctly urlencoded') - ) -}) diff --git a/deps/npm/node_modules/libnpmsearch/test/util/tnock.js b/deps/npm/node_modules/libnpmsearch/test/util/tnock.js deleted file mode 100644 index 00b6e160e10192..00000000000000 --- a/deps/npm/node_modules/libnpmsearch/test/util/tnock.js +++ /dev/null @@ -1,12 +0,0 @@ -'use strict' - -const nock = require('nock') - -module.exports = tnock -function tnock (t, host) { - const server = nock(host) - t.tearDown(function () { - server.done() - }) - return server -} diff --git a/deps/npm/node_modules/libnpmteam/.travis.yml b/deps/npm/node_modules/libnpmteam/.travis.yml deleted file mode 100644 index db5ea8b0186403..00000000000000 --- a/deps/npm/node_modules/libnpmteam/.travis.yml +++ /dev/null @@ -1,7 +0,0 @@ -language: node_js -sudo: false -node_js: - - "10" - - "9" - - "8" - - "6" diff --git a/deps/npm/node_modules/libnpmteam/CHANGELOG.md b/deps/npm/node_modules/libnpmteam/CHANGELOG.md index c5a8630a911648..ba472cfcc52ba3 100644 --- a/deps/npm/node_modules/libnpmteam/CHANGELOG.md +++ b/deps/npm/node_modules/libnpmteam/CHANGELOG.md @@ -1,5 +1,17 @@ # Change Log +## [2.0.0](https://github.com/npm/libnpmteam/compare/v1.0.2...v2.0.0) (2020-03-02) + +### BREAKING CHANGE +- Removed `figgy-pudding` as a dependecy +- Using native promises +- Require node >= v10 + +### Feature +- Updated stream interface to `minipass` type stream + +--- + 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. diff --git a/deps/npm/node_modules/libnpmteam/PULL_REQUEST_TEMPLATE b/deps/npm/node_modules/libnpmteam/PULL_REQUEST_TEMPLATE deleted file mode 100644 index 9471c6d325f7eb..00000000000000 --- a/deps/npm/node_modules/libnpmteam/PULL_REQUEST_TEMPLATE +++ /dev/null @@ -1,7 +0,0 @@ - diff --git a/deps/npm/node_modules/libnpmteam/README.md b/deps/npm/node_modules/libnpmteam/README.md index e0e771c7fac86c..bb2700292dc8aa 100644 --- a/deps/npm/node_modules/libnpmteam/README.md +++ b/deps/npm/node_modules/libnpmteam/README.md @@ -1,4 +1,9 @@ -# libnpmteam [![npm version](https://img.shields.io/npm/v/libnpmteam.svg)](https://npm.im/libnpmteam) [![license](https://img.shields.io/npm/l/libnpmteam.svg)](https://npm.im/libnpmteam) [![Travis](https://img.shields.io/travis/npm/libnpmteam/latest.svg)](https://travis-ci.org/npm/libnpmteam) [![AppVeyor](https://img.shields.io/appveyor/ci/zkat/libnpmteam/latest.svg)](https://ci.appveyor.com/project/zkat/libnpmteam) [![Coverage Status](https://coveralls.io/repos/github/npm/libnpmteam/badge.svg?branch=latest)](https://coveralls.io/github/npm/libnpmteam?branch=latest) +# libnpmteam + +[![npm version](https://img.shields.io/npm/v/libnpmteam.svg)](https://npm.im/libnpmteam) +[![license](https://img.shields.io/npm/l/libnpmteam.svg)](https://npm.im/libnpmteam) +[![GitHub Actions](https://github.com/npm/libnpmteam/workflows/Node%20CI/badge.svg)](https://github.com/npm/libnpmteam/workflows/Node%20CI/badge.svg) +[![Coverage Status](https://coveralls.io/repos/github/npm/libnpmteam/badge.svg?branch=latest)](https://coveralls.io/github/npm/libnpmteam?branch=latest) [`libnpmteam`](https://github.com/npm/libnpmteam) is a Node.js library that provides programmatic access to the guts of the npm CLI's `npm @@ -13,11 +18,26 @@ const access = require('libnpmteam') console.log(await team.lsTeams('npm')) ``` +## Publishing +1. Manually create CHANGELOG.md file +1. Commit changes to CHANGELOG.md + ```bash + $ git commit -m "chore: updated CHANGELOG.md" + ``` +1. Run `npm version {newVersion}` + ```bash + # Example + $ npm version patch + # 1. Runs `coverage` and `lint` scripts + # 2. Bumps package version; and **create commit/tag** + # 3. Runs `npm publish`; publishing directory with **unpushed commit** + # 4. Runs `git push origin --follow-tags` + ``` + ## Table of Contents * [Installing](#install) * [Example](#example) -* [Contributing](#contributing) * [API](#api) * [team opts](#opts) * [`create()`](#create) @@ -33,21 +53,6 @@ console.log(await team.lsTeams('npm')) `$ npm install libnpmteam` -### Contributing - -The npm team enthusiastically welcomes contributions and project participation! -There's a bunch of things you can do if you want to contribute! The [Contributor -Guide](CONTRIBUTING.md) has all the information you need for everything from -reporting bugs to contributing entire new features. Please don't hesitate to -jump in if you'd like to, or even ask us questions if something isn't clear. - -All participants and maintainers in this project are expected to follow [Code of -Conduct](CODE_OF_CONDUCT.md), and just generally be excellent to each other. - -Please refer to the [Changelog](CHANGELOG.md) for project history details, too. - -Happy hacking! - ### API #### `opts` for `libnpmteam` commands @@ -62,7 +67,6 @@ A couple of options of note for those in a hurry: * `opts.token` - can be passed in and will be used as the authentication token for the registry. For other ways to pass in auth details, see the n-r-f docs. * `opts.otp` - certain operations will require an OTP token to be passed in. If a `libnpmteam` command fails with `err.code === EOTP`, please retry the request with `{otp: <2fa token>}` -* `opts.Promise` - If you pass this in, the Promises returned by `libnpmteam` commands will use this Promise class instead. For example: `{Promise: require('bluebird')}` #### `> team.create(team, [opts]) -> Promise` diff --git a/deps/npm/node_modules/libnpmteam/appveyor.yml b/deps/npm/node_modules/libnpmteam/appveyor.yml deleted file mode 100644 index 9cc64c58e02f96..00000000000000 --- a/deps/npm/node_modules/libnpmteam/appveyor.yml +++ /dev/null @@ -1,22 +0,0 @@ -environment: - matrix: - - nodejs_version: "10" - - nodejs_version: "9" - - nodejs_version: "8" - - nodejs_version: "6" - -platform: - - x64 - -install: - - ps: Install-Product node $env:nodejs_version $env:platform - - npm config set spin false - - npm install - -test_script: - - npm test - -matrix: - fast_finish: true - -build: off diff --git a/deps/npm/node_modules/libnpmteam/index.js b/deps/npm/node_modules/libnpmteam/index.js index 3d9c906791c87e..8b6040113d5b1f 100644 --- a/deps/npm/node_modules/libnpmteam/index.js +++ b/deps/npm/node_modules/libnpmteam/index.js @@ -1,93 +1,81 @@ 'use strict' const eu = encodeURIComponent -const figgyPudding = require('figgy-pudding') -const getStream = require('get-stream') const npmFetch = require('npm-registry-fetch') const validate = require('aproba') -const TeamConfig = figgyPudding({ - description: {}, - Promise: { default: () => Promise } -}) +const cmd = module.exports -const cmd = module.exports = {} - -cmd.create = (entity, opts) => { - opts = TeamConfig(opts) - return pwrap(opts, () => { +cmd.create = (entity, opts = {}) => { + return Promise.resolve().then(() => { const { scope, team } = splitEntity(entity) validate('SSO', [scope, team, opts]) - return npmFetch.json(`/-/org/${eu(scope)}/team`, opts.concat({ + const uri = `/-/org/${eu(scope)}/team` + return npmFetch.json(uri, { + ...opts, method: 'PUT', scope, body: { name: team, description: opts.description } - })) + }) }) } -cmd.destroy = (entity, opts) => { - opts = TeamConfig(opts) - return pwrap(opts, () => { - const { scope, team } = splitEntity(entity) - validate('SSO', [scope, team, opts]) - return npmFetch.json(`/-/team/${eu(scope)}/${eu(team)}`, opts.concat({ - method: 'DELETE', - scope - })) +cmd.destroy = (entity, opts = {}) => { + const { scope, team } = splitEntity(entity) + validate('SSO', [scope, team, opts]) + const uri = `/-/team/${eu(scope)}/${eu(team)}` + return npmFetch.json(uri, { + ...opts, + method: 'DELETE', + scope }) } -cmd.add = (user, entity, opts) => { - opts = TeamConfig(opts) - return pwrap(opts, () => { - const { scope, team } = splitEntity(entity) - validate('SSO', [scope, team, opts]) - return npmFetch.json(`/-/team/${eu(scope)}/${eu(team)}/user`, opts.concat({ - method: 'PUT', - scope, - body: { user } - })) +cmd.add = (user, entity, opts = {}) => { + const { scope, team } = splitEntity(entity) + validate('SSO', [scope, team, opts]) + const uri = `/-/team/${eu(scope)}/${eu(team)}/user` + return npmFetch.json(uri, { + ...opts, + method: 'PUT', + scope, + body: { user } }) } -cmd.rm = (user, entity, opts) => { - opts = TeamConfig(opts) - return pwrap(opts, () => { - const { scope, team } = splitEntity(entity) - validate('SSO', [scope, team, opts]) - return npmFetch.json(`/-/team/${eu(scope)}/${eu(team)}/user`, opts.concat({ - method: 'DELETE', - scope, - body: { user } - })) +cmd.rm = (user, entity, opts = {}) => { + const { scope, team } = splitEntity(entity) + validate('SSO', [scope, team, opts]) + const uri = `/-/team/${eu(scope)}/${eu(team)}/user` + return npmFetch.json(uri, { + ...opts, + method: 'DELETE', + scope, + body: { user } }) } -cmd.lsTeams = (scope, opts) => { - opts = TeamConfig(opts) - return pwrap(opts, () => getStream.array(cmd.lsTeams.stream(scope, opts))) -} -cmd.lsTeams.stream = (scope, opts) => { - opts = TeamConfig(opts) +cmd.lsTeams = (...args) => cmd.lsTeams.stream(...args).collect() + +cmd.lsTeams.stream = (scope, opts = {}) => { validate('SO', [scope, opts]) - return npmFetch.json.stream(`/-/org/${eu(scope)}/team`, '.*', opts.concat({ + const uri = `/-/org/${eu(scope)}/team` + return npmFetch.json.stream(uri, '.*', { + ...opts, query: { format: 'cli' } - })) + }) } -cmd.lsUsers = (entity, opts) => { - opts = TeamConfig(opts) - return pwrap(opts, () => getStream.array(cmd.lsUsers.stream(entity, opts))) -} -cmd.lsUsers.stream = (entity, opts) => { - opts = TeamConfig(opts) +cmd.lsUsers = (...args) => cmd.lsUsers.stream(...args).collect() + +cmd.lsUsers.stream = (entity, opts = {}) => { const { scope, team } = splitEntity(entity) validate('SSO', [scope, team, opts]) const uri = `/-/team/${eu(scope)}/${eu(team)}/user` - return npmFetch.json.stream(uri, '.*', opts.concat({ + return npmFetch.json.stream(uri, '.*', { + ...opts, query: { format: 'cli' } - })) + }) } cmd.edit = () => { @@ -95,12 +83,6 @@ cmd.edit = () => { } function splitEntity (entity = '') { - let [, scope, team] = entity.match(/^@?([^:]+):(.*)$/) || [] + const [, scope, team] = entity.match(/^@?([^:]+):(.*)$/) || [] return { scope, team } } - -function pwrap (opts, fn) { - return new opts.Promise((resolve, reject) => { - fn().then(resolve, reject) - }) -} diff --git a/deps/npm/node_modules/libnpmteam/package.json b/deps/npm/node_modules/libnpmteam/package.json index 47bcedb8dc676c..1834be77732efc 100644 --- a/deps/npm/node_modules/libnpmteam/package.json +++ b/deps/npm/node_modules/libnpmteam/package.json @@ -1,67 +1,38 @@ { - "_from": "libnpmteam@1.0.2", - "_id": "libnpmteam@1.0.2", - "_inBundle": false, - "_integrity": "sha512-p420vM28Us04NAcg1rzgGW63LMM6rwe+6rtZpfDxCcXxM0zUTLl7nPFEnRF3JfFBF5skF/yuZDUthTsHgde8QA==", - "_location": "/libnpmteam", - "_phantomChildren": {}, - "_requested": { - "type": "version", - "registry": true, - "raw": "libnpmteam@1.0.2", - "name": "libnpmteam", - "escapedName": "libnpmteam", - "rawSpec": "1.0.2", - "saveSpec": null, - "fetchSpec": "1.0.2" - }, - "_requiredBy": [ - "#USER", - "/" - ], - "_resolved": "https://registry.npmjs.org/libnpmteam/-/libnpmteam-1.0.2.tgz", - "_shasum": "8b48bcbb6ce70dd8150c950fcbdbf3feb6eec820", - "_spec": "libnpmteam@1.0.2", - "_where": "/Users/isaacs/dev/npm/cli", - "author": { - "name": "Kat Marchán", - "email": "kzm@zkat.tech" - }, - "bugs": { - "url": "https://github.com/npm/libnpmteam/issues" - }, - "bundleDependencies": false, - "dependencies": { - "aproba": "^2.0.0", - "figgy-pudding": "^3.4.1", - "get-stream": "^4.0.0", - "npm-registry-fetch": "^4.0.0" - }, - "deprecated": false, + "name": "libnpmteam", "description": "npm Team management APIs", + "version": "2.0.1", + "author": "Kat Marchán ", + "license": "ISC", + "scripts": { + "preversion": "npm test", + "postversion": "npm publish", + "prepublishOnly": "git push origin --follow-tags", + "lint": "standard", + "test": "tap", + "posttest": "npm run lint" + }, "devDependencies": { - "nock": "^9.6.1", - "standard": "^12.0.0", - "standard-version": "*", - "tap": "*", - "weallbehave": "*", - "weallcontribute": "*" + "nock": "^12.0.1", + "standard": "^14.3.1", + "tap": "^14.10.6" }, - "homepage": "https://npmjs.com/package/libnpmteam", - "license": "ISC", - "name": "libnpmteam", "repository": { "type": "git", - "url": "git+https://github.com/npm/libnpmteam.git" + "url": "https://github.com/npm/libnpmteam.git" }, - "scripts": { - "postrelease": "npm publish && git push --follow-tags", - "prerelease": "npm t", - "pretest": "standard", - "release": "standard-version -s", - "test": "tap -J --100 test/*.js", - "update-coc": "weallbehave -o . && git add CODE_OF_CONDUCT.md && git commit -m 'docs(coc): updated CODE_OF_CONDUCT.md'", - "update-contrib": "weallcontribute -o . && git add CONTRIBUTING.md && git commit -m 'docs(contributing): updated CONTRIBUTING.md'" + "files": [ + "index.js" + ], + "homepage": "https://npmjs.com/package/libnpmteam", + "dependencies": { + "aproba": "^2.0.0", + "npm-registry-fetch": "^8.0.0" + }, + "engines": { + "node": ">=10" }, - "version": "1.0.2" + "tap": { + "check-coverage": true + } } diff --git a/deps/npm/node_modules/libnpmteam/test/index.js b/deps/npm/node_modules/libnpmteam/test/index.js deleted file mode 100644 index 7bc79d51812235..00000000000000 --- a/deps/npm/node_modules/libnpmteam/test/index.js +++ /dev/null @@ -1,138 +0,0 @@ -'use strict' - -const figgyPudding = require('figgy-pudding') -const getStream = require('get-stream') -const { test } = require('tap') -const tnock = require('./util/tnock.js') - -const team = require('../index.js') - -const REG = 'http://localhost:1337' -const OPTS = figgyPudding({})({ - registry: REG -}) - -test('create', t => { - tnock(t, REG).put( - '/-/org/foo/team', { name: 'cli' } - ).reply(201, { name: 'cli' }) - return team.create('@foo:cli', OPTS).then(ret => { - t.deepEqual(ret, { name: 'cli' }, 'request succeeded') - }) -}) - -test('create bad entity name', t => { - return team.create('go away', OPTS).then( - () => { throw new Error('should not succeed') }, - err => { t.ok(err, 'error on bad entity name') } - ) -}) - -test('create empty entity', t => { - return team.create(undefined, OPTS).then( - () => { throw new Error('should not succeed') }, - err => { t.ok(err, 'error on bad entity name') } - ) -}) - -test('create w/ description', t => { - tnock(t, REG).put('/-/org/foo/team', { - name: 'cli', - description: 'just some cool folx' - }).reply(201, { name: 'cli' }) - return team.create('@foo:cli', OPTS.concat({ - description: 'just some cool folx' - })).then(ret => { - t.deepEqual(ret, { name: 'cli' }, 'no desc in return') - }) -}) - -test('destroy', t => { - tnock(t, REG).delete( - '/-/team/foo/cli' - ).reply(204, {}) - return team.destroy('@foo:cli', OPTS).then(ret => { - t.deepEqual(ret, {}, 'request succeeded') - }) -}) - -test('add', t => { - tnock(t, REG).put( - '/-/team/foo/cli/user', { user: 'zkat' } - ).reply(201, {}) - return team.add('zkat', '@foo:cli', OPTS).then(ret => { - t.deepEqual(ret, {}, 'request succeeded') - }) -}) - -test('rm', t => { - tnock(t, REG).delete( - '/-/team/foo/cli/user', { user: 'zkat' } - ).reply(204, {}) - return team.rm('zkat', '@foo:cli', OPTS).then(ret => { - t.deepEqual(ret, {}, 'request succeeded') - }) -}) - -test('lsTeams', t => { - tnock(t, REG).get( - '/-/org/foo/team?format=cli' - ).reply(200, ['foo:bar', 'foo:cli']) - return team.lsTeams('foo', OPTS).then(ret => { - t.deepEqual(ret, ['foo:bar', 'foo:cli'], 'got teams') - }) -}) - -test('lsTeams error', t => { - tnock(t, REG).get( - '/-/org/foo/team?format=cli' - ).reply(500) - return team.lsTeams('foo', OPTS).then( - () => { throw new Error('should not succeed') }, - err => { t.equal(err.code, 'E500', 'got error code') } - ) -}) - -test('lsTeams.stream', t => { - tnock(t, REG).get( - '/-/org/foo/team?format=cli' - ).reply(200, ['foo:bar', 'foo:cli']) - return getStream.array(team.lsTeams.stream('foo', OPTS)).then(ret => { - t.deepEqual(ret, ['foo:bar', 'foo:cli'], 'got teams') - }) -}) - -test('lsUsers', t => { - tnock(t, REG).get( - '/-/team/foo/cli/user?format=cli' - ).reply(500) - return team.lsUsers('@foo:cli', OPTS).then( - () => { throw new Error('should not succeed') }, - err => { t.equal(err.code, 'E500', 'got error code') } - ) -}) - -test('lsUsers error', t => { - tnock(t, REG).get( - '/-/team/foo/cli/user?format=cli' - ).reply(200, ['iarna', 'zkat']) - return team.lsUsers('@foo:cli', OPTS).then(ret => { - t.deepEqual(ret, ['iarna', 'zkat'], 'got team members') - }) -}) - -test('lsUsers.stream', t => { - tnock(t, REG).get( - '/-/team/foo/cli/user?format=cli' - ).reply(200, ['iarna', 'zkat']) - return getStream.array(team.lsUsers.stream('@foo:cli', OPTS)).then(ret => { - t.deepEqual(ret, ['iarna', 'zkat'], 'got team members') - }) -}) - -test('edit', t => { - t.throws(() => { - team.edit() - }, /not implemented/) - t.done() -}) diff --git a/deps/npm/node_modules/libnpmteam/test/util/tnock.js b/deps/npm/node_modules/libnpmteam/test/util/tnock.js deleted file mode 100644 index 00b6e160e10192..00000000000000 --- a/deps/npm/node_modules/libnpmteam/test/util/tnock.js +++ /dev/null @@ -1,12 +0,0 @@ -'use strict' - -const nock = require('nock') - -module.exports = tnock -function tnock (t, host) { - const server = nock(host) - t.tearDown(function () { - server.done() - }) - return server -} diff --git a/deps/npm/node_modules/libnpmversion/LICENSE b/deps/npm/node_modules/libnpmversion/LICENSE new file mode 100644 index 00000000000000..05eeeb88c2ef4c --- /dev/null +++ b/deps/npm/node_modules/libnpmversion/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/deps/npm/node_modules/libnpmversion/README.md b/deps/npm/node_modules/libnpmversion/README.md new file mode 100644 index 00000000000000..daa0b88157c6c3 --- /dev/null +++ b/deps/npm/node_modules/libnpmversion/README.md @@ -0,0 +1,154 @@ +# libnpmversion + +Library to do the things that 'npm version' does. + +## USAGE + +```js +const npmVersion = require('libnpmversion') + +// argument can be one of: +// - any semver version string (set to that exact version) +// - 'major', 'minor', 'patch', 'pre{major,minor,patch}' (increment at +// that value) +// - 'from-git' (set to the latest semver-lookin git tag - this skips +// gitTagVersion, but will still sign if asked) +npmVersion(arg, { + path: '/path/to/my/pkg', // defaults to cwd + + allowSameVersion: false, // allow tagging/etc to the current version + preid: '', // when arg=='pre', define the prerelease string, like 'beta' etc. + tagVersionPrefix: 'v', // tag as 'v1.2.3' when versioning to 1.2.3 + commitHooks: true, // default true, run git commit hooks, default true + gitTagVersion: true, // default true, tag the version + signGitCommit: false, // default false, gpg sign the git commit + signGitTag: false, // default false, gpg sign the git tag + force: false, // push forward recklessly if any problems happen + ignoreScripts: false, // do not run pre/post/version lifecycle scripts + message: 'v%s', // message for tag and commit, replace %s with the version +}).then(newVersion => { + console.error('version updated!', newVersion) +}) +``` + +## Description + +Run this in a package directory to bump the version and write the new data +back to `package.json`, `package-lock.json`, and, if present, +`npm-shrinkwrap.json`. + +The `newversion` argument should be a valid semver string, a valid second +argument to [semver.inc](https://github.com/npm/node-semver#functions) (one +of `patch`, `minor`, `major`, `prepatch`, `preminor`, `premajor`, +`prerelease`), or `from-git`. In the second case, the existing version will +be incremented by 1 in the specified field. `from-git` will try to read +the latest git tag, and use that as the new npm version. + +If run in a git repo, it will also create a version commit and tag. This +behavior is controlled by `gitTagVersion` (see below), and can be +disabled by setting `gitTagVersion: false` in the options. +It will fail if the working directory is not clean, unless `force: true` is +set. + +If supplied with a `message` string option, it will +use it as a commit message when creating a version commit. If the +`message` option contains `%s` then that will be replaced with the +resulting version number. + +If the `signGitTag` option is set, then the tag will be signed using +the `-s` flag to git. Note that you must have a default GPG key set up in +your git config for this to work properly. + +If `preversion`, `version`, or `postversion` are in the `scripts` property +of the package.json, they will be executed in the appropriate sequence. + +The exact order of execution is as follows: + +1. Check to make sure the git working directory is clean before we get + started. Your scripts may add files to the commit in future steps. + This step is skipped if the `force` flag is set. +2. Run the `preversion` script. These scripts have access to the old + `version` in package.json. A typical use would be running your full + test suite before deploying. Any files you want added to the commit + should be explicitly added using `git add`. +3. Bump `version` in `package.json` as requested (`patch`, `minor`, + `major`, explicit version number, etc). +4. Run the `version` script. These scripts have access to the new `version` + in package.json (so they can incorporate it into file headers in + generated files for example). Again, scripts should explicitly add + generated files to the commit using `git add`. +5. Commit and tag. +6. Run the `postversion` script. Use it to clean up the file system or + automatically push the commit and/or tag. + +Take the following example: + +```json +{ + "scripts": { + "preversion": "npm test", + "version": "npm run build && git add -A dist", + "postversion": "git push && git push --tags && rm -rf build/temp" + } +} +``` + +This runs all your tests, and proceeds only if they pass. Then runs your +`build` script, and adds everything in the `dist` directory to the commit. +After the commit, it pushes the new commit and tag up to the server, and +deletes the `build/temp` directory. + +## API + +### `npmVersion(newversion, options = {}) -> Promise` + +Do the things. Returns a promise that resolves to the new version if +all is well, or rejects if any errors are encountered. + +### Options + +#### `path` String + +The path to the package being versionified. Defaults to process.cwd(). + +#### `allowSameVersion` Boolean + +Allow setting the version to the current version in package.json. Default +`false`. + +#### `preid` String +When the `newversion` is pre, premajor, preminor, or prepatch, this +defines the prerelease string, like 'beta' etc. + +#### `tagVersionPrefix` String + +The prefix to add to the raw semver string for the tag name. Defaults to +`'v'`. (So, by default it tags as 'v1.2.3' when versioning to 1.2.3.) + +#### `commitHooks` Boolean + +Run git commit hooks. Default true. + +#### `gitTagVersion` Boolean + +Tag the version, default true. + +#### `signGitCommit` Boolean + +GPG sign the git commit. Default `false`. + +#### `signGitTag` Boolean + +GPG sign the git tag. Default `false`. + +#### `force` Boolean + +Push forward recklessly if any problems happen. Default `false`. + +#### `ignoreScripts` Boolean + +Do not run pre/post/version lifecycle scripts. Default `false`. + +#### `message` String + +The message for the git commit and annotated git tag that are created. diff --git a/deps/npm/node_modules/libnpmversion/lib/commit.js b/deps/npm/node_modules/libnpmversion/lib/commit.js new file mode 100644 index 00000000000000..bd621acb4393de --- /dev/null +++ b/deps/npm/node_modules/libnpmversion/lib/commit.js @@ -0,0 +1,14 @@ +const git = require('@npmcli/git') + +module.exports = (version, opts) => { + const {commitHooks, allowSameVersion, signGitCommit, message} = opts + const args = ['commit'] + if (commitHooks === false) + args.push('-n') + if (allowSameVersion) + args.push('--allow-empty') + if (signGitCommit) + args.push('-S') + args.push('-m') + return git.spawn([...args, message.replace(/%s/g, version)], opts) +} diff --git a/deps/npm/node_modules/libnpmversion/lib/enforce-clean.js b/deps/npm/node_modules/libnpmversion/lib/enforce-clean.js new file mode 100644 index 00000000000000..980419ffb43d87 --- /dev/null +++ b/deps/npm/node_modules/libnpmversion/lib/enforce-clean.js @@ -0,0 +1,32 @@ +const git = require('@npmcli/git') + +// returns true if it's cool to do git stuff +// throws if it's unclean, and not forced. +module.exports = async opts => { + const { force, log } = opts + let hadError = false + const clean = await git.isClean(opts).catch(er => { + if (er.code === 'ENOGIT') { + log.warn( + 'version', + 'This is a Git checkout, but the git command was not found.', + 'npm could not create a Git tag for this release!' + ) + hadError = true + // how can merges be real if our git isn't real? + return true + } else + throw er + }) + + if (!clean) { + if (!force) + throw new Error('Git working directory not clean.') + log.warn( + 'version', + 'Git working directory not clean, proceeding forcefully.' + ) + } + + return !hadError +} diff --git a/deps/npm/node_modules/libnpmversion/lib/index.js b/deps/npm/node_modules/libnpmversion/lib/index.js new file mode 100644 index 00000000000000..525d8264e737a8 --- /dev/null +++ b/deps/npm/node_modules/libnpmversion/lib/index.js @@ -0,0 +1,39 @@ +const readJson = require('read-package-json-fast') +const version = require('./version.js') +const proclog = require('./proc-log.js') + +module.exports = async (newversion, opts = {}) => { + const { + path = process.cwd(), + allowSameVersion = false, + tagVersionPrefix = 'v', + commitHooks = true, + gitTagVersion = true, + signGitCommit = false, + signGitTag = false, + force = false, + ignoreScripts = false, + preid = null, + log = proclog, + message = 'v%s', + } = opts + + const pkg = opts.pkg || await readJson(path + '/package.json') + + return version(newversion, { + path, + cwd: path, + allowSameVersion, + tagVersionPrefix, + commitHooks, + gitTagVersion, + signGitCommit, + signGitTag, + force, + ignoreScripts, + preid, + pkg, + log, + message, + }) +} diff --git a/deps/npm/node_modules/libnpmversion/lib/proc-log.js b/deps/npm/node_modules/libnpmversion/lib/proc-log.js new file mode 100644 index 00000000000000..b2bdd9dc90205c --- /dev/null +++ b/deps/npm/node_modules/libnpmversion/lib/proc-log.js @@ -0,0 +1,21 @@ +// default logger. +// emits 'log' events on the process +const LEVELS = [ + 'notice', + 'error', + 'warn', + 'info', + 'verbose', + 'http', + 'silly', + 'pause', + 'resume' +] + +const log = level => (...args) => process.emit('log', level, ...args) + +const logger = {} +for (const level of LEVELS) { + logger[level] = log(level) +} +module.exports = logger diff --git a/deps/npm/node_modules/libnpmversion/lib/retrieve-tag.js b/deps/npm/node_modules/libnpmversion/lib/retrieve-tag.js new file mode 100644 index 00000000000000..b657561b861e76 --- /dev/null +++ b/deps/npm/node_modules/libnpmversion/lib/retrieve-tag.js @@ -0,0 +1,11 @@ +const {spawn} = require('@npmcli/git') +const semver = require('semver') + +module.exports = async opts => { + const tag = (await spawn(['describe', '--abbrev=0'], opts)).stdout.trim() + const match = tag.match(/v?(\d+\.\d+\.\d+(?:[-+].+)?)/) + const ver = match && semver.clean(match[1], { loose: true }) + if (ver) + return ver + throw new Error(`Tag is not a valid version: ${JSON.stringify(tag)}`) +} diff --git a/deps/npm/node_modules/libnpmversion/lib/tag.js b/deps/npm/node_modules/libnpmversion/lib/tag.js new file mode 100644 index 00000000000000..bd6c803a384998 --- /dev/null +++ b/deps/npm/node_modules/libnpmversion/lib/tag.js @@ -0,0 +1,20 @@ +const git = require('@npmcli/git') + +module.exports = async (version, opts) => { + const { signGitTag, allowSameVersion, tagVersionPrefix, message } = opts + const tag = `${tagVersionPrefix}${version}` + + const flags = ['-'] + if (signGitTag) + flags.push('s') + if (allowSameVersion) + flags.push('f') + flags.push('m') + + return git.spawn([ + 'tag', + flags.join(''), + message.replace(/%s/g, version), + tag, + ], opts) +} diff --git a/deps/npm/node_modules/libnpmversion/lib/version.js b/deps/npm/node_modules/libnpmversion/lib/version.js new file mode 100644 index 00000000000000..28ba039a0522ff --- /dev/null +++ b/deps/npm/node_modules/libnpmversion/lib/version.js @@ -0,0 +1,116 @@ +// called with all the options already set to their defaults + +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 git = require('@npmcli/git') +const commit = require('./commit.js') +const tag = require('./tag.js') + +const runScript = require('@npmcli/run-script') +const runner = opts => event => runScript({ + ...opts, + stdio: 'inherit', + event, +}) + +module.exports = async (newversion, opts) => { + const { + path, + allowSameVersion, + tagVersionPrefix, + commitHooks, + gitTagVersion, + signGitCommit, + signGitTag, + force, + ignoreScripts, + preid, + pkg, + log, + message, + } = opts + + const { valid, clean, inc } = semver + const current = pkg.version + const currentClean = clean(current) + + const newV = valid(newversion, { loose: true }) ? clean(newversion, { loose: true }) + : newversion === 'from-git' ? await retrieveTag(opts) + : inc(currentClean, newversion, { loose: true }, preid) + + if (!newV) { + throw Object.assign(new Error('Invalid version: ' + newversion), { + current, + requested: newversion, + }) + } + + if (newV === currentClean && !allowSameVersion) { + throw Object.assign(new Error('Version not changed'), { + current, + requested: newversion, + newVersion: newV, + }) + } + + const isGitDir = newversion === 'from-git' || await git.is(opts) + + // ok! now we know the new version, and the old version is in pkg + + // - check if git dir is clean + // returns false if we should not keep doing git stuff + const doGit = isGitDir && await enforceClean(opts) + + const runScript = ignoreScripts ? () => {} : runner({ + ...opts, + pkg, + env: { + npm_old_version: current, + npm_new_version: newV, + }, + }) + + + await runScript('preversion') + + // - update the files + pkg.version = newV + delete pkg._id + await writeJson(`${path}/package.json`, pkg) + + // try to update shrinkwrap, but ok if this fails + const locks = [`${path}/package-lock.json`, `${path}/npm-shrinkwrap.json`] + const haveLocks = [] + for (const lock of locks) { + try { + const sw = await readJson(lock) + sw.version = newV + if (sw.packages && sw.packages['']) { + sw.packages[''].version = newV + } + await writeJson(lock, sw) + haveLocks.push(lock) + } catch (er) {} + } + + await runScript('version') + + if (doGit) { + // - git add, git commit, git tag + await git.spawn(['add', `${path}/package.json`], opts) + // sometimes people .gitignore their lockfiles + for (const lock of haveLocks) { + await git.spawn(['add', lock], opts).catch(() => {}) + } + await commit(newV, opts) + await tag(newV, opts) + } else + log.verbose('version', 'Not tagging: not in a git repo or no git cmd') + + await runScript('postversion') + + return newV +} diff --git a/deps/npm/node_modules/libnpmversion/lib/write-json.js b/deps/npm/node_modules/libnpmversion/lib/write-json.js new file mode 100644 index 00000000000000..30ca1af0f19edc --- /dev/null +++ b/deps/npm/node_modules/libnpmversion/lib/write-json.js @@ -0,0 +1,16 @@ +// write the json back, preserving the line breaks and indent +const {promisify} = require('util') +const writeFile = promisify(require('fs').writeFile) +const kIndent = Symbol.for('indent') +const kNewline = Symbol.for('newline') + +module.exports = async (path, pkg) => { + const { + [kIndent]: indent = 2, + [kNewline]: newline = '\n', + } = pkg + delete pkg._id + const raw = JSON.stringify(pkg, null, indent) + '\n' + const data = newline === '\n' ? raw : raw.split('\n').join(newline) + return writeFile(path, data) +} diff --git a/deps/npm/node_modules/libnpmversion/package.json b/deps/npm/node_modules/libnpmversion/package.json new file mode 100644 index 00000000000000..c42801a8e9b167 --- /dev/null +++ b/deps/npm/node_modules/libnpmversion/package.json @@ -0,0 +1,37 @@ +{ + "name": "libnpmversion", + "version": "1.0.5", + "main": "lib/index.js", + "files": [ + "lib/*.js" + ], + "description": "library to do the things that 'npm version' does", + "repository": { + "type": "git", + "url": "git+https://github.com/npm/libnpmversion" + }, + "author": "Isaac Z. Schlueter (https://izs.me)", + "license": "ISC", + "scripts": { + "test": "tap", + "snap": "tap", + "preversion": "npm test", + "postversion": "npm publish", + "prepublishOnly": "git push origin --follow-tags" + }, + "tap": { + "coverage-map": "map.js", + "check-coverage": true + }, + "devDependencies": { + "require-inject": "^1.4.4", + "tap": "^14.10.6" + }, + "dependencies": { + "@npmcli/git": "^2.0.1", + "@npmcli/run-script": "^1.2.1", + "read-package-json-fast": "^1.2.1", + "semver": "^7.1.3", + "stringify-package": "^1.0.1" + } +} diff --git a/deps/npm/node_modules/libnpx/CHANGELOG.md b/deps/npm/node_modules/libnpx/CHANGELOG.md deleted file mode 100644 index d8ea8b4e874116..00000000000000 --- a/deps/npm/node_modules/libnpx/CHANGELOG.md +++ /dev/null @@ -1,825 +0,0 @@ -# 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. - - -## [10.2.4](https://github.com/npm/npx/compare/v10.2.3...v10.2.4) (2020-07-20) - - - - -## [10.2.3](https://github.com/npm/npx/compare/v10.2.2...v10.2.3) (2020-03-24) - - - - -## [10.2.2](https://github.com/npm/npx/compare/v10.2.1...v10.2.2) (2020-01-28) - - -### Bug Fixes - -* correct Kat's github url ([9a23db1](https://github.com/npm/npx/commit/9a23db1)) -* install latest npm on travis for node 6 ([e0eb3cb](https://github.com/npm/npx/commit/e0eb3cb)) -* Update changelog to fix old issue links ([3733137](https://github.com/npm/npx/commit/3733137)) - - - - -# [10.2.0](https://github.com/npm/npx/compare/v10.1.1...v10.2.0) (2018-04-13) - - -### Bug Fixes - -* **i18n:** fix korean; 쉘 -> 셸 ([#163](https://github.com/zkat/npx/issues/163)) ([11d9fe0](https://github.com/npm/npx/commit/11d9fe0)) -* **spawn:** spawn child processes with node without relying on the shebang. ([#174](https://github.com/zkat/npx/issues/174)) ([cba97bb](https://github.com/npm/npx/commit/cba97bb)) -* **windows:** Allow spaces in the node path when using --node-arg ([#173](https://github.com/zkat/npx/issues/173)) ([fe0d48a](https://github.com/npm/npx/commit/fe0d48a)), closes [#170](https://github.com/zkat/npx/issues/170) - - -### Features - -* **i18n:** add translation ([#159](https://github.com/zkat/npx/issues/159)) ([5da008b](https://github.com/npm/npx/commit/5da008b)) - - - - -## [10.1.1](https://github.com/npm/npx/compare/v10.1.0...v10.1.1) (2018-04-12) - - - - -# [10.1.0](https://github.com/npm/npx/compare/v10.0.1...v10.1.0) (2018-04-12) - - -### Features - -* **spawn:** add --always-spawn to opt out of process takeover optimization feature ([#172](https://github.com/zkat/npx/issues/172)) ([c0d6abc](https://github.com/npm/npx/commit/c0d6abc)) - - - - -## [10.0.1](https://github.com/npm/npx/compare/v10.0.0...v10.0.1) (2018-03-08) - - -### Bug Fixes - -* **i18n:** Improve French localization ([#158](https://github.com/zkat/npx/issues/158)) ([c88823e](https://github.com/npm/npx/commit/c88823e)) -* **windows:** on Windows, throw useful error when package contains no binaries([#142](https://github.com/zkat/npx/issues/142)) ([a69276e](https://github.com/npm/npx/commit/a69276e)), closes [#137](https://github.com/zkat/npx/issues/137) - - - - -# [10.0.0](https://github.com/npm/npx/compare/v9.7.1...v10.0.0) (2018-03-08) - - -### Bug Fixes - -* **i18n:** Fix Korean locale ([#130](https://github.com/zkat/npx/issues/130)) ([752db48](https://github.com/npm/npx/commit/752db48)) -* **index:** remove extraneous logging on Windows ([#136](https://github.com/zkat/npx/issues/136)) ([357e6ab](https://github.com/npm/npx/commit/357e6ab)), closes [#131](https://github.com/zkat/npx/issues/131) -* **license:** change npx license to ISC ([a617d7b](https://github.com/npm/npx/commit/a617d7b)) -* **parse-args:** fix version thing for yargs ([30677ed](https://github.com/npm/npx/commit/30677ed)) -* **prefix:** Handle node_modules without package.json ([#128](https://github.com/zkat/npx/issues/128)) ([f64ae43](https://github.com/npm/npx/commit/f64ae43)), closes [/github.com/babel/babel/issues/4066#issuecomment-336705199](https://github.com//github.com/babel/babel/issues/4066/issues/issuecomment-336705199) -* **standard:** get things in line with standard 11 ([6cf8e88](https://github.com/npm/npx/commit/6cf8e88)) - - -### BREAKING CHANGES - -* **license:** This moves the code over from CC0-1.0 to the ISC license. - - - - -## [9.7.1](https://github.com/npm/npx/compare/v9.7.0...v9.7.1) (2017-10-19) - - -### Bug Fixes - -* **main:** err... oops? ([f24b4e3](https://github.com/npm/npx/commit/f24b4e3)) - - - - -# [9.7.0](https://github.com/npm/npx/compare/v9.6.0...v9.7.0) (2017-10-19) - - -### Bug Fixes - -* **exec:** fixed unix binary pathing issues (#120) ([f80a970](https://github.com/npm/npx/commit/f80a970)), closes [#120](https://github.com/zkat/npx/issues/120) - - -### Features - -* **child:** add opts.installerStdio (#126) ([ade03f7](https://github.com/npm/npx/commit/ade03f7)) - - - - -# [9.6.0](https://github.com/npm/npx/compare/v9.5.0...v9.6.0) (2017-08-17) - - -### Features - -* **i18n:** add Arabic translation (#111) ([3c5b99a](https://github.com/npm/npx/commit/3c5b99a)) -* **i18n:** add Dutch (#108) ([ed116fd](https://github.com/npm/npx/commit/ed116fd)) - - - - -# [9.5.0](https://github.com/npm/npx/compare/v9.4.1...v9.5.0) (2017-07-28) - - -### Features - -* **i18n:** add Polish translations (#99) ([8442f59](https://github.com/npm/npx/commit/8442f59)) - - - - -## [9.4.1](https://github.com/npm/npx/compare/v9.4.0...v9.4.1) (2017-07-21) - - -### Bug Fixes - -* **i18n:** fix filename for uk.json locale ([2c770e4](https://github.com/npm/npx/commit/2c770e4)) - - - - -# [9.4.0](https://github.com/npm/npx/compare/v9.3.2...v9.4.0) (2017-07-21) - - -### Bug Fixes - -* **i18n:** minor fixes to ru locale (#92) ([f4d5051](https://github.com/npm/npx/commit/f4d5051)), closes [#92](https://github.com/zkat/npx/issues/92) - - -### Features - -* **i18n:** `no` locale fallback for Norwegian bokmål ⚠️ In case of weird setups ⚠️ (#91) ([74f0e4c](https://github.com/npm/npx/commit/74f0e4c)) -* **i18n:** add Bahasa Indonesia locale (#95) ([80dceeb](https://github.com/npm/npx/commit/80dceeb)) -* **i18n:** add serbian translation (#96) ([040de7a](https://github.com/npm/npx/commit/040de7a)) -* **i18n:** add Ukrainian locale (#93) ([9a3ef33](https://github.com/npm/npx/commit/9a3ef33)) -* **i18n:** Added Norwegian (bokmål and nynorsk) translations (#90) ([6c5c733](https://github.com/npm/npx/commit/6c5c733)) - - - - -## [9.3.2](https://github.com/npm/npx/compare/v9.3.1...v9.3.2) (2017-07-17) - - -### Bug Fixes - -* **exec:** detect a wider range of shebang lines for node scripts (#89) ([1841b6f](https://github.com/npm/npx/commit/1841b6f)) -* **windows:** escape spawn args because windows is picky (#87) ([314e5eb](https://github.com/npm/npx/commit/314e5eb)) -* **windows:** get magic shim detection working on Windows (#88) ([255aeeb](https://github.com/npm/npx/commit/255aeeb)) - - - - -## [9.3.1](https://github.com/npm/npx/compare/v9.3.0...v9.3.1) (2017-07-17) - - -### Bug Fixes - -* **deps:** update to npm[@5](https://github.com/5).3.0 ([2b14de2](https://github.com/npm/npx/commit/2b14de2)) - - - - -# [9.3.0](https://github.com/npm/npx/compare/v9.2.3...v9.3.0) (2017-07-17) - - -### Features - -* **i18n:** add Korean locale (#86) ([3655314](https://github.com/npm/npx/commit/3655314)) - - - - -## [9.2.3](https://github.com/npm/npx/compare/v9.2.2...v9.2.3) (2017-07-17) - - -### Bug Fixes - -* **paths:** support npm/npx paths with spaces in them ([8f3b829](https://github.com/npm/npx/commit/8f3b829)) - - - - -## [9.2.2](https://github.com/npm/npx/compare/v9.2.1...v9.2.2) (2017-07-15) - - -### Bug Fixes - -* **npm:** escape path to npm, too ([333d2ff](https://github.com/npm/npx/commit/333d2ff)) - - - - -## [9.2.1](https://github.com/npm/npx/compare/v9.2.0...v9.2.1) (2017-07-14) - - -### Bug Fixes - -* **windows:** fixed windows binary pathing issues ([761dfe9](https://github.com/npm/npx/commit/761dfe9)) - - - - -# [9.2.0](https://github.com/npm/npx/compare/v9.1.0...v9.2.0) (2017-07-14) - - -### Bug Fixes - -* **binpath:** fix calling binaries from subdirectories ([f185d0d](https://github.com/npm/npx/commit/f185d0d)) -* **i18n:** Fix typos in french locale (#78) ([f277fc7](https://github.com/npm/npx/commit/f277fc7)), closes [#78](https://github.com/zkat/npx/issues/78) - - -### Features - -* **i18n:** Add German translations (#79) ([c81e26d](https://github.com/npm/npx/commit/c81e26d)) -* **i18n:** add zh_TW translation (#80) ([98288d8](https://github.com/npm/npx/commit/98288d8)) - - - - -# [9.1.0](https://github.com/npm/npx/compare/v9.0.7...v9.1.0) (2017-07-12) - - -### Bug Fixes - -* **call:** only npm run env if package.json exists ([370f395](https://github.com/npm/npx/commit/370f395)) -* **i18n:** Fix grammar and spelling for de.json (#63) ([b14020f](https://github.com/npm/npx/commit/b14020f)), closes [#63](https://github.com/zkat/npx/issues/63) -* **i18n:** wording revisions for Brazilian Portuguese (#75) ([b5dc536](https://github.com/npm/npx/commit/b5dc536)) -* **npm:** path directly to the npm-cli.js script ([d531206](https://github.com/npm/npx/commit/d531206)) -* **rimraf:** fix rimraf.sync is not a function issue ([d2ecba3](https://github.com/npm/npx/commit/d2ecba3)) -* **windows:** get npx working well on Windows again (#69) ([6cfb8de](https://github.com/npm/npx/commit/6cfb8de)), closes [#60](https://github.com/zkat/npx/issues/60) [#58](https://github.com/zkat/npx/issues/58) [#62](https://github.com/zkat/npx/issues/62) - - -### Features - -* **i18n:** add Czech translation (#76) ([8a0b3f6](https://github.com/npm/npx/commit/8a0b3f6)) -* **i18n:** Add Turkish translation (#73) ([26e5edf](https://github.com/npm/npx/commit/26e5edf)) -* **i18n:** Added support for Italian language (#71) ([6883e75](https://github.com/npm/npx/commit/6883e75)) -* **i18n:** Fix Romanian translation (#70) ([fd6bbcf](https://github.com/npm/npx/commit/fd6bbcf)), closes [#70](https://github.com/zkat/npx/issues/70) -* **node:** add --node-arg support to pass flags to node for script binaries (#77) ([65665bd](https://github.com/npm/npx/commit/65665bd)) - - - - -## [9.0.7](https://github.com/npm/npx/compare/v9.0.6...v9.0.7) (2017-07-11) - - -### Bug Fixes - -* **i18n:** Fix some Catalan translations (#59) ([11c8a19](https://github.com/npm/npx/commit/11c8a19)), closes [#59](https://github.com/zkat/npx/issues/59) - - - - -## [9.0.6](https://github.com/npm/npx/compare/v9.0.5...v9.0.6) (2017-07-11) - - -### Bug Fixes - -* **auto-fallback:** fix syntax error in bash/zsh auto-fallback ([d8b19db](https://github.com/npm/npx/commit/d8b19db)) - - - - -## [9.0.5](https://github.com/npm/npx/compare/v9.0.4...v9.0.5) (2017-07-11) - - -### Bug Fixes - -* **npx:** something went wrong with the 9.0.4 build and bundledeps ([75fc436](https://github.com/npm/npx/commit/75fc436)) - - - - -## [9.0.4](https://github.com/npm/npx/compare/v9.0.3...v9.0.4) (2017-07-11) - - -### Bug Fixes - -* **auto-fallback:** prevent infinite loop if npx disappears ([6c24e58](https://github.com/npm/npx/commit/6c24e58)) -* **bin:** add repository and more detailed author info ([906574e](https://github.com/npm/npx/commit/906574e)) -* **bin:** pin the npx bin's dependencies ([ae62f7a](https://github.com/npm/npx/commit/ae62f7a)) -* **build:** make sure changelog and license are copied to bin ([4fbb599](https://github.com/npm/npx/commit/4fbb599)) -* **deps:** stop bundling deps in libnpx itself ([c3e56e9](https://github.com/npm/npx/commit/c3e56e9)) -* **errors:** print command not found for packages without valid binaries ([9b24359](https://github.com/npm/npx/commit/9b24359)) -* **help:** --no-install help text was contradicting itself ([9d96f5e](https://github.com/npm/npx/commit/9d96f5e)) -* **install:** prevent concurrent npx runs from clobbering each other ([6b35c91](https://github.com/npm/npx/commit/6b35c91)) -* **npx:** npx npx npx npx npx npx npx npx npx works again ([875d4cd](https://github.com/npm/npx/commit/875d4cd)) -* **updater:** dependency injection for update-notifier target ([c3027a9](https://github.com/npm/npx/commit/c3027a9)) -* **updater:** ignore some kinds of update-notifier errors ([7631bbe](https://github.com/npm/npx/commit/7631bbe)) - - - - -## [9.0.3](https://github.com/npm/npx/compare/v9.0.2...v9.0.3) (2017-07-08) - - -### Bug Fixes - -* **version:** hand version to yargs directly ([e0b5eeb](https://github.com/npm/npx/commit/e0b5eeb)) - - - - -## [9.0.2](https://github.com/npm/npx/compare/v9.0.1...v9.0.2) (2017-07-08) - - -### Bug Fixes - -* **manpage:** fix manpage for real because files syntax is weird ([9145e2a](https://github.com/npm/npx/commit/9145e2a)) - - - - -## [9.0.1](https://github.com/npm/npx/compare/v9.0.0...v9.0.1) (2017-07-08) - - -### Bug Fixes - -* **man:** make sure manpage is used in npx bin ([704b94f](https://github.com/npm/npx/commit/704b94f)) - - - - -# [9.0.0](https://github.com/npm/npx/compare/v8.1.1...v9.0.0) (2017-07-08) - - -### Features - -* **libnpx:** libify main npx codebase ([643f58e](https://github.com/npm/npx/commit/643f58e)) -* **npx:** create a new binary for standalone publishing ([da5a3b7](https://github.com/npm/npx/commit/da5a3b7)) - - -### BREAKING CHANGES - -* **libnpx:** This version of npx can no longer be used as a -standalone binary. It will be available on the registry as `libnpx`, -and a separate project will take over the role of the main `npx` binary. - - - - -## [8.1.1](https://github.com/npm/npx/compare/v8.1.0...v8.1.1) (2017-07-06) - - -### Bug Fixes - -* **deps:** bump all deps ([6ea24bf](https://github.com/npm/npx/commit/6ea24bf)) -* **npm:** bump npm to 5.1.0 for a bunch of fixes ([18e4587](https://github.com/npm/npx/commit/18e4587)) - - - - -# [8.1.0](https://github.com/npm/npx/compare/v8.0.1...v8.1.0) (2017-06-27) - - -### Bug Fixes - -* **i18n:** minor tweaks to ja.json (#46) ([1ed63c2](https://github.com/npm/npx/commit/1ed63c2)) - - -### Features - -* **i18n:** Update pt_BR.json (#51) ([d292f22](https://github.com/npm/npx/commit/d292f22)) - - - - -## [8.0.1](https://github.com/npm/npx/compare/v8.0.0...v8.0.1) (2017-06-27) - - -### Bug Fixes - -* **npm:** bump npm version for more bugfixes ([30711a8](https://github.com/npm/npx/commit/30711a8)) -* **npm:** Use --parseable option to work around output quirks ([8cb75a2](https://github.com/npm/npx/commit/8cb75a2)) - - - - -# [8.0.0](https://github.com/npm/npx/compare/v7.0.0...v8.0.0) (2017-06-24) - - -### Features - -* **exec:** auto-guess binaries when different from pkg name ([139c434](https://github.com/npm/npx/commit/139c434)) - - -### BREAKING CHANGES - -* **exec:** `npx ember-cli` and such things will now execute the -binary based on some guesswork, but only when using the shorthand format -for npx execution, with no `-p` option or `-c`. This might cause npx to -unintentionally execute the wrong binary if the package in question has -multiple non-matching binaries, but that should be rare. - - - - -# [7.0.0](https://github.com/npm/npx/compare/v6.2.0...v7.0.0) (2017-06-24) - - -### Bug Fixes - -* **win32:** improve win32 situation a bit (#50) ([b7ad934](https://github.com/npm/npx/commit/b7ad934)) - - -### Features - -* **local:** improve the behavior when calling ./local paths (#48) ([2e418d1](https://github.com/npm/npx/commit/2e418d1)) - - -### BREAKING CHANGES - -* **local:** `npx ./something` will now execute `./something` as a -binary or script instead of trying to install it as npm would. Other behavior -related to local path deps has likewise been changed. See -[#49](https://github.com/zkat/npx/issues/49) for a detailed explanation -of all the various cases and how each of them is handled. - - - - -# [6.2.0](https://github.com/npm/npx/compare/v6.1.0...v6.2.0) (2017-06-23) - - -### Bug Fixes - -* **child:** iron out a few crinkles and add tests ([b3b5ef6](https://github.com/npm/npx/commit/b3b5ef6)) -* **execCmd:** only reuse the current process if no shell passed in ([e413cff](https://github.com/npm/npx/commit/e413cff)) -* **execCmd:** use the module built-in directly ([6f741c2](https://github.com/npm/npx/commit/6f741c2)) -* **help:** fuck it. just hard-code it ([d5d5085](https://github.com/npm/npx/commit/d5d5085)) -* **main:** only exec if this is the main module ([9631e2a](https://github.com/npm/npx/commit/9631e2a)) - - -### Features - -* **i18n:** Update fr.json (#44) ([ea47c4f](https://github.com/npm/npx/commit/ea47c4f)) -* **i18n:** update the Romanian translation. (#42) ([2ed36b6](https://github.com/npm/npx/commit/2ed36b6)) - - - - -# [6.1.0](https://github.com/npm/npx/compare/v6.0.0...v6.1.0) (2017-06-21) - - -### Bug Fixes - -* **deps:** remove unused gauge dep ([aa40a34](https://github.com/npm/npx/commit/aa40a34)) - - -### Features - -* **i18n:** update ru locale (#41) ([7c84dee](https://github.com/npm/npx/commit/7c84dee)) -* **i18n:** update zh_CN (#40) ([da4ec67](https://github.com/npm/npx/commit/da4ec67)) -* **perf:** run node-based commands in the current process ([6efcde4](https://github.com/npm/npx/commit/6efcde4)) - - - - -# [6.0.0](https://github.com/npm/npx/compare/v5.4.0...v6.0.0) (2017-06-20) - - -### Bug Fixes - -* **call:** stop parsing -c for commands + fix corner cases ([bd4e538](https://github.com/npm/npx/commit/bd4e538)) -* **child:** exec does not have the information needed to correctly escape its args ([6714992](https://github.com/npm/npx/commit/6714992)) -* **guessCmdName:** tests failed because of lazy npa ([53a0119](https://github.com/npm/npx/commit/53a0119)) -* **i18n:** gender inclusiveness fix for french version (#37) ([04920ae](https://github.com/npm/npx/commit/04920ae)), closes [#37](https://github.com/zkat/npx/issues/37) -* **i18n:** typo 😇 (#38) ([ede4a53](https://github.com/npm/npx/commit/ede4a53)) -* **install:** handle JSON parsing failures ([bec2887](https://github.com/npm/npx/commit/bec2887)) -* **output:** stop printing out Command Failed messages ([873cffe](https://github.com/npm/npx/commit/873cffe)) -* **parseArgs:** fix booboo in fast path ([d1e5487](https://github.com/npm/npx/commit/d1e5487)) -* **perf:** fast-path `npx foo` arg parsing ([ba4fe71](https://github.com/npm/npx/commit/ba4fe71)) -* **perf:** remove bluebird and defer some requires for SPEED ([00fc313](https://github.com/npm/npx/commit/00fc313)) - - -### Features - -* **i18n:** add Romanian translations. (#34) ([9e98bd0](https://github.com/npm/npx/commit/9e98bd0)) -* **i18n:** added a few more localizable strings ([779d950](https://github.com/npm/npx/commit/779d950)) -* **i18n:** updated ca.json ([af7a035](https://github.com/npm/npx/commit/af7a035)) -* **i18n:** updated es.json ([414644f](https://github.com/npm/npx/commit/414644f)) -* **i18n:** updated ja.json ([448b082](https://github.com/npm/npx/commit/448b082)) -* **i18n:** Ze German Translation (#35) ([6f003f5](https://github.com/npm/npx/commit/6f003f5)) -* **package:** report number of temp packages installed ([5b7fe8d](https://github.com/npm/npx/commit/5b7fe8d)) -* **perf:** only launch update-notifier when npx installs stuff ([549d413](https://github.com/npm/npx/commit/549d413)) -* **quiet:** added -q/--quiet to suppress output from npx itself ([16607d9](https://github.com/npm/npx/commit/16607d9)) - - -### BREAKING CHANGES - -* **call:** `npx -c "foo"` will no longer install `foo`. Use `-p` to specicify packages to install. npx will no longer assume any particular format or escape status for `-c` strings: they will be passed directly, unparsed, and unaltered, to child_process.spawn. - - - - -# [5.4.0](https://github.com/npm/npx/compare/v5.3.0...v5.4.0) (2017-06-17) - - -### Bug Fixes - -* **i18n:** some corrections for es.json ([4d50b71](https://github.com/npm/npx/commit/4d50b71)) -* **i18n:** update locale files with bugfixes ([77caf82](https://github.com/npm/npx/commit/77caf82)) -* **i18n:** Y utility was ignoring falsy entries ([f22a4d0](https://github.com/npm/npx/commit/f22a4d0)) -* **i18n:** してください -> します ([01671af](https://github.com/npm/npx/commit/01671af)) - - -### Features - -* **i18n:** add catalan translation ([579efa1](https://github.com/npm/npx/commit/579efa1)) -* **i18n:** add pt-br translation (#33) ([6142551](https://github.com/npm/npx/commit/6142551)) -* **i18n:** added largely machine-translated ja.json ([827705f](https://github.com/npm/npx/commit/827705f)) -* **i18n:** adds russian translation (#32) ([b2619c1](https://github.com/npm/npx/commit/b2619c1)) - - - - -# [5.3.0](https://github.com/npm/npx/compare/v5.2.0...v5.3.0) (2017-06-13) - - -### Features - -* **i18n:** add Chinese translation (#31) ([24e1b31](https://github.com/npm/npx/commit/24e1b31)) - - - - -# [5.2.0](https://github.com/npm/npx/compare/v5.1.3...v5.2.0) (2017-06-12) - - -### Bug Fixes - -* **i18n:** removing extra spacing in fr.json ([002e2b8](https://github.com/npm/npx/commit/002e2b8)) - - -### Features - -* **i18n:** add french locale (#29) ([662395b](https://github.com/npm/npx/commit/662395b)) - - - - -## [5.1.3](https://github.com/npm/npx/compare/v5.1.2...v5.1.3) (2017-06-12) - - -### Bug Fixes - -* **fallback:** put the Y in the wrong place lol ([d6bf8aa](https://github.com/npm/npx/commit/d6bf8aa)) - - - - -## [5.1.2](https://github.com/npm/npx/compare/v5.1.1...v5.1.2) (2017-06-10) - - - - -## [5.1.1](https://github.com/npm/npx/compare/v5.1.0...v5.1.1) (2017-06-10) - - -### Bug Fixes - -* **i18n:** forgot to add locales to files ([4118d6a](https://github.com/npm/npx/commit/4118d6a)) - - - - -# [5.1.0](https://github.com/npm/npx/compare/v5.0.3...v5.1.0) (2017-06-10) - - -### Bug Fixes - -* **exit:** let process exit normally to finish writes ([c50a398](https://github.com/npm/npx/commit/c50a398)) - - -### Features - -* **i18n:** added es.json ([6cf58b9](https://github.com/npm/npx/commit/6cf58b9)) -* **i18n:** set up i18n plus baseline en.json locale ([b67bb3a](https://github.com/npm/npx/commit/b67bb3a)) - - - - -## [5.0.3](https://github.com/npm/npx/compare/v5.0.2...v5.0.3) (2017-06-09) - - -### Bug Fixes - -* **fallback:** exec is no ([42c1d30](https://github.com/npm/npx/commit/42c1d30)) - - - - -## [5.0.2](https://github.com/npm/npx/compare/v5.0.1...v5.0.2) (2017-06-09) - - -### Bug Fixes - -* **fallback:** allow fallback to local anyway ([569cf2c](https://github.com/npm/npx/commit/569cf2c)) - - - - -## [5.0.1](https://github.com/npm/npx/compare/v5.0.0...v5.0.1) (2017-06-09) - - - - -# [5.0.0](https://github.com/npm/npx/compare/v4.0.3...v5.0.0) (2017-06-09) - - -### Features - -* **fallback:** by default, only fall back if you have an @ in the name ([bea08a0](https://github.com/npm/npx/commit/bea08a0)) - - -### BREAKING CHANGES - -* **fallback:** auto-fallback will no longer fall back unless there was -an @ sign in the command. - - - - -## [4.0.3](https://github.com/npm/npx/compare/v4.0.2...v4.0.3) (2017-06-04) - - -### Bug Fixes - -* **npm:** use --userconfig when querying for npm cache config (#28) ([21bc3bf](https://github.com/npm/npx/commit/21bc3bf)) - - - - -## [4.0.2](https://github.com/npm/npx/compare/v4.0.1...v4.0.2) (2017-06-04) - - -### Bug Fixes - -* **install:** get windows workin (#27) ([9472175](https://github.com/npm/npx/commit/9472175)) - - - - -## [4.0.1](https://github.com/npm/npx/compare/v4.0.0...v4.0.1) (2017-06-04) - - -### Bug Fixes - -* **cmd:** make sure to use our own, enriched path ([9c89c2a](https://github.com/npm/npx/commit/9c89c2a)) -* **error:** join args with a space on Command failed error ([c2f6f18](https://github.com/npm/npx/commit/c2f6f18)) - - - - -# [4.0.0](https://github.com/npm/npx/compare/v3.0.0...v4.0.0) (2017-06-03) - - -### Features - -* **call:** -c now loads same env as run-script ([76ae44c](https://github.com/npm/npx/commit/76ae44c)) -* **npm:** allow configuration of npm binary ([e5d5634](https://github.com/npm/npx/commit/e5d5634)) -* **npm:** embed npm binary ([a2cae9d](https://github.com/npm/npx/commit/a2cae9d)) - - -### BREAKING CHANGES - -* **call:** scripts invoked with -c will now have a bunch of -variables added to them that were not there before. -* **npm:** npx will no longer use the system npm -- it embeds its own - - - - -# [3.0.0](https://github.com/npm/npx/compare/v2.1.0...v3.0.0) (2017-06-03) - - -### Bug Fixes - -* **args:** accept argv as arg and fix minor bugs ([46f10fe](https://github.com/npm/npx/commit/46f10fe)) -* **deps:** explicitly add mkdirp and rimraf to devDeps ([832c75d](https://github.com/npm/npx/commit/832c75d)) -* **docs:** misc tweaks to docs ([ed70a7b](https://github.com/npm/npx/commit/ed70a7b)) -* **exec:** escape binaries and args to cp.exec (#18) ([55d6a11](https://github.com/npm/npx/commit/55d6a11)) -* **fallback:** shells were sometimes ignored based on $SHELL ([07b7efc](https://github.com/npm/npx/commit/07b7efc)) -* **get-prefix:** nudge isRootPath ([1ab31eb](https://github.com/npm/npx/commit/1ab31eb)) -* **help:** correctly enable -h and --help ([adc2f45](https://github.com/npm/npx/commit/adc2f45)) -* **startup:** delay loading some things to speed up startup ([6b32bf5](https://github.com/npm/npx/commit/6b32bf5)) - - -### Features - -* **cmd:** do some heuristic guesswork on default command names (#23) ([2404420](https://github.com/npm/npx/commit/2404420)) -* **ignore:** add --ignore-existing option (#20) ([0866a83](https://github.com/npm/npx/commit/0866a83)) -* **install:** added --no-install option to prevent install fallbacks ([a5fbdaf](https://github.com/npm/npx/commit/a5fbdaf)) -* **package:** multiple --package options are now accepted ([f2fa6b3](https://github.com/npm/npx/commit/f2fa6b3)) -* **save:** remove all save-related functionality (#19) ([ab77f6c](https://github.com/npm/npx/commit/ab77f6c)) -* **shell:** run -c strings inside a system shell (#22) ([17db461](https://github.com/npm/npx/commit/17db461)) - - -### BREAKING CHANGES - -* **save:** npx can no longer be used to save packages locally or globally. Use an actual package manager for that, instead. - - - - -# [2.1.0](https://github.com/npm/npx/compare/v2.0.1...v2.1.0) (2017-06-01) - - -### Features - -* **opts:** add --shell-auto-fallback (#7) ([ac9cb40](https://github.com/npm/npx/commit/ac9cb40)) - - - - -## [2.0.1](https://github.com/npm/npx/compare/v2.0.0...v2.0.1) (2017-05-31) - - -### Bug Fixes - -* **exec:** use command lookup joined with current PATH ([d9175e8](https://github.com/npm/npx/commit/d9175e8)) - - - - -# [2.0.0](https://github.com/npm/npx/compare/v1.1.1...v2.0.0) (2017-05-31) - - -### Bug Fixes - -* **npm:** manually look up npm path for Windows compat ([0fe8fbf](https://github.com/npm/npx/commit/0fe8fbf)) - - -### Features - -* **commands:** -p and [@version](https://github.com/version) now trigger installs ([9668c83](https://github.com/npm/npx/commit/9668c83)) - - -### BREAKING CHANGES - -* **commands:** If a command has an explicit --package option, or if the command has an @version part, any version of the command in $PATH will be ignored and a regular install will be executed. - - - - -## [1.1.1](https://github.com/npm/npx/compare/v1.1.0...v1.1.1) (2017-05-30) - - -### Bug Fixes - -* **docs:** make sure man page gets installed ([2aadc16](https://github.com/npm/npx/commit/2aadc16)) - - - - -# [1.1.0](https://github.com/npm/npx/compare/v1.0.2...v1.1.0) (2017-05-30) - - -### Bug Fixes - -* **help:** update usage string for help ([0747cff](https://github.com/npm/npx/commit/0747cff)) -* **main:** exit if no package was parsed ([cdb579d](https://github.com/npm/npx/commit/cdb579d)) -* **opts:** allow -- to prevent further parsing ([db7a0e4](https://github.com/npm/npx/commit/db7a0e4)) - - -### Features - -* **updates:** added update-notifier ([8dc91d4](https://github.com/npm/npx/commit/8dc91d4)) - - - - -## [1.0.2](https://github.com/npm/npx/compare/v1.0.1...v1.0.2) (2017-05-30) - - -### Bug Fixes - -* **pkg:** bundle deps to guarantee global install precision ([3e21217](https://github.com/npm/npx/commit/3e21217)) - - - - -## [1.0.1](https://github.com/npm/npx/compare/v1.0.0...v1.0.1) (2017-05-30) - - -### Bug Fixes - -* **build:** add dummy test file to let things build ([6199eb6](https://github.com/npm/npx/commit/6199eb6)) -* **docs:** fix arg documentation in readme/manpage ([d1cf44c](https://github.com/npm/npx/commit/d1cf44c)) -* **opts:** add --version/-v ([2633a0e](https://github.com/npm/npx/commit/2633a0e)) - - - - -# 1.0.0 (2017-05-30) - - -### Features - -* **npx:** initial working implementation ([a83a67d](https://github.com/npm/npx/commit/a83a67d)) diff --git a/deps/npm/node_modules/libnpx/LICENSE.md b/deps/npm/node_modules/libnpx/LICENSE.md deleted file mode 100644 index 8d28acf866d932..00000000000000 --- a/deps/npm/node_modules/libnpx/LICENSE.md +++ /dev/null @@ -1,16 +0,0 @@ -ISC License - -Copyright (c) npm, Inc. - -Permission to use, copy, modify, and/or distribute this software for -any purpose with or without fee is hereby granted, provided that the -above copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE COPYRIGHT HOLDER DISCLAIMS -ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE -COPYRIGHT HOLDER BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR -CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS -OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE -OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE -USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/deps/npm/node_modules/libnpx/README.md b/deps/npm/node_modules/libnpx/README.md deleted file mode 100644 index fa7f37d878a067..00000000000000 --- a/deps/npm/node_modules/libnpx/README.md +++ /dev/null @@ -1,165 +0,0 @@ -[![npm](https://img.shields.io/npm/v/npx.svg)](https://npm.im/npx) [![license](https://img.shields.io/npm/l/npx.svg)](https://npm.im/npx) [![Travis](https://img.shields.io/travis/npm/npx.svg)](https://travis-ci.org/npm/npx) [![AppVeyor](https://ci.appveyor.com/api/projects/status/github/npm/npx?svg=true)](https://ci.appveyor.com/project/npm/npx) [![Coverage Status](https://coveralls.io/repos/github/npm/npx/badge.svg?branch=latest)](https://coveralls.io/github/npm/npx?branch=latest) - -# npx(1) -- execute npm package binaries - -## SYNOPSIS - -`npx [options] [@version] [command-arg]...` - -`npx [options] [-p|--package ]... [command-arg]...` - -`npx [options] -c ''` - -`npx --shell-auto-fallback [shell]` - -## INSTALL - -`npm install -g npx` - -## DESCRIPTION - -Executes `` either from a local `node_modules/.bin`, or from a central cache, installing any packages needed in order for `` to run. - -By default, `npx` will check whether `` exists in `$PATH`, or in the local project binaries, and execute that. If `` is not found, it will be installed prior to execution. - -Unless a `--package` option is specified, `npx` will try to guess the name of the binary to invoke depending on the specifier provided. All package specifiers understood by `npm` may be used with `npx`, including git specifiers, remote tarballs, local directories, or scoped packages. - -If a full specifier is included, or if `--package` is used, npx will always use a freshly-installed, temporary version of the package. This can also be forced with the `--ignore-existing` flag. - -* `-p, --package ` - define the package to be installed. This defaults to the value of ``. This is only needed for packages with multiple binaries if you want to call one of the other executables, or where the binary name does not match the package name. If this option is provided `` will be executed as-is, without interpreting `@version` if it's there. Multiple `--package` options may be provided, and all the packages specified will be installed. - -* `--no-install` - If passed to `npx`, it will only try to run `` if it already exists in the current path or in `$prefix/node_modules/.bin`. It won't try to install missing commands. - -* `--cache ` - set the location of the npm cache. Defaults to npm's own cache settings. - -* `--userconfig ` - path to the user configuration file to pass to npm. Defaults to whatever npm's current default is. - -* `-c ` - Execute `` inside an `npm run-script`-like shell environment, with all the usual environment variables available. Only the first item in `` will be automatically used as ``. Any others _must_ use `-p`. - -* `--shell ` - The shell to invoke the command with, if any. - -* `--shell-auto-fallback []` - Generates shell code to override your shell's "command not found" handler with one that calls `npx`. Tries to figure out your shell, or you can pass its name (either `bash`, `fish`, or `zsh`) as an option. See below for how to install. - -* `--ignore-existing` - If this flag is set, npx will not look in `$PATH`, or in the current package's `node_modules/.bin` for an existing version before deciding whether to install. Binaries in those paths will still be available for execution, but will be shadowed by any packages requested by this install. - -* `-q, --quiet` - Suppressed any output from npx itself (progress bars, error messages, install reports). Subcommand output itself will not be silenced. - -* `-n, --node-arg` - Extra node argument to supply to node when binary is a node script. You can supply this option multiple times to add more arguments. - -* `-v, --version` - Show the current npx version. - -## EXAMPLES - -### Running a project-local bin - -``` -$ npm i -D webpack -$ npx webpack ... -``` - -### One-off invocation without local installation - -``` -$ npm rm webpack -$ npx webpack -- ... -$ cat package.json -...webpack not in "devDependencies"... -``` - -### Invoking a command from a github repository - -``` -$ npx github:piuccio/cowsay -...or... -$ npx git+ssh://my.hosted.git:cowsay.git#semver:^1 -...etc... -``` - -### Execute a full shell command using one npx call w/ multiple packages - -``` -$ npx -p lolcatjs -p cowsay -c \ - 'echo "$npm_package_name@$npm_package_version" | cowsay | lolcatjs' -... - _____ -< your-cool-package@1.2.3 > - ----- - \ ^__^ - \ (oo)\_______ - (__)\ )\/\ - ||----w | - || || -``` - -### Run node binary with --inspect - -``` -$ npx --node-arg=--inspect cowsay -Debugger listening on ws://127.0.0.1:9229/.... -``` - -### Specify a node version to run npm scripts (or anything else!) - -``` -npx -p node@8 npm run build -``` - -## SHELL AUTO FALLBACK - -You can configure `npx` to run as your default fallback command when you type something in the command line with an `@` but the command is not found. This includes installing packages that were not found in the local prefix either. - -For example: - -``` -$ npm@4 --version -(stderr) npm@4 not found. Trying with npx... -4.6.1 -$ asdfasdfasf -zsh: command not found: asfdasdfasdf -``` - -Currently, `zsh`, `bash` (>= 4), and `fish` are supported. You can access these completion scripts using `npx --shell-auto-fallback `. - -To install permanently, add the relevant line below to your `~/.bashrc`, `~/.zshrc`, `~/.config/fish/config.fish`, or as needed. To install just for the shell session, simply run the line. - -You can optionally pass through `--no-install` when generating the fallback to prevent it from installing packages if the command is missing. - -### For bash@>=4: - -``` -$ source <(npx --shell-auto-fallback bash) -``` - -### For zsh: - -``` -$ source <(npx --shell-auto-fallback zsh) -``` - -### For fish: - -``` -$ source (npx --shell-auto-fallback fish | psub) -``` - -## ACKNOWLEDGEMENTS - -Huge thanks to [Kwyn Meagher](https://blog.kwyn.io) for generously donating the package name in the main npm registry. Previously `npx` was used for a Tessel board Neopixels library, which can now be found under [`npx-tessel`](https://npm.im/npx-tessel). - -## AUTHOR - -Written by [Kat Marchan](https://github.com/zkat). - -## REPORTING BUGS - -Please file any relevant issues [on Github.](https://github.com/npm/npx) - -## LICENSE - -This work is released by its authors into the public domain under CC0-1.0. See `LICENSE.md` for details. - -## SEE ALSO - -* `npm(1)` -* `npm-run-script(1)` -* `npm-config(7)` diff --git a/deps/npm/node_modules/libnpx/auto-fallback.js b/deps/npm/node_modules/libnpx/auto-fallback.js deleted file mode 100644 index 75fb60f4c2cbe8..00000000000000 --- a/deps/npm/node_modules/libnpx/auto-fallback.js +++ /dev/null @@ -1,69 +0,0 @@ -'use strict' - -const Y = require('./y.js') - -function mkPosix (opts) { - return ` -command_not_found_${opts.isBash ? 'handle' : 'handler'}() { - # Do not run within a pipe - if test ! -t 1; then - >&2 echo "${Y`command not found: ${'$1'}`}" - return 127 - fi - if which npx > /dev/null; then - echo "${Y`${'$1'} not found. Trying with npx...`}" >&2 - else - return 127 - fi - if ! [[ $1 =~ @ ]]; then - npx --no-install "$@" - else - npx "$@" - fi - return $? -}` -} - -function mkFish (opts) { - return ` -function __fish_command_not_found_on_interactive --on-event fish_prompt - functions --erase __fish_command_not_found_handler - functions --erase __fish_command_not_found_setup - - function __fish_command_not_found_handler --on-event fish_command_not_found - if which npx > /dev/null - echo "${Y`${'$argv[1]'} not found. Trying with npx...`}" >&2 - else - return 127 - end - if string match -q -r @ $argv[1] - npx $argv - else - npx --no-install $argv - end - end - - functions --erase __fish_command_not_found_on_interactive -end` -} - -module.exports = autoFallback -function autoFallback (shell, fromEnv, opts) { - if (shell.includes('bash')) { - return mkPosix({isBash: true, install: opts.install}) - } - - if (shell.includes('zsh')) { - return mkPosix({isBash: false, install: opts.install}) - } - - if (shell.includes('fish')) { - return mkFish(opts) - } - - if (fromEnv) { - return autoFallback(fromEnv, null, opts) - } - - console.error(Y`Only Bash, Zsh, and Fish shells are supported :(`) -} diff --git a/deps/npm/node_modules/libnpx/child.js b/deps/npm/node_modules/libnpx/child.js deleted file mode 100644 index cabc715d5b6d34..00000000000000 --- a/deps/npm/node_modules/libnpx/child.js +++ /dev/null @@ -1,86 +0,0 @@ -'use strict' - -const cp = require('child_process') -const path = require('path') - -module.exports.runCommand = runCommand -function runCommand (command, opts) { - const cmd = opts.call || command || opts.command - const copts = (opts.call ? [] : opts.cmdOpts) || [] - return spawn(cmd, copts, { - shell: opts.shell || !!opts.call, - stdio: opts.stdio || 'inherit' - }).catch(err => { - if (err.code === 'ENOENT') { - err = new Error( - `npx: ${ - require('./y.js')`command not found: ${path.basename(cmd)}` - }` - ) - err.exitCode = 127 - } else { - err.message = require('./y.js')`Command failed: ${cmd} ${err.message}` - } - throw err - }) -} - -module.exports.spawn = spawn -function spawn (cmd, args, opts) { - opts = opts || {} - opts.shell = opts.shell || process.platform === 'win32' - return new Promise((resolve, reject) => { - const child = cp.spawn(cmd, args, opts) - let stdout = '' - let stderr = '' - child.stdout && child.stdout.on('data', d => { stdout += d }) - child.stderr && child.stderr.on('data', d => { stderr += d }) - child.on('error', reject) - child.on('close', code => { - if (code) { - const err = new Error( - require('./y.js')`Command failed: ${cmd} ${args.join(' ')}` - ) - err.isOperational = true - err.stderr = stderr - err.exitCode = code - reject(err) - } else { - resolve({code, stdout, stderr}) - } - }) - }) -} - -module.exports.exec = exec -function exec (cmd, args, opts) { - opts = opts || {} - return new Promise((resolve, reject) => { - cp.exec(`${escapeArg(cmd, true)} ${ - args.join(' ') - }`, opts, (err, stdout) => { - if (err) { - if (typeof err.code === 'number') { - err.exitCode = err.code - } - reject(err) - } else { - resolve(stdout) - } - }) - }) -} - -module.exports.escapeArg = escapeArg -function escapeArg (str, asPath) { - return process.platform === 'win32' && asPath - ? path.normalize(str) - .split(/\\/) - .map(s => s.match(/\s+/) ? `"${s}"` : s) - .join('\\') - : process.platform === 'win32' - ? `"${str}"` - : str.match(/[^-_.~/\w]/) - ? `'${str.replace(/'/g, "'\"'\"'")}'` - : str -} diff --git a/deps/npm/node_modules/libnpx/get-prefix.js b/deps/npm/node_modules/libnpx/get-prefix.js deleted file mode 100644 index 3fef7f7eb9806d..00000000000000 --- a/deps/npm/node_modules/libnpx/get-prefix.js +++ /dev/null @@ -1,54 +0,0 @@ -'use strict' - -const promisify = require('./util.js').promisify - -const path = require('path') -const statAsync = promisify(require('fs').stat) - -module.exports = getPrefix -function getPrefix (root) { - const original = root = path.resolve(root) - while (path.basename(root) === 'node_modules') { - root = path.dirname(root) - } - if (original !== root) { - return Promise.resolve(root) - } else { - return Promise.resolve(getPrefixFromTree(root)) - } -} - -function getPrefixFromTree (current) { - if (isRootPath(current, process.platform)) { - return false - } else { - return Promise.all([ - fileExists(path.join(current, 'package.json')), - fileExists(path.join(current, 'node_modules')) - ]).then(args => { - const hasPkg = args[0] - const hasModules = args[1] - if (hasPkg || hasModules) { - return current - } else { - return getPrefixFromTree(path.dirname(current)) - } - }) - } -} - -module.exports._fileExists = fileExists -function fileExists (f) { - return statAsync(f).catch(err => { - if (err.code !== 'ENOENT') { - throw err - } - }) -} - -module.exports._isRootPath = isRootPath -function isRootPath (p, platform) { - return platform === 'win32' - ? p.match(/^[a-z]+:[/\\]?$/i) - : p === '/' -} diff --git a/deps/npm/node_modules/libnpx/index.js b/deps/npm/node_modules/libnpx/index.js deleted file mode 100644 index 21f44b37105675..00000000000000 --- a/deps/npm/node_modules/libnpx/index.js +++ /dev/null @@ -1,370 +0,0 @@ -'use strict' - -const Buffer = require('safe-buffer').Buffer -const promisify = require('./util.js').promisify - -const child = require('./child') -const fs = require('fs') -const parseArgs = require('./parse-args.js') -const path = require('path') -const which = promisify(require('which')) - -module.exports = npx -module.exports.parseArgs = parseArgs -function npx (argv) { - const shell = argv['shell-auto-fallback'] - if (shell || shell === '') { - const fallback = require('./auto-fallback.js')( - shell, process.env.SHELL, argv - ) - if (fallback) { - return console.log(fallback) - } else { - process.exitCode = 1 - return - } - } - - if (!argv.call && (!argv.command || !argv.package)) { - !argv.q && console.error(Y()`\nERROR: You must supply a command.\n`) - !argv.q && parseArgs.showHelp() - process.exitCode = 1 - return - } - - const startTime = Date.now() - - // First, we look to see if we're inside an npm project, and grab its - // bin path. This is exactly the same as running `$ npm bin`. - return localBinPath(process.cwd()).then(local => { - if (local) { - // Local project paths take priority. Go ahead and prepend it. - process.env.PATH = `${local}${path.delimiter}${process.env.PATH}` - } - return Promise.all([ - // Figuring out if a command exists, early on, lets us maybe - // short-circuit a few things later. This bit here primarily benefits - // calls like `$ npx foo`, where we might just be trying to invoke - // a single command and use whatever is already in the path. - argv.command && getExistingPath(argv.command, argv), - // The `-c` flag involves special behavior when used: in this case, - // we take a bit of extra time to pick up npm's full lifecycle script - // environment (so you can use `$npm_package_xxxxx` and company). - // Without that flag, we just use the current env. - argv.call && local && getEnv(argv) - ]).then(args => { - const existing = args[0] - const newEnv = args[1] - if (newEnv) { - // NOTE - we don't need to manipulate PATH further here, because - // npm has already done so. And even added the node-gyp path! - Object.assign(process.env, newEnv) - } - if ((!existing && !argv.call) || argv.packageRequested) { - // We only fire off the updateNotifier if we're installing things - if (argv.npxPkg) { - try { - require('update-notifier')({ - pkg: require(argv.npxPkg) - }).notify() - } catch (e) {} - } - // Some npm packages need to be installed. Let's install them! - return ensurePackages(argv.package, argv).then(results => { - if (results && results.added && results.updated && !argv.q) { - console.error(Y()`npx: installed ${ - results.added.length + results.updated.length - } in ${(Date.now() - startTime) / 1000}s`) - } - if ( - argv.command && - !existing && - !argv.packageRequested && - argv.package.length === 1 - ) { - return promisify(fs.readdir)(results.bin).then(bins => { - if (process.platform === 'win32') { - bins = bins.filter(b => b !== 'etc' && b !== 'node_modules') - } - if (bins.length < 1) { - throw new Error(Y()`command not found: ${argv.command}`) - } - const cmd = new RegExp(`^${argv.command}(?:\\.cmd)?$`, 'i') - const matching = bins.find(b => b.match(cmd)) - return path.resolve(results.bin, bins[matching] || bins[0]) - }, err => { - if (err.code === 'ENOENT') { - throw new Error(Y()`command not found: ${argv.command}`) - } else { - throw err - } - }) - } else { - return existing - } - }) - } else { - // We can skip any extra installation, 'cause everything exists. - return existing - } - }).then(existing => { - return execCommand(existing, argv) - }).catch(err => { - !argv.q && console.error(err.message) - process.exitCode = err.exitCode || 1 - }) - }) -} - -module.exports._localBinPath = localBinPath -function localBinPath (cwd) { - return require('./get-prefix.js')(cwd).then(prefix => { - return prefix && path.join(prefix, 'node_modules', '.bin') - }) -} - -module.exports._getEnv = getEnv -function getEnv (opts) { - const args = ['run', 'env', '--parseable'] - return findNodeScript(opts.npm, {isLocal: true}).then(npmPath => { - if (npmPath) { - args.unshift(child.escapeArg(opts.npm)) - return process.argv[0] - } else { - return opts.npm - } - }).then(npmPath => { - return child.exec(npmPath, args) - }).then(require('dotenv').parse) -} - -module.exports._ensurePackages = ensurePackages -function ensurePackages (specs, opts) { - return ( - opts.cache ? Promise.resolve(opts.cache) : getNpmCache(opts) - ).then(cache => { - const prefix = path.join(cache, '_npx', process.pid.toString()) - const bins = process.platform === 'win32' - ? prefix - : path.join(prefix, 'bin') - const rimraf = require('rimraf') - process.on('exit', () => rimraf.sync(prefix)) - return promisify(rimraf)(bins).then(() => { - return installPackages(specs, prefix, opts) - }).then(info => { - // This will make temp bins _higher priority_ than even local bins. - // This is intentional, since npx assumes that if you went through - // the trouble of doing `-p`, you're rather have that one. Right? ;) - process.env.PATH = `${bins}${path.delimiter}${process.env.PATH}` - if (!info) { info = {} } - info.prefix = prefix - info.bin = bins - return info - }) - }) -} - -module.exports._getExistingPath = getExistingPath -function getExistingPath (command, opts) { - if (opts.isLocal) { - return Promise.resolve(command) - } else if ( - opts.cmdHadVersion || opts.packageRequested || opts.ignoreExisting - ) { - return Promise.resolve(false) - } else { - return which(command).catch(err => { - if (err.code === 'ENOENT') { - if (opts.install === false) { - err.exitCode = 127 - throw err - } - } else { - throw err - } - }) - } -} - -module.exports._getNpmCache = getNpmCache -function getNpmCache (opts) { - const args = ['config', 'get', 'cache', '--parseable'] - if (opts.userconfig) { - args.push('--userconfig', child.escapeArg(opts.userconfig, true)) - } - return findNodeScript(opts.npm, {isLocal: true}).then(npmPath => { - if (npmPath) { - // This one is NOT escaped as a path because it's handed to Node. - args.unshift(child.escapeArg(opts.npm)) - return process.argv[0] - } else { - return opts.npm - } - }).then(npmPath => { - return child.exec(npmPath, args) - }).then(cache => cache.trim()) -} - -module.exports._buildArgs = buildArgs -function buildArgs (specs, prefix, opts) { - const args = ['install'].concat(specs) - args.push('--global', '--prefix', prefix) - if (opts.cache) args.push('--cache', opts.cache) - if (opts.userconfig) args.push('--userconfig', opts.userconfig) - args.push('--loglevel', 'error', '--json') - - return args -} - -module.exports._installPackages = installPackages -function installPackages (specs, prefix, opts) { - const args = buildArgs(specs, prefix, opts) - return findNodeScript(opts.npm, {isLocal: true}).then(npmPath => { - if (npmPath) { - args.unshift( - process.platform === 'win32' - ? child.escapeArg(opts.npm) - : opts.npm - ) - return process.argv[0] - } else { - return opts.npm - } - }).then(npmPath => { - return process.platform === 'win32' ? child.escapeArg(npmPath, true) : npmPath - }).then(npmPath => { - return child.spawn(npmPath, args, { - stdio: opts.installerStdio - ? opts.installerStdio - : [0, 'pipe', opts.q ? 'ignore' : 2] - }).then(deets => { - try { - return deets.stdout ? JSON.parse(deets.stdout) : null - } catch (e) { } - }, err => { - if (err.exitCode) { - err.message = Y()`Install for ${specs} failed with code ${err.exitCode}` - } - throw err - }) - }) -} - -module.exports._execCommand = execCommand -function execCommand (_existing, argv) { - return findNodeScript(_existing, argv).then(existing => { - const argvCmdOpts = argv.cmdOpts || [] - if (existing && !argv.alwaysSpawn && !argv.nodeArg && !argv.shell && existing !== process.argv[1]) { - const Module = require('module') - // let it take over the process. This means we can skip node startup! - if (!argv.noYargs) { - // blow away built-up yargs crud - require('yargs').reset() - } - process.argv = [ - process.argv[0], // Current node binary - existing // node script path. `runMain()` will set this as the new main - ].concat(argvCmdOpts) // options for the cmd itself - Module.runMain() // ✨MAGIC✨. Sorry-not-sorry - } else if (!existing && argv.nodeArg && argv.nodeArg.length) { - throw new Error(Y()`ERROR: --node-arg/-n can only be used on packages with node scripts.`) - } else { - let cmd = existing - let cmdOpts = argvCmdOpts - if (existing) { - cmd = process.argv[0] - if (process.platform === 'win32') { - cmd = child.escapeArg(cmd, true) - } - // If we know we're running a run script and we got a --node-arg, - // we need to fudge things a bit to get them working right. - cmdOpts = argv.nodeArg - if (cmdOpts) { - cmdOpts = Array.isArray(cmdOpts) ? cmdOpts : [cmdOpts] - } else { - cmdOpts = [] - } - // It's valid for a single arg to be a string of multiple - // space-separated node args. - // Example: `$ npx -n '--inspect --harmony --debug' ...` - cmdOpts = cmdOpts.reduce((acc, arg) => { - return acc.concat(arg.split(/\s+/)) - }, []) - cmdOpts = cmdOpts.concat(existing, argvCmdOpts) - } - const opts = Object.assign({}, argv, { cmdOpts }) - return child.runCommand(cmd, opts).catch(err => { - if (err.isOperational && err.exitCode) { - // At this point, we want to treat errors from the child as if - // we were just running the command. That means no extra msg logging - process.exitCode = err.exitCode - } else { - // But if it's not just a regular child-level error, blow up normally - throw err - } - }) - } - }) -} - -module.exports._findNodeScript = findNodeScript -function findNodeScript (existing, opts) { - if (!existing) { - return Promise.resolve(false) - } else { - return promisify(fs.stat)(existing).then(stat => { - if (opts && opts.isLocal && path.extname(existing) === '.js') { - return existing - } else if (opts && opts.isLocal && stat.isDirectory()) { - // npx will execute the directory itself - try { - const pkg = require(path.resolve(existing, 'package.json')) - const target = path.resolve(existing, pkg.bin || pkg.main || 'index.js') - return findNodeScript(target, opts).then(script => { - if (script) { - return script - } else { - throw new Error(Y()`command not found: ${target}`) - } - }) - } catch (e) { - throw new Error(Y()`command not found: ${existing}`) - } - } else if (process.platform !== 'win32') { - const bytecount = 400 - const buf = Buffer.alloc(bytecount) - return promisify(fs.open)(existing, 'r').then(fd => { - return promisify(fs.read)(fd, buf, 0, bytecount, 0).then(() => { - return promisify(fs.close)(fd) - }, err => { - return promisify(fs.close)(fd).then(() => { throw err }) - }) - }).then(() => { - const re = /#!\s*(?:\/usr\/bin\/env\s*node|\/usr\/local\/bin\/node|\/usr\/bin\/node)\s*\r?\n/i - return buf.toString('utf8').match(re) && existing - }) - } else if (process.platform === 'win32') { - const buf = Buffer.alloc(1000) - return promisify(fs.open)(existing, 'r').then(fd => { - return promisify(fs.read)(fd, buf, 0, 1000, 0).then(() => { - return promisify(fs.close)(fd) - }, err => { - return promisify(fs.close)(fd).then(() => { throw err }) - }) - }).then(() => { - return buf.toString('utf8').trim() - }).then(str => { - const cmd = /"%~dp0\\node\.exe"\s+"%~dp0\\(.*)"\s+%\*/ - const mingw = /"\$basedir\/node"\s+"\$basedir\/(.*)"\s+"\$@"/i - return str.match(cmd) || str.match(mingw) - }).then(match => { - return match && path.join(path.dirname(existing), match[1]) - }) - } - }) - } -} - -function Y () { - return require('./y.js') -} diff --git a/deps/npm/node_modules/libnpx/libnpx.1 b/deps/npm/node_modules/libnpx/libnpx.1 deleted file mode 100644 index 1f5669d3c9d76e..00000000000000 --- a/deps/npm/node_modules/libnpx/libnpx.1 +++ /dev/null @@ -1,175 +0,0 @@ -.TH "NPX" "1" "July 2020" "libnpx@10.2.3" "User Commands" -.SH "NAME" -\fBnpx\fR \- execute npm package binaries -.SH SYNOPSIS -.P -\fBnpx [options] [@version] [command\-arg]\.\.\.\fP -.P -\fBnpx [options] [\-p|\-\-package ]\.\.\. [command\-arg]\.\.\.\fP -.P -\fBnpx [options] \-c ''\fP -.P -\fBnpx \-\-shell\-auto\-fallback [shell]\fP -.SH INSTALL -.P -\fBnpm install \-g npx\fP -.SH DESCRIPTION -.P -Executes \fB\fP either from a local \fBnode_modules/\.bin\fP, or from a central cache, installing any packages needed in order for \fB\fP to run\. -.P -By default, \fBnpx\fP will check whether \fB\fP exists in \fB$PATH\fP, or in the local project binaries, and execute that\. If \fB\fP is not found, it will be installed prior to execution\. -.P -Unless a \fB\-\-package\fP option is specified, \fBnpx\fP will try to guess the name of the binary to invoke depending on the specifier provided\. All package specifiers understood by \fBnpm\fP may be used with \fBnpx\fP, including git specifiers, remote tarballs, local directories, or scoped packages\. -.P -If a full specifier is included, or if \fB\-\-package\fP is used, npx will always use a freshly\-installed, temporary version of the package\. This can also be forced with the \fB\-\-ignore\-existing\fP flag\. -.RS 0 -.IP \(bu 2 -\fB\-p, \-\-package \fP \- define the package to be installed\. This defaults to the value of \fB\fP\|\. This is only needed for packages with multiple binaries if you want to call one of the other executables, or where the binary name does not match the package name\. If this option is provided \fB\fP will be executed as\-is, without interpreting \fB@version\fP if it's there\. Multiple \fB\-\-package\fP options may be provided, and all the packages specified will be installed\. -.IP \(bu 2 -\fB\-\-no\-install\fP \- If passed to \fBnpx\fP, it will only try to run \fB\fP if it already exists in the current path or in \fB$prefix/node_modules/\.bin\fP\|\. It won't try to install missing commands\. -.IP \(bu 2 -\fB\-\-cache \fP \- set the location of the npm cache\. Defaults to npm's own cache settings\. -.IP \(bu 2 -\fB\-\-userconfig \fP \- path to the user configuration file to pass to npm\. Defaults to whatever npm's current default is\. -.IP \(bu 2 -\fB\-c \fP \- Execute \fB\fP inside an \fBnpm run\-script\fP\-like shell environment, with all the usual environment variables available\. Only the first item in \fB\fP will be automatically used as \fB\fP\|\. Any others \fImust\fR use \fB\-p\fP\|\. -.IP \(bu 2 -\fB\-\-shell \fP \- The shell to invoke the command with, if any\. -.IP \(bu 2 -\fB\-\-shell\-auto\-fallback []\fP \- Generates shell code to override your shell's "command not found" handler with one that calls \fBnpx\fP\|\. Tries to figure out your shell, or you can pass its name (either \fBbash\fP, \fBfish\fP, or \fBzsh\fP) as an option\. See below for how to install\. -.IP \(bu 2 -\fB\-\-ignore\-existing\fP \- If this flag is set, npx will not look in \fB$PATH\fP, or in the current package's \fBnode_modules/\.bin\fP for an existing version before deciding whether to install\. Binaries in those paths will still be available for execution, but will be shadowed by any packages requested by this install\. -.IP \(bu 2 -\fB\-q, \-\-quiet\fP \- Suppressed any output from npx itself (progress bars, error messages, install reports)\. Subcommand output itself will not be silenced\. -.IP \(bu 2 -\fB\-n, \-\-node\-arg\fP \- Extra node argument to supply to node when binary is a node script\. You can supply this option multiple times to add more arguments\. -.IP \(bu 2 -\fB\-v, \-\-version\fP \- Show the current npx version\. - -.RE -.SH EXAMPLES -.SS Running a project\-local bin -.P -.RS 2 -.nf -$ npm i \-D webpack -$ npx webpack \.\.\. -.fi -.RE -.SS One\-off invocation without local installation -.P -.RS 2 -.nf -$ npm rm webpack -$ npx webpack \-\- \.\.\. -$ cat package\.json -\|\.\.\.webpack not in "devDependencies"\.\.\. -.fi -.RE -.SS Invoking a command from a github repository -.P -.RS 2 -.nf -$ npx github:piuccio/cowsay -\|\.\.\.or\.\.\. -$ npx git+ssh://my\.hosted\.git:cowsay\.git#semver:^1 -\|\.\.\.etc\.\.\. -.fi -.RE -.SS Execute a full shell command using one npx call w/ multiple packages -.P -.RS 2 -.nf -$ npx \-p lolcatjs \-p cowsay \-c \\ - 'echo "$npm_package_name@$npm_package_version" | cowsay | lolcatjs' -\|\.\.\. - _____ -< your\-cool\-package@1\.2\.3 > - \-\-\-\-\- - \\ ^__^ - \\ (oo)\\_______ - (__)\\ )\\/\\ - ||\-\-\-\-w | - || || -.fi -.RE -.SS Run node binary with \-\-inspect -.P -.RS 2 -.nf -$ npx \-\-node\-arg=\-\-inspect cowsay -Debugger listening on ws://127\.0\.0\.1:9229/\.\.\.\. -.fi -.RE -.SS Specify a node version to run npm scripts (or anything else!) -.P -.RS 2 -.nf -npx \-p node@8 npm run build -.fi -.RE -.SH SHELL AUTO FALLBACK -.P -You can configure \fBnpx\fP to run as your default fallback command when you type something in the command line with an \fB@\fP but the command is not found\. This includes installing packages that were not found in the local prefix either\. -.P -For example: -.P -.RS 2 -.nf -$ npm@4 \-\-version -(stderr) npm@4 not found\. Trying with npx\.\.\. -4\.6\.1 -$ asdfasdfasf -zsh: command not found: asfdasdfasdf -.fi -.RE -.P -Currently, \fBzsh\fP, \fBbash\fP (>= 4), and \fBfish\fP are supported\. You can access these completion scripts using \fBnpx \-\-shell\-auto\-fallback \fP\|\. -.P -To install permanently, add the relevant line below to your \fB~/\.bashrc\fP, \fB~/\.zshrc\fP, \fB~/\.config/fish/config\.fish\fP, or as needed\. To install just for the shell session, simply run the line\. -.P -You can optionally pass through \fB\-\-no\-install\fP when generating the fallback to prevent it from installing packages if the command is missing\. -.SS For bash@>=4: -.P -.RS 2 -.nf -$ source <(npx \-\-shell\-auto\-fallback bash) -.fi -.RE -.SS For zsh: -.P -.RS 2 -.nf -$ source <(npx \-\-shell\-auto\-fallback zsh) -.fi -.RE -.SS For fish: -.P -.RS 2 -.nf -$ source (npx \-\-shell\-auto\-fallback fish | psub) -.fi -.RE -.SH ACKNOWLEDGEMENTS -.P -Huge thanks to Kwyn Meagher \fIhttps://blog\.kwyn\.io\fR for generously donating the package name in the main npm registry\. Previously \fBnpx\fP was used for a Tessel board Neopixels library, which can now be found under \fBnpx\-tessel\fP \fIhttps://npm\.im/npx\-tessel\fR\|\. -.SH AUTHOR -.P -Written by Kat Marchan \fIhttps://github\.com/zkat\fR\|\. -.SH REPORTING BUGS -.P -Please file any relevant issues on Github\. \fIhttps://github\.com/npm/npx\fR -.SH LICENSE -.P -This work is released by its authors into the public domain under CC0\-1\.0\. See \fBLICENSE\.md\fP for details\. -.SH SEE ALSO -.RS 0 -.IP \(bu 2 -\fBnpm(1)\fP -.IP \(bu 2 -\fBnpm\-run\-script(1)\fP -.IP \(bu 2 -\fBnpm\-config(7)\fP - -.RE - diff --git a/deps/npm/node_modules/libnpx/locales/ca.json b/deps/npm/node_modules/libnpx/locales/ca.json deleted file mode 100644 index d9faf1c08b0133..00000000000000 --- a/deps/npm/node_modules/libnpx/locales/ca.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "Execute binaries from npm packages.\n%s": "Executa comandes de paquets de npm.\n%s", - "Package to be installed.": "Paquet per a instal·lar.", - "Location of the npm cache.": "Ruta de la memòria cau de npm.", - "Skip installation if a package is missing.": "Salta el pas d'instal·lació si el paquet no està present.", - "Path to user npmrc.": "Ruta al npmrc de l'usuari.", - "Execute string as if inside `npm run-script`.": "Executa l'argument com si estigués dins de `npm run-script`.", - "Shell to execute the command with, if any.": "Shell amb el qual s'executarà la comanda, si hi ha algun.", - "Generate shell code to use npx as the \"command not found\" fallback.": "Genera codi de shell per utilizar npx com el replegament quan la comanda no existeix.", - "Ignores existing binaries in $PATH, or in the local project. This forces npx to do a temporary install and use the latest version.": "Ignora comandaments en $PATH, o en el projecte local. Això obliga a npx a fer una instal·lació temporal i usar la versió més recent de la comanda.", - "npm binary to use for internal operations.": "Comando d'npm que es farà servir per a operacions internes de npx.", - "For the full documentation, see the manual page for npx(1).": "Per documentació completa, vegeu la pàgina del manual npx(1).", - "Unable to guess a binary name from %s. Please use --package.": "No s'ha pogut endevinar el nom de la comanda usant %s. Si us plau utilitza --package.", - "\nERROR: You must supply a command.\n": "\nERROR: Has proveir una comanda.\n", - "Command failed: %s %s": "La comanda va fracasar: %s %s", - "Install for %s failed with code %s": "instal·lació de %s fracassar amb codi %s", - "%s not found. Trying with npx...": "%s no existeix. Provant-ho amb npx...", - "command not found: %s": "comanda no existeix: %s", - "options": "opcions", - "command": "comanda", - "version": "versió", - "command-arg": "argument-de-comanda", - "command-string": "text-de-comanda", - "shell": "shell", - "package": "paquet", - "npx: installed %s in %ss": "npx: instal·lat %s en %ss", - "Suppress output from npx itself. Subcommands will not be affected.": "Suprimir la sortida d' npx. Les sub-comandes no es veuran afectades." -} diff --git a/deps/npm/node_modules/libnpx/locales/cs.json b/deps/npm/node_modules/libnpx/locales/cs.json deleted file mode 100644 index c3ecc402cf916b..00000000000000 --- a/deps/npm/node_modules/libnpx/locales/cs.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "Execute binaries from npm packages.\n%s": "Spouštění skriptů z npm balíčků.\n%s", - "Package to be installed.": "Balíček k instalaci.", - "Location of the npm cache.": "Umístění npm keše.", - "Skip installation if a package is missing.": "Neinstalovat chybějící balíčky.", - "Path to user npmrc.": "Cesta k uživatelskému npmrc souboru.", - "Execute string as if inside `npm run-script`.": "Příkaz, který se spustí jakoby uvnitř `npm run-script`.", - "Shell to execute the command with, if any.": "Shell ke spuštění příkazu, pokud je třeba.", - "Generate shell code to use npx as the \"command not found\" fallback.": "Vygenerovat shell kód použitelný jako \"command not found\" fallback.", - "Ignores existing binaries in $PATH, or in the local project. This forces npx to do a temporary install and use the latest version.": "Ignorovat existující skripty v $PATH i v lokálním projektu, npx tak udělá dočasnou instalaci a použije poslední verzi balíčku.", - "npm binary to use for internal operations.": "npm použité pro interní operace.", - "For the full documentation, see the manual page for npx(1).": "Úplná dokumentace je dostupná v manuálu pro npx(1).", - "Unable to guess a binary name from %s. Please use --package.": "Nelze uhodnout jméno skriptu z %s, použijte prosím --package.", - "\nERROR: You must supply a command.\n": "\nCHYBA: Musíte zadat nějaký příkaz.\n", - "Command failed: %s %s": "Příkaz selhal: %s %s", - "Install for %s failed with code %s": "Instalace %s selhala s kódem %s", - "%s not found. Trying with npx...": "%s nenalezen. Zkouším npx...", - "command not found: %s": "příkaz nenalezen: %s", - "options": "parametry", - "command": "příkaz", - "version": "verze", - "command-arg": "argument", - "command-string": "příkaz v řetězci", - "shell": "shell", - "package": "balíček", - "npx: installed %s in %ss": "npx: nainstalováno %s za %ss", - "Suppress output from npx itself. Subcommands will not be affected.": "Potlačit výstup z npx. Spuštěné příkazy nebudou ovlivněné." -} diff --git a/deps/npm/node_modules/libnpx/locales/de.json b/deps/npm/node_modules/libnpx/locales/de.json deleted file mode 100644 index f732607063c481..00000000000000 --- a/deps/npm/node_modules/libnpx/locales/de.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "Execute binaries from npm packages.\n%s": "Führt Programme aus, die von npm Paketen bereitgestellt werden.\n%s", - "Package to be installed.": "Das zu installierende Paket.", - "Location of the npm cache.": "Ort des npm Zwischenspeichers.", - "Skip installation if a package is missing.": "Überspringe die Installation, falls ein Paket fehlt.", - "Path to user npmrc.": "Pfad zu npmrc im Benutzerverzeichnis.", - "Execute string as if inside `npm run-script`.": "Führe Zeichenkette aus, als wäre sie innerhalb von `npm run-script`.", - "Shell to execute the command with, if any.": "Shell, mit der Programme ausgeführt werden soll, wenn überhaupt.", - "Generate shell code to use npx as the \"command not found\" fallback.": "Erzeuge Shellcode, um npx als Alternative zu \"Programm konnte nicht gefunden werden\" zu benutzen.", - "Ignores existing binaries in $PATH, or in the local project. This forces npx to do a temporary install and use the latest version.": "Ignoriere bestehende Programme innerhalb von $PATH oder im lokalen Projekt. Dies zwingt npx dazu, die neuste Version herunterzuladen und zu benutzen.", - "npm binary to use for internal operations.": "npm-Programm für die interne Benutzung.", - "For the full documentation, see the manual page for npx(1).": "In der Manpage npx(1) ist die gesamte Dokumentation einzusehen.", - "Unable to guess a binary name from %s. Please use --package.": "Der Programmname von %s kann nicht automatisch ermittelt werden. Bitte benutze --package.", - "\nERROR: You must supply a command.\n": "\nFEHLER: Du musst einen Befehl angeben.\n", - "Command failed: %s %s": "Befehl fehlgeschlagen: %s %s", - "Install for %s failed with code %s": "Die Installation von %s ist mit dem Code %s fehlgeschlagen", - "%s not found. Trying with npx...": "%s konnte nicht gefunden werden. Versuche mit npx...", - "command not found: %s": "Programm konnte nicht gefunden werden: %s", - "options": "Optionen", - "command": "Befehl", - "version": "Version", - "command-arg": "Befehlsargument", - "command-string": "Befehlszeichenkette", - "shell": "Shell", - "package": "Paket", - "npx: installed %s in %ss": "npx: Installierte %s in %ss", - "Suppress output from npx itself. Subcommands will not be affected.": "Unterdrücke Output von npx. Unterbefehle sind nicht davon betroffen.", - "Extra node argument when calling a node binary.": "Extra node Argument, wenn eine node ausführbare Binärdatei gerufen ist." -} diff --git a/deps/npm/node_modules/libnpx/locales/en.json b/deps/npm/node_modules/libnpx/locales/en.json deleted file mode 100644 index d3463ae315c0be..00000000000000 --- a/deps/npm/node_modules/libnpx/locales/en.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "Execute binaries from npm packages.\n%s": "Execute binaries from npm packages.\n%s", - "Package to be installed.": "Package to be installed.", - "Location of the npm cache.": "Location of the npm cache.", - "Skip installation if a package is missing.": "Skip installation if a package is missing.", - "Path to user npmrc.": "Path to user npmrc.", - "Execute string as if inside `npm run-script`.": "Execute string as if inside `npm run-script`.", - "Shell to execute the command with, if any.": "Shell to execute the command with, if any.", - "Generate shell code to use npx as the \"command not found\" fallback.": "Generate shell code to use npx as the \"command not found\" fallback.", - "Ignores existing binaries in $PATH, or in the local project. This forces npx to do a temporary install and use the latest version.": "Ignores existing binaries in $PATH, or in the local project. This forces npx to do a temporary install and use the latest version.", - "npm binary to use for internal operations.": "npm binary to use for internal operations.", - "For the full documentation, see the manual page for npx(1).": "For the full documentation, see the manual page for npx(1).", - "Unable to guess a binary name from %s. Please use --package.": "Unable to guess a binary name from %s. Please use --package.", - "\nERROR: You must supply a command.\n": "\nERROR: You must supply a command.\n", - "Command failed: %s %s": "Command failed: %s %s", - "Install for %s failed with code %s": "Install for %s failed with code %s", - "%s not found. Trying with npx...": "%s not found. Trying with npx...", - "command not found: %s": "command not found: %s", - "options": "options", - "command": "command", - "version": "version", - "command-arg": "command-arg", - "command-string": "command-string", - "shell": "shell", - "package": "package", - "npx: installed %s in %ss": "npx: installed %s in %ss", - "Suppress output from npx itself. Subcommands will not be affected.": "Suppress output from npx itself. Subcommands will not be affected.", - "Extra node argument when calling a node binary.": "Extra node argument when calling a node binary.", - "Always spawn a child process to execute the command.": "Always spawn a child process to execute the command." -} \ No newline at end of file diff --git a/deps/npm/node_modules/libnpx/locales/es.json b/deps/npm/node_modules/libnpx/locales/es.json deleted file mode 100644 index c89bceeb20b790..00000000000000 --- a/deps/npm/node_modules/libnpx/locales/es.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "Execute binaries from npm packages.\n%s": "Ejecuta comandos de paquetes de npm.\n%s", - "Package to be installed.": "Paquete para instalar.", - "Location of the npm cache.": "Ruta del cache de npm.", - "Skip installation if a package is missing.": "Salta el paso de instalación si el paquete no está presente.", - "Path to user npmrc.": "Ruta al npmrc del usuario.", - "Execute string as if inside `npm run-script`.": "Ejecuta el argumento como si estuviera dentro de `npm run-script`.", - "Shell to execute the command with, if any.": "Shell con el que se ejecutará el comando, si alguno.", - "Generate shell code to use npx as the \"command not found\" fallback.": "Genera código de shell para usar npx como el repliegue cuando el comando no existe.", - "Ignores existing binaries in $PATH, or in the local project. This forces npx to do a temporary install and use the latest version.": "Ignora comandos en $PATH, o en el proyecto local. Esto obliga a npx a hacer una instalación temporanea y usar la version más reciente del comando.", - "npm binary to use for internal operations.": "Comando de npm que se usará para operaciones internas de npx.", - "For the full documentation, see the manual page for npx(1).": "Para documentación completa, véase la pagina del manual npx(1).", - "Unable to guess a binary name from %s. Please use --package.": "No se pudo adivinar el nombre del comando usando %s. Por favor usa --package.", - "\nERROR: You must supply a command.\n": "\nERROR: Debes proveer un comando.\n", - "Command failed: %s %s": "Comando fracasó: %s %s", - "Install for %s failed with code %s": "La instalación de %s fracasó con código %s", - "%s not found. Trying with npx...": "%s no existe. Tratando con npx...", - "command not found: %s": "comando no existe: %s", - "options": "opciones", - "command": "comando", - "version": "versión", - "command-arg": "argumento-de-comando", - "command-string": "texto-de-comando", - "shell": "shell", - "package": "paquete", - "npx: installed %s in %ss": "npx: instaló %s en %ss", - "Suppress output from npx itself. Subcommands will not be affected.": "Suprimir producción de npx. Sub-comandos no serán afectados." -} diff --git a/deps/npm/node_modules/libnpx/locales/fr.json b/deps/npm/node_modules/libnpx/locales/fr.json deleted file mode 100644 index 949ba9bb8e6083..00000000000000 --- a/deps/npm/node_modules/libnpx/locales/fr.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "Execute binaries from npm packages.\n%s": "Exécutez des binaires à partir de paquets npm.\n%s", - "Package to be installed.": "Paquet à installer.", - "Location of the npm cache.": "Chemin où est situé le cache de npm.", - "Skip installation if a package is missing.": "Passer l'installation si un paquet est manquant.", - "Path to user npmrc.": "Chemin du fichier npmrc de l'utilisateur(-trice).", - "Execute string as if inside `npm run-script`.": "Exécuter la chaine de caractère comme avec `npm run-script`.", - "Shell to execute the command with, if any.": "Shell à utiliser pour exécuter la commande, s'il y en a un.", - "Generate shell code to use npx as the \"command not found\" fallback.": "Générer le code du shell pour utiliser npx comme solution de rechange à \"command not found\".", - "Ignores existing binaries in $PATH, or in the local project. This forces npx to do a temporary install and use the latest version.": "Ignorer les binaires dans le $PATH ou dans le projet local. Cela force npm à réaliser une installation temporaire et à utiliser la dernière version.", - "npm binary to use for internal operations.": "Binaire de npm à utiliser pour les opérations internes.", - "For the full documentation, see the manual page for npx(1).": "Pour la documentation complète, consultez la page du manuel pour npx(1).", - "Unable to guess a binary name from %s. Please use --package.": "Impossible de deviner le nom du binaire de %s, utilisez --package s'il vous plaît.", - "\nERROR: You must supply a command.\n": "\nERREUR : Vous devez fournir une commande.\n", - "Command failed: %s %s": "La commande a échoué : %s %s", - "Install for %s failed with code %s": "L'installation de %s a échoué avec le code %s", - "%s not found. Trying with npx...": "%s n'a pas été trouvé. Essai avec npx...", - "command not found: %s": "Commande non trouvée : %s", - "options": "options", - "command": "commande", - "version": "version", - "command-arg": "arguments-de-la-commande", - "command-string": "chaîne-de-caractères-de-la-commande", - "shell": "shell", - "package": "paquet", - "npx: installed %s in %ss": "npx : %s installé(s) en %ss", - "Suppress output from npx itself. Subcommands will not be affected.": "Supprimer la sortie générée par npx. Les sous-commandes ne seront pas affectées." -} diff --git a/deps/npm/node_modules/libnpx/locales/id.json b/deps/npm/node_modules/libnpx/locales/id.json deleted file mode 100644 index 1e3e29fa5b1476..00000000000000 --- a/deps/npm/node_modules/libnpx/locales/id.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "Execute binaries from npm packages.\n%s": "Jalankan berkas-berkas binari darpi paket-paket npm.\n%s", - "Package to be installed.": "Paket yang akan dipasang.", - "Location of the npm cache.": "Lokasi dari cache npm.", - "Skip installation if a package is missing.": "Lewati pemasangan jika paket tidak ditemukan.", - "Path to user npmrc.": "Jalur ke npmrc milik pengguna.", - "Execute string as if inside `npm run-script`.": "Jalankan string seperti ada di dalam `npm run-script`.", - "Shell to execute the command with, if any.": "Shell untuk menjalankan sebuah perintah, jika ada.", - "Generate shell code to use npx as the \"command not found\" fallback.": "Membangkitkan kode shell untuk menggunakan npx sebagai cadangan dari \"perintah tidak ditemukan\" .", - "Ignores existing binaries in $PATH, or in the local project. This forces npx to do a temporary install and use the latest version.": "Jangan hiraukan berkas-berkas binari yang ada di $PATH, atau yang ada di proyek lokal. Ini memaksa npx untuk melakukan pemasangan sementara dan menggunakan versi yang terakhir.", - "npm binary to use for internal operations.": "Binari npm yang digunakan untuk operasi internal.", - "For the full documentation, see the manual page for npx(1).": "Untuk dokumentasi lengkap, mohon baca laman manual untuk npx(1).", - "Unable to guess a binary name from %s. Please use --package.": "Tidak dapat menebak nama binari dari %s. Mohon gunakan --package.", - "\nERROR: You must supply a command.\n": "\nGALAT: Anda harus menyediakan sebuah perintah.\n", - "Command failed: %s %s": "Perintah tidak berhasil: %s %s", - "Install for %s failed with code %s": "Pemasangan untuk %s tidak berhasil dengan kode %s", - "%s not found. Trying with npx...": "%s tidak ditemukan. Mencoba dengan npx...", - "command not found: %s": "Perintah tidak ditemukan: %s", - "options": "opsi-opsi", - "command": "perintah", - "version": "versi", - "command-arg": "arg-perintah", - "command-string": "string-perintah", - "shell": "shell", - "package": "paket", - "npx: installed %s in %ss": "npx: %s terpasang di %ss", - "Suppress output from npx itself. Subcommands will not be affected.": "Hilangkan keluaran dari npx itu sendiri. Sub-sub perintah tidak akan terpengaruh.", - "Extra node argument when calling a node binary.": "Argumen node ekstra ketika memanggil binari node." -} \ No newline at end of file diff --git a/deps/npm/node_modules/libnpx/locales/it.json b/deps/npm/node_modules/libnpx/locales/it.json deleted file mode 100644 index 24e72b49195816..00000000000000 --- a/deps/npm/node_modules/libnpx/locales/it.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "Execute binaries from npm packages.\n%s": "Esegui il binario del pacchetto npm.\n%s", - "Package to be installed.": "Pacchetto da installare.", - "Location of the npm cache.": "Percorso della cache npm.", - "Skip installation if a package is missing.": "Salta l'installazione se un pacchetto non è disponibile.", - "Path to user npmrc.": "Percorso utente per npmrc.", - "Execute string as if inside `npm run-script`.": "Esegui l'argomento come se fosse all'interno di `npm run-script`.", - "Shell to execute the command with, if any.": "Shell con cui eseguire il comando, se presente.", - "Generate shell code to use npx as the \"command not found\" fallback.": "Generare un codice di shell per usare npx come ripiego quando il comando non esiste.", - "Ignores existing binaries in $PATH, or in the local project. This forces npx to do a temporary install and use the latest version.": "Ignora i binari esistenti in $PATH, oppure nel progetto locale. Questo forza temporaneamente npx a installare e usare l'ultima versione.", - "npm binary to use for internal operations.": "Binario npm da usare per le operazioni interne.", - "For the full documentation, see the manual page for npx(1).": "Per la documentazione completa, vedere la pagina del manuale npx(1).", - "Unable to guess a binary name from %s. Please use --package.": "Impossibile supporre il nome del binario da %s. Prego usare --package.", - "\nERROR: You must supply a command.\n": "\nERRORE: E necessario fornire un comando.\n", - "Command failed: %s %s": "Comando fallito: %s %s", - "Install for %s failed with code %s": "Installazione di %s fallita con codice %s", - "%s not found. Trying with npx...": "%s non trovato. Prova con npx...", - "command not found: %s": "comando non trovato: %s", - "options": "opzioni", - "command": "comando", - "version": "versione", - "command-arg": "argomento-del-comando", - "command-string": "stringa-di-comando", - "shell": "shell", - "package": "pacchetto", - "npx: installed %s in %ss": "npx: installato %s in %ss", - "Suppress output from npx itself. Subcommands will not be affected.": "Sopprimere l'output da npx stesso. I sottocomandi non saranno interessati." -} diff --git a/deps/npm/node_modules/libnpx/locales/ja.json b/deps/npm/node_modules/libnpx/locales/ja.json deleted file mode 100644 index e575edabedfc1d..00000000000000 --- a/deps/npm/node_modules/libnpx/locales/ja.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "Execute binaries from npm packages.\n%s": "npmパッケージのバイナリを実行します。", - "Package to be installed.": "インストールするパッケージ。", - "Location of the npm cache.": "npmのキャッシュへのパス。", - "Skip installation if a package is missing.": "パッケージがない場合は、インストールをスキップします。", - "Path to user npmrc.": "ユーザーのnpmrcへのパス。", - "Execute string as if inside `npm run-script`.": "「npm run-script」の内部にあるかのように文字列を実行します。", - "Shell to execute the command with, if any.": "コマンドを実行するシェル(存在する場合)。", - "Generate shell code to use npx as the \"command not found\" fallback.": "\"コマンドが見つかりません\" フォールバックとして使用するコードを生成します。", - "Ignores existing binaries in $PATH, or in the local project. This forces npx to do a temporary install and use the latest version.": "$PATH、または既存のローカルプロジェクトのバイナリを無視します。 これにより、npxは一時的にインストールを行い、最新バージョンを使用します。", - "npm binary to use for internal operations.": "npmのバイナリを内部操作に使用します。", - "For the full documentation, see the manual page for npx(1).": "詳しくは、npx(1)のマニュアルページを参照してください。", - "Unable to guess a binary name from %s. Please use --package.": "%sからバイナリ名を推測できません。 --packageを使用してください。", - "\nERROR: You must supply a command.\n": "\nエラー: コマンドを入力する必要があります。\n", - "Command failed: %s %s": "コマンドが失敗しました: %s %s", - "Install for %s failed with code %s": "コード%sで%sのインストールに失敗しました", - "%s not found. Trying with npx...": "%sが見つかりません。 npxで試してみて...", - "command not found: %s": "コマンドが見つかりません: %s", - "options": "オプション", - "command": "コマンド", - "version": "バージョン", - "command-arg": "コマンドの引数", - "command-string": "コマンドの文字列", - "shell": "シェル", - "package": "パッケージ", - "npx: installed %s in %ss": "npx: %s個のパッケージを%s秒でインストールしました。", - "Suppress output from npx itself. Subcommands will not be affected.": "npx自体の標準出力を抑止します。 サブコマンドは影響を受けません。" -} diff --git a/deps/npm/node_modules/libnpx/locales/ko.json b/deps/npm/node_modules/libnpx/locales/ko.json deleted file mode 100644 index 0e9917df99ca55..00000000000000 --- a/deps/npm/node_modules/libnpx/locales/ko.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "Execute binaries from npm packages.\n%s": "npm 패키지에서 바이너리를 실행합니다.\n%s", - "Package to be installed.": "설치할 패키지.", - "Location of the npm cache.": "npm 캐시의 위치.", - "Skip installation if a package is missing.": "패키지가 없으면 설치를 건너뜁니다.", - "Path to user npmrc.": "사용자 npmrc의 경로.", - "Execute string as if inside `npm run-script`.": "문자열이 `npm run-script`안에 있는 것처럼 실행합니다.", - "Shell to execute the command with, if any.": "명령을 실행할 셸 (존재하는 경우).", - "Generate shell code to use npx as the \"command not found\" fallback.": "\"명령을 찾을 수 없습니다\" 대신 npx가 사용되도록 셸 코드를 생성합니다.", - "Ignores existing binaries in $PATH, or in the local project. This forces npx to do a temporary install and use the latest version.": "$PATH나 로컬 프로젝트에 있는 바이너리를 무시합니다. 이는 npx가 최신 버전을 임시로 설치해서 사용하도록 강제합니다.", - "npm binary to use for internal operations.": "내부 작업에 사용할 npm 바이너리.", - "For the full documentation, see the manual page for npx(1).": "전체 문서는 npx(1) 매뉴얼 페이지를 보세요.", - "Unable to guess a binary name from %s. Please use --package.": "%s에서 바이너리 이름을 추측할 수 없습니다. --package를 사용해 주세요.", - "\nERROR: You must supply a command.\n": "\nERROR: 명령을 제공해야 합니다.\n", - "Command failed: %s %s": "명령이 실패했습니다: %s %s", - "Install for %s failed with code %s": "%s 설치가 오류 코드 %s로 실패했습니다", - "%s not found. Trying with npx...": "%s 을 찾을 수 없습니다. npx로 시도합니다...", - "command not found: %s": "명령을 찾을 수 없습니다: %s", - "options": "옵션", - "command": "명령", - "version": "버전", - "command-arg": "명령-인자", - "command-string": "명령-문자열", - "shell": "셸", - "package": "패키지", - "npx: installed %s in %ss": "npx: %s개의 패키지를 %s초만에 설치했습니다.", - "Suppress output from npx itself. Subcommands will not be affected.": "npx의 출력을 감춥니다. 하위 명령은 영향을 받지 않습니다.", - "Extra node argument when calling a node binary.": "node 바이너리를 호출할 때 사용하는 추가 node 인자." -} diff --git a/deps/npm/node_modules/libnpx/locales/nb.json b/deps/npm/node_modules/libnpx/locales/nb.json deleted file mode 100644 index 5b3fa42788d3bf..00000000000000 --- a/deps/npm/node_modules/libnpx/locales/nb.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "Execute binaries from npm packages.\n%s": "Kjør binærfiler fra npm-pakker.\n%s", - "Package to be installed.": "Pakken som skal installeres.", - "Location of the npm cache.": "Hvor npm-cachen er.", - "Skip installation if a package is missing.": "La være å installere dersom pakken mangler.", - "Path to user npmrc.": "Sti til brukerens npmrc.", - "Execute string as if inside `npm run-script`.": "Kjør streng som om den var inni `npm run-script`.", - "Shell to execute the command with, if any.": "Skall å kjøre kommandoen med, hvis noe.", - "Generate shell code to use npx as the \"command not found\" fallback.": "Generer skallkode for å bruke npx som \"kommandoen finnes ikke\" fallback.", - "Ignores existing binaries in $PATH, or in the local project. This forces npx to do a temporary install and use the latest version.": "Ignorerer eksisterende binærfiler i $PATH eller i det lokale prosjektet. Dette tvinger npx til å installere siste versjon av pakken midlertidig.", - "npm binary to use for internal operations.": "npm-binærfil som skal brukes for interne operasjoner.", - "For the full documentation, see the manual page for npx(1).": "For hele dokumentasjonen, se brukermanualen for npx(1).", - "Unable to guess a binary name from %s. Please use --package.": "Klarer ikke å gjette en binærfils navn ut fra %s. Vennligst bruk --package.", - "\nERROR: You must supply a command.\n": "\nFEIL: Du må legge ved en kommando.\n", - "Command failed: %s %s": "Kommando feilet: %s %s", - "Install for %s failed with code %s": "Installasjon for %s feilet med kode %s", - "%s not found. Trying with npx...": "Kunne ikke finne%s. Prøver med npx...", - "command not found: %s": "kommando ikke funnet: %s", - "options": "innstillinger", - "command": "kommando", - "version": "versjon", - "command-arg": "kommando-argument", - "command-string": "kommando-streng", - "shell": "skall", - "package": "pakke", - "npx: installed %s in %ss": "npx: installerte %s på %ss", - "Suppress output from npx itself. Subcommands will not be affected.": "Skjul kommandoer fra npx. Sub-kommandoer vil ikke berøres.", - "Extra node argument when calling a node binary.": "Ekstra node-argument når en node-binærfil blir kalt." -} diff --git a/deps/npm/node_modules/libnpx/locales/nl.json b/deps/npm/node_modules/libnpx/locales/nl.json deleted file mode 100644 index 31fe4078566148..00000000000000 --- a/deps/npm/node_modules/libnpx/locales/nl.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "Execute binaries from npm packages.\n%s": "Voer een programma van een npm package uit.\n%s", - "Package to be installed.": "De te installeren package.", - "Location of the npm cache.": "Plaats van de npm cache.", - "Skip installation if a package is missing.": "Sla installatie over als een package nog niet geïnstalleerd is.", - "Path to user npmrc.": "Pad naar je npmrc.", - "Execute string as if inside `npm run-script`.": "Voer de tekst uit, alsof het `npm run-script` was.", - "Shell to execute the command with, if any.": "De shell te gebruiken met dit commando, indien nodig.", - "Generate shell code to use npx as the \"command not found\" fallback.": "Genereer shell-code als vervanging bij \"command not found\".", - "Ignores existing binaries in $PATH, or in the local project. This forces npx to do a temporary install and use the latest version.": "Negeer bestaande programmas in $PATH, of in het lokale prject. Dit forceert npx om een tijdelijke installatie te doen en de laatste versie te gebruiken.", - "npm binary to use for internal operations.": "npm programma te gebuiken voor interne operaties.", - "For the full documentation, see the manual page for npx(1).": "Voor de volledige documentatie, raadpleeg de man pagina van npx(1).", - "Unable to guess a binary name from %s. Please use --package.": "Vond geen programmanaam voor %S. Probeer opnieuw met --package.", - "\nERROR: You must supply a command.\n": "\nFOUT: Je moet een commando ingeven.\n", - "Command failed: %s %s": "Commando mislukt: %s %s", - "Install for %s failed with code %s": "De installatie van %s is mislukt met code %s", - "%s not found. Trying with npx...": "%s werd niet gevonden. Probeert nu met npx…", - "command not found: %s": "programma werd niet gevonden in %s", - "options": "opties", - "command": "commando", - "version": "versie", - "command-arg": "commandoargumenten", - "command-string": "commandotekst", - "shell": "shell", - "package": "package", - "npx: installed %s in %ss": "npx: heeft %s in %ss geïnstalleerd", - "Suppress output from npx itself. Subcommands will not be affected.": "Geef geen uitvoer voor npx zelf. Heeft geen invoed op subcommando's", - "Extra node argument when calling a node binary.": "Extra argumenten voor node, wanner een node-programma gebruikt wordt" -} diff --git a/deps/npm/node_modules/libnpx/locales/nn.json b/deps/npm/node_modules/libnpx/locales/nn.json deleted file mode 100644 index de23e798ef130a..00000000000000 --- a/deps/npm/node_modules/libnpx/locales/nn.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "Execute binaries from npm packages.\n%s": "Køyr binærfiler frå npm-pakkar.\n%s", - "Package to be installed.": "Pakken som skal bli installert.", - "Location of the npm cache.": "Kvar npm-mellomlagringa ligg.", - "Skip installation if a package is missing.": "La være å installere viss pakken manglar.", - "Path to user npmrc.": "Sti til brukaren sin npmrc-fil.", - "Execute string as if inside `npm run-script`.": "Køyr streng som om den var inni `npm run-script`.", - "Shell to execute the command with, if any.": "Skall å køyre kommandoen med, viss noe.", - "Generate shell code to use npx as the \"command not found\" fallback.": "Generer skallkode for å bruke npx som \"kommandoen finst ikkje\" fallback.", - "Ignores existing binaries in $PATH, or in the local project. This forces npx to do a temporary install and use the latest version.": "Ignorerer eksisterende binærfilar i $PATH eller i det lokale prosjektet. Dette tvingar npx til å installere siste versjon av pakken midlertidig.", - "npm binary to use for internal operations.": "npm-binærfil som skal brukes for interne operasjonar.", - "For the full documentation, see the manual page for npx(1).": "For heile dokumentasjonen, sjå brukarmanualen for npx(1).", - "Unable to guess a binary name from %s. Please use --package.": "Klarar ikkje å gjette ein binærfil sitt namn ut frå %s. Vennligst bruk --package.", - "\nERROR: You must supply a command.\n": "\nFEIL: Du må legge ved ein kommando.\n", - "Command failed: %s %s": "Kommando feilte: %s %s", - "Install for %s failed with code %s": "Installasjon for %s feilte med kode %s", - "%s not found. Trying with npx...": "Kunne ikkje finne%s. Prøver med npx...", - "command not found: %s": "kommando ikkje funnet: %s", - "options": "innstillinger", - "command": "kommando", - "version": "versjon", - "command-arg": "kommando-argument", - "command-string": "kommando-streng", - "shell": "skall", - "package": "pakke", - "npx: installed %s in %ss": "npx: installerte %s på %ss", - "Suppress output from npx itself. Subcommands will not be affected.": "Skjul kommandoer frå npx. Sub-kommandoer vil ikkje rørast.", - "Extra node argument when calling a node binary.": "Ekstra node-argument når ein node-binærfil blir kalt." - } - \ No newline at end of file diff --git a/deps/npm/node_modules/libnpx/locales/no.json b/deps/npm/node_modules/libnpx/locales/no.json deleted file mode 100644 index 5b3fa42788d3bf..00000000000000 --- a/deps/npm/node_modules/libnpx/locales/no.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "Execute binaries from npm packages.\n%s": "Kjør binærfiler fra npm-pakker.\n%s", - "Package to be installed.": "Pakken som skal installeres.", - "Location of the npm cache.": "Hvor npm-cachen er.", - "Skip installation if a package is missing.": "La være å installere dersom pakken mangler.", - "Path to user npmrc.": "Sti til brukerens npmrc.", - "Execute string as if inside `npm run-script`.": "Kjør streng som om den var inni `npm run-script`.", - "Shell to execute the command with, if any.": "Skall å kjøre kommandoen med, hvis noe.", - "Generate shell code to use npx as the \"command not found\" fallback.": "Generer skallkode for å bruke npx som \"kommandoen finnes ikke\" fallback.", - "Ignores existing binaries in $PATH, or in the local project. This forces npx to do a temporary install and use the latest version.": "Ignorerer eksisterende binærfiler i $PATH eller i det lokale prosjektet. Dette tvinger npx til å installere siste versjon av pakken midlertidig.", - "npm binary to use for internal operations.": "npm-binærfil som skal brukes for interne operasjoner.", - "For the full documentation, see the manual page for npx(1).": "For hele dokumentasjonen, se brukermanualen for npx(1).", - "Unable to guess a binary name from %s. Please use --package.": "Klarer ikke å gjette en binærfils navn ut fra %s. Vennligst bruk --package.", - "\nERROR: You must supply a command.\n": "\nFEIL: Du må legge ved en kommando.\n", - "Command failed: %s %s": "Kommando feilet: %s %s", - "Install for %s failed with code %s": "Installasjon for %s feilet med kode %s", - "%s not found. Trying with npx...": "Kunne ikke finne%s. Prøver med npx...", - "command not found: %s": "kommando ikke funnet: %s", - "options": "innstillinger", - "command": "kommando", - "version": "versjon", - "command-arg": "kommando-argument", - "command-string": "kommando-streng", - "shell": "skall", - "package": "pakke", - "npx: installed %s in %ss": "npx: installerte %s på %ss", - "Suppress output from npx itself. Subcommands will not be affected.": "Skjul kommandoer fra npx. Sub-kommandoer vil ikke berøres.", - "Extra node argument when calling a node binary.": "Ekstra node-argument når en node-binærfil blir kalt." -} diff --git a/deps/npm/node_modules/libnpx/locales/pl.json b/deps/npm/node_modules/libnpx/locales/pl.json deleted file mode 100644 index 6cf93db525d2f6..00000000000000 --- a/deps/npm/node_modules/libnpx/locales/pl.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "Execute binaries from npm packages.\n%s": "Uruchamia pliki wykonywalne (binarki) z paczek npm.\n%s", - "Package to be installed.": "Paczka do zainstalowania.", - "Location of the npm cache.": "Lokalizacja cache npm.", - "Skip installation if a package is missing.": "Pomiń instalacje w przypadku braku paczki.", - "Path to user npmrc.": "Ścieżka do pliku npmrc.", - "Execute string as if inside `npm run-script`.": "Wykonaj polecenie jak gdyby znajdowało się w `npm run-script`.", - "Shell to execute the command with, if any.": "Shell do wykonania polecenia, jeśli potrzeba.", - "Generate shell code to use npx as the \"command not found\" fallback.": "Wynegeruj kod dla shell-a aby używać npx zamiast \"nie znaleziono polecenia\".", - "Ignores existing binaries in $PATH, or in the local project. This forces npx to do a temporary install and use the latest version.": "Ignoruje istniejące paczki w $PATH lub lokalnym projekcie. Wymusza na npx tymczasową instalację i użycie najnowszej wersji.", - "npm binary to use for internal operations.": "Ścieżka do binarki npm używanej przez npx.", - "For the full documentation, see the manual page for npx(1).": "Dla pełnej dokumentacji zobacz manual dla npx(1).", - "Unable to guess a binary name from %s. Please use --package.": "Nie udało się ustalić binarki dla %s. Proszę użyć --package.", - "\nERROR: You must supply a command.\n": "\nERROR: Musisz podać polecenie.\n", - "Command failed: %s %s": "Polecenie się nie powiodło: %s %s", - "Install for %s failed with code %s": "Instalacja %s nie udała się, kod błędu: %s", - "%s not found. Trying with npx...": "%s: nie znaleziono polecenia. Próba uruchomienia przy użyciu npx...", - "command not found: %s": "nie znaleziono polecenia: %s", - "options": "opcje", - "command": "polecenie", - "version": "wersja", - "command-arg": "argument polecenia", - "command-string": "tekst polecenia", - "shell": "shell", - "package": "paczka", - "npx: installed %s in %ss": "npx: zainstalowano %s w %ss", - "Suppress output from npx itself. Subcommands will not be affected.": "Wycisza wyjście z npx. Nie dotyczy podprocesów.", - "Extra node argument when calling a node binary.": "Dodatkowe argumenty przekazywane do node." -} \ No newline at end of file diff --git a/deps/npm/node_modules/libnpx/locales/pt_BR.json b/deps/npm/node_modules/libnpx/locales/pt_BR.json deleted file mode 100644 index b44f4e0260061b..00000000000000 --- a/deps/npm/node_modules/libnpx/locales/pt_BR.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "Execute binaries from npm packages.\n%s": "Executa comandos de módulos npm.\n%s", - "Package to be installed.": "Pacote para ser instalado.", - "Location of the npm cache.": "Localização da cache npm.", - "Skip installation if a package is missing.": "Pular instalação se um pacote está faltando.", - "Path to user npmrc.": "Localização do npmrc do usuário.", - "Execute string as if inside `npm run-script`.": "Executa string como se estivesse dentro de `npm run-script`.", - "Shell to execute the command with, if any.": "Terminal para executar o comando, se tiver.", - "Generate shell code to use npx as the \"command not found\" fallback.": "Gera código de terminal para usar npx no lugar quando comando não existir (\"command not found\").", - "Ignores existing binaries in $PATH, or in the local project. This forces npx to do a temporary install and use the latest version.": "Ignora comandos no $PATH ou no projeto atual. Isto obriga npx a fazer uma instalação temporária e usar a última versão.", - "npm binary to use for internal operations.": "Comando npm usado para operações internas.", - "For the full documentation, see the manual page for npx(1).": "Para documentação completa, veja a página do manual npx(1).", - "Unable to guess a binary name from %s. Please use --package.": "Não foi possível advinhar o nome do comando usando %s. Por favor, use --package.", - "\nERROR: You must supply a command.\n": "\nERRO: Você deve suprir um comando.\n", - "Command failed: %s %s": "Comando fracassou: %s %s", - "Install for %s failed with code %s": "Instalação de %s falhou com código %s", - "%s not found. Trying with npx...": "%s não existe. Tentando com npx...", - "command not found: %s": "comando não existe: %s", - "options": "opções", - "command": "comando", - "version": "versão", - "command-arg": "argumento-de-comando", - "command-string": "string-de-comando", - "shell": "terminal", - "package": "pacote", - "npx: installed %s in %ss": "npx: instalou %s em %ss", - "Suppress output from npx itself. Subcommands will not be affected.": "Omitir resultado de npx. Sub-comandos não serão afetados." -} diff --git a/deps/npm/node_modules/libnpx/locales/ro.json b/deps/npm/node_modules/libnpx/locales/ro.json deleted file mode 100644 index b6c15d6af4863c..00000000000000 --- a/deps/npm/node_modules/libnpx/locales/ro.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "Execute binaries from npm packages.\n%s": "Rulează executabilele binare din pachetele npm.\n%s", - "Package to be installed.": "Pachetul care va fi instalat.", - "Location of the npm cache.": "Locația cache-ului npm.", - "Skip installation if a package is missing.": "Sari peste instalare dacă lipsește un pachet.", - "Path to user npmrc.": "Calea către fișierul npmrc al utilizatorului.", - "Execute string as if inside `npm run-script`.": "Execută string-ul ca și cum ar fi în `npm run-script`.", - "Shell to execute the command with, if any.": "Shell-ul cu care să fie executată comandă, dacă există.", - "Generate shell code to use npx as the \"command not found\" fallback.": "Generează cod shell pentru a folosi npx drept fallback pentru \"comanda nu a fost găsită\".", - "Ignores existing binaries in $PATH, or in the local project. This forces npx to do a temporary install and use the latest version.": "Ignoră executabilele binare existente din $PATH, sau din proiectul local. Aceasta forțează npx să facă o instalare temporară și să folosească ultima versiune.", - "npm binary to use for internal operations.": "Executabilul binar npm care să fie folosit pentru operaţiunile interne.", - "For the full documentation, see the manual page for npx(1).": "Pentru documentația completă, vedeți pagina de manual pentru npx(1).", - "Unable to guess a binary name from %s. Please use --package.": "Imposibil de ghicit numele executabilului binar pentru %s. Vă rugăm folosiți --package.", - "\nERROR: You must supply a command.\n": "\nEROARE: Trebuie să specifici o comandă.\n", - "Command failed: %s %s": "Comanda a eșuat: %s %s", - "Install for %s failed with code %s": "Procesul de instalare pentru %s a eșuat cu codul %s", - "%s not found. Trying with npx...": "%s nu a fost găsită. Încercare cu npx...", - "command not found: %s": "comanda nu a fost găsită: %s", - "options": "opțiuni", - "command": "comandă", - "version": "versiune", - "command-arg": "comandă-argument", - "command-string": "comandă-string", - "shell": "shell", - "package": "pachet", - "npx: installed %s in %ss": "npx: instalat %s în %ss", - "Suppress output from npx itself. Subcommands will not be affected.": "Suprimă outputul de la npx însăși. Subcomenzile nu vor fi afectate." -} diff --git a/deps/npm/node_modules/libnpx/locales/ru.json b/deps/npm/node_modules/libnpx/locales/ru.json deleted file mode 100644 index 801aeb58bb7e20..00000000000000 --- a/deps/npm/node_modules/libnpx/locales/ru.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "Execute binaries from npm packages.\n%s": "Выполняйте скрипты из npm пакетов.\n%s", - "Package to be installed.": "Пакет, который будет установлен.", - "Location of the npm cache.": "Расположение npm кеша.", - "Skip installation if a package is missing.": "Пропустить установку, если пакет отсутствует.", - "Path to user npmrc.": "Передать пользователя в npmrc.", - "Execute string as if inside `npm run-script`.": "Выполнить скрипт как внутри `npm run-script`.", - "Shell to execute the command with, if any.": "Shell, чтобы выполнить команду, если необходимо.", - "Generate shell code to use npx as the \"command not found\" fallback.": "Создает код для shell, чтобы использовать npx при \"command not found\".", - "Ignores existing binaries in $PATH, or in the local project. This forces npx to do a temporary install and use the latest version.": "Игнорирует все существующие скрипты в $PATH или локальном проекте. Что заставляет npx использовать временную установку и использовать последние версии.", - "npm binary to use for internal operations.": "npm файл для использования во внутренних операциях.", - "For the full documentation, see the manual page for npx(1).": "Полная документация доступна в мануале npx(1).", - "Unable to guess a binary name from %s. Please use --package.": "Невозможно угадать команду из %s. Пожалуйста, используйте --package.", - "\nERROR: You must supply a command.\n": "\nERROR: Нужно указать команду.\n", - "Command failed: %s %s": "Ошибка: %s %s", - "Install for %s failed with code %s": "Установка %s завершилась с кодом ошибки %s", - "%s not found. Trying with npx...": "%s не найдено. Пробуем с npx...", - "command not found: %s": "команда не найдена: %s", - "options": "опции", - "command": "команда", - "version": "версия", - "command-arg": "аргумент", - "command-string": "команда-строка", - "shell": "shell", - "package": "пакет", - "npx: installed %s in %ss": "npx: установлен %s в %ss", - "Suppress output from npx itself. Subcommands will not be affected.": "Отключить вывод npx. Поведение подкоманд не будет изменено." -} diff --git a/deps/npm/node_modules/libnpx/locales/sr.json b/deps/npm/node_modules/libnpx/locales/sr.json deleted file mode 100644 index 467e380df61ccf..00000000000000 --- a/deps/npm/node_modules/libnpx/locales/sr.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "Execute binaries from npm packages.\n%s": "Izvršavam binarne pakete iz npm packages.\n%s", - "Package to be installed.": "Paket će biti instaliran.", - "Location of the npm cache.": "Lokacija npm keša.", - "Skip installation if a package is missing.": "Preskoci instalaciju ako paket nedostaje.", - "Path to user npmrc.": "Putanja do korisnikovog npmrc.", - "Execute string as if inside `npm run-script`.": "Izvrši string kao da se nalazi unutar `npm run-script`.", - "Shell to execute the command with, if any.": "Skripta izvršava komandu sa, ako postoji.", - "Generate shell code to use npx as the \"command not found\" fallback.": "Napravi kod u Terminalu koji će koristiti npx kao zamenu za \"komanda nije pronađena\".", - "Ignores existing binaries in $PATH, or in the local project. This forces npx to do a temporary install and use the latest version.": "Ignoriše postojeće binarne pakete u $PATH, ili u lokalnom projektu. Ovo će naterati npx da izvrši privremenu instalaciju i koristi najnoviju verziju.", - "npm binary to use for internal operations.": "npm binarni paket za upotrebu u lokalnim operacijama.", - "For the full documentation, see the manual page for npx(1).": "Za kompletnu dokumentaciju, pogledajte stranicu sa uputstvima za npx(1).", - "Unable to guess a binary name from %s. Please use --package.": "Ne možemo da pogodimo ime binarnog paketa iz %s. Molimo koristite --package.", - "\nERROR: You must supply a command.\n": "\nERROR: Morate uneti komandu.\n", - "Command failed: %s %s": "Komanda nije uspela: %s %s", - "Install for %s failed with code %s": "Instalacija za %s nije uspela sa kodom %s", - "%s not found. Trying with npx...": "%s nije pronadjen. Pokušavam sa npx...", - "command not found: %s": "komanda nije pronadjena: %s", - "options": "opcije", - "command": "komanda", - "version": "verzija", - "command-arg": "command-arg", - "command-string": "command-string", - "shell": "shell", - "package": "paket", - "npx: installed %s in %ss": "npx: instaliran %s u %ss", - "Suppress output from npx itself. Subcommands will not be affected.": "Zabranjen izlaz iz samog npx. Na podkomande neće biti uticaja..", - "Extra node argument when calling a node binary.": "Dodatni node argument kada pozivate node binarni." -} \ No newline at end of file diff --git a/deps/npm/node_modules/libnpx/locales/tr.json b/deps/npm/node_modules/libnpx/locales/tr.json deleted file mode 100644 index 58ca49dbbdf88f..00000000000000 --- a/deps/npm/node_modules/libnpx/locales/tr.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "Execute binaries from npm packages.\n%s": "npm paketlerinden program çalıştırın.\n%s", - "Package to be installed.": "Yüklenecek paketin adı.", - "Location of the npm cache.":"npm önbelleğinin yeri.", - "Skip installation if a package is missing.": "Eğer eksik paket varsa yükleme adımını atla.", - "Path to user npmrc.": "Kullanıcının npmrc dosyasının yeri.", - "Execute string as if inside `npm run-script`.": "Komutu 'npm run-script' kapsamında çalıştır.", - "Shell to execute the command with, if any.": "Komutların çalıştırılacağı shell.", - "Generate shell code to use npx as the \"command not found\" fallback.": "Komut eğer 'command not found' hatası veriyorsa, komutu npx üzerinden bir daha dene.", - "Ignores existing binaries in $PATH, or in the local project. This forces npx to do a temporary install and use the latest version.": "$PATH ve lokal projede tanımlanmış programları pas geçer. Bu sayede, npx yeni bir yükleme yapar ve en son versiyonu kullanır.", - "npm binary to use for internal operations.": "Bu programın çalıştırılmasında kullanılacak npm.", - "For the full documentation, see the manual page for npx(1).": "Tamamını okumak için 'man npx'.", - "Unable to guess a binary name from %s. Please use --package.": "%s için hangi npm paketi bilemedim. Lütfen --package kullanın.", - "\nERROR: You must supply a command.\n": "\nHATA: Argüman vermelisiniz.\n", - "Command failed: %s %s": "Komut çalıştırılamadı: %s %s", - "Install for %s failed with code %s": "%s yüklenirken %s kodlu bir hata oluştu. Yükleme sonlandırıldı.", - "%s not found. Trying with npx...": "%s bulunamadı. npx ile deniyorum...", - "command not found": "komut bulunamadı", - "options": "seçenekler", - "command": "komut", - "version": "versiyon", - "command-arg": "argümanlar", - "command-string": "argümanlar", - "shell": "shell", - "package": "paket", - "npx": "npx", - "Suppress output from npx itself. Subcommands will not be affected.": "npx çıktısını durdur. Alt komutlar etkilenmez." -} diff --git a/deps/npm/node_modules/libnpx/locales/uk.json b/deps/npm/node_modules/libnpx/locales/uk.json deleted file mode 100644 index 729a0d696daa10..00000000000000 --- a/deps/npm/node_modules/libnpx/locales/uk.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "Execute binaries from npm packages.\n%s": "Виконуйте скрипти з npm пакетів.\n%s", - "Package to be installed.": "Пакет, який буде встановлено.", - "Location of the npm cache.": "Розташування npm кешу.", - "Skip installation if a package is missing.": "Пропустити встановлення, якщо пакет відсутній.", - "Path to user npmrc.": "Шлях до npmrc файлу користувача.", - "Execute string as if inside `npm run-script`.": "Виконати рядок наче в `npm run-script`.", - "Shell to execute the command with, if any.": "Shell для виконання команди, якщо є.", - "Generate shell code to use npx as the \"command not found\" fallback.": "Генерує shell скрипт для використання npx як фолбеку для \"command not found\".", - "Ignores existing binaries in $PATH, or in the local project. This forces npx to do a temporary install and use the latest version.": "Ігнорує існуючі бінарники в $PATH, чи в локальному проекті. Це змусить npx виконати тимчасове встановлення з використанням останньої версії.", - "npm binary to use for internal operations.": "npm файл для використання у внутрішніх операціях.", - "For the full documentation, see the manual page for npx(1).": "Повну документацію дивіться в мануалі npx(1).", - "Unable to guess a binary name from %s. Please use --package.": "Неможливо визначити ім'я бінарника з %s. Будь ласка, використовуйте --package.", - "\nERROR: You must supply a command.\n": "\nПОМИЛКА: Ви повинні вказати команду.\n", - "Command failed: %s %s": "Невдала команда: %s %s", - "Install for %s failed with code %s": "Невдале встановлення %s з кодом помилки %s", - "%s not found. Trying with npx...": "%s не знайдено. Спробуємо з npx...", - "command not found: %s": "команда не знайдена: %s", - "options": "опції", - "command": "команда", - "version": "версія", - "command-arg": "команда-аргумент", - "command-string": "команда-рядок", - "shell": "shell", - "package": "пакет", - "npx: installed %s in %ss": "npx: встановлено %s за %sс", - "Suppress output from npx itself. Subcommands will not be affected.": "Вимкнути вивід npx. Поведінка підкоманд не буде змінена.", - "Extra node argument when calling a node binary.": "Додатковий node аргумент під час виклику node бібліотеки." -} diff --git a/deps/npm/node_modules/libnpx/locales/zh_CN.json b/deps/npm/node_modules/libnpx/locales/zh_CN.json deleted file mode 100644 index 92b61186cb6b32..00000000000000 --- a/deps/npm/node_modules/libnpx/locales/zh_CN.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "Execute binaries from npm packages.\n%s": "从 npm 的可执行包执行命令\n%s", - "Package to be installed.": "包安装的路径", - "Location of the npm cache.": "npm 缓存路径", - "Skip installation if a package is missing.": "如果有包缺失,跳过安装", - "Path to user npmrc.": "当前用户的 npmrc 路径", - "Execute string as if inside `npm run-script`.": "像执行 `npm run-script` 一样执行一个字符串", - "Shell to execute the command with, if any.": "执行命令用到的解释器,可选", - "Generate shell code to use npx as the \"command not found\" fallback.": "产生“找不到命令”的错误码", - "Ignores existing binaries in $PATH, or in the local project. This forces npx to do a temporary install and use the latest version.": "忽略 $PATH 或工程里已有的可执行文件,这会强制使 npx 临时安装一次,并且使用其最新的版本", - "npm binary to use for internal operations.": "为了执行内部操作的 npm 可执行文件", - "For the full documentation, see the manual page for npx(1).": "可以通过 npx(1) 的手册找到完整说明文档", - "Unable to guess a binary name from %s. Please use --package.": "无法推测出可执行文件名的来源 %s,请使用 --package", - "\nERROR: You must supply a command.\n": "\n错误:您必须提供一个命令\n", - "Command failed: %s %s": "执行失败:%s %s", - "Install for %s failed with code %s": "安装 %s 失败,错误代码:%s", - "%s not found. Trying with npx...": "找不到 %s,请尝试使用 npx...", - "command not found: %s": "找不到命令:%s", - "options": "选项", - "command": "命令", - "version": "版本", - "command-arg": "命令的参数", - "command-string": "命令的字符串", - "shell": "命令行解释器", - "package": "包", - "npx: installed %s in %ss": "npx: %s 安装成功,用时 %s 秒", - "Suppress output from npx itself. Subcommands will not be affected.": "隐藏 npx 的输出,子命令不会受到影响", - "Extra node argument when calling a node binary.": "调用 node 二进制时使用额外的 node 参数。" -} diff --git a/deps/npm/node_modules/libnpx/locales/zh_TW.json b/deps/npm/node_modules/libnpx/locales/zh_TW.json deleted file mode 100644 index 86ed27ef61ea9a..00000000000000 --- a/deps/npm/node_modules/libnpx/locales/zh_TW.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "Execute binaries from npm packages.\n%s": "從 npm 套件的執行檔執行指令\n%s", - "Package to be installed.": "套件安装的路徑", - "Location of the npm cache.": "npm 快取路徑", - "Skip installation if a package is missing.": "當套件遺失時,略過安裝", - "Path to user npmrc.": "目前使用者的 npmrc 路徑", - "Execute string as if inside `npm run-script`.": "以 `npm run-script` 的方式執行一個字串", - "Shell to execute the command with, if any.": "執行指令所使用的殼層(Shell),選用", - "Generate shell code to use npx as the \"command not found\" fallback.": "當 npx 找不到指令時,產生殼層(Shell)指令,並執行之", - "Ignores existing binaries in $PATH, or in the local project. This forces npx to do a temporary install and use the latest version.": "將會讓 npx 忽略 $PATH 環境變數或專案內已有的執行檔,並暫時安裝及使用最新版本的執行檔", - "npm binary to use for internal operations.": "指定 npx 內部執行使用的 npm 執行檔", - "For the full documentation, see the manual page for npx(1).": "參考 npx(1) 的文件以取得完整的說明", - "Unable to guess a binary name from %s. Please use --package.": "無法從 %s 推測執行檔名稱,請使用 --package 參數", - "\nERROR: You must supply a command.\n": "\n錯誤:您必須輸入一個指令\n", - "Command failed: %s %s": "指令執行失敗:%s %s", - "Install for %s failed with code %s": "安裝 %s 失敗,錯誤代碼:%s", - "%s not found. Trying with npx...": "找不到 %s,請嘗試使用 npx...", - "command not found: %s": "找不到指令:%s", - "options": "選項", - "command": "指令", - "version": "版本", - "command-arg": "指令的參數", - "command-string": "指令字串", - "shell": "殼層(Shell)", - "package": "套件", - "npx: installed %s in %ss": "npx: %s 安裝成功,花費 %s 秒", - "Suppress output from npx itself. Subcommands will not be affected.": "隱藏 npx 的輸出,不影響子指令", - "Extra node argument when calling a node binary.": "當呼叫 node 執行檔時,提供的額外參數" -} diff --git a/deps/npm/node_modules/libnpx/package.json b/deps/npm/node_modules/libnpx/package.json deleted file mode 100644 index 53073ae79a2a03..00000000000000 --- a/deps/npm/node_modules/libnpx/package.json +++ /dev/null @@ -1,105 +0,0 @@ -{ - "_from": "libnpx@10.2.4", - "_id": "libnpx@10.2.4", - "_inBundle": false, - "_integrity": "sha512-BPc0D1cOjBeS8VIBKUu5F80s6njm0wbVt7CsGMrIcJ+SI7pi7V0uVPGpEMH9H5L8csOcclTxAXFE2VAsJXUhfA==", - "_location": "/libnpx", - "_phantomChildren": {}, - "_requested": { - "type": "version", - "registry": true, - "raw": "libnpx@10.2.4", - "name": "libnpx", - "escapedName": "libnpx", - "rawSpec": "10.2.4", - "saveSpec": null, - "fetchSpec": "10.2.4" - }, - "_requiredBy": [ - "#USER", - "/" - ], - "_resolved": "https://registry.npmjs.org/libnpx/-/libnpx-10.2.4.tgz", - "_shasum": "ef0e3258e29aef2ec7ee3276115e20e67f67d4ee", - "_spec": "libnpx@10.2.4", - "_where": "/Users/claudiahdz/npm/cli", - "author": { - "name": "Kat Marchán", - "email": "kzm@sykosomatic.org" - }, - "bugs": { - "url": "https://github.com/npm/npx/issues" - }, - "bundleDependencies": false, - "config": { - "nyc": { - "exclude": [ - "node_modules/**", - "test/**" - ] - } - }, - "dependencies": { - "dotenv": "^5.0.1", - "npm-package-arg": "^6.0.0", - "rimraf": "^2.6.2", - "safe-buffer": "^5.1.0", - "update-notifier": "^2.3.0", - "which": "^1.3.0", - "y18n": "^4.0.0", - "yargs": "^14.2.3" - }, - "deprecated": false, - "description": "support library for npx -- an tool for executing npm-based packages.", - "devDependencies": { - "cross-env": "^5.1.3", - "json": "^9.0.6", - "marked-man": "^0.2.1", - "mkdirp": "^0.5.1", - "npm": "^5.7.1", - "nyc": "^11.4.1", - "require-inject": "^1.4.0", - "standard": "^11.0.0", - "standard-version": "^4.3.0", - "tacks": "^1.2.6", - "tap": "^11.1.2" - }, - "engines": { - "node": ">=4" - }, - "files": [ - "*.js", - "libnpx.1", - "locales" - ], - "homepage": "https://github.com/npm/npx#readme", - "keywords": [ - "npm", - "npm exec", - "shell", - "scripts", - "npm bin", - "cli" - ], - "license": "ISC", - "main": "index.js", - "man": [ - "./libnpx.1" - ], - "name": "libnpx", - "repository": { - "type": "git", - "url": "git+https://github.com/npm/npx.git" - }, - "scripts": { - "bin": "make bin", - "docs": "tail -n +2 README.md | marked-man --manual 'User Commands' --version \"$npm_package_name@$npm_package_version\" > $npm_package_name.1", - "postrelease": "npm publish && git push --follow-tags", - "prerelease": "npm t && npm run docs", - "pretest": "standard *.js test bin/*.js locales", - "publish-bin": "npm run bin && cd bin && npm publish", - "release": "standard-version -s", - "test": "cross-env NPX_UPDATE_LOCALE_FILES=true LC_ALL=en nyc --all -- tap -J test/*.js" - }, - "version": "10.2.4" -} diff --git a/deps/npm/node_modules/libnpx/parse-args.js b/deps/npm/node_modules/libnpx/parse-args.js deleted file mode 100644 index d655442cbb9d36..00000000000000 --- a/deps/npm/node_modules/libnpx/parse-args.js +++ /dev/null @@ -1,241 +0,0 @@ -'use strict' - -let npa -const path = require('path') - -module.exports = parseArgs -function parseArgs (argv, defaultNpm) { - argv = argv || process.argv - if (argv.length > 2 && argv[2][0] !== '-') { - // fast-path around arg parsing! Don't even need to load yargs here. - return fastPathArgs(argv, defaultNpm) - } - - npa = require('npm-package-arg') - - const parser = yargsParser(argv, defaultNpm) - - const opts = parser.getOptions() - const bools = new Set(opts.boolean) - - let cmdIndex - let hasDashDash - for (let i = 2; i < argv.length; i++) { - const opt = argv[i] - if (opt === '--') { - hasDashDash = true - break - } else if (opt === '--node-arg' || opt === '-n') { - argv[i] = `${opt}=${argv[i + 1]}` - argv.splice(i + 1, 1) - } else if (opt[0] === '-') { - if ( - // --no-install needs to be special-cased because we're abusing - // yargs a bit in order to get the --help text right. - opt !== '--no-install' && - !bools.has(opt.replace(/^--?(no-)?/i, '')) && - opt.indexOf('=') === -1 - ) { - i++ - } - } else { - cmdIndex = i - break - } - } - if (cmdIndex) { - const parsed = parser.parse(argv.slice(0, cmdIndex)) - const parsedCmd = npa(argv[cmdIndex]) - parsed.command = parsed.package && parsedCmd.type !== 'directory' - ? argv[cmdIndex] - : guessCmdName(parsedCmd) - parsed.isLocal = parsedCmd.type === 'directory' - parsed.cmdOpts = argv.slice(cmdIndex + 1) - if (typeof parsed.package === 'string') { - parsed.package = [parsed.package] - } - parsed.packageRequested = !!parsed.package - parsed.cmdHadVersion = parsed.package || parsedCmd.type === 'directory' - ? false - : parsedCmd.name !== parsedCmd.raw - const pkg = parsed.package || [argv[cmdIndex]] - parsed.p = parsed.package = pkg.map(p => npa(p).toString()) - return parsed - } else { - const parsed = parser.parse(argv) - if (typeof parsed.package === 'string') { - parsed.package = [parsed.package] - } - // -c *requires* -p, because the -c string should not be touched by npx - if (parsed.call && parsed.package) { - parsed.packageRequested = !!parsed.package - parsed.cmdHadVersion = false - const pkg = parsed.package - parsed.p = parsed.package = pkg.map(p => npa(p).toString()) - } else if (parsed.call && !parsed.package) { - parsed.packageRequested = false - parsed.cmdHadVersion = false - parsed.p = parsed.package = [] - } else if (hasDashDash) { - const splitCmd = parsed._.slice(2) - const parsedCmd = npa(splitCmd[0]) - parsed.command = parsed.package - ? splitCmd[0] - : guessCmdName(parsedCmd) - parsed.cmdOpts = splitCmd.slice(1) - parsed.packageRequested = !!parsed.package - parsed.cmdHadVersion = parsed.package - ? false - : parsedCmd.name !== parsedCmd.raw - const pkg = parsed.package || [splitCmd[0]] - parsed.p = parsed.package = pkg.map(p => npa(p).toString()) - } - return parsed - } -} - -function fastPathArgs (argv, defaultNpm) { - let parsedCmd - let pkg - if (argv[2].match(/^[a-z0-9_-]+$/i)) { - parsedCmd = { registry: true, name: argv[2], raw: argv[2] } - pkg = [`${argv[2]}@latest`] - } else { - npa = require('npm-package-arg') - parsedCmd = npa(argv[2]) - if (parsedCmd.type === 'directory') { - pkg = [] - } else { - pkg = [parsedCmd.toString()] - } - } - return { - command: guessCmdName(parsedCmd), - cmdOpts: argv.slice(3), - packageRequested: false, - isLocal: parsedCmd.type === 'directory', - cmdHadVersion: ( - parsedCmd.name !== parsedCmd.raw && - parsedCmd.type !== 'directory' - ), - package: pkg, - p: pkg, - shell: false, - noYargs: true, - npm: defaultNpm || 'npm' - } -} - -parseArgs.showHelp = () => require('yargs').showHelp() - -module.exports._guessCmdName = guessCmdName -function guessCmdName (spec) { - if (typeof spec === 'string') { - if (!npa) { npa = require('npm-package-arg') } - spec = npa(spec) - } - if (spec.scope) { - return spec.name.slice(spec.scope.length + 1) - } else if (spec.registry) { - return spec.name - } else if (spec.hosted && spec.hosted.project) { - return spec.hosted.project - } else if (spec.type === 'git') { - const match = spec.fetchSpec.match(/([a-z0-9-]+)(?:\.git)?$/i) - return match[1] - } else if (spec.type === 'directory') { - return spec.raw - } else if (spec.type === 'file' || spec.type === 'remote') { - let ext = path.extname(spec.fetchSpec) - if (ext === '.gz') { - ext = path.extname(path.basename(spec.fetchSpec, ext)) + ext - } - return path.basename(spec.fetchSpec, ext).replace(/-\d+\.\d+\.\d+(?:-[a-z0-9.\-+]+)?$/i, '') - } - - console.error(Y()`Unable to guess a binary name from ${spec.raw}. Please use --package.`) - return null -} - -function yargsParser (argv, defaultNpm) { - const usage = ` - npx [${Y()`options`}] <${Y()`command`}>[@${Y()`version`}] [${Y()`command-arg`}]... - - npx [${Y()`options`}] [-p|--package <${Y()`package`}>]... <${Y()`command`}> [${Y()`command-arg`}]... - - npx [${Y()`options`}] -c '<${Y()`command-string`}>' - - npx --shell-auto-fallback [${Y()`shell`}] - ` - - return require('yargs') - .usage(Y()`Execute binaries from npm packages.\n${usage}`) - .option('package', { - alias: 'p', - type: 'string', - describe: Y()`Package to be installed.` - }) - .option('cache', { - type: 'string', - describe: Y()`Location of the npm cache.` - }) - .option('always-spawn', { - describe: Y()`Always spawn a child process to execute the command.`, - type: 'boolean' - }) - .option('no-install', { - type: 'boolean', - describe: Y()`Skip installation if a package is missing.` - }) - .option('userconfig', { - type: 'string', - describe: Y()`Path to user npmrc.` - }) - .option('call', { - alias: 'c', - type: 'string', - describe: Y()`Execute string as if inside \`npm run-script\`.` - }) - .option('shell', { - alias: 's', - type: 'string', - describe: Y()`Shell to execute the command with, if any.`, - default: false - }) - .option('shell-auto-fallback', { - choices: ['', 'bash', 'fish', 'zsh'], - describe: Y()`Generate shell code to use npx as the "command not found" fallback.`, - requireArg: false, - type: 'string' - }) - .option('ignore-existing', { - describe: Y()`Ignores existing binaries in $PATH, or in the local project. This forces npx to do a temporary install and use the latest version.`, - type: 'boolean' - }) - .option('quiet', { - alias: 'q', - describe: Y()`Suppress output from npx itself. Subcommands will not be affected.`, - type: 'boolean' - }) - .option('npm', { - describe: Y()`npm binary to use for internal operations.`, - type: 'string', - default: defaultNpm || 'npm' - }) - .option('node-arg', { - alias: 'n', - type: 'string', - describe: Y()`Extra node argument when calling a node binary.` - }) - .version() - .alias('version', 'v') - .help() - .alias('help', 'h') - .epilogue(Y()`For the full documentation, see the manual page for npx(1).`) -} - -var _y -function Y () { - if (!_y) { _y = require('./y.js') } - return _y -} diff --git a/deps/npm/node_modules/libnpx/util.js b/deps/npm/node_modules/libnpx/util.js deleted file mode 100644 index 2f3e4003aacebb..00000000000000 --- a/deps/npm/node_modules/libnpx/util.js +++ /dev/null @@ -1,17 +0,0 @@ -'use strict' - -module.exports.promisify = promisify -function promisify (f) { - const util = require('util') - if (util.promisify) { - return util.promisify(f) - } else { - return function () { - return new Promise((resolve, reject) => { - f.apply(this, [].slice.call(arguments).concat((err, val) => { - err ? reject(err) : resolve(val) - })) - }) - } - } -} diff --git a/deps/npm/node_modules/libnpx/y.js b/deps/npm/node_modules/libnpx/y.js deleted file mode 100644 index 82fe7d8ed21b8a..00000000000000 --- a/deps/npm/node_modules/libnpx/y.js +++ /dev/null @@ -1,21 +0,0 @@ -'use strict' - -const path = require('path') -const yargs = require('yargs') -const y18n = require('y18n')({ - directory: path.join(__dirname, 'locales'), - locale: yargs.locale(), - updateFiles: process.env.NPX_UPDATE_LOCALE_FILES === 'true' -}) - -module.exports = yTag -function yTag (parts) { - let str = '' - parts.forEach((part, i) => { - str += part - if (arguments.length > i + 1) { - str += '%s' - } - }) - return y18n.__.apply(null, [str].concat([].slice.call(arguments, 1))) -} diff --git a/deps/npm/node_modules/lock-verify/LICENSE b/deps/npm/node_modules/lock-verify/LICENSE deleted file mode 100644 index 83e7c4c62903d7..00000000000000 --- a/deps/npm/node_modules/lock-verify/LICENSE +++ /dev/null @@ -1,14 +0,0 @@ -Copyright (c) 2017, 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/lock-verify/README.md b/deps/npm/node_modules/lock-verify/README.md deleted file mode 100644 index 01f0633c09b33d..00000000000000 --- a/deps/npm/node_modules/lock-verify/README.md +++ /dev/null @@ -1,22 +0,0 @@ -# lock-verify - -Report if your package.json is out of sync with your package-lock.json. - -## USAGE - -``` -const lockVerify = require('lock-verify') -lockVerify(moduleDir).then(result => { - result.warnings.forEach(w => console.error('Warning:', w)) - if (!result.status) { - result.errors.forEach(e => console.error(e)) - process.exit(1) - } -}) -``` - -As a library it's a function that takes the path to a module and returns a -promise that resolves to an object with `.status`, `.warnings` and `.errors` -properties. The first will be true if everything was ok (though warnings -may exist). If there's no `package.json` or no lockfile in `moduleDir` or they're -unreadable then the promise will be rejected. diff --git a/deps/npm/node_modules/lock-verify/index.js b/deps/npm/node_modules/lock-verify/index.js deleted file mode 100644 index cf673888faf014..00000000000000 --- a/deps/npm/node_modules/lock-verify/index.js +++ /dev/null @@ -1,81 +0,0 @@ -'use strict' -module.exports = lockVerify - -const fs = require('fs') -const path = require('path') -const npa = require('npm-package-arg') -const semver = require('semver') - -function lockVerify(check) { - if (!check) check = '.' - - const pjson = readJson(`${check}/package.json`) - let plock = readJson(`${check}/npm-shrinkwrap.json`) - .catch(() => readJson(`${check}/package-lock.json`)) - - return Promise.all([pjson, plock]).then(result => { - const pjson = result[0] - const plock = result[1] - let warnings = [] - let errors = [] - for (let type of [['dependencies'], ['devDependencies'], ['optionalDependencies', true]]) { - const deps = pjson[type[0]] - if (!deps) continue - const isOptional = type[1] - Object.keys(deps).forEach(name => { - const spec = npa.resolve(name, deps[name]) - const lock = plock.dependencies[name] - if (!lock) { - if (isOptional) { - warnings.push('Optional missing: ' + name + '@' + deps[name]) - } else { - errors.push('Missing: ' + name + '@' + deps[name]) - } - return - } - if (spec.registry) { - // Can't match tags to package-lock w/o network - if (spec.type === 'tag') return - if (spec.type === 'alias') { - const lockSpec = npa.resolve(name, lock.version) - if (!semver.satisfies(lockSpec.subSpec.fetchSpec, spec.subSpec.fetchSpec)) { - errors.push("Invalid: lock file's " + name + '@' + lock.version + ' does not satisfy ' + name + '@' + spec.rawSpec) - return - } - } else { - if (!semver.satisfies(lock.version, spec.fetchSpec)) { - errors.push("Invalid: lock file's " + name + '@' + lock.version + ' does not satisfy ' + name + '@' + spec.fetchSpec) - return - } - } - } else if (spec.type === 'git') { - // can't verify git w/o network - return - } else if (spec.type === 'remote') { - if (lock.version !== spec.fetchSpec) { - errors.push("Invalid: lock file's " + name + '@' + lock.version + ' does not satisfy ' + name + '@' + spec.fetchSpec) - return - } - } else if (spec.type === 'file' || spec.type === 'directory') { - const lockSpec = npa.resolve(name, lock.version) - if (spec.fetchSpec !== lockSpec.fetchSpec) { - errors.push("Invalid: lock file's " + name + '@' + lock.version + ' does not satisfy ' + name + '@' + deps[name]) - return - } - } else { - console.log(spec) - } - }) - } - return Promise.resolve({status: errors.length === 0, warnings: warnings, errors: errors}) - }) -} - -function readJson (file) { - return new Promise((resolve, reject) => { - fs.readFile(file, (err, content) => { - if (err) return reject(err) - return resolve(JSON.parse(content)) - }) - }) -} diff --git a/deps/npm/node_modules/lock-verify/package.json b/deps/npm/node_modules/lock-verify/package.json deleted file mode 100644 index 621c12fb76e876..00000000000000 --- a/deps/npm/node_modules/lock-verify/package.json +++ /dev/null @@ -1,62 +0,0 @@ -{ - "_from": "lock-verify@2.1.0", - "_id": "lock-verify@2.1.0", - "_inBundle": false, - "_integrity": "sha512-vcLpxnGvrqisKvLQ2C2v0/u7LVly17ak2YSgoK4PrdsYBXQIax19vhKiLfvKNFx7FRrpTnitrpzF/uuCMuorIg==", - "_location": "/lock-verify", - "_phantomChildren": {}, - "_requested": { - "type": "version", - "registry": true, - "raw": "lock-verify@2.1.0", - "name": "lock-verify", - "escapedName": "lock-verify", - "rawSpec": "2.1.0", - "saveSpec": null, - "fetchSpec": "2.1.0" - }, - "_requiredBy": [ - "#USER", - "/", - "/libcipm", - "/libnpm" - ], - "_resolved": "https://registry.npmjs.org/lock-verify/-/lock-verify-2.1.0.tgz", - "_shasum": "fff4c918b8db9497af0c5fa7f6d71555de3ceb47", - "_spec": "lock-verify@2.1.0", - "_where": "/Users/zkat/Documents/code/work/npm", - "author": { - "name": "Rebecca Turner", - "email": "me@re-becca.org", - "url": "http://re-becca.org/" - }, - "bugs": { - "url": "https://github.com/iarna/lock-verify/issues" - }, - "bundleDependencies": false, - "dependencies": { - "npm-package-arg": "^6.1.0", - "semver": "^5.4.1" - }, - "deprecated": false, - "description": "Report if your package.json is out of sync with your package-lock.json.", - "devDependencies": { - "@iarna/cli": "^1.2.0" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/iarna/lock-verify#readme", - "keywords": [], - "license": "ISC", - "main": "index.js", - "name": "lock-verify", - "repository": { - "type": "git", - "url": "git+https://github.com/iarna/lock-verify.git" - }, - "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" - }, - "version": "2.1.0" -} diff --git a/deps/npm/node_modules/lockfile/.travis.yml b/deps/npm/node_modules/lockfile/.travis.yml deleted file mode 100644 index 85318e47f48db2..00000000000000 --- a/deps/npm/node_modules/lockfile/.travis.yml +++ /dev/null @@ -1,11 +0,0 @@ -language: node_js -sudo: false -node_js: - - 8 - - 6 - - 4 -notifications: - email: false -cache: - directories: - - $HOME/.npm diff --git a/deps/npm/node_modules/lockfile/CHANGELOG.md b/deps/npm/node_modules/lockfile/CHANGELOG.md deleted file mode 100644 index 82cb74655206cc..00000000000000 --- a/deps/npm/node_modules/lockfile/CHANGELOG.md +++ /dev/null @@ -1,109 +0,0 @@ -# Changes - - -## 1.0.4 - -* test parallel -* upgrade tap -* upgrade node versions in travis.yml -* Use signal-exit package to detect exit instead of process.on('exit') -* added some debugging lines - -## v1.0.3 - -* handle the case where callback is not passed by user - -## v1.0.2 - -* git ignore coverage and node_modules -* update tap to v7 -* build a changelog -* package: fix repository link -* pass tests on 0.8 -* before_script needs to be before_install -* tap 1.2.0 and travis - -## v1.0.1 - -* isc license -* updated README.md - -## v1.0.0 - -* Simulate staleness instead of waiting excessively -* whitespace -* manage 'retries' so it does not clash with 'wait' polling -* manage 'wait' timer properly -* Get rid of the excessive Object.create opts shadowing stuff -* failing test for the time taken for retries + wait options -* doc: add pollPeriod, correct opts.wait -* Fixed #6: polling period should be configurable - -## v0.4.3 - -* Implement race-resistant stale lock detection -* set req id to 1 to start out - -## v0.4.2 - -* stale option fix for windows file tunneling - -## v0.4.1 - -* Fix version parsing - -## v0.4.0 - -* Don't keep lockfiles open - -## v0.3.4 - -* retry more aggressively - -## v0.3.3 - -* Add debugging function - -## v0.3.2 - -* remove console.error - -## v0.3.1 - -* Support lack of subsecond fs precision -* Fix error closure overwriting in notStale - -## v0.3.0 - -* Use polling instead of watchers -* Add more overhead buffer to contention test - -## v0.2.2 - -* Fix wait calculation -* fixup -* Style: prefer early return to giant if/else -* unlock: Close before unlinking -* Don't get tripped up by locks named 'hasOwnProperty' -* test: Pathological extreme lock contention -* refactor license - -## 0.2.1 - -* Handle race conditions more thoroughly - -## 0.2.0 - -* Rename to 'lockfile' - -## 0.0.2 - -* Add retries -* bsd - -## 0.0.1 - -* tests -* package.json -* the code -* first diff --git a/deps/npm/node_modules/lockfile/README.md b/deps/npm/node_modules/lockfile/README.md deleted file mode 100644 index 3960194f068d61..00000000000000 --- a/deps/npm/node_modules/lockfile/README.md +++ /dev/null @@ -1,86 +0,0 @@ -# lockfile - -A very polite lock file utility, which endeavors to not litter, and to -wait patiently for others. - -## Usage - -```javascript -var lockFile = require('lockfile') - -// opts is optional, and defaults to {} -lockFile.lock('some-file.lock', opts, function (er) { - // if the er happens, then it failed to acquire a lock. - // if there was not an error, then the file was created, - // and won't be deleted until we unlock it. - - // do my stuff, free of interruptions - // then, some time later, do: - lockFile.unlock('some-file.lock', function (er) { - // er means that an error happened, and is probably bad. - }) -}) -``` - -## Methods - -Sync methods return the value/throw the error, others don't. Standard -node fs stuff. - -All known locks are removed when the process exits. Of course, it's -possible for certain types of failures to cause this to fail, but a best -effort is made to not be a litterbug. - -### lockFile.lock(path, [opts], cb) - -Acquire a file lock on the specified path - -### lockFile.lockSync(path, [opts]) - -Acquire a file lock on the specified path - -### lockFile.unlock(path, cb) - -Close and unlink the lockfile. - -### lockFile.unlockSync(path) - -Close and unlink the lockfile. - -### lockFile.check(path, [opts], cb) - -Check if the lockfile is locked and not stale. - -Callback is called with `cb(error, isLocked)`. - -### lockFile.checkSync(path, [opts]) - -Check if the lockfile is locked and not stale. - -Returns boolean. - -## Options - -### opts.wait - -A number of milliseconds to wait for locks to expire before giving up. -Only used by lockFile.lock. Poll for `opts.wait` ms. If the lock is -not cleared by the time the wait expires, then it returns with the -original error. - -### opts.pollPeriod - -When using `opts.wait`, this is the period in ms in which it polls to -check if the lock has expired. Defaults to `100`. - -### opts.stale - -A number of milliseconds before locks are considered to have expired. - -### opts.retries - -Used by lock and lockSync. Retry `n` number of times before giving up. - -### opts.retryWait - -Used by lock. Wait `n` milliseconds before retrying. diff --git a/deps/npm/node_modules/lockfile/gen-changelog.sh b/deps/npm/node_modules/lockfile/gen-changelog.sh deleted file mode 100644 index 360e54af40f6af..00000000000000 --- a/deps/npm/node_modules/lockfile/gen-changelog.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/bash -( - echo '# Changes' - echo '' - git log --first-parent --pretty=format:'%s' \ - | grep -v '^update changelog' \ - | perl -p -e 's/^((v?[0-9]+\.?)+)$/\n## \1\n/g' \ - | perl -p -e 's/^([^#\s].*)$/* \1/g' -)> CHANGELOG.md diff --git a/deps/npm/node_modules/lockfile/lockfile.js b/deps/npm/node_modules/lockfile/lockfile.js deleted file mode 100644 index f037bec55e73c4..00000000000000 --- a/deps/npm/node_modules/lockfile/lockfile.js +++ /dev/null @@ -1,320 +0,0 @@ -var fs = require('fs') - -var wx = 'wx' -if (process.version.match(/^v0\.[0-6]/)) { - var c = require('constants') - wx = c.O_TRUNC | c.O_CREAT | c.O_WRONLY | c.O_EXCL -} - -var os = require('os') -exports.filetime = 'ctime' -if (os.platform() == "win32") { - exports.filetime = 'mtime' -} - -var debug -var util = require('util') -if (util.debuglog) - debug = util.debuglog('LOCKFILE') -else if (/\blockfile\b/i.test(process.env.NODE_DEBUG)) - debug = function() { - var msg = util.format.apply(util, arguments) - console.error('LOCKFILE %d %s', process.pid, msg) - } -else - debug = function() {} - -var locks = {} - -function hasOwnProperty (obj, prop) { - return Object.prototype.hasOwnProperty.call(obj, prop) -} - -var onExit = require('signal-exit') -onExit(function () { - debug('exit listener') - // cleanup - Object.keys(locks).forEach(exports.unlockSync) -}) - -// XXX https://github.com/joyent/node/issues/3555 -// Remove when node 0.8 is deprecated. -if (/^v0\.[0-8]\./.test(process.version)) { - debug('uncaughtException, version = %s', process.version) - process.on('uncaughtException', function H (er) { - debug('uncaughtException') - var l = process.listeners('uncaughtException').filter(function (h) { - return h !== H - }) - if (!l.length) { - // cleanup - try { Object.keys(locks).forEach(exports.unlockSync) } catch (e) {} - process.removeListener('uncaughtException', H) - throw er - } - }) -} - -exports.unlock = function (path, cb) { - debug('unlock', path) - // best-effort. unlocking an already-unlocked lock is a noop - delete locks[path] - fs.unlink(path, function (unlinkEr) { cb && cb() }) -} - -exports.unlockSync = function (path) { - debug('unlockSync', path) - // best-effort. unlocking an already-unlocked lock is a noop - try { fs.unlinkSync(path) } catch (er) {} - delete locks[path] -} - - -// if the file can be opened in readonly mode, then it's there. -// if the error is something other than ENOENT, then it's not. -exports.check = function (path, opts, cb) { - if (typeof opts === 'function') cb = opts, opts = {} - debug('check', path, opts) - fs.open(path, 'r', function (er, fd) { - if (er) { - if (er.code !== 'ENOENT') return cb(er) - return cb(null, false) - } - - if (!opts.stale) { - return fs.close(fd, function (er) { - return cb(er, true) - }) - } - - fs.fstat(fd, function (er, st) { - if (er) return fs.close(fd, function (er2) { - return cb(er) - }) - - fs.close(fd, function (er) { - var age = Date.now() - st[exports.filetime].getTime() - return cb(er, age <= opts.stale) - }) - }) - }) -} - -exports.checkSync = function (path, opts) { - opts = opts || {} - debug('checkSync', path, opts) - if (opts.wait) { - throw new Error('opts.wait not supported sync for obvious reasons') - } - - try { - var fd = fs.openSync(path, 'r') - } catch (er) { - if (er.code !== 'ENOENT') throw er - return false - } - - if (!opts.stale) { - try { fs.closeSync(fd) } catch (er) {} - return true - } - - // file exists. however, might be stale - if (opts.stale) { - try { - var st = fs.fstatSync(fd) - } finally { - fs.closeSync(fd) - } - var age = Date.now() - st[exports.filetime].getTime() - return (age <= opts.stale) - } -} - - - -var req = 1 -exports.lock = function (path, opts, cb) { - if (typeof opts === 'function') cb = opts, opts = {} - opts.req = opts.req || req++ - debug('lock', path, opts) - opts.start = opts.start || Date.now() - - if (typeof opts.retries === 'number' && opts.retries > 0) { - debug('has retries', opts.retries) - var retries = opts.retries - opts.retries = 0 - cb = (function (orig) { return function cb (er, fd) { - debug('retry-mutated callback') - retries -= 1 - if (!er || retries < 0) return orig(er, fd) - - debug('lock retry', path, opts) - - if (opts.retryWait) setTimeout(retry, opts.retryWait) - else retry() - - function retry () { - opts.start = Date.now() - debug('retrying', opts.start) - exports.lock(path, opts, cb) - } - }})(cb) - } - - // try to engage the lock. - // if this succeeds, then we're in business. - fs.open(path, wx, function (er, fd) { - if (!er) { - debug('locked', path, fd) - locks[path] = fd - return fs.close(fd, function () { - return cb() - }) - } - - debug('failed to acquire lock', er) - - // something other than "currently locked" - // maybe eperm or something. - if (er.code !== 'EEXIST') { - debug('not EEXIST error', er) - return cb(er) - } - - // someone's got this one. see if it's valid. - if (!opts.stale) return notStale(er, path, opts, cb) - - return maybeStale(er, path, opts, false, cb) - }) - debug('lock return') -} - - -// Staleness checking algorithm -// 1. acquire $lock, fail -// 2. stat $lock, find that it is stale -// 3. acquire $lock.STALE -// 4. stat $lock, assert that it is still stale -// 5. unlink $lock -// 6. link $lock.STALE $lock -// 7. unlink $lock.STALE -// On any failure, clean up whatever we've done, and raise the error. -function maybeStale (originalEr, path, opts, hasStaleLock, cb) { - fs.stat(path, function (statEr, st) { - if (statEr) { - if (statEr.code === 'ENOENT') { - // expired already! - opts.stale = false - debug('lock stale enoent retry', path, opts) - exports.lock(path, opts, cb) - return - } - return cb(statEr) - } - - var age = Date.now() - st[exports.filetime].getTime() - if (age <= opts.stale) return notStale(originalEr, path, opts, cb) - - debug('lock stale', path, opts) - if (hasStaleLock) { - exports.unlock(path, function (er) { - if (er) return cb(er) - debug('lock stale retry', path, opts) - fs.link(path + '.STALE', path, function (er) { - fs.unlink(path + '.STALE', function () { - // best effort. if the unlink fails, oh well. - cb(er) - }) - }) - }) - } else { - debug('acquire .STALE file lock', opts) - exports.lock(path + '.STALE', opts, function (er) { - if (er) return cb(er) - maybeStale(originalEr, path, opts, true, cb) - }) - } - }) -} - -function notStale (er, path, opts, cb) { - debug('notStale', path, opts) - - // if we can't wait, then just call it a failure - if (typeof opts.wait !== 'number' || opts.wait <= 0) { - debug('notStale, wait is not a number') - return cb(er) - } - - // poll for some ms for the lock to clear - var now = Date.now() - var start = opts.start || now - var end = start + opts.wait - - if (end <= now) - return cb(er) - - debug('now=%d, wait until %d (delta=%d)', start, end, end-start) - var wait = Math.min(end - start, opts.pollPeriod || 100) - var timer = setTimeout(poll, wait) - - function poll () { - debug('notStale, polling', path, opts) - exports.lock(path, opts, cb) - } -} - -exports.lockSync = function (path, opts) { - opts = opts || {} - opts.req = opts.req || req++ - debug('lockSync', path, opts) - if (opts.wait || opts.retryWait) { - throw new Error('opts.wait not supported sync for obvious reasons') - } - - try { - var fd = fs.openSync(path, wx) - locks[path] = fd - try { fs.closeSync(fd) } catch (er) {} - debug('locked sync!', path, fd) - return - } catch (er) { - if (er.code !== 'EEXIST') return retryThrow(path, opts, er) - - if (opts.stale) { - var st = fs.statSync(path) - var ct = st[exports.filetime].getTime() - if (!(ct % 1000) && (opts.stale % 1000)) { - // probably don't have subsecond resolution. - // round up the staleness indicator. - // Yes, this will be wrong 1/1000 times on platforms - // with subsecond stat precision, but that's acceptable - // in exchange for not mistakenly removing locks on - // most other systems. - opts.stale = 1000 * Math.ceil(opts.stale / 1000) - } - var age = Date.now() - ct - if (age > opts.stale) { - debug('lockSync stale', path, opts, age) - exports.unlockSync(path) - return exports.lockSync(path, opts) - } - } - - // failed to lock! - debug('failed to lock', path, opts, er) - return retryThrow(path, opts, er) - } -} - -function retryThrow (path, opts, er) { - if (typeof opts.retries === 'number' && opts.retries > 0) { - var newRT = opts.retries - 1 - debug('retryThrow', path, opts, newRT) - opts.retries = newRT - return exports.lockSync(path, opts) - } - throw er -} - diff --git a/deps/npm/node_modules/lockfile/package.json b/deps/npm/node_modules/lockfile/package.json deleted file mode 100644 index 29e89ff0b0378b..00000000000000 --- a/deps/npm/node_modules/lockfile/package.json +++ /dev/null @@ -1,70 +0,0 @@ -{ - "_args": [ - [ - "lockfile@1.0.4", - "/Users/rebecca/code/npm" - ] - ], - "_from": "lockfile@1.0.4", - "_id": "lockfile@1.0.4", - "_inBundle": false, - "_integrity": "sha512-cvbTwETRfsFh4nHsL1eGWapU1XFi5Ot9E85sWAwia7Y7EgB7vfqcZhTKZ+l7hCGxSPoushMv5GKhT5PdLv03WA==", - "_location": "/lockfile", - "_phantomChildren": {}, - "_requested": { - "type": "version", - "registry": true, - "raw": "lockfile@1.0.4", - "name": "lockfile", - "escapedName": "lockfile", - "rawSpec": "1.0.4", - "saveSpec": null, - "fetchSpec": "1.0.4" - }, - "_requiredBy": [ - "/" - ], - "_resolved": "https://registry.npmjs.org/lockfile/-/lockfile-1.0.4.tgz", - "_spec": "1.0.4", - "_where": "/Users/rebecca/code/npm", - "author": { - "name": "Isaac Z. Schlueter", - "email": "i@izs.me", - "url": "http://blog.izs.me/" - }, - "bugs": { - "url": "https://github.com/npm/lockfile/issues" - }, - "dependencies": { - "signal-exit": "^3.0.2" - }, - "description": "A very polite lock file utility, which endeavors to not litter, and to wait patiently for others.", - "devDependencies": { - "tap": "^11.1.3", - "touch": "0" - }, - "directories": { - "test": "test" - }, - "homepage": "https://github.com/npm/lockfile#readme", - "keywords": [ - "lockfile", - "lock", - "file", - "fs", - "O_EXCL" - ], - "license": "ISC", - "main": "lockfile.js", - "name": "lockfile", - "repository": { - "type": "git", - "url": "git+https://github.com/npm/lockfile.git" - }, - "scripts": { - "changelog": "bash gen-changelog.sh", - "postversion": "npm run changelog && git add CHANGELOG.md && git commit -m 'update changelog - '${npm_package_version}", - "test": "tap test/*.js --cov -J" - }, - "version": "1.0.4" -} diff --git a/deps/npm/node_modules/lockfile/sockets.md b/deps/npm/node_modules/lockfile/sockets.md deleted file mode 100644 index 89b60eebce8b13..00000000000000 --- a/deps/npm/node_modules/lockfile/sockets.md +++ /dev/null @@ -1,27 +0,0 @@ -to ACQUIRE(lockname) -- create server, listen on lockname - - if enotsock, WATCH(lockname) - - if eaddrinuse, - - CONNECT(lockname) - - unref server - - lock has been acquired via server - ! on connection, place sockets in queue - -to RELEASE(lockname) -- if acquired via connection - - disconnect -- if acquired via server - - send "OK" to front-most connection - - when connection disconnects, RELEASE(lockname) -- if acquired via filename - - unlink file - -to CONNECT(lockname) -- net.connect(lockname) - - if enoent or socket termination, ACQUIRE(lockname) - - when server says "OK", - - lock has been acquired via connection - -to WATCH(lockname) -- fs.watch(lockname) -- on change, ACQUIRE(lockname) diff --git a/deps/npm/node_modules/lockfile/speedtest.js b/deps/npm/node_modules/lockfile/speedtest.js deleted file mode 100644 index 4433dce1d96169..00000000000000 --- a/deps/npm/node_modules/lockfile/speedtest.js +++ /dev/null @@ -1,63 +0,0 @@ -const path = require('path'); -const async = require('async'); -const lf = require('lockfile'); -const fs = require('fs'); - -const n = +process.argv[3] || 300; -const a = Array.apply(null, {length: n}).map(function(_, i) { - return i -}) -const file = path.resolve(__dirname, 'speed-test.lock'); - -try{ - fs.unlinkSync(file); -} -catch(e){} - - -/// NOTE: this should run in about 30ms on a SSD Ubuntu 16.04, that is fast, because we are locking/unlocking 300 locks -/// *HOWEVER* if we change async.eachSeries to async.each, lockfile will barf immediately, and I can't get lockfile -/// to not barf, using any of the options {} available to lockfile#lock. - - -const parallel = process.argv[2] === 'parallel'; - -var fn, msg; - -if(parallel){ - msg = 'parallel'; - fn = async.each; -} -else{ - msg = 'series'; - fn = async.eachSeries; -} - - -const start = Date.now(); -console.log(' => locking/unlocking ' + a.length + ' times, in ' + msg); - -fn(a, function (val, cb) { - - console.log('try %d', val) - - lf.lock(file, { retries: n * 3 }, function (err) { - if (err) { - cb(err); - } - else { - console.log('complete %d', val) - lf.unlock(file, cb); - } - }); - -}, function complete(err) { - - if (err) { - throw err; - } - - console.log(' => Time required for lockfile => ', Date.now() - start, 'ms'); - process.exit(0); - -}); diff --git a/deps/npm/node_modules/lockfile/test/basic.js b/deps/npm/node_modules/lockfile/test/basic.js deleted file mode 100644 index bc66cc35313660..00000000000000 --- a/deps/npm/node_modules/lockfile/test/basic.js +++ /dev/null @@ -1,292 +0,0 @@ -var test = require('tap').test -var lockFile = require('../lockfile.js') -var path = require('path') -var fs = require('fs') -var touch = require('touch') - -// On Unix systems, it uses ctime by default for staleness checks, since it's -// the most reliable. However, because this test artificially sets some locks -// to an earlier time to simulate staleness, we use mtime here. -lockFile.filetime = 'mtime' - -test('setup', function (t) { - try { lockFile.unlockSync('basic-lock') } catch (er) {} - try { lockFile.unlockSync('sync-lock') } catch (er) {} - try { lockFile.unlockSync('never-forget') } catch (er) {} - try { lockFile.unlockSync('stale-lock') } catch (er) {} - try { lockFile.unlockSync('watch-lock') } catch (er) {} - try { lockFile.unlockSync('retry-lock') } catch (er) {} - try { lockFile.unlockSync('contentious-lock') } catch (er) {} - try { lockFile.unlockSync('stale-wait-lock') } catch (er) {} - try { lockFile.unlockSync('stale-windows-lock') } catch (er) {} - t.end() -}) - -test('lock contention', function (t) { - var gotlocks = 0; - var N = 200 - var delay = 10 - // allow for some time for each lock acquisition and release. - // note that raising N higher will mean that the overhead - // increases, because we're creating more and more watchers. - // irl, you should never have several hundred contenders for a - // single lock, so this situation is somewhat pathological. - var overhead = 200 - var wait = N * overhead + delay - - // first make it locked, so that everyone has to wait - lockFile.lock('contentious-lock', function(er, lock) { - t.ifError(er, 'acquiring starter') - if (er) throw er; - t.pass('acquired starter lock') - setTimeout(function() { - lockFile.unlock('contentious-lock', function (er) { - t.ifError(er, 'unlocking starter') - if (er) throw er - t.pass('unlocked starter') - }) - }, delay) - }) - - for (var i=0; i < N; i++) - lockFile.lock('contentious-lock', { wait: wait }, function(er, lock) { - if (er) throw er; - lockFile.unlock('contentious-lock', function(er) { - if (er) throw er - gotlocks++ - t.pass('locked and unlocked #' + gotlocks) - if (gotlocks === N) { - t.pass('got all locks') - t.end() - } - }) - }) -}) - -test('basic test', function (t) { - lockFile.check('basic-lock', function (er, locked) { - if (er) throw er - t.notOk(locked) - lockFile.lock('basic-lock', function (er) { - if (er) throw er - lockFile.lock('basic-lock', function (er) { - t.ok(er) - lockFile.check('basic-lock', function (er, locked) { - if (er) throw er - t.ok(locked) - lockFile.unlock('basic-lock', function (er) { - if (er) throw er - lockFile.check('basic-lock', function (er, locked) { - if (er) throw er - t.notOk(locked) - t.end() - }) - }) - }) - }) - }) - }) -}) - -test('sync test', function (t) { - var locked - locked = lockFile.checkSync('sync-lock') - t.notOk(locked) - lockFile.lockSync('sync-lock') - locked = lockFile.checkSync('sync-lock') - t.ok(locked) - lockFile.unlockSync('sync-lock') - locked = lockFile.checkSync('sync-lock') - t.notOk(locked) - t.end() -}) - -test('exit cleanup test', function (t) { - var child = require.resolve('./fixtures/child.js') - var node = process.execPath - var spawn = require('child_process').spawn - spawn(node, [child]).on('exit', function () { - setTimeout(function () { - var locked = lockFile.checkSync('never-forget') - t.notOk(locked) - t.end() - }, 100) - }) -}) - -test('error exit cleanup test', function (t) { - var child = require.resolve('./fixtures/bad-child.js') - var node = process.execPath - var spawn = require('child_process').spawn - spawn(node, [child]).on('exit', function () { - setTimeout(function () { - var locked = lockFile.checkSync('never-forget') - t.notOk(locked) - t.end() - }, 100) - }) -}) - - -test('staleness test', function (t) { - lockFile.lock('stale-lock', function (er) { - if (er) throw er - - // simulate 2s old - touch.sync('stale-lock', { time: new Date(Date.now() - 2000) }) - - var opts = { stale: 1 } - lockFile.check('stale-lock', opts, function (er, locked) { - if (er) throw er - t.notOk(locked) - lockFile.lock('stale-lock', opts, function (er) { - if (er) throw er - lockFile.unlock('stale-lock', function (er) { - if (er) throw er - t.end() - }) - }) - }) - }) -}) - -test('staleness sync test', function (t) { - var opts = { stale: 1 } - lockFile.lockSync('stale-lock') - // simulate 2s old - touch.sync('stale-lock', { time: new Date(Date.now() - 2000) }) - var locked - locked = lockFile.checkSync('stale-lock', opts) - t.notOk(locked) - lockFile.lockSync('stale-lock', opts) - lockFile.unlockSync('stale-lock') - t.end() -}) - -test('retries', function (t) { - // next 5 opens will fail. - var opens = 5 - fs._open = fs.open - fs.open = function (path, mode, cb) { - if (--opens === 0) { - fs.open = fs._open - return fs.open(path, mode, cb) - } - var er = new Error('bogus') - // to be, or not to be, that is the question. - er.code = opens % 2 ? 'EEXIST' : 'ENOENT' - process.nextTick(cb.bind(null, er)) - } - - lockFile.lock('retry-lock', { retries: opens }, function (er) { - if (er) throw er - t.equal(opens, 0) - lockFile.unlockSync('retry-lock') - t.end() - }) -}) - -test('retryWait', function (t) { - // next 5 opens will fail. - var opens = 5 - fs._open = fs.open - fs.open = function (path, mode, cb) { - if (--opens === 0) { - fs.open = fs._open - return fs.open(path, mode, cb) - } - var er = new Error('bogus') - // to be, or not to be, that is the question. - er.code = opens % 2 ? 'EEXIST' : 'ENOENT' - process.nextTick(cb.bind(null, er)) - } - - var opts = { retries: opens, retryWait: 100 } - lockFile.lock('retry-lock', opts, function (er) { - if (er) throw er - t.equal(opens, 0) - lockFile.unlockSync('retry-lock') - t.end() - }) -}) - -test('retry sync', function (t) { - // next 5 opens will fail. - var opens = 5 - fs._openSync = fs.openSync - fs.openSync = function (path, mode) { - if (--opens === 0) { - fs.openSync = fs._openSync - return fs.openSync(path, mode) - } - var er = new Error('bogus') - // to be, or not to be, that is the question. - er.code = opens % 2 ? 'EEXIST' : 'ENOENT' - throw er - } - - var opts = { retries: opens } - lockFile.lockSync('retry-lock', opts) - t.equal(opens, 0) - lockFile.unlockSync('retry-lock') - t.end() -}) - -test('wait and stale together', function (t) { - // first locker. - var interval - lockFile.lock('stale-wait-lock', function(er) { - // keep refreshing the lock, so we keep it forever - interval = setInterval(function() { - touch.sync('stale-wait-lock') - }, 10) - - // try to get another lock. this must fail! - var opt = { stale: 1000, wait: 2000, pollInterval: 1000 } - lockFile.lock('stale-wait-lock', opt, function (er) { - if (!er) - t.fail('got second lock? that unpossible!') - else - t.pass('second lock failed, as i have foreseen it') - clearInterval(interval) - t.end() - }) - }) -}) - - -test('stale windows file tunneling test', function (t) { - // for windows only - // nt file system tunneling feature will make file creation time not updated - var opts = { stale: 1000 } - lockFile.lockSync('stale-windows-lock') - touch.sync('stale-windows-lock', { time: new Date(Date.now() - 3000) }) - - var locked - lockFile.unlockSync('stale-windows-lock') - lockFile.lockSync('stale-windows-lock', opts) - locked = lockFile.checkSync('stale-windows-lock', opts) - t.ok(locked, "should be locked and not stale") - lockFile.lock('stale-windows-lock', opts, function (er) { - if (!er) - t.fail('got second lock? impossible, windows file tunneling problem!') - else - t.pass('second lock failed, windows file tunneling problem fixed') - t.end() - }) -}) - - -test('cleanup', function (t) { - try { lockFile.unlockSync('basic-lock') } catch (er) {} - try { lockFile.unlockSync('sync-lock') } catch (er) {} - try { lockFile.unlockSync('never-forget') } catch (er) {} - try { lockFile.unlockSync('stale-lock') } catch (er) {} - try { lockFile.unlockSync('watch-lock') } catch (er) {} - try { lockFile.unlockSync('retry-lock') } catch (er) {} - try { lockFile.unlockSync('contentious-lock') } catch (er) {} - try { lockFile.unlockSync('stale-wait-lock') } catch (er) {} - try { lockFile.unlockSync('stale-windows-lock') } catch (er) {} - t.end() -}) - diff --git a/deps/npm/node_modules/lockfile/test/fixtures/bad-child.js b/deps/npm/node_modules/lockfile/test/fixtures/bad-child.js deleted file mode 100644 index e65304542f49bf..00000000000000 --- a/deps/npm/node_modules/lockfile/test/fixtures/bad-child.js +++ /dev/null @@ -1,5 +0,0 @@ -var lockFile = require('../../lockfile.js') - -lockFile.lockSync('never-forget') - -throw new Error('waaaaaaaaa') diff --git a/deps/npm/node_modules/lockfile/test/fixtures/child.js b/deps/npm/node_modules/lockfile/test/fixtures/child.js deleted file mode 100644 index 5b61d6c9110b3d..00000000000000 --- a/deps/npm/node_modules/lockfile/test/fixtures/child.js +++ /dev/null @@ -1,3 +0,0 @@ -var lockFile = require('../../lockfile.js') - -lockFile.lock('never-forget', function () {}) diff --git a/deps/npm/node_modules/lockfile/test/retry-time.js b/deps/npm/node_modules/lockfile/test/retry-time.js deleted file mode 100644 index 7632901afa8b17..00000000000000 --- a/deps/npm/node_modules/lockfile/test/retry-time.js +++ /dev/null @@ -1,67 +0,0 @@ -// In these tests, we do the following: -// try for 200ms (rt=2) -// wait for 300ms -// try for 200ms (rt=1) -// wait for 300ms -// try for 200ms (rt=0) -// fail after 1200 -// Actual time will be more like 1220-ish for setTimeout irregularity -// But it should NOT be as slow as 2000. - -var lockFile = require('../') -var touch = require('touch') -var test = require('tap').test -var fs = require('fs') - -var RETRYWAIT = 100 -var WAIT = 100 -var RETRIES = 2 -var EXPECTTIME = (RETRYWAIT * RETRIES) + (WAIT * (RETRIES + 1)) -var TOOLONG = EXPECTTIME * 1.5 - -test('setup', function (t) { - touch.sync('file.lock') - t.end() -}) - -var pollPeriods = [10, 100, 10000] -pollPeriods.forEach(function (pp) { - test('retry+wait, poll=' + pp, function (t) { - var ended = false - var timer = setTimeout(function() { - t.fail('taking too long!') - ended = true - t.end() - }, 2000) - - if (timer.unref) - timer.unref() - - var start = Date.now() - lockFile.lock('file.lock', { - wait: WAIT, - retries: RETRIES, - retryWait: RETRYWAIT, - pollPeriod: pp - }, function (er) { - if (ended) return - var time = Date.now() - start - t.ok(time >= EXPECTTIME, 'should take at least ' + EXPECTTIME) - t.ok(time < TOOLONG, 'should take less than ' + TOOLONG) - clearTimeout(timer) - t.end() - }) - }) -}) - -test('cleanup', function (t) { - fs.unlinkSync('file.lock') - t.end() - var timer = setTimeout(function() { - process.exit(1) - }, 500) - if (timer.unref) - timer.unref() - else - clearTimeout(timer) -}) diff --git a/deps/npm/node_modules/lockfile/test/stale-contention.js b/deps/npm/node_modules/lockfile/test/stale-contention.js deleted file mode 100644 index 85cbf92e938494..00000000000000 --- a/deps/npm/node_modules/lockfile/test/stale-contention.js +++ /dev/null @@ -1,85 +0,0 @@ -var fs = require('fs') -var lockFile = require('../') -var test = require('tap').test -var path = require('path') -var lock = path.resolve(__dirname, 'stale.lock') -var touch = require('touch') -var spawn = require('child_process').spawn -var node = process.execPath - -// We're using a lockfile with an artificially old date, -// so make it use that instead of ctime. -// Probably you should never do this in production! -lockFile.filetime = 'mtime' - -if (process.argv[2] === 'child') { - return child() -} - -function child () { - // Make fs.stat take 100ms to return its data - // This is important because, in a test scenario where - // we're statting the same exact file rapid-fire like this, - // it'll end up being cached by the FS, and never trigger - // the race condition we're trying to expose. - fs.stat = function (stat) { return function () { - var args = [].slice.call(arguments) - var cb = args.pop() - stat.apply(fs, args.concat(function(er, st) { - setTimeout(function () { - cb(er, st) - }, 100) - })) - }}(fs.stat) - - lockFile.lock(lock, { stale: 100000 }, function (er) { - if (er && er.code !== 'EEXIST') - throw er - else if (er) - process.exit(17) - else - setTimeout(function(){}, 500) - }) -} - -test('create stale file', function (t) { - try { fs.unlinkSync(lock) } catch (er) {} - touch.sync(lock, { time: '1979-07-01T19:10:00.000Z' }) - t.end() -}) - -test('contenders', function (t) { - var n = 10 - var fails = 0 - var wins = 0 - var args = [ __filename, 'child' ] - var opt = { stdio: [0, "pipe", 2] } - for (var i = 0; i < n; i++) { - spawn(node, args, opt).on('close', then) - } - - function then (code) { - if (code === 17) { - fails ++ - } else if (code) { - t.fail("unexpected failure", code) - fails ++ - } else { - wins ++ - } - if (fails + wins === n) { - done() - } - } - - function done () { - t.equal(wins, 1, "should have 1 lock winner") - t.equal(fails, n - 1, "all others should lose") - t.end() - } -}) - -test('remove stale file', function (t) { - try { fs.unlinkSync(lock) } catch (er) {} - t.end() -}) diff --git a/deps/npm/node_modules/lockfile/test/unlock-no-cb.js b/deps/npm/node_modules/lockfile/test/unlock-no-cb.js deleted file mode 100644 index df160923ebc6de..00000000000000 --- a/deps/npm/node_modules/lockfile/test/unlock-no-cb.js +++ /dev/null @@ -1,10 +0,0 @@ -var t = require('tap') -if (/0\.(10|8)/.test(process.version)) { - t.pass('just a dummy test, no beforeExit in this node version') -} else { - process.on('beforeExit', function (code) { - t.equal(code, 0, 'did not throw') - }) -} -var lf = require('lockfile') -lf.unlock('no-file-no-cb') diff --git a/deps/npm/node_modules/lodash._baseindexof/LICENSE.txt b/deps/npm/node_modules/lodash._baseindexof/LICENSE.txt deleted file mode 100644 index 17764328c826b5..00000000000000 --- a/deps/npm/node_modules/lodash._baseindexof/LICENSE.txt +++ /dev/null @@ -1,22 +0,0 @@ -Copyright 2012-2015 The Dojo Foundation -Based on Underscore.js 1.7.0, copyright 2009-2015 Jeremy Ashkenas, -DocumentCloud and Investigative Reporters & Editors - -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/lodash._baseindexof/README.md b/deps/npm/node_modules/lodash._baseindexof/README.md deleted file mode 100644 index ddcc79d5d66aee..00000000000000 --- a/deps/npm/node_modules/lodash._baseindexof/README.md +++ /dev/null @@ -1,20 +0,0 @@ -# lodash._baseindexof v3.1.0 - -The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) internal `baseIndexOf` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module. - -## Installation - -Using npm: - -```bash -$ {sudo -H} npm i -g npm -$ npm i --save lodash._baseindexof -``` - -In Node.js/io.js: - -```js -var baseIndexOf = require('lodash._baseindexof'); -``` - -See the [package source](https://github.com/lodash/lodash/blob/3.1.0-npm-packages/lodash._baseindexof) for more details. diff --git a/deps/npm/node_modules/lodash._baseindexof/index.js b/deps/npm/node_modules/lodash._baseindexof/index.js deleted file mode 100644 index e5da79147894ae..00000000000000 --- a/deps/npm/node_modules/lodash._baseindexof/index.js +++ /dev/null @@ -1,57 +0,0 @@ -/** - * lodash 3.1.0 (Custom Build) - * Build: `lodash modern modularize exports="npm" -o ./` - * Copyright 2012-2015 The Dojo Foundation - * Based on Underscore.js 1.8.2 - * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - * Available under MIT license - */ - -/** - * The base implementation of `_.indexOf` without support for binary searches. - * - * @private - * @param {Array} array The array to search. - * @param {*} value The value to search for. - * @param {number} fromIndex The index to search from. - * @returns {number} Returns the index of the matched value, else `-1`. - */ -function baseIndexOf(array, value, fromIndex) { - if (value !== value) { - return indexOfNaN(array, fromIndex); - } - var index = fromIndex - 1, - length = array.length; - - while (++index < length) { - if (array[index] === value) { - return index; - } - } - return -1; -} - -/** - * Gets the index at which the first occurrence of `NaN` is found in `array`. - * If `fromRight` is provided elements of `array` are iterated from right to left. - * - * @private - * @param {Array} array The array to search. - * @param {number} fromIndex The index to search from. - * @param {boolean} [fromRight] Specify iterating from right to left. - * @returns {number} Returns the index of the matched `NaN`, else `-1`. - */ -function indexOfNaN(array, fromIndex, fromRight) { - var length = array.length, - index = fromIndex + (fromRight ? 0 : -1); - - while ((fromRight ? index-- : ++index < length)) { - var other = array[index]; - if (other !== other) { - return index; - } - } - return -1; -} - -module.exports = baseIndexOf; diff --git a/deps/npm/node_modules/lodash._baseindexof/package.json b/deps/npm/node_modules/lodash._baseindexof/package.json deleted file mode 100644 index 35456752d6438e..00000000000000 --- a/deps/npm/node_modules/lodash._baseindexof/package.json +++ /dev/null @@ -1,78 +0,0 @@ -{ - "_args": [ - [ - "lodash._baseindexof@3.1.0", - "/Users/rebecca/code/npm" - ] - ], - "_from": "lodash._baseindexof@3.1.0", - "_id": "lodash._baseindexof@3.1.0", - "_inBundle": false, - "_integrity": "sha1-/lK1OhxnYeQmGNZU5KJXie1hgiw=", - "_location": "/lodash._baseindexof", - "_phantomChildren": {}, - "_requested": { - "type": "version", - "registry": true, - "raw": "lodash._baseindexof@3.1.0", - "name": "lodash._baseindexof", - "escapedName": "lodash._baseindexof", - "rawSpec": "3.1.0", - "saveSpec": null, - "fetchSpec": "3.1.0" - }, - "_requiredBy": [ - "/" - ], - "_resolved": "https://registry.npmjs.org/lodash._baseindexof/-/lodash._baseindexof-3.1.0.tgz", - "_spec": "3.1.0", - "_where": "/Users/rebecca/code/npm", - "author": { - "name": "John-David Dalton", - "email": "john.david.dalton@gmail.com", - "url": "http://allyoucanleet.com/" - }, - "bugs": { - "url": "https://github.com/lodash/lodash/issues" - }, - "contributors": [ - { - "name": "John-David Dalton", - "email": "john.david.dalton@gmail.com", - "url": "http://allyoucanleet.com/" - }, - { - "name": "Benjamin Tan", - "email": "demoneaux@gmail.com", - "url": "https://d10.github.io/" - }, - { - "name": "Blaine Bublitz", - "email": "blaine@iceddev.com", - "url": "http://www.iceddev.com/" - }, - { - "name": "Kit Cambridge", - "email": "github@kitcambridge.be", - "url": "http://kitcambridge.be/" - }, - { - "name": "Mathias Bynens", - "email": "mathias@qiwi.be", - "url": "https://mathiasbynens.be/" - } - ], - "description": "The modern build of lodash’s internal `baseIndexOf` as a module.", - "homepage": "https://lodash.com/", - "icon": "https://lodash.com/icon.svg", - "license": "MIT", - "name": "lodash._baseindexof", - "repository": { - "type": "git", - "url": "git+https://github.com/lodash/lodash.git" - }, - "scripts": { - "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" - }, - "version": "3.1.0" -} diff --git a/deps/npm/node_modules/lodash._baseuniq/LICENSE b/deps/npm/node_modules/lodash._baseuniq/LICENSE deleted file mode 100644 index e0c69d56032d15..00000000000000 --- a/deps/npm/node_modules/lodash._baseuniq/LICENSE +++ /dev/null @@ -1,47 +0,0 @@ -Copyright jQuery Foundation and other contributors - -Based on Underscore.js, copyright Jeremy Ashkenas, -DocumentCloud and Investigative Reporters & Editors - -This software consists of voluntary contributions made by many -individuals. For exact contribution history, see the revision history -available at https://github.com/lodash/lodash - -The following license applies to all parts of this software except as -documented below: - -==== - -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. - -==== - -Copyright and related rights for sample code are waived via CC0. Sample -code is defined as all source code displayed within the prose of the -documentation. - -CC0: http://creativecommons.org/publicdomain/zero/1.0/ - -==== - -Files located in the node_modules and vendor directories are externally -maintained libraries used by this software which have their own -licenses; we recommend you read them, as their terms may differ from the -terms above. diff --git a/deps/npm/node_modules/lodash._baseuniq/README.md b/deps/npm/node_modules/lodash._baseuniq/README.md deleted file mode 100644 index c18dbb6c377392..00000000000000 --- a/deps/npm/node_modules/lodash._baseuniq/README.md +++ /dev/null @@ -1,18 +0,0 @@ -# lodash._baseuniq v4.6.0 - -The internal [lodash](https://lodash.com/) function `baseUniq` exported as a [Node.js](https://nodejs.org/) module. - -## Installation - -Using npm: -```bash -$ {sudo -H} npm i -g npm -$ npm i --save lodash._baseuniq -``` - -In Node.js: -```js -var baseUniq = require('lodash._baseuniq'); -``` - -See the [package source](https://github.com/lodash/lodash/blob/4.6.0-npm-packages/lodash._baseuniq) for more details. diff --git a/deps/npm/node_modules/lodash._baseuniq/index.js b/deps/npm/node_modules/lodash._baseuniq/index.js deleted file mode 100644 index 8f3094f9be92ed..00000000000000 --- a/deps/npm/node_modules/lodash._baseuniq/index.js +++ /dev/null @@ -1,801 +0,0 @@ -/** - * lodash (Custom Build) - * Build: `lodash modularize exports="npm" -o ./` - * Copyright jQuery Foundation and other contributors - * Released under MIT license - * Based on Underscore.js 1.8.3 - * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - */ -var createSet = require('lodash._createset'), - root = require('lodash._root'); - -/** Used as the size to enable large array optimizations. */ -var LARGE_ARRAY_SIZE = 200; - -/** Used to stand-in for `undefined` hash values. */ -var HASH_UNDEFINED = '__lodash_hash_undefined__'; - -/** `Object#toString` result references. */ -var funcTag = '[object Function]', - genTag = '[object GeneratorFunction]'; - -/** - * Used to match `RegExp` - * [syntax characters](http://ecma-international.org/ecma-262/6.0/#sec-patterns). - */ -var reRegExpChar = /[\\^$.*+?()[\]{}|]/g; - -/** Used to detect host constructors (Safari). */ -var reIsHostCtor = /^\[object .+?Constructor\]$/; - -/** - * A specialized version of `_.includes` for arrays without support for - * specifying an index to search from. - * - * @private - * @param {Array} array The array to search. - * @param {*} target The value to search for. - * @returns {boolean} Returns `true` if `target` is found, else `false`. - */ -function arrayIncludes(array, value) { - return !!array.length && baseIndexOf(array, value, 0) > -1; -} - -/** - * This function is like `arrayIncludes` except that it accepts a comparator. - * - * @private - * @param {Array} array The array to search. - * @param {*} target The value to search for. - * @param {Function} comparator The comparator invoked per element. - * @returns {boolean} Returns `true` if `target` is found, else `false`. - */ -function arrayIncludesWith(array, value, comparator) { - var index = -1, - length = array.length; - - while (++index < length) { - if (comparator(value, array[index])) { - return true; - } - } - return false; -} - -/** - * The base implementation of `_.indexOf` without `fromIndex` bounds checks. - * - * @private - * @param {Array} array The array to search. - * @param {*} value The value to search for. - * @param {number} fromIndex The index to search from. - * @returns {number} Returns the index of the matched value, else `-1`. - */ -function baseIndexOf(array, value, fromIndex) { - if (value !== value) { - return indexOfNaN(array, fromIndex); - } - var index = fromIndex - 1, - length = array.length; - - while (++index < length) { - if (array[index] === value) { - return index; - } - } - return -1; -} - -/** - * Checks if a cache value for `key` exists. - * - * @private - * @param {Object} cache The cache to query. - * @param {string} key The key of the entry to check. - * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. - */ -function cacheHas(cache, key) { - return cache.has(key); -} - -/** - * Gets the index at which the first occurrence of `NaN` is found in `array`. - * - * @private - * @param {Array} array The array to search. - * @param {number} fromIndex The index to search from. - * @param {boolean} [fromRight] Specify iterating from right to left. - * @returns {number} Returns the index of the matched `NaN`, else `-1`. - */ -function indexOfNaN(array, fromIndex, fromRight) { - var length = array.length, - index = fromIndex + (fromRight ? 0 : -1); - - while ((fromRight ? index-- : ++index < length)) { - var other = array[index]; - if (other !== other) { - return index; - } - } - return -1; -} - -/** - * Checks if `value` is a host object in IE < 9. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a host object, else `false`. - */ -function isHostObject(value) { - // Many host objects are `Object` objects that can coerce to strings - // despite having improperly defined `toString` methods. - var result = false; - if (value != null && typeof value.toString != 'function') { - try { - result = !!(value + ''); - } catch (e) {} - } - return result; -} - -/** - * Converts `set` to an array of its values. - * - * @private - * @param {Object} set The set to convert. - * @returns {Array} Returns the values. - */ -function setToArray(set) { - var index = -1, - result = Array(set.size); - - set.forEach(function(value) { - result[++index] = value; - }); - return result; -} - -/** Used for built-in method references. */ -var arrayProto = Array.prototype, - objectProto = Object.prototype; - -/** Used to resolve the decompiled source of functions. */ -var funcToString = Function.prototype.toString; - -/** Used to check objects for own properties. */ -var hasOwnProperty = objectProto.hasOwnProperty; - -/** - * Used to resolve the - * [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) - * of values. - */ -var objectToString = objectProto.toString; - -/** Used to detect if a method is native. */ -var reIsNative = RegExp('^' + - funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&') - .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$' -); - -/** Built-in value references. */ -var splice = arrayProto.splice; - -/* Built-in method references that are verified to be native. */ -var Map = getNative(root, 'Map'), - nativeCreate = getNative(Object, 'create'); - -/** - * Creates a hash object. - * - * @private - * @constructor - * @param {Array} [entries] The key-value pairs to cache. - */ -function Hash(entries) { - var index = -1, - length = entries ? entries.length : 0; - - this.clear(); - while (++index < length) { - var entry = entries[index]; - this.set(entry[0], entry[1]); - } -} - -/** - * Removes all key-value entries from the hash. - * - * @private - * @name clear - * @memberOf Hash - */ -function hashClear() { - this.__data__ = nativeCreate ? nativeCreate(null) : {}; -} - -/** - * Removes `key` and its value from the hash. - * - * @private - * @name delete - * @memberOf Hash - * @param {Object} hash The hash to modify. - * @param {string} key The key of the value to remove. - * @returns {boolean} Returns `true` if the entry was removed, else `false`. - */ -function hashDelete(key) { - return this.has(key) && delete this.__data__[key]; -} - -/** - * Gets the hash value for `key`. - * - * @private - * @name get - * @memberOf Hash - * @param {string} key The key of the value to get. - * @returns {*} Returns the entry value. - */ -function hashGet(key) { - var data = this.__data__; - if (nativeCreate) { - var result = data[key]; - return result === HASH_UNDEFINED ? undefined : result; - } - return hasOwnProperty.call(data, key) ? data[key] : undefined; -} - -/** - * Checks if a hash value for `key` exists. - * - * @private - * @name has - * @memberOf Hash - * @param {string} key The key of the entry to check. - * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. - */ -function hashHas(key) { - var data = this.__data__; - return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key); -} - -/** - * Sets the hash `key` to `value`. - * - * @private - * @name set - * @memberOf Hash - * @param {string} key The key of the value to set. - * @param {*} value The value to set. - * @returns {Object} Returns the hash instance. - */ -function hashSet(key, value) { - var data = this.__data__; - data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value; - return this; -} - -// Add methods to `Hash`. -Hash.prototype.clear = hashClear; -Hash.prototype['delete'] = hashDelete; -Hash.prototype.get = hashGet; -Hash.prototype.has = hashHas; -Hash.prototype.set = hashSet; - -/** - * Creates an list cache object. - * - * @private - * @constructor - * @param {Array} [entries] The key-value pairs to cache. - */ -function ListCache(entries) { - var index = -1, - length = entries ? entries.length : 0; - - this.clear(); - while (++index < length) { - var entry = entries[index]; - this.set(entry[0], entry[1]); - } -} - -/** - * Removes all key-value entries from the list cache. - * - * @private - * @name clear - * @memberOf ListCache - */ -function listCacheClear() { - this.__data__ = []; -} - -/** - * Removes `key` and its value from the list cache. - * - * @private - * @name delete - * @memberOf ListCache - * @param {string} key The key of the value to remove. - * @returns {boolean} Returns `true` if the entry was removed, else `false`. - */ -function listCacheDelete(key) { - var data = this.__data__, - index = assocIndexOf(data, key); - - if (index < 0) { - return false; - } - var lastIndex = data.length - 1; - if (index == lastIndex) { - data.pop(); - } else { - splice.call(data, index, 1); - } - return true; -} - -/** - * Gets the list cache value for `key`. - * - * @private - * @name get - * @memberOf ListCache - * @param {string} key The key of the value to get. - * @returns {*} Returns the entry value. - */ -function listCacheGet(key) { - var data = this.__data__, - index = assocIndexOf(data, key); - - return index < 0 ? undefined : data[index][1]; -} - -/** - * Checks if a list cache value for `key` exists. - * - * @private - * @name has - * @memberOf ListCache - * @param {string} key The key of the entry to check. - * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. - */ -function listCacheHas(key) { - return assocIndexOf(this.__data__, key) > -1; -} - -/** - * Sets the list cache `key` to `value`. - * - * @private - * @name set - * @memberOf ListCache - * @param {string} key The key of the value to set. - * @param {*} value The value to set. - * @returns {Object} Returns the list cache instance. - */ -function listCacheSet(key, value) { - var data = this.__data__, - index = assocIndexOf(data, key); - - if (index < 0) { - data.push([key, value]); - } else { - data[index][1] = value; - } - return this; -} - -// Add methods to `ListCache`. -ListCache.prototype.clear = listCacheClear; -ListCache.prototype['delete'] = listCacheDelete; -ListCache.prototype.get = listCacheGet; -ListCache.prototype.has = listCacheHas; -ListCache.prototype.set = listCacheSet; - -/** - * Creates a map cache object to store key-value pairs. - * - * @private - * @constructor - * @param {Array} [entries] The key-value pairs to cache. - */ -function MapCache(entries) { - var index = -1, - length = entries ? entries.length : 0; - - this.clear(); - while (++index < length) { - var entry = entries[index]; - this.set(entry[0], entry[1]); - } -} - -/** - * Removes all key-value entries from the map. - * - * @private - * @name clear - * @memberOf MapCache - */ -function mapCacheClear() { - this.__data__ = { - 'hash': new Hash, - 'map': new (Map || ListCache), - 'string': new Hash - }; -} - -/** - * Removes `key` and its value from the map. - * - * @private - * @name delete - * @memberOf MapCache - * @param {string} key The key of the value to remove. - * @returns {boolean} Returns `true` if the entry was removed, else `false`. - */ -function mapCacheDelete(key) { - return getMapData(this, key)['delete'](key); -} - -/** - * Gets the map value for `key`. - * - * @private - * @name get - * @memberOf MapCache - * @param {string} key The key of the value to get. - * @returns {*} Returns the entry value. - */ -function mapCacheGet(key) { - return getMapData(this, key).get(key); -} - -/** - * Checks if a map value for `key` exists. - * - * @private - * @name has - * @memberOf MapCache - * @param {string} key The key of the entry to check. - * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. - */ -function mapCacheHas(key) { - return getMapData(this, key).has(key); -} - -/** - * Sets the map `key` to `value`. - * - * @private - * @name set - * @memberOf MapCache - * @param {string} key The key of the value to set. - * @param {*} value The value to set. - * @returns {Object} Returns the map cache instance. - */ -function mapCacheSet(key, value) { - getMapData(this, key).set(key, value); - return this; -} - -// Add methods to `MapCache`. -MapCache.prototype.clear = mapCacheClear; -MapCache.prototype['delete'] = mapCacheDelete; -MapCache.prototype.get = mapCacheGet; -MapCache.prototype.has = mapCacheHas; -MapCache.prototype.set = mapCacheSet; - -/** - * - * Creates an array cache object to store unique values. - * - * @private - * @constructor - * @param {Array} [values] The values to cache. - */ -function SetCache(values) { - var index = -1, - length = values ? values.length : 0; - - this.__data__ = new MapCache; - while (++index < length) { - this.add(values[index]); - } -} - -/** - * Adds `value` to the array cache. - * - * @private - * @name add - * @memberOf SetCache - * @alias push - * @param {*} value The value to cache. - * @returns {Object} Returns the cache instance. - */ -function setCacheAdd(value) { - this.__data__.set(value, HASH_UNDEFINED); - return this; -} - -/** - * Checks if `value` is in the array cache. - * - * @private - * @name has - * @memberOf SetCache - * @param {*} value The value to search for. - * @returns {number} Returns `true` if `value` is found, else `false`. - */ -function setCacheHas(value) { - return this.__data__.has(value); -} - -// Add methods to `SetCache`. -SetCache.prototype.add = SetCache.prototype.push = setCacheAdd; -SetCache.prototype.has = setCacheHas; - -/** - * Gets the index at which the `key` is found in `array` of key-value pairs. - * - * @private - * @param {Array} array The array to search. - * @param {*} key The key to search for. - * @returns {number} Returns the index of the matched value, else `-1`. - */ -function assocIndexOf(array, key) { - var length = array.length; - while (length--) { - if (eq(array[length][0], key)) { - return length; - } - } - return -1; -} - -/** - * The base implementation of `_.uniqBy` without support for iteratee shorthands. - * - * @private - * @param {Array} array The array to inspect. - * @param {Function} [iteratee] The iteratee invoked per element. - * @param {Function} [comparator] The comparator invoked per element. - * @returns {Array} Returns the new duplicate free array. - */ -function baseUniq(array, iteratee, comparator) { - var index = -1, - includes = arrayIncludes, - length = array.length, - isCommon = true, - result = [], - seen = result; - - if (comparator) { - isCommon = false; - includes = arrayIncludesWith; - } - else if (length >= LARGE_ARRAY_SIZE) { - var set = iteratee ? null : createSet(array); - if (set) { - return setToArray(set); - } - isCommon = false; - includes = cacheHas; - seen = new SetCache; - } - else { - seen = iteratee ? [] : result; - } - outer: - while (++index < length) { - var value = array[index], - computed = iteratee ? iteratee(value) : value; - - value = (comparator || value !== 0) ? value : 0; - if (isCommon && computed === computed) { - var seenIndex = seen.length; - while (seenIndex--) { - if (seen[seenIndex] === computed) { - continue outer; - } - } - if (iteratee) { - seen.push(computed); - } - result.push(value); - } - else if (!includes(seen, computed, comparator)) { - if (seen !== result) { - seen.push(computed); - } - result.push(value); - } - } - return result; -} - -/** - * Gets the data for `map`. - * - * @private - * @param {Object} map The map to query. - * @param {string} key The reference key. - * @returns {*} Returns the map data. - */ -function getMapData(map, key) { - var data = map.__data__; - return isKeyable(key) - ? data[typeof key == 'string' ? 'string' : 'hash'] - : data.map; -} - -/** - * Gets the native function at `key` of `object`. - * - * @private - * @param {Object} object The object to query. - * @param {string} key The key of the method to get. - * @returns {*} Returns the function if it's native, else `undefined`. - */ -function getNative(object, key) { - var value = object[key]; - return isNative(value) ? value : undefined; -} - -/** - * Checks if `value` is suitable for use as unique object key. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is suitable, else `false`. - */ -function isKeyable(value) { - var type = typeof value; - return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean') - ? (value !== '__proto__') - : (value === null); -} - -/** - * Converts `func` to its source code. - * - * @private - * @param {Function} func The function to process. - * @returns {string} Returns the source code. - */ -function toSource(func) { - if (func != null) { - try { - return funcToString.call(func); - } catch (e) {} - try { - return (func + ''); - } catch (e) {} - } - return ''; -} - -/** - * Performs a - * [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) - * comparison between two values to determine if they are equivalent. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to compare. - * @param {*} other The other value to compare. - * @returns {boolean} Returns `true` if the values are equivalent, else `false`. - * @example - * - * var object = { 'user': 'fred' }; - * var other = { 'user': 'fred' }; - * - * _.eq(object, object); - * // => true - * - * _.eq(object, other); - * // => false - * - * _.eq('a', 'a'); - * // => true - * - * _.eq('a', Object('a')); - * // => false - * - * _.eq(NaN, NaN); - * // => true - */ -function eq(value, other) { - return value === other || (value !== value && other !== other); -} - -/** - * Checks if `value` is classified as a `Function` object. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, - * else `false`. - * @example - * - * _.isFunction(_); - * // => true - * - * _.isFunction(/abc/); - * // => false - */ -function isFunction(value) { - // The use of `Object#toString` avoids issues with the `typeof` operator - // in Safari 8 which returns 'object' for typed array and weak map constructors, - // and PhantomJS 1.9 which returns 'function' for `NodeList` instances. - var tag = isObject(value) ? objectToString.call(value) : ''; - return tag == funcTag || tag == genTag; -} - -/** - * Checks if `value` is the - * [language type](http://www.ecma-international.org/ecma-262/6.0/#sec-ecmascript-language-types) - * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an object, else `false`. - * @example - * - * _.isObject({}); - * // => true - * - * _.isObject([1, 2, 3]); - * // => true - * - * _.isObject(_.noop); - * // => true - * - * _.isObject(null); - * // => false - */ -function isObject(value) { - var type = typeof value; - return !!value && (type == 'object' || type == 'function'); -} - -/** - * Checks if `value` is a native function. - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a native function, - * else `false`. - * @example - * - * _.isNative(Array.prototype.push); - * // => true - * - * _.isNative(_); - * // => false - */ -function isNative(value) { - if (!isObject(value)) { - return false; - } - var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor; - return pattern.test(toSource(value)); -} - -module.exports = baseUniq; diff --git a/deps/npm/node_modules/lodash._baseuniq/package.json b/deps/npm/node_modules/lodash._baseuniq/package.json deleted file mode 100644 index 9253d8b08a5350..00000000000000 --- a/deps/npm/node_modules/lodash._baseuniq/package.json +++ /dev/null @@ -1,72 +0,0 @@ -{ - "_args": [ - [ - "lodash._baseuniq@4.6.0", - "/Users/rebecca/code/npm" - ] - ], - "_from": "lodash._baseuniq@4.6.0", - "_id": "lodash._baseuniq@4.6.0", - "_inBundle": false, - "_integrity": "sha1-DrtE5FaBSveQXGIS+iybLVG4Qeg=", - "_location": "/lodash._baseuniq", - "_phantomChildren": {}, - "_requested": { - "type": "version", - "registry": true, - "raw": "lodash._baseuniq@4.6.0", - "name": "lodash._baseuniq", - "escapedName": "lodash._baseuniq", - "rawSpec": "4.6.0", - "saveSpec": null, - "fetchSpec": "4.6.0" - }, - "_requiredBy": [ - "/" - ], - "_resolved": "https://registry.npmjs.org/lodash._baseuniq/-/lodash._baseuniq-4.6.0.tgz", - "_spec": "4.6.0", - "_where": "/Users/rebecca/code/npm", - "author": { - "name": "John-David Dalton", - "email": "john.david.dalton@gmail.com", - "url": "http://allyoucanleet.com/" - }, - "bugs": { - "url": "https://github.com/lodash/lodash/issues" - }, - "contributors": [ - { - "name": "John-David Dalton", - "email": "john.david.dalton@gmail.com", - "url": "http://allyoucanleet.com/" - }, - { - "name": "Blaine Bublitz", - "email": "blaine.bublitz@gmail.com", - "url": "https://github.com/phated" - }, - { - "name": "Mathias Bynens", - "email": "mathias@qiwi.be", - "url": "https://mathiasbynens.be/" - } - ], - "dependencies": { - "lodash._createset": "~4.0.0", - "lodash._root": "~3.0.0" - }, - "description": "The internal lodash function `baseUniq` exported as a module.", - "homepage": "https://lodash.com/", - "icon": "https://lodash.com/icon.svg", - "license": "MIT", - "name": "lodash._baseuniq", - "repository": { - "type": "git", - "url": "git+https://github.com/lodash/lodash.git" - }, - "scripts": { - "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" - }, - "version": "4.6.0" -} diff --git a/deps/npm/node_modules/lodash._bindcallback/LICENSE.txt b/deps/npm/node_modules/lodash._bindcallback/LICENSE.txt deleted file mode 100644 index 9cd87e5dcefe58..00000000000000 --- a/deps/npm/node_modules/lodash._bindcallback/LICENSE.txt +++ /dev/null @@ -1,22 +0,0 @@ -Copyright 2012-2015 The Dojo Foundation -Based on Underscore.js, copyright 2009-2015 Jeremy Ashkenas, -DocumentCloud and Investigative Reporters & Editors - -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/lodash._bindcallback/README.md b/deps/npm/node_modules/lodash._bindcallback/README.md deleted file mode 100644 index d287f26d81bc3c..00000000000000 --- a/deps/npm/node_modules/lodash._bindcallback/README.md +++ /dev/null @@ -1,20 +0,0 @@ -# lodash._bindcallback v3.0.1 - -The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) internal `bindCallback` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module. - -## Installation - -Using npm: - -```bash -$ {sudo -H} npm i -g npm -$ npm i --save lodash._bindcallback -``` - -In Node.js/io.js: - -```js -var bindCallback = require('lodash._bindcallback'); -``` - -See the [package source](https://github.com/lodash/lodash/blob/3.0.1-npm-packages/lodash._bindcallback) for more details. diff --git a/deps/npm/node_modules/lodash._bindcallback/index.js b/deps/npm/node_modules/lodash._bindcallback/index.js deleted file mode 100644 index ef6811d1a5ebf3..00000000000000 --- a/deps/npm/node_modules/lodash._bindcallback/index.js +++ /dev/null @@ -1,65 +0,0 @@ -/** - * lodash 3.0.1 (Custom Build) - * Build: `lodash modern modularize exports="npm" -o ./` - * Copyright 2012-2015 The Dojo Foundation - * Based on Underscore.js 1.8.3 - * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - * Available under MIT license - */ - -/** - * A specialized version of `baseCallback` which only supports `this` binding - * and specifying the number of arguments to provide to `func`. - * - * @private - * @param {Function} func The function to bind. - * @param {*} thisArg The `this` binding of `func`. - * @param {number} [argCount] The number of arguments to provide to `func`. - * @returns {Function} Returns the callback. - */ -function bindCallback(func, thisArg, argCount) { - if (typeof func != 'function') { - return identity; - } - if (thisArg === undefined) { - return func; - } - switch (argCount) { - case 1: return function(value) { - return func.call(thisArg, value); - }; - case 3: return function(value, index, collection) { - return func.call(thisArg, value, index, collection); - }; - case 4: return function(accumulator, value, index, collection) { - return func.call(thisArg, accumulator, value, index, collection); - }; - case 5: return function(value, other, key, object, source) { - return func.call(thisArg, value, other, key, object, source); - }; - } - return function() { - return func.apply(thisArg, arguments); - }; -} - -/** - * This method returns the first argument provided to it. - * - * @static - * @memberOf _ - * @category Utility - * @param {*} value Any value. - * @returns {*} Returns `value`. - * @example - * - * var object = { 'user': 'fred' }; - * - * _.identity(object) === object; - * // => true - */ -function identity(value) { - return value; -} - -module.exports = bindCallback; diff --git a/deps/npm/node_modules/lodash._bindcallback/package.json b/deps/npm/node_modules/lodash._bindcallback/package.json deleted file mode 100644 index 2d6587bf47e62b..00000000000000 --- a/deps/npm/node_modules/lodash._bindcallback/package.json +++ /dev/null @@ -1,78 +0,0 @@ -{ - "_args": [ - [ - "lodash._bindcallback@3.0.1", - "/Users/rebecca/code/npm" - ] - ], - "_from": "lodash._bindcallback@3.0.1", - "_id": "lodash._bindcallback@3.0.1", - "_inBundle": false, - "_integrity": "sha1-5THCdkTPi1epnhftlbNcdIeJOS4=", - "_location": "/lodash._bindcallback", - "_phantomChildren": {}, - "_requested": { - "type": "version", - "registry": true, - "raw": "lodash._bindcallback@3.0.1", - "name": "lodash._bindcallback", - "escapedName": "lodash._bindcallback", - "rawSpec": "3.0.1", - "saveSpec": null, - "fetchSpec": "3.0.1" - }, - "_requiredBy": [ - "/" - ], - "_resolved": "https://registry.npmjs.org/lodash._bindcallback/-/lodash._bindcallback-3.0.1.tgz", - "_spec": "3.0.1", - "_where": "/Users/rebecca/code/npm", - "author": { - "name": "John-David Dalton", - "email": "john.david.dalton@gmail.com", - "url": "http://allyoucanleet.com/" - }, - "bugs": { - "url": "https://github.com/lodash/lodash/issues" - }, - "contributors": [ - { - "name": "John-David Dalton", - "email": "john.david.dalton@gmail.com", - "url": "http://allyoucanleet.com/" - }, - { - "name": "Benjamin Tan", - "email": "demoneaux@gmail.com", - "url": "https://d10.github.io/" - }, - { - "name": "Blaine Bublitz", - "email": "blaine@iceddev.com", - "url": "http://www.iceddev.com/" - }, - { - "name": "Kit Cambridge", - "email": "github@kitcambridge.be", - "url": "http://kitcambridge.be/" - }, - { - "name": "Mathias Bynens", - "email": "mathias@qiwi.be", - "url": "https://mathiasbynens.be/" - } - ], - "description": "The modern build of lodash’s internal `bindCallback` as a module.", - "homepage": "https://lodash.com/", - "icon": "https://lodash.com/icon.svg", - "license": "MIT", - "name": "lodash._bindcallback", - "repository": { - "type": "git", - "url": "git+https://github.com/lodash/lodash.git" - }, - "scripts": { - "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" - }, - "version": "3.0.1" -} diff --git a/deps/npm/node_modules/lodash._cacheindexof/LICENSE.txt b/deps/npm/node_modules/lodash._cacheindexof/LICENSE.txt deleted file mode 100644 index 9cd87e5dcefe58..00000000000000 --- a/deps/npm/node_modules/lodash._cacheindexof/LICENSE.txt +++ /dev/null @@ -1,22 +0,0 @@ -Copyright 2012-2015 The Dojo Foundation -Based on Underscore.js, copyright 2009-2015 Jeremy Ashkenas, -DocumentCloud and Investigative Reporters & Editors - -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/lodash._cacheindexof/README.md b/deps/npm/node_modules/lodash._cacheindexof/README.md deleted file mode 100644 index 69d2b62bf5dbed..00000000000000 --- a/deps/npm/node_modules/lodash._cacheindexof/README.md +++ /dev/null @@ -1,20 +0,0 @@ -# lodash._cacheindexof v3.0.2 - -The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) internal `cacheIndexOf` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module. - -## Installation - -Using npm: - -```bash -$ {sudo -H} npm i -g npm -$ npm i --save lodash._cacheindexof -``` - -In Node.js/io.js: - -```js -var cacheIndexOf = require('lodash._cacheindexof'); -``` - -See the [package source](https://github.com/lodash/lodash/blob/3.0.2-npm-packages/lodash._cacheindexof) for more details. diff --git a/deps/npm/node_modules/lodash._cacheindexof/index.js b/deps/npm/node_modules/lodash._cacheindexof/index.js deleted file mode 100644 index bc1d5afcfd5778..00000000000000 --- a/deps/npm/node_modules/lodash._cacheindexof/index.js +++ /dev/null @@ -1,53 +0,0 @@ -/** - * lodash 3.0.2 (Custom Build) - * Build: `lodash modern modularize exports="npm" -o ./` - * Copyright 2012-2015 The Dojo Foundation - * Based on Underscore.js 1.8.3 - * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - * Available under MIT license - */ - -/** - * Checks if `value` is in `cache` mimicking the return signature of - * `_.indexOf` by returning `0` if the value is found, else `-1`. - * - * @private - * @param {Object} cache The cache to search. - * @param {*} value The value to search for. - * @returns {number} Returns `0` if `value` is found, else `-1`. - */ -function cacheIndexOf(cache, value) { - var data = cache.data, - result = (typeof value == 'string' || isObject(value)) ? data.set.has(value) : data.hash[value]; - - return result ? 0 : -1; -} - -/** - * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`. - * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an object, else `false`. - * @example - * - * _.isObject({}); - * // => true - * - * _.isObject([1, 2, 3]); - * // => true - * - * _.isObject(1); - * // => false - */ -function isObject(value) { - // Avoid a V8 JIT bug in Chrome 19-20. - // See https://code.google.com/p/v8/issues/detail?id=2291 for more details. - var type = typeof value; - return !!value && (type == 'object' || type == 'function'); -} - -module.exports = cacheIndexOf; diff --git a/deps/npm/node_modules/lodash._cacheindexof/package.json b/deps/npm/node_modules/lodash._cacheindexof/package.json deleted file mode 100644 index 5b2bfd283f3bf8..00000000000000 --- a/deps/npm/node_modules/lodash._cacheindexof/package.json +++ /dev/null @@ -1,78 +0,0 @@ -{ - "_args": [ - [ - "lodash._cacheindexof@3.0.2", - "/Users/rebecca/code/npm" - ] - ], - "_from": "lodash._cacheindexof@3.0.2", - "_id": "lodash._cacheindexof@3.0.2", - "_inBundle": false, - "_integrity": "sha1-PcaayCSY0u5ePOVgkbr9Ktx73pI=", - "_location": "/lodash._cacheindexof", - "_phantomChildren": {}, - "_requested": { - "type": "version", - "registry": true, - "raw": "lodash._cacheindexof@3.0.2", - "name": "lodash._cacheindexof", - "escapedName": "lodash._cacheindexof", - "rawSpec": "3.0.2", - "saveSpec": null, - "fetchSpec": "3.0.2" - }, - "_requiredBy": [ - "/" - ], - "_resolved": "https://registry.npmjs.org/lodash._cacheindexof/-/lodash._cacheindexof-3.0.2.tgz", - "_spec": "3.0.2", - "_where": "/Users/rebecca/code/npm", - "author": { - "name": "John-David Dalton", - "email": "john.david.dalton@gmail.com", - "url": "http://allyoucanleet.com/" - }, - "bugs": { - "url": "https://github.com/lodash/lodash/issues" - }, - "contributors": [ - { - "name": "John-David Dalton", - "email": "john.david.dalton@gmail.com", - "url": "http://allyoucanleet.com/" - }, - { - "name": "Benjamin Tan", - "email": "demoneaux@gmail.com", - "url": "https://d10.github.io/" - }, - { - "name": "Blaine Bublitz", - "email": "blaine@iceddev.com", - "url": "http://www.iceddev.com/" - }, - { - "name": "Kit Cambridge", - "email": "github@kitcambridge.be", - "url": "http://kitcambridge.be/" - }, - { - "name": "Mathias Bynens", - "email": "mathias@qiwi.be", - "url": "https://mathiasbynens.be/" - } - ], - "description": "The modern build of lodash’s internal `cacheIndexOf` as a module.", - "homepage": "https://lodash.com/", - "icon": "https://lodash.com/icon.svg", - "license": "MIT", - "name": "lodash._cacheindexof", - "repository": { - "type": "git", - "url": "git+https://github.com/lodash/lodash.git" - }, - "scripts": { - "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" - }, - "version": "3.0.2" -} diff --git a/deps/npm/node_modules/lodash._createcache/LICENSE b/deps/npm/node_modules/lodash._createcache/LICENSE deleted file mode 100644 index 9cd87e5dcefe58..00000000000000 --- a/deps/npm/node_modules/lodash._createcache/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -Copyright 2012-2015 The Dojo Foundation -Based on Underscore.js, copyright 2009-2015 Jeremy Ashkenas, -DocumentCloud and Investigative Reporters & Editors - -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/lodash._createcache/README.md b/deps/npm/node_modules/lodash._createcache/README.md deleted file mode 100644 index 0ee4834d086a5b..00000000000000 --- a/deps/npm/node_modules/lodash._createcache/README.md +++ /dev/null @@ -1,20 +0,0 @@ -# lodash._createcache v3.1.2 - -The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) internal `createCache` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module. - -## Installation - -Using npm: - -```bash -$ {sudo -H} npm i -g npm -$ npm i --save lodash._createcache -``` - -In Node.js/io.js: - -```js -var createCache = require('lodash._createcache'); -``` - -See the [package source](https://github.com/lodash/lodash/blob/3.1.2-npm-packages/lodash._createcache) for more details. diff --git a/deps/npm/node_modules/lodash._createcache/index.js b/deps/npm/node_modules/lodash._createcache/index.js deleted file mode 100644 index 6cf391c1497a4c..00000000000000 --- a/deps/npm/node_modules/lodash._createcache/index.js +++ /dev/null @@ -1,91 +0,0 @@ -/** - * lodash 3.1.2 (Custom Build) - * Build: `lodash modern modularize exports="npm" -o ./` - * Copyright 2012-2015 The Dojo Foundation - * Based on Underscore.js 1.8.3 - * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - * Available under MIT license - */ -var getNative = require('lodash._getnative'); - -/** Native method references. */ -var Set = getNative(global, 'Set'); - -/* Native method references for those with the same name as other `lodash` methods. */ -var nativeCreate = getNative(Object, 'create'); - -/** - * - * Creates a cache object to store unique values. - * - * @private - * @param {Array} [values] The values to cache. - */ -function SetCache(values) { - var length = values ? values.length : 0; - - this.data = { 'hash': nativeCreate(null), 'set': new Set }; - while (length--) { - this.push(values[length]); - } -} - -/** - * Adds `value` to the cache. - * - * @private - * @name push - * @memberOf SetCache - * @param {*} value The value to cache. - */ -function cachePush(value) { - var data = this.data; - if (typeof value == 'string' || isObject(value)) { - data.set.add(value); - } else { - data.hash[value] = true; - } -} - -/** - * Creates a `Set` cache object to optimize linear searches of large arrays. - * - * @private - * @param {Array} [values] The values to cache. - * @returns {null|Object} Returns the new cache object if `Set` is supported, else `null`. - */ -function createCache(values) { - return (nativeCreate && Set) ? new SetCache(values) : null; -} - -/** - * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`. - * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an object, else `false`. - * @example - * - * _.isObject({}); - * // => true - * - * _.isObject([1, 2, 3]); - * // => true - * - * _.isObject(1); - * // => false - */ -function isObject(value) { - // Avoid a V8 JIT bug in Chrome 19-20. - // See https://code.google.com/p/v8/issues/detail?id=2291 for more details. - var type = typeof value; - return !!value && (type == 'object' || type == 'function'); -} - -// Add functions to the `Set` cache. -SetCache.prototype.push = cachePush; - -module.exports = createCache; diff --git a/deps/npm/node_modules/lodash._createcache/package.json b/deps/npm/node_modules/lodash._createcache/package.json deleted file mode 100644 index 8ea87a843c07a9..00000000000000 --- a/deps/npm/node_modules/lodash._createcache/package.json +++ /dev/null @@ -1,81 +0,0 @@ -{ - "_args": [ - [ - "lodash._createcache@3.1.2", - "/Users/rebecca/code/npm" - ] - ], - "_from": "lodash._createcache@3.1.2", - "_id": "lodash._createcache@3.1.2", - "_inBundle": false, - "_integrity": "sha1-VtagZAF2JeeevKa4AY4XRAvc8JM=", - "_location": "/lodash._createcache", - "_phantomChildren": {}, - "_requested": { - "type": "version", - "registry": true, - "raw": "lodash._createcache@3.1.2", - "name": "lodash._createcache", - "escapedName": "lodash._createcache", - "rawSpec": "3.1.2", - "saveSpec": null, - "fetchSpec": "3.1.2" - }, - "_requiredBy": [ - "/" - ], - "_resolved": "https://registry.npmjs.org/lodash._createcache/-/lodash._createcache-3.1.2.tgz", - "_spec": "3.1.2", - "_where": "/Users/rebecca/code/npm", - "author": { - "name": "John-David Dalton", - "email": "john.david.dalton@gmail.com", - "url": "http://allyoucanleet.com/" - }, - "bugs": { - "url": "https://github.com/lodash/lodash/issues" - }, - "contributors": [ - { - "name": "John-David Dalton", - "email": "john.david.dalton@gmail.com", - "url": "http://allyoucanleet.com/" - }, - { - "name": "Benjamin Tan", - "email": "demoneaux@gmail.com", - "url": "https://d10.github.io/" - }, - { - "name": "Blaine Bublitz", - "email": "blaine@iceddev.com", - "url": "http://www.iceddev.com/" - }, - { - "name": "Kit Cambridge", - "email": "github@kitcambridge.be", - "url": "http://kitcambridge.be/" - }, - { - "name": "Mathias Bynens", - "email": "mathias@qiwi.be", - "url": "https://mathiasbynens.be/" - } - ], - "dependencies": { - "lodash._getnative": "^3.0.0" - }, - "description": "The modern build of lodash’s internal `createCache` as a module.", - "homepage": "https://lodash.com/", - "icon": "https://lodash.com/icon.svg", - "license": "MIT", - "name": "lodash._createcache", - "repository": { - "type": "git", - "url": "git+https://github.com/lodash/lodash.git" - }, - "scripts": { - "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" - }, - "version": "3.1.2" -} diff --git a/deps/npm/node_modules/lodash._createset/LICENSE b/deps/npm/node_modules/lodash._createset/LICENSE deleted file mode 100644 index e0c69d56032d15..00000000000000 --- a/deps/npm/node_modules/lodash._createset/LICENSE +++ /dev/null @@ -1,47 +0,0 @@ -Copyright jQuery Foundation and other contributors - -Based on Underscore.js, copyright Jeremy Ashkenas, -DocumentCloud and Investigative Reporters & Editors - -This software consists of voluntary contributions made by many -individuals. For exact contribution history, see the revision history -available at https://github.com/lodash/lodash - -The following license applies to all parts of this software except as -documented below: - -==== - -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. - -==== - -Copyright and related rights for sample code are waived via CC0. Sample -code is defined as all source code displayed within the prose of the -documentation. - -CC0: http://creativecommons.org/publicdomain/zero/1.0/ - -==== - -Files located in the node_modules and vendor directories are externally -maintained libraries used by this software which have their own -licenses; we recommend you read them, as their terms may differ from the -terms above. diff --git a/deps/npm/node_modules/lodash._createset/README.md b/deps/npm/node_modules/lodash._createset/README.md deleted file mode 100644 index 6486d7e85ffd22..00000000000000 --- a/deps/npm/node_modules/lodash._createset/README.md +++ /dev/null @@ -1,18 +0,0 @@ -# lodash._createset v4.0.3 - -The internal [lodash](https://lodash.com/) function `createSet` exported as a [Node.js](https://nodejs.org/) module. - -## Installation - -Using npm: -```bash -$ {sudo -H} npm i -g npm -$ npm i --save lodash._createset -``` - -In Node.js: -```js -var createSet = require('lodash._createset'); -``` - -See the [package source](https://github.com/lodash/lodash/blob/4.0.3-npm-packages/lodash._createset) for more details. diff --git a/deps/npm/node_modules/lodash._createset/index.js b/deps/npm/node_modules/lodash._createset/index.js deleted file mode 100644 index 9cadd2eeebe1fe..00000000000000 --- a/deps/npm/node_modules/lodash._createset/index.js +++ /dev/null @@ -1,280 +0,0 @@ -/** - * lodash (Custom Build) - * Build: `lodash modularize exports="npm" -o ./` - * Copyright jQuery Foundation and other contributors - * Released under MIT license - * Based on Underscore.js 1.8.3 - * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - */ - -/** Used as references for various `Number` constants. */ -var INFINITY = 1 / 0; - -/** `Object#toString` result references. */ -var funcTag = '[object Function]', - genTag = '[object GeneratorFunction]'; - -/** - * Used to match `RegExp` - * [syntax characters](http://ecma-international.org/ecma-262/6.0/#sec-patterns). - */ -var reRegExpChar = /[\\^$.*+?()[\]{}|]/g; - -/** Used to detect host constructors (Safari). */ -var reIsHostCtor = /^\[object .+?Constructor\]$/; - -/** Used to determine if values are of the language type `Object`. */ -var objectTypes = { - 'function': true, - 'object': true -}; - -/** Detect free variable `exports`. */ -var freeExports = (objectTypes[typeof exports] && exports && !exports.nodeType) - ? exports - : undefined; - -/** Detect free variable `module`. */ -var freeModule = (objectTypes[typeof module] && module && !module.nodeType) - ? module - : undefined; - -/** Detect free variable `global` from Node.js. */ -var freeGlobal = checkGlobal(freeExports && freeModule && typeof global == 'object' && global); - -/** Detect free variable `self`. */ -var freeSelf = checkGlobal(objectTypes[typeof self] && self); - -/** Detect free variable `window`. */ -var freeWindow = checkGlobal(objectTypes[typeof window] && window); - -/** Detect `this` as the global object. */ -var thisGlobal = checkGlobal(objectTypes[typeof this] && this); - -/** - * Used as a reference to the global object. - * - * The `this` value is used if it's the global object to avoid Greasemonkey's - * restricted `window` object, otherwise the `window` object is used. - */ -var root = freeGlobal || - ((freeWindow !== (thisGlobal && thisGlobal.window)) && freeWindow) || - freeSelf || thisGlobal || Function('return this')(); - -/** - * Checks if `value` is a global object. - * - * @private - * @param {*} value The value to check. - * @returns {null|Object} Returns `value` if it's a global object, else `null`. - */ -function checkGlobal(value) { - return (value && value.Object === Object) ? value : null; -} - -/** - * Checks if `value` is a host object in IE < 9. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a host object, else `false`. - */ -function isHostObject(value) { - // Many host objects are `Object` objects that can coerce to strings - // despite having improperly defined `toString` methods. - var result = false; - if (value != null && typeof value.toString != 'function') { - try { - result = !!(value + ''); - } catch (e) {} - } - return result; -} - -/** - * Converts `set` to an array of its values. - * - * @private - * @param {Object} set The set to convert. - * @returns {Array} Returns the values. - */ -function setToArray(set) { - var index = -1, - result = Array(set.size); - - set.forEach(function(value) { - result[++index] = value; - }); - return result; -} - -/** Used for built-in method references. */ -var objectProto = Object.prototype; - -/** Used to resolve the decompiled source of functions. */ -var funcToString = Function.prototype.toString; - -/** Used to check objects for own properties. */ -var hasOwnProperty = objectProto.hasOwnProperty; - -/** - * Used to resolve the - * [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) - * of values. - */ -var objectToString = objectProto.toString; - -/** Used to detect if a method is native. */ -var reIsNative = RegExp('^' + - funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&') - .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$' -); - -/* Built-in method references that are verified to be native. */ -var Set = getNative(root, 'Set'); - -/** - * Creates a set of `values`. - * - * @private - * @param {Array} values The values to add to the set. - * @returns {Object} Returns the new set. - */ -var createSet = !(Set && (1 / setToArray(new Set([,-0]))[1]) == INFINITY) ? noop : function(values) { - return new Set(values); -}; - -/** - * Gets the native function at `key` of `object`. - * - * @private - * @param {Object} object The object to query. - * @param {string} key The key of the method to get. - * @returns {*} Returns the function if it's native, else `undefined`. - */ -function getNative(object, key) { - var value = object[key]; - return isNative(value) ? value : undefined; -} - -/** - * Converts `func` to its source code. - * - * @private - * @param {Function} func The function to process. - * @returns {string} Returns the source code. - */ -function toSource(func) { - if (func != null) { - try { - return funcToString.call(func); - } catch (e) {} - try { - return (func + ''); - } catch (e) {} - } - return ''; -} - -/** - * Checks if `value` is classified as a `Function` object. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, - * else `false`. - * @example - * - * _.isFunction(_); - * // => true - * - * _.isFunction(/abc/); - * // => false - */ -function isFunction(value) { - // The use of `Object#toString` avoids issues with the `typeof` operator - // in Safari 8 which returns 'object' for typed array and weak map constructors, - // and PhantomJS 1.9 which returns 'function' for `NodeList` instances. - var tag = isObject(value) ? objectToString.call(value) : ''; - return tag == funcTag || tag == genTag; -} - -/** - * Checks if `value` is the - * [language type](http://www.ecma-international.org/ecma-262/6.0/#sec-ecmascript-language-types) - * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an object, else `false`. - * @example - * - * _.isObject({}); - * // => true - * - * _.isObject([1, 2, 3]); - * // => true - * - * _.isObject(_.noop); - * // => true - * - * _.isObject(null); - * // => false - */ -function isObject(value) { - var type = typeof value; - return !!value && (type == 'object' || type == 'function'); -} - -/** - * Checks if `value` is a native function. - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a native function, - * else `false`. - * @example - * - * _.isNative(Array.prototype.push); - * // => true - * - * _.isNative(_); - * // => false - */ -function isNative(value) { - if (!isObject(value)) { - return false; - } - var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor; - return pattern.test(toSource(value)); -} - -/** - * A no-operation function that returns `undefined` regardless of the - * arguments it receives. - * - * @static - * @memberOf _ - * @since 2.3.0 - * @category Util - * @example - * - * var object = { 'user': 'fred' }; - * - * _.noop(object) === undefined; - * // => true - */ -function noop() { - // No operation performed. -} - -module.exports = createSet; diff --git a/deps/npm/node_modules/lodash._createset/package.json b/deps/npm/node_modules/lodash._createset/package.json deleted file mode 100644 index 723f56e3aaa975..00000000000000 --- a/deps/npm/node_modules/lodash._createset/package.json +++ /dev/null @@ -1,65 +0,0 @@ -{ - "_from": "lodash._createset@~4.0.0", - "_id": "lodash._createset@4.0.3", - "_inBundle": false, - "_integrity": "sha1-D0ZZ+7CddRlPqeK4imZE02PJ/iY=", - "_location": "/lodash._createset", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "lodash._createset@~4.0.0", - "name": "lodash._createset", - "escapedName": "lodash._createset", - "rawSpec": "~4.0.0", - "saveSpec": null, - "fetchSpec": "~4.0.0" - }, - "_requiredBy": [ - "/lodash._baseuniq" - ], - "_resolved": "https://registry.npmjs.org/lodash._createset/-/lodash._createset-4.0.3.tgz", - "_shasum": "0f4659fbb09d75194fa9e2b88a6644d363c9fe26", - "_spec": "lodash._createset@~4.0.0", - "_where": "/Users/rebecca/code/npm/node_modules/lodash._baseuniq", - "author": { - "name": "John-David Dalton", - "email": "john.david.dalton@gmail.com", - "url": "http://allyoucanleet.com/" - }, - "bugs": { - "url": "https://github.com/lodash/lodash/issues" - }, - "bundleDependencies": false, - "contributors": [ - { - "name": "John-David Dalton", - "email": "john.david.dalton@gmail.com", - "url": "http://allyoucanleet.com/" - }, - { - "name": "Blaine Bublitz", - "email": "blaine.bublitz@gmail.com", - "url": "https://github.com/phated" - }, - { - "name": "Mathias Bynens", - "email": "mathias@qiwi.be", - "url": "https://mathiasbynens.be/" - } - ], - "deprecated": false, - "description": "The internal lodash function `createSet` exported as a module.", - "homepage": "https://lodash.com/", - "icon": "https://lodash.com/icon.svg", - "license": "MIT", - "name": "lodash._createset", - "repository": { - "type": "git", - "url": "git+https://github.com/lodash/lodash.git" - }, - "scripts": { - "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" - }, - "version": "4.0.3" -} diff --git a/deps/npm/node_modules/lodash._getnative/LICENSE b/deps/npm/node_modules/lodash._getnative/LICENSE deleted file mode 100644 index 9cd87e5dcefe58..00000000000000 --- a/deps/npm/node_modules/lodash._getnative/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -Copyright 2012-2015 The Dojo Foundation -Based on Underscore.js, copyright 2009-2015 Jeremy Ashkenas, -DocumentCloud and Investigative Reporters & Editors - -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/lodash._getnative/README.md b/deps/npm/node_modules/lodash._getnative/README.md deleted file mode 100644 index 7835cec0ab1c02..00000000000000 --- a/deps/npm/node_modules/lodash._getnative/README.md +++ /dev/null @@ -1,20 +0,0 @@ -# lodash._getnative v3.9.1 - -The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) internal `getNative` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module. - -## Installation - -Using npm: - -```bash -$ {sudo -H} npm i -g npm -$ npm i --save lodash._getnative -``` - -In Node.js/io.js: - -```js -var getNative = require('lodash._getnative'); -``` - -See the [package source](https://github.com/lodash/lodash/blob/3.9.1-npm-packages/lodash._getnative) for more details. diff --git a/deps/npm/node_modules/lodash._getnative/index.js b/deps/npm/node_modules/lodash._getnative/index.js deleted file mode 100644 index a32063d27b9e74..00000000000000 --- a/deps/npm/node_modules/lodash._getnative/index.js +++ /dev/null @@ -1,137 +0,0 @@ -/** - * lodash 3.9.1 (Custom Build) - * Build: `lodash modern modularize exports="npm" -o ./` - * Copyright 2012-2015 The Dojo Foundation - * Based on Underscore.js 1.8.3 - * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - * Available under MIT license - */ - -/** `Object#toString` result references. */ -var funcTag = '[object Function]'; - -/** Used to detect host constructors (Safari > 5). */ -var reIsHostCtor = /^\[object .+?Constructor\]$/; - -/** - * Checks if `value` is object-like. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is object-like, else `false`. - */ -function isObjectLike(value) { - return !!value && typeof value == 'object'; -} - -/** Used for native method references. */ -var objectProto = Object.prototype; - -/** Used to resolve the decompiled source of functions. */ -var fnToString = Function.prototype.toString; - -/** Used to check objects for own properties. */ -var hasOwnProperty = objectProto.hasOwnProperty; - -/** - * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) - * of values. - */ -var objToString = objectProto.toString; - -/** Used to detect if a method is native. */ -var reIsNative = RegExp('^' + - fnToString.call(hasOwnProperty).replace(/[\\^$.*+?()[\]{}|]/g, '\\$&') - .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$' -); - -/** - * Gets the native function at `key` of `object`. - * - * @private - * @param {Object} object The object to query. - * @param {string} key The key of the method to get. - * @returns {*} Returns the function if it's native, else `undefined`. - */ -function getNative(object, key) { - var value = object == null ? undefined : object[key]; - return isNative(value) ? value : undefined; -} - -/** - * Checks if `value` is classified as a `Function` object. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. - * @example - * - * _.isFunction(_); - * // => true - * - * _.isFunction(/abc/); - * // => false - */ -function isFunction(value) { - // The use of `Object#toString` avoids issues with the `typeof` operator - // in older versions of Chrome and Safari which return 'function' for regexes - // and Safari 8 equivalents which return 'object' for typed array constructors. - return isObject(value) && objToString.call(value) == funcTag; -} - -/** - * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`. - * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an object, else `false`. - * @example - * - * _.isObject({}); - * // => true - * - * _.isObject([1, 2, 3]); - * // => true - * - * _.isObject(1); - * // => false - */ -function isObject(value) { - // Avoid a V8 JIT bug in Chrome 19-20. - // See https://code.google.com/p/v8/issues/detail?id=2291 for more details. - var type = typeof value; - return !!value && (type == 'object' || type == 'function'); -} - -/** - * Checks if `value` is a native function. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a native function, else `false`. - * @example - * - * _.isNative(Array.prototype.push); - * // => true - * - * _.isNative(_); - * // => false - */ -function isNative(value) { - if (value == null) { - return false; - } - if (isFunction(value)) { - return reIsNative.test(fnToString.call(value)); - } - return isObjectLike(value) && reIsHostCtor.test(value); -} - -module.exports = getNative; diff --git a/deps/npm/node_modules/lodash._getnative/package.json b/deps/npm/node_modules/lodash._getnative/package.json deleted file mode 100644 index d46151be8d4d8d..00000000000000 --- a/deps/npm/node_modules/lodash._getnative/package.json +++ /dev/null @@ -1,79 +0,0 @@ -{ - "_args": [ - [ - "lodash._getnative@3.9.1", - "/Users/rebecca/code/npm" - ] - ], - "_from": "lodash._getnative@3.9.1", - "_id": "lodash._getnative@3.9.1", - "_inBundle": false, - "_integrity": "sha1-VwvH3t5G1hzc3mh9ZdPuy6o6r/U=", - "_location": "/lodash._getnative", - "_phantomChildren": {}, - "_requested": { - "type": "version", - "registry": true, - "raw": "lodash._getnative@3.9.1", - "name": "lodash._getnative", - "escapedName": "lodash._getnative", - "rawSpec": "3.9.1", - "saveSpec": null, - "fetchSpec": "3.9.1" - }, - "_requiredBy": [ - "/", - "/lodash._createcache" - ], - "_resolved": "https://registry.npmjs.org/lodash._getnative/-/lodash._getnative-3.9.1.tgz", - "_spec": "3.9.1", - "_where": "/Users/rebecca/code/npm", - "author": { - "name": "John-David Dalton", - "email": "john.david.dalton@gmail.com", - "url": "http://allyoucanleet.com/" - }, - "bugs": { - "url": "https://github.com/lodash/lodash/issues" - }, - "contributors": [ - { - "name": "John-David Dalton", - "email": "john.david.dalton@gmail.com", - "url": "http://allyoucanleet.com/" - }, - { - "name": "Benjamin Tan", - "email": "demoneaux@gmail.com", - "url": "https://d10.github.io/" - }, - { - "name": "Blaine Bublitz", - "email": "blaine@iceddev.com", - "url": "http://www.iceddev.com/" - }, - { - "name": "Kit Cambridge", - "email": "github@kitcambridge.be", - "url": "http://kitcambridge.be/" - }, - { - "name": "Mathias Bynens", - "email": "mathias@qiwi.be", - "url": "https://mathiasbynens.be/" - } - ], - "description": "The modern build of lodash’s internal `getNative` as a module.", - "homepage": "https://lodash.com/", - "icon": "https://lodash.com/icon.svg", - "license": "MIT", - "name": "lodash._getnative", - "repository": { - "type": "git", - "url": "git+https://github.com/lodash/lodash.git" - }, - "scripts": { - "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" - }, - "version": "3.9.1" -} diff --git a/deps/npm/node_modules/lodash._root/LICENSE b/deps/npm/node_modules/lodash._root/LICENSE deleted file mode 100644 index bcbe13d67a9621..00000000000000 --- a/deps/npm/node_modules/lodash._root/LICENSE +++ /dev/null @@ -1,23 +0,0 @@ -The MIT License (MIT) - -Copyright 2012-2016 The Dojo Foundation -Based on Underscore.js, copyright 2009-2016 Jeremy Ashkenas, -DocumentCloud and Investigative Reporters & Editors - -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/lodash._root/README.md b/deps/npm/node_modules/lodash._root/README.md deleted file mode 100644 index 0329abf23d6735..00000000000000 --- a/deps/npm/node_modules/lodash._root/README.md +++ /dev/null @@ -1,18 +0,0 @@ -# lodash._root v3.0.1 - -The internal [lodash](https://lodash.com/) function `root` exported as a [Node.js](https://nodejs.org/) module. - -## Installation - -Using npm: -```bash -$ {sudo -H} npm i -g npm -$ npm i --save lodash._root -``` - -In Node.js: -```js -var root = require('lodash._root'); -``` - -See the [package source](https://github.com/lodash/lodash/blob/3.0.1-npm-packages/lodash._root) for more details. diff --git a/deps/npm/node_modules/lodash._root/index.js b/deps/npm/node_modules/lodash._root/index.js deleted file mode 100644 index 2d8ba0affc4d12..00000000000000 --- a/deps/npm/node_modules/lodash._root/index.js +++ /dev/null @@ -1,59 +0,0 @@ -/** - * lodash 3.0.1 (Custom Build) - * Build: `lodash modularize exports="npm" -o ./` - * Copyright 2012-2016 The Dojo Foundation - * Based on Underscore.js 1.8.3 - * Copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - * Available under MIT license - */ - -/** Used to determine if values are of the language type `Object`. */ -var objectTypes = { - 'function': true, - 'object': true -}; - -/** Detect free variable `exports`. */ -var freeExports = (objectTypes[typeof exports] && exports && !exports.nodeType) - ? exports - : undefined; - -/** Detect free variable `module`. */ -var freeModule = (objectTypes[typeof module] && module && !module.nodeType) - ? module - : undefined; - -/** Detect free variable `global` from Node.js. */ -var freeGlobal = checkGlobal(freeExports && freeModule && typeof global == 'object' && global); - -/** Detect free variable `self`. */ -var freeSelf = checkGlobal(objectTypes[typeof self] && self); - -/** Detect free variable `window`. */ -var freeWindow = checkGlobal(objectTypes[typeof window] && window); - -/** Detect `this` as the global object. */ -var thisGlobal = checkGlobal(objectTypes[typeof this] && this); - -/** - * Used as a reference to the global object. - * - * The `this` value is used if it's the global object to avoid Greasemonkey's - * restricted `window` object, otherwise the `window` object is used. - */ -var root = freeGlobal || - ((freeWindow !== (thisGlobal && thisGlobal.window)) && freeWindow) || - freeSelf || thisGlobal || Function('return this')(); - -/** - * Checks if `value` is a global object. - * - * @private - * @param {*} value The value to check. - * @returns {null|Object} Returns `value` if it's a global object, else `null`. - */ -function checkGlobal(value) { - return (value && value.Object === Object) ? value : null; -} - -module.exports = root; diff --git a/deps/npm/node_modules/lodash._root/package.json b/deps/npm/node_modules/lodash._root/package.json deleted file mode 100644 index 25673448af85e2..00000000000000 --- a/deps/npm/node_modules/lodash._root/package.json +++ /dev/null @@ -1,65 +0,0 @@ -{ - "_from": "lodash._root@~3.0.0", - "_id": "lodash._root@3.0.1", - "_inBundle": false, - "_integrity": "sha1-+6HEUkwZ7ppfgTa0YJ8BfPTe1pI=", - "_location": "/lodash._root", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "lodash._root@~3.0.0", - "name": "lodash._root", - "escapedName": "lodash._root", - "rawSpec": "~3.0.0", - "saveSpec": null, - "fetchSpec": "~3.0.0" - }, - "_requiredBy": [ - "/lodash._baseuniq" - ], - "_resolved": "https://registry.npmjs.org/lodash._root/-/lodash._root-3.0.1.tgz", - "_shasum": "fba1c4524c19ee9a5f8136b4609f017cf4ded692", - "_spec": "lodash._root@~3.0.0", - "_where": "/Users/rebecca/code/npm/node_modules/lodash._baseuniq", - "author": { - "name": "John-David Dalton", - "email": "john.david.dalton@gmail.com", - "url": "http://allyoucanleet.com/" - }, - "bugs": { - "url": "https://github.com/lodash/lodash/issues" - }, - "bundleDependencies": false, - "contributors": [ - { - "name": "John-David Dalton", - "email": "john.david.dalton@gmail.com", - "url": "http://allyoucanleet.com/" - }, - { - "name": "Blaine Bublitz", - "email": "blaine@iceddev.com", - "url": "https://github.com/phated" - }, - { - "name": "Mathias Bynens", - "email": "mathias@qiwi.be", - "url": "https://mathiasbynens.be/" - } - ], - "deprecated": false, - "description": "The internal lodash function `root` exported as a module.", - "homepage": "https://lodash.com/", - "icon": "https://lodash.com/icon.svg", - "license": "MIT", - "name": "lodash._root", - "repository": { - "type": "git", - "url": "git+https://github.com/lodash/lodash.git" - }, - "scripts": { - "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" - }, - "version": "3.0.1" -} diff --git a/deps/npm/node_modules/lodash.clonedeep/package.json b/deps/npm/node_modules/lodash.clonedeep/package.json index ce678cc4f4f92c..fb1d626d5c6039 100644 --- a/deps/npm/node_modules/lodash.clonedeep/package.json +++ b/deps/npm/node_modules/lodash.clonedeep/package.json @@ -1,72 +1,17 @@ { - "_args": [ - [ - "lodash.clonedeep@4.5.0", - "/Users/rebecca/code/npm" - ] - ], - "_from": "lodash.clonedeep@4.5.0", - "_id": "lodash.clonedeep@4.5.0", - "_inBundle": false, - "_integrity": "sha1-4j8/nE+Pvd6HJSnBBxhXoIblzO8=", - "_location": "/lodash.clonedeep", - "_phantomChildren": {}, - "_requested": { - "type": "version", - "registry": true, - "raw": "lodash.clonedeep@4.5.0", - "name": "lodash.clonedeep", - "escapedName": "lodash.clonedeep", - "rawSpec": "4.5.0", - "saveSpec": null, - "fetchSpec": "4.5.0" - }, - "_requiredBy": [ - "/" - ], - "_resolved": "https://registry.npmjs.org/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz", - "_spec": "4.5.0", - "_where": "/Users/rebecca/code/npm", - "author": { - "name": "John-David Dalton", - "email": "john.david.dalton@gmail.com", - "url": "http://allyoucanleet.com/" - }, - "bugs": { - "url": "https://github.com/lodash/lodash/issues" - }, - "contributors": [ - { - "name": "John-David Dalton", - "email": "john.david.dalton@gmail.com", - "url": "http://allyoucanleet.com/" - }, - { - "name": "Blaine Bublitz", - "email": "blaine.bublitz@gmail.com", - "url": "https://github.com/phated" - }, - { - "name": "Mathias Bynens", - "email": "mathias@qiwi.be", - "url": "https://mathiasbynens.be/" - } - ], + "name": "lodash.clonedeep", + "version": "4.5.0", "description": "The lodash method `_.cloneDeep` exported as a module.", "homepage": "https://lodash.com/", "icon": "https://lodash.com/icon.svg", - "keywords": [ - "lodash-modularized", - "clonedeep" - ], "license": "MIT", - "name": "lodash.clonedeep", - "repository": { - "type": "git", - "url": "git+https://github.com/lodash/lodash.git" - }, - "scripts": { - "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" - }, - "version": "4.5.0" + "keywords": "lodash-modularized, clonedeep", + "author": "John-David Dalton (http://allyoucanleet.com/)", + "contributors": [ + "John-David Dalton (http://allyoucanleet.com/)", + "Blaine Bublitz (https://github.com/phated)", + "Mathias Bynens (https://mathiasbynens.be/)" + ], + "repository": "lodash/lodash", + "scripts": { "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" } } diff --git a/deps/npm/node_modules/lodash.restparam/LICENSE.txt b/deps/npm/node_modules/lodash.restparam/LICENSE.txt deleted file mode 100644 index 9cd87e5dcefe58..00000000000000 --- a/deps/npm/node_modules/lodash.restparam/LICENSE.txt +++ /dev/null @@ -1,22 +0,0 @@ -Copyright 2012-2015 The Dojo Foundation -Based on Underscore.js, copyright 2009-2015 Jeremy Ashkenas, -DocumentCloud and Investigative Reporters & Editors - -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/lodash.restparam/README.md b/deps/npm/node_modules/lodash.restparam/README.md deleted file mode 100644 index 80e47a4f9b2093..00000000000000 --- a/deps/npm/node_modules/lodash.restparam/README.md +++ /dev/null @@ -1,20 +0,0 @@ -# lodash.restparam v3.6.1 - -The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) `_.restParam` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module. - -## Installation - -Using npm: - -```bash -$ {sudo -H} npm i -g npm -$ npm i --save lodash.restparam -``` - -In Node.js/io.js: - -```js -var restParam = require('lodash.restparam'); -``` - -See the [documentation](https://lodash.com/docs#restParam) or [package source](https://github.com/lodash/lodash/blob/3.6.1-npm-packages/lodash.restparam) for more details. diff --git a/deps/npm/node_modules/lodash.restparam/index.js b/deps/npm/node_modules/lodash.restparam/index.js deleted file mode 100644 index 932f47ac743461..00000000000000 --- a/deps/npm/node_modules/lodash.restparam/index.js +++ /dev/null @@ -1,67 +0,0 @@ -/** - * lodash 3.6.1 (Custom Build) - * Build: `lodash modern modularize exports="npm" -o ./` - * Copyright 2012-2015 The Dojo Foundation - * Based on Underscore.js 1.8.3 - * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - * Available under MIT license - */ - -/** Used as the `TypeError` message for "Functions" methods. */ -var FUNC_ERROR_TEXT = 'Expected a function'; - -/* Native method references for those with the same name as other `lodash` methods. */ -var nativeMax = Math.max; - -/** - * Creates a function that invokes `func` with the `this` binding of the - * created function and arguments from `start` and beyond provided as an array. - * - * **Note:** This method is based on the [rest parameter](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/rest_parameters). - * - * @static - * @memberOf _ - * @category Function - * @param {Function} func The function to apply a rest parameter to. - * @param {number} [start=func.length-1] The start position of the rest parameter. - * @returns {Function} Returns the new function. - * @example - * - * var say = _.restParam(function(what, names) { - * return what + ' ' + _.initial(names).join(', ') + - * (_.size(names) > 1 ? ', & ' : '') + _.last(names); - * }); - * - * say('hello', 'fred', 'barney', 'pebbles'); - * // => 'hello fred, barney, & pebbles' - */ -function restParam(func, start) { - if (typeof func != 'function') { - throw new TypeError(FUNC_ERROR_TEXT); - } - start = nativeMax(start === undefined ? (func.length - 1) : (+start || 0), 0); - return function() { - var args = arguments, - index = -1, - length = nativeMax(args.length - start, 0), - rest = Array(length); - - while (++index < length) { - rest[index] = args[start + index]; - } - switch (start) { - case 0: return func.call(this, rest); - case 1: return func.call(this, args[0], rest); - case 2: return func.call(this, args[0], args[1], rest); - } - var otherArgs = Array(start + 1); - index = -1; - while (++index < start) { - otherArgs[index] = args[index]; - } - otherArgs[start] = rest; - return func.apply(this, otherArgs); - }; -} - -module.exports = restParam; diff --git a/deps/npm/node_modules/lodash.restparam/package.json b/deps/npm/node_modules/lodash.restparam/package.json deleted file mode 100644 index 91ffa6f12a20bb..00000000000000 --- a/deps/npm/node_modules/lodash.restparam/package.json +++ /dev/null @@ -1,84 +0,0 @@ -{ - "_args": [ - [ - "lodash.restparam@3.6.1", - "/Users/rebecca/code/npm" - ] - ], - "_from": "lodash.restparam@3.6.1", - "_id": "lodash.restparam@3.6.1", - "_inBundle": false, - "_integrity": "sha1-k2pOMJ7zMKdkXtQUWYbIWuWyCAU=", - "_location": "/lodash.restparam", - "_phantomChildren": {}, - "_requested": { - "type": "version", - "registry": true, - "raw": "lodash.restparam@3.6.1", - "name": "lodash.restparam", - "escapedName": "lodash.restparam", - "rawSpec": "3.6.1", - "saveSpec": null, - "fetchSpec": "3.6.1" - }, - "_requiredBy": [ - "/" - ], - "_resolved": "https://registry.npmjs.org/lodash.restparam/-/lodash.restparam-3.6.1.tgz", - "_spec": "3.6.1", - "_where": "/Users/rebecca/code/npm", - "author": { - "name": "John-David Dalton", - "email": "john.david.dalton@gmail.com", - "url": "http://allyoucanleet.com/" - }, - "bugs": { - "url": "https://github.com/lodash/lodash/issues" - }, - "contributors": [ - { - "name": "John-David Dalton", - "email": "john.david.dalton@gmail.com", - "url": "http://allyoucanleet.com/" - }, - { - "name": "Benjamin Tan", - "email": "demoneaux@gmail.com", - "url": "https://d10.github.io/" - }, - { - "name": "Blaine Bublitz", - "email": "blaine@iceddev.com", - "url": "http://www.iceddev.com/" - }, - { - "name": "Kit Cambridge", - "email": "github@kitcambridge.be", - "url": "http://kitcambridge.be/" - }, - { - "name": "Mathias Bynens", - "email": "mathias@qiwi.be", - "url": "https://mathiasbynens.be/" - } - ], - "description": "The modern build of lodash’s `_.restParam` as a module.", - "homepage": "https://lodash.com/", - "icon": "https://lodash.com/icon.svg", - "keywords": [ - "lodash", - "lodash-modularized", - "stdlib", - "util" - ], - "license": "MIT", - "name": "lodash.restparam", - "repository": { - "type": "git", - "url": "git+https://github.com/lodash/lodash.git" - }, - "scripts": { - "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" - }, - "version": "3.6.1" -} diff --git a/deps/npm/node_modules/lodash.union/LICENSE b/deps/npm/node_modules/lodash.union/LICENSE deleted file mode 100644 index e0c69d56032d15..00000000000000 --- a/deps/npm/node_modules/lodash.union/LICENSE +++ /dev/null @@ -1,47 +0,0 @@ -Copyright jQuery Foundation and other contributors - -Based on Underscore.js, copyright Jeremy Ashkenas, -DocumentCloud and Investigative Reporters & Editors - -This software consists of voluntary contributions made by many -individuals. For exact contribution history, see the revision history -available at https://github.com/lodash/lodash - -The following license applies to all parts of this software except as -documented below: - -==== - -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. - -==== - -Copyright and related rights for sample code are waived via CC0. Sample -code is defined as all source code displayed within the prose of the -documentation. - -CC0: http://creativecommons.org/publicdomain/zero/1.0/ - -==== - -Files located in the node_modules and vendor directories are externally -maintained libraries used by this software which have their own -licenses; we recommend you read them, as their terms may differ from the -terms above. diff --git a/deps/npm/node_modules/lodash.union/README.md b/deps/npm/node_modules/lodash.union/README.md deleted file mode 100644 index 001092dde8d569..00000000000000 --- a/deps/npm/node_modules/lodash.union/README.md +++ /dev/null @@ -1,18 +0,0 @@ -# lodash.union v4.6.0 - -The [lodash](https://lodash.com/) method `_.union` exported as a [Node.js](https://nodejs.org/) module. - -## Installation - -Using npm: -```bash -$ {sudo -H} npm i -g npm -$ npm i --save lodash.union -``` - -In Node.js: -```js -var union = require('lodash.union'); -``` - -See the [documentation](https://lodash.com/docs#union) or [package source](https://github.com/lodash/lodash/blob/4.6.0-npm-packages/lodash.union) for more details. diff --git a/deps/npm/node_modules/lodash.union/index.js b/deps/npm/node_modules/lodash.union/index.js deleted file mode 100644 index d1eb0305d57626..00000000000000 --- a/deps/npm/node_modules/lodash.union/index.js +++ /dev/null @@ -1,1181 +0,0 @@ -/** - * lodash (Custom Build) - * Build: `lodash modularize exports="npm" -o ./` - * Copyright jQuery Foundation and other contributors - * Released under MIT license - * Based on Underscore.js 1.8.3 - * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - */ - -/** Used as the size to enable large array optimizations. */ -var LARGE_ARRAY_SIZE = 200; - -/** Used to stand-in for `undefined` hash values. */ -var HASH_UNDEFINED = '__lodash_hash_undefined__'; - -/** Used as references for various `Number` constants. */ -var INFINITY = 1 / 0, - MAX_SAFE_INTEGER = 9007199254740991; - -/** `Object#toString` result references. */ -var argsTag = '[object Arguments]', - funcTag = '[object Function]', - genTag = '[object GeneratorFunction]'; - -/** - * Used to match `RegExp` - * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns). - */ -var reRegExpChar = /[\\^$.*+?()[\]{}|]/g; - -/** Used to detect host constructors (Safari). */ -var reIsHostCtor = /^\[object .+?Constructor\]$/; - -/** Detect free variable `global` from Node.js. */ -var freeGlobal = typeof global == 'object' && global && global.Object === Object && global; - -/** Detect free variable `self`. */ -var freeSelf = typeof self == 'object' && self && self.Object === Object && self; - -/** Used as a reference to the global object. */ -var root = freeGlobal || freeSelf || Function('return this')(); - -/** - * A faster alternative to `Function#apply`, this function invokes `func` - * with the `this` binding of `thisArg` and the arguments of `args`. - * - * @private - * @param {Function} func The function to invoke. - * @param {*} thisArg The `this` binding of `func`. - * @param {Array} args The arguments to invoke `func` with. - * @returns {*} Returns the result of `func`. - */ -function apply(func, thisArg, args) { - switch (args.length) { - case 0: return func.call(thisArg); - case 1: return func.call(thisArg, args[0]); - case 2: return func.call(thisArg, args[0], args[1]); - case 3: return func.call(thisArg, args[0], args[1], args[2]); - } - return func.apply(thisArg, args); -} - -/** - * A specialized version of `_.includes` for arrays without support for - * specifying an index to search from. - * - * @private - * @param {Array} [array] The array to inspect. - * @param {*} target The value to search for. - * @returns {boolean} Returns `true` if `target` is found, else `false`. - */ -function arrayIncludes(array, value) { - var length = array ? array.length : 0; - return !!length && baseIndexOf(array, value, 0) > -1; -} - -/** - * This function is like `arrayIncludes` except that it accepts a comparator. - * - * @private - * @param {Array} [array] The array to inspect. - * @param {*} target The value to search for. - * @param {Function} comparator The comparator invoked per element. - * @returns {boolean} Returns `true` if `target` is found, else `false`. - */ -function arrayIncludesWith(array, value, comparator) { - var index = -1, - length = array ? array.length : 0; - - while (++index < length) { - if (comparator(value, array[index])) { - return true; - } - } - return false; -} - -/** - * Appends the elements of `values` to `array`. - * - * @private - * @param {Array} array The array to modify. - * @param {Array} values The values to append. - * @returns {Array} Returns `array`. - */ -function arrayPush(array, values) { - var index = -1, - length = values.length, - offset = array.length; - - while (++index < length) { - array[offset + index] = values[index]; - } - return array; -} - -/** - * The base implementation of `_.findIndex` and `_.findLastIndex` without - * support for iteratee shorthands. - * - * @private - * @param {Array} array The array to inspect. - * @param {Function} predicate The function invoked per iteration. - * @param {number} fromIndex The index to search from. - * @param {boolean} [fromRight] Specify iterating from right to left. - * @returns {number} Returns the index of the matched value, else `-1`. - */ -function baseFindIndex(array, predicate, fromIndex, fromRight) { - var length = array.length, - index = fromIndex + (fromRight ? 1 : -1); - - while ((fromRight ? index-- : ++index < length)) { - if (predicate(array[index], index, array)) { - return index; - } - } - return -1; -} - -/** - * The base implementation of `_.indexOf` without `fromIndex` bounds checks. - * - * @private - * @param {Array} array The array to inspect. - * @param {*} value The value to search for. - * @param {number} fromIndex The index to search from. - * @returns {number} Returns the index of the matched value, else `-1`. - */ -function baseIndexOf(array, value, fromIndex) { - if (value !== value) { - return baseFindIndex(array, baseIsNaN, fromIndex); - } - var index = fromIndex - 1, - length = array.length; - - while (++index < length) { - if (array[index] === value) { - return index; - } - } - return -1; -} - -/** - * The base implementation of `_.isNaN` without support for number objects. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`. - */ -function baseIsNaN(value) { - return value !== value; -} - -/** - * Checks if a cache value for `key` exists. - * - * @private - * @param {Object} cache The cache to query. - * @param {string} key The key of the entry to check. - * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. - */ -function cacheHas(cache, key) { - return cache.has(key); -} - -/** - * Gets the value at `key` of `object`. - * - * @private - * @param {Object} [object] The object to query. - * @param {string} key The key of the property to get. - * @returns {*} Returns the property value. - */ -function getValue(object, key) { - return object == null ? undefined : object[key]; -} - -/** - * Checks if `value` is a host object in IE < 9. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a host object, else `false`. - */ -function isHostObject(value) { - // Many host objects are `Object` objects that can coerce to strings - // despite having improperly defined `toString` methods. - var result = false; - if (value != null && typeof value.toString != 'function') { - try { - result = !!(value + ''); - } catch (e) {} - } - return result; -} - -/** - * Converts `set` to an array of its values. - * - * @private - * @param {Object} set The set to convert. - * @returns {Array} Returns the values. - */ -function setToArray(set) { - var index = -1, - result = Array(set.size); - - set.forEach(function(value) { - result[++index] = value; - }); - return result; -} - -/** Used for built-in method references. */ -var arrayProto = Array.prototype, - funcProto = Function.prototype, - objectProto = Object.prototype; - -/** Used to detect overreaching core-js shims. */ -var coreJsData = root['__core-js_shared__']; - -/** Used to detect methods masquerading as native. */ -var maskSrcKey = (function() { - var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || ''); - return uid ? ('Symbol(src)_1.' + uid) : ''; -}()); - -/** Used to resolve the decompiled source of functions. */ -var funcToString = funcProto.toString; - -/** Used to check objects for own properties. */ -var hasOwnProperty = objectProto.hasOwnProperty; - -/** - * Used to resolve the - * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) - * of values. - */ -var objectToString = objectProto.toString; - -/** Used to detect if a method is native. */ -var reIsNative = RegExp('^' + - funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&') - .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$' -); - -/** Built-in value references. */ -var Symbol = root.Symbol, - propertyIsEnumerable = objectProto.propertyIsEnumerable, - splice = arrayProto.splice, - spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined; - -/* Built-in method references for those with the same name as other `lodash` methods. */ -var nativeMax = Math.max; - -/* Built-in method references that are verified to be native. */ -var Map = getNative(root, 'Map'), - Set = getNative(root, 'Set'), - nativeCreate = getNative(Object, 'create'); - -/** - * Creates a hash object. - * - * @private - * @constructor - * @param {Array} [entries] The key-value pairs to cache. - */ -function Hash(entries) { - var index = -1, - length = entries ? entries.length : 0; - - this.clear(); - while (++index < length) { - var entry = entries[index]; - this.set(entry[0], entry[1]); - } -} - -/** - * Removes all key-value entries from the hash. - * - * @private - * @name clear - * @memberOf Hash - */ -function hashClear() { - this.__data__ = nativeCreate ? nativeCreate(null) : {}; -} - -/** - * Removes `key` and its value from the hash. - * - * @private - * @name delete - * @memberOf Hash - * @param {Object} hash The hash to modify. - * @param {string} key The key of the value to remove. - * @returns {boolean} Returns `true` if the entry was removed, else `false`. - */ -function hashDelete(key) { - return this.has(key) && delete this.__data__[key]; -} - -/** - * Gets the hash value for `key`. - * - * @private - * @name get - * @memberOf Hash - * @param {string} key The key of the value to get. - * @returns {*} Returns the entry value. - */ -function hashGet(key) { - var data = this.__data__; - if (nativeCreate) { - var result = data[key]; - return result === HASH_UNDEFINED ? undefined : result; - } - return hasOwnProperty.call(data, key) ? data[key] : undefined; -} - -/** - * Checks if a hash value for `key` exists. - * - * @private - * @name has - * @memberOf Hash - * @param {string} key The key of the entry to check. - * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. - */ -function hashHas(key) { - var data = this.__data__; - return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key); -} - -/** - * Sets the hash `key` to `value`. - * - * @private - * @name set - * @memberOf Hash - * @param {string} key The key of the value to set. - * @param {*} value The value to set. - * @returns {Object} Returns the hash instance. - */ -function hashSet(key, value) { - var data = this.__data__; - data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value; - return this; -} - -// Add methods to `Hash`. -Hash.prototype.clear = hashClear; -Hash.prototype['delete'] = hashDelete; -Hash.prototype.get = hashGet; -Hash.prototype.has = hashHas; -Hash.prototype.set = hashSet; - -/** - * Creates an list cache object. - * - * @private - * @constructor - * @param {Array} [entries] The key-value pairs to cache. - */ -function ListCache(entries) { - var index = -1, - length = entries ? entries.length : 0; - - this.clear(); - while (++index < length) { - var entry = entries[index]; - this.set(entry[0], entry[1]); - } -} - -/** - * Removes all key-value entries from the list cache. - * - * @private - * @name clear - * @memberOf ListCache - */ -function listCacheClear() { - this.__data__ = []; -} - -/** - * Removes `key` and its value from the list cache. - * - * @private - * @name delete - * @memberOf ListCache - * @param {string} key The key of the value to remove. - * @returns {boolean} Returns `true` if the entry was removed, else `false`. - */ -function listCacheDelete(key) { - var data = this.__data__, - index = assocIndexOf(data, key); - - if (index < 0) { - return false; - } - var lastIndex = data.length - 1; - if (index == lastIndex) { - data.pop(); - } else { - splice.call(data, index, 1); - } - return true; -} - -/** - * Gets the list cache value for `key`. - * - * @private - * @name get - * @memberOf ListCache - * @param {string} key The key of the value to get. - * @returns {*} Returns the entry value. - */ -function listCacheGet(key) { - var data = this.__data__, - index = assocIndexOf(data, key); - - return index < 0 ? undefined : data[index][1]; -} - -/** - * Checks if a list cache value for `key` exists. - * - * @private - * @name has - * @memberOf ListCache - * @param {string} key The key of the entry to check. - * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. - */ -function listCacheHas(key) { - return assocIndexOf(this.__data__, key) > -1; -} - -/** - * Sets the list cache `key` to `value`. - * - * @private - * @name set - * @memberOf ListCache - * @param {string} key The key of the value to set. - * @param {*} value The value to set. - * @returns {Object} Returns the list cache instance. - */ -function listCacheSet(key, value) { - var data = this.__data__, - index = assocIndexOf(data, key); - - if (index < 0) { - data.push([key, value]); - } else { - data[index][1] = value; - } - return this; -} - -// Add methods to `ListCache`. -ListCache.prototype.clear = listCacheClear; -ListCache.prototype['delete'] = listCacheDelete; -ListCache.prototype.get = listCacheGet; -ListCache.prototype.has = listCacheHas; -ListCache.prototype.set = listCacheSet; - -/** - * Creates a map cache object to store key-value pairs. - * - * @private - * @constructor - * @param {Array} [entries] The key-value pairs to cache. - */ -function MapCache(entries) { - var index = -1, - length = entries ? entries.length : 0; - - this.clear(); - while (++index < length) { - var entry = entries[index]; - this.set(entry[0], entry[1]); - } -} - -/** - * Removes all key-value entries from the map. - * - * @private - * @name clear - * @memberOf MapCache - */ -function mapCacheClear() { - this.__data__ = { - 'hash': new Hash, - 'map': new (Map || ListCache), - 'string': new Hash - }; -} - -/** - * Removes `key` and its value from the map. - * - * @private - * @name delete - * @memberOf MapCache - * @param {string} key The key of the value to remove. - * @returns {boolean} Returns `true` if the entry was removed, else `false`. - */ -function mapCacheDelete(key) { - return getMapData(this, key)['delete'](key); -} - -/** - * Gets the map value for `key`. - * - * @private - * @name get - * @memberOf MapCache - * @param {string} key The key of the value to get. - * @returns {*} Returns the entry value. - */ -function mapCacheGet(key) { - return getMapData(this, key).get(key); -} - -/** - * Checks if a map value for `key` exists. - * - * @private - * @name has - * @memberOf MapCache - * @param {string} key The key of the entry to check. - * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. - */ -function mapCacheHas(key) { - return getMapData(this, key).has(key); -} - -/** - * Sets the map `key` to `value`. - * - * @private - * @name set - * @memberOf MapCache - * @param {string} key The key of the value to set. - * @param {*} value The value to set. - * @returns {Object} Returns the map cache instance. - */ -function mapCacheSet(key, value) { - getMapData(this, key).set(key, value); - return this; -} - -// Add methods to `MapCache`. -MapCache.prototype.clear = mapCacheClear; -MapCache.prototype['delete'] = mapCacheDelete; -MapCache.prototype.get = mapCacheGet; -MapCache.prototype.has = mapCacheHas; -MapCache.prototype.set = mapCacheSet; - -/** - * - * Creates an array cache object to store unique values. - * - * @private - * @constructor - * @param {Array} [values] The values to cache. - */ -function SetCache(values) { - var index = -1, - length = values ? values.length : 0; - - this.__data__ = new MapCache; - while (++index < length) { - this.add(values[index]); - } -} - -/** - * Adds `value` to the array cache. - * - * @private - * @name add - * @memberOf SetCache - * @alias push - * @param {*} value The value to cache. - * @returns {Object} Returns the cache instance. - */ -function setCacheAdd(value) { - this.__data__.set(value, HASH_UNDEFINED); - return this; -} - -/** - * Checks if `value` is in the array cache. - * - * @private - * @name has - * @memberOf SetCache - * @param {*} value The value to search for. - * @returns {number} Returns `true` if `value` is found, else `false`. - */ -function setCacheHas(value) { - return this.__data__.has(value); -} - -// Add methods to `SetCache`. -SetCache.prototype.add = SetCache.prototype.push = setCacheAdd; -SetCache.prototype.has = setCacheHas; - -/** - * Gets the index at which the `key` is found in `array` of key-value pairs. - * - * @private - * @param {Array} array The array to inspect. - * @param {*} key The key to search for. - * @returns {number} Returns the index of the matched value, else `-1`. - */ -function assocIndexOf(array, key) { - var length = array.length; - while (length--) { - if (eq(array[length][0], key)) { - return length; - } - } - return -1; -} - -/** - * The base implementation of `_.flatten` with support for restricting flattening. - * - * @private - * @param {Array} array The array to flatten. - * @param {number} depth The maximum recursion depth. - * @param {boolean} [predicate=isFlattenable] The function invoked per iteration. - * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks. - * @param {Array} [result=[]] The initial result value. - * @returns {Array} Returns the new flattened array. - */ -function baseFlatten(array, depth, predicate, isStrict, result) { - var index = -1, - length = array.length; - - predicate || (predicate = isFlattenable); - result || (result = []); - - while (++index < length) { - var value = array[index]; - if (depth > 0 && predicate(value)) { - if (depth > 1) { - // Recursively flatten arrays (susceptible to call stack limits). - baseFlatten(value, depth - 1, predicate, isStrict, result); - } else { - arrayPush(result, value); - } - } else if (!isStrict) { - result[result.length] = value; - } - } - return result; -} - -/** - * The base implementation of `_.isNative` without bad shim checks. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a native function, - * else `false`. - */ -function baseIsNative(value) { - if (!isObject(value) || isMasked(value)) { - return false; - } - var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor; - return pattern.test(toSource(value)); -} - -/** - * The base implementation of `_.rest` which doesn't validate or coerce arguments. - * - * @private - * @param {Function} func The function to apply a rest parameter to. - * @param {number} [start=func.length-1] The start position of the rest parameter. - * @returns {Function} Returns the new function. - */ -function baseRest(func, start) { - start = nativeMax(start === undefined ? (func.length - 1) : start, 0); - return function() { - var args = arguments, - index = -1, - length = nativeMax(args.length - start, 0), - array = Array(length); - - while (++index < length) { - array[index] = args[start + index]; - } - index = -1; - var otherArgs = Array(start + 1); - while (++index < start) { - otherArgs[index] = args[index]; - } - otherArgs[start] = array; - return apply(func, this, otherArgs); - }; -} - -/** - * The base implementation of `_.uniqBy` without support for iteratee shorthands. - * - * @private - * @param {Array} array The array to inspect. - * @param {Function} [iteratee] The iteratee invoked per element. - * @param {Function} [comparator] The comparator invoked per element. - * @returns {Array} Returns the new duplicate free array. - */ -function baseUniq(array, iteratee, comparator) { - var index = -1, - includes = arrayIncludes, - length = array.length, - isCommon = true, - result = [], - seen = result; - - if (comparator) { - isCommon = false; - includes = arrayIncludesWith; - } - else if (length >= LARGE_ARRAY_SIZE) { - var set = iteratee ? null : createSet(array); - if (set) { - return setToArray(set); - } - isCommon = false; - includes = cacheHas; - seen = new SetCache; - } - else { - seen = iteratee ? [] : result; - } - outer: - while (++index < length) { - var value = array[index], - computed = iteratee ? iteratee(value) : value; - - value = (comparator || value !== 0) ? value : 0; - if (isCommon && computed === computed) { - var seenIndex = seen.length; - while (seenIndex--) { - if (seen[seenIndex] === computed) { - continue outer; - } - } - if (iteratee) { - seen.push(computed); - } - result.push(value); - } - else if (!includes(seen, computed, comparator)) { - if (seen !== result) { - seen.push(computed); - } - result.push(value); - } - } - return result; -} - -/** - * Creates a set object of `values`. - * - * @private - * @param {Array} values The values to add to the set. - * @returns {Object} Returns the new set. - */ -var createSet = !(Set && (1 / setToArray(new Set([,-0]))[1]) == INFINITY) ? noop : function(values) { - return new Set(values); -}; - -/** - * Gets the data for `map`. - * - * @private - * @param {Object} map The map to query. - * @param {string} key The reference key. - * @returns {*} Returns the map data. - */ -function getMapData(map, key) { - var data = map.__data__; - return isKeyable(key) - ? data[typeof key == 'string' ? 'string' : 'hash'] - : data.map; -} - -/** - * Gets the native function at `key` of `object`. - * - * @private - * @param {Object} object The object to query. - * @param {string} key The key of the method to get. - * @returns {*} Returns the function if it's native, else `undefined`. - */ -function getNative(object, key) { - var value = getValue(object, key); - return baseIsNative(value) ? value : undefined; -} - -/** - * Checks if `value` is a flattenable `arguments` object or array. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is flattenable, else `false`. - */ -function isFlattenable(value) { - return isArray(value) || isArguments(value) || - !!(spreadableSymbol && value && value[spreadableSymbol]); -} - -/** - * Checks if `value` is suitable for use as unique object key. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is suitable, else `false`. - */ -function isKeyable(value) { - var type = typeof value; - return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean') - ? (value !== '__proto__') - : (value === null); -} - -/** - * Checks if `func` has its source masked. - * - * @private - * @param {Function} func The function to check. - * @returns {boolean} Returns `true` if `func` is masked, else `false`. - */ -function isMasked(func) { - return !!maskSrcKey && (maskSrcKey in func); -} - -/** - * Converts `func` to its source code. - * - * @private - * @param {Function} func The function to process. - * @returns {string} Returns the source code. - */ -function toSource(func) { - if (func != null) { - try { - return funcToString.call(func); - } catch (e) {} - try { - return (func + ''); - } catch (e) {} - } - return ''; -} - -/** - * Creates an array of unique values, in order, from all given arrays using - * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) - * for equality comparisons. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Array - * @param {...Array} [arrays] The arrays to inspect. - * @returns {Array} Returns the new array of combined values. - * @example - * - * _.union([2], [1, 2]); - * // => [2, 1] - */ -var union = baseRest(function(arrays) { - return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true)); -}); - -/** - * Performs a - * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) - * comparison between two values to determine if they are equivalent. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to compare. - * @param {*} other The other value to compare. - * @returns {boolean} Returns `true` if the values are equivalent, else `false`. - * @example - * - * var object = { 'a': 1 }; - * var other = { 'a': 1 }; - * - * _.eq(object, object); - * // => true - * - * _.eq(object, other); - * // => false - * - * _.eq('a', 'a'); - * // => true - * - * _.eq('a', Object('a')); - * // => false - * - * _.eq(NaN, NaN); - * // => true - */ -function eq(value, other) { - return value === other || (value !== value && other !== other); -} - -/** - * Checks if `value` is likely an `arguments` object. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an `arguments` object, - * else `false`. - * @example - * - * _.isArguments(function() { return arguments; }()); - * // => true - * - * _.isArguments([1, 2, 3]); - * // => false - */ -function isArguments(value) { - // Safari 8.1 makes `arguments.callee` enumerable in strict mode. - return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') && - (!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag); -} - -/** - * Checks if `value` is classified as an `Array` object. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an array, else `false`. - * @example - * - * _.isArray([1, 2, 3]); - * // => true - * - * _.isArray(document.body.children); - * // => false - * - * _.isArray('abc'); - * // => false - * - * _.isArray(_.noop); - * // => false - */ -var isArray = Array.isArray; - -/** - * Checks if `value` is array-like. A value is considered array-like if it's - * not a function and has a `value.length` that's an integer greater than or - * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is array-like, else `false`. - * @example - * - * _.isArrayLike([1, 2, 3]); - * // => true - * - * _.isArrayLike(document.body.children); - * // => true - * - * _.isArrayLike('abc'); - * // => true - * - * _.isArrayLike(_.noop); - * // => false - */ -function isArrayLike(value) { - return value != null && isLength(value.length) && !isFunction(value); -} - -/** - * This method is like `_.isArrayLike` except that it also checks if `value` - * is an object. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an array-like object, - * else `false`. - * @example - * - * _.isArrayLikeObject([1, 2, 3]); - * // => true - * - * _.isArrayLikeObject(document.body.children); - * // => true - * - * _.isArrayLikeObject('abc'); - * // => false - * - * _.isArrayLikeObject(_.noop); - * // => false - */ -function isArrayLikeObject(value) { - return isObjectLike(value) && isArrayLike(value); -} - -/** - * Checks if `value` is classified as a `Function` object. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a function, else `false`. - * @example - * - * _.isFunction(_); - * // => true - * - * _.isFunction(/abc/); - * // => false - */ -function isFunction(value) { - // The use of `Object#toString` avoids issues with the `typeof` operator - // in Safari 8-9 which returns 'object' for typed array and other constructors. - var tag = isObject(value) ? objectToString.call(value) : ''; - return tag == funcTag || tag == genTag; -} - -/** - * Checks if `value` is a valid array-like length. - * - * **Note:** This method is loosely based on - * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength). - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. - * @example - * - * _.isLength(3); - * // => true - * - * _.isLength(Number.MIN_VALUE); - * // => false - * - * _.isLength(Infinity); - * // => false - * - * _.isLength('3'); - * // => false - */ -function isLength(value) { - return typeof value == 'number' && - value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; -} - -/** - * Checks if `value` is the - * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types) - * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an object, else `false`. - * @example - * - * _.isObject({}); - * // => true - * - * _.isObject([1, 2, 3]); - * // => true - * - * _.isObject(_.noop); - * // => true - * - * _.isObject(null); - * // => false - */ -function isObject(value) { - var type = typeof value; - return !!value && (type == 'object' || type == 'function'); -} - -/** - * Checks if `value` is object-like. A value is object-like if it's not `null` - * and has a `typeof` result of "object". - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is object-like, else `false`. - * @example - * - * _.isObjectLike({}); - * // => true - * - * _.isObjectLike([1, 2, 3]); - * // => true - * - * _.isObjectLike(_.noop); - * // => false - * - * _.isObjectLike(null); - * // => false - */ -function isObjectLike(value) { - return !!value && typeof value == 'object'; -} - -/** - * This method returns `undefined`. - * - * @static - * @memberOf _ - * @since 2.3.0 - * @category Util - * @example - * - * _.times(2, _.noop); - * // => [undefined, undefined] - */ -function noop() { - // No operation performed. -} - -module.exports = union; diff --git a/deps/npm/node_modules/lodash.union/package.json b/deps/npm/node_modules/lodash.union/package.json deleted file mode 100644 index bc6d838fcfba22..00000000000000 --- a/deps/npm/node_modules/lodash.union/package.json +++ /dev/null @@ -1,72 +0,0 @@ -{ - "_args": [ - [ - "lodash.union@4.6.0", - "/Users/rebecca/code/npm" - ] - ], - "_from": "lodash.union@4.6.0", - "_id": "lodash.union@4.6.0", - "_inBundle": false, - "_integrity": "sha1-SLtQiECfFvGCFmZkHETdGqrjzYg=", - "_location": "/lodash.union", - "_phantomChildren": {}, - "_requested": { - "type": "version", - "registry": true, - "raw": "lodash.union@4.6.0", - "name": "lodash.union", - "escapedName": "lodash.union", - "rawSpec": "4.6.0", - "saveSpec": null, - "fetchSpec": "4.6.0" - }, - "_requiredBy": [ - "/" - ], - "_resolved": "https://registry.npmjs.org/lodash.union/-/lodash.union-4.6.0.tgz", - "_spec": "4.6.0", - "_where": "/Users/rebecca/code/npm", - "author": { - "name": "John-David Dalton", - "email": "john.david.dalton@gmail.com", - "url": "http://allyoucanleet.com/" - }, - "bugs": { - "url": "https://github.com/lodash/lodash/issues" - }, - "contributors": [ - { - "name": "John-David Dalton", - "email": "john.david.dalton@gmail.com", - "url": "http://allyoucanleet.com/" - }, - { - "name": "Blaine Bublitz", - "email": "blaine.bublitz@gmail.com", - "url": "https://github.com/phated" - }, - { - "name": "Mathias Bynens", - "email": "mathias@qiwi.be", - "url": "https://mathiasbynens.be/" - } - ], - "description": "The lodash method `_.union` exported as a module.", - "homepage": "https://lodash.com/", - "icon": "https://lodash.com/icon.svg", - "keywords": [ - "lodash-modularized", - "union" - ], - "license": "MIT", - "name": "lodash.union", - "repository": { - "type": "git", - "url": "git+https://github.com/lodash/lodash.git" - }, - "scripts": { - "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" - }, - "version": "4.6.0" -} diff --git a/deps/npm/node_modules/lodash.uniq/LICENSE b/deps/npm/node_modules/lodash.uniq/LICENSE deleted file mode 100644 index e0c69d56032d15..00000000000000 --- a/deps/npm/node_modules/lodash.uniq/LICENSE +++ /dev/null @@ -1,47 +0,0 @@ -Copyright jQuery Foundation and other contributors - -Based on Underscore.js, copyright Jeremy Ashkenas, -DocumentCloud and Investigative Reporters & Editors - -This software consists of voluntary contributions made by many -individuals. For exact contribution history, see the revision history -available at https://github.com/lodash/lodash - -The following license applies to all parts of this software except as -documented below: - -==== - -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. - -==== - -Copyright and related rights for sample code are waived via CC0. Sample -code is defined as all source code displayed within the prose of the -documentation. - -CC0: http://creativecommons.org/publicdomain/zero/1.0/ - -==== - -Files located in the node_modules and vendor directories are externally -maintained libraries used by this software which have their own -licenses; we recommend you read them, as their terms may differ from the -terms above. diff --git a/deps/npm/node_modules/lodash.uniq/README.md b/deps/npm/node_modules/lodash.uniq/README.md deleted file mode 100644 index a662a5e3823153..00000000000000 --- a/deps/npm/node_modules/lodash.uniq/README.md +++ /dev/null @@ -1,18 +0,0 @@ -# lodash.uniq v4.5.0 - -The [lodash](https://lodash.com/) method `_.uniq` exported as a [Node.js](https://nodejs.org/) module. - -## Installation - -Using npm: -```bash -$ {sudo -H} npm i -g npm -$ npm i --save lodash.uniq -``` - -In Node.js: -```js -var uniq = require('lodash.uniq'); -``` - -See the [documentation](https://lodash.com/docs#uniq) or [package source](https://github.com/lodash/lodash/blob/4.5.0-npm-packages/lodash.uniq) for more details. diff --git a/deps/npm/node_modules/lodash.uniq/index.js b/deps/npm/node_modules/lodash.uniq/index.js deleted file mode 100644 index 83fce2bc44fcc4..00000000000000 --- a/deps/npm/node_modules/lodash.uniq/index.js +++ /dev/null @@ -1,896 +0,0 @@ -/** - * lodash (Custom Build) - * Build: `lodash modularize exports="npm" -o ./` - * Copyright jQuery Foundation and other contributors - * Released under MIT license - * Based on Underscore.js 1.8.3 - * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - */ - -/** Used as the size to enable large array optimizations. */ -var LARGE_ARRAY_SIZE = 200; - -/** Used to stand-in for `undefined` hash values. */ -var HASH_UNDEFINED = '__lodash_hash_undefined__'; - -/** Used as references for various `Number` constants. */ -var INFINITY = 1 / 0; - -/** `Object#toString` result references. */ -var funcTag = '[object Function]', - genTag = '[object GeneratorFunction]'; - -/** - * Used to match `RegExp` - * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns). - */ -var reRegExpChar = /[\\^$.*+?()[\]{}|]/g; - -/** Used to detect host constructors (Safari). */ -var reIsHostCtor = /^\[object .+?Constructor\]$/; - -/** Detect free variable `global` from Node.js. */ -var freeGlobal = typeof global == 'object' && global && global.Object === Object && global; - -/** Detect free variable `self`. */ -var freeSelf = typeof self == 'object' && self && self.Object === Object && self; - -/** Used as a reference to the global object. */ -var root = freeGlobal || freeSelf || Function('return this')(); - -/** - * A specialized version of `_.includes` for arrays without support for - * specifying an index to search from. - * - * @private - * @param {Array} [array] The array to inspect. - * @param {*} target The value to search for. - * @returns {boolean} Returns `true` if `target` is found, else `false`. - */ -function arrayIncludes(array, value) { - var length = array ? array.length : 0; - return !!length && baseIndexOf(array, value, 0) > -1; -} - -/** - * This function is like `arrayIncludes` except that it accepts a comparator. - * - * @private - * @param {Array} [array] The array to inspect. - * @param {*} target The value to search for. - * @param {Function} comparator The comparator invoked per element. - * @returns {boolean} Returns `true` if `target` is found, else `false`. - */ -function arrayIncludesWith(array, value, comparator) { - var index = -1, - length = array ? array.length : 0; - - while (++index < length) { - if (comparator(value, array[index])) { - return true; - } - } - return false; -} - -/** - * The base implementation of `_.findIndex` and `_.findLastIndex` without - * support for iteratee shorthands. - * - * @private - * @param {Array} array The array to inspect. - * @param {Function} predicate The function invoked per iteration. - * @param {number} fromIndex The index to search from. - * @param {boolean} [fromRight] Specify iterating from right to left. - * @returns {number} Returns the index of the matched value, else `-1`. - */ -function baseFindIndex(array, predicate, fromIndex, fromRight) { - var length = array.length, - index = fromIndex + (fromRight ? 1 : -1); - - while ((fromRight ? index-- : ++index < length)) { - if (predicate(array[index], index, array)) { - return index; - } - } - return -1; -} - -/** - * The base implementation of `_.indexOf` without `fromIndex` bounds checks. - * - * @private - * @param {Array} array The array to inspect. - * @param {*} value The value to search for. - * @param {number} fromIndex The index to search from. - * @returns {number} Returns the index of the matched value, else `-1`. - */ -function baseIndexOf(array, value, fromIndex) { - if (value !== value) { - return baseFindIndex(array, baseIsNaN, fromIndex); - } - var index = fromIndex - 1, - length = array.length; - - while (++index < length) { - if (array[index] === value) { - return index; - } - } - return -1; -} - -/** - * The base implementation of `_.isNaN` without support for number objects. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`. - */ -function baseIsNaN(value) { - return value !== value; -} - -/** - * Checks if a cache value for `key` exists. - * - * @private - * @param {Object} cache The cache to query. - * @param {string} key The key of the entry to check. - * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. - */ -function cacheHas(cache, key) { - return cache.has(key); -} - -/** - * Gets the value at `key` of `object`. - * - * @private - * @param {Object} [object] The object to query. - * @param {string} key The key of the property to get. - * @returns {*} Returns the property value. - */ -function getValue(object, key) { - return object == null ? undefined : object[key]; -} - -/** - * Checks if `value` is a host object in IE < 9. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a host object, else `false`. - */ -function isHostObject(value) { - // Many host objects are `Object` objects that can coerce to strings - // despite having improperly defined `toString` methods. - var result = false; - if (value != null && typeof value.toString != 'function') { - try { - result = !!(value + ''); - } catch (e) {} - } - return result; -} - -/** - * Converts `set` to an array of its values. - * - * @private - * @param {Object} set The set to convert. - * @returns {Array} Returns the values. - */ -function setToArray(set) { - var index = -1, - result = Array(set.size); - - set.forEach(function(value) { - result[++index] = value; - }); - return result; -} - -/** Used for built-in method references. */ -var arrayProto = Array.prototype, - funcProto = Function.prototype, - objectProto = Object.prototype; - -/** Used to detect overreaching core-js shims. */ -var coreJsData = root['__core-js_shared__']; - -/** Used to detect methods masquerading as native. */ -var maskSrcKey = (function() { - var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || ''); - return uid ? ('Symbol(src)_1.' + uid) : ''; -}()); - -/** Used to resolve the decompiled source of functions. */ -var funcToString = funcProto.toString; - -/** Used to check objects for own properties. */ -var hasOwnProperty = objectProto.hasOwnProperty; - -/** - * Used to resolve the - * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) - * of values. - */ -var objectToString = objectProto.toString; - -/** Used to detect if a method is native. */ -var reIsNative = RegExp('^' + - funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&') - .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$' -); - -/** Built-in value references. */ -var splice = arrayProto.splice; - -/* Built-in method references that are verified to be native. */ -var Map = getNative(root, 'Map'), - Set = getNative(root, 'Set'), - nativeCreate = getNative(Object, 'create'); - -/** - * Creates a hash object. - * - * @private - * @constructor - * @param {Array} [entries] The key-value pairs to cache. - */ -function Hash(entries) { - var index = -1, - length = entries ? entries.length : 0; - - this.clear(); - while (++index < length) { - var entry = entries[index]; - this.set(entry[0], entry[1]); - } -} - -/** - * Removes all key-value entries from the hash. - * - * @private - * @name clear - * @memberOf Hash - */ -function hashClear() { - this.__data__ = nativeCreate ? nativeCreate(null) : {}; -} - -/** - * Removes `key` and its value from the hash. - * - * @private - * @name delete - * @memberOf Hash - * @param {Object} hash The hash to modify. - * @param {string} key The key of the value to remove. - * @returns {boolean} Returns `true` if the entry was removed, else `false`. - */ -function hashDelete(key) { - return this.has(key) && delete this.__data__[key]; -} - -/** - * Gets the hash value for `key`. - * - * @private - * @name get - * @memberOf Hash - * @param {string} key The key of the value to get. - * @returns {*} Returns the entry value. - */ -function hashGet(key) { - var data = this.__data__; - if (nativeCreate) { - var result = data[key]; - return result === HASH_UNDEFINED ? undefined : result; - } - return hasOwnProperty.call(data, key) ? data[key] : undefined; -} - -/** - * Checks if a hash value for `key` exists. - * - * @private - * @name has - * @memberOf Hash - * @param {string} key The key of the entry to check. - * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. - */ -function hashHas(key) { - var data = this.__data__; - return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key); -} - -/** - * Sets the hash `key` to `value`. - * - * @private - * @name set - * @memberOf Hash - * @param {string} key The key of the value to set. - * @param {*} value The value to set. - * @returns {Object} Returns the hash instance. - */ -function hashSet(key, value) { - var data = this.__data__; - data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value; - return this; -} - -// Add methods to `Hash`. -Hash.prototype.clear = hashClear; -Hash.prototype['delete'] = hashDelete; -Hash.prototype.get = hashGet; -Hash.prototype.has = hashHas; -Hash.prototype.set = hashSet; - -/** - * Creates an list cache object. - * - * @private - * @constructor - * @param {Array} [entries] The key-value pairs to cache. - */ -function ListCache(entries) { - var index = -1, - length = entries ? entries.length : 0; - - this.clear(); - while (++index < length) { - var entry = entries[index]; - this.set(entry[0], entry[1]); - } -} - -/** - * Removes all key-value entries from the list cache. - * - * @private - * @name clear - * @memberOf ListCache - */ -function listCacheClear() { - this.__data__ = []; -} - -/** - * Removes `key` and its value from the list cache. - * - * @private - * @name delete - * @memberOf ListCache - * @param {string} key The key of the value to remove. - * @returns {boolean} Returns `true` if the entry was removed, else `false`. - */ -function listCacheDelete(key) { - var data = this.__data__, - index = assocIndexOf(data, key); - - if (index < 0) { - return false; - } - var lastIndex = data.length - 1; - if (index == lastIndex) { - data.pop(); - } else { - splice.call(data, index, 1); - } - return true; -} - -/** - * Gets the list cache value for `key`. - * - * @private - * @name get - * @memberOf ListCache - * @param {string} key The key of the value to get. - * @returns {*} Returns the entry value. - */ -function listCacheGet(key) { - var data = this.__data__, - index = assocIndexOf(data, key); - - return index < 0 ? undefined : data[index][1]; -} - -/** - * Checks if a list cache value for `key` exists. - * - * @private - * @name has - * @memberOf ListCache - * @param {string} key The key of the entry to check. - * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. - */ -function listCacheHas(key) { - return assocIndexOf(this.__data__, key) > -1; -} - -/** - * Sets the list cache `key` to `value`. - * - * @private - * @name set - * @memberOf ListCache - * @param {string} key The key of the value to set. - * @param {*} value The value to set. - * @returns {Object} Returns the list cache instance. - */ -function listCacheSet(key, value) { - var data = this.__data__, - index = assocIndexOf(data, key); - - if (index < 0) { - data.push([key, value]); - } else { - data[index][1] = value; - } - return this; -} - -// Add methods to `ListCache`. -ListCache.prototype.clear = listCacheClear; -ListCache.prototype['delete'] = listCacheDelete; -ListCache.prototype.get = listCacheGet; -ListCache.prototype.has = listCacheHas; -ListCache.prototype.set = listCacheSet; - -/** - * Creates a map cache object to store key-value pairs. - * - * @private - * @constructor - * @param {Array} [entries] The key-value pairs to cache. - */ -function MapCache(entries) { - var index = -1, - length = entries ? entries.length : 0; - - this.clear(); - while (++index < length) { - var entry = entries[index]; - this.set(entry[0], entry[1]); - } -} - -/** - * Removes all key-value entries from the map. - * - * @private - * @name clear - * @memberOf MapCache - */ -function mapCacheClear() { - this.__data__ = { - 'hash': new Hash, - 'map': new (Map || ListCache), - 'string': new Hash - }; -} - -/** - * Removes `key` and its value from the map. - * - * @private - * @name delete - * @memberOf MapCache - * @param {string} key The key of the value to remove. - * @returns {boolean} Returns `true` if the entry was removed, else `false`. - */ -function mapCacheDelete(key) { - return getMapData(this, key)['delete'](key); -} - -/** - * Gets the map value for `key`. - * - * @private - * @name get - * @memberOf MapCache - * @param {string} key The key of the value to get. - * @returns {*} Returns the entry value. - */ -function mapCacheGet(key) { - return getMapData(this, key).get(key); -} - -/** - * Checks if a map value for `key` exists. - * - * @private - * @name has - * @memberOf MapCache - * @param {string} key The key of the entry to check. - * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. - */ -function mapCacheHas(key) { - return getMapData(this, key).has(key); -} - -/** - * Sets the map `key` to `value`. - * - * @private - * @name set - * @memberOf MapCache - * @param {string} key The key of the value to set. - * @param {*} value The value to set. - * @returns {Object} Returns the map cache instance. - */ -function mapCacheSet(key, value) { - getMapData(this, key).set(key, value); - return this; -} - -// Add methods to `MapCache`. -MapCache.prototype.clear = mapCacheClear; -MapCache.prototype['delete'] = mapCacheDelete; -MapCache.prototype.get = mapCacheGet; -MapCache.prototype.has = mapCacheHas; -MapCache.prototype.set = mapCacheSet; - -/** - * - * Creates an array cache object to store unique values. - * - * @private - * @constructor - * @param {Array} [values] The values to cache. - */ -function SetCache(values) { - var index = -1, - length = values ? values.length : 0; - - this.__data__ = new MapCache; - while (++index < length) { - this.add(values[index]); - } -} - -/** - * Adds `value` to the array cache. - * - * @private - * @name add - * @memberOf SetCache - * @alias push - * @param {*} value The value to cache. - * @returns {Object} Returns the cache instance. - */ -function setCacheAdd(value) { - this.__data__.set(value, HASH_UNDEFINED); - return this; -} - -/** - * Checks if `value` is in the array cache. - * - * @private - * @name has - * @memberOf SetCache - * @param {*} value The value to search for. - * @returns {number} Returns `true` if `value` is found, else `false`. - */ -function setCacheHas(value) { - return this.__data__.has(value); -} - -// Add methods to `SetCache`. -SetCache.prototype.add = SetCache.prototype.push = setCacheAdd; -SetCache.prototype.has = setCacheHas; - -/** - * Gets the index at which the `key` is found in `array` of key-value pairs. - * - * @private - * @param {Array} array The array to inspect. - * @param {*} key The key to search for. - * @returns {number} Returns the index of the matched value, else `-1`. - */ -function assocIndexOf(array, key) { - var length = array.length; - while (length--) { - if (eq(array[length][0], key)) { - return length; - } - } - return -1; -} - -/** - * The base implementation of `_.isNative` without bad shim checks. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a native function, - * else `false`. - */ -function baseIsNative(value) { - if (!isObject(value) || isMasked(value)) { - return false; - } - var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor; - return pattern.test(toSource(value)); -} - -/** - * The base implementation of `_.uniqBy` without support for iteratee shorthands. - * - * @private - * @param {Array} array The array to inspect. - * @param {Function} [iteratee] The iteratee invoked per element. - * @param {Function} [comparator] The comparator invoked per element. - * @returns {Array} Returns the new duplicate free array. - */ -function baseUniq(array, iteratee, comparator) { - var index = -1, - includes = arrayIncludes, - length = array.length, - isCommon = true, - result = [], - seen = result; - - if (comparator) { - isCommon = false; - includes = arrayIncludesWith; - } - else if (length >= LARGE_ARRAY_SIZE) { - var set = iteratee ? null : createSet(array); - if (set) { - return setToArray(set); - } - isCommon = false; - includes = cacheHas; - seen = new SetCache; - } - else { - seen = iteratee ? [] : result; - } - outer: - while (++index < length) { - var value = array[index], - computed = iteratee ? iteratee(value) : value; - - value = (comparator || value !== 0) ? value : 0; - if (isCommon && computed === computed) { - var seenIndex = seen.length; - while (seenIndex--) { - if (seen[seenIndex] === computed) { - continue outer; - } - } - if (iteratee) { - seen.push(computed); - } - result.push(value); - } - else if (!includes(seen, computed, comparator)) { - if (seen !== result) { - seen.push(computed); - } - result.push(value); - } - } - return result; -} - -/** - * Creates a set object of `values`. - * - * @private - * @param {Array} values The values to add to the set. - * @returns {Object} Returns the new set. - */ -var createSet = !(Set && (1 / setToArray(new Set([,-0]))[1]) == INFINITY) ? noop : function(values) { - return new Set(values); -}; - -/** - * Gets the data for `map`. - * - * @private - * @param {Object} map The map to query. - * @param {string} key The reference key. - * @returns {*} Returns the map data. - */ -function getMapData(map, key) { - var data = map.__data__; - return isKeyable(key) - ? data[typeof key == 'string' ? 'string' : 'hash'] - : data.map; -} - -/** - * Gets the native function at `key` of `object`. - * - * @private - * @param {Object} object The object to query. - * @param {string} key The key of the method to get. - * @returns {*} Returns the function if it's native, else `undefined`. - */ -function getNative(object, key) { - var value = getValue(object, key); - return baseIsNative(value) ? value : undefined; -} - -/** - * Checks if `value` is suitable for use as unique object key. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is suitable, else `false`. - */ -function isKeyable(value) { - var type = typeof value; - return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean') - ? (value !== '__proto__') - : (value === null); -} - -/** - * Checks if `func` has its source masked. - * - * @private - * @param {Function} func The function to check. - * @returns {boolean} Returns `true` if `func` is masked, else `false`. - */ -function isMasked(func) { - return !!maskSrcKey && (maskSrcKey in func); -} - -/** - * Converts `func` to its source code. - * - * @private - * @param {Function} func The function to process. - * @returns {string} Returns the source code. - */ -function toSource(func) { - if (func != null) { - try { - return funcToString.call(func); - } catch (e) {} - try { - return (func + ''); - } catch (e) {} - } - return ''; -} - -/** - * Creates a duplicate-free version of an array, using - * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) - * for equality comparisons, in which only the first occurrence of each - * element is kept. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Array - * @param {Array} array The array to inspect. - * @returns {Array} Returns the new duplicate free array. - * @example - * - * _.uniq([2, 1, 2]); - * // => [2, 1] - */ -function uniq(array) { - return (array && array.length) - ? baseUniq(array) - : []; -} - -/** - * Performs a - * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) - * comparison between two values to determine if they are equivalent. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to compare. - * @param {*} other The other value to compare. - * @returns {boolean} Returns `true` if the values are equivalent, else `false`. - * @example - * - * var object = { 'a': 1 }; - * var other = { 'a': 1 }; - * - * _.eq(object, object); - * // => true - * - * _.eq(object, other); - * // => false - * - * _.eq('a', 'a'); - * // => true - * - * _.eq('a', Object('a')); - * // => false - * - * _.eq(NaN, NaN); - * // => true - */ -function eq(value, other) { - return value === other || (value !== value && other !== other); -} - -/** - * Checks if `value` is classified as a `Function` object. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a function, else `false`. - * @example - * - * _.isFunction(_); - * // => true - * - * _.isFunction(/abc/); - * // => false - */ -function isFunction(value) { - // The use of `Object#toString` avoids issues with the `typeof` operator - // in Safari 8-9 which returns 'object' for typed array and other constructors. - var tag = isObject(value) ? objectToString.call(value) : ''; - return tag == funcTag || tag == genTag; -} - -/** - * Checks if `value` is the - * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types) - * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an object, else `false`. - * @example - * - * _.isObject({}); - * // => true - * - * _.isObject([1, 2, 3]); - * // => true - * - * _.isObject(_.noop); - * // => true - * - * _.isObject(null); - * // => false - */ -function isObject(value) { - var type = typeof value; - return !!value && (type == 'object' || type == 'function'); -} - -/** - * This method returns `undefined`. - * - * @static - * @memberOf _ - * @since 2.3.0 - * @category Util - * @example - * - * _.times(2, _.noop); - * // => [undefined, undefined] - */ -function noop() { - // No operation performed. -} - -module.exports = uniq; diff --git a/deps/npm/node_modules/lodash.uniq/package.json b/deps/npm/node_modules/lodash.uniq/package.json deleted file mode 100644 index d988afca82f4aa..00000000000000 --- a/deps/npm/node_modules/lodash.uniq/package.json +++ /dev/null @@ -1,72 +0,0 @@ -{ - "_args": [ - [ - "lodash.uniq@4.5.0", - "/Users/rebecca/code/npm" - ] - ], - "_from": "lodash.uniq@4.5.0", - "_id": "lodash.uniq@4.5.0", - "_inBundle": false, - "_integrity": "sha1-0CJTc662Uq3BvILklFM5qEJ1R3M=", - "_location": "/lodash.uniq", - "_phantomChildren": {}, - "_requested": { - "type": "version", - "registry": true, - "raw": "lodash.uniq@4.5.0", - "name": "lodash.uniq", - "escapedName": "lodash.uniq", - "rawSpec": "4.5.0", - "saveSpec": null, - "fetchSpec": "4.5.0" - }, - "_requiredBy": [ - "/" - ], - "_resolved": "https://registry.npmjs.org/lodash.uniq/-/lodash.uniq-4.5.0.tgz", - "_spec": "4.5.0", - "_where": "/Users/rebecca/code/npm", - "author": { - "name": "John-David Dalton", - "email": "john.david.dalton@gmail.com", - "url": "http://allyoucanleet.com/" - }, - "bugs": { - "url": "https://github.com/lodash/lodash/issues" - }, - "contributors": [ - { - "name": "John-David Dalton", - "email": "john.david.dalton@gmail.com", - "url": "http://allyoucanleet.com/" - }, - { - "name": "Blaine Bublitz", - "email": "blaine.bublitz@gmail.com", - "url": "https://github.com/phated" - }, - { - "name": "Mathias Bynens", - "email": "mathias@qiwi.be", - "url": "https://mathiasbynens.be/" - } - ], - "description": "The lodash method `_.uniq` exported as a module.", - "homepage": "https://lodash.com/", - "icon": "https://lodash.com/icon.svg", - "keywords": [ - "lodash-modularized", - "uniq" - ], - "license": "MIT", - "name": "lodash.uniq", - "repository": { - "type": "git", - "url": "git+https://github.com/lodash/lodash.git" - }, - "scripts": { - "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" - }, - "version": "4.5.0" -} diff --git a/deps/npm/node_modules/lodash.without/LICENSE b/deps/npm/node_modules/lodash.without/LICENSE deleted file mode 100644 index e0c69d56032d15..00000000000000 --- a/deps/npm/node_modules/lodash.without/LICENSE +++ /dev/null @@ -1,47 +0,0 @@ -Copyright jQuery Foundation and other contributors - -Based on Underscore.js, copyright Jeremy Ashkenas, -DocumentCloud and Investigative Reporters & Editors - -This software consists of voluntary contributions made by many -individuals. For exact contribution history, see the revision history -available at https://github.com/lodash/lodash - -The following license applies to all parts of this software except as -documented below: - -==== - -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. - -==== - -Copyright and related rights for sample code are waived via CC0. Sample -code is defined as all source code displayed within the prose of the -documentation. - -CC0: http://creativecommons.org/publicdomain/zero/1.0/ - -==== - -Files located in the node_modules and vendor directories are externally -maintained libraries used by this software which have their own -licenses; we recommend you read them, as their terms may differ from the -terms above. diff --git a/deps/npm/node_modules/lodash.without/README.md b/deps/npm/node_modules/lodash.without/README.md deleted file mode 100644 index 8c00f8a4a03e62..00000000000000 --- a/deps/npm/node_modules/lodash.without/README.md +++ /dev/null @@ -1,18 +0,0 @@ -# lodash.without v4.4.0 - -The [lodash](https://lodash.com/) method `_.without` exported as a [Node.js](https://nodejs.org/) module. - -## Installation - -Using npm: -```bash -$ {sudo -H} npm i -g npm -$ npm i --save lodash.without -``` - -In Node.js: -```js -var without = require('lodash.without'); -``` - -See the [documentation](https://lodash.com/docs#without) or [package source](https://github.com/lodash/lodash/blob/4.4.0-npm-packages/lodash.without) for more details. diff --git a/deps/npm/node_modules/lodash.without/index.js b/deps/npm/node_modules/lodash.without/index.js deleted file mode 100644 index b75daee5fd82d8..00000000000000 --- a/deps/npm/node_modules/lodash.without/index.js +++ /dev/null @@ -1,1051 +0,0 @@ -/** - * lodash (Custom Build) - * Build: `lodash modularize exports="npm" -o ./` - * Copyright jQuery Foundation and other contributors - * Released under MIT license - * Based on Underscore.js 1.8.3 - * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - */ - -/** Used as the size to enable large array optimizations. */ -var LARGE_ARRAY_SIZE = 200; - -/** Used to stand-in for `undefined` hash values. */ -var HASH_UNDEFINED = '__lodash_hash_undefined__'; - -/** Used as references for various `Number` constants. */ -var MAX_SAFE_INTEGER = 9007199254740991; - -/** `Object#toString` result references. */ -var funcTag = '[object Function]', - genTag = '[object GeneratorFunction]'; - -/** - * Used to match `RegExp` - * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns). - */ -var reRegExpChar = /[\\^$.*+?()[\]{}|]/g; - -/** Used to detect host constructors (Safari). */ -var reIsHostCtor = /^\[object .+?Constructor\]$/; - -/** Detect free variable `global` from Node.js. */ -var freeGlobal = typeof global == 'object' && global && global.Object === Object && global; - -/** Detect free variable `self`. */ -var freeSelf = typeof self == 'object' && self && self.Object === Object && self; - -/** Used as a reference to the global object. */ -var root = freeGlobal || freeSelf || Function('return this')(); - -/** - * A faster alternative to `Function#apply`, this function invokes `func` - * with the `this` binding of `thisArg` and the arguments of `args`. - * - * @private - * @param {Function} func The function to invoke. - * @param {*} thisArg The `this` binding of `func`. - * @param {Array} args The arguments to invoke `func` with. - * @returns {*} Returns the result of `func`. - */ -function apply(func, thisArg, args) { - switch (args.length) { - case 0: return func.call(thisArg); - case 1: return func.call(thisArg, args[0]); - case 2: return func.call(thisArg, args[0], args[1]); - case 3: return func.call(thisArg, args[0], args[1], args[2]); - } - return func.apply(thisArg, args); -} - -/** - * A specialized version of `_.includes` for arrays without support for - * specifying an index to search from. - * - * @private - * @param {Array} [array] The array to inspect. - * @param {*} target The value to search for. - * @returns {boolean} Returns `true` if `target` is found, else `false`. - */ -function arrayIncludes(array, value) { - var length = array ? array.length : 0; - return !!length && baseIndexOf(array, value, 0) > -1; -} - -/** - * This function is like `arrayIncludes` except that it accepts a comparator. - * - * @private - * @param {Array} [array] The array to inspect. - * @param {*} target The value to search for. - * @param {Function} comparator The comparator invoked per element. - * @returns {boolean} Returns `true` if `target` is found, else `false`. - */ -function arrayIncludesWith(array, value, comparator) { - var index = -1, - length = array ? array.length : 0; - - while (++index < length) { - if (comparator(value, array[index])) { - return true; - } - } - return false; -} - -/** - * A specialized version of `_.map` for arrays without support for iteratee - * shorthands. - * - * @private - * @param {Array} [array] The array to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Array} Returns the new mapped array. - */ -function arrayMap(array, iteratee) { - var index = -1, - length = array ? array.length : 0, - result = Array(length); - - while (++index < length) { - result[index] = iteratee(array[index], index, array); - } - return result; -} - -/** - * The base implementation of `_.findIndex` and `_.findLastIndex` without - * support for iteratee shorthands. - * - * @private - * @param {Array} array The array to inspect. - * @param {Function} predicate The function invoked per iteration. - * @param {number} fromIndex The index to search from. - * @param {boolean} [fromRight] Specify iterating from right to left. - * @returns {number} Returns the index of the matched value, else `-1`. - */ -function baseFindIndex(array, predicate, fromIndex, fromRight) { - var length = array.length, - index = fromIndex + (fromRight ? 1 : -1); - - while ((fromRight ? index-- : ++index < length)) { - if (predicate(array[index], index, array)) { - return index; - } - } - return -1; -} - -/** - * The base implementation of `_.indexOf` without `fromIndex` bounds checks. - * - * @private - * @param {Array} array The array to inspect. - * @param {*} value The value to search for. - * @param {number} fromIndex The index to search from. - * @returns {number} Returns the index of the matched value, else `-1`. - */ -function baseIndexOf(array, value, fromIndex) { - if (value !== value) { - return baseFindIndex(array, baseIsNaN, fromIndex); - } - var index = fromIndex - 1, - length = array.length; - - while (++index < length) { - if (array[index] === value) { - return index; - } - } - return -1; -} - -/** - * The base implementation of `_.isNaN` without support for number objects. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`. - */ -function baseIsNaN(value) { - return value !== value; -} - -/** - * The base implementation of `_.unary` without support for storing metadata. - * - * @private - * @param {Function} func The function to cap arguments for. - * @returns {Function} Returns the new capped function. - */ -function baseUnary(func) { - return function(value) { - return func(value); - }; -} - -/** - * Checks if a cache value for `key` exists. - * - * @private - * @param {Object} cache The cache to query. - * @param {string} key The key of the entry to check. - * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. - */ -function cacheHas(cache, key) { - return cache.has(key); -} - -/** - * Gets the value at `key` of `object`. - * - * @private - * @param {Object} [object] The object to query. - * @param {string} key The key of the property to get. - * @returns {*} Returns the property value. - */ -function getValue(object, key) { - return object == null ? undefined : object[key]; -} - -/** - * Checks if `value` is a host object in IE < 9. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a host object, else `false`. - */ -function isHostObject(value) { - // Many host objects are `Object` objects that can coerce to strings - // despite having improperly defined `toString` methods. - var result = false; - if (value != null && typeof value.toString != 'function') { - try { - result = !!(value + ''); - } catch (e) {} - } - return result; -} - -/** Used for built-in method references. */ -var arrayProto = Array.prototype, - funcProto = Function.prototype, - objectProto = Object.prototype; - -/** Used to detect overreaching core-js shims. */ -var coreJsData = root['__core-js_shared__']; - -/** Used to detect methods masquerading as native. */ -var maskSrcKey = (function() { - var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || ''); - return uid ? ('Symbol(src)_1.' + uid) : ''; -}()); - -/** Used to resolve the decompiled source of functions. */ -var funcToString = funcProto.toString; - -/** Used to check objects for own properties. */ -var hasOwnProperty = objectProto.hasOwnProperty; - -/** - * Used to resolve the - * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) - * of values. - */ -var objectToString = objectProto.toString; - -/** Used to detect if a method is native. */ -var reIsNative = RegExp('^' + - funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&') - .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$' -); - -/** Built-in value references. */ -var splice = arrayProto.splice; - -/* Built-in method references for those with the same name as other `lodash` methods. */ -var nativeMax = Math.max; - -/* Built-in method references that are verified to be native. */ -var Map = getNative(root, 'Map'), - nativeCreate = getNative(Object, 'create'); - -/** - * Creates a hash object. - * - * @private - * @constructor - * @param {Array} [entries] The key-value pairs to cache. - */ -function Hash(entries) { - var index = -1, - length = entries ? entries.length : 0; - - this.clear(); - while (++index < length) { - var entry = entries[index]; - this.set(entry[0], entry[1]); - } -} - -/** - * Removes all key-value entries from the hash. - * - * @private - * @name clear - * @memberOf Hash - */ -function hashClear() { - this.__data__ = nativeCreate ? nativeCreate(null) : {}; -} - -/** - * Removes `key` and its value from the hash. - * - * @private - * @name delete - * @memberOf Hash - * @param {Object} hash The hash to modify. - * @param {string} key The key of the value to remove. - * @returns {boolean} Returns `true` if the entry was removed, else `false`. - */ -function hashDelete(key) { - return this.has(key) && delete this.__data__[key]; -} - -/** - * Gets the hash value for `key`. - * - * @private - * @name get - * @memberOf Hash - * @param {string} key The key of the value to get. - * @returns {*} Returns the entry value. - */ -function hashGet(key) { - var data = this.__data__; - if (nativeCreate) { - var result = data[key]; - return result === HASH_UNDEFINED ? undefined : result; - } - return hasOwnProperty.call(data, key) ? data[key] : undefined; -} - -/** - * Checks if a hash value for `key` exists. - * - * @private - * @name has - * @memberOf Hash - * @param {string} key The key of the entry to check. - * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. - */ -function hashHas(key) { - var data = this.__data__; - return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key); -} - -/** - * Sets the hash `key` to `value`. - * - * @private - * @name set - * @memberOf Hash - * @param {string} key The key of the value to set. - * @param {*} value The value to set. - * @returns {Object} Returns the hash instance. - */ -function hashSet(key, value) { - var data = this.__data__; - data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value; - return this; -} - -// Add methods to `Hash`. -Hash.prototype.clear = hashClear; -Hash.prototype['delete'] = hashDelete; -Hash.prototype.get = hashGet; -Hash.prototype.has = hashHas; -Hash.prototype.set = hashSet; - -/** - * Creates an list cache object. - * - * @private - * @constructor - * @param {Array} [entries] The key-value pairs to cache. - */ -function ListCache(entries) { - var index = -1, - length = entries ? entries.length : 0; - - this.clear(); - while (++index < length) { - var entry = entries[index]; - this.set(entry[0], entry[1]); - } -} - -/** - * Removes all key-value entries from the list cache. - * - * @private - * @name clear - * @memberOf ListCache - */ -function listCacheClear() { - this.__data__ = []; -} - -/** - * Removes `key` and its value from the list cache. - * - * @private - * @name delete - * @memberOf ListCache - * @param {string} key The key of the value to remove. - * @returns {boolean} Returns `true` if the entry was removed, else `false`. - */ -function listCacheDelete(key) { - var data = this.__data__, - index = assocIndexOf(data, key); - - if (index < 0) { - return false; - } - var lastIndex = data.length - 1; - if (index == lastIndex) { - data.pop(); - } else { - splice.call(data, index, 1); - } - return true; -} - -/** - * Gets the list cache value for `key`. - * - * @private - * @name get - * @memberOf ListCache - * @param {string} key The key of the value to get. - * @returns {*} Returns the entry value. - */ -function listCacheGet(key) { - var data = this.__data__, - index = assocIndexOf(data, key); - - return index < 0 ? undefined : data[index][1]; -} - -/** - * Checks if a list cache value for `key` exists. - * - * @private - * @name has - * @memberOf ListCache - * @param {string} key The key of the entry to check. - * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. - */ -function listCacheHas(key) { - return assocIndexOf(this.__data__, key) > -1; -} - -/** - * Sets the list cache `key` to `value`. - * - * @private - * @name set - * @memberOf ListCache - * @param {string} key The key of the value to set. - * @param {*} value The value to set. - * @returns {Object} Returns the list cache instance. - */ -function listCacheSet(key, value) { - var data = this.__data__, - index = assocIndexOf(data, key); - - if (index < 0) { - data.push([key, value]); - } else { - data[index][1] = value; - } - return this; -} - -// Add methods to `ListCache`. -ListCache.prototype.clear = listCacheClear; -ListCache.prototype['delete'] = listCacheDelete; -ListCache.prototype.get = listCacheGet; -ListCache.prototype.has = listCacheHas; -ListCache.prototype.set = listCacheSet; - -/** - * Creates a map cache object to store key-value pairs. - * - * @private - * @constructor - * @param {Array} [entries] The key-value pairs to cache. - */ -function MapCache(entries) { - var index = -1, - length = entries ? entries.length : 0; - - this.clear(); - while (++index < length) { - var entry = entries[index]; - this.set(entry[0], entry[1]); - } -} - -/** - * Removes all key-value entries from the map. - * - * @private - * @name clear - * @memberOf MapCache - */ -function mapCacheClear() { - this.__data__ = { - 'hash': new Hash, - 'map': new (Map || ListCache), - 'string': new Hash - }; -} - -/** - * Removes `key` and its value from the map. - * - * @private - * @name delete - * @memberOf MapCache - * @param {string} key The key of the value to remove. - * @returns {boolean} Returns `true` if the entry was removed, else `false`. - */ -function mapCacheDelete(key) { - return getMapData(this, key)['delete'](key); -} - -/** - * Gets the map value for `key`. - * - * @private - * @name get - * @memberOf MapCache - * @param {string} key The key of the value to get. - * @returns {*} Returns the entry value. - */ -function mapCacheGet(key) { - return getMapData(this, key).get(key); -} - -/** - * Checks if a map value for `key` exists. - * - * @private - * @name has - * @memberOf MapCache - * @param {string} key The key of the entry to check. - * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. - */ -function mapCacheHas(key) { - return getMapData(this, key).has(key); -} - -/** - * Sets the map `key` to `value`. - * - * @private - * @name set - * @memberOf MapCache - * @param {string} key The key of the value to set. - * @param {*} value The value to set. - * @returns {Object} Returns the map cache instance. - */ -function mapCacheSet(key, value) { - getMapData(this, key).set(key, value); - return this; -} - -// Add methods to `MapCache`. -MapCache.prototype.clear = mapCacheClear; -MapCache.prototype['delete'] = mapCacheDelete; -MapCache.prototype.get = mapCacheGet; -MapCache.prototype.has = mapCacheHas; -MapCache.prototype.set = mapCacheSet; - -/** - * - * Creates an array cache object to store unique values. - * - * @private - * @constructor - * @param {Array} [values] The values to cache. - */ -function SetCache(values) { - var index = -1, - length = values ? values.length : 0; - - this.__data__ = new MapCache; - while (++index < length) { - this.add(values[index]); - } -} - -/** - * Adds `value` to the array cache. - * - * @private - * @name add - * @memberOf SetCache - * @alias push - * @param {*} value The value to cache. - * @returns {Object} Returns the cache instance. - */ -function setCacheAdd(value) { - this.__data__.set(value, HASH_UNDEFINED); - return this; -} - -/** - * Checks if `value` is in the array cache. - * - * @private - * @name has - * @memberOf SetCache - * @param {*} value The value to search for. - * @returns {number} Returns `true` if `value` is found, else `false`. - */ -function setCacheHas(value) { - return this.__data__.has(value); -} - -// Add methods to `SetCache`. -SetCache.prototype.add = SetCache.prototype.push = setCacheAdd; -SetCache.prototype.has = setCacheHas; - -/** - * Gets the index at which the `key` is found in `array` of key-value pairs. - * - * @private - * @param {Array} array The array to inspect. - * @param {*} key The key to search for. - * @returns {number} Returns the index of the matched value, else `-1`. - */ -function assocIndexOf(array, key) { - var length = array.length; - while (length--) { - if (eq(array[length][0], key)) { - return length; - } - } - return -1; -} - -/** - * The base implementation of methods like `_.difference` without support - * for excluding multiple arrays or iteratee shorthands. - * - * @private - * @param {Array} array The array to inspect. - * @param {Array} values The values to exclude. - * @param {Function} [iteratee] The iteratee invoked per element. - * @param {Function} [comparator] The comparator invoked per element. - * @returns {Array} Returns the new array of filtered values. - */ -function baseDifference(array, values, iteratee, comparator) { - var index = -1, - includes = arrayIncludes, - isCommon = true, - length = array.length, - result = [], - valuesLength = values.length; - - if (!length) { - return result; - } - if (iteratee) { - values = arrayMap(values, baseUnary(iteratee)); - } - if (comparator) { - includes = arrayIncludesWith; - isCommon = false; - } - else if (values.length >= LARGE_ARRAY_SIZE) { - includes = cacheHas; - isCommon = false; - values = new SetCache(values); - } - outer: - while (++index < length) { - var value = array[index], - computed = iteratee ? iteratee(value) : value; - - value = (comparator || value !== 0) ? value : 0; - if (isCommon && computed === computed) { - var valuesIndex = valuesLength; - while (valuesIndex--) { - if (values[valuesIndex] === computed) { - continue outer; - } - } - result.push(value); - } - else if (!includes(values, computed, comparator)) { - result.push(value); - } - } - return result; -} - -/** - * The base implementation of `_.isNative` without bad shim checks. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a native function, - * else `false`. - */ -function baseIsNative(value) { - if (!isObject(value) || isMasked(value)) { - return false; - } - var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor; - return pattern.test(toSource(value)); -} - -/** - * The base implementation of `_.rest` which doesn't validate or coerce arguments. - * - * @private - * @param {Function} func The function to apply a rest parameter to. - * @param {number} [start=func.length-1] The start position of the rest parameter. - * @returns {Function} Returns the new function. - */ -function baseRest(func, start) { - start = nativeMax(start === undefined ? (func.length - 1) : start, 0); - return function() { - var args = arguments, - index = -1, - length = nativeMax(args.length - start, 0), - array = Array(length); - - while (++index < length) { - array[index] = args[start + index]; - } - index = -1; - var otherArgs = Array(start + 1); - while (++index < start) { - otherArgs[index] = args[index]; - } - otherArgs[start] = array; - return apply(func, this, otherArgs); - }; -} - -/** - * Gets the data for `map`. - * - * @private - * @param {Object} map The map to query. - * @param {string} key The reference key. - * @returns {*} Returns the map data. - */ -function getMapData(map, key) { - var data = map.__data__; - return isKeyable(key) - ? data[typeof key == 'string' ? 'string' : 'hash'] - : data.map; -} - -/** - * Gets the native function at `key` of `object`. - * - * @private - * @param {Object} object The object to query. - * @param {string} key The key of the method to get. - * @returns {*} Returns the function if it's native, else `undefined`. - */ -function getNative(object, key) { - var value = getValue(object, key); - return baseIsNative(value) ? value : undefined; -} - -/** - * Checks if `value` is suitable for use as unique object key. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is suitable, else `false`. - */ -function isKeyable(value) { - var type = typeof value; - return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean') - ? (value !== '__proto__') - : (value === null); -} - -/** - * Checks if `func` has its source masked. - * - * @private - * @param {Function} func The function to check. - * @returns {boolean} Returns `true` if `func` is masked, else `false`. - */ -function isMasked(func) { - return !!maskSrcKey && (maskSrcKey in func); -} - -/** - * Converts `func` to its source code. - * - * @private - * @param {Function} func The function to process. - * @returns {string} Returns the source code. - */ -function toSource(func) { - if (func != null) { - try { - return funcToString.call(func); - } catch (e) {} - try { - return (func + ''); - } catch (e) {} - } - return ''; -} - -/** - * Creates an array excluding all given values using - * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) - * for equality comparisons. - * - * **Note:** Unlike `_.pull`, this method returns a new array. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Array - * @param {Array} array The array to inspect. - * @param {...*} [values] The values to exclude. - * @returns {Array} Returns the new array of filtered values. - * @see _.difference, _.xor - * @example - * - * _.without([2, 1, 2, 3], 1, 2); - * // => [3] - */ -var without = baseRest(function(array, values) { - return isArrayLikeObject(array) - ? baseDifference(array, values) - : []; -}); - -/** - * Performs a - * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) - * comparison between two values to determine if they are equivalent. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to compare. - * @param {*} other The other value to compare. - * @returns {boolean} Returns `true` if the values are equivalent, else `false`. - * @example - * - * var object = { 'a': 1 }; - * var other = { 'a': 1 }; - * - * _.eq(object, object); - * // => true - * - * _.eq(object, other); - * // => false - * - * _.eq('a', 'a'); - * // => true - * - * _.eq('a', Object('a')); - * // => false - * - * _.eq(NaN, NaN); - * // => true - */ -function eq(value, other) { - return value === other || (value !== value && other !== other); -} - -/** - * Checks if `value` is array-like. A value is considered array-like if it's - * not a function and has a `value.length` that's an integer greater than or - * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is array-like, else `false`. - * @example - * - * _.isArrayLike([1, 2, 3]); - * // => true - * - * _.isArrayLike(document.body.children); - * // => true - * - * _.isArrayLike('abc'); - * // => true - * - * _.isArrayLike(_.noop); - * // => false - */ -function isArrayLike(value) { - return value != null && isLength(value.length) && !isFunction(value); -} - -/** - * This method is like `_.isArrayLike` except that it also checks if `value` - * is an object. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an array-like object, - * else `false`. - * @example - * - * _.isArrayLikeObject([1, 2, 3]); - * // => true - * - * _.isArrayLikeObject(document.body.children); - * // => true - * - * _.isArrayLikeObject('abc'); - * // => false - * - * _.isArrayLikeObject(_.noop); - * // => false - */ -function isArrayLikeObject(value) { - return isObjectLike(value) && isArrayLike(value); -} - -/** - * Checks if `value` is classified as a `Function` object. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a function, else `false`. - * @example - * - * _.isFunction(_); - * // => true - * - * _.isFunction(/abc/); - * // => false - */ -function isFunction(value) { - // The use of `Object#toString` avoids issues with the `typeof` operator - // in Safari 8-9 which returns 'object' for typed array and other constructors. - var tag = isObject(value) ? objectToString.call(value) : ''; - return tag == funcTag || tag == genTag; -} - -/** - * Checks if `value` is a valid array-like length. - * - * **Note:** This method is loosely based on - * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength). - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. - * @example - * - * _.isLength(3); - * // => true - * - * _.isLength(Number.MIN_VALUE); - * // => false - * - * _.isLength(Infinity); - * // => false - * - * _.isLength('3'); - * // => false - */ -function isLength(value) { - return typeof value == 'number' && - value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; -} - -/** - * Checks if `value` is the - * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types) - * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an object, else `false`. - * @example - * - * _.isObject({}); - * // => true - * - * _.isObject([1, 2, 3]); - * // => true - * - * _.isObject(_.noop); - * // => true - * - * _.isObject(null); - * // => false - */ -function isObject(value) { - var type = typeof value; - return !!value && (type == 'object' || type == 'function'); -} - -/** - * Checks if `value` is object-like. A value is object-like if it's not `null` - * and has a `typeof` result of "object". - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is object-like, else `false`. - * @example - * - * _.isObjectLike({}); - * // => true - * - * _.isObjectLike([1, 2, 3]); - * // => true - * - * _.isObjectLike(_.noop); - * // => false - * - * _.isObjectLike(null); - * // => false - */ -function isObjectLike(value) { - return !!value && typeof value == 'object'; -} - -module.exports = without; diff --git a/deps/npm/node_modules/lodash.without/package.json b/deps/npm/node_modules/lodash.without/package.json deleted file mode 100644 index df953169d50dd9..00000000000000 --- a/deps/npm/node_modules/lodash.without/package.json +++ /dev/null @@ -1,72 +0,0 @@ -{ - "_args": [ - [ - "lodash.without@4.4.0", - "/Users/rebecca/code/npm" - ] - ], - "_from": "lodash.without@4.4.0", - "_id": "lodash.without@4.4.0", - "_inBundle": false, - "_integrity": "sha1-PNRXSgC2e643OpS3SHcmQFB7eqw=", - "_location": "/lodash.without", - "_phantomChildren": {}, - "_requested": { - "type": "version", - "registry": true, - "raw": "lodash.without@4.4.0", - "name": "lodash.without", - "escapedName": "lodash.without", - "rawSpec": "4.4.0", - "saveSpec": null, - "fetchSpec": "4.4.0" - }, - "_requiredBy": [ - "/" - ], - "_resolved": "https://registry.npmjs.org/lodash.without/-/lodash.without-4.4.0.tgz", - "_spec": "4.4.0", - "_where": "/Users/rebecca/code/npm", - "author": { - "name": "John-David Dalton", - "email": "john.david.dalton@gmail.com", - "url": "http://allyoucanleet.com/" - }, - "bugs": { - "url": "https://github.com/lodash/lodash/issues" - }, - "contributors": [ - { - "name": "John-David Dalton", - "email": "john.david.dalton@gmail.com", - "url": "http://allyoucanleet.com/" - }, - { - "name": "Blaine Bublitz", - "email": "blaine.bublitz@gmail.com", - "url": "https://github.com/phated" - }, - { - "name": "Mathias Bynens", - "email": "mathias@qiwi.be", - "url": "https://mathiasbynens.be/" - } - ], - "description": "The lodash method `_.without` exported as a module.", - "homepage": "https://lodash.com/", - "icon": "https://lodash.com/icon.svg", - "keywords": [ - "lodash-modularized", - "without" - ], - "license": "MIT", - "name": "lodash.without", - "repository": { - "type": "git", - "url": "git+https://github.com/lodash/lodash.git" - }, - "scripts": { - "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" - }, - "version": "4.4.0" -} diff --git a/deps/npm/node_modules/lowercase-keys/index.js b/deps/npm/node_modules/lowercase-keys/index.js deleted file mode 100644 index b8d8898365ee57..00000000000000 --- a/deps/npm/node_modules/lowercase-keys/index.js +++ /dev/null @@ -1,11 +0,0 @@ -'use strict'; -module.exports = function (obj) { - var ret = {}; - var keys = Object.keys(Object(obj)); - - for (var i = 0; i < keys.length; i++) { - ret[keys[i].toLowerCase()] = obj[keys[i]]; - } - - return ret; -}; diff --git a/deps/npm/node_modules/lowercase-keys/license b/deps/npm/node_modules/lowercase-keys/license deleted file mode 100644 index 654d0bfe943437..00000000000000 --- a/deps/npm/node_modules/lowercase-keys/license +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -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/deps/npm/node_modules/lowercase-keys/package.json b/deps/npm/node_modules/lowercase-keys/package.json deleted file mode 100644 index fe5b91f7acdb18..00000000000000 --- a/deps/npm/node_modules/lowercase-keys/package.json +++ /dev/null @@ -1,67 +0,0 @@ -{ - "_from": "lowercase-keys@^1.0.0", - "_id": "lowercase-keys@1.0.1", - "_inBundle": false, - "_integrity": "sha512-G2Lj61tXDnVFFOi8VZds+SoQjtQC3dgokKdDG2mTm1tx4m50NUHBOZSBwQQHyy0V12A0JTG4icfZQH+xPyh8VA==", - "_location": "/lowercase-keys", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "lowercase-keys@^1.0.0", - "name": "lowercase-keys", - "escapedName": "lowercase-keys", - "rawSpec": "^1.0.0", - "saveSpec": null, - "fetchSpec": "^1.0.0" - }, - "_requiredBy": [ - "/got" - ], - "_resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-1.0.1.tgz", - "_shasum": "6f9e30b47084d971a7c820ff15a6c5167b74c26f", - "_spec": "lowercase-keys@^1.0.0", - "_where": "/Users/rebecca/code/npm/node_modules/got", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "bugs": { - "url": "https://github.com/sindresorhus/lowercase-keys/issues" - }, - "bundleDependencies": false, - "deprecated": false, - "description": "Lowercase the keys of an object", - "devDependencies": { - "ava": "*" - }, - "engines": { - "node": ">=0.10.0" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/sindresorhus/lowercase-keys#readme", - "keywords": [ - "object", - "assign", - "extend", - "properties", - "lowercase", - "lower-case", - "case", - "keys", - "key" - ], - "license": "MIT", - "name": "lowercase-keys", - "repository": { - "type": "git", - "url": "git+https://github.com/sindresorhus/lowercase-keys.git" - }, - "scripts": { - "test": "ava" - }, - "version": "1.0.1" -} diff --git a/deps/npm/node_modules/lowercase-keys/readme.md b/deps/npm/node_modules/lowercase-keys/readme.md deleted file mode 100644 index dc65770a383861..00000000000000 --- a/deps/npm/node_modules/lowercase-keys/readme.md +++ /dev/null @@ -1,33 +0,0 @@ -# lowercase-keys [![Build Status](https://travis-ci.org/sindresorhus/lowercase-keys.svg?branch=master)](https://travis-ci.org/sindresorhus/lowercase-keys) - -> Lowercase the keys of an object - - -## Install - -``` -$ npm install --save lowercase-keys -``` - - -## Usage - -```js -var lowercaseKeys = require('lowercase-keys'); - -lowercaseKeys({FOO: true, bAr: false}); -//=> {foo: true, bar: false} -``` - - -## API - -### lowercaseKeys(object) - -Lowercases the keys and returns a new object. - - - -## License - -MIT © [Sindre Sorhus](http://sindresorhus.com) diff --git a/deps/npm/node_modules/lru-cache/package.json b/deps/npm/node_modules/lru-cache/package.json index 3b5a1f8b3fa2d9..43b7502c3e7c79 100644 --- a/deps/npm/node_modules/lru-cache/package.json +++ b/deps/npm/node_modules/lru-cache/package.json @@ -1,68 +1,34 @@ { - "_from": "lru-cache@5.1.1", - "_id": "lru-cache@5.1.1", - "_inBundle": false, - "_integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", - "_location": "/lru-cache", - "_phantomChildren": {}, - "_requested": { - "type": "version", - "registry": true, - "raw": "lru-cache@5.1.1", - "name": "lru-cache", - "escapedName": "lru-cache", - "rawSpec": "5.1.1", - "saveSpec": null, - "fetchSpec": "5.1.1" - }, - "_requiredBy": [ - "#USER", - "/" - ], - "_resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", - "_shasum": "1da27e6710271947695daf6848e847f01d84b920", - "_spec": "lru-cache@5.1.1", - "_where": "/Users/isaacs/dev/npm/cli", - "author": { - "name": "Isaac Z. Schlueter", - "email": "i@izs.me" - }, - "bugs": { - "url": "https://github.com/isaacs/node-lru-cache/issues" - }, - "bundleDependencies": false, - "dependencies": { - "yallist": "^3.0.2" - }, - "deprecated": false, + "name": "lru-cache", "description": "A cache object that deletes the least-recently-used items.", - "devDependencies": { - "benchmark": "^2.1.4", - "tap": "^12.1.0" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/isaacs/node-lru-cache#readme", + "version": "6.0.0", + "author": "Isaac Z. Schlueter ", "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": { - "coveragerport": "tap --coverage-report=html", - "postpublish": "git push origin --all; git push origin --tags", - "postversion": "npm publish", + "test": "tap", + "snap": "tap", "preversion": "npm test", - "snap": "TAP_SNAPSHOT=1 tap test/*.js -J", - "test": "tap test/*.js --100 -J" + "postversion": "npm publish", + "prepublishOnly": "git push origin --follow-tags" + }, + "main": "index.js", + "repository": "git://github.com/isaacs/node-lru-cache.git", + "devDependencies": { + "benchmark": "^2.1.4", + "tap": "^14.10.7" + }, + "license": "ISC", + "dependencies": { + "yallist": "^4.0.0" }, - "version": "5.1.1" + "files": [ + "index.js" + ], + "engines": { + "node": ">=10" + } } diff --git a/deps/npm/node_modules/make-dir/index.js b/deps/npm/node_modules/make-dir/index.js deleted file mode 100644 index 18439555f8ee25..00000000000000 --- a/deps/npm/node_modules/make-dir/index.js +++ /dev/null @@ -1,85 +0,0 @@ -'use strict'; -const fs = require('fs'); -const path = require('path'); -const pify = require('pify'); - -const defaults = { - mode: 0o777 & (~process.umask()), - fs -}; - -// https://github.com/nodejs/node/issues/8987 -// https://github.com/libuv/libuv/pull/1088 -const checkPath = pth => { - if (process.platform === 'win32') { - const pathHasInvalidWinCharacters = /[<>:"|?*]/.test(pth.replace(path.parse(pth).root, '')); - - if (pathHasInvalidWinCharacters) { - const err = new Error(`Path contains invalid characters: ${pth}`); - err.code = 'EINVAL'; - throw err; - } - } -}; - -module.exports = (input, opts) => Promise.resolve().then(() => { - checkPath(input); - opts = Object.assign({}, defaults, opts); - - const mkdir = pify(opts.fs.mkdir); - const stat = pify(opts.fs.stat); - - const make = pth => { - return mkdir(pth, opts.mode) - .then(() => pth) - .catch(err => { - if (err.code === 'ENOENT') { - if (err.message.includes('null bytes') || path.dirname(pth) === pth) { - throw err; - } - - return make(path.dirname(pth)).then(() => make(pth)); - } - - return stat(pth) - .then(stats => stats.isDirectory() ? pth : Promise.reject()) - .catch(() => { - throw err; - }); - }); - }; - - return make(path.resolve(input)); -}); - -module.exports.sync = (input, opts) => { - checkPath(input); - opts = Object.assign({}, defaults, opts); - - const make = pth => { - try { - opts.fs.mkdirSync(pth, opts.mode); - } catch (err) { - if (err.code === 'ENOENT') { - if (err.message.includes('null bytes') || path.dirname(pth) === pth) { - throw err; - } - - make(path.dirname(pth)); - return make(pth); - } - - try { - if (!opts.fs.statSync(pth).isDirectory()) { - throw new Error('The path is not a directory'); - } - } catch (_) { - throw err; - } - } - - return pth; - }; - - return make(path.resolve(input)); -}; diff --git a/deps/npm/node_modules/make-dir/license b/deps/npm/node_modules/make-dir/license deleted file mode 100644 index e7af2f77107d73..00000000000000 --- a/deps/npm/node_modules/make-dir/license +++ /dev/null @@ -1,9 +0,0 @@ -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/deps/npm/node_modules/make-dir/package.json b/deps/npm/node_modules/make-dir/package.json deleted file mode 100644 index fac42a63042f56..00000000000000 --- a/deps/npm/node_modules/make-dir/package.json +++ /dev/null @@ -1,86 +0,0 @@ -{ - "_from": "make-dir@^1.0.0", - "_id": "make-dir@1.3.0", - "_inBundle": false, - "_integrity": "sha512-2w31R7SJtieJJnQtGc7RVL2StM2vGYVfqUOvUDxH6bC6aJTxPxTF0GnIgCyu7tjockiUWAYQRbxa7vKn34s5sQ==", - "_location": "/make-dir", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "make-dir@^1.0.0", - "name": "make-dir", - "escapedName": "make-dir", - "rawSpec": "^1.0.0", - "saveSpec": null, - "fetchSpec": "^1.0.0" - }, - "_requiredBy": [ - "/configstore" - ], - "_resolved": "https://registry.npmjs.org/make-dir/-/make-dir-1.3.0.tgz", - "_shasum": "79c1033b80515bd6d24ec9933e860ca75ee27f0c", - "_spec": "make-dir@^1.0.0", - "_where": "/Users/rebecca/code/npm/node_modules/configstore", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "bugs": { - "url": "https://github.com/sindresorhus/make-dir/issues" - }, - "bundleDependencies": false, - "dependencies": { - "pify": "^3.0.0" - }, - "deprecated": false, - "description": "Make a directory and its parents if needed - Think `mkdir -p`", - "devDependencies": { - "ava": "*", - "codecov": "^3.0.0", - "graceful-fs": "^4.1.11", - "nyc": "^11.3.0", - "path-type": "^3.0.0", - "tempy": "^0.2.1", - "xo": "^0.20.0" - }, - "engines": { - "node": ">=4" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/sindresorhus/make-dir#readme", - "keywords": [ - "mkdir", - "mkdirp", - "make", - "directories", - "dir", - "dirs", - "folders", - "directory", - "folder", - "path", - "parent", - "parents", - "intermediate", - "recursively", - "recursive", - "create", - "fs", - "filesystem", - "file-system" - ], - "license": "MIT", - "name": "make-dir", - "repository": { - "type": "git", - "url": "git+https://github.com/sindresorhus/make-dir.git" - }, - "scripts": { - "test": "xo && nyc ava" - }, - "version": "1.3.0" -} diff --git a/deps/npm/node_modules/make-dir/readme.md b/deps/npm/node_modules/make-dir/readme.md deleted file mode 100644 index 8a32bf4714ceca..00000000000000 --- a/deps/npm/node_modules/make-dir/readme.md +++ /dev/null @@ -1,116 +0,0 @@ -# make-dir [![Build Status: macOS & Linux](https://travis-ci.org/sindresorhus/make-dir.svg?branch=master)](https://travis-ci.org/sindresorhus/make-dir) [![Build status: Windows](https://ci.appveyor.com/api/projects/status/e0vtt8y600w91gcs/branch/master?svg=true)](https://ci.appveyor.com/project/sindresorhus/make-dir/branch/master) [![codecov](https://codecov.io/gh/sindresorhus/make-dir/branch/master/graph/badge.svg)](https://codecov.io/gh/sindresorhus/make-dir) - -> Make a directory and its parents if needed - Think `mkdir -p` - - -## Advantages over [`mkdirp`](https://github.com/substack/node-mkdirp) - -- Promise API *(Async/await ready!)* -- Fixes many `mkdirp` issues: [#96](https://github.com/substack/node-mkdirp/pull/96) [#70](https://github.com/substack/node-mkdirp/issues/70) [#66](https://github.com/substack/node-mkdirp/issues/66) -- 100% test coverage -- CI-tested on macOS, Linux, and Windows -- Actively maintained -- Doesn't bundle a CLI - - -## Install - -``` -$ npm install make-dir -``` - - -## Usage - -``` -$ pwd -/Users/sindresorhus/fun -$ tree -. -``` - -```js -const makeDir = require('make-dir'); - -makeDir('unicorn/rainbow/cake').then(path => { - console.log(path); - //=> '/Users/sindresorhus/fun/unicorn/rainbow/cake' -}); -``` - -``` -$ tree -. -└── unicorn - └── rainbow - └── cake -``` - -Multiple directories: - -```js -const makeDir = require('make-dir'); - -Promise.all([ - makeDir('unicorn/rainbow') - makeDir('foo/bar') -]).then(paths => { - console.log(paths); - /* - [ - '/Users/sindresorhus/fun/unicorn/rainbow', - '/Users/sindresorhus/fun/foo/bar' - ] - */ -}); -``` - - -## API - -### makeDir(path, [options]) - -Returns a `Promise` for the path to the created directory. - -### makeDir.sync(path, [options]) - -Returns the path to the created directory. - -#### path - -Type: `string` - -Directory to create. - -#### options - -Type: `Object` - -##### mode - -Type: `integer`
    -Default: `0o777 & (~process.umask())` - -Directory [permissions](https://x-team.com/blog/file-system-permissions-umask-node-js/). - -##### fs - -Type: `Object`
    -Default: `require('fs')` - -Use a custom `fs` implementation. For example [`graceful-fs`](https://github.com/isaacs/node-graceful-fs). - - -## Related - -- [make-dir-cli](https://github.com/sindresorhus/make-dir-cli) - CLI for this module -- [del](https://github.com/sindresorhus/del) - Delete files and directories -- [globby](https://github.com/sindresorhus/globby) - User-friendly glob matching -- [cpy](https://github.com/sindresorhus/cpy) - Copy files -- [cpy-cli](https://github.com/sindresorhus/cpy-cli) - Copy files on the command-line -- [move-file](https://github.com/sindresorhus/move-file) - Move a file - - -## License - -MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/deps/npm/node_modules/make-fetch-happen/CHANGELOG.md b/deps/npm/node_modules/make-fetch-happen/CHANGELOG.md index c73bd4de4fafce..324dfc1058d934 100644 --- a/deps/npm/node_modules/make-fetch-happen/CHANGELOG.md +++ b/deps/npm/node_modules/make-fetch-happen/CHANGELOG.md @@ -1,30 +1,97 @@ -# Change Log +# 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. - -## [5.0.2](https://github.com/zkat/make-fetch-happen/compare/v5.0.1...v5.0.2) (2019-11-14) +### [8.0.3](https://github.com/npm/make-fetch-happen/compare/v8.0.2...v8.0.3) (2020-03-03) ### Bug Fixes -* **streams:** only provide a size and not a boolean to highWaterMark & update travis environments ([a367a14](https://github.com/zkat/make-fetch-happen/commit/a367a14)) -* `highWaterMark` bug @ v5 ([#10](https://github.com/zkat/make-fetch-happen/issues/10)) ([4e4f4e0](https://github.com/zkat/make-fetch-happen/commit/4e4f4e0)) +* remoteFetch takes instance of fetch.Headers ([6e0de7b](https://github.com/npm/make-fetch-happen/commit/6e0de7b10b8597eaff69fea06a266914766cf5ab)), closes [#22](https://github.com/npm/make-fetch-happen/issues/22) +### [8.0.1](https://github.com/npm/make-fetch-happen/compare/v8.0.0...v8.0.1) (2020-02-18) +## [8.0.0](https://github.com/npm/make-fetch-happen/compare/v7.1.1...v8.0.0) (2020-02-18) - -## [5.0.1](https://github.com/zkat/make-fetch-happen/compare/v5.0.0...v5.0.1) (2019-10-23) +### ⚠ BREAKING CHANGES +* this module now only supports taking a plain JavaScript +options object, not a figgy pudding config object. + +* update cacache and ssri ([09e4f97](https://github.com/npm/make-fetch-happen/commit/09e4f9794a6f134d3f1d8e65eb9bd940e38e5bfc)) + +### [7.1.1](https://github.com/npm/make-fetch-happen/compare/v7.1.0...v7.1.1) (2020-01-28) + +## [7.1.0](https://github.com/npm/make-fetch-happen/compare/v7.0.0...v7.1.0) (2019-12-17) + + +### Features + +* use globalAgent when in lambda ([bd9409d](https://github.com/npm/make-fetch-happen/commit/bd9409da246a979b665ebd23967ec01dd928ce47)), closes [#4](https://github.com/npm/make-fetch-happen/issues/4) + +## [7.0.0](https://github.com/npm/make-fetch-happen/compare/v6.1.0...v7.0.0) (2019-12-17) + + +### ⚠ BREAKING CHANGES + +* drops support for node v8, since it's EOL as of 2020-01-01 + +### Features + +* **github:** added github actions with coveralls integration ([1913c1b](https://github.com/npm/make-fetch-happen/commit/1913c1b51aaac6044b4dab65b3d19ec943a35f39)) +* updated fetch module; linting mostly; based on testing ([063f28e](https://github.com/npm/make-fetch-happen/commit/063f28ea1ac23f7e9d9d79e15949ca82b634ce97)) +* **utils:** fixed configure-options based on testing ([9dd4f6f](https://github.com/npm/make-fetch-happen/commit/9dd4f6f108442dc247de44e1ddc0341edcb84c9b)) +* fixed test dep requires; added mockRequire function to mock tests properly ([95de7a1](https://github.com/npm/make-fetch-happen/commit/95de7a171110907e30f41f489e4be983cd8184a5)) +* refactored functions into utilities ([74620dd](https://github.com/npm/make-fetch-happen/commit/74620dd7c2262ac46d9b4f6ac2dc9ff45a4f19ee)) +* updated dev deps; update tap; updated standard ([dce6eec](https://github.com/npm/make-fetch-happen/commit/dce6eece130fb20164a62eeabc6090811d8f14a4)) +* updated fetch tests; linting, logic, added tests ([d50aeaf](https://github.com/npm/make-fetch-happen/commit/d50aeafebeb5d8f7118d7f6660208f40ac487804)) + + +### Bug Fixes + +* format cache key with new URL object shape ([21cb6cc](https://github.com/npm/make-fetch-happen/commit/21cb6cc968aabff8b5c5c02e3666fb093fd6578c)) +* polish out an unnecessary URL object creation ([67a01d4](https://github.com/npm/make-fetch-happen/commit/67a01d46b2cacbadc22f49604ee524526cee3912)), closes [#14](https://github.com/npm/make-fetch-happen/issues/14) +* support user without password in proxy auth ([e24bbf9](https://github.com/npm/make-fetch-happen/commit/e24bbf935bc8a2c49070cdb2518e5ee290143191)) +* updated 'files' property in package file ([945e40c](https://github.com/npm/make-fetch-happen/commit/945e40c7fbb59333e0c632c490683e4babc68dc1)) +* Use WhatWG URL objects over deprecated legacy url API ([28aca97](https://github.com/npm/make-fetch-happen/commit/28aca97dfb63ca003ebf62d1b961771cfbb2481d)) + + +* drop node 8 ([9fa7944](https://github.com/npm/make-fetch-happen/commit/9fa7944cbc603f3a194dfb440f519a7d5265653e)) + +## [6.1.0](https://github.com/npm/make-fetch-happen/compare/v6.0.1...v6.1.0) (2019-11-14) + + +### Bug Fixes + +* **streams:** change condition/logic of fitInMemory used when defining memoize ([c173723](https://github.com/npm/make-fetch-happen/commit/c173723)) + +### [6.0.1](https://github.com/npm/make-fetch-happen/compare/v6.0.0...v6.0.1) (2019-10-23) + + +# [6.0.0](https://github.com/npm/make-fetch-happen/compare/v5.0.0...v6.0.0) (2019-10-01) + +### Bug Fixes + +* preserve rfc7234 5.5.4 warnings ([001b91e](https://github.com/npm/make-fetch-happen/commit/001b91e)) +* properly detect thrown HTTP "error" objects ([d7cbeb4](https://github.com/npm/make-fetch-happen/commit/d7cbeb4)) +* safely create synthetic response body for 304 ([bc70f88](https://github.com/npm/make-fetch-happen/commit/bc70f88)) + +### Features + +* **promises:** refactor bluebird with native promises ([7482d54](https://github.com/npm/make-fetch-happen/commit/7482d54)) + +### BREAKING CHANGES + +* **streams:** refactor node streams with minipass ([1d7f5a3](https://github.com/npm/make-fetch-happen/commit/1d7f5a3)) -# [5.0.0](https://github.com/zkat/make-fetch-happen/compare/v4.0.2...v5.0.0) (2019-07-15) +# [5.0.0](https://github.com/npm/make-fetch-happen/compare/v4.0.2...v5.0.0) (2019-07-15) ### Features -* cacache@12, no need for uid/gid opts ([fdb956f](https://github.com/zkat/make-fetch-happen/commit/fdb956f)) +* cacache@12, no need for uid/gid opts ([fdb956f](https://github.com/npm/make-fetch-happen/commit/fdb956f)) ### BREAKING CHANGES @@ -35,27 +102,27 @@ not passed in as options. -## [4.0.2](https://github.com/zkat/make-fetch-happen/compare/v4.0.1...v4.0.2) (2019-07-02) +## [4.0.2](https://github.com/npm/make-fetch-happen/compare/v4.0.1...v4.0.2) (2019-07-02) -## [4.0.1](https://github.com/zkat/make-fetch-happen/compare/v4.0.0...v4.0.1) (2018-04-12) +## [4.0.1](https://github.com/npm/make-fetch-happen/compare/v4.0.0...v4.0.1) (2018-04-12) ### Bug Fixes -* **integrity:** use new sri.match() for verification ([4f371a0](https://github.com/zkat/make-fetch-happen/commit/4f371a0)) +* **integrity:** use new sri.match() for verification ([4f371a0](https://github.com/npm/make-fetch-happen/commit/4f371a0)) -# [4.0.0](https://github.com/zkat/make-fetch-happen/compare/v3.0.0...v4.0.0) (2018-04-09) +# [4.0.0](https://github.com/npm/make-fetch-happen/compare/v3.0.0...v4.0.0) (2018-04-09) ### meta -* drop node@4, add node@9 ([7b0191a](https://github.com/zkat/make-fetch-happen/commit/7b0191a)) +* drop node@4, add node@9 ([7b0191a](https://github.com/npm/make-fetch-happen/commit/7b0191a)) ### BREAKING CHANGES @@ -65,13 +132,13 @@ not passed in as options. -# [3.0.0](https://github.com/zkat/make-fetch-happen/compare/v2.6.0...v3.0.0) (2018-03-12) +# [3.0.0](https://github.com/npm/make-fetch-happen/compare/v2.6.0...v3.0.0) (2018-03-12) ### Bug Fixes -* **license:** switch to ISC ([#49](https://github.com/zkat/make-fetch-happen/issues/49)) ([bf90c6d](https://github.com/zkat/make-fetch-happen/commit/bf90c6d)) -* **standard:** standard@11 update ([ff0aa70](https://github.com/zkat/make-fetch-happen/commit/ff0aa70)) +* **license:** switch to ISC ([#49](https://github.com/npm/make-fetch-happen/issues/49)) ([bf90c6d](https://github.com/npm/make-fetch-happen/commit/bf90c6d)) +* **standard:** standard@11 update ([ff0aa70](https://github.com/npm/make-fetch-happen/commit/ff0aa70)) ### BREAKING CHANGES @@ -81,336 +148,336 @@ not passed in as options. -# [2.6.0](https://github.com/zkat/make-fetch-happen/compare/v2.5.0...v2.6.0) (2017-11-14) +# [2.6.0](https://github.com/npm/make-fetch-happen/compare/v2.5.0...v2.6.0) (2017-11-14) ### Bug Fixes -* **integrity:** disable node-fetch compress when checking integrity (#42) ([a7cc74c](https://github.com/zkat/make-fetch-happen/commit/a7cc74c)) +* **integrity:** disable node-fetch compress when checking integrity (#42) ([a7cc74c](https://github.com/npm/make-fetch-happen/commit/a7cc74c)) ### Features -* **onretry:** Add `options.onRetry` (#48) ([f90ccff](https://github.com/zkat/make-fetch-happen/commit/f90ccff)) +* **onretry:** Add `options.onRetry` (#48) ([f90ccff](https://github.com/npm/make-fetch-happen/commit/f90ccff)) -# [2.5.0](https://github.com/zkat/make-fetch-happen/compare/v2.4.13...v2.5.0) (2017-08-24) +# [2.5.0](https://github.com/npm/make-fetch-happen/compare/v2.4.13...v2.5.0) (2017-08-24) ### Bug Fixes -* **agent:** support timeout durations greater than 30 seconds ([04875ae](https://github.com/zkat/make-fetch-happen/commit/04875ae)), closes [#35](https://github.com/zkat/make-fetch-happen/issues/35) +* **agent:** support timeout durations greater than 30 seconds ([04875ae](https://github.com/npm/make-fetch-happen/commit/04875ae)), closes [#35](https://github.com/npm/make-fetch-happen/issues/35) ### Features -* **cache:** export cache deletion functionality (#40) ([3da4250](https://github.com/zkat/make-fetch-happen/commit/3da4250)) +* **cache:** export cache deletion functionality (#40) ([3da4250](https://github.com/npm/make-fetch-happen/commit/3da4250)) -## [2.4.13](https://github.com/zkat/make-fetch-happen/compare/v2.4.12...v2.4.13) (2017-06-29) +## [2.4.13](https://github.com/npm/make-fetch-happen/compare/v2.4.12...v2.4.13) (2017-06-29) ### Bug Fixes -* **deps:** bump other deps for bugfixes ([eab8297](https://github.com/zkat/make-fetch-happen/commit/eab8297)) -* **proxy:** bump proxy deps with bugfixes (#32) ([632f860](https://github.com/zkat/make-fetch-happen/commit/632f860)), closes [#32](https://github.com/zkat/make-fetch-happen/issues/32) +* **deps:** bump other deps for bugfixes ([eab8297](https://github.com/npm/make-fetch-happen/commit/eab8297)) +* **proxy:** bump proxy deps with bugfixes (#32) ([632f860](https://github.com/npm/make-fetch-happen/commit/632f860)), closes [#32](https://github.com/npm/make-fetch-happen/issues/32) -## [2.4.12](https://github.com/zkat/make-fetch-happen/compare/v2.4.11...v2.4.12) (2017-06-06) +## [2.4.12](https://github.com/npm/make-fetch-happen/compare/v2.4.11...v2.4.12) (2017-06-06) ### Bug Fixes -* **cache:** encode x-local-cache-etc headers to be header-safe ([dc9fb1b](https://github.com/zkat/make-fetch-happen/commit/dc9fb1b)) +* **cache:** encode x-local-cache-etc headers to be header-safe ([dc9fb1b](https://github.com/npm/make-fetch-happen/commit/dc9fb1b)) -## [2.4.11](https://github.com/zkat/make-fetch-happen/compare/v2.4.10...v2.4.11) (2017-06-05) +## [2.4.11](https://github.com/npm/make-fetch-happen/compare/v2.4.10...v2.4.11) (2017-06-05) ### Bug Fixes -* **deps:** bump deps with ssri fix ([bef1994](https://github.com/zkat/make-fetch-happen/commit/bef1994)) +* **deps:** bump deps with ssri fix ([bef1994](https://github.com/npm/make-fetch-happen/commit/bef1994)) -## [2.4.10](https://github.com/zkat/make-fetch-happen/compare/v2.4.9...v2.4.10) (2017-05-31) +## [2.4.10](https://github.com/npm/make-fetch-happen/compare/v2.4.9...v2.4.10) (2017-05-31) ### Bug Fixes -* **deps:** bump dep versions with bugfixes ([0af4003](https://github.com/zkat/make-fetch-happen/commit/0af4003)) -* **proxy:** use auth parameter for proxy authentication (#30) ([c687306](https://github.com/zkat/make-fetch-happen/commit/c687306)) +* **deps:** bump dep versions with bugfixes ([0af4003](https://github.com/npm/make-fetch-happen/commit/0af4003)) +* **proxy:** use auth parameter for proxy authentication (#30) ([c687306](https://github.com/npm/make-fetch-happen/commit/c687306)) -## [2.4.9](https://github.com/zkat/make-fetch-happen/compare/v2.4.8...v2.4.9) (2017-05-25) +## [2.4.9](https://github.com/npm/make-fetch-happen/compare/v2.4.8...v2.4.9) (2017-05-25) ### Bug Fixes -* **cache:** use the passed-in promise for resolving cache stuff ([4c46257](https://github.com/zkat/make-fetch-happen/commit/4c46257)) +* **cache:** use the passed-in promise for resolving cache stuff ([4c46257](https://github.com/npm/make-fetch-happen/commit/4c46257)) -## [2.4.8](https://github.com/zkat/make-fetch-happen/compare/v2.4.7...v2.4.8) (2017-05-25) +## [2.4.8](https://github.com/npm/make-fetch-happen/compare/v2.4.7...v2.4.8) (2017-05-25) ### Bug Fixes -* **cache:** pass uid/gid/Promise through to cache ([a847c92](https://github.com/zkat/make-fetch-happen/commit/a847c92)) +* **cache:** pass uid/gid/Promise through to cache ([a847c92](https://github.com/npm/make-fetch-happen/commit/a847c92)) -## [2.4.7](https://github.com/zkat/make-fetch-happen/compare/v2.4.6...v2.4.7) (2017-05-24) +## [2.4.7](https://github.com/npm/make-fetch-happen/compare/v2.4.6...v2.4.7) (2017-05-24) ### Bug Fixes -* **deps:** pull in various fixes from deps ([fc2a587](https://github.com/zkat/make-fetch-happen/commit/fc2a587)) +* **deps:** pull in various fixes from deps ([fc2a587](https://github.com/npm/make-fetch-happen/commit/fc2a587)) -## [2.4.6](https://github.com/zkat/make-fetch-happen/compare/v2.4.5...v2.4.6) (2017-05-24) +## [2.4.6](https://github.com/npm/make-fetch-happen/compare/v2.4.5...v2.4.6) (2017-05-24) ### Bug Fixes -* **proxy:** choose agent for http(s)-proxy by protocol of destUrl ([ea4832a](https://github.com/zkat/make-fetch-happen/commit/ea4832a)) -* **proxy:** make socks proxy working ([1de810a](https://github.com/zkat/make-fetch-happen/commit/1de810a)) -* **proxy:** revert previous proxy solution ([563b0d8](https://github.com/zkat/make-fetch-happen/commit/563b0d8)) +* **proxy:** choose agent for http(s)-proxy by protocol of destUrl ([ea4832a](https://github.com/npm/make-fetch-happen/commit/ea4832a)) +* **proxy:** make socks proxy working ([1de810a](https://github.com/npm/make-fetch-happen/commit/1de810a)) +* **proxy:** revert previous proxy solution ([563b0d8](https://github.com/npm/make-fetch-happen/commit/563b0d8)) -## [2.4.5](https://github.com/zkat/make-fetch-happen/compare/v2.4.4...v2.4.5) (2017-05-24) +## [2.4.5](https://github.com/npm/make-fetch-happen/compare/v2.4.4...v2.4.5) (2017-05-24) ### Bug Fixes -* **proxy:** use the destination url when determining agent ([1a714e7](https://github.com/zkat/make-fetch-happen/commit/1a714e7)) +* **proxy:** use the destination url when determining agent ([1a714e7](https://github.com/npm/make-fetch-happen/commit/1a714e7)) -## [2.4.4](https://github.com/zkat/make-fetch-happen/compare/v2.4.3...v2.4.4) (2017-05-23) +## [2.4.4](https://github.com/npm/make-fetch-happen/compare/v2.4.3...v2.4.4) (2017-05-23) ### Bug Fixes -* **redirect:** handle redirects explicitly (#27) ([4c4af54](https://github.com/zkat/make-fetch-happen/commit/4c4af54)) +* **redirect:** handle redirects explicitly (#27) ([4c4af54](https://github.com/npm/make-fetch-happen/commit/4c4af54)) -## [2.4.3](https://github.com/zkat/make-fetch-happen/compare/v2.4.2...v2.4.3) (2017-05-06) +## [2.4.3](https://github.com/npm/make-fetch-happen/compare/v2.4.2...v2.4.3) (2017-05-06) ### Bug Fixes -* **redirect:** redirects now delete authorization if hosts fail to match ([c071805](https://github.com/zkat/make-fetch-happen/commit/c071805)) +* **redirect:** redirects now delete authorization if hosts fail to match ([c071805](https://github.com/npm/make-fetch-happen/commit/c071805)) -## [2.4.2](https://github.com/zkat/make-fetch-happen/compare/v2.4.1...v2.4.2) (2017-05-04) +## [2.4.2](https://github.com/npm/make-fetch-happen/compare/v2.4.1...v2.4.2) (2017-05-04) ### Bug Fixes -* **cache:** reduce race condition window by checking for content ([24544b1](https://github.com/zkat/make-fetch-happen/commit/24544b1)) -* **match:** Rewrite the conditional stream logic (#25) ([66bba4b](https://github.com/zkat/make-fetch-happen/commit/66bba4b)) +* **cache:** reduce race condition window by checking for content ([24544b1](https://github.com/npm/make-fetch-happen/commit/24544b1)) +* **match:** Rewrite the conditional stream logic (#25) ([66bba4b](https://github.com/npm/make-fetch-happen/commit/66bba4b)) -## [2.4.1](https://github.com/zkat/make-fetch-happen/compare/v2.4.0...v2.4.1) (2017-04-28) +## [2.4.1](https://github.com/npm/make-fetch-happen/compare/v2.4.0...v2.4.1) (2017-04-28) ### Bug Fixes -* **memoization:** missed spots + allow passthrough of memo objs ([ac0cd12](https://github.com/zkat/make-fetch-happen/commit/ac0cd12)) +* **memoization:** missed spots + allow passthrough of memo objs ([ac0cd12](https://github.com/npm/make-fetch-happen/commit/ac0cd12)) -# [2.4.0](https://github.com/zkat/make-fetch-happen/compare/v2.3.0...v2.4.0) (2017-04-28) +# [2.4.0](https://github.com/npm/make-fetch-happen/compare/v2.3.0...v2.4.0) (2017-04-28) ### Bug Fixes -* **memoize:** cacache had a broken memoizer ([8a9ed4c](https://github.com/zkat/make-fetch-happen/commit/8a9ed4c)) +* **memoize:** cacache had a broken memoizer ([8a9ed4c](https://github.com/npm/make-fetch-happen/commit/8a9ed4c)) ### Features -* **memoization:** only slurp stuff into memory if opts.memoize is not false ([0744adc](https://github.com/zkat/make-fetch-happen/commit/0744adc)) +* **memoization:** only slurp stuff into memory if opts.memoize is not false ([0744adc](https://github.com/npm/make-fetch-happen/commit/0744adc)) -# [2.3.0](https://github.com/zkat/make-fetch-happen/compare/v2.2.6...v2.3.0) (2017-04-27) +# [2.3.0](https://github.com/npm/make-fetch-happen/compare/v2.2.6...v2.3.0) (2017-04-27) ### Features -* **agent:** added opts.strictSSL and opts.localAddress ([c35015a](https://github.com/zkat/make-fetch-happen/commit/c35015a)) -* **proxy:** Added opts.noProxy and NO_PROXY support ([f45c915](https://github.com/zkat/make-fetch-happen/commit/f45c915)) +* **agent:** added opts.strictSSL and opts.localAddress ([c35015a](https://github.com/npm/make-fetch-happen/commit/c35015a)) +* **proxy:** Added opts.noProxy and NO_PROXY support ([f45c915](https://github.com/npm/make-fetch-happen/commit/f45c915)) -## [2.2.6](https://github.com/zkat/make-fetch-happen/compare/v2.2.5...v2.2.6) (2017-04-26) +## [2.2.6](https://github.com/npm/make-fetch-happen/compare/v2.2.5...v2.2.6) (2017-04-26) ### Bug Fixes -* **agent:** check uppercase & lowercase proxy env (#24) ([acf2326](https://github.com/zkat/make-fetch-happen/commit/acf2326)), closes [#22](https://github.com/zkat/make-fetch-happen/issues/22) -* **deps:** switch to node-fetch-npm and stop bundling ([3db603b](https://github.com/zkat/make-fetch-happen/commit/3db603b)) +* **agent:** check uppercase & lowercase proxy env (#24) ([acf2326](https://github.com/npm/make-fetch-happen/commit/acf2326)), closes [#22](https://github.com/npm/make-fetch-happen/issues/22) +* **deps:** switch to node-fetch-npm and stop bundling ([3db603b](https://github.com/npm/make-fetch-happen/commit/3db603b)) -## [2.2.5](https://github.com/zkat/make-fetch-happen/compare/v2.2.4...v2.2.5) (2017-04-23) +## [2.2.5](https://github.com/npm/make-fetch-happen/compare/v2.2.4...v2.2.5) (2017-04-23) ### Bug Fixes -* **deps:** bump cacache and use its size feature ([926c1d3](https://github.com/zkat/make-fetch-happen/commit/926c1d3)) +* **deps:** bump cacache and use its size feature ([926c1d3](https://github.com/npm/make-fetch-happen/commit/926c1d3)) -## [2.2.4](https://github.com/zkat/make-fetch-happen/compare/v2.2.3...v2.2.4) (2017-04-18) +## [2.2.4](https://github.com/npm/make-fetch-happen/compare/v2.2.3...v2.2.4) (2017-04-18) ### Bug Fixes -* **integrity:** hash verification issues fixed ([07f9402](https://github.com/zkat/make-fetch-happen/commit/07f9402)) +* **integrity:** hash verification issues fixed ([07f9402](https://github.com/npm/make-fetch-happen/commit/07f9402)) -## [2.2.3](https://github.com/zkat/make-fetch-happen/compare/v2.2.2...v2.2.3) (2017-04-18) +## [2.2.3](https://github.com/npm/make-fetch-happen/compare/v2.2.2...v2.2.3) (2017-04-18) ### Bug Fixes -* **staleness:** responses older than 8h were never stale :< ([b54dd75](https://github.com/zkat/make-fetch-happen/commit/b54dd75)) -* **warning:** remove spurious warning, make format more spec-compliant ([2e4f6bb](https://github.com/zkat/make-fetch-happen/commit/2e4f6bb)) +* **staleness:** responses older than 8h were never stale :< ([b54dd75](https://github.com/npm/make-fetch-happen/commit/b54dd75)) +* **warning:** remove spurious warning, make format more spec-compliant ([2e4f6bb](https://github.com/npm/make-fetch-happen/commit/2e4f6bb)) -## [2.2.2](https://github.com/zkat/make-fetch-happen/compare/v2.2.1...v2.2.2) (2017-04-12) +## [2.2.2](https://github.com/npm/make-fetch-happen/compare/v2.2.1...v2.2.2) (2017-04-12) ### Bug Fixes -* **retry:** stop retrying 404s ([6fafd53](https://github.com/zkat/make-fetch-happen/commit/6fafd53)) +* **retry:** stop retrying 404s ([6fafd53](https://github.com/npm/make-fetch-happen/commit/6fafd53)) -## [2.2.1](https://github.com/zkat/make-fetch-happen/compare/v2.2.0...v2.2.1) (2017-04-10) +## [2.2.1](https://github.com/npm/make-fetch-happen/compare/v2.2.0...v2.2.1) (2017-04-10) ### Bug Fixes -* **deps:** move test-only deps to devDeps ([2daaf80](https://github.com/zkat/make-fetch-happen/commit/2daaf80)) +* **deps:** move test-only deps to devDeps ([2daaf80](https://github.com/npm/make-fetch-happen/commit/2daaf80)) -# [2.2.0](https://github.com/zkat/make-fetch-happen/compare/v2.1.0...v2.2.0) (2017-04-09) +# [2.2.0](https://github.com/npm/make-fetch-happen/compare/v2.1.0...v2.2.0) (2017-04-09) ### Bug Fixes -* **cache:** treat caches as private ([57b7dc2](https://github.com/zkat/make-fetch-happen/commit/57b7dc2)) +* **cache:** treat caches as private ([57b7dc2](https://github.com/npm/make-fetch-happen/commit/57b7dc2)) ### Features -* **retry:** accept shorthand retry settings ([dfed69d](https://github.com/zkat/make-fetch-happen/commit/dfed69d)) +* **retry:** accept shorthand retry settings ([dfed69d](https://github.com/npm/make-fetch-happen/commit/dfed69d)) -# [2.1.0](https://github.com/zkat/make-fetch-happen/compare/v2.0.4...v2.1.0) (2017-04-09) +# [2.1.0](https://github.com/npm/make-fetch-happen/compare/v2.0.4...v2.1.0) (2017-04-09) ### Features -* **cache:** cache now obeys Age and a variety of other things (#13) ([7b9652d](https://github.com/zkat/make-fetch-happen/commit/7b9652d)) +* **cache:** cache now obeys Age and a variety of other things (#13) ([7b9652d](https://github.com/npm/make-fetch-happen/commit/7b9652d)) -## [2.0.4](https://github.com/zkat/make-fetch-happen/compare/v2.0.3...v2.0.4) (2017-04-09) +## [2.0.4](https://github.com/npm/make-fetch-happen/compare/v2.0.3...v2.0.4) (2017-04-09) ### Bug Fixes -* **agent:** accept Request as fetch input, not just strings ([b71669a](https://github.com/zkat/make-fetch-happen/commit/b71669a)) +* **agent:** accept Request as fetch input, not just strings ([b71669a](https://github.com/npm/make-fetch-happen/commit/b71669a)) -## [2.0.3](https://github.com/zkat/make-fetch-happen/compare/v2.0.2...v2.0.3) (2017-04-09) +## [2.0.3](https://github.com/npm/make-fetch-happen/compare/v2.0.2...v2.0.3) (2017-04-09) ### Bug Fixes -* **deps:** seriously ([c29e7e7](https://github.com/zkat/make-fetch-happen/commit/c29e7e7)) +* **deps:** seriously ([c29e7e7](https://github.com/npm/make-fetch-happen/commit/c29e7e7)) -## [2.0.2](https://github.com/zkat/make-fetch-happen/compare/v2.0.1...v2.0.2) (2017-04-09) +## [2.0.2](https://github.com/npm/make-fetch-happen/compare/v2.0.1...v2.0.2) (2017-04-09) ### Bug Fixes -* **deps:** use bundleDeps instead ([c36ebf0](https://github.com/zkat/make-fetch-happen/commit/c36ebf0)) +* **deps:** use bundleDeps instead ([c36ebf0](https://github.com/npm/make-fetch-happen/commit/c36ebf0)) -## [2.0.1](https://github.com/zkat/make-fetch-happen/compare/v2.0.0...v2.0.1) (2017-04-09) +## [2.0.1](https://github.com/npm/make-fetch-happen/compare/v2.0.0...v2.0.1) (2017-04-09) ### Bug Fixes -* **deps:** make sure node-fetch tarball included in release ([3bf49d1](https://github.com/zkat/make-fetch-happen/commit/3bf49d1)) +* **deps:** make sure node-fetch tarball included in release ([3bf49d1](https://github.com/npm/make-fetch-happen/commit/3bf49d1)) -# [2.0.0](https://github.com/zkat/make-fetch-happen/compare/v1.7.0...v2.0.0) (2017-04-09) +# [2.0.0](https://github.com/npm/make-fetch-happen/compare/v1.7.0...v2.0.0) (2017-04-09) ### Bug Fixes -* **deps:** manually pull in newer node-fetch to avoid babel prod dep ([66e5e87](https://github.com/zkat/make-fetch-happen/commit/66e5e87)) -* **retry:** be more specific about when we retry ([a47b782](https://github.com/zkat/make-fetch-happen/commit/a47b782)) +* **deps:** manually pull in newer node-fetch to avoid babel prod dep ([66e5e87](https://github.com/npm/make-fetch-happen/commit/66e5e87)) +* **retry:** be more specific about when we retry ([a47b782](https://github.com/npm/make-fetch-happen/commit/a47b782)) ### Features -* **agent:** add ca/cert/key support to auto-agent (#15) ([57585a7](https://github.com/zkat/make-fetch-happen/commit/57585a7)) +* **agent:** add ca/cert/key support to auto-agent (#15) ([57585a7](https://github.com/npm/make-fetch-happen/commit/57585a7)) ### BREAKING CHANGES @@ -425,119 +492,119 @@ not passed in as options. -# [1.7.0](https://github.com/zkat/make-fetch-happen/compare/v1.6.0...v1.7.0) (2017-04-08) +# [1.7.0](https://github.com/npm/make-fetch-happen/compare/v1.6.0...v1.7.0) (2017-04-08) ### Features -* **cache:** add useful headers to inform users about cached data ([9bd7b00](https://github.com/zkat/make-fetch-happen/commit/9bd7b00)) +* **cache:** add useful headers to inform users about cached data ([9bd7b00](https://github.com/npm/make-fetch-happen/commit/9bd7b00)) -# [1.6.0](https://github.com/zkat/make-fetch-happen/compare/v1.5.1...v1.6.0) (2017-04-06) +# [1.6.0](https://github.com/npm/make-fetch-happen/compare/v1.5.1...v1.6.0) (2017-04-06) ### Features -* **agent:** better, keepalive-supporting, default http agents ([16277f6](https://github.com/zkat/make-fetch-happen/commit/16277f6)) +* **agent:** better, keepalive-supporting, default http agents ([16277f6](https://github.com/npm/make-fetch-happen/commit/16277f6)) -## [1.5.1](https://github.com/zkat/make-fetch-happen/compare/v1.5.0...v1.5.1) (2017-04-05) +## [1.5.1](https://github.com/npm/make-fetch-happen/compare/v1.5.0...v1.5.1) (2017-04-05) ### Bug Fixes -* **cache:** bump cacache for its fixed error messages ([2f2b916](https://github.com/zkat/make-fetch-happen/commit/2f2b916)) -* **cache:** fix handling of errors in cache reads ([5729222](https://github.com/zkat/make-fetch-happen/commit/5729222)) +* **cache:** bump cacache for its fixed error messages ([2f2b916](https://github.com/npm/make-fetch-happen/commit/2f2b916)) +* **cache:** fix handling of errors in cache reads ([5729222](https://github.com/npm/make-fetch-happen/commit/5729222)) -# [1.5.0](https://github.com/zkat/make-fetch-happen/compare/v1.4.0...v1.5.0) (2017-04-04) +# [1.5.0](https://github.com/npm/make-fetch-happen/compare/v1.4.0...v1.5.0) (2017-04-04) ### Features -* **retry:** retry requests on 408 timeouts, too ([8d8b5bd](https://github.com/zkat/make-fetch-happen/commit/8d8b5bd)) +* **retry:** retry requests on 408 timeouts, too ([8d8b5bd](https://github.com/npm/make-fetch-happen/commit/8d8b5bd)) -# [1.4.0](https://github.com/zkat/make-fetch-happen/compare/v1.3.1...v1.4.0) (2017-04-04) +# [1.4.0](https://github.com/npm/make-fetch-happen/compare/v1.3.1...v1.4.0) (2017-04-04) ### Bug Fixes -* **cache:** stop relying on BB.catch ([2b04494](https://github.com/zkat/make-fetch-happen/commit/2b04494)) +* **cache:** stop relying on BB.catch ([2b04494](https://github.com/npm/make-fetch-happen/commit/2b04494)) ### Features -* **retry:** report retry attempt number as extra header ([fd50927](https://github.com/zkat/make-fetch-happen/commit/fd50927)) +* **retry:** report retry attempt number as extra header ([fd50927](https://github.com/npm/make-fetch-happen/commit/fd50927)) -## [1.3.1](https://github.com/zkat/make-fetch-happen/compare/v1.3.0...v1.3.1) (2017-04-04) +## [1.3.1](https://github.com/npm/make-fetch-happen/compare/v1.3.0...v1.3.1) (2017-04-04) ### Bug Fixes -* **cache:** pretend cache entry is missing on ENOENT ([9c2bb26](https://github.com/zkat/make-fetch-happen/commit/9c2bb26)) +* **cache:** pretend cache entry is missing on ENOENT ([9c2bb26](https://github.com/npm/make-fetch-happen/commit/9c2bb26)) -# [1.3.0](https://github.com/zkat/make-fetch-happen/compare/v1.2.1...v1.3.0) (2017-04-04) +# [1.3.0](https://github.com/npm/make-fetch-happen/compare/v1.2.1...v1.3.0) (2017-04-04) ### Bug Fixes -* **cache:** if metadata is missing for some odd reason, ignore the entry ([a021a6b](https://github.com/zkat/make-fetch-happen/commit/a021a6b)) +* **cache:** if metadata is missing for some odd reason, ignore the entry ([a021a6b](https://github.com/npm/make-fetch-happen/commit/a021a6b)) ### Features -* **cache:** add special headers when request was loaded straight from cache ([8a7dbd1](https://github.com/zkat/make-fetch-happen/commit/8a7dbd1)) -* **cache:** allow configuring algorithms to be calculated on insertion ([bf4a0f2](https://github.com/zkat/make-fetch-happen/commit/bf4a0f2)) +* **cache:** add special headers when request was loaded straight from cache ([8a7dbd1](https://github.com/npm/make-fetch-happen/commit/8a7dbd1)) +* **cache:** allow configuring algorithms to be calculated on insertion ([bf4a0f2](https://github.com/npm/make-fetch-happen/commit/bf4a0f2)) -## [1.2.1](https://github.com/zkat/make-fetch-happen/compare/v1.2.0...v1.2.1) (2017-04-03) +## [1.2.1](https://github.com/npm/make-fetch-happen/compare/v1.2.0...v1.2.1) (2017-04-03) ### Bug Fixes -* **integrity:** update cacache and ssri and change EBADCHECKSUM -> EINTEGRITY ([b6cf6f6](https://github.com/zkat/make-fetch-happen/commit/b6cf6f6)) +* **integrity:** update cacache and ssri and change EBADCHECKSUM -> EINTEGRITY ([b6cf6f6](https://github.com/npm/make-fetch-happen/commit/b6cf6f6)) -# [1.2.0](https://github.com/zkat/make-fetch-happen/compare/v1.1.0...v1.2.0) (2017-04-03) +# [1.2.0](https://github.com/npm/make-fetch-happen/compare/v1.1.0...v1.2.0) (2017-04-03) ### Features -* **integrity:** full Subresource Integrity support (#10) ([a590159](https://github.com/zkat/make-fetch-happen/commit/a590159)) +* **integrity:** full Subresource Integrity support (#10) ([a590159](https://github.com/npm/make-fetch-happen/commit/a590159)) -# [1.1.0](https://github.com/zkat/make-fetch-happen/compare/v1.0.1...v1.1.0) (2017-04-01) +# [1.1.0](https://github.com/npm/make-fetch-happen/compare/v1.0.1...v1.1.0) (2017-04-01) ### Features -* **opts:** fetch.defaults() for default options ([522a65e](https://github.com/zkat/make-fetch-happen/commit/522a65e)) +* **opts:** fetch.defaults() for default options ([522a65e](https://github.com/npm/make-fetch-happen/commit/522a65e)) -## [1.0.1](https://github.com/zkat/make-fetch-happen/compare/v1.0.0...v1.0.1) (2017-04-01) +## [1.0.1](https://github.com/npm/make-fetch-happen/compare/v1.0.0...v1.0.1) (2017-04-01) @@ -547,37 +614,37 @@ not passed in as options. ### Bug Fixes -* **cache:** default on cache-control header ([b872a2c](https://github.com/zkat/make-fetch-happen/commit/b872a2c)) -* standard stuff and cache matching ([753f2c2](https://github.com/zkat/make-fetch-happen/commit/753f2c2)) -* **agent:** nudge around things with opts.agent ([ed62b57](https://github.com/zkat/make-fetch-happen/commit/ed62b57)) -* **agent:** {agent: false} has special behavior ([b8cc923](https://github.com/zkat/make-fetch-happen/commit/b8cc923)) -* **cache:** invalidation on non-GET ([fe78fac](https://github.com/zkat/make-fetch-happen/commit/fe78fac)) -* **cache:** make force-cache and only-if-cached work as expected ([f50e9df](https://github.com/zkat/make-fetch-happen/commit/f50e9df)) -* **cache:** more spec compliance ([d5a56db](https://github.com/zkat/make-fetch-happen/commit/d5a56db)) -* **cache:** only cache 200 gets ([0abb25a](https://github.com/zkat/make-fetch-happen/commit/0abb25a)) -* **cache:** only load cache code if cache opt is a string ([250fcd5](https://github.com/zkat/make-fetch-happen/commit/250fcd5)) -* **cache:** oops ([e3fa15a](https://github.com/zkat/make-fetch-happen/commit/e3fa15a)) -* **cache:** refactored warning removal into main file ([5b0a9f9](https://github.com/zkat/make-fetch-happen/commit/5b0a9f9)) -* **cache:** req constructor no longer needed in Cache ([5b74cbc](https://github.com/zkat/make-fetch-happen/commit/5b74cbc)) -* **cache:** standard fetch api calls cacheMode "cache" ([6fba805](https://github.com/zkat/make-fetch-happen/commit/6fba805)) -* **cache:** was using wrong method for non-GET/HEAD cache invalidation ([810763a](https://github.com/zkat/make-fetch-happen/commit/810763a)) -* **caching:** a bunch of cache-related fixes ([8ebda1d](https://github.com/zkat/make-fetch-happen/commit/8ebda1d)) -* **deps:** `cacache[@6](https://github.com/6).3.0` - race condition fixes ([9528442](https://github.com/zkat/make-fetch-happen/commit/9528442)) -* **freshness:** fix regex for cacheControl matching ([070db86](https://github.com/zkat/make-fetch-happen/commit/070db86)) -* **freshness:** fixed default freshness heuristic value ([5d29e88](https://github.com/zkat/make-fetch-happen/commit/5d29e88)) -* **logging:** remove console.log calls ([a1d0a47](https://github.com/zkat/make-fetch-happen/commit/a1d0a47)) -* **method:** node-fetch guarantees uppercase ([a1d68d6](https://github.com/zkat/make-fetch-happen/commit/a1d68d6)) -* **opts:** simplified opts handling ([516fd6e](https://github.com/zkat/make-fetch-happen/commit/516fd6e)) -* **proxy:** pass proxy option directly to ProxyAgent ([3398460](https://github.com/zkat/make-fetch-happen/commit/3398460)) -* **retry:** false -> {retries: 0} ([297fbb6](https://github.com/zkat/make-fetch-happen/commit/297fbb6)) -* **retry:** only retry put if body is not a stream ([a24e599](https://github.com/zkat/make-fetch-happen/commit/a24e599)) -* **retry:** skip retries if body is a stream for ANY method ([780c0f8](https://github.com/zkat/make-fetch-happen/commit/780c0f8)) +* **cache:** default on cache-control header ([b872a2c](https://github.com/npm/make-fetch-happen/commit/b872a2c)) +* standard stuff and cache matching ([753f2c2](https://github.com/npm/make-fetch-happen/commit/753f2c2)) +* **agent:** nudge around things with opts.agent ([ed62b57](https://github.com/npm/make-fetch-happen/commit/ed62b57)) +* **agent:** {agent: false} has special behavior ([b8cc923](https://github.com/npm/make-fetch-happen/commit/b8cc923)) +* **cache:** invalidation on non-GET ([fe78fac](https://github.com/npm/make-fetch-happen/commit/fe78fac)) +* **cache:** make force-cache and only-if-cached work as expected ([f50e9df](https://github.com/npm/make-fetch-happen/commit/f50e9df)) +* **cache:** more spec compliance ([d5a56db](https://github.com/npm/make-fetch-happen/commit/d5a56db)) +* **cache:** only cache 200 gets ([0abb25a](https://github.com/npm/make-fetch-happen/commit/0abb25a)) +* **cache:** only load cache code if cache opt is a string ([250fcd5](https://github.com/npm/make-fetch-happen/commit/250fcd5)) +* **cache:** oops ([e3fa15a](https://github.com/npm/make-fetch-happen/commit/e3fa15a)) +* **cache:** refactored warning removal into main file ([5b0a9f9](https://github.com/npm/make-fetch-happen/commit/5b0a9f9)) +* **cache:** req constructor no longer needed in Cache ([5b74cbc](https://github.com/npm/make-fetch-happen/commit/5b74cbc)) +* **cache:** standard fetch api calls cacheMode "cache" ([6fba805](https://github.com/npm/make-fetch-happen/commit/6fba805)) +* **cache:** was using wrong method for non-GET/HEAD cache invalidation ([810763a](https://github.com/npm/make-fetch-happen/commit/810763a)) +* **caching:** a bunch of cache-related fixes ([8ebda1d](https://github.com/npm/make-fetch-happen/commit/8ebda1d)) +* **deps:** `cacache[@6](https://github.com/6).3.0` - race condition fixes ([9528442](https://github.com/npm/make-fetch-happen/commit/9528442)) +* **freshness:** fix regex for cacheControl matching ([070db86](https://github.com/npm/make-fetch-happen/commit/070db86)) +* **freshness:** fixed default freshness heuristic value ([5d29e88](https://github.com/npm/make-fetch-happen/commit/5d29e88)) +* **logging:** remove console.log calls ([a1d0a47](https://github.com/npm/make-fetch-happen/commit/a1d0a47)) +* **method:** node-fetch guarantees uppercase ([a1d68d6](https://github.com/npm/make-fetch-happen/commit/a1d68d6)) +* **opts:** simplified opts handling ([516fd6e](https://github.com/npm/make-fetch-happen/commit/516fd6e)) +* **proxy:** pass proxy option directly to ProxyAgent ([3398460](https://github.com/npm/make-fetch-happen/commit/3398460)) +* **retry:** false -> {retries: 0} ([297fbb6](https://github.com/npm/make-fetch-happen/commit/297fbb6)) +* **retry:** only retry put if body is not a stream ([a24e599](https://github.com/npm/make-fetch-happen/commit/a24e599)) +* **retry:** skip retries if body is a stream for ANY method ([780c0f8](https://github.com/npm/make-fetch-happen/commit/780c0f8)) ### Features -* **api:** initial implementation -- can make and cache requests ([7d55b49](https://github.com/zkat/make-fetch-happen/commit/7d55b49)) -* **fetch:** injectable cache, and retry support ([87b84bf](https://github.com/zkat/make-fetch-happen/commit/87b84bf)) +* **api:** initial implementation -- can make and cache requests ([7d55b49](https://github.com/npm/make-fetch-happen/commit/7d55b49)) +* **fetch:** injectable cache, and retry support ([87b84bf](https://github.com/npm/make-fetch-happen/commit/87b84bf)) ### BREAKING CHANGES diff --git a/deps/npm/node_modules/make-fetch-happen/README.md b/deps/npm/node_modules/make-fetch-happen/README.md index 4d12d8dae7e31b..f454469e68508c 100644 --- a/deps/npm/node_modules/make-fetch-happen/README.md +++ b/deps/npm/node_modules/make-fetch-happen/README.md @@ -1,9 +1,9 @@ -# make-fetch-happen [![npm version](https://img.shields.io/npm/v/make-fetch-happen.svg)](https://npm.im/make-fetch-happen) [![license](https://img.shields.io/npm/l/make-fetch-happen.svg)](https://npm.im/make-fetch-happen) [![Travis](https://img.shields.io/travis/zkat/make-fetch-happen.svg)](https://travis-ci.org/zkat/make-fetch-happen) [![AppVeyor](https://ci.appveyor.com/api/projects/status/github/zkat/make-fetch-happen?svg=true)](https://ci.appveyor.com/project/zkat/make-fetch-happen) [![Coverage Status](https://coveralls.io/repos/github/zkat/make-fetch-happen/badge.svg?branch=latest)](https://coveralls.io/github/zkat/make-fetch-happen?branch=latest) +# make-fetch-happen +[![npm version](https://img.shields.io/npm/v/make-fetch-happen.svg)](https://npm.im/make-fetch-happen) [![license](https://img.shields.io/npm/l/make-fetch-happen.svg)](https://npm.im/make-fetch-happen) [![Travis](https://img.shields.io/travis/npm/make-fetch-happen.svg)](https://travis-ci.org/npm/make-fetch-happen) [![Coverage Status](https://coveralls.io/repos/github/npm/make-fetch-happen/badge.svg?branch=latest)](https://coveralls.io/github/npm/make-fetch-happen?branch=latest) - -[`make-fetch-happen`](https://github.com/zkat/make-fetch-happen) is a Node.js -library that wraps [`node-fetch-npm`](https://github.com/npm/node-fetch-npm) with additional -features [`node-fetch`](https://github.com/bitinn/node-fetch) doesn't intend to include, including HTTP Cache support, request +[`make-fetch-happen`](https://github.com/npm/make-fetch-happen) is a Node.js +library that wraps [`minipass-fetch`](https://github.com/npm/minipass-fetch) with additional +features [`minipass-fetch`](https://github.com/npm/minipass-fetch) doesn't intend to include, including HTTP Cache support, request pooling, proxies, retries, [and more](#features)! ## Install @@ -18,7 +18,7 @@ pooling, proxies, retries, [and more](#features)! * [API](#api) * [`fetch`](#fetch) * [`fetch.defaults`](#fetch-defaults) - * [`node-fetch` options](#node-fetch-options) + * [`minipass-fetch` options](#minipass-fetch-options) * [`make-fetch-happen` options](#extra-options) * [`opts.cacheManager`](#opts-cache-manager) * [`opts.cache`](#opts-cache) @@ -55,7 +55,7 @@ fetch('https://registry.npmjs.org/make-fetch-happen').then(res => { ### Features -* Builds around [`node-fetch`](https://npm.im/node-fetch) for the core [`fetch` API](https://fetch.spec.whatwg.org) implementation +* Builds around [`minipass-fetch`](https://npm.im/minipass-fetch) for the core [`fetch` API](https://fetch.spec.whatwg.org) implementation * Request pooling out of the box * Quite fast, really * Automatic HTTP-semantics-aware request retries @@ -71,9 +71,9 @@ fetch('https://registry.npmjs.org/make-fetch-happen').then(res => { ### Contributing -The make-fetch-happen team enthusiastically welcomes contributions and project participation! There's a bunch of things you can do if you want to contribute! The [Contributor Guide](CONTRIBUTING.md) has all the information you need for everything from reporting bugs to contributing entire new features. Please don't hesitate to jump in if you'd like to, or even ask us questions if something isn't clear. +The make-fetch-happen team enthusiastically welcomes contributions and project participation! There's a bunch of things you can do if you want to contribute! The [Contributor Guide](https://github.com/npm/cli/blob/latest/CONTRIBUTING.md) outlines the process for community interaction and contribution. Please don't hesitate to jump in if you'd like to, or even ask us questions if something isn't clear. -All participants and maintainers in this project are expected to follow [Code of Conduct](CODE_OF_CONDUCT.md), and just generally be excellent to each other. +All participants and maintainers in this project are expected to follow the [npm Code of Conduct](https://www.npmjs.com/policies/conduct), and just generally be excellent to each other. Please refer to the [Changelog](CHANGELOG.md) for project history details, too. @@ -85,7 +85,7 @@ Happy hacking! This function implements most of the [`fetch` API](https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/fetch): given a `uri` string or a `Request` instance, it will fire off an http request and return a Promise containing the relevant response. -If `opts` is provided, the [`node-fetch`-specific options](#node-fetch-options) will be passed to that library. There are also [additional options](#extra-options) specific to make-fetch-happen that add various features, such as HTTP caching, integrity verification, proxy support, and more. +If `opts` is provided, the [`minipass-fetch`-specific options](#minipass-fetch-options) will be passed to that library. There are also [additional options](#extra-options) specific to make-fetch-happen that add various features, such as HTTP caching, integrity verification, proxy support, and more. ##### Example @@ -109,9 +109,9 @@ const fetch = require('make-fetch-happen').defaults({ fetch('https://registry.npmjs.org/make-fetch-happen') // will always use the cache ``` -#### `> node-fetch options` +#### `> minipass-fetch options` -The following options for `node-fetch` are used as-is: +The following options for `minipass-fetch` are used as-is: * method * body @@ -130,11 +130,11 @@ These other options are modified or augmented by make-fetch-happen: * If `opts.agent` is an object, it will be used as the request-pooling agent argument for this request. * If `opts.agent` is `false`, it will be passed as-is to the underlying request library. This causes a new Agent to be spawned for every request. -For more details, see [the documentation for `node-fetch` itself](https://github.com/bitinn/node-fetch#options). +For more details, see [the documentation for `minipass-fetch` itself](https://github.com/npm/minipass-fetch#options). #### `> make-fetch-happen options` -make-fetch-happen augments the `node-fetch` API with additional features available through extra options. The following extra options are available: +make-fetch-happen augments the `minipass-fetch` API with additional features available through extra options. The following extra options are available: * [`opts.cacheManager`](#opts-cache-manager) - Cache target to read/write * [`opts.cache`](#opts-cache) - `fetch` cache mode. Controls cache *behavior*. @@ -266,7 +266,7 @@ fetch('https://registry.npmjs.org/make-fetch-happen', { #### `> opts.proxy` -A string or `url.parse`-d URI to proxy through. Different Proxy handlers will be +A string or `new url.URL()`-d URI to proxy through. Different Proxy handlers will be used depending on the proxy's protocol. Additionally, `process.env.HTTP_PROXY`, `process.env.HTTPS_PROXY`, and diff --git a/deps/npm/node_modules/make-fetch-happen/agent.js b/deps/npm/node_modules/make-fetch-happen/agent.js index 55675946ad97d6..66ca886bea156b 100644 --- a/deps/npm/node_modules/make-fetch-happen/agent.js +++ b/deps/npm/node_modules/make-fetch-happen/agent.js @@ -1,17 +1,31 @@ 'use strict' const LRU = require('lru-cache') const url = require('url') +const isLambda = require('is-lambda') -let AGENT_CACHE = new LRU({ max: 50 }) +const AGENT_CACHE = new LRU({ max: 50 }) let HttpsAgent let HttpAgent module.exports = getAgent +const getAgentTimeout = timeout => + typeof timeout !== 'number' || !timeout ? 0 : timeout + 1 + +const getMaxSockets = maxSockets => maxSockets || 15 + function getAgent (uri, opts) { - const parsedUri = url.parse(typeof uri === 'string' ? uri : uri.url) + const parsedUri = new url.URL(typeof uri === 'string' ? uri : uri.url) const isHttps = parsedUri.protocol === 'https:' - const pxuri = getProxyUri(uri, opts) + const pxuri = getProxyUri(parsedUri.href, opts) + + // If opts.timeout is zero, set the agentTimeout to zero as well. A timeout + // of zero disables the timeout behavior (OS limits still apply). Else, if + // opts.timeout is a non-zero value, set it to timeout + 1, to ensure that + // the node-fetch-npm timeout will always fire first, giving us more + // consistent errors. + const agentTimeout = getAgentTimeout(opts.timeout) + const agentMaxSockets = getMaxSockets(opts.maxSockets) const key = [ `https:${isHttps}`, @@ -22,38 +36,45 @@ function getAgent (uri, opts) { `strict-ssl:${isHttps ? !!opts.strictSSL : '>no-strict-ssl<'}`, `ca:${(isHttps && opts.ca) || '>no-ca<'}`, `cert:${(isHttps && opts.cert) || '>no-cert<'}`, - `key:${(isHttps && opts.key) || '>no-key<'}` + `key:${(isHttps && opts.key) || '>no-key<'}`, + `timeout:${agentTimeout}`, + `maxSockets:${agentMaxSockets}` ].join(':') if (opts.agent != null) { // `agent: false` has special behavior! return opts.agent } + // keep alive in AWS lambda makes no sense + const lambdaAgent = !isLambda ? null + : isHttps ? require('https').globalAgent + : require('http').globalAgent + + if (isLambda && !pxuri) { + return lambdaAgent + } + if (AGENT_CACHE.peek(key)) { return AGENT_CACHE.get(key) } if (pxuri) { - const proxy = getProxy(pxuri, opts, isHttps) + const pxopts = isLambda ? { + ...opts, + agent: lambdaAgent + } : opts + const proxy = getProxy(pxuri, pxopts, isHttps) AGENT_CACHE.set(key, proxy) return proxy } - if (isHttps && !HttpsAgent) { - HttpsAgent = require('agentkeepalive').HttpsAgent - } else if (!isHttps && !HttpAgent) { + if (!HttpsAgent) { HttpAgent = require('agentkeepalive') + HttpsAgent = HttpAgent.HttpsAgent } - // If opts.timeout is zero, set the agentTimeout to zero as well. A timeout - // of zero disables the timeout behavior (OS limits still apply). Else, if - // opts.timeout is a non-zero value, set it to timeout + 1, to ensure that - // the node-fetch-npm timeout will always fire first, giving us more - // consistent errors. - const agentTimeout = opts.timeout === 0 ? 0 : opts.timeout + 1 - const agent = isHttps ? new HttpsAgent({ - maxSockets: opts.maxSockets || 15, + maxSockets: agentMaxSockets, ca: opts.ca, cert: opts.cert, key: opts.key, @@ -61,7 +82,7 @@ function getAgent (uri, opts) { rejectUnauthorized: opts.strictSSL, timeout: agentTimeout }) : new HttpAgent({ - maxSockets: opts.maxSockets || 15, + maxSockets: agentMaxSockets, localAddress: opts.localAddress, timeout: agentTimeout }) @@ -70,7 +91,7 @@ function getAgent (uri, opts) { } function checkNoProxy (uri, opts) { - const host = url.parse(uri).hostname.split('.').reverse() + const host = new url.URL(uri).hostname.split('.').reverse() let noproxy = (opts.noProxy || getProcessEnv('no_proxy')) if (typeof noproxy === 'string') { noproxy = noproxy.split(/\s*,\s*/g) @@ -90,12 +111,14 @@ function checkNoProxy (uri, opts) { module.exports.getProcessEnv = getProcessEnv function getProcessEnv (env) { - if (!env) { return } + if (!env) { + return + } let value if (Array.isArray(env)) { - for (let e of env) { + for (const e of env) { value = process.env[e] || process.env[e.toUpperCase()] || process.env[e.toLowerCase()] @@ -112,37 +135,50 @@ function getProcessEnv (env) { return value } +module.exports.getProxyUri = getProxyUri function getProxyUri (uri, opts) { - const protocol = url.parse(uri).protocol - - const proxy = opts.proxy || ( - protocol === 'https:' && getProcessEnv('https_proxy') - ) || ( - protocol === 'http:' && getProcessEnv(['https_proxy', 'http_proxy', 'proxy']) + const protocol = new url.URL(uri).protocol + + const proxy = opts.proxy || + ( + protocol === 'https:' && + getProcessEnv('https_proxy') + ) || + ( + protocol === 'http:' && + getProcessEnv(['https_proxy', 'http_proxy', 'proxy']) ) if (!proxy) { return null } - const parsedProxy = (typeof proxy === 'string') ? url.parse(proxy) : proxy + const parsedProxy = (typeof proxy === 'string') ? new url.URL(proxy) : proxy return !checkNoProxy(uri, opts) && parsedProxy } +const getAuth = u => + u.username && u.password ? `${u.username}:${u.password}` + : u.username ? u.username + : null + +const getPath = u => u.pathname + u.search + u.hash + let HttpProxyAgent let HttpsProxyAgent let SocksProxyAgent +module.exports.getProxy = getProxy function getProxy (proxyUrl, opts, isHttps) { - let popts = { + const popts = { host: proxyUrl.hostname, port: proxyUrl.port, protocol: proxyUrl.protocol, - path: proxyUrl.path, - auth: proxyUrl.auth, + path: getPath(proxyUrl), + auth: getAuth(proxyUrl), ca: opts.ca, cert: opts.cert, key: opts.key, - timeout: opts.timeout === 0 ? 0 : opts.timeout + 1, + timeout: getAgentTimeout(opts.timeout), localAddress: opts.localAddress, - maxSockets: opts.maxSockets || 15, + maxSockets: getMaxSockets(opts.maxSockets), rejectUnauthorized: opts.strictSSL } @@ -160,12 +196,18 @@ function getProxy (proxyUrl, opts, isHttps) { return new HttpsProxyAgent(popts) } - } - if (proxyUrl.protocol.startsWith('socks')) { + } else if (proxyUrl.protocol.startsWith('socks')) { if (!SocksProxyAgent) { SocksProxyAgent = require('socks-proxy-agent') } return new SocksProxyAgent(popts) + } else { + throw Object.assign( + new Error(`unsupported proxy protocol: '${proxyUrl.protocol}'`), + { + url: proxyUrl.href + } + ) } } diff --git a/deps/npm/node_modules/make-fetch-happen/cache.js b/deps/npm/node_modules/make-fetch-happen/cache.js index f00de14a8844a8..1b7f0db1b688df 100644 --- a/deps/npm/node_modules/make-fetch-happen/cache.js +++ b/deps/npm/node_modules/make-fetch-happen/cache.js @@ -1,23 +1,24 @@ 'use strict' +const fetch = require('minipass-fetch') const cacache = require('cacache') -const fetch = require('node-fetch-npm') -const pipe = require('mississippi').pipe const ssri = require('ssri') -const through = require('mississippi').through -const to = require('mississippi').to const url = require('url') -const stream = require('stream') + +const Minipass = require('minipass') +const MinipassFlush = require('minipass-flush') +const MinipassCollect = require('minipass-collect') +const MinipassPipeline = require('minipass-pipeline') const MAX_MEM_SIZE = 5 * 1024 * 1024 // 5MB function cacheKey (req) { - const parsed = url.parse(req.url) + const parsed = new url.URL(req.url) return `make-fetch-happen:request-cache:${ url.format({ protocol: parsed.protocol, - slashes: parsed.slashes, - host: parsed.host, + slashes: true, + port: parsed.port, hostname: parsed.hostname, pathname: parsed.pathname }) @@ -37,7 +38,6 @@ module.exports = class Cache { // Returns a Promise that resolves to the response associated with the first // matching request in the Cache object. match (req, opts) { - opts = opts || {} const key = cacheKey(req) return cacache.get.info(this._path, key).then(info => { return info && cacache.get.hasContent( @@ -60,39 +60,35 @@ module.exports = class Cache { status: 200 }) } - let body const cachePath = this._path // avoid opening cache file handles until a user actually tries to // read from it. - if (opts.memoize !== false && info.size > MAX_MEM_SIZE) { - body = new stream.PassThrough() - const realRead = body._read - body._read = function (size) { - body._read = realRead - pipe( - cacache.get.stream.byDigest(cachePath, info.integrity, { + const body = new Minipass() + const fitInMemory = info.size < MAX_MEM_SIZE + const removeOnResume = () => body.removeListener('resume', onResume) + const onResume = + opts.memoize !== false && fitInMemory + ? () => { + const c = cacache.get.stream.byDigest(cachePath, info.integrity, { memoize: opts.memoize - }), - body, - err => body.emit(err)) - return realRead.call(this, size) - } - } else { - let readOnce = false - // cacache is much faster at bulk reads - body = new stream.Readable({ - read () { - if (readOnce) return this.push(null) - readOnce = true + }) + c.on('error', /* istanbul ignore next */ err => { + body.emit('error', err) + }) + c.pipe(body) + } + : () => { + removeOnResume() cacache.get.byDigest(cachePath, info.integrity, { memoize: opts.memoize - }).then(data => { - this.push(data) - this.push(null) - }, err => this.emit('error', err)) + }) + .then(data => body.end(data)) + .catch(/* istanbul ignore next */ err => { + body.emit('error', err) + }) } - }) - } + body.once('resume', onResume) + body.once('end', () => removeOnResume) return this.Promise.resolve(new fetch.Response(body, { url: req.url, headers: resHeaders, @@ -127,65 +123,59 @@ module.exports = class Cache { addCacheHeaders( response.headers, this._path, ckey, info.integrity, info.time ) - return new this.Promise((resolve, reject) => { - pipe( - cacache.get.stream.byDigest(this._path, info.integrity, cacheOpts), - cacache.put.stream(this._path, cacheKey(req), cacheOpts), - err => err ? reject(err) : resolve(response) - ) + + return new MinipassPipeline( + cacache.get.stream.byDigest(this._path, info.integrity, cacheOpts), + cacache.put.stream(this._path, ckey, cacheOpts) + ).promise().then(() => { + return response }) - }).then(() => response) + }) } - let buf = [] - let bufSize = 0 - let cacheTargetStream = false - const cachePath = this._path - let cacheStream = to((chunk, enc, cb) => { - if (!cacheTargetStream) { - if (fitInMemory) { - cacheTargetStream = - to({highWaterMark: MAX_MEM_SIZE}, (chunk, enc, cb) => { - buf.push(chunk) - bufSize += chunk.length - cb() - }, done => { - cacache.put( - cachePath, - cacheKey(req), - Buffer.concat(buf, bufSize), - cacheOpts - ).then( - () => done(), - done - ) - }) - } else { - cacheTargetStream = - cacache.put.stream(cachePath, cacheKey(req), cacheOpts) - } + const oldBody = response.body + // the flush is the last thing in the pipeline. Build the pipeline + // back-to-front so we don't consume the data before we use it! + // We unshift in either a tee-stream to the cache put stream, + // or a collecter that dumps it to cache in one go, then the + // old body to bring in the data. + const newBody = new MinipassPipeline(new MinipassFlush({ + flush () { + return cacheWritePromise } - cacheTargetStream.write(chunk, enc, cb) - }, done => { - cacheTargetStream ? cacheTargetStream.end(done) : done() + })) + + let cacheWriteResolve, cacheWriteReject + const cacheWritePromise = new Promise((resolve, reject) => { + cacheWriteResolve = resolve + cacheWriteReject = reject }) - const oldBody = response.body - const newBody = through({highWaterMark: MAX_MEM_SIZE}) - response.body = newBody - oldBody.once('error', err => newBody.emit('error', err)) - newBody.once('error', err => oldBody.emit('error', err)) - cacheStream.once('error', err => newBody.emit('error', err)) - pipe(oldBody, to((chunk, enc, cb) => { - cacheStream.write(chunk, enc, () => { - newBody.write(chunk, enc, cb) - }) - }, done => { - cacheStream.end(() => { - newBody.end(() => { - done() - }) + const cachePath = this._path + + if (fitInMemory) { + const collecter = new MinipassCollect.PassThrough() + collecter.on('collect', data => { + cacache.put( + cachePath, + ckey, + data, + cacheOpts + ).then(cacheWriteResolve, cacheWriteReject) }) - }), err => err && newBody.emit('error', err)) - return response + newBody.unshift(collecter) + } else { + const tee = new Minipass() + const cacheStream = cacache.put.stream( + cachePath, + ckey, + cacheOpts + ) + tee.pipe(cacheStream) + cacheStream.promise().then(cacheWriteResolve, cacheWriteReject) + newBody.unshift(tee) + } + + newBody.unshift(oldBody) + return Promise.resolve(new fetch.Response(newBody, response)) } // Finds the Cache entry whose key is the request, and if found, deletes the @@ -213,8 +203,8 @@ module.exports = class Cache { } function matchDetails (req, cached) { - const reqUrl = url.parse(req.url) - const cacheUrl = url.parse(cached.url) + const reqUrl = new url.URL(req.url) + const cacheUrl = new url.URL(cached.url) const vary = cached.resHeaders.get('Vary') // https://tools.ietf.org/html/rfc7234#section-4.1 if (vary) { diff --git a/deps/npm/node_modules/make-fetch-happen/index.js b/deps/npm/node_modules/make-fetch-happen/index.js index 0f2c164e19f285..fb2e115ff4d2a9 100644 --- a/deps/npm/node_modules/make-fetch-happen/index.js +++ b/deps/npm/node_modules/make-fetch-happen/index.js @@ -1,16 +1,20 @@ 'use strict' -let Cache const url = require('url') -const CachePolicy = require('http-cache-semantics') -const fetch = require('node-fetch-npm') +const fetch = require('minipass-fetch') const pkg = require('./package.json') const retry = require('promise-retry') let ssri -const Stream = require('stream') + +const Minipass = require('minipass') +const MinipassPipeline = require('minipass-pipeline') const getAgent = require('./agent') const setWarning = require('./warning') +const configureOptions = require('./utils/configure-options') +const iterableToObject = require('./utils/iterable-to-object') +const makePolicy = require('./utils/make-policy') + const isURL = /^https?:/ const USER_AGENT = `${pkg.name}/${pkg.version} (+https://npm.im/${pkg.name})` @@ -58,45 +62,6 @@ function cacheDelete (uri, opts) { } } -function initializeCache (opts) { - if (typeof opts.cacheManager === 'string') { - if (!Cache) { - // Default cacache-based cache - Cache = require('./cache') - } - - opts.cacheManager = new Cache(opts.cacheManager, opts) - } - - opts.cache = opts.cache || 'default' - - if (opts.cache === 'default' && isHeaderConditional(opts.headers)) { - // If header list contains `If-Modified-Since`, `If-None-Match`, - // `If-Unmodified-Since`, `If-Match`, or `If-Range`, fetch will set cache - // mode to "no-store" if it is "default". - opts.cache = 'no-store' - } -} - -function configureOptions (_opts) { - const opts = Object.assign({}, _opts || {}) - opts.method = (opts.method || 'GET').toUpperCase() - - if (opts.retry && typeof opts.retry === 'number') { - opts.retry = { retries: opts.retry } - } - - if (opts.retry === false) { - opts.retry = { retries: 0 } - } - - if (opts.cacheManager) { - initializeCache(opts) - } - - return opts -} - function initializeSsri () { if (!ssri) { ssri = require('ssri') @@ -108,14 +73,19 @@ function cachingFetch (uri, _opts) { if (opts.integrity) { initializeSsri() - // if verifying integrity, node-fetch must not decompress + // if verifying integrity, fetch must not decompress opts.compress = false } - const isCachable = (opts.method === 'GET' || opts.method === 'HEAD') && - opts.cacheManager && - opts.cache !== 'no-store' && - opts.cache !== 'reload' + const isCachable = ( + ( + opts.method === 'GET' || + opts.method === 'HEAD' + ) && + Boolean(opts.cacheManager) && + opts.cache !== 'no-store' && + opts.cache !== 'reload' + ) if (isCachable) { const req = new fetch.Request(uri, { @@ -172,38 +142,11 @@ function cachingFetch (uri, _opts) { return remoteFetch(req.url, opts) }) } - return remoteFetch(uri, opts) } -function iterableToObject (iter) { - const obj = {} - for (let k of iter.keys()) { - obj[k] = iter.get(k) - } - return obj -} - -function makePolicy (req, res) { - const _req = { - url: req.url, - method: req.method, - headers: iterableToObject(req.headers) - } - const _res = { - status: res.status, - headers: iterableToObject(res.headers) - } - - return new CachePolicy(_req, _res, { shared: false }) -} - // https://tools.ietf.org/html/rfc7234#section-4.2 function isStale (req, res) { - if (!res) { - return null - } - const _req = { url: req.url, method: req.method, @@ -213,12 +156,21 @@ function isStale (req, res) { const policy = makePolicy(req, res) const responseTime = res.headers.get('x-local-cache-time') || - res.headers.get('date') || - 0 + /* istanbul ignore next - would be weird to get a 'stale' + * response that didn't come from cache with a cache time header */ + (res.headers.get('date') || 0) policy._responseTime = new Date(responseTime) const bool = !policy.satisfiesWithoutRevalidation(_req) + const headers = policy.responseHeaders() + if (headers.warning && /^113\b/.test(headers.warning)) { + // Possible to pick up a rfc7234 warning at this point. + // This is kind of a weird place to stick this, should probably go + // in cachingFetch. But by putting it here, we save an extra + // CachePolicy object construction. + res.headers.append('warning', headers.warning) + } return bool } @@ -254,10 +206,22 @@ function conditionalFetch (req, cachedRes, opts) { } if (condRes.status === 304) { // 304 Not Modified - condRes.body = cachedRes.body - return opts.cacheManager.put(req, condRes, opts) + // Create a synthetic response from the cached body and original req + const synthRes = new fetch.Response(cachedRes.body, condRes) + return opts.cacheManager.put(req, synthRes, opts) .then(newRes => { - newRes.headers = new fetch.Headers(revalidatedPolicy.policy.responseHeaders()) + // Get the list first, because if we delete while iterating, + // it'll throw off the count and not make it through all + // of them. + const newHeaders = revalidatedPolicy.policy.responseHeaders() + const toDelete = [...newRes.headers.keys()] + .filter(k => !newHeaders[k]) + for (const key of toDelete) { + newRes.headers.delete(key) + } + for (const [key, val] of Object.entries(newHeaders)) { + newRes.headers.set(key, val) + } return newRes }) } @@ -296,29 +260,27 @@ function remoteFetchHandleIntegrity (res, integrity) { const newBod = ssri.integrityStream({ integrity }) - oldBod.pipe(newBod) - res.body = newBod - oldBod.once('error', err => { - newBod.emit('error', err) - }) - newBod.once('error', err => { - oldBod.emit('error', err) - }) + return new fetch.Response(new MinipassPipeline(oldBod, newBod), res) } function remoteFetch (uri, opts) { const agent = getAgent(uri, opts) - const headers = Object.assign({ - 'connection': agent ? 'keep-alive' : 'close', - 'user-agent': USER_AGENT - }, opts.headers || {}) + const headers = opts.headers instanceof fetch.Headers + ? opts.headers + : new fetch.Headers(opts.headers) + if (!headers.get('connection')) { + headers.set('connection', agent ? 'keep-alive' : 'close') + } + if (!headers.get('user-agent')) { + headers.set('user-agent', USER_AGENT) + } const reqOpts = { agent, body: opts.body, compress: opts.compress, follow: opts.follow, - headers: new fetch.Headers(headers), + headers, method: opts.method, redirect: 'manual', size: opts.size, @@ -330,23 +292,27 @@ function remoteFetch (uri, opts) { (retryHandler, attemptNum) => { const req = new fetch.Request(uri, reqOpts) return fetch(req) - .then(res => { - res.headers.set('x-fetch-attempts', attemptNum) - + .then((res) => { if (opts.integrity) { - remoteFetchHandleIntegrity(res, opts.integrity) + res = remoteFetchHandleIntegrity(res, opts.integrity) } - const isStream = req.body instanceof Stream + res.headers.set('x-fetch-attempts', attemptNum) + + const isStream = Minipass.isStream(req.body) if (opts.cacheManager) { - const isMethodGetHead = req.method === 'GET' || + const isMethodGetHead = ( + req.method === 'GET' || req.method === 'HEAD' + ) - const isCachable = opts.cache !== 'no-store' && + const isCachable = ( + opts.cache !== 'no-store' && isMethodGetHead && makePolicy(req, res).storable() && res.status === 200 // No other statuses should be stored! + ) if (isCachable) { return opts.cacheManager.put(req, res, opts) @@ -367,13 +333,16 @@ function remoteFetch (uri, opts) { } } - const isRetriable = req.method !== 'POST' && - !isStream && ( + const isRetriable = ( + req.method !== 'POST' && + !isStream && + ( res.status === 408 || // Request Timeout res.status === 420 || // Enhance Your Calm (usually Twitter rate-limit) res.status === 429 || // Too Many Requests ("standard" rate-limiting) res.status >= 500 // Assume server errors are momentary hiccups ) + ) if (isRetriable) { if (typeof opts.onRetry === 'function') { @@ -383,47 +352,69 @@ function remoteFetch (uri, opts) { return retryHandler(res) } - if (!fetch.isRedirect(res.status) || opts.redirect === 'manual') { + if (!fetch.isRedirect(res.status)) { return res } + if (opts.redirect === 'manual') { + return res + } + // if (!fetch.isRedirect(res.status) || opts.redirect === 'manual') { + // return res + // } - // handle redirects - matches behavior of npm-fetch: https://github.com/bitinn/node-fetch + // handle redirects - matches behavior of fetch: https://github.com/bitinn/node-fetch if (opts.redirect === 'error') { - const err = new Error(`redirect mode is set to error: ${uri}`) - err.code = 'ENOREDIRECT' + const err = new fetch.FetchError(`redirect mode is set to error: ${uri}`, 'no-redirect', { code: 'ENOREDIRECT' }) throw err } if (!res.headers.get('location')) { - const err = new Error(`redirect location header missing at: ${uri}`) - err.code = 'EINVALIDREDIRECT' + const err = new fetch.FetchError(`redirect location header missing at: ${uri}`, 'no-location', { code: 'EINVALIDREDIRECT' }) throw err } if (req.counter >= req.follow) { - const err = new Error(`maximum redirect reached at: ${uri}`) - err.code = 'EMAXREDIRECT' + const err = new fetch.FetchError(`maximum redirect reached at: ${uri}`, 'max-redirect', { code: 'EMAXREDIRECT' }) throw err } - const resolvedUrl = url.resolve(req.url, res.headers.get('location')) - let redirectURL = url.parse(resolvedUrl) - - if (isURL.test(res.headers.get('location'))) { - redirectURL = url.parse(res.headers.get('location')) - } + const resolvedUrlParsed = new url.URL(res.headers.get('location'), req.url) + const resolvedUrl = url.format(resolvedUrlParsed) + const redirectURL = (isURL.test(res.headers.get('location'))) + ? new url.URL(res.headers.get('location')) + : resolvedUrlParsed + + // Comment below is used under the following license: + // Copyright (c) 2010-2012 Mikeal Rogers + // Licensed under the Apache License, Version 2.0 (the "License"); + // you may not use this file except in compliance with the License. + // You may obtain a copy of the License at + // http://www.apache.org/licenses/LICENSE-2.0 + // Unless required by applicable law or agreed to in writing, + // software distributed under the License is distributed on an "AS + // IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + // express or implied. See the License for the specific language + // governing permissions and limitations under the License. // Remove authorization if changing hostnames (but not if just // changing ports or protocols). This matches the behavior of request: // https://github.com/request/request/blob/b12a6245/lib/redirect.js#L134-L138 - if (url.parse(req.url).hostname !== redirectURL.hostname) { + if (new url.URL(req.url).hostname !== redirectURL.hostname) { req.headers.delete('authorization') } // for POST request with 301/302 response, or any request with 303 response, // use GET when following redirect - if (res.status === 303 || - ((res.status === 301 || res.status === 302) && req.method === 'POST')) { + if ( + res.status === 303 || + ( + req.method === 'POST' && + ( + res.status === 301 || + res.status === 302 + ) + ) + ) { opts.method = 'GET' opts.body = null req.headers.delete('content-length') @@ -438,10 +429,14 @@ function remoteFetch (uri, opts) { return cachingFetch(resolvedUrl, opts) }) .catch(err => { - const code = err.code === 'EPROMISERETRY' ? err.retried.code : err.code + const code = (err.code === 'EPROMISERETRY') + ? err.retried.code + : err.code - const isRetryError = RETRY_ERRORS.indexOf(code) === -1 && + const isRetryError = ( + RETRY_ERRORS.indexOf(code) === -1 && RETRY_TYPES.indexOf(err.type) === -1 + ) if (req.method === 'POST' || isRetryError) { throw err @@ -456,27 +451,11 @@ function remoteFetch (uri, opts) { }, opts.retry ).catch(err => { - if (err.status >= 400) { + if (err.status >= 400 && err.type !== 'system') { + // this is an HTTP response "error" that we care about return err } throw err }) } - -function isHeaderConditional (headers) { - if (!headers || typeof headers !== 'object') { - return false - } - - const modifiers = [ - 'if-modified-since', - 'if-none-match', - 'if-unmodified-since', - 'if-match', - 'if-range' - ] - - return Object.keys(headers) - .some(h => modifiers.indexOf(h.toLowerCase()) !== -1) -} diff --git a/deps/npm/node_modules/make-fetch-happen/package.json b/deps/npm/node_modules/make-fetch-happen/package.json index a2c7397bc8c4f8..794283aab21cdc 100644 --- a/deps/npm/node_modules/make-fetch-happen/package.json +++ b/deps/npm/node_modules/make-fetch-happen/package.json @@ -1,73 +1,22 @@ { - "_from": "make-fetch-happen@5.0.2", - "_id": "make-fetch-happen@5.0.2", - "_inBundle": false, - "_integrity": "sha512-07JHC0r1ykIoruKO8ifMXu+xEU8qOXDFETylktdug6vJDACnP+HKevOu3PXyNPzFyTSlz8vrBYlBO1JZRe8Cag==", - "_location": "/make-fetch-happen", - "_phantomChildren": {}, - "_requested": { - "type": "version", - "registry": true, - "raw": "make-fetch-happen@5.0.2", - "name": "make-fetch-happen", - "escapedName": "make-fetch-happen", - "rawSpec": "5.0.2", - "saveSpec": null, - "fetchSpec": "5.0.2" - }, - "_requiredBy": [ - "#USER", - "/", - "/npm-registry-fetch", - "/pacote" - ], - "_resolved": "https://registry.npmjs.org/make-fetch-happen/-/make-fetch-happen-5.0.2.tgz", - "_shasum": "aa8387104f2687edca01c8687ee45013d02d19bd", - "_spec": "make-fetch-happen@5.0.2", - "_where": "/Users/claudiahdz/npm/cli", - "author": { - "name": "Kat Marchán", - "email": "kzm@zkat.tech" - }, - "bugs": { - "url": "https://github.com/zkat/make-fetch-happen/issues" - }, - "bundleDependencies": false, - "dependencies": { - "agentkeepalive": "^3.4.1", - "cacache": "^12.0.0", - "http-cache-semantics": "^3.8.1", - "http-proxy-agent": "^2.1.0", - "https-proxy-agent": "^2.2.3", - "lru-cache": "^5.1.1", - "mississippi": "^3.0.0", - "node-fetch-npm": "^2.0.2", - "promise-retry": "^1.1.1", - "socks-proxy-agent": "^4.0.0", - "ssri": "^6.0.0" - }, - "deprecated": false, + "name": "make-fetch-happen", + "version": "8.0.9", "description": "Opinionated, caching, retrying fetch client", - "devDependencies": { - "bluebird": "^3.5.1", - "mkdirp": "^0.5.1", - "nock": "^9.2.3", - "npmlog": "^4.1.2", - "require-inject": "^1.4.2", - "rimraf": "^2.6.2", - "safe-buffer": "^5.1.1", - "standard": "^11.0.1", - "standard-version": "^4.3.0", - "tacks": "^1.2.6", - "tap": "^12.7.0", - "weallbehave": "^1.0.0", - "weallcontribute": "^1.0.7" - }, + "main": "index.js", "files": [ "*.js", - "lib" + "lib", + "utils" ], - "homepage": "https://github.com/zkat/make-fetch-happen#readme", + "scripts": { + "preversion": "npm t", + "postversion": "npm publish", + "prepublishOnly": "git push --follow-tags", + "test": "tap test/*.js", + "posttest": "npm run lint", + "lint": "standard" + }, + "repository": "https://github.com/npm/make-fetch-happen", "keywords": [ "http", "request", @@ -77,21 +26,42 @@ "cache", "subresource integrity" ], + "author": { + "name": "Kat Marchán", + "email": "kzm@zkat.tech", + "twitter": "maybekatz" + }, "license": "ISC", - "main": "index.js", - "name": "make-fetch-happen", - "repository": { - "type": "git", - "url": "git+https://github.com/zkat/make-fetch-happen.git" + "dependencies": { + "agentkeepalive": "^4.1.0", + "cacache": "^15.0.0", + "http-cache-semantics": "^4.0.4", + "http-proxy-agent": "^4.0.1", + "https-proxy-agent": "^5.0.0", + "is-lambda": "^1.0.1", + "lru-cache": "^6.0.0", + "minipass": "^3.1.3", + "minipass-collect": "^1.0.2", + "minipass-fetch": "^1.3.0", + "minipass-flush": "^1.0.5", + "minipass-pipeline": "^1.2.2", + "promise-retry": "^1.1.1", + "socks-proxy-agent": "^5.0.0", + "ssri": "^8.0.0" }, - "scripts": { - "postrelease": "npm publish --tag=legacy && git push --follow-tags", - "prerelease": "npm t", - "pretest": "standard", - "release": "standard-version -s", - "test": "tap --coverage --nyc-arg=--all --timeout=35 -J test/*.js", - "update-coc": "weallbehave -o . && git add CODE_OF_CONDUCT.md && git commit -m 'docs(coc): updated CODE_OF_CONDUCT.md'", - "update-contrib": "weallcontribute -o . && git add CONTRIBUTING.md && git commit -m 'docs(contributing): updated CONTRIBUTING.md'" + "devDependencies": { + "mkdirp": "^1.0.3", + "nock": "^11.9.1", + "npmlog": "^4.1.2", + "require-inject": "^1.4.2", + "rimraf": "^2.7.1", + "safe-buffer": "^5.2.0", + "standard": "^14.3.1", + "standard-version": "^7.1.0", + "tacks": "^1.2.6", + "tap": "^14.10.6" }, - "version": "5.0.2" + "engines": { + "node": ">= 10" + } } diff --git a/deps/npm/node_modules/make-fetch-happen/utils/configure-options.js b/deps/npm/node_modules/make-fetch-happen/utils/configure-options.js new file mode 100644 index 00000000000000..d55fec43978f85 --- /dev/null +++ b/deps/npm/node_modules/make-fetch-happen/utils/configure-options.js @@ -0,0 +1,33 @@ +'use strict' + +const initializeCache = require('./initialize-cache') + +module.exports = function configureOptions (_opts) { + const opts = Object.assign({}, _opts || {}) + opts.method = (opts.method || 'GET').toUpperCase() + + if (!opts.retry) { + // opts.retry was falsy; set default + opts.retry = { retries: 0 } + } else { + if (typeof opts.retry !== 'object') { + // Shorthand + if (typeof opts.retry === 'number') { + opts.retry = { retries: opts.retry } + } + if (typeof opts.retry === 'string') { + const value = parseInt(opts.retry, 10) + opts.retry = (value) ? { retries: value } : { retries: 0 } + } + } else { + // Set default retries + opts.retry = Object.assign({}, { retries: 0 }, opts.retry) + } + } + + if (opts.cacheManager) { + initializeCache(opts) + } + + return opts +} diff --git a/deps/npm/node_modules/make-fetch-happen/utils/initialize-cache.js b/deps/npm/node_modules/make-fetch-happen/utils/initialize-cache.js new file mode 100644 index 00000000000000..9f96bf56226ef5 --- /dev/null +++ b/deps/npm/node_modules/make-fetch-happen/utils/initialize-cache.js @@ -0,0 +1,26 @@ +'use strict' + +const isHeaderConditional = require('./is-header-conditional') +// Default cacache-based cache +const Cache = require('../cache') + +module.exports = function initializeCache (opts) { + /** + * NOTE: `opts.cacheManager` is the path to cache + * We're making the assumption that if `opts.cacheManager` *isn't* a string, + * it's a cache object + */ + if (typeof opts.cacheManager === 'string') { + // Need to make a cache object + opts.cacheManager = new Cache(opts.cacheManager, opts) + } + + opts.cache = opts.cache || 'default' + + if (opts.cache === 'default' && isHeaderConditional(opts.headers)) { + // If header list contains `If-Modified-Since`, `If-None-Match`, + // `If-Unmodified-Since`, `If-Match`, or `If-Range`, fetch will set cache + // mode to "no-store" if it is "default". + opts.cache = 'no-store' + } +} diff --git a/deps/npm/node_modules/make-fetch-happen/utils/is-header-conditional.js b/deps/npm/node_modules/make-fetch-happen/utils/is-header-conditional.js new file mode 100644 index 00000000000000..c2e70d5ea596c2 --- /dev/null +++ b/deps/npm/node_modules/make-fetch-happen/utils/is-header-conditional.js @@ -0,0 +1,18 @@ +'use strict' + +module.exports = function isHeaderConditional (headers) { + if (!headers || typeof headers !== 'object') { + return false + } + + const modifiers = [ + 'if-modified-since', + 'if-none-match', + 'if-unmodified-since', + 'if-match', + 'if-range' + ] + + return Object.keys(headers) + .some(h => modifiers.indexOf(h.toLowerCase()) !== -1) +} diff --git a/deps/npm/node_modules/make-fetch-happen/utils/iterable-to-object.js b/deps/npm/node_modules/make-fetch-happen/utils/iterable-to-object.js new file mode 100644 index 00000000000000..6b844c4f237991 --- /dev/null +++ b/deps/npm/node_modules/make-fetch-happen/utils/iterable-to-object.js @@ -0,0 +1,9 @@ +'use strict' + +module.exports = function iterableToObject (iter) { + const obj = {} + for (const k of iter.keys()) { + obj[k] = iter.get(k) + } + return obj +} diff --git a/deps/npm/node_modules/make-fetch-happen/utils/make-policy.js b/deps/npm/node_modules/make-fetch-happen/utils/make-policy.js new file mode 100644 index 00000000000000..b7dd3d29ab541a --- /dev/null +++ b/deps/npm/node_modules/make-fetch-happen/utils/make-policy.js @@ -0,0 +1,19 @@ +'use strict' + +const CachePolicy = require('http-cache-semantics') + +const iterableToObject = require('./iterable-to-object') + +module.exports = function makePolicy (req, res) { + const _req = { + url: req.url, + method: req.method, + headers: iterableToObject(req.headers) + } + const _res = { + status: res.status, + headers: iterableToObject(res.headers) + } + + return new CachePolicy(_req, _res, { shared: false }) +} diff --git a/deps/npm/node_modules/make-fetch-happen/warning.js b/deps/npm/node_modules/make-fetch-happen/warning.js index b8f13cf83195ab..2b96024714e3be 100644 --- a/deps/npm/node_modules/make-fetch-happen/warning.js +++ b/deps/npm/node_modules/make-fetch-happen/warning.js @@ -12,7 +12,7 @@ function setWarning (reqOrRes, code, message, replace) { // warn-text = quoted-string // warn-date = <"> HTTP-date <"> // (https://tools.ietf.org/html/rfc2616#section-14.46) - const host = url.parse(reqOrRes.url).host + const host = new url.URL(reqOrRes.url).host const jsonMessage = JSON.stringify(message) const jsonDate = JSON.stringify(new Date().toUTCString()) const header = replace ? 'set' : 'append' diff --git a/deps/npm/node_modules/meant/.github/workflows/ci.yml b/deps/npm/node_modules/meant/.github/workflows/ci.yml deleted file mode 100644 index b11451fa603d54..00000000000000 --- a/deps/npm/node_modules/meant/.github/workflows/ci.yml +++ /dev/null @@ -1,20 +0,0 @@ -name: Node.js CI - -on: [push, pull_request] - -jobs: - build: - strategy: - matrix: - node-version: [6.x, 8.x, 10.x, 12.x] - os: [ubuntu-latest, windows-latest, macOS-latest] - runs-on: ${{ matrix.os }} - - steps: - - uses: actions/checkout@v2 - - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v1 - with: - node-version: ${{ matrix.node-version }} - - run: npm install - - run: npm test diff --git a/deps/npm/node_modules/meant/CHANGELOG.md b/deps/npm/node_modules/meant/CHANGELOG.md deleted file mode 100644 index 89b0e6f94e1ccf..00000000000000 --- a/deps/npm/node_modules/meant/CHANGELOG.md +++ /dev/null @@ -1,37 +0,0 @@ -# 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. - -### [1.0.2](https://github.com/watilde/meant/compare/v1.0.1...v1.0.2) (2020-07-19) - - -### Bug Fixes - -* **deps:** bump standard, standard-version and tap ([d31fb06](https://github.com/watilde/meant/commit/d31fb064495b031dd1152726da9bd2198daa36ff)) -* **deps:** patch update in lock file ([4e699ee](https://github.com/watilde/meant/commit/4e699ee8751a69923dddf18c940acce630f4bf29)) - - -## [1.0.1](https://github.com/watilde/meant/compare/v1.0.0...v1.0.1) (2017-08-23) - - -### Bug Fixes - -* **package:** tweak the line ([915d949](https://github.com/watilde/meant/commit/915d949)) - - - - -# 1.0.0 (2016-09-08) - - -### Bug Fixes - -* **deps:** install devDeps and update tests ([d766d6f](https://github.com/watilde/meant/commit/d766d6f)) -* **run-script:** add npm run release command ([9387904](https://github.com/watilde/meant/commit/9387904)) -* **test:** add test.js ([65b6e99](https://github.com/watilde/meant/commit/65b6e99)) -* **travis:** add .travis.yml ([24d918c](https://github.com/watilde/meant/commit/24d918c)) - - -### Features - -* **new-meant:** add index.js ([7289b99](https://github.com/watilde/meant/commit/7289b99)) diff --git a/deps/npm/node_modules/meant/LICENSE b/deps/npm/node_modules/meant/LICENSE deleted file mode 100644 index 4205f889a4b31e..00000000000000 --- a/deps/npm/node_modules/meant/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2016 Daijirō Wachi - -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/meant/README.md b/deps/npm/node_modules/meant/README.md deleted file mode 100644 index 2fe43b610a71de..00000000000000 --- a/deps/npm/node_modules/meant/README.md +++ /dev/null @@ -1,67 +0,0 @@ -# meant ![Build status](https://github.com/watilde/meant/workflows/Node.js%20CI/badge.svg) - -Like the `Did you mean?` in git for npm - -## API -### meant(item, list) -+ item {String} A key for finding an approximate value -+ list {Array} A list for comparing with the item - -```js -const meant = require('meant') -const result = meant('foa', ['foo', 'bar', 'baz']) -// => [ 'foo' ] -``` - -## Installation - -Download node at [nodejs.org](http://nodejs.org) and install it, if you haven't already. - -```sh -npm install meant --save -``` - - -## Tests - -```sh -npm install -npm test -``` -``` - -> meant@1.0.0 test /Users/watilde/Development/meant -> standard && tap test.js -TAP version 13 -# Subtest: test.js - # Subtest: test vs ['tast', 'tbst', 'tcst', 'foo'] - ok 1 - list has tast - ok 2 - list has tbst - ok 3 - list has tcst - ok 4 - list doesn't have foo - 1..4 - ok 1 - test vs ['tast', 'tbst', 'tcst', 'foo'] # time=11.816ms - 1..1 - # time=44.006ms -ok 1 - test.js # time=249.154ms -1..1 -# time=267.371ms - -``` - -## Dependencies - -None - -## Dev Dependencies - -- [standard](https://github.com/feross/standard): JavaScript Standard Style -- [standard-version](https://github.com/conventional-changelog/standard-version): replacement for `npm version` with automatic CHANGELOG generation -- [tap](https://github.com/tapjs/node-tap): A Test-Anything-Protocol library - - -## License - -MIT - -_Generated by [package-json-to-readme](https://github.com/zeke/package-json-to-readme)_ diff --git a/deps/npm/node_modules/meant/index.js b/deps/npm/node_modules/meant/index.js deleted file mode 100644 index 647ba912d42ec2..00000000000000 --- a/deps/npm/node_modules/meant/index.js +++ /dev/null @@ -1,49 +0,0 @@ -function levenshteinD (s1, s2) { - var d = [] - var i = 0 - - for (i = 0; i <= s1.length; i++) d[i] = [i] - for (i = 0; i <= s2.length; i++) d[0][i] = i - - s2.split('').forEach(function (c2, j) { - s1.split('').forEach(function (c1, i) { - if (c1 === c2) { - d[i + 1][j + 1] = d[i][j] - return - } - d[i + 1][j + 1] = Math.min( - d[i][j + 1] + 1, - d[i + 1][j] + 1, - d[i][j] + 1 - ) - }) - }) - - return d[s1.length][s2.length] -} - -function meant (scmd, commands) { - var d = [] - var bestSimilarity = [] - - commands.forEach(function (cmd, i) { - var item = {} - item[levenshteinD(scmd, cmd)] = i - d.push(item) - }) - - d.sort(function (a, b) { - return Number(Object.keys(a)[0]) - Number(Object.keys(b)[0]) - }) - - d.forEach(function (item) { - var key = Number(Object.keys(item)[0]) - if (scmd.length / 2 >= key) { - bestSimilarity.push(commands[item[key]]) - } - }) - - return bestSimilarity -} - -module.exports = meant diff --git a/deps/npm/node_modules/meant/package.json b/deps/npm/node_modules/meant/package.json deleted file mode 100644 index 64fb15b983f088..00000000000000 --- a/deps/npm/node_modules/meant/package.json +++ /dev/null @@ -1,56 +0,0 @@ -{ - "_from": "meant@1.0.2", - "_id": "meant@1.0.2", - "_inBundle": false, - "_integrity": "sha512-KN+1uowN/NK+sT/Lzx7WSGIj2u+3xe5n2LbwObfjOhPZiA+cCfCm6idVl0RkEfjThkw5XJ96CyRcanq6GmKtUg==", - "_location": "/meant", - "_phantomChildren": {}, - "_requested": { - "type": "version", - "registry": true, - "raw": "meant@1.0.2", - "name": "meant", - "escapedName": "meant", - "rawSpec": "1.0.2", - "saveSpec": null, - "fetchSpec": "1.0.2" - }, - "_requiredBy": [ - "#USER", - "/" - ], - "_resolved": "https://registry.npmjs.org/meant/-/meant-1.0.2.tgz", - "_shasum": "5d0c78310a3d8ae1408a16be0fe0bd42a969f560", - "_spec": "meant@1.0.2", - "_where": "/Users/ruyadorno/Documents/workspace/cli/latest", - "author": { - "name": "Daijiro Wachi" - }, - "bugs": { - "url": "https://github.com/watilde/meant/issues" - }, - "bundleDependencies": false, - "deprecated": false, - "description": "Like the `Did you mean?` in git for npm", - "devDependencies": { - "standard": "^11.0.1", - "standard-version": "^8.0.1", - "tap": "^12.7.0" - }, - "homepage": "https://github.com/watilde/meant#readme", - "keywords": [ - "meant" - ], - "license": "MIT", - "main": "index.js", - "name": "meant", - "repository": { - "type": "git", - "url": "git+https://github.com/watilde/meant.git" - }, - "scripts": { - "release": "standard-version", - "test": "standard && tap test.js" - }, - "version": "1.0.2" -} diff --git a/deps/npm/node_modules/meant/test.js b/deps/npm/node_modules/meant/test.js deleted file mode 100644 index bc7ba564be9dd4..00000000000000 --- a/deps/npm/node_modules/meant/test.js +++ /dev/null @@ -1,11 +0,0 @@ -var test = require('tap').test -var meant = require('./') - -test('test vs [\'tast\', \'tbst\', \'tcst\', \'foo\']', function (t) { - var list = meant('test', ['tast', 'tbst', 'tcst', 'foo']) - t.notEqual(list.indexOf('tast'), -1, 'list has tast') - t.notEqual(list.indexOf('tbst'), -1, 'list has tbst') - t.notEqual(list.indexOf('tcst'), -1, 'list has tcst') - t.equal(list.indexOf('foo'), -1, 'list doesn\'t have foo') - t.end() -}) diff --git a/deps/npm/node_modules/mime-db/HISTORY.md b/deps/npm/node_modules/mime-db/HISTORY.md index d71464e5cb12f9..85c0319c817182 100644 --- a/deps/npm/node_modules/mime-db/HISTORY.md +++ b/deps/npm/node_modules/mime-db/HISTORY.md @@ -1,3 +1,65 @@ +1.44.0 / 2020-04-22 +=================== + + * Add charsets from IANA + * Add extension `.cjs` to `application/node` + * Add new upstream MIME types + +1.43.0 / 2020-01-05 +=================== + + * Add `application/x-keepass2` with extension `.kdbx` + * Add extension `.mxmf` to `audio/mobile-xmf` + * Add extensions from IANA for `application/*+xml` types + * Add new upstream MIME types + +1.42.0 / 2019-09-25 +=================== + + * Add `image/vnd.ms-dds` with extension `.dds` + * Add new upstream MIME types + * Remove compressible from `multipart/mixed` + +1.41.0 / 2019-08-30 +=================== + + * Add new upstream MIME types + * Add `application/toml` with extension `.toml` + * Mark `font/ttf` as compressible + +1.40.0 / 2019-04-20 +=================== + + * Add extensions from IANA for `model/*` types + * Add `text/mdx` with extension `.mdx` + +1.39.0 / 2019-04-04 +=================== + + * Add extensions `.siv` and `.sieve` to `application/sieve` + * Add new upstream MIME types + +1.38.0 / 2019-02-04 +=================== + + * Add extension `.nq` to `application/n-quads` + * Add extension `.nt` to `application/n-triples` + * Add new upstream MIME types + * Mark `text/less` as compressible + +1.37.0 / 2018-10-19 +=================== + + * Add extensions to HEIC image types + * Add new upstream MIME types + +1.36.0 / 2018-08-20 +=================== + + * Add Apple file extensions from IANA + * Add extensions from IANA for `image/*` types + * Add new upstream MIME types + 1.35.0 / 2018-07-15 =================== diff --git a/deps/npm/node_modules/mime-db/README.md b/deps/npm/node_modules/mime-db/README.md index fed4eebac6c8f9..d6a6f80aacf1ab 100644 --- a/deps/npm/node_modules/mime-db/README.md +++ b/deps/npm/node_modules/mime-db/README.md @@ -24,21 +24,23 @@ npm install mime-db ### Database Download If you're crazy enough to use this in the browser, you can just grab the -JSON file using [RawGit](https://rawgit.com/). It is recommended to replace -`master` with [a release tag](https://github.com/jshttp/mime-db/tags) as the -JSON format may change in the future. +JSON file using [jsDelivr](https://www.jsdelivr.com/). It is recommended to +replace `master` with [a release tag](https://github.com/jshttp/mime-db/tags) +as the JSON format may change in the future. ``` -https://cdn.rawgit.com/jshttp/mime-db/master/db.json +https://cdn.jsdelivr.net/gh/jshttp/mime-db@master/db.json ``` ## Usage + + ```js -var db = require('mime-db'); +var db = require('mime-db') // grab data on .js files -var data = db['application/javascript']; +var data = db['application/javascript'] ``` ## Data Structure @@ -76,19 +78,25 @@ and the values being an object with the following keys: To update the build, run `npm run build`. -## Adding Custom Media Types +### Adding Custom Media Types The best way to get new media types included in this library is to register them with the IANA. The community registration procedure is outlined in [RFC 6838 section 5](http://tools.ietf.org/html/rfc6838#section-5). Types registered with the IANA are automatically pulled into this library. -[npm-version-image]: https://img.shields.io/npm/v/mime-db.svg -[npm-downloads-image]: https://img.shields.io/npm/dm/mime-db.svg +If that is not possible / feasible, they can be added directly here as a +"custom" type. To do this, it is required to have a primary source that +definitively lists the media type. If an extension is going to be listed as +associateed with this media type, the source must definitively link the +media type and extension as well. + +[coveralls-image]: https://badgen.net/coveralls/c/github/jshttp/mime-db/master +[coveralls-url]: https://coveralls.io/r/jshttp/mime-db?branch=master +[node-image]: https://badgen.net/npm/node/mime-db +[node-url]: https://nodejs.org/en/download +[npm-downloads-image]: https://badgen.net/npm/dm/mime-db [npm-url]: https://npmjs.org/package/mime-db -[travis-image]: https://img.shields.io/travis/jshttp/mime-db/master.svg +[npm-version-image]: https://badgen.net/npm/v/mime-db +[travis-image]: https://badgen.net/travis/jshttp/mime-db/master [travis-url]: https://travis-ci.org/jshttp/mime-db -[coveralls-image]: https://img.shields.io/coveralls/jshttp/mime-db/master.svg -[coveralls-url]: https://coveralls.io/r/jshttp/mime-db?branch=master -[node-image]: https://img.shields.io/node/v/mime-db.svg -[node-url]: https://nodejs.org/en/download/ diff --git a/deps/npm/node_modules/mime-db/db.json b/deps/npm/node_modules/mime-db/db.json index 9736ab8a1147af..e69f352d95a546 100644 --- a/deps/npm/node_modules/mime-db/db.json +++ b/deps/npm/node_modules/mime-db/db.json @@ -4,6 +4,7 @@ }, "application/3gpdash-qoe-report+xml": { "source": "iana", + "charset": "UTF-8", "compressible": true }, "application/3gpp-ims+xml": { @@ -60,6 +61,14 @@ "source": "iana", "compressible": true }, + "application/alto-updatestreamcontrol+json": { + "source": "iana", + "compressible": true + }, + "application/alto-updatestreamparams+json": { + "source": "iana", + "compressible": true + }, "application/aml": { "source": "iana" }, @@ -92,7 +101,8 @@ }, "application/atomdeleted+xml": { "source": "iana", - "compressible": true + "compressible": true, + "extensions": ["atomdeleted"] }, "application/atomicmail": { "source": "iana" @@ -102,6 +112,28 @@ "compressible": true, "extensions": ["atomsvc"] }, + "application/atsc-dwd+xml": { + "source": "iana", + "compressible": true, + "extensions": ["dwd"] + }, + "application/atsc-dynamic-event-message": { + "source": "iana" + }, + "application/atsc-held+xml": { + "source": "iana", + "compressible": true, + "extensions": ["held"] + }, + "application/atsc-rdt+json": { + "source": "iana", + "compressible": true + }, + "application/atsc-rsat+xml": { + "source": "iana", + "compressible": true, + "extensions": ["rsat"] + }, "application/atxml": { "source": "iana" }, @@ -122,6 +154,7 @@ }, "application/beep+xml": { "source": "iana", + "charset": "UTF-8", "compressible": true }, "application/calendar+json": { @@ -130,7 +163,8 @@ }, "application/calendar+xml": { "source": "iana", - "compressible": true + "compressible": true, + "extensions": ["xcs"] }, "application/call-completion": { "source": "iana" @@ -138,9 +172,17 @@ "application/cals-1840": { "source": "iana" }, + "application/cap+xml": { + "source": "iana", + "charset": "UTF-8", + "compressible": true + }, "application/cbor": { "source": "iana" }, + "application/cbor-seq": { + "source": "iana" + }, "application/cccex": { "source": "iana" }, @@ -155,7 +197,8 @@ }, "application/cdfx+xml": { "source": "iana", - "compressible": true + "compressible": true, + "extensions": ["cdfx"] }, "application/cdmi-capability": { "source": "iana", @@ -194,6 +237,10 @@ "application/cfw": { "source": "iana" }, + "application/clue+xml": { + "source": "iana", + "compressible": true + }, "application/clue_info+xml": { "source": "iana", "compressible": true @@ -310,11 +357,17 @@ "source": "iana", "compressible": true }, + "application/dns-message": { + "source": "iana" + }, "application/docbook+xml": { "source": "apache", "compressible": true, "extensions": ["dbk"] }, + "application/dots+cbor": { + "source": "iana" + }, "application/dskpp+xml": { "source": "iana", "compressible": true @@ -388,7 +441,8 @@ }, "application/emotionml+xml": { "source": "iana", - "compressible": true + "compressible": true, + "extensions": ["emotionml"] }, "application/encaprtp": { "source": "iana" @@ -409,6 +463,10 @@ "source": "iana", "extensions": ["exi"] }, + "application/expect-ct-report+json": { + "source": "iana", + "compressible": true + }, "application/fastinfoset": { "source": "iana" }, @@ -417,14 +475,17 @@ }, "application/fdt+xml": { "source": "iana", - "compressible": true + "compressible": true, + "extensions": ["fdt"] }, "application/fhir+json": { "source": "iana", + "charset": "UTF-8", "compressible": true }, "application/fhir+xml": { "source": "iana", + "charset": "UTF-8", "compressible": true }, "application/fido.trusted-apps+json": { @@ -433,6 +494,9 @@ "application/fits": { "source": "iana" }, + "application/flexfec": { + "source": "iana" + }, "application/font-sfnt": { "source": "iana" }, @@ -456,6 +520,9 @@ "application/geo+json-seq": { "source": "iana" }, + "application/geopackage+sqlite3": { + "source": "iana" + }, "application/geoxacml+xml": { "source": "iana", "compressible": true @@ -515,6 +582,7 @@ }, "application/im-iscomposing+xml": { "source": "iana", + "charset": "UTF-8", "compressible": true }, "application/index": { @@ -552,7 +620,8 @@ }, "application/its+xml": { "source": "iana", - "compressible": true + "compressible": true, + "extensions": ["its"] }, "application/java-archive": { "source": "apache", @@ -637,7 +706,8 @@ }, "application/lgr+xml": { "source": "iana", - "compressible": true + "compressible": true, + "extensions": ["lgr"] }, "application/link-format": { "source": "iana" @@ -655,6 +725,10 @@ "source": "iana", "compressible": true }, + "application/lpf+zip": { + "source": "iana", + "compressible": false + }, "application/lxf": { "source": "iana" }, @@ -791,9 +865,18 @@ "application/mikey": { "source": "iana" }, + "application/mipc": { + "source": "iana" + }, + "application/mmt-aei+xml": { + "source": "iana", + "compressible": true, + "extensions": ["maei"] + }, "application/mmt-usd+xml": { "source": "iana", - "compressible": true + "compressible": true, + "extensions": ["musd"] }, "application/mods+xml": { "source": "iana", @@ -831,18 +914,22 @@ }, "application/mrb-consumer+xml": { "source": "iana", - "compressible": true + "compressible": true, + "extensions": ["xdf"] }, "application/mrb-publish+xml": { "source": "iana", - "compressible": true + "compressible": true, + "extensions": ["xdf"] }, "application/msc-ivr+xml": { "source": "iana", + "charset": "UTF-8", "compressible": true }, "application/msc-mixer+xml": { "source": "iana", + "charset": "UTF-8", "compressible": true }, "application/msword": { @@ -854,24 +941,31 @@ "source": "iana", "compressible": true }, + "application/multipart-core": { + "source": "iana" + }, "application/mxf": { "source": "iana", "extensions": ["mxf"] }, "application/n-quads": { - "source": "iana" + "source": "iana", + "extensions": ["nq"] }, "application/n-triples": { - "source": "iana" + "source": "iana", + "extensions": ["nt"] }, "application/nasdata": { "source": "iana" }, "application/news-checkgroups": { - "source": "iana" + "source": "iana", + "charset": "US-ASCII" }, "application/news-groupinfo": { - "source": "iana" + "source": "iana", + "charset": "US-ASCII" }, "application/news-transmission": { "source": "iana" @@ -881,7 +975,8 @@ "compressible": true }, "application/node": { - "source": "iana" + "source": "iana", + "extensions": ["cjs"] }, "application/nss": { "source": "iana" @@ -901,6 +996,10 @@ "source": "iana", "extensions": ["oda"] }, + "application/odm+xml": { + "source": "iana", + "compressible": true + }, "application/odx": { "source": "iana" }, @@ -923,13 +1022,17 @@ "source": "apache", "extensions": ["onetoc","onetoc2","onetmp","onepkg"] }, + "application/oscore": { + "source": "iana" + }, "application/oxps": { "source": "iana", "extensions": ["oxps"] }, "application/p2p-overlay+xml": { "source": "iana", - "compressible": true + "compressible": true, + "extensions": ["relo"] }, "application/parityfec": { "source": "iana" @@ -950,6 +1053,9 @@ "application/pdx": { "source": "iana" }, + "application/pem-certificate-chain": { + "source": "iana" + }, "application/pgp-encrypted": { "source": "iana", "compressible": false, @@ -968,10 +1074,12 @@ }, "application/pidf+xml": { "source": "iana", + "charset": "UTF-8", "compressible": true }, "application/pidf-diff+xml": { "source": "iana", + "charset": "UTF-8", "compressible": true }, "application/pkcs10": { @@ -1023,6 +1131,7 @@ }, "application/poc-settings+xml": { "source": "iana", + "charset": "UTF-8", "compressible": true }, "application/postscript": { @@ -1044,7 +1153,8 @@ }, "application/provenance+xml": { "source": "iana", - "compressible": true + "compressible": true, + "extensions": ["provx"] }, "application/prs.alvestrand.titrax-sheet": { "source": "iana" @@ -1075,6 +1185,10 @@ "compressible": true, "extensions": ["pskcxml"] }, + "application/pvd+json": { + "source": "iana", + "compressible": true + }, "application/qsig": { "source": "iana" }, @@ -1138,15 +1252,18 @@ }, "application/route-apd+xml": { "source": "iana", - "compressible": true + "compressible": true, + "extensions": ["rapd"] }, "application/route-s-tsid+xml": { "source": "iana", - "compressible": true + "compressible": true, + "extensions": ["sls"] }, "application/route-usd+xml": { "source": "iana", - "compressible": true + "compressible": true, + "extensions": ["rusd"] }, "application/rpki-ghostbusters": { "source": "iana", @@ -1195,6 +1312,9 @@ "source": "iana", "compressible": true }, + "application/sbe": { + "source": "iana" + }, "application/sbml+xml": { "source": "iana", "compressible": true, @@ -1239,6 +1359,14 @@ "compressible": true }, "application/senml+xml": { + "source": "iana", + "compressible": true, + "extensions": ["senmlx"] + }, + "application/senml-etch+cbor": { + "source": "iana" + }, + "application/senml-etch+json": { "source": "iana", "compressible": true }, @@ -1254,7 +1382,8 @@ }, "application/sensml+xml": { "source": "iana", - "compressible": true + "compressible": true, + "extensions": ["sensmlx"] }, "application/sensml-exi": { "source": "iana" @@ -1295,7 +1424,8 @@ "extensions": ["shf"] }, "application/sieve": { - "source": "iana" + "source": "iana", + "extensions": ["siv","sieve"] }, "application/simple-filter+xml": { "source": "iana", @@ -1307,6 +1437,9 @@ "application/simplesymbolcontainer": { "source": "iana" }, + "application/sipc": { + "source": "iana" + }, "application/slate": { "source": "iana" }, @@ -1372,6 +1505,11 @@ "source": "iana", "compressible": true }, + "application/swid+xml": { + "source": "iana", + "compressible": true, + "extensions": ["swidtag"] + }, "application/tamp-apex-update": { "source": "iana" }, @@ -1412,11 +1550,18 @@ "source": "iana", "compressible": true }, + "application/td+json": { + "source": "iana", + "compressible": true + }, "application/tei+xml": { "source": "iana", "compressible": true, "extensions": ["tei","teicorpus"] }, + "application/tetra_isi": { + "source": "iana" + }, "application/thraud+xml": { "source": "iana", "compressible": true, @@ -1442,6 +1587,10 @@ "application/tnauthlist": { "source": "iana" }, + "application/toml": { + "compressible": true, + "extensions": ["toml"] + }, "application/trickle-ice-sdpfrag": { "source": "iana" }, @@ -1450,11 +1599,18 @@ }, "application/ttml+xml": { "source": "iana", - "compressible": true + "compressible": true, + "extensions": ["ttml"] }, "application/tve-trigger": { "source": "iana" }, + "application/tzif": { + "source": "iana" + }, + "application/tzif-leap": { + "source": "iana" + }, "application/ulpfec": { "source": "iana" }, @@ -1464,7 +1620,8 @@ }, "application/urc-ressheet+xml": { "source": "iana", - "compressible": true + "compressible": true, + "extensions": ["rsheet"] }, "application/urc-targetdesc+xml": { "source": "iana", @@ -1490,7 +1647,8 @@ }, "application/vnd.1000minds.decision-model+xml": { "source": "iana", - "compressible": true + "compressible": true, + "extensions": ["1km"] }, "application/vnd.3gpp-prose+xml": { "source": "iana", @@ -1515,12 +1673,35 @@ "source": "iana", "compressible": true }, + "application/vnd.3gpp.mc-signalling-ear": { + "source": "iana" + }, + "application/vnd.3gpp.mcdata-affiliation-command+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.mcdata-info+xml": { + "source": "iana", + "compressible": true + }, "application/vnd.3gpp.mcdata-payload": { "source": "iana" }, + "application/vnd.3gpp.mcdata-service-config+xml": { + "source": "iana", + "compressible": true + }, "application/vnd.3gpp.mcdata-signalling": { "source": "iana" }, + "application/vnd.3gpp.mcdata-ue-config+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.mcdata-user-profile+xml": { + "source": "iana", + "compressible": true + }, "application/vnd.3gpp.mcptt-affiliation-command+xml": { "source": "iana", "compressible": true @@ -1541,10 +1722,62 @@ "source": "iana", "compressible": true }, + "application/vnd.3gpp.mcptt-service-config+xml": { + "source": "iana", + "compressible": true + }, "application/vnd.3gpp.mcptt-signed+xml": { "source": "iana", "compressible": true }, + "application/vnd.3gpp.mcptt-ue-config+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.mcptt-ue-init-config+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.mcptt-user-profile+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.mcvideo-affiliation-command+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.mcvideo-affiliation-info+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.mcvideo-info+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.mcvideo-location-info+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.mcvideo-mbms-usage-info+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.mcvideo-service-config+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.mcvideo-transmission-request+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.mcvideo-ue-config+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.mcvideo-user-profile+xml": { + "source": "iana", + "compressible": true + }, "application/vnd.3gpp.mid-call+xml": { "source": "iana", "compressible": true @@ -1652,9 +1885,36 @@ "application/vnd.afpc.afplinedata": { "source": "iana" }, + "application/vnd.afpc.afplinedata-pagedef": { + "source": "iana" + }, + "application/vnd.afpc.foca-charset": { + "source": "iana" + }, + "application/vnd.afpc.foca-codedfont": { + "source": "iana" + }, + "application/vnd.afpc.foca-codepage": { + "source": "iana" + }, "application/vnd.afpc.modca": { "source": "iana" }, + "application/vnd.afpc.modca-formdef": { + "source": "iana" + }, + "application/vnd.afpc.modca-mediummap": { + "source": "iana" + }, + "application/vnd.afpc.modca-objectcontainer": { + "source": "iana" + }, + "application/vnd.afpc.modca-overlay": { + "source": "iana" + }, + "application/vnd.afpc.modca-pagesegment": { + "source": "iana" + }, "application/vnd.ah-barcode": { "source": "iana" }, @@ -1693,6 +1953,9 @@ "source": "iana", "compressible": true }, + "application/vnd.android.ota": { + "source": "iana" + }, "application/vnd.android.package-archive": { "source": "apache", "compressible": false, @@ -1726,6 +1989,10 @@ "source": "iana", "compressible": true }, + "application/vnd.aplextor.warrp+json": { + "source": "iana", + "compressible": true + }, "application/vnd.apothekende.reservation+json": { "source": "iana", "compressible": true @@ -1735,10 +2002,22 @@ "compressible": true, "extensions": ["mpkg"] }, + "application/vnd.apple.keynote": { + "source": "iana", + "extensions": ["keynote"] + }, "application/vnd.apple.mpegurl": { "source": "iana", "extensions": ["m3u8"] }, + "application/vnd.apple.numbers": { + "source": "iana", + "extensions": ["numbers"] + }, + "application/vnd.apple.pages": { + "source": "iana", + "extensions": ["pages"] + }, "application/vnd.apple.pkpass": { "compressible": false, "extensions": ["pkpass"] @@ -1778,7 +2057,8 @@ }, "application/vnd.balsamiq.bmml+xml": { "source": "iana", - "compressible": true + "compressible": true, + "extensions": ["bmml"] }, "application/vnd.balsamiq.bmpr": { "source": "iana" @@ -1786,6 +2066,9 @@ "application/vnd.banana-accounting": { "source": "iana" }, + "application/vnd.bbf.usp.error": { + "source": "iana" + }, "application/vnd.bbf.usp.msg": { "source": "iana" }, @@ -1821,6 +2104,12 @@ "source": "iana", "extensions": ["bmi"] }, + "application/vnd.bpf": { + "source": "iana" + }, + "application/vnd.bpf3": { + "source": "iana" + }, "application/vnd.businessobjects": { "source": "iana", "extensions": ["rep"] @@ -1860,6 +2149,9 @@ "source": "iana", "extensions": ["mmd"] }, + "application/vnd.ciedi": { + "source": "iana" + }, "application/vnd.cinderella": { "source": "iana", "extensions": ["cdy"] @@ -1976,6 +2268,13 @@ "compressible": true, "extensions": ["wbs"] }, + "application/vnd.cryptii.pipe+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.crypto-shade-file": { + "source": "iana" + }, "application/vnd.ctc-posml": { "source": "iana", "extensions": ["pml"] @@ -2039,6 +2338,9 @@ "source": "iana", "compressible": true }, + "application/vnd.dbf": { + "source": "iana" + }, "application/vnd.debian.binary-package": { "source": "iana" }, @@ -2063,11 +2365,8 @@ "source": "iana", "extensions": ["fe_launch"] }, - "application/vnd.desmume-movie": { - "source": "iana" - }, "application/vnd.desmume.movie": { - "source": "apache" + "source": "iana" }, "application/vnd.dir-bi.plate-dl-nosuffix": { "source": "iana" @@ -2126,6 +2425,10 @@ "source": "iana", "extensions": ["ait"] }, + "application/vnd.dvb.dvbisl+xml": { + "source": "iana", + "compressible": true + }, "application/vnd.dvb.dvbj": { "source": "iana" }, @@ -2376,6 +2679,13 @@ "application/vnd.evolv.ecig.theme": { "source": "iana" }, + "application/vnd.exstream-empower+zip": { + "source": "iana", + "compressible": false + }, + "application/vnd.exstream-package": { + "source": "iana" + }, "application/vnd.ezpix-album": { "source": "iana", "extensions": ["ez2"] @@ -2405,6 +2715,10 @@ "application/vnd.ffsns": { "source": "iana" }, + "application/vnd.ficlab.flb+zip": { + "source": "iana", + "compressible": false + }, "application/vnd.filmit.zfc": { "source": "iana" }, @@ -2488,6 +2802,13 @@ "application/vnd.fut-misnet": { "source": "iana" }, + "application/vnd.futoin+cbor": { + "source": "iana" + }, + "application/vnd.futoin+json": { + "source": "iana", + "compressible": true + }, "application/vnd.fuzzysheet": { "source": "iana", "extensions": ["fzs"] @@ -2496,6 +2817,10 @@ "source": "iana", "extensions": ["txd"] }, + "application/vnd.gentics.grd+json": { + "source": "iana", + "compressible": true + }, "application/vnd.geo+json": { "source": "iana", "compressible": true @@ -2862,6 +3187,10 @@ "source": "iana", "extensions": ["fcs"] }, + "application/vnd.iso11783-10+zip": { + "source": "iana", + "compressible": false + }, "application/vnd.jam": { "source": "iana", "extensions": ["jam"] @@ -2961,6 +3290,9 @@ "source": "iana", "extensions": ["sse"] }, + "application/vnd.las": { + "source": "iana" + }, "application/vnd.las.las+json": { "source": "iana", "compressible": true @@ -2970,6 +3302,9 @@ "compressible": true, "extensions": ["lasxml"] }, + "application/vnd.laszip": { + "source": "iana" + }, "application/vnd.leap+json": { "source": "iana", "compressible": true @@ -2987,6 +3322,13 @@ "compressible": true, "extensions": ["lbe"] }, + "application/vnd.logipipe.circuit+zip": { + "source": "iana", + "compressible": false + }, + "application/vnd.loom": { + "source": "iana" + }, "application/vnd.lotus-1-2-3": { "source": "iana", "extensions": ["123"] @@ -3445,7 +3787,8 @@ }, "application/vnd.nokia.n-gage.ac+xml": { "source": "iana", - "compressible": true + "compressible": true, + "extensions": ["ac"] }, "application/vnd.nokia.n-gage.data": { "source": "iana", @@ -3578,6 +3921,10 @@ "application/vnd.ocf+cbor": { "source": "iana" }, + "application/vnd.oci.image.manifest.v1+json": { + "source": "iana", + "compressible": true + }, "application/vnd.oftn.l10n+json": { "source": "iana", "compressible": true @@ -3766,14 +4113,17 @@ }, "application/vnd.omads-email+xml": { "source": "iana", + "charset": "UTF-8", "compressible": true }, "application/vnd.omads-file+xml": { "source": "iana", + "charset": "UTF-8", "compressible": true }, "application/vnd.omads-folder+xml": { "source": "iana", + "charset": "UTF-8", "compressible": true }, "application/vnd.omaloc-supl-init": { @@ -3799,7 +4149,8 @@ }, "application/vnd.openblox.game+xml": { "source": "iana", - "compressible": true + "compressible": true, + "extensions": ["obgx"] }, "application/vnd.openblox.game-binary": { "source": "iana" @@ -3813,7 +4164,8 @@ }, "application/vnd.openstreetmap.data+xml": { "source": "iana", - "compressible": true + "compressible": true, + "extensions": ["osm"] }, "application/vnd.openxmlformats-officedocument.custom-properties+xml": { "source": "iana", @@ -4156,16 +4508,15 @@ "application/vnd.panoply": { "source": "iana" }, - "application/vnd.paos+xml": { - "source": "iana", - "compressible": true - }, "application/vnd.paos.xml": { - "source": "apache" + "source": "iana" }, "application/vnd.patentdive": { "source": "iana" }, + "application/vnd.patientecommsdoc": { + "source": "iana" + }, "application/vnd.pawaafile": { "source": "iana", "extensions": ["paw"] @@ -4384,6 +4735,9 @@ "source": "iana", "extensions": ["st"] }, + "application/vnd.sar": { + "source": "iana" + }, "application/vnd.sbm.cid": { "source": "iana" }, @@ -4442,6 +4796,9 @@ "source": "iana", "extensions": ["semf"] }, + "application/vnd.shade-save-file": { + "source": "iana" + }, "application/vnd.shana.informed.formdata": { "source": "iana", "extensions": ["ifm"] @@ -4462,6 +4819,16 @@ "source": "iana", "compressible": true }, + "application/vnd.shopkick+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.shp": { + "source": "iana" + }, + "application/vnd.shx": { + "source": "iana" + }, "application/vnd.sigrok.session": { "source": "iana" }, @@ -4484,9 +4851,13 @@ "source": "iana", "extensions": ["teacher"] }, + "application/vnd.snesdev-page-table": { + "source": "iana" + }, "application/vnd.software602.filler.form+xml": { "source": "iana", - "compressible": true + "compressible": true, + "extensions": ["fo"] }, "application/vnd.software602.filler.form-xml-zip": { "source": "iana" @@ -4613,15 +4984,18 @@ }, "application/vnd.syncml+xml": { "source": "iana", + "charset": "UTF-8", "compressible": true, "extensions": ["xsm"] }, "application/vnd.syncml.dm+wbxml": { "source": "iana", + "charset": "UTF-8", "extensions": ["bdm"] }, "application/vnd.syncml.dm+xml": { "source": "iana", + "charset": "UTF-8", "compressible": true, "extensions": ["xdm"] }, @@ -4633,13 +5007,16 @@ }, "application/vnd.syncml.dmddf+xml": { "source": "iana", - "compressible": true + "charset": "UTF-8", + "compressible": true, + "extensions": ["ddf"] }, "application/vnd.syncml.dmtnds+wbxml": { "source": "iana" }, "application/vnd.syncml.dmtnds+xml": { "source": "iana", + "charset": "UTF-8", "compressible": true }, "application/vnd.syncml.ds.notification": { @@ -4776,6 +5153,12 @@ "application/vnd.verimatrix.vcas": { "source": "iana" }, + "application/vnd.veryant.thin": { + "source": "iana" + }, + "application/vnd.ves.encrypted": { + "source": "iana" + }, "application/vnd.vidsoft.vidconference": { "source": "iana" }, @@ -4802,6 +5185,7 @@ }, "application/vnd.wap.wbxml": { "source": "iana", + "charset": "UTF-8", "extensions": ["wbxml"] }, "application/vnd.wap.wmlc": { @@ -5264,6 +5648,9 @@ "application/x-javascript": { "compressible": true }, + "application/x-keepass2": { + "extensions": ["kdbx"] + }, "application/x-latex": { "source": "apache", "compressible": false, @@ -5395,6 +5782,9 @@ "source": "apache", "extensions": ["p7r"] }, + "application/x-pki-message": { + "source": "iana" + }, "application/x-rar-compressed": { "source": "apache", "compressible": false, @@ -5537,9 +5927,15 @@ "compressible": true }, "application/x-x509-ca-cert": { - "source": "apache", + "source": "iana", "extensions": ["der","crt","pem"] }, + "application/x-x509-ca-ra-cert": { + "source": "iana" + }, + "application/x-x509-next-ca-cert": { + "source": "iana" + }, "application/x-xfig": { "source": "apache", "extensions": ["fig"] @@ -5576,11 +5972,13 @@ }, "application/xcap-att+xml": { "source": "iana", - "compressible": true + "compressible": true, + "extensions": ["xav"] }, "application/xcap-caps+xml": { "source": "iana", - "compressible": true + "compressible": true, + "extensions": ["xca"] }, "application/xcap-diff+xml": { "source": "iana", @@ -5589,15 +5987,18 @@ }, "application/xcap-el+xml": { "source": "iana", - "compressible": true + "compressible": true, + "extensions": ["xel"] }, "application/xcap-error+xml": { "source": "iana", - "compressible": true + "compressible": true, + "extensions": ["xer"] }, "application/xcap-ns+xml": { "source": "iana", - "compressible": true + "compressible": true, + "extensions": ["xns"] }, "application/xcon-conference-info+xml": { "source": "iana", @@ -5623,7 +6024,8 @@ }, "application/xliff+xml": { "source": "iana", - "compressible": true + "compressible": true, + "extensions": ["xlf"] }, "application/xml": { "source": "iana", @@ -5704,6 +6106,9 @@ "application/zlib": { "source": "iana" }, + "application/zstd": { + "source": "iana" + }, "audio/1d-interleaved-parityfec": { "source": "iana" }, @@ -5841,6 +6246,9 @@ "audio/evs": { "source": "iana" }, + "audio/flexfec": { + "source": "iana" + }, "audio/fwdred": { "source": "iana" }, @@ -5932,12 +6340,16 @@ "audio/melp600": { "source": "iana" }, + "audio/mhas": { + "source": "iana" + }, "audio/midi": { "source": "apache", "extensions": ["mid","midi","kar","rmi"] }, "audio/mobile-xmf": { - "source": "iana" + "source": "iana", + "extensions": ["mxmf"] }, "audio/mp3": { "compressible": false, @@ -6047,6 +6459,12 @@ "audio/telephone-event": { "source": "iana" }, + "audio/tetra_acelp": { + "source": "iana" + }, + "audio/tetra_acelp_bb": { + "source": "iana" + }, "audio/tone": { "source": "iana" }, @@ -6136,6 +6554,9 @@ "source": "iana", "extensions": ["dtshd"] }, + "audio/vnd.dts.uhd": { + "source": "iana" + }, "audio/vnd.dvb.file": { "source": "iana" }, @@ -6321,6 +6742,7 @@ }, "font/ttf": { "source": "iana", + "compressible": true, "extensions": ["ttf"] }, "font/woff": { @@ -6332,12 +6754,19 @@ "extensions": ["woff2"] }, "image/aces": { - "source": "iana" + "source": "iana", + "extensions": ["exr"] }, "image/apng": { "compressible": false, "extensions": ["apng"] }, + "image/avci": { + "source": "iana" + }, + "image/avcs": { + "source": "iana" + }, "image/bmp": { "source": "iana", "compressible": true, @@ -6348,13 +6777,16 @@ "extensions": ["cgm"] }, "image/dicom-rle": { - "source": "iana" + "source": "iana", + "extensions": ["drle"] }, "image/emf": { - "source": "iana" + "source": "iana", + "extensions": ["emf"] }, "image/fits": { - "source": "iana" + "source": "iana", + "extensions": ["fits"] }, "image/g3fax": { "source": "iana", @@ -6365,12 +6797,37 @@ "compressible": false, "extensions": ["gif"] }, + "image/heic": { + "source": "iana", + "extensions": ["heic"] + }, + "image/heic-sequence": { + "source": "iana", + "extensions": ["heics"] + }, + "image/heif": { + "source": "iana", + "extensions": ["heif"] + }, + "image/heif-sequence": { + "source": "iana", + "extensions": ["heifs"] + }, + "image/hej2k": { + "source": "iana", + "extensions": ["hej2"] + }, + "image/hsj2": { + "source": "iana", + "extensions": ["hsj2"] + }, "image/ief": { "source": "iana", "extensions": ["ief"] }, "image/jls": { - "source": "iana" + "source": "iana", + "extensions": ["jls"] }, "image/jp2": { "source": "iana", @@ -6382,6 +6839,14 @@ "compressible": false, "extensions": ["jpeg","jpg","jpe"] }, + "image/jph": { + "source": "iana", + "extensions": ["jph"] + }, + "image/jphc": { + "source": "iana", + "extensions": ["jhc"] + }, "image/jpm": { "source": "iana", "compressible": false, @@ -6392,6 +6857,34 @@ "compressible": false, "extensions": ["jpx","jpf"] }, + "image/jxr": { + "source": "iana", + "extensions": ["jxr"] + }, + "image/jxra": { + "source": "iana", + "extensions": ["jxra"] + }, + "image/jxrs": { + "source": "iana", + "extensions": ["jxrs"] + }, + "image/jxs": { + "source": "iana", + "extensions": ["jxs"] + }, + "image/jxsc": { + "source": "iana", + "extensions": ["jxsc"] + }, + "image/jxsi": { + "source": "iana", + "extensions": ["jxsi"] + }, + "image/jxss": { + "source": "iana", + "extensions": ["jxss"] + }, "image/ktx": { "source": "iana", "extensions": ["ktx"] @@ -6412,7 +6905,8 @@ "extensions": ["btif"] }, "image/prs.pti": { - "source": "iana" + "source": "iana", + "extensions": ["pti"] }, "image/pwg-raster": { "source": "iana" @@ -6427,15 +6921,17 @@ "extensions": ["svg","svgz"] }, "image/t38": { - "source": "iana" + "source": "iana", + "extensions": ["t38"] }, "image/tiff": { "source": "iana", "compressible": false, - "extensions": ["tiff","tif"] + "extensions": ["tif","tiff"] }, "image/tiff-fx": { - "source": "iana" + "source": "iana", + "extensions": ["tfx"] }, "image/vnd.adobe.photoshop": { "source": "iana", @@ -6443,7 +6939,8 @@ "extensions": ["psd"] }, "image/vnd.airzip.accelerator.azv": { - "source": "iana" + "source": "iana", + "extensions": ["azv"] }, "image/vnd.cns.inf2": { "source": "iana" @@ -6492,7 +6989,8 @@ "source": "iana" }, "image/vnd.microsoft.icon": { - "source": "iana" + "source": "iana", + "extensions": ["ico"] }, "image/vnd.mix": { "source": "iana" @@ -6500,6 +6998,9 @@ "image/vnd.mozilla.apng": { "source": "iana" }, + "image/vnd.ms-dds": { + "extensions": ["dds"] + }, "image/vnd.ms-modi": { "source": "iana", "extensions": ["mdi"] @@ -6528,10 +7029,12 @@ "source": "iana" }, "image/vnd.tencent.tap": { - "source": "iana" + "source": "iana", + "extensions": ["tap"] }, "image/vnd.valve.source.texture": { - "source": "iana" + "source": "iana", + "extensions": ["vtf"] }, "image/vnd.wap.wbmp": { "source": "iana", @@ -6542,14 +7045,16 @@ "extensions": ["xif"] }, "image/vnd.zbrush.pcx": { - "source": "iana" + "source": "iana", + "extensions": ["pcx"] }, "image/webp": { "source": "apache", "extensions": ["webp"] }, "image/wmf": { - "source": "iana" + "source": "iana", + "extensions": ["wmf"] }, "image/x-3ds": { "source": "apache", @@ -6706,7 +7211,8 @@ "extensions": ["wsc"] }, "model/3mf": { - "source": "iana" + "source": "iana", + "extensions": ["3mf"] }, "model/gltf+json": { "source": "iana", @@ -6728,8 +7234,17 @@ "compressible": false, "extensions": ["msh","mesh","silo"] }, + "model/mtl": { + "source": "iana", + "extensions": ["mtl"] + }, + "model/obj": { + "source": "iana", + "extensions": ["obj"] + }, "model/stl": { - "source": "iana" + "source": "iana", + "extensions": ["stl"] }, "model/vnd.collada+xml": { "source": "iana", @@ -6766,23 +7281,28 @@ "extensions": ["mts"] }, "model/vnd.opengex": { - "source": "iana" + "source": "iana", + "extensions": ["ogex"] }, "model/vnd.parasolid.transmit.binary": { - "source": "iana" + "source": "iana", + "extensions": ["x_b"] }, "model/vnd.parasolid.transmit.text": { - "source": "iana" + "source": "iana", + "extensions": ["x_t"] }, "model/vnd.rosette.annotated-data-model": { "source": "iana" }, "model/vnd.usdz+zip": { "source": "iana", - "compressible": false + "compressible": false, + "extensions": ["usdz"] }, "model/vnd.valve.source.compiled-map": { - "source": "iana" + "source": "iana", + "extensions": ["bsp"] }, "model/vnd.vtu": { "source": "iana", @@ -6799,7 +7319,8 @@ "extensions": ["x3db","x3dbz"] }, "model/x3d+fastinfoset": { - "source": "iana" + "source": "iana", + "extensions": ["x3db"] }, "model/x3d+vrml": { "source": "apache", @@ -6812,7 +7333,8 @@ "extensions": ["x3d","x3dz"] }, "model/x3d-vrml": { - "source": "iana" + "source": "iana", + "extensions": ["x3dv"] }, "multipart/alternative": { "source": "iana", @@ -6839,8 +7361,7 @@ "source": "iana" }, "multipart/mixed": { - "source": "iana", - "compressible": false + "source": "iana" }, "multipart/multilingual": { "source": "iana" @@ -6918,6 +7439,9 @@ "text/enriched": { "source": "iana" }, + "text/flexfec": { + "source": "iana" + }, "text/fwdred": { "source": "iana" }, @@ -6944,6 +7468,7 @@ "extensions": ["jsx"] }, "text/less": { + "compressible": true, "extensions": ["less"] }, "text/markdown": { @@ -6955,16 +7480,22 @@ "source": "nginx", "extensions": ["mml"] }, + "text/mdx": { + "compressible": true, + "extensions": ["mdx"] + }, "text/mizar": { "source": "iana" }, "text/n3": { "source": "iana", + "charset": "UTF-8", "compressible": true, "extensions": ["n3"] }, "text/parameters": { - "source": "iana" + "source": "iana", + "charset": "UTF-8" }, "text/parityfec": { "source": "iana" @@ -6975,7 +7506,8 @@ "extensions": ["txt","text","conf","def","list","log","in","ini"] }, "text/provenance-notation": { - "source": "iana" + "source": "iana", + "charset": "UTF-8" }, "text/prs.fallenstein.rst": { "source": "iana" @@ -7087,7 +7619,8 @@ "extensions": ["scurl"] }, "text/vnd.debian.copyright": { - "source": "iana" + "source": "iana", + "charset": "UTF-8" }, "text/vnd.dmclientscript": { "source": "iana" @@ -7097,6 +7630,10 @@ "extensions": ["sub"] }, "text/vnd.esmertec.theme-descriptor": { + "source": "iana", + "charset": "UTF-8" + }, + "text/vnd.ficlab.flt": { "source": "iana" }, "text/vnd.fly": { @@ -7146,15 +7683,23 @@ "text/vnd.radisys.msml-basic-layout": { "source": "iana" }, + "text/vnd.senx.warpscript": { + "source": "iana" + }, "text/vnd.si.uricatalogue": { "source": "iana" }, + "text/vnd.sosi": { + "source": "iana" + }, "text/vnd.sun.j2me.app-descriptor": { "source": "iana", + "charset": "UTF-8", "extensions": ["jad"] }, "text/vnd.trolltech.linguist": { - "source": "iana" + "source": "iana", + "charset": "UTF-8" }, "text/vnd.wap.si": { "source": "iana" @@ -7171,6 +7716,7 @@ "extensions": ["wmls"] }, "text/vtt": { + "source": "iana", "charset": "UTF-8", "compressible": true, "extensions": ["vtt"] @@ -7301,6 +7847,9 @@ "video/encaprtp": { "source": "iana" }, + "video/flexfec": { + "source": "iana" + }, "video/h261": { "source": "iana", "extensions": ["h261"] @@ -7421,6 +7970,9 @@ "video/vc1": { "source": "iana" }, + "video/vc2": { + "source": "iana" + }, "video/vnd.cctv": { "source": "iana" }, @@ -7537,6 +8089,9 @@ "source": "iana", "extensions": ["viv"] }, + "video/vnd.youtube.yt": { + "source": "iana" + }, "video/vp8": { "source": "iana" }, diff --git a/deps/npm/node_modules/mime-db/package.json b/deps/npm/node_modules/mime-db/package.json index c176f396951e0c..dd40869baa5f3d 100644 --- a/deps/npm/node_modules/mime-db/package.json +++ b/deps/npm/node_modules/mime-db/package.json @@ -1,69 +1,41 @@ { - "_from": "mime-db@~1.35.0", - "_id": "mime-db@1.35.0", - "_inBundle": false, - "_integrity": "sha512-JWT/IcCTsB0Io3AhWUMjRqucrHSPsSf2xKLaRldJVULioggvkJvggZ3VXNNSRkCddE6D+BUI4HEIZIA2OjwIvg==", - "_location": "/mime-db", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "mime-db@~1.35.0", - "name": "mime-db", - "escapedName": "mime-db", - "rawSpec": "~1.35.0", - "saveSpec": null, - "fetchSpec": "~1.35.0" - }, - "_requiredBy": [ - "/mime-types" - ], - "_resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.35.0.tgz", - "_shasum": "0569d657466491283709663ad379a99b90d9ab47", - "_spec": "mime-db@~1.35.0", - "_where": "/Users/zkat/Documents/code/work/npm/node_modules/mime-types", - "bugs": { - "url": "https://github.com/jshttp/mime-db/issues" - }, - "bundleDependencies": false, + "name": "mime-db", + "description": "Media Type Database", + "version": "1.44.0", "contributors": [ - { - "name": "Douglas Christopher Wilson", - "email": "doug@somethingdoug.com" - }, - { - "name": "Jonathan Ong", - "email": "me@jongleberry.com", - "url": "http://jongleberry.com" - }, - { - "name": "Robert Kieffer", - "email": "robert@broofa.com", - "url": "http://github.com/broofa" - } + "Douglas Christopher Wilson ", + "Jonathan Ong (http://jongleberry.com)", + "Robert Kieffer (http://github.com/broofa)" ], - "deprecated": false, - "description": "Media Type Database", + "license": "MIT", + "keywords": [ + "mime", + "db", + "type", + "types", + "database", + "charset", + "charsets" + ], + "repository": "jshttp/mime-db", "devDependencies": { - "bluebird": "3.5.1", + "bluebird": "3.7.2", "co": "4.6.0", "cogent": "1.0.1", - "csv-parse": "2.5.0", - "eslint": "4.19.1", - "eslint-config-standard": "11.0.0", - "eslint-plugin-import": "2.13.0", - "eslint-plugin-node": "6.0.1", - "eslint-plugin-promise": "3.8.0", - "eslint-plugin-standard": "3.1.0", + "csv-parse": "4.8.9", + "eslint": "6.8.0", + "eslint-config-standard": "14.1.1", + "eslint-plugin-import": "2.20.2", + "eslint-plugin-markdown": "1.0.2", + "eslint-plugin-node": "11.1.0", + "eslint-plugin-promise": "4.2.1", + "eslint-plugin-standard": "4.0.1", "gnode": "0.1.2", - "mocha": "1.21.5", - "nyc": "11.8.0", - "raw-body": "2.3.3", + "mocha": "7.1.1", + "nyc": "15.0.1", + "raw-body": "2.4.1", "stream-to-array": "2.3.0" }, - "engines": { - "node": ">= 0.6" - }, "files": [ "HISTORY.md", "LICENSE", @@ -71,30 +43,17 @@ "db.json", "index.js" ], - "homepage": "https://github.com/jshttp/mime-db#readme", - "keywords": [ - "mime", - "db", - "type", - "types", - "database", - "charset", - "charsets" - ], - "license": "MIT", - "name": "mime-db", - "repository": { - "type": "git", - "url": "git+https://github.com/jshttp/mime-db.git" + "engines": { + "node": ">= 0.6" }, "scripts": { "build": "node scripts/build", "fetch": "node scripts/fetch-apache && gnode scripts/fetch-iana && node scripts/fetch-nginx", - "lint": "eslint .", + "lint": "eslint --plugin markdown --ext js,md .", "test": "mocha --reporter spec --bail --check-leaks test/", "test-cov": "nyc --reporter=html --reporter=text npm test", "test-travis": "nyc --reporter=text npm test", - "update": "npm run fetch && npm run build" - }, - "version": "1.35.0" + "update": "npm run fetch && npm run build", + "version": "node scripts/version-history.js && git add HISTORY.md" + } } diff --git a/deps/npm/node_modules/mime-types/HISTORY.md b/deps/npm/node_modules/mime-types/HISTORY.md index 802f139c1cdb11..e93149ae9f9083 100644 --- a/deps/npm/node_modules/mime-types/HISTORY.md +++ b/deps/npm/node_modules/mime-types/HISTORY.md @@ -1,3 +1,66 @@ +2.1.27 / 2020-04-23 +=================== + + * deps: mime-db@1.44.0 + - Add charsets from IANA + - Add extension `.cjs` to `application/node` + - Add new upstream MIME types + +2.1.26 / 2020-01-05 +=================== + + * deps: mime-db@1.43.0 + - Add `application/x-keepass2` with extension `.kdbx` + - Add extension `.mxmf` to `audio/mobile-xmf` + - Add extensions from IANA for `application/*+xml` types + - Add new upstream MIME types + +2.1.25 / 2019-11-12 +=================== + + * deps: mime-db@1.42.0 + - Add new upstream MIME types + - Add `application/toml` with extension `.toml` + - Add `image/vnd.ms-dds` with extension `.dds` + +2.1.24 / 2019-04-20 +=================== + + * deps: mime-db@1.40.0 + - Add extensions from IANA for `model/*` types + - Add `text/mdx` with extension `.mdx` + +2.1.23 / 2019-04-17 +=================== + + * deps: mime-db@~1.39.0 + - Add extensions `.siv` and `.sieve` to `application/sieve` + - Add new upstream MIME types + +2.1.22 / 2019-02-14 +=================== + + * deps: mime-db@~1.38.0 + - Add extension `.nq` to `application/n-quads` + - Add extension `.nt` to `application/n-triples` + - Add new upstream MIME types + - Mark `text/less` as compressible + +2.1.21 / 2018-10-19 +=================== + + * deps: mime-db@~1.37.0 + - Add extensions to HEIC image types + - Add new upstream MIME types + +2.1.20 / 2018-08-26 +=================== + + * deps: mime-db@~1.36.0 + - Add Apple file extensions from IANA + - Add extensions from IANA for `image/*` types + - Add new upstream MIME types + 2.1.19 / 2018-07-17 =================== diff --git a/deps/npm/node_modules/mime-types/README.md b/deps/npm/node_modules/mime-types/README.md index b58cae6d286d65..3863339aa3f7a8 100644 --- a/deps/npm/node_modules/mime-types/README.md +++ b/deps/npm/node_modules/mime-types/README.md @@ -1,7 +1,7 @@ # mime-types -[![NPM Version][npm-image]][npm-url] -[![NPM Downloads][downloads-image]][downloads-url] +[![NPM Version][npm-version-image]][npm-url] +[![NPM Downloads][npm-downloads-image]][npm-url] [![Node.js Version][node-version-image]][node-version-url] [![Build Status][travis-image]][travis-url] [![Test Coverage][coveralls-image]][coveralls-url] @@ -36,6 +36,8 @@ so open a PR there if you'd like to add mime types. ## API + + ```js var mime = require('mime-types') ``` @@ -46,11 +48,13 @@ All functions return `false` if input is invalid or not found. Lookup the content-type associated with a file. + + ```js -mime.lookup('json') // 'application/json' -mime.lookup('.md') // 'text/markdown' -mime.lookup('file.html') // 'text/html' -mime.lookup('folder/file.js') // 'application/javascript' +mime.lookup('json') // 'application/json' +mime.lookup('.md') // 'text/markdown' +mime.lookup('file.html') // 'text/html' +mime.lookup('folder/file.js') // 'application/javascript' mime.lookup('folder/.htaccess') // false mime.lookup('cats') // false @@ -59,10 +63,18 @@ mime.lookup('cats') // false ### mime.contentType(type) Create a full content-type header given a content-type or extension. +When given an extension, `mime.lookup` is used to get the matching +content-type, otherwise the given content-type is used. Then if the +content-type does not already have a `charset` parameter, `mime.charset` +is used to get the default charset and add to the returned content-type. + + ```js -mime.contentType('markdown') // 'text/x-markdown; charset=utf-8' +mime.contentType('markdown') // 'text/x-markdown; charset=utf-8' mime.contentType('file.json') // 'application/json; charset=utf-8' +mime.contentType('text/html') // 'text/html; charset=utf-8' +mime.contentType('text/html; charset=iso-8859-1') // 'text/html; charset=iso-8859-1' // from a full path mime.contentType(path.extname('/path/to/file.json')) // 'application/json; charset=utf-8' @@ -72,6 +84,8 @@ mime.contentType(path.extname('/path/to/file.json')) // 'application/json; chars Get the default extension for a content-type. + + ```js mime.extension('application/octet-stream') // 'bin' ``` @@ -80,6 +94,8 @@ mime.extension('application/octet-stream') // 'bin' Lookup the implied default charset of a content-type. + + ```js mime.charset('text/markdown') // 'UTF-8' ``` @@ -96,13 +112,12 @@ A map of extensions by content-type. [MIT](LICENSE) -[npm-image]: https://img.shields.io/npm/v/mime-types.svg +[coveralls-image]: https://badgen.net/coveralls/c/github/jshttp/mime-types/master +[coveralls-url]: https://coveralls.io/r/jshttp/mime-types?branch=master +[node-version-image]: https://badgen.net/npm/node/mime-types +[node-version-url]: https://nodejs.org/en/download +[npm-downloads-image]: https://badgen.net/npm/dm/mime-types [npm-url]: https://npmjs.org/package/mime-types -[node-version-image]: https://img.shields.io/node/v/mime-types.svg -[node-version-url]: https://nodejs.org/en/download/ -[travis-image]: https://img.shields.io/travis/jshttp/mime-types/master.svg +[npm-version-image]: https://badgen.net/npm/v/mime-types +[travis-image]: https://badgen.net/travis/jshttp/mime-types/master [travis-url]: https://travis-ci.org/jshttp/mime-types -[coveralls-image]: https://img.shields.io/coveralls/jshttp/mime-types/master.svg -[coveralls-url]: https://coveralls.io/r/jshttp/mime-types -[downloads-image]: https://img.shields.io/npm/dm/mime-types.svg -[downloads-url]: https://npmjs.org/package/mime-types diff --git a/deps/npm/node_modules/mime-types/package.json b/deps/npm/node_modules/mime-types/package.json index 1bc76ab0304c94..53100eba038aa6 100644 --- a/deps/npm/node_modules/mime-types/package.json +++ b/deps/npm/node_modules/mime-types/package.json @@ -1,92 +1,44 @@ { - "_from": "mime-types@2.1.19", - "_id": "mime-types@2.1.19", - "_inBundle": false, - "_integrity": "sha512-P1tKYHVSZ6uFo26mtnve4HQFE3koh1UWVkp8YUC+ESBHe945xWSoXuHHiGarDqcEZ+whpCDnlNw5LON0kLo+sw==", - "_location": "/mime-types", - "_phantomChildren": {}, - "_requested": { - "type": "version", - "registry": true, - "raw": "mime-types@2.1.19", - "name": "mime-types", - "escapedName": "mime-types", - "rawSpec": "2.1.19", - "saveSpec": null, - "fetchSpec": "2.1.19" - }, - "_requiredBy": [ - "#USER", - "/", - "/cloudant-follow/form-data", - "/cloudant-follow/request", - "/form-data", - "/nano/form-data", - "/nano/request" - ], - "_resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.19.tgz", - "_shasum": "71e464537a7ef81c15f2db9d97e913fc0ff606f0", - "_spec": "mime-types@2.1.19", - "_where": "/Users/zkat/Documents/code/work/npm", - "bugs": { - "url": "https://github.com/jshttp/mime-types/issues" - }, - "bundleDependencies": false, + "name": "mime-types", + "description": "The ultimate javascript content-type utility.", + "version": "2.1.27", "contributors": [ - { - "name": "Douglas Christopher Wilson", - "email": "doug@somethingdoug.com" - }, - { - "name": "Jeremiah Senkpiel", - "email": "fishrock123@rocketmail.com", - "url": "https://searchbeam.jit.su" - }, - { - "name": "Jonathan Ong", - "email": "me@jongleberry.com", - "url": "http://jongleberry.com" - } + "Douglas Christopher Wilson ", + "Jeremiah Senkpiel (https://searchbeam.jit.su)", + "Jonathan Ong (http://jongleberry.com)" + ], + "license": "MIT", + "keywords": [ + "mime", + "types" ], + "repository": "jshttp/mime-types", "dependencies": { - "mime-db": "~1.35.0" + "mime-db": "1.44.0" }, - "deprecated": false, - "description": "The ultimate javascript content-type utility.", "devDependencies": { - "eslint": "4.19.1", - "eslint-config-standard": "11.0.0", - "eslint-plugin-import": "2.13.0", - "eslint-plugin-node": "6.0.1", - "eslint-plugin-promise": "3.8.0", - "eslint-plugin-standard": "3.1.0", - "istanbul": "0.4.5", - "mocha": "1.21.5" - }, - "engines": { - "node": ">= 0.6" + "eslint": "6.8.0", + "eslint-config-standard": "14.1.1", + "eslint-plugin-import": "2.20.2", + "eslint-plugin-markdown": "1.0.2", + "eslint-plugin-node": "11.1.0", + "eslint-plugin-promise": "4.2.1", + "eslint-plugin-standard": "4.0.1", + "mocha": "7.1.1", + "nyc": "15.0.1" }, "files": [ "HISTORY.md", "LICENSE", "index.js" ], - "homepage": "https://github.com/jshttp/mime-types#readme", - "keywords": [ - "mime", - "types" - ], - "license": "MIT", - "name": "mime-types", - "repository": { - "type": "git", - "url": "git+https://github.com/jshttp/mime-types.git" + "engines": { + "node": ">= 0.6" }, "scripts": { - "lint": "eslint .", + "lint": "eslint --plugin markdown --ext js,md .", "test": "mocha --reporter spec test/test.js", - "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot test/test.js", - "test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter dot test/test.js" - }, - "version": "2.1.19" + "test-cov": "nyc --reporter=html --reporter=text npm test", + "test-travis": "nyc --reporter=text npm test" + } } diff --git a/deps/npm/node_modules/minimatch/package.json b/deps/npm/node_modules/minimatch/package.json index bd211926ffdd30..c4514c807776de 100644 --- a/deps/npm/node_modules/minimatch/package.json +++ b/deps/npm/node_modules/minimatch/package.json @@ -1,69 +1,30 @@ { - "_from": "minimatch@^3.0.4", - "_id": "minimatch@3.0.4", - "_inBundle": false, - "_integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", - "_location": "/minimatch", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "minimatch@^3.0.4", - "name": "minimatch", - "escapedName": "minimatch", - "rawSpec": "^3.0.4", - "saveSpec": null, - "fetchSpec": "^3.0.4" + "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" }, - "_requiredBy": [ - "/eslint", - "/eslint-plugin-import", - "/eslint-plugin-node", - "/glob", - "/ignore-walk", - "/node-gyp", - "/pacote" - ], - "_resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", - "_shasum": "5166e286457f03306064be5497e8dbb0c3d32083", - "_spec": "minimatch@^3.0.4", - "_where": "/Users/rebecca/code/npm/node_modules/glob", - "author": { - "name": "Isaac Z. Schlueter", - "email": "i@izs.me", - "url": "http://blog.izs.me" + "main": "minimatch.js", + "scripts": { + "test": "tap test/*.js --cov", + "preversion": "npm test", + "postversion": "npm publish", + "postpublish": "git push origin --all; git push origin --tags" }, - "bugs": { - "url": "https://github.com/isaacs/minimatch/issues" + "engines": { + "node": "*" }, - "bundleDependencies": false, "dependencies": { "brace-expansion": "^1.1.7" }, - "deprecated": false, - "description": "a glob matcher in javascript", "devDependencies": { "tap": "^10.3.2" }, - "engines": { - "node": "*" - }, + "license": "ISC", "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" + ] } diff --git a/deps/npm/node_modules/minimist/.travis.yml b/deps/npm/node_modules/minimist/.travis.yml deleted file mode 100644 index 74c57bf15e2391..00000000000000 --- a/deps/npm/node_modules/minimist/.travis.yml +++ /dev/null @@ -1,8 +0,0 @@ -language: node_js -node_js: - - "0.8" - - "0.10" - - "0.12" - - "iojs" -before_install: - - npm install -g npm@~1.4.6 diff --git a/deps/npm/node_modules/minimist/LICENSE b/deps/npm/node_modules/minimist/LICENSE deleted file mode 100644 index ee27ba4b4412b0..00000000000000 --- a/deps/npm/node_modules/minimist/LICENSE +++ /dev/null @@ -1,18 +0,0 @@ -This software is released under the MIT license: - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of -the Software, and to permit persons to whom the Software is furnished to do so, -subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/deps/npm/node_modules/minimist/example/parse.js b/deps/npm/node_modules/minimist/example/parse.js deleted file mode 100644 index f7c8d49807f32e..00000000000000 --- a/deps/npm/node_modules/minimist/example/parse.js +++ /dev/null @@ -1,2 +0,0 @@ -var argv = require('../')(process.argv.slice(2)); -console.log(argv); diff --git a/deps/npm/node_modules/minimist/index.js b/deps/npm/node_modules/minimist/index.js deleted file mode 100644 index d5fa9d510fa17e..00000000000000 --- a/deps/npm/node_modules/minimist/index.js +++ /dev/null @@ -1,244 +0,0 @@ -module.exports = function (args, opts) { - if (!opts) opts = {}; - - var flags = { bools : {}, strings : {}, unknownFn: null }; - - if (typeof opts['unknown'] === 'function') { - flags.unknownFn = opts['unknown']; - } - - if (typeof opts['boolean'] === 'boolean' && opts['boolean']) { - flags.allBools = true; - } else { - [].concat(opts['boolean']).filter(Boolean).forEach(function (key) { - flags.bools[key] = true; - }); - } - - var aliases = {}; - Object.keys(opts.alias || {}).forEach(function (key) { - aliases[key] = [].concat(opts.alias[key]); - aliases[key].forEach(function (x) { - aliases[x] = [key].concat(aliases[key].filter(function (y) { - return x !== y; - })); - }); - }); - - [].concat(opts.string).filter(Boolean).forEach(function (key) { - flags.strings[key] = true; - if (aliases[key]) { - flags.strings[aliases[key]] = true; - } - }); - - var defaults = opts['default'] || {}; - - var argv = { _ : [] }; - Object.keys(flags.bools).forEach(function (key) { - setArg(key, defaults[key] === undefined ? false : defaults[key]); - }); - - var notFlags = []; - - if (args.indexOf('--') !== -1) { - notFlags = args.slice(args.indexOf('--')+1); - args = args.slice(0, args.indexOf('--')); - } - - function argDefined(key, arg) { - return (flags.allBools && /^--[^=]+$/.test(arg)) || - flags.strings[key] || flags.bools[key] || aliases[key]; - } - - function setArg (key, val, arg) { - if (arg && flags.unknownFn && !argDefined(key, arg)) { - if (flags.unknownFn(arg) === false) return; - } - - var value = !flags.strings[key] && isNumber(val) - ? Number(val) : val - ; - setKey(argv, key.split('.'), value); - - (aliases[key] || []).forEach(function (x) { - setKey(argv, x.split('.'), value); - }); - } - - function setKey (obj, keys, value) { - var o = obj; - for (var i = 0; i < keys.length-1; i++) { - var key = keys[i]; - if (key === '__proto__') return; - if (o[key] === undefined) o[key] = {}; - if (o[key] === Object.prototype || o[key] === Number.prototype - || o[key] === String.prototype) o[key] = {}; - if (o[key] === Array.prototype) o[key] = []; - o = o[key]; - } - - var key = keys[keys.length - 1]; - if (key === '__proto__') return; - if (o === Object.prototype || o === Number.prototype - || o === String.prototype) o = {}; - if (o === Array.prototype) o = []; - if (o[key] === undefined || flags.bools[key] || typeof o[key] === 'boolean') { - o[key] = value; - } - else if (Array.isArray(o[key])) { - o[key].push(value); - } - else { - o[key] = [ o[key], value ]; - } - } - - function aliasIsBoolean(key) { - return aliases[key].some(function (x) { - return flags.bools[x]; - }); - } - - for (var i = 0; i < args.length; i++) { - var arg = args[i]; - - if (/^--.+=/.test(arg)) { - // Using [\s\S] instead of . because js doesn't support the - // 'dotall' regex modifier. See: - // http://stackoverflow.com/a/1068308/13216 - var m = arg.match(/^--([^=]+)=([\s\S]*)$/); - var key = m[1]; - var value = m[2]; - if (flags.bools[key]) { - value = value !== 'false'; - } - setArg(key, value, arg); - } - else if (/^--no-.+/.test(arg)) { - var key = arg.match(/^--no-(.+)/)[1]; - setArg(key, false, arg); - } - else if (/^--.+/.test(arg)) { - var key = arg.match(/^--(.+)/)[1]; - var next = args[i + 1]; - if (next !== undefined && !/^-/.test(next) - && !flags.bools[key] - && !flags.allBools - && (aliases[key] ? !aliasIsBoolean(key) : true)) { - setArg(key, next, arg); - i++; - } - else if (/^(true|false)$/.test(next)) { - setArg(key, next === 'true', arg); - i++; - } - else { - setArg(key, flags.strings[key] ? '' : true, arg); - } - } - else if (/^-[^-]+/.test(arg)) { - var letters = arg.slice(1,-1).split(''); - - var broken = false; - for (var j = 0; j < letters.length; j++) { - var next = arg.slice(j+2); - - if (next === '-') { - setArg(letters[j], next, arg) - continue; - } - - if (/[A-Za-z]/.test(letters[j]) && /=/.test(next)) { - setArg(letters[j], next.split('=')[1], arg); - broken = true; - break; - } - - if (/[A-Za-z]/.test(letters[j]) - && /-?\d+(\.\d*)?(e-?\d+)?$/.test(next)) { - setArg(letters[j], next, arg); - broken = true; - break; - } - - if (letters[j+1] && letters[j+1].match(/\W/)) { - setArg(letters[j], arg.slice(j+2), arg); - broken = true; - break; - } - else { - setArg(letters[j], flags.strings[letters[j]] ? '' : true, arg); - } - } - - var key = arg.slice(-1)[0]; - if (!broken && key !== '-') { - if (args[i+1] && !/^(-|--)[^-]/.test(args[i+1]) - && !flags.bools[key] - && (aliases[key] ? !aliasIsBoolean(key) : true)) { - setArg(key, args[i+1], arg); - i++; - } - else if (args[i+1] && /^(true|false)$/.test(args[i+1])) { - setArg(key, args[i+1] === 'true', arg); - i++; - } - else { - setArg(key, flags.strings[key] ? '' : true, arg); - } - } - } - else { - if (!flags.unknownFn || flags.unknownFn(arg) !== false) { - argv._.push( - flags.strings['_'] || !isNumber(arg) ? arg : Number(arg) - ); - } - if (opts.stopEarly) { - argv._.push.apply(argv._, args.slice(i + 1)); - break; - } - } - } - - Object.keys(defaults).forEach(function (key) { - if (!hasKey(argv, key.split('.'))) { - setKey(argv, key.split('.'), defaults[key]); - - (aliases[key] || []).forEach(function (x) { - setKey(argv, x.split('.'), defaults[key]); - }); - } - }); - - if (opts['--']) { - argv['--'] = new Array(); - notFlags.forEach(function(key) { - argv['--'].push(key); - }); - } - else { - notFlags.forEach(function(key) { - argv._.push(key); - }); - } - - return argv; -}; - -function hasKey (obj, keys) { - var o = obj; - keys.slice(0,-1).forEach(function (key) { - o = (o[key] || {}); - }); - - var key = keys[keys.length - 1]; - return key in o; -} - -function isNumber (x) { - if (typeof x === 'number') return true; - if (/^0x[0-9a-f]+$/i.test(x)) return true; - return /^[-+]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(x); -} diff --git a/deps/npm/node_modules/minimist/package.json b/deps/npm/node_modules/minimist/package.json deleted file mode 100644 index 502b798942f818..00000000000000 --- a/deps/npm/node_modules/minimist/package.json +++ /dev/null @@ -1,73 +0,0 @@ -{ - "_from": "minimist@^1.2.0", - "_id": "minimist@1.2.5", - "_inBundle": false, - "_integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", - "_location": "/minimist", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "minimist@^1.2.0", - "name": "minimist", - "escapedName": "minimist", - "rawSpec": "^1.2.0", - "saveSpec": null, - "fetchSpec": "^1.2.0" - }, - "_requiredBy": [ - "/rc" - ], - "_resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", - "_shasum": "67d66014b66a6a8aaa0c083c5fd58df4e4e97602", - "_spec": "minimist@^1.2.0", - "_where": "/Users/ruyadorno/Documents/workspace/cli/latest/node_modules/rc", - "author": { - "name": "James Halliday", - "email": "mail@substack.net", - "url": "http://substack.net" - }, - "bugs": { - "url": "https://github.com/substack/minimist/issues" - }, - "bundleDependencies": false, - "deprecated": false, - "description": "parse argument options", - "devDependencies": { - "covert": "^1.0.0", - "tap": "~0.4.0", - "tape": "^3.5.0" - }, - "homepage": "https://github.com/substack/minimist", - "keywords": [ - "argv", - "getopt", - "parser", - "optimist" - ], - "license": "MIT", - "main": "index.js", - "name": "minimist", - "repository": { - "type": "git", - "url": "git://github.com/substack/minimist.git" - }, - "scripts": { - "coverage": "covert test/*.js", - "test": "tap test/*.js" - }, - "testling": { - "files": "test/*.js", - "browsers": [ - "ie/6..latest", - "ff/5", - "firefox/latest", - "chrome/10", - "chrome/latest", - "safari/5.1", - "safari/latest", - "opera/12" - ] - }, - "version": "1.2.5" -} diff --git a/deps/npm/node_modules/minimist/readme.markdown b/deps/npm/node_modules/minimist/readme.markdown deleted file mode 100644 index 5fd97ab11ee9d8..00000000000000 --- a/deps/npm/node_modules/minimist/readme.markdown +++ /dev/null @@ -1,95 +0,0 @@ -# minimist - -parse argument options - -This module is the guts of optimist's argument parser without all the -fanciful decoration. - -# example - -``` js -var argv = require('minimist')(process.argv.slice(2)); -console.log(argv); -``` - -``` -$ node example/parse.js -a beep -b boop -{ _: [], a: 'beep', b: 'boop' } -``` - -``` -$ node example/parse.js -x 3 -y 4 -n5 -abc --beep=boop foo bar baz -{ _: [ 'foo', 'bar', 'baz' ], - x: 3, - y: 4, - n: 5, - a: true, - b: true, - c: true, - beep: 'boop' } -``` - -# security - -Previous versions had a prototype pollution bug that could cause privilege -escalation in some circumstances when handling untrusted user input. - -Please use version 1.2.3 or later: https://snyk.io/vuln/SNYK-JS-MINIMIST-559764 - -# methods - -``` js -var parseArgs = require('minimist') -``` - -## var argv = parseArgs(args, opts={}) - -Return an argument object `argv` populated with the array arguments from `args`. - -`argv._` contains all the arguments that didn't have an option associated with -them. - -Numeric-looking arguments will be returned as numbers unless `opts.string` or -`opts.boolean` is set for that argument name. - -Any arguments after `'--'` will not be parsed and will end up in `argv._`. - -options can be: - -* `opts.string` - a string or array of strings argument names to always treat as -strings -* `opts.boolean` - a boolean, string or array of strings to always treat as -booleans. if `true` will treat all double hyphenated arguments without equal signs -as boolean (e.g. affects `--foo`, not `-f` or `--foo=bar`) -* `opts.alias` - an object mapping string names to strings or arrays of string -argument names to use as aliases -* `opts.default` - an object mapping string argument names to default values -* `opts.stopEarly` - when true, populate `argv._` with everything after the -first non-option -* `opts['--']` - when true, populate `argv._` with everything before the `--` -and `argv['--']` with everything after the `--`. Here's an example: - - ``` - > require('./')('one two three -- four five --six'.split(' '), { '--': true }) - { _: [ 'one', 'two', 'three' ], - '--': [ 'four', 'five', '--six' ] } - ``` - - Note that with `opts['--']` set, parsing for arguments still stops after the - `--`. - -* `opts.unknown` - a function which is invoked with a command line parameter not -defined in the `opts` configuration object. If the function returns `false`, the -unknown option is not added to `argv`. - -# install - -With [npm](https://npmjs.org) do: - -``` -npm install minimist -``` - -# license - -MIT diff --git a/deps/npm/node_modules/minimist/test/all_bool.js b/deps/npm/node_modules/minimist/test/all_bool.js deleted file mode 100644 index 25df1654bc99d9..00000000000000 --- a/deps/npm/node_modules/minimist/test/all_bool.js +++ /dev/null @@ -1,32 +0,0 @@ -var parse = require('../'); -var test = require('tape'); - -test('flag boolean true (default all --args to boolean)', function (t) { - var argv = parse(['moo', '--honk', 'cow'], { - boolean: true - }); - - t.deepEqual(argv, { - honk: true, - _: ['moo', 'cow'] - }); - - t.deepEqual(typeof argv.honk, 'boolean'); - t.end(); -}); - -test('flag boolean true only affects double hyphen arguments without equals signs', function (t) { - var argv = parse(['moo', '--honk', 'cow', '-p', '55', '--tacos=good'], { - boolean: true - }); - - t.deepEqual(argv, { - honk: true, - tacos: 'good', - p: 55, - _: ['moo', 'cow'] - }); - - t.deepEqual(typeof argv.honk, 'boolean'); - t.end(); -}); diff --git a/deps/npm/node_modules/minimist/test/bool.js b/deps/npm/node_modules/minimist/test/bool.js deleted file mode 100644 index dc9666bc619755..00000000000000 --- a/deps/npm/node_modules/minimist/test/bool.js +++ /dev/null @@ -1,178 +0,0 @@ -var parse = require('../'); -var test = require('tape'); - -test('flag boolean default false', function (t) { - var argv = parse(['moo'], { - boolean: ['t', 'verbose'], - default: { verbose: false, t: false } - }); - - t.deepEqual(argv, { - verbose: false, - t: false, - _: ['moo'] - }); - - t.deepEqual(typeof argv.verbose, 'boolean'); - t.deepEqual(typeof argv.t, 'boolean'); - t.end(); - -}); - -test('boolean groups', function (t) { - var argv = parse([ '-x', '-z', 'one', 'two', 'three' ], { - boolean: ['x','y','z'] - }); - - t.deepEqual(argv, { - x : true, - y : false, - z : true, - _ : [ 'one', 'two', 'three' ] - }); - - t.deepEqual(typeof argv.x, 'boolean'); - t.deepEqual(typeof argv.y, 'boolean'); - t.deepEqual(typeof argv.z, 'boolean'); - t.end(); -}); -test('boolean and alias with chainable api', function (t) { - var aliased = [ '-h', 'derp' ]; - var regular = [ '--herp', 'derp' ]; - var opts = { - herp: { alias: 'h', boolean: true } - }; - var aliasedArgv = parse(aliased, { - boolean: 'herp', - alias: { h: 'herp' } - }); - var propertyArgv = parse(regular, { - boolean: 'herp', - alias: { h: 'herp' } - }); - var expected = { - herp: true, - h: true, - '_': [ 'derp' ] - }; - - t.same(aliasedArgv, expected); - t.same(propertyArgv, expected); - t.end(); -}); - -test('boolean and alias with options hash', function (t) { - var aliased = [ '-h', 'derp' ]; - var regular = [ '--herp', 'derp' ]; - var opts = { - alias: { 'h': 'herp' }, - boolean: 'herp' - }; - var aliasedArgv = parse(aliased, opts); - var propertyArgv = parse(regular, opts); - var expected = { - herp: true, - h: true, - '_': [ 'derp' ] - }; - t.same(aliasedArgv, expected); - t.same(propertyArgv, expected); - t.end(); -}); - -test('boolean and alias array with options hash', function (t) { - var aliased = [ '-h', 'derp' ]; - var regular = [ '--herp', 'derp' ]; - var alt = [ '--harp', 'derp' ]; - var opts = { - alias: { 'h': ['herp', 'harp'] }, - boolean: 'h' - }; - var aliasedArgv = parse(aliased, opts); - var propertyArgv = parse(regular, opts); - var altPropertyArgv = parse(alt, opts); - var expected = { - harp: true, - herp: true, - h: true, - '_': [ 'derp' ] - }; - t.same(aliasedArgv, expected); - t.same(propertyArgv, expected); - t.same(altPropertyArgv, expected); - t.end(); -}); - -test('boolean and alias using explicit true', function (t) { - var aliased = [ '-h', 'true' ]; - var regular = [ '--herp', 'true' ]; - var opts = { - alias: { h: 'herp' }, - boolean: 'h' - }; - var aliasedArgv = parse(aliased, opts); - var propertyArgv = parse(regular, opts); - var expected = { - herp: true, - h: true, - '_': [ ] - }; - - t.same(aliasedArgv, expected); - t.same(propertyArgv, expected); - t.end(); -}); - -// regression, see https://github.com/substack/node-optimist/issues/71 -test('boolean and --x=true', function(t) { - var parsed = parse(['--boool', '--other=true'], { - boolean: 'boool' - }); - - t.same(parsed.boool, true); - t.same(parsed.other, 'true'); - - parsed = parse(['--boool', '--other=false'], { - boolean: 'boool' - }); - - t.same(parsed.boool, true); - t.same(parsed.other, 'false'); - t.end(); -}); - -test('boolean --boool=true', function (t) { - var parsed = parse(['--boool=true'], { - default: { - boool: false - }, - boolean: ['boool'] - }); - - t.same(parsed.boool, true); - t.end(); -}); - -test('boolean --boool=false', function (t) { - var parsed = parse(['--boool=false'], { - default: { - boool: true - }, - boolean: ['boool'] - }); - - t.same(parsed.boool, false); - t.end(); -}); - -test('boolean using something similar to true', function (t) { - var opts = { boolean: 'h' }; - var result = parse(['-h', 'true.txt'], opts); - var expected = { - h: true, - '_': ['true.txt'] - }; - - t.same(result, expected); - t.end(); -}); \ No newline at end of file diff --git a/deps/npm/node_modules/minimist/test/dash.js b/deps/npm/node_modules/minimist/test/dash.js deleted file mode 100644 index 5a4fa5be418596..00000000000000 --- a/deps/npm/node_modules/minimist/test/dash.js +++ /dev/null @@ -1,31 +0,0 @@ -var parse = require('../'); -var test = require('tape'); - -test('-', function (t) { - t.plan(5); - t.deepEqual(parse([ '-n', '-' ]), { n: '-', _: [] }); - t.deepEqual(parse([ '-' ]), { _: [ '-' ] }); - t.deepEqual(parse([ '-f-' ]), { f: '-', _: [] }); - t.deepEqual( - parse([ '-b', '-' ], { boolean: 'b' }), - { b: true, _: [ '-' ] } - ); - t.deepEqual( - parse([ '-s', '-' ], { string: 's' }), - { s: '-', _: [] } - ); -}); - -test('-a -- b', function (t) { - t.plan(3); - t.deepEqual(parse([ '-a', '--', 'b' ]), { a: true, _: [ 'b' ] }); - t.deepEqual(parse([ '--a', '--', 'b' ]), { a: true, _: [ 'b' ] }); - t.deepEqual(parse([ '--a', '--', 'b' ]), { a: true, _: [ 'b' ] }); -}); - -test('move arguments after the -- into their own `--` array', function(t) { - t.plan(1); - t.deepEqual( - parse([ '--name', 'John', 'before', '--', 'after' ], { '--': true }), - { name: 'John', _: [ 'before' ], '--': [ 'after' ] }); -}); diff --git a/deps/npm/node_modules/minimist/test/default_bool.js b/deps/npm/node_modules/minimist/test/default_bool.js deleted file mode 100644 index 780a311270fcda..00000000000000 --- a/deps/npm/node_modules/minimist/test/default_bool.js +++ /dev/null @@ -1,35 +0,0 @@ -var test = require('tape'); -var parse = require('../'); - -test('boolean default true', function (t) { - var argv = parse([], { - boolean: 'sometrue', - default: { sometrue: true } - }); - t.equal(argv.sometrue, true); - t.end(); -}); - -test('boolean default false', function (t) { - var argv = parse([], { - boolean: 'somefalse', - default: { somefalse: false } - }); - t.equal(argv.somefalse, false); - t.end(); -}); - -test('boolean default to null', function (t) { - var argv = parse([], { - boolean: 'maybe', - default: { maybe: null } - }); - t.equal(argv.maybe, null); - var argv = parse(['--maybe'], { - boolean: 'maybe', - default: { maybe: null } - }); - t.equal(argv.maybe, true); - t.end(); - -}) diff --git a/deps/npm/node_modules/minimist/test/dotted.js b/deps/npm/node_modules/minimist/test/dotted.js deleted file mode 100644 index d8b3e856ec795f..00000000000000 --- a/deps/npm/node_modules/minimist/test/dotted.js +++ /dev/null @@ -1,22 +0,0 @@ -var parse = require('../'); -var test = require('tape'); - -test('dotted alias', function (t) { - var argv = parse(['--a.b', '22'], {default: {'a.b': 11}, alias: {'a.b': 'aa.bb'}}); - t.equal(argv.a.b, 22); - t.equal(argv.aa.bb, 22); - t.end(); -}); - -test('dotted default', function (t) { - var argv = parse('', {default: {'a.b': 11}, alias: {'a.b': 'aa.bb'}}); - t.equal(argv.a.b, 11); - t.equal(argv.aa.bb, 11); - t.end(); -}); - -test('dotted default with no alias', function (t) { - var argv = parse('', {default: {'a.b': 11}}); - t.equal(argv.a.b, 11); - t.end(); -}); diff --git a/deps/npm/node_modules/minimist/test/kv_short.js b/deps/npm/node_modules/minimist/test/kv_short.js deleted file mode 100644 index ae880be4661dd5..00000000000000 --- a/deps/npm/node_modules/minimist/test/kv_short.js +++ /dev/null @@ -1,16 +0,0 @@ -var parse = require('../'); -var test = require('tape'); - -test('short -k=v' , function (t) { - t.plan(1); - - var argv = parse([ '-b=123' ]); - t.deepEqual(argv, { b: 123, _: [] }); -}); - -test('multi short -k=v' , function (t) { - t.plan(1); - - var argv = parse([ '-a=whatever', '-b=robots' ]); - t.deepEqual(argv, { a: 'whatever', b: 'robots', _: [] }); -}); diff --git a/deps/npm/node_modules/minimist/test/long.js b/deps/npm/node_modules/minimist/test/long.js deleted file mode 100644 index 5d3a1e09d3b64c..00000000000000 --- a/deps/npm/node_modules/minimist/test/long.js +++ /dev/null @@ -1,31 +0,0 @@ -var test = require('tape'); -var parse = require('../'); - -test('long opts', function (t) { - t.deepEqual( - parse([ '--bool' ]), - { bool : true, _ : [] }, - 'long boolean' - ); - t.deepEqual( - parse([ '--pow', 'xixxle' ]), - { pow : 'xixxle', _ : [] }, - 'long capture sp' - ); - t.deepEqual( - parse([ '--pow=xixxle' ]), - { pow : 'xixxle', _ : [] }, - 'long capture eq' - ); - t.deepEqual( - parse([ '--host', 'localhost', '--port', '555' ]), - { host : 'localhost', port : 555, _ : [] }, - 'long captures sp' - ); - t.deepEqual( - parse([ '--host=localhost', '--port=555' ]), - { host : 'localhost', port : 555, _ : [] }, - 'long captures eq' - ); - t.end(); -}); diff --git a/deps/npm/node_modules/minimist/test/num.js b/deps/npm/node_modules/minimist/test/num.js deleted file mode 100644 index 2cc77f4d62ffb2..00000000000000 --- a/deps/npm/node_modules/minimist/test/num.js +++ /dev/null @@ -1,36 +0,0 @@ -var parse = require('../'); -var test = require('tape'); - -test('nums', function (t) { - var argv = parse([ - '-x', '1234', - '-y', '5.67', - '-z', '1e7', - '-w', '10f', - '--hex', '0xdeadbeef', - '789' - ]); - t.deepEqual(argv, { - x : 1234, - y : 5.67, - z : 1e7, - w : '10f', - hex : 0xdeadbeef, - _ : [ 789 ] - }); - t.deepEqual(typeof argv.x, 'number'); - t.deepEqual(typeof argv.y, 'number'); - t.deepEqual(typeof argv.z, 'number'); - t.deepEqual(typeof argv.w, 'string'); - t.deepEqual(typeof argv.hex, 'number'); - t.deepEqual(typeof argv._[0], 'number'); - t.end(); -}); - -test('already a number', function (t) { - var argv = parse([ '-x', 1234, 789 ]); - t.deepEqual(argv, { x : 1234, _ : [ 789 ] }); - t.deepEqual(typeof argv.x, 'number'); - t.deepEqual(typeof argv._[0], 'number'); - t.end(); -}); diff --git a/deps/npm/node_modules/minimist/test/parse.js b/deps/npm/node_modules/minimist/test/parse.js deleted file mode 100644 index 58f24572c47d86..00000000000000 --- a/deps/npm/node_modules/minimist/test/parse.js +++ /dev/null @@ -1,197 +0,0 @@ -var parse = require('../'); -var test = require('tape'); - -test('parse args', function (t) { - t.deepEqual( - parse([ '--no-moo' ]), - { moo : false, _ : [] }, - 'no' - ); - t.deepEqual( - parse([ '-v', 'a', '-v', 'b', '-v', 'c' ]), - { v : ['a','b','c'], _ : [] }, - 'multi' - ); - t.end(); -}); - -test('comprehensive', function (t) { - t.deepEqual( - parse([ - '--name=meowmers', 'bare', '-cats', 'woo', - '-h', 'awesome', '--multi=quux', - '--key', 'value', - '-b', '--bool', '--no-meep', '--multi=baz', - '--', '--not-a-flag', 'eek' - ]), - { - c : true, - a : true, - t : true, - s : 'woo', - h : 'awesome', - b : true, - bool : true, - key : 'value', - multi : [ 'quux', 'baz' ], - meep : false, - name : 'meowmers', - _ : [ 'bare', '--not-a-flag', 'eek' ] - } - ); - t.end(); -}); - -test('flag boolean', function (t) { - var argv = parse([ '-t', 'moo' ], { boolean: 't' }); - t.deepEqual(argv, { t : true, _ : [ 'moo' ] }); - t.deepEqual(typeof argv.t, 'boolean'); - t.end(); -}); - -test('flag boolean value', function (t) { - var argv = parse(['--verbose', 'false', 'moo', '-t', 'true'], { - boolean: [ 't', 'verbose' ], - default: { verbose: true } - }); - - t.deepEqual(argv, { - verbose: false, - t: true, - _: ['moo'] - }); - - t.deepEqual(typeof argv.verbose, 'boolean'); - t.deepEqual(typeof argv.t, 'boolean'); - t.end(); -}); - -test('newlines in params' , function (t) { - var args = parse([ '-s', "X\nX" ]) - t.deepEqual(args, { _ : [], s : "X\nX" }); - - // reproduce in bash: - // VALUE="new - // line" - // node program.js --s="$VALUE" - args = parse([ "--s=X\nX" ]) - t.deepEqual(args, { _ : [], s : "X\nX" }); - t.end(); -}); - -test('strings' , function (t) { - var s = parse([ '-s', '0001234' ], { string: 's' }).s; - t.equal(s, '0001234'); - t.equal(typeof s, 'string'); - - var x = parse([ '-x', '56' ], { string: 'x' }).x; - t.equal(x, '56'); - t.equal(typeof x, 'string'); - t.end(); -}); - -test('stringArgs', function (t) { - var s = parse([ ' ', ' ' ], { string: '_' })._; - t.same(s.length, 2); - t.same(typeof s[0], 'string'); - t.same(s[0], ' '); - t.same(typeof s[1], 'string'); - t.same(s[1], ' '); - t.end(); -}); - -test('empty strings', function(t) { - var s = parse([ '-s' ], { string: 's' }).s; - t.equal(s, ''); - t.equal(typeof s, 'string'); - - var str = parse([ '--str' ], { string: 'str' }).str; - t.equal(str, ''); - t.equal(typeof str, 'string'); - - var letters = parse([ '-art' ], { - string: [ 'a', 't' ] - }); - - t.equal(letters.a, ''); - t.equal(letters.r, true); - t.equal(letters.t, ''); - - t.end(); -}); - - -test('string and alias', function(t) { - var x = parse([ '--str', '000123' ], { - string: 's', - alias: { s: 'str' } - }); - - t.equal(x.str, '000123'); - t.equal(typeof x.str, 'string'); - t.equal(x.s, '000123'); - t.equal(typeof x.s, 'string'); - - var y = parse([ '-s', '000123' ], { - string: 'str', - alias: { str: 's' } - }); - - t.equal(y.str, '000123'); - t.equal(typeof y.str, 'string'); - t.equal(y.s, '000123'); - t.equal(typeof y.s, 'string'); - t.end(); -}); - -test('slashBreak', function (t) { - t.same( - parse([ '-I/foo/bar/baz' ]), - { I : '/foo/bar/baz', _ : [] } - ); - t.same( - parse([ '-xyz/foo/bar/baz' ]), - { x : true, y : true, z : '/foo/bar/baz', _ : [] } - ); - t.end(); -}); - -test('alias', function (t) { - var argv = parse([ '-f', '11', '--zoom', '55' ], { - alias: { z: 'zoom' } - }); - t.equal(argv.zoom, 55); - t.equal(argv.z, argv.zoom); - t.equal(argv.f, 11); - t.end(); -}); - -test('multiAlias', function (t) { - var argv = parse([ '-f', '11', '--zoom', '55' ], { - alias: { z: [ 'zm', 'zoom' ] } - }); - t.equal(argv.zoom, 55); - t.equal(argv.z, argv.zoom); - t.equal(argv.z, argv.zm); - t.equal(argv.f, 11); - t.end(); -}); - -test('nested dotted objects', function (t) { - var argv = parse([ - '--foo.bar', '3', '--foo.baz', '4', - '--foo.quux.quibble', '5', '--foo.quux.o_O', - '--beep.boop' - ]); - - t.same(argv.foo, { - bar : 3, - baz : 4, - quux : { - quibble : 5, - o_O : true - } - }); - t.same(argv.beep, { boop : true }); - t.end(); -}); diff --git a/deps/npm/node_modules/minimist/test/parse_modified.js b/deps/npm/node_modules/minimist/test/parse_modified.js deleted file mode 100644 index a22248532f0c6f..00000000000000 --- a/deps/npm/node_modules/minimist/test/parse_modified.js +++ /dev/null @@ -1,9 +0,0 @@ -var parse = require('../'); -var test = require('tape'); - -test('parse with modifier functions' , function (t) { - t.plan(1); - - var argv = parse([ '-b', '123' ], { boolean: 'b' }); - t.deepEqual(argv, { b: true, _: [123] }); -}); diff --git a/deps/npm/node_modules/minimist/test/proto.js b/deps/npm/node_modules/minimist/test/proto.js deleted file mode 100644 index 8649107ecba1f0..00000000000000 --- a/deps/npm/node_modules/minimist/test/proto.js +++ /dev/null @@ -1,44 +0,0 @@ -var parse = require('../'); -var test = require('tape'); - -test('proto pollution', function (t) { - var argv = parse(['--__proto__.x','123']); - t.equal({}.x, undefined); - t.equal(argv.__proto__.x, undefined); - t.equal(argv.x, undefined); - t.end(); -}); - -test('proto pollution (array)', function (t) { - var argv = parse(['--x','4','--x','5','--x.__proto__.z','789']); - t.equal({}.z, undefined); - t.deepEqual(argv.x, [4,5]); - t.equal(argv.x.z, undefined); - t.equal(argv.x.__proto__.z, undefined); - t.end(); -}); - -test('proto pollution (number)', function (t) { - var argv = parse(['--x','5','--x.__proto__.z','100']); - t.equal({}.z, undefined); - t.equal((4).z, undefined); - t.equal(argv.x, 5); - t.equal(argv.x.z, undefined); - t.end(); -}); - -test('proto pollution (string)', function (t) { - var argv = parse(['--x','abc','--x.__proto__.z','def']); - t.equal({}.z, undefined); - t.equal('...'.z, undefined); - t.equal(argv.x, 'abc'); - t.equal(argv.x.z, undefined); - t.end(); -}); - -test('proto pollution (constructor)', function (t) { - var argv = parse(['--constructor.prototype.y','123']); - t.equal({}.y, undefined); - t.equal(argv.y, undefined); - t.end(); -}); diff --git a/deps/npm/node_modules/minimist/test/short.js b/deps/npm/node_modules/minimist/test/short.js deleted file mode 100644 index ac18880f1eb50c..00000000000000 --- a/deps/npm/node_modules/minimist/test/short.js +++ /dev/null @@ -1,67 +0,0 @@ -var parse = require('../'); -var test = require('tape'); - -test('numeric short args', function (t) { - t.plan(2); - t.deepEqual(parse([ '-n123' ]), { n: 123, _: [] }); - t.deepEqual( - parse([ '-123', '456' ]), - { 1: true, 2: true, 3: 456, _: [] } - ); -}); - -test('short', function (t) { - t.deepEqual( - parse([ '-b' ]), - { b : true, _ : [] }, - 'short boolean' - ); - t.deepEqual( - parse([ 'foo', 'bar', 'baz' ]), - { _ : [ 'foo', 'bar', 'baz' ] }, - 'bare' - ); - t.deepEqual( - parse([ '-cats' ]), - { c : true, a : true, t : true, s : true, _ : [] }, - 'group' - ); - t.deepEqual( - parse([ '-cats', 'meow' ]), - { c : true, a : true, t : true, s : 'meow', _ : [] }, - 'short group next' - ); - t.deepEqual( - parse([ '-h', 'localhost' ]), - { h : 'localhost', _ : [] }, - 'short capture' - ); - t.deepEqual( - parse([ '-h', 'localhost', '-p', '555' ]), - { h : 'localhost', p : 555, _ : [] }, - 'short captures' - ); - t.end(); -}); - -test('mixed short bool and capture', function (t) { - t.same( - parse([ '-h', 'localhost', '-fp', '555', 'script.js' ]), - { - f : true, p : 555, h : 'localhost', - _ : [ 'script.js' ] - } - ); - t.end(); -}); - -test('short and long', function (t) { - t.deepEqual( - parse([ '-h', 'localhost', '-fp', '555', 'script.js' ]), - { - f : true, p : 555, h : 'localhost', - _ : [ 'script.js' ] - } - ); - t.end(); -}); diff --git a/deps/npm/node_modules/minimist/test/stop_early.js b/deps/npm/node_modules/minimist/test/stop_early.js deleted file mode 100644 index bdf9fbcb0b57ab..00000000000000 --- a/deps/npm/node_modules/minimist/test/stop_early.js +++ /dev/null @@ -1,15 +0,0 @@ -var parse = require('../'); -var test = require('tape'); - -test('stops parsing on the first non-option when stopEarly is set', function (t) { - var argv = parse(['--aaa', 'bbb', 'ccc', '--ddd'], { - stopEarly: true - }); - - t.deepEqual(argv, { - aaa: 'bbb', - _: ['ccc', '--ddd'] - }); - - t.end(); -}); diff --git a/deps/npm/node_modules/minimist/test/unknown.js b/deps/npm/node_modules/minimist/test/unknown.js deleted file mode 100644 index 462a36bdd7ec9f..00000000000000 --- a/deps/npm/node_modules/minimist/test/unknown.js +++ /dev/null @@ -1,102 +0,0 @@ -var parse = require('../'); -var test = require('tape'); - -test('boolean and alias is not unknown', function (t) { - var unknown = []; - function unknownFn(arg) { - unknown.push(arg); - return false; - } - var aliased = [ '-h', 'true', '--derp', 'true' ]; - var regular = [ '--herp', 'true', '-d', 'true' ]; - var opts = { - alias: { h: 'herp' }, - boolean: 'h', - unknown: unknownFn - }; - var aliasedArgv = parse(aliased, opts); - var propertyArgv = parse(regular, opts); - - t.same(unknown, ['--derp', '-d']); - t.end(); -}); - -test('flag boolean true any double hyphen argument is not unknown', function (t) { - var unknown = []; - function unknownFn(arg) { - unknown.push(arg); - return false; - } - var argv = parse(['--honk', '--tacos=good', 'cow', '-p', '55'], { - boolean: true, - unknown: unknownFn - }); - t.same(unknown, ['--tacos=good', 'cow', '-p']); - t.same(argv, { - honk: true, - _: [] - }); - t.end(); -}); - -test('string and alias is not unknown', function (t) { - var unknown = []; - function unknownFn(arg) { - unknown.push(arg); - return false; - } - var aliased = [ '-h', 'hello', '--derp', 'goodbye' ]; - var regular = [ '--herp', 'hello', '-d', 'moon' ]; - var opts = { - alias: { h: 'herp' }, - string: 'h', - unknown: unknownFn - }; - var aliasedArgv = parse(aliased, opts); - var propertyArgv = parse(regular, opts); - - t.same(unknown, ['--derp', '-d']); - t.end(); -}); - -test('default and alias is not unknown', function (t) { - var unknown = []; - function unknownFn(arg) { - unknown.push(arg); - return false; - } - var aliased = [ '-h', 'hello' ]; - var regular = [ '--herp', 'hello' ]; - var opts = { - default: { 'h': 'bar' }, - alias: { 'h': 'herp' }, - unknown: unknownFn - }; - var aliasedArgv = parse(aliased, opts); - var propertyArgv = parse(regular, opts); - - t.same(unknown, []); - t.end(); - unknownFn(); // exercise fn for 100% coverage -}); - -test('value following -- is not unknown', function (t) { - var unknown = []; - function unknownFn(arg) { - unknown.push(arg); - return false; - } - var aliased = [ '--bad', '--', 'good', 'arg' ]; - var opts = { - '--': true, - unknown: unknownFn - }; - var argv = parse(aliased, opts); - - t.same(unknown, ['--bad']); - t.same(argv, { - '--': ['good', 'arg'], - '_': [] - }) - t.end(); -}); diff --git a/deps/npm/node_modules/minimist/test/whitespace.js b/deps/npm/node_modules/minimist/test/whitespace.js deleted file mode 100644 index 8a52a58cecfd7a..00000000000000 --- a/deps/npm/node_modules/minimist/test/whitespace.js +++ /dev/null @@ -1,8 +0,0 @@ -var parse = require('../'); -var test = require('tape'); - -test('whitespace should be whitespace' , function (t) { - t.plan(1); - var x = parse([ '-x', '\t' ]).x; - t.equal(x, '\t'); -}); diff --git a/deps/npm/node_modules/fs-write-stream-atomic/LICENSE b/deps/npm/node_modules/minipass-collect/LICENSE similarity index 100% rename from deps/npm/node_modules/fs-write-stream-atomic/LICENSE rename to deps/npm/node_modules/minipass-collect/LICENSE diff --git a/deps/npm/node_modules/minipass-collect/README.md b/deps/npm/node_modules/minipass-collect/README.md new file mode 100644 index 00000000000000..ae1c3dacaa066a --- /dev/null +++ b/deps/npm/node_modules/minipass-collect/README.md @@ -0,0 +1,48 @@ +# minipass-collect + +A Minipass stream that collects all the data into a single chunk + +Note that this buffers ALL data written to it, so it's only good for +situations where you are sure the entire stream fits in memory. + +Note: this is primarily useful for the `Collect.PassThrough` class, since +Minipass streams already have a `.collect()` method which returns a promise +that resolves to the array of chunks, and a `.concat()` method that returns +the data concatenated into a single Buffer or String. + +## USAGE + +```js +const Collect = require('minipass-collect') + +const collector = new Collect() +collector.on('data', allTheData => { + console.log('all the data!', allTheData) +}) + +someSourceOfData.pipe(collector) + +// note that you can also simply do: +someSourceOfData.pipe(new Minipass()).concat().then(data => ...) +// or even, if someSourceOfData is a Minipass: +someSourceOfData.concat().then(data => ...) +// but you might prefer to have it stream-shaped rather than +// Promise-shaped in some scenarios. +``` + +If you want to collect the data, but _also_ act as a passthrough stream, +then use `Collect.PassThrough` instead (for example to memoize streaming +responses), and listen on the `collect` event. + +```js +const Collect = require('minipass-collect') + +const collector = new Collect.PassThrough() +collector.on('collect', allTheData => { + console.log('all the data!', allTheData) +}) + +someSourceOfData.pipe(collector).pipe(someOtherStream) +``` + +All [minipass options](http://npm.im/minipass) are supported. diff --git a/deps/npm/node_modules/minipass-collect/index.js b/deps/npm/node_modules/minipass-collect/index.js new file mode 100644 index 00000000000000..2fe68c0b5a5a9b --- /dev/null +++ b/deps/npm/node_modules/minipass-collect/index.js @@ -0,0 +1,71 @@ +const Minipass = require('minipass') +const _data = Symbol('_data') +const _length = Symbol('_length') +class Collect extends Minipass { + constructor (options) { + super(options) + this[_data] = [] + this[_length] = 0 + } + write (chunk, encoding, cb) { + if (typeof encoding === 'function') + cb = encoding, encoding = 'utf8' + + if (!encoding) + encoding = 'utf8' + + const c = Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk, encoding) + this[_data].push(c) + this[_length] += c.length + if (cb) + cb() + return true + } + end (chunk, encoding, cb) { + if (typeof chunk === 'function') + cb = chunk, chunk = null + if (typeof encoding === 'function') + cb = encoding, encoding = 'utf8' + if (chunk) + this.write(chunk, encoding) + const result = Buffer.concat(this[_data], this[_length]) + super.write(result) + return super.end(cb) + } +} +module.exports = Collect + +// it would be possible to DRY this a bit by doing something like +// this.collector = new Collect() and listening on its data event, +// but it's not much code, and we may as well save the extra obj +class CollectPassThrough extends Minipass { + constructor (options) { + super(options) + this[_data] = [] + this[_length] = 0 + } + write (chunk, encoding, cb) { + if (typeof encoding === 'function') + cb = encoding, encoding = 'utf8' + + if (!encoding) + encoding = 'utf8' + + const c = Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk, encoding) + this[_data].push(c) + this[_length] += c.length + return super.write(chunk, encoding, cb) + } + end (chunk, encoding, cb) { + if (typeof chunk === 'function') + cb = chunk, chunk = null + if (typeof encoding === 'function') + cb = encoding, encoding = 'utf8' + if (chunk) + this.write(chunk, encoding) + const result = Buffer.concat(this[_data], this[_length]) + this.emit('collect', result) + return super.end(cb) + } +} +module.exports.PassThrough = CollectPassThrough diff --git a/deps/npm/node_modules/minipass-collect/package.json b/deps/npm/node_modules/minipass-collect/package.json new file mode 100644 index 00000000000000..54d87ac2e63b20 --- /dev/null +++ b/deps/npm/node_modules/minipass-collect/package.json @@ -0,0 +1,29 @@ +{ + "name": "minipass-collect", + "version": "1.0.2", + "description": "A Minipass stream that collects all the data into a single chunk", + "author": "Isaac Z. Schlueter (https://izs.me)", + "license": "ISC", + "scripts": { + "test": "tap", + "snap": "tap", + "preversion": "npm test", + "postversion": "npm publish", + "postpublish": "git push origin --follow-tags" + }, + "tap": { + "check-coverage": true + }, + "devDependencies": { + "tap": "^14.6.9" + }, + "dependencies": { + "minipass": "^3.0.0" + }, + "files": [ + "index.js" + ], + "engines": { + "node": ">= 8" + } +} diff --git a/deps/npm/node_modules/minipass-fetch/LICENSE b/deps/npm/node_modules/minipass-fetch/LICENSE new file mode 100644 index 00000000000000..3c3410cdc12ee3 --- /dev/null +++ b/deps/npm/node_modules/minipass-fetch/LICENSE @@ -0,0 +1,28 @@ +The MIT License (MIT) + +Copyright (c) Isaac Z. Schlueter and Contributors +Copyright (c) 2016 David Frank + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + +--- + +Note: This is a derivative work based on "node-fetch" by David Frank, +modified and distributed under the terms of the MIT license above. +https://github.com/bitinn/node-fetch diff --git a/deps/npm/node_modules/minipass-fetch/README.md b/deps/npm/node_modules/minipass-fetch/README.md new file mode 100644 index 00000000000000..925e6bec3f15d2 --- /dev/null +++ b/deps/npm/node_modules/minipass-fetch/README.md @@ -0,0 +1,29 @@ +# minipass-fetch + +An implementation of window.fetch in Node.js using Minipass streams + +This is a fork (or more precisely, a reimplementation) of +[node-fetch](http://npm.im/node-fetch). All streams have been replaced +with [minipass streams](http://npm.im/minipass). + +The goal of this module is to stay in sync with the API presented by +`node-fetch`, with the exception of the streaming interface provided. + +## Why + +Minipass streams are faster and more deterministic in their timing contract +than node-core streams, making them a better fit for many server-side use +cases. + +## API + +See [node-fetch](http://npm.im/node-fetch) + +Differences from `node-fetch` (and, by extension, from the WhatWG Fetch +specification): + +- Returns [minipass](http://npm.im/minipass) streams instead of node-core + streams. +- Supports the full set of [TLS Options that may be provided to + `https.request()`](https://nodejs.org/api/https.html#https_https_request_options_callback) + when making `https` requests. diff --git a/deps/npm/node_modules/minipass-fetch/index.js b/deps/npm/node_modules/minipass-fetch/index.js new file mode 100644 index 00000000000000..07efc17880fa0e --- /dev/null +++ b/deps/npm/node_modules/minipass-fetch/index.js @@ -0,0 +1 @@ +module.exports = require('./lib/index.js') diff --git a/deps/npm/node_modules/minipass-fetch/lib/abort-error.js b/deps/npm/node_modules/minipass-fetch/lib/abort-error.js new file mode 100644 index 00000000000000..b18f643269e375 --- /dev/null +++ b/deps/npm/node_modules/minipass-fetch/lib/abort-error.js @@ -0,0 +1,17 @@ +'use strict' +class AbortError extends Error { + constructor (message) { + super(message) + this.code = 'FETCH_ABORTED' + this.type = 'aborted' + Error.captureStackTrace(this, this.constructor) + } + + get name () { + return 'AbortError' + } + + // don't allow name to be overridden, but don't throw either + set name (s) {} +} +module.exports = AbortError diff --git a/deps/npm/node_modules/minipass-fetch/lib/blob.js b/deps/npm/node_modules/minipass-fetch/lib/blob.js new file mode 100644 index 00000000000000..9225db6f6ac3f2 --- /dev/null +++ b/deps/npm/node_modules/minipass-fetch/lib/blob.js @@ -0,0 +1,97 @@ +'use strict' +const Minipass = require('minipass') +const TYPE = Symbol('type') +const BUFFER = Symbol('buffer') + +class Blob { + constructor (blobParts, options) { + this[TYPE] = '' + + const buffers = [] + let size = 0 + + if (blobParts) { + const a = blobParts + const length = Number(a.length) + for (let i = 0; i < length; i++) { + const element = a[i] + const buffer = element instanceof Buffer ? element + : ArrayBuffer.isView(element) + ? Buffer.from(element.buffer, element.byteOffset, element.byteLength) + : element instanceof ArrayBuffer ? Buffer.from(element) + : element instanceof Blob ? element[BUFFER] + : typeof element === 'string' ? Buffer.from(element) + : Buffer.from(String(element)) + size += buffer.length + buffers.push(buffer) + } + } + + this[BUFFER] = Buffer.concat(buffers, size) + + const type = options && options.type !== undefined + && String(options.type).toLowerCase() + if (type && !/[^\u0020-\u007E]/.test(type)) { + this[TYPE] = type + } + } + + get size () { + return this[BUFFER].length + } + + get type () { + return this[TYPE] + } + + text () { + return Promise.resolve(this[BUFFER].toString()) + } + + arrayBuffer () { + const buf = this[BUFFER] + const off = buf.byteOffset + const len = buf.byteLength + const ab = buf.buffer.slice(off, off + len) + return Promise.resolve(ab) + } + + stream () { + return new Minipass().end(this[BUFFER]) + } + + slice (start, end, type) { + const size = this.size + const relativeStart = start === undefined ? 0 + : start < 0 ? Math.max(size + start, 0) + : Math.min(start, size) + const relativeEnd = end === undefined ? size + : end < 0 ? Math.max(size + end, 0) + : Math.min(end, size) + const span = Math.max(relativeEnd - relativeStart, 0) + + const buffer = this[BUFFER] + const slicedBuffer = buffer.slice( + relativeStart, + relativeStart + span + ) + const blob = new Blob([], { type }) + blob[BUFFER] = slicedBuffer + return blob + } + + get [Symbol.toStringTag] () { + return 'Blob' + } + + static get BUFFER () { + return BUFFER + } +} + +Object.defineProperties(Blob.prototype, { + size: { enumerable: true }, + type: { enumerable: true }, +}) + +module.exports = Blob diff --git a/deps/npm/node_modules/minipass-fetch/lib/body.js b/deps/npm/node_modules/minipass-fetch/lib/body.js new file mode 100644 index 00000000000000..fb7ffc356fb6d5 --- /dev/null +++ b/deps/npm/node_modules/minipass-fetch/lib/body.js @@ -0,0 +1,334 @@ +'use strict' +const Minipass = require('minipass') +const MinipassSized = require('minipass-sized') + +const Blob = require('./blob.js') +const {BUFFER} = Blob +const FetchError = require('./fetch-error.js') + +// optional dependency on 'encoding' +let convert +try { + convert = require('encoding').convert +} catch (e) {} + +const INTERNALS = Symbol('Body internals') +const CONSUME_BODY = Symbol('consumeBody') + +class Body { + constructor (bodyArg, options = {}) { + const { size = 0, timeout = 0 } = options + const body = bodyArg === undefined || bodyArg === null ? null + : isURLSearchParams(bodyArg) ? Buffer.from(bodyArg.toString()) + : isBlob(bodyArg) ? bodyArg + : Buffer.isBuffer(bodyArg) ? bodyArg + : Object.prototype.toString.call(bodyArg) === '[object ArrayBuffer]' + ? Buffer.from(bodyArg) + : ArrayBuffer.isView(bodyArg) + ? Buffer.from(bodyArg.buffer, bodyArg.byteOffset, bodyArg.byteLength) + : Minipass.isStream(bodyArg) ? bodyArg + : Buffer.from(String(bodyArg)) + + this[INTERNALS] = { + body, + disturbed: false, + error: null, + } + + this.size = size + this.timeout = timeout + + if (Minipass.isStream(body)) { + body.on('error', er => { + const error = er.name === 'AbortError' ? er + : new FetchError(`Invalid response while trying to fetch ${ + this.url}: ${er.message}`, 'system', er) + this[INTERNALS].error = error + }) + } + } + + get body () { + return this[INTERNALS].body + } + + get bodyUsed () { + return this[INTERNALS].disturbed + } + + arrayBuffer () { + return this[CONSUME_BODY]().then(buf => + buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength)) + } + + blob () { + const ct = this.headers && this.headers.get('content-type') || '' + return this[CONSUME_BODY]().then(buf => Object.assign( + new Blob([], { type: ct.toLowerCase() }), + { [BUFFER]: buf } + )) + } + + json () { + return this[CONSUME_BODY]().then(buf => { + try { + return JSON.parse(buf.toString()) + } catch (er) { + return Promise.reject(new FetchError( + `invalid json response body at ${ + this.url} reason: ${er.message}`, 'invalid-json')) + } + }) + } + + text () { + return this[CONSUME_BODY]().then(buf => buf.toString()) + } + + buffer () { + return this[CONSUME_BODY]() + } + + textConverted () { + return this[CONSUME_BODY]().then(buf => convertBody(buf, this.headers)) + } + + [CONSUME_BODY] () { + if (this[INTERNALS].disturbed) + return Promise.reject(new TypeError(`body used already for: ${ + this.url}`)) + + this[INTERNALS].disturbed = true + + if (this[INTERNALS].error) + return Promise.reject(this[INTERNALS].error) + + // body is null + if (this.body === null) { + return Promise.resolve(Buffer.alloc(0)) + } + + if (Buffer.isBuffer(this.body)) + return Promise.resolve(this.body) + + const upstream = isBlob(this.body) ? this.body.stream() : this.body + + /* istanbul ignore if: should never happen */ + if (!Minipass.isStream(upstream)) + return Promise.resolve(Buffer.alloc(0)) + + const stream = this.size && upstream instanceof MinipassSized ? upstream + : !this.size && upstream instanceof Minipass && + !(upstream instanceof MinipassSized) ? upstream + : this.size ? new MinipassSized({ size: this.size }) + : new Minipass() + + // allow timeout on slow response body + const resTimeout = this.timeout ? setTimeout(() => { + stream.emit('error', new FetchError( + `Response timeout while trying to fetch ${ + this.url} (over ${this.timeout}ms)`, 'body-timeout')) + }, this.timeout) : null + + // do not keep the process open just for this timeout, even + // though we expect it'll get cleared eventually. + if (resTimeout) { + resTimeout.unref() + } + + // do the pipe in the promise, because the pipe() can send too much + // data through right away and upset the MP Sized object + return new Promise((resolve, reject) => { + // if the stream is some other kind of stream, then pipe through a MP + // so we can collect it more easily. + if (stream !== upstream) { + upstream.on('error', er => stream.emit('error', er)) + upstream.pipe(stream) + } + resolve() + }).then(() => stream.concat()).then(buf => { + clearTimeout(resTimeout) + return buf + }).catch(er => { + clearTimeout(resTimeout) + // request was aborted, reject with this Error + if (er.name === 'AbortError' || er.name === 'FetchError') + throw er + else if (er.name === 'RangeError') + throw new FetchError(`Could not create Buffer from response body for ${ + this.url}: ${er.message}`, 'system', er) + else + // other errors, such as incorrect content-encoding or content-length + throw new FetchError(`Invalid response body while trying to fetch ${ + this.url}: ${er.message}`, 'system', er) + }) + } + + static clone (instance) { + if (instance.bodyUsed) + throw new Error('cannot clone body after it is used') + + const body = instance.body + + // check that body is a stream and not form-data object + // NB: can't clone the form-data object without having it as a dependency + if (Minipass.isStream(body) && typeof body.getBoundary !== 'function') { + // create a dedicated tee stream so that we don't lose data + // potentially sitting in the body stream's buffer by writing it + // immediately to p1 and not having it for p2. + const tee = new Minipass() + const p1 = new Minipass() + const p2 = new Minipass() + tee.on('error', er => { + p1.emit('error', er) + p2.emit('error', er) + }) + body.on('error', er => tee.emit('error', er)) + tee.pipe(p1) + tee.pipe(p2) + body.pipe(tee) + // set instance body to one fork, return the other + instance[INTERNALS].body = p1 + return p2 + } else + return instance.body + } + + static extractContentType (body) { + return body === null || body === undefined ? null + : typeof body === 'string' ? 'text/plain;charset=UTF-8' + : isURLSearchParams(body) + ? 'application/x-www-form-urlencoded;charset=UTF-8' + : isBlob(body) ? body.type || null + : Buffer.isBuffer(body) ? null + : Object.prototype.toString.call(body) === '[object ArrayBuffer]' ? null + : ArrayBuffer.isView(body) ? null + : typeof body.getBoundary === 'function' + ? `multipart/form-data;boundary=${body.getBoundary()}` + : Minipass.isStream(body) ? null + : 'text/plain;charset=UTF-8' + } + + static getTotalBytes (instance) { + const {body} = instance + return (body === null || body === undefined) ? 0 + : isBlob(body) ? body.size + : Buffer.isBuffer(body) ? body.length + : body && typeof body.getLengthSync === 'function' && ( + // detect form data input from form-data module + body._lengthRetrievers && + /* istanbul ignore next */ body._lengthRetrievers.length == 0 || // 1.x + body.hasKnownLength && body.hasKnownLength()) // 2.x + ? body.getLengthSync() + : null + } + + static writeToStream (dest, instance) { + const {body} = instance + + if (body === null || body === undefined) + dest.end() + else if (Buffer.isBuffer(body) || typeof body === 'string') + dest.end(body) + else { + // body is stream or blob + const stream = isBlob(body) ? body.stream() : body + stream.on('error', er => dest.emit('error', er)).pipe(dest) + } + + return dest + } +} + +Object.defineProperties(Body.prototype, { + body: { enumerable: true }, + bodyUsed: { enumerable: true }, + arrayBuffer: { enumerable: true }, + blob: { enumerable: true }, + json: { enumerable: true }, + text: { enumerable: true } +}) + + +const isURLSearchParams = obj => + // Duck-typing as a necessary condition. + (typeof obj !== 'object' || + typeof obj.append !== 'function' || + typeof obj.delete !== 'function' || + typeof obj.get !== 'function' || + typeof obj.getAll !== 'function' || + typeof obj.has !== 'function' || + typeof obj.set !== 'function') ? false + // Brand-checking and more duck-typing as optional condition. + : obj.constructor.name === 'URLSearchParams' || + Object.prototype.toString.call(obj) === '[object URLSearchParams]' || + typeof obj.sort === 'function' + +const isBlob = obj => + typeof obj === 'object' && + typeof obj.arrayBuffer === 'function' && + typeof obj.type === 'string' && + typeof obj.stream === 'function' && + typeof obj.constructor === 'function' && + typeof obj.constructor.name === 'string' && + /^(Blob|File)$/.test(obj.constructor.name) && + /^(Blob|File)$/.test(obj[Symbol.toStringTag]) + + +const convertBody = (buffer, headers) => { + /* istanbul ignore if */ + if (typeof convert !== 'function') + throw new Error('The package `encoding` must be installed to use the textConverted() function') + + const ct = headers && headers.get('content-type') + let charset = 'utf-8' + let res, str + + // header + if (ct) + res = /charset=([^;]*)/i.exec(ct) + + // no charset in content type, peek at response body for at most 1024 bytes + str = buffer.slice(0, 1024).toString() + + // html5 + if (!res && str) + res = / this.expect + ? 'max-size' : type + this.message = message + Error.captureStackTrace(this, this.constructor) + } + + get name () { + return 'FetchError' + } + + // don't allow name to be overwritten + set name (n) {} + + get [Symbol.toStringTag] () { + return 'FetchError' + } +} +module.exports = FetchError diff --git a/deps/npm/node_modules/minipass-fetch/lib/headers.js b/deps/npm/node_modules/minipass-fetch/lib/headers.js new file mode 100644 index 00000000000000..233675fb1f78da --- /dev/null +++ b/deps/npm/node_modules/minipass-fetch/lib/headers.js @@ -0,0 +1,250 @@ +'use strict' +const invalidTokenRegex = /[^\^_`a-zA-Z\-0-9!#$%&'*+.|~]/ +const invalidHeaderCharRegex = /[^\t\x20-\x7e\x80-\xff]/ + +const validateName = name => { + name = `${name}` + if (invalidTokenRegex.test(name) || name === '') + throw new TypeError(`${name} is not a legal HTTP header name`) +} + +const validateValue = value => { + value = `${value}` + if (invalidHeaderCharRegex.test(value)) + throw new TypeError(`${value} is not a legal HTTP header value`) +} + +const find = (map, name) => { + name = name.toLowerCase() + for (const key in map) { + if (key.toLowerCase() === name) + return key + } + return undefined +} + +const MAP = Symbol('map') +class Headers { + constructor (init = undefined) { + this[MAP] = Object.create(null) + if (init instanceof Headers) { + const rawHeaders = init.raw() + const headerNames = Object.keys(rawHeaders) + for (const headerName of headerNames) { + for (const value of rawHeaders[headerName]) { + this.append(headerName, value) + } + } + return + } + + // no-op + if (init === undefined || init === null) + return + + if (typeof init === 'object') { + const method = init[Symbol.iterator] + if (method !== null && method !== undefined) { + if (typeof method !== 'function') + throw new TypeError('Header pairs must be iterable') + + // sequence> + // Note: per spec we have to first exhaust the lists then process them + const pairs = [] + for (const pair of init) { + if (typeof pair !== 'object' || + typeof pair[Symbol.iterator] !== 'function') + throw new TypeError('Each header pair must be iterable') + const arrPair = Array.from(pair) + if (arrPair.length !== 2) + throw new TypeError('Each header pair must be a name/value tuple') + pairs.push(arrPair) + } + + for (const pair of pairs) { + this.append(pair[0], pair[1]) + } + } else { + // record + for (const key of Object.keys(init)) { + this.append(key, init[key]) + } + } + } else + throw new TypeError('Provided initializer must be an object') + } + + get (name) { + name = `${name}` + validateName(name) + const key = find(this[MAP], name) + if (key === undefined) + return null + + return this[MAP][key].join(', ') + } + + forEach (callback, thisArg = undefined) { + let pairs = getHeaders(this) + for (let i = 0; i < pairs.length; i++) { + const [name, value] = pairs[i] + callback.call(thisArg, value, name, this) + // refresh in case the callback added more headers + pairs = getHeaders(this) + } + } + + set (name, value) { + name = `${name}` + value = `${value}` + validateName(name) + validateValue(value) + const key = find(this[MAP], name) + this[MAP][key !== undefined ? key : name] = [value] + } + + append (name, value) { + name = `${name}` + value = `${value}` + validateName(name) + validateValue(value) + const key = find(this[MAP], name) + if (key !== undefined) + this[MAP][key].push(value) + else + this[MAP][name] = [value] + } + + has (name) { + name = `${name}` + validateName(name) + return find(this[MAP], name) !== undefined + } + + delete (name) { + name = `${name}` + validateName(name) + const key = find(this[MAP], name) + if (key !== undefined) + delete this[MAP][key] + } + + raw () { + return this[MAP] + } + + keys () { + return new HeadersIterator(this, 'key') + } + + values () { + return new HeadersIterator(this, 'value') + } + + [Symbol.iterator]() { + return new HeadersIterator(this, 'key+value') + } + + entries () { + return new HeadersIterator(this, 'key+value') + } + + get [Symbol.toStringTag] () { + return 'Headers' + } + + static exportNodeCompatibleHeaders (headers) { + const obj = Object.assign(Object.create(null), headers[MAP]) + + // http.request() only supports string as Host header. This hack makes + // specifying custom Host header possible. + const hostHeaderKey = find(headers[MAP], 'Host') + if (hostHeaderKey !== undefined) + obj[hostHeaderKey] = obj[hostHeaderKey][0] + + return obj + } + + static createHeadersLenient (obj) { + const headers = new Headers() + for (const name of Object.keys(obj)) { + if (invalidTokenRegex.test(name)) + continue + + if (Array.isArray(obj[name])) { + for (const val of obj[name]) { + if (invalidHeaderCharRegex.test(val)) + continue + + if (headers[MAP][name] === undefined) + headers[MAP][name] = [val] + else + headers[MAP][name].push(val) + } + } else if (!invalidHeaderCharRegex.test(obj[name])) + headers[MAP][name] = [obj[name]] + } + return headers + } +} + +Object.defineProperties(Headers.prototype, { + get: { enumerable: true }, + forEach: { enumerable: true }, + set: { enumerable: true }, + append: { enumerable: true }, + has: { enumerable: true }, + delete: { enumerable: true }, + keys: { enumerable: true }, + values: { enumerable: true }, + entries: { enumerable: true }, +}) + +const getHeaders = (headers, kind = 'key+value') => + Object.keys(headers[MAP]).sort().map( + kind === 'key' ? k => k.toLowerCase() + : kind === 'value' ? k => headers[MAP][k].join(', ') + : k => [k.toLowerCase(), headers[MAP][k].join(', ')] + ) + +const INTERNAL = Symbol('internal') + +class HeadersIterator { + constructor (target, kind) { + this[INTERNAL] = { + target, + kind, + index: 0, + } + } + + get [Symbol.toStringTag] () { + return 'HeadersIterator' + } + + next () { + /* istanbul ignore if: should be impossible */ + if (!this || Object.getPrototypeOf(this) !== HeadersIterator.prototype) + throw new TypeError('Value of `this` is not a HeadersIterator') + + const { target, kind, index } = this[INTERNAL] + const values = getHeaders(target, kind) + const len = values.length + if (index >= len) { + return { + value: undefined, + done: true, + } + } + + this[INTERNAL].index++ + + return { value: values[index], done: false } + } +} + +// manually extend because 'extends' requires a ctor +Object.setPrototypeOf(HeadersIterator.prototype, + Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]()))) + +module.exports = Headers diff --git a/deps/npm/node_modules/minipass-fetch/lib/index.js b/deps/npm/node_modules/minipass-fetch/lib/index.js new file mode 100644 index 00000000000000..d6ed57942e80f4 --- /dev/null +++ b/deps/npm/node_modules/minipass-fetch/lib/index.js @@ -0,0 +1,320 @@ +'use strict' +const Url = require('url') +const http = require('http') +const https = require('https') +const zlib = require('minizlib') +const Minipass = require('minipass') + +const Body = require('./body.js') +const { writeToStream, getTotalBytes } = Body +const Response = require('./response.js') +const Headers = require('./headers.js') +const { createHeadersLenient } = Headers +const Request = require('./request.js') +const { getNodeRequestOptions } = Request +const FetchError = require('./fetch-error.js') +const AbortError = require('./abort-error.js') + +const resolveUrl = Url.resolve + +const fetch = (url, opts) => { + if (/^data:/.test(url)) { + const request = new Request(url, opts) + try { + const split = url.split(',') + const data = Buffer.from(split[1], 'base64') + const type = split[0].match(/^data:(.*);base64$/)[1] + return Promise.resolve(new Response(data, { + headers: { + 'Content-Type': type, + 'Content-Length': data.length, + } + })) + } catch (er) { + return Promise.reject(new FetchError(`[${request.method}] ${ + request.url} invalid URL, ${er.message}`, 'system', er)) + } + } + + return new Promise((resolve, reject) => { + // build request object + const request = new Request(url, opts) + let options + try { + options = getNodeRequestOptions(request) + } catch (er) { + return reject(er) + } + + const send = (options.protocol === 'https:' ? https : http).request + const { signal } = request + let response = null + const abort = () => { + const error = new AbortError('The user aborted a request.') + reject(error) + if (Minipass.isStream(request.body) && + typeof request.body.destroy === 'function') { + request.body.destroy(error) + } + if (response && response.body) { + response.body.emit('error', error) + } + } + + if (signal && signal.aborted) + return abort() + + const abortAndFinalize = () => { + abort() + finalize() + } + + const finalize = () => { + req.abort() + if (signal) + signal.removeEventListener('abort', abortAndFinalize) + clearTimeout(reqTimeout) + } + + // send request + const req = send(options) + + if (signal) + signal.addEventListener('abort', abortAndFinalize) + + let reqTimeout = null + if (request.timeout) { + req.once('socket', socket => { + reqTimeout = setTimeout(() => { + reject(new FetchError(`network timeout at: ${ + request.url}`, 'request-timeout')) + finalize() + }, request.timeout) + }) + } + + req.on('error', er => { + reject(new FetchError(`request to ${request.url} failed, reason: ${ + er.message}`, 'system', er)) + finalize() + }) + + req.on('response', res => { + clearTimeout(reqTimeout) + + const headers = createHeadersLenient(res.headers) + + // HTTP fetch step 5 + if (fetch.isRedirect(res.statusCode)) { + // HTTP fetch step 5.2 + const location = headers.get('Location') + + // HTTP fetch step 5.3 + const locationURL = location === null ? null + : resolveUrl(request.url, location) + + // HTTP fetch step 5.5 + switch (request.redirect) { + case 'error': + reject(new FetchError(`uri requested responds with a redirect, redirect mode is set to error: ${ + request.url}`, 'no-redirect')) + finalize() + return + + case 'manual': + // node-fetch-specific step: make manual redirect a bit easier to + // use by setting the Location header value to the resolved URL. + if (locationURL !== null) { + // handle corrupted header + try { + headers.set('Location', locationURL) + } catch (err) { + /* istanbul ignore next: nodejs server prevent invalid + response headers, we can't test this through normal + request */ + reject(err) + } + } + break + + case 'follow': + // HTTP-redirect fetch step 2 + if (locationURL === null) { + break + } + + // HTTP-redirect fetch step 5 + if (request.counter >= request.follow) { + reject(new FetchError(`maximum redirect reached at: ${ + request.url}`, 'max-redirect')) + finalize() + return + } + + // HTTP-redirect fetch step 9 + if (res.statusCode !== 303 && + request.body && + getTotalBytes(request) === null) { + reject(new FetchError( + 'Cannot follow redirect with body being a readable stream', + 'unsupported-redirect' + )) + finalize() + return + } + + // Update host due to redirection + request.headers.set('host', Url.parse(locationURL).host) + + // HTTP-redirect fetch step 6 (counter increment) + // Create a new Request object. + const requestOpts = { + headers: new Headers(request.headers), + follow: request.follow, + counter: request.counter + 1, + agent: request.agent, + compress: request.compress, + method: request.method, + body: request.body, + signal: request.signal, + timeout: request.timeout, + } + + // HTTP-redirect fetch step 11 + if (res.statusCode === 303 || ( + (res.statusCode === 301 || res.statusCode === 302) && + request.method === 'POST' + )) { + requestOpts.method = 'GET' + requestOpts.body = undefined + requestOpts.headers.delete('content-length') + } + + // HTTP-redirect fetch step 15 + resolve(fetch(new Request(locationURL, requestOpts))) + finalize() + return + } + } // end if(isRedirect) + + + // prepare response + res.once('end', () => + signal && signal.removeEventListener('abort', abortAndFinalize)) + + const body = new Minipass() + // exceedingly rare that the stream would have an error, + // but just in case we proxy it to the stream in use. + res.on('error', /* istanbul ignore next */ er => body.emit('error', er)) + res.on('data', (chunk) => body.write(chunk)) + res.on('end', () => body.end()) + + const responseOptions = { + url: request.url, + status: res.statusCode, + statusText: res.statusMessage, + headers: headers, + size: request.size, + timeout: request.timeout, + counter: request.counter, + trailer: new Promise(resolve => + res.on('end', () => resolve(createHeadersLenient(res.trailers)))) + } + + // HTTP-network fetch step 12.1.1.3 + const codings = headers.get('Content-Encoding') + + // HTTP-network fetch step 12.1.1.4: handle content codings + + // in following scenarios we ignore compression support + // 1. compression support is disabled + // 2. HEAD request + // 3. no Content-Encoding header + // 4. no content response (204) + // 5. content not modified response (304) + if (!request.compress || + request.method === 'HEAD' || + codings === null || + res.statusCode === 204 || + res.statusCode === 304) { + response = new Response(body, responseOptions) + resolve(response) + return + } + + + // Be less strict when decoding compressed responses, since sometimes + // servers send slightly invalid responses that are still accepted + // by common browsers. + // Always using Z_SYNC_FLUSH is what cURL does. + const zlibOptions = { + flush: zlib.constants.Z_SYNC_FLUSH, + finishFlush: zlib.constants.Z_SYNC_FLUSH, + } + + // for gzip + if (codings == 'gzip' || codings == 'x-gzip') { + const unzip = new zlib.Gunzip(zlibOptions) + response = new Response( + // exceedingly rare that the stream would have an error, + // but just in case we proxy it to the stream in use. + body.on('error', /* istanbul ignore next */ er => unzip.emit('error', er)).pipe(unzip), + responseOptions + ) + resolve(response) + return + } + + // for deflate + if (codings == 'deflate' || codings == 'x-deflate') { + // handle the infamous raw deflate response from old servers + // a hack for old IIS and Apache servers + const raw = res.pipe(new Minipass()) + raw.once('data', chunk => { + // see http://stackoverflow.com/questions/37519828 + const decoder = (chunk[0] & 0x0F) === 0x08 + ? new zlib.Inflate() + : new zlib.InflateRaw() + // exceedingly rare that the stream would have an error, + // but just in case we proxy it to the stream in use. + body.on('error', /* istanbul ignore next */ er => decoder.emit('error', er)).pipe(decoder) + response = new Response(decoder, responseOptions) + resolve(response) + }) + return + } + + + // for br + if (codings == 'br' && typeof zlib.BrotliDecompress === 'function') { + const decoder = new zlib.BrotliDecompress() + // exceedingly rare that the stream would have an error, + // but just in case we proxy it to the stream in use. + body.on('error', /* istanbul ignore next */ er => decoder.emit('error', er)).pipe(decoder) + response = new Response(decoder, responseOptions) + resolve(response) + return + } + + // otherwise, use response as-is + response = new Response(body, responseOptions) + resolve(response) + }) + + writeToStream(req, request) + }) +} + +module.exports = fetch + +fetch.isRedirect = code => + code === 301 || + code === 302 || + code === 303 || + code === 307 || + code === 308 + +fetch.Headers = Headers +fetch.Request = Request +fetch.Response = Response +fetch.FetchError = FetchError diff --git a/deps/npm/node_modules/minipass-fetch/lib/request.js b/deps/npm/node_modules/minipass-fetch/lib/request.js new file mode 100644 index 00000000000000..0eb571c95d4301 --- /dev/null +++ b/deps/npm/node_modules/minipass-fetch/lib/request.js @@ -0,0 +1,258 @@ +'use strict' +const Url = require('url') +const Minipass = require('minipass') +const Headers = require('./headers.js') +const { exportNodeCompatibleHeaders } = Headers +const Body = require('./body.js') +const { clone, extractContentType, getTotalBytes } = Body + +const version = require('../package.json').version +const defaultUserAgent = + `minipass-fetch/${version} (+https://github.com/isaacs/minipass-fetch)` + +const INTERNALS = Symbol('Request internals') + +const { parse: parseUrl, format: formatUrl } = Url + +const isRequest = input => + typeof input === 'object' && typeof input[INTERNALS] === 'object' + +const isAbortSignal = signal => { + const proto = ( + signal + && typeof signal === 'object' + && Object.getPrototypeOf(signal) + ) + return !!(proto && proto.constructor.name === 'AbortSignal') +} + +class Request extends Body { + constructor (input, init = {}) { + const parsedURL = isRequest(input) ? Url.parse(input.url) + : input && input.href ? Url.parse(input.href) + : Url.parse(`${input}`) + + if (!isRequest(input)) + input = {} + + const method = (init.method || input.method || 'GET').toUpperCase() + const isGETHEAD = method === 'GET' || method === 'HEAD' + + if ((init.body !== null && init.body !== undefined || + isRequest(input) && input.body !== null) && isGETHEAD) + throw new TypeError('Request with GET/HEAD method cannot have body') + + const inputBody = init.body !== null && init.body !== undefined ? init.body + : isRequest(input) && input.body !== null ? clone(input) + : null + + super(inputBody, { + timeout: init.timeout || input.timeout || 0, + size: init.size || input.size || 0, + }) + + const headers = new Headers(init.headers || input.headers || {}) + + if (inputBody !== null && inputBody !== undefined && + !headers.has('Content-Type')) { + const contentType = extractContentType(inputBody) + if (contentType) + headers.append('Content-Type', contentType) + } + + const signal = 'signal' in init ? init.signal + : isRequest(input) ? input.signal + : null + + if (signal !== null && signal !== undefined && !isAbortSignal(signal)) + throw new TypeError('Expected signal must be an instanceof AbortSignal') + + // TLS specific options that are handled by node + const { + ca, + cert, + ciphers, + clientCertEngine, + crl, + dhparam, + ecdhCurve, + honorCipherOrder, + key, + passphrase, + pfx, + rejectUnauthorized = true, + secureOptions, + secureProtocol, + servername, + sessionIdContext, + } = init + + this[INTERNALS] = { + method, + redirect: init.redirect || input.redirect || 'follow', + headers, + parsedURL, + signal, + ca, + cert, + ciphers, + clientCertEngine, + crl, + dhparam, + ecdhCurve, + honorCipherOrder, + key, + passphrase, + pfx, + rejectUnauthorized, + secureOptions, + secureProtocol, + servername, + sessionIdContext, + } + + // node-fetch-only options + this.follow = init.follow !== undefined ? init.follow + : input.follow !== undefined ? input.follow + : 20 + this.compress = init.compress !== undefined ? init.compress + : input.compress !== undefined ? input.compress + : true + this.counter = init.counter || input.counter || 0 + this.agent = init.agent || input.agent + } + + get method() { + return this[INTERNALS].method + } + + get url() { + return formatUrl(this[INTERNALS].parsedURL) + } + + get headers() { + return this[INTERNALS].headers + } + + get redirect() { + return this[INTERNALS].redirect + } + + get signal() { + return this[INTERNALS].signal + } + + clone () { + return new Request(this) + } + + get [Symbol.toStringTag] () { + return 'Request' + } + + static getNodeRequestOptions (request) { + const parsedURL = request[INTERNALS].parsedURL + const headers = new Headers(request[INTERNALS].headers) + + // fetch step 1.3 + if (!headers.has('Accept')) + headers.set('Accept', '*/*') + + // Basic fetch + if (!parsedURL.protocol || !parsedURL.hostname) + throw new TypeError('Only absolute URLs are supported') + + if (!/^https?:$/.test(parsedURL.protocol)) + throw new TypeError('Only HTTP(S) protocols are supported') + + if (request.signal && + Minipass.isStream(request.body) && + typeof request.body.destroy !== 'function') { + throw new Error( + 'Cancellation of streamed requests with AbortSignal is not supported') + } + + // HTTP-network-or-cache fetch steps 2.4-2.7 + const contentLengthValue = + (request.body === null || request.body === undefined) && + /^(POST|PUT)$/i.test(request.method) ? '0' + : request.body !== null && request.body !== undefined + ? getTotalBytes(request) + : null + + if (contentLengthValue) + headers.set('Content-Length', contentLengthValue + '') + + // HTTP-network-or-cache fetch step 2.11 + if (!headers.has('User-Agent')) + headers.set('User-Agent', defaultUserAgent) + + // HTTP-network-or-cache fetch step 2.15 + if (request.compress && !headers.has('Accept-Encoding')) + headers.set('Accept-Encoding', 'gzip,deflate') + + const agent = typeof request.agent === 'function' + ? request.agent(parsedURL) + : request.agent + + if (!headers.has('Connection') && !agent) + headers.set('Connection', 'close') + + // TLS specific options that are handled by node + const { + ca, + cert, + ciphers, + clientCertEngine, + crl, + dhparam, + ecdhCurve, + honorCipherOrder, + key, + passphrase, + pfx, + rejectUnauthorized, + secureOptions, + secureProtocol, + servername, + sessionIdContext, + } = request[INTERNALS] + + // HTTP-network fetch step 4.2 + // chunked encoding is handled by Node.js + + return { + ...parsedURL, + method: request.method, + headers: exportNodeCompatibleHeaders(headers), + agent, + ca, + cert, + ciphers, + clientCertEngine, + crl, + dhparam, + ecdhCurve, + honorCipherOrder, + key, + passphrase, + pfx, + rejectUnauthorized, + secureOptions, + secureProtocol, + servername, + sessionIdContext, + } + } +} + +module.exports = Request + +Object.defineProperties(Request.prototype, { + method: { enumerable: true }, + url: { enumerable: true }, + headers: { enumerable: true }, + redirect: { enumerable: true }, + clone: { enumerable: true }, + signal: { enumerable: true }, +}) diff --git a/deps/npm/node_modules/minipass-fetch/lib/response.js b/deps/npm/node_modules/minipass-fetch/lib/response.js new file mode 100644 index 00000000000000..854f789f89cfa1 --- /dev/null +++ b/deps/npm/node_modules/minipass-fetch/lib/response.js @@ -0,0 +1,89 @@ +'use strict' +const http = require('http') +const { STATUS_CODES } = http + +const Headers = require('./headers.js') +const Body = require('./body.js') +const { clone, extractContentType } = Body + +const INTERNALS = Symbol('Response internals') + +class Response extends Body { + constructor (body = null, opts = {}) { + super(body, opts) + + const status = opts.status || 200 + const headers = new Headers(opts.headers) + + if (body !== null && body !== undefined && !headers.has('Content-Type')) { + const contentType = extractContentType(body) + if (contentType) + headers.append('Content-Type', contentType) + } + + this[INTERNALS] = { + url: opts.url, + status, + statusText: opts.statusText || STATUS_CODES[status], + headers, + counter: opts.counter, + trailer: Promise.resolve(opts.trailer || new Headers()), + } + } + + get trailer () { + return this[INTERNALS].trailer + } + + get url () { + return this[INTERNALS].url || '' + } + + get status () { + return this[INTERNALS].status + } + + get ok () { + return this[INTERNALS].status >= 200 && this[INTERNALS].status < 300 + } + + get redirected () { + return this[INTERNALS].counter > 0 + } + + get statusText () { + return this[INTERNALS].statusText + } + + get headers () { + return this[INTERNALS].headers + } + + clone () { + return new Response(clone(this), { + url: this.url, + status: this.status, + statusText: this.statusText, + headers: this.headers, + ok: this.ok, + redirected: this.redirected, + trailer: this.trailer, + }) + } + + get [Symbol.toStringTag] () { + return 'Response' + } +} + +module.exports = Response + +Object.defineProperties(Response.prototype, { + url: { enumerable: true }, + status: { enumerable: true }, + ok: { enumerable: true }, + redirected: { enumerable: true }, + statusText: { enumerable: true }, + headers: { enumerable: true }, + clone: { enumerable: true }, +}) diff --git a/deps/npm/node_modules/minipass-fetch/package.json b/deps/npm/node_modules/minipass-fetch/package.json new file mode 100644 index 00000000000000..a9585c9516c182 --- /dev/null +++ b/deps/npm/node_modules/minipass-fetch/package.json @@ -0,0 +1,54 @@ +{ + "name": "minipass-fetch", + "version": "1.3.2", + "description": "An implementation of window.fetch in Node.js using Minipass streams", + "license": "MIT", + "main": "lib/index.js", + "scripts": { + "test": "tap", + "snap": "tap", + "preversion": "npm test", + "postversion": "npm publish", + "postpublish": "git push origin --follow-tags" + }, + "tap": { + "coverage-map": "map.js", + "check-coverage": true + }, + "devDependencies": { + "@ungap/url-search-params": "^0.1.2", + "abort-controller": "^3.0.0", + "abortcontroller-polyfill": "^1.3.0", + "form-data": "^2.5.1", + "parted": "^0.1.1", + "string-to-arraybuffer": "^1.0.2", + "tap": "^14.6.9", + "whatwg-url": "^7.0.0" + }, + "dependencies": { + "encoding": "^0.1.12", + "minipass": "^3.1.0", + "minipass-sized": "^1.0.3", + "minizlib": "^2.0.0" + }, + "optionalDependencies": { + "encoding": "^0.1.12" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/npm/minipass-fetch.git" + }, + "keywords": [ + "fetch", + "minipass", + "node-fetch", + "window.fetch" + ], + "files": [ + "index.js", + "lib/*.js" + ], + "engines": { + "node": ">=8" + } +} diff --git a/deps/npm/node_modules/lockfile/LICENSE b/deps/npm/node_modules/minipass-flush/LICENSE similarity index 100% rename from deps/npm/node_modules/lockfile/LICENSE rename to deps/npm/node_modules/minipass-flush/LICENSE diff --git a/deps/npm/node_modules/minipass-flush/README.md b/deps/npm/node_modules/minipass-flush/README.md new file mode 100644 index 00000000000000..7eea40013a08d5 --- /dev/null +++ b/deps/npm/node_modules/minipass-flush/README.md @@ -0,0 +1,47 @@ +# minipass-flush + +A Minipass stream that calls a flush function before emitting 'end' + +## USAGE + +```js +const Flush = require('minipass-flush') +cons f = new Flush({ + flush (cb) { + // call the cb when done, or return a promise + // the 'end' event will wait for it, along with + // close, finish, and prefinish. + // call the cb with an error, or return a rejecting + // promise to emit 'error' instead of doing the 'end' + return rerouteAllEncryptions().then(() => clearAllChannels()) + }, + // all other minipass options accepted as well +}) + +someDataSource.pipe(f).on('end', () => { + // proper flushing has been accomplished +}) + +// Or as a subclass implementing a 'flush' method: +class MyFlush extends Flush { + flush (cb) { + // old fashioned callback style! + rerouteAllEncryptions(er => { + if (er) + return cb(er) + clearAllChannels(er => { + if (er) + cb(er) + cb() + }) + }) + } +} +``` + +That's about it. + +If your `flush` method doesn't have to do anything asynchronous, then it's +better to call the callback right away in this tick, rather than returning +`Promise.resolve()`, so that the `end` event can happen as soon as +possible. diff --git a/deps/npm/node_modules/minipass-flush/index.js b/deps/npm/node_modules/minipass-flush/index.js new file mode 100644 index 00000000000000..cb2537fa6b2b57 --- /dev/null +++ b/deps/npm/node_modules/minipass-flush/index.js @@ -0,0 +1,39 @@ +const Minipass = require('minipass') +const _flush = Symbol('_flush') +const _flushed = Symbol('_flushed') +const _flushing = Symbol('_flushing') +class Flush extends Minipass { + constructor (opt = {}) { + if (typeof opt === 'function') + opt = { flush: opt } + + super(opt) + + // or extend this class and provide a 'flush' method in your subclass + if (typeof opt.flush !== 'function' && typeof this.flush !== 'function') + throw new TypeError('must provide flush function in options') + + this[_flush] = opt.flush || this.flush + } + + emit (ev, ...data) { + if ((ev !== 'end' && ev !== 'finish') || this[_flushed]) + return super.emit(ev, ...data) + + if (this[_flushing]) + return + + this[_flushing] = true + + const afterFlush = er => { + this[_flushed] = true + er ? super.emit('error', er) : super.emit('end') + } + + const ret = this[_flush](afterFlush) + if (ret && ret.then) + ret.then(() => afterFlush(), er => afterFlush(er)) + } +} + +module.exports = Flush diff --git a/deps/npm/node_modules/minipass-flush/package.json b/deps/npm/node_modules/minipass-flush/package.json new file mode 100644 index 00000000000000..09127d0ec2015c --- /dev/null +++ b/deps/npm/node_modules/minipass-flush/package.json @@ -0,0 +1,39 @@ +{ + "name": "minipass-flush", + "version": "1.0.5", + "description": "A Minipass stream that calls a flush function before emitting 'end'", + "author": "Isaac Z. Schlueter (https://izs.me)", + "license": "ISC", + "scripts": { + "test": "tap", + "snap": "tap", + "preversion": "npm test", + "postversion": "npm publish", + "postpublish": "git push origin --follow-tags" + }, + "tap": { + "check-coverage": true + }, + "devDependencies": { + "tap": "^14.6.9" + }, + "dependencies": { + "minipass": "^3.0.0" + }, + "files": [ + "index.js" + ], + "main": "index.js", + "repository": { + "type": "git", + "url": "git+https://github.com/isaacs/minipass-flush.git" + }, + "keywords": [ + "minipass", + "flush", + "stream" + ], + "engines": { + "node": ">= 8" + } +} diff --git a/deps/npm/node_modules/minipass-json-stream/LICENSE b/deps/npm/node_modules/minipass-json-stream/LICENSE new file mode 100644 index 00000000000000..2781a897b60fe1 --- /dev/null +++ b/deps/npm/node_modules/minipass-json-stream/LICENSE @@ -0,0 +1,27 @@ +The MIT License + +Copyright (c) Isaac Z. Schlueter and Contributors +Copyright (c) 2011 Dominic Tarr + +Permission is hereby granted, free of charge, to any person obtaining a +copy of this software and associated documentation files (the "Software"), +to deal in the Software without restriction, including without limitation +the rights to use, copy, modify, merge, publish, distribute, sublicense, +and/or sell copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. + +---- +This is a derivative work based on JSONStream by Dominic Tarr, modified and +redistributed according to the terms of the MIT license above. +https://github.com/dominictarr/JSONStream diff --git a/deps/npm/node_modules/minipass-json-stream/README.md b/deps/npm/node_modules/minipass-json-stream/README.md new file mode 100644 index 00000000000000..ab7ab087d09ef2 --- /dev/null +++ b/deps/npm/node_modules/minipass-json-stream/README.md @@ -0,0 +1,189 @@ +# minipass-json-stream + +Like [JSONStream](http://npm.im/JSONStream), but using Minipass streams + +## install + +``` +npm install minipass-json-stream +``` + +## example + +```js + +const request = require('request') +const JSONStream = require('minipass-json-stream') +const es = require('event-stream') + +request({url: 'http://isaacs.couchone.com/registry/_all_docs'}) + .pipe(JSONStream.parse('rows.*')) + .pipe(es.mapSync(function (data) { + console.error(data) + return data + })) +``` + +## new JSONStream(options) + +Create a new stream. This is a [minipass](http://npm.im/minipass) stream +that is always set in `objectMode`. It emits objects parsed out of +string/buffer JSON input that match the supplied `path` option. + +## JSONStream.parse(path) + +Return a new JSONStream object to stream values that match a path. + +(Equivalent to `new JSONStream({path})`.) + +``` js +JSONStream.parse('rows.*.doc') +``` + +The `..` operator is the recursive descent operator from +[JSONPath](http://goessner.net/articles/JsonPath/), which will match a +child at any depth (see examples below). + +If your keys have keys that include `.` or `*` etc, use an array instead. +`['row', true, /^doc/]`. + +If you use an array, `RegExp`s, booleans, and/or functions. The `..` +operator is also available in array representation, using `{recurse: +true}`. any object that matches the path will be emitted as 'data' (and +`pipe`d down stream) + +If `path` is empty or null, no 'data' events are emitted. + +If you want to have keys emitted, you can prefix your `*` operator with +`$`: `obj.$*` - in this case the data passed to the stream is an object +with a `key` holding the key and a `value` property holding the data. + +### Examples + +query a couchdb view: + +``` bash +curl -sS localhost:5984/tests/_all_docs&include_docs=true +``` +you will get something like this: + +``` js +{"total_rows":129,"offset":0,"rows":[ + { "id":"change1_0.6995461115147918" + , "key":"change1_0.6995461115147918" + , "value":{"rev":"1-e240bae28c7bb3667f02760f6398d508"} + , "doc":{ + "_id": "change1_0.6995461115147918" + , "_rev": "1-e240bae28c7bb3667f02760f6398d508","hello":1} + }, + { "id":"change2_0.6995461115147918" + , "key":"change2_0.6995461115147918" + , "value":{"rev":"1-13677d36b98c0c075145bb8975105153"} + , "doc":{ + "_id":"change2_0.6995461115147918" + , "_rev":"1-13677d36b98c0c075145bb8975105153" + , "hello":2 + } + }, +]} +``` + +we are probably most interested in the `rows.*.doc` + +create a `JSONStream` that parses the documents from the feed like this: + +``` js +var stream = JSONStream.parse(['rows', true, 'doc']) //rows, ANYTHING, doc + +stream.on('data', function(data) { + console.log('received:', data); +}); + +//emits anything from _before_ the first match +stream.on('header', function (data) { + console.log('header:', data) // => {"total_rows":129,"offset":0} +}) +``` + +awesome! + +In case you wanted the contents the doc emitted: + +``` js +// equivalent to: 'rows.*.doc.$*' +var stream = JSONStream.parse([ + 'rows', + true, + 'doc', + {emitKey: true} +]) //rows, ANYTHING, doc, items in docs with keys + +stream.on('data', function(data) { + console.log('key:', data.key); + console.log('value:', data.value); +}); +``` + +You can also emit the path: + +``` js +var stream = JSONStream.parse([ + 'rows', + true, + 'doc', + {emitPath: true} +]) //rows, ANYTHING, doc, items in docs with keys + +stream.on('data', function(data) { + console.log('path:', data.path); + console.log('value:', data.value); +}); +``` + +### recursive patterns (..) + +`JSONStream.parse('docs..value')` +(or `JSONStream.parse(['docs', {recurse: true}, 'value'])` using an array) +will emit every `value` object that is a child, grand-child, etc. of the +`docs` object. In this example, it will match exactly 5 times at various depth +levels, emitting 0, 1, 2, 3 and 4 as results. + +```js +{ + "total": 5, + "docs": [ + { + "key": { + "value": 0, + "some": "property" + } + }, + {"value": 1}, + {"value": 2}, + {"blbl": [{}, {"a":0, "b":1, "value":3}, 10]}, + {"value": 4} + ] +} +``` + +## JSONStream.parse(pattern, map) + +(Equivalent to `new JSONStream({ pattern, map })`) + +provide a function that can be used to map or filter +the json output. `map` is passed the value at that node of the pattern, +if `map` return non-nullish (anything but `null` or `undefined`) +that value will be emitted in the stream. If it returns a nullish value, +nothing will be emitted. + +`JSONStream` also emits `'header'` and `'footer'` events, +the `'header'` event contains anything in the output that was before +the first match, and the `'footer'`, is anything after the last match. + +## Acknowlegements + +This module is a fork of [JSONStream](http://npm.im/JSONStream) by Dominic +Tarr, modified and redistributed under the terms of the MIT license. + +this module depends on https://github.com/creationix/jsonparse +by Tim Caswell diff --git a/deps/npm/node_modules/minipass-json-stream/index.js b/deps/npm/node_modules/minipass-json-stream/index.js new file mode 100644 index 00000000000000..5168d1322ac20f --- /dev/null +++ b/deps/npm/node_modules/minipass-json-stream/index.js @@ -0,0 +1,227 @@ +// put javascript in here +'use strict' + +const Parser = require('jsonparse') +const Minipass = require('minipass') + +class JSONStreamError extends Error { + constructor (err, caller) { + super(err.message) + Error.captureStackTrace(this, caller || this.constructor) + } + get name () { + return 'JSONStreamError' + } + set name (n) {} +} + +const check = (x, y) => + typeof x === 'string' ? String(y) === x + : x && typeof x.test === 'function' ? x.test(y) + : typeof x === 'boolean' || typeof x === 'object' ? x + : typeof x === 'function' ? x(y) + : false + +const _parser = Symbol('_parser') +const _onValue = Symbol('_onValue') +const _onTokenOriginal = Symbol('_onTokenOriginal') +const _onToken = Symbol('_onToken') +const _onError = Symbol('_onError') +const _count = Symbol('_count') +const _path = Symbol('_path') +const _map = Symbol('_map') +const _root = Symbol('_root') +const _header = Symbol('_header') +const _footer = Symbol('_footer') +const _setHeaderFooter = Symbol('_setHeaderFooter') +const _ending = Symbol('_ending') + +class JSONStream extends Minipass { + constructor (opts = {}) { + super({ + ...opts, + objectMode: true, + }) + + this[_ending] = false + const parser = this[_parser] = new Parser() + parser.onValue = value => this[_onValue](value) + this[_onTokenOriginal] = parser.onToken + parser.onToken = (token, value) => this[_onToken](token, value) + parser.onError = er => this[_onError](er) + + this[_count] = 0 + this[_path] = typeof opts.path === 'string' + ? opts.path.split('.').map(e => + e === '$*' ? { emitKey: true } + : e === '*' ? true + : e === '' ? { recurse: true } + : e) + : Array.isArray(opts.path) && opts.path.length ? opts.path + : null + + this[_map] = typeof opts.map === 'function' ? opts.map : null + this[_root] = null + this[_header] = null + this[_footer] = null + this[_count] = 0 + } + + [_setHeaderFooter] (key, value) { + // header has not been emitted yet + if (this[_header] !== false) { + this[_header] = this[_header] || {} + this[_header][key] = value + } + + // footer has not been emitted yet but header has + if (this[_footer] !== false && this[_header] === false) { + this[_footer] = this[_footer] || {} + this[_footer][key] = value + } + } + + [_onError] (er) { + // error will always happen during a write() call. + const caller = this[_ending] ? this.end : this.write + this[_ending] = false + return this.emit('error', new JSONStreamError(er, caller)) + } + + [_onToken] (token, value) { + const parser = this[_parser] + this[_onTokenOriginal].call(parser, token, value) + if (parser.stack.length === 0) { + if (this[_root]) { + const root = this[_root] + if (!this[_path]) + super.write(root) + this[_root] = null + this[_count] = 0 + } + } + } + + [_onValue] (value) { + const parser = this[_parser] + // the LAST onValue encountered is the root object. + // just overwrite it each time. + this[_root] = value + + if(!this[_path]) return + + let i = 0 // iterates on path + let j = 0 // iterates on stack + let emitKey = false + let emitPath = false + while (i < this[_path].length) { + const key = this[_path][i] + j++ + + if (key && !key.recurse) { + const c = (j === parser.stack.length) ? parser : parser.stack[j] + if (!c) return + if (!check(key, c.key)) { + this[_setHeaderFooter](c.key, value) + return + } + emitKey = !!key.emitKey; + emitPath = !!key.emitPath; + i++ + } else { + i++ + if (i >= this[_path].length) + return + const nextKey = this[_path][i] + if (!nextKey) + return + while (true) { + const c = (j === parser.stack.length) ? parser : parser.stack[j] + if (!c) return + if (check(nextKey, c.key)) { + i++ + if (!Object.isFrozen(parser.stack[j])) + parser.stack[j].value = null + break + } else { + this[_setHeaderFooter](c.key, value) + } + j++ + } + } + } + + // emit header + if (this[_header]) { + const header = this[_header] + this[_header] = false + this.emit('header', header) + } + if (j !== parser.stack.length) return + + this[_count] ++ + const actualPath = parser.stack.slice(1) + .map(e => e.key).concat([parser.key]) + if (value !== null && value !== undefined) { + const data = this[_map] ? this[_map](value, actualPath) : value + if (data !== null && data !== undefined) { + const emit = emitKey || emitPath ? { value: data } : data + if (emitKey) + emit.key = parser.key + if (emitPath) + emit.path = actualPath + super.write(emit) + } + } + + if (parser.value) + delete parser.value[parser.key] + + for (const k of parser.stack) { + k.value = null + } + } + + write (chunk, encoding, cb) { + if (typeof encoding === 'function') + cb = encoding, encoding = null + if (typeof chunk === 'string') + chunk = Buffer.from(chunk, encoding) + else if (!Buffer.isBuffer(chunk)) + return this.emit('error', new TypeError( + 'Can only parse JSON from string or buffer input')) + this[_parser].write(chunk) + if (cb) + cb() + return this.flowing + } + + end (chunk, encoding, cb) { + this[_ending] = true + if (typeof encoding === 'function') + cb = encoding, encoding = null + if (typeof chunk === 'function') + cb = chunk, chunk = null + if (chunk) + this.write(chunk, encoding) + if (cb) + this.once('end', cb) + + const h = this[_header] + this[_header] = null + const f = this[_footer] + this[_footer] = null + if (h) + this.emit('header', h) + if (f) + this.emit('footer', f) + return super.end() + } + + static get JSONStreamError () { return JSONStreamError } + static parse (path, map) { + return new JSONStream({path, map}) + } +} + +module.exports = JSONStream diff --git a/deps/npm/node_modules/minipass-json-stream/package.json b/deps/npm/node_modules/minipass-json-stream/package.json new file mode 100644 index 00000000000000..19d1f358fce621 --- /dev/null +++ b/deps/npm/node_modules/minipass-json-stream/package.json @@ -0,0 +1,39 @@ +{ + "name": "minipass-json-stream", + "version": "1.0.1", + "description": "Like JSONStream, but using Minipass streams", + "author": "Isaac Z. Schlueter (https://izs.me)", + "license": "MIT", + "scripts": { + "test": "tap", + "snap": "tap", + "preversion": "npm test", + "postversion": "npm publish", + "postpublish": "git push origin --follow-tags" + }, + "tap": { + "check-coverage": true + }, + "devDependencies": { + "JSONStream": "^1.3.5", + "tap": "^14.6.9" + }, + "dependencies": { + "jsonparse": "^1.3.1", + "minipass": "^3.0.0" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/npm/minipass-json-stream.git" + }, + "keywords": [ + "stream", + "json", + "parse", + "minipass", + "JSONStream" + ], + "files": [ + "index.js" + ] +} diff --git a/deps/npm/node_modules/proto-list/LICENSE b/deps/npm/node_modules/minipass-pipeline/LICENSE similarity index 100% rename from deps/npm/node_modules/proto-list/LICENSE rename to deps/npm/node_modules/minipass-pipeline/LICENSE diff --git a/deps/npm/node_modules/minipass-pipeline/README.md b/deps/npm/node_modules/minipass-pipeline/README.md new file mode 100644 index 00000000000000..12daa99f0b086a --- /dev/null +++ b/deps/npm/node_modules/minipass-pipeline/README.md @@ -0,0 +1,69 @@ +# minipass-pipeline + +Create a pipeline of streams using Minipass. + +Calls `.pipe()` on all the streams in the list. Returns a stream where +writes got to the first pipe in the chain, and reads are from the last. + +Errors are proxied along the chain and emitted on the Pipeline stream. + +## USAGE + +```js +const Pipeline = require('minipass-pipeline') + +// the list of streams to pipeline together, +// a bit like `input | transform | output` in bash +const p = new Pipeline(input, transform, output) + +p.write('foo') // writes to input +p.on('data', chunk => doSomething()) // reads from output stream + +// less contrived example (but still pretty contrived)... +const decode = new bunzipDecoder() +const unpack = tar.extract({ cwd: 'target-dir' }) +const tbz = new Pipeline(decode, unpack) + +fs.createReadStream('archive.tbz').pipe(tbz) + +// specify any minipass options if you like, as the first argument +// it'll only try to pipeline event emitters with a .pipe() method +const p = new Pipeline({ objectMode: true }, input, transform, output) + +// If you don't know the things to pipe in right away, that's fine. +// use p.push(stream) to add to the end, or p.unshift(stream) to the front +const databaseDecoderStreamDoohickey = (connectionInfo) => { + const p = new Pipeline() + logIntoDatabase(connectionInfo).then(connection => { + initializeDecoderRing(connectionInfo).then(decoderRing => { + p.push(connection, decoderRing) + getUpstreamSource(upstream => { + p.unshift(upstream) + }) + }) + }) + // return to caller right away + // emitted data will be upstream -> connection -> decoderRing pipeline + return p +} +``` + +Pipeline is a [minipass](http://npm.im/minipass) stream, so it's as +synchronous as the streams it wraps. It will buffer data until there is a +reader, but no longer, so make sure to attach your listeners before you +pipe it somewhere else. + +## `new Pipeline(opts = {}, ...streams)` + +Create a new Pipeline with the specified Minipass options and any streams +provided. + +## `pipeline.push(stream, ...)` + +Attach one or more streams to the pipeline at the end (read) side of the +pipe chain. + +## `pipeline.unshift(stream, ...)` + +Attach one or more streams to the pipeline at the start (write) side of the +pipe chain. diff --git a/deps/npm/node_modules/minipass-pipeline/index.js b/deps/npm/node_modules/minipass-pipeline/index.js new file mode 100644 index 00000000000000..b94ea14b602bef --- /dev/null +++ b/deps/npm/node_modules/minipass-pipeline/index.js @@ -0,0 +1,128 @@ +const Minipass = require('minipass') +const EE = require('events') +const isStream = s => s && s instanceof EE && ( + typeof s.pipe === 'function' || // readable + (typeof s.write === 'function' && typeof s.end === 'function') // writable +) + +const _head = Symbol('_head') +const _tail = Symbol('_tail') +const _linkStreams = Symbol('_linkStreams') +const _setHead = Symbol('_setHead') +const _setTail = Symbol('_setTail') +const _onError = Symbol('_onError') +const _onData = Symbol('_onData') +const _onEnd = Symbol('_onEnd') +const _onDrain = Symbol('_onDrain') +const _streams = Symbol('_streams') +class Pipeline extends Minipass { + constructor (opts, ...streams) { + if (isStream(opts)) { + streams.unshift(opts) + opts = {} + } + + super(opts) + this[_streams] = [] + if (streams.length) + this.push(...streams) + } + + [_linkStreams] (streams) { + // reduce takes (left,right), and we return right to make it the + // new left value. + return streams.reduce((src, dest) => { + src.on('error', er => dest.emit('error', er)) + src.pipe(dest) + return dest + }) + } + + push (...streams) { + this[_streams].push(...streams) + if (this[_tail]) + streams.unshift(this[_tail]) + + const linkRet = this[_linkStreams](streams) + + this[_setTail](linkRet) + if (!this[_head]) + this[_setHead](streams[0]) + } + + unshift (...streams) { + this[_streams].unshift(...streams) + if (this[_head]) + streams.push(this[_head]) + + const linkRet = this[_linkStreams](streams) + this[_setHead](streams[0]) + if (!this[_tail]) + this[_setTail](linkRet) + } + + destroy (er) { + // set fire to the whole thing. + this[_streams].forEach(s => + typeof s.destroy === 'function' && s.destroy()) + return super.destroy(er) + } + + // readable interface -> tail + [_setTail] (stream) { + this[_tail] = stream + stream.on('error', er => this[_onError](stream, er)) + stream.on('data', chunk => this[_onData](stream, chunk)) + stream.on('end', () => this[_onEnd](stream)) + stream.on('finish', () => this[_onEnd](stream)) + } + + // errors proxied down the pipeline + // they're considered part of the "read" interface + [_onError] (stream, er) { + if (stream === this[_tail]) + this.emit('error', er) + } + [_onData] (stream, chunk) { + if (stream === this[_tail]) + super.write(chunk) + } + [_onEnd] (stream) { + if (stream === this[_tail]) + super.end() + } + pause () { + super.pause() + return this[_tail] && this[_tail].pause && this[_tail].pause() + } + + // NB: Minipass calls its internal private [RESUME] method during + // pipe drains, to avoid hazards where stream.resume() is overridden. + // Thus, we need to listen to the resume *event*, not override the + // resume() method, and proxy *that* to the tail. + emit (ev, ...args) { + if (ev === 'resume' && this[_tail] && this[_tail].resume) + this[_tail].resume() + return super.emit(ev, ...args) + } + + // writable interface -> head + [_setHead] (stream) { + this[_head] = stream + stream.on('drain', () => this[_onDrain](stream)) + } + [_onDrain] (stream) { + if (stream === this[_head]) + this.emit('drain') + } + write (chunk, enc, cb) { + return this[_head].write(chunk, enc, cb) && + (this.flowing || this.buffer.length === 0) + } + end (chunk, enc, cb) { + this[_head].end(chunk, enc, cb) + return this + } +} + +module.exports = Pipeline diff --git a/deps/npm/node_modules/minipass-pipeline/package.json b/deps/npm/node_modules/minipass-pipeline/package.json new file mode 100644 index 00000000000000..d608dc66ce515d --- /dev/null +++ b/deps/npm/node_modules/minipass-pipeline/package.json @@ -0,0 +1,29 @@ +{ + "name": "minipass-pipeline", + "version": "1.2.4", + "description": "create a pipeline of streams using Minipass", + "author": "Isaac Z. Schlueter (https://izs.me)", + "license": "ISC", + "scripts": { + "test": "tap", + "snap": "tap", + "preversion": "npm test", + "postversion": "npm publish", + "postpublish": "git push origin --follow-tags" + }, + "tap": { + "check-coverage": true + }, + "devDependencies": { + "tap": "^14.6.9" + }, + "dependencies": { + "minipass": "^3.0.0" + }, + "files": [ + "index.js" + ], + "engines": { + "node": ">=8" + } +} diff --git a/deps/npm/node_modules/minipass-sized/.npmignore b/deps/npm/node_modules/minipass-sized/.npmignore new file mode 100644 index 00000000000000..2bec044be4bbda --- /dev/null +++ b/deps/npm/node_modules/minipass-sized/.npmignore @@ -0,0 +1,22 @@ +# ignore most things, include some others +/* +/.* + +!bin/ +!lib/ +!docs/ +!package.json +!package-lock.json +!README.md +!CONTRIBUTING.md +!LICENSE +!CHANGELOG.md +!example/ +!scripts/ +!tap-snapshots/ +!test/ +!.travis.yml +!.gitignore +!.gitattributes +!coverage-map.js +!index.js diff --git a/deps/npm/node_modules/pseudomap/LICENSE b/deps/npm/node_modules/minipass-sized/LICENSE similarity index 100% rename from deps/npm/node_modules/pseudomap/LICENSE rename to deps/npm/node_modules/minipass-sized/LICENSE diff --git a/deps/npm/node_modules/minipass-sized/README.md b/deps/npm/node_modules/minipass-sized/README.md new file mode 100644 index 00000000000000..6da403e6a2dab5 --- /dev/null +++ b/deps/npm/node_modules/minipass-sized/README.md @@ -0,0 +1,28 @@ +# minipass-sized + +A Minipass stream that raises an error if you get a different number of +bytes than expected. + +## USAGE + +Use just like any old [minipass](http://npm.im/minipass) stream, but +provide a `size` option to the constructor. + +The `size` option must be a positive integer, smaller than +`Number.MAX_SAFE_INTEGER`. + +```js +const MinipassSized = require('minipass-sized') +// figure out how much data you expect to get +const expectedSize = +headers['content-length'] +const stream = new MinipassSized({ size: expectedSize }) +stream.on('error', er => { + // if it's the wrong size, then this will raise an error with + // { found: , expect: , code: 'EBADSIZE' } +}) +response.pipe(stream) +``` + +Caveats: this does not work with `objectMode` streams, and will throw a +`TypeError` from the constructor if the size argument is missing or +invalid. diff --git a/deps/npm/node_modules/minipass-sized/index.js b/deps/npm/node_modules/minipass-sized/index.js new file mode 100644 index 00000000000000..a0c8acde487fce --- /dev/null +++ b/deps/npm/node_modules/minipass-sized/index.js @@ -0,0 +1,67 @@ +const Minipass = require('minipass') + +class SizeError extends Error { + constructor (found, expect) { + super(`Bad data size: expected ${expect} bytes, but got ${found}`) + this.expect = expect + this.found = found + this.code = 'EBADSIZE' + Error.captureStackTrace(this, this.constructor) + } + get name () { + return 'SizeError' + } +} + +class MinipassSized extends Minipass { + constructor (options = {}) { + super(options) + + if (options.objectMode) + throw new TypeError(`${ + this.constructor.name + } streams only work with string and buffer data`) + + this.found = 0 + this.expect = options.size + if (typeof this.expect !== 'number' || + this.expect > Number.MAX_SAFE_INTEGER || + isNaN(this.expect) || + this.expect < 0 || + !isFinite(this.expect) || + this.expect !== Math.floor(this.expect)) + throw new Error('invalid expected size: ' + this.expect) + } + + write (chunk, encoding, cb) { + const buffer = Buffer.isBuffer(chunk) ? chunk + : typeof chunk === 'string' ? + Buffer.from(chunk, typeof encoding === 'string' ? encoding : 'utf8') + : chunk + + if (!Buffer.isBuffer(buffer)) { + this.emit('error', new TypeError(`${ + this.constructor.name + } streams only work with string and buffer data`)) + return false + } + + this.found += buffer.length + if (this.found > this.expect) + this.emit('error', new SizeError(this.found, this.expect)) + + return super.write(chunk, encoding, cb) + } + + emit (ev, ...data) { + if (ev === 'end') { + if (this.found !== this.expect) + this.emit('error', new SizeError(this.found, this.expect)) + } + return super.emit(ev, ...data) + } +} + +MinipassSized.SizeError = SizeError + +module.exports = MinipassSized diff --git a/deps/npm/node_modules/minipass-sized/package.json b/deps/npm/node_modules/minipass-sized/package.json new file mode 100644 index 00000000000000..a3257fd8f673ae --- /dev/null +++ b/deps/npm/node_modules/minipass-sized/package.json @@ -0,0 +1,39 @@ +{ + "name": "minipass-sized", + "version": "1.0.3", + "description": "A Minipass stream that raises an error if you get a different number of bytes than expected", + "author": "Isaac Z. Schlueter (https://izs.me)", + "license": "ISC", + "scripts": { + "test": "tap", + "snap": "tap", + "preversion": "npm test", + "postversion": "npm publish", + "postpublish": "git push origin --follow-tags" + }, + "tap": { + "check-coverage": true + }, + "devDependencies": { + "tap": "^14.6.4" + }, + "dependencies": { + "minipass": "^3.0.0" + }, + "main": "index.js", + "keywords": [ + "minipass", + "size", + "length" + ], + "directories": { + "test": "test" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/isaacs/minipass-sized.git" + }, + "engines": { + "node": ">=8" + } +} diff --git a/deps/npm/node_modules/minipass-sized/test/basic.js b/deps/npm/node_modules/minipass-sized/test/basic.js new file mode 100644 index 00000000000000..bbdcadaa8c4e27 --- /dev/null +++ b/deps/npm/node_modules/minipass-sized/test/basic.js @@ -0,0 +1,83 @@ +const t = require('tap') +const MPS = require('../') + +t.test('ok if size checks out', t => { + const mps = new MPS({ size: 4 }) + + mps.write(Buffer.from('a').toString('hex'), 'hex') + mps.write(Buffer.from('sd')) + mps.end('f') + return mps.concat().then(data => t.equal(data.toString(), 'asdf')) +}) + +t.test('error if size exceeded', t => { + const mps = new MPS({ size: 1 }) + mps.on('error', er => { + t.match(er, { + message: 'Bad data size: expected 1 bytes, but got 4', + found: 4, + expect: 1, + code: 'EBADSIZE', + name: 'SizeError', + }) + t.end() + }) + mps.write('asdf') +}) + +t.test('error if size is not met', t => { + const mps = new MPS({ size: 999 }) + t.throws(() => mps.end(), { + message: 'Bad data size: expected 999 bytes, but got 0', + found: 0, + name: 'SizeError', + expect: 999, + code: 'EBADSIZE', + }) + t.end() +}) + +t.test('error if non-string/buffer is written', t => { + const mps = new MPS({size:1}) + mps.on('error', er => { + t.match(er, { + message: 'MinipassSized streams only work with string and buffer data' + }) + t.end() + }) + mps.write({some:'object'}) +}) + +t.test('projectiles', t => { + t.throws(() => new MPS(), { + message: 'invalid expected size: undefined' + }, 'size is required') + t.throws(() => new MPS({size: true}), { + message: 'invalid expected size: true' + }, 'size must be number') + t.throws(() => new MPS({size: NaN}), { + message: 'invalid expected size: NaN' + }, 'size must not be NaN') + t.throws(() => new MPS({size:1.2}), { + message: 'invalid expected size: 1.2' + }, 'size must be integer') + t.throws(() => new MPS({size: Infinity}), { + message: 'invalid expected size: Infinity' + }, 'size must be finite') + t.throws(() => new MPS({size: -1}), { + message: 'invalid expected size: -1' + }, 'size must be positive') + t.throws(() => new MPS({objectMode: true}), { + message: 'MinipassSized streams only work with string and buffer data' + }, 'no objectMode') + t.throws(() => new MPS({size: Number.MAX_SAFE_INTEGER + 1000000}), { + message: 'invalid expected size: 9007199255740992' + }) + t.end() +}) + +t.test('exports SizeError class', t => { + t.isa(MPS.SizeError, 'function') + t.isa(MPS.SizeError.prototype, Error) + t.end() +}) diff --git a/deps/npm/node_modules/fs-minipass/node_modules/minipass/LICENSE b/deps/npm/node_modules/minipass/LICENSE similarity index 100% rename from deps/npm/node_modules/fs-minipass/node_modules/minipass/LICENSE rename to deps/npm/node_modules/minipass/LICENSE diff --git a/deps/npm/node_modules/minipass/README.md b/deps/npm/node_modules/minipass/README.md new file mode 100644 index 00000000000000..1a6ff7f5d778e2 --- /dev/null +++ b/deps/npm/node_modules/minipass/README.md @@ -0,0 +1,613 @@ +# minipass + +A _very_ minimal implementation of a [PassThrough +stream](https://nodejs.org/api/stream.html#stream_class_stream_passthrough) + +[It's very +fast](https://docs.google.com/spreadsheets/d/1oObKSrVwLX_7Ut4Z6g3fZW-AX1j1-k6w-cDsrkaSbHM/edit#gid=0) +for objects, strings, and buffers. + +Supports pipe()ing (including multi-pipe() and backpressure transmission), +buffering data until either a `data` event handler or `pipe()` is added (so +you don't lose the first chunk), and most other cases where PassThrough is +a good idea. + +There is a `read()` method, but it's much more efficient to consume data +from this stream via `'data'` events or by calling `pipe()` into some other +stream. Calling `read()` requires the buffer to be flattened in some +cases, which requires copying memory. + +There is also no `unpipe()` method. Once you start piping, there is no +stopping it! + +If you set `objectMode: true` in the options, then whatever is written will +be emitted. Otherwise, it'll do a minimal amount of Buffer copying to +ensure proper Streams semantics when `read(n)` is called. + +`objectMode` can also be set by doing `stream.objectMode = true`, or by +writing any non-string/non-buffer data. `objectMode` cannot be set to +false once it is set. + +This is not a `through` or `through2` stream. It doesn't transform the +data, it just passes it right through. If you want to transform the data, +extend the class, and override the `write()` method. Once you're done +transforming the data however you want, call `super.write()` with the +transform output. + +For some examples of streams that extend Minipass in various ways, check +out: + +- [minizlib](http://npm.im/minizlib) +- [fs-minipass](http://npm.im/fs-minipass) +- [tar](http://npm.im/tar) +- [minipass-collect](http://npm.im/minipass-collect) +- [minipass-flush](http://npm.im/minipass-flush) +- [minipass-pipeline](http://npm.im/minipass-pipeline) +- [tap](http://npm.im/tap) +- [tap-parser](http://npm.im/tap) +- [treport](http://npm.im/tap) +- [minipass-fetch](http://npm.im/minipass-fetch) +- [pacote](http://npm.im/pacote) +- [make-fetch-happen](http://npm.im/make-fetch-happen) +- [cacache](http://npm.im/cacache) +- [ssri](http://npm.im/ssri) +- [npm-registry-fetch](http://npm.im/npm-registry-fetch) +- [minipass-json-stream](http://npm.im/minipass-json-stream) +- [minipass-sized](http://npm.im/minipass-sized) + +## Differences from Node.js Streams + +There are several things that make Minipass streams different from (and in +some ways superior to) Node.js core streams. + +Please read these caveats if you are familiar with noode-core streams and +intend to use Minipass streams in your programs. + +### Timing + +Minipass streams are designed to support synchronous use-cases. Thus, data +is emitted as soon as it is available, always. It is buffered until read, +but no longer. Another way to look at it is that Minipass streams are +exactly as synchronous as the logic that writes into them. + +This can be surprising if your code relies on `PassThrough.write()` always +providing data on the next tick rather than the current one, or being able +to call `resume()` and not have the entire buffer disappear immediately. + +However, without this synchronicity guarantee, there would be no way for +Minipass to achieve the speeds it does, or support the synchronous use +cases that it does. Simply put, waiting takes time. + +This non-deferring approach makes Minipass streams much easier to reason +about, especially in the context of Promises and other flow-control +mechanisms. + +### No High/Low Water Marks + +Node.js core streams will optimistically fill up a buffer, returning `true` +on all writes until the limit is hit, even if the data has nowhere to go. +Then, they will not attempt to draw more data in until the buffer size dips +below a minimum value. + +Minipass streams are much simpler. The `write()` method will return `true` +if the data has somewhere to go (which is to say, given the timing +guarantees, that the data is already there by the time `write()` returns). + +If the data has nowhere to go, then `write()` returns false, and the data +sits in a buffer, to be drained out immediately as soon as anyone consumes +it. + +### Hazards of Buffering (or: Why Minipass Is So Fast) + +Since data written to a Minipass stream is immediately written all the way +through the pipeline, and `write()` always returns true/false based on +whether the data was fully flushed, backpressure is communicated +immediately to the upstream caller. This minimizes buffering. + +Consider this case: + +```js +const {PassThrough} = require('stream') +const p1 = new PassThrough({ highWaterMark: 1024 }) +const p2 = new PassThrough({ highWaterMark: 1024 }) +const p3 = new PassThrough({ highWaterMark: 1024 }) +const p4 = new PassThrough({ highWaterMark: 1024 }) + +p1.pipe(p2).pipe(p3).pipe(p4) +p4.on('data', () => console.log('made it through')) + +// this returns false and buffers, then writes to p2 on next tick (1) +// p2 returns false and buffers, pausing p1, then writes to p3 on next tick (2) +// p3 returns false and buffers, pausing p2, then writes to p4 on next tick (3) +// p4 returns false and buffers, pausing p3, then emits 'data' and 'drain' +// on next tick (4) +// p3 sees p4's 'drain' event, and calls resume(), emitting 'resume' and +// 'drain' on next tick (5) +// p2 sees p3's 'drain', calls resume(), emits 'resume' and 'drain' on next tick (6) +// p1 sees p2's 'drain', calls resume(), emits 'resume' and 'drain' on next +// tick (7) + +p1.write(Buffer.alloc(2048)) // returns false +``` + +Along the way, the data was buffered and deferred at each stage, and +multiple event deferrals happened, for an unblocked pipeline where it was +perfectly safe to write all the way through! + +Furthermore, setting a `highWaterMark` of `1024` might lead someone reading +the code to think an advisory maximum of 1KiB is being set for the +pipeline. However, the actual advisory buffering level is the _sum_ of +`highWaterMark` values, since each one has its own bucket. + +Consider the Minipass case: + +```js +const m1 = new Minipass() +const m2 = new Minipass() +const m3 = new Minipass() +const m4 = new Minipass() + +m1.pipe(m2).pipe(m3).pipe(m4) +m4.on('data', () => console.log('made it through')) + +// m1 is flowing, so it writes the data to m2 immediately +// m2 is flowing, so it writes the data to m3 immediately +// m3 is flowing, so it writes the data to m4 immediately +// m4 is flowing, so it fires the 'data' event immediately, returns true +// m4's write returned true, so m3 is still flowing, returns true +// m3's write returned true, so m2 is still flowing, returns true +// m2's write returned true, so m1 is still flowing, returns true +// No event deferrals or buffering along the way! + +m1.write(Buffer.alloc(2048)) // returns true +``` + +It is extremely unlikely that you _don't_ want to buffer any data written, +or _ever_ buffer data that can be flushed all the way through. Neither +node-core streams nor Minipass ever fail to buffer written data, but +node-core streams do a lot of unnecessary buffering and pausing. + +As always, the faster implementation is the one that does less stuff and +waits less time to do it. + +### Immediately emit `end` for empty streams (when not paused) + +If a stream is not paused, and `end()` is called before writing any data +into it, then it will emit `end` immediately. + +If you have logic that occurs on the `end` event which you don't want to +potentially happen immediately (for example, closing file descriptors, +moving on to the next entry in an archive parse stream, etc.) then be sure +to call `stream.pause()` on creation, and then `stream.resume()` once you +are ready to respond to the `end` event. + +### Emit `end` When Asked + +One hazard of immediately emitting `'end'` is that you may not yet have had +a chance to add a listener. In order to avoid this hazard, Minipass +streams safely re-emit the `'end'` event if a new listener is added after +`'end'` has been emitted. + +Ie, if you do `stream.on('end', someFunction)`, and the stream has already +emitted `end`, then it will call the handler right away. (You can think of +this somewhat like attaching a new `.then(fn)` to a previously-resolved +Promise.) + +To prevent calling handlers multiple times who would not expect multiple +ends to occur, all listeners are removed from the `'end'` event whenever it +is emitted. + +### Impact of "immediate flow" on Tee-streams + +A "tee stream" is a stream piping to multiple destinations: + +```js +const tee = new Minipass() +t.pipe(dest1) +t.pipe(dest2) +t.write('foo') // goes to both destinations +``` + +Since Minipass streams _immediately_ process any pending data through the +pipeline when a new pipe destination is added, this can have surprising +effects, especially when a stream comes in from some other function and may +or may not have data in its buffer. + +```js +// WARNING! WILL LOSE DATA! +const src = new Minipass() +src.write('foo') +src.pipe(dest1) // 'foo' chunk flows to dest1 immediately, and is gone +src.pipe(dest2) // gets nothing! +``` + +The solution is to create a dedicated tee-stream junction that pipes to +both locations, and then pipe to _that_ instead. + +```js +// Safe example: tee to both places +const src = new Minipass() +src.write('foo') +const tee = new Minipass() +tee.pipe(dest1) +tee.pipe(dest2) +src.pipe(tee) // tee gets 'foo', pipes to both locations +``` + +The same caveat applies to `on('data')` event listeners. The first one +added will _immediately_ receive all of the data, leaving nothing for the +second: + +```js +// WARNING! WILL LOSE DATA! +const src = new Minipass() +src.write('foo') +src.on('data', handler1) // receives 'foo' right away +src.on('data', handler2) // nothing to see here! +``` + +Using a dedicated tee-stream can be used in this case as well: + +```js +// Safe example: tee to both data handlers +const src = new Minipass() +src.write('foo') +const tee = new Minipass() +tee.on('data', handler1) +tee.on('data', handler2) +src.pipe(tee) +``` + +## USAGE + +It's a stream! Use it like a stream and it'll most likely do what you +want. + +```js +const Minipass = require('minipass') +const mp = new Minipass(options) // optional: { encoding, objectMode } +mp.write('foo') +mp.pipe(someOtherStream) +mp.end('bar') +``` + +### OPTIONS + +* `encoding` How would you like the data coming _out_ of the stream to be + encoded? Accepts any values that can be passed to `Buffer.toString()`. +* `objectMode` Emit data exactly as it comes in. This will be flipped on + by default if you write() something other than a string or Buffer at any + point. Setting `objectMode: true` will prevent setting any encoding + value. + +### API + +Implements the user-facing portions of Node.js's `Readable` and `Writable` +streams. + +### Methods + +* `write(chunk, [encoding], [callback])` - Put data in. (Note that, in the + base Minipass class, the same data will come out.) Returns `false` if + the stream will buffer the next write, or true if it's still in "flowing" + mode. +* `end([chunk, [encoding]], [callback])` - Signal that you have no more + data to write. This will queue an `end` event to be fired when all the + data has been consumed. +* `setEncoding(encoding)` - Set the encoding for data coming of the stream. + This can only be done once. +* `pause()` - No more data for a while, please. This also prevents `end` + from being emitted for empty streams until the stream is resumed. +* `resume()` - Resume the stream. If there's data in the buffer, it is all + discarded. Any buffered events are immediately emitted. +* `pipe(dest)` - Send all output to the stream provided. There is no way + to unpipe. When data is emitted, it is immediately written to any and + all pipe destinations. +* `on(ev, fn)`, `emit(ev, fn)` - Minipass streams are EventEmitters. Some + events are given special treatment, however. (See below under "events".) +* `promise()` - Returns a Promise that resolves when the stream emits + `end`, or rejects if the stream emits `error`. +* `collect()` - Return a Promise that resolves on `end` with an array + containing each chunk of data that was emitted, or rejects if the stream + emits `error`. Note that this consumes the stream data. +* `concat()` - Same as `collect()`, but concatenates the data into a single + Buffer object. Will reject the returned promise if the stream is in + objectMode, or if it goes into objectMode by the end of the data. +* `read(n)` - Consume `n` bytes of data out of the buffer. If `n` is not + provided, then consume all of it. If `n` bytes are not available, then + it returns null. **Note** consuming streams in this way is less + efficient, and can lead to unnecessary Buffer copying. +* `destroy([er])` - Destroy the stream. If an error is provided, then an + `'error'` event is emitted. If the stream has a `close()` method, and + has not emitted a `'close'` event yet, then `stream.close()` will be + called. Any Promises returned by `.promise()`, `.collect()` or + `.concat()` will be rejected. After being destroyed, writing to the + stream will emit an error. No more data will be emitted if the stream is + destroyed, even if it was previously buffered. + +### Properties + +* `bufferLength` Read-only. Total number of bytes buffered, or in the case + of objectMode, the total number of objects. +* `encoding` The encoding that has been set. (Setting this is equivalent + to calling `setEncoding(enc)` and has the same prohibition against + setting multiple times.) +* `flowing` Read-only. Boolean indicating whether a chunk written to the + stream will be immediately emitted. +* `emittedEnd` Read-only. Boolean indicating whether the end-ish events + (ie, `end`, `prefinish`, `finish`) have been emitted. Note that + listening on any end-ish event will immediateyl re-emit it if it has + already been emitted. +* `writable` Whether the stream is writable. Default `true`. Set to + `false` when `end()` +* `readable` Whether the stream is readable. Default `true`. +* `buffer` A [yallist](http://npm.im/yallist) linked list of chunks written + to the stream that have not yet been emitted. (It's probably a bad idea + to mess with this.) +* `pipes` A [yallist](http://npm.im/yallist) linked list of streams that + this stream is piping into. (It's probably a bad idea to mess with + this.) +* `destroyed` A getter that indicates whether the stream was destroyed. +* `paused` True if the stream has been explicitly paused, otherwise false. +* `objectMode` Indicates whether the stream is in `objectMode`. Once set + to `true`, it cannot be set to `false`. + +### Events + +* `data` Emitted when there's data to read. Argument is the data to read. + This is never emitted while not flowing. If a listener is attached, that + will resume the stream. +* `end` Emitted when there's no more data to read. This will be emitted + immediately for empty streams when `end()` is called. If a listener is + attached, and `end` was already emitted, then it will be emitted again. + All listeners are removed when `end` is emitted. +* `prefinish` An end-ish event that follows the same logic as `end` and is + emitted in the same conditions where `end` is emitted. Emitted after + `'end'`. +* `finish` An end-ish event that follows the same logic as `end` and is + emitted in the same conditions where `end` is emitted. Emitted after + `'prefinish'`. +* `close` An indication that an underlying resource has been released. + Minipass does not emit this event, but will defer it until after `end` + has been emitted, since it throws off some stream libraries otherwise. +* `drain` Emitted when the internal buffer empties, and it is again + suitable to `write()` into the stream. +* `readable` Emitted when data is buffered and ready to be read by a + consumer. +* `resume` Emitted when stream changes state from buffering to flowing + mode. (Ie, when `resume` is called, `pipe` is called, or a `data` event + listener is added.) + +### Static Methods + +* `Minipass.isStream(stream)` Returns `true` if the argument is a stream, + and false otherwise. To be considered a stream, the object must be + either an instance of Minipass, or an EventEmitter that has either a + `pipe()` method, or both `write()` and `end()` methods. (Pretty much any + stream in node-land will return `true` for this.) + +## EXAMPLES + +Here are some examples of things you can do with Minipass streams. + +### simple "are you done yet" promise + +```js +mp.promise().then(() => { + // stream is finished +}, er => { + // stream emitted an error +}) +``` + +### collecting + +```js +mp.collect().then(all => { + // all is an array of all the data emitted + // encoding is supported in this case, so + // so the result will be a collection of strings if + // an encoding is specified, or buffers/objects if not. + // + // In an async function, you may do + // const data = await stream.collect() +}) +``` + +### collecting into a single blob + +This is a bit slower because it concatenates the data into one chunk for +you, but if you're going to do it yourself anyway, it's convenient this +way: + +```js +mp.concat().then(onebigchunk => { + // onebigchunk is a string if the stream + // had an encoding set, or a buffer otherwise. +}) +``` + +### iteration + +You can iterate over streams synchronously or asynchronously in platforms +that support it. + +Synchronous iteration will end when the currently available data is +consumed, even if the `end` event has not been reached. In string and +buffer mode, the data is concatenated, so unless multiple writes are +occurring in the same tick as the `read()`, sync iteration loops will +generally only have a single iteration. + +To consume chunks in this way exactly as they have been written, with no +flattening, create the stream with the `{ objectMode: true }` option. + +```js +const mp = new Minipass({ objectMode: true }) +mp.write('a') +mp.write('b') +for (let letter of mp) { + console.log(letter) // a, b +} +mp.write('c') +mp.write('d') +for (let letter of mp) { + console.log(letter) // c, d +} +mp.write('e') +mp.end() +for (let letter of mp) { + console.log(letter) // e +} +for (let letter of mp) { + console.log(letter) // nothing +} +``` + +Asynchronous iteration will continue until the end event is reached, +consuming all of the data. + +```js +const mp = new Minipass({ encoding: 'utf8' }) + +// some source of some data +let i = 5 +const inter = setInterval(() => { + if (i --> 0) + mp.write(Buffer.from('foo\n', 'utf8')) + else { + mp.end() + clearInterval(inter) + } +}, 100) + +// consume the data with asynchronous iteration +async function consume () { + for await (let chunk of mp) { + console.log(chunk) + } + return 'ok' +} + +consume().then(res => console.log(res)) +// logs `foo\n` 5 times, and then `ok` +``` + +### subclass that `console.log()`s everything written into it + +```js +class Logger extends Minipass { + write (chunk, encoding, callback) { + console.log('WRITE', chunk, encoding) + return super.write(chunk, encoding, callback) + } + end (chunk, encoding, callback) { + console.log('END', chunk, encoding) + return super.end(chunk, encoding, callback) + } +} + +someSource.pipe(new Logger()).pipe(someDest) +``` + +### same thing, but using an inline anonymous class + +```js +// js classes are fun +someSource + .pipe(new (class extends Minipass { + emit (ev, ...data) { + // let's also log events, because debugging some weird thing + console.log('EMIT', ev) + return super.emit(ev, ...data) + } + write (chunk, encoding, callback) { + console.log('WRITE', chunk, encoding) + return super.write(chunk, encoding, callback) + } + end (chunk, encoding, callback) { + console.log('END', chunk, encoding) + return super.end(chunk, encoding, callback) + } + })) + .pipe(someDest) +``` + +### subclass that defers 'end' for some reason + +```js +class SlowEnd extends Minipass { + emit (ev, ...args) { + if (ev === 'end') { + console.log('going to end, hold on a sec') + setTimeout(() => { + console.log('ok, ready to end now') + super.emit('end', ...args) + }, 100) + } else { + return super.emit(ev, ...args) + } + } +} +``` + +### transform that creates newline-delimited JSON + +```js +class NDJSONEncode extends Minipass { + write (obj, cb) { + try { + // JSON.stringify can throw, emit an error on that + return super.write(JSON.stringify(obj) + '\n', 'utf8', cb) + } catch (er) { + this.emit('error', er) + } + } + end (obj, cb) { + if (typeof obj === 'function') { + cb = obj + obj = undefined + } + if (obj !== undefined) { + this.write(obj) + } + return super.end(cb) + } +} +``` + +### transform that parses newline-delimited JSON + +```js +class NDJSONDecode extends Minipass { + constructor (options) { + // always be in object mode, as far as Minipass is concerned + super({ objectMode: true }) + this._jsonBuffer = '' + } + write (chunk, encoding, cb) { + if (typeof chunk === 'string' && + typeof encoding === 'string' && + encoding !== 'utf8') { + chunk = Buffer.from(chunk, encoding).toString() + } else if (Buffer.isBuffer(chunk)) + chunk = chunk.toString() + } + if (typeof encoding === 'function') { + cb = encoding + } + const jsonData = (this._jsonBuffer + chunk).split('\n') + this._jsonBuffer = jsonData.pop() + for (let i = 0; i < jsonData.length; i++) { + let parsed + try { + super.write(parsed) + } catch (er) { + this.emit('error', er) + continue + } + } + if (cb) + cb() + } +} +``` diff --git a/deps/npm/node_modules/minipass/index.js b/deps/npm/node_modules/minipass/index.js new file mode 100644 index 00000000000000..56cbd665d2526d --- /dev/null +++ b/deps/npm/node_modules/minipass/index.js @@ -0,0 +1,545 @@ +'use strict' +const EE = require('events') +const Stream = require('stream') +const Yallist = require('yallist') +const SD = require('string_decoder').StringDecoder + +const EOF = Symbol('EOF') +const MAYBE_EMIT_END = Symbol('maybeEmitEnd') +const EMITTED_END = Symbol('emittedEnd') +const EMITTING_END = Symbol('emittingEnd') +const CLOSED = Symbol('closed') +const READ = Symbol('read') +const FLUSH = Symbol('flush') +const FLUSHCHUNK = Symbol('flushChunk') +const ENCODING = Symbol('encoding') +const DECODER = Symbol('decoder') +const FLOWING = Symbol('flowing') +const PAUSED = Symbol('paused') +const RESUME = Symbol('resume') +const BUFFERLENGTH = Symbol('bufferLength') +const BUFFERPUSH = Symbol('bufferPush') +const BUFFERSHIFT = Symbol('bufferShift') +const OBJECTMODE = Symbol('objectMode') +const DESTROYED = Symbol('destroyed') + +// TODO remove when Node v8 support drops +const doIter = global._MP_NO_ITERATOR_SYMBOLS_ !== '1' +const ASYNCITERATOR = doIter && Symbol.asyncIterator + || Symbol('asyncIterator not implemented') +const ITERATOR = doIter && Symbol.iterator + || Symbol('iterator not implemented') + +// events that mean 'the stream is over' +// these are treated specially, and re-emitted +// if they are listened for after emitting. +const isEndish = ev => + ev === 'end' || + ev === 'finish' || + ev === 'prefinish' + +const isArrayBuffer = b => b instanceof ArrayBuffer || + typeof b === 'object' && + b.constructor && + b.constructor.name === 'ArrayBuffer' && + b.byteLength >= 0 + +const isArrayBufferView = b => !Buffer.isBuffer(b) && ArrayBuffer.isView(b) + +module.exports = class Minipass extends Stream { + constructor (options) { + super() + this[FLOWING] = false + // whether we're explicitly paused + this[PAUSED] = false + this.pipes = new Yallist() + this.buffer = new Yallist() + this[OBJECTMODE] = options && options.objectMode || false + if (this[OBJECTMODE]) + this[ENCODING] = null + else + this[ENCODING] = options && options.encoding || null + if (this[ENCODING] === 'buffer') + this[ENCODING] = null + this[DECODER] = this[ENCODING] ? new SD(this[ENCODING]) : null + this[EOF] = false + this[EMITTED_END] = false + this[EMITTING_END] = false + this[CLOSED] = false + this.writable = true + this.readable = true + this[BUFFERLENGTH] = 0 + this[DESTROYED] = false + } + + get bufferLength () { return this[BUFFERLENGTH] } + + get encoding () { return this[ENCODING] } + set encoding (enc) { + if (this[OBJECTMODE]) + throw new Error('cannot set encoding in objectMode') + + if (this[ENCODING] && enc !== this[ENCODING] && + (this[DECODER] && this[DECODER].lastNeed || this[BUFFERLENGTH])) + throw new Error('cannot change encoding') + + if (this[ENCODING] !== enc) { + this[DECODER] = enc ? new SD(enc) : null + if (this.buffer.length) + this.buffer = this.buffer.map(chunk => this[DECODER].write(chunk)) + } + + this[ENCODING] = enc + } + + setEncoding (enc) { + this.encoding = enc + } + + get objectMode () { return this[OBJECTMODE] } + set objectMode (om) { this[OBJECTMODE] = this[OBJECTMODE] || !!om } + + write (chunk, encoding, cb) { + if (this[EOF]) + throw new Error('write after end') + + if (this[DESTROYED]) { + this.emit('error', Object.assign( + new Error('Cannot call write after a stream was destroyed'), + { code: 'ERR_STREAM_DESTROYED' } + )) + return true + } + + if (typeof encoding === 'function') + cb = encoding, encoding = 'utf8' + + if (!encoding) + encoding = 'utf8' + + // convert array buffers and typed array views into buffers + // at some point in the future, we may want to do the opposite! + // leave strings and buffers as-is + // anything else switches us into object mode + if (!this[OBJECTMODE] && !Buffer.isBuffer(chunk)) { + if (isArrayBufferView(chunk)) + chunk = Buffer.from(chunk.buffer, chunk.byteOffset, chunk.byteLength) + else if (isArrayBuffer(chunk)) + chunk = Buffer.from(chunk) + else if (typeof chunk !== 'string') + // use the setter so we throw if we have encoding set + this.objectMode = true + } + + // this ensures at this point that the chunk is a buffer or string + // don't buffer it up or send it to the decoder + if (!this.objectMode && !chunk.length) { + if (this[BUFFERLENGTH] !== 0) + this.emit('readable') + if (cb) + cb() + return this.flowing + } + + // fast-path writing strings of same encoding to a stream with + // an empty buffer, skipping the buffer/decoder dance + if (typeof chunk === 'string' && !this[OBJECTMODE] && + // unless it is a string already ready for us to use + !(encoding === this[ENCODING] && !this[DECODER].lastNeed)) { + chunk = Buffer.from(chunk, encoding) + } + + if (Buffer.isBuffer(chunk) && this[ENCODING]) + chunk = this[DECODER].write(chunk) + + if (this.flowing) { + // if we somehow have something in the buffer, but we think we're + // flowing, then we need to flush all that out first, or we get + // chunks coming in out of order. Can't emit 'drain' here though, + // because we're mid-write, so that'd be bad. + if (this[BUFFERLENGTH] !== 0) + this[FLUSH](true) + this.emit('data', chunk) + } else + this[BUFFERPUSH](chunk) + + if (this[BUFFERLENGTH] !== 0) + this.emit('readable') + + if (cb) + cb() + + return this.flowing + } + + read (n) { + if (this[DESTROYED]) + return null + + try { + if (this[BUFFERLENGTH] === 0 || n === 0 || n > this[BUFFERLENGTH]) + return null + + if (this[OBJECTMODE]) + n = null + + if (this.buffer.length > 1 && !this[OBJECTMODE]) { + if (this.encoding) + this.buffer = new Yallist([ + Array.from(this.buffer).join('') + ]) + else + this.buffer = new Yallist([ + Buffer.concat(Array.from(this.buffer), this[BUFFERLENGTH]) + ]) + } + + return this[READ](n || null, this.buffer.head.value) + } finally { + this[MAYBE_EMIT_END]() + } + } + + [READ] (n, chunk) { + if (n === chunk.length || n === null) + this[BUFFERSHIFT]() + else { + this.buffer.head.value = chunk.slice(n) + chunk = chunk.slice(0, n) + this[BUFFERLENGTH] -= n + } + + this.emit('data', chunk) + + if (!this.buffer.length && !this[EOF]) + this.emit('drain') + + return chunk + } + + end (chunk, encoding, cb) { + if (typeof chunk === 'function') + cb = chunk, chunk = null + if (typeof encoding === 'function') + cb = encoding, encoding = 'utf8' + if (chunk) + this.write(chunk, encoding) + if (cb) + this.once('end', cb) + this[EOF] = true + this.writable = false + + // if we haven't written anything, then go ahead and emit, + // even if we're not reading. + // we'll re-emit if a new 'end' listener is added anyway. + // This makes MP more suitable to write-only use cases. + if (this.flowing || !this[PAUSED]) + this[MAYBE_EMIT_END]() + return this + } + + // don't let the internal resume be overwritten + [RESUME] () { + if (this[DESTROYED]) + return + + this[PAUSED] = false + this[FLOWING] = true + this.emit('resume') + if (this.buffer.length) + this[FLUSH]() + else if (this[EOF]) + this[MAYBE_EMIT_END]() + else + this.emit('drain') + } + + resume () { + return this[RESUME]() + } + + pause () { + this[FLOWING] = false + this[PAUSED] = true + } + + get destroyed () { + return this[DESTROYED] + } + + get flowing () { + return this[FLOWING] + } + + get paused () { + return this[PAUSED] + } + + [BUFFERPUSH] (chunk) { + if (this[OBJECTMODE]) + this[BUFFERLENGTH] += 1 + else + this[BUFFERLENGTH] += chunk.length + return this.buffer.push(chunk) + } + + [BUFFERSHIFT] () { + if (this.buffer.length) { + if (this[OBJECTMODE]) + this[BUFFERLENGTH] -= 1 + else + this[BUFFERLENGTH] -= this.buffer.head.value.length + } + return this.buffer.shift() + } + + [FLUSH] (noDrain) { + do {} while (this[FLUSHCHUNK](this[BUFFERSHIFT]())) + + if (!noDrain && !this.buffer.length && !this[EOF]) + this.emit('drain') + } + + [FLUSHCHUNK] (chunk) { + return chunk ? (this.emit('data', chunk), this.flowing) : false + } + + pipe (dest, opts) { + if (this[DESTROYED]) + return + + const ended = this[EMITTED_END] + opts = opts || {} + if (dest === process.stdout || dest === process.stderr) + opts.end = false + else + opts.end = opts.end !== false + + const p = { dest: dest, opts: opts, ondrain: _ => this[RESUME]() } + this.pipes.push(p) + + dest.on('drain', p.ondrain) + this[RESUME]() + // piping an ended stream ends immediately + if (ended && p.opts.end) + p.dest.end() + return dest + } + + addListener (ev, fn) { + return this.on(ev, fn) + } + + on (ev, fn) { + try { + return super.on(ev, fn) + } finally { + if (ev === 'data' && !this.pipes.length && !this.flowing) + this[RESUME]() + else if (isEndish(ev) && this[EMITTED_END]) { + super.emit(ev) + this.removeAllListeners(ev) + } + } + } + + get emittedEnd () { + return this[EMITTED_END] + } + + [MAYBE_EMIT_END] () { + if (!this[EMITTING_END] && + !this[EMITTED_END] && + !this[DESTROYED] && + this.buffer.length === 0 && + this[EOF]) { + this[EMITTING_END] = true + this.emit('end') + this.emit('prefinish') + this.emit('finish') + if (this[CLOSED]) + this.emit('close') + this[EMITTING_END] = false + } + } + + emit (ev, data) { + // error and close are only events allowed after calling destroy() + if (ev !== 'error' && ev !== 'close' && ev !== DESTROYED && this[DESTROYED]) + return + else if (ev === 'data') { + if (!data) + return + + if (this.pipes.length) + this.pipes.forEach(p => + p.dest.write(data) === false && this.pause()) + } else if (ev === 'end') { + // only actual end gets this treatment + if (this[EMITTED_END] === true) + return + + this[EMITTED_END] = true + this.readable = false + + if (this[DECODER]) { + data = this[DECODER].end() + if (data) { + this.pipes.forEach(p => p.dest.write(data)) + super.emit('data', data) + } + } + + this.pipes.forEach(p => { + p.dest.removeListener('drain', p.ondrain) + if (p.opts.end) + p.dest.end() + }) + } else if (ev === 'close') { + this[CLOSED] = true + // don't emit close before 'end' and 'finish' + if (!this[EMITTED_END] && !this[DESTROYED]) + return + } + + // TODO: replace with a spread operator when Node v4 support drops + const args = new Array(arguments.length) + args[0] = ev + args[1] = data + if (arguments.length > 2) { + for (let i = 2; i < arguments.length; i++) { + args[i] = arguments[i] + } + } + + try { + return super.emit.apply(this, args) + } finally { + if (!isEndish(ev)) + this[MAYBE_EMIT_END]() + else + this.removeAllListeners(ev) + } + } + + // const all = await stream.collect() + collect () { + const buf = [] + if (!this[OBJECTMODE]) + buf.dataLength = 0 + // set the promise first, in case an error is raised + // by triggering the flow here. + const p = this.promise() + this.on('data', c => { + buf.push(c) + if (!this[OBJECTMODE]) + buf.dataLength += c.length + }) + return p.then(() => buf) + } + + // const data = await stream.concat() + concat () { + return this[OBJECTMODE] + ? Promise.reject(new Error('cannot concat in objectMode')) + : this.collect().then(buf => + this[OBJECTMODE] + ? Promise.reject(new Error('cannot concat in objectMode')) + : this[ENCODING] ? buf.join('') : Buffer.concat(buf, buf.dataLength)) + } + + // stream.promise().then(() => done, er => emitted error) + promise () { + return new Promise((resolve, reject) => { + this.on(DESTROYED, () => reject(new Error('stream destroyed'))) + this.on('end', () => resolve()) + this.on('error', er => reject(er)) + }) + } + + // for await (let chunk of stream) + [ASYNCITERATOR] () { + const next = () => { + const res = this.read() + if (res !== null) + return Promise.resolve({ done: false, value: res }) + + if (this[EOF]) + return Promise.resolve({ done: true }) + + let resolve = null + let reject = null + const onerr = er => { + this.removeListener('data', ondata) + this.removeListener('end', onend) + reject(er) + } + const ondata = value => { + this.removeListener('error', onerr) + this.removeListener('end', onend) + this.pause() + resolve({ value: value, done: !!this[EOF] }) + } + const onend = () => { + this.removeListener('error', onerr) + this.removeListener('data', ondata) + resolve({ done: true }) + } + const ondestroy = () => onerr(new Error('stream destroyed')) + return new Promise((res, rej) => { + reject = rej + resolve = res + this.once(DESTROYED, ondestroy) + this.once('error', onerr) + this.once('end', onend) + this.once('data', ondata) + }) + } + + return { next } + } + + // for (let chunk of stream) + [ITERATOR] () { + const next = () => { + const value = this.read() + const done = value === null + return { value, done } + } + return { next } + } + + destroy (er) { + if (this[DESTROYED]) { + if (er) + this.emit('error', er) + else + this.emit(DESTROYED) + return this + } + + this[DESTROYED] = true + + // throw away all buffered data, it's never coming out + this.buffer = new Yallist() + this[BUFFERLENGTH] = 0 + + if (typeof this.close === 'function' && !this[CLOSED]) + this.close() + + if (er) + this.emit('error', er) + else // if no error to emit, still reject pending promises + this.emit(DESTROYED) + + return this + } + + static isStream (s) { + return !!s && (s instanceof Minipass || s instanceof Stream || + s instanceof EE && ( + typeof s.pipe === 'function' || // readable + (typeof s.write === 'function' && typeof s.end === 'function') // writable + )) + } +} diff --git a/deps/npm/node_modules/minipass/package.json b/deps/npm/node_modules/minipass/package.json new file mode 100644 index 00000000000000..54f62d56d46d86 --- /dev/null +++ b/deps/npm/node_modules/minipass/package.json @@ -0,0 +1,39 @@ +{ + "name": "minipass", + "version": "3.1.3", + "description": "minimal implementation of a PassThrough stream", + "main": "index.js", + "dependencies": { + "yallist": "^4.0.0" + }, + "devDependencies": { + "end-of-stream": "^1.4.0", + "tap": "^14.6.5", + "through2": "^2.0.3" + }, + "scripts": { + "test": "tap", + "preversion": "npm test", + "postversion": "npm publish --tag=next", + "postpublish": "git push origin --follow-tags" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/isaacs/minipass.git" + }, + "keywords": [ + "passthrough", + "stream" + ], + "author": "Isaac Z. Schlueter (http://blog.izs.me/)", + "license": "ISC", + "files": [ + "index.js" + ], + "tap": { + "check-coverage": true + }, + "engines": { + "node": ">=8" + } +} diff --git a/deps/npm/node_modules/minizlib/README.md b/deps/npm/node_modules/minizlib/README.md index 4097b85225542f..80e067ab381e1d 100644 --- a/deps/npm/node_modules/minizlib/README.md +++ b/deps/npm/node_modules/minizlib/README.md @@ -51,3 +51,10 @@ const decode = new zlib.BrotliDecompress() const output = whereToWriteTheDecodedData() input.pipe(decode).pipe(output) ``` + +## REPRODUCIBLE BUILDS + +To create reproducible gzip compressed files across different operating +systems, set `portable: true` in the options. This causes minizlib to set +the `OS` indicator in byte 9 of the extended gzip header to `0xFF` for +'unknown'. diff --git a/deps/npm/node_modules/minizlib/index.js b/deps/npm/node_modules/minizlib/index.js index 295047b9c1447d..fbaf69e19f2092 100644 --- a/deps/npm/node_modules/minizlib/index.js +++ b/deps/npm/node_modules/minizlib/index.js @@ -9,6 +9,7 @@ const Minipass = require('minipass') const OriginalBufferConcat = Buffer.concat +const _superWrite = Symbol('_superWrite') class ZlibError extends Error { constructor (err) { super('zlib: ' + err.message) @@ -49,6 +50,7 @@ class ZlibBase extends Minipass { throw new TypeError('invalid options for ZlibBase constructor') super(opts) + this[_sawError] = false this[_ended] = false this[_opts] = opts @@ -63,7 +65,12 @@ class ZlibBase extends Minipass { } this[_onError] = (err) => { + // no sense raising multiple errors, since we abort on the first one. + if (this[_sawError]) + return + this[_sawError] = true + // there is no way to cleanly recover. // continuing only obscures problems. this.close() @@ -156,20 +163,24 @@ class ZlibBase extends Minipass { // `_processChunk()` adds an 'error' listener. If we don't remove it // after each call, these handlers start piling up. this[_handle].removeAllListeners('error') + // make sure OUR error listener is still attached tho } } + if (this[_handle]) + this[_handle].on('error', er => this[_onError](new ZlibError(er))) + let writeReturn if (result) { if (Array.isArray(result) && result.length > 0) { // The first buffer is always `handle._outBuffer`, which would be // re-used for later invocations; so, we always have to copy that one. - writeReturn = super.write(Buffer.from(result[0])) + writeReturn = this[_superWrite](Buffer.from(result[0])) for (let i = 1; i < result.length; i++) { - writeReturn = super.write(result[i]) + writeReturn = this[_superWrite](result[i]) } } else { - writeReturn = super.write(Buffer.from(result)) + writeReturn = this[_superWrite](Buffer.from(result)) } } @@ -177,6 +188,10 @@ class ZlibBase extends Minipass { cb() return writeReturn } + + [_superWrite] (data) { + return super.write(data) + } } class Zlib extends ZlibBase { @@ -243,9 +258,22 @@ class Inflate extends Zlib { } // gzip - bigger header, same deflate compression +const _portable = Symbol('_portable') class Gzip extends Zlib { constructor (opts) { super(opts, 'Gzip') + this[_portable] = opts && !!opts.portable + } + + [_superWrite] (data) { + if (!this[_portable]) + return super[_superWrite](data) + + // we'll always get the header emitted in one first chunk + // overwrite the OS indicator byte with 0xFF + this[_portable] = false + data[9] = 255 + return super[_superWrite](data) } } diff --git a/deps/npm/node_modules/minizlib/node_modules/minipass/README.md b/deps/npm/node_modules/minizlib/node_modules/minipass/README.md deleted file mode 100644 index c989beea0e6d97..00000000000000 --- a/deps/npm/node_modules/minizlib/node_modules/minipass/README.md +++ /dev/null @@ -1,606 +0,0 @@ -# minipass - -A _very_ minimal implementation of a [PassThrough -stream](https://nodejs.org/api/stream.html#stream_class_stream_passthrough) - -[It's very -fast](https://docs.google.com/spreadsheets/d/1oObKSrVwLX_7Ut4Z6g3fZW-AX1j1-k6w-cDsrkaSbHM/edit#gid=0) -for objects, strings, and buffers. - -Supports pipe()ing (including multi-pipe() and backpressure -transmission), buffering data until either a `data` event handler or -`pipe()` is added (so you don't lose the first chunk), and most other -cases where PassThrough is a good idea. - -There is a `read()` method, but it's much more efficient to consume -data from this stream via `'data'` events or by calling `pipe()` into -some other stream. Calling `read()` requires the buffer to be -flattened in some cases, which requires copying memory. - -There is also no `unpipe()` method. Once you start piping, there is -no stopping it! - -If you set `objectMode: true` in the options, then whatever is written -will be emitted. Otherwise, it'll do a minimal amount of Buffer -copying to ensure proper Streams semantics when `read(n)` is called. - -`objectMode` can also be set by doing `stream.objectMode = true`, or by -writing any non-string/non-buffer data. `objectMode` cannot be set to -false once it is set. - -This is not a `through` or `through2` stream. It doesn't transform -the data, it just passes it right through. If you want to transform -the data, extend the class, and override the `write()` method. Once -you're done transforming the data however you want, call -`super.write()` with the transform output. - -For some examples of streams that extend Minipass in various ways, check -out: - -- [minizlib](http://npm.im/minizlib) -- [fs-minipass](http://npm.im/fs-minipass) -- [tar](http://npm.im/tar) -- [minipass-collect](http://npm.im/minipass-collect) -- [minipass-flush](http://npm.im/minipass-flush) -- [minipass-pipeline](http://npm.im/minipass-pipeline) -- [tap](http://npm.im/tap) -- [tap-parser](http://npm.im/tap) -- [treport](http://npm.im/tap) - -## Differences from Node.js Streams - -There are several things that make Minipass streams different from (and in -some ways superior to) Node.js core streams. - -Please read these caveats if you are familiar with noode-core streams and -intend to use Minipass streams in your programs. - -### Timing - -Minipass streams are designed to support synchronous use-cases. Thus, data -is emitted as soon as it is available, always. It is buffered until read, -but no longer. Another way to look at it is that Minipass streams are -exactly as synchronous as the logic that writes into them. - -This can be surprising if your code relies on `PassThrough.write()` always -providing data on the next tick rather than the current one, or being able -to call `resume()` and not have the entire buffer disappear immediately. - -However, without this synchronicity guarantee, there would be no way for -Minipass to achieve the speeds it does, or support the synchronous use -cases that it does. Simply put, waiting takes time. - -This non-deferring approach makes Minipass streams much easier to reason -about, especially in the context of Promises and other flow-control -mechanisms. - -### No High/Low Water Marks - -Node.js core streams will optimistically fill up a buffer, returning `true` -on all writes until the limit is hit, even if the data has nowhere to go. -Then, they will not attempt to draw more data in until the buffer size dips -below a minimum value. - -Minipass streams are much simpler. The `write()` method will return `true` -if the data has somewhere to go (which is to say, given the timing -guarantees, that the data is already there by the time `write()` returns). - -If the data has nowhere to go, then `write()` returns false, and the data -sits in a buffer, to be drained out immediately as soon as anyone consumes -it. - -### Hazards of Buffering (or: Why Minipass Is So Fast) - -Since data written to a Minipass stream is immediately written all the way -through the pipeline, and `write()` always returns true/false based on -whether the data was fully flushed, backpressure is communicated -immediately to the upstream caller. This minimizes buffering. - -Consider this case: - -```js -const {PassThrough} = require('stream') -const p1 = new PassThrough({ highWaterMark: 1024 }) -const p2 = new PassThrough({ highWaterMark: 1024 }) -const p3 = new PassThrough({ highWaterMark: 1024 }) -const p4 = new PassThrough({ highWaterMark: 1024 }) - -p1.pipe(p2).pipe(p3).pipe(p4) -p4.on('data', () => console.log('made it through')) - -// this returns false and buffers, then writes to p2 on next tick (1) -// p2 returns false and buffers, pausing p1, then writes to p3 on next tick (2) -// p3 returns false and buffers, pausing p2, then writes to p4 on next tick (3) -// p4 returns false and buffers, pausing p3, then emits 'data' and 'drain' -// on next tick (4) -// p3 sees p4's 'drain' event, and calls resume(), emitting 'resume' and -// 'drain' on next tick (5) -// p2 sees p3's 'drain', calls resume(), emits 'resume' and 'drain' on next tick (6) -// p1 sees p2's 'drain', calls resume(), emits 'resume' and 'drain' on next -// tick (7) - -p1.write(Buffer.alloc(2048)) // returns false -``` - -Along the way, the data was buffered and deferred at each stage, and -multiple event deferrals happened, for an unblocked pipeline where it was -perfectly safe to write all the way through! - -Furthermore, setting a `highWaterMark` of `1024` might lead someone reading -the code to think an advisory maximum of 1KiB is being set for the -pipeline. However, the actual advisory buffering level is the _sum_ of -`highWaterMark` values, since each one has its own bucket. - -Consider the Minipass case: - -```js -const m1 = new Minipass() -const m2 = new Minipass() -const m3 = new Minipass() -const m4 = new Minipass() - -m1.pipe(m2).pipe(m3).pipe(m4) -m4.on('data', () => console.log('made it through')) - -// m1 is flowing, so it writes the data to m2 immediately -// m2 is flowing, so it writes the data to m3 immediately -// m3 is flowing, so it writes the data to m4 immediately -// m4 is flowing, so it fires the 'data' event immediately, returns true -// m4's write returned true, so m3 is still flowing, returns true -// m3's write returned true, so m2 is still flowing, returns true -// m2's write returned true, so m1 is still flowing, returns true -// No event deferrals or buffering along the way! - -m1.write(Buffer.alloc(2048)) // returns true -``` - -It is extremely unlikely that you _don't_ want to buffer any data written, -or _ever_ buffer data that can be flushed all the way through. Neither -node-core streams nor Minipass ever fail to buffer written data, but -node-core streams do a lot of unnecessary buffering and pausing. - -As always, the faster implementation is the one that does less stuff and -waits less time to do it. - -### Immediately emit `end` for empty streams (when not paused) - -If a stream is not paused, and `end()` is called before writing any data -into it, then it will emit `end` immediately. - -If you have logic that occurs on the `end` event which you don't want to -potentially happen immediately (for example, closing file descriptors, -moving on to the next entry in an archive parse stream, etc.) then be sure -to call `stream.pause()` on creation, and then `stream.resume()` once you -are ready to respond to the `end` event. - -### Emit `end` When Asked - -One hazard of immediately emitting `'end'` is that you may not yet have had -a chance to add a listener. In order to avoid this hazard, Minipass -streams safely re-emit the `'end'` event if a new listener is added after -`'end'` has been emitted. - -Ie, if you do `stream.on('end', someFunction)`, and the stream has already -emitted `end`, then it will call the handler right away. (You can think of -this somewhat like attaching a new `.then(fn)` to a previously-resolved -Promise.) - -To prevent calling handlers multiple times who would not expect multiple -ends to occur, all listeners are removed from the `'end'` event whenever it -is emitted. - -### Impact of "immediate flow" on Tee-streams - -A "tee stream" is a stream piping to multiple destinations: - -```js -const tee = new Minipass() -t.pipe(dest1) -t.pipe(dest2) -t.write('foo') // goes to both destinations -``` - -Since Minipass streams _immediately_ process any pending data through the -pipeline when a new pipe destination is added, this can have surprising -effects, especially when a stream comes in from some other function and may -or may not have data in its buffer. - -```js -// WARNING! WILL LOSE DATA! -const src = new Minipass() -src.write('foo') -src.pipe(dest1) // 'foo' chunk flows to dest1 immediately, and is gone -src.pipe(dest2) // gets nothing! -``` - -The solution is to create a dedicated tee-stream junction that pipes to -both locations, and then pipe to _that_ instead. - -```js -// Safe example: tee to both places -const src = new Minipass() -src.write('foo') -const tee = new Minipass() -tee.pipe(dest1) -tee.pipe(dest2) -stream.pipe(tee) // tee gets 'foo', pipes to both locations -``` - -The same caveat applies to `on('data')` event listeners. The first one -added will _immediately_ receive all of the data, leaving nothing for the -second: - -```js -// WARNING! WILL LOSE DATA! -const src = new Minipass() -src.write('foo') -src.on('data', handler1) // receives 'foo' right away -src.on('data', handler2) // nothing to see here! -``` - -Using a dedicated tee-stream can be used in this case as well: - -```js -// Safe example: tee to both data handlers -const src = new Minipass() -src.write('foo') -const tee = new Minipass() -tee.on('data', handler1) -tee.on('data', handler2) -src.pipe(tee) -``` - -## USAGE - -It's a stream! Use it like a stream and it'll most likely do what you want. - -```js -const Minipass = require('minipass') -const mp = new Minipass(options) // optional: { encoding, objectMode } -mp.write('foo') -mp.pipe(someOtherStream) -mp.end('bar') -``` - -### OPTIONS - -* `encoding` How would you like the data coming _out_ of the stream to be - encoded? Accepts any values that can be passed to `Buffer.toString()`. -* `objectMode` Emit data exactly as it comes in. This will be flipped on - by default if you write() something other than a string or Buffer at any - point. Setting `objectMode: true` will prevent setting any encoding - value. - -### API - -Implements the user-facing portions of Node.js's `Readable` and `Writable` -streams. - -### Methods - -* `write(chunk, [encoding], [callback])` - Put data in. (Note that, in the - base Minipass class, the same data will come out.) Returns `false` if - the stream will buffer the next write, or true if it's still in - "flowing" mode. -* `end([chunk, [encoding]], [callback])` - Signal that you have no more - data to write. This will queue an `end` event to be fired when all the - data has been consumed. -* `setEncoding(encoding)` - Set the encoding for data coming of the - stream. This can only be done once. -* `pause()` - No more data for a while, please. This also prevents `end` - from being emitted for empty streams until the stream is resumed. -* `resume()` - Resume the stream. If there's data in the buffer, it is - all discarded. Any buffered events are immediately emitted. -* `pipe(dest)` - Send all output to the stream provided. There is no way - to unpipe. When data is emitted, it is immediately written to any and - all pipe destinations. -* `on(ev, fn)`, `emit(ev, fn)` - Minipass streams are EventEmitters. - Some events are given special treatment, however. (See below under - "events".) -* `promise()` - Returns a Promise that resolves when the stream emits - `end`, or rejects if the stream emits `error`. -* `collect()` - Return a Promise that resolves on `end` with an array - containing each chunk of data that was emitted, or rejects if the - stream emits `error`. Note that this consumes the stream data. -* `concat()` - Same as `collect()`, but concatenates the data into a - single Buffer object. Will reject the returned promise if the stream is - in objectMode, or if it goes into objectMode by the end of the data. -* `read(n)` - Consume `n` bytes of data out of the buffer. If `n` is not - provided, then consume all of it. If `n` bytes are not available, then - it returns null. **Note** consuming streams in this way is less - efficient, and can lead to unnecessary Buffer copying. -* `destroy([er])` - Destroy the stream. If an error is provided, then an - `'error'` event is emitted. If the stream has a `close()` method, and - has not emitted a `'close'` event yet, then `stream.close()` will be - called. Any Promises returned by `.promise()`, `.collect()` or - `.concat()` will be rejected. After being destroyed, writing to the - stream will emit an error. No more data will be emitted if the stream is - destroyed, even if it was previously buffered. - -### Properties - -* `bufferLength` Read-only. Total number of bytes buffered, or in the case - of objectMode, the total number of objects. -* `encoding` The encoding that has been set. (Setting this is equivalent - to calling `setEncoding(enc)` and has the same prohibition against - setting multiple times.) -* `flowing` Read-only. Boolean indicating whether a chunk written to the - stream will be immediately emitted. -* `emittedEnd` Read-only. Boolean indicating whether the end-ish events - (ie, `end`, `prefinish`, `finish`) have been emitted. Note that - listening on any end-ish event will immediateyl re-emit it if it has - already been emitted. -* `writable` Whether the stream is writable. Default `true`. Set to - `false` when `end()` -* `readable` Whether the stream is readable. Default `true`. -* `buffer` A [yallist](http://npm.im/yallist) linked list of chunks written - to the stream that have not yet been emitted. (It's probably a bad idea - to mess with this.) -* `pipes` A [yallist](http://npm.im/yallist) linked list of streams that - this stream is piping into. (It's probably a bad idea to mess with - this.) -* `destroyed` A getter that indicates whether the stream was destroyed. -* `paused` True if the stream has been explicitly paused, otherwise false. -* `objectMode` Indicates whether the stream is in `objectMode`. Once set - to `true`, it cannot be set to `false`. - -### Events - -* `data` Emitted when there's data to read. Argument is the data to read. - This is never emitted while not flowing. If a listener is attached, that - will resume the stream. -* `end` Emitted when there's no more data to read. This will be emitted - immediately for empty streams when `end()` is called. If a listener is - attached, and `end` was already emitted, then it will be emitted again. - All listeners are removed when `end` is emitted. -* `prefinish` An end-ish event that follows the same logic as `end` and is - emitted in the same conditions where `end` is emitted. Emitted after - `'end'`. -* `finish` An end-ish event that follows the same logic as `end` and is - emitted in the same conditions where `end` is emitted. Emitted after - `'prefinish'`. -* `close` An indication that an underlying resource has been released. - Minipass does not emit this event, but will defer it until after `end` - has been emitted, since it throws off some stream libraries otherwise. -* `drain` Emitted when the internal buffer empties, and it is again - suitable to `write()` into the stream. -* `readable` Emitted when data is buffered and ready to be read by a - consumer. -* `resume` Emitted when stream changes state from buffering to flowing - mode. (Ie, when `resume` is called, `pipe` is called, or a `data` event - listener is added.) - -### Static Methods - -* `Minipass.isStream(stream)` Returns `true` if the argument is a stream, - and false otherwise. To be considered a stream, the object must be - either an instance of Minipass, or an EventEmitter that has either a - `pipe()` method, or both `write()` and `end()` methods. (Pretty much any - stream in node-land will return `true` for this.) - -## EXAMPLES - -Here are some examples of things you can do with Minipass streams. - -### simple "are you done yet" promise - -```js -mp.promise().then(() => { - // stream is finished -}, er => { - // stream emitted an error -}) -``` - -### collecting - -```js -mp.collect().then(all => { - // all is an array of all the data emitted - // encoding is supported in this case, so - // so the result will be a collection of strings if - // an encoding is specified, or buffers/objects if not. - // - // In an async function, you may do - // const data = await stream.collect() -}) -``` - -### collecting into a single blob - -This is a bit slower because it concatenates the data into one chunk for -you, but if you're going to do it yourself anyway, it's convenient this -way: - -```js -mp.concat().then(onebigchunk => { - // onebigchunk is a string if the stream - // had an encoding set, or a buffer otherwise. -}) -``` - -### iteration - -You can iterate over streams synchronously or asynchronously in -platforms that support it. - -Synchronous iteration will end when the currently available data is -consumed, even if the `end` event has not been reached. In string and -buffer mode, the data is concatenated, so unless multiple writes are -occurring in the same tick as the `read()`, sync iteration loops will -generally only have a single iteration. - -To consume chunks in this way exactly as they have been written, with -no flattening, create the stream with the `{ objectMode: true }` -option. - -```js -const mp = new Minipass({ objectMode: true }) -mp.write('a') -mp.write('b') -for (let letter of mp) { - console.log(letter) // a, b -} -mp.write('c') -mp.write('d') -for (let letter of mp) { - console.log(letter) // c, d -} -mp.write('e') -mp.end() -for (let letter of mp) { - console.log(letter) // e -} -for (let letter of mp) { - console.log(letter) // nothing -} -``` - -Asynchronous iteration will continue until the end event is reached, -consuming all of the data. - -```js -const mp = new Minipass({ encoding: 'utf8' }) - -// some source of some data -let i = 5 -const inter = setInterval(() => { - if (i --> 0) - mp.write(Buffer.from('foo\n', 'utf8')) - else { - mp.end() - clearInterval(inter) - } -}, 100) - -// consume the data with asynchronous iteration -async function consume () { - for await (let chunk of mp) { - console.log(chunk) - } - return 'ok' -} - -consume().then(res => console.log(res)) -// logs `foo\n` 5 times, and then `ok` -``` - -### subclass that `console.log()`s everything written into it - -```js -class Logger extends Minipass { - write (chunk, encoding, callback) { - console.log('WRITE', chunk, encoding) - return super.write(chunk, encoding, callback) - } - end (chunk, encoding, callback) { - console.log('END', chunk, encoding) - return super.end(chunk, encoding, callback) - } -} - -someSource.pipe(new Logger()).pipe(someDest) -``` - -### same thing, but using an inline anonymous class - -```js -// js classes are fun -someSource - .pipe(new (class extends Minipass { - emit (ev, ...data) { - // let's also log events, because debugging some weird thing - console.log('EMIT', ev) - return super.emit(ev, ...data) - } - write (chunk, encoding, callback) { - console.log('WRITE', chunk, encoding) - return super.write(chunk, encoding, callback) - } - end (chunk, encoding, callback) { - console.log('END', chunk, encoding) - return super.end(chunk, encoding, callback) - } - })) - .pipe(someDest) -``` - -### subclass that defers 'end' for some reason - -```js -class SlowEnd extends Minipass { - emit (ev, ...args) { - if (ev === 'end') { - console.log('going to end, hold on a sec') - setTimeout(() => { - console.log('ok, ready to end now') - super.emit('end', ...args) - }, 100) - } else { - return super.emit(ev, ...args) - } - } -} -``` - -### transform that creates newline-delimited JSON - -```js -class NDJSONEncode extends Minipass { - write (obj, cb) { - try { - // JSON.stringify can throw, emit an error on that - return super.write(JSON.stringify(obj) + '\n', 'utf8', cb) - } catch (er) { - this.emit('error', er) - } - } - end (obj, cb) { - if (typeof obj === 'function') { - cb = obj - obj = undefined - } - if (obj !== undefined) { - this.write(obj) - } - return super.end(cb) - } -} -``` - -### transform that parses newline-delimited JSON - -```js -class NDJSONDecode extends Minipass { - constructor (options) { - // always be in object mode, as far as Minipass is concerned - super({ objectMode: true }) - this._jsonBuffer = '' - } - write (chunk, encoding, cb) { - if (typeof chunk === 'string' && - typeof encoding === 'string' && - encoding !== 'utf8') { - chunk = Buffer.from(chunk, encoding).toString() - } else if (Buffer.isBuffer(chunk)) - chunk = chunk.toString() - } - if (typeof encoding === 'function') { - cb = encoding - } - const jsonData = (this._jsonBuffer + chunk).split('\n') - this._jsonBuffer = jsonData.pop() - for (let i = 0; i < jsonData.length; i++) { - let parsed - try { - super.write(parsed) - } catch (er) { - this.emit('error', er) - continue - } - } - if (cb) - cb() - } -} -``` diff --git a/deps/npm/node_modules/minizlib/node_modules/minipass/index.js b/deps/npm/node_modules/minizlib/node_modules/minipass/index.js deleted file mode 100644 index c072352d448a97..00000000000000 --- a/deps/npm/node_modules/minizlib/node_modules/minipass/index.js +++ /dev/null @@ -1,537 +0,0 @@ -'use strict' -const EE = require('events') -const Yallist = require('yallist') -const SD = require('string_decoder').StringDecoder - -const EOF = Symbol('EOF') -const MAYBE_EMIT_END = Symbol('maybeEmitEnd') -const EMITTED_END = Symbol('emittedEnd') -const EMITTING_END = Symbol('emittingEnd') -const CLOSED = Symbol('closed') -const READ = Symbol('read') -const FLUSH = Symbol('flush') -const FLUSHCHUNK = Symbol('flushChunk') -const ENCODING = Symbol('encoding') -const DECODER = Symbol('decoder') -const FLOWING = Symbol('flowing') -const PAUSED = Symbol('paused') -const RESUME = Symbol('resume') -const BUFFERLENGTH = Symbol('bufferLength') -const BUFFERPUSH = Symbol('bufferPush') -const BUFFERSHIFT = Symbol('bufferShift') -const OBJECTMODE = Symbol('objectMode') -const DESTROYED = Symbol('destroyed') - -// TODO remove when Node v8 support drops -const doIter = global._MP_NO_ITERATOR_SYMBOLS_ !== '1' -const ASYNCITERATOR = doIter && Symbol.asyncIterator - || Symbol('asyncIterator not implemented') -const ITERATOR = doIter && Symbol.iterator - || Symbol('iterator not implemented') - -// Buffer in node 4.x < 4.5.0 doesn't have working Buffer.from -// or Buffer.alloc, and Buffer in node 10 deprecated the ctor. -// .M, this is fine .\^/M.. -const B = Buffer.alloc ? Buffer - : /* istanbul ignore next */ require('safe-buffer').Buffer - -// events that mean 'the stream is over' -// these are treated specially, and re-emitted -// if they are listened for after emitting. -const isEndish = ev => - ev === 'end' || - ev === 'finish' || - ev === 'prefinish' - -const isArrayBuffer = b => b instanceof ArrayBuffer || - typeof b === 'object' && - b.constructor && - b.constructor.name === 'ArrayBuffer' && - b.byteLength >= 0 - -const isArrayBufferView = b => !B.isBuffer(b) && ArrayBuffer.isView(b) - -module.exports = class Minipass extends EE { - constructor (options) { - super() - this[FLOWING] = false - // whether we're explicitly paused - this[PAUSED] = false - this.pipes = new Yallist() - this.buffer = new Yallist() - this[OBJECTMODE] = options && options.objectMode || false - if (this[OBJECTMODE]) - this[ENCODING] = null - else - this[ENCODING] = options && options.encoding || null - if (this[ENCODING] === 'buffer') - this[ENCODING] = null - this[DECODER] = this[ENCODING] ? new SD(this[ENCODING]) : null - this[EOF] = false - this[EMITTED_END] = false - this[EMITTING_END] = false - this[CLOSED] = false - this.writable = true - this.readable = true - this[BUFFERLENGTH] = 0 - this[DESTROYED] = false - } - - get bufferLength () { return this[BUFFERLENGTH] } - - get encoding () { return this[ENCODING] } - set encoding (enc) { - if (this[OBJECTMODE]) - throw new Error('cannot set encoding in objectMode') - - if (this[ENCODING] && enc !== this[ENCODING] && - (this[DECODER] && this[DECODER].lastNeed || this[BUFFERLENGTH])) - throw new Error('cannot change encoding') - - if (this[ENCODING] !== enc) { - this[DECODER] = enc ? new SD(enc) : null - if (this.buffer.length) - this.buffer = this.buffer.map(chunk => this[DECODER].write(chunk)) - } - - this[ENCODING] = enc - } - - setEncoding (enc) { - this.encoding = enc - } - - get objectMode () { return this[OBJECTMODE] } - set objectMode (ॐ ) { this[OBJECTMODE] = this[OBJECTMODE] || !!ॐ } - - write (chunk, encoding, cb) { - if (this[EOF]) - throw new Error('write after end') - - if (this[DESTROYED]) { - this.emit('error', Object.assign( - new Error('Cannot call write after a stream was destroyed'), - { code: 'ERR_STREAM_DESTROYED' } - )) - return true - } - - if (typeof encoding === 'function') - cb = encoding, encoding = 'utf8' - - if (!encoding) - encoding = 'utf8' - - // convert array buffers and typed array views into buffers - // at some point in the future, we may want to do the opposite! - // leave strings and buffers as-is - // anything else switches us into object mode - if (!this[OBJECTMODE] && !B.isBuffer(chunk)) { - if (isArrayBufferView(chunk)) - chunk = B.from(chunk.buffer, chunk.byteOffset, chunk.byteLength) - else if (isArrayBuffer(chunk)) - chunk = B.from(chunk) - else if (typeof chunk !== 'string') - // use the setter so we throw if we have encoding set - this.objectMode = true - } - - // this ensures at this point that the chunk is a buffer or string - // don't buffer it up or send it to the decoder - if (!this.objectMode && !chunk.length) { - const ret = this.flowing - if (this[BUFFERLENGTH] !== 0) - this.emit('readable') - if (cb) - cb() - return ret - } - - // fast-path writing strings of same encoding to a stream with - // an empty buffer, skipping the buffer/decoder dance - if (typeof chunk === 'string' && !this[OBJECTMODE] && - // unless it is a string already ready for us to use - !(encoding === this[ENCODING] && !this[DECODER].lastNeed)) { - chunk = B.from(chunk, encoding) - } - - if (B.isBuffer(chunk) && this[ENCODING]) - chunk = this[DECODER].write(chunk) - - try { - return this.flowing - ? (this.emit('data', chunk), this.flowing) - : (this[BUFFERPUSH](chunk), false) - } finally { - if (this[BUFFERLENGTH] !== 0) - this.emit('readable') - if (cb) - cb() - } - } - - read (n) { - if (this[DESTROYED]) - return null - - try { - if (this[BUFFERLENGTH] === 0 || n === 0 || n > this[BUFFERLENGTH]) - return null - - if (this[OBJECTMODE]) - n = null - - if (this.buffer.length > 1 && !this[OBJECTMODE]) { - if (this.encoding) - this.buffer = new Yallist([ - Array.from(this.buffer).join('') - ]) - else - this.buffer = new Yallist([ - B.concat(Array.from(this.buffer), this[BUFFERLENGTH]) - ]) - } - - return this[READ](n || null, this.buffer.head.value) - } finally { - this[MAYBE_EMIT_END]() - } - } - - [READ] (n, chunk) { - if (n === chunk.length || n === null) - this[BUFFERSHIFT]() - else { - this.buffer.head.value = chunk.slice(n) - chunk = chunk.slice(0, n) - this[BUFFERLENGTH] -= n - } - - this.emit('data', chunk) - - if (!this.buffer.length && !this[EOF]) - this.emit('drain') - - return chunk - } - - end (chunk, encoding, cb) { - if (typeof chunk === 'function') - cb = chunk, chunk = null - if (typeof encoding === 'function') - cb = encoding, encoding = 'utf8' - if (chunk) - this.write(chunk, encoding) - if (cb) - this.once('end', cb) - this[EOF] = true - this.writable = false - - // if we haven't written anything, then go ahead and emit, - // even if we're not reading. - // we'll re-emit if a new 'end' listener is added anyway. - // This makes MP more suitable to write-only use cases. - if (this.flowing || !this[PAUSED]) - this[MAYBE_EMIT_END]() - return this - } - - // don't let the internal resume be overwritten - [RESUME] () { - if (this[DESTROYED]) - return - - this[PAUSED] = false - this[FLOWING] = true - this.emit('resume') - if (this.buffer.length) - this[FLUSH]() - else if (this[EOF]) - this[MAYBE_EMIT_END]() - else - this.emit('drain') - } - - resume () { - return this[RESUME]() - } - - pause () { - this[FLOWING] = false - this[PAUSED] = true - } - - get destroyed () { - return this[DESTROYED] - } - - get flowing () { - return this[FLOWING] - } - - get paused () { - return this[PAUSED] - } - - [BUFFERPUSH] (chunk) { - if (this[OBJECTMODE]) - this[BUFFERLENGTH] += 1 - else - this[BUFFERLENGTH] += chunk.length - return this.buffer.push(chunk) - } - - [BUFFERSHIFT] () { - if (this.buffer.length) { - if (this[OBJECTMODE]) - this[BUFFERLENGTH] -= 1 - else - this[BUFFERLENGTH] -= this.buffer.head.value.length - } - return this.buffer.shift() - } - - [FLUSH] () { - do {} while (this[FLUSHCHUNK](this[BUFFERSHIFT]())) - - if (!this.buffer.length && !this[EOF]) - this.emit('drain') - } - - [FLUSHCHUNK] (chunk) { - return chunk ? (this.emit('data', chunk), this.flowing) : false - } - - pipe (dest, opts) { - if (this[DESTROYED]) - return - - const ended = this[EMITTED_END] - opts = opts || {} - if (dest === process.stdout || dest === process.stderr) - opts.end = false - else - opts.end = opts.end !== false - - const p = { dest: dest, opts: opts, ondrain: _ => this[RESUME]() } - this.pipes.push(p) - - dest.on('drain', p.ondrain) - this[RESUME]() - // piping an ended stream ends immediately - if (ended && p.opts.end) - p.dest.end() - return dest - } - - addListener (ev, fn) { - return this.on(ev, fn) - } - - on (ev, fn) { - try { - return super.on(ev, fn) - } finally { - if (ev === 'data' && !this.pipes.length && !this.flowing) - this[RESUME]() - else if (isEndish(ev) && this[EMITTED_END]) { - super.emit(ev) - this.removeAllListeners(ev) - } - } - } - - get emittedEnd () { - return this[EMITTED_END] - } - - [MAYBE_EMIT_END] () { - if (!this[EMITTING_END] && - !this[EMITTED_END] && - !this[DESTROYED] && - this.buffer.length === 0 && - this[EOF]) { - this[EMITTING_END] = true - this.emit('end') - this.emit('prefinish') - this.emit('finish') - if (this[CLOSED]) - this.emit('close') - this[EMITTING_END] = false - } - } - - emit (ev, data) { - // error and close are only events allowed after calling destroy() - if (ev !== 'error' && ev !== 'close' && ev !== DESTROYED && this[DESTROYED]) - return - else if (ev === 'data') { - if (!data) - return - - if (this.pipes.length) - this.pipes.forEach(p => - p.dest.write(data) === false && this.pause()) - } else if (ev === 'end') { - // only actual end gets this treatment - if (this[EMITTED_END] === true) - return - - this[EMITTED_END] = true - this.readable = false - - if (this[DECODER]) { - data = this[DECODER].end() - if (data) { - this.pipes.forEach(p => p.dest.write(data)) - super.emit('data', data) - } - } - - this.pipes.forEach(p => { - p.dest.removeListener('drain', p.ondrain) - if (p.opts.end) - p.dest.end() - }) - } else if (ev === 'close') { - this[CLOSED] = true - // don't emit close before 'end' and 'finish' - if (!this[EMITTED_END] && !this[DESTROYED]) - return - } - - // TODO: replace with a spread operator when Node v4 support drops - const args = new Array(arguments.length) - args[0] = ev - args[1] = data - if (arguments.length > 2) { - for (let i = 2; i < arguments.length; i++) { - args[i] = arguments[i] - } - } - - try { - return super.emit.apply(this, args) - } finally { - if (!isEndish(ev)) - this[MAYBE_EMIT_END]() - else - this.removeAllListeners(ev) - } - } - - // const all = await stream.collect() - collect () { - const buf = [] - buf.dataLength = 0 - this.on('data', c => { - buf.push(c) - buf.dataLength += c.length - }) - return this.promise().then(() => buf) - } - - // const data = await stream.concat() - concat () { - return this[OBJECTMODE] - ? Promise.reject(new Error('cannot concat in objectMode')) - : this.collect().then(buf => - this[OBJECTMODE] - ? Promise.reject(new Error('cannot concat in objectMode')) - : this[ENCODING] ? buf.join('') : B.concat(buf, buf.dataLength)) - } - - // stream.promise().then(() => done, er => emitted error) - promise () { - return new Promise((resolve, reject) => { - this.on(DESTROYED, () => reject(new Error('stream destroyed'))) - this.on('end', () => resolve()) - this.on('error', er => reject(er)) - }) - } - - // for await (let chunk of stream) - [ASYNCITERATOR] () { - const next = () => { - const res = this.read() - if (res !== null) - return Promise.resolve({ done: false, value: res }) - - if (this[EOF]) - return Promise.resolve({ done: true }) - - let resolve = null - let reject = null - const onerr = er => { - this.removeListener('data', ondata) - this.removeListener('end', onend) - reject(er) - } - const ondata = value => { - this.removeListener('error', onerr) - this.removeListener('end', onend) - this.pause() - resolve({ value: value, done: !!this[EOF] }) - } - const onend = () => { - this.removeListener('error', onerr) - this.removeListener('data', ondata) - resolve({ done: true }) - } - const ondestroy = () => onerr(new Error('stream destroyed')) - return new Promise((res, rej) => { - reject = rej - resolve = res - this.once(DESTROYED, ondestroy) - this.once('error', onerr) - this.once('end', onend) - this.once('data', ondata) - }) - } - - return { next } - } - - // for (let chunk of stream) - [ITERATOR] () { - const next = () => { - const value = this.read() - const done = value === null - return { value, done } - } - return { next } - } - - destroy (er) { - if (this[DESTROYED]) { - if (er) - this.emit('error', er) - else - this.emit(DESTROYED) - return this - } - - this[DESTROYED] = true - - // throw away all buffered data, it's never coming out - this.buffer = new Yallist() - this[BUFFERLENGTH] = 0 - - if (typeof this.close === 'function' && !this[CLOSED]) - this.close() - - if (er) - this.emit('error', er) - else // if no error to emit, still reject pending promises - this.emit(DESTROYED) - - return this - } - - static isStream (s) { - return !!s && (s instanceof Minipass || s instanceof EE && ( - typeof s.pipe === 'function' || // readable - (typeof s.write === 'function' && typeof s.end === 'function') // writable - )) - } -} diff --git a/deps/npm/node_modules/minizlib/node_modules/minipass/package.json b/deps/npm/node_modules/minizlib/node_modules/minipass/package.json deleted file mode 100644 index 57284172b071f2..00000000000000 --- a/deps/npm/node_modules/minizlib/node_modules/minipass/package.json +++ /dev/null @@ -1,70 +0,0 @@ -{ - "_from": "minipass@^2.9.0", - "_id": "minipass@2.9.0", - "_inBundle": false, - "_integrity": "sha512-wxfUjg9WebH+CUDX/CdbRlh5SmfZiy/hpkxaRI16Y9W56Pa75sWgd/rvFilSgrauD9NyFymP/+JFV3KwzIsJeg==", - "_location": "/minizlib/minipass", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "minipass@^2.9.0", - "name": "minipass", - "escapedName": "minipass", - "rawSpec": "^2.9.0", - "saveSpec": null, - "fetchSpec": "^2.9.0" - }, - "_requiredBy": [ - "/minizlib" - ], - "_resolved": "https://registry.npmjs.org/minipass/-/minipass-2.9.0.tgz", - "_shasum": "e713762e7d3e32fed803115cf93e04bca9fcc9a6", - "_spec": "minipass@^2.9.0", - "_where": "/Users/mperrotte/npminc/cli/node_modules/minizlib", - "author": { - "name": "Isaac Z. Schlueter", - "email": "i@izs.me", - "url": "http://blog.izs.me/" - }, - "bugs": { - "url": "https://github.com/isaacs/minipass/issues" - }, - "bundleDependencies": false, - "dependencies": { - "safe-buffer": "^5.1.2", - "yallist": "^3.0.0" - }, - "deprecated": false, - "description": "minimal implementation of a PassThrough stream", - "devDependencies": { - "end-of-stream": "^1.4.0", - "tap": "^14.6.5", - "through2": "^2.0.3" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/isaacs/minipass#readme", - "keywords": [ - "passthrough", - "stream" - ], - "license": "ISC", - "main": "index.js", - "name": "minipass", - "repository": { - "type": "git", - "url": "git+https://github.com/isaacs/minipass.git" - }, - "scripts": { - "postpublish": "git push origin --follow-tags", - "postversion": "npm publish", - "preversion": "npm test", - "test": "tap" - }, - "tap": { - "check-coverage": true - }, - "version": "2.9.0" -} diff --git a/deps/npm/node_modules/minizlib/package.json b/deps/npm/node_modules/minizlib/package.json index 1284b8c6c48316..98825a549f3fdc 100644 --- a/deps/npm/node_modules/minizlib/package.json +++ b/deps/npm/node_modules/minizlib/package.json @@ -1,52 +1,22 @@ { - "_from": "minizlib@^1.2.1", - "_id": "minizlib@1.3.3", - "_inBundle": false, - "_integrity": "sha512-6ZYMOEnmVsdCeTJVE0W9ZD+pVnE8h9Hma/iOwwRDsdQoePpoX56/8B6z3P9VNwppJuBKNRuFDRNRqRWexT9G9Q==", - "_location": "/minizlib", - "_phantomChildren": { - "safe-buffer": "5.1.2", - "yallist": "3.0.3" - }, - "_requested": { - "type": "range", - "registry": true, - "raw": "minizlib@^1.2.1", - "name": "minizlib", - "escapedName": "minizlib", - "rawSpec": "^1.2.1", - "saveSpec": null, - "fetchSpec": "^1.2.1" - }, - "_requiredBy": [ - "/tar" - ], - "_resolved": "https://registry.npmjs.org/minizlib/-/minizlib-1.3.3.tgz", - "_shasum": "2290de96818a34c29551c8a8d301216bd65a861d", - "_spec": "minizlib@^1.2.1", - "_where": "/Users/mperrotte/npminc/cli/node_modules/tar", - "author": { - "name": "Isaac Z. Schlueter", - "email": "i@izs.me", - "url": "http://blog.izs.me/" - }, - "bugs": { - "url": "https://github.com/isaacs/minizlib/issues" - }, - "bundleDependencies": false, + "name": "minizlib", + "version": "2.1.2", + "description": "A small fast zlib stream built on [minipass](http://npm.im/minipass) and Node.js's zlib binding.", + "main": "index.js", "dependencies": { - "minipass": "^2.9.0" + "minipass": "^3.0.0", + "yallist": "^4.0.0" }, - "deprecated": false, - "description": "A small fast zlib stream built on [minipass](http://npm.im/minipass) and Node.js's zlib binding.", - "devDependencies": { - "tap": "^12.0.1" + "scripts": { + "test": "tap test/*.js --100 -J", + "preversion": "npm test", + "postversion": "npm publish", + "postpublish": "git push origin --all; git push origin --tags" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/isaacs/minizlib.git" }, - "files": [ - "index.js", - "constants.js" - ], - "homepage": "https://github.com/isaacs/minizlib#readme", "keywords": [ "zlib", "gzip", @@ -57,18 +27,16 @@ "zip", "unzip" ], + "author": "Isaac Z. Schlueter (http://blog.izs.me/)", "license": "MIT", - "main": "index.js", - "name": "minizlib", - "repository": { - "type": "git", - "url": "git+https://github.com/isaacs/minizlib.git" - }, - "scripts": { - "postpublish": "git push origin --all; git push origin --tags", - "postversion": "npm publish", - "preversion": "npm test", - "test": "tap test/*.js --100 -J" + "devDependencies": { + "tap": "^14.6.9" }, - "version": "1.3.3" + "files": [ + "index.js", + "constants.js" + ], + "engines": { + "node": ">= 8" + } } diff --git a/deps/npm/node_modules/mississippi/changelog.md b/deps/npm/node_modules/mississippi/changelog.md deleted file mode 100644 index 75333b08447d9f..00000000000000 --- a/deps/npm/node_modules/mississippi/changelog.md +++ /dev/null @@ -1,10 +0,0 @@ -# mississippi Change Log -All notable changes to this project will be documented in this file. -This project adheres to [Semantic Versioning](http://semver.org/). - -## 3.0.0 - 2018-02-26 -* Update to pump@3.0.0. Returns the last stream the pipeline to enable chaining. (Use the individual modules to avoid potentially unnecessary major updates in your project). - -## 2.0.0 - 2018-01-30 -* Update to pump@2.0.1. (Use the individual modules to avoid potentially unnecessary major updates in your project) -* Pin engines support to >= Node 4.0.0. Run Node LTS or greater. diff --git a/deps/npm/node_modules/mississippi/index.js b/deps/npm/node_modules/mississippi/index.js deleted file mode 100644 index d635b29c5614df..00000000000000 --- a/deps/npm/node_modules/mississippi/index.js +++ /dev/null @@ -1,10 +0,0 @@ -module.exports.pipe = require('pump') -module.exports.each = require('stream-each') -module.exports.pipeline = require('pumpify') -module.exports.duplex = require('duplexify') -module.exports.through = require('through2') -module.exports.concat = require('concat-stream') -module.exports.finished = require('end-of-stream') -module.exports.from = require('from2') -module.exports.to = require('flush-write-stream') -module.exports.parallel = require('parallel-transform') diff --git a/deps/npm/node_modules/mississippi/license b/deps/npm/node_modules/mississippi/license deleted file mode 100644 index e34763968c262d..00000000000000 --- a/deps/npm/node_modules/mississippi/license +++ /dev/null @@ -1,7 +0,0 @@ -Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/deps/npm/node_modules/mississippi/package.json b/deps/npm/node_modules/mississippi/package.json deleted file mode 100644 index 5e4c2b2e34277f..00000000000000 --- a/deps/npm/node_modules/mississippi/package.json +++ /dev/null @@ -1,69 +0,0 @@ -{ - "_args": [ - [ - "mississippi@3.0.0", - "/Users/rebecca/code/npm" - ] - ], - "_from": "mississippi@3.0.0", - "_id": "mississippi@3.0.0", - "_inBundle": false, - "_integrity": "sha512-x471SsVjUtBRtcvd4BzKE9kFC+/2TeWgKCgw0bZcw1b9l2X3QX5vCWgF+KaZaYm87Ss//rHnWryupDrgLvmSkA==", - "_location": "/mississippi", - "_phantomChildren": {}, - "_requested": { - "type": "version", - "registry": true, - "raw": "mississippi@3.0.0", - "name": "mississippi", - "escapedName": "mississippi", - "rawSpec": "3.0.0", - "saveSpec": null, - "fetchSpec": "3.0.0" - }, - "_requiredBy": [ - "/", - "/cacache", - "/make-fetch-happen", - "/npm-registry-fetch/make-fetch-happen", - "/pacote" - ], - "_resolved": "https://registry.npmjs.org/mississippi/-/mississippi-3.0.0.tgz", - "_spec": "3.0.0", - "_where": "/Users/rebecca/code/npm", - "author": { - "name": "max ogden" - }, - "bugs": { - "url": "https://github.com/maxogden/mississippi/issues" - }, - "dependencies": { - "concat-stream": "^1.5.0", - "duplexify": "^3.4.2", - "end-of-stream": "^1.1.0", - "flush-write-stream": "^1.0.0", - "from2": "^2.1.0", - "parallel-transform": "^1.1.0", - "pump": "^3.0.0", - "pumpify": "^1.3.3", - "stream-each": "^1.1.0", - "through2": "^2.0.0" - }, - "description": "a collection of useful streams", - "devDependencies": {}, - "engines": { - "node": ">=4.0.0" - }, - "homepage": "https://github.com/maxogden/mississippi#readme", - "license": "BSD-2-Clause", - "main": "index.js", - "name": "mississippi", - "repository": { - "type": "git", - "url": "git+https://github.com/maxogden/mississippi.git" - }, - "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" - }, - "version": "3.0.0" -} diff --git a/deps/npm/node_modules/mississippi/readme.md b/deps/npm/node_modules/mississippi/readme.md deleted file mode 100644 index 5fa6d66c89e2a6..00000000000000 --- a/deps/npm/node_modules/mississippi/readme.md +++ /dev/null @@ -1,411 +0,0 @@ -# mississippi - -a collection of useful stream utility modules. learn how the modules work using this and then pick the ones you want and use them individually - -the goal of the modules included in mississippi is to make working with streams easy without sacrificing speed, error handling or composability. - -## usage - -```js -var miss = require('mississippi') -``` - -## methods - -- [pipe](#pipe) -- [each](#each) -- [pipeline](#pipeline) -- [duplex](#duplex) -- [through](#through) -- [from](#from) -- [to](#to) -- [concat](#concat) -- [finished](#finished) -- [parallel](#parallel) - -### pipe - -##### `miss.pipe(stream1, stream2, stream3, ..., cb)` - -Pipes streams together and destroys all of them if one of them closes. Calls `cb` with `(error)` if there was an error in any of the streams. - -When using standard `source.pipe(destination)` the source will _not_ be destroyed if the destination emits close or error. You are also not able to provide a callback to tell when the pipe has finished. - -`miss.pipe` does these two things for you, ensuring you handle stream errors 100% of the time (unhandled errors are probably the most common bug in most node streams code) - -#### original module - -`miss.pipe` is provided by [`require('pump')`](https://www.npmjs.com/package/pump) - -#### example - -```js -// lets do a simple file copy -var fs = require('fs') - -var read = fs.createReadStream('./original.zip') -var write = fs.createWriteStream('./copy.zip') - -// use miss.pipe instead of read.pipe(write) -miss.pipe(read, write, function (err) { - if (err) return console.error('Copy error!', err) - console.log('Copied successfully') -}) -``` - -### each - -##### `miss.each(stream, each, [done])` - -Iterate the data in `stream` one chunk at a time. Your `each` function will be called with `(data, next)` where data is a data chunk and next is a callback. Call `next` when you are ready to consume the next chunk. - -Optionally you can call `next` with an error to destroy the stream. You can also pass the optional third argument, `done`, which is a function that will be called with `(err)` when the stream ends. The `err` argument will be populated with an error if the stream emitted an error. - -#### original module - -`miss.each` is provided by [`require('stream-each')`](https://www.npmjs.com/package/stream-each) - -#### example - -```js -var fs = require('fs') -var split = require('split2') - -var newLineSeparatedNumbers = fs.createReadStream('numbers.txt') - -var pipeline = miss.pipeline(newLineSeparatedNumbers, split()) -miss.each(pipeline, eachLine, done) -var sum = 0 - -function eachLine (line, next) { - sum += parseInt(line.toString()) - next() -} - -function done (err) { - if (err) throw err - console.log('sum is', sum) -} -``` - -### pipeline - -##### `var pipeline = miss.pipeline(stream1, stream2, stream3, ...)` - -Builds a pipeline from all the transform streams passed in as arguments by piping them together and returning a single stream object that lets you write to the first stream and read from the last stream. - -If you are pumping object streams together use `pipeline = miss.pipeline.obj(s1, s2, ...)`. - -If any of the streams in the pipeline emits an error or gets destroyed, or you destroy the stream it returns, all of the streams will be destroyed and cleaned up for you. - -#### original module - -`miss.pipeline` is provided by [`require('pumpify')`](https://www.npmjs.com/package/pumpify) - -#### example - -```js -// first create some transform streams (note: these two modules are fictional) -var imageResize = require('image-resizer-stream')({width: 400}) -var pngOptimizer = require('png-optimizer-stream')({quality: 60}) - -// instead of doing a.pipe(b), use pipelin -var resizeAndOptimize = miss.pipeline(imageResize, pngOptimizer) -// `resizeAndOptimize` is a transform stream. when you write to it, it writes -// to `imageResize`. when you read from it, it reads from `pngOptimizer`. -// it handles piping all the streams together for you - -// use it like any other transform stream -var fs = require('fs') - -var read = fs.createReadStream('./image.png') -var write = fs.createWriteStream('./resized-and-optimized.png') - -miss.pipe(read, resizeAndOptimize, write, function (err) { - if (err) return console.error('Image processing error!', err) - console.log('Image processed successfully') -}) -``` - -### duplex - -##### `var duplex = miss.duplex([writable, readable, opts])` - -Take two separate streams, a writable and a readable, and turn them into a single [duplex (readable and writable) stream](https://nodejs.org/api/stream.html#stream_class_stream_duplex). - -The returned stream will emit data from the readable. When you write to it it writes to the writable. - -You can either choose to supply the writable and the readable at the time you create the stream, or you can do it later using the `.setWritable` and `.setReadable` methods and data written to the stream in the meantime will be buffered for you. - -#### original module - -`miss.duplex` is provided by [`require('duplexify')`](https://www.npmjs.com/package/duplexify) - -#### example - -```js -// lets spawn a process and take its stdout and stdin and combine them into 1 stream -var child = require('child_process') - -// @- tells it to read from stdin, --data-binary sets 'raw' binary mode -var curl = child.spawn('curl -X POST --data-binary @- http://foo.com') - -// duplexCurl will write to stdin and read from stdout -var duplexCurl = miss.duplex(curl.stdin, curl.stdout) -``` - -### through - -##### `var transformer = miss.through([options, transformFunction, flushFunction])` - -Make a custom [transform stream](https://nodejs.org/docs/latest/api/stream.html#stream_class_stream_transform). - -The `options` object is passed to the internal transform stream and can be used to create an `objectMode` stream (or use the shortcut `miss.through.obj([...])`) - -The `transformFunction` is called when data is available for the writable side and has the signature `(chunk, encoding, cb)`. Within the function, add data to the readable side any number of times with `this.push(data)`. Call `cb()` to indicate processing of the `chunk` is complete. Or to easily emit a single error or chunk, call `cb(err, chunk)` - -The `flushFunction`, with signature `(cb)`, is called just before the stream is complete and should be used to wrap up stream processing. - -#### original module - -`miss.through` is provided by [`require('through2')`](https://www.npmjs.com/package/through2) - -#### example - -```js -var fs = require('fs') - -var read = fs.createReadStream('./boring_lowercase.txt') -var write = fs.createWriteStream('./AWESOMECASE.TXT') - -// Leaving out the options object -var uppercaser = miss.through( - function (chunk, enc, cb) { - cb(null, chunk.toString().toUpperCase()) - }, - function (cb) { - cb(null, 'ONE LAST BIT OF UPPERCASE') - } -) - -miss.pipe(read, uppercaser, write, function (err) { - if (err) return console.error('Trouble uppercasing!') - console.log('Splendid uppercasing!') -}) -``` - -### from - -##### `miss.from([opts], read)` - -Make a custom [readable stream](https://nodejs.org/docs/latest/api/stream.html#stream_class_stream_readable). - -`opts` contains the options to pass on to the ReadableStream constructor e.g. for creating a readable object stream (or use the shortcut `miss.from.obj([...])`). - -Returns a readable stream that calls `read(size, next)` when data is requested from the stream. - -- `size` is the recommended amount of data (in bytes) to retrieve. -- `next(err, chunk)` should be called when you're ready to emit more data. - -#### original module - -`miss.from` is provided by [`require('from2')`](https://www.npmjs.com/package/from2) - -#### example - -```js - - -function fromString(string) { - return miss.from(function(size, next) { - // if there's no more content - // left in the string, close the stream. - if (string.length <= 0) return next(null, null) - - // Pull in a new chunk of text, - // removing it from the string. - var chunk = string.slice(0, size) - string = string.slice(size) - - // Emit "chunk" from the stream. - next(null, chunk) - }) -} - -// pipe "hello world" out -// to stdout. -fromString('hello world').pipe(process.stdout) -``` - -### to - -##### `miss.to([options], write, [flush])` - -Make a custom [writable stream](https://nodejs.org/docs/latest/api/stream.html#stream_class_stream_writable). - -`opts` contains the options to pass on to the WritableStream constructor e.g. for creating a writable object stream (or use the shortcut `miss.to.obj([...])`). - -Returns a writable stream that calls `write(data, enc, cb)` when data is written to the stream. - -- `data` is the received data to write the destination. -- `enc` encoding of the piece of data received. -- `cb(err, data)` should be called when you're ready to write more data, or encountered an error. - -`flush(cb)` is called before `finish` is emitted and allows for cleanup steps to occur. - -#### original module - -`miss.to` is provided by [`require('flush-write-stream')`](https://www.npmjs.com/package/flush-write-stream) - -#### example - -```js -var ws = miss.to(write, flush) - -ws.on('finish', function () { - console.log('finished') -}) - -ws.write('hello') -ws.write('world') -ws.end() - -function write (data, enc, cb) { - // i am your normal ._write method - console.log('writing', data.toString()) - cb() -} - -function flush (cb) { - // i am called before finish is emitted - setTimeout(cb, 1000) // wait 1 sec -} -``` - -If you run the above it will produce the following output - -``` -writing hello -writing world -(nothing happens for 1 sec) -finished -``` - -### concat - -##### `var concat = miss.concat(cb)` - -Returns a writable stream that concatenates all data written to the stream and calls a callback with the single result. - -Calling `miss.concat(cb)` returns a writable stream. `cb` is called when the writable stream is finished, e.g. when all data is done being written to it. `cb` is called with a single argument, `(data)`, which will contain the result of concatenating all the data written to the stream. - -Note that `miss.concat` will not handle stream errors for you. To handle errors, use `miss.pipe` or handle the `error` event manually. - -#### original module - -`miss.concat` is provided by [`require('concat-stream')`](https://www.npmjs.com/package/concat-stream) - -#### example - -```js -var fs = require('fs') - -var readStream = fs.createReadStream('cat.png') -var concatStream = miss.concat(gotPicture) - -function callback (err) { - if (err) { - console.error(err) - process.exit(1) - } -} - -miss.pipe(readStream, concatStream, callback) - -function gotPicture(imageBuffer) { - // imageBuffer is all of `cat.png` as a node.js Buffer -} - -function handleError(err) { - // handle your error appropriately here, e.g.: - console.error(err) // print the error to STDERR - process.exit(1) // exit program with non-zero exit code -} -``` - -### finished - -##### `miss.finished(stream, cb)` - -Waits for `stream` to finish or error and then calls `cb` with `(err)`. `cb` will only be called once. `err` will be null if the stream finished without error, or else it will be populated with the error from the streams `error` event. - -This function is useful for simplifying stream handling code as it lets you handle success or error conditions in a single code path. It's used internally `miss.pipe`. - -#### original module - -`miss.finished` is provided by [`require('end-of-stream')`](https://www.npmjs.com/package/end-of-stream) - -#### example - -```js -var copySource = fs.createReadStream('./movie.mp4') -var copyDest = fs.createWriteStream('./movie-copy.mp4') - -copySource.pipe(copyDest) - -miss.finished(copyDest, function(err) { - if (err) return console.log('write failed', err) - console.log('write success') -}) -``` - -### parallel - -##### `miss.parallel(concurrency, each)` - -This works like `through` except you can process items in parallel, while still preserving the original input order. - -This is handy if you wanna take advantage of node's async I/O and process streams of items in batches. With this module you can build your very own streaming parallel job queue. - -Note that `miss.parallel` preserves input ordering, if you don't need that then you can use [through2-concurrent](https://github.com/almost/through2-concurrent) instead, which is very similar to this otherwise. - -#### original module - -`miss.parallel` is provided by [`require('parallel-transform')`](https://npmjs.org/parallel-transform) - -#### example - -This example fetches the GET HTTP headers for a stream of input URLs 5 at a time in parallel. - -```js -function getResponse (item, cb) { - var r = request(item.url) - r.on('error', function (err) { - cb(err) - }) - r.on('response', function (re) { - cb(null, {url: item.url, date: new Date(), status: re.statusCode, headers: re.headers}) - r.abort() - }) -} - -miss.pipe( - fs.createReadStream('./urls.txt'), // one url per line - split(), - miss.parallel(5, getResponse), - miss.through(function (row, enc, next) { - console.log(JSON.stringify(row)) - next() - }) -) -``` - -## see also - -- [substack/stream-handbook](https://github.com/substack/stream-handbook) -- [nodejs.org/api/stream.html](https://nodejs.org/api/stream.html) -- [awesome-nodejs-streams](https://github.com/thejmazz/awesome-nodejs-streams) - -## license - -Licensed under the BSD 2-clause license. diff --git a/deps/npm/node_modules/mkdirp-infer-owner/LICENSE b/deps/npm/node_modules/mkdirp-infer-owner/LICENSE new file mode 100644 index 00000000000000..05eeeb88c2ef4c --- /dev/null +++ b/deps/npm/node_modules/mkdirp-infer-owner/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/deps/npm/node_modules/mkdirp-infer-owner/README.md b/deps/npm/node_modules/mkdirp-infer-owner/README.md new file mode 100644 index 00000000000000..c466ac3404b38b --- /dev/null +++ b/deps/npm/node_modules/mkdirp-infer-owner/README.md @@ -0,0 +1,16 @@ +# mkdirp-infer-owner + +[`mkdirp`](http://npm.im/mkdirp), but chown to the owner of the containing +folder if possible and necessary. + +That is, on Windows and when running as non-root, it's exactly the same as +[`mkdirp`](http://npm.im/mkdirp). + +When running as root on non-Windows systems, it uses +[`infer-owner`](http://npm.im/infer-owner) to find the owner of the +containing folder, and then [`chownr`](http://npm.im/chownr) to set the +ownership of the created folder to that same uid/gid. + +This is used by [npm](http://npm.im/npm) to prevent root-owned files and +folders from showing up in your home directory (either in `node_modules` or +in the `~/.npm` cache) when running as root. diff --git a/deps/npm/node_modules/mkdirp-infer-owner/index.js b/deps/npm/node_modules/mkdirp-infer-owner/index.js new file mode 100644 index 00000000000000..750743f51a9f91 --- /dev/null +++ b/deps/npm/node_modules/mkdirp-infer-owner/index.js @@ -0,0 +1,26 @@ +const inferOwner = require('infer-owner') +const mkdirp = require('mkdirp') +const {promisify} = require('util') +const chownr = promisify(require('chownr')) + +const platform = process.env.__TESTING_MKDIRP_INFER_OWNER_PLATFORM__ + || process.platform +const isWindows = platform === 'win32' +const isRoot = process.getuid && process.getuid() === 0 +const doChown = !isWindows && isRoot + +module.exports = !doChown ? (path, opts) => mkdirp(path, opts) + : (path, opts) => inferOwner(path).then(({uid, gid}) => + mkdirp(path, opts).then(made => + uid !== 0 || gid !== process.getgid() + ? chownr(made || path, uid, gid).then(() => made) + : made)) + +module.exports.sync = !doChown ? (path, opts) => mkdirp.sync(path, opts) + : (path, opts) => { + const {uid, gid} = inferOwner.sync(path) + const made = mkdirp.sync(path) + if (uid !== 0 || gid !== process.getgid()) + chownr.sync(made || path, uid, gid) + return made + } diff --git a/deps/npm/node_modules/mkdirp-infer-owner/package.json b/deps/npm/node_modules/mkdirp-infer-owner/package.json new file mode 100644 index 00000000000000..1f67ad0edf501c --- /dev/null +++ b/deps/npm/node_modules/mkdirp-infer-owner/package.json @@ -0,0 +1,36 @@ +{ + "name": "mkdirp-infer-owner", + "version": "2.0.0", + "files": [ + "index.js" + ], + "description": "mkdirp, but chown to the owner of the containing folder if possible and necessary", + "author": "Isaac Z. Schlueter (https://izs.me)", + "license": "ISC", + "scripts": { + "test": "tap", + "preversion": "npm test", + "postversion": "npm publish", + "prepublishOnly": "git push origin --follow-tags", + "snap": "tap" + }, + "tap": { + "check-coverage": true + }, + "devDependencies": { + "require-inject": "^1.4.4", + "tap": "^14.10.6" + }, + "dependencies": { + "chownr": "^2.0.0", + "infer-owner": "^1.0.4", + "mkdirp": "^1.0.3" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/isaacs/mkdirp-infer-owner" + }, + "engines": { + "node": ">=10" + } +} diff --git a/deps/npm/node_modules/mkdirp/CHANGELOG.md b/deps/npm/node_modules/mkdirp/CHANGELOG.md new file mode 100644 index 00000000000000..81458380be9a28 --- /dev/null +++ b/deps/npm/node_modules/mkdirp/CHANGELOG.md @@ -0,0 +1,15 @@ +# Changers Lorgs! + +## 1.0 + +Full rewrite. Essentially a brand new module. + +- Return a promise instead of taking a callback. +- Use native `fs.mkdir(path, { recursive: true })` when available. +- Drop support for outdated Node.js versions. (Technically still works on + Node.js v8, but only 10 and above are officially supported.) + +## 0.x + +Original and most widely used recursive directory creation implementation +in JavaScript, dating back to 2010. diff --git a/deps/npm/node_modules/mkdirp/LICENSE b/deps/npm/node_modules/mkdirp/LICENSE index 432d1aeb01df66..13fcd15f0e0beb 100644 --- a/deps/npm/node_modules/mkdirp/LICENSE +++ b/deps/npm/node_modules/mkdirp/LICENSE @@ -1,6 +1,6 @@ -Copyright 2010 James Halliday (mail@substack.net) +Copyright James Halliday (mail@substack.net) and Isaac Z. Schlueter (i@izs.me) -This project is free software released under the MIT/X11 license: +This project is free software released under the MIT license: Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/deps/npm/node_modules/mkdirp/README.markdown b/deps/npm/node_modules/mkdirp/README.markdown index fc314bfbd662cf..827de5905230a9 100644 --- a/deps/npm/node_modules/mkdirp/README.markdown +++ b/deps/npm/node_modules/mkdirp/README.markdown @@ -1,26 +1,37 @@ # mkdirp -Like `mkdir -p`, but in node.js! +Like `mkdir -p`, but in Node.js! -[![build status](https://secure.travis-ci.org/substack/node-mkdirp.png)](http://travis-ci.org/substack/node-mkdirp) +Now with a modern API and no\* bugs! + +\* may contain some bugs # example ## pow.js ```js -var mkdirp = require('mkdirp'); - -mkdirp('/tmp/foo/bar/baz', function (err) { - if (err) console.error(err) - else console.log('pow!') -}); +const mkdirp = require('mkdirp') + +// return value is a Promise resolving to the first directory created +mkdirp('/tmp/foo/bar/baz').then(made => + console.log(`made directories, starting with ${made}`)) ``` -Output +Output (where `/tmp/foo` already exists) ``` -pow! +made directories, starting with /tmp/foo/bar +``` + +Or, if you don't have time to wait around for promises: + +```js +const mkdirp = require('mkdirp') + +// return value is the first directory created +const made = mkdirp.sync('/tmp/foo/bar/baz') +console.log(`made directories, starting with ${made}`) ``` And now /tmp/foo/bar/baz exists, huzzah! @@ -28,55 +39,198 @@ And now /tmp/foo/bar/baz exists, huzzah! # methods ```js -var mkdirp = require('mkdirp'); +const mkdirp = require('mkdirp') ``` -## mkdirp(dir, opts, cb) +## mkdirp(dir, [opts]) -> Promise Create a new directory and any necessary subdirectories at `dir` with octal -permission string `opts.mode`. If `opts` is a non-object, it will be treated as -the `opts.mode`. +permission string `opts.mode`. If `opts` is a string or number, it will be +treated as the `opts.mode`. -If `opts.mode` isn't specified, it defaults to `0777`. +If `opts.mode` isn't specified, it defaults to `0o777 & +(~process.umask())`. -`cb(err, made)` fires with the error or the first directory `made` -that had to be created, if any. +Promise resolves to first directory `made` that had to be created, or +`undefined` if everything already exists. Promise rejects if any errors +are encountered. Note that, in the case of promise rejection, some +directories _may_ have been created, as recursive directory creation is not +an atomic operation. You can optionally pass in an alternate `fs` implementation by passing in -`opts.fs`. Your implementation should have `opts.fs.mkdir(path, mode, cb)` and -`opts.fs.stat(path, cb)`. +`opts.fs`. Your implementation should have `opts.fs.mkdir(path, opts, cb)` +and `opts.fs.stat(path, cb)`. -## mkdirp.sync(dir, opts) +You can also override just one or the other of `mkdir` and `stat` by +passing in `opts.stat` or `opts.mkdir`, or providing an `fs` option that +only overrides one of these. -Synchronously create a new directory and any necessary subdirectories at `dir` -with octal permission string `opts.mode`. If `opts` is a non-object, it will be -treated as the `opts.mode`. +## mkdirp.sync(dir, opts) -> String|null -If `opts.mode` isn't specified, it defaults to `0777`. +Synchronously create a new directory and any necessary subdirectories at +`dir` with octal permission string `opts.mode`. If `opts` is a string or +number, it will be treated as the `opts.mode`. -Returns the first directory that had to be created, if any. +If `opts.mode` isn't specified, it defaults to `0o777 & +(~process.umask())`. + +Returns the first directory that had to be created, or undefined if +everything already exists. You can optionally pass in an alternate `fs` implementation by passing in -`opts.fs`. Your implementation should have `opts.fs.mkdirSync(path, mode)` and -`opts.fs.statSync(path)`. +`opts.fs`. Your implementation should have `opts.fs.mkdirSync(path, mode)` +and `opts.fs.statSync(path)`. + +You can also override just one or the other of `mkdirSync` and `statSync` +by passing in `opts.statSync` or `opts.mkdirSync`, or providing an `fs` +option that only overrides one of these. -# usage +## mkdirp.manual, mkdirp.manualSync + +Use the manual implementation (not the native one). This is the default +when the native implementation is not available or the stat/mkdir +implementation is overridden. + +## mkdirp.native, mkdirp.nativeSync + +Use the native implementation (not the manual one). This is the default +when the native implementation is available and stat/mkdir are not +overridden. + +# implementation + +On Node.js v10.12.0 and above, use the native `fs.mkdir(p, +{recursive:true})` option, unless `fs.mkdir`/`fs.mkdirSync` has been +overridden by an option. + +## native implementation + +- If the path is a root directory, then pass it to the underlying + implementation and return the result/error. (In this case, it'll either + succeed or fail, but we aren't actually creating any dirs.) +- Walk up the path statting each directory, to find the first path that + will be created, `made`. +- Call `fs.mkdir(path, { recursive: true })` (or `fs.mkdirSync`) +- If error, raise it to the caller. +- Return `made`. + +## manual implementation + +- Call underlying `fs.mkdir` implementation, with `recursive: false` +- If error: + - If path is a root directory, raise to the caller and do not handle it + - If ENOENT, mkdirp parent dir, store result as `made` + - stat(path) + - If error, raise original `mkdir` error + - If directory, return `made` + - Else, raise original `mkdir` error +- else + - return `undefined` if a root dir, or `made` if set, or `path` + +## windows vs unix caveat + +On Windows file systems, attempts to create a root directory (ie, a drive +letter or root UNC path) will fail. If the root directory exists, then it +will fail with `EPERM`. If the root directory does not exist, then it will +fail with `ENOENT`. + +On posix file systems, attempts to create a root directory (in recursive +mode) will succeed silently, as it is treated like just another directory +that already exists. (In non-recursive mode, of course, it fails with +`EEXIST`.) + +In order to preserve this system-specific behavior (and because it's not as +if we can create the parent of a root directory anyway), attempts to create +a root directory are passed directly to the `fs` implementation, and any +errors encountered are not handled. + +## native error caveat + +The native implementation (as of at least Node.js v13.4.0) does not provide +appropriate errors in some cases (see +[nodejs/node#31481](https://github.com/nodejs/node/issues/31481) and +[nodejs/node#28015](https://github.com/nodejs/node/issues/28015)). + +In order to work around this issue, the native implementation will fall +back to the manual implementation if an `ENOENT` error is encountered. + +# choosing a recursive mkdir implementation + +There are a few to choose from! Use the one that suits your needs best :D + +## use `fs.mkdir(path, {recursive: true}, cb)` if: + +- You wish to optimize performance even at the expense of other factors. +- You don't need to know the first dir created. +- You are ok with getting `ENOENT` as the error when some other problem is + the actual cause. +- You can limit your platforms to Node.js v10.12 and above. +- You're ok with using callbacks instead of promises. +- You don't need/want a CLI. +- You don't need to override the `fs` methods in use. + +## use this module (mkdirp 1.x) if: + +- You need to know the first directory that was created. +- You wish to use the native implementation if available, but fall back + when it's not. +- You prefer promise-returning APIs to callback-taking APIs. +- You want more useful error messages than the native recursive mkdir + provides (at least as of Node.js v13.4), and are ok with re-trying on + `ENOENT` to achieve this. +- You need (or at least, are ok with) a CLI. +- You need to override the `fs` methods in use. + +## use [`make-dir`](http://npm.im/make-dir) if: + +- You do not need to know the first dir created (and wish to save a few + `stat` calls when using the native implementation for this reason). +- You wish to use the native implementation if available, but fall back + when it's not. +- You prefer promise-returning APIs to callback-taking APIs. +- You are ok with occasionally getting `ENOENT` errors for failures that + are actually related to something other than a missing file system entry. +- You don't need/want a CLI. +- You need to override the `fs` methods in use. + +## use mkdirp 0.x if: + +- You need to know the first directory that was created. +- You need (or at least, are ok with) a CLI. +- You need to override the `fs` methods in use. +- You're ok with using callbacks instead of promises. +- You are not running on Windows, where the root-level ENOENT errors can + lead to infinite regress. +- You think vinyl just sounds warmer and richer for some weird reason. +- You are supporting truly ancient Node.js versions, before even the advent + of a `Promise` language primitive. (Please don't. You deserve better.) + +# cli This package also ships with a `mkdirp` command. ``` +$ mkdirp -h + usage: mkdirp [DIR1,DIR2..] {OPTIONS} - Create each supplied directory including any necessary parent directories that - don't yet exist. - + Create each supplied directory including any necessary parent directories + that don't yet exist. + If the directory already exists, do nothing. OPTIONS are: - -m, --mode If a directory needs to be created, set the mode as an octal - permission string. + -m If a directory needs to be created, set the mode as an octal + --mode= permission string. + + -v --version Print the mkdirp version number + -h --help Print this helpful banner + + -p --print Print the first directories created for each path provided + + --manual Use manual implementation, even if native is available ``` # install @@ -87,13 +241,25 @@ With [npm](http://npmjs.org) do: npm install mkdirp ``` -to get the library, or +to get the library locally, or ``` npm install -g mkdirp ``` -to get the command. +to get the command everywhere, or + +``` +npx mkdirp ... +``` + +to run the command without installing it globally. + +# platform support + +This module works on node v8, but only v10 and above are officially +supported, as Node v8 reached its LTS end of life 2020-01-01, which is in +the past, as of this writing. # license diff --git a/deps/npm/node_modules/mkdirp/bin/cmd.js b/deps/npm/node_modules/mkdirp/bin/cmd.js index d95de15ae9743f..6e0aa8dc4667b6 100755 --- a/deps/npm/node_modules/mkdirp/bin/cmd.js +++ b/deps/npm/node_modules/mkdirp/bin/cmd.js @@ -1,33 +1,68 @@ #!/usr/bin/env node -var mkdirp = require('../'); -var minimist = require('minimist'); -var fs = require('fs'); - -var argv = minimist(process.argv.slice(2), { - alias: { m: 'mode', h: 'help' }, - string: [ 'mode' ] -}); -if (argv.help) { - fs.createReadStream(__dirname + '/usage.txt').pipe(process.stdout); - return; -} +const usage = () => ` +usage: mkdirp [DIR1,DIR2..] {OPTIONS} + + Create each supplied directory including any necessary parent directories + that don't yet exist. + + If the directory already exists, do nothing. + +OPTIONS are: + + -m If a directory needs to be created, set the mode as an octal + --mode= permission string. + + -v --version Print the mkdirp version number -var paths = argv._.slice(); -var mode = argv.mode ? parseInt(argv.mode, 8) : undefined; - -(function next () { - if (paths.length === 0) return; - var p = paths.shift(); - - if (mode === undefined) mkdirp(p, cb) - else mkdirp(p, mode, cb) - - function cb (err) { - if (err) { - console.error(err.message); - process.exit(1); - } - else next(); + -h --help Print this helpful banner + + -p --print Print the first directories created for each path provided + + --manual Use manual implementation, even if native is available +` + +const dirs = [] +const opts = {} +let print = false +let dashdash = false +let manual = false +for (const arg of process.argv.slice(2)) { + if (dashdash) + dirs.push(arg) + else if (arg === '--') + dashdash = true + else if (arg === '--manual') + manual = true + else if (/^-h/.test(arg) || /^--help/.test(arg)) { + console.log(usage()) + process.exit(0) + } else if (arg === '-v' || arg === '--version') { + console.log(require('../package.json').version) + process.exit(0) + } else if (arg === '-p' || arg === '--print') { + print = true + } else if (/^-m/.test(arg) || /^--mode=/.test(arg)) { + const mode = parseInt(arg.replace(/^(-m|--mode=)/, ''), 8) + if (isNaN(mode)) { + console.error(`invalid mode argument: ${arg}\nMust be an octal number.`) + process.exit(1) } -})(); + opts.mode = mode + } else + dirs.push(arg) +} + +const mkdirp = require('../') +const impl = manual ? mkdirp.manual : mkdirp +if (dirs.length === 0) + console.error(usage()) + +Promise.all(dirs.map(dir => impl(dir, opts))) + .then(made => print ? made.forEach(m => m && console.log(m)) : null) + .catch(er => { + console.error(er.message) + if (er.code) + console.error(' code: ' + er.code) + process.exit(1) + }) diff --git a/deps/npm/node_modules/mkdirp/bin/usage.txt b/deps/npm/node_modules/mkdirp/bin/usage.txt deleted file mode 100644 index f952aa2c7a979e..00000000000000 --- a/deps/npm/node_modules/mkdirp/bin/usage.txt +++ /dev/null @@ -1,12 +0,0 @@ -usage: mkdirp [DIR1,DIR2..] {OPTIONS} - - Create each supplied directory including any necessary parent directories that - don't yet exist. - - If the directory already exists, do nothing. - -OPTIONS are: - - -m, --mode If a directory needs to be created, set the mode as an octal - permission string. - diff --git a/deps/npm/node_modules/mkdirp/index.js b/deps/npm/node_modules/mkdirp/index.js index 468d7cd8df53be..ad7a16c9f45d97 100644 --- a/deps/npm/node_modules/mkdirp/index.js +++ b/deps/npm/node_modules/mkdirp/index.js @@ -1,99 +1,31 @@ -var path = require('path'); -var fs = require('fs'); -var _0777 = parseInt('0777', 8); +const optsArg = require('./lib/opts-arg.js') +const pathArg = require('./lib/path-arg.js') -module.exports = mkdirP.mkdirp = mkdirP.mkdirP = mkdirP; +const {mkdirpNative, mkdirpNativeSync} = require('./lib/mkdirp-native.js') +const {mkdirpManual, mkdirpManualSync} = require('./lib/mkdirp-manual.js') +const {useNative, useNativeSync} = require('./lib/use-native.js') -function mkdirP (p, opts, f, made) { - if (typeof opts === 'function') { - f = opts; - opts = {}; - } - else if (!opts || typeof opts !== 'object') { - opts = { mode: opts }; - } - - var mode = opts.mode; - var xfs = opts.fs || fs; - - if (mode === undefined) { - mode = _0777 - } - if (!made) made = null; - - var cb = f || function () {}; - p = path.resolve(p); - - xfs.mkdir(p, mode, function (er) { - if (!er) { - made = made || p; - return cb(null, made); - } - switch (er.code) { - case 'ENOENT': - if (path.dirname(p) === p) return cb(er); - mkdirP(path.dirname(p), opts, function (er, made) { - if (er) cb(er, made); - else mkdirP(p, opts, cb, made); - }); - break; - // In the case of any other error, just see if there's a dir - // there already. If so, then hooray! If not, then something - // is borked. - default: - xfs.stat(p, function (er2, stat) { - // if the stat fails, then that's super weird. - // let the original error be the failure reason. - if (er2 || !stat.isDirectory()) cb(er, made) - else cb(null, made); - }); - break; - } - }); +const mkdirp = (path, opts) => { + path = pathArg(path) + opts = optsArg(opts) + return useNative(opts) + ? mkdirpNative(path, opts) + : mkdirpManual(path, opts) } -mkdirP.sync = function sync (p, opts, made) { - if (!opts || typeof opts !== 'object') { - opts = { mode: opts }; - } - - var mode = opts.mode; - var xfs = opts.fs || fs; - - if (mode === undefined) { - mode = _0777 - } - if (!made) made = null; - - p = path.resolve(p); - - try { - xfs.mkdirSync(p, mode); - made = made || p; - } - catch (err0) { - switch (err0.code) { - case 'ENOENT' : - made = sync(path.dirname(p), opts, made); - sync(p, opts, made); - break; +const mkdirpSync = (path, opts) => { + path = pathArg(path) + opts = optsArg(opts) + return useNativeSync(opts) + ? mkdirpNativeSync(path, opts) + : mkdirpManualSync(path, opts) +} - // In the case of any other error, just see if there's a dir - // there already. If so, then hooray! If not, then something - // is borked. - default: - var stat; - try { - stat = xfs.statSync(p); - } - catch (err1) { - throw err0; - } - if (!stat.isDirectory()) throw err0; - break; - } - } +mkdirp.sync = mkdirpSync +mkdirp.native = (path, opts) => mkdirpNative(pathArg(path), optsArg(opts)) +mkdirp.manual = (path, opts) => mkdirpManual(pathArg(path), optsArg(opts)) +mkdirp.nativeSync = (path, opts) => mkdirpNativeSync(pathArg(path), optsArg(opts)) +mkdirp.manualSync = (path, opts) => mkdirpManualSync(pathArg(path), optsArg(opts)) - return made; -}; +module.exports = mkdirp diff --git a/deps/npm/node_modules/mkdirp/lib/find-made.js b/deps/npm/node_modules/mkdirp/lib/find-made.js new file mode 100644 index 00000000000000..022e492c085da0 --- /dev/null +++ b/deps/npm/node_modules/mkdirp/lib/find-made.js @@ -0,0 +1,29 @@ +const {dirname} = require('path') + +const findMade = (opts, parent, path = undefined) => { + // we never want the 'made' return value to be a root directory + if (path === parent) + return Promise.resolve() + + return opts.statAsync(parent).then( + st => st.isDirectory() ? path : undefined, // will fail later + er => er.code === 'ENOENT' + ? findMade(opts, dirname(parent), parent) + : undefined + ) +} + +const findMadeSync = (opts, parent, path = undefined) => { + if (path === parent) + return undefined + + try { + return opts.statSync(parent).isDirectory() ? path : undefined + } catch (er) { + return er.code === 'ENOENT' + ? findMadeSync(opts, dirname(parent), parent) + : undefined + } +} + +module.exports = {findMade, findMadeSync} diff --git a/deps/npm/node_modules/mkdirp/lib/mkdirp-manual.js b/deps/npm/node_modules/mkdirp/lib/mkdirp-manual.js new file mode 100644 index 00000000000000..2eb18cd64eb79c --- /dev/null +++ b/deps/npm/node_modules/mkdirp/lib/mkdirp-manual.js @@ -0,0 +1,64 @@ +const {dirname} = require('path') + +const mkdirpManual = (path, opts, made) => { + opts.recursive = false + const parent = dirname(path) + if (parent === path) { + return opts.mkdirAsync(path, opts).catch(er => { + // swallowed by recursive implementation on posix systems + // any other error is a failure + if (er.code !== 'EISDIR') + throw er + }) + } + + return opts.mkdirAsync(path, opts).then(() => made || path, er => { + if (er.code === 'ENOENT') + return mkdirpManual(parent, opts) + .then(made => mkdirpManual(path, opts, made)) + if (er.code !== 'EEXIST' && er.code !== 'EROFS') + throw er + return opts.statAsync(path).then(st => { + if (st.isDirectory()) + return made + else + throw er + }, () => { throw er }) + }) +} + +const mkdirpManualSync = (path, opts, made) => { + const parent = dirname(path) + opts.recursive = false + + if (parent === path) { + try { + return opts.mkdirSync(path, opts) + } catch (er) { + // swallowed by recursive implementation on posix systems + // any other error is a failure + if (er.code !== 'EISDIR') + throw er + else + return + } + } + + try { + opts.mkdirSync(path, opts) + return made || path + } catch (er) { + if (er.code === 'ENOENT') + return mkdirpManualSync(path, opts, mkdirpManualSync(parent, opts, made)) + if (er.code !== 'EEXIST' && er.code !== 'EROFS') + throw er + try { + if (!opts.statSync(path).isDirectory()) + throw er + } catch (_) { + throw er + } + } +} + +module.exports = {mkdirpManual, mkdirpManualSync} diff --git a/deps/npm/node_modules/mkdirp/lib/mkdirp-native.js b/deps/npm/node_modules/mkdirp/lib/mkdirp-native.js new file mode 100644 index 00000000000000..c7a6b69800f62b --- /dev/null +++ b/deps/npm/node_modules/mkdirp/lib/mkdirp-native.js @@ -0,0 +1,39 @@ +const {dirname} = require('path') +const {findMade, findMadeSync} = require('./find-made.js') +const {mkdirpManual, mkdirpManualSync} = require('./mkdirp-manual.js') + +const mkdirpNative = (path, opts) => { + opts.recursive = true + const parent = dirname(path) + if (parent === path) + return opts.mkdirAsync(path, opts) + + return findMade(opts, path).then(made => + opts.mkdirAsync(path, opts).then(() => made) + .catch(er => { + if (er.code === 'ENOENT') + return mkdirpManual(path, opts) + else + throw er + })) +} + +const mkdirpNativeSync = (path, opts) => { + opts.recursive = true + const parent = dirname(path) + if (parent === path) + return opts.mkdirSync(path, opts) + + const made = findMadeSync(opts, path) + try { + opts.mkdirSync(path, opts) + return made + } catch (er) { + if (er.code === 'ENOENT') + return mkdirpManualSync(path, opts) + else + throw er + } +} + +module.exports = {mkdirpNative, mkdirpNativeSync} diff --git a/deps/npm/node_modules/mkdirp/lib/opts-arg.js b/deps/npm/node_modules/mkdirp/lib/opts-arg.js new file mode 100644 index 00000000000000..2fa4833faacc70 --- /dev/null +++ b/deps/npm/node_modules/mkdirp/lib/opts-arg.js @@ -0,0 +1,23 @@ +const { promisify } = require('util') +const fs = require('fs') +const optsArg = opts => { + if (!opts) + opts = { mode: 0o777, fs } + else if (typeof opts === 'object') + opts = { mode: 0o777, fs, ...opts } + else if (typeof opts === 'number') + opts = { mode: opts, fs } + else if (typeof opts === 'string') + opts = { mode: parseInt(opts, 8), fs } + else + throw new TypeError('invalid options argument') + + opts.mkdir = opts.mkdir || opts.fs.mkdir || fs.mkdir + opts.mkdirAsync = promisify(opts.mkdir) + opts.stat = opts.stat || opts.fs.stat || fs.stat + opts.statAsync = promisify(opts.stat) + opts.statSync = opts.statSync || opts.fs.statSync || fs.statSync + opts.mkdirSync = opts.mkdirSync || opts.fs.mkdirSync || fs.mkdirSync + return opts +} +module.exports = optsArg diff --git a/deps/npm/node_modules/mkdirp/lib/path-arg.js b/deps/npm/node_modules/mkdirp/lib/path-arg.js new file mode 100644 index 00000000000000..cc07de5a6f9920 --- /dev/null +++ b/deps/npm/node_modules/mkdirp/lib/path-arg.js @@ -0,0 +1,29 @@ +const platform = process.env.__TESTING_MKDIRP_PLATFORM__ || process.platform +const { resolve, parse } = require('path') +const pathArg = path => { + if (/\0/.test(path)) { + // simulate same failure that node raises + throw Object.assign( + new TypeError('path must be a string without null bytes'), + { + path, + code: 'ERR_INVALID_ARG_VALUE', + } + ) + } + + path = resolve(path) + if (platform === 'win32') { + const badWinChars = /[*|"<>?:]/ + const {root} = parse(path) + if (badWinChars.test(path.substr(root.length))) { + throw Object.assign(new Error('Illegal characters in path.'), { + path, + code: 'EINVAL', + }) + } + } + + return path +} +module.exports = pathArg diff --git a/deps/npm/node_modules/mkdirp/lib/use-native.js b/deps/npm/node_modules/mkdirp/lib/use-native.js new file mode 100644 index 00000000000000..079361de19fd81 --- /dev/null +++ b/deps/npm/node_modules/mkdirp/lib/use-native.js @@ -0,0 +1,10 @@ +const fs = require('fs') + +const version = process.env.__TESTING_MKDIRP_NODE_VERSION__ || process.version +const versArr = version.replace(/^v/, '').split('.') +const hasNative = +versArr[0] > 10 || +versArr[0] === 10 && +versArr[1] >= 12 + +const useNative = !hasNative ? () => false : opts => opts.mkdir === fs.mkdir +const useNativeSync = !hasNative ? () => false : opts => opts.mkdirSync === fs.mkdirSync + +module.exports = {useNative, useNativeSync} diff --git a/deps/npm/node_modules/mkdirp/node_modules/minimist/.travis.yml b/deps/npm/node_modules/mkdirp/node_modules/minimist/.travis.yml deleted file mode 100644 index 74c57bf15e2391..00000000000000 --- a/deps/npm/node_modules/mkdirp/node_modules/minimist/.travis.yml +++ /dev/null @@ -1,8 +0,0 @@ -language: node_js -node_js: - - "0.8" - - "0.10" - - "0.12" - - "iojs" -before_install: - - npm install -g npm@~1.4.6 diff --git a/deps/npm/node_modules/mkdirp/node_modules/minimist/LICENSE b/deps/npm/node_modules/mkdirp/node_modules/minimist/LICENSE deleted file mode 100644 index ee27ba4b4412b0..00000000000000 --- a/deps/npm/node_modules/mkdirp/node_modules/minimist/LICENSE +++ /dev/null @@ -1,18 +0,0 @@ -This software is released under the MIT license: - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of -the Software, and to permit persons to whom the Software is furnished to do so, -subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/deps/npm/node_modules/mkdirp/node_modules/minimist/example/parse.js b/deps/npm/node_modules/mkdirp/node_modules/minimist/example/parse.js deleted file mode 100644 index f7c8d49807f32e..00000000000000 --- a/deps/npm/node_modules/mkdirp/node_modules/minimist/example/parse.js +++ /dev/null @@ -1,2 +0,0 @@ -var argv = require('../')(process.argv.slice(2)); -console.log(argv); diff --git a/deps/npm/node_modules/mkdirp/node_modules/minimist/index.js b/deps/npm/node_modules/mkdirp/node_modules/minimist/index.js deleted file mode 100644 index d5fa9d510fa17e..00000000000000 --- a/deps/npm/node_modules/mkdirp/node_modules/minimist/index.js +++ /dev/null @@ -1,244 +0,0 @@ -module.exports = function (args, opts) { - if (!opts) opts = {}; - - var flags = { bools : {}, strings : {}, unknownFn: null }; - - if (typeof opts['unknown'] === 'function') { - flags.unknownFn = opts['unknown']; - } - - if (typeof opts['boolean'] === 'boolean' && opts['boolean']) { - flags.allBools = true; - } else { - [].concat(opts['boolean']).filter(Boolean).forEach(function (key) { - flags.bools[key] = true; - }); - } - - var aliases = {}; - Object.keys(opts.alias || {}).forEach(function (key) { - aliases[key] = [].concat(opts.alias[key]); - aliases[key].forEach(function (x) { - aliases[x] = [key].concat(aliases[key].filter(function (y) { - return x !== y; - })); - }); - }); - - [].concat(opts.string).filter(Boolean).forEach(function (key) { - flags.strings[key] = true; - if (aliases[key]) { - flags.strings[aliases[key]] = true; - } - }); - - var defaults = opts['default'] || {}; - - var argv = { _ : [] }; - Object.keys(flags.bools).forEach(function (key) { - setArg(key, defaults[key] === undefined ? false : defaults[key]); - }); - - var notFlags = []; - - if (args.indexOf('--') !== -1) { - notFlags = args.slice(args.indexOf('--')+1); - args = args.slice(0, args.indexOf('--')); - } - - function argDefined(key, arg) { - return (flags.allBools && /^--[^=]+$/.test(arg)) || - flags.strings[key] || flags.bools[key] || aliases[key]; - } - - function setArg (key, val, arg) { - if (arg && flags.unknownFn && !argDefined(key, arg)) { - if (flags.unknownFn(arg) === false) return; - } - - var value = !flags.strings[key] && isNumber(val) - ? Number(val) : val - ; - setKey(argv, key.split('.'), value); - - (aliases[key] || []).forEach(function (x) { - setKey(argv, x.split('.'), value); - }); - } - - function setKey (obj, keys, value) { - var o = obj; - for (var i = 0; i < keys.length-1; i++) { - var key = keys[i]; - if (key === '__proto__') return; - if (o[key] === undefined) o[key] = {}; - if (o[key] === Object.prototype || o[key] === Number.prototype - || o[key] === String.prototype) o[key] = {}; - if (o[key] === Array.prototype) o[key] = []; - o = o[key]; - } - - var key = keys[keys.length - 1]; - if (key === '__proto__') return; - if (o === Object.prototype || o === Number.prototype - || o === String.prototype) o = {}; - if (o === Array.prototype) o = []; - if (o[key] === undefined || flags.bools[key] || typeof o[key] === 'boolean') { - o[key] = value; - } - else if (Array.isArray(o[key])) { - o[key].push(value); - } - else { - o[key] = [ o[key], value ]; - } - } - - function aliasIsBoolean(key) { - return aliases[key].some(function (x) { - return flags.bools[x]; - }); - } - - for (var i = 0; i < args.length; i++) { - var arg = args[i]; - - if (/^--.+=/.test(arg)) { - // Using [\s\S] instead of . because js doesn't support the - // 'dotall' regex modifier. See: - // http://stackoverflow.com/a/1068308/13216 - var m = arg.match(/^--([^=]+)=([\s\S]*)$/); - var key = m[1]; - var value = m[2]; - if (flags.bools[key]) { - value = value !== 'false'; - } - setArg(key, value, arg); - } - else if (/^--no-.+/.test(arg)) { - var key = arg.match(/^--no-(.+)/)[1]; - setArg(key, false, arg); - } - else if (/^--.+/.test(arg)) { - var key = arg.match(/^--(.+)/)[1]; - var next = args[i + 1]; - if (next !== undefined && !/^-/.test(next) - && !flags.bools[key] - && !flags.allBools - && (aliases[key] ? !aliasIsBoolean(key) : true)) { - setArg(key, next, arg); - i++; - } - else if (/^(true|false)$/.test(next)) { - setArg(key, next === 'true', arg); - i++; - } - else { - setArg(key, flags.strings[key] ? '' : true, arg); - } - } - else if (/^-[^-]+/.test(arg)) { - var letters = arg.slice(1,-1).split(''); - - var broken = false; - for (var j = 0; j < letters.length; j++) { - var next = arg.slice(j+2); - - if (next === '-') { - setArg(letters[j], next, arg) - continue; - } - - if (/[A-Za-z]/.test(letters[j]) && /=/.test(next)) { - setArg(letters[j], next.split('=')[1], arg); - broken = true; - break; - } - - if (/[A-Za-z]/.test(letters[j]) - && /-?\d+(\.\d*)?(e-?\d+)?$/.test(next)) { - setArg(letters[j], next, arg); - broken = true; - break; - } - - if (letters[j+1] && letters[j+1].match(/\W/)) { - setArg(letters[j], arg.slice(j+2), arg); - broken = true; - break; - } - else { - setArg(letters[j], flags.strings[letters[j]] ? '' : true, arg); - } - } - - var key = arg.slice(-1)[0]; - if (!broken && key !== '-') { - if (args[i+1] && !/^(-|--)[^-]/.test(args[i+1]) - && !flags.bools[key] - && (aliases[key] ? !aliasIsBoolean(key) : true)) { - setArg(key, args[i+1], arg); - i++; - } - else if (args[i+1] && /^(true|false)$/.test(args[i+1])) { - setArg(key, args[i+1] === 'true', arg); - i++; - } - else { - setArg(key, flags.strings[key] ? '' : true, arg); - } - } - } - else { - if (!flags.unknownFn || flags.unknownFn(arg) !== false) { - argv._.push( - flags.strings['_'] || !isNumber(arg) ? arg : Number(arg) - ); - } - if (opts.stopEarly) { - argv._.push.apply(argv._, args.slice(i + 1)); - break; - } - } - } - - Object.keys(defaults).forEach(function (key) { - if (!hasKey(argv, key.split('.'))) { - setKey(argv, key.split('.'), defaults[key]); - - (aliases[key] || []).forEach(function (x) { - setKey(argv, x.split('.'), defaults[key]); - }); - } - }); - - if (opts['--']) { - argv['--'] = new Array(); - notFlags.forEach(function(key) { - argv['--'].push(key); - }); - } - else { - notFlags.forEach(function(key) { - argv._.push(key); - }); - } - - return argv; -}; - -function hasKey (obj, keys) { - var o = obj; - keys.slice(0,-1).forEach(function (key) { - o = (o[key] || {}); - }); - - var key = keys[keys.length - 1]; - return key in o; -} - -function isNumber (x) { - if (typeof x === 'number') return true; - if (/^0x[0-9a-f]+$/i.test(x)) return true; - return /^[-+]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(x); -} diff --git a/deps/npm/node_modules/mkdirp/node_modules/minimist/package.json b/deps/npm/node_modules/mkdirp/node_modules/minimist/package.json deleted file mode 100644 index 2846f6885ae634..00000000000000 --- a/deps/npm/node_modules/mkdirp/node_modules/minimist/package.json +++ /dev/null @@ -1,73 +0,0 @@ -{ - "_from": "minimist@^1.2.5", - "_id": "minimist@1.2.5", - "_inBundle": false, - "_integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", - "_location": "/mkdirp/minimist", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "minimist@^1.2.5", - "name": "minimist", - "escapedName": "minimist", - "rawSpec": "^1.2.5", - "saveSpec": null, - "fetchSpec": "^1.2.5" - }, - "_requiredBy": [ - "/mkdirp" - ], - "_resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", - "_shasum": "67d66014b66a6a8aaa0c083c5fd58df4e4e97602", - "_spec": "minimist@^1.2.5", - "_where": "/Users/darcyclarke/Documents/Repos/npm/npm/cli/node_modules/mkdirp", - "author": { - "name": "James Halliday", - "email": "mail@substack.net", - "url": "http://substack.net" - }, - "bugs": { - "url": "https://github.com/substack/minimist/issues" - }, - "bundleDependencies": false, - "deprecated": false, - "description": "parse argument options", - "devDependencies": { - "covert": "^1.0.0", - "tap": "~0.4.0", - "tape": "^3.5.0" - }, - "homepage": "https://github.com/substack/minimist", - "keywords": [ - "argv", - "getopt", - "parser", - "optimist" - ], - "license": "MIT", - "main": "index.js", - "name": "minimist", - "repository": { - "type": "git", - "url": "git://github.com/substack/minimist.git" - }, - "scripts": { - "coverage": "covert test/*.js", - "test": "tap test/*.js" - }, - "testling": { - "files": "test/*.js", - "browsers": [ - "ie/6..latest", - "ff/5", - "firefox/latest", - "chrome/10", - "chrome/latest", - "safari/5.1", - "safari/latest", - "opera/12" - ] - }, - "version": "1.2.5" -} diff --git a/deps/npm/node_modules/mkdirp/node_modules/minimist/readme.markdown b/deps/npm/node_modules/mkdirp/node_modules/minimist/readme.markdown deleted file mode 100644 index 5fd97ab11ee9d8..00000000000000 --- a/deps/npm/node_modules/mkdirp/node_modules/minimist/readme.markdown +++ /dev/null @@ -1,95 +0,0 @@ -# minimist - -parse argument options - -This module is the guts of optimist's argument parser without all the -fanciful decoration. - -# example - -``` js -var argv = require('minimist')(process.argv.slice(2)); -console.log(argv); -``` - -``` -$ node example/parse.js -a beep -b boop -{ _: [], a: 'beep', b: 'boop' } -``` - -``` -$ node example/parse.js -x 3 -y 4 -n5 -abc --beep=boop foo bar baz -{ _: [ 'foo', 'bar', 'baz' ], - x: 3, - y: 4, - n: 5, - a: true, - b: true, - c: true, - beep: 'boop' } -``` - -# security - -Previous versions had a prototype pollution bug that could cause privilege -escalation in some circumstances when handling untrusted user input. - -Please use version 1.2.3 or later: https://snyk.io/vuln/SNYK-JS-MINIMIST-559764 - -# methods - -``` js -var parseArgs = require('minimist') -``` - -## var argv = parseArgs(args, opts={}) - -Return an argument object `argv` populated with the array arguments from `args`. - -`argv._` contains all the arguments that didn't have an option associated with -them. - -Numeric-looking arguments will be returned as numbers unless `opts.string` or -`opts.boolean` is set for that argument name. - -Any arguments after `'--'` will not be parsed and will end up in `argv._`. - -options can be: - -* `opts.string` - a string or array of strings argument names to always treat as -strings -* `opts.boolean` - a boolean, string or array of strings to always treat as -booleans. if `true` will treat all double hyphenated arguments without equal signs -as boolean (e.g. affects `--foo`, not `-f` or `--foo=bar`) -* `opts.alias` - an object mapping string names to strings or arrays of string -argument names to use as aliases -* `opts.default` - an object mapping string argument names to default values -* `opts.stopEarly` - when true, populate `argv._` with everything after the -first non-option -* `opts['--']` - when true, populate `argv._` with everything before the `--` -and `argv['--']` with everything after the `--`. Here's an example: - - ``` - > require('./')('one two three -- four five --six'.split(' '), { '--': true }) - { _: [ 'one', 'two', 'three' ], - '--': [ 'four', 'five', '--six' ] } - ``` - - Note that with `opts['--']` set, parsing for arguments still stops after the - `--`. - -* `opts.unknown` - a function which is invoked with a command line parameter not -defined in the `opts` configuration object. If the function returns `false`, the -unknown option is not added to `argv`. - -# install - -With [npm](https://npmjs.org) do: - -``` -npm install minimist -``` - -# license - -MIT diff --git a/deps/npm/node_modules/mkdirp/node_modules/minimist/test/all_bool.js b/deps/npm/node_modules/mkdirp/node_modules/minimist/test/all_bool.js deleted file mode 100644 index 25df1654bc99d9..00000000000000 --- a/deps/npm/node_modules/mkdirp/node_modules/minimist/test/all_bool.js +++ /dev/null @@ -1,32 +0,0 @@ -var parse = require('../'); -var test = require('tape'); - -test('flag boolean true (default all --args to boolean)', function (t) { - var argv = parse(['moo', '--honk', 'cow'], { - boolean: true - }); - - t.deepEqual(argv, { - honk: true, - _: ['moo', 'cow'] - }); - - t.deepEqual(typeof argv.honk, 'boolean'); - t.end(); -}); - -test('flag boolean true only affects double hyphen arguments without equals signs', function (t) { - var argv = parse(['moo', '--honk', 'cow', '-p', '55', '--tacos=good'], { - boolean: true - }); - - t.deepEqual(argv, { - honk: true, - tacos: 'good', - p: 55, - _: ['moo', 'cow'] - }); - - t.deepEqual(typeof argv.honk, 'boolean'); - t.end(); -}); diff --git a/deps/npm/node_modules/mkdirp/node_modules/minimist/test/bool.js b/deps/npm/node_modules/mkdirp/node_modules/minimist/test/bool.js deleted file mode 100644 index dc9666bc619755..00000000000000 --- a/deps/npm/node_modules/mkdirp/node_modules/minimist/test/bool.js +++ /dev/null @@ -1,178 +0,0 @@ -var parse = require('../'); -var test = require('tape'); - -test('flag boolean default false', function (t) { - var argv = parse(['moo'], { - boolean: ['t', 'verbose'], - default: { verbose: false, t: false } - }); - - t.deepEqual(argv, { - verbose: false, - t: false, - _: ['moo'] - }); - - t.deepEqual(typeof argv.verbose, 'boolean'); - t.deepEqual(typeof argv.t, 'boolean'); - t.end(); - -}); - -test('boolean groups', function (t) { - var argv = parse([ '-x', '-z', 'one', 'two', 'three' ], { - boolean: ['x','y','z'] - }); - - t.deepEqual(argv, { - x : true, - y : false, - z : true, - _ : [ 'one', 'two', 'three' ] - }); - - t.deepEqual(typeof argv.x, 'boolean'); - t.deepEqual(typeof argv.y, 'boolean'); - t.deepEqual(typeof argv.z, 'boolean'); - t.end(); -}); -test('boolean and alias with chainable api', function (t) { - var aliased = [ '-h', 'derp' ]; - var regular = [ '--herp', 'derp' ]; - var opts = { - herp: { alias: 'h', boolean: true } - }; - var aliasedArgv = parse(aliased, { - boolean: 'herp', - alias: { h: 'herp' } - }); - var propertyArgv = parse(regular, { - boolean: 'herp', - alias: { h: 'herp' } - }); - var expected = { - herp: true, - h: true, - '_': [ 'derp' ] - }; - - t.same(aliasedArgv, expected); - t.same(propertyArgv, expected); - t.end(); -}); - -test('boolean and alias with options hash', function (t) { - var aliased = [ '-h', 'derp' ]; - var regular = [ '--herp', 'derp' ]; - var opts = { - alias: { 'h': 'herp' }, - boolean: 'herp' - }; - var aliasedArgv = parse(aliased, opts); - var propertyArgv = parse(regular, opts); - var expected = { - herp: true, - h: true, - '_': [ 'derp' ] - }; - t.same(aliasedArgv, expected); - t.same(propertyArgv, expected); - t.end(); -}); - -test('boolean and alias array with options hash', function (t) { - var aliased = [ '-h', 'derp' ]; - var regular = [ '--herp', 'derp' ]; - var alt = [ '--harp', 'derp' ]; - var opts = { - alias: { 'h': ['herp', 'harp'] }, - boolean: 'h' - }; - var aliasedArgv = parse(aliased, opts); - var propertyArgv = parse(regular, opts); - var altPropertyArgv = parse(alt, opts); - var expected = { - harp: true, - herp: true, - h: true, - '_': [ 'derp' ] - }; - t.same(aliasedArgv, expected); - t.same(propertyArgv, expected); - t.same(altPropertyArgv, expected); - t.end(); -}); - -test('boolean and alias using explicit true', function (t) { - var aliased = [ '-h', 'true' ]; - var regular = [ '--herp', 'true' ]; - var opts = { - alias: { h: 'herp' }, - boolean: 'h' - }; - var aliasedArgv = parse(aliased, opts); - var propertyArgv = parse(regular, opts); - var expected = { - herp: true, - h: true, - '_': [ ] - }; - - t.same(aliasedArgv, expected); - t.same(propertyArgv, expected); - t.end(); -}); - -// regression, see https://github.com/substack/node-optimist/issues/71 -test('boolean and --x=true', function(t) { - var parsed = parse(['--boool', '--other=true'], { - boolean: 'boool' - }); - - t.same(parsed.boool, true); - t.same(parsed.other, 'true'); - - parsed = parse(['--boool', '--other=false'], { - boolean: 'boool' - }); - - t.same(parsed.boool, true); - t.same(parsed.other, 'false'); - t.end(); -}); - -test('boolean --boool=true', function (t) { - var parsed = parse(['--boool=true'], { - default: { - boool: false - }, - boolean: ['boool'] - }); - - t.same(parsed.boool, true); - t.end(); -}); - -test('boolean --boool=false', function (t) { - var parsed = parse(['--boool=false'], { - default: { - boool: true - }, - boolean: ['boool'] - }); - - t.same(parsed.boool, false); - t.end(); -}); - -test('boolean using something similar to true', function (t) { - var opts = { boolean: 'h' }; - var result = parse(['-h', 'true.txt'], opts); - var expected = { - h: true, - '_': ['true.txt'] - }; - - t.same(result, expected); - t.end(); -}); \ No newline at end of file diff --git a/deps/npm/node_modules/mkdirp/node_modules/minimist/test/dash.js b/deps/npm/node_modules/mkdirp/node_modules/minimist/test/dash.js deleted file mode 100644 index 5a4fa5be418596..00000000000000 --- a/deps/npm/node_modules/mkdirp/node_modules/minimist/test/dash.js +++ /dev/null @@ -1,31 +0,0 @@ -var parse = require('../'); -var test = require('tape'); - -test('-', function (t) { - t.plan(5); - t.deepEqual(parse([ '-n', '-' ]), { n: '-', _: [] }); - t.deepEqual(parse([ '-' ]), { _: [ '-' ] }); - t.deepEqual(parse([ '-f-' ]), { f: '-', _: [] }); - t.deepEqual( - parse([ '-b', '-' ], { boolean: 'b' }), - { b: true, _: [ '-' ] } - ); - t.deepEqual( - parse([ '-s', '-' ], { string: 's' }), - { s: '-', _: [] } - ); -}); - -test('-a -- b', function (t) { - t.plan(3); - t.deepEqual(parse([ '-a', '--', 'b' ]), { a: true, _: [ 'b' ] }); - t.deepEqual(parse([ '--a', '--', 'b' ]), { a: true, _: [ 'b' ] }); - t.deepEqual(parse([ '--a', '--', 'b' ]), { a: true, _: [ 'b' ] }); -}); - -test('move arguments after the -- into their own `--` array', function(t) { - t.plan(1); - t.deepEqual( - parse([ '--name', 'John', 'before', '--', 'after' ], { '--': true }), - { name: 'John', _: [ 'before' ], '--': [ 'after' ] }); -}); diff --git a/deps/npm/node_modules/mkdirp/node_modules/minimist/test/default_bool.js b/deps/npm/node_modules/mkdirp/node_modules/minimist/test/default_bool.js deleted file mode 100644 index 780a311270fcda..00000000000000 --- a/deps/npm/node_modules/mkdirp/node_modules/minimist/test/default_bool.js +++ /dev/null @@ -1,35 +0,0 @@ -var test = require('tape'); -var parse = require('../'); - -test('boolean default true', function (t) { - var argv = parse([], { - boolean: 'sometrue', - default: { sometrue: true } - }); - t.equal(argv.sometrue, true); - t.end(); -}); - -test('boolean default false', function (t) { - var argv = parse([], { - boolean: 'somefalse', - default: { somefalse: false } - }); - t.equal(argv.somefalse, false); - t.end(); -}); - -test('boolean default to null', function (t) { - var argv = parse([], { - boolean: 'maybe', - default: { maybe: null } - }); - t.equal(argv.maybe, null); - var argv = parse(['--maybe'], { - boolean: 'maybe', - default: { maybe: null } - }); - t.equal(argv.maybe, true); - t.end(); - -}) diff --git a/deps/npm/node_modules/mkdirp/node_modules/minimist/test/dotted.js b/deps/npm/node_modules/mkdirp/node_modules/minimist/test/dotted.js deleted file mode 100644 index d8b3e856ec795f..00000000000000 --- a/deps/npm/node_modules/mkdirp/node_modules/minimist/test/dotted.js +++ /dev/null @@ -1,22 +0,0 @@ -var parse = require('../'); -var test = require('tape'); - -test('dotted alias', function (t) { - var argv = parse(['--a.b', '22'], {default: {'a.b': 11}, alias: {'a.b': 'aa.bb'}}); - t.equal(argv.a.b, 22); - t.equal(argv.aa.bb, 22); - t.end(); -}); - -test('dotted default', function (t) { - var argv = parse('', {default: {'a.b': 11}, alias: {'a.b': 'aa.bb'}}); - t.equal(argv.a.b, 11); - t.equal(argv.aa.bb, 11); - t.end(); -}); - -test('dotted default with no alias', function (t) { - var argv = parse('', {default: {'a.b': 11}}); - t.equal(argv.a.b, 11); - t.end(); -}); diff --git a/deps/npm/node_modules/mkdirp/node_modules/minimist/test/kv_short.js b/deps/npm/node_modules/mkdirp/node_modules/minimist/test/kv_short.js deleted file mode 100644 index ae880be4661dd5..00000000000000 --- a/deps/npm/node_modules/mkdirp/node_modules/minimist/test/kv_short.js +++ /dev/null @@ -1,16 +0,0 @@ -var parse = require('../'); -var test = require('tape'); - -test('short -k=v' , function (t) { - t.plan(1); - - var argv = parse([ '-b=123' ]); - t.deepEqual(argv, { b: 123, _: [] }); -}); - -test('multi short -k=v' , function (t) { - t.plan(1); - - var argv = parse([ '-a=whatever', '-b=robots' ]); - t.deepEqual(argv, { a: 'whatever', b: 'robots', _: [] }); -}); diff --git a/deps/npm/node_modules/mkdirp/node_modules/minimist/test/long.js b/deps/npm/node_modules/mkdirp/node_modules/minimist/test/long.js deleted file mode 100644 index 5d3a1e09d3b64c..00000000000000 --- a/deps/npm/node_modules/mkdirp/node_modules/minimist/test/long.js +++ /dev/null @@ -1,31 +0,0 @@ -var test = require('tape'); -var parse = require('../'); - -test('long opts', function (t) { - t.deepEqual( - parse([ '--bool' ]), - { bool : true, _ : [] }, - 'long boolean' - ); - t.deepEqual( - parse([ '--pow', 'xixxle' ]), - { pow : 'xixxle', _ : [] }, - 'long capture sp' - ); - t.deepEqual( - parse([ '--pow=xixxle' ]), - { pow : 'xixxle', _ : [] }, - 'long capture eq' - ); - t.deepEqual( - parse([ '--host', 'localhost', '--port', '555' ]), - { host : 'localhost', port : 555, _ : [] }, - 'long captures sp' - ); - t.deepEqual( - parse([ '--host=localhost', '--port=555' ]), - { host : 'localhost', port : 555, _ : [] }, - 'long captures eq' - ); - t.end(); -}); diff --git a/deps/npm/node_modules/mkdirp/node_modules/minimist/test/num.js b/deps/npm/node_modules/mkdirp/node_modules/minimist/test/num.js deleted file mode 100644 index 2cc77f4d62ffb2..00000000000000 --- a/deps/npm/node_modules/mkdirp/node_modules/minimist/test/num.js +++ /dev/null @@ -1,36 +0,0 @@ -var parse = require('../'); -var test = require('tape'); - -test('nums', function (t) { - var argv = parse([ - '-x', '1234', - '-y', '5.67', - '-z', '1e7', - '-w', '10f', - '--hex', '0xdeadbeef', - '789' - ]); - t.deepEqual(argv, { - x : 1234, - y : 5.67, - z : 1e7, - w : '10f', - hex : 0xdeadbeef, - _ : [ 789 ] - }); - t.deepEqual(typeof argv.x, 'number'); - t.deepEqual(typeof argv.y, 'number'); - t.deepEqual(typeof argv.z, 'number'); - t.deepEqual(typeof argv.w, 'string'); - t.deepEqual(typeof argv.hex, 'number'); - t.deepEqual(typeof argv._[0], 'number'); - t.end(); -}); - -test('already a number', function (t) { - var argv = parse([ '-x', 1234, 789 ]); - t.deepEqual(argv, { x : 1234, _ : [ 789 ] }); - t.deepEqual(typeof argv.x, 'number'); - t.deepEqual(typeof argv._[0], 'number'); - t.end(); -}); diff --git a/deps/npm/node_modules/mkdirp/node_modules/minimist/test/parse.js b/deps/npm/node_modules/mkdirp/node_modules/minimist/test/parse.js deleted file mode 100644 index 58f24572c47d86..00000000000000 --- a/deps/npm/node_modules/mkdirp/node_modules/minimist/test/parse.js +++ /dev/null @@ -1,197 +0,0 @@ -var parse = require('../'); -var test = require('tape'); - -test('parse args', function (t) { - t.deepEqual( - parse([ '--no-moo' ]), - { moo : false, _ : [] }, - 'no' - ); - t.deepEqual( - parse([ '-v', 'a', '-v', 'b', '-v', 'c' ]), - { v : ['a','b','c'], _ : [] }, - 'multi' - ); - t.end(); -}); - -test('comprehensive', function (t) { - t.deepEqual( - parse([ - '--name=meowmers', 'bare', '-cats', 'woo', - '-h', 'awesome', '--multi=quux', - '--key', 'value', - '-b', '--bool', '--no-meep', '--multi=baz', - '--', '--not-a-flag', 'eek' - ]), - { - c : true, - a : true, - t : true, - s : 'woo', - h : 'awesome', - b : true, - bool : true, - key : 'value', - multi : [ 'quux', 'baz' ], - meep : false, - name : 'meowmers', - _ : [ 'bare', '--not-a-flag', 'eek' ] - } - ); - t.end(); -}); - -test('flag boolean', function (t) { - var argv = parse([ '-t', 'moo' ], { boolean: 't' }); - t.deepEqual(argv, { t : true, _ : [ 'moo' ] }); - t.deepEqual(typeof argv.t, 'boolean'); - t.end(); -}); - -test('flag boolean value', function (t) { - var argv = parse(['--verbose', 'false', 'moo', '-t', 'true'], { - boolean: [ 't', 'verbose' ], - default: { verbose: true } - }); - - t.deepEqual(argv, { - verbose: false, - t: true, - _: ['moo'] - }); - - t.deepEqual(typeof argv.verbose, 'boolean'); - t.deepEqual(typeof argv.t, 'boolean'); - t.end(); -}); - -test('newlines in params' , function (t) { - var args = parse([ '-s', "X\nX" ]) - t.deepEqual(args, { _ : [], s : "X\nX" }); - - // reproduce in bash: - // VALUE="new - // line" - // node program.js --s="$VALUE" - args = parse([ "--s=X\nX" ]) - t.deepEqual(args, { _ : [], s : "X\nX" }); - t.end(); -}); - -test('strings' , function (t) { - var s = parse([ '-s', '0001234' ], { string: 's' }).s; - t.equal(s, '0001234'); - t.equal(typeof s, 'string'); - - var x = parse([ '-x', '56' ], { string: 'x' }).x; - t.equal(x, '56'); - t.equal(typeof x, 'string'); - t.end(); -}); - -test('stringArgs', function (t) { - var s = parse([ ' ', ' ' ], { string: '_' })._; - t.same(s.length, 2); - t.same(typeof s[0], 'string'); - t.same(s[0], ' '); - t.same(typeof s[1], 'string'); - t.same(s[1], ' '); - t.end(); -}); - -test('empty strings', function(t) { - var s = parse([ '-s' ], { string: 's' }).s; - t.equal(s, ''); - t.equal(typeof s, 'string'); - - var str = parse([ '--str' ], { string: 'str' }).str; - t.equal(str, ''); - t.equal(typeof str, 'string'); - - var letters = parse([ '-art' ], { - string: [ 'a', 't' ] - }); - - t.equal(letters.a, ''); - t.equal(letters.r, true); - t.equal(letters.t, ''); - - t.end(); -}); - - -test('string and alias', function(t) { - var x = parse([ '--str', '000123' ], { - string: 's', - alias: { s: 'str' } - }); - - t.equal(x.str, '000123'); - t.equal(typeof x.str, 'string'); - t.equal(x.s, '000123'); - t.equal(typeof x.s, 'string'); - - var y = parse([ '-s', '000123' ], { - string: 'str', - alias: { str: 's' } - }); - - t.equal(y.str, '000123'); - t.equal(typeof y.str, 'string'); - t.equal(y.s, '000123'); - t.equal(typeof y.s, 'string'); - t.end(); -}); - -test('slashBreak', function (t) { - t.same( - parse([ '-I/foo/bar/baz' ]), - { I : '/foo/bar/baz', _ : [] } - ); - t.same( - parse([ '-xyz/foo/bar/baz' ]), - { x : true, y : true, z : '/foo/bar/baz', _ : [] } - ); - t.end(); -}); - -test('alias', function (t) { - var argv = parse([ '-f', '11', '--zoom', '55' ], { - alias: { z: 'zoom' } - }); - t.equal(argv.zoom, 55); - t.equal(argv.z, argv.zoom); - t.equal(argv.f, 11); - t.end(); -}); - -test('multiAlias', function (t) { - var argv = parse([ '-f', '11', '--zoom', '55' ], { - alias: { z: [ 'zm', 'zoom' ] } - }); - t.equal(argv.zoom, 55); - t.equal(argv.z, argv.zoom); - t.equal(argv.z, argv.zm); - t.equal(argv.f, 11); - t.end(); -}); - -test('nested dotted objects', function (t) { - var argv = parse([ - '--foo.bar', '3', '--foo.baz', '4', - '--foo.quux.quibble', '5', '--foo.quux.o_O', - '--beep.boop' - ]); - - t.same(argv.foo, { - bar : 3, - baz : 4, - quux : { - quibble : 5, - o_O : true - } - }); - t.same(argv.beep, { boop : true }); - t.end(); -}); diff --git a/deps/npm/node_modules/mkdirp/node_modules/minimist/test/parse_modified.js b/deps/npm/node_modules/mkdirp/node_modules/minimist/test/parse_modified.js deleted file mode 100644 index a22248532f0c6f..00000000000000 --- a/deps/npm/node_modules/mkdirp/node_modules/minimist/test/parse_modified.js +++ /dev/null @@ -1,9 +0,0 @@ -var parse = require('../'); -var test = require('tape'); - -test('parse with modifier functions' , function (t) { - t.plan(1); - - var argv = parse([ '-b', '123' ], { boolean: 'b' }); - t.deepEqual(argv, { b: true, _: [123] }); -}); diff --git a/deps/npm/node_modules/mkdirp/node_modules/minimist/test/proto.js b/deps/npm/node_modules/mkdirp/node_modules/minimist/test/proto.js deleted file mode 100644 index 8649107ecba1f0..00000000000000 --- a/deps/npm/node_modules/mkdirp/node_modules/minimist/test/proto.js +++ /dev/null @@ -1,44 +0,0 @@ -var parse = require('../'); -var test = require('tape'); - -test('proto pollution', function (t) { - var argv = parse(['--__proto__.x','123']); - t.equal({}.x, undefined); - t.equal(argv.__proto__.x, undefined); - t.equal(argv.x, undefined); - t.end(); -}); - -test('proto pollution (array)', function (t) { - var argv = parse(['--x','4','--x','5','--x.__proto__.z','789']); - t.equal({}.z, undefined); - t.deepEqual(argv.x, [4,5]); - t.equal(argv.x.z, undefined); - t.equal(argv.x.__proto__.z, undefined); - t.end(); -}); - -test('proto pollution (number)', function (t) { - var argv = parse(['--x','5','--x.__proto__.z','100']); - t.equal({}.z, undefined); - t.equal((4).z, undefined); - t.equal(argv.x, 5); - t.equal(argv.x.z, undefined); - t.end(); -}); - -test('proto pollution (string)', function (t) { - var argv = parse(['--x','abc','--x.__proto__.z','def']); - t.equal({}.z, undefined); - t.equal('...'.z, undefined); - t.equal(argv.x, 'abc'); - t.equal(argv.x.z, undefined); - t.end(); -}); - -test('proto pollution (constructor)', function (t) { - var argv = parse(['--constructor.prototype.y','123']); - t.equal({}.y, undefined); - t.equal(argv.y, undefined); - t.end(); -}); diff --git a/deps/npm/node_modules/mkdirp/node_modules/minimist/test/short.js b/deps/npm/node_modules/mkdirp/node_modules/minimist/test/short.js deleted file mode 100644 index ac18880f1eb50c..00000000000000 --- a/deps/npm/node_modules/mkdirp/node_modules/minimist/test/short.js +++ /dev/null @@ -1,67 +0,0 @@ -var parse = require('../'); -var test = require('tape'); - -test('numeric short args', function (t) { - t.plan(2); - t.deepEqual(parse([ '-n123' ]), { n: 123, _: [] }); - t.deepEqual( - parse([ '-123', '456' ]), - { 1: true, 2: true, 3: 456, _: [] } - ); -}); - -test('short', function (t) { - t.deepEqual( - parse([ '-b' ]), - { b : true, _ : [] }, - 'short boolean' - ); - t.deepEqual( - parse([ 'foo', 'bar', 'baz' ]), - { _ : [ 'foo', 'bar', 'baz' ] }, - 'bare' - ); - t.deepEqual( - parse([ '-cats' ]), - { c : true, a : true, t : true, s : true, _ : [] }, - 'group' - ); - t.deepEqual( - parse([ '-cats', 'meow' ]), - { c : true, a : true, t : true, s : 'meow', _ : [] }, - 'short group next' - ); - t.deepEqual( - parse([ '-h', 'localhost' ]), - { h : 'localhost', _ : [] }, - 'short capture' - ); - t.deepEqual( - parse([ '-h', 'localhost', '-p', '555' ]), - { h : 'localhost', p : 555, _ : [] }, - 'short captures' - ); - t.end(); -}); - -test('mixed short bool and capture', function (t) { - t.same( - parse([ '-h', 'localhost', '-fp', '555', 'script.js' ]), - { - f : true, p : 555, h : 'localhost', - _ : [ 'script.js' ] - } - ); - t.end(); -}); - -test('short and long', function (t) { - t.deepEqual( - parse([ '-h', 'localhost', '-fp', '555', 'script.js' ]), - { - f : true, p : 555, h : 'localhost', - _ : [ 'script.js' ] - } - ); - t.end(); -}); diff --git a/deps/npm/node_modules/mkdirp/node_modules/minimist/test/stop_early.js b/deps/npm/node_modules/mkdirp/node_modules/minimist/test/stop_early.js deleted file mode 100644 index bdf9fbcb0b57ab..00000000000000 --- a/deps/npm/node_modules/mkdirp/node_modules/minimist/test/stop_early.js +++ /dev/null @@ -1,15 +0,0 @@ -var parse = require('../'); -var test = require('tape'); - -test('stops parsing on the first non-option when stopEarly is set', function (t) { - var argv = parse(['--aaa', 'bbb', 'ccc', '--ddd'], { - stopEarly: true - }); - - t.deepEqual(argv, { - aaa: 'bbb', - _: ['ccc', '--ddd'] - }); - - t.end(); -}); diff --git a/deps/npm/node_modules/mkdirp/node_modules/minimist/test/unknown.js b/deps/npm/node_modules/mkdirp/node_modules/minimist/test/unknown.js deleted file mode 100644 index 462a36bdd7ec9f..00000000000000 --- a/deps/npm/node_modules/mkdirp/node_modules/minimist/test/unknown.js +++ /dev/null @@ -1,102 +0,0 @@ -var parse = require('../'); -var test = require('tape'); - -test('boolean and alias is not unknown', function (t) { - var unknown = []; - function unknownFn(arg) { - unknown.push(arg); - return false; - } - var aliased = [ '-h', 'true', '--derp', 'true' ]; - var regular = [ '--herp', 'true', '-d', 'true' ]; - var opts = { - alias: { h: 'herp' }, - boolean: 'h', - unknown: unknownFn - }; - var aliasedArgv = parse(aliased, opts); - var propertyArgv = parse(regular, opts); - - t.same(unknown, ['--derp', '-d']); - t.end(); -}); - -test('flag boolean true any double hyphen argument is not unknown', function (t) { - var unknown = []; - function unknownFn(arg) { - unknown.push(arg); - return false; - } - var argv = parse(['--honk', '--tacos=good', 'cow', '-p', '55'], { - boolean: true, - unknown: unknownFn - }); - t.same(unknown, ['--tacos=good', 'cow', '-p']); - t.same(argv, { - honk: true, - _: [] - }); - t.end(); -}); - -test('string and alias is not unknown', function (t) { - var unknown = []; - function unknownFn(arg) { - unknown.push(arg); - return false; - } - var aliased = [ '-h', 'hello', '--derp', 'goodbye' ]; - var regular = [ '--herp', 'hello', '-d', 'moon' ]; - var opts = { - alias: { h: 'herp' }, - string: 'h', - unknown: unknownFn - }; - var aliasedArgv = parse(aliased, opts); - var propertyArgv = parse(regular, opts); - - t.same(unknown, ['--derp', '-d']); - t.end(); -}); - -test('default and alias is not unknown', function (t) { - var unknown = []; - function unknownFn(arg) { - unknown.push(arg); - return false; - } - var aliased = [ '-h', 'hello' ]; - var regular = [ '--herp', 'hello' ]; - var opts = { - default: { 'h': 'bar' }, - alias: { 'h': 'herp' }, - unknown: unknownFn - }; - var aliasedArgv = parse(aliased, opts); - var propertyArgv = parse(regular, opts); - - t.same(unknown, []); - t.end(); - unknownFn(); // exercise fn for 100% coverage -}); - -test('value following -- is not unknown', function (t) { - var unknown = []; - function unknownFn(arg) { - unknown.push(arg); - return false; - } - var aliased = [ '--bad', '--', 'good', 'arg' ]; - var opts = { - '--': true, - unknown: unknownFn - }; - var argv = parse(aliased, opts); - - t.same(unknown, ['--bad']); - t.same(argv, { - '--': ['good', 'arg'], - '_': [] - }) - t.end(); -}); diff --git a/deps/npm/node_modules/mkdirp/node_modules/minimist/test/whitespace.js b/deps/npm/node_modules/mkdirp/node_modules/minimist/test/whitespace.js deleted file mode 100644 index 8a52a58cecfd7a..00000000000000 --- a/deps/npm/node_modules/mkdirp/node_modules/minimist/test/whitespace.js +++ /dev/null @@ -1,8 +0,0 @@ -var parse = require('../'); -var test = require('tape'); - -test('whitespace should be whitespace' , function (t) { - t.plan(1); - var x = parse([ '-x', '\t' ]).x; - t.equal(x, '\t'); -}); diff --git a/deps/npm/node_modules/mkdirp/package.json b/deps/npm/node_modules/mkdirp/package.json index af775065f04fae..2913ed09bddd66 100644 --- a/deps/npm/node_modules/mkdirp/package.json +++ b/deps/npm/node_modules/mkdirp/package.json @@ -1,83 +1,44 @@ { - "_from": "mkdirp@0.5.5", - "_id": "mkdirp@0.5.5", - "_inBundle": false, - "_integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==", - "_location": "/mkdirp", - "_phantomChildren": {}, - "_requested": { - "type": "version", - "registry": true, - "raw": "mkdirp@0.5.5", - "name": "mkdirp", - "escapedName": "mkdirp", - "rawSpec": "0.5.5", - "saveSpec": null, - "fetchSpec": "0.5.5" - }, - "_requiredBy": [ - "#USER", - "/", - "/cacache", - "/cmd-shim", - "/copy-concurrently", - "/eslint", - "/gentle-fs", - "/libcipm", - "/move-concurrently", - "/node-gyp", - "/pacote", - "/spawn-wrap", - "/tap", - "/tar", - "/write" - ], - "_resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz", - "_shasum": "d91cefd62d1436ca0f41620e251288d420099def", - "_spec": "mkdirp@0.5.5", - "_where": "/Users/ruyadorno/Documents/workspace/cli", - "author": { - "name": "James Halliday", - "email": "mail@substack.net", - "url": "http://substack.net" - }, - "bin": { - "mkdirp": "bin/cmd.js" - }, - "bugs": { - "url": "https://github.com/substack/node-mkdirp/issues" - }, - "bundleDependencies": false, - "dependencies": { - "minimist": "^1.2.5" - }, - "deprecated": false, + "name": "mkdirp", "description": "Recursively mkdir, like `mkdir -p`", - "devDependencies": { - "mock-fs": "^3.7.0", - "tap": "^5.4.2" - }, - "files": [ - "bin", - "index.js" - ], - "homepage": "https://github.com/substack/node-mkdirp#readme", + "version": "1.0.4", + "main": "index.js", "keywords": [ "mkdir", - "directory" + "directory", + "make dir", + "make", + "dir", + "recursive", + "native" ], - "license": "MIT", - "main": "index.js", - "name": "mkdirp", - "publishConfig": { - "tag": "legacy" - }, "repository": { "type": "git", - "url": "git+https://github.com/substack/node-mkdirp.git" + "url": "https://github.com/isaacs/node-mkdirp.git" }, "scripts": { - "test": "tap test/*.js" + "test": "tap", + "snap": "tap", + "preversion": "npm test", + "postversion": "npm publish", + "postpublish": "git push origin --follow-tags" + }, + "tap": { + "check-coverage": true, + "coverage-map": "map.js" }, - "version": "0.5.5" + "devDependencies": { + "require-inject": "^1.4.4", + "tap": "^14.10.7" + }, + "bin": "bin/cmd.js", + "license": "MIT", + "engines": { + "node": ">=10" + }, + "files": [ + "bin", + "lib", + "index.js" + ] } diff --git a/deps/npm/node_modules/move-concurrently/LICENSE b/deps/npm/node_modules/move-concurrently/LICENSE deleted file mode 100644 index 83e7c4c62903d7..00000000000000 --- a/deps/npm/node_modules/move-concurrently/LICENSE +++ /dev/null @@ -1,14 +0,0 @@ -Copyright (c) 2017, 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/move-concurrently/README.md b/deps/npm/node_modules/move-concurrently/README.md deleted file mode 100644 index 0e6e9b9ea821b1..00000000000000 --- a/deps/npm/node_modules/move-concurrently/README.md +++ /dev/null @@ -1,53 +0,0 @@ -# move-concurrently - -Move files and directories. - -``` -const move = require('move-concurrently') -move('/path/to/thing', '/new/path/thing').then(() => { - // thing is now moved! -}).catch(err => { - // oh no! -}) -``` - -Uses `rename` to move things as fast as possible. - -If you `move` across devices or on filesystems that don't support renaming -large directories. That is, situations that result in `rename` returning -the `EXDEV` error, then `move` will fallback to copy + delete. - -When recursively copying directories it will first try to rename the -contents before falling back to copying. While this will be slightly slower -in true cross-device scenarios, it is MUCH faster in cases where the -filesystem can't handle directory renames. - -When copying ownership is maintained when running as root. Permissions are -always maintained. On Windows, if symlinks are unavailable then junctions -will be used. - -## INTERFACE - -### move(from, to, options) → Promise - -Recursively moves `from` to `to` and resolves its promise when finished. -If `to` already exists then the promise will be rejected with an `EEXIST` -error. - -Starts by trying to rename `from` to `to`. - -Options are: - -* maxConcurrency – (Default: `1`) The maximum number of concurrent copies to do at once. -* isWindows - (Default: `process.platform === 'win32'`) If true enables Windows symlink semantics. This requires - an extra `stat` to determine if the destination of a symlink is a file or directory. If symlinking a directory - fails then we'll try making a junction instead. - -Options can also include dependency injection: - -* Promise - (Default: `global.Promise`) The promise implementation to use, defaults to Node's. -* fs - (Default: `require('fs')`) The filesystem module to use. Can be used - to use `graceful-fs` or to inject a mock. -* writeStreamAtomic - (Default: `require('fs-write-stream-atomic')`) The - implementation of `writeStreamAtomic` to use. Used to inject a mock. -* getuid - (Default: `process.getuid`) A function that returns the current UID. Used to inject a mock. diff --git a/deps/npm/node_modules/move-concurrently/move.js b/deps/npm/node_modules/move-concurrently/move.js deleted file mode 100644 index 6a2a7332c8efb6..00000000000000 --- a/deps/npm/node_modules/move-concurrently/move.js +++ /dev/null @@ -1,84 +0,0 @@ -'use strict' -module.exports = move - -var nodeFs = require('fs') -var rimraf = require('rimraf') -var validate = require('aproba') -var copy = require('copy-concurrently') -var RunQueue = require('run-queue') -var extend = Object.assign || require('util')._extend - -function promisify (Promise, fn) { - return function () { - var args = [].slice.call(arguments) - return new Promise(function (resolve, reject) { - return fn.apply(null, args.concat(function (err, value) { - if (err) { - reject(err) - } else { - resolve(value) - } - })) - }) - } -} - -function move (from, to, opts) { - validate('SSO|SS', arguments) - opts = extend({}, opts || {}) - - var Promise = opts.Promise || global.Promise - var fs = opts.fs || nodeFs - var rimrafAsync = promisify(Promise, rimraf) - var renameAsync = promisify(Promise, fs.rename) - - opts.top = from - - var queue = new RunQueue({ - maxConcurrency: opts.maxConcurrency, - Promise: Promise - }) - opts.queue = queue - opts.recurseWith = rename - - queue.add(0, rename, [from, to, opts]) - - return queue.run().then(function () { - return remove(from) - }, function (err) { - // if the target already exists don't clobber it - if (err.code === 'EEXIST' || err.code === 'EPERM') { - return passThroughError() - } else { - return remove(to).then(passThroughError, passThroughError) - } - function passThroughError () { - return Promise.reject(err) - } - }) - - function remove (target) { - var opts = { - unlink: fs.unlink, - chmod: fs.chmod, - stat: fs.stat, - lstat: fs.lstat, - rmdir: fs.rmdir, - readdir: fs.readdir, - glob: false - } - return rimrafAsync(target, opts) - } - - function rename (from, to, opts, done) { - return renameAsync(from, to).catch(function (err) { - if (err.code !== 'EXDEV') { - return Promise.reject(err) - } else { - return remove(to).then(function () { - return copy.item(from, to, opts) - }) - } - }) - } -} diff --git a/deps/npm/node_modules/move-concurrently/node_modules/aproba/LICENSE b/deps/npm/node_modules/move-concurrently/node_modules/aproba/LICENSE deleted file mode 100644 index f4be44d881b2d9..00000000000000 --- a/deps/npm/node_modules/move-concurrently/node_modules/aproba/LICENSE +++ /dev/null @@ -1,14 +0,0 @@ -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/move-concurrently/node_modules/aproba/README.md b/deps/npm/node_modules/move-concurrently/node_modules/aproba/README.md deleted file mode 100644 index 0bfc594c56a372..00000000000000 --- a/deps/npm/node_modules/move-concurrently/node_modules/aproba/README.md +++ /dev/null @@ -1,94 +0,0 @@ -aproba -====== - -A ridiculously light-weight function argument validator - -``` -var validate = require("aproba") - -function myfunc(a, b, c) { - // `a` must be a string, `b` a number, `c` a function - validate('SNF', arguments) // [a,b,c] is also valid -} - -myfunc('test', 23, function () {}) // ok -myfunc(123, 23, function () {}) // type error -myfunc('test', 23) // missing arg error -myfunc('test', 23, function () {}, true) // too many args error - -``` - -Valid types are: - -| type | description -| :--: | :---------- -| * | matches any type -| A | `Array.isArray` OR an `arguments` object -| S | typeof == string -| N | typeof == number -| F | typeof == function -| O | typeof == object and not type A and not type E -| B | typeof == boolean -| E | `instanceof Error` OR `null` **(special: see below)** -| Z | == `null` - -Validation failures throw one of three exception types, distinguished by a -`code` property of `EMISSINGARG`, `EINVALIDTYPE` or `ETOOMANYARGS`. - -If you pass in an invalid type then it will throw with a code of -`EUNKNOWNTYPE`. - -If an **error** argument is found and is not null then the remaining -arguments are optional. That is, if you say `ESO` then that's like using a -non-magical `E` in: `E|ESO|ZSO`. - -### But I have optional arguments?! - -You can provide more than one signature by separating them with pipes `|`. -If any signature matches the arguments then they'll be considered valid. - -So for example, say you wanted to write a signature for -`fs.createWriteStream`. The docs for it describe it thusly: - -``` -fs.createWriteStream(path[, options]) -``` - -This would be a signature of `SO|S`. That is, a string and and object, or -just a string. - -Now, if you read the full `fs` docs, you'll see that actually path can ALSO -be a buffer. And options can be a string, that is: -``` -path | -options | -``` - -To reproduce this you have to fully enumerate all of the possible -combinations and that implies a signature of `SO|SS|OO|OS|S|O`. The -awkwardness is a feature: It reminds you of the complexity you're adding to -your API when you do this sort of thing. - - -### Browser support - -This has no dependencies and should work in browsers, though you'll have -noisier stack traces. - -### Why this exists - -I wanted a very simple argument validator. It needed to do two things: - -1. Be more concise and easier to use than assertions - -2. Not encourage an infinite bikeshed of DSLs - -This is why types are specified by a single character and there's no such -thing as an optional argument. - -This is not intended to validate user data. This is specifically about -asserting the interface of your functions. - -If you need greater validation, I encourage you to write them by hand or -look elsewhere. - diff --git a/deps/npm/node_modules/move-concurrently/node_modules/aproba/index.js b/deps/npm/node_modules/move-concurrently/node_modules/aproba/index.js deleted file mode 100644 index 6f3f797c09a750..00000000000000 --- a/deps/npm/node_modules/move-concurrently/node_modules/aproba/index.js +++ /dev/null @@ -1,105 +0,0 @@ -'use strict' - -function isArguments (thingy) { - return thingy != null && typeof thingy === 'object' && thingy.hasOwnProperty('callee') -} - -var types = { - '*': {label: 'any', check: function () { return true }}, - A: {label: 'array', check: function (thingy) { return Array.isArray(thingy) || isArguments(thingy) }}, - S: {label: 'string', check: function (thingy) { return typeof thingy === 'string' }}, - N: {label: 'number', check: function (thingy) { return typeof thingy === 'number' }}, - F: {label: 'function', check: function (thingy) { return typeof thingy === 'function' }}, - O: {label: 'object', check: function (thingy) { return typeof thingy === 'object' && thingy != null && !types.A.check(thingy) && !types.E.check(thingy) }}, - B: {label: 'boolean', check: function (thingy) { return typeof thingy === 'boolean' }}, - E: {label: 'error', check: function (thingy) { return thingy instanceof Error }}, - Z: {label: 'null', check: function (thingy) { return thingy == null }} -} - -function addSchema (schema, arity) { - var group = arity[schema.length] = arity[schema.length] || [] - if (group.indexOf(schema) === -1) group.push(schema) -} - -var validate = module.exports = function (rawSchemas, args) { - if (arguments.length !== 2) throw wrongNumberOfArgs(['SA'], arguments.length) - if (!rawSchemas) throw missingRequiredArg(0, 'rawSchemas') - if (!args) throw missingRequiredArg(1, 'args') - if (!types.S.check(rawSchemas)) throw invalidType(0, ['string'], rawSchemas) - if (!types.A.check(args)) throw invalidType(1, ['array'], args) - var schemas = rawSchemas.split('|') - var arity = {} - - schemas.forEach(function (schema) { - for (var ii = 0; ii < schema.length; ++ii) { - var type = schema[ii] - if (!types[type]) throw unknownType(ii, type) - } - if (/E.*E/.test(schema)) throw moreThanOneError(schema) - addSchema(schema, arity) - if (/E/.test(schema)) { - addSchema(schema.replace(/E.*$/, 'E'), arity) - addSchema(schema.replace(/E/, 'Z'), arity) - if (schema.length === 1) addSchema('', arity) - } - }) - var matching = arity[args.length] - if (!matching) { - throw wrongNumberOfArgs(Object.keys(arity), args.length) - } - for (var ii = 0; ii < args.length; ++ii) { - var newMatching = matching.filter(function (schema) { - var type = schema[ii] - var typeCheck = types[type].check - return typeCheck(args[ii]) - }) - if (!newMatching.length) { - var labels = matching.map(function (schema) { - return types[schema[ii]].label - }).filter(function (schema) { return schema != null }) - throw invalidType(ii, labels, args[ii]) - } - matching = newMatching - } -} - -function missingRequiredArg (num) { - return newException('EMISSINGARG', 'Missing required argument #' + (num + 1)) -} - -function unknownType (num, type) { - return newException('EUNKNOWNTYPE', 'Unknown type ' + type + ' in argument #' + (num + 1)) -} - -function invalidType (num, expectedTypes, value) { - var valueType - Object.keys(types).forEach(function (typeCode) { - if (types[typeCode].check(value)) valueType = types[typeCode].label - }) - return newException('EINVALIDTYPE', 'Argument #' + (num + 1) + ': Expected ' + - englishList(expectedTypes) + ' but got ' + valueType) -} - -function englishList (list) { - return list.join(', ').replace(/, ([^,]+)$/, ' or $1') -} - -function wrongNumberOfArgs (expected, got) { - var english = englishList(expected) - var args = expected.every(function (ex) { return ex.length === 1 }) - ? 'argument' - : 'arguments' - return newException('EWRONGARGCOUNT', 'Expected ' + english + ' ' + args + ' but got ' + got) -} - -function moreThanOneError (schema) { - return newException('ETOOMANYERRORTYPES', - 'Only one error type per argument signature is allowed, more than one found in "' + schema + '"') -} - -function newException (code, msg) { - var e = new Error(msg) - e.code = code - if (Error.captureStackTrace) Error.captureStackTrace(e, validate) - return e -} diff --git a/deps/npm/node_modules/move-concurrently/node_modules/aproba/package.json b/deps/npm/node_modules/move-concurrently/node_modules/aproba/package.json deleted file mode 100644 index eba0d3e6ea8f57..00000000000000 --- a/deps/npm/node_modules/move-concurrently/node_modules/aproba/package.json +++ /dev/null @@ -1,62 +0,0 @@ -{ - "_from": "aproba@^1.1.1", - "_id": "aproba@1.2.0", - "_inBundle": false, - "_integrity": "sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw==", - "_location": "/move-concurrently/aproba", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "aproba@^1.1.1", - "name": "aproba", - "escapedName": "aproba", - "rawSpec": "^1.1.1", - "saveSpec": null, - "fetchSpec": "^1.1.1" - }, - "_requiredBy": [ - "/move-concurrently" - ], - "_resolved": "https://registry.npmjs.org/aproba/-/aproba-1.2.0.tgz", - "_shasum": "6802e6264efd18c790a1b0d517f0f2627bf2c94a", - "_spec": "aproba@^1.1.1", - "_where": "/Users/aeschright/code/cli/node_modules/move-concurrently", - "author": { - "name": "Rebecca Turner", - "email": "me@re-becca.org" - }, - "bugs": { - "url": "https://github.com/iarna/aproba/issues" - }, - "bundleDependencies": false, - "dependencies": {}, - "deprecated": false, - "description": "A ridiculously light-weight argument validator (now browser friendly)", - "devDependencies": { - "standard": "^10.0.3", - "tap": "^10.0.2" - }, - "directories": { - "test": "test" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/iarna/aproba", - "keywords": [ - "argument", - "validate" - ], - "license": "ISC", - "main": "index.js", - "name": "aproba", - "repository": { - "type": "git", - "url": "git+https://github.com/iarna/aproba.git" - }, - "scripts": { - "test": "standard && tap -j3 test/*.js" - }, - "version": "1.2.0" -} diff --git a/deps/npm/node_modules/move-concurrently/package.json b/deps/npm/node_modules/move-concurrently/package.json deleted file mode 100644 index 52595211cd6b02..00000000000000 --- a/deps/npm/node_modules/move-concurrently/package.json +++ /dev/null @@ -1,77 +0,0 @@ -{ - "_args": [ - [ - "move-concurrently@1.0.1", - "/Users/rebecca/code/npm" - ] - ], - "_from": "move-concurrently@1.0.1", - "_id": "move-concurrently@1.0.1", - "_inBundle": false, - "_integrity": "sha1-viwAX9oy4LKa8fBdfEszIUxwH5I=", - "_location": "/move-concurrently", - "_phantomChildren": {}, - "_requested": { - "type": "version", - "registry": true, - "raw": "move-concurrently@1.0.1", - "name": "move-concurrently", - "escapedName": "move-concurrently", - "rawSpec": "1.0.1", - "saveSpec": null, - "fetchSpec": "1.0.1" - }, - "_requiredBy": [ - "/", - "/cacache", - "/npm-profile/cacache", - "/npm-registry-fetch/cacache" - ], - "_resolved": "https://registry.npmjs.org/move-concurrently/-/move-concurrently-1.0.1.tgz", - "_spec": "1.0.1", - "_where": "/Users/rebecca/code/npm", - "author": { - "name": "Rebecca Turner", - "email": "me@re-becca.org", - "url": "http://re-becca.org/" - }, - "bugs": { - "url": "https://github.com/npm/move-concurrently/issues" - }, - "dependencies": { - "aproba": "^1.1.1", - "copy-concurrently": "^1.0.0", - "fs-write-stream-atomic": "^1.0.8", - "mkdirp": "^0.5.1", - "rimraf": "^2.5.4", - "run-queue": "^1.0.3" - }, - "description": "Promises of moves of files or directories with rename, falling back to recursive rename/copy on EXDEV errors, with configurable concurrency and win32 junction support.", - "devDependencies": { - "standard": "^8.6.0", - "tacks": "^1.2.6", - "tap": "^10.1.1" - }, - "directories": { - "test": "test" - }, - "files": [ - "move.js", - "is-windows.js" - ], - "homepage": "https://www.npmjs.com/package/move-concurrently", - "keywords": [ - "move" - ], - "license": "ISC", - "main": "move.js", - "name": "move-concurrently", - "repository": { - "type": "git", - "url": "git+https://github.com/npm/move-concurrently.git" - }, - "scripts": { - "test": "standard && tap --coverage test" - }, - "version": "1.0.1" -} diff --git a/deps/npm/node_modules/ms/index.js b/deps/npm/node_modules/ms/index.js index 72297501f9b9bb..c4498bcc212589 100644 --- a/deps/npm/node_modules/ms/index.js +++ b/deps/npm/node_modules/ms/index.js @@ -28,7 +28,7 @@ module.exports = function(val, options) { var type = typeof val; if (type === 'string' && val.length > 0) { return parse(val); - } else if (type === 'number' && isNaN(val) === false) { + } else if (type === 'number' && isFinite(val)) { return options.long ? fmtLong(val) : fmtShort(val); } throw new Error( @@ -50,7 +50,7 @@ function parse(str) { if (str.length > 100) { return; } - var match = /^((?:\d+)?\-?\d?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec( + var match = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec( str ); if (!match) { diff --git a/deps/npm/node_modules/ms/package.json b/deps/npm/node_modules/ms/package.json index 9a4424a8b2d8e1..eea666e1fb03d6 100644 --- a/deps/npm/node_modules/ms/package.json +++ b/deps/npm/node_modules/ms/package.json @@ -1,39 +1,16 @@ { - "_from": "ms@^2.0.0", - "_id": "ms@2.1.1", - "_inBundle": false, - "_integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==", - "_location": "/ms", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "ms@^2.0.0", - "name": "ms", - "escapedName": "ms", - "rawSpec": "^2.0.0", - "saveSpec": null, - "fetchSpec": "^2.0.0" - }, - "_requiredBy": [ - "/humanize-ms" - ], - "_resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", - "_shasum": "30a5864eb3ebb0a66f2ebe6d727af06a09d86e0a", - "_spec": "ms@^2.0.0", - "_where": "/Users/rebecca/code/npm/node_modules/humanize-ms", - "bugs": { - "url": "https://github.com/zeit/ms/issues" - }, - "bundleDependencies": false, - "deprecated": false, + "name": "ms", + "version": "2.1.2", "description": "Tiny millisecond conversion utility", - "devDependencies": { - "eslint": "4.12.1", - "expect.js": "0.3.1", - "husky": "0.14.3", - "lint-staged": "5.0.0", - "mocha": "4.0.1" + "repository": "zeit/ms", + "main": "./index", + "files": [ + "index.js" + ], + "scripts": { + "precommit": "lint-staged", + "lint": "eslint lib/* bin/*", + "test": "mocha tests.js" }, "eslintConfig": { "extends": "eslint:recommended", @@ -42,11 +19,6 @@ "es6": true } }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/zeit/ms#readme", - "license": "MIT", "lint-staged": { "*.js": [ "npm run lint", @@ -54,16 +26,12 @@ "git add" ] }, - "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.1" + "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" + } } diff --git a/deps/npm/node_modules/ms/readme.md b/deps/npm/node_modules/ms/readme.md index bb767293ac740d..9a1996b17e0de6 100644 --- a/deps/npm/node_modules/ms/readme.md +++ b/deps/npm/node_modules/ms/readme.md @@ -1,7 +1,7 @@ # ms [![Build Status](https://travis-ci.org/zeit/ms.svg?branch=master)](https://travis-ci.org/zeit/ms) -[![Slack Channel](http://zeit-slackin.now.sh/badge.svg)](https://zeit.chat/) +[![Join the community on Spectrum](https://withspectrum.github.io/badge/badge.svg)](https://spectrum.chat/zeit) Use this package to easily convert various time formats to milliseconds. diff --git a/deps/npm/node_modules/mute-stream/.travis.yml b/deps/npm/node_modules/mute-stream/.travis.yml deleted file mode 100644 index 99f2bbf5068a8c..00000000000000 --- a/deps/npm/node_modules/mute-stream/.travis.yml +++ /dev/null @@ -1,9 +0,0 @@ -language: node_js -language: node_js -node_js: - - '0.8' - - '0.10' - - '0.12' - - 'iojs' -before_install: - - npm install -g npm@latest diff --git a/deps/npm/node_modules/mute-stream/coverage/lcov-report/__root__/index.html b/deps/npm/node_modules/mute-stream/coverage/lcov-report/__root__/index.html deleted file mode 100644 index de0934d61f01a0..00000000000000 --- a/deps/npm/node_modules/mute-stream/coverage/lcov-report/__root__/index.html +++ /dev/null @@ -1,93 +0,0 @@ - - - - Code coverage report for __root__/ - - - - - - - -
    -
    -

    - all files __root__/ -

    -
    -
    - 77.03% - Statements - 57/74 -
    -
    - 57.14% - Branches - 28/49 -
    -
    - 93.33% - Functions - 14/15 -
    -
    - 79.1% - Lines - 53/67 -
    -
    -
    -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    FileStatementsBranchesFunctionsLines
    mute.js
    77.03%57/7457.14%28/4993.33%14/1579.1%53/67
    -
    -
    - - - - - - - diff --git a/deps/npm/node_modules/mute-stream/coverage/lcov-report/__root__/mute.js.html b/deps/npm/node_modules/mute-stream/coverage/lcov-report/__root__/mute.js.html deleted file mode 100644 index 375a83265228e9..00000000000000 --- a/deps/npm/node_modules/mute-stream/coverage/lcov-report/__root__/mute.js.html +++ /dev/null @@ -1,500 +0,0 @@ - - - - Code coverage report for mute.js - - - - - - - -
    -
    -

    - all files / __root__/ mute.js -

    -
    -
    - 77.03% - Statements - 57/74 -
    -
    - 57.14% - Branches - 28/49 -
    -
    - 93.33% - Functions - 14/15 -
    -
    - 79.1% - Lines - 53/67 -
    -
    -
    -
    -
    
    -
    -
    1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102 -103 -104 -105 -106 -107 -108 -109 -110 -111 -112 -113 -114 -115 -116 -117 -118 -119 -120 -121 -122 -123 -124 -125 -126 -127 -128 -129 -130 -131 -132 -133 -134 -135 -136 -137 -138 -139 -140 -141 -142 -143 -144 -145 -146 -  - -  -  -  - - - - - - - -  -  -  -  - - -  -  - -  - -  -  -  -  - -10× -  -  - - -  -  - -  -  -  -  -  -  - - -  -  - -  -  -  -  -  -  - - -  -  -  -  -  -  - - -  -  -  -  -  -  -  - -  - -  -  -  -  - -  - -  -  -  -  -  - - - -  -  - - -  -  - - -  -  - -25× -13× - -  -  -  -  -  -  -  -  - -  -  -  -  -  - -  -  -20× -  -  - - - -  -  - -  -  - - -  -  - -  -  -  -  -  -  - - - - 
    var Stream = require('stream')
    - 
    -module.exports = MuteStream
    - 
    -// var out = new MuteStream(process.stdout)
    -// argument auto-pipes
    -function MuteStream (opts) {
    -  Stream.apply(this)
    -  opts = opts || {}
    -  this.writable = this.readable = true
    -  this.muted = false
    -  this.on('pipe', this._onpipe)
    -  this.replace = opts.replace
    - 
    -  // For readline-type situations
    -  // This much at the start of a line being redrawn after a ctrl char
    -  // is seen (such as backspace) won't be redrawn as the replacement
    -  this._prompt = opts.prompt || null
    -  this._hadControl = false
    -}
    - 
    -MuteStream.prototype = Object.create(Stream.prototype)
    - 
    -Object.defineProperty(MuteStream.prototype, 'constructor', {
    -  value: MuteStream,
    -  enumerable: false
    -})
    - 
    -MuteStream.prototype.mute = function () {
    -  this.muted = true
    -}
    - 
    -MuteStream.prototype.unmute = function () {
    -  this.muted = false
    -}
    - 
    -Object.defineProperty(MuteStream.prototype, '_onpipe', {
    -  value: onPipe,
    -  enumerable: false,
    -  writable: true,
    -  configurable: true
    -})
    - 
    -function onPipe (src) {
    -  this._src = src
    -}
    - 
    -Object.defineProperty(MuteStream.prototype, 'isTTY', {
    -  get: getIsTTY,
    -  set: setIsTTY,
    -  enumerable: true,
    -  configurable: true
    -})
    - 
    -function getIsTTY () {
    -  return( (this._dest) ? this._dest.isTTY
    -        : (this._src) ? this._src.isTTY
    -        : false
    -        )
    -}
    - 
    -// basically just get replace the getter/setter with a regular value
    -function setIsTTY (isTTY) {
    -  Object.defineProperty(this, 'isTTY', {
    -    value: isTTY,
    -    enumerable: true,
    -    writable: true,
    -    configurable: true
    -  })
    -}
    - 
    -Object.defineProperty(MuteStream.prototype, 'rows', {
    -  get: function () {
    -    return( this._dest ? this._dest.rows
    -          : this._src ? this._src.rows
    -          : undefined )
    -  }, enumerable: true, configurable: true })
    - 
    -Object.defineProperty(MuteStream.prototype, 'columns', {
    -  get: function () {
    -    return( this._dest ? this._dest.columns
    -          : this._src ? this._src.columns
    -          : undefined )
    -  }, enumerable: true, configurable: true })
    - 
    - 
    -MuteStream.prototype.pipe = function (dest, options) {
    -  this._dest = dest
    -  return Stream.prototype.pipe.call(this, dest, options)
    -}
    - 
    -MuteStream.prototype.pause = function () {
    -  Eif (this._src) return this._src.pause()
    -}
    - 
    -MuteStream.prototype.resume = function () {
    -  Eif (this._src) return this._src.resume()
    -}
    - 
    -MuteStream.prototype.write = function (c) {
    -  if (this.muted) {
    -    if (!this.replace) return true
    -    Iif (c.match(/^\u001b/)) {
    -      if(c.indexOf(this._prompt) === 0) {
    -        c = c.substr(this._prompt.length);
    -        c = c.replace(/./g, this.replace);
    -        c = this._prompt + c;
    -      }
    -      this._hadControl = true
    -      return this.emit('data', c)
    -    } else {
    -      Iif (this._prompt && this._hadControl &&
    -          c.indexOf(this._prompt) === 0) {
    -        this._hadControl = false
    -        this.emit('data', this._prompt)
    -        c = c.substr(this._prompt.length)
    -      }
    -      c = c.toString().replace(/./g, this.replace)
    -    }
    -  }
    -  this.emit('data', c)
    -}
    - 
    -MuteStream.prototype.end = function (c) {
    -  Eif (this.muted) {
    -    Iif (c && this.replace) {
    -      c = c.toString().replace(/./g, this.replace)
    -    } else {
    -      c = null
    -    }
    -  }
    -  Iif (c) this.emit('data', c)
    -  this.emit('end')
    -}
    - 
    -function proxy (fn) { return function () {
    -  var d = this._dest
    -  var s = this._src
    -  if (d && d[fn]) d[fn].apply(d, arguments)
    -  if (s && s[fn]) s[fn].apply(s, arguments)
    -}}
    - 
    -MuteStream.prototype.destroy = proxy('destroy')
    -MuteStream.prototype.destroySoon = proxy('destroySoon')
    -MuteStream.prototype.close = proxy('close')
    - 
    -
    -
    - - - - - - - diff --git a/deps/npm/node_modules/mute-stream/coverage/lcov-report/base.css b/deps/npm/node_modules/mute-stream/coverage/lcov-report/base.css deleted file mode 100644 index 0c0571dad9ffc9..00000000000000 --- a/deps/npm/node_modules/mute-stream/coverage/lcov-report/base.css +++ /dev/null @@ -1,212 +0,0 @@ -body, html { - margin:0; padding: 0; - height: 100%; -} -body { - font-family: Helvetica Neue, Helvetica, Arial; - font-size: 14px; - color:#333; -} -.small { font-size: 12px;; } -*, *:after, *:before { - -webkit-box-sizing:border-box; - -moz-box-sizing:border-box; - box-sizing:border-box; - } -h1 { font-size: 20px; margin: 0;} -h2 { font-size: 14px; } -pre { - font: 12px/1.4 Consolas, "Liberation Mono", Menlo, Courier, monospace; - margin: 0; - padding: 0; - -moz-tab-size: 2; - -o-tab-size: 2; - tab-size: 2; -} -a { color:#0074D9; text-decoration:none; } -a:hover { text-decoration:underline; } -.strong { font-weight: bold; } -.space-top1 { padding: 10px 0 0 0; } -.pad2y { padding: 20px 0; } -.pad1y { padding: 10px 0; } -.pad2x { padding: 0 20px; } -.pad2 { padding: 20px; } -.pad1 { padding: 10px; } -.space-left2 { padding-left:55px; } -.space-right2 { padding-right:20px; } -.center { text-align:center; } -.clearfix { display:block; } -.clearfix:after { - content:''; - display:block; - height:0; - clear:both; - visibility:hidden; - } -.fl { float: left; } -@media only screen and (max-width:640px) { - .col3 { width:100%; max-width:100%; } - .hide-mobile { display:none!important; } -} - -.quiet { - color: #7f7f7f; - color: rgba(0,0,0,0.5); -} -.quiet a { opacity: 0.7; } - -.fraction { - font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; - font-size: 10px; - color: #555; - background: #E8E8E8; - padding: 4px 5px; - border-radius: 3px; - vertical-align: middle; -} - -div.path a:link, div.path a:visited { color: #333; } -table.coverage { - border-collapse: collapse; - margin: 10px 0 0 0; - padding: 0; -} - -table.coverage td { - margin: 0; - padding: 0; - vertical-align: top; -} -table.coverage td.line-count { - text-align: right; - padding: 0 5px 0 20px; -} -table.coverage td.line-coverage { - text-align: right; - padding-right: 10px; - min-width:20px; -} - -table.coverage td span.cline-any { - display: inline-block; - padding: 0 5px; - width: 100%; -} -.missing-if-branch { - display: inline-block; - margin-right: 5px; - border-radius: 3px; - position: relative; - padding: 0 4px; - background: #333; - color: yellow; -} - -.skip-if-branch { - display: none; - margin-right: 10px; - position: relative; - padding: 0 4px; - background: #ccc; - color: white; -} -.missing-if-branch .typ, .skip-if-branch .typ { - color: inherit !important; -} -.coverage-summary { - border-collapse: collapse; - width: 100%; -} -.coverage-summary tr { border-bottom: 1px solid #bbb; } -.keyline-all { border: 1px solid #ddd; } -.coverage-summary td, .coverage-summary th { padding: 10px; } -.coverage-summary tbody { border: 1px solid #bbb; } -.coverage-summary td { border-right: 1px solid #bbb; } -.coverage-summary td:last-child { border-right: none; } -.coverage-summary th { - text-align: left; - font-weight: normal; - white-space: nowrap; -} -.coverage-summary th.file { border-right: none !important; } -.coverage-summary th.pct { } -.coverage-summary th.pic, -.coverage-summary th.abs, -.coverage-summary td.pct, -.coverage-summary td.abs { text-align: right; } -.coverage-summary td.file { white-space: nowrap; } -.coverage-summary td.pic { min-width: 120px !important; } -.coverage-summary tfoot td { } - -.coverage-summary .sorter { - height: 10px; - width: 7px; - display: inline-block; - margin-left: 0.5em; - background: url(sort-arrow-sprite.png) no-repeat scroll 0 0 transparent; -} -.coverage-summary .sorted .sorter { - background-position: 0 -20px; -} -.coverage-summary .sorted-desc .sorter { - background-position: 0 -10px; -} -.status-line { height: 10px; } -/* dark red */ -.red.solid, .status-line.low, .low .cover-fill { background:#C21F39 } -.low .chart { border:1px solid #C21F39 } -/* medium red */ -.cstat-no, .fstat-no, .cbranch-no, .cbranch-no { background:#F6C6CE } -/* light red */ -.low, .cline-no { background:#FCE1E5 } -/* light green */ -.high, .cline-yes { background:rgb(230,245,208) } -/* medium green */ -.cstat-yes { background:rgb(161,215,106) } -/* dark green */ -.status-line.high, .high .cover-fill { background:rgb(77,146,33) } -.high .chart { border:1px solid rgb(77,146,33) } - - -.medium .chart { border:1px solid #666; } -.medium .cover-fill { background: #666; } - -.cbranch-no { background: yellow !important; color: #111; } - -.cstat-skip { background: #ddd; color: #111; } -.fstat-skip { background: #ddd; color: #111 !important; } -.cbranch-skip { background: #ddd !important; color: #111; } - -span.cline-neutral { background: #eaeaea; } -.medium { background: #eaeaea; } - -.cover-fill, .cover-empty { - display:inline-block; - height: 12px; -} -.chart { - line-height: 0; -} -.cover-empty { - background: white; -} -.cover-full { - border-right: none !important; -} -pre.prettyprint { - border: none !important; - padding: 0 !important; - margin: 0 !important; -} -.com { color: #999 !important; } -.ignore-none { color: #999; font-weight: normal; } - -.wrapper { - min-height: 100%; - height: auto !important; - height: 100%; - margin: 0 auto -48px; -} -.footer, .push { - height: 48px; -} diff --git a/deps/npm/node_modules/mute-stream/coverage/lcov-report/index.html b/deps/npm/node_modules/mute-stream/coverage/lcov-report/index.html deleted file mode 100644 index 17d7a760e804bd..00000000000000 --- a/deps/npm/node_modules/mute-stream/coverage/lcov-report/index.html +++ /dev/null @@ -1,93 +0,0 @@ - - - - Code coverage report for All files - - - - - - - -
    -
    -

    - / -

    -
    -
    - 77.03% - Statements - 57/74 -
    -
    - 57.14% - Branches - 28/49 -
    -
    - 93.33% - Functions - 14/15 -
    -
    - 79.1% - Lines - 53/67 -
    -
    -
    -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    FileStatementsBranchesFunctionsLines
    __root__/
    77.03%57/7457.14%28/4993.33%14/1579.1%53/67
    -
    -
    - - - - - - - diff --git a/deps/npm/node_modules/mute-stream/coverage/lcov-report/prettify.css b/deps/npm/node_modules/mute-stream/coverage/lcov-report/prettify.css deleted file mode 100644 index b317a7cda31a44..00000000000000 --- a/deps/npm/node_modules/mute-stream/coverage/lcov-report/prettify.css +++ /dev/null @@ -1 +0,0 @@ -.pln{color:#000}@media screen{.str{color:#080}.kwd{color:#008}.com{color:#800}.typ{color:#606}.lit{color:#066}.pun,.opn,.clo{color:#660}.tag{color:#008}.atn{color:#606}.atv{color:#080}.dec,.var{color:#606}.fun{color:red}}@media print,projection{.str{color:#060}.kwd{color:#006;font-weight:bold}.com{color:#600;font-style:italic}.typ{color:#404;font-weight:bold}.lit{color:#044}.pun,.opn,.clo{color:#440}.tag{color:#006;font-weight:bold}.atn{color:#404}.atv{color:#060}}pre.prettyprint{padding:2px;border:1px solid #888}ol.linenums{margin-top:0;margin-bottom:0}li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8{list-style-type:none}li.L1,li.L3,li.L5,li.L7,li.L9{background:#eee} diff --git a/deps/npm/node_modules/mute-stream/coverage/lcov-report/prettify.js b/deps/npm/node_modules/mute-stream/coverage/lcov-report/prettify.js deleted file mode 100644 index ef51e03866898f..00000000000000 --- a/deps/npm/node_modules/mute-stream/coverage/lcov-report/prettify.js +++ /dev/null @@ -1 +0,0 @@ -window.PR_SHOULD_USE_CONTINUATION=true;(function(){var h=["break,continue,do,else,for,if,return,while"];var u=[h,"auto,case,char,const,default,double,enum,extern,float,goto,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"];var p=[u,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"];var l=[p,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,dynamic_cast,explicit,export,friend,inline,late_check,mutable,namespace,nullptr,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"];var x=[p,"abstract,boolean,byte,extends,final,finally,implements,import,instanceof,null,native,package,strictfp,super,synchronized,throws,transient"];var R=[x,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,interface,internal,into,is,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var"];var r="all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,true,try,unless,until,when,while,yes";var w=[p,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"];var s="caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END";var I=[h,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"];var f=[h,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"];var H=[h,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"];var A=[l,R,w,s+I,f,H];var e=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)/;var C="str";var z="kwd";var j="com";var O="typ";var G="lit";var L="pun";var F="pln";var m="tag";var E="dec";var J="src";var P="atn";var n="atv";var N="nocode";var M="(?:^^\\.?|[+-]|\\!|\\!=|\\!==|\\#|\\%|\\%=|&|&&|&&=|&=|\\(|\\*|\\*=|\\+=|\\,|\\-=|\\->|\\/|\\/=|:|::|\\;|<|<<|<<=|<=|=|==|===|>|>=|>>|>>=|>>>|>>>=|\\?|\\@|\\[|\\^|\\^=|\\^\\^|\\^\\^=|\\{|\\||\\|=|\\|\\||\\|\\|=|\\~|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function k(Z){var ad=0;var S=false;var ac=false;for(var V=0,U=Z.length;V122)){if(!(al<65||ag>90)){af.push([Math.max(65,ag)|32,Math.min(al,90)|32])}if(!(al<97||ag>122)){af.push([Math.max(97,ag)&~32,Math.min(al,122)&~32])}}}}af.sort(function(av,au){return(av[0]-au[0])||(au[1]-av[1])});var ai=[];var ap=[NaN,NaN];for(var ar=0;arat[0]){if(at[1]+1>at[0]){an.push("-")}an.push(T(at[1]))}}an.push("]");return an.join("")}function W(al){var aj=al.source.match(new RegExp("(?:\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]|\\\\u[A-Fa-f0-9]{4}|\\\\x[A-Fa-f0-9]{2}|\\\\[0-9]+|\\\\[^ux0-9]|\\(\\?[:!=]|[\\(\\)\\^]|[^\\x5B\\x5C\\(\\)\\^]+)","g"));var ah=aj.length;var an=[];for(var ak=0,am=0;ak=2&&ai==="["){aj[ak]=X(ag)}else{if(ai!=="\\"){aj[ak]=ag.replace(/[a-zA-Z]/g,function(ao){var ap=ao.charCodeAt(0);return"["+String.fromCharCode(ap&~32,ap|32)+"]"})}}}}return aj.join("")}var aa=[];for(var V=0,U=Z.length;V=0;){S[ac.charAt(ae)]=Y}}var af=Y[1];var aa=""+af;if(!ag.hasOwnProperty(aa)){ah.push(af);ag[aa]=null}}ah.push(/[\0-\uffff]/);V=k(ah)})();var X=T.length;var W=function(ah){var Z=ah.sourceCode,Y=ah.basePos;var ad=[Y,F];var af=0;var an=Z.match(V)||[];var aj={};for(var ae=0,aq=an.length;ae=5&&"lang-"===ap.substring(0,5);if(am&&!(ai&&typeof ai[1]==="string")){am=false;ap=J}if(!am){aj[ag]=ap}}var ab=af;af+=ag.length;if(!am){ad.push(Y+ab,ap)}else{var al=ai[1];var ak=ag.indexOf(al);var ac=ak+al.length;if(ai[2]){ac=ag.length-ai[2].length;ak=ac-al.length}var ar=ap.substring(5);B(Y+ab,ag.substring(0,ak),W,ad);B(Y+ab+ak,al,q(ar,al),ad);B(Y+ab+ac,ag.substring(ac),W,ad)}}ah.decorations=ad};return W}function i(T){var W=[],S=[];if(T.tripleQuotedStrings){W.push([C,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,"'\""])}else{if(T.multiLineStrings){W.push([C,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"])}else{W.push([C,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,"\"'"])}}if(T.verbatimStrings){S.push([C,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null])}var Y=T.hashComments;if(Y){if(T.cStyleComments){if(Y>1){W.push([j,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"])}else{W.push([j,/^#(?:(?:define|elif|else|endif|error|ifdef|include|ifndef|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"])}S.push([C,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h|[a-z]\w*)>/,null])}else{W.push([j,/^#[^\r\n]*/,null,"#"])}}if(T.cStyleComments){S.push([j,/^\/\/[^\r\n]*/,null]);S.push([j,/^\/\*[\s\S]*?(?:\*\/|$)/,null])}if(T.regexLiterals){var X=("/(?=[^/*])(?:[^/\\x5B\\x5C]|\\x5C[\\s\\S]|\\x5B(?:[^\\x5C\\x5D]|\\x5C[\\s\\S])*(?:\\x5D|$))+/");S.push(["lang-regex",new RegExp("^"+M+"("+X+")")])}var V=T.types;if(V){S.push([O,V])}var U=(""+T.keywords).replace(/^ | $/g,"");if(U.length){S.push([z,new RegExp("^(?:"+U.replace(/[\s,]+/g,"|")+")\\b"),null])}W.push([F,/^\s+/,null," \r\n\t\xA0"]);S.push([G,/^@[a-z_$][a-z_$@0-9]*/i,null],[O,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[F,/^[a-z_$][a-z_$@0-9]*/i,null],[G,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[F,/^\\[\s\S]?/,null],[L,/^.[^\s\w\.$@\'\"\`\/\#\\]*/,null]);return g(W,S)}var K=i({keywords:A,hashComments:true,cStyleComments:true,multiLineStrings:true,regexLiterals:true});function Q(V,ag){var U=/(?:^|\s)nocode(?:\s|$)/;var ab=/\r\n?|\n/;var ac=V.ownerDocument;var S;if(V.currentStyle){S=V.currentStyle.whiteSpace}else{if(window.getComputedStyle){S=ac.defaultView.getComputedStyle(V,null).getPropertyValue("white-space")}}var Z=S&&"pre"===S.substring(0,3);var af=ac.createElement("LI");while(V.firstChild){af.appendChild(V.firstChild)}var W=[af];function ae(al){switch(al.nodeType){case 1:if(U.test(al.className)){break}if("BR"===al.nodeName){ad(al);if(al.parentNode){al.parentNode.removeChild(al)}}else{for(var an=al.firstChild;an;an=an.nextSibling){ae(an)}}break;case 3:case 4:if(Z){var am=al.nodeValue;var aj=am.match(ab);if(aj){var ai=am.substring(0,aj.index);al.nodeValue=ai;var ah=am.substring(aj.index+aj[0].length);if(ah){var ak=al.parentNode;ak.insertBefore(ac.createTextNode(ah),al.nextSibling)}ad(al);if(!ai){al.parentNode.removeChild(al)}}}break}}function ad(ak){while(!ak.nextSibling){ak=ak.parentNode;if(!ak){return}}function ai(al,ar){var aq=ar?al.cloneNode(false):al;var ao=al.parentNode;if(ao){var ap=ai(ao,1);var an=al.nextSibling;ap.appendChild(aq);for(var am=an;am;am=an){an=am.nextSibling;ap.appendChild(am)}}return aq}var ah=ai(ak.nextSibling,0);for(var aj;(aj=ah.parentNode)&&aj.nodeType===1;){ah=aj}W.push(ah)}for(var Y=0;Y=S){ah+=2}if(V>=ap){Z+=2}}}var t={};function c(U,V){for(var S=V.length;--S>=0;){var T=V[S];if(!t.hasOwnProperty(T)){t[T]=U}else{if(window.console){console.warn("cannot override language handler %s",T)}}}}function q(T,S){if(!(T&&t.hasOwnProperty(T))){T=/^\s*]*(?:>|$)/],[j,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[L,/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]);c(g([[F,/^[\s]+/,null," \t\r\n"],[n,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,"\"'"]],[[m,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[P,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[L,/^[=<>\/]+/],["lang-js",/^on\w+\s*=\s*\"([^\"]+)\"/i],["lang-js",/^on\w+\s*=\s*\'([^\']+)\'/i],["lang-js",/^on\w+\s*=\s*([^\"\'>\s]+)/i],["lang-css",/^style\s*=\s*\"([^\"]+)\"/i],["lang-css",/^style\s*=\s*\'([^\']+)\'/i],["lang-css",/^style\s*=\s*([^\"\'>\s]+)/i]]),["in.tag"]);c(g([],[[n,/^[\s\S]+/]]),["uq.val"]);c(i({keywords:l,hashComments:true,cStyleComments:true,types:e}),["c","cc","cpp","cxx","cyc","m"]);c(i({keywords:"null,true,false"}),["json"]);c(i({keywords:R,hashComments:true,cStyleComments:true,verbatimStrings:true,types:e}),["cs"]);c(i({keywords:x,cStyleComments:true}),["java"]);c(i({keywords:H,hashComments:true,multiLineStrings:true}),["bsh","csh","sh"]);c(i({keywords:I,hashComments:true,multiLineStrings:true,tripleQuotedStrings:true}),["cv","py"]);c(i({keywords:s,hashComments:true,multiLineStrings:true,regexLiterals:true}),["perl","pl","pm"]);c(i({keywords:f,hashComments:true,multiLineStrings:true,regexLiterals:true}),["rb"]);c(i({keywords:w,cStyleComments:true,regexLiterals:true}),["js"]);c(i({keywords:r,hashComments:3,cStyleComments:true,multilineStrings:true,tripleQuotedStrings:true,regexLiterals:true}),["coffee"]);c(g([],[[C,/^[\s\S]+/]]),["regex"]);function d(V){var U=V.langExtension;try{var S=a(V.sourceNode);var T=S.sourceCode;V.sourceCode=T;V.spans=S.spans;V.basePos=0;q(U,T)(V);D(V)}catch(W){if("console" in window){console.log(W&&W.stack?W.stack:W)}}}function y(W,V,U){var S=document.createElement("PRE");S.innerHTML=W;if(U){Q(S,U)}var T={langExtension:V,numberLines:U,sourceNode:S};d(T);return S.innerHTML}function b(ad){function Y(af){return document.getElementsByTagName(af)}var ac=[Y("pre"),Y("code"),Y("xmp")];var T=[];for(var aa=0;aa=0){var ah=ai.match(ab);var am;if(!ah&&(am=o(aj))&&"CODE"===am.tagName){ah=am.className.match(ab)}if(ah){ah=ah[1]}var al=false;for(var ak=aj.parentNode;ak;ak=ak.parentNode){if((ak.tagName==="pre"||ak.tagName==="code"||ak.tagName==="xmp")&&ak.className&&ak.className.indexOf("prettyprint")>=0){al=true;break}}if(!al){var af=aj.className.match(/\blinenums\b(?::(\d+))?/);af=af?af[1]&&af[1].length?+af[1]:true:false;if(af){Q(aj,af)}S={langExtension:ah,sourceNode:aj,numberLines:af};d(S)}}}if(X]*(?:>|$)/],[PR.PR_COMMENT,/^<\!--[\s\S]*?(?:-\->|$)/],[PR.PR_PUNCTUATION,/^(?:<[%?]|[%?]>)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-handlebars",/^]*type\s*=\s*['"]?text\/x-handlebars-template['"]?\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i],[PR.PR_DECLARATION,/^{{[#^>/]?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{&?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{{>?\s*[\w.][^}]*}}}/],[PR.PR_COMMENT,/^{{![^}]*}}/]]),["handlebars","hbs"]);PR.registerLangHandler(PR.createSimpleLexer([[PR.PR_PLAIN,/^[ \t\r\n\f]+/,null," \t\r\n\f"]],[[PR.PR_STRING,/^\"(?:[^\n\r\f\\\"]|\\(?:\r\n?|\n|\f)|\\[\s\S])*\"/,null],[PR.PR_STRING,/^\'(?:[^\n\r\f\\\']|\\(?:\r\n?|\n|\f)|\\[\s\S])*\'/,null],["lang-css-str",/^url\(([^\)\"\']*)\)/i],[PR.PR_KEYWORD,/^(?:url|rgb|\!important|@import|@page|@media|@charset|inherit)(?=[^\-\w]|$)/i,null],["lang-css-kw",/^(-?(?:[_a-z]|(?:\\[0-9a-f]+ ?))(?:[_a-z0-9\-]|\\(?:\\[0-9a-f]+ ?))*)\s*:/i],[PR.PR_COMMENT,/^\/\*[^*]*\*+(?:[^\/*][^*]*\*+)*\//],[PR.PR_COMMENT,/^(?:)/],[PR.PR_LITERAL,/^(?:\d+|\d*\.\d+)(?:%|[a-z]+)?/i],[PR.PR_LITERAL,/^#(?:[0-9a-f]{3}){1,2}/i],[PR.PR_PLAIN,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i],[PR.PR_PUNCTUATION,/^[^\s\w\'\"]+/]]),["css"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_KEYWORD,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i]]),["css-kw"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_STRING,/^[^\)\"\']+/]]),["css-str"]); diff --git a/deps/npm/node_modules/mute-stream/coverage/lcov-report/sort-arrow-sprite.png b/deps/npm/node_modules/mute-stream/coverage/lcov-report/sort-arrow-sprite.png deleted file mode 100644 index 03f704a609c6fd0dbfdac63466a7d7c958b5cbf3..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 209 zcmeAS@N?(olHy`uVBq!ia0vp^>_9Bd!3HEZxJ@+%Qj#UE5hcO-X(i=}MX3yqDfvmM z3ZA)%>8U}fi7AzZCsS>Jii$m5978H@?Fn+^JD|Y9yzj{W`447Gxa{7*dM7nnnD-Lb z6^}Hx2)'; - } - } - return cols; - } - // attaches a data attribute to every tr element with an object - // of data values keyed by column name - function loadRowData(tableRow) { - var tableCols = tableRow.querySelectorAll('td'), - colNode, - col, - data = {}, - i, - val; - for (i = 0; i < tableCols.length; i += 1) { - colNode = tableCols[i]; - col = cols[i]; - val = colNode.getAttribute('data-value'); - if (col.type === 'number') { - val = Number(val); - } - data[col.key] = val; - } - return data; - } - // loads all row data - function loadData() { - var rows = getTableBody().querySelectorAll('tr'), - i; - - for (i = 0; i < rows.length; i += 1) { - rows[i].data = loadRowData(rows[i]); - } - } - // sorts the table using the data for the ith column - function sortByIndex(index, desc) { - var key = cols[index].key, - sorter = function (a, b) { - a = a.data[key]; - b = b.data[key]; - return a < b ? -1 : a > b ? 1 : 0; - }, - finalSorter = sorter, - tableBody = document.querySelector('.coverage-summary tbody'), - rowNodes = tableBody.querySelectorAll('tr'), - rows = [], - i; - - if (desc) { - finalSorter = function (a, b) { - return -1 * sorter(a, b); - }; - } - - for (i = 0; i < rowNodes.length; i += 1) { - rows.push(rowNodes[i]); - tableBody.removeChild(rowNodes[i]); - } - - rows.sort(finalSorter); - - for (i = 0; i < rows.length; i += 1) { - tableBody.appendChild(rows[i]); - } - } - // removes sort indicators for current column being sorted - function removeSortIndicators() { - var col = getNthColumn(currentSort.index), - cls = col.className; - - cls = cls.replace(/ sorted$/, '').replace(/ sorted-desc$/, ''); - col.className = cls; - } - // adds sort indicators for current column being sorted - function addSortIndicators() { - getNthColumn(currentSort.index).className += currentSort.desc ? ' sorted-desc' : ' sorted'; - } - // adds event listeners for all sorter widgets - function enableUI() { - var i, - el, - ithSorter = function ithSorter(i) { - var col = cols[i]; - - return function () { - var desc = col.defaultDescSort; - - if (currentSort.index === i) { - desc = !currentSort.desc; - } - sortByIndex(i, desc); - removeSortIndicators(); - currentSort.index = i; - currentSort.desc = desc; - addSortIndicators(); - }; - }; - for (i =0 ; i < cols.length; i += 1) { - if (cols[i].sortable) { - // add the click event handler on the th so users - // dont have to click on those tiny arrows - el = getNthColumn(i).querySelector('.sorter').parentElement; - if (el.addEventListener) { - el.addEventListener('click', ithSorter(i)); - } else { - el.attachEvent('onclick', ithSorter(i)); - } - } - } - } - // adds sorting functionality to the UI - return function () { - if (!getTable()) { - return; - } - cols = loadColumns(); - loadData(cols); - addSortIndicators(); - enableUI(); - }; -})(); - -window.addEventListener('load', addSorting); diff --git a/deps/npm/node_modules/mute-stream/coverage/lcov.info b/deps/npm/node_modules/mute-stream/coverage/lcov.info deleted file mode 100644 index 5f2a58e42d2c4a..00000000000000 --- a/deps/npm/node_modules/mute-stream/coverage/lcov.info +++ /dev/null @@ -1,155 +0,0 @@ -TN: -SF:./mute.js -FN:7,MuteStream -FN:29,(anonymous_2) -FN:33,(anonymous_3) -FN:44,onPipe -FN:55,getIsTTY -FN:63,setIsTTY -FN:73,(anonymous_7) -FN:80,(anonymous_8) -FN:87,(anonymous_9) -FN:92,(anonymous_10) -FN:96,(anonymous_11) -FN:100,(anonymous_12) -FN:124,(anonymous_13) -FN:136,proxy -FN:136,(anonymous_15) -FNF:15 -FNH:14 -FNDA:7,MuteStream -FNDA:10,(anonymous_2) -FNDA:6,(anonymous_3) -FNDA:5,onPipe -FNDA:8,getIsTTY -FNDA:2,setIsTTY -FNDA:5,(anonymous_7) -FNDA:5,(anonymous_8) -FNDA:2,(anonymous_9) -FNDA:2,(anonymous_10) -FNDA:2,(anonymous_11) -FNDA:25,(anonymous_12) -FNDA:2,(anonymous_13) -FNDA:3,proxy -FNDA:0,(anonymous_15) -DA:1,1 -DA:3,1 -DA:7,1 -DA:8,7 -DA:9,7 -DA:10,7 -DA:11,7 -DA:12,7 -DA:13,7 -DA:18,7 -DA:19,7 -DA:22,1 -DA:24,1 -DA:29,1 -DA:30,10 -DA:33,1 -DA:34,6 -DA:37,1 -DA:44,1 -DA:45,5 -DA:48,1 -DA:55,1 -DA:56,8 -DA:63,1 -DA:64,2 -DA:72,1 -DA:74,5 -DA:79,1 -DA:81,5 -DA:87,1 -DA:88,2 -DA:89,2 -DA:92,1 -DA:93,2 -DA:96,1 -DA:97,2 -DA:100,1 -DA:101,25 -DA:102,13 -DA:103,8 -DA:104,0 -DA:105,0 -DA:106,0 -DA:107,0 -DA:109,0 -DA:110,0 -DA:112,8 -DA:114,0 -DA:115,0 -DA:116,0 -DA:118,8 -DA:121,20 -DA:124,1 -DA:125,2 -DA:126,2 -DA:127,0 -DA:129,2 -DA:132,2 -DA:133,2 -DA:136,3 -DA:137,0 -DA:138,0 -DA:139,0 -DA:140,0 -DA:143,1 -DA:144,1 -DA:145,1 -LF:67 -LH:53 -BRDA:9,1,0,7 -BRDA:9,1,1,5 -BRDA:18,2,0,7 -BRDA:18,2,1,7 -BRDA:56,3,0,3 -BRDA:56,3,1,5 -BRDA:57,4,0,3 -BRDA:57,4,1,2 -BRDA:74,5,0,4 -BRDA:74,5,1,1 -BRDA:75,6,0,0 -BRDA:75,6,1,1 -BRDA:81,7,0,4 -BRDA:81,7,1,1 -BRDA:82,8,0,0 -BRDA:82,8,1,1 -BRDA:93,9,0,2 -BRDA:93,9,1,0 -BRDA:97,10,0,2 -BRDA:97,10,1,0 -BRDA:101,11,0,13 -BRDA:101,11,1,12 -BRDA:102,12,0,5 -BRDA:102,12,1,8 -BRDA:103,13,0,0 -BRDA:103,13,1,8 -BRDA:104,14,0,0 -BRDA:104,14,1,0 -BRDA:112,15,0,0 -BRDA:112,15,1,8 -BRDA:112,16,0,8 -BRDA:112,16,1,0 -BRDA:112,16,2,0 -BRDA:125,17,0,2 -BRDA:125,17,1,0 -BRDA:126,18,0,0 -BRDA:126,18,1,2 -BRDA:126,19,0,2 -BRDA:126,19,1,1 -BRDA:132,20,0,0 -BRDA:132,20,1,2 -BRDA:139,21,0,0 -BRDA:139,21,1,0 -BRDA:139,22,0,0 -BRDA:139,22,1,0 -BRDA:140,23,0,0 -BRDA:140,23,1,0 -BRDA:140,24,0,0 -BRDA:140,24,1,0 -BRF:49 -BRH:28 -end_of_record diff --git a/deps/npm/node_modules/mute-stream/package.json b/deps/npm/node_modules/mute-stream/package.json index cc03dcf7c0dcda..56ebb363b92511 100644 --- a/deps/npm/node_modules/mute-stream/package.json +++ b/deps/npm/node_modules/mute-stream/package.json @@ -1,60 +1,29 @@ { - "_from": "mute-stream@~0.0.4", - "_id": "mute-stream@0.0.7", - "_inBundle": false, - "_integrity": "sha1-MHXOk7whuPq0PhvE2n6BFe0ee6s=", - "_location": "/mute-stream", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "mute-stream@~0.0.4", - "name": "mute-stream", - "escapedName": "mute-stream", - "rawSpec": "~0.0.4", - "saveSpec": null, - "fetchSpec": "~0.0.4" - }, - "_requiredBy": [ - "/inquirer", - "/read" - ], - "_resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.7.tgz", - "_shasum": "3075ce93bc21b8fab43e1bc4da7e8115ed1e7bab", - "_spec": "mute-stream@~0.0.4", - "_where": "/Users/rebecca/code/npm/node_modules/read", - "author": { - "name": "Isaac Z. Schlueter", - "email": "i@izs.me", - "url": "http://blog.izs.me/" - }, - "bugs": { - "url": "https://github.com/isaacs/mute-stream/issues" + "name": "mute-stream", + "version": "0.0.8", + "main": "mute.js", + "directories": { + "test": "test" }, - "bundleDependencies": false, - "deprecated": false, - "description": "Bytes go in, but they don't come out (when muted).", "devDependencies": { - "tap": "^5.4.4" + "tap": "^12.1.1" }, - "directories": { - "test": "test" + "scripts": { + "test": "tap test/*.js --cov" + }, + "repository": { + "type": "git", + "url": "git://github.com/isaacs/mute-stream" }, - "homepage": "https://github.com/isaacs/mute-stream#readme", "keywords": [ "mute", "stream", "pipe" ], + "author": "Isaac Z. Schlueter (http://blog.izs.me/)", "license": "ISC", - "main": "mute.js", - "name": "mute-stream", - "repository": { - "type": "git", - "url": "git://github.com/isaacs/mute-stream.git" - }, - "scripts": { - "test": "tap test/*.js --cov" - }, - "version": "0.0.7" + "description": "Bytes go in, but they don't come out (when muted).", + "files": [ + "mute.js" + ] } diff --git a/deps/npm/node_modules/mute-stream/test/basic.js b/deps/npm/node_modules/mute-stream/test/basic.js deleted file mode 100644 index 41f9e10c385a2f..00000000000000 --- a/deps/npm/node_modules/mute-stream/test/basic.js +++ /dev/null @@ -1,207 +0,0 @@ -var Stream = require('stream') -var tap = require('tap') -var MS = require('../mute.js') - -// some marker objects -var END = {} -var PAUSE = {} -var RESUME = {} - -function PassThrough () { - Stream.call(this) - this.readable = this.writable = true -} - -PassThrough.prototype = Object.create(Stream.prototype, { - constructor: { - value: PassThrough - }, - write: { - value: function (c) { - this.emit('data', c) - return true - } - }, - end: { - value: function (c) { - if (c) this.write(c) - this.emit('end') - } - }, - pause: { - value: function () { - this.emit('pause') - } - }, - resume: { - value: function () { - this.emit('resume') - } - } -}) - -tap.test('incoming', function (t) { - var ms = new MS - var str = new PassThrough - str.pipe(ms) - - var expect = ['foo', 'boo', END] - ms.on('data', function (c) { - t.equal(c, expect.shift()) - }) - ms.on('end', function () { - t.equal(END, expect.shift()) - t.end() - }) - str.write('foo') - ms.mute() - str.write('bar') - ms.unmute() - str.write('boo') - ms.mute() - str.write('blaz') - str.end('grelb') -}) - -tap.test('outgoing', function (t) { - var ms = new MS - var str = new PassThrough - ms.pipe(str) - - var expect = ['foo', 'boo', END] - str.on('data', function (c) { - t.equal(c, expect.shift()) - }) - str.on('end', function () { - t.equal(END, expect.shift()) - t.end() - }) - - ms.write('foo') - ms.mute() - ms.write('bar') - ms.unmute() - ms.write('boo') - ms.mute() - ms.write('blaz') - ms.end('grelb') -}) - -tap.test('isTTY', function (t) { - var str = new PassThrough - str.isTTY = true - str.columns=80 - str.rows=24 - - var ms = new MS - t.equal(ms.isTTY, false) - t.equal(ms.columns, undefined) - t.equal(ms.rows, undefined) - ms.pipe(str) - t.equal(ms.isTTY, true) - t.equal(ms.columns, 80) - t.equal(ms.rows, 24) - str.isTTY = false - t.equal(ms.isTTY, false) - t.equal(ms.columns, 80) - t.equal(ms.rows, 24) - str.isTTY = true - t.equal(ms.isTTY, true) - t.equal(ms.columns, 80) - t.equal(ms.rows, 24) - ms.isTTY = false - t.equal(ms.isTTY, false) - t.equal(ms.columns, 80) - t.equal(ms.rows, 24) - - ms = new MS - t.equal(ms.isTTY, false) - str.pipe(ms) - t.equal(ms.isTTY, true) - str.isTTY = false - t.equal(ms.isTTY, false) - str.isTTY = true - t.equal(ms.isTTY, true) - ms.isTTY = false - t.equal(ms.isTTY, false) - - t.end() -}) - -tap.test('pause/resume incoming', function (t) { - var str = new PassThrough - var ms = new MS - str.on('pause', function () { - t.equal(PAUSE, expect.shift()) - }) - str.on('resume', function () { - t.equal(RESUME, expect.shift()) - }) - var expect = [PAUSE, RESUME, PAUSE, RESUME] - str.pipe(ms) - ms.pause() - ms.resume() - ms.pause() - ms.resume() - t.equal(expect.length, 0, 'saw all events') - t.end() -}) - -tap.test('replace with *', function (t) { - var str = new PassThrough - var ms = new MS({replace: '*'}) - str.pipe(ms) - var expect = ['foo', '*****', 'bar', '***', 'baz', 'boo', '**', '****'] - - ms.on('data', function (c) { - t.equal(c, expect.shift()) - }) - - str.write('foo') - ms.mute() - str.write('12345') - ms.unmute() - str.write('bar') - ms.mute() - str.write('baz') - ms.unmute() - str.write('baz') - str.write('boo') - ms.mute() - str.write('xy') - str.write('xyzΩ') - - t.equal(expect.length, 0) - t.end() -}) - -tap.test('replace with ~YARG~', function (t) { - var str = new PassThrough - var ms = new MS({replace: '~YARG~'}) - str.pipe(ms) - var expect = ['foo', '~YARG~~YARG~~YARG~~YARG~~YARG~', 'bar', - '~YARG~~YARG~~YARG~', 'baz', 'boo', '~YARG~~YARG~', - '~YARG~~YARG~~YARG~~YARG~'] - - ms.on('data', function (c) { - t.equal(c, expect.shift()) - }) - - // also throw some unicode in there, just for good measure. - str.write('foo') - ms.mute() - str.write('ΩΩ') - ms.unmute() - str.write('bar') - ms.mute() - str.write('Ω') - ms.unmute() - str.write('baz') - str.write('boo') - ms.mute() - str.write('Ω') - str.write('ΩΩ') - - t.equal(expect.length, 0) - t.end() -}) diff --git a/deps/npm/node_modules/node-fetch-npm/CHANGELOG.md b/deps/npm/node_modules/node-fetch-npm/CHANGELOG.md deleted file mode 100644 index a0cfe7f73e495c..00000000000000 --- a/deps/npm/node_modules/node-fetch-npm/CHANGELOG.md +++ /dev/null @@ -1,252 +0,0 @@ -# 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. - - -## [2.0.2](https://github.com/npm/node-fetch-npm/compare/v2.0.1...v2.0.2) (2017-08-15) - - -### Bug Fixes - -* **json:** replace jju with a custom syntax error reporter ([#6](https://github.com/npm/node-fetch-npm/issues/6)) ([84d169c](https://github.com/npm/node-fetch-npm/commit/84d169c)) - - - - -## [2.0.1](https://github.com/npm/node-fetch-npm/compare/v2.0.0...v2.0.1) (2017-05-24) - - -### Bug Fixes - -* **json:** improve JSON parse error reporting ([1c810df](https://github.com/npm/node-fetch-npm/commit/1c810df)) - - - - -# [2.0.0](https://github.com/npm/node-fetch-npm/compare/v1.0.1...v2.0.0) (2017-05-06) - - -### Features - -* **version:** force bump to 2.0 ([39c5d50](https://github.com/npm/node-fetch-npm/commit/39c5d50)) - - -### BREAKING CHANGES - -* **version:** tooling got confused, so hitting 2.0.0 for reals now - - - - -## [1.0.1](https://github.com/npm/node-fetch-npm/compare/v1.0.0...v1.0.1) (2017-05-06) - - -### Bug Fixes - -* **redirect:** Remove authorization header on redirect to different host ([#2](https://github.com/npm/node-fetch-npm/issues/2)) ([273260e](https://github.com/npm/node-fetch-npm/commit/273260e)) - - - - -# [1.0.0](https://github.com/npm/node-fetch-npm/compare/v2.0.0-alpha.3...v1.0.0) (2017-04-26) - - -### Bug Fixes - -* **proj:** initial fork changes ([0a190a8](https://github.com/npm/node-fetch-npm/commit/0a190a8)) - - -### BREAKING CHANGES - -* **proj:** this renames the library altogether - - - - -Changelog -========= - - -# 2.x release - -## v2.0.0 - -This is a major release. Check [our upgrade guide](https://github.com/bitinn/node-fetch/blob/master/UPGRADE-GUIDE.md) for an overview on some key differences between v1 and v2. - -### General changes - -- Major: Node.js 0.10.x and 0.12.x support is dropped -- Major: `require('node-fetch/lib/response')` etc. is now unsupported; use `require('node-fetch').Response` or ES6 module imports -- Enhance: start testing on Node.js 4, 6, 7 -- Enhance: use Rollup to produce a distributed bundle (less memory overhead and faster startup) -- Enhance: make `Object.prototype.toString()` on Headers, Requests, and Responses return correct class strings -- Other: rewrite in ES2015 using Babel -- Other: use Codecov for code coverage tracking - -### HTTP requests - -- Major: overwrite user's `Content-Length` if we can be sure our information is correct (per spec) -- Fix: support WHATWG URL objects, created by `whatwg-url` package or `require('url').URL` in Node.js 7+ - -### Response and Request classes - -- Major: `response.text()` no longer attempts to detect encoding, instead always opting for UTF-8 (per spec); use `response.textConverted()` for the v1 behavior -- Major: make `response.json()` throw error instead of returning an empty object on 204 no-content respose (per spec; reverts behavior changed in v1.6.2) -- Major: internal methods are no longer exposed -- Major: throw error when a `GET` or `HEAD` Request is constructed with a non-null body (per spec) -- Enhance: add `response.arrayBuffer()` (also applies to Requests) -- Enhance: add experimental `response.blob()` (also applies to Requests) -- Fix: fix Request and Response with `null` body - -### Headers class - -- Major: remove `headers.getAll()`; make `get()` return all headers delimited by commas (per spec) -- Enhance: make Headers iterable -- Enhance: make Headers constructor accept an array of tuples -- Enhance: make sure header names and values are valid in HTTP -- Fix: coerce Headers prototype function parameters to strings, where applicable - -### Documentation - -- Enhance: more comprehensive API docs -- Enhance: add a list of default headers in README - - -# 1.x release - -## v1.6.3 - -- Enhance: error handling document to explain `FetchError` design -- Fix: support `form-data` 2.x releases (requires `form-data` >= 2.1.0) - -## v1.6.2 - -- Enhance: minor document update -- Fix: response.json() returns empty object on 204 no-content response instead of throwing a syntax error - -## v1.6.1 - -- Fix: if `res.body` is a non-stream non-formdata object, we will call `body.toString` and send it as a string -- Fix: `counter` value is incorrectly set to `follow` value when wrapping Request instance -- Fix: documentation update - -## v1.6.0 - -- Enhance: added `res.buffer()` api for convenience, it returns body as a Node.js buffer -- Enhance: better old server support by handling raw deflate response -- Enhance: skip encoding detection for non-HTML/XML response -- Enhance: minor document update -- Fix: HEAD request doesn't need decompression, as body is empty -- Fix: `req.body` now accepts a Node.js buffer - -## v1.5.3 - -- Fix: handle 204 and 304 responses when body is empty but content-encoding is gzip/deflate -- Fix: allow resolving response and cloned response in any order -- Fix: avoid setting `content-length` when `form-data` body use streams -- Fix: send DELETE request with content-length when body is present -- Fix: allow any url when calling new Request, but still reject non-http(s) url in fetch - -## v1.5.2 - -- Fix: allow node.js core to handle keep-alive connection pool when passing a custom agent - -## v1.5.1 - -- Fix: redirect mode `manual` should work even when there is no redirection or broken redirection - -## v1.5.0 - -- Enhance: rejected promise now use custom `Error` (thx to @pekeler) -- Enhance: `FetchError` contains `err.type` and `err.code`, allows for better error handling (thx to @pekeler) -- Enhance: basic support for redirect mode `manual` and `error`, allows for location header extraction (thx to @jimmywarting for the initial PR) - -## v1.4.1 - -- Fix: wrapping Request instance with FormData body again should preserve the body as-is - -## v1.4.0 - -- Enhance: Request and Response now have `clone` method (thx to @kirill-konshin for the initial PR) -- Enhance: Request and Response now have proper string and buffer body support (thx to @kirill-konshin) -- Enhance: Body constructor has been refactored out (thx to @kirill-konshin) -- Enhance: Headers now has `forEach` method (thx to @tricoder42) -- Enhance: back to 100% code coverage -- Fix: better form-data support (thx to @item4) -- Fix: better character encoding detection under chunked encoding (thx to @dsuket for the initial PR) - -## v1.3.3 - -- Fix: make sure `Content-Length` header is set when body is string for POST/PUT/PATCH requests -- Fix: handle body stream error, for cases such as incorrect `Content-Encoding` header -- Fix: when following certain redirects, use `GET` on subsequent request per Fetch Spec -- Fix: `Request` and `Response` constructors now parse headers input using `Headers` - -## v1.3.2 - -- Enhance: allow auto detect of form-data input (no `FormData` spec on node.js, this is form-data specific feature) - -## v1.3.1 - -- Enhance: allow custom host header to be set (server-side only feature, as it's a forbidden header on client-side) - -## v1.3.0 - -- Enhance: now `fetch.Request` is exposed as well - -## v1.2.1 - -- Enhance: `Headers` now normalized `Number` value to `String`, prevent common mistakes - -## v1.2.0 - -- Enhance: now fetch.Headers and fetch.Response are exposed, making testing easier - -## v1.1.2 - -- Fix: `Headers` should only support `String` and `Array` properties, and ignore others - -## v1.1.1 - -- Enhance: now req.headers accept both plain object and `Headers` instance - -## v1.1.0 - -- Enhance: timeout now also applies to response body (in case of slow response) -- Fix: timeout is now cleared properly when fetch is done/has failed - -## v1.0.6 - -- Fix: less greedy content-type charset matching - -## v1.0.5 - -- Fix: when `follow = 0`, fetch should not follow redirect -- Enhance: update tests for better coverage -- Enhance: code formatting -- Enhance: clean up doc - -## v1.0.4 - -- Enhance: test iojs support -- Enhance: timeout attached to socket event only fire once per redirect - -## v1.0.3 - -- Fix: response size limit should reject large chunk -- Enhance: added character encoding detection for xml, such as rss/atom feed (encoding in DTD) - -## v1.0.2 - -- Fix: added res.ok per spec change - -## v1.0.0 - -- Enhance: better test coverage and doc - - -# 0.x release - -## v0.1 - -- Major: initial public release diff --git a/deps/npm/node_modules/node-fetch-npm/LICENSE.md b/deps/npm/node_modules/node-fetch-npm/LICENSE.md deleted file mode 100644 index 660ffecb58b02f..00000000000000 --- a/deps/npm/node_modules/node-fetch-npm/LICENSE.md +++ /dev/null @@ -1,22 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2016 David Frank - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. - diff --git a/deps/npm/node_modules/node-fetch-npm/README.md b/deps/npm/node_modules/node-fetch-npm/README.md deleted file mode 100644 index 6d3dd0e6a1d828..00000000000000 --- a/deps/npm/node_modules/node-fetch-npm/README.md +++ /dev/null @@ -1,398 +0,0 @@ - -node-fetch-npm -============== - -[![npm version][npm-image]][npm-url] -[![build status][travis-image]][travis-url] -[![coverage status][codecov-image]][codecov-url] - -A light-weight module that brings `window.fetch` to Node.js - -`node-fetch-npm` is a fork of [`node-fetch`](https://npm.im/node-fetch) used in -npm itself, through [`make-fetch-happen`](https://npm.im/make-fetch-happen). It -has more regular releases and accepts some patches that would not fit with -`node-fetch`'s own design goals (such as picking a specific cookie library, -removing `babel` dependency altogether, etc). - -This library is *not a replacement* for `node-fetch`, nor does it intend to -supplant it. It's purely a fork maintained for the sake of easier patching of -specific needs that it wouldn't be fair to shove down the main project's throat. -This project will still send patches for shared bugs over and hopefully help -improve its "parent". - -## Motivation - -Instead of implementing `XMLHttpRequest` in Node.js to run browser-specific [Fetch polyfill](https://github.com/github/fetch), why not go from native `http` to `fetch` API directly? Hence `node-fetch`, minimal code for a `window.fetch` compatible API on Node.js runtime. - -See Matt Andrews' [isomorphic-fetch](https://github.com/matthew-andrews/isomorphic-fetch) for isomorphic usage (exports `node-fetch` for server-side, `whatwg-fetch` for client-side). - - -## Features - -- Stay consistent with `window.fetch` API. -- Make conscious trade-off when following [whatwg fetch spec][whatwg-fetch] and [stream spec](https://streams.spec.whatwg.org/) implementation details, document known difference. -- Use native promise, but allow substituting it with [insert your favorite promise library]. -- Use native stream for body, on both request and response. -- Decode content encoding (gzip/deflate) properly, and convert string output (such as `res.text()` and `res.json()`) to UTF-8 automatically. -- Useful extensions such as timeout, redirect limit, response size limit, [explicit errors][] for troubleshooting. - - -## Difference from client-side fetch - -- See [Known Differences](https://github.com/npm/node-fetch-npm/blob/master/LIMITS.md) for details. -- If you happen to use a missing feature that `window.fetch` offers, feel free to open an issue. -- Pull requests are welcomed too! - - -## Install - -```sh -$ npm install node-fetch-npm --save -``` - - -## Usage - -```javascript -import fetch from 'node-fetch'; -// or -// const fetch = require('node-fetch'); - -// if you are using your own Promise library, set it through fetch.Promise. Eg. - -// import Bluebird from 'bluebird'; -// fetch.Promise = Bluebird; - -// plain text or html - -fetch('https://github.com/') - .then(res => res.text()) - .then(body => console.log(body)); - -// json - -fetch('https://api.github.com/users/github') - .then(res => res.json()) - .then(json => console.log(json)); - -// catching network error -// 3xx-5xx responses are NOT network errors, and should be handled in then() -// you only need one catch() at the end of your promise chain - -fetch('http://domain.invalid/') - .catch(err => console.error(err)); - -// stream -// the node.js way is to use stream when possible - -fetch('https://assets-cdn.github.com/images/modules/logos_page/Octocat.png') - .then(res => { - const dest = fs.createWriteStream('./octocat.png'); - res.body.pipe(dest); - }); - -// buffer -// if you prefer to cache binary data in full, use buffer() -// note that buffer() is a node-fetch only API - -import fileType from 'file-type'; - -fetch('https://assets-cdn.github.com/images/modules/logos_page/Octocat.png') - .then(res => res.buffer()) - .then(buffer => fileType(buffer)) - .then(type => { /* ... */ }); - -// meta - -fetch('https://github.com/') - .then(res => { - console.log(res.ok); - console.log(res.status); - console.log(res.statusText); - console.log(res.headers.raw()); - console.log(res.headers.get('content-type')); - }); - -// post - -fetch('http://httpbin.org/post', { method: 'POST', body: 'a=1' }) - .then(res => res.json()) - .then(json => console.log(json)); - -// post with stream from file - -import { createReadStream } from 'fs'; - -const stream = createReadStream('input.txt'); -fetch('http://httpbin.org/post', { method: 'POST', body: stream }) - .then(res => res.json()) - .then(json => console.log(json)); - -// post with JSON - -var body = { a: 1 }; -fetch('http://httpbin.org/post', { - method: 'POST', - body: JSON.stringify(body), - headers: { 'Content-Type': 'application/json' }, -}) - .then(res => res.json()) - .then(json => console.log(json)); - -// post with form-data (detect multipart) - -import FormData from 'form-data'; - -const form = new FormData(); -form.append('a', 1); -fetch('http://httpbin.org/post', { method: 'POST', body: form }) - .then(res => res.json()) - .then(json => console.log(json)); - -// post with form-data (custom headers) -// note that getHeaders() is non-standard API - -import FormData from 'form-data'; - -const form = new FormData(); -form.append('a', 1); -fetch('http://httpbin.org/post', { method: 'POST', body: form, headers: form.getHeaders() }) - .then(res => res.json()) - .then(json => console.log(json)); - -// node 7+ with async function - -(async function () { - const res = await fetch('https://api.github.com/users/github'); - const json = await res.json(); - console.log(json); -})(); -``` - -See [test cases](https://github.com/npm/node-fetch-npm/blob/master/test/test.js) for more examples. - - -## API - -### fetch(url[, options]) - -- `url` A string representing the URL for fetching -- `options` [Options](#fetch-options) for the HTTP(S) request -- Returns: Promise<[Response](#class-response)> - -Perform an HTTP(S) fetch. - -`url` should be an absolute url, such as `http://example.com/`. A path-relative URL (`/file/under/root`) or protocol-relative URL (`//can-be-http-or-https.com/`) will result in a rejected promise. - - -#### Options - -The default values are shown after each option key. - -```js -{ - // These properties are part of the Fetch Standard - method: 'GET', - headers: {}, // request headers. format is the identical to that accepted by the Headers constructor (see below) - body: null, // request body. can be null, a string, a Buffer, a Blob, or a Node.js Readable stream - redirect: 'follow', // set to `manual` to extract redirect headers, `error` to reject redirect - - // The following properties are node-fetch-npm extensions - follow: 20, // maximum redirect count. 0 to not follow redirect - timeout: 0, // req/res timeout in ms, it resets on redirect. 0 to disable (OS limit applies) - compress: true, // support gzip/deflate content encoding. false to disable - size: 0, // maximum response body size in bytes. 0 to disable - agent: null // http(s).Agent instance, allows custom proxy, certificate etc. -} -``` - -##### Default Headers - -If no values are set, the following request headers will be sent automatically: - -Header | Value ------------------ | -------------------------------------------------------- -`Accept-Encoding` | `gzip,deflate` _(when `options.compress === true`)_ -`Accept` | `*/*` -`Connection` | `close` _(when no `options.agent` is present)_ -`Content-Length` | _(automatically calculated, if possible)_ -`User-Agent` | `node-fetch-npm/1.0 (+https://github.com/npm/node-fetch-npm)` - - -### Class: Request - -An HTTP(S) request containing information about URL, method, headers, and the body. This class implements the [Body](#iface-body) interface. - -Due to the nature of Node.js, the following properties are not implemented at this moment: - -- `type` -- `destination` -- `referrer` -- `referrerPolicy` -- `mode` -- `credentials` -- `cache` -- `integrity` -- `keepalive` - -The following node-fetch-npm extension properties are provided: - -- `follow` -- `compress` -- `counter` -- `agent` - -See [options](#fetch-options) for exact meaning of these extensions. - -#### new Request(input[, options]) - -*(spec-compliant)* - -- `input` A string representing a URL, or another `Request` (which will be cloned) -- `options` [Options][#fetch-options] for the HTTP(S) request - -Constructs a new `Request` object. The constructor is identical to that in the [browser](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request). - -In most cases, directly `fetch(url, options)` is simpler than creating a `Request` object. - - -### Class: Response - -An HTTP(S) response. This class implements the [Body](#iface-body) interface. - -The following properties are not implemented in node-fetch-npm at this moment: - -- `Response.error()` -- `Response.redirect()` -- `type` -- `redirected` -- `trailer` - -#### new Response([body[, options]]) - -*(spec-compliant)* - -- `body` A string or [Readable stream][node-readable] -- `options` A [`ResponseInit`][response-init] options dictionary - -Constructs a new `Response` object. The constructor is identical to that in the [browser](https://developer.mozilla.org/en-US/docs/Web/API/Response/Response). - -Because Node.js does not implement service workers (for which this class was designed), one rarely has to construct a `Response` directly. - - -### Class: Headers - -This class allows manipulating and iterating over a set of HTTP headers. All methods specified in the [Fetch Standard][whatwg-fetch] are implemented. - -#### new Headers([init]) - -*(spec-compliant)* - -- `init` Optional argument to pre-fill the `Headers` object - -Construct a new `Headers` object. `init` can be either `null`, a `Headers` object, an key-value map object, or any iterable object. - -```js -// Example adapted from https://fetch.spec.whatwg.org/#example-headers-class - -const meta = { - 'Content-Type': 'text/xml', - 'Breaking-Bad': '<3' -}; -const headers = new Headers(meta); - -// The above is equivalent to -const meta = [ - [ 'Content-Type', 'text/xml' ], - [ 'Breaking-Bad', '<3' ] -]; -const headers = new Headers(meta); - -// You can in fact use any iterable objects, like a Map or even another Headers -const meta = new Map(); -meta.set('Content-Type', 'text/xml'); -meta.set('Breaking-Bad', '<3'); -const headers = new Headers(meta); -const copyOfHeaders = new Headers(headers); -``` - - -### Interface: Body - -`Body` is an abstract interface with methods that are applicable to both `Request` and `Response` classes. - -The following methods are not yet implemented in node-fetch-npm at this moment: - -- `formData()` - -#### body.body - -*(deviation from spec)* - -* Node.js [`Readable` stream][node-readable] - -The data encapsulated in the `Body` object. Note that while the [Fetch Standard][whatwg-fetch] requires the property to always be a WHATWG `ReadableStream`, in node-fetch-npm it is a Node.js [`Readable` stream][node-readable]. - -#### body.bodyUsed - -*(spec-compliant)* - -* `Boolean` - -A boolean property for if this body has been consumed. Per spec, a consumed body cannot be used again. - -#### body.arrayBuffer() -#### body.blob() -#### body.json() -#### body.text() - -*(spec-compliant)* - -* Returns: Promise - -Consume the body and return a promise that will resolve to one of these formats. - -#### body.buffer() - -*(node-fetch-npm extension)* - -* Returns: Promise<Buffer> - -Consume the body and return a promise that will resolve to a Buffer. - -#### body.textConverted() - -*(node-fetch-npm extension)* - -* Returns: Promise<String> - -Identical to `body.text()`, except instead of always converting to UTF-8, encoding sniffing will be performed and text converted to UTF-8, if possible. - - -### Class: FetchError - -*(node-fetch-npm extension)* - -An operational error in the fetching process. See [ERROR-HANDLING.md][] for more info. - -## License - -MIT - - -## Acknowledgement - -Thanks to [github/fetch](https://github.com/github/fetch) for providing a solid implementation reference. - - -[npm-image]: https://img.shields.io/npm/v/node-fetch-npm.svg?style=flat-square -[npm-url]: https://www.npmjs.com/package/node-fetch-npm -[travis-image]: https://img.shields.io/travis/npm/node-fetch-npm.svg?style=flat-square -[travis-url]: https://travis-ci.org/npm/node-fetch-npm -[codecov-image]: https://img.shields.io/codecov/c/github/npm/node-fetch-npm.svg?style=flat-square -[codecov-url]: https://codecov.io/gh/npm/node-fetch-npm -[ERROR-HANDLING.md]: https://github.com/npm/node-fetch-npm/blob/master/ERROR-HANDLING.md -[whatwg-fetch]: https://fetch.spec.whatwg.org/ -[response-init]: https://fetch.spec.whatwg.org/#responseinit -[node-readable]: https://nodejs.org/api/stream.html#stream_readable_streams -[mdn-headers]: https://developer.mozilla.org/en-US/docs/Web/API/Headers diff --git a/deps/npm/node_modules/node-fetch-npm/package.json b/deps/npm/node_modules/node-fetch-npm/package.json deleted file mode 100644 index b256ce71862176..00000000000000 --- a/deps/npm/node_modules/node-fetch-npm/package.json +++ /dev/null @@ -1,102 +0,0 @@ -{ - "_from": "node-fetch-npm@^2.0.2", - "_id": "node-fetch-npm@2.0.2", - "_inBundle": false, - "_integrity": "sha512-nJIxm1QmAj4v3nfCvEeCrYSoVwXyxLnaPBK5W1W5DGEJwjlKuC2VEUycGw5oxk+4zZahRrB84PUJJgEmhFTDFw==", - "_location": "/node-fetch-npm", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "node-fetch-npm@^2.0.2", - "name": "node-fetch-npm", - "escapedName": "node-fetch-npm", - "rawSpec": "^2.0.2", - "saveSpec": null, - "fetchSpec": "^2.0.2" - }, - "_requiredBy": [ - "/make-fetch-happen", - "/npm-profile/make-fetch-happen", - "/npm-registry-fetch/make-fetch-happen" - ], - "_resolved": "https://registry.npmjs.org/node-fetch-npm/-/node-fetch-npm-2.0.2.tgz", - "_shasum": "7258c9046182dca345b4208eda918daf33697ff7", - "_spec": "node-fetch-npm@^2.0.2", - "_where": "/Users/rebecca/code/npm/node_modules/make-fetch-happen", - "author": { - "name": "David Frank" - }, - "bugs": { - "url": "https://github.com/npm/node-fetch-npm/issues" - }, - "bundleDependencies": false, - "contributors": [ - { - "name": "Rebecca Turner", - "email": "me@re-becca.org" - }, - { - "name": "Kat Marchán", - "email": "kzm@sykosomatic.org" - } - ], - "dependencies": { - "encoding": "^0.1.11", - "json-parse-better-errors": "^1.0.0", - "safe-buffer": "^5.1.1" - }, - "deprecated": false, - "description": "An npm cli-oriented fork of the excellent node-fetch", - "devDependencies": { - "chai": "^3.5.0", - "chai-as-promised": "^6.0.0", - "chai-iterator": "^1.1.1", - "chai-string": "^1.4.0", - "codecov": "^1.0.1", - "cross-env": "^3.1.4", - "form-data": "^2.2.0", - "is-builtin-module": "^1.0.0", - "mocha": "^3.5.0", - "nyc": "^10.3.2", - "parted": "^0.1.1", - "promise": "^7.3.1", - "resumer": "0.0.0", - "standard": "^10.0.3", - "standard-version": "^4.2.0", - "weallbehave": "^1.2.0", - "weallcontribute": "^1.0.8", - "whatwg-url": "^4.8.0" - }, - "engines": { - "node": ">=4" - }, - "files": [ - "src/*.js" - ], - "homepage": "https://github.com/npm/node-fetch-npm", - "keywords": [ - "fetch", - "http", - "promise" - ], - "license": "MIT", - "main": "src/index.js", - "name": "node-fetch-npm", - "repository": { - "type": "git", - "url": "git+https://github.com/npm/node-fetch-npm.git" - }, - "scripts": { - "coverage": "nyc --reporter json --reporter text mocha -R spec test/test.js && codecov -f coverage/coverage-final.json", - "postrelease": "npm publish && git push --follow-tags", - "prerelease": "npm t", - "pretest": "standard src/*", - "release": "standard-version -s", - "report": "nyc --reporter lcov --reporter text mocha -R spec test/test.js", - "test": "mocha test/test.js", - "update-coc": "weallbehave -o . && git add CODE_OF_CONDUCT.md && git commit -m 'docs(coc): updated CODE_OF_CONDUCT.md'", - "update-contrib": "weallcontribute -o . && git add CONTRIBUTING.md && git commit -m 'docs(contributing): updated CONTRIBUTING.md'" - }, - "version": "2.0.2" -} diff --git a/deps/npm/node_modules/node-fetch-npm/src/blob.js b/deps/npm/node_modules/node-fetch-npm/src/blob.js deleted file mode 100644 index 0a4462abd6be15..00000000000000 --- a/deps/npm/node_modules/node-fetch-npm/src/blob.js +++ /dev/null @@ -1,109 +0,0 @@ -'use strict' -// Based on https://github.com/tmpvar/jsdom/blob/aa85b2abf07766ff7bf5c1f6daafb3726f2f2db5/lib/jsdom/living/blob.js -// (MIT licensed) - -const Buffer = require('safe-buffer').Buffer - -const BUFFER = Symbol('buffer') -const TYPE = Symbol('type') -const CLOSED = Symbol('closed') - -class Blob { - constructor () { - Object.defineProperty(this, Symbol.toStringTag, { - value: 'Blob', - writable: false, - enumerable: false, - configurable: true - }) - - this[CLOSED] = false - this[TYPE] = '' - - const blobParts = arguments[0] - const options = arguments[1] - - const buffers = [] - - if (blobParts) { - const a = blobParts - const length = Number(a.length) - for (let i = 0; i < length; i++) { - const element = a[i] - let buffer - if (Buffer.isBuffer(element)) { - buffer = element - } else if (ArrayBuffer.isView(element)) { - buffer = Buffer.from(new Uint8Array(element.buffer, element.byteOffset, element.byteLength)) - } else if (element instanceof ArrayBuffer) { - buffer = Buffer.from(new Uint8Array(element)) - } else if (element instanceof Blob) { - buffer = element[BUFFER] - } else { - buffer = Buffer.from(typeof element === 'string' ? element : String(element)) - } - buffers.push(buffer) - } - } - - this[BUFFER] = Buffer.concat(buffers) - - let type = options && options.type !== undefined && String(options.type).toLowerCase() - if (type && !/[^\u0020-\u007E]/.test(type)) { - this[TYPE] = type - } - } - get size () { - return this[CLOSED] ? 0 : this[BUFFER].length - } - get type () { - return this[TYPE] - } - get isClosed () { - return this[CLOSED] - } - slice () { - const size = this.size - - const start = arguments[0] - const end = arguments[1] - let relativeStart, relativeEnd - if (start === undefined) { - relativeStart = 0 - } else if (start < 0) { - relativeStart = Math.max(size + start, 0) - } else { - relativeStart = Math.min(start, size) - } - if (end === undefined) { - relativeEnd = size - } else if (end < 0) { - relativeEnd = Math.max(size + end, 0) - } else { - relativeEnd = Math.min(end, size) - } - const span = Math.max(relativeEnd - relativeStart, 0) - - const buffer = this[BUFFER] - const slicedBuffer = buffer.slice( - relativeStart, - relativeStart + span - ) - const blob = new Blob([], { type: arguments[2] }) - blob[BUFFER] = slicedBuffer - blob[CLOSED] = this[CLOSED] - return blob - } - close () { - this[CLOSED] = true - } -} -exports = module.exports = Blob -exports.BUFFER = BUFFER - -Object.defineProperty(Blob.prototype, Symbol.toStringTag, { - value: 'BlobPrototype', - writable: false, - enumerable: false, - configurable: true -}) diff --git a/deps/npm/node_modules/node-fetch-npm/src/body.js b/deps/npm/node_modules/node-fetch-npm/src/body.js deleted file mode 100644 index 9e7481857aea24..00000000000000 --- a/deps/npm/node_modules/node-fetch-npm/src/body.js +++ /dev/null @@ -1,411 +0,0 @@ -'use strict' - -/** - * body.js - * - * Body interface provides common methods for Request and Response - */ - -const Buffer = require('safe-buffer').Buffer - -const Blob = require('./blob.js') -const BUFFER = Blob.BUFFER -const convert = require('encoding').convert -const parseJson = require('json-parse-better-errors') -const FetchError = require('./fetch-error.js') -const Stream = require('stream') - -const PassThrough = Stream.PassThrough -const DISTURBED = Symbol('disturbed') - -/** - * Body class - * - * Cannot use ES6 class because Body must be called with .call(). - * - * @param Stream body Readable stream - * @param Object opts Response options - * @return Void - */ -exports = module.exports = Body - -function Body (body, opts) { - if (!opts) opts = {} - const size = opts.size == null ? 0 : opts.size - const timeout = opts.timeout == null ? 0 : opts.timeout - if (body == null) { - // body is undefined or null - body = null - } else if (typeof body === 'string') { - // body is string - } else if (body instanceof Blob) { - // body is blob - } else if (Buffer.isBuffer(body)) { - // body is buffer - } else if (body instanceof Stream) { - // body is stream - } else { - // none of the above - // coerce to string - body = String(body) - } - this.body = body - this[DISTURBED] = false - this.size = size - this.timeout = timeout -} - -Body.prototype = { - get bodyUsed () { - return this[DISTURBED] - }, - - /** - * Decode response as ArrayBuffer - * - * @return Promise - */ - arrayBuffer () { - return consumeBody.call(this).then(buf => buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength)) - }, - - /** - * Return raw response as Blob - * - * @return Promise - */ - blob () { - let ct = (this.headers && this.headers.get('content-type')) || '' - return consumeBody.call(this).then(buf => Object.assign( - // Prevent copying - new Blob([], { - type: ct.toLowerCase() - }), - { - [BUFFER]: buf - } - )) - }, - - /** - * Decode response as json - * - * @return Promise - */ - json () { - return consumeBody.call(this).then(buffer => parseJson(buffer.toString())) - }, - - /** - * Decode response as text - * - * @return Promise - */ - text () { - return consumeBody.call(this).then(buffer => buffer.toString()) - }, - - /** - * Decode response as buffer (non-spec api) - * - * @return Promise - */ - buffer () { - return consumeBody.call(this) - }, - - /** - * Decode response as text, while automatically detecting the encoding and - * trying to decode to UTF-8 (non-spec api) - * - * @return Promise - */ - textConverted () { - return consumeBody.call(this).then(buffer => convertBody(buffer, this.headers)) - } - -} - -Body.mixIn = function (proto) { - for (const name of Object.getOwnPropertyNames(Body.prototype)) { - // istanbul ignore else: future proof - if (!(name in proto)) { - const desc = Object.getOwnPropertyDescriptor(Body.prototype, name) - Object.defineProperty(proto, name, desc) - } - } -} - -/** - * Decode buffers into utf-8 string - * - * @return Promise - */ -function consumeBody (body) { - if (this[DISTURBED]) { - return Body.Promise.reject(new Error(`body used already for: ${this.url}`)) - } - - this[DISTURBED] = true - - // body is null - if (this.body === null) { - return Body.Promise.resolve(Buffer.alloc(0)) - } - - // body is string - if (typeof this.body === 'string') { - return Body.Promise.resolve(Buffer.from(this.body)) - } - - // body is blob - if (this.body instanceof Blob) { - return Body.Promise.resolve(this.body[BUFFER]) - } - - // body is buffer - if (Buffer.isBuffer(this.body)) { - return Body.Promise.resolve(this.body) - } - - // istanbul ignore if: should never happen - if (!(this.body instanceof Stream)) { - return Body.Promise.resolve(Buffer.alloc(0)) - } - - // body is stream - // get ready to actually consume the body - let accum = [] - let accumBytes = 0 - let abort = false - - return new Body.Promise((resolve, reject) => { - let resTimeout - - // allow timeout on slow response body - if (this.timeout) { - resTimeout = setTimeout(() => { - abort = true - reject(new FetchError(`Response timeout while trying to fetch ${this.url} (over ${this.timeout}ms)`, 'body-timeout')) - }, this.timeout) - } - - // handle stream error, such as incorrect content-encoding - this.body.on('error', err => { - reject(new FetchError(`Invalid response body while trying to fetch ${this.url}: ${err.message}`, 'system', err)) - }) - - this.body.on('data', chunk => { - if (abort || chunk === null) { - return - } - - if (this.size && accumBytes + chunk.length > this.size) { - abort = true - reject(new FetchError(`content size at ${this.url} over limit: ${this.size}`, 'max-size')) - return - } - - accumBytes += chunk.length - accum.push(chunk) - }) - - this.body.on('end', () => { - if (abort) { - return - } - - clearTimeout(resTimeout) - resolve(Buffer.concat(accum)) - }) - }) -} - -/** - * Detect buffer encoding and convert to target encoding - * ref: http://www.w3.org/TR/2011/WD-html5-20110113/parsing.html#determining-the-character-encoding - * - * @param Buffer buffer Incoming buffer - * @param String encoding Target encoding - * @return String - */ -function convertBody (buffer, headers) { - const ct = headers.get('content-type') - let charset = 'utf-8' - let res, str - - // header - if (ct) { - res = /charset=([^;]*)/i.exec(ct) - } - - // no charset in content type, peek at response body for at most 1024 bytes - str = buffer.slice(0, 1024).toString() - - // html5 - if (!res && str) { - res = /= 94 && ch <= 122) { return true } - if (ch >= 65 && ch <= 90) { return true } - if (ch === 45) { return true } - if (ch >= 48 && ch <= 57) { return true } - if (ch === 34 || ch === 40 || ch === 41 || ch === 44) { return false } - if (ch >= 33 && ch <= 46) { return true } - if (ch === 124 || ch === 126) { return true } - return false -} -/* istanbul ignore next */ -function checkIsHttpToken (val) { - if (typeof val !== 'string' || val.length === 0) { return false } - if (!isValidTokenChar(val.charCodeAt(0))) { return false } - const len = val.length - if (len > 1) { - if (!isValidTokenChar(val.charCodeAt(1))) { return false } - if (len > 2) { - if (!isValidTokenChar(val.charCodeAt(2))) { return false } - if (len > 3) { - if (!isValidTokenChar(val.charCodeAt(3))) { return false } - for (var i = 4; i < len; i++) { - if (!isValidTokenChar(val.charCodeAt(i))) { return false } - } - } - } - } - return true -} -exports.checkIsHttpToken = checkIsHttpToken - -/** - * True if val contains an invalid field-vchar - * field-value = *( field-content / obs-fold ) - * field-content = field-vchar [ 1*( SP / HTAB ) field-vchar ] - * field-vchar = VCHAR / obs-text - * - * checkInvalidHeaderChar() is currently designed to be inlinable by v8, - * so take care when making changes to the implementation so that the source - * code size does not exceed v8's default max_inlined_source_size setting. - **/ -/* istanbul ignore next */ -function checkInvalidHeaderChar (val) { - val += '' - if (val.length < 1) { return false } - var c = val.charCodeAt(0) - if ((c <= 31 && c !== 9) || c > 255 || c === 127) { return true } - if (val.length < 2) { return false } - c = val.charCodeAt(1) - if ((c <= 31 && c !== 9) || c > 255 || c === 127) { return true } - if (val.length < 3) { return false } - c = val.charCodeAt(2) - if ((c <= 31 && c !== 9) || c > 255 || c === 127) { return true } - for (var i = 3; i < val.length; ++i) { - c = val.charCodeAt(i) - if ((c <= 31 && c !== 9) || c > 255 || c === 127) { return true } - } - return false -} -exports.checkInvalidHeaderChar = checkInvalidHeaderChar diff --git a/deps/npm/node_modules/node-fetch-npm/src/fetch-error.js b/deps/npm/node_modules/node-fetch-npm/src/fetch-error.js deleted file mode 100644 index 338e1e2729152e..00000000000000 --- a/deps/npm/node_modules/node-fetch-npm/src/fetch-error.js +++ /dev/null @@ -1,35 +0,0 @@ -'use strict' - -/** - * fetch-error.js - * - * FetchError interface for operational errors - */ - -/** - * Create FetchError instance - * - * @param String message Error message for human - * @param String type Error type for machine - * @param String systemError For Node.js system error - * @return FetchError - */ -module.exports = FetchError -function FetchError (message, type, systemError) { - Error.call(this, message) - - this.message = message - this.type = type - - // when err.type is `system`, err.code contains system error code - if (systemError) { - this.code = this.errno = systemError.code - } - - // hide custom error implementation details from end-users - Error.captureStackTrace(this, this.constructor) -} - -FetchError.prototype = Object.create(Error.prototype) -FetchError.prototype.constructor = FetchError -FetchError.prototype.name = 'FetchError' diff --git a/deps/npm/node_modules/node-fetch-npm/src/headers.js b/deps/npm/node_modules/node-fetch-npm/src/headers.js deleted file mode 100644 index 28f71cd9b89828..00000000000000 --- a/deps/npm/node_modules/node-fetch-npm/src/headers.js +++ /dev/null @@ -1,296 +0,0 @@ -'use strict' - -/** - * headers.js - * - * Headers class offers convenient helpers - */ - -const common = require('./common.js') -const checkInvalidHeaderChar = common.checkInvalidHeaderChar -const checkIsHttpToken = common.checkIsHttpToken - -function sanitizeName (name) { - name += '' - if (!checkIsHttpToken(name)) { - throw new TypeError(`${name} is not a legal HTTP header name`) - } - return name.toLowerCase() -} - -function sanitizeValue (value) { - value += '' - if (checkInvalidHeaderChar(value)) { - throw new TypeError(`${value} is not a legal HTTP header value`) - } - return value -} - -const MAP = Symbol('map') -class Headers { - /** - * Headers class - * - * @param Object headers Response headers - * @return Void - */ - constructor (init) { - this[MAP] = Object.create(null) - - if (init instanceof Headers) { - const rawHeaders = init.raw() - const headerNames = Object.keys(rawHeaders) - - for (const headerName of headerNames) { - for (const value of rawHeaders[headerName]) { - this.append(headerName, value) - } - } - - return - } - - // We don't worry about converting prop to ByteString here as append() - // will handle it. - if (init == null) { - // no op - } else if (typeof init === 'object') { - const method = init[Symbol.iterator] - if (method != null) { - if (typeof method !== 'function') { - throw new TypeError('Header pairs must be iterable') - } - - // sequence> - // Note: per spec we have to first exhaust the lists then process them - const pairs = [] - for (const pair of init) { - if (typeof pair !== 'object' || typeof pair[Symbol.iterator] !== 'function') { - throw new TypeError('Each header pair must be iterable') - } - pairs.push(Array.from(pair)) - } - - for (const pair of pairs) { - if (pair.length !== 2) { - throw new TypeError('Each header pair must be a name/value tuple') - } - this.append(pair[0], pair[1]) - } - } else { - // record - for (const key of Object.keys(init)) { - const value = init[key] - this.append(key, value) - } - } - } else { - throw new TypeError('Provided initializer must be an object') - } - - Object.defineProperty(this, Symbol.toStringTag, { - value: 'Headers', - writable: false, - enumerable: false, - configurable: true - }) - } - - /** - * Return first header value given name - * - * @param String name Header name - * @return Mixed - */ - get (name) { - const list = this[MAP][sanitizeName(name)] - if (!list) { - return null - } - - return list.join(', ') - } - - /** - * Iterate over all headers - * - * @param Function callback Executed for each item with parameters (value, name, thisArg) - * @param Boolean thisArg `this` context for callback function - * @return Void - */ - forEach (callback, thisArg) { - let pairs = getHeaderPairs(this) - let i = 0 - while (i < pairs.length) { - const name = pairs[i][0] - const value = pairs[i][1] - callback.call(thisArg, value, name, this) - pairs = getHeaderPairs(this) - i++ - } - } - - /** - * Overwrite header values given name - * - * @param String name Header name - * @param String value Header value - * @return Void - */ - set (name, value) { - this[MAP][sanitizeName(name)] = [sanitizeValue(value)] - } - - /** - * Append a value onto existing header - * - * @param String name Header name - * @param String value Header value - * @return Void - */ - append (name, value) { - if (!this.has(name)) { - this.set(name, value) - return - } - - this[MAP][sanitizeName(name)].push(sanitizeValue(value)) - } - - /** - * Check for header name existence - * - * @param String name Header name - * @return Boolean - */ - has (name) { - return !!this[MAP][sanitizeName(name)] - } - - /** - * Delete all header values given name - * - * @param String name Header name - * @return Void - */ - delete (name) { - delete this[MAP][sanitizeName(name)] - }; - - /** - * Return raw headers (non-spec api) - * - * @return Object - */ - raw () { - return this[MAP] - } - - /** - * Get an iterator on keys. - * - * @return Iterator - */ - keys () { - return createHeadersIterator(this, 'key') - } - - /** - * Get an iterator on values. - * - * @return Iterator - */ - values () { - return createHeadersIterator(this, 'value') - } - - /** - * Get an iterator on entries. - * - * This is the default iterator of the Headers object. - * - * @return Iterator - */ - [Symbol.iterator] () { - return createHeadersIterator(this, 'key+value') - } -} -Headers.prototype.entries = Headers.prototype[Symbol.iterator] - -Object.defineProperty(Headers.prototype, Symbol.toStringTag, { - value: 'HeadersPrototype', - writable: false, - enumerable: false, - configurable: true -}) - -function getHeaderPairs (headers, kind) { - const keys = Object.keys(headers[MAP]).sort() - return keys.map( - kind === 'key' - ? k => [k] - : k => [k, headers.get(k)] - ) -} - -const INTERNAL = Symbol('internal') - -function createHeadersIterator (target, kind) { - const iterator = Object.create(HeadersIteratorPrototype) - iterator[INTERNAL] = { - target, - kind, - index: 0 - } - return iterator -} - -const HeadersIteratorPrototype = Object.setPrototypeOf({ - next () { - // istanbul ignore if - if (!this || - Object.getPrototypeOf(this) !== HeadersIteratorPrototype) { - throw new TypeError('Value of `this` is not a HeadersIterator') - } - - const target = this[INTERNAL].target - const kind = this[INTERNAL].kind - const index = this[INTERNAL].index - const values = getHeaderPairs(target, kind) - const len = values.length - if (index >= len) { - return { - value: undefined, - done: true - } - } - - const pair = values[index] - this[INTERNAL].index = index + 1 - - let result - if (kind === 'key') { - result = pair[0] - } else if (kind === 'value') { - result = pair[1] - } else { - result = pair - } - - return { - value: result, - done: false - } - } -}, Object.getPrototypeOf( - Object.getPrototypeOf([][Symbol.iterator]()) -)) - -Object.defineProperty(HeadersIteratorPrototype, Symbol.toStringTag, { - value: 'HeadersIterator', - writable: false, - enumerable: false, - configurable: true -}) - -module.exports = Headers diff --git a/deps/npm/node_modules/node-fetch-npm/src/index.js b/deps/npm/node_modules/node-fetch-npm/src/index.js deleted file mode 100644 index b2cf80f9eccf31..00000000000000 --- a/deps/npm/node_modules/node-fetch-npm/src/index.js +++ /dev/null @@ -1,214 +0,0 @@ -'use strict' - -/** - * index.js - * - * a request API compatible with window.fetch - */ - -const url = require('url') -const http = require('http') -const https = require('https') -const zlib = require('zlib') -const PassThrough = require('stream').PassThrough - -const Body = require('./body.js') -const writeToStream = Body.writeToStream -const Response = require('./response') -const Headers = require('./headers') -const Request = require('./request') -const getNodeRequestOptions = Request.getNodeRequestOptions -const FetchError = require('./fetch-error') -const isURL = /^https?:/ - -/** - * Fetch function - * - * @param Mixed url Absolute url or Request instance - * @param Object opts Fetch options - * @return Promise - */ -exports = module.exports = fetch -function fetch (uri, opts) { - // allow custom promise - if (!fetch.Promise) { - throw new Error('native promise missing, set fetch.Promise to your favorite alternative') - } - - Body.Promise = fetch.Promise - - // wrap http.request into fetch - return new fetch.Promise((resolve, reject) => { - // build request object - const request = new Request(uri, opts) - const options = getNodeRequestOptions(request) - - const send = (options.protocol === 'https:' ? https : http).request - - // http.request only support string as host header, this hack make custom host header possible - if (options.headers.host) { - options.headers.host = options.headers.host[0] - } - - // send request - const req = send(options) - let reqTimeout - - if (request.timeout) { - req.once('socket', socket => { - reqTimeout = setTimeout(() => { - req.abort() - reject(new FetchError(`network timeout at: ${request.url}`, 'request-timeout')) - }, request.timeout) - }) - } - - req.on('error', err => { - clearTimeout(reqTimeout) - reject(new FetchError(`request to ${request.url} failed, reason: ${err.message}`, 'system', err)) - }) - - req.on('response', res => { - clearTimeout(reqTimeout) - - // handle redirect - if (fetch.isRedirect(res.statusCode) && request.redirect !== 'manual') { - if (request.redirect === 'error') { - reject(new FetchError(`redirect mode is set to error: ${request.url}`, 'no-redirect')) - return - } - - if (request.counter >= request.follow) { - reject(new FetchError(`maximum redirect reached at: ${request.url}`, 'max-redirect')) - return - } - - if (!res.headers.location) { - reject(new FetchError(`redirect location header missing at: ${request.url}`, 'invalid-redirect')) - return - } - // Remove authorization if changing hostnames (but not if just - // changing ports or protocols). This matches the behavior of request: - // https://github.com/request/request/blob/b12a6245/lib/redirect.js#L134-L138 - const resolvedUrl = url.resolve(request.url, res.headers.location) - let redirectURL = '' - if (!isURL.test(res.headers.location)) { - redirectURL = url.parse(resolvedUrl) - } else { - redirectURL = url.parse(res.headers.location) - } - if (url.parse(request.url).hostname !== redirectURL.hostname) { - request.headers.delete('authorization') - } - - // per fetch spec, for POST request with 301/302 response, or any request with 303 response, use GET when following redirect - if (res.statusCode === 303 || - ((res.statusCode === 301 || res.statusCode === 302) && request.method === 'POST')) { - request.method = 'GET' - request.body = null - request.headers.delete('content-length') - } - - request.counter++ - - resolve(fetch(resolvedUrl, request)) - return - } - - // normalize location header for manual redirect mode - const headers = new Headers() - for (const name of Object.keys(res.headers)) { - if (Array.isArray(res.headers[name])) { - for (const val of res.headers[name]) { - headers.append(name, val) - } - } else { - headers.append(name, res.headers[name]) - } - } - if (request.redirect === 'manual' && headers.has('location')) { - headers.set('location', url.resolve(request.url, headers.get('location'))) - } - - // prepare response - let body = res.pipe(new PassThrough()) - const responseOptions = { - url: request.url, - status: res.statusCode, - statusText: res.statusMessage, - headers: headers, - size: request.size, - timeout: request.timeout - } - - // HTTP-network fetch step 16.1.2 - const codings = headers.get('Content-Encoding') - - // HTTP-network fetch step 16.1.3: handle content codings - - // in following scenarios we ignore compression support - // 1. compression support is disabled - // 2. HEAD request - // 3. no Content-Encoding header - // 4. no content response (204) - // 5. content not modified response (304) - if (!request.compress || request.method === 'HEAD' || codings === null || res.statusCode === 204 || res.statusCode === 304) { - resolve(new Response(body, responseOptions)) - return - } - - // Be less strict when decoding compressed responses, since sometimes - // servers send slightly invalid responses that are still accepted - // by common browsers. - // Always using Z_SYNC_FLUSH is what cURL does. - const zlibOptions = { - flush: zlib.Z_SYNC_FLUSH, - finishFlush: zlib.Z_SYNC_FLUSH - } - - // for gzip - if (codings === 'gzip' || codings === 'x-gzip') { - body = body.pipe(zlib.createGunzip(zlibOptions)) - resolve(new Response(body, responseOptions)) - return - } - - // for deflate - if (codings === 'deflate' || codings === 'x-deflate') { - // handle the infamous raw deflate response from old servers - // a hack for old IIS and Apache servers - const raw = res.pipe(new PassThrough()) - raw.once('data', chunk => { - // see http://stackoverflow.com/questions/37519828 - if ((chunk[0] & 0x0F) === 0x08) { - body = body.pipe(zlib.createInflate(zlibOptions)) - } else { - body = body.pipe(zlib.createInflateRaw(zlibOptions)) - } - resolve(new Response(body, responseOptions)) - }) - return - } - - // otherwise, use response as-is - resolve(new Response(body, responseOptions)) - }) - - writeToStream(req, request) - }) -}; - -/** - * Redirect code matching - * - * @param Number code Status code - * @return Boolean - */ -fetch.isRedirect = code => code === 301 || code === 302 || code === 303 || code === 307 || code === 308 - -// expose Promise -fetch.Promise = global.Promise -exports.Headers = Headers -exports.Request = Request -exports.Response = Response -exports.FetchError = FetchError diff --git a/deps/npm/node_modules/node-fetch-npm/src/request.js b/deps/npm/node_modules/node-fetch-npm/src/request.js deleted file mode 100644 index 326dc4606fa57c..00000000000000 --- a/deps/npm/node_modules/node-fetch-npm/src/request.js +++ /dev/null @@ -1,174 +0,0 @@ -'use strict' - -/** - * request.js - * - * Request class contains server only options - */ - -const url = require('url') -const Headers = require('./headers.js') -const Body = require('./body.js') -const clone = Body.clone -const extractContentType = Body.extractContentType -const getTotalBytes = Body.getTotalBytes - -const PARSED_URL = Symbol('url') - -/** - * Request class - * - * @param Mixed input Url or Request instance - * @param Object init Custom options - * @return Void - */ -class Request { - constructor (input, init) { - if (!init) init = {} - let parsedURL - - // normalize input - if (!(input instanceof Request)) { - if (input && input.href) { - // in order to support Node.js' Url objects; though WHATWG's URL objects - // will fall into this branch also (since their `toString()` will return - // `href` property anyway) - parsedURL = url.parse(input.href) - } else { - // coerce input to a string before attempting to parse - parsedURL = url.parse(`${input}`) - } - input = {} - } else { - parsedURL = url.parse(input.url) - } - - let method = init.method || input.method || 'GET' - - if ((init.body != null || (input instanceof Request && input.body !== null)) && - (method === 'GET' || method === 'HEAD')) { - throw new TypeError('Request with GET/HEAD method cannot have body') - } - - let inputBody = init.body != null - ? init.body - : input instanceof Request && input.body !== null - ? clone(input) - : null - - Body.call(this, inputBody, { - timeout: init.timeout || input.timeout || 0, - size: init.size || input.size || 0 - }) - - // fetch spec options - this.method = method.toUpperCase() - this.redirect = init.redirect || input.redirect || 'follow' - this.headers = new Headers(init.headers || input.headers || {}) - - if (init.body != null) { - const contentType = extractContentType(this) - if (contentType !== null && !this.headers.has('Content-Type')) { - this.headers.append('Content-Type', contentType) - } - } - - // server only options - this.follow = init.follow !== undefined - ? init.follow : input.follow !== undefined - ? input.follow : 20 - this.compress = init.compress !== undefined - ? init.compress : input.compress !== undefined - ? input.compress : true - this.counter = init.counter || input.counter || 0 - this.agent = init.agent || input.agent - - this[PARSED_URL] = parsedURL - Object.defineProperty(this, Symbol.toStringTag, { - value: 'Request', - writable: false, - enumerable: false, - configurable: true - }) - } - - get url () { - return url.format(this[PARSED_URL]) - } - - /** - * Clone this request - * - * @return Request - */ - clone () { - return new Request(this) - } -} - -Body.mixIn(Request.prototype) - -Object.defineProperty(Request.prototype, Symbol.toStringTag, { - value: 'RequestPrototype', - writable: false, - enumerable: false, - configurable: true -}) - -exports = module.exports = Request - -exports.getNodeRequestOptions = function getNodeRequestOptions (request) { - const parsedURL = request[PARSED_URL] - const headers = new Headers(request.headers) - - // fetch step 3 - if (!headers.has('Accept')) { - headers.set('Accept', '*/*') - } - - // Basic fetch - if (!parsedURL.protocol || !parsedURL.hostname) { - throw new TypeError('Only absolute URLs are supported') - } - - if (!/^https?:$/.test(parsedURL.protocol)) { - throw new TypeError('Only HTTP(S) protocols are supported') - } - - // HTTP-network-or-cache fetch steps 5-9 - let contentLengthValue = null - if (request.body == null && /^(POST|PUT)$/i.test(request.method)) { - contentLengthValue = '0' - } - if (request.body != null) { - const totalBytes = getTotalBytes(request) - if (typeof totalBytes === 'number') { - contentLengthValue = String(totalBytes) - } - } - if (contentLengthValue) { - headers.set('Content-Length', contentLengthValue) - } - - // HTTP-network-or-cache fetch step 12 - if (!headers.has('User-Agent')) { - headers.set('User-Agent', 'node-fetch/1.0 (+https://github.com/bitinn/node-fetch)') - } - - // HTTP-network-or-cache fetch step 16 - if (request.compress) { - headers.set('Accept-Encoding', 'gzip,deflate') - } - if (!headers.has('Connection') && !request.agent) { - headers.set('Connection', 'close') - } - - // HTTP-network fetch step 4 - // chunked encoding is handled by Node.js - - return Object.assign({}, parsedURL, { - method: request.method, - headers: headers.raw(), - agent: request.agent - }) -} diff --git a/deps/npm/node_modules/node-fetch-npm/src/response.js b/deps/npm/node_modules/node-fetch-npm/src/response.js deleted file mode 100644 index 6fb050d74c78c2..00000000000000 --- a/deps/npm/node_modules/node-fetch-npm/src/response.js +++ /dev/null @@ -1,71 +0,0 @@ -'use strict' - -/** - * response.js - * - * Response class provides content decoding - */ - -const STATUS_CODES = require('http').STATUS_CODES -const Headers = require('./headers.js') -const Body = require('./body.js') -const clone = Body.clone - -/** - * Response class - * - * @param Stream body Readable stream - * @param Object opts Response options - * @return Void - */ -class Response { - constructor (body, opts) { - if (!opts) opts = {} - Body.call(this, body, opts) - - this.url = opts.url - this.status = opts.status || 200 - this.statusText = opts.statusText || STATUS_CODES[this.status] - - this.headers = new Headers(opts.headers) - - Object.defineProperty(this, Symbol.toStringTag, { - value: 'Response', - writable: false, - enumerable: false, - configurable: true - }) - } - - /** - * Convenience property representing if the request ended normally - */ - get ok () { - return this.status >= 200 && this.status < 300 - } - - /** - * Clone this response - * - * @return Response - */ - clone () { - return new Response(clone(this), { - url: this.url, - status: this.status, - statusText: this.statusText, - headers: this.headers, - ok: this.ok - }) - } -} - -Body.mixIn(Response.prototype) - -Object.defineProperty(Response.prototype, Symbol.toStringTag, { - value: 'ResponsePrototype', - writable: false, - enumerable: false, - configurable: true -}) -module.exports = Response diff --git a/deps/npm/node_modules/node-gyp/.github/ISSUE_TEMPLATE.md b/deps/npm/node_modules/node-gyp/.github/ISSUE_TEMPLATE.md index b5bed7fdd1ea61..485e26ecae8761 100644 --- a/deps/npm/node_modules/node-gyp/.github/ISSUE_TEMPLATE.md +++ b/deps/npm/node_modules/node-gyp/.github/ISSUE_TEMPLATE.md @@ -1,10 +1,16 @@ * **Node Version**: @@ -19,6 +25,22 @@ Paste your log here, between the backticks. It can be: - npm --verbose output, - or contents of npm-debug.log, - or output of node-gyp rebuild --verbose. +Include the command you were trying to run. + +This should look like this: + +>npm --verbose +npm info it worked if it ends with ok +npm verb cli [ +npm verb cli 'C:\\...\\node\\13.9.0\\x64\\node.exe', +npm verb cli 'C:\\...\\node\\13.9.0\\x64\\node_modules\\npm\\bin\\npm-cli.js', +npm verb cli '--verbose' +npm verb cli ] +npm info using npm@6.13.7 +npm info using node@v13.9.0 + +Usage: npm +(...) ``` diff --git a/deps/npm/node_modules/node-gyp/.github/workflows/Python_tests.yml b/deps/npm/node_modules/node-gyp/.github/workflows/Python_tests.yml index dba9d10933cbf9..067294515d175e 100644 --- a/deps/npm/node_modules/node-gyp/.github/workflows/Python_tests.yml +++ b/deps/npm/node_modules/node-gyp/.github/workflows/Python_tests.yml @@ -13,7 +13,7 @@ jobs: os: [macos-latest, ubuntu-latest, windows-latest] python-version: [2.7, 3.6, 3.7, 3.8] # 3.5, steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v1 with: diff --git a/deps/npm/node_modules/node-gyp/.travis.yml b/deps/npm/node_modules/node-gyp/.travis.yml index 22f7bc12fc349c..ae691bed480b90 100644 --- a/deps/npm/node_modules/node-gyp/.travis.yml +++ b/deps/npm/node_modules/node-gyp/.travis.yml @@ -13,18 +13,11 @@ jobs: env: NODE_GYP_FORCE_PYTHON=python2 python: 2.7 - - name: "Node.js 6 & Python 3.8 on Linux" - python: 3.8 - env: NODE_GYP_FORCE_PYTHON=python3 - before_install: nvm install 6 - - name: "Node.js 8 & Python 3.8 on Linux" - python: 3.8 - env: NODE_GYP_FORCE_PYTHON=python3 - before_install: nvm install 8 - name: "Node.js 10 & Python 3.8 on Linux" python: 3.8 env: NODE_GYP_FORCE_PYTHON=python3 before_install: nvm install 10 + - name: "Node.js 12 & Python 3.5 on Linux" python: 3.5 env: NODE_GYP_FORCE_PYTHON=python3 @@ -55,14 +48,6 @@ jobs: env: NODE_GYP_FORCE_PYTHON=python3 PATH=$HOME/.pyenv/shims:$PATH PYENV_VERSION=3.8.0 before_install: pyenv install $PYENV_VERSION - - name: "Node.js 6 & Python 2.7 on Windows" - os: windows - language: node_js - node_js: 6 # node - env: >- - PATH=/c/Python27:/c/Python27/Scripts:$PATH - NODE_GYP_FORCE_PYTHON=/c/Python27/python.exe - before_install: choco install python2 - name: "Node.js 12 & Python 2.7 on Windows" os: windows language: node_js diff --git a/deps/npm/node_modules/node-gyp/CHANGELOG.md b/deps/npm/node_modules/node-gyp/CHANGELOG.md index 5dc6bb4d47069b..2605d61fbeb6af 100644 --- a/deps/npm/node_modules/node-gyp/CHANGELOG.md +++ b/deps/npm/node_modules/node-gyp/CHANGELOG.md @@ -1,3 +1,104 @@ +v7.1.0 2020-08-12 +================= + +* [[`aaf33c3029`](https://github.com/nodejs/node-gyp/commit/aaf33c3029)] - **build**: add update-gyp script (Samuel Attard) [#2167](https://github.com/nodejs/node-gyp/pull/2167) +* * [[`3baa4e4172`](https://github.com/nodejs/node-gyp/commit/3baa4e4172)] - **(SEMVER-MINOR)** **gyp**: update gyp to 0.4.0 (Samuel Attard) [#2165](https://github.com/nodejs/node-gyp/pull/2165) +* * [[`f461d56c53`](https://github.com/nodejs/node-gyp/commit/f461d56c53)] - **(SEMVER-MINOR)** **build**: support apple silicon (arm64 darwin) builds (Samuel Attard) [#2165](https://github.com/nodejs/node-gyp/pull/2165) +* * [[`ee6fa7d3bc`](https://github.com/nodejs/node-gyp/commit/ee6fa7d3bc)] - **docs**: note that node-gyp@7 should solve Catalina CLT issues (Rod Vagg) [#2156](https://github.com/nodejs/node-gyp/pull/2156) +* * [[`4fc8ff179d`](https://github.com/nodejs/node-gyp/commit/4fc8ff179d)] - **doc**: silence curl for macOS Catalina acid test (Chia Wei Ong) [#2150](https://github.com/nodejs/node-gyp/pull/2150) +* * [[`7857cb2eb1`](https://github.com/nodejs/node-gyp/commit/7857cb2eb1)] - **deps**: increase "engines" to "node" : "\>= 10.12.0" (DeeDeeG) [#2153](https://github.com/nodejs/node-gyp/pull/2153) + +v7.0.0 2020-06-03 +================= + +* [[`e18a61afc1`](https://github.com/nodejs/node-gyp/commit/e18a61afc1)] - **build**: shrink bloated addon binaries on windows (Shelley Vohr) [#2060](https://github.com/nodejs/node-gyp/pull/2060) +* [[`4937722cf5`](https://github.com/nodejs/node-gyp/commit/4937722cf5)] - **(SEMVER-MAJOR)** **deps**: replace mkdirp with {recursive} mkdir (Rod Vagg) [#2123](https://github.com/nodejs/node-gyp/pull/2123) +* [[`d45438a047`](https://github.com/nodejs/node-gyp/commit/d45438a047)] - **(SEMVER-MAJOR)** **deps**: update deps, match to npm@7 (Rod Vagg) [#2126](https://github.com/nodejs/node-gyp/pull/2126) +* [[`ba4f34b7d6`](https://github.com/nodejs/node-gyp/commit/ba4f34b7d6)] - **doc**: update catalina xcode clt download link (Dario Vladovic) [#2133](https://github.com/nodejs/node-gyp/pull/2133) +* [[`f7bfce96ed`](https://github.com/nodejs/node-gyp/commit/f7bfce96ed)] - **doc**: update acid test and introduce curl|bash test script (Dario Vladovic) [#2105](https://github.com/nodejs/node-gyp/pull/2105) +* [[`e529f3309d`](https://github.com/nodejs/node-gyp/commit/e529f3309d)] - **doc**: update README to reflect upgrade to gyp-next (Ujjwal Sharma) [#2092](https://github.com/nodejs/node-gyp/pull/2092) +* [[`9aed6286a3`](https://github.com/nodejs/node-gyp/commit/9aed6286a3)] - **doc**: give more attention to Catalina issues doc (Matheus Marchini) [#2134](https://github.com/nodejs/node-gyp/pull/2134) +* [[`963f2a7b48`](https://github.com/nodejs/node-gyp/commit/963f2a7b48)] - **doc**: improve cataline discoverability for search engines (Matheus Marchini) [#2135](https://github.com/nodejs/node-gyp/pull/2135) +* [[`7b75af349b`](https://github.com/nodejs/node-gyp/commit/7b75af349b)] - **doc**: add macOS Catalina software update info (Karl Horky) [#2078](https://github.com/nodejs/node-gyp/pull/2078) +* [[`4f23c7bee2`](https://github.com/nodejs/node-gyp/commit/4f23c7bee2)] - **doc**: update link to the code of conduct (#2073) (Michaël Zasso) [#2073](https://github.com/nodejs/node-gyp/pull/2073) +* [[`473cfa283f`](https://github.com/nodejs/node-gyp/commit/473cfa283f)] - **doc**: note in README that Python 3.8 is supported (#2072) (Michaël Zasso) [#2072](https://github.com/nodejs/node-gyp/pull/2072) +* [[`e7402b4a7c`](https://github.com/nodejs/node-gyp/commit/e7402b4a7c)] - **doc**: update catalina xcode cli tools download link (#2044) (Dario Vladović) [#2044](https://github.com/nodejs/node-gyp/pull/2044) +* [[`35de45984f`](https://github.com/nodejs/node-gyp/commit/35de45984f)] - **doc**: update catalina xcode cli tools download link; formatting (Jonathan Hult) [#2034](https://github.com/nodejs/node-gyp/pull/2034) +* [[`48642191f5`](https://github.com/nodejs/node-gyp/commit/48642191f5)] - **doc**: add download link for Command Line Tools for Xcode (Przemysław Bitkowski) [#2029](https://github.com/nodejs/node-gyp/pull/2029) +* [[`ae5b150051`](https://github.com/nodejs/node-gyp/commit/ae5b150051)] - **doc**: Catalina suggestion: remove /Library/Developer/CommandLineTools (Christian Clauss) [#2022](https://github.com/nodejs/node-gyp/pull/2022) +* [[`d1dea13fe4`](https://github.com/nodejs/node-gyp/commit/d1dea13fe4)] - **doc**: fix changelog 6.1.0 release year to be 2020 (Quentin Vernot) [#2021](https://github.com/nodejs/node-gyp/pull/2021) +* [[`6356117b08`](https://github.com/nodejs/node-gyp/commit/6356117b08)] - **doc, bin**: stop suggesting opening node-gyp issues (Bartosz Sosnowski) [#2096](https://github.com/nodejs/node-gyp/pull/2096) +* [[`a6b76a8b48`](https://github.com/nodejs/node-gyp/commit/a6b76a8b48)] - **gyp**: update gyp to 0.2.1 (Ujjwal Sharma) [#2092](https://github.com/nodejs/node-gyp/pull/2092) +* [[`ebc34ec823`](https://github.com/nodejs/node-gyp/commit/ebc34ec823)] - **gyp**: update gyp to 0.2.0 (Ujjwal Sharma) [#2092](https://github.com/nodejs/node-gyp/pull/2092) +* [[`972780bde7`](https://github.com/nodejs/node-gyp/commit/972780bde7)] - **(SEMVER-MAJOR)** **gyp**: sync code base with nodejs repo (#1975) (Michaël Zasso) [#1975](https://github.com/nodejs/node-gyp/pull/1975) +* [[`c255ffbf6a`](https://github.com/nodejs/node-gyp/commit/c255ffbf6a)] - **lib**: drop "-2" flag for "py.exe" launcher (DeeDeeG) [#2131](https://github.com/nodejs/node-gyp/pull/2131) +* [[`1f7e1e93b5`](https://github.com/nodejs/node-gyp/commit/1f7e1e93b5)] - **lib**: ignore VS instances that cause COMExceptions (Andrew Casey) [#2018](https://github.com/nodejs/node-gyp/pull/2018) +* [[`741ab096d5`](https://github.com/nodejs/node-gyp/commit/741ab096d5)] - **test**: remove support for EOL versions of Node.js (Shelley Vohr) +* [[`ca86ef2539`](https://github.com/nodejs/node-gyp/commit/ca86ef2539)] - **test**: bump actions/checkout from v1 to v2 (BSKY) [#2063](https://github.com/nodejs/node-gyp/pull/2063) + +v6.1.0 2020-01-08 +================= + +* [[`9a7dd16b76`](https://github.com/nodejs/node-gyp/commit/9a7dd16b76)] - **doc**: remove backticks from Python version list (Rod Vagg) [#2011](https://github.com/nodejs/node-gyp/pull/2011) +* [[`26cd6eaea6`](https://github.com/nodejs/node-gyp/commit/26cd6eaea6)] - **doc**: add GitHub Actions badge (#1994) (Rod Vagg) [#1994](https://github.com/nodejs/node-gyp/pull/1994) +* [[`312c12ef4f`](https://github.com/nodejs/node-gyp/commit/312c12ef4f)] - **doc**: update macOS\_Catalina.md (#1992) (James Home) [#1992](https://github.com/nodejs/node-gyp/pull/1992) +* [[`f7b6b6b77b`](https://github.com/nodejs/node-gyp/commit/f7b6b6b77b)] - **doc**: fix typo in README.md (#1985) (Suraneti Rodsuwan) [#1985](https://github.com/nodejs/node-gyp/pull/1985) +* [[`6b8f2652dd`](https://github.com/nodejs/node-gyp/commit/6b8f2652dd)] - **doc**: add travis badge (Rod Vagg) [#1971](https://github.com/nodejs/node-gyp/pull/1971) +* [[`20aa0b44f7`](https://github.com/nodejs/node-gyp/commit/20aa0b44f7)] - **doc**: macOS Catalina add two commands (Christian Clauss) [#1962](https://github.com/nodejs/node-gyp/pull/1962) +* [[`14f2a07a39`](https://github.com/nodejs/node-gyp/commit/14f2a07a39)] - **gyp**: list(dict) so we can del dict(key) while iterating (Christian Clauss) [#2009](https://github.com/nodejs/node-gyp/pull/2009) +* [[`f242ce4d2c`](https://github.com/nodejs/node-gyp/commit/f242ce4d2c)] - **lib**: compatibility with semver ≥ 7 (`new` for semver.Range) (Xavier Guimard) [#2006](https://github.com/nodejs/node-gyp/pull/2006) +* [[`3bcba2a01a`](https://github.com/nodejs/node-gyp/commit/3bcba2a01a)] - **(SEMVER-MINOR)** **lib**: noproxy support, match proxy detection to `request` (Matias Lopez) [#1978](https://github.com/nodejs/node-gyp/pull/1978) +* [[`470cc2178e`](https://github.com/nodejs/node-gyp/commit/470cc2178e)] - **test**: remove old docker test harness (#1993) (Rod Vagg) [#1993](https://github.com/nodejs/node-gyp/pull/1993) +* [[`31ecc8421d`](https://github.com/nodejs/node-gyp/commit/31ecc8421d)] - **test**: add Windows to GitHub Actions testing (#1996) (Christian Clauss) [#1996](https://github.com/nodejs/node-gyp/pull/1996) +* [[`5a729e86ee`](https://github.com/nodejs/node-gyp/commit/5a729e86ee)] - **test**: fix typo in header download test (#2001) (Richard Lau) [#2001](https://github.com/nodejs/node-gyp/pull/2001) +* [[`345c70e56d`](https://github.com/nodejs/node-gyp/commit/345c70e56d)] - **test**: direct python invocation & simpler pyenv (Matias Lopez) [#1979](https://github.com/nodejs/node-gyp/pull/1979) +* [[`d6a7e0e1fb`](https://github.com/nodejs/node-gyp/commit/d6a7e0e1fb)] - **test**: fix macOS Travis on Python 2.7 & 3.7 (Christian Clauss) [#1979](https://github.com/nodejs/node-gyp/pull/1979) +* [[`5a64e9bd32`](https://github.com/nodejs/node-gyp/commit/5a64e9bd32)] - **test**: initial Github Actions with Ubuntu & macOS (Christian Clauss) [#1985](https://github.com/nodejs/node-gyp/pull/1985) +* [[`04da736d38`](https://github.com/nodejs/node-gyp/commit/04da736d38)] - **test**: fix Python unittests (cclauss) [#1961](https://github.com/nodejs/node-gyp/pull/1961) +* [[`0670e5189d`](https://github.com/nodejs/node-gyp/commit/0670e5189d)] - **test**: add header download test (Rod Vagg) [#1796](https://github.com/nodejs/node-gyp/pull/1796) +* [[`c506a6a150`](https://github.com/nodejs/node-gyp/commit/c506a6a150)] - **test**: configure proper devDir for invoking configure() (Rod Vagg) [#1796](https://github.com/nodejs/node-gyp/pull/1796) + +v6.0.1 2019-11-01 +================= + +* [[`8ec2e681d5`](https://github.com/nodejs/node-gyp/commit/8ec2e681d5)] - **doc**: add macOS\_Catalina.md document (cclauss) [#1940](https://github.com/nodejs/node-gyp/pull/1940) +* [[`1b11be63cc`](https://github.com/nodejs/node-gyp/commit/1b11be63cc)] - **gyp**: python3 fixes: utf8 decode, use of 'None' in eval (Wilfried Goesgens) [#1925](https://github.com/nodejs/node-gyp/pull/1925) +* [[`c0282daa48`](https://github.com/nodejs/node-gyp/commit/c0282daa48)] - **gyp**: iteritems() -\> items() in compile\_commands\_json.py (cclauss) [#1947](https://github.com/nodejs/node-gyp/pull/1947) +* [[`d8e09a1b6a`](https://github.com/nodejs/node-gyp/commit/d8e09a1b6a)] - **gyp**: make cmake python3 compatible (gengjiawen) [#1944](https://github.com/nodejs/node-gyp/pull/1944) +* [[`9c0f3404f0`](https://github.com/nodejs/node-gyp/commit/9c0f3404f0)] - **gyp**: fix TypeError in XcodeVersion() (Christian Clauss) [#1939](https://github.com/nodejs/node-gyp/pull/1939) +* [[`bb2eb72a3f`](https://github.com/nodejs/node-gyp/commit/bb2eb72a3f)] - **gyp**: finish decode stdout on Python 3 (Christian Clauss) [#1937](https://github.com/nodejs/node-gyp/pull/1937) +* [[`f0693413d9`](https://github.com/nodejs/node-gyp/commit/f0693413d9)] - **src,win**: allow 403 errors for arm64 node.lib (Richard Lau) [#1934](https://github.com/nodejs/node-gyp/pull/1934) +* [[`c60c22de58`](https://github.com/nodejs/node-gyp/commit/c60c22de58)] - **deps**: update deps to roughly match current npm@6 (Rod Vagg) [#1920](https://github.com/nodejs/node-gyp/pull/1920) +* [[`b91718eefc`](https://github.com/nodejs/node-gyp/commit/b91718eefc)] - **test**: upgrade Linux Travis CI to Python 3.8 (Christian Clauss) [#1923](https://github.com/nodejs/node-gyp/pull/1923) +* [[`3538a317b6`](https://github.com/nodejs/node-gyp/commit/3538a317b6)] - **doc**: adjustments to the README.md for new users (Dan Pike) [#1919](https://github.com/nodejs/node-gyp/pull/1919) +* [[`4fff8458c0`](https://github.com/nodejs/node-gyp/commit/4fff8458c0)] - **travis**: ignore failed `brew upgrade npm`, update xcode (Christian Clauss) [#1932](https://github.com/nodejs/node-gyp/pull/1932) +* [[`60e4488f08`](https://github.com/nodejs/node-gyp/commit/60e4488f08)] - **build**: avoid bare exceptions in xcode\_emulation.py (Christian Clauss) [#1932](https://github.com/nodejs/node-gyp/pull/1932) +* [[`032db2a2d0`](https://github.com/nodejs/node-gyp/commit/032db2a2d0)] - **lib,install**: always download SHA sums on Windows (Sam Hughes) [#1926](https://github.com/nodejs/node-gyp/pull/1926) +* [[`5a83630c33`](https://github.com/nodejs/node-gyp/commit/5a83630c33)] - **travis**: add Windows + Python 3.8 to the mix (Rod Vagg) [#1921](https://github.com/nodejs/node-gyp/pull/1921) + +v6.0.0 2019-10-04 +================= + +* [[`dd0e97ef0b`](https://github.com/nodejs/node-gyp/commit/dd0e97ef0b)] - **(SEMVER-MAJOR)** **lib**: try to find `python` after `python3` (Sam Roberts) [#1907](https://github.com/nodejs/node-gyp/pull/1907) +* [[`f60ed47d14`](https://github.com/nodejs/node-gyp/commit/f60ed47d14)] - **travis**: add Python 3.5 and 3.6 tests on Linux (Christian Clauss) [#1903](https://github.com/nodejs/node-gyp/pull/1903) +* [[`c763ca1838`](https://github.com/nodejs/node-gyp/commit/c763ca1838)] - **(SEMVER-MAJOR)** **doc**: Declare that node-gyp is Python 3 compatible (cclauss) [#1811](https://github.com/nodejs/node-gyp/pull/1811) +* [[`3d1c60ab81`](https://github.com/nodejs/node-gyp/commit/3d1c60ab81)] - **(SEMVER-MAJOR)** **lib**: accept Python 3 by default (João Reis) [#1844](https://github.com/nodejs/node-gyp/pull/1844) +* [[`c6e3b65a23`](https://github.com/nodejs/node-gyp/commit/c6e3b65a23)] - **(SEMVER-MAJOR)** **lib**: raise the minimum Python version from 2.6 to 2.7 (cclauss) [#1818](https://github.com/nodejs/node-gyp/pull/1818) + +v5.1.1 2020-05-25 +================= + +* [[`bdd3a79abe`](https://github.com/nodejs/node-gyp/commit/bdd3a79abe)] - **build**: shrink bloated addon binaries on windows (Shelley Vohr) [#2060](https://github.com/nodejs/node-gyp/pull/2060) +* [[`1f2ba75bc0`](https://github.com/nodejs/node-gyp/commit/1f2ba75bc0)] - **doc**: add macOS Catalina software update info (Karl Horky) [#2078](https://github.com/nodejs/node-gyp/pull/2078) +* [[`c106d915f5`](https://github.com/nodejs/node-gyp/commit/c106d915f5)] - **doc**: update catalina xcode cli tools download link (#2044) (Dario Vladović) [#2044](https://github.com/nodejs/node-gyp/pull/2044) +* [[`9a6fea92e2`](https://github.com/nodejs/node-gyp/commit/9a6fea92e2)] - **doc**: update catalina xcode cli tools download link; formatting (Jonathan Hult) [#2034](https://github.com/nodejs/node-gyp/pull/2034) +* [[`59b0b1add8`](https://github.com/nodejs/node-gyp/commit/59b0b1add8)] - **doc**: add download link for Command Line Tools for Xcode (Przemysław Bitkowski) [#2029](https://github.com/nodejs/node-gyp/pull/2029) +* [[`bb8d0e7b10`](https://github.com/nodejs/node-gyp/commit/bb8d0e7b10)] - **doc**: Catalina suggestion: remove /Library/Developer/CommandLineTools (Christian Clauss) [#2022](https://github.com/nodejs/node-gyp/pull/2022) +* [[`fb2e80d4e3`](https://github.com/nodejs/node-gyp/commit/fb2e80d4e3)] - **doc**: update link to the code of conduct (#2073) (Michaël Zasso) [#2073](https://github.com/nodejs/node-gyp/pull/2073) +* [[`251d9c885c`](https://github.com/nodejs/node-gyp/commit/251d9c885c)] - **doc**: note in README that Python 3.8 is supported (#2072) (Michaël Zasso) [#2072](https://github.com/nodejs/node-gyp/pull/2072) +* [[`2b6fc3c8d6`](https://github.com/nodejs/node-gyp/commit/2b6fc3c8d6)] - **doc, bin**: stop suggesting opening node-gyp issues (Bartosz Sosnowski) [#2096](https://github.com/nodejs/node-gyp/pull/2096) +* [[`a876ae58ad`](https://github.com/nodejs/node-gyp/commit/a876ae58ad)] - **test**: bump actions/checkout from v1 to v2 (BSKY) [#2063](https://github.com/nodejs/node-gyp/pull/2063) + v5.1.0 2020-02-05 ================= diff --git a/deps/npm/node_modules/node-gyp/CONTRIBUTING.md b/deps/npm/node_modules/node-gyp/CONTRIBUTING.md new file mode 100644 index 00000000000000..c1c50eab4e58b7 --- /dev/null +++ b/deps/npm/node_modules/node-gyp/CONTRIBUTING.md @@ -0,0 +1,34 @@ +# Contributing to node-gyp + +## Code of Conduct + +Please read the +[Code of Conduct](https://github.com/nodejs/admin/blob/master/CODE_OF_CONDUCT.md) +which explains the minimum behavior expectations for node-gyp contributors. + + +## Developer's Certificate of Origin 1.1 + +By making a contribution to this project, I certify that: + +* (a) The contribution was created in whole or in part by me and I + have the right to submit it under the open source license + indicated in the file; or + +* (b) The contribution is based upon previous work that, to the best + of my knowledge, is covered under an appropriate open source + license and I have the right under that license to submit that + work with modifications, whether created in whole or in part + by me, under the same open source license (unless I am + permitted to submit under a different license), as indicated + in the file; or + +* (c) The contribution was provided directly to me by some other + person who certified (a), (b) or (c) and I have not modified + it. + +* (d) I understand and agree that this project and the contribution + are public and that a record of the contribution (including all + personal information I submit with it, including my sign-off) is + maintained indefinitely and may be redistributed consistent with + this project or the open source license(s) involved. diff --git a/deps/npm/node_modules/node-gyp/README.md b/deps/npm/node_modules/node-gyp/README.md index 79abf4ba71fe3d..fd7e6a117c157a 100644 --- a/deps/npm/node_modules/node-gyp/README.md +++ b/deps/npm/node_modules/node-gyp/README.md @@ -4,9 +4,9 @@ [![Build Status](https://github.com/nodejs/node-gyp/workflows/Python_tests/badge.svg)](https://github.com/nodejs/node-gyp/actions?workflow=Python_tests) `node-gyp` is a cross-platform command-line tool written in Node.js for -compiling native addon modules for Node.js. It contains a fork of the -[gyp](https://gyp.gsrc.io) project that was previously used by the Chromium -team, extended to support the development of Node.js native addons. +compiling native addon modules for Node.js. It contains a vendored copy of the +[gyp-next](https://github.com/nodejs/gyp-next) project that was previously used +by the Chromium team, extended to support the development of Node.js native addons. Note that `node-gyp` is _not_ used to build Node.js itself. @@ -31,16 +31,17 @@ Depending on your operating system, you will need to install: ### On Unix - * Python v2.7, v3.5, v3.6, or v3.7 + * Python v2.7, v3.5, v3.6, v3.7, or v3.8 * `make` * A proper C/C++ compiler toolchain, like [GCC](https://gcc.gnu.org) ### On macOS - * Python v2.7, v3.5, v3.6, or v3.7 +**ATTENTION**: If your Mac has been _upgraded_ to macOS Catalina (10.15), please read [macOS_Catalina.md](macOS_Catalina.md). + + * Python v2.7, v3.5, v3.6, v3.7, or v3.8 * [Xcode](https://developer.apple.com/xcode/download/) * You also need to install the `XCode Command Line Tools` by running `xcode-select --install`. Alternatively, if you already have the full Xcode installed, you can find them under the menu `Xcode -> Open Developer Tool -> More Developer Tools...`. This step will install `clang`, `clang++`, and `make`. - * If your Mac has been _upgraded_ to macOS Catalina (10.15), please read [macOS_Catalina.md](macOS_Catalina.md). ### On Windows @@ -65,7 +66,7 @@ Install tools and configuration manually: ### Configuring Python Dependency `node-gyp` requires that you have installed a compatible version of Python, one of: v2.7, v3.5, v3.6, -or v3.7. If you have multiple Python versions installed, you can identify which Python +v3.7, or v3.8. If you have multiple Python versions installed, you can identify which Python version `node-gyp` should use in one of the following ways: 1. by setting the `--python` command-line option, e.g.: diff --git a/deps/npm/node_modules/node-gyp/addon.gypi b/deps/npm/node_modules/node-gyp/addon.gypi index 6462f539ffb725..9327b0d722e74a 100644 --- a/deps/npm/node_modules/node-gyp/addon.gypi +++ b/deps/npm/node_modules/node-gyp/addon.gypi @@ -1,7 +1,8 @@ { 'variables' : { 'node_engine_include_dir%': 'deps/v8/include', - 'node_host_binary%': 'node' + 'node_host_binary%': 'node', + 'node_with_ltcg%': 'true', }, 'target_defaults': { 'type': 'loadable_module', @@ -126,6 +127,26 @@ 'library_dirs': [ '<(node_root_dir)/$(ConfigurationName)' ], 'libraries': [ '<@(node_engine_libs)' ], }], + ['node_with_ltcg=="true"', { + 'msvs_settings': { + 'VCCLCompilerTool': { + 'WholeProgramOptimization': 'true' # /GL, whole program optimization, needed for LTCG + }, + 'VCLibrarianTool': { + 'AdditionalOptions': [ + '/LTCG:INCREMENTAL', # incremental link-time code generation + ] + }, + 'VCLinkerTool': { + 'OptimizeReferences': 2, # /OPT:REF + 'EnableCOMDATFolding': 2, # /OPT:ICF + 'LinkIncremental': 1, # disable incremental linking + 'AdditionalOptions': [ + '/LTCG:INCREMENTAL', # incremental link-time code generation + ] + } + } + }] ], 'libraries': [ '-lkernel32.lib', diff --git a/deps/npm/node_modules/node-gyp/bin/node-gyp.js b/deps/npm/node_modules/node-gyp/bin/node-gyp.js index 49b5721d02d89c..8652ea21eceebb 100755 --- a/deps/npm/node_modules/node-gyp/bin/node-gyp.js +++ b/deps/npm/node_modules/node-gyp/bin/node-gyp.js @@ -131,9 +131,8 @@ function errorMessage () { function issueMessage () { errorMessage() - log.error('', ['This is a bug in `node-gyp`.', - 'Try to update node-gyp and file an Issue if it does not help:', - ' ' + log.error('', ['Node-gyp failed to build your package.', + 'Try to update npm and/or node-gyp and if it does not help file an issue with the package author.' ].join('\n')) } diff --git a/deps/npm/node_modules/node-gyp/gyp/.flake8 b/deps/npm/node_modules/node-gyp/gyp/.flake8 new file mode 100644 index 00000000000000..139e952e7d32fa --- /dev/null +++ b/deps/npm/node_modules/node-gyp/gyp/.flake8 @@ -0,0 +1,4 @@ +[flake8] +max-complexity = 10 +max-line-length = 88 +extend-ignore = E203,C901,E501 diff --git a/deps/npm/node_modules/node-gyp/gyp/.github/workflows/Python_tests.yml b/deps/npm/node_modules/node-gyp/gyp/.github/workflows/Python_tests.yml new file mode 100644 index 00000000000000..a93b92f426acf9 --- /dev/null +++ b/deps/npm/node_modules/node-gyp/gyp/.github/workflows/Python_tests.yml @@ -0,0 +1,31 @@ +# TODO: Enable os: windows-latest +# TODO: Enable python-version: 3.5 +# TODO: Enable pytest --doctest-modules + +name: Python_tests +on: [push, pull_request] +jobs: + Python_tests: + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + max-parallel: 15 + matrix: + os: [macos-latest, ubuntu-latest] # , windows-latest] + python-version: [2.7, 3.6, 3.7, 3.8] # 3.5, + steps: + - uses: actions/checkout@v2 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install -r requirements_dev.txt + - name: Lint with flake8 + run: flake8 . --count --show-source --statistics + - name: Test with pytest + run: pytest + # - name: Run doctests with pytest + # run: pytest --doctest-modules diff --git a/deps/npm/node_modules/node-gyp/gyp/.github/workflows/nodejs-windows.yml b/deps/npm/node_modules/node-gyp/gyp/.github/workflows/nodejs-windows.yml new file mode 100644 index 00000000000000..48a42372c2f0b0 --- /dev/null +++ b/deps/npm/node_modules/node-gyp/gyp/.github/workflows/nodejs-windows.yml @@ -0,0 +1,27 @@ +name: Node.js Windows integration + +on: [push, pull_request] + +jobs: + build-windows: + runs-on: windows-latest + steps: + - name: Clone node-gyp + uses: actions/checkout@v2 + with: + path: gyp-next + - name: Clone nodejs/node + uses: actions/checkout@v2 + with: + repository: nodejs/node + path: node + - name: Install deps + run: choco install nasm + - name: Replace gyp in Node.js + run: | + rm -Recurse node/tools/gyp + cp -Recurse gyp-next node/tools/gyp + - name: Build Node.js + run: | + cd node + ./vcbuild.bat diff --git a/deps/npm/node_modules/node-gyp/gyp/AUTHORS b/deps/npm/node_modules/node-gyp/gyp/AUTHORS index d76d8cd7683f29..f49a357b9ed104 100644 --- a/deps/npm/node_modules/node-gyp/gyp/AUTHORS +++ b/deps/npm/node_modules/node-gyp/gyp/AUTHORS @@ -11,3 +11,6 @@ Ryan Norton David J. Sankel Eric N. Vander Weele Tom Freudenberg +Julien Brianceau +Refael Ackermann +Ujjwal Sharma diff --git a/deps/npm/node_modules/node-gyp/gyp/CHANGELOG.md b/deps/npm/node_modules/node-gyp/gyp/CHANGELOG.md new file mode 100644 index 00000000000000..8cbcdd3b727894 --- /dev/null +++ b/deps/npm/node_modules/node-gyp/gyp/CHANGELOG.md @@ -0,0 +1,41 @@ +# 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/). + +## [Unreleased] + +## [0.4.0] - 2020-07-14 + +### Added +- Added support for passing arbitrary architectures to Xcode builds, enables `arm64` builds. + +### Fixed +- Fixed a bug on Solaris where copying archives failed. + +## [0.3.0] - 2020-06-06 + +### Added +- Added support for MSVC cross-compilation. This allows compilation on x64 for + a Windows ARM target. + +### Fixed +- Fixed XCode CLT version detection on macOS Catalina. + +## [0.2.1] - 2020-05-05 + +### Fixed +- Relicensed to Node.js contributors. +- Fixed Windows bug introduced in v0.2.0. + +## [0.2.0] - 2020-04-06 + +This is the first release of this project, based on https://chromium.googlesource.com/external/gyp +with changes made over the years in Node.js and node-gyp. + +[Unreleased]: https://github.com/nodejs/gyp-next/compare/v0.4.0...HEAD +[0.4.0]: https://github.com/nodejs/gyp-next/compare/v0.3.0...v0.4.0 +[0.3.0]: https://github.com/nodejs/gyp-next/compare/v0.2.1...v0.3.0 +[0.2.1]: https://github.com/nodejs/gyp-next/compare/v0.2.0...v0.2.1 +[0.2.0]: https://github.com/nodejs/gyp-next/releases/tag/v0.2.0 diff --git a/deps/npm/node_modules/node-gyp/gyp/CODE_OF_CONDUCT.md b/deps/npm/node_modules/node-gyp/gyp/CODE_OF_CONDUCT.md new file mode 100644 index 00000000000000..4c211405596cb4 --- /dev/null +++ b/deps/npm/node_modules/node-gyp/gyp/CODE_OF_CONDUCT.md @@ -0,0 +1,4 @@ +# Code of Conduct + +* [Node.js Code of Conduct](https://github.com/nodejs/admin/blob/master/CODE_OF_CONDUCT.md) +* [Node.js Moderation Policy](https://github.com/nodejs/admin/blob/master/Moderation-Policy.md) diff --git a/deps/npm/node_modules/node-gyp/gyp/CONTRIBUTING.md b/deps/npm/node_modules/node-gyp/gyp/CONTRIBUTING.md new file mode 100644 index 00000000000000..f9dd574a47cd9d --- /dev/null +++ b/deps/npm/node_modules/node-gyp/gyp/CONTRIBUTING.md @@ -0,0 +1,32 @@ +# Contributing to gyp-next + +## Code of Conduct + +This project is bound to the [Node.js Code of Conduct](https://github.com/nodejs/admin/blob/master/CODE_OF_CONDUCT.md). + + +## Developer's Certificate of Origin 1.1 + +By making a contribution to this project, I certify that: + +* (a) The contribution was created in whole or in part by me and I + have the right to submit it under the open source license + indicated in the file; or + +* (b) The contribution is based upon previous work that, to the best + of my knowledge, is covered under an appropriate open source + license and I have the right under that license to submit that + work with modifications, whether created in whole or in part + by me, under the same open source license (unless I am + permitted to submit under a different license), as indicated + in the file; or + +* (c) The contribution was provided directly to me by some other + person who certified (a), (b) or (c) and I have not modified + it. + +* (d) I understand and agree that this project and the contribution + are public and that a record of the contribution (including all + personal information I submit with it, including my sign-off) is + maintained indefinitely and may be redistributed consistent with + this project or the open source license(s) involved. diff --git a/deps/npm/node_modules/node-gyp/gyp/DEPS b/deps/npm/node_modules/node-gyp/gyp/DEPS deleted file mode 100644 index 2e1120f274687d..00000000000000 --- a/deps/npm/node_modules/node-gyp/gyp/DEPS +++ /dev/null @@ -1,24 +0,0 @@ -# DEPS file for gclient use in buildbot execution of gyp tests. -# -# (You don't need to use gclient for normal GYP development work.) - -vars = { - "chrome_trunk": "http://src.chromium.org/svn/trunk", - "googlecode_url": "http://%s.googlecode.com/svn", -} - -deps = { -} - -deps_os = { - "win": { - "third_party/cygwin": - Var("chrome_trunk") + "/deps/third_party/cygwin@66844", - - "third_party/python_26": - Var("chrome_trunk") + "/tools/third_party/python_26@89111", - - "src/third_party/pefile": - (Var("googlecode_url") % "pefile") + "/trunk@63", - }, -} diff --git a/deps/npm/node_modules/node-gyp/gyp/LICENSE b/deps/npm/node_modules/node-gyp/gyp/LICENSE index ab6b011a109335..c6944c5e4ed488 100644 --- a/deps/npm/node_modules/node-gyp/gyp/LICENSE +++ b/deps/npm/node_modules/node-gyp/gyp/LICENSE @@ -1,3 +1,4 @@ +Copyright (c) 2020 Node.js contributors. All rights reserved. Copyright (c) 2009 Google Inc. All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/deps/npm/node_modules/node-gyp/gyp/OWNERS b/deps/npm/node_modules/node-gyp/gyp/OWNERS deleted file mode 100644 index 72e8ffc0db8aad..00000000000000 --- a/deps/npm/node_modules/node-gyp/gyp/OWNERS +++ /dev/null @@ -1 +0,0 @@ -* diff --git a/deps/npm/node_modules/node-gyp/gyp/PRESUBMIT.py b/deps/npm/node_modules/node-gyp/gyp/PRESUBMIT.py deleted file mode 100644 index e52f9d2d22d607..00000000000000 --- a/deps/npm/node_modules/node-gyp/gyp/PRESUBMIT.py +++ /dev/null @@ -1,138 +0,0 @@ -# Copyright (c) 2012 Google Inc. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - - -"""Top-level presubmit script for GYP. - -See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts -for more details about the presubmit API built into gcl. -""" - - -PYLINT_BLACKLIST = [ - # TODO: fix me. - # From SCons, not done in google style. - 'test/lib/TestCmd.py', - 'test/lib/TestCommon.py', - 'test/lib/TestGyp.py', -] - - -PYLINT_DISABLED_WARNINGS = [ - # TODO: fix me. - # Many tests include modules they don't use. - 'W0611', - # Possible unbalanced tuple unpacking with sequence. - 'W0632', - # Attempting to unpack a non-sequence. - 'W0633', - # Include order doesn't properly include local files? - 'F0401', - # Some use of built-in names. - 'W0622', - # Some unused variables. - 'W0612', - # Operator not preceded/followed by space. - 'C0323', - 'C0322', - # Unnecessary semicolon. - 'W0301', - # Unused argument. - 'W0613', - # String has no effect (docstring in wrong place). - 'W0105', - # map/filter on lambda could be replaced by comprehension. - 'W0110', - # Use of eval. - 'W0123', - # Comma not followed by space. - 'C0324', - # Access to a protected member. - 'W0212', - # Bad indent. - 'W0311', - # Line too long. - 'C0301', - # Undefined variable. - 'E0602', - # Not exception type specified. - 'W0702', - # No member of that name. - 'E1101', - # Dangerous default {}. - 'W0102', - # Cyclic import. - 'R0401', - # Others, too many to sort. - 'W0201', 'W0232', 'E1103', 'W0621', 'W0108', 'W0223', 'W0231', - 'R0201', 'E0101', 'C0321', - # ************* Module copy - # W0104:427,12:_test.odict.__setitem__: Statement seems to have no effect - 'W0104', -] - - -def _LicenseHeader(input_api): - # Accept any year number from 2009 to the current year. - current_year = int(input_api.time.strftime('%Y')) - allowed_years = (str(s) for s in reversed(range(2009, current_year + 1))) - years_re = '(' + '|'.join(allowed_years) + ')' - - # The (c) is deprecated, but tolerate it until it's removed from all files. - return ( - r'.*? Copyright (\(c\) )?%(year)s Google Inc\. All rights reserved\.\n' - r'.*? Use of this source code is governed by a BSD-style license that ' - r'can be\n' - r'.*? found in the LICENSE file\.\n' - ) % { - 'year': years_re, - } - -def CheckChangeOnUpload(input_api, output_api): - report = [] - report.extend(input_api.canned_checks.PanProjectChecks( - input_api, output_api, license_header=_LicenseHeader(input_api))) - return report - - -def CheckChangeOnCommit(input_api, output_api): - report = [] - - report.extend(input_api.canned_checks.PanProjectChecks( - input_api, output_api, license_header=_LicenseHeader(input_api))) - report.extend(input_api.canned_checks.CheckTreeIsOpen( - input_api, output_api, - 'http://gyp-status.appspot.com/status', - 'http://gyp-status.appspot.com/current')) - - import os - import sys - old_sys_path = sys.path - try: - sys.path = ['pylib', 'test/lib'] + sys.path - blacklist = PYLINT_BLACKLIST - if sys.platform == 'win32': - blacklist = [os.path.normpath(x).replace('\\', '\\\\') - for x in PYLINT_BLACKLIST] - report.extend(input_api.canned_checks.RunPylint( - input_api, - output_api, - black_list=blacklist, - disabled_warnings=PYLINT_DISABLED_WARNINGS)) - finally: - sys.path = old_sys_path - return report - - -TRYBOTS = [ - 'linux_try', - 'mac_try', - 'win_try', -] - - -def GetPreferredTryMasters(_, change): - return { - 'client.gyp': { t: set(['defaulttests']) for t in TRYBOTS }, - } diff --git a/deps/npm/node_modules/node-gyp/gyp/README.md b/deps/npm/node_modules/node-gyp/gyp/README.md new file mode 100644 index 00000000000000..c0d73ac9587af3 --- /dev/null +++ b/deps/npm/node_modules/node-gyp/gyp/README.md @@ -0,0 +1,4 @@ +GYP can Generate Your Projects. +=================================== + +Documents are available at [gyp.gsrc.io](https://gyp.gsrc.io), or you can check out ```md-pages``` branch to read those documents offline. diff --git a/deps/npm/node_modules/node-gyp/gyp/codereview.settings b/deps/npm/node_modules/node-gyp/gyp/codereview.settings deleted file mode 100644 index faf37f1145f173..00000000000000 --- a/deps/npm/node_modules/node-gyp/gyp/codereview.settings +++ /dev/null @@ -1,10 +0,0 @@ -# This file is used by gcl to get repository specific information. -CODE_REVIEW_SERVER: codereview.chromium.org -CC_LIST: gyp-developer@googlegroups.com -VIEW_VC: https://chromium.googlesource.com/external/gyp/+/ -TRY_ON_UPLOAD: False -TRYSERVER_PROJECT: gyp -TRYSERVER_PATCHLEVEL: 1 -TRYSERVER_ROOT: gyp -TRYSERVER_SVN_URL: svn://svn.chromium.org/chrome-try/try-nacl -PROJECT: gyp diff --git a/deps/npm/node_modules/node-gyp/gyp/gyp.bat b/deps/npm/node_modules/node-gyp/gyp/gyp.bat old mode 100644 new mode 100755 diff --git a/deps/npm/node_modules/node-gyp/gyp/gyp_main.py b/deps/npm/node_modules/node-gyp/gyp/gyp_main.py index f738e8009f71e7..da696cfc4b1c3f 100755 --- a/deps/npm/node_modules/node-gyp/gyp/gyp_main.py +++ b/deps/npm/node_modules/node-gyp/gyp/gyp_main.py @@ -10,41 +10,42 @@ PY3 = bytes != str -# Below IsCygwin() function copied from pylib/gyp/common.py + def IsCygwin(): - try: - out = subprocess.Popen("uname", - stdout=subprocess.PIPE, - stderr=subprocess.STDOUT) - stdout, stderr = out.communicate() - if PY3: - stdout = stdout.decode("utf-8") - return "CYGWIN" in str(stdout) - except Exception: - return False + # Function copied from pylib/gyp/common.py + try: + out = subprocess.Popen( + "uname", stdout=subprocess.PIPE, stderr=subprocess.STDOUT + ) + stdout, stderr = out.communicate() + if PY3: + stdout = stdout.decode("utf-8") + return "CYGWIN" in str(stdout) + except Exception: + return False def UnixifyPath(path): - try: - if not IsCygwin(): - return path - out = subprocess.Popen(["cygpath", "-u", path], - stdout=subprocess.PIPE, - stderr=subprocess.STDOUT) - stdout, _ = out.communicate() - if PY3: - stdout = stdout.decode("utf-8") - return str(stdout) - except Exception: - return path + try: + if not IsCygwin(): + return path + out = subprocess.Popen( + ["cygpath", "-u", path], stdout=subprocess.PIPE, stderr=subprocess.STDOUT + ) + stdout, _ = out.communicate() + if PY3: + stdout = stdout.decode("utf-8") + return str(stdout) + except Exception: + return path # Make sure we're using the version of pylib in this repo, not one installed # elsewhere on the system. Also convert to Unix style path on Cygwin systems, # else the 'gyp' library will not be found path = UnixifyPath(sys.argv[0]) -sys.path.insert(0, os.path.join(os.path.dirname(path), 'pylib')) -import gyp +sys.path.insert(0, os.path.join(os.path.dirname(path), "pylib")) +import gyp # noqa: E402 -if __name__ == '__main__': - sys.exit(gyp.script_main()) +if __name__ == "__main__": + sys.exit(gyp.script_main()) diff --git a/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/MSVSNew.py b/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/MSVSNew.py index 76c4b95c0c3e82..04bbb3df718727 100644 --- a/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/MSVSNew.py +++ b/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/MSVSNew.py @@ -7,30 +7,33 @@ import hashlib import os import random +from operator import attrgetter import gyp.common try: - cmp + cmp except NameError: - def cmp(x, y): - return (x > y) - (x < y) + + def cmp(x, y): + return (x > y) - (x < y) + # Initialize random number generator random.seed() # GUIDs for project types ENTRY_TYPE_GUIDS = { - 'project': '{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}', - 'folder': '{2150E333-8FDC-42A3-9474-1A3956D46DE8}', + "project": "{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}", + "folder": "{2150E333-8FDC-42A3-9474-1A3956D46DE8}", } -#------------------------------------------------------------------------------ +# ------------------------------------------------------------------------------ # Helper functions -def MakeGuid(name, seed='msvs_new'): - """Returns a GUID for the specified target name. +def MakeGuid(name, seed="msvs_new"): + """Returns a GUID for the specified target name. Args: name: Target name. @@ -44,31 +47,39 @@ def MakeGuid(name, seed='msvs_new'): determine the GUID to refer to explicitly. It also means that the GUID will not change when the project for a target is rebuilt. """ - # Calculate a MD5 signature for the seed and name. - d = hashlib.md5((str(seed) + str(name)).encode('utf-8')).hexdigest().upper() - # Convert most of the signature to GUID form (discard the rest) - guid = ('{' + d[:8] + '-' + d[8:12] + '-' + d[12:16] + '-' + d[16:20] - + '-' + d[20:32] + '}') - return guid - -#------------------------------------------------------------------------------ + # Calculate a MD5 signature for the seed and name. + d = hashlib.md5((str(seed) + str(name)).encode("utf-8")).hexdigest().upper() + # Convert most of the signature to GUID form (discard the rest) + guid = ( + "{" + + d[:8] + + "-" + + d[8:12] + + "-" + + d[12:16] + + "-" + + d[16:20] + + "-" + + d[20:32] + + "}" + ) + return guid + + +# ------------------------------------------------------------------------------ class MSVSSolutionEntry(object): - def __cmp__(self, other): - # Sort by name then guid (so things are in order on vs2008). - return cmp((self.name, self.get_guid()), (other.name, other.get_guid())) - - def __lt__(self, other): - return self.__cmp__(other) < 0 + def __cmp__(self, other): + # Sort by name then guid (so things are in order on vs2008). + return cmp((self.name, self.get_guid()), (other.name, other.get_guid())) class MSVSFolder(MSVSSolutionEntry): - """Folder in a Visual Studio project or solution.""" + """Folder in a Visual Studio project or solution.""" - def __init__(self, path, name = None, entries = None, - guid = None, items = None): - """Initializes the folder. + def __init__(self, path, name=None, entries=None, guid=None, items=None): + """Initializes the folder. Args: path: Full path to the folder. @@ -79,38 +90,46 @@ def __init__(self, path, name = None, entries = None, items: List of solution items to include in the folder project. May be None, if the folder does not directly contain items. """ - if name: - self.name = name - else: - # Use last layer. - self.name = os.path.basename(path) + if name: + self.name = name + else: + # Use last layer. + self.name = os.path.basename(path) - self.path = path - self.guid = guid + self.path = path + self.guid = guid - # Copy passed lists (or set to empty lists) - self.entries = sorted(list(entries or [])) - self.items = list(items or []) + # Copy passed lists (or set to empty lists) + self.entries = sorted(entries or [], key=attrgetter("path")) + self.items = list(items or []) - self.entry_type_guid = ENTRY_TYPE_GUIDS['folder'] + self.entry_type_guid = ENTRY_TYPE_GUIDS["folder"] - def get_guid(self): - if self.guid is None: - # Use consistent guids for folders (so things don't regenerate). - self.guid = MakeGuid(self.path, seed='msvs_folder') - return self.guid + def get_guid(self): + if self.guid is None: + # Use consistent guids for folders (so things don't regenerate). + self.guid = MakeGuid(self.path, seed="msvs_folder") + return self.guid -#------------------------------------------------------------------------------ +# ------------------------------------------------------------------------------ class MSVSProject(MSVSSolutionEntry): - """Visual Studio project.""" - - def __init__(self, path, name = None, dependencies = None, guid = None, - spec = None, build_file = None, config_platform_overrides = None, - fixpath_prefix = None): - """Initializes the project. + """Visual Studio project.""" + + def __init__( + self, + path, + name=None, + dependencies=None, + guid=None, + spec=None, + build_file=None, + config_platform_overrides=None, + fixpath_prefix=None, + ): + """Initializes the project. Args: path: Absolute path to the project file. @@ -125,57 +144,59 @@ def __init__(self, path, name = None, dependencies = None, guid = None, used in place of the default for this target. fixpath_prefix: the path used to adjust the behavior of _fixpath """ - self.path = path - self.guid = guid - self.spec = spec - self.build_file = build_file - # Use project filename if name not specified - self.name = name or os.path.splitext(os.path.basename(path))[0] - - # Copy passed lists (or set to empty lists) - self.dependencies = list(dependencies or []) - - self.entry_type_guid = ENTRY_TYPE_GUIDS['project'] - - if config_platform_overrides: - self.config_platform_overrides = config_platform_overrides - else: - self.config_platform_overrides = {} - self.fixpath_prefix = fixpath_prefix - self.msbuild_toolset = None - - def set_dependencies(self, dependencies): - self.dependencies = list(dependencies or []) - - def get_guid(self): - if self.guid is None: - # Set GUID from path - # TODO(rspangler): This is fragile. - # 1. We can't just use the project filename sans path, since there could - # be multiple projects with the same base name (for example, - # foo/unittest.vcproj and bar/unittest.vcproj). - # 2. The path needs to be relative to $SOURCE_ROOT, so that the project - # GUID is the same whether it's included from base/base.sln or - # foo/bar/baz/baz.sln. - # 3. The GUID needs to be the same each time this builder is invoked, so - # that we don't need to rebuild the solution when the project changes. - # 4. We should be able to handle pre-built project files by reading the - # GUID from the files. - self.guid = MakeGuid(self.name) - return self.guid - - def set_msbuild_toolset(self, msbuild_toolset): - self.msbuild_toolset = msbuild_toolset - -#------------------------------------------------------------------------------ + self.path = path + self.guid = guid + self.spec = spec + self.build_file = build_file + # Use project filename if name not specified + self.name = name or os.path.splitext(os.path.basename(path))[0] + + # Copy passed lists (or set to empty lists) + self.dependencies = list(dependencies or []) + + self.entry_type_guid = ENTRY_TYPE_GUIDS["project"] + + if config_platform_overrides: + self.config_platform_overrides = config_platform_overrides + else: + self.config_platform_overrides = {} + self.fixpath_prefix = fixpath_prefix + self.msbuild_toolset = None + + def set_dependencies(self, dependencies): + self.dependencies = list(dependencies or []) + + def get_guid(self): + if self.guid is None: + # Set GUID from path + # TODO(rspangler): This is fragile. + # 1. We can't just use the project filename sans path, since there could + # be multiple projects with the same base name (for example, + # foo/unittest.vcproj and bar/unittest.vcproj). + # 2. The path needs to be relative to $SOURCE_ROOT, so that the project + # GUID is the same whether it's included from base/base.sln or + # foo/bar/baz/baz.sln. + # 3. The GUID needs to be the same each time this builder is invoked, so + # that we don't need to rebuild the solution when the project changes. + # 4. We should be able to handle pre-built project files by reading the + # GUID from the files. + self.guid = MakeGuid(self.name) + return self.guid + + def set_msbuild_toolset(self, msbuild_toolset): + self.msbuild_toolset = msbuild_toolset + + +# ------------------------------------------------------------------------------ class MSVSSolution(object): - """Visual Studio solution.""" + """Visual Studio solution.""" - def __init__(self, path, version, entries=None, variants=None, - websiteProperties=True): - """Initializes the solution. + def __init__( + self, path, version, entries=None, variants=None, websiteProperties=True + ): + """Initializes the solution. Args: path: Path to solution file. @@ -187,152 +208,163 @@ def __init__(self, path, version, entries=None, variants=None, websiteProperties: Flag to decide if the website properties section is generated. """ - self.path = path - self.websiteProperties = websiteProperties - self.version = version - - # Copy passed lists (or set to empty lists) - self.entries = list(entries or []) - - if variants: - # Copy passed list - self.variants = variants[:] - else: - # Use default - self.variants = ['Debug|Win32', 'Release|Win32'] - # TODO(rspangler): Need to be able to handle a mapping of solution config - # to project config. Should we be able to handle variants being a dict, - # or add a separate variant_map variable? If it's a dict, we can't - # guarantee the order of variants since dict keys aren't ordered. - - - # TODO(rspangler): Automatically write to disk for now; should delay until - # node-evaluation time. - self.Write() - - - def Write(self, writer=gyp.common.WriteOnDiff): - """Writes the solution file to disk. + self.path = path + self.websiteProperties = websiteProperties + self.version = version + + # Copy passed lists (or set to empty lists) + self.entries = list(entries or []) + + if variants: + # Copy passed list + self.variants = variants[:] + else: + # Use default + self.variants = ["Debug|Win32", "Release|Win32"] + # TODO(rspangler): Need to be able to handle a mapping of solution config + # to project config. Should we be able to handle variants being a dict, + # or add a separate variant_map variable? If it's a dict, we can't + # guarantee the order of variants since dict keys aren't ordered. + + # TODO(rspangler): Automatically write to disk for now; should delay until + # node-evaluation time. + self.Write() + + def Write(self, writer=gyp.common.WriteOnDiff): + """Writes the solution file to disk. Raises: IndexError: An entry appears multiple times. """ - # Walk the entry tree and collect all the folders and projects. - all_entries = set() - entries_to_check = self.entries[:] - while entries_to_check: - e = entries_to_check.pop(0) - - # If this entry has been visited, nothing to do. - if e in all_entries: - continue - - all_entries.add(e) - - # If this is a folder, check its entries too. - if isinstance(e, MSVSFolder): - entries_to_check += e.entries - - all_entries = sorted(all_entries) - - # Open file and print header - f = writer(self.path) - f.write('Microsoft Visual Studio Solution File, ' - 'Format Version %s\r\n' % self.version.SolutionVersion()) - f.write('# %s\r\n' % self.version.Description()) - - # Project entries - sln_root = os.path.split(self.path)[0] - for e in all_entries: - relative_path = gyp.common.RelativePath(e.path, sln_root) - # msbuild does not accept an empty folder_name. - # use '.' in case relative_path is empty. - folder_name = relative_path.replace('/', '\\') or '.' - f.write('Project("%s") = "%s", "%s", "%s"\r\n' % ( - e.entry_type_guid, # Entry type GUID - e.name, # Folder name - folder_name, # Folder name (again) - e.get_guid(), # Entry GUID - )) - - # TODO(rspangler): Need a way to configure this stuff - if self.websiteProperties: - f.write('\tProjectSection(WebsiteProperties) = preProject\r\n' - '\t\tDebug.AspNetCompiler.Debug = "True"\r\n' - '\t\tRelease.AspNetCompiler.Debug = "False"\r\n' - '\tEndProjectSection\r\n') - - if isinstance(e, MSVSFolder): - if e.items: - f.write('\tProjectSection(SolutionItems) = preProject\r\n') - for i in e.items: - f.write('\t\t%s = %s\r\n' % (i, i)) - f.write('\tEndProjectSection\r\n') - - if isinstance(e, MSVSProject): - if e.dependencies: - f.write('\tProjectSection(ProjectDependencies) = postProject\r\n') - for d in e.dependencies: - f.write('\t\t%s = %s\r\n' % (d.get_guid(), d.get_guid())) - f.write('\tEndProjectSection\r\n') - - f.write('EndProject\r\n') - - # Global section - f.write('Global\r\n') - - # Configurations (variants) - f.write('\tGlobalSection(SolutionConfigurationPlatforms) = preSolution\r\n') - for v in self.variants: - f.write('\t\t%s = %s\r\n' % (v, v)) - f.write('\tEndGlobalSection\r\n') - - # Sort config guids for easier diffing of solution changes. - config_guids = [] - config_guids_overrides = {} - for e in all_entries: - if isinstance(e, MSVSProject): - config_guids.append(e.get_guid()) - config_guids_overrides[e.get_guid()] = e.config_platform_overrides - config_guids.sort() - - f.write('\tGlobalSection(ProjectConfigurationPlatforms) = postSolution\r\n') - for g in config_guids: - for v in self.variants: - nv = config_guids_overrides[g].get(v, v) - # Pick which project configuration to build for this solution - # configuration. - f.write('\t\t%s.%s.ActiveCfg = %s\r\n' % ( - g, # Project GUID - v, # Solution build configuration - nv, # Project build config for that solution config - )) - - # Enable project in this solution configuration. - f.write('\t\t%s.%s.Build.0 = %s\r\n' % ( - g, # Project GUID - v, # Solution build configuration - nv, # Project build config for that solution config - )) - f.write('\tEndGlobalSection\r\n') - - # TODO(rspangler): Should be able to configure this stuff too (though I've - # never seen this be any different) - f.write('\tGlobalSection(SolutionProperties) = preSolution\r\n') - f.write('\t\tHideSolutionNode = FALSE\r\n') - f.write('\tEndGlobalSection\r\n') - - # Folder mappings - # Omit this section if there are no folders - if any([e.entries for e in all_entries if isinstance(e, MSVSFolder)]): - f.write('\tGlobalSection(NestedProjects) = preSolution\r\n') - for e in all_entries: - if not isinstance(e, MSVSFolder): - continue # Does not apply to projects, only folders - for subentry in e.entries: - f.write('\t\t%s = %s\r\n' % (subentry.get_guid(), e.get_guid())) - f.write('\tEndGlobalSection\r\n') - - f.write('EndGlobal\r\n') - - f.close() + # Walk the entry tree and collect all the folders and projects. + all_entries = set() + entries_to_check = self.entries[:] + while entries_to_check: + e = entries_to_check.pop(0) + + # If this entry has been visited, nothing to do. + if e in all_entries: + continue + + all_entries.add(e) + + # If this is a folder, check its entries too. + if isinstance(e, MSVSFolder): + entries_to_check += e.entries + + all_entries = sorted(all_entries, key=attrgetter("path")) + + # Open file and print header + f = writer(self.path) + f.write( + "Microsoft Visual Studio Solution File, " + "Format Version %s\r\n" % self.version.SolutionVersion() + ) + f.write("# %s\r\n" % self.version.Description()) + + # Project entries + sln_root = os.path.split(self.path)[0] + for e in all_entries: + relative_path = gyp.common.RelativePath(e.path, sln_root) + # msbuild does not accept an empty folder_name. + # use '.' in case relative_path is empty. + folder_name = relative_path.replace("/", "\\") or "." + f.write( + 'Project("%s") = "%s", "%s", "%s"\r\n' + % ( + e.entry_type_guid, # Entry type GUID + e.name, # Folder name + folder_name, # Folder name (again) + e.get_guid(), # Entry GUID + ) + ) + + # TODO(rspangler): Need a way to configure this stuff + if self.websiteProperties: + f.write( + "\tProjectSection(WebsiteProperties) = preProject\r\n" + '\t\tDebug.AspNetCompiler.Debug = "True"\r\n' + '\t\tRelease.AspNetCompiler.Debug = "False"\r\n' + "\tEndProjectSection\r\n" + ) + + if isinstance(e, MSVSFolder): + if e.items: + f.write("\tProjectSection(SolutionItems) = preProject\r\n") + for i in e.items: + f.write("\t\t%s = %s\r\n" % (i, i)) + f.write("\tEndProjectSection\r\n") + + if isinstance(e, MSVSProject): + if e.dependencies: + f.write("\tProjectSection(ProjectDependencies) = postProject\r\n") + for d in e.dependencies: + f.write("\t\t%s = %s\r\n" % (d.get_guid(), d.get_guid())) + f.write("\tEndProjectSection\r\n") + + f.write("EndProject\r\n") + + # Global section + f.write("Global\r\n") + + # Configurations (variants) + f.write("\tGlobalSection(SolutionConfigurationPlatforms) = preSolution\r\n") + for v in self.variants: + f.write("\t\t%s = %s\r\n" % (v, v)) + f.write("\tEndGlobalSection\r\n") + + # Sort config guids for easier diffing of solution changes. + config_guids = [] + config_guids_overrides = {} + for e in all_entries: + if isinstance(e, MSVSProject): + config_guids.append(e.get_guid()) + config_guids_overrides[e.get_guid()] = e.config_platform_overrides + config_guids.sort() + + f.write("\tGlobalSection(ProjectConfigurationPlatforms) = postSolution\r\n") + for g in config_guids: + for v in self.variants: + nv = config_guids_overrides[g].get(v, v) + # Pick which project configuration to build for this solution + # configuration. + f.write( + "\t\t%s.%s.ActiveCfg = %s\r\n" + % ( + g, # Project GUID + v, # Solution build configuration + nv, # Project build config for that solution config + ) + ) + + # Enable project in this solution configuration. + f.write( + "\t\t%s.%s.Build.0 = %s\r\n" + % ( + g, # Project GUID + v, # Solution build configuration + nv, # Project build config for that solution config + ) + ) + f.write("\tEndGlobalSection\r\n") + + # TODO(rspangler): Should be able to configure this stuff too (though I've + # never seen this be any different) + f.write("\tGlobalSection(SolutionProperties) = preSolution\r\n") + f.write("\t\tHideSolutionNode = FALSE\r\n") + f.write("\tEndGlobalSection\r\n") + + # Folder mappings + # Omit this section if there are no folders + if any([e.entries for e in all_entries if isinstance(e, MSVSFolder)]): + f.write("\tGlobalSection(NestedProjects) = preSolution\r\n") + for e in all_entries: + if not isinstance(e, MSVSFolder): + continue # Does not apply to projects, only folders + for subentry in e.entries: + f.write("\t\t%s = %s\r\n" % (subentry.get_guid(), e.get_guid())) + f.write("\tEndGlobalSection\r\n") + + f.write("EndGlobal\r\n") + + f.close() diff --git a/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/MSVSProject.py b/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/MSVSProject.py index db1ceede344c60..f953d52cd03d36 100644 --- a/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/MSVSProject.py +++ b/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/MSVSProject.py @@ -4,55 +4,55 @@ """Visual Studio project reader/writer.""" -import gyp.common import gyp.easy_xml as easy_xml -#------------------------------------------------------------------------------ +# ------------------------------------------------------------------------------ class Tool(object): - """Visual Studio tool.""" + """Visual Studio tool.""" - def __init__(self, name, attrs=None): - """Initializes the tool. + def __init__(self, name, attrs=None): + """Initializes the tool. Args: name: Tool name. attrs: Dict of tool attributes; may be None. """ - self._attrs = attrs or {} - self._attrs['Name'] = name + self._attrs = attrs or {} + self._attrs["Name"] = name - def _GetSpecification(self): - """Creates an element for the tool. + def _GetSpecification(self): + """Creates an element for the tool. Returns: A new xml.dom.Element for the tool. """ - return ['Tool', self._attrs] + return ["Tool", self._attrs] + class Filter(object): - """Visual Studio filter - that is, a virtual folder.""" + """Visual Studio filter - that is, a virtual folder.""" - def __init__(self, name, contents=None): - """Initializes the folder. + def __init__(self, name, contents=None): + """Initializes the folder. Args: name: Filter (folder) name. contents: List of filenames and/or Filter objects contained. """ - self.name = name - self.contents = list(contents or []) + self.name = name + self.contents = list(contents or []) -#------------------------------------------------------------------------------ +# ------------------------------------------------------------------------------ class Writer(object): - """Visual Studio XML project writer.""" + """Visual Studio XML project writer.""" - def __init__(self, project_path, version, name, guid=None, platforms=None): - """Initializes the project. + def __init__(self, project_path, version, name, guid=None, platforms=None): + """Initializes the project. Args: project_path: Path to the project file. @@ -61,36 +61,36 @@ def __init__(self, project_path, version, name, guid=None, platforms=None): guid: GUID to use for project, if not None. platforms: Array of string, the supported platforms. If null, ['Win32'] """ - self.project_path = project_path - self.version = version - self.name = name - self.guid = guid + self.project_path = project_path + self.version = version + self.name = name + self.guid = guid - # Default to Win32 for platforms. - if not platforms: - platforms = ['Win32'] + # Default to Win32 for platforms. + if not platforms: + platforms = ["Win32"] - # Initialize the specifications of the various sections. - self.platform_section = ['Platforms'] - for platform in platforms: - self.platform_section.append(['Platform', {'Name': platform}]) - self.tool_files_section = ['ToolFiles'] - self.configurations_section = ['Configurations'] - self.files_section = ['Files'] + # Initialize the specifications of the various sections. + self.platform_section = ["Platforms"] + for platform in platforms: + self.platform_section.append(["Platform", {"Name": platform}]) + self.tool_files_section = ["ToolFiles"] + self.configurations_section = ["Configurations"] + self.files_section = ["Files"] - # Keep a dict keyed on filename to speed up access. - self.files_dict = dict() + # Keep a dict keyed on filename to speed up access. + self.files_dict = dict() - def AddToolFile(self, path): - """Adds a tool file to the project. + def AddToolFile(self, path): + """Adds a tool file to the project. Args: path: Relative path from project to tool file. """ - self.tool_files_section.append(['ToolFile', {'RelativePath': path}]) + self.tool_files_section.append(["ToolFile", {"RelativePath": path}]) - def _GetSpecForConfiguration(self, config_type, config_name, attrs, tools): - """Returns the specification for a configuration. + def _GetSpecForConfiguration(self, config_type, config_name, attrs, tools): + """Returns the specification for a configuration. Args: config_type: Type of configuration node. @@ -99,40 +99,39 @@ def _GetSpecForConfiguration(self, config_type, config_name, attrs, tools): tools: List of tools (strings or Tool objects); may be None. Returns: """ - # Handle defaults - if not attrs: - attrs = {} - if not tools: - tools = [] - - # Add configuration node and its attributes - node_attrs = attrs.copy() - node_attrs['Name'] = config_name - specification = [config_type, node_attrs] - - # Add tool nodes and their attributes - if tools: - for t in tools: - if isinstance(t, Tool): - specification.append(t._GetSpecification()) - else: - specification.append(Tool(t)._GetSpecification()) - return specification - - - def AddConfig(self, name, attrs=None, tools=None): - """Adds a configuration to the project. + # Handle defaults + if not attrs: + attrs = {} + if not tools: + tools = [] + + # Add configuration node and its attributes + node_attrs = attrs.copy() + node_attrs["Name"] = config_name + specification = [config_type, node_attrs] + + # Add tool nodes and their attributes + if tools: + for t in tools: + if isinstance(t, Tool): + specification.append(t._GetSpecification()) + else: + specification.append(Tool(t)._GetSpecification()) + return specification + + def AddConfig(self, name, attrs=None, tools=None): + """Adds a configuration to the project. Args: name: Configuration name. attrs: Dict of configuration attributes; may be None. tools: List of tools (strings or Tool objects); may be None. """ - spec = self._GetSpecForConfiguration('Configuration', name, attrs, tools) - self.configurations_section.append(spec) + spec = self._GetSpecForConfiguration("Configuration", name, attrs, tools) + self.configurations_section.append(spec) - def _AddFilesToNode(self, parent, files): - """Adds files and/or filters to the parent node. + def _AddFilesToNode(self, parent, files): + """Adds files and/or filters to the parent node. Args: parent: Destination node @@ -140,17 +139,17 @@ def _AddFilesToNode(self, parent, files): Will call itself recursively, if the files list contains Filter objects. """ - for f in files: - if isinstance(f, Filter): - node = ['Filter', {'Name': f.name}] - self._AddFilesToNode(node, f.contents) - else: - node = ['File', {'RelativePath': f}] - self.files_dict[f] = node - parent.append(node) - - def AddFiles(self, files): - """Adds files to the project. + for f in files: + if isinstance(f, Filter): + node = ["Filter", {"Name": f.name}] + self._AddFilesToNode(node, f.contents) + else: + node = ["File", {"RelativePath": f}] + self.files_dict[f] = node + parent.append(node) + + def AddFiles(self, files): + """Adds files to the project. Args: files: A list of Filter objects and/or relative paths to files. @@ -159,12 +158,12 @@ def AddFiles(self, files): later add files to a Filter object which was passed into a previous call to AddFiles(), it will not be reflected in this project. """ - self._AddFilesToNode(self.files_section, files) - # TODO(rspangler) This also doesn't handle adding files to an existing - # filter. That is, it doesn't merge the trees. + self._AddFilesToNode(self.files_section, files) + # TODO(rspangler) This also doesn't handle adding files to an existing + # filter. That is, it doesn't merge the trees. - def AddFileConfig(self, path, config, attrs=None, tools=None): - """Adds a configuration to a file. + def AddFileConfig(self, path, config, attrs=None, tools=None): + """Adds a configuration to a file. Args: path: Relative path to the file. @@ -175,34 +174,33 @@ def AddFileConfig(self, path, config, attrs=None, tools=None): Raises: ValueError: Relative path does not match any file added via AddFiles(). """ - # Find the file node with the right relative path - parent = self.files_dict.get(path) - if not parent: - raise ValueError('AddFileConfig: file "%s" not in project.' % path) - - # Add the config to the file node - spec = self._GetSpecForConfiguration('FileConfiguration', config, attrs, - tools) - parent.append(spec) - - def WriteIfChanged(self): - """Writes the project file.""" - # First create XML content definition - content = [ - 'VisualStudioProject', - {'ProjectType': 'Visual C++', - 'Version': self.version.ProjectVersion(), - 'Name': self.name, - 'ProjectGUID': self.guid, - 'RootNamespace': self.name, - 'Keyword': 'Win32Proj' - }, - self.platform_section, - self.tool_files_section, - self.configurations_section, - ['References'], # empty section - self.files_section, - ['Globals'] # empty section - ] - easy_xml.WriteXmlIfChanged(content, self.project_path, - encoding="Windows-1252") + # Find the file node with the right relative path + parent = self.files_dict.get(path) + if not parent: + raise ValueError('AddFileConfig: file "%s" not in project.' % path) + + # Add the config to the file node + spec = self._GetSpecForConfiguration("FileConfiguration", config, attrs, tools) + parent.append(spec) + + def WriteIfChanged(self): + """Writes the project file.""" + # First create XML content definition + content = [ + "VisualStudioProject", + { + "ProjectType": "Visual C++", + "Version": self.version.ProjectVersion(), + "Name": self.name, + "ProjectGUID": self.guid, + "RootNamespace": self.name, + "Keyword": "Win32Proj", + }, + self.platform_section, + self.tool_files_section, + self.configurations_section, + ["References"], # empty section + self.files_section, + ["Globals"], # empty section + ] + easy_xml.WriteXmlIfChanged(content, self.project_path, encoding="Windows-1252") diff --git a/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/MSVSSettings.py b/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/MSVSSettings.py index 065a339a8025e5..6ef16f2a0b23e2 100644 --- a/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/MSVSSettings.py +++ b/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/MSVSSettings.py @@ -37,42 +37,42 @@ class _Tool(object): - """Represents a tool used by MSVS or MSBuild. + """Represents a tool used by MSVS or MSBuild. Attributes: msvs_name: The name of the tool in MSVS. msbuild_name: The name of the tool in MSBuild. """ - def __init__(self, msvs_name, msbuild_name): - self.msvs_name = msvs_name - self.msbuild_name = msbuild_name + def __init__(self, msvs_name, msbuild_name): + self.msvs_name = msvs_name + self.msbuild_name = msbuild_name def _AddTool(tool): - """Adds a tool to the four dictionaries used to process settings. + """Adds a tool to the four dictionaries used to process settings. This only defines the tool. Each setting also needs to be added. Args: tool: The _Tool object to be added. """ - _msvs_validators[tool.msvs_name] = {} - _msbuild_validators[tool.msbuild_name] = {} - _msvs_to_msbuild_converters[tool.msvs_name] = {} - _msbuild_name_of_tool[tool.msvs_name] = tool.msbuild_name + _msvs_validators[tool.msvs_name] = {} + _msbuild_validators[tool.msbuild_name] = {} + _msvs_to_msbuild_converters[tool.msvs_name] = {} + _msbuild_name_of_tool[tool.msvs_name] = tool.msbuild_name def _GetMSBuildToolSettings(msbuild_settings, tool): - """Returns an MSBuild tool dictionary. Creates it if needed.""" - return msbuild_settings.setdefault(tool.msbuild_name, {}) + """Returns an MSBuild tool dictionary. Creates it if needed.""" + return msbuild_settings.setdefault(tool.msbuild_name, {}) class _Type(object): - """Type of settings (Base class).""" + """Type of settings (Base class).""" - def ValidateMSVS(self, value): - """Verifies that the value is legal for MSVS. + def ValidateMSVS(self, value): + """Verifies that the value is legal for MSVS. Args: value: the value to check for this type. @@ -81,8 +81,8 @@ def ValidateMSVS(self, value): ValueError if value is not valid for MSVS. """ - def ValidateMSBuild(self, value): - """Verifies that the value is legal for MSBuild. + def ValidateMSBuild(self, value): + """Verifies that the value is legal for MSBuild. Args: value: the value to check for this type. @@ -91,8 +91,8 @@ def ValidateMSBuild(self, value): ValueError if value is not valid for MSBuild. """ - def ConvertToMSBuild(self, value): - """Returns the MSBuild equivalent of the MSVS value given. + def ConvertToMSBuild(self, value): + """Returns the MSBuild equivalent of the MSVS value given. Args: value: the MSVS value to convert. @@ -103,84 +103,84 @@ def ConvertToMSBuild(self, value): Raises: ValueError if value is not valid. """ - return value + return value class _String(_Type): - """A setting that's just a string.""" + """A setting that's just a string.""" - def ValidateMSVS(self, value): - if not isinstance(value, string_types): - raise ValueError('expected string; got %r' % value) + def ValidateMSVS(self, value): + if not isinstance(value, string_types): + raise ValueError("expected string; got %r" % value) - def ValidateMSBuild(self, value): - if not isinstance(value, string_types): - raise ValueError('expected string; got %r' % value) + def ValidateMSBuild(self, value): + if not isinstance(value, string_types): + raise ValueError("expected string; got %r" % value) - def ConvertToMSBuild(self, value): - # Convert the macros - return ConvertVCMacrosToMSBuild(value) + def ConvertToMSBuild(self, value): + # Convert the macros + return ConvertVCMacrosToMSBuild(value) class _StringList(_Type): - """A settings that's a list of strings.""" + """A settings that's a list of strings.""" - def ValidateMSVS(self, value): - if not isinstance(value, string_types) and not isinstance(value, list): - raise ValueError('expected string list; got %r' % value) + def ValidateMSVS(self, value): + if not isinstance(value, string_types) and not isinstance(value, list): + raise ValueError("expected string list; got %r" % value) - def ValidateMSBuild(self, value): - if not isinstance(value, string_types) and not isinstance(value, list): - raise ValueError('expected string list; got %r' % value) + def ValidateMSBuild(self, value): + if not isinstance(value, string_types) and not isinstance(value, list): + raise ValueError("expected string list; got %r" % value) - def ConvertToMSBuild(self, value): - # Convert the macros - if isinstance(value, list): - return [ConvertVCMacrosToMSBuild(i) for i in value] - else: - return ConvertVCMacrosToMSBuild(value) + def ConvertToMSBuild(self, value): + # Convert the macros + if isinstance(value, list): + return [ConvertVCMacrosToMSBuild(i) for i in value] + else: + return ConvertVCMacrosToMSBuild(value) class _Boolean(_Type): - """Boolean settings, can have the values 'false' or 'true'.""" + """Boolean settings, can have the values 'false' or 'true'.""" - def _Validate(self, value): - if value != 'true' and value != 'false': - raise ValueError('expected bool; got %r' % value) + def _Validate(self, value): + if value != "true" and value != "false": + raise ValueError("expected bool; got %r" % value) - def ValidateMSVS(self, value): - self._Validate(value) + def ValidateMSVS(self, value): + self._Validate(value) - def ValidateMSBuild(self, value): - self._Validate(value) + def ValidateMSBuild(self, value): + self._Validate(value) - def ConvertToMSBuild(self, value): - self._Validate(value) - return value + def ConvertToMSBuild(self, value): + self._Validate(value) + return value class _Integer(_Type): - """Integer settings.""" + """Integer settings.""" - def __init__(self, msbuild_base=10): - _Type.__init__(self) - self._msbuild_base = msbuild_base + def __init__(self, msbuild_base=10): + _Type.__init__(self) + self._msbuild_base = msbuild_base - def ValidateMSVS(self, value): - # Try to convert, this will raise ValueError if invalid. - self.ConvertToMSBuild(value) + def ValidateMSVS(self, value): + # Try to convert, this will raise ValueError if invalid. + self.ConvertToMSBuild(value) - def ValidateMSBuild(self, value): - # Try to convert, this will raise ValueError if invalid. - int(value, self._msbuild_base) + def ValidateMSBuild(self, value): + # Try to convert, this will raise ValueError if invalid. + int(value, self._msbuild_base) - def ConvertToMSBuild(self, value): - msbuild_format = (self._msbuild_base == 10) and '%d' or '0x%04x' - return msbuild_format % int(value) + def ConvertToMSBuild(self, value): + msbuild_format = (self._msbuild_base == 10) and "%d" or "0x%04x" + return msbuild_format % int(value) class _Enumeration(_Type): - """Type of settings that is an enumeration. + """Type of settings that is an enumeration. In MSVS, the values are indexes like '0', '1', and '2'. MSBuild uses text labels that are more representative, like 'Win32'. @@ -192,31 +192,32 @@ class _Enumeration(_Type): new: an array of labels that are new to MSBuild. """ - def __init__(self, label_list, new=None): - _Type.__init__(self) - self._label_list = label_list - self._msbuild_values = set(value for value in label_list - if value is not None) - if new is not None: - self._msbuild_values.update(new) - - def ValidateMSVS(self, value): - # Try to convert. It will raise an exception if not valid. - self.ConvertToMSBuild(value) - - def ValidateMSBuild(self, value): - if value not in self._msbuild_values: - raise ValueError('unrecognized enumerated value %s' % value) - - def ConvertToMSBuild(self, value): - index = int(value) - if index < 0 or index >= len(self._label_list): - raise ValueError('index value (%d) not in expected range [0, %d)' % - (index, len(self._label_list))) - label = self._label_list[index] - if label is None: - raise ValueError('converted value for %s not specified.' % value) - return label + def __init__(self, label_list, new=None): + _Type.__init__(self) + self._label_list = label_list + self._msbuild_values = set(value for value in label_list if value is not None) + if new is not None: + self._msbuild_values.update(new) + + def ValidateMSVS(self, value): + # Try to convert. It will raise an exception if not valid. + self.ConvertToMSBuild(value) + + def ValidateMSBuild(self, value): + if value not in self._msbuild_values: + raise ValueError("unrecognized enumerated value %s" % value) + + def ConvertToMSBuild(self, value): + index = int(value) + if index < 0 or index >= len(self._label_list): + raise ValueError( + "index value (%d) not in expected range [0, %d)" + % (index, len(self._label_list)) + ) + label = self._label_list[index] + if label is None: + raise ValueError("converted value for %s not specified." % value) + return label # Instantiate the various generic types. @@ -231,22 +232,22 @@ def ConvertToMSBuild(self, value): _string_list = _StringList() # Some boolean settings went from numerical values to boolean. The # mapping is 0: default, 1: false, 2: true. -_newly_boolean = _Enumeration(['', 'false', 'true']) +_newly_boolean = _Enumeration(["", "false", "true"]) def _Same(tool, name, setting_type): - """Defines a setting that has the same name in MSVS and MSBuild. + """Defines a setting that has the same name in MSVS and MSBuild. Args: tool: a dictionary that gives the names of the tool for MSVS and MSBuild. name: the name of the setting. setting_type: the type of this setting. """ - _Renamed(tool, name, name, setting_type) + _Renamed(tool, name, name, setting_type) def _Renamed(tool, msvs_name, msbuild_name, setting_type): - """Defines a setting for which the name has changed. + """Defines a setting for which the name has changed. Args: tool: a dictionary that gives the names of the tool for MSVS and MSBuild. @@ -255,24 +256,25 @@ def _Renamed(tool, msvs_name, msbuild_name, setting_type): setting_type: the type of this setting. """ - def _Translate(value, msbuild_settings): - msbuild_tool_settings = _GetMSBuildToolSettings(msbuild_settings, tool) - msbuild_tool_settings[msbuild_name] = setting_type.ConvertToMSBuild(value) + def _Translate(value, msbuild_settings): + msbuild_tool_settings = _GetMSBuildToolSettings(msbuild_settings, tool) + msbuild_tool_settings[msbuild_name] = setting_type.ConvertToMSBuild(value) - _msvs_validators[tool.msvs_name][msvs_name] = setting_type.ValidateMSVS - _msbuild_validators[tool.msbuild_name][msbuild_name] = ( - setting_type.ValidateMSBuild) - _msvs_to_msbuild_converters[tool.msvs_name][msvs_name] = _Translate + _msvs_validators[tool.msvs_name][msvs_name] = setting_type.ValidateMSVS + _msbuild_validators[tool.msbuild_name][msbuild_name] = setting_type.ValidateMSBuild + _msvs_to_msbuild_converters[tool.msvs_name][msvs_name] = _Translate def _Moved(tool, settings_name, msbuild_tool_name, setting_type): - _MovedAndRenamed(tool, settings_name, msbuild_tool_name, settings_name, - setting_type) + _MovedAndRenamed( + tool, settings_name, msbuild_tool_name, settings_name, setting_type + ) -def _MovedAndRenamed(tool, msvs_settings_name, msbuild_tool_name, - msbuild_settings_name, setting_type): - """Defines a setting that may have moved to a new section. +def _MovedAndRenamed( + tool, msvs_settings_name, msbuild_tool_name, msbuild_settings_name, setting_type +): + """Defines a setting that may have moved to a new section. Args: tool: a dictionary that gives the names of the tool for MSVS and MSBuild. @@ -282,19 +284,18 @@ def _MovedAndRenamed(tool, msvs_settings_name, msbuild_tool_name, setting_type: the type of this setting. """ - def _Translate(value, msbuild_settings): - tool_settings = msbuild_settings.setdefault(msbuild_tool_name, {}) - tool_settings[msbuild_settings_name] = setting_type.ConvertToMSBuild(value) + def _Translate(value, msbuild_settings): + tool_settings = msbuild_settings.setdefault(msbuild_tool_name, {}) + tool_settings[msbuild_settings_name] = setting_type.ConvertToMSBuild(value) - _msvs_validators[tool.msvs_name][msvs_settings_name] = ( - setting_type.ValidateMSVS) - validator = setting_type.ValidateMSBuild - _msbuild_validators[msbuild_tool_name][msbuild_settings_name] = validator - _msvs_to_msbuild_converters[tool.msvs_name][msvs_settings_name] = _Translate + _msvs_validators[tool.msvs_name][msvs_settings_name] = setting_type.ValidateMSVS + validator = setting_type.ValidateMSBuild + _msbuild_validators[msbuild_tool_name][msbuild_settings_name] = validator + _msvs_to_msbuild_converters[tool.msvs_name][msvs_settings_name] = _Translate def _MSVSOnly(tool, name, setting_type): - """Defines a setting that is only found in MSVS. + """Defines a setting that is only found in MSVS. Args: tool: a dictionary that gives the names of the tool for MSVS and MSBuild. @@ -302,16 +303,16 @@ def _MSVSOnly(tool, name, setting_type): setting_type: the type of this setting. """ - def _Translate(unused_value, unused_msbuild_settings): - # Since this is for MSVS only settings, no translation will happen. - pass + def _Translate(unused_value, unused_msbuild_settings): + # Since this is for MSVS only settings, no translation will happen. + pass - _msvs_validators[tool.msvs_name][name] = setting_type.ValidateMSVS - _msvs_to_msbuild_converters[tool.msvs_name][name] = _Translate + _msvs_validators[tool.msvs_name][name] = setting_type.ValidateMSVS + _msvs_to_msbuild_converters[tool.msvs_name][name] = _Translate def _MSBuildOnly(tool, name, setting_type): - """Defines a setting that is only found in MSBuild. + """Defines a setting that is only found in MSBuild. Args: tool: a dictionary that gives the names of the tool for MSVS and MSBuild. @@ -319,17 +320,17 @@ def _MSBuildOnly(tool, name, setting_type): setting_type: the type of this setting. """ - def _Translate(value, msbuild_settings): - # Let msbuild-only properties get translated as-is from msvs_settings. - tool_settings = msbuild_settings.setdefault(tool.msbuild_name, {}) - tool_settings[name] = value + def _Translate(value, msbuild_settings): + # Let msbuild-only properties get translated as-is from msvs_settings. + tool_settings = msbuild_settings.setdefault(tool.msbuild_name, {}) + tool_settings[name] = value - _msbuild_validators[tool.msbuild_name][name] = setting_type.ValidateMSBuild - _msvs_to_msbuild_converters[tool.msvs_name][name] = _Translate + _msbuild_validators[tool.msbuild_name][name] = setting_type.ValidateMSBuild + _msvs_to_msbuild_converters[tool.msvs_name][name] = _Translate def _ConvertedToAdditionalOption(tool, msvs_name, flag): - """Defines a setting that's handled via a command line option in MSBuild. + """Defines a setting that's handled via a command line option in MSBuild. Args: tool: a dictionary that gives the names of the tool for MSVS and MSBuild. @@ -337,53 +338,55 @@ def _ConvertedToAdditionalOption(tool, msvs_name, flag): flag: the flag to insert at the end of the AdditionalOptions """ - def _Translate(value, msbuild_settings): - if value == 'true': - tool_settings = _GetMSBuildToolSettings(msbuild_settings, tool) - if 'AdditionalOptions' in tool_settings: - new_flags = '%s %s' % (tool_settings['AdditionalOptions'], flag) - else: - new_flags = flag - tool_settings['AdditionalOptions'] = new_flags - _msvs_validators[tool.msvs_name][msvs_name] = _boolean.ValidateMSVS - _msvs_to_msbuild_converters[tool.msvs_name][msvs_name] = _Translate + def _Translate(value, msbuild_settings): + if value == "true": + tool_settings = _GetMSBuildToolSettings(msbuild_settings, tool) + if "AdditionalOptions" in tool_settings: + new_flags = "%s %s" % (tool_settings["AdditionalOptions"], flag) + else: + new_flags = flag + tool_settings["AdditionalOptions"] = new_flags + + _msvs_validators[tool.msvs_name][msvs_name] = _boolean.ValidateMSVS + _msvs_to_msbuild_converters[tool.msvs_name][msvs_name] = _Translate def _CustomGeneratePreprocessedFile(tool, msvs_name): - def _Translate(value, msbuild_settings): - tool_settings = _GetMSBuildToolSettings(msbuild_settings, tool) - if value == '0': - tool_settings['PreprocessToFile'] = 'false' - tool_settings['PreprocessSuppressLineNumbers'] = 'false' - elif value == '1': # /P - tool_settings['PreprocessToFile'] = 'true' - tool_settings['PreprocessSuppressLineNumbers'] = 'false' - elif value == '2': # /EP /P - tool_settings['PreprocessToFile'] = 'true' - tool_settings['PreprocessSuppressLineNumbers'] = 'true' - else: - raise ValueError('value must be one of [0, 1, 2]; got %s' % value) - # Create a bogus validator that looks for '0', '1', or '2' - msvs_validator = _Enumeration(['a', 'b', 'c']).ValidateMSVS - _msvs_validators[tool.msvs_name][msvs_name] = msvs_validator - msbuild_validator = _boolean.ValidateMSBuild - msbuild_tool_validators = _msbuild_validators[tool.msbuild_name] - msbuild_tool_validators['PreprocessToFile'] = msbuild_validator - msbuild_tool_validators['PreprocessSuppressLineNumbers'] = msbuild_validator - _msvs_to_msbuild_converters[tool.msvs_name][msvs_name] = _Translate - - -fix_vc_macro_slashes_regex_list = ('IntDir', 'OutDir') + def _Translate(value, msbuild_settings): + tool_settings = _GetMSBuildToolSettings(msbuild_settings, tool) + if value == "0": + tool_settings["PreprocessToFile"] = "false" + tool_settings["PreprocessSuppressLineNumbers"] = "false" + elif value == "1": # /P + tool_settings["PreprocessToFile"] = "true" + tool_settings["PreprocessSuppressLineNumbers"] = "false" + elif value == "2": # /EP /P + tool_settings["PreprocessToFile"] = "true" + tool_settings["PreprocessSuppressLineNumbers"] = "true" + else: + raise ValueError("value must be one of [0, 1, 2]; got %s" % value) + + # Create a bogus validator that looks for '0', '1', or '2' + msvs_validator = _Enumeration(["a", "b", "c"]).ValidateMSVS + _msvs_validators[tool.msvs_name][msvs_name] = msvs_validator + msbuild_validator = _boolean.ValidateMSBuild + msbuild_tool_validators = _msbuild_validators[tool.msbuild_name] + msbuild_tool_validators["PreprocessToFile"] = msbuild_validator + msbuild_tool_validators["PreprocessSuppressLineNumbers"] = msbuild_validator + _msvs_to_msbuild_converters[tool.msvs_name][msvs_name] = _Translate + + +fix_vc_macro_slashes_regex_list = ("IntDir", "OutDir") fix_vc_macro_slashes_regex = re.compile( - r'(\$\((?:%s)\))(?:[\\/]+)' % "|".join(fix_vc_macro_slashes_regex_list) + r"(\$\((?:%s)\))(?:[\\/]+)" % "|".join(fix_vc_macro_slashes_regex_list) ) # Regular expression to detect keys that were generated by exclusion lists -_EXCLUDED_SUFFIX_RE = re.compile('^(.*)_excluded$') +_EXCLUDED_SUFFIX_RE = re.compile("^(.*)_excluded$") def _ValidateExclusionSetting(setting, settings, error_msg, stderr=sys.stderr): - """Verify that 'setting' is valid if it is generated from an exclusion list. + """Verify that 'setting' is valid if it is generated from an exclusion list. If the setting appears to be generated from an exclusion list, the root name is checked. @@ -394,57 +397,57 @@ def _ValidateExclusionSetting(setting, settings, error_msg, stderr=sys.stderr): error_msg: The message to emit in the event of error stderr: The stream receiving the error messages. """ - # This may be unrecognized because it's an exclusion list. If the - # setting name has the _excluded suffix, then check the root name. - unrecognized = True - m = re.match(_EXCLUDED_SUFFIX_RE, setting) - if m: - root_setting = m.group(1) - unrecognized = root_setting not in settings + # This may be unrecognized because it's an exclusion list. If the + # setting name has the _excluded suffix, then check the root name. + unrecognized = True + m = re.match(_EXCLUDED_SUFFIX_RE, setting) + if m: + root_setting = m.group(1) + unrecognized = root_setting not in settings - if unrecognized: - # We don't know this setting. Give a warning. - print(error_msg, file=stderr) + if unrecognized: + # We don't know this setting. Give a warning. + print(error_msg, file=stderr) def FixVCMacroSlashes(s): - """Replace macros which have excessive following slashes. + """Replace macros which have excessive following slashes. These macros are known to have a built-in trailing slash. Furthermore, many scripts hiccup on processing paths with extra slashes in the middle. This list is probably not exhaustive. Add as needed. """ - if '$' in s: - s = fix_vc_macro_slashes_regex.sub(r'\1', s) - return s + if "$" in s: + s = fix_vc_macro_slashes_regex.sub(r"\1", s) + return s def ConvertVCMacrosToMSBuild(s): - """Convert the MSVS macros found in the string to the MSBuild equivalent. + """Convert the MSVS macros found in the string to the MSBuild equivalent. This list is probably not exhaustive. Add as needed. """ - if '$' in s: - replace_map = { - '$(ConfigurationName)': '$(Configuration)', - '$(InputDir)': '%(RelativeDir)', - '$(InputExt)': '%(Extension)', - '$(InputFileName)': '%(Filename)%(Extension)', - '$(InputName)': '%(Filename)', - '$(InputPath)': '%(Identity)', - '$(ParentName)': '$(ProjectFileName)', - '$(PlatformName)': '$(Platform)', - '$(SafeInputName)': '%(Filename)', - } - for old, new in replace_map.items(): - s = s.replace(old, new) - s = FixVCMacroSlashes(s) - return s + if "$" in s: + replace_map = { + "$(ConfigurationName)": "$(Configuration)", + "$(InputDir)": "%(RelativeDir)", + "$(InputExt)": "%(Extension)", + "$(InputFileName)": "%(Filename)%(Extension)", + "$(InputName)": "%(Filename)", + "$(InputPath)": "%(Identity)", + "$(ParentName)": "$(ProjectFileName)", + "$(PlatformName)": "$(Platform)", + "$(SafeInputName)": "%(Filename)", + } + for old, new in replace_map.items(): + s = s.replace(old, new) + s = FixVCMacroSlashes(s) + return s def ConvertToMSBuildSettings(msvs_settings, stderr=sys.stderr): - """Converts MSVS settings (VS2008 and earlier) to MSBuild settings (VS2010+). + """Converts MSVS settings (VS2008 and earlier) to MSBuild settings (VS2010+). Args: msvs_settings: A dictionary. The key is the tool name. The values are @@ -456,55 +459,65 @@ def ConvertToMSBuildSettings(msvs_settings, stderr=sys.stderr): or the empty string (for the global settings). The values are themselves dictionaries of settings and their values. """ - msbuild_settings = {} - for msvs_tool_name, msvs_tool_settings in msvs_settings.items(): - if msvs_tool_name in _msvs_to_msbuild_converters: - msvs_tool = _msvs_to_msbuild_converters[msvs_tool_name] - for msvs_setting, msvs_value in msvs_tool_settings.items(): - if msvs_setting in msvs_tool: - # Invoke the translation function. - try: - msvs_tool[msvs_setting](msvs_value, msbuild_settings) - except ValueError as e: - print('Warning: while converting %s/%s to MSBuild, ' - '%s' % (msvs_tool_name, msvs_setting, e), file=stderr) + msbuild_settings = {} + for msvs_tool_name, msvs_tool_settings in msvs_settings.items(): + if msvs_tool_name in _msvs_to_msbuild_converters: + msvs_tool = _msvs_to_msbuild_converters[msvs_tool_name] + for msvs_setting, msvs_value in msvs_tool_settings.items(): + if msvs_setting in msvs_tool: + # Invoke the translation function. + try: + msvs_tool[msvs_setting](msvs_value, msbuild_settings) + except ValueError as e: + print( + "Warning: while converting %s/%s to MSBuild, " + "%s" % (msvs_tool_name, msvs_setting, e), + file=stderr, + ) + else: + _ValidateExclusionSetting( + msvs_setting, + msvs_tool, + ( + "Warning: unrecognized setting %s/%s " + "while converting to MSBuild." + % (msvs_tool_name, msvs_setting) + ), + stderr, + ) else: - _ValidateExclusionSetting(msvs_setting, - msvs_tool, - ('Warning: unrecognized setting %s/%s ' - 'while converting to MSBuild.' % - (msvs_tool_name, msvs_setting)), - stderr) - else: - print('Warning: unrecognized tool %s while converting to ' - 'MSBuild.' % msvs_tool_name, file=stderr) - return msbuild_settings + print( + "Warning: unrecognized tool %s while converting to " + "MSBuild." % msvs_tool_name, + file=stderr, + ) + return msbuild_settings def ValidateMSVSSettings(settings, stderr=sys.stderr): - """Validates that the names of the settings are valid for MSVS. + """Validates that the names of the settings are valid for MSVS. Args: settings: A dictionary. The key is the tool name. The values are themselves dictionaries of settings and their values. stderr: The stream receiving the error messages. """ - _ValidateSettings(_msvs_validators, settings, stderr) + _ValidateSettings(_msvs_validators, settings, stderr) def ValidateMSBuildSettings(settings, stderr=sys.stderr): - """Validates that the names of the settings are valid for MSBuild. + """Validates that the names of the settings are valid for MSBuild. Args: settings: A dictionary. The key is the tool name. The values are themselves dictionaries of settings and their values. stderr: The stream receiving the error messages. """ - _ValidateSettings(_msbuild_validators, settings, stderr) + _ValidateSettings(_msbuild_validators, settings, stderr) def _ValidateSettings(validators, settings, stderr): - """Validates that the settings are valid for MSBuild or MSVS. + """Validates that the settings are valid for MSBuild or MSVS. We currently only validate the names of the settings, not their values. @@ -514,36 +527,39 @@ def _ValidateSettings(validators, settings, stderr): themselves dictionaries of settings and their values. stderr: The stream receiving the error messages. """ - for tool_name in settings: - if tool_name in validators: - tool_validators = validators[tool_name] - for setting, value in settings[tool_name].items(): - if setting in tool_validators: - try: - tool_validators[setting](value) - except ValueError as e: - print('Warning: for %s/%s, %s' % - (tool_name, setting, e), file=stderr) - else: - _ValidateExclusionSetting(setting, - tool_validators, - ('Warning: unrecognized setting %s/%s' % - (tool_name, setting)), - stderr) + for tool_name in settings: + if tool_name in validators: + tool_validators = validators[tool_name] + for setting, value in settings[tool_name].items(): + if setting in tool_validators: + try: + tool_validators[setting](value) + except ValueError as e: + print( + "Warning: for %s/%s, %s" % (tool_name, setting, e), + file=stderr, + ) + else: + _ValidateExclusionSetting( + setting, + tool_validators, + ("Warning: unrecognized setting %s/%s" % (tool_name, setting)), + stderr, + ) - else: - print('Warning: unrecognized tool %s' % (tool_name), file=stderr) + else: + print("Warning: unrecognized tool %s" % (tool_name), file=stderr) # MSVS and MBuild names of the tools. -_compile = _Tool('VCCLCompilerTool', 'ClCompile') -_link = _Tool('VCLinkerTool', 'Link') -_midl = _Tool('VCMIDLTool', 'Midl') -_rc = _Tool('VCResourceCompilerTool', 'ResourceCompile') -_lib = _Tool('VCLibrarianTool', 'Lib') -_manifest = _Tool('VCManifestTool', 'Manifest') -_masm = _Tool('MASM', 'MASM') -_armasm = _Tool('ARMASM', 'ARMASM') +_compile = _Tool("VCCLCompilerTool", "ClCompile") +_link = _Tool("VCLinkerTool", "Link") +_midl = _Tool("VCMIDLTool", "Midl") +_rc = _Tool("VCResourceCompilerTool", "ResourceCompile") +_lib = _Tool("VCLibrarianTool", "Lib") +_manifest = _Tool("VCManifestTool", "Manifest") +_masm = _Tool("MASM", "MASM") +_armasm = _Tool("ARMASM", "ARMASM") _AddTool(_compile) @@ -555,9 +571,9 @@ def _ValidateSettings(validators, settings, stderr): _AddTool(_masm) _AddTool(_armasm) # Add sections only found in the MSBuild settings. -_msbuild_validators[''] = {} -_msbuild_validators['ProjectReference'] = {} -_msbuild_validators['ManifestResourceCompile'] = {} +_msbuild_validators[""] = {} +_msbuild_validators["ProjectReference"] = {} +_msbuild_validators["ManifestResourceCompile"] = {} # Descriptions of the compiler options, i.e. VCCLCompilerTool in MSVS and # ClCompile in MSBuild. @@ -565,166 +581,231 @@ def _ValidateSettings(validators, settings, stderr): # the schema of the MSBuild ClCompile settings. # Options that have the same name in MSVS and MSBuild -_Same(_compile, 'AdditionalIncludeDirectories', _folder_list) # /I -_Same(_compile, 'AdditionalOptions', _string_list) -_Same(_compile, 'AdditionalUsingDirectories', _folder_list) # /AI -_Same(_compile, 'AssemblerListingLocation', _file_name) # /Fa -_Same(_compile, 'BrowseInformationFile', _file_name) -_Same(_compile, 'BufferSecurityCheck', _boolean) # /GS -_Same(_compile, 'DisableLanguageExtensions', _boolean) # /Za -_Same(_compile, 'DisableSpecificWarnings', _string_list) # /wd -_Same(_compile, 'EnableFiberSafeOptimizations', _boolean) # /GT -_Same(_compile, 'EnablePREfast', _boolean) # /analyze Visible='false' -_Same(_compile, 'ExpandAttributedSource', _boolean) # /Fx -_Same(_compile, 'FloatingPointExceptions', _boolean) # /fp:except -_Same(_compile, 'ForceConformanceInForLoopScope', _boolean) # /Zc:forScope -_Same(_compile, 'ForcedIncludeFiles', _file_list) # /FI -_Same(_compile, 'ForcedUsingFiles', _file_list) # /FU -_Same(_compile, 'GenerateXMLDocumentationFiles', _boolean) # /doc -_Same(_compile, 'IgnoreStandardIncludePath', _boolean) # /X -_Same(_compile, 'MinimalRebuild', _boolean) # /Gm -_Same(_compile, 'OmitDefaultLibName', _boolean) # /Zl -_Same(_compile, 'OmitFramePointers', _boolean) # /Oy -_Same(_compile, 'PreprocessorDefinitions', _string_list) # /D -_Same(_compile, 'ProgramDataBaseFileName', _file_name) # /Fd -_Same(_compile, 'RuntimeTypeInfo', _boolean) # /GR -_Same(_compile, 'ShowIncludes', _boolean) # /showIncludes -_Same(_compile, 'SmallerTypeCheck', _boolean) # /RTCc -_Same(_compile, 'StringPooling', _boolean) # /GF -_Same(_compile, 'SuppressStartupBanner', _boolean) # /nologo -_Same(_compile, 'TreatWChar_tAsBuiltInType', _boolean) # /Zc:wchar_t -_Same(_compile, 'UndefineAllPreprocessorDefinitions', _boolean) # /u -_Same(_compile, 'UndefinePreprocessorDefinitions', _string_list) # /U -_Same(_compile, 'UseFullPaths', _boolean) # /FC -_Same(_compile, 'WholeProgramOptimization', _boolean) # /GL -_Same(_compile, 'XMLDocumentationFileName', _file_name) - -_Same(_compile, 'AssemblerOutput', - _Enumeration(['NoListing', - 'AssemblyCode', # /FA - 'All', # /FAcs - 'AssemblyAndMachineCode', # /FAc - 'AssemblyAndSourceCode'])) # /FAs -_Same(_compile, 'BasicRuntimeChecks', - _Enumeration(['Default', - 'StackFrameRuntimeCheck', # /RTCs - 'UninitializedLocalUsageCheck', # /RTCu - 'EnableFastChecks'])) # /RTC1 -_Same(_compile, 'BrowseInformation', - _Enumeration(['false', - 'true', # /FR - 'true'])) # /Fr -_Same(_compile, 'CallingConvention', - _Enumeration(['Cdecl', # /Gd - 'FastCall', # /Gr - 'StdCall', # /Gz - 'VectorCall'])) # /Gv -_Same(_compile, 'CompileAs', - _Enumeration(['Default', - 'CompileAsC', # /TC - 'CompileAsCpp'])) # /TP -_Same(_compile, 'DebugInformationFormat', - _Enumeration(['', # Disabled - 'OldStyle', # /Z7 - None, - 'ProgramDatabase', # /Zi - 'EditAndContinue'])) # /ZI -_Same(_compile, 'EnableEnhancedInstructionSet', - _Enumeration(['NotSet', - 'StreamingSIMDExtensions', # /arch:SSE - 'StreamingSIMDExtensions2', # /arch:SSE2 - 'AdvancedVectorExtensions', # /arch:AVX (vs2012+) - 'NoExtensions', # /arch:IA32 (vs2012+) - # This one only exists in the new msbuild format. - 'AdvancedVectorExtensions2', # /arch:AVX2 (vs2013r2+) - ])) -_Same(_compile, 'ErrorReporting', - _Enumeration(['None', # /errorReport:none - 'Prompt', # /errorReport:prompt - 'Queue'], # /errorReport:queue - new=['Send'])) # /errorReport:send" -_Same(_compile, 'ExceptionHandling', - _Enumeration(['false', - 'Sync', # /EHsc - 'Async'], # /EHa - new=['SyncCThrow'])) # /EHs -_Same(_compile, 'FavorSizeOrSpeed', - _Enumeration(['Neither', - 'Speed', # /Ot - 'Size'])) # /Os -_Same(_compile, 'FloatingPointModel', - _Enumeration(['Precise', # /fp:precise - 'Strict', # /fp:strict - 'Fast'])) # /fp:fast -_Same(_compile, 'InlineFunctionExpansion', - _Enumeration(['Default', - 'OnlyExplicitInline', # /Ob1 - 'AnySuitable'], # /Ob2 - new=['Disabled'])) # /Ob0 -_Same(_compile, 'Optimization', - _Enumeration(['Disabled', # /Od - 'MinSpace', # /O1 - 'MaxSpeed', # /O2 - 'Full'])) # /Ox -_Same(_compile, 'RuntimeLibrary', - _Enumeration(['MultiThreaded', # /MT - 'MultiThreadedDebug', # /MTd - 'MultiThreadedDLL', # /MD - 'MultiThreadedDebugDLL'])) # /MDd -_Same(_compile, 'StructMemberAlignment', - _Enumeration(['Default', - '1Byte', # /Zp1 - '2Bytes', # /Zp2 - '4Bytes', # /Zp4 - '8Bytes', # /Zp8 - '16Bytes'])) # /Zp16 -_Same(_compile, 'WarningLevel', - _Enumeration(['TurnOffAllWarnings', # /W0 - 'Level1', # /W1 - 'Level2', # /W2 - 'Level3', # /W3 - 'Level4'], # /W4 - new=['EnableAllWarnings'])) # /Wall +_Same(_compile, "AdditionalIncludeDirectories", _folder_list) # /I +_Same(_compile, "AdditionalOptions", _string_list) +_Same(_compile, "AdditionalUsingDirectories", _folder_list) # /AI +_Same(_compile, "AssemblerListingLocation", _file_name) # /Fa +_Same(_compile, "BrowseInformationFile", _file_name) +_Same(_compile, "BufferSecurityCheck", _boolean) # /GS +_Same(_compile, "DisableLanguageExtensions", _boolean) # /Za +_Same(_compile, "DisableSpecificWarnings", _string_list) # /wd +_Same(_compile, "EnableFiberSafeOptimizations", _boolean) # /GT +_Same(_compile, "EnablePREfast", _boolean) # /analyze Visible='false' +_Same(_compile, "ExpandAttributedSource", _boolean) # /Fx +_Same(_compile, "FloatingPointExceptions", _boolean) # /fp:except +_Same(_compile, "ForceConformanceInForLoopScope", _boolean) # /Zc:forScope +_Same(_compile, "ForcedIncludeFiles", _file_list) # /FI +_Same(_compile, "ForcedUsingFiles", _file_list) # /FU +_Same(_compile, "GenerateXMLDocumentationFiles", _boolean) # /doc +_Same(_compile, "IgnoreStandardIncludePath", _boolean) # /X +_Same(_compile, "MinimalRebuild", _boolean) # /Gm +_Same(_compile, "OmitDefaultLibName", _boolean) # /Zl +_Same(_compile, "OmitFramePointers", _boolean) # /Oy +_Same(_compile, "PreprocessorDefinitions", _string_list) # /D +_Same(_compile, "ProgramDataBaseFileName", _file_name) # /Fd +_Same(_compile, "RuntimeTypeInfo", _boolean) # /GR +_Same(_compile, "ShowIncludes", _boolean) # /showIncludes +_Same(_compile, "SmallerTypeCheck", _boolean) # /RTCc +_Same(_compile, "StringPooling", _boolean) # /GF +_Same(_compile, "SuppressStartupBanner", _boolean) # /nologo +_Same(_compile, "TreatWChar_tAsBuiltInType", _boolean) # /Zc:wchar_t +_Same(_compile, "UndefineAllPreprocessorDefinitions", _boolean) # /u +_Same(_compile, "UndefinePreprocessorDefinitions", _string_list) # /U +_Same(_compile, "UseFullPaths", _boolean) # /FC +_Same(_compile, "WholeProgramOptimization", _boolean) # /GL +_Same(_compile, "XMLDocumentationFileName", _file_name) +_Same(_compile, "CompileAsWinRT", _boolean) # /ZW + +_Same( + _compile, + "AssemblerOutput", + _Enumeration( + [ + "NoListing", + "AssemblyCode", # /FA + "All", # /FAcs + "AssemblyAndMachineCode", # /FAc + "AssemblyAndSourceCode", + ] + ), +) # /FAs +_Same( + _compile, + "BasicRuntimeChecks", + _Enumeration( + [ + "Default", + "StackFrameRuntimeCheck", # /RTCs + "UninitializedLocalUsageCheck", # /RTCu + "EnableFastChecks", + ] + ), +) # /RTC1 +_Same( + _compile, "BrowseInformation", _Enumeration(["false", "true", "true"]) # /FR +) # /Fr +_Same( + _compile, + "CallingConvention", + _Enumeration(["Cdecl", "FastCall", "StdCall", "VectorCall"]), # /Gd # /Gr # /Gz +) # /Gv +_Same( + _compile, + "CompileAs", + _Enumeration(["Default", "CompileAsC", "CompileAsCpp"]), # /TC +) # /TP +_Same( + _compile, + "DebugInformationFormat", + _Enumeration( + [ + "", # Disabled + "OldStyle", # /Z7 + None, + "ProgramDatabase", # /Zi + "EditAndContinue", + ] + ), +) # /ZI +_Same( + _compile, + "EnableEnhancedInstructionSet", + _Enumeration( + [ + "NotSet", + "StreamingSIMDExtensions", # /arch:SSE + "StreamingSIMDExtensions2", # /arch:SSE2 + "AdvancedVectorExtensions", # /arch:AVX (vs2012+) + "NoExtensions", # /arch:IA32 (vs2012+) + # This one only exists in the new msbuild format. + "AdvancedVectorExtensions2", # /arch:AVX2 (vs2013r2+) + ] + ), +) +_Same( + _compile, + "ErrorReporting", + _Enumeration( + [ + "None", # /errorReport:none + "Prompt", # /errorReport:prompt + "Queue", + ], # /errorReport:queue + new=["Send"], + ), +) # /errorReport:send" +_Same( + _compile, + "ExceptionHandling", + _Enumeration(["false", "Sync", "Async"], new=["SyncCThrow"]), # /EHsc # /EHa +) # /EHs +_Same( + _compile, "FavorSizeOrSpeed", _Enumeration(["Neither", "Speed", "Size"]) # /Ot +) # /Os +_Same( + _compile, + "FloatingPointModel", + _Enumeration(["Precise", "Strict", "Fast"]), # /fp:precise # /fp:strict +) # /fp:fast +_Same( + _compile, + "InlineFunctionExpansion", + _Enumeration( + ["Default", "OnlyExplicitInline", "AnySuitable"], # /Ob1 # /Ob2 + new=["Disabled"], + ), +) # /Ob0 +_Same( + _compile, + "Optimization", + _Enumeration(["Disabled", "MinSpace", "MaxSpeed", "Full"]), # /Od # /O1 # /O2 +) # /Ox +_Same( + _compile, + "RuntimeLibrary", + _Enumeration( + [ + "MultiThreaded", # /MT + "MultiThreadedDebug", # /MTd + "MultiThreadedDLL", # /MD + "MultiThreadedDebugDLL", + ] + ), +) # /MDd +_Same( + _compile, + "StructMemberAlignment", + _Enumeration( + [ + "Default", + "1Byte", # /Zp1 + "2Bytes", # /Zp2 + "4Bytes", # /Zp4 + "8Bytes", # /Zp8 + "16Bytes", + ] + ), +) # /Zp16 +_Same( + _compile, + "WarningLevel", + _Enumeration( + [ + "TurnOffAllWarnings", # /W0 + "Level1", # /W1 + "Level2", # /W2 + "Level3", # /W3 + "Level4", + ], # /W4 + new=["EnableAllWarnings"], + ), +) # /Wall # Options found in MSVS that have been renamed in MSBuild. -_Renamed(_compile, 'EnableFunctionLevelLinking', 'FunctionLevelLinking', - _boolean) # /Gy -_Renamed(_compile, 'EnableIntrinsicFunctions', 'IntrinsicFunctions', - _boolean) # /Oi -_Renamed(_compile, 'KeepComments', 'PreprocessKeepComments', _boolean) # /C -_Renamed(_compile, 'ObjectFile', 'ObjectFileName', _file_name) # /Fo -_Renamed(_compile, 'OpenMP', 'OpenMPSupport', _boolean) # /openmp -_Renamed(_compile, 'PrecompiledHeaderThrough', 'PrecompiledHeaderFile', - _file_name) # Used with /Yc and /Yu -_Renamed(_compile, 'PrecompiledHeaderFile', 'PrecompiledHeaderOutputFile', - _file_name) # /Fp -_Renamed(_compile, 'UsePrecompiledHeader', 'PrecompiledHeader', - _Enumeration(['NotUsing', # VS recognized '' for this value too. - 'Create', # /Yc - 'Use'])) # /Yu -_Renamed(_compile, 'WarnAsError', 'TreatWarningAsError', _boolean) # /WX - -_ConvertedToAdditionalOption(_compile, 'DefaultCharIsUnsigned', '/J') +_Renamed( + _compile, "EnableFunctionLevelLinking", "FunctionLevelLinking", _boolean +) # /Gy +_Renamed(_compile, "EnableIntrinsicFunctions", "IntrinsicFunctions", _boolean) # /Oi +_Renamed(_compile, "KeepComments", "PreprocessKeepComments", _boolean) # /C +_Renamed(_compile, "ObjectFile", "ObjectFileName", _file_name) # /Fo +_Renamed(_compile, "OpenMP", "OpenMPSupport", _boolean) # /openmp +_Renamed( + _compile, "PrecompiledHeaderThrough", "PrecompiledHeaderFile", _file_name +) # Used with /Yc and /Yu +_Renamed( + _compile, "PrecompiledHeaderFile", "PrecompiledHeaderOutputFile", _file_name +) # /Fp +_Renamed( + _compile, + "UsePrecompiledHeader", + "PrecompiledHeader", + _Enumeration( + ["NotUsing", "Create", "Use"] # VS recognized '' for this value too. # /Yc + ), +) # /Yu +_Renamed(_compile, "WarnAsError", "TreatWarningAsError", _boolean) # /WX + +_ConvertedToAdditionalOption(_compile, "DefaultCharIsUnsigned", "/J") # MSVS options not found in MSBuild. -_MSVSOnly(_compile, 'Detect64BitPortabilityProblems', _boolean) -_MSVSOnly(_compile, 'UseUnicodeResponseFiles', _boolean) +_MSVSOnly(_compile, "Detect64BitPortabilityProblems", _boolean) +_MSVSOnly(_compile, "UseUnicodeResponseFiles", _boolean) # MSBuild options not found in MSVS. -_MSBuildOnly(_compile, 'BuildingInIDE', _boolean) -_MSBuildOnly(_compile, 'CompileAsManaged', - _Enumeration([], new=['false', - 'true'])) # /clr -_MSBuildOnly(_compile, 'CreateHotpatchableImage', _boolean) # /hotpatch -_MSBuildOnly(_compile, 'MultiProcessorCompilation', _boolean) # /MP -_MSBuildOnly(_compile, 'PreprocessOutputPath', _string) # /Fi -_MSBuildOnly(_compile, 'ProcessorNumber', _integer) # the number of processors -_MSBuildOnly(_compile, 'TrackerLogDirectory', _folder_name) -_MSBuildOnly(_compile, 'TreatSpecificWarningsAsErrors', _string_list) # /we -_MSBuildOnly(_compile, 'UseUnicodeForAssemblerListing', _boolean) # /FAu +_MSBuildOnly(_compile, "BuildingInIDE", _boolean) +_MSBuildOnly( + _compile, "CompileAsManaged", _Enumeration([], new=["false", "true"]) +) # /clr +_MSBuildOnly(_compile, "CreateHotpatchableImage", _boolean) # /hotpatch +_MSBuildOnly(_compile, "MultiProcessorCompilation", _boolean) # /MP +_MSBuildOnly(_compile, "PreprocessOutputPath", _string) # /Fi +_MSBuildOnly(_compile, "ProcessorNumber", _integer) # the number of processors +_MSBuildOnly(_compile, "TrackerLogDirectory", _folder_name) +_MSBuildOnly(_compile, "TreatSpecificWarningsAsErrors", _string_list) # /we +_MSBuildOnly(_compile, "UseUnicodeForAssemblerListing", _boolean) # /FAu # Defines a setting that needs very customized processing -_CustomGeneratePreprocessedFile(_compile, 'GeneratePreprocessedFile') +_CustomGeneratePreprocessedFile(_compile, "GeneratePreprocessedFile") # Directives for converting MSVS VCLinkerTool to MSBuild Link. @@ -732,326 +813,411 @@ def _ValidateSettings(validators, settings, stderr): # the schema of the MSBuild Link settings. # Options that have the same name in MSVS and MSBuild -_Same(_link, 'AdditionalDependencies', _file_list) -_Same(_link, 'AdditionalLibraryDirectories', _folder_list) # /LIBPATH +_Same(_link, "AdditionalDependencies", _file_list) +_Same(_link, "AdditionalLibraryDirectories", _folder_list) # /LIBPATH # /MANIFESTDEPENDENCY: -_Same(_link, 'AdditionalManifestDependencies', _file_list) -_Same(_link, 'AdditionalOptions', _string_list) -_Same(_link, 'AddModuleNamesToAssembly', _file_list) # /ASSEMBLYMODULE -_Same(_link, 'AllowIsolation', _boolean) # /ALLOWISOLATION -_Same(_link, 'AssemblyLinkResource', _file_list) # /ASSEMBLYLINKRESOURCE -_Same(_link, 'BaseAddress', _string) # /BASE -_Same(_link, 'CLRUnmanagedCodeCheck', _boolean) # /CLRUNMANAGEDCODECHECK -_Same(_link, 'DelayLoadDLLs', _file_list) # /DELAYLOAD -_Same(_link, 'DelaySign', _boolean) # /DELAYSIGN -_Same(_link, 'EmbedManagedResourceFile', _file_list) # /ASSEMBLYRESOURCE -_Same(_link, 'EnableUAC', _boolean) # /MANIFESTUAC -_Same(_link, 'EntryPointSymbol', _string) # /ENTRY -_Same(_link, 'ForceSymbolReferences', _file_list) # /INCLUDE -_Same(_link, 'FunctionOrder', _file_name) # /ORDER -_Same(_link, 'GenerateDebugInformation', _boolean) # /DEBUG -_Same(_link, 'GenerateMapFile', _boolean) # /MAP -_Same(_link, 'HeapCommitSize', _string) -_Same(_link, 'HeapReserveSize', _string) # /HEAP -_Same(_link, 'IgnoreAllDefaultLibraries', _boolean) # /NODEFAULTLIB -_Same(_link, 'IgnoreEmbeddedIDL', _boolean) # /IGNOREIDL -_Same(_link, 'ImportLibrary', _file_name) # /IMPLIB -_Same(_link, 'KeyContainer', _file_name) # /KEYCONTAINER -_Same(_link, 'KeyFile', _file_name) # /KEYFILE -_Same(_link, 'ManifestFile', _file_name) # /ManifestFile -_Same(_link, 'MapExports', _boolean) # /MAPINFO:EXPORTS -_Same(_link, 'MapFileName', _file_name) -_Same(_link, 'MergedIDLBaseFileName', _file_name) # /IDLOUT -_Same(_link, 'MergeSections', _string) # /MERGE -_Same(_link, 'MidlCommandFile', _file_name) # /MIDL -_Same(_link, 'ModuleDefinitionFile', _file_name) # /DEF -_Same(_link, 'OutputFile', _file_name) # /OUT -_Same(_link, 'PerUserRedirection', _boolean) -_Same(_link, 'Profile', _boolean) # /PROFILE -_Same(_link, 'ProfileGuidedDatabase', _file_name) # /PGD -_Same(_link, 'ProgramDatabaseFile', _file_name) # /PDB -_Same(_link, 'RegisterOutput', _boolean) -_Same(_link, 'SetChecksum', _boolean) # /RELEASE -_Same(_link, 'StackCommitSize', _string) -_Same(_link, 'StackReserveSize', _string) # /STACK -_Same(_link, 'StripPrivateSymbols', _file_name) # /PDBSTRIPPED -_Same(_link, 'SupportUnloadOfDelayLoadedDLL', _boolean) # /DELAY:UNLOAD -_Same(_link, 'SuppressStartupBanner', _boolean) # /NOLOGO -_Same(_link, 'SwapRunFromCD', _boolean) # /SWAPRUN:CD -_Same(_link, 'TurnOffAssemblyGeneration', _boolean) # /NOASSEMBLY -_Same(_link, 'TypeLibraryFile', _file_name) # /TLBOUT -_Same(_link, 'TypeLibraryResourceID', _integer) # /TLBID -_Same(_link, 'UACUIAccess', _boolean) # /uiAccess='true' -_Same(_link, 'Version', _string) # /VERSION - -_Same(_link, 'EnableCOMDATFolding', _newly_boolean) # /OPT:ICF -_Same(_link, 'FixedBaseAddress', _newly_boolean) # /FIXED -_Same(_link, 'LargeAddressAware', _newly_boolean) # /LARGEADDRESSAWARE -_Same(_link, 'OptimizeReferences', _newly_boolean) # /OPT:REF -_Same(_link, 'RandomizedBaseAddress', _newly_boolean) # /DYNAMICBASE -_Same(_link, 'TerminalServerAware', _newly_boolean) # /TSAWARE +_Same(_link, "AdditionalManifestDependencies", _file_list) +_Same(_link, "AdditionalOptions", _string_list) +_Same(_link, "AddModuleNamesToAssembly", _file_list) # /ASSEMBLYMODULE +_Same(_link, "AllowIsolation", _boolean) # /ALLOWISOLATION +_Same(_link, "AssemblyLinkResource", _file_list) # /ASSEMBLYLINKRESOURCE +_Same(_link, "BaseAddress", _string) # /BASE +_Same(_link, "CLRUnmanagedCodeCheck", _boolean) # /CLRUNMANAGEDCODECHECK +_Same(_link, "DelayLoadDLLs", _file_list) # /DELAYLOAD +_Same(_link, "DelaySign", _boolean) # /DELAYSIGN +_Same(_link, "EmbedManagedResourceFile", _file_list) # /ASSEMBLYRESOURCE +_Same(_link, "EnableUAC", _boolean) # /MANIFESTUAC +_Same(_link, "EntryPointSymbol", _string) # /ENTRY +_Same(_link, "ForceSymbolReferences", _file_list) # /INCLUDE +_Same(_link, "FunctionOrder", _file_name) # /ORDER +_Same(_link, "GenerateDebugInformation", _boolean) # /DEBUG +_Same(_link, "GenerateMapFile", _boolean) # /MAP +_Same(_link, "HeapCommitSize", _string) +_Same(_link, "HeapReserveSize", _string) # /HEAP +_Same(_link, "IgnoreAllDefaultLibraries", _boolean) # /NODEFAULTLIB +_Same(_link, "IgnoreEmbeddedIDL", _boolean) # /IGNOREIDL +_Same(_link, "ImportLibrary", _file_name) # /IMPLIB +_Same(_link, "KeyContainer", _file_name) # /KEYCONTAINER +_Same(_link, "KeyFile", _file_name) # /KEYFILE +_Same(_link, "ManifestFile", _file_name) # /ManifestFile +_Same(_link, "MapExports", _boolean) # /MAPINFO:EXPORTS +_Same(_link, "MapFileName", _file_name) +_Same(_link, "MergedIDLBaseFileName", _file_name) # /IDLOUT +_Same(_link, "MergeSections", _string) # /MERGE +_Same(_link, "MidlCommandFile", _file_name) # /MIDL +_Same(_link, "ModuleDefinitionFile", _file_name) # /DEF +_Same(_link, "OutputFile", _file_name) # /OUT +_Same(_link, "PerUserRedirection", _boolean) +_Same(_link, "Profile", _boolean) # /PROFILE +_Same(_link, "ProfileGuidedDatabase", _file_name) # /PGD +_Same(_link, "ProgramDatabaseFile", _file_name) # /PDB +_Same(_link, "RegisterOutput", _boolean) +_Same(_link, "SetChecksum", _boolean) # /RELEASE +_Same(_link, "StackCommitSize", _string) +_Same(_link, "StackReserveSize", _string) # /STACK +_Same(_link, "StripPrivateSymbols", _file_name) # /PDBSTRIPPED +_Same(_link, "SupportUnloadOfDelayLoadedDLL", _boolean) # /DELAY:UNLOAD +_Same(_link, "SuppressStartupBanner", _boolean) # /NOLOGO +_Same(_link, "SwapRunFromCD", _boolean) # /SWAPRUN:CD +_Same(_link, "TurnOffAssemblyGeneration", _boolean) # /NOASSEMBLY +_Same(_link, "TypeLibraryFile", _file_name) # /TLBOUT +_Same(_link, "TypeLibraryResourceID", _integer) # /TLBID +_Same(_link, "UACUIAccess", _boolean) # /uiAccess='true' +_Same(_link, "Version", _string) # /VERSION + +_Same(_link, "EnableCOMDATFolding", _newly_boolean) # /OPT:ICF +_Same(_link, "FixedBaseAddress", _newly_boolean) # /FIXED +_Same(_link, "LargeAddressAware", _newly_boolean) # /LARGEADDRESSAWARE +_Same(_link, "OptimizeReferences", _newly_boolean) # /OPT:REF +_Same(_link, "RandomizedBaseAddress", _newly_boolean) # /DYNAMICBASE +_Same(_link, "TerminalServerAware", _newly_boolean) # /TSAWARE _subsystem_enumeration = _Enumeration( - ['NotSet', - 'Console', # /SUBSYSTEM:CONSOLE - 'Windows', # /SUBSYSTEM:WINDOWS - 'Native', # /SUBSYSTEM:NATIVE - 'EFI Application', # /SUBSYSTEM:EFI_APPLICATION - 'EFI Boot Service Driver', # /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER - 'EFI ROM', # /SUBSYSTEM:EFI_ROM - 'EFI Runtime', # /SUBSYSTEM:EFI_RUNTIME_DRIVER - 'WindowsCE'], # /SUBSYSTEM:WINDOWSCE - new=['POSIX']) # /SUBSYSTEM:POSIX + [ + "NotSet", + "Console", # /SUBSYSTEM:CONSOLE + "Windows", # /SUBSYSTEM:WINDOWS + "Native", # /SUBSYSTEM:NATIVE + "EFI Application", # /SUBSYSTEM:EFI_APPLICATION + "EFI Boot Service Driver", # /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER + "EFI ROM", # /SUBSYSTEM:EFI_ROM + "EFI Runtime", # /SUBSYSTEM:EFI_RUNTIME_DRIVER + "WindowsCE", + ], # /SUBSYSTEM:WINDOWSCE + new=["POSIX"], +) # /SUBSYSTEM:POSIX _target_machine_enumeration = _Enumeration( - ['NotSet', - 'MachineX86', # /MACHINE:X86 - None, - 'MachineARM', # /MACHINE:ARM - 'MachineEBC', # /MACHINE:EBC - 'MachineIA64', # /MACHINE:IA64 - None, - 'MachineMIPS', # /MACHINE:MIPS - 'MachineMIPS16', # /MACHINE:MIPS16 - 'MachineMIPSFPU', # /MACHINE:MIPSFPU - 'MachineMIPSFPU16', # /MACHINE:MIPSFPU16 - None, - None, - None, - 'MachineSH4', # /MACHINE:SH4 - None, - 'MachineTHUMB', # /MACHINE:THUMB - 'MachineX64']) # /MACHINE:X64 - -_Same(_link, 'AssemblyDebug', - _Enumeration(['', - 'true', # /ASSEMBLYDEBUG - 'false'])) # /ASSEMBLYDEBUG:DISABLE -_Same(_link, 'CLRImageType', - _Enumeration(['Default', - 'ForceIJWImage', # /CLRIMAGETYPE:IJW - 'ForcePureILImage', # /Switch="CLRIMAGETYPE:PURE - 'ForceSafeILImage'])) # /Switch="CLRIMAGETYPE:SAFE -_Same(_link, 'CLRThreadAttribute', - _Enumeration(['DefaultThreadingAttribute', # /CLRTHREADATTRIBUTE:NONE - 'MTAThreadingAttribute', # /CLRTHREADATTRIBUTE:MTA - 'STAThreadingAttribute'])) # /CLRTHREADATTRIBUTE:STA -_Same(_link, 'DataExecutionPrevention', - _Enumeration(['', - 'false', # /NXCOMPAT:NO - 'true'])) # /NXCOMPAT -_Same(_link, 'Driver', - _Enumeration(['NotSet', - 'Driver', # /Driver - 'UpOnly', # /DRIVER:UPONLY - 'WDM'])) # /DRIVER:WDM -_Same(_link, 'LinkTimeCodeGeneration', - _Enumeration(['Default', - 'UseLinkTimeCodeGeneration', # /LTCG - 'PGInstrument', # /LTCG:PGInstrument - 'PGOptimization', # /LTCG:PGOptimize - 'PGUpdate'])) # /LTCG:PGUpdate -_Same(_link, 'ShowProgress', - _Enumeration(['NotSet', - 'LinkVerbose', # /VERBOSE - 'LinkVerboseLib'], # /VERBOSE:Lib - new=['LinkVerboseICF', # /VERBOSE:ICF - 'LinkVerboseREF', # /VERBOSE:REF - 'LinkVerboseSAFESEH', # /VERBOSE:SAFESEH - 'LinkVerboseCLR'])) # /VERBOSE:CLR -_Same(_link, 'SubSystem', _subsystem_enumeration) -_Same(_link, 'TargetMachine', _target_machine_enumeration) -_Same(_link, 'UACExecutionLevel', - _Enumeration(['AsInvoker', # /level='asInvoker' - 'HighestAvailable', # /level='highestAvailable' - 'RequireAdministrator'])) # /level='requireAdministrator' -_Same(_link, 'MinimumRequiredVersion', _string) -_Same(_link, 'TreatLinkerWarningAsErrors', _boolean) # /WX + [ + "NotSet", + "MachineX86", # /MACHINE:X86 + None, + "MachineARM", # /MACHINE:ARM + "MachineEBC", # /MACHINE:EBC + "MachineIA64", # /MACHINE:IA64 + None, + "MachineMIPS", # /MACHINE:MIPS + "MachineMIPS16", # /MACHINE:MIPS16 + "MachineMIPSFPU", # /MACHINE:MIPSFPU + "MachineMIPSFPU16", # /MACHINE:MIPSFPU16 + None, + None, + None, + "MachineSH4", # /MACHINE:SH4 + None, + "MachineTHUMB", # /MACHINE:THUMB + "MachineX64", + ] +) # /MACHINE:X64 + +_Same( + _link, "AssemblyDebug", _Enumeration(["", "true", "false"]) # /ASSEMBLYDEBUG +) # /ASSEMBLYDEBUG:DISABLE +_Same( + _link, + "CLRImageType", + _Enumeration( + [ + "Default", + "ForceIJWImage", # /CLRIMAGETYPE:IJW + "ForcePureILImage", # /Switch="CLRIMAGETYPE:PURE + "ForceSafeILImage", + ] + ), +) # /Switch="CLRIMAGETYPE:SAFE +_Same( + _link, + "CLRThreadAttribute", + _Enumeration( + [ + "DefaultThreadingAttribute", # /CLRTHREADATTRIBUTE:NONE + "MTAThreadingAttribute", # /CLRTHREADATTRIBUTE:MTA + "STAThreadingAttribute", + ] + ), +) # /CLRTHREADATTRIBUTE:STA +_Same( + _link, + "DataExecutionPrevention", + _Enumeration(["", "false", "true"]), # /NXCOMPAT:NO +) # /NXCOMPAT +_Same( + _link, + "Driver", + _Enumeration(["NotSet", "Driver", "UpOnly", "WDM"]), # /Driver # /DRIVER:UPONLY +) # /DRIVER:WDM +_Same( + _link, + "LinkTimeCodeGeneration", + _Enumeration( + [ + "Default", + "UseLinkTimeCodeGeneration", # /LTCG + "PGInstrument", # /LTCG:PGInstrument + "PGOptimization", # /LTCG:PGOptimize + "PGUpdate", + ] + ), +) # /LTCG:PGUpdate +_Same( + _link, + "ShowProgress", + _Enumeration( + ["NotSet", "LinkVerbose", "LinkVerboseLib"], # /VERBOSE # /VERBOSE:Lib + new=[ + "LinkVerboseICF", # /VERBOSE:ICF + "LinkVerboseREF", # /VERBOSE:REF + "LinkVerboseSAFESEH", # /VERBOSE:SAFESEH + "LinkVerboseCLR", + ], + ), +) # /VERBOSE:CLR +_Same(_link, "SubSystem", _subsystem_enumeration) +_Same(_link, "TargetMachine", _target_machine_enumeration) +_Same( + _link, + "UACExecutionLevel", + _Enumeration( + [ + "AsInvoker", # /level='asInvoker' + "HighestAvailable", # /level='highestAvailable' + "RequireAdministrator", + ] + ), +) # /level='requireAdministrator' +_Same(_link, "MinimumRequiredVersion", _string) +_Same(_link, "TreatLinkerWarningAsErrors", _boolean) # /WX # Options found in MSVS that have been renamed in MSBuild. -_Renamed(_link, 'ErrorReporting', 'LinkErrorReporting', - _Enumeration(['NoErrorReport', # /ERRORREPORT:NONE - 'PromptImmediately', # /ERRORREPORT:PROMPT - 'QueueForNextLogin'], # /ERRORREPORT:QUEUE - new=['SendErrorReport'])) # /ERRORREPORT:SEND -_Renamed(_link, 'IgnoreDefaultLibraryNames', 'IgnoreSpecificDefaultLibraries', - _file_list) # /NODEFAULTLIB -_Renamed(_link, 'ResourceOnlyDLL', 'NoEntryPoint', _boolean) # /NOENTRY -_Renamed(_link, 'SwapRunFromNet', 'SwapRunFromNET', _boolean) # /SWAPRUN:NET - -_Moved(_link, 'GenerateManifest', '', _boolean) -_Moved(_link, 'IgnoreImportLibrary', '', _boolean) -_Moved(_link, 'LinkIncremental', '', _newly_boolean) -_Moved(_link, 'LinkLibraryDependencies', 'ProjectReference', _boolean) -_Moved(_link, 'UseLibraryDependencyInputs', 'ProjectReference', _boolean) +_Renamed( + _link, + "ErrorReporting", + "LinkErrorReporting", + _Enumeration( + [ + "NoErrorReport", # /ERRORREPORT:NONE + "PromptImmediately", # /ERRORREPORT:PROMPT + "QueueForNextLogin", + ], # /ERRORREPORT:QUEUE + new=["SendErrorReport"], + ), +) # /ERRORREPORT:SEND +_Renamed( + _link, "IgnoreDefaultLibraryNames", "IgnoreSpecificDefaultLibraries", _file_list +) # /NODEFAULTLIB +_Renamed(_link, "ResourceOnlyDLL", "NoEntryPoint", _boolean) # /NOENTRY +_Renamed(_link, "SwapRunFromNet", "SwapRunFromNET", _boolean) # /SWAPRUN:NET + +_Moved(_link, "GenerateManifest", "", _boolean) +_Moved(_link, "IgnoreImportLibrary", "", _boolean) +_Moved(_link, "LinkIncremental", "", _newly_boolean) +_Moved(_link, "LinkLibraryDependencies", "ProjectReference", _boolean) +_Moved(_link, "UseLibraryDependencyInputs", "ProjectReference", _boolean) # MSVS options not found in MSBuild. -_MSVSOnly(_link, 'OptimizeForWindows98', _newly_boolean) -_MSVSOnly(_link, 'UseUnicodeResponseFiles', _boolean) +_MSVSOnly(_link, "OptimizeForWindows98", _newly_boolean) +_MSVSOnly(_link, "UseUnicodeResponseFiles", _boolean) # MSBuild options not found in MSVS. -_MSBuildOnly(_link, 'BuildingInIDE', _boolean) -_MSBuildOnly(_link, 'ImageHasSafeExceptionHandlers', _boolean) # /SAFESEH -_MSBuildOnly(_link, 'LinkDLL', _boolean) # /DLL Visible='false' -_MSBuildOnly(_link, 'LinkStatus', _boolean) # /LTCG:STATUS -_MSBuildOnly(_link, 'PreventDllBinding', _boolean) # /ALLOWBIND -_MSBuildOnly(_link, 'SupportNobindOfDelayLoadedDLL', _boolean) # /DELAY:NOBIND -_MSBuildOnly(_link, 'TrackerLogDirectory', _folder_name) -_MSBuildOnly(_link, 'MSDOSStubFileName', _file_name) # /STUB Visible='false' -_MSBuildOnly(_link, 'SectionAlignment', _integer) # /ALIGN -_MSBuildOnly(_link, 'SpecifySectionAttributes', _string) # /SECTION -_MSBuildOnly(_link, 'ForceFileOutput', - _Enumeration([], new=['Enabled', # /FORCE - # /FORCE:MULTIPLE - 'MultiplyDefinedSymbolOnly', - 'UndefinedSymbolOnly'])) # /FORCE:UNRESOLVED -_MSBuildOnly(_link, 'CreateHotPatchableImage', - _Enumeration([], new=['Enabled', # /FUNCTIONPADMIN - 'X86Image', # /FUNCTIONPADMIN:5 - 'X64Image', # /FUNCTIONPADMIN:6 - 'ItaniumImage'])) # /FUNCTIONPADMIN:16 -_MSBuildOnly(_link, 'CLRSupportLastError', - _Enumeration([], new=['Enabled', # /CLRSupportLastError - 'Disabled', # /CLRSupportLastError:NO - # /CLRSupportLastError:SYSTEMDLL - 'SystemDlls'])) +_MSBuildOnly(_link, "BuildingInIDE", _boolean) +_MSBuildOnly(_link, "ImageHasSafeExceptionHandlers", _boolean) # /SAFESEH +_MSBuildOnly(_link, "LinkDLL", _boolean) # /DLL Visible='false' +_MSBuildOnly(_link, "LinkStatus", _boolean) # /LTCG:STATUS +_MSBuildOnly(_link, "PreventDllBinding", _boolean) # /ALLOWBIND +_MSBuildOnly(_link, "SupportNobindOfDelayLoadedDLL", _boolean) # /DELAY:NOBIND +_MSBuildOnly(_link, "TrackerLogDirectory", _folder_name) +_MSBuildOnly(_link, "MSDOSStubFileName", _file_name) # /STUB Visible='false' +_MSBuildOnly(_link, "SectionAlignment", _integer) # /ALIGN +_MSBuildOnly(_link, "SpecifySectionAttributes", _string) # /SECTION +_MSBuildOnly( + _link, + "ForceFileOutput", + _Enumeration( + [], + new=[ + "Enabled", # /FORCE + # /FORCE:MULTIPLE + "MultiplyDefinedSymbolOnly", + "UndefinedSymbolOnly", + ], + ), +) # /FORCE:UNRESOLVED +_MSBuildOnly( + _link, + "CreateHotPatchableImage", + _Enumeration( + [], + new=[ + "Enabled", # /FUNCTIONPADMIN + "X86Image", # /FUNCTIONPADMIN:5 + "X64Image", # /FUNCTIONPADMIN:6 + "ItaniumImage", + ], + ), +) # /FUNCTIONPADMIN:16 +_MSBuildOnly( + _link, + "CLRSupportLastError", + _Enumeration( + [], + new=[ + "Enabled", # /CLRSupportLastError + "Disabled", # /CLRSupportLastError:NO + # /CLRSupportLastError:SYSTEMDLL + "SystemDlls", + ], + ), +) # Directives for converting VCResourceCompilerTool to ResourceCompile. # See "c:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\1033\rc.xml" for # the schema of the MSBuild ResourceCompile settings. -_Same(_rc, 'AdditionalOptions', _string_list) -_Same(_rc, 'AdditionalIncludeDirectories', _folder_list) # /I -_Same(_rc, 'Culture', _Integer(msbuild_base=16)) -_Same(_rc, 'IgnoreStandardIncludePath', _boolean) # /X -_Same(_rc, 'PreprocessorDefinitions', _string_list) # /D -_Same(_rc, 'ResourceOutputFileName', _string) # /fo -_Same(_rc, 'ShowProgress', _boolean) # /v +_Same(_rc, "AdditionalOptions", _string_list) +_Same(_rc, "AdditionalIncludeDirectories", _folder_list) # /I +_Same(_rc, "Culture", _Integer(msbuild_base=16)) +_Same(_rc, "IgnoreStandardIncludePath", _boolean) # /X +_Same(_rc, "PreprocessorDefinitions", _string_list) # /D +_Same(_rc, "ResourceOutputFileName", _string) # /fo +_Same(_rc, "ShowProgress", _boolean) # /v # There is no UI in VisualStudio 2008 to set the following properties. # However they are found in CL and other tools. Include them here for # completeness, as they are very likely to have the same usage pattern. -_Same(_rc, 'SuppressStartupBanner', _boolean) # /nologo -_Same(_rc, 'UndefinePreprocessorDefinitions', _string_list) # /u +_Same(_rc, "SuppressStartupBanner", _boolean) # /nologo +_Same(_rc, "UndefinePreprocessorDefinitions", _string_list) # /u # MSBuild options not found in MSVS. -_MSBuildOnly(_rc, 'NullTerminateStrings', _boolean) # /n -_MSBuildOnly(_rc, 'TrackerLogDirectory', _folder_name) +_MSBuildOnly(_rc, "NullTerminateStrings", _boolean) # /n +_MSBuildOnly(_rc, "TrackerLogDirectory", _folder_name) # Directives for converting VCMIDLTool to Midl. # See "c:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\1033\midl.xml" for # the schema of the MSBuild Midl settings. -_Same(_midl, 'AdditionalIncludeDirectories', _folder_list) # /I -_Same(_midl, 'AdditionalOptions', _string_list) -_Same(_midl, 'CPreprocessOptions', _string) # /cpp_opt -_Same(_midl, 'ErrorCheckAllocations', _boolean) # /error allocation -_Same(_midl, 'ErrorCheckBounds', _boolean) # /error bounds_check -_Same(_midl, 'ErrorCheckEnumRange', _boolean) # /error enum -_Same(_midl, 'ErrorCheckRefPointers', _boolean) # /error ref -_Same(_midl, 'ErrorCheckStubData', _boolean) # /error stub_data -_Same(_midl, 'GenerateStublessProxies', _boolean) # /Oicf -_Same(_midl, 'GenerateTypeLibrary', _boolean) -_Same(_midl, 'HeaderFileName', _file_name) # /h -_Same(_midl, 'IgnoreStandardIncludePath', _boolean) # /no_def_idir -_Same(_midl, 'InterfaceIdentifierFileName', _file_name) # /iid -_Same(_midl, 'MkTypLibCompatible', _boolean) # /mktyplib203 -_Same(_midl, 'OutputDirectory', _string) # /out -_Same(_midl, 'PreprocessorDefinitions', _string_list) # /D -_Same(_midl, 'ProxyFileName', _file_name) # /proxy -_Same(_midl, 'RedirectOutputAndErrors', _file_name) # /o -_Same(_midl, 'SuppressStartupBanner', _boolean) # /nologo -_Same(_midl, 'TypeLibraryName', _file_name) # /tlb -_Same(_midl, 'UndefinePreprocessorDefinitions', _string_list) # /U -_Same(_midl, 'WarnAsError', _boolean) # /WX - -_Same(_midl, 'DefaultCharType', - _Enumeration(['Unsigned', # /char unsigned - 'Signed', # /char signed - 'Ascii'])) # /char ascii7 -_Same(_midl, 'TargetEnvironment', - _Enumeration(['NotSet', - 'Win32', # /env win32 - 'Itanium', # /env ia64 - 'X64', # /env x64 - 'ARM64', # /env arm64 - ])) -_Same(_midl, 'EnableErrorChecks', - _Enumeration(['EnableCustom', - 'None', # /error none - 'All'])) # /error all -_Same(_midl, 'StructMemberAlignment', - _Enumeration(['NotSet', - '1', # Zp1 - '2', # Zp2 - '4', # Zp4 - '8'])) # Zp8 -_Same(_midl, 'WarningLevel', - _Enumeration(['0', # /W0 - '1', # /W1 - '2', # /W2 - '3', # /W3 - '4'])) # /W4 - -_Renamed(_midl, 'DLLDataFileName', 'DllDataFileName', _file_name) # /dlldata -_Renamed(_midl, 'ValidateParameters', 'ValidateAllParameters', - _boolean) # /robust +_Same(_midl, "AdditionalIncludeDirectories", _folder_list) # /I +_Same(_midl, "AdditionalOptions", _string_list) +_Same(_midl, "CPreprocessOptions", _string) # /cpp_opt +_Same(_midl, "ErrorCheckAllocations", _boolean) # /error allocation +_Same(_midl, "ErrorCheckBounds", _boolean) # /error bounds_check +_Same(_midl, "ErrorCheckEnumRange", _boolean) # /error enum +_Same(_midl, "ErrorCheckRefPointers", _boolean) # /error ref +_Same(_midl, "ErrorCheckStubData", _boolean) # /error stub_data +_Same(_midl, "GenerateStublessProxies", _boolean) # /Oicf +_Same(_midl, "GenerateTypeLibrary", _boolean) +_Same(_midl, "HeaderFileName", _file_name) # /h +_Same(_midl, "IgnoreStandardIncludePath", _boolean) # /no_def_idir +_Same(_midl, "InterfaceIdentifierFileName", _file_name) # /iid +_Same(_midl, "MkTypLibCompatible", _boolean) # /mktyplib203 +_Same(_midl, "OutputDirectory", _string) # /out +_Same(_midl, "PreprocessorDefinitions", _string_list) # /D +_Same(_midl, "ProxyFileName", _file_name) # /proxy +_Same(_midl, "RedirectOutputAndErrors", _file_name) # /o +_Same(_midl, "SuppressStartupBanner", _boolean) # /nologo +_Same(_midl, "TypeLibraryName", _file_name) # /tlb +_Same(_midl, "UndefinePreprocessorDefinitions", _string_list) # /U +_Same(_midl, "WarnAsError", _boolean) # /WX + +_Same( + _midl, + "DefaultCharType", + _Enumeration(["Unsigned", "Signed", "Ascii"]), # /char unsigned # /char signed +) # /char ascii7 +_Same( + _midl, + "TargetEnvironment", + _Enumeration( + [ + "NotSet", + "Win32", # /env win32 + "Itanium", # /env ia64 + "X64", # /env x64 + "ARM64", # /env arm64 + ] + ), +) +_Same( + _midl, + "EnableErrorChecks", + _Enumeration(["EnableCustom", "None", "All"]), # /error none +) # /error all +_Same( + _midl, + "StructMemberAlignment", + _Enumeration(["NotSet", "1", "2", "4", "8"]), # Zp1 # Zp2 # Zp4 +) # Zp8 +_Same( + _midl, + "WarningLevel", + _Enumeration(["0", "1", "2", "3", "4"]), # /W0 # /W1 # /W2 # /W3 +) # /W4 + +_Renamed(_midl, "DLLDataFileName", "DllDataFileName", _file_name) # /dlldata +_Renamed(_midl, "ValidateParameters", "ValidateAllParameters", _boolean) # /robust # MSBuild options not found in MSVS. -_MSBuildOnly(_midl, 'ApplicationConfigurationMode', _boolean) # /app_config -_MSBuildOnly(_midl, 'ClientStubFile', _file_name) # /cstub -_MSBuildOnly(_midl, 'GenerateClientFiles', - _Enumeration([], new=['Stub', # /client stub - 'None'])) # /client none -_MSBuildOnly(_midl, 'GenerateServerFiles', - _Enumeration([], new=['Stub', # /client stub - 'None'])) # /client none -_MSBuildOnly(_midl, 'LocaleID', _integer) # /lcid DECIMAL -_MSBuildOnly(_midl, 'ServerStubFile', _file_name) # /sstub -_MSBuildOnly(_midl, 'SuppressCompilerWarnings', _boolean) # /no_warn -_MSBuildOnly(_midl, 'TrackerLogDirectory', _folder_name) -_MSBuildOnly(_midl, 'TypeLibFormat', - _Enumeration([], new=['NewFormat', # /newtlb - 'OldFormat'])) # /oldtlb +_MSBuildOnly(_midl, "ApplicationConfigurationMode", _boolean) # /app_config +_MSBuildOnly(_midl, "ClientStubFile", _file_name) # /cstub +_MSBuildOnly( + _midl, "GenerateClientFiles", _Enumeration([], new=["Stub", "None"]) # /client stub +) # /client none +_MSBuildOnly( + _midl, "GenerateServerFiles", _Enumeration([], new=["Stub", "None"]) # /client stub +) # /client none +_MSBuildOnly(_midl, "LocaleID", _integer) # /lcid DECIMAL +_MSBuildOnly(_midl, "ServerStubFile", _file_name) # /sstub +_MSBuildOnly(_midl, "SuppressCompilerWarnings", _boolean) # /no_warn +_MSBuildOnly(_midl, "TrackerLogDirectory", _folder_name) +_MSBuildOnly( + _midl, "TypeLibFormat", _Enumeration([], new=["NewFormat", "OldFormat"]) # /newtlb +) # /oldtlb # Directives for converting VCLibrarianTool to Lib. # See "c:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\1033\lib.xml" for # the schema of the MSBuild Lib settings. -_Same(_lib, 'AdditionalDependencies', _file_list) -_Same(_lib, 'AdditionalLibraryDirectories', _folder_list) # /LIBPATH -_Same(_lib, 'AdditionalOptions', _string_list) -_Same(_lib, 'ExportNamedFunctions', _string_list) # /EXPORT -_Same(_lib, 'ForceSymbolReferences', _string) # /INCLUDE -_Same(_lib, 'IgnoreAllDefaultLibraries', _boolean) # /NODEFAULTLIB -_Same(_lib, 'IgnoreSpecificDefaultLibraries', _file_list) # /NODEFAULTLIB -_Same(_lib, 'ModuleDefinitionFile', _file_name) # /DEF -_Same(_lib, 'OutputFile', _file_name) # /OUT -_Same(_lib, 'SuppressStartupBanner', _boolean) # /NOLOGO -_Same(_lib, 'UseUnicodeResponseFiles', _boolean) -_Same(_lib, 'LinkTimeCodeGeneration', _boolean) # /LTCG -_Same(_lib, 'TargetMachine', _target_machine_enumeration) +_Same(_lib, "AdditionalDependencies", _file_list) +_Same(_lib, "AdditionalLibraryDirectories", _folder_list) # /LIBPATH +_Same(_lib, "AdditionalOptions", _string_list) +_Same(_lib, "ExportNamedFunctions", _string_list) # /EXPORT +_Same(_lib, "ForceSymbolReferences", _string) # /INCLUDE +_Same(_lib, "IgnoreAllDefaultLibraries", _boolean) # /NODEFAULTLIB +_Same(_lib, "IgnoreSpecificDefaultLibraries", _file_list) # /NODEFAULTLIB +_Same(_lib, "ModuleDefinitionFile", _file_name) # /DEF +_Same(_lib, "OutputFile", _file_name) # /OUT +_Same(_lib, "SuppressStartupBanner", _boolean) # /NOLOGO +_Same(_lib, "UseUnicodeResponseFiles", _boolean) +_Same(_lib, "LinkTimeCodeGeneration", _boolean) # /LTCG +_Same(_lib, "TargetMachine", _target_machine_enumeration) # TODO(jeanluc) _link defines the same value that gets moved to # ProjectReference. We may want to validate that they are consistent. -_Moved(_lib, 'LinkLibraryDependencies', 'ProjectReference', _boolean) - -_MSBuildOnly(_lib, 'DisplayLibrary', _string) # /LIST Visible='false' -_MSBuildOnly(_lib, 'ErrorReporting', - _Enumeration([], new=['PromptImmediately', # /ERRORREPORT:PROMPT - 'QueueForNextLogin', # /ERRORREPORT:QUEUE - 'SendErrorReport', # /ERRORREPORT:SEND - 'NoErrorReport'])) # /ERRORREPORT:NONE -_MSBuildOnly(_lib, 'MinimumRequiredVersion', _string) -_MSBuildOnly(_lib, 'Name', _file_name) # /NAME -_MSBuildOnly(_lib, 'RemoveObjects', _file_list) # /REMOVE -_MSBuildOnly(_lib, 'SubSystem', _subsystem_enumeration) -_MSBuildOnly(_lib, 'TrackerLogDirectory', _folder_name) -_MSBuildOnly(_lib, 'TreatLibWarningAsErrors', _boolean) # /WX -_MSBuildOnly(_lib, 'Verbose', _boolean) +_Moved(_lib, "LinkLibraryDependencies", "ProjectReference", _boolean) + +_MSBuildOnly(_lib, "DisplayLibrary", _string) # /LIST Visible='false' +_MSBuildOnly( + _lib, + "ErrorReporting", + _Enumeration( + [], + new=[ + "PromptImmediately", # /ERRORREPORT:PROMPT + "QueueForNextLogin", # /ERRORREPORT:QUEUE + "SendErrorReport", # /ERRORREPORT:SEND + "NoErrorReport", + ], + ), +) # /ERRORREPORT:NONE +_MSBuildOnly(_lib, "MinimumRequiredVersion", _string) +_MSBuildOnly(_lib, "Name", _file_name) # /NAME +_MSBuildOnly(_lib, "RemoveObjects", _file_list) # /REMOVE +_MSBuildOnly(_lib, "SubSystem", _subsystem_enumeration) +_MSBuildOnly(_lib, "TrackerLogDirectory", _folder_name) +_MSBuildOnly(_lib, "TreatLibWarningAsErrors", _boolean) # /WX +_MSBuildOnly(_lib, "Verbose", _boolean) # Directives for converting VCManifestTool to Mt. @@ -1059,41 +1225,45 @@ def _ValidateSettings(validators, settings, stderr): # the schema of the MSBuild Lib settings. # Options that have the same name in MSVS and MSBuild -_Same(_manifest, 'AdditionalManifestFiles', _file_list) # /manifest -_Same(_manifest, 'AdditionalOptions', _string_list) -_Same(_manifest, 'AssemblyIdentity', _string) # /identity: -_Same(_manifest, 'ComponentFileName', _file_name) # /dll -_Same(_manifest, 'GenerateCatalogFiles', _boolean) # /makecdfs -_Same(_manifest, 'InputResourceManifests', _string) # /inputresource -_Same(_manifest, 'OutputManifestFile', _file_name) # /out -_Same(_manifest, 'RegistrarScriptFile', _file_name) # /rgs -_Same(_manifest, 'ReplacementsFile', _file_name) # /replacements -_Same(_manifest, 'SuppressStartupBanner', _boolean) # /nologo -_Same(_manifest, 'TypeLibraryFile', _file_name) # /tlb: -_Same(_manifest, 'UpdateFileHashes', _boolean) # /hashupdate -_Same(_manifest, 'UpdateFileHashesSearchPath', _file_name) -_Same(_manifest, 'VerboseOutput', _boolean) # /verbose +_Same(_manifest, "AdditionalManifestFiles", _file_list) # /manifest +_Same(_manifest, "AdditionalOptions", _string_list) +_Same(_manifest, "AssemblyIdentity", _string) # /identity: +_Same(_manifest, "ComponentFileName", _file_name) # /dll +_Same(_manifest, "GenerateCatalogFiles", _boolean) # /makecdfs +_Same(_manifest, "InputResourceManifests", _string) # /inputresource +_Same(_manifest, "OutputManifestFile", _file_name) # /out +_Same(_manifest, "RegistrarScriptFile", _file_name) # /rgs +_Same(_manifest, "ReplacementsFile", _file_name) # /replacements +_Same(_manifest, "SuppressStartupBanner", _boolean) # /nologo +_Same(_manifest, "TypeLibraryFile", _file_name) # /tlb: +_Same(_manifest, "UpdateFileHashes", _boolean) # /hashupdate +_Same(_manifest, "UpdateFileHashesSearchPath", _file_name) +_Same(_manifest, "VerboseOutput", _boolean) # /verbose # Options that have moved location. -_MovedAndRenamed(_manifest, 'ManifestResourceFile', - 'ManifestResourceCompile', - 'ResourceOutputFileName', - _file_name) -_Moved(_manifest, 'EmbedManifest', '', _boolean) +_MovedAndRenamed( + _manifest, + "ManifestResourceFile", + "ManifestResourceCompile", + "ResourceOutputFileName", + _file_name, +) +_Moved(_manifest, "EmbedManifest", "", _boolean) # MSVS options not found in MSBuild. -_MSVSOnly(_manifest, 'DependencyInformationFile', _file_name) -_MSVSOnly(_manifest, 'UseFAT32Workaround', _boolean) -_MSVSOnly(_manifest, 'UseUnicodeResponseFiles', _boolean) +_MSVSOnly(_manifest, "DependencyInformationFile", _file_name) +_MSVSOnly(_manifest, "UseFAT32Workaround", _boolean) +_MSVSOnly(_manifest, "UseUnicodeResponseFiles", _boolean) # MSBuild options not found in MSVS. -_MSBuildOnly(_manifest, 'EnableDPIAwareness', _boolean) -_MSBuildOnly(_manifest, 'GenerateCategoryTags', _boolean) # /category -_MSBuildOnly(_manifest, 'ManifestFromManagedAssembly', - _file_name) # /managedassemblyname -_MSBuildOnly(_manifest, 'OutputResourceManifests', _string) # /outputresource -_MSBuildOnly(_manifest, 'SuppressDependencyElement', _boolean) # /nodependency -_MSBuildOnly(_manifest, 'TrackerLogDirectory', _folder_name) +_MSBuildOnly(_manifest, "EnableDPIAwareness", _boolean) +_MSBuildOnly(_manifest, "GenerateCategoryTags", _boolean) # /category +_MSBuildOnly( + _manifest, "ManifestFromManagedAssembly", _file_name +) # /managedassemblyname +_MSBuildOnly(_manifest, "OutputResourceManifests", _string) # /outputresource +_MSBuildOnly(_manifest, "SuppressDependencyElement", _boolean) # /nodependency +_MSBuildOnly(_manifest, "TrackerLogDirectory", _folder_name) # Directives for MASM. @@ -1101,4 +1271,4 @@ def _ValidateSettings(validators, settings, stderr): # MSBuild MASM settings. # Options that have the same name in MSVS and MSBuild. -_Same(_masm, 'UseSafeExceptionHandlers', _boolean) # /safeseh +_Same(_masm, "UseSafeExceptionHandlers", _boolean) # /safeseh diff --git a/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/MSVSSettings_test.py b/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/MSVSSettings_test.py index ce71c38a9b94fa..c53c88e8248dd2 100755 --- a/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/MSVSSettings_test.py +++ b/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/MSVSSettings_test.py @@ -6,1094 +6,1144 @@ """Unit tests for the MSVSSettings.py file.""" -try: - from cStringIO import StringIO -except ImportError: - from io import StringIO - import unittest import gyp.MSVSSettings as MSVSSettings +try: + from StringIO import StringIO # Python 2 +except ImportError: + from io import StringIO # Python 3 -class TestSequenceFunctions(unittest.TestCase): - def setUp(self): - self.stderr = StringIO() +class TestSequenceFunctions(unittest.TestCase): + def setUp(self): + self.stderr = StringIO() - def _ExpectedWarnings(self, expected): - """Compares recorded lines to expected warnings.""" - self.stderr.seek(0) - actual = self.stderr.read().split('\n') - actual = [line for line in actual if line] - self.assertEqual(sorted(expected), sorted(actual)) + def _ExpectedWarnings(self, expected): + """Compares recorded lines to expected warnings.""" + self.stderr.seek(0) + actual = self.stderr.read().split("\n") + actual = [line for line in actual if line] + self.assertEqual(sorted(expected), sorted(actual)) - def testValidateMSVSSettings_tool_names(self): - """Tests that only MSVS tool names are allowed.""" - MSVSSettings.ValidateMSVSSettings( - {'VCCLCompilerTool': {}, - 'VCLinkerTool': {}, - 'VCMIDLTool': {}, - 'foo': {}, - 'VCResourceCompilerTool': {}, - 'VCLibrarianTool': {}, - 'VCManifestTool': {}, - 'ClCompile': {}}, - self.stderr) - self._ExpectedWarnings([ - 'Warning: unrecognized tool foo', - 'Warning: unrecognized tool ClCompile']) + def testValidateMSVSSettings_tool_names(self): + """Tests that only MSVS tool names are allowed.""" + MSVSSettings.ValidateMSVSSettings( + { + "VCCLCompilerTool": {}, + "VCLinkerTool": {}, + "VCMIDLTool": {}, + "foo": {}, + "VCResourceCompilerTool": {}, + "VCLibrarianTool": {}, + "VCManifestTool": {}, + "ClCompile": {}, + }, + self.stderr, + ) + self._ExpectedWarnings( + ["Warning: unrecognized tool foo", "Warning: unrecognized tool ClCompile"] + ) - def testValidateMSVSSettings_settings(self): - """Tests that for invalid MSVS settings.""" - MSVSSettings.ValidateMSVSSettings( - {'VCCLCompilerTool': { - 'AdditionalIncludeDirectories': 'folder1;folder2', - 'AdditionalOptions': ['string1', 'string2'], - 'AdditionalUsingDirectories': 'folder1;folder2', - 'AssemblerListingLocation': 'a_file_name', - 'AssemblerOutput': '0', - 'BasicRuntimeChecks': '5', - 'BrowseInformation': 'fdkslj', - 'BrowseInformationFile': 'a_file_name', - 'BufferSecurityCheck': 'true', - 'CallingConvention': '-1', - 'CompileAs': '1', - 'DebugInformationFormat': '2', - 'DefaultCharIsUnsigned': 'true', - 'Detect64BitPortabilityProblems': 'true', - 'DisableLanguageExtensions': 'true', - 'DisableSpecificWarnings': 'string1;string2', - 'EnableEnhancedInstructionSet': '1', - 'EnableFiberSafeOptimizations': 'true', - 'EnableFunctionLevelLinking': 'true', - 'EnableIntrinsicFunctions': 'true', - 'EnablePREfast': 'true', - 'Enableprefast': 'bogus', - 'ErrorReporting': '1', - 'ExceptionHandling': '1', - 'ExpandAttributedSource': 'true', - 'FavorSizeOrSpeed': '1', - 'FloatingPointExceptions': 'true', - 'FloatingPointModel': '1', - 'ForceConformanceInForLoopScope': 'true', - 'ForcedIncludeFiles': 'file1;file2', - 'ForcedUsingFiles': 'file1;file2', - 'GeneratePreprocessedFile': '1', - 'GenerateXMLDocumentationFiles': 'true', - 'IgnoreStandardIncludePath': 'true', - 'InlineFunctionExpansion': '1', - 'KeepComments': 'true', - 'MinimalRebuild': 'true', - 'ObjectFile': 'a_file_name', - 'OmitDefaultLibName': 'true', - 'OmitFramePointers': 'true', - 'OpenMP': 'true', - 'Optimization': '1', - 'PrecompiledHeaderFile': 'a_file_name', - 'PrecompiledHeaderThrough': 'a_file_name', - 'PreprocessorDefinitions': 'string1;string2', - 'ProgramDataBaseFileName': 'a_file_name', - 'RuntimeLibrary': '1', - 'RuntimeTypeInfo': 'true', - 'ShowIncludes': 'true', - 'SmallerTypeCheck': 'true', - 'StringPooling': 'true', - 'StructMemberAlignment': '1', - 'SuppressStartupBanner': 'true', - 'TreatWChar_tAsBuiltInType': 'true', - 'UndefineAllPreprocessorDefinitions': 'true', - 'UndefinePreprocessorDefinitions': 'string1;string2', - 'UseFullPaths': 'true', - 'UsePrecompiledHeader': '1', - 'UseUnicodeResponseFiles': 'true', - 'WarnAsError': 'true', - 'WarningLevel': '1', - 'WholeProgramOptimization': 'true', - 'XMLDocumentationFileName': 'a_file_name', - 'ZZXYZ': 'bogus'}, - 'VCLinkerTool': { - 'AdditionalDependencies': 'file1;file2', - 'AdditionalDependencies_excluded': 'file3', - 'AdditionalLibraryDirectories': 'folder1;folder2', - 'AdditionalManifestDependencies': 'file1;file2', - 'AdditionalOptions': 'a string1', - 'AddModuleNamesToAssembly': 'file1;file2', - 'AllowIsolation': 'true', - 'AssemblyDebug': '2', - 'AssemblyLinkResource': 'file1;file2', - 'BaseAddress': 'a string1', - 'CLRImageType': '2', - 'CLRThreadAttribute': '2', - 'CLRUnmanagedCodeCheck': 'true', - 'DataExecutionPrevention': '2', - 'DelayLoadDLLs': 'file1;file2', - 'DelaySign': 'true', - 'Driver': '2', - 'EmbedManagedResourceFile': 'file1;file2', - 'EnableCOMDATFolding': '2', - 'EnableUAC': 'true', - 'EntryPointSymbol': 'a string1', - 'ErrorReporting': '2', - 'FixedBaseAddress': '2', - 'ForceSymbolReferences': 'file1;file2', - 'FunctionOrder': 'a_file_name', - 'GenerateDebugInformation': 'true', - 'GenerateManifest': 'true', - 'GenerateMapFile': 'true', - 'HeapCommitSize': 'a string1', - 'HeapReserveSize': 'a string1', - 'IgnoreAllDefaultLibraries': 'true', - 'IgnoreDefaultLibraryNames': 'file1;file2', - 'IgnoreEmbeddedIDL': 'true', - 'IgnoreImportLibrary': 'true', - 'ImportLibrary': 'a_file_name', - 'KeyContainer': 'a_file_name', - 'KeyFile': 'a_file_name', - 'LargeAddressAware': '2', - 'LinkIncremental': '2', - 'LinkLibraryDependencies': 'true', - 'LinkTimeCodeGeneration': '2', - 'ManifestFile': 'a_file_name', - 'MapExports': 'true', - 'MapFileName': 'a_file_name', - 'MergedIDLBaseFileName': 'a_file_name', - 'MergeSections': 'a string1', - 'MidlCommandFile': 'a_file_name', - 'ModuleDefinitionFile': 'a_file_name', - 'OptimizeForWindows98': '1', - 'OptimizeReferences': '2', - 'OutputFile': 'a_file_name', - 'PerUserRedirection': 'true', - 'Profile': 'true', - 'ProfileGuidedDatabase': 'a_file_name', - 'ProgramDatabaseFile': 'a_file_name', - 'RandomizedBaseAddress': '2', - 'RegisterOutput': 'true', - 'ResourceOnlyDLL': 'true', - 'SetChecksum': 'true', - 'ShowProgress': '2', - 'StackCommitSize': 'a string1', - 'StackReserveSize': 'a string1', - 'StripPrivateSymbols': 'a_file_name', - 'SubSystem': '2', - 'SupportUnloadOfDelayLoadedDLL': 'true', - 'SuppressStartupBanner': 'true', - 'SwapRunFromCD': 'true', - 'SwapRunFromNet': 'true', - 'TargetMachine': '2', - 'TerminalServerAware': '2', - 'TurnOffAssemblyGeneration': 'true', - 'TypeLibraryFile': 'a_file_name', - 'TypeLibraryResourceID': '33', - 'UACExecutionLevel': '2', - 'UACUIAccess': 'true', - 'UseLibraryDependencyInputs': 'true', - 'UseUnicodeResponseFiles': 'true', - 'Version': 'a string1'}, - 'VCMIDLTool': { - 'AdditionalIncludeDirectories': 'folder1;folder2', - 'AdditionalOptions': 'a string1', - 'CPreprocessOptions': 'a string1', - 'DefaultCharType': '1', - 'DLLDataFileName': 'a_file_name', - 'EnableErrorChecks': '1', - 'ErrorCheckAllocations': 'true', - 'ErrorCheckBounds': 'true', - 'ErrorCheckEnumRange': 'true', - 'ErrorCheckRefPointers': 'true', - 'ErrorCheckStubData': 'true', - 'GenerateStublessProxies': 'true', - 'GenerateTypeLibrary': 'true', - 'HeaderFileName': 'a_file_name', - 'IgnoreStandardIncludePath': 'true', - 'InterfaceIdentifierFileName': 'a_file_name', - 'MkTypLibCompatible': 'true', - 'notgood': 'bogus', - 'OutputDirectory': 'a string1', - 'PreprocessorDefinitions': 'string1;string2', - 'ProxyFileName': 'a_file_name', - 'RedirectOutputAndErrors': 'a_file_name', - 'StructMemberAlignment': '1', - 'SuppressStartupBanner': 'true', - 'TargetEnvironment': '1', - 'TypeLibraryName': 'a_file_name', - 'UndefinePreprocessorDefinitions': 'string1;string2', - 'ValidateParameters': 'true', - 'WarnAsError': 'true', - 'WarningLevel': '1'}, - 'VCResourceCompilerTool': { - 'AdditionalOptions': 'a string1', - 'AdditionalIncludeDirectories': 'folder1;folder2', - 'Culture': '1003', - 'IgnoreStandardIncludePath': 'true', - 'notgood2': 'bogus', - 'PreprocessorDefinitions': 'string1;string2', - 'ResourceOutputFileName': 'a string1', - 'ShowProgress': 'true', - 'SuppressStartupBanner': 'true', - 'UndefinePreprocessorDefinitions': 'string1;string2'}, - 'VCLibrarianTool': { - 'AdditionalDependencies': 'file1;file2', - 'AdditionalLibraryDirectories': 'folder1;folder2', - 'AdditionalOptions': 'a string1', - 'ExportNamedFunctions': 'string1;string2', - 'ForceSymbolReferences': 'a string1', - 'IgnoreAllDefaultLibraries': 'true', - 'IgnoreSpecificDefaultLibraries': 'file1;file2', - 'LinkLibraryDependencies': 'true', - 'ModuleDefinitionFile': 'a_file_name', - 'OutputFile': 'a_file_name', - 'SuppressStartupBanner': 'true', - 'UseUnicodeResponseFiles': 'true'}, - 'VCManifestTool': { - 'AdditionalManifestFiles': 'file1;file2', - 'AdditionalOptions': 'a string1', - 'AssemblyIdentity': 'a string1', - 'ComponentFileName': 'a_file_name', - 'DependencyInformationFile': 'a_file_name', - 'GenerateCatalogFiles': 'true', - 'InputResourceManifests': 'a string1', - 'ManifestResourceFile': 'a_file_name', - 'OutputManifestFile': 'a_file_name', - 'RegistrarScriptFile': 'a_file_name', - 'ReplacementsFile': 'a_file_name', - 'SuppressStartupBanner': 'true', - 'TypeLibraryFile': 'a_file_name', - 'UpdateFileHashes': 'truel', - 'UpdateFileHashesSearchPath': 'a_file_name', - 'UseFAT32Workaround': 'true', - 'UseUnicodeResponseFiles': 'true', - 'VerboseOutput': 'true'}}, - self.stderr) - self._ExpectedWarnings([ - 'Warning: for VCCLCompilerTool/BasicRuntimeChecks, ' - 'index value (5) not in expected range [0, 4)', - 'Warning: for VCCLCompilerTool/BrowseInformation, ' - "invalid literal for int() with base 10: 'fdkslj'", - 'Warning: for VCCLCompilerTool/CallingConvention, ' - 'index value (-1) not in expected range [0, 4)', - 'Warning: for VCCLCompilerTool/DebugInformationFormat, ' - 'converted value for 2 not specified.', - 'Warning: unrecognized setting VCCLCompilerTool/Enableprefast', - 'Warning: unrecognized setting VCCLCompilerTool/ZZXYZ', - 'Warning: for VCLinkerTool/TargetMachine, ' - 'converted value for 2 not specified.', - 'Warning: unrecognized setting VCMIDLTool/notgood', - 'Warning: unrecognized setting VCResourceCompilerTool/notgood2', - 'Warning: for VCManifestTool/UpdateFileHashes, ' - "expected bool; got 'truel'" - '']) + def testValidateMSVSSettings_settings(self): + """Tests that for invalid MSVS settings.""" + MSVSSettings.ValidateMSVSSettings( + { + "VCCLCompilerTool": { + "AdditionalIncludeDirectories": "folder1;folder2", + "AdditionalOptions": ["string1", "string2"], + "AdditionalUsingDirectories": "folder1;folder2", + "AssemblerListingLocation": "a_file_name", + "AssemblerOutput": "0", + "BasicRuntimeChecks": "5", + "BrowseInformation": "fdkslj", + "BrowseInformationFile": "a_file_name", + "BufferSecurityCheck": "true", + "CallingConvention": "-1", + "CompileAs": "1", + "DebugInformationFormat": "2", + "DefaultCharIsUnsigned": "true", + "Detect64BitPortabilityProblems": "true", + "DisableLanguageExtensions": "true", + "DisableSpecificWarnings": "string1;string2", + "EnableEnhancedInstructionSet": "1", + "EnableFiberSafeOptimizations": "true", + "EnableFunctionLevelLinking": "true", + "EnableIntrinsicFunctions": "true", + "EnablePREfast": "true", + "Enableprefast": "bogus", + "ErrorReporting": "1", + "ExceptionHandling": "1", + "ExpandAttributedSource": "true", + "FavorSizeOrSpeed": "1", + "FloatingPointExceptions": "true", + "FloatingPointModel": "1", + "ForceConformanceInForLoopScope": "true", + "ForcedIncludeFiles": "file1;file2", + "ForcedUsingFiles": "file1;file2", + "GeneratePreprocessedFile": "1", + "GenerateXMLDocumentationFiles": "true", + "IgnoreStandardIncludePath": "true", + "InlineFunctionExpansion": "1", + "KeepComments": "true", + "MinimalRebuild": "true", + "ObjectFile": "a_file_name", + "OmitDefaultLibName": "true", + "OmitFramePointers": "true", + "OpenMP": "true", + "Optimization": "1", + "PrecompiledHeaderFile": "a_file_name", + "PrecompiledHeaderThrough": "a_file_name", + "PreprocessorDefinitions": "string1;string2", + "ProgramDataBaseFileName": "a_file_name", + "RuntimeLibrary": "1", + "RuntimeTypeInfo": "true", + "ShowIncludes": "true", + "SmallerTypeCheck": "true", + "StringPooling": "true", + "StructMemberAlignment": "1", + "SuppressStartupBanner": "true", + "TreatWChar_tAsBuiltInType": "true", + "UndefineAllPreprocessorDefinitions": "true", + "UndefinePreprocessorDefinitions": "string1;string2", + "UseFullPaths": "true", + "UsePrecompiledHeader": "1", + "UseUnicodeResponseFiles": "true", + "WarnAsError": "true", + "WarningLevel": "1", + "WholeProgramOptimization": "true", + "XMLDocumentationFileName": "a_file_name", + "ZZXYZ": "bogus", + }, + "VCLinkerTool": { + "AdditionalDependencies": "file1;file2", + "AdditionalDependencies_excluded": "file3", + "AdditionalLibraryDirectories": "folder1;folder2", + "AdditionalManifestDependencies": "file1;file2", + "AdditionalOptions": "a string1", + "AddModuleNamesToAssembly": "file1;file2", + "AllowIsolation": "true", + "AssemblyDebug": "2", + "AssemblyLinkResource": "file1;file2", + "BaseAddress": "a string1", + "CLRImageType": "2", + "CLRThreadAttribute": "2", + "CLRUnmanagedCodeCheck": "true", + "DataExecutionPrevention": "2", + "DelayLoadDLLs": "file1;file2", + "DelaySign": "true", + "Driver": "2", + "EmbedManagedResourceFile": "file1;file2", + "EnableCOMDATFolding": "2", + "EnableUAC": "true", + "EntryPointSymbol": "a string1", + "ErrorReporting": "2", + "FixedBaseAddress": "2", + "ForceSymbolReferences": "file1;file2", + "FunctionOrder": "a_file_name", + "GenerateDebugInformation": "true", + "GenerateManifest": "true", + "GenerateMapFile": "true", + "HeapCommitSize": "a string1", + "HeapReserveSize": "a string1", + "IgnoreAllDefaultLibraries": "true", + "IgnoreDefaultLibraryNames": "file1;file2", + "IgnoreEmbeddedIDL": "true", + "IgnoreImportLibrary": "true", + "ImportLibrary": "a_file_name", + "KeyContainer": "a_file_name", + "KeyFile": "a_file_name", + "LargeAddressAware": "2", + "LinkIncremental": "2", + "LinkLibraryDependencies": "true", + "LinkTimeCodeGeneration": "2", + "ManifestFile": "a_file_name", + "MapExports": "true", + "MapFileName": "a_file_name", + "MergedIDLBaseFileName": "a_file_name", + "MergeSections": "a string1", + "MidlCommandFile": "a_file_name", + "ModuleDefinitionFile": "a_file_name", + "OptimizeForWindows98": "1", + "OptimizeReferences": "2", + "OutputFile": "a_file_name", + "PerUserRedirection": "true", + "Profile": "true", + "ProfileGuidedDatabase": "a_file_name", + "ProgramDatabaseFile": "a_file_name", + "RandomizedBaseAddress": "2", + "RegisterOutput": "true", + "ResourceOnlyDLL": "true", + "SetChecksum": "true", + "ShowProgress": "2", + "StackCommitSize": "a string1", + "StackReserveSize": "a string1", + "StripPrivateSymbols": "a_file_name", + "SubSystem": "2", + "SupportUnloadOfDelayLoadedDLL": "true", + "SuppressStartupBanner": "true", + "SwapRunFromCD": "true", + "SwapRunFromNet": "true", + "TargetMachine": "2", + "TerminalServerAware": "2", + "TurnOffAssemblyGeneration": "true", + "TypeLibraryFile": "a_file_name", + "TypeLibraryResourceID": "33", + "UACExecutionLevel": "2", + "UACUIAccess": "true", + "UseLibraryDependencyInputs": "true", + "UseUnicodeResponseFiles": "true", + "Version": "a string1", + }, + "VCMIDLTool": { + "AdditionalIncludeDirectories": "folder1;folder2", + "AdditionalOptions": "a string1", + "CPreprocessOptions": "a string1", + "DefaultCharType": "1", + "DLLDataFileName": "a_file_name", + "EnableErrorChecks": "1", + "ErrorCheckAllocations": "true", + "ErrorCheckBounds": "true", + "ErrorCheckEnumRange": "true", + "ErrorCheckRefPointers": "true", + "ErrorCheckStubData": "true", + "GenerateStublessProxies": "true", + "GenerateTypeLibrary": "true", + "HeaderFileName": "a_file_name", + "IgnoreStandardIncludePath": "true", + "InterfaceIdentifierFileName": "a_file_name", + "MkTypLibCompatible": "true", + "notgood": "bogus", + "OutputDirectory": "a string1", + "PreprocessorDefinitions": "string1;string2", + "ProxyFileName": "a_file_name", + "RedirectOutputAndErrors": "a_file_name", + "StructMemberAlignment": "1", + "SuppressStartupBanner": "true", + "TargetEnvironment": "1", + "TypeLibraryName": "a_file_name", + "UndefinePreprocessorDefinitions": "string1;string2", + "ValidateParameters": "true", + "WarnAsError": "true", + "WarningLevel": "1", + }, + "VCResourceCompilerTool": { + "AdditionalOptions": "a string1", + "AdditionalIncludeDirectories": "folder1;folder2", + "Culture": "1003", + "IgnoreStandardIncludePath": "true", + "notgood2": "bogus", + "PreprocessorDefinitions": "string1;string2", + "ResourceOutputFileName": "a string1", + "ShowProgress": "true", + "SuppressStartupBanner": "true", + "UndefinePreprocessorDefinitions": "string1;string2", + }, + "VCLibrarianTool": { + "AdditionalDependencies": "file1;file2", + "AdditionalLibraryDirectories": "folder1;folder2", + "AdditionalOptions": "a string1", + "ExportNamedFunctions": "string1;string2", + "ForceSymbolReferences": "a string1", + "IgnoreAllDefaultLibraries": "true", + "IgnoreSpecificDefaultLibraries": "file1;file2", + "LinkLibraryDependencies": "true", + "ModuleDefinitionFile": "a_file_name", + "OutputFile": "a_file_name", + "SuppressStartupBanner": "true", + "UseUnicodeResponseFiles": "true", + }, + "VCManifestTool": { + "AdditionalManifestFiles": "file1;file2", + "AdditionalOptions": "a string1", + "AssemblyIdentity": "a string1", + "ComponentFileName": "a_file_name", + "DependencyInformationFile": "a_file_name", + "GenerateCatalogFiles": "true", + "InputResourceManifests": "a string1", + "ManifestResourceFile": "a_file_name", + "OutputManifestFile": "a_file_name", + "RegistrarScriptFile": "a_file_name", + "ReplacementsFile": "a_file_name", + "SuppressStartupBanner": "true", + "TypeLibraryFile": "a_file_name", + "UpdateFileHashes": "truel", + "UpdateFileHashesSearchPath": "a_file_name", + "UseFAT32Workaround": "true", + "UseUnicodeResponseFiles": "true", + "VerboseOutput": "true", + }, + }, + self.stderr, + ) + self._ExpectedWarnings( + [ + "Warning: for VCCLCompilerTool/BasicRuntimeChecks, " + "index value (5) not in expected range [0, 4)", + "Warning: for VCCLCompilerTool/BrowseInformation, " + "invalid literal for int() with base 10: 'fdkslj'", + "Warning: for VCCLCompilerTool/CallingConvention, " + "index value (-1) not in expected range [0, 4)", + "Warning: for VCCLCompilerTool/DebugInformationFormat, " + "converted value for 2 not specified.", + "Warning: unrecognized setting VCCLCompilerTool/Enableprefast", + "Warning: unrecognized setting VCCLCompilerTool/ZZXYZ", + "Warning: for VCLinkerTool/TargetMachine, " + "converted value for 2 not specified.", + "Warning: unrecognized setting VCMIDLTool/notgood", + "Warning: unrecognized setting VCResourceCompilerTool/notgood2", + "Warning: for VCManifestTool/UpdateFileHashes, " + "expected bool; got 'truel'" + "", + ] + ) - def testValidateMSBuildSettings_settings(self): - """Tests that for invalid MSBuild settings.""" - MSVSSettings.ValidateMSBuildSettings( - {'ClCompile': { - 'AdditionalIncludeDirectories': 'folder1;folder2', - 'AdditionalOptions': ['string1', 'string2'], - 'AdditionalUsingDirectories': 'folder1;folder2', - 'AssemblerListingLocation': 'a_file_name', - 'AssemblerOutput': 'NoListing', - 'BasicRuntimeChecks': 'StackFrameRuntimeCheck', - 'BrowseInformation': 'false', - 'BrowseInformationFile': 'a_file_name', - 'BufferSecurityCheck': 'true', - 'BuildingInIDE': 'true', - 'CallingConvention': 'Cdecl', - 'CompileAs': 'CompileAsC', - 'CompileAsManaged': 'true', - 'CreateHotpatchableImage': 'true', - 'DebugInformationFormat': 'ProgramDatabase', - 'DisableLanguageExtensions': 'true', - 'DisableSpecificWarnings': 'string1;string2', - 'EnableEnhancedInstructionSet': 'StreamingSIMDExtensions', - 'EnableFiberSafeOptimizations': 'true', - 'EnablePREfast': 'true', - 'Enableprefast': 'bogus', - 'ErrorReporting': 'Prompt', - 'ExceptionHandling': 'SyncCThrow', - 'ExpandAttributedSource': 'true', - 'FavorSizeOrSpeed': 'Neither', - 'FloatingPointExceptions': 'true', - 'FloatingPointModel': 'Precise', - 'ForceConformanceInForLoopScope': 'true', - 'ForcedIncludeFiles': 'file1;file2', - 'ForcedUsingFiles': 'file1;file2', - 'FunctionLevelLinking': 'false', - 'GenerateXMLDocumentationFiles': 'true', - 'IgnoreStandardIncludePath': 'true', - 'InlineFunctionExpansion': 'OnlyExplicitInline', - 'IntrinsicFunctions': 'false', - 'MinimalRebuild': 'true', - 'MultiProcessorCompilation': 'true', - 'ObjectFileName': 'a_file_name', - 'OmitDefaultLibName': 'true', - 'OmitFramePointers': 'true', - 'OpenMPSupport': 'true', - 'Optimization': 'Disabled', - 'PrecompiledHeader': 'NotUsing', - 'PrecompiledHeaderFile': 'a_file_name', - 'PrecompiledHeaderOutputFile': 'a_file_name', - 'PreprocessKeepComments': 'true', - 'PreprocessorDefinitions': 'string1;string2', - 'PreprocessOutputPath': 'a string1', - 'PreprocessSuppressLineNumbers': 'false', - 'PreprocessToFile': 'false', - 'ProcessorNumber': '33', - 'ProgramDataBaseFileName': 'a_file_name', - 'RuntimeLibrary': 'MultiThreaded', - 'RuntimeTypeInfo': 'true', - 'ShowIncludes': 'true', - 'SmallerTypeCheck': 'true', - 'StringPooling': 'true', - 'StructMemberAlignment': '1Byte', - 'SuppressStartupBanner': 'true', - 'TrackerLogDirectory': 'a_folder', - 'TreatSpecificWarningsAsErrors': 'string1;string2', - 'TreatWarningAsError': 'true', - 'TreatWChar_tAsBuiltInType': 'true', - 'UndefineAllPreprocessorDefinitions': 'true', - 'UndefinePreprocessorDefinitions': 'string1;string2', - 'UseFullPaths': 'true', - 'UseUnicodeForAssemblerListing': 'true', - 'WarningLevel': 'TurnOffAllWarnings', - 'WholeProgramOptimization': 'true', - 'XMLDocumentationFileName': 'a_file_name', - 'ZZXYZ': 'bogus'}, - 'Link': { - 'AdditionalDependencies': 'file1;file2', - 'AdditionalLibraryDirectories': 'folder1;folder2', - 'AdditionalManifestDependencies': 'file1;file2', - 'AdditionalOptions': 'a string1', - 'AddModuleNamesToAssembly': 'file1;file2', - 'AllowIsolation': 'true', - 'AssemblyDebug': '', - 'AssemblyLinkResource': 'file1;file2', - 'BaseAddress': 'a string1', - 'BuildingInIDE': 'true', - 'CLRImageType': 'ForceIJWImage', - 'CLRSupportLastError': 'Enabled', - 'CLRThreadAttribute': 'MTAThreadingAttribute', - 'CLRUnmanagedCodeCheck': 'true', - 'CreateHotPatchableImage': 'X86Image', - 'DataExecutionPrevention': 'false', - 'DelayLoadDLLs': 'file1;file2', - 'DelaySign': 'true', - 'Driver': 'NotSet', - 'EmbedManagedResourceFile': 'file1;file2', - 'EnableCOMDATFolding': 'false', - 'EnableUAC': 'true', - 'EntryPointSymbol': 'a string1', - 'FixedBaseAddress': 'false', - 'ForceFileOutput': 'Enabled', - 'ForceSymbolReferences': 'file1;file2', - 'FunctionOrder': 'a_file_name', - 'GenerateDebugInformation': 'true', - 'GenerateMapFile': 'true', - 'HeapCommitSize': 'a string1', - 'HeapReserveSize': 'a string1', - 'IgnoreAllDefaultLibraries': 'true', - 'IgnoreEmbeddedIDL': 'true', - 'IgnoreSpecificDefaultLibraries': 'a_file_list', - 'ImageHasSafeExceptionHandlers': 'true', - 'ImportLibrary': 'a_file_name', - 'KeyContainer': 'a_file_name', - 'KeyFile': 'a_file_name', - 'LargeAddressAware': 'false', - 'LinkDLL': 'true', - 'LinkErrorReporting': 'SendErrorReport', - 'LinkStatus': 'true', - 'LinkTimeCodeGeneration': 'UseLinkTimeCodeGeneration', - 'ManifestFile': 'a_file_name', - 'MapExports': 'true', - 'MapFileName': 'a_file_name', - 'MergedIDLBaseFileName': 'a_file_name', - 'MergeSections': 'a string1', - 'MidlCommandFile': 'a_file_name', - 'MinimumRequiredVersion': 'a string1', - 'ModuleDefinitionFile': 'a_file_name', - 'MSDOSStubFileName': 'a_file_name', - 'NoEntryPoint': 'true', - 'OptimizeReferences': 'false', - 'OutputFile': 'a_file_name', - 'PerUserRedirection': 'true', - 'PreventDllBinding': 'true', - 'Profile': 'true', - 'ProfileGuidedDatabase': 'a_file_name', - 'ProgramDatabaseFile': 'a_file_name', - 'RandomizedBaseAddress': 'false', - 'RegisterOutput': 'true', - 'SectionAlignment': '33', - 'SetChecksum': 'true', - 'ShowProgress': 'LinkVerboseREF', - 'SpecifySectionAttributes': 'a string1', - 'StackCommitSize': 'a string1', - 'StackReserveSize': 'a string1', - 'StripPrivateSymbols': 'a_file_name', - 'SubSystem': 'Console', - 'SupportNobindOfDelayLoadedDLL': 'true', - 'SupportUnloadOfDelayLoadedDLL': 'true', - 'SuppressStartupBanner': 'true', - 'SwapRunFromCD': 'true', - 'SwapRunFromNET': 'true', - 'TargetMachine': 'MachineX86', - 'TerminalServerAware': 'false', - 'TrackerLogDirectory': 'a_folder', - 'TreatLinkerWarningAsErrors': 'true', - 'TurnOffAssemblyGeneration': 'true', - 'TypeLibraryFile': 'a_file_name', - 'TypeLibraryResourceID': '33', - 'UACExecutionLevel': 'AsInvoker', - 'UACUIAccess': 'true', - 'Version': 'a string1'}, - 'ResourceCompile': { - 'AdditionalIncludeDirectories': 'folder1;folder2', - 'AdditionalOptions': 'a string1', - 'Culture': '0x236', - 'IgnoreStandardIncludePath': 'true', - 'NullTerminateStrings': 'true', - 'PreprocessorDefinitions': 'string1;string2', - 'ResourceOutputFileName': 'a string1', - 'ShowProgress': 'true', - 'SuppressStartupBanner': 'true', - 'TrackerLogDirectory': 'a_folder', - 'UndefinePreprocessorDefinitions': 'string1;string2'}, - 'Midl': { - 'AdditionalIncludeDirectories': 'folder1;folder2', - 'AdditionalOptions': 'a string1', - 'ApplicationConfigurationMode': 'true', - 'ClientStubFile': 'a_file_name', - 'CPreprocessOptions': 'a string1', - 'DefaultCharType': 'Signed', - 'DllDataFileName': 'a_file_name', - 'EnableErrorChecks': 'EnableCustom', - 'ErrorCheckAllocations': 'true', - 'ErrorCheckBounds': 'true', - 'ErrorCheckEnumRange': 'true', - 'ErrorCheckRefPointers': 'true', - 'ErrorCheckStubData': 'true', - 'GenerateClientFiles': 'Stub', - 'GenerateServerFiles': 'None', - 'GenerateStublessProxies': 'true', - 'GenerateTypeLibrary': 'true', - 'HeaderFileName': 'a_file_name', - 'IgnoreStandardIncludePath': 'true', - 'InterfaceIdentifierFileName': 'a_file_name', - 'LocaleID': '33', - 'MkTypLibCompatible': 'true', - 'OutputDirectory': 'a string1', - 'PreprocessorDefinitions': 'string1;string2', - 'ProxyFileName': 'a_file_name', - 'RedirectOutputAndErrors': 'a_file_name', - 'ServerStubFile': 'a_file_name', - 'StructMemberAlignment': 'NotSet', - 'SuppressCompilerWarnings': 'true', - 'SuppressStartupBanner': 'true', - 'TargetEnvironment': 'Itanium', - 'TrackerLogDirectory': 'a_folder', - 'TypeLibFormat': 'NewFormat', - 'TypeLibraryName': 'a_file_name', - 'UndefinePreprocessorDefinitions': 'string1;string2', - 'ValidateAllParameters': 'true', - 'WarnAsError': 'true', - 'WarningLevel': '1'}, - 'Lib': { - 'AdditionalDependencies': 'file1;file2', - 'AdditionalLibraryDirectories': 'folder1;folder2', - 'AdditionalOptions': 'a string1', - 'DisplayLibrary': 'a string1', - 'ErrorReporting': 'PromptImmediately', - 'ExportNamedFunctions': 'string1;string2', - 'ForceSymbolReferences': 'a string1', - 'IgnoreAllDefaultLibraries': 'true', - 'IgnoreSpecificDefaultLibraries': 'file1;file2', - 'LinkTimeCodeGeneration': 'true', - 'MinimumRequiredVersion': 'a string1', - 'ModuleDefinitionFile': 'a_file_name', - 'Name': 'a_file_name', - 'OutputFile': 'a_file_name', - 'RemoveObjects': 'file1;file2', - 'SubSystem': 'Console', - 'SuppressStartupBanner': 'true', - 'TargetMachine': 'MachineX86i', - 'TrackerLogDirectory': 'a_folder', - 'TreatLibWarningAsErrors': 'true', - 'UseUnicodeResponseFiles': 'true', - 'Verbose': 'true'}, - 'Manifest': { - 'AdditionalManifestFiles': 'file1;file2', - 'AdditionalOptions': 'a string1', - 'AssemblyIdentity': 'a string1', - 'ComponentFileName': 'a_file_name', - 'EnableDPIAwareness': 'fal', - 'GenerateCatalogFiles': 'truel', - 'GenerateCategoryTags': 'true', - 'InputResourceManifests': 'a string1', - 'ManifestFromManagedAssembly': 'a_file_name', - 'notgood3': 'bogus', - 'OutputManifestFile': 'a_file_name', - 'OutputResourceManifests': 'a string1', - 'RegistrarScriptFile': 'a_file_name', - 'ReplacementsFile': 'a_file_name', - 'SuppressDependencyElement': 'true', - 'SuppressStartupBanner': 'true', - 'TrackerLogDirectory': 'a_folder', - 'TypeLibraryFile': 'a_file_name', - 'UpdateFileHashes': 'true', - 'UpdateFileHashesSearchPath': 'a_file_name', - 'VerboseOutput': 'true'}, - 'ProjectReference': { - 'LinkLibraryDependencies': 'true', - 'UseLibraryDependencyInputs': 'true'}, - 'ManifestResourceCompile': { - 'ResourceOutputFileName': 'a_file_name'}, - '': { - 'EmbedManifest': 'true', - 'GenerateManifest': 'true', - 'IgnoreImportLibrary': 'true', - 'LinkIncremental': 'false'}}, - self.stderr) - self._ExpectedWarnings([ - 'Warning: unrecognized setting ClCompile/Enableprefast', - 'Warning: unrecognized setting ClCompile/ZZXYZ', - 'Warning: unrecognized setting Manifest/notgood3', - 'Warning: for Manifest/GenerateCatalogFiles, ' - "expected bool; got 'truel'", - 'Warning: for Lib/TargetMachine, unrecognized enumerated value ' - 'MachineX86i', - "Warning: for Manifest/EnableDPIAwareness, expected bool; got 'fal'"]) + def testValidateMSBuildSettings_settings(self): + """Tests that for invalid MSBuild settings.""" + MSVSSettings.ValidateMSBuildSettings( + { + "ClCompile": { + "AdditionalIncludeDirectories": "folder1;folder2", + "AdditionalOptions": ["string1", "string2"], + "AdditionalUsingDirectories": "folder1;folder2", + "AssemblerListingLocation": "a_file_name", + "AssemblerOutput": "NoListing", + "BasicRuntimeChecks": "StackFrameRuntimeCheck", + "BrowseInformation": "false", + "BrowseInformationFile": "a_file_name", + "BufferSecurityCheck": "true", + "BuildingInIDE": "true", + "CallingConvention": "Cdecl", + "CompileAs": "CompileAsC", + "CompileAsManaged": "true", + "CreateHotpatchableImage": "true", + "DebugInformationFormat": "ProgramDatabase", + "DisableLanguageExtensions": "true", + "DisableSpecificWarnings": "string1;string2", + "EnableEnhancedInstructionSet": "StreamingSIMDExtensions", + "EnableFiberSafeOptimizations": "true", + "EnablePREfast": "true", + "Enableprefast": "bogus", + "ErrorReporting": "Prompt", + "ExceptionHandling": "SyncCThrow", + "ExpandAttributedSource": "true", + "FavorSizeOrSpeed": "Neither", + "FloatingPointExceptions": "true", + "FloatingPointModel": "Precise", + "ForceConformanceInForLoopScope": "true", + "ForcedIncludeFiles": "file1;file2", + "ForcedUsingFiles": "file1;file2", + "FunctionLevelLinking": "false", + "GenerateXMLDocumentationFiles": "true", + "IgnoreStandardIncludePath": "true", + "InlineFunctionExpansion": "OnlyExplicitInline", + "IntrinsicFunctions": "false", + "MinimalRebuild": "true", + "MultiProcessorCompilation": "true", + "ObjectFileName": "a_file_name", + "OmitDefaultLibName": "true", + "OmitFramePointers": "true", + "OpenMPSupport": "true", + "Optimization": "Disabled", + "PrecompiledHeader": "NotUsing", + "PrecompiledHeaderFile": "a_file_name", + "PrecompiledHeaderOutputFile": "a_file_name", + "PreprocessKeepComments": "true", + "PreprocessorDefinitions": "string1;string2", + "PreprocessOutputPath": "a string1", + "PreprocessSuppressLineNumbers": "false", + "PreprocessToFile": "false", + "ProcessorNumber": "33", + "ProgramDataBaseFileName": "a_file_name", + "RuntimeLibrary": "MultiThreaded", + "RuntimeTypeInfo": "true", + "ShowIncludes": "true", + "SmallerTypeCheck": "true", + "StringPooling": "true", + "StructMemberAlignment": "1Byte", + "SuppressStartupBanner": "true", + "TrackerLogDirectory": "a_folder", + "TreatSpecificWarningsAsErrors": "string1;string2", + "TreatWarningAsError": "true", + "TreatWChar_tAsBuiltInType": "true", + "UndefineAllPreprocessorDefinitions": "true", + "UndefinePreprocessorDefinitions": "string1;string2", + "UseFullPaths": "true", + "UseUnicodeForAssemblerListing": "true", + "WarningLevel": "TurnOffAllWarnings", + "WholeProgramOptimization": "true", + "XMLDocumentationFileName": "a_file_name", + "ZZXYZ": "bogus", + }, + "Link": { + "AdditionalDependencies": "file1;file2", + "AdditionalLibraryDirectories": "folder1;folder2", + "AdditionalManifestDependencies": "file1;file2", + "AdditionalOptions": "a string1", + "AddModuleNamesToAssembly": "file1;file2", + "AllowIsolation": "true", + "AssemblyDebug": "", + "AssemblyLinkResource": "file1;file2", + "BaseAddress": "a string1", + "BuildingInIDE": "true", + "CLRImageType": "ForceIJWImage", + "CLRSupportLastError": "Enabled", + "CLRThreadAttribute": "MTAThreadingAttribute", + "CLRUnmanagedCodeCheck": "true", + "CreateHotPatchableImage": "X86Image", + "DataExecutionPrevention": "false", + "DelayLoadDLLs": "file1;file2", + "DelaySign": "true", + "Driver": "NotSet", + "EmbedManagedResourceFile": "file1;file2", + "EnableCOMDATFolding": "false", + "EnableUAC": "true", + "EntryPointSymbol": "a string1", + "FixedBaseAddress": "false", + "ForceFileOutput": "Enabled", + "ForceSymbolReferences": "file1;file2", + "FunctionOrder": "a_file_name", + "GenerateDebugInformation": "true", + "GenerateMapFile": "true", + "HeapCommitSize": "a string1", + "HeapReserveSize": "a string1", + "IgnoreAllDefaultLibraries": "true", + "IgnoreEmbeddedIDL": "true", + "IgnoreSpecificDefaultLibraries": "a_file_list", + "ImageHasSafeExceptionHandlers": "true", + "ImportLibrary": "a_file_name", + "KeyContainer": "a_file_name", + "KeyFile": "a_file_name", + "LargeAddressAware": "false", + "LinkDLL": "true", + "LinkErrorReporting": "SendErrorReport", + "LinkStatus": "true", + "LinkTimeCodeGeneration": "UseLinkTimeCodeGeneration", + "ManifestFile": "a_file_name", + "MapExports": "true", + "MapFileName": "a_file_name", + "MergedIDLBaseFileName": "a_file_name", + "MergeSections": "a string1", + "MidlCommandFile": "a_file_name", + "MinimumRequiredVersion": "a string1", + "ModuleDefinitionFile": "a_file_name", + "MSDOSStubFileName": "a_file_name", + "NoEntryPoint": "true", + "OptimizeReferences": "false", + "OutputFile": "a_file_name", + "PerUserRedirection": "true", + "PreventDllBinding": "true", + "Profile": "true", + "ProfileGuidedDatabase": "a_file_name", + "ProgramDatabaseFile": "a_file_name", + "RandomizedBaseAddress": "false", + "RegisterOutput": "true", + "SectionAlignment": "33", + "SetChecksum": "true", + "ShowProgress": "LinkVerboseREF", + "SpecifySectionAttributes": "a string1", + "StackCommitSize": "a string1", + "StackReserveSize": "a string1", + "StripPrivateSymbols": "a_file_name", + "SubSystem": "Console", + "SupportNobindOfDelayLoadedDLL": "true", + "SupportUnloadOfDelayLoadedDLL": "true", + "SuppressStartupBanner": "true", + "SwapRunFromCD": "true", + "SwapRunFromNET": "true", + "TargetMachine": "MachineX86", + "TerminalServerAware": "false", + "TrackerLogDirectory": "a_folder", + "TreatLinkerWarningAsErrors": "true", + "TurnOffAssemblyGeneration": "true", + "TypeLibraryFile": "a_file_name", + "TypeLibraryResourceID": "33", + "UACExecutionLevel": "AsInvoker", + "UACUIAccess": "true", + "Version": "a string1", + }, + "ResourceCompile": { + "AdditionalIncludeDirectories": "folder1;folder2", + "AdditionalOptions": "a string1", + "Culture": "0x236", + "IgnoreStandardIncludePath": "true", + "NullTerminateStrings": "true", + "PreprocessorDefinitions": "string1;string2", + "ResourceOutputFileName": "a string1", + "ShowProgress": "true", + "SuppressStartupBanner": "true", + "TrackerLogDirectory": "a_folder", + "UndefinePreprocessorDefinitions": "string1;string2", + }, + "Midl": { + "AdditionalIncludeDirectories": "folder1;folder2", + "AdditionalOptions": "a string1", + "ApplicationConfigurationMode": "true", + "ClientStubFile": "a_file_name", + "CPreprocessOptions": "a string1", + "DefaultCharType": "Signed", + "DllDataFileName": "a_file_name", + "EnableErrorChecks": "EnableCustom", + "ErrorCheckAllocations": "true", + "ErrorCheckBounds": "true", + "ErrorCheckEnumRange": "true", + "ErrorCheckRefPointers": "true", + "ErrorCheckStubData": "true", + "GenerateClientFiles": "Stub", + "GenerateServerFiles": "None", + "GenerateStublessProxies": "true", + "GenerateTypeLibrary": "true", + "HeaderFileName": "a_file_name", + "IgnoreStandardIncludePath": "true", + "InterfaceIdentifierFileName": "a_file_name", + "LocaleID": "33", + "MkTypLibCompatible": "true", + "OutputDirectory": "a string1", + "PreprocessorDefinitions": "string1;string2", + "ProxyFileName": "a_file_name", + "RedirectOutputAndErrors": "a_file_name", + "ServerStubFile": "a_file_name", + "StructMemberAlignment": "NotSet", + "SuppressCompilerWarnings": "true", + "SuppressStartupBanner": "true", + "TargetEnvironment": "Itanium", + "TrackerLogDirectory": "a_folder", + "TypeLibFormat": "NewFormat", + "TypeLibraryName": "a_file_name", + "UndefinePreprocessorDefinitions": "string1;string2", + "ValidateAllParameters": "true", + "WarnAsError": "true", + "WarningLevel": "1", + }, + "Lib": { + "AdditionalDependencies": "file1;file2", + "AdditionalLibraryDirectories": "folder1;folder2", + "AdditionalOptions": "a string1", + "DisplayLibrary": "a string1", + "ErrorReporting": "PromptImmediately", + "ExportNamedFunctions": "string1;string2", + "ForceSymbolReferences": "a string1", + "IgnoreAllDefaultLibraries": "true", + "IgnoreSpecificDefaultLibraries": "file1;file2", + "LinkTimeCodeGeneration": "true", + "MinimumRequiredVersion": "a string1", + "ModuleDefinitionFile": "a_file_name", + "Name": "a_file_name", + "OutputFile": "a_file_name", + "RemoveObjects": "file1;file2", + "SubSystem": "Console", + "SuppressStartupBanner": "true", + "TargetMachine": "MachineX86i", + "TrackerLogDirectory": "a_folder", + "TreatLibWarningAsErrors": "true", + "UseUnicodeResponseFiles": "true", + "Verbose": "true", + }, + "Manifest": { + "AdditionalManifestFiles": "file1;file2", + "AdditionalOptions": "a string1", + "AssemblyIdentity": "a string1", + "ComponentFileName": "a_file_name", + "EnableDPIAwareness": "fal", + "GenerateCatalogFiles": "truel", + "GenerateCategoryTags": "true", + "InputResourceManifests": "a string1", + "ManifestFromManagedAssembly": "a_file_name", + "notgood3": "bogus", + "OutputManifestFile": "a_file_name", + "OutputResourceManifests": "a string1", + "RegistrarScriptFile": "a_file_name", + "ReplacementsFile": "a_file_name", + "SuppressDependencyElement": "true", + "SuppressStartupBanner": "true", + "TrackerLogDirectory": "a_folder", + "TypeLibraryFile": "a_file_name", + "UpdateFileHashes": "true", + "UpdateFileHashesSearchPath": "a_file_name", + "VerboseOutput": "true", + }, + "ProjectReference": { + "LinkLibraryDependencies": "true", + "UseLibraryDependencyInputs": "true", + }, + "ManifestResourceCompile": {"ResourceOutputFileName": "a_file_name"}, + "": { + "EmbedManifest": "true", + "GenerateManifest": "true", + "IgnoreImportLibrary": "true", + "LinkIncremental": "false", + }, + }, + self.stderr, + ) + self._ExpectedWarnings( + [ + "Warning: unrecognized setting ClCompile/Enableprefast", + "Warning: unrecognized setting ClCompile/ZZXYZ", + "Warning: unrecognized setting Manifest/notgood3", + "Warning: for Manifest/GenerateCatalogFiles, " + "expected bool; got 'truel'", + "Warning: for Lib/TargetMachine, unrecognized enumerated value " + "MachineX86i", + "Warning: for Manifest/EnableDPIAwareness, expected bool; got 'fal'", + ] + ) - def testConvertToMSBuildSettings_empty(self): - """Tests an empty conversion.""" - msvs_settings = {} - expected_msbuild_settings = {} - actual_msbuild_settings = MSVSSettings.ConvertToMSBuildSettings( - msvs_settings, - self.stderr) - self.assertEqual(expected_msbuild_settings, actual_msbuild_settings) - self._ExpectedWarnings([]) + def testConvertToMSBuildSettings_empty(self): + """Tests an empty conversion.""" + msvs_settings = {} + expected_msbuild_settings = {} + actual_msbuild_settings = MSVSSettings.ConvertToMSBuildSettings( + msvs_settings, self.stderr + ) + self.assertEqual(expected_msbuild_settings, actual_msbuild_settings) + self._ExpectedWarnings([]) - def testConvertToMSBuildSettings_minimal(self): - """Tests a minimal conversion.""" - msvs_settings = { - 'VCCLCompilerTool': { - 'AdditionalIncludeDirectories': 'dir1', - 'AdditionalOptions': '/foo', - 'BasicRuntimeChecks': '0', + def testConvertToMSBuildSettings_minimal(self): + """Tests a minimal conversion.""" + msvs_settings = { + "VCCLCompilerTool": { + "AdditionalIncludeDirectories": "dir1", + "AdditionalOptions": "/foo", + "BasicRuntimeChecks": "0", }, - 'VCLinkerTool': { - 'LinkTimeCodeGeneration': '1', - 'ErrorReporting': '1', - 'DataExecutionPrevention': '2', + "VCLinkerTool": { + "LinkTimeCodeGeneration": "1", + "ErrorReporting": "1", + "DataExecutionPrevention": "2", }, } - expected_msbuild_settings = { - 'ClCompile': { - 'AdditionalIncludeDirectories': 'dir1', - 'AdditionalOptions': '/foo', - 'BasicRuntimeChecks': 'Default', + expected_msbuild_settings = { + "ClCompile": { + "AdditionalIncludeDirectories": "dir1", + "AdditionalOptions": "/foo", + "BasicRuntimeChecks": "Default", }, - 'Link': { - 'LinkTimeCodeGeneration': 'UseLinkTimeCodeGeneration', - 'LinkErrorReporting': 'PromptImmediately', - 'DataExecutionPrevention': 'true', + "Link": { + "LinkTimeCodeGeneration": "UseLinkTimeCodeGeneration", + "LinkErrorReporting": "PromptImmediately", + "DataExecutionPrevention": "true", }, } - actual_msbuild_settings = MSVSSettings.ConvertToMSBuildSettings( - msvs_settings, - self.stderr) - self.assertEqual(expected_msbuild_settings, actual_msbuild_settings) - self._ExpectedWarnings([]) - - def testConvertToMSBuildSettings_warnings(self): - """Tests conversion that generates warnings.""" - msvs_settings = { - 'VCCLCompilerTool': { - 'AdditionalIncludeDirectories': '1', - 'AdditionalOptions': '2', - # These are incorrect values: - 'BasicRuntimeChecks': '12', - 'BrowseInformation': '21', - 'UsePrecompiledHeader': '13', - 'GeneratePreprocessedFile': '14'}, - 'VCLinkerTool': { - # These are incorrect values: - 'Driver': '10', - 'LinkTimeCodeGeneration': '31', - 'ErrorReporting': '21', - 'FixedBaseAddress': '6'}, - 'VCResourceCompilerTool': { - # Custom - 'Culture': '1003'}} - expected_msbuild_settings = { - 'ClCompile': { - 'AdditionalIncludeDirectories': '1', - 'AdditionalOptions': '2'}, - 'Link': {}, - 'ResourceCompile': { - # Custom - 'Culture': '0x03eb'}} - actual_msbuild_settings = MSVSSettings.ConvertToMSBuildSettings( - msvs_settings, - self.stderr) - self.assertEqual(expected_msbuild_settings, actual_msbuild_settings) - self._ExpectedWarnings([ - 'Warning: while converting VCCLCompilerTool/BasicRuntimeChecks to ' - 'MSBuild, index value (12) not in expected range [0, 4)', - 'Warning: while converting VCCLCompilerTool/BrowseInformation to ' - 'MSBuild, index value (21) not in expected range [0, 3)', - 'Warning: while converting VCCLCompilerTool/UsePrecompiledHeader to ' - 'MSBuild, index value (13) not in expected range [0, 3)', - 'Warning: while converting VCCLCompilerTool/GeneratePreprocessedFile to ' - 'MSBuild, value must be one of [0, 1, 2]; got 14', + actual_msbuild_settings = MSVSSettings.ConvertToMSBuildSettings( + msvs_settings, self.stderr + ) + self.assertEqual(expected_msbuild_settings, actual_msbuild_settings) + self._ExpectedWarnings([]) - 'Warning: while converting VCLinkerTool/Driver to ' - 'MSBuild, index value (10) not in expected range [0, 4)', - 'Warning: while converting VCLinkerTool/LinkTimeCodeGeneration to ' - 'MSBuild, index value (31) not in expected range [0, 5)', - 'Warning: while converting VCLinkerTool/ErrorReporting to ' - 'MSBuild, index value (21) not in expected range [0, 3)', - 'Warning: while converting VCLinkerTool/FixedBaseAddress to ' - 'MSBuild, index value (6) not in expected range [0, 3)', - ]) + def testConvertToMSBuildSettings_warnings(self): + """Tests conversion that generates warnings.""" + msvs_settings = { + "VCCLCompilerTool": { + "AdditionalIncludeDirectories": "1", + "AdditionalOptions": "2", + # These are incorrect values: + "BasicRuntimeChecks": "12", + "BrowseInformation": "21", + "UsePrecompiledHeader": "13", + "GeneratePreprocessedFile": "14", + }, + "VCLinkerTool": { + # These are incorrect values: + "Driver": "10", + "LinkTimeCodeGeneration": "31", + "ErrorReporting": "21", + "FixedBaseAddress": "6", + }, + "VCResourceCompilerTool": { + # Custom + "Culture": "1003" + }, + } + expected_msbuild_settings = { + "ClCompile": { + "AdditionalIncludeDirectories": "1", + "AdditionalOptions": "2", + }, + "Link": {}, + "ResourceCompile": { + # Custom + "Culture": "0x03eb" + }, + } + actual_msbuild_settings = MSVSSettings.ConvertToMSBuildSettings( + msvs_settings, self.stderr + ) + self.assertEqual(expected_msbuild_settings, actual_msbuild_settings) + self._ExpectedWarnings( + [ + "Warning: while converting VCCLCompilerTool/BasicRuntimeChecks to " + "MSBuild, index value (12) not in expected range [0, 4)", + "Warning: while converting VCCLCompilerTool/BrowseInformation to " + "MSBuild, index value (21) not in expected range [0, 3)", + "Warning: while converting VCCLCompilerTool/UsePrecompiledHeader to " + "MSBuild, index value (13) not in expected range [0, 3)", + "Warning: while converting VCCLCompilerTool/GeneratePreprocessedFile to " + "MSBuild, value must be one of [0, 1, 2]; got 14", + "Warning: while converting VCLinkerTool/Driver to " + "MSBuild, index value (10) not in expected range [0, 4)", + "Warning: while converting VCLinkerTool/LinkTimeCodeGeneration to " + "MSBuild, index value (31) not in expected range [0, 5)", + "Warning: while converting VCLinkerTool/ErrorReporting to " + "MSBuild, index value (21) not in expected range [0, 3)", + "Warning: while converting VCLinkerTool/FixedBaseAddress to " + "MSBuild, index value (6) not in expected range [0, 3)", + ] + ) - def testConvertToMSBuildSettings_full_synthetic(self): - """Tests conversion of all the MSBuild settings.""" - msvs_settings = { - 'VCCLCompilerTool': { - 'AdditionalIncludeDirectories': 'folder1;folder2;folder3', - 'AdditionalOptions': 'a_string', - 'AdditionalUsingDirectories': 'folder1;folder2;folder3', - 'AssemblerListingLocation': 'a_file_name', - 'AssemblerOutput': '0', - 'BasicRuntimeChecks': '1', - 'BrowseInformation': '2', - 'BrowseInformationFile': 'a_file_name', - 'BufferSecurityCheck': 'true', - 'CallingConvention': '0', - 'CompileAs': '1', - 'DebugInformationFormat': '4', - 'DefaultCharIsUnsigned': 'true', - 'Detect64BitPortabilityProblems': 'true', - 'DisableLanguageExtensions': 'true', - 'DisableSpecificWarnings': 'd1;d2;d3', - 'EnableEnhancedInstructionSet': '0', - 'EnableFiberSafeOptimizations': 'true', - 'EnableFunctionLevelLinking': 'true', - 'EnableIntrinsicFunctions': 'true', - 'EnablePREfast': 'true', - 'ErrorReporting': '1', - 'ExceptionHandling': '2', - 'ExpandAttributedSource': 'true', - 'FavorSizeOrSpeed': '0', - 'FloatingPointExceptions': 'true', - 'FloatingPointModel': '1', - 'ForceConformanceInForLoopScope': 'true', - 'ForcedIncludeFiles': 'file1;file2;file3', - 'ForcedUsingFiles': 'file1;file2;file3', - 'GeneratePreprocessedFile': '1', - 'GenerateXMLDocumentationFiles': 'true', - 'IgnoreStandardIncludePath': 'true', - 'InlineFunctionExpansion': '2', - 'KeepComments': 'true', - 'MinimalRebuild': 'true', - 'ObjectFile': 'a_file_name', - 'OmitDefaultLibName': 'true', - 'OmitFramePointers': 'true', - 'OpenMP': 'true', - 'Optimization': '3', - 'PrecompiledHeaderFile': 'a_file_name', - 'PrecompiledHeaderThrough': 'a_file_name', - 'PreprocessorDefinitions': 'd1;d2;d3', - 'ProgramDataBaseFileName': 'a_file_name', - 'RuntimeLibrary': '0', - 'RuntimeTypeInfo': 'true', - 'ShowIncludes': 'true', - 'SmallerTypeCheck': 'true', - 'StringPooling': 'true', - 'StructMemberAlignment': '1', - 'SuppressStartupBanner': 'true', - 'TreatWChar_tAsBuiltInType': 'true', - 'UndefineAllPreprocessorDefinitions': 'true', - 'UndefinePreprocessorDefinitions': 'd1;d2;d3', - 'UseFullPaths': 'true', - 'UsePrecompiledHeader': '1', - 'UseUnicodeResponseFiles': 'true', - 'WarnAsError': 'true', - 'WarningLevel': '2', - 'WholeProgramOptimization': 'true', - 'XMLDocumentationFileName': 'a_file_name'}, - 'VCLinkerTool': { - 'AdditionalDependencies': 'file1;file2;file3', - 'AdditionalLibraryDirectories': 'folder1;folder2;folder3', - 'AdditionalLibraryDirectories_excluded': 'folder1;folder2;folder3', - 'AdditionalManifestDependencies': 'file1;file2;file3', - 'AdditionalOptions': 'a_string', - 'AddModuleNamesToAssembly': 'file1;file2;file3', - 'AllowIsolation': 'true', - 'AssemblyDebug': '0', - 'AssemblyLinkResource': 'file1;file2;file3', - 'BaseAddress': 'a_string', - 'CLRImageType': '1', - 'CLRThreadAttribute': '2', - 'CLRUnmanagedCodeCheck': 'true', - 'DataExecutionPrevention': '0', - 'DelayLoadDLLs': 'file1;file2;file3', - 'DelaySign': 'true', - 'Driver': '1', - 'EmbedManagedResourceFile': 'file1;file2;file3', - 'EnableCOMDATFolding': '0', - 'EnableUAC': 'true', - 'EntryPointSymbol': 'a_string', - 'ErrorReporting': '0', - 'FixedBaseAddress': '1', - 'ForceSymbolReferences': 'file1;file2;file3', - 'FunctionOrder': 'a_file_name', - 'GenerateDebugInformation': 'true', - 'GenerateManifest': 'true', - 'GenerateMapFile': 'true', - 'HeapCommitSize': 'a_string', - 'HeapReserveSize': 'a_string', - 'IgnoreAllDefaultLibraries': 'true', - 'IgnoreDefaultLibraryNames': 'file1;file2;file3', - 'IgnoreEmbeddedIDL': 'true', - 'IgnoreImportLibrary': 'true', - 'ImportLibrary': 'a_file_name', - 'KeyContainer': 'a_file_name', - 'KeyFile': 'a_file_name', - 'LargeAddressAware': '2', - 'LinkIncremental': '1', - 'LinkLibraryDependencies': 'true', - 'LinkTimeCodeGeneration': '2', - 'ManifestFile': 'a_file_name', - 'MapExports': 'true', - 'MapFileName': 'a_file_name', - 'MergedIDLBaseFileName': 'a_file_name', - 'MergeSections': 'a_string', - 'MidlCommandFile': 'a_file_name', - 'ModuleDefinitionFile': 'a_file_name', - 'OptimizeForWindows98': '1', - 'OptimizeReferences': '0', - 'OutputFile': 'a_file_name', - 'PerUserRedirection': 'true', - 'Profile': 'true', - 'ProfileGuidedDatabase': 'a_file_name', - 'ProgramDatabaseFile': 'a_file_name', - 'RandomizedBaseAddress': '1', - 'RegisterOutput': 'true', - 'ResourceOnlyDLL': 'true', - 'SetChecksum': 'true', - 'ShowProgress': '0', - 'StackCommitSize': 'a_string', - 'StackReserveSize': 'a_string', - 'StripPrivateSymbols': 'a_file_name', - 'SubSystem': '2', - 'SupportUnloadOfDelayLoadedDLL': 'true', - 'SuppressStartupBanner': 'true', - 'SwapRunFromCD': 'true', - 'SwapRunFromNet': 'true', - 'TargetMachine': '3', - 'TerminalServerAware': '2', - 'TurnOffAssemblyGeneration': 'true', - 'TypeLibraryFile': 'a_file_name', - 'TypeLibraryResourceID': '33', - 'UACExecutionLevel': '1', - 'UACUIAccess': 'true', - 'UseLibraryDependencyInputs': 'false', - 'UseUnicodeResponseFiles': 'true', - 'Version': 'a_string'}, - 'VCResourceCompilerTool': { - 'AdditionalIncludeDirectories': 'folder1;folder2;folder3', - 'AdditionalOptions': 'a_string', - 'Culture': '1003', - 'IgnoreStandardIncludePath': 'true', - 'PreprocessorDefinitions': 'd1;d2;d3', - 'ResourceOutputFileName': 'a_string', - 'ShowProgress': 'true', - 'SuppressStartupBanner': 'true', - 'UndefinePreprocessorDefinitions': 'd1;d2;d3'}, - 'VCMIDLTool': { - 'AdditionalIncludeDirectories': 'folder1;folder2;folder3', - 'AdditionalOptions': 'a_string', - 'CPreprocessOptions': 'a_string', - 'DefaultCharType': '0', - 'DLLDataFileName': 'a_file_name', - 'EnableErrorChecks': '2', - 'ErrorCheckAllocations': 'true', - 'ErrorCheckBounds': 'true', - 'ErrorCheckEnumRange': 'true', - 'ErrorCheckRefPointers': 'true', - 'ErrorCheckStubData': 'true', - 'GenerateStublessProxies': 'true', - 'GenerateTypeLibrary': 'true', - 'HeaderFileName': 'a_file_name', - 'IgnoreStandardIncludePath': 'true', - 'InterfaceIdentifierFileName': 'a_file_name', - 'MkTypLibCompatible': 'true', - 'OutputDirectory': 'a_string', - 'PreprocessorDefinitions': 'd1;d2;d3', - 'ProxyFileName': 'a_file_name', - 'RedirectOutputAndErrors': 'a_file_name', - 'StructMemberAlignment': '3', - 'SuppressStartupBanner': 'true', - 'TargetEnvironment': '1', - 'TypeLibraryName': 'a_file_name', - 'UndefinePreprocessorDefinitions': 'd1;d2;d3', - 'ValidateParameters': 'true', - 'WarnAsError': 'true', - 'WarningLevel': '4'}, - 'VCLibrarianTool': { - 'AdditionalDependencies': 'file1;file2;file3', - 'AdditionalLibraryDirectories': 'folder1;folder2;folder3', - 'AdditionalLibraryDirectories_excluded': 'folder1;folder2;folder3', - 'AdditionalOptions': 'a_string', - 'ExportNamedFunctions': 'd1;d2;d3', - 'ForceSymbolReferences': 'a_string', - 'IgnoreAllDefaultLibraries': 'true', - 'IgnoreSpecificDefaultLibraries': 'file1;file2;file3', - 'LinkLibraryDependencies': 'true', - 'ModuleDefinitionFile': 'a_file_name', - 'OutputFile': 'a_file_name', - 'SuppressStartupBanner': 'true', - 'UseUnicodeResponseFiles': 'true'}, - 'VCManifestTool': { - 'AdditionalManifestFiles': 'file1;file2;file3', - 'AdditionalOptions': 'a_string', - 'AssemblyIdentity': 'a_string', - 'ComponentFileName': 'a_file_name', - 'DependencyInformationFile': 'a_file_name', - 'EmbedManifest': 'true', - 'GenerateCatalogFiles': 'true', - 'InputResourceManifests': 'a_string', - 'ManifestResourceFile': 'my_name', - 'OutputManifestFile': 'a_file_name', - 'RegistrarScriptFile': 'a_file_name', - 'ReplacementsFile': 'a_file_name', - 'SuppressStartupBanner': 'true', - 'TypeLibraryFile': 'a_file_name', - 'UpdateFileHashes': 'true', - 'UpdateFileHashesSearchPath': 'a_file_name', - 'UseFAT32Workaround': 'true', - 'UseUnicodeResponseFiles': 'true', - 'VerboseOutput': 'true'}} - expected_msbuild_settings = { - 'ClCompile': { - 'AdditionalIncludeDirectories': 'folder1;folder2;folder3', - 'AdditionalOptions': 'a_string /J', - 'AdditionalUsingDirectories': 'folder1;folder2;folder3', - 'AssemblerListingLocation': 'a_file_name', - 'AssemblerOutput': 'NoListing', - 'BasicRuntimeChecks': 'StackFrameRuntimeCheck', - 'BrowseInformation': 'true', - 'BrowseInformationFile': 'a_file_name', - 'BufferSecurityCheck': 'true', - 'CallingConvention': 'Cdecl', - 'CompileAs': 'CompileAsC', - 'DebugInformationFormat': 'EditAndContinue', - 'DisableLanguageExtensions': 'true', - 'DisableSpecificWarnings': 'd1;d2;d3', - 'EnableEnhancedInstructionSet': 'NotSet', - 'EnableFiberSafeOptimizations': 'true', - 'EnablePREfast': 'true', - 'ErrorReporting': 'Prompt', - 'ExceptionHandling': 'Async', - 'ExpandAttributedSource': 'true', - 'FavorSizeOrSpeed': 'Neither', - 'FloatingPointExceptions': 'true', - 'FloatingPointModel': 'Strict', - 'ForceConformanceInForLoopScope': 'true', - 'ForcedIncludeFiles': 'file1;file2;file3', - 'ForcedUsingFiles': 'file1;file2;file3', - 'FunctionLevelLinking': 'true', - 'GenerateXMLDocumentationFiles': 'true', - 'IgnoreStandardIncludePath': 'true', - 'InlineFunctionExpansion': 'AnySuitable', - 'IntrinsicFunctions': 'true', - 'MinimalRebuild': 'true', - 'ObjectFileName': 'a_file_name', - 'OmitDefaultLibName': 'true', - 'OmitFramePointers': 'true', - 'OpenMPSupport': 'true', - 'Optimization': 'Full', - 'PrecompiledHeader': 'Create', - 'PrecompiledHeaderFile': 'a_file_name', - 'PrecompiledHeaderOutputFile': 'a_file_name', - 'PreprocessKeepComments': 'true', - 'PreprocessorDefinitions': 'd1;d2;d3', - 'PreprocessSuppressLineNumbers': 'false', - 'PreprocessToFile': 'true', - 'ProgramDataBaseFileName': 'a_file_name', - 'RuntimeLibrary': 'MultiThreaded', - 'RuntimeTypeInfo': 'true', - 'ShowIncludes': 'true', - 'SmallerTypeCheck': 'true', - 'StringPooling': 'true', - 'StructMemberAlignment': '1Byte', - 'SuppressStartupBanner': 'true', - 'TreatWarningAsError': 'true', - 'TreatWChar_tAsBuiltInType': 'true', - 'UndefineAllPreprocessorDefinitions': 'true', - 'UndefinePreprocessorDefinitions': 'd1;d2;d3', - 'UseFullPaths': 'true', - 'WarningLevel': 'Level2', - 'WholeProgramOptimization': 'true', - 'XMLDocumentationFileName': 'a_file_name'}, - 'Link': { - 'AdditionalDependencies': 'file1;file2;file3', - 'AdditionalLibraryDirectories': 'folder1;folder2;folder3', - 'AdditionalManifestDependencies': 'file1;file2;file3', - 'AdditionalOptions': 'a_string', - 'AddModuleNamesToAssembly': 'file1;file2;file3', - 'AllowIsolation': 'true', - 'AssemblyDebug': '', - 'AssemblyLinkResource': 'file1;file2;file3', - 'BaseAddress': 'a_string', - 'CLRImageType': 'ForceIJWImage', - 'CLRThreadAttribute': 'STAThreadingAttribute', - 'CLRUnmanagedCodeCheck': 'true', - 'DataExecutionPrevention': '', - 'DelayLoadDLLs': 'file1;file2;file3', - 'DelaySign': 'true', - 'Driver': 'Driver', - 'EmbedManagedResourceFile': 'file1;file2;file3', - 'EnableCOMDATFolding': '', - 'EnableUAC': 'true', - 'EntryPointSymbol': 'a_string', - 'FixedBaseAddress': 'false', - 'ForceSymbolReferences': 'file1;file2;file3', - 'FunctionOrder': 'a_file_name', - 'GenerateDebugInformation': 'true', - 'GenerateMapFile': 'true', - 'HeapCommitSize': 'a_string', - 'HeapReserveSize': 'a_string', - 'IgnoreAllDefaultLibraries': 'true', - 'IgnoreEmbeddedIDL': 'true', - 'IgnoreSpecificDefaultLibraries': 'file1;file2;file3', - 'ImportLibrary': 'a_file_name', - 'KeyContainer': 'a_file_name', - 'KeyFile': 'a_file_name', - 'LargeAddressAware': 'true', - 'LinkErrorReporting': 'NoErrorReport', - 'LinkTimeCodeGeneration': 'PGInstrument', - 'ManifestFile': 'a_file_name', - 'MapExports': 'true', - 'MapFileName': 'a_file_name', - 'MergedIDLBaseFileName': 'a_file_name', - 'MergeSections': 'a_string', - 'MidlCommandFile': 'a_file_name', - 'ModuleDefinitionFile': 'a_file_name', - 'NoEntryPoint': 'true', - 'OptimizeReferences': '', - 'OutputFile': 'a_file_name', - 'PerUserRedirection': 'true', - 'Profile': 'true', - 'ProfileGuidedDatabase': 'a_file_name', - 'ProgramDatabaseFile': 'a_file_name', - 'RandomizedBaseAddress': 'false', - 'RegisterOutput': 'true', - 'SetChecksum': 'true', - 'ShowProgress': 'NotSet', - 'StackCommitSize': 'a_string', - 'StackReserveSize': 'a_string', - 'StripPrivateSymbols': 'a_file_name', - 'SubSystem': 'Windows', - 'SupportUnloadOfDelayLoadedDLL': 'true', - 'SuppressStartupBanner': 'true', - 'SwapRunFromCD': 'true', - 'SwapRunFromNET': 'true', - 'TargetMachine': 'MachineARM', - 'TerminalServerAware': 'true', - 'TurnOffAssemblyGeneration': 'true', - 'TypeLibraryFile': 'a_file_name', - 'TypeLibraryResourceID': '33', - 'UACExecutionLevel': 'HighestAvailable', - 'UACUIAccess': 'true', - 'Version': 'a_string'}, - 'ResourceCompile': { - 'AdditionalIncludeDirectories': 'folder1;folder2;folder3', - 'AdditionalOptions': 'a_string', - 'Culture': '0x03eb', - 'IgnoreStandardIncludePath': 'true', - 'PreprocessorDefinitions': 'd1;d2;d3', - 'ResourceOutputFileName': 'a_string', - 'ShowProgress': 'true', - 'SuppressStartupBanner': 'true', - 'UndefinePreprocessorDefinitions': 'd1;d2;d3'}, - 'Midl': { - 'AdditionalIncludeDirectories': 'folder1;folder2;folder3', - 'AdditionalOptions': 'a_string', - 'CPreprocessOptions': 'a_string', - 'DefaultCharType': 'Unsigned', - 'DllDataFileName': 'a_file_name', - 'EnableErrorChecks': 'All', - 'ErrorCheckAllocations': 'true', - 'ErrorCheckBounds': 'true', - 'ErrorCheckEnumRange': 'true', - 'ErrorCheckRefPointers': 'true', - 'ErrorCheckStubData': 'true', - 'GenerateStublessProxies': 'true', - 'GenerateTypeLibrary': 'true', - 'HeaderFileName': 'a_file_name', - 'IgnoreStandardIncludePath': 'true', - 'InterfaceIdentifierFileName': 'a_file_name', - 'MkTypLibCompatible': 'true', - 'OutputDirectory': 'a_string', - 'PreprocessorDefinitions': 'd1;d2;d3', - 'ProxyFileName': 'a_file_name', - 'RedirectOutputAndErrors': 'a_file_name', - 'StructMemberAlignment': '4', - 'SuppressStartupBanner': 'true', - 'TargetEnvironment': 'Win32', - 'TypeLibraryName': 'a_file_name', - 'UndefinePreprocessorDefinitions': 'd1;d2;d3', - 'ValidateAllParameters': 'true', - 'WarnAsError': 'true', - 'WarningLevel': '4'}, - 'Lib': { - 'AdditionalDependencies': 'file1;file2;file3', - 'AdditionalLibraryDirectories': 'folder1;folder2;folder3', - 'AdditionalOptions': 'a_string', - 'ExportNamedFunctions': 'd1;d2;d3', - 'ForceSymbolReferences': 'a_string', - 'IgnoreAllDefaultLibraries': 'true', - 'IgnoreSpecificDefaultLibraries': 'file1;file2;file3', - 'ModuleDefinitionFile': 'a_file_name', - 'OutputFile': 'a_file_name', - 'SuppressStartupBanner': 'true', - 'UseUnicodeResponseFiles': 'true'}, - 'Manifest': { - 'AdditionalManifestFiles': 'file1;file2;file3', - 'AdditionalOptions': 'a_string', - 'AssemblyIdentity': 'a_string', - 'ComponentFileName': 'a_file_name', - 'GenerateCatalogFiles': 'true', - 'InputResourceManifests': 'a_string', - 'OutputManifestFile': 'a_file_name', - 'RegistrarScriptFile': 'a_file_name', - 'ReplacementsFile': 'a_file_name', - 'SuppressStartupBanner': 'true', - 'TypeLibraryFile': 'a_file_name', - 'UpdateFileHashes': 'true', - 'UpdateFileHashesSearchPath': 'a_file_name', - 'VerboseOutput': 'true'}, - 'ManifestResourceCompile': { - 'ResourceOutputFileName': 'my_name'}, - 'ProjectReference': { - 'LinkLibraryDependencies': 'true', - 'UseLibraryDependencyInputs': 'false'}, - '': { - 'EmbedManifest': 'true', - 'GenerateManifest': 'true', - 'IgnoreImportLibrary': 'true', - 'LinkIncremental': 'false'}} - self.maxDiff = 9999 # on failure display a long diff - actual_msbuild_settings = MSVSSettings.ConvertToMSBuildSettings( - msvs_settings, - self.stderr) - self.assertEqual(expected_msbuild_settings, actual_msbuild_settings) - self._ExpectedWarnings([]) + def testConvertToMSBuildSettings_full_synthetic(self): + """Tests conversion of all the MSBuild settings.""" + msvs_settings = { + "VCCLCompilerTool": { + "AdditionalIncludeDirectories": "folder1;folder2;folder3", + "AdditionalOptions": "a_string", + "AdditionalUsingDirectories": "folder1;folder2;folder3", + "AssemblerListingLocation": "a_file_name", + "AssemblerOutput": "0", + "BasicRuntimeChecks": "1", + "BrowseInformation": "2", + "BrowseInformationFile": "a_file_name", + "BufferSecurityCheck": "true", + "CallingConvention": "0", + "CompileAs": "1", + "DebugInformationFormat": "4", + "DefaultCharIsUnsigned": "true", + "Detect64BitPortabilityProblems": "true", + "DisableLanguageExtensions": "true", + "DisableSpecificWarnings": "d1;d2;d3", + "EnableEnhancedInstructionSet": "0", + "EnableFiberSafeOptimizations": "true", + "EnableFunctionLevelLinking": "true", + "EnableIntrinsicFunctions": "true", + "EnablePREfast": "true", + "ErrorReporting": "1", + "ExceptionHandling": "2", + "ExpandAttributedSource": "true", + "FavorSizeOrSpeed": "0", + "FloatingPointExceptions": "true", + "FloatingPointModel": "1", + "ForceConformanceInForLoopScope": "true", + "ForcedIncludeFiles": "file1;file2;file3", + "ForcedUsingFiles": "file1;file2;file3", + "GeneratePreprocessedFile": "1", + "GenerateXMLDocumentationFiles": "true", + "IgnoreStandardIncludePath": "true", + "InlineFunctionExpansion": "2", + "KeepComments": "true", + "MinimalRebuild": "true", + "ObjectFile": "a_file_name", + "OmitDefaultLibName": "true", + "OmitFramePointers": "true", + "OpenMP": "true", + "Optimization": "3", + "PrecompiledHeaderFile": "a_file_name", + "PrecompiledHeaderThrough": "a_file_name", + "PreprocessorDefinitions": "d1;d2;d3", + "ProgramDataBaseFileName": "a_file_name", + "RuntimeLibrary": "0", + "RuntimeTypeInfo": "true", + "ShowIncludes": "true", + "SmallerTypeCheck": "true", + "StringPooling": "true", + "StructMemberAlignment": "1", + "SuppressStartupBanner": "true", + "TreatWChar_tAsBuiltInType": "true", + "UndefineAllPreprocessorDefinitions": "true", + "UndefinePreprocessorDefinitions": "d1;d2;d3", + "UseFullPaths": "true", + "UsePrecompiledHeader": "1", + "UseUnicodeResponseFiles": "true", + "WarnAsError": "true", + "WarningLevel": "2", + "WholeProgramOptimization": "true", + "XMLDocumentationFileName": "a_file_name", + }, + "VCLinkerTool": { + "AdditionalDependencies": "file1;file2;file3", + "AdditionalLibraryDirectories": "folder1;folder2;folder3", + "AdditionalLibraryDirectories_excluded": "folder1;folder2;folder3", + "AdditionalManifestDependencies": "file1;file2;file3", + "AdditionalOptions": "a_string", + "AddModuleNamesToAssembly": "file1;file2;file3", + "AllowIsolation": "true", + "AssemblyDebug": "0", + "AssemblyLinkResource": "file1;file2;file3", + "BaseAddress": "a_string", + "CLRImageType": "1", + "CLRThreadAttribute": "2", + "CLRUnmanagedCodeCheck": "true", + "DataExecutionPrevention": "0", + "DelayLoadDLLs": "file1;file2;file3", + "DelaySign": "true", + "Driver": "1", + "EmbedManagedResourceFile": "file1;file2;file3", + "EnableCOMDATFolding": "0", + "EnableUAC": "true", + "EntryPointSymbol": "a_string", + "ErrorReporting": "0", + "FixedBaseAddress": "1", + "ForceSymbolReferences": "file1;file2;file3", + "FunctionOrder": "a_file_name", + "GenerateDebugInformation": "true", + "GenerateManifest": "true", + "GenerateMapFile": "true", + "HeapCommitSize": "a_string", + "HeapReserveSize": "a_string", + "IgnoreAllDefaultLibraries": "true", + "IgnoreDefaultLibraryNames": "file1;file2;file3", + "IgnoreEmbeddedIDL": "true", + "IgnoreImportLibrary": "true", + "ImportLibrary": "a_file_name", + "KeyContainer": "a_file_name", + "KeyFile": "a_file_name", + "LargeAddressAware": "2", + "LinkIncremental": "1", + "LinkLibraryDependencies": "true", + "LinkTimeCodeGeneration": "2", + "ManifestFile": "a_file_name", + "MapExports": "true", + "MapFileName": "a_file_name", + "MergedIDLBaseFileName": "a_file_name", + "MergeSections": "a_string", + "MidlCommandFile": "a_file_name", + "ModuleDefinitionFile": "a_file_name", + "OptimizeForWindows98": "1", + "OptimizeReferences": "0", + "OutputFile": "a_file_name", + "PerUserRedirection": "true", + "Profile": "true", + "ProfileGuidedDatabase": "a_file_name", + "ProgramDatabaseFile": "a_file_name", + "RandomizedBaseAddress": "1", + "RegisterOutput": "true", + "ResourceOnlyDLL": "true", + "SetChecksum": "true", + "ShowProgress": "0", + "StackCommitSize": "a_string", + "StackReserveSize": "a_string", + "StripPrivateSymbols": "a_file_name", + "SubSystem": "2", + "SupportUnloadOfDelayLoadedDLL": "true", + "SuppressStartupBanner": "true", + "SwapRunFromCD": "true", + "SwapRunFromNet": "true", + "TargetMachine": "3", + "TerminalServerAware": "2", + "TurnOffAssemblyGeneration": "true", + "TypeLibraryFile": "a_file_name", + "TypeLibraryResourceID": "33", + "UACExecutionLevel": "1", + "UACUIAccess": "true", + "UseLibraryDependencyInputs": "false", + "UseUnicodeResponseFiles": "true", + "Version": "a_string", + }, + "VCResourceCompilerTool": { + "AdditionalIncludeDirectories": "folder1;folder2;folder3", + "AdditionalOptions": "a_string", + "Culture": "1003", + "IgnoreStandardIncludePath": "true", + "PreprocessorDefinitions": "d1;d2;d3", + "ResourceOutputFileName": "a_string", + "ShowProgress": "true", + "SuppressStartupBanner": "true", + "UndefinePreprocessorDefinitions": "d1;d2;d3", + }, + "VCMIDLTool": { + "AdditionalIncludeDirectories": "folder1;folder2;folder3", + "AdditionalOptions": "a_string", + "CPreprocessOptions": "a_string", + "DefaultCharType": "0", + "DLLDataFileName": "a_file_name", + "EnableErrorChecks": "2", + "ErrorCheckAllocations": "true", + "ErrorCheckBounds": "true", + "ErrorCheckEnumRange": "true", + "ErrorCheckRefPointers": "true", + "ErrorCheckStubData": "true", + "GenerateStublessProxies": "true", + "GenerateTypeLibrary": "true", + "HeaderFileName": "a_file_name", + "IgnoreStandardIncludePath": "true", + "InterfaceIdentifierFileName": "a_file_name", + "MkTypLibCompatible": "true", + "OutputDirectory": "a_string", + "PreprocessorDefinitions": "d1;d2;d3", + "ProxyFileName": "a_file_name", + "RedirectOutputAndErrors": "a_file_name", + "StructMemberAlignment": "3", + "SuppressStartupBanner": "true", + "TargetEnvironment": "1", + "TypeLibraryName": "a_file_name", + "UndefinePreprocessorDefinitions": "d1;d2;d3", + "ValidateParameters": "true", + "WarnAsError": "true", + "WarningLevel": "4", + }, + "VCLibrarianTool": { + "AdditionalDependencies": "file1;file2;file3", + "AdditionalLibraryDirectories": "folder1;folder2;folder3", + "AdditionalLibraryDirectories_excluded": "folder1;folder2;folder3", + "AdditionalOptions": "a_string", + "ExportNamedFunctions": "d1;d2;d3", + "ForceSymbolReferences": "a_string", + "IgnoreAllDefaultLibraries": "true", + "IgnoreSpecificDefaultLibraries": "file1;file2;file3", + "LinkLibraryDependencies": "true", + "ModuleDefinitionFile": "a_file_name", + "OutputFile": "a_file_name", + "SuppressStartupBanner": "true", + "UseUnicodeResponseFiles": "true", + }, + "VCManifestTool": { + "AdditionalManifestFiles": "file1;file2;file3", + "AdditionalOptions": "a_string", + "AssemblyIdentity": "a_string", + "ComponentFileName": "a_file_name", + "DependencyInformationFile": "a_file_name", + "EmbedManifest": "true", + "GenerateCatalogFiles": "true", + "InputResourceManifests": "a_string", + "ManifestResourceFile": "my_name", + "OutputManifestFile": "a_file_name", + "RegistrarScriptFile": "a_file_name", + "ReplacementsFile": "a_file_name", + "SuppressStartupBanner": "true", + "TypeLibraryFile": "a_file_name", + "UpdateFileHashes": "true", + "UpdateFileHashesSearchPath": "a_file_name", + "UseFAT32Workaround": "true", + "UseUnicodeResponseFiles": "true", + "VerboseOutput": "true", + }, + } + expected_msbuild_settings = { + "ClCompile": { + "AdditionalIncludeDirectories": "folder1;folder2;folder3", + "AdditionalOptions": "a_string /J", + "AdditionalUsingDirectories": "folder1;folder2;folder3", + "AssemblerListingLocation": "a_file_name", + "AssemblerOutput": "NoListing", + "BasicRuntimeChecks": "StackFrameRuntimeCheck", + "BrowseInformation": "true", + "BrowseInformationFile": "a_file_name", + "BufferSecurityCheck": "true", + "CallingConvention": "Cdecl", + "CompileAs": "CompileAsC", + "DebugInformationFormat": "EditAndContinue", + "DisableLanguageExtensions": "true", + "DisableSpecificWarnings": "d1;d2;d3", + "EnableEnhancedInstructionSet": "NotSet", + "EnableFiberSafeOptimizations": "true", + "EnablePREfast": "true", + "ErrorReporting": "Prompt", + "ExceptionHandling": "Async", + "ExpandAttributedSource": "true", + "FavorSizeOrSpeed": "Neither", + "FloatingPointExceptions": "true", + "FloatingPointModel": "Strict", + "ForceConformanceInForLoopScope": "true", + "ForcedIncludeFiles": "file1;file2;file3", + "ForcedUsingFiles": "file1;file2;file3", + "FunctionLevelLinking": "true", + "GenerateXMLDocumentationFiles": "true", + "IgnoreStandardIncludePath": "true", + "InlineFunctionExpansion": "AnySuitable", + "IntrinsicFunctions": "true", + "MinimalRebuild": "true", + "ObjectFileName": "a_file_name", + "OmitDefaultLibName": "true", + "OmitFramePointers": "true", + "OpenMPSupport": "true", + "Optimization": "Full", + "PrecompiledHeader": "Create", + "PrecompiledHeaderFile": "a_file_name", + "PrecompiledHeaderOutputFile": "a_file_name", + "PreprocessKeepComments": "true", + "PreprocessorDefinitions": "d1;d2;d3", + "PreprocessSuppressLineNumbers": "false", + "PreprocessToFile": "true", + "ProgramDataBaseFileName": "a_file_name", + "RuntimeLibrary": "MultiThreaded", + "RuntimeTypeInfo": "true", + "ShowIncludes": "true", + "SmallerTypeCheck": "true", + "StringPooling": "true", + "StructMemberAlignment": "1Byte", + "SuppressStartupBanner": "true", + "TreatWarningAsError": "true", + "TreatWChar_tAsBuiltInType": "true", + "UndefineAllPreprocessorDefinitions": "true", + "UndefinePreprocessorDefinitions": "d1;d2;d3", + "UseFullPaths": "true", + "WarningLevel": "Level2", + "WholeProgramOptimization": "true", + "XMLDocumentationFileName": "a_file_name", + }, + "Link": { + "AdditionalDependencies": "file1;file2;file3", + "AdditionalLibraryDirectories": "folder1;folder2;folder3", + "AdditionalManifestDependencies": "file1;file2;file3", + "AdditionalOptions": "a_string", + "AddModuleNamesToAssembly": "file1;file2;file3", + "AllowIsolation": "true", + "AssemblyDebug": "", + "AssemblyLinkResource": "file1;file2;file3", + "BaseAddress": "a_string", + "CLRImageType": "ForceIJWImage", + "CLRThreadAttribute": "STAThreadingAttribute", + "CLRUnmanagedCodeCheck": "true", + "DataExecutionPrevention": "", + "DelayLoadDLLs": "file1;file2;file3", + "DelaySign": "true", + "Driver": "Driver", + "EmbedManagedResourceFile": "file1;file2;file3", + "EnableCOMDATFolding": "", + "EnableUAC": "true", + "EntryPointSymbol": "a_string", + "FixedBaseAddress": "false", + "ForceSymbolReferences": "file1;file2;file3", + "FunctionOrder": "a_file_name", + "GenerateDebugInformation": "true", + "GenerateMapFile": "true", + "HeapCommitSize": "a_string", + "HeapReserveSize": "a_string", + "IgnoreAllDefaultLibraries": "true", + "IgnoreEmbeddedIDL": "true", + "IgnoreSpecificDefaultLibraries": "file1;file2;file3", + "ImportLibrary": "a_file_name", + "KeyContainer": "a_file_name", + "KeyFile": "a_file_name", + "LargeAddressAware": "true", + "LinkErrorReporting": "NoErrorReport", + "LinkTimeCodeGeneration": "PGInstrument", + "ManifestFile": "a_file_name", + "MapExports": "true", + "MapFileName": "a_file_name", + "MergedIDLBaseFileName": "a_file_name", + "MergeSections": "a_string", + "MidlCommandFile": "a_file_name", + "ModuleDefinitionFile": "a_file_name", + "NoEntryPoint": "true", + "OptimizeReferences": "", + "OutputFile": "a_file_name", + "PerUserRedirection": "true", + "Profile": "true", + "ProfileGuidedDatabase": "a_file_name", + "ProgramDatabaseFile": "a_file_name", + "RandomizedBaseAddress": "false", + "RegisterOutput": "true", + "SetChecksum": "true", + "ShowProgress": "NotSet", + "StackCommitSize": "a_string", + "StackReserveSize": "a_string", + "StripPrivateSymbols": "a_file_name", + "SubSystem": "Windows", + "SupportUnloadOfDelayLoadedDLL": "true", + "SuppressStartupBanner": "true", + "SwapRunFromCD": "true", + "SwapRunFromNET": "true", + "TargetMachine": "MachineARM", + "TerminalServerAware": "true", + "TurnOffAssemblyGeneration": "true", + "TypeLibraryFile": "a_file_name", + "TypeLibraryResourceID": "33", + "UACExecutionLevel": "HighestAvailable", + "UACUIAccess": "true", + "Version": "a_string", + }, + "ResourceCompile": { + "AdditionalIncludeDirectories": "folder1;folder2;folder3", + "AdditionalOptions": "a_string", + "Culture": "0x03eb", + "IgnoreStandardIncludePath": "true", + "PreprocessorDefinitions": "d1;d2;d3", + "ResourceOutputFileName": "a_string", + "ShowProgress": "true", + "SuppressStartupBanner": "true", + "UndefinePreprocessorDefinitions": "d1;d2;d3", + }, + "Midl": { + "AdditionalIncludeDirectories": "folder1;folder2;folder3", + "AdditionalOptions": "a_string", + "CPreprocessOptions": "a_string", + "DefaultCharType": "Unsigned", + "DllDataFileName": "a_file_name", + "EnableErrorChecks": "All", + "ErrorCheckAllocations": "true", + "ErrorCheckBounds": "true", + "ErrorCheckEnumRange": "true", + "ErrorCheckRefPointers": "true", + "ErrorCheckStubData": "true", + "GenerateStublessProxies": "true", + "GenerateTypeLibrary": "true", + "HeaderFileName": "a_file_name", + "IgnoreStandardIncludePath": "true", + "InterfaceIdentifierFileName": "a_file_name", + "MkTypLibCompatible": "true", + "OutputDirectory": "a_string", + "PreprocessorDefinitions": "d1;d2;d3", + "ProxyFileName": "a_file_name", + "RedirectOutputAndErrors": "a_file_name", + "StructMemberAlignment": "4", + "SuppressStartupBanner": "true", + "TargetEnvironment": "Win32", + "TypeLibraryName": "a_file_name", + "UndefinePreprocessorDefinitions": "d1;d2;d3", + "ValidateAllParameters": "true", + "WarnAsError": "true", + "WarningLevel": "4", + }, + "Lib": { + "AdditionalDependencies": "file1;file2;file3", + "AdditionalLibraryDirectories": "folder1;folder2;folder3", + "AdditionalOptions": "a_string", + "ExportNamedFunctions": "d1;d2;d3", + "ForceSymbolReferences": "a_string", + "IgnoreAllDefaultLibraries": "true", + "IgnoreSpecificDefaultLibraries": "file1;file2;file3", + "ModuleDefinitionFile": "a_file_name", + "OutputFile": "a_file_name", + "SuppressStartupBanner": "true", + "UseUnicodeResponseFiles": "true", + }, + "Manifest": { + "AdditionalManifestFiles": "file1;file2;file3", + "AdditionalOptions": "a_string", + "AssemblyIdentity": "a_string", + "ComponentFileName": "a_file_name", + "GenerateCatalogFiles": "true", + "InputResourceManifests": "a_string", + "OutputManifestFile": "a_file_name", + "RegistrarScriptFile": "a_file_name", + "ReplacementsFile": "a_file_name", + "SuppressStartupBanner": "true", + "TypeLibraryFile": "a_file_name", + "UpdateFileHashes": "true", + "UpdateFileHashesSearchPath": "a_file_name", + "VerboseOutput": "true", + }, + "ManifestResourceCompile": {"ResourceOutputFileName": "my_name"}, + "ProjectReference": { + "LinkLibraryDependencies": "true", + "UseLibraryDependencyInputs": "false", + }, + "": { + "EmbedManifest": "true", + "GenerateManifest": "true", + "IgnoreImportLibrary": "true", + "LinkIncremental": "false", + }, + } + self.maxDiff = 9999 # on failure display a long diff + actual_msbuild_settings = MSVSSettings.ConvertToMSBuildSettings( + msvs_settings, self.stderr + ) + self.assertEqual(expected_msbuild_settings, actual_msbuild_settings) + self._ExpectedWarnings([]) - def testConvertToMSBuildSettings_actual(self): - """Tests the conversion of an actual project. + def testConvertToMSBuildSettings_actual(self): + """Tests the conversion of an actual project. A VS2008 project with most of the options defined was created through the VS2008 IDE. It was then converted to VS2010. The tool settings found in @@ -1136,354 +1186,362 @@ def testConvertToMSBuildSettings_actual(self): AdditionalOptions: ' %(AdditionalOptions)', InputResourceManifests: ';%(InputResourceManifests)', """ - msvs_settings = { - 'VCCLCompilerTool': { - 'AdditionalIncludeDirectories': 'dir1', - 'AdditionalOptions': '/more', - 'AdditionalUsingDirectories': 'test', - 'AssemblerListingLocation': '$(IntDir)\\a', - 'AssemblerOutput': '1', - 'BasicRuntimeChecks': '3', - 'BrowseInformation': '1', - 'BrowseInformationFile': '$(IntDir)\\e', - 'BufferSecurityCheck': 'false', - 'CallingConvention': '1', - 'CompileAs': '1', - 'DebugInformationFormat': '4', - 'DefaultCharIsUnsigned': 'true', - 'Detect64BitPortabilityProblems': 'true', - 'DisableLanguageExtensions': 'true', - 'DisableSpecificWarnings': 'abc', - 'EnableEnhancedInstructionSet': '1', - 'EnableFiberSafeOptimizations': 'true', - 'EnableFunctionLevelLinking': 'true', - 'EnableIntrinsicFunctions': 'true', - 'EnablePREfast': 'true', - 'ErrorReporting': '2', - 'ExceptionHandling': '2', - 'ExpandAttributedSource': 'true', - 'FavorSizeOrSpeed': '2', - 'FloatingPointExceptions': 'true', - 'FloatingPointModel': '1', - 'ForceConformanceInForLoopScope': 'false', - 'ForcedIncludeFiles': 'def', - 'ForcedUsingFiles': 'ge', - 'GeneratePreprocessedFile': '2', - 'GenerateXMLDocumentationFiles': 'true', - 'IgnoreStandardIncludePath': 'true', - 'InlineFunctionExpansion': '1', - 'KeepComments': 'true', - 'MinimalRebuild': 'true', - 'ObjectFile': '$(IntDir)\\b', - 'OmitDefaultLibName': 'true', - 'OmitFramePointers': 'true', - 'OpenMP': 'true', - 'Optimization': '3', - 'PrecompiledHeaderFile': '$(IntDir)\\$(TargetName).pche', - 'PrecompiledHeaderThrough': 'StdAfx.hd', - 'PreprocessorDefinitions': 'WIN32;_DEBUG;_CONSOLE', - 'ProgramDataBaseFileName': '$(IntDir)\\vc90b.pdb', - 'RuntimeLibrary': '3', - 'RuntimeTypeInfo': 'false', - 'ShowIncludes': 'true', - 'SmallerTypeCheck': 'true', - 'StringPooling': 'true', - 'StructMemberAlignment': '3', - 'SuppressStartupBanner': 'false', - 'TreatWChar_tAsBuiltInType': 'false', - 'UndefineAllPreprocessorDefinitions': 'true', - 'UndefinePreprocessorDefinitions': 'wer', - 'UseFullPaths': 'true', - 'UsePrecompiledHeader': '0', - 'UseUnicodeResponseFiles': 'false', - 'WarnAsError': 'true', - 'WarningLevel': '3', - 'WholeProgramOptimization': 'true', - 'XMLDocumentationFileName': '$(IntDir)\\c'}, - 'VCLinkerTool': { - 'AdditionalDependencies': 'zx', - 'AdditionalLibraryDirectories': 'asd', - 'AdditionalManifestDependencies': 's2', - 'AdditionalOptions': '/mor2', - 'AddModuleNamesToAssembly': 'd1', - 'AllowIsolation': 'false', - 'AssemblyDebug': '1', - 'AssemblyLinkResource': 'd5', - 'BaseAddress': '23423', - 'CLRImageType': '3', - 'CLRThreadAttribute': '1', - 'CLRUnmanagedCodeCheck': 'true', - 'DataExecutionPrevention': '0', - 'DelayLoadDLLs': 'd4', - 'DelaySign': 'true', - 'Driver': '2', - 'EmbedManagedResourceFile': 'd2', - 'EnableCOMDATFolding': '1', - 'EnableUAC': 'false', - 'EntryPointSymbol': 'f5', - 'ErrorReporting': '2', - 'FixedBaseAddress': '1', - 'ForceSymbolReferences': 'd3', - 'FunctionOrder': 'fssdfsd', - 'GenerateDebugInformation': 'true', - 'GenerateManifest': 'false', - 'GenerateMapFile': 'true', - 'HeapCommitSize': '13', - 'HeapReserveSize': '12', - 'IgnoreAllDefaultLibraries': 'true', - 'IgnoreDefaultLibraryNames': 'flob;flok', - 'IgnoreEmbeddedIDL': 'true', - 'IgnoreImportLibrary': 'true', - 'ImportLibrary': 'f4', - 'KeyContainer': 'f7', - 'KeyFile': 'f6', - 'LargeAddressAware': '2', - 'LinkIncremental': '0', - 'LinkLibraryDependencies': 'false', - 'LinkTimeCodeGeneration': '1', - 'ManifestFile': - '$(IntDir)\\$(TargetFileName).2intermediate.manifest', - 'MapExports': 'true', - 'MapFileName': 'd5', - 'MergedIDLBaseFileName': 'f2', - 'MergeSections': 'f5', - 'MidlCommandFile': 'f1', - 'ModuleDefinitionFile': 'sdsd', - 'OptimizeForWindows98': '2', - 'OptimizeReferences': '2', - 'OutputFile': '$(OutDir)\\$(ProjectName)2.exe', - 'PerUserRedirection': 'true', - 'Profile': 'true', - 'ProfileGuidedDatabase': '$(TargetDir)$(TargetName).pgdd', - 'ProgramDatabaseFile': 'Flob.pdb', - 'RandomizedBaseAddress': '1', - 'RegisterOutput': 'true', - 'ResourceOnlyDLL': 'true', - 'SetChecksum': 'false', - 'ShowProgress': '1', - 'StackCommitSize': '15', - 'StackReserveSize': '14', - 'StripPrivateSymbols': 'd3', - 'SubSystem': '1', - 'SupportUnloadOfDelayLoadedDLL': 'true', - 'SuppressStartupBanner': 'false', - 'SwapRunFromCD': 'true', - 'SwapRunFromNet': 'true', - 'TargetMachine': '1', - 'TerminalServerAware': '1', - 'TurnOffAssemblyGeneration': 'true', - 'TypeLibraryFile': 'f3', - 'TypeLibraryResourceID': '12', - 'UACExecutionLevel': '2', - 'UACUIAccess': 'true', - 'UseLibraryDependencyInputs': 'true', - 'UseUnicodeResponseFiles': 'false', - 'Version': '333'}, - 'VCResourceCompilerTool': { - 'AdditionalIncludeDirectories': 'f3', - 'AdditionalOptions': '/more3', - 'Culture': '3084', - 'IgnoreStandardIncludePath': 'true', - 'PreprocessorDefinitions': '_UNICODE;UNICODE2', - 'ResourceOutputFileName': '$(IntDir)/$(InputName)3.res', - 'ShowProgress': 'true'}, - 'VCManifestTool': { - 'AdditionalManifestFiles': 'sfsdfsd', - 'AdditionalOptions': 'afdsdafsd', - 'AssemblyIdentity': 'sddfdsadfsa', - 'ComponentFileName': 'fsdfds', - 'DependencyInformationFile': '$(IntDir)\\mt.depdfd', - 'EmbedManifest': 'false', - 'GenerateCatalogFiles': 'true', - 'InputResourceManifests': 'asfsfdafs', - 'ManifestResourceFile': - '$(IntDir)\\$(TargetFileName).embed.manifest.resfdsf', - 'OutputManifestFile': '$(TargetPath).manifestdfs', - 'RegistrarScriptFile': 'sdfsfd', - 'ReplacementsFile': 'sdffsd', - 'SuppressStartupBanner': 'false', - 'TypeLibraryFile': 'sfsd', - 'UpdateFileHashes': 'true', - 'UpdateFileHashesSearchPath': 'sfsd', - 'UseFAT32Workaround': 'true', - 'UseUnicodeResponseFiles': 'false', - 'VerboseOutput': 'true'}} - expected_msbuild_settings = { - 'ClCompile': { - 'AdditionalIncludeDirectories': 'dir1', - 'AdditionalOptions': '/more /J', - 'AdditionalUsingDirectories': 'test', - 'AssemblerListingLocation': '$(IntDir)a', - 'AssemblerOutput': 'AssemblyCode', - 'BasicRuntimeChecks': 'EnableFastChecks', - 'BrowseInformation': 'true', - 'BrowseInformationFile': '$(IntDir)e', - 'BufferSecurityCheck': 'false', - 'CallingConvention': 'FastCall', - 'CompileAs': 'CompileAsC', - 'DebugInformationFormat': 'EditAndContinue', - 'DisableLanguageExtensions': 'true', - 'DisableSpecificWarnings': 'abc', - 'EnableEnhancedInstructionSet': 'StreamingSIMDExtensions', - 'EnableFiberSafeOptimizations': 'true', - 'EnablePREfast': 'true', - 'ErrorReporting': 'Queue', - 'ExceptionHandling': 'Async', - 'ExpandAttributedSource': 'true', - 'FavorSizeOrSpeed': 'Size', - 'FloatingPointExceptions': 'true', - 'FloatingPointModel': 'Strict', - 'ForceConformanceInForLoopScope': 'false', - 'ForcedIncludeFiles': 'def', - 'ForcedUsingFiles': 'ge', - 'FunctionLevelLinking': 'true', - 'GenerateXMLDocumentationFiles': 'true', - 'IgnoreStandardIncludePath': 'true', - 'InlineFunctionExpansion': 'OnlyExplicitInline', - 'IntrinsicFunctions': 'true', - 'MinimalRebuild': 'true', - 'ObjectFileName': '$(IntDir)b', - 'OmitDefaultLibName': 'true', - 'OmitFramePointers': 'true', - 'OpenMPSupport': 'true', - 'Optimization': 'Full', - 'PrecompiledHeader': 'NotUsing', # Actual conversion gives '' - 'PrecompiledHeaderFile': 'StdAfx.hd', - 'PrecompiledHeaderOutputFile': '$(IntDir)$(TargetName).pche', - 'PreprocessKeepComments': 'true', - 'PreprocessorDefinitions': 'WIN32;_DEBUG;_CONSOLE', - 'PreprocessSuppressLineNumbers': 'true', - 'PreprocessToFile': 'true', - 'ProgramDataBaseFileName': '$(IntDir)vc90b.pdb', - 'RuntimeLibrary': 'MultiThreadedDebugDLL', - 'RuntimeTypeInfo': 'false', - 'ShowIncludes': 'true', - 'SmallerTypeCheck': 'true', - 'StringPooling': 'true', - 'StructMemberAlignment': '4Bytes', - 'SuppressStartupBanner': 'false', - 'TreatWarningAsError': 'true', - 'TreatWChar_tAsBuiltInType': 'false', - 'UndefineAllPreprocessorDefinitions': 'true', - 'UndefinePreprocessorDefinitions': 'wer', - 'UseFullPaths': 'true', - 'WarningLevel': 'Level3', - 'WholeProgramOptimization': 'true', - 'XMLDocumentationFileName': '$(IntDir)c'}, - 'Link': { - 'AdditionalDependencies': 'zx', - 'AdditionalLibraryDirectories': 'asd', - 'AdditionalManifestDependencies': 's2', - 'AdditionalOptions': '/mor2', - 'AddModuleNamesToAssembly': 'd1', - 'AllowIsolation': 'false', - 'AssemblyDebug': 'true', - 'AssemblyLinkResource': 'd5', - 'BaseAddress': '23423', - 'CLRImageType': 'ForceSafeILImage', - 'CLRThreadAttribute': 'MTAThreadingAttribute', - 'CLRUnmanagedCodeCheck': 'true', - 'DataExecutionPrevention': '', - 'DelayLoadDLLs': 'd4', - 'DelaySign': 'true', - 'Driver': 'UpOnly', - 'EmbedManagedResourceFile': 'd2', - 'EnableCOMDATFolding': 'false', - 'EnableUAC': 'false', - 'EntryPointSymbol': 'f5', - 'FixedBaseAddress': 'false', - 'ForceSymbolReferences': 'd3', - 'FunctionOrder': 'fssdfsd', - 'GenerateDebugInformation': 'true', - 'GenerateMapFile': 'true', - 'HeapCommitSize': '13', - 'HeapReserveSize': '12', - 'IgnoreAllDefaultLibraries': 'true', - 'IgnoreEmbeddedIDL': 'true', - 'IgnoreSpecificDefaultLibraries': 'flob;flok', - 'ImportLibrary': 'f4', - 'KeyContainer': 'f7', - 'KeyFile': 'f6', - 'LargeAddressAware': 'true', - 'LinkErrorReporting': 'QueueForNextLogin', - 'LinkTimeCodeGeneration': 'UseLinkTimeCodeGeneration', - 'ManifestFile': '$(IntDir)$(TargetFileName).2intermediate.manifest', - 'MapExports': 'true', - 'MapFileName': 'd5', - 'MergedIDLBaseFileName': 'f2', - 'MergeSections': 'f5', - 'MidlCommandFile': 'f1', - 'ModuleDefinitionFile': 'sdsd', - 'NoEntryPoint': 'true', - 'OptimizeReferences': 'true', - 'OutputFile': '$(OutDir)$(ProjectName)2.exe', - 'PerUserRedirection': 'true', - 'Profile': 'true', - 'ProfileGuidedDatabase': '$(TargetDir)$(TargetName).pgdd', - 'ProgramDatabaseFile': 'Flob.pdb', - 'RandomizedBaseAddress': 'false', - 'RegisterOutput': 'true', - 'SetChecksum': 'false', - 'ShowProgress': 'LinkVerbose', - 'StackCommitSize': '15', - 'StackReserveSize': '14', - 'StripPrivateSymbols': 'd3', - 'SubSystem': 'Console', - 'SupportUnloadOfDelayLoadedDLL': 'true', - 'SuppressStartupBanner': 'false', - 'SwapRunFromCD': 'true', - 'SwapRunFromNET': 'true', - 'TargetMachine': 'MachineX86', - 'TerminalServerAware': 'false', - 'TurnOffAssemblyGeneration': 'true', - 'TypeLibraryFile': 'f3', - 'TypeLibraryResourceID': '12', - 'UACExecutionLevel': 'RequireAdministrator', - 'UACUIAccess': 'true', - 'Version': '333'}, - 'ResourceCompile': { - 'AdditionalIncludeDirectories': 'f3', - 'AdditionalOptions': '/more3', - 'Culture': '0x0c0c', - 'IgnoreStandardIncludePath': 'true', - 'PreprocessorDefinitions': '_UNICODE;UNICODE2', - 'ResourceOutputFileName': '$(IntDir)%(Filename)3.res', - 'ShowProgress': 'true'}, - 'Manifest': { - 'AdditionalManifestFiles': 'sfsdfsd', - 'AdditionalOptions': 'afdsdafsd', - 'AssemblyIdentity': 'sddfdsadfsa', - 'ComponentFileName': 'fsdfds', - 'GenerateCatalogFiles': 'true', - 'InputResourceManifests': 'asfsfdafs', - 'OutputManifestFile': '$(TargetPath).manifestdfs', - 'RegistrarScriptFile': 'sdfsfd', - 'ReplacementsFile': 'sdffsd', - 'SuppressStartupBanner': 'false', - 'TypeLibraryFile': 'sfsd', - 'UpdateFileHashes': 'true', - 'UpdateFileHashesSearchPath': 'sfsd', - 'VerboseOutput': 'true'}, - 'ProjectReference': { - 'LinkLibraryDependencies': 'false', - 'UseLibraryDependencyInputs': 'true'}, - '': { - 'EmbedManifest': 'false', - 'GenerateManifest': 'false', - 'IgnoreImportLibrary': 'true', - 'LinkIncremental': '' + msvs_settings = { + "VCCLCompilerTool": { + "AdditionalIncludeDirectories": "dir1", + "AdditionalOptions": "/more", + "AdditionalUsingDirectories": "test", + "AssemblerListingLocation": "$(IntDir)\\a", + "AssemblerOutput": "1", + "BasicRuntimeChecks": "3", + "BrowseInformation": "1", + "BrowseInformationFile": "$(IntDir)\\e", + "BufferSecurityCheck": "false", + "CallingConvention": "1", + "CompileAs": "1", + "DebugInformationFormat": "4", + "DefaultCharIsUnsigned": "true", + "Detect64BitPortabilityProblems": "true", + "DisableLanguageExtensions": "true", + "DisableSpecificWarnings": "abc", + "EnableEnhancedInstructionSet": "1", + "EnableFiberSafeOptimizations": "true", + "EnableFunctionLevelLinking": "true", + "EnableIntrinsicFunctions": "true", + "EnablePREfast": "true", + "ErrorReporting": "2", + "ExceptionHandling": "2", + "ExpandAttributedSource": "true", + "FavorSizeOrSpeed": "2", + "FloatingPointExceptions": "true", + "FloatingPointModel": "1", + "ForceConformanceInForLoopScope": "false", + "ForcedIncludeFiles": "def", + "ForcedUsingFiles": "ge", + "GeneratePreprocessedFile": "2", + "GenerateXMLDocumentationFiles": "true", + "IgnoreStandardIncludePath": "true", + "InlineFunctionExpansion": "1", + "KeepComments": "true", + "MinimalRebuild": "true", + "ObjectFile": "$(IntDir)\\b", + "OmitDefaultLibName": "true", + "OmitFramePointers": "true", + "OpenMP": "true", + "Optimization": "3", + "PrecompiledHeaderFile": "$(IntDir)\\$(TargetName).pche", + "PrecompiledHeaderThrough": "StdAfx.hd", + "PreprocessorDefinitions": "WIN32;_DEBUG;_CONSOLE", + "ProgramDataBaseFileName": "$(IntDir)\\vc90b.pdb", + "RuntimeLibrary": "3", + "RuntimeTypeInfo": "false", + "ShowIncludes": "true", + "SmallerTypeCheck": "true", + "StringPooling": "true", + "StructMemberAlignment": "3", + "SuppressStartupBanner": "false", + "TreatWChar_tAsBuiltInType": "false", + "UndefineAllPreprocessorDefinitions": "true", + "UndefinePreprocessorDefinitions": "wer", + "UseFullPaths": "true", + "UsePrecompiledHeader": "0", + "UseUnicodeResponseFiles": "false", + "WarnAsError": "true", + "WarningLevel": "3", + "WholeProgramOptimization": "true", + "XMLDocumentationFileName": "$(IntDir)\\c", + }, + "VCLinkerTool": { + "AdditionalDependencies": "zx", + "AdditionalLibraryDirectories": "asd", + "AdditionalManifestDependencies": "s2", + "AdditionalOptions": "/mor2", + "AddModuleNamesToAssembly": "d1", + "AllowIsolation": "false", + "AssemblyDebug": "1", + "AssemblyLinkResource": "d5", + "BaseAddress": "23423", + "CLRImageType": "3", + "CLRThreadAttribute": "1", + "CLRUnmanagedCodeCheck": "true", + "DataExecutionPrevention": "0", + "DelayLoadDLLs": "d4", + "DelaySign": "true", + "Driver": "2", + "EmbedManagedResourceFile": "d2", + "EnableCOMDATFolding": "1", + "EnableUAC": "false", + "EntryPointSymbol": "f5", + "ErrorReporting": "2", + "FixedBaseAddress": "1", + "ForceSymbolReferences": "d3", + "FunctionOrder": "fssdfsd", + "GenerateDebugInformation": "true", + "GenerateManifest": "false", + "GenerateMapFile": "true", + "HeapCommitSize": "13", + "HeapReserveSize": "12", + "IgnoreAllDefaultLibraries": "true", + "IgnoreDefaultLibraryNames": "flob;flok", + "IgnoreEmbeddedIDL": "true", + "IgnoreImportLibrary": "true", + "ImportLibrary": "f4", + "KeyContainer": "f7", + "KeyFile": "f6", + "LargeAddressAware": "2", + "LinkIncremental": "0", + "LinkLibraryDependencies": "false", + "LinkTimeCodeGeneration": "1", + "ManifestFile": "$(IntDir)\\$(TargetFileName).2intermediate.manifest", + "MapExports": "true", + "MapFileName": "d5", + "MergedIDLBaseFileName": "f2", + "MergeSections": "f5", + "MidlCommandFile": "f1", + "ModuleDefinitionFile": "sdsd", + "OptimizeForWindows98": "2", + "OptimizeReferences": "2", + "OutputFile": "$(OutDir)\\$(ProjectName)2.exe", + "PerUserRedirection": "true", + "Profile": "true", + "ProfileGuidedDatabase": "$(TargetDir)$(TargetName).pgdd", + "ProgramDatabaseFile": "Flob.pdb", + "RandomizedBaseAddress": "1", + "RegisterOutput": "true", + "ResourceOnlyDLL": "true", + "SetChecksum": "false", + "ShowProgress": "1", + "StackCommitSize": "15", + "StackReserveSize": "14", + "StripPrivateSymbols": "d3", + "SubSystem": "1", + "SupportUnloadOfDelayLoadedDLL": "true", + "SuppressStartupBanner": "false", + "SwapRunFromCD": "true", + "SwapRunFromNet": "true", + "TargetMachine": "1", + "TerminalServerAware": "1", + "TurnOffAssemblyGeneration": "true", + "TypeLibraryFile": "f3", + "TypeLibraryResourceID": "12", + "UACExecutionLevel": "2", + "UACUIAccess": "true", + "UseLibraryDependencyInputs": "true", + "UseUnicodeResponseFiles": "false", + "Version": "333", + }, + "VCResourceCompilerTool": { + "AdditionalIncludeDirectories": "f3", + "AdditionalOptions": "/more3", + "Culture": "3084", + "IgnoreStandardIncludePath": "true", + "PreprocessorDefinitions": "_UNICODE;UNICODE2", + "ResourceOutputFileName": "$(IntDir)/$(InputName)3.res", + "ShowProgress": "true", + }, + "VCManifestTool": { + "AdditionalManifestFiles": "sfsdfsd", + "AdditionalOptions": "afdsdafsd", + "AssemblyIdentity": "sddfdsadfsa", + "ComponentFileName": "fsdfds", + "DependencyInformationFile": "$(IntDir)\\mt.depdfd", + "EmbedManifest": "false", + "GenerateCatalogFiles": "true", + "InputResourceManifests": "asfsfdafs", + "ManifestResourceFile": "$(IntDir)\\$(TargetFileName).embed.manifest.resfdsf", + "OutputManifestFile": "$(TargetPath).manifestdfs", + "RegistrarScriptFile": "sdfsfd", + "ReplacementsFile": "sdffsd", + "SuppressStartupBanner": "false", + "TypeLibraryFile": "sfsd", + "UpdateFileHashes": "true", + "UpdateFileHashesSearchPath": "sfsd", + "UseFAT32Workaround": "true", + "UseUnicodeResponseFiles": "false", + "VerboseOutput": "true", + }, + } + expected_msbuild_settings = { + "ClCompile": { + "AdditionalIncludeDirectories": "dir1", + "AdditionalOptions": "/more /J", + "AdditionalUsingDirectories": "test", + "AssemblerListingLocation": "$(IntDir)a", + "AssemblerOutput": "AssemblyCode", + "BasicRuntimeChecks": "EnableFastChecks", + "BrowseInformation": "true", + "BrowseInformationFile": "$(IntDir)e", + "BufferSecurityCheck": "false", + "CallingConvention": "FastCall", + "CompileAs": "CompileAsC", + "DebugInformationFormat": "EditAndContinue", + "DisableLanguageExtensions": "true", + "DisableSpecificWarnings": "abc", + "EnableEnhancedInstructionSet": "StreamingSIMDExtensions", + "EnableFiberSafeOptimizations": "true", + "EnablePREfast": "true", + "ErrorReporting": "Queue", + "ExceptionHandling": "Async", + "ExpandAttributedSource": "true", + "FavorSizeOrSpeed": "Size", + "FloatingPointExceptions": "true", + "FloatingPointModel": "Strict", + "ForceConformanceInForLoopScope": "false", + "ForcedIncludeFiles": "def", + "ForcedUsingFiles": "ge", + "FunctionLevelLinking": "true", + "GenerateXMLDocumentationFiles": "true", + "IgnoreStandardIncludePath": "true", + "InlineFunctionExpansion": "OnlyExplicitInline", + "IntrinsicFunctions": "true", + "MinimalRebuild": "true", + "ObjectFileName": "$(IntDir)b", + "OmitDefaultLibName": "true", + "OmitFramePointers": "true", + "OpenMPSupport": "true", + "Optimization": "Full", + "PrecompiledHeader": "NotUsing", # Actual conversion gives '' + "PrecompiledHeaderFile": "StdAfx.hd", + "PrecompiledHeaderOutputFile": "$(IntDir)$(TargetName).pche", + "PreprocessKeepComments": "true", + "PreprocessorDefinitions": "WIN32;_DEBUG;_CONSOLE", + "PreprocessSuppressLineNumbers": "true", + "PreprocessToFile": "true", + "ProgramDataBaseFileName": "$(IntDir)vc90b.pdb", + "RuntimeLibrary": "MultiThreadedDebugDLL", + "RuntimeTypeInfo": "false", + "ShowIncludes": "true", + "SmallerTypeCheck": "true", + "StringPooling": "true", + "StructMemberAlignment": "4Bytes", + "SuppressStartupBanner": "false", + "TreatWarningAsError": "true", + "TreatWChar_tAsBuiltInType": "false", + "UndefineAllPreprocessorDefinitions": "true", + "UndefinePreprocessorDefinitions": "wer", + "UseFullPaths": "true", + "WarningLevel": "Level3", + "WholeProgramOptimization": "true", + "XMLDocumentationFileName": "$(IntDir)c", + }, + "Link": { + "AdditionalDependencies": "zx", + "AdditionalLibraryDirectories": "asd", + "AdditionalManifestDependencies": "s2", + "AdditionalOptions": "/mor2", + "AddModuleNamesToAssembly": "d1", + "AllowIsolation": "false", + "AssemblyDebug": "true", + "AssemblyLinkResource": "d5", + "BaseAddress": "23423", + "CLRImageType": "ForceSafeILImage", + "CLRThreadAttribute": "MTAThreadingAttribute", + "CLRUnmanagedCodeCheck": "true", + "DataExecutionPrevention": "", + "DelayLoadDLLs": "d4", + "DelaySign": "true", + "Driver": "UpOnly", + "EmbedManagedResourceFile": "d2", + "EnableCOMDATFolding": "false", + "EnableUAC": "false", + "EntryPointSymbol": "f5", + "FixedBaseAddress": "false", + "ForceSymbolReferences": "d3", + "FunctionOrder": "fssdfsd", + "GenerateDebugInformation": "true", + "GenerateMapFile": "true", + "HeapCommitSize": "13", + "HeapReserveSize": "12", + "IgnoreAllDefaultLibraries": "true", + "IgnoreEmbeddedIDL": "true", + "IgnoreSpecificDefaultLibraries": "flob;flok", + "ImportLibrary": "f4", + "KeyContainer": "f7", + "KeyFile": "f6", + "LargeAddressAware": "true", + "LinkErrorReporting": "QueueForNextLogin", + "LinkTimeCodeGeneration": "UseLinkTimeCodeGeneration", + "ManifestFile": "$(IntDir)$(TargetFileName).2intermediate.manifest", + "MapExports": "true", + "MapFileName": "d5", + "MergedIDLBaseFileName": "f2", + "MergeSections": "f5", + "MidlCommandFile": "f1", + "ModuleDefinitionFile": "sdsd", + "NoEntryPoint": "true", + "OptimizeReferences": "true", + "OutputFile": "$(OutDir)$(ProjectName)2.exe", + "PerUserRedirection": "true", + "Profile": "true", + "ProfileGuidedDatabase": "$(TargetDir)$(TargetName).pgdd", + "ProgramDatabaseFile": "Flob.pdb", + "RandomizedBaseAddress": "false", + "RegisterOutput": "true", + "SetChecksum": "false", + "ShowProgress": "LinkVerbose", + "StackCommitSize": "15", + "StackReserveSize": "14", + "StripPrivateSymbols": "d3", + "SubSystem": "Console", + "SupportUnloadOfDelayLoadedDLL": "true", + "SuppressStartupBanner": "false", + "SwapRunFromCD": "true", + "SwapRunFromNET": "true", + "TargetMachine": "MachineX86", + "TerminalServerAware": "false", + "TurnOffAssemblyGeneration": "true", + "TypeLibraryFile": "f3", + "TypeLibraryResourceID": "12", + "UACExecutionLevel": "RequireAdministrator", + "UACUIAccess": "true", + "Version": "333", + }, + "ResourceCompile": { + "AdditionalIncludeDirectories": "f3", + "AdditionalOptions": "/more3", + "Culture": "0x0c0c", + "IgnoreStandardIncludePath": "true", + "PreprocessorDefinitions": "_UNICODE;UNICODE2", + "ResourceOutputFileName": "$(IntDir)%(Filename)3.res", + "ShowProgress": "true", + }, + "Manifest": { + "AdditionalManifestFiles": "sfsdfsd", + "AdditionalOptions": "afdsdafsd", + "AssemblyIdentity": "sddfdsadfsa", + "ComponentFileName": "fsdfds", + "GenerateCatalogFiles": "true", + "InputResourceManifests": "asfsfdafs", + "OutputManifestFile": "$(TargetPath).manifestdfs", + "RegistrarScriptFile": "sdfsfd", + "ReplacementsFile": "sdffsd", + "SuppressStartupBanner": "false", + "TypeLibraryFile": "sfsd", + "UpdateFileHashes": "true", + "UpdateFileHashesSearchPath": "sfsd", + "VerboseOutput": "true", + }, + "ProjectReference": { + "LinkLibraryDependencies": "false", + "UseLibraryDependencyInputs": "true", + }, + "": { + "EmbedManifest": "false", + "GenerateManifest": "false", + "IgnoreImportLibrary": "true", + "LinkIncremental": "", + }, + "ManifestResourceCompile": { + "ResourceOutputFileName": "$(IntDir)$(TargetFileName).embed.manifest.resfdsf" }, - 'ManifestResourceCompile': { - 'ResourceOutputFileName': - '$(IntDir)$(TargetFileName).embed.manifest.resfdsf'} } - self.maxDiff = 9999 # on failure display a long diff - actual_msbuild_settings = MSVSSettings.ConvertToMSBuildSettings( - msvs_settings, - self.stderr) - self.assertEqual(expected_msbuild_settings, actual_msbuild_settings) - self._ExpectedWarnings([]) + self.maxDiff = 9999 # on failure display a long diff + actual_msbuild_settings = MSVSSettings.ConvertToMSBuildSettings( + msvs_settings, self.stderr + ) + self.assertEqual(expected_msbuild_settings, actual_msbuild_settings) + self._ExpectedWarnings([]) -if __name__ == '__main__': - unittest.main() +if __name__ == "__main__": + unittest.main() diff --git a/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/MSVSToolFile.py b/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/MSVSToolFile.py index 74e529a17f1dca..2c08589e06dc6d 100644 --- a/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/MSVSToolFile.py +++ b/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/MSVSToolFile.py @@ -4,28 +4,27 @@ """Visual Studio project reader/writer.""" -import gyp.common import gyp.easy_xml as easy_xml class Writer(object): - """Visual Studio XML tool file writer.""" + """Visual Studio XML tool file writer.""" - def __init__(self, tool_file_path, name): - """Initializes the tool file. + def __init__(self, tool_file_path, name): + """Initializes the tool file. Args: tool_file_path: Path to the tool file. name: Name of the tool file. """ - self.tool_file_path = tool_file_path - self.name = name - self.rules_section = ['Rules'] + self.tool_file_path = tool_file_path + self.name = name + self.rules_section = ["Rules"] - def AddCustomBuildRule(self, name, cmd, description, - additional_dependencies, - outputs, extensions): - """Adds a rule to the tool file. + def AddCustomBuildRule( + self, name, cmd, description, additional_dependencies, outputs, extensions + ): + """Adds a rule to the tool file. Args: name: Name of the rule. @@ -35,24 +34,26 @@ def AddCustomBuildRule(self, name, cmd, description, outputs: outputs of the rule. extensions: extensions handled by the rule. """ - rule = ['CustomBuildRule', - {'Name': name, - 'ExecutionDescription': description, - 'CommandLine': cmd, - 'Outputs': ';'.join(outputs), - 'FileExtensions': ';'.join(extensions), - 'AdditionalDependencies': - ';'.join(additional_dependencies) - }] - self.rules_section.append(rule) - - def WriteIfChanged(self): - """Writes the tool file.""" - content = ['VisualStudioToolFile', - {'Version': '8.00', - 'Name': self.name - }, - self.rules_section - ] - easy_xml.WriteXmlIfChanged(content, self.tool_file_path, - encoding="Windows-1252") + rule = [ + "CustomBuildRule", + { + "Name": name, + "ExecutionDescription": description, + "CommandLine": cmd, + "Outputs": ";".join(outputs), + "FileExtensions": ";".join(extensions), + "AdditionalDependencies": ";".join(additional_dependencies), + }, + ] + self.rules_section.append(rule) + + def WriteIfChanged(self): + """Writes the tool file.""" + content = [ + "VisualStudioToolFile", + {"Version": "8.00", "Name": self.name}, + self.rules_section, + ] + easy_xml.WriteXmlIfChanged( + content, self.tool_file_path, encoding="Windows-1252" + ) diff --git a/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/MSVSUserFile.py b/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/MSVSUserFile.py index 2264d640152a29..de0896e6931816 100644 --- a/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/MSVSUserFile.py +++ b/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/MSVSUserFile.py @@ -6,78 +6,81 @@ import os import re -import socket # for gethostname +import socket # for gethostname -import gyp.common import gyp.easy_xml as easy_xml -#------------------------------------------------------------------------------ +# ------------------------------------------------------------------------------ + def _FindCommandInPath(command): - """If there are no slashes in the command given, this function + """If there are no slashes in the command given, this function searches the PATH env to find the given command, and converts it to an absolute path. We have to do this because MSVS is looking for an actual file to launch a debugger on, not just a command line. Note that this happens at GYP time, so anything needing to be built needs to have a full path.""" - if '/' in command or '\\' in command: - # If the command already has path elements (either relative or - # absolute), then assume it is constructed properly. + if "/" in command or "\\" in command: + # If the command already has path elements (either relative or + # absolute), then assume it is constructed properly. + return command + else: + # Search through the path list and find an existing file that + # we can access. + paths = os.environ.get("PATH", "").split(os.pathsep) + for path in paths: + item = os.path.join(path, command) + if os.path.isfile(item) and os.access(item, os.X_OK): + return item return command - else: - # Search through the path list and find an existing file that - # we can access. - paths = os.environ.get('PATH','').split(os.pathsep) - for path in paths: - item = os.path.join(path, command) - if os.path.isfile(item) and os.access(item, os.X_OK): - return item - return command + def _QuoteWin32CommandLineArgs(args): - new_args = [] - for arg in args: - # Replace all double-quotes with double-double-quotes to escape - # them for cmd shell, and then quote the whole thing if there - # are any. - if arg.find('"') != -1: - arg = '""'.join(arg.split('"')) - arg = '"%s"' % arg - - # Otherwise, if there are any spaces, quote the whole arg. - elif re.search(r'[ \t\n]', arg): - arg = '"%s"' % arg - new_args.append(arg) - return new_args + new_args = [] + for arg in args: + # Replace all double-quotes with double-double-quotes to escape + # them for cmd shell, and then quote the whole thing if there + # are any. + if arg.find('"') != -1: + arg = '""'.join(arg.split('"')) + arg = '"%s"' % arg + + # Otherwise, if there are any spaces, quote the whole arg. + elif re.search(r"[ \t\n]", arg): + arg = '"%s"' % arg + new_args.append(arg) + return new_args + class Writer(object): - """Visual Studio XML user user file writer.""" + """Visual Studio XML user user file writer.""" - def __init__(self, user_file_path, version, name): - """Initializes the user file. + def __init__(self, user_file_path, version, name): + """Initializes the user file. Args: user_file_path: Path to the user file. version: Version info. name: Name of the user file. """ - self.user_file_path = user_file_path - self.version = version - self.name = name - self.configurations = {} + self.user_file_path = user_file_path + self.version = version + self.name = name + self.configurations = {} - def AddConfig(self, name): - """Adds a configuration to the project. + def AddConfig(self, name): + """Adds a configuration to the project. Args: name: Configuration name. """ - self.configurations[name] = ['Configuration', {'Name': name}] + self.configurations[name] = ["Configuration", {"Name": name}] - def AddDebugSettings(self, config_name, command, environment = {}, - working_directory=""): - """Adds a DebugSettings node to the user file for a particular config. + def AddDebugSettings( + self, config_name, command, environment={}, working_directory="" + ): + """Adds a DebugSettings node to the user file for a particular config. Args: command: command line to run. First element in the list is the @@ -85,63 +88,66 @@ def AddDebugSettings(self, config_name, command, environment = {}, necessary. working_directory: other files which may trigger the rule. (optional) """ - command = _QuoteWin32CommandLineArgs(command) - - abs_command = _FindCommandInPath(command[0]) - - if environment and isinstance(environment, dict): - env_list = ['%s="%s"' % (key, val) - for (key,val) in environment.items()] - environment = ' '.join(env_list) - else: - environment = '' - - n_cmd = ['DebugSettings', - {'Command': abs_command, - 'WorkingDirectory': working_directory, - 'CommandArguments': " ".join(command[1:]), - 'RemoteMachine': socket.gethostname(), - 'Environment': environment, - 'EnvironmentMerge': 'true', - # Currently these are all "dummy" values that we're just setting - # in the default manner that MSVS does it. We could use some of - # these to add additional capabilities, I suppose, but they might - # not have parity with other platforms then. - 'Attach': 'false', - 'DebuggerType': '3', # 'auto' debugger - 'Remote': '1', - 'RemoteCommand': '', - 'HttpUrl': '', - 'PDBPath': '', - 'SQLDebugging': '', - 'DebuggerFlavor': '0', - 'MPIRunCommand': '', - 'MPIRunArguments': '', - 'MPIRunWorkingDirectory': '', - 'ApplicationCommand': '', - 'ApplicationArguments': '', - 'ShimCommand': '', - 'MPIAcceptMode': '', - 'MPIAcceptFilter': '' - }] - - # Find the config, and add it if it doesn't exist. - if config_name not in self.configurations: - self.AddConfig(config_name) - - # Add the DebugSettings onto the appropriate config. - self.configurations[config_name].append(n_cmd) - - def WriteIfChanged(self): - """Writes the user file.""" - configs = ['Configurations'] - for config, spec in sorted(self.configurations.items()): - configs.append(spec) - - content = ['VisualStudioUserFile', - {'Version': self.version.ProjectVersion(), - 'Name': self.name - }, - configs] - easy_xml.WriteXmlIfChanged(content, self.user_file_path, - encoding="Windows-1252") + command = _QuoteWin32CommandLineArgs(command) + + abs_command = _FindCommandInPath(command[0]) + + if environment and isinstance(environment, dict): + env_list = ['%s="%s"' % (key, val) for (key, val) in environment.items()] + environment = " ".join(env_list) + else: + environment = "" + + n_cmd = [ + "DebugSettings", + { + "Command": abs_command, + "WorkingDirectory": working_directory, + "CommandArguments": " ".join(command[1:]), + "RemoteMachine": socket.gethostname(), + "Environment": environment, + "EnvironmentMerge": "true", + # Currently these are all "dummy" values that we're just setting + # in the default manner that MSVS does it. We could use some of + # these to add additional capabilities, I suppose, but they might + # not have parity with other platforms then. + "Attach": "false", + "DebuggerType": "3", # 'auto' debugger + "Remote": "1", + "RemoteCommand": "", + "HttpUrl": "", + "PDBPath": "", + "SQLDebugging": "", + "DebuggerFlavor": "0", + "MPIRunCommand": "", + "MPIRunArguments": "", + "MPIRunWorkingDirectory": "", + "ApplicationCommand": "", + "ApplicationArguments": "", + "ShimCommand": "", + "MPIAcceptMode": "", + "MPIAcceptFilter": "", + }, + ] + + # Find the config, and add it if it doesn't exist. + if config_name not in self.configurations: + self.AddConfig(config_name) + + # Add the DebugSettings onto the appropriate config. + self.configurations[config_name].append(n_cmd) + + def WriteIfChanged(self): + """Writes the user file.""" + configs = ["Configurations"] + for config, spec in sorted(self.configurations.items()): + configs.append(spec) + + content = [ + "VisualStudioUserFile", + {"Version": self.version.ProjectVersion(), "Name": self.name}, + configs, + ] + easy_xml.WriteXmlIfChanged( + content, self.user_file_path, encoding="Windows-1252" + ) diff --git a/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/MSVSUtil.py b/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/MSVSUtil.py index c8187eb3314471..83a9c297ed6e14 100644 --- a/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/MSVSUtil.py +++ b/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/MSVSUtil.py @@ -10,24 +10,25 @@ # A dictionary mapping supported target types to extensions. TARGET_TYPE_EXT = { - 'executable': 'exe', - 'loadable_module': 'dll', - 'shared_library': 'dll', - 'static_library': 'lib', + "executable": "exe", + "loadable_module": "dll", + "shared_library": "dll", + "static_library": "lib", + "windows_driver": "sys", } def _GetLargePdbShimCcPath(): - """Returns the path of the large_pdb_shim.cc file.""" - this_dir = os.path.abspath(os.path.dirname(__file__)) - src_dir = os.path.abspath(os.path.join(this_dir, '..', '..')) - win_data_dir = os.path.join(src_dir, 'data', 'win') - large_pdb_shim_cc = os.path.join(win_data_dir, 'large-pdb-shim.cc') - return large_pdb_shim_cc + """Returns the path of the large_pdb_shim.cc file.""" + this_dir = os.path.abspath(os.path.dirname(__file__)) + src_dir = os.path.abspath(os.path.join(this_dir, "..", "..")) + win_data_dir = os.path.join(src_dir, "data", "win") + large_pdb_shim_cc = os.path.join(win_data_dir, "large-pdb-shim.cc") + return large_pdb_shim_cc def _DeepCopySomeKeys(in_dict, keys): - """Performs a partial deep-copy on |in_dict|, only copying the keys in |keys|. + """Performs a partial deep-copy on |in_dict|, only copying the keys in |keys|. Arguments: in_dict: The dictionary to copy. @@ -36,16 +37,16 @@ def _DeepCopySomeKeys(in_dict, keys): Returns: The partially deep-copied dictionary. """ - d = {} - for key in keys: - if key not in in_dict: - continue - d[key] = copy.deepcopy(in_dict[key]) - return d + d = {} + for key in keys: + if key not in in_dict: + continue + d[key] = copy.deepcopy(in_dict[key]) + return d def _SuffixName(name, suffix): - """Add a suffix to the end of a target. + """Add a suffix to the end of a target. Arguments: name: name of the target (foo#target) @@ -53,13 +54,13 @@ def _SuffixName(name, suffix): Returns: Target name with suffix added (foo_suffix#target) """ - parts = name.rsplit('#', 1) - parts[0] = '%s_%s' % (parts[0], suffix) - return '#'.join(parts) + parts = name.rsplit("#", 1) + parts[0] = "%s_%s" % (parts[0], suffix) + return "#".join(parts) def _ShardName(name, number): - """Add a shard number to the end of a target. + """Add a shard number to the end of a target. Arguments: name: name of the target (foo#target) @@ -67,11 +68,11 @@ def _ShardName(name, number): Returns: Target name with shard added (foo_1#target) """ - return _SuffixName(name, str(number)) + return _SuffixName(name, str(number)) def ShardTargets(target_list, target_dicts): - """Shard some targets apart to work around the linkers limits. + """Shard some targets apart to work around the linkers limits. Arguments: target_list: List of target pairs: 'base/base.gyp:base'. @@ -79,54 +80,55 @@ def ShardTargets(target_list, target_dicts): Returns: Tuple of the new sharded versions of the inputs. """ - # Gather the targets to shard, and how many pieces. - targets_to_shard = {} - for t in target_dicts: - shards = int(target_dicts[t].get('msvs_shard', 0)) - if shards: - targets_to_shard[t] = shards - # Shard target_list. - new_target_list = [] - for t in target_list: - if t in targets_to_shard: - for i in range(targets_to_shard[t]): - new_target_list.append(_ShardName(t, i)) - else: - new_target_list.append(t) - # Shard target_dict. - new_target_dicts = {} - for t in target_dicts: - if t in targets_to_shard: - for i in range(targets_to_shard[t]): - name = _ShardName(t, i) - new_target_dicts[name] = copy.copy(target_dicts[t]) - new_target_dicts[name]['target_name'] = _ShardName( - new_target_dicts[name]['target_name'], i) - sources = new_target_dicts[name].get('sources', []) - new_sources = [] - for pos in range(i, len(sources), targets_to_shard[t]): - new_sources.append(sources[pos]) - new_target_dicts[name]['sources'] = new_sources - else: - new_target_dicts[t] = target_dicts[t] - # Shard dependencies. - for t in new_target_dicts: - for deptype in ('dependencies', 'dependencies_original'): - dependencies = copy.copy(new_target_dicts[t].get(deptype, [])) - new_dependencies = [] - for d in dependencies: - if d in targets_to_shard: - for i in range(targets_to_shard[d]): - new_dependencies.append(_ShardName(d, i)) + # Gather the targets to shard, and how many pieces. + targets_to_shard = {} + for t in target_dicts: + shards = int(target_dicts[t].get("msvs_shard", 0)) + if shards: + targets_to_shard[t] = shards + # Shard target_list. + new_target_list = [] + for t in target_list: + if t in targets_to_shard: + for i in range(targets_to_shard[t]): + new_target_list.append(_ShardName(t, i)) else: - new_dependencies.append(d) - new_target_dicts[t][deptype] = new_dependencies - - return (new_target_list, new_target_dicts) + new_target_list.append(t) + # Shard target_dict. + new_target_dicts = {} + for t in target_dicts: + if t in targets_to_shard: + for i in range(targets_to_shard[t]): + name = _ShardName(t, i) + new_target_dicts[name] = copy.copy(target_dicts[t]) + new_target_dicts[name]["target_name"] = _ShardName( + new_target_dicts[name]["target_name"], i + ) + sources = new_target_dicts[name].get("sources", []) + new_sources = [] + for pos in range(i, len(sources), targets_to_shard[t]): + new_sources.append(sources[pos]) + new_target_dicts[name]["sources"] = new_sources + else: + new_target_dicts[t] = target_dicts[t] + # Shard dependencies. + for t in sorted(new_target_dicts): + for deptype in ("dependencies", "dependencies_original"): + dependencies = copy.copy(new_target_dicts[t].get(deptype, [])) + new_dependencies = [] + for d in dependencies: + if d in targets_to_shard: + for i in range(targets_to_shard[d]): + new_dependencies.append(_ShardName(d, i)) + else: + new_dependencies.append(d) + new_target_dicts[t][deptype] = new_dependencies + + return (new_target_list, new_target_dicts) def _GetPdbPath(target_dict, config_name, vars): - """Returns the path to the PDB file that will be generated by a given + """Returns the path to the PDB file that will be generated by a given configuration. The lookup proceeds as follows: @@ -143,30 +145,29 @@ def _GetPdbPath(target_dict, config_name, vars): Returns: The path of the corresponding PDB file. """ - config = target_dict['configurations'][config_name] - msvs = config.setdefault('msvs_settings', {}) - - linker = msvs.get('VCLinkerTool', {}) + config = target_dict["configurations"][config_name] + msvs = config.setdefault("msvs_settings", {}) - pdb_path = linker.get('ProgramDatabaseFile') - if pdb_path: - return pdb_path + linker = msvs.get("VCLinkerTool", {}) - variables = target_dict.get('variables', {}) - pdb_path = variables.get('msvs_large_pdb_path', None) - if pdb_path: - return pdb_path + pdb_path = linker.get("ProgramDatabaseFile") + if pdb_path: + return pdb_path + variables = target_dict.get("variables", {}) + pdb_path = variables.get("msvs_large_pdb_path", None) + if pdb_path: + return pdb_path - pdb_base = target_dict.get('product_name', target_dict['target_name']) - pdb_base = '%s.%s.pdb' % (pdb_base, TARGET_TYPE_EXT[target_dict['type']]) - pdb_path = vars['PRODUCT_DIR'] + '/' + pdb_base + pdb_base = target_dict.get("product_name", target_dict["target_name"]) + pdb_base = "%s.%s.pdb" % (pdb_base, TARGET_TYPE_EXT[target_dict["type"]]) + pdb_path = vars["PRODUCT_DIR"] + "/" + pdb_base - return pdb_path + return pdb_path def InsertLargePdbShims(target_list, target_dicts, vars): - """Insert a shim target that forces the linker to use 4KB pagesize PDBs. + """Insert a shim target that forces the linker to use 4KB pagesize PDBs. This is a workaround for targets with PDBs greater than 1GB in size, the limit for the 1KB pagesize PDBs created by the linker by default. @@ -178,93 +179,93 @@ def InsertLargePdbShims(target_list, target_dicts, vars): Returns: Tuple of the shimmed version of the inputs. """ - # Determine which targets need shimming. - targets_to_shim = [] - for t in target_dicts: - target_dict = target_dicts[t] - - # We only want to shim targets that have msvs_large_pdb enabled. - if not int(target_dict.get('msvs_large_pdb', 0)): - continue - # This is intended for executable, shared_library and loadable_module - # targets where every configuration is set up to produce a PDB output. - # If any of these conditions is not true then the shim logic will fail - # below. - targets_to_shim.append(t) - - large_pdb_shim_cc = _GetLargePdbShimCcPath() - - for t in targets_to_shim: - target_dict = target_dicts[t] - target_name = target_dict.get('target_name') - - base_dict = _DeepCopySomeKeys(target_dict, - ['configurations', 'default_configuration', 'toolset']) - - # This is the dict for copying the source file (part of the GYP tree) - # to the intermediate directory of the project. This is necessary because - # we can't always build a relative path to the shim source file (on Windows - # GYP and the project may be on different drives), and Ninja hates absolute - # paths (it ends up generating the .obj and .obj.d alongside the source - # file, polluting GYPs tree). - copy_suffix = 'large_pdb_copy' - copy_target_name = target_name + '_' + copy_suffix - full_copy_target_name = _SuffixName(t, copy_suffix) - shim_cc_basename = os.path.basename(large_pdb_shim_cc) - shim_cc_dir = vars['SHARED_INTERMEDIATE_DIR'] + '/' + copy_target_name - shim_cc_path = shim_cc_dir + '/' + shim_cc_basename - copy_dict = copy.deepcopy(base_dict) - copy_dict['target_name'] = copy_target_name - copy_dict['type'] = 'none' - copy_dict['sources'] = [ large_pdb_shim_cc ] - copy_dict['copies'] = [{ - 'destination': shim_cc_dir, - 'files': [ large_pdb_shim_cc ] - }] - - # This is the dict for the PDB generating shim target. It depends on the - # copy target. - shim_suffix = 'large_pdb_shim' - shim_target_name = target_name + '_' + shim_suffix - full_shim_target_name = _SuffixName(t, shim_suffix) - shim_dict = copy.deepcopy(base_dict) - shim_dict['target_name'] = shim_target_name - shim_dict['type'] = 'static_library' - shim_dict['sources'] = [ shim_cc_path ] - shim_dict['dependencies'] = [ full_copy_target_name ] - - # Set up the shim to output its PDB to the same location as the final linker - # target. - for config_name, config in shim_dict.get('configurations').items(): - pdb_path = _GetPdbPath(target_dict, config_name, vars) - - # A few keys that we don't want to propagate. - for key in ['msvs_precompiled_header', 'msvs_precompiled_source', 'test']: - config.pop(key, None) - - msvs = config.setdefault('msvs_settings', {}) - - # Update the compiler directives in the shim target. - compiler = msvs.setdefault('VCCLCompilerTool', {}) - compiler['DebugInformationFormat'] = '3' - compiler['ProgramDataBaseFileName'] = pdb_path - - # Set the explicit PDB path in the appropriate configuration of the - # original target. - config = target_dict['configurations'][config_name] - msvs = config.setdefault('msvs_settings', {}) - linker = msvs.setdefault('VCLinkerTool', {}) - linker['GenerateDebugInformation'] = 'true' - linker['ProgramDatabaseFile'] = pdb_path - - # Add the new targets. They must go to the beginning of the list so that - # the dependency generation works as expected in ninja. - target_list.insert(0, full_copy_target_name) - target_list.insert(0, full_shim_target_name) - target_dicts[full_copy_target_name] = copy_dict - target_dicts[full_shim_target_name] = shim_dict - - # Update the original target to depend on the shim target. - target_dict.setdefault('dependencies', []).append(full_shim_target_name) - - return (target_list, target_dicts) + # Determine which targets need shimming. + targets_to_shim = [] + for t in target_dicts: + target_dict = target_dicts[t] + + # We only want to shim targets that have msvs_large_pdb enabled. + if not int(target_dict.get("msvs_large_pdb", 0)): + continue + # This is intended for executable, shared_library and loadable_module + # targets where every configuration is set up to produce a PDB output. + # If any of these conditions is not true then the shim logic will fail + # below. + targets_to_shim.append(t) + + large_pdb_shim_cc = _GetLargePdbShimCcPath() + + for t in targets_to_shim: + target_dict = target_dicts[t] + target_name = target_dict.get("target_name") + + base_dict = _DeepCopySomeKeys( + target_dict, ["configurations", "default_configuration", "toolset"] + ) + + # This is the dict for copying the source file (part of the GYP tree) + # to the intermediate directory of the project. This is necessary because + # we can't always build a relative path to the shim source file (on Windows + # GYP and the project may be on different drives), and Ninja hates absolute + # paths (it ends up generating the .obj and .obj.d alongside the source + # file, polluting GYPs tree). + copy_suffix = "large_pdb_copy" + copy_target_name = target_name + "_" + copy_suffix + full_copy_target_name = _SuffixName(t, copy_suffix) + shim_cc_basename = os.path.basename(large_pdb_shim_cc) + shim_cc_dir = vars["SHARED_INTERMEDIATE_DIR"] + "/" + copy_target_name + shim_cc_path = shim_cc_dir + "/" + shim_cc_basename + copy_dict = copy.deepcopy(base_dict) + copy_dict["target_name"] = copy_target_name + copy_dict["type"] = "none" + copy_dict["sources"] = [large_pdb_shim_cc] + copy_dict["copies"] = [ + {"destination": shim_cc_dir, "files": [large_pdb_shim_cc]} + ] + + # This is the dict for the PDB generating shim target. It depends on the + # copy target. + shim_suffix = "large_pdb_shim" + shim_target_name = target_name + "_" + shim_suffix + full_shim_target_name = _SuffixName(t, shim_suffix) + shim_dict = copy.deepcopy(base_dict) + shim_dict["target_name"] = shim_target_name + shim_dict["type"] = "static_library" + shim_dict["sources"] = [shim_cc_path] + shim_dict["dependencies"] = [full_copy_target_name] + + # Set up the shim to output its PDB to the same location as the final linker + # target. + for config_name, config in shim_dict.get("configurations").items(): + pdb_path = _GetPdbPath(target_dict, config_name, vars) + + # A few keys that we don't want to propagate. + for key in ["msvs_precompiled_header", "msvs_precompiled_source", "test"]: + config.pop(key, None) + + msvs = config.setdefault("msvs_settings", {}) + + # Update the compiler directives in the shim target. + compiler = msvs.setdefault("VCCLCompilerTool", {}) + compiler["DebugInformationFormat"] = "3" + compiler["ProgramDataBaseFileName"] = pdb_path + + # Set the explicit PDB path in the appropriate configuration of the + # original target. + config = target_dict["configurations"][config_name] + msvs = config.setdefault("msvs_settings", {}) + linker = msvs.setdefault("VCLinkerTool", {}) + linker["GenerateDebugInformation"] = "true" + linker["ProgramDatabaseFile"] = pdb_path + + # Add the new targets. They must go to the beginning of the list so that + # the dependency generation works as expected in ninja. + target_list.insert(0, full_copy_target_name) + target_list.insert(0, full_shim_target_name) + target_dicts[full_copy_target_name] = copy_dict + target_dicts[full_shim_target_name] = shim_dict + + # Update the original target to depend on the shim target. + target_dict.setdefault("dependencies", []).append(full_shim_target_name) + + return (target_list, target_dicts) diff --git a/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/MSVSVersion.py b/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/MSVSVersion.py index c7cf68d3a1ba90..36b006aaa93759 100644 --- a/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/MSVSVersion.py +++ b/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/MSVSVersion.py @@ -9,108 +9,152 @@ import re import subprocess import sys -import gyp import glob PY3 = bytes != str +def JoinPath(*args): + return os.path.normpath(os.path.join(*args)) + + class VisualStudioVersion(object): - """Information regarding a version of Visual Studio.""" - - def __init__(self, short_name, description, - solution_version, project_version, flat_sln, uses_vcxproj, - path, sdk_based, default_toolset=None): - self.short_name = short_name - self.description = description - self.solution_version = solution_version - self.project_version = project_version - self.flat_sln = flat_sln - self.uses_vcxproj = uses_vcxproj - self.path = path - self.sdk_based = sdk_based - self.default_toolset = default_toolset - - def ShortName(self): - return self.short_name - - def Description(self): - """Get the full description of the version.""" - return self.description - - def SolutionVersion(self): - """Get the version number of the sln files.""" - return self.solution_version - - def ProjectVersion(self): - """Get the version number of the vcproj or vcxproj files.""" - return self.project_version - - def FlatSolution(self): - return self.flat_sln - - def UsesVcxproj(self): - """Returns true if this version uses a vcxproj file.""" - return self.uses_vcxproj - - def ProjectExtension(self): - """Returns the file extension for the project.""" - return self.uses_vcxproj and '.vcxproj' or '.vcproj' - - def Path(self): - """Returns the path to Visual Studio installation.""" - return self.path - - def ToolPath(self, tool): - """Returns the path to a given compiler tool. """ - return os.path.normpath(os.path.join(self.path, "VC/bin", tool)) - - def DefaultToolset(self): - """Returns the msbuild toolset version that will be used in the absence + """Information regarding a version of Visual Studio.""" + + def __init__( + self, + short_name, + description, + solution_version, + project_version, + flat_sln, + uses_vcxproj, + path, + sdk_based, + default_toolset=None, + compatible_sdks=None, + ): + self.short_name = short_name + self.description = description + self.solution_version = solution_version + self.project_version = project_version + self.flat_sln = flat_sln + self.uses_vcxproj = uses_vcxproj + self.path = path + self.sdk_based = sdk_based + self.default_toolset = default_toolset + compatible_sdks = compatible_sdks or [] + compatible_sdks.sort(key=lambda v: float(v.replace("v", "")), reverse=True) + self.compatible_sdks = compatible_sdks + + def ShortName(self): + return self.short_name + + def Description(self): + """Get the full description of the version.""" + return self.description + + def SolutionVersion(self): + """Get the version number of the sln files.""" + return self.solution_version + + def ProjectVersion(self): + """Get the version number of the vcproj or vcxproj files.""" + return self.project_version + + def FlatSolution(self): + return self.flat_sln + + def UsesVcxproj(self): + """Returns true if this version uses a vcxproj file.""" + return self.uses_vcxproj + + def ProjectExtension(self): + """Returns the file extension for the project.""" + return self.uses_vcxproj and ".vcxproj" or ".vcproj" + + def Path(self): + """Returns the path to Visual Studio installation.""" + return self.path + + def ToolPath(self, tool): + """Returns the path to a given compiler tool. """ + return os.path.normpath(os.path.join(self.path, "VC/bin", tool)) + + def DefaultToolset(self): + """Returns the msbuild toolset version that will be used in the absence of a user override.""" - return self.default_toolset + return self.default_toolset - def SetupScript(self, target_arch): - """Returns a command (with arguments) to be used to set up the + def _SetupScriptInternal(self, target_arch): + """Returns a command (with arguments) to be used to set up the environment.""" - # Check if we are running in the SDK command line environment and use - # the setup script from the SDK if so. |target_arch| should be either - # 'x86' or 'x64'. - assert target_arch in ('x86', 'x64') - sdk_dir = os.environ.get('WindowsSDKDir') - if self.sdk_based and sdk_dir: - return [os.path.normpath(os.path.join(sdk_dir, 'Bin/SetEnv.Cmd')), - '/' + target_arch] - else: - # We don't use VC/vcvarsall.bat for x86 because vcvarsall calls - # vcvars32, which it can only find if VS??COMNTOOLS is set, which it - # isn't always. - if target_arch == 'x86': - if self.short_name >= '2013' and self.short_name[-1] != 'e' and ( - os.environ.get('PROCESSOR_ARCHITECTURE') == 'AMD64' or - os.environ.get('PROCESSOR_ARCHITEW6432') == 'AMD64'): - # VS2013 and later, non-Express have a x64-x86 cross that we want - # to prefer. - return [os.path.normpath( - os.path.join(self.path, 'VC/vcvarsall.bat')), 'amd64_x86'] - # Otherwise, the standard x86 compiler. - return [os.path.normpath( - os.path.join(self.path, 'Common7/Tools/vsvars32.bat'))] - else: - assert target_arch == 'x64' - arg = 'x86_amd64' - # Use the 64-on-64 compiler if we're not using an express - # edition and we're running on a 64bit OS. - if self.short_name[-1] != 'e' and ( - os.environ.get('PROCESSOR_ARCHITECTURE') == 'AMD64' or - os.environ.get('PROCESSOR_ARCHITEW6432') == 'AMD64'): - arg = 'amd64' - return [os.path.normpath( - os.path.join(self.path, 'VC/vcvarsall.bat')), arg] + assert target_arch in ("x86", "x64"), "target_arch not supported" + # If WindowsSDKDir is set and SetEnv.Cmd exists then we are using the + # depot_tools build tools and should run SetEnv.Cmd to set up the + # environment. The check for WindowsSDKDir alone is not sufficient because + # this is set by running vcvarsall.bat. + sdk_dir = os.environ.get("WindowsSDKDir", "") + setup_path = JoinPath(sdk_dir, "Bin", "SetEnv.Cmd") + if self.sdk_based and sdk_dir and os.path.exists(setup_path): + return [setup_path, "/" + target_arch] + + is_host_arch_x64 = ( + os.environ.get("PROCESSOR_ARCHITECTURE") == "AMD64" + or os.environ.get("PROCESSOR_ARCHITEW6432") == "AMD64" + ) + + # For VS2017 (and newer) it's fairly easy + if self.short_name >= "2017": + script_path = JoinPath( + self.path, "VC", "Auxiliary", "Build", "vcvarsall.bat" + ) + + # Always use a native executable, cross-compiling if necessary. + host_arch = "amd64" if is_host_arch_x64 else "x86" + msvc_target_arch = "amd64" if target_arch == "x64" else "x86" + arg = host_arch + if host_arch != msvc_target_arch: + arg += "_" + msvc_target_arch + + return [script_path, arg] + + # We try to find the best version of the env setup batch. + vcvarsall = JoinPath(self.path, "VC", "vcvarsall.bat") + if target_arch == "x86": + if ( + self.short_name >= "2013" + and self.short_name[-1] != "e" + and is_host_arch_x64 + ): + # VS2013 and later, non-Express have a x64-x86 cross that we want + # to prefer. + return [vcvarsall, "amd64_x86"] + else: + # Otherwise, the standard x86 compiler. We don't use VC/vcvarsall.bat + # for x86 because vcvarsall calls vcvars32, which it can only find if + # VS??COMNTOOLS is set, which isn't guaranteed. + return [JoinPath(self.path, "Common7", "Tools", "vsvars32.bat")] + elif target_arch == "x64": + arg = "x86_amd64" + # Use the 64-on-64 compiler if we're not using an express edition and + # we're running on a 64bit OS. + if self.short_name[-1] != "e" and is_host_arch_x64: + arg = "amd64" + return [vcvarsall, arg] + + def SetupScript(self, target_arch): + script_data = self._SetupScriptInternal(target_arch) + script_path = script_data[0] + if not os.path.exists(script_path): + raise Exception( + "%s is missing - make sure VC++ tools are installed." % script_path + ) + return script_data def _RegistryQueryBase(sysdir, key, value): - """Use reg.exe to read a particular key. + """Use reg.exe to read a particular key. While ideally we might use the win32 module, we would like gyp to be python neutral, so for instance cygwin python lacks this module. @@ -122,28 +166,27 @@ def _RegistryQueryBase(sysdir, key, value): Return: stdout from reg.exe, or None for failure. """ - # Skip if not on Windows or Python Win32 setup issue - if sys.platform not in ('win32', 'cygwin'): - return None - # Setup params to pass to and attempt to launch reg.exe - cmd = [os.path.join(os.environ.get('WINDIR', ''), sysdir, 'reg.exe'), - 'query', key] - if value: - cmd.extend(['/v', value]) - p = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE) - # Obtain the stdout from reg.exe, reading to the end so p.returncode is valid - # Note that the error text may be in [1] in some cases - text = p.communicate()[0] - if PY3: - text = text.decode('utf-8') - # Check return code from reg.exe; officially 0==success and 1==error - if p.returncode: - return None - return text + # Skip if not on Windows or Python Win32 setup issue + if sys.platform not in ("win32", "cygwin"): + return None + # Setup params to pass to and attempt to launch reg.exe + cmd = [os.path.join(os.environ.get("WINDIR", ""), sysdir, "reg.exe"), "query", key] + if value: + cmd.extend(["/v", value]) + p = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE) + # Obtain the stdout from reg.exe, reading to the end so p.returncode is valid + # Note that the error text may be in [1] in some cases + text = p.communicate()[0] + if PY3: + text = text.decode("utf-8") + # Check return code from reg.exe; officially 0==success and 1==error + if p.returncode: + return None + return text def _RegistryQuery(key, value=None): - r"""Use reg.exe to read a particular key through _RegistryQueryBase. + r"""Use reg.exe to read a particular key through _RegistryQueryBase. First tries to launch from %WinDir%\Sysnative to avoid WoW64 redirection. If that fails, it falls back to System32. Sysnative is available on Vista and @@ -159,19 +202,19 @@ def _RegistryQuery(key, value=None): Return: stdout from reg.exe, or None for failure. """ - text = None - try: - text = _RegistryQueryBase('Sysnative', key, value) - except OSError as e: - if e.errno == errno.ENOENT: - text = _RegistryQueryBase('System32', key, value) - else: - raise - return text + text = None + try: + text = _RegistryQueryBase("Sysnative", key, value) + except OSError as e: + if e.errno == errno.ENOENT: + text = _RegistryQueryBase("System32", key, value) + else: + raise + return text def _RegistryGetValueUsingWinReg(key, value): - """Use the _winreg module to obtain the value of a registry key. + """Use the _winreg module to obtain the value of a registry key. Args: key: The registry key. @@ -180,24 +223,24 @@ def _RegistryGetValueUsingWinReg(key, value): contents of the registry key's value, or None on failure. Throws ImportError if _winreg is unavailable. """ - try: - # Python 2 - from _winreg import HKEY_LOCAL_MACHINE, OpenKey, QueryValueEx - except ImportError: - # Python 3 - from winreg import HKEY_LOCAL_MACHINE, OpenKey, QueryValueEx - - try: - root, subkey = key.split('\\', 1) - assert root == 'HKLM' # Only need HKLM for now. - with OpenKey(HKEY_LOCAL_MACHINE, subkey) as hkey: - return QueryValueEx(hkey, value)[0] - except WindowsError: - return None + try: + # Python 2 + from _winreg import HKEY_LOCAL_MACHINE, OpenKey, QueryValueEx + except ImportError: + # Python 3 + from winreg import HKEY_LOCAL_MACHINE, OpenKey, QueryValueEx + + try: + root, subkey = key.split("\\", 1) + assert root == "HKLM" # Only need HKLM for now. + with OpenKey(HKEY_LOCAL_MACHINE, subkey) as hkey: + return QueryValueEx(hkey, value)[0] + except WindowsError: + return None def _RegistryGetValue(key, value): - """Use _winreg or reg.exe to obtain the value of a registry key. + """Use _winreg or reg.exe to obtain the value of a registry key. Using _winreg is preferable because it solves an issue on some corporate environments where access to reg.exe is locked down. However, we still need @@ -210,147 +253,192 @@ def _RegistryGetValue(key, value): Return: contents of the registry key's value, or None on failure. """ - try: - return _RegistryGetValueUsingWinReg(key, value) - except ImportError: - pass - - # Fallback to reg.exe if we fail to import _winreg. - text = _RegistryQuery(key, value) - if not text: - return None - # Extract value. - match = re.search(r'REG_\w+\s+([^\r]+)\r\n', text) - if not match: - return None - return match.group(1) + try: + return _RegistryGetValueUsingWinReg(key, value) + except ImportError: + pass + + # Fallback to reg.exe if we fail to import _winreg. + text = _RegistryQuery(key, value) + if not text: + return None + # Extract value. + match = re.search(r"REG_\w+\s+([^\r]+)\r\n", text) + if not match: + return None + return match.group(1) def _CreateVersion(name, path, sdk_based=False): - """Sets up MSVS project generation. + """Sets up MSVS project generation. Setup is based off the GYP_MSVS_VERSION environment variable or whatever is autodetected if GYP_MSVS_VERSION is not explicitly specified. If a version is passed in that doesn't match a value in versions python will throw a error. """ - if path: - path = os.path.normpath(path) - versions = { - '2015': VisualStudioVersion('2015', - 'Visual Studio 2015', - solution_version='12.00', - project_version='14.0', - flat_sln=False, - uses_vcxproj=True, - path=path, - sdk_based=sdk_based, - default_toolset='v140'), - '2013': VisualStudioVersion('2013', - 'Visual Studio 2013', - solution_version='13.00', - project_version='12.0', - flat_sln=False, - uses_vcxproj=True, - path=path, - sdk_based=sdk_based, - default_toolset='v120'), - '2013e': VisualStudioVersion('2013e', - 'Visual Studio 2013', - solution_version='13.00', - project_version='12.0', - flat_sln=True, - uses_vcxproj=True, - path=path, - sdk_based=sdk_based, - default_toolset='v120'), - '2012': VisualStudioVersion('2012', - 'Visual Studio 2012', - solution_version='12.00', - project_version='4.0', - flat_sln=False, - uses_vcxproj=True, - path=path, - sdk_based=sdk_based, - default_toolset='v110'), - '2012e': VisualStudioVersion('2012e', - 'Visual Studio 2012', - solution_version='12.00', - project_version='4.0', - flat_sln=True, - uses_vcxproj=True, - path=path, - sdk_based=sdk_based, - default_toolset='v110'), - '2010': VisualStudioVersion('2010', - 'Visual Studio 2010', - solution_version='11.00', - project_version='4.0', - flat_sln=False, - uses_vcxproj=True, - path=path, - sdk_based=sdk_based), - '2010e': VisualStudioVersion('2010e', - 'Visual C++ Express 2010', - solution_version='11.00', - project_version='4.0', - flat_sln=True, - uses_vcxproj=True, - path=path, - sdk_based=sdk_based), - '2008': VisualStudioVersion('2008', - 'Visual Studio 2008', - solution_version='10.00', - project_version='9.00', - flat_sln=False, - uses_vcxproj=False, - path=path, - sdk_based=sdk_based), - '2008e': VisualStudioVersion('2008e', - 'Visual Studio 2008', - solution_version='10.00', - project_version='9.00', - flat_sln=True, - uses_vcxproj=False, - path=path, - sdk_based=sdk_based), - '2005': VisualStudioVersion('2005', - 'Visual Studio 2005', - solution_version='9.00', - project_version='8.00', - flat_sln=False, - uses_vcxproj=False, - path=path, - sdk_based=sdk_based), - '2005e': VisualStudioVersion('2005e', - 'Visual Studio 2005', - solution_version='9.00', - project_version='8.00', - flat_sln=True, - uses_vcxproj=False, - path=path, - sdk_based=sdk_based), - } - return versions[str(name)] + if path: + path = os.path.normpath(path) + versions = { + "2019": VisualStudioVersion( + "2019", + "Visual Studio 2019", + solution_version="12.00", + project_version="16.0", + flat_sln=False, + uses_vcxproj=True, + path=path, + sdk_based=sdk_based, + default_toolset="v142", + compatible_sdks=["v8.1", "v10.0"], + ), + "2017": VisualStudioVersion( + "2017", + "Visual Studio 2017", + solution_version="12.00", + project_version="15.0", + flat_sln=False, + uses_vcxproj=True, + path=path, + sdk_based=sdk_based, + default_toolset="v141", + compatible_sdks=["v8.1", "v10.0"], + ), + "2015": VisualStudioVersion( + "2015", + "Visual Studio 2015", + solution_version="12.00", + project_version="14.0", + flat_sln=False, + uses_vcxproj=True, + path=path, + sdk_based=sdk_based, + default_toolset="v140", + ), + "2013": VisualStudioVersion( + "2013", + "Visual Studio 2013", + solution_version="13.00", + project_version="12.0", + flat_sln=False, + uses_vcxproj=True, + path=path, + sdk_based=sdk_based, + default_toolset="v120", + ), + "2013e": VisualStudioVersion( + "2013e", + "Visual Studio 2013", + solution_version="13.00", + project_version="12.0", + flat_sln=True, + uses_vcxproj=True, + path=path, + sdk_based=sdk_based, + default_toolset="v120", + ), + "2012": VisualStudioVersion( + "2012", + "Visual Studio 2012", + solution_version="12.00", + project_version="4.0", + flat_sln=False, + uses_vcxproj=True, + path=path, + sdk_based=sdk_based, + default_toolset="v110", + ), + "2012e": VisualStudioVersion( + "2012e", + "Visual Studio 2012", + solution_version="12.00", + project_version="4.0", + flat_sln=True, + uses_vcxproj=True, + path=path, + sdk_based=sdk_based, + default_toolset="v110", + ), + "2010": VisualStudioVersion( + "2010", + "Visual Studio 2010", + solution_version="11.00", + project_version="4.0", + flat_sln=False, + uses_vcxproj=True, + path=path, + sdk_based=sdk_based, + ), + "2010e": VisualStudioVersion( + "2010e", + "Visual C++ Express 2010", + solution_version="11.00", + project_version="4.0", + flat_sln=True, + uses_vcxproj=True, + path=path, + sdk_based=sdk_based, + ), + "2008": VisualStudioVersion( + "2008", + "Visual Studio 2008", + solution_version="10.00", + project_version="9.00", + flat_sln=False, + uses_vcxproj=False, + path=path, + sdk_based=sdk_based, + ), + "2008e": VisualStudioVersion( + "2008e", + "Visual Studio 2008", + solution_version="10.00", + project_version="9.00", + flat_sln=True, + uses_vcxproj=False, + path=path, + sdk_based=sdk_based, + ), + "2005": VisualStudioVersion( + "2005", + "Visual Studio 2005", + solution_version="9.00", + project_version="8.00", + flat_sln=False, + uses_vcxproj=False, + path=path, + sdk_based=sdk_based, + ), + "2005e": VisualStudioVersion( + "2005e", + "Visual Studio 2005", + solution_version="9.00", + project_version="8.00", + flat_sln=True, + uses_vcxproj=False, + path=path, + sdk_based=sdk_based, + ), + } + return versions[str(name)] def _ConvertToCygpath(path): - """Convert to cygwin path if we are using cygwin.""" - if sys.platform == 'cygwin': - p = subprocess.Popen(['cygpath', path], stdout=subprocess.PIPE) - path = p.communicate()[0].strip() - if PY3: - path = path.decode('utf-8') - return path + """Convert to cygwin path if we are using cygwin.""" + if sys.platform == "cygwin": + p = subprocess.Popen(["cygpath", path], stdout=subprocess.PIPE) + path = p.communicate()[0].strip() + if PY3: + path = path.decode("utf-8") + return path def _DetectVisualStudioVersions(versions_to_check, force_express): - """Collect the list of installed visual studio versions. + """Collect the list of installed visual studio versions. Returns: A list of visual studio versions installed in descending order of usage preference. Base this on the registry and a quick check if devenv.exe exists. - Only versions 8-10 are considered. Possibilities are: 2005(e) - Visual Studio 2005 (8) 2008(e) - Visual Studio 2008 (9) @@ -358,98 +446,126 @@ def _DetectVisualStudioVersions(versions_to_check, force_express): 2012(e) - Visual Studio 2012 (11) 2013(e) - Visual Studio 2013 (12) 2015 - Visual Studio 2015 (14) + 2017 - Visual Studio 2017 (15) + 2019 - Visual Studio 2019 (16) Where (e) is e for express editions of MSVS and blank otherwise. """ - version_to_year = { - '8.0': '2005', - '9.0': '2008', - '10.0': '2010', - '11.0': '2012', - '12.0': '2013', - '14.0': '2015', - } - versions = [] - for version in versions_to_check: - # Old method of searching for which VS version is installed - # We don't use the 2010-encouraged-way because we also want to get the - # path to the binaries, which it doesn't offer. - keys = [r'HKLM\Software\Microsoft\VisualStudio\%s' % version, - r'HKLM\Software\Wow6432Node\Microsoft\VisualStudio\%s' % version, - r'HKLM\Software\Microsoft\VCExpress\%s' % version, - r'HKLM\Software\Wow6432Node\Microsoft\VCExpress\%s' % version] - for index in range(len(keys)): - path = _RegistryGetValue(keys[index], 'InstallDir') - if not path: - continue - path = _ConvertToCygpath(path) - # Check for full. - full_path = os.path.join(path, 'devenv.exe') - express_path = os.path.join(path, '*express.exe') - if not force_express and os.path.exists(full_path): - # Add this one. - versions.append(_CreateVersion(version_to_year[version], - os.path.join(path, '..', '..'))) - # Check for express. - elif glob.glob(express_path): - # Add this one. - versions.append(_CreateVersion(version_to_year[version] + 'e', - os.path.join(path, '..', '..'))) - - # The old method above does not work when only SDK is installed. - keys = [r'HKLM\Software\Microsoft\VisualStudio\SxS\VC7', - r'HKLM\Software\Wow6432Node\Microsoft\VisualStudio\SxS\VC7'] - for index in range(len(keys)): - path = _RegistryGetValue(keys[index], version) - if not path: - continue - path = _ConvertToCygpath(path) - if version != '14.0': # There is no Express edition for 2015. - versions.append(_CreateVersion(version_to_year[version] + 'e', - os.path.join(path, '..'), sdk_based=True)) - - return versions - - -def SelectVisualStudioVersion(version='auto', allow_fallback=True): - """Select which version of Visual Studio projects to generate. + version_to_year = { + "8.0": "2005", + "9.0": "2008", + "10.0": "2010", + "11.0": "2012", + "12.0": "2013", + "14.0": "2015", + "15.0": "2017", + "16.0": "2019", + } + versions = [] + for version in versions_to_check: + # Old method of searching for which VS version is installed + # We don't use the 2010-encouraged-way because we also want to get the + # path to the binaries, which it doesn't offer. + keys = [ + r"HKLM\Software\Microsoft\VisualStudio\%s" % version, + r"HKLM\Software\Wow6432Node\Microsoft\VisualStudio\%s" % version, + r"HKLM\Software\Microsoft\VCExpress\%s" % version, + r"HKLM\Software\Wow6432Node\Microsoft\VCExpress\%s" % version, + ] + for index in range(len(keys)): + path = _RegistryGetValue(keys[index], "InstallDir") + if not path: + continue + path = _ConvertToCygpath(path) + # Check for full. + full_path = os.path.join(path, "devenv.exe") + express_path = os.path.join(path, "*express.exe") + if not force_express and os.path.exists(full_path): + # Add this one. + versions.append( + _CreateVersion( + version_to_year[version], os.path.join(path, "..", "..") + ) + ) + # Check for express. + elif glob.glob(express_path): + # Add this one. + versions.append( + _CreateVersion( + version_to_year[version] + "e", os.path.join(path, "..", "..") + ) + ) + + # The old method above does not work when only SDK is installed. + keys = [ + r"HKLM\Software\Microsoft\VisualStudio\SxS\VC7", + r"HKLM\Software\Wow6432Node\Microsoft\VisualStudio\SxS\VC7", + r"HKLM\Software\Microsoft\VisualStudio\SxS\VS7", + r"HKLM\Software\Wow6432Node\Microsoft\VisualStudio\SxS\VS7", + ] + for index in range(len(keys)): + path = _RegistryGetValue(keys[index], version) + if not path: + continue + path = _ConvertToCygpath(path) + if version == "15.0": + if os.path.exists(path): + versions.append(_CreateVersion("2017", path)) + elif version != "14.0": # There is no Express edition for 2015. + versions.append( + _CreateVersion( + version_to_year[version] + "e", + os.path.join(path, ".."), + sdk_based=True, + ) + ) + + return versions + + +def SelectVisualStudioVersion(version="auto", allow_fallback=True): + """Select which version of Visual Studio projects to generate. Arguments: version: Hook to allow caller to force a particular version (vs auto). Returns: An object representing a visual studio project format version. """ - # In auto mode, check environment variable for override. - if version == 'auto': - version = os.environ.get('GYP_MSVS_VERSION', 'auto') - version_map = { - 'auto': ('14.0', '12.0', '10.0', '9.0', '8.0', '11.0'), - '2005': ('8.0',), - '2005e': ('8.0',), - '2008': ('9.0',), - '2008e': ('9.0',), - '2010': ('10.0',), - '2010e': ('10.0',), - '2012': ('11.0',), - '2012e': ('11.0',), - '2013': ('12.0',), - '2013e': ('12.0',), - '2015': ('14.0',), - } - override_path = os.environ.get('GYP_MSVS_OVERRIDE_PATH') - if override_path: - msvs_version = os.environ.get('GYP_MSVS_VERSION') - if not msvs_version: - raise ValueError('GYP_MSVS_OVERRIDE_PATH requires GYP_MSVS_VERSION to be ' - 'set to a particular version (e.g. 2010e).') - return _CreateVersion(msvs_version, override_path, sdk_based=True) - version = str(version) - versions = _DetectVisualStudioVersions(version_map[version], 'e' in version) - if not versions: - if not allow_fallback: - raise ValueError('Could not locate Visual Studio installation.') - if version == 'auto': - # Default to 2005 if we couldn't find anything - return _CreateVersion('2005', None) - else: - return _CreateVersion(version, None) - return versions[0] + # In auto mode, check environment variable for override. + if version == "auto": + version = os.environ.get("GYP_MSVS_VERSION", "auto") + version_map = { + "auto": ("16.0", "15.0", "14.0", "12.0", "10.0", "9.0", "8.0", "11.0"), + "2005": ("8.0",), + "2005e": ("8.0",), + "2008": ("9.0",), + "2008e": ("9.0",), + "2010": ("10.0",), + "2010e": ("10.0",), + "2012": ("11.0",), + "2012e": ("11.0",), + "2013": ("12.0",), + "2013e": ("12.0",), + "2015": ("14.0",), + "2017": ("15.0",), + "2019": ("16.0",), + } + override_path = os.environ.get("GYP_MSVS_OVERRIDE_PATH") + if override_path: + msvs_version = os.environ.get("GYP_MSVS_VERSION") + if not msvs_version: + raise ValueError( + "GYP_MSVS_OVERRIDE_PATH requires GYP_MSVS_VERSION to be " + "set to a particular version (e.g. 2010e)." + ) + return _CreateVersion(msvs_version, override_path, sdk_based=True) + version = str(version) + versions = _DetectVisualStudioVersions(version_map[version], "e" in version) + if not versions: + if not allow_fallback: + raise ValueError("Could not locate Visual Studio installation.") + if version == "auto": + # Default to 2005 if we couldn't find anything + return _CreateVersion("2005", None) + else: + return _CreateVersion(version, None) + return versions[0] diff --git a/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/__init__.py b/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/__init__.py index dee834013f4144..e249536429ec31 100755 --- a/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/__init__.py +++ b/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/__init__.py @@ -27,153 +27,180 @@ debug = {} # List of "official" debug modes, but you can use anything you like. -DEBUG_GENERAL = 'general' -DEBUG_VARIABLES = 'variables' -DEBUG_INCLUDES = 'includes' +DEBUG_GENERAL = "general" +DEBUG_VARIABLES = "variables" +DEBUG_INCLUDES = "includes" def DebugOutput(mode, message, *args): - if 'all' in gyp.debug or mode in gyp.debug: - ctx = ('unknown', 0, 'unknown') - try: - f = traceback.extract_stack(limit=2) - if f: - ctx = f[0][:3] - except: - pass - if args: - message %= args - print('%s:%s:%d:%s %s' % (mode.upper(), os.path.basename(ctx[0]), - ctx[1], ctx[2], message)) + if "all" in gyp.debug or mode in gyp.debug: + ctx = ("unknown", 0, "unknown") + try: + f = traceback.extract_stack(limit=2) + if f: + ctx = f[0][:3] + except Exception: + pass + if args: + message %= args + print( + "%s:%s:%d:%s %s" + % (mode.upper(), os.path.basename(ctx[0]), ctx[1], ctx[2], message) + ) + def FindBuildFiles(): - extension = '.gyp' - files = os.listdir(os.getcwd()) - build_files = [] - for file in files: - if file.endswith(extension): - build_files.append(file) - return build_files - - -def Load(build_files, format, default_variables={}, - includes=[], depth='.', params=None, check=False, - circular_check=True, duplicate_basename_check=True): - """ + extension = ".gyp" + files = os.listdir(os.getcwd()) + build_files = [] + for file in files: + if file.endswith(extension): + build_files.append(file) + return build_files + + +def Load( + build_files, + format, + default_variables={}, + includes=[], + depth=".", + params=None, + check=False, + circular_check=True, + duplicate_basename_check=True, +): + """ Loads one or more specified build files. default_variables and includes will be copied before use. Returns the generator for the specified format and the data returned by loading the specified build files. """ - if params is None: - params = {} - - if '-' in format: - format, params['flavor'] = format.split('-', 1) - - default_variables = copy.copy(default_variables) - - # Default variables provided by this program and its modules should be - # named WITH_CAPITAL_LETTERS to provide a distinct "best practice" namespace, - # avoiding collisions with user and automatic variables. - default_variables['GENERATOR'] = format - default_variables['GENERATOR_FLAVOR'] = params.get('flavor', '') - - # Format can be a custom python file, or by default the name of a module - # within gyp.generator. - if format.endswith('.py'): - generator_name = os.path.splitext(format)[0] - path, generator_name = os.path.split(generator_name) - - # Make sure the path to the custom generator is in sys.path - # Don't worry about removing it once we are done. Keeping the path - # to each generator that is used in sys.path is likely harmless and - # arguably a good idea. - path = os.path.abspath(path) - if path not in sys.path: - sys.path.insert(0, path) - else: - generator_name = 'gyp.generator.' + format - - # These parameters are passed in order (as opposed to by key) - # because ActivePython cannot handle key parameters to __import__. - generator = __import__(generator_name, globals(), locals(), generator_name) - for (key, val) in generator.generator_default_variables.items(): - default_variables.setdefault(key, val) - - # Give the generator the opportunity to set additional variables based on - # the params it will receive in the output phase. - if getattr(generator, 'CalculateVariables', None): - generator.CalculateVariables(default_variables, params) - - # Give the generator the opportunity to set generator_input_info based on - # the params it will receive in the output phase. - if getattr(generator, 'CalculateGeneratorInputInfo', None): - generator.CalculateGeneratorInputInfo(params) - - # Fetch the generator specific info that gets fed to input, we use getattr - # so we can default things and the generators only have to provide what - # they need. - generator_input_info = { - 'non_configuration_keys': - getattr(generator, 'generator_additional_non_configuration_keys', []), - 'path_sections': - getattr(generator, 'generator_additional_path_sections', []), - 'extra_sources_for_rules': - getattr(generator, 'generator_extra_sources_for_rules', []), - 'generator_supports_multiple_toolsets': - getattr(generator, 'generator_supports_multiple_toolsets', False), - 'generator_wants_static_library_dependencies_adjusted': - getattr(generator, - 'generator_wants_static_library_dependencies_adjusted', True), - 'generator_wants_sorted_dependencies': - getattr(generator, 'generator_wants_sorted_dependencies', False), - 'generator_filelist_paths': - getattr(generator, 'generator_filelist_paths', None), - } - - # Process the input specific to this generator. - result = gyp.input.Load(build_files, default_variables, includes[:], - depth, generator_input_info, check, circular_check, - duplicate_basename_check, - params['parallel'], params['root_targets']) - return [generator] + result + if params is None: + params = {} + + if "-" in format: + format, params["flavor"] = format.split("-", 1) + + default_variables = copy.copy(default_variables) + + # Default variables provided by this program and its modules should be + # named WITH_CAPITAL_LETTERS to provide a distinct "best practice" namespace, + # avoiding collisions with user and automatic variables. + default_variables["GENERATOR"] = format + default_variables["GENERATOR_FLAVOR"] = params.get("flavor", "") + + # Format can be a custom python file, or by default the name of a module + # within gyp.generator. + if format.endswith(".py"): + generator_name = os.path.splitext(format)[0] + path, generator_name = os.path.split(generator_name) + + # Make sure the path to the custom generator is in sys.path + # Don't worry about removing it once we are done. Keeping the path + # to each generator that is used in sys.path is likely harmless and + # arguably a good idea. + path = os.path.abspath(path) + if path not in sys.path: + sys.path.insert(0, path) + else: + generator_name = "gyp.generator." + format + + # These parameters are passed in order (as opposed to by key) + # because ActivePython cannot handle key parameters to __import__. + generator = __import__(generator_name, globals(), locals(), generator_name) + for (key, val) in generator.generator_default_variables.items(): + default_variables.setdefault(key, val) + + # Give the generator the opportunity to set additional variables based on + # the params it will receive in the output phase. + if getattr(generator, "CalculateVariables", None): + generator.CalculateVariables(default_variables, params) + + # Give the generator the opportunity to set generator_input_info based on + # the params it will receive in the output phase. + if getattr(generator, "CalculateGeneratorInputInfo", None): + generator.CalculateGeneratorInputInfo(params) + + # Fetch the generator specific info that gets fed to input, we use getattr + # so we can default things and the generators only have to provide what + # they need. + generator_input_info = { + "non_configuration_keys": getattr( + generator, "generator_additional_non_configuration_keys", [] + ), + "path_sections": getattr(generator, "generator_additional_path_sections", []), + "extra_sources_for_rules": getattr( + generator, "generator_extra_sources_for_rules", [] + ), + "generator_supports_multiple_toolsets": getattr( + generator, "generator_supports_multiple_toolsets", False + ), + "generator_wants_static_library_dependencies_adjusted": getattr( + generator, "generator_wants_static_library_dependencies_adjusted", True + ), + "generator_wants_sorted_dependencies": getattr( + generator, "generator_wants_sorted_dependencies", False + ), + "generator_filelist_paths": getattr( + generator, "generator_filelist_paths", None + ), + } + + # Process the input specific to this generator. + result = gyp.input.Load( + build_files, + default_variables, + includes[:], + depth, + generator_input_info, + check, + circular_check, + duplicate_basename_check, + params["parallel"], + params["root_targets"], + ) + return [generator] + result + def NameValueListToDict(name_value_list): - """ + """ Takes an array of strings of the form 'NAME=VALUE' and creates a dictionary of the pairs. If a string is simply NAME, then the value in the dictionary is set to True. If VALUE can be converted to an integer, it is. """ - result = { } - for item in name_value_list: - tokens = item.split('=', 1) - if len(tokens) == 2: - # If we can make it an int, use that, otherwise, use the string. - try: - token_value = int(tokens[1]) - except ValueError: - token_value = tokens[1] - # Set the variable to the supplied value. - result[tokens[0]] = token_value - else: - # No value supplied, treat it as a boolean and set it. - result[tokens[0]] = True - return result + result = {} + for item in name_value_list: + tokens = item.split("=", 1) + if len(tokens) == 2: + # If we can make it an int, use that, otherwise, use the string. + try: + token_value = int(tokens[1]) + except ValueError: + token_value = tokens[1] + # Set the variable to the supplied value. + result[tokens[0]] = token_value + else: + # No value supplied, treat it as a boolean and set it. + result[tokens[0]] = True + return result + def ShlexEnv(env_name): - flags = os.environ.get(env_name, []) - if flags: - flags = shlex.split(flags) - return flags + flags = os.environ.get(env_name, []) + if flags: + flags = shlex.split(flags) + return flags + def FormatOpt(opt, value): - if opt.startswith('--'): - return '%s=%s' % (opt, value) - return opt + value + if opt.startswith("--"): + return "%s=%s" % (opt, value) + return opt + value + def RegenerateAppendFlag(flag, values, predicate, env_name, options): - """Regenerate a list of command line flags, for an option of action='append'. + """Regenerate a list of command line flags, for an option of action='append'. The |env_name|, if given, is checked in the environment and used to generate an initial list of options, then the options that were specified on the @@ -182,20 +209,21 @@ def RegenerateAppendFlag(flag, values, predicate, env_name, options): the environment, while not requiring the environment to be set when the flags are used again. """ - flags = [] - if options.use_environment and env_name: - for flag_value in ShlexEnv(env_name): - value = FormatOpt(flag, predicate(flag_value)) - if value in flags: - flags.remove(value) - flags.append(value) - if values: - for flag_value in values: - flags.append(FormatOpt(flag, predicate(flag_value))) - return flags + flags = [] + if options.use_environment and env_name: + for flag_value in ShlexEnv(env_name): + value = FormatOpt(flag, predicate(flag_value)) + if value in flags: + flags.remove(value) + flags.append(value) + if values: + for flag_value in values: + flags.append(FormatOpt(flag, predicate(flag_value))) + return flags + def RegenerateFlags(options): - """Given a parsed options object, and taking the environment variables into + """Given a parsed options object, and taking the environment variables into account, returns a list of flags that should regenerate an equivalent options object (even in the absence of the environment variables.) @@ -204,53 +232,62 @@ def RegenerateFlags(options): The format flag is not included, as it is assumed the calling generator will set that as appropriate. """ - def FixPath(path): - path = gyp.common.FixIfRelativePath(path, options.depth) - if not path: - return os.path.curdir - return path - - def Noop(value): - return value - - # We always want to ignore the environment when regenerating, to avoid - # duplicate or changed flags in the environment at the time of regeneration. - flags = ['--ignore-environment'] - for name, metadata in options._regeneration_metadata.items(): - opt = metadata['opt'] - value = getattr(options, name) - value_predicate = metadata['type'] == 'path' and FixPath or Noop - action = metadata['action'] - env_name = metadata['env_name'] - if action == 'append': - flags.extend(RegenerateAppendFlag(opt, value, value_predicate, - env_name, options)) - elif action in ('store', None): # None is a synonym for 'store'. - if value: - flags.append(FormatOpt(opt, value_predicate(value))) - elif options.use_environment and env_name and os.environ.get(env_name): - flags.append(FormatOpt(opt, value_predicate(os.environ.get(env_name)))) - elif action in ('store_true', 'store_false'): - if ((action == 'store_true' and value) or - (action == 'store_false' and not value)): - flags.append(opt) - elif options.use_environment and env_name: - print('Warning: environment regeneration unimplemented ' - 'for %s flag %r env_name %r' % (action, opt, - env_name), file=sys.stderr) - else: - print('Warning: regeneration unimplemented for action %r ' - 'flag %r' % (action, opt), file=sys.stderr) - return flags + def FixPath(path): + path = gyp.common.FixIfRelativePath(path, options.depth) + if not path: + return os.path.curdir + return path + + def Noop(value): + return value + + # We always want to ignore the environment when regenerating, to avoid + # duplicate or changed flags in the environment at the time of regeneration. + flags = ["--ignore-environment"] + for name, metadata in options._regeneration_metadata.items(): + opt = metadata["opt"] + value = getattr(options, name) + value_predicate = metadata["type"] == "path" and FixPath or Noop + action = metadata["action"] + env_name = metadata["env_name"] + if action == "append": + flags.extend( + RegenerateAppendFlag(opt, value, value_predicate, env_name, options) + ) + elif action in ("store", None): # None is a synonym for 'store'. + if value: + flags.append(FormatOpt(opt, value_predicate(value))) + elif options.use_environment and env_name and os.environ.get(env_name): + flags.append(FormatOpt(opt, value_predicate(os.environ.get(env_name)))) + elif action in ("store_true", "store_false"): + if (action == "store_true" and value) or ( + action == "store_false" and not value + ): + flags.append(opt) + elif options.use_environment and env_name: + print( + "Warning: environment regeneration unimplemented " + "for %s flag %r env_name %r" % (action, opt, env_name), + file=sys.stderr, + ) + else: + print( + "Warning: regeneration unimplemented for action %r " + "flag %r" % (action, opt), + file=sys.stderr, + ) + + return flags + class RegeneratableOptionParser(argparse.ArgumentParser): - def __init__(self, usage): - self.__regeneratable_options = {} - argparse.ArgumentParser.__init__(self, usage=usage) + def __init__(self, usage): + self.__regeneratable_options = {} + argparse.ArgumentParser.__init__(self, usage=usage) - def add_argument(self, *args, **kw): - """Add an option to the parser. + def add_argument(self, *args, **kw): + """Add an option to the parser. This accepts the same arguments as ArgumentParser.add_argument, plus the following: @@ -261,297 +298,394 @@ def add_argument(self, *args, **kw): type: adds type='path', to tell the regenerator that the values of this option need to be made relative to options.depth """ - env_name = kw.pop('env_name', None) - if 'dest' in kw and kw.pop('regenerate', True): - dest = kw['dest'] - - # The path type is needed for regenerating, for optparse we can just treat - # it as a string. - type = kw.get('type') - if type == 'path': - kw['type'] = str - - self.__regeneratable_options[dest] = { - 'action': kw.get('action'), - 'type': type, - 'env_name': env_name, - 'opt': args[0], - } + env_name = kw.pop("env_name", None) + if "dest" in kw and kw.pop("regenerate", True): + dest = kw["dest"] + + # The path type is needed for regenerating, for optparse we can just treat + # it as a string. + type = kw.get("type") + if type == "path": + kw["type"] = str + + self.__regeneratable_options[dest] = { + "action": kw.get("action"), + "type": type, + "env_name": env_name, + "opt": args[0], + } - argparse.ArgumentParser.add_argument(self, *args, **kw) + argparse.ArgumentParser.add_argument(self, *args, **kw) + + def parse_args(self, *args): + values, args = argparse.ArgumentParser.parse_known_args(self, *args) + values._regeneration_metadata = self.__regeneratable_options + return values, args - def parse_args(self, *args): - values, args = argparse.ArgumentParser.parse_known_args(self, *args) - values._regeneration_metadata = self.__regeneratable_options - return values, args def gyp_main(args): - my_name = os.path.basename(sys.argv[0]) - usage = 'usage: %(prog)s [options ...] [build_file ...]' - - - parser = RegeneratableOptionParser(usage=usage.replace('%s', '%(prog)s')) - parser.add_argument('--build', dest='configs', action='append', - help='configuration for build after project generation') - parser.add_argument('--check', dest='check', action='store_true', - help='check format of gyp files') - parser.add_argument('--config-dir', dest='config_dir', action='store', - env_name='GYP_CONFIG_DIR', default=None, - help='The location for configuration files like ' - 'include.gypi.') - parser.add_argument('-d', '--debug', dest='debug', metavar='DEBUGMODE', - action='append', default=[], help='turn on a debugging ' - 'mode for debugging GYP. Supported modes are "variables", ' - '"includes" and "general" or "all" for all of them.') - parser.add_argument('-D', dest='defines', action='append', metavar='VAR=VAL', - env_name='GYP_DEFINES', - help='sets variable VAR to value VAL') - parser.add_argument('--depth', dest='depth', metavar='PATH', type='path', - help='set DEPTH gyp variable to a relative path to PATH') - parser.add_argument('-f', '--format', dest='formats', action='append', - env_name='GYP_GENERATORS', regenerate=False, - help='output formats to generate') - parser.add_argument('-G', dest='generator_flags', action='append', default=[], - metavar='FLAG=VAL', env_name='GYP_GENERATOR_FLAGS', - help='sets generator flag FLAG to VAL') - parser.add_argument('--generator-output', dest='generator_output', - action='store', default=None, metavar='DIR', type='path', - env_name='GYP_GENERATOR_OUTPUT', - help='puts generated build files under DIR') - parser.add_argument('--ignore-environment', dest='use_environment', - action='store_false', default=True, regenerate=False, - help='do not read options from environment variables') - parser.add_argument('-I', '--include', dest='includes', action='append', - metavar='INCLUDE', type='path', - help='files to include in all loaded .gyp files') - # --no-circular-check disables the check for circular relationships between - # .gyp files. These relationships should not exist, but they've only been - # observed to be harmful with the Xcode generator. Chromium's .gyp files - # currently have some circular relationships on non-Mac platforms, so this - # option allows the strict behavior to be used on Macs and the lenient - # behavior to be used elsewhere. - # TODO(mark): Remove this option when http://crbug.com/35878 is fixed. - parser.add_argument('--no-circular-check', dest='circular_check', - action='store_false', default=True, regenerate=False, - help="don't check for circular relationships between files") - # --no-duplicate-basename-check disables the check for duplicate basenames - # in a static_library/shared_library project. Visual C++ 2008 generator - # doesn't support this configuration. Libtool on Mac also generates warnings - # when duplicate basenames are passed into Make generator on Mac. - # TODO(yukawa): Remove this option when these legacy generators are - # deprecated. - parser.add_argument('--no-duplicate-basename-check', - dest='duplicate_basename_check', action='store_false', - default=True, regenerate=False, - help="don't check for duplicate basenames") - parser.add_argument('--no-parallel', action='store_true', default=False, - help='Disable multiprocessing') - parser.add_argument('-S', '--suffix', dest='suffix', default='', - help='suffix to add to generated files') - parser.add_argument('--toplevel-dir', dest='toplevel_dir', action='store', - default=None, metavar='DIR', type='path', - help='directory to use as the root of the source tree') - parser.add_argument('-R', '--root-target', dest='root_targets', - action='append', metavar='TARGET', - help='include only TARGET and its deep dependencies') - - options, build_files_arg = parser.parse_args(args) - build_files = build_files_arg - - # Set up the configuration directory (defaults to ~/.gyp) - if not options.config_dir: - home = None - home_dot_gyp = None + my_name = os.path.basename(sys.argv[0]) + usage = "usage: %(prog)s [options ...] [build_file ...]" + + parser = RegeneratableOptionParser(usage=usage.replace("%s", "%(prog)s")) + parser.add_argument( + "--build", + dest="configs", + action="append", + help="configuration for build after project generation", + ) + parser.add_argument( + "--check", dest="check", action="store_true", help="check format of gyp files" + ) + parser.add_argument( + "--config-dir", + dest="config_dir", + action="store", + env_name="GYP_CONFIG_DIR", + default=None, + help="The location for configuration files like " "include.gypi.", + ) + parser.add_argument( + "-d", + "--debug", + dest="debug", + metavar="DEBUGMODE", + action="append", + default=[], + help="turn on a debugging " + 'mode for debugging GYP. Supported modes are "variables", ' + '"includes" and "general" or "all" for all of them.', + ) + parser.add_argument( + "-D", + dest="defines", + action="append", + metavar="VAR=VAL", + env_name="GYP_DEFINES", + help="sets variable VAR to value VAL", + ) + parser.add_argument( + "--depth", + dest="depth", + metavar="PATH", + type="path", + help="set DEPTH gyp variable to a relative path to PATH", + ) + parser.add_argument( + "-f", + "--format", + dest="formats", + action="append", + env_name="GYP_GENERATORS", + regenerate=False, + help="output formats to generate", + ) + parser.add_argument( + "-G", + dest="generator_flags", + action="append", + default=[], + metavar="FLAG=VAL", + env_name="GYP_GENERATOR_FLAGS", + help="sets generator flag FLAG to VAL", + ) + parser.add_argument( + "--generator-output", + dest="generator_output", + action="store", + default=None, + metavar="DIR", + type="path", + env_name="GYP_GENERATOR_OUTPUT", + help="puts generated build files under DIR", + ) + parser.add_argument( + "--ignore-environment", + dest="use_environment", + action="store_false", + default=True, + regenerate=False, + help="do not read options from environment variables", + ) + parser.add_argument( + "-I", + "--include", + dest="includes", + action="append", + metavar="INCLUDE", + type="path", + help="files to include in all loaded .gyp files", + ) + # --no-circular-check disables the check for circular relationships between + # .gyp files. These relationships should not exist, but they've only been + # observed to be harmful with the Xcode generator. Chromium's .gyp files + # currently have some circular relationships on non-Mac platforms, so this + # option allows the strict behavior to be used on Macs and the lenient + # behavior to be used elsewhere. + # TODO(mark): Remove this option when http://crbug.com/35878 is fixed. + parser.add_argument( + "--no-circular-check", + dest="circular_check", + action="store_false", + default=True, + regenerate=False, + help="don't check for circular relationships between files", + ) + # --no-duplicate-basename-check disables the check for duplicate basenames + # in a static_library/shared_library project. Visual C++ 2008 generator + # doesn't support this configuration. Libtool on Mac also generates warnings + # when duplicate basenames are passed into Make generator on Mac. + # TODO(yukawa): Remove this option when these legacy generators are + # deprecated. + parser.add_argument( + "--no-duplicate-basename-check", + dest="duplicate_basename_check", + action="store_false", + default=True, + regenerate=False, + help="don't check for duplicate basenames", + ) + parser.add_argument( + "--no-parallel", + action="store_true", + default=False, + help="Disable multiprocessing", + ) + parser.add_argument( + "-S", + "--suffix", + dest="suffix", + default="", + help="suffix to add to generated files", + ) + parser.add_argument( + "--toplevel-dir", + dest="toplevel_dir", + action="store", + default=None, + metavar="DIR", + type="path", + help="directory to use as the root of the source tree", + ) + parser.add_argument( + "-R", + "--root-target", + dest="root_targets", + action="append", + metavar="TARGET", + help="include only TARGET and its deep dependencies", + ) + + options, build_files_arg = parser.parse_args(args) + build_files = build_files_arg + + # Set up the configuration directory (defaults to ~/.gyp) + if not options.config_dir: + home = None + home_dot_gyp = None + if options.use_environment: + home_dot_gyp = os.environ.get("GYP_CONFIG_DIR", None) + if home_dot_gyp: + home_dot_gyp = os.path.expanduser(home_dot_gyp) + + if not home_dot_gyp: + home_vars = ["HOME"] + if sys.platform in ("cygwin", "win32"): + home_vars.append("USERPROFILE") + for home_var in home_vars: + home = os.getenv(home_var) + if home: + home_dot_gyp = os.path.join(home, ".gyp") + if not os.path.exists(home_dot_gyp): + home_dot_gyp = None + else: + break + else: + home_dot_gyp = os.path.expanduser(options.config_dir) + + if home_dot_gyp and not os.path.exists(home_dot_gyp): + home_dot_gyp = None + + if not options.formats: + # If no format was given on the command line, then check the env variable. + generate_formats = [] + if options.use_environment: + generate_formats = os.environ.get("GYP_GENERATORS", []) + if generate_formats: + generate_formats = re.split(r"[\s,]", generate_formats) + if generate_formats: + options.formats = generate_formats + else: + # Nothing in the variable, default based on platform. + if sys.platform == "darwin": + options.formats = ["xcode"] + elif sys.platform in ("win32", "cygwin"): + options.formats = ["msvs"] + else: + options.formats = ["make"] + + if not options.generator_output and options.use_environment: + g_o = os.environ.get("GYP_GENERATOR_OUTPUT") + if g_o: + options.generator_output = g_o + + options.parallel = not options.no_parallel + + for mode in options.debug: + gyp.debug[mode] = 1 + + # Do an extra check to avoid work when we're not debugging. + if DEBUG_GENERAL in gyp.debug: + DebugOutput(DEBUG_GENERAL, "running with these options:") + for option, value in sorted(options.__dict__.items()): + if option[0] == "_": + continue + if isinstance(value, string_types): + DebugOutput(DEBUG_GENERAL, " %s: '%s'", option, value) + else: + DebugOutput(DEBUG_GENERAL, " %s: %s", option, value) + + if not build_files: + build_files = FindBuildFiles() + if not build_files: + raise GypError((usage + "\n\n%s: error: no build_file") % (my_name, my_name)) + + # TODO(mark): Chromium-specific hack! + # For Chromium, the gyp "depth" variable should always be a relative path + # to Chromium's top-level "src" directory. If no depth variable was set + # on the command line, try to find a "src" directory by looking at the + # absolute path to each build file's directory. The first "src" component + # found will be treated as though it were the path used for --depth. + if not options.depth: + for build_file in build_files: + build_file_dir = os.path.abspath(os.path.dirname(build_file)) + build_file_dir_components = build_file_dir.split(os.path.sep) + components_len = len(build_file_dir_components) + for index in range(components_len - 1, -1, -1): + if build_file_dir_components[index] == "src": + options.depth = os.path.sep.join(build_file_dir_components) + break + del build_file_dir_components[index] + + # If the inner loop found something, break without advancing to another + # build file. + if options.depth: + break + + if not options.depth: + raise GypError( + "Could not automatically locate src directory. This is" + "a temporary Chromium feature that will be removed. Use" + "--depth as a workaround." + ) + + # If toplevel-dir is not set, we assume that depth is the root of our source + # tree. + if not options.toplevel_dir: + options.toplevel_dir = options.depth + + # -D on the command line sets variable defaults - D isn't just for define, + # it's for default. Perhaps there should be a way to force (-F?) a + # variable's value so that it can't be overridden by anything else. + cmdline_default_variables = {} + defines = [] if options.use_environment: - home_dot_gyp = os.environ.get('GYP_CONFIG_DIR', None) - if home_dot_gyp: - home_dot_gyp = os.path.expanduser(home_dot_gyp) - - if not home_dot_gyp: - home_vars = ['HOME'] - if sys.platform in ('cygwin', 'win32'): - home_vars.append('USERPROFILE') - for home_var in home_vars: - home = os.getenv(home_var) - if home != None: - home_dot_gyp = os.path.join(home, '.gyp') - if not os.path.exists(home_dot_gyp): - home_dot_gyp = None - else: - break - else: - home_dot_gyp = os.path.expanduser(options.config_dir) - - if home_dot_gyp and not os.path.exists(home_dot_gyp): - home_dot_gyp = None - - if not options.formats: - # If no format was given on the command line, then check the env variable. - generate_formats = [] + defines += ShlexEnv("GYP_DEFINES") + if options.defines: + defines += options.defines + cmdline_default_variables = NameValueListToDict(defines) + if DEBUG_GENERAL in gyp.debug: + DebugOutput( + DEBUG_GENERAL, "cmdline_default_variables: %s", cmdline_default_variables + ) + + # Set up includes. + includes = [] + + # If ~/.gyp/include.gypi exists, it'll be forcibly included into every + # .gyp file that's loaded, before anything else is included. + if home_dot_gyp: + default_include = os.path.join(home_dot_gyp, "include.gypi") + if os.path.exists(default_include): + print("Using overrides found in " + default_include) + includes.append(default_include) + + # Command-line --include files come after the default include. + if options.includes: + includes.extend(options.includes) + + # Generator flags should be prefixed with the target generator since they + # are global across all generator runs. + gen_flags = [] if options.use_environment: - generate_formats = os.environ.get('GYP_GENERATORS', []) - if generate_formats: - generate_formats = re.split(r'[\s,]', generate_formats) - if generate_formats: - options.formats = generate_formats - else: - # Nothing in the variable, default based on platform. - if sys.platform == 'darwin': - options.formats = ['xcode'] - elif sys.platform in ('win32', 'cygwin'): - options.formats = ['msvs'] - else: - options.formats = ['make'] - - if not options.generator_output and options.use_environment: - g_o = os.environ.get('GYP_GENERATOR_OUTPUT') - if g_o: - options.generator_output = g_o - - options.parallel = not options.no_parallel - - for mode in options.debug: - gyp.debug[mode] = 1 - - # Do an extra check to avoid work when we're not debugging. - if DEBUG_GENERAL in gyp.debug: - DebugOutput(DEBUG_GENERAL, 'running with these options:') - for option, value in sorted(options.__dict__.items()): - if option[0] == '_': - continue - if isinstance(value, string_types): - DebugOutput(DEBUG_GENERAL, " %s: '%s'", option, value) - else: - DebugOutput(DEBUG_GENERAL, " %s: %s", option, value) - - if not build_files: - build_files = FindBuildFiles() - if not build_files: - raise GypError((usage + '\n\n%s: error: no build_file') % - (my_name, my_name)) - - # TODO(mark): Chromium-specific hack! - # For Chromium, the gyp "depth" variable should always be a relative path - # to Chromium's top-level "src" directory. If no depth variable was set - # on the command line, try to find a "src" directory by looking at the - # absolute path to each build file's directory. The first "src" component - # found will be treated as though it were the path used for --depth. - if not options.depth: - for build_file in build_files: - build_file_dir = os.path.abspath(os.path.dirname(build_file)) - build_file_dir_components = build_file_dir.split(os.path.sep) - components_len = len(build_file_dir_components) - for index in range(components_len - 1, -1, -1): - if build_file_dir_components[index] == 'src': - options.depth = os.path.sep.join(build_file_dir_components) - break - del build_file_dir_components[index] - - # If the inner loop found something, break without advancing to another - # build file. - if options.depth: - break + gen_flags += ShlexEnv("GYP_GENERATOR_FLAGS") + if options.generator_flags: + gen_flags += options.generator_flags + generator_flags = NameValueListToDict(gen_flags) + if DEBUG_GENERAL in gyp.debug.keys(): + DebugOutput(DEBUG_GENERAL, "generator_flags: %s", generator_flags) + + # Generate all requested formats (use a set in case we got one format request + # twice) + for format in set(options.formats): + params = { + "options": options, + "build_files": build_files, + "generator_flags": generator_flags, + "cwd": os.getcwd(), + "build_files_arg": build_files_arg, + "gyp_binary": sys.argv[0], + "home_dot_gyp": home_dot_gyp, + "parallel": options.parallel, + "root_targets": options.root_targets, + "target_arch": cmdline_default_variables.get("target_arch", ""), + } - if not options.depth: - raise GypError('Could not automatically locate src directory. This is' - 'a temporary Chromium feature that will be removed. Use' - '--depth as a workaround.') - - # If toplevel-dir is not set, we assume that depth is the root of our source - # tree. - if not options.toplevel_dir: - options.toplevel_dir = options.depth - - # -D on the command line sets variable defaults - D isn't just for define, - # it's for default. Perhaps there should be a way to force (-F?) a - # variable's value so that it can't be overridden by anything else. - cmdline_default_variables = {} - defines = [] - if options.use_environment: - defines += ShlexEnv('GYP_DEFINES') - if options.defines: - defines += options.defines - cmdline_default_variables = NameValueListToDict(defines) - if DEBUG_GENERAL in gyp.debug: - DebugOutput(DEBUG_GENERAL, - "cmdline_default_variables: %s", cmdline_default_variables) - - # Set up includes. - includes = [] - - # If ~/.gyp/include.gypi exists, it'll be forcibly included into every - # .gyp file that's loaded, before anything else is included. - if home_dot_gyp != None: - default_include = os.path.join(home_dot_gyp, 'include.gypi') - if os.path.exists(default_include): - print('Using overrides found in ' + default_include) - includes.append(default_include) - - # Command-line --include files come after the default include. - if options.includes: - includes.extend(options.includes) - - # Generator flags should be prefixed with the target generator since they - # are global across all generator runs. - gen_flags = [] - if options.use_environment: - gen_flags += ShlexEnv('GYP_GENERATOR_FLAGS') - if options.generator_flags: - gen_flags += options.generator_flags - generator_flags = NameValueListToDict(gen_flags) - if DEBUG_GENERAL in gyp.debug.keys(): - DebugOutput(DEBUG_GENERAL, "generator_flags: %s", generator_flags) - - # Generate all requested formats (use a set in case we got one format request - # twice) - for format in set(options.formats): - params = {'options': options, - 'build_files': build_files, - 'generator_flags': generator_flags, - 'cwd': os.getcwd(), - 'build_files_arg': build_files_arg, - 'gyp_binary': sys.argv[0], - 'home_dot_gyp': home_dot_gyp, - 'parallel': options.parallel, - 'root_targets': options.root_targets, - 'target_arch': cmdline_default_variables.get('target_arch', '')} - - # Start with the default variables from the command line. - [generator, flat_list, targets, data] = Load( - build_files, format, cmdline_default_variables, includes, options.depth, - params, options.check, options.circular_check, - options.duplicate_basename_check) - - # TODO(mark): Pass |data| for now because the generator needs a list of - # build files that came in. In the future, maybe it should just accept - # a list, and not the whole data dict. - # NOTE: flat_list is the flattened dependency graph specifying the order - # that targets may be built. Build systems that operate serially or that - # need to have dependencies defined before dependents reference them should - # generate targets in the order specified in flat_list. - generator.GenerateOutput(flat_list, targets, data, params) - - if options.configs: - valid_configs = targets[flat_list[0]]['configurations'].keys() - for conf in options.configs: - if conf not in valid_configs: - raise GypError('Invalid config specified via --build: %s' % conf) - generator.PerformBuild(data, options.configs, params) - - # Done - return 0 + # Start with the default variables from the command line. + [generator, flat_list, targets, data] = Load( + build_files, + format, + cmdline_default_variables, + includes, + options.depth, + params, + options.check, + options.circular_check, + options.duplicate_basename_check, + ) + + # TODO(mark): Pass |data| for now because the generator needs a list of + # build files that came in. In the future, maybe it should just accept + # a list, and not the whole data dict. + # NOTE: flat_list is the flattened dependency graph specifying the order + # that targets may be built. Build systems that operate serially or that + # need to have dependencies defined before dependents reference them should + # generate targets in the order specified in flat_list. + generator.GenerateOutput(flat_list, targets, data, params) + + if options.configs: + valid_configs = targets[flat_list[0]]["configurations"] + for conf in options.configs: + if conf not in valid_configs: + raise GypError("Invalid config specified via --build: %s" % conf) + generator.PerformBuild(data, options.configs, params) + + # Done + return 0 def main(args): - try: - return gyp_main(args) - except GypError as e: - sys.stderr.write("gyp: %s\n" % e) - return 1 + try: + return gyp_main(args) + except GypError as e: + sys.stderr.write("gyp: %s\n" % e) + return 1 + # NOTE: setuptools generated console_scripts calls function with no arguments def script_main(): - return main(sys.argv[1:]) + return main(sys.argv[1:]) + -if __name__ == '__main__': - sys.exit(script_main()) +if __name__ == "__main__": + sys.exit(script_main()) diff --git a/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/common.py b/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/common.py index d866e81d40b0a4..bfe546f8675291 100644 --- a/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/common.py +++ b/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/common.py @@ -11,9 +11,9 @@ import subprocess try: - from collections.abc import MutableSet + from collections.abc import MutableSet except ImportError: - from collections import MutableSet + from collections import MutableSet PY3 = bytes != str @@ -21,191 +21,197 @@ # A minimal memoizing decorator. It'll blow up if the args aren't immutable, # among other "problems". class memoize(object): - def __init__(self, func): - self.func = func - self.cache = {} - def __call__(self, *args): - try: - return self.cache[args] - except KeyError: - result = self.func(*args) - self.cache[args] = result - return result + def __init__(self, func): + self.func = func + self.cache = {} + + def __call__(self, *args): + try: + return self.cache[args] + except KeyError: + result = self.func(*args) + self.cache[args] = result + return result class GypError(Exception): - """Error class representing an error, which is to be presented + """Error class representing an error, which is to be presented to the user. The main entry point will catch and display this. """ - pass + + pass def ExceptionAppend(e, msg): - """Append a message to the given exception's message.""" - if not e.args: - e.args = (msg,) - elif len(e.args) == 1: - e.args = (str(e.args[0]) + ' ' + msg,) - else: - e.args = (str(e.args[0]) + ' ' + msg,) + e.args[1:] + """Append a message to the given exception's message.""" + if not e.args: + e.args = (msg,) + elif len(e.args) == 1: + e.args = (str(e.args[0]) + " " + msg,) + else: + e.args = (str(e.args[0]) + " " + msg,) + e.args[1:] def FindQualifiedTargets(target, qualified_list): - """ + """ Given a list of qualified targets, return the qualified targets for the specified |target|. """ - return [t for t in qualified_list if ParseQualifiedTarget(t)[1] == target] + return [t for t in qualified_list if ParseQualifiedTarget(t)[1] == target] def ParseQualifiedTarget(target): - # Splits a qualified target into a build file, target name and toolset. + # Splits a qualified target into a build file, target name and toolset. - # NOTE: rsplit is used to disambiguate the Windows drive letter separator. - target_split = target.rsplit(':', 1) - if len(target_split) == 2: - [build_file, target] = target_split - else: - build_file = None + # NOTE: rsplit is used to disambiguate the Windows drive letter separator. + target_split = target.rsplit(":", 1) + if len(target_split) == 2: + [build_file, target] = target_split + else: + build_file = None - target_split = target.rsplit('#', 1) - if len(target_split) == 2: - [target, toolset] = target_split - else: - toolset = None + target_split = target.rsplit("#", 1) + if len(target_split) == 2: + [target, toolset] = target_split + else: + toolset = None - return [build_file, target, toolset] + return [build_file, target, toolset] def ResolveTarget(build_file, target, toolset): - # This function resolves a target into a canonical form: - # - a fully defined build file, either absolute or relative to the current - # directory - # - a target name - # - a toolset - # - # build_file is the file relative to which 'target' is defined. - # target is the qualified target. - # toolset is the default toolset for that target. - [parsed_build_file, target, parsed_toolset] = ParseQualifiedTarget(target) - - if parsed_build_file: - if build_file: - # If a relative path, parsed_build_file is relative to the directory - # containing build_file. If build_file is not in the current directory, - # parsed_build_file is not a usable path as-is. Resolve it by - # interpreting it as relative to build_file. If parsed_build_file is - # absolute, it is usable as a path regardless of the current directory, - # and os.path.join will return it as-is. - build_file = os.path.normpath(os.path.join(os.path.dirname(build_file), - parsed_build_file)) - # Further (to handle cases like ../cwd), make it relative to cwd) - if not os.path.isabs(build_file): - build_file = RelativePath(build_file, '.') - else: - build_file = parsed_build_file + # This function resolves a target into a canonical form: + # - a fully defined build file, either absolute or relative to the current + # directory + # - a target name + # - a toolset + # + # build_file is the file relative to which 'target' is defined. + # target is the qualified target. + # toolset is the default toolset for that target. + [parsed_build_file, target, parsed_toolset] = ParseQualifiedTarget(target) + + if parsed_build_file: + if build_file: + # If a relative path, parsed_build_file is relative to the directory + # containing build_file. If build_file is not in the current directory, + # parsed_build_file is not a usable path as-is. Resolve it by + # interpreting it as relative to build_file. If parsed_build_file is + # absolute, it is usable as a path regardless of the current directory, + # and os.path.join will return it as-is. + build_file = os.path.normpath( + os.path.join(os.path.dirname(build_file), parsed_build_file) + ) + # Further (to handle cases like ../cwd), make it relative to cwd) + if not os.path.isabs(build_file): + build_file = RelativePath(build_file, ".") + else: + build_file = parsed_build_file - if parsed_toolset: - toolset = parsed_toolset + if parsed_toolset: + toolset = parsed_toolset - return [build_file, target, toolset] + return [build_file, target, toolset] def BuildFile(fully_qualified_target): - # Extracts the build file from the fully qualified target. - return ParseQualifiedTarget(fully_qualified_target)[0] + # Extracts the build file from the fully qualified target. + return ParseQualifiedTarget(fully_qualified_target)[0] def GetEnvironFallback(var_list, default): - """Look up a key in the environment, with fallback to secondary keys + """Look up a key in the environment, with fallback to secondary keys and finally falling back to a default value.""" - for var in var_list: - if var in os.environ: - return os.environ[var] - return default + for var in var_list: + if var in os.environ: + return os.environ[var] + return default def QualifiedTarget(build_file, target, toolset): - # "Qualified" means the file that a target was defined in and the target - # name, separated by a colon, suffixed by a # and the toolset name: - # /path/to/file.gyp:target_name#toolset - fully_qualified = build_file + ':' + target - if toolset: - fully_qualified = fully_qualified + '#' + toolset - return fully_qualified + # "Qualified" means the file that a target was defined in and the target + # name, separated by a colon, suffixed by a # and the toolset name: + # /path/to/file.gyp:target_name#toolset + fully_qualified = build_file + ":" + target + if toolset: + fully_qualified = fully_qualified + "#" + toolset + return fully_qualified @memoize def RelativePath(path, relative_to, follow_path_symlink=True): - # Assuming both |path| and |relative_to| are relative to the current - # directory, returns a relative path that identifies path relative to - # relative_to. - # If |follow_symlink_path| is true (default) and |path| is a symlink, then - # this method returns a path to the real file represented by |path|. If it is - # false, this method returns a path to the symlink. If |path| is not a - # symlink, this option has no effect. - - # Convert to normalized (and therefore absolute paths). - if follow_path_symlink: - path = os.path.realpath(path) - else: - path = os.path.abspath(path) - relative_to = os.path.realpath(relative_to) - - # On Windows, we can't create a relative path to a different drive, so just - # use the absolute path. - if sys.platform == 'win32': - if (os.path.splitdrive(path)[0].lower() != - os.path.splitdrive(relative_to)[0].lower()): - return path - - # Split the paths into components. - path_split = path.split(os.path.sep) - relative_to_split = relative_to.split(os.path.sep) - - # Determine how much of the prefix the two paths share. - prefix_len = len(os.path.commonprefix([path_split, relative_to_split])) - - # Put enough ".." components to back up out of relative_to to the common - # prefix, and then append the part of path_split after the common prefix. - relative_split = [os.path.pardir] * (len(relative_to_split) - prefix_len) + \ - path_split[prefix_len:] - - if len(relative_split) == 0: - # The paths were the same. - return '' - - # Turn it back into a string and we're done. - return os.path.join(*relative_split) + # Assuming both |path| and |relative_to| are relative to the current + # directory, returns a relative path that identifies path relative to + # relative_to. + # If |follow_symlink_path| is true (default) and |path| is a symlink, then + # this method returns a path to the real file represented by |path|. If it is + # false, this method returns a path to the symlink. If |path| is not a + # symlink, this option has no effect. + + # Convert to normalized (and therefore absolute paths). + if follow_path_symlink: + path = os.path.realpath(path) + else: + path = os.path.abspath(path) + relative_to = os.path.realpath(relative_to) + + # On Windows, we can't create a relative path to a different drive, so just + # use the absolute path. + if sys.platform == "win32": + if ( + os.path.splitdrive(path)[0].lower() + != os.path.splitdrive(relative_to)[0].lower() + ): + return path + + # Split the paths into components. + path_split = path.split(os.path.sep) + relative_to_split = relative_to.split(os.path.sep) + + # Determine how much of the prefix the two paths share. + prefix_len = len(os.path.commonprefix([path_split, relative_to_split])) + + # Put enough ".." components to back up out of relative_to to the common + # prefix, and then append the part of path_split after the common prefix. + relative_split = [os.path.pardir] * ( + len(relative_to_split) - prefix_len + ) + path_split[prefix_len:] + + if len(relative_split) == 0: + # The paths were the same. + return "" + + # Turn it back into a string and we're done. + return os.path.join(*relative_split) @memoize def InvertRelativePath(path, toplevel_dir=None): - """Given a path like foo/bar that is relative to toplevel_dir, return + """Given a path like foo/bar that is relative to toplevel_dir, return the inverse relative path back to the toplevel_dir. E.g. os.path.normpath(os.path.join(path, InvertRelativePath(path))) should always produce the empty string, unless the path contains symlinks. """ - if not path: - return path - toplevel_dir = '.' if toplevel_dir is None else toplevel_dir - return RelativePath(toplevel_dir, os.path.join(toplevel_dir, path)) + if not path: + return path + toplevel_dir = "." if toplevel_dir is None else toplevel_dir + return RelativePath(toplevel_dir, os.path.join(toplevel_dir, path)) def FixIfRelativePath(path, relative_to): - # Like RelativePath but returns |path| unchanged if it is absolute. - if os.path.isabs(path): - return path - return RelativePath(path, relative_to) + # Like RelativePath but returns |path| unchanged if it is absolute. + if os.path.isabs(path): + return path + return RelativePath(path, relative_to) def UnrelativePath(path, relative_to): - # Assuming that |relative_to| is relative to the current directory, and |path| - # is a path relative to the dirname of |relative_to|, returns a path that - # identifies |path| relative to the current directory. - rel_dir = os.path.dirname(relative_to) - return os.path.normpath(os.path.join(rel_dir, path)) + # Assuming that |relative_to| is relative to the current directory, and |path| + # is a path relative to the dirname of |relative_to|, returns a path that + # identifies |path| relative to the current directory. + rel_dir = os.path.dirname(relative_to) + return os.path.normpath(os.path.join(rel_dir, path)) # re objects used by EncodePOSIXShellArgument. See IEEE 1003.1 XCU.2.2 at @@ -234,7 +240,7 @@ def UnrelativePath(path, relative_to): # This does not match the characters in _escape, because those need to be # backslash-escaped regardless of whether they appear in a double-quoted # string. -_quote = re.compile('[\t\n #$%&\'()*;<=>?[{|}~]|^$') +_quote = re.compile("[\t\n #$%&'()*;<=>?[{|}~]|^$") # _escape is a pattern that should match any character that needs to be # escaped with a backslash, whether or not the argument matched the _quote @@ -262,8 +268,9 @@ def UnrelativePath(path, relative_to): # shells, there is no room for error here by ignoring !. _escape = re.compile(r'(["\\`])') + def EncodePOSIXShellArgument(argument): - """Encodes |argument| suitably for consumption by POSIX shells. + """Encodes |argument| suitably for consumption by POSIX shells. argument may be quoted and escaped as necessary to ensure that POSIX shells treat the returned value as a literal representing the argument passed to @@ -272,67 +279,67 @@ def EncodePOSIXShellArgument(argument): references to variables to be expanded by the shell. """ - if not isinstance(argument, str): - argument = str(argument) + if not isinstance(argument, str): + argument = str(argument) - if _quote.search(argument): - quote = '"' - else: - quote = '' + if _quote.search(argument): + quote = '"' + else: + quote = "" - encoded = quote + re.sub(_escape, r'\\\1', argument) + quote + encoded = quote + re.sub(_escape, r"\\\1", argument) + quote - return encoded + return encoded def EncodePOSIXShellList(list): - """Encodes |list| suitably for consumption by POSIX shells. + """Encodes |list| suitably for consumption by POSIX shells. Returns EncodePOSIXShellArgument for each item in list, and joins them together using the space character as an argument separator. """ - encoded_arguments = [] - for argument in list: - encoded_arguments.append(EncodePOSIXShellArgument(argument)) - return ' '.join(encoded_arguments) + encoded_arguments = [] + for argument in list: + encoded_arguments.append(EncodePOSIXShellArgument(argument)) + return " ".join(encoded_arguments) def DeepDependencyTargets(target_dicts, roots): - """Returns the recursive list of target dependencies.""" - dependencies = set() - pending = set(roots) - while pending: - # Pluck out one. - r = pending.pop() - # Skip if visited already. - if r in dependencies: - continue - # Add it. - dependencies.add(r) - # Add its children. - spec = target_dicts[r] - pending.update(set(spec.get('dependencies', []))) - pending.update(set(spec.get('dependencies_original', []))) - return list(dependencies - set(roots)) + """Returns the recursive list of target dependencies.""" + dependencies = set() + pending = set(roots) + while pending: + # Pluck out one. + r = pending.pop() + # Skip if visited already. + if r in dependencies: + continue + # Add it. + dependencies.add(r) + # Add its children. + spec = target_dicts[r] + pending.update(set(spec.get("dependencies", []))) + pending.update(set(spec.get("dependencies_original", []))) + return list(dependencies - set(roots)) def BuildFileTargets(target_list, build_file): - """From a target_list, returns the subset from the specified build_file. + """From a target_list, returns the subset from the specified build_file. """ - return [p for p in target_list if BuildFile(p) == build_file] + return [p for p in target_list if BuildFile(p) == build_file] def AllTargets(target_list, target_dicts, build_file): - """Returns all targets (direct and dependencies) for the specified build_file. + """Returns all targets (direct and dependencies) for the specified build_file. """ - bftargets = BuildFileTargets(target_list, build_file) - deptargets = DeepDependencyTargets(target_dicts, bftargets) - return bftargets + deptargets + bftargets = BuildFileTargets(target_list, build_file) + deptargets = DeepDependencyTargets(target_dicts, bftargets) + return bftargets + deptargets def WriteOnDiff(filename): - """Write to a file only if the new contents differ. + """Write to a file only if the new contents differ. Arguments: filename: name of the file to potentially write to. @@ -341,143 +348,146 @@ def WriteOnDiff(filename): the target if it differs (on close). """ - class Writer(object): - """Wrapper around file which only covers the target if it differs.""" - def __init__(self): - # On Cygwin remove the "dir" argument because `C:` prefixed paths are treated as relative, - # consequently ending up with current dir "/cygdrive/c/..." being prefixed to those, which was - # obviously a non-existent path, for example: "/cygdrive/c//C:\". - # See https://docs.python.org/2/library/tempfile.html#tempfile.mkstemp for more details - base_temp_dir = "" if IsCygwin() else os.path.dirname(filename) - # Pick temporary file. - tmp_fd, self.tmp_path = tempfile.mkstemp( - suffix='.tmp', - prefix=os.path.split(filename)[1] + '.gyp.', - dir=base_temp_dir) - try: - self.tmp_file = os.fdopen(tmp_fd, 'wb') - except Exception: - # Don't leave turds behind. - os.unlink(self.tmp_path) - raise - - def __getattr__(self, attrname): - # Delegate everything else to self.tmp_file - return getattr(self.tmp_file, attrname) - - def close(self): - try: - # Close tmp file. - self.tmp_file.close() - # Determine if different. - same = False - try: - same = filecmp.cmp(self.tmp_path, filename, False) - except OSError as e: - if e.errno != errno.ENOENT: - raise - - if same: - # The new file is identical to the old one, just get rid of the new - # one. - os.unlink(self.tmp_path) - else: - # The new file is different from the old one, or there is no old one. - # Rename the new file to the permanent name. - # - # tempfile.mkstemp uses an overly restrictive mode, resulting in a - # file that can only be read by the owner, regardless of the umask. - # There's no reason to not respect the umask here, which means that - # an extra hoop is required to fetch it and reset the new file's mode. - # - # No way to get the umask without setting a new one? Set a safe one - # and then set it back to the old value. - umask = os.umask(0o77) - os.umask(umask) - os.chmod(self.tmp_path, 0o666 & ~umask) - if sys.platform == 'win32' and os.path.exists(filename): - # NOTE: on windows (but not cygwin) rename will not replace an - # existing file, so it must be preceded with a remove. Sadly there - # is no way to make the switch atomic. - os.remove(filename) - os.rename(self.tmp_path, filename) - except Exception: - # Don't leave turds behind. - os.unlink(self.tmp_path) - raise - - def write(self, s): - self.tmp_file.write(s.encode('utf-8')) - - return Writer() + class Writer(object): + """Wrapper around file which only covers the target if it differs.""" + + def __init__(self): + # On Cygwin remove the "dir" argument because `C:` prefixed paths are treated as relative, + # consequently ending up with current dir "/cygdrive/c/..." being prefixed to those, which was + # obviously a non-existent path, for example: "/cygdrive/c//C:\". + # See https://docs.python.org/2/library/tempfile.html#tempfile.mkstemp for more details + base_temp_dir = "" if IsCygwin() else os.path.dirname(filename) + # Pick temporary file. + tmp_fd, self.tmp_path = tempfile.mkstemp( + suffix=".tmp", + prefix=os.path.split(filename)[1] + ".gyp.", + dir=base_temp_dir, + ) + try: + self.tmp_file = os.fdopen(tmp_fd, "wb") + except Exception: + # Don't leave turds behind. + os.unlink(self.tmp_path) + raise + + def __getattr__(self, attrname): + # Delegate everything else to self.tmp_file + return getattr(self.tmp_file, attrname) + + def close(self): + try: + # Close tmp file. + self.tmp_file.close() + # Determine if different. + same = False + try: + same = filecmp.cmp(self.tmp_path, filename, False) + except OSError as e: + if e.errno != errno.ENOENT: + raise + + if same: + # The new file is identical to the old one, just get rid of the new + # one. + os.unlink(self.tmp_path) + else: + # The new file is different from the old one, or there is no old one. + # Rename the new file to the permanent name. + # + # tempfile.mkstemp uses an overly restrictive mode, resulting in a + # file that can only be read by the owner, regardless of the umask. + # There's no reason to not respect the umask here, which means that + # an extra hoop is required to fetch it and reset the new file's mode. + # + # No way to get the umask without setting a new one? Set a safe one + # and then set it back to the old value. + umask = os.umask(0o77) + os.umask(umask) + os.chmod(self.tmp_path, 0o666 & ~umask) + if sys.platform == "win32" and os.path.exists(filename): + # NOTE: on windows (but not cygwin) rename will not replace an + # existing file, so it must be preceded with a remove. Sadly there + # is no way to make the switch atomic. + os.remove(filename) + os.rename(self.tmp_path, filename) + except Exception: + # Don't leave turds behind. + os.unlink(self.tmp_path) + raise + + def write(self, s): + self.tmp_file.write(s.encode("utf-8")) + + return Writer() def EnsureDirExists(path): - """Make sure the directory for |path| exists.""" - try: - os.makedirs(os.path.dirname(path)) - except OSError: - pass + """Make sure the directory for |path| exists.""" + try: + os.makedirs(os.path.dirname(path)) + except OSError: + pass def GetFlavor(params): - """Returns |params.flavor| if it's set, the system's default flavor else.""" - flavors = { - 'cygwin': 'win', - 'win32': 'win', - 'darwin': 'mac', - } - - if 'flavor' in params: - return params['flavor'] - if sys.platform in flavors: - return flavors[sys.platform] - if sys.platform.startswith('sunos'): - return 'solaris' - if sys.platform.startswith('freebsd'): - return 'freebsd' - if sys.platform.startswith('openbsd'): - return 'openbsd' - if sys.platform.startswith('netbsd'): - return 'netbsd' - if sys.platform.startswith('aix'): - return 'aix' - if sys.platform.startswith('zos'): - return 'zos' - if sys.platform.startswith('os390'): - return 'zos' - - return 'linux' - - -def CopyTool(flavor, out_path): - """Finds (flock|mac|win)_tool.gyp in the gyp directory and copies it + """Returns |params.flavor| if it's set, the system's default flavor else.""" + flavors = { + "cygwin": "win", + "win32": "win", + "darwin": "mac", + } + + if "flavor" in params: + return params["flavor"] + if sys.platform in flavors: + return flavors[sys.platform] + if sys.platform.startswith("sunos"): + return "solaris" + if sys.platform.startswith(("dragonfly", "freebsd")): + return "freebsd" + if sys.platform.startswith("openbsd"): + return "openbsd" + if sys.platform.startswith("netbsd"): + return "netbsd" + if sys.platform.startswith("aix"): + return "aix" + if sys.platform.startswith(("os390", "zos")): + return "zos" + + return "linux" + + +def CopyTool(flavor, out_path, generator_flags={}): + """Finds (flock|mac|win)_tool.gyp in the gyp directory and copies it to |out_path|.""" - # aix and solaris just need flock emulation. mac and win use more complicated - # support scripts. - prefix = { - 'aix': 'flock', - 'solaris': 'flock', - 'mac': 'mac', - 'win': 'win' - }.get(flavor, None) - if not prefix: - return - - # Slurp input file. - source_path = os.path.join( - os.path.dirname(os.path.abspath(__file__)), '%s_tool.py' % prefix) - with open(source_path) as source_file: - source = source_file.readlines() - - # Add header and write it out. - tool_path = os.path.join(out_path, 'gyp-%s-tool' % prefix) - with open(tool_path, 'w') as tool_file: - tool_file.write( - ''.join([source[0], '# Generated by gyp. Do not edit.\n'] + source[1:])) - - # Make file executable. - os.chmod(tool_path, 0o755) + # aix and solaris just need flock emulation. mac and win use more complicated + # support scripts. + prefix = {"aix": "flock", "solaris": "flock", "mac": "mac", "win": "win"}.get( + flavor, None + ) + if not prefix: + return + + # Slurp input file. + source_path = os.path.join( + os.path.dirname(os.path.abspath(__file__)), "%s_tool.py" % prefix + ) + with open(source_path) as source_file: + source = source_file.readlines() + + # Set custom header flags. + header = "# Generated by gyp. Do not edit.\n" + mac_toolchain_dir = generator_flags.get("mac_toolchain_dir", None) + if flavor == "mac" and mac_toolchain_dir: + header += "import os;\nos.environ['DEVELOPER_DIR']='%s'\n" % mac_toolchain_dir + + # Add header and write it out. + tool_path = os.path.join(out_path, "gyp-%s-tool" % prefix) + with open(tool_path, "w") as tool_file: + tool_file.write("".join([source[0], header] + source[1:])) + + # Make file executable. + os.chmod(tool_path, 0o755) # From Alex Martelli, @@ -486,14 +496,14 @@ def CopyTool(flavor, out_path): # First comment, dated 2001/10/13. # (Also in the printed Python Cookbook.) -def uniquer(seq, idfun=None): - if idfun is None: - idfun = lambda x: x + +def uniquer(seq, idfun=lambda x: x): seen = {} result = [] for item in seq: marker = idfun(item) - if marker in seen: continue + if marker in seen: + continue seen[marker] = 1 result.append(item) return result @@ -501,80 +511,82 @@ def uniquer(seq, idfun=None): # Based on http://code.activestate.com/recipes/576694/. class OrderedSet(MutableSet): - def __init__(self, iterable=None): - self.end = end = [] - end += [None, end, end] # sentinel node for doubly linked list - self.map = {} # key --> [key, prev, next] - if iterable is not None: - self |= iterable - - def __len__(self): - return len(self.map) - - def __contains__(self, key): - return key in self.map - - def add(self, key): - if key not in self.map: - end = self.end - curr = end[1] - curr[2] = end[1] = self.map[key] = [key, curr, end] - - def discard(self, key): - if key in self.map: - key, prev_item, next_item = self.map.pop(key) - prev_item[2] = next_item - next_item[1] = prev_item - - def __iter__(self): - end = self.end - curr = end[2] - while curr is not end: - yield curr[0] - curr = curr[2] - - def __reversed__(self): - end = self.end - curr = end[1] - while curr is not end: - yield curr[0] - curr = curr[1] - - # The second argument is an addition that causes a pylint warning. - def pop(self, last=True): # pylint: disable=W0221 - if not self: - raise KeyError('set is empty') - key = self.end[1][0] if last else self.end[2][0] - self.discard(key) - return key - - def __repr__(self): - if not self: - return '%s()' % (self.__class__.__name__,) - return '%s(%r)' % (self.__class__.__name__, list(self)) - - def __eq__(self, other): - if isinstance(other, OrderedSet): - return len(self) == len(other) and list(self) == list(other) - return set(self) == set(other) - - # Extensions to the recipe. - def update(self, iterable): - for i in iterable: - if i not in self: - self.add(i) + def __init__(self, iterable=None): + self.end = end = [] + end += [None, end, end] # sentinel node for doubly linked list + self.map = {} # key --> [key, prev, next] + if iterable is not None: + self |= iterable + + def __len__(self): + return len(self.map) + + def __contains__(self, key): + return key in self.map + + def add(self, key): + if key not in self.map: + end = self.end + curr = end[1] + curr[2] = end[1] = self.map[key] = [key, curr, end] + + def discard(self, key): + if key in self.map: + key, prev_item, next_item = self.map.pop(key) + prev_item[2] = next_item + next_item[1] = prev_item + + def __iter__(self): + end = self.end + curr = end[2] + while curr is not end: + yield curr[0] + curr = curr[2] + + def __reversed__(self): + end = self.end + curr = end[1] + while curr is not end: + yield curr[0] + curr = curr[1] + + # The second argument is an addition that causes a pylint warning. + def pop(self, last=True): # pylint: disable=W0221 + if not self: + raise KeyError("set is empty") + key = self.end[1][0] if last else self.end[2][0] + self.discard(key) + return key + + def __repr__(self): + if not self: + return "%s()" % (self.__class__.__name__,) + return "%s(%r)" % (self.__class__.__name__, list(self)) + + def __eq__(self, other): + if isinstance(other, OrderedSet): + return len(self) == len(other) and list(self) == list(other) + return set(self) == set(other) + + # Extensions to the recipe. + def update(self, iterable): + for i in iterable: + if i not in self: + self.add(i) class CycleError(Exception): - """An exception raised when an unexpected cycle is detected.""" - def __init__(self, nodes): - self.nodes = nodes - def __str__(self): - return 'CycleError: cycle involving: ' + str(self.nodes) + """An exception raised when an unexpected cycle is detected.""" + + def __init__(self, nodes): + self.nodes = nodes + + def __str__(self): + return "CycleError: cycle involving: " + str(self.nodes) def TopologicallySorted(graph, get_edges): - r"""Topologically sort based on a user provided edge definition. + r"""Topologically sort based on a user provided edge definition. Args: graph: A list of node names. @@ -594,45 +606,50 @@ def GetEdges(node): ==> ['a', 'c', b'] """ - get_edges = memoize(get_edges) - visited = set() - visiting = set() - ordered_nodes = [] - def Visit(node): - if node in visiting: - raise CycleError(visiting) - if node in visited: - return - visited.add(node) - visiting.add(node) - for neighbor in get_edges(node): - Visit(neighbor) - visiting.remove(node) - ordered_nodes.insert(0, node) - for node in sorted(graph): - Visit(node) - return ordered_nodes + get_edges = memoize(get_edges) + visited = set() + visiting = set() + ordered_nodes = [] + + def Visit(node): + if node in visiting: + raise CycleError(visiting) + if node in visited: + return + visited.add(node) + visiting.add(node) + for neighbor in get_edges(node): + Visit(neighbor) + visiting.remove(node) + ordered_nodes.insert(0, node) + + for node in sorted(graph): + Visit(node) + return ordered_nodes + def CrossCompileRequested(): - # TODO: figure out how to not build extra host objects in the - # non-cross-compile case when this is enabled, and enable unconditionally. - return (os.environ.get('GYP_CROSSCOMPILE') or - os.environ.get('AR_host') or - os.environ.get('CC_host') or - os.environ.get('CXX_host') or - os.environ.get('AR_target') or - os.environ.get('CC_target') or - os.environ.get('CXX_target')) + # TODO: figure out how to not build extra host objects in the + # non-cross-compile case when this is enabled, and enable unconditionally. + return ( + os.environ.get("GYP_CROSSCOMPILE") + or os.environ.get("AR_host") + or os.environ.get("CC_host") + or os.environ.get("CXX_host") + or os.environ.get("AR_target") + or os.environ.get("CC_target") + or os.environ.get("CXX_target") + ) -def IsCygwin(): - try: - out = subprocess.Popen("uname", - stdout=subprocess.PIPE, - stderr=subprocess.STDOUT) - stdout, stderr = out.communicate() - if PY3: - stdout = stdout.decode("utf-8") - return "CYGWIN" in str(stdout) - except Exception: - return False +def IsCygwin(): + try: + out = subprocess.Popen( + "uname", stdout=subprocess.PIPE, stderr=subprocess.STDOUT + ) + stdout, stderr = out.communicate() + if PY3: + stdout = stdout.decode("utf-8") + return "CYGWIN" in str(stdout) + except Exception: + return False diff --git a/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/common_test.py b/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/common_test.py index b75bbb8412b6f8..0310fb266c4e4f 100755 --- a/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/common_test.py +++ b/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/common_test.py @@ -12,61 +12,67 @@ class TestTopologicallySorted(unittest.TestCase): - def test_Valid(self): - """Test that sorting works on a valid graph with one possible order.""" - graph = { - 'a': ['b', 'c'], - 'b': [], - 'c': ['d'], - 'd': ['b'], + def test_Valid(self): + """Test that sorting works on a valid graph with one possible order.""" + graph = { + "a": ["b", "c"], + "b": [], + "c": ["d"], + "d": ["b"], } - def GetEdge(node): - return tuple(graph[node]) - self.assertEqual( - gyp.common.TopologicallySorted(graph.keys(), GetEdge), - ['a', 'c', 'd', 'b']) - - def test_Cycle(self): - """Test that an exception is thrown on a cyclic graph.""" - graph = { - 'a': ['b'], - 'b': ['c'], - 'c': ['d'], - 'd': ['a'], + + def GetEdge(node): + return tuple(graph[node]) + + self.assertEqual( + gyp.common.TopologicallySorted(graph.keys(), GetEdge), ["a", "c", "d", "b"] + ) + + def test_Cycle(self): + """Test that an exception is thrown on a cyclic graph.""" + graph = { + "a": ["b"], + "b": ["c"], + "c": ["d"], + "d": ["a"], } - def GetEdge(node): - return tuple(graph[node]) - self.assertRaises( - gyp.common.CycleError, gyp.common.TopologicallySorted, - graph.keys(), GetEdge) + + def GetEdge(node): + return tuple(graph[node]) + + self.assertRaises( + gyp.common.CycleError, gyp.common.TopologicallySorted, graph.keys(), GetEdge + ) class TestGetFlavor(unittest.TestCase): - """Test that gyp.common.GetFlavor works as intended""" - original_platform = '' + """Test that gyp.common.GetFlavor works as intended""" + + original_platform = "" - def setUp(self): - self.original_platform = sys.platform + def setUp(self): + self.original_platform = sys.platform - def tearDown(self): - sys.platform = self.original_platform + def tearDown(self): + sys.platform = self.original_platform - def assertFlavor(self, expected, argument, param): - sys.platform = argument - self.assertEqual(expected, gyp.common.GetFlavor(param)) + def assertFlavor(self, expected, argument, param): + sys.platform = argument + self.assertEqual(expected, gyp.common.GetFlavor(param)) - def test_platform_default(self): - self.assertFlavor('freebsd', 'freebsd9' , {}) - self.assertFlavor('freebsd', 'freebsd10', {}) - self.assertFlavor('openbsd', 'openbsd5' , {}) - self.assertFlavor('solaris', 'sunos5' , {}) - self.assertFlavor('solaris', 'sunos' , {}) - self.assertFlavor('linux' , 'linux2' , {}) - self.assertFlavor('linux' , 'linux3' , {}) + def test_platform_default(self): + self.assertFlavor("freebsd", "freebsd9", {}) + self.assertFlavor("freebsd", "freebsd10", {}) + self.assertFlavor("openbsd", "openbsd5", {}) + self.assertFlavor("solaris", "sunos5", {}) + self.assertFlavor("solaris", "sunos", {}) + self.assertFlavor("linux", "linux2", {}) + self.assertFlavor("linux", "linux3", {}) + self.assertFlavor("linux", "linux", {}) - def test_param(self): - self.assertFlavor('foobar', 'linux2' , {'flavor': 'foobar'}) + def test_param(self): + self.assertFlavor("foobar", "linux2", {"flavor": "foobar"}) -if __name__ == '__main__': - unittest.main() +if __name__ == "__main__": + unittest.main() diff --git a/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/easy_xml.py b/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/easy_xml.py index 1ddd9091756a26..e0628ef4d8310a 100644 --- a/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/easy_xml.py +++ b/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/easy_xml.py @@ -8,8 +8,8 @@ from functools import reduce -def XmlToString(content, encoding='utf-8', pretty=False): - """ Writes the XML content to disk, touching the file only if it has changed. +def XmlToString(content, encoding="utf-8", pretty=False): + """ Writes the XML content to disk, touching the file only if it has changed. Visual Studio files have a lot of pre-defined structures. This function makes it easy to represent these structures as Python data structures, instead of @@ -46,18 +46,18 @@ def XmlToString(content, encoding='utf-8', pretty=False): Returns: The XML content as a string. """ - # We create a huge list of all the elements of the file. - xml_parts = ['' % encoding] - if pretty: - xml_parts.append('\n') - _ConstructContentList(xml_parts, content, pretty) + # We create a huge list of all the elements of the file. + xml_parts = ['' % encoding] + if pretty: + xml_parts.append("\n") + _ConstructContentList(xml_parts, content, pretty) - # Convert it to a string - return ''.join(xml_parts) + # Convert it to a string + return "".join(xml_parts) def _ConstructContentList(xml_parts, specification, pretty, level=0): - """ Appends the XML parts corresponding to the specification. + """ Appends the XML parts corresponding to the specification. Args: xml_parts: A list of XML parts to be appended to. @@ -65,48 +65,49 @@ def _ConstructContentList(xml_parts, specification, pretty, level=0): pretty: True if we want pretty printing with indents and new lines. level: Indentation level. """ - # The first item in a specification is the name of the element. - if pretty: - indentation = ' ' * level - new_line = '\n' - else: - indentation = '' - new_line = '' - name = specification[0] - if not isinstance(name, str): - raise Exception('The first item of an EasyXml specification should be ' - 'a string. Specification was ' + str(specification)) - xml_parts.append(indentation + '<' + name) - - # Optionally in second position is a dictionary of the attributes. - rest = specification[1:] - if rest and isinstance(rest[0], dict): - for at, val in sorted(rest[0].items()): - xml_parts.append(' %s="%s"' % (at, _XmlEscape(val, attr=True))) - rest = rest[1:] - if rest: - xml_parts.append('>') - all_strings = reduce(lambda x, y: x and isinstance(y, str), rest, True) - multi_line = not all_strings - if multi_line and new_line: - xml_parts.append(new_line) - for child_spec in rest: - # If it's a string, append a text node. - # Otherwise recurse over that child definition - if isinstance(child_spec, str): - xml_parts.append(_XmlEscape(child_spec)) - else: - _ConstructContentList(xml_parts, child_spec, pretty, level + 1) - if multi_line and indentation: - xml_parts.append(indentation) - xml_parts.append('%s' % (name, new_line)) - else: - xml_parts.append('/>%s' % new_line) - - -def WriteXmlIfChanged(content, path, encoding='utf-8', pretty=False, - win32=False): - """ Writes the XML content to disk, touching the file only if it has changed. + # The first item in a specification is the name of the element. + if pretty: + indentation = " " * level + new_line = "\n" + else: + indentation = "" + new_line = "" + name = specification[0] + if not isinstance(name, str): + raise Exception( + "The first item of an EasyXml specification should be " + "a string. Specification was " + str(specification) + ) + xml_parts.append(indentation + "<" + name) + + # Optionally in second position is a dictionary of the attributes. + rest = specification[1:] + if rest and isinstance(rest[0], dict): + for at, val in sorted(rest[0].items()): + xml_parts.append(' %s="%s"' % (at, _XmlEscape(val, attr=True))) + rest = rest[1:] + if rest: + xml_parts.append(">") + all_strings = reduce(lambda x, y: x and isinstance(y, str), rest, True) + multi_line = not all_strings + if multi_line and new_line: + xml_parts.append(new_line) + for child_spec in rest: + # If it's a string, append a text node. + # Otherwise recurse over that child definition + if isinstance(child_spec, str): + xml_parts.append(_XmlEscape(child_spec)) + else: + _ConstructContentList(xml_parts, child_spec, pretty, level + 1) + if multi_line and indentation: + xml_parts.append(indentation) + xml_parts.append("%s" % (name, new_line)) + else: + xml_parts.append("/>%s" % new_line) + + +def WriteXmlIfChanged(content, path, encoding="utf-8", pretty=False, win32=False): + """ Writes the XML content to disk, touching the file only if it has changed. Args: content: The structured content to be written. @@ -114,50 +115,49 @@ def WriteXmlIfChanged(content, path, encoding='utf-8', pretty=False, encoding: The encoding to report on the first line of the XML file. pretty: True if we want pretty printing with indents and new lines. """ - xml_string = XmlToString(content, encoding, pretty) - if win32 and os.linesep != '\r\n': - xml_string = xml_string.replace('\n', '\r\n') + xml_string = XmlToString(content, encoding, pretty) + if win32 and os.linesep != "\r\n": + xml_string = xml_string.replace("\n", "\r\n") - default_encoding = locale.getdefaultlocale()[1] - if default_encoding.upper() != encoding.upper(): - xml_string = xml_string.encode(encoding) + default_encoding = locale.getdefaultlocale()[1] + if default_encoding and default_encoding.upper() != encoding.upper(): + xml_string = xml_string.encode(encoding) - # Get the old content - try: - f = open(path, 'r') - existing = f.read() - f.close() - except: - existing = None + # Get the old content + try: + with open(path, "r") as file: + existing = file.read() + except IOError: + existing = None - # It has changed, write it - if existing != xml_string: - f = open(path, 'wb') - f.write(xml_string) - f.close() + # It has changed, write it + if existing != xml_string: + with open(path, "wb") as file: + file.write(xml_string) _xml_escape_map = { - '"': '"', - "'": ''', - '<': '<', - '>': '>', - '&': '&', - '\n': ' ', - '\r': ' ', + '"': """, + "'": "'", + "<": "<", + ">": ">", + "&": "&", + "\n": " ", + "\r": " ", } -_xml_escape_re = re.compile( - "(%s)" % "|".join(map(re.escape, _xml_escape_map.keys()))) +_xml_escape_re = re.compile("(%s)" % "|".join(map(re.escape, _xml_escape_map.keys()))) def _XmlEscape(value, attr=False): - """ Escape a string for inclusion in XML.""" - def replace(match): - m = match.string[match.start() : match.end()] - # don't replace single quotes in attrs - if attr and m == "'": - return m - return _xml_escape_map[m] - return _xml_escape_re.sub(replace, value) + """ Escape a string for inclusion in XML.""" + + def replace(match): + m = match.string[match.start() : match.end()] + # don't replace single quotes in attrs + if attr and m == "'": + return m + return _xml_escape_map[m] + + return _xml_escape_re.sub(replace, value) diff --git a/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/easy_xml_test.py b/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/easy_xml_test.py index 2a80b8a4564aa7..5bc795ddbe441b 100755 --- a/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/easy_xml_test.py +++ b/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/easy_xml_test.py @@ -8,99 +8,105 @@ import gyp.easy_xml as easy_xml import unittest + try: - from cStringIO import StringIO + from StringIO import StringIO # Python 2 except ImportError: - from io import StringIO + from io import StringIO # Python 3 class TestSequenceFunctions(unittest.TestCase): - - def setUp(self): - self.stderr = StringIO() - - def test_EasyXml_simple(self): - self.assertEqual( - easy_xml.XmlToString(['test']), - '') - - self.assertEqual( - easy_xml.XmlToString(['test'], encoding='Windows-1252'), - '') - - def test_EasyXml_simple_with_attributes(self): - self.assertEqual( - easy_xml.XmlToString(['test2', {'a': 'value1', 'b': 'value2'}]), - '') - - def test_EasyXml_escaping(self): - original = '\'"\r&\nfoo' - converted = '<test>\'" & foo' - converted_apos = converted.replace("'", ''') - self.assertEqual( - easy_xml.XmlToString(['test3', {'a': original}, original]), - '%s' % - (converted, converted_apos)) - - def test_EasyXml_pretty(self): - self.assertEqual( - easy_xml.XmlToString( - ['test3', - ['GrandParent', - ['Parent1', - ['Child'] - ], - ['Parent2'] + def setUp(self): + self.stderr = StringIO() + + def test_EasyXml_simple(self): + self.assertEqual( + easy_xml.XmlToString(["test"]), + '', + ) + + self.assertEqual( + easy_xml.XmlToString(["test"], encoding="Windows-1252"), + '', + ) + + def test_EasyXml_simple_with_attributes(self): + self.assertEqual( + easy_xml.XmlToString(["test2", {"a": "value1", "b": "value2"}]), + '', + ) + + def test_EasyXml_escaping(self): + original = "'\"\r&\nfoo" + converted = "<test>'" & foo" + converted_apos = converted.replace("'", "'") + self.assertEqual( + easy_xml.XmlToString(["test3", {"a": original}, original]), + '%s' + % (converted, converted_apos), + ) + + def test_EasyXml_pretty(self): + self.assertEqual( + easy_xml.XmlToString( + ["test3", ["GrandParent", ["Parent1", ["Child"]], ["Parent2"]]], + pretty=True, + ), + '\n' + "\n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + "\n", + ) + + def test_EasyXml_complex(self): + # We want to create: + target = ( + '' + "" + '' + "{D2250C20-3A94-4FB9-AF73-11BC5B73884B}" + "Win32Proj" + "automated_ui_tests" + "" + '' + "' + "Application" + "Unicode" + "" + "" + ) + + xml = easy_xml.XmlToString( + [ + "Project", + [ + "PropertyGroup", + {"Label": "Globals"}, + ["ProjectGuid", "{D2250C20-3A94-4FB9-AF73-11BC5B73884B}"], + ["Keyword", "Win32Proj"], + ["RootNamespace", "automated_ui_tests"], + ], + ["Import", {"Project": "$(VCTargetsPath)\\Microsoft.Cpp.props"}], + [ + "PropertyGroup", + { + "Condition": "'$(Configuration)|$(Platform)'=='Debug|Win32'", + "Label": "Configuration", + }, + ["ConfigurationType", "Application"], + ["CharacterSet", "Unicode"], + ], ] - ], - pretty=True), - '\n' - '\n' - ' \n' - ' \n' - ' \n' - ' \n' - ' \n' - ' \n' - '\n') - - - def test_EasyXml_complex(self): - # We want to create: - target = ( - '' - '' - '' - '{D2250C20-3A94-4FB9-AF73-11BC5B73884B}' - 'Win32Proj' - 'automated_ui_tests' - '' - '' - '' - 'Application' - 'Unicode' - '' - '') - - xml = easy_xml.XmlToString( - ['Project', - ['PropertyGroup', {'Label': 'Globals'}, - ['ProjectGuid', '{D2250C20-3A94-4FB9-AF73-11BC5B73884B}'], - ['Keyword', 'Win32Proj'], - ['RootNamespace', 'automated_ui_tests'] - ], - ['Import', {'Project': '$(VCTargetsPath)\\Microsoft.Cpp.props'}], - ['PropertyGroup', - {'Condition': "'$(Configuration)|$(Platform)'=='Debug|Win32'", - 'Label': 'Configuration'}, - ['ConfigurationType', 'Application'], - ['CharacterSet', 'Unicode'] - ] - ]) - self.assertEqual(xml, target) + ) + self.assertEqual(xml, target) -if __name__ == '__main__': - unittest.main() +if __name__ == "__main__": + unittest.main() diff --git a/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/flock_tool.py b/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/flock_tool.py index 81fb79d136a0a5..f9f89e520ac684 100755 --- a/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/flock_tool.py +++ b/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/flock_tool.py @@ -14,41 +14,42 @@ def main(args): - executor = FlockTool() - executor.Dispatch(args) + executor = FlockTool() + executor.Dispatch(args) class FlockTool(object): - """This class emulates the 'flock' command.""" - def Dispatch(self, args): - """Dispatches a string command to a method.""" - if len(args) < 1: - raise Exception("Not enough arguments") - - method = "Exec%s" % self._CommandifyName(args[0]) - getattr(self, method)(*args[1:]) - - def _CommandifyName(self, name_string): - """Transforms a tool name like copy-info-plist to CopyInfoPlist""" - return name_string.title().replace('-', '') - - def ExecFlock(self, lockfile, *cmd_list): - """Emulates the most basic behavior of Linux's flock(1).""" - # Rely on exception handling to report errors. - # Note that the stock python on SunOS has a bug - # where fcntl.flock(fd, LOCK_EX) always fails - # with EBADF, that's why we use this F_SETLK - # hack instead. - fd = os.open(lockfile, os.O_WRONLY|os.O_NOCTTY|os.O_CREAT, 0o666) - if sys.platform.startswith('aix'): - # Python on AIX is compiled with LARGEFILE support, which changes the - # struct size. - op = struct.pack('hhIllqq', fcntl.F_WRLCK, 0, 0, 0, 0, 0, 0) - else: - op = struct.pack('hhllhhl', fcntl.F_WRLCK, 0, 0, 0, 0, 0, 0) - fcntl.fcntl(fd, fcntl.F_SETLK, op) - return subprocess.call(cmd_list) - - -if __name__ == '__main__': - sys.exit(main(sys.argv[1:])) + """This class emulates the 'flock' command.""" + + def Dispatch(self, args): + """Dispatches a string command to a method.""" + if len(args) < 1: + raise Exception("Not enough arguments") + + method = "Exec%s" % self._CommandifyName(args[0]) + getattr(self, method)(*args[1:]) + + def _CommandifyName(self, name_string): + """Transforms a tool name like copy-info-plist to CopyInfoPlist""" + return name_string.title().replace("-", "") + + def ExecFlock(self, lockfile, *cmd_list): + """Emulates the most basic behavior of Linux's flock(1).""" + # Rely on exception handling to report errors. + # Note that the stock python on SunOS has a bug + # where fcntl.flock(fd, LOCK_EX) always fails + # with EBADF, that's why we use this F_SETLK + # hack instead. + fd = os.open(lockfile, os.O_WRONLY | os.O_NOCTTY | os.O_CREAT, 0o666) + if sys.platform.startswith("aix"): + # Python on AIX is compiled with LARGEFILE support, which changes the + # struct size. + op = struct.pack("hhIllqq", fcntl.F_WRLCK, 0, 0, 0, 0, 0, 0) + else: + op = struct.pack("hhllhhl", fcntl.F_WRLCK, 0, 0, 0, 0, 0, 0) + fcntl.fcntl(fd, fcntl.F_SETLK, op) + return subprocess.call(cmd_list) + + +if __name__ == "__main__": + sys.exit(main(sys.argv[1:])) diff --git a/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/analyzer.py b/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/analyzer.py index 59d73dbedbd319..7a393c1f9393da 100644 --- a/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/analyzer.py +++ b/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/analyzer.py @@ -65,18 +65,16 @@ from __future__ import print_function import gyp.common -import gyp.ninja_syntax as ninja_syntax import json import os import posixpath -import sys debug = False -found_dependency_string = 'Found dependency' -no_dependency_string = 'No dependencies' +found_dependency_string = "Found dependency" +no_dependency_string = "No dependencies" # Status when it should be assumed that everything has changed. -all_changed_string = 'Found dependency (all)' +all_changed_string = "Found dependency (all)" # MatchStatus is used indicate if and how a target depends upon the supplied # sources. @@ -96,118 +94,130 @@ generator_wants_static_library_dependencies_adjusted = False -generator_default_variables = { -} -for dirname in ['INTERMEDIATE_DIR', 'SHARED_INTERMEDIATE_DIR', 'PRODUCT_DIR', - 'LIB_DIR', 'SHARED_LIB_DIR']: - generator_default_variables[dirname] = '!!!' - -for unused in ['RULE_INPUT_PATH', 'RULE_INPUT_ROOT', 'RULE_INPUT_NAME', - 'RULE_INPUT_DIRNAME', 'RULE_INPUT_EXT', - 'EXECUTABLE_PREFIX', 'EXECUTABLE_SUFFIX', - 'STATIC_LIB_PREFIX', 'STATIC_LIB_SUFFIX', - 'SHARED_LIB_PREFIX', 'SHARED_LIB_SUFFIX', - 'CONFIGURATION_NAME']: - generator_default_variables[unused] = '' +generator_default_variables = {} +for dirname in [ + "INTERMEDIATE_DIR", + "SHARED_INTERMEDIATE_DIR", + "PRODUCT_DIR", + "LIB_DIR", + "SHARED_LIB_DIR", +]: + generator_default_variables[dirname] = "!!!" + +for unused in [ + "RULE_INPUT_PATH", + "RULE_INPUT_ROOT", + "RULE_INPUT_NAME", + "RULE_INPUT_DIRNAME", + "RULE_INPUT_EXT", + "EXECUTABLE_PREFIX", + "EXECUTABLE_SUFFIX", + "STATIC_LIB_PREFIX", + "STATIC_LIB_SUFFIX", + "SHARED_LIB_PREFIX", + "SHARED_LIB_SUFFIX", + "CONFIGURATION_NAME", +]: + generator_default_variables[unused] = "" def _ToGypPath(path): - """Converts a path to the format used by gyp.""" - if os.sep == '\\' and os.altsep == '/': - return path.replace('\\', '/') - return path + """Converts a path to the format used by gyp.""" + if os.sep == "\\" and os.altsep == "/": + return path.replace("\\", "/") + return path def _ResolveParent(path, base_path_components): - """Resolves |path|, which starts with at least one '../'. Returns an empty + """Resolves |path|, which starts with at least one '../'. Returns an empty string if the path shouldn't be considered. See _AddSources() for a description of |base_path_components|.""" - depth = 0 - while path.startswith('../'): - depth += 1 - path = path[3:] - # Relative includes may go outside the source tree. For example, an action may - # have inputs in /usr/include, which are not in the source tree. - if depth > len(base_path_components): - return '' - if depth == len(base_path_components): - return path - return '/'.join(base_path_components[0:len(base_path_components) - depth]) + \ - '/' + path + depth = 0 + while path.startswith("../"): + depth += 1 + path = path[3:] + # Relative includes may go outside the source tree. For example, an action may + # have inputs in /usr/include, which are not in the source tree. + if depth > len(base_path_components): + return "" + if depth == len(base_path_components): + return path + return ( + "/".join(base_path_components[0 : len(base_path_components) - depth]) + + "/" + + path + ) def _AddSources(sources, base_path, base_path_components, result): - """Extracts valid sources from |sources| and adds them to |result|. Each + """Extracts valid sources from |sources| and adds them to |result|. Each source file is relative to |base_path|, but may contain '..'. To make resolving '..' easier |base_path_components| contains each of the directories in |base_path|. Additionally each source may contain variables. Such sources are ignored as it is assumed dependencies on them are expressed and tracked in some other means.""" - # NOTE: gyp paths are always posix style. - for source in sources: - if not len(source) or source.startswith('!!!') or source.startswith('$'): - continue - # variable expansion may lead to //. - org_source = source - source = source[0] + source[1:].replace('//', '/') - if source.startswith('../'): - source = _ResolveParent(source, base_path_components) - if len(source): - result.append(source) - continue - result.append(base_path + source) - if debug: - print('AddSource', org_source, result[len(result) - 1]) - - -def _ExtractSourcesFromAction(action, base_path, base_path_components, - results): - if 'inputs' in action: - _AddSources(action['inputs'], base_path, base_path_components, results) + # NOTE: gyp paths are always posix style. + for source in sources: + if not len(source) or source.startswith("!!!") or source.startswith("$"): + continue + # variable expansion may lead to //. + org_source = source + source = source[0] + source[1:].replace("//", "/") + if source.startswith("../"): + source = _ResolveParent(source, base_path_components) + if len(source): + result.append(source) + continue + result.append(base_path + source) + if debug: + print("AddSource", org_source, result[len(result) - 1]) + + +def _ExtractSourcesFromAction(action, base_path, base_path_components, results): + if "inputs" in action: + _AddSources(action["inputs"], base_path, base_path_components, results) def _ToLocalPath(toplevel_dir, path): - """Converts |path| to a path relative to |toplevel_dir|.""" - if path == toplevel_dir: - return '' - if path.startswith(toplevel_dir + '/'): - return path[len(toplevel_dir) + len('/'):] - return path + """Converts |path| to a path relative to |toplevel_dir|.""" + if path == toplevel_dir: + return "" + if path.startswith(toplevel_dir + "/"): + return path[len(toplevel_dir) + len("/") :] + return path def _ExtractSources(target, target_dict, toplevel_dir): - # |target| is either absolute or relative and in the format of the OS. Gyp - # source paths are always posix. Convert |target| to a posix path relative to - # |toplevel_dir_|. This is done to make it easy to build source paths. - base_path = posixpath.dirname(_ToLocalPath(toplevel_dir, _ToGypPath(target))) - base_path_components = base_path.split('/') - - # Add a trailing '/' so that _AddSources() can easily build paths. - if len(base_path): - base_path += '/' - - if debug: - print('ExtractSources', target, base_path) - - results = [] - if 'sources' in target_dict: - _AddSources(target_dict['sources'], base_path, base_path_components, - results) - # Include the inputs from any actions. Any changes to these affect the - # resulting output. - if 'actions' in target_dict: - for action in target_dict['actions']: - _ExtractSourcesFromAction(action, base_path, base_path_components, - results) - if 'rules' in target_dict: - for rule in target_dict['rules']: - _ExtractSourcesFromAction(rule, base_path, base_path_components, results) - - return results + # |target| is either absolute or relative and in the format of the OS. Gyp + # source paths are always posix. Convert |target| to a posix path relative to + # |toplevel_dir_|. This is done to make it easy to build source paths. + base_path = posixpath.dirname(_ToLocalPath(toplevel_dir, _ToGypPath(target))) + base_path_components = base_path.split("/") + + # Add a trailing '/' so that _AddSources() can easily build paths. + if len(base_path): + base_path += "/" + + if debug: + print("ExtractSources", target, base_path) + + results = [] + if "sources" in target_dict: + _AddSources(target_dict["sources"], base_path, base_path_components, results) + # Include the inputs from any actions. Any changes to these affect the + # resulting output. + if "actions" in target_dict: + for action in target_dict["actions"]: + _ExtractSourcesFromAction(action, base_path, base_path_components, results) + if "rules" in target_dict: + for rule in target_dict["rules"]: + _ExtractSourcesFromAction(rule, base_path, base_path_components, results) + + return results class Target(object): - """Holds information about a particular target: + """Holds information about a particular target: deps: set of Targets this Target depends upon. This is not recursive, only the direct dependent Targets. match_status: one of the MatchStatus values. @@ -225,101 +235,111 @@ class Target(object): is_static_library: true if the type of target is static_library. is_or_has_linked_ancestor: true if the target does a link (eg executable), or if there is a target in back_deps that does a link.""" - def __init__(self, name): - self.deps = set() - self.match_status = MATCH_STATUS_TBD - self.back_deps = set() - self.name = name - # TODO(sky): I don't like hanging this off Target. This state is specific - # to certain functions and should be isolated there. - self.visited = False - self.requires_build = False - self.added_to_compile_targets = False - self.in_roots = False - self.is_executable = False - self.is_static_library = False - self.is_or_has_linked_ancestor = False + + def __init__(self, name): + self.deps = set() + self.match_status = MATCH_STATUS_TBD + self.back_deps = set() + self.name = name + # TODO(sky): I don't like hanging this off Target. This state is specific + # to certain functions and should be isolated there. + self.visited = False + self.requires_build = False + self.added_to_compile_targets = False + self.in_roots = False + self.is_executable = False + self.is_static_library = False + self.is_or_has_linked_ancestor = False class Config(object): - """Details what we're looking for + """Details what we're looking for files: set of files to search for targets: see file description for details.""" - def __init__(self): - self.files = [] - self.targets = set() - self.additional_compile_target_names = set() - self.test_target_names = set() - - def Init(self, params): - """Initializes Config. This is a separate method as it raises an exception + + def __init__(self): + self.files = [] + self.targets = set() + self.additional_compile_target_names = set() + self.test_target_names = set() + + def Init(self, params): + """Initializes Config. This is a separate method as it raises an exception if there is a parse error.""" - generator_flags = params.get('generator_flags', {}) - config_path = generator_flags.get('config_path', None) - if not config_path: - return - try: - f = open(config_path, 'r') - config = json.load(f) - f.close() - except IOError: - raise Exception('Unable to open file ' + config_path) - except ValueError as e: - raise Exception('Unable to parse config file ' + config_path + str(e)) - if not isinstance(config, dict): - raise Exception('config_path must be a JSON file containing a dictionary') - self.files = config.get('files', []) - self.additional_compile_target_names = set( - config.get('additional_compile_targets', [])) - self.test_target_names = set(config.get('test_targets', [])) + generator_flags = params.get("generator_flags", {}) + config_path = generator_flags.get("config_path", None) + if not config_path: + return + try: + f = open(config_path, "r") + config = json.load(f) + f.close() + except IOError: + raise Exception("Unable to open file " + config_path) + except ValueError as e: + raise Exception("Unable to parse config file " + config_path + str(e)) + if not isinstance(config, dict): + raise Exception("config_path must be a JSON file containing a dictionary") + self.files = config.get("files", []) + self.additional_compile_target_names = set( + config.get("additional_compile_targets", []) + ) + self.test_target_names = set(config.get("test_targets", [])) def _WasBuildFileModified(build_file, data, files, toplevel_dir): - """Returns true if the build file |build_file| is either in |files| or + """Returns true if the build file |build_file| is either in |files| or one of the files included by |build_file| is in |files|. |toplevel_dir| is the root of the source tree.""" - if _ToLocalPath(toplevel_dir, _ToGypPath(build_file)) in files: - if debug: - print('gyp file modified', build_file) - return True + if _ToLocalPath(toplevel_dir, _ToGypPath(build_file)) in files: + if debug: + print("gyp file modified", build_file) + return True - # First element of included_files is the file itself. - if len(data[build_file]['included_files']) <= 1: + # First element of included_files is the file itself. + if len(data[build_file]["included_files"]) <= 1: + return False + + for include_file in data[build_file]["included_files"][1:]: + # |included_files| are relative to the directory of the |build_file|. + rel_include_file = _ToGypPath( + gyp.common.UnrelativePath(include_file, build_file) + ) + if _ToLocalPath(toplevel_dir, rel_include_file) in files: + if debug: + print( + "included gyp file modified, gyp_file=", + build_file, + "included file=", + rel_include_file, + ) + return True return False - for include_file in data[build_file]['included_files'][1:]: - # |included_files| are relative to the directory of the |build_file|. - rel_include_file = \ - _ToGypPath(gyp.common.UnrelativePath(include_file, build_file)) - if _ToLocalPath(toplevel_dir, rel_include_file) in files: - if debug: - print('included gyp file modified, gyp_file=', build_file, - 'included file=', rel_include_file) - return True - return False - def _GetOrCreateTargetByName(targets, target_name): - """Creates or returns the Target at targets[target_name]. If there is no + """Creates or returns the Target at targets[target_name]. If there is no Target for |target_name| one is created. Returns a tuple of whether a new Target was created and the Target.""" - if target_name in targets: - return False, targets[target_name] - target = Target(target_name) - targets[target_name] = target - return True, target + if target_name in targets: + return False, targets[target_name] + target = Target(target_name) + targets[target_name] = target + return True, target def _DoesTargetTypeRequireBuild(target_dict): - """Returns true if the target type is such that it needs to be built.""" - # If a 'none' target has rules or actions we assume it requires a build. - return bool(target_dict['type'] != 'none' or - target_dict.get('actions') or target_dict.get('rules')) + """Returns true if the target type is such that it needs to be built.""" + # If a 'none' target has rules or actions we assume it requires a build. + return bool( + target_dict["type"] != "none" + or target_dict.get("actions") + or target_dict.get("rules") + ) -def _GenerateTargets(data, target_list, target_dicts, toplevel_dir, files, - build_files): - """Returns a tuple of the following: +def _GenerateTargets(data, target_list, target_dicts, toplevel_dir, files, build_files): + """Returns a tuple of the following: . A dictionary mapping from fully qualified name to Target. . A list of the targets that have a source file in |files|. . Targets that constitute the 'all' target. See description at top of file @@ -327,417 +347,463 @@ def _GenerateTargets(data, target_list, target_dicts, toplevel_dir, files, This sets the |match_status| of the targets that contain any of the source files in |files| to MATCH_STATUS_MATCHES. |toplevel_dir| is the root of the source tree.""" - # Maps from target name to Target. - name_to_target = {} - - # Targets that matched. - matching_targets = [] - - # Queue of targets to visit. - targets_to_visit = target_list[:] - - # Maps from build file to a boolean indicating whether the build file is in - # |files|. - build_file_in_files = {} - - # Root targets across all files. - roots = set() - - # Set of Targets in |build_files|. - build_file_targets = set() - - while len(targets_to_visit) > 0: - target_name = targets_to_visit.pop() - created_target, target = _GetOrCreateTargetByName(name_to_target, - target_name) - if created_target: - roots.add(target) - elif target.visited: - continue - - target.visited = True - target.requires_build = _DoesTargetTypeRequireBuild( - target_dicts[target_name]) - target_type = target_dicts[target_name]['type'] - target.is_executable = target_type == 'executable' - target.is_static_library = target_type == 'static_library' - target.is_or_has_linked_ancestor = (target_type == 'executable' or - target_type == 'shared_library') - - build_file = gyp.common.ParseQualifiedTarget(target_name)[0] - if not build_file in build_file_in_files: - build_file_in_files[build_file] = \ - _WasBuildFileModified(build_file, data, files, toplevel_dir) - - if build_file in build_files: - build_file_targets.add(target) - - # If a build file (or any of its included files) is modified we assume all - # targets in the file are modified. - if build_file_in_files[build_file]: - print('matching target from modified build file', target_name) - target.match_status = MATCH_STATUS_MATCHES - matching_targets.append(target) - else: - sources = _ExtractSources(target_name, target_dicts[target_name], - toplevel_dir) - for source in sources: - if _ToGypPath(os.path.normpath(source)) in files: - print('target', target_name, 'matches', source) - target.match_status = MATCH_STATUS_MATCHES - matching_targets.append(target) - break - - # Add dependencies to visit as well as updating back pointers for deps. - for dep in target_dicts[target_name].get('dependencies', []): - targets_to_visit.append(dep) - - created_dep_target, dep_target = _GetOrCreateTargetByName(name_to_target, - dep) - if not created_dep_target: - roots.discard(dep_target) - - target.deps.add(dep_target) - dep_target.back_deps.add(target) - - return name_to_target, matching_targets, roots & build_file_targets + # Maps from target name to Target. + name_to_target = {} + + # Targets that matched. + matching_targets = [] + + # Queue of targets to visit. + targets_to_visit = target_list[:] + + # Maps from build file to a boolean indicating whether the build file is in + # |files|. + build_file_in_files = {} + + # Root targets across all files. + roots = set() + + # Set of Targets in |build_files|. + build_file_targets = set() + + while len(targets_to_visit) > 0: + target_name = targets_to_visit.pop() + created_target, target = _GetOrCreateTargetByName(name_to_target, target_name) + if created_target: + roots.add(target) + elif target.visited: + continue + + target.visited = True + target.requires_build = _DoesTargetTypeRequireBuild(target_dicts[target_name]) + target_type = target_dicts[target_name]["type"] + target.is_executable = target_type == "executable" + target.is_static_library = target_type == "static_library" + target.is_or_has_linked_ancestor = ( + target_type == "executable" or target_type == "shared_library" + ) + + build_file = gyp.common.ParseQualifiedTarget(target_name)[0] + if build_file not in build_file_in_files: + build_file_in_files[build_file] = _WasBuildFileModified( + build_file, data, files, toplevel_dir + ) + + if build_file in build_files: + build_file_targets.add(target) + + # If a build file (or any of its included files) is modified we assume all + # targets in the file are modified. + if build_file_in_files[build_file]: + print("matching target from modified build file", target_name) + target.match_status = MATCH_STATUS_MATCHES + matching_targets.append(target) + else: + sources = _ExtractSources( + target_name, target_dicts[target_name], toplevel_dir + ) + for source in sources: + if _ToGypPath(os.path.normpath(source)) in files: + print("target", target_name, "matches", source) + target.match_status = MATCH_STATUS_MATCHES + matching_targets.append(target) + break + + # Add dependencies to visit as well as updating back pointers for deps. + for dep in target_dicts[target_name].get("dependencies", []): + targets_to_visit.append(dep) + + created_dep_target, dep_target = _GetOrCreateTargetByName( + name_to_target, dep + ) + if not created_dep_target: + roots.discard(dep_target) + + target.deps.add(dep_target) + dep_target.back_deps.add(target) + + return name_to_target, matching_targets, roots & build_file_targets def _GetUnqualifiedToTargetMapping(all_targets, to_find): - """Returns a tuple of the following: + """Returns a tuple of the following: . mapping (dictionary) from unqualified name to Target for all the Targets in |to_find|. . any target names not found. If this is empty all targets were found.""" - result = {} - if not to_find: - return {}, [] - to_find = set(to_find) - for target_name in all_targets.keys(): - extracted = gyp.common.ParseQualifiedTarget(target_name) - if len(extracted) > 1 and extracted[1] in to_find: - to_find.remove(extracted[1]) - result[extracted[1]] = all_targets[target_name] - if not to_find: - return result, [] - return result, [x for x in to_find] + result = {} + if not to_find: + return {}, [] + to_find = set(to_find) + for target_name in all_targets.keys(): + extracted = gyp.common.ParseQualifiedTarget(target_name) + if len(extracted) > 1 and extracted[1] in to_find: + to_find.remove(extracted[1]) + result[extracted[1]] = all_targets[target_name] + if not to_find: + return result, [] + return result, [x for x in to_find] def _DoesTargetDependOnMatchingTargets(target): - """Returns true if |target| or any of its dependencies is one of the + """Returns true if |target| or any of its dependencies is one of the targets containing the files supplied as input to analyzer. This updates |matches| of the Targets as it recurses. target: the Target to look for.""" - if target.match_status == MATCH_STATUS_DOESNT_MATCH: + if target.match_status == MATCH_STATUS_DOESNT_MATCH: + return False + if ( + target.match_status == MATCH_STATUS_MATCHES + or target.match_status == MATCH_STATUS_MATCHES_BY_DEPENDENCY + ): + return True + for dep in target.deps: + if _DoesTargetDependOnMatchingTargets(dep): + target.match_status = MATCH_STATUS_MATCHES_BY_DEPENDENCY + print("\t", target.name, "matches by dep", dep.name) + return True + target.match_status = MATCH_STATUS_DOESNT_MATCH return False - if target.match_status == MATCH_STATUS_MATCHES or \ - target.match_status == MATCH_STATUS_MATCHES_BY_DEPENDENCY: - return True - for dep in target.deps: - if _DoesTargetDependOnMatchingTargets(dep): - target.match_status = MATCH_STATUS_MATCHES_BY_DEPENDENCY - print('\t', target.name, 'matches by dep', dep.name) - return True - target.match_status = MATCH_STATUS_DOESNT_MATCH - return False def _GetTargetsDependingOnMatchingTargets(possible_targets): - """Returns the list of Targets in |possible_targets| that depend (either + """Returns the list of Targets in |possible_targets| that depend (either directly on indirectly) on at least one of the targets containing the files supplied as input to analyzer. possible_targets: targets to search from.""" - found = [] - print('Targets that matched by dependency:') - for target in possible_targets: - if _DoesTargetDependOnMatchingTargets(target): - found.append(target) - return found + found = [] + print("Targets that matched by dependency:") + for target in possible_targets: + if _DoesTargetDependOnMatchingTargets(target): + found.append(target) + return found def _AddCompileTargets(target, roots, add_if_no_ancestor, result): - """Recurses through all targets that depend on |target|, adding all targets + """Recurses through all targets that depend on |target|, adding all targets that need to be built (and are in |roots|) to |result|. roots: set of root targets. add_if_no_ancestor: If true and there are no ancestors of |target| then add |target| to |result|. |target| must still be in |roots|. result: targets that need to be built are added here.""" - if target.visited: - return - - target.visited = True - target.in_roots = target in roots - - for back_dep_target in target.back_deps: - _AddCompileTargets(back_dep_target, roots, False, result) - target.added_to_compile_targets |= back_dep_target.added_to_compile_targets - target.in_roots |= back_dep_target.in_roots - target.is_or_has_linked_ancestor |= ( - back_dep_target.is_or_has_linked_ancestor) - - # Always add 'executable' targets. Even though they may be built by other - # targets that depend upon them it makes detection of what is going to be - # built easier. - # And always add static_libraries that have no dependencies on them from - # linkables. This is necessary as the other dependencies on them may be - # static libraries themselves, which are not compile time dependencies. - if target.in_roots and \ - (target.is_executable or - (not target.added_to_compile_targets and - (add_if_no_ancestor or target.requires_build)) or - (target.is_static_library and add_if_no_ancestor and - not target.is_or_has_linked_ancestor)): - print('\t\tadding to compile targets', target.name, 'executable', - target.is_executable, 'added_to_compile_targets', - target.added_to_compile_targets, 'add_if_no_ancestor', - add_if_no_ancestor, 'requires_build', target.requires_build, - 'is_static_library', target.is_static_library, - 'is_or_has_linked_ancestor', target.is_or_has_linked_ancestor) - result.add(target) - target.added_to_compile_targets = True + if target.visited: + return + + target.visited = True + target.in_roots = target in roots + + for back_dep_target in target.back_deps: + _AddCompileTargets(back_dep_target, roots, False, result) + target.added_to_compile_targets |= back_dep_target.added_to_compile_targets + target.in_roots |= back_dep_target.in_roots + target.is_or_has_linked_ancestor |= back_dep_target.is_or_has_linked_ancestor + + # Always add 'executable' targets. Even though they may be built by other + # targets that depend upon them it makes detection of what is going to be + # built easier. + # And always add static_libraries that have no dependencies on them from + # linkables. This is necessary as the other dependencies on them may be + # static libraries themselves, which are not compile time dependencies. + if target.in_roots and ( + target.is_executable + or ( + not target.added_to_compile_targets + and (add_if_no_ancestor or target.requires_build) + ) + or ( + target.is_static_library + and add_if_no_ancestor + and not target.is_or_has_linked_ancestor + ) + ): + print( + "\t\tadding to compile targets", + target.name, + "executable", + target.is_executable, + "added_to_compile_targets", + target.added_to_compile_targets, + "add_if_no_ancestor", + add_if_no_ancestor, + "requires_build", + target.requires_build, + "is_static_library", + target.is_static_library, + "is_or_has_linked_ancestor", + target.is_or_has_linked_ancestor, + ) + result.add(target) + target.added_to_compile_targets = True def _GetCompileTargets(matching_targets, supplied_targets): - """Returns the set of Targets that require a build. + """Returns the set of Targets that require a build. matching_targets: targets that changed and need to be built. supplied_targets: set of targets supplied to analyzer to search from.""" - result = set() - for target in matching_targets: - print('finding compile targets for match', target.name) - _AddCompileTargets(target, supplied_targets, True, result) - return result + result = set() + for target in matching_targets: + print("finding compile targets for match", target.name) + _AddCompileTargets(target, supplied_targets, True, result) + return result def _WriteOutput(params, **values): - """Writes the output, either to stdout or a file is specified.""" - if 'error' in values: - print('Error:', values['error']) - if 'status' in values: - print(values['status']) - if 'targets' in values: - values['targets'].sort() - print('Supplied targets that depend on changed files:') - for target in values['targets']: - print('\t', target) - if 'invalid_targets' in values: - values['invalid_targets'].sort() - print('The following targets were not found:') - for target in values['invalid_targets']: - print('\t', target) - if 'build_targets' in values: - values['build_targets'].sort() - print('Targets that require a build:') - for target in values['build_targets']: - print('\t', target) - if 'compile_targets' in values: - values['compile_targets'].sort() - print('Targets that need to be built:') - for target in values['compile_targets']: - print('\t', target) - if 'test_targets' in values: - values['test_targets'].sort() - print('Test targets:') - for target in values['test_targets']: - print('\t', target) - - output_path = params.get('generator_flags', {}).get( - 'analyzer_output_path', None) - if not output_path: - print(json.dumps(values)) - return - try: - f = open(output_path, 'w') - f.write(json.dumps(values) + '\n') - f.close() - except IOError as e: - print('Error writing to output file', output_path, str(e)) + """Writes the output, either to stdout or a file is specified.""" + if "error" in values: + print("Error:", values["error"]) + if "status" in values: + print(values["status"]) + if "targets" in values: + values["targets"].sort() + print("Supplied targets that depend on changed files:") + for target in values["targets"]: + print("\t", target) + if "invalid_targets" in values: + values["invalid_targets"].sort() + print("The following targets were not found:") + for target in values["invalid_targets"]: + print("\t", target) + if "build_targets" in values: + values["build_targets"].sort() + print("Targets that require a build:") + for target in values["build_targets"]: + print("\t", target) + if "compile_targets" in values: + values["compile_targets"].sort() + print("Targets that need to be built:") + for target in values["compile_targets"]: + print("\t", target) + if "test_targets" in values: + values["test_targets"].sort() + print("Test targets:") + for target in values["test_targets"]: + print("\t", target) + + output_path = params.get("generator_flags", {}).get("analyzer_output_path", None) + if not output_path: + print(json.dumps(values)) + return + try: + f = open(output_path, "w") + f.write(json.dumps(values) + "\n") + f.close() + except IOError as e: + print("Error writing to output file", output_path, str(e)) def _WasGypIncludeFileModified(params, files): - """Returns true if one of the files in |files| is in the set of included + """Returns true if one of the files in |files| is in the set of included files.""" - if params['options'].includes: - for include in params['options'].includes: - if _ToGypPath(os.path.normpath(include)) in files: - print('Include file modified, assuming all changed', include) - return True - return False + if params["options"].includes: + for include in params["options"].includes: + if _ToGypPath(os.path.normpath(include)) in files: + print("Include file modified, assuming all changed", include) + return True + return False def _NamesNotIn(names, mapping): - """Returns a list of the values in |names| that are not in |mapping|.""" - return [name for name in names if name not in mapping] + """Returns a list of the values in |names| that are not in |mapping|.""" + return [name for name in names if name not in mapping] def _LookupTargets(names, mapping): - """Returns a list of the mapping[name] for each value in |names| that is in + """Returns a list of the mapping[name] for each value in |names| that is in |mapping|.""" - return [mapping[name] for name in names if name in mapping] + return [mapping[name] for name in names if name in mapping] def CalculateVariables(default_variables, params): - """Calculate additional variables for use in the build (called by gyp).""" - flavor = gyp.common.GetFlavor(params) - if flavor == 'mac': - default_variables.setdefault('OS', 'mac') - elif flavor == 'win': - default_variables.setdefault('OS', 'win') - # Copy additional generator configuration data from VS, which is shared - # by the Windows Ninja generator. - import gyp.generator.msvs as msvs_generator - generator_additional_non_configuration_keys = getattr(msvs_generator, - 'generator_additional_non_configuration_keys', []) - generator_additional_path_sections = getattr(msvs_generator, - 'generator_additional_path_sections', []) - - gyp.msvs_emulation.CalculateCommonVariables(default_variables, params) - else: - operating_system = flavor - if flavor == 'android': - operating_system = 'linux' # Keep this legacy behavior for now. - default_variables.setdefault('OS', operating_system) + """Calculate additional variables for use in the build (called by gyp).""" + flavor = gyp.common.GetFlavor(params) + if flavor == "mac": + default_variables.setdefault("OS", "mac") + elif flavor == "win": + default_variables.setdefault("OS", "win") + gyp.msvs_emulation.CalculateCommonVariables(default_variables, params) + else: + operating_system = flavor + if flavor == "android": + operating_system = "linux" # Keep this legacy behavior for now. + default_variables.setdefault("OS", operating_system) class TargetCalculator(object): - """Calculates the matching test_targets and matching compile_targets.""" - def __init__(self, files, additional_compile_target_names, test_target_names, - data, target_list, target_dicts, toplevel_dir, build_files): - self._additional_compile_target_names = set(additional_compile_target_names) - self._test_target_names = set(test_target_names) - self._name_to_target, self._changed_targets, self._root_targets = ( - _GenerateTargets(data, target_list, target_dicts, toplevel_dir, - frozenset(files), build_files)) - self._unqualified_mapping, self.invalid_targets = ( - _GetUnqualifiedToTargetMapping(self._name_to_target, - self._supplied_target_names_no_all())) - - def _supplied_target_names(self): - return self._additional_compile_target_names | self._test_target_names - - def _supplied_target_names_no_all(self): - """Returns the supplied test targets without 'all'.""" - result = self._supplied_target_names() - result.discard('all') - return result - - def is_build_impacted(self): - """Returns true if the supplied files impact the build at all.""" - return self._changed_targets - - def find_matching_test_target_names(self): - """Returns the set of output test targets.""" - assert self.is_build_impacted() - # Find the test targets first. 'all' is special cased to mean all the - # root targets. To deal with all the supplied |test_targets| are expanded - # to include the root targets during lookup. If any of the root targets - # match, we remove it and replace it with 'all'. - test_target_names_no_all = set(self._test_target_names) - test_target_names_no_all.discard('all') - test_targets_no_all = _LookupTargets(test_target_names_no_all, - self._unqualified_mapping) - test_target_names_contains_all = 'all' in self._test_target_names - if test_target_names_contains_all: - test_targets = [x for x in (set(test_targets_no_all) | - set(self._root_targets))] - else: - test_targets = [x for x in test_targets_no_all] - print('supplied test_targets') - for target_name in self._test_target_names: - print('\t', target_name) - print('found test_targets') - for target in test_targets: - print('\t', target.name) - print('searching for matching test targets') - matching_test_targets = _GetTargetsDependingOnMatchingTargets(test_targets) - matching_test_targets_contains_all = (test_target_names_contains_all and - set(matching_test_targets) & - set(self._root_targets)) - if matching_test_targets_contains_all: - # Remove any of the targets for all that were not explicitly supplied, - # 'all' is subsequentely added to the matching names below. - matching_test_targets = [x for x in (set(matching_test_targets) & - set(test_targets_no_all))] - print('matched test_targets') - for target in matching_test_targets: - print('\t', target.name) - matching_target_names = [gyp.common.ParseQualifiedTarget(target.name)[1] - for target in matching_test_targets] - if matching_test_targets_contains_all: - matching_target_names.append('all') - print('\tall') - return matching_target_names - - def find_matching_compile_target_names(self): - """Returns the set of output compile targets.""" - assert self.is_build_impacted() - # Compile targets are found by searching up from changed targets. - # Reset the visited status for _GetBuildTargets. - for target in self._name_to_target.values(): - target.visited = False - - supplied_targets = _LookupTargets(self._supplied_target_names_no_all(), - self._unqualified_mapping) - if 'all' in self._supplied_target_names(): - supplied_targets = [x for x in (set(supplied_targets) | - set(self._root_targets))] - print('Supplied test_targets & compile_targets') - for target in supplied_targets: - print('\t', target.name) - print('Finding compile targets') - compile_targets = _GetCompileTargets(self._changed_targets, - supplied_targets) - return [gyp.common.ParseQualifiedTarget(target.name)[1] - for target in compile_targets] + """Calculates the matching test_targets and matching compile_targets.""" + + def __init__( + self, + files, + additional_compile_target_names, + test_target_names, + data, + target_list, + target_dicts, + toplevel_dir, + build_files, + ): + self._additional_compile_target_names = set(additional_compile_target_names) + self._test_target_names = set(test_target_names) + ( + self._name_to_target, + self._changed_targets, + self._root_targets, + ) = _GenerateTargets( + data, target_list, target_dicts, toplevel_dir, frozenset(files), build_files + ) + ( + self._unqualified_mapping, + self.invalid_targets, + ) = _GetUnqualifiedToTargetMapping( + self._name_to_target, self._supplied_target_names_no_all() + ) + + def _supplied_target_names(self): + return self._additional_compile_target_names | self._test_target_names + + def _supplied_target_names_no_all(self): + """Returns the supplied test targets without 'all'.""" + result = self._supplied_target_names() + result.discard("all") + return result + + def is_build_impacted(self): + """Returns true if the supplied files impact the build at all.""" + return self._changed_targets + + def find_matching_test_target_names(self): + """Returns the set of output test targets.""" + assert self.is_build_impacted() + # Find the test targets first. 'all' is special cased to mean all the + # root targets. To deal with all the supplied |test_targets| are expanded + # to include the root targets during lookup. If any of the root targets + # match, we remove it and replace it with 'all'. + test_target_names_no_all = set(self._test_target_names) + test_target_names_no_all.discard("all") + test_targets_no_all = _LookupTargets( + test_target_names_no_all, self._unqualified_mapping + ) + test_target_names_contains_all = "all" in self._test_target_names + if test_target_names_contains_all: + test_targets = [ + x for x in (set(test_targets_no_all) | set(self._root_targets)) + ] + else: + test_targets = [x for x in test_targets_no_all] + print("supplied test_targets") + for target_name in self._test_target_names: + print("\t", target_name) + print("found test_targets") + for target in test_targets: + print("\t", target.name) + print("searching for matching test targets") + matching_test_targets = _GetTargetsDependingOnMatchingTargets(test_targets) + matching_test_targets_contains_all = test_target_names_contains_all and set( + matching_test_targets + ) & set(self._root_targets) + if matching_test_targets_contains_all: + # Remove any of the targets for all that were not explicitly supplied, + # 'all' is subsequentely added to the matching names below. + matching_test_targets = [ + x for x in (set(matching_test_targets) & set(test_targets_no_all)) + ] + print("matched test_targets") + for target in matching_test_targets: + print("\t", target.name) + matching_target_names = [ + gyp.common.ParseQualifiedTarget(target.name)[1] + for target in matching_test_targets + ] + if matching_test_targets_contains_all: + matching_target_names.append("all") + print("\tall") + return matching_target_names + + def find_matching_compile_target_names(self): + """Returns the set of output compile targets.""" + assert self.is_build_impacted() + # Compile targets are found by searching up from changed targets. + # Reset the visited status for _GetBuildTargets. + for target in self._name_to_target.values(): + target.visited = False + + supplied_targets = _LookupTargets( + self._supplied_target_names_no_all(), self._unqualified_mapping + ) + if "all" in self._supplied_target_names(): + supplied_targets = [ + x for x in (set(supplied_targets) | set(self._root_targets)) + ] + print("Supplied test_targets & compile_targets") + for target in supplied_targets: + print("\t", target.name) + print("Finding compile targets") + compile_targets = _GetCompileTargets(self._changed_targets, supplied_targets) + return [ + gyp.common.ParseQualifiedTarget(target.name)[1] + for target in compile_targets + ] def GenerateOutput(target_list, target_dicts, data, params): - """Called by gyp as the final stage. Outputs results.""" - config = Config() - try: - config.Init(params) - - if not config.files: - raise Exception('Must specify files to analyze via config_path generator ' - 'flag') - - toplevel_dir = _ToGypPath(os.path.abspath(params['options'].toplevel_dir)) - if debug: - print('toplevel_dir', toplevel_dir) - - if _WasGypIncludeFileModified(params, config.files): - result_dict = { 'status': all_changed_string, - 'test_targets': list(config.test_target_names), - 'compile_targets': list( - config.additional_compile_target_names | - config.test_target_names) } - _WriteOutput(params, **result_dict) - return - - calculator = TargetCalculator(config.files, - config.additional_compile_target_names, - config.test_target_names, data, - target_list, target_dicts, toplevel_dir, - params['build_files']) - if not calculator.is_build_impacted(): - result_dict = { 'status': no_dependency_string, - 'test_targets': [], - 'compile_targets': [] } - if calculator.invalid_targets: - result_dict['invalid_targets'] = calculator.invalid_targets - _WriteOutput(params, **result_dict) - return - - test_target_names = calculator.find_matching_test_target_names() - compile_target_names = calculator.find_matching_compile_target_names() - found_at_least_one_target = compile_target_names or test_target_names - result_dict = { 'test_targets': test_target_names, - 'status': found_dependency_string if - found_at_least_one_target else no_dependency_string, - 'compile_targets': list( - set(compile_target_names) | - set(test_target_names)) } - if calculator.invalid_targets: - result_dict['invalid_targets'] = calculator.invalid_targets - _WriteOutput(params, **result_dict) - - except Exception as e: - _WriteOutput(params, error=str(e)) + """Called by gyp as the final stage. Outputs results.""" + config = Config() + try: + config.Init(params) + + if not config.files: + raise Exception( + "Must specify files to analyze via config_path generator " "flag" + ) + + toplevel_dir = _ToGypPath(os.path.abspath(params["options"].toplevel_dir)) + if debug: + print("toplevel_dir", toplevel_dir) + + if _WasGypIncludeFileModified(params, config.files): + result_dict = { + "status": all_changed_string, + "test_targets": list(config.test_target_names), + "compile_targets": list( + config.additional_compile_target_names | config.test_target_names + ), + } + _WriteOutput(params, **result_dict) + return + + calculator = TargetCalculator( + config.files, + config.additional_compile_target_names, + config.test_target_names, + data, + target_list, + target_dicts, + toplevel_dir, + params["build_files"], + ) + if not calculator.is_build_impacted(): + result_dict = { + "status": no_dependency_string, + "test_targets": [], + "compile_targets": [], + } + if calculator.invalid_targets: + result_dict["invalid_targets"] = calculator.invalid_targets + _WriteOutput(params, **result_dict) + return + + test_target_names = calculator.find_matching_test_target_names() + compile_target_names = calculator.find_matching_compile_target_names() + found_at_least_one_target = compile_target_names or test_target_names + result_dict = { + "test_targets": test_target_names, + "status": found_dependency_string + if found_at_least_one_target + else no_dependency_string, + "compile_targets": list(set(compile_target_names) | set(test_target_names)), + } + if calculator.invalid_targets: + result_dict["invalid_targets"] = calculator.invalid_targets + _WriteOutput(params, **result_dict) + + except Exception as e: + _WriteOutput(params, error=str(e)) diff --git a/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/android.py b/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/android.py index cecb28c3660b5e..3ac61008b96f4d 100644 --- a/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/android.py +++ b/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/android.py @@ -24,24 +24,24 @@ import subprocess generator_default_variables = { - 'OS': 'android', - 'EXECUTABLE_PREFIX': '', - 'EXECUTABLE_SUFFIX': '', - 'STATIC_LIB_PREFIX': 'lib', - 'SHARED_LIB_PREFIX': 'lib', - 'STATIC_LIB_SUFFIX': '.a', - 'SHARED_LIB_SUFFIX': '.so', - 'INTERMEDIATE_DIR': '$(gyp_intermediate_dir)', - 'SHARED_INTERMEDIATE_DIR': '$(gyp_shared_intermediate_dir)', - 'PRODUCT_DIR': '$(gyp_shared_intermediate_dir)', - 'SHARED_LIB_DIR': '$(builddir)/lib.$(TOOLSET)', - 'LIB_DIR': '$(obj).$(TOOLSET)', - 'RULE_INPUT_ROOT': '%(INPUT_ROOT)s', # This gets expanded by Python. - 'RULE_INPUT_DIRNAME': '%(INPUT_DIRNAME)s', # This gets expanded by Python. - 'RULE_INPUT_PATH': '$(RULE_SOURCES)', - 'RULE_INPUT_EXT': '$(suffix $<)', - 'RULE_INPUT_NAME': '$(notdir $<)', - 'CONFIGURATION_NAME': '$(GYP_CONFIGURATION)', + "OS": "android", + "EXECUTABLE_PREFIX": "", + "EXECUTABLE_SUFFIX": "", + "STATIC_LIB_PREFIX": "lib", + "SHARED_LIB_PREFIX": "lib", + "STATIC_LIB_SUFFIX": ".a", + "SHARED_LIB_SUFFIX": ".so", + "INTERMEDIATE_DIR": "$(gyp_intermediate_dir)", + "SHARED_INTERMEDIATE_DIR": "$(gyp_shared_intermediate_dir)", + "PRODUCT_DIR": "$(gyp_shared_intermediate_dir)", + "SHARED_LIB_DIR": "$(builddir)/lib.$(TOOLSET)", + "LIB_DIR": "$(obj).$(TOOLSET)", + "RULE_INPUT_ROOT": "%(INPUT_ROOT)s", # This gets expanded by Python. + "RULE_INPUT_DIRNAME": "%(INPUT_DIRNAME)s", # This gets expanded by Python. + "RULE_INPUT_PATH": "$(RULE_SOURCES)", + "RULE_INPUT_EXT": "$(suffix $<)", + "RULE_INPUT_NAME": "$(notdir $<)", + "CONFIGURATION_NAME": "$(GYP_CONFIGURATION)", } # Make supports multiple toolsets @@ -51,9 +51,9 @@ # Generator-specific gyp specs. generator_additional_non_configuration_keys = [ # Boolean to declare that this target does not want its name mangled. - 'android_unmangled_name', + "android_unmangled_name", # Map of android build system variables to set. - 'aosp_build_settings', + "aosp_build_settings", ] generator_additional_path_sections = [] generator_extra_sources_for_rules = [] @@ -72,20 +72,20 @@ # Map gyp target types to Android module classes. MODULE_CLASSES = { - 'static_library': 'STATIC_LIBRARIES', - 'shared_library': 'SHARED_LIBRARIES', - 'executable': 'EXECUTABLES', + "static_library": "STATIC_LIBRARIES", + "shared_library": "SHARED_LIBRARIES", + "executable": "EXECUTABLES", } def IsCPPExtension(ext): - return make.COMPILABLE_EXTENSIONS.get(ext) == 'cxx' + return make.COMPILABLE_EXTENSIONS.get(ext) == "cxx" def Sourceify(path): - """Convert a path to its source directory form. The Android backend does not + """Convert a path to its source directory form. The Android backend does not support options.generator_output, so this function is a noop.""" - return path + return path # Map from qualified target to path to output. @@ -101,17 +101,27 @@ def Sourceify(path): class AndroidMkWriter(object): - """AndroidMkWriter packages up the writing of one target-specific Android.mk. + """AndroidMkWriter packages up the writing of one target-specific Android.mk. Its only real entry point is Write(), and is mostly used for namespacing. """ - def __init__(self, android_top_dir): - self.android_top_dir = android_top_dir - - def Write(self, qualified_target, relative_target, base_path, output_filename, - spec, configs, part_of_all, write_alias_target, sdk_version): - """The main entry point: writes a .mk file for a single target. + def __init__(self, android_top_dir): + self.android_top_dir = android_top_dir + + def Write( + self, + qualified_target, + relative_target, + base_path, + output_filename, + spec, + configs, + part_of_all, + write_alias_target, + sdk_version, + ): + """The main entry point: writes a .mk file for a single target. Arguments: qualified_target: target we're generating @@ -125,114 +135,124 @@ def Write(self, qualified_target, relative_target, base_path, output_filename, this target sdk_version: what to emit for LOCAL_SDK_VERSION in output """ - gyp.common.EnsureDirExists(output_filename) - - self.fp = open(output_filename, 'w') - - self.fp.write(header) - - self.qualified_target = qualified_target - self.relative_target = relative_target - self.path = base_path - self.target = spec['target_name'] - self.type = spec['type'] - self.toolset = spec['toolset'] - - deps, link_deps = self.ComputeDeps(spec) - - # Some of the generation below can add extra output, sources, or - # link dependencies. All of the out params of the functions that - # follow use names like extra_foo. - extra_outputs = [] - extra_sources = [] - - self.android_class = MODULE_CLASSES.get(self.type, 'GYP') - self.android_module = self.ComputeAndroidModule(spec) - (self.android_stem, self.android_suffix) = self.ComputeOutputParts(spec) - self.output = self.output_binary = self.ComputeOutput(spec) - - # Standard header. - self.WriteLn('include $(CLEAR_VARS)\n') - - # Module class and name. - self.WriteLn('LOCAL_MODULE_CLASS := ' + self.android_class) - self.WriteLn('LOCAL_MODULE := ' + self.android_module) - # Only emit LOCAL_MODULE_STEM if it's different to LOCAL_MODULE. - # The library module classes fail if the stem is set. ComputeOutputParts - # makes sure that stem == modulename in these cases. - if self.android_stem != self.android_module: - self.WriteLn('LOCAL_MODULE_STEM := ' + self.android_stem) - self.WriteLn('LOCAL_MODULE_SUFFIX := ' + self.android_suffix) - if self.toolset == 'host': - self.WriteLn('LOCAL_IS_HOST_MODULE := true') - self.WriteLn('LOCAL_MULTILIB := $(GYP_HOST_MULTILIB)') - elif sdk_version > 0: - self.WriteLn('LOCAL_MODULE_TARGET_ARCH := ' - '$(TARGET_$(GYP_VAR_PREFIX)ARCH)') - self.WriteLn('LOCAL_SDK_VERSION := %s' % sdk_version) - - # Grab output directories; needed for Actions and Rules. - if self.toolset == 'host': - self.WriteLn('gyp_intermediate_dir := ' - '$(call local-intermediates-dir,,$(GYP_HOST_VAR_PREFIX))') - else: - self.WriteLn('gyp_intermediate_dir := ' - '$(call local-intermediates-dir,,$(GYP_VAR_PREFIX))') - self.WriteLn('gyp_shared_intermediate_dir := ' - '$(call intermediates-dir-for,GYP,shared,,,$(GYP_VAR_PREFIX))') - self.WriteLn() - - # List files this target depends on so that actions/rules/copies/sources - # can depend on the list. - # TODO: doesn't pull in things through transitive link deps; needed? - target_dependencies = [x[1] for x in deps if x[0] == 'path'] - self.WriteLn('# Make sure our deps are built first.') - self.WriteList(target_dependencies, 'GYP_TARGET_DEPENDENCIES', - local_pathify=True) - - # Actions must come first, since they can generate more OBJs for use below. - if 'actions' in spec: - self.WriteActions(spec['actions'], extra_sources, extra_outputs) - - # Rules must be early like actions. - if 'rules' in spec: - self.WriteRules(spec['rules'], extra_sources, extra_outputs) - - if 'copies' in spec: - self.WriteCopies(spec['copies'], extra_outputs) - - # GYP generated outputs. - self.WriteList(extra_outputs, 'GYP_GENERATED_OUTPUTS', local_pathify=True) - - # Set LOCAL_ADDITIONAL_DEPENDENCIES so that Android's build rules depend - # on both our dependency targets and our generated files. - self.WriteLn('# Make sure our deps and generated files are built first.') - self.WriteLn('LOCAL_ADDITIONAL_DEPENDENCIES := $(GYP_TARGET_DEPENDENCIES) ' - '$(GYP_GENERATED_OUTPUTS)') - self.WriteLn() - - # Sources. - if spec.get('sources', []) or extra_sources: - self.WriteSources(spec, configs, extra_sources) - - self.WriteTarget(spec, configs, deps, link_deps, part_of_all, - write_alias_target) - - # Update global list of target outputs, used in dependency tracking. - target_outputs[qualified_target] = ('path', self.output_binary) - - # Update global list of link dependencies. - if self.type == 'static_library': - target_link_deps[qualified_target] = ('static', self.android_module) - elif self.type == 'shared_library': - target_link_deps[qualified_target] = ('shared', self.android_module) - - self.fp.close() - return self.android_module - - - def WriteActions(self, actions, extra_sources, extra_outputs): - """Write Makefile code for any 'actions' from the gyp input. + gyp.common.EnsureDirExists(output_filename) + + self.fp = open(output_filename, "w") + + self.fp.write(header) + + self.qualified_target = qualified_target + self.relative_target = relative_target + self.path = base_path + self.target = spec["target_name"] + self.type = spec["type"] + self.toolset = spec["toolset"] + + deps, link_deps = self.ComputeDeps(spec) + + # Some of the generation below can add extra output, sources, or + # link dependencies. All of the out params of the functions that + # follow use names like extra_foo. + extra_outputs = [] + extra_sources = [] + + self.android_class = MODULE_CLASSES.get(self.type, "GYP") + self.android_module = self.ComputeAndroidModule(spec) + (self.android_stem, self.android_suffix) = self.ComputeOutputParts(spec) + self.output = self.output_binary = self.ComputeOutput(spec) + + # Standard header. + self.WriteLn("include $(CLEAR_VARS)\n") + + # Module class and name. + self.WriteLn("LOCAL_MODULE_CLASS := " + self.android_class) + self.WriteLn("LOCAL_MODULE := " + self.android_module) + # Only emit LOCAL_MODULE_STEM if it's different to LOCAL_MODULE. + # The library module classes fail if the stem is set. ComputeOutputParts + # makes sure that stem == modulename in these cases. + if self.android_stem != self.android_module: + self.WriteLn("LOCAL_MODULE_STEM := " + self.android_stem) + self.WriteLn("LOCAL_MODULE_SUFFIX := " + self.android_suffix) + if self.toolset == "host": + self.WriteLn("LOCAL_IS_HOST_MODULE := true") + self.WriteLn("LOCAL_MULTILIB := $(GYP_HOST_MULTILIB)") + elif sdk_version > 0: + self.WriteLn( + "LOCAL_MODULE_TARGET_ARCH := " "$(TARGET_$(GYP_VAR_PREFIX)ARCH)" + ) + self.WriteLn("LOCAL_SDK_VERSION := %s" % sdk_version) + + # Grab output directories; needed for Actions and Rules. + if self.toolset == "host": + self.WriteLn( + "gyp_intermediate_dir := " + "$(call local-intermediates-dir,,$(GYP_HOST_VAR_PREFIX))" + ) + else: + self.WriteLn( + "gyp_intermediate_dir := " + "$(call local-intermediates-dir,,$(GYP_VAR_PREFIX))" + ) + self.WriteLn( + "gyp_shared_intermediate_dir := " + "$(call intermediates-dir-for,GYP,shared,,,$(GYP_VAR_PREFIX))" + ) + self.WriteLn() + + # List files this target depends on so that actions/rules/copies/sources + # can depend on the list. + # TODO: doesn't pull in things through transitive link deps; needed? + target_dependencies = [x[1] for x in deps if x[0] == "path"] + self.WriteLn("# Make sure our deps are built first.") + self.WriteList( + target_dependencies, "GYP_TARGET_DEPENDENCIES", local_pathify=True + ) + + # Actions must come first, since they can generate more OBJs for use below. + if "actions" in spec: + self.WriteActions(spec["actions"], extra_sources, extra_outputs) + + # Rules must be early like actions. + if "rules" in spec: + self.WriteRules(spec["rules"], extra_sources, extra_outputs) + + if "copies" in spec: + self.WriteCopies(spec["copies"], extra_outputs) + + # GYP generated outputs. + self.WriteList(extra_outputs, "GYP_GENERATED_OUTPUTS", local_pathify=True) + + # Set LOCAL_ADDITIONAL_DEPENDENCIES so that Android's build rules depend + # on both our dependency targets and our generated files. + self.WriteLn("# Make sure our deps and generated files are built first.") + self.WriteLn( + "LOCAL_ADDITIONAL_DEPENDENCIES := $(GYP_TARGET_DEPENDENCIES) " + "$(GYP_GENERATED_OUTPUTS)" + ) + self.WriteLn() + + # Sources. + if spec.get("sources", []) or extra_sources: + self.WriteSources(spec, configs, extra_sources) + + self.WriteTarget( + spec, configs, deps, link_deps, part_of_all, write_alias_target + ) + + # Update global list of target outputs, used in dependency tracking. + target_outputs[qualified_target] = ("path", self.output_binary) + + # Update global list of link dependencies. + if self.type == "static_library": + target_link_deps[qualified_target] = ("static", self.android_module) + elif self.type == "shared_library": + target_link_deps[qualified_target] = ("shared", self.android_module) + + self.fp.close() + return self.android_module + + def WriteActions(self, actions, extra_sources, extra_outputs): + """Write Makefile code for any 'actions' from the gyp input. extra_sources: a list that will be filled in with newly generated source files, if any @@ -240,266 +260,300 @@ def WriteActions(self, actions, extra_sources, extra_outputs): actions (used to make other pieces dependent on these actions) """ - for action in actions: - name = make.StringToMakefileVariable('%s_%s' % (self.relative_target, - action['action_name'])) - self.WriteLn('### Rules for action "%s":' % action['action_name']) - inputs = action['inputs'] - outputs = action['outputs'] - - # Build up a list of outputs. - # Collect the output dirs we'll need. - dirs = set() - for out in outputs: - if not out.startswith('$'): - print('WARNING: Action for target "%s" writes output to local path ' - '"%s".' % (self.target, out)) - dir = os.path.split(out)[0] - if dir: - dirs.add(dir) - if int(action.get('process_outputs_as_sources', False)): - extra_sources += outputs - - # Prepare the actual command. - command = gyp.common.EncodePOSIXShellList(action['action']) - if 'message' in action: - quiet_cmd = 'Gyp action: %s ($@)' % action['message'] - else: - quiet_cmd = 'Gyp action: %s ($@)' % name - if len(dirs) > 0: - command = 'mkdir -p %s' % ' '.join(dirs) + '; ' + command - - cd_action = 'cd $(gyp_local_path)/%s; ' % self.path - command = cd_action + command - - # The makefile rules are all relative to the top dir, but the gyp actions - # are defined relative to their containing dir. This replaces the gyp_* - # variables for the action rule with an absolute version so that the - # output goes in the right place. - # Only write the gyp_* rules for the "primary" output (:1); - # it's superfluous for the "extra outputs", and this avoids accidentally - # writing duplicate dummy rules for those outputs. - main_output = make.QuoteSpaces(self.LocalPathify(outputs[0])) - self.WriteLn('%s: gyp_local_path := $(LOCAL_PATH)' % main_output) - self.WriteLn('%s: gyp_var_prefix := $(GYP_VAR_PREFIX)' % main_output) - self.WriteLn('%s: gyp_intermediate_dir := ' - '$(abspath $(gyp_intermediate_dir))' % main_output) - self.WriteLn('%s: gyp_shared_intermediate_dir := ' - '$(abspath $(gyp_shared_intermediate_dir))' % main_output) - - # Android's envsetup.sh adds a number of directories to the path including - # the built host binary directory. This causes actions/rules invoked by - # gyp to sometimes use these instead of system versions, e.g. bison. - # The built host binaries may not be suitable, and can cause errors. - # So, we remove them from the PATH using the ANDROID_BUILD_PATHS variable - # set by envsetup. - self.WriteLn('%s: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))' - % main_output) - - # Don't allow spaces in input/output filenames, but make an exception for - # filenames which start with '$(' since it's okay for there to be spaces - # inside of make function/macro invocations. - for input in inputs: - if not input.startswith('$(') and ' ' in input: - raise gyp.common.GypError( - 'Action input filename "%s" in target %s contains a space' % - (input, self.target)) - for output in outputs: - if not output.startswith('$(') and ' ' in output: - raise gyp.common.GypError( - 'Action output filename "%s" in target %s contains a space' % - (output, self.target)) - - self.WriteLn('%s: %s $(GYP_TARGET_DEPENDENCIES)' % - (main_output, ' '.join(map(self.LocalPathify, inputs)))) - self.WriteLn('\t@echo "%s"' % quiet_cmd) - self.WriteLn('\t$(hide)%s\n' % command) - for output in outputs[1:]: - # Make each output depend on the main output, with an empty command - # to force make to notice that the mtime has changed. - self.WriteLn('%s: %s ;' % (self.LocalPathify(output), main_output)) - - extra_outputs += outputs - self.WriteLn() - - self.WriteLn() - - - def WriteRules(self, rules, extra_sources, extra_outputs): - """Write Makefile code for any 'rules' from the gyp input. + for action in actions: + name = make.StringToMakefileVariable( + "%s_%s" % (self.relative_target, action["action_name"]) + ) + self.WriteLn('### Rules for action "%s":' % action["action_name"]) + inputs = action["inputs"] + outputs = action["outputs"] + + # Build up a list of outputs. + # Collect the output dirs we'll need. + dirs = set() + for out in outputs: + if not out.startswith("$"): + print( + 'WARNING: Action for target "%s" writes output to local path ' + '"%s".' % (self.target, out) + ) + dir = os.path.split(out)[0] + if dir: + dirs.add(dir) + if int(action.get("process_outputs_as_sources", False)): + extra_sources += outputs + + # Prepare the actual command. + command = gyp.common.EncodePOSIXShellList(action["action"]) + if "message" in action: + quiet_cmd = "Gyp action: %s ($@)" % action["message"] + else: + quiet_cmd = "Gyp action: %s ($@)" % name + if len(dirs) > 0: + command = "mkdir -p %s" % " ".join(dirs) + "; " + command + + cd_action = "cd $(gyp_local_path)/%s; " % self.path + command = cd_action + command + + # The makefile rules are all relative to the top dir, but the gyp actions + # are defined relative to their containing dir. This replaces the gyp_* + # variables for the action rule with an absolute version so that the + # output goes in the right place. + # Only write the gyp_* rules for the "primary" output (:1); + # it's superfluous for the "extra outputs", and this avoids accidentally + # writing duplicate dummy rules for those outputs. + main_output = make.QuoteSpaces(self.LocalPathify(outputs[0])) + self.WriteLn("%s: gyp_local_path := $(LOCAL_PATH)" % main_output) + self.WriteLn("%s: gyp_var_prefix := $(GYP_VAR_PREFIX)" % main_output) + self.WriteLn( + "%s: gyp_intermediate_dir := " + "$(abspath $(gyp_intermediate_dir))" % main_output + ) + self.WriteLn( + "%s: gyp_shared_intermediate_dir := " + "$(abspath $(gyp_shared_intermediate_dir))" % main_output + ) + + # Android's envsetup.sh adds a number of directories to the path including + # the built host binary directory. This causes actions/rules invoked by + # gyp to sometimes use these instead of system versions, e.g. bison. + # The built host binaries may not be suitable, and can cause errors. + # So, we remove them from the PATH using the ANDROID_BUILD_PATHS variable + # set by envsetup. + self.WriteLn( + "%s: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))" + % main_output + ) + + # Don't allow spaces in input/output filenames, but make an exception for + # filenames which start with '$(' since it's okay for there to be spaces + # inside of make function/macro invocations. + for input in inputs: + if not input.startswith("$(") and " " in input: + raise gyp.common.GypError( + 'Action input filename "%s" in target %s contains a space' + % (input, self.target) + ) + for output in outputs: + if not output.startswith("$(") and " " in output: + raise gyp.common.GypError( + 'Action output filename "%s" in target %s contains a space' + % (output, self.target) + ) + + self.WriteLn( + "%s: %s $(GYP_TARGET_DEPENDENCIES)" + % (main_output, " ".join(map(self.LocalPathify, inputs))) + ) + self.WriteLn('\t@echo "%s"' % quiet_cmd) + self.WriteLn("\t$(hide)%s\n" % command) + for output in outputs[1:]: + # Make each output depend on the main output, with an empty command + # to force make to notice that the mtime has changed. + self.WriteLn("%s: %s ;" % (self.LocalPathify(output), main_output)) + + extra_outputs += outputs + self.WriteLn() + + self.WriteLn() + + def WriteRules(self, rules, extra_sources, extra_outputs): + """Write Makefile code for any 'rules' from the gyp input. extra_sources: a list that will be filled in with newly generated source files, if any extra_outputs: a list that will be filled in with any outputs of these rules (used to make other pieces dependent on these rules) """ - if len(rules) == 0: - return - - for rule in rules: - if len(rule.get('rule_sources', [])) == 0: - continue - name = make.StringToMakefileVariable('%s_%s' % (self.relative_target, - rule['rule_name'])) - self.WriteLn('\n### Generated for rule "%s":' % name) - self.WriteLn('# "%s":' % rule) - - inputs = rule.get('inputs') - for rule_source in rule.get('rule_sources', []): - (rule_source_dirname, rule_source_basename) = os.path.split(rule_source) - (rule_source_root, rule_source_ext) = \ - os.path.splitext(rule_source_basename) - - outputs = [self.ExpandInputRoot(out, rule_source_root, - rule_source_dirname) - for out in rule['outputs']] - - dirs = set() - for out in outputs: - if not out.startswith('$'): - print('WARNING: Rule for target %s writes output to local path %s' - % (self.target, out)) - dir = os.path.dirname(out) - if dir: - dirs.add(dir) - extra_outputs += outputs - if int(rule.get('process_outputs_as_sources', False)): - extra_sources.extend(outputs) - - components = [] - for component in rule['action']: - component = self.ExpandInputRoot(component, rule_source_root, - rule_source_dirname) - if '$(RULE_SOURCES)' in component: - component = component.replace('$(RULE_SOURCES)', - rule_source) - components.append(component) - - command = gyp.common.EncodePOSIXShellList(components) - cd_action = 'cd $(gyp_local_path)/%s; ' % self.path - command = cd_action + command - if dirs: - command = 'mkdir -p %s' % ' '.join(dirs) + '; ' + command - - # We set up a rule to build the first output, and then set up - # a rule for each additional output to depend on the first. - outputs = map(self.LocalPathify, outputs) - main_output = outputs[0] - self.WriteLn('%s: gyp_local_path := $(LOCAL_PATH)' % main_output) - self.WriteLn('%s: gyp_var_prefix := $(GYP_VAR_PREFIX)' % main_output) - self.WriteLn('%s: gyp_intermediate_dir := ' - '$(abspath $(gyp_intermediate_dir))' % main_output) - self.WriteLn('%s: gyp_shared_intermediate_dir := ' - '$(abspath $(gyp_shared_intermediate_dir))' % main_output) - - # See explanation in WriteActions. - self.WriteLn('%s: export PATH := ' - '$(subst $(ANDROID_BUILD_PATHS),,$(PATH))' % main_output) - - main_output_deps = self.LocalPathify(rule_source) - if inputs: - main_output_deps += ' ' - main_output_deps += ' '.join([self.LocalPathify(f) for f in inputs]) - - self.WriteLn('%s: %s $(GYP_TARGET_DEPENDENCIES)' % - (main_output, main_output_deps)) - self.WriteLn('\t%s\n' % command) - for output in outputs[1:]: - # Make each output depend on the main output, with an empty command - # to force make to notice that the mtime has changed. - self.WriteLn('%s: %s ;' % (output, main_output)) - self.WriteLn() - - self.WriteLn() + if len(rules) == 0: + return + + for rule in rules: + if len(rule.get("rule_sources", [])) == 0: + continue + name = make.StringToMakefileVariable( + "%s_%s" % (self.relative_target, rule["rule_name"]) + ) + self.WriteLn('\n### Generated for rule "%s":' % name) + self.WriteLn('# "%s":' % rule) + + inputs = rule.get("inputs") + for rule_source in rule.get("rule_sources", []): + (rule_source_dirname, rule_source_basename) = os.path.split(rule_source) + (rule_source_root, rule_source_ext) = os.path.splitext( + rule_source_basename + ) + + outputs = [ + self.ExpandInputRoot(out, rule_source_root, rule_source_dirname) + for out in rule["outputs"] + ] + + dirs = set() + for out in outputs: + if not out.startswith("$"): + print( + "WARNING: Rule for target %s writes output to local path %s" + % (self.target, out) + ) + dir = os.path.dirname(out) + if dir: + dirs.add(dir) + extra_outputs += outputs + if int(rule.get("process_outputs_as_sources", False)): + extra_sources.extend(outputs) + + components = [] + for component in rule["action"]: + component = self.ExpandInputRoot( + component, rule_source_root, rule_source_dirname + ) + if "$(RULE_SOURCES)" in component: + component = component.replace("$(RULE_SOURCES)", rule_source) + components.append(component) + + command = gyp.common.EncodePOSIXShellList(components) + cd_action = "cd $(gyp_local_path)/%s; " % self.path + command = cd_action + command + if dirs: + command = "mkdir -p %s" % " ".join(dirs) + "; " + command + + # We set up a rule to build the first output, and then set up + # a rule for each additional output to depend on the first. + outputs = map(self.LocalPathify, outputs) + main_output = outputs[0] + self.WriteLn("%s: gyp_local_path := $(LOCAL_PATH)" % main_output) + self.WriteLn("%s: gyp_var_prefix := $(GYP_VAR_PREFIX)" % main_output) + self.WriteLn( + "%s: gyp_intermediate_dir := " + "$(abspath $(gyp_intermediate_dir))" % main_output + ) + self.WriteLn( + "%s: gyp_shared_intermediate_dir := " + "$(abspath $(gyp_shared_intermediate_dir))" % main_output + ) + + # See explanation in WriteActions. + self.WriteLn( + "%s: export PATH := " + "$(subst $(ANDROID_BUILD_PATHS),,$(PATH))" % main_output + ) + + main_output_deps = self.LocalPathify(rule_source) + if inputs: + main_output_deps += " " + main_output_deps += " ".join([self.LocalPathify(f) for f in inputs]) + + self.WriteLn( + "%s: %s $(GYP_TARGET_DEPENDENCIES)" + % (main_output, main_output_deps) + ) + self.WriteLn("\t%s\n" % command) + for output in outputs[1:]: + # Make each output depend on the main output, with an empty command + # to force make to notice that the mtime has changed. + self.WriteLn("%s: %s ;" % (output, main_output)) + self.WriteLn() + self.WriteLn() - def WriteCopies(self, copies, extra_outputs): - """Write Makefile code for any 'copies' from the gyp input. + def WriteCopies(self, copies, extra_outputs): + """Write Makefile code for any 'copies' from the gyp input. extra_outputs: a list that will be filled in with any outputs of this action (used to make other pieces dependent on this action) """ - self.WriteLn('### Generated for copy rule.') - - variable = make.StringToMakefileVariable(self.relative_target + '_copies') - outputs = [] - for copy in copies: - for path in copy['files']: - # The Android build system does not allow generation of files into the - # source tree. The destination should start with a variable, which will - # typically be $(gyp_intermediate_dir) or - # $(gyp_shared_intermediate_dir). Note that we can't use an assertion - # because some of the gyp tests depend on this. - if not copy['destination'].startswith('$'): - print('WARNING: Copy rule for target %s writes output to ' - 'local path %s' % (self.target, copy['destination'])) - - # LocalPathify() calls normpath, stripping trailing slashes. - path = Sourceify(self.LocalPathify(path)) - filename = os.path.split(path)[1] - output = Sourceify(self.LocalPathify(os.path.join(copy['destination'], - filename))) - - self.WriteLn('%s: %s $(GYP_TARGET_DEPENDENCIES) | $(ACP)' % - (output, path)) - self.WriteLn('\t@echo Copying: $@') - self.WriteLn('\t$(hide) mkdir -p $(dir $@)') - self.WriteLn('\t$(hide) $(ACP) -rpf $< $@') + self.WriteLn("### Generated for copy rule.") + + variable = make.StringToMakefileVariable(self.relative_target + "_copies") + outputs = [] + for copy in copies: + for path in copy["files"]: + # The Android build system does not allow generation of files into the + # source tree. The destination should start with a variable, which will + # typically be $(gyp_intermediate_dir) or + # $(gyp_shared_intermediate_dir). Note that we can't use an assertion + # because some of the gyp tests depend on this. + if not copy["destination"].startswith("$"): + print( + "WARNING: Copy rule for target %s writes output to " + "local path %s" % (self.target, copy["destination"]) + ) + + # LocalPathify() calls normpath, stripping trailing slashes. + path = Sourceify(self.LocalPathify(path)) + filename = os.path.split(path)[1] + output = Sourceify( + self.LocalPathify(os.path.join(copy["destination"], filename)) + ) + + self.WriteLn( + "%s: %s $(GYP_TARGET_DEPENDENCIES) | $(ACP)" % (output, path) + ) + self.WriteLn("\t@echo Copying: $@") + self.WriteLn("\t$(hide) mkdir -p $(dir $@)") + self.WriteLn("\t$(hide) $(ACP) -rpf $< $@") + self.WriteLn() + outputs.append(output) + self.WriteLn("%s = %s" % (variable, " ".join(map(make.QuoteSpaces, outputs)))) + extra_outputs.append("$(%s)" % variable) self.WriteLn() - outputs.append(output) - self.WriteLn('%s = %s' % (variable, - ' '.join(map(make.QuoteSpaces, outputs)))) - extra_outputs.append('$(%s)' % variable) - self.WriteLn() - - def WriteSourceFlags(self, spec, configs): - """Write out the flags and include paths used to compile source files for + def WriteSourceFlags(self, spec, configs): + """Write out the flags and include paths used to compile source files for the current target. Args: spec, configs: input from gyp. """ - for configname, config in sorted(configs.items()): - extracted_includes = [] - - self.WriteLn('\n# Flags passed to both C and C++ files.') - cflags, includes_from_cflags = self.ExtractIncludesFromCFlags( - config.get('cflags', []) + config.get('cflags_c', [])) - extracted_includes.extend(includes_from_cflags) - self.WriteList(cflags, 'MY_CFLAGS_%s' % configname) - - self.WriteList(config.get('defines'), 'MY_DEFS_%s' % configname, - prefix='-D', quoter=make.EscapeCppDefine) - - self.WriteLn('\n# Include paths placed before CFLAGS/CPPFLAGS') - includes = list(config.get('include_dirs', [])) - includes.extend(extracted_includes) - includes = map(Sourceify, map(self.LocalPathify, includes)) - includes = self.NormalizeIncludePaths(includes) - self.WriteList(includes, 'LOCAL_C_INCLUDES_%s' % configname) - - self.WriteLn('\n# Flags passed to only C++ (and not C) files.') - self.WriteList(config.get('cflags_cc'), 'LOCAL_CPPFLAGS_%s' % configname) - - self.WriteLn('\nLOCAL_CFLAGS := $(MY_CFLAGS_$(GYP_CONFIGURATION)) ' - '$(MY_DEFS_$(GYP_CONFIGURATION))') - # Undefine ANDROID for host modules - # TODO: the source code should not use macro ANDROID to tell if it's host - # or target module. - if self.toolset == 'host': - self.WriteLn('# Undefine ANDROID for host modules') - self.WriteLn('LOCAL_CFLAGS += -UANDROID') - self.WriteLn('LOCAL_C_INCLUDES := $(GYP_COPIED_SOURCE_ORIGIN_DIRS) ' - '$(LOCAL_C_INCLUDES_$(GYP_CONFIGURATION))') - self.WriteLn('LOCAL_CPPFLAGS := $(LOCAL_CPPFLAGS_$(GYP_CONFIGURATION))') - # Android uses separate flags for assembly file invocations, but gyp expects - # the same CFLAGS to be applied: - self.WriteLn('LOCAL_ASFLAGS := $(LOCAL_CFLAGS)') - - - def WriteSources(self, spec, configs, extra_sources): - """Write Makefile code for any 'sources' from the gyp input. + for configname, config in sorted(configs.items()): + extracted_includes = [] + + self.WriteLn("\n# Flags passed to both C and C++ files.") + cflags, includes_from_cflags = self.ExtractIncludesFromCFlags( + config.get("cflags", []) + config.get("cflags_c", []) + ) + extracted_includes.extend(includes_from_cflags) + self.WriteList(cflags, "MY_CFLAGS_%s" % configname) + + self.WriteList( + config.get("defines"), + "MY_DEFS_%s" % configname, + prefix="-D", + quoter=make.EscapeCppDefine, + ) + + self.WriteLn("\n# Include paths placed before CFLAGS/CPPFLAGS") + includes = list(config.get("include_dirs", [])) + includes.extend(extracted_includes) + includes = map(Sourceify, map(self.LocalPathify, includes)) + includes = self.NormalizeIncludePaths(includes) + self.WriteList(includes, "LOCAL_C_INCLUDES_%s" % configname) + + self.WriteLn("\n# Flags passed to only C++ (and not C) files.") + self.WriteList(config.get("cflags_cc"), "LOCAL_CPPFLAGS_%s" % configname) + + self.WriteLn( + "\nLOCAL_CFLAGS := $(MY_CFLAGS_$(GYP_CONFIGURATION)) " + "$(MY_DEFS_$(GYP_CONFIGURATION))" + ) + # Undefine ANDROID for host modules + # TODO: the source code should not use macro ANDROID to tell if it's host + # or target module. + if self.toolset == "host": + self.WriteLn("# Undefine ANDROID for host modules") + self.WriteLn("LOCAL_CFLAGS += -UANDROID") + self.WriteLn( + "LOCAL_C_INCLUDES := $(GYP_COPIED_SOURCE_ORIGIN_DIRS) " + "$(LOCAL_C_INCLUDES_$(GYP_CONFIGURATION))" + ) + self.WriteLn("LOCAL_CPPFLAGS := $(LOCAL_CPPFLAGS_$(GYP_CONFIGURATION))") + # Android uses separate flags for assembly file invocations, but gyp expects + # the same CFLAGS to be applied: + self.WriteLn("LOCAL_ASFLAGS := $(LOCAL_CFLAGS)") + + def WriteSources(self, spec, configs, extra_sources): + """Write Makefile code for any 'sources' from the gyp input. These are source files necessary to build the current target. We need to handle shared_intermediate directory source files as a special case by copying them to the intermediate directory and @@ -510,187 +564,192 @@ def WriteSources(self, spec, configs, extra_sources): spec, configs: input from gyp. extra_sources: Sources generated from Actions or Rules. """ - sources = filter(make.Compilable, spec.get('sources', [])) - generated_not_sources = [x for x in extra_sources if not make.Compilable(x)] - extra_sources = filter(make.Compilable, extra_sources) - - # Determine and output the C++ extension used by these sources. - # We simply find the first C++ file and use that extension. - all_sources = sources + extra_sources - local_cpp_extension = '.cpp' - for source in all_sources: - (root, ext) = os.path.splitext(source) - if IsCPPExtension(ext): - local_cpp_extension = ext - break - if local_cpp_extension != '.cpp': - self.WriteLn('LOCAL_CPP_EXTENSION := %s' % local_cpp_extension) - - # We need to move any non-generated sources that are coming from the - # shared intermediate directory out of LOCAL_SRC_FILES and put them - # into LOCAL_GENERATED_SOURCES. We also need to move over any C++ files - # that don't match our local_cpp_extension, since Android will only - # generate Makefile rules for a single LOCAL_CPP_EXTENSION. - local_files = [] - for source in sources: - (root, ext) = os.path.splitext(source) - if '$(gyp_shared_intermediate_dir)' in source: - extra_sources.append(source) - elif '$(gyp_intermediate_dir)' in source: - extra_sources.append(source) - elif IsCPPExtension(ext) and ext != local_cpp_extension: - extra_sources.append(source) - else: - local_files.append(os.path.normpath(os.path.join(self.path, source))) - - # For any generated source, if it is coming from the shared intermediate - # directory then we add a Make rule to copy them to the local intermediate - # directory first. This is because the Android LOCAL_GENERATED_SOURCES - # must be in the local module intermediate directory for the compile rules - # to work properly. If the file has the wrong C++ extension, then we add - # a rule to copy that to intermediates and use the new version. - final_generated_sources = [] - # If a source file gets copied, we still need to add the original source - # directory as header search path, for GCC searches headers in the - # directory that contains the source file by default. - origin_src_dirs = [] - for source in extra_sources: - local_file = source - if not '$(gyp_intermediate_dir)/' in local_file: - basename = os.path.basename(local_file) - local_file = '$(gyp_intermediate_dir)/' + basename - (root, ext) = os.path.splitext(local_file) - if IsCPPExtension(ext) and ext != local_cpp_extension: - local_file = root + local_cpp_extension - if local_file != source: - self.WriteLn('%s: %s' % (local_file, self.LocalPathify(source))) - self.WriteLn('\tmkdir -p $(@D); cp $< $@') - origin_src_dirs.append(os.path.dirname(source)) - final_generated_sources.append(local_file) - - # We add back in all of the non-compilable stuff to make sure that the - # make rules have dependencies on them. - final_generated_sources.extend(generated_not_sources) - self.WriteList(final_generated_sources, 'LOCAL_GENERATED_SOURCES') - - origin_src_dirs = gyp.common.uniquer(origin_src_dirs) - origin_src_dirs = map(Sourceify, map(self.LocalPathify, origin_src_dirs)) - self.WriteList(origin_src_dirs, 'GYP_COPIED_SOURCE_ORIGIN_DIRS') - - self.WriteList(local_files, 'LOCAL_SRC_FILES') - - # Write out the flags used to compile the source; this must be done last - # so that GYP_COPIED_SOURCE_ORIGIN_DIRS can be used as an include path. - self.WriteSourceFlags(spec, configs) - - - def ComputeAndroidModule(self, spec): - """Return the Android module name used for a gyp spec. + sources = filter(make.Compilable, spec.get("sources", [])) + generated_not_sources = [x for x in extra_sources if not make.Compilable(x)] + extra_sources = filter(make.Compilable, extra_sources) + + # Determine and output the C++ extension used by these sources. + # We simply find the first C++ file and use that extension. + all_sources = sources + extra_sources + local_cpp_extension = ".cpp" + for source in all_sources: + (root, ext) = os.path.splitext(source) + if IsCPPExtension(ext): + local_cpp_extension = ext + break + if local_cpp_extension != ".cpp": + self.WriteLn("LOCAL_CPP_EXTENSION := %s" % local_cpp_extension) + + # We need to move any non-generated sources that are coming from the + # shared intermediate directory out of LOCAL_SRC_FILES and put them + # into LOCAL_GENERATED_SOURCES. We also need to move over any C++ files + # that don't match our local_cpp_extension, since Android will only + # generate Makefile rules for a single LOCAL_CPP_EXTENSION. + local_files = [] + for source in sources: + (root, ext) = os.path.splitext(source) + if "$(gyp_shared_intermediate_dir)" in source: + extra_sources.append(source) + elif "$(gyp_intermediate_dir)" in source: + extra_sources.append(source) + elif IsCPPExtension(ext) and ext != local_cpp_extension: + extra_sources.append(source) + else: + local_files.append(os.path.normpath(os.path.join(self.path, source))) + + # For any generated source, if it is coming from the shared intermediate + # directory then we add a Make rule to copy them to the local intermediate + # directory first. This is because the Android LOCAL_GENERATED_SOURCES + # must be in the local module intermediate directory for the compile rules + # to work properly. If the file has the wrong C++ extension, then we add + # a rule to copy that to intermediates and use the new version. + final_generated_sources = [] + # If a source file gets copied, we still need to add the original source + # directory as header search path, for GCC searches headers in the + # directory that contains the source file by default. + origin_src_dirs = [] + for source in extra_sources: + local_file = source + if "$(gyp_intermediate_dir)/" not in local_file: + basename = os.path.basename(local_file) + local_file = "$(gyp_intermediate_dir)/" + basename + (root, ext) = os.path.splitext(local_file) + if IsCPPExtension(ext) and ext != local_cpp_extension: + local_file = root + local_cpp_extension + if local_file != source: + self.WriteLn("%s: %s" % (local_file, self.LocalPathify(source))) + self.WriteLn("\tmkdir -p $(@D); cp $< $@") + origin_src_dirs.append(os.path.dirname(source)) + final_generated_sources.append(local_file) + + # We add back in all of the non-compilable stuff to make sure that the + # make rules have dependencies on them. + final_generated_sources.extend(generated_not_sources) + self.WriteList(final_generated_sources, "LOCAL_GENERATED_SOURCES") + + origin_src_dirs = gyp.common.uniquer(origin_src_dirs) + origin_src_dirs = map(Sourceify, map(self.LocalPathify, origin_src_dirs)) + self.WriteList(origin_src_dirs, "GYP_COPIED_SOURCE_ORIGIN_DIRS") + + self.WriteList(local_files, "LOCAL_SRC_FILES") + + # Write out the flags used to compile the source; this must be done last + # so that GYP_COPIED_SOURCE_ORIGIN_DIRS can be used as an include path. + self.WriteSourceFlags(spec, configs) + + def ComputeAndroidModule(self, spec): + """Return the Android module name used for a gyp spec. We use the complete qualified target name to avoid collisions between duplicate targets in different directories. We also add a suffix to distinguish gyp-generated module names. """ - if int(spec.get('android_unmangled_name', 0)): - assert self.type != 'shared_library' or self.target.startswith('lib') - return self.target - - if self.type == 'shared_library': - # For reasons of convention, the Android build system requires that all - # shared library modules are named 'libfoo' when generating -l flags. - prefix = 'lib_' - else: - prefix = '' + if int(spec.get("android_unmangled_name", 0)): + assert self.type != "shared_library" or self.target.startswith("lib") + return self.target - if spec['toolset'] == 'host': - suffix = '_$(TARGET_$(GYP_VAR_PREFIX)ARCH)_host_gyp' - else: - suffix = '_gyp' + if self.type == "shared_library": + # For reasons of convention, the Android build system requires that all + # shared library modules are named 'libfoo' when generating -l flags. + prefix = "lib_" + else: + prefix = "" - if self.path: - middle = make.StringToMakefileVariable('%s_%s' % (self.path, self.target)) - else: - middle = make.StringToMakefileVariable(self.target) + if spec["toolset"] == "host": + suffix = "_$(TARGET_$(GYP_VAR_PREFIX)ARCH)_host_gyp" + else: + suffix = "_gyp" - return ''.join([prefix, middle, suffix]) + if self.path: + middle = make.StringToMakefileVariable("%s_%s" % (self.path, self.target)) + else: + middle = make.StringToMakefileVariable(self.target) + return "".join([prefix, middle, suffix]) - def ComputeOutputParts(self, spec): - """Return the 'output basename' of a gyp spec, split into filename + ext. + def ComputeOutputParts(self, spec): + """Return the 'output basename' of a gyp spec, split into filename + ext. Android libraries must be named the same thing as their module name, otherwise the linker can't find them, so product_name and so on must be ignored if we are building a library, and the "lib" prepending is not done for Android. """ - assert self.type != 'loadable_module' # TODO: not supported? - - target = spec['target_name'] - target_prefix = '' - target_ext = '' - if self.type == 'static_library': - target = self.ComputeAndroidModule(spec) - target_ext = '.a' - elif self.type == 'shared_library': - target = self.ComputeAndroidModule(spec) - target_ext = '.so' - elif self.type == 'none': - target_ext = '.stamp' - elif self.type != 'executable': - print("ERROR: What output file should be generated?", - "type", self.type, "target", target) - - if self.type != 'static_library' and self.type != 'shared_library': - target_prefix = spec.get('product_prefix', target_prefix) - target = spec.get('product_name', target) - product_ext = spec.get('product_extension') - if product_ext: - target_ext = '.' + product_ext - - target_stem = target_prefix + target - return (target_stem, target_ext) - - - def ComputeOutputBasename(self, spec): - """Return the 'output basename' of a gyp spec. + assert self.type != "loadable_module" # TODO: not supported? + + target = spec["target_name"] + target_prefix = "" + target_ext = "" + if self.type == "static_library": + target = self.ComputeAndroidModule(spec) + target_ext = ".a" + elif self.type == "shared_library": + target = self.ComputeAndroidModule(spec) + target_ext = ".so" + elif self.type == "none": + target_ext = ".stamp" + elif self.type != "executable": + print( + "ERROR: What output file should be generated?", + "type", + self.type, + "target", + target, + ) + + if self.type != "static_library" and self.type != "shared_library": + target_prefix = spec.get("product_prefix", target_prefix) + target = spec.get("product_name", target) + product_ext = spec.get("product_extension") + if product_ext: + target_ext = "." + product_ext + + target_stem = target_prefix + target + return (target_stem, target_ext) + + def ComputeOutputBasename(self, spec): + """Return the 'output basename' of a gyp spec. E.g., the loadable module 'foobar' in directory 'baz' will produce 'libfoobar.so' """ - return ''.join(self.ComputeOutputParts(spec)) - + return "".join(self.ComputeOutputParts(spec)) - def ComputeOutput(self, spec): - """Return the 'output' (full output path) of a gyp spec. + def ComputeOutput(self, spec): + """Return the 'output' (full output path) of a gyp spec. E.g., the loadable module 'foobar' in directory 'baz' will produce '$(obj)/baz/libfoobar.so' """ - if self.type == 'executable': - # We install host executables into shared_intermediate_dir so they can be - # run by gyp rules that refer to PRODUCT_DIR. - path = '$(gyp_shared_intermediate_dir)' - elif self.type == 'shared_library': - if self.toolset == 'host': - path = '$($(GYP_HOST_VAR_PREFIX)HOST_OUT_INTERMEDIATE_LIBRARIES)' - else: - path = '$($(GYP_VAR_PREFIX)TARGET_OUT_INTERMEDIATE_LIBRARIES)' - else: - # Other targets just get built into their intermediate dir. - if self.toolset == 'host': - path = ('$(call intermediates-dir-for,%s,%s,true,,' - '$(GYP_HOST_VAR_PREFIX))' % (self.android_class, - self.android_module)) - else: - path = ('$(call intermediates-dir-for,%s,%s,,,$(GYP_VAR_PREFIX))' - % (self.android_class, self.android_module)) - - assert spec.get('product_dir') is None # TODO: not supported? - return os.path.join(path, self.ComputeOutputBasename(spec)) - - def NormalizeIncludePaths(self, include_paths): - """ Normalize include_paths. + if self.type == "executable": + # We install host executables into shared_intermediate_dir so they can be + # run by gyp rules that refer to PRODUCT_DIR. + path = "$(gyp_shared_intermediate_dir)" + elif self.type == "shared_library": + if self.toolset == "host": + path = "$($(GYP_HOST_VAR_PREFIX)HOST_OUT_INTERMEDIATE_LIBRARIES)" + else: + path = "$($(GYP_VAR_PREFIX)TARGET_OUT_INTERMEDIATE_LIBRARIES)" + else: + # Other targets just get built into their intermediate dir. + if self.toolset == "host": + path = ( + "$(call intermediates-dir-for,%s,%s,true,," + "$(GYP_HOST_VAR_PREFIX))" + % (self.android_class, self.android_module) + ) + else: + path = "$(call intermediates-dir-for,%s,%s,,,$(GYP_VAR_PREFIX))" % ( + self.android_class, + self.android_module, + ) + + assert spec.get("product_dir") is None # TODO: not supported? + return os.path.join(path, self.ComputeOutputBasename(spec)) + + def NormalizeIncludePaths(self, include_paths): + """ Normalize include_paths. Convert absolute paths to relative to the Android top directory. Args: @@ -698,33 +757,33 @@ def NormalizeIncludePaths(self, include_paths): Returns: A list of normalized include paths. """ - normalized = [] - for path in include_paths: - if path[0] == '/': - path = gyp.common.RelativePath(path, self.android_top_dir) - normalized.append(path) - return normalized + normalized = [] + for path in include_paths: + if path[0] == "/": + path = gyp.common.RelativePath(path, self.android_top_dir) + normalized.append(path) + return normalized - def ExtractIncludesFromCFlags(self, cflags): - """Extract includes "-I..." out from cflags + def ExtractIncludesFromCFlags(self, cflags): + """Extract includes "-I..." out from cflags Args: cflags: A list of compiler flags, which may be mixed with "-I.." Returns: A tuple of lists: (clean_clfags, include_paths). "-I.." is trimmed. """ - clean_cflags = [] - include_paths = [] - for flag in cflags: - if flag.startswith('-I'): - include_paths.append(flag[2:]) - else: - clean_cflags.append(flag) + clean_cflags = [] + include_paths = [] + for flag in cflags: + if flag.startswith("-I"): + include_paths.append(flag[2:]) + else: + clean_cflags.append(flag) - return (clean_cflags, include_paths) + return (clean_cflags, include_paths) - def FilterLibraries(self, libraries): - """Filter the 'libraries' key to separate things that shouldn't be ldflags. + def FilterLibraries(self, libraries): + """Filter the 'libraries' key to separate things that shouldn't be ldflags. Library entries that look like filenames should be converted to android module names instead of being passed to the linker as flags. @@ -734,96 +793,103 @@ def FilterLibraries(self, libraries): Returns: A tuple (static_lib_modules, dynamic_lib_modules, ldflags) """ - static_lib_modules = [] - dynamic_lib_modules = [] - ldflags = [] - for libs in libraries: - # Libs can have multiple words. - for lib in libs.split(): - # Filter the system libraries, which are added by default by the Android - # build system. - if (lib == '-lc' or lib == '-lstdc++' or lib == '-lm' or - lib.endswith('libgcc.a')): - continue - match = re.search(r'([^/]+)\.a$', lib) - if match: - static_lib_modules.append(match.group(1)) - continue - match = re.search(r'([^/]+)\.so$', lib) - if match: - dynamic_lib_modules.append(match.group(1)) - continue - if lib.startswith('-l'): - ldflags.append(lib) - return (static_lib_modules, dynamic_lib_modules, ldflags) - - - def ComputeDeps(self, spec): - """Compute the dependencies of a gyp spec. + static_lib_modules = [] + dynamic_lib_modules = [] + ldflags = [] + for libs in libraries: + # Libs can have multiple words. + for lib in libs.split(): + # Filter the system libraries, which are added by default by the Android + # build system. + if ( + lib == "-lc" + or lib == "-lstdc++" + or lib == "-lm" + or lib.endswith("libgcc.a") + ): + continue + match = re.search(r"([^/]+)\.a$", lib) + if match: + static_lib_modules.append(match.group(1)) + continue + match = re.search(r"([^/]+)\.so$", lib) + if match: + dynamic_lib_modules.append(match.group(1)) + continue + if lib.startswith("-l"): + ldflags.append(lib) + return (static_lib_modules, dynamic_lib_modules, ldflags) + + def ComputeDeps(self, spec): + """Compute the dependencies of a gyp spec. Returns a tuple (deps, link_deps), where each is a list of filenames that will need to be put in front of make for either building (deps) or linking (link_deps). """ - deps = [] - link_deps = [] - if 'dependencies' in spec: - deps.extend([target_outputs[dep] for dep in spec['dependencies'] - if target_outputs[dep]]) - for dep in spec['dependencies']: - if dep in target_link_deps: - link_deps.append(target_link_deps[dep]) - deps.extend(link_deps) - return (gyp.common.uniquer(deps), gyp.common.uniquer(link_deps)) - - - def WriteTargetFlags(self, spec, configs, link_deps): - """Write Makefile code to specify the link flags and library dependencies. + deps = [] + link_deps = [] + if "dependencies" in spec: + deps.extend( + [ + target_outputs[dep] + for dep in spec["dependencies"] + if target_outputs[dep] + ] + ) + for dep in spec["dependencies"]: + if dep in target_link_deps: + link_deps.append(target_link_deps[dep]) + deps.extend(link_deps) + return (gyp.common.uniquer(deps), gyp.common.uniquer(link_deps)) + + def WriteTargetFlags(self, spec, configs, link_deps): + """Write Makefile code to specify the link flags and library dependencies. spec, configs: input from gyp. link_deps: link dependency list; see ComputeDeps() """ - # Libraries (i.e. -lfoo) - # These must be included even for static libraries as some of them provide - # implicit include paths through the build system. - libraries = gyp.common.uniquer(spec.get('libraries', [])) - static_libs, dynamic_libs, ldflags_libs = self.FilterLibraries(libraries) - - if self.type != 'static_library': - for configname, config in sorted(configs.items()): - ldflags = list(config.get('ldflags', [])) - self.WriteLn('') - self.WriteList(ldflags, 'LOCAL_LDFLAGS_%s' % configname) - self.WriteList(ldflags_libs, 'LOCAL_GYP_LIBS') - self.WriteLn('LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION)) ' - '$(LOCAL_GYP_LIBS)') - - # Link dependencies (i.e. other gyp targets this target depends on) - # These need not be included for static libraries as within the gyp build - # we do not use the implicit include path mechanism. - if self.type != 'static_library': - static_link_deps = [x[1] for x in link_deps if x[0] == 'static'] - shared_link_deps = [x[1] for x in link_deps if x[0] == 'shared'] - else: - static_link_deps = [] - shared_link_deps = [] - - # Only write the lists if they are non-empty. - if static_libs or static_link_deps: - self.WriteLn('') - self.WriteList(static_libs + static_link_deps, - 'LOCAL_STATIC_LIBRARIES') - self.WriteLn('# Enable grouping to fix circular references') - self.WriteLn('LOCAL_GROUP_STATIC_LIBRARIES := true') - if dynamic_libs or shared_link_deps: - self.WriteLn('') - self.WriteList(dynamic_libs + shared_link_deps, - 'LOCAL_SHARED_LIBRARIES') - - - def WriteTarget(self, spec, configs, deps, link_deps, part_of_all, - write_alias_target): - """Write Makefile code to produce the final target of the gyp spec. + # Libraries (i.e. -lfoo) + # These must be included even for static libraries as some of them provide + # implicit include paths through the build system. + libraries = gyp.common.uniquer(spec.get("libraries", [])) + static_libs, dynamic_libs, ldflags_libs = self.FilterLibraries(libraries) + + if self.type != "static_library": + for configname, config in sorted(configs.items()): + ldflags = list(config.get("ldflags", [])) + self.WriteLn("") + self.WriteList(ldflags, "LOCAL_LDFLAGS_%s" % configname) + self.WriteList(ldflags_libs, "LOCAL_GYP_LIBS") + self.WriteLn( + "LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION)) " + "$(LOCAL_GYP_LIBS)" + ) + + # Link dependencies (i.e. other gyp targets this target depends on) + # These need not be included for static libraries as within the gyp build + # we do not use the implicit include path mechanism. + if self.type != "static_library": + static_link_deps = [x[1] for x in link_deps if x[0] == "static"] + shared_link_deps = [x[1] for x in link_deps if x[0] == "shared"] + else: + static_link_deps = [] + shared_link_deps = [] + + # Only write the lists if they are non-empty. + if static_libs or static_link_deps: + self.WriteLn("") + self.WriteList(static_libs + static_link_deps, "LOCAL_STATIC_LIBRARIES") + self.WriteLn("# Enable grouping to fix circular references") + self.WriteLn("LOCAL_GROUP_STATIC_LIBRARIES := true") + if dynamic_libs or shared_link_deps: + self.WriteLn("") + self.WriteList(dynamic_libs + shared_link_deps, "LOCAL_SHARED_LIBRARIES") + + def WriteTarget( + self, spec, configs, deps, link_deps, part_of_all, write_alias_target + ): + """Write Makefile code to produce the final target of the gyp spec. spec, configs: input from gyp. deps, link_deps: dependency lists; see ComputeDeps() @@ -831,267 +897,278 @@ def WriteTarget(self, spec, configs, deps, link_deps, part_of_all, write_alias_target: flag indicating whether to create short aliases for this target """ - self.WriteLn('### Rules for final target.') - - if self.type != 'none': - self.WriteTargetFlags(spec, configs, link_deps) - - settings = spec.get('aosp_build_settings', {}) - if settings: - self.WriteLn('### Set directly by aosp_build_settings.') - for k, v in settings.items(): - if isinstance(v, list): - self.WriteList(v, k) + self.WriteLn("### Rules for final target.") + + if self.type != "none": + self.WriteTargetFlags(spec, configs, link_deps) + + settings = spec.get("aosp_build_settings", {}) + if settings: + self.WriteLn("### Set directly by aosp_build_settings.") + for k, v in settings.items(): + if isinstance(v, list): + self.WriteList(v, k) + else: + self.WriteLn("%s := %s" % (k, make.QuoteIfNecessary(v))) + self.WriteLn("") + + # Add to the set of targets which represent the gyp 'all' target. We use the + # name 'gyp_all_modules' as the Android build system doesn't allow the use + # of the Make target 'all' and because 'all_modules' is the equivalent of + # the Make target 'all' on Android. + if part_of_all and write_alias_target: + self.WriteLn('# Add target alias to "gyp_all_modules" target.') + self.WriteLn(".PHONY: gyp_all_modules") + self.WriteLn("gyp_all_modules: %s" % self.android_module) + self.WriteLn("") + + # Add an alias from the gyp target name to the Android module name. This + # simplifies manual builds of the target, and is required by the test + # framework. + if self.target != self.android_module and write_alias_target: + self.WriteLn("# Alias gyp target name.") + self.WriteLn(".PHONY: %s" % self.target) + self.WriteLn("%s: %s" % (self.target, self.android_module)) + self.WriteLn("") + + # Add the command to trigger build of the target type depending + # on the toolset. Ex: BUILD_STATIC_LIBRARY vs. BUILD_HOST_STATIC_LIBRARY + # NOTE: This has to come last! + modifier = "" + if self.toolset == "host": + modifier = "HOST_" + if self.type == "static_library": + self.WriteLn("include $(BUILD_%sSTATIC_LIBRARY)" % modifier) + elif self.type == "shared_library": + self.WriteLn("LOCAL_PRELINK_MODULE := false") + self.WriteLn("include $(BUILD_%sSHARED_LIBRARY)" % modifier) + elif self.type == "executable": + self.WriteLn("LOCAL_CXX_STL := libc++_static") + # Executables are for build and test purposes only, so they're installed + # to a directory that doesn't get included in the system image. + self.WriteLn("LOCAL_MODULE_PATH := $(gyp_shared_intermediate_dir)") + self.WriteLn("include $(BUILD_%sEXECUTABLE)" % modifier) else: - self.WriteLn('%s := %s' % (k, make.QuoteIfNecessary(v))) - self.WriteLn('') - - # Add to the set of targets which represent the gyp 'all' target. We use the - # name 'gyp_all_modules' as the Android build system doesn't allow the use - # of the Make target 'all' and because 'all_modules' is the equivalent of - # the Make target 'all' on Android. - if part_of_all and write_alias_target: - self.WriteLn('# Add target alias to "gyp_all_modules" target.') - self.WriteLn('.PHONY: gyp_all_modules') - self.WriteLn('gyp_all_modules: %s' % self.android_module) - self.WriteLn('') - - # Add an alias from the gyp target name to the Android module name. This - # simplifies manual builds of the target, and is required by the test - # framework. - if self.target != self.android_module and write_alias_target: - self.WriteLn('# Alias gyp target name.') - self.WriteLn('.PHONY: %s' % self.target) - self.WriteLn('%s: %s' % (self.target, self.android_module)) - self.WriteLn('') - - # Add the command to trigger build of the target type depending - # on the toolset. Ex: BUILD_STATIC_LIBRARY vs. BUILD_HOST_STATIC_LIBRARY - # NOTE: This has to come last! - modifier = '' - if self.toolset == 'host': - modifier = 'HOST_' - if self.type == 'static_library': - self.WriteLn('include $(BUILD_%sSTATIC_LIBRARY)' % modifier) - elif self.type == 'shared_library': - self.WriteLn('LOCAL_PRELINK_MODULE := false') - self.WriteLn('include $(BUILD_%sSHARED_LIBRARY)' % modifier) - elif self.type == 'executable': - self.WriteLn('LOCAL_CXX_STL := libc++_static') - # Executables are for build and test purposes only, so they're installed - # to a directory that doesn't get included in the system image. - self.WriteLn('LOCAL_MODULE_PATH := $(gyp_shared_intermediate_dir)') - self.WriteLn('include $(BUILD_%sEXECUTABLE)' % modifier) - else: - self.WriteLn('LOCAL_MODULE_PATH := $(PRODUCT_OUT)/gyp_stamp') - self.WriteLn('LOCAL_UNINSTALLABLE_MODULE := true') - if self.toolset == 'target': - self.WriteLn('LOCAL_2ND_ARCH_VAR_PREFIX := $(GYP_VAR_PREFIX)') - else: - self.WriteLn('LOCAL_2ND_ARCH_VAR_PREFIX := $(GYP_HOST_VAR_PREFIX)') - self.WriteLn() - self.WriteLn('include $(BUILD_SYSTEM)/base_rules.mk') - self.WriteLn() - self.WriteLn('$(LOCAL_BUILT_MODULE): $(LOCAL_ADDITIONAL_DEPENDENCIES)') - self.WriteLn('\t$(hide) echo "Gyp timestamp: $@"') - self.WriteLn('\t$(hide) mkdir -p $(dir $@)') - self.WriteLn('\t$(hide) touch $@') - self.WriteLn() - self.WriteLn('LOCAL_2ND_ARCH_VAR_PREFIX :=') - - - def WriteList(self, value_list, variable=None, prefix='', - quoter=make.QuoteIfNecessary, local_pathify=False): - """Write a variable definition that is a list of values. + self.WriteLn("LOCAL_MODULE_PATH := $(PRODUCT_OUT)/gyp_stamp") + self.WriteLn("LOCAL_UNINSTALLABLE_MODULE := true") + if self.toolset == "target": + self.WriteLn("LOCAL_2ND_ARCH_VAR_PREFIX := $(GYP_VAR_PREFIX)") + else: + self.WriteLn("LOCAL_2ND_ARCH_VAR_PREFIX := $(GYP_HOST_VAR_PREFIX)") + self.WriteLn() + self.WriteLn("include $(BUILD_SYSTEM)/base_rules.mk") + self.WriteLn() + self.WriteLn("$(LOCAL_BUILT_MODULE): $(LOCAL_ADDITIONAL_DEPENDENCIES)") + self.WriteLn('\t$(hide) echo "Gyp timestamp: $@"') + self.WriteLn("\t$(hide) mkdir -p $(dir $@)") + self.WriteLn("\t$(hide) touch $@") + self.WriteLn() + self.WriteLn("LOCAL_2ND_ARCH_VAR_PREFIX :=") + + def WriteList( + self, + value_list, + variable=None, + prefix="", + quoter=make.QuoteIfNecessary, + local_pathify=False, + ): + """Write a variable definition that is a list of values. E.g. WriteList(['a','b'], 'foo', prefix='blah') writes out foo = blaha blahb but in a pretty-printed style. """ - values = '' - if value_list: - value_list = [quoter(prefix + l) for l in value_list] - if local_pathify: - value_list = [self.LocalPathify(l) for l in value_list] - values = ' \\\n\t' + ' \\\n\t'.join(value_list) - self.fp.write('%s :=%s\n\n' % (variable, values)) - - - def WriteLn(self, text=''): - self.fp.write(text + '\n') - - - def LocalPathify(self, path): - """Convert a subdirectory-relative path into a normalized path which starts + values = "" + if value_list: + value_list = [quoter(prefix + value) for value in value_list] + if local_pathify: + value_list = [self.LocalPathify(value) for value in value_list] + values = " \\\n\t" + " \\\n\t".join(value_list) + self.fp.write("%s :=%s\n\n" % (variable, values)) + + def WriteLn(self, text=""): + self.fp.write(text + "\n") + + def LocalPathify(self, path): + """Convert a subdirectory-relative path into a normalized path which starts with the make variable $(LOCAL_PATH) (i.e. the top of the project tree). Absolute paths, or paths that contain variables, are just normalized.""" - if '$(' in path or os.path.isabs(path): - # path is not a file in the project tree in this case, but calling - # normpath is still important for trimming trailing slashes. - return os.path.normpath(path) - local_path = os.path.join('$(LOCAL_PATH)', self.path, path) - local_path = os.path.normpath(local_path) - # Check that normalizing the path didn't ../ itself out of $(LOCAL_PATH) - # - i.e. that the resulting path is still inside the project tree. The - # path may legitimately have ended up containing just $(LOCAL_PATH), though, - # so we don't look for a slash. - assert local_path.startswith('$(LOCAL_PATH)'), ( - 'Path %s attempts to escape from gyp path %s !)' % (path, self.path)) - return local_path - - - def ExpandInputRoot(self, template, expansion, dirname): - if '%(INPUT_ROOT)s' not in template and '%(INPUT_DIRNAME)s' not in template: - return template - path = template % { - 'INPUT_ROOT': expansion, - 'INPUT_DIRNAME': dirname, + if "$(" in path or os.path.isabs(path): + # path is not a file in the project tree in this case, but calling + # normpath is still important for trimming trailing slashes. + return os.path.normpath(path) + local_path = os.path.join("$(LOCAL_PATH)", self.path, path) + local_path = os.path.normpath(local_path) + # Check that normalizing the path didn't ../ itself out of $(LOCAL_PATH) + # - i.e. that the resulting path is still inside the project tree. The + # path may legitimately have ended up containing just $(LOCAL_PATH), though, + # so we don't look for a slash. + assert local_path.startswith( + "$(LOCAL_PATH)" + ), "Path %s attempts to escape from gyp path %s !)" % (path, self.path) + return local_path + + def ExpandInputRoot(self, template, expansion, dirname): + if "%(INPUT_ROOT)s" not in template and "%(INPUT_DIRNAME)s" not in template: + return template + path = template % { + "INPUT_ROOT": expansion, + "INPUT_DIRNAME": dirname, } - return os.path.normpath(path) + return os.path.normpath(path) def PerformBuild(data, configurations, params): - # The android backend only supports the default configuration. - options = params['options'] - makefile = os.path.abspath(os.path.join(options.toplevel_dir, - 'GypAndroid.mk')) - env = dict(os.environ) - env['ONE_SHOT_MAKEFILE'] = makefile - arguments = ['make', '-C', os.environ['ANDROID_BUILD_TOP'], 'gyp_all_modules'] - print('Building: %s' % arguments) - subprocess.check_call(arguments, env=env) + # The android backend only supports the default configuration. + options = params["options"] + makefile = os.path.abspath(os.path.join(options.toplevel_dir, "GypAndroid.mk")) + env = dict(os.environ) + env["ONE_SHOT_MAKEFILE"] = makefile + arguments = ["make", "-C", os.environ["ANDROID_BUILD_TOP"], "gyp_all_modules"] + print("Building: %s" % arguments) + subprocess.check_call(arguments, env=env) def GenerateOutput(target_list, target_dicts, data, params): - options = params['options'] - generator_flags = params.get('generator_flags', {}) - builddir_name = generator_flags.get('output_dir', 'out') - limit_to_target_all = generator_flags.get('limit_to_target_all', False) - write_alias_targets = generator_flags.get('write_alias_targets', True) - sdk_version = generator_flags.get('aosp_sdk_version', 0) - android_top_dir = os.environ.get('ANDROID_BUILD_TOP') - assert android_top_dir, '$ANDROID_BUILD_TOP not set; you need to run lunch.' - - def CalculateMakefilePath(build_file, base_name): - """Determine where to write a Makefile for a given gyp file.""" - # Paths in gyp files are relative to the .gyp file, but we want - # paths relative to the source root for the master makefile. Grab - # the path of the .gyp file as the base to relativize against. - # E.g. "foo/bar" when we're constructing targets for "foo/bar/baz.gyp". - base_path = gyp.common.RelativePath(os.path.dirname(build_file), - options.depth) - # We write the file in the base_path directory. - output_file = os.path.join(options.depth, base_path, base_name) - assert not options.generator_output, ( - 'The Android backend does not support options.generator_output.') - base_path = gyp.common.RelativePath(os.path.dirname(build_file), - options.toplevel_dir) - return base_path, output_file - - # TODO: search for the first non-'Default' target. This can go - # away when we add verification that all targets have the - # necessary configurations. - default_configuration = None - toolsets = set([target_dicts[target]['toolset'] for target in target_list]) - for target in target_list: - spec = target_dicts[target] - if spec['default_configuration'] != 'Default': - default_configuration = spec['default_configuration'] - break - if not default_configuration: - default_configuration = 'Default' - - srcdir = '.' - makefile_name = 'GypAndroid' + options.suffix + '.mk' - makefile_path = os.path.join(options.toplevel_dir, makefile_name) - assert not options.generator_output, ( - 'The Android backend does not support options.generator_output.') - gyp.common.EnsureDirExists(makefile_path) - root_makefile = open(makefile_path, 'w') - - root_makefile.write(header) - - # We set LOCAL_PATH just once, here, to the top of the project tree. This - # allows all the other paths we use to be relative to the Android.mk file, - # as the Android build system expects. - root_makefile.write('\nLOCAL_PATH := $(call my-dir)\n') - - # Find the list of targets that derive from the gyp file(s) being built. - needed_targets = set() - for build_file in params['build_files']: - for target in gyp.common.AllTargets(target_list, target_dicts, build_file): - needed_targets.add(target) - - build_files = set() - include_list = set() - android_modules = {} - for qualified_target in target_list: - build_file, target, toolset = gyp.common.ParseQualifiedTarget( - qualified_target) - relative_build_file = gyp.common.RelativePath(build_file, - options.toplevel_dir) - build_files.add(relative_build_file) - included_files = data[build_file]['included_files'] - for included_file in included_files: - # The included_files entries are relative to the dir of the build file - # that included them, so we have to undo that and then make them relative - # to the root dir. - relative_include_file = gyp.common.RelativePath( - gyp.common.UnrelativePath(included_file, build_file), - options.toplevel_dir) - abs_include_file = os.path.abspath(relative_include_file) - # If the include file is from the ~/.gyp dir, we should use absolute path - # so that relocating the src dir doesn't break the path. - if (params['home_dot_gyp'] and - abs_include_file.startswith(params['home_dot_gyp'])): - build_files.add(abs_include_file) - else: - build_files.add(relative_include_file) - - base_path, output_file = CalculateMakefilePath(build_file, - target + '.' + toolset + options.suffix + '.mk') - - spec = target_dicts[qualified_target] - configs = spec['configurations'] - - part_of_all = qualified_target in needed_targets - if limit_to_target_all and not part_of_all: - continue - - relative_target = gyp.common.QualifiedTarget(relative_build_file, target, - toolset) - writer = AndroidMkWriter(android_top_dir) - android_module = writer.Write(qualified_target, relative_target, base_path, - output_file, spec, configs, - part_of_all=part_of_all, - write_alias_target=write_alias_targets, - sdk_version=sdk_version) - if android_module in android_modules: - print('ERROR: Android module names must be unique. The following ' - 'targets both generate Android module name %s.\n %s\n %s' % - (android_module, android_modules[android_module], - qualified_target)) - return - android_modules[android_module] = qualified_target - - # Our root_makefile lives at the source root. Compute the relative path - # from there to the output_file for including. - mkfile_rel_path = gyp.common.RelativePath(output_file, - os.path.dirname(makefile_path)) - include_list.add(mkfile_rel_path) - - root_makefile.write('GYP_CONFIGURATION ?= %s\n' % default_configuration) - root_makefile.write('GYP_VAR_PREFIX ?=\n') - root_makefile.write('GYP_HOST_VAR_PREFIX ?=\n') - root_makefile.write('GYP_HOST_MULTILIB ?= first\n') - - # Write out the sorted list of includes. - root_makefile.write('\n') - for include_file in sorted(include_list): - root_makefile.write('include $(LOCAL_PATH)/' + include_file + '\n') - root_makefile.write('\n') - - if write_alias_targets: - root_makefile.write(ALL_MODULES_FOOTER) - - root_makefile.close() + options = params["options"] + generator_flags = params.get("generator_flags", {}) + limit_to_target_all = generator_flags.get("limit_to_target_all", False) + write_alias_targets = generator_flags.get("write_alias_targets", True) + sdk_version = generator_flags.get("aosp_sdk_version", 0) + android_top_dir = os.environ.get("ANDROID_BUILD_TOP") + assert android_top_dir, "$ANDROID_BUILD_TOP not set; you need to run lunch." + + def CalculateMakefilePath(build_file, base_name): + """Determine where to write a Makefile for a given gyp file.""" + # Paths in gyp files are relative to the .gyp file, but we want + # paths relative to the source root for the master makefile. Grab + # the path of the .gyp file as the base to relativize against. + # E.g. "foo/bar" when we're constructing targets for "foo/bar/baz.gyp". + base_path = gyp.common.RelativePath(os.path.dirname(build_file), options.depth) + # We write the file in the base_path directory. + output_file = os.path.join(options.depth, base_path, base_name) + assert ( + not options.generator_output + ), "The Android backend does not support options.generator_output." + base_path = gyp.common.RelativePath( + os.path.dirname(build_file), options.toplevel_dir + ) + return base_path, output_file + + # TODO: search for the first non-'Default' target. This can go + # away when we add verification that all targets have the + # necessary configurations. + default_configuration = None + for target in target_list: + spec = target_dicts[target] + if spec["default_configuration"] != "Default": + default_configuration = spec["default_configuration"] + break + if not default_configuration: + default_configuration = "Default" + + makefile_name = "GypAndroid" + options.suffix + ".mk" + makefile_path = os.path.join(options.toplevel_dir, makefile_name) + assert ( + not options.generator_output + ), "The Android backend does not support options.generator_output." + gyp.common.EnsureDirExists(makefile_path) + root_makefile = open(makefile_path, "w") + + root_makefile.write(header) + + # We set LOCAL_PATH just once, here, to the top of the project tree. This + # allows all the other paths we use to be relative to the Android.mk file, + # as the Android build system expects. + root_makefile.write("\nLOCAL_PATH := $(call my-dir)\n") + + # Find the list of targets that derive from the gyp file(s) being built. + needed_targets = set() + for build_file in params["build_files"]: + for target in gyp.common.AllTargets(target_list, target_dicts, build_file): + needed_targets.add(target) + + build_files = set() + include_list = set() + android_modules = {} + for qualified_target in target_list: + build_file, target, toolset = gyp.common.ParseQualifiedTarget(qualified_target) + relative_build_file = gyp.common.RelativePath(build_file, options.toplevel_dir) + build_files.add(relative_build_file) + included_files = data[build_file]["included_files"] + for included_file in included_files: + # The included_files entries are relative to the dir of the build file + # that included them, so we have to undo that and then make them relative + # to the root dir. + relative_include_file = gyp.common.RelativePath( + gyp.common.UnrelativePath(included_file, build_file), + options.toplevel_dir, + ) + abs_include_file = os.path.abspath(relative_include_file) + # If the include file is from the ~/.gyp dir, we should use absolute path + # so that relocating the src dir doesn't break the path. + if params["home_dot_gyp"] and abs_include_file.startswith( + params["home_dot_gyp"] + ): + build_files.add(abs_include_file) + else: + build_files.add(relative_include_file) + + base_path, output_file = CalculateMakefilePath( + build_file, target + "." + toolset + options.suffix + ".mk" + ) + + spec = target_dicts[qualified_target] + configs = spec["configurations"] + + part_of_all = qualified_target in needed_targets + if limit_to_target_all and not part_of_all: + continue + + relative_target = gyp.common.QualifiedTarget( + relative_build_file, target, toolset + ) + writer = AndroidMkWriter(android_top_dir) + android_module = writer.Write( + qualified_target, + relative_target, + base_path, + output_file, + spec, + configs, + part_of_all=part_of_all, + write_alias_target=write_alias_targets, + sdk_version=sdk_version, + ) + if android_module in android_modules: + print( + "ERROR: Android module names must be unique. The following " + "targets both generate Android module name %s.\n %s\n %s" + % (android_module, android_modules[android_module], qualified_target) + ) + return + android_modules[android_module] = qualified_target + + # Our root_makefile lives at the source root. Compute the relative path + # from there to the output_file for including. + mkfile_rel_path = gyp.common.RelativePath( + output_file, os.path.dirname(makefile_path) + ) + include_list.add(mkfile_rel_path) + + root_makefile.write("GYP_CONFIGURATION ?= %s\n" % default_configuration) + root_makefile.write("GYP_VAR_PREFIX ?=\n") + root_makefile.write("GYP_HOST_VAR_PREFIX ?=\n") + root_makefile.write("GYP_HOST_MULTILIB ?= first\n") + + # Write out the sorted list of includes. + root_makefile.write("\n") + for include_file in sorted(include_list): + root_makefile.write("include $(LOCAL_PATH)/" + include_file + "\n") + root_makefile.write("\n") + + if write_alias_targets: + root_makefile.write(ALL_MODULES_FOOTER) + + root_makefile.close() diff --git a/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/cmake.py b/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/cmake.py index 5601a6657e3d03..f5ceacfca364ce 100644 --- a/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/cmake.py +++ b/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/cmake.py @@ -36,92 +36,100 @@ import string import subprocess import gyp.common +import gyp.xcode_emulation + +try: + # maketrans moved to str in python3. + _maketrans = string.maketrans +except NameError: + _maketrans = str.maketrans generator_default_variables = { - 'EXECUTABLE_PREFIX': '', - 'EXECUTABLE_SUFFIX': '', - 'STATIC_LIB_PREFIX': 'lib', - 'STATIC_LIB_SUFFIX': '.a', - 'SHARED_LIB_PREFIX': 'lib', - 'SHARED_LIB_SUFFIX': '.so', - 'SHARED_LIB_DIR': '${builddir}/lib.${TOOLSET}', - 'LIB_DIR': '${obj}.${TOOLSET}', - 'INTERMEDIATE_DIR': '${obj}.${TOOLSET}/${TARGET}/geni', - 'SHARED_INTERMEDIATE_DIR': '${obj}/gen', - 'PRODUCT_DIR': '${builddir}', - 'RULE_INPUT_PATH': '${RULE_INPUT_PATH}', - 'RULE_INPUT_DIRNAME': '${RULE_INPUT_DIRNAME}', - 'RULE_INPUT_NAME': '${RULE_INPUT_NAME}', - 'RULE_INPUT_ROOT': '${RULE_INPUT_ROOT}', - 'RULE_INPUT_EXT': '${RULE_INPUT_EXT}', - 'CONFIGURATION_NAME': '${configuration}', + "EXECUTABLE_PREFIX": "", + "EXECUTABLE_SUFFIX": "", + "STATIC_LIB_PREFIX": "lib", + "STATIC_LIB_SUFFIX": ".a", + "SHARED_LIB_PREFIX": "lib", + "SHARED_LIB_SUFFIX": ".so", + "SHARED_LIB_DIR": "${builddir}/lib.${TOOLSET}", + "LIB_DIR": "${obj}.${TOOLSET}", + "INTERMEDIATE_DIR": "${obj}.${TOOLSET}/${TARGET}/geni", + "SHARED_INTERMEDIATE_DIR": "${obj}/gen", + "PRODUCT_DIR": "${builddir}", + "RULE_INPUT_PATH": "${RULE_INPUT_PATH}", + "RULE_INPUT_DIRNAME": "${RULE_INPUT_DIRNAME}", + "RULE_INPUT_NAME": "${RULE_INPUT_NAME}", + "RULE_INPUT_ROOT": "${RULE_INPUT_ROOT}", + "RULE_INPUT_EXT": "${RULE_INPUT_EXT}", + "CONFIGURATION_NAME": "${configuration}", } -FULL_PATH_VARS = ('${CMAKE_CURRENT_LIST_DIR}', '${builddir}', '${obj}') +FULL_PATH_VARS = ("${CMAKE_CURRENT_LIST_DIR}", "${builddir}", "${obj}") generator_supports_multiple_toolsets = True generator_wants_static_library_dependencies_adjusted = True COMPILABLE_EXTENSIONS = { - '.c': 'cc', - '.cc': 'cxx', - '.cpp': 'cxx', - '.cxx': 'cxx', - '.s': 's', # cc - '.S': 's', # cc + ".c": "cc", + ".cc": "cxx", + ".cpp": "cxx", + ".cxx": "cxx", + ".s": "s", # cc + ".S": "s", # cc } def RemovePrefix(a, prefix): - """Returns 'a' without 'prefix' if it starts with 'prefix'.""" - return a[len(prefix):] if a.startswith(prefix) else a + """Returns 'a' without 'prefix' if it starts with 'prefix'.""" + return a[len(prefix) :] if a.startswith(prefix) else a def CalculateVariables(default_variables, params): - """Calculate additional variables for use in the build (called by gyp).""" - default_variables.setdefault('OS', gyp.common.GetFlavor(params)) + """Calculate additional variables for use in the build (called by gyp).""" + default_variables.setdefault("OS", gyp.common.GetFlavor(params)) def Compilable(filename): - """Return true if the file is compilable (should be in OBJS).""" - return any(filename.endswith(e) for e in COMPILABLE_EXTENSIONS) + """Return true if the file is compilable (should be in OBJS).""" + return any(filename.endswith(e) for e in COMPILABLE_EXTENSIONS) def Linkable(filename): - """Return true if the file is linkable (should be on the link line).""" - return filename.endswith('.o') + """Return true if the file is linkable (should be on the link line).""" + return filename.endswith(".o") def NormjoinPathForceCMakeSource(base_path, rel_path): - """Resolves rel_path against base_path and returns the result. + """Resolves rel_path against base_path and returns the result. If rel_path is an absolute path it is returned unchanged. Otherwise it is resolved against base_path and normalized. If the result is a relative path, it is forced to be relative to the CMakeLists.txt. """ - if os.path.isabs(rel_path): - return rel_path - if any([rel_path.startswith(var) for var in FULL_PATH_VARS]): - return rel_path - # TODO: do we need to check base_path for absolute variables as well? - return os.path.join('${CMAKE_CURRENT_LIST_DIR}', - os.path.normpath(os.path.join(base_path, rel_path))) + if os.path.isabs(rel_path): + return rel_path + if any([rel_path.startswith(var) for var in FULL_PATH_VARS]): + return rel_path + # TODO: do we need to check base_path for absolute variables as well? + return os.path.join( + "${CMAKE_CURRENT_LIST_DIR}", os.path.normpath(os.path.join(base_path, rel_path)) + ) def NormjoinPath(base_path, rel_path): - """Resolves rel_path against base_path and returns the result. + """Resolves rel_path against base_path and returns the result. TODO: what is this really used for? If rel_path begins with '$' it is returned unchanged. Otherwise it is resolved against base_path if relative, then normalized. """ - if rel_path.startswith('$') and not rel_path.startswith('${configuration}'): - return rel_path - return os.path.normpath(os.path.join(base_path, rel_path)) + if rel_path.startswith("$") and not rel_path.startswith("${configuration}"): + return rel_path + return os.path.normpath(os.path.join(base_path, rel_path)) def CMakeStringEscape(a): - """Escapes the string 'a' for use inside a CMake string. + """Escapes the string 'a' for use inside a CMake string. This means escaping '\' otherwise it may be seen as modifying the next character @@ -136,118 +144,114 @@ def CMakeStringEscape(a): but text $ should be escaped what is wanted is to know which $ come from generator variables """ - return a.replace('\\', '\\\\').replace(';', '\\;').replace('"', '\\"') + return a.replace("\\", "\\\\").replace(";", "\\;").replace('"', '\\"') def SetFileProperty(output, source_name, property_name, values, sep): - """Given a set of source file, sets the given property on them.""" - output.write('set_source_files_properties(') - output.write(source_name) - output.write(' PROPERTIES ') - output.write(property_name) - output.write(' "') - for value in values: - output.write(CMakeStringEscape(value)) - output.write(sep) - output.write('")\n') + """Given a set of source file, sets the given property on them.""" + output.write("set_source_files_properties(") + output.write(source_name) + output.write(" PROPERTIES ") + output.write(property_name) + output.write(' "') + for value in values: + output.write(CMakeStringEscape(value)) + output.write(sep) + output.write('")\n') def SetFilesProperty(output, variable, property_name, values, sep): - """Given a set of source files, sets the given property on them.""" - output.write('set_source_files_properties(') - WriteVariable(output, variable) - output.write(' PROPERTIES ') - output.write(property_name) - output.write(' "') - for value in values: - output.write(CMakeStringEscape(value)) - output.write(sep) - output.write('")\n') - - -def SetTargetProperty(output, target_name, property_name, values, sep=''): - """Given a target, sets the given property.""" - output.write('set_target_properties(') - output.write(target_name) - output.write(' PROPERTIES ') - output.write(property_name) - output.write(' "') - for value in values: - output.write(CMakeStringEscape(value)) - output.write(sep) - output.write('")\n') + """Given a set of source files, sets the given property on them.""" + output.write("set_source_files_properties(") + WriteVariable(output, variable) + output.write(" PROPERTIES ") + output.write(property_name) + output.write(' "') + for value in values: + output.write(CMakeStringEscape(value)) + output.write(sep) + output.write('")\n') + + +def SetTargetProperty(output, target_name, property_name, values, sep=""): + """Given a target, sets the given property.""" + output.write("set_target_properties(") + output.write(target_name) + output.write(" PROPERTIES ") + output.write(property_name) + output.write(' "') + for value in values: + output.write(CMakeStringEscape(value)) + output.write(sep) + output.write('")\n') def SetVariable(output, variable_name, value): - """Sets a CMake variable.""" - output.write('set(') - output.write(variable_name) - output.write(' "') - output.write(CMakeStringEscape(value)) - output.write('")\n') + """Sets a CMake variable.""" + output.write("set(") + output.write(variable_name) + output.write(' "') + output.write(CMakeStringEscape(value)) + output.write('")\n') def SetVariableList(output, variable_name, values): - """Sets a CMake variable to a list.""" - if not values: - return SetVariable(output, variable_name, "") - if len(values) == 1: - return SetVariable(output, variable_name, values[0]) - output.write('list(APPEND ') - output.write(variable_name) - output.write('\n "') - output.write('"\n "'.join([CMakeStringEscape(value) for value in values])) - output.write('")\n') + """Sets a CMake variable to a list.""" + if not values: + return SetVariable(output, variable_name, "") + if len(values) == 1: + return SetVariable(output, variable_name, values[0]) + output.write("list(APPEND ") + output.write(variable_name) + output.write('\n "') + output.write('"\n "'.join([CMakeStringEscape(value) for value in values])) + output.write('")\n') def UnsetVariable(output, variable_name): - """Unsets a CMake variable.""" - output.write('unset(') - output.write(variable_name) - output.write(')\n') + """Unsets a CMake variable.""" + output.write("unset(") + output.write(variable_name) + output.write(")\n") def WriteVariable(output, variable_name, prepend=None): - if prepend: - output.write(prepend) - output.write('${') - output.write(variable_name) - output.write('}') + if prepend: + output.write(prepend) + output.write("${") + output.write(variable_name) + output.write("}") class CMakeTargetType(object): - def __init__(self, command, modifier, property_modifier): - self.command = command - self.modifier = modifier - self.property_modifier = property_modifier + def __init__(self, command, modifier, property_modifier): + self.command = command + self.modifier = modifier + self.property_modifier = property_modifier cmake_target_type_from_gyp_target_type = { - 'executable': CMakeTargetType('add_executable', None, 'RUNTIME'), - 'static_library': CMakeTargetType('add_library', 'STATIC', 'ARCHIVE'), - 'shared_library': CMakeTargetType('add_library', 'SHARED', 'LIBRARY'), - 'loadable_module': CMakeTargetType('add_library', 'MODULE', 'LIBRARY'), - 'none': CMakeTargetType('add_custom_target', 'SOURCES', None), + "executable": CMakeTargetType("add_executable", None, "RUNTIME"), + "static_library": CMakeTargetType("add_library", "STATIC", "ARCHIVE"), + "shared_library": CMakeTargetType("add_library", "SHARED", "LIBRARY"), + "loadable_module": CMakeTargetType("add_library", "MODULE", "LIBRARY"), + "none": CMakeTargetType("add_custom_target", "SOURCES", None), } def StringToCMakeTargetName(a): - """Converts the given string 'a' to a valid CMake target name. + """Converts the given string 'a' to a valid CMake target name. All invalid characters are replaced by '_'. Invalid for cmake: ' ', '/', '(', ')', '"' Invalid for make: ':' Invalid for unknown reasons but cause failures: '.' """ - try: - return a.translate(str.maketrans(' /():."', '_______')) - except AttributeError: - return a.translate(string.maketrans(' /():."', '_______')) + return a.translate(_maketrans(' /():."', "_______")) -def WriteActions(target_name, actions, extra_sources, extra_deps, - path_to_gyp, output): - """Write CMake for the 'actions' in the target. +def WriteActions(target_name, actions, extra_sources, extra_deps, path_to_gyp, output): + """Write CMake for the 'actions' in the target. Args: target_name: the name of the CMake target being generated. @@ -257,83 +261,86 @@ def WriteActions(target_name, actions, extra_sources, extra_deps, path_to_gyp: relative path from CMakeLists.txt being generated to the Gyp file in which the target being generated is defined. """ - for action in actions: - action_name = StringToCMakeTargetName(action['action_name']) - action_target_name = '%s__%s' % (target_name, action_name) - - inputs = action['inputs'] - inputs_name = action_target_name + '__input' - SetVariableList(output, inputs_name, - [NormjoinPathForceCMakeSource(path_to_gyp, dep) for dep in inputs]) - - outputs = action['outputs'] - cmake_outputs = [NormjoinPathForceCMakeSource(path_to_gyp, out) - for out in outputs] - outputs_name = action_target_name + '__output' - SetVariableList(output, outputs_name, cmake_outputs) - - # Build up a list of outputs. - # Collect the output dirs we'll need. - dirs = set(dir for dir in (os.path.dirname(o) for o in outputs) if dir) - - if int(action.get('process_outputs_as_sources', False)): - extra_sources.extend(zip(cmake_outputs, outputs)) - - # add_custom_command - output.write('add_custom_command(OUTPUT ') - WriteVariable(output, outputs_name) - output.write('\n') - - if len(dirs) > 0: - for directory in dirs: - output.write(' COMMAND ${CMAKE_COMMAND} -E make_directory ') - output.write(directory) - output.write('\n') - - output.write(' COMMAND ') - output.write(gyp.common.EncodePOSIXShellList(action['action'])) - output.write('\n') - - output.write(' DEPENDS ') - WriteVariable(output, inputs_name) - output.write('\n') - - output.write(' WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/') - output.write(path_to_gyp) - output.write('\n') - - output.write(' COMMENT ') - if 'message' in action: - output.write(action['message']) - else: - output.write(action_target_name) - output.write('\n') - - output.write(' VERBATIM\n') - output.write(')\n') - - # add_custom_target - output.write('add_custom_target(') - output.write(action_target_name) - output.write('\n DEPENDS ') - WriteVariable(output, outputs_name) - output.write('\n SOURCES ') - WriteVariable(output, inputs_name) - output.write('\n)\n') - - extra_deps.append(action_target_name) + for action in actions: + action_name = StringToCMakeTargetName(action["action_name"]) + action_target_name = "%s__%s" % (target_name, action_name) + + inputs = action["inputs"] + inputs_name = action_target_name + "__input" + SetVariableList( + output, + inputs_name, + [NormjoinPathForceCMakeSource(path_to_gyp, dep) for dep in inputs], + ) + + outputs = action["outputs"] + cmake_outputs = [ + NormjoinPathForceCMakeSource(path_to_gyp, out) for out in outputs + ] + outputs_name = action_target_name + "__output" + SetVariableList(output, outputs_name, cmake_outputs) + + # Build up a list of outputs. + # Collect the output dirs we'll need. + dirs = set(dir for dir in (os.path.dirname(o) for o in outputs) if dir) + + if int(action.get("process_outputs_as_sources", False)): + extra_sources.extend(zip(cmake_outputs, outputs)) + + # add_custom_command + output.write("add_custom_command(OUTPUT ") + WriteVariable(output, outputs_name) + output.write("\n") + + if len(dirs) > 0: + for directory in dirs: + output.write(" COMMAND ${CMAKE_COMMAND} -E make_directory ") + output.write(directory) + output.write("\n") + + output.write(" COMMAND ") + output.write(gyp.common.EncodePOSIXShellList(action["action"])) + output.write("\n") + + output.write(" DEPENDS ") + WriteVariable(output, inputs_name) + output.write("\n") + + output.write(" WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/") + output.write(path_to_gyp) + output.write("\n") + + output.write(" COMMENT ") + if "message" in action: + output.write(action["message"]) + else: + output.write(action_target_name) + output.write("\n") + + output.write(" VERBATIM\n") + output.write(")\n") + + # add_custom_target + output.write("add_custom_target(") + output.write(action_target_name) + output.write("\n DEPENDS ") + WriteVariable(output, outputs_name) + output.write("\n SOURCES ") + WriteVariable(output, inputs_name) + output.write("\n)\n") + + extra_deps.append(action_target_name) def NormjoinRulePathForceCMakeSource(base_path, rel_path, rule_source): - if rel_path.startswith(("${RULE_INPUT_PATH}","${RULE_INPUT_DIRNAME}")): - if any([rule_source.startswith(var) for var in FULL_PATH_VARS]): - return rel_path - return NormjoinPathForceCMakeSource(base_path, rel_path) + if rel_path.startswith(("${RULE_INPUT_PATH}", "${RULE_INPUT_DIRNAME}")): + if any([rule_source.startswith(var) for var in FULL_PATH_VARS]): + return rel_path + return NormjoinPathForceCMakeSource(base_path, rel_path) -def WriteRules(target_name, rules, extra_sources, extra_deps, - path_to_gyp, output): - """Write CMake for the 'rules' in the target. +def WriteRules(target_name, rules, extra_sources, extra_deps, path_to_gyp, output): + """Write CMake for the 'rules' in the target. Args: target_name: the name of the CMake target being generated. @@ -343,110 +350,115 @@ def WriteRules(target_name, rules, extra_sources, extra_deps, path_to_gyp: relative path from CMakeLists.txt being generated to the Gyp file in which the target being generated is defined. """ - for rule in rules: - rule_name = StringToCMakeTargetName(target_name + '__' + rule['rule_name']) - - inputs = rule.get('inputs', []) - inputs_name = rule_name + '__input' - SetVariableList(output, inputs_name, - [NormjoinPathForceCMakeSource(path_to_gyp, dep) for dep in inputs]) - outputs = rule['outputs'] - var_outputs = [] - - for count, rule_source in enumerate(rule.get('rule_sources', [])): - action_name = rule_name + '_' + str(count) - - rule_source_dirname, rule_source_basename = os.path.split(rule_source) - rule_source_root, rule_source_ext = os.path.splitext(rule_source_basename) - - SetVariable(output, 'RULE_INPUT_PATH', rule_source) - SetVariable(output, 'RULE_INPUT_DIRNAME', rule_source_dirname) - SetVariable(output, 'RULE_INPUT_NAME', rule_source_basename) - SetVariable(output, 'RULE_INPUT_ROOT', rule_source_root) - SetVariable(output, 'RULE_INPUT_EXT', rule_source_ext) - - # Build up a list of outputs. - # Collect the output dirs we'll need. - dirs = set(dir for dir in (os.path.dirname(o) for o in outputs) if dir) - - # Create variables for the output, as 'local' variable will be unset. - these_outputs = [] - for output_index, out in enumerate(outputs): - output_name = action_name + '_' + str(output_index) - SetVariable(output, output_name, - NormjoinRulePathForceCMakeSource(path_to_gyp, out, - rule_source)) - if int(rule.get('process_outputs_as_sources', False)): - extra_sources.append(('${' + output_name + '}', out)) - these_outputs.append('${' + output_name + '}') - var_outputs.append('${' + output_name + '}') - - # add_custom_command - output.write('add_custom_command(OUTPUT\n') - for out in these_outputs: - output.write(' ') - output.write(out) - output.write('\n') - - for directory in dirs: - output.write(' COMMAND ${CMAKE_COMMAND} -E make_directory ') - output.write(directory) - output.write('\n') - - output.write(' COMMAND ') - output.write(gyp.common.EncodePOSIXShellList(rule['action'])) - output.write('\n') - - output.write(' DEPENDS ') - WriteVariable(output, inputs_name) - output.write(' ') - output.write(NormjoinPath(path_to_gyp, rule_source)) - output.write('\n') - - # CMAKE_CURRENT_LIST_DIR is where the CMakeLists.txt lives. - # The cwd is the current build directory. - output.write(' WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/') - output.write(path_to_gyp) - output.write('\n') - - output.write(' COMMENT ') - if 'message' in rule: - output.write(rule['message']) - else: - output.write(action_name) - output.write('\n') - - output.write(' VERBATIM\n') - output.write(')\n') - - UnsetVariable(output, 'RULE_INPUT_PATH') - UnsetVariable(output, 'RULE_INPUT_DIRNAME') - UnsetVariable(output, 'RULE_INPUT_NAME') - UnsetVariable(output, 'RULE_INPUT_ROOT') - UnsetVariable(output, 'RULE_INPUT_EXT') - - # add_custom_target - output.write('add_custom_target(') - output.write(rule_name) - output.write(' DEPENDS\n') - for out in var_outputs: - output.write(' ') - output.write(out) - output.write('\n') - output.write('SOURCES ') - WriteVariable(output, inputs_name) - output.write('\n') - for rule_source in rule.get('rule_sources', []): - output.write(' ') - output.write(NormjoinPath(path_to_gyp, rule_source)) - output.write('\n') - output.write(')\n') - - extra_deps.append(rule_name) + for rule in rules: + rule_name = StringToCMakeTargetName(target_name + "__" + rule["rule_name"]) + + inputs = rule.get("inputs", []) + inputs_name = rule_name + "__input" + SetVariableList( + output, + inputs_name, + [NormjoinPathForceCMakeSource(path_to_gyp, dep) for dep in inputs], + ) + outputs = rule["outputs"] + var_outputs = [] + + for count, rule_source in enumerate(rule.get("rule_sources", [])): + action_name = rule_name + "_" + str(count) + + rule_source_dirname, rule_source_basename = os.path.split(rule_source) + rule_source_root, rule_source_ext = os.path.splitext(rule_source_basename) + + SetVariable(output, "RULE_INPUT_PATH", rule_source) + SetVariable(output, "RULE_INPUT_DIRNAME", rule_source_dirname) + SetVariable(output, "RULE_INPUT_NAME", rule_source_basename) + SetVariable(output, "RULE_INPUT_ROOT", rule_source_root) + SetVariable(output, "RULE_INPUT_EXT", rule_source_ext) + + # Build up a list of outputs. + # Collect the output dirs we'll need. + dirs = set(dir for dir in (os.path.dirname(o) for o in outputs) if dir) + + # Create variables for the output, as 'local' variable will be unset. + these_outputs = [] + for output_index, out in enumerate(outputs): + output_name = action_name + "_" + str(output_index) + SetVariable( + output, + output_name, + NormjoinRulePathForceCMakeSource(path_to_gyp, out, rule_source), + ) + if int(rule.get("process_outputs_as_sources", False)): + extra_sources.append(("${" + output_name + "}", out)) + these_outputs.append("${" + output_name + "}") + var_outputs.append("${" + output_name + "}") + + # add_custom_command + output.write("add_custom_command(OUTPUT\n") + for out in these_outputs: + output.write(" ") + output.write(out) + output.write("\n") + + for directory in dirs: + output.write(" COMMAND ${CMAKE_COMMAND} -E make_directory ") + output.write(directory) + output.write("\n") + + output.write(" COMMAND ") + output.write(gyp.common.EncodePOSIXShellList(rule["action"])) + output.write("\n") + + output.write(" DEPENDS ") + WriteVariable(output, inputs_name) + output.write(" ") + output.write(NormjoinPath(path_to_gyp, rule_source)) + output.write("\n") + + # CMAKE_CURRENT_LIST_DIR is where the CMakeLists.txt lives. + # The cwd is the current build directory. + output.write(" WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/") + output.write(path_to_gyp) + output.write("\n") + + output.write(" COMMENT ") + if "message" in rule: + output.write(rule["message"]) + else: + output.write(action_name) + output.write("\n") + + output.write(" VERBATIM\n") + output.write(")\n") + + UnsetVariable(output, "RULE_INPUT_PATH") + UnsetVariable(output, "RULE_INPUT_DIRNAME") + UnsetVariable(output, "RULE_INPUT_NAME") + UnsetVariable(output, "RULE_INPUT_ROOT") + UnsetVariable(output, "RULE_INPUT_EXT") + + # add_custom_target + output.write("add_custom_target(") + output.write(rule_name) + output.write(" DEPENDS\n") + for out in var_outputs: + output.write(" ") + output.write(out) + output.write("\n") + output.write("SOURCES ") + WriteVariable(output, inputs_name) + output.write("\n") + for rule_source in rule.get("rule_sources", []): + output.write(" ") + output.write(NormjoinPath(path_to_gyp, rule_source)) + output.write("\n") + output.write(")\n") + + extra_deps.append(rule_name) def WriteCopies(target_name, copies, extra_deps, path_to_gyp, output): - """Write CMake for the 'copies' in the target. + """Write CMake for the 'copies' in the target. Args: target_name: the name of the CMake target being generated. @@ -455,126 +467,128 @@ def WriteCopies(target_name, copies, extra_deps, path_to_gyp, output): path_to_gyp: relative path from CMakeLists.txt being generated to the Gyp file in which the target being generated is defined. """ - copy_name = target_name + '__copies' + copy_name = target_name + "__copies" + + # CMake gets upset with custom targets with OUTPUT which specify no output. + have_copies = any(copy["files"] for copy in copies) + if not have_copies: + output.write("add_custom_target(") + output.write(copy_name) + output.write(")\n") + extra_deps.append(copy_name) + return + + class Copy(object): + def __init__(self, ext, command): + self.cmake_inputs = [] + self.cmake_outputs = [] + self.gyp_inputs = [] + self.gyp_outputs = [] + self.ext = ext + self.inputs_name = None + self.outputs_name = None + self.command = command + + file_copy = Copy("", "copy") + dir_copy = Copy("_dirs", "copy_directory") + + for copy in copies: + files = copy["files"] + destination = copy["destination"] + for src in files: + path = os.path.normpath(src) + basename = os.path.split(path)[1] + dst = os.path.join(destination, basename) + + copy = file_copy if os.path.basename(src) else dir_copy + + copy.cmake_inputs.append(NormjoinPathForceCMakeSource(path_to_gyp, src)) + copy.cmake_outputs.append(NormjoinPathForceCMakeSource(path_to_gyp, dst)) + copy.gyp_inputs.append(src) + copy.gyp_outputs.append(dst) + + for copy in (file_copy, dir_copy): + if copy.cmake_inputs: + copy.inputs_name = copy_name + "__input" + copy.ext + SetVariableList(output, copy.inputs_name, copy.cmake_inputs) + + copy.outputs_name = copy_name + "__output" + copy.ext + SetVariableList(output, copy.outputs_name, copy.cmake_outputs) + + # add_custom_command + output.write("add_custom_command(\n") + + output.write("OUTPUT") + for copy in (file_copy, dir_copy): + if copy.outputs_name: + WriteVariable(output, copy.outputs_name, " ") + output.write("\n") + + for copy in (file_copy, dir_copy): + for src, dst in zip(copy.gyp_inputs, copy.gyp_outputs): + # 'cmake -E copy src dst' will create the 'dst' directory if needed. + output.write("COMMAND ${CMAKE_COMMAND} -E %s " % copy.command) + output.write(src) + output.write(" ") + output.write(dst) + output.write("\n") + + output.write("DEPENDS") + for copy in (file_copy, dir_copy): + if copy.inputs_name: + WriteVariable(output, copy.inputs_name, " ") + output.write("\n") + + output.write("WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/") + output.write(path_to_gyp) + output.write("\n") + + output.write("COMMENT Copying for ") + output.write(target_name) + output.write("\n") - # CMake gets upset with custom targets with OUTPUT which specify no output. - have_copies = any(copy['files'] for copy in copies) - if not have_copies: - output.write('add_custom_target(') + output.write("VERBATIM\n") + output.write(")\n") + + # add_custom_target + output.write("add_custom_target(") output.write(copy_name) - output.write(')\n') + output.write("\n DEPENDS") + for copy in (file_copy, dir_copy): + if copy.outputs_name: + WriteVariable(output, copy.outputs_name, " ") + output.write("\n SOURCES") + if file_copy.inputs_name: + WriteVariable(output, file_copy.inputs_name, " ") + output.write("\n)\n") + extra_deps.append(copy_name) - return - - class Copy(object): - def __init__(self, ext, command): - self.cmake_inputs = [] - self.cmake_outputs = [] - self.gyp_inputs = [] - self.gyp_outputs = [] - self.ext = ext - self.inputs_name = None - self.outputs_name = None - self.command = command - - file_copy = Copy('', 'copy') - dir_copy = Copy('_dirs', 'copy_directory') - - for copy in copies: - files = copy['files'] - destination = copy['destination'] - for src in files: - path = os.path.normpath(src) - basename = os.path.split(path)[1] - dst = os.path.join(destination, basename) - - copy = file_copy if os.path.basename(src) else dir_copy - - copy.cmake_inputs.append(NormjoinPathForceCMakeSource(path_to_gyp, src)) - copy.cmake_outputs.append(NormjoinPathForceCMakeSource(path_to_gyp, dst)) - copy.gyp_inputs.append(src) - copy.gyp_outputs.append(dst) - - for copy in (file_copy, dir_copy): - if copy.cmake_inputs: - copy.inputs_name = copy_name + '__input' + copy.ext - SetVariableList(output, copy.inputs_name, copy.cmake_inputs) - - copy.outputs_name = copy_name + '__output' + copy.ext - SetVariableList(output, copy.outputs_name, copy.cmake_outputs) - - # add_custom_command - output.write('add_custom_command(\n') - - output.write('OUTPUT') - for copy in (file_copy, dir_copy): - if copy.outputs_name: - WriteVariable(output, copy.outputs_name, ' ') - output.write('\n') - - for copy in (file_copy, dir_copy): - for src, dst in zip(copy.gyp_inputs, copy.gyp_outputs): - # 'cmake -E copy src dst' will create the 'dst' directory if needed. - output.write('COMMAND ${CMAKE_COMMAND} -E %s ' % copy.command) - output.write(src) - output.write(' ') - output.write(dst) - output.write("\n") - - output.write('DEPENDS') - for copy in (file_copy, dir_copy): - if copy.inputs_name: - WriteVariable(output, copy.inputs_name, ' ') - output.write('\n') - - output.write('WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/') - output.write(path_to_gyp) - output.write('\n') - - output.write('COMMENT Copying for ') - output.write(target_name) - output.write('\n') - - output.write('VERBATIM\n') - output.write(')\n') - - # add_custom_target - output.write('add_custom_target(') - output.write(copy_name) - output.write('\n DEPENDS') - for copy in (file_copy, dir_copy): - if copy.outputs_name: - WriteVariable(output, copy.outputs_name, ' ') - output.write('\n SOURCES') - if file_copy.inputs_name: - WriteVariable(output, file_copy.inputs_name, ' ') - output.write('\n)\n') - - extra_deps.append(copy_name) def CreateCMakeTargetBaseName(qualified_target): - """This is the name we would like the target to have.""" - _, gyp_target_name, gyp_target_toolset = ( - gyp.common.ParseQualifiedTarget(qualified_target)) - cmake_target_base_name = gyp_target_name - if gyp_target_toolset and gyp_target_toolset != 'target': - cmake_target_base_name += '_' + gyp_target_toolset - return StringToCMakeTargetName(cmake_target_base_name) + """This is the name we would like the target to have.""" + _, gyp_target_name, gyp_target_toolset = gyp.common.ParseQualifiedTarget( + qualified_target + ) + cmake_target_base_name = gyp_target_name + if gyp_target_toolset and gyp_target_toolset != "target": + cmake_target_base_name += "_" + gyp_target_toolset + return StringToCMakeTargetName(cmake_target_base_name) def CreateCMakeTargetFullName(qualified_target): - """An unambiguous name for the target.""" - gyp_file, gyp_target_name, gyp_target_toolset = ( - gyp.common.ParseQualifiedTarget(qualified_target)) - cmake_target_full_name = gyp_file + ':' + gyp_target_name - if gyp_target_toolset and gyp_target_toolset != 'target': - cmake_target_full_name += '_' + gyp_target_toolset - return StringToCMakeTargetName(cmake_target_full_name) + """An unambiguous name for the target.""" + gyp_file, gyp_target_name, gyp_target_toolset = gyp.common.ParseQualifiedTarget( + qualified_target + ) + cmake_target_full_name = gyp_file + ":" + gyp_target_name + if gyp_target_toolset and gyp_target_toolset != "target": + cmake_target_full_name += "_" + gyp_target_toolset + return StringToCMakeTargetName(cmake_target_full_name) class CMakeNamer(object): - """Converts Gyp target names into CMake target names. + """Converts Gyp target names into CMake target names. CMake requires that target names be globally unique. One way to ensure this is to fully qualify the names of the targets. Unfortunately, this @@ -593,634 +607,721 @@ class CMakeNamer(object): building. However, it also makes sense for an IDE, as it is possible for defines to be different. """ - def __init__(self, target_list): - self.cmake_target_base_names_conficting = set() - cmake_target_base_names_seen = set() - for qualified_target in target_list: - cmake_target_base_name = CreateCMakeTargetBaseName(qualified_target) - - if cmake_target_base_name not in cmake_target_base_names_seen: - cmake_target_base_names_seen.add(cmake_target_base_name) - else: - self.cmake_target_base_names_conficting.add(cmake_target_base_name) - - def CreateCMakeTargetName(self, qualified_target): - base_name = CreateCMakeTargetBaseName(qualified_target) - if base_name in self.cmake_target_base_names_conficting: - return CreateCMakeTargetFullName(qualified_target) - return base_name - - -def WriteTarget(namer, qualified_target, target_dicts, build_dir, config_to_use, - options, generator_flags, all_qualified_targets, output): - - # The make generator does this always. - # TODO: It would be nice to be able to tell CMake all dependencies. - circular_libs = generator_flags.get('circular', True) - - if not generator_flags.get('standalone', False): - output.write('\n#') - output.write(qualified_target) - output.write('\n') - - gyp_file, _, _ = gyp.common.ParseQualifiedTarget(qualified_target) - rel_gyp_file = gyp.common.RelativePath(gyp_file, options.toplevel_dir) - rel_gyp_dir = os.path.dirname(rel_gyp_file) - - # Relative path from build dir to top dir. - build_to_top = gyp.common.InvertRelativePath(build_dir, options.toplevel_dir) - # Relative path from build dir to gyp dir. - build_to_gyp = os.path.join(build_to_top, rel_gyp_dir) - - path_from_cmakelists_to_gyp = build_to_gyp - - spec = target_dicts.get(qualified_target, {}) - config = spec.get('configurations', {}).get(config_to_use, {}) - - target_name = spec.get('target_name', '') - target_type = spec.get('type', '') - target_toolset = spec.get('toolset') - - cmake_target_type = cmake_target_type_from_gyp_target_type.get(target_type) - if cmake_target_type is None: - print('Target %s has unknown target type %s, skipping.' % - ( target_name, target_type )) - return - - SetVariable(output, 'TARGET', target_name) - SetVariable(output, 'TOOLSET', target_toolset) - - cmake_target_name = namer.CreateCMakeTargetName(qualified_target) - - extra_sources = [] - extra_deps = [] - - # Actions must come first, since they can generate more OBJs for use below. - if 'actions' in spec: - WriteActions(cmake_target_name, spec['actions'], extra_sources, extra_deps, - path_from_cmakelists_to_gyp, output) - - # Rules must be early like actions. - if 'rules' in spec: - WriteRules(cmake_target_name, spec['rules'], extra_sources, extra_deps, - path_from_cmakelists_to_gyp, output) - - # Copies - if 'copies' in spec: - WriteCopies(cmake_target_name, spec['copies'], extra_deps, - path_from_cmakelists_to_gyp, output) - - # Target and sources - srcs = spec.get('sources', []) - - # Gyp separates the sheep from the goats based on file extensions. - # A full separation is done here because of flag handing (see below). - s_sources = [] - c_sources = [] - cxx_sources = [] - linkable_sources = [] - other_sources = [] - for src in srcs: - _, ext = os.path.splitext(src) - src_type = COMPILABLE_EXTENSIONS.get(ext, None) - src_norm_path = NormjoinPath(path_from_cmakelists_to_gyp, src) - - if src_type == 's': - s_sources.append(src_norm_path) - elif src_type == 'cc': - c_sources.append(src_norm_path) - elif src_type == 'cxx': - cxx_sources.append(src_norm_path) - elif Linkable(ext): - linkable_sources.append(src_norm_path) - else: - other_sources.append(src_norm_path) - - for extra_source in extra_sources: - src, real_source = extra_source - _, ext = os.path.splitext(real_source) - src_type = COMPILABLE_EXTENSIONS.get(ext, None) - - if src_type == 's': - s_sources.append(src) - elif src_type == 'cc': - c_sources.append(src) - elif src_type == 'cxx': - cxx_sources.append(src) - elif Linkable(ext): - linkable_sources.append(src) - else: - other_sources.append(src) - - s_sources_name = None - if s_sources: - s_sources_name = cmake_target_name + '__asm_srcs' - SetVariableList(output, s_sources_name, s_sources) - - c_sources_name = None - if c_sources: - c_sources_name = cmake_target_name + '__c_srcs' - SetVariableList(output, c_sources_name, c_sources) - - cxx_sources_name = None - if cxx_sources: - cxx_sources_name = cmake_target_name + '__cxx_srcs' - SetVariableList(output, cxx_sources_name, cxx_sources) - - linkable_sources_name = None - if linkable_sources: - linkable_sources_name = cmake_target_name + '__linkable_srcs' - SetVariableList(output, linkable_sources_name, linkable_sources) - - other_sources_name = None - if other_sources: - other_sources_name = cmake_target_name + '__other_srcs' - SetVariableList(output, other_sources_name, other_sources) - - # CMake gets upset when executable targets provide no sources. - # http://www.cmake.org/pipermail/cmake/2010-July/038461.html - dummy_sources_name = None - has_sources = (s_sources_name or - c_sources_name or - cxx_sources_name or - linkable_sources_name or - other_sources_name) - if target_type == 'executable' and not has_sources: - dummy_sources_name = cmake_target_name + '__dummy_srcs' - SetVariable(output, dummy_sources_name, - "${obj}.${TOOLSET}/${TARGET}/genc/dummy.c") - output.write('if(NOT EXISTS "') - WriteVariable(output, dummy_sources_name) - output.write('")\n') - output.write(' file(WRITE "') - WriteVariable(output, dummy_sources_name) - output.write('" "")\n') - output.write("endif()\n") - - - # CMake is opposed to setting linker directories and considers the practice - # of setting linker directories dangerous. Instead, it favors the use of - # find_library and passing absolute paths to target_link_libraries. - # However, CMake does provide the command link_directories, which adds - # link directories to targets defined after it is called. - # As a result, link_directories must come before the target definition. - # CMake unfortunately has no means of removing entries from LINK_DIRECTORIES. - library_dirs = config.get('library_dirs') - if library_dirs is not None: - output.write('link_directories(') - for library_dir in library_dirs: - output.write(' ') - output.write(NormjoinPath(path_from_cmakelists_to_gyp, library_dir)) - output.write('\n') - output.write(')\n') - - output.write(cmake_target_type.command) - output.write('(') - output.write(cmake_target_name) - - if cmake_target_type.modifier is not None: - output.write(' ') - output.write(cmake_target_type.modifier) - - if s_sources_name: - WriteVariable(output, s_sources_name, ' ') - if c_sources_name: - WriteVariable(output, c_sources_name, ' ') - if cxx_sources_name: - WriteVariable(output, cxx_sources_name, ' ') - if linkable_sources_name: - WriteVariable(output, linkable_sources_name, ' ') - if other_sources_name: - WriteVariable(output, other_sources_name, ' ') - if dummy_sources_name: - WriteVariable(output, dummy_sources_name, ' ') - - output.write(')\n') - - # Let CMake know if the 'all' target should depend on this target. - exclude_from_all = ('TRUE' if qualified_target not in all_qualified_targets - else 'FALSE') - SetTargetProperty(output, cmake_target_name, - 'EXCLUDE_FROM_ALL', exclude_from_all) - for extra_target_name in extra_deps: - SetTargetProperty(output, extra_target_name, - 'EXCLUDE_FROM_ALL', exclude_from_all) - - # Output name and location. - if target_type != 'none': - # Link as 'C' if there are no other files - if not c_sources and not cxx_sources: - SetTargetProperty(output, cmake_target_name, 'LINKER_LANGUAGE', ['C']) - - # Mark uncompiled sources as uncompiled. - if other_sources_name: - output.write('set_source_files_properties(') - WriteVariable(output, other_sources_name, '') - output.write(' PROPERTIES HEADER_FILE_ONLY "TRUE")\n') + def __init__(self, target_list): + self.cmake_target_base_names_conficting = set() + + cmake_target_base_names_seen = set() + for qualified_target in target_list: + cmake_target_base_name = CreateCMakeTargetBaseName(qualified_target) + + if cmake_target_base_name not in cmake_target_base_names_seen: + cmake_target_base_names_seen.add(cmake_target_base_name) + else: + self.cmake_target_base_names_conficting.add(cmake_target_base_name) + + def CreateCMakeTargetName(self, qualified_target): + base_name = CreateCMakeTargetBaseName(qualified_target) + if base_name in self.cmake_target_base_names_conficting: + return CreateCMakeTargetFullName(qualified_target) + return base_name + + +def WriteTarget( + namer, + qualified_target, + target_dicts, + build_dir, + config_to_use, + options, + generator_flags, + all_qualified_targets, + flavor, + output, +): + # The make generator does this always. + # TODO: It would be nice to be able to tell CMake all dependencies. + circular_libs = generator_flags.get("circular", True) + + if not generator_flags.get("standalone", False): + output.write("\n#") + output.write(qualified_target) + output.write("\n") + + gyp_file, _, _ = gyp.common.ParseQualifiedTarget(qualified_target) + rel_gyp_file = gyp.common.RelativePath(gyp_file, options.toplevel_dir) + rel_gyp_dir = os.path.dirname(rel_gyp_file) + + # Relative path from build dir to top dir. + build_to_top = gyp.common.InvertRelativePath(build_dir, options.toplevel_dir) + # Relative path from build dir to gyp dir. + build_to_gyp = os.path.join(build_to_top, rel_gyp_dir) + + path_from_cmakelists_to_gyp = build_to_gyp + + spec = target_dicts.get(qualified_target, {}) + config = spec.get("configurations", {}).get(config_to_use, {}) + + xcode_settings = None + if flavor == "mac": + xcode_settings = gyp.xcode_emulation.XcodeSettings(spec) + + target_name = spec.get("target_name", "") + target_type = spec.get("type", "") + target_toolset = spec.get("toolset") + + cmake_target_type = cmake_target_type_from_gyp_target_type.get(target_type) + if cmake_target_type is None: + print( + "Target %s has unknown target type %s, skipping." + % (target_name, target_type) + ) + return + + SetVariable(output, "TARGET", target_name) + SetVariable(output, "TOOLSET", target_toolset) + + cmake_target_name = namer.CreateCMakeTargetName(qualified_target) + + extra_sources = [] + extra_deps = [] + + # Actions must come first, since they can generate more OBJs for use below. + if "actions" in spec: + WriteActions( + cmake_target_name, + spec["actions"], + extra_sources, + extra_deps, + path_from_cmakelists_to_gyp, + output, + ) + + # Rules must be early like actions. + if "rules" in spec: + WriteRules( + cmake_target_name, + spec["rules"], + extra_sources, + extra_deps, + path_from_cmakelists_to_gyp, + output, + ) + + # Copies + if "copies" in spec: + WriteCopies( + cmake_target_name, + spec["copies"], + extra_deps, + path_from_cmakelists_to_gyp, + output, + ) + + # Target and sources + srcs = spec.get("sources", []) + + # Gyp separates the sheep from the goats based on file extensions. + # A full separation is done here because of flag handing (see below). + s_sources = [] + c_sources = [] + cxx_sources = [] + linkable_sources = [] + other_sources = [] + for src in srcs: + _, ext = os.path.splitext(src) + src_type = COMPILABLE_EXTENSIONS.get(ext, None) + src_norm_path = NormjoinPath(path_from_cmakelists_to_gyp, src) + + if src_type == "s": + s_sources.append(src_norm_path) + elif src_type == "cc": + c_sources.append(src_norm_path) + elif src_type == "cxx": + cxx_sources.append(src_norm_path) + elif Linkable(ext): + linkable_sources.append(src_norm_path) + else: + other_sources.append(src_norm_path) + + for extra_source in extra_sources: + src, real_source = extra_source + _, ext = os.path.splitext(real_source) + src_type = COMPILABLE_EXTENSIONS.get(ext, None) + + if src_type == "s": + s_sources.append(src) + elif src_type == "cc": + c_sources.append(src) + elif src_type == "cxx": + cxx_sources.append(src) + elif Linkable(ext): + linkable_sources.append(src) + else: + other_sources.append(src) + + s_sources_name = None + if s_sources: + s_sources_name = cmake_target_name + "__asm_srcs" + SetVariableList(output, s_sources_name, s_sources) + + c_sources_name = None + if c_sources: + c_sources_name = cmake_target_name + "__c_srcs" + SetVariableList(output, c_sources_name, c_sources) + + cxx_sources_name = None + if cxx_sources: + cxx_sources_name = cmake_target_name + "__cxx_srcs" + SetVariableList(output, cxx_sources_name, cxx_sources) + + linkable_sources_name = None + if linkable_sources: + linkable_sources_name = cmake_target_name + "__linkable_srcs" + SetVariableList(output, linkable_sources_name, linkable_sources) + + other_sources_name = None + if other_sources: + other_sources_name = cmake_target_name + "__other_srcs" + SetVariableList(output, other_sources_name, other_sources) + + # CMake gets upset when executable targets provide no sources. + # http://www.cmake.org/pipermail/cmake/2010-July/038461.html + dummy_sources_name = None + has_sources = ( + s_sources_name + or c_sources_name + or cxx_sources_name + or linkable_sources_name + or other_sources_name + ) + if target_type == "executable" and not has_sources: + dummy_sources_name = cmake_target_name + "__dummy_srcs" + SetVariable( + output, dummy_sources_name, "${obj}.${TOOLSET}/${TARGET}/genc/dummy.c" + ) + output.write('if(NOT EXISTS "') + WriteVariable(output, dummy_sources_name) + output.write('")\n') + output.write(' file(WRITE "') + WriteVariable(output, dummy_sources_name) + output.write('" "")\n') + output.write("endif()\n") + + # CMake is opposed to setting linker directories and considers the practice + # of setting linker directories dangerous. Instead, it favors the use of + # find_library and passing absolute paths to target_link_libraries. + # However, CMake does provide the command link_directories, which adds + # link directories to targets defined after it is called. + # As a result, link_directories must come before the target definition. + # CMake unfortunately has no means of removing entries from LINK_DIRECTORIES. + library_dirs = config.get("library_dirs") + if library_dirs is not None: + output.write("link_directories(") + for library_dir in library_dirs: + output.write(" ") + output.write(NormjoinPath(path_from_cmakelists_to_gyp, library_dir)) + output.write("\n") + output.write(")\n") + + output.write(cmake_target_type.command) + output.write("(") + output.write(cmake_target_name) - # Mark object sources as linkable. + if cmake_target_type.modifier is not None: + output.write(" ") + output.write(cmake_target_type.modifier) + + if s_sources_name: + WriteVariable(output, s_sources_name, " ") + if c_sources_name: + WriteVariable(output, c_sources_name, " ") + if cxx_sources_name: + WriteVariable(output, cxx_sources_name, " ") if linkable_sources_name: - output.write('set_source_files_properties(') - WriteVariable(output, other_sources_name, '') - output.write(' PROPERTIES EXTERNAL_OBJECT "TRUE")\n') - - # Output directory - target_output_directory = spec.get('product_dir') - if target_output_directory is None: - if target_type in ('executable', 'loadable_module'): - target_output_directory = generator_default_variables['PRODUCT_DIR'] - elif target_type == 'shared_library': - target_output_directory = '${builddir}/lib.${TOOLSET}' - elif spec.get('standalone_static_library', False): - target_output_directory = generator_default_variables['PRODUCT_DIR'] - else: - base_path = gyp.common.RelativePath(os.path.dirname(gyp_file), - options.toplevel_dir) - target_output_directory = '${obj}.${TOOLSET}' - target_output_directory = ( - os.path.join(target_output_directory, base_path)) - - cmake_target_output_directory = NormjoinPathForceCMakeSource( - path_from_cmakelists_to_gyp, - target_output_directory) - SetTargetProperty(output, - cmake_target_name, - cmake_target_type.property_modifier + '_OUTPUT_DIRECTORY', - cmake_target_output_directory) - - # Output name - default_product_prefix = '' - default_product_name = target_name - default_product_ext = '' - if target_type == 'static_library': - static_library_prefix = generator_default_variables['STATIC_LIB_PREFIX'] - default_product_name = RemovePrefix(default_product_name, - static_library_prefix) - default_product_prefix = static_library_prefix - default_product_ext = generator_default_variables['STATIC_LIB_SUFFIX'] - - elif target_type in ('loadable_module', 'shared_library'): - shared_library_prefix = generator_default_variables['SHARED_LIB_PREFIX'] - default_product_name = RemovePrefix(default_product_name, - shared_library_prefix) - default_product_prefix = shared_library_prefix - default_product_ext = generator_default_variables['SHARED_LIB_SUFFIX'] - - elif target_type != 'executable': - print('ERROR: What output file should be generated?', - 'type', target_type, 'target', target_name) - - product_prefix = spec.get('product_prefix', default_product_prefix) - product_name = spec.get('product_name', default_product_name) - product_ext = spec.get('product_extension') - if product_ext: - product_ext = '.' + product_ext - else: - product_ext = default_product_ext - - SetTargetProperty(output, cmake_target_name, 'PREFIX', product_prefix) - SetTargetProperty(output, cmake_target_name, - cmake_target_type.property_modifier + '_OUTPUT_NAME', - product_name) - SetTargetProperty(output, cmake_target_name, 'SUFFIX', product_ext) - - # Make the output of this target referenceable as a source. - cmake_target_output_basename = product_prefix + product_name + product_ext - cmake_target_output = os.path.join(cmake_target_output_directory, - cmake_target_output_basename) - SetFileProperty(output, cmake_target_output, 'GENERATED', ['TRUE'], '') - - # Includes - includes = config.get('include_dirs') - if includes: - # This (target include directories) is what requires CMake 2.8.8 - includes_name = cmake_target_name + '__include_dirs' - SetVariableList(output, includes_name, - [NormjoinPathForceCMakeSource(path_from_cmakelists_to_gyp, include) - for include in includes]) - output.write('set_property(TARGET ') - output.write(cmake_target_name) - output.write(' APPEND PROPERTY INCLUDE_DIRECTORIES ') - WriteVariable(output, includes_name, '') - output.write(')\n') - - # Defines - defines = config.get('defines') - if defines is not None: - SetTargetProperty(output, - cmake_target_name, - 'COMPILE_DEFINITIONS', - defines, - ';') - - # Compile Flags - http://www.cmake.org/Bug/view.php?id=6493 - # CMake currently does not have target C and CXX flags. - # So, instead of doing... - - # cflags_c = config.get('cflags_c') - # if cflags_c is not None: - # SetTargetProperty(output, cmake_target_name, - # 'C_COMPILE_FLAGS', cflags_c, ' ') - - # cflags_cc = config.get('cflags_cc') - # if cflags_cc is not None: - # SetTargetProperty(output, cmake_target_name, - # 'CXX_COMPILE_FLAGS', cflags_cc, ' ') - - # Instead we must... - cflags = config.get('cflags', []) - cflags_c = config.get('cflags_c', []) - cflags_cxx = config.get('cflags_cc', []) - if (not cflags_c or not c_sources) and (not cflags_cxx or not cxx_sources): - SetTargetProperty(output, cmake_target_name, 'COMPILE_FLAGS', cflags, ' ') - - elif c_sources and not (s_sources or cxx_sources): - flags = [] - flags.extend(cflags) - flags.extend(cflags_c) - SetTargetProperty(output, cmake_target_name, 'COMPILE_FLAGS', flags, ' ') - - elif cxx_sources and not (s_sources or c_sources): - flags = [] - flags.extend(cflags) - flags.extend(cflags_cxx) - SetTargetProperty(output, cmake_target_name, 'COMPILE_FLAGS', flags, ' ') + WriteVariable(output, linkable_sources_name, " ") + if other_sources_name: + WriteVariable(output, other_sources_name, " ") + if dummy_sources_name: + WriteVariable(output, dummy_sources_name, " ") + + output.write(")\n") + + # Let CMake know if the 'all' target should depend on this target. + exclude_from_all = ( + "TRUE" if qualified_target not in all_qualified_targets else "FALSE" + ) + SetTargetProperty(output, cmake_target_name, "EXCLUDE_FROM_ALL", exclude_from_all) + for extra_target_name in extra_deps: + SetTargetProperty( + output, extra_target_name, "EXCLUDE_FROM_ALL", exclude_from_all + ) + + # Output name and location. + if target_type != "none": + # Link as 'C' if there are no other files + if not c_sources and not cxx_sources: + SetTargetProperty(output, cmake_target_name, "LINKER_LANGUAGE", ["C"]) + + # Mark uncompiled sources as uncompiled. + if other_sources_name: + output.write("set_source_files_properties(") + WriteVariable(output, other_sources_name, "") + output.write(' PROPERTIES HEADER_FILE_ONLY "TRUE")\n') + + # Mark object sources as linkable. + if linkable_sources_name: + output.write("set_source_files_properties(") + WriteVariable(output, other_sources_name, "") + output.write(' PROPERTIES EXTERNAL_OBJECT "TRUE")\n') + + # Output directory + target_output_directory = spec.get("product_dir") + if target_output_directory is None: + if target_type in ("executable", "loadable_module"): + target_output_directory = generator_default_variables["PRODUCT_DIR"] + elif target_type == "shared_library": + target_output_directory = "${builddir}/lib.${TOOLSET}" + elif spec.get("standalone_static_library", False): + target_output_directory = generator_default_variables["PRODUCT_DIR"] + else: + base_path = gyp.common.RelativePath( + os.path.dirname(gyp_file), options.toplevel_dir + ) + target_output_directory = "${obj}.${TOOLSET}" + target_output_directory = os.path.join( + target_output_directory, base_path + ) + + cmake_target_output_directory = NormjoinPathForceCMakeSource( + path_from_cmakelists_to_gyp, target_output_directory + ) + SetTargetProperty( + output, + cmake_target_name, + cmake_target_type.property_modifier + "_OUTPUT_DIRECTORY", + cmake_target_output_directory, + ) + + # Output name + default_product_prefix = "" + default_product_name = target_name + default_product_ext = "" + if target_type == "static_library": + static_library_prefix = generator_default_variables["STATIC_LIB_PREFIX"] + default_product_name = RemovePrefix( + default_product_name, static_library_prefix + ) + default_product_prefix = static_library_prefix + default_product_ext = generator_default_variables["STATIC_LIB_SUFFIX"] + + elif target_type in ("loadable_module", "shared_library"): + shared_library_prefix = generator_default_variables["SHARED_LIB_PREFIX"] + default_product_name = RemovePrefix( + default_product_name, shared_library_prefix + ) + default_product_prefix = shared_library_prefix + default_product_ext = generator_default_variables["SHARED_LIB_SUFFIX"] + + elif target_type != "executable": + print( + "ERROR: What output file should be generated?", + "type", + target_type, + "target", + target_name, + ) + + product_prefix = spec.get("product_prefix", default_product_prefix) + product_name = spec.get("product_name", default_product_name) + product_ext = spec.get("product_extension") + if product_ext: + product_ext = "." + product_ext + else: + product_ext = default_product_ext + + SetTargetProperty(output, cmake_target_name, "PREFIX", product_prefix) + SetTargetProperty( + output, + cmake_target_name, + cmake_target_type.property_modifier + "_OUTPUT_NAME", + product_name, + ) + SetTargetProperty(output, cmake_target_name, "SUFFIX", product_ext) + + # Make the output of this target referenceable as a source. + cmake_target_output_basename = product_prefix + product_name + product_ext + cmake_target_output = os.path.join( + cmake_target_output_directory, cmake_target_output_basename + ) + SetFileProperty(output, cmake_target_output, "GENERATED", ["TRUE"], "") + + # Includes + includes = config.get("include_dirs") + if includes: + # This (target include directories) is what requires CMake 2.8.8 + includes_name = cmake_target_name + "__include_dirs" + SetVariableList( + output, + includes_name, + [ + NormjoinPathForceCMakeSource(path_from_cmakelists_to_gyp, include) + for include in includes + ], + ) + output.write("set_property(TARGET ") + output.write(cmake_target_name) + output.write(" APPEND PROPERTY INCLUDE_DIRECTORIES ") + WriteVariable(output, includes_name, "") + output.write(")\n") + + # Defines + defines = config.get("defines") + if defines is not None: + SetTargetProperty( + output, cmake_target_name, "COMPILE_DEFINITIONS", defines, ";" + ) + + # Compile Flags - http://www.cmake.org/Bug/view.php?id=6493 + # CMake currently does not have target C and CXX flags. + # So, instead of doing... + + # cflags_c = config.get('cflags_c') + # if cflags_c is not None: + # SetTargetProperty(output, cmake_target_name, + # 'C_COMPILE_FLAGS', cflags_c, ' ') + + # cflags_cc = config.get('cflags_cc') + # if cflags_cc is not None: + # SetTargetProperty(output, cmake_target_name, + # 'CXX_COMPILE_FLAGS', cflags_cc, ' ') + + # Instead we must... + cflags = config.get("cflags", []) + cflags_c = config.get("cflags_c", []) + cflags_cxx = config.get("cflags_cc", []) + if xcode_settings: + cflags = xcode_settings.GetCflags(config_to_use) + cflags_c = xcode_settings.GetCflagsC(config_to_use) + cflags_cxx = xcode_settings.GetCflagsCC(config_to_use) + # cflags_objc = xcode_settings.GetCflagsObjC(config_to_use) + # cflags_objcc = xcode_settings.GetCflagsObjCC(config_to_use) + + if (not cflags_c or not c_sources) and (not cflags_cxx or not cxx_sources): + SetTargetProperty(output, cmake_target_name, "COMPILE_FLAGS", cflags, " ") + + elif c_sources and not (s_sources or cxx_sources): + flags = [] + flags.extend(cflags) + flags.extend(cflags_c) + SetTargetProperty(output, cmake_target_name, "COMPILE_FLAGS", flags, " ") + + elif cxx_sources and not (s_sources or c_sources): + flags = [] + flags.extend(cflags) + flags.extend(cflags_cxx) + SetTargetProperty(output, cmake_target_name, "COMPILE_FLAGS", flags, " ") + + else: + # TODO: This is broken, one cannot generally set properties on files, + # as other targets may require different properties on the same files. + if s_sources and cflags: + SetFilesProperty(output, s_sources_name, "COMPILE_FLAGS", cflags, " ") + + if c_sources and (cflags or cflags_c): + flags = [] + flags.extend(cflags) + flags.extend(cflags_c) + SetFilesProperty(output, c_sources_name, "COMPILE_FLAGS", flags, " ") + + if cxx_sources and (cflags or cflags_cxx): + flags = [] + flags.extend(cflags) + flags.extend(cflags_cxx) + SetFilesProperty(output, cxx_sources_name, "COMPILE_FLAGS", flags, " ") + + # Linker flags + ldflags = config.get("ldflags") + if ldflags is not None: + SetTargetProperty(output, cmake_target_name, "LINK_FLAGS", ldflags, " ") + + # XCode settings + xcode_settings = config.get("xcode_settings", {}) + for xcode_setting, xcode_value in xcode_settings.viewitems(): + SetTargetProperty( + output, + cmake_target_name, + "XCODE_ATTRIBUTE_%s" % xcode_setting, + xcode_value, + "" if isinstance(xcode_value, str) else " ", + ) + + # Note on Dependencies and Libraries: + # CMake wants to handle link order, resolving the link line up front. + # Gyp does not retain or enforce specifying enough information to do so. + # So do as other gyp generators and use --start-group and --end-group. + # Give CMake as little information as possible so that it doesn't mess it up. + + # Dependencies + rawDeps = spec.get("dependencies", []) + + static_deps = [] + shared_deps = [] + other_deps = [] + for rawDep in rawDeps: + dep_cmake_name = namer.CreateCMakeTargetName(rawDep) + dep_spec = target_dicts.get(rawDep, {}) + dep_target_type = dep_spec.get("type", None) + + if dep_target_type == "static_library": + static_deps.append(dep_cmake_name) + elif dep_target_type == "shared_library": + shared_deps.append(dep_cmake_name) + else: + other_deps.append(dep_cmake_name) + + # ensure all external dependencies are complete before internal dependencies + # extra_deps currently only depend on their own deps, so otherwise run early + if static_deps or shared_deps or other_deps: + for extra_dep in extra_deps: + output.write("add_dependencies(") + output.write(extra_dep) + output.write("\n") + for deps in (static_deps, shared_deps, other_deps): + for dep in gyp.common.uniquer(deps): + output.write(" ") + output.write(dep) + output.write("\n") + output.write(")\n") + + linkable = target_type in ("executable", "loadable_module", "shared_library") + other_deps.extend(extra_deps) + if other_deps or (not linkable and (static_deps or shared_deps)): + output.write("add_dependencies(") + output.write(cmake_target_name) + output.write("\n") + for dep in gyp.common.uniquer(other_deps): + output.write(" ") + output.write(dep) + output.write("\n") + if not linkable: + for deps in (static_deps, shared_deps): + for lib_dep in gyp.common.uniquer(deps): + output.write(" ") + output.write(lib_dep) + output.write("\n") + output.write(")\n") + + # Libraries + if linkable: + external_libs = [lib for lib in spec.get("libraries", []) if len(lib) > 0] + if external_libs or static_deps or shared_deps: + output.write("target_link_libraries(") + output.write(cmake_target_name) + output.write("\n") + if static_deps: + write_group = circular_libs and len(static_deps) > 1 and flavor != "mac" + if write_group: + output.write("-Wl,--start-group\n") + for dep in gyp.common.uniquer(static_deps): + output.write(" ") + output.write(dep) + output.write("\n") + if write_group: + output.write("-Wl,--end-group\n") + if shared_deps: + for dep in gyp.common.uniquer(shared_deps): + output.write(" ") + output.write(dep) + output.write("\n") + if external_libs: + for lib in gyp.common.uniquer(external_libs): + output.write(' "') + output.write(RemovePrefix(lib, "$(SDKROOT)")) + output.write('"\n') + + output.write(")\n") + + UnsetVariable(output, "TOOLSET") + UnsetVariable(output, "TARGET") + + +def GenerateOutputForConfig(target_list, target_dicts, data, params, config_to_use): + options = params["options"] + generator_flags = params["generator_flags"] + flavor = gyp.common.GetFlavor(params) + + # generator_dir: relative path from pwd to where make puts build files. + # Makes migrating from make to cmake easier, cmake doesn't put anything here. + # Each Gyp configuration creates a different CMakeLists.txt file + # to avoid incompatibilities between Gyp and CMake configurations. + generator_dir = os.path.relpath(options.generator_output or ".") + + # output_dir: relative path from generator_dir to the build directory. + output_dir = generator_flags.get("output_dir", "out") - else: - # TODO: This is broken, one cannot generally set properties on files, - # as other targets may require different properties on the same files. - if s_sources and cflags: - SetFilesProperty(output, s_sources_name, 'COMPILE_FLAGS', cflags, ' ') - - if c_sources and (cflags or cflags_c): - flags = [] - flags.extend(cflags) - flags.extend(cflags_c) - SetFilesProperty(output, c_sources_name, 'COMPILE_FLAGS', flags, ' ') - - if cxx_sources and (cflags or cflags_cxx): - flags = [] - flags.extend(cflags) - flags.extend(cflags_cxx) - SetFilesProperty(output, cxx_sources_name, 'COMPILE_FLAGS', flags, ' ') - - # Linker flags - ldflags = config.get('ldflags') - if ldflags is not None: - SetTargetProperty(output, cmake_target_name, 'LINK_FLAGS', ldflags, ' ') - - # Note on Dependencies and Libraries: - # CMake wants to handle link order, resolving the link line up front. - # Gyp does not retain or enforce specifying enough information to do so. - # So do as other gyp generators and use --start-group and --end-group. - # Give CMake as little information as possible so that it doesn't mess it up. - - # Dependencies - rawDeps = spec.get('dependencies', []) - - static_deps = [] - shared_deps = [] - other_deps = [] - for rawDep in rawDeps: - dep_cmake_name = namer.CreateCMakeTargetName(rawDep) - dep_spec = target_dicts.get(rawDep, {}) - dep_target_type = dep_spec.get('type', None) - - if dep_target_type == 'static_library': - static_deps.append(dep_cmake_name) - elif dep_target_type == 'shared_library': - shared_deps.append(dep_cmake_name) - else: - other_deps.append(dep_cmake_name) - - # ensure all external dependencies are complete before internal dependencies - # extra_deps currently only depend on their own deps, so otherwise run early - if static_deps or shared_deps or other_deps: - for extra_dep in extra_deps: - output.write('add_dependencies(') - output.write(extra_dep) - output.write('\n') - for deps in (static_deps, shared_deps, other_deps): - for dep in gyp.common.uniquer(deps): - output.write(' ') - output.write(dep) - output.write('\n') - output.write(')\n') - - linkable = target_type in ('executable', 'loadable_module', 'shared_library') - other_deps.extend(extra_deps) - if other_deps or (not linkable and (static_deps or shared_deps)): - output.write('add_dependencies(') - output.write(cmake_target_name) - output.write('\n') - for dep in gyp.common.uniquer(other_deps): - output.write(' ') - output.write(dep) - output.write('\n') - if not linkable: - for deps in (static_deps, shared_deps): - for lib_dep in gyp.common.uniquer(deps): - output.write(' ') - output.write(lib_dep) - output.write('\n') - output.write(')\n') - - # Libraries - if linkable: - external_libs = [lib for lib in spec.get('libraries', []) if len(lib) > 0] - if external_libs or static_deps or shared_deps: - output.write('target_link_libraries(') - output.write(cmake_target_name) - output.write('\n') - if static_deps: - write_group = circular_libs and len(static_deps) > 1 - if write_group: - output.write('-Wl,--start-group\n') - for dep in gyp.common.uniquer(static_deps): - output.write(' ') - output.write(dep) - output.write('\n') - if write_group: - output.write('-Wl,--end-group\n') - if shared_deps: - for dep in gyp.common.uniquer(shared_deps): - output.write(' ') - output.write(dep) - output.write('\n') - if external_libs: - for lib in gyp.common.uniquer(external_libs): - output.write(' ') - output.write(lib) - output.write('\n') - - output.write(')\n') - - UnsetVariable(output, 'TOOLSET') - UnsetVariable(output, 'TARGET') - - -def GenerateOutputForConfig(target_list, target_dicts, data, - params, config_to_use): - options = params['options'] - generator_flags = params['generator_flags'] - - # generator_dir: relative path from pwd to where make puts build files. - # Makes migrating from make to cmake easier, cmake doesn't put anything here. - # Each Gyp configuration creates a different CMakeLists.txt file - # to avoid incompatibilities between Gyp and CMake configurations. - generator_dir = os.path.relpath(options.generator_output or '.') - - # output_dir: relative path from generator_dir to the build directory. - output_dir = generator_flags.get('output_dir', 'out') - - # build_dir: relative path from source root to our output files. - # e.g. "out/Debug" - build_dir = os.path.normpath(os.path.join(generator_dir, - output_dir, - config_to_use)) - - toplevel_build = os.path.join(options.toplevel_dir, build_dir) - - output_file = os.path.join(toplevel_build, 'CMakeLists.txt') - gyp.common.EnsureDirExists(output_file) - - output = open(output_file, 'w') - output.write('cmake_minimum_required(VERSION 2.8.8 FATAL_ERROR)\n') - output.write('cmake_policy(VERSION 2.8.8)\n') - - gyp_file, project_target, _ = gyp.common.ParseQualifiedTarget(target_list[-1]) - output.write('project(') - output.write(project_target) - output.write(')\n') - - SetVariable(output, 'configuration', config_to_use) - - ar = None - cc = None - cxx = None - - make_global_settings = data[gyp_file].get('make_global_settings', []) - build_to_top = gyp.common.InvertRelativePath(build_dir, - options.toplevel_dir) - for key, value in make_global_settings: - if key == 'AR': - ar = os.path.join(build_to_top, value) - if key == 'CC': - cc = os.path.join(build_to_top, value) - if key == 'CXX': - cxx = os.path.join(build_to_top, value) - - ar = gyp.common.GetEnvironFallback(['AR_target', 'AR'], ar) - cc = gyp.common.GetEnvironFallback(['CC_target', 'CC'], cc) - cxx = gyp.common.GetEnvironFallback(['CXX_target', 'CXX'], cxx) - - if ar: - SetVariable(output, 'CMAKE_AR', ar) - if cc: - SetVariable(output, 'CMAKE_C_COMPILER', cc) - if cxx: - SetVariable(output, 'CMAKE_CXX_COMPILER', cxx) - - # The following appears to be as-yet undocumented. - # http://public.kitware.com/Bug/view.php?id=8392 - output.write('enable_language(ASM)\n') - # ASM-ATT does not support .S files. - # output.write('enable_language(ASM-ATT)\n') - - if cc: - SetVariable(output, 'CMAKE_ASM_COMPILER', cc) - - SetVariable(output, 'builddir', '${CMAKE_CURRENT_BINARY_DIR}') - SetVariable(output, 'obj', '${builddir}/obj') - output.write('\n') - - # TODO: Undocumented/unsupported (the CMake Java generator depends on it). - # CMake by default names the object resulting from foo.c to be foo.c.o. - # Gyp traditionally names the object resulting from foo.c foo.o. - # This should be irrelevant, but some targets extract .o files from .a - # and depend on the name of the extracted .o files. - output.write('set(CMAKE_C_OUTPUT_EXTENSION_REPLACE 1)\n') - output.write('set(CMAKE_CXX_OUTPUT_EXTENSION_REPLACE 1)\n') - output.write('\n') - - # Force ninja to use rsp files. Otherwise link and ar lines can get too long, - # resulting in 'Argument list too long' errors. - output.write('set(CMAKE_NINJA_FORCE_RESPONSE_FILE 1)\n') - output.write('\n') - - namer = CMakeNamer(target_list) - - # The list of targets upon which the 'all' target should depend. - # CMake has it's own implicit 'all' target, one is not created explicitly. - all_qualified_targets = set() - for build_file in params['build_files']: - for qualified_target in gyp.common.AllTargets(target_list, - target_dicts, - os.path.normpath(build_file)): - all_qualified_targets.add(qualified_target) - - for qualified_target in target_list: - WriteTarget(namer, qualified_target, target_dicts, build_dir, config_to_use, - options, generator_flags, all_qualified_targets, output) - - output.close() + # build_dir: relative path from source root to our output files. + # e.g. "out/Debug" + build_dir = os.path.normpath(os.path.join(generator_dir, output_dir, config_to_use)) + + toplevel_build = os.path.join(options.toplevel_dir, build_dir) + + output_file = os.path.join(toplevel_build, "CMakeLists.txt") + gyp.common.EnsureDirExists(output_file) + + output = open(output_file, "w") + output.write("cmake_minimum_required(VERSION 2.8.8 FATAL_ERROR)\n") + output.write("cmake_policy(VERSION 2.8.8)\n") + + gyp_file, project_target, _ = gyp.common.ParseQualifiedTarget(target_list[-1]) + output.write("project(") + output.write(project_target) + output.write(")\n") + + SetVariable(output, "configuration", config_to_use) + + ar = None + cc = None + cxx = None + + make_global_settings = data[gyp_file].get("make_global_settings", []) + build_to_top = gyp.common.InvertRelativePath(build_dir, options.toplevel_dir) + for key, value in make_global_settings: + if key == "AR": + ar = os.path.join(build_to_top, value) + if key == "CC": + cc = os.path.join(build_to_top, value) + if key == "CXX": + cxx = os.path.join(build_to_top, value) + + ar = gyp.common.GetEnvironFallback(["AR_target", "AR"], ar) + cc = gyp.common.GetEnvironFallback(["CC_target", "CC"], cc) + cxx = gyp.common.GetEnvironFallback(["CXX_target", "CXX"], cxx) + + if ar: + SetVariable(output, "CMAKE_AR", ar) + if cc: + SetVariable(output, "CMAKE_C_COMPILER", cc) + if cxx: + SetVariable(output, "CMAKE_CXX_COMPILER", cxx) + + # The following appears to be as-yet undocumented. + # http://public.kitware.com/Bug/view.php?id=8392 + output.write("enable_language(ASM)\n") + # ASM-ATT does not support .S files. + # output.write('enable_language(ASM-ATT)\n') + + if cc: + SetVariable(output, "CMAKE_ASM_COMPILER", cc) + + SetVariable(output, "builddir", "${CMAKE_CURRENT_BINARY_DIR}") + SetVariable(output, "obj", "${builddir}/obj") + output.write("\n") + + # TODO: Undocumented/unsupported (the CMake Java generator depends on it). + # CMake by default names the object resulting from foo.c to be foo.c.o. + # Gyp traditionally names the object resulting from foo.c foo.o. + # This should be irrelevant, but some targets extract .o files from .a + # and depend on the name of the extracted .o files. + output.write("set(CMAKE_C_OUTPUT_EXTENSION_REPLACE 1)\n") + output.write("set(CMAKE_CXX_OUTPUT_EXTENSION_REPLACE 1)\n") + output.write("\n") + + # Force ninja to use rsp files. Otherwise link and ar lines can get too long, + # resulting in 'Argument list too long' errors. + # However, rsp files don't work correctly on Mac. + if flavor != "mac": + output.write("set(CMAKE_NINJA_FORCE_RESPONSE_FILE 1)\n") + output.write("\n") + + namer = CMakeNamer(target_list) + + # The list of targets upon which the 'all' target should depend. + # CMake has it's own implicit 'all' target, one is not created explicitly. + all_qualified_targets = set() + for build_file in params["build_files"]: + for qualified_target in gyp.common.AllTargets( + target_list, target_dicts, os.path.normpath(build_file) + ): + all_qualified_targets.add(qualified_target) + + for qualified_target in target_list: + if flavor == "mac": + gyp_file, _, _ = gyp.common.ParseQualifiedTarget(qualified_target) + spec = target_dicts[qualified_target] + gyp.xcode_emulation.MergeGlobalXcodeSettingsToSpec(data[gyp_file], spec) + + WriteTarget( + namer, + qualified_target, + target_dicts, + build_dir, + config_to_use, + options, + generator_flags, + all_qualified_targets, + flavor, + output, + ) + + output.close() def PerformBuild(data, configurations, params): - options = params['options'] - generator_flags = params['generator_flags'] + options = params["options"] + generator_flags = params["generator_flags"] - # generator_dir: relative path from pwd to where make puts build files. - # Makes migrating from make to cmake easier, cmake doesn't put anything here. - generator_dir = os.path.relpath(options.generator_output or '.') + # generator_dir: relative path from pwd to where make puts build files. + # Makes migrating from make to cmake easier, cmake doesn't put anything here. + generator_dir = os.path.relpath(options.generator_output or ".") - # output_dir: relative path from generator_dir to the build directory. - output_dir = generator_flags.get('output_dir', 'out') + # output_dir: relative path from generator_dir to the build directory. + output_dir = generator_flags.get("output_dir", "out") - for config_name in configurations: - # build_dir: relative path from source root to our output files. - # e.g. "out/Debug" - build_dir = os.path.normpath(os.path.join(generator_dir, - output_dir, - config_name)) - arguments = ['cmake', '-G', 'Ninja'] - print('Generating [%s]: %s' % (config_name, arguments)) - subprocess.check_call(arguments, cwd=build_dir) + for config_name in configurations: + # build_dir: relative path from source root to our output files. + # e.g. "out/Debug" + build_dir = os.path.normpath( + os.path.join(generator_dir, output_dir, config_name) + ) + arguments = ["cmake", "-G", "Ninja"] + print("Generating [%s]: %s" % (config_name, arguments)) + subprocess.check_call(arguments, cwd=build_dir) - arguments = ['ninja', '-C', build_dir] - print('Building [%s]: %s' % (config_name, arguments)) - subprocess.check_call(arguments) + arguments = ["ninja", "-C", build_dir] + print("Building [%s]: %s" % (config_name, arguments)) + subprocess.check_call(arguments) def CallGenerateOutputForConfig(arglist): - # Ignore the interrupt signal so that the parent process catches it and - # kills all multiprocessing children. - signal.signal(signal.SIGINT, signal.SIG_IGN) + # Ignore the interrupt signal so that the parent process catches it and + # kills all multiprocessing children. + signal.signal(signal.SIGINT, signal.SIG_IGN) - target_list, target_dicts, data, params, config_name = arglist - GenerateOutputForConfig(target_list, target_dicts, data, params, config_name) + target_list, target_dicts, data, params, config_name = arglist + GenerateOutputForConfig(target_list, target_dicts, data, params, config_name) def GenerateOutput(target_list, target_dicts, data, params): - user_config = params.get('generator_flags', {}).get('config', None) - if user_config: - GenerateOutputForConfig(target_list, target_dicts, data, - params, user_config) - else: - config_names = target_dicts[target_list[0]]['configurations'].keys() - if params['parallel']: - try: - pool = multiprocessing.Pool(len(config_names)) - arglists = [] - for config_name in config_names: - arglists.append((target_list, target_dicts, data, - params, config_name)) - pool.map(CallGenerateOutputForConfig, arglists) - except KeyboardInterrupt as e: - pool.terminate() - raise e + user_config = params.get("generator_flags", {}).get("config", None) + if user_config: + GenerateOutputForConfig(target_list, target_dicts, data, params, user_config) else: - for config_name in config_names: - GenerateOutputForConfig(target_list, target_dicts, data, - params, config_name) + config_names = target_dicts[target_list[0]]["configurations"] + if params["parallel"]: + try: + pool = multiprocessing.Pool(len(config_names)) + arglists = [] + for config_name in config_names: + arglists.append( + (target_list, target_dicts, data, params, config_name) + ) + pool.map(CallGenerateOutputForConfig, arglists) + except KeyboardInterrupt as e: + pool.terminate() + raise e + else: + for config_name in config_names: + GenerateOutputForConfig( + target_list, target_dicts, data, params, config_name + ) diff --git a/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/compile_commands_json.py b/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/compile_commands_json.py index 1b8490451f9793..9bc21ff8342511 100644 --- a/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/compile_commands_json.py +++ b/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/compile_commands_json.py @@ -16,100 +16,105 @@ # Lifted from make.py. The actual values don't matter much. generator_default_variables = { - 'CONFIGURATION_NAME': '$(BUILDTYPE)', - 'EXECUTABLE_PREFIX': '', - 'EXECUTABLE_SUFFIX': '', - 'INTERMEDIATE_DIR': '$(obj).$(TOOLSET)/$(TARGET)/geni', - 'PRODUCT_DIR': '$(builddir)', - 'RULE_INPUT_DIRNAME': '%(INPUT_DIRNAME)s', - 'RULE_INPUT_EXT': '$(suffix $<)', - 'RULE_INPUT_NAME': '$(notdir $<)', - 'RULE_INPUT_PATH': '$(abspath $<)', - 'RULE_INPUT_ROOT': '%(INPUT_ROOT)s', - 'SHARED_INTERMEDIATE_DIR': '$(obj)/gen', - 'SHARED_LIB_PREFIX': 'lib', - 'STATIC_LIB_PREFIX': 'lib', - 'STATIC_LIB_SUFFIX': '.a', + "CONFIGURATION_NAME": "$(BUILDTYPE)", + "EXECUTABLE_PREFIX": "", + "EXECUTABLE_SUFFIX": "", + "INTERMEDIATE_DIR": "$(obj).$(TOOLSET)/$(TARGET)/geni", + "PRODUCT_DIR": "$(builddir)", + "RULE_INPUT_DIRNAME": "%(INPUT_DIRNAME)s", + "RULE_INPUT_EXT": "$(suffix $<)", + "RULE_INPUT_NAME": "$(notdir $<)", + "RULE_INPUT_PATH": "$(abspath $<)", + "RULE_INPUT_ROOT": "%(INPUT_ROOT)s", + "SHARED_INTERMEDIATE_DIR": "$(obj)/gen", + "SHARED_LIB_PREFIX": "lib", + "STATIC_LIB_PREFIX": "lib", + "STATIC_LIB_SUFFIX": ".a", } def IsMac(params): - return 'mac' == gyp.common.GetFlavor(params) + return "mac" == gyp.common.GetFlavor(params) def CalculateVariables(default_variables, params): - default_variables.setdefault('OS', gyp.common.GetFlavor(params)) + default_variables.setdefault("OS", gyp.common.GetFlavor(params)) def AddCommandsForTarget(cwd, target, params, per_config_commands): - output_dir = params['generator_flags']['output_dir'] - for configuration_name, configuration in target['configurations'].items(): - builddir_name = os.path.join(output_dir, configuration_name) - - if IsMac(params): - xcode_settings = gyp.xcode_emulation.XcodeSettings(target) - cflags = xcode_settings.GetCflags(configuration_name) - cflags_c = xcode_settings.GetCflagsC(configuration_name) - cflags_cc = xcode_settings.GetCflagsCC(configuration_name) - else: - cflags = configuration.get('cflags', []) - cflags_c = configuration.get('cflags_c', []) - cflags_cc = configuration.get('cflags_cc', []) - - cflags_c = cflags + cflags_c - cflags_cc = cflags + cflags_cc - - defines = configuration.get('defines', []) - defines = ['-D' + s for s in defines] - - # TODO(bnoordhuis) Handle generated source files. - sources = target.get('sources', []) - sources = [s for s in sources if s.endswith('.c') or s.endswith('.cc')] - - def resolve(filename): - return os.path.abspath(os.path.join(cwd, filename)) - - # TODO(bnoordhuis) Handle generated header files. - include_dirs = configuration.get('include_dirs', []) - include_dirs = [s for s in include_dirs if not s.startswith('$(obj)')] - includes = ['-I' + resolve(s) for s in include_dirs] - - defines = gyp.common.EncodePOSIXShellList(defines) - includes = gyp.common.EncodePOSIXShellList(includes) - cflags_c = gyp.common.EncodePOSIXShellList(cflags_c) - cflags_cc = gyp.common.EncodePOSIXShellList(cflags_cc) - - commands = per_config_commands.setdefault(configuration_name, []) - for source in sources: - file = resolve(source) - isc = source.endswith('.c') - cc = 'cc' if isc else 'c++' - cflags = cflags_c if isc else cflags_cc - command = ' '.join((cc, defines, includes, cflags, - '-c', gyp.common.EncodePOSIXShellArgument(file))) - commands.append(dict(command=command, directory=output_dir, file=file)) + output_dir = params["generator_flags"].get("output_dir", "out") + for configuration_name, configuration in target["configurations"].items(): + if IsMac(params): + xcode_settings = gyp.xcode_emulation.XcodeSettings(target) + cflags = xcode_settings.GetCflags(configuration_name) + cflags_c = xcode_settings.GetCflagsC(configuration_name) + cflags_cc = xcode_settings.GetCflagsCC(configuration_name) + else: + cflags = configuration.get("cflags", []) + cflags_c = configuration.get("cflags_c", []) + cflags_cc = configuration.get("cflags_cc", []) + + cflags_c = cflags + cflags_c + cflags_cc = cflags + cflags_cc + + defines = configuration.get("defines", []) + defines = ["-D" + s for s in defines] + + # TODO(bnoordhuis) Handle generated source files. + sources = target.get("sources", []) + sources = [s for s in sources if s.endswith(".c") or s.endswith(".cc")] + + def resolve(filename): + return os.path.abspath(os.path.join(cwd, filename)) + + # TODO(bnoordhuis) Handle generated header files. + include_dirs = configuration.get("include_dirs", []) + include_dirs = [s for s in include_dirs if not s.startswith("$(obj)")] + includes = ["-I" + resolve(s) for s in include_dirs] + + defines = gyp.common.EncodePOSIXShellList(defines) + includes = gyp.common.EncodePOSIXShellList(includes) + cflags_c = gyp.common.EncodePOSIXShellList(cflags_c) + cflags_cc = gyp.common.EncodePOSIXShellList(cflags_cc) + + commands = per_config_commands.setdefault(configuration_name, []) + for source in sources: + file = resolve(source) + isc = source.endswith(".c") + cc = "cc" if isc else "c++" + cflags = cflags_c if isc else cflags_cc + command = " ".join( + ( + cc, + defines, + includes, + cflags, + "-c", + gyp.common.EncodePOSIXShellArgument(file), + ) + ) + commands.append(dict(command=command, directory=output_dir, file=file)) def GenerateOutput(target_list, target_dicts, data, params): - per_config_commands = {} - for qualified_target, target in target_dicts.items(): - build_file, target_name, toolset = ( - gyp.common.ParseQualifiedTarget(qualified_target)) - if IsMac(params): - settings = data[build_file] - gyp.xcode_emulation.MergeGlobalXcodeSettingsToSpec(settings, target) - cwd = os.path.dirname(build_file) - AddCommandsForTarget(cwd, target, params, per_config_commands) - - output_dir = params['generator_flags']['output_dir'] - for configuration_name, commands in per_config_commands.items(): - filename = os.path.join(output_dir, - configuration_name, - 'compile_commands.json') - gyp.common.EnsureDirExists(filename) - fp = open(filename, 'w') - json.dump(commands, fp=fp, indent=0, check_circular=False) + per_config_commands = {} + for qualified_target, target in target_dicts.items(): + build_file, target_name, toolset = gyp.common.ParseQualifiedTarget( + qualified_target + ) + if IsMac(params): + settings = data[build_file] + gyp.xcode_emulation.MergeGlobalXcodeSettingsToSpec(settings, target) + cwd = os.path.dirname(build_file) + AddCommandsForTarget(cwd, target, params, per_config_commands) + + output_dir = params["generator_flags"].get("output_dir", "out") + for configuration_name, commands in per_config_commands.items(): + filename = os.path.join(output_dir, configuration_name, "compile_commands.json") + gyp.common.EnsureDirExists(filename) + fp = open(filename, "w") + json.dump(commands, fp=fp, indent=0, check_circular=False) def PerformBuild(data, configurations, params): - pass + pass diff --git a/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/dump_dependency_json.py b/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/dump_dependency_json.py index 8e4f3168f3e7ef..46f68e038418f3 100644 --- a/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/dump_dependency_json.py +++ b/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/dump_dependency_json.py @@ -1,100 +1,104 @@ -from __future__ import print_function # Copyright (c) 2012 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -import collections +from __future__ import print_function + import os import gyp import gyp.common import gyp.msvs_emulation import json -import sys generator_supports_multiple_toolsets = True generator_wants_static_library_dependencies_adjusted = False -generator_filelist_paths = { -} - -generator_default_variables = { -} -for dirname in ['INTERMEDIATE_DIR', 'SHARED_INTERMEDIATE_DIR', 'PRODUCT_DIR', - 'LIB_DIR', 'SHARED_LIB_DIR']: - # Some gyp steps fail if these are empty(!). - generator_default_variables[dirname] = 'dir' -for unused in ['RULE_INPUT_PATH', 'RULE_INPUT_ROOT', 'RULE_INPUT_NAME', - 'RULE_INPUT_DIRNAME', 'RULE_INPUT_EXT', - 'EXECUTABLE_PREFIX', 'EXECUTABLE_SUFFIX', - 'STATIC_LIB_PREFIX', 'STATIC_LIB_SUFFIX', - 'SHARED_LIB_PREFIX', 'SHARED_LIB_SUFFIX', - 'CONFIGURATION_NAME']: - generator_default_variables[unused] = '' +generator_filelist_paths = {} + +generator_default_variables = {} +for dirname in [ + "INTERMEDIATE_DIR", + "SHARED_INTERMEDIATE_DIR", + "PRODUCT_DIR", + "LIB_DIR", + "SHARED_LIB_DIR", +]: + # Some gyp steps fail if these are empty(!). + generator_default_variables[dirname] = "dir" +for unused in [ + "RULE_INPUT_PATH", + "RULE_INPUT_ROOT", + "RULE_INPUT_NAME", + "RULE_INPUT_DIRNAME", + "RULE_INPUT_EXT", + "EXECUTABLE_PREFIX", + "EXECUTABLE_SUFFIX", + "STATIC_LIB_PREFIX", + "STATIC_LIB_SUFFIX", + "SHARED_LIB_PREFIX", + "SHARED_LIB_SUFFIX", + "CONFIGURATION_NAME", +]: + generator_default_variables[unused] = "" def CalculateVariables(default_variables, params): - generator_flags = params.get('generator_flags', {}) - for key, val in generator_flags.items(): - default_variables.setdefault(key, val) - default_variables.setdefault('OS', gyp.common.GetFlavor(params)) - - flavor = gyp.common.GetFlavor(params) - if flavor =='win': - # Copy additional generator configuration data from VS, which is shared - # by the Windows Ninja generator. - import gyp.generator.msvs as msvs_generator - generator_additional_non_configuration_keys = getattr(msvs_generator, - 'generator_additional_non_configuration_keys', []) - generator_additional_path_sections = getattr(msvs_generator, - 'generator_additional_path_sections', []) + generator_flags = params.get("generator_flags", {}) + for key, val in generator_flags.items(): + default_variables.setdefault(key, val) + default_variables.setdefault("OS", gyp.common.GetFlavor(params)) - gyp.msvs_emulation.CalculateCommonVariables(default_variables, params) + flavor = gyp.common.GetFlavor(params) + if flavor == "win": + gyp.msvs_emulation.CalculateCommonVariables(default_variables, params) def CalculateGeneratorInputInfo(params): - """Calculate the generator specific info that gets fed to input (called by + """Calculate the generator specific info that gets fed to input (called by gyp).""" - generator_flags = params.get('generator_flags', {}) - if generator_flags.get('adjust_static_libraries', False): - global generator_wants_static_library_dependencies_adjusted - generator_wants_static_library_dependencies_adjusted = True - - toplevel = params['options'].toplevel_dir - generator_dir = os.path.relpath(params['options'].generator_output or '.') - # output_dir: relative path from generator_dir to the build directory. - output_dir = generator_flags.get('output_dir', 'out') - qualified_out_dir = os.path.normpath(os.path.join( - toplevel, generator_dir, output_dir, 'gypfiles')) - global generator_filelist_paths - generator_filelist_paths = { - 'toplevel': toplevel, - 'qualified_out_dir': qualified_out_dir, - } + generator_flags = params.get("generator_flags", {}) + if generator_flags.get("adjust_static_libraries", False): + global generator_wants_static_library_dependencies_adjusted + generator_wants_static_library_dependencies_adjusted = True + + toplevel = params["options"].toplevel_dir + generator_dir = os.path.relpath(params["options"].generator_output or ".") + # output_dir: relative path from generator_dir to the build directory. + output_dir = generator_flags.get("output_dir", "out") + qualified_out_dir = os.path.normpath( + os.path.join(toplevel, generator_dir, output_dir, "gypfiles") + ) + global generator_filelist_paths + generator_filelist_paths = { + "toplevel": toplevel, + "qualified_out_dir": qualified_out_dir, + } + def GenerateOutput(target_list, target_dicts, data, params): - # Map of target -> list of targets it depends on. - edges = {} - - # Queue of targets to visit. - targets_to_visit = target_list[:] - - while len(targets_to_visit) > 0: - target = targets_to_visit.pop() - if target in edges: - continue - edges[target] = [] - - for dep in target_dicts[target].get('dependencies', []): - edges[target].append(dep) - targets_to_visit.append(dep) - - try: - filepath = params['generator_flags']['output_dir'] - except KeyError: - filepath = '.' - filename = os.path.join(filepath, 'dump.json') - f = open(filename, 'w') - json.dump(edges, f) - f.close() - print('Wrote json to %s.' % filename) + # Map of target -> list of targets it depends on. + edges = {} + + # Queue of targets to visit. + targets_to_visit = target_list[:] + + while len(targets_to_visit) > 0: + target = targets_to_visit.pop() + if target in edges: + continue + edges[target] = [] + + for dep in target_dicts[target].get("dependencies", []): + edges[target].append(dep) + targets_to_visit.append(dep) + + try: + filepath = params["generator_flags"]["output_dir"] + except KeyError: + filepath = "." + filename = os.path.join(filepath, "dump.json") + f = open(filename, "w") + json.dump(edges, f) + f.close() + print("Wrote json to %s." % filename) diff --git a/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/eclipse.py b/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/eclipse.py index 91f187d685ad51..4bd49725dc1e89 100644 --- a/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/eclipse.py +++ b/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/eclipse.py @@ -30,402 +30,441 @@ generator_wants_static_library_dependencies_adjusted = False -generator_default_variables = { -} - -for dirname in ['INTERMEDIATE_DIR', 'PRODUCT_DIR', 'LIB_DIR', 'SHARED_LIB_DIR']: - # Some gyp steps fail if these are empty(!), so we convert them to variables - generator_default_variables[dirname] = '$' + dirname - -for unused in ['RULE_INPUT_PATH', 'RULE_INPUT_ROOT', 'RULE_INPUT_NAME', - 'RULE_INPUT_DIRNAME', 'RULE_INPUT_EXT', - 'EXECUTABLE_PREFIX', 'EXECUTABLE_SUFFIX', - 'STATIC_LIB_PREFIX', 'STATIC_LIB_SUFFIX', - 'SHARED_LIB_PREFIX', 'SHARED_LIB_SUFFIX', - 'CONFIGURATION_NAME']: - generator_default_variables[unused] = '' +generator_default_variables = {} + +for dirname in ["INTERMEDIATE_DIR", "PRODUCT_DIR", "LIB_DIR", "SHARED_LIB_DIR"]: + # Some gyp steps fail if these are empty(!), so we convert them to variables + generator_default_variables[dirname] = "$" + dirname + +for unused in [ + "RULE_INPUT_PATH", + "RULE_INPUT_ROOT", + "RULE_INPUT_NAME", + "RULE_INPUT_DIRNAME", + "RULE_INPUT_EXT", + "EXECUTABLE_PREFIX", + "EXECUTABLE_SUFFIX", + "STATIC_LIB_PREFIX", + "STATIC_LIB_SUFFIX", + "SHARED_LIB_PREFIX", + "SHARED_LIB_SUFFIX", + "CONFIGURATION_NAME", +]: + generator_default_variables[unused] = "" # Include dirs will occasionally use the SHARED_INTERMEDIATE_DIR variable as # part of the path when dealing with generated headers. This value will be # replaced dynamically for each configuration. -generator_default_variables['SHARED_INTERMEDIATE_DIR'] = \ - '$SHARED_INTERMEDIATE_DIR' +generator_default_variables["SHARED_INTERMEDIATE_DIR"] = "$SHARED_INTERMEDIATE_DIR" def CalculateVariables(default_variables, params): - generator_flags = params.get('generator_flags', {}) - for key, val in generator_flags.items(): - default_variables.setdefault(key, val) - flavor = gyp.common.GetFlavor(params) - default_variables.setdefault('OS', flavor) - if flavor == 'win': - # Copy additional generator configuration data from VS, which is shared - # by the Eclipse generator. - import gyp.generator.msvs as msvs_generator - generator_additional_non_configuration_keys = getattr(msvs_generator, - 'generator_additional_non_configuration_keys', []) - generator_additional_path_sections = getattr(msvs_generator, - 'generator_additional_path_sections', []) - - gyp.msvs_emulation.CalculateCommonVariables(default_variables, params) + generator_flags = params.get("generator_flags", {}) + for key, val in generator_flags.items(): + default_variables.setdefault(key, val) + flavor = gyp.common.GetFlavor(params) + default_variables.setdefault("OS", flavor) + if flavor == "win": + gyp.msvs_emulation.CalculateCommonVariables(default_variables, params) def CalculateGeneratorInputInfo(params): - """Calculate the generator specific info that gets fed to input (called by + """Calculate the generator specific info that gets fed to input (called by gyp).""" - generator_flags = params.get('generator_flags', {}) - if generator_flags.get('adjust_static_libraries', False): - global generator_wants_static_library_dependencies_adjusted - generator_wants_static_library_dependencies_adjusted = True - - -def GetAllIncludeDirectories(target_list, target_dicts, - shared_intermediate_dirs, config_name, params, - compiler_path): - """Calculate the set of include directories to be used. + generator_flags = params.get("generator_flags", {}) + if generator_flags.get("adjust_static_libraries", False): + global generator_wants_static_library_dependencies_adjusted + generator_wants_static_library_dependencies_adjusted = True + + +def GetAllIncludeDirectories( + target_list, + target_dicts, + shared_intermediate_dirs, + config_name, + params, + compiler_path, +): + """Calculate the set of include directories to be used. Returns: A list including all the include_dir's specified for every target followed by any include directories that were added as cflag compiler options. """ - gyp_includes_set = set() - compiler_includes_list = [] - - # Find compiler's default include dirs. - if compiler_path: - command = shlex.split(compiler_path) - command.extend(['-E', '-xc++', '-v', '-']) - proc = subprocess.Popen(args=command, stdin=subprocess.PIPE, - stdout=subprocess.PIPE, stderr=subprocess.PIPE) - output = proc.communicate()[1] - if PY3: - output = output.decode('utf-8') - # Extract the list of include dirs from the output, which has this format: - # ... - # #include "..." search starts here: - # #include <...> search starts here: - # /usr/include/c++/4.6 - # /usr/local/include - # End of search list. - # ... - in_include_list = False - for line in output.splitlines(): - if line.startswith('#include'): - in_include_list = True - continue - if line.startswith('End of search list.'): - break - if in_include_list: - include_dir = line.strip() - if include_dir not in compiler_includes_list: - compiler_includes_list.append(include_dir) - - flavor = gyp.common.GetFlavor(params) - if flavor == 'win': - generator_flags = params.get('generator_flags', {}) - for target_name in target_list: - target = target_dicts[target_name] - if config_name in target['configurations']: - config = target['configurations'][config_name] - - # Look for any include dirs that were explicitly added via cflags. This - # may be done in gyp files to force certain includes to come at the end. - # TODO(jgreenwald): Change the gyp files to not abuse cflags for this, and - # remove this. - if flavor == 'win': - msvs_settings = gyp.msvs_emulation.MsvsSettings(target, generator_flags) - cflags = msvs_settings.GetCflags(config_name) - else: - cflags = config['cflags'] - for cflag in cflags: - if cflag.startswith('-I'): - include_dir = cflag[2:] - if include_dir not in compiler_includes_list: - compiler_includes_list.append(include_dir) - - # Find standard gyp include dirs. - if 'include_dirs' in config: - include_dirs = config['include_dirs'] - for shared_intermediate_dir in shared_intermediate_dirs: - for include_dir in include_dirs: - include_dir = include_dir.replace('$SHARED_INTERMEDIATE_DIR', - shared_intermediate_dir) - if not os.path.isabs(include_dir): - base_dir = os.path.dirname(target_name) - - include_dir = base_dir + '/' + include_dir - include_dir = os.path.abspath(include_dir) - - gyp_includes_set.add(include_dir) - - # Generate a list that has all the include dirs. - all_includes_list = list(gyp_includes_set) - all_includes_list.sort() - for compiler_include in compiler_includes_list: - if not compiler_include in gyp_includes_set: - all_includes_list.append(compiler_include) - - # All done. - return all_includes_list + gyp_includes_set = set() + compiler_includes_list = [] + + # Find compiler's default include dirs. + if compiler_path: + command = shlex.split(compiler_path) + command.extend(["-E", "-xc++", "-v", "-"]) + proc = subprocess.Popen( + args=command, + stdin=subprocess.PIPE, + stdout=subprocess.PIPE, + stderr=subprocess.PIPE, + ) + output = proc.communicate()[1] + if PY3: + output = output.decode("utf-8") + # Extract the list of include dirs from the output, which has this format: + # ... + # #include "..." search starts here: + # #include <...> search starts here: + # /usr/include/c++/4.6 + # /usr/local/include + # End of search list. + # ... + in_include_list = False + for line in output.splitlines(): + if line.startswith("#include"): + in_include_list = True + continue + if line.startswith("End of search list."): + break + if in_include_list: + include_dir = line.strip() + if include_dir not in compiler_includes_list: + compiler_includes_list.append(include_dir) + + flavor = gyp.common.GetFlavor(params) + if flavor == "win": + generator_flags = params.get("generator_flags", {}) + for target_name in target_list: + target = target_dicts[target_name] + if config_name in target["configurations"]: + config = target["configurations"][config_name] + + # Look for any include dirs that were explicitly added via cflags. This + # may be done in gyp files to force certain includes to come at the end. + # TODO(jgreenwald): Change the gyp files to not abuse cflags for this, and + # remove this. + if flavor == "win": + msvs_settings = gyp.msvs_emulation.MsvsSettings(target, generator_flags) + cflags = msvs_settings.GetCflags(config_name) + else: + cflags = config["cflags"] + for cflag in cflags: + if cflag.startswith("-I"): + include_dir = cflag[2:] + if include_dir not in compiler_includes_list: + compiler_includes_list.append(include_dir) + + # Find standard gyp include dirs. + if "include_dirs" in config: + include_dirs = config["include_dirs"] + for shared_intermediate_dir in shared_intermediate_dirs: + for include_dir in include_dirs: + include_dir = include_dir.replace( + "$SHARED_INTERMEDIATE_DIR", shared_intermediate_dir + ) + if not os.path.isabs(include_dir): + base_dir = os.path.dirname(target_name) + + include_dir = base_dir + "/" + include_dir + include_dir = os.path.abspath(include_dir) + + gyp_includes_set.add(include_dir) + + # Generate a list that has all the include dirs. + all_includes_list = list(gyp_includes_set) + all_includes_list.sort() + for compiler_include in compiler_includes_list: + if compiler_include not in gyp_includes_set: + all_includes_list.append(compiler_include) + + # All done. + return all_includes_list def GetCompilerPath(target_list, data, options): - """Determine a command that can be used to invoke the compiler. + """Determine a command that can be used to invoke the compiler. Returns: If this is a gyp project that has explicit make settings, try to determine the compiler from that. Otherwise, see if a compiler was specified via the CC_target environment variable. """ - # First, see if the compiler is configured in make's settings. - build_file, _, _ = gyp.common.ParseQualifiedTarget(target_list[0]) - make_global_settings_dict = data[build_file].get('make_global_settings', {}) - for key, value in make_global_settings_dict: - if key in ['CC', 'CXX']: - return os.path.join(options.toplevel_dir, value) + # First, see if the compiler is configured in make's settings. + build_file, _, _ = gyp.common.ParseQualifiedTarget(target_list[0]) + make_global_settings_dict = data[build_file].get("make_global_settings", {}) + for key, value in make_global_settings_dict: + if key in ["CC", "CXX"]: + return os.path.join(options.toplevel_dir, value) - # Check to see if the compiler was specified as an environment variable. - for key in ['CC_target', 'CC', 'CXX']: - compiler = os.environ.get(key) - if compiler: - return compiler + # Check to see if the compiler was specified as an environment variable. + for key in ["CC_target", "CC", "CXX"]: + compiler = os.environ.get(key) + if compiler: + return compiler - return 'gcc' + return "gcc" -def GetAllDefines(target_list, target_dicts, data, config_name, params, - compiler_path): - """Calculate the defines for a project. +def GetAllDefines(target_list, target_dicts, data, config_name, params, compiler_path): + """Calculate the defines for a project. Returns: - A dict that includes explicit defines declared in gyp files along with all of - the default defines that the compiler uses. + A dict that includes explicit defines declared in gyp files along with all + of the default defines that the compiler uses. """ - # Get defines declared in the gyp files. - all_defines = {} - flavor = gyp.common.GetFlavor(params) - if flavor == 'win': - generator_flags = params.get('generator_flags', {}) - for target_name in target_list: - target = target_dicts[target_name] - - if flavor == 'win': - msvs_settings = gyp.msvs_emulation.MsvsSettings(target, generator_flags) - extra_defines = msvs_settings.GetComputedDefines(config_name) - else: - extra_defines = [] - if config_name in target['configurations']: - config = target['configurations'][config_name] - target_defines = config['defines'] - else: - target_defines = [] - for define in target_defines + extra_defines: - split_define = define.split('=', 1) - if len(split_define) == 1: - split_define.append('1') - if split_define[0].strip() in all_defines: - # Already defined - continue - all_defines[split_define[0].strip()] = split_define[1].strip() - # Get default compiler defines (if possible). - if flavor == 'win': - return all_defines # Default defines already processed in the loop above. - if compiler_path: - command = shlex.split(compiler_path) - command.extend(['-E', '-dM', '-']) - cpp_proc = subprocess.Popen(args=command, cwd='.', - stdin=subprocess.PIPE, stdout=subprocess.PIPE) - cpp_output = cpp_proc.communicate()[0] - if PY3: - cpp_output = cpp_output.decode('utf-8') - cpp_lines = cpp_output.split('\n') - for cpp_line in cpp_lines: - if not cpp_line.strip(): - continue - cpp_line_parts = cpp_line.split(' ', 2) - key = cpp_line_parts[1] - if len(cpp_line_parts) >= 3: - val = cpp_line_parts[2] - else: - val = '1' - all_defines[key] = val - - return all_defines + # Get defines declared in the gyp files. + all_defines = {} + flavor = gyp.common.GetFlavor(params) + if flavor == "win": + generator_flags = params.get("generator_flags", {}) + for target_name in target_list: + target = target_dicts[target_name] + + if flavor == "win": + msvs_settings = gyp.msvs_emulation.MsvsSettings(target, generator_flags) + extra_defines = msvs_settings.GetComputedDefines(config_name) + else: + extra_defines = [] + if config_name in target["configurations"]: + config = target["configurations"][config_name] + target_defines = config["defines"] + else: + target_defines = [] + for define in target_defines + extra_defines: + split_define = define.split("=", 1) + if len(split_define) == 1: + split_define.append("1") + if split_define[0].strip() in all_defines: + # Already defined + continue + all_defines[split_define[0].strip()] = split_define[1].strip() + # Get default compiler defines (if possible). + if flavor == "win": + return all_defines # Default defines already processed in the loop above. + if compiler_path: + command = shlex.split(compiler_path) + command.extend(["-E", "-dM", "-"]) + cpp_proc = subprocess.Popen( + args=command, cwd=".", stdin=subprocess.PIPE, stdout=subprocess.PIPE + ) + cpp_output = cpp_proc.communicate()[0] + if PY3: + cpp_output = cpp_output.decode("utf-8") + cpp_lines = cpp_output.split("\n") + for cpp_line in cpp_lines: + if not cpp_line.strip(): + continue + cpp_line_parts = cpp_line.split(" ", 2) + key = cpp_line_parts[1] + if len(cpp_line_parts) >= 3: + val = cpp_line_parts[2] + else: + val = "1" + all_defines[key] = val + + return all_defines def WriteIncludePaths(out, eclipse_langs, include_dirs): - """Write the includes section of a CDT settings export file.""" - - out.write('
    \n') - out.write(' \n') - for lang in eclipse_langs: - out.write(' \n' % lang) - for include_dir in include_dirs: - out.write(' %s\n' % - include_dir) - out.write(' \n') - out.write('
    \n') + """Write the includes section of a CDT settings export file.""" + + out.write( + '
    \n' + ) + out.write(' \n') + for lang in eclipse_langs: + out.write(' \n' % lang) + for include_dir in include_dirs: + out.write( + ' %s\n' + % include_dir + ) + out.write(" \n") + out.write("
    \n") def WriteMacros(out, eclipse_langs, defines): - """Write the macros section of a CDT settings export file.""" - - out.write('
    \n') - out.write(' \n') - for lang in eclipse_langs: - out.write(' \n' % lang) - for key in sorted(defines): - out.write(' %s%s\n' % - (escape(key), escape(defines[key]))) - out.write(' \n') - out.write('
    \n') - - -def GenerateOutputForConfig(target_list, target_dicts, data, params, - config_name): - options = params['options'] - generator_flags = params.get('generator_flags', {}) - - # build_dir: relative path from source root to our output files. - # e.g. "out/Debug" - build_dir = os.path.join(generator_flags.get('output_dir', 'out'), - config_name) - - toplevel_build = os.path.join(options.toplevel_dir, build_dir) - # Ninja uses out/Debug/gen while make uses out/Debug/obj/gen as the - # SHARED_INTERMEDIATE_DIR. Include both possible locations. - shared_intermediate_dirs = [os.path.join(toplevel_build, 'obj', 'gen'), - os.path.join(toplevel_build, 'gen')] - - GenerateCdtSettingsFile(target_list, - target_dicts, - data, - params, - config_name, - os.path.join(toplevel_build, - 'eclipse-cdt-settings.xml'), - options, - shared_intermediate_dirs) - GenerateClasspathFile(target_list, - target_dicts, - options.toplevel_dir, - toplevel_build, - os.path.join(toplevel_build, - 'eclipse-classpath.xml')) - - -def GenerateCdtSettingsFile(target_list, target_dicts, data, params, - config_name, out_name, options, - shared_intermediate_dirs): - gyp.common.EnsureDirExists(out_name) - with open(out_name, 'w') as out: - out.write('\n') - out.write('\n') - - eclipse_langs = ['C++ Source File', 'C Source File', 'Assembly Source File', - 'GNU C++', 'GNU C', 'Assembly'] - compiler_path = GetCompilerPath(target_list, data, options) - include_dirs = GetAllIncludeDirectories(target_list, target_dicts, - shared_intermediate_dirs, - config_name, params, compiler_path) - WriteIncludePaths(out, eclipse_langs, include_dirs) - defines = GetAllDefines(target_list, target_dicts, data, config_name, - params, compiler_path) - WriteMacros(out, eclipse_langs, defines) - - out.write('\n') - - -def GenerateClasspathFile(target_list, target_dicts, toplevel_dir, - toplevel_build, out_name): - '''Generates a classpath file suitable for symbol navigation and code + """Write the macros section of a CDT settings export file.""" + + out.write( + '
    \n' + ) + out.write(' \n') + for lang in eclipse_langs: + out.write(' \n' % lang) + for key in sorted(defines): + out.write( + " %s%s\n" + % (escape(key), escape(defines[key])) + ) + out.write(" \n") + out.write("
    \n") + + +def GenerateOutputForConfig(target_list, target_dicts, data, params, config_name): + options = params["options"] + generator_flags = params.get("generator_flags", {}) + + # build_dir: relative path from source root to our output files. + # e.g. "out/Debug" + build_dir = os.path.join(generator_flags.get("output_dir", "out"), config_name) + + toplevel_build = os.path.join(options.toplevel_dir, build_dir) + # Ninja uses out/Debug/gen while make uses out/Debug/obj/gen as the + # SHARED_INTERMEDIATE_DIR. Include both possible locations. + shared_intermediate_dirs = [ + os.path.join(toplevel_build, "obj", "gen"), + os.path.join(toplevel_build, "gen"), + ] + + GenerateCdtSettingsFile( + target_list, + target_dicts, + data, + params, + config_name, + os.path.join(toplevel_build, "eclipse-cdt-settings.xml"), + options, + shared_intermediate_dirs, + ) + GenerateClasspathFile( + target_list, + target_dicts, + options.toplevel_dir, + toplevel_build, + os.path.join(toplevel_build, "eclipse-classpath.xml"), + ) + + +def GenerateCdtSettingsFile( + target_list, + target_dicts, + data, + params, + config_name, + out_name, + options, + shared_intermediate_dirs, +): + gyp.common.EnsureDirExists(out_name) + with open(out_name, "w") as out: + out.write('\n') + out.write("\n") + + eclipse_langs = [ + "C++ Source File", + "C Source File", + "Assembly Source File", + "GNU C++", + "GNU C", + "Assembly", + ] + compiler_path = GetCompilerPath(target_list, data, options) + include_dirs = GetAllIncludeDirectories( + target_list, + target_dicts, + shared_intermediate_dirs, + config_name, + params, + compiler_path, + ) + WriteIncludePaths(out, eclipse_langs, include_dirs) + defines = GetAllDefines( + target_list, target_dicts, data, config_name, params, compiler_path + ) + WriteMacros(out, eclipse_langs, defines) + + out.write("\n") + + +def GenerateClasspathFile( + target_list, target_dicts, toplevel_dir, toplevel_build, out_name +): + """Generates a classpath file suitable for symbol navigation and code completion of Java code (such as in Android projects) by finding all - .java and .jar files used as action inputs.''' - gyp.common.EnsureDirExists(out_name) - result = ET.Element('classpath') - - def AddElements(kind, paths): - # First, we need to normalize the paths so they are all relative to the - # toplevel dir. - rel_paths = set() - for path in paths: - if os.path.isabs(path): - rel_paths.add(os.path.relpath(path, toplevel_dir)) - else: - rel_paths.add(path) - - for path in sorted(rel_paths): - entry_element = ET.SubElement(result, 'classpathentry') - entry_element.set('kind', kind) - entry_element.set('path', path) - - AddElements('lib', GetJavaJars(target_list, target_dicts, toplevel_dir)) - AddElements('src', GetJavaSourceDirs(target_list, target_dicts, toplevel_dir)) - # Include the standard JRE container and a dummy out folder - AddElements('con', ['org.eclipse.jdt.launching.JRE_CONTAINER']) - # Include a dummy out folder so that Eclipse doesn't use the default /bin - # folder in the root of the project. - AddElements('output', [os.path.join(toplevel_build, '.eclipse-java-build')]) - - ET.ElementTree(result).write(out_name) + .java and .jar files used as action inputs.""" + gyp.common.EnsureDirExists(out_name) + result = ET.Element("classpath") + + def AddElements(kind, paths): + # First, we need to normalize the paths so they are all relative to the + # toplevel dir. + rel_paths = set() + for path in paths: + if os.path.isabs(path): + rel_paths.add(os.path.relpath(path, toplevel_dir)) + else: + rel_paths.add(path) + + for path in sorted(rel_paths): + entry_element = ET.SubElement(result, "classpathentry") + entry_element.set("kind", kind) + entry_element.set("path", path) + + AddElements("lib", GetJavaJars(target_list, target_dicts, toplevel_dir)) + AddElements("src", GetJavaSourceDirs(target_list, target_dicts, toplevel_dir)) + # Include the standard JRE container and a dummy out folder + AddElements("con", ["org.eclipse.jdt.launching.JRE_CONTAINER"]) + # Include a dummy out folder so that Eclipse doesn't use the default /bin + # folder in the root of the project. + AddElements("output", [os.path.join(toplevel_build, ".eclipse-java-build")]) + + ET.ElementTree(result).write(out_name) def GetJavaJars(target_list, target_dicts, toplevel_dir): - '''Generates a sequence of all .jars used as inputs.''' - for target_name in target_list: - target = target_dicts[target_name] - for action in target.get('actions', []): - for input_ in action['inputs']: - if os.path.splitext(input_)[1] == '.jar' and not input_.startswith('$'): - if os.path.isabs(input_): - yield input_ - else: - yield os.path.join(os.path.dirname(target_name), input_) + """Generates a sequence of all .jars used as inputs.""" + for target_name in target_list: + target = target_dicts[target_name] + for action in target.get("actions", []): + for input_ in action["inputs"]: + if os.path.splitext(input_)[1] == ".jar" and not input_.startswith("$"): + if os.path.isabs(input_): + yield input_ + else: + yield os.path.join(os.path.dirname(target_name), input_) def GetJavaSourceDirs(target_list, target_dicts, toplevel_dir): - '''Generates a sequence of all likely java package root directories.''' - for target_name in target_list: - target = target_dicts[target_name] - for action in target.get('actions', []): - for input_ in action['inputs']: - if (os.path.splitext(input_)[1] == '.java' and - not input_.startswith('$')): - dir_ = os.path.dirname(os.path.join(os.path.dirname(target_name), - input_)) - # If there is a parent 'src' or 'java' folder, navigate up to it - - # these are canonical package root names in Chromium. This will - # break if 'src' or 'java' exists in the package structure. This - # could be further improved by inspecting the java file for the - # package name if this proves to be too fragile in practice. - parent_search = dir_ - while os.path.basename(parent_search) not in ['src', 'java']: - parent_search, _ = os.path.split(parent_search) - if not parent_search or parent_search == toplevel_dir: - # Didn't find a known root, just return the original path - yield dir_ - break - else: - yield parent_search + """Generates a sequence of all likely java package root directories.""" + for target_name in target_list: + target = target_dicts[target_name] + for action in target.get("actions", []): + for input_ in action["inputs"]: + if os.path.splitext(input_)[1] == ".java" and not input_.startswith( + "$" + ): + dir_ = os.path.dirname( + os.path.join(os.path.dirname(target_name), input_) + ) + # If there is a parent 'src' or 'java' folder, navigate up to it - + # these are canonical package root names in Chromium. This will + # break if 'src' or 'java' exists in the package structure. This + # could be further improved by inspecting the java file for the + # package name if this proves to be too fragile in practice. + parent_search = dir_ + while os.path.basename(parent_search) not in ["src", "java"]: + parent_search, _ = os.path.split(parent_search) + if not parent_search or parent_search == toplevel_dir: + # Didn't find a known root, just return the original path + yield dir_ + break + else: + yield parent_search def GenerateOutput(target_list, target_dicts, data, params): - """Generate an XML settings file that can be imported into a CDT project.""" + """Generate an XML settings file that can be imported into a CDT project.""" - if params['options'].generator_output: - raise NotImplementedError("--generator_output not implemented for eclipse") - - user_config = params.get('generator_flags', {}).get('config', None) - if user_config: - GenerateOutputForConfig(target_list, target_dicts, data, params, - user_config) - else: - config_names = target_dicts[target_list[0]]['configurations'].keys() - for config_name in config_names: - GenerateOutputForConfig(target_list, target_dicts, data, params, - config_name) + if params["options"].generator_output: + raise NotImplementedError("--generator_output not implemented for eclipse") + user_config = params.get("generator_flags", {}).get("config", None) + if user_config: + GenerateOutputForConfig(target_list, target_dicts, data, params, user_config) + else: + config_names = target_dicts[target_list[0]]["configurations"] + for config_name in config_names: + GenerateOutputForConfig( + target_list, target_dicts, data, params, config_name + ) diff --git a/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/gypd.py b/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/gypd.py index 78eeaa61b2294a..4171704c47a4b6 100644 --- a/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/gypd.py +++ b/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/gypd.py @@ -32,36 +32,33 @@ import gyp.common -import errno -import os import pprint # These variables should just be spit back out as variable references. _generator_identity_variables = [ - 'CONFIGURATION_NAME', - 'EXECUTABLE_PREFIX', - 'EXECUTABLE_SUFFIX', - 'INTERMEDIATE_DIR', - 'LIB_DIR', - 'PRODUCT_DIR', - 'RULE_INPUT_ROOT', - 'RULE_INPUT_DIRNAME', - 'RULE_INPUT_EXT', - 'RULE_INPUT_NAME', - 'RULE_INPUT_PATH', - 'SHARED_INTERMEDIATE_DIR', - 'SHARED_LIB_DIR', - 'SHARED_LIB_PREFIX', - 'SHARED_LIB_SUFFIX', - 'STATIC_LIB_PREFIX', - 'STATIC_LIB_SUFFIX', + "CONFIGURATION_NAME", + "EXECUTABLE_PREFIX", + "EXECUTABLE_SUFFIX", + "INTERMEDIATE_DIR", + "LIB_DIR", + "PRODUCT_DIR", + "RULE_INPUT_ROOT", + "RULE_INPUT_DIRNAME", + "RULE_INPUT_EXT", + "RULE_INPUT_NAME", + "RULE_INPUT_PATH", + "SHARED_INTERMEDIATE_DIR", + "SHARED_LIB_DIR", + "SHARED_LIB_PREFIX", + "SHARED_LIB_SUFFIX", + "STATIC_LIB_PREFIX", + "STATIC_LIB_SUFFIX", ] # gypd doesn't define a default value for OS like many other generator # modules. Specify "-D OS=whatever" on the command line to provide a value. -generator_default_variables = { -} +generator_default_variables = {} # gypd supports multiple toolsets generator_supports_multiple_toolsets = True @@ -71,24 +68,22 @@ # module should use < for the early phase and then switch to > for the late # phase. Bonus points for carrying @ back into the output too. for v in _generator_identity_variables: - generator_default_variables[v] = '<(%s)' % v + generator_default_variables[v] = "<(%s)" % v def GenerateOutput(target_list, target_dicts, data, params): - output_files = {} - for qualified_target in target_list: - [input_file, target] = \ - gyp.common.ParseQualifiedTarget(qualified_target)[0:2] - - if input_file[-4:] != '.gyp': - continue - input_file_stem = input_file[:-4] - output_file = input_file_stem + params['options'].suffix + '.gypd' - - if not output_file in output_files: - output_files[output_file] = input_file - - for output_file, input_file in output_files.items(): - output = open(output_file, 'w') - pprint.pprint(data[input_file], output) - output.close() + output_files = {} + for qualified_target in target_list: + [input_file, target] = gyp.common.ParseQualifiedTarget(qualified_target)[0:2] + + if input_file[-4:] != ".gyp": + continue + input_file_stem = input_file[:-4] + output_file = input_file_stem + params["options"].suffix + ".gypd" + + output_files[output_file] = output_files.get(output_file, input_file) + + for output_file, input_file in output_files.items(): + output = open(output_file, "w") + pprint.pprint(data[input_file], output) + output.close() diff --git a/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/gypsh.py b/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/gypsh.py index bd405f43a993d4..2d8aba5d1c19e9 100644 --- a/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/gypsh.py +++ b/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/gypsh.py @@ -21,36 +21,38 @@ # All of this stuff about generator variables was lovingly ripped from gypd.py. # That module has a much better description of what's going on and why. _generator_identity_variables = [ - 'EXECUTABLE_PREFIX', - 'EXECUTABLE_SUFFIX', - 'INTERMEDIATE_DIR', - 'PRODUCT_DIR', - 'RULE_INPUT_ROOT', - 'RULE_INPUT_DIRNAME', - 'RULE_INPUT_EXT', - 'RULE_INPUT_NAME', - 'RULE_INPUT_PATH', - 'SHARED_INTERMEDIATE_DIR', + "EXECUTABLE_PREFIX", + "EXECUTABLE_SUFFIX", + "INTERMEDIATE_DIR", + "PRODUCT_DIR", + "RULE_INPUT_ROOT", + "RULE_INPUT_DIRNAME", + "RULE_INPUT_EXT", + "RULE_INPUT_NAME", + "RULE_INPUT_PATH", + "SHARED_INTERMEDIATE_DIR", ] -generator_default_variables = { -} +generator_default_variables = {} for v in _generator_identity_variables: - generator_default_variables[v] = '<(%s)' % v + generator_default_variables[v] = "<(%s)" % v def GenerateOutput(target_list, target_dicts, data, params): - locals = { - 'target_list': target_list, - 'target_dicts': target_dicts, - 'data': data, - } - - # Use a banner that looks like the stock Python one and like what - # code.interact uses by default, but tack on something to indicate what - # locals are available, and identify gypsh. - banner='Python %s on %s\nlocals.keys() = %s\ngypsh' % \ - (sys.version, sys.platform, repr(sorted(locals.keys()))) - - code.interact(banner, local=locals) + locals = { + "target_list": target_list, + "target_dicts": target_dicts, + "data": data, + } + + # Use a banner that looks like the stock Python one and like what + # code.interact uses by default, but tack on something to indicate what + # locals are available, and identify gypsh. + banner = "Python %s on %s\nlocals.keys() = %s\ngypsh" % ( + sys.version, + sys.platform, + repr(sorted(locals.keys())), + ) + + code.interact(banner, local=locals) diff --git a/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/make.py b/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/make.py index 196053679492f2..6e1c5205cf2b64 100644 --- a/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/make.py +++ b/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/make.py @@ -25,7 +25,6 @@ import os import re -import sys import subprocess import gyp import gyp.common @@ -36,20 +35,20 @@ import hashlib generator_default_variables = { - 'EXECUTABLE_PREFIX': '', - 'EXECUTABLE_SUFFIX': '', - 'STATIC_LIB_PREFIX': 'lib', - 'SHARED_LIB_PREFIX': 'lib', - 'STATIC_LIB_SUFFIX': '.a', - 'INTERMEDIATE_DIR': '$(obj).$(TOOLSET)/$(TARGET)/geni', - 'SHARED_INTERMEDIATE_DIR': '$(obj)/gen', - 'PRODUCT_DIR': '$(builddir)', - 'RULE_INPUT_ROOT': '%(INPUT_ROOT)s', # This gets expanded by Python. - 'RULE_INPUT_DIRNAME': '%(INPUT_DIRNAME)s', # This gets expanded by Python. - 'RULE_INPUT_PATH': '$(abspath $<)', - 'RULE_INPUT_EXT': '$(suffix $<)', - 'RULE_INPUT_NAME': '$(notdir $<)', - 'CONFIGURATION_NAME': '$(BUILDTYPE)', + "EXECUTABLE_PREFIX": "", + "EXECUTABLE_SUFFIX": "", + "STATIC_LIB_PREFIX": "lib", + "SHARED_LIB_PREFIX": "lib", + "STATIC_LIB_SUFFIX": ".a", + "INTERMEDIATE_DIR": "$(obj).$(TOOLSET)/$(TARGET)/geni", + "SHARED_INTERMEDIATE_DIR": "$(obj)/gen", + "PRODUCT_DIR": "$(builddir)", + "RULE_INPUT_ROOT": "%(INPUT_ROOT)s", # This gets expanded by Python. + "RULE_INPUT_DIRNAME": "%(INPUT_DIRNAME)s", # This gets expanded by Python. + "RULE_INPUT_PATH": "$(abspath $<)", + "RULE_INPUT_EXT": "$(suffix $<)", + "RULE_INPUT_NAME": "$(notdir $<)", + "CONFIGURATION_NAME": "$(BUILDTYPE)", } # Make supports multiple toolsets @@ -66,63 +65,69 @@ def CalculateVariables(default_variables, params): - """Calculate additional variables for use in the build (called by gyp).""" - flavor = gyp.common.GetFlavor(params) - if flavor == 'mac': - default_variables.setdefault('OS', 'mac') - default_variables.setdefault('SHARED_LIB_SUFFIX', '.dylib') - default_variables.setdefault('SHARED_LIB_DIR', - generator_default_variables['PRODUCT_DIR']) - default_variables.setdefault('LIB_DIR', - generator_default_variables['PRODUCT_DIR']) - - # Copy additional generator configuration data from Xcode, which is shared - # by the Mac Make generator. - import gyp.generator.xcode as xcode_generator - global generator_additional_non_configuration_keys - generator_additional_non_configuration_keys = getattr(xcode_generator, - 'generator_additional_non_configuration_keys', []) - global generator_additional_path_sections - generator_additional_path_sections = getattr(xcode_generator, - 'generator_additional_path_sections', []) - global generator_extra_sources_for_rules - generator_extra_sources_for_rules = getattr(xcode_generator, - 'generator_extra_sources_for_rules', []) - COMPILABLE_EXTENSIONS.update({'.m': 'objc', '.mm' : 'objcxx'}) - else: - operating_system = flavor - if flavor == 'android': - operating_system = 'linux' # Keep this legacy behavior for now. - default_variables.setdefault('OS', operating_system) - if flavor == 'aix': - default_variables.setdefault('SHARED_LIB_SUFFIX', '.a') + """Calculate additional variables for use in the build (called by gyp).""" + flavor = gyp.common.GetFlavor(params) + if flavor == "mac": + default_variables.setdefault("OS", "mac") + default_variables.setdefault("SHARED_LIB_SUFFIX", ".dylib") + default_variables.setdefault( + "SHARED_LIB_DIR", generator_default_variables["PRODUCT_DIR"] + ) + default_variables.setdefault( + "LIB_DIR", generator_default_variables["PRODUCT_DIR"] + ) + + # Copy additional generator configuration data from Xcode, which is shared + # by the Mac Make generator. + import gyp.generator.xcode as xcode_generator + + global generator_additional_non_configuration_keys + generator_additional_non_configuration_keys = getattr( + xcode_generator, "generator_additional_non_configuration_keys", [] + ) + global generator_additional_path_sections + generator_additional_path_sections = getattr( + xcode_generator, "generator_additional_path_sections", [] + ) + global generator_extra_sources_for_rules + generator_extra_sources_for_rules = getattr( + xcode_generator, "generator_extra_sources_for_rules", [] + ) + COMPILABLE_EXTENSIONS.update({".m": "objc", ".mm": "objcxx"}) else: - default_variables.setdefault('SHARED_LIB_SUFFIX', '.so') - default_variables.setdefault('SHARED_LIB_DIR','$(builddir)/lib.$(TOOLSET)') - default_variables.setdefault('LIB_DIR', '$(obj).$(TOOLSET)') + operating_system = flavor + if flavor == "android": + operating_system = "linux" # Keep this legacy behavior for now. + default_variables.setdefault("OS", operating_system) + if flavor == "aix": + default_variables.setdefault("SHARED_LIB_SUFFIX", ".a") + else: + default_variables.setdefault("SHARED_LIB_SUFFIX", ".so") + default_variables.setdefault("SHARED_LIB_DIR", "$(builddir)/lib.$(TOOLSET)") + default_variables.setdefault("LIB_DIR", "$(obj).$(TOOLSET)") def CalculateGeneratorInputInfo(params): - """Calculate the generator specific info that gets fed to input (called by + """Calculate the generator specific info that gets fed to input (called by gyp).""" - generator_flags = params.get('generator_flags', {}) - android_ndk_version = generator_flags.get('android_ndk_version', None) - # Android NDK requires a strict link order. - if android_ndk_version: - global generator_wants_sorted_dependencies - generator_wants_sorted_dependencies = True - - output_dir = params['options'].generator_output or \ - params['options'].toplevel_dir - builddir_name = generator_flags.get('output_dir', 'out') - qualified_out_dir = os.path.normpath(os.path.join( - output_dir, builddir_name, 'gypfiles')) - - global generator_filelist_paths - generator_filelist_paths = { - 'toplevel': params['options'].toplevel_dir, - 'qualified_out_dir': qualified_out_dir, - } + generator_flags = params.get("generator_flags", {}) + android_ndk_version = generator_flags.get("android_ndk_version", None) + # Android NDK requires a strict link order. + if android_ndk_version: + global generator_wants_sorted_dependencies + generator_wants_sorted_dependencies = True + + output_dir = params["options"].generator_output or params["options"].toplevel_dir + builddir_name = generator_flags.get("output_dir", "out") + qualified_out_dir = os.path.normpath( + os.path.join(output_dir, builddir_name, "gypfiles") + ) + + global generator_filelist_paths + generator_filelist_paths = { + "toplevel": params["options"].toplevel_dir, + "qualified_out_dir": qualified_out_dir, + } # The .d checking code below uses these functions: @@ -135,7 +140,7 @@ def CalculateGeneratorInputInfo(params): # is for example # out/Release/.deps/out/Release/Chromium?Framework.framework/foo # This is the replacement character. -SPACE_REPLACEMENT = '?' +SPACE_REPLACEMENT = "?" LINK_COMMANDS_LINUX = """\ @@ -149,7 +154,7 @@ def CalculateGeneratorInputInfo(params): # special "figure out circular dependencies" flags around the entire # input list during linking. quiet_cmd_link = LINK($(TOOLSET)) $@ -cmd_link = $(LINK.$(TOOLSET)) $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ -Wl,--start-group $(LD_INPUTS) $(LIBS) -Wl,--end-group +cmd_link = $(LINK.$(TOOLSET)) -o $@ $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -Wl,--start-group $(LD_INPUTS) $(LIBS) -Wl,--end-group # We support two kinds of shared objects (.so): # 1) shared_library, which is just bundling together many dependent libraries @@ -168,10 +173,10 @@ def CalculateGeneratorInputInfo(params): # - Set SONAME to the library filename so our binaries don't reference # the local, absolute paths used on the link command-line. quiet_cmd_solink = SOLINK($(TOOLSET)) $@ -cmd_solink = $(LINK.$(TOOLSET)) -shared $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -Wl,-soname=$(@F) -o $@ -Wl,--whole-archive $(LD_INPUTS) -Wl,--no-whole-archive $(LIBS) +cmd_solink = $(LINK.$(TOOLSET)) -o $@ -shared $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -Wl,-soname=$(@F) -Wl,--whole-archive $(LD_INPUTS) -Wl,--no-whole-archive $(LIBS) quiet_cmd_solink_module = SOLINK_MODULE($(TOOLSET)) $@ -cmd_solink_module = $(LINK.$(TOOLSET)) -shared $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -Wl,-soname=$(@F) -o $@ -Wl,--start-group $(filter-out FORCE_DO_CMD, $^) -Wl,--end-group $(LIBS) +cmd_solink_module = $(LINK.$(TOOLSET)) -o $@ -shared $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -Wl,-soname=$(@F) -Wl,--start-group $(filter-out FORCE_DO_CMD, $^) -Wl,--end-group $(LIBS) """ LINK_COMMANDS_MAC = """\ @@ -201,7 +206,7 @@ def CalculateGeneratorInputInfo(params): quiet_cmd_link = LINK($(TOOLSET)) $@ quiet_cmd_link_host = LINK($(TOOLSET)) $@ cmd_link = $(LINK.$(TOOLSET)) $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ -Wl,--start-group $(LD_INPUTS) -Wl,--end-group $(LIBS) -cmd_link_host = $(LINK.$(TOOLSET)) $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ $(LD_INPUTS) $(LIBS) +cmd_link_host = $(LINK.$(TOOLSET)) $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ -Wl,--start-group $(LD_INPUTS) -Wl,--end-group $(LIBS) # Other shared-object link notes: # - Set SONAME to the library filename so our binaries don't reference @@ -255,7 +260,8 @@ def CalculateGeneratorInputInfo(params): # Header of toplevel Makefile. # This should go into the build tree, but it's easier to keep it here for now. -SHARED_HEADER = ("""\ +SHARED_HEADER = ( + """\ # We borrow heavily from the kernel build setup, though we are simpler since # we don't have Kconfig tweaking settings on us. @@ -327,8 +333,12 @@ def CalculateGeneratorInputInfo(params): space := $(empty) $(empty) # http://stackoverflow.com/questions/1189781/using-make-dir-or-notdir-on-a-path-with-spaces -replace_spaces = $(subst $(space),""" + SPACE_REPLACEMENT + """,$1) -unreplace_spaces = $(subst """ + SPACE_REPLACEMENT + """,$(space),$1) +replace_spaces = $(subst $(space),""" + + SPACE_REPLACEMENT + + """,$1) +unreplace_spaces = $(subst """ + + SPACE_REPLACEMENT + + """,$(space),$1) dirx = $(call unreplace_spaces,$(dir $(call replace_spaces,$1))) # Flags to make gcc output dependency info. Note that you need to be @@ -358,7 +368,7 @@ def CalculateGeneratorInputInfo(params): # and dollar signs past make, the shell, and sed at the same time. # Doesn't work with spaces, but that's fine: .d files have spaces in # their names replaced with other characters.""" -r""" + r""" define fixup_dep # The depfile may not exist if the input file didn't have any #includes. touch $(depfile).raw @@ -375,28 +385,27 @@ def CalculateGeneratorInputInfo(params): rm $(depfile).raw endef """ -""" + """ # Command definitions: # - cmd_foo is the actual command to run; # - quiet_cmd_foo is the brief-output summary of the command. quiet_cmd_cc = CC($(TOOLSET)) $@ -cmd_cc = $(CC.$(TOOLSET)) $(GYP_CFLAGS) $(DEPFLAGS) $(CFLAGS.$(TOOLSET)) -c -o $@ $< +cmd_cc = $(CC.$(TOOLSET)) -o $@ $< $(GYP_CFLAGS) $(DEPFLAGS) $(CFLAGS.$(TOOLSET)) -c quiet_cmd_cxx = CXX($(TOOLSET)) $@ -cmd_cxx = $(CXX.$(TOOLSET)) $(GYP_CXXFLAGS) $(DEPFLAGS) $(CXXFLAGS.$(TOOLSET)) -c -o $@ $< +cmd_cxx = $(CXX.$(TOOLSET)) -o $@ $< $(GYP_CXXFLAGS) $(DEPFLAGS) $(CXXFLAGS.$(TOOLSET)) -c %(extra_commands)s quiet_cmd_touch = TOUCH $@ cmd_touch = touch $@ quiet_cmd_copy = COPY $@ # send stderr to /dev/null to ignore messages when linking directories. -cmd_copy = rm -rf "$@" && cp %(copy_archive_args)s "$<" "$@" +cmd_copy = ln -f "$<" "$@" 2>/dev/null || (rm -rf "$@" && cp %(copy_archive_args)s "$<" "$@") %(link_commands)s """ - -r""" + r""" # Define an escape_quotes function to escape single quotes. # This allows us to handle quotes properly as long as we always use # use single quotes and escape_quotes. @@ -412,7 +421,7 @@ def CalculateGeneratorInputInfo(params): # (e.g., dash, bash). exact_echo = printf '%%s\n' '$(call escape_quotes,$(1))' """ -""" + """ # Helper to compare the command we're about to run against the command # we logged the last time we ran the command. Produces an empty # string (false) when the commands match. @@ -423,8 +432,9 @@ def CalculateGeneratorInputInfo(params): # $(filter-out $(cmd_$@), $(cmd_$(1)))) # We instead substitute each for the empty string into the other, and # say they're equal if both substitutions produce the empty string. -# .d files contain """ + SPACE_REPLACEMENT + \ - """ instead of spaces, take that into account. +# .d files contain """ + + SPACE_REPLACEMENT + + """ instead of spaces, take that into account. command_changed = $(or $(subst $(cmd_$(1)),,$(cmd_$(call replace_spaces,$@))),\\ $(subst $(cmd_$(call replace_spaces,$@)),,$(cmd_$(1)))) @@ -455,10 +465,12 @@ def CalculateGeneratorInputInfo(params): # Should always run for a given target to handle command-line changes. # Second argument, if non-zero, makes it do asm/C/C++ dependency munging. # Third argument, if non-zero, makes it do POSTBUILDS processing. -# Note: We intentionally do NOT call dirx for depfile, since it contains """ + \ - SPACE_REPLACEMENT + """ for -# spaces already and dirx strips the """ + SPACE_REPLACEMENT + \ - """ characters. +# Note: We intentionally do NOT call dirx for depfile, since it contains """ + + SPACE_REPLACEMENT + + """ for +# spaces already and dirx strips the """ + + SPACE_REPLACEMENT + + """ characters. define do_cmd $(if $(or $(command_changed),$(prereq_changed)), @$(call exact_echo, $($(quiet)cmd_$(1))) @@ -491,7 +503,8 @@ def CalculateGeneratorInputInfo(params): .PHONY: FORCE_DO_CMD FORCE_DO_CMD: -""") +""" +) SHARED_HEADER_MAC_COMMANDS = """ quiet_cmd_objc = CXX($(TOOLSET)) $@ @@ -525,33 +538,34 @@ def CalculateGeneratorInputInfo(params): def WriteRootHeaderSuffixRules(writer): - extensions = sorted(COMPILABLE_EXTENSIONS.keys(), key=str.lower) - - writer.write('# Suffix rules, putting all outputs into $(obj).\n') - for ext in extensions: - writer.write('$(obj).$(TOOLSET)/%%.o: $(srcdir)/%%%s FORCE_DO_CMD\n' % ext) - writer.write('\t@$(call do_cmd,%s,1)\n' % COMPILABLE_EXTENSIONS[ext]) - - writer.write('\n# Try building from generated source, too.\n') - for ext in extensions: - writer.write( - '$(obj).$(TOOLSET)/%%.o: $(obj).$(TOOLSET)/%%%s FORCE_DO_CMD\n' % ext) - writer.write('\t@$(call do_cmd,%s,1)\n' % COMPILABLE_EXTENSIONS[ext]) - writer.write('\n') - for ext in extensions: - writer.write('$(obj).$(TOOLSET)/%%.o: $(obj)/%%%s FORCE_DO_CMD\n' % ext) - writer.write('\t@$(call do_cmd,%s,1)\n' % COMPILABLE_EXTENSIONS[ext]) - writer.write('\n') - - -SHARED_HEADER_SUFFIX_RULES_COMMENT1 = ("""\ + extensions = sorted(COMPILABLE_EXTENSIONS.keys(), key=str.lower) + + writer.write("# Suffix rules, putting all outputs into $(obj).\n") + for ext in extensions: + writer.write("$(obj).$(TOOLSET)/%%.o: $(srcdir)/%%%s FORCE_DO_CMD\n" % ext) + writer.write("\t@$(call do_cmd,%s,1)\n" % COMPILABLE_EXTENSIONS[ext]) + + writer.write("\n# Try building from generated source, too.\n") + for ext in extensions: + writer.write( + "$(obj).$(TOOLSET)/%%.o: $(obj).$(TOOLSET)/%%%s FORCE_DO_CMD\n" % ext + ) + writer.write("\t@$(call do_cmd,%s,1)\n" % COMPILABLE_EXTENSIONS[ext]) + writer.write("\n") + for ext in extensions: + writer.write("$(obj).$(TOOLSET)/%%.o: $(obj)/%%%s FORCE_DO_CMD\n" % ext) + writer.write("\t@$(call do_cmd,%s,1)\n" % COMPILABLE_EXTENSIONS[ext]) + writer.write("\n") + + +SHARED_HEADER_SUFFIX_RULES_COMMENT1 = """\ # Suffix rules, putting all outputs into $(obj). -""") +""" -SHARED_HEADER_SUFFIX_RULES_COMMENT2 = ("""\ +SHARED_HEADER_SUFFIX_RULES_COMMENT2 = """\ # Try building from generated source, too. -""") +""" SHARED_FOOTER = """\ @@ -574,114 +588,125 @@ def WriteRootHeaderSuffixRules(writer): # Maps every compilable file extension to the do_cmd that compiles it. COMPILABLE_EXTENSIONS = { - '.c': 'cc', - '.cc': 'cxx', - '.cpp': 'cxx', - '.cxx': 'cxx', - '.s': 'cc', - '.S': 'cc', + ".c": "cc", + ".cc": "cxx", + ".cpp": "cxx", + ".cxx": "cxx", + ".s": "cc", + ".S": "cc", } + def Compilable(filename): - """Return true if the file is compilable (should be in OBJS).""" - for res in (filename.endswith(e) for e in COMPILABLE_EXTENSIONS): - if res: - return True - return False + """Return true if the file is compilable (should be in OBJS).""" + for res in (filename.endswith(e) for e in COMPILABLE_EXTENSIONS): + if res: + return True + return False def Linkable(filename): - """Return true if the file is linkable (should be on the link line).""" - return filename.endswith('.o') + """Return true if the file is linkable (should be on the link line).""" + return filename.endswith(".o") def Target(filename): - """Translate a compilable filename to its .o target.""" - return os.path.splitext(filename)[0] + '.o' + """Translate a compilable filename to its .o target.""" + return os.path.splitext(filename)[0] + ".o" def EscapeShellArgument(s): - """Quotes an argument so that it will be interpreted literally by a POSIX + """Quotes an argument so that it will be interpreted literally by a POSIX shell. Taken from http://stackoverflow.com/questions/35817/whats-the-best-way-to-escape-ossystem-calls-in-python """ - return "'" + s.replace("'", "'\\''") + "'" + return "'" + s.replace("'", "'\\''") + "'" def EscapeMakeVariableExpansion(s): - """Make has its own variable expansion syntax using $. We must escape it for + """Make has its own variable expansion syntax using $. We must escape it for string to be interpreted literally.""" - return s.replace('$', '$$') + return s.replace("$", "$$") def EscapeCppDefine(s): - """Escapes a CPP define so that it will reach the compiler unaltered.""" - s = EscapeShellArgument(s) - s = EscapeMakeVariableExpansion(s) - # '#' characters must be escaped even embedded in a string, else Make will - # treat it as the start of a comment. - return s.replace('#', r'\#') + """Escapes a CPP define so that it will reach the compiler unaltered.""" + s = EscapeShellArgument(s) + s = EscapeMakeVariableExpansion(s) + # '#' characters must be escaped even embedded in a string, else Make will + # treat it as the start of a comment. + return s.replace("#", r"\#") def QuoteIfNecessary(string): - """TODO: Should this ideally be replaced with one or more of the above + """TODO: Should this ideally be replaced with one or more of the above functions?""" - if '"' in string: - string = '"' + string.replace('"', '\\"') + '"' - return string + if '"' in string: + string = '"' + string.replace('"', '\\"') + '"' + return string def StringToMakefileVariable(string): - """Convert a string to a value that is acceptable as a make variable name.""" - return re.sub('[^a-zA-Z0-9_]', '_', string) + """Convert a string to a value that is acceptable as a make variable name.""" + return re.sub("[^a-zA-Z0-9_]", "_", string) + + +srcdir_prefix = "" -srcdir_prefix = '' def Sourceify(path): - """Convert a path to its source directory form.""" - if '$(' in path: - return path - if os.path.isabs(path): - return path - return srcdir_prefix + path + """Convert a path to its source directory form.""" + if "$(" in path: + return path + if os.path.isabs(path): + return path + return srcdir_prefix + path + +def QuoteSpaces(s, quote=r"\ "): + return s.replace(" ", quote) -def QuoteSpaces(s, quote=r'\ '): - return s.replace(' ', quote) def SourceifyAndQuoteSpaces(path): - """Convert a path to its source directory form and quote spaces.""" - return QuoteSpaces(Sourceify(path)) + """Convert a path to its source directory form and quote spaces.""" + return QuoteSpaces(Sourceify(path)) + # TODO: Avoid code duplication with _ValidateSourcesForMSVSProject in msvs.py. def _ValidateSourcesForOSX(spec, all_sources): - """Makes sure if duplicate basenames are not specified in the source list. + """Makes sure if duplicate basenames are not specified in the source list. Arguments: spec: The target dictionary containing the properties of the target. """ - if spec.get('type', None) != 'static_library': - return - - basenames = {} - for source in all_sources: - name, ext = os.path.splitext(source) - is_compiled_file = ext in [ - '.c', '.cc', '.cpp', '.cxx', '.m', '.mm', '.s', '.S'] - if not is_compiled_file: - continue - basename = os.path.basename(name) # Don't include extension. - basenames.setdefault(basename, []).append(source) - - error = '' - for basename, files in basenames.items(): - if len(files) > 1: - error += ' %s: %s\n' % (basename, ' '.join(files)) - - if error: - print(('static library %s has several files with the same basename:\n' % spec['target_name']) - + error + 'libtool on OS X will generate' + ' warnings for them.') - raise GypError('Duplicate basenames in sources section, see list above') + if spec.get("type", None) != "static_library": + return + + basenames = {} + for source in all_sources: + name, ext = os.path.splitext(source) + is_compiled_file = ext in [".c", ".cc", ".cpp", ".cxx", ".m", ".mm", ".s", ".S"] + if not is_compiled_file: + continue + basename = os.path.basename(name) # Don't include extension. + basenames.setdefault(basename, []).append(source) + + error = "" + for basename, files in basenames.items(): + if len(files) > 1: + error += " %s: %s\n" % (basename, " ".join(files)) + + if error: + print( + ( + "static library %s has several files with the same basename:\n" + % spec["target_name"] + ) + + error + + "libtool on OS X will generate" + + " warnings for them." + ) + raise GypError("Duplicate basenames in sources section, see list above") # Map from qualified target to path to output. @@ -694,41 +719,62 @@ def _ValidateSourcesForOSX(spec, all_sources): class MakefileWriter(object): - """MakefileWriter packages up the writing of one target-specific foobar.mk. + """MakefileWriter packages up the writing of one target-specific foobar.mk. Its only real entry point is Write(), and is mostly used for namespacing. """ - def __init__(self, generator_flags, flavor): - self.generator_flags = generator_flags - self.flavor = flavor - - self.suffix_rules_srcdir = {} - self.suffix_rules_objdir1 = {} - self.suffix_rules_objdir2 = {} - - # Generate suffix rules for all compilable extensions. - for ext in COMPILABLE_EXTENSIONS.keys(): - # Suffix rules for source folder. - self.suffix_rules_srcdir.update({ext: ("""\ + def __init__(self, generator_flags, flavor): + self.generator_flags = generator_flags + self.flavor = flavor + + self.suffix_rules_srcdir = {} + self.suffix_rules_objdir1 = {} + self.suffix_rules_objdir2 = {} + + # Generate suffix rules for all compilable extensions. + for ext in COMPILABLE_EXTENSIONS.keys(): + # Suffix rules for source folder. + self.suffix_rules_srcdir.update( + { + ext: ( + """\ $(obj).$(TOOLSET)/$(TARGET)/%%.o: $(srcdir)/%%%s FORCE_DO_CMD - @$(call do_cmd,%s,1) -""" % (ext, COMPILABLE_EXTENSIONS[ext]))}) - - # Suffix rules for generated source files. - self.suffix_rules_objdir1.update({ext: ("""\ +\t@$(call do_cmd,%s,1) +""" + % (ext, COMPILABLE_EXTENSIONS[ext]) + ) + } + ) + + # Suffix rules for generated source files. + self.suffix_rules_objdir1.update( + { + ext: ( + """\ $(obj).$(TOOLSET)/$(TARGET)/%%.o: $(obj).$(TOOLSET)/%%%s FORCE_DO_CMD - @$(call do_cmd,%s,1) -""" % (ext, COMPILABLE_EXTENSIONS[ext]))}) - self.suffix_rules_objdir2.update({ext: ("""\ +\t@$(call do_cmd,%s,1) +""" + % (ext, COMPILABLE_EXTENSIONS[ext]) + ) + } + ) + self.suffix_rules_objdir2.update( + { + ext: ( + """\ $(obj).$(TOOLSET)/$(TARGET)/%%.o: $(obj)/%%%s FORCE_DO_CMD - @$(call do_cmd,%s,1) -""" % (ext, COMPILABLE_EXTENSIONS[ext]))}) - +\t@$(call do_cmd,%s,1) +""" + % (ext, COMPILABLE_EXTENSIONS[ext]) + ) + } + ) - def Write(self, qualified_target, base_path, output_filename, spec, configs, - part_of_all): - """The main entry point: writes a .mk file for a single target. + def Write( + self, qualified_target, base_path, output_filename, spec, configs, part_of_all + ): + """The main entry point: writes a .mk file for a single target. Arguments: qualified_target: target we're generating @@ -738,129 +784,152 @@ def Write(self, qualified_target, base_path, output_filename, spec, configs, spec, configs: gyp info part_of_all: flag indicating this target is part of 'all' """ - gyp.common.EnsureDirExists(output_filename) - - self.fp = open(output_filename, 'w') - - self.fp.write(header) - - self.qualified_target = qualified_target - self.path = base_path - self.target = spec['target_name'] - self.type = spec['type'] - self.toolset = spec['toolset'] - - self.is_mac_bundle = gyp.xcode_emulation.IsMacBundle(self.flavor, spec) - if self.flavor == 'mac': - self.xcode_settings = gyp.xcode_emulation.XcodeSettings(spec) - else: - self.xcode_settings = None - - deps, link_deps = self.ComputeDeps(spec) - - # Some of the generation below can add extra output, sources, or - # link dependencies. All of the out params of the functions that - # follow use names like extra_foo. - extra_outputs = [] - extra_sources = [] - extra_link_deps = [] - extra_mac_bundle_resources = [] - mac_bundle_deps = [] - - if self.is_mac_bundle: - self.output = self.ComputeMacBundleOutput(spec) - self.output_binary = self.ComputeMacBundleBinaryOutput(spec) - else: - self.output = self.output_binary = self.ComputeOutput(spec) - - self.is_standalone_static_library = bool( - spec.get('standalone_static_library', 0)) - self._INSTALLABLE_TARGETS = ('executable', 'loadable_module', - 'shared_library') - if (self.is_standalone_static_library or - self.type in self._INSTALLABLE_TARGETS): - self.alias = os.path.basename(self.output) - install_path = self._InstallableTargetInstallPath() - else: - self.alias = self.output - install_path = self.output - - self.WriteLn("TOOLSET := " + self.toolset) - self.WriteLn("TARGET := " + self.target) - - # Actions must come first, since they can generate more OBJs for use below. - if 'actions' in spec: - self.WriteActions(spec['actions'], extra_sources, extra_outputs, - extra_mac_bundle_resources, part_of_all) - - # Rules must be early like actions. - if 'rules' in spec: - self.WriteRules(spec['rules'], extra_sources, extra_outputs, - extra_mac_bundle_resources, part_of_all) - - if 'copies' in spec: - self.WriteCopies(spec['copies'], extra_outputs, part_of_all) - - # Bundle resources. - if self.is_mac_bundle: - all_mac_bundle_resources = ( - spec.get('mac_bundle_resources', []) + extra_mac_bundle_resources) - self.WriteMacBundleResources(all_mac_bundle_resources, mac_bundle_deps) - self.WriteMacInfoPlist(mac_bundle_deps) - - # Sources. - all_sources = spec.get('sources', []) + extra_sources - if all_sources: - if self.flavor == 'mac': - # libtool on OS X generates warnings for duplicate basenames in the same - # target. - _ValidateSourcesForOSX(spec, all_sources) - self.WriteSources( - configs, deps, all_sources, extra_outputs, - extra_link_deps, part_of_all, - gyp.xcode_emulation.MacPrefixHeader( - self.xcode_settings, lambda p: Sourceify(self.Absolutify(p)), - self.Pchify)) - sources = list(filter(Compilable, all_sources)) - if sources: - self.WriteLn(SHARED_HEADER_SUFFIX_RULES_COMMENT1) - extensions = set([os.path.splitext(s)[1] for s in sources]) - for ext in extensions: - if ext in self.suffix_rules_srcdir: - self.WriteLn(self.suffix_rules_srcdir[ext]) - self.WriteLn(SHARED_HEADER_SUFFIX_RULES_COMMENT2) - for ext in extensions: - if ext in self.suffix_rules_objdir1: - self.WriteLn(self.suffix_rules_objdir1[ext]) - for ext in extensions: - if ext in self.suffix_rules_objdir2: - self.WriteLn(self.suffix_rules_objdir2[ext]) - self.WriteLn('# End of this set of suffix rules') - - # Add dependency from bundle to bundle binary. - if self.is_mac_bundle: - mac_bundle_deps.append(self.output_binary) + gyp.common.EnsureDirExists(output_filename) - self.WriteTarget(spec, configs, deps, extra_link_deps + link_deps, - mac_bundle_deps, extra_outputs, part_of_all) + self.fp = open(output_filename, "w") - # Update global list of target outputs, used in dependency tracking. - target_outputs[qualified_target] = install_path + self.fp.write(header) - # Update global list of link dependencies. - if self.type in ('static_library', 'shared_library'): - target_link_deps[qualified_target] = self.output_binary + self.qualified_target = qualified_target + self.path = base_path + self.target = spec["target_name"] + self.type = spec["type"] + self.toolset = spec["toolset"] - # Currently any versions have the same effect, but in future the behavior - # could be different. - if self.generator_flags.get('android_ndk_version', None): - self.WriteAndroidNdkModuleRule(self.target, all_sources, link_deps) + self.is_mac_bundle = gyp.xcode_emulation.IsMacBundle(self.flavor, spec) + if self.flavor == "mac": + self.xcode_settings = gyp.xcode_emulation.XcodeSettings(spec) + else: + self.xcode_settings = None - self.fp.close() + deps, link_deps = self.ComputeDeps(spec) + # Some of the generation below can add extra output, sources, or + # link dependencies. All of the out params of the functions that + # follow use names like extra_foo. + extra_outputs = [] + extra_sources = [] + extra_link_deps = [] + extra_mac_bundle_resources = [] + mac_bundle_deps = [] - def WriteSubMake(self, output_filename, makefile_path, targets, build_dir): - """Write a "sub-project" Makefile. + if self.is_mac_bundle: + self.output = self.ComputeMacBundleOutput(spec) + self.output_binary = self.ComputeMacBundleBinaryOutput(spec) + else: + self.output = self.output_binary = self.ComputeOutput(spec) + + self.is_standalone_static_library = bool( + spec.get("standalone_static_library", 0) + ) + self._INSTALLABLE_TARGETS = ("executable", "loadable_module", "shared_library") + if self.is_standalone_static_library or self.type in self._INSTALLABLE_TARGETS: + self.alias = os.path.basename(self.output) + install_path = self._InstallableTargetInstallPath() + else: + self.alias = self.output + install_path = self.output + + self.WriteLn("TOOLSET := " + self.toolset) + self.WriteLn("TARGET := " + self.target) + + # Actions must come first, since they can generate more OBJs for use below. + if "actions" in spec: + self.WriteActions( + spec["actions"], + extra_sources, + extra_outputs, + extra_mac_bundle_resources, + part_of_all, + ) + + # Rules must be early like actions. + if "rules" in spec: + self.WriteRules( + spec["rules"], + extra_sources, + extra_outputs, + extra_mac_bundle_resources, + part_of_all, + ) + + if "copies" in spec: + self.WriteCopies(spec["copies"], extra_outputs, part_of_all) + + # Bundle resources. + if self.is_mac_bundle: + all_mac_bundle_resources = ( + spec.get("mac_bundle_resources", []) + extra_mac_bundle_resources + ) + self.WriteMacBundleResources(all_mac_bundle_resources, mac_bundle_deps) + self.WriteMacInfoPlist(mac_bundle_deps) + + # Sources. + all_sources = spec.get("sources", []) + extra_sources + if all_sources: + if self.flavor == "mac": + # libtool on OS X generates warnings for duplicate basenames in the same + # target. + _ValidateSourcesForOSX(spec, all_sources) + self.WriteSources( + configs, + deps, + all_sources, + extra_outputs, + extra_link_deps, + part_of_all, + gyp.xcode_emulation.MacPrefixHeader( + self.xcode_settings, + lambda p: Sourceify(self.Absolutify(p)), + self.Pchify, + ), + ) + sources = [x for x in all_sources if Compilable(x)] + if sources: + self.WriteLn(SHARED_HEADER_SUFFIX_RULES_COMMENT1) + extensions = set([os.path.splitext(s)[1] for s in sources]) + for ext in extensions: + if ext in self.suffix_rules_srcdir: + self.WriteLn(self.suffix_rules_srcdir[ext]) + self.WriteLn(SHARED_HEADER_SUFFIX_RULES_COMMENT2) + for ext in extensions: + if ext in self.suffix_rules_objdir1: + self.WriteLn(self.suffix_rules_objdir1[ext]) + for ext in extensions: + if ext in self.suffix_rules_objdir2: + self.WriteLn(self.suffix_rules_objdir2[ext]) + self.WriteLn("# End of this set of suffix rules") + + # Add dependency from bundle to bundle binary. + if self.is_mac_bundle: + mac_bundle_deps.append(self.output_binary) + + self.WriteTarget( + spec, + configs, + deps, + extra_link_deps + link_deps, + mac_bundle_deps, + extra_outputs, + part_of_all, + ) + + # Update global list of target outputs, used in dependency tracking. + target_outputs[qualified_target] = install_path + + # Update global list of link dependencies. + if self.type in ("static_library", "shared_library"): + target_link_deps[qualified_target] = self.output_binary + + # Currently any versions have the same effect, but in future the behavior + # could be different. + if self.generator_flags.get("android_ndk_version", None): + self.WriteAndroidNdkModuleRule(self.target, all_sources, link_deps) + + self.fp.close() + + def WriteSubMake(self, output_filename, makefile_path, targets, build_dir): + """Write a "sub-project" Makefile. This is a small, wrapper Makefile that calls the top-level Makefile to build the targets from a single gyp file (i.e. a sub-project). @@ -871,24 +940,31 @@ def WriteSubMake(self, output_filename, makefile_path, targets, build_dir): targets: list of "all" targets for this sub-project build_dir: build output directory, relative to the sub-project """ - gyp.common.EnsureDirExists(output_filename) - self.fp = open(output_filename, 'w') - self.fp.write(header) - # For consistency with other builders, put sub-project build output in the - # sub-project dir (see test/subdirectory/gyptest-subdir-all.py). - self.WriteLn('export builddir_name ?= %s' % - os.path.join(os.path.dirname(output_filename), build_dir)) - self.WriteLn('.PHONY: all') - self.WriteLn('all:') - if makefile_path: - makefile_path = ' -C ' + makefile_path - self.WriteLn('\t$(MAKE)%s %s' % (makefile_path, ' '.join(targets))) - self.fp.close() - - - def WriteActions(self, actions, extra_sources, extra_outputs, - extra_mac_bundle_resources, part_of_all): - """Write Makefile code for any 'actions' from the gyp input. + gyp.common.EnsureDirExists(output_filename) + self.fp = open(output_filename, "w") + self.fp.write(header) + # For consistency with other builders, put sub-project build output in the + # sub-project dir (see test/subdirectory/gyptest-subdir-all.py). + self.WriteLn( + "export builddir_name ?= %s" + % os.path.join(os.path.dirname(output_filename), build_dir) + ) + self.WriteLn(".PHONY: all") + self.WriteLn("all:") + if makefile_path: + makefile_path = " -C " + makefile_path + self.WriteLn("\t$(MAKE)%s %s" % (makefile_path, " ".join(targets))) + self.fp.close() + + def WriteActions( + self, + actions, + extra_sources, + extra_outputs, + extra_mac_bundle_resources, + part_of_all, + ): + """Write Makefile code for any 'actions' from the gyp input. extra_sources: a list that will be filled in with newly generated source files, if any @@ -897,98 +973,113 @@ def WriteActions(self, actions, extra_sources, extra_outputs, actions) part_of_all: flag indicating this target is part of 'all' """ - env = self.GetSortedXcodeEnv() - for action in actions: - name = StringToMakefileVariable('%s_%s' % (self.qualified_target, - action['action_name'])) - self.WriteLn('### Rules for action "%s":' % action['action_name']) - inputs = action['inputs'] - outputs = action['outputs'] - - # Build up a list of outputs. - # Collect the output dirs we'll need. - dirs = set() - for out in outputs: - dir = os.path.split(out)[0] - if dir: - dirs.add(dir) - if int(action.get('process_outputs_as_sources', False)): - extra_sources += outputs - if int(action.get('process_outputs_as_mac_bundle_resources', False)): - extra_mac_bundle_resources += outputs - - # Write the actual command. - action_commands = action['action'] - if self.flavor == 'mac': - action_commands = [gyp.xcode_emulation.ExpandEnvVars(command, env) - for command in action_commands] - command = gyp.common.EncodePOSIXShellList(action_commands) - if 'message' in action: - self.WriteLn('quiet_cmd_%s = ACTION %s $@' % (name, action['message'])) - else: - self.WriteLn('quiet_cmd_%s = ACTION %s $@' % (name, name)) - if len(dirs) > 0: - command = 'mkdir -p %s' % ' '.join(dirs) + '; ' + command - - cd_action = 'cd %s; ' % Sourceify(self.path or '.') - - # command and cd_action get written to a toplevel variable called - # cmd_foo. Toplevel variables can't handle things that change per - # makefile like $(TARGET), so hardcode the target. - command = command.replace('$(TARGET)', self.target) - cd_action = cd_action.replace('$(TARGET)', self.target) - - # Set LD_LIBRARY_PATH in case the action runs an executable from this - # build which links to shared libs from this build. - # actions run on the host, so they should in theory only use host - # libraries, but until everything is made cross-compile safe, also use - # target libraries. - # TODO(piman): when everything is cross-compile safe, remove lib.target - self.WriteLn('cmd_%s = LD_LIBRARY_PATH=$(builddir)/lib.host:' - '$(builddir)/lib.target:$$LD_LIBRARY_PATH; ' - 'export LD_LIBRARY_PATH; ' - '%s%s' - % (name, cd_action, command)) - self.WriteLn() - outputs = [self.Absolutify(output) for output in outputs] - # The makefile rules are all relative to the top dir, but the gyp actions - # are defined relative to their containing dir. This replaces the obj - # variable for the action rule with an absolute version so that the output - # goes in the right place. - # Only write the 'obj' and 'builddir' rules for the "primary" output (:1); - # it's superfluous for the "extra outputs", and this avoids accidentally - # writing duplicate dummy rules for those outputs. - # Same for environment. - self.WriteLn("%s: obj := $(abs_obj)" % QuoteSpaces(outputs[0])) - self.WriteLn("%s: builddir := $(abs_builddir)" % QuoteSpaces(outputs[0])) - self.WriteSortedXcodeEnv(outputs[0], self.GetSortedXcodeEnv()) - - for input in inputs: - assert ' ' not in input, ( - "Spaces in action input filenames not supported (%s)" % input) - for output in outputs: - assert ' ' not in output, ( - "Spaces in action output filenames not supported (%s)" % output) - - # See the comment in WriteCopies about expanding env vars. - outputs = [gyp.xcode_emulation.ExpandEnvVars(o, env) for o in outputs] - inputs = [gyp.xcode_emulation.ExpandEnvVars(i, env) for i in inputs] - - self.WriteDoCmd(outputs, [Sourceify(self.Absolutify(i)) for i in inputs], - part_of_all=part_of_all, command=name) - - # Stuff the outputs in a variable so we can refer to them later. - outputs_variable = 'action_%s_outputs' % name - self.WriteLn('%s := %s' % (outputs_variable, ' '.join(outputs))) - extra_outputs.append('$(%s)' % outputs_variable) - self.WriteLn() - - self.WriteLn() - - - def WriteRules(self, rules, extra_sources, extra_outputs, - extra_mac_bundle_resources, part_of_all): - """Write Makefile code for any 'rules' from the gyp input. + env = self.GetSortedXcodeEnv() + for action in actions: + name = StringToMakefileVariable( + "%s_%s" % (self.qualified_target, action["action_name"]) + ) + self.WriteLn('### Rules for action "%s":' % action["action_name"]) + inputs = action["inputs"] + outputs = action["outputs"] + + # Build up a list of outputs. + # Collect the output dirs we'll need. + dirs = set() + for out in outputs: + dir = os.path.split(out)[0] + if dir: + dirs.add(dir) + if int(action.get("process_outputs_as_sources", False)): + extra_sources += outputs + if int(action.get("process_outputs_as_mac_bundle_resources", False)): + extra_mac_bundle_resources += outputs + + # Write the actual command. + action_commands = action["action"] + if self.flavor == "mac": + action_commands = [ + gyp.xcode_emulation.ExpandEnvVars(command, env) + for command in action_commands + ] + command = gyp.common.EncodePOSIXShellList(action_commands) + if "message" in action: + self.WriteLn("quiet_cmd_%s = ACTION %s $@" % (name, action["message"])) + else: + self.WriteLn("quiet_cmd_%s = ACTION %s $@" % (name, name)) + if len(dirs) > 0: + command = "mkdir -p %s" % " ".join(dirs) + "; " + command + + cd_action = "cd %s; " % Sourceify(self.path or ".") + + # command and cd_action get written to a toplevel variable called + # cmd_foo. Toplevel variables can't handle things that change per + # makefile like $(TARGET), so hardcode the target. + command = command.replace("$(TARGET)", self.target) + cd_action = cd_action.replace("$(TARGET)", self.target) + + # Set LD_LIBRARY_PATH in case the action runs an executable from this + # build which links to shared libs from this build. + # actions run on the host, so they should in theory only use host + # libraries, but until everything is made cross-compile safe, also use + # target libraries. + # TODO(piman): when everything is cross-compile safe, remove lib.target + self.WriteLn( + "cmd_%s = LD_LIBRARY_PATH=$(builddir)/lib.host:" + "$(builddir)/lib.target:$$LD_LIBRARY_PATH; " + "export LD_LIBRARY_PATH; " + "%s%s" % (name, cd_action, command) + ) + self.WriteLn() + outputs = [self.Absolutify(o) for o in outputs] + # The makefile rules are all relative to the top dir, but the gyp actions + # are defined relative to their containing dir. This replaces the obj + # variable for the action rule with an absolute version so that the output + # goes in the right place. + # Only write the 'obj' and 'builddir' rules for the "primary" output (:1); + # it's superfluous for the "extra outputs", and this avoids accidentally + # writing duplicate dummy rules for those outputs. + # Same for environment. + self.WriteLn("%s: obj := $(abs_obj)" % QuoteSpaces(outputs[0])) + self.WriteLn("%s: builddir := $(abs_builddir)" % QuoteSpaces(outputs[0])) + self.WriteSortedXcodeEnv(outputs[0], self.GetSortedXcodeEnv()) + + for input in inputs: + assert " " not in input, ( + "Spaces in action input filenames not supported (%s)" % input + ) + for output in outputs: + assert " " not in output, ( + "Spaces in action output filenames not supported (%s)" % output + ) + + # See the comment in WriteCopies about expanding env vars. + outputs = [gyp.xcode_emulation.ExpandEnvVars(o, env) for o in outputs] + inputs = [gyp.xcode_emulation.ExpandEnvVars(i, env) for i in inputs] + + self.WriteDoCmd( + outputs, + [Sourceify(self.Absolutify(i)) for i in inputs], + part_of_all=part_of_all, + command=name, + ) + + # Stuff the outputs in a variable so we can refer to them later. + outputs_variable = "action_%s_outputs" % name + self.WriteLn("%s := %s" % (outputs_variable, " ".join(outputs))) + extra_outputs.append("$(%s)" % outputs_variable) + self.WriteLn() + + self.WriteLn() + + def WriteRules( + self, + rules, + extra_sources, + extra_outputs, + extra_mac_bundle_resources, + part_of_all, + ): + """Write Makefile code for any 'rules' from the gyp input. extra_sources: a list that will be filled in with newly generated source files, if any @@ -996,208 +1087,240 @@ def WriteRules(self, rules, extra_sources, extra_outputs, rules (used to make other pieces dependent on these rules) part_of_all: flag indicating this target is part of 'all' """ - env = self.GetSortedXcodeEnv() - for rule in rules: - name = StringToMakefileVariable('%s_%s' % (self.qualified_target, - rule['rule_name'])) - count = 0 - self.WriteLn('### Generated for rule %s:' % name) - - all_outputs = [] - - for rule_source in rule.get('rule_sources', []): - dirs = set() - (rule_source_dirname, rule_source_basename) = os.path.split(rule_source) - (rule_source_root, rule_source_ext) = \ - os.path.splitext(rule_source_basename) - - outputs = [self.ExpandInputRoot(out, rule_source_root, - rule_source_dirname) - for out in rule['outputs']] - - for out in outputs: - dir = os.path.dirname(out) - if dir: - dirs.add(dir) - if int(rule.get('process_outputs_as_sources', False)): - extra_sources += outputs - if int(rule.get('process_outputs_as_mac_bundle_resources', False)): - extra_mac_bundle_resources += outputs - inputs = [Sourceify(self.Absolutify(i)) for i - in [rule_source] + rule.get('inputs', [])] - actions = ['$(call do_cmd,%s_%d)' % (name, count)] - - if name == 'resources_grit': - # HACK: This is ugly. Grit intentionally doesn't touch the - # timestamp of its output file when the file doesn't change, - # which is fine in hash-based dependency systems like scons - # and forge, but not kosher in the make world. After some - # discussion, hacking around it here seems like the least - # amount of pain. - actions += ['@touch --no-create $@'] - - # See the comment in WriteCopies about expanding env vars. - outputs = [gyp.xcode_emulation.ExpandEnvVars(o, env) for o in outputs] - inputs = [gyp.xcode_emulation.ExpandEnvVars(i, env) for i in inputs] - - outputs = [self.Absolutify(output) for output in outputs] - all_outputs += outputs - # Only write the 'obj' and 'builddir' rules for the "primary" output - # (:1); it's superfluous for the "extra outputs", and this avoids - # accidentally writing duplicate dummy rules for those outputs. - self.WriteLn('%s: obj := $(abs_obj)' % outputs[0]) - self.WriteLn('%s: builddir := $(abs_builddir)' % outputs[0]) - self.WriteMakeRule(outputs, inputs, actions, - command="%s_%d" % (name, count)) - # Spaces in rule filenames are not supported, but rule variables have - # spaces in them (e.g. RULE_INPUT_PATH expands to '$(abspath $<)'). - # The spaces within the variables are valid, so remove the variables - # before checking. - variables_with_spaces = re.compile(r'\$\([^ ]* \$<\)') - for output in outputs: - output = re.sub(variables_with_spaces, '', output) - assert ' ' not in output, ( - "Spaces in rule filenames not yet supported (%s)" % output) - self.WriteLn('all_deps += %s' % ' '.join(outputs)) - - action = [self.ExpandInputRoot(ac, rule_source_root, - rule_source_dirname) - for ac in rule['action']] - mkdirs = '' - if len(dirs) > 0: - mkdirs = 'mkdir -p %s; ' % ' '.join(dirs) - cd_action = 'cd %s; ' % Sourceify(self.path or '.') - - # action, cd_action, and mkdirs get written to a toplevel variable - # called cmd_foo. Toplevel variables can't handle things that change - # per makefile like $(TARGET), so hardcode the target. - if self.flavor == 'mac': - action = [gyp.xcode_emulation.ExpandEnvVars(command, env) - for command in action] - action = gyp.common.EncodePOSIXShellList(action) - action = action.replace('$(TARGET)', self.target) - cd_action = cd_action.replace('$(TARGET)', self.target) - mkdirs = mkdirs.replace('$(TARGET)', self.target) - - # Set LD_LIBRARY_PATH in case the rule runs an executable from this - # build which links to shared libs from this build. - # rules run on the host, so they should in theory only use host - # libraries, but until everything is made cross-compile safe, also use - # target libraries. - # TODO(piman): when everything is cross-compile safe, remove lib.target - self.WriteLn( - "cmd_%(name)s_%(count)d = LD_LIBRARY_PATH=" - "$(builddir)/lib.host:$(builddir)/lib.target:$$LD_LIBRARY_PATH; " - "export LD_LIBRARY_PATH; " - "%(cd_action)s%(mkdirs)s%(action)s" % { - 'action': action, - 'cd_action': cd_action, - 'count': count, - 'mkdirs': mkdirs, - 'name': name, - }) - self.WriteLn( - 'quiet_cmd_%(name)s_%(count)d = RULE %(name)s_%(count)d $@' % { - 'count': count, - 'name': name, - }) - self.WriteLn() - count += 1 - - outputs_variable = 'rule_%s_outputs' % name - self.WriteList(all_outputs, outputs_variable) - extra_outputs.append('$(%s)' % outputs_variable) - - self.WriteLn('### Finished generating for rule: %s' % name) - self.WriteLn() - self.WriteLn('### Finished generating for all rules') - self.WriteLn('') - - - def WriteCopies(self, copies, extra_outputs, part_of_all): - """Write Makefile code for any 'copies' from the gyp input. + env = self.GetSortedXcodeEnv() + for rule in rules: + name = StringToMakefileVariable( + "%s_%s" % (self.qualified_target, rule["rule_name"]) + ) + count = 0 + self.WriteLn("### Generated for rule %s:" % name) + + all_outputs = [] + + for rule_source in rule.get("rule_sources", []): + dirs = set() + (rule_source_dirname, rule_source_basename) = os.path.split(rule_source) + (rule_source_root, rule_source_ext) = os.path.splitext( + rule_source_basename + ) + + outputs = [ + self.ExpandInputRoot(out, rule_source_root, rule_source_dirname) + for out in rule["outputs"] + ] + + for out in outputs: + dir = os.path.dirname(out) + if dir: + dirs.add(dir) + if int(rule.get("process_outputs_as_sources", False)): + extra_sources += outputs + if int(rule.get("process_outputs_as_mac_bundle_resources", False)): + extra_mac_bundle_resources += outputs + inputs = [ + Sourceify(self.Absolutify(i)) + for i in [rule_source] + rule.get("inputs", []) + ] + actions = ["$(call do_cmd,%s_%d)" % (name, count)] + + if name == "resources_grit": + # HACK: This is ugly. Grit intentionally doesn't touch the + # timestamp of its output file when the file doesn't change, + # which is fine in hash-based dependency systems like scons + # and forge, but not kosher in the make world. After some + # discussion, hacking around it here seems like the least + # amount of pain. + actions += ["@touch --no-create $@"] + + # See the comment in WriteCopies about expanding env vars. + outputs = [gyp.xcode_emulation.ExpandEnvVars(o, env) for o in outputs] + inputs = [gyp.xcode_emulation.ExpandEnvVars(i, env) for i in inputs] + + outputs = [self.Absolutify(o) for o in outputs] + all_outputs += outputs + # Only write the 'obj' and 'builddir' rules for the "primary" output + # (:1); it's superfluous for the "extra outputs", and this avoids + # accidentally writing duplicate dummy rules for those outputs. + self.WriteLn("%s: obj := $(abs_obj)" % outputs[0]) + self.WriteLn("%s: builddir := $(abs_builddir)" % outputs[0]) + self.WriteMakeRule( + outputs, inputs, actions, command="%s_%d" % (name, count) + ) + # Spaces in rule filenames are not supported, but rule variables have + # spaces in them (e.g. RULE_INPUT_PATH expands to '$(abspath $<)'). + # The spaces within the variables are valid, so remove the variables + # before checking. + variables_with_spaces = re.compile(r"\$\([^ ]* \$<\)") + for output in outputs: + output = re.sub(variables_with_spaces, "", output) + assert " " not in output, ( + "Spaces in rule filenames not yet supported (%s)" % output + ) + self.WriteLn("all_deps += %s" % " ".join(outputs)) + + action = [ + self.ExpandInputRoot(ac, rule_source_root, rule_source_dirname) + for ac in rule["action"] + ] + mkdirs = "" + if len(dirs) > 0: + mkdirs = "mkdir -p %s; " % " ".join(dirs) + cd_action = "cd %s; " % Sourceify(self.path or ".") + + # action, cd_action, and mkdirs get written to a toplevel variable + # called cmd_foo. Toplevel variables can't handle things that change + # per makefile like $(TARGET), so hardcode the target. + if self.flavor == "mac": + action = [ + gyp.xcode_emulation.ExpandEnvVars(command, env) + for command in action + ] + action = gyp.common.EncodePOSIXShellList(action) + action = action.replace("$(TARGET)", self.target) + cd_action = cd_action.replace("$(TARGET)", self.target) + mkdirs = mkdirs.replace("$(TARGET)", self.target) + + # Set LD_LIBRARY_PATH in case the rule runs an executable from this + # build which links to shared libs from this build. + # rules run on the host, so they should in theory only use host + # libraries, but until everything is made cross-compile safe, also use + # target libraries. + # TODO(piman): when everything is cross-compile safe, remove lib.target + self.WriteLn( + "cmd_%(name)s_%(count)d = LD_LIBRARY_PATH=" + "$(builddir)/lib.host:$(builddir)/lib.target:$$LD_LIBRARY_PATH; " + "export LD_LIBRARY_PATH; " + "%(cd_action)s%(mkdirs)s%(action)s" + % { + "action": action, + "cd_action": cd_action, + "count": count, + "mkdirs": mkdirs, + "name": name, + } + ) + self.WriteLn( + "quiet_cmd_%(name)s_%(count)d = RULE %(name)s_%(count)d $@" + % {"count": count, "name": name} + ) + self.WriteLn() + count += 1 + + outputs_variable = "rule_%s_outputs" % name + self.WriteList(all_outputs, outputs_variable) + extra_outputs.append("$(%s)" % outputs_variable) + + self.WriteLn("### Finished generating for rule: %s" % name) + self.WriteLn() + self.WriteLn("### Finished generating for all rules") + self.WriteLn("") + + def WriteCopies(self, copies, extra_outputs, part_of_all): + """Write Makefile code for any 'copies' from the gyp input. extra_outputs: a list that will be filled in with any outputs of this action (used to make other pieces dependent on this action) part_of_all: flag indicating this target is part of 'all' """ - self.WriteLn('### Generated for copy rule.') - - variable = StringToMakefileVariable(self.qualified_target + '_copies') - outputs = [] - for copy in copies: - for path in copy['files']: - # Absolutify() may call normpath, and will strip trailing slashes. - path = Sourceify(self.Absolutify(path)) - filename = os.path.split(path)[1] - output = Sourceify(self.Absolutify(os.path.join(copy['destination'], - filename))) - - # If the output path has variables in it, which happens in practice for - # 'copies', writing the environment as target-local doesn't work, - # because the variables are already needed for the target name. - # Copying the environment variables into global make variables doesn't - # work either, because then the .d files will potentially contain spaces - # after variable expansion, and .d file handling cannot handle spaces. - # As a workaround, manually expand variables at gyp time. Since 'copies' - # can't run scripts, there's no need to write the env then. - # WriteDoCmd() will escape spaces for .d files. - env = self.GetSortedXcodeEnv() - output = gyp.xcode_emulation.ExpandEnvVars(output, env) - path = gyp.xcode_emulation.ExpandEnvVars(path, env) - self.WriteDoCmd([output], [path], 'copy', part_of_all) - outputs.append(output) - self.WriteLn('%s = %s' % (variable, ' '.join(QuoteSpaces(o) for o in outputs))) - extra_outputs.append('$(%s)' % variable) - self.WriteLn() - - - def WriteMacBundleResources(self, resources, bundle_deps): - """Writes Makefile code for 'mac_bundle_resources'.""" - self.WriteLn('### Generated for mac_bundle_resources') - - for output, res in gyp.xcode_emulation.GetMacBundleResources( - generator_default_variables['PRODUCT_DIR'], self.xcode_settings, - [Sourceify(self.Absolutify(r)) for r in resources]): - _, ext = os.path.splitext(output) - if ext != '.xcassets': - # Make does not supports '.xcassets' emulation. - self.WriteDoCmd([output], [res], 'mac_tool,,,copy-bundle-resource', - part_of_all=True) - bundle_deps.append(output) - - - def WriteMacInfoPlist(self, bundle_deps): - """Write Makefile code for bundle Info.plist files.""" - info_plist, out, defines, extra_env = gyp.xcode_emulation.GetMacInfoPlist( - generator_default_variables['PRODUCT_DIR'], self.xcode_settings, - lambda p: Sourceify(self.Absolutify(p))) - if not info_plist: - return - if defines: - # Create an intermediate file to store preprocessed results. - intermediate_plist = ('$(obj).$(TOOLSET)/$(TARGET)/' + - os.path.basename(info_plist)) - self.WriteList(defines, intermediate_plist + ': INFOPLIST_DEFINES', '-D', - quoter=EscapeCppDefine) - self.WriteMakeRule([intermediate_plist], [info_plist], - ['$(call do_cmd,infoplist)', - # "Convert" the plist so that any weird whitespace changes from the - # preprocessor do not affect the XML parser in mac_tool. - '@plutil -convert xml1 $@ $@']) - info_plist = intermediate_plist - # plists can contain envvars and substitute them into the file. - self.WriteSortedXcodeEnv( - out, self.GetSortedXcodeEnv(additional_settings=extra_env)) - self.WriteDoCmd([out], [info_plist], 'mac_tool,,,copy-info-plist', - part_of_all=True) - bundle_deps.append(out) - - - def WriteSources(self, configs, deps, sources, - extra_outputs, extra_link_deps, - part_of_all, precompiled_header): - """Write Makefile code for any 'sources' from the gyp input. + self.WriteLn("### Generated for copy rule.") + + variable = StringToMakefileVariable(self.qualified_target + "_copies") + outputs = [] + for copy in copies: + for path in copy["files"]: + # Absolutify() may call normpath, and will strip trailing slashes. + path = Sourceify(self.Absolutify(path)) + filename = os.path.split(path)[1] + output = Sourceify( + self.Absolutify(os.path.join(copy["destination"], filename)) + ) + + # If the output path has variables in it, which happens in practice for + # 'copies', writing the environment as target-local doesn't work, + # because the variables are already needed for the target name. + # Copying the environment variables into global make variables doesn't + # work either, because then the .d files will potentially contain spaces + # after variable expansion, and .d file handling cannot handle spaces. + # As a workaround, manually expand variables at gyp time. Since 'copies' + # can't run scripts, there's no need to write the env then. + # WriteDoCmd() will escape spaces for .d files. + env = self.GetSortedXcodeEnv() + output = gyp.xcode_emulation.ExpandEnvVars(output, env) + path = gyp.xcode_emulation.ExpandEnvVars(path, env) + self.WriteDoCmd([output], [path], "copy", part_of_all) + outputs.append(output) + self.WriteLn("%s = %s" % (variable, " ".join(QuoteSpaces(o) for o in outputs))) + extra_outputs.append("$(%s)" % variable) + self.WriteLn() + + def WriteMacBundleResources(self, resources, bundle_deps): + """Writes Makefile code for 'mac_bundle_resources'.""" + self.WriteLn("### Generated for mac_bundle_resources") + + for output, res in gyp.xcode_emulation.GetMacBundleResources( + generator_default_variables["PRODUCT_DIR"], + self.xcode_settings, + [Sourceify(self.Absolutify(r)) for r in resources], + ): + _, ext = os.path.splitext(output) + if ext != ".xcassets": + # Make does not supports '.xcassets' emulation. + self.WriteDoCmd( + [output], [res], "mac_tool,,,copy-bundle-resource", part_of_all=True + ) + bundle_deps.append(output) + + def WriteMacInfoPlist(self, bundle_deps): + """Write Makefile code for bundle Info.plist files.""" + info_plist, out, defines, extra_env = gyp.xcode_emulation.GetMacInfoPlist( + generator_default_variables["PRODUCT_DIR"], + self.xcode_settings, + lambda p: Sourceify(self.Absolutify(p)), + ) + if not info_plist: + return + if defines: + # Create an intermediate file to store preprocessed results. + intermediate_plist = "$(obj).$(TOOLSET)/$(TARGET)/" + os.path.basename( + info_plist + ) + self.WriteList( + defines, + intermediate_plist + ": INFOPLIST_DEFINES", + "-D", + quoter=EscapeCppDefine, + ) + self.WriteMakeRule( + [intermediate_plist], + [info_plist], + [ + "$(call do_cmd,infoplist)", + # "Convert" the plist so that any weird whitespace changes from the + # preprocessor do not affect the XML parser in mac_tool. + "@plutil -convert xml1 $@ $@", + ], + ) + info_plist = intermediate_plist + # plists can contain envvars and substitute them into the file. + self.WriteSortedXcodeEnv( + out, self.GetSortedXcodeEnv(additional_settings=extra_env) + ) + self.WriteDoCmd( + [out], [info_plist], "mac_tool,,,copy-info-plist", part_of_all=True + ) + bundle_deps.append(out) + + def WriteSources( + self, + configs, + deps, + sources, + extra_outputs, + extra_link_deps, + part_of_all, + precompiled_header, + ): + """Write Makefile code for any 'sources' from the gyp input. These are source files necessary to build the current target. configs, deps, sources: input from gyp. @@ -1208,256 +1331,285 @@ def WriteSources(self, configs, deps, sources, part_of_all: flag indicating this target is part of 'all' """ - # Write configuration-specific variables for CFLAGS, etc. - for configname in sorted(configs.keys()): - config = configs[configname] - self.WriteList(config.get('defines'), 'DEFS_%s' % configname, prefix='-D', - quoter=EscapeCppDefine) - - if self.flavor == 'mac': - cflags = self.xcode_settings.GetCflags(configname) - cflags_c = self.xcode_settings.GetCflagsC(configname) - cflags_cc = self.xcode_settings.GetCflagsCC(configname) - cflags_objc = self.xcode_settings.GetCflagsObjC(configname) - cflags_objcc = self.xcode_settings.GetCflagsObjCC(configname) - else: - cflags = config.get('cflags') - cflags_c = config.get('cflags_c') - cflags_cc = config.get('cflags_cc') - - self.WriteLn("# Flags passed to all source files.") - self.WriteList(cflags, 'CFLAGS_%s' % configname) - self.WriteLn("# Flags passed to only C files.") - self.WriteList(cflags_c, 'CFLAGS_C_%s' % configname) - self.WriteLn("# Flags passed to only C++ files.") - self.WriteList(cflags_cc, 'CFLAGS_CC_%s' % configname) - if self.flavor == 'mac': - self.WriteLn("# Flags passed to only ObjC files.") - self.WriteList(cflags_objc, 'CFLAGS_OBJC_%s' % configname) - self.WriteLn("# Flags passed to only ObjC++ files.") - self.WriteList(cflags_objcc, 'CFLAGS_OBJCC_%s' % configname) - includes = config.get('include_dirs') - if includes: - includes = [Sourceify(self.Absolutify(i)) for i in includes] - self.WriteList(includes, 'INCS_%s' % configname, prefix='-I') - - compilable = list(filter(Compilable, sources)) - objs = [self.Objectify(self.Absolutify(Target(c))) for c in compilable] - self.WriteList(objs, 'OBJS') - - for obj in objs: - assert ' ' not in obj, ( - "Spaces in object filenames not supported (%s)" % obj) - self.WriteLn('# Add to the list of files we specially track ' - 'dependencies for.') - self.WriteLn('all_deps += $(OBJS)') - self.WriteLn() - - # Make sure our dependencies are built first. - if deps: - self.WriteMakeRule(['$(OBJS)'], deps, - comment = 'Make sure our dependencies are built ' - 'before any of us.', - order_only = True) - - # Make sure the actions and rules run first. - # If they generate any extra headers etc., the per-.o file dep tracking - # will catch the proper rebuilds, so order only is still ok here. - if extra_outputs: - self.WriteMakeRule(['$(OBJS)'], extra_outputs, - comment = 'Make sure our actions/rules run ' - 'before any of us.', - order_only = True) - - pchdeps = precompiled_header.GetObjDependencies(compilable, objs ) - if pchdeps: - self.WriteLn('# Dependencies from obj files to their precompiled headers') - for source, obj, gch in pchdeps: - self.WriteLn('%s: %s' % (obj, gch)) - self.WriteLn('# End precompiled header dependencies') - - if objs: - extra_link_deps.append('$(OBJS)') - self.WriteLn("""\ + # Write configuration-specific variables for CFLAGS, etc. + for configname in sorted(configs.keys()): + config = configs[configname] + self.WriteList( + config.get("defines"), + "DEFS_%s" % configname, + prefix="-D", + quoter=EscapeCppDefine, + ) + + if self.flavor == "mac": + cflags = self.xcode_settings.GetCflags(configname, arch=config.get('xcode_configuration_platform')) + cflags_c = self.xcode_settings.GetCflagsC(configname) + cflags_cc = self.xcode_settings.GetCflagsCC(configname) + cflags_objc = self.xcode_settings.GetCflagsObjC(configname) + cflags_objcc = self.xcode_settings.GetCflagsObjCC(configname) + else: + cflags = config.get("cflags") + cflags_c = config.get("cflags_c") + cflags_cc = config.get("cflags_cc") + + self.WriteLn("# Flags passed to all source files.") + self.WriteList(cflags, "CFLAGS_%s" % configname) + self.WriteLn("# Flags passed to only C files.") + self.WriteList(cflags_c, "CFLAGS_C_%s" % configname) + self.WriteLn("# Flags passed to only C++ files.") + self.WriteList(cflags_cc, "CFLAGS_CC_%s" % configname) + if self.flavor == "mac": + self.WriteLn("# Flags passed to only ObjC files.") + self.WriteList(cflags_objc, "CFLAGS_OBJC_%s" % configname) + self.WriteLn("# Flags passed to only ObjC++ files.") + self.WriteList(cflags_objcc, "CFLAGS_OBJCC_%s" % configname) + includes = config.get("include_dirs") + if includes: + includes = [Sourceify(self.Absolutify(i)) for i in includes] + self.WriteList(includes, "INCS_%s" % configname, prefix="-I") + + compilable = list(filter(Compilable, sources)) + objs = [self.Objectify(self.Absolutify(Target(c))) for c in compilable] + self.WriteList(objs, "OBJS") + + for obj in objs: + assert " " not in obj, "Spaces in object filenames not supported (%s)" % obj + self.WriteLn( + "# Add to the list of files we specially track " "dependencies for." + ) + self.WriteLn("all_deps += $(OBJS)") + self.WriteLn() + + # Make sure our dependencies are built first. + if deps: + self.WriteMakeRule( + ["$(OBJS)"], + deps, + comment="Make sure our dependencies are built " "before any of us.", + order_only=True, + ) + + # Make sure the actions and rules run first. + # If they generate any extra headers etc., the per-.o file dep tracking + # will catch the proper rebuilds, so order only is still ok here. + if extra_outputs: + self.WriteMakeRule( + ["$(OBJS)"], + extra_outputs, + comment="Make sure our actions/rules run " "before any of us.", + order_only=True, + ) + + pchdeps = precompiled_header.GetObjDependencies(compilable, objs) + if pchdeps: + self.WriteLn("# Dependencies from obj files to their precompiled headers") + for source, obj, gch in pchdeps: + self.WriteLn("%s: %s" % (obj, gch)) + self.WriteLn("# End precompiled header dependencies") + + if objs: + extra_link_deps.append("$(OBJS)") + self.WriteLn( + """\ # CFLAGS et al overrides must be target-local. -# See "Target-specific Variable Values" in the GNU Make manual.""") - self.WriteLn("$(OBJS): TOOLSET := $(TOOLSET)") - self.WriteLn("$(OBJS): GYP_CFLAGS := " - "$(DEFS_$(BUILDTYPE)) " - "$(INCS_$(BUILDTYPE)) " - "%s " % precompiled_header.GetInclude('c') + - "$(CFLAGS_$(BUILDTYPE)) " - "$(CFLAGS_C_$(BUILDTYPE))") - self.WriteLn("$(OBJS): GYP_CXXFLAGS := " - "$(DEFS_$(BUILDTYPE)) " - "$(INCS_$(BUILDTYPE)) " - "%s " % precompiled_header.GetInclude('cc') + - "$(CFLAGS_$(BUILDTYPE)) " - "$(CFLAGS_CC_$(BUILDTYPE))") - if self.flavor == 'mac': - self.WriteLn("$(OBJS): GYP_OBJCFLAGS := " - "$(DEFS_$(BUILDTYPE)) " - "$(INCS_$(BUILDTYPE)) " - "%s " % precompiled_header.GetInclude('m') + - "$(CFLAGS_$(BUILDTYPE)) " - "$(CFLAGS_C_$(BUILDTYPE)) " - "$(CFLAGS_OBJC_$(BUILDTYPE))") - self.WriteLn("$(OBJS): GYP_OBJCXXFLAGS := " - "$(DEFS_$(BUILDTYPE)) " - "$(INCS_$(BUILDTYPE)) " - "%s " % precompiled_header.GetInclude('mm') + - "$(CFLAGS_$(BUILDTYPE)) " - "$(CFLAGS_CC_$(BUILDTYPE)) " - "$(CFLAGS_OBJCC_$(BUILDTYPE))") - - self.WritePchTargets(precompiled_header.GetPchBuildCommands()) - - # If there are any object files in our input file list, link them into our - # output. - extra_link_deps += list(filter(Linkable, sources)) - - self.WriteLn() - - def WritePchTargets(self, pch_commands): - """Writes make rules to compile prefix headers.""" - if not pch_commands: - return - - for gch, lang_flag, lang, input in pch_commands: - extra_flags = { - 'c': '$(CFLAGS_C_$(BUILDTYPE))', - 'cc': '$(CFLAGS_CC_$(BUILDTYPE))', - 'm': '$(CFLAGS_C_$(BUILDTYPE)) $(CFLAGS_OBJC_$(BUILDTYPE))', - 'mm': '$(CFLAGS_CC_$(BUILDTYPE)) $(CFLAGS_OBJCC_$(BUILDTYPE))', - }[lang] - var_name = { - 'c': 'GYP_PCH_CFLAGS', - 'cc': 'GYP_PCH_CXXFLAGS', - 'm': 'GYP_PCH_OBJCFLAGS', - 'mm': 'GYP_PCH_OBJCXXFLAGS', - }[lang] - self.WriteLn("%s: %s := %s " % (gch, var_name, lang_flag) + - "$(DEFS_$(BUILDTYPE)) " - "$(INCS_$(BUILDTYPE)) " - "$(CFLAGS_$(BUILDTYPE)) " + - extra_flags) - - self.WriteLn('%s: %s FORCE_DO_CMD' % (gch, input)) - self.WriteLn('\t@$(call do_cmd,pch_%s,1)' % lang) - self.WriteLn('') - assert ' ' not in gch, ( - "Spaces in gch filenames not supported (%s)" % gch) - self.WriteLn('all_deps += %s' % gch) - self.WriteLn('') - - - def ComputeOutputBasename(self, spec): - """Return the 'output basename' of a gyp spec. +# See "Target-specific Variable Values" in the GNU Make manual.""" + ) + self.WriteLn("$(OBJS): TOOLSET := $(TOOLSET)") + self.WriteLn( + "$(OBJS): GYP_CFLAGS := " + "$(DEFS_$(BUILDTYPE)) " + "$(INCS_$(BUILDTYPE)) " + "%s " % precompiled_header.GetInclude("c") + "$(CFLAGS_$(BUILDTYPE)) " + "$(CFLAGS_C_$(BUILDTYPE))" + ) + self.WriteLn( + "$(OBJS): GYP_CXXFLAGS := " + "$(DEFS_$(BUILDTYPE)) " + "$(INCS_$(BUILDTYPE)) " + "%s " % precompiled_header.GetInclude("cc") + "$(CFLAGS_$(BUILDTYPE)) " + "$(CFLAGS_CC_$(BUILDTYPE))" + ) + if self.flavor == "mac": + self.WriteLn( + "$(OBJS): GYP_OBJCFLAGS := " + "$(DEFS_$(BUILDTYPE)) " + "$(INCS_$(BUILDTYPE)) " + "%s " % precompiled_header.GetInclude("m") + + "$(CFLAGS_$(BUILDTYPE)) " + "$(CFLAGS_C_$(BUILDTYPE)) " + "$(CFLAGS_OBJC_$(BUILDTYPE))" + ) + self.WriteLn( + "$(OBJS): GYP_OBJCXXFLAGS := " + "$(DEFS_$(BUILDTYPE)) " + "$(INCS_$(BUILDTYPE)) " + "%s " % precompiled_header.GetInclude("mm") + + "$(CFLAGS_$(BUILDTYPE)) " + "$(CFLAGS_CC_$(BUILDTYPE)) " + "$(CFLAGS_OBJCC_$(BUILDTYPE))" + ) + + self.WritePchTargets(precompiled_header.GetPchBuildCommands()) + + # If there are any object files in our input file list, link them into our + # output. + extra_link_deps += [source for source in sources if Linkable(source)] + + self.WriteLn() + + def WritePchTargets(self, pch_commands): + """Writes make rules to compile prefix headers.""" + if not pch_commands: + return + + for gch, lang_flag, lang, input in pch_commands: + extra_flags = { + "c": "$(CFLAGS_C_$(BUILDTYPE))", + "cc": "$(CFLAGS_CC_$(BUILDTYPE))", + "m": "$(CFLAGS_C_$(BUILDTYPE)) $(CFLAGS_OBJC_$(BUILDTYPE))", + "mm": "$(CFLAGS_CC_$(BUILDTYPE)) $(CFLAGS_OBJCC_$(BUILDTYPE))", + }[lang] + var_name = { + "c": "GYP_PCH_CFLAGS", + "cc": "GYP_PCH_CXXFLAGS", + "m": "GYP_PCH_OBJCFLAGS", + "mm": "GYP_PCH_OBJCXXFLAGS", + }[lang] + self.WriteLn( + "%s: %s := %s " % (gch, var_name, lang_flag) + "$(DEFS_$(BUILDTYPE)) " + "$(INCS_$(BUILDTYPE)) " + "$(CFLAGS_$(BUILDTYPE)) " + extra_flags + ) + + self.WriteLn("%s: %s FORCE_DO_CMD" % (gch, input)) + self.WriteLn("\t@$(call do_cmd,pch_%s,1)" % lang) + self.WriteLn("") + assert " " not in gch, "Spaces in gch filenames not supported (%s)" % gch + self.WriteLn("all_deps += %s" % gch) + self.WriteLn("") + + def ComputeOutputBasename(self, spec): + """Return the 'output basename' of a gyp spec. E.g., the loadable module 'foobar' in directory 'baz' will produce 'libfoobar.so' """ - assert not self.is_mac_bundle - - if self.flavor == 'mac' and self.type in ( - 'static_library', 'executable', 'shared_library', 'loadable_module'): - return self.xcode_settings.GetExecutablePath() - - target = spec['target_name'] - target_prefix = '' - target_ext = '' - if self.type == 'static_library': - if target[:3] == 'lib': - target = target[3:] - target_prefix = 'lib' - target_ext = '.a' - elif self.type in ('loadable_module', 'shared_library'): - if target[:3] == 'lib': - target = target[3:] - target_prefix = 'lib' - if self.flavor == 'aix': - target_ext = '.a' - else: - target_ext = '.so' - elif self.type == 'none': - target = '%s.stamp' % target - elif self.type != 'executable': - print("ERROR: What output file should be generated?", - "type", self.type, "target", target) - - target_prefix = spec.get('product_prefix', target_prefix) - target = spec.get('product_name', target) - product_ext = spec.get('product_extension') - if product_ext: - target_ext = '.' + product_ext - - return target_prefix + target + target_ext - - - def _InstallImmediately(self): - return self.toolset == 'target' and self.flavor == 'mac' and self.type in ( - 'static_library', 'executable', 'shared_library', 'loadable_module') - - - def ComputeOutput(self, spec): - """Return the 'output' (full output path) of a gyp spec. + assert not self.is_mac_bundle + + if self.flavor == "mac" and self.type in ( + "static_library", + "executable", + "shared_library", + "loadable_module", + ): + return self.xcode_settings.GetExecutablePath() + + target = spec["target_name"] + target_prefix = "" + target_ext = "" + if self.type == "static_library": + if target[:3] == "lib": + target = target[3:] + target_prefix = "lib" + target_ext = ".a" + elif self.type in ("loadable_module", "shared_library"): + if target[:3] == "lib": + target = target[3:] + target_prefix = "lib" + if self.flavor == "aix": + target_ext = ".a" + else: + target_ext = ".so" + elif self.type == "none": + target = "%s.stamp" % target + elif self.type != "executable": + print( + "ERROR: What output file should be generated?", + "type", + self.type, + "target", + target, + ) + + target_prefix = spec.get("product_prefix", target_prefix) + target = spec.get("product_name", target) + product_ext = spec.get("product_extension") + if product_ext: + target_ext = "." + product_ext + + return target_prefix + target + target_ext + + def _InstallImmediately(self): + return ( + self.toolset == "target" + and self.flavor == "mac" + and self.type + in ("static_library", "executable", "shared_library", "loadable_module") + ) + + def ComputeOutput(self, spec): + """Return the 'output' (full output path) of a gyp spec. E.g., the loadable module 'foobar' in directory 'baz' will produce '$(obj)/baz/libfoobar.so' """ - assert not self.is_mac_bundle - - path = os.path.join('$(obj).' + self.toolset, self.path) - if self.type == 'executable' or self._InstallImmediately(): - path = '$(builddir)' - path = spec.get('product_dir', path) - return os.path.join(path, self.ComputeOutputBasename(spec)) - - - def ComputeMacBundleOutput(self, spec): - """Return the 'output' (full output path) to a bundle output directory.""" - assert self.is_mac_bundle - path = generator_default_variables['PRODUCT_DIR'] - return os.path.join(path, self.xcode_settings.GetWrapperName()) + assert not self.is_mac_bundle + path = os.path.join("$(obj)." + self.toolset, self.path) + if self.type == "executable" or self._InstallImmediately(): + path = "$(builddir)" + path = spec.get("product_dir", path) + return os.path.join(path, self.ComputeOutputBasename(spec)) - def ComputeMacBundleBinaryOutput(self, spec): - """Return the 'output' (full output path) to the binary in a bundle.""" - path = generator_default_variables['PRODUCT_DIR'] - return os.path.join(path, self.xcode_settings.GetExecutablePath()) + def ComputeMacBundleOutput(self, spec): + """Return the 'output' (full output path) to a bundle output directory.""" + assert self.is_mac_bundle + path = generator_default_variables["PRODUCT_DIR"] + return os.path.join(path, self.xcode_settings.GetWrapperName()) + def ComputeMacBundleBinaryOutput(self, spec): + """Return the 'output' (full output path) to the binary in a bundle.""" + path = generator_default_variables["PRODUCT_DIR"] + return os.path.join(path, self.xcode_settings.GetExecutablePath()) - def ComputeDeps(self, spec): - """Compute the dependencies of a gyp spec. + def ComputeDeps(self, spec): + """Compute the dependencies of a gyp spec. Returns a tuple (deps, link_deps), where each is a list of filenames that will need to be put in front of make for either building (deps) or linking (link_deps). """ - deps = [] - link_deps = [] - if 'dependencies' in spec: - deps.extend([target_outputs[dep] for dep in spec['dependencies'] - if target_outputs[dep]]) - for dep in spec['dependencies']: - if dep in target_link_deps: - link_deps.append(target_link_deps[dep]) - deps.extend(link_deps) - # TODO: It seems we need to transitively link in libraries (e.g. -lfoo)? - # This hack makes it work: - # link_deps.extend(spec.get('libraries', [])) - return (gyp.common.uniquer(deps), gyp.common.uniquer(link_deps)) - - - def WriteDependencyOnExtraOutputs(self, target, extra_outputs): - self.WriteMakeRule([self.output_binary], extra_outputs, - comment = 'Build our special outputs first.', - order_only = True) - - - def WriteTarget(self, spec, configs, deps, link_deps, bundle_deps, - extra_outputs, part_of_all): - """Write Makefile code to produce the final target of the gyp spec. + deps = [] + link_deps = [] + if "dependencies" in spec: + deps.extend( + [ + target_outputs[dep] + for dep in spec["dependencies"] + if target_outputs[dep] + ] + ) + for dep in spec["dependencies"]: + if dep in target_link_deps: + link_deps.append(target_link_deps[dep]) + deps.extend(link_deps) + # TODO: It seems we need to transitively link in libraries (e.g. -lfoo)? + # This hack makes it work: + # link_deps.extend(spec.get('libraries', [])) + return (gyp.common.uniquer(deps), gyp.common.uniquer(link_deps)) + + def WriteDependencyOnExtraOutputs(self, target, extra_outputs): + self.WriteMakeRule( + [self.output_binary], + extra_outputs, + comment="Build our special outputs first.", + order_only=True, + ) + + def WriteTarget( + self, spec, configs, deps, link_deps, bundle_deps, extra_outputs, part_of_all + ): + """Write Makefile code to produce the final target of the gyp spec. spec, configs: input from gyp. deps, link_deps: dependency lists; see ComputeDeps() @@ -1465,274 +1617,377 @@ def WriteTarget(self, spec, configs, deps, link_deps, bundle_deps, part_of_all: flag indicating this target is part of 'all' """ - self.WriteLn('### Rules for final target.') - - if extra_outputs: - self.WriteDependencyOnExtraOutputs(self.output_binary, extra_outputs) - self.WriteMakeRule(extra_outputs, deps, - comment=('Preserve order dependency of ' - 'special output on deps.'), - order_only = True) - - target_postbuilds = {} - if self.type != 'none': - for configname in sorted(configs.keys()): - config = configs[configname] - if self.flavor == 'mac': - ldflags = self.xcode_settings.GetLdflags(configname, - generator_default_variables['PRODUCT_DIR'], - lambda p: Sourceify(self.Absolutify(p))) - - # TARGET_POSTBUILDS_$(BUILDTYPE) is added to postbuilds later on. - gyp_to_build = gyp.common.InvertRelativePath(self.path) - target_postbuild = self.xcode_settings.AddImplicitPostbuilds( - configname, - QuoteSpaces(os.path.normpath(os.path.join(gyp_to_build, - self.output))), - QuoteSpaces(os.path.normpath(os.path.join(gyp_to_build, - self.output_binary)))) - if target_postbuild: - target_postbuilds[configname] = target_postbuild + self.WriteLn("### Rules for final target.") + + if extra_outputs: + self.WriteDependencyOnExtraOutputs(self.output_binary, extra_outputs) + self.WriteMakeRule( + extra_outputs, + deps, + comment=("Preserve order dependency of " "special output on deps."), + order_only=True, + ) + + target_postbuilds = {} + if self.type != "none": + for configname in sorted(configs.keys()): + config = configs[configname] + if self.flavor == "mac": + ldflags = self.xcode_settings.GetLdflags( + configname, + generator_default_variables["PRODUCT_DIR"], + lambda p: Sourceify(self.Absolutify(p)), + arch=config.get('xcode_configuration_platform') + ) + + # TARGET_POSTBUILDS_$(BUILDTYPE) is added to postbuilds later on. + gyp_to_build = gyp.common.InvertRelativePath(self.path) + target_postbuild = self.xcode_settings.AddImplicitPostbuilds( + configname, + QuoteSpaces( + os.path.normpath(os.path.join(gyp_to_build, self.output)) + ), + QuoteSpaces( + os.path.normpath( + os.path.join(gyp_to_build, self.output_binary) + ) + ), + ) + if target_postbuild: + target_postbuilds[configname] = target_postbuild + else: + ldflags = config.get("ldflags", []) + # Compute an rpath for this output if needed. + if any(dep.endswith(".so") or ".so." in dep for dep in deps): + # We want to get the literal string "$ORIGIN" into the link command, + # so we need lots of escaping. + ldflags.append(r"-Wl,-rpath=\$$ORIGIN/lib.%s/" % self.toolset) + ldflags.append( + r"-Wl,-rpath-link=\$(builddir)/lib.%s/" % self.toolset + ) + library_dirs = config.get("library_dirs", []) + ldflags += [("-L%s" % library_dir) for library_dir in library_dirs] + self.WriteList(ldflags, "LDFLAGS_%s" % configname) + if self.flavor == "mac": + self.WriteList( + self.xcode_settings.GetLibtoolflags(configname), + "LIBTOOLFLAGS_%s" % configname, + ) + libraries = spec.get("libraries") + if libraries: + # Remove duplicate entries + libraries = gyp.common.uniquer(libraries) + if self.flavor == "mac": + libraries = self.xcode_settings.AdjustLibraries(libraries) + self.WriteList(libraries, "LIBS") + self.WriteLn( + "%s: GYP_LDFLAGS := $(LDFLAGS_$(BUILDTYPE))" + % QuoteSpaces(self.output_binary) + ) + self.WriteLn("%s: LIBS := $(LIBS)" % QuoteSpaces(self.output_binary)) + + if self.flavor == "mac": + self.WriteLn( + "%s: GYP_LIBTOOLFLAGS := $(LIBTOOLFLAGS_$(BUILDTYPE))" + % QuoteSpaces(self.output_binary) + ) + + # Postbuild actions. Like actions, but implicitly depend on the target's + # output. + postbuilds = [] + if self.flavor == "mac": + if target_postbuilds: + postbuilds.append("$(TARGET_POSTBUILDS_$(BUILDTYPE))") + postbuilds.extend(gyp.xcode_emulation.GetSpecPostbuildCommands(spec)) + + if postbuilds: + # Envvars may be referenced by TARGET_POSTBUILDS_$(BUILDTYPE), + # so we must output its definition first, since we declare variables + # using ":=". + self.WriteSortedXcodeEnv(self.output, self.GetSortedXcodePostbuildEnv()) + + for configname in target_postbuilds: + self.WriteLn( + "%s: TARGET_POSTBUILDS_%s := %s" + % ( + QuoteSpaces(self.output), + configname, + gyp.common.EncodePOSIXShellList(target_postbuilds[configname]), + ) + ) + + # Postbuilds expect to be run in the gyp file's directory, so insert an + # implicit postbuild to cd to there. + postbuilds.insert(0, gyp.common.EncodePOSIXShellList(["cd", self.path])) + for i, postbuild in enumerate(postbuilds): + if not postbuild.startswith("$"): + postbuilds[i] = EscapeShellArgument(postbuild) + self.WriteLn("%s: builddir := $(abs_builddir)" % QuoteSpaces(self.output)) + self.WriteLn( + "%s: POSTBUILDS := %s" + % (QuoteSpaces(self.output), " ".join(postbuilds)) + ) + + # A bundle directory depends on its dependencies such as bundle resources + # and bundle binary. When all dependencies have been built, the bundle + # needs to be packaged. + if self.is_mac_bundle: + # If the framework doesn't contain a binary, then nothing depends + # on the actions -- make the framework depend on them directly too. + self.WriteDependencyOnExtraOutputs(self.output, extra_outputs) + + # Bundle dependencies. Note that the code below adds actions to this + # target, so if you move these two lines, move the lines below as well. + self.WriteList([QuoteSpaces(dep) for dep in bundle_deps], "BUNDLE_DEPS") + self.WriteLn("%s: $(BUNDLE_DEPS)" % QuoteSpaces(self.output)) + + # After the framework is built, package it. Needs to happen before + # postbuilds, since postbuilds depend on this. + if self.type in ("shared_library", "loadable_module"): + self.WriteLn( + "\t@$(call do_cmd,mac_package_framework,,,%s)" + % self.xcode_settings.GetFrameworkVersion() + ) + + # Bundle postbuilds can depend on the whole bundle, so run them after + # the bundle is packaged, not already after the bundle binary is done. + if postbuilds: + self.WriteLn("\t@$(call do_postbuilds)") + postbuilds = [] # Don't write postbuilds for target's output. + + # Needed by test/mac/gyptest-rebuild.py. + self.WriteLn("\t@true # No-op, used by tests") + + # Since this target depends on binary and resources which are in + # nested subfolders, the framework directory will be older than + # its dependencies usually. To prevent this rule from executing + # on every build (expensive, especially with postbuilds), expliclity + # update the time on the framework directory. + self.WriteLn("\t@touch -c %s" % QuoteSpaces(self.output)) + + if postbuilds: + assert not self.is_mac_bundle, ( + "Postbuilds for bundles should be done " + "on the bundle, not the binary (target '%s')" % self.target + ) + assert "product_dir" not in spec, ( + "Postbuilds do not work with " "custom product_dir" + ) + + if self.type == "executable": + self.WriteLn( + "%s: LD_INPUTS := %s" + % ( + QuoteSpaces(self.output_binary), + " ".join(QuoteSpaces(dep) for dep in link_deps), + ) + ) + if self.toolset == "host" and self.flavor == "android": + self.WriteDoCmd( + [self.output_binary], + link_deps, + "link_host", + part_of_all, + postbuilds=postbuilds, + ) + else: + self.WriteDoCmd( + [self.output_binary], + link_deps, + "link", + part_of_all, + postbuilds=postbuilds, + ) + + elif self.type == "static_library": + for link_dep in link_deps: + assert " " not in link_dep, ( + "Spaces in alink input filenames not supported (%s)" % link_dep + ) + if ( + self.flavor not in ("mac", "openbsd", "netbsd", "win") + and not self.is_standalone_static_library + ): + self.WriteDoCmd( + [self.output_binary], + link_deps, + "alink_thin", + part_of_all, + postbuilds=postbuilds, + ) + else: + self.WriteDoCmd( + [self.output_binary], + link_deps, + "alink", + part_of_all, + postbuilds=postbuilds, + ) + elif self.type == "shared_library": + self.WriteLn( + "%s: LD_INPUTS := %s" + % ( + QuoteSpaces(self.output_binary), + " ".join(QuoteSpaces(dep) for dep in link_deps), + ) + ) + self.WriteDoCmd( + [self.output_binary], + link_deps, + "solink", + part_of_all, + postbuilds=postbuilds, + ) + elif self.type == "loadable_module": + for link_dep in link_deps: + assert " " not in link_dep, ( + "Spaces in module input filenames not supported (%s)" % link_dep + ) + if self.toolset == "host" and self.flavor == "android": + self.WriteDoCmd( + [self.output_binary], + link_deps, + "solink_module_host", + part_of_all, + postbuilds=postbuilds, + ) + else: + self.WriteDoCmd( + [self.output_binary], + link_deps, + "solink_module", + part_of_all, + postbuilds=postbuilds, + ) + elif self.type == "none": + # Write a stamp line. + self.WriteDoCmd( + [self.output_binary], deps, "touch", part_of_all, postbuilds=postbuilds + ) else: - ldflags = config.get('ldflags', []) - # Compute an rpath for this output if needed. - if any(dep.endswith('.so') or '.so.' in dep for dep in deps): - # We want to get the literal string "$ORIGIN" into the link command, - # so we need lots of escaping. - ldflags.append(r'-Wl,-rpath=\$$ORIGIN/lib.%s/' % self.toolset) - ldflags.append(r'-Wl,-rpath-link=\$(builddir)/lib.%s/' % - self.toolset) - library_dirs = config.get('library_dirs', []) - ldflags += [('-L%s' % library_dir) for library_dir in library_dirs] - self.WriteList(ldflags, 'LDFLAGS_%s' % configname) - if self.flavor == 'mac': - self.WriteList(self.xcode_settings.GetLibtoolflags(configname), - 'LIBTOOLFLAGS_%s' % configname) - libraries = spec.get('libraries') - if libraries: - # Remove duplicate entries - libraries = gyp.common.uniquer(libraries) - if self.flavor == 'mac': - libraries = self.xcode_settings.AdjustLibraries(libraries) - self.WriteList(libraries, 'LIBS') - self.WriteLn('%s: GYP_LDFLAGS := $(LDFLAGS_$(BUILDTYPE))' % - QuoteSpaces(self.output_binary)) - self.WriteLn('%s: LIBS := $(LIBS)' % QuoteSpaces(self.output_binary)) - - if self.flavor == 'mac': - self.WriteLn('%s: GYP_LIBTOOLFLAGS := $(LIBTOOLFLAGS_$(BUILDTYPE))' % - QuoteSpaces(self.output_binary)) - - # Postbuild actions. Like actions, but implicitly depend on the target's - # output. - postbuilds = [] - if self.flavor == 'mac': - if target_postbuilds: - postbuilds.append('$(TARGET_POSTBUILDS_$(BUILDTYPE))') - postbuilds.extend( - gyp.xcode_emulation.GetSpecPostbuildCommands(spec)) - - if postbuilds: - # Envvars may be referenced by TARGET_POSTBUILDS_$(BUILDTYPE), - # so we must output its definition first, since we declare variables - # using ":=". - self.WriteSortedXcodeEnv(self.output, self.GetSortedXcodePostbuildEnv()) - - for configname in target_postbuilds: - self.WriteLn('%s: TARGET_POSTBUILDS_%s := %s' % - (QuoteSpaces(self.output), - configname, - gyp.common.EncodePOSIXShellList(target_postbuilds[configname]))) - - # Postbuilds expect to be run in the gyp file's directory, so insert an - # implicit postbuild to cd to there. - postbuilds.insert(0, gyp.common.EncodePOSIXShellList(['cd', self.path])) - for i in range(len(postbuilds)): - if not postbuilds[i].startswith('$'): - postbuilds[i] = EscapeShellArgument(postbuilds[i]) - self.WriteLn('%s: builddir := $(abs_builddir)' % QuoteSpaces(self.output)) - self.WriteLn('%s: POSTBUILDS := %s' % ( - QuoteSpaces(self.output), ' '.join(postbuilds))) - - # A bundle directory depends on its dependencies such as bundle resources - # and bundle binary. When all dependencies have been built, the bundle - # needs to be packaged. - if self.is_mac_bundle: - # If the framework doesn't contain a binary, then nothing depends - # on the actions -- make the framework depend on them directly too. - self.WriteDependencyOnExtraOutputs(self.output, extra_outputs) - - # Bundle dependencies. Note that the code below adds actions to this - # target, so if you move these two lines, move the lines below as well. - self.WriteList([QuoteSpaces(dep) for dep in bundle_deps], 'BUNDLE_DEPS') - self.WriteLn('%s: $(BUNDLE_DEPS)' % QuoteSpaces(self.output)) - - # After the framework is built, package it. Needs to happen before - # postbuilds, since postbuilds depend on this. - if self.type in ('shared_library', 'loadable_module'): - self.WriteLn('\t@$(call do_cmd,mac_package_framework,,,%s)' % - self.xcode_settings.GetFrameworkVersion()) - - # Bundle postbuilds can depend on the whole bundle, so run them after - # the bundle is packaged, not already after the bundle binary is done. - if postbuilds: - self.WriteLn('\t@$(call do_postbuilds)') - postbuilds = [] # Don't write postbuilds for target's output. - - # Needed by test/mac/gyptest-rebuild.py. - self.WriteLn('\t@true # No-op, used by tests') - - # Since this target depends on binary and resources which are in - # nested subfolders, the framework directory will be older than - # its dependencies usually. To prevent this rule from executing - # on every build (expensive, especially with postbuilds), expliclity - # update the time on the framework directory. - self.WriteLn('\t@touch -c %s' % QuoteSpaces(self.output)) - - if postbuilds: - assert not self.is_mac_bundle, ('Postbuilds for bundles should be done ' - 'on the bundle, not the binary (target \'%s\')' % self.target) - assert 'product_dir' not in spec, ('Postbuilds do not work with ' - 'custom product_dir') - - if self.type == 'executable': - self.WriteLn('%s: LD_INPUTS := %s' % ( - QuoteSpaces(self.output_binary), - ' '.join(QuoteSpaces(dep) for dep in link_deps))) - if self.toolset == 'host' and self.flavor == 'android': - self.WriteDoCmd([self.output_binary], link_deps, 'link_host', - part_of_all, postbuilds=postbuilds) - else: - self.WriteDoCmd([self.output_binary], link_deps, 'link', part_of_all, - postbuilds=postbuilds) - - elif self.type == 'static_library': - for link_dep in link_deps: - assert ' ' not in link_dep, ( - "Spaces in alink input filenames not supported (%s)" % link_dep) - if (self.flavor not in ('mac', 'openbsd', 'netbsd', 'win') and not - self.is_standalone_static_library): - self.WriteDoCmd([self.output_binary], link_deps, 'alink_thin', - part_of_all, postbuilds=postbuilds) - else: - self.WriteDoCmd([self.output_binary], link_deps, 'alink', part_of_all, - postbuilds=postbuilds) - elif self.type == 'shared_library': - self.WriteLn('%s: LD_INPUTS := %s' % ( - QuoteSpaces(self.output_binary), - ' '.join(QuoteSpaces(dep) for dep in link_deps))) - self.WriteDoCmd([self.output_binary], link_deps, 'solink', part_of_all, - postbuilds=postbuilds) - elif self.type == 'loadable_module': - for link_dep in link_deps: - assert ' ' not in link_dep, ( - "Spaces in module input filenames not supported (%s)" % link_dep) - if self.toolset == 'host' and self.flavor == 'android': - self.WriteDoCmd([self.output_binary], link_deps, 'solink_module_host', - part_of_all, postbuilds=postbuilds) - else: - self.WriteDoCmd( - [self.output_binary], link_deps, 'solink_module', part_of_all, - postbuilds=postbuilds) - elif self.type == 'none': - # Write a stamp line. - self.WriteDoCmd([self.output_binary], deps, 'touch', part_of_all, - postbuilds=postbuilds) - else: - print("WARNING: no output for", self.type, self.target) - - # Add an alias for each target (if there are any outputs). - # Installable target aliases are created below. - if ((self.output and self.output != self.target) and - (self.type not in self._INSTALLABLE_TARGETS)): - self.WriteMakeRule([self.target], [self.output], - comment='Add target alias', phony = True) - if part_of_all: - self.WriteMakeRule(['all'], [self.target], - comment = 'Add target alias to "all" target.', - phony = True) - - # Add special-case rules for our installable targets. - # 1) They need to install to the build dir or "product" dir. - # 2) They get shortcuts for building (e.g. "make chrome"). - # 3) They are part of "make all". - if (self.type in self._INSTALLABLE_TARGETS or - self.is_standalone_static_library): - if self.type == 'shared_library': - file_desc = 'shared library' - elif self.type == 'static_library': - file_desc = 'static library' - else: - file_desc = 'executable' - install_path = self._InstallableTargetInstallPath() - installable_deps = [self.output] - if (self.flavor == 'mac' and not 'product_dir' in spec and - self.toolset == 'target'): - # On mac, products are created in install_path immediately. - assert install_path == self.output, '%s != %s' % ( - install_path, self.output) - - # Point the target alias to the final binary output. - self.WriteMakeRule([self.target], [install_path], - comment='Add target alias', phony = True) - if install_path != self.output: - assert not self.is_mac_bundle # See comment a few lines above. - self.WriteDoCmd([install_path], [self.output], 'copy', - comment = 'Copy this to the %s output path.' % - file_desc, part_of_all=part_of_all) - installable_deps.append(install_path) - if self.output != self.alias and self.alias != self.target: - self.WriteMakeRule([self.alias], installable_deps, - comment = 'Short alias for building this %s.' % - file_desc, phony = True) - if part_of_all: - self.WriteMakeRule(['all'], [install_path], - comment = 'Add %s to "all" target.' % file_desc, - phony = True) - - - def WriteList(self, value_list, variable=None, prefix='', - quoter=QuoteIfNecessary): - """Write a variable definition that is a list of values. + print("WARNING: no output for", self.type, self.target) + + # Add an alias for each target (if there are any outputs). + # Installable target aliases are created below. + if (self.output and self.output != self.target) and ( + self.type not in self._INSTALLABLE_TARGETS + ): + self.WriteMakeRule( + [self.target], [self.output], comment="Add target alias", phony=True + ) + if part_of_all: + self.WriteMakeRule( + ["all"], + [self.target], + comment='Add target alias to "all" target.', + phony=True, + ) + + # Add special-case rules for our installable targets. + # 1) They need to install to the build dir or "product" dir. + # 2) They get shortcuts for building (e.g. "make chrome"). + # 3) They are part of "make all". + if self.type in self._INSTALLABLE_TARGETS or self.is_standalone_static_library: + if self.type == "shared_library": + file_desc = "shared library" + elif self.type == "static_library": + file_desc = "static library" + else: + file_desc = "executable" + install_path = self._InstallableTargetInstallPath() + installable_deps = [self.output] + if ( + self.flavor == "mac" + and "product_dir" not in spec + and self.toolset == "target" + ): + # On mac, products are created in install_path immediately. + assert install_path == self.output, "%s != %s" % ( + install_path, + self.output, + ) + + # Point the target alias to the final binary output. + self.WriteMakeRule( + [self.target], [install_path], comment="Add target alias", phony=True + ) + if install_path != self.output: + assert not self.is_mac_bundle # See comment a few lines above. + self.WriteDoCmd( + [install_path], + [self.output], + "copy", + comment="Copy this to the %s output path." % file_desc, + part_of_all=part_of_all, + ) + installable_deps.append(install_path) + if self.output != self.alias and self.alias != self.target: + self.WriteMakeRule( + [self.alias], + installable_deps, + comment="Short alias for building this %s." % file_desc, + phony=True, + ) + if part_of_all: + self.WriteMakeRule( + ["all"], + [install_path], + comment='Add %s to "all" target.' % file_desc, + phony=True, + ) + + def WriteList(self, value_list, variable=None, prefix="", quoter=QuoteIfNecessary): + """Write a variable definition that is a list of values. E.g. WriteList(['a','b'], 'foo', prefix='blah') writes out foo = blaha blahb but in a pretty-printed style. """ - values = '' - if value_list: - value_list = [quoter(prefix + l) for l in value_list] - values = ' \\\n\t' + ' \\\n\t'.join(value_list) - self.fp.write('%s :=%s\n\n' % (variable, values)) + values = "" + if value_list: + value_list = [quoter(prefix + value) for value in value_list] + values = " \\\n\t" + " \\\n\t".join(value_list) + self.fp.write("%s :=%s\n\n" % (variable, values)) - - def WriteDoCmd(self, outputs, inputs, command, part_of_all, comment=None, - postbuilds=False): - """Write a Makefile rule that uses do_cmd. + def WriteDoCmd( + self, outputs, inputs, command, part_of_all, comment=None, postbuilds=False + ): + """Write a Makefile rule that uses do_cmd. This makes the outputs dependent on the command line that was run, as well as support the V= make command line flag. """ - suffix = '' - if postbuilds: - assert ',' not in command - suffix = ',,1' # Tell do_cmd to honor $POSTBUILDS - self.WriteMakeRule(outputs, inputs, - actions = ['$(call do_cmd,%s%s)' % (command, suffix)], - comment = comment, - command = command, - force = True) - # Add our outputs to the list of targets we read depfiles from. - # all_deps is only used for deps file reading, and for deps files we replace - # spaces with ? because escaping doesn't work with make's $(sort) and - # other functions. - outputs = [QuoteSpaces(o, SPACE_REPLACEMENT) for o in outputs] - self.WriteLn('all_deps += %s' % ' '.join(outputs)) - - - def WriteMakeRule(self, outputs, inputs, actions=None, comment=None, - order_only=False, force=False, phony=False, command=None): - """Write a Makefile rule, with some extra tricks. + suffix = "" + if postbuilds: + assert "," not in command + suffix = ",,1" # Tell do_cmd to honor $POSTBUILDS + self.WriteMakeRule( + outputs, + inputs, + actions=["$(call do_cmd,%s%s)" % (command, suffix)], + comment=comment, + command=command, + force=True, + ) + # Add our outputs to the list of targets we read depfiles from. + # all_deps is only used for deps file reading, and for deps files we replace + # spaces with ? because escaping doesn't work with make's $(sort) and + # other functions. + outputs = [QuoteSpaces(o, SPACE_REPLACEMENT) for o in outputs] + self.WriteLn("all_deps += %s" % " ".join(outputs)) + + def WriteMakeRule( + self, + outputs, + inputs, + actions=None, + comment=None, + order_only=False, + force=False, + phony=False, + command=None, + ): + """Write a Makefile rule, with some extra tricks. outputs: a list of outputs for the rule (note: this is not directly supported by make; see comments below) @@ -1746,53 +2001,54 @@ def WriteMakeRule(self, outputs, inputs, actions=None, comment=None, output is just a name to run the rule command: (optional) command name to generate unambiguous labels """ - outputs = [QuoteSpaces(o) for o in outputs] - inputs = [QuoteSpaces(i) for i in inputs] - - if comment: - self.WriteLn('# ' + comment) - if phony: - self.WriteLn('.PHONY: ' + ' '.join(outputs)) - if actions: - self.WriteLn("%s: TOOLSET := $(TOOLSET)" % outputs[0]) - force_append = ' FORCE_DO_CMD' if force else '' - - if order_only: - # Order only rule: Just write a simple rule. - # TODO(evanm): just make order_only a list of deps instead of this hack. - self.WriteLn('%s: | %s%s' % - (' '.join(outputs), ' '.join(inputs), force_append)) - elif len(outputs) == 1: - # Regular rule, one output: Just write a simple rule. - self.WriteLn('%s: %s%s' % (outputs[0], ' '.join(inputs), force_append)) - else: - # Regular rule, more than one output: Multiple outputs are tricky in - # make. We will write three rules: - # - All outputs depend on an intermediate file. - # - Make .INTERMEDIATE depend on the intermediate. - # - The intermediate file depends on the inputs and executes the - # actual command. - # - The intermediate recipe will 'touch' the intermediate file. - # - The multi-output rule will have an do-nothing recipe. - - # Hash the target name to avoid generating overlong filenames. - cmddigest = hashlib.sha1((command or self.target).encode('utf-8')).hexdigest() - intermediate = "%s.intermediate" % cmddigest - self.WriteLn('%s: %s' % (' '.join(outputs), intermediate)) - self.WriteLn('\t%s' % '@:') - self.WriteLn('%s: %s' % ('.INTERMEDIATE', intermediate)) - self.WriteLn('%s: %s%s' % - (intermediate, ' '.join(inputs), force_append)) - actions.insert(0, '$(call do_cmd,touch)') - - if actions: - for action in actions: - self.WriteLn('\t%s' % action) - self.WriteLn() - - - def WriteAndroidNdkModuleRule(self, module_name, all_sources, link_deps): - """Write a set of LOCAL_XXX definitions for Android NDK. + outputs = [QuoteSpaces(o) for o in outputs] + inputs = [QuoteSpaces(i) for i in inputs] + + if comment: + self.WriteLn("# " + comment) + if phony: + self.WriteLn(".PHONY: " + " ".join(outputs)) + if actions: + self.WriteLn("%s: TOOLSET := $(TOOLSET)" % outputs[0]) + force_append = " FORCE_DO_CMD" if force else "" + + if order_only: + # Order only rule: Just write a simple rule. + # TODO(evanm): just make order_only a list of deps instead of this hack. + self.WriteLn( + "%s: | %s%s" % (" ".join(outputs), " ".join(inputs), force_append) + ) + elif len(outputs) == 1: + # Regular rule, one output: Just write a simple rule. + self.WriteLn("%s: %s%s" % (outputs[0], " ".join(inputs), force_append)) + else: + # Regular rule, more than one output: Multiple outputs are tricky in + # make. We will write three rules: + # - All outputs depend on an intermediate file. + # - Make .INTERMEDIATE depend on the intermediate. + # - The intermediate file depends on the inputs and executes the + # actual command. + # - The intermediate recipe will 'touch' the intermediate file. + # - The multi-output rule will have an do-nothing recipe. + + # Hash the target name to avoid generating overlong filenames. + cmddigest = hashlib.sha1( + (command or self.target).encode("utf-8") + ).hexdigest() + intermediate = "%s.intermediate" % cmddigest + self.WriteLn("%s: %s" % (" ".join(outputs), intermediate)) + self.WriteLn("\t%s" % "@:") + self.WriteLn("%s: %s" % (".INTERMEDIATE", intermediate)) + self.WriteLn("%s: %s%s" % (intermediate, " ".join(inputs), force_append)) + actions.insert(0, "$(call do_cmd,touch)") + + if actions: + for action in actions: + self.WriteLn("\t%s" % action) + self.WriteLn() + + def WriteAndroidNdkModuleRule(self, module_name, all_sources, link_deps): + """Write a set of LOCAL_XXX definitions for Android NDK. These variable definitions will be used by Android NDK but do nothing for non-Android applications. @@ -1804,462 +2060,495 @@ def WriteAndroidNdkModuleRule(self, module_name, all_sources, link_deps): link_deps: A list of link dependencies, which must be sorted in the order from dependencies to dependents. """ - if self.type not in ('executable', 'shared_library', 'static_library'): - return - - self.WriteLn('# Variable definitions for Android applications') - self.WriteLn('include $(CLEAR_VARS)') - self.WriteLn('LOCAL_MODULE := ' + module_name) - self.WriteLn('LOCAL_CFLAGS := $(CFLAGS_$(BUILDTYPE)) ' - '$(DEFS_$(BUILDTYPE)) ' - # LOCAL_CFLAGS is applied to both of C and C++. There is - # no way to specify $(CFLAGS_C_$(BUILDTYPE)) only for C - # sources. - '$(CFLAGS_C_$(BUILDTYPE)) ' - # $(INCS_$(BUILDTYPE)) includes the prefix '-I' while - # LOCAL_C_INCLUDES does not expect it. So put it in - # LOCAL_CFLAGS. - '$(INCS_$(BUILDTYPE))') - # LOCAL_CXXFLAGS is obsolete and LOCAL_CPPFLAGS is preferred. - self.WriteLn('LOCAL_CPPFLAGS := $(CFLAGS_CC_$(BUILDTYPE))') - self.WriteLn('LOCAL_C_INCLUDES :=') - self.WriteLn('LOCAL_LDLIBS := $(LDFLAGS_$(BUILDTYPE)) $(LIBS)') - - # Detect the C++ extension. - cpp_ext = {'.cc': 0, '.cpp': 0, '.cxx': 0} - default_cpp_ext = '.cpp' - for filename in all_sources: - ext = os.path.splitext(filename)[1] - if ext in cpp_ext: - cpp_ext[ext] += 1 - if cpp_ext[ext] > cpp_ext[default_cpp_ext]: - default_cpp_ext = ext - self.WriteLn('LOCAL_CPP_EXTENSION := ' + default_cpp_ext) - - self.WriteList(list(map(self.Absolutify, filter(Compilable, all_sources))), - 'LOCAL_SRC_FILES') - - # Filter out those which do not match prefix and suffix and produce - # the resulting list without prefix and suffix. - def DepsToModules(deps, prefix, suffix): - modules = [] - for filepath in deps: - filename = os.path.basename(filepath) - if filename.startswith(prefix) and filename.endswith(suffix): - modules.append(filename[len(prefix):-len(suffix)]) - return modules - - # Retrieve the default value of 'SHARED_LIB_SUFFIX' - params = {'flavor': 'linux'} - default_variables = {} - CalculateVariables(default_variables, params) - - self.WriteList( - DepsToModules(link_deps, - generator_default_variables['SHARED_LIB_PREFIX'], - default_variables['SHARED_LIB_SUFFIX']), - 'LOCAL_SHARED_LIBRARIES') - self.WriteList( - DepsToModules(link_deps, - generator_default_variables['STATIC_LIB_PREFIX'], - generator_default_variables['STATIC_LIB_SUFFIX']), - 'LOCAL_STATIC_LIBRARIES') - - if self.type == 'executable': - self.WriteLn('include $(BUILD_EXECUTABLE)') - elif self.type == 'shared_library': - self.WriteLn('include $(BUILD_SHARED_LIBRARY)') - elif self.type == 'static_library': - self.WriteLn('include $(BUILD_STATIC_LIBRARY)') - self.WriteLn() - - - def WriteLn(self, text=''): - self.fp.write(text + '\n') - - - def GetSortedXcodeEnv(self, additional_settings=None): - return gyp.xcode_emulation.GetSortedXcodeEnv( - self.xcode_settings, "$(abs_builddir)", - os.path.join("$(abs_srcdir)", self.path), "$(BUILDTYPE)", - additional_settings) - - - def GetSortedXcodePostbuildEnv(self): - # CHROMIUM_STRIP_SAVE_FILE is a chromium-specific hack. - # TODO(thakis): It would be nice to have some general mechanism instead. - strip_save_file = self.xcode_settings.GetPerTargetSetting( - 'CHROMIUM_STRIP_SAVE_FILE', '') - # Even if strip_save_file is empty, explicitly write it. Else a postbuild - # might pick up an export from an earlier target. - return self.GetSortedXcodeEnv( - additional_settings={'CHROMIUM_STRIP_SAVE_FILE': strip_save_file}) - - - def WriteSortedXcodeEnv(self, target, env): - for k, v in env: - # For - # foo := a\ b - # the escaped space does the right thing. For - # export foo := a\ b - # it does not -- the backslash is written to the env as literal character. - # So don't escape spaces in |env[k]|. - self.WriteLn('%s: export %s := %s' % (QuoteSpaces(target), k, v)) - - - def Objectify(self, path): - """Convert a path to its output directory form.""" - if '$(' in path: - path = path.replace('$(obj)/', '$(obj).%s/$(TARGET)/' % self.toolset) - if not '$(obj)' in path: - path = '$(obj).%s/$(TARGET)/%s' % (self.toolset, path) - return path - - - def Pchify(self, path, lang): - """Convert a prefix header path to its output directory form.""" - path = self.Absolutify(path) - if '$(' in path: - path = path.replace('$(obj)/', '$(obj).%s/$(TARGET)/pch-%s' % - (self.toolset, lang)) - return path - return '$(obj).%s/$(TARGET)/pch-%s/%s' % (self.toolset, lang, path) - - - def Absolutify(self, path): - """Convert a subdirectory-relative path into a base-relative path. + if self.type not in ("executable", "shared_library", "static_library"): + return + + self.WriteLn("# Variable definitions for Android applications") + self.WriteLn("include $(CLEAR_VARS)") + self.WriteLn("LOCAL_MODULE := " + module_name) + self.WriteLn( + "LOCAL_CFLAGS := $(CFLAGS_$(BUILDTYPE)) " + "$(DEFS_$(BUILDTYPE)) " + # LOCAL_CFLAGS is applied to both of C and C++. There is + # no way to specify $(CFLAGS_C_$(BUILDTYPE)) only for C + # sources. + "$(CFLAGS_C_$(BUILDTYPE)) " + # $(INCS_$(BUILDTYPE)) includes the prefix '-I' while + # LOCAL_C_INCLUDES does not expect it. So put it in + # LOCAL_CFLAGS. + "$(INCS_$(BUILDTYPE))" + ) + # LOCAL_CXXFLAGS is obsolete and LOCAL_CPPFLAGS is preferred. + self.WriteLn("LOCAL_CPPFLAGS := $(CFLAGS_CC_$(BUILDTYPE))") + self.WriteLn("LOCAL_C_INCLUDES :=") + self.WriteLn("LOCAL_LDLIBS := $(LDFLAGS_$(BUILDTYPE)) $(LIBS)") + + # Detect the C++ extension. + cpp_ext = {".cc": 0, ".cpp": 0, ".cxx": 0} + default_cpp_ext = ".cpp" + for filename in all_sources: + ext = os.path.splitext(filename)[1] + if ext in cpp_ext: + cpp_ext[ext] += 1 + if cpp_ext[ext] > cpp_ext[default_cpp_ext]: + default_cpp_ext = ext + self.WriteLn("LOCAL_CPP_EXTENSION := " + default_cpp_ext) + + self.WriteList( + list(map(self.Absolutify, filter(Compilable, all_sources))), + "LOCAL_SRC_FILES", + ) + + # Filter out those which do not match prefix and suffix and produce + # the resulting list without prefix and suffix. + def DepsToModules(deps, prefix, suffix): + modules = [] + for filepath in deps: + filename = os.path.basename(filepath) + if filename.startswith(prefix) and filename.endswith(suffix): + modules.append(filename[len(prefix) : -len(suffix)]) + return modules + + # Retrieve the default value of 'SHARED_LIB_SUFFIX' + params = {"flavor": "linux"} + default_variables = {} + CalculateVariables(default_variables, params) + + self.WriteList( + DepsToModules( + link_deps, + generator_default_variables["SHARED_LIB_PREFIX"], + default_variables["SHARED_LIB_SUFFIX"], + ), + "LOCAL_SHARED_LIBRARIES", + ) + self.WriteList( + DepsToModules( + link_deps, + generator_default_variables["STATIC_LIB_PREFIX"], + generator_default_variables["STATIC_LIB_SUFFIX"], + ), + "LOCAL_STATIC_LIBRARIES", + ) + + if self.type == "executable": + self.WriteLn("include $(BUILD_EXECUTABLE)") + elif self.type == "shared_library": + self.WriteLn("include $(BUILD_SHARED_LIBRARY)") + elif self.type == "static_library": + self.WriteLn("include $(BUILD_STATIC_LIBRARY)") + self.WriteLn() + + def WriteLn(self, text=""): + self.fp.write(text + "\n") + + def GetSortedXcodeEnv(self, additional_settings=None): + return gyp.xcode_emulation.GetSortedXcodeEnv( + self.xcode_settings, + "$(abs_builddir)", + os.path.join("$(abs_srcdir)", self.path), + "$(BUILDTYPE)", + additional_settings, + ) + + def GetSortedXcodePostbuildEnv(self): + # CHROMIUM_STRIP_SAVE_FILE is a chromium-specific hack. + # TODO(thakis): It would be nice to have some general mechanism instead. + strip_save_file = self.xcode_settings.GetPerTargetSetting( + "CHROMIUM_STRIP_SAVE_FILE", "" + ) + # Even if strip_save_file is empty, explicitly write it. Else a postbuild + # might pick up an export from an earlier target. + return self.GetSortedXcodeEnv( + additional_settings={"CHROMIUM_STRIP_SAVE_FILE": strip_save_file} + ) + + def WriteSortedXcodeEnv(self, target, env): + for k, v in env: + # For + # foo := a\ b + # the escaped space does the right thing. For + # export foo := a\ b + # it does not -- the backslash is written to the env as literal character. + # So don't escape spaces in |env[k]|. + self.WriteLn("%s: export %s := %s" % (QuoteSpaces(target), k, v)) + + def Objectify(self, path): + """Convert a path to its output directory form.""" + if "$(" in path: + path = path.replace("$(obj)/", "$(obj).%s/$(TARGET)/" % self.toolset) + if "$(obj)" not in path: + path = "$(obj).%s/$(TARGET)/%s" % (self.toolset, path) + return path + + def Pchify(self, path, lang): + """Convert a prefix header path to its output directory form.""" + path = self.Absolutify(path) + if "$(" in path: + path = path.replace( + "$(obj)/", "$(obj).%s/$(TARGET)/pch-%s" % (self.toolset, lang) + ) + return path + return "$(obj).%s/$(TARGET)/pch-%s/%s" % (self.toolset, lang, path) + + def Absolutify(self, path): + """Convert a subdirectory-relative path into a base-relative path. Skips over paths that contain variables.""" - if '$(' in path: - # Don't call normpath in this case, as it might collapse the - # path too aggressively if it features '..'. However it's still - # important to strip trailing slashes. - return path.rstrip('/') - return os.path.normpath(os.path.join(self.path, path)) - - - def ExpandInputRoot(self, template, expansion, dirname): - if '%(INPUT_ROOT)s' not in template and '%(INPUT_DIRNAME)s' not in template: - return template - path = template % { - 'INPUT_ROOT': expansion, - 'INPUT_DIRNAME': dirname, + if "$(" in path: + # Don't call normpath in this case, as it might collapse the + # path too aggressively if it features '..'. However it's still + # important to strip trailing slashes. + return path.rstrip("/") + return os.path.normpath(os.path.join(self.path, path)) + + def ExpandInputRoot(self, template, expansion, dirname): + if "%(INPUT_ROOT)s" not in template and "%(INPUT_DIRNAME)s" not in template: + return template + path = template % { + "INPUT_ROOT": expansion, + "INPUT_DIRNAME": dirname, + } + return path + + def _InstallableTargetInstallPath(self): + """Returns the location of the final output for an installable target.""" + # Xcode puts shared_library results into PRODUCT_DIR, and some gyp files + # rely on this. Emulate this behavior for mac. + if self.type == "shared_library" and ( + self.flavor != "mac" or self.toolset != "target" + ): + # Install all shared libs into a common directory (per toolset) for + # convenient access with LD_LIBRARY_PATH. + return "$(builddir)/lib.%s/%s" % (self.toolset, self.alias) + return "$(builddir)/" + self.alias + + +def WriteAutoRegenerationRule(params, root_makefile, makefile_name, build_files): + """Write the target to regenerate the Makefile.""" + options = params["options"] + build_files_args = [ + gyp.common.RelativePath(filename, options.toplevel_dir) + for filename in params["build_files_arg"] + ] + + gyp_binary = gyp.common.FixIfRelativePath( + params["gyp_binary"], options.toplevel_dir + ) + if not gyp_binary.startswith(os.sep): + gyp_binary = os.path.join(".", gyp_binary) + + root_makefile.write( + "quiet_cmd_regen_makefile = ACTION Regenerating $@\n" + "cmd_regen_makefile = cd $(srcdir); %(cmd)s\n" + "%(makefile_name)s: %(deps)s\n" + "\t$(call do_cmd,regen_makefile)\n\n" + % { + "makefile_name": makefile_name, + "deps": " ".join(SourceifyAndQuoteSpaces(bf) for bf in build_files), + "cmd": gyp.common.EncodePOSIXShellList( + [gyp_binary, "-fmake"] + gyp.RegenerateFlags(options) + build_files_args + ), } - return path - - - def _InstallableTargetInstallPath(self): - """Returns the location of the final output for an installable target.""" - # Xcode puts shared_library results into PRODUCT_DIR, and some gyp files - # rely on this. Emulate this behavior for mac. - - # XXX(TooTallNate): disabling this code since we don't want this behavior... - #if (self.type == 'shared_library' and - # (self.flavor != 'mac' or self.toolset != 'target')): - # # Install all shared libs into a common directory (per toolset) for - # # convenient access with LD_LIBRARY_PATH. - # return '$(builddir)/lib.%s/%s' % (self.toolset, self.alias) - return '$(builddir)/' + self.alias - - -def WriteAutoRegenerationRule(params, root_makefile, makefile_name, - build_files): - """Write the target to regenerate the Makefile.""" - options = params['options'] - build_files_args = [gyp.common.RelativePath(filename, options.toplevel_dir) - for filename in params['build_files_arg']] - - gyp_binary = gyp.common.FixIfRelativePath(params['gyp_binary'], - options.toplevel_dir) - if not gyp_binary.startswith(os.sep): - gyp_binary = os.path.join('.', gyp_binary) - - root_makefile.write( - "quiet_cmd_regen_makefile = ACTION Regenerating $@\n" - "cmd_regen_makefile = cd $(srcdir); %(cmd)s\n" - "%(makefile_name)s: %(deps)s\n" - "\t$(call do_cmd,regen_makefile)\n\n" % { - 'makefile_name': makefile_name, - 'deps': ' '.join(SourceifyAndQuoteSpaces(bf) for bf in build_files), - 'cmd': gyp.common.EncodePOSIXShellList( - [gyp_binary, '-fmake'] + - gyp.RegenerateFlags(options) + - build_files_args)}) + ) def PerformBuild(data, configurations, params): - options = params['options'] - for config in configurations: - arguments = ['make'] - if options.toplevel_dir and options.toplevel_dir != '.': - arguments += '-C', options.toplevel_dir - arguments.append('BUILDTYPE=' + config) - print('Building [%s]: %s' % (config, arguments)) - subprocess.check_call(arguments) + options = params["options"] + for config in configurations: + arguments = ["make"] + if options.toplevel_dir and options.toplevel_dir != ".": + arguments += "-C", options.toplevel_dir + arguments.append("BUILDTYPE=" + config) + print("Building [%s]: %s" % (config, arguments)) + subprocess.check_call(arguments) def GenerateOutput(target_list, target_dicts, data, params): - options = params['options'] - flavor = gyp.common.GetFlavor(params) - generator_flags = params.get('generator_flags', {}) - builddir_name = generator_flags.get('output_dir', 'out') - android_ndk_version = generator_flags.get('android_ndk_version', None) - default_target = generator_flags.get('default_target', 'all') - - def CalculateMakefilePath(build_file, base_name): - """Determine where to write a Makefile for a given gyp file.""" - # Paths in gyp files are relative to the .gyp file, but we want - # paths relative to the source root for the master makefile. Grab - # the path of the .gyp file as the base to relativize against. - # E.g. "foo/bar" when we're constructing targets for "foo/bar/baz.gyp". - base_path = gyp.common.RelativePath(os.path.dirname(build_file), - options.depth) - # We write the file in the base_path directory. - output_file = os.path.join(options.depth, base_path, base_name) + options = params["options"] + flavor = gyp.common.GetFlavor(params) + generator_flags = params.get("generator_flags", {}) + builddir_name = generator_flags.get("output_dir", "out") + android_ndk_version = generator_flags.get("android_ndk_version", None) + default_target = generator_flags.get("default_target", "all") + + def CalculateMakefilePath(build_file, base_name): + """Determine where to write a Makefile for a given gyp file.""" + # Paths in gyp files are relative to the .gyp file, but we want + # paths relative to the source root for the master makefile. Grab + # the path of the .gyp file as the base to relativize against. + # E.g. "foo/bar" when we're constructing targets for "foo/bar/baz.gyp". + base_path = gyp.common.RelativePath(os.path.dirname(build_file), options.depth) + # We write the file in the base_path directory. + output_file = os.path.join(options.depth, base_path, base_name) + if options.generator_output: + output_file = os.path.join( + options.depth, options.generator_output, base_path, base_name + ) + base_path = gyp.common.RelativePath( + os.path.dirname(build_file), options.toplevel_dir + ) + return base_path, output_file + + # TODO: search for the first non-'Default' target. This can go + # away when we add verification that all targets have the + # necessary configurations. + default_configuration = None + toolsets = set([target_dicts[target]["toolset"] for target in target_list]) + for target in target_list: + spec = target_dicts[target] + if spec["default_configuration"] != "Default": + default_configuration = spec["default_configuration"] + break + if not default_configuration: + default_configuration = "Default" + + srcdir = "." + makefile_name = "Makefile" + options.suffix + makefile_path = os.path.join(options.toplevel_dir, makefile_name) if options.generator_output: - output_file = os.path.join( - options.depth, options.generator_output, base_path, base_name) - base_path = gyp.common.RelativePath(os.path.dirname(build_file), - options.toplevel_dir) - return base_path, output_file - - # TODO: search for the first non-'Default' target. This can go - # away when we add verification that all targets have the - # necessary configurations. - default_configuration = None - toolsets = set([target_dicts[target]['toolset'] for target in target_list]) - for target in target_list: - spec = target_dicts[target] - if spec['default_configuration'] != 'Default': - default_configuration = spec['default_configuration'] - break - if not default_configuration: - default_configuration = 'Default' - - srcdir = '.' - makefile_name = 'Makefile' + options.suffix - makefile_path = os.path.join(options.toplevel_dir, makefile_name) - if options.generator_output: - global srcdir_prefix - makefile_path = os.path.join( - options.toplevel_dir, options.generator_output, makefile_name) - srcdir = gyp.common.RelativePath(srcdir, options.generator_output) - srcdir_prefix = '$(srcdir)/' - - flock_command= 'flock' - copy_archive_arguments = '-af' - makedep_arguments = '-MMD' - header_params = { - 'default_target': default_target, - 'builddir': builddir_name, - 'default_configuration': default_configuration, - 'flock': flock_command, - 'flock_index': 1, - 'link_commands': LINK_COMMANDS_LINUX, - 'extra_commands': '', - 'srcdir': srcdir, - 'copy_archive_args': copy_archive_arguments, - 'makedep_args': makedep_arguments, - 'CC.target': GetEnvironFallback(('CC_target', 'CC'), '$(CC)'), - 'AR.target': GetEnvironFallback(('AR_target', 'AR'), '$(AR)'), - 'CXX.target': GetEnvironFallback(('CXX_target', 'CXX'), '$(CXX)'), - 'LINK.target': GetEnvironFallback(('LINK_target', 'LINK'), '$(LINK)'), - 'CC.host': GetEnvironFallback(('CC_host', 'CC'), 'gcc'), - 'AR.host': GetEnvironFallback(('AR_host', 'AR'), 'ar'), - 'CXX.host': GetEnvironFallback(('CXX_host', 'CXX'), 'g++'), - 'LINK.host': GetEnvironFallback(('LINK_host', 'LINK'), '$(CXX.host)'), + global srcdir_prefix + makefile_path = os.path.join( + options.toplevel_dir, options.generator_output, makefile_name + ) + srcdir = gyp.common.RelativePath(srcdir, options.generator_output) + srcdir_prefix = "$(srcdir)/" + + flock_command = "flock" + copy_archive_arguments = "-af" + makedep_arguments = "-MMD" + header_params = { + "default_target": default_target, + "builddir": builddir_name, + "default_configuration": default_configuration, + "flock": flock_command, + "flock_index": 1, + "link_commands": LINK_COMMANDS_LINUX, + "extra_commands": "", + "srcdir": srcdir, + "copy_archive_args": copy_archive_arguments, + "makedep_args": makedep_arguments, + "CC.target": GetEnvironFallback(("CC_target", "CC"), "$(CC)"), + "AR.target": GetEnvironFallback(("AR_target", "AR"), "$(AR)"), + "CXX.target": GetEnvironFallback(("CXX_target", "CXX"), "$(CXX)"), + "LINK.target": GetEnvironFallback(("LINK_target", "LINK"), "$(LINK)"), + "CC.host": GetEnvironFallback(("CC_host", "CC"), "gcc"), + "AR.host": GetEnvironFallback(("AR_host", "AR"), "ar"), + "CXX.host": GetEnvironFallback(("CXX_host", "CXX"), "g++"), + "LINK.host": GetEnvironFallback(("LINK_host", "LINK"), "$(CXX.host)"), } - if flavor == 'mac': - flock_command = './gyp-mac-tool flock' - header_params.update({ - 'flock': flock_command, - 'flock_index': 2, - 'link_commands': LINK_COMMANDS_MAC, - 'extra_commands': SHARED_HEADER_MAC_COMMANDS, - }) - elif flavor == 'android': - header_params.update({ - 'link_commands': LINK_COMMANDS_ANDROID, - }) - elif flavor == 'zos': - copy_archive_arguments = '-fPR' - makedep_arguments = '-qmakedep=gcc' - header_params.update({ - 'copy_archive_args': copy_archive_arguments, - 'makedep_args': makedep_arguments, - 'link_commands': LINK_COMMANDS_OS390, - 'CC.target': GetEnvironFallback(('CC_target', 'CC'), 'njsc'), - 'CXX.target': GetEnvironFallback(('CXX_target', 'CXX'), 'njsc++'), - 'CC.host': GetEnvironFallback(('CC_host', 'CC'), 'njsc'), - 'CXX.host': GetEnvironFallback(('CXX_host', 'CXX'), 'njsc++'), - }) - elif flavor == 'solaris': - header_params.update({ - 'flock': './gyp-flock-tool flock', - 'flock_index': 2, - }) - elif flavor == 'freebsd': - # Note: OpenBSD has sysutils/flock. lockf seems to be FreeBSD specific. - header_params.update({ - 'flock': 'lockf', - }) - elif flavor == 'openbsd': - copy_archive_arguments = '-pPRf' - header_params.update({ - 'copy_archive_args': copy_archive_arguments, - }) - elif flavor == 'aix': - copy_archive_arguments = '-pPRf' - header_params.update({ - 'copy_archive_args': copy_archive_arguments, - 'link_commands': LINK_COMMANDS_AIX, - 'flock': './gyp-flock-tool flock', - 'flock_index': 2, - }) - - build_file, _, _ = gyp.common.ParseQualifiedTarget(target_list[0]) - make_global_settings_array = data[build_file].get('make_global_settings', []) - wrappers = {} - for key, value in make_global_settings_array: - if key.endswith('_wrapper'): - wrappers[key[:-len('_wrapper')]] = '$(abspath %s)' % value - make_global_settings = '' - for key, value in make_global_settings_array: - if re.match('.*_wrapper', key): - continue - if value[0] != '$': - value = '$(abspath %s)' % value - wrapper = wrappers.get(key) - if wrapper: - value = '%s %s' % (wrapper, value) - del wrappers[key] - if key in ('CC', 'CC.host', 'CXX', 'CXX.host'): - make_global_settings += ( - 'ifneq (,$(filter $(origin %s), undefined default))\n' % key) - # Let gyp-time envvars win over global settings. - env_key = key.replace('.', '_') # CC.host -> CC_host - if env_key in os.environ: - value = os.environ[env_key] - make_global_settings += ' %s = %s\n' % (key, value) - make_global_settings += 'endif\n' - else: - make_global_settings += '%s ?= %s\n' % (key, value) - # TODO(ukai): define cmd when only wrapper is specified in - # make_global_settings. - - header_params['make_global_settings'] = make_global_settings - - gyp.common.EnsureDirExists(makefile_path) - root_makefile = open(makefile_path, 'w') - root_makefile.write(SHARED_HEADER % header_params) - # Currently any versions have the same effect, but in future the behavior - # could be different. - if android_ndk_version: - root_makefile.write( - '# Define LOCAL_PATH for build of Android applications.\n' - 'LOCAL_PATH := $(call my-dir)\n' - '\n') - for toolset in toolsets: - root_makefile.write('TOOLSET := %s\n' % toolset) - WriteRootHeaderSuffixRules(root_makefile) - - # Put build-time support tools next to the root Makefile. - dest_path = os.path.dirname(makefile_path) - gyp.common.CopyTool(flavor, dest_path) - - # Find the list of targets that derive from the gyp file(s) being built. - needed_targets = set() - for build_file in params['build_files']: - for target in gyp.common.AllTargets(target_list, target_dicts, build_file): - needed_targets.add(target) - - build_files = set() - include_list = set() - for qualified_target in target_list: - build_file, target, toolset = gyp.common.ParseQualifiedTarget( - qualified_target) - - this_make_global_settings = data[build_file].get('make_global_settings', []) - assert make_global_settings_array == this_make_global_settings, ( - "make_global_settings needs to be the same for all targets. %s vs. %s" % - (this_make_global_settings, make_global_settings)) - - build_files.add(gyp.common.RelativePath(build_file, options.toplevel_dir)) - included_files = data[build_file]['included_files'] - for included_file in included_files: - # The included_files entries are relative to the dir of the build file - # that included them, so we have to undo that and then make them relative - # to the root dir. - relative_include_file = gyp.common.RelativePath( - gyp.common.UnrelativePath(included_file, build_file), - options.toplevel_dir) - abs_include_file = os.path.abspath(relative_include_file) - # If the include file is from the ~/.gyp dir, we should use absolute path - # so that relocating the src dir doesn't break the path. - if (params['home_dot_gyp'] and - abs_include_file.startswith(params['home_dot_gyp'])): - build_files.add(abs_include_file) - else: - build_files.add(relative_include_file) - - base_path, output_file = CalculateMakefilePath(build_file, - target + '.' + toolset + options.suffix + '.mk') - - spec = target_dicts[qualified_target] - configs = spec['configurations'] - - if flavor == 'mac': - gyp.xcode_emulation.MergeGlobalXcodeSettingsToSpec(data[build_file], spec) - - writer = MakefileWriter(generator_flags, flavor) - writer.Write(qualified_target, base_path, output_file, spec, configs, - part_of_all=qualified_target in needed_targets) - - # Our root_makefile lives at the source root. Compute the relative path - # from there to the output_file for including. - mkfile_rel_path = gyp.common.RelativePath(output_file, - os.path.dirname(makefile_path)) - include_list.add(mkfile_rel_path) - - # Write out per-gyp (sub-project) Makefiles. - depth_rel_path = gyp.common.RelativePath(options.depth, os.getcwd()) - for build_file in build_files: - # The paths in build_files were relativized above, so undo that before - # testing against the non-relativized items in target_list and before - # calculating the Makefile path. - build_file = os.path.join(depth_rel_path, build_file) - gyp_targets = [target_dicts[target]['target_name'] for target in target_list - if target.startswith(build_file) and - target in needed_targets] - # Only generate Makefiles for gyp files with targets. - if not gyp_targets: - continue - base_path, output_file = CalculateMakefilePath(build_file, - os.path.splitext(os.path.basename(build_file))[0] + '.Makefile') - makefile_rel_path = gyp.common.RelativePath(os.path.dirname(makefile_path), - os.path.dirname(output_file)) - writer.WriteSubMake(output_file, makefile_rel_path, gyp_targets, - builddir_name) - - - # Write out the sorted list of includes. - root_makefile.write('\n') - for include_file in sorted(include_list): - # We wrap each .mk include in an if statement so users can tell make to - # not load a file by setting NO_LOAD. The below make code says, only - # load the .mk file if the .mk filename doesn't start with a token in - # NO_LOAD. - root_makefile.write( - "ifeq ($(strip $(foreach prefix,$(NO_LOAD),\\\n" - " $(findstring $(join ^,$(prefix)),\\\n" - " $(join ^," + include_file + ")))),)\n") - root_makefile.write(" include " + include_file + "\n") - root_makefile.write("endif\n") - root_makefile.write('\n') - - if (not generator_flags.get('standalone') - and generator_flags.get('auto_regeneration', True)): - WriteAutoRegenerationRule(params, root_makefile, makefile_name, build_files) + if flavor == "mac": + flock_command = "./gyp-mac-tool flock" + header_params.update( + { + "flock": flock_command, + "flock_index": 2, + "link_commands": LINK_COMMANDS_MAC, + "extra_commands": SHARED_HEADER_MAC_COMMANDS, + } + ) + elif flavor == "android": + header_params.update({"link_commands": LINK_COMMANDS_ANDROID}) + elif flavor == "zos": + copy_archive_arguments = "-fPR" + makedep_arguments = "-qmakedep=gcc" + header_params.update( + { + "copy_archive_args": copy_archive_arguments, + "makedep_args": makedep_arguments, + "link_commands": LINK_COMMANDS_OS390, + "CC.target": GetEnvironFallback(("CC_target", "CC"), "njsc"), + "CXX.target": GetEnvironFallback(("CXX_target", "CXX"), "njsc++"), + "CC.host": GetEnvironFallback(("CC_host", "CC"), "njsc"), + "CXX.host": GetEnvironFallback(("CXX_host", "CXX"), "njsc++"), + } + ) + elif flavor == "solaris": + copy_archive_arguments = "-pPRf@" + header_params.update( + { + "copy_archive_args": copy_archive_arguments, + "flock": "./gyp-flock-tool flock", + "flock_index": 2 + } + ) + elif flavor == "freebsd": + # Note: OpenBSD has sysutils/flock. lockf seems to be FreeBSD specific. + header_params.update({"flock": "lockf"}) + elif flavor == "openbsd": + copy_archive_arguments = "-pPRf" + header_params.update({"copy_archive_args": copy_archive_arguments}) + elif flavor == "aix": + copy_archive_arguments = "-pPRf" + header_params.update( + { + "copy_archive_args": copy_archive_arguments, + "link_commands": LINK_COMMANDS_AIX, + "flock": "./gyp-flock-tool flock", + "flock_index": 2, + } + ) + + build_file, _, _ = gyp.common.ParseQualifiedTarget(target_list[0]) + make_global_settings_array = data[build_file].get("make_global_settings", []) + wrappers = {} + for key, value in make_global_settings_array: + if key.endswith("_wrapper"): + wrappers[key[: -len("_wrapper")]] = "$(abspath %s)" % value + make_global_settings = "" + for key, value in make_global_settings_array: + if re.match(".*_wrapper", key): + continue + if value[0] != "$": + value = "$(abspath %s)" % value + wrapper = wrappers.get(key) + if wrapper: + value = "%s %s" % (wrapper, value) + del wrappers[key] + if key in ("CC", "CC.host", "CXX", "CXX.host"): + make_global_settings += ( + "ifneq (,$(filter $(origin %s), undefined default))\n" % key + ) + # Let gyp-time envvars win over global settings. + env_key = key.replace(".", "_") # CC.host -> CC_host + if env_key in os.environ: + value = os.environ[env_key] + make_global_settings += " %s = %s\n" % (key, value) + make_global_settings += "endif\n" + else: + make_global_settings += "%s ?= %s\n" % (key, value) + # TODO(ukai): define cmd when only wrapper is specified in + # make_global_settings. - root_makefile.write(SHARED_FOOTER) + header_params["make_global_settings"] = make_global_settings - root_makefile.close() + gyp.common.EnsureDirExists(makefile_path) + root_makefile = open(makefile_path, "w") + root_makefile.write(SHARED_HEADER % header_params) + # Currently any versions have the same effect, but in future the behavior + # could be different. + if android_ndk_version: + root_makefile.write( + "# Define LOCAL_PATH for build of Android applications.\n" + "LOCAL_PATH := $(call my-dir)\n" + "\n" + ) + for toolset in toolsets: + root_makefile.write("TOOLSET := %s\n" % toolset) + WriteRootHeaderSuffixRules(root_makefile) + + # Put build-time support tools next to the root Makefile. + dest_path = os.path.dirname(makefile_path) + gyp.common.CopyTool(flavor, dest_path) + + # Find the list of targets that derive from the gyp file(s) being built. + needed_targets = set() + for build_file in params["build_files"]: + for target in gyp.common.AllTargets(target_list, target_dicts, build_file): + needed_targets.add(target) + + build_files = set() + include_list = set() + for qualified_target in target_list: + build_file, target, toolset = gyp.common.ParseQualifiedTarget(qualified_target) + + this_make_global_settings = data[build_file].get("make_global_settings", []) + assert make_global_settings_array == this_make_global_settings, ( + "make_global_settings needs to be the same for all targets. %s vs. %s" + % (this_make_global_settings, make_global_settings) + ) + + build_files.add(gyp.common.RelativePath(build_file, options.toplevel_dir)) + included_files = data[build_file]["included_files"] + for included_file in included_files: + # The included_files entries are relative to the dir of the build file + # that included them, so we have to undo that and then make them relative + # to the root dir. + relative_include_file = gyp.common.RelativePath( + gyp.common.UnrelativePath(included_file, build_file), + options.toplevel_dir, + ) + abs_include_file = os.path.abspath(relative_include_file) + # If the include file is from the ~/.gyp dir, we should use absolute path + # so that relocating the src dir doesn't break the path. + if params["home_dot_gyp"] and abs_include_file.startswith( + params["home_dot_gyp"] + ): + build_files.add(abs_include_file) + else: + build_files.add(relative_include_file) + + base_path, output_file = CalculateMakefilePath( + build_file, target + "." + toolset + options.suffix + ".mk" + ) + + spec = target_dicts[qualified_target] + configs = spec["configurations"] + + if flavor == "mac": + gyp.xcode_emulation.MergeGlobalXcodeSettingsToSpec(data[build_file], spec) + + writer = MakefileWriter(generator_flags, flavor) + writer.Write( + qualified_target, + base_path, + output_file, + spec, + configs, + part_of_all=qualified_target in needed_targets, + ) + + # Our root_makefile lives at the source root. Compute the relative path + # from there to the output_file for including. + mkfile_rel_path = gyp.common.RelativePath( + output_file, os.path.dirname(makefile_path) + ) + include_list.add(mkfile_rel_path) + + # Write out per-gyp (sub-project) Makefiles. + depth_rel_path = gyp.common.RelativePath(options.depth, os.getcwd()) + for build_file in build_files: + # The paths in build_files were relativized above, so undo that before + # testing against the non-relativized items in target_list and before + # calculating the Makefile path. + build_file = os.path.join(depth_rel_path, build_file) + gyp_targets = [ + target_dicts[qualified_target]["target_name"] + for qualified_target in target_list + if qualified_target.startswith(build_file) + and qualified_target in needed_targets + ] + # Only generate Makefiles for gyp files with targets. + if not gyp_targets: + continue + base_path, output_file = CalculateMakefilePath( + build_file, os.path.splitext(os.path.basename(build_file))[0] + ".Makefile" + ) + makefile_rel_path = gyp.common.RelativePath( + os.path.dirname(makefile_path), os.path.dirname(output_file) + ) + writer.WriteSubMake(output_file, makefile_rel_path, gyp_targets, builddir_name) + + # Write out the sorted list of includes. + root_makefile.write("\n") + for include_file in sorted(include_list): + # We wrap each .mk include in an if statement so users can tell make to + # not load a file by setting NO_LOAD. The below make code says, only + # load the .mk file if the .mk filename doesn't start with a token in + # NO_LOAD. + root_makefile.write( + "ifeq ($(strip $(foreach prefix,$(NO_LOAD),\\\n" + " $(findstring $(join ^,$(prefix)),\\\n" + " $(join ^," + include_file + ")))),)\n" + ) + root_makefile.write(" include " + include_file + "\n") + root_makefile.write("endif\n") + root_makefile.write("\n") + + if not generator_flags.get("standalone") and generator_flags.get( + "auto_regeneration", True + ): + WriteAutoRegenerationRule(params, root_makefile, makefile_name, build_files) + + root_makefile.write(SHARED_FOOTER) + + root_makefile.close() diff --git a/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/msvs.py b/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/msvs.py index 8dbe0dc05b86b6..5bfceb05cb3761 100644 --- a/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/msvs.py +++ b/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/msvs.py @@ -4,7 +4,6 @@ from __future__ import print_function -import copy import ntpath import os import posixpath @@ -38,61 +37,65 @@ # if IncrediBuild is executed from inside Visual Studio. This regex # validates that the string looks like a GUID with all uppercase hex # letters. -VALID_MSVS_GUID_CHARS = re.compile(r'^[A-F0-9\-]+$') +VALID_MSVS_GUID_CHARS = re.compile(r"^[A-F0-9\-]+$") +generator_supports_multiple_toolsets = gyp.common.CrossCompileRequested() generator_default_variables = { - 'EXECUTABLE_PREFIX': '', - 'EXECUTABLE_SUFFIX': '.exe', - 'STATIC_LIB_PREFIX': '', - 'SHARED_LIB_PREFIX': '', - 'STATIC_LIB_SUFFIX': '.lib', - 'SHARED_LIB_SUFFIX': '.dll', - 'INTERMEDIATE_DIR': '$(IntDir)', - 'SHARED_INTERMEDIATE_DIR': '$(OutDir)obj/global_intermediate', - 'OS': 'win', - 'PRODUCT_DIR': '$(OutDir)', - 'LIB_DIR': '$(OutDir)lib', - 'RULE_INPUT_ROOT': '$(InputName)', - 'RULE_INPUT_DIRNAME': '$(InputDir)', - 'RULE_INPUT_EXT': '$(InputExt)', - 'RULE_INPUT_NAME': '$(InputFileName)', - 'RULE_INPUT_PATH': '$(InputPath)', - 'CONFIGURATION_NAME': '$(ConfigurationName)', + "DRIVER_PREFIX": "", + "DRIVER_SUFFIX": ".sys", + "EXECUTABLE_PREFIX": "", + "EXECUTABLE_SUFFIX": ".exe", + "STATIC_LIB_PREFIX": "", + "SHARED_LIB_PREFIX": "", + "STATIC_LIB_SUFFIX": ".lib", + "SHARED_LIB_SUFFIX": ".dll", + "INTERMEDIATE_DIR": "$(IntDir)", + "SHARED_INTERMEDIATE_DIR": "$(OutDir)/obj/global_intermediate", + "OS": "win", + "PRODUCT_DIR": "$(OutDir)", + "LIB_DIR": "$(OutDir)lib", + "RULE_INPUT_ROOT": "$(InputName)", + "RULE_INPUT_DIRNAME": "$(InputDir)", + "RULE_INPUT_EXT": "$(InputExt)", + "RULE_INPUT_NAME": "$(InputFileName)", + "RULE_INPUT_PATH": "$(InputPath)", + "CONFIGURATION_NAME": "$(ConfigurationName)", } # The msvs specific sections that hold paths generator_additional_path_sections = [ - 'msvs_cygwin_dirs', - 'msvs_props', + "msvs_cygwin_dirs", + "msvs_props", ] generator_additional_non_configuration_keys = [ - 'msvs_cygwin_dirs', - 'msvs_cygwin_shell', - 'msvs_large_pdb', - 'msvs_shard', - 'msvs_external_builder', - 'msvs_external_builder_out_dir', - 'msvs_external_builder_build_cmd', - 'msvs_external_builder_clean_cmd', - 'msvs_external_builder_clcompile_cmd', - 'msvs_enable_winrt', - 'msvs_requires_importlibrary', - 'msvs_enable_winphone', - 'msvs_enable_marmasm', - 'msvs_application_type_revision', - 'msvs_target_platform_version', - 'msvs_target_platform_minversion', + "msvs_cygwin_dirs", + "msvs_cygwin_shell", + "msvs_large_pdb", + "msvs_shard", + "msvs_external_builder", + "msvs_external_builder_out_dir", + "msvs_external_builder_build_cmd", + "msvs_external_builder_clean_cmd", + "msvs_external_builder_clcompile_cmd", + "msvs_enable_winrt", + "msvs_requires_importlibrary", + "msvs_enable_winphone", + "msvs_enable_marmasm", + "msvs_application_type_revision", + "msvs_target_platform_version", + "msvs_target_platform_minversion", ] +generator_filelist_paths = None # List of precompiled header related keys. precomp_keys = [ - 'msvs_precompiled_header', - 'msvs_precompiled_source', + "msvs_precompiled_header", + "msvs_precompiled_source", ] @@ -107,36 +110,38 @@ # python version in depot_tools has been updated to work on Vista # 64-bit. def _GetDomainAndUserName(): - if sys.platform not in ('win32', 'cygwin'): - return ('DOMAIN', 'USERNAME') - global cached_username - global cached_domain - if not cached_domain or not cached_username: - domain = os.environ.get('USERDOMAIN') - username = os.environ.get('USERNAME') - if not domain or not username: - call = subprocess.Popen(['net', 'config', 'Workstation'], - stdout=subprocess.PIPE) - config = call.communicate()[0] - if PY3: - config = config.decode('utf-8') - username_re = re.compile(r'^User name\s+(\S+)', re.MULTILINE) - username_match = username_re.search(config) - if username_match: - username = username_match.group(1) - domain_re = re.compile(r'^Logon domain\s+(\S+)', re.MULTILINE) - domain_match = domain_re.search(config) - if domain_match: - domain = domain_match.group(1) - cached_domain = domain - cached_username = username - return (cached_domain, cached_username) + if sys.platform not in ("win32", "cygwin"): + return ("DOMAIN", "USERNAME") + global cached_username + global cached_domain + if not cached_domain or not cached_username: + domain = os.environ.get("USERDOMAIN") + username = os.environ.get("USERNAME") + if not domain or not username: + call = subprocess.Popen( + ["net", "config", "Workstation"], stdout=subprocess.PIPE + ) + config = call.communicate()[0] + if PY3: + config = config.decode("utf-8") + username_re = re.compile(r"^User name\s+(\S+)", re.MULTILINE) + username_match = username_re.search(config) + if username_match: + username = username_match.group(1) + domain_re = re.compile(r"^Logon domain\s+(\S+)", re.MULTILINE) + domain_match = domain_re.search(config) + if domain_match: + domain = domain_match.group(1) + cached_domain = domain + cached_username = username + return (cached_domain, cached_username) + fixpath_prefix = None def _NormalizedSource(source): - """Normalize the path. + """Normalize the path. But not if that gets rid of a variable, as this may expand to something larger than one directory. @@ -147,47 +152,53 @@ def _NormalizedSource(source): Returns: The normalized path. """ - normalized = os.path.normpath(source) - if source.count('$') == normalized.count('$'): - source = normalized - return source + normalized = os.path.normpath(source) + if source.count("$") == normalized.count("$"): + source = normalized + return source def _FixPath(path): - """Convert paths to a form that will make sense in a vcproj file. + """Convert paths to a form that will make sense in a vcproj file. Arguments: path: The path to convert, may contain / etc. Returns: The path with all slashes made into backslashes. """ - if fixpath_prefix and path and not os.path.isabs(path) and not path[0] == '$' and not _IsWindowsAbsPath(path): - path = os.path.join(fixpath_prefix, path) - path = path.replace('/', '\\') - path = _NormalizedSource(path) - if path and path[-1] == '\\': - path = path[:-1] - return path + if ( + fixpath_prefix + and path + and not os.path.isabs(path) + and not path[0] == "$" + and not _IsWindowsAbsPath(path) + ): + path = os.path.join(fixpath_prefix, path) + path = path.replace("/", "\\") + path = _NormalizedSource(path) + if path and path[-1] == "\\": + path = path[:-1] + return path def _IsWindowsAbsPath(path): - r""" + """ On Cygwin systems Python needs a little help determining if a path is an absolute Windows path or not, so that it does not treat those as relative, which results in bad paths like: - - '..\C:\\some_source_code_file.cc' + '..\\C:\\\\some_source_code_file.cc' """ - return path.startswith('c:') or path.startswith('C:') + return path.startswith("c:") or path.startswith("C:") def _FixPaths(paths): - """Fix each of the paths of the list.""" - return [_FixPath(i) for i in paths] + """Fix each of the paths of the list.""" + return [_FixPath(i) for i in paths] -def _ConvertSourcesToFilterHierarchy(sources, prefix=None, excluded=None, - list_excluded=True, msvs_version=None): - """Converts a list split source file paths into a vcproj folder hierarchy. +def _ConvertSourcesToFilterHierarchy( + sources, prefix=None, excluded=None, list_excluded=True, msvs_version=None +): + """Converts a list split source file paths into a vcproj folder hierarchy. Arguments: sources: A list of source file paths split. @@ -205,203 +216,248 @@ def _ConvertSourcesToFilterHierarchy(sources, prefix=None, excluded=None, [MSVSProject.Filter('a', contents=['joe\\a\\bob1.c']), MSVSProject.Filter('b', contents=['joe\\b\\bob2.c'])] """ - if not prefix: prefix = [] - result = [] - excluded_result = [] - folders = OrderedDict() - # Gather files into the final result, excluded, or folders. - for s in sources: - if len(s) == 1: - filename = _NormalizedSource('\\'.join(prefix + s)) - if filename in excluded: - excluded_result.append(filename) - else: - result.append(filename) - elif msvs_version and not msvs_version.UsesVcxproj(): - # For MSVS 2008 and earlier, we need to process all files before walking - # the sub folders. - if not folders.get(s[0]): - folders[s[0]] = [] - folders[s[0]].append(s[1:]) - else: - contents = _ConvertSourcesToFilterHierarchy([s[1:]], prefix + [s[0]], - excluded=excluded, - list_excluded=list_excluded, - msvs_version=msvs_version) - contents = MSVSProject.Filter(s[0], contents=contents) - result.append(contents) - # Add a folder for excluded files. - if excluded_result and list_excluded: - excluded_folder = MSVSProject.Filter('_excluded_files', - contents=excluded_result) - result.append(excluded_folder) - - if msvs_version and msvs_version.UsesVcxproj(): + if not prefix: + prefix = [] + result = [] + excluded_result = [] + folders = OrderedDict() + # Gather files into the final result, excluded, or folders. + for s in sources: + if len(s) == 1: + filename = _NormalizedSource("\\".join(prefix + s)) + if filename in excluded: + excluded_result.append(filename) + else: + result.append(filename) + elif msvs_version and not msvs_version.UsesVcxproj(): + # For MSVS 2008 and earlier, we need to process all files before walking + # the sub folders. + if not folders.get(s[0]): + folders[s[0]] = [] + folders[s[0]].append(s[1:]) + else: + contents = _ConvertSourcesToFilterHierarchy( + [s[1:]], + prefix + [s[0]], + excluded=excluded, + list_excluded=list_excluded, + msvs_version=msvs_version, + ) + contents = MSVSProject.Filter(s[0], contents=contents) + result.append(contents) + # Add a folder for excluded files. + if excluded_result and list_excluded: + excluded_folder = MSVSProject.Filter( + "_excluded_files", contents=excluded_result + ) + result.append(excluded_folder) + + if msvs_version and msvs_version.UsesVcxproj(): + return result + + # Populate all the folders. + for f in folders: + contents = _ConvertSourcesToFilterHierarchy( + folders[f], + prefix=prefix + [f], + excluded=excluded, + list_excluded=list_excluded, + msvs_version=msvs_version, + ) + contents = MSVSProject.Filter(f, contents=contents) + result.append(contents) return result - # Populate all the folders. - for f in folders: - contents = _ConvertSourcesToFilterHierarchy(folders[f], prefix=prefix + [f], - excluded=excluded, - list_excluded=list_excluded, - msvs_version=msvs_version) - contents = MSVSProject.Filter(f, contents=contents) - result.append(contents) - return result - def _ToolAppend(tools, tool_name, setting, value, only_if_unset=False): - if not value: return - _ToolSetOrAppend(tools, tool_name, setting, value, only_if_unset) + if not value: + return + _ToolSetOrAppend(tools, tool_name, setting, value, only_if_unset) def _ToolSetOrAppend(tools, tool_name, setting, value, only_if_unset=False): - # TODO(bradnelson): ugly hack, fix this more generally!!! - if 'Directories' in setting or 'Dependencies' in setting: - if type(value) == str: - value = value.replace('/', '\\') - else: - value = [i.replace('/', '\\') for i in value] - if not tools.get(tool_name): - tools[tool_name] = dict() - tool = tools[tool_name] - if tool.get(setting): - if only_if_unset: return - if type(tool[setting]) == list and type(value) == list: - tool[setting] += value + # TODO(bradnelson): ugly hack, fix this more generally!!! + if "Directories" in setting or "Dependencies" in setting: + if type(value) == str: + value = value.replace("/", "\\") + else: + value = [i.replace("/", "\\") for i in value] + if not tools.get(tool_name): + tools[tool_name] = dict() + tool = tools[tool_name] + if "CompileAsWinRT" == setting: + return + if tool.get(setting): + if only_if_unset: + return + if type(tool[setting]) == list and type(value) == list: + tool[setting] += value + else: + raise TypeError( + 'Appending "%s" to a non-list setting "%s" for tool "%s" is ' + "not allowed, previous value: %s" + % (value, setting, tool_name, str(tool[setting])) + ) else: - raise TypeError( - 'Appending "%s" to a non-list setting "%s" for tool "%s" is ' - 'not allowed, previous value: %s' % ( - value, setting, tool_name, str(tool[setting]))) - else: - tool[setting] = value + tool[setting] = value + + +def _ConfigTargetVersion(config_data): + return config_data.get("msvs_target_version", "Windows7") def _ConfigPlatform(config_data): - return config_data.get('msvs_configuration_platform', 'Win32') + return config_data.get("msvs_configuration_platform", "Win32") def _ConfigBaseName(config_name, platform_name): - if config_name.endswith('_' + platform_name): - return config_name[0:-len(platform_name) - 1] - else: - return config_name + if config_name.endswith("_" + platform_name): + return config_name[0 : -len(platform_name) - 1] + else: + return config_name def _ConfigFullName(config_name, config_data): - platform_name = _ConfigPlatform(config_data) - return '%s|%s' % (_ConfigBaseName(config_name, platform_name), platform_name) - - -def _ConfigWindowsTargetPlatformVersion(config_data): - ver = config_data.get('msvs_windows_target_platform_version') - if not ver or re.match(r'^\d+', ver): - return ver - for key in [r'HKLM\Software\Microsoft\Microsoft SDKs\Windows\%s', - r'HKLM\Software\Wow6432Node\Microsoft\Microsoft SDKs\Windows\%s']: - sdkdir = MSVSVersion._RegistryGetValue(key % ver, 'InstallationFolder') - if not sdkdir: - continue - version = MSVSVersion._RegistryGetValue(key % ver, 'ProductVersion') or '' - # find a matching entry in sdkdir\include - names = sorted([x for x in os.listdir(r'%s\include' % sdkdir) \ - if x.startswith(version)], reverse = True) - return names[0] - - -def _BuildCommandLineForRuleRaw(spec, cmd, cygwin_shell, has_input_path, - quote_cmd, do_setup_env): - - if [x for x in cmd if '$(InputDir)' in x]: - input_dir_preamble = ( - 'set INPUTDIR=$(InputDir)\n' - 'if NOT DEFINED INPUTDIR set INPUTDIR=.\\\n' - 'set INPUTDIR=%INPUTDIR:~0,-1%\n' - ) - else: - input_dir_preamble = '' - - if cygwin_shell: - # Find path to cygwin. - cygwin_dir = _FixPath(spec.get('msvs_cygwin_dirs', ['.'])[0]) - # Prepare command. - direct_cmd = cmd - direct_cmd = [i.replace('$(IntDir)', - '`cygpath -m "${INTDIR}"`') for i in direct_cmd] - direct_cmd = [i.replace('$(OutDir)', - '`cygpath -m "${OUTDIR}"`') for i in direct_cmd] - direct_cmd = [i.replace('$(InputDir)', - '`cygpath -m "${INPUTDIR}"`') for i in direct_cmd] - if has_input_path: - direct_cmd = [i.replace('$(InputPath)', - '`cygpath -m "${INPUTPATH}"`') - for i in direct_cmd] - direct_cmd = ['\\"%s\\"' % i.replace('"', '\\\\\\"') for i in direct_cmd] - # direct_cmd = gyp.common.EncodePOSIXShellList(direct_cmd) - direct_cmd = ' '.join(direct_cmd) - # TODO(quote): regularize quoting path names throughout the module - cmd = '' - if do_setup_env: - cmd += 'call "$(ProjectDir)%(cygwin_dir)s\\setup_env.bat" && ' - cmd += 'set CYGWIN=nontsec&& ' - if direct_cmd.find('NUMBER_OF_PROCESSORS') >= 0: - cmd += 'set /a NUMBER_OF_PROCESSORS_PLUS_1=%%NUMBER_OF_PROCESSORS%%+1&& ' - if direct_cmd.find('INTDIR') >= 0: - cmd += 'set INTDIR=$(IntDir)&& ' - if direct_cmd.find('OUTDIR') >= 0: - cmd += 'set OUTDIR=$(OutDir)&& ' - if has_input_path and direct_cmd.find('INPUTPATH') >= 0: - cmd += 'set INPUTPATH=$(InputPath) && ' - cmd += 'bash -c "%(cmd)s"' - cmd = cmd % {'cygwin_dir': cygwin_dir, - 'cmd': direct_cmd} - return input_dir_preamble + cmd - else: - # Convert cat --> type to mimic unix. - if cmd[0] == 'cat': - command = ['type'] + platform_name = _ConfigPlatform(config_data) + return "%s|%s" % (_ConfigBaseName(config_name, platform_name), platform_name) + + +def _ConfigWindowsTargetPlatformVersion(config_data, version): + target_ver = config_data.get("msvs_windows_target_platform_version") + if target_ver and re.match(r"^\d+", target_ver): + return target_ver + config_ver = config_data.get("msvs_windows_sdk_version") + vers = [config_ver] if config_ver else version.compatible_sdks + for ver in vers: + for key in [ + r"HKLM\Software\Microsoft\Microsoft SDKs\Windows\%s", + r"HKLM\Software\Wow6432Node\Microsoft\Microsoft SDKs\Windows\%s", + ]: + sdk_dir = MSVSVersion._RegistryGetValue(key % ver, "InstallationFolder") + if not sdk_dir: + continue + version = MSVSVersion._RegistryGetValue(key % ver, "ProductVersion") or "" + # Find a matching entry in sdk_dir\include. + expected_sdk_dir = r"%s\include" % sdk_dir + names = sorted( + [ + x + for x in ( + os.listdir(expected_sdk_dir) + if os.path.isdir(expected_sdk_dir) + else [] + ) + if x.startswith(version) + ], + reverse=True, + ) + if names: + return names[0] + else: + print( + "Warning: No include files found for detected " + "Windows SDK version %s" % (version), + file=sys.stdout, + ) + + +def _BuildCommandLineForRuleRaw( + spec, cmd, cygwin_shell, has_input_path, quote_cmd, do_setup_env +): + + if [x for x in cmd if "$(InputDir)" in x]: + input_dir_preamble = ( + "set INPUTDIR=$(InputDir)\n" + "if NOT DEFINED INPUTDIR set INPUTDIR=.\\\n" + "set INPUTDIR=%INPUTDIR:~0,-1%\n" + ) else: - command = [cmd[0].replace('/', '\\')] - # Add call before command to ensure that commands can be tied together one - # after the other without aborting in Incredibuild, since IB makes a bat - # file out of the raw command string, and some commands (like python) are - # actually batch files themselves. - command.insert(0, 'call') - # Fix the paths - # TODO(quote): This is a really ugly heuristic, and will miss path fixing - # for arguments like "--arg=path" or "/opt:path". - # If the argument starts with a slash or dash, it's probably a command line - # switch - arguments = [i if (i[:1] in "/-") else _FixPath(i) for i in cmd[1:]] - arguments = [i.replace('$(InputDir)', '%INPUTDIR%') for i in arguments] - arguments = [MSVSSettings.FixVCMacroSlashes(i) for i in arguments] - if quote_cmd: - # Support a mode for using cmd directly. - # Convert any paths to native form (first element is used directly). - # TODO(quote): regularize quoting path names throughout the module - arguments = ['"%s"' % i for i in arguments] - # Collapse into a single command. - return input_dir_preamble + ' '.join(command + arguments) + input_dir_preamble = "" + + if cygwin_shell: + # Find path to cygwin. + cygwin_dir = _FixPath(spec.get("msvs_cygwin_dirs", ["."])[0]) + # Prepare command. + direct_cmd = cmd + direct_cmd = [ + i.replace("$(IntDir)", '`cygpath -m "${INTDIR}"`') for i in direct_cmd + ] + direct_cmd = [ + i.replace("$(OutDir)", '`cygpath -m "${OUTDIR}"`') for i in direct_cmd + ] + direct_cmd = [ + i.replace("$(InputDir)", '`cygpath -m "${INPUTDIR}"`') for i in direct_cmd + ] + if has_input_path: + direct_cmd = [ + i.replace("$(InputPath)", '`cygpath -m "${INPUTPATH}"`') + for i in direct_cmd + ] + direct_cmd = ['\\"%s\\"' % i.replace('"', '\\\\\\"') for i in direct_cmd] + # direct_cmd = gyp.common.EncodePOSIXShellList(direct_cmd) + direct_cmd = " ".join(direct_cmd) + # TODO(quote): regularize quoting path names throughout the module + cmd = "" + if do_setup_env: + cmd += 'call "$(ProjectDir)%(cygwin_dir)s\\setup_env.bat" && ' + cmd += "set CYGWIN=nontsec&& " + if direct_cmd.find("NUMBER_OF_PROCESSORS") >= 0: + cmd += "set /a NUMBER_OF_PROCESSORS_PLUS_1=%%NUMBER_OF_PROCESSORS%%+1&& " + if direct_cmd.find("INTDIR") >= 0: + cmd += "set INTDIR=$(IntDir)&& " + if direct_cmd.find("OUTDIR") >= 0: + cmd += "set OUTDIR=$(OutDir)&& " + if has_input_path and direct_cmd.find("INPUTPATH") >= 0: + cmd += "set INPUTPATH=$(InputPath) && " + cmd += 'bash -c "%(cmd)s"' + cmd = cmd % {"cygwin_dir": cygwin_dir, "cmd": direct_cmd} + return input_dir_preamble + cmd + else: + # Convert cat --> type to mimic unix. + if cmd[0] == "cat": + command = ["type"] + else: + command = [cmd[0].replace("/", "\\")] + # Add call before command to ensure that commands can be tied together one + # after the other without aborting in Incredibuild, since IB makes a bat + # file out of the raw command string, and some commands (like python) are + # actually batch files themselves. + command.insert(0, "call") + # Fix the paths + # TODO(quote): This is a really ugly heuristic, and will miss path fixing + # for arguments like "--arg=path" or "/opt:path". + # If the argument starts with a slash or dash, it's probably a command line + # switch + arguments = [i if (i[:1] in "/-") else _FixPath(i) for i in cmd[1:]] + arguments = [i.replace("$(InputDir)", "%INPUTDIR%") for i in arguments] + arguments = [MSVSSettings.FixVCMacroSlashes(i) for i in arguments] + if quote_cmd: + # Support a mode for using cmd directly. + # Convert any paths to native form (first element is used directly). + # TODO(quote): regularize quoting path names throughout the module + arguments = ['"%s"' % i for i in arguments] + # Collapse into a single command. + return input_dir_preamble + " ".join(command + arguments) def _BuildCommandLineForRule(spec, rule, has_input_path, do_setup_env): - # Currently this weird argument munging is used to duplicate the way a - # python script would need to be run as part of the chrome tree. - # Eventually we should add some sort of rule_default option to set this - # per project. For now the behavior chrome needs is the default. - mcs = rule.get('msvs_cygwin_shell') - if mcs is None: - mcs = int(spec.get('msvs_cygwin_shell', 1)) - elif isinstance(mcs, str): - mcs = int(mcs) - quote_cmd = int(rule.get('msvs_quote_cmd', 1)) - return _BuildCommandLineForRuleRaw(spec, rule['action'], mcs, has_input_path, - quote_cmd, do_setup_env=do_setup_env) + # Currently this weird argument munging is used to duplicate the way a + # python script would need to be run as part of the chrome tree. + # Eventually we should add some sort of rule_default option to set this + # per project. For now the behavior chrome needs is the default. + mcs = rule.get("msvs_cygwin_shell") + if mcs is None: + mcs = int(spec.get("msvs_cygwin_shell", 1)) + elif isinstance(mcs, str): + mcs = int(mcs) + quote_cmd = int(rule.get("msvs_quote_cmd", 1)) + return _BuildCommandLineForRuleRaw( + spec, rule["action"], mcs, has_input_path, quote_cmd, do_setup_env=do_setup_env + ) def _AddActionStep(actions_dict, inputs, outputs, description, command): - """Merge action into an existing list of actions. + """Merge action into an existing list of actions. Care must be taken so that actions which have overlapping inputs either don't get assigned to the same input, or get collapsed into one. @@ -414,30 +470,31 @@ def _AddActionStep(actions_dict, inputs, outputs, description, command): description: description of the action command: command line to execute """ - # Require there to be at least one input (call sites will ensure this). - assert inputs + # Require there to be at least one input (call sites will ensure this). + assert inputs - action = { - 'inputs': inputs, - 'outputs': outputs, - 'description': description, - 'command': command, - } + action = { + "inputs": inputs, + "outputs": outputs, + "description": description, + "command": command, + } - # Pick where to stick this action. - # While less than optimal in terms of build time, attach them to the first - # input for now. - chosen_input = inputs[0] + # Pick where to stick this action. + # While less than optimal in terms of build time, attach them to the first + # input for now. + chosen_input = inputs[0] - # Add it there. - if chosen_input not in actions_dict: - actions_dict[chosen_input] = [] - actions_dict[chosen_input].append(action) + # Add it there. + if chosen_input not in actions_dict: + actions_dict[chosen_input] = [] + actions_dict[chosen_input].append(action) -def _AddCustomBuildToolForMSVS(p, spec, primary_input, - inputs, outputs, description, cmd): - """Add a custom build tool to execute something. +def _AddCustomBuildToolForMSVS( + p, spec, primary_input, inputs, outputs, description, cmd +): + """Add a custom build tool to execute something. Arguments: p: the target project @@ -448,23 +505,26 @@ def _AddCustomBuildToolForMSVS(p, spec, primary_input, description: description of the action cmd: command line to execute """ - inputs = _FixPaths(inputs) - outputs = _FixPaths(outputs) - tool = MSVSProject.Tool( - 'VCCustomBuildTool', - {'Description': description, - 'AdditionalDependencies': ';'.join(inputs), - 'Outputs': ';'.join(outputs), - 'CommandLine': cmd, - }) - # Add to the properties of primary input for each config. - for config_name, c_data in spec['configurations'].items(): - p.AddFileConfig(_FixPath(primary_input), - _ConfigFullName(config_name, c_data), tools=[tool]) + inputs = _FixPaths(inputs) + outputs = _FixPaths(outputs) + tool = MSVSProject.Tool( + "VCCustomBuildTool", + { + "Description": description, + "AdditionalDependencies": ";".join(inputs), + "Outputs": ";".join(outputs), + "CommandLine": cmd, + }, + ) + # Add to the properties of primary input for each config. + for config_name, c_data in spec["configurations"].items(): + p.AddFileConfig( + _FixPath(primary_input), _ConfigFullName(config_name, c_data), tools=[tool] + ) def _AddAccumulatedActionsToMSVS(p, spec, actions_dict): - """Add actions accumulated into an actions_dict, merging as needed. + """Add actions accumulated into an actions_dict, merging as needed. Arguments: p: the target project @@ -472,29 +532,32 @@ def _AddAccumulatedActionsToMSVS(p, spec, actions_dict): actions_dict: dictionary keyed on input name, which maps to a list of dicts describing the actions attached to that input file. """ - for primary_input in actions_dict: - inputs = OrderedSet() - outputs = OrderedSet() - descriptions = [] - commands = [] - for action in actions_dict[primary_input]: - inputs.update(OrderedSet(action['inputs'])) - outputs.update(OrderedSet(action['outputs'])) - descriptions.append(action['description']) - commands.append(action['command']) - # Add the custom build step for one input file. - description = ', and also '.join(descriptions) - command = '\r\n'.join(commands) - _AddCustomBuildToolForMSVS(p, spec, - primary_input=primary_input, - inputs=inputs, - outputs=outputs, - description=description, - cmd=command) + for primary_input in actions_dict: + inputs = OrderedSet() + outputs = OrderedSet() + descriptions = [] + commands = [] + for action in actions_dict[primary_input]: + inputs.update(OrderedSet(action["inputs"])) + outputs.update(OrderedSet(action["outputs"])) + descriptions.append(action["description"]) + commands.append(action["command"]) + # Add the custom build step for one input file. + description = ", and also ".join(descriptions) + command = "\r\n".join(commands) + _AddCustomBuildToolForMSVS( + p, + spec, + primary_input=primary_input, + inputs=inputs, + outputs=outputs, + description=description, + cmd=command, + ) def _RuleExpandPath(path, input_file): - """Given the input file to which a rule applied, string substitute a path. + """Given the input file to which a rule applied, string substitute a path. Arguments: path: a path to string expand @@ -502,18 +565,20 @@ def _RuleExpandPath(path, input_file): Returns: The string substituted path. """ - path = path.replace('$(InputName)', - os.path.splitext(os.path.split(input_file)[1])[0]) - path = path.replace('$(InputDir)', os.path.dirname(input_file)) - path = path.replace('$(InputExt)', - os.path.splitext(os.path.split(input_file)[1])[1]) - path = path.replace('$(InputFileName)', os.path.split(input_file)[1]) - path = path.replace('$(InputPath)', input_file) - return path + path = path.replace( + "$(InputName)", os.path.splitext(os.path.split(input_file)[1])[0] + ) + path = path.replace("$(InputDir)", os.path.dirname(input_file)) + path = path.replace( + "$(InputExt)", os.path.splitext(os.path.split(input_file)[1])[1] + ) + path = path.replace("$(InputFileName)", os.path.split(input_file)[1]) + path = path.replace("$(InputPath)", input_file) + return path def _FindRuleTriggerFiles(rule, sources): - """Find the list of files which a particular rule applies to. + """Find the list of files which a particular rule applies to. Arguments: rule: the rule in question @@ -521,11 +586,11 @@ def _FindRuleTriggerFiles(rule, sources): Returns: The list of sources that trigger a particular rule. """ - return rule.get('rule_sources', []) + return rule.get("rule_sources", []) def _RuleInputsAndOutputs(rule, trigger_file): - """Find the inputs and outputs generated by a rule. + """Find the inputs and outputs generated by a rule. Arguments: rule: the rule in question. @@ -533,20 +598,20 @@ def _RuleInputsAndOutputs(rule, trigger_file): Returns: The pair of (inputs, outputs) involved in this rule. """ - raw_inputs = _FixPaths(rule.get('inputs', [])) - raw_outputs = _FixPaths(rule.get('outputs', [])) - inputs = OrderedSet() - outputs = OrderedSet() - inputs.add(trigger_file) - for i in raw_inputs: - inputs.add(_RuleExpandPath(i, trigger_file)) - for o in raw_outputs: - outputs.add(_RuleExpandPath(o, trigger_file)) - return (inputs, outputs) + raw_inputs = _FixPaths(rule.get("inputs", [])) + raw_outputs = _FixPaths(rule.get("outputs", [])) + inputs = OrderedSet() + outputs = OrderedSet() + inputs.add(trigger_file) + for i in raw_inputs: + inputs.add(_RuleExpandPath(i, trigger_file)) + for o in raw_outputs: + outputs.add(_RuleExpandPath(o, trigger_file)) + return (inputs, outputs) def _GenerateNativeRulesForMSVS(p, rules, output_dir, spec, options): - """Generate a native rules file. + """Generate a native rules file. Arguments: p: the target project @@ -555,43 +620,43 @@ def _GenerateNativeRulesForMSVS(p, rules, output_dir, spec, options): spec: the project dict options: global generator options """ - rules_filename = '%s%s.rules' % (spec['target_name'], - options.suffix) - rules_file = MSVSToolFile.Writer(os.path.join(output_dir, rules_filename), - spec['target_name']) - # Add each rule. - for r in rules: - rule_name = r['rule_name'] - rule_ext = r['extension'] - inputs = _FixPaths(r.get('inputs', [])) - outputs = _FixPaths(r.get('outputs', [])) - # Skip a rule with no action and no inputs. - if 'action' not in r and not r.get('rule_sources', []): - continue - cmd = _BuildCommandLineForRule(spec, r, has_input_path=True, - do_setup_env=True) - rules_file.AddCustomBuildRule(name=rule_name, - description=r.get('message', rule_name), - extensions=[rule_ext], - additional_dependencies=inputs, - outputs=outputs, - cmd=cmd) - # Write out rules file. - rules_file.WriteIfChanged() - - # Add rules file to project. - p.AddToolFile(rules_filename) + rules_filename = "%s%s.rules" % (spec["target_name"], options.suffix) + rules_file = MSVSToolFile.Writer( + os.path.join(output_dir, rules_filename), spec["target_name"] + ) + # Add each rule. + for r in rules: + rule_name = r["rule_name"] + rule_ext = r["extension"] + inputs = _FixPaths(r.get("inputs", [])) + outputs = _FixPaths(r.get("outputs", [])) + # Skip a rule with no action and no inputs. + if "action" not in r and not r.get("rule_sources", []): + continue + cmd = _BuildCommandLineForRule(spec, r, has_input_path=True, do_setup_env=True) + rules_file.AddCustomBuildRule( + name=rule_name, + description=r.get("message", rule_name), + extensions=[rule_ext], + additional_dependencies=inputs, + outputs=outputs, + cmd=cmd, + ) + # Write out rules file. + rules_file.WriteIfChanged() + + # Add rules file to project. + p.AddToolFile(rules_filename) def _Cygwinify(path): - path = path.replace('$(OutDir)', '$(OutDirCygwin)') - path = path.replace('$(IntDir)', '$(IntDirCygwin)') - return path + path = path.replace("$(OutDir)", "$(OutDirCygwin)") + path = path.replace("$(IntDir)", "$(IntDirCygwin)") + return path -def _GenerateExternalRules(rules, output_dir, spec, - sources, options, actions_to_add): - """Generate an external makefile to do a set of rules. +def _GenerateExternalRules(rules, output_dir, spec, sources, options, actions_to_add): + """Generate an external makefile to do a set of rules. Arguments: rules: the list of rules to include @@ -601,77 +666,82 @@ def _GenerateExternalRules(rules, output_dir, spec, options: global generator options actions_to_add: The list of actions we will add to. """ - filename = '%s_rules%s.mk' % (spec['target_name'], options.suffix) - mk_file = gyp.common.WriteOnDiff(os.path.join(output_dir, filename)) - # Find cygwin style versions of some paths. - mk_file.write('OutDirCygwin:=$(shell cygpath -u "$(OutDir)")\n') - mk_file.write('IntDirCygwin:=$(shell cygpath -u "$(IntDir)")\n') - # Gather stuff needed to emit all: target. - all_inputs = OrderedSet() - all_outputs = OrderedSet() - all_output_dirs = OrderedSet() - first_outputs = [] - for rule in rules: - trigger_files = _FindRuleTriggerFiles(rule, sources) - for tf in trigger_files: - inputs, outputs = _RuleInputsAndOutputs(rule, tf) - all_inputs.update(OrderedSet(inputs)) - all_outputs.update(OrderedSet(outputs)) - # Only use one target from each rule as the dependency for - # 'all' so we don't try to build each rule multiple times. - first_outputs.append(list(outputs)[0]) - # Get the unique output directories for this rule. - output_dirs = [os.path.split(i)[0] for i in outputs] - for od in output_dirs: - all_output_dirs.add(od) - first_outputs_cyg = [_Cygwinify(i) for i in first_outputs] - # Write out all: target, including mkdir for each output directory. - mk_file.write('all: %s\n' % ' '.join(first_outputs_cyg)) - for od in all_output_dirs: - if od: - mk_file.write('\tmkdir -p `cygpath -u "%s"`\n' % od) - mk_file.write('\n') - # Define how each output is generated. - for rule in rules: - trigger_files = _FindRuleTriggerFiles(rule, sources) - for tf in trigger_files: - # Get all the inputs and outputs for this rule for this trigger file. - inputs, outputs = _RuleInputsAndOutputs(rule, tf) - inputs = [_Cygwinify(i) for i in inputs] - outputs = [_Cygwinify(i) for i in outputs] - # Prepare the command line for this rule. - cmd = [_RuleExpandPath(c, tf) for c in rule['action']] - cmd = ['"%s"' % i for i in cmd] - cmd = ' '.join(cmd) - # Add it to the makefile. - mk_file.write('%s: %s\n' % (' '.join(outputs), ' '.join(inputs))) - mk_file.write('\t%s\n\n' % cmd) - # Close up the file. - mk_file.close() - - # Add makefile to list of sources. - sources.add(filename) - # Add a build action to call makefile. - cmd = ['make', - 'OutDir=$(OutDir)', - 'IntDir=$(IntDir)', - '-j', '${NUMBER_OF_PROCESSORS_PLUS_1}', - '-f', filename] - cmd = _BuildCommandLineForRuleRaw(spec, cmd, True, False, True, True) - # Insert makefile as 0'th input, so it gets the action attached there, - # as this is easier to understand from in the IDE. - all_inputs = list(all_inputs) - all_inputs.insert(0, filename) - _AddActionStep(actions_to_add, - inputs=_FixPaths(all_inputs), - outputs=_FixPaths(all_outputs), - description='Running external rules for %s' % - spec['target_name'], - command=cmd) + filename = "%s_rules%s.mk" % (spec["target_name"], options.suffix) + mk_file = gyp.common.WriteOnDiff(os.path.join(output_dir, filename)) + # Find cygwin style versions of some paths. + mk_file.write('OutDirCygwin:=$(shell cygpath -u "$(OutDir)")\n') + mk_file.write('IntDirCygwin:=$(shell cygpath -u "$(IntDir)")\n') + # Gather stuff needed to emit all: target. + all_inputs = OrderedSet() + all_outputs = OrderedSet() + all_output_dirs = OrderedSet() + first_outputs = [] + for rule in rules: + trigger_files = _FindRuleTriggerFiles(rule, sources) + for tf in trigger_files: + inputs, outputs = _RuleInputsAndOutputs(rule, tf) + all_inputs.update(OrderedSet(inputs)) + all_outputs.update(OrderedSet(outputs)) + # Only use one target from each rule as the dependency for + # 'all' so we don't try to build each rule multiple times. + first_outputs.append(list(outputs)[0]) + # Get the unique output directories for this rule. + output_dirs = [os.path.split(i)[0] for i in outputs] + for od in output_dirs: + all_output_dirs.add(od) + first_outputs_cyg = [_Cygwinify(i) for i in first_outputs] + # Write out all: target, including mkdir for each output directory. + mk_file.write("all: %s\n" % " ".join(first_outputs_cyg)) + for od in all_output_dirs: + if od: + mk_file.write('\tmkdir -p `cygpath -u "%s"`\n' % od) + mk_file.write("\n") + # Define how each output is generated. + for rule in rules: + trigger_files = _FindRuleTriggerFiles(rule, sources) + for tf in trigger_files: + # Get all the inputs and outputs for this rule for this trigger file. + inputs, outputs = _RuleInputsAndOutputs(rule, tf) + inputs = [_Cygwinify(i) for i in inputs] + outputs = [_Cygwinify(i) for i in outputs] + # Prepare the command line for this rule. + cmd = [_RuleExpandPath(c, tf) for c in rule["action"]] + cmd = ['"%s"' % i for i in cmd] + cmd = " ".join(cmd) + # Add it to the makefile. + mk_file.write("%s: %s\n" % (" ".join(outputs), " ".join(inputs))) + mk_file.write("\t%s\n\n" % cmd) + # Close up the file. + mk_file.close() + + # Add makefile to list of sources. + sources.add(filename) + # Add a build action to call makefile. + cmd = [ + "make", + "OutDir=$(OutDir)", + "IntDir=$(IntDir)", + "-j", + "${NUMBER_OF_PROCESSORS_PLUS_1}", + "-f", + filename, + ] + cmd = _BuildCommandLineForRuleRaw(spec, cmd, True, False, True, True) + # Insert makefile as 0'th input, so it gets the action attached there, + # as this is easier to understand from in the IDE. + all_inputs = list(all_inputs) + all_inputs.insert(0, filename) + _AddActionStep( + actions_to_add, + inputs=_FixPaths(all_inputs), + outputs=_FixPaths(all_outputs), + description="Running external rules for %s" % spec["target_name"], + command=cmd, + ) def _EscapeEnvironmentVariableExpansion(s): - """Escapes % characters. + """Escapes % characters. Escapes any % characters so that Windows-style environment variable expansions will leave them alone. @@ -684,15 +754,15 @@ def _EscapeEnvironmentVariableExpansion(s): Returns: The escaped string. """ - s = s.replace('%', '%%') - return s + s = s.replace("%", "%%") + return s quote_replacer_regex = re.compile(r'(\\*)"') def _EscapeCommandLineArgumentForMSVS(s): - """Escapes a Windows command-line argument. + """Escapes a Windows command-line argument. So that the Win32 CommandLineToArgv function will turn the escaped result back into the original string. @@ -706,24 +776,24 @@ def _EscapeCommandLineArgumentForMSVS(s): the escaped string. """ - def _Replace(match): - # For a literal quote, CommandLineToArgv requires an odd number of - # backslashes preceding it, and it produces half as many literal backslashes - # (rounded down). So we need to produce 2n+1 backslashes. - return 2 * match.group(1) + '\\"' + def _Replace(match): + # For a literal quote, CommandLineToArgv requires an odd number of + # backslashes preceding it, and it produces half as many literal backslashes + # (rounded down). So we need to produce 2n+1 backslashes. + return 2 * match.group(1) + '\\"' - # Escape all quotes so that they are interpreted literally. - s = quote_replacer_regex.sub(_Replace, s) - # Now add unescaped quotes so that any whitespace is interpreted literally. - s = '"' + s + '"' - return s + # Escape all quotes so that they are interpreted literally. + s = quote_replacer_regex.sub(_Replace, s) + # Now add unescaped quotes so that any whitespace is interpreted literally. + s = '"' + s + '"' + return s -delimiters_replacer_regex = re.compile(r'(\\*)([,;]+)') +delimiters_replacer_regex = re.compile(r"(\\*)([,;]+)") def _EscapeVCProjCommandLineArgListItem(s): - """Escapes command line arguments for MSVS. + """Escapes command line arguments for MSVS. The VCProj format stores string lists in a single string using commas and semi-colons as separators, which must be quoted if they are to be @@ -744,85 +814,87 @@ def _EscapeVCProjCommandLineArgListItem(s): the escaped string. """ - def _Replace(match): - # For a non-literal quote, CommandLineToArgv requires an even number of - # backslashes preceding it, and it produces half as many literal - # backslashes. So we need to produce 2n backslashes. - return 2 * match.group(1) + '"' + match.group(2) + '"' - - segments = s.split('"') - # The unquoted segments are at the even-numbered indices. - for i in range(0, len(segments), 2): - segments[i] = delimiters_replacer_regex.sub(_Replace, segments[i]) - # Concatenate back into a single string - s = '"'.join(segments) - if len(segments) % 2 == 0: - # String ends while still quoted according to VCProj's convention. This - # means the delimiter and the next list item that follow this one in the - # .vcproj file will be misinterpreted as part of this item. There is nothing - # we can do about this. Adding an extra quote would correct the problem in - # the VCProj but cause the same problem on the final command-line. Moving - # the item to the end of the list does works, but that's only possible if - # there's only one such item. Let's just warn the user. - print('Warning: MSVS may misinterpret the odd number of ' + - 'quotes in ' + s, file=sys.stderr) - return s + def _Replace(match): + # For a non-literal quote, CommandLineToArgv requires an even number of + # backslashes preceding it, and it produces half as many literal + # backslashes. So we need to produce 2n backslashes. + return 2 * match.group(1) + '"' + match.group(2) + '"' + + segments = s.split('"') + # The unquoted segments are at the even-numbered indices. + for i in range(0, len(segments), 2): + segments[i] = delimiters_replacer_regex.sub(_Replace, segments[i]) + # Concatenate back into a single string + s = '"'.join(segments) + if len(segments) % 2 == 0: + # String ends while still quoted according to VCProj's convention. This + # means the delimiter and the next list item that follow this one in the + # .vcproj file will be misinterpreted as part of this item. There is nothing + # we can do about this. Adding an extra quote would correct the problem in + # the VCProj but cause the same problem on the final command-line. Moving + # the item to the end of the list does works, but that's only possible if + # there's only one such item. Let's just warn the user. + print( + "Warning: MSVS may misinterpret the odd number of " + "quotes in " + s, + file=sys.stderr, + ) + return s def _EscapeCppDefineForMSVS(s): - """Escapes a CPP define so that it will reach the compiler unaltered.""" - s = _EscapeEnvironmentVariableExpansion(s) - s = _EscapeCommandLineArgumentForMSVS(s) - s = _EscapeVCProjCommandLineArgListItem(s) - # cl.exe replaces literal # characters with = in preprocesor definitions for - # some reason. Octal-encode to work around that. - s = s.replace('#', '\\%03o' % ord('#')) - return s + """Escapes a CPP define so that it will reach the compiler unaltered.""" + s = _EscapeEnvironmentVariableExpansion(s) + s = _EscapeCommandLineArgumentForMSVS(s) + s = _EscapeVCProjCommandLineArgListItem(s) + # cl.exe replaces literal # characters with = in preprocesor definitions for + # some reason. Octal-encode to work around that. + s = s.replace("#", "\\%03o" % ord("#")) + return s quote_replacer_regex2 = re.compile(r'(\\+)"') def _EscapeCommandLineArgumentForMSBuild(s): - """Escapes a Windows command-line argument for use by MSBuild.""" + """Escapes a Windows command-line argument for use by MSBuild.""" - def _Replace(match): - return (len(match.group(1)) / 2 * 4) * '\\' + '\\"' + def _Replace(match): + return (len(match.group(1)) / 2 * 4) * "\\" + '\\"' - # Escape all quotes so that they are interpreted literally. - s = quote_replacer_regex2.sub(_Replace, s) - return s + # Escape all quotes so that they are interpreted literally. + s = quote_replacer_regex2.sub(_Replace, s) + return s def _EscapeMSBuildSpecialCharacters(s): - escape_dictionary = { - '%': '%25', - '$': '%24', - '@': '%40', - "'": '%27', - ';': '%3B', - '?': '%3F', - '*': '%2A' - } - result = ''.join([escape_dictionary.get(c, c) for c in s]) - return result + escape_dictionary = { + "%": "%25", + "$": "%24", + "@": "%40", + "'": "%27", + ";": "%3B", + "?": "%3F", + "*": "%2A", + } + result = "".join([escape_dictionary.get(c, c) for c in s]) + return result def _EscapeCppDefineForMSBuild(s): - """Escapes a CPP define so that it will reach the compiler unaltered.""" - s = _EscapeEnvironmentVariableExpansion(s) - s = _EscapeCommandLineArgumentForMSBuild(s) - s = _EscapeMSBuildSpecialCharacters(s) - # cl.exe replaces literal # characters with = in preprocesor definitions for - # some reason. Octal-encode to work around that. - s = s.replace('#', '\\%03o' % ord('#')) - return s + """Escapes a CPP define so that it will reach the compiler unaltered.""" + s = _EscapeEnvironmentVariableExpansion(s) + s = _EscapeCommandLineArgumentForMSBuild(s) + s = _EscapeMSBuildSpecialCharacters(s) + # cl.exe replaces literal # characters with = in preprocesor definitions for + # some reason. Octal-encode to work around that. + s = s.replace("#", "\\%03o" % ord("#")) + return s -def _GenerateRulesForMSVS(p, output_dir, options, spec, - sources, excluded_sources, - actions_to_add): - """Generate all the rules for a particular project. +def _GenerateRulesForMSVS( + p, output_dir, options, spec, sources, excluded_sources, actions_to_add +): + """Generate all the rules for a particular project. Arguments: p: the project @@ -833,45 +905,46 @@ def _GenerateRulesForMSVS(p, output_dir, options, spec, excluded_sources: the set of sources excluded from normal processing actions_to_add: deferred list of actions to add in """ - rules = spec.get('rules', []) - rules_native = [r for r in rules if not int(r.get('msvs_external_rule', 0))] - rules_external = [r for r in rules if int(r.get('msvs_external_rule', 0))] + rules = spec.get("rules", []) + rules_native = [r for r in rules if not int(r.get("msvs_external_rule", 0))] + rules_external = [r for r in rules if int(r.get("msvs_external_rule", 0))] - # Handle rules that use a native rules file. - if rules_native: - _GenerateNativeRulesForMSVS(p, rules_native, output_dir, spec, options) + # Handle rules that use a native rules file. + if rules_native: + _GenerateNativeRulesForMSVS(p, rules_native, output_dir, spec, options) - # Handle external rules (non-native rules). - if rules_external: - _GenerateExternalRules(rules_external, output_dir, spec, - sources, options, actions_to_add) - _AdjustSourcesForRules(rules, sources, excluded_sources, False) + # Handle external rules (non-native rules). + if rules_external: + _GenerateExternalRules( + rules_external, output_dir, spec, sources, options, actions_to_add + ) + _AdjustSourcesForRules(rules, sources, excluded_sources, False) def _AdjustSourcesForRules(rules, sources, excluded_sources, is_msbuild): - # Add outputs generated by each rule (if applicable). - for rule in rules: - # Add in the outputs from this rule. - trigger_files = _FindRuleTriggerFiles(rule, sources) - for trigger_file in trigger_files: - # Remove trigger_file from excluded_sources to let the rule be triggered - # (e.g. rule trigger ax_enums.idl is added to excluded_sources - # because it's also in an action's inputs in the same project) - excluded_sources.discard(_FixPath(trigger_file)) - # Done if not processing outputs as sources. - if int(rule.get('process_outputs_as_sources', False)): - inputs, outputs = _RuleInputsAndOutputs(rule, trigger_file) - inputs = OrderedSet(_FixPaths(inputs)) - outputs = OrderedSet(_FixPaths(outputs)) - inputs.remove(_FixPath(trigger_file)) - sources.update(inputs) - if not is_msbuild: - excluded_sources.update(inputs) - sources.update(outputs) + # Add outputs generated by each rule (if applicable). + for rule in rules: + # Add in the outputs from this rule. + trigger_files = _FindRuleTriggerFiles(rule, sources) + for trigger_file in trigger_files: + # Remove trigger_file from excluded_sources to let the rule be triggered + # (e.g. rule trigger ax_enums.idl is added to excluded_sources + # because it's also in an action's inputs in the same project) + excluded_sources.discard(_FixPath(trigger_file)) + # Done if not processing outputs as sources. + if int(rule.get("process_outputs_as_sources", False)): + inputs, outputs = _RuleInputsAndOutputs(rule, trigger_file) + inputs = OrderedSet(_FixPaths(inputs)) + outputs = OrderedSet(_FixPaths(outputs)) + inputs.remove(_FixPath(trigger_file)) + sources.update(inputs) + if not is_msbuild: + excluded_sources.update(inputs) + sources.update(outputs) def _FilterActionsFromExcluded(excluded_sources, actions_to_add): - """Take inputs with actions attached out of the list of exclusions. + """Take inputs with actions attached out of the list of exclusions. Arguments: excluded_sources: list of source files not to be built. @@ -879,16 +952,16 @@ def _FilterActionsFromExcluded(excluded_sources, actions_to_add): Returns: excluded_sources with files that have actions attached removed. """ - must_keep = OrderedSet(_FixPaths(actions_to_add.keys())) - return [s for s in excluded_sources if s not in must_keep] + must_keep = OrderedSet(_FixPaths(actions_to_add.keys())) + return [s for s in excluded_sources if s not in must_keep] def _GetDefaultConfiguration(spec): - return spec['configurations'][spec['default_configuration']] + return spec["configurations"][spec["default_configuration"]] def _GetGuidOfProject(proj_path, spec): - """Get the guid for the project. + """Get the guid for the project. Arguments: proj_path: Path of the vcproj or vcxproj file to generate. @@ -898,21 +971,23 @@ def _GetGuidOfProject(proj_path, spec): Raises: ValueError: if the specified GUID is invalid. """ - # Pluck out the default configuration. - default_config = _GetDefaultConfiguration(spec) - # Decide the guid of the project. - guid = default_config.get('msvs_guid') - if guid: - if VALID_MSVS_GUID_CHARS.match(guid) is None: - raise ValueError('Invalid MSVS guid: "%s". Must match regex: "%s".' % - (guid, VALID_MSVS_GUID_CHARS.pattern)) - guid = '{%s}' % guid - guid = guid or MSVSNew.MakeGuid(proj_path) - return guid + # Pluck out the default configuration. + default_config = _GetDefaultConfiguration(spec) + # Decide the guid of the project. + guid = default_config.get("msvs_guid") + if guid: + if VALID_MSVS_GUID_CHARS.match(guid) is None: + raise ValueError( + 'Invalid MSVS guid: "%s". Must match regex: "%s".' + % (guid, VALID_MSVS_GUID_CHARS.pattern) + ) + guid = "{%s}" % guid + guid = guid or MSVSNew.MakeGuid(proj_path) + return guid def _GetMsbuildToolsetOfProject(proj_path, spec, version): - """Get the platform toolset for the project. + """Get the platform toolset for the project. Arguments: proj_path: Path of the vcproj or vcxproj file to generate. @@ -921,16 +996,18 @@ def _GetMsbuildToolsetOfProject(proj_path, spec, version): Returns: the platform toolset string or None. """ - # Pluck out the default configuration. - default_config = _GetDefaultConfiguration(spec) - toolset = default_config.get('msbuild_toolset') - if not toolset and version.DefaultToolset(): - toolset = version.DefaultToolset() - return toolset + # Pluck out the default configuration. + default_config = _GetDefaultConfiguration(spec) + toolset = default_config.get("msbuild_toolset") + if not toolset and version.DefaultToolset(): + toolset = version.DefaultToolset() + if spec["type"] == "windows_driver": + toolset = "WindowsKernelModeDriver10.0" + return toolset -def _GenerateProject(project, options, version, generator_flags): - """Generates a vcproj file. +def _GenerateProject(project, options, version, generator_flags, spec): + """Generates a vcproj file. Arguments: project: the MSVSProject object. @@ -940,56 +1017,59 @@ def _GenerateProject(project, options, version, generator_flags): Returns: A list of source files that cannot be found on disk. """ - default_config = _GetDefaultConfiguration(project.spec) + default_config = _GetDefaultConfiguration(project.spec) - # Skip emitting anything if told to with msvs_existing_vcproj option. - if default_config.get('msvs_existing_vcproj'): - return [] + # Skip emitting anything if told to with msvs_existing_vcproj option. + if default_config.get("msvs_existing_vcproj"): + return [] - if version.UsesVcxproj(): - return _GenerateMSBuildProject(project, options, version, generator_flags) - else: - return _GenerateMSVSProject(project, options, version, generator_flags) + if version.UsesVcxproj(): + return _GenerateMSBuildProject(project, options, version, generator_flags, spec) + else: + return _GenerateMSVSProject(project, options, version, generator_flags) # TODO: Avoid code duplication with _ValidateSourcesForOSX in make.py. def _ValidateSourcesForMSVSProject(spec, version): - """Makes sure if duplicate basenames are not specified in the source list. + """Makes sure if duplicate basenames are not specified in the source list. Arguments: spec: The target dictionary containing the properties of the target. version: The VisualStudioVersion object. """ - # This validation should not be applied to MSVC2010 and later. - assert not version.UsesVcxproj() - - # TODO: Check if MSVC allows this for loadable_module targets. - if spec.get('type', None) not in ('static_library', 'shared_library'): - return - sources = spec.get('sources', []) - basenames = {} - for source in sources: - name, ext = os.path.splitext(source) - is_compiled_file = ext in [ - '.c', '.cc', '.cpp', '.cxx', '.m', '.mm', '.s', '.S'] - if not is_compiled_file: - continue - basename = os.path.basename(name) # Don't include extension. - basenames.setdefault(basename, []).append(source) - - error = '' - for basename, files in basenames.items(): - if len(files) > 1: - error += ' %s: %s\n' % (basename, ' '.join(files)) - - if error: - print('static library %s has several files with the same basename:\n' % spec['target_name'] - + error + 'MSVC08 cannot handle that.') - raise GypError('Duplicate basenames in sources section, see list above') + # This validation should not be applied to MSVC2010 and later. + assert not version.UsesVcxproj() + + # TODO: Check if MSVC allows this for loadable_module targets. + if spec.get("type", None) not in ("static_library", "shared_library"): + return + sources = spec.get("sources", []) + basenames = {} + for source in sources: + name, ext = os.path.splitext(source) + is_compiled_file = ext in [".c", ".cc", ".cpp", ".cxx", ".m", ".mm", ".s", ".S"] + if not is_compiled_file: + continue + basename = os.path.basename(name) # Don't include extension. + basenames.setdefault(basename, []).append(source) + + error = "" + for basename, files in basenames.items(): + if len(files) > 1: + error += " %s: %s\n" % (basename, " ".join(files)) + + if error: + print( + "static library %s has several files with the same basename:\n" + % spec["target_name"] + + error + + "MSVC08 cannot handle that." + ) + raise GypError("Duplicate basenames in sources section, see list above") def _GenerateMSVSProject(project, options, version, generator_flags): - """Generates a .vcproj file. It may create .rules and .user files too. + """Generates a .vcproj file. It may create .rules and .user files too. Arguments: project: The project object we will generate the file for. @@ -997,85 +1077,82 @@ def _GenerateMSVSProject(project, options, version, generator_flags): version: The VisualStudioVersion object. generator_flags: dict of generator-specific flags. """ - spec = project.spec - gyp.common.EnsureDirExists(project.path) - - platforms = _GetUniquePlatforms(spec) - p = MSVSProject.Writer(project.path, version, spec['target_name'], - project.guid, platforms) - - # Get directory project file is in. - project_dir = os.path.split(project.path)[0] - gyp_path = _NormalizedSource(project.build_file) - relative_path_of_gyp_file = gyp.common.RelativePath(gyp_path, project_dir) - - config_type = _GetMSVSConfigurationType(spec, project.build_file) - for config_name, config in spec['configurations'].items(): - _AddConfigurationToMSVSProject(p, spec, config_type, config_name, config) - - # MSVC08 and prior version cannot handle duplicate basenames in the same - # target. - # TODO: Take excluded sources into consideration if possible. - _ValidateSourcesForMSVSProject(spec, version) - - # Prepare list of sources and excluded sources. - gyp_file = os.path.split(project.build_file)[1] - sources, excluded_sources = _PrepareListOfSources(spec, generator_flags, - gyp_file) - - # Add rules. - actions_to_add = {} - _GenerateRulesForMSVS(p, project_dir, options, spec, - sources, excluded_sources, - actions_to_add) - list_excluded = generator_flags.get('msvs_list_excluded_files', True) - sources, excluded_sources, excluded_idl = ( - _AdjustSourcesAndConvertToFilterHierarchy(spec, options, project_dir, - sources, excluded_sources, - list_excluded, version)) - - # Add in files. - missing_sources = _VerifySourcesExist(sources, project_dir) - p.AddFiles(sources) - - _AddToolFilesToMSVS(p, spec) - _HandlePreCompiledHeaders(p, sources, spec) - _AddActions(actions_to_add, spec, relative_path_of_gyp_file) - _AddCopies(actions_to_add, spec) - _WriteMSVSUserFile(project.path, version, spec) - - # NOTE: this stanza must appear after all actions have been decided. - # Don't excluded sources with actions attached, or they won't run. - excluded_sources = _FilterActionsFromExcluded( - excluded_sources, actions_to_add) - _ExcludeFilesFromBeingBuilt(p, spec, excluded_sources, excluded_idl, - list_excluded) - _AddAccumulatedActionsToMSVS(p, spec, actions_to_add) - - # Write it out. - p.WriteIfChanged() - - return missing_sources + spec = project.spec + gyp.common.EnsureDirExists(project.path) + + platforms = _GetUniquePlatforms(spec) + p = MSVSProject.Writer( + project.path, version, spec["target_name"], project.guid, platforms + ) + + # Get directory project file is in. + project_dir = os.path.split(project.path)[0] + gyp_path = _NormalizedSource(project.build_file) + relative_path_of_gyp_file = gyp.common.RelativePath(gyp_path, project_dir) + + config_type = _GetMSVSConfigurationType(spec, project.build_file) + for config_name, config in spec["configurations"].items(): + _AddConfigurationToMSVSProject(p, spec, config_type, config_name, config) + + # MSVC08 and prior version cannot handle duplicate basenames in the same + # target. + # TODO: Take excluded sources into consideration if possible. + _ValidateSourcesForMSVSProject(spec, version) + + # Prepare list of sources and excluded sources. + gyp_file = os.path.split(project.build_file)[1] + sources, excluded_sources = _PrepareListOfSources(spec, generator_flags, gyp_file) + + # Add rules. + actions_to_add = {} + _GenerateRulesForMSVS( + p, project_dir, options, spec, sources, excluded_sources, actions_to_add + ) + list_excluded = generator_flags.get("msvs_list_excluded_files", True) + sources, excluded_sources, excluded_idl = _AdjustSourcesAndConvertToFilterHierarchy( + spec, options, project_dir, sources, excluded_sources, list_excluded, version + ) + + # Add in files. + missing_sources = _VerifySourcesExist(sources, project_dir) + p.AddFiles(sources) + + _AddToolFilesToMSVS(p, spec) + _HandlePreCompiledHeaders(p, sources, spec) + _AddActions(actions_to_add, spec, relative_path_of_gyp_file) + _AddCopies(actions_to_add, spec) + _WriteMSVSUserFile(project.path, version, spec) + + # NOTE: this stanza must appear after all actions have been decided. + # Don't excluded sources with actions attached, or they won't run. + excluded_sources = _FilterActionsFromExcluded(excluded_sources, actions_to_add) + _ExcludeFilesFromBeingBuilt(p, spec, excluded_sources, excluded_idl, list_excluded) + _AddAccumulatedActionsToMSVS(p, spec, actions_to_add) + + # Write it out. + p.WriteIfChanged() + + return missing_sources def _GetUniquePlatforms(spec): - """Returns the list of unique platforms for this spec, e.g ['win32', ...]. + """Returns the list of unique platforms for this spec, e.g ['win32', ...]. Arguments: spec: The target dictionary containing the properties of the target. Returns: The MSVSUserFile object created. """ - # Gather list of unique platforms. - platforms = OrderedSet() - for configuration in spec['configurations']: - platforms.add(_ConfigPlatform(spec['configurations'][configuration])) - platforms = list(platforms) - return platforms + # Gather list of unique platforms. + platforms = OrderedSet() + for configuration in spec["configurations"]: + platforms.add(_ConfigPlatform(spec["configurations"][configuration])) + platforms = list(platforms) + return platforms def _CreateMSVSUserFile(proj_path, version, spec): - """Generates a .user file for the user running this Gyp program. + """Generates a .user file for the user running this Gyp program. Arguments: proj_path: The path of the project file being created. The .user file @@ -1085,15 +1162,14 @@ def _CreateMSVSUserFile(proj_path, version, spec): Returns: The MSVSUserFile object created. """ - (domain, username) = _GetDomainAndUserName() - vcuser_filename = '.'.join([proj_path, domain, username, 'user']) - user_file = MSVSUserFile.Writer(vcuser_filename, version, - spec['target_name']) - return user_file + (domain, username) = _GetDomainAndUserName() + vcuser_filename = ".".join([proj_path, domain, username, "user"]) + user_file = MSVSUserFile.Writer(vcuser_filename, version, spec["target_name"]) + return user_file def _GetMSVSConfigurationType(spec, build_file): - """Returns the configuration type for this project. + """Returns the configuration type for this project. It's a number defined by Microsoft. May raise an exception. @@ -1103,27 +1179,31 @@ def _GetMSVSConfigurationType(spec, build_file): Returns: An integer, the configuration type. """ - try: - config_type = { - 'executable': '1', # .exe - 'shared_library': '2', # .dll - 'loadable_module': '2', # .dll - 'static_library': '4', # .lib - 'none': '10', # Utility type - }[spec['type']] - except KeyError: - if spec.get('type'): - raise GypError('Target type %s is not a valid target type for ' - 'target %s in %s.' % - (spec['type'], spec['target_name'], build_file)) - else: - raise GypError('Missing type field for target %s in %s.' % - (spec['target_name'], build_file)) - return config_type + try: + config_type = { + "executable": "1", # .exe + "shared_library": "2", # .dll + "loadable_module": "2", # .dll + "static_library": "4", # .lib + "windows_driver": "5", # .sys + "none": "10", # Utility type + }[spec["type"]] + except KeyError: + if spec.get("type"): + raise GypError( + "Target type %s is not a valid target type for " + "target %s in %s." % (spec["type"], spec["target_name"], build_file) + ) + else: + raise GypError( + "Missing type field for target %s in %s." + % (spec["target_name"], build_file) + ) + return config_type def _AddConfigurationToMSVSProject(p, spec, config_type, config_name, config): - """Adds a configuration to the MSVS project. + """Adds a configuration to the MSVS project. Many settings in a vcproj file are specific to a configuration. This function the main part of the vcproj file that's configuration specific. @@ -1136,81 +1216,84 @@ def _AddConfigurationToMSVSProject(p, spec, config_type, config_name, config): config: The dictionary that defines the special processing to be done for this configuration. """ - # Get the information for this configuration - include_dirs, midl_include_dirs, resource_include_dirs = \ - _GetIncludeDirs(config) - libraries = _GetLibraries(spec) - library_dirs = _GetLibraryDirs(config) - out_file, vc_tool, _ = _GetOutputFilePathAndTool(spec, msbuild=False) - defines = _GetDefines(config) - defines = [_EscapeCppDefineForMSVS(d) for d in defines] - disabled_warnings = _GetDisabledWarnings(config) - prebuild = config.get('msvs_prebuild') - postbuild = config.get('msvs_postbuild') - def_file = _GetModuleDefinition(spec) - precompiled_header = config.get('msvs_precompiled_header') - - # Prepare the list of tools as a dictionary. - tools = dict() - # Add in user specified msvs_settings. - msvs_settings = config.get('msvs_settings', {}) - MSVSSettings.ValidateMSVSSettings(msvs_settings) - - # Prevent default library inheritance from the environment. - _ToolAppend(tools, 'VCLinkerTool', 'AdditionalDependencies', ['$(NOINHERIT)']) - - for tool in msvs_settings: - settings = config['msvs_settings'][tool] - for setting in settings: - _ToolAppend(tools, tool, setting, settings[setting]) - # Add the information to the appropriate tool - _ToolAppend(tools, 'VCCLCompilerTool', - 'AdditionalIncludeDirectories', include_dirs) - _ToolAppend(tools, 'VCMIDLTool', - 'AdditionalIncludeDirectories', midl_include_dirs) - _ToolAppend(tools, 'VCResourceCompilerTool', - 'AdditionalIncludeDirectories', resource_include_dirs) - # Add in libraries. - _ToolAppend(tools, 'VCLinkerTool', 'AdditionalDependencies', libraries) - _ToolAppend(tools, 'VCLinkerTool', 'AdditionalLibraryDirectories', - library_dirs) - if out_file: - _ToolAppend(tools, vc_tool, 'OutputFile', out_file, only_if_unset=True) - # Add defines. - _ToolAppend(tools, 'VCCLCompilerTool', 'PreprocessorDefinitions', defines) - _ToolAppend(tools, 'VCResourceCompilerTool', 'PreprocessorDefinitions', - defines) - # Change program database directory to prevent collisions. - _ToolAppend(tools, 'VCCLCompilerTool', 'ProgramDataBaseFileName', - '$(IntDir)$(ProjectName)\\vc80.pdb', only_if_unset=True) - # Add disabled warnings. - _ToolAppend(tools, 'VCCLCompilerTool', - 'DisableSpecificWarnings', disabled_warnings) - # Add Pre-build. - _ToolAppend(tools, 'VCPreBuildEventTool', 'CommandLine', prebuild) - # Add Post-build. - _ToolAppend(tools, 'VCPostBuildEventTool', 'CommandLine', postbuild) - # Turn on precompiled headers if appropriate. - if precompiled_header: - precompiled_header = os.path.split(precompiled_header)[1] - _ToolAppend(tools, 'VCCLCompilerTool', 'UsePrecompiledHeader', '2') - _ToolAppend(tools, 'VCCLCompilerTool', - 'PrecompiledHeaderThrough', precompiled_header) - _ToolAppend(tools, 'VCCLCompilerTool', - 'ForcedIncludeFiles', precompiled_header) - # Loadable modules don't generate import libraries; - # tell dependent projects to not expect one. - if spec['type'] == 'loadable_module': - _ToolAppend(tools, 'VCLinkerTool', 'IgnoreImportLibrary', 'true') - # Set the module definition file if any. - if def_file: - _ToolAppend(tools, 'VCLinkerTool', 'ModuleDefinitionFile', def_file) - - _AddConfigurationToMSVS(p, spec, tools, config, config_type, config_name) + # Get the information for this configuration + include_dirs, midl_include_dirs, resource_include_dirs = _GetIncludeDirs(config) + libraries = _GetLibraries(spec) + library_dirs = _GetLibraryDirs(config) + out_file, vc_tool, _ = _GetOutputFilePathAndTool(spec, msbuild=False) + defines = _GetDefines(config) + defines = [_EscapeCppDefineForMSVS(d) for d in defines] + disabled_warnings = _GetDisabledWarnings(config) + prebuild = config.get("msvs_prebuild") + postbuild = config.get("msvs_postbuild") + def_file = _GetModuleDefinition(spec) + precompiled_header = config.get("msvs_precompiled_header") + + # Prepare the list of tools as a dictionary. + tools = dict() + # Add in user specified msvs_settings. + msvs_settings = config.get("msvs_settings", {}) + MSVSSettings.ValidateMSVSSettings(msvs_settings) + + # Prevent default library inheritance from the environment. + _ToolAppend(tools, "VCLinkerTool", "AdditionalDependencies", ["$(NOINHERIT)"]) + + for tool in msvs_settings: + settings = config["msvs_settings"][tool] + for setting in settings: + _ToolAppend(tools, tool, setting, settings[setting]) + # Add the information to the appropriate tool + _ToolAppend(tools, "VCCLCompilerTool", "AdditionalIncludeDirectories", include_dirs) + _ToolAppend(tools, "VCMIDLTool", "AdditionalIncludeDirectories", midl_include_dirs) + _ToolAppend( + tools, + "VCResourceCompilerTool", + "AdditionalIncludeDirectories", + resource_include_dirs, + ) + # Add in libraries. + _ToolAppend(tools, "VCLinkerTool", "AdditionalDependencies", libraries) + _ToolAppend(tools, "VCLinkerTool", "AdditionalLibraryDirectories", library_dirs) + if out_file: + _ToolAppend(tools, vc_tool, "OutputFile", out_file, only_if_unset=True) + # Add defines. + _ToolAppend(tools, "VCCLCompilerTool", "PreprocessorDefinitions", defines) + _ToolAppend(tools, "VCResourceCompilerTool", "PreprocessorDefinitions", defines) + # Change program database directory to prevent collisions. + _ToolAppend( + tools, + "VCCLCompilerTool", + "ProgramDataBaseFileName", + "$(IntDir)$(ProjectName)\\vc80.pdb", + only_if_unset=True, + ) + # Add disabled warnings. + _ToolAppend(tools, "VCCLCompilerTool", "DisableSpecificWarnings", disabled_warnings) + # Add Pre-build. + _ToolAppend(tools, "VCPreBuildEventTool", "CommandLine", prebuild) + # Add Post-build. + _ToolAppend(tools, "VCPostBuildEventTool", "CommandLine", postbuild) + # Turn on precompiled headers if appropriate. + if precompiled_header: + precompiled_header = os.path.split(precompiled_header)[1] + _ToolAppend(tools, "VCCLCompilerTool", "UsePrecompiledHeader", "2") + _ToolAppend( + tools, "VCCLCompilerTool", "PrecompiledHeaderThrough", precompiled_header + ) + _ToolAppend(tools, "VCCLCompilerTool", "ForcedIncludeFiles", precompiled_header) + # Loadable modules don't generate import libraries; + # tell dependent projects to not expect one. + if spec["type"] == "loadable_module": + _ToolAppend(tools, "VCLinkerTool", "IgnoreImportLibrary", "true") + # Set the module definition file if any. + if def_file: + _ToolAppend(tools, "VCLinkerTool", "ModuleDefinitionFile", def_file) + + _AddConfigurationToMSVS(p, spec, tools, config, config_type, config_name) def _GetIncludeDirs(config): - """Returns the list of directories to be used for #include directives. + """Returns the list of directories to be used for #include directives. Arguments: config: The dictionary that defines the special processing to be done @@ -1218,23 +1301,23 @@ def _GetIncludeDirs(config): Returns: The list of directory paths. """ - # TODO(bradnelson): include_dirs should really be flexible enough not to - # require this sort of thing. - include_dirs = ( - config.get('include_dirs', []) + - config.get('msvs_system_include_dirs', [])) - midl_include_dirs = ( - config.get('midl_include_dirs', []) + - config.get('msvs_system_include_dirs', [])) - resource_include_dirs = config.get('resource_include_dirs', include_dirs) - include_dirs = _FixPaths(include_dirs) - midl_include_dirs = _FixPaths(midl_include_dirs) - resource_include_dirs = _FixPaths(resource_include_dirs) - return include_dirs, midl_include_dirs, resource_include_dirs + # TODO(bradnelson): include_dirs should really be flexible enough not to + # require this sort of thing. + include_dirs = config.get("include_dirs", []) + config.get( + "msvs_system_include_dirs", [] + ) + midl_include_dirs = config.get("midl_include_dirs", []) + config.get( + "msvs_system_include_dirs", [] + ) + resource_include_dirs = config.get("resource_include_dirs", include_dirs) + include_dirs = _FixPaths(include_dirs) + midl_include_dirs = _FixPaths(midl_include_dirs) + resource_include_dirs = _FixPaths(resource_include_dirs) + return include_dirs, midl_include_dirs, resource_include_dirs def _GetLibraryDirs(config): - """Returns the list of directories to be used for library search paths. + """Returns the list of directories to be used for library search paths. Arguments: config: The dictionary that defines the special processing to be done @@ -1243,39 +1326,39 @@ def _GetLibraryDirs(config): The list of directory paths. """ - library_dirs = config.get('library_dirs', []) - library_dirs = _FixPaths(library_dirs) - return library_dirs + library_dirs = config.get("library_dirs", []) + library_dirs = _FixPaths(library_dirs) + return library_dirs def _GetLibraries(spec): - """Returns the list of libraries for this configuration. + """Returns the list of libraries for this configuration. Arguments: spec: The target dictionary containing the properties of the target. Returns: The list of directory paths. """ - libraries = spec.get('libraries', []) - # Strip out -l, as it is not used on windows (but is needed so we can pass - # in libraries that are assumed to be in the default library path). - # Also remove duplicate entries, leaving only the last duplicate, while - # preserving order. - found = OrderedSet() - unique_libraries_list = [] - for entry in reversed(libraries): - library = re.sub(r'^\-l', '', entry) - if not os.path.splitext(library)[1]: - library += '.lib' - if library not in found: - found.add(library) - unique_libraries_list.append(library) - unique_libraries_list.reverse() - return unique_libraries_list + libraries = spec.get("libraries", []) + # Strip out -l, as it is not used on windows (but is needed so we can pass + # in libraries that are assumed to be in the default library path). + # Also remove duplicate entries, leaving only the last duplicate, while + # preserving order. + found = OrderedSet() + unique_libraries_list = [] + for entry in reversed(libraries): + library = re.sub(r"^\-l", "", entry) + if not os.path.splitext(library)[1]: + library += ".lib" + if library not in found: + found.add(library) + unique_libraries_list.append(library) + unique_libraries_list.reverse() + return unique_libraries_list def _GetOutputFilePathAndTool(spec, msbuild): - """Returns the path and tool to use for this target. + """Returns the path and tool to use for this target. Figures out the path of the file this spec will create and the name of the VC tool that will create it. @@ -1285,35 +1368,36 @@ def _GetOutputFilePathAndTool(spec, msbuild): Returns: A triple of (file path, name of the vc tool, name of the msbuild tool) """ - # Select a name for the output file. - out_file = '' - vc_tool = '' - msbuild_tool = '' - output_file_map = { - 'executable': ('VCLinkerTool', 'Link', '$(OutDir)', '.exe'), - 'shared_library': ('VCLinkerTool', 'Link', '$(OutDir)', '.dll'), - 'loadable_module': ('VCLinkerTool', 'Link', '$(OutDir)', '.dll'), - 'static_library': ('VCLibrarianTool', 'Lib', '$(OutDir)lib\\', '.lib'), - } - output_file_props = output_file_map.get(spec['type']) - if output_file_props and int(spec.get('msvs_auto_output_file', 1)): - vc_tool, msbuild_tool, out_dir, suffix = output_file_props - if spec.get('standalone_static_library', 0): - out_dir = '$(OutDir)' - out_dir = spec.get('product_dir', out_dir) - product_extension = spec.get('product_extension') - if product_extension: - suffix = '.' + product_extension - elif msbuild: - suffix = '$(TargetExt)' - prefix = spec.get('product_prefix', '') - product_name = spec.get('product_name', '$(ProjectName)') - out_file = ntpath.join(out_dir, prefix + product_name + suffix) - return out_file, vc_tool, msbuild_tool + # Select a name for the output file. + out_file = "" + vc_tool = "" + msbuild_tool = "" + output_file_map = { + "executable": ("VCLinkerTool", "Link", "$(OutDir)", ".exe"), + "shared_library": ("VCLinkerTool", "Link", "$(OutDir)", ".dll"), + "loadable_module": ("VCLinkerTool", "Link", "$(OutDir)", ".dll"), + "windows_driver": ("VCLinkerTool", "Link", "$(OutDir)", ".sys"), + "static_library": ("VCLibrarianTool", "Lib", "$(OutDir)lib\\", ".lib"), + } + output_file_props = output_file_map.get(spec["type"]) + if output_file_props and int(spec.get("msvs_auto_output_file", 1)): + vc_tool, msbuild_tool, out_dir, suffix = output_file_props + if spec.get("standalone_static_library", 0): + out_dir = "$(OutDir)" + out_dir = spec.get("product_dir", out_dir) + product_extension = spec.get("product_extension") + if product_extension: + suffix = "." + product_extension + elif msbuild: + suffix = "$(TargetExt)" + prefix = spec.get("product_prefix", "") + product_name = spec.get("product_name", "$(ProjectName)") + out_file = ntpath.join(out_dir, prefix + product_name + suffix) + return out_file, vc_tool, msbuild_tool def _GetOutputTargetExt(spec): - """Returns the extension for this target, including the dot + """Returns the extension for this target, including the dot If product_extension is specified, set target_extension to this to avoid MSB8012, returns None otherwise. Ignores any target_extension settings in @@ -1324,14 +1408,14 @@ def _GetOutputTargetExt(spec): Returns: A string with the extension, or None """ - target_extension = spec.get('product_extension') - if target_extension: - return '.' + target_extension - return None + target_extension = spec.get("product_extension") + if target_extension: + return "." + target_extension + return None def _GetDefines(config): - """Returns the list of preprocessor definitions for this configuation. + """Returns the list of preprocessor definitions for this configuation. Arguments: config: The dictionary that defines the special processing to be done @@ -1339,63 +1423,68 @@ def _GetDefines(config): Returns: The list of preprocessor definitions. """ - defines = [] - for d in config.get('defines', []): - if type(d) == list: - fd = '='.join([str(dpart) for dpart in d]) - else: - fd = str(d) - defines.append(fd) - return defines + defines = [] + for d in config.get("defines", []): + if type(d) == list: + fd = "=".join([str(dpart) for dpart in d]) + else: + fd = str(d) + defines.append(fd) + return defines def _GetDisabledWarnings(config): - return [str(i) for i in config.get('msvs_disabled_warnings', [])] + return [str(i) for i in config.get("msvs_disabled_warnings", [])] def _GetModuleDefinition(spec): - def_file = '' - if spec['type'] in ['shared_library', 'loadable_module', 'executable']: - def_files = [s for s in spec.get('sources', []) if s.endswith('.def')] - if len(def_files) == 1: - def_file = _FixPath(def_files[0]) - elif def_files: - raise ValueError( - 'Multiple module definition files in one target, target %s lists ' - 'multiple .def files: %s' % ( - spec['target_name'], ' '.join(def_files))) - return def_file + def_file = "" + if spec["type"] in [ + "shared_library", + "loadable_module", + "executable", + "windows_driver", + ]: + def_files = [s for s in spec.get("sources", []) if s.endswith(".def")] + if len(def_files) == 1: + def_file = _FixPath(def_files[0]) + elif def_files: + raise ValueError( + "Multiple module definition files in one target, target %s lists " + "multiple .def files: %s" % (spec["target_name"], " ".join(def_files)) + ) + return def_file def _ConvertToolsToExpectedForm(tools): - """Convert tools to a form expected by Visual Studio. + """Convert tools to a form expected by Visual Studio. Arguments: tools: A dictionary of settings; the tool name is the key. Returns: A list of Tool objects. """ - tool_list = [] - for tool, settings in tools.items(): - # Collapse settings with lists. - settings_fixed = {} - for setting, value in settings.items(): - if type(value) == list: - if ((tool == 'VCLinkerTool' and - setting == 'AdditionalDependencies') or - setting == 'AdditionalOptions'): - settings_fixed[setting] = ' '.join(value) - else: - settings_fixed[setting] = ';'.join(value) - else: - settings_fixed[setting] = value - # Add in this tool. - tool_list.append(MSVSProject.Tool(tool, settings_fixed)) - return tool_list + tool_list = [] + for tool, settings in tools.items(): + # Collapse settings with lists. + settings_fixed = {} + for setting, value in settings.items(): + if type(value) == list: + if ( + tool == "VCLinkerTool" and setting == "AdditionalDependencies" + ) or setting == "AdditionalOptions": + settings_fixed[setting] = " ".join(value) + else: + settings_fixed[setting] = ";".join(value) + else: + settings_fixed[setting] = value + # Add in this tool. + tool_list.append(MSVSProject.Tool(tool, settings_fixed)) + return tool_list def _AddConfigurationToMSVS(p, spec, tools, config, config_type, config_name): - """Add to the project file the configuration specified by config. + """Add to the project file the configuration specified by config. Arguments: p: The target project being generated. @@ -1406,45 +1495,45 @@ def _AddConfigurationToMSVS(p, spec, tools, config, config_type, config_name): config_type: The configuration type, a number as defined by Microsoft. config_name: The name of the configuration. """ - attributes = _GetMSVSAttributes(spec, config, config_type) - # Add in this configuration. - tool_list = _ConvertToolsToExpectedForm(tools) - p.AddConfig(_ConfigFullName(config_name, config), - attrs=attributes, tools=tool_list) + attributes = _GetMSVSAttributes(spec, config, config_type) + # Add in this configuration. + tool_list = _ConvertToolsToExpectedForm(tools) + p.AddConfig(_ConfigFullName(config_name, config), attrs=attributes, tools=tool_list) def _GetMSVSAttributes(spec, config, config_type): - # Prepare configuration attributes. - prepared_attrs = {} - source_attrs = config.get('msvs_configuration_attributes', {}) - for a in source_attrs: - prepared_attrs[a] = source_attrs[a] - # Add props files. - vsprops_dirs = config.get('msvs_props', []) - vsprops_dirs = _FixPaths(vsprops_dirs) - if vsprops_dirs: - prepared_attrs['InheritedPropertySheets'] = ';'.join(vsprops_dirs) - # Set configuration type. - prepared_attrs['ConfigurationType'] = config_type - output_dir = prepared_attrs.get('OutputDirectory', - '$(SolutionDir)$(ConfigurationName)') - prepared_attrs['OutputDirectory'] = _FixPath(output_dir) + '\\' - if 'IntermediateDirectory' not in prepared_attrs: - intermediate = '$(ConfigurationName)\\obj\\$(ProjectName)' - prepared_attrs['IntermediateDirectory'] = _FixPath(intermediate) + '\\' - else: - intermediate = _FixPath(prepared_attrs['IntermediateDirectory']) + '\\' - intermediate = MSVSSettings.FixVCMacroSlashes(intermediate) - prepared_attrs['IntermediateDirectory'] = intermediate - return prepared_attrs + # Prepare configuration attributes. + prepared_attrs = {} + source_attrs = config.get("msvs_configuration_attributes", {}) + for a in source_attrs: + prepared_attrs[a] = source_attrs[a] + # Add props files. + vsprops_dirs = config.get("msvs_props", []) + vsprops_dirs = _FixPaths(vsprops_dirs) + if vsprops_dirs: + prepared_attrs["InheritedPropertySheets"] = ";".join(vsprops_dirs) + # Set configuration type. + prepared_attrs["ConfigurationType"] = config_type + output_dir = prepared_attrs.get( + "OutputDirectory", "$(SolutionDir)$(ConfigurationName)" + ) + prepared_attrs["OutputDirectory"] = _FixPath(output_dir) + "\\" + if "IntermediateDirectory" not in prepared_attrs: + intermediate = "$(ConfigurationName)\\obj\\$(ProjectName)" + prepared_attrs["IntermediateDirectory"] = _FixPath(intermediate) + "\\" + else: + intermediate = _FixPath(prepared_attrs["IntermediateDirectory"]) + "\\" + intermediate = MSVSSettings.FixVCMacroSlashes(intermediate) + prepared_attrs["IntermediateDirectory"] = intermediate + return prepared_attrs def _AddNormalizedSources(sources_set, sources_array): - sources_set.update(_NormalizedSource(s) for s in sources_array) + sources_set.update(_NormalizedSource(s) for s in sources_array) def _PrepareListOfSources(spec, generator_flags, gyp_file): - """Prepare list of sources and excluded sources. + """Prepare list of sources and excluded sources. Besides the sources specified directly in the spec, adds the gyp file so that a change to it will cause a re-compile. Also adds appropriate sources @@ -1458,33 +1547,34 @@ def _PrepareListOfSources(spec, generator_flags, gyp_file): A pair of (list of sources, list of excluded sources). The sources will be relative to the gyp file. """ - sources = OrderedSet() - _AddNormalizedSources(sources, spec.get('sources', [])) - excluded_sources = OrderedSet() - # Add in the gyp file. - if not generator_flags.get('standalone'): - sources.add(gyp_file) - - # Add in 'action' inputs and outputs. - for a in spec.get('actions', []): - inputs = a['inputs'] - inputs = [_NormalizedSource(i) for i in inputs] - # Add all inputs to sources and excluded sources. - inputs = OrderedSet(inputs) - sources.update(inputs) - if not spec.get('msvs_external_builder'): - excluded_sources.update(inputs) - if int(a.get('process_outputs_as_sources', False)): - _AddNormalizedSources(sources, a.get('outputs', [])) - # Add in 'copies' inputs and outputs. - for cpy in spec.get('copies', []): - _AddNormalizedSources(sources, cpy.get('files', [])) - return (sources, excluded_sources) + sources = OrderedSet() + _AddNormalizedSources(sources, spec.get("sources", [])) + excluded_sources = OrderedSet() + # Add in the gyp file. + if not generator_flags.get("standalone"): + sources.add(gyp_file) + + # Add in 'action' inputs and outputs. + for a in spec.get("actions", []): + inputs = a["inputs"] + inputs = [_NormalizedSource(i) for i in inputs] + # Add all inputs to sources and excluded sources. + inputs = OrderedSet(inputs) + sources.update(inputs) + if not spec.get("msvs_external_builder"): + excluded_sources.update(inputs) + if int(a.get("process_outputs_as_sources", False)): + _AddNormalizedSources(sources, a.get("outputs", [])) + # Add in 'copies' inputs and outputs. + for cpy in spec.get("copies", []): + _AddNormalizedSources(sources, cpy.get("files", [])) + return (sources, excluded_sources) def _AdjustSourcesAndConvertToFilterHierarchy( - spec, options, gyp_dir, sources, excluded_sources, list_excluded, version): - """Adjusts the list of sources and excluded sources. + spec, options, gyp_dir, sources, excluded_sources, list_excluded, version +): + """Adjusts the list of sources and excluded sources. Also converts the sets to lists. @@ -1499,327 +1589,377 @@ def _AdjustSourcesAndConvertToFilterHierarchy( A trio of (list of sources, list of excluded sources, path of excluded IDL file) """ - # Exclude excluded sources coming into the generator. - excluded_sources.update(OrderedSet(spec.get('sources_excluded', []))) - # Add excluded sources into sources for good measure. - sources.update(excluded_sources) - # Convert to proper windows form. - # NOTE: sources goes from being a set to a list here. - # NOTE: excluded_sources goes from being a set to a list here. - sources = _FixPaths(sources) - # Convert to proper windows form. - excluded_sources = _FixPaths(excluded_sources) - - excluded_idl = _IdlFilesHandledNonNatively(spec, sources) - - precompiled_related = _GetPrecompileRelatedFiles(spec) - # Find the excluded ones, minus the precompiled header related ones. - fully_excluded = [i for i in excluded_sources if i not in precompiled_related] - - # Convert to folders and the right slashes. - sources = [i.split('\\') for i in sources] - sources = _ConvertSourcesToFilterHierarchy(sources, excluded=fully_excluded, - list_excluded=list_excluded, - msvs_version=version) - - # Prune filters with a single child to flatten ugly directory structures - # such as ../../src/modules/module1 etc. - if version.UsesVcxproj(): - while all([isinstance(s, MSVSProject.Filter) for s in sources]) \ - and len(set([s.name for s in sources])) == 1: - assert all([len(s.contents) == 1 for s in sources]) - sources = [s.contents[0] for s in sources] - else: - while len(sources) == 1 and isinstance(sources[0], MSVSProject.Filter): - sources = sources[0].contents - - return sources, excluded_sources, excluded_idl + # Exclude excluded sources coming into the generator. + excluded_sources.update(OrderedSet(spec.get("sources_excluded", []))) + # Add excluded sources into sources for good measure. + sources.update(excluded_sources) + # Convert to proper windows form. + # NOTE: sources goes from being a set to a list here. + # NOTE: excluded_sources goes from being a set to a list here. + sources = _FixPaths(sources) + # Convert to proper windows form. + excluded_sources = _FixPaths(excluded_sources) + + excluded_idl = _IdlFilesHandledNonNatively(spec, sources) + + precompiled_related = _GetPrecompileRelatedFiles(spec) + # Find the excluded ones, minus the precompiled header related ones. + fully_excluded = [i for i in excluded_sources if i not in precompiled_related] + + # Convert to folders and the right slashes. + sources = [i.split("\\") for i in sources] + sources = _ConvertSourcesToFilterHierarchy( + sources, + excluded=fully_excluded, + list_excluded=list_excluded, + msvs_version=version, + ) + + # Prune filters with a single child to flatten ugly directory structures + # such as ../../src/modules/module1 etc. + if version.UsesVcxproj(): + while ( + all([isinstance(s, MSVSProject.Filter) for s in sources]) + and len(set([s.name for s in sources])) == 1 + ): + assert all([len(s.contents) == 1 for s in sources]) + sources = [s.contents[0] for s in sources] + else: + while len(sources) == 1 and isinstance(sources[0], MSVSProject.Filter): + sources = sources[0].contents + + return sources, excluded_sources, excluded_idl def _IdlFilesHandledNonNatively(spec, sources): - # If any non-native rules use 'idl' as an extension exclude idl files. - # Gather a list here to use later. - using_idl = False - for rule in spec.get('rules', []): - if rule['extension'] == 'idl' and int(rule.get('msvs_external_rule', 0)): - using_idl = True - break - if using_idl: - excluded_idl = [i for i in sources if i.endswith('.idl')] - else: - excluded_idl = [] - return excluded_idl + # If any non-native rules use 'idl' as an extension exclude idl files. + # Gather a list here to use later. + using_idl = False + for rule in spec.get("rules", []): + if rule["extension"] == "idl" and int(rule.get("msvs_external_rule", 0)): + using_idl = True + break + if using_idl: + excluded_idl = [i for i in sources if i.endswith(".idl")] + else: + excluded_idl = [] + return excluded_idl def _GetPrecompileRelatedFiles(spec): - # Gather a list of precompiled header related sources. - precompiled_related = [] - for _, config in spec['configurations'].items(): - for k in precomp_keys: - f = config.get(k) - if f: - precompiled_related.append(_FixPath(f)) - return precompiled_related - - -def _ExcludeFilesFromBeingBuilt(p, spec, excluded_sources, excluded_idl, - list_excluded): - exclusions = _GetExcludedFilesFromBuild(spec, excluded_sources, excluded_idl) - for file_name, excluded_configs in exclusions.items(): - if (not list_excluded and - len(excluded_configs) == len(spec['configurations'])): - # If we're not listing excluded files, then they won't appear in the - # project, so don't try to configure them to be excluded. - pass - else: - for config_name, config in excluded_configs: - p.AddFileConfig(file_name, _ConfigFullName(config_name, config), - {'ExcludedFromBuild': 'true'}) + # Gather a list of precompiled header related sources. + precompiled_related = [] + for _, config in spec["configurations"].items(): + for k in precomp_keys: + f = config.get(k) + if f: + precompiled_related.append(_FixPath(f)) + return precompiled_related + + +def _ExcludeFilesFromBeingBuilt(p, spec, excluded_sources, excluded_idl, list_excluded): + exclusions = _GetExcludedFilesFromBuild(spec, excluded_sources, excluded_idl) + for file_name, excluded_configs in exclusions.items(): + if not list_excluded and len(excluded_configs) == len(spec["configurations"]): + # If we're not listing excluded files, then they won't appear in the + # project, so don't try to configure them to be excluded. + pass + else: + for config_name, config in excluded_configs: + p.AddFileConfig( + file_name, + _ConfigFullName(config_name, config), + {"ExcludedFromBuild": "true"}, + ) def _GetExcludedFilesFromBuild(spec, excluded_sources, excluded_idl): - exclusions = {} - # Exclude excluded sources from being built. - for f in excluded_sources: - excluded_configs = [] - for config_name, config in spec['configurations'].items(): - precomped = [_FixPath(config.get(i, '')) for i in precomp_keys] - # Don't do this for ones that are precompiled header related. - if f not in precomped: - excluded_configs.append((config_name, config)) - exclusions[f] = excluded_configs - # If any non-native rules use 'idl' as an extension exclude idl files. - # Exclude them now. - for f in excluded_idl: - excluded_configs = [] - for config_name, config in spec['configurations'].items(): - excluded_configs.append((config_name, config)) - exclusions[f] = excluded_configs - return exclusions + exclusions = {} + # Exclude excluded sources from being built. + for f in excluded_sources: + excluded_configs = [] + for config_name, config in spec["configurations"].items(): + precomped = [_FixPath(config.get(i, "")) for i in precomp_keys] + # Don't do this for ones that are precompiled header related. + if f not in precomped: + excluded_configs.append((config_name, config)) + exclusions[f] = excluded_configs + # If any non-native rules use 'idl' as an extension exclude idl files. + # Exclude them now. + for f in excluded_idl: + excluded_configs = [] + for config_name, config in spec["configurations"].items(): + excluded_configs.append((config_name, config)) + exclusions[f] = excluded_configs + return exclusions def _AddToolFilesToMSVS(p, spec): - # Add in tool files (rules). - tool_files = OrderedSet() - for _, config in spec['configurations'].items(): - for f in config.get('msvs_tool_files', []): - tool_files.add(f) - for f in tool_files: - p.AddToolFile(f) + # Add in tool files (rules). + tool_files = OrderedSet() + for _, config in spec["configurations"].items(): + for f in config.get("msvs_tool_files", []): + tool_files.add(f) + for f in tool_files: + p.AddToolFile(f) def _HandlePreCompiledHeaders(p, sources, spec): - # Pre-compiled header source stubs need a different compiler flag - # (generate precompiled header) and any source file not of the same - # kind (i.e. C vs. C++) as the precompiled header source stub needs - # to have use of precompiled headers disabled. - extensions_excluded_from_precompile = [] - for config_name, config in spec['configurations'].items(): - source = config.get('msvs_precompiled_source') - if source: - source = _FixPath(source) - # UsePrecompiledHeader=1 for if using precompiled headers. - tool = MSVSProject.Tool('VCCLCompilerTool', - {'UsePrecompiledHeader': '1'}) - p.AddFileConfig(source, _ConfigFullName(config_name, config), - {}, tools=[tool]) - basename, extension = os.path.splitext(source) - if extension == '.c': - extensions_excluded_from_precompile = ['.cc', '.cpp', '.cxx'] - else: - extensions_excluded_from_precompile = ['.c'] - def DisableForSourceTree(source_tree): - for source in source_tree: - if isinstance(source, MSVSProject.Filter): - DisableForSourceTree(source.contents) - else: - basename, extension = os.path.splitext(source) - if extension in extensions_excluded_from_precompile: - for config_name, config in spec['configurations'].items(): - tool = MSVSProject.Tool('VCCLCompilerTool', - {'UsePrecompiledHeader': '0', - 'ForcedIncludeFiles': '$(NOINHERIT)'}) - p.AddFileConfig(_FixPath(source), + # Pre-compiled header source stubs need a different compiler flag + # (generate precompiled header) and any source file not of the same + # kind (i.e. C vs. C++) as the precompiled header source stub needs + # to have use of precompiled headers disabled. + extensions_excluded_from_precompile = [] + for config_name, config in spec["configurations"].items(): + source = config.get("msvs_precompiled_source") + if source: + source = _FixPath(source) + # UsePrecompiledHeader=1 for if using precompiled headers. + tool = MSVSProject.Tool("VCCLCompilerTool", {"UsePrecompiledHeader": "1"}) + p.AddFileConfig( + source, _ConfigFullName(config_name, config), {}, tools=[tool] + ) + basename, extension = os.path.splitext(source) + if extension == ".c": + extensions_excluded_from_precompile = [".cc", ".cpp", ".cxx"] + else: + extensions_excluded_from_precompile = [".c"] + + def DisableForSourceTree(source_tree): + for source in source_tree: + if isinstance(source, MSVSProject.Filter): + DisableForSourceTree(source.contents) + else: + basename, extension = os.path.splitext(source) + if extension in extensions_excluded_from_precompile: + for config_name, config in spec["configurations"].items(): + tool = MSVSProject.Tool( + "VCCLCompilerTool", + { + "UsePrecompiledHeader": "0", + "ForcedIncludeFiles": "$(NOINHERIT)", + }, + ) + p.AddFileConfig( + _FixPath(source), _ConfigFullName(config_name, config), - {}, tools=[tool]) - # Do nothing if there was no precompiled source. - if extensions_excluded_from_precompile: - DisableForSourceTree(sources) + {}, + tools=[tool], + ) + + # Do nothing if there was no precompiled source. + if extensions_excluded_from_precompile: + DisableForSourceTree(sources) def _AddActions(actions_to_add, spec, relative_path_of_gyp_file): - # Add actions. - actions = spec.get('actions', []) - # Don't setup_env every time. When all the actions are run together in one - # batch file in VS, the PATH will grow too long. - # Membership in this set means that the cygwin environment has been set up, - # and does not need to be set up again. - have_setup_env = set() - for a in actions: - # Attach actions to the gyp file if nothing else is there. - inputs = a.get('inputs') or [relative_path_of_gyp_file] - attached_to = inputs[0] - need_setup_env = attached_to not in have_setup_env - cmd = _BuildCommandLineForRule(spec, a, has_input_path=False, - do_setup_env=need_setup_env) - have_setup_env.add(attached_to) - # Add the action. - _AddActionStep(actions_to_add, - inputs=inputs, - outputs=a.get('outputs', []), - description=a.get('message', a['action_name']), - command=cmd) + # Add actions. + actions = spec.get("actions", []) + # Don't setup_env every time. When all the actions are run together in one + # batch file in VS, the PATH will grow too long. + # Membership in this set means that the cygwin environment has been set up, + # and does not need to be set up again. + have_setup_env = set() + for a in actions: + # Attach actions to the gyp file if nothing else is there. + inputs = a.get("inputs") or [relative_path_of_gyp_file] + attached_to = inputs[0] + need_setup_env = attached_to not in have_setup_env + cmd = _BuildCommandLineForRule( + spec, a, has_input_path=False, do_setup_env=need_setup_env + ) + have_setup_env.add(attached_to) + # Add the action. + _AddActionStep( + actions_to_add, + inputs=inputs, + outputs=a.get("outputs", []), + description=a.get("message", a["action_name"]), + command=cmd, + ) def _WriteMSVSUserFile(project_path, version, spec): - # Add run_as and test targets. - if 'run_as' in spec: - run_as = spec['run_as'] - action = run_as.get('action', []) - environment = run_as.get('environment', []) - working_directory = run_as.get('working_directory', '.') - elif int(spec.get('test', 0)): - action = ['$(TargetPath)', '--gtest_print_time'] - environment = [] - working_directory = '.' - else: - return # Nothing to add - # Write out the user file. - user_file = _CreateMSVSUserFile(project_path, version, spec) - for config_name, c_data in spec['configurations'].items(): - user_file.AddDebugSettings(_ConfigFullName(config_name, c_data), - action, environment, working_directory) - user_file.WriteIfChanged() + # Add run_as and test targets. + if "run_as" in spec: + run_as = spec["run_as"] + action = run_as.get("action", []) + environment = run_as.get("environment", []) + working_directory = run_as.get("working_directory", ".") + elif int(spec.get("test", 0)): + action = ["$(TargetPath)", "--gtest_print_time"] + environment = [] + working_directory = "." + else: + return # Nothing to add + # Write out the user file. + user_file = _CreateMSVSUserFile(project_path, version, spec) + for config_name, c_data in spec["configurations"].items(): + user_file.AddDebugSettings( + _ConfigFullName(config_name, c_data), action, environment, working_directory + ) + user_file.WriteIfChanged() def _AddCopies(actions_to_add, spec): - copies = _GetCopies(spec) - for inputs, outputs, cmd, description in copies: - _AddActionStep(actions_to_add, inputs=inputs, outputs=outputs, - description=description, command=cmd) + copies = _GetCopies(spec) + for inputs, outputs, cmd, description in copies: + _AddActionStep( + actions_to_add, + inputs=inputs, + outputs=outputs, + description=description, + command=cmd, + ) def _GetCopies(spec): - copies = [] - # Add copies. - for cpy in spec.get('copies', []): - for src in cpy.get('files', []): - dst = os.path.join(cpy['destination'], os.path.basename(src)) - # _AddCustomBuildToolForMSVS() will call _FixPath() on the inputs and - # outputs, so do the same for our generated command line. - if src.endswith('/'): - src_bare = src[:-1] - base_dir = posixpath.split(src_bare)[0] - outer_dir = posixpath.split(src_bare)[1] - cmd = 'cd "%s" && xcopy /e /f /y "%s" "%s\\%s\\"' % ( - _FixPath(base_dir), outer_dir, _FixPath(dst), outer_dir) - copies.append(([src], ['dummy_copies', dst], cmd, - 'Copying %s to %s' % (src, dst))) - else: - cmd = 'mkdir "%s" 2>nul & set ERRORLEVEL=0 & copy /Y "%s" "%s"' % ( - _FixPath(cpy['destination']), _FixPath(src), _FixPath(dst)) - copies.append(([src], [dst], cmd, 'Copying %s to %s' % (src, dst))) - return copies + copies = [] + # Add copies. + for cpy in spec.get("copies", []): + for src in cpy.get("files", []): + dst = os.path.join(cpy["destination"], os.path.basename(src)) + # _AddCustomBuildToolForMSVS() will call _FixPath() on the inputs and + # outputs, so do the same for our generated command line. + if src.endswith("/"): + src_bare = src[:-1] + base_dir = posixpath.split(src_bare)[0] + outer_dir = posixpath.split(src_bare)[1] + fixed_dst = _FixPath(dst) + full_dst = '"%s\\%s\\"' % (fixed_dst, outer_dir) + cmd = 'mkdir %s 2>nul & cd "%s" && xcopy /e /f /y "%s" %s' % ( + full_dst, + _FixPath(base_dir), + outer_dir, + full_dst, + ) + copies.append( + ( + [src], + ["dummy_copies", dst], + cmd, + "Copying %s to %s" % (src, fixed_dst), + ) + ) + else: + fix_dst = _FixPath(cpy["destination"]) + cmd = 'mkdir "%s" 2>nul & set ERRORLEVEL=0 & copy /Y "%s" "%s"' % ( + fix_dst, + _FixPath(src), + _FixPath(dst), + ) + copies.append(([src], [dst], cmd, "Copying %s to %s" % (src, fix_dst))) + return copies def _GetPathDict(root, path): - # |path| will eventually be empty (in the recursive calls) if it was initially - # relative; otherwise it will eventually end up as '\', 'D:\', etc. - if not path or path.endswith(os.sep): - return root - parent, folder = os.path.split(path) - parent_dict = _GetPathDict(root, parent) - if folder not in parent_dict: - parent_dict[folder] = dict() - return parent_dict[folder] + # |path| will eventually be empty (in the recursive calls) if it was initially + # relative; otherwise it will eventually end up as '\', 'D:\', etc. + if not path or path.endswith(os.sep): + return root + parent, folder = os.path.split(path) + parent_dict = _GetPathDict(root, parent) + if folder not in parent_dict: + parent_dict[folder] = dict() + return parent_dict[folder] def _DictsToFolders(base_path, bucket, flat): - # Convert to folders recursively. - children = [] - for folder, contents in bucket.items(): - if type(contents) == dict: - folder_children = _DictsToFolders(os.path.join(base_path, folder), - contents, flat) - if flat: - children += folder_children - else: - folder_children = MSVSNew.MSVSFolder(os.path.join(base_path, folder), - name='(' + folder + ')', - entries=folder_children) - children.append(folder_children) - else: - children.append(contents) - return children + # Convert to folders recursively. + children = [] + for folder, contents in bucket.items(): + if type(contents) == dict: + folder_children = _DictsToFolders( + os.path.join(base_path, folder), contents, flat + ) + if flat: + children += folder_children + else: + folder_children = MSVSNew.MSVSFolder( + os.path.join(base_path, folder), + name="(" + folder + ")", + entries=folder_children, + ) + children.append(folder_children) + else: + children.append(contents) + return children def _CollapseSingles(parent, node): - # Recursively explorer the tree of dicts looking for projects which are - # the sole item in a folder which has the same name as the project. Bring - # such projects up one level. - if (type(node) == dict and - len(node) == 1 and - list(node)[0] == parent + '.vcproj'): - return node[list(node)[0]] - if type(node) != dict: + # Recursively explorer the tree of dicts looking for projects which are + # the sole item in a folder which has the same name as the project. Bring + # such projects up one level. + if type(node) == dict and len(node) == 1 and next(iter(node)) == parent + ".vcproj": + return node[next(iter(node))] + if type(node) != dict: + return node + for child in node: + node[child] = _CollapseSingles(child, node[child]) return node - for child in node: - node[child] = _CollapseSingles(child, node[child]) - return node def _GatherSolutionFolders(sln_projects, project_objects, flat): - root = {} - # Convert into a tree of dicts on path. - for p in sln_projects: - gyp_file, target = gyp.common.ParseQualifiedTarget(p)[0:2] - gyp_dir = os.path.dirname(gyp_file) - path_dict = _GetPathDict(root, gyp_dir) - path_dict[target + '.vcproj'] = project_objects[p] - # Walk down from the top until we hit a folder that has more than one entry. - # In practice, this strips the top-level "src/" dir from the hierarchy in - # the solution. - while len(root) == 1 and type(root[list(root)[0]]) == dict: - root = root[list(root)[0]] - # Collapse singles. - root = _CollapseSingles('', root) - # Merge buckets until everything is a root entry. - return _DictsToFolders('', root, flat) + root = {} + # Convert into a tree of dicts on path. + for p in sln_projects: + gyp_file, target = gyp.common.ParseQualifiedTarget(p)[0:2] + if p.endswith("#host"): + target += "_host" + gyp_dir = os.path.dirname(gyp_file) + path_dict = _GetPathDict(root, gyp_dir) + path_dict[target + ".vcproj"] = project_objects[p] + # Walk down from the top until we hit a folder that has more than one entry. + # In practice, this strips the top-level "src/" dir from the hierarchy in + # the solution. + while len(root) == 1 and type(root[next(iter(root))]) == dict: + root = root[next(iter(root))] + # Collapse singles. + root = _CollapseSingles("", root) + # Merge buckets until everything is a root entry. + return _DictsToFolders("", root, flat) def _GetPathOfProject(qualified_target, spec, options, msvs_version): - default_config = _GetDefaultConfiguration(spec) - proj_filename = default_config.get('msvs_existing_vcproj') - if not proj_filename: - proj_filename = (spec['target_name'] + options.suffix + - msvs_version.ProjectExtension()) - - build_file = gyp.common.BuildFile(qualified_target) - proj_path = os.path.join(os.path.dirname(build_file), proj_filename) - fix_prefix = None - if options.generator_output: - project_dir_path = os.path.dirname(os.path.abspath(proj_path)) - proj_path = os.path.join(options.generator_output, proj_path) - fix_prefix = gyp.common.RelativePath(project_dir_path, - os.path.dirname(proj_path)) - return proj_path, fix_prefix + default_config = _GetDefaultConfiguration(spec) + proj_filename = default_config.get("msvs_existing_vcproj") + if not proj_filename: + proj_filename = spec["target_name"] + if spec["toolset"] == "host": + proj_filename += "_host" + proj_filename = proj_filename + options.suffix + msvs_version.ProjectExtension() + + build_file = gyp.common.BuildFile(qualified_target) + proj_path = os.path.join(os.path.dirname(build_file), proj_filename) + fix_prefix = None + if options.generator_output: + project_dir_path = os.path.dirname(os.path.abspath(proj_path)) + proj_path = os.path.join(options.generator_output, proj_path) + fix_prefix = gyp.common.RelativePath( + project_dir_path, os.path.dirname(proj_path) + ) + return proj_path, fix_prefix def _GetPlatformOverridesOfProject(spec): - # Prepare a dict indicating which project configurations are used for which - # solution configurations for this target. - config_platform_overrides = {} - for config_name, c in spec['configurations'].items(): - config_fullname = _ConfigFullName(config_name, c) - platform = c.get('msvs_target_platform', _ConfigPlatform(c)) - fixed_config_fullname = '%s|%s' % ( - _ConfigBaseName(config_name, _ConfigPlatform(c)), platform) - config_platform_overrides[config_fullname] = fixed_config_fullname - return config_platform_overrides + # Prepare a dict indicating which project configurations are used for which + # solution configurations for this target. + config_platform_overrides = {} + for config_name, c in spec["configurations"].items(): + config_fullname = _ConfigFullName(config_name, c) + platform = c.get("msvs_target_platform", _ConfigPlatform(c)) + fixed_config_fullname = "%s|%s" % ( + _ConfigBaseName(config_name, _ConfigPlatform(c)), + platform, + ) + if spec["toolset"] == "host" and generator_supports_multiple_toolsets: + fixed_config_fullname = "%s|x64" % (config_name,) + config_platform_overrides[config_fullname] = fixed_config_fullname + return config_platform_overrides def _CreateProjectObjects(target_list, target_dicts, options, msvs_version): - """Create a MSVSProject object for the targets found in target list. + """Create a MSVSProject object for the targets found in target list. Arguments: target_list: the list of targets to generate project objects for. @@ -1829,46 +1969,48 @@ def _CreateProjectObjects(target_list, target_dicts, options, msvs_version): Returns: A set of created projects, keyed by target. """ - global fixpath_prefix - # Generate each project. - projects = {} - for qualified_target in target_list: - spec = target_dicts[qualified_target] - if spec['toolset'] != 'target': - raise GypError( - 'Multiple toolsets not supported in msvs build (target %s)' % - qualified_target) - proj_path, fixpath_prefix = _GetPathOfProject(qualified_target, spec, - options, msvs_version) - guid = _GetGuidOfProject(proj_path, spec) - overrides = _GetPlatformOverridesOfProject(spec) - build_file = gyp.common.BuildFile(qualified_target) - # Create object for this project. - obj = MSVSNew.MSVSProject( - proj_path, - name=spec['target_name'], - guid=guid, - spec=spec, - build_file=build_file, - config_platform_overrides=overrides, - fixpath_prefix=fixpath_prefix) - # Set project toolset if any (MS build only) - if msvs_version.UsesVcxproj(): - obj.set_msbuild_toolset( - _GetMsbuildToolsetOfProject(proj_path, spec, msvs_version)) - projects[qualified_target] = obj - # Set all the dependencies, but not if we are using an external builder like - # ninja - for project in projects.values(): - if not project.spec.get('msvs_external_builder'): - deps = project.spec.get('dependencies', []) - deps = [projects[d] for d in deps] - project.set_dependencies(deps) - return projects + global fixpath_prefix + # Generate each project. + projects = {} + for qualified_target in target_list: + spec = target_dicts[qualified_target] + proj_path, fixpath_prefix = _GetPathOfProject( + qualified_target, spec, options, msvs_version + ) + guid = _GetGuidOfProject(proj_path, spec) + overrides = _GetPlatformOverridesOfProject(spec) + build_file = gyp.common.BuildFile(qualified_target) + # Create object for this project. + target_name = spec["target_name"] + if spec["toolset"] == "host": + target_name += "_host" + obj = MSVSNew.MSVSProject( + proj_path, + name=target_name, + guid=guid, + spec=spec, + build_file=build_file, + config_platform_overrides=overrides, + fixpath_prefix=fixpath_prefix, + ) + # Set project toolset if any (MS build only) + if msvs_version.UsesVcxproj(): + obj.set_msbuild_toolset( + _GetMsbuildToolsetOfProject(proj_path, spec, msvs_version) + ) + projects[qualified_target] = obj + # Set all the dependencies, but not if we are using an external builder like + # ninja + for project in projects.values(): + if not project.spec.get("msvs_external_builder"): + deps = project.spec.get("dependencies", []) + deps = [projects[d] for d in deps] + project.set_dependencies(deps) + return projects def _InitNinjaFlavor(params, target_list, target_dicts): - """Initialize targets for the ninja flavor. + """Initialize targets for the ninja flavor. This sets up the necessary variables in the targets to generate msvs projects that use ninja as an external builder. The variables in the spec are only set @@ -1879,93 +2021,115 @@ def _InitNinjaFlavor(params, target_list, target_dicts): target_list: List of target pairs: 'base/base.gyp:base'. target_dicts: Dict of target properties keyed on target pair. """ - for qualified_target in target_list: - spec = target_dicts[qualified_target] - if spec.get('msvs_external_builder'): - # The spec explicitly defined an external builder, so don't change it. - continue - - path_to_ninja = spec.get('msvs_path_to_ninja', 'ninja.exe') - - spec['msvs_external_builder'] = 'ninja' - if not spec.get('msvs_external_builder_out_dir'): - gyp_file, _, _ = gyp.common.ParseQualifiedTarget(qualified_target) - gyp_dir = os.path.dirname(gyp_file) - configuration = '$(Configuration)' - if params.get('target_arch') == 'x64': - configuration += '_x64' - if params.get('target_arch') == 'arm64': - configuration += '_arm64' - spec['msvs_external_builder_out_dir'] = os.path.join( - gyp.common.RelativePath(params['options'].toplevel_dir, gyp_dir), - ninja_generator.ComputeOutputDir(params), - configuration) - if not spec.get('msvs_external_builder_build_cmd'): - spec['msvs_external_builder_build_cmd'] = [ - path_to_ninja, - '-C', - '$(OutDir)', - '$(ProjectName)', - ] - if not spec.get('msvs_external_builder_clean_cmd'): - spec['msvs_external_builder_clean_cmd'] = [ - path_to_ninja, - '-C', - '$(OutDir)', - '-tclean', - '$(ProjectName)', - ] + for qualified_target in target_list: + spec = target_dicts[qualified_target] + if spec.get("msvs_external_builder"): + # The spec explicitly defined an external builder, so don't change it. + continue + + path_to_ninja = spec.get("msvs_path_to_ninja", "ninja.exe") + + spec["msvs_external_builder"] = "ninja" + if not spec.get("msvs_external_builder_out_dir"): + gyp_file, _, _ = gyp.common.ParseQualifiedTarget(qualified_target) + gyp_dir = os.path.dirname(gyp_file) + configuration = "$(Configuration)" + if params.get("target_arch") == "x64": + configuration += "_x64" + if params.get("target_arch") == "arm64": + configuration += "_arm64" + spec["msvs_external_builder_out_dir"] = os.path.join( + gyp.common.RelativePath(params["options"].toplevel_dir, gyp_dir), + ninja_generator.ComputeOutputDir(params), + configuration, + ) + if not spec.get("msvs_external_builder_build_cmd"): + spec["msvs_external_builder_build_cmd"] = [ + path_to_ninja, + "-C", + "$(OutDir)", + "$(ProjectName)", + ] + if not spec.get("msvs_external_builder_clean_cmd"): + spec["msvs_external_builder_clean_cmd"] = [ + path_to_ninja, + "-C", + "$(OutDir)", + "-tclean", + "$(ProjectName)", + ] def CalculateVariables(default_variables, params): - """Generated variables that require params to be known.""" - - generator_flags = params.get('generator_flags', {}) - - # Select project file format version (if unset, default to auto detecting). - msvs_version = MSVSVersion.SelectVisualStudioVersion( - generator_flags.get('msvs_version', 'auto')) - # Stash msvs_version for later (so we don't have to probe the system twice). - params['msvs_version'] = msvs_version - - # Set a variable so conditions can be based on msvs_version. - default_variables['MSVS_VERSION'] = msvs_version.ShortName() - - # To determine processor word size on Windows, in addition to checking - # PROCESSOR_ARCHITECTURE (which reflects the word size of the current - # process), it is also necessary to check PROCESSOR_ARCITEW6432 (which - # contains the actual word size of the system when running thru WOW64). - if (os.environ.get('PROCESSOR_ARCHITECTURE', '').find('64') >= 0 or - os.environ.get('PROCESSOR_ARCHITEW6432', '').find('64') >= 0): - default_variables['MSVS_OS_BITS'] = 64 - else: - default_variables['MSVS_OS_BITS'] = 32 + """Generated variables that require params to be known.""" + + generator_flags = params.get("generator_flags", {}) + + # Select project file format version (if unset, default to auto detecting). + msvs_version = MSVSVersion.SelectVisualStudioVersion( + generator_flags.get("msvs_version", "auto") + ) + # Stash msvs_version for later (so we don't have to probe the system twice). + params["msvs_version"] = msvs_version + + # Set a variable so conditions can be based on msvs_version. + default_variables["MSVS_VERSION"] = msvs_version.ShortName() + + # To determine processor word size on Windows, in addition to checking + # PROCESSOR_ARCHITECTURE (which reflects the word size of the current + # process), it is also necessary to check PROCESSOR_ARCITEW6432 (which + # contains the actual word size of the system when running thru WOW64). + if ( + os.environ.get("PROCESSOR_ARCHITECTURE", "").find("64") >= 0 + or os.environ.get("PROCESSOR_ARCHITEW6432", "").find("64") >= 0 + ): + default_variables["MSVS_OS_BITS"] = 64 + else: + default_variables["MSVS_OS_BITS"] = 32 - if gyp.common.GetFlavor(params) == 'ninja': - default_variables['SHARED_INTERMEDIATE_DIR'] = '$(OutDir)gen' + if gyp.common.GetFlavor(params) == "ninja": + default_variables["SHARED_INTERMEDIATE_DIR"] = "$(OutDir)gen" def PerformBuild(data, configurations, params): - options = params['options'] - msvs_version = params['msvs_version'] - devenv = os.path.join(msvs_version.path, 'Common7', 'IDE', 'devenv.com') - - for build_file, build_file_dict in data.items(): - (build_file_root, build_file_ext) = os.path.splitext(build_file) - if build_file_ext != '.gyp': - continue - sln_path = build_file_root + options.suffix + '.sln' - if options.generator_output: - sln_path = os.path.join(options.generator_output, sln_path) - - for config in configurations: - arguments = [devenv, sln_path, '/Build', config] - print('Building [%s]: %s' % (config, arguments)) - rtn = subprocess.check_call(arguments) + options = params["options"] + msvs_version = params["msvs_version"] + devenv = os.path.join(msvs_version.path, "Common7", "IDE", "devenv.com") + + for build_file, build_file_dict in data.items(): + (build_file_root, build_file_ext) = os.path.splitext(build_file) + if build_file_ext != ".gyp": + continue + sln_path = build_file_root + options.suffix + ".sln" + if options.generator_output: + sln_path = os.path.join(options.generator_output, sln_path) + + for config in configurations: + arguments = [devenv, sln_path, "/Build", config] + print("Building [%s]: %s" % (config, arguments)) + subprocess.check_call(arguments) + + +def CalculateGeneratorInputInfo(params): + if params.get("flavor") == "ninja": + toplevel = params["options"].toplevel_dir + qualified_out_dir = os.path.normpath( + os.path.join( + toplevel, + ninja_generator.ComputeOutputDir(params), + "gypfiles-msvs-ninja", + ) + ) + + global generator_filelist_paths + generator_filelist_paths = { + "toplevel": toplevel, + "qualified_out_dir": qualified_out_dir, + } def GenerateOutput(target_list, target_dicts, data, params): - """Generate .sln and .vcproj files. + """Generate .sln and .vcproj files. This is the entry point for this generator. Arguments: @@ -1973,82 +2137,93 @@ def GenerateOutput(target_list, target_dicts, data, params): target_dicts: Dict of target properties keyed on target pair. data: Dictionary containing per .gyp data. """ - global fixpath_prefix - - options = params['options'] - - # Get the project file format version back out of where we stashed it in - # GeneratorCalculatedVariables. - msvs_version = params['msvs_version'] - - generator_flags = params.get('generator_flags', {}) - - # Optionally shard targets marked with 'msvs_shard': SHARD_COUNT. - (target_list, target_dicts) = MSVSUtil.ShardTargets(target_list, target_dicts) - - # Optionally use the large PDB workaround for targets marked with - # 'msvs_large_pdb': 1. - (target_list, target_dicts) = MSVSUtil.InsertLargePdbShims( - target_list, target_dicts, generator_default_variables) - - # Optionally configure each spec to use ninja as the external builder. - if params.get('flavor') == 'ninja': - _InitNinjaFlavor(params, target_list, target_dicts) - - # Prepare the set of configurations. - configs = set() - for qualified_target in target_list: - spec = target_dicts[qualified_target] - for config_name, config in spec['configurations'].items(): - configs.add(_ConfigFullName(config_name, config)) - configs = list(configs) - - # Figure out all the projects that will be generated and their guids - project_objects = _CreateProjectObjects(target_list, target_dicts, options, - msvs_version) - - # Generate each project. - missing_sources = [] - for project in project_objects.values(): - fixpath_prefix = project.fixpath_prefix - missing_sources.extend(_GenerateProject(project, options, msvs_version, - generator_flags)) - fixpath_prefix = None - - for build_file in data: - # Validate build_file extension - if not build_file.endswith('.gyp'): - continue - sln_path = os.path.splitext(build_file)[0] + options.suffix + '.sln' - if options.generator_output: - sln_path = os.path.join(options.generator_output, sln_path) - # Get projects in the solution, and their dependents. - sln_projects = gyp.common.BuildFileTargets(target_list, build_file) - sln_projects += gyp.common.DeepDependencyTargets(target_dicts, sln_projects) - # Create folder hierarchy. - root_entries = _GatherSolutionFolders( - sln_projects, project_objects, flat=msvs_version.FlatSolution()) - # Create solution. - sln = MSVSNew.MSVSSolution(sln_path, - entries=root_entries, - variants=configs, - websiteProperties=False, - version=msvs_version) - sln.Write() - - if missing_sources: - error_message = "Missing input files:\n" + \ - '\n'.join(set(missing_sources)) - if generator_flags.get('msvs_error_on_missing_sources', False): - raise GypError(error_message) - else: - print("Warning: " + error_message, file=sys.stdout) + global fixpath_prefix + + options = params["options"] + + # Get the project file format version back out of where we stashed it in + # GeneratorCalculatedVariables. + msvs_version = params["msvs_version"] + + generator_flags = params.get("generator_flags", {}) + + # Optionally shard targets marked with 'msvs_shard': SHARD_COUNT. + (target_list, target_dicts) = MSVSUtil.ShardTargets(target_list, target_dicts) + + # Optionally use the large PDB workaround for targets marked with + # 'msvs_large_pdb': 1. + (target_list, target_dicts) = MSVSUtil.InsertLargePdbShims( + target_list, target_dicts, generator_default_variables + ) + + # Optionally configure each spec to use ninja as the external builder. + if params.get("flavor") == "ninja": + _InitNinjaFlavor(params, target_list, target_dicts) + + # Prepare the set of configurations. + configs = set() + for qualified_target in target_list: + spec = target_dicts[qualified_target] + for config_name, config in spec["configurations"].items(): + config_name = _ConfigFullName(config_name, config) + configs.add(config_name) + if config_name == "Release|arm64": + configs.add("Release|x64") + configs = list(configs) + + # Figure out all the projects that will be generated and their guids + project_objects = _CreateProjectObjects( + target_list, target_dicts, options, msvs_version + ) + + # Generate each project. + missing_sources = [] + for project in project_objects.values(): + fixpath_prefix = project.fixpath_prefix + missing_sources.extend( + _GenerateProject(project, options, msvs_version, generator_flags, spec) + ) + fixpath_prefix = None + + for build_file in data: + # Validate build_file extension + target_only_configs = configs + if generator_supports_multiple_toolsets: + target_only_configs = [i for i in configs if i.endswith("arm64")] + if not build_file.endswith(".gyp"): + continue + sln_path = os.path.splitext(build_file)[0] + options.suffix + ".sln" + if options.generator_output: + sln_path = os.path.join(options.generator_output, sln_path) + # Get projects in the solution, and their dependents. + sln_projects = gyp.common.BuildFileTargets(target_list, build_file) + sln_projects += gyp.common.DeepDependencyTargets(target_dicts, sln_projects) + # Create folder hierarchy. + root_entries = _GatherSolutionFolders( + sln_projects, project_objects, flat=msvs_version.FlatSolution() + ) + # Create solution. + sln = MSVSNew.MSVSSolution( + sln_path, + entries=root_entries, + variants=target_only_configs, + websiteProperties=False, + version=msvs_version, + ) + sln.Write() + + if missing_sources: + error_message = "Missing input files:\n" + "\n".join(set(missing_sources)) + if generator_flags.get("msvs_error_on_missing_sources", False): + raise GypError(error_message) + else: + print("Warning: " + error_message, file=sys.stdout) -def _GenerateMSBuildFiltersFile(filters_path, source_files, - rule_dependencies, extension_to_rule_name, - platforms): - """Generate the filters file. +def _GenerateMSBuildFiltersFile( + filters_path, source_files, rule_dependencies, extension_to_rule_name, platforms +): + """Generate the filters file. This file is used by Visual Studio to organize the presentation of source files into folders. @@ -2058,29 +2233,43 @@ def _GenerateMSBuildFiltersFile(filters_path, source_files, source_files: The hierarchical structure of all the sources. extension_to_rule_name: A dictionary mapping file extensions to rules. """ - filter_group = [] - source_group = [] - _AppendFiltersForMSBuild('', source_files, rule_dependencies, - extension_to_rule_name, platforms, - filter_group, source_group) - if filter_group: - content = ['Project', - {'ToolsVersion': '4.0', - 'xmlns': 'http://schemas.microsoft.com/developer/msbuild/2003' - }, - ['ItemGroup'] + filter_group, - ['ItemGroup'] + source_group - ] - easy_xml.WriteXmlIfChanged(content, filters_path, pretty=True, win32=True) - elif os.path.exists(filters_path): - # We don't need this filter anymore. Delete the old filter file. - os.unlink(filters_path) - - -def _AppendFiltersForMSBuild(parent_filter_name, sources, rule_dependencies, - extension_to_rule_name, platforms, - filter_group, source_group): - """Creates the list of filters and sources to be added in the filter file. + filter_group = [] + source_group = [] + _AppendFiltersForMSBuild( + "", + source_files, + rule_dependencies, + extension_to_rule_name, + platforms, + filter_group, + source_group, + ) + if filter_group: + content = [ + "Project", + { + "ToolsVersion": "4.0", + "xmlns": "http://schemas.microsoft.com/developer/msbuild/2003", + }, + ["ItemGroup"] + filter_group, + ["ItemGroup"] + source_group, + ] + easy_xml.WriteXmlIfChanged(content, filters_path, pretty=True, win32=True) + elif os.path.exists(filters_path): + # We don't need this filter anymore. Delete the old filter file. + os.unlink(filters_path) + + +def _AppendFiltersForMSBuild( + parent_filter_name, + sources, + rule_dependencies, + extension_to_rule_name, + platforms, + filter_group, + source_group, +): + """Creates the list of filters and sources to be added in the filter file. Args: parent_filter_name: The name of the filter under which the sources are @@ -2090,36 +2279,47 @@ def _AppendFiltersForMSBuild(parent_filter_name, sources, rule_dependencies, filter_group: The list to which filter entries will be appended. source_group: The list to which source entries will be appeneded. """ - for source in sources: - if isinstance(source, MSVSProject.Filter): - # We have a sub-filter. Create the name of that sub-filter. - if not parent_filter_name: - filter_name = source.name - else: - filter_name = '%s\\%s' % (parent_filter_name, source.name) - # Add the filter to the group. - filter_group.append( - ['Filter', {'Include': filter_name}, - ['UniqueIdentifier', MSVSNew.MakeGuid(source.name)]]) - # Recurse and add its dependents. - _AppendFiltersForMSBuild(filter_name, source.contents, - rule_dependencies, extension_to_rule_name, - platforms, filter_group, source_group) - else: - # It's a source. Create a source entry. - _, element = _MapFileToMsBuildSourceType(source, rule_dependencies, - extension_to_rule_name, - platforms) - source_entry = [element, {'Include': source}] - # Specify the filter it is part of, if any. - if parent_filter_name: - source_entry.append(['Filter', parent_filter_name]) - source_group.append(source_entry) - - -def _MapFileToMsBuildSourceType(source, rule_dependencies, - extension_to_rule_name, platforms): - """Returns the group and element type of the source file. + for source in sources: + if isinstance(source, MSVSProject.Filter): + # We have a sub-filter. Create the name of that sub-filter. + if not parent_filter_name: + filter_name = source.name + else: + filter_name = "%s\\%s" % (parent_filter_name, source.name) + # Add the filter to the group. + filter_group.append( + [ + "Filter", + {"Include": filter_name}, + ["UniqueIdentifier", MSVSNew.MakeGuid(source.name)], + ] + ) + # Recurse and add its dependents. + _AppendFiltersForMSBuild( + filter_name, + source.contents, + rule_dependencies, + extension_to_rule_name, + platforms, + filter_group, + source_group, + ) + else: + # It's a source. Create a source entry. + _, element = _MapFileToMsBuildSourceType( + source, rule_dependencies, extension_to_rule_name, platforms + ) + source_entry = [element, {"Include": source}] + # Specify the filter it is part of, if any. + if parent_filter_name: + source_entry.append(["Filter", parent_filter_name]) + source_group.append(source_entry) + + +def _MapFileToMsBuildSourceType( + source, rule_dependencies, extension_to_rule_name, platforms +): + """Returns the group and element type of the source file. Arguments: source: The source file name. @@ -2128,84 +2328,93 @@ def _MapFileToMsBuildSourceType(source, rule_dependencies, Returns: A pair of (group this file should be part of, the label of element) """ - _, ext = os.path.splitext(source) - if ext in extension_to_rule_name: - group = 'rule' - element = extension_to_rule_name[ext] - elif ext in ['.cc', '.cpp', '.c', '.cxx', '.mm']: - group = 'compile' - element = 'ClCompile' - elif ext in ['.h', '.hxx']: - group = 'include' - element = 'ClInclude' - elif ext == '.rc': - group = 'resource' - element = 'ResourceCompile' - elif ext == '.asm': - group = 'masm' - element = 'MASM' - for platform in platforms: - if platform.lower() in ['arm', 'arm64']: - element = 'MARMASM' - elif ext == '.idl': - group = 'midl' - element = 'Midl' - elif source in rule_dependencies: - group = 'rule_dependency' - element = 'CustomBuild' - else: - group = 'none' - element = 'None' - return (group, element) - - -def _GenerateRulesForMSBuild(output_dir, options, spec, - sources, excluded_sources, - props_files_of_rules, targets_files_of_rules, - actions_to_add, rule_dependencies, - extension_to_rule_name): - # MSBuild rules are implemented using three files: an XML file, a .targets - # file and a .props file. - # See http://blogs.msdn.com/b/vcblog/archive/2010/04/21/quick-help-on-vs2010-custom-build-rule.aspx - # for more details. - rules = spec.get('rules', []) - rules_native = [r for r in rules if not int(r.get('msvs_external_rule', 0))] - rules_external = [r for r in rules if int(r.get('msvs_external_rule', 0))] - - msbuild_rules = [] - for rule in rules_native: - # Skip a rule with no action and no inputs. - if 'action' not in rule and not rule.get('rule_sources', []): - continue - msbuild_rule = MSBuildRule(rule, spec) - msbuild_rules.append(msbuild_rule) - rule_dependencies.update(msbuild_rule.additional_dependencies.split(';')) - extension_to_rule_name[msbuild_rule.extension] = msbuild_rule.rule_name - if msbuild_rules: - base = spec['target_name'] + options.suffix - props_name = base + '.props' - targets_name = base + '.targets' - xml_name = base + '.xml' - - props_files_of_rules.add(props_name) - targets_files_of_rules.add(targets_name) - - props_path = os.path.join(output_dir, props_name) - targets_path = os.path.join(output_dir, targets_name) - xml_path = os.path.join(output_dir, xml_name) - - _GenerateMSBuildRulePropsFile(props_path, msbuild_rules) - _GenerateMSBuildRuleTargetsFile(targets_path, msbuild_rules) - _GenerateMSBuildRuleXmlFile(xml_path, msbuild_rules) - - if rules_external: - _GenerateExternalRules(rules_external, output_dir, spec, - sources, options, actions_to_add) - _AdjustSourcesForRules(rules, sources, excluded_sources, True) + _, ext = os.path.splitext(source) + ext = ext.lower() + if ext in extension_to_rule_name: + group = "rule" + element = extension_to_rule_name[ext] + elif ext in [".cc", ".cpp", ".c", ".cxx", ".mm"]: + group = "compile" + element = "ClCompile" + elif ext in [".h", ".hxx"]: + group = "include" + element = "ClInclude" + elif ext == ".rc": + group = "resource" + element = "ResourceCompile" + elif ext in [".s", ".asm"]: + group = "masm" + element = "MASM" + for platform in platforms: + if platform.lower() in ["arm", "arm64"]: + element = "MARMASM" + elif ext == ".idl": + group = "midl" + element = "Midl" + elif source in rule_dependencies: + group = "rule_dependency" + element = "CustomBuild" + else: + group = "none" + element = "None" + return (group, element) + + +def _GenerateRulesForMSBuild( + output_dir, + options, + spec, + sources, + excluded_sources, + props_files_of_rules, + targets_files_of_rules, + actions_to_add, + rule_dependencies, + extension_to_rule_name, +): + # MSBuild rules are implemented using three files: an XML file, a .targets + # file and a .props file. + # See http://blogs.msdn.com/b/vcblog/archive/2010/04/21/quick-help-on-vs2010-custom-build-rule.aspx + # for more details. + rules = spec.get("rules", []) + rules_native = [r for r in rules if not int(r.get("msvs_external_rule", 0))] + rules_external = [r for r in rules if int(r.get("msvs_external_rule", 0))] + + msbuild_rules = [] + for rule in rules_native: + # Skip a rule with no action and no inputs. + if "action" not in rule and not rule.get("rule_sources", []): + continue + msbuild_rule = MSBuildRule(rule, spec) + msbuild_rules.append(msbuild_rule) + rule_dependencies.update(msbuild_rule.additional_dependencies.split(";")) + extension_to_rule_name[msbuild_rule.extension] = msbuild_rule.rule_name + if msbuild_rules: + base = spec["target_name"] + options.suffix + props_name = base + ".props" + targets_name = base + ".targets" + xml_name = base + ".xml" + + props_files_of_rules.add(props_name) + targets_files_of_rules.add(targets_name) + + props_path = os.path.join(output_dir, props_name) + targets_path = os.path.join(output_dir, targets_name) + xml_path = os.path.join(output_dir, xml_name) + + _GenerateMSBuildRulePropsFile(props_path, msbuild_rules) + _GenerateMSBuildRuleTargetsFile(targets_path, msbuild_rules) + _GenerateMSBuildRuleXmlFile(xml_path, msbuild_rules) + + if rules_external: + _GenerateExternalRules( + rules_external, output_dir, spec, sources, options, actions_to_add + ) + _AdjustSourcesForRules(rules, sources, excluded_sources, True) class MSBuildRule(object): - """Used to store information used to generate an MSBuild rule. + """Used to store information used to generate an MSBuild rule. Attributes: rule_name: The rule name, sanitized to use in XML. @@ -2224,708 +2433,844 @@ class MSBuildRule(object): command: The command used to run the rule. """ - def __init__(self, rule, spec): - self.display_name = rule['rule_name'] - # Assure that the rule name is only characters and numbers - self.rule_name = re.sub(r'\W', '_', self.display_name) - # Create the various element names, following the example set by the - # Visual Studio 2008 to 2010 conversion. I don't know if VS2010 - # is sensitive to the exact names. - self.target_name = '_' + self.rule_name - self.after_targets = self.rule_name + 'AfterTargets' - self.before_targets = self.rule_name + 'BeforeTargets' - self.depends_on = self.rule_name + 'DependsOn' - self.compute_output = 'Compute%sOutput' % self.rule_name - self.dirs_to_make = self.rule_name + 'DirsToMake' - self.inputs = self.rule_name + '_inputs' - self.tlog = self.rule_name + '_tlog' - self.extension = rule['extension'] - if not self.extension.startswith('.'): - self.extension = '.' + self.extension - - self.description = MSVSSettings.ConvertVCMacrosToMSBuild( - rule.get('message', self.rule_name)) - old_additional_dependencies = _FixPaths(rule.get('inputs', [])) - self.additional_dependencies = ( - ';'.join([MSVSSettings.ConvertVCMacrosToMSBuild(i) - for i in old_additional_dependencies])) - old_outputs = _FixPaths(rule.get('outputs', [])) - self.outputs = ';'.join([MSVSSettings.ConvertVCMacrosToMSBuild(i) - for i in old_outputs]) - old_command = _BuildCommandLineForRule(spec, rule, has_input_path=True, - do_setup_env=True) - self.command = MSVSSettings.ConvertVCMacrosToMSBuild(old_command) + def __init__(self, rule, spec): + self.display_name = rule["rule_name"] + # Assure that the rule name is only characters and numbers + self.rule_name = re.sub(r"\W", "_", self.display_name) + # Create the various element names, following the example set by the + # Visual Studio 2008 to 2010 conversion. I don't know if VS2010 + # is sensitive to the exact names. + self.target_name = "_" + self.rule_name + self.after_targets = self.rule_name + "AfterTargets" + self.before_targets = self.rule_name + "BeforeTargets" + self.depends_on = self.rule_name + "DependsOn" + self.compute_output = "Compute%sOutput" % self.rule_name + self.dirs_to_make = self.rule_name + "DirsToMake" + self.inputs = self.rule_name + "_inputs" + self.tlog = self.rule_name + "_tlog" + self.extension = rule["extension"] + if not self.extension.startswith("."): + self.extension = "." + self.extension + + self.description = MSVSSettings.ConvertVCMacrosToMSBuild( + rule.get("message", self.rule_name) + ) + old_additional_dependencies = _FixPaths(rule.get("inputs", [])) + self.additional_dependencies = ";".join( + [ + MSVSSettings.ConvertVCMacrosToMSBuild(i) + for i in old_additional_dependencies + ] + ) + old_outputs = _FixPaths(rule.get("outputs", [])) + self.outputs = ";".join( + [MSVSSettings.ConvertVCMacrosToMSBuild(i) for i in old_outputs] + ) + old_command = _BuildCommandLineForRule( + spec, rule, has_input_path=True, do_setup_env=True + ) + self.command = MSVSSettings.ConvertVCMacrosToMSBuild(old_command) def _GenerateMSBuildRulePropsFile(props_path, msbuild_rules): - """Generate the .props file.""" - content = ['Project', - {'xmlns': 'http://schemas.microsoft.com/developer/msbuild/2003'}] - for rule in msbuild_rules: - content.extend([ - ['PropertyGroup', - {'Condition': "'$(%s)' == '' and '$(%s)' == '' and " - "'$(ConfigurationType)' != 'Makefile'" % (rule.before_targets, - rule.after_targets) - }, - [rule.before_targets, 'Midl'], - [rule.after_targets, 'CustomBuild'], - ], - ['PropertyGroup', - [rule.depends_on, - {'Condition': "'$(ConfigurationType)' != 'Makefile'"}, - '_SelectedFiles;$(%s)' % rule.depends_on - ], - ], - ['ItemDefinitionGroup', - [rule.rule_name, - ['CommandLineTemplate', rule.command], - ['Outputs', rule.outputs], - ['ExecutionDescription', rule.description], - ['AdditionalDependencies', rule.additional_dependencies], - ], - ] - ]) - easy_xml.WriteXmlIfChanged(content, props_path, pretty=True, win32=True) + """Generate the .props file.""" + content = [ + "Project", + {"xmlns": "http://schemas.microsoft.com/developer/msbuild/2003"}, + ] + for rule in msbuild_rules: + content.extend( + [ + [ + "PropertyGroup", + { + "Condition": "'$(%s)' == '' and '$(%s)' == '' and " + "'$(ConfigurationType)' != 'Makefile'" + % (rule.before_targets, rule.after_targets) + }, + [rule.before_targets, "Midl"], + [rule.after_targets, "CustomBuild"], + ], + [ + "PropertyGroup", + [ + rule.depends_on, + {"Condition": "'$(ConfigurationType)' != 'Makefile'"}, + "_SelectedFiles;$(%s)" % rule.depends_on, + ], + ], + [ + "ItemDefinitionGroup", + [ + rule.rule_name, + ["CommandLineTemplate", rule.command], + ["Outputs", rule.outputs], + ["ExecutionDescription", rule.description], + ["AdditionalDependencies", rule.additional_dependencies], + ], + ], + ] + ) + easy_xml.WriteXmlIfChanged(content, props_path, pretty=True, win32=True) def _GenerateMSBuildRuleTargetsFile(targets_path, msbuild_rules): - """Generate the .targets file.""" - content = ['Project', - {'xmlns': 'http://schemas.microsoft.com/developer/msbuild/2003' - } - ] - item_group = [ - 'ItemGroup', - ['PropertyPageSchema', - {'Include': '$(MSBuildThisFileDirectory)$(MSBuildThisFileName).xml'} - ] - ] - for rule in msbuild_rules: - item_group.append( - ['AvailableItemName', - {'Include': rule.rule_name}, - ['Targets', rule.target_name], - ]) - content.append(item_group) - - for rule in msbuild_rules: - content.append( - ['UsingTask', - {'TaskName': rule.rule_name, - 'TaskFactory': 'XamlTaskFactory', - 'AssemblyName': 'Microsoft.Build.Tasks.v4.0' - }, - ['Task', '$(MSBuildThisFileDirectory)$(MSBuildThisFileName).xml'], - ]) - for rule in msbuild_rules: - rule_name = rule.rule_name - target_outputs = '%%(%s.Outputs)' % rule_name - target_inputs = ('%%(%s.Identity);%%(%s.AdditionalDependencies);' - '$(MSBuildProjectFile)') % (rule_name, rule_name) - rule_inputs = '%%(%s.Identity)' % rule_name - extension_condition = ("'%(Extension)'=='.obj' or " - "'%(Extension)'=='.res' or " - "'%(Extension)'=='.rsc' or " - "'%(Extension)'=='.lib'") - remove_section = [ - 'ItemGroup', - {'Condition': "'@(SelectedFiles)' != ''"}, - [rule_name, - {'Remove': '@(%s)' % rule_name, - 'Condition': "'%(Identity)' != '@(SelectedFiles)'" - } - ] - ] - inputs_section = [ - 'ItemGroup', - [rule.inputs, {'Include': '%%(%s.AdditionalDependencies)' % rule_name}] + """Generate the .targets file.""" + content = [ + "Project", + {"xmlns": "http://schemas.microsoft.com/developer/msbuild/2003"}, ] - logging_section = [ - 'ItemGroup', - [rule.tlog, - {'Include': '%%(%s.Outputs)' % rule_name, - 'Condition': ("'%%(%s.Outputs)' != '' and " - "'%%(%s.ExcludedFromBuild)' != 'true'" % - (rule_name, rule_name)) - }, - ['Source', "@(%s, '|')" % rule_name], - ['Inputs', "@(%s -> '%%(Fullpath)', ';')" % rule.inputs], + item_group = [ + "ItemGroup", + [ + "PropertyPageSchema", + {"Include": "$(MSBuildThisFileDirectory)$(MSBuildThisFileName).xml"}, ], ] - message_section = [ - 'Message', - {'Importance': 'High', - 'Text': '%%(%s.ExecutionDescription)' % rule_name - } - ] - write_tlog_section = [ - 'WriteLinesToFile', - {'Condition': "'@(%s)' != '' and '%%(%s.ExcludedFromBuild)' != " - "'true'" % (rule.tlog, rule.tlog), - 'File': '$(IntDir)$(ProjectName).write.1.tlog', - 'Lines': "^%%(%s.Source);@(%s->'%%(Fullpath)')" % (rule.tlog, - rule.tlog) - } - ] - read_tlog_section = [ - 'WriteLinesToFile', - {'Condition': "'@(%s)' != '' and '%%(%s.ExcludedFromBuild)' != " - "'true'" % (rule.tlog, rule.tlog), - 'File': '$(IntDir)$(ProjectName).read.1.tlog', - 'Lines': "^%%(%s.Source);%%(%s.Inputs)" % (rule.tlog, rule.tlog) - } - ] - command_and_input_section = [ - rule_name, - {'Condition': "'@(%s)' != '' and '%%(%s.ExcludedFromBuild)' != " - "'true'" % (rule_name, rule_name), - 'EchoOff': 'true', - 'StandardOutputImportance': 'High', - 'StandardErrorImportance': 'High', - 'CommandLineTemplate': '%%(%s.CommandLineTemplate)' % rule_name, - 'AdditionalOptions': '%%(%s.AdditionalOptions)' % rule_name, - 'Inputs': rule_inputs - } - ] - content.extend([ - ['Target', - {'Name': rule.target_name, - 'BeforeTargets': '$(%s)' % rule.before_targets, - 'AfterTargets': '$(%s)' % rule.after_targets, - 'Condition': "'@(%s)' != ''" % rule_name, - 'DependsOnTargets': '$(%s);%s' % (rule.depends_on, - rule.compute_output), - 'Outputs': target_outputs, - 'Inputs': target_inputs - }, - remove_section, - inputs_section, - logging_section, - message_section, - write_tlog_section, - read_tlog_section, - command_and_input_section, - ], - ['PropertyGroup', - ['ComputeLinkInputsTargets', - '$(ComputeLinkInputsTargets);', - '%s;' % rule.compute_output - ], - ['ComputeLibInputsTargets', - '$(ComputeLibInputsTargets);', - '%s;' % rule.compute_output - ], - ], - ['Target', - {'Name': rule.compute_output, - 'Condition': "'@(%s)' != ''" % rule_name - }, - ['ItemGroup', - [rule.dirs_to_make, - {'Condition': "'@(%s)' != '' and " - "'%%(%s.ExcludedFromBuild)' != 'true'" % (rule_name, rule_name), - 'Include': '%%(%s.Outputs)' % rule_name - } - ], - ['Link', - {'Include': '%%(%s.Identity)' % rule.dirs_to_make, - 'Condition': extension_condition - } - ], - ['Lib', - {'Include': '%%(%s.Identity)' % rule.dirs_to_make, - 'Condition': extension_condition - } - ], - ['ImpLib', - {'Include': '%%(%s.Identity)' % rule.dirs_to_make, - 'Condition': extension_condition - } - ], - ], - ['MakeDir', - {'Directories': ("@(%s->'%%(RootDir)%%(Directory)')" % - rule.dirs_to_make) - } - ] - ], - ]) - easy_xml.WriteXmlIfChanged(content, targets_path, pretty=True, win32=True) + for rule in msbuild_rules: + item_group.append( + [ + "AvailableItemName", + {"Include": rule.rule_name}, + ["Targets", rule.target_name], + ] + ) + content.append(item_group) + + for rule in msbuild_rules: + content.append( + [ + "UsingTask", + { + "TaskName": rule.rule_name, + "TaskFactory": "XamlTaskFactory", + "AssemblyName": "Microsoft.Build.Tasks.v4.0", + }, + ["Task", "$(MSBuildThisFileDirectory)$(MSBuildThisFileName).xml"], + ] + ) + for rule in msbuild_rules: + rule_name = rule.rule_name + target_outputs = "%%(%s.Outputs)" % rule_name + target_inputs = ( + "%%(%s.Identity);%%(%s.AdditionalDependencies);" "$(MSBuildProjectFile)" + ) % (rule_name, rule_name) + rule_inputs = "%%(%s.Identity)" % rule_name + extension_condition = ( + "'%(Extension)'=='.obj' or " + "'%(Extension)'=='.res' or " + "'%(Extension)'=='.rsc' or " + "'%(Extension)'=='.lib'" + ) + remove_section = [ + "ItemGroup", + {"Condition": "'@(SelectedFiles)' != ''"}, + [ + rule_name, + { + "Remove": "@(%s)" % rule_name, + "Condition": "'%(Identity)' != '@(SelectedFiles)'", + }, + ], + ] + inputs_section = [ + "ItemGroup", + [rule.inputs, {"Include": "%%(%s.AdditionalDependencies)" % rule_name}], + ] + logging_section = [ + "ItemGroup", + [ + rule.tlog, + { + "Include": "%%(%s.Outputs)" % rule_name, + "Condition": ( + "'%%(%s.Outputs)' != '' and " + "'%%(%s.ExcludedFromBuild)' != 'true'" % (rule_name, rule_name) + ), + }, + ["Source", "@(%s, '|')" % rule_name], + ["Inputs", "@(%s -> '%%(Fullpath)', ';')" % rule.inputs], + ], + ] + message_section = [ + "Message", + {"Importance": "High", "Text": "%%(%s.ExecutionDescription)" % rule_name}, + ] + write_tlog_section = [ + "WriteLinesToFile", + { + "Condition": "'@(%s)' != '' and '%%(%s.ExcludedFromBuild)' != " + "'true'" % (rule.tlog, rule.tlog), + "File": "$(IntDir)$(ProjectName).write.1.tlog", + "Lines": "^%%(%s.Source);@(%s->'%%(Fullpath)')" + % (rule.tlog, rule.tlog), + }, + ] + read_tlog_section = [ + "WriteLinesToFile", + { + "Condition": "'@(%s)' != '' and '%%(%s.ExcludedFromBuild)' != " + "'true'" % (rule.tlog, rule.tlog), + "File": "$(IntDir)$(ProjectName).read.1.tlog", + "Lines": "^%%(%s.Source);%%(%s.Inputs)" % (rule.tlog, rule.tlog), + }, + ] + command_and_input_section = [ + rule_name, + { + "Condition": "'@(%s)' != '' and '%%(%s.ExcludedFromBuild)' != " + "'true'" % (rule_name, rule_name), + "EchoOff": "true", + "StandardOutputImportance": "High", + "StandardErrorImportance": "High", + "CommandLineTemplate": "%%(%s.CommandLineTemplate)" % rule_name, + "AdditionalOptions": "%%(%s.AdditionalOptions)" % rule_name, + "Inputs": rule_inputs, + }, + ] + content.extend( + [ + [ + "Target", + { + "Name": rule.target_name, + "BeforeTargets": "$(%s)" % rule.before_targets, + "AfterTargets": "$(%s)" % rule.after_targets, + "Condition": "'@(%s)' != ''" % rule_name, + "DependsOnTargets": "$(%s);%s" + % (rule.depends_on, rule.compute_output), + "Outputs": target_outputs, + "Inputs": target_inputs, + }, + remove_section, + inputs_section, + logging_section, + message_section, + write_tlog_section, + read_tlog_section, + command_and_input_section, + ], + [ + "PropertyGroup", + [ + "ComputeLinkInputsTargets", + "$(ComputeLinkInputsTargets);", + "%s;" % rule.compute_output, + ], + [ + "ComputeLibInputsTargets", + "$(ComputeLibInputsTargets);", + "%s;" % rule.compute_output, + ], + ], + [ + "Target", + { + "Name": rule.compute_output, + "Condition": "'@(%s)' != ''" % rule_name, + }, + [ + "ItemGroup", + [ + rule.dirs_to_make, + { + "Condition": "'@(%s)' != '' and " + "'%%(%s.ExcludedFromBuild)' != 'true'" + % (rule_name, rule_name), + "Include": "%%(%s.Outputs)" % rule_name, + }, + ], + [ + "Link", + { + "Include": "%%(%s.Identity)" % rule.dirs_to_make, + "Condition": extension_condition, + }, + ], + [ + "Lib", + { + "Include": "%%(%s.Identity)" % rule.dirs_to_make, + "Condition": extension_condition, + }, + ], + [ + "ImpLib", + { + "Include": "%%(%s.Identity)" % rule.dirs_to_make, + "Condition": extension_condition, + }, + ], + ], + [ + "MakeDir", + { + "Directories": ( + "@(%s->'%%(RootDir)%%(Directory)')" % rule.dirs_to_make + ) + }, + ], + ], + ] + ) + easy_xml.WriteXmlIfChanged(content, targets_path, pretty=True, win32=True) def _GenerateMSBuildRuleXmlFile(xml_path, msbuild_rules): - # Generate the .xml file - content = [ - 'ProjectSchemaDefinitions', - {'xmlns': ('clr-namespace:Microsoft.Build.Framework.XamlTypes;' - 'assembly=Microsoft.Build.Framework'), - 'xmlns:x': 'http://schemas.microsoft.com/winfx/2006/xaml', - 'xmlns:sys': 'clr-namespace:System;assembly=mscorlib', - 'xmlns:transformCallback': - 'Microsoft.Cpp.Dev10.ConvertPropertyCallback' - } - ] - for rule in msbuild_rules: - content.extend([ - ['Rule', - {'Name': rule.rule_name, - 'PageTemplate': 'tool', - 'DisplayName': rule.display_name, - 'Order': '200' - }, - ['Rule.DataSource', - ['DataSource', - {'Persistence': 'ProjectFile', - 'ItemType': rule.rule_name - } - ] - ], - ['Rule.Categories', - ['Category', - {'Name': 'General'}, - ['Category.DisplayName', - ['sys:String', 'General'], - ], - ], - ['Category', - {'Name': 'Command Line', - 'Subtype': 'CommandLine' - }, - ['Category.DisplayName', - ['sys:String', 'Command Line'], - ], - ], - ], - ['StringListProperty', - {'Name': 'Inputs', - 'Category': 'Command Line', - 'IsRequired': 'true', - 'Switch': ' ' - }, - ['StringListProperty.DataSource', - ['DataSource', - {'Persistence': 'ProjectFile', - 'ItemType': rule.rule_name, - 'SourceType': 'Item' - } - ] - ], - ], - ['StringProperty', - {'Name': 'CommandLineTemplate', - 'DisplayName': 'Command Line', - 'Visible': 'False', - 'IncludeInCommandLine': 'False' - } - ], - ['DynamicEnumProperty', - {'Name': rule.before_targets, - 'Category': 'General', - 'EnumProvider': 'Targets', - 'IncludeInCommandLine': 'False' - }, - ['DynamicEnumProperty.DisplayName', - ['sys:String', 'Execute Before'], - ], - ['DynamicEnumProperty.Description', - ['sys:String', 'Specifies the targets for the build customization' - ' to run before.' - ], - ], - ['DynamicEnumProperty.ProviderSettings', - ['NameValuePair', - {'Name': 'Exclude', - 'Value': '^%s|^Compute' % rule.before_targets - } - ] - ], - ['DynamicEnumProperty.DataSource', - ['DataSource', - {'Persistence': 'ProjectFile', - 'HasConfigurationCondition': 'true' - } - ] - ], - ], - ['DynamicEnumProperty', - {'Name': rule.after_targets, - 'Category': 'General', - 'EnumProvider': 'Targets', - 'IncludeInCommandLine': 'False' - }, - ['DynamicEnumProperty.DisplayName', - ['sys:String', 'Execute After'], - ], - ['DynamicEnumProperty.Description', - ['sys:String', ('Specifies the targets for the build customization' - ' to run after.') - ], - ], - ['DynamicEnumProperty.ProviderSettings', - ['NameValuePair', - {'Name': 'Exclude', - 'Value': '^%s|^Compute' % rule.after_targets - } - ] - ], - ['DynamicEnumProperty.DataSource', - ['DataSource', - {'Persistence': 'ProjectFile', - 'ItemType': '', - 'HasConfigurationCondition': 'true' - } - ] - ], - ], - ['StringListProperty', - {'Name': 'Outputs', - 'DisplayName': 'Outputs', - 'Visible': 'False', - 'IncludeInCommandLine': 'False' - } - ], - ['StringProperty', - {'Name': 'ExecutionDescription', - 'DisplayName': 'Execution Description', - 'Visible': 'False', - 'IncludeInCommandLine': 'False' - } - ], - ['StringListProperty', - {'Name': 'AdditionalDependencies', - 'DisplayName': 'Additional Dependencies', - 'IncludeInCommandLine': 'False', - 'Visible': 'false' - } - ], - ['StringProperty', - {'Subtype': 'AdditionalOptions', - 'Name': 'AdditionalOptions', - 'Category': 'Command Line' - }, - ['StringProperty.DisplayName', - ['sys:String', 'Additional Options'], - ], - ['StringProperty.Description', - ['sys:String', 'Additional Options'], - ], - ], - ], - ['ItemType', - {'Name': rule.rule_name, - 'DisplayName': rule.display_name - } - ], - ['FileExtension', - {'Name': '*' + rule.extension, - 'ContentType': rule.rule_name - } - ], - ['ContentType', - {'Name': rule.rule_name, - 'DisplayName': '', - 'ItemType': rule.rule_name - } + # Generate the .xml file + content = [ + "ProjectSchemaDefinitions", + { + "xmlns": ( + "clr-namespace:Microsoft.Build.Framework.XamlTypes;" + "assembly=Microsoft.Build.Framework" + ), + "xmlns:x": "http://schemas.microsoft.com/winfx/2006/xaml", + "xmlns:sys": "clr-namespace:System;assembly=mscorlib", + "xmlns:transformCallback": "Microsoft.Cpp.Dev10.ConvertPropertyCallback", + }, + ] + for rule in msbuild_rules: + content.extend( + [ + [ + "Rule", + { + "Name": rule.rule_name, + "PageTemplate": "tool", + "DisplayName": rule.display_name, + "Order": "200", + }, + [ + "Rule.DataSource", + [ + "DataSource", + {"Persistence": "ProjectFile", "ItemType": rule.rule_name}, + ], + ], + [ + "Rule.Categories", + [ + "Category", + {"Name": "General"}, + ["Category.DisplayName", ["sys:String", "General"]], + ], + [ + "Category", + {"Name": "Command Line", "Subtype": "CommandLine"}, + ["Category.DisplayName", ["sys:String", "Command Line"]], + ], + ], + [ + "StringListProperty", + { + "Name": "Inputs", + "Category": "Command Line", + "IsRequired": "true", + "Switch": " ", + }, + [ + "StringListProperty.DataSource", + [ + "DataSource", + { + "Persistence": "ProjectFile", + "ItemType": rule.rule_name, + "SourceType": "Item", + }, + ], + ], + ], + [ + "StringProperty", + { + "Name": "CommandLineTemplate", + "DisplayName": "Command Line", + "Visible": "False", + "IncludeInCommandLine": "False", + }, + ], + [ + "DynamicEnumProperty", + { + "Name": rule.before_targets, + "Category": "General", + "EnumProvider": "Targets", + "IncludeInCommandLine": "False", + }, + [ + "DynamicEnumProperty.DisplayName", + ["sys:String", "Execute Before"], + ], + [ + "DynamicEnumProperty.Description", + [ + "sys:String", + "Specifies the targets for the build customization" + " to run before.", + ], + ], + [ + "DynamicEnumProperty.ProviderSettings", + [ + "NameValuePair", + { + "Name": "Exclude", + "Value": "^%s|^Compute" % rule.before_targets, + }, + ], + ], + [ + "DynamicEnumProperty.DataSource", + [ + "DataSource", + { + "Persistence": "ProjectFile", + "HasConfigurationCondition": "true", + }, + ], + ], + ], + [ + "DynamicEnumProperty", + { + "Name": rule.after_targets, + "Category": "General", + "EnumProvider": "Targets", + "IncludeInCommandLine": "False", + }, + [ + "DynamicEnumProperty.DisplayName", + ["sys:String", "Execute After"], + ], + [ + "DynamicEnumProperty.Description", + [ + "sys:String", + ( + "Specifies the targets for the build customization" + " to run after." + ), + ], + ], + [ + "DynamicEnumProperty.ProviderSettings", + [ + "NameValuePair", + { + "Name": "Exclude", + "Value": "^%s|^Compute" % rule.after_targets, + }, + ], + ], + [ + "DynamicEnumProperty.DataSource", + [ + "DataSource", + { + "Persistence": "ProjectFile", + "ItemType": "", + "HasConfigurationCondition": "true", + }, + ], + ], + ], + [ + "StringListProperty", + { + "Name": "Outputs", + "DisplayName": "Outputs", + "Visible": "False", + "IncludeInCommandLine": "False", + }, + ], + [ + "StringProperty", + { + "Name": "ExecutionDescription", + "DisplayName": "Execution Description", + "Visible": "False", + "IncludeInCommandLine": "False", + }, + ], + [ + "StringListProperty", + { + "Name": "AdditionalDependencies", + "DisplayName": "Additional Dependencies", + "IncludeInCommandLine": "False", + "Visible": "false", + }, + ], + [ + "StringProperty", + { + "Subtype": "AdditionalOptions", + "Name": "AdditionalOptions", + "Category": "Command Line", + }, + [ + "StringProperty.DisplayName", + ["sys:String", "Additional Options"], + ], + [ + "StringProperty.Description", + ["sys:String", "Additional Options"], + ], + ], + ], + [ + "ItemType", + {"Name": rule.rule_name, "DisplayName": rule.display_name}, + ], + [ + "FileExtension", + {"Name": "*" + rule.extension, "ContentType": rule.rule_name}, + ], + [ + "ContentType", + { + "Name": rule.rule_name, + "DisplayName": "", + "ItemType": rule.rule_name, + }, + ], + ] + ) + easy_xml.WriteXmlIfChanged(content, xml_path, pretty=True, win32=True) + + +def _GetConfigurationAndPlatform(name, settings, spec): + configuration = name.rsplit("_", 1)[0] + platform = settings.get("msvs_configuration_platform", "Win32") + if spec["toolset"] == "host" and platform == "arm64": + platform = "x64" # Host-only tools are always built for x64 + return (configuration, platform) + + +def _GetConfigurationCondition(name, settings, spec): + return r"'$(Configuration)|$(Platform)'=='%s|%s'" % _GetConfigurationAndPlatform( + name, settings, spec + ) + + +def _GetMSBuildProjectConfigurations(configurations, spec): + group = ["ItemGroup", {"Label": "ProjectConfigurations"}] + for (name, settings) in sorted(configurations.items()): + configuration, platform = _GetConfigurationAndPlatform(name, settings, spec) + designation = "%s|%s" % (configuration, platform) + group.append( + [ + "ProjectConfiguration", + {"Include": designation}, + ["Configuration", configuration], + ["Platform", platform], + ] + ) + return [group] + + +def _GetMSBuildGlobalProperties(spec, version, guid, gyp_file_name): + namespace = os.path.splitext(gyp_file_name)[0] + properties = [ + [ + "PropertyGroup", + {"Label": "Globals"}, + ["ProjectGuid", guid], + ["Keyword", "Win32Proj"], + ["RootNamespace", namespace], + ["IgnoreWarnCompileDuplicatedFilename", "true"], ] - ]) - easy_xml.WriteXmlIfChanged(content, xml_path, pretty=True, win32=True) - - -def _GetConfigurationAndPlatform(name, settings): - configuration = name.rsplit('_', 1)[0] - platform = settings.get('msvs_configuration_platform', 'Win32') - return (configuration, platform) - - -def _GetConfigurationCondition(name, settings): - return (r"'$(Configuration)|$(Platform)'=='%s|%s'" % - _GetConfigurationAndPlatform(name, settings)) - - -def _GetMSBuildProjectConfigurations(configurations): - group = ['ItemGroup', {'Label': 'ProjectConfigurations'}] - for (name, settings) in sorted(configurations.items()): - configuration, platform = _GetConfigurationAndPlatform(name, settings) - designation = '%s|%s' % (configuration, platform) - group.append( - ['ProjectConfiguration', {'Include': designation}, - ['Configuration', configuration], - ['Platform', platform]]) - return [group] - - -def _GetMSBuildGlobalProperties(spec, guid, gyp_file_name): - namespace = os.path.splitext(gyp_file_name)[0] - properties = [ - ['PropertyGroup', {'Label': 'Globals'}, - ['ProjectGuid', guid], - ['Keyword', 'Win32Proj'], - ['RootNamespace', namespace], - ['IgnoreWarnCompileDuplicatedFilename', 'true'], - ] ] - if os.environ.get('PROCESSOR_ARCHITECTURE') == 'AMD64' or \ - os.environ.get('PROCESSOR_ARCHITEW6432') == 'AMD64': - properties[0].append(['PreferredToolArchitecture', 'x64']) + if ( + os.environ.get("PROCESSOR_ARCHITECTURE") == "AMD64" + or os.environ.get("PROCESSOR_ARCHITEW6432") == "AMD64" + ): + properties[0].append(["PreferredToolArchitecture", "x64"]) + + if spec.get("msvs_target_platform_version"): + target_platform_version = spec.get("msvs_target_platform_version") + properties[0].append(["WindowsTargetPlatformVersion", target_platform_version]) + if spec.get("msvs_target_platform_minversion"): + target_platform_minversion = spec.get("msvs_target_platform_minversion") + properties[0].append( + ["WindowsTargetPlatformMinVersion", target_platform_minversion] + ) + else: + properties[0].append( + ["WindowsTargetPlatformMinVersion", target_platform_version] + ) + + if spec.get("msvs_enable_winrt"): + properties[0].append(["DefaultLanguage", "en-US"]) + properties[0].append(["AppContainerApplication", "true"]) + if spec.get("msvs_application_type_revision"): + app_type_revision = spec.get("msvs_application_type_revision") + properties[0].append(["ApplicationTypeRevision", app_type_revision]) + else: + properties[0].append(["ApplicationTypeRevision", "8.1"]) + if spec.get("msvs_enable_winphone"): + properties[0].append(["ApplicationType", "Windows Phone"]) + else: + properties[0].append(["ApplicationType", "Windows Store"]) + + platform_name = None + msvs_windows_sdk_version = None + for configuration in spec["configurations"].values(): + platform_name = platform_name or _ConfigPlatform(configuration) + msvs_windows_sdk_version = ( + msvs_windows_sdk_version + or _ConfigWindowsTargetPlatformVersion(configuration, version) + ) + if platform_name and msvs_windows_sdk_version: + break + if msvs_windows_sdk_version: + properties[0].append( + ["WindowsTargetPlatformVersion", str(msvs_windows_sdk_version)] + ) + elif version.compatible_sdks: + raise GypError( + "%s requires any SDK of %s version, but none were found" + % (version.description, version.compatible_sdks) + ) + + if platform_name == "ARM": + properties[0].append(["WindowsSDKDesktopARMSupport", "true"]) + + return properties - if spec.get('msvs_enable_winrt'): - properties[0].append(['DefaultLanguage', 'en-US']) - properties[0].append(['AppContainerApplication', 'true']) - if spec.get('msvs_application_type_revision'): - app_type_revision = spec.get('msvs_application_type_revision') - properties[0].append(['ApplicationTypeRevision', app_type_revision]) - else: - properties[0].append(['ApplicationTypeRevision', '8.1']) - - if spec.get('msvs_target_platform_version'): - target_platform_version = spec.get('msvs_target_platform_version') - properties[0].append(['WindowsTargetPlatformVersion', - target_platform_version]) - if spec.get('msvs_target_platform_minversion'): - target_platform_minversion = spec.get('msvs_target_platform_minversion') - properties[0].append(['WindowsTargetPlatformMinVersion', - target_platform_minversion]) - else: - properties[0].append(['WindowsTargetPlatformMinVersion', - target_platform_version]) - if spec.get('msvs_enable_winphone'): - properties[0].append(['ApplicationType', 'Windows Phone']) - else: - properties[0].append(['ApplicationType', 'Windows Store']) - - platform_name = None - msvs_windows_target_platform_version = None - for configuration in spec['configurations'].values(): - platform_name = platform_name or _ConfigPlatform(configuration) - msvs_windows_target_platform_version = \ - msvs_windows_target_platform_version or \ - _ConfigWindowsTargetPlatformVersion(configuration) - if platform_name and msvs_windows_target_platform_version: - break - - if platform_name == 'ARM': - properties[0].append(['WindowsSDKDesktopARMSupport', 'true']) - if msvs_windows_target_platform_version: - properties[0].append(['WindowsTargetPlatformVersion', \ - str(msvs_windows_target_platform_version)]) - - return properties def _GetMSBuildConfigurationDetails(spec, build_file): - properties = {} - for name, settings in spec['configurations'].items(): - msbuild_attributes = _GetMSBuildAttributes(spec, settings, build_file) - condition = _GetConfigurationCondition(name, settings) - character_set = msbuild_attributes.get('CharacterSet') - _AddConditionalProperty(properties, condition, 'ConfigurationType', - msbuild_attributes['ConfigurationType']) - if character_set: - if 'msvs_enable_winrt' not in spec : - _AddConditionalProperty(properties, condition, 'CharacterSet', - character_set) - return _GetMSBuildPropertyGroup(spec, 'Configuration', properties) + properties = {} + for name, settings in spec["configurations"].items(): + msbuild_attributes = _GetMSBuildAttributes(spec, settings, build_file) + condition = _GetConfigurationCondition(name, settings, spec) + character_set = msbuild_attributes.get("CharacterSet") + config_type = msbuild_attributes.get("ConfigurationType") + _AddConditionalProperty(properties, condition, "ConfigurationType", config_type) + if config_type == "Driver": + _AddConditionalProperty(properties, condition, "DriverType", "WDM") + _AddConditionalProperty( + properties, condition, "TargetVersion", _ConfigTargetVersion(settings) + ) + if character_set: + if "msvs_enable_winrt" not in spec: + _AddConditionalProperty( + properties, condition, "CharacterSet", character_set + ) + return _GetMSBuildPropertyGroup(spec, "Configuration", properties) def _GetMSBuildLocalProperties(msbuild_toolset): - # Currently the only local property we support is PlatformToolset - properties = {} - if msbuild_toolset: - properties = [ - ['PropertyGroup', {'Label': 'Locals'}, - ['PlatformToolset', msbuild_toolset], - ] - ] - return properties - - -def _GetMSBuildPropertySheets(configurations): - user_props = r'$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props' - additional_props = {} - props_specified = False - for name, settings in sorted(configurations.items()): - configuration = _GetConfigurationCondition(name, settings) - if 'msbuild_props' in settings: - additional_props[configuration] = _FixPaths(settings['msbuild_props']) - props_specified = True - else: - additional_props[configuration] = '' - - if not props_specified: - return [ - ['ImportGroup', - {'Label': 'PropertySheets'}, - ['Import', - {'Project': user_props, - 'Condition': "exists('%s')" % user_props, - 'Label': 'LocalAppDataPlatform' - } - ] + # Currently the only local property we support is PlatformToolset + properties = {} + if msbuild_toolset: + properties = [ + [ + "PropertyGroup", + {"Label": "Locals"}, + ["PlatformToolset", msbuild_toolset], + ] ] - ] - else: - sheets = [] - for condition, props in additional_props.items(): - import_group = [ - 'ImportGroup', - {'Label': 'PropertySheets', - 'Condition': condition - }, - ['Import', - {'Project': user_props, - 'Condition': "exists('%s')" % user_props, - 'Label': 'LocalAppDataPlatform' - } + return properties + + +def _GetMSBuildPropertySheets(configurations, spec): + user_props = r"$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" + additional_props = {} + props_specified = False + for name, settings in sorted(configurations.items()): + configuration = _GetConfigurationCondition(name, settings, spec) + if "msbuild_props" in settings: + additional_props[configuration] = _FixPaths(settings["msbuild_props"]) + props_specified = True + else: + additional_props[configuration] = "" + + if not props_specified: + return [ + [ + "ImportGroup", + {"Label": "PropertySheets"}, + [ + "Import", + { + "Project": user_props, + "Condition": "exists('%s')" % user_props, + "Label": "LocalAppDataPlatform", + }, + ], + ] ] - ] - for props_file in props: - import_group.append(['Import', {'Project':props_file}]) - sheets.append(import_group) - return sheets + else: + sheets = [] + for condition, props in additional_props.items(): + import_group = [ + "ImportGroup", + {"Label": "PropertySheets", "Condition": condition}, + [ + "Import", + { + "Project": user_props, + "Condition": "exists('%s')" % user_props, + "Label": "LocalAppDataPlatform", + }, + ], + ] + for props_file in props: + import_group.append(["Import", {"Project": props_file}]) + sheets.append(import_group) + return sheets + def _ConvertMSVSBuildAttributes(spec, config, build_file): - config_type = _GetMSVSConfigurationType(spec, build_file) - msvs_attributes = _GetMSVSAttributes(spec, config, config_type) - msbuild_attributes = {} - for a in msvs_attributes: - if a in ['IntermediateDirectory', 'OutputDirectory']: - directory = MSVSSettings.ConvertVCMacrosToMSBuild(msvs_attributes[a]) - if not directory.endswith('\\'): - directory += '\\' - msbuild_attributes[a] = directory - elif a == 'CharacterSet': - msbuild_attributes[a] = _ConvertMSVSCharacterSet(msvs_attributes[a]) - elif a == 'ConfigurationType': - msbuild_attributes[a] = _ConvertMSVSConfigurationType(msvs_attributes[a]) - else: - print('Warning: Do not know how to convert MSVS attribute ' + a) - return msbuild_attributes + config_type = _GetMSVSConfigurationType(spec, build_file) + msvs_attributes = _GetMSVSAttributes(spec, config, config_type) + msbuild_attributes = {} + for a in msvs_attributes: + if a in ["IntermediateDirectory", "OutputDirectory"]: + directory = MSVSSettings.ConvertVCMacrosToMSBuild(msvs_attributes[a]) + if not directory.endswith("\\"): + directory += "\\" + msbuild_attributes[a] = directory + elif a == "CharacterSet": + msbuild_attributes[a] = _ConvertMSVSCharacterSet(msvs_attributes[a]) + elif a == "ConfigurationType": + msbuild_attributes[a] = _ConvertMSVSConfigurationType(msvs_attributes[a]) + else: + print("Warning: Do not know how to convert MSVS attribute " + a) + return msbuild_attributes def _ConvertMSVSCharacterSet(char_set): - if char_set.isdigit(): - char_set = { - '0': 'MultiByte', - '1': 'Unicode', - '2': 'MultiByte', - }[char_set] - return char_set + if char_set.isdigit(): + char_set = {"0": "MultiByte", "1": "Unicode", "2": "MultiByte"}[char_set] + return char_set def _ConvertMSVSConfigurationType(config_type): - if config_type.isdigit(): - config_type = { - '1': 'Application', - '2': 'DynamicLibrary', - '4': 'StaticLibrary', - '10': 'Utility' - }[config_type] - return config_type + if config_type.isdigit(): + config_type = { + "1": "Application", + "2": "DynamicLibrary", + "4": "StaticLibrary", + "5": "Driver", + "10": "Utility", + }[config_type] + return config_type def _GetMSBuildAttributes(spec, config, build_file): - if 'msbuild_configuration_attributes' not in config: - msbuild_attributes = _ConvertMSVSBuildAttributes(spec, config, build_file) + if "msbuild_configuration_attributes" not in config: + msbuild_attributes = _ConvertMSVSBuildAttributes(spec, config, build_file) - else: - config_type = _GetMSVSConfigurationType(spec, build_file) - config_type = _ConvertMSVSConfigurationType(config_type) - msbuild_attributes = config.get('msbuild_configuration_attributes', {}) - msbuild_attributes.setdefault('ConfigurationType', config_type) - output_dir = msbuild_attributes.get('OutputDirectory', - '$(SolutionDir)$(Configuration)') - msbuild_attributes['OutputDirectory'] = _FixPath(output_dir) + '\\' - if 'IntermediateDirectory' not in msbuild_attributes: - intermediate = _FixPath('$(Configuration)') + '\\' - msbuild_attributes['IntermediateDirectory'] = intermediate - if 'CharacterSet' in msbuild_attributes: - msbuild_attributes['CharacterSet'] = _ConvertMSVSCharacterSet( - msbuild_attributes['CharacterSet']) - if 'TargetName' not in msbuild_attributes: - prefix = spec.get('product_prefix', '') - product_name = spec.get('product_name', '$(ProjectName)') - target_name = prefix + product_name - msbuild_attributes['TargetName'] = target_name - if 'TargetExt' not in msbuild_attributes and 'product_extension' in spec: - ext = spec.get('product_extension') - msbuild_attributes['TargetExt'] = '.' + ext - - if spec.get('msvs_external_builder'): - external_out_dir = spec.get('msvs_external_builder_out_dir', '.') - msbuild_attributes['OutputDirectory'] = _FixPath(external_out_dir) + '\\' - - # Make sure that 'TargetPath' matches 'Lib.OutputFile' or 'Link.OutputFile' - # (depending on the tool used) to avoid MSB8012 warning. - msbuild_tool_map = { - 'executable': 'Link', - 'shared_library': 'Link', - 'loadable_module': 'Link', - 'static_library': 'Lib', - } - msbuild_tool = msbuild_tool_map.get(spec['type']) - if msbuild_tool: - msbuild_settings = config['finalized_msbuild_settings'] - out_file = msbuild_settings[msbuild_tool].get('OutputFile') - if out_file: - msbuild_attributes['TargetPath'] = _FixPath(out_file) - target_ext = msbuild_settings[msbuild_tool].get('TargetExt') - if target_ext: - msbuild_attributes['TargetExt'] = target_ext - - return msbuild_attributes + else: + config_type = _GetMSVSConfigurationType(spec, build_file) + config_type = _ConvertMSVSConfigurationType(config_type) + msbuild_attributes = config.get("msbuild_configuration_attributes", {}) + msbuild_attributes.setdefault("ConfigurationType", config_type) + output_dir = msbuild_attributes.get( + "OutputDirectory", "$(SolutionDir)$(Configuration)" + ) + msbuild_attributes["OutputDirectory"] = _FixPath(output_dir) + "\\" + if "IntermediateDirectory" not in msbuild_attributes: + intermediate = _FixPath("$(Configuration)") + "\\" + msbuild_attributes["IntermediateDirectory"] = intermediate + if "CharacterSet" in msbuild_attributes: + msbuild_attributes["CharacterSet"] = _ConvertMSVSCharacterSet( + msbuild_attributes["CharacterSet"] + ) + if "TargetName" not in msbuild_attributes: + prefix = spec.get("product_prefix", "") + product_name = spec.get("product_name", "$(ProjectName)") + target_name = prefix + product_name + msbuild_attributes["TargetName"] = target_name + if "TargetExt" not in msbuild_attributes and "product_extension" in spec: + ext = spec.get("product_extension") + msbuild_attributes["TargetExt"] = "." + ext + + if spec.get("msvs_external_builder"): + external_out_dir = spec.get("msvs_external_builder_out_dir", ".") + msbuild_attributes["OutputDirectory"] = _FixPath(external_out_dir) + "\\" + + # Make sure that 'TargetPath' matches 'Lib.OutputFile' or 'Link.OutputFile' + # (depending on the tool used) to avoid MSB8012 warning. + msbuild_tool_map = { + "executable": "Link", + "shared_library": "Link", + "loadable_module": "Link", + "windows_driver": "Link", + "static_library": "Lib", + } + msbuild_tool = msbuild_tool_map.get(spec["type"]) + if msbuild_tool: + msbuild_settings = config["finalized_msbuild_settings"] + out_file = msbuild_settings[msbuild_tool].get("OutputFile") + if out_file: + msbuild_attributes["TargetPath"] = _FixPath(out_file) + target_ext = msbuild_settings[msbuild_tool].get("TargetExt") + if target_ext: + msbuild_attributes["TargetExt"] = target_ext + + return msbuild_attributes def _GetMSBuildConfigurationGlobalProperties(spec, configurations, build_file): - # TODO(jeanluc) We could optimize out the following and do it only if - # there are actions. - # TODO(jeanluc) Handle the equivalent of setting 'CYGWIN=nontsec'. - new_paths = [] - cygwin_dirs = spec.get('msvs_cygwin_dirs', ['.'])[0] - if cygwin_dirs: - cyg_path = '$(MSBuildProjectDirectory)\\%s\\bin\\' % _FixPath(cygwin_dirs) - new_paths.append(cyg_path) - # TODO(jeanluc) Change the convention to have both a cygwin_dir and a - # python_dir. - python_path = cyg_path.replace('cygwin\\bin', 'python_26') - new_paths.append(python_path) - if new_paths: - new_paths = '$(ExecutablePath);' + ';'.join(new_paths) - - properties = {} - for (name, configuration) in sorted(configurations.items()): - condition = _GetConfigurationCondition(name, configuration) - attributes = _GetMSBuildAttributes(spec, configuration, build_file) - msbuild_settings = configuration['finalized_msbuild_settings'] - _AddConditionalProperty(properties, condition, 'IntDir', - attributes['IntermediateDirectory']) - _AddConditionalProperty(properties, condition, 'OutDir', - attributes['OutputDirectory']) - _AddConditionalProperty(properties, condition, 'TargetName', - attributes['TargetName']) - if 'TargetExt' in attributes: - _AddConditionalProperty(properties, condition, 'TargetExt', - attributes['TargetExt']) - - if attributes.get('TargetPath'): - _AddConditionalProperty(properties, condition, 'TargetPath', - attributes['TargetPath']) - if attributes.get('TargetExt'): - _AddConditionalProperty(properties, condition, 'TargetExt', - attributes['TargetExt']) - - if new_paths: - _AddConditionalProperty(properties, condition, 'ExecutablePath', - new_paths) - tool_settings = msbuild_settings.get('', {}) - for name, value in sorted(tool_settings.items()): - formatted_value = _GetValueFormattedForMSBuild('', name, value) - _AddConditionalProperty(properties, condition, name, formatted_value) - return _GetMSBuildPropertyGroup(spec, None, properties) + # TODO(jeanluc) We could optimize out the following and do it only if + # there are actions. + # TODO(jeanluc) Handle the equivalent of setting 'CYGWIN=nontsec'. + new_paths = [] + cygwin_dirs = spec.get("msvs_cygwin_dirs", ["."])[0] + if cygwin_dirs: + cyg_path = "$(MSBuildProjectDirectory)\\%s\\bin\\" % _FixPath(cygwin_dirs) + new_paths.append(cyg_path) + # TODO(jeanluc) Change the convention to have both a cygwin_dir and a + # python_dir. + python_path = cyg_path.replace("cygwin\\bin", "python_26") + new_paths.append(python_path) + if new_paths: + new_paths = "$(ExecutablePath);" + ";".join(new_paths) + + properties = {} + for (name, configuration) in sorted(configurations.items()): + condition = _GetConfigurationCondition(name, configuration, spec) + attributes = _GetMSBuildAttributes(spec, configuration, build_file) + msbuild_settings = configuration["finalized_msbuild_settings"] + _AddConditionalProperty( + properties, condition, "IntDir", attributes["IntermediateDirectory"] + ) + _AddConditionalProperty( + properties, condition, "OutDir", attributes["OutputDirectory"] + ) + _AddConditionalProperty( + properties, condition, "TargetName", attributes["TargetName"] + ) + if "TargetExt" in attributes: + _AddConditionalProperty( + properties, condition, "TargetExt", attributes["TargetExt"] + ) + + if attributes.get("TargetPath"): + _AddConditionalProperty( + properties, condition, "TargetPath", attributes["TargetPath"] + ) + if attributes.get("TargetExt"): + _AddConditionalProperty( + properties, condition, "TargetExt", attributes["TargetExt"] + ) + + if new_paths: + _AddConditionalProperty(properties, condition, "ExecutablePath", new_paths) + tool_settings = msbuild_settings.get("", {}) + for name, value in sorted(tool_settings.items()): + formatted_value = _GetValueFormattedForMSBuild("", name, value) + _AddConditionalProperty(properties, condition, name, formatted_value) + return _GetMSBuildPropertyGroup(spec, None, properties) def _AddConditionalProperty(properties, condition, name, value): - """Adds a property / conditional value pair to a dictionary. + """Adds a property / conditional value pair to a dictionary. Arguments: properties: The dictionary to be modified. The key is the name of the @@ -2935,21 +3280,21 @@ def _AddConditionalProperty(properties, condition, name, value): name: The name of the property. value: The value of the property. """ - if name not in properties: - properties[name] = {} - values = properties[name] - if value not in values: - values[value] = [] - conditions = values[value] - conditions.append(condition) + if name not in properties: + properties[name] = {} + values = properties[name] + if value not in values: + values[value] = [] + conditions = values[value] + conditions.append(condition) # Regex for msvs variable references ( i.e. $(FOO) ). -MSVS_VARIABLE_REFERENCE = re.compile(r'\$\(([a-zA-Z_][a-zA-Z0-9_]*)\)') +MSVS_VARIABLE_REFERENCE = re.compile(r"\$\(([a-zA-Z_][a-zA-Z0-9_]*)\)") def _GetMSBuildPropertyGroup(spec, label, properties): - """Returns a PropertyGroup definition for the specified properties. + """Returns a PropertyGroup definition for the specified properties. Arguments: spec: The target project dict. @@ -2958,191 +3303,215 @@ def _GetMSBuildPropertyGroup(spec, label, properties): property. The value is itself a dictionary; its key is the value and the value a list of condition for which this value is true. """ - group = ['PropertyGroup'] - if label: - group.append({'Label': label}) - num_configurations = len(spec['configurations']) - def GetEdges(node): - # Use a definition of edges such that user_of_variable -> used_varible. - # This happens to be easier in this case, since a variable's - # definition contains all variables it references in a single string. - edges = set() - for value in sorted(properties[node].keys()): - # Add to edges all $(...) references to variables. - # - # Variable references that refer to names not in properties are excluded - # These can exist for instance to refer built in definitions like - # $(SolutionDir). - # - # Self references are ignored. Self reference is used in a few places to - # append to the default value. I.e. PATH=$(PATH);other_path - edges.update(set([v for v in MSVS_VARIABLE_REFERENCE.findall(value) - if v in properties and v != node])) - return edges - properties_ordered = gyp.common.TopologicallySorted( - properties.keys(), GetEdges) - # Walk properties in the reverse of a topological sort on - # user_of_variable -> used_variable as this ensures variables are - # defined before they are used. - # NOTE: reverse(topsort(DAG)) = topsort(reverse_edges(DAG)) - for name in reversed(properties_ordered): - values = properties[name] - for value, conditions in sorted(values.items()): - if len(conditions) == num_configurations: - # If the value is the same all configurations, - # just add one unconditional entry. - group.append([name, value]) - else: - for condition in conditions: - group.append([name, {'Condition': condition}, value]) - return [group] + group = ["PropertyGroup"] + if label: + group.append({"Label": label}) + num_configurations = len(spec["configurations"]) + + def GetEdges(node): + # Use a definition of edges such that user_of_variable -> used_varible. + # This happens to be easier in this case, since a variable's + # definition contains all variables it references in a single string. + edges = set() + for value in sorted(properties[node].keys()): + # Add to edges all $(...) references to variables. + # + # Variable references that refer to names not in properties are excluded + # These can exist for instance to refer built in definitions like + # $(SolutionDir). + # + # Self references are ignored. Self reference is used in a few places to + # append to the default value. I.e. PATH=$(PATH);other_path + edges.update( + set( + [ + v + for v in MSVS_VARIABLE_REFERENCE.findall(value) + if v in properties and v != node + ] + ) + ) + return edges + + properties_ordered = gyp.common.TopologicallySorted(properties.keys(), GetEdges) + # Walk properties in the reverse of a topological sort on + # user_of_variable -> used_variable as this ensures variables are + # defined before they are used. + # NOTE: reverse(topsort(DAG)) = topsort(reverse_edges(DAG)) + for name in reversed(properties_ordered): + values = properties[name] + for value, conditions in sorted(values.items()): + if len(conditions) == num_configurations: + # If the value is the same all configurations, + # just add one unconditional entry. + group.append([name, value]) + else: + for condition in conditions: + group.append([name, {"Condition": condition}, value]) + return [group] def _GetMSBuildToolSettingsSections(spec, configurations): - groups = [] - for (name, configuration) in sorted(configurations.items()): - msbuild_settings = configuration['finalized_msbuild_settings'] - group = ['ItemDefinitionGroup', - {'Condition': _GetConfigurationCondition(name, configuration)} - ] - for tool_name, tool_settings in sorted(msbuild_settings.items()): - # Skip the tool named '' which is a holder of global settings handled - # by _GetMSBuildConfigurationGlobalProperties. - if tool_name: - if tool_settings: - tool = [tool_name] - for name, value in sorted(tool_settings.items()): - formatted_value = _GetValueFormattedForMSBuild(tool_name, name, - value) - tool.append([name, formatted_value]) - group.append(tool) - groups.append(group) - return groups + groups = [] + for (name, configuration) in sorted(configurations.items()): + msbuild_settings = configuration["finalized_msbuild_settings"] + group = [ + "ItemDefinitionGroup", + {"Condition": _GetConfigurationCondition(name, configuration, spec)}, + ] + for tool_name, tool_settings in sorted(msbuild_settings.items()): + # Skip the tool named '' which is a holder of global settings handled + # by _GetMSBuildConfigurationGlobalProperties. + if tool_name: + if tool_settings: + tool = [tool_name] + for name, value in sorted(tool_settings.items()): + formatted_value = _GetValueFormattedForMSBuild( + tool_name, name, value + ) + tool.append([name, formatted_value]) + group.append(tool) + groups.append(group) + return groups def _FinalizeMSBuildSettings(spec, configuration): - if 'msbuild_settings' in configuration: - converted = False - msbuild_settings = configuration['msbuild_settings'] - MSVSSettings.ValidateMSBuildSettings(msbuild_settings) - else: - converted = True - msvs_settings = configuration.get('msvs_settings', {}) - msbuild_settings = MSVSSettings.ConvertToMSBuildSettings(msvs_settings) - include_dirs, midl_include_dirs, resource_include_dirs = \ - _GetIncludeDirs(configuration) - libraries = _GetLibraries(spec) - library_dirs = _GetLibraryDirs(configuration) - out_file, _, msbuild_tool = _GetOutputFilePathAndTool(spec, msbuild=True) - target_ext = _GetOutputTargetExt(spec) - defines = _GetDefines(configuration) - if converted: - # Visual Studio 2010 has TR1 - defines = [d for d in defines if d != '_HAS_TR1=0'] - # Warn of ignored settings - ignored_settings = ['msvs_tool_files'] - for ignored_setting in ignored_settings: - value = configuration.get(ignored_setting) - if value: - print('Warning: The automatic conversion to MSBuild does not handle ' - '%s. Ignoring setting of %s' % (ignored_setting, str(value))) - - defines = [_EscapeCppDefineForMSBuild(d) for d in defines] - disabled_warnings = _GetDisabledWarnings(configuration) - prebuild = configuration.get('msvs_prebuild') - postbuild = configuration.get('msvs_postbuild') - def_file = _GetModuleDefinition(spec) - precompiled_header = configuration.get('msvs_precompiled_header') - - # Add the information to the appropriate tool - # TODO(jeanluc) We could optimize and generate these settings only if - # the corresponding files are found, e.g. don't generate ResourceCompile - # if you don't have any resources. - _ToolAppend(msbuild_settings, 'ClCompile', - 'AdditionalIncludeDirectories', include_dirs) - _ToolAppend(msbuild_settings, 'Midl', - 'AdditionalIncludeDirectories', midl_include_dirs) - _ToolAppend(msbuild_settings, 'ResourceCompile', - 'AdditionalIncludeDirectories', resource_include_dirs) - # Add in libraries, note that even for empty libraries, we want this - # set, to prevent inheriting default libraries from the environment. - _ToolSetOrAppend(msbuild_settings, 'Link', 'AdditionalDependencies', - libraries) - _ToolAppend(msbuild_settings, 'Link', 'AdditionalLibraryDirectories', - library_dirs) - if out_file: - _ToolAppend(msbuild_settings, msbuild_tool, 'OutputFile', out_file, - only_if_unset=True) - if target_ext: - _ToolAppend(msbuild_settings, msbuild_tool, 'TargetExt', target_ext, - only_if_unset=True) - # Add defines. - _ToolAppend(msbuild_settings, 'ClCompile', - 'PreprocessorDefinitions', defines) - _ToolAppend(msbuild_settings, 'ResourceCompile', - 'PreprocessorDefinitions', defines) - # Add disabled warnings. - _ToolAppend(msbuild_settings, 'ClCompile', - 'DisableSpecificWarnings', disabled_warnings) - # Turn on precompiled headers if appropriate. - if precompiled_header: - precompiled_header = os.path.split(precompiled_header)[1] - _ToolAppend(msbuild_settings, 'ClCompile', 'PrecompiledHeader', 'Use') - _ToolAppend(msbuild_settings, 'ClCompile', - 'PrecompiledHeaderFile', precompiled_header) - _ToolAppend(msbuild_settings, 'ClCompile', - 'ForcedIncludeFiles', [precompiled_header]) - else: - _ToolAppend(msbuild_settings, 'ClCompile', 'PrecompiledHeader', 'NotUsing') - # Turn off WinRT compilation - _ToolAppend(msbuild_settings, 'ClCompile', 'CompileAsWinRT', 'false') - # Turn on import libraries if appropriate - if spec.get('msvs_requires_importlibrary'): - _ToolAppend(msbuild_settings, '', 'IgnoreImportLibrary', 'false') - # Loadable modules don't generate import libraries; - # tell dependent projects to not expect one. - if spec['type'] == 'loadable_module': - _ToolAppend(msbuild_settings, '', 'IgnoreImportLibrary', 'true') - # Set the module definition file if any. - if def_file: - _ToolAppend(msbuild_settings, 'Link', 'ModuleDefinitionFile', def_file) - configuration['finalized_msbuild_settings'] = msbuild_settings - if prebuild: - _ToolAppend(msbuild_settings, 'PreBuildEvent', 'Command', prebuild) - if postbuild: - _ToolAppend(msbuild_settings, 'PostBuildEvent', 'Command', postbuild) + if "msbuild_settings" in configuration: + converted = False + msbuild_settings = configuration["msbuild_settings"] + MSVSSettings.ValidateMSBuildSettings(msbuild_settings) + else: + converted = True + msvs_settings = configuration.get("msvs_settings", {}) + msbuild_settings = MSVSSettings.ConvertToMSBuildSettings(msvs_settings) + include_dirs, midl_include_dirs, resource_include_dirs = _GetIncludeDirs( + configuration + ) + libraries = _GetLibraries(spec) + library_dirs = _GetLibraryDirs(configuration) + out_file, _, msbuild_tool = _GetOutputFilePathAndTool(spec, msbuild=True) + target_ext = _GetOutputTargetExt(spec) + defines = _GetDefines(configuration) + if converted: + # Visual Studio 2010 has TR1 + defines = [d for d in defines if d != "_HAS_TR1=0"] + # Warn of ignored settings + ignored_settings = ["msvs_tool_files"] + for ignored_setting in ignored_settings: + value = configuration.get(ignored_setting) + if value: + print( + "Warning: The automatic conversion to MSBuild does not handle " + "%s. Ignoring setting of %s" % (ignored_setting, str(value)) + ) + + defines = [_EscapeCppDefineForMSBuild(d) for d in defines] + disabled_warnings = _GetDisabledWarnings(configuration) + prebuild = configuration.get("msvs_prebuild") + postbuild = configuration.get("msvs_postbuild") + def_file = _GetModuleDefinition(spec) + precompiled_header = configuration.get("msvs_precompiled_header") + + # Add the information to the appropriate tool + # TODO(jeanluc) We could optimize and generate these settings only if + # the corresponding files are found, e.g. don't generate ResourceCompile + # if you don't have any resources. + _ToolAppend( + msbuild_settings, "ClCompile", "AdditionalIncludeDirectories", include_dirs + ) + _ToolAppend( + msbuild_settings, "Midl", "AdditionalIncludeDirectories", midl_include_dirs + ) + _ToolAppend( + msbuild_settings, + "ResourceCompile", + "AdditionalIncludeDirectories", + resource_include_dirs, + ) + # Add in libraries, note that even for empty libraries, we want this + # set, to prevent inheriting default libraries from the environment. + _ToolSetOrAppend(msbuild_settings, "Link", "AdditionalDependencies", libraries) + _ToolAppend(msbuild_settings, "Link", "AdditionalLibraryDirectories", library_dirs) + if out_file: + _ToolAppend( + msbuild_settings, msbuild_tool, "OutputFile", out_file, only_if_unset=True + ) + if target_ext: + _ToolAppend( + msbuild_settings, msbuild_tool, "TargetExt", target_ext, only_if_unset=True + ) + # Add defines. + _ToolAppend(msbuild_settings, "ClCompile", "PreprocessorDefinitions", defines) + _ToolAppend(msbuild_settings, "ResourceCompile", "PreprocessorDefinitions", defines) + # Add disabled warnings. + _ToolAppend( + msbuild_settings, "ClCompile", "DisableSpecificWarnings", disabled_warnings + ) + # Turn on precompiled headers if appropriate. + if precompiled_header: + precompiled_header = os.path.split(precompiled_header)[1] + _ToolAppend(msbuild_settings, "ClCompile", "PrecompiledHeader", "Use") + _ToolAppend( + msbuild_settings, "ClCompile", "PrecompiledHeaderFile", precompiled_header + ) + _ToolAppend( + msbuild_settings, "ClCompile", "ForcedIncludeFiles", [precompiled_header] + ) + else: + _ToolAppend(msbuild_settings, "ClCompile", "PrecompiledHeader", "NotUsing") + # Turn off WinRT compilation + _ToolAppend(msbuild_settings, "ClCompile", "CompileAsWinRT", "false") + # Turn on import libraries if appropriate + if spec.get("msvs_requires_importlibrary"): + _ToolAppend(msbuild_settings, "", "IgnoreImportLibrary", "false") + # Loadable modules don't generate import libraries; + # tell dependent projects to not expect one. + if spec["type"] == "loadable_module": + _ToolAppend(msbuild_settings, "", "IgnoreImportLibrary", "true") + # Set the module definition file if any. + if def_file: + _ToolAppend(msbuild_settings, "Link", "ModuleDefinitionFile", def_file) + configuration["finalized_msbuild_settings"] = msbuild_settings + if prebuild: + _ToolAppend(msbuild_settings, "PreBuildEvent", "Command", prebuild) + if postbuild: + _ToolAppend(msbuild_settings, "PostBuildEvent", "Command", postbuild) def _GetValueFormattedForMSBuild(tool_name, name, value): - if type(value) == list: - # For some settings, VS2010 does not automatically extends the settings - # TODO(jeanluc) Is this what we want? - if name in ['AdditionalIncludeDirectories', - 'AdditionalLibraryDirectories', - 'AdditionalOptions', - 'DelayLoadDLLs', - 'DisableSpecificWarnings', - 'PreprocessorDefinitions']: - value.append('%%(%s)' % name) - # For most tools, entries in a list should be separated with ';' but some - # settings use a space. Check for those first. - exceptions = { - 'ClCompile': ['AdditionalOptions'], - 'Link': ['AdditionalOptions'], - 'Lib': ['AdditionalOptions']} - if tool_name in exceptions and name in exceptions[tool_name]: - char = ' ' + if type(value) == list: + # For some settings, VS2010 does not automatically extends the settings + # TODO(jeanluc) Is this what we want? + if name in [ + "AdditionalIncludeDirectories", + "AdditionalLibraryDirectories", + "AdditionalOptions", + "DelayLoadDLLs", + "DisableSpecificWarnings", + "PreprocessorDefinitions", + ]: + value.append("%%(%s)" % name) + # For most tools, entries in a list should be separated with ';' but some + # settings use a space. Check for those first. + exceptions = { + "ClCompile": ["AdditionalOptions"], + "Link": ["AdditionalOptions"], + "Lib": ["AdditionalOptions"], + } + if tool_name in exceptions and name in exceptions[tool_name]: + char = " " + else: + char = ";" + formatted_value = char.join( + [MSVSSettings.ConvertVCMacrosToMSBuild(i) for i in value] + ) else: - char = ';' - formatted_value = char.join( - [MSVSSettings.ConvertVCMacrosToMSBuild(i) for i in value]) - else: - formatted_value = MSVSSettings.ConvertVCMacrosToMSBuild(value) - return formatted_value + formatted_value = MSVSSettings.ConvertVCMacrosToMSBuild(value) + return formatted_value def _VerifySourcesExist(sources, root_dir): - """Verifies that all source files exist on disk. + """Verifies that all source files exist on disk. Checks that all regular source files, i.e. not created at run time, exist on disk. Missing files cause needless recompilation but no otherwise @@ -3154,252 +3523,334 @@ def _VerifySourcesExist(sources, root_dir): Returns: A list of source files that cannot be found on disk. """ - missing_sources = [] - for source in sources: - if isinstance(source, MSVSProject.Filter): - missing_sources.extend(_VerifySourcesExist(source.contents, root_dir)) - else: - if '$' not in source: - full_path = os.path.join(root_dir, source) - if not os.path.exists(full_path): - missing_sources.append(full_path) - return missing_sources - - -def _GetMSBuildSources(spec, sources, exclusions, rule_dependencies, - extension_to_rule_name, actions_spec, - sources_handled_by_action, list_excluded): - groups = ['none', 'masm', 'midl', 'include', 'compile', 'resource', 'rule', - 'rule_dependency'] - grouped_sources = {} - for g in groups: - grouped_sources[g] = [] - - _AddSources2(spec, sources, exclusions, grouped_sources, - rule_dependencies, extension_to_rule_name, - sources_handled_by_action, list_excluded) - sources = [] - for g in groups: - if grouped_sources[g]: - sources.append(['ItemGroup'] + grouped_sources[g]) - if actions_spec: - sources.append(['ItemGroup'] + actions_spec) - return sources - - -def _AddSources2(spec, sources, exclusions, grouped_sources, - rule_dependencies, extension_to_rule_name, - sources_handled_by_action, - list_excluded): - extensions_excluded_from_precompile = [] - for source in sources: - if isinstance(source, MSVSProject.Filter): - _AddSources2(spec, source.contents, exclusions, grouped_sources, - rule_dependencies, extension_to_rule_name, - sources_handled_by_action, - list_excluded) - else: - if not source in sources_handled_by_action: - detail = [] - excluded_configurations = exclusions.get(source, []) - if len(excluded_configurations) == len(spec['configurations']): - detail.append(['ExcludedFromBuild', 'true']) + missing_sources = [] + for source in sources: + if isinstance(source, MSVSProject.Filter): + missing_sources.extend(_VerifySourcesExist(source.contents, root_dir)) else: - for config_name, configuration in sorted(excluded_configurations): - condition = _GetConfigurationCondition(config_name, configuration) - detail.append(['ExcludedFromBuild', - {'Condition': condition}, - 'true']) - # Add precompile if needed - for config_name, configuration in spec['configurations'].items(): - precompiled_source = configuration.get('msvs_precompiled_source', '') - if precompiled_source != '': - precompiled_source = _FixPath(precompiled_source) - if not extensions_excluded_from_precompile: - # If the precompiled header is generated by a C source, we must - # not try to use it for C++ sources, and vice versa. - basename, extension = os.path.splitext(precompiled_source) - if extension == '.c': - extensions_excluded_from_precompile = ['.cc', '.cpp', '.cxx'] - else: - extensions_excluded_from_precompile = ['.c'] - - if precompiled_source == source: - condition = _GetConfigurationCondition(config_name, configuration) - detail.append(['PrecompiledHeader', - {'Condition': condition}, - 'Create' - ]) - else: - # Turn off precompiled header usage for source files of a - # different type than the file that generated the - # precompiled header. - for extension in extensions_excluded_from_precompile: - if source.endswith(extension): - detail.append(['PrecompiledHeader', '']) - detail.append(['ForcedIncludeFiles', '']) - - group, element = _MapFileToMsBuildSourceType(source, rule_dependencies, - extension_to_rule_name, - _GetUniquePlatforms(spec)) - grouped_sources[group].append([element, {'Include': source}] + detail) + if "$" not in source: + full_path = os.path.join(root_dir, source) + if not os.path.exists(full_path): + missing_sources.append(full_path) + return missing_sources + + +def _GetMSBuildSources( + spec, + sources, + exclusions, + rule_dependencies, + extension_to_rule_name, + actions_spec, + sources_handled_by_action, + list_excluded, +): + groups = [ + "none", + "masm", + "midl", + "include", + "compile", + "resource", + "rule", + "rule_dependency", + ] + grouped_sources = {} + for g in groups: + grouped_sources[g] = [] + + _AddSources2( + spec, + sources, + exclusions, + grouped_sources, + rule_dependencies, + extension_to_rule_name, + sources_handled_by_action, + list_excluded, + ) + sources = [] + for g in groups: + if grouped_sources[g]: + sources.append(["ItemGroup"] + grouped_sources[g]) + if actions_spec: + sources.append(["ItemGroup"] + actions_spec) + return sources + + +def _AddSources2( + spec, + sources, + exclusions, + grouped_sources, + rule_dependencies, + extension_to_rule_name, + sources_handled_by_action, + list_excluded, +): + extensions_excluded_from_precompile = [] + for source in sources: + if isinstance(source, MSVSProject.Filter): + _AddSources2( + spec, + source.contents, + exclusions, + grouped_sources, + rule_dependencies, + extension_to_rule_name, + sources_handled_by_action, + list_excluded, + ) + else: + if source not in sources_handled_by_action: + detail = [] + excluded_configurations = exclusions.get(source, []) + if len(excluded_configurations) == len(spec["configurations"]): + detail.append(["ExcludedFromBuild", "true"]) + else: + for config_name, configuration in sorted(excluded_configurations): + condition = _GetConfigurationCondition( + config_name, configuration + ) + detail.append( + ["ExcludedFromBuild", {"Condition": condition}, "true"] + ) + # Add precompile if needed + for config_name, configuration in spec["configurations"].items(): + precompiled_source = configuration.get( + "msvs_precompiled_source", "" + ) + if precompiled_source != "": + precompiled_source = _FixPath(precompiled_source) + if not extensions_excluded_from_precompile: + # If the precompiled header is generated by a C source, we must + # not try to use it for C++ sources, and vice versa. + basename, extension = os.path.splitext(precompiled_source) + if extension == ".c": + extensions_excluded_from_precompile = [ + ".cc", + ".cpp", + ".cxx", + ] + else: + extensions_excluded_from_precompile = [".c"] + + if precompiled_source == source: + condition = _GetConfigurationCondition( + config_name, configuration, spec + ) + detail.append( + ["PrecompiledHeader", {"Condition": condition}, "Create"] + ) + else: + # Turn off precompiled header usage for source files of a + # different type than the file that generated the + # precompiled header. + for extension in extensions_excluded_from_precompile: + if source.endswith(extension): + detail.append(["PrecompiledHeader", ""]) + detail.append(["ForcedIncludeFiles", ""]) + + group, element = _MapFileToMsBuildSourceType( + source, + rule_dependencies, + extension_to_rule_name, + _GetUniquePlatforms(spec), + ) + grouped_sources[group].append([element, {"Include": source}] + detail) def _GetMSBuildProjectReferences(project): - references = [] - if project.dependencies: - group = ['ItemGroup'] - for dependency in project.dependencies: - guid = dependency.guid - project_dir = os.path.split(project.path)[0] - relative_path = gyp.common.RelativePath(dependency.path, project_dir) - project_ref = ['ProjectReference', - {'Include': relative_path}, - ['Project', guid], - ['ReferenceOutputAssembly', 'false'] - ] - for config in dependency.spec.get('configurations', {}).values(): - if config.get('msvs_use_library_dependency_inputs', 0): - project_ref.append(['UseLibraryDependencyInputs', 'true']) - break - # If it's disabled in any config, turn it off in the reference. - if config.get('msvs_2010_disable_uldi_when_referenced', 0): - project_ref.append(['UseLibraryDependencyInputs', 'false']) - break - group.append(project_ref) - references.append(group) - return references - - -def _GenerateMSBuildProject(project, options, version, generator_flags): - spec = project.spec - configurations = spec['configurations'] - project_dir, project_file_name = os.path.split(project.path) - gyp.common.EnsureDirExists(project.path) - # Prepare list of sources and excluded sources. - gyp_path = _NormalizedSource(project.build_file) - relative_path_of_gyp_file = gyp.common.RelativePath(gyp_path, project_dir) - - gyp_file = os.path.split(project.build_file)[1] - sources, excluded_sources = _PrepareListOfSources(spec, generator_flags, - gyp_file) - # Add rules. - actions_to_add = {} - props_files_of_rules = set() - targets_files_of_rules = set() - rule_dependencies = set() - extension_to_rule_name = {} - list_excluded = generator_flags.get('msvs_list_excluded_files', True) - - # Don't generate rules if we are using an external builder like ninja. - if not spec.get('msvs_external_builder'): - _GenerateRulesForMSBuild(project_dir, options, spec, - sources, excluded_sources, - props_files_of_rules, targets_files_of_rules, - actions_to_add, rule_dependencies, - extension_to_rule_name) - else: - rules = spec.get('rules', []) - _AdjustSourcesForRules(rules, sources, excluded_sources, True) - - sources, excluded_sources, excluded_idl = ( - _AdjustSourcesAndConvertToFilterHierarchy(spec, options, - project_dir, sources, - excluded_sources, - list_excluded, version)) - - # Don't add actions if we are using an external builder like ninja. - if not spec.get('msvs_external_builder'): - _AddActions(actions_to_add, spec, project.build_file) - _AddCopies(actions_to_add, spec) + references = [] + if project.dependencies: + group = ["ItemGroup"] + added_dependency_set = set() + for dependency in project.dependencies: + dependency_spec = dependency.spec + should_skip_dep = False + if project.spec["toolset"] == "target": + if dependency_spec["toolset"] == "host": + if dependency_spec["type"] == "static_library": + should_skip_dep = True + if dependency.name.startswith("run_"): + should_skip_dep = False + if should_skip_dep: + continue + + canonical_name = dependency.name.replace("_host", "") + added_dependency_set.add(canonical_name) + guid = dependency.guid + project_dir = os.path.split(project.path)[0] + relative_path = gyp.common.RelativePath(dependency.path, project_dir) + project_ref = [ + "ProjectReference", + {"Include": relative_path}, + ["Project", guid], + ["ReferenceOutputAssembly", "false"], + ] + for config in dependency.spec.get("configurations", {}).values(): + if config.get("msvs_use_library_dependency_inputs", 0): + project_ref.append(["UseLibraryDependencyInputs", "true"]) + break + # If it's disabled in any config, turn it off in the reference. + if config.get("msvs_2010_disable_uldi_when_referenced", 0): + project_ref.append(["UseLibraryDependencyInputs", "false"]) + break + group.append(project_ref) + references.append(group) + return references + + +def _GenerateMSBuildProject(project, options, version, generator_flags, spec): + spec = project.spec + configurations = spec["configurations"] + project_dir, project_file_name = os.path.split(project.path) + gyp.common.EnsureDirExists(project.path) + # Prepare list of sources and excluded sources. + + gyp_file = os.path.split(project.build_file)[1] + sources, excluded_sources = _PrepareListOfSources(spec, generator_flags, gyp_file) + # Add rules. + actions_to_add = {} + props_files_of_rules = set() + targets_files_of_rules = set() + rule_dependencies = set() + extension_to_rule_name = {} + list_excluded = generator_flags.get("msvs_list_excluded_files", True) + + # Don't generate rules if we are using an external builder like ninja. + if not spec.get("msvs_external_builder"): + _GenerateRulesForMSBuild( + project_dir, + options, + spec, + sources, + excluded_sources, + props_files_of_rules, + targets_files_of_rules, + actions_to_add, + rule_dependencies, + extension_to_rule_name, + ) + else: + rules = spec.get("rules", []) + _AdjustSourcesForRules(rules, sources, excluded_sources, True) + + sources, excluded_sources, excluded_idl = _AdjustSourcesAndConvertToFilterHierarchy( + spec, options, project_dir, sources, excluded_sources, list_excluded, version + ) + + # Don't add actions if we are using an external builder like ninja. + if not spec.get("msvs_external_builder"): + _AddActions(actions_to_add, spec, project.build_file) + _AddCopies(actions_to_add, spec) + + # NOTE: this stanza must appear after all actions have been decided. + # Don't excluded sources with actions attached, or they won't run. + excluded_sources = _FilterActionsFromExcluded(excluded_sources, actions_to_add) + + exclusions = _GetExcludedFilesFromBuild(spec, excluded_sources, excluded_idl) + actions_spec, sources_handled_by_action = _GenerateActionsForMSBuild( + spec, actions_to_add + ) + + _GenerateMSBuildFiltersFile( + project.path + ".filters", + sources, + rule_dependencies, + extension_to_rule_name, + _GetUniquePlatforms(spec), + ) + missing_sources = _VerifySourcesExist(sources, project_dir) + + for configuration in configurations.values(): + _FinalizeMSBuildSettings(spec, configuration) + + # Add attributes to root element + + import_default_section = [ + ["Import", {"Project": r"$(VCTargetsPath)\Microsoft.Cpp.Default.props"}] + ] + import_cpp_props_section = [ + ["Import", {"Project": r"$(VCTargetsPath)\Microsoft.Cpp.props"}] + ] + import_cpp_targets_section = [ + ["Import", {"Project": r"$(VCTargetsPath)\Microsoft.Cpp.targets"}] + ] + import_masm_props_section = [ + ["Import", {"Project": r"$(VCTargetsPath)\BuildCustomizations\masm.props"}] + ] + import_masm_targets_section = [ + ["Import", {"Project": r"$(VCTargetsPath)\BuildCustomizations\masm.targets"}] + ] + import_marmasm_props_section = [ + ["Import", {"Project": r"$(VCTargetsPath)\BuildCustomizations\marmasm.props"}] + ] + import_marmasm_targets_section = [ + ["Import", {"Project": r"$(VCTargetsPath)\BuildCustomizations\marmasm.targets"}] + ] + macro_section = [["PropertyGroup", {"Label": "UserMacros"}]] + + content = [ + "Project", + { + "xmlns": "http://schemas.microsoft.com/developer/msbuild/2003", + "ToolsVersion": version.ProjectVersion(), + "DefaultTargets": "Build", + }, + ] - # NOTE: this stanza must appear after all actions have been decided. - # Don't excluded sources with actions attached, or they won't run. - excluded_sources = _FilterActionsFromExcluded( - excluded_sources, actions_to_add) - - exclusions = _GetExcludedFilesFromBuild(spec, excluded_sources, excluded_idl) - actions_spec, sources_handled_by_action = _GenerateActionsForMSBuild( - spec, actions_to_add) - - _GenerateMSBuildFiltersFile(project.path + '.filters', sources, - rule_dependencies, - extension_to_rule_name, _GetUniquePlatforms(spec)) - missing_sources = _VerifySourcesExist(sources, project_dir) - - for configuration in configurations.values(): - _FinalizeMSBuildSettings(spec, configuration) - - # Add attributes to root element - - import_default_section = [ - ['Import', {'Project': r'$(VCTargetsPath)\Microsoft.Cpp.Default.props'}]] - import_cpp_props_section = [ - ['Import', {'Project': r'$(VCTargetsPath)\Microsoft.Cpp.props'}]] - import_cpp_targets_section = [ - ['Import', {'Project': r'$(VCTargetsPath)\Microsoft.Cpp.targets'}]] - import_masm_props_section = [ - ['Import', - {'Project': r'$(VCTargetsPath)\BuildCustomizations\masm.props'}]] - import_masm_targets_section = [ - ['Import', - {'Project': r'$(VCTargetsPath)\BuildCustomizations\masm.targets'}]] - import_marmasm_props_section = [ - ['Import', - {'Project': r'$(VCTargetsPath)\BuildCustomizations\marmasm.props'}]] - import_marmasm_targets_section = [ - ['Import', - {'Project': r'$(VCTargetsPath)\BuildCustomizations\marmasm.targets'}]] - macro_section = [['PropertyGroup', {'Label': 'UserMacros'}]] - - content = [ - 'Project', - {'xmlns': 'http://schemas.microsoft.com/developer/msbuild/2003', - 'ToolsVersion': version.ProjectVersion(), - 'DefaultTargets': 'Build' - }] - - content += _GetMSBuildProjectConfigurations(configurations) - content += _GetMSBuildGlobalProperties(spec, project.guid, project_file_name) - content += import_default_section - content += _GetMSBuildConfigurationDetails(spec, project.build_file) - if spec.get('msvs_enable_winphone'): - content += _GetMSBuildLocalProperties('v120_wp81') - else: - content += _GetMSBuildLocalProperties(project.msbuild_toolset) - content += import_cpp_props_section - content += import_masm_props_section - if spec.get('msvs_enable_marmasm'): - content += import_marmasm_props_section - content += _GetMSBuildExtensions(props_files_of_rules) - content += _GetMSBuildPropertySheets(configurations) - content += macro_section - content += _GetMSBuildConfigurationGlobalProperties(spec, configurations, - project.build_file) - content += _GetMSBuildToolSettingsSections(spec, configurations) - content += _GetMSBuildSources( - spec, sources, exclusions, rule_dependencies, extension_to_rule_name, - actions_spec, sources_handled_by_action, list_excluded) - content += _GetMSBuildProjectReferences(project) - content += import_cpp_targets_section - content += import_masm_targets_section - if spec.get('msvs_enable_marmasm'): - content += import_marmasm_targets_section - content += _GetMSBuildExtensionTargets(targets_files_of_rules) - - if spec.get('msvs_external_builder'): - content += _GetMSBuildExternalBuilderTargets(spec) - - # TODO(jeanluc) File a bug to get rid of runas. We had in MSVS: - # has_run_as = _WriteMSVSUserFile(project.path, version, spec) - - easy_xml.WriteXmlIfChanged(content, project.path, pretty=True, win32=True) - - return missing_sources + content += _GetMSBuildProjectConfigurations(configurations, spec) + content += _GetMSBuildGlobalProperties( + spec, version, project.guid, project_file_name + ) + content += import_default_section + content += _GetMSBuildConfigurationDetails(spec, project.build_file) + if spec.get("msvs_enable_winphone"): + content += _GetMSBuildLocalProperties("v120_wp81") + else: + content += _GetMSBuildLocalProperties(project.msbuild_toolset) + content += import_cpp_props_section + content += import_masm_props_section + if spec.get("msvs_enable_marmasm"): + content += import_marmasm_props_section + content += _GetMSBuildExtensions(props_files_of_rules) + content += _GetMSBuildPropertySheets(configurations, spec) + content += macro_section + content += _GetMSBuildConfigurationGlobalProperties( + spec, configurations, project.build_file + ) + content += _GetMSBuildToolSettingsSections(spec, configurations) + content += _GetMSBuildSources( + spec, + sources, + exclusions, + rule_dependencies, + extension_to_rule_name, + actions_spec, + sources_handled_by_action, + list_excluded, + ) + content += _GetMSBuildProjectReferences(project) + content += import_cpp_targets_section + content += import_masm_targets_section + if spec.get("msvs_enable_marmasm"): + content += import_marmasm_targets_section + content += _GetMSBuildExtensionTargets(targets_files_of_rules) + + if spec.get("msvs_external_builder"): + content += _GetMSBuildExternalBuilderTargets(spec) + + # TODO(jeanluc) File a bug to get rid of runas. We had in MSVS: + # has_run_as = _WriteMSVSUserFile(project.path, version, spec) + + easy_xml.WriteXmlIfChanged(content, project.path, pretty=True, win32=True) + + return missing_sources def _GetMSBuildExternalBuilderTargets(spec): - """Return a list of MSBuild targets for external builders. + """Return a list of MSBuild targets for external builders. The "Build" and "Clean" targets are always generated. If the spec contains 'msvs_external_builder_clcompile_cmd', then the "ClCompile" target will also @@ -3410,47 +3861,52 @@ def _GetMSBuildExternalBuilderTargets(spec): Returns: List of MSBuild 'Target' specs. """ - build_cmd = _BuildCommandLineForRuleRaw( - spec, spec['msvs_external_builder_build_cmd'], - False, False, False, False) - build_target = ['Target', {'Name': 'Build'}] - build_target.append(['Exec', {'Command': build_cmd}]) - - clean_cmd = _BuildCommandLineForRuleRaw( - spec, spec['msvs_external_builder_clean_cmd'], - False, False, False, False) - clean_target = ['Target', {'Name': 'Clean'}] - clean_target.append(['Exec', {'Command': clean_cmd}]) - - targets = [build_target, clean_target] - - if spec.get('msvs_external_builder_clcompile_cmd'): - clcompile_cmd = _BuildCommandLineForRuleRaw( - spec, spec['msvs_external_builder_clcompile_cmd'], - False, False, False, False) - clcompile_target = ['Target', {'Name': 'ClCompile'}] - clcompile_target.append(['Exec', {'Command': clcompile_cmd}]) - targets.append(clcompile_target) - - return targets + build_cmd = _BuildCommandLineForRuleRaw( + spec, spec["msvs_external_builder_build_cmd"], False, False, False, False + ) + build_target = ["Target", {"Name": "Build"}] + build_target.append(["Exec", {"Command": build_cmd}]) + + clean_cmd = _BuildCommandLineForRuleRaw( + spec, spec["msvs_external_builder_clean_cmd"], False, False, False, False + ) + clean_target = ["Target", {"Name": "Clean"}] + clean_target.append(["Exec", {"Command": clean_cmd}]) + + targets = [build_target, clean_target] + + if spec.get("msvs_external_builder_clcompile_cmd"): + clcompile_cmd = _BuildCommandLineForRuleRaw( + spec, + spec["msvs_external_builder_clcompile_cmd"], + False, + False, + False, + False, + ) + clcompile_target = ["Target", {"Name": "ClCompile"}] + clcompile_target.append(["Exec", {"Command": clcompile_cmd}]) + targets.append(clcompile_target) + + return targets def _GetMSBuildExtensions(props_files_of_rules): - extensions = ['ImportGroup', {'Label': 'ExtensionSettings'}] - for props_file in props_files_of_rules: - extensions.append(['Import', {'Project': props_file}]) - return [extensions] + extensions = ["ImportGroup", {"Label": "ExtensionSettings"}] + for props_file in props_files_of_rules: + extensions.append(["Import", {"Project": props_file}]) + return [extensions] def _GetMSBuildExtensionTargets(targets_files_of_rules): - targets_node = ['ImportGroup', {'Label': 'ExtensionTargets'}] - for targets_file in sorted(targets_files_of_rules): - targets_node.append(['Import', {'Project': targets_file}]) - return [targets_node] + targets_node = ["ImportGroup", {"Label": "ExtensionTargets"}] + for targets_file in sorted(targets_files_of_rules): + targets_node.append(["Import", {"Project": targets_file}]) + return [targets_node] def _GenerateActionsForMSBuild(spec, actions_to_add): - """Add actions accumulated into an actions_to_add, merging as needed. + """Add actions accumulated into an actions_to_add, merging as needed. Arguments: spec: the target project dict @@ -3460,63 +3916,87 @@ def _GenerateActionsForMSBuild(spec, actions_to_add): Returns: A pair of (action specification, the sources handled by this action). """ - sources_handled_by_action = OrderedSet() - actions_spec = [] - for primary_input, actions in actions_to_add.items(): - inputs = OrderedSet() - outputs = OrderedSet() - descriptions = [] - commands = [] - for action in actions: - inputs.update(OrderedSet(action['inputs'])) - outputs.update(OrderedSet(action['outputs'])) - descriptions.append(action['description']) - cmd = action['command'] - # For most actions, add 'call' so that actions that invoke batch files - # return and continue executing. msbuild_use_call provides a way to - # disable this but I have not seen any adverse effect from doing that - # for everything. - if action.get('msbuild_use_call', True): - cmd = 'call ' + cmd - commands.append(cmd) - # Add the custom build action for one input file. - description = ', and also '.join(descriptions) - - # We can't join the commands simply with && because the command line will - # get too long. See also _AddActions: cygwin's setup_env mustn't be called - # for every invocation or the command that sets the PATH will grow too - # long. - command = '\r\n'.join([c + '\r\nif %errorlevel% neq 0 exit /b %errorlevel%' - for c in commands]) - _AddMSBuildAction(spec, - primary_input, - inputs, - outputs, - command, - description, - sources_handled_by_action, - actions_spec) - return actions_spec, sources_handled_by_action - - -def _AddMSBuildAction(spec, primary_input, inputs, outputs, cmd, description, - sources_handled_by_action, actions_spec): - command = MSVSSettings.ConvertVCMacrosToMSBuild(cmd) - primary_input = _FixPath(primary_input) - inputs_array = _FixPaths(inputs) - outputs_array = _FixPaths(outputs) - additional_inputs = ';'.join([i for i in inputs_array - if i != primary_input]) - outputs = ';'.join(outputs_array) - sources_handled_by_action.add(primary_input) - action_spec = ['CustomBuild', {'Include': primary_input}] - action_spec.extend( - # TODO(jeanluc) 'Document' for all or just if as_sources? - [['FileType', 'Document'], - ['Command', command], - ['Message', description], - ['Outputs', outputs] - ]) - if additional_inputs: - action_spec.append(['AdditionalInputs', additional_inputs]) - actions_spec.append(action_spec) + sources_handled_by_action = OrderedSet() + actions_spec = [] + for primary_input, actions in actions_to_add.items(): + if generator_supports_multiple_toolsets: + primary_input = primary_input.replace(".exe", "_host.exe") + inputs = OrderedSet() + outputs = OrderedSet() + descriptions = [] + commands = [] + for action in actions: + + def fixup_host_exe(i): + if "$(OutDir)" in i: + i = i.replace(".exe", "_host.exe") + return i + + if generator_supports_multiple_toolsets: + action["inputs"] = [fixup_host_exe(i) for i in action["inputs"]] + inputs.update(OrderedSet(action["inputs"])) + outputs.update(OrderedSet(action["outputs"])) + descriptions.append(action["description"]) + cmd = action["command"] + if generator_supports_multiple_toolsets: + cmd = cmd.replace(".exe", "_host.exe") + # For most actions, add 'call' so that actions that invoke batch files + # return and continue executing. msbuild_use_call provides a way to + # disable this but I have not seen any adverse effect from doing that + # for everything. + if action.get("msbuild_use_call", True): + cmd = "call " + cmd + commands.append(cmd) + # Add the custom build action for one input file. + description = ", and also ".join(descriptions) + + # We can't join the commands simply with && because the command line will + # get too long. See also _AddActions: cygwin's setup_env mustn't be called + # for every invocation or the command that sets the PATH will grow too + # long. + command = "\r\n".join( + [c + "\r\nif %errorlevel% neq 0 exit /b %errorlevel%" for c in commands] + ) + _AddMSBuildAction( + spec, + primary_input, + inputs, + outputs, + command, + description, + sources_handled_by_action, + actions_spec, + ) + return actions_spec, sources_handled_by_action + + +def _AddMSBuildAction( + spec, + primary_input, + inputs, + outputs, + cmd, + description, + sources_handled_by_action, + actions_spec, +): + command = MSVSSettings.ConvertVCMacrosToMSBuild(cmd) + primary_input = _FixPath(primary_input) + inputs_array = _FixPaths(inputs) + outputs_array = _FixPaths(outputs) + additional_inputs = ";".join([i for i in inputs_array if i != primary_input]) + outputs = ";".join(outputs_array) + sources_handled_by_action.add(primary_input) + action_spec = ["CustomBuild", {"Include": primary_input}] + action_spec.extend( + # TODO(jeanluc) 'Document' for all or just if as_sources? + [ + ["FileType", "Document"], + ["Command", command], + ["Message", description], + ["Outputs", outputs], + ] + ) + if additional_inputs: + action_spec.append(["AdditionalInputs", additional_inputs]) + actions_spec.append(action_spec) diff --git a/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/msvs_test.py b/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/msvs_test.py index daf4f411bc481f..e001f417d53aa5 100755 --- a/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/msvs_test.py +++ b/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/msvs_test.py @@ -7,34 +7,41 @@ import gyp.generator.msvs as msvs import unittest + try: - from cStringIO import StringIO + from StringIO import StringIO # Python 2 except ImportError: - from io import StringIO + from io import StringIO # Python 3 class TestSequenceFunctions(unittest.TestCase): + def setUp(self): + self.stderr = StringIO() + + def test_GetLibraries(self): + self.assertEqual(msvs._GetLibraries({}), []) + self.assertEqual(msvs._GetLibraries({"libraries": []}), []) + self.assertEqual( + msvs._GetLibraries({"other": "foo", "libraries": ["a.lib"]}), ["a.lib"] + ) + self.assertEqual(msvs._GetLibraries({"libraries": ["-la"]}), ["a.lib"]) + self.assertEqual( + msvs._GetLibraries( + { + "libraries": [ + "a.lib", + "b.lib", + "c.lib", + "-lb.lib", + "-lb.lib", + "d.lib", + "a.lib", + ] + } + ), + ["c.lib", "b.lib", "d.lib", "a.lib"], + ) + - def setUp(self): - self.stderr = StringIO() - - def test_GetLibraries(self): - self.assertEqual( - msvs._GetLibraries({}), - []) - self.assertEqual( - msvs._GetLibraries({'libraries': []}), - []) - self.assertEqual( - msvs._GetLibraries({'other':'foo', 'libraries': ['a.lib']}), - ['a.lib']) - self.assertEqual( - msvs._GetLibraries({'libraries': ['-la']}), - ['a.lib']) - self.assertEqual( - msvs._GetLibraries({'libraries': ['a.lib', 'b.lib', 'c.lib', '-lb.lib', - '-lb.lib', 'd.lib', 'a.lib']}), - ['c.lib', 'b.lib', 'd.lib', 'a.lib']) - -if __name__ == '__main__': - unittest.main() +if __name__ == "__main__": + unittest.main() diff --git a/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/ninja.py b/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/ninja.py index 33cc253aba67b5..384b252e739529 100644 --- a/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/ninja.py +++ b/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/ninja.py @@ -1,8 +1,9 @@ -from __future__ import print_function # Copyright (c) 2013 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. +from __future__ import print_function + import collections import copy import hashlib @@ -15,49 +16,47 @@ import sys import gyp import gyp.common -from gyp.common import OrderedSet import gyp.msvs_emulation import gyp.MSVSUtil as MSVSUtil import gyp.xcode_emulation + try: - from cStringIO import StringIO + from cStringIO import StringIO except ImportError: - from io import StringIO + from io import StringIO from gyp.common import GetEnvironFallback import gyp.ninja_syntax as ninja_syntax generator_default_variables = { - 'EXECUTABLE_PREFIX': '', - 'EXECUTABLE_SUFFIX': '', - 'STATIC_LIB_PREFIX': 'lib', - 'STATIC_LIB_SUFFIX': '.a', - 'SHARED_LIB_PREFIX': 'lib', - - # Gyp expects the following variables to be expandable by the build - # system to the appropriate locations. Ninja prefers paths to be - # known at gyp time. To resolve this, introduce special - # variables starting with $! and $| (which begin with a $ so gyp knows it - # should be treated specially, but is otherwise an invalid - # ninja/shell variable) that are passed to gyp here but expanded - # before writing out into the target .ninja files; see - # ExpandSpecial. - # $! is used for variables that represent a path and that can only appear at - # the start of a string, while $| is used for variables that can appear - # anywhere in a string. - 'INTERMEDIATE_DIR': '$!INTERMEDIATE_DIR', - 'SHARED_INTERMEDIATE_DIR': '$!PRODUCT_DIR/gen', - 'PRODUCT_DIR': '$!PRODUCT_DIR', - 'CONFIGURATION_NAME': '$|CONFIGURATION_NAME', - - # Special variables that may be used by gyp 'rule' targets. - # We generate definitions for these variables on the fly when processing a - # rule. - 'RULE_INPUT_ROOT': '${root}', - 'RULE_INPUT_DIRNAME': '${dirname}', - 'RULE_INPUT_PATH': '${source}', - 'RULE_INPUT_EXT': '${ext}', - 'RULE_INPUT_NAME': '${name}', + "EXECUTABLE_PREFIX": "", + "EXECUTABLE_SUFFIX": "", + "STATIC_LIB_PREFIX": "lib", + "STATIC_LIB_SUFFIX": ".a", + "SHARED_LIB_PREFIX": "lib", + # Gyp expects the following variables to be expandable by the build + # system to the appropriate locations. Ninja prefers paths to be + # known at gyp time. To resolve this, introduce special + # variables starting with $! and $| (which begin with a $ so gyp knows it + # should be treated specially, but is otherwise an invalid + # ninja/shell variable) that are passed to gyp here but expanded + # before writing out into the target .ninja files; see + # ExpandSpecial. + # $! is used for variables that represent a path and that can only appear at + # the start of a string, while $| is used for variables that can appear + # anywhere in a string. + "INTERMEDIATE_DIR": "$!INTERMEDIATE_DIR", + "SHARED_INTERMEDIATE_DIR": "$!PRODUCT_DIR/gen", + "PRODUCT_DIR": "$!PRODUCT_DIR", + "CONFIGURATION_NAME": "$|CONFIGURATION_NAME", + # Special variables that may be used by gyp 'rule' targets. + # We generate definitions for these variables on the fly when processing a + # rule. + "RULE_INPUT_ROOT": "${root}", + "RULE_INPUT_DIRNAME": "${dirname}", + "RULE_INPUT_PATH": "${source}", + "RULE_INPUT_EXT": "${ext}", + "RULE_INPUT_NAME": "${name}", } # Placates pylint. @@ -68,42 +67,43 @@ generator_supports_multiple_toolsets = gyp.common.CrossCompileRequested() + def StripPrefix(arg, prefix): - if arg.startswith(prefix): - return arg[len(prefix):] - return arg + if arg.startswith(prefix): + return arg[len(prefix) :] + return arg def QuoteShellArgument(arg, flavor): - """Quote a string such that it will be interpreted as a single argument + """Quote a string such that it will be interpreted as a single argument by the shell.""" - # Rather than attempting to enumerate the bad shell characters, just - # whitelist common OK ones and quote anything else. - if re.match(r'^[a-zA-Z0-9_=.\\/-]+$', arg): - return arg # No quoting necessary. - if flavor == 'win': - return gyp.msvs_emulation.QuoteForRspFile(arg) - return "'" + arg.replace("'", "'" + '"\'"' + "'") + "'" + # Rather than attempting to enumerate the bad shell characters, just + # allow common OK ones and quote anything else. + if re.match(r"^[a-zA-Z0-9_=.\\/-]+$", arg): + return arg # No quoting necessary. + if flavor == "win": + return gyp.msvs_emulation.QuoteForRspFile(arg) + return "'" + arg.replace("'", "'" + '"\'"' + "'") + "'" def Define(d, flavor): - """Takes a preprocessor define and returns a -D parameter that's ninja- and + """Takes a preprocessor define and returns a -D parameter that's ninja- and shell-escaped.""" - if flavor == 'win': - # cl.exe replaces literal # characters with = in preprocesor definitions for - # some reason. Octal-encode to work around that. - d = d.replace('#', '\\%03o' % ord('#')) - return QuoteShellArgument(ninja_syntax.escape('-D' + d), flavor) + if flavor == "win": + # cl.exe replaces literal # characters with = in preprocesor definitions for + # some reason. Octal-encode to work around that. + d = d.replace("#", "\\%03o" % ord("#")) + return QuoteShellArgument(ninja_syntax.escape("-D" + d), flavor) def AddArch(output, arch): - """Adds an arch string to an output path.""" - output, extension = os.path.splitext(output) - return '%s.%s%s' % (output, arch, extension) + """Adds an arch string to an output path.""" + output, extension = os.path.splitext(output) + return "%s.%s%s" % (output, arch, extension) class Target(object): - """Target represents the paths used within a single gyp target. + """Target represents the paths used within a single gyp target. Conceptually, building a single target A is a series of steps: @@ -125,64 +125,68 @@ class Target(object): variables only store concrete paths to single files, while methods compute derived values like "the last output of the target". """ - def __init__(self, type): - # Gyp type ("static_library", etc.) of this target. - self.type = type - # File representing whether any input dependencies necessary for - # dependent actions have completed. - self.preaction_stamp = None - # File representing whether any input dependencies necessary for - # dependent compiles have completed. - self.precompile_stamp = None - # File representing the completion of actions/rules/copies, if any. - self.actions_stamp = None - # Path to the output of the link step, if any. - self.binary = None - # Path to the file representing the completion of building the bundle, - # if any. - self.bundle = None - # On Windows, incremental linking requires linking against all the .objs - # that compose a .lib (rather than the .lib itself). That list is stored - # here. In this case, we also need to save the compile_deps for the target, - # so that the target that directly depends on the .objs can also depend - # on those. - self.component_objs = None - self.compile_deps = None - # Windows only. The import .lib is the output of a build step, but - # because dependents only link against the lib (not both the lib and the - # dll) we keep track of the import library here. - self.import_lib = None - - def Linkable(self): - """Return true if this is a target that can be linked against.""" - return self.type in ('static_library', 'shared_library') - - def UsesToc(self, flavor): - """Return true if the target should produce a restat rule based on a TOC + + def __init__(self, type): + # Gyp type ("static_library", etc.) of this target. + self.type = type + # File representing whether any input dependencies necessary for + # dependent actions have completed. + self.preaction_stamp = None + # File representing whether any input dependencies necessary for + # dependent compiles have completed. + self.precompile_stamp = None + # File representing the completion of actions/rules/copies, if any. + self.actions_stamp = None + # Path to the output of the link step, if any. + self.binary = None + # Path to the file representing the completion of building the bundle, + # if any. + self.bundle = None + # On Windows, incremental linking requires linking against all the .objs + # that compose a .lib (rather than the .lib itself). That list is stored + # here. In this case, we also need to save the compile_deps for the target, + # so that the target that directly depends on the .objs can also depend + # on those. + self.component_objs = None + self.compile_deps = None + # Windows only. The import .lib is the output of a build step, but + # because dependents only link against the lib (not both the lib and the + # dll) we keep track of the import library here. + self.import_lib = None + # Track if this target contains any C++ files, to decide if gcc or g++ + # should be used for linking. + self.uses_cpp = False + + def Linkable(self): + """Return true if this is a target that can be linked against.""" + return self.type in ("static_library", "shared_library") + + def UsesToc(self, flavor): + """Return true if the target should produce a restat rule based on a TOC file.""" - # For bundles, the .TOC should be produced for the binary, not for - # FinalOutput(). But the naive approach would put the TOC file into the - # bundle, so don't do this for bundles for now. - if flavor == 'win' or self.bundle: - return False - return self.type in ('shared_library', 'loadable_module') - - def PreActionInput(self, flavor): - """Return the path, if any, that should be used as a dependency of + # For bundles, the .TOC should be produced for the binary, not for + # FinalOutput(). But the naive approach would put the TOC file into the + # bundle, so don't do this for bundles for now. + if flavor == "win" or self.bundle: + return False + return self.type in ("shared_library", "loadable_module") + + def PreActionInput(self, flavor): + """Return the path, if any, that should be used as a dependency of any dependent action step.""" - if self.UsesToc(flavor): - return self.FinalOutput() + '.TOC' - return self.FinalOutput() or self.preaction_stamp + if self.UsesToc(flavor): + return self.FinalOutput() + ".TOC" + return self.FinalOutput() or self.preaction_stamp - def PreCompileInput(self): - """Return the path, if any, that should be used as a dependency of + def PreCompileInput(self): + """Return the path, if any, that should be used as a dependency of any dependent compile step.""" - return self.actions_stamp or self.precompile_stamp + return self.actions_stamp or self.precompile_stamp - def FinalOutput(self): - """Return the last output of the target, which depends on all prior + def FinalOutput(self): + """Return the last output of the target, which depends on all prior steps.""" - return self.bundle or self.binary or self.actions_stamp + return self.bundle or self.binary or self.actions_stamp # A small discourse on paths as used within the Ninja build: @@ -209,108 +213,116 @@ def FinalOutput(self): # an output file; the result can be namespaced such that it is unique # to the input file name as well as the output target name. + class NinjaWriter(object): - def __init__(self, hash_for_rules, target_outputs, base_dir, build_dir, - output_file, toplevel_build, output_file_name, flavor, - toplevel_dir=None): - """ + def __init__( + self, + hash_for_rules, + target_outputs, + base_dir, + build_dir, + output_file, + toplevel_build, + output_file_name, + flavor, + toplevel_dir=None, + ): + """ base_dir: path from source root to directory containing this gyp file, by gyp semantics, all input paths are relative to this build_dir: path from source root to build output toplevel_dir: path to the toplevel directory """ - self.hash_for_rules = hash_for_rules - self.target_outputs = target_outputs - self.base_dir = base_dir - self.build_dir = build_dir - self.ninja = ninja_syntax.Writer(output_file) - self.toplevel_build = toplevel_build - self.output_file_name = output_file_name - - self.flavor = flavor - self.abs_build_dir = None - if toplevel_dir is not None: - self.abs_build_dir = os.path.abspath(os.path.join(toplevel_dir, - build_dir)) - self.obj_ext = '.obj' if flavor == 'win' else '.o' - if flavor == 'win': - # See docstring of msvs_emulation.GenerateEnvironmentFiles(). - self.win_env = {} - for arch in ('x86', 'x64'): - self.win_env[arch] = 'environment.' + arch - - # Relative path from build output dir to base dir. - build_to_top = gyp.common.InvertRelativePath(build_dir, toplevel_dir) - self.build_to_base = os.path.join(build_to_top, base_dir) - # Relative path from base dir to build dir. - base_to_top = gyp.common.InvertRelativePath(base_dir, toplevel_dir) - self.base_to_build = os.path.join(base_to_top, build_dir) - - def ExpandSpecial(self, path, product_dir=None): - """Expand specials like $!PRODUCT_DIR in |path|. + self.hash_for_rules = hash_for_rules + self.target_outputs = target_outputs + self.base_dir = base_dir + self.build_dir = build_dir + self.ninja = ninja_syntax.Writer(output_file) + self.toplevel_build = toplevel_build + self.output_file_name = output_file_name + + self.flavor = flavor + self.abs_build_dir = None + if toplevel_dir is not None: + self.abs_build_dir = os.path.abspath(os.path.join(toplevel_dir, build_dir)) + self.obj_ext = ".obj" if flavor == "win" else ".o" + if flavor == "win": + # See docstring of msvs_emulation.GenerateEnvironmentFiles(). + self.win_env = {} + for arch in ("x86", "x64"): + self.win_env[arch] = "environment." + arch + + # Relative path from build output dir to base dir. + build_to_top = gyp.common.InvertRelativePath(build_dir, toplevel_dir) + self.build_to_base = os.path.join(build_to_top, base_dir) + # Relative path from base dir to build dir. + base_to_top = gyp.common.InvertRelativePath(base_dir, toplevel_dir) + self.base_to_build = os.path.join(base_to_top, build_dir) + + def ExpandSpecial(self, path, product_dir=None): + """Expand specials like $!PRODUCT_DIR in |path|. If |product_dir| is None, assumes the cwd is already the product dir. Otherwise, |product_dir| is the relative path to the product dir. """ - PRODUCT_DIR = '$!PRODUCT_DIR' - if PRODUCT_DIR in path: - if product_dir: - path = path.replace(PRODUCT_DIR, product_dir) - else: - path = path.replace(PRODUCT_DIR + '/', '') - path = path.replace(PRODUCT_DIR + '\\', '') - path = path.replace(PRODUCT_DIR, '.') - - INTERMEDIATE_DIR = '$!INTERMEDIATE_DIR' - if INTERMEDIATE_DIR in path: - int_dir = self.GypPathToUniqueOutput('gen') - # GypPathToUniqueOutput generates a path relative to the product dir, - # so insert product_dir in front if it is provided. - path = path.replace(INTERMEDIATE_DIR, - os.path.join(product_dir or '', int_dir)) - - CONFIGURATION_NAME = '$|CONFIGURATION_NAME' - path = path.replace(CONFIGURATION_NAME, self.config_name) - - return path - - def ExpandRuleVariables(self, path, root, dirname, source, ext, name): - if self.flavor == 'win': - path = self.msvs_settings.ConvertVSMacros( - path, config=self.config_name) - path = path.replace(generator_default_variables['RULE_INPUT_ROOT'], root) - path = path.replace(generator_default_variables['RULE_INPUT_DIRNAME'], - dirname) - path = path.replace(generator_default_variables['RULE_INPUT_PATH'], source) - path = path.replace(generator_default_variables['RULE_INPUT_EXT'], ext) - path = path.replace(generator_default_variables['RULE_INPUT_NAME'], name) - return path - - def GypPathToNinja(self, path, env=None): - """Translate a gyp path to a ninja path, optionally expanding environment + PRODUCT_DIR = "$!PRODUCT_DIR" + if PRODUCT_DIR in path: + if product_dir: + path = path.replace(PRODUCT_DIR, product_dir) + else: + path = path.replace(PRODUCT_DIR + "/", "") + path = path.replace(PRODUCT_DIR + "\\", "") + path = path.replace(PRODUCT_DIR, ".") + + INTERMEDIATE_DIR = "$!INTERMEDIATE_DIR" + if INTERMEDIATE_DIR in path: + int_dir = self.GypPathToUniqueOutput("gen") + # GypPathToUniqueOutput generates a path relative to the product dir, + # so insert product_dir in front if it is provided. + path = path.replace( + INTERMEDIATE_DIR, os.path.join(product_dir or "", int_dir) + ) + + CONFIGURATION_NAME = "$|CONFIGURATION_NAME" + path = path.replace(CONFIGURATION_NAME, self.config_name) + + return path + + def ExpandRuleVariables(self, path, root, dirname, source, ext, name): + if self.flavor == "win": + path = self.msvs_settings.ConvertVSMacros(path, config=self.config_name) + path = path.replace(generator_default_variables["RULE_INPUT_ROOT"], root) + path = path.replace(generator_default_variables["RULE_INPUT_DIRNAME"], dirname) + path = path.replace(generator_default_variables["RULE_INPUT_PATH"], source) + path = path.replace(generator_default_variables["RULE_INPUT_EXT"], ext) + path = path.replace(generator_default_variables["RULE_INPUT_NAME"], name) + return path + + def GypPathToNinja(self, path, env=None): + """Translate a gyp path to a ninja path, optionally expanding environment variable references in |path| with |env|. See the above discourse on path conversions.""" - if env: - if self.flavor == 'mac': - path = gyp.xcode_emulation.ExpandEnvVars(path, env) - elif self.flavor == 'win': - path = gyp.msvs_emulation.ExpandMacros(path, env) - if path.startswith('$!'): - expanded = self.ExpandSpecial(path) - if self.flavor == 'win': - expanded = os.path.normpath(expanded) - return expanded - if '$|' in path: - path = self.ExpandSpecial(path) - assert '$' not in path, path - return os.path.normpath(os.path.join(self.build_to_base, path)) - - def GypPathToUniqueOutput(self, path, qualified=True): - """Translate a gyp path to a ninja path for writing output. + if env: + if self.flavor == "mac": + path = gyp.xcode_emulation.ExpandEnvVars(path, env) + elif self.flavor == "win": + path = gyp.msvs_emulation.ExpandMacros(path, env) + if path.startswith("$!"): + expanded = self.ExpandSpecial(path) + if self.flavor == "win": + expanded = os.path.normpath(expanded) + return expanded + if "$|" in path: + path = self.ExpandSpecial(path) + assert "$" not in path, path + return os.path.normpath(os.path.join(self.build_to_base, path)) + + def GypPathToUniqueOutput(self, path, qualified=True): + """Translate a gyp path to a ninja path for writing output. If qualified is True, qualify the resulting filename with the name of the target. This is necessary when e.g. compiling the same @@ -318,2109 +330,2607 @@ def GypPathToUniqueOutput(self, path, qualified=True): See the above discourse on path conversions.""" - path = self.ExpandSpecial(path) - assert not path.startswith('$'), path - - # Translate the path following this scheme: - # Input: foo/bar.gyp, target targ, references baz/out.o - # Output: obj/foo/baz/targ.out.o (if qualified) - # obj/foo/baz/out.o (otherwise) - # (and obj.host instead of obj for cross-compiles) - # - # Why this scheme and not some other one? - # 1) for a given input, you can compute all derived outputs by matching - # its path, even if the input is brought via a gyp file with '..'. - # 2) simple files like libraries and stamps have a simple filename. - - obj = 'obj' - if self.toolset != 'target': - obj += '.' + self.toolset - - path_dir, path_basename = os.path.split(path) - assert not os.path.isabs(path_dir), ( - "'%s' can not be absolute path (see crbug.com/462153)." % path_dir) - - if qualified: - path_basename = self.name + '.' + path_basename - return os.path.normpath(os.path.join(obj, self.base_dir, path_dir, - path_basename)) - - def WriteCollapsedDependencies(self, name, targets, order_only=None): - """Given a list of targets, return a path for a single file + path = self.ExpandSpecial(path) + assert not path.startswith("$"), path + + # Translate the path following this scheme: + # Input: foo/bar.gyp, target targ, references baz/out.o + # Output: obj/foo/baz/targ.out.o (if qualified) + # obj/foo/baz/out.o (otherwise) + # (and obj.host instead of obj for cross-compiles) + # + # Why this scheme and not some other one? + # 1) for a given input, you can compute all derived outputs by matching + # its path, even if the input is brought via a gyp file with '..'. + # 2) simple files like libraries and stamps have a simple filename. + + obj = "obj" + if self.toolset != "target": + obj += "." + self.toolset + + path_dir, path_basename = os.path.split(path) + assert not os.path.isabs(path_dir), ( + "'%s' can not be absolute path (see crbug.com/462153)." % path_dir + ) + + if qualified: + path_basename = self.name + "." + path_basename + return os.path.normpath( + os.path.join(obj, self.base_dir, path_dir, path_basename) + ) + + def WriteCollapsedDependencies(self, name, targets, order_only=None): + """Given a list of targets, return a path for a single file representing the result of building all the targets or None. Uses a stamp file if necessary.""" - assert targets == filter(None, targets), targets - if len(targets) == 0: - assert not order_only - return None - if len(targets) > 1 or order_only: - stamp = self.GypPathToUniqueOutput(name + '.stamp') - targets = self.ninja.build(stamp, 'stamp', targets, order_only=order_only) - self.ninja.newline() - return targets[0] + assert targets == [item for item in targets if item], targets + if len(targets) == 0: + assert not order_only + return None + if len(targets) > 1 or order_only: + stamp = self.GypPathToUniqueOutput(name + ".stamp") + targets = self.ninja.build(stamp, "stamp", targets, order_only=order_only) + self.ninja.newline() + return targets[0] - def _SubninjaNameForArch(self, arch): - output_file_base = os.path.splitext(self.output_file_name)[0] - return '%s.%s.ninja' % (output_file_base, arch) + def _SubninjaNameForArch(self, arch): + output_file_base = os.path.splitext(self.output_file_name)[0] + return "%s.%s.ninja" % (output_file_base, arch) - def WriteSpec(self, spec, config_name, generator_flags): - """The main entry point for NinjaWriter: write the build rules for a spec. + def WriteSpec(self, spec, config_name, generator_flags): + """The main entry point for NinjaWriter: write the build rules for a spec. Returns a Target object, which represents the output paths for this spec. Returns None if there are no outputs (e.g. a settings-only 'none' type target).""" - self.config_name = config_name - self.name = spec['target_name'] - self.toolset = spec['toolset'] - config = spec['configurations'][config_name] - self.target = Target(spec['type']) - self.is_standalone_static_library = bool( - spec.get('standalone_static_library', 0)) - # Track if this target contains any C++ files, to decide if gcc or g++ - # should be used for linking. - self.uses_cpp = False - - self.is_mac_bundle = gyp.xcode_emulation.IsMacBundle(self.flavor, spec) - self.xcode_settings = self.msvs_settings = None - if self.flavor == 'mac': - self.xcode_settings = gyp.xcode_emulation.XcodeSettings(spec) - if self.flavor == 'win': - self.msvs_settings = gyp.msvs_emulation.MsvsSettings(spec, - generator_flags) - arch = self.msvs_settings.GetArch(config_name) - self.ninja.variable('arch', self.win_env[arch]) - self.ninja.variable('cc', '$cl_' + arch) - self.ninja.variable('cxx', '$cl_' + arch) - self.ninja.variable('cc_host', '$cl_' + arch) - self.ninja.variable('cxx_host', '$cl_' + arch) - self.ninja.variable('asm', '$ml_' + arch) - - if self.flavor == 'mac': - self.archs = self.xcode_settings.GetActiveArchs(config_name) - if len(self.archs) > 1: - self.arch_subninjas = dict( - (arch, ninja_syntax.Writer( - OpenOutput(os.path.join(self.toplevel_build, - self._SubninjaNameForArch(arch)), - 'w'))) - for arch in self.archs) - - # Compute predepends for all rules. - # actions_depends is the dependencies this target depends on before running - # any of its action/rule/copy steps. - # compile_depends is the dependencies this target depends on before running - # any of its compile steps. - actions_depends = [] - compile_depends = [] - # TODO(evan): it is rather confusing which things are lists and which - # are strings. Fix these. - if 'dependencies' in spec: - for dep in spec['dependencies']: - if dep in self.target_outputs: - target = self.target_outputs[dep] - actions_depends.append(target.PreActionInput(self.flavor)) - compile_depends.append(target.PreCompileInput()) - actions_depends = filter(None, actions_depends) - compile_depends = filter(None, compile_depends) - actions_depends = self.WriteCollapsedDependencies('actions_depends', - actions_depends) - compile_depends = self.WriteCollapsedDependencies('compile_depends', - compile_depends) - self.target.preaction_stamp = actions_depends - self.target.precompile_stamp = compile_depends - - # Write out actions, rules, and copies. These must happen before we - # compile any sources, so compute a list of predependencies for sources - # while we do it. - extra_sources = [] - mac_bundle_depends = [] - self.target.actions_stamp = self.WriteActionsRulesCopies( - spec, extra_sources, actions_depends, mac_bundle_depends) - - # If we have actions/rules/copies, we depend directly on those, but - # otherwise we depend on dependent target's actions/rules/copies etc. - # We never need to explicitly depend on previous target's link steps, - # because no compile ever depends on them. - compile_depends_stamp = (self.target.actions_stamp or compile_depends) - - # Write out the compilation steps, if any. - link_deps = [] - sources = extra_sources + spec.get('sources', []) - if sources: - if self.flavor == 'mac' and len(self.archs) > 1: - # Write subninja file containing compile and link commands scoped to - # a single arch if a fat binary is being built. - for arch in self.archs: - self.ninja.subninja(self._SubninjaNameForArch(arch)) - - pch = None - if self.flavor == 'win': - gyp.msvs_emulation.VerifyMissingSources( - sources, self.abs_build_dir, generator_flags, self.GypPathToNinja) - pch = gyp.msvs_emulation.PrecompiledHeader( - self.msvs_settings, config_name, self.GypPathToNinja, - self.GypPathToUniqueOutput, self.obj_ext) - else: - pch = gyp.xcode_emulation.MacPrefixHeader( - self.xcode_settings, self.GypPathToNinja, - lambda path, lang: self.GypPathToUniqueOutput(path + '-' + lang)) - link_deps = self.WriteSources( - self.ninja, config_name, config, sources, compile_depends_stamp, pch, - spec) - # Some actions/rules output 'sources' that are already object files. - obj_outputs = [f for f in sources if f.endswith(self.obj_ext)] - if obj_outputs: - if self.flavor != 'mac' or len(self.archs) == 1: - link_deps += [self.GypPathToNinja(o) for o in obj_outputs] - else: - print("Warning: Actions/rules writing object files don't work with " \ - "multiarch targets, dropping. (target %s)" % spec['target_name']) - elif self.flavor == 'mac' and len(self.archs) > 1: - link_deps = collections.defaultdict(list) - - compile_deps = self.target.actions_stamp or actions_depends - if self.flavor == 'win' and self.target.type == 'static_library': - self.target.component_objs = link_deps - self.target.compile_deps = compile_deps - - # Write out a link step, if needed. - output = None - is_empty_bundle = not link_deps and not mac_bundle_depends - if link_deps or self.target.actions_stamp or actions_depends: - output = self.WriteTarget(spec, config_name, config, link_deps, - compile_deps) - if self.is_mac_bundle: - mac_bundle_depends.append(output) - - # Bundle all of the above together, if needed. - if self.is_mac_bundle: - output = self.WriteMacBundle(spec, mac_bundle_depends, is_empty_bundle) - - if not output: - return None - - assert self.target.FinalOutput(), output - return self.target - - def _WinIdlRule(self, source, prebuild, outputs): - """Handle the implicit VS .idl rule for one source file. Fills |outputs| - with files that are generated.""" - outdir, output, vars, flags = self.msvs_settings.GetIdlBuildData( - source, self.config_name) - outdir = self.GypPathToNinja(outdir) - def fix_path(path, rel=None): - path = os.path.join(outdir, path) - dirname, basename = os.path.split(source) - root, ext = os.path.splitext(basename) - path = self.ExpandRuleVariables( - path, root, dirname, source, ext, basename) - if rel: - path = os.path.relpath(path, rel) - return path - vars = [(name, fix_path(value, outdir)) for name, value in vars] - output = [fix_path(p) for p in output] - vars.append(('outdir', outdir)) - vars.append(('idlflags', flags)) - input = self.GypPathToNinja(source) - self.ninja.build(output, 'idl', input, - variables=vars, order_only=prebuild) - outputs.extend(output) - - def WriteWinIdlFiles(self, spec, prebuild): - """Writes rules to match MSVS's implicit idl handling.""" - assert self.flavor == 'win' - if self.msvs_settings.HasExplicitIdlRulesOrActions(spec): - return [] - outputs = [] - for source in filter(lambda x: x.endswith('.idl'), spec['sources']): - self._WinIdlRule(source, prebuild, outputs) - return outputs - - def WriteActionsRulesCopies(self, spec, extra_sources, prebuild, - mac_bundle_depends): - """Write out the Actions, Rules, and Copies steps. Return a path - representing the outputs of these steps.""" - outputs = [] - if self.is_mac_bundle: - mac_bundle_resources = spec.get('mac_bundle_resources', [])[:] - else: - mac_bundle_resources = [] - extra_mac_bundle_resources = [] + self.config_name = config_name + self.name = spec["target_name"] + self.toolset = spec["toolset"] + config = spec["configurations"][config_name] + self.target = Target(spec["type"]) + self.is_standalone_static_library = bool( + spec.get("standalone_static_library", 0) + ) + + self.target_rpath = generator_flags.get("target_rpath", r"\$$ORIGIN/lib/") + + self.is_mac_bundle = gyp.xcode_emulation.IsMacBundle(self.flavor, spec) + self.xcode_settings = self.msvs_settings = None + if self.flavor == "mac": + self.xcode_settings = gyp.xcode_emulation.XcodeSettings(spec) + mac_toolchain_dir = generator_flags.get("mac_toolchain_dir", None) + if mac_toolchain_dir: + self.xcode_settings.mac_toolchain_dir = mac_toolchain_dir + + if self.flavor == "win": + self.msvs_settings = gyp.msvs_emulation.MsvsSettings(spec, generator_flags) + arch = self.msvs_settings.GetArch(config_name) + self.ninja.variable("arch", self.win_env[arch]) + self.ninja.variable("cc", "$cl_" + arch) + self.ninja.variable("cxx", "$cl_" + arch) + self.ninja.variable("cc_host", "$cl_" + arch) + self.ninja.variable("cxx_host", "$cl_" + arch) + self.ninja.variable("asm", "$ml_" + arch) + + if self.flavor == "mac": + self.archs = self.xcode_settings.GetActiveArchs(config_name) + if len(self.archs) > 1: + self.arch_subninjas = dict( + ( + arch, + ninja_syntax.Writer( + OpenOutput( + os.path.join( + self.toplevel_build, self._SubninjaNameForArch(arch) + ), + "w", + ) + ), + ) + for arch in self.archs + ) + + # Compute predepends for all rules. + # actions_depends is the dependencies this target depends on before running + # any of its action/rule/copy steps. + # compile_depends is the dependencies this target depends on before running + # any of its compile steps. + actions_depends = [] + compile_depends = [] + # TODO(evan): it is rather confusing which things are lists and which + # are strings. Fix these. + if "dependencies" in spec: + for dep in spec["dependencies"]: + if dep in self.target_outputs: + target = self.target_outputs[dep] + actions_depends.append(target.PreActionInput(self.flavor)) + compile_depends.append(target.PreCompileInput()) + if target.uses_cpp: + self.target.uses_cpp = True + actions_depends = [item for item in actions_depends if item] + compile_depends = [item for item in compile_depends if item] + actions_depends = self.WriteCollapsedDependencies( + "actions_depends", actions_depends + ) + compile_depends = self.WriteCollapsedDependencies( + "compile_depends", compile_depends + ) + self.target.preaction_stamp = actions_depends + self.target.precompile_stamp = compile_depends + + # Write out actions, rules, and copies. These must happen before we + # compile any sources, so compute a list of predependencies for sources + # while we do it. + extra_sources = [] + mac_bundle_depends = [] + self.target.actions_stamp = self.WriteActionsRulesCopies( + spec, extra_sources, actions_depends, mac_bundle_depends + ) + + # If we have actions/rules/copies, we depend directly on those, but + # otherwise we depend on dependent target's actions/rules/copies etc. + # We never need to explicitly depend on previous target's link steps, + # because no compile ever depends on them. + compile_depends_stamp = self.target.actions_stamp or compile_depends + + # Write out the compilation steps, if any. + link_deps = [] + try: + sources = extra_sources + spec.get("sources", []) + except TypeError: + print("extra_sources: ", str(extra_sources)) + print('spec.get("sources"): ', str(spec.get("sources"))) + raise + if sources: + if self.flavor == "mac" and len(self.archs) > 1: + # Write subninja file containing compile and link commands scoped to + # a single arch if a fat binary is being built. + for arch in self.archs: + self.ninja.subninja(self._SubninjaNameForArch(arch)) + + pch = None + if self.flavor == "win": + gyp.msvs_emulation.VerifyMissingSources( + sources, self.abs_build_dir, generator_flags, self.GypPathToNinja + ) + pch = gyp.msvs_emulation.PrecompiledHeader( + self.msvs_settings, + config_name, + self.GypPathToNinja, + self.GypPathToUniqueOutput, + self.obj_ext, + ) + else: + pch = gyp.xcode_emulation.MacPrefixHeader( + self.xcode_settings, + self.GypPathToNinja, + lambda path, lang: self.GypPathToUniqueOutput(path + "-" + lang), + ) + link_deps = self.WriteSources( + self.ninja, + config_name, + config, + sources, + compile_depends_stamp, + pch, + spec, + ) + # Some actions/rules output 'sources' that are already object files. + obj_outputs = [f for f in sources if f.endswith(self.obj_ext)] + if obj_outputs: + if self.flavor != "mac" or len(self.archs) == 1: + link_deps += [self.GypPathToNinja(o) for o in obj_outputs] + else: + print( + "Warning: Actions/rules writing object files don't work with " + "multiarch targets, dropping. (target %s)" % spec["target_name"] + ) + elif self.flavor == "mac" and len(self.archs) > 1: + link_deps = collections.defaultdict(list) + + compile_deps = self.target.actions_stamp or actions_depends + if self.flavor == "win" and self.target.type == "static_library": + self.target.component_objs = link_deps + self.target.compile_deps = compile_deps + + # Write out a link step, if needed. + output = None + is_empty_bundle = not link_deps and not mac_bundle_depends + if link_deps or self.target.actions_stamp or actions_depends: + output = self.WriteTarget( + spec, config_name, config, link_deps, compile_deps + ) + if self.is_mac_bundle: + mac_bundle_depends.append(output) + + # Bundle all of the above together, if needed. + if self.is_mac_bundle: + output = self.WriteMacBundle(spec, mac_bundle_depends, is_empty_bundle) - if 'actions' in spec: - outputs += self.WriteActions(spec['actions'], extra_sources, prebuild, - extra_mac_bundle_resources) - if 'rules' in spec: - outputs += self.WriteRules(spec['rules'], extra_sources, prebuild, - mac_bundle_resources, - extra_mac_bundle_resources) - if 'copies' in spec: - outputs += self.WriteCopies(spec['copies'], prebuild, mac_bundle_depends) + if not output: + return None - if 'sources' in spec and self.flavor == 'win': - outputs += self.WriteWinIdlFiles(spec, prebuild) + assert self.target.FinalOutput(), output + return self.target - stamp = self.WriteCollapsedDependencies('actions_rules_copies', outputs) + def _WinIdlRule(self, source, prebuild, outputs): + """Handle the implicit VS .idl rule for one source file. Fills |outputs| + with files that are generated.""" + outdir, output, vars, flags = self.msvs_settings.GetIdlBuildData( + source, self.config_name + ) + outdir = self.GypPathToNinja(outdir) + + def fix_path(path, rel=None): + path = os.path.join(outdir, path) + dirname, basename = os.path.split(source) + root, ext = os.path.splitext(basename) + path = self.ExpandRuleVariables(path, root, dirname, source, ext, basename) + if rel: + path = os.path.relpath(path, rel) + return path + + vars = [(name, fix_path(value, outdir)) for name, value in vars] + output = [fix_path(p) for p in output] + vars.append(("outdir", outdir)) + vars.append(("idlflags", flags)) + input = self.GypPathToNinja(source) + self.ninja.build(output, "idl", input, variables=vars, order_only=prebuild) + outputs.extend(output) + + def WriteWinIdlFiles(self, spec, prebuild): + """Writes rules to match MSVS's implicit idl handling.""" + assert self.flavor == "win" + if self.msvs_settings.HasExplicitIdlRulesOrActions(spec): + return [] + outputs = [] + for source in filter(lambda x: x.endswith(".idl"), spec["sources"]): + self._WinIdlRule(source, prebuild, outputs) + return outputs + + def WriteActionsRulesCopies( + self, spec, extra_sources, prebuild, mac_bundle_depends + ): + """Write out the Actions, Rules, and Copies steps. Return a path + representing the outputs of these steps.""" + outputs = [] + if self.is_mac_bundle: + mac_bundle_resources = spec.get("mac_bundle_resources", [])[:] + else: + mac_bundle_resources = [] + extra_mac_bundle_resources = [] + + if "actions" in spec: + outputs += self.WriteActions( + spec["actions"], extra_sources, prebuild, extra_mac_bundle_resources + ) + if "rules" in spec: + outputs += self.WriteRules( + spec["rules"], + extra_sources, + prebuild, + mac_bundle_resources, + extra_mac_bundle_resources, + ) + if "copies" in spec: + outputs += self.WriteCopies(spec["copies"], prebuild, mac_bundle_depends) + + if "sources" in spec and self.flavor == "win": + outputs += self.WriteWinIdlFiles(spec, prebuild) + + if self.xcode_settings and self.xcode_settings.IsIosFramework(): + self.WriteiOSFrameworkHeaders(spec, outputs, prebuild) + + stamp = self.WriteCollapsedDependencies("actions_rules_copies", outputs) - if self.is_mac_bundle: - xcassets = self.WriteMacBundleResources( - extra_mac_bundle_resources + mac_bundle_resources, mac_bundle_depends) - partial_info_plist = self.WriteMacXCassets(xcassets, mac_bundle_depends) - self.WriteMacInfoPlist(partial_info_plist, mac_bundle_depends) + if self.is_mac_bundle: + xcassets = self.WriteMacBundleResources( + extra_mac_bundle_resources + mac_bundle_resources, mac_bundle_depends + ) + partial_info_plist = self.WriteMacXCassets(xcassets, mac_bundle_depends) + self.WriteMacInfoPlist(partial_info_plist, mac_bundle_depends) - return stamp + return stamp - def GenerateDescription(self, verb, message, fallback): - """Generate and return a description of a build step. + def GenerateDescription(self, verb, message, fallback): + """Generate and return a description of a build step. |verb| is the short summary, e.g. ACTION or RULE. |message| is a hand-written description, or None if not available. |fallback| is the gyp-level name of the step, usable as a fallback. """ - if self.toolset != 'target': - verb += '(%s)' % self.toolset - if message: - return '%s %s' % (verb, self.ExpandSpecial(message)) - else: - return '%s %s: %s' % (verb, self.name, fallback) - - def WriteActions(self, actions, extra_sources, prebuild, - extra_mac_bundle_resources): - # Actions cd into the base directory. - env = self.GetToolchainEnv() - all_outputs = [] - for action in actions: - # First write out a rule for the action. - name = '%s_%s' % (action['action_name'], self.hash_for_rules) - description = self.GenerateDescription('ACTION', - action.get('message', None), - name) - is_cygwin = (self.msvs_settings.IsRuleRunUnderCygwin(action) - if self.flavor == 'win' else False) - args = action['action'] - depfile = action.get('depfile', None) - if depfile: - depfile = self.ExpandSpecial(depfile, self.base_to_build) - pool = 'console' if int(action.get('ninja_use_console', 0)) else None - rule_name, _ = self.WriteNewNinjaRule(name, args, description, - is_cygwin, env, pool, - depfile=depfile) - - inputs = [self.GypPathToNinja(i, env) for i in action['inputs']] - if int(action.get('process_outputs_as_sources', False)): - extra_sources += action['outputs'] - if int(action.get('process_outputs_as_mac_bundle_resources', False)): - extra_mac_bundle_resources += action['outputs'] - outputs = [self.GypPathToNinja(o, env) for o in action['outputs']] - - # Then write out an edge using the rule. - self.ninja.build(outputs, rule_name, inputs, - order_only=prebuild) - all_outputs += outputs - - self.ninja.newline() - - return all_outputs - - def WriteRules(self, rules, extra_sources, prebuild, - mac_bundle_resources, extra_mac_bundle_resources): - env = self.GetToolchainEnv() - all_outputs = [] - for rule in rules: - # Skip a rule with no action and no inputs. - if 'action' not in rule and not rule.get('rule_sources', []): - continue - - # First write out a rule for the rule action. - name = '%s_%s' % (rule['rule_name'], self.hash_for_rules) - - args = rule['action'] - description = self.GenerateDescription( - 'RULE', - rule.get('message', None), - ('%s ' + generator_default_variables['RULE_INPUT_PATH']) % name) - is_cygwin = (self.msvs_settings.IsRuleRunUnderCygwin(rule) - if self.flavor == 'win' else False) - pool = 'console' if int(rule.get('ninja_use_console', 0)) else None - rule_name, args = self.WriteNewNinjaRule( - name, args, description, is_cygwin, env, pool) - - # TODO: if the command references the outputs directly, we should - # simplify it to just use $out. - - # Rules can potentially make use of some special variables which - # must vary per source file. - # Compute the list of variables we'll need to provide. - special_locals = ('source', 'root', 'dirname', 'ext', 'name') - needed_variables = set(['source']) - for argument in args: - for var in special_locals: - if '${%s}' % var in argument: - needed_variables.add(var) - - def cygwin_munge(path): - # pylint: disable=cell-var-from-loop - if is_cygwin: - return path.replace('\\', '/') - return path - - inputs = [self.GypPathToNinja(i, env) for i in rule.get('inputs', [])] - - # If there are n source files matching the rule, and m additional rule - # inputs, then adding 'inputs' to each build edge written below will - # write m * n inputs. Collapsing reduces this to m + n. - sources = rule.get('rule_sources', []) - num_inputs = len(inputs) - if prebuild: - num_inputs += 1 - if num_inputs > 2 and len(sources) > 2: - inputs = [self.WriteCollapsedDependencies( - rule['rule_name'], inputs, order_only=prebuild)] - prebuild = [] - - # For each source file, write an edge that generates all the outputs. - for source in sources: - source = os.path.normpath(source) - dirname, basename = os.path.split(source) - root, ext = os.path.splitext(basename) - - # Gather the list of inputs and outputs, expanding $vars if possible. - outputs = [self.ExpandRuleVariables(o, root, dirname, - source, ext, basename) - for o in rule['outputs']] - - if int(rule.get('process_outputs_as_sources', False)): - extra_sources += outputs - - was_mac_bundle_resource = source in mac_bundle_resources - if was_mac_bundle_resource or \ - int(rule.get('process_outputs_as_mac_bundle_resources', False)): - extra_mac_bundle_resources += outputs - # Note: This is n_resources * n_outputs_in_rule. Put to-be-removed - # items in a set and remove them all in a single pass if this becomes - # a performance issue. - if was_mac_bundle_resource: - mac_bundle_resources.remove(source) - - extra_bindings = [] - for var in needed_variables: - if var == 'root': - extra_bindings.append(('root', cygwin_munge(root))) - elif var == 'dirname': - # '$dirname' is a parameter to the rule action, which means - # it shouldn't be converted to a Ninja path. But we don't - # want $!PRODUCT_DIR in there either. - dirname_expanded = self.ExpandSpecial(dirname, self.base_to_build) - extra_bindings.append(('dirname', cygwin_munge(dirname_expanded))) - elif var == 'source': - # '$source' is a parameter to the rule action, which means - # it shouldn't be converted to a Ninja path. But we don't - # want $!PRODUCT_DIR in there either. - source_expanded = self.ExpandSpecial(source, self.base_to_build) - extra_bindings.append(('source', cygwin_munge(source_expanded))) - elif var == 'ext': - extra_bindings.append(('ext', ext)) - elif var == 'name': - extra_bindings.append(('name', cygwin_munge(basename))) - else: - assert var is None, repr(var) - - outputs = [self.GypPathToNinja(o, env) for o in outputs] - if self.flavor == 'win': - # WriteNewNinjaRule uses unique_name for creating an rsp file on win. - extra_bindings.append(('unique_name', - hashlib.md5(outputs[0]).hexdigest())) - self.ninja.build(outputs, rule_name, self.GypPathToNinja(source), - implicit=inputs, - order_only=prebuild, - variables=extra_bindings) - - all_outputs.extend(outputs) - - return all_outputs - - def WriteCopies(self, copies, prebuild, mac_bundle_depends): - outputs = [] - env = self.GetToolchainEnv() - for copy in copies: - for path in copy['files']: - # Normalize the path so trailing slashes don't confuse us. - path = os.path.normpath(path) - basename = os.path.split(path)[1] - src = self.GypPathToNinja(path, env) - dst = self.GypPathToNinja(os.path.join(copy['destination'], basename), - env) - outputs += self.ninja.build(dst, 'copy', src, order_only=prebuild) - if self.is_mac_bundle: - # gyp has mac_bundle_resources to copy things into a bundle's - # Resources folder, but there's no built-in way to copy files to other - # places in the bundle. Hence, some targets use copies for this. Check - # if this file is copied into the current bundle, and if so add it to - # the bundle depends so that dependent targets get rebuilt if the copy - # input changes. - if dst.startswith(self.xcode_settings.GetBundleContentsFolderPath()): - mac_bundle_depends.append(dst) - - return outputs - - def WriteMacBundleResources(self, resources, bundle_depends): - """Writes ninja edges for 'mac_bundle_resources'.""" - xcassets = [] - for output, res in gyp.xcode_emulation.GetMacBundleResources( - generator_default_variables['PRODUCT_DIR'], - self.xcode_settings, map(self.GypPathToNinja, resources)): - output = self.ExpandSpecial(output) - if os.path.splitext(output)[-1] != '.xcassets': + if self.toolset != "target": + verb += "(%s)" % self.toolset + if message: + return "%s %s" % (verb, self.ExpandSpecial(message)) + else: + return "%s %s: %s" % (verb, self.name, fallback) + + def WriteActions( + self, actions, extra_sources, prebuild, extra_mac_bundle_resources + ): + # Actions cd into the base directory. + env = self.GetToolchainEnv() + all_outputs = [] + for action in actions: + # First write out a rule for the action. + name = "%s_%s" % (action["action_name"], self.hash_for_rules) + description = self.GenerateDescription( + "ACTION", action.get("message", None), name + ) + is_cygwin = ( + self.msvs_settings.IsRuleRunUnderCygwin(action) + if self.flavor == "win" + else False + ) + args = action["action"] + depfile = action.get("depfile", None) + if depfile: + depfile = self.ExpandSpecial(depfile, self.base_to_build) + pool = "console" if int(action.get("ninja_use_console", 0)) else None + rule_name, _ = self.WriteNewNinjaRule( + name, args, description, is_cygwin, env, pool, depfile=depfile + ) + + inputs = [self.GypPathToNinja(i, env) for i in action["inputs"]] + if int(action.get("process_outputs_as_sources", False)): + extra_sources += action["outputs"] + if int(action.get("process_outputs_as_mac_bundle_resources", False)): + extra_mac_bundle_resources += action["outputs"] + outputs = [self.GypPathToNinja(o, env) for o in action["outputs"]] + + # Then write out an edge using the rule. + self.ninja.build(outputs, rule_name, inputs, order_only=prebuild) + all_outputs += outputs + + self.ninja.newline() + + return all_outputs + + def WriteRules( + self, + rules, + extra_sources, + prebuild, + mac_bundle_resources, + extra_mac_bundle_resources, + ): + env = self.GetToolchainEnv() + all_outputs = [] + for rule in rules: + # Skip a rule with no action and no inputs. + if "action" not in rule and not rule.get("rule_sources", []): + continue + + # First write out a rule for the rule action. + name = "%s_%s" % (rule["rule_name"], self.hash_for_rules) + + args = rule["action"] + description = self.GenerateDescription( + "RULE", + rule.get("message", None), + ("%s " + generator_default_variables["RULE_INPUT_PATH"]) % name, + ) + is_cygwin = ( + self.msvs_settings.IsRuleRunUnderCygwin(rule) + if self.flavor == "win" + else False + ) + pool = "console" if int(rule.get("ninja_use_console", 0)) else None + rule_name, args = self.WriteNewNinjaRule( + name, args, description, is_cygwin, env, pool + ) + + # TODO: if the command references the outputs directly, we should + # simplify it to just use $out. + + # Rules can potentially make use of some special variables which + # must vary per source file. + # Compute the list of variables we'll need to provide. + special_locals = ("source", "root", "dirname", "ext", "name") + needed_variables = set(["source"]) + for argument in args: + for var in special_locals: + if "${%s}" % var in argument: + needed_variables.add(var) + needed_variables = sorted(needed_variables) + + def cygwin_munge(path): + # pylint: disable=cell-var-from-loop + if is_cygwin: + return path.replace("\\", "/") + return path + + inputs = [self.GypPathToNinja(i, env) for i in rule.get("inputs", [])] + + # If there are n source files matching the rule, and m additional rule + # inputs, then adding 'inputs' to each build edge written below will + # write m * n inputs. Collapsing reduces this to m + n. + sources = rule.get("rule_sources", []) + num_inputs = len(inputs) + if prebuild: + num_inputs += 1 + if num_inputs > 2 and len(sources) > 2: + inputs = [ + self.WriteCollapsedDependencies( + rule["rule_name"], inputs, order_only=prebuild + ) + ] + prebuild = [] + + # For each source file, write an edge that generates all the outputs. + for source in sources: + source = os.path.normpath(source) + dirname, basename = os.path.split(source) + root, ext = os.path.splitext(basename) + + # Gather the list of inputs and outputs, expanding $vars if possible. + outputs = [ + self.ExpandRuleVariables(o, root, dirname, source, ext, basename) + for o in rule["outputs"] + ] + + if int(rule.get("process_outputs_as_sources", False)): + extra_sources += outputs + + was_mac_bundle_resource = source in mac_bundle_resources + if was_mac_bundle_resource or int( + rule.get("process_outputs_as_mac_bundle_resources", False) + ): + extra_mac_bundle_resources += outputs + # Note: This is n_resources * n_outputs_in_rule. Put to-be-removed + # items in a set and remove them all in a single pass if this becomes + # a performance issue. + if was_mac_bundle_resource: + mac_bundle_resources.remove(source) + + extra_bindings = [] + for var in needed_variables: + if var == "root": + extra_bindings.append(("root", cygwin_munge(root))) + elif var == "dirname": + # '$dirname' is a parameter to the rule action, which means + # it shouldn't be converted to a Ninja path. But we don't + # want $!PRODUCT_DIR in there either. + dirname_expanded = self.ExpandSpecial( + dirname, self.base_to_build + ) + extra_bindings.append( + ("dirname", cygwin_munge(dirname_expanded)) + ) + elif var == "source": + # '$source' is a parameter to the rule action, which means + # it shouldn't be converted to a Ninja path. But we don't + # want $!PRODUCT_DIR in there either. + source_expanded = self.ExpandSpecial(source, self.base_to_build) + extra_bindings.append(("source", cygwin_munge(source_expanded))) + elif var == "ext": + extra_bindings.append(("ext", ext)) + elif var == "name": + extra_bindings.append(("name", cygwin_munge(basename))) + else: + assert var is None, repr(var) + + outputs = [self.GypPathToNinja(o, env) for o in outputs] + if self.flavor == "win": + # WriteNewNinjaRule uses unique_name for creating an rsp file on win. + extra_bindings.append( + ("unique_name", hashlib.md5(outputs[0]).hexdigest()) + ) + + self.ninja.build( + outputs, + rule_name, + self.GypPathToNinja(source), + implicit=inputs, + order_only=prebuild, + variables=extra_bindings, + ) + + all_outputs.extend(outputs) + + return all_outputs + + def WriteCopies(self, copies, prebuild, mac_bundle_depends): + outputs = [] + if self.xcode_settings: + extra_env = self.xcode_settings.GetPerTargetSettings() + env = self.GetToolchainEnv(additional_settings=extra_env) + else: + env = self.GetToolchainEnv() + for to_copy in copies: + for path in to_copy["files"]: + # Normalize the path so trailing slashes don't confuse us. + path = os.path.normpath(path) + basename = os.path.split(path)[1] + src = self.GypPathToNinja(path, env) + dst = self.GypPathToNinja( + os.path.join(to_copy["destination"], basename), env + ) + outputs += self.ninja.build(dst, "copy", src, order_only=prebuild) + if self.is_mac_bundle: + # gyp has mac_bundle_resources to copy things into a bundle's + # Resources folder, but there's no built-in way to copy files to other + # places in the bundle. Hence, some targets use copies for this. Check + # if this file is copied into the current bundle, and if so add it to + # the bundle depends so that dependent targets get rebuilt if the copy + # input changes. + if dst.startswith( + self.xcode_settings.GetBundleContentsFolderPath() + ): + mac_bundle_depends.append(dst) + + return outputs + + def WriteiOSFrameworkHeaders(self, spec, outputs, prebuild): + """Prebuild steps to generate hmap files and copy headers to destination.""" + framework = self.ComputeMacBundleOutput() + all_sources = spec["sources"] + copy_headers = spec["mac_framework_headers"] + output = self.GypPathToUniqueOutput("headers.hmap") + self.xcode_settings.header_map_path = output + all_headers = map( + self.GypPathToNinja, filter(lambda x: x.endswith((".h")), all_sources) + ) + variables = [ + ("framework", framework), + ("copy_headers", map(self.GypPathToNinja, copy_headers)), + ] + outputs.extend( + self.ninja.build( + output, + "compile_ios_framework_headers", + all_headers, + variables=variables, + order_only=prebuild, + ) + ) + + def WriteMacBundleResources(self, resources, bundle_depends): + """Writes ninja edges for 'mac_bundle_resources'.""" + xcassets = [] + + extra_env = self.xcode_settings.GetPerTargetSettings() + env = self.GetSortedXcodeEnv(additional_settings=extra_env) + env = self.ComputeExportEnvString(env) isBinary = self.xcode_settings.IsBinaryOutputFormat(self.config_name) - self.ninja.build(output, 'mac_tool', res, - variables=[('mactool_cmd', 'copy-bundle-resource'), \ - ('binary', isBinary)]) - bundle_depends.append(output) - else: - xcassets.append(res) - return xcassets - def WriteMacXCassets(self, xcassets, bundle_depends): - """Writes ninja edges for 'mac_bundle_resources' .xcassets files. + for output, res in gyp.xcode_emulation.GetMacBundleResources( + generator_default_variables["PRODUCT_DIR"], + self.xcode_settings, + map(self.GypPathToNinja, resources), + ): + output = self.ExpandSpecial(output) + if os.path.splitext(output)[-1] != ".xcassets": + self.ninja.build( + output, + "mac_tool", + res, + variables=[ + ("mactool_cmd", "copy-bundle-resource"), + ("env", env), + ("binary", isBinary), + ], + ) + bundle_depends.append(output) + else: + xcassets.append(res) + return xcassets + + def WriteMacXCassets(self, xcassets, bundle_depends): + """Writes ninja edges for 'mac_bundle_resources' .xcassets files. This add an invocation of 'actool' via the 'mac_tool.py' helper script. It assumes that the assets catalogs define at least one imageset and thus an Assets.car file will be generated in the application resources directory. If this is not the case, then the build will probably be done at each invocation of ninja.""" - if not xcassets: - return - - extra_arguments = {} - settings_to_arg = { - 'XCASSETS_APP_ICON': 'app-icon', - 'XCASSETS_LAUNCH_IMAGE': 'launch-image', - } - settings = self.xcode_settings.xcode_settings[self.config_name] - for settings_key, arg_name in settings_to_arg.items(): - value = settings.get(settings_key) - if value: - extra_arguments[arg_name] = value - - partial_info_plist = None - if extra_arguments: - partial_info_plist = self.GypPathToUniqueOutput( - 'assetcatalog_generated_info.plist') - extra_arguments['output-partial-info-plist'] = partial_info_plist - - outputs = [] - outputs.append( - os.path.join( - self.xcode_settings.GetBundleResourceFolder(), - 'Assets.car')) - if partial_info_plist: - outputs.append(partial_info_plist) - - keys = QuoteShellArgument(json.dumps(extra_arguments), self.flavor) - extra_env = self.xcode_settings.GetPerTargetSettings() - env = self.GetSortedXcodeEnv(additional_settings=extra_env) - env = self.ComputeExportEnvString(env) - - bundle_depends.extend(self.ninja.build( - outputs, 'compile_xcassets', xcassets, - variables=[('env', env), ('keys', keys)])) - return partial_info_plist - - def WriteMacInfoPlist(self, partial_info_plist, bundle_depends): - """Write build rules for bundle Info.plist files.""" - info_plist, out, defines, extra_env = gyp.xcode_emulation.GetMacInfoPlist( - generator_default_variables['PRODUCT_DIR'], - self.xcode_settings, self.GypPathToNinja) - if not info_plist: - return - out = self.ExpandSpecial(out) - if defines: - # Create an intermediate file to store preprocessed results. - intermediate_plist = self.GypPathToUniqueOutput( - os.path.basename(info_plist)) - defines = ' '.join([Define(d, self.flavor) for d in defines]) - info_plist = self.ninja.build( - intermediate_plist, 'preprocess_infoplist', info_plist, - variables=[('defines',defines)]) - - env = self.GetSortedXcodeEnv(additional_settings=extra_env) - env = self.ComputeExportEnvString(env) - - if partial_info_plist: - intermediate_plist = self.GypPathToUniqueOutput('merged_info.plist') - info_plist = self.ninja.build( - intermediate_plist, 'merge_infoplist', - [partial_info_plist, info_plist]) - - keys = self.xcode_settings.GetExtraPlistItems(self.config_name) - keys = QuoteShellArgument(json.dumps(keys), self.flavor) - isBinary = self.xcode_settings.IsBinaryOutputFormat(self.config_name) - self.ninja.build(out, 'copy_infoplist', info_plist, - variables=[('env', env), ('keys', keys), - ('binary', isBinary)]) - bundle_depends.append(out) - - def WriteSources(self, ninja_file, config_name, config, sources, predepends, - precompiled_header, spec): - """Write build rules to compile all of |sources|.""" - if self.toolset == 'host': - self.ninja.variable('ar', '$ar_host') - self.ninja.variable('cc', '$cc_host') - self.ninja.variable('cxx', '$cxx_host') - self.ninja.variable('ld', '$ld_host') - self.ninja.variable('ldxx', '$ldxx_host') - self.ninja.variable('nm', '$nm_host') - self.ninja.variable('readelf', '$readelf_host') - - if self.flavor != 'mac' or len(self.archs) == 1: - return self.WriteSourcesForArch( - self.ninja, config_name, config, sources, predepends, - precompiled_header, spec) - else: - return dict((arch, self.WriteSourcesForArch( - self.arch_subninjas[arch], config_name, config, sources, predepends, - precompiled_header, spec, arch=arch)) - for arch in self.archs) - - def WriteSourcesForArch(self, ninja_file, config_name, config, sources, - predepends, precompiled_header, spec, arch=None): - """Write build rules to compile all of |sources|.""" - - extra_defines = [] - if self.flavor == 'mac': - cflags = self.xcode_settings.GetCflags(config_name, arch=arch) - cflags_c = self.xcode_settings.GetCflagsC(config_name) - cflags_cc = self.xcode_settings.GetCflagsCC(config_name) - cflags_objc = ['$cflags_c'] + \ - self.xcode_settings.GetCflagsObjC(config_name) - cflags_objcc = ['$cflags_cc'] + \ - self.xcode_settings.GetCflagsObjCC(config_name) - elif self.flavor == 'win': - asmflags = self.msvs_settings.GetAsmflags(config_name) - cflags = self.msvs_settings.GetCflags(config_name) - cflags_c = self.msvs_settings.GetCflagsC(config_name) - cflags_cc = self.msvs_settings.GetCflagsCC(config_name) - extra_defines = self.msvs_settings.GetComputedDefines(config_name) - # See comment at cc_command for why there's two .pdb files. - pdbpath_c = pdbpath_cc = self.msvs_settings.GetCompilerPdbName( - config_name, self.ExpandSpecial) - if not pdbpath_c: - obj = 'obj' - if self.toolset != 'target': - obj += '.' + self.toolset - pdbpath = os.path.normpath(os.path.join(obj, self.base_dir, self.name)) - pdbpath_c = pdbpath + '.c.pdb' - pdbpath_cc = pdbpath + '.cc.pdb' - self.WriteVariableList(ninja_file, 'pdbname_c', [pdbpath_c]) - self.WriteVariableList(ninja_file, 'pdbname_cc', [pdbpath_cc]) - self.WriteVariableList(ninja_file, 'pchprefix', [self.name]) - else: - cflags = config.get('cflags', []) - cflags_c = config.get('cflags_c', []) - cflags_cc = config.get('cflags_cc', []) - - # Respect environment variables related to build, but target-specific - # flags can still override them. - if self.toolset == 'target': - cflags_c = (os.environ.get('CPPFLAGS', '').split() + - os.environ.get('CFLAGS', '').split() + cflags_c) - cflags_cc = (os.environ.get('CPPFLAGS', '').split() + - os.environ.get('CXXFLAGS', '').split() + cflags_cc) - elif self.toolset == 'host': - cflags_c = (os.environ.get('CPPFLAGS_host', '').split() + - os.environ.get('CFLAGS_host', '').split() + cflags_c) - cflags_cc = (os.environ.get('CPPFLAGS_host', '').split() + - os.environ.get('CXXFLAGS_host', '').split() + cflags_cc) - - defines = config.get('defines', []) + extra_defines - self.WriteVariableList(ninja_file, 'defines', - [Define(d, self.flavor) for d in defines]) - if self.flavor == 'win': - self.WriteVariableList(ninja_file, 'asmflags', - map(self.ExpandSpecial, asmflags)) - self.WriteVariableList(ninja_file, 'rcflags', - [QuoteShellArgument(self.ExpandSpecial(f), self.flavor) - for f in self.msvs_settings.GetRcflags(config_name, - self.GypPathToNinja)]) - - include_dirs = config.get('include_dirs', []) - - env = self.GetToolchainEnv() - if self.flavor == 'win': - include_dirs = self.msvs_settings.AdjustIncludeDirs(include_dirs, - config_name) - self.WriteVariableList(ninja_file, 'includes', - [QuoteShellArgument('-I' + self.GypPathToNinja(i, env), self.flavor) - for i in include_dirs]) - - if self.flavor == 'win': - midl_include_dirs = config.get('midl_include_dirs', []) - midl_include_dirs = self.msvs_settings.AdjustMidlIncludeDirs( - midl_include_dirs, config_name) - self.WriteVariableList(ninja_file, 'midl_includes', - [QuoteShellArgument('-I' + self.GypPathToNinja(i, env), self.flavor) - for i in midl_include_dirs]) - - pch_commands = precompiled_header.GetPchBuildCommands(arch) - if self.flavor == 'mac': - # Most targets use no precompiled headers, so only write these if needed. - for ext, var in [('c', 'cflags_pch_c'), ('cc', 'cflags_pch_cc'), - ('m', 'cflags_pch_objc'), ('mm', 'cflags_pch_objcc')]: - include = precompiled_header.GetInclude(ext, arch) - if include: ninja_file.variable(var, include) - - arflags = config.get('arflags', []) - - self.WriteVariableList(ninja_file, 'cflags', - map(self.ExpandSpecial, cflags)) - self.WriteVariableList(ninja_file, 'cflags_c', - map(self.ExpandSpecial, cflags_c)) - self.WriteVariableList(ninja_file, 'cflags_cc', - map(self.ExpandSpecial, cflags_cc)) - if self.flavor == 'mac': - self.WriteVariableList(ninja_file, 'cflags_objc', - map(self.ExpandSpecial, cflags_objc)) - self.WriteVariableList(ninja_file, 'cflags_objcc', - map(self.ExpandSpecial, cflags_objcc)) - self.WriteVariableList(ninja_file, 'arflags', - map(self.ExpandSpecial, arflags)) - ninja_file.newline() - outputs = [] - has_rc_source = False - for source in sources: - filename, ext = os.path.splitext(source) - ext = ext[1:] - obj_ext = self.obj_ext - if ext in ('cc', 'cpp', 'cxx'): - command = 'cxx' - self.uses_cpp = True - elif ext == 'c' or (ext == 'S' and self.flavor != 'win'): - command = 'cc' - elif ext == 's' and self.flavor != 'win': # Doesn't generate .o.d files. - command = 'cc_s' - elif (self.flavor == 'win' and ext == 'asm' and - not self.msvs_settings.HasExplicitAsmRules(spec)): - command = 'asm' - # Add the _asm suffix as msvs is capable of handling .cc and - # .asm files of the same name without collision. - obj_ext = '_asm.obj' - elif self.flavor == 'mac' and ext == 'm': - command = 'objc' - elif self.flavor == 'mac' and ext == 'mm': - command = 'objcxx' - self.uses_cpp = True - elif self.flavor == 'win' and ext == 'rc': - command = 'rc' - obj_ext = '.res' - has_rc_source = True - else: - # Ignore unhandled extensions. - continue - input = self.GypPathToNinja(source) - output = self.GypPathToUniqueOutput(filename + obj_ext) - if arch is not None: - output = AddArch(output, arch) - implicit = precompiled_header.GetObjDependencies([input], [output], arch) - variables = [] - if self.flavor == 'win': - variables, output, implicit = precompiled_header.GetFlagsModifications( - input, output, implicit, command, cflags_c, cflags_cc, - self.ExpandSpecial) - ninja_file.build(output, command, input, - implicit=[gch for _, _, gch in implicit], - order_only=predepends, variables=variables) - outputs.append(output) - - if has_rc_source: - resource_include_dirs = config.get('resource_include_dirs', include_dirs) - self.WriteVariableList(ninja_file, 'resource_includes', - [QuoteShellArgument('-I' + self.GypPathToNinja(i, env), self.flavor) - for i in resource_include_dirs]) - - self.WritePchTargets(ninja_file, pch_commands) - - ninja_file.newline() - return outputs - - def WritePchTargets(self, ninja_file, pch_commands): - """Writes ninja rules to compile prefix headers.""" - if not pch_commands: - return - - for gch, lang_flag, lang, input in pch_commands: - var_name = { - 'c': 'cflags_pch_c', - 'cc': 'cflags_pch_cc', - 'm': 'cflags_pch_objc', - 'mm': 'cflags_pch_objcc', - }[lang] - - map = { 'c': 'cc', 'cc': 'cxx', 'm': 'objc', 'mm': 'objcxx', } - cmd = map.get(lang) - ninja_file.build(gch, cmd, input, variables=[(var_name, lang_flag)]) - - def WriteLink(self, spec, config_name, config, link_deps): - """Write out a link step. Fills out target.binary. """ - if self.flavor != 'mac' or len(self.archs) == 1: - return self.WriteLinkForArch( - self.ninja, spec, config_name, config, link_deps) - else: - output = self.ComputeOutput(spec) - inputs = [self.WriteLinkForArch(self.arch_subninjas[arch], spec, - config_name, config, link_deps[arch], - arch=arch) - for arch in self.archs] - extra_bindings = [] - build_output = output - if not self.is_mac_bundle: - self.AppendPostbuildVariable(extra_bindings, spec, output, output) - - # TODO(yyanagisawa): more work needed to fix: - # https://code.google.com/p/gyp/issues/detail?id=411 - if (spec['type'] in ('shared_library', 'loadable_module') and - not self.is_mac_bundle): - extra_bindings.append(('lib', output)) - self.ninja.build([output, output + '.TOC'], 'solipo', inputs, - variables=extra_bindings) - else: - self.ninja.build(build_output, 'lipo', inputs, variables=extra_bindings) - return output - - def WriteLinkForArch(self, ninja_file, spec, config_name, config, - link_deps, arch=None): - """Write out a link step. Fills out target.binary. """ - command = { - 'executable': 'link', - 'loadable_module': 'solink_module', - 'shared_library': 'solink', - }[spec['type']] - command_suffix = '' - - implicit_deps = set() - solibs = set() - order_deps = set() - - if 'dependencies' in spec: - # Two kinds of dependencies: - # - Linkable dependencies (like a .a or a .so): add them to the link line. - # - Non-linkable dependencies (like a rule that generates a file - # and writes a stamp file): add them to implicit_deps - extra_link_deps = set() - for dep in spec['dependencies']: - target = self.target_outputs.get(dep) - if not target: - continue - linkable = target.Linkable() - if linkable: - new_deps = [] - if (self.flavor == 'win' and - target.component_objs and - self.msvs_settings.IsUseLibraryDependencyInputs(config_name)): - new_deps = target.component_objs - if target.compile_deps: - order_deps.add(target.compile_deps) - elif self.flavor == 'win' and target.import_lib: - new_deps = [target.import_lib] - elif target.UsesToc(self.flavor): - solibs.add(target.binary) - implicit_deps.add(target.binary + '.TOC') - else: - new_deps = [target.binary] - for new_dep in new_deps: - if new_dep not in extra_link_deps: - extra_link_deps.add(new_dep) - link_deps.append(new_dep) - - final_output = target.FinalOutput() - if not linkable or final_output != target.binary: - implicit_deps.add(final_output) - - extra_bindings = [] - if self.uses_cpp and self.flavor != 'win': - extra_bindings.append(('ld', '$ldxx')) - - output = self.ComputeOutput(spec, arch) - if arch is None and not self.is_mac_bundle: - self.AppendPostbuildVariable(extra_bindings, spec, output, output) - - is_executable = spec['type'] == 'executable' - # The ldflags config key is not used on mac or win. On those platforms - # linker flags are set via xcode_settings and msvs_settings, respectively. - env_ldflags = os.environ.get('LDFLAGS', '').split() - if self.flavor == 'mac': - ldflags = self.xcode_settings.GetLdflags(config_name, - self.ExpandSpecial(generator_default_variables['PRODUCT_DIR']), - self.GypPathToNinja, arch) - ldflags = env_ldflags + ldflags - elif self.flavor == 'win': - manifest_base_name = self.GypPathToUniqueOutput( - self.ComputeOutputFileName(spec)) - ldflags, intermediate_manifest, manifest_files = \ - self.msvs_settings.GetLdflags(config_name, self.GypPathToNinja, - self.ExpandSpecial, manifest_base_name, - output, is_executable, - self.toplevel_build) - ldflags = env_ldflags + ldflags - self.WriteVariableList(ninja_file, 'manifests', manifest_files) - implicit_deps = implicit_deps.union(manifest_files) - if intermediate_manifest: + if not xcassets: + return + + extra_arguments = {} + settings_to_arg = { + "XCASSETS_APP_ICON": "app-icon", + "XCASSETS_LAUNCH_IMAGE": "launch-image", + } + settings = self.xcode_settings.xcode_settings[self.config_name] + for settings_key, arg_name in settings_to_arg.items(): + value = settings.get(settings_key) + if value: + extra_arguments[arg_name] = value + + partial_info_plist = None + if extra_arguments: + partial_info_plist = self.GypPathToUniqueOutput( + "assetcatalog_generated_info.plist" + ) + extra_arguments["output-partial-info-plist"] = partial_info_plist + + outputs = [] + outputs.append( + os.path.join(self.xcode_settings.GetBundleResourceFolder(), "Assets.car") + ) + if partial_info_plist: + outputs.append(partial_info_plist) + + keys = QuoteShellArgument(json.dumps(extra_arguments), self.flavor) + extra_env = self.xcode_settings.GetPerTargetSettings() + env = self.GetSortedXcodeEnv(additional_settings=extra_env) + env = self.ComputeExportEnvString(env) + + bundle_depends.extend( + self.ninja.build( + outputs, + "compile_xcassets", + xcassets, + variables=[("env", env), ("keys", keys)], + ) + ) + return partial_info_plist + + def WriteMacInfoPlist(self, partial_info_plist, bundle_depends): + """Write build rules for bundle Info.plist files.""" + info_plist, out, defines, extra_env = gyp.xcode_emulation.GetMacInfoPlist( + generator_default_variables["PRODUCT_DIR"], + self.xcode_settings, + self.GypPathToNinja, + ) + if not info_plist: + return + out = self.ExpandSpecial(out) + if defines: + # Create an intermediate file to store preprocessed results. + intermediate_plist = self.GypPathToUniqueOutput( + os.path.basename(info_plist) + ) + defines = " ".join([Define(d, self.flavor) for d in defines]) + info_plist = self.ninja.build( + intermediate_plist, + "preprocess_infoplist", + info_plist, + variables=[("defines", defines)], + ) + + env = self.GetSortedXcodeEnv(additional_settings=extra_env) + env = self.ComputeExportEnvString(env) + + if partial_info_plist: + intermediate_plist = self.GypPathToUniqueOutput("merged_info.plist") + info_plist = self.ninja.build( + intermediate_plist, "merge_infoplist", [partial_info_plist, info_plist] + ) + + keys = self.xcode_settings.GetExtraPlistItems(self.config_name) + keys = QuoteShellArgument(json.dumps(keys), self.flavor) + isBinary = self.xcode_settings.IsBinaryOutputFormat(self.config_name) + self.ninja.build( + out, + "copy_infoplist", + info_plist, + variables=[("env", env), ("keys", keys), ("binary", isBinary)], + ) + bundle_depends.append(out) + + def WriteSources( + self, + ninja_file, + config_name, + config, + sources, + predepends, + precompiled_header, + spec, + ): + """Write build rules to compile all of |sources|.""" + if self.toolset == "host": + self.ninja.variable("ar", "$ar_host") + self.ninja.variable("cc", "$cc_host") + self.ninja.variable("cxx", "$cxx_host") + self.ninja.variable("ld", "$ld_host") + self.ninja.variable("ldxx", "$ldxx_host") + self.ninja.variable("nm", "$nm_host") + self.ninja.variable("readelf", "$readelf_host") + + if self.flavor != "mac" or len(self.archs) == 1: + return self.WriteSourcesForArch( + self.ninja, + config_name, + config, + sources, + predepends, + precompiled_header, + spec, + ) + else: + return dict( + ( + arch, + self.WriteSourcesForArch( + self.arch_subninjas[arch], + config_name, + config, + sources, + predepends, + precompiled_header, + spec, + arch=arch, + ), + ) + for arch in self.archs + ) + + def WriteSourcesForArch( + self, + ninja_file, + config_name, + config, + sources, + predepends, + precompiled_header, + spec, + arch=None, + ): + """Write build rules to compile all of |sources|.""" + + extra_defines = [] + if self.flavor == "mac": + cflags = self.xcode_settings.GetCflags(config_name, arch=arch) + cflags_c = self.xcode_settings.GetCflagsC(config_name) + cflags_cc = self.xcode_settings.GetCflagsCC(config_name) + cflags_objc = ["$cflags_c"] + self.xcode_settings.GetCflagsObjC(config_name) + cflags_objcc = ["$cflags_cc"] + self.xcode_settings.GetCflagsObjCC( + config_name + ) + elif self.flavor == "win": + asmflags = self.msvs_settings.GetAsmflags(config_name) + cflags = self.msvs_settings.GetCflags(config_name) + cflags_c = self.msvs_settings.GetCflagsC(config_name) + cflags_cc = self.msvs_settings.GetCflagsCC(config_name) + extra_defines = self.msvs_settings.GetComputedDefines(config_name) + # See comment at cc_command for why there's two .pdb files. + pdbpath_c = pdbpath_cc = self.msvs_settings.GetCompilerPdbName( + config_name, self.ExpandSpecial + ) + if not pdbpath_c: + obj = "obj" + if self.toolset != "target": + obj += "." + self.toolset + pdbpath = os.path.normpath(os.path.join(obj, self.base_dir, self.name)) + pdbpath_c = pdbpath + ".c.pdb" + pdbpath_cc = pdbpath + ".cc.pdb" + self.WriteVariableList(ninja_file, "pdbname_c", [pdbpath_c]) + self.WriteVariableList(ninja_file, "pdbname_cc", [pdbpath_cc]) + self.WriteVariableList(ninja_file, "pchprefix", [self.name]) + else: + cflags = config.get("cflags", []) + cflags_c = config.get("cflags_c", []) + cflags_cc = config.get("cflags_cc", []) + + # Respect environment variables related to build, but target-specific + # flags can still override them. + if self.toolset == "target": + cflags_c = ( + os.environ.get("CPPFLAGS", "").split() + + os.environ.get("CFLAGS", "").split() + + cflags_c + ) + cflags_cc = ( + os.environ.get("CPPFLAGS", "").split() + + os.environ.get("CXXFLAGS", "").split() + + cflags_cc + ) + elif self.toolset == "host": + cflags_c = ( + os.environ.get("CPPFLAGS_host", "").split() + + os.environ.get("CFLAGS_host", "").split() + + cflags_c + ) + cflags_cc = ( + os.environ.get("CPPFLAGS_host", "").split() + + os.environ.get("CXXFLAGS_host", "").split() + + cflags_cc + ) + + defines = config.get("defines", []) + extra_defines self.WriteVariableList( - ninja_file, 'intermediatemanifest', [intermediate_manifest]) - command_suffix = _GetWinLinkRuleNameSuffix( - self.msvs_settings.IsEmbedManifest(config_name)) - def_file = self.msvs_settings.GetDefFile(self.GypPathToNinja) - if def_file: - implicit_deps.add(def_file) - else: - # Respect environment variables related to build, but target-specific - # flags can still override them. - ldflags = env_ldflags + config.get('ldflags', []) - if is_executable and len(solibs): - rpath = 'lib/' - if self.toolset != 'target': - rpath += self.toolset - ldflags.append(r'-Wl,-rpath=\$$ORIGIN/%s' % rpath) - ldflags.append('-Wl,-rpath-link=%s' % rpath) - self.WriteVariableList(ninja_file, 'ldflags', - map(self.ExpandSpecial, ldflags)) - - library_dirs = config.get('library_dirs', []) - if self.flavor == 'win': - library_dirs = [self.msvs_settings.ConvertVSMacros(l, config_name) - for l in library_dirs] - library_dirs = ['/LIBPATH:' + QuoteShellArgument(self.GypPathToNinja(l), - self.flavor) - for l in library_dirs] - else: - library_dirs = [QuoteShellArgument('-L' + self.GypPathToNinja(l), - self.flavor) - for l in library_dirs] - - libraries = gyp.common.uniquer(map(self.ExpandSpecial, - spec.get('libraries', []))) - if self.flavor == 'mac': - libraries = self.xcode_settings.AdjustLibraries(libraries, config_name) - elif self.flavor == 'win': - libraries = self.msvs_settings.AdjustLibraries(libraries) - - self.WriteVariableList(ninja_file, 'libs', library_dirs + libraries) - - linked_binary = output - - if command in ('solink', 'solink_module'): - extra_bindings.append(('soname', os.path.split(output)[1])) - extra_bindings.append(('lib', - gyp.common.EncodePOSIXShellArgument(output))) - if self.flavor != 'win': - link_file_list = output - if self.is_mac_bundle: - # 'Dependency Framework.framework/Versions/A/Dependency Framework' -> - # 'Dependency Framework.framework.rsp' - link_file_list = self.xcode_settings.GetWrapperName() - if arch: - link_file_list += '.' + arch - link_file_list += '.rsp' - # If an rspfile contains spaces, ninja surrounds the filename with - # quotes around it and then passes it to open(), creating a file with - # quotes in its name (and when looking for the rsp file, the name - # makes it through bash which strips the quotes) :-/ - link_file_list = link_file_list.replace(' ', '_') - extra_bindings.append( - ('link_file_list', - gyp.common.EncodePOSIXShellArgument(link_file_list))) - if self.flavor == 'win': - extra_bindings.append(('binary', output)) - if ('/NOENTRY' not in ldflags and - not self.msvs_settings.GetNoImportLibrary(config_name)): - self.target.import_lib = output + '.lib' - extra_bindings.append(('implibflag', - '/IMPLIB:%s' % self.target.import_lib)) - pdbname = self.msvs_settings.GetPDBName( - config_name, self.ExpandSpecial, output + '.pdb') - output = [output, self.target.import_lib] - if pdbname: - output.append(pdbname) - elif not self.is_mac_bundle: - output = [output, output + '.TOC'] - else: - command = command + '_notoc' - elif self.flavor == 'win': - extra_bindings.append(('binary', output)) - pdbname = self.msvs_settings.GetPDBName( - config_name, self.ExpandSpecial, output + '.pdb') - if pdbname: - output = [output, pdbname] - - - if len(solibs): - extra_bindings.append(('solibs', gyp.common.EncodePOSIXShellList(solibs))) - - ninja_file.build(output, command + command_suffix, link_deps, - implicit=list(implicit_deps), - order_only=list(order_deps), - variables=extra_bindings) - return linked_binary - - def WriteTarget(self, spec, config_name, config, link_deps, compile_deps): - extra_link_deps = any(self.target_outputs.get(dep).Linkable() - for dep in spec.get('dependencies', []) - if dep in self.target_outputs) - if spec['type'] == 'none' or (not link_deps and not extra_link_deps): - # TODO(evan): don't call this function for 'none' target types, as - # it doesn't do anything, and we fake out a 'binary' with a stamp file. - self.target.binary = compile_deps - self.target.type = 'none' - elif spec['type'] == 'static_library': - self.target.binary = self.ComputeOutput(spec) - if (self.flavor not in ('mac', 'openbsd', 'netbsd', 'win') and not - self.is_standalone_static_library): - self.ninja.build(self.target.binary, 'alink_thin', link_deps, - order_only=compile_deps) - else: + ninja_file, "defines", [Define(d, self.flavor) for d in defines] + ) + if self.flavor == "win": + self.WriteVariableList( + ninja_file, "asmflags", map(self.ExpandSpecial, asmflags) + ) + self.WriteVariableList( + ninja_file, + "rcflags", + [ + QuoteShellArgument(self.ExpandSpecial(f), self.flavor) + for f in self.msvs_settings.GetRcflags( + config_name, self.GypPathToNinja + ) + ], + ) + + include_dirs = config.get("include_dirs", []) + + env = self.GetToolchainEnv() + if self.flavor == "win": + include_dirs = self.msvs_settings.AdjustIncludeDirs( + include_dirs, config_name + ) + self.WriteVariableList( + ninja_file, + "includes", + [ + QuoteShellArgument("-I" + self.GypPathToNinja(i, env), self.flavor) + for i in include_dirs + ], + ) + + if self.flavor == "win": + midl_include_dirs = config.get("midl_include_dirs", []) + midl_include_dirs = self.msvs_settings.AdjustMidlIncludeDirs( + midl_include_dirs, config_name + ) + self.WriteVariableList( + ninja_file, + "midl_includes", + [ + QuoteShellArgument("-I" + self.GypPathToNinja(i, env), self.flavor) + for i in midl_include_dirs + ], + ) + + pch_commands = precompiled_header.GetPchBuildCommands(arch) + if self.flavor == "mac": + # Most targets use no precompiled headers, so only write these if needed. + for ext, var in [ + ("c", "cflags_pch_c"), + ("cc", "cflags_pch_cc"), + ("m", "cflags_pch_objc"), + ("mm", "cflags_pch_objcc"), + ]: + include = precompiled_header.GetInclude(ext, arch) + if include: + ninja_file.variable(var, include) + + arflags = config.get("arflags", []) + + self.WriteVariableList(ninja_file, "cflags", map(self.ExpandSpecial, cflags)) + self.WriteVariableList( + ninja_file, "cflags_c", map(self.ExpandSpecial, cflags_c) + ) + self.WriteVariableList( + ninja_file, "cflags_cc", map(self.ExpandSpecial, cflags_cc) + ) + if self.flavor == "mac": + self.WriteVariableList( + ninja_file, "cflags_objc", map(self.ExpandSpecial, cflags_objc) + ) + self.WriteVariableList( + ninja_file, "cflags_objcc", map(self.ExpandSpecial, cflags_objcc) + ) + self.WriteVariableList(ninja_file, "arflags", map(self.ExpandSpecial, arflags)) + ninja_file.newline() + outputs = [] + has_rc_source = False + for source in sources: + filename, ext = os.path.splitext(source) + ext = ext[1:] + obj_ext = self.obj_ext + if ext in ("cc", "cpp", "cxx"): + command = "cxx" + self.target.uses_cpp = True + elif ext == "c" or (ext == "S" and self.flavor != "win"): + command = "cc" + elif ext == "s" and self.flavor != "win": # Doesn't generate .o.d files. + command = "cc_s" + elif ( + self.flavor == "win" + and ext == "asm" + and not self.msvs_settings.HasExplicitAsmRules(spec) + ): + command = "asm" + # Add the _asm suffix as msvs is capable of handling .cc and + # .asm files of the same name without collision. + obj_ext = "_asm.obj" + elif self.flavor == "mac" and ext == "m": + command = "objc" + elif self.flavor == "mac" and ext == "mm": + command = "objcxx" + self.target.uses_cpp = True + elif self.flavor == "win" and ext == "rc": + command = "rc" + obj_ext = ".res" + has_rc_source = True + else: + # Ignore unhandled extensions. + continue + input = self.GypPathToNinja(source) + output = self.GypPathToUniqueOutput(filename + obj_ext) + if arch is not None: + output = AddArch(output, arch) + implicit = precompiled_header.GetObjDependencies([input], [output], arch) + variables = [] + if self.flavor == "win": + variables, output, implicit = precompiled_header.GetFlagsModifications( + input, + output, + implicit, + command, + cflags_c, + cflags_cc, + self.ExpandSpecial, + ) + ninja_file.build( + output, + command, + input, + implicit=[gch for _, _, gch in implicit], + order_only=predepends, + variables=variables, + ) + outputs.append(output) + + if has_rc_source: + resource_include_dirs = config.get("resource_include_dirs", include_dirs) + self.WriteVariableList( + ninja_file, + "resource_includes", + [ + QuoteShellArgument("-I" + self.GypPathToNinja(i, env), self.flavor) + for i in resource_include_dirs + ], + ) + + self.WritePchTargets(ninja_file, pch_commands) + + ninja_file.newline() + return outputs + + def WritePchTargets(self, ninja_file, pch_commands): + """Writes ninja rules to compile prefix headers.""" + if not pch_commands: + return + + for gch, lang_flag, lang, input in pch_commands: + var_name = { + "c": "cflags_pch_c", + "cc": "cflags_pch_cc", + "m": "cflags_pch_objc", + "mm": "cflags_pch_objcc", + }[lang] + + map = { + "c": "cc", + "cc": "cxx", + "m": "objc", + "mm": "objcxx", + } + cmd = map.get(lang) + ninja_file.build(gch, cmd, input, variables=[(var_name, lang_flag)]) + + def WriteLink(self, spec, config_name, config, link_deps, compile_deps): + """Write out a link step. Fills out target.binary. """ + if self.flavor != "mac" or len(self.archs) == 1: + return self.WriteLinkForArch( + self.ninja, spec, config_name, config, link_deps, compile_deps + ) + else: + output = self.ComputeOutput(spec) + inputs = [ + self.WriteLinkForArch( + self.arch_subninjas[arch], + spec, + config_name, + config, + link_deps[arch], + compile_deps, + arch=arch, + ) + for arch in self.archs + ] + extra_bindings = [] + build_output = output + if not self.is_mac_bundle: + self.AppendPostbuildVariable(extra_bindings, spec, output, output) + + # TODO(yyanagisawa): more work needed to fix: + # https://code.google.com/p/gyp/issues/detail?id=411 + if ( + spec["type"] in ("shared_library", "loadable_module") + and not self.is_mac_bundle + ): + extra_bindings.append(("lib", output)) + self.ninja.build( + [output, output + ".TOC"], + "solipo", + inputs, + variables=extra_bindings, + ) + else: + self.ninja.build(build_output, "lipo", inputs, variables=extra_bindings) + return output + + def WriteLinkForArch( + self, ninja_file, spec, config_name, config, link_deps, compile_deps, arch=None + ): + """Write out a link step. Fills out target.binary. """ + command = { + "executable": "link", + "loadable_module": "solink_module", + "shared_library": "solink", + }[spec["type"]] + command_suffix = "" + + implicit_deps = set() + solibs = set() + order_deps = set() + + if compile_deps: + # Normally, the compiles of the target already depend on compile_deps, + # but a shared_library target might have no sources and only link together + # a few static_library deps, so the link step also needs to depend + # on compile_deps to make sure actions in the shared_library target + # get run before the link. + order_deps.add(compile_deps) + + if "dependencies" in spec: + # Two kinds of dependencies: + # - Linkable dependencies (like a .a or a .so): add them to the link line. + # - Non-linkable dependencies (like a rule that generates a file + # and writes a stamp file): add them to implicit_deps + extra_link_deps = set() + for dep in spec["dependencies"]: + target = self.target_outputs.get(dep) + if not target: + continue + linkable = target.Linkable() + if linkable: + new_deps = [] + if ( + self.flavor == "win" + and target.component_objs + and self.msvs_settings.IsUseLibraryDependencyInputs(config_name) + ): + new_deps = target.component_objs + if target.compile_deps: + order_deps.add(target.compile_deps) + elif self.flavor == "win" and target.import_lib: + new_deps = [target.import_lib] + elif target.UsesToc(self.flavor): + solibs.add(target.binary) + implicit_deps.add(target.binary + ".TOC") + else: + new_deps = [target.binary] + for new_dep in new_deps: + if new_dep not in extra_link_deps: + extra_link_deps.add(new_dep) + link_deps.append(new_dep) + + final_output = target.FinalOutput() + if not linkable or final_output != target.binary: + implicit_deps.add(final_output) + + extra_bindings = [] + if self.target.uses_cpp and self.flavor != "win": + extra_bindings.append(("ld", "$ldxx")) + + output = self.ComputeOutput(spec, arch) + if arch is None and not self.is_mac_bundle: + self.AppendPostbuildVariable(extra_bindings, spec, output, output) + + is_executable = spec["type"] == "executable" + # The ldflags config key is not used on mac or win. On those platforms + # linker flags are set via xcode_settings and msvs_settings, respectively. + env_ldflags = os.environ.get("LDFLAGS", "").split() + if self.flavor == "mac": + ldflags = self.xcode_settings.GetLdflags( + config_name, + self.ExpandSpecial(generator_default_variables["PRODUCT_DIR"]), + self.GypPathToNinja, + arch, + ) + ldflags = env_ldflags + ldflags + elif self.flavor == "win": + manifest_base_name = self.GypPathToUniqueOutput( + self.ComputeOutputFileName(spec) + ) + ( + ldflags, + intermediate_manifest, + manifest_files, + ) = self.msvs_settings.GetLdflags( + config_name, + self.GypPathToNinja, + self.ExpandSpecial, + manifest_base_name, + output, + is_executable, + self.toplevel_build, + ) + ldflags = env_ldflags + ldflags + self.WriteVariableList(ninja_file, "manifests", manifest_files) + implicit_deps = implicit_deps.union(manifest_files) + if intermediate_manifest: + self.WriteVariableList( + ninja_file, "intermediatemanifest", [intermediate_manifest] + ) + command_suffix = _GetWinLinkRuleNameSuffix( + self.msvs_settings.IsEmbedManifest(config_name) + ) + def_file = self.msvs_settings.GetDefFile(self.GypPathToNinja) + if def_file: + implicit_deps.add(def_file) + else: + # Respect environment variables related to build, but target-specific + # flags can still override them. + ldflags = env_ldflags + config.get("ldflags", []) + if is_executable and len(solibs): + rpath = "lib/" + if self.toolset != "target": + rpath += self.toolset + ldflags.append(r"-Wl,-rpath=\$$ORIGIN/%s" % rpath) + else: + ldflags.append("-Wl,-rpath=%s" % self.target_rpath) + ldflags.append("-Wl,-rpath-link=%s" % rpath) + self.WriteVariableList(ninja_file, "ldflags", map(self.ExpandSpecial, ldflags)) + + library_dirs = config.get("library_dirs", []) + if self.flavor == "win": + library_dirs = [ + self.msvs_settings.ConvertVSMacros(library_dir, config_name) + for library_dir in library_dirs + ] + library_dirs = [ + "/LIBPATH:" + + QuoteShellArgument(self.GypPathToNinja(library_dir), self.flavor) + for library_dir in library_dirs + ] + else: + library_dirs = [ + QuoteShellArgument("-L" + self.GypPathToNinja(library_dir), self.flavor) + for library_dir in library_dirs + ] + + libraries = gyp.common.uniquer( + map(self.ExpandSpecial, spec.get("libraries", [])) + ) + if self.flavor == "mac": + libraries = self.xcode_settings.AdjustLibraries(libraries, config_name) + elif self.flavor == "win": + libraries = self.msvs_settings.AdjustLibraries(libraries) + + self.WriteVariableList(ninja_file, "libs", library_dirs + libraries) + + linked_binary = output + + if command in ("solink", "solink_module"): + extra_bindings.append(("soname", os.path.split(output)[1])) + extra_bindings.append(("lib", gyp.common.EncodePOSIXShellArgument(output))) + if self.flavor != "win": + link_file_list = output + if self.is_mac_bundle: + # 'Dependency Framework.framework/Versions/A/Dependency Framework' -> + # 'Dependency Framework.framework.rsp' + link_file_list = self.xcode_settings.GetWrapperName() + if arch: + link_file_list += "." + arch + link_file_list += ".rsp" + # If an rspfile contains spaces, ninja surrounds the filename with + # quotes around it and then passes it to open(), creating a file with + # quotes in its name (and when looking for the rsp file, the name + # makes it through bash which strips the quotes) :-/ + link_file_list = link_file_list.replace(" ", "_") + extra_bindings.append( + ( + "link_file_list", + gyp.common.EncodePOSIXShellArgument(link_file_list), + ) + ) + if self.flavor == "win": + extra_bindings.append(("binary", output)) + if ( + "/NOENTRY" not in ldflags + and not self.msvs_settings.GetNoImportLibrary(config_name) + ): + self.target.import_lib = output + ".lib" + extra_bindings.append( + ("implibflag", "/IMPLIB:%s" % self.target.import_lib) + ) + pdbname = self.msvs_settings.GetPDBName( + config_name, self.ExpandSpecial, output + ".pdb" + ) + output = [output, self.target.import_lib] + if pdbname: + output.append(pdbname) + elif not self.is_mac_bundle: + output = [output, output + ".TOC"] + else: + command = command + "_notoc" + elif self.flavor == "win": + extra_bindings.append(("binary", output)) + pdbname = self.msvs_settings.GetPDBName( + config_name, self.ExpandSpecial, output + ".pdb" + ) + if pdbname: + output = [output, pdbname] + + if len(solibs): + extra_bindings.append( + ("solibs", gyp.common.EncodePOSIXShellList(sorted(solibs))) + ) + + ninja_file.build( + output, + command + command_suffix, + link_deps, + implicit=sorted(implicit_deps), + order_only=list(order_deps), + variables=extra_bindings, + ) + return linked_binary + + def WriteTarget(self, spec, config_name, config, link_deps, compile_deps): + extra_link_deps = any( + self.target_outputs.get(dep).Linkable() + for dep in spec.get("dependencies", []) + if dep in self.target_outputs + ) + if spec["type"] == "none" or (not link_deps and not extra_link_deps): + # TODO(evan): don't call this function for 'none' target types, as + # it doesn't do anything, and we fake out a 'binary' with a stamp file. + self.target.binary = compile_deps + self.target.type = "none" + elif spec["type"] == "static_library": + self.target.binary = self.ComputeOutput(spec) + if ( + self.flavor not in ("mac", "openbsd", "netbsd", "win") + and not self.is_standalone_static_library + ): + self.ninja.build( + self.target.binary, "alink_thin", link_deps, order_only=compile_deps + ) + else: + variables = [] + if self.xcode_settings: + libtool_flags = self.xcode_settings.GetLibtoolflags(config_name) + if libtool_flags: + variables.append(("libtool_flags", libtool_flags)) + if self.msvs_settings: + libflags = self.msvs_settings.GetLibFlags( + config_name, self.GypPathToNinja + ) + variables.append(("libflags", libflags)) + + if self.flavor != "mac" or len(self.archs) == 1: + self.AppendPostbuildVariable( + variables, spec, self.target.binary, self.target.binary + ) + self.ninja.build( + self.target.binary, + "alink", + link_deps, + order_only=compile_deps, + variables=variables, + ) + else: + inputs = [] + for arch in self.archs: + output = self.ComputeOutput(spec, arch) + self.arch_subninjas[arch].build( + output, + "alink", + link_deps[arch], + order_only=compile_deps, + variables=variables, + ) + inputs.append(output) + # TODO: It's not clear if libtool_flags should be passed to the alink + # call that combines single-arch .a files into a fat .a file. + self.AppendPostbuildVariable( + variables, spec, self.target.binary, self.target.binary + ) + self.ninja.build( + self.target.binary, + "alink", + inputs, + # FIXME: test proving order_only=compile_deps isn't + # needed. + variables=variables, + ) + else: + self.target.binary = self.WriteLink( + spec, config_name, config, link_deps, compile_deps + ) + return self.target.binary + + def WriteMacBundle(self, spec, mac_bundle_depends, is_empty): + assert self.is_mac_bundle + package_framework = spec["type"] in ("shared_library", "loadable_module") + output = self.ComputeMacBundleOutput() + if is_empty: + output += ".stamp" variables = [] - if self.xcode_settings: - libtool_flags = self.xcode_settings.GetLibtoolflags(config_name) - if libtool_flags: - variables.append(('libtool_flags', libtool_flags)) - if self.msvs_settings: - libflags = self.msvs_settings.GetLibFlags(config_name, - self.GypPathToNinja) - variables.append(('libflags', libflags)) - - if self.flavor != 'mac' or len(self.archs) == 1: - self.AppendPostbuildVariable(variables, spec, - self.target.binary, self.target.binary) - self.ninja.build(self.target.binary, 'alink', link_deps, - order_only=compile_deps, variables=variables) + self.AppendPostbuildVariable( + variables, + spec, + output, + self.target.binary, + is_command_start=not package_framework, + ) + if package_framework and not is_empty: + if spec["type"] == "shared_library" and self.xcode_settings.isIOS: + self.ninja.build( + output, + "package_ios_framework", + mac_bundle_depends, + variables=variables, + ) + else: + variables.append(("version", self.xcode_settings.GetFrameworkVersion())) + self.ninja.build( + output, "package_framework", mac_bundle_depends, variables=variables + ) else: - inputs = [] - for arch in self.archs: - output = self.ComputeOutput(spec, arch) - self.arch_subninjas[arch].build(output, 'alink', link_deps[arch], - order_only=compile_deps, - variables=variables) - inputs.append(output) - # TODO: It's not clear if libtool_flags should be passed to the alink - # call that combines single-arch .a files into a fat .a file. - self.AppendPostbuildVariable(variables, spec, - self.target.binary, self.target.binary) - self.ninja.build(self.target.binary, 'alink', inputs, - # FIXME: test proving order_only=compile_deps isn't - # needed. - variables=variables) - else: - self.target.binary = self.WriteLink(spec, config_name, config, link_deps) - return self.target.binary - - def WriteMacBundle(self, spec, mac_bundle_depends, is_empty): - assert self.is_mac_bundle - package_framework = spec['type'] in ('shared_library', 'loadable_module') - output = self.ComputeMacBundleOutput() - if is_empty: - output += '.stamp' - variables = [] - self.AppendPostbuildVariable(variables, spec, output, self.target.binary, - is_command_start=not package_framework) - if package_framework and not is_empty: - variables.append(('version', self.xcode_settings.GetFrameworkVersion())) - self.ninja.build(output, 'package_framework', mac_bundle_depends, - variables=variables) - else: - self.ninja.build(output, 'stamp', mac_bundle_depends, - variables=variables) - self.target.bundle = output - return output - - def GetToolchainEnv(self, additional_settings=None): - """Returns the variables toolchain would set for build steps.""" - env = self.GetSortedXcodeEnv(additional_settings=additional_settings) - if self.flavor == 'win': - env = self.GetMsvsToolchainEnv( - additional_settings=additional_settings) - return env - - def GetMsvsToolchainEnv(self, additional_settings=None): - """Returns the variables Visual Studio would set for build steps.""" - return self.msvs_settings.GetVSMacroEnv('$!PRODUCT_DIR', - config=self.config_name) - - def GetSortedXcodeEnv(self, additional_settings=None): - """Returns the variables Xcode would set for build steps.""" - assert self.abs_build_dir - abs_build_dir = self.abs_build_dir - return gyp.xcode_emulation.GetSortedXcodeEnv( - self.xcode_settings, abs_build_dir, - os.path.join(abs_build_dir, self.build_to_base), self.config_name, - additional_settings) - - def GetSortedXcodePostbuildEnv(self): - """Returns the variables Xcode would set for postbuild steps.""" - postbuild_settings = {} - # CHROMIUM_STRIP_SAVE_FILE is a chromium-specific hack. - # TODO(thakis): It would be nice to have some general mechanism instead. - strip_save_file = self.xcode_settings.GetPerTargetSetting( - 'CHROMIUM_STRIP_SAVE_FILE') - if strip_save_file: - postbuild_settings['CHROMIUM_STRIP_SAVE_FILE'] = strip_save_file - return self.GetSortedXcodeEnv(additional_settings=postbuild_settings) - - def AppendPostbuildVariable(self, variables, spec, output, binary, - is_command_start=False): - """Adds a 'postbuild' variable if there is a postbuild for |output|.""" - postbuild = self.GetPostbuildCommand(spec, output, binary, is_command_start) - if postbuild: - variables.append(('postbuilds', postbuild)) - - def GetPostbuildCommand(self, spec, output, output_binary, is_command_start): - """Returns a shell command that runs all the postbuilds, and removes + self.ninja.build(output, "stamp", mac_bundle_depends, variables=variables) + self.target.bundle = output + return output + + def GetToolchainEnv(self, additional_settings=None): + """Returns the variables toolchain would set for build steps.""" + env = self.GetSortedXcodeEnv(additional_settings=additional_settings) + if self.flavor == "win": + env = self.GetMsvsToolchainEnv(additional_settings=additional_settings) + return env + + def GetMsvsToolchainEnv(self, additional_settings=None): + """Returns the variables Visual Studio would set for build steps.""" + return self.msvs_settings.GetVSMacroEnv( + "$!PRODUCT_DIR", config=self.config_name + ) + + def GetSortedXcodeEnv(self, additional_settings=None): + """Returns the variables Xcode would set for build steps.""" + assert self.abs_build_dir + abs_build_dir = self.abs_build_dir + return gyp.xcode_emulation.GetSortedXcodeEnv( + self.xcode_settings, + abs_build_dir, + os.path.join(abs_build_dir, self.build_to_base), + self.config_name, + additional_settings, + ) + + def GetSortedXcodePostbuildEnv(self): + """Returns the variables Xcode would set for postbuild steps.""" + postbuild_settings = {} + # CHROMIUM_STRIP_SAVE_FILE is a chromium-specific hack. + # TODO(thakis): It would be nice to have some general mechanism instead. + strip_save_file = self.xcode_settings.GetPerTargetSetting( + "CHROMIUM_STRIP_SAVE_FILE" + ) + if strip_save_file: + postbuild_settings["CHROMIUM_STRIP_SAVE_FILE"] = strip_save_file + return self.GetSortedXcodeEnv(additional_settings=postbuild_settings) + + def AppendPostbuildVariable( + self, variables, spec, output, binary, is_command_start=False + ): + """Adds a 'postbuild' variable if there is a postbuild for |output|.""" + postbuild = self.GetPostbuildCommand(spec, output, binary, is_command_start) + if postbuild: + variables.append(("postbuilds", postbuild)) + + def GetPostbuildCommand(self, spec, output, output_binary, is_command_start): + """Returns a shell command that runs all the postbuilds, and removes |output| if any of them fails. If |is_command_start| is False, then the returned string will start with ' && '.""" - if not self.xcode_settings or spec['type'] == 'none' or not output: - return '' - output = QuoteShellArgument(output, self.flavor) - postbuilds = gyp.xcode_emulation.GetSpecPostbuildCommands(spec, quiet=True) - if output_binary is not None: - postbuilds = self.xcode_settings.AddImplicitPostbuilds( - self.config_name, - os.path.normpath(os.path.join(self.base_to_build, output)), - QuoteShellArgument( - os.path.normpath(os.path.join(self.base_to_build, output_binary)), - self.flavor), - postbuilds, quiet=True) - - if not postbuilds: - return '' - # Postbuilds expect to be run in the gyp file's directory, so insert an - # implicit postbuild to cd to there. - postbuilds.insert(0, gyp.common.EncodePOSIXShellList( - ['cd', self.build_to_base])) - env = self.ComputeExportEnvString(self.GetSortedXcodePostbuildEnv()) - # G will be non-null if any postbuild fails. Run all postbuilds in a - # subshell. - commands = env + ' (' + \ - ' && '.join([ninja_syntax.escape(command) for command in postbuilds]) - command_string = (commands + '); G=$$?; ' - # Remove the final output if any postbuild failed. - '((exit $$G) || rm -rf %s) ' % output + '&& exit $$G)') - if is_command_start: - return '(' + command_string + ' && ' - else: - return '$ && (' + command_string + if not self.xcode_settings or spec["type"] == "none" or not output: + return "" + output = QuoteShellArgument(output, self.flavor) + postbuilds = gyp.xcode_emulation.GetSpecPostbuildCommands(spec, quiet=True) + if output_binary is not None: + postbuilds = self.xcode_settings.AddImplicitPostbuilds( + self.config_name, + os.path.normpath(os.path.join(self.base_to_build, output)), + QuoteShellArgument( + os.path.normpath(os.path.join(self.base_to_build, output_binary)), + self.flavor, + ), + postbuilds, + quiet=True, + ) + + if not postbuilds: + return "" + # Postbuilds expect to be run in the gyp file's directory, so insert an + # implicit postbuild to cd to there. + postbuilds.insert( + 0, gyp.common.EncodePOSIXShellList(["cd", self.build_to_base]) + ) + env = self.ComputeExportEnvString(self.GetSortedXcodePostbuildEnv()) + # G will be non-null if any postbuild fails. Run all postbuilds in a + # subshell. + commands = ( + env + + " (" + + " && ".join([ninja_syntax.escape(command) for command in postbuilds]) + ) + command_string = ( + commands + + "); G=$$?; " + # Remove the final output if any postbuild failed. + "((exit $$G) || rm -rf %s) " % output + + "&& exit $$G)" + ) + if is_command_start: + return "(" + command_string + " && " + else: + return "$ && (" + command_string - def ComputeExportEnvString(self, env): - """Given an environment, returns a string looking like + def ComputeExportEnvString(self, env): + """Given an environment, returns a string looking like 'export FOO=foo; export BAR="${FOO} bar;' that exports |env| to the shell.""" - export_str = [] - for k, v in env: - export_str.append('export %s=%s;' % - (k, ninja_syntax.escape(gyp.common.EncodePOSIXShellArgument(v)))) - return ' '.join(export_str) - - def ComputeMacBundleOutput(self): - """Return the 'output' (full output path) to a bundle output directory.""" - assert self.is_mac_bundle - path = generator_default_variables['PRODUCT_DIR'] - return self.ExpandSpecial( - os.path.join(path, self.xcode_settings.GetWrapperName())) - - def ComputeOutputFileName(self, spec, type=None): - """Compute the filename of the final output for the current target.""" - if not type: - type = spec['type'] - - default_variables = copy.copy(generator_default_variables) - CalculateVariables(default_variables, {'flavor': self.flavor}) - - # Compute filename prefix: the product prefix, or a default for - # the product type. - DEFAULT_PREFIX = { - 'loadable_module': default_variables['SHARED_LIB_PREFIX'], - 'shared_library': default_variables['SHARED_LIB_PREFIX'], - 'static_library': default_variables['STATIC_LIB_PREFIX'], - 'executable': default_variables['EXECUTABLE_PREFIX'], - } - prefix = spec.get('product_prefix', DEFAULT_PREFIX.get(type, '')) - - # Compute filename extension: the product extension, or a default - # for the product type. - DEFAULT_EXTENSION = { - 'loadable_module': default_variables['SHARED_LIB_SUFFIX'], - 'shared_library': default_variables['SHARED_LIB_SUFFIX'], - 'static_library': default_variables['STATIC_LIB_SUFFIX'], - 'executable': default_variables['EXECUTABLE_SUFFIX'], - } - extension = spec.get('product_extension') - if extension: - extension = '.' + extension - else: - extension = DEFAULT_EXTENSION.get(type, '') - - if 'product_name' in spec: - # If we were given an explicit name, use that. - target = spec['product_name'] - else: - # Otherwise, derive a name from the target name. - target = spec['target_name'] - if prefix == 'lib': - # Snip out an extra 'lib' from libs if appropriate. - target = StripPrefix(target, 'lib') - - if type in ('static_library', 'loadable_module', 'shared_library', - 'executable'): - return '%s%s%s' % (prefix, target, extension) - elif type == 'none': - return '%s.stamp' % target - else: - raise Exception('Unhandled output type %s' % type) - - def ComputeOutput(self, spec, arch=None): - """Compute the path for the final output of the spec.""" - type = spec['type'] - - if self.flavor == 'win': - override = self.msvs_settings.GetOutputName(self.config_name, - self.ExpandSpecial) - if override: - return override + export_str = [] + for k, v in env: + export_str.append( + "export %s=%s;" + % (k, ninja_syntax.escape(gyp.common.EncodePOSIXShellArgument(v))) + ) + return " ".join(export_str) + + def ComputeMacBundleOutput(self): + """Return the 'output' (full output path) to a bundle output directory.""" + assert self.is_mac_bundle + path = generator_default_variables["PRODUCT_DIR"] + return self.ExpandSpecial( + os.path.join(path, self.xcode_settings.GetWrapperName()) + ) + + def ComputeOutputFileName(self, spec, type=None): + """Compute the filename of the final output for the current target.""" + if not type: + type = spec["type"] + + default_variables = copy.copy(generator_default_variables) + CalculateVariables(default_variables, {"flavor": self.flavor}) + + # Compute filename prefix: the product prefix, or a default for + # the product type. + DEFAULT_PREFIX = { + "loadable_module": default_variables["SHARED_LIB_PREFIX"], + "shared_library": default_variables["SHARED_LIB_PREFIX"], + "static_library": default_variables["STATIC_LIB_PREFIX"], + "executable": default_variables["EXECUTABLE_PREFIX"], + } + prefix = spec.get("product_prefix", DEFAULT_PREFIX.get(type, "")) + + # Compute filename extension: the product extension, or a default + # for the product type. + DEFAULT_EXTENSION = { + "loadable_module": default_variables["SHARED_LIB_SUFFIX"], + "shared_library": default_variables["SHARED_LIB_SUFFIX"], + "static_library": default_variables["STATIC_LIB_SUFFIX"], + "executable": default_variables["EXECUTABLE_SUFFIX"], + } + extension = spec.get("product_extension") + if extension: + extension = "." + extension + else: + extension = DEFAULT_EXTENSION.get(type, "") - if arch is None and self.flavor == 'mac' and type in ( - 'static_library', 'executable', 'shared_library', 'loadable_module'): - filename = self.xcode_settings.GetExecutablePath() - else: - filename = self.ComputeOutputFileName(spec, type) - - if arch is None and 'product_dir' in spec: - path = os.path.join(spec['product_dir'], filename) - return self.ExpandSpecial(path) - - # Some products go into the output root, libraries go into shared library - # dir, and everything else goes into the normal place. - type_in_output_root = ['executable', 'loadable_module'] - if self.flavor == 'mac' and self.toolset == 'target': - type_in_output_root += ['shared_library', 'static_library'] - elif self.flavor == 'win' and self.toolset == 'target': - type_in_output_root += ['shared_library'] - - if arch is not None: - # Make sure partial executables don't end up in a bundle or the regular - # output directory. - archdir = 'arch' - if self.toolset != 'target': - archdir = os.path.join('arch', '%s' % self.toolset) - return os.path.join(archdir, AddArch(filename, arch)) - elif type in type_in_output_root or self.is_standalone_static_library: - return filename - elif type == 'shared_library': - libdir = 'lib' - if self.toolset != 'target': - libdir = os.path.join('lib', '%s' % self.toolset) - return os.path.join(libdir, filename) - else: - return self.GypPathToUniqueOutput(filename, qualified=False) + if "product_name" in spec: + # If we were given an explicit name, use that. + target = spec["product_name"] + else: + # Otherwise, derive a name from the target name. + target = spec["target_name"] + if prefix == "lib": + # Snip out an extra 'lib' from libs if appropriate. + target = StripPrefix(target, "lib") + + if type in ( + "static_library", + "loadable_module", + "shared_library", + "executable", + ): + return "%s%s%s" % (prefix, target, extension) + elif type == "none": + return "%s.stamp" % target + else: + raise Exception("Unhandled output type %s" % type) + + def ComputeOutput(self, spec, arch=None): + """Compute the path for the final output of the spec.""" + type = spec["type"] + + if self.flavor == "win": + override = self.msvs_settings.GetOutputName( + self.config_name, self.ExpandSpecial + ) + if override: + return override + + if ( + arch is None + and self.flavor == "mac" + and type + in ("static_library", "executable", "shared_library", "loadable_module") + ): + filename = self.xcode_settings.GetExecutablePath() + else: + filename = self.ComputeOutputFileName(spec, type) + + if arch is None and "product_dir" in spec: + path = os.path.join(spec["product_dir"], filename) + return self.ExpandSpecial(path) + + # Some products go into the output root, libraries go into shared library + # dir, and everything else goes into the normal place. + type_in_output_root = ["executable", "loadable_module"] + if self.flavor == "mac" and self.toolset == "target": + type_in_output_root += ["shared_library", "static_library"] + elif self.flavor == "win" and self.toolset == "target": + type_in_output_root += ["shared_library"] + + if arch is not None: + # Make sure partial executables don't end up in a bundle or the regular + # output directory. + archdir = "arch" + if self.toolset != "target": + archdir = os.path.join("arch", "%s" % self.toolset) + return os.path.join(archdir, AddArch(filename, arch)) + elif type in type_in_output_root or self.is_standalone_static_library: + return filename + elif type == "shared_library": + libdir = "lib" + if self.toolset != "target": + libdir = os.path.join("lib", "%s" % self.toolset) + return os.path.join(libdir, filename) + else: + return self.GypPathToUniqueOutput(filename, qualified=False) - def WriteVariableList(self, ninja_file, var, values): - assert not isinstance(values, str) - if values is None: - values = [] - ninja_file.variable(var, ' '.join(values)) + def WriteVariableList(self, ninja_file, var, values): + assert not isinstance(values, str) + if values is None: + values = [] + ninja_file.variable(var, " ".join(values)) - def WriteNewNinjaRule(self, name, args, description, is_cygwin, env, pool, - depfile=None): - """Write out a new ninja "rule" statement for a given command. + def WriteNewNinjaRule( + self, name, args, description, is_cygwin, env, pool, depfile=None + ): + """Write out a new ninja "rule" statement for a given command. Returns the name of the new rule, and a copy of |args| with variables expanded.""" - if self.flavor == 'win': - args = [self.msvs_settings.ConvertVSMacros( - arg, self.base_to_build, config=self.config_name) - for arg in args] - description = self.msvs_settings.ConvertVSMacros( - description, config=self.config_name) - elif self.flavor == 'mac': - # |env| is an empty list on non-mac. - args = [gyp.xcode_emulation.ExpandEnvVars(arg, env) for arg in args] - description = gyp.xcode_emulation.ExpandEnvVars(description, env) - - # TODO: we shouldn't need to qualify names; we do it because - # currently the ninja rule namespace is global, but it really - # should be scoped to the subninja. - rule_name = self.name - if self.toolset == 'target': - rule_name += '.' + self.toolset - rule_name += '.' + name - rule_name = re.sub('[^a-zA-Z0-9_]', '_', rule_name) - - # Remove variable references, but not if they refer to the magic rule - # variables. This is not quite right, as it also protects these for - # actions, not just for rules where they are valid. Good enough. - protect = [ '${root}', '${dirname}', '${source}', '${ext}', '${name}' ] - protect = '(?!' + '|'.join(map(re.escape, protect)) + ')' - description = re.sub(protect + r'\$', '_', description) - - # gyp dictates that commands are run from the base directory. - # cd into the directory before running, and adjust paths in - # the arguments to point to the proper locations. - rspfile = None - rspfile_content = None - args = [self.ExpandSpecial(arg, self.base_to_build) for arg in args] - if self.flavor == 'win': - rspfile = rule_name + '.$unique_name.rsp' - # The cygwin case handles this inside the bash sub-shell. - run_in = '' if is_cygwin else ' ' + self.build_to_base - if is_cygwin: - rspfile_content = self.msvs_settings.BuildCygwinBashCommandLine( - args, self.build_to_base) - else: - rspfile_content = gyp.msvs_emulation.EncodeRspFileList(args) - command = ('%s gyp-win-tool action-wrapper $arch ' % sys.executable + - rspfile + run_in) - else: - env = self.ComputeExportEnvString(env) - command = gyp.common.EncodePOSIXShellList(args) - command = 'cd %s; ' % self.build_to_base + env + command - - # GYP rules/actions express being no-ops by not touching their outputs. - # Avoid executing downstream dependencies in this case by specifying - # restat=1 to ninja. - self.ninja.rule(rule_name, command, description, depfile=depfile, - restat=True, pool=pool, - rspfile=rspfile, rspfile_content=rspfile_content) - self.ninja.newline() - - return rule_name, args + if self.flavor == "win": + args = [ + self.msvs_settings.ConvertVSMacros( + arg, self.base_to_build, config=self.config_name + ) + for arg in args + ] + description = self.msvs_settings.ConvertVSMacros( + description, config=self.config_name + ) + elif self.flavor == "mac": + # |env| is an empty list on non-mac. + args = [gyp.xcode_emulation.ExpandEnvVars(arg, env) for arg in args] + description = gyp.xcode_emulation.ExpandEnvVars(description, env) + + # TODO: we shouldn't need to qualify names; we do it because + # currently the ninja rule namespace is global, but it really + # should be scoped to the subninja. + rule_name = self.name + if self.toolset == "target": + rule_name += "." + self.toolset + rule_name += "." + name + rule_name = re.sub("[^a-zA-Z0-9_]", "_", rule_name) + + # Remove variable references, but not if they refer to the magic rule + # variables. This is not quite right, as it also protects these for + # actions, not just for rules where they are valid. Good enough. + protect = ["${root}", "${dirname}", "${source}", "${ext}", "${name}"] + protect = "(?!" + "|".join(map(re.escape, protect)) + ")" + description = re.sub(protect + r"\$", "_", description) + + # gyp dictates that commands are run from the base directory. + # cd into the directory before running, and adjust paths in + # the arguments to point to the proper locations. + rspfile = None + rspfile_content = None + args = [self.ExpandSpecial(arg, self.base_to_build) for arg in args] + if self.flavor == "win": + rspfile = rule_name + ".$unique_name.rsp" + # The cygwin case handles this inside the bash sub-shell. + run_in = "" if is_cygwin else " " + self.build_to_base + if is_cygwin: + rspfile_content = self.msvs_settings.BuildCygwinBashCommandLine( + args, self.build_to_base + ) + else: + rspfile_content = gyp.msvs_emulation.EncodeRspFileList(args) + command = ( + "%s gyp-win-tool action-wrapper $arch " % sys.executable + + rspfile + + run_in + ) + else: + env = self.ComputeExportEnvString(env) + command = gyp.common.EncodePOSIXShellList(args) + command = "cd %s; " % self.build_to_base + env + command + + # GYP rules/actions express being no-ops by not touching their outputs. + # Avoid executing downstream dependencies in this case by specifying + # restat=1 to ninja. + self.ninja.rule( + rule_name, + command, + description, + depfile=depfile, + restat=True, + pool=pool, + rspfile=rspfile, + rspfile_content=rspfile_content, + ) + self.ninja.newline() + + return rule_name, args def CalculateVariables(default_variables, params): - """Calculate additional variables for use in the build (called by gyp).""" - global generator_additional_non_configuration_keys - global generator_additional_path_sections - flavor = gyp.common.GetFlavor(params) - if flavor == 'mac': - default_variables.setdefault('OS', 'mac') - default_variables.setdefault('SHARED_LIB_SUFFIX', '.dylib') - default_variables.setdefault('SHARED_LIB_DIR', - generator_default_variables['PRODUCT_DIR']) - default_variables.setdefault('LIB_DIR', - generator_default_variables['PRODUCT_DIR']) - - # Copy additional generator configuration data from Xcode, which is shared - # by the Mac Ninja generator. - import gyp.generator.xcode as xcode_generator - generator_additional_non_configuration_keys = getattr(xcode_generator, - 'generator_additional_non_configuration_keys', []) - generator_additional_path_sections = getattr(xcode_generator, - 'generator_additional_path_sections', []) - global generator_extra_sources_for_rules - generator_extra_sources_for_rules = getattr(xcode_generator, - 'generator_extra_sources_for_rules', []) - elif flavor == 'win': - exts = gyp.MSVSUtil.TARGET_TYPE_EXT - default_variables.setdefault('OS', 'win') - default_variables['EXECUTABLE_SUFFIX'] = '.' + exts['executable'] - default_variables['STATIC_LIB_PREFIX'] = '' - default_variables['STATIC_LIB_SUFFIX'] = '.' + exts['static_library'] - default_variables['SHARED_LIB_PREFIX'] = '' - default_variables['SHARED_LIB_SUFFIX'] = '.' + exts['shared_library'] - - # Copy additional generator configuration data from VS, which is shared - # by the Windows Ninja generator. - import gyp.generator.msvs as msvs_generator - generator_additional_non_configuration_keys = getattr(msvs_generator, - 'generator_additional_non_configuration_keys', []) - generator_additional_path_sections = getattr(msvs_generator, - 'generator_additional_path_sections', []) - - gyp.msvs_emulation.CalculateCommonVariables(default_variables, params) - else: - operating_system = flavor - if flavor == 'android': - operating_system = 'linux' # Keep this legacy behavior for now. - default_variables.setdefault('OS', operating_system) - default_variables.setdefault('SHARED_LIB_SUFFIX', '.so') - default_variables.setdefault('SHARED_LIB_DIR', - os.path.join('$!PRODUCT_DIR', 'lib')) - default_variables.setdefault('LIB_DIR', - os.path.join('$!PRODUCT_DIR', 'obj')) + """Calculate additional variables for use in the build (called by gyp).""" + global generator_additional_non_configuration_keys + global generator_additional_path_sections + flavor = gyp.common.GetFlavor(params) + if flavor == "mac": + default_variables.setdefault("OS", "mac") + default_variables.setdefault("SHARED_LIB_SUFFIX", ".dylib") + default_variables.setdefault( + "SHARED_LIB_DIR", generator_default_variables["PRODUCT_DIR"] + ) + default_variables.setdefault( + "LIB_DIR", generator_default_variables["PRODUCT_DIR"] + ) + + # Copy additional generator configuration data from Xcode, which is shared + # by the Mac Ninja generator. + import gyp.generator.xcode as xcode_generator + + generator_additional_non_configuration_keys = getattr( + xcode_generator, "generator_additional_non_configuration_keys", [] + ) + generator_additional_path_sections = getattr( + xcode_generator, "generator_additional_path_sections", [] + ) + global generator_extra_sources_for_rules + generator_extra_sources_for_rules = getattr( + xcode_generator, "generator_extra_sources_for_rules", [] + ) + elif flavor == "win": + exts = gyp.MSVSUtil.TARGET_TYPE_EXT + default_variables.setdefault("OS", "win") + default_variables["EXECUTABLE_SUFFIX"] = "." + exts["executable"] + default_variables["STATIC_LIB_PREFIX"] = "" + default_variables["STATIC_LIB_SUFFIX"] = "." + exts["static_library"] + default_variables["SHARED_LIB_PREFIX"] = "" + default_variables["SHARED_LIB_SUFFIX"] = "." + exts["shared_library"] + + # Copy additional generator configuration data from VS, which is shared + # by the Windows Ninja generator. + import gyp.generator.msvs as msvs_generator + + generator_additional_non_configuration_keys = getattr( + msvs_generator, "generator_additional_non_configuration_keys", [] + ) + generator_additional_path_sections = getattr( + msvs_generator, "generator_additional_path_sections", [] + ) + + gyp.msvs_emulation.CalculateCommonVariables(default_variables, params) + else: + operating_system = flavor + if flavor == "android": + operating_system = "linux" # Keep this legacy behavior for now. + default_variables.setdefault("OS", operating_system) + default_variables.setdefault("SHARED_LIB_SUFFIX", ".so") + default_variables.setdefault( + "SHARED_LIB_DIR", os.path.join("$!PRODUCT_DIR", "lib") + ) + default_variables.setdefault("LIB_DIR", os.path.join("$!PRODUCT_DIR", "obj")) + def ComputeOutputDir(params): - """Returns the path from the toplevel_dir to the build output directory.""" - # generator_dir: relative path from pwd to where make puts build files. - # Makes migrating from make to ninja easier, ninja doesn't put anything here. - generator_dir = os.path.relpath(params['options'].generator_output or '.') + """Returns the path from the toplevel_dir to the build output directory.""" + # generator_dir: relative path from pwd to where make puts build files. + # Makes migrating from make to ninja easier, ninja doesn't put anything here. + generator_dir = os.path.relpath(params["options"].generator_output or ".") - # output_dir: relative path from generator_dir to the build directory. - output_dir = params.get('generator_flags', {}).get('output_dir', 'out') + # output_dir: relative path from generator_dir to the build directory. + output_dir = params.get("generator_flags", {}).get("output_dir", "out") - # Relative path from source root to our output files. e.g. "out" - return os.path.normpath(os.path.join(generator_dir, output_dir)) + # Relative path from source root to our output files. e.g. "out" + return os.path.normpath(os.path.join(generator_dir, output_dir)) def CalculateGeneratorInputInfo(params): - """Called by __init__ to initialize generator values based on params.""" - # E.g. "out/gypfiles" - toplevel = params['options'].toplevel_dir - qualified_out_dir = os.path.normpath(os.path.join( - toplevel, ComputeOutputDir(params), 'gypfiles')) - - global generator_filelist_paths - generator_filelist_paths = { - 'toplevel': toplevel, - 'qualified_out_dir': qualified_out_dir, - } + """Called by __init__ to initialize generator values based on params.""" + # E.g. "out/gypfiles" + toplevel = params["options"].toplevel_dir + qualified_out_dir = os.path.normpath( + os.path.join(toplevel, ComputeOutputDir(params), "gypfiles") + ) + + global generator_filelist_paths + generator_filelist_paths = { + "toplevel": toplevel, + "qualified_out_dir": qualified_out_dir, + } -def OpenOutput(path, mode='w'): - """Open |path| for writing, creating directories if necessary.""" - gyp.common.EnsureDirExists(path) - return open(path, mode) +def OpenOutput(path, mode="w"): + """Open |path| for writing, creating directories if necessary.""" + gyp.common.EnsureDirExists(path) + return open(path, mode) def CommandWithWrapper(cmd, wrappers, prog): - wrapper = wrappers.get(cmd, '') - if wrapper: - return wrapper + ' ' + prog - return prog + wrapper = wrappers.get(cmd, "") + if wrapper: + return wrapper + " " + prog + return prog def GetDefaultConcurrentLinks(): - """Returns a best-guess for a number of concurrent links.""" - pool_size = int(os.environ.get('GYP_LINK_CONCURRENCY', 0)) - if pool_size: - return pool_size - - if sys.platform in ('win32', 'cygwin'): - import ctypes - - class MEMORYSTATUSEX(ctypes.Structure): - _fields_ = [ - ("dwLength", ctypes.c_ulong), - ("dwMemoryLoad", ctypes.c_ulong), - ("ullTotalPhys", ctypes.c_ulonglong), - ("ullAvailPhys", ctypes.c_ulonglong), - ("ullTotalPageFile", ctypes.c_ulonglong), - ("ullAvailPageFile", ctypes.c_ulonglong), - ("ullTotalVirtual", ctypes.c_ulonglong), - ("ullAvailVirtual", ctypes.c_ulonglong), - ("sullAvailExtendedVirtual", ctypes.c_ulonglong), - ] - - stat = MEMORYSTATUSEX() - stat.dwLength = ctypes.sizeof(stat) - ctypes.windll.kernel32.GlobalMemoryStatusEx(ctypes.byref(stat)) - - # VS 2015 uses 20% more working set than VS 2013 and can consume all RAM - # on a 64 GB machine. - mem_limit = max(1, stat.ullTotalPhys / (5 * (2 ** 30))) # total / 5GB - hard_cap = max(1, int(os.environ.get('GYP_LINK_CONCURRENCY_MAX', 2**32))) - return min(mem_limit, hard_cap) - elif sys.platform.startswith('linux'): - if os.path.exists("/proc/meminfo"): - with open("/proc/meminfo") as meminfo: - memtotal_re = re.compile(r'^MemTotal:\s*(\d*)\s*kB') - for line in meminfo: - match = memtotal_re.match(line) - if not match: - continue - # Allow 8Gb per link on Linux because Gold is quite memory hungry - return max(1, int(match.group(1)) / (8 * (2 ** 20))) - return 1 - elif sys.platform == 'darwin': - try: - avail_bytes = int(subprocess.check_output(['sysctl', '-n', 'hw.memsize'])) - # A static library debug build of Chromium's unit_tests takes ~2.7GB, so - # 4GB per ld process allows for some more bloat. - return max(1, avail_bytes / (4 * (2 ** 30))) # total / 4GB - except: - return 1 - else: - # TODO(scottmg): Implement this for other platforms. - return 1 + """Returns a best-guess for a number of concurrent links.""" + pool_size = int(os.environ.get("GYP_LINK_CONCURRENCY", 0)) + if pool_size: + return pool_size + + if sys.platform in ("win32", "cygwin"): + import ctypes + + class MEMORYSTATUSEX(ctypes.Structure): + _fields_ = [ + ("dwLength", ctypes.c_ulong), + ("dwMemoryLoad", ctypes.c_ulong), + ("ullTotalPhys", ctypes.c_ulonglong), + ("ullAvailPhys", ctypes.c_ulonglong), + ("ullTotalPageFile", ctypes.c_ulonglong), + ("ullAvailPageFile", ctypes.c_ulonglong), + ("ullTotalVirtual", ctypes.c_ulonglong), + ("ullAvailVirtual", ctypes.c_ulonglong), + ("sullAvailExtendedVirtual", ctypes.c_ulonglong), + ] + + stat = MEMORYSTATUSEX() + stat.dwLength = ctypes.sizeof(stat) + ctypes.windll.kernel32.GlobalMemoryStatusEx(ctypes.byref(stat)) + + # VS 2015 uses 20% more working set than VS 2013 and can consume all RAM + # on a 64 GB machine. + mem_limit = max(1, stat.ullTotalPhys // (5 * (2 ** 30))) # total / 5GB + hard_cap = max(1, int(os.environ.get("GYP_LINK_CONCURRENCY_MAX", 2 ** 32))) + return min(mem_limit, hard_cap) + elif sys.platform.startswith("linux"): + if os.path.exists("/proc/meminfo"): + with open("/proc/meminfo") as meminfo: + memtotal_re = re.compile(r"^MemTotal:\s*(\d*)\s*kB") + for line in meminfo: + match = memtotal_re.match(line) + if not match: + continue + # Allow 8Gb per link on Linux because Gold is quite memory hungry + return max(1, int(match.group(1)) // (8 * (2 ** 20))) + return 1 + elif sys.platform == "darwin": + try: + avail_bytes = int(subprocess.check_output(["sysctl", "-n", "hw.memsize"])) + # A static library debug build of Chromium's unit_tests takes ~2.7GB, so + # 4GB per ld process allows for some more bloat. + return max(1, avail_bytes // (4 * (2 ** 30))) # total / 4GB + except subprocess.CalledProcessError: + return 1 + else: + # TODO(scottmg): Implement this for other platforms. + return 1 def _GetWinLinkRuleNameSuffix(embed_manifest): - """Returns the suffix used to select an appropriate linking rule depending on + """Returns the suffix used to select an appropriate linking rule depending on whether the manifest embedding is enabled.""" - return '_embed' if embed_manifest else '' + return "_embed" if embed_manifest else "" def _AddWinLinkRules(master_ninja, embed_manifest): - """Adds link rules for Windows platform to |master_ninja|.""" - def FullLinkCommand(ldcmd, out, binary_type): - resource_name = { - 'exe': '1', - 'dll': '2', - }[binary_type] - return '%(python)s gyp-win-tool link-with-manifests $arch %(embed)s ' \ - '%(out)s "%(ldcmd)s" %(resname)s $mt $rc "$intermediatemanifest" ' \ - '$manifests' % { - 'python': sys.executable, - 'out': out, - 'ldcmd': ldcmd, - 'resname': resource_name, - 'embed': embed_manifest } - rule_name_suffix = _GetWinLinkRuleNameSuffix(embed_manifest) - use_separate_mspdbsrv = ( - int(os.environ.get('GYP_USE_SEPARATE_MSPDBSRV', '0')) != 0) - dlldesc = 'LINK%s(DLL) $binary' % rule_name_suffix.upper() - dllcmd = ('%s gyp-win-tool link-wrapper $arch %s ' - '$ld /nologo $implibflag /DLL /OUT:$binary ' - '@$binary.rsp' % (sys.executable, use_separate_mspdbsrv)) - dllcmd = FullLinkCommand(dllcmd, '$binary', 'dll') - master_ninja.rule('solink' + rule_name_suffix, - description=dlldesc, command=dllcmd, - rspfile='$binary.rsp', - rspfile_content='$libs $in_newline $ldflags', - restat=True, - pool='link_pool') - master_ninja.rule('solink_module' + rule_name_suffix, - description=dlldesc, command=dllcmd, - rspfile='$binary.rsp', - rspfile_content='$libs $in_newline $ldflags', - restat=True, - pool='link_pool') - # Note that ldflags goes at the end so that it has the option of - # overriding default settings earlier in the command line. - exe_cmd = ('%s gyp-win-tool link-wrapper $arch %s ' - '$ld /nologo /OUT:$binary @$binary.rsp' % - (sys.executable, use_separate_mspdbsrv)) - exe_cmd = FullLinkCommand(exe_cmd, '$binary', 'exe') - master_ninja.rule('link' + rule_name_suffix, - description='LINK%s $binary' % rule_name_suffix.upper(), - command=exe_cmd, - rspfile='$binary.rsp', - rspfile_content='$in_newline $libs $ldflags', - pool='link_pool') - - -def GenerateOutputForConfig(target_list, target_dicts, data, params, - config_name): - options = params['options'] - flavor = gyp.common.GetFlavor(params) - generator_flags = params.get('generator_flags', {}) - - # build_dir: relative path from source root to our output files. - # e.g. "out/Debug" - build_dir = os.path.normpath( - os.path.join(ComputeOutputDir(params), config_name)) - - toplevel_build = os.path.join(options.toplevel_dir, build_dir) - - master_ninja_file = OpenOutput(os.path.join(toplevel_build, 'build.ninja')) - master_ninja = ninja_syntax.Writer(master_ninja_file, width=120) - - # Put build-time support tools in out/{config_name}. - gyp.common.CopyTool(flavor, toplevel_build) - - # Grab make settings for CC/CXX. - # The rules are - # - The priority from low to high is gcc/g++, the 'make_global_settings' in - # gyp, the environment variable. - # - If there is no 'make_global_settings' for CC.host/CXX.host or - # 'CC_host'/'CXX_host' environment variable, cc_host/cxx_host should be set - # to cc/cxx. - if flavor == 'win': - ar = 'lib.exe' - # cc and cxx must be set to the correct architecture by overriding with one - # of cl_x86 or cl_x64 below. - cc = 'UNSET' - cxx = 'UNSET' - ld = 'link.exe' - ld_host = '$ld' - else: - ar = 'ar' - cc = 'cc' - cxx = 'c++' - ld = '$cc' - ldxx = '$cxx' - ld_host = '$cc_host' - ldxx_host = '$cxx_host' - - ar_host = 'ar' - cc_host = None - cxx_host = None - cc_host_global_setting = None - cxx_host_global_setting = None - clang_cl = None - nm = 'nm' - nm_host = 'nm' - readelf = 'readelf' - readelf_host = 'readelf' - - build_file, _, _ = gyp.common.ParseQualifiedTarget(target_list[0]) - make_global_settings = data[build_file].get('make_global_settings', []) - build_to_root = gyp.common.InvertRelativePath(build_dir, - options.toplevel_dir) - wrappers = {} - for key, value in make_global_settings: - if key == 'AR': - ar = os.path.join(build_to_root, value) - if key == 'AR.host': - ar_host = os.path.join(build_to_root, value) - if key == 'CC': - cc = os.path.join(build_to_root, value) - if cc.endswith('clang-cl'): - clang_cl = cc - if key == 'CXX': - cxx = os.path.join(build_to_root, value) - if key == 'CC.host': - cc_host = os.path.join(build_to_root, value) - cc_host_global_setting = value - if key == 'CXX.host': - cxx_host = os.path.join(build_to_root, value) - cxx_host_global_setting = value - if key == 'LD': - ld = os.path.join(build_to_root, value) - if key == 'LD.host': - ld_host = os.path.join(build_to_root, value) - if key == 'LDXX': - ldxx = os.path.join(build_to_root, value) - if key == 'LDXX.host': - ldxx_host = os.path.join(build_to_root, value) - if key == 'NM': - nm = os.path.join(build_to_root, value) - if key == 'NM.host': - nm_host = os.path.join(build_to_root, value) - if key == 'READELF': - readelf = os.path.join(build_to_root, value) - if key == 'READELF.host': - readelf_host = os.path.join(build_to_root, value) - if key.endswith('_wrapper'): - wrappers[key[:-len('_wrapper')]] = os.path.join(build_to_root, value) - - # Support wrappers from environment variables too. - for key, value in os.environ.items(): - if key.lower().endswith('_wrapper'): - key_prefix = key[:-len('_wrapper')] - key_prefix = re.sub(r'\.HOST$', '.host', key_prefix) - wrappers[key_prefix] = os.path.join(build_to_root, value) - - if flavor == 'win': - configs = [target_dicts[qualified_target]['configurations'][config_name] - for qualified_target in target_list] - shared_system_includes = None - if not generator_flags.get('ninja_use_custom_environment_files', 0): - shared_system_includes = \ - gyp.msvs_emulation.ExtractSharedMSVSSystemIncludes( - configs, generator_flags) - cl_paths = gyp.msvs_emulation.GenerateEnvironmentFiles( - toplevel_build, generator_flags, shared_system_includes, OpenOutput) - for arch, path in cl_paths.items(): - if clang_cl: - # If we have selected clang-cl, use that instead. - path = clang_cl - command = CommandWithWrapper('CC', wrappers, - QuoteShellArgument(path, 'win')) - if clang_cl: - # Use clang-cl to cross-compile for x86 or x86_64. - command += (' -m32' if arch == 'x86' else ' -m64') - master_ninja.variable('cl_' + arch, command) - - cc = GetEnvironFallback(['CC_target', 'CC'], cc) - master_ninja.variable('cc', CommandWithWrapper('CC', wrappers, cc)) - cxx = GetEnvironFallback(['CXX_target', 'CXX'], cxx) - master_ninja.variable('cxx', CommandWithWrapper('CXX', wrappers, cxx)) - - if flavor == 'win': - master_ninja.variable('ld', ld) - master_ninja.variable('idl', 'midl.exe') - master_ninja.variable('ar', ar) - master_ninja.variable('rc', 'rc.exe') - master_ninja.variable('ml_x86', 'ml.exe') - master_ninja.variable('ml_x64', 'ml64.exe') - master_ninja.variable('mt', 'mt.exe') - else: - master_ninja.variable('ld', CommandWithWrapper('LINK', wrappers, ld)) - master_ninja.variable('ldxx', CommandWithWrapper('LINK', wrappers, ldxx)) - master_ninja.variable('ar', GetEnvironFallback(['AR_target', 'AR'], ar)) - if flavor != 'mac': - # Mac does not use readelf/nm for .TOC generation, so avoiding polluting - # the master ninja with extra unused variables. - master_ninja.variable( - 'nm', GetEnvironFallback(['NM_target', 'NM'], nm)) - master_ninja.variable( - 'readelf', GetEnvironFallback(['READELF_target', 'READELF'], readelf)) - - if generator_supports_multiple_toolsets: - if not cc_host: - cc_host = cc - if not cxx_host: - cxx_host = cxx - - master_ninja.variable('ar_host', GetEnvironFallback(['AR_host'], ar_host)) - master_ninja.variable('nm_host', GetEnvironFallback(['NM_host'], nm_host)) - master_ninja.variable('readelf_host', - GetEnvironFallback(['READELF_host'], readelf_host)) - cc_host = GetEnvironFallback(['CC_host'], cc_host) - cxx_host = GetEnvironFallback(['CXX_host'], cxx_host) - - # The environment variable could be used in 'make_global_settings', like - # ['CC.host', '$(CC)'] or ['CXX.host', '$(CXX)'], transform them here. - if '$(CC)' in cc_host and cc_host_global_setting: - cc_host = cc_host_global_setting.replace('$(CC)', cc) - if '$(CXX)' in cxx_host and cxx_host_global_setting: - cxx_host = cxx_host_global_setting.replace('$(CXX)', cxx) - master_ninja.variable('cc_host', - CommandWithWrapper('CC.host', wrappers, cc_host)) - master_ninja.variable('cxx_host', - CommandWithWrapper('CXX.host', wrappers, cxx_host)) - if flavor == 'win': - master_ninja.variable('ld_host', ld_host) - master_ninja.variable('ldxx_host', ldxx_host) - else: - master_ninja.variable('ld_host', CommandWithWrapper( - 'LINK', wrappers, ld_host)) - master_ninja.variable('ldxx_host', CommandWithWrapper( - 'LINK', wrappers, ldxx_host)) - - master_ninja.newline() - - master_ninja.pool('link_pool', depth=GetDefaultConcurrentLinks()) - master_ninja.newline() - - deps = 'msvc' if flavor == 'win' else 'gcc' - - if flavor != 'win': - master_ninja.rule( - 'cc', - description='CC $out', - command=('$cc -MMD -MF $out.d $defines $includes $cflags $cflags_c ' - '$cflags_pch_c -c $in -o $out'), - depfile='$out.d', - deps=deps) - master_ninja.rule( - 'cc_s', - description='CC $out', - command=('$cc $defines $includes $cflags $cflags_c ' - '$cflags_pch_c -c $in -o $out')) - master_ninja.rule( - 'cxx', - description='CXX $out', - command=('$cxx -MMD -MF $out.d $defines $includes $cflags $cflags_cc ' - '$cflags_pch_cc -c $in -o $out'), - depfile='$out.d', - deps=deps) - else: - # TODO(scottmg) Separate pdb names is a test to see if it works around - # http://crbug.com/142362. It seems there's a race between the creation of - # the .pdb by the precompiled header step for .cc and the compilation of - # .c files. This should be handled by mspdbsrv, but rarely errors out with - # c1xx : fatal error C1033: cannot open program database - # By making the rules target separate pdb files this might be avoided. - cc_command = ('ninja -t msvc -e $arch ' + - '-- ' - '$cc /nologo /showIncludes /FC ' - '@$out.rsp /c $in /Fo$out /Fd$pdbname_c ') - cxx_command = ('ninja -t msvc -e $arch ' + - '-- ' - '$cxx /nologo /showIncludes /FC ' - '@$out.rsp /c $in /Fo$out /Fd$pdbname_cc ') - master_ninja.rule( - 'cc', - description='CC $out', - command=cc_command, - rspfile='$out.rsp', - rspfile_content='$defines $includes $cflags $cflags_c', - deps=deps) - master_ninja.rule( - 'cxx', - description='CXX $out', - command=cxx_command, - rspfile='$out.rsp', - rspfile_content='$defines $includes $cflags $cflags_cc', - deps=deps) - master_ninja.rule( - 'idl', - description='IDL $in', - command=('%s gyp-win-tool midl-wrapper $arch $outdir ' - '$tlb $h $dlldata $iid $proxy $in ' - '$midl_includes $idlflags' % sys.executable)) - master_ninja.rule( - 'rc', - description='RC $in', - # Note: $in must be last otherwise rc.exe complains. - command=('%s gyp-win-tool rc-wrapper ' - '$arch $rc $defines $resource_includes $rcflags /fo$out $in' % - sys.executable)) - master_ninja.rule( - 'asm', - description='ASM $out', - command=('%s gyp-win-tool asm-wrapper ' - '$arch $asm $defines $includes $asmflags /c /Fo $out $in' % - sys.executable)) - - if flavor != 'mac' and flavor != 'win': - master_ninja.rule( - 'alink', - description='AR $out', - command='rm -f $out && $ar rcs $arflags $out $in') - master_ninja.rule( - 'alink_thin', - description='AR $out', - command='rm -f $out && $ar rcsT $arflags $out $in') - - # This allows targets that only need to depend on $lib's API to declare an - # order-only dependency on $lib.TOC and avoid relinking such downstream - # dependencies when $lib changes only in non-public ways. - # The resulting string leaves an uninterpolated %{suffix} which - # is used in the final substitution below. - mtime_preserving_solink_base = ( - 'if [ ! -e $lib -o ! -e $lib.TOC ]; then ' - '%(solink)s && %(extract_toc)s > $lib.TOC; else ' - '%(solink)s && %(extract_toc)s > $lib.tmp && ' - 'if ! cmp -s $lib.tmp $lib.TOC; then mv $lib.tmp $lib.TOC ; ' - 'fi; fi' - % { 'solink': - '$ld -shared $ldflags -o $lib -Wl,-soname=$soname %(suffix)s', - 'extract_toc': - ('{ $readelf -d $lib | grep SONAME ; ' - '$nm -gD -f p $lib | cut -f1-2 -d\' \'; }')}) - - master_ninja.rule( - 'solink', - description='SOLINK $lib', - restat=True, - command=mtime_preserving_solink_base % {'suffix': '@$link_file_list'}, - rspfile='$link_file_list', - rspfile_content= - '-Wl,--whole-archive $in $solibs -Wl,--no-whole-archive $libs', - pool='link_pool') + """Adds link rules for Windows platform to |master_ninja|.""" + + def FullLinkCommand(ldcmd, out, binary_type): + resource_name = {"exe": "1", "dll": "2"}[binary_type] + return ( + "%(python)s gyp-win-tool link-with-manifests $arch %(embed)s " + '%(out)s "%(ldcmd)s" %(resname)s $mt $rc "$intermediatemanifest" ' + "$manifests" + % { + "python": sys.executable, + "out": out, + "ldcmd": ldcmd, + "resname": resource_name, + "embed": embed_manifest, + } + ) + + rule_name_suffix = _GetWinLinkRuleNameSuffix(embed_manifest) + use_separate_mspdbsrv = int(os.environ.get("GYP_USE_SEPARATE_MSPDBSRV", "0")) != 0 + dlldesc = "LINK%s(DLL) $binary" % rule_name_suffix.upper() + dllcmd = ( + "%s gyp-win-tool link-wrapper $arch %s " + "$ld /nologo $implibflag /DLL /OUT:$binary " + "@$binary.rsp" % (sys.executable, use_separate_mspdbsrv) + ) + dllcmd = FullLinkCommand(dllcmd, "$binary", "dll") master_ninja.rule( - 'solink_module', - description='SOLINK(module) $lib', - restat=True, - command=mtime_preserving_solink_base % {'suffix': '@$link_file_list'}, - rspfile='$link_file_list', - rspfile_content='-Wl,--start-group $in $solibs $libs -Wl,--end-group', - pool='link_pool') + "solink" + rule_name_suffix, + description=dlldesc, + command=dllcmd, + rspfile="$binary.rsp", + rspfile_content="$libs $in_newline $ldflags", + restat=True, + pool="link_pool", + ) master_ninja.rule( - 'link', - description='LINK $out', - command=('$ld $ldflags -o $out ' - '-Wl,--start-group $in $solibs $libs -Wl,--end-group'), - pool='link_pool') - elif flavor == 'win': + "solink_module" + rule_name_suffix, + description=dlldesc, + command=dllcmd, + rspfile="$binary.rsp", + rspfile_content="$libs $in_newline $ldflags", + restat=True, + pool="link_pool", + ) + # Note that ldflags goes at the end so that it has the option of + # overriding default settings earlier in the command line. + exe_cmd = ( + "%s gyp-win-tool link-wrapper $arch %s " + "$ld /nologo /OUT:$binary @$binary.rsp" + % (sys.executable, use_separate_mspdbsrv) + ) + exe_cmd = FullLinkCommand(exe_cmd, "$binary", "exe") master_ninja.rule( - 'alink', - description='LIB $out', - command=('%s gyp-win-tool link-wrapper $arch False ' - '$ar /nologo /ignore:4221 /OUT:$out @$out.rsp' % - sys.executable), - rspfile='$out.rsp', - rspfile_content='$in_newline $libflags') - _AddWinLinkRules(master_ninja, embed_manifest=True) - _AddWinLinkRules(master_ninja, embed_manifest=False) - else: - master_ninja.rule( - 'objc', - description='OBJC $out', - command=('$cc -MMD -MF $out.d $defines $includes $cflags $cflags_objc ' - '$cflags_pch_objc -c $in -o $out'), - depfile='$out.d', - deps=deps) - master_ninja.rule( - 'objcxx', - description='OBJCXX $out', - command=('$cxx -MMD -MF $out.d $defines $includes $cflags $cflags_objcc ' - '$cflags_pch_objcc -c $in -o $out'), - depfile='$out.d', - deps=deps) - master_ninja.rule( - 'alink', - description='LIBTOOL-STATIC $out, POSTBUILDS', - command='rm -f $out && ' - './gyp-mac-tool filter-libtool libtool $libtool_flags ' - '-static -o $out $in' - '$postbuilds') - master_ninja.rule( - 'lipo', - description='LIPO $out, POSTBUILDS', - command='rm -f $out && lipo -create $in -output $out$postbuilds') - master_ninja.rule( - 'solipo', - description='SOLIPO $out, POSTBUILDS', - command=( - 'rm -f $lib $lib.TOC && lipo -create $in -output $lib$postbuilds &&' - '%(extract_toc)s > $lib.TOC' - % { 'extract_toc': - '{ otool -l $lib | grep LC_ID_DYLIB -A 5; ' - 'nm -gP $lib | cut -f1-2 -d\' \' | grep -v U$$; true; }'})) - - - # Record the public interface of $lib in $lib.TOC. See the corresponding - # comment in the posix section above for details. - solink_base = '$ld %(type)s $ldflags -o $lib %(suffix)s' - mtime_preserving_solink_base = ( - 'if [ ! -e $lib -o ! -e $lib.TOC ] || ' - # Always force dependent targets to relink if this library - # reexports something. Handling this correctly would require - # recursive TOC dumping but this is rare in practice, so punt. - 'otool -l $lib | grep -q LC_REEXPORT_DYLIB ; then ' - '%(solink)s && %(extract_toc)s > $lib.TOC; ' - 'else ' - '%(solink)s && %(extract_toc)s > $lib.tmp && ' - 'if ! cmp -s $lib.tmp $lib.TOC; then ' - 'mv $lib.tmp $lib.TOC ; ' - 'fi; ' - 'fi' - % { 'solink': solink_base, - 'extract_toc': - '{ otool -l $lib | grep LC_ID_DYLIB -A 5; ' - 'nm -gP $lib | cut -f1-2 -d\' \' | grep -v U$$; true; }'}) - - - solink_suffix = '@$link_file_list$postbuilds' - master_ninja.rule( - 'solink', - description='SOLINK $lib, POSTBUILDS', - restat=True, - command=mtime_preserving_solink_base % {'suffix': solink_suffix, - 'type': '-shared'}, - rspfile='$link_file_list', - rspfile_content='$in $solibs $libs', - pool='link_pool') - master_ninja.rule( - 'solink_notoc', - description='SOLINK $lib, POSTBUILDS', - restat=True, - command=solink_base % {'suffix':solink_suffix, 'type': '-shared'}, - rspfile='$link_file_list', - rspfile_content='$in $solibs $libs', - pool='link_pool') - - master_ninja.rule( - 'solink_module', - description='SOLINK(module) $lib, POSTBUILDS', - restat=True, - command=mtime_preserving_solink_base % {'suffix': solink_suffix, - 'type': '-bundle'}, - rspfile='$link_file_list', - rspfile_content='$in $solibs $libs', - pool='link_pool') - master_ninja.rule( - 'solink_module_notoc', - description='SOLINK(module) $lib, POSTBUILDS', - restat=True, - command=solink_base % {'suffix': solink_suffix, 'type': '-bundle'}, - rspfile='$link_file_list', - rspfile_content='$in $solibs $libs', - pool='link_pool') - - master_ninja.rule( - 'link', - description='LINK $out, POSTBUILDS', - command=('$ld $ldflags -o $out ' - '$in $solibs $libs$postbuilds'), - pool='link_pool') - master_ninja.rule( - 'preprocess_infoplist', - description='PREPROCESS INFOPLIST $out', - command=('$cc -E -P -Wno-trigraphs -x c $defines $in -o $out && ' - 'plutil -convert xml1 $out $out')) - master_ninja.rule( - 'copy_infoplist', - description='COPY INFOPLIST $in', - command='$env ./gyp-mac-tool copy-info-plist $in $out $binary $keys') - master_ninja.rule( - 'merge_infoplist', - description='MERGE INFOPLISTS $in', - command='$env ./gyp-mac-tool merge-info-plist $out $in') - master_ninja.rule( - 'compile_xcassets', - description='COMPILE XCASSETS $in', - command='$env ./gyp-mac-tool compile-xcassets $keys $in') - master_ninja.rule( - 'mac_tool', - description='MACTOOL $mactool_cmd $in', - command='$env ./gyp-mac-tool $mactool_cmd $in $out $binary') - master_ninja.rule( - 'package_framework', - description='PACKAGE FRAMEWORK $out, POSTBUILDS', - command='./gyp-mac-tool package-framework $out $version$postbuilds ' - '&& touch $out') - if flavor == 'win': - master_ninja.rule( - 'stamp', - description='STAMP $out', - command='%s gyp-win-tool stamp $out' % sys.executable) - else: - master_ninja.rule( - 'stamp', - description='STAMP $out', - command='${postbuilds}touch $out') - if flavor == 'win': - master_ninja.rule( - 'copy', - description='COPY $in $out', - command='%s gyp-win-tool recursive-mirror $in $out' % sys.executable) - elif flavor == 'zos': - master_ninja.rule( - 'copy', - description='COPY $in $out', - command='rm -rf $out && cp -fRP $in $out') - else: - master_ninja.rule( - 'copy', - description='COPY $in $out', - command='rm -rf $out && cp -af $in $out') - master_ninja.newline() - - all_targets = set() - for build_file in params['build_files']: - for target in gyp.common.AllTargets(target_list, - target_dicts, - os.path.normpath(build_file)): - all_targets.add(target) - all_outputs = set() - - # target_outputs is a map from qualified target name to a Target object. - target_outputs = {} - # target_short_names is a map from target short name to a list of Target - # objects. - target_short_names = {} - - # short name of targets that were skipped because they didn't contain anything - # interesting. - # NOTE: there may be overlap between this an non_empty_target_names. - empty_target_names = set() - - # Set of non-empty short target names. - # NOTE: there may be overlap between this an empty_target_names. - non_empty_target_names = set() - - for qualified_target in target_list: - # qualified_target is like: third_party/icu/icu.gyp:icui18n#target - build_file, name, toolset = \ - gyp.common.ParseQualifiedTarget(qualified_target) - - this_make_global_settings = data[build_file].get('make_global_settings', []) - assert make_global_settings == this_make_global_settings, ( - "make_global_settings needs to be the same for all targets. %s vs. %s" % - (this_make_global_settings, make_global_settings)) - - spec = target_dicts[qualified_target] - if flavor == 'mac': - gyp.xcode_emulation.MergeGlobalXcodeSettingsToSpec(data[build_file], spec) - - # If build_file is a symlink, we must not follow it because there's a chance - # it could point to a path above toplevel_dir, and we cannot correctly deal - # with that case at the moment. - build_file = gyp.common.RelativePath(build_file, options.toplevel_dir, - False) - - qualified_target_for_hash = gyp.common.QualifiedTarget(build_file, name, - toolset) - hash_for_rules = hashlib.md5(qualified_target_for_hash).hexdigest() - - base_path = os.path.dirname(build_file) - obj = 'obj' - if toolset != 'target': - obj += '.' + toolset - output_file = os.path.join(obj, base_path, name + '.ninja') - - ninja_output = StringIO() - writer = NinjaWriter(hash_for_rules, target_outputs, base_path, build_dir, - ninja_output, - toplevel_build, output_file, - flavor, toplevel_dir=options.toplevel_dir) - - target = writer.WriteSpec(spec, config_name, generator_flags) - - if ninja_output.tell() > 0: - # Only create files for ninja files that actually have contents. - with OpenOutput(os.path.join(toplevel_build, output_file)) as ninja_file: - ninja_file.write(ninja_output.getvalue()) - ninja_output.close() - master_ninja.subninja(output_file) - - if target: - if name != target.FinalOutput() and spec['toolset'] == 'target': - target_short_names.setdefault(name, []).append(target) - target_outputs[qualified_target] = target - if qualified_target in all_targets: - all_outputs.add(target.FinalOutput()) - non_empty_target_names.add(name) + "link" + rule_name_suffix, + description="LINK%s $binary" % rule_name_suffix.upper(), + command=exe_cmd, + rspfile="$binary.rsp", + rspfile_content="$in_newline $libs $ldflags", + pool="link_pool", + ) + + +def GenerateOutputForConfig(target_list, target_dicts, data, params, config_name): + options = params["options"] + flavor = gyp.common.GetFlavor(params) + generator_flags = params.get("generator_flags", {}) + + # build_dir: relative path from source root to our output files. + # e.g. "out/Debug" + build_dir = os.path.normpath(os.path.join(ComputeOutputDir(params), config_name)) + + toplevel_build = os.path.join(options.toplevel_dir, build_dir) + + master_ninja_file = OpenOutput(os.path.join(toplevel_build, "build.ninja")) + master_ninja = ninja_syntax.Writer(master_ninja_file, width=120) + + # Put build-time support tools in out/{config_name}. + gyp.common.CopyTool(flavor, toplevel_build, generator_flags) + + # Grab make settings for CC/CXX. + # The rules are + # - The priority from low to high is gcc/g++, the 'make_global_settings' in + # gyp, the environment variable. + # - If there is no 'make_global_settings' for CC.host/CXX.host or + # 'CC_host'/'CXX_host' environment variable, cc_host/cxx_host should be set + # to cc/cxx. + if flavor == "win": + ar = "lib.exe" + # cc and cxx must be set to the correct architecture by overriding with one + # of cl_x86 or cl_x64 below. + cc = "UNSET" + cxx = "UNSET" + ld = "link.exe" + ld_host = "$ld" + else: + ar = "ar" + cc = "cc" + cxx = "c++" + ld = "$cc" + ldxx = "$cxx" + ld_host = "$cc_host" + ldxx_host = "$cxx_host" + + ar_host = ar + cc_host = None + cxx_host = None + cc_host_global_setting = None + cxx_host_global_setting = None + clang_cl = None + nm = "nm" + nm_host = "nm" + readelf = "readelf" + readelf_host = "readelf" + + build_file, _, _ = gyp.common.ParseQualifiedTarget(target_list[0]) + make_global_settings = data[build_file].get("make_global_settings", []) + build_to_root = gyp.common.InvertRelativePath(build_dir, options.toplevel_dir) + wrappers = {} + for key, value in make_global_settings: + if key == "AR": + ar = os.path.join(build_to_root, value) + if key == "AR.host": + ar_host = os.path.join(build_to_root, value) + if key == "CC": + cc = os.path.join(build_to_root, value) + if cc.endswith("clang-cl"): + clang_cl = cc + if key == "CXX": + cxx = os.path.join(build_to_root, value) + if key == "CC.host": + cc_host = os.path.join(build_to_root, value) + cc_host_global_setting = value + if key == "CXX.host": + cxx_host = os.path.join(build_to_root, value) + cxx_host_global_setting = value + if key == "LD": + ld = os.path.join(build_to_root, value) + if key == "LD.host": + ld_host = os.path.join(build_to_root, value) + if key == "LDXX": + ldxx = os.path.join(build_to_root, value) + if key == "LDXX.host": + ldxx_host = os.path.join(build_to_root, value) + if key == "NM": + nm = os.path.join(build_to_root, value) + if key == "NM.host": + nm_host = os.path.join(build_to_root, value) + if key == "READELF": + readelf = os.path.join(build_to_root, value) + if key == "READELF.host": + readelf_host = os.path.join(build_to_root, value) + if key.endswith("_wrapper"): + wrappers[key[: -len("_wrapper")]] = os.path.join(build_to_root, value) + + # Support wrappers from environment variables too. + for key, value in os.environ.items(): + if key.lower().endswith("_wrapper"): + key_prefix = key[: -len("_wrapper")] + key_prefix = re.sub(r"\.HOST$", ".host", key_prefix) + wrappers[key_prefix] = os.path.join(build_to_root, value) + + mac_toolchain_dir = generator_flags.get("mac_toolchain_dir", None) + if mac_toolchain_dir: + wrappers["LINK"] = "export DEVELOPER_DIR='%s' &&" % mac_toolchain_dir + + if flavor == "win": + configs = [ + target_dicts[qualified_target]["configurations"][config_name] + for qualified_target in target_list + ] + shared_system_includes = None + if not generator_flags.get("ninja_use_custom_environment_files", 0): + shared_system_includes = gyp.msvs_emulation.ExtractSharedMSVSSystemIncludes( + configs, generator_flags + ) + cl_paths = gyp.msvs_emulation.GenerateEnvironmentFiles( + toplevel_build, generator_flags, shared_system_includes, OpenOutput + ) + for arch, path in sorted(cl_paths.items()): + if clang_cl: + # If we have selected clang-cl, use that instead. + path = clang_cl + command = CommandWithWrapper( + "CC", wrappers, QuoteShellArgument(path, "win") + ) + if clang_cl: + # Use clang-cl to cross-compile for x86 or x86_64. + command += " -m32" if arch == "x86" else " -m64" + master_ninja.variable("cl_" + arch, command) + + cc = GetEnvironFallback(["CC_target", "CC"], cc) + master_ninja.variable("cc", CommandWithWrapper("CC", wrappers, cc)) + cxx = GetEnvironFallback(["CXX_target", "CXX"], cxx) + master_ninja.variable("cxx", CommandWithWrapper("CXX", wrappers, cxx)) + + if flavor == "win": + master_ninja.variable("ld", ld) + master_ninja.variable("idl", "midl.exe") + master_ninja.variable("ar", ar) + master_ninja.variable("rc", "rc.exe") + master_ninja.variable("ml_x86", "ml.exe") + master_ninja.variable("ml_x64", "ml64.exe") + master_ninja.variable("mt", "mt.exe") else: - empty_target_names.add(name) + master_ninja.variable("ld", CommandWithWrapper("LINK", wrappers, ld)) + master_ninja.variable("ldxx", CommandWithWrapper("LINK", wrappers, ldxx)) + master_ninja.variable("ar", GetEnvironFallback(["AR_target", "AR"], ar)) + if flavor != "mac": + # Mac does not use readelf/nm for .TOC generation, so avoiding polluting + # the master ninja with extra unused variables. + master_ninja.variable("nm", GetEnvironFallback(["NM_target", "NM"], nm)) + master_ninja.variable( + "readelf", GetEnvironFallback(["READELF_target", "READELF"], readelf) + ) + + if generator_supports_multiple_toolsets: + if not cc_host: + cc_host = cc + if not cxx_host: + cxx_host = cxx + + master_ninja.variable("ar_host", GetEnvironFallback(["AR_host"], ar_host)) + master_ninja.variable("nm_host", GetEnvironFallback(["NM_host"], nm_host)) + master_ninja.variable( + "readelf_host", GetEnvironFallback(["READELF_host"], readelf_host) + ) + cc_host = GetEnvironFallback(["CC_host"], cc_host) + cxx_host = GetEnvironFallback(["CXX_host"], cxx_host) + + # The environment variable could be used in 'make_global_settings', like + # ['CC.host', '$(CC)'] or ['CXX.host', '$(CXX)'], transform them here. + if "$(CC)" in cc_host and cc_host_global_setting: + cc_host = cc_host_global_setting.replace("$(CC)", cc) + if "$(CXX)" in cxx_host and cxx_host_global_setting: + cxx_host = cxx_host_global_setting.replace("$(CXX)", cxx) + master_ninja.variable( + "cc_host", CommandWithWrapper("CC.host", wrappers, cc_host) + ) + master_ninja.variable( + "cxx_host", CommandWithWrapper("CXX.host", wrappers, cxx_host) + ) + if flavor == "win": + master_ninja.variable("ld_host", ld_host) + master_ninja.variable("ldxx_host", ldxx_host) + else: + master_ninja.variable( + "ld_host", CommandWithWrapper("LINK", wrappers, ld_host) + ) + master_ninja.variable( + "ldxx_host", CommandWithWrapper("LINK", wrappers, ldxx_host) + ) - if target_short_names: - # Write a short name to build this target. This benefits both the - # "build chrome" case as well as the gyp tests, which expect to be - # able to run actions and build libraries by their short name. master_ninja.newline() - master_ninja.comment('Short names for targets.') - for short_name in target_short_names: - master_ninja.build(short_name, 'phony', [x.FinalOutput() for x in - target_short_names[short_name]]) - - # Write phony targets for any empty targets that weren't written yet. As - # short names are not necessarily unique only do this for short names that - # haven't already been output for another target. - empty_target_names = empty_target_names - non_empty_target_names - if empty_target_names: + + master_ninja.pool("link_pool", depth=GetDefaultConcurrentLinks()) master_ninja.newline() - master_ninja.comment('Empty targets (output for completeness).') - for name in sorted(empty_target_names): - master_ninja.build(name, 'phony') - if all_outputs: + deps = "msvc" if flavor == "win" else "gcc" + + if flavor != "win": + master_ninja.rule( + "cc", + description="CC $out", + command=( + "$cc -MMD -MF $out.d $defines $includes $cflags $cflags_c " + "$cflags_pch_c -c $in -o $out" + ), + depfile="$out.d", + deps=deps, + ) + master_ninja.rule( + "cc_s", + description="CC $out", + command=( + "$cc $defines $includes $cflags $cflags_c " + "$cflags_pch_c -c $in -o $out" + ), + ) + master_ninja.rule( + "cxx", + description="CXX $out", + command=( + "$cxx -MMD -MF $out.d $defines $includes $cflags $cflags_cc " + "$cflags_pch_cc -c $in -o $out" + ), + depfile="$out.d", + deps=deps, + ) + else: + # TODO(scottmg) Separate pdb names is a test to see if it works around + # http://crbug.com/142362. It seems there's a race between the creation of + # the .pdb by the precompiled header step for .cc and the compilation of + # .c files. This should be handled by mspdbsrv, but rarely errors out with + # c1xx : fatal error C1033: cannot open program database + # By making the rules target separate pdb files this might be avoided. + cc_command = ( + "ninja -t msvc -e $arch " + "-- " + "$cc /nologo /showIncludes /FC " + "@$out.rsp /c $in /Fo$out /Fd$pdbname_c " + ) + cxx_command = ( + "ninja -t msvc -e $arch " + "-- " + "$cxx /nologo /showIncludes /FC " + "@$out.rsp /c $in /Fo$out /Fd$pdbname_cc " + ) + master_ninja.rule( + "cc", + description="CC $out", + command=cc_command, + rspfile="$out.rsp", + rspfile_content="$defines $includes $cflags $cflags_c", + deps=deps, + ) + master_ninja.rule( + "cxx", + description="CXX $out", + command=cxx_command, + rspfile="$out.rsp", + rspfile_content="$defines $includes $cflags $cflags_cc", + deps=deps, + ) + master_ninja.rule( + "idl", + description="IDL $in", + command=( + "%s gyp-win-tool midl-wrapper $arch $outdir " + "$tlb $h $dlldata $iid $proxy $in " + "$midl_includes $idlflags" % sys.executable + ), + ) + master_ninja.rule( + "rc", + description="RC $in", + # Note: $in must be last otherwise rc.exe complains. + command=( + "%s gyp-win-tool rc-wrapper " + "$arch $rc $defines $resource_includes $rcflags /fo$out $in" + % sys.executable + ), + ) + master_ninja.rule( + "asm", + description="ASM $out", + command=( + "%s gyp-win-tool asm-wrapper " + "$arch $asm $defines $includes $asmflags /c /Fo $out $in" + % sys.executable + ), + ) + + if flavor != "mac" and flavor != "win": + master_ninja.rule( + "alink", + description="AR $out", + command="rm -f $out && $ar rcs $arflags $out $in", + ) + master_ninja.rule( + "alink_thin", + description="AR $out", + command="rm -f $out && $ar rcsT $arflags $out $in", + ) + + # This allows targets that only need to depend on $lib's API to declare an + # order-only dependency on $lib.TOC and avoid relinking such downstream + # dependencies when $lib changes only in non-public ways. + # The resulting string leaves an uninterpolated %{suffix} which + # is used in the final substitution below. + mtime_preserving_solink_base = ( + "if [ ! -e $lib -o ! -e $lib.TOC ]; then " + "%(solink)s && %(extract_toc)s > $lib.TOC; else " + "%(solink)s && %(extract_toc)s > $lib.tmp && " + "if ! cmp -s $lib.tmp $lib.TOC; then mv $lib.tmp $lib.TOC ; " + "fi; fi" + % { + "solink": "$ld -shared $ldflags -o $lib -Wl,-soname=$soname %(suffix)s", + "extract_toc": ( + "{ $readelf -d $lib | grep SONAME ; " + "$nm -gD -f p $lib | cut -f1-2 -d' '; }" + ), + } + ) + + master_ninja.rule( + "solink", + description="SOLINK $lib", + restat=True, + command=mtime_preserving_solink_base % {"suffix": "@$link_file_list"}, + rspfile="$link_file_list", + rspfile_content="-Wl,--whole-archive $in $solibs -Wl,--no-whole-archive $libs", + pool="link_pool", + ) + master_ninja.rule( + "solink_module", + description="SOLINK(module) $lib", + restat=True, + command=mtime_preserving_solink_base % {"suffix": "@$link_file_list"}, + rspfile="$link_file_list", + rspfile_content="-Wl,--start-group $in $solibs $libs -Wl,--end-group", + pool="link_pool", + ) + master_ninja.rule( + "link", + description="LINK $out", + command=( + "$ld $ldflags -o $out " + "-Wl,--start-group $in $solibs $libs -Wl,--end-group" + ), + pool="link_pool", + ) + elif flavor == "win": + master_ninja.rule( + "alink", + description="LIB $out", + command=( + "%s gyp-win-tool link-wrapper $arch False " + "$ar /nologo /ignore:4221 /OUT:$out @$out.rsp" % sys.executable + ), + rspfile="$out.rsp", + rspfile_content="$in_newline $libflags", + ) + _AddWinLinkRules(master_ninja, embed_manifest=True) + _AddWinLinkRules(master_ninja, embed_manifest=False) + else: + master_ninja.rule( + "objc", + description="OBJC $out", + command=( + "$cc -MMD -MF $out.d $defines $includes $cflags $cflags_objc " + "$cflags_pch_objc -c $in -o $out" + ), + depfile="$out.d", + deps=deps, + ) + master_ninja.rule( + "objcxx", + description="OBJCXX $out", + command=( + "$cxx -MMD -MF $out.d $defines $includes $cflags $cflags_objcc " + "$cflags_pch_objcc -c $in -o $out" + ), + depfile="$out.d", + deps=deps, + ) + master_ninja.rule( + "alink", + description="LIBTOOL-STATIC $out, POSTBUILDS", + command="rm -f $out && " + "./gyp-mac-tool filter-libtool libtool $libtool_flags " + "-static -o $out $in" + "$postbuilds", + ) + master_ninja.rule( + "lipo", + description="LIPO $out, POSTBUILDS", + command="rm -f $out && lipo -create $in -output $out$postbuilds", + ) + master_ninja.rule( + "solipo", + description="SOLIPO $out, POSTBUILDS", + command=( + "rm -f $lib $lib.TOC && lipo -create $in -output $lib$postbuilds &&" + "%(extract_toc)s > $lib.TOC" + % { + "extract_toc": "{ otool -l $lib | grep LC_ID_DYLIB -A 5; " + "nm -gP $lib | cut -f1-2 -d' ' | grep -v U$$; true; }" + } + ), + ) + + # Record the public interface of $lib in $lib.TOC. See the corresponding + # comment in the posix section above for details. + solink_base = "$ld %(type)s $ldflags -o $lib %(suffix)s" + mtime_preserving_solink_base = ( + "if [ ! -e $lib -o ! -e $lib.TOC ] || " + # Always force dependent targets to relink if this library + # reexports something. Handling this correctly would require + # recursive TOC dumping but this is rare in practice, so punt. + "otool -l $lib | grep -q LC_REEXPORT_DYLIB ; then " + "%(solink)s && %(extract_toc)s > $lib.TOC; " + "else " + "%(solink)s && %(extract_toc)s > $lib.tmp && " + "if ! cmp -s $lib.tmp $lib.TOC; then " + "mv $lib.tmp $lib.TOC ; " + "fi; " + "fi" + % { + "solink": solink_base, + "extract_toc": "{ otool -l $lib | grep LC_ID_DYLIB -A 5; " + "nm -gP $lib | cut -f1-2 -d' ' | grep -v U$$; true; }", + } + ) + + solink_suffix = "@$link_file_list$postbuilds" + master_ninja.rule( + "solink", + description="SOLINK $lib, POSTBUILDS", + restat=True, + command=mtime_preserving_solink_base + % {"suffix": solink_suffix, "type": "-shared"}, + rspfile="$link_file_list", + rspfile_content="$in $solibs $libs", + pool="link_pool", + ) + master_ninja.rule( + "solink_notoc", + description="SOLINK $lib, POSTBUILDS", + restat=True, + command=solink_base % {"suffix": solink_suffix, "type": "-shared"}, + rspfile="$link_file_list", + rspfile_content="$in $solibs $libs", + pool="link_pool", + ) + + master_ninja.rule( + "solink_module", + description="SOLINK(module) $lib, POSTBUILDS", + restat=True, + command=mtime_preserving_solink_base + % {"suffix": solink_suffix, "type": "-bundle"}, + rspfile="$link_file_list", + rspfile_content="$in $solibs $libs", + pool="link_pool", + ) + master_ninja.rule( + "solink_module_notoc", + description="SOLINK(module) $lib, POSTBUILDS", + restat=True, + command=solink_base % {"suffix": solink_suffix, "type": "-bundle"}, + rspfile="$link_file_list", + rspfile_content="$in $solibs $libs", + pool="link_pool", + ) + + master_ninja.rule( + "link", + description="LINK $out, POSTBUILDS", + command=("$ld $ldflags -o $out " "$in $solibs $libs$postbuilds"), + pool="link_pool", + ) + master_ninja.rule( + "preprocess_infoplist", + description="PREPROCESS INFOPLIST $out", + command=( + "$cc -E -P -Wno-trigraphs -x c $defines $in -o $out && " + "plutil -convert xml1 $out $out" + ), + ) + master_ninja.rule( + "copy_infoplist", + description="COPY INFOPLIST $in", + command="$env ./gyp-mac-tool copy-info-plist $in $out $binary $keys", + ) + master_ninja.rule( + "merge_infoplist", + description="MERGE INFOPLISTS $in", + command="$env ./gyp-mac-tool merge-info-plist $out $in", + ) + master_ninja.rule( + "compile_xcassets", + description="COMPILE XCASSETS $in", + command="$env ./gyp-mac-tool compile-xcassets $keys $in", + ) + master_ninja.rule( + "compile_ios_framework_headers", + description="COMPILE HEADER MAPS AND COPY FRAMEWORK HEADERS $in", + command="$env ./gyp-mac-tool compile-ios-framework-header-map $out " + "$framework $in && $env ./gyp-mac-tool " + "copy-ios-framework-headers $framework $copy_headers", + ) + master_ninja.rule( + "mac_tool", + description="MACTOOL $mactool_cmd $in", + command="$env ./gyp-mac-tool $mactool_cmd $in $out $binary", + ) + master_ninja.rule( + "package_framework", + description="PACKAGE FRAMEWORK $out, POSTBUILDS", + command="./gyp-mac-tool package-framework $out $version$postbuilds " + "&& touch $out", + ) + master_ninja.rule( + "package_ios_framework", + description="PACKAGE IOS FRAMEWORK $out, POSTBUILDS", + command="./gyp-mac-tool package-ios-framework $out $postbuilds " + "&& touch $out", + ) + if flavor == "win": + master_ninja.rule( + "stamp", + description="STAMP $out", + command="%s gyp-win-tool stamp $out" % sys.executable, + ) + else: + master_ninja.rule( + "stamp", description="STAMP $out", command="${postbuilds}touch $out" + ) + if flavor == "win": + master_ninja.rule( + "copy", + description="COPY $in $out", + command="%s gyp-win-tool recursive-mirror $in $out" % sys.executable, + ) + elif flavor == "zos": + master_ninja.rule( + "copy", + description="COPY $in $out", + command="rm -rf $out && cp -fRP $in $out", + ) + else: + master_ninja.rule( + "copy", + description="COPY $in $out", + command="ln -f $in $out 2>/dev/null || (rm -rf $out && cp -af $in $out)", + ) master_ninja.newline() - master_ninja.build('all', 'phony', list(all_outputs)) - master_ninja.default(generator_flags.get('default_target', 'all')) - master_ninja_file.close() + all_targets = set() + for build_file in params["build_files"]: + for target in gyp.common.AllTargets( + target_list, target_dicts, os.path.normpath(build_file) + ): + all_targets.add(target) + all_outputs = set() + + # target_outputs is a map from qualified target name to a Target object. + target_outputs = {} + # target_short_names is a map from target short name to a list of Target + # objects. + target_short_names = {} + + # short name of targets that were skipped because they didn't contain anything + # interesting. + # NOTE: there may be overlap between this an non_empty_target_names. + empty_target_names = set() + + # Set of non-empty short target names. + # NOTE: there may be overlap between this an empty_target_names. + non_empty_target_names = set() + + for qualified_target in target_list: + # qualified_target is like: third_party/icu/icu.gyp:icui18n#target + build_file, name, toolset = gyp.common.ParseQualifiedTarget(qualified_target) + + this_make_global_settings = data[build_file].get("make_global_settings", []) + assert make_global_settings == this_make_global_settings, ( + "make_global_settings needs to be the same for all targets. %s vs. %s" + % (this_make_global_settings, make_global_settings) + ) + + spec = target_dicts[qualified_target] + if flavor == "mac": + gyp.xcode_emulation.MergeGlobalXcodeSettingsToSpec(data[build_file], spec) + + # If build_file is a symlink, we must not follow it because there's a chance + # it could point to a path above toplevel_dir, and we cannot correctly deal + # with that case at the moment. + build_file = gyp.common.RelativePath(build_file, options.toplevel_dir, False) + + qualified_target_for_hash = gyp.common.QualifiedTarget( + build_file, name, toolset + ) + qualified_target_for_hash = qualified_target_for_hash.encode("utf-8") + hash_for_rules = hashlib.md5(qualified_target_for_hash).hexdigest() + + base_path = os.path.dirname(build_file) + obj = "obj" + if toolset != "target": + obj += "." + toolset + output_file = os.path.join(obj, base_path, name + ".ninja") + + ninja_output = StringIO() + writer = NinjaWriter( + hash_for_rules, + target_outputs, + base_path, + build_dir, + ninja_output, + toplevel_build, + output_file, + flavor, + toplevel_dir=options.toplevel_dir, + ) + + target = writer.WriteSpec(spec, config_name, generator_flags) + + if ninja_output.tell() > 0: + # Only create files for ninja files that actually have contents. + with OpenOutput(os.path.join(toplevel_build, output_file)) as ninja_file: + ninja_file.write(ninja_output.getvalue()) + ninja_output.close() + master_ninja.subninja(output_file) + + if target: + if name != target.FinalOutput() and spec["toolset"] == "target": + target_short_names.setdefault(name, []).append(target) + target_outputs[qualified_target] = target + if qualified_target in all_targets: + all_outputs.add(target.FinalOutput()) + non_empty_target_names.add(name) + else: + empty_target_names.add(name) + + if target_short_names: + # Write a short name to build this target. This benefits both the + # "build chrome" case as well as the gyp tests, which expect to be + # able to run actions and build libraries by their short name. + master_ninja.newline() + master_ninja.comment("Short names for targets.") + for short_name in sorted(target_short_names): + master_ninja.build( + short_name, + "phony", + [x.FinalOutput() for x in target_short_names[short_name]], + ) + + # Write phony targets for any empty targets that weren't written yet. As + # short names are not necessarily unique only do this for short names that + # haven't already been output for another target. + empty_target_names = empty_target_names - non_empty_target_names + if empty_target_names: + master_ninja.newline() + master_ninja.comment("Empty targets (output for completeness).") + for name in sorted(empty_target_names): + master_ninja.build(name, "phony") + + if all_outputs: + master_ninja.newline() + master_ninja.build("all", "phony", sorted(all_outputs)) + master_ninja.default(generator_flags.get("default_target", "all")) + + master_ninja_file.close() def PerformBuild(data, configurations, params): - options = params['options'] - for config in configurations: - builddir = os.path.join(options.toplevel_dir, 'out', config) - arguments = ['ninja', '-C', builddir] - print('Building [%s]: %s' % (config, arguments)) - subprocess.check_call(arguments) + options = params["options"] + for config in configurations: + builddir = os.path.join(options.toplevel_dir, "out", config) + arguments = ["ninja", "-C", builddir] + print("Building [%s]: %s" % (config, arguments)) + subprocess.check_call(arguments) def CallGenerateOutputForConfig(arglist): - # Ignore the interrupt signal so that the parent process catches it and - # kills all multiprocessing children. - signal.signal(signal.SIGINT, signal.SIG_IGN) + # Ignore the interrupt signal so that the parent process catches it and + # kills all multiprocessing children. + signal.signal(signal.SIGINT, signal.SIG_IGN) - (target_list, target_dicts, data, params, config_name) = arglist - GenerateOutputForConfig(target_list, target_dicts, data, params, config_name) + (target_list, target_dicts, data, params, config_name) = arglist + GenerateOutputForConfig(target_list, target_dicts, data, params, config_name) def GenerateOutput(target_list, target_dicts, data, params): - # Update target_dicts for iOS device builds. - target_dicts = gyp.xcode_emulation.CloneConfigurationForDeviceAndEmulator( - target_dicts) - - user_config = params.get('generator_flags', {}).get('config', None) - if gyp.common.GetFlavor(params) == 'win': - target_list, target_dicts = MSVSUtil.ShardTargets(target_list, target_dicts) - target_list, target_dicts = MSVSUtil.InsertLargePdbShims( - target_list, target_dicts, generator_default_variables) - - if user_config: - GenerateOutputForConfig(target_list, target_dicts, data, params, - user_config) - else: - config_names = target_dicts[target_list[0]]['configurations'].keys() - if params['parallel']: - try: - pool = multiprocessing.Pool(len(config_names)) - arglists = [] - for config_name in config_names: - arglists.append( - (target_list, target_dicts, data, params, config_name)) - pool.map(CallGenerateOutputForConfig, arglists) - except KeyboardInterrupt as e: - pool.terminate() - raise e + # Update target_dicts for iOS device builds. + target_dicts = gyp.xcode_emulation.CloneConfigurationForDeviceAndEmulator( + target_dicts + ) + + user_config = params.get("generator_flags", {}).get("config", None) + if gyp.common.GetFlavor(params) == "win": + target_list, target_dicts = MSVSUtil.ShardTargets(target_list, target_dicts) + target_list, target_dicts = MSVSUtil.InsertLargePdbShims( + target_list, target_dicts, generator_default_variables + ) + + if user_config: + GenerateOutputForConfig(target_list, target_dicts, data, params, user_config) else: - for config_name in config_names: - GenerateOutputForConfig(target_list, target_dicts, data, params, - config_name) + config_names = target_dicts[target_list[0]]["configurations"] + if params["parallel"]: + try: + pool = multiprocessing.Pool(len(config_names)) + arglists = [] + for config_name in config_names: + arglists.append( + (target_list, target_dicts, data, params, config_name) + ) + pool.map(CallGenerateOutputForConfig, arglists) + except KeyboardInterrupt as e: + pool.terminate() + raise e + else: + for config_name in config_names: + GenerateOutputForConfig( + target_list, target_dicts, data, params, config_name + ) diff --git a/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/ninja_test.py b/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/ninja_test.py index 5ecfbdf004d211..abadcd9828e8b2 100644 --- a/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/ninja_test.py +++ b/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/ninja_test.py @@ -6,40 +6,50 @@ """ Unit tests for the ninja.py file. """ -import gyp.generator.ninja as ninja -import unittest import sys +import unittest + +import gyp.generator.ninja as ninja class TestPrefixesAndSuffixes(unittest.TestCase): - def test_BinaryNamesWindows(self): - # These cannot run on non-Windows as they require a VS installation to - # correctly handle variable expansion. - if sys.platform.startswith('win'): - writer = ninja.NinjaWriter('foo', 'wee', '.', '.', 'build.ninja', '.', - 'build.ninja', 'win') - spec = { 'target_name': 'wee' } - self.assertTrue(writer.ComputeOutputFileName(spec, 'executable'). - endswith('.exe')) - self.assertTrue(writer.ComputeOutputFileName(spec, 'shared_library'). - endswith('.dll')) - self.assertTrue(writer.ComputeOutputFileName(spec, 'static_library'). - endswith('.lib')) - - def test_BinaryNamesLinux(self): - writer = ninja.NinjaWriter('foo', 'wee', '.', '.', 'build.ninja', '.', - 'build.ninja', 'linux') - spec = { 'target_name': 'wee' } - self.assertTrue('.' not in writer.ComputeOutputFileName(spec, - 'executable')) - self.assertTrue(writer.ComputeOutputFileName(spec, 'shared_library'). - startswith('lib')) - self.assertTrue(writer.ComputeOutputFileName(spec, 'static_library'). - startswith('lib')) - self.assertTrue(writer.ComputeOutputFileName(spec, 'shared_library'). - endswith('.so')) - self.assertTrue(writer.ComputeOutputFileName(spec, 'static_library'). - endswith('.a')) - -if __name__ == '__main__': - unittest.main() + def test_BinaryNamesWindows(self): + # These cannot run on non-Windows as they require a VS installation to + # correctly handle variable expansion. + if sys.platform.startswith("win"): + writer = ninja.NinjaWriter( + "foo", "wee", ".", ".", "build.ninja", ".", "build.ninja", "win" + ) + spec = {"target_name": "wee"} + self.assertTrue( + writer.ComputeOutputFileName(spec, "executable").endswith(".exe") + ) + self.assertTrue( + writer.ComputeOutputFileName(spec, "shared_library").endswith(".dll") + ) + self.assertTrue( + writer.ComputeOutputFileName(spec, "static_library").endswith(".lib") + ) + + def test_BinaryNamesLinux(self): + writer = ninja.NinjaWriter( + "foo", "wee", ".", ".", "build.ninja", ".", "build.ninja", "linux" + ) + spec = {"target_name": "wee"} + self.assertTrue("." not in writer.ComputeOutputFileName(spec, "executable")) + self.assertTrue( + writer.ComputeOutputFileName(spec, "shared_library").startswith("lib") + ) + self.assertTrue( + writer.ComputeOutputFileName(spec, "static_library").startswith("lib") + ) + self.assertTrue( + writer.ComputeOutputFileName(spec, "shared_library").endswith(".so") + ) + self.assertTrue( + writer.ComputeOutputFileName(spec, "static_library").endswith(".a") + ) + + +if __name__ == "__main__": + unittest.main() diff --git a/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/xcode.py b/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/xcode.py index 6317d04c703026..535c5400ce5701 100644 --- a/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/xcode.py +++ b/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/xcode.py @@ -1,8 +1,9 @@ -from __future__ import print_function # Copyright (c) 2012 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. +from __future__ import print_function + import filecmp import gyp.common import gyp.xcodeproj_file @@ -26,510 +27,543 @@ # PROJECT_DERIVED_FILE_DIR, is unsuitable because while it is project-specific, # it is not configuration-specific. INTERMEDIATE_DIR is defined as # $(PROJECT_DERIVED_FILE_DIR)/$(CONFIGURATION). -_intermediate_var = 'INTERMEDIATE_DIR' +_intermediate_var = "INTERMEDIATE_DIR" # SHARED_INTERMEDIATE_DIR is the same, except that it is shared among all # targets that share the same BUILT_PRODUCTS_DIR. -_shared_intermediate_var = 'SHARED_INTERMEDIATE_DIR' +_shared_intermediate_var = "SHARED_INTERMEDIATE_DIR" -_library_search_paths_var = 'LIBRARY_SEARCH_PATHS' +_library_search_paths_var = "LIBRARY_SEARCH_PATHS" generator_default_variables = { - 'EXECUTABLE_PREFIX': '', - 'EXECUTABLE_SUFFIX': '', - 'STATIC_LIB_PREFIX': 'lib', - 'SHARED_LIB_PREFIX': 'lib', - 'STATIC_LIB_SUFFIX': '.a', - 'SHARED_LIB_SUFFIX': '.dylib', - # INTERMEDIATE_DIR is a place for targets to build up intermediate products. - # It is specific to each build environment. It is only guaranteed to exist - # and be constant within the context of a project, corresponding to a single - # input file. Some build environments may allow their intermediate directory - # to be shared on a wider scale, but this is not guaranteed. - 'INTERMEDIATE_DIR': '$(%s)' % _intermediate_var, - 'OS': 'mac', - 'PRODUCT_DIR': '$(BUILT_PRODUCTS_DIR)', - 'LIB_DIR': '$(BUILT_PRODUCTS_DIR)', - 'RULE_INPUT_ROOT': '$(INPUT_FILE_BASE)', - 'RULE_INPUT_EXT': '$(INPUT_FILE_SUFFIX)', - 'RULE_INPUT_NAME': '$(INPUT_FILE_NAME)', - 'RULE_INPUT_PATH': '$(INPUT_FILE_PATH)', - 'RULE_INPUT_DIRNAME': '$(INPUT_FILE_DIRNAME)', - 'SHARED_INTERMEDIATE_DIR': '$(%s)' % _shared_intermediate_var, - 'CONFIGURATION_NAME': '$(CONFIGURATION)', + "EXECUTABLE_PREFIX": "", + "EXECUTABLE_SUFFIX": "", + "STATIC_LIB_PREFIX": "lib", + "SHARED_LIB_PREFIX": "lib", + "STATIC_LIB_SUFFIX": ".a", + "SHARED_LIB_SUFFIX": ".dylib", + # INTERMEDIATE_DIR is a place for targets to build up intermediate products. + # It is specific to each build environment. It is only guaranteed to exist + # and be constant within the context of a project, corresponding to a single + # input file. Some build environments may allow their intermediate directory + # to be shared on a wider scale, but this is not guaranteed. + "INTERMEDIATE_DIR": "$(%s)" % _intermediate_var, + "OS": "mac", + "PRODUCT_DIR": "$(BUILT_PRODUCTS_DIR)", + "LIB_DIR": "$(BUILT_PRODUCTS_DIR)", + "RULE_INPUT_ROOT": "$(INPUT_FILE_BASE)", + "RULE_INPUT_EXT": "$(INPUT_FILE_SUFFIX)", + "RULE_INPUT_NAME": "$(INPUT_FILE_NAME)", + "RULE_INPUT_PATH": "$(INPUT_FILE_PATH)", + "RULE_INPUT_DIRNAME": "$(INPUT_FILE_DIRNAME)", + "SHARED_INTERMEDIATE_DIR": "$(%s)" % _shared_intermediate_var, + "CONFIGURATION_NAME": "$(CONFIGURATION)", } # The Xcode-specific sections that hold paths. generator_additional_path_sections = [ - 'mac_bundle_resources', - 'mac_framework_headers', - 'mac_framework_private_headers', - # 'mac_framework_dirs', input already handles _dirs endings. + "mac_bundle_resources", + "mac_framework_headers", + "mac_framework_private_headers", + # 'mac_framework_dirs', input already handles _dirs endings. ] # The Xcode-specific keys that exist on targets and aren't moved down to # configurations. generator_additional_non_configuration_keys = [ - 'ios_app_extension', - 'ios_watch_app', - 'ios_watchkit_extension', - 'mac_bundle', - 'mac_bundle_resources', - 'mac_framework_headers', - 'mac_framework_private_headers', - 'mac_xctest_bundle', - 'xcode_create_dependents_test_runner', + "ios_app_extension", + "ios_watch_app", + "ios_watchkit_extension", + "mac_bundle", + "mac_bundle_resources", + "mac_framework_headers", + "mac_framework_private_headers", + "mac_xctest_bundle", + "mac_xcuitest_bundle", + "xcode_create_dependents_test_runner", ] # We want to let any rules apply to files that are resources also. generator_extra_sources_for_rules = [ - 'mac_bundle_resources', - 'mac_framework_headers', - 'mac_framework_private_headers', + "mac_bundle_resources", + "mac_framework_headers", + "mac_framework_private_headers", ] generator_filelist_paths = None # Xcode's standard set of library directories, which don't need to be duplicated # in LIBRARY_SEARCH_PATHS. This list is not exhaustive, but that's okay. -xcode_standard_library_dirs = frozenset([ - '$(SDKROOT)/usr/lib', - '$(SDKROOT)/usr/local/lib', -]) +xcode_standard_library_dirs = frozenset( + ["$(SDKROOT)/usr/lib", "$(SDKROOT)/usr/local/lib"] +) + def CreateXCConfigurationList(configuration_names): - xccl = gyp.xcodeproj_file.XCConfigurationList({'buildConfigurations': []}) - if len(configuration_names) == 0: - configuration_names = ['Default'] - for configuration_name in configuration_names: - xcbc = gyp.xcodeproj_file.XCBuildConfiguration({ - 'name': configuration_name}) - xccl.AppendProperty('buildConfigurations', xcbc) - xccl.SetProperty('defaultConfigurationName', configuration_names[0]) - return xccl + xccl = gyp.xcodeproj_file.XCConfigurationList({"buildConfigurations": []}) + if len(configuration_names) == 0: + configuration_names = ["Default"] + for configuration_name in configuration_names: + xcbc = gyp.xcodeproj_file.XCBuildConfiguration({"name": configuration_name}) + xccl.AppendProperty("buildConfigurations", xcbc) + xccl.SetProperty("defaultConfigurationName", configuration_names[0]) + return xccl class XcodeProject(object): - def __init__(self, gyp_path, path, build_file_dict): - self.gyp_path = gyp_path - self.path = path - self.project = gyp.xcodeproj_file.PBXProject(path=path) - projectDirPath = gyp.common.RelativePath( - os.path.dirname(os.path.abspath(self.gyp_path)), - os.path.dirname(path) or '.') - self.project.SetProperty('projectDirPath', projectDirPath) - self.project_file = \ - gyp.xcodeproj_file.XCProjectFile({'rootObject': self.project}) - self.build_file_dict = build_file_dict - - # TODO(mark): add destructor that cleans up self.path if created_dir is - # True and things didn't complete successfully. Or do something even - # better with "try"? - self.created_dir = False - try: - os.makedirs(self.path) - self.created_dir = True - except OSError as e: - if e.errno != errno.EEXIST: - raise - - def Finalize1(self, xcode_targets, serialize_all_tests): - # Collect a list of all of the build configuration names used by the - # various targets in the file. It is very heavily advised to keep each - # target in an entire project (even across multiple project files) using - # the same set of configuration names. - configurations = [] - for xct in self.project.GetProperty('targets'): - xccl = xct.GetProperty('buildConfigurationList') - xcbcs = xccl.GetProperty('buildConfigurations') - for xcbc in xcbcs: - name = xcbc.GetProperty('name') - if name not in configurations: - configurations.append(name) - - # Replace the XCConfigurationList attached to the PBXProject object with - # a new one specifying all of the configuration names used by the various - # targets. - try: - xccl = CreateXCConfigurationList(configurations) - self.project.SetProperty('buildConfigurationList', xccl) - except: - sys.stderr.write("Problem with gyp file %s\n" % self.gyp_path) - raise - - # The need for this setting is explained above where _intermediate_var is - # defined. The comments below about wanting to avoid project-wide build - # settings apply here too, but this needs to be set on a project-wide basis - # so that files relative to the _intermediate_var setting can be displayed - # properly in the Xcode UI. - # - # Note that for configuration-relative files such as anything relative to - # _intermediate_var, for the purposes of UI tree view display, Xcode will - # only resolve the configuration name once, when the project file is - # opened. If the active build configuration is changed, the project file - # must be closed and reopened if it is desired for the tree view to update. - # This is filed as Apple radar 6588391. - xccl.SetBuildSetting(_intermediate_var, - '$(PROJECT_DERIVED_FILE_DIR)/$(CONFIGURATION)') - xccl.SetBuildSetting(_shared_intermediate_var, - '$(SYMROOT)/DerivedSources/$(CONFIGURATION)') - - # Set user-specified project-wide build settings and config files. This - # is intended to be used very sparingly. Really, almost everything should - # go into target-specific build settings sections. The project-wide - # settings are only intended to be used in cases where Xcode attempts to - # resolve variable references in a project context as opposed to a target - # context, such as when resolving sourceTree references while building up - # the tree tree view for UI display. - # Any values set globally are applied to all configurations, then any - # per-configuration values are applied. - for xck, xcv in self.build_file_dict.get('xcode_settings', {}).items(): - xccl.SetBuildSetting(xck, xcv) - if 'xcode_config_file' in self.build_file_dict: - config_ref = self.project.AddOrGetFileInRootGroup( - self.build_file_dict['xcode_config_file']) - xccl.SetBaseConfiguration(config_ref) - build_file_configurations = self.build_file_dict.get('configurations', {}) - if build_file_configurations: - for config_name in configurations: - build_file_configuration_named = \ - build_file_configurations.get(config_name, {}) - if build_file_configuration_named: - xcc = xccl.ConfigurationNamed(config_name) - for xck, xcv in build_file_configuration_named.get('xcode_settings', - {}).items(): - xcc.SetBuildSetting(xck, xcv) - if 'xcode_config_file' in build_file_configuration_named: + def __init__(self, gyp_path, path, build_file_dict): + self.gyp_path = gyp_path + self.path = path + self.project = gyp.xcodeproj_file.PBXProject(path=path) + projectDirPath = gyp.common.RelativePath( + os.path.dirname(os.path.abspath(self.gyp_path)), + os.path.dirname(path) or ".", + ) + self.project.SetProperty("projectDirPath", projectDirPath) + self.project_file = gyp.xcodeproj_file.XCProjectFile( + {"rootObject": self.project} + ) + self.build_file_dict = build_file_dict + + # TODO(mark): add destructor that cleans up self.path if created_dir is + # True and things didn't complete successfully. Or do something even + # better with "try"? + self.created_dir = False + try: + os.makedirs(self.path) + self.created_dir = True + except OSError as e: + if e.errno != errno.EEXIST: + raise + + def Finalize1(self, xcode_targets, serialize_all_tests): + # Collect a list of all of the build configuration names used by the + # various targets in the file. It is very heavily advised to keep each + # target in an entire project (even across multiple project files) using + # the same set of configuration names. + configurations = [] + for xct in self.project.GetProperty("targets"): + xccl = xct.GetProperty("buildConfigurationList") + xcbcs = xccl.GetProperty("buildConfigurations") + for xcbc in xcbcs: + name = xcbc.GetProperty("name") + if name not in configurations: + configurations.append(name) + + # Replace the XCConfigurationList attached to the PBXProject object with + # a new one specifying all of the configuration names used by the various + # targets. + try: + xccl = CreateXCConfigurationList(configurations) + self.project.SetProperty("buildConfigurationList", xccl) + except Exception: + sys.stderr.write("Problem with gyp file %s\n" % self.gyp_path) + raise + + # The need for this setting is explained above where _intermediate_var is + # defined. The comments below about wanting to avoid project-wide build + # settings apply here too, but this needs to be set on a project-wide basis + # so that files relative to the _intermediate_var setting can be displayed + # properly in the Xcode UI. + # + # Note that for configuration-relative files such as anything relative to + # _intermediate_var, for the purposes of UI tree view display, Xcode will + # only resolve the configuration name once, when the project file is + # opened. If the active build configuration is changed, the project file + # must be closed and reopened if it is desired for the tree view to update. + # This is filed as Apple radar 6588391. + xccl.SetBuildSetting( + _intermediate_var, "$(PROJECT_DERIVED_FILE_DIR)/$(CONFIGURATION)" + ) + xccl.SetBuildSetting( + _shared_intermediate_var, "$(SYMROOT)/DerivedSources/$(CONFIGURATION)" + ) + + # Set user-specified project-wide build settings and config files. This + # is intended to be used very sparingly. Really, almost everything should + # go into target-specific build settings sections. The project-wide + # settings are only intended to be used in cases where Xcode attempts to + # resolve variable references in a project context as opposed to a target + # context, such as when resolving sourceTree references while building up + # the tree tree view for UI display. + # Any values set globally are applied to all configurations, then any + # per-configuration values are applied. + for xck, xcv in self.build_file_dict.get("xcode_settings", {}).items(): + xccl.SetBuildSetting(xck, xcv) + if "xcode_config_file" in self.build_file_dict: config_ref = self.project.AddOrGetFileInRootGroup( - build_file_configurations[config_name]['xcode_config_file']) - xcc.SetBaseConfiguration(config_ref) - - # Sort the targets based on how they appeared in the input. - # TODO(mark): Like a lot of other things here, this assumes internal - # knowledge of PBXProject - in this case, of its "targets" property. - - # ordinary_targets are ordinary targets that are already in the project - # file. run_test_targets are the targets that run unittests and should be - # used for the Run All Tests target. support_targets are the action/rule - # targets used by GYP file targets, just kept for the assert check. - ordinary_targets = [] - run_test_targets = [] - support_targets = [] - - # targets is full list of targets in the project. - targets = [] - - # does the it define it's own "all"? - has_custom_all = False - - # targets_for_all is the list of ordinary_targets that should be listed - # in this project's "All" target. It includes each non_runtest_target - # that does not have suppress_wildcard set. - targets_for_all = [] - - for target in self.build_file_dict['targets']: - target_name = target['target_name'] - toolset = target['toolset'] - qualified_target = gyp.common.QualifiedTarget(self.gyp_path, target_name, - toolset) - xcode_target = xcode_targets[qualified_target] - # Make sure that the target being added to the sorted list is already in - # the unsorted list. - assert xcode_target in self.project._properties['targets'] - targets.append(xcode_target) - ordinary_targets.append(xcode_target) - if xcode_target.support_target: - support_targets.append(xcode_target.support_target) - targets.append(xcode_target.support_target) - - if not int(target.get('suppress_wildcard', False)): - targets_for_all.append(xcode_target) - - if target_name.lower() == 'all': - has_custom_all = True - - # If this target has a 'run_as' attribute, add its target to the - # targets, and add it to the test targets. - if target.get('run_as'): - # Make a target to run something. It should have one - # dependency, the parent xcode target. - xccl = CreateXCConfigurationList(configurations) - run_target = gyp.xcodeproj_file.PBXAggregateTarget({ - 'name': 'Run ' + target_name, - 'productName': xcode_target.GetProperty('productName'), - 'buildConfigurationList': xccl, - }, - parent=self.project) - run_target.AddDependency(xcode_target) - - command = target['run_as'] - script = '' - if command.get('working_directory'): - script = script + 'cd "%s"\n' % \ - gyp.xcodeproj_file.ConvertVariablesToShellSyntax( - command.get('working_directory')) - - if command.get('environment'): - script = script + "\n".join( - ['export %s="%s"' % - (key, gyp.xcodeproj_file.ConvertVariablesToShellSyntax(val)) - for (key, val) in command.get('environment').items()]) + "\n" - - # Some test end up using sockets, files on disk, etc. and can get - # confused if more then one test runs at a time. The generator - # flag 'xcode_serialize_all_test_runs' controls the forcing of all - # tests serially. It defaults to True. To get serial runs this - # little bit of python does the same as the linux flock utility to - # make sure only one runs at a time. - command_prefix = '' - if serialize_all_tests: - command_prefix = \ -"""python -c "import fcntl, subprocess, sys + self.build_file_dict["xcode_config_file"] + ) + xccl.SetBaseConfiguration(config_ref) + build_file_configurations = self.build_file_dict.get("configurations", {}) + if build_file_configurations: + for config_name in configurations: + build_file_configuration_named = build_file_configurations.get( + config_name, {} + ) + if build_file_configuration_named: + xcc = xccl.ConfigurationNamed(config_name) + for xck, xcv in build_file_configuration_named.get( + "xcode_settings", {} + ).items(): + xcc.SetBuildSetting(xck, xcv) + if "xcode_config_file" in build_file_configuration_named: + config_ref = self.project.AddOrGetFileInRootGroup( + build_file_configurations[config_name]["xcode_config_file"] + ) + xcc.SetBaseConfiguration(config_ref) + + # Sort the targets based on how they appeared in the input. + # TODO(mark): Like a lot of other things here, this assumes internal + # knowledge of PBXProject - in this case, of its "targets" property. + + # ordinary_targets are ordinary targets that are already in the project + # file. run_test_targets are the targets that run unittests and should be + # used for the Run All Tests target. support_targets are the action/rule + # targets used by GYP file targets, just kept for the assert check. + ordinary_targets = [] + run_test_targets = [] + support_targets = [] + + # targets is full list of targets in the project. + targets = [] + + # does the it define it's own "all"? + has_custom_all = False + + # targets_for_all is the list of ordinary_targets that should be listed + # in this project's "All" target. It includes each non_runtest_target + # that does not have suppress_wildcard set. + targets_for_all = [] + + for target in self.build_file_dict["targets"]: + target_name = target["target_name"] + toolset = target["toolset"] + qualified_target = gyp.common.QualifiedTarget( + self.gyp_path, target_name, toolset + ) + xcode_target = xcode_targets[qualified_target] + # Make sure that the target being added to the sorted list is already in + # the unsorted list. + assert xcode_target in self.project._properties["targets"] + targets.append(xcode_target) + ordinary_targets.append(xcode_target) + if xcode_target.support_target: + support_targets.append(xcode_target.support_target) + targets.append(xcode_target.support_target) + + if not int(target.get("suppress_wildcard", False)): + targets_for_all.append(xcode_target) + + if target_name.lower() == "all": + has_custom_all = True + + # If this target has a 'run_as' attribute, add its target to the + # targets, and add it to the test targets. + if target.get("run_as"): + # Make a target to run something. It should have one + # dependency, the parent xcode target. + xccl = CreateXCConfigurationList(configurations) + run_target = gyp.xcodeproj_file.PBXAggregateTarget( + { + "name": "Run " + target_name, + "productName": xcode_target.GetProperty("productName"), + "buildConfigurationList": xccl, + }, + parent=self.project, + ) + run_target.AddDependency(xcode_target) + + command = target["run_as"] + script = "" + if command.get("working_directory"): + script = ( + script + + 'cd "%s"\n' + % gyp.xcodeproj_file.ConvertVariablesToShellSyntax( + command.get("working_directory") + ) + ) + + if command.get("environment"): + script = ( + script + + "\n".join( + [ + 'export %s="%s"' + % ( + key, + gyp.xcodeproj_file.ConvertVariablesToShellSyntax( + val + ), + ) + for (key, val) in command.get("environment").items() + ] + ) + + "\n" + ) + + # Some test end up using sockets, files on disk, etc. and can get + # confused if more then one test runs at a time. The generator + # flag 'xcode_serialize_all_test_runs' controls the forcing of all + # tests serially. It defaults to True. To get serial runs this + # little bit of python does the same as the linux flock utility to + # make sure only one runs at a time. + command_prefix = "" + if serialize_all_tests: + command_prefix = """python -c "import fcntl, subprocess, sys file = open('$TMPDIR/GYP_serialize_test_runs', 'a') fcntl.flock(file.fileno(), fcntl.LOCK_EX) sys.exit(subprocess.call(sys.argv[1:]))" """ - # If we were unable to exec for some reason, we want to exit - # with an error, and fixup variable references to be shell - # syntax instead of xcode syntax. - script = script + 'exec ' + command_prefix + '%s\nexit 1\n' % \ - gyp.xcodeproj_file.ConvertVariablesToShellSyntax( - gyp.common.EncodePOSIXShellList(command.get('action'))) - - ssbp = gyp.xcodeproj_file.PBXShellScriptBuildPhase({ - 'shellScript': script, - 'showEnvVarsInLog': 0, - }) - run_target.AppendProperty('buildPhases', ssbp) - - # Add the run target to the project file. - targets.append(run_target) - run_test_targets.append(run_target) - xcode_target.test_runner = run_target - - - # Make sure that the list of targets being replaced is the same length as - # the one replacing it, but allow for the added test runner targets. - assert len(self.project._properties['targets']) == \ - len(ordinary_targets) + len(support_targets) - - self.project._properties['targets'] = targets - - # Get rid of unnecessary levels of depth in groups like the Source group. - self.project.RootGroupsTakeOverOnlyChildren(True) - - # Sort the groups nicely. Do this after sorting the targets, because the - # Products group is sorted based on the order of the targets. - self.project.SortGroups() - - # Create an "All" target if there's more than one target in this project - # file and the project didn't define its own "All" target. Put a generated - # "All" target first so that people opening up the project for the first - # time will build everything by default. - if len(targets_for_all) > 1 and not has_custom_all: - xccl = CreateXCConfigurationList(configurations) - all_target = gyp.xcodeproj_file.PBXAggregateTarget( - { - 'buildConfigurationList': xccl, - 'name': 'All', - }, - parent=self.project) - - for target in targets_for_all: - all_target.AddDependency(target) - - # TODO(mark): This is evil because it relies on internal knowledge of - # PBXProject._properties. It's important to get the "All" target first, - # though. - self.project._properties['targets'].insert(0, all_target) - - # The same, but for run_test_targets. - if len(run_test_targets) > 1: - xccl = CreateXCConfigurationList(configurations) - run_all_tests_target = gyp.xcodeproj_file.PBXAggregateTarget( - { - 'buildConfigurationList': xccl, - 'name': 'Run All Tests', - }, - parent=self.project) - for run_test_target in run_test_targets: - run_all_tests_target.AddDependency(run_test_target) - - # Insert after the "All" target, which must exist if there is more than - # one run_test_target. - self.project._properties['targets'].insert(1, run_all_tests_target) - - def Finalize2(self, xcode_targets, xcode_target_to_target_dict): - # Finalize2 needs to happen in a separate step because the process of - # updating references to other projects depends on the ordering of targets - # within remote project files. Finalize1 is responsible for sorting duty, - # and once all project files are sorted, Finalize2 can come in and update - # these references. - - # To support making a "test runner" target that will run all the tests - # that are direct dependents of any given target, we look for - # xcode_create_dependents_test_runner being set on an Aggregate target, - # and generate a second target that will run the tests runners found under - # the marked target. - for bf_tgt in self.build_file_dict['targets']: - if int(bf_tgt.get('xcode_create_dependents_test_runner', 0)): - tgt_name = bf_tgt['target_name'] - toolset = bf_tgt['toolset'] - qualified_target = gyp.common.QualifiedTarget(self.gyp_path, - tgt_name, toolset) - xcode_target = xcode_targets[qualified_target] - if isinstance(xcode_target, gyp.xcodeproj_file.PBXAggregateTarget): - # Collect all the run test targets. - all_run_tests = [] - pbxtds = xcode_target.GetProperty('dependencies') - for pbxtd in pbxtds: - pbxcip = pbxtd.GetProperty('targetProxy') - dependency_xct = pbxcip.GetProperty('remoteGlobalIDString') - if hasattr(dependency_xct, 'test_runner'): - all_run_tests.append(dependency_xct.test_runner) - - # Directly depend on all the runners as they depend on the target - # that builds them. - if len(all_run_tests) > 0: - run_all_target = gyp.xcodeproj_file.PBXAggregateTarget({ - 'name': 'Run %s Tests' % tgt_name, - 'productName': tgt_name, - }, - parent=self.project) - for run_test_target in all_run_tests: - run_all_target.AddDependency(run_test_target) - - # Insert the test runner after the related target. - idx = self.project._properties['targets'].index(xcode_target) - self.project._properties['targets'].insert(idx + 1, run_all_target) - - # Update all references to other projects, to make sure that the lists of - # remote products are complete. Otherwise, Xcode will fill them in when - # it opens the project file, which will result in unnecessary diffs. - # TODO(mark): This is evil because it relies on internal knowledge of - # PBXProject._other_pbxprojects. - for other_pbxproject in self.project._other_pbxprojects.keys(): - self.project.AddOrGetProjectReference(other_pbxproject) - - self.project.SortRemoteProductReferences() - - # Give everything an ID. - self.project_file.ComputeIDs() - - # Make sure that no two objects in the project file have the same ID. If - # multiple objects wind up with the same ID, upon loading the file, Xcode - # will only recognize one object (the last one in the file?) and the - # results are unpredictable. - self.project_file.EnsureNoIDCollisions() - - def Write(self): - # Write the project file to a temporary location first. Xcode watches for - # changes to the project file and presents a UI sheet offering to reload - # the project when it does change. However, in some cases, especially when - # multiple projects are open or when Xcode is busy, things don't work so - # seamlessly. Sometimes, Xcode is able to detect that a project file has - # changed but can't unload it because something else is referencing it. - # To mitigate this problem, and to avoid even having Xcode present the UI - # sheet when an open project is rewritten for inconsequential changes, the - # project file is written to a temporary file in the xcodeproj directory - # first. The new temporary file is then compared to the existing project - # file, if any. If they differ, the new file replaces the old; otherwise, - # the new project file is simply deleted. Xcode properly detects a file - # being renamed over an open project file as a change and so it remains - # able to present the "project file changed" sheet under this system. - # Writing to a temporary file first also avoids the possible problem of - # Xcode rereading an incomplete project file. - (output_fd, new_pbxproj_path) = \ - tempfile.mkstemp(suffix='.tmp', prefix='project.pbxproj.gyp.', - dir=self.path) - - try: - output_file = os.fdopen(output_fd, 'wb') - - self.project_file.Print(output_file) - output_file.close() - - pbxproj_path = os.path.join(self.path, 'project.pbxproj') - - same = False - try: - same = filecmp.cmp(pbxproj_path, new_pbxproj_path, False) - except OSError as e: - if e.errno != errno.ENOENT: - raise - - if same: - # The new file is identical to the old one, just get rid of the new - # one. - os.unlink(new_pbxproj_path) - else: - # The new file is different from the old one, or there is no old one. - # Rename the new file to the permanent name. - # - # tempfile.mkstemp uses an overly restrictive mode, resulting in a - # file that can only be read by the owner, regardless of the umask. - # There's no reason to not respect the umask here, which means that - # an extra hoop is required to fetch it and reset the new file's mode. - # - # No way to get the umask without setting a new one? Set a safe one - # and then set it back to the old value. - umask = os.umask(0o77) - os.umask(umask) - - os.chmod(new_pbxproj_path, 0o666 & ~umask) - os.rename(new_pbxproj_path, pbxproj_path) - - except Exception: - # Don't leave turds behind. In fact, if this code was responsible for - # creating the xcodeproj directory, get rid of that too. - os.unlink(new_pbxproj_path) - if self.created_dir: - shutil.rmtree(self.path, True) - raise + # If we were unable to exec for some reason, we want to exit + # with an error, and fixup variable references to be shell + # syntax instead of xcode syntax. + script = ( + script + + "exec " + + command_prefix + + "%s\nexit 1\n" + % gyp.xcodeproj_file.ConvertVariablesToShellSyntax( + gyp.common.EncodePOSIXShellList(command.get("action")) + ) + ) + + ssbp = gyp.xcodeproj_file.PBXShellScriptBuildPhase( + {"shellScript": script, "showEnvVarsInLog": 0} + ) + run_target.AppendProperty("buildPhases", ssbp) + + # Add the run target to the project file. + targets.append(run_target) + run_test_targets.append(run_target) + xcode_target.test_runner = run_target + + # Make sure that the list of targets being replaced is the same length as + # the one replacing it, but allow for the added test runner targets. + assert len(self.project._properties["targets"]) == len(ordinary_targets) + len( + support_targets + ) + + self.project._properties["targets"] = targets + + # Get rid of unnecessary levels of depth in groups like the Source group. + self.project.RootGroupsTakeOverOnlyChildren(True) + + # Sort the groups nicely. Do this after sorting the targets, because the + # Products group is sorted based on the order of the targets. + self.project.SortGroups() + + # Create an "All" target if there's more than one target in this project + # file and the project didn't define its own "All" target. Put a generated + # "All" target first so that people opening up the project for the first + # time will build everything by default. + if len(targets_for_all) > 1 and not has_custom_all: + xccl = CreateXCConfigurationList(configurations) + all_target = gyp.xcodeproj_file.PBXAggregateTarget( + {"buildConfigurationList": xccl, "name": "All"}, parent=self.project + ) + + for target in targets_for_all: + all_target.AddDependency(target) + + # TODO(mark): This is evil because it relies on internal knowledge of + # PBXProject._properties. It's important to get the "All" target first, + # though. + self.project._properties["targets"].insert(0, all_target) + + # The same, but for run_test_targets. + if len(run_test_targets) > 1: + xccl = CreateXCConfigurationList(configurations) + run_all_tests_target = gyp.xcodeproj_file.PBXAggregateTarget( + {"buildConfigurationList": xccl, "name": "Run All Tests"}, + parent=self.project, + ) + for run_test_target in run_test_targets: + run_all_tests_target.AddDependency(run_test_target) + + # Insert after the "All" target, which must exist if there is more than + # one run_test_target. + self.project._properties["targets"].insert(1, run_all_tests_target) + + def Finalize2(self, xcode_targets, xcode_target_to_target_dict): + # Finalize2 needs to happen in a separate step because the process of + # updating references to other projects depends on the ordering of targets + # within remote project files. Finalize1 is responsible for sorting duty, + # and once all project files are sorted, Finalize2 can come in and update + # these references. + + # To support making a "test runner" target that will run all the tests + # that are direct dependents of any given target, we look for + # xcode_create_dependents_test_runner being set on an Aggregate target, + # and generate a second target that will run the tests runners found under + # the marked target. + for bf_tgt in self.build_file_dict["targets"]: + if int(bf_tgt.get("xcode_create_dependents_test_runner", 0)): + tgt_name = bf_tgt["target_name"] + toolset = bf_tgt["toolset"] + qualified_target = gyp.common.QualifiedTarget( + self.gyp_path, tgt_name, toolset + ) + xcode_target = xcode_targets[qualified_target] + if isinstance(xcode_target, gyp.xcodeproj_file.PBXAggregateTarget): + # Collect all the run test targets. + all_run_tests = [] + pbxtds = xcode_target.GetProperty("dependencies") + for pbxtd in pbxtds: + pbxcip = pbxtd.GetProperty("targetProxy") + dependency_xct = pbxcip.GetProperty("remoteGlobalIDString") + if hasattr(dependency_xct, "test_runner"): + all_run_tests.append(dependency_xct.test_runner) + + # Directly depend on all the runners as they depend on the target + # that builds them. + if len(all_run_tests) > 0: + run_all_target = gyp.xcodeproj_file.PBXAggregateTarget( + { + "name": "Run %s Tests" % tgt_name, + "productName": tgt_name, + }, + parent=self.project, + ) + for run_test_target in all_run_tests: + run_all_target.AddDependency(run_test_target) + + # Insert the test runner after the related target. + idx = self.project._properties["targets"].index(xcode_target) + self.project._properties["targets"].insert( + idx + 1, run_all_target + ) + + # Update all references to other projects, to make sure that the lists of + # remote products are complete. Otherwise, Xcode will fill them in when + # it opens the project file, which will result in unnecessary diffs. + # TODO(mark): This is evil because it relies on internal knowledge of + # PBXProject._other_pbxprojects. + for other_pbxproject in self.project._other_pbxprojects.keys(): + self.project.AddOrGetProjectReference(other_pbxproject) + + self.project.SortRemoteProductReferences() + + # Give everything an ID. + self.project_file.ComputeIDs() + + # Make sure that no two objects in the project file have the same ID. If + # multiple objects wind up with the same ID, upon loading the file, Xcode + # will only recognize one object (the last one in the file?) and the + # results are unpredictable. + self.project_file.EnsureNoIDCollisions() + + def Write(self): + # Write the project file to a temporary location first. Xcode watches for + # changes to the project file and presents a UI sheet offering to reload + # the project when it does change. However, in some cases, especially when + # multiple projects are open or when Xcode is busy, things don't work so + # seamlessly. Sometimes, Xcode is able to detect that a project file has + # changed but can't unload it because something else is referencing it. + # To mitigate this problem, and to avoid even having Xcode present the UI + # sheet when an open project is rewritten for inconsequential changes, the + # project file is written to a temporary file in the xcodeproj directory + # first. The new temporary file is then compared to the existing project + # file, if any. If they differ, the new file replaces the old; otherwise, + # the new project file is simply deleted. Xcode properly detects a file + # being renamed over an open project file as a change and so it remains + # able to present the "project file changed" sheet under this system. + # Writing to a temporary file first also avoids the possible problem of + # Xcode rereading an incomplete project file. + (output_fd, new_pbxproj_path) = tempfile.mkstemp( + suffix=".tmp", prefix="project.pbxproj.gyp.", dir=self.path + ) + + try: + output_file = os.fdopen(output_fd, "w") + + self.project_file.Print(output_file) + output_file.close() + + pbxproj_path = os.path.join(self.path, "project.pbxproj") + + same = False + try: + same = filecmp.cmp(pbxproj_path, new_pbxproj_path, False) + except OSError as e: + if e.errno != errno.ENOENT: + raise + + if same: + # The new file is identical to the old one, just get rid of the new + # one. + os.unlink(new_pbxproj_path) + else: + # The new file is different from the old one, or there is no old one. + # Rename the new file to the permanent name. + # + # tempfile.mkstemp uses an overly restrictive mode, resulting in a + # file that can only be read by the owner, regardless of the umask. + # There's no reason to not respect the umask here, which means that + # an extra hoop is required to fetch it and reset the new file's mode. + # + # No way to get the umask without setting a new one? Set a safe one + # and then set it back to the old value. + umask = os.umask(0o77) + os.umask(umask) + + os.chmod(new_pbxproj_path, 0o666 & ~umask) + os.rename(new_pbxproj_path, pbxproj_path) + + except Exception: + # Don't leave turds behind. In fact, if this code was responsible for + # creating the xcodeproj directory, get rid of that too. + os.unlink(new_pbxproj_path) + if self.created_dir: + shutil.rmtree(self.path, True) + raise def AddSourceToTarget(source, type, pbxp, xct): - # TODO(mark): Perhaps source_extensions and library_extensions can be made a - # little bit fancier. - source_extensions = ['c', 'cc', 'cpp', 'cxx', 'm', 'mm', 's', 'swift'] - - # .o is conceptually more of a "source" than a "library," but Xcode thinks - # of "sources" as things to compile and "libraries" (or "frameworks") as - # things to link with. Adding an object file to an Xcode target's frameworks - # phase works properly. - library_extensions = ['a', 'dylib', 'framework', 'o'] - - basename = posixpath.basename(source) - (root, ext) = posixpath.splitext(basename) - if ext: - ext = ext[1:].lower() - - if ext in source_extensions and type != 'none': - xct.SourcesPhase().AddFile(source) - elif ext in library_extensions and type != 'none': - xct.FrameworksPhase().AddFile(source) - else: - # Files that aren't added to a sources or frameworks build phase can still - # go into the project file, just not as part of a build phase. - pbxp.AddOrGetFileInRootGroup(source) + # TODO(mark): Perhaps source_extensions and library_extensions can be made a + # little bit fancier. + source_extensions = ["c", "cc", "cpp", "cxx", "m", "mm", "s", "swift"] + + # .o is conceptually more of a "source" than a "library," but Xcode thinks + # of "sources" as things to compile and "libraries" (or "frameworks") as + # things to link with. Adding an object file to an Xcode target's frameworks + # phase works properly. + library_extensions = ["a", "dylib", "framework", "o"] + + basename = posixpath.basename(source) + (root, ext) = posixpath.splitext(basename) + if ext: + ext = ext[1:].lower() + + if ext in source_extensions and type != "none": + xct.SourcesPhase().AddFile(source) + elif ext in library_extensions and type != "none": + xct.FrameworksPhase().AddFile(source) + else: + # Files that aren't added to a sources or frameworks build phase can still + # go into the project file, just not as part of a build phase. + pbxp.AddOrGetFileInRootGroup(source) def AddResourceToTarget(resource, pbxp, xct): - # TODO(mark): Combine with AddSourceToTarget above? Or just inline this call - # where it's used. - xct.ResourcesPhase().AddFile(resource) + # TODO(mark): Combine with AddSourceToTarget above? Or just inline this call + # where it's used. + xct.ResourcesPhase().AddFile(resource) def AddHeaderToTarget(header, pbxp, xct, is_public): - # TODO(mark): Combine with AddSourceToTarget above? Or just inline this call - # where it's used. - settings = '{ATTRIBUTES = (%s, ); }' % ('Private', 'Public')[is_public] - xct.HeadersPhase().AddFile(header, settings) + # TODO(mark): Combine with AddSourceToTarget above? Or just inline this call + # where it's used. + settings = "{ATTRIBUTES = (%s, ); }" % ("Private", "Public")[is_public] + xct.HeadersPhase().AddFile(header, settings) + + +_xcode_variable_re = re.compile(r"(\$\((.*?)\))") -_xcode_variable_re = re.compile(r'(\$\((.*?)\))') def ExpandXcodeVariables(string, expansions): - """Expands Xcode-style $(VARIABLES) in string per the expansions dict. + """Expands Xcode-style $(VARIABLES) in string per the expansions dict. In some rare cases, it is appropriate to expand Xcode variables when a project file is generated. For any substring $(VAR) in string, if VAR is a @@ -538,764 +572,823 @@ def ExpandXcodeVariables(string, expansions): dict will remain in the returned string. """ - matches = _xcode_variable_re.findall(string) - if matches is None: - return string + matches = _xcode_variable_re.findall(string) + if matches is None: + return string + + matches.reverse() + for match in matches: + (to_replace, variable) = match + if variable not in expansions: + continue - matches.reverse() - for match in matches: - (to_replace, variable) = match - if not variable in expansions: - continue + replacement = expansions[variable] + string = re.sub(re.escape(to_replace), replacement, string) - replacement = expansions[variable] - string = re.sub(re.escape(to_replace), replacement, string) + return string - return string + +_xcode_define_re = re.compile(r"([\\\"\' ])") -_xcode_define_re = re.compile(r'([\\\"\' ])') def EscapeXcodeDefine(s): - """We must escape the defines that we give to XCode so that it knows not to + """We must escape the defines that we give to XCode so that it knows not to split on spaces and to respect backslash and quote literals. However, we must not quote the define, or Xcode will incorrectly intepret variables especially $(inherited).""" - return re.sub(_xcode_define_re, r'\\\1', s) + return re.sub(_xcode_define_re, r"\\\1", s) def PerformBuild(data, configurations, params): - options = params['options'] + options = params["options"] - for build_file, build_file_dict in data.items(): - (build_file_root, build_file_ext) = os.path.splitext(build_file) - if build_file_ext != '.gyp': - continue - xcodeproj_path = build_file_root + options.suffix + '.xcodeproj' - if options.generator_output: - xcodeproj_path = os.path.join(options.generator_output, xcodeproj_path) + for build_file, build_file_dict in data.items(): + (build_file_root, build_file_ext) = os.path.splitext(build_file) + if build_file_ext != ".gyp": + continue + xcodeproj_path = build_file_root + options.suffix + ".xcodeproj" + if options.generator_output: + xcodeproj_path = os.path.join(options.generator_output, xcodeproj_path) - for config in configurations: - arguments = ['xcodebuild', '-project', xcodeproj_path] - arguments += ['-configuration', config] - print("Building [%s]: %s" % (config, arguments)) - subprocess.check_call(arguments) + for config in configurations: + arguments = ["xcodebuild", "-project", xcodeproj_path] + arguments += ["-configuration", config] + print("Building [%s]: %s" % (config, arguments)) + subprocess.check_call(arguments) def CalculateGeneratorInputInfo(params): - toplevel = params['options'].toplevel_dir - if params.get('flavor') == 'ninja': - generator_dir = os.path.relpath(params['options'].generator_output or '.') - output_dir = params.get('generator_flags', {}).get('output_dir', 'out') - output_dir = os.path.normpath(os.path.join(generator_dir, output_dir)) - qualified_out_dir = os.path.normpath(os.path.join( - toplevel, output_dir, 'gypfiles-xcode-ninja')) - else: - output_dir = os.path.normpath(os.path.join(toplevel, 'xcodebuild')) - qualified_out_dir = os.path.normpath(os.path.join( - toplevel, output_dir, 'gypfiles')) - - global generator_filelist_paths - generator_filelist_paths = { - 'toplevel': toplevel, - 'qualified_out_dir': qualified_out_dir, - } + toplevel = params["options"].toplevel_dir + if params.get("flavor") == "ninja": + generator_dir = os.path.relpath(params["options"].generator_output or ".") + output_dir = params.get("generator_flags", {}).get("output_dir", "out") + output_dir = os.path.normpath(os.path.join(generator_dir, output_dir)) + qualified_out_dir = os.path.normpath( + os.path.join(toplevel, output_dir, "gypfiles-xcode-ninja") + ) + else: + output_dir = os.path.normpath(os.path.join(toplevel, "xcodebuild")) + qualified_out_dir = os.path.normpath( + os.path.join(toplevel, output_dir, "gypfiles") + ) + + global generator_filelist_paths + generator_filelist_paths = { + "toplevel": toplevel, + "qualified_out_dir": qualified_out_dir, + } def GenerateOutput(target_list, target_dicts, data, params): - # Optionally configure each spec to use ninja as the external builder. - ninja_wrapper = params.get('flavor') == 'ninja' - if ninja_wrapper: - (target_list, target_dicts, data) = \ - gyp.xcode_ninja.CreateWrapper(target_list, target_dicts, data, params) - - options = params['options'] - generator_flags = params.get('generator_flags', {}) - parallel_builds = generator_flags.get('xcode_parallel_builds', True) - serialize_all_tests = \ - generator_flags.get('xcode_serialize_all_test_runs', True) - upgrade_check_project_version = \ - generator_flags.get('xcode_upgrade_check_project_version', None) - - # Format upgrade_check_project_version with leading zeros as needed. - if upgrade_check_project_version: - upgrade_check_project_version = str(upgrade_check_project_version) - while len(upgrade_check_project_version) < 4: - upgrade_check_project_version = '0' + upgrade_check_project_version - - skip_excluded_files = \ - not generator_flags.get('xcode_list_excluded_files', True) - xcode_projects = {} - for build_file, build_file_dict in data.items(): - (build_file_root, build_file_ext) = os.path.splitext(build_file) - if build_file_ext != '.gyp': - continue - xcodeproj_path = build_file_root + options.suffix + '.xcodeproj' - if options.generator_output: - xcodeproj_path = os.path.join(options.generator_output, xcodeproj_path) - xcp = XcodeProject(build_file, xcodeproj_path, build_file_dict) - xcode_projects[build_file] = xcp - pbxp = xcp.project - - # Set project-level attributes from multiple options - project_attributes = {} - if parallel_builds: - project_attributes['BuildIndependentTargetsInParallel'] = 'YES' + # Optionally configure each spec to use ninja as the external builder. + ninja_wrapper = params.get("flavor") == "ninja" + if ninja_wrapper: + (target_list, target_dicts, data) = gyp.xcode_ninja.CreateWrapper( + target_list, target_dicts, data, params + ) + + options = params["options"] + generator_flags = params.get("generator_flags", {}) + parallel_builds = generator_flags.get("xcode_parallel_builds", True) + serialize_all_tests = generator_flags.get("xcode_serialize_all_test_runs", True) + upgrade_check_project_version = generator_flags.get( + "xcode_upgrade_check_project_version", None + ) + + # Format upgrade_check_project_version with leading zeros as needed. if upgrade_check_project_version: - project_attributes['LastUpgradeCheck'] = upgrade_check_project_version - project_attributes['LastTestingUpgradeCheck'] = \ - upgrade_check_project_version - project_attributes['LastSwiftUpdateCheck'] = \ - upgrade_check_project_version - pbxp.SetProperty('attributes', project_attributes) - - # Add gyp/gypi files to project - if not generator_flags.get('standalone'): - main_group = pbxp.GetProperty('mainGroup') - build_group = gyp.xcodeproj_file.PBXGroup({'name': 'Build'}) - main_group.AppendChild(build_group) - for included_file in build_file_dict['included_files']: - build_group.AddOrGetFileByPath(included_file, False) - - xcode_targets = {} - xcode_target_to_target_dict = {} - for qualified_target in target_list: - [build_file, target_name, toolset] = \ - gyp.common.ParseQualifiedTarget(qualified_target) - - spec = target_dicts[qualified_target] - if spec['toolset'] != 'target': - raise Exception( - 'Multiple toolsets not supported in xcode build (target %s)' % - qualified_target) - configuration_names = [spec['default_configuration']] - for configuration_name in sorted(spec['configurations'].keys()): - if configuration_name not in configuration_names: - configuration_names.append(configuration_name) - xcp = xcode_projects[build_file] - pbxp = xcp.project - - # Set up the configurations for the target according to the list of names - # supplied. - xccl = CreateXCConfigurationList(configuration_names) - - # Create an XCTarget subclass object for the target. The type with - # "+bundle" appended will be used if the target has "mac_bundle" set. - # loadable_modules not in a mac_bundle are mapped to - # com.googlecode.gyp.xcode.bundle, a pseudo-type that xcode.py interprets - # to create a single-file mh_bundle. - _types = { - 'executable': 'com.apple.product-type.tool', - 'loadable_module': 'com.googlecode.gyp.xcode.bundle', - 'shared_library': 'com.apple.product-type.library.dynamic', - 'static_library': 'com.apple.product-type.library.static', - 'mac_kernel_extension': 'com.apple.product-type.kernel-extension', - 'executable+bundle': 'com.apple.product-type.application', - 'loadable_module+bundle': 'com.apple.product-type.bundle', - 'loadable_module+xctest': 'com.apple.product-type.bundle.unit-test', - 'shared_library+bundle': 'com.apple.product-type.framework', - 'executable+extension+bundle': 'com.apple.product-type.app-extension', - 'executable+watch+extension+bundle': - 'com.apple.product-type.watchkit-extension', - 'executable+watch+bundle': - 'com.apple.product-type.application.watchapp', - 'mac_kernel_extension+bundle': 'com.apple.product-type.kernel-extension', - } - - target_properties = { - 'buildConfigurationList': xccl, - 'name': target_name, - } + upgrade_check_project_version = str(upgrade_check_project_version) + while len(upgrade_check_project_version) < 4: + upgrade_check_project_version = "0" + upgrade_check_project_version + + skip_excluded_files = not generator_flags.get("xcode_list_excluded_files", True) + xcode_projects = {} + for build_file, build_file_dict in data.items(): + (build_file_root, build_file_ext) = os.path.splitext(build_file) + if build_file_ext != ".gyp": + continue + xcodeproj_path = build_file_root + options.suffix + ".xcodeproj" + if options.generator_output: + xcodeproj_path = os.path.join(options.generator_output, xcodeproj_path) + xcp = XcodeProject(build_file, xcodeproj_path, build_file_dict) + xcode_projects[build_file] = xcp + pbxp = xcp.project + + # Set project-level attributes from multiple options + project_attributes = {} + if parallel_builds: + project_attributes["BuildIndependentTargetsInParallel"] = "YES" + if upgrade_check_project_version: + project_attributes["LastUpgradeCheck"] = upgrade_check_project_version + project_attributes[ + "LastTestingUpgradeCheck" + ] = upgrade_check_project_version + project_attributes["LastSwiftUpdateCheck"] = upgrade_check_project_version + pbxp.SetProperty("attributes", project_attributes) + + # Add gyp/gypi files to project + if not generator_flags.get("standalone"): + main_group = pbxp.GetProperty("mainGroup") + build_group = gyp.xcodeproj_file.PBXGroup({"name": "Build"}) + main_group.AppendChild(build_group) + for included_file in build_file_dict["included_files"]: + build_group.AddOrGetFileByPath(included_file, False) + + xcode_targets = {} + xcode_target_to_target_dict = {} + for qualified_target in target_list: + [build_file, target_name, toolset] = gyp.common.ParseQualifiedTarget( + qualified_target + ) + + spec = target_dicts[qualified_target] + if spec["toolset"] != "target": + raise Exception( + "Multiple toolsets not supported in xcode build (target %s)" + % qualified_target + ) + configuration_names = [spec["default_configuration"]] + for configuration_name in sorted(spec["configurations"].keys()): + if configuration_name not in configuration_names: + configuration_names.append(configuration_name) + xcp = xcode_projects[build_file] + pbxp = xcp.project + + # Set up the configurations for the target according to the list of names + # supplied. + xccl = CreateXCConfigurationList(configuration_names) + + # Create an XCTarget subclass object for the target. The type with + # "+bundle" appended will be used if the target has "mac_bundle" set. + # loadable_modules not in a mac_bundle are mapped to + # com.googlecode.gyp.xcode.bundle, a pseudo-type that xcode.py interprets + # to create a single-file mh_bundle. + _types = { + "executable": "com.apple.product-type.tool", + "loadable_module": "com.googlecode.gyp.xcode.bundle", + "shared_library": "com.apple.product-type.library.dynamic", + "static_library": "com.apple.product-type.library.static", + "mac_kernel_extension": "com.apple.product-type.kernel-extension", + "executable+bundle": "com.apple.product-type.application", + "loadable_module+bundle": "com.apple.product-type.bundle", + "loadable_module+xctest": "com.apple.product-type.bundle.unit-test", + "loadable_module+xcuitest": "com.apple.product-type.bundle.ui-testing", + "shared_library+bundle": "com.apple.product-type.framework", + "executable+extension+bundle": "com.apple.product-type.app-extension", + "executable+watch+extension+bundle": "com.apple.product-type.watchkit-extension", + "executable+watch+bundle": "com.apple.product-type.application.watchapp", + "mac_kernel_extension+bundle": "com.apple.product-type.kernel-extension", + } - type = spec['type'] - is_xctest = int(spec.get('mac_xctest_bundle', 0)) - is_bundle = int(spec.get('mac_bundle', 0)) or is_xctest - is_app_extension = int(spec.get('ios_app_extension', 0)) - is_watchkit_extension = int(spec.get('ios_watchkit_extension', 0)) - is_watch_app = int(spec.get('ios_watch_app', 0)) - if type != 'none': - type_bundle_key = type - if is_xctest: - type_bundle_key += '+xctest' - assert type == 'loadable_module', ( - 'mac_xctest_bundle targets must have type loadable_module ' - '(target %s)' % target_name) - elif is_app_extension: - assert is_bundle, ('ios_app_extension flag requires mac_bundle ' - '(target %s)' % target_name) - type_bundle_key += '+extension+bundle' - elif is_watchkit_extension: - assert is_bundle, ('ios_watchkit_extension flag requires mac_bundle ' - '(target %s)' % target_name) - type_bundle_key += '+watch+extension+bundle' - elif is_watch_app: - assert is_bundle, ('ios_watch_app flag requires mac_bundle ' - '(target %s)' % target_name) - type_bundle_key += '+watch+bundle' - elif is_bundle: - type_bundle_key += '+bundle' - - xctarget_type = gyp.xcodeproj_file.PBXNativeTarget - try: - target_properties['productType'] = _types[type_bundle_key] - except KeyError as e: - gyp.common.ExceptionAppend(e, "-- unknown product type while " - "writing target %s" % target_name) - raise - else: - xctarget_type = gyp.xcodeproj_file.PBXAggregateTarget - assert not is_bundle, ( - 'mac_bundle targets cannot have type none (target "%s")' % - target_name) - assert not is_xctest, ( - 'mac_xctest_bundle targets cannot have type none (target "%s")' % - target_name) - - target_product_name = spec.get('product_name') - if target_product_name is not None: - target_properties['productName'] = target_product_name - - xct = xctarget_type(target_properties, parent=pbxp, - force_outdir=spec.get('product_dir'), - force_prefix=spec.get('product_prefix'), - force_extension=spec.get('product_extension')) - pbxp.AppendProperty('targets', xct) - xcode_targets[qualified_target] = xct - xcode_target_to_target_dict[xct] = spec - - spec_actions = spec.get('actions', []) - spec_rules = spec.get('rules', []) - - # Xcode has some "issues" with checking dependencies for the "Compile - # sources" step with any source files/headers generated by actions/rules. - # To work around this, if a target is building anything directly (not - # type "none"), then a second target is used to run the GYP actions/rules - # and is made a dependency of this target. This way the work is done - # before the dependency checks for what should be recompiled. - support_xct = None - # The Xcode "issues" don't affect xcode-ninja builds, since the dependency - # logic all happens in ninja. Don't bother creating the extra targets in - # that case. - if type != 'none' and (spec_actions or spec_rules) and not ninja_wrapper: - support_xccl = CreateXCConfigurationList(configuration_names) - support_target_suffix = generator_flags.get( - 'support_target_suffix', ' Support') - support_target_properties = { - 'buildConfigurationList': support_xccl, - 'name': target_name + support_target_suffix, - } - if target_product_name: - support_target_properties['productName'] = \ - target_product_name + ' Support' - support_xct = \ - gyp.xcodeproj_file.PBXAggregateTarget(support_target_properties, - parent=pbxp) - pbxp.AppendProperty('targets', support_xct) - xct.AddDependency(support_xct) - # Hang the support target off the main target so it can be tested/found - # by the generator during Finalize. - xct.support_target = support_xct - - prebuild_index = 0 - - # Add custom shell script phases for "actions" sections. - for action in spec_actions: - # There's no need to write anything into the script to ensure that the - # output directories already exist, because Xcode will look at the - # declared outputs and automatically ensure that they exist for us. - - # Do we have a message to print when this action runs? - message = action.get('message') - if message: - message = 'echo note: ' + gyp.common.EncodePOSIXShellArgument(message) - else: - message = '' - - # Turn the list into a string that can be passed to a shell. - action_string = gyp.common.EncodePOSIXShellList(action['action']) - - # Convert Xcode-type variable references to sh-compatible environment - # variable references. - message_sh = gyp.xcodeproj_file.ConvertVariablesToShellSyntax(message) - action_string_sh = gyp.xcodeproj_file.ConvertVariablesToShellSyntax( - action_string) - - script = '' - # Include the optional message - if message_sh: - script += message_sh + '\n' - # Be sure the script runs in exec, and that if exec fails, the script - # exits signalling an error. - script += 'exec ' + action_string_sh + '\nexit 1\n' - ssbp = gyp.xcodeproj_file.PBXShellScriptBuildPhase({ - 'inputPaths': action['inputs'], - 'name': 'Action "' + action['action_name'] + '"', - 'outputPaths': action['outputs'], - 'shellScript': script, - 'showEnvVarsInLog': 0, - }) - - if support_xct: - support_xct.AppendProperty('buildPhases', ssbp) - else: - # TODO(mark): this assumes too much knowledge of the internals of - # xcodeproj_file; some of these smarts should move into xcodeproj_file - # itself. - xct._properties['buildPhases'].insert(prebuild_index, ssbp) - prebuild_index = prebuild_index + 1 - - # TODO(mark): Should verify that at most one of these is specified. - if int(action.get('process_outputs_as_sources', False)): - for output in action['outputs']: - AddSourceToTarget(output, type, pbxp, xct) - - if int(action.get('process_outputs_as_mac_bundle_resources', False)): - for output in action['outputs']: - AddResourceToTarget(output, pbxp, xct) - - # tgt_mac_bundle_resources holds the list of bundle resources so - # the rule processing can check against it. - if is_bundle: - tgt_mac_bundle_resources = spec.get('mac_bundle_resources', []) - else: - tgt_mac_bundle_resources = [] - - # Add custom shell script phases driving "make" for "rules" sections. - # - # Xcode's built-in rule support is almost powerful enough to use directly, - # but there are a few significant deficiencies that render them unusable. - # There are workarounds for some of its inadequacies, but in aggregate, - # the workarounds added complexity to the generator, and some workarounds - # actually require input files to be crafted more carefully than I'd like. - # Consequently, until Xcode rules are made more capable, "rules" input - # sections will be handled in Xcode output by shell script build phases - # performed prior to the compilation phase. - # - # The following problems with Xcode rules were found. The numbers are - # Apple radar IDs. I hope that these shortcomings are addressed, I really - # liked having the rules handled directly in Xcode during the period that - # I was prototyping this. - # - # 6588600 Xcode compiles custom script rule outputs too soon, compilation - # fails. This occurs when rule outputs from distinct inputs are - # interdependent. The only workaround is to put rules and their - # inputs in a separate target from the one that compiles the rule - # outputs. This requires input file cooperation and it means that - # process_outputs_as_sources is unusable. - # 6584932 Need to declare that custom rule outputs should be excluded from - # compilation. A possible workaround is to lie to Xcode about a - # rule's output, giving it a dummy file it doesn't know how to - # compile. The rule action script would need to touch the dummy. - # 6584839 I need a way to declare additional inputs to a custom rule. - # A possible workaround is a shell script phase prior to - # compilation that touches a rule's primary input files if any - # would-be additional inputs are newer than the output. Modifying - # the source tree - even just modification times - feels dirty. - # 6564240 Xcode "custom script" build rules always dump all environment - # variables. This is a low-prioroty problem and is not a - # show-stopper. - rules_by_ext = {} - for rule in spec_rules: - rules_by_ext[rule['extension']] = rule - - # First, some definitions: - # - # A "rule source" is a file that was listed in a target's "sources" - # list and will have a rule applied to it on the basis of matching the - # rule's "extensions" attribute. Rule sources are direct inputs to - # rules. - # - # Rule definitions may specify additional inputs in their "inputs" - # attribute. These additional inputs are used for dependency tracking - # purposes. - # - # A "concrete output" is a rule output with input-dependent variables - # resolved. For example, given a rule with: - # 'extension': 'ext', 'outputs': ['$(INPUT_FILE_BASE).cc'], - # if the target's "sources" list contained "one.ext" and "two.ext", - # the "concrete output" for rule input "two.ext" would be "two.cc". If - # a rule specifies multiple outputs, each input file that the rule is - # applied to will have the same number of concrete outputs. - # - # If any concrete outputs are outdated or missing relative to their - # corresponding rule_source or to any specified additional input, the - # rule action must be performed to generate the concrete outputs. - - # concrete_outputs_by_rule_source will have an item at the same index - # as the rule['rule_sources'] that it corresponds to. Each item is a - # list of all of the concrete outputs for the rule_source. - concrete_outputs_by_rule_source = [] - - # concrete_outputs_all is a flat list of all concrete outputs that this - # rule is able to produce, given the known set of input files - # (rule_sources) that apply to it. - concrete_outputs_all = [] - - # messages & actions are keyed by the same indices as rule['rule_sources'] - # and concrete_outputs_by_rule_source. They contain the message and - # action to perform after resolving input-dependent variables. The - # message is optional, in which case None is stored for each rule source. - messages = [] - actions = [] - - for rule_source in rule.get('rule_sources', []): - rule_source_dirname, rule_source_basename = \ - posixpath.split(rule_source) - (rule_source_root, rule_source_ext) = \ - posixpath.splitext(rule_source_basename) - - # These are the same variable names that Xcode uses for its own native - # rule support. Because Xcode's rule engine is not being used, they - # need to be expanded as they are written to the makefile. - rule_input_dict = { - 'INPUT_FILE_BASE': rule_source_root, - 'INPUT_FILE_SUFFIX': rule_source_ext, - 'INPUT_FILE_NAME': rule_source_basename, - 'INPUT_FILE_PATH': rule_source, - 'INPUT_FILE_DIRNAME': rule_source_dirname, + target_properties = { + "buildConfigurationList": xccl, + "name": target_name, } - concrete_outputs_for_this_rule_source = [] - for output in rule.get('outputs', []): - # Fortunately, Xcode and make both use $(VAR) format for their - # variables, so the expansion is the only transformation necessary. - # Any remaning $(VAR)-type variables in the string can be given - # directly to make, which will pick up the correct settings from - # what Xcode puts into the environment. - concrete_output = ExpandXcodeVariables(output, rule_input_dict) - concrete_outputs_for_this_rule_source.append(concrete_output) - - # Add all concrete outputs to the project. - pbxp.AddOrGetFileInRootGroup(concrete_output) - - concrete_outputs_by_rule_source.append( \ - concrete_outputs_for_this_rule_source) - concrete_outputs_all.extend(concrete_outputs_for_this_rule_source) - - # TODO(mark): Should verify that at most one of these is specified. - if int(rule.get('process_outputs_as_sources', False)): - for output in concrete_outputs_for_this_rule_source: - AddSourceToTarget(output, type, pbxp, xct) - - # If the file came from the mac_bundle_resources list or if the rule - # is marked to process outputs as bundle resource, do so. - was_mac_bundle_resource = rule_source in tgt_mac_bundle_resources - if was_mac_bundle_resource or \ - int(rule.get('process_outputs_as_mac_bundle_resources', False)): - for output in concrete_outputs_for_this_rule_source: - AddResourceToTarget(output, pbxp, xct) - - # Do we have a message to print when this rule runs? - message = rule.get('message') - if message: - message = gyp.common.EncodePOSIXShellArgument(message) - message = ExpandXcodeVariables(message, rule_input_dict) - messages.append(message) - - # Turn the list into a string that can be passed to a shell. - action_string = gyp.common.EncodePOSIXShellList(rule['action']) - - action = ExpandXcodeVariables(action_string, rule_input_dict) - actions.append(action) - - if len(concrete_outputs_all) > 0: - # TODO(mark): There's a possibility for collision here. Consider - # target "t" rule "A_r" and target "t_A" rule "r". - makefile_name = '%s.make' % re.sub( - '[^a-zA-Z0-9_]', '_' , '%s_%s' % (target_name, rule['rule_name'])) - makefile_path = os.path.join(xcode_projects[build_file].path, - makefile_name) - # TODO(mark): try/close? Write to a temporary file and swap it only - # if it's got changes? - makefile = open(makefile_path, 'wb') - - # make will build the first target in the makefile by default. By - # convention, it's called "all". List all (or at least one) - # concrete output for each rule source as a prerequisite of the "all" - # target. - makefile.write('all: \\\n') - for concrete_output_index in \ - range(0, len(concrete_outputs_by_rule_source)): - # Only list the first (index [0]) concrete output of each input - # in the "all" target. Otherwise, a parallel make (-j > 1) would - # attempt to process each input multiple times simultaneously. - # Otherwise, "all" could just contain the entire list of - # concrete_outputs_all. - concrete_output = \ - concrete_outputs_by_rule_source[concrete_output_index][0] - if concrete_output_index == len(concrete_outputs_by_rule_source) - 1: - eol = '' - else: - eol = ' \\' - makefile.write(' %s%s\n' % (concrete_output, eol)) - - for (rule_source, concrete_outputs, message, action) in \ - zip(rule['rule_sources'], concrete_outputs_by_rule_source, - messages, actions): - makefile.write('\n') - - # Add a rule that declares it can build each concrete output of a - # rule source. Collect the names of the directories that are - # required. - concrete_output_dirs = [] - for concrete_output_index in range(0, len(concrete_outputs)): - concrete_output = concrete_outputs[concrete_output_index] - if concrete_output_index == 0: - bol = '' + type = spec["type"] + is_xctest = int(spec.get("mac_xctest_bundle", 0)) + is_xcuitest = int(spec.get("mac_xcuitest_bundle", 0)) + is_bundle = int(spec.get("mac_bundle", 0)) or is_xctest + is_app_extension = int(spec.get("ios_app_extension", 0)) + is_watchkit_extension = int(spec.get("ios_watchkit_extension", 0)) + is_watch_app = int(spec.get("ios_watch_app", 0)) + if type != "none": + type_bundle_key = type + if is_xcuitest: + type_bundle_key += "+xcuitest" + assert type == "loadable_module", ( + "mac_xcuitest_bundle targets must have type loadable_module " + "(target %s)" % target_name + ) + elif is_xctest: + type_bundle_key += "+xctest" + assert type == "loadable_module", ( + "mac_xctest_bundle targets must have type loadable_module " + "(target %s)" % target_name + ) + elif is_app_extension: + assert is_bundle, ( + "ios_app_extension flag requires mac_bundle " + "(target %s)" % target_name + ) + type_bundle_key += "+extension+bundle" + elif is_watchkit_extension: + assert is_bundle, ( + "ios_watchkit_extension flag requires mac_bundle " + "(target %s)" % target_name + ) + type_bundle_key += "+watch+extension+bundle" + elif is_watch_app: + assert is_bundle, ( + "ios_watch_app flag requires mac_bundle " + "(target %s)" % target_name + ) + type_bundle_key += "+watch+bundle" + elif is_bundle: + type_bundle_key += "+bundle" + + xctarget_type = gyp.xcodeproj_file.PBXNativeTarget + try: + target_properties["productType"] = _types[type_bundle_key] + except KeyError as e: + gyp.common.ExceptionAppend( + e, + "-- unknown product type while " "writing target %s" % target_name, + ) + raise + else: + xctarget_type = gyp.xcodeproj_file.PBXAggregateTarget + assert not is_bundle, ( + 'mac_bundle targets cannot have type none (target "%s")' % target_name + ) + assert not is_xcuitest, ( + 'mac_xcuitest_bundle targets cannot have type none (target "%s")' + % target_name + ) + assert not is_xctest, ( + 'mac_xctest_bundle targets cannot have type none (target "%s")' + % target_name + ) + + target_product_name = spec.get("product_name") + if target_product_name is not None: + target_properties["productName"] = target_product_name + + xct = xctarget_type( + target_properties, + parent=pbxp, + force_outdir=spec.get("product_dir"), + force_prefix=spec.get("product_prefix"), + force_extension=spec.get("product_extension"), + ) + pbxp.AppendProperty("targets", xct) + xcode_targets[qualified_target] = xct + xcode_target_to_target_dict[xct] = spec + + spec_actions = spec.get("actions", []) + spec_rules = spec.get("rules", []) + + # Xcode has some "issues" with checking dependencies for the "Compile + # sources" step with any source files/headers generated by actions/rules. + # To work around this, if a target is building anything directly (not + # type "none"), then a second target is used to run the GYP actions/rules + # and is made a dependency of this target. This way the work is done + # before the dependency checks for what should be recompiled. + support_xct = None + # The Xcode "issues" don't affect xcode-ninja builds, since the dependency + # logic all happens in ninja. Don't bother creating the extra targets in + # that case. + if type != "none" and (spec_actions or spec_rules) and not ninja_wrapper: + support_xccl = CreateXCConfigurationList(configuration_names) + support_target_suffix = generator_flags.get( + "support_target_suffix", " Support" + ) + support_target_properties = { + "buildConfigurationList": support_xccl, + "name": target_name + support_target_suffix, + } + if target_product_name: + support_target_properties["productName"] = ( + target_product_name + " Support" + ) + support_xct = gyp.xcodeproj_file.PBXAggregateTarget( + support_target_properties, parent=pbxp + ) + pbxp.AppendProperty("targets", support_xct) + xct.AddDependency(support_xct) + # Hang the support target off the main target so it can be tested/found + # by the generator during Finalize. + xct.support_target = support_xct + + prebuild_index = 0 + + # Add custom shell script phases for "actions" sections. + for action in spec_actions: + # There's no need to write anything into the script to ensure that the + # output directories already exist, because Xcode will look at the + # declared outputs and automatically ensure that they exist for us. + + # Do we have a message to print when this action runs? + message = action.get("message") + if message: + message = "echo note: " + gyp.common.EncodePOSIXShellArgument(message) else: - bol = ' ' - makefile.write('%s%s \\\n' % (bol, concrete_output)) - - concrete_output_dir = posixpath.dirname(concrete_output) - if (concrete_output_dir and - concrete_output_dir not in concrete_output_dirs): - concrete_output_dirs.append(concrete_output_dir) - - makefile.write(' : \\\n') - - # The prerequisites for this rule are the rule source itself and - # the set of additional rule inputs, if any. - prerequisites = [rule_source] - prerequisites.extend(rule.get('inputs', [])) - for prerequisite_index in range(0, len(prerequisites)): - prerequisite = prerequisites[prerequisite_index] - if prerequisite_index == len(prerequisites) - 1: - eol = '' + message = "" + + # Turn the list into a string that can be passed to a shell. + action_string = gyp.common.EncodePOSIXShellList(action["action"]) + + # Convert Xcode-type variable references to sh-compatible environment + # variable references. + message_sh = gyp.xcodeproj_file.ConvertVariablesToShellSyntax(message) + action_string_sh = gyp.xcodeproj_file.ConvertVariablesToShellSyntax( + action_string + ) + + script = "" + # Include the optional message + if message_sh: + script += message_sh + "\n" + # Be sure the script runs in exec, and that if exec fails, the script + # exits signalling an error. + script += "exec " + action_string_sh + "\nexit 1\n" + ssbp = gyp.xcodeproj_file.PBXShellScriptBuildPhase( + { + "inputPaths": action["inputs"], + "name": 'Action "' + action["action_name"] + '"', + "outputPaths": action["outputs"], + "shellScript": script, + "showEnvVarsInLog": 0, + } + ) + + if support_xct: + support_xct.AppendProperty("buildPhases", ssbp) else: - eol = ' \\' - makefile.write(' %s%s\n' % (prerequisite, eol)) - - # Make sure that output directories exist before executing the rule - # action. - if len(concrete_output_dirs) > 0: - makefile.write('\t@mkdir -p "%s"\n' % - '" "'.join(concrete_output_dirs)) - - # The rule message and action have already had the necessary variable - # substitutions performed. - if message: - # Mark it with note: so Xcode picks it up in build output. - makefile.write('\t@echo note: %s\n' % message) - makefile.write('\t%s\n' % action) - - makefile.close() - - # It might be nice to ensure that needed output directories exist - # here rather than in each target in the Makefile, but that wouldn't - # work if there ever was a concrete output that had an input-dependent - # variable anywhere other than in the leaf position. - - # Don't declare any inputPaths or outputPaths. If they're present, - # Xcode will provide a slight optimization by only running the script - # phase if any output is missing or outdated relative to any input. - # Unfortunately, it will also assume that all outputs are touched by - # the script, and if the outputs serve as files in a compilation - # phase, they will be unconditionally rebuilt. Since make might not - # rebuild everything that could be declared here as an output, this - # extra compilation activity is unnecessary. With inputPaths and - # outputPaths not supplied, make will always be called, but it knows - # enough to not do anything when everything is up-to-date. - - # To help speed things up, pass -j COUNT to make so it does some work - # in parallel. Don't use ncpus because Xcode will build ncpus targets - # in parallel and if each target happens to have a rules step, there - # would be ncpus^2 things going. With a machine that has 2 quad-core - # Xeons, a build can quickly run out of processes based on - # scheduling/other tasks, and randomly failing builds are no good. - script = \ -"""JOB_COUNT="$(/usr/sbin/sysctl -n hw.ncpu)" + # TODO(mark): this assumes too much knowledge of the internals of + # xcodeproj_file; some of these smarts should move into xcodeproj_file + # itself. + xct._properties["buildPhases"].insert(prebuild_index, ssbp) + prebuild_index = prebuild_index + 1 + + # TODO(mark): Should verify that at most one of these is specified. + if int(action.get("process_outputs_as_sources", False)): + for output in action["outputs"]: + AddSourceToTarget(output, type, pbxp, xct) + + if int(action.get("process_outputs_as_mac_bundle_resources", False)): + for output in action["outputs"]: + AddResourceToTarget(output, pbxp, xct) + + # tgt_mac_bundle_resources holds the list of bundle resources so + # the rule processing can check against it. + if is_bundle: + tgt_mac_bundle_resources = spec.get("mac_bundle_resources", []) + else: + tgt_mac_bundle_resources = [] + + # Add custom shell script phases driving "make" for "rules" sections. + # + # Xcode's built-in rule support is almost powerful enough to use directly, + # but there are a few significant deficiencies that render them unusable. + # There are workarounds for some of its inadequacies, but in aggregate, + # the workarounds added complexity to the generator, and some workarounds + # actually require input files to be crafted more carefully than I'd like. + # Consequently, until Xcode rules are made more capable, "rules" input + # sections will be handled in Xcode output by shell script build phases + # performed prior to the compilation phase. + # + # The following problems with Xcode rules were found. The numbers are + # Apple radar IDs. I hope that these shortcomings are addressed, I really + # liked having the rules handled directly in Xcode during the period that + # I was prototyping this. + # + # 6588600 Xcode compiles custom script rule outputs too soon, compilation + # fails. This occurs when rule outputs from distinct inputs are + # interdependent. The only workaround is to put rules and their + # inputs in a separate target from the one that compiles the rule + # outputs. This requires input file cooperation and it means that + # process_outputs_as_sources is unusable. + # 6584932 Need to declare that custom rule outputs should be excluded from + # compilation. A possible workaround is to lie to Xcode about a + # rule's output, giving it a dummy file it doesn't know how to + # compile. The rule action script would need to touch the dummy. + # 6584839 I need a way to declare additional inputs to a custom rule. + # A possible workaround is a shell script phase prior to + # compilation that touches a rule's primary input files if any + # would-be additional inputs are newer than the output. Modifying + # the source tree - even just modification times - feels dirty. + # 6564240 Xcode "custom script" build rules always dump all environment + # variables. This is a low-prioroty problem and is not a + # show-stopper. + rules_by_ext = {} + for rule in spec_rules: + rules_by_ext[rule["extension"]] = rule + + # First, some definitions: + # + # A "rule source" is a file that was listed in a target's "sources" + # list and will have a rule applied to it on the basis of matching the + # rule's "extensions" attribute. Rule sources are direct inputs to + # rules. + # + # Rule definitions may specify additional inputs in their "inputs" + # attribute. These additional inputs are used for dependency tracking + # purposes. + # + # A "concrete output" is a rule output with input-dependent variables + # resolved. For example, given a rule with: + # 'extension': 'ext', 'outputs': ['$(INPUT_FILE_BASE).cc'], + # if the target's "sources" list contained "one.ext" and "two.ext", + # the "concrete output" for rule input "two.ext" would be "two.cc". If + # a rule specifies multiple outputs, each input file that the rule is + # applied to will have the same number of concrete outputs. + # + # If any concrete outputs are outdated or missing relative to their + # corresponding rule_source or to any specified additional input, the + # rule action must be performed to generate the concrete outputs. + + # concrete_outputs_by_rule_source will have an item at the same index + # as the rule['rule_sources'] that it corresponds to. Each item is a + # list of all of the concrete outputs for the rule_source. + concrete_outputs_by_rule_source = [] + + # concrete_outputs_all is a flat list of all concrete outputs that this + # rule is able to produce, given the known set of input files + # (rule_sources) that apply to it. + concrete_outputs_all = [] + + # messages & actions are keyed by the same indices as rule['rule_sources'] + # and concrete_outputs_by_rule_source. They contain the message and + # action to perform after resolving input-dependent variables. The + # message is optional, in which case None is stored for each rule source. + messages = [] + actions = [] + + for rule_source in rule.get("rule_sources", []): + rule_source_dirname, rule_source_basename = posixpath.split(rule_source) + (rule_source_root, rule_source_ext) = posixpath.splitext( + rule_source_basename + ) + + # These are the same variable names that Xcode uses for its own native + # rule support. Because Xcode's rule engine is not being used, they + # need to be expanded as they are written to the makefile. + rule_input_dict = { + "INPUT_FILE_BASE": rule_source_root, + "INPUT_FILE_SUFFIX": rule_source_ext, + "INPUT_FILE_NAME": rule_source_basename, + "INPUT_FILE_PATH": rule_source, + "INPUT_FILE_DIRNAME": rule_source_dirname, + } + + concrete_outputs_for_this_rule_source = [] + for output in rule.get("outputs", []): + # Fortunately, Xcode and make both use $(VAR) format for their + # variables, so the expansion is the only transformation necessary. + # Any remaning $(VAR)-type variables in the string can be given + # directly to make, which will pick up the correct settings from + # what Xcode puts into the environment. + concrete_output = ExpandXcodeVariables(output, rule_input_dict) + concrete_outputs_for_this_rule_source.append(concrete_output) + + # Add all concrete outputs to the project. + pbxp.AddOrGetFileInRootGroup(concrete_output) + + concrete_outputs_by_rule_source.append( + concrete_outputs_for_this_rule_source + ) + concrete_outputs_all.extend(concrete_outputs_for_this_rule_source) + + # TODO(mark): Should verify that at most one of these is specified. + if int(rule.get("process_outputs_as_sources", False)): + for output in concrete_outputs_for_this_rule_source: + AddSourceToTarget(output, type, pbxp, xct) + + # If the file came from the mac_bundle_resources list or if the rule + # is marked to process outputs as bundle resource, do so. + was_mac_bundle_resource = rule_source in tgt_mac_bundle_resources + if was_mac_bundle_resource or int( + rule.get("process_outputs_as_mac_bundle_resources", False) + ): + for output in concrete_outputs_for_this_rule_source: + AddResourceToTarget(output, pbxp, xct) + + # Do we have a message to print when this rule runs? + message = rule.get("message") + if message: + message = gyp.common.EncodePOSIXShellArgument(message) + message = ExpandXcodeVariables(message, rule_input_dict) + messages.append(message) + + # Turn the list into a string that can be passed to a shell. + action_string = gyp.common.EncodePOSIXShellList(rule["action"]) + + action = ExpandXcodeVariables(action_string, rule_input_dict) + actions.append(action) + + if len(concrete_outputs_all) > 0: + # TODO(mark): There's a possibility for collision here. Consider + # target "t" rule "A_r" and target "t_A" rule "r". + makefile_name = "%s.make" % re.sub( + "[^a-zA-Z0-9_]", "_", "%s_%s" % (target_name, rule["rule_name"]) + ) + makefile_path = os.path.join( + xcode_projects[build_file].path, makefile_name + ) + # TODO(mark): try/close? Write to a temporary file and swap it only + # if it's got changes? + makefile = open(makefile_path, "w") + + # make will build the first target in the makefile by default. By + # convention, it's called "all". List all (or at least one) + # concrete output for each rule source as a prerequisite of the "all" + # target. + makefile.write("all: \\\n") + for concrete_output_index, concrete_output_by_rule_source in enumerate( + concrete_outputs_by_rule_source + ): + # Only list the first (index [0]) concrete output of each input + # in the "all" target. Otherwise, a parallel make (-j > 1) would + # attempt to process each input multiple times simultaneously. + # Otherwise, "all" could just contain the entire list of + # concrete_outputs_all. + concrete_output = concrete_output_by_rule_source[0] + if ( + concrete_output_index + == len(concrete_outputs_by_rule_source) - 1 + ): + eol = "" + else: + eol = " \\" + makefile.write(" %s%s\n" % (concrete_output, eol)) + + for (rule_source, concrete_outputs, message, action) in zip( + rule["rule_sources"], + concrete_outputs_by_rule_source, + messages, + actions, + ): + makefile.write("\n") + + # Add a rule that declares it can build each concrete output of a + # rule source. Collect the names of the directories that are + # required. + concrete_output_dirs = [] + for concrete_output_index, concrete_output in enumerate( + concrete_outputs + ): + if concrete_output_index == 0: + bol = "" + else: + bol = " " + makefile.write("%s%s \\\n" % (bol, concrete_output)) + + concrete_output_dir = posixpath.dirname(concrete_output) + if ( + concrete_output_dir + and concrete_output_dir not in concrete_output_dirs + ): + concrete_output_dirs.append(concrete_output_dir) + + makefile.write(" : \\\n") + + # The prerequisites for this rule are the rule source itself and + # the set of additional rule inputs, if any. + prerequisites = [rule_source] + prerequisites.extend(rule.get("inputs", [])) + for prerequisite_index, prerequisite in enumerate(prerequisites): + if prerequisite_index == len(prerequisites) - 1: + eol = "" + else: + eol = " \\" + makefile.write(" %s%s\n" % (prerequisite, eol)) + + # Make sure that output directories exist before executing the rule + # action. + if len(concrete_output_dirs) > 0: + makefile.write( + '\t@mkdir -p "%s"\n' % '" "'.join(concrete_output_dirs) + ) + + # The rule message and action have already had the necessary variable + # substitutions performed. + if message: + # Mark it with note: so Xcode picks it up in build output. + makefile.write("\t@echo note: %s\n" % message) + makefile.write("\t%s\n" % action) + + makefile.close() + + # It might be nice to ensure that needed output directories exist + # here rather than in each target in the Makefile, but that wouldn't + # work if there ever was a concrete output that had an input-dependent + # variable anywhere other than in the leaf position. + + # Don't declare any inputPaths or outputPaths. If they're present, + # Xcode will provide a slight optimization by only running the script + # phase if any output is missing or outdated relative to any input. + # Unfortunately, it will also assume that all outputs are touched by + # the script, and if the outputs serve as files in a compilation + # phase, they will be unconditionally rebuilt. Since make might not + # rebuild everything that could be declared here as an output, this + # extra compilation activity is unnecessary. With inputPaths and + # outputPaths not supplied, make will always be called, but it knows + # enough to not do anything when everything is up-to-date. + + # To help speed things up, pass -j COUNT to make so it does some work + # in parallel. Don't use ncpus because Xcode will build ncpus targets + # in parallel and if each target happens to have a rules step, there + # would be ncpus^2 things going. With a machine that has 2 quad-core + # Xeons, a build can quickly run out of processes based on + # scheduling/other tasks, and randomly failing builds are no good. + script = ( + """JOB_COUNT="$(/usr/sbin/sysctl -n hw.ncpu)" if [ "${JOB_COUNT}" -gt 4 ]; then JOB_COUNT=4 fi exec xcrun make -f "${PROJECT_FILE_PATH}/%s" -j "${JOB_COUNT}" exit 1 -""" % makefile_name - ssbp = gyp.xcodeproj_file.PBXShellScriptBuildPhase({ - 'name': 'Rule "' + rule['rule_name'] + '"', - 'shellScript': script, - 'showEnvVarsInLog': 0, - }) - - if support_xct: - support_xct.AppendProperty('buildPhases', ssbp) - else: - # TODO(mark): this assumes too much knowledge of the internals of - # xcodeproj_file; some of these smarts should move into xcodeproj_file - # itself. - xct._properties['buildPhases'].insert(prebuild_index, ssbp) - prebuild_index = prebuild_index + 1 - - # Extra rule inputs also go into the project file. Concrete outputs were - # already added when they were computed. - groups = ['inputs', 'inputs_excluded'] - if skip_excluded_files: - groups = [x for x in groups if not x.endswith('_excluded')] - for group in groups: - for item in rule.get(group, []): - pbxp.AddOrGetFileInRootGroup(item) - - # Add "sources". - for source in spec.get('sources', []): - (source_root, source_extension) = posixpath.splitext(source) - if source_extension[1:] not in rules_by_ext: - # AddSourceToTarget will add the file to a root group if it's not - # already there. - AddSourceToTarget(source, type, pbxp, xct) - else: - pbxp.AddOrGetFileInRootGroup(source) - - # Add "mac_bundle_resources" and "mac_framework_private_headers" if - # it's a bundle of any type. - if is_bundle: - for resource in tgt_mac_bundle_resources: - (resource_root, resource_extension) = posixpath.splitext(resource) - if resource_extension[1:] not in rules_by_ext: - AddResourceToTarget(resource, pbxp, xct) - else: - pbxp.AddOrGetFileInRootGroup(resource) - - for header in spec.get('mac_framework_private_headers', []): - AddHeaderToTarget(header, pbxp, xct, False) - - # Add "mac_framework_headers". These can be valid for both frameworks - # and static libraries. - if is_bundle or type == 'static_library': - for header in spec.get('mac_framework_headers', []): - AddHeaderToTarget(header, pbxp, xct, True) - - # Add "copies". - pbxcp_dict = {} - for copy_group in spec.get('copies', []): - dest = copy_group['destination'] - if dest[0] not in ('/', '$'): - # Relative paths are relative to $(SRCROOT). - dest = '$(SRCROOT)/' + dest - - code_sign = int(copy_group.get('xcode_code_sign', 0)) - settings = (None, '{ATTRIBUTES = (CodeSignOnCopy, ); }')[code_sign] - - # Coalesce multiple "copies" sections in the same target with the same - # "destination" property into the same PBXCopyFilesBuildPhase, otherwise - # they'll wind up with ID collisions. - pbxcp = pbxcp_dict.get(dest, None) - if pbxcp is None: - pbxcp = gyp.xcodeproj_file.PBXCopyFilesBuildPhase({ - 'name': 'Copy to ' + copy_group['destination'] - }, - parent=xct) - pbxcp.SetDestination(dest) - - # TODO(mark): The usual comment about this knowing too much about - # gyp.xcodeproj_file internals applies. - xct._properties['buildPhases'].insert(prebuild_index, pbxcp) - - pbxcp_dict[dest] = pbxcp - - for file in copy_group['files']: - pbxcp.AddFile(file, settings) - - # Excluded files can also go into the project file. - if not skip_excluded_files: - for key in ['sources', 'mac_bundle_resources', 'mac_framework_headers', - 'mac_framework_private_headers']: - excluded_key = key + '_excluded' - for item in spec.get(excluded_key, []): - pbxp.AddOrGetFileInRootGroup(item) - - # So can "inputs" and "outputs" sections of "actions" groups. - groups = ['inputs', 'inputs_excluded', 'outputs', 'outputs_excluded'] - if skip_excluded_files: - groups = [x for x in groups if not x.endswith('_excluded')] - for action in spec.get('actions', []): - for group in groups: - for item in action.get(group, []): - # Exclude anything in BUILT_PRODUCTS_DIR. They're products, not - # sources. - if not item.startswith('$(BUILT_PRODUCTS_DIR)/'): - pbxp.AddOrGetFileInRootGroup(item) - - for postbuild in spec.get('postbuilds', []): - action_string_sh = gyp.common.EncodePOSIXShellList(postbuild['action']) - script = 'exec ' + action_string_sh + '\nexit 1\n' - - # Make the postbuild step depend on the output of ld or ar from this - # target. Apparently putting the script step after the link step isn't - # sufficient to ensure proper ordering in all cases. With an input - # declared but no outputs, the script step should run every time, as - # desired. - ssbp = gyp.xcodeproj_file.PBXShellScriptBuildPhase({ - 'inputPaths': ['$(BUILT_PRODUCTS_DIR)/$(EXECUTABLE_PATH)'], - 'name': 'Postbuild "' + postbuild['postbuild_name'] + '"', - 'shellScript': script, - 'showEnvVarsInLog': 0, - }) - xct.AppendProperty('buildPhases', ssbp) - - # Add dependencies before libraries, because adding a dependency may imply - # adding a library. It's preferable to keep dependencies listed first - # during a link phase so that they can override symbols that would - # otherwise be provided by libraries, which will usually include system - # libraries. On some systems, ld is finicky and even requires the - # libraries to be ordered in such a way that unresolved symbols in - # earlier-listed libraries may only be resolved by later-listed libraries. - # The Mac linker doesn't work that way, but other platforms do, and so - # their linker invocations need to be constructed in this way. There's - # no compelling reason for Xcode's linker invocations to differ. - - if 'dependencies' in spec: - for dependency in spec['dependencies']: - xct.AddDependency(xcode_targets[dependency]) - # The support project also gets the dependencies (in case they are - # needed for the actions/rules to work). - if support_xct: - support_xct.AddDependency(xcode_targets[dependency]) - - if 'libraries' in spec: - for library in spec['libraries']: - xct.FrameworksPhase().AddFile(library) - # Add the library's directory to LIBRARY_SEARCH_PATHS if necessary. - # I wish Xcode handled this automatically. - library_dir = posixpath.dirname(library) - if library_dir not in xcode_standard_library_dirs and ( - not xct.HasBuildSetting(_library_search_paths_var) or - library_dir not in xct.GetBuildSetting(_library_search_paths_var)): - xct.AppendBuildSetting(_library_search_paths_var, library_dir) - - for configuration_name in configuration_names: - configuration = spec['configurations'][configuration_name] - xcbc = xct.ConfigurationNamed(configuration_name) - for include_dir in configuration.get('mac_framework_dirs', []): - xcbc.AppendBuildSetting('FRAMEWORK_SEARCH_PATHS', include_dir) - for include_dir in configuration.get('include_dirs', []): - xcbc.AppendBuildSetting('HEADER_SEARCH_PATHS', include_dir) - for library_dir in configuration.get('library_dirs', []): - if library_dir not in xcode_standard_library_dirs and ( - not xcbc.HasBuildSetting(_library_search_paths_var) or - library_dir not in xcbc.GetBuildSetting(_library_search_paths_var)): - xcbc.AppendBuildSetting(_library_search_paths_var, library_dir) - - if 'defines' in configuration: - for define in configuration['defines']: - set_define = EscapeXcodeDefine(define) - xcbc.AppendBuildSetting('GCC_PREPROCESSOR_DEFINITIONS', set_define) - if 'xcode_settings' in configuration: - for xck, xcv in configuration['xcode_settings'].items(): - xcbc.SetBuildSetting(xck, xcv) - if 'xcode_config_file' in configuration: - config_ref = pbxp.AddOrGetFileInRootGroup( - configuration['xcode_config_file']) - xcbc.SetBaseConfiguration(config_ref) - - build_files = [] - for build_file, build_file_dict in data.items(): - if build_file.endswith('.gyp'): - build_files.append(build_file) - - for build_file in build_files: - xcode_projects[build_file].Finalize1(xcode_targets, serialize_all_tests) - - for build_file in build_files: - xcode_projects[build_file].Finalize2(xcode_targets, - xcode_target_to_target_dict) - - for build_file in build_files: - xcode_projects[build_file].Write() +""" + % makefile_name + ) + ssbp = gyp.xcodeproj_file.PBXShellScriptBuildPhase( + { + "name": 'Rule "' + rule["rule_name"] + '"', + "shellScript": script, + "showEnvVarsInLog": 0, + } + ) + + if support_xct: + support_xct.AppendProperty("buildPhases", ssbp) + else: + # TODO(mark): this assumes too much knowledge of the internals of + # xcodeproj_file; some of these smarts should move into xcodeproj_file + # itself. + xct._properties["buildPhases"].insert(prebuild_index, ssbp) + prebuild_index = prebuild_index + 1 + + # Extra rule inputs also go into the project file. Concrete outputs were + # already added when they were computed. + groups = ["inputs", "inputs_excluded"] + if skip_excluded_files: + groups = [x for x in groups if not x.endswith("_excluded")] + for group in groups: + for item in rule.get(group, []): + pbxp.AddOrGetFileInRootGroup(item) + + # Add "sources". + for source in spec.get("sources", []): + (source_root, source_extension) = posixpath.splitext(source) + if source_extension[1:] not in rules_by_ext: + # AddSourceToTarget will add the file to a root group if it's not + # already there. + AddSourceToTarget(source, type, pbxp, xct) + else: + pbxp.AddOrGetFileInRootGroup(source) + + # Add "mac_bundle_resources" and "mac_framework_private_headers" if + # it's a bundle of any type. + if is_bundle: + for resource in tgt_mac_bundle_resources: + (resource_root, resource_extension) = posixpath.splitext(resource) + if resource_extension[1:] not in rules_by_ext: + AddResourceToTarget(resource, pbxp, xct) + else: + pbxp.AddOrGetFileInRootGroup(resource) + + for header in spec.get("mac_framework_private_headers", []): + AddHeaderToTarget(header, pbxp, xct, False) + + # Add "mac_framework_headers". These can be valid for both frameworks + # and static libraries. + if is_bundle or type == "static_library": + for header in spec.get("mac_framework_headers", []): + AddHeaderToTarget(header, pbxp, xct, True) + + # Add "copies". + pbxcp_dict = {} + for copy_group in spec.get("copies", []): + dest = copy_group["destination"] + if dest[0] not in ("/", "$"): + # Relative paths are relative to $(SRCROOT). + dest = "$(SRCROOT)/" + dest + + code_sign = int(copy_group.get("xcode_code_sign", 0)) + settings = (None, "{ATTRIBUTES = (CodeSignOnCopy, ); }")[code_sign] + + # Coalesce multiple "copies" sections in the same target with the same + # "destination" property into the same PBXCopyFilesBuildPhase, otherwise + # they'll wind up with ID collisions. + pbxcp = pbxcp_dict.get(dest, None) + if pbxcp is None: + pbxcp = gyp.xcodeproj_file.PBXCopyFilesBuildPhase( + {"name": "Copy to " + copy_group["destination"]}, parent=xct + ) + pbxcp.SetDestination(dest) + + # TODO(mark): The usual comment about this knowing too much about + # gyp.xcodeproj_file internals applies. + xct._properties["buildPhases"].insert(prebuild_index, pbxcp) + + pbxcp_dict[dest] = pbxcp + + for file in copy_group["files"]: + pbxcp.AddFile(file, settings) + + # Excluded files can also go into the project file. + if not skip_excluded_files: + for key in [ + "sources", + "mac_bundle_resources", + "mac_framework_headers", + "mac_framework_private_headers", + ]: + excluded_key = key + "_excluded" + for item in spec.get(excluded_key, []): + pbxp.AddOrGetFileInRootGroup(item) + + # So can "inputs" and "outputs" sections of "actions" groups. + groups = ["inputs", "inputs_excluded", "outputs", "outputs_excluded"] + if skip_excluded_files: + groups = [x for x in groups if not x.endswith("_excluded")] + for action in spec.get("actions", []): + for group in groups: + for item in action.get(group, []): + # Exclude anything in BUILT_PRODUCTS_DIR. They're products, not + # sources. + if not item.startswith("$(BUILT_PRODUCTS_DIR)/"): + pbxp.AddOrGetFileInRootGroup(item) + + for postbuild in spec.get("postbuilds", []): + action_string_sh = gyp.common.EncodePOSIXShellList(postbuild["action"]) + script = "exec " + action_string_sh + "\nexit 1\n" + + # Make the postbuild step depend on the output of ld or ar from this + # target. Apparently putting the script step after the link step isn't + # sufficient to ensure proper ordering in all cases. With an input + # declared but no outputs, the script step should run every time, as + # desired. + ssbp = gyp.xcodeproj_file.PBXShellScriptBuildPhase( + { + "inputPaths": ["$(BUILT_PRODUCTS_DIR)/$(EXECUTABLE_PATH)"], + "name": 'Postbuild "' + postbuild["postbuild_name"] + '"', + "shellScript": script, + "showEnvVarsInLog": 0, + } + ) + xct.AppendProperty("buildPhases", ssbp) + + # Add dependencies before libraries, because adding a dependency may imply + # adding a library. It's preferable to keep dependencies listed first + # during a link phase so that they can override symbols that would + # otherwise be provided by libraries, which will usually include system + # libraries. On some systems, ld is finicky and even requires the + # libraries to be ordered in such a way that unresolved symbols in + # earlier-listed libraries may only be resolved by later-listed libraries. + # The Mac linker doesn't work that way, but other platforms do, and so + # their linker invocations need to be constructed in this way. There's + # no compelling reason for Xcode's linker invocations to differ. + + if "dependencies" in spec: + for dependency in spec["dependencies"]: + xct.AddDependency(xcode_targets[dependency]) + # The support project also gets the dependencies (in case they are + # needed for the actions/rules to work). + if support_xct: + support_xct.AddDependency(xcode_targets[dependency]) + + if "libraries" in spec: + for library in spec["libraries"]: + xct.FrameworksPhase().AddFile(library) + # Add the library's directory to LIBRARY_SEARCH_PATHS if necessary. + # I wish Xcode handled this automatically. + library_dir = posixpath.dirname(library) + if library_dir not in xcode_standard_library_dirs and ( + not xct.HasBuildSetting(_library_search_paths_var) + or library_dir not in xct.GetBuildSetting(_library_search_paths_var) + ): + xct.AppendBuildSetting(_library_search_paths_var, library_dir) + + for configuration_name in configuration_names: + configuration = spec["configurations"][configuration_name] + xcbc = xct.ConfigurationNamed(configuration_name) + for include_dir in configuration.get("mac_framework_dirs", []): + xcbc.AppendBuildSetting("FRAMEWORK_SEARCH_PATHS", include_dir) + for include_dir in configuration.get("include_dirs", []): + xcbc.AppendBuildSetting("HEADER_SEARCH_PATHS", include_dir) + for library_dir in configuration.get("library_dirs", []): + if library_dir not in xcode_standard_library_dirs and ( + not xcbc.HasBuildSetting(_library_search_paths_var) + or library_dir + not in xcbc.GetBuildSetting(_library_search_paths_var) + ): + xcbc.AppendBuildSetting(_library_search_paths_var, library_dir) + + if "defines" in configuration: + for define in configuration["defines"]: + set_define = EscapeXcodeDefine(define) + xcbc.AppendBuildSetting("GCC_PREPROCESSOR_DEFINITIONS", set_define) + if "xcode_settings" in configuration: + for xck, xcv in configuration["xcode_settings"].items(): + xcbc.SetBuildSetting(xck, xcv) + if "xcode_config_file" in configuration: + config_ref = pbxp.AddOrGetFileInRootGroup( + configuration["xcode_config_file"] + ) + xcbc.SetBaseConfiguration(config_ref) + + build_files = [] + for build_file, build_file_dict in data.items(): + if build_file.endswith(".gyp"): + build_files.append(build_file) + + for build_file in build_files: + xcode_projects[build_file].Finalize1(xcode_targets, serialize_all_tests) + + for build_file in build_files: + xcode_projects[build_file].Finalize2(xcode_targets, xcode_target_to_target_dict) + + for build_file in build_files: + xcode_projects[build_file].Write() diff --git a/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/xcode_test.py b/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/xcode_test.py index 260324a43f3e23..51fbca6a2a28f0 100644 --- a/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/xcode_test.py +++ b/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/xcode_test.py @@ -12,12 +12,14 @@ class TestEscapeXcodeDefine(unittest.TestCase): - if sys.platform == 'darwin': - def test_InheritedRemainsUnescaped(self): - self.assertEqual(xcode.EscapeXcodeDefine('$(inherited)'), '$(inherited)') + if sys.platform == "darwin": - def test_Escaping(self): - self.assertEqual(xcode.EscapeXcodeDefine('a b"c\\'), 'a\\ b\\"c\\\\') + def test_InheritedRemainsUnescaped(self): + self.assertEqual(xcode.EscapeXcodeDefine("$(inherited)"), "$(inherited)") -if __name__ == '__main__': - unittest.main() + def test_Escaping(self): + self.assertEqual(xcode.EscapeXcodeDefine('a b"c\\'), 'a\\ b\\"c\\\\') + + +if __name__ == "__main__": + unittest.main() diff --git a/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/input.py b/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/input.py index d1742800ac507e..00c4ee1f96a03c 100644 --- a/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/input.py +++ b/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/input.py @@ -9,7 +9,6 @@ import gyp.common import gyp.simple_copy import multiprocessing -import optparse import os.path import re import shlex @@ -17,8 +16,8 @@ import subprocess import sys import threading -import time import traceback +from distutils.version import StrictVersion from gyp.common import GypError from gyp.common import OrderedSet @@ -26,27 +25,28 @@ # A list of types that are treated as linkable. linkable_types = [ - 'executable', - 'shared_library', - 'loadable_module', - 'mac_kernel_extension', + "executable", + "shared_library", + "loadable_module", + "mac_kernel_extension", + "windows_driver", ] # A list of sections that contain links to other targets. -dependency_sections = ['dependencies', 'export_dependent_settings'] +dependency_sections = ["dependencies", "export_dependent_settings"] # base_path_sections is a list of sections defined by GYP that contain # pathnames. The generators can provide more keys, the two lists are merged # into path_sections, but you should call IsPathSection instead of using either # list directly. base_path_sections = [ - 'destination', - 'files', - 'include_dirs', - 'inputs', - 'libraries', - 'outputs', - 'sources', + "destination", + "files", + "include_dirs", + "inputs", + "libraries", + "outputs", + "sources", ] path_sections = set() @@ -55,77 +55,78 @@ per_process_data = {} per_process_aux_data = {} + def IsPathSection(section): - # If section ends in one of the '=+?!' characters, it's applied to a section - # without the trailing characters. '/' is notably absent from this list, - # because there's no way for a regular expression to be treated as a path. - while section and section[-1:] in '=+?!': - section = section[:-1] - - if section in path_sections: - return True - - # Sections mathing the regexp '_(dir|file|path)s?$' are also - # considered PathSections. Using manual string matching since that - # is much faster than the regexp and this can be called hundreds of - # thousands of times so micro performance matters. - if "_" in section: - tail = section[-6:] - if tail[-1] == 's': - tail = tail[:-1] - if tail[-5:] in ('_file', '_path'): - return True - return tail[-4:] == '_dir' - - return False + # If section ends in one of the '=+?!' characters, it's applied to a section + # without the trailing characters. '/' is notably absent from this list, + # because there's no way for a regular expression to be treated as a path. + while section and section[-1:] in "=+?!": + section = section[:-1] + + if section in path_sections: + return True + + # Sections mathing the regexp '_(dir|file|path)s?$' are also + # considered PathSections. Using manual string matching since that + # is much faster than the regexp and this can be called hundreds of + # thousands of times so micro performance matters. + if "_" in section: + tail = section[-6:] + if tail[-1] == "s": + tail = tail[:-1] + if tail[-5:] in ("_file", "_path"): + return True + return tail[-4:] == "_dir" + + return False + # base_non_configuration_keys is a list of key names that belong in the target # itself and should not be propagated into its configurations. It is merged # with a list that can come from the generator to # create non_configuration_keys. base_non_configuration_keys = [ - # Sections that must exist inside targets and not configurations. - 'actions', - 'configurations', - 'copies', - 'default_configuration', - 'dependencies', - 'dependencies_original', - 'libraries', - 'postbuilds', - 'product_dir', - 'product_extension', - 'product_name', - 'product_prefix', - 'rules', - 'run_as', - 'sources', - 'standalone_static_library', - 'suppress_wildcard', - 'target_name', - 'toolset', - 'toolsets', - 'type', - - # Sections that can be found inside targets or configurations, but that - # should not be propagated from targets into their configurations. - 'variables', + # Sections that must exist inside targets and not configurations. + "actions", + "configurations", + "copies", + "default_configuration", + "dependencies", + "dependencies_original", + "libraries", + "postbuilds", + "product_dir", + "product_extension", + "product_name", + "product_prefix", + "rules", + "run_as", + "sources", + "standalone_static_library", + "suppress_wildcard", + "target_name", + "toolset", + "toolsets", + "type", + # Sections that can be found inside targets or configurations, but that + # should not be propagated from targets into their configurations. + "variables", ] non_configuration_keys = [] # Keys that do not belong inside a configuration dictionary. invalid_configuration_keys = [ - 'actions', - 'all_dependent_settings', - 'configurations', - 'dependencies', - 'direct_dependent_settings', - 'libraries', - 'link_settings', - 'sources', - 'standalone_static_library', - 'target_name', - 'type', + "actions", + "all_dependent_settings", + "configurations", + "dependencies", + "direct_dependent_settings", + "libraries", + "link_settings", + "sources", + "standalone_static_library", + "target_name", + "type", ] # Controls whether or not the generator supports multiple toolsets. @@ -137,8 +138,9 @@ def IsPathSection(section): # } generator_filelist_paths = None + def GetIncludedBuildFiles(build_file_path, aux_data, included=None): - """Return a list of all build files included into build_file_path. + """Return a list of all build files included into build_file_path. The returned list will contain build_file_path as well as all other files that it included, either directly or indirectly. Note that the list may @@ -156,537 +158,595 @@ def GetIncludedBuildFiles(build_file_path, aux_data, included=None): in the list will be relative to the current directory. """ - if included is None: - included = [] + if included is None: + included = [] - if build_file_path in included: - return included + if build_file_path in included: + return included - included.append(build_file_path) + included.append(build_file_path) - for included_build_file in aux_data[build_file_path].get('included', []): - GetIncludedBuildFiles(included_build_file, aux_data, included) + for included_build_file in aux_data[build_file_path].get("included", []): + GetIncludedBuildFiles(included_build_file, aux_data, included) - return included + return included def CheckedEval(file_contents): - """Return the eval of a gyp file. - + """Return the eval of a gyp file. The gyp file is restricted to dictionaries and lists only, and repeated keys are not allowed. - Note that this is slower than eval() is. """ - syntax_tree = ast.parse(file_contents) - assert isinstance(syntax_tree, ast.Module) - c1 = syntax_tree.body - assert len(c1) == 1 - c2 = c1[0] - assert isinstance(c2, ast.Expr) - return CheckNode(c2.value, []) + syntax_tree = ast.parse(file_contents) + assert isinstance(syntax_tree, ast.Module) + c1 = syntax_tree.body + assert len(c1) == 1 + c2 = c1[0] + assert isinstance(c2, ast.Expr) + return CheckNode(c2.value, []) def CheckNode(node, keypath): - if isinstance(node, ast.Dict): - c = node.getChildren() - dict = {} - for key, value in zip(node.keys, node.values): - assert isinstance(key, ast.Str) - key = key.s - if key in dict: - raise GypError("Key '" + key + "' repeated at level " + - repr(len(keypath) + 1) + " with key path '" + - '.'.join(keypath) + "'") - kp = list(keypath) # Make a copy of the list for descending this node. - kp.append(key) - dict[key] = CheckNode(value, kp) - return dict - elif isinstance(node, ast.List): - children = [] - for index, child in enumerate(node.elts): - kp = list(keypath) # Copy list. - kp.append(repr(index)) - children.append(CheckNode(child, kp)) - return children - elif isinstance(node, ast.Str): - return node.s - else: - raise TypeError("Unknown AST node at key path '" + '.'.join(keypath) + - "': " + repr(node)) - - -def LoadOneBuildFile(build_file_path, data, aux_data, includes, - is_target, check): - if build_file_path in data: - return data[build_file_path] - - if os.path.exists(build_file_path): - # Open the build file for read ('r') with universal-newlines mode ('U') - # to make sure platform specific newlines ('\r\n' or '\r') are converted to '\n' - # which otherwise will fail eval() - if sys.platform == 'zos': - # On z/OS, universal-newlines mode treats the file as an ascii file. But since - # node-gyp produces ebcdic files, do not use that mode. - build_file_contents = open(build_file_path, 'r').read() + if isinstance(node, ast.Dict): + dict = {} + for key, value in zip(node.keys, node.values): + assert isinstance(key, ast.Str) + key = key.s + if key in dict: + raise GypError( + "Key '" + + key + + "' repeated at level " + + repr(len(keypath) + 1) + + " with key path '" + + ".".join(keypath) + + "'" + ) + kp = list(keypath) # Make a copy of the list for descending this node. + kp.append(key) + dict[key] = CheckNode(value, kp) + return dict + elif isinstance(node, ast.List): + children = [] + for index, child in enumerate(node.elts): + kp = list(keypath) # Copy list. + kp.append(repr(index)) + children.append(CheckNode(child, kp)) + return children + elif isinstance(node, ast.Str): + return node.s else: - build_file_contents = open(build_file_path, 'rU').read() - else: - raise GypError("%s not found (cwd: %s)" % (build_file_path, os.getcwd())) - - build_file_data = None - try: - if check: - build_file_data = CheckedEval(build_file_contents) + raise TypeError( + "Unknown AST node at key path '" + ".".join(keypath) + "': " + repr(node) + ) + + +def LoadOneBuildFile(build_file_path, data, aux_data, includes, is_target, check): + if build_file_path in data: + return data[build_file_path] + + if os.path.exists(build_file_path): + # Open the build file for read ('r') with universal-newlines mode ('U') + # to make sure platform specific newlines ('\r\n' or '\r') are converted to '\n' + # which otherwise will fail eval() + if sys.platform == "zos": + # On z/OS, universal-newlines mode treats the file as an ascii file. But since + # node-gyp produces ebcdic files, do not use that mode. + build_file_contents = open(build_file_path, "r").read() + else: + build_file_contents = open(build_file_path, "rU").read() else: - build_file_data = eval(build_file_contents, {'__builtins__': {}}, - None) - except SyntaxError as e: - e.filename = build_file_path - raise - except Exception as e: - gyp.common.ExceptionAppend(e, 'while reading ' + build_file_path) - raise - - if type(build_file_data) is not dict: - raise GypError("%s does not evaluate to a dictionary." % build_file_path) - - data[build_file_path] = build_file_data - aux_data[build_file_path] = {} - - # Scan for includes and merge them in. - if ('skip_includes' not in build_file_data or - not build_file_data['skip_includes']): + raise GypError("%s not found (cwd: %s)" % (build_file_path, os.getcwd())) + + build_file_data = None try: - if is_target: - LoadBuildFileIncludesIntoDict(build_file_data, build_file_path, data, - aux_data, includes, check) - else: - LoadBuildFileIncludesIntoDict(build_file_data, build_file_path, data, - aux_data, None, check) + if check: + build_file_data = CheckedEval(build_file_contents) + else: + build_file_data = eval(build_file_contents, {"__builtins__": {}}, None) + except SyntaxError as e: + e.filename = build_file_path + raise except Exception as e: - gyp.common.ExceptionAppend(e, - 'while reading includes of ' + build_file_path) - raise - - return build_file_data - - -def LoadBuildFileIncludesIntoDict(subdict, subdict_path, data, aux_data, - includes, check): - includes_list = [] - if includes != None: - includes_list.extend(includes) - if 'includes' in subdict: - for include in subdict['includes']: - # "include" is specified relative to subdict_path, so compute the real - # path to include by appending the provided "include" to the directory - # in which subdict_path resides. - relative_include = \ - os.path.normpath(os.path.join(os.path.dirname(subdict_path), include)) - includes_list.append(relative_include) - # Unhook the includes list, it's no longer needed. - del subdict['includes'] - - # Merge in the included files. - for include in includes_list: - if not 'included' in aux_data[subdict_path]: - aux_data[subdict_path]['included'] = [] - aux_data[subdict_path]['included'].append(include) - - gyp.DebugOutput(gyp.DEBUG_INCLUDES, "Loading Included File: '%s'", include) - - MergeDicts(subdict, - LoadOneBuildFile(include, data, aux_data, None, False, check), - subdict_path, include) - - # Recurse into subdictionaries. - for k, v in subdict.items(): - if type(v) is dict: - LoadBuildFileIncludesIntoDict(v, subdict_path, data, aux_data, - None, check) - elif type(v) is list: - LoadBuildFileIncludesIntoList(v, subdict_path, data, aux_data, - check) + gyp.common.ExceptionAppend(e, "while reading " + build_file_path) + raise + + if type(build_file_data) is not dict: + raise GypError("%s does not evaluate to a dictionary." % build_file_path) + + data[build_file_path] = build_file_data + aux_data[build_file_path] = {} + + # Scan for includes and merge them in. + if "skip_includes" not in build_file_data or not build_file_data["skip_includes"]: + try: + if is_target: + LoadBuildFileIncludesIntoDict( + build_file_data, build_file_path, data, aux_data, includes, check + ) + else: + LoadBuildFileIncludesIntoDict( + build_file_data, build_file_path, data, aux_data, None, check + ) + except Exception as e: + gyp.common.ExceptionAppend( + e, "while reading includes of " + build_file_path + ) + raise + + return build_file_data + + +def LoadBuildFileIncludesIntoDict( + subdict, subdict_path, data, aux_data, includes, check +): + includes_list = [] + if includes is not None: + includes_list.extend(includes) + if "includes" in subdict: + for include in subdict["includes"]: + # "include" is specified relative to subdict_path, so compute the real + # path to include by appending the provided "include" to the directory + # in which subdict_path resides. + relative_include = os.path.normpath( + os.path.join(os.path.dirname(subdict_path), include) + ) + includes_list.append(relative_include) + # Unhook the includes list, it's no longer needed. + del subdict["includes"] + + # Merge in the included files. + for include in includes_list: + if "included" not in aux_data[subdict_path]: + aux_data[subdict_path]["included"] = [] + aux_data[subdict_path]["included"].append(include) + + gyp.DebugOutput(gyp.DEBUG_INCLUDES, "Loading Included File: '%s'", include) + + MergeDicts( + subdict, + LoadOneBuildFile(include, data, aux_data, None, False, check), + subdict_path, + include, + ) + + # Recurse into subdictionaries. + for k, v in subdict.items(): + if type(v) is dict: + LoadBuildFileIncludesIntoDict(v, subdict_path, data, aux_data, None, check) + elif type(v) is list: + LoadBuildFileIncludesIntoList(v, subdict_path, data, aux_data, check) # This recurses into lists so that it can look for dicts. def LoadBuildFileIncludesIntoList(sublist, sublist_path, data, aux_data, check): - for item in sublist: - if type(item) is dict: - LoadBuildFileIncludesIntoDict(item, sublist_path, data, aux_data, - None, check) - elif type(item) is list: - LoadBuildFileIncludesIntoList(item, sublist_path, data, aux_data, check) + for item in sublist: + if type(item) is dict: + LoadBuildFileIncludesIntoDict( + item, sublist_path, data, aux_data, None, check + ) + elif type(item) is list: + LoadBuildFileIncludesIntoList(item, sublist_path, data, aux_data, check) + # Processes toolsets in all the targets. This recurses into condition entries # since they can contain toolsets as well. def ProcessToolsetsInDict(data): - if 'targets' in data: - target_list = data['targets'] - new_target_list = [] - for target in target_list: - # If this target already has an explicit 'toolset', and no 'toolsets' - # list, don't modify it further. - if 'toolset' in target and 'toolsets' not in target: - new_target_list.append(target) - continue - if multiple_toolsets: - toolsets = target.get('toolsets', ['target']) - else: - toolsets = ['target'] - # Make sure this 'toolsets' definition is only processed once. - if 'toolsets' in target: - del target['toolsets'] - if len(toolsets) > 0: - # Optimization: only do copies if more than one toolset is specified. - for build in toolsets[1:]: - new_target = gyp.simple_copy.deepcopy(target) - new_target['toolset'] = build - new_target_list.append(new_target) - target['toolset'] = toolsets[0] - new_target_list.append(target) - data['targets'] = new_target_list - if 'conditions' in data: - for condition in data['conditions']: - if type(condition) is list: - for condition_dict in condition[1:]: - if type(condition_dict) is dict: - ProcessToolsetsInDict(condition_dict) + if "targets" in data: + target_list = data["targets"] + new_target_list = [] + for target in target_list: + # If this target already has an explicit 'toolset', and no 'toolsets' + # list, don't modify it further. + if "toolset" in target and "toolsets" not in target: + new_target_list.append(target) + continue + if multiple_toolsets: + toolsets = target.get("toolsets", ["target"]) + else: + toolsets = ["target"] + # Make sure this 'toolsets' definition is only processed once. + if "toolsets" in target: + del target["toolsets"] + if len(toolsets) > 0: + # Optimization: only do copies if more than one toolset is specified. + for build in toolsets[1:]: + new_target = gyp.simple_copy.deepcopy(target) + new_target["toolset"] = build + new_target_list.append(new_target) + target["toolset"] = toolsets[0] + new_target_list.append(target) + data["targets"] = new_target_list + if "conditions" in data: + for condition in data["conditions"]: + if type(condition) is list: + for condition_dict in condition[1:]: + if type(condition_dict) is dict: + ProcessToolsetsInDict(condition_dict) # TODO(mark): I don't love this name. It just means that it's going to load # a build file that contains targets and is expected to provide a targets dict # that contains the targets... -def LoadTargetBuildFile(build_file_path, data, aux_data, variables, includes, - depth, check, load_dependencies): - # If depth is set, predefine the DEPTH variable to be a relative path from - # this build file's directory to the directory identified by depth. - if depth: - # TODO(dglazkov) The backslash/forward-slash replacement at the end is a - # temporary measure. This should really be addressed by keeping all paths - # in POSIX until actual project generation. - d = gyp.common.RelativePath(depth, os.path.dirname(build_file_path)) - if d == '': - variables['DEPTH'] = '.' +def LoadTargetBuildFile( + build_file_path, + data, + aux_data, + variables, + includes, + depth, + check, + load_dependencies, +): + # If depth is set, predefine the DEPTH variable to be a relative path from + # this build file's directory to the directory identified by depth. + if depth: + # TODO(dglazkov) The backslash/forward-slash replacement at the end is a + # temporary measure. This should really be addressed by keeping all paths + # in POSIX until actual project generation. + d = gyp.common.RelativePath(depth, os.path.dirname(build_file_path)) + if d == "": + variables["DEPTH"] = "." + else: + variables["DEPTH"] = d.replace("\\", "/") + + # The 'target_build_files' key is only set when loading target build files in + # the non-parallel code path, where LoadTargetBuildFile is called + # recursively. In the parallel code path, we don't need to check whether the + # |build_file_path| has already been loaded, because the 'scheduled' set in + # ParallelState guarantees that we never load the same |build_file_path| + # twice. + if "target_build_files" in data: + if build_file_path in data["target_build_files"]: + # Already loaded. + return False + data["target_build_files"].add(build_file_path) + + gyp.DebugOutput( + gyp.DEBUG_INCLUDES, "Loading Target Build File '%s'", build_file_path + ) + + build_file_data = LoadOneBuildFile( + build_file_path, data, aux_data, includes, True, check + ) + + # Store DEPTH for later use in generators. + build_file_data["_DEPTH"] = depth + + # Set up the included_files key indicating which .gyp files contributed to + # this target dict. + if "included_files" in build_file_data: + raise GypError(build_file_path + " must not contain included_files key") + + included = GetIncludedBuildFiles(build_file_path, aux_data) + build_file_data["included_files"] = [] + for included_file in included: + # included_file is relative to the current directory, but it needs to + # be made relative to build_file_path's directory. + included_relative = gyp.common.RelativePath( + included_file, os.path.dirname(build_file_path) + ) + build_file_data["included_files"].append(included_relative) + + # Do a first round of toolsets expansion so that conditions can be defined + # per toolset. + ProcessToolsetsInDict(build_file_data) + + # Apply "pre"/"early" variable expansions and condition evaluations. + ProcessVariablesAndConditionsInDict( + build_file_data, PHASE_EARLY, variables, build_file_path + ) + + # Since some toolsets might have been defined conditionally, perform + # a second round of toolsets expansion now. + ProcessToolsetsInDict(build_file_data) + + # Look at each project's target_defaults dict, and merge settings into + # targets. + if "target_defaults" in build_file_data: + if "targets" not in build_file_data: + raise GypError("Unable to find targets in build file %s" % build_file_path) + + index = 0 + while index < len(build_file_data["targets"]): + # This procedure needs to give the impression that target_defaults is + # used as defaults, and the individual targets inherit from that. + # The individual targets need to be merged into the defaults. Make + # a deep copy of the defaults for each target, merge the target dict + # as found in the input file into that copy, and then hook up the + # copy with the target-specific data merged into it as the replacement + # target dict. + old_target_dict = build_file_data["targets"][index] + new_target_dict = gyp.simple_copy.deepcopy( + build_file_data["target_defaults"] + ) + MergeDicts( + new_target_dict, old_target_dict, build_file_path, build_file_path + ) + build_file_data["targets"][index] = new_target_dict + index += 1 + + # No longer needed. + del build_file_data["target_defaults"] + + # Look for dependencies. This means that dependency resolution occurs + # after "pre" conditionals and variable expansion, but before "post" - + # in other words, you can't put a "dependencies" section inside a "post" + # conditional within a target. + + dependencies = [] + if "targets" in build_file_data: + for target_dict in build_file_data["targets"]: + if "dependencies" not in target_dict: + continue + for dependency in target_dict["dependencies"]: + dependencies.append( + gyp.common.ResolveTarget(build_file_path, dependency, None)[0] + ) + + if load_dependencies: + for dependency in dependencies: + try: + LoadTargetBuildFile( + dependency, + data, + aux_data, + variables, + includes, + depth, + check, + load_dependencies, + ) + except Exception as e: + gyp.common.ExceptionAppend( + e, "while loading dependencies of %s" % build_file_path + ) + raise else: - variables['DEPTH'] = d.replace('\\', '/') - - # The 'target_build_files' key is only set when loading target build files in - # the non-parallel code path, where LoadTargetBuildFile is called - # recursively. In the parallel code path, we don't need to check whether the - # |build_file_path| has already been loaded, because the 'scheduled' set in - # ParallelState guarantees that we never load the same |build_file_path| - # twice. - if 'target_build_files' in data: - if build_file_path in data['target_build_files']: - # Already loaded. - return False - data['target_build_files'].add(build_file_path) - - gyp.DebugOutput(gyp.DEBUG_INCLUDES, - "Loading Target Build File '%s'", build_file_path) - - build_file_data = LoadOneBuildFile(build_file_path, data, aux_data, - includes, True, check) - - # Store DEPTH for later use in generators. - build_file_data['_DEPTH'] = depth - - # Set up the included_files key indicating which .gyp files contributed to - # this target dict. - if 'included_files' in build_file_data: - raise GypError(build_file_path + ' must not contain included_files key') - - included = GetIncludedBuildFiles(build_file_path, aux_data) - build_file_data['included_files'] = [] - for included_file in included: - # included_file is relative to the current directory, but it needs to - # be made relative to build_file_path's directory. - included_relative = \ - gyp.common.RelativePath(included_file, - os.path.dirname(build_file_path)) - build_file_data['included_files'].append(included_relative) - - # Do a first round of toolsets expansion so that conditions can be defined - # per toolset. - ProcessToolsetsInDict(build_file_data) - - # Apply "pre"/"early" variable expansions and condition evaluations. - ProcessVariablesAndConditionsInDict( - build_file_data, PHASE_EARLY, variables, build_file_path) - - # Since some toolsets might have been defined conditionally, perform - # a second round of toolsets expansion now. - ProcessToolsetsInDict(build_file_data) - - # Look at each project's target_defaults dict, and merge settings into - # targets. - if 'target_defaults' in build_file_data: - if 'targets' not in build_file_data: - raise GypError("Unable to find targets in build file %s" % - build_file_path) + return (build_file_path, dependencies) - index = 0 - while index < len(build_file_data['targets']): - # This procedure needs to give the impression that target_defaults is - # used as defaults, and the individual targets inherit from that. - # The individual targets need to be merged into the defaults. Make - # a deep copy of the defaults for each target, merge the target dict - # as found in the input file into that copy, and then hook up the - # copy with the target-specific data merged into it as the replacement - # target dict. - old_target_dict = build_file_data['targets'][index] - new_target_dict = gyp.simple_copy.deepcopy( - build_file_data['target_defaults']) - MergeDicts(new_target_dict, old_target_dict, - build_file_path, build_file_path) - build_file_data['targets'][index] = new_target_dict - index += 1 - - # No longer needed. - del build_file_data['target_defaults'] - - # Look for dependencies. This means that dependency resolution occurs - # after "pre" conditionals and variable expansion, but before "post" - - # in other words, you can't put a "dependencies" section inside a "post" - # conditional within a target. - - dependencies = [] - if 'targets' in build_file_data: - for target_dict in build_file_data['targets']: - if 'dependencies' not in target_dict: - continue - for dependency in target_dict['dependencies']: - dependencies.append( - gyp.common.ResolveTarget(build_file_path, dependency, None)[0]) - - if load_dependencies: - for dependency in dependencies: - try: - LoadTargetBuildFile(dependency, data, aux_data, variables, - includes, depth, check, load_dependencies) - except Exception as e: - gyp.common.ExceptionAppend( - e, 'while loading dependencies of %s' % build_file_path) - raise - else: - return (build_file_path, dependencies) -def CallLoadTargetBuildFile(global_flags, - build_file_path, variables, - includes, depth, check, - generator_input_info): - """Wrapper around LoadTargetBuildFile for parallel processing. +def CallLoadTargetBuildFile( + global_flags, + build_file_path, + variables, + includes, + depth, + check, + generator_input_info, +): + """Wrapper around LoadTargetBuildFile for parallel processing. This wrapper is used when LoadTargetBuildFile is executed in a worker process. """ - try: - signal.signal(signal.SIGINT, signal.SIG_IGN) - - # Apply globals so that the worker process behaves the same. - for key, value in global_flags.items(): - globals()[key] = value - - SetGeneratorGlobals(generator_input_info) - result = LoadTargetBuildFile(build_file_path, per_process_data, - per_process_aux_data, variables, - includes, depth, check, False) - if not result: - return result - - (build_file_path, dependencies) = result - - # We can safely pop the build_file_data from per_process_data because it - # will never be referenced by this process again, so we don't need to keep - # it in the cache. - build_file_data = per_process_data.pop(build_file_path) - - # This gets serialized and sent back to the main process via a pipe. - # It's handled in LoadTargetBuildFileCallback. - return (build_file_path, - build_file_data, - dependencies) - except GypError as e: - sys.stderr.write("gyp: %s\n" % e) - return None - except Exception as e: - print('Exception:', e, file=sys.stderr) - print(traceback.format_exc(), file=sys.stderr) - return None + try: + signal.signal(signal.SIGINT, signal.SIG_IGN) + + # Apply globals so that the worker process behaves the same. + for key, value in global_flags.items(): + globals()[key] = value + + SetGeneratorGlobals(generator_input_info) + result = LoadTargetBuildFile( + build_file_path, + per_process_data, + per_process_aux_data, + variables, + includes, + depth, + check, + False, + ) + if not result: + return result + + (build_file_path, dependencies) = result + + # We can safely pop the build_file_data from per_process_data because it + # will never be referenced by this process again, so we don't need to keep + # it in the cache. + build_file_data = per_process_data.pop(build_file_path) + + # This gets serialized and sent back to the main process via a pipe. + # It's handled in LoadTargetBuildFileCallback. + return (build_file_path, build_file_data, dependencies) + except GypError as e: + sys.stderr.write("gyp: %s\n" % e) + return None + except Exception as e: + print("Exception:", e, file=sys.stderr) + print(traceback.format_exc(), file=sys.stderr) + return None class ParallelProcessingError(Exception): - pass + pass class ParallelState(object): - """Class to keep track of state when processing input files in parallel. + """Class to keep track of state when processing input files in parallel. If build files are loaded in parallel, use this to keep track of state during farming out and processing parallel jobs. It's stored in a global so that the callback function can have access to it. """ - def __init__(self): - # The multiprocessing pool. - self.pool = None - # The condition variable used to protect this object and notify - # the main loop when there might be more data to process. - self.condition = None - # The "data" dict that was passed to LoadTargetBuildFileParallel - self.data = None - # The number of parallel calls outstanding; decremented when a response - # was received. - self.pending = 0 - # The set of all build files that have been scheduled, so we don't - # schedule the same one twice. - self.scheduled = set() - # A list of dependency build file paths that haven't been scheduled yet. - self.dependencies = [] - # Flag to indicate if there was an error in a child process. - self.error = False - - def LoadTargetBuildFileCallback(self, result): - """Handle the results of running LoadTargetBuildFile in another process. + def __init__(self): + # The multiprocessing pool. + self.pool = None + # The condition variable used to protect this object and notify + # the main loop when there might be more data to process. + self.condition = None + # The "data" dict that was passed to LoadTargetBuildFileParallel + self.data = None + # The number of parallel calls outstanding; decremented when a response + # was received. + self.pending = 0 + # The set of all build files that have been scheduled, so we don't + # schedule the same one twice. + self.scheduled = set() + # A list of dependency build file paths that haven't been scheduled yet. + self.dependencies = [] + # Flag to indicate if there was an error in a child process. + self.error = False + + def LoadTargetBuildFileCallback(self, result): + """Handle the results of running LoadTargetBuildFile in another process. """ - self.condition.acquire() - if not result: - self.error = True - self.condition.notify() - self.condition.release() - return - (build_file_path0, build_file_data0, dependencies0) = result - self.data[build_file_path0] = build_file_data0 - self.data['target_build_files'].add(build_file_path0) - for new_dependency in dependencies0: - if new_dependency not in self.scheduled: - self.scheduled.add(new_dependency) - self.dependencies.append(new_dependency) - self.pending -= 1 - self.condition.notify() - self.condition.release() - - -def LoadTargetBuildFilesParallel(build_files, data, variables, includes, depth, - check, generator_input_info): - parallel_state = ParallelState() - parallel_state.condition = threading.Condition() - # Make copies of the build_files argument that we can modify while working. - parallel_state.dependencies = list(build_files) - parallel_state.scheduled = set(build_files) - parallel_state.pending = 0 - parallel_state.data = data - - try: - parallel_state.condition.acquire() - while parallel_state.dependencies or parallel_state.pending: - if parallel_state.error: - break - if not parallel_state.dependencies: - parallel_state.condition.wait() - continue - - dependency = parallel_state.dependencies.pop() - - parallel_state.pending += 1 - global_flags = { - 'path_sections': globals()['path_sections'], - 'non_configuration_keys': globals()['non_configuration_keys'], - 'multiple_toolsets': globals()['multiple_toolsets']} - - if not parallel_state.pool: - parallel_state.pool = multiprocessing.Pool(multiprocessing.cpu_count()) - parallel_state.pool.apply_async( - CallLoadTargetBuildFile, - args = (global_flags, dependency, - variables, includes, depth, check, generator_input_info), - callback = parallel_state.LoadTargetBuildFileCallback) - except KeyboardInterrupt as e: - parallel_state.pool.terminate() - raise e - - parallel_state.condition.release() - - parallel_state.pool.close() - parallel_state.pool.join() - parallel_state.pool = None - - if parallel_state.error: - sys.exit(1) + self.condition.acquire() + if not result: + self.error = True + self.condition.notify() + self.condition.release() + return + (build_file_path0, build_file_data0, dependencies0) = result + self.data[build_file_path0] = build_file_data0 + self.data["target_build_files"].add(build_file_path0) + for new_dependency in dependencies0: + if new_dependency not in self.scheduled: + self.scheduled.add(new_dependency) + self.dependencies.append(new_dependency) + self.pending -= 1 + self.condition.notify() + self.condition.release() + + +def LoadTargetBuildFilesParallel( + build_files, data, variables, includes, depth, check, generator_input_info +): + parallel_state = ParallelState() + parallel_state.condition = threading.Condition() + # Make copies of the build_files argument that we can modify while working. + parallel_state.dependencies = list(build_files) + parallel_state.scheduled = set(build_files) + parallel_state.pending = 0 + parallel_state.data = data + + try: + parallel_state.condition.acquire() + while parallel_state.dependencies or parallel_state.pending: + if parallel_state.error: + break + if not parallel_state.dependencies: + parallel_state.condition.wait() + continue + + dependency = parallel_state.dependencies.pop() + + parallel_state.pending += 1 + global_flags = { + "path_sections": globals()["path_sections"], + "non_configuration_keys": globals()["non_configuration_keys"], + "multiple_toolsets": globals()["multiple_toolsets"], + } + + if not parallel_state.pool: + parallel_state.pool = multiprocessing.Pool(multiprocessing.cpu_count()) + parallel_state.pool.apply_async( + CallLoadTargetBuildFile, + args=( + global_flags, + dependency, + variables, + includes, + depth, + check, + generator_input_info, + ), + callback=parallel_state.LoadTargetBuildFileCallback, + ) + except KeyboardInterrupt as e: + parallel_state.pool.terminate() + raise e + + parallel_state.condition.release() + + parallel_state.pool.close() + parallel_state.pool.join() + parallel_state.pool = None + + if parallel_state.error: + sys.exit(1) + # Look for the bracket that matches the first bracket seen in a # string, and return the start and end as a tuple. For example, if # the input is something like "<(foo <(bar)) blah", then it would # return (1, 13), indicating the entire string except for the leading # "<" and trailing " blah". -LBRACKETS= set('{[(') -BRACKETS = {'}': '{', ']': '[', ')': '('} +LBRACKETS = set("{[(") +BRACKETS = {"}": "{", "]": "[", ")": "("} + + def FindEnclosingBracketGroup(input_str): - stack = [] - start = -1 - for index, char in enumerate(input_str): - if char in LBRACKETS: - stack.append(char) - if start == -1: - start = index - elif char in BRACKETS: - if not stack: - return (-1, -1) - if stack.pop() != BRACKETS[char]: - return (-1, -1) - if not stack: - return (start, index + 1) - return (-1, -1) + stack = [] + start = -1 + for index, char in enumerate(input_str): + if char in LBRACKETS: + stack.append(char) + if start == -1: + start = index + elif char in BRACKETS: + if not stack: + return (-1, -1) + if stack.pop() != BRACKETS[char]: + return (-1, -1) + if not stack: + return (start, index + 1) + return (-1, -1) def IsStrCanonicalInt(string): - """Returns True if |string| is in its canonical integer form. + """Returns True if |string| is in its canonical integer form. The canonical form is such that str(int(string)) == string. """ - if type(string) is str: - # This function is called a lot so for maximum performance, avoid - # involving regexps which would otherwise make the code much - # shorter. Regexps would need twice the time of this function. - if string: - if string == "0": - return True - if string[0] == "-": - string = string[1:] - if not string: - return False - if '1' <= string[0] <= '9': - return string.isdigit() - - return False + if type(string) is str: + # This function is called a lot so for maximum performance, avoid + # involving regexps which would otherwise make the code much + # shorter. Regexps would need twice the time of this function. + if string: + if string == "0": + return True + if string[0] == "-": + string = string[1:] + if not string: + return False + if "1" <= string[0] <= "9": + return string.isdigit() + + return False # This matches things like "<(asdf)", "(?P<(?:(?:!?@?)|\|)?)' - r'(?P[-a-zA-Z0-9_.]+)?' - r'\((?P\s*\[?)' - r'(?P.*?)(\]?)\))') + r"(?P(?P<(?:(?:!?@?)|\|)?)" + r"(?P[-a-zA-Z0-9_.]+)?" + r"\((?P\s*\[?)" + r"(?P.*?)(\]?)\))" +) # This matches the same as early_variable_re, but with '>' instead of '<'. late_variable_re = re.compile( - r'(?P(?P>(?:(?:!?@?)|\|)?)' - r'(?P[-a-zA-Z0-9_.]+)?' - r'\((?P\s*\[?)' - r'(?P.*?)(\]?)\))') + r"(?P(?P>(?:(?:!?@?)|\|)?)" + r"(?P[-a-zA-Z0-9_.]+)?" + r"\((?P\s*\[?)" + r"(?P.*?)(\]?)\))" +) # This matches the same as early_variable_re, but with '^' instead of '<'. latelate_variable_re = re.compile( - r'(?P(?P[\^](?:(?:!?@?)|\|)?)' - r'(?P[-a-zA-Z0-9_.]+)?' - r'\((?P\s*\[?)' - r'(?P.*?)(\]?)\))') + r"(?P(?P[\^](?:(?:!?@?)|\|)?)" + r"(?P[-a-zA-Z0-9_.]+)?" + r"\((?P\s*\[?)" + r"(?P.*?)(\]?)\))" +) # Global cache of results from running commands so they don't have to be run # more then once. @@ -694,12 +754,12 @@ def IsStrCanonicalInt(string): def FixupPlatformCommand(cmd): - if sys.platform == 'win32': - if type(cmd) is list: - cmd = [re.sub('^cat ', 'type ', cmd[0])] + cmd[1:] - else: - cmd = re.sub('^cat ', 'type ', cmd) - return cmd + if sys.platform == "win32": + if type(cmd) is list: + cmd = [re.sub("^cat ", "type ", cmd[0])] + cmd[1:] + else: + cmd = re.sub("^cat ", "type ", cmd) + return cmd PHASE_EARLY = 0 @@ -708,637 +768,702 @@ def FixupPlatformCommand(cmd): def ExpandVariables(input, phase, variables, build_file): - # Look for the pattern that gets expanded into variables - if phase == PHASE_EARLY: - variable_re = early_variable_re - expansion_symbol = '<' - elif phase == PHASE_LATE: - variable_re = late_variable_re - expansion_symbol = '>' - elif phase == PHASE_LATELATE: - variable_re = latelate_variable_re - expansion_symbol = '^' - else: - assert False - - input_str = str(input) - if IsStrCanonicalInt(input_str): - return int(input_str) - - # Do a quick scan to determine if an expensive regex search is warranted. - if expansion_symbol not in input_str: - return input_str - - # Get the entire list of matches as a list of MatchObject instances. - # (using findall here would return strings instead of MatchObjects). - matches = list(variable_re.finditer(input_str)) - if not matches: - return input_str - - output = input_str - # Reverse the list of matches so that replacements are done right-to-left. - # That ensures that earlier replacements won't mess up the string in a - # way that causes later calls to find the earlier substituted text instead - # of what's intended for replacement. - matches.reverse() - for match_group in matches: - match = match_group.groupdict() - gyp.DebugOutput(gyp.DEBUG_VARIABLES, "Matches: %r", match) - # match['replace'] is the substring to look for, match['type'] - # is the character code for the replacement type (< > ! <| >| <@ - # >@ !@), match['is_array'] contains a '[' for command - # arrays, and match['content'] is the name of the variable (< >) - # or command to run (!). match['command_string'] is an optional - # command string. Currently, only 'pymod_do_main' is supported. - - # run_command is true if a ! variant is used. - run_command = '!' in match['type'] - command_string = match['command_string'] - - # file_list is true if a | variant is used. - file_list = '|' in match['type'] - - # Capture these now so we can adjust them later. - replace_start = match_group.start('replace') - replace_end = match_group.end('replace') - - # Find the ending paren, and re-evaluate the contained string. - (c_start, c_end) = FindEnclosingBracketGroup(input_str[replace_start:]) - - # Adjust the replacement range to match the entire command - # found by FindEnclosingBracketGroup (since the variable_re - # probably doesn't match the entire command if it contained - # nested variables). - replace_end = replace_start + c_end - - # Find the "real" replacement, matching the appropriate closing - # paren, and adjust the replacement start and end. - replacement = input_str[replace_start:replace_end] - - # Figure out what the contents of the variable parens are. - contents_start = replace_start + c_start + 1 - contents_end = replace_end - 1 - contents = input_str[contents_start:contents_end] - - # Do filter substitution now for <|(). - # Admittedly, this is different than the evaluation order in other - # contexts. However, since filtration has no chance to run on <|(), - # this seems like the only obvious way to give them access to filters. - if file_list: - processed_variables = gyp.simple_copy.deepcopy(variables) - ProcessListFiltersInDict(contents, processed_variables) - # Recurse to expand variables in the contents - contents = ExpandVariables(contents, phase, - processed_variables, build_file) + # Look for the pattern that gets expanded into variables + if phase == PHASE_EARLY: + variable_re = early_variable_re + expansion_symbol = "<" + elif phase == PHASE_LATE: + variable_re = late_variable_re + expansion_symbol = ">" + elif phase == PHASE_LATELATE: + variable_re = latelate_variable_re + expansion_symbol = "^" else: - # Recurse to expand variables in the contents - contents = ExpandVariables(contents, phase, variables, build_file) - - # Strip off leading/trailing whitespace so that variable matches are - # simpler below (and because they are rarely needed). - contents = contents.strip() - - # expand_to_list is true if an @ variant is used. In that case, - # the expansion should result in a list. Note that the caller - # is to be expecting a list in return, and not all callers do - # because not all are working in list context. Also, for list - # expansions, there can be no other text besides the variable - # expansion in the input string. - expand_to_list = '@' in match['type'] and input_str == replacement - - if run_command or file_list: - # Find the build file's directory, so commands can be run or file lists - # generated relative to it. - build_file_dir = os.path.dirname(build_file) - if build_file_dir == '' and not file_list: - # If build_file is just a leaf filename indicating a file in the - # current directory, build_file_dir might be an empty string. Set - # it to None to signal to subprocess.Popen that it should run the - # command in the current directory. - build_file_dir = None - - # Support <|(listfile.txt ...) which generates a file - # containing items from a gyp list, generated at gyp time. - # This works around actions/rules which have more inputs than will - # fit on the command line. - if file_list: - if type(contents) is list: - contents_list = contents - else: - contents_list = contents.split(' ') - replacement = contents_list[0] - if os.path.isabs(replacement): - raise GypError('| cannot handle absolute paths, got "%s"' % replacement) - - if not generator_filelist_paths: - path = os.path.join(build_file_dir, replacement) - else: - if os.path.isabs(build_file_dir): - toplevel = generator_filelist_paths['toplevel'] - rel_build_file_dir = gyp.common.RelativePath(build_file_dir, toplevel) + assert False + + input_str = str(input) + if IsStrCanonicalInt(input_str): + return int(input_str) + + # Do a quick scan to determine if an expensive regex search is warranted. + if expansion_symbol not in input_str: + return input_str + + # Get the entire list of matches as a list of MatchObject instances. + # (using findall here would return strings instead of MatchObjects). + matches = list(variable_re.finditer(input_str)) + if not matches: + return input_str + + output = input_str + # Reverse the list of matches so that replacements are done right-to-left. + # That ensures that earlier replacements won't mess up the string in a + # way that causes later calls to find the earlier substituted text instead + # of what's intended for replacement. + matches.reverse() + for match_group in matches: + match = match_group.groupdict() + gyp.DebugOutput(gyp.DEBUG_VARIABLES, "Matches: %r", match) + # match['replace'] is the substring to look for, match['type'] + # is the character code for the replacement type (< > ! <| >| <@ + # >@ !@), match['is_array'] contains a '[' for command + # arrays, and match['content'] is the name of the variable (< >) + # or command to run (!). match['command_string'] is an optional + # command string. Currently, only 'pymod_do_main' is supported. + + # run_command is true if a ! variant is used. + run_command = "!" in match["type"] + command_string = match["command_string"] + + # file_list is true if a | variant is used. + file_list = "|" in match["type"] + + # Capture these now so we can adjust them later. + replace_start = match_group.start("replace") + replace_end = match_group.end("replace") + + # Find the ending paren, and re-evaluate the contained string. + (c_start, c_end) = FindEnclosingBracketGroup(input_str[replace_start:]) + + # Adjust the replacement range to match the entire command + # found by FindEnclosingBracketGroup (since the variable_re + # probably doesn't match the entire command if it contained + # nested variables). + replace_end = replace_start + c_end + + # Find the "real" replacement, matching the appropriate closing + # paren, and adjust the replacement start and end. + replacement = input_str[replace_start:replace_end] + + # Figure out what the contents of the variable parens are. + contents_start = replace_start + c_start + 1 + contents_end = replace_end - 1 + contents = input_str[contents_start:contents_end] + + # Do filter substitution now for <|(). + # Admittedly, this is different than the evaluation order in other + # contexts. However, since filtration has no chance to run on <|(), + # this seems like the only obvious way to give them access to filters. + if file_list: + processed_variables = gyp.simple_copy.deepcopy(variables) + ProcessListFiltersInDict(contents, processed_variables) + # Recurse to expand variables in the contents + contents = ExpandVariables(contents, phase, processed_variables, build_file) else: - rel_build_file_dir = build_file_dir - qualified_out_dir = generator_filelist_paths['qualified_out_dir'] - path = os.path.join(qualified_out_dir, rel_build_file_dir, replacement) - gyp.common.EnsureDirExists(path) - - replacement = gyp.common.RelativePath(path, build_file_dir) - f = gyp.common.WriteOnDiff(path) - for i in contents_list[1:]: - f.write('%s\n' % i) - f.close() - - elif run_command: - use_shell = True - if match['is_array']: - contents = eval(contents) - use_shell = False - - # Check for a cached value to avoid executing commands, or generating - # file lists more than once. The cache key contains the command to be - # run as well as the directory to run it from, to account for commands - # that depend on their current directory. - # TODO(http://code.google.com/p/gyp/issues/detail?id=111): In theory, - # someone could author a set of GYP files where each time the command - # is invoked it produces different output by design. When the need - # arises, the syntax should be extended to support no caching off a - # command's output so it is run every time. - cache_key = (str(contents), build_file_dir) - cached_value = cached_command_results.get(cache_key, None) - if cached_value is None: - gyp.DebugOutput(gyp.DEBUG_VARIABLES, - "Executing command '%s' in directory '%s'", - contents, build_file_dir) - - replacement = '' - - if command_string == 'pymod_do_main': - # (sources/) etc. to resolve to - # and empty list if undefined. This allows actions to: - # 'action!': [ - # '>@(_sources!)', - # ], - # 'action/': [ - # '>@(_sources/)', - # ], - replacement = [] else: - raise GypError('Undefined variable ' + contents + - ' in ' + build_file) - else: - replacement = variables[contents] - - if isinstance(replacement, bytes) and not isinstance(replacement, str): - replacement = replacement.decode("utf-8") # done on Python 3 only - if type(replacement) is list: - for item in replacement: - if isinstance(item, bytes) and not isinstance(item, str): - item = item.decode("utf-8") # done on Python 3 only - if not contents[-1] == '/' and type(item) not in (str, int): - raise GypError('Variable ' + contents + - ' must expand to a string or list of strings; ' + - 'list contains a ' + - item.__class__.__name__) - # Run through the list and handle variable expansions in it. Since - # the list is guaranteed not to contain dicts, this won't do anything - # with conditions sections. - ProcessVariablesAndConditionsInList(replacement, phase, variables, - build_file) - elif type(replacement) not in (str, int): - raise GypError('Variable ' + contents + - ' must expand to a string or list of strings; ' + - 'found a ' + replacement.__class__.__name__) - - if expand_to_list: - # Expanding in list context. It's guaranteed that there's only one - # replacement to do in |input_str| and that it's this replacement. See - # above. - if type(replacement) is list: - # If it's already a list, make a copy. - output = replacement[:] - else: - # Split it the same way sh would split arguments. - output = shlex.split(str(replacement)) + if contents not in variables: + if contents[-1] in ["!", "/"]: + # In order to allow cross-compiles (nacl) to happen more naturally, + # we will allow references to >(sources/) etc. to resolve to + # and empty list if undefined. This allows actions to: + # 'action!': [ + # '>@(_sources!)', + # ], + # 'action/': [ + # '>@(_sources/)', + # ], + replacement = [] + else: + raise GypError( + "Undefined variable " + contents + " in " + build_file + ) + else: + replacement = variables[contents] + + if isinstance(replacement, bytes) and not isinstance(replacement, str): + replacement = replacement.decode("utf-8") # done on Python 3 only + if type(replacement) is list: + for item in replacement: + if isinstance(item, bytes) and not isinstance(item, str): + item = item.decode("utf-8") # done on Python 3 only + if not contents[-1] == "/" and type(item) not in (str, int): + raise GypError( + "Variable " + + contents + + " must expand to a string or list of strings; " + + "list contains a " + + item.__class__.__name__ + ) + # Run through the list and handle variable expansions in it. Since + # the list is guaranteed not to contain dicts, this won't do anything + # with conditions sections. + ProcessVariablesAndConditionsInList( + replacement, phase, variables, build_file + ) + elif type(replacement) not in (str, int): + raise GypError( + "Variable " + + contents + + " must expand to a string or list of strings; " + + "found a " + + replacement.__class__.__name__ + ) + + if expand_to_list: + # Expanding in list context. It's guaranteed that there's only one + # replacement to do in |input_str| and that it's this replacement. See + # above. + if type(replacement) is list: + # If it's already a list, make a copy. + output = replacement[:] + else: + # Split it the same way sh would split arguments. + output = shlex.split(str(replacement)) + else: + # Expanding in string context. + encoded_replacement = "" + if type(replacement) is list: + # When expanding a list into string context, turn the list items + # into a string in a way that will work with a subprocess call. + # + # TODO(mark): This isn't completely correct. This should + # call a generator-provided function that observes the + # proper list-to-argument quoting rules on a specific + # platform instead of just calling the POSIX encoding + # routine. + encoded_replacement = gyp.common.EncodePOSIXShellList(replacement) + else: + encoded_replacement = replacement + + output = ( + output[:replace_start] + str(encoded_replacement) + output[replace_end:] + ) + # Prepare for the next match iteration. + input_str = output + + if output == input: + gyp.DebugOutput( + gyp.DEBUG_VARIABLES, + "Found only identity matches on %r, avoiding infinite " "recursion.", + output, + ) else: - # Expanding in string context. - encoded_replacement = '' - if type(replacement) is list: - # When expanding a list into string context, turn the list items - # into a string in a way that will work with a subprocess call. - # - # TODO(mark): This isn't completely correct. This should - # call a generator-provided function that observes the - # proper list-to-argument quoting rules on a specific - # platform instead of just calling the POSIX encoding - # routine. - encoded_replacement = gyp.common.EncodePOSIXShellList(replacement) - else: - encoded_replacement = replacement - - output = output[:replace_start] + str(encoded_replacement) + \ - output[replace_end:] - # Prepare for the next match iteration. - input_str = output - - if output == input: - gyp.DebugOutput(gyp.DEBUG_VARIABLES, - "Found only identity matches on %r, avoiding infinite " - "recursion.", - output) - else: - # Look for more matches now that we've replaced some, to deal with - # expanding local variables (variables defined in the same - # variables block as this one). - gyp.DebugOutput(gyp.DEBUG_VARIABLES, "Found output %r, recursing.", output) + # Look for more matches now that we've replaced some, to deal with + # expanding local variables (variables defined in the same + # variables block as this one). + gyp.DebugOutput(gyp.DEBUG_VARIABLES, "Found output %r, recursing.", output) + if type(output) is list: + if output and type(output[0]) is list: + # Leave output alone if it's a list of lists. + # We don't want such lists to be stringified. + pass + else: + new_output = [] + for item in output: + new_output.append( + ExpandVariables(item, phase, variables, build_file) + ) + output = new_output + else: + output = ExpandVariables(output, phase, variables, build_file) + + # Convert all strings that are canonically-represented integers into integers. if type(output) is list: - if output and type(output[0]) is list: - # Leave output alone if it's a list of lists. - # We don't want such lists to be stringified. - pass - else: - new_output = [] - for item in output: - new_output.append( - ExpandVariables(item, phase, variables, build_file)) - output = new_output - else: - output = ExpandVariables(output, phase, variables, build_file) + for index, outstr in enumerate(output): + if IsStrCanonicalInt(outstr): + output[index] = int(outstr) + elif IsStrCanonicalInt(output): + output = int(output) - # Convert all strings that are canonically-represented integers into integers. - if type(output) is list: - for index in range(0, len(output)): - if IsStrCanonicalInt(output[index]): - output[index] = int(output[index]) - elif IsStrCanonicalInt(output): - output = int(output) + return output - return output # The same condition is often evaluated over and over again so it # makes sense to cache as much as possible between evaluations. cached_conditions_asts = {} + def EvalCondition(condition, conditions_key, phase, variables, build_file): - """Returns the dict that should be used or None if the result was + """Returns the dict that should be used or None if the result was that nothing should be used.""" - if type(condition) is not list: - raise GypError(conditions_key + ' must be a list') - if len(condition) < 2: - # It's possible that condition[0] won't work in which case this - # attempt will raise its own IndexError. That's probably fine. - raise GypError(conditions_key + ' ' + condition[0] + - ' must be at least length 2, not ' + str(len(condition))) - - i = 0 - result = None - while i < len(condition): - cond_expr = condition[i] - true_dict = condition[i + 1] - if type(true_dict) is not dict: - raise GypError('{} {} must be followed by a dictionary, not {}'.format( - conditions_key, cond_expr, type(true_dict))) - if len(condition) > i + 2 and type(condition[i + 2]) is dict: - false_dict = condition[i + 2] - i = i + 3 - if i != len(condition): - raise GypError('{} {} has {} unexpected trailing items'.format( - conditions_key, cond_expr, len(condition) - i)) - else: - false_dict = None - i = i + 2 - if result is None: - result = EvalSingleCondition( - cond_expr, true_dict, false_dict, phase, variables, build_file) + if type(condition) is not list: + raise GypError(conditions_key + " must be a list") + if len(condition) < 2: + # It's possible that condition[0] won't work in which case this + # attempt will raise its own IndexError. That's probably fine. + raise GypError( + conditions_key + + " " + + condition[0] + + " must be at least length 2, not " + + str(len(condition)) + ) + + i = 0 + result = None + while i < len(condition): + cond_expr = condition[i] + true_dict = condition[i + 1] + if type(true_dict) is not dict: + raise GypError( + "{} {} must be followed by a dictionary, not {}".format( + conditions_key, cond_expr, type(true_dict) + ) + ) + if len(condition) > i + 2 and type(condition[i + 2]) is dict: + false_dict = condition[i + 2] + i = i + 3 + if i != len(condition): + raise GypError( + "{} {} has {} unexpected trailing items".format( + conditions_key, cond_expr, len(condition) - i + ) + ) + else: + false_dict = None + i = i + 2 + if result is None: + result = EvalSingleCondition( + cond_expr, true_dict, false_dict, phase, variables, build_file + ) - return result + return result -def EvalSingleCondition( - cond_expr, true_dict, false_dict, phase, variables, build_file): - """Returns true_dict if cond_expr evaluates to true, and false_dict +def EvalSingleCondition(cond_expr, true_dict, false_dict, phase, variables, build_file): + """Returns true_dict if cond_expr evaluates to true, and false_dict otherwise.""" - # Do expansions on the condition itself. Since the condition can naturally - # contain variable references without needing to resort to GYP expansion - # syntax, this is of dubious value for variables, but someone might want to - # use a command expansion directly inside a condition. - cond_expr_expanded = ExpandVariables(cond_expr, phase, variables, - build_file) - if type(cond_expr_expanded) not in (str, int): - raise ValueError( - 'Variable expansion in this context permits str and int ' + \ - 'only, found ' + cond_expr_expanded.__class__.__name__) - - try: - if cond_expr_expanded in cached_conditions_asts: - ast_code = cached_conditions_asts[cond_expr_expanded] - else: - ast_code = compile(cond_expr_expanded, '', 'eval') - cached_conditions_asts[cond_expr_expanded] = ast_code - if eval(ast_code, {'__builtins__': {}}, variables): - return true_dict - return false_dict - except SyntaxError as e: - syntax_error = SyntaxError('%s while evaluating condition \'%s\' in %s ' - 'at character %d.' % - (str(e.args[0]), e.text, build_file, e.offset), - e.filename, e.lineno, e.offset, e.text) - raise syntax_error - except NameError as e: - gyp.common.ExceptionAppend(e, 'while evaluating condition \'%s\' in %s' % - (cond_expr_expanded, build_file)) - raise GypError(e) + # Do expansions on the condition itself. Since the condition can naturally + # contain variable references without needing to resort to GYP expansion + # syntax, this is of dubious value for variables, but someone might want to + # use a command expansion directly inside a condition. + cond_expr_expanded = ExpandVariables(cond_expr, phase, variables, build_file) + if type(cond_expr_expanded) not in (str, int): + raise ValueError( + "Variable expansion in this context permits str and int " + + "only, found " + + cond_expr_expanded.__class__.__name__ + ) + + try: + if cond_expr_expanded in cached_conditions_asts: + ast_code = cached_conditions_asts[cond_expr_expanded] + else: + ast_code = compile(cond_expr_expanded, "", "eval") + cached_conditions_asts[cond_expr_expanded] = ast_code + env = {"__builtins__": {}, "v": StrictVersion} + if eval(ast_code, env, variables): + return true_dict + return false_dict + except SyntaxError as e: + syntax_error = SyntaxError( + "%s while evaluating condition '%s' in %s " + "at character %d." % (str(e.args[0]), e.text, build_file, e.offset), + e.filename, + e.lineno, + e.offset, + e.text, + ) + raise syntax_error + except NameError as e: + gyp.common.ExceptionAppend( + e, + "while evaluating condition '%s' in %s" % (cond_expr_expanded, build_file), + ) + raise GypError(e) def ProcessConditionsInDict(the_dict, phase, variables, build_file): - # Process a 'conditions' or 'target_conditions' section in the_dict, - # depending on phase. - # early -> conditions - # late -> target_conditions - # latelate -> no conditions - # - # Each item in a conditions list consists of cond_expr, a string expression - # evaluated as the condition, and true_dict, a dict that will be merged into - # the_dict if cond_expr evaluates to true. Optionally, a third item, - # false_dict, may be present. false_dict is merged into the_dict if - # cond_expr evaluates to false. - # - # Any dict merged into the_dict will be recursively processed for nested - # conditionals and other expansions, also according to phase, immediately - # prior to being merged. - - if phase == PHASE_EARLY: - conditions_key = 'conditions' - elif phase == PHASE_LATE: - conditions_key = 'target_conditions' - elif phase == PHASE_LATELATE: - return - else: - assert False - - if not conditions_key in the_dict: - return - - conditions_list = the_dict[conditions_key] - # Unhook the conditions list, it's no longer needed. - del the_dict[conditions_key] - - for condition in conditions_list: - merge_dict = EvalCondition(condition, conditions_key, phase, variables, - build_file) - - if merge_dict != None: - # Expand variables and nested conditinals in the merge_dict before - # merging it. - ProcessVariablesAndConditionsInDict(merge_dict, phase, - variables, build_file) - - MergeDicts(the_dict, merge_dict, build_file, build_file) + # Process a 'conditions' or 'target_conditions' section in the_dict, + # depending on phase. + # early -> conditions + # late -> target_conditions + # latelate -> no conditions + # + # Each item in a conditions list consists of cond_expr, a string expression + # evaluated as the condition, and true_dict, a dict that will be merged into + # the_dict if cond_expr evaluates to true. Optionally, a third item, + # false_dict, may be present. false_dict is merged into the_dict if + # cond_expr evaluates to false. + # + # Any dict merged into the_dict will be recursively processed for nested + # conditionals and other expansions, also according to phase, immediately + # prior to being merged. + + if phase == PHASE_EARLY: + conditions_key = "conditions" + elif phase == PHASE_LATE: + conditions_key = "target_conditions" + elif phase == PHASE_LATELATE: + return + else: + assert False + + if conditions_key not in the_dict: + return + + conditions_list = the_dict[conditions_key] + # Unhook the conditions list, it's no longer needed. + del the_dict[conditions_key] + + for condition in conditions_list: + merge_dict = EvalCondition( + condition, conditions_key, phase, variables, build_file + ) + + if merge_dict is not None: + # Expand variables and nested conditinals in the merge_dict before + # merging it. + ProcessVariablesAndConditionsInDict( + merge_dict, phase, variables, build_file + ) + + MergeDicts(the_dict, merge_dict, build_file, build_file) def LoadAutomaticVariablesFromDict(variables, the_dict): - # Any keys with plain string values in the_dict become automatic variables. - # The variable name is the key name with a "_" character prepended. - for key, value in the_dict.items(): - if type(value) in (str, int, list): - variables['_' + key] = value + # Any keys with plain string values in the_dict become automatic variables. + # The variable name is the key name with a "_" character prepended. + for key, value in the_dict.items(): + if type(value) in (str, int, list): + variables["_" + key] = value def LoadVariablesFromVariablesDict(variables, the_dict, the_dict_key): - # Any keys in the_dict's "variables" dict, if it has one, becomes a - # variable. The variable name is the key name in the "variables" dict. - # Variables that end with the % character are set only if they are unset in - # the variables dict. the_dict_key is the name of the key that accesses - # the_dict in the_dict's parent dict. If the_dict's parent is not a dict - # (it could be a list or it could be parentless because it is a root dict), - # the_dict_key will be None. - for key, value in the_dict.get('variables', {}).items(): - if type(value) not in (str, int, list): - continue - - if key.endswith('%'): - variable_name = key[:-1] - if variable_name in variables: - # If the variable is already set, don't set it. - continue - if the_dict_key == 'variables' and variable_name in the_dict: - # If the variable is set without a % in the_dict, and the_dict is a - # variables dict (making |variables| a variables sub-dict of a - # variables dict), use the_dict's definition. - value = the_dict[variable_name] - else: - variable_name = key + # Any keys in the_dict's "variables" dict, if it has one, becomes a + # variable. The variable name is the key name in the "variables" dict. + # Variables that end with the % character are set only if they are unset in + # the variables dict. the_dict_key is the name of the key that accesses + # the_dict in the_dict's parent dict. If the_dict's parent is not a dict + # (it could be a list or it could be parentless because it is a root dict), + # the_dict_key will be None. + for key, value in the_dict.get("variables", {}).items(): + if type(value) not in (str, int, list): + continue + + if key.endswith("%"): + variable_name = key[:-1] + if variable_name in variables: + # If the variable is already set, don't set it. + continue + if the_dict_key == "variables" and variable_name in the_dict: + # If the variable is set without a % in the_dict, and the_dict is a + # variables dict (making |variables| a variables sub-dict of a + # variables dict), use the_dict's definition. + value = the_dict[variable_name] + else: + variable_name = key - variables[variable_name] = value + variables[variable_name] = value -def ProcessVariablesAndConditionsInDict(the_dict, phase, variables_in, - build_file, the_dict_key=None): - """Handle all variable and command expansion and conditional evaluation. +def ProcessVariablesAndConditionsInDict( + the_dict, phase, variables_in, build_file, the_dict_key=None +): + """Handle all variable and command expansion and conditional evaluation. This function is the public entry point for all variable expansions and conditional evaluations. The variables_in dictionary will not be modified by this function. """ - # Make a copy of the variables_in dict that can be modified during the - # loading of automatics and the loading of the variables dict. - variables = variables_in.copy() - LoadAutomaticVariablesFromDict(variables, the_dict) - - if 'variables' in the_dict: - # Make sure all the local variables are added to the variables - # list before we process them so that you can reference one - # variable from another. They will be fully expanded by recursion - # in ExpandVariables. - for key, value in the_dict['variables'].items(): - variables[key] = value - - # Handle the associated variables dict first, so that any variable - # references within can be resolved prior to using them as variables. - # Pass a copy of the variables dict to avoid having it be tainted. - # Otherwise, it would have extra automatics added for everything that - # should just be an ordinary variable in this scope. - ProcessVariablesAndConditionsInDict(the_dict['variables'], phase, - variables, build_file, 'variables') - - LoadVariablesFromVariablesDict(variables, the_dict, the_dict_key) - - for key, value in the_dict.items(): - # Skip "variables", which was already processed if present. - if key != 'variables' and type(value) is str: - expanded = ExpandVariables(value, phase, variables, build_file) - if type(expanded) not in (str, int): - raise ValueError( - 'Variable expansion in this context permits str and int ' + \ - 'only, found ' + expanded.__class__.__name__ + ' for ' + key) - the_dict[key] = expanded - - # Variable expansion may have resulted in changes to automatics. Reload. - # TODO(mark): Optimization: only reload if no changes were made. - variables = variables_in.copy() - LoadAutomaticVariablesFromDict(variables, the_dict) - LoadVariablesFromVariablesDict(variables, the_dict, the_dict_key) - - # Process conditions in this dict. This is done after variable expansion - # so that conditions may take advantage of expanded variables. For example, - # if the_dict contains: - # {'type': '<(library_type)', - # 'conditions': [['_type=="static_library"', { ... }]]}, - # _type, as used in the condition, will only be set to the value of - # library_type if variable expansion is performed before condition - # processing. However, condition processing should occur prior to recursion - # so that variables (both automatic and "variables" dict type) may be - # adjusted by conditions sections, merged into the_dict, and have the - # intended impact on contained dicts. - # - # This arrangement means that a "conditions" section containing a "variables" - # section will only have those variables effective in subdicts, not in - # the_dict. The workaround is to put a "conditions" section within a - # "variables" section. For example: - # {'conditions': [['os=="mac"', {'variables': {'define': 'IS_MAC'}}]], - # 'defines': ['<(define)'], - # 'my_subdict': {'defines': ['<(define)']}}, - # will not result in "IS_MAC" being appended to the "defines" list in the - # current scope but would result in it being appended to the "defines" list - # within "my_subdict". By comparison: - # {'variables': {'conditions': [['os=="mac"', {'define': 'IS_MAC'}]]}, - # 'defines': ['<(define)'], - # 'my_subdict': {'defines': ['<(define)']}}, - # will append "IS_MAC" to both "defines" lists. - - # Evaluate conditions sections, allowing variable expansions within them - # as well as nested conditionals. This will process a 'conditions' or - # 'target_conditions' section, perform appropriate merging and recursive - # conditional and variable processing, and then remove the conditions section - # from the_dict if it is present. - ProcessConditionsInDict(the_dict, phase, variables, build_file) - - # Conditional processing may have resulted in changes to automatics or the - # variables dict. Reload. - variables = variables_in.copy() - LoadAutomaticVariablesFromDict(variables, the_dict) - LoadVariablesFromVariablesDict(variables, the_dict, the_dict_key) - - # Recurse into child dicts, or process child lists which may result in - # further recursion into descendant dicts. - for key, value in the_dict.items(): - # Skip "variables" and string values, which were already processed if - # present. - if key == 'variables' or type(value) is str: - continue - if type(value) is dict: - # Pass a copy of the variables dict so that subdicts can't influence - # parents. - ProcessVariablesAndConditionsInDict(value, phase, variables, - build_file, key) - elif type(value) is list: - # The list itself can't influence the variables dict, and - # ProcessVariablesAndConditionsInList will make copies of the variables - # dict if it needs to pass it to something that can influence it. No - # copy is necessary here. - ProcessVariablesAndConditionsInList(value, phase, variables, - build_file) - elif type(value) is not int: - raise TypeError('Unknown type ' + value.__class__.__name__ + \ - ' for ' + key) - - -def ProcessVariablesAndConditionsInList(the_list, phase, variables, - build_file): - # Iterate using an index so that new values can be assigned into the_list. - index = 0 - while index < len(the_list): - item = the_list[index] - if type(item) is dict: - # Make a copy of the variables dict so that it won't influence anything - # outside of its own scope. - ProcessVariablesAndConditionsInDict(item, phase, variables, build_file) - elif type(item) is list: - ProcessVariablesAndConditionsInList(item, phase, variables, build_file) - elif type(item) is str: - expanded = ExpandVariables(item, phase, variables, build_file) - if type(expanded) in (str, int): - the_list[index] = expanded - elif type(expanded) is list: - the_list[index:index+1] = expanded - index += len(expanded) - - # index now identifies the next item to examine. Continue right now - # without falling into the index increment below. - continue - else: - raise ValueError( - 'Variable expansion in this context permits strings and ' + \ - 'lists only, found ' + expanded.__class__.__name__ + ' at ' + \ - index) - elif type(item) is not int: - raise TypeError('Unknown type ' + item.__class__.__name__ + \ - ' at index ' + index) - index = index + 1 + # Make a copy of the variables_in dict that can be modified during the + # loading of automatics and the loading of the variables dict. + variables = variables_in.copy() + LoadAutomaticVariablesFromDict(variables, the_dict) + + if "variables" in the_dict: + # Make sure all the local variables are added to the variables + # list before we process them so that you can reference one + # variable from another. They will be fully expanded by recursion + # in ExpandVariables. + for key, value in the_dict["variables"].items(): + variables[key] = value + + # Handle the associated variables dict first, so that any variable + # references within can be resolved prior to using them as variables. + # Pass a copy of the variables dict to avoid having it be tainted. + # Otherwise, it would have extra automatics added for everything that + # should just be an ordinary variable in this scope. + ProcessVariablesAndConditionsInDict( + the_dict["variables"], phase, variables, build_file, "variables" + ) + + LoadVariablesFromVariablesDict(variables, the_dict, the_dict_key) + + for key, value in the_dict.items(): + # Skip "variables", which was already processed if present. + if key != "variables" and type(value) is str: + expanded = ExpandVariables(value, phase, variables, build_file) + if type(expanded) not in (str, int): + raise ValueError( + "Variable expansion in this context permits str and int " + + "only, found " + + expanded.__class__.__name__ + + " for " + + key + ) + the_dict[key] = expanded + + # Variable expansion may have resulted in changes to automatics. Reload. + # TODO(mark): Optimization: only reload if no changes were made. + variables = variables_in.copy() + LoadAutomaticVariablesFromDict(variables, the_dict) + LoadVariablesFromVariablesDict(variables, the_dict, the_dict_key) + + # Process conditions in this dict. This is done after variable expansion + # so that conditions may take advantage of expanded variables. For example, + # if the_dict contains: + # {'type': '<(library_type)', + # 'conditions': [['_type=="static_library"', { ... }]]}, + # _type, as used in the condition, will only be set to the value of + # library_type if variable expansion is performed before condition + # processing. However, condition processing should occur prior to recursion + # so that variables (both automatic and "variables" dict type) may be + # adjusted by conditions sections, merged into the_dict, and have the + # intended impact on contained dicts. + # + # This arrangement means that a "conditions" section containing a "variables" + # section will only have those variables effective in subdicts, not in + # the_dict. The workaround is to put a "conditions" section within a + # "variables" section. For example: + # {'conditions': [['os=="mac"', {'variables': {'define': 'IS_MAC'}}]], + # 'defines': ['<(define)'], + # 'my_subdict': {'defines': ['<(define)']}}, + # will not result in "IS_MAC" being appended to the "defines" list in the + # current scope but would result in it being appended to the "defines" list + # within "my_subdict". By comparison: + # {'variables': {'conditions': [['os=="mac"', {'define': 'IS_MAC'}]]}, + # 'defines': ['<(define)'], + # 'my_subdict': {'defines': ['<(define)']}}, + # will append "IS_MAC" to both "defines" lists. + + # Evaluate conditions sections, allowing variable expansions within them + # as well as nested conditionals. This will process a 'conditions' or + # 'target_conditions' section, perform appropriate merging and recursive + # conditional and variable processing, and then remove the conditions section + # from the_dict if it is present. + ProcessConditionsInDict(the_dict, phase, variables, build_file) + + # Conditional processing may have resulted in changes to automatics or the + # variables dict. Reload. + variables = variables_in.copy() + LoadAutomaticVariablesFromDict(variables, the_dict) + LoadVariablesFromVariablesDict(variables, the_dict, the_dict_key) + + # Recurse into child dicts, or process child lists which may result in + # further recursion into descendant dicts. + for key, value in the_dict.items(): + # Skip "variables" and string values, which were already processed if + # present. + if key == "variables" or type(value) is str: + continue + if type(value) is dict: + # Pass a copy of the variables dict so that subdicts can't influence + # parents. + ProcessVariablesAndConditionsInDict( + value, phase, variables, build_file, key + ) + elif type(value) is list: + # The list itself can't influence the variables dict, and + # ProcessVariablesAndConditionsInList will make copies of the variables + # dict if it needs to pass it to something that can influence it. No + # copy is necessary here. + ProcessVariablesAndConditionsInList(value, phase, variables, build_file) + elif type(value) is not int: + raise TypeError("Unknown type " + value.__class__.__name__ + " for " + key) + + +def ProcessVariablesAndConditionsInList(the_list, phase, variables, build_file): + # Iterate using an index so that new values can be assigned into the_list. + index = 0 + while index < len(the_list): + item = the_list[index] + if type(item) is dict: + # Make a copy of the variables dict so that it won't influence anything + # outside of its own scope. + ProcessVariablesAndConditionsInDict(item, phase, variables, build_file) + elif type(item) is list: + ProcessVariablesAndConditionsInList(item, phase, variables, build_file) + elif type(item) is str: + expanded = ExpandVariables(item, phase, variables, build_file) + if type(expanded) in (str, int): + the_list[index] = expanded + elif type(expanded) is list: + the_list[index : index + 1] = expanded + index += len(expanded) + + # index now identifies the next item to examine. Continue right now + # without falling into the index increment below. + continue + else: + raise ValueError( + "Variable expansion in this context permits strings and " + + "lists only, found " + + expanded.__class__.__name__ + + " at " + + index + ) + elif type(item) is not int: + raise TypeError( + "Unknown type " + item.__class__.__name__ + " at index " + index + ) + index = index + 1 def BuildTargetsDict(data): - """Builds a dict mapping fully-qualified target names to their target dicts. + """Builds a dict mapping fully-qualified target names to their target dicts. |data| is a dict mapping loaded build files by pathname relative to the current directory. Values in |data| are build file contents. For each @@ -1350,21 +1475,21 @@ def BuildTargetsDict(data): the dicts in the "targets" lists. """ - targets = {} - for build_file in data['target_build_files']: - for target in data[build_file].get('targets', []): - target_name = gyp.common.QualifiedTarget(build_file, - target['target_name'], - target['toolset']) - if target_name in targets: - raise GypError('Duplicate target definitions for ' + target_name) - targets[target_name] = target + targets = {} + for build_file in data["target_build_files"]: + for target in data[build_file].get("targets", []): + target_name = gyp.common.QualifiedTarget( + build_file, target["target_name"], target["toolset"] + ) + if target_name in targets: + raise GypError("Duplicate target definitions for " + target_name) + targets[target_name] = target - return targets + return targets def QualifyDependencies(targets): - """Make dependency links fully-qualified relative to the current directory. + """Make dependency links fully-qualified relative to the current directory. |targets| is a dict mapping fully-qualified target names to their target dicts. For each target in this dict, keys known to contain dependency @@ -1374,36 +1499,46 @@ def QualifyDependencies(targets): similar dict. """ - all_dependency_sections = [dep + op - for dep in dependency_sections - for op in ('', '!', '/')] - - for target, target_dict in targets.items(): - target_build_file = gyp.common.BuildFile(target) - toolset = target_dict['toolset'] - for dependency_key in all_dependency_sections: - dependencies = target_dict.get(dependency_key, []) - for index in range(0, len(dependencies)): - dep_file, dep_target, dep_toolset = gyp.common.ResolveTarget( - target_build_file, dependencies[index], toolset) - if not multiple_toolsets: - # Ignore toolset specification in the dependency if it is specified. - dep_toolset = toolset - dependency = gyp.common.QualifiedTarget(dep_file, - dep_target, - dep_toolset) - dependencies[index] = dependency - - # Make sure anything appearing in a list other than "dependencies" also - # appears in the "dependencies" list. - if dependency_key != 'dependencies' and \ - dependency not in target_dict['dependencies']: - raise GypError('Found ' + dependency + ' in ' + dependency_key + - ' of ' + target + ', but not in dependencies') + all_dependency_sections = [ + dep + op for dep in dependency_sections for op in ("", "!", "/") + ] + + for target, target_dict in targets.items(): + target_build_file = gyp.common.BuildFile(target) + toolset = target_dict["toolset"] + for dependency_key in all_dependency_sections: + dependencies = target_dict.get(dependency_key, []) + for index, dep in enumerate(dependencies): + dep_file, dep_target, dep_toolset = gyp.common.ResolveTarget( + target_build_file, dep, toolset + ) + if not multiple_toolsets: + # Ignore toolset specification in the dependency if it is specified. + dep_toolset = toolset + dependency = gyp.common.QualifiedTarget( + dep_file, dep_target, dep_toolset + ) + dependencies[index] = dependency + + # Make sure anything appearing in a list other than "dependencies" also + # appears in the "dependencies" list. + if ( + dependency_key != "dependencies" + and dependency not in target_dict["dependencies"] + ): + raise GypError( + "Found " + + dependency + + " in " + + dependency_key + + " of " + + target + + ", but not in dependencies" + ) def ExpandWildcardDependencies(targets, data): - """Expands dependencies specified as build_file:*. + """Expands dependencies specified as build_file:*. For each target in |targets|, examines sections containing links to other targets. If any such section contains a link of the form build_file:*, it @@ -1418,110 +1553,130 @@ def ExpandWildcardDependencies(targets, data): dependency list, must be qualified when this function is called. """ - for target, target_dict in targets.items(): - toolset = target_dict['toolset'] - target_build_file = gyp.common.BuildFile(target) - for dependency_key in dependency_sections: - dependencies = target_dict.get(dependency_key, []) - - # Loop this way instead of "for dependency in" or "for index in range" - # because the dependencies list will be modified within the loop body. - index = 0 - while index < len(dependencies): - (dependency_build_file, dependency_target, dependency_toolset) = \ - gyp.common.ParseQualifiedTarget(dependencies[index]) - if dependency_target != '*' and dependency_toolset != '*': - # Not a wildcard. Keep it moving. - index = index + 1 - continue - - if dependency_build_file == target_build_file: - # It's an error for a target to depend on all other targets in - # the same file, because a target cannot depend on itself. - raise GypError('Found wildcard in ' + dependency_key + ' of ' + - target + ' referring to same build file') - - # Take the wildcard out and adjust the index so that the next - # dependency in the list will be processed the next time through the - # loop. - del dependencies[index] - index = index - 1 - - # Loop through the targets in the other build file, adding them to - # this target's list of dependencies in place of the removed - # wildcard. - dependency_target_dicts = data[dependency_build_file]['targets'] - for dependency_target_dict in dependency_target_dicts: - if int(dependency_target_dict.get('suppress_wildcard', False)): - continue - dependency_target_name = dependency_target_dict['target_name'] - if (dependency_target != '*' and - dependency_target != dependency_target_name): - continue - dependency_target_toolset = dependency_target_dict['toolset'] - if (dependency_toolset != '*' and - dependency_toolset != dependency_target_toolset): - continue - dependency = gyp.common.QualifiedTarget(dependency_build_file, - dependency_target_name, - dependency_target_toolset) - index = index + 1 - dependencies.insert(index, dependency) - - index = index + 1 - - -def Unify(l): - """Removes duplicate elements from l, keeping the first element.""" - seen = {} - return [seen.setdefault(e, e) for e in l if e not in seen] + for target, target_dict in targets.items(): + target_build_file = gyp.common.BuildFile(target) + for dependency_key in dependency_sections: + dependencies = target_dict.get(dependency_key, []) + + # Loop this way instead of "for dependency in" or "for index in range" + # because the dependencies list will be modified within the loop body. + index = 0 + while index < len(dependencies): + ( + dependency_build_file, + dependency_target, + dependency_toolset, + ) = gyp.common.ParseQualifiedTarget(dependencies[index]) + if dependency_target != "*" and dependency_toolset != "*": + # Not a wildcard. Keep it moving. + index = index + 1 + continue + + if dependency_build_file == target_build_file: + # It's an error for a target to depend on all other targets in + # the same file, because a target cannot depend on itself. + raise GypError( + "Found wildcard in " + + dependency_key + + " of " + + target + + " referring to same build file" + ) + + # Take the wildcard out and adjust the index so that the next + # dependency in the list will be processed the next time through the + # loop. + del dependencies[index] + index = index - 1 + + # Loop through the targets in the other build file, adding them to + # this target's list of dependencies in place of the removed + # wildcard. + dependency_target_dicts = data[dependency_build_file]["targets"] + for dependency_target_dict in dependency_target_dicts: + if int(dependency_target_dict.get("suppress_wildcard", False)): + continue + dependency_target_name = dependency_target_dict["target_name"] + if ( + dependency_target != "*" + and dependency_target != dependency_target_name + ): + continue + dependency_target_toolset = dependency_target_dict["toolset"] + if ( + dependency_toolset != "*" + and dependency_toolset != dependency_target_toolset + ): + continue + dependency = gyp.common.QualifiedTarget( + dependency_build_file, + dependency_target_name, + dependency_target_toolset, + ) + index = index + 1 + dependencies.insert(index, dependency) + + index = index + 1 + + +def Unify(items): + """Removes duplicate elements from items, keeping the first element.""" + seen = {} + return [seen.setdefault(e, e) for e in items if e not in seen] def RemoveDuplicateDependencies(targets): - """Makes sure every dependency appears only once in all targets's dependency + """Makes sure every dependency appears only once in all targets's dependency lists.""" - for target_name, target_dict in targets.items(): - for dependency_key in dependency_sections: - dependencies = target_dict.get(dependency_key, []) - if dependencies: - target_dict[dependency_key] = Unify(dependencies) + for target_name, target_dict in targets.items(): + for dependency_key in dependency_sections: + dependencies = target_dict.get(dependency_key, []) + if dependencies: + target_dict[dependency_key] = Unify(dependencies) -def Filter(l, item): - """Removes item from l.""" - res = {} - return [res.setdefault(e, e) for e in l if e != item] +def Filter(items, item): + """Removes item from items.""" + res = {} + return [res.setdefault(e, e) for e in items if e != item] def RemoveSelfDependencies(targets): - """Remove self dependencies from targets that have the prune_self_dependency + """Remove self dependencies from targets that have the prune_self_dependency variable set.""" - for target_name, target_dict in targets.items(): - for dependency_key in dependency_sections: - dependencies = target_dict.get(dependency_key, []) - if dependencies: - for t in dependencies: - if t == target_name: - if targets[t].get('variables', {}).get('prune_self_dependency', 0): - target_dict[dependency_key] = Filter(dependencies, target_name) + for target_name, target_dict in targets.items(): + for dependency_key in dependency_sections: + dependencies = target_dict.get(dependency_key, []) + if dependencies: + for t in dependencies: + if t == target_name: + if ( + targets[t] + .get("variables", {}) + .get("prune_self_dependency", 0) + ): + target_dict[dependency_key] = Filter( + dependencies, target_name + ) def RemoveLinkDependenciesFromNoneTargets(targets): - """Remove dependencies having the 'link_dependency' attribute from the 'none' + """Remove dependencies having the 'link_dependency' attribute from the 'none' targets.""" - for target_name, target_dict in targets.items(): - for dependency_key in dependency_sections: - dependencies = target_dict.get(dependency_key, []) - if dependencies: - for t in dependencies: - if target_dict.get('type', None) == 'none': - if targets[t].get('variables', {}).get('link_dependency', 0): - target_dict[dependency_key] = \ - Filter(target_dict[dependency_key], t) + for target_name, target_dict in targets.items(): + for dependency_key in dependency_sections: + dependencies = target_dict.get(dependency_key, []) + if dependencies: + for t in dependencies: + if target_dict.get("type", None) == "none": + if targets[t].get("variables", {}).get("link_dependency", 0): + target_dict[dependency_key] = Filter( + target_dict[dependency_key], t + ) class DependencyGraphNode(object): - """ + """ Attributes: ref: A reference to an object that this DependencyGraphNode represents. @@ -1529,96 +1684,102 @@ class DependencyGraphNode(object): dependents: List of DependencyGraphNodes that depend on this one. """ - class CircularException(GypError): - pass + class CircularException(GypError): + pass - def __init__(self, ref): - self.ref = ref - self.dependencies = [] - self.dependents = [] - - def __repr__(self): - return '' % self.ref - - def FlattenToList(self): - # flat_list is the sorted list of dependencies - actually, the list items - # are the "ref" attributes of DependencyGraphNodes. Every target will - # appear in flat_list after all of its dependencies, and before all of its - # dependents. - flat_list = OrderedSet() - - # in_degree_zeros is the list of DependencyGraphNodes that have no - # dependencies not in flat_list. Initially, it is a copy of the children - # of this node, because when the graph was built, nodes with no - # dependencies were made implicit dependents of the root node. - in_degree_zeros = set(self.dependents[:]) - - while in_degree_zeros: - # Nodes in in_degree_zeros have no dependencies not in flat_list, so they - # can be appended to flat_list. Take these nodes out of in_degree_zeros - # as work progresses, so that the next node to process from the list can - # always be accessed at a consistent position. - node = in_degree_zeros.pop() - flat_list.add(node.ref) - - # Look at dependents of the node just added to flat_list. Some of them - # may now belong in in_degree_zeros. - for node_dependent in node.dependents: - is_in_degree_zero = True - # TODO: We want to check through the - # node_dependent.dependencies list but if it's long and we - # always start at the beginning, then we get O(n^2) behaviour. - for node_dependent_dependency in node_dependent.dependencies: - if not node_dependent_dependency.ref in flat_list: - # The dependent one or more dependencies not in flat_list. There - # will be more chances to add it to flat_list when examining - # it again as a dependent of those other dependencies, provided - # that there are no cycles. - is_in_degree_zero = False - break - - if is_in_degree_zero: - # All of the dependent's dependencies are already in flat_list. Add - # it to in_degree_zeros where it will be processed in a future - # iteration of the outer loop. - in_degree_zeros.add(node_dependent) - - return list(flat_list) - - def FindCycles(self): - """ + def __init__(self, ref): + self.ref = ref + self.dependencies = [] + self.dependents = [] + + def __repr__(self): + return "" % self.ref + + def FlattenToList(self): + # flat_list is the sorted list of dependencies - actually, the list items + # are the "ref" attributes of DependencyGraphNodes. Every target will + # appear in flat_list after all of its dependencies, and before all of its + # dependents. + flat_list = OrderedSet() + + def ExtractNodeRef(node): + """Extracts the object that the node represents from the given node.""" + return node.ref + + # in_degree_zeros is the list of DependencyGraphNodes that have no + # dependencies not in flat_list. Initially, it is a copy of the children + # of this node, because when the graph was built, nodes with no + # dependencies were made implicit dependents of the root node. + in_degree_zeros = sorted(self.dependents[:], key=ExtractNodeRef) + + while in_degree_zeros: + # Nodes in in_degree_zeros have no dependencies not in flat_list, so they + # can be appended to flat_list. Take these nodes out of in_degree_zeros + # as work progresses, so that the next node to process from the list can + # always be accessed at a consistent position. + node = in_degree_zeros.pop() + flat_list.add(node.ref) + + # Look at dependents of the node just added to flat_list. Some of them + # may now belong in in_degree_zeros. + for node_dependent in sorted(node.dependents, key=ExtractNodeRef): + is_in_degree_zero = True + # TODO: We want to check through the + # node_dependent.dependencies list but if it's long and we + # always start at the beginning, then we get O(n^2) behaviour. + for node_dependent_dependency in sorted( + node_dependent.dependencies, key=ExtractNodeRef + ): + if node_dependent_dependency.ref not in flat_list: + # The dependent one or more dependencies not in flat_list. There + # will be more chances to add it to flat_list when examining + # it again as a dependent of those other dependencies, provided + # that there are no cycles. + is_in_degree_zero = False + break + + if is_in_degree_zero: + # All of the dependent's dependencies are already in flat_list. Add + # it to in_degree_zeros where it will be processed in a future + # iteration of the outer loop. + in_degree_zeros += [node_dependent] + + return list(flat_list) + + def FindCycles(self): + """ Returns a list of cycles in the graph, where each cycle is its own list. """ - results = [] - visited = set() + results = [] + visited = set() - def Visit(node, path): - for child in node.dependents: - if child in path: - results.append([child] + path[:path.index(child) + 1]) - elif not child in visited: - visited.add(child) - Visit(child, [child] + path) + def Visit(node, path): + for child in node.dependents: + if child in path: + results.append([child] + path[: path.index(child) + 1]) + elif child not in visited: + visited.add(child) + Visit(child, [child] + path) - visited.add(self) - Visit(self, [self]) + visited.add(self) + Visit(self, [self]) - return results + return results - def DirectDependencies(self, dependencies=None): - """Returns a list of just direct dependencies.""" - if dependencies is None: - dependencies = [] + def DirectDependencies(self, dependencies=None): + """Returns a list of just direct dependencies.""" + if dependencies is None: + dependencies = [] - for dependency in self.dependencies: - # Check for None, corresponding to the root node. - if dependency.ref != None and dependency.ref not in dependencies: - dependencies.append(dependency.ref) + for dependency in self.dependencies: + # Check for None, corresponding to the root node. + if dependency.ref and dependency.ref not in dependencies: + dependencies.append(dependency.ref) - return dependencies + return dependencies - def _AddImportedDependencies(self, targets, dependencies=None): - """Given a list of direct dependencies, adds indirect dependencies that + def _AddImportedDependencies(self, targets, dependencies=None): + """Given a list of direct dependencies, adds indirect dependencies that other dependencies have declared to export their settings. This method does not operate on self. Rather, it operates on the list @@ -1635,58 +1796,60 @@ def _AddImportedDependencies(self, targets, dependencies=None): public entry point. """ - if dependencies is None: - dependencies = [] - - index = 0 - while index < len(dependencies): - dependency = dependencies[index] - dependency_dict = targets[dependency] - # Add any dependencies whose settings should be imported to the list - # if not already present. Newly-added items will be checked for - # their own imports when the list iteration reaches them. - # Rather than simply appending new items, insert them after the - # dependency that exported them. This is done to more closely match - # the depth-first method used by DeepDependencies. - add_index = 1 - for imported_dependency in \ - dependency_dict.get('export_dependent_settings', []): - if imported_dependency not in dependencies: - dependencies.insert(index + add_index, imported_dependency) - add_index = add_index + 1 - index = index + 1 - - return dependencies - - def DirectAndImportedDependencies(self, targets, dependencies=None): - """Returns a list of a target's direct dependencies and all indirect + if dependencies is None: + dependencies = [] + + index = 0 + while index < len(dependencies): + dependency = dependencies[index] + dependency_dict = targets[dependency] + # Add any dependencies whose settings should be imported to the list + # if not already present. Newly-added items will be checked for + # their own imports when the list iteration reaches them. + # Rather than simply appending new items, insert them after the + # dependency that exported them. This is done to more closely match + # the depth-first method used by DeepDependencies. + add_index = 1 + for imported_dependency in dependency_dict.get( + "export_dependent_settings", [] + ): + if imported_dependency not in dependencies: + dependencies.insert(index + add_index, imported_dependency) + add_index = add_index + 1 + index = index + 1 + + return dependencies + + def DirectAndImportedDependencies(self, targets, dependencies=None): + """Returns a list of a target's direct dependencies and all indirect dependencies that a dependency has advertised settings should be exported through the dependency for. """ - dependencies = self.DirectDependencies(dependencies) - return self._AddImportedDependencies(targets, dependencies) - - def DeepDependencies(self, dependencies=None): - """Returns an OrderedSet of all of a target's dependencies, recursively.""" - if dependencies is None: - # Using a list to get ordered output and a set to do fast "is it - # already added" checks. - dependencies = OrderedSet() - - for dependency in self.dependencies: - # Check for None, corresponding to the root node. - if dependency.ref is None: - continue - if dependency.ref not in dependencies: - dependency.DeepDependencies(dependencies) - dependencies.add(dependency.ref) - - return dependencies - - def _LinkDependenciesInternal(self, targets, include_shared_libraries, - dependencies=None, initial=True): - """Returns an OrderedSet of dependency targets that are linked + dependencies = self.DirectDependencies(dependencies) + return self._AddImportedDependencies(targets, dependencies) + + def DeepDependencies(self, dependencies=None): + """Returns an OrderedSet of all of a target's dependencies, recursively.""" + if dependencies is None: + # Using a list to get ordered output and a set to do fast "is it + # already added" checks. + dependencies = OrderedSet() + + for dependency in self.dependencies: + # Check for None, corresponding to the root node. + if dependency.ref is None: + continue + if dependency.ref not in dependencies: + dependency.DeepDependencies(dependencies) + dependencies.add(dependency.ref) + + return dependencies + + def _LinkDependenciesInternal( + self, targets, include_shared_libraries, dependencies=None, initial=True + ): + """Returns an OrderedSet of dependency targets that are linked into this target. This function has a split personality, depending on the setting of @@ -1700,624 +1863,683 @@ def _LinkDependenciesInternal(self, targets, include_shared_libraries, If |include_shared_libraries| is False, the resulting dependencies will not include shared_library targets that are linked into this target. """ - if dependencies is None: - # Using a list to get ordered output and a set to do fast "is it - # already added" checks. - dependencies = OrderedSet() - - # Check for None, corresponding to the root node. - if self.ref is None: - return dependencies - - # It's kind of sucky that |targets| has to be passed into this function, - # but that's presently the easiest way to access the target dicts so that - # this function can find target types. - - if 'target_name' not in targets[self.ref]: - raise GypError("Missing 'target_name' field in target.") - - if 'type' not in targets[self.ref]: - raise GypError("Missing 'type' field in target %s" % - targets[self.ref]['target_name']) - - target_type = targets[self.ref]['type'] - - is_linkable = target_type in linkable_types - - if initial and not is_linkable: - # If this is the first target being examined and it's not linkable, - # return an empty list of link dependencies, because the link - # dependencies are intended to apply to the target itself (initial is - # True) and this target won't be linked. - return dependencies - - # Don't traverse 'none' targets if explicitly excluded. - if (target_type == 'none' and - not targets[self.ref].get('dependencies_traverse', True)): - dependencies.add(self.ref) - return dependencies - - # Executables, mac kernel extensions and loadable modules are already fully - # and finally linked. Nothing else can be a link dependency of them, there - # can only be dependencies in the sense that a dependent target might run - # an executable or load the loadable_module. - if not initial and target_type in ('executable', 'loadable_module', - 'mac_kernel_extension'): - return dependencies - - # Shared libraries are already fully linked. They should only be included - # in |dependencies| when adjusting static library dependencies (in order to - # link against the shared_library's import lib), but should not be included - # in |dependencies| when propagating link_settings. - # The |include_shared_libraries| flag controls which of these two cases we - # are handling. - if (not initial and target_type == 'shared_library' and - not include_shared_libraries): - return dependencies - - # The target is linkable, add it to the list of link dependencies. - if self.ref not in dependencies: - dependencies.add(self.ref) - if initial or not is_linkable: - # If this is a subsequent target and it's linkable, don't look any - # further for linkable dependencies, as they'll already be linked into - # this target linkable. Always look at dependencies of the initial - # target, and always look at dependencies of non-linkables. - for dependency in self.dependencies: - dependency._LinkDependenciesInternal(targets, - include_shared_libraries, - dependencies, False) - - return dependencies - - def DependenciesForLinkSettings(self, targets): - """ + if dependencies is None: + # Using a list to get ordered output and a set to do fast "is it + # already added" checks. + dependencies = OrderedSet() + + # Check for None, corresponding to the root node. + if self.ref is None: + return dependencies + + # It's kind of sucky that |targets| has to be passed into this function, + # but that's presently the easiest way to access the target dicts so that + # this function can find target types. + + if "target_name" not in targets[self.ref]: + raise GypError("Missing 'target_name' field in target.") + + if "type" not in targets[self.ref]: + raise GypError( + "Missing 'type' field in target %s" % targets[self.ref]["target_name"] + ) + + target_type = targets[self.ref]["type"] + + is_linkable = target_type in linkable_types + + if initial and not is_linkable: + # If this is the first target being examined and it's not linkable, + # return an empty list of link dependencies, because the link + # dependencies are intended to apply to the target itself (initial is + # True) and this target won't be linked. + return dependencies + + # Don't traverse 'none' targets if explicitly excluded. + if target_type == "none" and not targets[self.ref].get( + "dependencies_traverse", True + ): + dependencies.add(self.ref) + return dependencies + + # Executables, mac kernel extensions, windows drivers and loadable modules + # are already fully and finally linked. Nothing else can be a link + # dependency of them, there can only be dependencies in the sense that a + # dependent target might run an executable or load the loadable_module. + if not initial and target_type in ( + "executable", + "loadable_module", + "mac_kernel_extension", + "windows_driver", + ): + return dependencies + + # Shared libraries are already fully linked. They should only be included + # in |dependencies| when adjusting static library dependencies (in order to + # link against the shared_library's import lib), but should not be included + # in |dependencies| when propagating link_settings. + # The |include_shared_libraries| flag controls which of these two cases we + # are handling. + if ( + not initial + and target_type == "shared_library" + and not include_shared_libraries + ): + return dependencies + + # The target is linkable, add it to the list of link dependencies. + if self.ref not in dependencies: + dependencies.add(self.ref) + if initial or not is_linkable: + # If this is a subsequent target and it's linkable, don't look any + # further for linkable dependencies, as they'll already be linked into + # this target linkable. Always look at dependencies of the initial + # target, and always look at dependencies of non-linkables. + for dependency in self.dependencies: + dependency._LinkDependenciesInternal( + targets, include_shared_libraries, dependencies, False + ) + + return dependencies + + def DependenciesForLinkSettings(self, targets): + """ Returns a list of dependency targets whose link_settings should be merged into this target. """ - # TODO(sbaig) Currently, chrome depends on the bug that shared libraries' - # link_settings are propagated. So for now, we will allow it, unless the - # 'allow_sharedlib_linksettings_propagation' flag is explicitly set to - # False. Once chrome is fixed, we can remove this flag. - include_shared_libraries = \ - targets[self.ref].get('allow_sharedlib_linksettings_propagation', True) - return self._LinkDependenciesInternal(targets, include_shared_libraries) - - def DependenciesToLinkAgainst(self, targets): - """ + # TODO(sbaig) Currently, chrome depends on the bug that shared libraries' + # link_settings are propagated. So for now, we will allow it, unless the + # 'allow_sharedlib_linksettings_propagation' flag is explicitly set to + # False. Once chrome is fixed, we can remove this flag. + include_shared_libraries = targets[self.ref].get( + "allow_sharedlib_linksettings_propagation", True + ) + return self._LinkDependenciesInternal(targets, include_shared_libraries) + + def DependenciesToLinkAgainst(self, targets): + """ Returns a list of dependency targets that are linked into this target. """ - return self._LinkDependenciesInternal(targets, True) + return self._LinkDependenciesInternal(targets, True) def BuildDependencyList(targets): - # Create a DependencyGraphNode for each target. Put it into a dict for easy - # access. - dependency_nodes = {} - for target, spec in targets.items(): - if target not in dependency_nodes: - dependency_nodes[target] = DependencyGraphNode(target) - - # Set up the dependency links. Targets that have no dependencies are treated - # as dependent on root_node. - root_node = DependencyGraphNode(None) - for target, spec in targets.items(): - target_node = dependency_nodes[target] - target_build_file = gyp.common.BuildFile(target) - dependencies = spec.get('dependencies') - if not dependencies: - target_node.dependencies = [root_node] - root_node.dependents.append(target_node) - else: - for dependency in dependencies: - dependency_node = dependency_nodes.get(dependency) - if not dependency_node: - raise GypError("Dependency '%s' not found while " - "trying to load target %s" % (dependency, target)) - target_node.dependencies.append(dependency_node) - dependency_node.dependents.append(target_node) - - flat_list = root_node.FlattenToList() - - # If there's anything left unvisited, there must be a circular dependency - # (cycle). - if len(flat_list) != len(targets): - if not root_node.dependents: - # If all targets have dependencies, add the first target as a dependent - # of root_node so that the cycle can be discovered from root_node. - target = targets.keys()[0] - target_node = dependency_nodes[target] - target_node.dependencies.append(root_node) - root_node.dependents.append(target_node) - - cycles = [] - for cycle in root_node.FindCycles(): - paths = [node.ref for node in cycle] - cycles.append('Cycle: %s' % ' -> '.join(paths)) - raise DependencyGraphNode.CircularException( - 'Cycles in dependency graph detected:\n' + '\n'.join(cycles)) - - return [dependency_nodes, flat_list] + # Create a DependencyGraphNode for each target. Put it into a dict for easy + # access. + dependency_nodes = {} + for target, spec in targets.items(): + if target not in dependency_nodes: + dependency_nodes[target] = DependencyGraphNode(target) + + # Set up the dependency links. Targets that have no dependencies are treated + # as dependent on root_node. + root_node = DependencyGraphNode(None) + for target, spec in targets.items(): + target_node = dependency_nodes[target] + dependencies = spec.get("dependencies") + if not dependencies: + target_node.dependencies = [root_node] + root_node.dependents.append(target_node) + else: + for dependency in dependencies: + dependency_node = dependency_nodes.get(dependency) + if not dependency_node: + raise GypError( + "Dependency '%s' not found while " + "trying to load target %s" % (dependency, target) + ) + target_node.dependencies.append(dependency_node) + dependency_node.dependents.append(target_node) + + flat_list = root_node.FlattenToList() + + # If there's anything left unvisited, there must be a circular dependency + # (cycle). + if len(flat_list) != len(targets): + if not root_node.dependents: + # If all targets have dependencies, add the first target as a dependent + # of root_node so that the cycle can be discovered from root_node. + target = next(iter(targets)) + target_node = dependency_nodes[target] + target_node.dependencies.append(root_node) + root_node.dependents.append(target_node) + + cycles = [] + for cycle in root_node.FindCycles(): + paths = [node.ref for node in cycle] + cycles.append("Cycle: %s" % " -> ".join(paths)) + raise DependencyGraphNode.CircularException( + "Cycles in dependency graph detected:\n" + "\n".join(cycles) + ) + + return [dependency_nodes, flat_list] def VerifyNoGYPFileCircularDependencies(targets): - # Create a DependencyGraphNode for each gyp file containing a target. Put - # it into a dict for easy access. - dependency_nodes = {} - for target in targets: - build_file = gyp.common.BuildFile(target) - if not build_file in dependency_nodes: - dependency_nodes[build_file] = DependencyGraphNode(build_file) - - # Set up the dependency links. - for target, spec in targets.items(): - build_file = gyp.common.BuildFile(target) - build_file_node = dependency_nodes[build_file] - target_dependencies = spec.get('dependencies', []) - for dependency in target_dependencies: - try: - dependency_build_file = gyp.common.BuildFile(dependency) - except GypError as e: - gyp.common.ExceptionAppend( - e, 'while computing dependencies of .gyp file %s' % build_file) - raise - - if dependency_build_file == build_file: - # A .gyp file is allowed to refer back to itself. - continue - dependency_node = dependency_nodes.get(dependency_build_file) - if not dependency_node: - raise GypError("Dependency '%s' not found" % dependency_build_file) - if dependency_node not in build_file_node.dependencies: - build_file_node.dependencies.append(dependency_node) - dependency_node.dependents.append(build_file_node) - - - # Files that have no dependencies are treated as dependent on root_node. - root_node = DependencyGraphNode(None) - for build_file_node in dependency_nodes.values(): - if len(build_file_node.dependencies) == 0: - build_file_node.dependencies.append(root_node) - root_node.dependents.append(build_file_node) - - flat_list = root_node.FlattenToList() - - # If there's anything left unvisited, there must be a circular dependency - # (cycle). - if len(flat_list) != len(dependency_nodes): - if not root_node.dependents: - # If all files have dependencies, add the first file as a dependent - # of root_node so that the cycle can be discovered from root_node. - file_node = dependency_nodes.values()[0] - file_node.dependencies.append(root_node) - root_node.dependents.append(file_node) - cycles = [] - for cycle in root_node.FindCycles(): - paths = [node.ref for node in cycle] - cycles.append('Cycle: %s' % ' -> '.join(paths)) - raise DependencyGraphNode.CircularException( - 'Cycles in .gyp file dependency graph detected:\n' + '\n'.join(cycles)) + # Create a DependencyGraphNode for each gyp file containing a target. Put + # it into a dict for easy access. + dependency_nodes = {} + for target in targets: + build_file = gyp.common.BuildFile(target) + if build_file not in dependency_nodes: + dependency_nodes[build_file] = DependencyGraphNode(build_file) + + # Set up the dependency links. + for target, spec in targets.items(): + build_file = gyp.common.BuildFile(target) + build_file_node = dependency_nodes[build_file] + target_dependencies = spec.get("dependencies", []) + for dependency in target_dependencies: + try: + dependency_build_file = gyp.common.BuildFile(dependency) + except GypError as e: + gyp.common.ExceptionAppend( + e, "while computing dependencies of .gyp file %s" % build_file + ) + raise + + if dependency_build_file == build_file: + # A .gyp file is allowed to refer back to itself. + continue + dependency_node = dependency_nodes.get(dependency_build_file) + if not dependency_node: + raise GypError("Dependency '%s' not found" % dependency_build_file) + if dependency_node not in build_file_node.dependencies: + build_file_node.dependencies.append(dependency_node) + dependency_node.dependents.append(build_file_node) + + # Files that have no dependencies are treated as dependent on root_node. + root_node = DependencyGraphNode(None) + for build_file_node in dependency_nodes.values(): + if len(build_file_node.dependencies) == 0: + build_file_node.dependencies.append(root_node) + root_node.dependents.append(build_file_node) + + flat_list = root_node.FlattenToList() + + # If there's anything left unvisited, there must be a circular dependency + # (cycle). + if len(flat_list) != len(dependency_nodes): + if not root_node.dependents: + # If all files have dependencies, add the first file as a dependent + # of root_node so that the cycle can be discovered from root_node. + file_node = next(iter(dependency_nodes.values())) + file_node.dependencies.append(root_node) + root_node.dependents.append(file_node) + cycles = [] + for cycle in root_node.FindCycles(): + paths = [node.ref for node in cycle] + cycles.append("Cycle: %s" % " -> ".join(paths)) + raise DependencyGraphNode.CircularException( + "Cycles in .gyp file dependency graph detected:\n" + "\n".join(cycles) + ) def DoDependentSettings(key, flat_list, targets, dependency_nodes): - # key should be one of all_dependent_settings, direct_dependent_settings, - # or link_settings. + # key should be one of all_dependent_settings, direct_dependent_settings, + # or link_settings. - for target in flat_list: - target_dict = targets[target] - build_file = gyp.common.BuildFile(target) - - if key == 'all_dependent_settings': - dependencies = dependency_nodes[target].DeepDependencies() - elif key == 'direct_dependent_settings': - dependencies = \ - dependency_nodes[target].DirectAndImportedDependencies(targets) - elif key == 'link_settings': - dependencies = \ - dependency_nodes[target].DependenciesForLinkSettings(targets) - else: - raise GypError("DoDependentSettings doesn't know how to determine " - 'dependencies for ' + key) - - for dependency in dependencies: - dependency_dict = targets[dependency] - if not key in dependency_dict: - continue - dependency_build_file = gyp.common.BuildFile(dependency) - MergeDicts(target_dict, dependency_dict[key], - build_file, dependency_build_file) - - -def AdjustStaticLibraryDependencies(flat_list, targets, dependency_nodes, - sort_dependencies): - # Recompute target "dependencies" properties. For each static library - # target, remove "dependencies" entries referring to other static libraries, - # unless the dependency has the "hard_dependency" attribute set. For each - # linkable target, add a "dependencies" entry referring to all of the - # target's computed list of link dependencies (including static libraries - # if no such entry is already present. - for target in flat_list: - target_dict = targets[target] - target_type = target_dict['type'] - - if target_type == 'static_library': - if not 'dependencies' in target_dict: - continue - - target_dict['dependencies_original'] = target_dict.get( - 'dependencies', [])[:] - - # A static library should not depend on another static library unless - # the dependency relationship is "hard," which should only be done when - # a dependent relies on some side effect other than just the build - # product, like a rule or action output. Further, if a target has a - # non-hard dependency, but that dependency exports a hard dependency, - # the non-hard dependency can safely be removed, but the exported hard - # dependency must be added to the target to keep the same dependency - # ordering. - dependencies = \ - dependency_nodes[target].DirectAndImportedDependencies(targets) - index = 0 - while index < len(dependencies): - dependency = dependencies[index] - dependency_dict = targets[dependency] - - # Remove every non-hard static library dependency and remove every - # non-static library dependency that isn't a direct dependency. - if (dependency_dict['type'] == 'static_library' and \ - not dependency_dict.get('hard_dependency', False)) or \ - (dependency_dict['type'] != 'static_library' and \ - not dependency in target_dict['dependencies']): - # Take the dependency out of the list, and don't increment index - # because the next dependency to analyze will shift into the index - # formerly occupied by the one being removed. - del dependencies[index] + for target in flat_list: + target_dict = targets[target] + build_file = gyp.common.BuildFile(target) + + if key == "all_dependent_settings": + dependencies = dependency_nodes[target].DeepDependencies() + elif key == "direct_dependent_settings": + dependencies = dependency_nodes[target].DirectAndImportedDependencies( + targets + ) + elif key == "link_settings": + dependencies = dependency_nodes[target].DependenciesForLinkSettings(targets) else: - index = index + 1 - - # Update the dependencies. If the dependencies list is empty, it's not - # needed, so unhook it. - if len(dependencies) > 0: - target_dict['dependencies'] = dependencies - else: - del target_dict['dependencies'] - - elif target_type in linkable_types: - # Get a list of dependency targets that should be linked into this - # target. Add them to the dependencies list if they're not already - # present. - - link_dependencies = \ - dependency_nodes[target].DependenciesToLinkAgainst(targets) - for dependency in link_dependencies: - if dependency == target: - continue - if not 'dependencies' in target_dict: - target_dict['dependencies'] = [] - if not dependency in target_dict['dependencies']: - target_dict['dependencies'].append(dependency) - # Sort the dependencies list in the order from dependents to dependencies. - # e.g. If A and B depend on C and C depends on D, sort them in A, B, C, D. - # Note: flat_list is already sorted in the order from dependencies to - # dependents. - if sort_dependencies and 'dependencies' in target_dict: - target_dict['dependencies'] = [dep for dep in reversed(flat_list) - if dep in target_dict['dependencies']] + raise GypError( + "DoDependentSettings doesn't know how to determine " + "dependencies for " + key + ) + + for dependency in dependencies: + dependency_dict = targets[dependency] + if key not in dependency_dict: + continue + dependency_build_file = gyp.common.BuildFile(dependency) + MergeDicts( + target_dict, dependency_dict[key], build_file, dependency_build_file + ) + + +def AdjustStaticLibraryDependencies( + flat_list, targets, dependency_nodes, sort_dependencies +): + # Recompute target "dependencies" properties. For each static library + # target, remove "dependencies" entries referring to other static libraries, + # unless the dependency has the "hard_dependency" attribute set. For each + # linkable target, add a "dependencies" entry referring to all of the + # target's computed list of link dependencies (including static libraries + # if no such entry is already present. + for target in flat_list: + target_dict = targets[target] + target_type = target_dict["type"] + + if target_type == "static_library": + if "dependencies" not in target_dict: + continue + + target_dict["dependencies_original"] = target_dict.get("dependencies", [])[ + : + ] + + # A static library should not depend on another static library unless + # the dependency relationship is "hard," which should only be done when + # a dependent relies on some side effect other than just the build + # product, like a rule or action output. Further, if a target has a + # non-hard dependency, but that dependency exports a hard dependency, + # the non-hard dependency can safely be removed, but the exported hard + # dependency must be added to the target to keep the same dependency + # ordering. + dependencies = dependency_nodes[target].DirectAndImportedDependencies( + targets + ) + index = 0 + while index < len(dependencies): + dependency = dependencies[index] + dependency_dict = targets[dependency] + + # Remove every non-hard static library dependency and remove every + # non-static library dependency that isn't a direct dependency. + if ( + dependency_dict["type"] == "static_library" + and not dependency_dict.get("hard_dependency", False) + ) or ( + dependency_dict["type"] != "static_library" + and dependency not in target_dict["dependencies"] + ): + # Take the dependency out of the list, and don't increment index + # because the next dependency to analyze will shift into the index + # formerly occupied by the one being removed. + del dependencies[index] + else: + index = index + 1 + + # Update the dependencies. If the dependencies list is empty, it's not + # needed, so unhook it. + if len(dependencies) > 0: + target_dict["dependencies"] = dependencies + else: + del target_dict["dependencies"] + + elif target_type in linkable_types: + # Get a list of dependency targets that should be linked into this + # target. Add them to the dependencies list if they're not already + # present. + + link_dependencies = dependency_nodes[target].DependenciesToLinkAgainst( + targets + ) + for dependency in link_dependencies: + if dependency == target: + continue + if "dependencies" not in target_dict: + target_dict["dependencies"] = [] + if dependency not in target_dict["dependencies"]: + target_dict["dependencies"].append(dependency) + # Sort the dependencies list in the order from dependents to dependencies. + # e.g. If A and B depend on C and C depends on D, sort them in A, B, C, D. + # Note: flat_list is already sorted in the order from dependencies to + # dependents. + if sort_dependencies and "dependencies" in target_dict: + target_dict["dependencies"] = [ + dep + for dep in reversed(flat_list) + if dep in target_dict["dependencies"] + ] # Initialize this here to speed up MakePathRelative. -exception_re = re.compile(r'''["']?[-/$<>^]''') +exception_re = re.compile(r"""["']?[-/$<>^]""") def MakePathRelative(to_file, fro_file, item): - # If item is a relative path, it's relative to the build file dict that it's - # coming from. Fix it up to make it relative to the build file dict that - # it's going into. - # Exception: any |item| that begins with these special characters is - # returned without modification. - # / Used when a path is already absolute (shortcut optimization; - # such paths would be returned as absolute anyway) - # $ Used for build environment variables - # - Used for some build environment flags (such as -lapr-1 in a - # "libraries" section) - # < Used for our own variable and command expansions (see ExpandVariables) - # > Used for our own variable and command expansions (see ExpandVariables) - # ^ Used for our own variable and command expansions (see ExpandVariables) - # - # "/' Used when a value is quoted. If these are present, then we - # check the second character instead. - # - if to_file == fro_file or exception_re.match(item): - return item - else: - # TODO(dglazkov) The backslash/forward-slash replacement at the end is a - # temporary measure. This should really be addressed by keeping all paths - # in POSIX until actual project generation. - ret = os.path.normpath(os.path.join( - gyp.common.RelativePath(os.path.dirname(fro_file), - os.path.dirname(to_file)), - item)).replace('\\', '/') - if item[-1:] == '/': - ret += '/' - return ret - -def MergeLists(to, fro, to_file, fro_file, is_paths=False, append=True): - # Python documentation recommends objects which do not support hash - # set this value to None. Python library objects follow this rule. - is_hashable = lambda val: val.__hash__ - - # If x is hashable, returns whether x is in s. Else returns whether x is in l. - def is_in_set_or_list(x, s, l): - if is_hashable(x): - return x in s - return x in l - - prepend_index = 0 - - # Make membership testing of hashables in |to| (in particular, strings) - # faster. - hashable_to_set = set(x for x in to if is_hashable(x)) - for item in fro: - singleton = False - if type(item) in (str, int): - # The cheap and easy case. - if is_paths: - to_item = MakePathRelative(to_file, fro_file, item) - else: - to_item = item - - if not (type(item) is str and item.startswith('-')): - # Any string that doesn't begin with a "-" is a singleton - it can - # only appear once in a list, to be enforced by the list merge append - # or prepend. - singleton = True - elif type(item) is dict: - # Make a copy of the dictionary, continuing to look for paths to fix. - # The other intelligent aspects of merge processing won't apply because - # item is being merged into an empty dict. - to_item = {} - MergeDicts(to_item, item, to_file, fro_file) - elif type(item) is list: - # Recurse, making a copy of the list. If the list contains any - # descendant dicts, path fixing will occur. Note that here, custom - # values for is_paths and append are dropped; those are only to be - # applied to |to| and |fro|, not sublists of |fro|. append shouldn't - # matter anyway because the new |to_item| list is empty. - to_item = [] - MergeLists(to_item, item, to_file, fro_file) - else: - raise TypeError( - 'Attempt to merge list item of unsupported type ' + \ - item.__class__.__name__) - - if append: - # If appending a singleton that's already in the list, don't append. - # This ensures that the earliest occurrence of the item will stay put. - if not singleton or not is_in_set_or_list(to_item, hashable_to_set, to): - to.append(to_item) - if is_hashable(to_item): - hashable_to_set.add(to_item) - else: - # If prepending a singleton that's already in the list, remove the - # existing instance and proceed with the prepend. This ensures that the - # item appears at the earliest possible position in the list. - while singleton and to_item in to: - to.remove(to_item) - - # Don't just insert everything at index 0. That would prepend the new - # items to the list in reverse order, which would be an unwelcome - # surprise. - to.insert(prepend_index, to_item) - if is_hashable(to_item): - hashable_to_set.add(to_item) - prepend_index = prepend_index + 1 - - -def MergeDicts(to, fro, to_file, fro_file): - # I wanted to name the parameter "from" but it's a Python keyword... - for k, v in fro.items(): - # It would be nice to do "if not k in to: to[k] = v" but that wouldn't give - # copy semantics. Something else may want to merge from the |fro| dict - # later, and having the same dict ref pointed to twice in the tree isn't - # what anyone wants considering that the dicts may subsequently be - # modified. - if k in to: - bad_merge = False - if type(v) in (str, int): - if type(to[k]) not in (str, int): - bad_merge = True - elif type(v) is not type(to[k]): - bad_merge = True - - if bad_merge: - raise TypeError( - 'Attempt to merge dict value of type ' + v.__class__.__name__ + \ - ' into incompatible type ' + to[k].__class__.__name__ + \ - ' for key ' + k) - if type(v) in (str, int): - # Overwrite the existing value, if any. Cheap and easy. - is_path = IsPathSection(k) - if is_path: - to[k] = MakePathRelative(to_file, fro_file, v) - else: - to[k] = v - elif type(v) is dict: - # Recurse, guaranteeing copies will be made of objects that require it. - if not k in to: - to[k] = {} - MergeDicts(to[k], v, to_file, fro_file) - elif type(v) is list: - # Lists in dicts can be merged with different policies, depending on - # how the key in the "from" dict (k, the from-key) is written. - # - # If the from-key has ...the to-list will have this action - # this character appended:... applied when receiving the from-list: - # = replace - # + prepend - # ? set, only if to-list does not yet exist - # (none) append - # - # This logic is list-specific, but since it relies on the associated - # dict key, it's checked in this dict-oriented function. - ext = k[-1] - append = True - if ext == '=': - list_base = k[:-1] - lists_incompatible = [list_base, list_base + '?'] - to[list_base] = [] - elif ext == '+': - list_base = k[:-1] - lists_incompatible = [list_base + '=', list_base + '?'] - append = False - elif ext == '?': - list_base = k[:-1] - lists_incompatible = [list_base, list_base + '=', list_base + '+'] - else: - list_base = k - lists_incompatible = [list_base + '=', list_base + '?'] - - # Some combinations of merge policies appearing together are meaningless. - # It's stupid to replace and append simultaneously, for example. Append - # and prepend are the only policies that can coexist. - for list_incompatible in lists_incompatible: - if list_incompatible in fro: - raise GypError('Incompatible list policies ' + k + ' and ' + - list_incompatible) - - if list_base in to: - if ext == '?': - # If the key ends in "?", the list will only be merged if it doesn't - # already exist. - continue - elif type(to[list_base]) is not list: - # This may not have been checked above if merging in a list with an - # extension character. - raise TypeError( - 'Attempt to merge dict value of type ' + v.__class__.__name__ + \ - ' into incompatible type ' + to[list_base].__class__.__name__ + \ - ' for key ' + list_base + '(' + k + ')') - else: - to[list_base] = [] - - # Call MergeLists, which will make copies of objects that require it. - # MergeLists can recurse back into MergeDicts, although this will be - # to make copies of dicts (with paths fixed), there will be no - # subsequent dict "merging" once entering a list because lists are - # always replaced, appended to, or prepended to. - is_paths = IsPathSection(list_base) - MergeLists(to[list_base], v, to_file, fro_file, is_paths, append) + # If item is a relative path, it's relative to the build file dict that it's + # coming from. Fix it up to make it relative to the build file dict that + # it's going into. + # Exception: any |item| that begins with these special characters is + # returned without modification. + # / Used when a path is already absolute (shortcut optimization; + # such paths would be returned as absolute anyway) + # $ Used for build environment variables + # - Used for some build environment flags (such as -lapr-1 in a + # "libraries" section) + # < Used for our own variable and command expansions (see ExpandVariables) + # > Used for our own variable and command expansions (see ExpandVariables) + # ^ Used for our own variable and command expansions (see ExpandVariables) + # + # "/' Used when a value is quoted. If these are present, then we + # check the second character instead. + # + if to_file == fro_file or exception_re.match(item): + return item else: - raise TypeError( - 'Attempt to merge dict value of unsupported type ' + \ - v.__class__.__name__ + ' for key ' + k) - + # TODO(dglazkov) The backslash/forward-slash replacement at the end is a + # temporary measure. This should really be addressed by keeping all paths + # in POSIX until actual project generation. + ret = os.path.normpath( + os.path.join( + gyp.common.RelativePath( + os.path.dirname(fro_file), os.path.dirname(to_file) + ), + item, + ) + ).replace("\\", "/") + if item.endswith("/"): + ret += "/" + return ret -def MergeConfigWithInheritance(new_configuration_dict, build_file, - target_dict, configuration, visited): - # Skip if previously visted. - if configuration in visited: - return - # Look at this configuration. - configuration_dict = target_dict['configurations'][configuration] +def MergeLists(to, fro, to_file, fro_file, is_paths=False, append=True): + # Python documentation recommends objects which do not support hash + # set this value to None. Python library objects follow this rule. + def is_hashable(val): + return val.__hash__ + + # If x is hashable, returns whether x is in s. Else returns whether x is in items. + def is_in_set_or_list(x, s, items): + if is_hashable(x): + return x in s + return x in items + + prepend_index = 0 + + # Make membership testing of hashables in |to| (in particular, strings) + # faster. + hashable_to_set = set(x for x in to if is_hashable(x)) + for item in fro: + singleton = False + if type(item) in (str, int): + # The cheap and easy case. + if is_paths: + to_item = MakePathRelative(to_file, fro_file, item) + else: + to_item = item + + if not (type(item) is str and item.startswith("-")): + # Any string that doesn't begin with a "-" is a singleton - it can + # only appear once in a list, to be enforced by the list merge append + # or prepend. + singleton = True + elif type(item) is dict: + # Make a copy of the dictionary, continuing to look for paths to fix. + # The other intelligent aspects of merge processing won't apply because + # item is being merged into an empty dict. + to_item = {} + MergeDicts(to_item, item, to_file, fro_file) + elif type(item) is list: + # Recurse, making a copy of the list. If the list contains any + # descendant dicts, path fixing will occur. Note that here, custom + # values for is_paths and append are dropped; those are only to be + # applied to |to| and |fro|, not sublists of |fro|. append shouldn't + # matter anyway because the new |to_item| list is empty. + to_item = [] + MergeLists(to_item, item, to_file, fro_file) + else: + raise TypeError( + "Attempt to merge list item of unsupported type " + + item.__class__.__name__ + ) + + if append: + # If appending a singleton that's already in the list, don't append. + # This ensures that the earliest occurrence of the item will stay put. + if not singleton or not is_in_set_or_list(to_item, hashable_to_set, to): + to.append(to_item) + if is_hashable(to_item): + hashable_to_set.add(to_item) + else: + # If prepending a singleton that's already in the list, remove the + # existing instance and proceed with the prepend. This ensures that the + # item appears at the earliest possible position in the list. + while singleton and to_item in to: + to.remove(to_item) - # Merge in parents. - for parent in configuration_dict.get('inherit_from', []): - MergeConfigWithInheritance(new_configuration_dict, build_file, - target_dict, parent, visited + [configuration]) + # Don't just insert everything at index 0. That would prepend the new + # items to the list in reverse order, which would be an unwelcome + # surprise. + to.insert(prepend_index, to_item) + if is_hashable(to_item): + hashable_to_set.add(to_item) + prepend_index = prepend_index + 1 - # Merge it into the new config. - MergeDicts(new_configuration_dict, configuration_dict, - build_file, build_file) - # Drop abstract. - if 'abstract' in new_configuration_dict: - del new_configuration_dict['abstract'] +def MergeDicts(to, fro, to_file, fro_file): + # I wanted to name the parameter "from" but it's a Python keyword... + for k, v in fro.items(): + # It would be nice to do "if not k in to: to[k] = v" but that wouldn't give + # copy semantics. Something else may want to merge from the |fro| dict + # later, and having the same dict ref pointed to twice in the tree isn't + # what anyone wants considering that the dicts may subsequently be + # modified. + if k in to: + bad_merge = False + if type(v) in (str, int): + if type(to[k]) not in (str, int): + bad_merge = True + elif not isinstance(v, type(to[k])): + bad_merge = True + + if bad_merge: + raise TypeError( + "Attempt to merge dict value of type " + + v.__class__.__name__ + + " into incompatible type " + + to[k].__class__.__name__ + + " for key " + + k + ) + if type(v) in (str, int): + # Overwrite the existing value, if any. Cheap and easy. + is_path = IsPathSection(k) + if is_path: + to[k] = MakePathRelative(to_file, fro_file, v) + else: + to[k] = v + elif type(v) is dict: + # Recurse, guaranteeing copies will be made of objects that require it. + if k not in to: + to[k] = {} + MergeDicts(to[k], v, to_file, fro_file) + elif type(v) is list: + # Lists in dicts can be merged with different policies, depending on + # how the key in the "from" dict (k, the from-key) is written. + # + # If the from-key has ...the to-list will have this action + # this character appended:... applied when receiving the from-list: + # = replace + # + prepend + # ? set, only if to-list does not yet exist + # (none) append + # + # This logic is list-specific, but since it relies on the associated + # dict key, it's checked in this dict-oriented function. + ext = k[-1] + append = True + if ext == "=": + list_base = k[:-1] + lists_incompatible = [list_base, list_base + "?"] + to[list_base] = [] + elif ext == "+": + list_base = k[:-1] + lists_incompatible = [list_base + "=", list_base + "?"] + append = False + elif ext == "?": + list_base = k[:-1] + lists_incompatible = [list_base, list_base + "=", list_base + "+"] + else: + list_base = k + lists_incompatible = [list_base + "=", list_base + "?"] + + # Some combinations of merge policies appearing together are meaningless. + # It's stupid to replace and append simultaneously, for example. Append + # and prepend are the only policies that can coexist. + for list_incompatible in lists_incompatible: + if list_incompatible in fro: + raise GypError( + "Incompatible list policies " + k + " and " + list_incompatible + ) + + if list_base in to: + if ext == "?": + # If the key ends in "?", the list will only be merged if it doesn't + # already exist. + continue + elif type(to[list_base]) is not list: + # This may not have been checked above if merging in a list with an + # extension character. + raise TypeError( + "Attempt to merge dict value of type " + + v.__class__.__name__ + + " into incompatible type " + + to[list_base].__class__.__name__ + + " for key " + + list_base + + "(" + + k + + ")" + ) + else: + to[list_base] = [] + + # Call MergeLists, which will make copies of objects that require it. + # MergeLists can recurse back into MergeDicts, although this will be + # to make copies of dicts (with paths fixed), there will be no + # subsequent dict "merging" once entering a list because lists are + # always replaced, appended to, or prepended to. + is_paths = IsPathSection(list_base) + MergeLists(to[list_base], v, to_file, fro_file, is_paths, append) + else: + raise TypeError( + "Attempt to merge dict value of unsupported type " + + v.__class__.__name__ + + " for key " + + k + ) + + +def MergeConfigWithInheritance( + new_configuration_dict, build_file, target_dict, configuration, visited +): + # Skip if previously visted. + if configuration in visited: + return + + # Look at this configuration. + configuration_dict = target_dict["configurations"][configuration] + + # Merge in parents. + for parent in configuration_dict.get("inherit_from", []): + MergeConfigWithInheritance( + new_configuration_dict, + build_file, + target_dict, + parent, + visited + [configuration], + ) + + # Merge it into the new config. + MergeDicts(new_configuration_dict, configuration_dict, build_file, build_file) + + # Drop abstract. + if "abstract" in new_configuration_dict: + del new_configuration_dict["abstract"] def SetUpConfigurations(target, target_dict): - # key_suffixes is a list of key suffixes that might appear on key names. - # These suffixes are handled in conditional evaluations (for =, +, and ?) - # and rules/exclude processing (for ! and /). Keys with these suffixes - # should be treated the same as keys without. - key_suffixes = ['=', '+', '?', '!', '/'] - - build_file = gyp.common.BuildFile(target) - - # Provide a single configuration by default if none exists. - # TODO(mark): Signal an error if default_configurations exists but - # configurations does not. - if not 'configurations' in target_dict: - target_dict['configurations'] = {'Default': {}} - if not 'default_configuration' in target_dict: - concrete = [i for (i, config) in target_dict['configurations'].items() - if not config.get('abstract')] - target_dict['default_configuration'] = sorted(concrete)[0] - - merged_configurations = {} - configs = target_dict['configurations'] - for (configuration, old_configuration_dict) in configs.items(): - # Skip abstract configurations (saves work only). - if old_configuration_dict.get('abstract'): - continue - # Configurations inherit (most) settings from the enclosing target scope. - # Get the inheritance relationship right by making a copy of the target - # dict. - new_configuration_dict = {} - for (key, target_val) in target_dict.items(): - key_ext = key[-1:] - if key_ext in key_suffixes: - key_base = key[:-1] - else: - key_base = key - if not key_base in non_configuration_keys: - new_configuration_dict[key] = gyp.simple_copy.deepcopy(target_val) - - # Merge in configuration (with all its parents first). - MergeConfigWithInheritance(new_configuration_dict, build_file, - target_dict, configuration, []) - - merged_configurations[configuration] = new_configuration_dict - - # Put the new configurations back into the target dict as a configuration. - for configuration in merged_configurations.keys(): - target_dict['configurations'][configuration] = ( - merged_configurations[configuration]) - - # Now drop all the abstract ones. - for configuration in list(target_dict['configurations']): - old_configuration_dict = target_dict['configurations'][configuration] - if old_configuration_dict.get('abstract'): - del target_dict['configurations'][configuration] - - # Now that all of the target's configurations have been built, go through - # the target dict's keys and remove everything that's been moved into a - # "configurations" section. - delete_keys = [] - for key in target_dict: - key_ext = key[-1:] - if key_ext in key_suffixes: - key_base = key[:-1] - else: - key_base = key - if not key_base in non_configuration_keys: - delete_keys.append(key) - for key in delete_keys: - del target_dict[key] + # key_suffixes is a list of key suffixes that might appear on key names. + # These suffixes are handled in conditional evaluations (for =, +, and ?) + # and rules/exclude processing (for ! and /). Keys with these suffixes + # should be treated the same as keys without. + key_suffixes = ["=", "+", "?", "!", "/"] - # Check the configurations to see if they contain invalid keys. - for configuration in target_dict['configurations'].keys(): - configuration_dict = target_dict['configurations'][configuration] - for key in configuration_dict.keys(): - if key in invalid_configuration_keys: - raise GypError('%s not allowed in the %s configuration, found in ' - 'target %s' % (key, configuration, target)) + build_file = gyp.common.BuildFile(target) + # Provide a single configuration by default if none exists. + # TODO(mark): Signal an error if default_configurations exists but + # configurations does not. + if "configurations" not in target_dict: + target_dict["configurations"] = {"Default": {}} + if "default_configuration" not in target_dict: + concrete = [ + i + for (i, config) in target_dict["configurations"].items() + if not config.get("abstract") + ] + target_dict["default_configuration"] = sorted(concrete)[0] + + merged_configurations = {} + configs = target_dict["configurations"] + for (configuration, old_configuration_dict) in configs.items(): + # Skip abstract configurations (saves work only). + if old_configuration_dict.get("abstract"): + continue + # Configurations inherit (most) settings from the enclosing target scope. + # Get the inheritance relationship right by making a copy of the target + # dict. + new_configuration_dict = {} + for (key, target_val) in target_dict.items(): + key_ext = key[-1:] + if key_ext in key_suffixes: + key_base = key[:-1] + else: + key_base = key + if key_base not in non_configuration_keys: + new_configuration_dict[key] = gyp.simple_copy.deepcopy(target_val) + + # Merge in configuration (with all its parents first). + MergeConfigWithInheritance( + new_configuration_dict, build_file, target_dict, configuration, [] + ) + + merged_configurations[configuration] = new_configuration_dict + + # Put the new configurations back into the target dict as a configuration. + for configuration in merged_configurations.keys(): + target_dict["configurations"][configuration] = merged_configurations[ + configuration + ] + + # Now drop all the abstract ones. + configs = target_dict["configurations"] + target_dict["configurations"] = { + k: v for k, v in configs.items() if not v.get("abstract") + } + + # Now that all of the target's configurations have been built, go through + # the target dict's keys and remove everything that's been moved into a + # "configurations" section. + delete_keys = [] + for key in target_dict: + key_ext = key[-1:] + if key_ext in key_suffixes: + key_base = key[:-1] + else: + key_base = key + if key_base not in non_configuration_keys: + delete_keys.append(key) + for key in delete_keys: + del target_dict[key] + + # Check the configurations to see if they contain invalid keys. + for configuration in target_dict["configurations"].keys(): + configuration_dict = target_dict["configurations"][configuration] + for key in configuration_dict.keys(): + if key in invalid_configuration_keys: + raise GypError( + "%s not allowed in the %s configuration, found in " + "target %s" % (key, configuration, target) + ) def ProcessListFiltersInDict(name, the_dict): - """Process regular expression and exclusion-based filters on lists. + """Process regular expression and exclusion-based filters on lists. An exclusion list is in a dict key named with a trailing "!", like "sources!". Every item in such a list is removed from the associated @@ -2339,151 +2561,163 @@ def ProcessListFiltersInDict(name, the_dict): patterns can still cause items to be excluded after matching an "include". """ - # Look through the dictionary for any lists whose keys end in "!" or "/". - # These are lists that will be treated as exclude lists and regular - # expression-based exclude/include lists. Collect the lists that are - # needed first, looking for the lists that they operate on, and assemble - # then into |lists|. This is done in a separate loop up front, because - # the _included and _excluded keys need to be added to the_dict, and that - # can't be done while iterating through it. - - lists = [] - del_lists = [] - for key, value in the_dict.items(): - operation = key[-1] - if operation != '!' and operation != '/': - continue - - if type(value) is not list: - raise ValueError(name + ' key ' + key + ' must be list, not ' + \ - value.__class__.__name__) - - list_key = key[:-1] - if list_key not in the_dict: - # This happens when there's a list like "sources!" but no corresponding - # "sources" list. Since there's nothing for it to operate on, queue up - # the "sources!" list for deletion now. - del_lists.append(key) - continue - - if type(the_dict[list_key]) is not list: - value = the_dict[list_key] - raise ValueError(name + ' key ' + list_key + \ - ' must be list, not ' + \ - value.__class__.__name__ + ' when applying ' + \ - {'!': 'exclusion', '/': 'regex'}[operation]) - - if not list_key in lists: - lists.append(list_key) - - # Delete the lists that are known to be unneeded at this point. - for del_list in del_lists: - del the_dict[del_list] - - for list_key in lists: - the_list = the_dict[list_key] - - # Initialize the list_actions list, which is parallel to the_list. Each - # item in list_actions identifies whether the corresponding item in - # the_list should be excluded, unconditionally preserved (included), or - # whether no exclusion or inclusion has been applied. Items for which - # no exclusion or inclusion has been applied (yet) have value -1, items - # excluded have value 0, and items included have value 1. Includes and - # excludes override previous actions. All items in list_actions are - # initialized to -1 because no excludes or includes have been processed - # yet. - list_actions = list((-1,) * len(the_list)) - - exclude_key = list_key + '!' - if exclude_key in the_dict: - for exclude_item in the_dict[exclude_key]: - for index in range(0, len(the_list)): - if exclude_item == the_list[index]: - # This item matches the exclude_item, so set its action to 0 - # (exclude). - list_actions[index] = 0 - - # The "whatever!" list is no longer needed, dump it. - del the_dict[exclude_key] - - regex_key = list_key + '/' - if regex_key in the_dict: - for regex_item in the_dict[regex_key]: - [action, pattern] = regex_item - pattern_re = re.compile(pattern) - - if action == 'exclude': - # This item matches an exclude regex, so set its value to 0 (exclude). - action_value = 0 - elif action == 'include': - # This item matches an include regex, so set its value to 1 (include). - action_value = 1 - else: - # This is an action that doesn't make any sense. - raise ValueError('Unrecognized action ' + action + ' in ' + name + \ - ' key ' + regex_key) - - for index in range(0, len(the_list)): - list_item = the_list[index] - if list_actions[index] == action_value: - # Even if the regex matches, nothing will change so continue (regex - # searches are expensive). + # Look through the dictionary for any lists whose keys end in "!" or "/". + # These are lists that will be treated as exclude lists and regular + # expression-based exclude/include lists. Collect the lists that are + # needed first, looking for the lists that they operate on, and assemble + # then into |lists|. This is done in a separate loop up front, because + # the _included and _excluded keys need to be added to the_dict, and that + # can't be done while iterating through it. + + lists = [] + del_lists = [] + for key, value in the_dict.items(): + operation = key[-1] + if operation != "!" and operation != "/": continue - if pattern_re.search(list_item): - # Regular expression match. - list_actions[index] = action_value - # The "whatever/" list is no longer needed, dump it. - del the_dict[regex_key] + if type(value) is not list: + raise ValueError( + name + " key " + key + " must be list, not " + value.__class__.__name__ + ) + + list_key = key[:-1] + if list_key not in the_dict: + # This happens when there's a list like "sources!" but no corresponding + # "sources" list. Since there's nothing for it to operate on, queue up + # the "sources!" list for deletion now. + del_lists.append(key) + continue - # Add excluded items to the excluded list. - # - # Note that exclude_key ("sources!") is different from excluded_key - # ("sources_excluded"). The exclude_key list is input and it was already - # processed and deleted; the excluded_key list is output and it's about - # to be created. - excluded_key = list_key + '_excluded' - if excluded_key in the_dict: - raise GypError(name + ' key ' + excluded_key + - ' must not be present prior ' - ' to applying exclusion/regex filters for ' + list_key) - - excluded_list = [] - - # Go backwards through the list_actions list so that as items are deleted, - # the indices of items that haven't been seen yet don't shift. That means - # that things need to be prepended to excluded_list to maintain them in the - # same order that they existed in the_list. - for index in range(len(list_actions) - 1, -1, -1): - if list_actions[index] == 0: - # Dump anything with action 0 (exclude). Keep anything with action 1 - # (include) or -1 (no include or exclude seen for the item). - excluded_list.insert(0, the_list[index]) - del the_list[index] - - # If anything was excluded, put the excluded list into the_dict at - # excluded_key. - if len(excluded_list) > 0: - the_dict[excluded_key] = excluded_list - - # Now recurse into subdicts and lists that may contain dicts. - for key, value in the_dict.items(): - if type(value) is dict: - ProcessListFiltersInDict(key, value) - elif type(value) is list: - ProcessListFiltersInList(key, value) + if type(the_dict[list_key]) is not list: + value = the_dict[list_key] + raise ValueError( + name + + " key " + + list_key + + " must be list, not " + + value.__class__.__name__ + + " when applying " + + {"!": "exclusion", "/": "regex"}[operation] + ) + + if list_key not in lists: + lists.append(list_key) + + # Delete the lists that are known to be unneeded at this point. + for del_list in del_lists: + del the_dict[del_list] + + for list_key in lists: + the_list = the_dict[list_key] + + # Initialize the list_actions list, which is parallel to the_list. Each + # item in list_actions identifies whether the corresponding item in + # the_list should be excluded, unconditionally preserved (included), or + # whether no exclusion or inclusion has been applied. Items for which + # no exclusion or inclusion has been applied (yet) have value -1, items + # excluded have value 0, and items included have value 1. Includes and + # excludes override previous actions. All items in list_actions are + # initialized to -1 because no excludes or includes have been processed + # yet. + list_actions = list((-1,) * len(the_list)) + + exclude_key = list_key + "!" + if exclude_key in the_dict: + for exclude_item in the_dict[exclude_key]: + for index, list_item in enumerate(the_list): + if exclude_item == list_item: + # This item matches the exclude_item, so set its action to 0 + # (exclude). + list_actions[index] = 0 + + # The "whatever!" list is no longer needed, dump it. + del the_dict[exclude_key] + + regex_key = list_key + "/" + if regex_key in the_dict: + for regex_item in the_dict[regex_key]: + [action, pattern] = regex_item + pattern_re = re.compile(pattern) + + if action == "exclude": + # This item matches an exclude regex, so set its value to 0 (exclude). + action_value = 0 + elif action == "include": + # This item matches an include regex, so set its value to 1 (include). + action_value = 1 + else: + # This is an action that doesn't make any sense. + raise ValueError( + "Unrecognized action " + + action + + " in " + + name + + " key " + + regex_key + ) + + for index, list_item in enumerate(the_list): + if list_actions[index] == action_value: + # Even if the regex matches, nothing will change so continue (regex + # searches are expensive). + continue + if pattern_re.search(list_item): + # Regular expression match. + list_actions[index] = action_value + + # The "whatever/" list is no longer needed, dump it. + del the_dict[regex_key] + + # Add excluded items to the excluded list. + # + # Note that exclude_key ("sources!") is different from excluded_key + # ("sources_excluded"). The exclude_key list is input and it was already + # processed and deleted; the excluded_key list is output and it's about + # to be created. + excluded_key = list_key + "_excluded" + if excluded_key in the_dict: + raise GypError( + name + " key " + excluded_key + " must not be present prior " + " to applying exclusion/regex filters for " + list_key + ) + + excluded_list = [] + + # Go backwards through the list_actions list so that as items are deleted, + # the indices of items that haven't been seen yet don't shift. That means + # that things need to be prepended to excluded_list to maintain them in the + # same order that they existed in the_list. + for index in range(len(list_actions) - 1, -1, -1): + if list_actions[index] == 0: + # Dump anything with action 0 (exclude). Keep anything with action 1 + # (include) or -1 (no include or exclude seen for the item). + excluded_list.insert(0, the_list[index]) + del the_list[index] + + # If anything was excluded, put the excluded list into the_dict at + # excluded_key. + if len(excluded_list) > 0: + the_dict[excluded_key] = excluded_list + + # Now recurse into subdicts and lists that may contain dicts. + for key, value in the_dict.items(): + if type(value) is dict: + ProcessListFiltersInDict(key, value) + elif type(value) is list: + ProcessListFiltersInList(key, value) def ProcessListFiltersInList(name, the_list): - for item in the_list: - if type(item) is dict: - ProcessListFiltersInDict(name, item) - elif type(item) is list: - ProcessListFiltersInList(name, item) + for item in the_list: + if type(item) is dict: + ProcessListFiltersInDict(name, item) + elif type(item) is list: + ProcessListFiltersInList(name, item) def ValidateTargetType(target, target_dict): - """Ensures the 'type' field on the target is one of the known types. + """Ensures the 'type' field on the target is one of the known types. Arguments: target: string, name of target. @@ -2491,52 +2725,63 @@ def ValidateTargetType(target, target_dict): Raises an exception on error. """ - VALID_TARGET_TYPES = ('executable', 'loadable_module', - 'static_library', 'shared_library', - 'mac_kernel_extension', 'none') - target_type = target_dict.get('type', None) - if target_type not in VALID_TARGET_TYPES: - raise GypError("Target %s has an invalid target type '%s'. " - "Must be one of %s." % - (target, target_type, '/'.join(VALID_TARGET_TYPES))) - if (target_dict.get('standalone_static_library', 0) and - not target_type == 'static_library'): - raise GypError('Target %s has type %s but standalone_static_library flag is' - ' only valid for static_library type.' % (target, - target_type)) - - -def ValidateSourcesInTarget(target, target_dict, build_file, - duplicate_basename_check): - if not duplicate_basename_check: - return - if target_dict.get('type', None) != 'static_library': - return - sources = target_dict.get('sources', []) - basenames = {} - for source in sources: - name, ext = os.path.splitext(source) - is_compiled_file = ext in [ - '.c', '.cc', '.cpp', '.cxx', '.m', '.mm', '.s', '.S'] - if not is_compiled_file: - continue - basename = os.path.basename(name) # Don't include extension. - basenames.setdefault(basename, []).append(source) - - error = '' - for basename, files in basenames.items(): - if len(files) > 1: - error += ' %s: %s\n' % (basename, ' '.join(files)) - - if error: - print('static library %s has several files with the same basename:\n' % target - + error + 'libtool on Mac cannot handle that. Use ' - '--no-duplicate-basename-check to disable this validation.') - raise GypError('Duplicate basenames in sources section, see list above') + VALID_TARGET_TYPES = ( + "executable", + "loadable_module", + "static_library", + "shared_library", + "mac_kernel_extension", + "none", + "windows_driver", + ) + target_type = target_dict.get("type", None) + if target_type not in VALID_TARGET_TYPES: + raise GypError( + "Target %s has an invalid target type '%s'. " + "Must be one of %s." % (target, target_type, "/".join(VALID_TARGET_TYPES)) + ) + if ( + target_dict.get("standalone_static_library", 0) + and not target_type == "static_library" + ): + raise GypError( + "Target %s has type %s but standalone_static_library flag is" + " only valid for static_library type." % (target, target_type) + ) + + +def ValidateSourcesInTarget(target, target_dict, build_file, duplicate_basename_check): + if not duplicate_basename_check: + return + if target_dict.get("type", None) != "static_library": + return + sources = target_dict.get("sources", []) + basenames = {} + for source in sources: + name, ext = os.path.splitext(source) + is_compiled_file = ext in [".c", ".cc", ".cpp", ".cxx", ".m", ".mm", ".s", ".S"] + if not is_compiled_file: + continue + basename = os.path.basename(name) # Don't include extension. + basenames.setdefault(basename, []).append(source) + + error = "" + for basename, files in basenames.items(): + if len(files) > 1: + error += " %s: %s\n" % (basename, " ".join(files)) + + if error: + print( + "static library %s has several files with the same basename:\n" % target + + error + + "libtool on Mac cannot handle that. Use " + "--no-duplicate-basename-check to disable this validation." + ) + raise GypError("Duplicate basenames in sources section, see list above") def ValidateRulesInTarget(target, target_dict, extra_sources_for_rules): - """Ensures that the rules sections in target_dict are valid and consistent, + """Ensures that the rules sections in target_dict are valid and consistent, and determines which sources they apply to. Arguments: @@ -2546,357 +2791,393 @@ def ValidateRulesInTarget(target, target_dict, extra_sources_for_rules): addition to 'sources'. """ - # Dicts to map between values found in rules' 'rule_name' and 'extension' - # keys and the rule dicts themselves. - rule_names = {} - rule_extensions = {} - - rules = target_dict.get('rules', []) - for rule in rules: - # Make sure that there's no conflict among rule names and extensions. - rule_name = rule['rule_name'] - if rule_name in rule_names: - raise GypError('rule %s exists in duplicate, target %s' % - (rule_name, target)) - rule_names[rule_name] = rule - - rule_extension = rule['extension'] - if rule_extension.startswith('.'): - rule_extension = rule_extension[1:] - if rule_extension in rule_extensions: - raise GypError(('extension %s associated with multiple rules, ' + - 'target %s rules %s and %s') % - (rule_extension, target, - rule_extensions[rule_extension]['rule_name'], - rule_name)) - rule_extensions[rule_extension] = rule - - # Make sure rule_sources isn't already there. It's going to be - # created below if needed. - if 'rule_sources' in rule: - raise GypError( - 'rule_sources must not exist in input, target %s rule %s' % - (target, rule_name)) - - rule_sources = [] - source_keys = ['sources'] - source_keys.extend(extra_sources_for_rules) - for source_key in source_keys: - for source in target_dict.get(source_key, []): - (source_root, source_extension) = os.path.splitext(source) - if source_extension.startswith('.'): - source_extension = source_extension[1:] - if source_extension == rule_extension: - rule_sources.append(source) - - if len(rule_sources) > 0: - rule['rule_sources'] = rule_sources + # Dicts to map between values found in rules' 'rule_name' and 'extension' + # keys and the rule dicts themselves. + rule_names = {} + rule_extensions = {} + + rules = target_dict.get("rules", []) + for rule in rules: + # Make sure that there's no conflict among rule names and extensions. + rule_name = rule["rule_name"] + if rule_name in rule_names: + raise GypError( + "rule %s exists in duplicate, target %s" % (rule_name, target) + ) + rule_names[rule_name] = rule + + rule_extension = rule["extension"] + if rule_extension.startswith("."): + rule_extension = rule_extension[1:] + if rule_extension in rule_extensions: + raise GypError( + ( + "extension %s associated with multiple rules, " + + "target %s rules %s and %s" + ) + % ( + rule_extension, + target, + rule_extensions[rule_extension]["rule_name"], + rule_name, + ) + ) + rule_extensions[rule_extension] = rule + + # Make sure rule_sources isn't already there. It's going to be + # created below if needed. + if "rule_sources" in rule: + raise GypError( + "rule_sources must not exist in input, target %s rule %s" + % (target, rule_name) + ) + + rule_sources = [] + source_keys = ["sources"] + source_keys.extend(extra_sources_for_rules) + for source_key in source_keys: + for source in target_dict.get(source_key, []): + (source_root, source_extension) = os.path.splitext(source) + if source_extension.startswith("."): + source_extension = source_extension[1:] + if source_extension == rule_extension: + rule_sources.append(source) + + if len(rule_sources) > 0: + rule["rule_sources"] = rule_sources def ValidateRunAsInTarget(target, target_dict, build_file): - target_name = target_dict.get('target_name') - run_as = target_dict.get('run_as') - if not run_as: - return - if type(run_as) is not dict: - raise GypError("The 'run_as' in target %s from file %s should be a " - "dictionary." % - (target_name, build_file)) - action = run_as.get('action') - if not action: - raise GypError("The 'run_as' in target %s from file %s must have an " - "'action' section." % - (target_name, build_file)) - if type(action) is not list: - raise GypError("The 'action' for 'run_as' in target %s from file %s " - "must be a list." % - (target_name, build_file)) - working_directory = run_as.get('working_directory') - if working_directory and type(working_directory) is not str: - raise GypError("The 'working_directory' for 'run_as' in target %s " - "in file %s should be a string." % - (target_name, build_file)) - environment = run_as.get('environment') - if environment and type(environment) is not dict: - raise GypError("The 'environment' for 'run_as' in target %s " - "in file %s should be a dictionary." % - (target_name, build_file)) + target_name = target_dict.get("target_name") + run_as = target_dict.get("run_as") + if not run_as: + return + if type(run_as) is not dict: + raise GypError( + "The 'run_as' in target %s from file %s should be a " + "dictionary." % (target_name, build_file) + ) + action = run_as.get("action") + if not action: + raise GypError( + "The 'run_as' in target %s from file %s must have an " + "'action' section." % (target_name, build_file) + ) + if type(action) is not list: + raise GypError( + "The 'action' for 'run_as' in target %s from file %s " + "must be a list." % (target_name, build_file) + ) + working_directory = run_as.get("working_directory") + if working_directory and type(working_directory) is not str: + raise GypError( + "The 'working_directory' for 'run_as' in target %s " + "in file %s should be a string." % (target_name, build_file) + ) + environment = run_as.get("environment") + if environment and type(environment) is not dict: + raise GypError( + "The 'environment' for 'run_as' in target %s " + "in file %s should be a dictionary." % (target_name, build_file) + ) def ValidateActionsInTarget(target, target_dict, build_file): - '''Validates the inputs to the actions in a target.''' - target_name = target_dict.get('target_name') - actions = target_dict.get('actions', []) - for action in actions: - action_name = action.get('action_name') - if not action_name: - raise GypError("Anonymous action in target %s. " - "An action must have an 'action_name' field." % - target_name) - inputs = action.get('inputs', None) - if inputs is None: - raise GypError('Action in target %s has no inputs.' % target_name) - action_command = action.get('action') - if action_command and not action_command[0]: - raise GypError("Empty action as command in target %s." % target_name) + """Validates the inputs to the actions in a target.""" + target_name = target_dict.get("target_name") + actions = target_dict.get("actions", []) + for action in actions: + action_name = action.get("action_name") + if not action_name: + raise GypError( + "Anonymous action in target %s. " + "An action must have an 'action_name' field." % target_name + ) + inputs = action.get("inputs", None) + if inputs is None: + raise GypError("Action in target %s has no inputs." % target_name) + action_command = action.get("action") + if action_command and not action_command[0]: + raise GypError("Empty action as command in target %s." % target_name) def TurnIntIntoStrInDict(the_dict): - """Given dict the_dict, recursively converts all integers into strings. + """Given dict the_dict, recursively converts all integers into strings. """ - # Use items instead of items because there's no need to try to look at - # reinserted keys and their associated values. - for k, v in the_dict.items(): - if type(v) is int: - v = str(v) - the_dict[k] = v - elif type(v) is dict: - TurnIntIntoStrInDict(v) - elif type(v) is list: - TurnIntIntoStrInList(v) - - if type(k) is int: - del the_dict[k] - the_dict[str(k)] = v + # Use items instead of iteritems because there's no need to try to look at + # reinserted keys and their associated values. + for k, v in the_dict.items(): + if type(v) is int: + v = str(v) + the_dict[k] = v + elif type(v) is dict: + TurnIntIntoStrInDict(v) + elif type(v) is list: + TurnIntIntoStrInList(v) + + if type(k) is int: + del the_dict[k] + the_dict[str(k)] = v def TurnIntIntoStrInList(the_list): - """Given list the_list, recursively converts all integers into strings. + """Given list the_list, recursively converts all integers into strings. """ - for index in range(0, len(the_list)): - item = the_list[index] - if type(item) is int: - the_list[index] = str(item) - elif type(item) is dict: - TurnIntIntoStrInDict(item) - elif type(item) is list: - TurnIntIntoStrInList(item) - - -def PruneUnwantedTargets(targets, flat_list, dependency_nodes, root_targets, - data): - """Return only the targets that are deep dependencies of |root_targets|.""" - qualified_root_targets = [] - for target in root_targets: - target = target.strip() - qualified_targets = gyp.common.FindQualifiedTargets(target, flat_list) - if not qualified_targets: - raise GypError("Could not find target %s" % target) - qualified_root_targets.extend(qualified_targets) - - wanted_targets = {} - for target in qualified_root_targets: - wanted_targets[target] = targets[target] - for dependency in dependency_nodes[target].DeepDependencies(): - wanted_targets[dependency] = targets[dependency] - - wanted_flat_list = [t for t in flat_list if t in wanted_targets] - - # Prune unwanted targets from each build_file's data dict. - for build_file in data['target_build_files']: - if not 'targets' in data[build_file]: - continue - new_targets = [] - for target in data[build_file]['targets']: - qualified_name = gyp.common.QualifiedTarget(build_file, - target['target_name'], - target['toolset']) - if qualified_name in wanted_targets: - new_targets.append(target) - data[build_file]['targets'] = new_targets - - return wanted_targets, wanted_flat_list + for index, item in enumerate(the_list): + if type(item) is int: + the_list[index] = str(item) + elif type(item) is dict: + TurnIntIntoStrInDict(item) + elif type(item) is list: + TurnIntIntoStrInList(item) + + +def PruneUnwantedTargets(targets, flat_list, dependency_nodes, root_targets, data): + """Return only the targets that are deep dependencies of |root_targets|.""" + qualified_root_targets = [] + for target in root_targets: + target = target.strip() + qualified_targets = gyp.common.FindQualifiedTargets(target, flat_list) + if not qualified_targets: + raise GypError("Could not find target %s" % target) + qualified_root_targets.extend(qualified_targets) + + wanted_targets = {} + for target in qualified_root_targets: + wanted_targets[target] = targets[target] + for dependency in dependency_nodes[target].DeepDependencies(): + wanted_targets[dependency] = targets[dependency] + + wanted_flat_list = [t for t in flat_list if t in wanted_targets] + + # Prune unwanted targets from each build_file's data dict. + for build_file in data["target_build_files"]: + if "targets" not in data[build_file]: + continue + new_targets = [] + for target in data[build_file]["targets"]: + qualified_name = gyp.common.QualifiedTarget( + build_file, target["target_name"], target["toolset"] + ) + if qualified_name in wanted_targets: + new_targets.append(target) + data[build_file]["targets"] = new_targets + + return wanted_targets, wanted_flat_list def VerifyNoCollidingTargets(targets): - """Verify that no two targets in the same directory share the same name. + """Verify that no two targets in the same directory share the same name. Arguments: targets: A list of targets in the form 'path/to/file.gyp:target_name'. """ - # Keep a dict going from 'subdirectory:target_name' to 'foo.gyp'. - used = {} - for target in targets: - # Separate out 'path/to/file.gyp, 'target_name' from - # 'path/to/file.gyp:target_name'. - path, name = target.rsplit(':', 1) - # Separate out 'path/to', 'file.gyp' from 'path/to/file.gyp'. - subdir, gyp = os.path.split(path) - # Use '.' for the current directory '', so that the error messages make - # more sense. - if not subdir: - subdir = '.' - # Prepare a key like 'path/to:target_name'. - key = subdir + ':' + name - if key in used: - # Complain if this target is already used. - raise GypError('Duplicate target name "%s" in directory "%s" used both ' - 'in "%s" and "%s".' % (name, subdir, gyp, used[key])) - used[key] = gyp + # Keep a dict going from 'subdirectory:target_name' to 'foo.gyp'. + used = {} + for target in targets: + # Separate out 'path/to/file.gyp, 'target_name' from + # 'path/to/file.gyp:target_name'. + path, name = target.rsplit(":", 1) + # Separate out 'path/to', 'file.gyp' from 'path/to/file.gyp'. + subdir, gyp = os.path.split(path) + # Use '.' for the current directory '', so that the error messages make + # more sense. + if not subdir: + subdir = "." + # Prepare a key like 'path/to:target_name'. + key = subdir + ":" + name + if key in used: + # Complain if this target is already used. + raise GypError( + 'Duplicate target name "%s" in directory "%s" used both ' + 'in "%s" and "%s".' % (name, subdir, gyp, used[key]) + ) + used[key] = gyp def SetGeneratorGlobals(generator_input_info): - # Set up path_sections and non_configuration_keys with the default data plus - # the generator-specific data. - global path_sections - path_sections = set(base_path_sections) - path_sections.update(generator_input_info['path_sections']) - - global non_configuration_keys - non_configuration_keys = base_non_configuration_keys[:] - non_configuration_keys.extend(generator_input_info['non_configuration_keys']) - - global multiple_toolsets - multiple_toolsets = generator_input_info[ - 'generator_supports_multiple_toolsets'] - - global generator_filelist_paths - generator_filelist_paths = generator_input_info['generator_filelist_paths'] - - -def Load(build_files, variables, includes, depth, generator_input_info, check, - circular_check, duplicate_basename_check, parallel, root_targets): - SetGeneratorGlobals(generator_input_info) - # A generator can have other lists (in addition to sources) be processed - # for rules. - extra_sources_for_rules = generator_input_info['extra_sources_for_rules'] - - # Load build files. This loads every target-containing build file into - # the |data| dictionary such that the keys to |data| are build file names, - # and the values are the entire build file contents after "early" or "pre" - # processing has been done and includes have been resolved. - # NOTE: data contains both "target" files (.gyp) and "includes" (.gypi), as - # well as meta-data (e.g. 'included_files' key). 'target_build_files' keeps - # track of the keys corresponding to "target" files. - data = {'target_build_files': set()} - # Normalize paths everywhere. This is important because paths will be - # used as keys to the data dict and for references between input files. - build_files = set(map(os.path.normpath, build_files)) - if parallel: - LoadTargetBuildFilesParallel(build_files, data, variables, includes, depth, - check, generator_input_info) - else: - aux_data = {} - for build_file in build_files: - try: - LoadTargetBuildFile(build_file, data, aux_data, - variables, includes, depth, check, True) - except Exception as e: - gyp.common.ExceptionAppend(e, 'while trying to load %s' % build_file) - raise - - # Build a dict to access each target's subdict by qualified name. - targets = BuildTargetsDict(data) - - # Fully qualify all dependency links. - QualifyDependencies(targets) - - # Remove self-dependencies from targets that have 'prune_self_dependencies' - # set to 1. - RemoveSelfDependencies(targets) - - # Expand dependencies specified as build_file:*. - ExpandWildcardDependencies(targets, data) - - # Remove all dependencies marked as 'link_dependency' from the targets of - # type 'none'. - RemoveLinkDependenciesFromNoneTargets(targets) - - # Apply exclude (!) and regex (/) list filters only for dependency_sections. - for target_name, target_dict in targets.items(): - tmp_dict = {} - for key_base in dependency_sections: - for op in ('', '!', '/'): - key = key_base + op - if key in target_dict: - tmp_dict[key] = target_dict[key] - del target_dict[key] - ProcessListFiltersInDict(target_name, tmp_dict) - # Write the results back to |target_dict|. - for key in tmp_dict: - target_dict[key] = tmp_dict[key] - - # Make sure every dependency appears at most once. - RemoveDuplicateDependencies(targets) - - if circular_check: - # Make sure that any targets in a.gyp don't contain dependencies in other - # .gyp files that further depend on a.gyp. - VerifyNoGYPFileCircularDependencies(targets) - - [dependency_nodes, flat_list] = BuildDependencyList(targets) - - if root_targets: - # Remove, from |targets| and |flat_list|, the targets that are not deep - # dependencies of the targets specified in |root_targets|. - targets, flat_list = PruneUnwantedTargets( - targets, flat_list, dependency_nodes, root_targets, data) - - # Check that no two targets in the same directory have the same name. - VerifyNoCollidingTargets(flat_list) - - # Handle dependent settings of various types. - for settings_type in ['all_dependent_settings', - 'direct_dependent_settings', - 'link_settings']: - DoDependentSettings(settings_type, flat_list, targets, dependency_nodes) - - # Take out the dependent settings now that they've been published to all - # of the targets that require them. + # Set up path_sections and non_configuration_keys with the default data plus + # the generator-specific data. + global path_sections + path_sections = set(base_path_sections) + path_sections.update(generator_input_info["path_sections"]) + + global non_configuration_keys + non_configuration_keys = base_non_configuration_keys[:] + non_configuration_keys.extend(generator_input_info["non_configuration_keys"]) + + global multiple_toolsets + multiple_toolsets = generator_input_info["generator_supports_multiple_toolsets"] + + global generator_filelist_paths + generator_filelist_paths = generator_input_info["generator_filelist_paths"] + + +def Load( + build_files, + variables, + includes, + depth, + generator_input_info, + check, + circular_check, + duplicate_basename_check, + parallel, + root_targets, +): + SetGeneratorGlobals(generator_input_info) + # A generator can have other lists (in addition to sources) be processed + # for rules. + extra_sources_for_rules = generator_input_info["extra_sources_for_rules"] + + # Load build files. This loads every target-containing build file into + # the |data| dictionary such that the keys to |data| are build file names, + # and the values are the entire build file contents after "early" or "pre" + # processing has been done and includes have been resolved. + # NOTE: data contains both "target" files (.gyp) and "includes" (.gypi), as + # well as meta-data (e.g. 'included_files' key). 'target_build_files' keeps + # track of the keys corresponding to "target" files. + data = {"target_build_files": set()} + # Normalize paths everywhere. This is important because paths will be + # used as keys to the data dict and for references between input files. + build_files = set(map(os.path.normpath, build_files)) + if parallel: + LoadTargetBuildFilesParallel( + build_files, data, variables, includes, depth, check, generator_input_info + ) + else: + aux_data = {} + for build_file in build_files: + try: + LoadTargetBuildFile( + build_file, data, aux_data, variables, includes, depth, check, True + ) + except Exception as e: + gyp.common.ExceptionAppend(e, "while trying to load %s" % build_file) + raise + + # Build a dict to access each target's subdict by qualified name. + targets = BuildTargetsDict(data) + + # Fully qualify all dependency links. + QualifyDependencies(targets) + + # Remove self-dependencies from targets that have 'prune_self_dependencies' + # set to 1. + RemoveSelfDependencies(targets) + + # Expand dependencies specified as build_file:*. + ExpandWildcardDependencies(targets, data) + + # Remove all dependencies marked as 'link_dependency' from the targets of + # type 'none'. + RemoveLinkDependenciesFromNoneTargets(targets) + + # Apply exclude (!) and regex (/) list filters only for dependency_sections. + for target_name, target_dict in targets.items(): + tmp_dict = {} + for key_base in dependency_sections: + for op in ("", "!", "/"): + key = key_base + op + if key in target_dict: + tmp_dict[key] = target_dict[key] + del target_dict[key] + ProcessListFiltersInDict(target_name, tmp_dict) + # Write the results back to |target_dict|. + for key in tmp_dict: + target_dict[key] = tmp_dict[key] + + # Make sure every dependency appears at most once. + RemoveDuplicateDependencies(targets) + + if circular_check: + # Make sure that any targets in a.gyp don't contain dependencies in other + # .gyp files that further depend on a.gyp. + VerifyNoGYPFileCircularDependencies(targets) + + [dependency_nodes, flat_list] = BuildDependencyList(targets) + + if root_targets: + # Remove, from |targets| and |flat_list|, the targets that are not deep + # dependencies of the targets specified in |root_targets|. + targets, flat_list = PruneUnwantedTargets( + targets, flat_list, dependency_nodes, root_targets, data + ) + + # Check that no two targets in the same directory have the same name. + VerifyNoCollidingTargets(flat_list) + + # Handle dependent settings of various types. + for settings_type in [ + "all_dependent_settings", + "direct_dependent_settings", + "link_settings", + ]: + DoDependentSettings(settings_type, flat_list, targets, dependency_nodes) + + # Take out the dependent settings now that they've been published to all + # of the targets that require them. + for target in flat_list: + if settings_type in targets[target]: + del targets[target][settings_type] + + # Make sure static libraries don't declare dependencies on other static + # libraries, but that linkables depend on all unlinked static libraries + # that they need so that their link steps will be correct. + gii = generator_input_info + if gii["generator_wants_static_library_dependencies_adjusted"]: + AdjustStaticLibraryDependencies( + flat_list, + targets, + dependency_nodes, + gii["generator_wants_sorted_dependencies"], + ) + + # Apply "post"/"late"/"target" variable expansions and condition evaluations. for target in flat_list: - if settings_type in targets[target]: - del targets[target][settings_type] - - # Make sure static libraries don't declare dependencies on other static - # libraries, but that linkables depend on all unlinked static libraries - # that they need so that their link steps will be correct. - gii = generator_input_info - if gii['generator_wants_static_library_dependencies_adjusted']: - AdjustStaticLibraryDependencies(flat_list, targets, dependency_nodes, - gii['generator_wants_sorted_dependencies']) - - # Apply "post"/"late"/"target" variable expansions and condition evaluations. - for target in flat_list: - target_dict = targets[target] - build_file = gyp.common.BuildFile(target) - ProcessVariablesAndConditionsInDict( - target_dict, PHASE_LATE, variables, build_file) + target_dict = targets[target] + build_file = gyp.common.BuildFile(target) + ProcessVariablesAndConditionsInDict( + target_dict, PHASE_LATE, variables, build_file + ) - # Move everything that can go into a "configurations" section into one. - for target in flat_list: - target_dict = targets[target] - SetUpConfigurations(target, target_dict) + # Move everything that can go into a "configurations" section into one. + for target in flat_list: + target_dict = targets[target] + SetUpConfigurations(target, target_dict) - # Apply exclude (!) and regex (/) list filters. - for target in flat_list: - target_dict = targets[target] - ProcessListFiltersInDict(target, target_dict) + # Apply exclude (!) and regex (/) list filters. + for target in flat_list: + target_dict = targets[target] + ProcessListFiltersInDict(target, target_dict) - # Apply "latelate" variable expansions and condition evaluations. - for target in flat_list: - target_dict = targets[target] - build_file = gyp.common.BuildFile(target) - ProcessVariablesAndConditionsInDict( - target_dict, PHASE_LATELATE, variables, build_file) - - # Make sure that the rules make sense, and build up rule_sources lists as - # needed. Not all generators will need to use the rule_sources lists, but - # some may, and it seems best to build the list in a common spot. - # Also validate actions and run_as elements in targets. - for target in flat_list: - target_dict = targets[target] - build_file = gyp.common.BuildFile(target) - ValidateTargetType(target, target_dict) - ValidateSourcesInTarget(target, target_dict, build_file, - duplicate_basename_check) - ValidateRulesInTarget(target, target_dict, extra_sources_for_rules) - ValidateRunAsInTarget(target, target_dict, build_file) - ValidateActionsInTarget(target, target_dict, build_file) - - # Generators might not expect ints. Turn them into strs. - TurnIntIntoStrInDict(data) - - # TODO(mark): Return |data| for now because the generator needs a list of - # build files that came in. In the future, maybe it should just accept - # a list, and not the whole data dict. - return [flat_list, targets, data] + # Apply "latelate" variable expansions and condition evaluations. + for target in flat_list: + target_dict = targets[target] + build_file = gyp.common.BuildFile(target) + ProcessVariablesAndConditionsInDict( + target_dict, PHASE_LATELATE, variables, build_file + ) + + # Make sure that the rules make sense, and build up rule_sources lists as + # needed. Not all generators will need to use the rule_sources lists, but + # some may, and it seems best to build the list in a common spot. + # Also validate actions and run_as elements in targets. + for target in flat_list: + target_dict = targets[target] + build_file = gyp.common.BuildFile(target) + ValidateTargetType(target, target_dict) + ValidateSourcesInTarget( + target, target_dict, build_file, duplicate_basename_check + ) + ValidateRulesInTarget(target, target_dict, extra_sources_for_rules) + ValidateRunAsInTarget(target, target_dict, build_file) + ValidateActionsInTarget(target, target_dict, build_file) + + # Generators might not expect ints. Turn them into strs. + TurnIntIntoStrInDict(data) + + # TODO(mark): Return |data| for now because the generator needs a list of + # build files that came in. In the future, maybe it should just accept + # a list, and not the whole data dict. + return [flat_list, targets, data] diff --git a/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/input_test.py b/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/input_test.py index 1bc5e3d3081ea6..6672ddc014b150 100755 --- a/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/input_test.py +++ b/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/input_test.py @@ -8,83 +8,91 @@ import gyp.input import unittest -import sys class TestFindCycles(unittest.TestCase): - def setUp(self): - self.nodes = {} - for x in ('a', 'b', 'c', 'd', 'e'): - self.nodes[x] = gyp.input.DependencyGraphNode(x) - - def _create_dependency(self, dependent, dependency): - dependent.dependencies.append(dependency) - dependency.dependents.append(dependent) - - def test_no_cycle_empty_graph(self): - for label, node in self.nodes.items(): - self.assertEqual([], node.FindCycles()) - - def test_no_cycle_line(self): - self._create_dependency(self.nodes['a'], self.nodes['b']) - self._create_dependency(self.nodes['b'], self.nodes['c']) - self._create_dependency(self.nodes['c'], self.nodes['d']) - - for label, node in self.nodes.items(): - self.assertEqual([], node.FindCycles()) - - def test_no_cycle_dag(self): - self._create_dependency(self.nodes['a'], self.nodes['b']) - self._create_dependency(self.nodes['a'], self.nodes['c']) - self._create_dependency(self.nodes['b'], self.nodes['c']) - - for label, node in self.nodes.items(): - self.assertEqual([], node.FindCycles()) - - def test_cycle_self_reference(self): - self._create_dependency(self.nodes['a'], self.nodes['a']) - - self.assertEqual([[self.nodes['a'], self.nodes['a']]], - self.nodes['a'].FindCycles()) - - def test_cycle_two_nodes(self): - self._create_dependency(self.nodes['a'], self.nodes['b']) - self._create_dependency(self.nodes['b'], self.nodes['a']) - - self.assertEqual([[self.nodes['a'], self.nodes['b'], self.nodes['a']]], - self.nodes['a'].FindCycles()) - self.assertEqual([[self.nodes['b'], self.nodes['a'], self.nodes['b']]], - self.nodes['b'].FindCycles()) - - def test_two_cycles(self): - self._create_dependency(self.nodes['a'], self.nodes['b']) - self._create_dependency(self.nodes['b'], self.nodes['a']) - - self._create_dependency(self.nodes['b'], self.nodes['c']) - self._create_dependency(self.nodes['c'], self.nodes['b']) - - cycles = self.nodes['a'].FindCycles() - self.assertTrue( - [self.nodes['a'], self.nodes['b'], self.nodes['a']] in cycles) - self.assertTrue( - [self.nodes['b'], self.nodes['c'], self.nodes['b']] in cycles) - self.assertEqual(2, len(cycles)) - - def test_big_cycle(self): - self._create_dependency(self.nodes['a'], self.nodes['b']) - self._create_dependency(self.nodes['b'], self.nodes['c']) - self._create_dependency(self.nodes['c'], self.nodes['d']) - self._create_dependency(self.nodes['d'], self.nodes['e']) - self._create_dependency(self.nodes['e'], self.nodes['a']) - - self.assertEqual([[self.nodes['a'], - self.nodes['b'], - self.nodes['c'], - self.nodes['d'], - self.nodes['e'], - self.nodes['a']]], - self.nodes['a'].FindCycles()) - - -if __name__ == '__main__': - unittest.main() + def setUp(self): + self.nodes = {} + for x in ("a", "b", "c", "d", "e"): + self.nodes[x] = gyp.input.DependencyGraphNode(x) + + def _create_dependency(self, dependent, dependency): + dependent.dependencies.append(dependency) + dependency.dependents.append(dependent) + + def test_no_cycle_empty_graph(self): + for label, node in self.nodes.items(): + self.assertEqual([], node.FindCycles()) + + def test_no_cycle_line(self): + self._create_dependency(self.nodes["a"], self.nodes["b"]) + self._create_dependency(self.nodes["b"], self.nodes["c"]) + self._create_dependency(self.nodes["c"], self.nodes["d"]) + + for label, node in self.nodes.items(): + self.assertEqual([], node.FindCycles()) + + def test_no_cycle_dag(self): + self._create_dependency(self.nodes["a"], self.nodes["b"]) + self._create_dependency(self.nodes["a"], self.nodes["c"]) + self._create_dependency(self.nodes["b"], self.nodes["c"]) + + for label, node in self.nodes.items(): + self.assertEqual([], node.FindCycles()) + + def test_cycle_self_reference(self): + self._create_dependency(self.nodes["a"], self.nodes["a"]) + + self.assertEqual( + [[self.nodes["a"], self.nodes["a"]]], self.nodes["a"].FindCycles() + ) + + def test_cycle_two_nodes(self): + self._create_dependency(self.nodes["a"], self.nodes["b"]) + self._create_dependency(self.nodes["b"], self.nodes["a"]) + + self.assertEqual( + [[self.nodes["a"], self.nodes["b"], self.nodes["a"]]], + self.nodes["a"].FindCycles(), + ) + self.assertEqual( + [[self.nodes["b"], self.nodes["a"], self.nodes["b"]]], + self.nodes["b"].FindCycles(), + ) + + def test_two_cycles(self): + self._create_dependency(self.nodes["a"], self.nodes["b"]) + self._create_dependency(self.nodes["b"], self.nodes["a"]) + + self._create_dependency(self.nodes["b"], self.nodes["c"]) + self._create_dependency(self.nodes["c"], self.nodes["b"]) + + cycles = self.nodes["a"].FindCycles() + self.assertTrue([self.nodes["a"], self.nodes["b"], self.nodes["a"]] in cycles) + self.assertTrue([self.nodes["b"], self.nodes["c"], self.nodes["b"]] in cycles) + self.assertEqual(2, len(cycles)) + + def test_big_cycle(self): + self._create_dependency(self.nodes["a"], self.nodes["b"]) + self._create_dependency(self.nodes["b"], self.nodes["c"]) + self._create_dependency(self.nodes["c"], self.nodes["d"]) + self._create_dependency(self.nodes["d"], self.nodes["e"]) + self._create_dependency(self.nodes["e"], self.nodes["a"]) + + self.assertEqual( + [ + [ + self.nodes["a"], + self.nodes["b"], + self.nodes["c"], + self.nodes["d"], + self.nodes["e"], + self.nodes["a"], + ] + ], + self.nodes["a"].FindCycles(), + ) + + +if __name__ == "__main__": + unittest.main() diff --git a/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/mac_tool.py b/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/mac_tool.py index 222befb982a9d4..07412578d19a24 100755 --- a/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/mac_tool.py +++ b/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/mac_tool.py @@ -18,7 +18,7 @@ import plistlib import re import shutil -import string +import struct import subprocess import sys import tempfile @@ -27,276 +27,345 @@ def main(args): - executor = MacTool() - exit_code = executor.Dispatch(args) - if exit_code is not None: - sys.exit(exit_code) + executor = MacTool() + exit_code = executor.Dispatch(args) + if exit_code is not None: + sys.exit(exit_code) class MacTool(object): - """This class performs all the Mac tooling steps. The methods can either be + """This class performs all the Mac tooling steps. The methods can either be executed directly, or dispatched from an argument list.""" - def Dispatch(self, args): - """Dispatches a string command to a method.""" - if len(args) < 1: - raise Exception("Not enough arguments") + def Dispatch(self, args): + """Dispatches a string command to a method.""" + if len(args) < 1: + raise Exception("Not enough arguments") - method = "Exec%s" % self._CommandifyName(args[0]) - return getattr(self, method)(*args[1:]) + method = "Exec%s" % self._CommandifyName(args[0]) + return getattr(self, method)(*args[1:]) - def _CommandifyName(self, name_string): - """Transforms a tool name like copy-info-plist to CopyInfoPlist""" - return name_string.title().replace('-', '') + def _CommandifyName(self, name_string): + """Transforms a tool name like copy-info-plist to CopyInfoPlist""" + return name_string.title().replace("-", "") - def ExecCopyBundleResource(self, source, dest, convert_to_binary): - """Copies a resource file to the bundle/Resources directory, performing any + def ExecCopyBundleResource(self, source, dest, convert_to_binary): + """Copies a resource file to the bundle/Resources directory, performing any necessary compilation on each resource.""" - extension = os.path.splitext(source)[1].lower() - if os.path.isdir(source): - # Copy tree. - # TODO(thakis): This copies file attributes like mtime, while the - # single-file branch below doesn't. This should probably be changed to - # be consistent with the single-file branch. - if os.path.exists(dest): - shutil.rmtree(dest) - shutil.copytree(source, dest) - elif extension == '.xib': - return self._CopyXIBFile(source, dest) - elif extension == '.storyboard': - return self._CopyXIBFile(source, dest) - elif extension == '.strings': - self._CopyStringsFile(source, dest, convert_to_binary) - else: - shutil.copy(source, dest) - - def _CopyXIBFile(self, source, dest): - """Compiles a XIB file with ibtool into a binary plist in the bundle.""" - - # ibtool sometimes crashes with relative paths. See crbug.com/314728. - base = os.path.dirname(os.path.realpath(__file__)) - if os.path.relpath(source): - source = os.path.join(base, source) - if os.path.relpath(dest): - dest = os.path.join(base, dest) - - args = ['xcrun', 'ibtool', '--errors', '--warnings', '--notices', - '--output-format', 'human-readable-text', '--compile', dest, source] - ibtool_section_re = re.compile(r'/\*.*\*/') - ibtool_re = re.compile(r'.*note:.*is clipping its content') - ibtoolout = subprocess.Popen(args, stdout=subprocess.PIPE) - current_section_header = None - for line in ibtoolout.stdout: - if ibtool_section_re.match(line): - current_section_header = line - elif not ibtool_re.match(line): - if current_section_header: - sys.stdout.write(current_section_header) - current_section_header = None - sys.stdout.write(line) - return ibtoolout.returncode - - def _ConvertToBinary(self, dest): - subprocess.check_call([ - 'xcrun', 'plutil', '-convert', 'binary1', '-o', dest, dest]) - - def _CopyStringsFile(self, source, dest, convert_to_binary): - """Copies a .strings file using iconv to reconvert the input into UTF-16.""" - input_code = self._DetectInputEncoding(source) or "UTF-8" - - # Xcode's CpyCopyStringsFile / builtin-copyStrings seems to call - # CFPropertyListCreateFromXMLData() behind the scenes; at least it prints - # CFPropertyListCreateFromXMLData(): Old-style plist parser: missing - # semicolon in dictionary. - # on invalid files. Do the same kind of validation. - import CoreFoundation - s = open(source, 'rb').read() - d = CoreFoundation.CFDataCreate(None, s, len(s)) - _, error = CoreFoundation.CFPropertyListCreateFromXMLData(None, d, 0, None) - if error: - return - - fp = open(dest, 'wb') - fp.write(s.decode(input_code).encode('UTF-16')) - fp.close() - - if convert_to_binary == 'True': - self._ConvertToBinary(dest) - - def _DetectInputEncoding(self, file_name): - """Reads the first few bytes from file_name and tries to guess the text + convert_to_binary = convert_to_binary == "True" + extension = os.path.splitext(source)[1].lower() + if os.path.isdir(source): + # Copy tree. + # TODO(thakis): This copies file attributes like mtime, while the + # single-file branch below doesn't. This should probably be changed to + # be consistent with the single-file branch. + if os.path.exists(dest): + shutil.rmtree(dest) + shutil.copytree(source, dest) + elif extension == ".xib": + return self._CopyXIBFile(source, dest) + elif extension == ".storyboard": + return self._CopyXIBFile(source, dest) + elif extension == ".strings" and not convert_to_binary: + self._CopyStringsFile(source, dest) + else: + if os.path.exists(dest): + os.unlink(dest) + shutil.copy(source, dest) + + if convert_to_binary and extension in (".plist", ".strings"): + self._ConvertToBinary(dest) + + def _CopyXIBFile(self, source, dest): + """Compiles a XIB file with ibtool into a binary plist in the bundle.""" + + # ibtool sometimes crashes with relative paths. See crbug.com/314728. + base = os.path.dirname(os.path.realpath(__file__)) + if os.path.relpath(source): + source = os.path.join(base, source) + if os.path.relpath(dest): + dest = os.path.join(base, dest) + + args = ["xcrun", "ibtool", "--errors", "--warnings", "--notices"] + + if os.environ["XCODE_VERSION_ACTUAL"] > "0700": + args.extend(["--auto-activate-custom-fonts"]) + if "IPHONEOS_DEPLOYMENT_TARGET" in os.environ: + args.extend( + [ + "--target-device", + "iphone", + "--target-device", + "ipad", + "--minimum-deployment-target", + os.environ["IPHONEOS_DEPLOYMENT_TARGET"], + ] + ) + else: + args.extend( + [ + "--target-device", + "mac", + "--minimum-deployment-target", + os.environ["MACOSX_DEPLOYMENT_TARGET"], + ] + ) + + args.extend( + ["--output-format", "human-readable-text", "--compile", dest, source] + ) + + ibtool_section_re = re.compile(r"/\*.*\*/") + ibtool_re = re.compile(r".*note:.*is clipping its content") + try: + stdout = subprocess.check_output(args) + except subprocess.CalledProcessError as e: + print(e.output) + raise + current_section_header = None + for line in stdout.splitlines(): + if ibtool_section_re.match(line): + current_section_header = line + elif not ibtool_re.match(line): + if current_section_header: + print(current_section_header) + current_section_header = None + print(line) + return 0 + + def _ConvertToBinary(self, dest): + subprocess.check_call( + ["xcrun", "plutil", "-convert", "binary1", "-o", dest, dest] + ) + + def _CopyStringsFile(self, source, dest): + """Copies a .strings file using iconv to reconvert the input into UTF-16.""" + input_code = self._DetectInputEncoding(source) or "UTF-8" + + # Xcode's CpyCopyStringsFile / builtin-copyStrings seems to call + # CFPropertyListCreateFromXMLData() behind the scenes; at least it prints + # CFPropertyListCreateFromXMLData(): Old-style plist parser: missing + # semicolon in dictionary. + # on invalid files. Do the same kind of validation. + import CoreFoundation + + with open(source, "rb") as in_file: + s = in_file.read() + d = CoreFoundation.CFDataCreate(None, s, len(s)) + _, error = CoreFoundation.CFPropertyListCreateFromXMLData(None, d, 0, None) + if error: + return + + with open(dest, "wb") as fp: + fp.write(s.decode(input_code).encode("UTF-16")) + + def _DetectInputEncoding(self, file_name): + """Reads the first few bytes from file_name and tries to guess the text encoding. Returns None as a guess if it can't detect it.""" - fp = open(file_name, 'rb') - try: - header = fp.read(3) - except Exception: - fp.close() - return None - fp.close() - if header.startswith("\xFE\xFF"): - return "UTF-16" - elif header.startswith("\xFF\xFE"): - return "UTF-16" - elif header.startswith("\xEF\xBB\xBF"): - return "UTF-8" - else: - return None - - def ExecCopyInfoPlist(self, source, dest, convert_to_binary, *keys): - """Copies the |source| Info.plist to the destination directory |dest|.""" - # Read the source Info.plist into memory. - fd = open(source, 'r') - lines = fd.read() - fd.close() - - # Insert synthesized key/value pairs (e.g. BuildMachineOSBuild). - plist = plistlib.readPlistFromString(lines) - if keys: - plist = dict(plist.items() + json.loads(keys[0]).items()) - lines = plistlib.writePlistToString(plist) - - # Go through all the environment variables and replace them as variables in - # the file. - IDENT_RE = re.compile(r'[/\s]') - for key in os.environ: - if key.startswith('_'): - continue - evar = '${%s}' % key - evalue = os.environ[key] - lines = string.replace(lines, evar, evalue) - - # Xcode supports various suffices on environment variables, which are - # all undocumented. :rfc1034identifier is used in the standard project - # template these days, and :identifier was used earlier. They are used to - # convert non-url characters into things that look like valid urls -- - # except that the replacement character for :identifier, '_' isn't valid - # in a URL either -- oops, hence :rfc1034identifier was born. - evar = '${%s:identifier}' % key - evalue = IDENT_RE.sub('_', os.environ[key]) - lines = string.replace(lines, evar, evalue) - - evar = '${%s:rfc1034identifier}' % key - evalue = IDENT_RE.sub('-', os.environ[key]) - lines = string.replace(lines, evar, evalue) - - # Remove any keys with values that haven't been replaced. - lines = lines.split('\n') - for i in range(len(lines)): - if lines[i].strip().startswith("${"): - lines[i] = None - lines[i - 1] = None - lines = '\n'.join(filter(lambda x: x is not None, lines)) - - # Write out the file with variables replaced. - fd = open(dest, 'w') - fd.write(lines) - fd.close() - - # Now write out PkgInfo file now that the Info.plist file has been - # "compiled". - self._WritePkgInfo(dest) - - if convert_to_binary == 'True': - self._ConvertToBinary(dest) - - def _WritePkgInfo(self, info_plist): - """This writes the PkgInfo file from the data stored in Info.plist.""" - plist = plistlib.readPlist(info_plist) - if not plist: - return - - # Only create PkgInfo for executable types. - package_type = plist['CFBundlePackageType'] - if package_type != 'APPL': - return - - # The format of PkgInfo is eight characters, representing the bundle type - # and bundle signature, each four characters. If that is missing, four - # '?' characters are used instead. - signature_code = plist.get('CFBundleSignature', '????') - if len(signature_code) != 4: # Wrong length resets everything, too. - signature_code = '?' * 4 - - dest = os.path.join(os.path.dirname(info_plist), 'PkgInfo') - fp = open(dest, 'w') - fp.write('%s%s' % (package_type, signature_code)) - fp.close() - - def ExecFlock(self, lockfile, *cmd_list): - """Emulates the most basic behavior of Linux's flock(1).""" - # Rely on exception handling to report errors. - fd = os.open(lockfile, os.O_RDONLY|os.O_NOCTTY|os.O_CREAT, 0o666) - fcntl.flock(fd, fcntl.LOCK_EX) - return subprocess.call(cmd_list) - - def ExecFilterLibtool(self, *cmd_list): - """Calls libtool and filters out '/path/to/libtool: file: foo.o has no + with open(file_name, "rb") as fp: + try: + header = fp.read(3) + except Exception: + return None + if header.startswith(b"\xFE\xFF"): + return "UTF-16" + elif header.startswith(b"\xFF\xFE"): + return "UTF-16" + elif header.startswith(b"\xEF\xBB\xBF"): + return "UTF-8" + else: + return None + + def ExecCopyInfoPlist(self, source, dest, convert_to_binary, *keys): + """Copies the |source| Info.plist to the destination directory |dest|.""" + # Read the source Info.plist into memory. + with open(source, "r") as fd: + lines = fd.read() + + # Insert synthesized key/value pairs (e.g. BuildMachineOSBuild). + plist = plistlib.readPlistFromString(lines) + if keys: + plist.update(json.loads(keys[0])) + lines = plistlib.writePlistToString(plist) + + # Go through all the environment variables and replace them as variables in + # the file. + IDENT_RE = re.compile(r"[_/\s]") + for key in os.environ: + if key.startswith("_"): + continue + evar = "${%s}" % key + evalue = os.environ[key] + lines = lines.replace(lines, evar, evalue) + + # Xcode supports various suffices on environment variables, which are + # all undocumented. :rfc1034identifier is used in the standard project + # template these days, and :identifier was used earlier. They are used to + # convert non-url characters into things that look like valid urls -- + # except that the replacement character for :identifier, '_' isn't valid + # in a URL either -- oops, hence :rfc1034identifier was born. + evar = "${%s:identifier}" % key + evalue = IDENT_RE.sub("_", os.environ[key]) + lines = lines.replace(lines, evar, evalue) + + evar = "${%s:rfc1034identifier}" % key + evalue = IDENT_RE.sub("-", os.environ[key]) + lines = lines.replace(lines, evar, evalue) + + # Remove any keys with values that haven't been replaced. + lines = lines.splitlines() + for i in range(len(lines)): + if lines[i].strip().startswith("${"): + lines[i] = None + lines[i - 1] = None + lines = "\n".join(line for line in lines if line is not None) + + # Write out the file with variables replaced. + with open(dest, "w") as fd: + fd.write(lines) + + # Now write out PkgInfo file now that the Info.plist file has been + # "compiled". + self._WritePkgInfo(dest) + + if convert_to_binary == "True": + self._ConvertToBinary(dest) + + def _WritePkgInfo(self, info_plist): + """This writes the PkgInfo file from the data stored in Info.plist.""" + plist = plistlib.readPlist(info_plist) + if not plist: + return + + # Only create PkgInfo for executable types. + package_type = plist["CFBundlePackageType"] + if package_type != "APPL": + return + + # The format of PkgInfo is eight characters, representing the bundle type + # and bundle signature, each four characters. If that is missing, four + # '?' characters are used instead. + signature_code = plist.get("CFBundleSignature", "????") + if len(signature_code) != 4: # Wrong length resets everything, too. + signature_code = "?" * 4 + + dest = os.path.join(os.path.dirname(info_plist), "PkgInfo") + with open(dest, "w") as fp: + fp.write("%s%s" % (package_type, signature_code)) + + def ExecFlock(self, lockfile, *cmd_list): + """Emulates the most basic behavior of Linux's flock(1).""" + # Rely on exception handling to report errors. + fd = os.open(lockfile, os.O_RDONLY | os.O_NOCTTY | os.O_CREAT, 0o666) + fcntl.flock(fd, fcntl.LOCK_EX) + return subprocess.call(cmd_list) + + def ExecFilterLibtool(self, *cmd_list): + """Calls libtool and filters out '/path/to/libtool: file: foo.o has no symbols'.""" - libtool_re = re.compile(r'^.*libtool: file: .* has no symbols$') - libtool_re5 = re.compile( - r'^.*libtool: warning for library: ' + - r'.* the table of contents is empty ' + - r'\(no object file members in the library define global symbols\)$') - env = os.environ.copy() - # Ref: - # http://www.opensource.apple.com/source/cctools/cctools-809/misc/libtool.c - # The problem with this flag is that it resets the file mtime on the file to - # epoch=0, e.g. 1970-1-1 or 1969-12-31 depending on timezone. - env['ZERO_AR_DATE'] = '1' - libtoolout = subprocess.Popen(cmd_list, stderr=subprocess.PIPE, env=env) - _, err = libtoolout.communicate() - if PY3: - err = err.decode('utf-8') - for line in err.splitlines(): - if not libtool_re.match(line) and not libtool_re5.match(line): - print(line, file=sys.stderr) - # Unconditionally touch the output .a file on the command line if present - # and the command succeeded. A bit hacky. - if not libtoolout.returncode: - for i in range(len(cmd_list) - 1): - if cmd_list[i] == "-o" and cmd_list[i+1].endswith('.a'): - os.utime(cmd_list[i+1], None) - break - return libtoolout.returncode - - def ExecPackageFramework(self, framework, version): - """Takes a path to Something.framework and the Current version of that and + libtool_re = re.compile( + r"^.*libtool: (?:for architecture: \S* )?" r"file: .* has no symbols$" + ) + libtool_re5 = re.compile( + r"^.*libtool: warning for library: " + + r".* the table of contents is empty " + + r"\(no object file members in the library define global symbols\)$" + ) + env = os.environ.copy() + # Ref: + # http://www.opensource.apple.com/source/cctools/cctools-809/misc/libtool.c + # The problem with this flag is that it resets the file mtime on the file to + # epoch=0, e.g. 1970-1-1 or 1969-12-31 depending on timezone. + env["ZERO_AR_DATE"] = "1" + libtoolout = subprocess.Popen(cmd_list, stderr=subprocess.PIPE, env=env) + _, err = libtoolout.communicate() + if PY3: + err = err.decode("utf-8") + for line in err.splitlines(): + if not libtool_re.match(line) and not libtool_re5.match(line): + print(line, file=sys.stderr) + # Unconditionally touch the output .a file on the command line if present + # and the command succeeded. A bit hacky. + if not libtoolout.returncode: + for i in range(len(cmd_list) - 1): + if cmd_list[i] == "-o" and cmd_list[i + 1].endswith(".a"): + os.utime(cmd_list[i + 1], None) + break + return libtoolout.returncode + + def ExecPackageIosFramework(self, framework): + # Find the name of the binary based on the part before the ".framework". + binary = os.path.basename(framework).split(".")[0] + module_path = os.path.join(framework, "Modules") + if not os.path.exists(module_path): + os.mkdir(module_path) + module_template = ( + "framework module %s {\n" + ' umbrella header "%s.h"\n' + "\n" + " export *\n" + " module * { export * }\n" + "}\n" % (binary, binary) + ) + + with open(os.path.join(module_path, "module.modulemap"), "w") as module_file: + module_file.write(module_template) + + def ExecPackageFramework(self, framework, version): + """Takes a path to Something.framework and the Current version of that and sets up all the symlinks.""" - # Find the name of the binary based on the part before the ".framework". - binary = os.path.basename(framework).split('.')[0] + # Find the name of the binary based on the part before the ".framework". + binary = os.path.basename(framework).split(".")[0] - CURRENT = 'Current' - RESOURCES = 'Resources' - VERSIONS = 'Versions' + CURRENT = "Current" + RESOURCES = "Resources" + VERSIONS = "Versions" - if not os.path.exists(os.path.join(framework, VERSIONS, version, binary)): - # Binary-less frameworks don't seem to contain symlinks (see e.g. - # chromium's out/Debug/org.chromium.Chromium.manifest/ bundle). - return + if not os.path.exists(os.path.join(framework, VERSIONS, version, binary)): + # Binary-less frameworks don't seem to contain symlinks (see e.g. + # chromium's out/Debug/org.chromium.Chromium.manifest/ bundle). + return - # Move into the framework directory to set the symlinks correctly. - pwd = os.getcwd() - os.chdir(framework) + # Move into the framework directory to set the symlinks correctly. + pwd = os.getcwd() + os.chdir(framework) - # Set up the Current version. - self._Relink(version, os.path.join(VERSIONS, CURRENT)) + # Set up the Current version. + self._Relink(version, os.path.join(VERSIONS, CURRENT)) - # Set up the root symlinks. - self._Relink(os.path.join(VERSIONS, CURRENT, binary), binary) - self._Relink(os.path.join(VERSIONS, CURRENT, RESOURCES), RESOURCES) + # Set up the root symlinks. + self._Relink(os.path.join(VERSIONS, CURRENT, binary), binary) + self._Relink(os.path.join(VERSIONS, CURRENT, RESOURCES), RESOURCES) - # Back to where we were before! - os.chdir(pwd) + # Back to where we were before! + os.chdir(pwd) - def _Relink(self, dest, link): - """Creates a symlink to |dest| named |link|. If |link| already exists, + def _Relink(self, dest, link): + """Creates a symlink to |dest| named |link|. If |link| already exists, it is overwritten.""" - if os.path.lexists(link): - os.remove(link) - os.symlink(dest, link) - - def ExecCompileXcassets(self, keys, *inputs): - """Compiles multiple .xcassets files into a single .car file. + if os.path.lexists(link): + os.remove(link) + os.symlink(dest, link) + + def ExecCompileIosFrameworkHeaderMap(self, out, framework, *all_headers): + framework_name = os.path.basename(framework).split(".")[0] + all_headers = [os.path.abspath(header) for header in all_headers] + filelist = {} + for header in all_headers: + filename = os.path.basename(header) + filelist[filename] = header + filelist[os.path.join(framework_name, filename)] = header + WriteHmap(out, filelist) + + def ExecCopyIosFrameworkHeaders(self, framework, *copy_headers): + header_path = os.path.join(framework, "Headers") + if not os.path.exists(header_path): + os.makedirs(header_path) + for header in copy_headers: + shutil.copy(header, os.path.join(header_path, os.path.basename(header))) + + def ExecCompileXcassets(self, keys, *inputs): + """Compiles multiple .xcassets files into a single .car file. This invokes 'actool' to compile all the inputs .xcassets files. The |keys| arguments is a json-encoded dictionary of extra arguments to @@ -306,101 +375,102 @@ def ExecCompileXcassets(self, keys, *inputs): Note that 'actool' does not create the Assets.car file if the asset catalogs does not contains imageset. """ - command_line = [ - 'xcrun', 'actool', '--output-format', 'human-readable-text', - '--compress-pngs', '--notices', '--warnings', '--errors', - ] - is_iphone_target = 'IPHONEOS_DEPLOYMENT_TARGET' in os.environ - if is_iphone_target: - platform = os.environ['CONFIGURATION'].split('-')[-1] - if platform not in ('iphoneos', 'iphonesimulator'): - platform = 'iphonesimulator' - command_line.extend([ - '--platform', platform, '--target-device', 'iphone', - '--target-device', 'ipad', '--minimum-deployment-target', - os.environ['IPHONEOS_DEPLOYMENT_TARGET'], '--compile', - os.path.abspath(os.environ['CONTENTS_FOLDER_PATH']), - ]) - else: - command_line.extend([ - '--platform', 'macosx', '--target-device', 'mac', - '--minimum-deployment-target', os.environ['MACOSX_DEPLOYMENT_TARGET'], - '--compile', - os.path.abspath(os.environ['UNLOCALIZED_RESOURCES_FOLDER_PATH']), - ]) - if keys: - keys = json.loads(keys) - for key, value in keys.items(): - arg_name = '--' + key - if isinstance(value, bool): - if value: - command_line.append(arg_name) - elif isinstance(value, list): - for v in value: - command_line.append(arg_name) - command_line.append(str(v)) + command_line = [ + "xcrun", + "actool", + "--output-format", + "human-readable-text", + "--compress-pngs", + "--notices", + "--warnings", + "--errors", + ] + is_iphone_target = "IPHONEOS_DEPLOYMENT_TARGET" in os.environ + if is_iphone_target: + platform = os.environ["CONFIGURATION"].split("-")[-1] + if platform not in ("iphoneos", "iphonesimulator"): + platform = "iphonesimulator" + command_line.extend( + [ + "--platform", + platform, + "--target-device", + "iphone", + "--target-device", + "ipad", + "--minimum-deployment-target", + os.environ["IPHONEOS_DEPLOYMENT_TARGET"], + "--compile", + os.path.abspath(os.environ["CONTENTS_FOLDER_PATH"]), + ] + ) else: - command_line.append(arg_name) - command_line.append(str(value)) - # Note: actool crashes if inputs path are relative, so use os.path.abspath - # to get absolute path name for inputs. - command_line.extend(map(os.path.abspath, inputs)) - subprocess.check_call(command_line) - - def ExecMergeInfoPlist(self, output, *inputs): - """Merge multiple .plist files into a single .plist file.""" - merged_plist = {} - for path in inputs: - plist = self._LoadPlistMaybeBinary(path) - self._MergePlist(merged_plist, plist) - plistlib.writePlist(merged_plist, output) - - def ExecCodeSignBundle(self, key, resource_rules, entitlements, provisioning): - """Code sign a bundle. + command_line.extend( + [ + "--platform", + "macosx", + "--target-device", + "mac", + "--minimum-deployment-target", + os.environ["MACOSX_DEPLOYMENT_TARGET"], + "--compile", + os.path.abspath(os.environ["UNLOCALIZED_RESOURCES_FOLDER_PATH"]), + ] + ) + if keys: + keys = json.loads(keys) + for key, value in keys.items(): + arg_name = "--" + key + if isinstance(value, bool): + if value: + command_line.append(arg_name) + elif isinstance(value, list): + for v in value: + command_line.append(arg_name) + command_line.append(str(v)) + else: + command_line.append(arg_name) + command_line.append(str(value)) + # Note: actool crashes if inputs path are relative, so use os.path.abspath + # to get absolute path name for inputs. + command_line.extend(map(os.path.abspath, inputs)) + subprocess.check_call(command_line) + + def ExecMergeInfoPlist(self, output, *inputs): + """Merge multiple .plist files into a single .plist file.""" + merged_plist = {} + for path in inputs: + plist = self._LoadPlistMaybeBinary(path) + self._MergePlist(merged_plist, plist) + plistlib.writePlist(merged_plist, output) + + def ExecCodeSignBundle(self, key, entitlements, provisioning, path, preserve): + """Code sign a bundle. This function tries to code sign an iOS bundle, following the same algorithm as Xcode: - 1. copy ResourceRules.plist from the user or the SDK into the bundle, - 2. pick the provisioning profile that best match the bundle identifier, + 1. pick the provisioning profile that best match the bundle identifier, and copy it into the bundle as embedded.mobileprovision, - 3. copy Entitlements.plist from user or SDK next to the bundle, - 4. code sign the bundle. + 2. copy Entitlements.plist from user or SDK next to the bundle, + 3. code sign the bundle. """ - resource_rules_path = self._InstallResourceRules(resource_rules) - substitutions, overrides = self._InstallProvisioningProfile( - provisioning, self._GetCFBundleIdentifier()) - entitlements_path = self._InstallEntitlements( - entitlements, substitutions, overrides) - subprocess.check_call([ - 'codesign', '--force', '--sign', key, '--resource-rules', - resource_rules_path, '--entitlements', entitlements_path, - os.path.join( - os.environ['TARGET_BUILD_DIR'], - os.environ['FULL_PRODUCT_NAME'])]) - - def _InstallResourceRules(self, resource_rules): - """Installs ResourceRules.plist from user or SDK into the bundle. + substitutions, overrides = self._InstallProvisioningProfile( + provisioning, self._GetCFBundleIdentifier() + ) + entitlements_path = self._InstallEntitlements( + entitlements, substitutions, overrides + ) + + args = ["codesign", "--force", "--sign", key] + if preserve == "True": + args.extend(["--deep", "--preserve-metadata=identifier,entitlements"]) + else: + args.extend(["--entitlements", entitlements_path]) + args.extend(["--timestamp=none", path]) + subprocess.check_call(args) - Args: - resource_rules: string, optional, path to the ResourceRules.plist file - to use, default to "${SDKROOT}/ResourceRules.plist" - - Returns: - Path to the copy of ResourceRules.plist into the bundle. - """ - source_path = resource_rules - target_path = os.path.join( - os.environ['BUILT_PRODUCTS_DIR'], - os.environ['CONTENTS_FOLDER_PATH'], - 'ResourceRules.plist') - if not source_path: - source_path = os.path.join( - os.environ['SDKROOT'], 'ResourceRules.plist') - shutil.copy2(source_path, target_path) - return target_path - - def _InstallProvisioningProfile(self, profile, bundle_identifier): - """Installs embedded.mobileprovision into the bundle. + def _InstallProvisioningProfile(self, profile, bundle_identifier): + """Installs embedded.mobileprovision into the bundle. Args: profile: string, optional, short name of the .mobileprovision file @@ -412,18 +482,20 @@ def _InstallProvisioningProfile(self, profile, bundle_identifier): A tuple containing two dictionary: variables substitutions and values to overrides when generating the entitlements file. """ - source_path, provisioning_data, team_id = self._FindProvisioningProfile( - profile, bundle_identifier) - target_path = os.path.join( - os.environ['BUILT_PRODUCTS_DIR'], - os.environ['CONTENTS_FOLDER_PATH'], - 'embedded.mobileprovision') - shutil.copy2(source_path, target_path) - substitutions = self._GetSubstitutions(bundle_identifier, team_id + '.') - return substitutions, provisioning_data['Entitlements'] - - def _FindProvisioningProfile(self, profile, bundle_identifier): - """Finds the .mobileprovision file to use for signing the bundle. + source_path, provisioning_data, team_id = self._FindProvisioningProfile( + profile, bundle_identifier + ) + target_path = os.path.join( + os.environ["BUILT_PRODUCTS_DIR"], + os.environ["CONTENTS_FOLDER_PATH"], + "embedded.mobileprovision", + ) + shutil.copy2(source_path, target_path) + substitutions = self._GetSubstitutions(bundle_identifier, team_id + ".") + return substitutions, provisioning_data["Entitlements"] + + def _FindProvisioningProfile(self, profile, bundle_identifier): + """Finds the .mobileprovision file to use for signing the bundle. Checks all the installed provisioning profiles (or if the user specified the PROVISIONING_PROFILE variable, only consult it) and select the most @@ -443,40 +515,52 @@ def _FindProvisioningProfile(self, profile, bundle_identifier): Raises: SystemExit: if no .mobileprovision can be used to sign the bundle. """ - profiles_dir = os.path.join( - os.environ['HOME'], 'Library', 'MobileDevice', 'Provisioning Profiles') - if not os.path.isdir(profiles_dir): - print('cannot find mobile provisioning for %s' % (bundle_identifier), file=sys.stderr) - sys.exit(1) - provisioning_profiles = None - if profile: - profile_path = os.path.join(profiles_dir, profile + '.mobileprovision') - if os.path.exists(profile_path): - provisioning_profiles = [profile_path] - if not provisioning_profiles: - provisioning_profiles = glob.glob( - os.path.join(profiles_dir, '*.mobileprovision')) - valid_provisioning_profiles = {} - for profile_path in provisioning_profiles: - profile_data = self._LoadProvisioningProfile(profile_path) - app_id_pattern = profile_data.get( - 'Entitlements', {}).get('application-identifier', '') - for team_identifier in profile_data.get('TeamIdentifier', []): - app_id = '%s.%s' % (team_identifier, bundle_identifier) - if fnmatch.fnmatch(app_id, app_id_pattern): - valid_provisioning_profiles[app_id_pattern] = ( - profile_path, profile_data, team_identifier) - if not valid_provisioning_profiles: - print('cannot find mobile provisioning for %s' % (bundle_identifier), file=sys.stderr) - sys.exit(1) - # If the user has multiple provisioning profiles installed that can be - # used for ${bundle_identifier}, pick the most specific one (ie. the - # provisioning profile whose pattern is the longest). - selected_key = max(valid_provisioning_profiles, key=lambda v: len(v)) - return valid_provisioning_profiles[selected_key] - - def _LoadProvisioningProfile(self, profile_path): - """Extracts the plist embedded in a provisioning profile. + profiles_dir = os.path.join( + os.environ["HOME"], "Library", "MobileDevice", "Provisioning Profiles" + ) + if not os.path.isdir(profiles_dir): + print( + "cannot find mobile provisioning for %s" % (bundle_identifier), + file=sys.stderr, + ) + sys.exit(1) + provisioning_profiles = None + if profile: + profile_path = os.path.join(profiles_dir, profile + ".mobileprovision") + if os.path.exists(profile_path): + provisioning_profiles = [profile_path] + if not provisioning_profiles: + provisioning_profiles = glob.glob( + os.path.join(profiles_dir, "*.mobileprovision") + ) + valid_provisioning_profiles = {} + for profile_path in provisioning_profiles: + profile_data = self._LoadProvisioningProfile(profile_path) + app_id_pattern = profile_data.get("Entitlements", {}).get( + "application-identifier", "" + ) + for team_identifier in profile_data.get("TeamIdentifier", []): + app_id = "%s.%s" % (team_identifier, bundle_identifier) + if fnmatch.fnmatch(app_id, app_id_pattern): + valid_provisioning_profiles[app_id_pattern] = ( + profile_path, + profile_data, + team_identifier, + ) + if not valid_provisioning_profiles: + print( + "cannot find mobile provisioning for %s" % (bundle_identifier), + file=sys.stderr, + ) + sys.exit(1) + # If the user has multiple provisioning profiles installed that can be + # used for ${bundle_identifier}, pick the most specific one (ie. the + # provisioning profile whose pattern is the longest). + selected_key = max(valid_provisioning_profiles, key=lambda v: len(v)) + return valid_provisioning_profiles[selected_key] + + def _LoadProvisioningProfile(self, profile_path): + """Extracts the plist embedded in a provisioning profile. Args: profile_path: string, path to the .mobileprovision file @@ -484,26 +568,27 @@ def _LoadProvisioningProfile(self, profile_path): Returns: Content of the plist embedded in the provisioning profile as a dictionary. """ - with tempfile.NamedTemporaryFile() as temp: - subprocess.check_call([ - 'security', 'cms', '-D', '-i', profile_path, '-o', temp.name]) - return self._LoadPlistMaybeBinary(temp.name) - - def _MergePlist(self, merged_plist, plist): - """Merge |plist| into |merged_plist|.""" - for key, value in plist.items(): - if isinstance(value, dict): - merged_value = merged_plist.get(key, {}) - if isinstance(merged_value, dict): - self._MergePlist(merged_value, value) - merged_plist[key] = merged_value - else: - merged_plist[key] = value - else: - merged_plist[key] = value - - def _LoadPlistMaybeBinary(self, plist_path): - """Loads into a memory a plist possibly encoded in binary format. + with tempfile.NamedTemporaryFile() as temp: + subprocess.check_call( + ["security", "cms", "-D", "-i", profile_path, "-o", temp.name] + ) + return self._LoadPlistMaybeBinary(temp.name) + + def _MergePlist(self, merged_plist, plist): + """Merge |plist| into |merged_plist|.""" + for key, value in plist.items(): + if isinstance(value, dict): + merged_value = merged_plist.get(key, {}) + if isinstance(merged_value, dict): + self._MergePlist(merged_value, value) + merged_plist[key] = merged_value + else: + merged_plist[key] = value + else: + merged_plist[key] = value + + def _LoadPlistMaybeBinary(self, plist_path): + """Loads into a memory a plist possibly encoded in binary format. This is a wrapper around plistlib.readPlist that tries to convert the plist to the XML format if it can't be parsed (assuming that it is in @@ -515,20 +600,20 @@ def _LoadPlistMaybeBinary(self, plist_path): Returns: Content of the plist as a dictionary. """ - try: - # First, try to read the file using plistlib that only supports XML, - # and if an exception is raised, convert a temporary copy to XML and - # load that copy. - return plistlib.readPlist(plist_path) - except: - pass - with tempfile.NamedTemporaryFile() as temp: - shutil.copy2(plist_path, temp.name) - subprocess.check_call(['plutil', '-convert', 'xml1', temp.name]) - return plistlib.readPlist(temp.name) - - def _GetSubstitutions(self, bundle_identifier, app_identifier_prefix): - """Constructs a dictionary of variable substitutions for Entitlements.plist. + try: + # First, try to read the file using plistlib that only supports XML, + # and if an exception is raised, convert a temporary copy to XML and + # load that copy. + return plistlib.readPlist(plist_path) + except Exception: + pass + with tempfile.NamedTemporaryFile() as temp: + shutil.copy2(plist_path, temp.name) + subprocess.check_call(["plutil", "-convert", "xml1", temp.name]) + return plistlib.readPlist(temp.name) + + def _GetSubstitutions(self, bundle_identifier, app_identifier_prefix): + """Constructs a dictionary of variable substitutions for Entitlements.plist. Args: bundle_identifier: string, value of CFBundleIdentifier from Info.plist @@ -537,25 +622,25 @@ def _GetSubstitutions(self, bundle_identifier, app_identifier_prefix): Returns: Dictionary of substitutions to apply when generating Entitlements.plist. """ - return { - 'CFBundleIdentifier': bundle_identifier, - 'AppIdentifierPrefix': app_identifier_prefix, - } + return { + "CFBundleIdentifier": bundle_identifier, + "AppIdentifierPrefix": app_identifier_prefix, + } - def _GetCFBundleIdentifier(self): - """Extracts CFBundleIdentifier value from Info.plist in the bundle. + def _GetCFBundleIdentifier(self): + """Extracts CFBundleIdentifier value from Info.plist in the bundle. Returns: Value of CFBundleIdentifier in the Info.plist located in the bundle. """ - info_plist_path = os.path.join( - os.environ['TARGET_BUILD_DIR'], - os.environ['INFOPLIST_PATH']) - info_plist_data = self._LoadPlistMaybeBinary(info_plist_path) - return info_plist_data['CFBundleIdentifier'] + info_plist_path = os.path.join( + os.environ["TARGET_BUILD_DIR"], os.environ["INFOPLIST_PATH"] + ) + info_plist_data = self._LoadPlistMaybeBinary(info_plist_path) + return info_plist_data["CFBundleIdentifier"] - def _InstallEntitlements(self, entitlements, substitutions, overrides): - """Generates and install the ${BundleName}.xcent entitlements file. + def _InstallEntitlements(self, entitlements, substitutions, overrides): + """Generates and install the ${BundleName}.xcent entitlements file. Expands variables "$(variable)" pattern in the source entitlements file, add extra entitlements defined in the .mobileprovision file and the copy @@ -570,26 +655,24 @@ def _InstallEntitlements(self, entitlements, substitutions, overrides): Returns: Path to the generated entitlements file. """ - source_path = entitlements - target_path = os.path.join( - os.environ['BUILT_PRODUCTS_DIR'], - os.environ['PRODUCT_NAME'] + '.xcent') - if not source_path: - source_path = os.path.join( - os.environ['SDKROOT'], - 'Entitlements.plist') - shutil.copy2(source_path, target_path) - data = self._LoadPlistMaybeBinary(target_path) - data = self._ExpandVariables(data, substitutions) - if overrides: - for key in overrides: - if key not in data: - data[key] = overrides[key] - plistlib.writePlist(data, target_path) - return target_path - - def _ExpandVariables(self, data, substitutions): - """Expands variables "$(variable)" in data. + source_path = entitlements + target_path = os.path.join( + os.environ["BUILT_PRODUCTS_DIR"], os.environ["PRODUCT_NAME"] + ".xcent" + ) + if not source_path: + source_path = os.path.join(os.environ["SDKROOT"], "Entitlements.plist") + shutil.copy2(source_path, target_path) + data = self._LoadPlistMaybeBinary(target_path) + data = self._ExpandVariables(data, substitutions) + if overrides: + for key in overrides: + if key not in data: + data[key] = overrides[key] + plistlib.writePlist(data, target_path) + return target_path + + def _ExpandVariables(self, data, substitutions): + """Expands variables "$(variable)" in data. Args: data: object, can be either string, list or dictionary @@ -600,15 +683,94 @@ def _ExpandVariables(self, data, substitutions): by the corresponding value found in substitutions, or left intact if the key was not found. """ - if isinstance(data, str): - for key, value in substitutions.items(): - data = data.replace('$(%s)' % key, value) - return data - if isinstance(data, list): - return [self._ExpandVariables(v, substitutions) for v in data] - if isinstance(data, dict): - return {k: self._ExpandVariables(data[k], substitutions) for k in data} - return data - -if __name__ == '__main__': - sys.exit(main(sys.argv[1:])) + if isinstance(data, str): + for key, value in substitutions.items(): + data = data.replace("$(%s)" % key, value) + return data + if isinstance(data, list): + return [self._ExpandVariables(v, substitutions) for v in data] + if isinstance(data, dict): + return {k: self._ExpandVariables(data[k], substitutions) for k in data} + return data + + +def NextGreaterPowerOf2(x): + return 2 ** (x).bit_length() + + +def WriteHmap(output_name, filelist): + """Generates a header map based on |filelist|. + + Per Mark Mentovai: + A header map is structured essentially as a hash table, keyed by names used + in #includes, and providing pathnames to the actual files. + + The implementation below and the comment above comes from inspecting: + http://www.opensource.apple.com/source/distcc/distcc-2503/distcc_dist/include_server/headermap.py?txt + while also looking at the implementation in clang in: + https://llvm.org/svn/llvm-project/cfe/trunk/lib/Lex/HeaderMap.cpp + """ + magic = 1751998832 + version = 1 + _reserved = 0 + count = len(filelist) + capacity = NextGreaterPowerOf2(count) + strings_offset = 24 + (12 * capacity) + max_value_length = max(len(value) for value in filelist.values()) + + out = open(output_name, "wb") + out.write( + struct.pack( + " 0 or arg.count("/") > 1: + arg = os.path.normpath(arg) - # %'s also need to be doubled otherwise they're interpreted as batch - # positional arguments. Also make sure to escape the % so that they're - # passed literally through escaping so they can be singled to just the - # original %. Otherwise, trying to pass the literal representation that - # looks like an environment variable to the shell (e.g. %PATH%) would fail. - arg = arg.replace('%', '%%') + # For a literal quote, CommandLineToArgvW requires 2n+1 backslashes + # preceding it, and results in n backslashes + the quote. So we substitute + # in 2* what we match, +1 more, plus the quote. + arg = windows_quoter_regex.sub(lambda mo: 2 * mo.group(1) + '\\"', arg) - # These commands are used in rsp files, so no escaping for the shell (via ^) - # is necessary. + # %'s also need to be doubled otherwise they're interpreted as batch + # positional arguments. Also make sure to escape the % so that they're + # passed literally through escaping so they can be singled to just the + # original %. Otherwise, trying to pass the literal representation that + # looks like an environment variable to the shell (e.g. %PATH%) would fail. + arg = arg.replace("%", "%%") - # Finally, wrap the whole thing in quotes so that the above quote rule - # applies and whitespace isn't a word break. - return '"' + arg + '"' + # These commands are used in rsp files, so no escaping for the shell (via ^) + # is necessary. + + # Finally, wrap the whole thing in quotes so that the above quote rule + # applies and whitespace isn't a word break. + return '"' + arg + '"' def EncodeRspFileList(args): - """Process a list of arguments using QuoteCmdExeArgument.""" - # Note that the first argument is assumed to be the command. Don't add - # quotes around it because then built-ins like 'echo', etc. won't work. - # Take care to normpath only the path in the case of 'call ../x.bat' because - # otherwise the whole thing is incorrectly interpreted as a path and not - # normalized correctly. - if not args: return '' - if args[0].startswith('call '): - call, program = args[0].split(' ', 1) - program = call + ' ' + os.path.normpath(program) - else: - program = os.path.normpath(args[0]) - return program + ' ' + ' '.join(QuoteForRspFile(arg) for arg in args[1:]) + """Process a list of arguments using QuoteCmdExeArgument.""" + # Note that the first argument is assumed to be the command. Don't add + # quotes around it because then built-ins like 'echo', etc. won't work. + # Take care to normpath only the path in the case of 'call ../x.bat' because + # otherwise the whole thing is incorrectly interpreted as a path and not + # normalized correctly. + if not args: + return "" + if args[0].startswith("call "): + call, program = args[0].split(" ", 1) + program = call + " " + os.path.normpath(program) + else: + program = os.path.normpath(args[0]) + return program + " " + " ".join(QuoteForRspFile(arg) for arg in args[1:]) def _GenericRetrieve(root, default, path): - """Given a list of dictionary keys |path| and a tree of dicts |root|, find + """Given a list of dictionary keys |path| and a tree of dicts |root|, find value at path, or return |default| if any of the path doesn't exist.""" - if not root: - return default - if not path: - return root - return _GenericRetrieve(root.get(path[0]), default, path[1:]) + if not root: + return default + if not path: + return root + return _GenericRetrieve(root.get(path[0]), default, path[1:]) def _AddPrefix(element, prefix): - """Add |prefix| to |element| or each subelement if element is iterable.""" - if element is None: - return element - # Note, not Iterable because we don't want to handle strings like that. - if isinstance(element, list) or isinstance(element, tuple): - return [prefix + e for e in element] - else: - return prefix + element + """Add |prefix| to |element| or each subelement if element is iterable.""" + if element is None: + return element + # Note, not Iterable because we don't want to handle strings like that. + if isinstance(element, list) or isinstance(element, tuple): + return [prefix + e for e in element] + else: + return prefix + element def _DoRemapping(element, map): - """If |element| then remap it through |map|. If |element| is iterable then + """If |element| then remap it through |map|. If |element| is iterable then each item will be remapped. Any elements not found will be removed.""" - if map is not None and element is not None: - if not callable(map): - map = map.get # Assume it's a dict, otherwise a callable to do the remap. - if isinstance(element, list) or isinstance(element, tuple): - element = filter(None, [map(elem) for elem in element]) - else: - element = map(element) - return element + if map is not None and element is not None: + if not callable(map): + map = map.get # Assume it's a dict, otherwise a callable to do the remap. + if isinstance(element, list) or isinstance(element, tuple): + element = filter(None, [map(elem) for elem in element]) + else: + element = map(element) + return element def _AppendOrReturn(append, element): - """If |append| is None, simply return |element|. If |append| is not None, + """If |append| is None, simply return |element|. If |append| is not None, then add |element| to it, adding each item in |element| if it's a list or tuple.""" - if append is not None and element is not None: - if isinstance(element, list) or isinstance(element, tuple): - append.extend(element) + if append is not None and element is not None: + if isinstance(element, list) or isinstance(element, tuple): + append.extend(element) + else: + append.append(element) else: - append.append(element) - else: - return element + return element def _FindDirectXInstallation(): - """Try to find an installation location for the DirectX SDK. Check for the + """Try to find an installation location for the DirectX SDK. Check for the standard environment variable, and if that doesn't exist, try to find via the registry. May return None if not found in either location.""" - # Return previously calculated value, if there is one - if hasattr(_FindDirectXInstallation, 'dxsdk_dir'): - return _FindDirectXInstallation.dxsdk_dir - - dxsdk_dir = os.environ.get('DXSDK_DIR') - if not dxsdk_dir: - # Setup params to pass to and attempt to launch reg.exe. - cmd = ['reg.exe', 'query', r'HKLM\Software\Microsoft\DirectX', '/s'] - p = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE) - stdout = p.communicate()[0] - if PY3: - stdout = stdout.decode('utf-8') - for line in stdout.splitlines(): - if 'InstallPath' in line: - dxsdk_dir = line.split(' ')[3] + "\\" - - # Cache return value - _FindDirectXInstallation.dxsdk_dir = dxsdk_dir - return dxsdk_dir + # Return previously calculated value, if there is one + if hasattr(_FindDirectXInstallation, "dxsdk_dir"): + return _FindDirectXInstallation.dxsdk_dir + + dxsdk_dir = os.environ.get("DXSDK_DIR") + if not dxsdk_dir: + # Setup params to pass to and attempt to launch reg.exe. + cmd = ["reg.exe", "query", r"HKLM\Software\Microsoft\DirectX", "/s"] + p = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE) + stdout = p.communicate()[0] + if PY3: + stdout = stdout.decode("utf-8") + for line in stdout.splitlines(): + if "InstallPath" in line: + dxsdk_dir = line.split(" ")[3] + "\\" + + # Cache return value + _FindDirectXInstallation.dxsdk_dir = dxsdk_dir + return dxsdk_dir def GetGlobalVSMacroEnv(vs_version): - """Get a dict of variables mapping internal VS macro names to their gyp + """Get a dict of variables mapping internal VS macro names to their gyp equivalents. Returns all variables that are independent of the target.""" - env = {} - # '$(VSInstallDir)' and '$(VCInstallDir)' are available when and only when - # Visual Studio is actually installed. - if vs_version.Path(): - env['$(VSInstallDir)'] = vs_version.Path() - env['$(VCInstallDir)'] = os.path.join(vs_version.Path(), 'VC') + '\\' - # Chromium uses DXSDK_DIR in include/lib paths, but it may or may not be - # set. This happens when the SDK is sync'd via src-internal, rather than - # by typical end-user installation of the SDK. If it's not set, we don't - # want to leave the unexpanded variable in the path, so simply strip it. - dxsdk_dir = _FindDirectXInstallation() - env['$(DXSDK_DIR)'] = dxsdk_dir if dxsdk_dir else '' - # Try to find an installation location for the Windows DDK by checking - # the WDK_DIR environment variable, may be None. - env['$(WDK_DIR)'] = os.environ.get('WDK_DIR', '') - return env + env = {} + # '$(VSInstallDir)' and '$(VCInstallDir)' are available when and only when + # Visual Studio is actually installed. + if vs_version.Path(): + env["$(VSInstallDir)"] = vs_version.Path() + env["$(VCInstallDir)"] = os.path.join(vs_version.Path(), "VC") + "\\" + # Chromium uses DXSDK_DIR in include/lib paths, but it may or may not be + # set. This happens when the SDK is sync'd via src-internal, rather than + # by typical end-user installation of the SDK. If it's not set, we don't + # want to leave the unexpanded variable in the path, so simply strip it. + dxsdk_dir = _FindDirectXInstallation() + env["$(DXSDK_DIR)"] = dxsdk_dir if dxsdk_dir else "" + # Try to find an installation location for the Windows DDK by checking + # the WDK_DIR environment variable, may be None. + env["$(WDK_DIR)"] = os.environ.get("WDK_DIR", "") + return env + def ExtractSharedMSVSSystemIncludes(configs, generator_flags): - """Finds msvs_system_include_dirs that are common to all targets, removes + """Finds msvs_system_include_dirs that are common to all targets, removes them from all targets, and returns an OrderedSet containing them.""" - all_system_includes = OrderedSet( - configs[0].get('msvs_system_include_dirs', [])) - for config in configs[1:]: - system_includes = config.get('msvs_system_include_dirs', []) - all_system_includes = all_system_includes & OrderedSet(system_includes) - if not all_system_includes: - return None - # Expand macros in all_system_includes. - env = GetGlobalVSMacroEnv(GetVSVersion(generator_flags)) - expanded_system_includes = OrderedSet([ExpandMacros(include, env) - for include in all_system_includes]) - if any(['$' in include for include in expanded_system_includes]): - # Some path relies on target-specific variables, bail. - return None - - # Remove system includes shared by all targets from the targets. - for config in configs: - includes = config.get('msvs_system_include_dirs', []) - if includes: # Don't insert a msvs_system_include_dirs key if not needed. - # This must check the unexpanded includes list: - new_includes = [i for i in includes if i not in all_system_includes] - config['msvs_system_include_dirs'] = new_includes - return expanded_system_includes + all_system_includes = OrderedSet(configs[0].get("msvs_system_include_dirs", [])) + for config in configs[1:]: + system_includes = config.get("msvs_system_include_dirs", []) + all_system_includes = all_system_includes & OrderedSet(system_includes) + if not all_system_includes: + return None + # Expand macros in all_system_includes. + env = GetGlobalVSMacroEnv(GetVSVersion(generator_flags)) + expanded_system_includes = OrderedSet( + [ExpandMacros(include, env) for include in all_system_includes] + ) + if any(["$" in include for include in expanded_system_includes]): + # Some path relies on target-specific variables, bail. + return None + + # Remove system includes shared by all targets from the targets. + for config in configs: + includes = config.get("msvs_system_include_dirs", []) + if includes: # Don't insert a msvs_system_include_dirs key if not needed. + # This must check the unexpanded includes list: + new_includes = [i for i in includes if i not in all_system_includes] + config["msvs_system_include_dirs"] = new_includes + return expanded_system_includes class MsvsSettings(object): - """A class that understands the gyp 'msvs_...' values (especially the + """A class that understands the gyp 'msvs_...' values (especially the msvs_settings field). They largely correpond to the VS2008 IDE DOM. This class helps map those settings to command line options.""" - def __init__(self, spec, generator_flags): - self.spec = spec - self.vs_version = GetVSVersion(generator_flags) - - supported_fields = [ - ('msvs_configuration_attributes', dict), - ('msvs_settings', dict), - ('msvs_system_include_dirs', list), - ('msvs_disabled_warnings', list), - ('msvs_precompiled_header', str), - ('msvs_precompiled_source', str), - ('msvs_configuration_platform', str), - ('msvs_target_platform', str), + def __init__(self, spec, generator_flags): + self.spec = spec + self.vs_version = GetVSVersion(generator_flags) + + supported_fields = [ + ("msvs_configuration_attributes", dict), + ("msvs_settings", dict), + ("msvs_system_include_dirs", list), + ("msvs_disabled_warnings", list), + ("msvs_precompiled_header", str), + ("msvs_precompiled_source", str), + ("msvs_configuration_platform", str), + ("msvs_target_platform", str), + ] + configs = spec["configurations"] + for field, default in supported_fields: + setattr(self, field, {}) + for configname, config in configs.items(): + getattr(self, field)[configname] = config.get(field, default()) + + self.msvs_cygwin_dirs = spec.get("msvs_cygwin_dirs", ["."]) + + unsupported_fields = [ + "msvs_prebuild", + "msvs_postbuild", ] - configs = spec['configurations'] - for field, default in supported_fields: - setattr(self, field, {}) - for configname, config in configs.items(): - getattr(self, field)[configname] = config.get(field, default()) - - self.msvs_cygwin_dirs = spec.get('msvs_cygwin_dirs', ['.']) - - unsupported_fields = [ - 'msvs_prebuild', - 'msvs_postbuild', - ] - unsupported = [] - for field in unsupported_fields: - for config in configs.values(): - if field in config: - unsupported += ["%s not supported (target %s)." % - (field, spec['target_name'])] - if unsupported: - raise Exception('\n'.join(unsupported)) - - def GetExtension(self): - """Returns the extension for the target, with no leading dot. + unsupported = [] + for field in unsupported_fields: + for config in configs.values(): + if field in config: + unsupported += [ + "%s not supported (target %s)." % (field, spec["target_name"]) + ] + if unsupported: + raise Exception("\n".join(unsupported)) + + def GetExtension(self): + """Returns the extension for the target, with no leading dot. Uses 'product_extension' if specified, otherwise uses MSVS defaults based on the target type. """ - ext = self.spec.get('product_extension', None) - if ext: - return ext - return gyp.MSVSUtil.TARGET_TYPE_EXT.get(self.spec['type'], '') + ext = self.spec.get("product_extension", None) + if ext: + return ext + return gyp.MSVSUtil.TARGET_TYPE_EXT.get(self.spec["type"], "") - def GetVSMacroEnv(self, base_to_build=None, config=None): - """Get a dict of variables mapping internal VS macro names to their gyp + def GetVSMacroEnv(self, base_to_build=None, config=None): + """Get a dict of variables mapping internal VS macro names to their gyp equivalents.""" - target_arch = self.GetArch(config) - if target_arch == 'x86': - target_platform = 'Win32' - else: - target_platform = target_arch - target_name = self.spec.get('product_prefix', '') + \ - self.spec.get('product_name', self.spec['target_name']) - target_dir = base_to_build + '\\' if base_to_build else '' - target_ext = '.' + self.GetExtension() - target_file_name = target_name + target_ext - - replacements = { - '$(InputName)': '${root}', - '$(InputPath)': '${source}', - '$(IntDir)': '$!INTERMEDIATE_DIR', - '$(OutDir)\\': target_dir, - '$(PlatformName)': target_platform, - '$(ProjectDir)\\': '', - '$(ProjectName)': self.spec['target_name'], - '$(TargetDir)\\': target_dir, - '$(TargetExt)': target_ext, - '$(TargetFileName)': target_file_name, - '$(TargetName)': target_name, - '$(TargetPath)': os.path.join(target_dir, target_file_name), - } - replacements.update(GetGlobalVSMacroEnv(self.vs_version)) - return replacements - - def ConvertVSMacros(self, s, base_to_build=None, config=None): - """Convert from VS macro names to something equivalent.""" - env = self.GetVSMacroEnv(base_to_build, config=config) - return ExpandMacros(s, env) - - def AdjustLibraries(self, libraries): - """Strip -l from library if it's specified with that.""" - libs = [lib[2:] if lib.startswith('-l') else lib for lib in libraries] - return [lib + '.lib' if not lib.endswith('.lib') else lib for lib in libs] - - def _GetAndMunge(self, field, path, default, prefix, append, map): - """Retrieve a value from |field| at |path| or return |default|. If + target_arch = self.GetArch(config) + if target_arch == "x86": + target_platform = "Win32" + else: + target_platform = target_arch + target_name = self.spec.get("product_prefix", "") + self.spec.get( + "product_name", self.spec["target_name"] + ) + target_dir = base_to_build + "\\" if base_to_build else "" + target_ext = "." + self.GetExtension() + target_file_name = target_name + target_ext + + replacements = { + "$(InputName)": "${root}", + "$(InputPath)": "${source}", + "$(IntDir)": "$!INTERMEDIATE_DIR", + "$(OutDir)\\": target_dir, + "$(PlatformName)": target_platform, + "$(ProjectDir)\\": "", + "$(ProjectName)": self.spec["target_name"], + "$(TargetDir)\\": target_dir, + "$(TargetExt)": target_ext, + "$(TargetFileName)": target_file_name, + "$(TargetName)": target_name, + "$(TargetPath)": os.path.join(target_dir, target_file_name), + } + replacements.update(GetGlobalVSMacroEnv(self.vs_version)) + return replacements + + def ConvertVSMacros(self, s, base_to_build=None, config=None): + """Convert from VS macro names to something equivalent.""" + env = self.GetVSMacroEnv(base_to_build, config=config) + return ExpandMacros(s, env) + + def AdjustLibraries(self, libraries): + """Strip -l from library if it's specified with that.""" + libs = [lib[2:] if lib.startswith("-l") else lib for lib in libraries] + return [ + lib + ".lib" + if not lib.lower().endswith(".lib") and not lib.lower().endswith(".obj") + else lib + for lib in libs + ] + + def _GetAndMunge(self, field, path, default, prefix, append, map): + """Retrieve a value from |field| at |path| or return |default|. If |append| is specified, and the item is found, it will be appended to that object instead of returned. If |map| is specified, results will be remapped through |map| before being returned or appended.""" - result = _GenericRetrieve(field, default, path) - result = _DoRemapping(result, map) - result = _AddPrefix(result, prefix) - return _AppendOrReturn(append, result) - - class _GetWrapper(object): - def __init__(self, parent, field, base_path, append=None): - self.parent = parent - self.field = field - self.base_path = [base_path] - self.append = append - def __call__(self, name, map=None, prefix='', default=None): - return self.parent._GetAndMunge(self.field, self.base_path + [name], - default=default, prefix=prefix, append=self.append, map=map) - - def GetArch(self, config): - """Get architecture based on msvs_configuration_platform and + result = _GenericRetrieve(field, default, path) + result = _DoRemapping(result, map) + result = _AddPrefix(result, prefix) + return _AppendOrReturn(append, result) + + class _GetWrapper(object): + def __init__(self, parent, field, base_path, append=None): + self.parent = parent + self.field = field + self.base_path = [base_path] + self.append = append + + def __call__(self, name, map=None, prefix="", default=None): + return self.parent._GetAndMunge( + self.field, + self.base_path + [name], + default=default, + prefix=prefix, + append=self.append, + map=map, + ) + + def GetArch(self, config): + """Get architecture based on msvs_configuration_platform and msvs_target_platform. Returns either 'x86' or 'x64'.""" - configuration_platform = self.msvs_configuration_platform.get(config, '') - platform = self.msvs_target_platform.get(config, '') - if not platform: # If no specific override, use the configuration's. - platform = configuration_platform - # Map from platform to architecture. - return {'Win32': 'x86', 'x64': 'x64', 'ARM64': 'arm64'}.get(platform, 'x86') - - def _TargetConfig(self, config): - """Returns the target-specific configuration.""" - # There's two levels of architecture/platform specification in VS. The - # first level is globally for the configuration (this is what we consider - # "the" config at the gyp level, which will be something like 'Debug' or - # 'Release_x64'), and a second target-specific configuration, which is an - # override for the global one. |config| is remapped here to take into - # account the local target-specific overrides to the global configuration. - arch = self.GetArch(config) - if arch == 'x64' and not config.endswith('_x64'): - config += '_x64' - if arch == 'x86' and config.endswith('_x64'): - config = config.rsplit('_', 1)[0] - return config - - def _Setting(self, path, config, - default=None, prefix='', append=None, map=None): - """_GetAndMunge for msvs_settings.""" - return self._GetAndMunge( - self.msvs_settings[config], path, default, prefix, append, map) - - def _ConfigAttrib(self, path, config, - default=None, prefix='', append=None, map=None): - """_GetAndMunge for msvs_configuration_attributes.""" - return self._GetAndMunge( - self.msvs_configuration_attributes[config], - path, default, prefix, append, map) - - def AdjustIncludeDirs(self, include_dirs, config): - """Updates include_dirs to expand VS specific paths, and adds the system + configuration_platform = self.msvs_configuration_platform.get(config, "") + platform = self.msvs_target_platform.get(config, "") + if not platform: # If no specific override, use the configuration's. + platform = configuration_platform + # Map from platform to architecture. + return {"Win32": "x86", "x64": "x64", "ARM64": "arm64"}.get(platform, "x86") + + def _TargetConfig(self, config): + """Returns the target-specific configuration.""" + # There's two levels of architecture/platform specification in VS. The + # first level is globally for the configuration (this is what we consider + # "the" config at the gyp level, which will be something like 'Debug' or + # 'Release'), VS2015 and later only use this level + if self.vs_version.short_name >= 2015: + return config + # and a second target-specific configuration, which is an + # override for the global one. |config| is remapped here to take into + # account the local target-specific overrides to the global configuration. + arch = self.GetArch(config) + if arch == "x64" and not config.endswith("_x64"): + config += "_x64" + if arch == "x86" and config.endswith("_x64"): + config = config.rsplit("_", 1)[0] + return config + + def _Setting(self, path, config, default=None, prefix="", append=None, map=None): + """_GetAndMunge for msvs_settings.""" + return self._GetAndMunge( + self.msvs_settings[config], path, default, prefix, append, map + ) + + def _ConfigAttrib( + self, path, config, default=None, prefix="", append=None, map=None + ): + """_GetAndMunge for msvs_configuration_attributes.""" + return self._GetAndMunge( + self.msvs_configuration_attributes[config], + path, + default, + prefix, + append, + map, + ) + + def AdjustIncludeDirs(self, include_dirs, config): + """Updates include_dirs to expand VS specific paths, and adds the system include dirs used for platform SDK and similar.""" - config = self._TargetConfig(config) - includes = include_dirs + self.msvs_system_include_dirs[config] - includes.extend(self._Setting( - ('VCCLCompilerTool', 'AdditionalIncludeDirectories'), config, default=[])) - return [self.ConvertVSMacros(p, config=config) for p in includes] - - def AdjustMidlIncludeDirs(self, midl_include_dirs, config): - """Updates midl_include_dirs to expand VS specific paths, and adds the + config = self._TargetConfig(config) + includes = include_dirs + self.msvs_system_include_dirs[config] + includes.extend( + self._Setting( + ("VCCLCompilerTool", "AdditionalIncludeDirectories"), config, default=[] + ) + ) + return [self.ConvertVSMacros(p, config=config) for p in includes] + + def AdjustMidlIncludeDirs(self, midl_include_dirs, config): + """Updates midl_include_dirs to expand VS specific paths, and adds the system include dirs used for platform SDK and similar.""" - config = self._TargetConfig(config) - includes = midl_include_dirs + self.msvs_system_include_dirs[config] - includes.extend(self._Setting( - ('VCMIDLTool', 'AdditionalIncludeDirectories'), config, default=[])) - return [self.ConvertVSMacros(p, config=config) for p in includes] - - def GetComputedDefines(self, config): - """Returns the set of defines that are injected to the defines list based + config = self._TargetConfig(config) + includes = midl_include_dirs + self.msvs_system_include_dirs[config] + includes.extend( + self._Setting( + ("VCMIDLTool", "AdditionalIncludeDirectories"), config, default=[] + ) + ) + return [self.ConvertVSMacros(p, config=config) for p in includes] + + def GetComputedDefines(self, config): + """Returns the set of defines that are injected to the defines list based on other VS settings.""" - config = self._TargetConfig(config) - defines = [] - if self._ConfigAttrib(['CharacterSet'], config) == '1': - defines.extend(('_UNICODE', 'UNICODE')) - if self._ConfigAttrib(['CharacterSet'], config) == '2': - defines.append('_MBCS') - defines.extend(self._Setting( - ('VCCLCompilerTool', 'PreprocessorDefinitions'), config, default=[])) - return defines - - def GetCompilerPdbName(self, config, expand_special): - """Get the pdb file name that should be used for compiler invocations, or + config = self._TargetConfig(config) + defines = [] + if self._ConfigAttrib(["CharacterSet"], config) == "1": + defines.extend(("_UNICODE", "UNICODE")) + if self._ConfigAttrib(["CharacterSet"], config) == "2": + defines.append("_MBCS") + defines.extend( + self._Setting( + ("VCCLCompilerTool", "PreprocessorDefinitions"), config, default=[] + ) + ) + return defines + + def GetCompilerPdbName(self, config, expand_special): + """Get the pdb file name that should be used for compiler invocations, or None if there's no explicit name specified.""" - config = self._TargetConfig(config) - pdbname = self._Setting( - ('VCCLCompilerTool', 'ProgramDataBaseFileName'), config) - if pdbname: - pdbname = expand_special(self.ConvertVSMacros(pdbname)) - return pdbname - - def GetMapFileName(self, config, expand_special): - """Gets the explicitly overridden map file name for a target or returns None + config = self._TargetConfig(config) + pdbname = self._Setting(("VCCLCompilerTool", "ProgramDataBaseFileName"), config) + if pdbname: + pdbname = expand_special(self.ConvertVSMacros(pdbname)) + return pdbname + + def GetMapFileName(self, config, expand_special): + """Gets the explicitly overridden map file name for a target or returns None if it's not set.""" - config = self._TargetConfig(config) - map_file = self._Setting(('VCLinkerTool', 'MapFileName'), config) - if map_file: - map_file = expand_special(self.ConvertVSMacros(map_file, config=config)) - return map_file - - def GetOutputName(self, config, expand_special): - """Gets the explicitly overridden output name for a target or returns None + config = self._TargetConfig(config) + map_file = self._Setting(("VCLinkerTool", "MapFileName"), config) + if map_file: + map_file = expand_special(self.ConvertVSMacros(map_file, config=config)) + return map_file + + def GetOutputName(self, config, expand_special): + """Gets the explicitly overridden output name for a target or returns None if it's not overridden.""" - config = self._TargetConfig(config) - type = self.spec['type'] - root = 'VCLibrarianTool' if type == 'static_library' else 'VCLinkerTool' - # TODO(scottmg): Handle OutputDirectory without OutputFile. - output_file = self._Setting((root, 'OutputFile'), config) - if output_file: - output_file = expand_special(self.ConvertVSMacros( - output_file, config=config)) - return output_file - - def GetPDBName(self, config, expand_special, default): - """Gets the explicitly overridden pdb name for a target or returns + config = self._TargetConfig(config) + type = self.spec["type"] + root = "VCLibrarianTool" if type == "static_library" else "VCLinkerTool" + # TODO(scottmg): Handle OutputDirectory without OutputFile. + output_file = self._Setting((root, "OutputFile"), config) + if output_file: + output_file = expand_special( + self.ConvertVSMacros(output_file, config=config) + ) + return output_file + + def GetPDBName(self, config, expand_special, default): + """Gets the explicitly overridden pdb name for a target or returns default if it's not overridden, or if no pdb will be generated.""" - config = self._TargetConfig(config) - output_file = self._Setting(('VCLinkerTool', 'ProgramDatabaseFile'), config) - generate_debug_info = self._Setting( - ('VCLinkerTool', 'GenerateDebugInformation'), config) - if generate_debug_info == 'true': - if output_file: - return expand_special(self.ConvertVSMacros(output_file, config=config)) - else: - return default - else: - return None - - def GetNoImportLibrary(self, config): - """If NoImportLibrary: true, ninja will not expect the output to include + config = self._TargetConfig(config) + output_file = self._Setting(("VCLinkerTool", "ProgramDatabaseFile"), config) + generate_debug_info = self._Setting( + ("VCLinkerTool", "GenerateDebugInformation"), config + ) + if generate_debug_info == "true": + if output_file: + return expand_special(self.ConvertVSMacros(output_file, config=config)) + else: + return default + else: + return None + + def GetNoImportLibrary(self, config): + """If NoImportLibrary: true, ninja will not expect the output to include an import library.""" - config = self._TargetConfig(config) - noimplib = self._Setting(('NoImportLibrary',), config) - return noimplib == 'true' - - def GetAsmflags(self, config): - """Returns the flags that need to be added to ml invocations.""" - config = self._TargetConfig(config) - asmflags = [] - safeseh = self._Setting(('MASM', 'UseSafeExceptionHandlers'), config) - if safeseh == 'true': - asmflags.append('/safeseh') - return asmflags - - def GetCflags(self, config): - """Returns the flags that need to be added to .c and .cc compilations.""" - config = self._TargetConfig(config) - cflags = [] - cflags.extend(['/wd' + w for w in self.msvs_disabled_warnings[config]]) - cl = self._GetWrapper(self, self.msvs_settings[config], - 'VCCLCompilerTool', append=cflags) - cl('Optimization', - map={'0': 'd', '1': '1', '2': '2', '3': 'x'}, prefix='/O', default='2') - cl('InlineFunctionExpansion', prefix='/Ob') - cl('DisableSpecificWarnings', prefix='/wd') - cl('StringPooling', map={'true': '/GF'}) - cl('EnableFiberSafeOptimizations', map={'true': '/GT'}) - cl('OmitFramePointers', map={'false': '-', 'true': ''}, prefix='/Oy') - cl('EnableIntrinsicFunctions', map={'false': '-', 'true': ''}, prefix='/Oi') - cl('FavorSizeOrSpeed', map={'1': 't', '2': 's'}, prefix='/O') - cl('FloatingPointModel', - map={'0': 'precise', '1': 'strict', '2': 'fast'}, prefix='/fp:', - default='0') - cl('CompileAsManaged', map={'false': '', 'true': '/clr'}) - cl('WholeProgramOptimization', map={'true': '/GL'}) - cl('WarningLevel', prefix='/W') - cl('WarnAsError', map={'true': '/WX'}) - cl('CallingConvention', - map={'0': 'd', '1': 'r', '2': 'z', '3': 'v'}, prefix='/G') - cl('DebugInformationFormat', - map={'1': '7', '3': 'i', '4': 'I'}, prefix='/Z') - cl('RuntimeTypeInfo', map={'true': '/GR', 'false': '/GR-'}) - cl('EnableFunctionLevelLinking', map={'true': '/Gy', 'false': '/Gy-'}) - cl('MinimalRebuild', map={'true': '/Gm'}) - cl('BufferSecurityCheck', map={'true': '/GS', 'false': '/GS-'}) - cl('BasicRuntimeChecks', map={'1': 's', '2': 'u', '3': '1'}, prefix='/RTC') - cl('RuntimeLibrary', - map={'0': 'T', '1': 'Td', '2': 'D', '3': 'Dd'}, prefix='/M') - cl('ExceptionHandling', map={'1': 'sc','2': 'a'}, prefix='/EH') - cl('DefaultCharIsUnsigned', map={'true': '/J'}) - cl('TreatWChar_tAsBuiltInType', - map={'false': '-', 'true': ''}, prefix='/Zc:wchar_t') - cl('EnablePREfast', map={'true': '/analyze'}) - cl('AdditionalOptions', prefix='') - cl('EnableEnhancedInstructionSet', - map={'1': 'SSE', '2': 'SSE2', '3': 'AVX', '4': 'IA32', '5': 'AVX2'}, - prefix='/arch:') - cflags.extend(['/FI' + f for f in self._Setting( - ('VCCLCompilerTool', 'ForcedIncludeFiles'), config, default=[])]) - if self.vs_version.short_name in ('2013', '2013e', '2015'): - # New flag required in 2013 to maintain previous PDB behavior. - cflags.append('/FS') - # ninja handles parallelism by itself, don't have the compiler do it too. - cflags = filter(lambda x: not x.startswith('/MP'), cflags) - return cflags - - def _GetPchFlags(self, config, extension): - """Get the flags to be added to the cflags for precompiled header support. + config = self._TargetConfig(config) + noimplib = self._Setting(("NoImportLibrary",), config) + return noimplib == "true" + + def GetAsmflags(self, config): + """Returns the flags that need to be added to ml invocations.""" + config = self._TargetConfig(config) + asmflags = [] + safeseh = self._Setting(("MASM", "UseSafeExceptionHandlers"), config) + if safeseh == "true": + asmflags.append("/safeseh") + return asmflags + + def GetCflags(self, config): + """Returns the flags that need to be added to .c and .cc compilations.""" + config = self._TargetConfig(config) + cflags = [] + cflags.extend(["/wd" + w for w in self.msvs_disabled_warnings[config]]) + cl = self._GetWrapper( + self, self.msvs_settings[config], "VCCLCompilerTool", append=cflags + ) + cl( + "Optimization", + map={"0": "d", "1": "1", "2": "2", "3": "x"}, + prefix="/O", + default="2", + ) + cl("InlineFunctionExpansion", prefix="/Ob") + cl("DisableSpecificWarnings", prefix="/wd") + cl("StringPooling", map={"true": "/GF"}) + cl("EnableFiberSafeOptimizations", map={"true": "/GT"}) + cl("OmitFramePointers", map={"false": "-", "true": ""}, prefix="/Oy") + cl("EnableIntrinsicFunctions", map={"false": "-", "true": ""}, prefix="/Oi") + cl("FavorSizeOrSpeed", map={"1": "t", "2": "s"}, prefix="/O") + cl( + "FloatingPointModel", + map={"0": "precise", "1": "strict", "2": "fast"}, + prefix="/fp:", + default="0", + ) + cl("CompileAsManaged", map={"false": "", "true": "/clr"}) + cl("WholeProgramOptimization", map={"true": "/GL"}) + cl("WarningLevel", prefix="/W") + cl("WarnAsError", map={"true": "/WX"}) + cl( + "CallingConvention", + map={"0": "d", "1": "r", "2": "z", "3": "v"}, + prefix="/G", + ) + cl("DebugInformationFormat", map={"1": "7", "3": "i", "4": "I"}, prefix="/Z") + cl("RuntimeTypeInfo", map={"true": "/GR", "false": "/GR-"}) + cl("EnableFunctionLevelLinking", map={"true": "/Gy", "false": "/Gy-"}) + cl("MinimalRebuild", map={"true": "/Gm"}) + cl("BufferSecurityCheck", map={"true": "/GS", "false": "/GS-"}) + cl("BasicRuntimeChecks", map={"1": "s", "2": "u", "3": "1"}, prefix="/RTC") + cl( + "RuntimeLibrary", + map={"0": "T", "1": "Td", "2": "D", "3": "Dd"}, + prefix="/M", + ) + cl("ExceptionHandling", map={"1": "sc", "2": "a"}, prefix="/EH") + cl("DefaultCharIsUnsigned", map={"true": "/J"}) + cl( + "TreatWChar_tAsBuiltInType", + map={"false": "-", "true": ""}, + prefix="/Zc:wchar_t", + ) + cl("EnablePREfast", map={"true": "/analyze"}) + cl("AdditionalOptions", prefix="") + cl( + "EnableEnhancedInstructionSet", + map={"1": "SSE", "2": "SSE2", "3": "AVX", "4": "IA32", "5": "AVX2"}, + prefix="/arch:", + ) + cflags.extend( + [ + "/FI" + f + for f in self._Setting( + ("VCCLCompilerTool", "ForcedIncludeFiles"), config, default=[] + ) + ] + ) + if self.vs_version.project_version >= 12.0: + # New flag introduced in VS2013 (project version 12.0) Forces writes to + # the program database (PDB) to be serialized through MSPDBSRV.EXE. + # https://msdn.microsoft.com/en-us/library/dn502518.aspx + cflags.append("/FS") + # ninja handles parallelism by itself, don't have the compiler do it too. + cflags = [x for x in cflags if not x.startswith("/MP")] + return cflags + + def _GetPchFlags(self, config, extension): + """Get the flags to be added to the cflags for precompiled header support. """ - config = self._TargetConfig(config) - # The PCH is only built once by a particular source file. Usage of PCH must - # only be for the same language (i.e. C vs. C++), so only include the pch - # flags when the language matches. - if self.msvs_precompiled_header[config]: - source_ext = os.path.splitext(self.msvs_precompiled_source[config])[1] - if _LanguageMatchesForPch(source_ext, extension): - pch = os.path.split(self.msvs_precompiled_header[config])[1] - return ['/Yu' + pch, '/FI' + pch, '/Fp${pchprefix}.' + pch + '.pch'] - return [] - - def GetCflagsC(self, config): - """Returns the flags that need to be added to .c compilations.""" - config = self._TargetConfig(config) - return self._GetPchFlags(config, '.c') - - def GetCflagsCC(self, config): - """Returns the flags that need to be added to .cc compilations.""" - config = self._TargetConfig(config) - return ['/TP'] + self._GetPchFlags(config, '.cc') - - def _GetAdditionalLibraryDirectories(self, root, config, gyp_to_build_path): - """Get and normalize the list of paths in AdditionalLibraryDirectories + config = self._TargetConfig(config) + # The PCH is only built once by a particular source file. Usage of PCH must + # only be for the same language (i.e. C vs. C++), so only include the pch + # flags when the language matches. + if self.msvs_precompiled_header[config]: + source_ext = os.path.splitext(self.msvs_precompiled_source[config])[1] + if _LanguageMatchesForPch(source_ext, extension): + pch = self.msvs_precompiled_header[config] + pchbase = os.path.split(pch)[1] + return ["/Yu" + pch, "/FI" + pch, "/Fp${pchprefix}." + pchbase + ".pch"] + return [] + + def GetCflagsC(self, config): + """Returns the flags that need to be added to .c compilations.""" + config = self._TargetConfig(config) + return self._GetPchFlags(config, ".c") + + def GetCflagsCC(self, config): + """Returns the flags that need to be added to .cc compilations.""" + config = self._TargetConfig(config) + return ["/TP"] + self._GetPchFlags(config, ".cc") + + def _GetAdditionalLibraryDirectories(self, root, config, gyp_to_build_path): + """Get and normalize the list of paths in AdditionalLibraryDirectories setting.""" - config = self._TargetConfig(config) - libpaths = self._Setting((root, 'AdditionalLibraryDirectories'), - config, default=[]) - libpaths = [os.path.normpath( - gyp_to_build_path(self.ConvertVSMacros(p, config=config))) - for p in libpaths] - return ['/LIBPATH:"' + p + '"' for p in libpaths] - - def GetLibFlags(self, config, gyp_to_build_path): - """Returns the flags that need to be added to lib commands.""" - config = self._TargetConfig(config) - libflags = [] - lib = self._GetWrapper(self, self.msvs_settings[config], - 'VCLibrarianTool', append=libflags) - libflags.extend(self._GetAdditionalLibraryDirectories( - 'VCLibrarianTool', config, gyp_to_build_path)) - lib('LinkTimeCodeGeneration', map={'true': '/LTCG'}) - lib('TargetMachine', map={'1': 'X86', '17': 'X64', '3': 'ARM'}, - prefix='/MACHINE:') - lib('AdditionalOptions') - return libflags - - def GetDefFile(self, gyp_to_build_path): - """Returns the .def file from sources, if any. Otherwise returns None.""" - spec = self.spec - if spec['type'] in ('shared_library', 'loadable_module', 'executable'): - def_files = [s for s in spec.get('sources', []) if s.endswith('.def')] - if len(def_files) == 1: - return gyp_to_build_path(def_files[0]) - elif len(def_files) > 1: - raise Exception("Multiple .def files") - return None - - def _GetDefFileAsLdflags(self, ldflags, gyp_to_build_path): - """.def files get implicitly converted to a ModuleDefinitionFile for the + config = self._TargetConfig(config) + libpaths = self._Setting( + (root, "AdditionalLibraryDirectories"), config, default=[] + ) + libpaths = [ + os.path.normpath(gyp_to_build_path(self.ConvertVSMacros(p, config=config))) + for p in libpaths + ] + return ['/LIBPATH:"' + p + '"' for p in libpaths] + + def GetLibFlags(self, config, gyp_to_build_path): + """Returns the flags that need to be added to lib commands.""" + config = self._TargetConfig(config) + libflags = [] + lib = self._GetWrapper( + self, self.msvs_settings[config], "VCLibrarianTool", append=libflags + ) + libflags.extend( + self._GetAdditionalLibraryDirectories( + "VCLibrarianTool", config, gyp_to_build_path + ) + ) + lib("LinkTimeCodeGeneration", map={"true": "/LTCG"}) + lib( + "TargetMachine", + map={"1": "X86", "17": "X64", "3": "ARM"}, + prefix="/MACHINE:", + ) + lib("AdditionalOptions") + return libflags + + def GetDefFile(self, gyp_to_build_path): + """Returns the .def file from sources, if any. Otherwise returns None.""" + spec = self.spec + if spec["type"] in ("shared_library", "loadable_module", "executable"): + def_files = [ + s for s in spec.get("sources", []) if s.lower().endswith(".def") + ] + if len(def_files) == 1: + return gyp_to_build_path(def_files[0]) + elif len(def_files) > 1: + raise Exception("Multiple .def files") + return None + + def _GetDefFileAsLdflags(self, ldflags, gyp_to_build_path): + """.def files get implicitly converted to a ModuleDefinitionFile for the linker in the VS generator. Emulate that behaviour here.""" - def_file = self.GetDefFile(gyp_to_build_path) - if def_file: - ldflags.append('/DEF:"%s"' % def_file) + def_file = self.GetDefFile(gyp_to_build_path) + if def_file: + ldflags.append('/DEF:"%s"' % def_file) - def GetPGDName(self, config, expand_special): - """Gets the explicitly overridden pgd name for a target or returns None + def GetPGDName(self, config, expand_special): + """Gets the explicitly overridden pgd name for a target or returns None if it's not overridden.""" - config = self._TargetConfig(config) - output_file = self._Setting( - ('VCLinkerTool', 'ProfileGuidedDatabase'), config) - if output_file: - output_file = expand_special(self.ConvertVSMacros( - output_file, config=config)) - return output_file - - def GetLdflags(self, config, gyp_to_build_path, expand_special, - manifest_base_name, output_name, is_executable, build_dir): - """Returns the flags that need to be added to link commands, and the + config = self._TargetConfig(config) + output_file = self._Setting(("VCLinkerTool", "ProfileGuidedDatabase"), config) + if output_file: + output_file = expand_special( + self.ConvertVSMacros(output_file, config=config) + ) + return output_file + + def GetLdflags( + self, + config, + gyp_to_build_path, + expand_special, + manifest_base_name, + output_name, + is_executable, + build_dir, + ): + """Returns the flags that need to be added to link commands, and the manifest files.""" - config = self._TargetConfig(config) - ldflags = [] - ld = self._GetWrapper(self, self.msvs_settings[config], - 'VCLinkerTool', append=ldflags) - self._GetDefFileAsLdflags(ldflags, gyp_to_build_path) - ld('GenerateDebugInformation', map={'true': '/DEBUG'}) - # TODO: These 'map' values come from machineTypeOption enum, - # and does not have an official value for ARM64 in VS2017 (yet). - # It needs to verify the ARM64 value when machineTypeOption is updated. - ld('TargetMachine', map={'1': 'X86', '17': 'X64', '3': 'ARM', '18': 'ARM64'}, - prefix='/MACHINE:') - ldflags.extend(self._GetAdditionalLibraryDirectories( - 'VCLinkerTool', config, gyp_to_build_path)) - ld('DelayLoadDLLs', prefix='/DELAYLOAD:') - ld('TreatLinkerWarningAsErrors', prefix='/WX', - map={'true': '', 'false': ':NO'}) - out = self.GetOutputName(config, expand_special) - if out: - ldflags.append('/OUT:' + out) - pdb = self.GetPDBName(config, expand_special, output_name + '.pdb') - if pdb: - ldflags.append('/PDB:' + pdb) - pgd = self.GetPGDName(config, expand_special) - if pgd: - ldflags.append('/PGD:' + pgd) - map_file = self.GetMapFileName(config, expand_special) - ld('GenerateMapFile', map={'true': '/MAP:' + map_file if map_file - else '/MAP'}) - ld('MapExports', map={'true': '/MAPINFO:EXPORTS'}) - ld('AdditionalOptions', prefix='') - - minimum_required_version = self._Setting( - ('VCLinkerTool', 'MinimumRequiredVersion'), config, default='') - if minimum_required_version: - minimum_required_version = ',' + minimum_required_version - ld('SubSystem', - map={'1': 'CONSOLE%s' % minimum_required_version, - '2': 'WINDOWS%s' % minimum_required_version}, - prefix='/SUBSYSTEM:') - - stack_reserve_size = self._Setting( - ('VCLinkerTool', 'StackReserveSize'), config, default='') - if stack_reserve_size: - stack_commit_size = self._Setting( - ('VCLinkerTool', 'StackCommitSize'), config, default='') - if stack_commit_size: - stack_commit_size = ',' + stack_commit_size - ldflags.append('/STACK:%s%s' % (stack_reserve_size, stack_commit_size)) - - ld('TerminalServerAware', map={'1': ':NO', '2': ''}, prefix='/TSAWARE') - ld('LinkIncremental', map={'1': ':NO', '2': ''}, prefix='/INCREMENTAL') - ld('BaseAddress', prefix='/BASE:') - ld('FixedBaseAddress', map={'1': ':NO', '2': ''}, prefix='/FIXED') - ld('RandomizedBaseAddress', - map={'1': ':NO', '2': ''}, prefix='/DYNAMICBASE') - ld('DataExecutionPrevention', - map={'1': ':NO', '2': ''}, prefix='/NXCOMPAT') - ld('OptimizeReferences', map={'1': 'NOREF', '2': 'REF'}, prefix='/OPT:') - ld('ForceSymbolReferences', prefix='/INCLUDE:') - ld('EnableCOMDATFolding', map={'1': 'NOICF', '2': 'ICF'}, prefix='/OPT:') - ld('LinkTimeCodeGeneration', - map={'1': '', '2': ':PGINSTRUMENT', '3': ':PGOPTIMIZE', - '4': ':PGUPDATE'}, - prefix='/LTCG') - ld('IgnoreDefaultLibraryNames', prefix='/NODEFAULTLIB:') - ld('ResourceOnlyDLL', map={'true': '/NOENTRY'}) - ld('EntryPointSymbol', prefix='/ENTRY:') - ld('Profile', map={'true': '/PROFILE'}) - ld('LargeAddressAware', - map={'1': ':NO', '2': ''}, prefix='/LARGEADDRESSAWARE') - # TODO(scottmg): This should sort of be somewhere else (not really a flag). - ld('AdditionalDependencies', prefix='') - - if self.GetArch(config) == 'x86': - safeseh_default = 'true' - else: - safeseh_default = None - ld('ImageHasSafeExceptionHandlers', - map={'false': ':NO', 'true': ''}, prefix='/SAFESEH', - default=safeseh_default) - - # If the base address is not specifically controlled, DYNAMICBASE should - # be on by default. - base_flags = filter(lambda x: 'DYNAMICBASE' in x or x == '/FIXED', - ldflags) - if not base_flags: - ldflags.append('/DYNAMICBASE') - - # If the NXCOMPAT flag has not been specified, default to on. Despite the - # documentation that says this only defaults to on when the subsystem is - # Vista or greater (which applies to the linker), the IDE defaults it on - # unless it's explicitly off. - if not filter(lambda x: 'NXCOMPAT' in x, ldflags): - ldflags.append('/NXCOMPAT') - - have_def_file = filter(lambda x: x.startswith('/DEF:'), ldflags) - manifest_flags, intermediate_manifest, manifest_files = \ - self._GetLdManifestFlags(config, manifest_base_name, gyp_to_build_path, - is_executable and not have_def_file, build_dir) - ldflags.extend(manifest_flags) - return ldflags, intermediate_manifest, manifest_files - - def _GetLdManifestFlags(self, config, name, gyp_to_build_path, - allow_isolation, build_dir): - """Returns a 3-tuple: + config = self._TargetConfig(config) + ldflags = [] + ld = self._GetWrapper( + self, self.msvs_settings[config], "VCLinkerTool", append=ldflags + ) + self._GetDefFileAsLdflags(ldflags, gyp_to_build_path) + ld("GenerateDebugInformation", map={"true": "/DEBUG"}) + # TODO: These 'map' values come from machineTypeOption enum, + # and does not have an official value for ARM64 in VS2017 (yet). + # It needs to verify the ARM64 value when machineTypeOption is updated. + ld( + "TargetMachine", + map={"1": "X86", "17": "X64", "3": "ARM", "18": "ARM64"}, + prefix="/MACHINE:", + ) + ldflags.extend( + self._GetAdditionalLibraryDirectories( + "VCLinkerTool", config, gyp_to_build_path + ) + ) + ld("DelayLoadDLLs", prefix="/DELAYLOAD:") + ld("TreatLinkerWarningAsErrors", prefix="/WX", map={"true": "", "false": ":NO"}) + out = self.GetOutputName(config, expand_special) + if out: + ldflags.append("/OUT:" + out) + pdb = self.GetPDBName(config, expand_special, output_name + ".pdb") + if pdb: + ldflags.append("/PDB:" + pdb) + pgd = self.GetPGDName(config, expand_special) + if pgd: + ldflags.append("/PGD:" + pgd) + map_file = self.GetMapFileName(config, expand_special) + ld("GenerateMapFile", map={"true": "/MAP:" + map_file if map_file else "/MAP"}) + ld("MapExports", map={"true": "/MAPINFO:EXPORTS"}) + ld("AdditionalOptions", prefix="") + + minimum_required_version = self._Setting( + ("VCLinkerTool", "MinimumRequiredVersion"), config, default="" + ) + if minimum_required_version: + minimum_required_version = "," + minimum_required_version + ld( + "SubSystem", + map={ + "1": "CONSOLE%s" % minimum_required_version, + "2": "WINDOWS%s" % minimum_required_version, + }, + prefix="/SUBSYSTEM:", + ) + + stack_reserve_size = self._Setting( + ("VCLinkerTool", "StackReserveSize"), config, default="" + ) + if stack_reserve_size: + stack_commit_size = self._Setting( + ("VCLinkerTool", "StackCommitSize"), config, default="" + ) + if stack_commit_size: + stack_commit_size = "," + stack_commit_size + ldflags.append("/STACK:%s%s" % (stack_reserve_size, stack_commit_size)) + + ld("TerminalServerAware", map={"1": ":NO", "2": ""}, prefix="/TSAWARE") + ld("LinkIncremental", map={"1": ":NO", "2": ""}, prefix="/INCREMENTAL") + ld("BaseAddress", prefix="/BASE:") + ld("FixedBaseAddress", map={"1": ":NO", "2": ""}, prefix="/FIXED") + ld("RandomizedBaseAddress", map={"1": ":NO", "2": ""}, prefix="/DYNAMICBASE") + ld("DataExecutionPrevention", map={"1": ":NO", "2": ""}, prefix="/NXCOMPAT") + ld("OptimizeReferences", map={"1": "NOREF", "2": "REF"}, prefix="/OPT:") + ld("ForceSymbolReferences", prefix="/INCLUDE:") + ld("EnableCOMDATFolding", map={"1": "NOICF", "2": "ICF"}, prefix="/OPT:") + ld( + "LinkTimeCodeGeneration", + map={"1": "", "2": ":PGINSTRUMENT", "3": ":PGOPTIMIZE", "4": ":PGUPDATE"}, + prefix="/LTCG", + ) + ld("IgnoreDefaultLibraryNames", prefix="/NODEFAULTLIB:") + ld("ResourceOnlyDLL", map={"true": "/NOENTRY"}) + ld("EntryPointSymbol", prefix="/ENTRY:") + ld("Profile", map={"true": "/PROFILE"}) + ld("LargeAddressAware", map={"1": ":NO", "2": ""}, prefix="/LARGEADDRESSAWARE") + # TODO(scottmg): This should sort of be somewhere else (not really a flag). + ld("AdditionalDependencies", prefix="") + + if self.GetArch(config) == "x86": + safeseh_default = "true" + else: + safeseh_default = None + ld( + "ImageHasSafeExceptionHandlers", + map={"false": ":NO", "true": ""}, + prefix="/SAFESEH", + default=safeseh_default, + ) + + # If the base address is not specifically controlled, DYNAMICBASE should + # be on by default. + if not any("DYNAMICBASE" in flag or flag == "/FIXED" for flag in ldflags): + ldflags.append("/DYNAMICBASE") + + # If the NXCOMPAT flag has not been specified, default to on. Despite the + # documentation that says this only defaults to on when the subsystem is + # Vista or greater (which applies to the linker), the IDE defaults it on + # unless it's explicitly off. + if not any("NXCOMPAT" in flag for flag in ldflags): + ldflags.append("/NXCOMPAT") + + have_def_file = any(flag.startswith("/DEF:") for flag in ldflags) + ( + manifest_flags, + intermediate_manifest, + manifest_files, + ) = self._GetLdManifestFlags( + config, + manifest_base_name, + gyp_to_build_path, + is_executable and not have_def_file, + build_dir, + ) + ldflags.extend(manifest_flags) + return ldflags, intermediate_manifest, manifest_files + + def _GetLdManifestFlags( + self, config, name, gyp_to_build_path, allow_isolation, build_dir + ): + """Returns a 3-tuple: - the set of flags that need to be added to the link to generate a default manifest - the intermediate manifest that the linker will generate that should be used to assert it doesn't add anything to the merged one. - the list of all the manifest files to be merged by the manifest tool and included into the link.""" - generate_manifest = self._Setting(('VCLinkerTool', 'GenerateManifest'), - config, - default='true') - if generate_manifest != 'true': - # This means not only that the linker should not generate the intermediate - # manifest but also that the manifest tool should do nothing even when - # additional manifests are specified. - return ['/MANIFEST:NO'], [], [] - - output_name = name + '.intermediate.manifest' - flags = [ - '/MANIFEST', - '/ManifestFile:' + output_name, - ] - - # Instead of using the MANIFESTUAC flags, we generate a .manifest to - # include into the list of manifests. This allows us to avoid the need to - # do two passes during linking. The /MANIFEST flag and /ManifestFile are - # still used, and the intermediate manifest is used to assert that the - # final manifest we get from merging all the additional manifest files - # (plus the one we generate here) isn't modified by merging the - # intermediate into it. - - # Always NO, because we generate a manifest file that has what we want. - flags.append('/MANIFESTUAC:NO') - - config = self._TargetConfig(config) - enable_uac = self._Setting(('VCLinkerTool', 'EnableUAC'), config, - default='true') - manifest_files = [] - generated_manifest_outer = \ -"" \ -"%s" \ -"" - if enable_uac == 'true': - execution_level = self._Setting(('VCLinkerTool', 'UACExecutionLevel'), - config, default='0') - execution_level_map = { - '0': 'asInvoker', - '1': 'highestAvailable', - '2': 'requireAdministrator' - } - - ui_access = self._Setting(('VCLinkerTool', 'UACUIAccess'), config, - default='false') - - inner = ''' + generate_manifest = self._Setting( + ("VCLinkerTool", "GenerateManifest"), config, default="true" + ) + if generate_manifest != "true": + # This means not only that the linker should not generate the intermediate + # manifest but also that the manifest tool should do nothing even when + # additional manifests are specified. + return ["/MANIFEST:NO"], [], [] + + output_name = name + ".intermediate.manifest" + flags = [ + "/MANIFEST", + "/ManifestFile:" + output_name, + ] + + # Instead of using the MANIFESTUAC flags, we generate a .manifest to + # include into the list of manifests. This allows us to avoid the need to + # do two passes during linking. The /MANIFEST flag and /ManifestFile are + # still used, and the intermediate manifest is used to assert that the + # final manifest we get from merging all the additional manifest files + # (plus the one we generate here) isn't modified by merging the + # intermediate into it. + + # Always NO, because we generate a manifest file that has what we want. + flags.append("/MANIFESTUAC:NO") + + config = self._TargetConfig(config) + enable_uac = self._Setting( + ("VCLinkerTool", "EnableUAC"), config, default="true" + ) + manifest_files = [] + generated_manifest_outer = ( + "" + "%s" + "" + ) + if enable_uac == "true": + execution_level = self._Setting( + ("VCLinkerTool", "UACExecutionLevel"), config, default="0" + ) + execution_level_map = { + "0": "asInvoker", + "1": "highestAvailable", + "2": "requireAdministrator", + } + + ui_access = self._Setting( + ("VCLinkerTool", "UACUIAccess"), config, default="false" + ) + + inner = """ -''' % (execution_level_map[execution_level], ui_access) - else: - inner = '' - - generated_manifest_contents = generated_manifest_outer % inner - generated_name = name + '.generated.manifest' - # Need to join with the build_dir here as we're writing it during - # generation time, but we return the un-joined version because the build - # will occur in that directory. We only write the file if the contents - # have changed so that simply regenerating the project files doesn't - # cause a relink. - build_dir_generated_name = os.path.join(build_dir, generated_name) - gyp.common.EnsureDirExists(build_dir_generated_name) - f = gyp.common.WriteOnDiff(build_dir_generated_name) - f.write(generated_manifest_contents) - f.close() - manifest_files = [generated_name] - - if allow_isolation: - flags.append('/ALLOWISOLATION') - - manifest_files += self._GetAdditionalManifestFiles(config, - gyp_to_build_path) - return flags, output_name, manifest_files - - def _GetAdditionalManifestFiles(self, config, gyp_to_build_path): - """Gets additional manifest files that are added to the default one +""" % ( + execution_level_map[execution_level], + ui_access, + ) + else: + inner = "" + + generated_manifest_contents = generated_manifest_outer % inner + generated_name = name + ".generated.manifest" + # Need to join with the build_dir here as we're writing it during + # generation time, but we return the un-joined version because the build + # will occur in that directory. We only write the file if the contents + # have changed so that simply regenerating the project files doesn't + # cause a relink. + build_dir_generated_name = os.path.join(build_dir, generated_name) + gyp.common.EnsureDirExists(build_dir_generated_name) + f = gyp.common.WriteOnDiff(build_dir_generated_name) + f.write(generated_manifest_contents) + f.close() + manifest_files = [generated_name] + + if allow_isolation: + flags.append("/ALLOWISOLATION") + + manifest_files += self._GetAdditionalManifestFiles(config, gyp_to_build_path) + return flags, output_name, manifest_files + + def _GetAdditionalManifestFiles(self, config, gyp_to_build_path): + """Gets additional manifest files that are added to the default one generated by the linker.""" - files = self._Setting(('VCManifestTool', 'AdditionalManifestFiles'), config, - default=[]) - if isinstance(files, str): - files = files.split(';') - return [os.path.normpath( - gyp_to_build_path(self.ConvertVSMacros(f, config=config))) - for f in files] - - def IsUseLibraryDependencyInputs(self, config): - """Returns whether the target should be linked via Use Library Dependency + files = self._Setting( + ("VCManifestTool", "AdditionalManifestFiles"), config, default=[] + ) + if isinstance(files, str): + files = files.split(";") + return [ + os.path.normpath(gyp_to_build_path(self.ConvertVSMacros(f, config=config))) + for f in files + ] + + def IsUseLibraryDependencyInputs(self, config): + """Returns whether the target should be linked via Use Library Dependency Inputs (using component .objs of a given .lib).""" - config = self._TargetConfig(config) - uldi = self._Setting(('VCLinkerTool', 'UseLibraryDependencyInputs'), config) - return uldi == 'true' - - def IsEmbedManifest(self, config): - """Returns whether manifest should be linked into binary.""" - config = self._TargetConfig(config) - embed = self._Setting(('VCManifestTool', 'EmbedManifest'), config, - default='true') - return embed == 'true' - - def IsLinkIncremental(self, config): - """Returns whether the target should be linked incrementally.""" - config = self._TargetConfig(config) - link_inc = self._Setting(('VCLinkerTool', 'LinkIncremental'), config) - return link_inc != '1' - - def GetRcflags(self, config, gyp_to_ninja_path): - """Returns the flags that need to be added to invocations of the resource + config = self._TargetConfig(config) + uldi = self._Setting(("VCLinkerTool", "UseLibraryDependencyInputs"), config) + return uldi == "true" + + def IsEmbedManifest(self, config): + """Returns whether manifest should be linked into binary.""" + config = self._TargetConfig(config) + embed = self._Setting( + ("VCManifestTool", "EmbedManifest"), config, default="true" + ) + return embed == "true" + + def IsLinkIncremental(self, config): + """Returns whether the target should be linked incrementally.""" + config = self._TargetConfig(config) + link_inc = self._Setting(("VCLinkerTool", "LinkIncremental"), config) + return link_inc != "1" + + def GetRcflags(self, config, gyp_to_ninja_path): + """Returns the flags that need to be added to invocations of the resource compiler.""" - config = self._TargetConfig(config) - rcflags = [] - rc = self._GetWrapper(self, self.msvs_settings[config], - 'VCResourceCompilerTool', append=rcflags) - rc('AdditionalIncludeDirectories', map=gyp_to_ninja_path, prefix='/I') - rcflags.append('/I' + gyp_to_ninja_path('.')) - rc('PreprocessorDefinitions', prefix='/d') - # /l arg must be in hex without leading '0x' - rc('Culture', prefix='/l', map=lambda x: hex(int(x))[2:]) - return rcflags - - def BuildCygwinBashCommandLine(self, args, path_to_base): - """Build a command line that runs args via cygwin bash. We assume that all + config = self._TargetConfig(config) + rcflags = [] + rc = self._GetWrapper( + self, self.msvs_settings[config], "VCResourceCompilerTool", append=rcflags + ) + rc("AdditionalIncludeDirectories", map=gyp_to_ninja_path, prefix="/I") + rcflags.append("/I" + gyp_to_ninja_path(".")) + rc("PreprocessorDefinitions", prefix="/d") + # /l arg must be in hex without leading '0x' + rc("Culture", prefix="/l", map=lambda x: hex(int(x))[2:]) + return rcflags + + def BuildCygwinBashCommandLine(self, args, path_to_base): + """Build a command line that runs args via cygwin bash. We assume that all incoming paths are in Windows normpath'd form, so they need to be converted to posix style for the part of the command line that's passed to bash. We also have to do some Visual Studio macro emulation here because @@ -808,212 +923,246 @@ def BuildCygwinBashCommandLine(self, args, path_to_base): contain ninja variables cannot be fixed here (for example ${source}), so the outer generator needs to make sure that the paths that are written out are in posix style, if the command line will be used here.""" - cygwin_dir = os.path.normpath( - os.path.join(path_to_base, self.msvs_cygwin_dirs[0])) - cd = ('cd %s' % path_to_base).replace('\\', '/') - args = [a.replace('\\', '/').replace('"', '\\"') for a in args] - args = ["'%s'" % a.replace("'", "'\\''") for a in args] - bash_cmd = ' '.join(args) - cmd = ( - 'call "%s\\setup_env.bat" && set CYGWIN=nontsec && ' % cygwin_dir + - 'bash -c "%s ; %s"' % (cd, bash_cmd)) - return cmd - - def IsRuleRunUnderCygwin(self, rule): - """Determine if an action should be run under cygwin. If the variable is + cygwin_dir = os.path.normpath( + os.path.join(path_to_base, self.msvs_cygwin_dirs[0]) + ) + cd = ("cd %s" % path_to_base).replace("\\", "/") + args = [a.replace("\\", "/").replace('"', '\\"') for a in args] + args = ["'%s'" % a.replace("'", "'\\''") for a in args] + bash_cmd = " ".join(args) + cmd = ( + 'call "%s\\setup_env.bat" && set CYGWIN=nontsec && ' % cygwin_dir + + 'bash -c "%s ; %s"' % (cd, bash_cmd) + ) + return cmd + + def IsRuleRunUnderCygwin(self, rule): + """Determine if an action should be run under cygwin. If the variable is unset, or set to 1 we use cygwin.""" - return int(rule.get('msvs_cygwin_shell', - self.spec.get('msvs_cygwin_shell', 1))) != 0 - - def _HasExplicitRuleForExtension(self, spec, extension): - """Determine if there's an explicit rule for a particular extension.""" - for rule in spec.get('rules', []): - if rule['extension'] == extension: - return True - return False - - def _HasExplicitIdlActions(self, spec): - """Determine if an action should not run midl for .idl files.""" - return any([action.get('explicit_idl_action', 0) - for action in spec.get('actions', [])]) - - def HasExplicitIdlRulesOrActions(self, spec): - """Determine if there's an explicit rule or action for idl files. When + return ( + int(rule.get("msvs_cygwin_shell", self.spec.get("msvs_cygwin_shell", 1))) + != 0 + ) + + def _HasExplicitRuleForExtension(self, spec, extension): + """Determine if there's an explicit rule for a particular extension.""" + for rule in spec.get("rules", []): + if rule["extension"] == extension: + return True + return False + + def _HasExplicitIdlActions(self, spec): + """Determine if an action should not run midl for .idl files.""" + return any( + [action.get("explicit_idl_action", 0) for action in spec.get("actions", [])] + ) + + def HasExplicitIdlRulesOrActions(self, spec): + """Determine if there's an explicit rule or action for idl files. When there isn't we need to generate implicit rules to build MIDL .idl files.""" - return (self._HasExplicitRuleForExtension(spec, 'idl') or - self._HasExplicitIdlActions(spec)) + return self._HasExplicitRuleForExtension( + spec, "idl" + ) or self._HasExplicitIdlActions(spec) - def HasExplicitAsmRules(self, spec): - """Determine if there's an explicit rule for asm files. When there isn't we + def HasExplicitAsmRules(self, spec): + """Determine if there's an explicit rule for asm files. When there isn't we need to generate implicit rules to assemble .asm files.""" - return self._HasExplicitRuleForExtension(spec, 'asm') + return self._HasExplicitRuleForExtension(spec, "asm") - def GetIdlBuildData(self, source, config): - """Determine the implicit outputs for an idl file. Returns output + def GetIdlBuildData(self, source, config): + """Determine the implicit outputs for an idl file. Returns output directory, outputs, and variables and flags that are required.""" - config = self._TargetConfig(config) - midl_get = self._GetWrapper(self, self.msvs_settings[config], 'VCMIDLTool') - def midl(name, default=None): - return self.ConvertVSMacros(midl_get(name, default=default), - config=config) - tlb = midl('TypeLibraryName', default='${root}.tlb') - header = midl('HeaderFileName', default='${root}.h') - dlldata = midl('DLLDataFileName', default='dlldata.c') - iid = midl('InterfaceIdentifierFileName', default='${root}_i.c') - proxy = midl('ProxyFileName', default='${root}_p.c') - # Note that .tlb is not included in the outputs as it is not always - # generated depending on the content of the input idl file. - outdir = midl('OutputDirectory', default='') - output = [header, dlldata, iid, proxy] - variables = [('tlb', tlb), - ('h', header), - ('dlldata', dlldata), - ('iid', iid), - ('proxy', proxy)] - # TODO(scottmg): Are there configuration settings to set these flags? - target_platform = self.GetArch(config) - if target_platform == 'x86': - target_platform = 'win32' - flags = ['/char', 'signed', '/env', target_platform, '/Oicf'] - return outdir, output, variables, flags + config = self._TargetConfig(config) + midl_get = self._GetWrapper(self, self.msvs_settings[config], "VCMIDLTool") + + def midl(name, default=None): + return self.ConvertVSMacros(midl_get(name, default=default), config=config) + + tlb = midl("TypeLibraryName", default="${root}.tlb") + header = midl("HeaderFileName", default="${root}.h") + dlldata = midl("DLLDataFileName", default="dlldata.c") + iid = midl("InterfaceIdentifierFileName", default="${root}_i.c") + proxy = midl("ProxyFileName", default="${root}_p.c") + # Note that .tlb is not included in the outputs as it is not always + # generated depending on the content of the input idl file. + outdir = midl("OutputDirectory", default="") + output = [header, dlldata, iid, proxy] + variables = [ + ("tlb", tlb), + ("h", header), + ("dlldata", dlldata), + ("iid", iid), + ("proxy", proxy), + ] + # TODO(scottmg): Are there configuration settings to set these flags? + target_platform = self.GetArch(config) + if target_platform == "x86": + target_platform = "win32" + flags = ["/char", "signed", "/env", target_platform, "/Oicf"] + return outdir, output, variables, flags def _LanguageMatchesForPch(source_ext, pch_source_ext): - c_exts = ('.c',) - cc_exts = ('.cc', '.cxx', '.cpp') - return ((source_ext in c_exts and pch_source_ext in c_exts) or - (source_ext in cc_exts and pch_source_ext in cc_exts)) + c_exts = (".c",) + cc_exts = (".cc", ".cxx", ".cpp") + return (source_ext in c_exts and pch_source_ext in c_exts) or ( + source_ext in cc_exts and pch_source_ext in cc_exts + ) class PrecompiledHeader(object): - """Helper to generate dependencies and build rules to handle generation of + """Helper to generate dependencies and build rules to handle generation of precompiled headers. Interface matches the GCH handler in xcode_emulation.py. """ - def __init__( - self, settings, config, gyp_to_build_path, gyp_to_unique_output, obj_ext): - self.settings = settings - self.config = config - pch_source = self.settings.msvs_precompiled_source[self.config] - self.pch_source = gyp_to_build_path(pch_source) - filename, _ = os.path.splitext(pch_source) - self.output_obj = gyp_to_unique_output(filename + obj_ext).lower() - - def _PchHeader(self): - """Get the header that will appear in an #include line for all source + + def __init__( + self, settings, config, gyp_to_build_path, gyp_to_unique_output, obj_ext + ): + self.settings = settings + self.config = config + pch_source = self.settings.msvs_precompiled_source[self.config] + self.pch_source = gyp_to_build_path(pch_source) + filename, _ = os.path.splitext(pch_source) + self.output_obj = gyp_to_unique_output(filename + obj_ext).lower() + + def _PchHeader(self): + """Get the header that will appear in an #include line for all source files.""" - return os.path.split(self.settings.msvs_precompiled_header[self.config])[1] + return self.settings.msvs_precompiled_header[self.config] - def GetObjDependencies(self, sources, objs, arch): - """Given a list of sources files and the corresponding object files, + def GetObjDependencies(self, sources, objs, arch): + """Given a list of sources files and the corresponding object files, returns a list of the pch files that should be depended upon. The additional wrapping in the return value is for interface compatibility with make.py on Mac, and xcode_emulation.py.""" - assert arch is None - if not self._PchHeader(): - return [] - pch_ext = os.path.splitext(self.pch_source)[1] - for source in sources: - if _LanguageMatchesForPch(os.path.splitext(source)[1], pch_ext): - return [(None, None, self.output_obj)] - return [] - - def GetPchBuildCommands(self, arch): - """Not used on Windows as there are no additional build steps required + assert arch is None + if not self._PchHeader(): + return [] + pch_ext = os.path.splitext(self.pch_source)[1] + for source in sources: + if _LanguageMatchesForPch(os.path.splitext(source)[1], pch_ext): + return [(None, None, self.output_obj)] + return [] + + def GetPchBuildCommands(self, arch): + """Not used on Windows as there are no additional build steps required (instead, existing steps are modified in GetFlagsModifications below).""" - return [] + return [] - def GetFlagsModifications(self, input, output, implicit, command, - cflags_c, cflags_cc, expand_special): - """Get the modified cflags and implicit dependencies that should be used + def GetFlagsModifications( + self, input, output, implicit, command, cflags_c, cflags_cc, expand_special + ): + """Get the modified cflags and implicit dependencies that should be used for the pch compilation step.""" - if input == self.pch_source: - pch_output = ['/Yc' + self._PchHeader()] - if command == 'cxx': - return ([('cflags_cc', map(expand_special, cflags_cc + pch_output))], - self.output_obj, []) - elif command == 'cc': - return ([('cflags_c', map(expand_special, cflags_c + pch_output))], - self.output_obj, []) - return [], output, implicit + if input == self.pch_source: + pch_output = ["/Yc" + self._PchHeader()] + if command == "cxx": + return ( + [("cflags_cc", map(expand_special, cflags_cc + pch_output))], + self.output_obj, + [], + ) + elif command == "cc": + return ( + [("cflags_c", map(expand_special, cflags_c + pch_output))], + self.output_obj, + [], + ) + return [], output, implicit vs_version = None + + def GetVSVersion(generator_flags): - global vs_version - if not vs_version: - vs_version = gyp.MSVSVersion.SelectVisualStudioVersion( - generator_flags.get('msvs_version', 'auto'), - allow_fallback=False) - return vs_version + global vs_version + if not vs_version: + vs_version = gyp.MSVSVersion.SelectVisualStudioVersion( + generator_flags.get("msvs_version", "auto"), allow_fallback=False + ) + return vs_version + def _GetVsvarsSetupArgs(generator_flags, arch): - vs = GetVSVersion(generator_flags) - return vs.SetupScript() + vs = GetVSVersion(generator_flags) + return vs.SetupScript() + def ExpandMacros(string, expansions): - """Expand $(Variable) per expansions dict. See MsvsSettings.GetVSMacroEnv + """Expand $(Variable) per expansions dict. See MsvsSettings.GetVSMacroEnv for the canonical way to retrieve a suitable dict.""" - if '$' in string: - for old, new in expansions.items(): - assert '$(' not in new, new - string = string.replace(old, new) - return string + if "$" in string: + for old, new in expansions.items(): + assert "$(" not in new, new + string = string.replace(old, new) + return string + def _ExtractImportantEnvironment(output_of_set): - """Extracts environment variables required for the toolchain to run from + """Extracts environment variables required for the toolchain to run from a textual dump output by the cmd.exe 'set' command.""" - envvars_to_save = ( - 'goma_.*', # TODO(scottmg): This is ugly, but needed for goma. - 'include', - 'lib', - 'libpath', - 'path', - 'pathext', - 'systemroot', - 'temp', - 'tmp', - ) - env = {} - for line in output_of_set.splitlines(): - for envvar in envvars_to_save: - if re.match(envvar + '=', line.lower()): - var, setting = line.split('=', 1) - if envvar == 'path': - # Our own rules (for running gyp-win-tool) and other actions in - # Chromium rely on python being in the path. Add the path to this - # python here so that if it's not in the path when ninja is run - # later, python will still be found. - setting = os.path.dirname(sys.executable) + os.pathsep + setting - env[var.upper()] = setting - break - for required in ('SYSTEMROOT', 'TEMP', 'TMP'): - if required not in env: - raise Exception('Environment variable "%s" ' - 'required to be set to valid path' % required) - return env + envvars_to_save = ( + "goma_.*", # TODO(scottmg): This is ugly, but needed for goma. + "include", + "lib", + "libpath", + "path", + "pathext", + "systemroot", + "temp", + "tmp", + ) + env = {} + # This occasionally happens and leads to misleading SYSTEMROOT error messages + # if not caught here. + if output_of_set.count("=") == 0: + raise Exception("Invalid output_of_set. Value is:\n%s" % output_of_set) + for line in output_of_set.splitlines(): + for envvar in envvars_to_save: + if re.match(envvar + "=", line.lower()): + var, setting = line.split("=", 1) + if envvar == "path": + # Our own rules (for running gyp-win-tool) and other actions in + # Chromium rely on python being in the path. Add the path to this + # python here so that if it's not in the path when ninja is run + # later, python will still be found. + setting = os.path.dirname(sys.executable) + os.pathsep + setting + env[var.upper()] = setting + break + for required in ("SYSTEMROOT", "TEMP", "TMP"): + if required not in env: + raise Exception( + 'Environment variable "%s" ' + "required to be set to valid path" % required + ) + return env + def _FormatAsEnvironmentBlock(envvar_dict): - """Format as an 'environment block' directly suitable for CreateProcess. + """Format as an 'environment block' directly suitable for CreateProcess. Briefly this is a list of key=value\0, terminated by an additional \0. See CreateProcess documentation for more details.""" - block = '' - nul = '\0' - for key, value in envvar_dict.items(): - block += key + '=' + value + nul - block += nul - return block + block = "" + nul = "\0" + for key, value in envvar_dict.items(): + block += key + "=" + value + nul + block += nul + return block + def _ExtractCLPath(output_of_where): - """Gets the path to cl.exe based on the output of calling the environment + """Gets the path to cl.exe based on the output of calling the environment setup batch file, followed by the equivalent of `where`.""" - # Take the first line, as that's the first found in the PATH. - for line in output_of_where.strip().splitlines(): - if line.startswith('LOC:'): - return line[len('LOC:'):].strip() - -def GenerateEnvironmentFiles(toplevel_build_dir, generator_flags, - system_includes, open_out): - """It's not sufficient to have the absolute path to the compiler, linker, + # Take the first line, as that's the first found in the PATH. + for line in output_of_where.strip().splitlines(): + if line.startswith("LOC:"): + return line[len("LOC:") :].strip() + + +def GenerateEnvironmentFiles( + toplevel_build_dir, generator_flags, system_includes, open_out +): + """It's not sufficient to have the absolute path to the compiler, linker, etc. on Windows, as those tools rely on .dlls being in the PATH. We also need to support both x86 and x64 compilers within the same build (to support msvs_target_platform hackery). Different architectures require a different @@ -1027,78 +1176,86 @@ def GenerateEnvironmentFiles(toplevel_build_dir, generator_flags, meet your requirement (e.g. for custom toolchains), you can pass "-G ninja_use_custom_environment_files" to the gyp to suppress file generation and use custom environment files prepared by yourself.""" - archs = ('x86', 'x64') - if generator_flags.get('ninja_use_custom_environment_files', 0): + archs = ("x86", "x64") + if generator_flags.get("ninja_use_custom_environment_files", 0): + cl_paths = {} + for arch in archs: + cl_paths[arch] = "cl.exe" + return cl_paths + vs = GetVSVersion(generator_flags) cl_paths = {} for arch in archs: - cl_paths[arch] = 'cl.exe' + # Extract environment variables for subprocesses. + args = vs.SetupScript(arch) + args.extend(("&&", "set")) + popen = subprocess.Popen( + args, shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT + ) + variables, _ = popen.communicate() + if PY3: + variables = variables.decode("utf-8") + if popen.returncode != 0: + raise Exception('"%s" failed with error %d' % (args, popen.returncode)) + env = _ExtractImportantEnvironment(variables) + + # Inject system includes from gyp files into INCLUDE. + if system_includes: + system_includes = system_includes | OrderedSet( + env.get("INCLUDE", "").split(";") + ) + env["INCLUDE"] = ";".join(system_includes) + + env_block = _FormatAsEnvironmentBlock(env) + f = open_out(os.path.join(toplevel_build_dir, "environment." + arch), "w") + f.write(env_block) + f.close() + + # Find cl.exe location for this architecture. + args = vs.SetupScript(arch) + args.extend( + ("&&", "for", "%i", "in", "(cl.exe)", "do", "@echo", "LOC:%~$PATH:i") + ) + popen = subprocess.Popen(args, shell=True, stdout=subprocess.PIPE) + output, _ = popen.communicate() + if PY3: + output = output.decode("utf-8") + cl_paths[arch] = _ExtractCLPath(output) return cl_paths - vs = GetVSVersion(generator_flags) - cl_paths = {} - for arch in archs: - # Extract environment variables for subprocesses. - args = vs.SetupScript(arch) - args.extend(('&&', 'set')) - popen = subprocess.Popen( - args, shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) - variables, _ = popen.communicate() - if PY3: - variables = variables.decode('utf-8') - env = _ExtractImportantEnvironment(variables) - - # Inject system includes from gyp files into INCLUDE. - if system_includes: - system_includes = system_includes | OrderedSet( - env.get('INCLUDE', '').split(';')) - env['INCLUDE'] = ';'.join(system_includes) - - env_block = _FormatAsEnvironmentBlock(env) - f = open_out(os.path.join(toplevel_build_dir, 'environment.' + arch), 'wb') - f.write(env_block) - f.close() - - # Find cl.exe location for this architecture. - args = vs.SetupScript(arch) - args.extend(('&&', - 'for', '%i', 'in', '(cl.exe)', 'do', '@echo', 'LOC:%~$PATH:i')) - popen = subprocess.Popen(args, shell=True, stdout=subprocess.PIPE) - output, _ = popen.communicate() - if PY3: - output = output.decode('utf-8') - cl_paths[arch] = _ExtractCLPath(output) - return cl_paths + def VerifyMissingSources(sources, build_dir, generator_flags, gyp_to_ninja): - """Emulate behavior of msvs_error_on_missing_sources present in the msvs + """Emulate behavior of msvs_error_on_missing_sources present in the msvs generator: Check that all regular source files, i.e. not created at run time, exist on disk. Missing files cause needless recompilation when building via VS, and we want this check to match for people/bots that build using ninja, so they're not surprised when the VS build fails.""" - if int(generator_flags.get('msvs_error_on_missing_sources', 0)): - no_specials = filter(lambda x: '$' not in x, sources) - relative = [os.path.join(build_dir, gyp_to_ninja(s)) for s in no_specials] - missing = filter(lambda x: not os.path.exists(x), relative) - if missing: - # They'll look like out\Release\..\..\stuff\things.cc, so normalize the - # path for a slightly less crazy looking output. - cleaned_up = [os.path.normpath(x) for x in missing] - raise Exception('Missing input files:\n%s' % '\n'.join(cleaned_up)) + if int(generator_flags.get("msvs_error_on_missing_sources", 0)): + no_specials = filter(lambda x: "$" not in x, sources) + relative = [os.path.join(build_dir, gyp_to_ninja(s)) for s in no_specials] + missing = [x for x in relative if not os.path.exists(x)] + if missing: + # They'll look like out\Release\..\..\stuff\things.cc, so normalize the + # path for a slightly less crazy looking output. + cleaned_up = [os.path.normpath(x) for x in missing] + raise Exception("Missing input files:\n%s" % "\n".join(cleaned_up)) + # Sets some values in default_variables, which are required for many # generators, run on Windows. def CalculateCommonVariables(default_variables, params): - generator_flags = params.get('generator_flags', {}) - - # Set a variable so conditions can be based on msvs_version. - msvs_version = gyp.msvs_emulation.GetVSVersion(generator_flags) - default_variables['MSVS_VERSION'] = msvs_version.ShortName() - - # To determine processor word size on Windows, in addition to checking - # PROCESSOR_ARCHITECTURE (which reflects the word size of the current - # process), it is also necessary to check PROCESSOR_ARCHITEW6432 (which - # contains the actual word size of the system when running thru WOW64). - if ('64' in os.environ.get('PROCESSOR_ARCHITECTURE', '') or - '64' in os.environ.get('PROCESSOR_ARCHITEW6432', '')): - default_variables['MSVS_OS_BITS'] = 64 - else: - default_variables['MSVS_OS_BITS'] = 32 + generator_flags = params.get("generator_flags", {}) + + # Set a variable so conditions can be based on msvs_version. + msvs_version = gyp.msvs_emulation.GetVSVersion(generator_flags) + default_variables["MSVS_VERSION"] = msvs_version.ShortName() + + # To determine processor word size on Windows, in addition to checking + # PROCESSOR_ARCHITECTURE (which reflects the word size of the current + # process), it is also necessary to check PROCESSOR_ARCHITEW6432 (which + # contains the actual word size of the system when running thru WOW64). + if "64" in os.environ.get("PROCESSOR_ARCHITECTURE", "") or "64" in os.environ.get( + "PROCESSOR_ARCHITEW6432", "" + ): + default_variables["MSVS_OS_BITS"] = 64 + else: + default_variables["MSVS_OS_BITS"] = 32 diff --git a/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/ninja_syntax.py b/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/ninja_syntax.py index d2948f06c08e36..14212358082a62 100644 --- a/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/ninja_syntax.py +++ b/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/ninja_syntax.py @@ -10,10 +10,11 @@ """ import textwrap -import re + def escape_path(word): - return word.replace('$ ','$$ ').replace(' ','$ ').replace(':', '$:') + return word.replace("$ ", "$$ ").replace(" ", "$ ").replace(":", "$:") + class Writer(object): def __init__(self, output, width=78): @@ -21,47 +22,58 @@ def __init__(self, output, width=78): self.width = width def newline(self): - self.output.write('\n') + self.output.write("\n") def comment(self, text): for line in textwrap.wrap(text, self.width - 2): - self.output.write('# ' + line + '\n') + self.output.write("# " + line + "\n") def variable(self, key, value, indent=0): if value is None: return if isinstance(value, list): - value = ' '.join(filter(None, value)) # Filter out empty strings. - self._line('%s = %s' % (key, value), indent) + value = " ".join(filter(None, value)) # Filter out empty strings. + self._line("%s = %s" % (key, value), indent) def pool(self, name, depth): - self._line('pool %s' % name) - self.variable('depth', depth, indent=1) - - def rule(self, name, command, description=None, depfile=None, - generator=False, pool=None, restat=False, rspfile=None, - rspfile_content=None, deps=None): - self._line('rule %s' % name) - self.variable('command', command, indent=1) + self._line("pool %s" % name) + self.variable("depth", depth, indent=1) + + def rule( + self, + name, + command, + description=None, + depfile=None, + generator=False, + pool=None, + restat=False, + rspfile=None, + rspfile_content=None, + deps=None, + ): + self._line("rule %s" % name) + self.variable("command", command, indent=1) if description: - self.variable('description', description, indent=1) + self.variable("description", description, indent=1) if depfile: - self.variable('depfile', depfile, indent=1) + self.variable("depfile", depfile, indent=1) if generator: - self.variable('generator', '1', indent=1) + self.variable("generator", "1", indent=1) if pool: - self.variable('pool', pool, indent=1) + self.variable("pool", pool, indent=1) if restat: - self.variable('restat', '1', indent=1) + self.variable("restat", "1", indent=1) if rspfile: - self.variable('rspfile', rspfile, indent=1) + self.variable("rspfile", rspfile, indent=1) if rspfile_content: - self.variable('rspfile_content', rspfile_content, indent=1) + self.variable("rspfile_content", rspfile_content, indent=1) if deps: - self.variable('deps', deps, indent=1) + self.variable("deps", deps, indent=1) - def build(self, outputs, rule, inputs=None, implicit=None, order_only=None, - variables=None): + def build( + self, outputs, rule, inputs=None, implicit=None, order_only=None, variables=None + ): outputs = self._as_list(outputs) all_inputs = self._as_list(inputs)[:] out_outputs = list(map(escape_path, outputs)) @@ -69,15 +81,16 @@ def build(self, outputs, rule, inputs=None, implicit=None, order_only=None, if implicit: implicit = map(escape_path, self._as_list(implicit)) - all_inputs.append('|') + all_inputs.append("|") all_inputs.extend(implicit) if order_only: order_only = map(escape_path, self._as_list(order_only)) - all_inputs.append('||') + all_inputs.append("||") all_inputs.extend(order_only) - self._line('build %s: %s' % (' '.join(out_outputs), - ' '.join([rule] + all_inputs))) + self._line( + "build %s: %s" % (" ".join(out_outputs), " ".join([rule] + all_inputs)) + ) if variables: if isinstance(variables, dict): @@ -91,58 +104,59 @@ def build(self, outputs, rule, inputs=None, implicit=None, order_only=None, return outputs def include(self, path): - self._line('include %s' % path) + self._line("include %s" % path) def subninja(self, path): - self._line('subninja %s' % path) + self._line("subninja %s" % path) def default(self, paths): - self._line('default %s' % ' '.join(self._as_list(paths))) + self._line("default %s" % " ".join(self._as_list(paths))) def _count_dollars_before_index(self, s, i): - """Returns the number of '$' characters right in front of s[i].""" - dollar_count = 0 - dollar_index = i - 1 - while dollar_index > 0 and s[dollar_index] == '$': - dollar_count += 1 - dollar_index -= 1 - return dollar_count + """Returns the number of '$' characters right in front of s[i].""" + dollar_count = 0 + dollar_index = i - 1 + while dollar_index > 0 and s[dollar_index] == "$": + dollar_count += 1 + dollar_index -= 1 + return dollar_count def _line(self, text, indent=0): """Write 'text' word-wrapped at self.width characters.""" - leading_space = ' ' * indent + leading_space = " " * indent while len(leading_space) + len(text) > self.width: # The text is too wide; wrap if possible. # Find the rightmost space that would obey our width constraint and # that's not an escaped space. - available_space = self.width - len(leading_space) - len(' $') + available_space = self.width - len(leading_space) - len(" $") space = available_space while True: - space = text.rfind(' ', 0, space) - if space < 0 or \ - self._count_dollars_before_index(text, space) % 2 == 0: - break + space = text.rfind(" ", 0, space) + if space < 0 or self._count_dollars_before_index(text, space) % 2 == 0: + break if space < 0: # No such space; just use the first unescaped space we can find. space = available_space - 1 while True: - space = text.find(' ', space + 1) - if space < 0 or \ - self._count_dollars_before_index(text, space) % 2 == 0: - break + space = text.find(" ", space + 1) + if ( + space < 0 + or self._count_dollars_before_index(text, space) % 2 == 0 + ): + break if space < 0: # Give up on breaking. break - self.output.write(leading_space + text[0:space] + ' $\n') - text = text[space+1:] + self.output.write(leading_space + text[0:space] + " $\n") + text = text[space + 1 :] # Subsequent lines are continuations, so indent them. - leading_space = ' ' * (indent+2) + leading_space = " " * (indent + 2) - self.output.write(leading_space + text + '\n') + self.output.write(leading_space + text + "\n") def _as_list(self, input): if input is None: @@ -155,6 +169,6 @@ def _as_list(self, input): def escape(string): """Escape a string such that it can be embedded into a Ninja file without further interpretation.""" - assert '\n' not in string, 'Ninja syntax does not allow newlines' + assert "\n" not in string, "Ninja syntax does not allow newlines" # We only have one special metacharacter: '$'. - return string.replace('$', '$$') + return string.replace("$", "$$") diff --git a/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/simple_copy.py b/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/simple_copy.py index 94a6f17dab5d1c..e01106f9c4821a 100644 --- a/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/simple_copy.py +++ b/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/simple_copy.py @@ -7,44 +7,58 @@ because gyp copies so large structure that small copy overhead ends up taking seconds in a project the size of Chromium.""" + class Error(Exception): - pass + pass + __all__ = ["Error", "deepcopy"] + def deepcopy(x): - """Deep copy operation on gyp objects such as strings, ints, dicts + """Deep copy operation on gyp objects such as strings, ints, dicts and lists. More than twice as fast as copy.deepcopy but much less generic.""" - try: - return _deepcopy_dispatch[type(x)](x) - except KeyError: - raise Error('Unsupported type %s for deepcopy. Use copy.deepcopy ' + - 'or expand simple_copy support.' % type(x)) + try: + return _deepcopy_dispatch[type(x)](x) + except KeyError: + raise Error( + "Unsupported type %s for deepcopy. Use copy.deepcopy " + + "or expand simple_copy support." % type(x) + ) + _deepcopy_dispatch = d = {} + def _deepcopy_atomic(x): - return x + return x + try: - types = bool, float, int, str, type, type(None), long, unicode + types = bool, float, int, str, type, type(None), long, unicode except NameError: # Python 3 - types = bool, float, int, str, type, type(None) + types = bool, float, int, str, type, type(None) for x in types: - d[x] = _deepcopy_atomic + d[x] = _deepcopy_atomic + def _deepcopy_list(x): - return [deepcopy(a) for a in x] + return [deepcopy(a) for a in x] + + d[list] = _deepcopy_list + def _deepcopy_dict(x): - y = {} - for key, value in x.items(): - y[deepcopy(key)] = deepcopy(value) - return y + y = {} + for key, value in x.items(): + y[deepcopy(key)] = deepcopy(value) + return y + + d[dict] = _deepcopy_dict del d diff --git a/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/win_tool.py b/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/win_tool.py index 0a6daf203931e6..758e9f5c456221 100755 --- a/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/win_tool.py +++ b/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/win_tool.py @@ -24,304 +24,362 @@ # A regex matching an argument corresponding to the output filename passed to # link.exe. -_LINK_EXE_OUT_ARG = re.compile('/OUT:(?P.+)$', re.IGNORECASE) +_LINK_EXE_OUT_ARG = re.compile("/OUT:(?P.+)$", re.IGNORECASE) + def main(args): - executor = WinTool() - exit_code = executor.Dispatch(args) - if exit_code is not None: - sys.exit(exit_code) + executor = WinTool() + exit_code = executor.Dispatch(args) + if exit_code is not None: + sys.exit(exit_code) class WinTool(object): - """This class performs all the Windows tooling steps. The methods can either + """This class performs all the Windows tooling steps. The methods can either be executed directly, or dispatched from an argument list.""" - def _UseSeparateMspdbsrv(self, env, args): - """Allows to use a unique instance of mspdbsrv.exe per linker instead of a + def _UseSeparateMspdbsrv(self, env, args): + """Allows to use a unique instance of mspdbsrv.exe per linker instead of a shared one.""" - if len(args) < 1: - raise Exception("Not enough arguments") - - if args[0] != 'link.exe': - return - - # Use the output filename passed to the linker to generate an endpoint name - # for mspdbsrv.exe. - endpoint_name = None - for arg in args: - m = _LINK_EXE_OUT_ARG.match(arg) - if m: - endpoint_name = re.sub(r'\W+', '', - '%s_%d' % (m.group('out'), os.getpid())) - break - - if endpoint_name is None: - return - - # Adds the appropriate environment variable. This will be read by link.exe - # to know which instance of mspdbsrv.exe it should connect to (if it's - # not set then the default endpoint is used). - env['_MSPDBSRV_ENDPOINT_'] = endpoint_name - - def Dispatch(self, args): - """Dispatches a string command to a method.""" - if len(args) < 1: - raise Exception("Not enough arguments") - - method = "Exec%s" % self._CommandifyName(args[0]) - return getattr(self, method)(*args[1:]) - - def _CommandifyName(self, name_string): - """Transforms a tool name like recursive-mirror to RecursiveMirror.""" - return name_string.title().replace('-', '') - - def _GetEnv(self, arch): - """Gets the saved environment from a file for a given architecture.""" - # The environment is saved as an "environment block" (see CreateProcess - # and msvs_emulation for details). We convert to a dict here. - # Drop last 2 NULs, one for list terminator, one for trailing vs. separator. - pairs = open(arch).read()[:-2].split('\0') - kvs = [item.split('=', 1) for item in pairs] - return dict(kvs) - - def ExecStamp(self, path): - """Simple stamp command.""" - open(path, 'w').close() - - def ExecRecursiveMirror(self, source, dest): - """Emulation of rm -rf out && cp -af in out.""" - if os.path.exists(dest): - if os.path.isdir(dest): - def _on_error(fn, path, excinfo): - # The operation failed, possibly because the file is set to - # read-only. If that's why, make it writable and try the op again. - if not os.access(path, os.W_OK): - os.chmod(path, stat.S_IWRITE) - fn(path) - shutil.rmtree(dest, onerror=_on_error) - else: - if not os.access(dest, os.W_OK): - # Attempt to make the file writable before deleting it. - os.chmod(dest, stat.S_IWRITE) - os.unlink(dest) - - if os.path.isdir(source): - shutil.copytree(source, dest) - else: - shutil.copy2(source, dest) - - def ExecLinkWrapper(self, arch, use_separate_mspdbsrv, *args): - """Filter diagnostic output from link that looks like: + if len(args) < 1: + raise Exception("Not enough arguments") + + if args[0] != "link.exe": + return + + # Use the output filename passed to the linker to generate an endpoint name + # for mspdbsrv.exe. + endpoint_name = None + for arg in args: + m = _LINK_EXE_OUT_ARG.match(arg) + if m: + endpoint_name = re.sub( + r"\W+", "", "%s_%d" % (m.group("out"), os.getpid()) + ) + break + + if endpoint_name is None: + return + + # Adds the appropriate environment variable. This will be read by link.exe + # to know which instance of mspdbsrv.exe it should connect to (if it's + # not set then the default endpoint is used). + env["_MSPDBSRV_ENDPOINT_"] = endpoint_name + + def Dispatch(self, args): + """Dispatches a string command to a method.""" + if len(args) < 1: + raise Exception("Not enough arguments") + + method = "Exec%s" % self._CommandifyName(args[0]) + return getattr(self, method)(*args[1:]) + + def _CommandifyName(self, name_string): + """Transforms a tool name like recursive-mirror to RecursiveMirror.""" + return name_string.title().replace("-", "") + + def _GetEnv(self, arch): + """Gets the saved environment from a file for a given architecture.""" + # The environment is saved as an "environment block" (see CreateProcess + # and msvs_emulation for details). We convert to a dict here. + # Drop last 2 NULs, one for list terminator, one for trailing vs. separator. + pairs = open(arch).read()[:-2].split("\0") + kvs = [item.split("=", 1) for item in pairs] + return dict(kvs) + + def ExecStamp(self, path): + """Simple stamp command.""" + open(path, "w").close() + + def ExecRecursiveMirror(self, source, dest): + """Emulation of rm -rf out && cp -af in out.""" + if os.path.exists(dest): + if os.path.isdir(dest): + + def _on_error(fn, path, excinfo): + # The operation failed, possibly because the file is set to + # read-only. If that's why, make it writable and try the op again. + if not os.access(path, os.W_OK): + os.chmod(path, stat.S_IWRITE) + fn(path) + + shutil.rmtree(dest, onerror=_on_error) + else: + if not os.access(dest, os.W_OK): + # Attempt to make the file writable before deleting it. + os.chmod(dest, stat.S_IWRITE) + os.unlink(dest) + + if os.path.isdir(source): + shutil.copytree(source, dest) + else: + shutil.copy2(source, dest) + + def ExecLinkWrapper(self, arch, use_separate_mspdbsrv, *args): + """Filter diagnostic output from link that looks like: ' Creating library ui.dll.lib and object ui.dll.exp' This happens when there are exports from the dll or exe. """ - env = self._GetEnv(arch) - if use_separate_mspdbsrv == 'True': - self._UseSeparateMspdbsrv(env, args) - link = subprocess.Popen([args[0].replace('/', '\\')] + list(args[1:]), - shell=True, - env=env, - stdout=subprocess.PIPE, - stderr=subprocess.STDOUT) - out, _ = link.communicate() - if PY3: - out = out.decode('utf-8') - for line in out.splitlines(): - if (not line.startswith(' Creating library ') and - not line.startswith('Generating code') and - not line.startswith('Finished generating code')): - print(line) - return link.returncode - - def ExecLinkWithManifests(self, arch, embed_manifest, out, ldcmd, resname, - mt, rc, intermediate_manifest, *manifests): - """A wrapper for handling creating a manifest resource and then executing + env = self._GetEnv(arch) + if use_separate_mspdbsrv == "True": + self._UseSeparateMspdbsrv(env, args) + if sys.platform == "win32": + args = list(args) # *args is a tuple by default, which is read-only. + args[0] = args[0].replace("/", "\\") + # https://docs.python.org/2/library/subprocess.html: + # "On Unix with shell=True [...] if args is a sequence, the first item + # specifies the command string, and any additional items will be treated as + # additional arguments to the shell itself. That is to say, Popen does the + # equivalent of: + # Popen(['/bin/sh', '-c', args[0], args[1], ...])" + # For that reason, since going through the shell doesn't seem necessary on + # non-Windows don't do that there. + link = subprocess.Popen( + args, + shell=sys.platform == "win32", + env=env, + stdout=subprocess.PIPE, + stderr=subprocess.STDOUT, + ) + out, _ = link.communicate() + if PY3: + out = out.decode("utf-8") + for line in out.splitlines(): + if ( + not line.startswith(" Creating library ") + and not line.startswith("Generating code") + and not line.startswith("Finished generating code") + ): + print(line) + return link.returncode + + def ExecLinkWithManifests( + self, + arch, + embed_manifest, + out, + ldcmd, + resname, + mt, + rc, + intermediate_manifest, + *manifests + ): + """A wrapper for handling creating a manifest resource and then executing a link command.""" - # The 'normal' way to do manifests is to have link generate a manifest - # based on gathering dependencies from the object files, then merge that - # manifest with other manifests supplied as sources, convert the merged - # manifest to a resource, and then *relink*, including the compiled - # version of the manifest resource. This breaks incremental linking, and - # is generally overly complicated. Instead, we merge all the manifests - # provided (along with one that includes what would normally be in the - # linker-generated one, see msvs_emulation.py), and include that into the - # first and only link. We still tell link to generate a manifest, but we - # only use that to assert that our simpler process did not miss anything. - variables = { - 'python': sys.executable, - 'arch': arch, - 'out': out, - 'ldcmd': ldcmd, - 'resname': resname, - 'mt': mt, - 'rc': rc, - 'intermediate_manifest': intermediate_manifest, - 'manifests': ' '.join(manifests), - } - add_to_ld = '' - if manifests: - subprocess.check_call( - '%(python)s gyp-win-tool manifest-wrapper %(arch)s %(mt)s -nologo ' - '-manifest %(manifests)s -out:%(out)s.manifest' % variables) - if embed_manifest == 'True': - subprocess.check_call( - '%(python)s gyp-win-tool manifest-to-rc %(arch)s %(out)s.manifest' - ' %(out)s.manifest.rc %(resname)s' % variables) - subprocess.check_call( - '%(python)s gyp-win-tool rc-wrapper %(arch)s %(rc)s ' - '%(out)s.manifest.rc' % variables) - add_to_ld = ' %(out)s.manifest.res' % variables - subprocess.check_call(ldcmd + add_to_ld) - - # Run mt.exe on the theoretically complete manifest we generated, merging - # it with the one the linker generated to confirm that the linker - # generated one does not add anything. This is strictly unnecessary for - # correctness, it's only to verify that e.g. /MANIFESTDEPENDENCY was not - # used in a #pragma comment. - if manifests: - # Merge the intermediate one with ours to .assert.manifest, then check - # that .assert.manifest is identical to ours. - subprocess.check_call( - '%(python)s gyp-win-tool manifest-wrapper %(arch)s %(mt)s -nologo ' - '-manifest %(out)s.manifest %(intermediate_manifest)s ' - '-out:%(out)s.assert.manifest' % variables) - assert_manifest = '%(out)s.assert.manifest' % variables - our_manifest = '%(out)s.manifest' % variables - # Load and normalize the manifests. mt.exe sometimes removes whitespace, - # and sometimes doesn't unfortunately. - with open(our_manifest, 'rb') as our_f: - with open(assert_manifest, 'rb') as assert_f: - our_data = our_f.read().translate(None, string.whitespace) - assert_data = assert_f.read().translate(None, string.whitespace) - if our_data != assert_data: - os.unlink(out) - def dump(filename): - sys.stderr.write('%s\n-----\n' % filename) - with open(filename, 'rb') as f: - sys.stderr.write(f.read() + '\n-----\n') - dump(intermediate_manifest) - dump(our_manifest) - dump(assert_manifest) - sys.stderr.write( - 'Linker generated manifest "%s" added to final manifest "%s" ' - '(result in "%s"). ' - 'Were /MANIFEST switches used in #pragma statements? ' % ( - intermediate_manifest, our_manifest, assert_manifest)) - return 1 - - def ExecManifestWrapper(self, arch, *args): - """Run manifest tool with environment set. Strip out undesirable warning + # The 'normal' way to do manifests is to have link generate a manifest + # based on gathering dependencies from the object files, then merge that + # manifest with other manifests supplied as sources, convert the merged + # manifest to a resource, and then *relink*, including the compiled + # version of the manifest resource. This breaks incremental linking, and + # is generally overly complicated. Instead, we merge all the manifests + # provided (along with one that includes what would normally be in the + # linker-generated one, see msvs_emulation.py), and include that into the + # first and only link. We still tell link to generate a manifest, but we + # only use that to assert that our simpler process did not miss anything. + variables = { + "python": sys.executable, + "arch": arch, + "out": out, + "ldcmd": ldcmd, + "resname": resname, + "mt": mt, + "rc": rc, + "intermediate_manifest": intermediate_manifest, + "manifests": " ".join(manifests), + } + add_to_ld = "" + if manifests: + subprocess.check_call( + "%(python)s gyp-win-tool manifest-wrapper %(arch)s %(mt)s -nologo " + "-manifest %(manifests)s -out:%(out)s.manifest" % variables + ) + if embed_manifest == "True": + subprocess.check_call( + "%(python)s gyp-win-tool manifest-to-rc %(arch)s %(out)s.manifest" + " %(out)s.manifest.rc %(resname)s" % variables + ) + subprocess.check_call( + "%(python)s gyp-win-tool rc-wrapper %(arch)s %(rc)s " + "%(out)s.manifest.rc" % variables + ) + add_to_ld = " %(out)s.manifest.res" % variables + subprocess.check_call(ldcmd + add_to_ld) + + # Run mt.exe on the theoretically complete manifest we generated, merging + # it with the one the linker generated to confirm that the linker + # generated one does not add anything. This is strictly unnecessary for + # correctness, it's only to verify that e.g. /MANIFESTDEPENDENCY was not + # used in a #pragma comment. + if manifests: + # Merge the intermediate one with ours to .assert.manifest, then check + # that .assert.manifest is identical to ours. + subprocess.check_call( + "%(python)s gyp-win-tool manifest-wrapper %(arch)s %(mt)s -nologo " + "-manifest %(out)s.manifest %(intermediate_manifest)s " + "-out:%(out)s.assert.manifest" % variables + ) + assert_manifest = "%(out)s.assert.manifest" % variables + our_manifest = "%(out)s.manifest" % variables + # Load and normalize the manifests. mt.exe sometimes removes whitespace, + # and sometimes doesn't unfortunately. + with open(our_manifest, "r") as our_f: + with open(assert_manifest, "r") as assert_f: + our_data = our_f.read().translate(None, string.whitespace) + assert_data = assert_f.read().translate(None, string.whitespace) + if our_data != assert_data: + os.unlink(out) + + def dump(filename): + print(filename, file=sys.stderr) + print("-----", file=sys.stderr) + with open(filename, "r") as f: + print(f.read(), file=sys.stderr) + print("-----", file=sys.stderr) + + dump(intermediate_manifest) + dump(our_manifest) + dump(assert_manifest) + sys.stderr.write( + 'Linker generated manifest "%s" added to final manifest "%s" ' + '(result in "%s"). ' + "Were /MANIFEST switches used in #pragma statements? " + % (intermediate_manifest, our_manifest, assert_manifest) + ) + return 1 + + def ExecManifestWrapper(self, arch, *args): + """Run manifest tool with environment set. Strip out undesirable warning (some XML blocks are recognized by the OS loader, but not the manifest tool).""" - env = self._GetEnv(arch) - popen = subprocess.Popen(args, shell=True, env=env, - stdout=subprocess.PIPE, stderr=subprocess.STDOUT) - out, _ = popen.communicate() - if PY3: - out = out.decode('utf-8') - for line in out.splitlines(): - if line and 'manifest authoring warning 81010002' not in line: - print(line) - return popen.returncode - - def ExecManifestToRc(self, arch, *args): - """Creates a resource file pointing a SxS assembly manifest. + env = self._GetEnv(arch) + popen = subprocess.Popen( + args, shell=True, env=env, stdout=subprocess.PIPE, stderr=subprocess.STDOUT + ) + out, _ = popen.communicate() + if PY3: + out = out.decode("utf-8") + for line in out.splitlines(): + if line and "manifest authoring warning 81010002" not in line: + print(line) + return popen.returncode + + def ExecManifestToRc(self, arch, *args): + """Creates a resource file pointing a SxS assembly manifest. |args| is tuple containing path to resource file, path to manifest file and resource name which can be "1" (for executables) or "2" (for DLLs).""" - manifest_path, resource_path, resource_name = args - with open(resource_path, 'wb') as output: - output.write('#include \n%s RT_MANIFEST "%s"' % ( - resource_name, - os.path.abspath(manifest_path).replace('\\', '/'))) - - def ExecMidlWrapper(self, arch, outdir, tlb, h, dlldata, iid, proxy, idl, - *flags): - """Filter noisy filenames output from MIDL compile step that isn't + manifest_path, resource_path, resource_name = args + with open(resource_path, "w") as output: + output.write( + '#include \n%s RT_MANIFEST "%s"' + % (resource_name, os.path.abspath(manifest_path).replace("\\", "/")) + ) + + def ExecMidlWrapper(self, arch, outdir, tlb, h, dlldata, iid, proxy, idl, *flags): + """Filter noisy filenames output from MIDL compile step that isn't quietable via command line flags. """ - args = ['midl', '/nologo'] + list(flags) + [ - '/out', outdir, - '/tlb', tlb, - '/h', h, - '/dlldata', dlldata, - '/iid', iid, - '/proxy', proxy, - idl] - env = self._GetEnv(arch) - popen = subprocess.Popen(args, shell=True, env=env, - stdout=subprocess.PIPE, stderr=subprocess.STDOUT) - out, _ = popen.communicate() - if PY3: - out = out.decode('utf-8') - # Filter junk out of stdout, and write filtered versions. Output we want - # to filter is pairs of lines that look like this: - # Processing C:\Program Files (x86)\Microsoft SDKs\...\include\objidl.idl - # objidl.idl - lines = out.splitlines() - prefixes = ('Processing ', '64 bit Processing ') - processing = set(os.path.basename(x) - for x in lines if x.startswith(prefixes)) - for line in lines: - if not line.startswith(prefixes) and line not in processing: - print(line) - return popen.returncode - - def ExecAsmWrapper(self, arch, *args): - """Filter logo banner from invocations of asm.exe.""" - env = self._GetEnv(arch) - popen = subprocess.Popen(args, shell=True, env=env, - stdout=subprocess.PIPE, stderr=subprocess.STDOUT) - out, _ = popen.communicate() - if PY3: - out = out.decode('utf-8') - for line in out.splitlines(): - if (not line.startswith('Copyright (C) Microsoft Corporation') and - not line.startswith('Microsoft (R) Macro Assembler') and - not line.startswith(' Assembling: ') and - line): - print(line) - return popen.returncode - - def ExecRcWrapper(self, arch, *args): - """Filter logo banner from invocations of rc.exe. Older versions of RC + args = ( + ["midl", "/nologo"] + + list(flags) + + [ + "/out", + outdir, + "/tlb", + tlb, + "/h", + h, + "/dlldata", + dlldata, + "/iid", + iid, + "/proxy", + proxy, + idl, + ] + ) + env = self._GetEnv(arch) + popen = subprocess.Popen( + args, shell=True, env=env, stdout=subprocess.PIPE, stderr=subprocess.STDOUT + ) + out, _ = popen.communicate() + if PY3: + out = out.decode("utf-8") + # Filter junk out of stdout, and write filtered versions. Output we want + # to filter is pairs of lines that look like this: + # Processing C:\Program Files (x86)\Microsoft SDKs\...\include\objidl.idl + # objidl.idl + lines = out.splitlines() + prefixes = ("Processing ", "64 bit Processing ") + processing = set(os.path.basename(x) for x in lines if x.startswith(prefixes)) + for line in lines: + if not line.startswith(prefixes) and line not in processing: + print(line) + return popen.returncode + + def ExecAsmWrapper(self, arch, *args): + """Filter logo banner from invocations of asm.exe.""" + env = self._GetEnv(arch) + popen = subprocess.Popen( + args, shell=True, env=env, stdout=subprocess.PIPE, stderr=subprocess.STDOUT + ) + out, _ = popen.communicate() + if PY3: + out = out.decode("utf-8") + for line in out.splitlines(): + if ( + not line.startswith("Copyright (C) Microsoft Corporation") + and not line.startswith("Microsoft (R) Macro Assembler") + and not line.startswith(" Assembling: ") + and line + ): + print(line) + return popen.returncode + + def ExecRcWrapper(self, arch, *args): + """Filter logo banner from invocations of rc.exe. Older versions of RC don't support the /nologo flag.""" - env = self._GetEnv(arch) - popen = subprocess.Popen(args, shell=True, env=env, - stdout=subprocess.PIPE, stderr=subprocess.STDOUT) - out, _ = popen.communicate() - if PY3: - out = out.decode('utf-8') - for line in out.splitlines(): - if (not line.startswith('Microsoft (R) Windows (R) Resource Compiler') and - not line.startswith('Copyright (C) Microsoft Corporation') and - line): - print(line) - return popen.returncode - - def ExecActionWrapper(self, arch, rspfile, *dir): - """Runs an action command line from a response file using the environment + env = self._GetEnv(arch) + popen = subprocess.Popen( + args, shell=True, env=env, stdout=subprocess.PIPE, stderr=subprocess.STDOUT + ) + out, _ = popen.communicate() + if PY3: + out = out.decode("utf-8") + for line in out.splitlines(): + if ( + not line.startswith("Microsoft (R) Windows (R) Resource Compiler") + and not line.startswith("Copyright (C) Microsoft Corporation") + and line + ): + print(line) + return popen.returncode + + def ExecActionWrapper(self, arch, rspfile, *dir): + """Runs an action command line from a response file using the environment for |arch|. If |dir| is supplied, use that as the working directory.""" - env = self._GetEnv(arch) - # TODO(scottmg): This is a temporary hack to get some specific variables - # through to actions that are set after gyp-time. http://crbug.com/333738. - for k, v in os.environ.items(): - if k not in env: - env[k] = v - args = open(rspfile).read() - dir = dir[0] if dir else None - return subprocess.call(args, shell=True, env=env, cwd=dir) - - def ExecClCompile(self, project_dir, selected_files): - """Executed by msvs-ninja projects when the 'ClCompile' target is used to + env = self._GetEnv(arch) + # TODO(scottmg): This is a temporary hack to get some specific variables + # through to actions that are set after gyp-time. http://crbug.com/333738. + for k, v in os.environ.items(): + if k not in env: + env[k] = v + args = open(rspfile).read() + dir = dir[0] if dir else None + return subprocess.call(args, shell=True, env=env, cwd=dir) + + def ExecClCompile(self, project_dir, selected_files): + """Executed by msvs-ninja projects when the 'ClCompile' target is used to build selected C/C++ files.""" - project_dir = os.path.relpath(project_dir, BASE_DIR) - selected_files = selected_files.split(';') - ninja_targets = [os.path.join(project_dir, filename) + '^^' - for filename in selected_files] - cmd = ['ninja.exe'] - cmd.extend(ninja_targets) - return subprocess.call(cmd, shell=True, cwd=BASE_DIR) - -if __name__ == '__main__': - sys.exit(main(sys.argv[1:])) + project_dir = os.path.relpath(project_dir, BASE_DIR) + selected_files = selected_files.split(";") + ninja_targets = [ + os.path.join(project_dir, filename) + "^^" for filename in selected_files + ] + cmd = ["ninja.exe"] + cmd.extend(ninja_targets) + return subprocess.call(cmd, shell=True, cwd=BASE_DIR) + + +if __name__ == "__main__": + sys.exit(main(sys.argv[1:])) diff --git a/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/xcode_emulation.py b/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/xcode_emulation.py index 60171649900aae..42a4ce47ed3410 100644 --- a/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/xcode_emulation.py +++ b/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/xcode_emulation.py @@ -17,7 +17,6 @@ import shlex import subprocess import sys -import tempfile from gyp.common import GypError PY3 = bytes != str @@ -33,71 +32,72 @@ def XcodeArchsVariableMapping(archs, archs_including_64_bit=None): - """Constructs a dictionary with expansion for $(ARCHS_STANDARD) variable, + """Constructs a dictionary with expansion for $(ARCHS_STANDARD) variable, and optionally for $(ARCHS_STANDARD_INCLUDING_64_BIT).""" - mapping = {'$(ARCHS_STANDARD)': archs} - if archs_including_64_bit: - mapping['$(ARCHS_STANDARD_INCLUDING_64_BIT)'] = archs_including_64_bit - return mapping + mapping = {"$(ARCHS_STANDARD)": archs} + if archs_including_64_bit: + mapping["$(ARCHS_STANDARD_INCLUDING_64_BIT)"] = archs_including_64_bit + return mapping + class XcodeArchsDefault(object): - """A class to resolve ARCHS variable from xcode_settings, resolving Xcode + """A class to resolve ARCHS variable from xcode_settings, resolving Xcode macros and implementing filtering by VALID_ARCHS. The expansion of macros depends on the SDKROOT used ("macosx", "iphoneos", "iphonesimulator") and on the version of Xcode. """ - # Match variable like $(ARCHS_STANDARD). - variable_pattern = re.compile(r'\$\([a-zA-Z_][a-zA-Z0-9_]*\)$') + # Match variable like $(ARCHS_STANDARD). + variable_pattern = re.compile(r"\$\([a-zA-Z_][a-zA-Z0-9_]*\)$") - def __init__(self, default, mac, iphonesimulator, iphoneos): - self._default = (default,) - self._archs = {'mac': mac, 'ios': iphoneos, 'iossim': iphonesimulator} + def __init__(self, default, mac, iphonesimulator, iphoneos): + self._default = (default,) + self._archs = {"mac": mac, "ios": iphoneos, "iossim": iphonesimulator} - def _VariableMapping(self, sdkroot): - """Returns the dictionary of variable mapping depending on the SDKROOT.""" - sdkroot = sdkroot.lower() - if 'iphoneos' in sdkroot: - return self._archs['ios'] - elif 'iphonesimulator' in sdkroot: - return self._archs['iossim'] - else: - return self._archs['mac'] - - def _ExpandArchs(self, archs, sdkroot): - """Expands variables references in ARCHS, and remove duplicates.""" - variable_mapping = self._VariableMapping(sdkroot) - expanded_archs = [] - for arch in archs: - if self.variable_pattern.match(arch): - variable = arch - try: - variable_expansion = variable_mapping[variable] - for arch in variable_expansion: - if arch not in expanded_archs: - expanded_archs.append(arch) - except KeyError as e: - print('Warning: Ignoring unsupported variable "%s".' % variable) - elif arch not in expanded_archs: - expanded_archs.append(arch) - return expanded_archs - - def ActiveArchs(self, archs, valid_archs, sdkroot): - """Expands variables references in ARCHS, and filter by VALID_ARCHS if it + def _VariableMapping(self, sdkroot): + """Returns the dictionary of variable mapping depending on the SDKROOT.""" + sdkroot = sdkroot.lower() + if "iphoneos" in sdkroot: + return self._archs["ios"] + elif "iphonesimulator" in sdkroot: + return self._archs["iossim"] + else: + return self._archs["mac"] + + def _ExpandArchs(self, archs, sdkroot): + """Expands variables references in ARCHS, and remove duplicates.""" + variable_mapping = self._VariableMapping(sdkroot) + expanded_archs = [] + for arch in archs: + if self.variable_pattern.match(arch): + variable = arch + try: + variable_expansion = variable_mapping[variable] + for arch in variable_expansion: + if arch not in expanded_archs: + expanded_archs.append(arch) + except KeyError: + print('Warning: Ignoring unsupported variable "%s".' % variable) + elif arch not in expanded_archs: + expanded_archs.append(arch) + return expanded_archs + + def ActiveArchs(self, archs, valid_archs, sdkroot): + """Expands variables references in ARCHS, and filter by VALID_ARCHS if it is defined (if not set, Xcode accept any value in ARCHS, otherwise, only values present in VALID_ARCHS are kept).""" - expanded_archs = self._ExpandArchs(archs or self._default, sdkroot or '') - if valid_archs: - filtered_archs = [] - for arch in expanded_archs: - if arch in valid_archs: - filtered_archs.append(arch) - expanded_archs = filtered_archs - return expanded_archs + expanded_archs = self._ExpandArchs(archs or self._default, sdkroot or "") + if valid_archs: + filtered_archs = [] + for arch in expanded_archs: + if arch in valid_archs: + filtered_archs.append(arch) + expanded_archs = filtered_archs + return expanded_archs def GetXcodeArchsDefault(): - """Returns the |XcodeArchsDefault| object to use to expand ARCHS for the + """Returns the |XcodeArchsDefault| object to use to expand ARCHS for the installed version of Xcode. The default values used by Xcode for ARCHS and the expansion of the variables depends on the version of Xcode used. @@ -116,664 +116,786 @@ def GetXcodeArchsDefault(): All thoses rules are coded in the construction of the |XcodeArchsDefault| object to use depending on the version of Xcode detected. The object is for performance reason.""" - global XCODE_ARCHS_DEFAULT_CACHE - if XCODE_ARCHS_DEFAULT_CACHE: + global XCODE_ARCHS_DEFAULT_CACHE + if XCODE_ARCHS_DEFAULT_CACHE: + return XCODE_ARCHS_DEFAULT_CACHE + xcode_version, _ = XcodeVersion() + if xcode_version < "0500": + XCODE_ARCHS_DEFAULT_CACHE = XcodeArchsDefault( + "$(ARCHS_STANDARD)", + XcodeArchsVariableMapping(["i386"]), + XcodeArchsVariableMapping(["i386"]), + XcodeArchsVariableMapping(["armv7"]), + ) + elif xcode_version < "0510": + XCODE_ARCHS_DEFAULT_CACHE = XcodeArchsDefault( + "$(ARCHS_STANDARD_INCLUDING_64_BIT)", + XcodeArchsVariableMapping(["x86_64"], ["x86_64"]), + XcodeArchsVariableMapping(["i386"], ["i386", "x86_64"]), + XcodeArchsVariableMapping( + ["armv7", "armv7s"], ["armv7", "armv7s", "arm64"] + ), + ) + else: + XCODE_ARCHS_DEFAULT_CACHE = XcodeArchsDefault( + "$(ARCHS_STANDARD)", + XcodeArchsVariableMapping(["x86_64"], ["x86_64"]), + XcodeArchsVariableMapping(["i386", "x86_64"], ["i386", "x86_64"]), + XcodeArchsVariableMapping( + ["armv7", "armv7s", "arm64"], ["armv7", "armv7s", "arm64"] + ), + ) return XCODE_ARCHS_DEFAULT_CACHE - xcode_version, _ = XcodeVersion() - if xcode_version < '0500': - XCODE_ARCHS_DEFAULT_CACHE = XcodeArchsDefault( - '$(ARCHS_STANDARD)', - XcodeArchsVariableMapping(['i386']), - XcodeArchsVariableMapping(['i386']), - XcodeArchsVariableMapping(['armv7'])) - elif xcode_version < '0510': - XCODE_ARCHS_DEFAULT_CACHE = XcodeArchsDefault( - '$(ARCHS_STANDARD_INCLUDING_64_BIT)', - XcodeArchsVariableMapping(['x86_64'], ['x86_64']), - XcodeArchsVariableMapping(['i386'], ['i386', 'x86_64']), - XcodeArchsVariableMapping( - ['armv7', 'armv7s'], - ['armv7', 'armv7s', 'arm64'])) - else: - XCODE_ARCHS_DEFAULT_CACHE = XcodeArchsDefault( - '$(ARCHS_STANDARD)', - XcodeArchsVariableMapping(['x86_64'], ['x86_64']), - XcodeArchsVariableMapping(['i386', 'x86_64'], ['i386', 'x86_64']), - XcodeArchsVariableMapping( - ['armv7', 'armv7s', 'arm64'], - ['armv7', 'armv7s', 'arm64'])) - return XCODE_ARCHS_DEFAULT_CACHE class XcodeSettings(object): - """A class that understands the gyp 'xcode_settings' object.""" - - # Populated lazily by _SdkPath(). Shared by all XcodeSettings, so cached - # at class-level for efficiency. - _sdk_path_cache = {} - _sdk_root_cache = {} - - # Populated lazily by GetExtraPlistItems(). Shared by all XcodeSettings, so - # cached at class-level for efficiency. - _plist_cache = {} - - # Populated lazily by GetIOSPostbuilds. Shared by all XcodeSettings, so - # cached at class-level for efficiency. - _codesigning_key_cache = {} - - def __init__(self, spec): - self.spec = spec - - self.isIOS = False - - # Per-target 'xcode_settings' are pushed down into configs earlier by gyp. - # This means self.xcode_settings[config] always contains all settings - # for that config -- the per-target settings as well. Settings that are - # the same for all configs are implicitly per-target settings. - self.xcode_settings = {} - configs = spec['configurations'] - for configname, config in configs.items(): - self.xcode_settings[configname] = config.get('xcode_settings', {}) - self._ConvertConditionalKeys(configname) - if self.xcode_settings[configname].get('IPHONEOS_DEPLOYMENT_TARGET', - None): - self.isIOS = True - - # This is only non-None temporarily during the execution of some methods. - self.configname = None - - # Used by _AdjustLibrary to match .a and .dylib entries in libraries. - self.library_re = re.compile(r'^lib([^/]+)\.(a|dylib)$') - - def _ConvertConditionalKeys(self, configname): - """Converts or warns on conditional keys. Xcode supports conditional keys, + """A class that understands the gyp 'xcode_settings' object.""" + + # Populated lazily by _SdkPath(). Shared by all XcodeSettings, so cached + # at class-level for efficiency. + _sdk_path_cache = {} + _platform_path_cache = {} + _sdk_root_cache = {} + + # Populated lazily by GetExtraPlistItems(). Shared by all XcodeSettings, so + # cached at class-level for efficiency. + _plist_cache = {} + + # Populated lazily by GetIOSPostbuilds. Shared by all XcodeSettings, so + # cached at class-level for efficiency. + _codesigning_key_cache = {} + + def __init__(self, spec): + self.spec = spec + + self.isIOS = False + self.mac_toolchain_dir = None + self.header_map_path = None + + # Per-target 'xcode_settings' are pushed down into configs earlier by gyp. + # This means self.xcode_settings[config] always contains all settings + # for that config -- the per-target settings as well. Settings that are + # the same for all configs are implicitly per-target settings. + self.xcode_settings = {} + configs = spec["configurations"] + for configname, config in configs.items(): + self.xcode_settings[configname] = config.get("xcode_settings", {}) + self._ConvertConditionalKeys(configname) + if self.xcode_settings[configname].get("IPHONEOS_DEPLOYMENT_TARGET", None): + self.isIOS = True + + # This is only non-None temporarily during the execution of some methods. + self.configname = None + + # Used by _AdjustLibrary to match .a and .dylib entries in libraries. + self.library_re = re.compile(r"^lib([^/]+)\.(a|dylib)$") + + def _ConvertConditionalKeys(self, configname): + """Converts or warns on conditional keys. Xcode supports conditional keys, such as CODE_SIGN_IDENTITY[sdk=iphoneos*]. This is a partial implementation with some keys converted while the rest force a warning.""" - settings = self.xcode_settings[configname] - conditional_keys = [key for key in settings if key.endswith(']')] - for key in conditional_keys: - # If you need more, speak up at http://crbug.com/122592 - if key.endswith("[sdk=iphoneos*]"): - if configname.endswith("iphoneos"): - new_key = key.split("[")[0] - settings[new_key] = settings[key] - else: - print('Warning: Conditional keys not implemented, ignoring:', \ - ' '.join(conditional_keys)) - del settings[key] - - def _Settings(self): - assert self.configname - return self.xcode_settings[self.configname] - - def _Test(self, test_key, cond_key, default): - return self._Settings().get(test_key, default) == cond_key - - def _Appendf(self, lst, test_key, format_str, default=None): - if test_key in self._Settings(): - lst.append(format_str % str(self._Settings()[test_key])) - elif default: - lst.append(format_str % str(default)) - - def _WarnUnimplemented(self, test_key): - if test_key in self._Settings(): - print('Warning: Ignoring not yet implemented key "%s".' % test_key) - - def IsBinaryOutputFormat(self, configname): - default = "binary" if self.isIOS else "xml" - format = self.xcode_settings[configname].get('INFOPLIST_OUTPUT_FORMAT', - default) - return format == "binary" - - def _IsBundle(self): - return int(self.spec.get('mac_bundle', 0)) != 0 - - def _IsIosAppExtension(self): - return int(self.spec.get('ios_app_extension', 0)) != 0 - - def _IsIosWatchKitExtension(self): - return int(self.spec.get('ios_watchkit_extension', 0)) != 0 - - def _IsIosWatchApp(self): - return int(self.spec.get('ios_watch_app', 0)) != 0 - - def _IsXCTest(self): - return int(self.spec.get('mac_xctest_bundle', 0)) != 0 - - def GetFrameworkVersion(self): - """Returns the framework version of the current target. Only valid for + settings = self.xcode_settings[configname] + conditional_keys = [key for key in settings if key.endswith("]")] + for key in conditional_keys: + # If you need more, speak up at http://crbug.com/122592 + if key.endswith("[sdk=iphoneos*]"): + if configname.endswith("iphoneos"): + new_key = key.split("[")[0] + settings[new_key] = settings[key] + else: + print( + "Warning: Conditional keys not implemented, ignoring:", + " ".join(conditional_keys), + ) + del settings[key] + + def _Settings(self): + assert self.configname + return self.xcode_settings[self.configname] + + def _Test(self, test_key, cond_key, default): + return self._Settings().get(test_key, default) == cond_key + + def _Appendf(self, lst, test_key, format_str, default=None): + if test_key in self._Settings(): + lst.append(format_str % str(self._Settings()[test_key])) + elif default: + lst.append(format_str % str(default)) + + def _WarnUnimplemented(self, test_key): + if test_key in self._Settings(): + print('Warning: Ignoring not yet implemented key "%s".' % test_key) + + def IsBinaryOutputFormat(self, configname): + default = "binary" if self.isIOS else "xml" + format = self.xcode_settings[configname].get("INFOPLIST_OUTPUT_FORMAT", default) + return format == "binary" + + def IsIosFramework(self): + return self.spec["type"] == "shared_library" and self._IsBundle() and self.isIOS + + def _IsBundle(self): + return ( + int(self.spec.get("mac_bundle", 0)) != 0 + or self._IsXCTest() + or self._IsXCUiTest() + ) + + def _IsXCTest(self): + return int(self.spec.get("mac_xctest_bundle", 0)) != 0 + + def _IsXCUiTest(self): + return int(self.spec.get("mac_xcuitest_bundle", 0)) != 0 + + def _IsIosAppExtension(self): + return int(self.spec.get("ios_app_extension", 0)) != 0 + + def _IsIosWatchKitExtension(self): + return int(self.spec.get("ios_watchkit_extension", 0)) != 0 + + def _IsIosWatchApp(self): + return int(self.spec.get("ios_watch_app", 0)) != 0 + + def GetFrameworkVersion(self): + """Returns the framework version of the current target. Only valid for bundles.""" - assert self._IsBundle() - return self.GetPerTargetSetting('FRAMEWORK_VERSION', default='A') + assert self._IsBundle() + return self.GetPerTargetSetting("FRAMEWORK_VERSION", default="A") - def GetWrapperExtension(self): - """Returns the bundle extension (.app, .framework, .plugin, etc). Only + def GetWrapperExtension(self): + """Returns the bundle extension (.app, .framework, .plugin, etc). Only valid for bundles.""" - assert self._IsBundle() - if self.spec['type'] in ('loadable_module', 'shared_library'): - default_wrapper_extension = { - 'loadable_module': 'bundle', - 'shared_library': 'framework', - }[self.spec['type']] - wrapper_extension = self.GetPerTargetSetting( - 'WRAPPER_EXTENSION', default=default_wrapper_extension) - return '.' + self.spec.get('product_extension', wrapper_extension) - elif self.spec['type'] == 'executable': - if self._IsIosAppExtension() or self._IsIosWatchKitExtension(): - return '.' + self.spec.get('product_extension', 'appex') - else: - return '.' + self.spec.get('product_extension', 'app') - else: - assert False, "Don't know extension for '%s', target '%s'" % ( - self.spec['type'], self.spec['target_name']) - - def GetProductName(self): - """Returns PRODUCT_NAME.""" - return self.spec.get('product_name', self.spec['target_name']) - - def GetFullProductName(self): - """Returns FULL_PRODUCT_NAME.""" - if self._IsBundle(): - return self.GetWrapperName() - else: - return self._GetStandaloneBinaryPath() + assert self._IsBundle() + if self.spec["type"] in ("loadable_module", "shared_library"): + default_wrapper_extension = { + "loadable_module": "bundle", + "shared_library": "framework", + }[self.spec["type"]] + wrapper_extension = self.GetPerTargetSetting( + "WRAPPER_EXTENSION", default=default_wrapper_extension + ) + return "." + self.spec.get("product_extension", wrapper_extension) + elif self.spec["type"] == "executable": + if self._IsIosAppExtension() or self._IsIosWatchKitExtension(): + return "." + self.spec.get("product_extension", "appex") + else: + return "." + self.spec.get("product_extension", "app") + else: + assert False, "Don't know extension for '%s', target '%s'" % ( + self.spec["type"], + self.spec["target_name"], + ) + + def GetProductName(self): + """Returns PRODUCT_NAME.""" + return self.spec.get("product_name", self.spec["target_name"]) + + def GetFullProductName(self): + """Returns FULL_PRODUCT_NAME.""" + if self._IsBundle(): + return self.GetWrapperName() + else: + return self._GetStandaloneBinaryPath() - def GetWrapperName(self): - """Returns the directory name of the bundle represented by this target. + def GetWrapperName(self): + """Returns the directory name of the bundle represented by this target. Only valid for bundles.""" - assert self._IsBundle() - return self.GetProductName() + self.GetWrapperExtension() + assert self._IsBundle() + return self.GetProductName() + self.GetWrapperExtension() - def GetBundleContentsFolderPath(self): - """Returns the qualified path to the bundle's contents folder. E.g. + def GetBundleContentsFolderPath(self): + """Returns the qualified path to the bundle's contents folder. E.g. Chromium.app/Contents or Foo.bundle/Versions/A. Only valid for bundles.""" - if self.isIOS: - return self.GetWrapperName() - assert self._IsBundle() - if self.spec['type'] == 'shared_library': - return os.path.join( - self.GetWrapperName(), 'Versions', self.GetFrameworkVersion()) - else: - # loadable_modules have a 'Contents' folder like executables. - return os.path.join(self.GetWrapperName(), 'Contents') + if self.isIOS: + return self.GetWrapperName() + assert self._IsBundle() + if self.spec["type"] == "shared_library": + return os.path.join( + self.GetWrapperName(), "Versions", self.GetFrameworkVersion() + ) + else: + # loadable_modules have a 'Contents' folder like executables. + return os.path.join(self.GetWrapperName(), "Contents") - def GetBundleResourceFolder(self): - """Returns the qualified path to the bundle's resource folder. E.g. + def GetBundleResourceFolder(self): + """Returns the qualified path to the bundle's resource folder. E.g. Chromium.app/Contents/Resources. Only valid for bundles.""" - assert self._IsBundle() - if self.isIOS: - return self.GetBundleContentsFolderPath() - return os.path.join(self.GetBundleContentsFolderPath(), 'Resources') - - def GetBundlePlistPath(self): - """Returns the qualified path to the bundle's plist file. E.g. + assert self._IsBundle() + if self.isIOS: + return self.GetBundleContentsFolderPath() + return os.path.join(self.GetBundleContentsFolderPath(), "Resources") + + def GetBundleExecutableFolderPath(self): + """Returns the qualified path to the bundle's executables folder. E.g. + Chromium.app/Contents/MacOS. Only valid for bundles.""" + assert self._IsBundle() + if self.spec["type"] in ("shared_library") or self.isIOS: + return self.GetBundleContentsFolderPath() + elif self.spec["type"] in ("executable", "loadable_module"): + return os.path.join(self.GetBundleContentsFolderPath(), "MacOS") + + def GetBundleJavaFolderPath(self): + """Returns the qualified path to the bundle's Java resource folder. + E.g. Chromium.app/Contents/Resources/Java. Only valid for bundles.""" + assert self._IsBundle() + return os.path.join(self.GetBundleResourceFolder(), "Java") + + def GetBundleFrameworksFolderPath(self): + """Returns the qualified path to the bundle's frameworks folder. E.g, + Chromium.app/Contents/Frameworks. Only valid for bundles.""" + assert self._IsBundle() + return os.path.join(self.GetBundleContentsFolderPath(), "Frameworks") + + def GetBundleSharedFrameworksFolderPath(self): + """Returns the qualified path to the bundle's frameworks folder. E.g, + Chromium.app/Contents/SharedFrameworks. Only valid for bundles.""" + assert self._IsBundle() + return os.path.join(self.GetBundleContentsFolderPath(), "SharedFrameworks") + + def GetBundleSharedSupportFolderPath(self): + """Returns the qualified path to the bundle's shared support folder. E.g, + Chromium.app/Contents/SharedSupport. Only valid for bundles.""" + assert self._IsBundle() + if self.spec["type"] == "shared_library": + return self.GetBundleResourceFolder() + else: + return os.path.join(self.GetBundleContentsFolderPath(), "SharedSupport") + + def GetBundlePlugInsFolderPath(self): + """Returns the qualified path to the bundle's plugins folder. E.g, + Chromium.app/Contents/PlugIns. Only valid for bundles.""" + assert self._IsBundle() + return os.path.join(self.GetBundleContentsFolderPath(), "PlugIns") + + def GetBundleXPCServicesFolderPath(self): + """Returns the qualified path to the bundle's XPC services folder. E.g, + Chromium.app/Contents/XPCServices. Only valid for bundles.""" + assert self._IsBundle() + return os.path.join(self.GetBundleContentsFolderPath(), "XPCServices") + + def GetBundlePlistPath(self): + """Returns the qualified path to the bundle's plist file. E.g. Chromium.app/Contents/Info.plist. Only valid for bundles.""" - assert self._IsBundle() - if self.spec['type'] in ('executable', 'loadable_module'): - return os.path.join(self.GetBundleContentsFolderPath(), 'Info.plist') - else: - return os.path.join(self.GetBundleContentsFolderPath(), - 'Resources', 'Info.plist') - - def GetProductType(self): - """Returns the PRODUCT_TYPE of this target.""" - if self._IsIosAppExtension(): - assert self._IsBundle(), ('ios_app_extension flag requires mac_bundle ' - '(target %s)' % self.spec['target_name']) - return 'com.apple.product-type.app-extension' - if self._IsIosWatchKitExtension(): - assert self._IsBundle(), ('ios_watchkit_extension flag requires ' - 'mac_bundle (target %s)' % self.spec['target_name']) - return 'com.apple.product-type.watchkit-extension' - if self._IsIosWatchApp(): - assert self._IsBundle(), ('ios_watch_app flag requires mac_bundle ' - '(target %s)' % self.spec['target_name']) - return 'com.apple.product-type.application.watchapp' - if self._IsBundle(): - return { - 'executable': 'com.apple.product-type.application', - 'loadable_module': 'com.apple.product-type.bundle', - 'shared_library': 'com.apple.product-type.framework', - }[self.spec['type']] - else: - return { - 'executable': 'com.apple.product-type.tool', - 'loadable_module': 'com.apple.product-type.library.dynamic', - 'shared_library': 'com.apple.product-type.library.dynamic', - 'static_library': 'com.apple.product-type.library.static', - }[self.spec['type']] - - def GetMachOType(self): - """Returns the MACH_O_TYPE of this target.""" - # Weird, but matches Xcode. - if not self._IsBundle() and self.spec['type'] == 'executable': - return '' - return { - 'executable': 'mh_execute', - 'static_library': 'staticlib', - 'shared_library': 'mh_dylib', - 'loadable_module': 'mh_bundle', - }[self.spec['type']] - - def _GetBundleBinaryPath(self): - """Returns the name of the bundle binary of by this target. + assert self._IsBundle() + if ( + self.spec["type"] in ("executable", "loadable_module") + or self.IsIosFramework() + ): + return os.path.join(self.GetBundleContentsFolderPath(), "Info.plist") + else: + return os.path.join( + self.GetBundleContentsFolderPath(), "Resources", "Info.plist" + ) + + def GetProductType(self): + """Returns the PRODUCT_TYPE of this target.""" + if self._IsIosAppExtension(): + assert self._IsBundle(), ( + "ios_app_extension flag requires mac_bundle " + "(target %s)" % self.spec["target_name"] + ) + return "com.apple.product-type.app-extension" + if self._IsIosWatchKitExtension(): + assert self._IsBundle(), ( + "ios_watchkit_extension flag requires " + "mac_bundle (target %s)" % self.spec["target_name"] + ) + return "com.apple.product-type.watchkit-extension" + if self._IsIosWatchApp(): + assert self._IsBundle(), ( + "ios_watch_app flag requires mac_bundle " + "(target %s)" % self.spec["target_name"] + ) + return "com.apple.product-type.application.watchapp" + if self._IsXCUiTest(): + assert self._IsBundle(), ( + "mac_xcuitest_bundle flag requires mac_bundle " + "(target %s)" % self.spec["target_name"] + ) + return "com.apple.product-type.bundle.ui-testing" + if self._IsBundle(): + return { + "executable": "com.apple.product-type.application", + "loadable_module": "com.apple.product-type.bundle", + "shared_library": "com.apple.product-type.framework", + }[self.spec["type"]] + else: + return { + "executable": "com.apple.product-type.tool", + "loadable_module": "com.apple.product-type.library.dynamic", + "shared_library": "com.apple.product-type.library.dynamic", + "static_library": "com.apple.product-type.library.static", + }[self.spec["type"]] + + def GetMachOType(self): + """Returns the MACH_O_TYPE of this target.""" + # Weird, but matches Xcode. + if not self._IsBundle() and self.spec["type"] == "executable": + return "" + return { + "executable": "mh_execute", + "static_library": "staticlib", + "shared_library": "mh_dylib", + "loadable_module": "mh_bundle", + }[self.spec["type"]] + + def _GetBundleBinaryPath(self): + """Returns the name of the bundle binary of by this target. E.g. Chromium.app/Contents/MacOS/Chromium. Only valid for bundles.""" - assert self._IsBundle() - if self.spec['type'] in ('shared_library') or self.isIOS: - path = self.GetBundleContentsFolderPath() - elif self.spec['type'] in ('executable', 'loadable_module'): - path = os.path.join(self.GetBundleContentsFolderPath(), 'MacOS') - return os.path.join(path, self.GetExecutableName()) - - def _GetStandaloneExecutableSuffix(self): - if 'product_extension' in self.spec: - return '.' + self.spec['product_extension'] - return { - 'executable': '', - 'static_library': '.a', - 'shared_library': '.dylib', - 'loadable_module': '.so', - }[self.spec['type']] - - def _GetStandaloneExecutablePrefix(self): - return self.spec.get('product_prefix', { - 'executable': '', - 'static_library': 'lib', - 'shared_library': 'lib', - # Non-bundled loadable_modules are called foo.so for some reason - # (that is, .so and no prefix) with the xcode build -- match that. - 'loadable_module': '', - }[self.spec['type']]) - - def _GetStandaloneBinaryPath(self): - """Returns the name of the non-bundle binary represented by this target. + assert self._IsBundle() + return os.path.join( + self.GetBundleExecutableFolderPath(), self.GetExecutableName() + ) + + def _GetStandaloneExecutableSuffix(self): + if "product_extension" in self.spec: + return "." + self.spec["product_extension"] + return { + "executable": "", + "static_library": ".a", + "shared_library": ".dylib", + "loadable_module": ".so", + }[self.spec["type"]] + + def _GetStandaloneExecutablePrefix(self): + return self.spec.get( + "product_prefix", + { + "executable": "", + "static_library": "lib", + "shared_library": "lib", + # Non-bundled loadable_modules are called foo.so for some reason + # (that is, .so and no prefix) with the xcode build -- match that. + "loadable_module": "", + }[self.spec["type"]], + ) + + def _GetStandaloneBinaryPath(self): + """Returns the name of the non-bundle binary represented by this target. E.g. hello_world. Only valid for non-bundles.""" - assert not self._IsBundle() - assert self.spec['type'] in ( - 'executable', 'shared_library', 'static_library', 'loadable_module'), ( - 'Unexpected type %s' % self.spec['type']) - target = self.spec['target_name'] - if self.spec['type'] == 'static_library': - if target[:3] == 'lib': - target = target[3:] - elif self.spec['type'] in ('loadable_module', 'shared_library'): - if target[:3] == 'lib': - target = target[3:] - - target_prefix = self._GetStandaloneExecutablePrefix() - target = self.spec.get('product_name', target) - target_ext = self._GetStandaloneExecutableSuffix() - return target_prefix + target + target_ext - - def GetExecutableName(self): - """Returns the executable name of the bundle represented by this target. + assert not self._IsBundle() + assert self.spec["type"] in ( + "executable", + "shared_library", + "static_library", + "loadable_module", + ), ("Unexpected type %s" % self.spec["type"]) + target = self.spec["target_name"] + if self.spec["type"] == "static_library": + if target[:3] == "lib": + target = target[3:] + elif self.spec["type"] in ("loadable_module", "shared_library"): + if target[:3] == "lib": + target = target[3:] + + target_prefix = self._GetStandaloneExecutablePrefix() + target = self.spec.get("product_name", target) + target_ext = self._GetStandaloneExecutableSuffix() + return target_prefix + target + target_ext + + def GetExecutableName(self): + """Returns the executable name of the bundle represented by this target. E.g. Chromium.""" - if self._IsBundle(): - return self.spec.get('product_name', self.spec['target_name']) - else: - return self._GetStandaloneBinaryPath() + if self._IsBundle(): + return self.spec.get("product_name", self.spec["target_name"]) + else: + return self._GetStandaloneBinaryPath() - def GetExecutablePath(self): - """Returns the directory name of the bundle represented by this target. E.g. - Chromium.app/Contents/MacOS/Chromium.""" - if self._IsBundle(): - return self._GetBundleBinaryPath() - else: - return self._GetStandaloneBinaryPath() - - def GetActiveArchs(self, configname): - """Returns the architectures this target should be built for.""" - config_settings = self.xcode_settings[configname] - xcode_archs_default = GetXcodeArchsDefault() - return xcode_archs_default.ActiveArchs( - config_settings.get('ARCHS'), - config_settings.get('VALID_ARCHS'), - config_settings.get('SDKROOT')) - - def _GetSdkVersionInfoItem(self, sdk, infoitem): - # xcodebuild requires Xcode and can't run on Command Line Tools-only - # systems from 10.7 onward. - # Since the CLT has no SDK paths anyway, returning None is the - # most sensible route and should still do the right thing. - try: - return GetStdoutQuiet(['xcodebuild', '-version', '-sdk', sdk, infoitem]) - except GypError: - pass - - def _SdkRoot(self, configname): - if configname is None: - configname = self.configname - return self.GetPerConfigSetting('SDKROOT', configname, default='') - - def _SdkPath(self, configname=None): - sdk_root = self._SdkRoot(configname) - if sdk_root.startswith('/'): - return sdk_root - return self._XcodeSdkPath(sdk_root) - - def _XcodeSdkPath(self, sdk_root): - if sdk_root not in XcodeSettings._sdk_path_cache: - sdk_path = self._GetSdkVersionInfoItem(sdk_root, 'Path') - XcodeSettings._sdk_path_cache[sdk_root] = sdk_path - if sdk_root: - XcodeSettings._sdk_root_cache[sdk_path] = sdk_root - return XcodeSettings._sdk_path_cache[sdk_root] - - def _AppendPlatformVersionMinFlags(self, lst): - self._Appendf(lst, 'MACOSX_DEPLOYMENT_TARGET', '-mmacosx-version-min=%s') - if 'IPHONEOS_DEPLOYMENT_TARGET' in self._Settings(): - # TODO: Implement this better? - sdk_path_basename = os.path.basename(self._SdkPath()) - if sdk_path_basename.lower().startswith('iphonesimulator'): - self._Appendf(lst, 'IPHONEOS_DEPLOYMENT_TARGET', - '-mios-simulator-version-min=%s') - else: - self._Appendf(lst, 'IPHONEOS_DEPLOYMENT_TARGET', - '-miphoneos-version-min=%s') - - def GetCflags(self, configname, arch=None): - """Returns flags that need to be added to .c, .cc, .m, and .mm + def GetExecutablePath(self): + """Returns the qualified path to the primary executable of the bundle + represented by this target. E.g. Chromium.app/Contents/MacOS/Chromium.""" + if self._IsBundle(): + return self._GetBundleBinaryPath() + else: + return self._GetStandaloneBinaryPath() + + def GetActiveArchs(self, configname): + """Returns the architectures this target should be built for.""" + config_settings = self.xcode_settings[configname] + xcode_archs_default = GetXcodeArchsDefault() + return xcode_archs_default.ActiveArchs( + config_settings.get("ARCHS"), + config_settings.get("VALID_ARCHS"), + config_settings.get("SDKROOT"), + ) + + def _GetSdkVersionInfoItem(self, sdk, infoitem): + # xcodebuild requires Xcode and can't run on Command Line Tools-only + # systems from 10.7 onward. + # Since the CLT has no SDK paths anyway, returning None is the + # most sensible route and should still do the right thing. + try: + return GetStdoutQuiet(["xcrun", "--sdk", sdk, infoitem]) + except GypError: + pass + + def _SdkRoot(self, configname): + if configname is None: + configname = self.configname + return self.GetPerConfigSetting("SDKROOT", configname, default="") + + def _XcodePlatformPath(self, configname=None): + sdk_root = self._SdkRoot(configname) + if sdk_root not in XcodeSettings._platform_path_cache: + platform_path = self._GetSdkVersionInfoItem( + sdk_root, "--show-sdk-platform-path" + ) + XcodeSettings._platform_path_cache[sdk_root] = platform_path + return XcodeSettings._platform_path_cache[sdk_root] + + def _SdkPath(self, configname=None): + sdk_root = self._SdkRoot(configname) + if sdk_root.startswith("/"): + return sdk_root + return self._XcodeSdkPath(sdk_root) + + def _XcodeSdkPath(self, sdk_root): + if sdk_root not in XcodeSettings._sdk_path_cache: + sdk_path = self._GetSdkVersionInfoItem(sdk_root, "--show-sdk-path") + XcodeSettings._sdk_path_cache[sdk_root] = sdk_path + if sdk_root: + XcodeSettings._sdk_root_cache[sdk_path] = sdk_root + return XcodeSettings._sdk_path_cache[sdk_root] + + def _AppendPlatformVersionMinFlags(self, lst): + self._Appendf(lst, "MACOSX_DEPLOYMENT_TARGET", "-mmacosx-version-min=%s") + if "IPHONEOS_DEPLOYMENT_TARGET" in self._Settings(): + # TODO: Implement this better? + sdk_path_basename = os.path.basename(self._SdkPath()) + if sdk_path_basename.lower().startswith("iphonesimulator"): + self._Appendf( + lst, "IPHONEOS_DEPLOYMENT_TARGET", "-mios-simulator-version-min=%s" + ) + else: + self._Appendf( + lst, "IPHONEOS_DEPLOYMENT_TARGET", "-miphoneos-version-min=%s" + ) + + def GetCflags(self, configname, arch=None): + """Returns flags that need to be added to .c, .cc, .m, and .mm compilations.""" - # This functions (and the similar ones below) do not offer complete - # emulation of all xcode_settings keys. They're implemented on demand. + # This functions (and the similar ones below) do not offer complete + # emulation of all xcode_settings keys. They're implemented on demand. - self.configname = configname - cflags = [] + self.configname = configname + cflags = [] - sdk_root = self._SdkPath() - if 'SDKROOT' in self._Settings() and sdk_root: - cflags.append('-isysroot %s' % sdk_root) + sdk_root = self._SdkPath() + if "SDKROOT" in self._Settings() and sdk_root: + cflags.append("-isysroot %s" % sdk_root) - if self._Test('CLANG_WARN_CONSTANT_CONVERSION', 'YES', default='NO'): - cflags.append('-Wconstant-conversion') + if self.header_map_path: + cflags.append("-I%s" % self.header_map_path) - if self._Test('GCC_CHAR_IS_UNSIGNED_CHAR', 'YES', default='NO'): - cflags.append('-funsigned-char') + if self._Test("CLANG_WARN_CONSTANT_CONVERSION", "YES", default="NO"): + cflags.append("-Wconstant-conversion") - if self._Test('GCC_CW_ASM_SYNTAX', 'YES', default='YES'): - cflags.append('-fasm-blocks') + if self._Test("GCC_CHAR_IS_UNSIGNED_CHAR", "YES", default="NO"): + cflags.append("-funsigned-char") - if 'GCC_DYNAMIC_NO_PIC' in self._Settings(): - if self._Settings()['GCC_DYNAMIC_NO_PIC'] == 'YES': - cflags.append('-mdynamic-no-pic') - else: - pass - # TODO: In this case, it depends on the target. xcode passes - # mdynamic-no-pic by default for executable and possibly static lib - # according to mento - - if self._Test('GCC_ENABLE_PASCAL_STRINGS', 'YES', default='YES'): - cflags.append('-mpascal-strings') - - self._Appendf(cflags, 'GCC_OPTIMIZATION_LEVEL', '-O%s', default='s') - - if self._Test('GCC_GENERATE_DEBUGGING_SYMBOLS', 'YES', default='YES'): - dbg_format = self._Settings().get('DEBUG_INFORMATION_FORMAT', 'dwarf') - if dbg_format == 'dwarf': - cflags.append('-gdwarf-2') - elif dbg_format == 'stabs': - raise NotImplementedError('stabs debug format is not supported yet.') - elif dbg_format == 'dwarf-with-dsym': - cflags.append('-gdwarf-2') - else: - raise NotImplementedError('Unknown debug format %s' % dbg_format) - - if self._Settings().get('GCC_STRICT_ALIASING') == 'YES': - cflags.append('-fstrict-aliasing') - elif self._Settings().get('GCC_STRICT_ALIASING') == 'NO': - cflags.append('-fno-strict-aliasing') - - if self._Test('GCC_SYMBOLS_PRIVATE_EXTERN', 'YES', default='NO'): - cflags.append('-fvisibility=hidden') - - if self._Test('GCC_TREAT_WARNINGS_AS_ERRORS', 'YES', default='NO'): - cflags.append('-Werror') - - if self._Test('GCC_WARN_ABOUT_MISSING_NEWLINE', 'YES', default='NO'): - cflags.append('-Wnewline-eof') - - # In Xcode, this is only activated when GCC_COMPILER_VERSION is clang or - # llvm-gcc. It also requires a fairly recent libtool, and - # if the system clang isn't used, DYLD_LIBRARY_PATH needs to contain the - # path to the libLTO.dylib that matches the used clang. - if self._Test('LLVM_LTO', 'YES', default='NO'): - cflags.append('-flto') - - self._AppendPlatformVersionMinFlags(cflags) - - # TODO: - if self._Test('COPY_PHASE_STRIP', 'YES', default='NO'): - self._WarnUnimplemented('COPY_PHASE_STRIP') - self._WarnUnimplemented('GCC_DEBUGGING_SYMBOLS') - self._WarnUnimplemented('GCC_ENABLE_OBJC_EXCEPTIONS') - - # TODO: This is exported correctly, but assigning to it is not supported. - self._WarnUnimplemented('MACH_O_TYPE') - self._WarnUnimplemented('PRODUCT_TYPE') - - if arch is not None: - archs = [arch] - else: - assert self.configname - archs = self.GetActiveArchs(self.configname) - if len(archs) != 1: - # TODO: Supporting fat binaries will be annoying. - self._WarnUnimplemented('ARCHS') - archs = ['i386'] - cflags.append('-arch ' + archs[0]) - - if archs[0] in ('i386', 'x86_64'): - if self._Test('GCC_ENABLE_SSE3_EXTENSIONS', 'YES', default='NO'): - cflags.append('-msse3') - if self._Test('GCC_ENABLE_SUPPLEMENTAL_SSE3_INSTRUCTIONS', 'YES', - default='NO'): - cflags.append('-mssse3') # Note 3rd 's'. - if self._Test('GCC_ENABLE_SSE41_EXTENSIONS', 'YES', default='NO'): - cflags.append('-msse4.1') - if self._Test('GCC_ENABLE_SSE42_EXTENSIONS', 'YES', default='NO'): - cflags.append('-msse4.2') - - cflags += self._Settings().get('WARNING_CFLAGS', []) - - if self._IsXCTest(): - platform_root = self._XcodePlatformPath(configname) - if platform_root: - cflags.append('-F' + platform_root + '/Developer/Library/Frameworks/') - - if sdk_root: - framework_root = sdk_root - else: - framework_root = '' - config = self.spec['configurations'][self.configname] - framework_dirs = config.get('mac_framework_dirs', []) - for directory in framework_dirs: - cflags.append('-F' + directory.replace('$(SDKROOT)', framework_root)) - - self.configname = None - return cflags - - def GetCflagsC(self, configname): - """Returns flags that need to be added to .c, and .m compilations.""" - self.configname = configname - cflags_c = [] - if self._Settings().get('GCC_C_LANGUAGE_STANDARD', '') == 'ansi': - cflags_c.append('-ansi') - else: - self._Appendf(cflags_c, 'GCC_C_LANGUAGE_STANDARD', '-std=%s') - cflags_c += self._Settings().get('OTHER_CFLAGS', []) - self.configname = None - return cflags_c - - def GetCflagsCC(self, configname): - """Returns flags that need to be added to .cc, and .mm compilations.""" - self.configname = configname - cflags_cc = [] - - clang_cxx_language_standard = self._Settings().get( - 'CLANG_CXX_LANGUAGE_STANDARD') - # Note: Don't make c++0x to c++11 so that c++0x can be used with older - # clangs that don't understand c++11 yet (like Xcode 4.2's). - if clang_cxx_language_standard: - cflags_cc.append('-std=%s' % clang_cxx_language_standard) - - self._Appendf(cflags_cc, 'CLANG_CXX_LIBRARY', '-stdlib=%s') - - if self._Test('GCC_ENABLE_CPP_RTTI', 'NO', default='YES'): - cflags_cc.append('-fno-rtti') - if self._Test('GCC_ENABLE_CPP_EXCEPTIONS', 'NO', default='YES'): - cflags_cc.append('-fno-exceptions') - if self._Test('GCC_INLINES_ARE_PRIVATE_EXTERN', 'YES', default='NO'): - cflags_cc.append('-fvisibility-inlines-hidden') - if self._Test('GCC_THREADSAFE_STATICS', 'NO', default='YES'): - cflags_cc.append('-fno-threadsafe-statics') - # Note: This flag is a no-op for clang, it only has an effect for gcc. - if self._Test('GCC_WARN_ABOUT_INVALID_OFFSETOF_MACRO', 'NO', default='YES'): - cflags_cc.append('-Wno-invalid-offsetof') - - other_ccflags = [] - - for flag in self._Settings().get('OTHER_CPLUSPLUSFLAGS', ['$(inherited)']): - # TODO: More general variable expansion. Missing in many other places too. - if flag in ('$inherited', '$(inherited)', '${inherited}'): - flag = '$OTHER_CFLAGS' - if flag in ('$OTHER_CFLAGS', '$(OTHER_CFLAGS)', '${OTHER_CFLAGS}'): - other_ccflags += self._Settings().get('OTHER_CFLAGS', []) - else: - other_ccflags.append(flag) - cflags_cc += other_ccflags - - self.configname = None - return cflags_cc - - def _AddObjectiveCGarbageCollectionFlags(self, flags): - gc_policy = self._Settings().get('GCC_ENABLE_OBJC_GC', 'unsupported') - if gc_policy == 'supported': - flags.append('-fobjc-gc') - elif gc_policy == 'required': - flags.append('-fobjc-gc-only') - - def _AddObjectiveCARCFlags(self, flags): - if self._Test('CLANG_ENABLE_OBJC_ARC', 'YES', default='NO'): - flags.append('-fobjc-arc') - - def _AddObjectiveCMissingPropertySynthesisFlags(self, flags): - if self._Test('CLANG_WARN_OBJC_MISSING_PROPERTY_SYNTHESIS', - 'YES', default='NO'): - flags.append('-Wobjc-missing-property-synthesis') - - def GetCflagsObjC(self, configname): - """Returns flags that need to be added to .m compilations.""" - self.configname = configname - cflags_objc = [] - self._AddObjectiveCGarbageCollectionFlags(cflags_objc) - self._AddObjectiveCARCFlags(cflags_objc) - self._AddObjectiveCMissingPropertySynthesisFlags(cflags_objc) - self.configname = None - return cflags_objc - - def GetCflagsObjCC(self, configname): - """Returns flags that need to be added to .mm compilations.""" - self.configname = configname - cflags_objcc = [] - self._AddObjectiveCGarbageCollectionFlags(cflags_objcc) - self._AddObjectiveCARCFlags(cflags_objcc) - self._AddObjectiveCMissingPropertySynthesisFlags(cflags_objcc) - if self._Test('GCC_OBJC_CALL_CXX_CDTORS', 'YES', default='NO'): - cflags_objcc.append('-fobjc-call-cxx-cdtors') - self.configname = None - return cflags_objcc - - def GetInstallNameBase(self): - """Return DYLIB_INSTALL_NAME_BASE for this target.""" - # Xcode sets this for shared_libraries, and for nonbundled loadable_modules. - if (self.spec['type'] != 'shared_library' and - (self.spec['type'] != 'loadable_module' or self._IsBundle())): - return None - install_base = self.GetPerTargetSetting( - 'DYLIB_INSTALL_NAME_BASE', - default='/Library/Frameworks' if self._IsBundle() else '/usr/local/lib') - return install_base - - def _StandardizePath(self, path): - """Do :standardizepath processing for path.""" - # I'm not quite sure what :standardizepath does. Just call normpath(), - # but don't let @executable_path/../foo collapse to foo. - if '/' in path: - prefix, rest = '', path - if path.startswith('@'): - prefix, rest = path.split('/', 1) - rest = os.path.normpath(rest) # :standardizepath - path = os.path.join(prefix, rest) - return path - - def GetInstallName(self): - """Return LD_DYLIB_INSTALL_NAME for this target.""" - # Xcode sets this for shared_libraries, and for nonbundled loadable_modules. - if (self.spec['type'] != 'shared_library' and - (self.spec['type'] != 'loadable_module' or self._IsBundle())): - return None - - default_install_name = \ - '$(DYLIB_INSTALL_NAME_BASE:standardizepath)/$(EXECUTABLE_PATH)' - install_name = self.GetPerTargetSetting( - 'LD_DYLIB_INSTALL_NAME', default=default_install_name) - - # Hardcode support for the variables used in chromium for now, to - # unblock people using the make build. - if '$' in install_name: - assert install_name in ('$(DYLIB_INSTALL_NAME_BASE:standardizepath)/' - '$(WRAPPER_NAME)/$(PRODUCT_NAME)', default_install_name), ( - 'Variables in LD_DYLIB_INSTALL_NAME are not generally supported ' - 'yet in target \'%s\' (got \'%s\')' % - (self.spec['target_name'], install_name)) - - install_name = install_name.replace( - '$(DYLIB_INSTALL_NAME_BASE:standardizepath)', - self._StandardizePath(self.GetInstallNameBase())) - if self._IsBundle(): - # These are only valid for bundles, hence the |if|. - install_name = install_name.replace( - '$(WRAPPER_NAME)', self.GetWrapperName()) - install_name = install_name.replace( - '$(PRODUCT_NAME)', self.GetProductName()) - else: - assert '$(WRAPPER_NAME)' not in install_name - assert '$(PRODUCT_NAME)' not in install_name - - install_name = install_name.replace( - '$(EXECUTABLE_PATH)', self.GetExecutablePath()) - return install_name - - def _MapLinkerFlagFilename(self, ldflag, gyp_to_build_path): - """Checks if ldflag contains a filename and if so remaps it from + if self._Test("GCC_CW_ASM_SYNTAX", "YES", default="YES"): + cflags.append("-fasm-blocks") + + if "GCC_DYNAMIC_NO_PIC" in self._Settings(): + if self._Settings()["GCC_DYNAMIC_NO_PIC"] == "YES": + cflags.append("-mdynamic-no-pic") + else: + pass + # TODO: In this case, it depends on the target. xcode passes + # mdynamic-no-pic by default for executable and possibly static lib + # according to mento + + if self._Test("GCC_ENABLE_PASCAL_STRINGS", "YES", default="YES"): + cflags.append("-mpascal-strings") + + self._Appendf(cflags, "GCC_OPTIMIZATION_LEVEL", "-O%s", default="s") + + if self._Test("GCC_GENERATE_DEBUGGING_SYMBOLS", "YES", default="YES"): + dbg_format = self._Settings().get("DEBUG_INFORMATION_FORMAT", "dwarf") + if dbg_format == "dwarf": + cflags.append("-gdwarf-2") + elif dbg_format == "stabs": + raise NotImplementedError("stabs debug format is not supported yet.") + elif dbg_format == "dwarf-with-dsym": + cflags.append("-gdwarf-2") + else: + raise NotImplementedError("Unknown debug format %s" % dbg_format) + + if self._Settings().get("GCC_STRICT_ALIASING") == "YES": + cflags.append("-fstrict-aliasing") + elif self._Settings().get("GCC_STRICT_ALIASING") == "NO": + cflags.append("-fno-strict-aliasing") + + if self._Test("GCC_SYMBOLS_PRIVATE_EXTERN", "YES", default="NO"): + cflags.append("-fvisibility=hidden") + + if self._Test("GCC_TREAT_WARNINGS_AS_ERRORS", "YES", default="NO"): + cflags.append("-Werror") + + if self._Test("GCC_WARN_ABOUT_MISSING_NEWLINE", "YES", default="NO"): + cflags.append("-Wnewline-eof") + + # In Xcode, this is only activated when GCC_COMPILER_VERSION is clang or + # llvm-gcc. It also requires a fairly recent libtool, and + # if the system clang isn't used, DYLD_LIBRARY_PATH needs to contain the + # path to the libLTO.dylib that matches the used clang. + if self._Test("LLVM_LTO", "YES", default="NO"): + cflags.append("-flto") + + self._AppendPlatformVersionMinFlags(cflags) + + # TODO: + if self._Test("COPY_PHASE_STRIP", "YES", default="NO"): + self._WarnUnimplemented("COPY_PHASE_STRIP") + self._WarnUnimplemented("GCC_DEBUGGING_SYMBOLS") + self._WarnUnimplemented("GCC_ENABLE_OBJC_EXCEPTIONS") + + # TODO: This is exported correctly, but assigning to it is not supported. + self._WarnUnimplemented("MACH_O_TYPE") + self._WarnUnimplemented("PRODUCT_TYPE") + + if arch is not None: + archs = [arch] + else: + assert self.configname + archs = self.GetActiveArchs(self.configname) + if len(archs) != 1: + # TODO: Supporting fat binaries will be annoying. + self._WarnUnimplemented("ARCHS") + archs = ["i386"] + cflags.append("-arch " + archs[0]) + + if archs[0] in ("i386", "x86_64"): + if self._Test("GCC_ENABLE_SSE3_EXTENSIONS", "YES", default="NO"): + cflags.append("-msse3") + if self._Test( + "GCC_ENABLE_SUPPLEMENTAL_SSE3_INSTRUCTIONS", "YES", default="NO" + ): + cflags.append("-mssse3") # Note 3rd 's'. + if self._Test("GCC_ENABLE_SSE41_EXTENSIONS", "YES", default="NO"): + cflags.append("-msse4.1") + if self._Test("GCC_ENABLE_SSE42_EXTENSIONS", "YES", default="NO"): + cflags.append("-msse4.2") + + cflags += self._Settings().get("WARNING_CFLAGS", []) + + if self._IsXCTest(): + platform_root = self._XcodePlatformPath(configname) + if platform_root: + cflags.append("-F" + platform_root + "/Developer/Library/Frameworks/") + + if sdk_root: + framework_root = sdk_root + else: + framework_root = "" + config = self.spec["configurations"][self.configname] + framework_dirs = config.get("mac_framework_dirs", []) + for directory in framework_dirs: + cflags.append("-F" + directory.replace("$(SDKROOT)", framework_root)) + + self.configname = None + return cflags + + def GetCflagsC(self, configname): + """Returns flags that need to be added to .c, and .m compilations.""" + self.configname = configname + cflags_c = [] + if self._Settings().get("GCC_C_LANGUAGE_STANDARD", "") == "ansi": + cflags_c.append("-ansi") + else: + self._Appendf(cflags_c, "GCC_C_LANGUAGE_STANDARD", "-std=%s") + cflags_c += self._Settings().get("OTHER_CFLAGS", []) + self.configname = None + return cflags_c + + def GetCflagsCC(self, configname): + """Returns flags that need to be added to .cc, and .mm compilations.""" + self.configname = configname + cflags_cc = [] + + clang_cxx_language_standard = self._Settings().get( + "CLANG_CXX_LANGUAGE_STANDARD" + ) + # Note: Don't make c++0x to c++11 so that c++0x can be used with older + # clangs that don't understand c++11 yet (like Xcode 4.2's). + if clang_cxx_language_standard: + cflags_cc.append("-std=%s" % clang_cxx_language_standard) + + self._Appendf(cflags_cc, "CLANG_CXX_LIBRARY", "-stdlib=%s") + + if self._Test("GCC_ENABLE_CPP_RTTI", "NO", default="YES"): + cflags_cc.append("-fno-rtti") + if self._Test("GCC_ENABLE_CPP_EXCEPTIONS", "NO", default="YES"): + cflags_cc.append("-fno-exceptions") + if self._Test("GCC_INLINES_ARE_PRIVATE_EXTERN", "YES", default="NO"): + cflags_cc.append("-fvisibility-inlines-hidden") + if self._Test("GCC_THREADSAFE_STATICS", "NO", default="YES"): + cflags_cc.append("-fno-threadsafe-statics") + # Note: This flag is a no-op for clang, it only has an effect for gcc. + if self._Test("GCC_WARN_ABOUT_INVALID_OFFSETOF_MACRO", "NO", default="YES"): + cflags_cc.append("-Wno-invalid-offsetof") + + other_ccflags = [] + + for flag in self._Settings().get("OTHER_CPLUSPLUSFLAGS", ["$(inherited)"]): + # TODO: More general variable expansion. Missing in many other places too. + if flag in ("$inherited", "$(inherited)", "${inherited}"): + flag = "$OTHER_CFLAGS" + if flag in ("$OTHER_CFLAGS", "$(OTHER_CFLAGS)", "${OTHER_CFLAGS}"): + other_ccflags += self._Settings().get("OTHER_CFLAGS", []) + else: + other_ccflags.append(flag) + cflags_cc += other_ccflags + + self.configname = None + return cflags_cc + + def _AddObjectiveCGarbageCollectionFlags(self, flags): + gc_policy = self._Settings().get("GCC_ENABLE_OBJC_GC", "unsupported") + if gc_policy == "supported": + flags.append("-fobjc-gc") + elif gc_policy == "required": + flags.append("-fobjc-gc-only") + + def _AddObjectiveCARCFlags(self, flags): + if self._Test("CLANG_ENABLE_OBJC_ARC", "YES", default="NO"): + flags.append("-fobjc-arc") + + def _AddObjectiveCMissingPropertySynthesisFlags(self, flags): + if self._Test( + "CLANG_WARN_OBJC_MISSING_PROPERTY_SYNTHESIS", "YES", default="NO" + ): + flags.append("-Wobjc-missing-property-synthesis") + + def GetCflagsObjC(self, configname): + """Returns flags that need to be added to .m compilations.""" + self.configname = configname + cflags_objc = [] + self._AddObjectiveCGarbageCollectionFlags(cflags_objc) + self._AddObjectiveCARCFlags(cflags_objc) + self._AddObjectiveCMissingPropertySynthesisFlags(cflags_objc) + self.configname = None + return cflags_objc + + def GetCflagsObjCC(self, configname): + """Returns flags that need to be added to .mm compilations.""" + self.configname = configname + cflags_objcc = [] + self._AddObjectiveCGarbageCollectionFlags(cflags_objcc) + self._AddObjectiveCARCFlags(cflags_objcc) + self._AddObjectiveCMissingPropertySynthesisFlags(cflags_objcc) + if self._Test("GCC_OBJC_CALL_CXX_CDTORS", "YES", default="NO"): + cflags_objcc.append("-fobjc-call-cxx-cdtors") + self.configname = None + return cflags_objcc + + def GetInstallNameBase(self): + """Return DYLIB_INSTALL_NAME_BASE for this target.""" + # Xcode sets this for shared_libraries, and for nonbundled loadable_modules. + if self.spec["type"] != "shared_library" and ( + self.spec["type"] != "loadable_module" or self._IsBundle() + ): + return None + install_base = self.GetPerTargetSetting( + "DYLIB_INSTALL_NAME_BASE", + default="/Library/Frameworks" if self._IsBundle() else "/usr/local/lib", + ) + return install_base + + def _StandardizePath(self, path): + """Do :standardizepath processing for path.""" + # I'm not quite sure what :standardizepath does. Just call normpath(), + # but don't let @executable_path/../foo collapse to foo. + if "/" in path: + prefix, rest = "", path + if path.startswith("@"): + prefix, rest = path.split("/", 1) + rest = os.path.normpath(rest) # :standardizepath + path = os.path.join(prefix, rest) + return path + + def GetInstallName(self): + """Return LD_DYLIB_INSTALL_NAME for this target.""" + # Xcode sets this for shared_libraries, and for nonbundled loadable_modules. + if self.spec["type"] != "shared_library" and ( + self.spec["type"] != "loadable_module" or self._IsBundle() + ): + return None + + default_install_name = ( + "$(DYLIB_INSTALL_NAME_BASE:standardizepath)/$(EXECUTABLE_PATH)" + ) + install_name = self.GetPerTargetSetting( + "LD_DYLIB_INSTALL_NAME", default=default_install_name + ) + + # Hardcode support for the variables used in chromium for now, to + # unblock people using the make build. + if "$" in install_name: + assert install_name in ( + "$(DYLIB_INSTALL_NAME_BASE:standardizepath)/" + "$(WRAPPER_NAME)/$(PRODUCT_NAME)", + default_install_name, + ), ( + "Variables in LD_DYLIB_INSTALL_NAME are not generally supported " + "yet in target '%s' (got '%s')" + % (self.spec["target_name"], install_name) + ) + + install_name = install_name.replace( + "$(DYLIB_INSTALL_NAME_BASE:standardizepath)", + self._StandardizePath(self.GetInstallNameBase()), + ) + if self._IsBundle(): + # These are only valid for bundles, hence the |if|. + install_name = install_name.replace( + "$(WRAPPER_NAME)", self.GetWrapperName() + ) + install_name = install_name.replace( + "$(PRODUCT_NAME)", self.GetProductName() + ) + else: + assert "$(WRAPPER_NAME)" not in install_name + assert "$(PRODUCT_NAME)" not in install_name + + install_name = install_name.replace( + "$(EXECUTABLE_PATH)", self.GetExecutablePath() + ) + return install_name + + def _MapLinkerFlagFilename(self, ldflag, gyp_to_build_path): + """Checks if ldflag contains a filename and if so remaps it from gyp-directory-relative to build-directory-relative.""" - # This list is expanded on demand. - # They get matched as: - # -exported_symbols_list file - # -Wl,exported_symbols_list file - # -Wl,exported_symbols_list,file - LINKER_FILE = r'(\S+)' - WORD = r'\S+' - linker_flags = [ - ['-exported_symbols_list', LINKER_FILE], # Needed for NaCl. - ['-unexported_symbols_list', LINKER_FILE], - ['-reexported_symbols_list', LINKER_FILE], - ['-sectcreate', WORD, WORD, LINKER_FILE], # Needed for remoting. - ] - for flag_pattern in linker_flags: - regex = re.compile('(?:-Wl,)?' + '[ ,]'.join(flag_pattern)) - m = regex.match(ldflag) - if m: - ldflag = ldflag[:m.start(1)] + gyp_to_build_path(m.group(1)) + \ - ldflag[m.end(1):] - # Required for ffmpeg (no idea why they don't use LIBRARY_SEARCH_PATHS, - # TODO(thakis): Update ffmpeg.gyp): - if ldflag.startswith('-L'): - ldflag = '-L' + gyp_to_build_path(ldflag[len('-L'):]) - return ldflag - - def GetLdflags(self, configname, product_dir, gyp_to_build_path, arch=None): - """Returns flags that need to be passed to the linker. + # This list is expanded on demand. + # They get matched as: + # -exported_symbols_list file + # -Wl,exported_symbols_list file + # -Wl,exported_symbols_list,file + LINKER_FILE = r"(\S+)" + WORD = r"\S+" + linker_flags = [ + ["-exported_symbols_list", LINKER_FILE], # Needed for NaCl. + ["-unexported_symbols_list", LINKER_FILE], + ["-reexported_symbols_list", LINKER_FILE], + ["-sectcreate", WORD, WORD, LINKER_FILE], # Needed for remoting. + ] + for flag_pattern in linker_flags: + regex = re.compile("(?:-Wl,)?" + "[ ,]".join(flag_pattern)) + m = regex.match(ldflag) + if m: + ldflag = ( + ldflag[: m.start(1)] + + gyp_to_build_path(m.group(1)) + + ldflag[m.end(1) :] + ) + # Required for ffmpeg (no idea why they don't use LIBRARY_SEARCH_PATHS, + # TODO(thakis): Update ffmpeg.gyp): + if ldflag.startswith("-L"): + ldflag = "-L" + gyp_to_build_path(ldflag[len("-L") :]) + return ldflag + + def GetLdflags(self, configname, product_dir, gyp_to_build_path, arch=None): + """Returns flags that need to be passed to the linker. Args: configname: The name of the configuration to get ld flags for. @@ -782,375 +904,470 @@ def GetLdflags(self, configname, product_dir, gyp_to_build_path, arch=None): gyp_to_build_path: A function that converts paths relative to the current gyp file to paths relative to the build directory. """ - self.configname = configname - ldflags = [] + self.configname = configname + ldflags = [] - # The xcode build is relative to a gyp file's directory, and OTHER_LDFLAGS - # can contain entries that depend on this. Explicitly absolutify these. - for ldflag in self._Settings().get('OTHER_LDFLAGS', []): - ldflags.append(self._MapLinkerFlagFilename(ldflag, gyp_to_build_path)) + # The xcode build is relative to a gyp file's directory, and OTHER_LDFLAGS + # can contain entries that depend on this. Explicitly absolutify these. + for ldflag in self._Settings().get("OTHER_LDFLAGS", []): + ldflags.append(self._MapLinkerFlagFilename(ldflag, gyp_to_build_path)) - if self._Test('DEAD_CODE_STRIPPING', 'YES', default='NO'): - ldflags.append('-Wl,-dead_strip') + if self._Test("DEAD_CODE_STRIPPING", "YES", default="NO"): + ldflags.append("-Wl,-dead_strip") - if self._Test('PREBINDING', 'YES', default='NO'): - ldflags.append('-Wl,-prebind') + if self._Test("PREBINDING", "YES", default="NO"): + ldflags.append("-Wl,-prebind") - self._Appendf( - ldflags, 'DYLIB_COMPATIBILITY_VERSION', '-compatibility_version %s') - self._Appendf( - ldflags, 'DYLIB_CURRENT_VERSION', '-current_version %s') + self._Appendf( + ldflags, "DYLIB_COMPATIBILITY_VERSION", "-compatibility_version %s" + ) + self._Appendf(ldflags, "DYLIB_CURRENT_VERSION", "-current_version %s") - self._AppendPlatformVersionMinFlags(ldflags) + self._AppendPlatformVersionMinFlags(ldflags) - if 'SDKROOT' in self._Settings() and self._SdkPath(): - ldflags.append('-isysroot ' + self._SdkPath()) + if "SDKROOT" in self._Settings() and self._SdkPath(): + ldflags.append("-isysroot " + self._SdkPath()) - for library_path in self._Settings().get('LIBRARY_SEARCH_PATHS', []): - ldflags.append('-L' + gyp_to_build_path(library_path)) + for library_path in self._Settings().get("LIBRARY_SEARCH_PATHS", []): + ldflags.append("-L" + gyp_to_build_path(library_path)) - if 'ORDER_FILE' in self._Settings(): - ldflags.append('-Wl,-order_file ' + - '-Wl,' + gyp_to_build_path( - self._Settings()['ORDER_FILE'])) + if "ORDER_FILE" in self._Settings(): + ldflags.append( + "-Wl,-order_file " + + "-Wl," + + gyp_to_build_path(self._Settings()["ORDER_FILE"]) + ) - if arch is not None: - archs = [arch] - else: - assert self.configname - archs = self.GetActiveArchs(self.configname) - if len(archs) != 1: - # TODO: Supporting fat binaries will be annoying. - self._WarnUnimplemented('ARCHS') - archs = ['i386'] - ldflags.append('-arch ' + archs[0]) - - # Xcode adds the product directory by default. - ldflags.append('-L' + product_dir) - - install_name = self.GetInstallName() - if install_name and self.spec['type'] != 'loadable_module': - ldflags.append('-install_name ' + install_name.replace(' ', r'\ ')) - - for rpath in self._Settings().get('LD_RUNPATH_SEARCH_PATHS', []): - ldflags.append('-Wl,-rpath,' + rpath) - - sdk_root = self._SdkPath() - if not sdk_root: - sdk_root = '' - config = self.spec['configurations'][self.configname] - framework_dirs = config.get('mac_framework_dirs', []) - for directory in framework_dirs: - ldflags.append('-F' + directory.replace('$(SDKROOT)', sdk_root)) - - if self._IsXCTest(): - platform_root = self._XcodePlatformPath(configname) - if platform_root: - ldflags.append('-F' + platform_root + '/Developer/Library/Frameworks/') - - is_extension = self._IsIosAppExtension() or self._IsIosWatchKitExtension() - if sdk_root and is_extension: - # Adds the link flags for extensions. These flags are common for all - # extensions and provide loader and main function. - # These flags reflect the compilation options used by xcode to compile - # extensions. - ldflags.append('-lpkstart') - xcode_version, _ = XcodeVersion() - if xcode_version < '0900': - ldflags.append(sdk_root + - '/System/Library/PrivateFrameworks/PlugInKit.framework/PlugInKit') - ldflags.append('-fapplication-extension') - ldflags.append('-Xlinker -rpath ' - '-Xlinker @executable_path/../../Frameworks') - - self._Appendf(ldflags, 'CLANG_CXX_LIBRARY', '-stdlib=%s') - - self.configname = None - return ldflags - - def GetLibtoolflags(self, configname): - """Returns flags that need to be passed to the static linker. + if arch is not None: + archs = [arch] + else: + assert self.configname + archs = self.GetActiveArchs(self.configname) + if len(archs) != 1: + # TODO: Supporting fat binaries will be annoying. + self._WarnUnimplemented("ARCHS") + archs = ["i386"] + ldflags.append("-arch " + archs[0]) + + # Xcode adds the product directory by default. + # Rewrite -L. to -L./ to work around http://www.openradar.me/25313838 + ldflags.append("-L" + (product_dir if product_dir != "." else "./")) + + install_name = self.GetInstallName() + if install_name and self.spec["type"] != "loadable_module": + ldflags.append("-install_name " + install_name.replace(" ", r"\ ")) + + for rpath in self._Settings().get("LD_RUNPATH_SEARCH_PATHS", []): + ldflags.append("-Wl,-rpath," + rpath) + + sdk_root = self._SdkPath() + if not sdk_root: + sdk_root = "" + config = self.spec["configurations"][self.configname] + framework_dirs = config.get("mac_framework_dirs", []) + for directory in framework_dirs: + ldflags.append("-F" + directory.replace("$(SDKROOT)", sdk_root)) + + if self._IsXCTest(): + platform_root = self._XcodePlatformPath(configname) + if sdk_root and platform_root: + ldflags.append("-F" + platform_root + "/Developer/Library/Frameworks/") + ldflags.append("-framework XCTest") + + is_extension = self._IsIosAppExtension() or self._IsIosWatchKitExtension() + if sdk_root and is_extension: + # Adds the link flags for extensions. These flags are common for all + # extensions and provide loader and main function. + # These flags reflect the compilation options used by xcode to compile + # extensions. + xcode_version, _ = XcodeVersion() + if xcode_version < "0900": + ldflags.append("-lpkstart") + ldflags.append( + sdk_root + + "/System/Library/PrivateFrameworks/PlugInKit.framework/PlugInKit" + ) + else: + ldflags.append("-e _NSExtensionMain") + ldflags.append("-fapplication-extension") + + self._Appendf(ldflags, "CLANG_CXX_LIBRARY", "-stdlib=%s") + + self.configname = None + return ldflags + + def GetLibtoolflags(self, configname): + """Returns flags that need to be passed to the static linker. Args: configname: The name of the configuration to get ld flags for. """ - self.configname = configname - libtoolflags = [] + self.configname = configname + libtoolflags = [] - for libtoolflag in self._Settings().get('OTHER_LDFLAGS', []): - libtoolflags.append(libtoolflag) - # TODO(thakis): ARCHS? + for libtoolflag in self._Settings().get("OTHER_LDFLAGS", []): + libtoolflags.append(libtoolflag) + # TODO(thakis): ARCHS? - self.configname = None - return libtoolflags + self.configname = None + return libtoolflags - def GetPerTargetSettings(self): - """Gets a list of all the per-target settings. This will only fetch keys + def GetPerTargetSettings(self): + """Gets a list of all the per-target settings. This will only fetch keys whose values are the same across all configurations.""" - first_pass = True - result = {} - for configname in sorted(self.xcode_settings.keys()): - if first_pass: - result = dict(self.xcode_settings[configname]) - first_pass = False - else: - for key, value in self.xcode_settings[configname].items(): - if key not in result: - continue - elif result[key] != value: - del result[key] - return result - - def GetPerConfigSetting(self, setting, configname, default=None): - if configname in self.xcode_settings: - return self.xcode_settings[configname].get(setting, default) - else: - return self.GetPerTargetSetting(setting, default) + first_pass = True + result = {} + for configname in sorted(self.xcode_settings.keys()): + if first_pass: + result = dict(self.xcode_settings[configname]) + first_pass = False + else: + for key, value in self.xcode_settings[configname].items(): + if key not in result: + continue + elif result[key] != value: + del result[key] + return result + + def GetPerConfigSetting(self, setting, configname, default=None): + if configname in self.xcode_settings: + return self.xcode_settings[configname].get(setting, default) + else: + return self.GetPerTargetSetting(setting, default) - def GetPerTargetSetting(self, setting, default=None): - """Tries to get xcode_settings.setting from spec. Assumes that the setting + def GetPerTargetSetting(self, setting, default=None): + """Tries to get xcode_settings.setting from spec. Assumes that the setting has the same value in all configurations and throws otherwise.""" - is_first_pass = True - result = None - for configname in sorted(self.xcode_settings.keys()): - if is_first_pass: - result = self.xcode_settings[configname].get(setting, None) - is_first_pass = False - else: - assert result == self.xcode_settings[configname].get(setting, None), ( - "Expected per-target setting for '%s', got per-config setting " - "(target %s)" % (setting, self.spec['target_name'])) - if result is None: - return default - return result - - def _GetStripPostbuilds(self, configname, output_binary, quiet): - """Returns a list of shell commands that contain the shell commands + is_first_pass = True + result = None + for configname in sorted(self.xcode_settings.keys()): + if is_first_pass: + result = self.xcode_settings[configname].get(setting, None) + is_first_pass = False + else: + assert result == self.xcode_settings[configname].get(setting, None), ( + "Expected per-target setting for '%s', got per-config setting " + "(target %s)" % (setting, self.spec["target_name"]) + ) + if result is None: + return default + return result + + def _GetStripPostbuilds(self, configname, output_binary, quiet): + """Returns a list of shell commands that contain the shell commands necessary to strip this target's binary. These should be run as postbuilds before the actual postbuilds run.""" - self.configname = configname - - result = [] - if (self._Test('DEPLOYMENT_POSTPROCESSING', 'YES', default='NO') and - self._Test('STRIP_INSTALLED_PRODUCT', 'YES', default='NO')): - - default_strip_style = 'debugging' - if self.spec['type'] == 'loadable_module' and self._IsBundle(): - default_strip_style = 'non-global' - elif self.spec['type'] == 'executable': - default_strip_style = 'all' - - strip_style = self._Settings().get('STRIP_STYLE', default_strip_style) - strip_flags = { - 'all': '', - 'non-global': '-x', - 'debugging': '-S', - }[strip_style] - - explicit_strip_flags = self._Settings().get('STRIPFLAGS', '') - if explicit_strip_flags: - strip_flags += ' ' + _NormalizeEnvVarReferences(explicit_strip_flags) - - if not quiet: - result.append('echo STRIP\\(%s\\)' % self.spec['target_name']) - result.append('strip %s %s' % (strip_flags, output_binary)) - - self.configname = None - return result - - def _GetDebugInfoPostbuilds(self, configname, output, output_binary, quiet): - """Returns a list of shell commands that contain the shell commands + self.configname = configname + + result = [] + if self._Test("DEPLOYMENT_POSTPROCESSING", "YES", default="NO") and self._Test( + "STRIP_INSTALLED_PRODUCT", "YES", default="NO" + ): + + default_strip_style = "debugging" + if ( + self.spec["type"] == "loadable_module" or self._IsIosAppExtension() + ) and self._IsBundle(): + default_strip_style = "non-global" + elif self.spec["type"] == "executable": + default_strip_style = "all" + + strip_style = self._Settings().get("STRIP_STYLE", default_strip_style) + strip_flags = {"all": "", "non-global": "-x", "debugging": "-S"}[ + strip_style + ] + + explicit_strip_flags = self._Settings().get("STRIPFLAGS", "") + if explicit_strip_flags: + strip_flags += " " + _NormalizeEnvVarReferences(explicit_strip_flags) + + if not quiet: + result.append("echo STRIP\\(%s\\)" % self.spec["target_name"]) + result.append("strip %s %s" % (strip_flags, output_binary)) + + self.configname = None + return result + + def _GetDebugInfoPostbuilds(self, configname, output, output_binary, quiet): + """Returns a list of shell commands that contain the shell commands necessary to massage this target's debug information. These should be run as postbuilds before the actual postbuilds run.""" - self.configname = configname - - # For static libraries, no dSYMs are created. - result = [] - if (self._Test('GCC_GENERATE_DEBUGGING_SYMBOLS', 'YES', default='YES') and - self._Test( - 'DEBUG_INFORMATION_FORMAT', 'dwarf-with-dsym', default='dwarf') and - self.spec['type'] != 'static_library'): - if not quiet: - result.append('echo DSYMUTIL\\(%s\\)' % self.spec['target_name']) - result.append('dsymutil %s -o %s' % (output_binary, output + '.dSYM')) - - self.configname = None - return result - - def _GetTargetPostbuilds(self, configname, output, output_binary, - quiet=False): - """Returns a list of shell commands that contain the shell commands + self.configname = configname + + # For static libraries, no dSYMs are created. + result = [] + if ( + self._Test("GCC_GENERATE_DEBUGGING_SYMBOLS", "YES", default="YES") + and self._Test( + "DEBUG_INFORMATION_FORMAT", "dwarf-with-dsym", default="dwarf" + ) + and self.spec["type"] != "static_library" + ): + if not quiet: + result.append("echo DSYMUTIL\\(%s\\)" % self.spec["target_name"]) + result.append("dsymutil %s -o %s" % (output_binary, output + ".dSYM")) + + self.configname = None + return result + + def _GetTargetPostbuilds(self, configname, output, output_binary, quiet=False): + """Returns a list of shell commands that contain the shell commands to run as postbuilds for this target, before the actual postbuilds.""" - # dSYMs need to build before stripping happens. - return ( - self._GetDebugInfoPostbuilds(configname, output, output_binary, quiet) + - self._GetStripPostbuilds(configname, output_binary, quiet)) + # dSYMs need to build before stripping happens. + return self._GetDebugInfoPostbuilds( + configname, output, output_binary, quiet + ) + self._GetStripPostbuilds(configname, output_binary, quiet) - def _GetIOSPostbuilds(self, configname, output_binary): - """Return a shell command to codesign the iOS output binary so it can + def _GetIOSPostbuilds(self, configname, output_binary): + """Return a shell command to codesign the iOS output binary so it can be deployed to a device. This should be run as the very last step of the build.""" - if not (self.isIOS and self.spec['type'] == 'executable'): - return [] - - settings = self.xcode_settings[configname] - key = self._GetIOSCodeSignIdentityKey(settings) - if not key: - return [] - - # Warn for any unimplemented signing xcode keys. - unimpl = ['OTHER_CODE_SIGN_FLAGS'] - unimpl = set(unimpl) & set(self.xcode_settings[configname].keys()) - if unimpl: - print('Warning: Some codesign keys not implemented, ignoring: %s' % ( - ', '.join(sorted(unimpl)))) - - return ['%s code-sign-bundle "%s" "%s" "%s" "%s"' % ( - os.path.join('${TARGET_BUILD_DIR}', 'gyp-mac-tool'), key, - settings.get('CODE_SIGN_RESOURCE_RULES_PATH', ''), - settings.get('CODE_SIGN_ENTITLEMENTS', ''), - settings.get('PROVISIONING_PROFILE', '')) - ] - - def _GetIOSCodeSignIdentityKey(self, settings): - identity = settings.get('CODE_SIGN_IDENTITY') - if not identity: - return None - if identity not in XcodeSettings._codesigning_key_cache: - output = subprocess.check_output( - ['security', 'find-identity', '-p', 'codesigning', '-v']) - for line in output.splitlines(): - if identity in line: - fingerprint = line.split()[1] - cache = XcodeSettings._codesigning_key_cache - assert identity not in cache or fingerprint == cache[identity], ( - "Multiple codesigning fingerprints for identity: %s" % identity) - XcodeSettings._codesigning_key_cache[identity] = fingerprint - return XcodeSettings._codesigning_key_cache.get(identity, '') - - def AddImplicitPostbuilds(self, configname, output, output_binary, - postbuilds=[], quiet=False): - """Returns a list of shell commands that should run before and after + if not ( + self.isIOS + and (self.spec["type"] == "executable" or self._IsXCTest()) + or self.IsIosFramework() + ): + return [] + + postbuilds = [] + product_name = self.GetFullProductName() + settings = self.xcode_settings[configname] + + # Xcode expects XCTests to be copied into the TEST_HOST dir. + if self._IsXCTest(): + source = os.path.join("${BUILT_PRODUCTS_DIR}", product_name) + test_host = os.path.dirname(settings.get("TEST_HOST")) + xctest_destination = os.path.join(test_host, "PlugIns", product_name) + postbuilds.extend(["ditto %s %s" % (source, xctest_destination)]) + + key = self._GetIOSCodeSignIdentityKey(settings) + if not key: + return postbuilds + + # Warn for any unimplemented signing xcode keys. + unimpl = ["OTHER_CODE_SIGN_FLAGS"] + unimpl = set(unimpl) & set(self.xcode_settings[configname].keys()) + if unimpl: + print( + "Warning: Some codesign keys not implemented, ignoring: %s" + % ", ".join(sorted(unimpl)) + ) + + if self._IsXCTest(): + # For device xctests, Xcode copies two extra frameworks into $TEST_HOST. + test_host = os.path.dirname(settings.get("TEST_HOST")) + frameworks_dir = os.path.join(test_host, "Frameworks") + platform_root = self._XcodePlatformPath(configname) + frameworks = [ + "Developer/Library/PrivateFrameworks/IDEBundleInjection.framework", + "Developer/Library/Frameworks/XCTest.framework", + ] + for framework in frameworks: + source = os.path.join(platform_root, framework) + destination = os.path.join(frameworks_dir, os.path.basename(framework)) + postbuilds.extend(["ditto %s %s" % (source, destination)]) + + # Then re-sign everything with 'preserve=True' + postbuilds.extend( + [ + '%s code-sign-bundle "%s" "%s" "%s" "%s" %s' + % ( + os.path.join("${TARGET_BUILD_DIR}", "gyp-mac-tool"), + key, + settings.get("CODE_SIGN_ENTITLEMENTS", ""), + settings.get("PROVISIONING_PROFILE", ""), + destination, + True, + ) + ] + ) + plugin_dir = os.path.join(test_host, "PlugIns") + targets = [os.path.join(plugin_dir, product_name), test_host] + for target in targets: + postbuilds.extend( + [ + '%s code-sign-bundle "%s" "%s" "%s" "%s" %s' + % ( + os.path.join("${TARGET_BUILD_DIR}", "gyp-mac-tool"), + key, + settings.get("CODE_SIGN_ENTITLEMENTS", ""), + settings.get("PROVISIONING_PROFILE", ""), + target, + True, + ) + ] + ) + + postbuilds.extend( + [ + '%s code-sign-bundle "%s" "%s" "%s" "%s" %s' + % ( + os.path.join("${TARGET_BUILD_DIR}", "gyp-mac-tool"), + key, + settings.get("CODE_SIGN_ENTITLEMENTS", ""), + settings.get("PROVISIONING_PROFILE", ""), + os.path.join("${BUILT_PRODUCTS_DIR}", product_name), + False, + ) + ] + ) + return postbuilds + + def _GetIOSCodeSignIdentityKey(self, settings): + identity = settings.get("CODE_SIGN_IDENTITY") + if not identity: + return None + if identity not in XcodeSettings._codesigning_key_cache: + output = subprocess.check_output( + ["security", "find-identity", "-p", "codesigning", "-v"] + ) + for line in output.splitlines(): + if identity in line: + fingerprint = line.split()[1] + cache = XcodeSettings._codesigning_key_cache + assert identity not in cache or fingerprint == cache[identity], ( + "Multiple codesigning fingerprints for identity: %s" % identity + ) + XcodeSettings._codesigning_key_cache[identity] = fingerprint + return XcodeSettings._codesigning_key_cache.get(identity, "") + + def AddImplicitPostbuilds( + self, configname, output, output_binary, postbuilds=[], quiet=False + ): + """Returns a list of shell commands that should run before and after |postbuilds|.""" - assert output_binary is not None - pre = self._GetTargetPostbuilds(configname, output, output_binary, quiet) - post = self._GetIOSPostbuilds(configname, output_binary) - return pre + postbuilds + post - - def _AdjustLibrary(self, library, config_name=None): - if library.endswith('.framework'): - l = '-framework ' + os.path.splitext(os.path.basename(library))[0] - else: - m = self.library_re.match(library) - if m: - l = '-l' + m.group(1) - else: - l = library - - sdk_root = self._SdkPath(config_name) - if not sdk_root: - sdk_root = '' - # Xcode 7 started shipping with ".tbd" (text based stubs) files instead of - # ".dylib" without providing a real support for them. What it does, for - # "/usr/lib" libraries, is do "-L/usr/lib -lname" which is dependent on the - # library order and cause collision when building Chrome. - # - # Instead substitute ".tbd" to ".dylib" in the generated project when the - # following conditions are both true: - # - library is referenced in the gyp file as "$(SDKROOT)/**/*.dylib", - # - the ".dylib" file does not exists but a ".tbd" file do. - library = l.replace('$(SDKROOT)', sdk_root) - if l.startswith('$(SDKROOT)'): - basename, ext = os.path.splitext(library) - if ext == '.dylib' and not os.path.exists(library): - tbd_library = basename + '.tbd' - if os.path.exists(tbd_library): - library = tbd_library - return library - - def AdjustLibraries(self, libraries, config_name=None): - """Transforms entries like 'Cocoa.framework' in libraries into entries like + assert output_binary is not None + pre = self._GetTargetPostbuilds(configname, output, output_binary, quiet) + post = self._GetIOSPostbuilds(configname, output_binary) + return pre + postbuilds + post + + def _AdjustLibrary(self, library, config_name=None): + if library.endswith(".framework"): + l_flag = "-framework " + os.path.splitext(os.path.basename(library))[0] + else: + m = self.library_re.match(library) + if m: + l_flag = "-l" + m.group(1) + else: + l_flag = library + + sdk_root = self._SdkPath(config_name) + if not sdk_root: + sdk_root = "" + # Xcode 7 started shipping with ".tbd" (text based stubs) files instead of + # ".dylib" without providing a real support for them. What it does, for + # "/usr/lib" libraries, is do "-L/usr/lib -lname" which is dependent on the + # library order and cause collision when building Chrome. + # + # Instead substitute ".tbd" to ".dylib" in the generated project when the + # following conditions are both true: + # - library is referenced in the gyp file as "$(SDKROOT)/**/*.dylib", + # - the ".dylib" file does not exists but a ".tbd" file do. + library = l_flag.replace("$(SDKROOT)", sdk_root) + if l_flag.startswith("$(SDKROOT)"): + basename, ext = os.path.splitext(library) + if ext == ".dylib" and not os.path.exists(library): + tbd_library = basename + ".tbd" + if os.path.exists(tbd_library): + library = tbd_library + return library + + def AdjustLibraries(self, libraries, config_name=None): + """Transforms entries like 'Cocoa.framework' in libraries into entries like '-framework Cocoa', 'libcrypto.dylib' into '-lcrypto', etc. """ - libraries = [self._AdjustLibrary(library, config_name) - for library in libraries] - return libraries - - def _BuildMachineOSBuild(self): - return GetStdout(['sw_vers', '-buildVersion']) - - def _XcodeIOSDeviceFamily(self, configname): - family = self.xcode_settings[configname].get('TARGETED_DEVICE_FAMILY', '1') - return [int(x) for x in family.split(',')] - - def GetExtraPlistItems(self, configname=None): - """Returns a dictionary with extra items to insert into Info.plist.""" - if configname not in XcodeSettings._plist_cache: - cache = {} - cache['BuildMachineOSBuild'] = self._BuildMachineOSBuild() - - xcode_version, xcode_build = XcodeVersion() - cache['DTXcode'] = xcode_version - cache['DTXcodeBuild'] = xcode_build - - sdk_root = self._SdkRoot(configname) - if not sdk_root: - sdk_root = self._DefaultSdkRoot() - cache['DTSDKName'] = sdk_root - if xcode_version >= '0430': - cache['DTSDKBuild'] = self._GetSdkVersionInfoItem( - sdk_root, 'ProductBuildVersion') - else: - cache['DTSDKBuild'] = cache['BuildMachineOSBuild'] - - if self.isIOS: - cache['DTPlatformName'] = cache['DTSDKName'] - if configname.endswith("iphoneos"): - cache['DTPlatformVersion'] = self._GetSdkVersionInfoItem( - sdk_root, 'ProductVersion') - cache['CFBundleSupportedPlatforms'] = ['iPhoneOS'] - else: - cache['CFBundleSupportedPlatforms'] = ['iPhoneSimulator'] - XcodeSettings._plist_cache[configname] = cache - - # Include extra plist items that are per-target, not per global - # XcodeSettings. - items = dict(XcodeSettings._plist_cache[configname]) - if self.isIOS: - items['UIDeviceFamily'] = self._XcodeIOSDeviceFamily(configname) - return items - - def _DefaultSdkRoot(self): - """Returns the default SDKROOT to use. + libraries = [self._AdjustLibrary(library, config_name) for library in libraries] + return libraries + + def _BuildMachineOSBuild(self): + return GetStdout(["sw_vers", "-buildVersion"]) + + def _XcodeIOSDeviceFamily(self, configname): + family = self.xcode_settings[configname].get("TARGETED_DEVICE_FAMILY", "1") + return [int(x) for x in family.split(",")] + + def GetExtraPlistItems(self, configname=None): + """Returns a dictionary with extra items to insert into Info.plist.""" + if configname not in XcodeSettings._plist_cache: + cache = {} + cache["BuildMachineOSBuild"] = self._BuildMachineOSBuild() + + xcode_version, xcode_build = XcodeVersion() + cache["DTXcode"] = xcode_version + cache["DTXcodeBuild"] = xcode_build + compiler = self.xcode_settings[configname].get("GCC_VERSION") + if compiler is not None: + cache["DTCompiler"] = compiler + + sdk_root = self._SdkRoot(configname) + if not sdk_root: + sdk_root = self._DefaultSdkRoot() + sdk_version = self._GetSdkVersionInfoItem(sdk_root, "--show-sdk-version") + cache["DTSDKName"] = sdk_root + (sdk_version or "") + if xcode_version >= "0720": + cache["DTSDKBuild"] = self._GetSdkVersionInfoItem( + sdk_root, "--show-sdk-build-version" + ) + elif xcode_version >= "0430": + cache["DTSDKBuild"] = sdk_version + else: + cache["DTSDKBuild"] = cache["BuildMachineOSBuild"] + + if self.isIOS: + cache["MinimumOSVersion"] = self.xcode_settings[configname].get( + "IPHONEOS_DEPLOYMENT_TARGET" + ) + cache["DTPlatformName"] = sdk_root + cache["DTPlatformVersion"] = sdk_version + + if configname.endswith("iphoneos"): + cache["CFBundleSupportedPlatforms"] = ["iPhoneOS"] + cache["DTPlatformBuild"] = cache["DTSDKBuild"] + else: + cache["CFBundleSupportedPlatforms"] = ["iPhoneSimulator"] + # This is weird, but Xcode sets DTPlatformBuild to an empty field + # for simulator builds. + cache["DTPlatformBuild"] = "" + XcodeSettings._plist_cache[configname] = cache + + # Include extra plist items that are per-target, not per global + # XcodeSettings. + items = dict(XcodeSettings._plist_cache[configname]) + if self.isIOS: + items["UIDeviceFamily"] = self._XcodeIOSDeviceFamily(configname) + return items + + def _DefaultSdkRoot(self): + """Returns the default SDKROOT to use. Prior to version 5.0.0, if SDKROOT was not explicitly set in the Xcode project, then the environment variable was empty. Starting with this version, Xcode uses the name of the newest SDK installed. """ - xcode_version, _ = XcodeVersion() - if xcode_version < '0500': - return '' - default_sdk_path = self._XcodeSdkPath('') - default_sdk_root = XcodeSettings._sdk_root_cache.get(default_sdk_path) - if default_sdk_root: - return default_sdk_root - try: - all_sdks = GetStdout(['xcodebuild', '-showsdks']) - except GypError: - # If xcodebuild fails, there will be no valid SDKs - return '' - for line in all_sdks.splitlines(): - items = line.split() - if len(items) >= 3 and items[-2] == '-sdk': - sdk_root = items[-1] - sdk_path = self._XcodeSdkPath(sdk_root) - if sdk_path == default_sdk_path: - return sdk_root - return '' + xcode_version, _ = XcodeVersion() + if xcode_version < "0500": + return "" + default_sdk_path = self._XcodeSdkPath("") + default_sdk_root = XcodeSettings._sdk_root_cache.get(default_sdk_path) + if default_sdk_root: + return default_sdk_root + try: + all_sdks = GetStdout(["xcodebuild", "-showsdks"]) + except GypError: + # If xcodebuild fails, there will be no valid SDKs + return "" + for line in all_sdks.splitlines(): + items = line.split() + if len(items) >= 3 and items[-2] == "-sdk": + sdk_root = items[-1] + sdk_path = self._XcodeSdkPath(sdk_root) + if sdk_path == default_sdk_path: + return sdk_root + return "" class MacPrefixHeader(object): - """A class that helps with emulating Xcode's GCC_PREFIX_HEADER feature. + """A class that helps with emulating Xcode's GCC_PREFIX_HEADER feature. This feature consists of several pieces: * If GCC_PREFIX_HEADER is present, all compilations in that project get an @@ -1171,9 +1388,11 @@ class MacPrefixHeader(object): system for writing dependencies to the gch files, for writing build commands for the gch files, and for figuring out the location of the gch files. """ - def __init__(self, xcode_settings, - gyp_path_to_build_path, gyp_path_to_build_output): - """If xcode_settings is None, all methods on this class are no-ops. + + def __init__( + self, xcode_settings, gyp_path_to_build_path, gyp_path_to_build_output + ): + """If xcode_settings is None, all methods on this class are no-ops. Args: gyp_path_to_build_path: A function that takes a gyp-relative path, @@ -1183,197 +1402,217 @@ def __init__(self, xcode_settings, to where the output of precompiling that path for that language should be placed (without the trailing '.gch'). """ - # This doesn't support per-configuration prefix headers. Good enough - # for now. - self.header = None - self.compile_headers = False - if xcode_settings: - self.header = xcode_settings.GetPerTargetSetting('GCC_PREFIX_HEADER') - self.compile_headers = xcode_settings.GetPerTargetSetting( - 'GCC_PRECOMPILE_PREFIX_HEADER', default='NO') != 'NO' - self.compiled_headers = {} - if self.header: - if self.compile_headers: - for lang in ['c', 'cc', 'm', 'mm']: - self.compiled_headers[lang] = gyp_path_to_build_output( - self.header, lang) - self.header = gyp_path_to_build_path(self.header) - - def _CompiledHeader(self, lang, arch): - assert self.compile_headers - h = self.compiled_headers[lang] - if arch: - h += '.' + arch - return h - - def GetInclude(self, lang, arch=None): - """Gets the cflags to include the prefix header for language |lang|.""" - if self.compile_headers and lang in self.compiled_headers: - return '-include %s' % self._CompiledHeader(lang, arch) - elif self.header: - return '-include %s' % self.header - else: - return '' + # This doesn't support per-configuration prefix headers. Good enough + # for now. + self.header = None + self.compile_headers = False + if xcode_settings: + self.header = xcode_settings.GetPerTargetSetting("GCC_PREFIX_HEADER") + self.compile_headers = ( + xcode_settings.GetPerTargetSetting( + "GCC_PRECOMPILE_PREFIX_HEADER", default="NO" + ) + != "NO" + ) + self.compiled_headers = {} + if self.header: + if self.compile_headers: + for lang in ["c", "cc", "m", "mm"]: + self.compiled_headers[lang] = gyp_path_to_build_output( + self.header, lang + ) + self.header = gyp_path_to_build_path(self.header) + + def _CompiledHeader(self, lang, arch): + assert self.compile_headers + h = self.compiled_headers[lang] + if arch: + h += "." + arch + return h + + def GetInclude(self, lang, arch=None): + """Gets the cflags to include the prefix header for language |lang|.""" + if self.compile_headers and lang in self.compiled_headers: + return "-include %s" % self._CompiledHeader(lang, arch) + elif self.header: + return "-include %s" % self.header + else: + return "" - def _Gch(self, lang, arch): - """Returns the actual file name of the prefix header for language |lang|.""" - assert self.compile_headers - return self._CompiledHeader(lang, arch) + '.gch' + def _Gch(self, lang, arch): + """Returns the actual file name of the prefix header for language |lang|.""" + assert self.compile_headers + return self._CompiledHeader(lang, arch) + ".gch" - def GetObjDependencies(self, sources, objs, arch=None): - """Given a list of source files and the corresponding object files, returns + def GetObjDependencies(self, sources, objs, arch=None): + """Given a list of source files and the corresponding object files, returns a list of (source, object, gch) tuples, where |gch| is the build-directory relative path to the gch file each object file depends on. |compilable[i]| has to be the source file belonging to |objs[i]|.""" - if not self.header or not self.compile_headers: - return [] - - result = [] - for source, obj in zip(sources, objs): - ext = os.path.splitext(source)[1] - lang = { - '.c': 'c', - '.cpp': 'cc', '.cc': 'cc', '.cxx': 'cc', - '.m': 'm', - '.mm': 'mm', - }.get(ext, None) - if lang: - result.append((source, obj, self._Gch(lang, arch))) - return result - - def GetPchBuildCommands(self, arch=None): - """Returns [(path_to_gch, language_flag, language, header)]. + if not self.header or not self.compile_headers: + return [] + + result = [] + for source, obj in zip(sources, objs): + ext = os.path.splitext(source)[1] + lang = { + ".c": "c", + ".cpp": "cc", + ".cc": "cc", + ".cxx": "cc", + ".m": "m", + ".mm": "mm", + }.get(ext, None) + if lang: + result.append((source, obj, self._Gch(lang, arch))) + return result + + def GetPchBuildCommands(self, arch=None): + """Returns [(path_to_gch, language_flag, language, header)]. |path_to_gch| and |header| are relative to the build directory. """ - if not self.header or not self.compile_headers: - return [] - return [ - (self._Gch('c', arch), '-x c-header', 'c', self.header), - (self._Gch('cc', arch), '-x c++-header', 'cc', self.header), - (self._Gch('m', arch), '-x objective-c-header', 'm', self.header), - (self._Gch('mm', arch), '-x objective-c++-header', 'mm', self.header), - ] + if not self.header or not self.compile_headers: + return [] + return [ + (self._Gch("c", arch), "-x c-header", "c", self.header), + (self._Gch("cc", arch), "-x c++-header", "cc", self.header), + (self._Gch("m", arch), "-x objective-c-header", "m", self.header), + (self._Gch("mm", arch), "-x objective-c++-header", "mm", self.header), + ] def XcodeVersion(): - """Returns a tuple of version and build version of installed Xcode.""" - # `xcodebuild -version` output looks like - # Xcode 4.6.3 - # Build version 4H1503 - # or like - # Xcode 3.2.6 - # Component versions: DevToolsCore-1809.0; DevToolsSupport-1806.0 - # BuildVersion: 10M2518 - # Convert that to ('0463', '4H1503') or ('0326', '10M2518'). - global XCODE_VERSION_CACHE - if XCODE_VERSION_CACHE: + """Returns a tuple of version and build version of installed Xcode.""" + # `xcodebuild -version` output looks like + # Xcode 4.6.3 + # Build version 4H1503 + # or like + # Xcode 3.2.6 + # Component versions: DevToolsCore-1809.0; DevToolsSupport-1806.0 + # BuildVersion: 10M2518 + # Convert that to ('0463', '4H1503') or ('0326', '10M2518'). + global XCODE_VERSION_CACHE + if XCODE_VERSION_CACHE: + return XCODE_VERSION_CACHE + version = "" + build = "" + try: + version_list = GetStdoutQuiet(["xcodebuild", "-version"]).splitlines() + # In some circumstances xcodebuild exits 0 but doesn't return + # the right results; for example, a user on 10.7 or 10.8 with + # a bogus path set via xcode-select + # In that case this may be a CLT-only install so fall back to + # checking that version. + if len(version_list) < 2: + raise GypError("xcodebuild returned unexpected results") + version = version_list[0].split()[-1] # Last word on first line + build = version_list[-1].split()[-1] # Last word on last line + except GypError: # Xcode not installed so look for XCode Command Line Tools + version = CLTVersion() # macOS Catalina returns 11.0.0.0.1.1567737322 + if not version: + raise GypError("No Xcode or CLT version detected!") + # Be careful to convert "4.2.3" to "0423" and "11.0.0" to "1100": + version = version.split(".")[:3] # Just major, minor, micro + version[0] = version[0].zfill(2) # Add a leading zero if major is one digit + version = ("".join(version) + "00")[:4] # Limit to exactly four characters + XCODE_VERSION_CACHE = (version, build) return XCODE_VERSION_CACHE - version = "" - build = "" - try: - version_list = GetStdoutQuiet(['xcodebuild', '-version']).splitlines() - # In some circumstances xcodebuild exits 0 but doesn't return - # the right results; for example, a user on 10.7 or 10.8 with - # a bogus path set via xcode-select - # In that case this may be a CLT-only install so fall back to - # checking that version. - if len(version_list) < 2: - raise GypError("xcodebuild returned unexpected results") - version = version_list[0].split()[-1] # Last word on first line - build = version_list[-1].split()[-1] # Last word on last line - except GypError: # Xcode not installed so look for XCode Command Line Tools - version = CLTVersion() # macOS Catalina returns 11.0.0.0.1.1567737322 - if not version: - raise GypError("No Xcode or CLT version detected!") - # Be careful to convert "4.2.3" to "0423" and "11.0.0" to "1100": - version = version.split(".")[:3] # Just major, minor, micro - version[0] = version[0].zfill(2) # Add a leading zero if major is one digit - version = ("".join(version) + "00")[:4] # Limit to exactly four characters - XCODE_VERSION_CACHE = (version, build) - return XCODE_VERSION_CACHE # This function ported from the logic in Homebrew's CLT version check def CLTVersion(): - """Returns the version of command-line tools from pkgutil.""" - # pkgutil output looks like - # package-id: com.apple.pkg.CLTools_Executables - # version: 5.0.1.0.1.1382131676 - # volume: / - # location: / - # install-time: 1382544035 - # groups: com.apple.FindSystemFiles.pkg-group com.apple.DevToolsBoth.pkg-group com.apple.DevToolsNonRelocatableShared.pkg-group - STANDALONE_PKG_ID = "com.apple.pkg.DeveloperToolsCLILeo" - FROM_XCODE_PKG_ID = "com.apple.pkg.DeveloperToolsCLI" - MAVERICKS_PKG_ID = "com.apple.pkg.CLTools_Executables" - - regex = re.compile('version: (?P.+)') - for key in [MAVERICKS_PKG_ID, STANDALONE_PKG_ID, FROM_XCODE_PKG_ID]: + """Returns the version of command-line tools from pkgutil.""" + # pkgutil output looks like + # package-id: com.apple.pkg.CLTools_Executables + # version: 5.0.1.0.1.1382131676 + # volume: / + # location: / + # install-time: 1382544035 + # groups: com.apple.FindSystemFiles.pkg-group com.apple.DevToolsBoth.pkg-group com.apple.DevToolsNonRelocatableShared.pkg-group + STANDALONE_PKG_ID = "com.apple.pkg.DeveloperToolsCLILeo" + FROM_XCODE_PKG_ID = "com.apple.pkg.DeveloperToolsCLI" + MAVERICKS_PKG_ID = "com.apple.pkg.CLTools_Executables" + + regex = re.compile("version: (?P.+)") + for key in [MAVERICKS_PKG_ID, STANDALONE_PKG_ID, FROM_XCODE_PKG_ID]: + try: + output = GetStdout(["/usr/sbin/pkgutil", "--pkg-info", key]) + return re.search(regex, output).groupdict()["version"] + except GypError: + continue + + regex = re.compile(r'Command Line Tools for Xcode\s+(?P\S+)') try: - output = GetStdout(['/usr/sbin/pkgutil', '--pkg-info', key]) - return re.search(regex, output).groupdict()['version'] + output = GetStdout(["/usr/sbin/softwareupdate", "--history"]) + return re.search(regex, output).groupdict()["version"] except GypError: - continue + return None def GetStdoutQuiet(cmdlist): - """Returns the content of standard output returned by invoking |cmdlist|. + """Returns the content of standard output returned by invoking |cmdlist|. Ignores the stderr. Raises |GypError| if the command return with a non-zero return code.""" - job = subprocess.Popen(cmdlist, stdout=subprocess.PIPE, stderr=subprocess.PIPE) - out = job.communicate()[0] - if PY3: - out = out.decode("utf-8") - if job.returncode != 0: - raise GypError('Error %d running %s' % (job.returncode, cmdlist[0])) - return out.rstrip('\n') + job = subprocess.Popen(cmdlist, stdout=subprocess.PIPE, stderr=subprocess.PIPE) + out = job.communicate()[0] + if PY3: + out = out.decode("utf-8") + if job.returncode != 0: + raise GypError("Error %d running %s" % (job.returncode, cmdlist[0])) + return out.rstrip("\n") def GetStdout(cmdlist): - """Returns the content of standard output returned by invoking |cmdlist|. + """Returns the content of standard output returned by invoking |cmdlist|. Raises |GypError| if the command return with a non-zero return code.""" - job = subprocess.Popen(cmdlist, stdout=subprocess.PIPE) - out = job.communicate()[0] - if PY3: - out = out.decode("utf-8") - if job.returncode != 0: - sys.stderr.write(out + '\n') - raise GypError('Error %d running %s' % (job.returncode, cmdlist[0])) - return out.rstrip('\n') + job = subprocess.Popen(cmdlist, stdout=subprocess.PIPE) + out = job.communicate()[0] + if PY3: + out = out.decode("utf-8") + if job.returncode != 0: + sys.stderr.write(out + "\n") + raise GypError("Error %d running %s" % (job.returncode, cmdlist[0])) + return out.rstrip("\n") def MergeGlobalXcodeSettingsToSpec(global_dict, spec): - """Merges the global xcode_settings dictionary into each configuration of the + """Merges the global xcode_settings dictionary into each configuration of the target represented by spec. For keys that are both in the global and the local xcode_settings dict, the local key gets precedence. """ - # The xcode generator special-cases global xcode_settings and does something - # that amounts to merging in the global xcode_settings into each local - # xcode_settings dict. - global_xcode_settings = global_dict.get('xcode_settings', {}) - for config in spec['configurations'].values(): - if 'xcode_settings' in config: - new_settings = global_xcode_settings.copy() - new_settings.update(config['xcode_settings']) - config['xcode_settings'] = new_settings + # The xcode generator special-cases global xcode_settings and does something + # that amounts to merging in the global xcode_settings into each local + # xcode_settings dict. + global_xcode_settings = global_dict.get("xcode_settings", {}) + for config in spec["configurations"].values(): + if "xcode_settings" in config: + new_settings = global_xcode_settings.copy() + new_settings.update(config["xcode_settings"]) + config["xcode_settings"] = new_settings def IsMacBundle(flavor, spec): - """Returns if |spec| should be treated as a bundle. + """Returns if |spec| should be treated as a bundle. Bundles are directories with a certain subdirectory structure, instead of just a single file. Bundle rules do not produce a binary but also package resources into that directory.""" - is_mac_bundle = (int(spec.get('mac_bundle', 0)) != 0 and flavor == 'mac') - if is_mac_bundle: - assert spec['type'] != 'none', ( - 'mac_bundle targets cannot have type none (target "%s")' % - spec['target_name']) - return is_mac_bundle + is_mac_bundle = ( + int(spec.get("mac_xctest_bundle", 0)) != 0 + or int(spec.get("mac_xcuitest_bundle", 0)) != 0 + or (int(spec.get("mac_bundle", 0)) != 0 and flavor == "mac") + ) + + if is_mac_bundle: + assert spec["type"] != "none", ( + 'mac_bundle targets cannot have type none (target "%s")' + % spec["target_name"] + ) + return is_mac_bundle def GetMacBundleResources(product_dir, xcode_settings, resources): - """Yields (output, resource) pairs for every resource in |resources|. + """Yields (output, resource) pairs for every resource in |resources|. Only call this for mac bundle targets. Args: @@ -1382,38 +1621,36 @@ def GetMacBundleResources(product_dir, xcode_settings, resources): xcode_settings: The XcodeSettings of the current target. resources: A list of bundle resources, relative to the build directory. """ - dest = os.path.join(product_dir, - xcode_settings.GetBundleResourceFolder()) - for res in resources: - output = dest + dest = os.path.join(product_dir, xcode_settings.GetBundleResourceFolder()) + for res in resources: + output = dest - # The make generator doesn't support it, so forbid it everywhere - # to keep the generators more interchangeable. - assert ' ' not in res, ( - "Spaces in resource filenames not supported (%s)" % res) + # The make generator doesn't support it, so forbid it everywhere + # to keep the generators more interchangeable. + assert " " not in res, "Spaces in resource filenames not supported (%s)" % res - # Split into (path,file). - res_parts = os.path.split(res) + # Split into (path,file). + res_parts = os.path.split(res) - # Now split the path into (prefix,maybe.lproj). - lproj_parts = os.path.split(res_parts[0]) - # If the resource lives in a .lproj bundle, add that to the destination. - if lproj_parts[1].endswith('.lproj'): - output = os.path.join(output, lproj_parts[1]) + # Now split the path into (prefix,maybe.lproj). + lproj_parts = os.path.split(res_parts[0]) + # If the resource lives in a .lproj bundle, add that to the destination. + if lproj_parts[1].endswith(".lproj"): + output = os.path.join(output, lproj_parts[1]) - output = os.path.join(output, res_parts[1]) - # Compiled XIB files are referred to by .nib. - if output.endswith('.xib'): - output = os.path.splitext(output)[0] + '.nib' - # Compiled storyboard files are referred to by .storyboardc. - if output.endswith('.storyboard'): - output = os.path.splitext(output)[0] + '.storyboardc' + output = os.path.join(output, res_parts[1]) + # Compiled XIB files are referred to by .nib. + if output.endswith(".xib"): + output = os.path.splitext(output)[0] + ".nib" + # Compiled storyboard files are referred to by .storyboardc. + if output.endswith(".storyboard"): + output = os.path.splitext(output)[0] + ".storyboardc" - yield output, res + yield output, res def GetMacInfoPlist(product_dir, xcode_settings, gyp_path_to_build_path): - """Returns (info_plist, dest_plist, defines, extra_env), where: + """Returns (info_plist, dest_plist, defines, extra_env), where: * |info_plist| is the source plist path, relative to the build directory, * |dest_plist| is the destination plist path, relative to the @@ -1432,36 +1669,43 @@ def GetMacInfoPlist(product_dir, xcode_settings, gyp_path_to_build_path): gyp_to_build_path: A function that converts paths relative to the current gyp file to paths relative to the build directory. """ - info_plist = xcode_settings.GetPerTargetSetting('INFOPLIST_FILE') - if not info_plist: - return None, None, [], {} - - # The make generator doesn't support it, so forbid it everywhere - # to keep the generators more interchangeable. - assert ' ' not in info_plist, ( - "Spaces in Info.plist filenames not supported (%s)" % info_plist) + info_plist = xcode_settings.GetPerTargetSetting("INFOPLIST_FILE") + if not info_plist: + return None, None, [], {} - info_plist = gyp_path_to_build_path(info_plist) - - # If explicitly set to preprocess the plist, invoke the C preprocessor and - # specify any defines as -D flags. - if xcode_settings.GetPerTargetSetting( - 'INFOPLIST_PREPROCESS', default='NO') == 'YES': - # Create an intermediate file based on the path. - defines = shlex.split(xcode_settings.GetPerTargetSetting( - 'INFOPLIST_PREPROCESSOR_DEFINITIONS', default='')) - else: - defines = [] + # The make generator doesn't support it, so forbid it everywhere + # to keep the generators more interchangeable. + assert " " not in info_plist, ( + "Spaces in Info.plist filenames not supported (%s)" % info_plist + ) + + info_plist = gyp_path_to_build_path(info_plist) + + # If explicitly set to preprocess the plist, invoke the C preprocessor and + # specify any defines as -D flags. + if ( + xcode_settings.GetPerTargetSetting("INFOPLIST_PREPROCESS", default="NO") + == "YES" + ): + # Create an intermediate file based on the path. + defines = shlex.split( + xcode_settings.GetPerTargetSetting( + "INFOPLIST_PREPROCESSOR_DEFINITIONS", default="" + ) + ) + else: + defines = [] - dest_plist = os.path.join(product_dir, xcode_settings.GetBundlePlistPath()) - extra_env = xcode_settings.GetPerTargetSettings() + dest_plist = os.path.join(product_dir, xcode_settings.GetBundlePlistPath()) + extra_env = xcode_settings.GetPerTargetSettings() - return info_plist, dest_plist, defines, extra_env + return info_plist, dest_plist, defines, extra_env -def _GetXcodeEnv(xcode_settings, built_products_dir, srcroot, configuration, - additional_settings=None): - """Return the environment variables that Xcode would set. See +def _GetXcodeEnv( + xcode_settings, built_products_dir, srcroot, configuration, additional_settings=None +): + """Return the environment variables that Xcode would set. See http://developer.apple.com/library/mac/#documentation/DeveloperTools/Reference/XcodeBuildSettingRef/1-Build_Setting_Reference/build_setting_ref.html#//apple_ref/doc/uid/TP40003931-CH3-SW153 for a full list. @@ -1474,187 +1718,221 @@ def _GetXcodeEnv(xcode_settings, built_products_dir, srcroot, configuration, additional_settings: An optional dict with more values to add to the result. """ - if not xcode_settings: return {} - - # This function is considered a friend of XcodeSettings, so let it reach into - # its implementation details. - spec = xcode_settings.spec - - # These are filled in on a as-needed basis. - env = { - 'BUILT_FRAMEWORKS_DIR' : built_products_dir, - 'BUILT_PRODUCTS_DIR' : built_products_dir, - 'CONFIGURATION' : configuration, - 'PRODUCT_NAME' : xcode_settings.GetProductName(), - # See /Developer/Platforms/MacOSX.platform/Developer/Library/Xcode/Specifications/MacOSX\ Product\ Types.xcspec for FULL_PRODUCT_NAME - 'SRCROOT' : srcroot, - 'SOURCE_ROOT': '${SRCROOT}', - # This is not true for static libraries, but currently the env is only - # written for bundles: - 'TARGET_BUILD_DIR' : built_products_dir, - 'TEMP_DIR' : '${TMPDIR}', - } - if xcode_settings.GetPerConfigSetting('SDKROOT', configuration): - env['SDKROOT'] = xcode_settings._SdkPath(configuration) - else: - env['SDKROOT'] = '' - - if spec['type'] in ( - 'executable', 'static_library', 'shared_library', 'loadable_module'): - env['EXECUTABLE_NAME'] = xcode_settings.GetExecutableName() - env['EXECUTABLE_PATH'] = xcode_settings.GetExecutablePath() - env['FULL_PRODUCT_NAME'] = xcode_settings.GetFullProductName() - mach_o_type = xcode_settings.GetMachOType() - if mach_o_type: - env['MACH_O_TYPE'] = mach_o_type - env['PRODUCT_TYPE'] = xcode_settings.GetProductType() - if xcode_settings._IsBundle(): - env['CONTENTS_FOLDER_PATH'] = \ - xcode_settings.GetBundleContentsFolderPath() - env['UNLOCALIZED_RESOURCES_FOLDER_PATH'] = \ - xcode_settings.GetBundleResourceFolder() - env['INFOPLIST_PATH'] = xcode_settings.GetBundlePlistPath() - env['WRAPPER_NAME'] = xcode_settings.GetWrapperName() - - install_name = xcode_settings.GetInstallName() - if install_name: - env['LD_DYLIB_INSTALL_NAME'] = install_name - install_name_base = xcode_settings.GetInstallNameBase() - if install_name_base: - env['DYLIB_INSTALL_NAME_BASE'] = install_name_base - xcode_version, _ = XcodeVersion() - if xcode_version >= '0500' and not env.get('SDKROOT'): - sdk_root = xcode_settings._SdkRoot(configuration) - if not sdk_root: - sdk_root = xcode_settings._XcodeSdkPath('') - if sdk_root is None: - sdk_root = '' - env['SDKROOT'] = sdk_root - - if not additional_settings: - additional_settings = {} - else: - # Flatten lists to strings. - for k in additional_settings: - if not isinstance(additional_settings[k], str): - additional_settings[k] = ' '.join(additional_settings[k]) - additional_settings.update(env) - for k in additional_settings: - additional_settings[k] = _NormalizeEnvVarReferences(additional_settings[k]) + if not xcode_settings: + return {} + + # This function is considered a friend of XcodeSettings, so let it reach into + # its implementation details. + spec = xcode_settings.spec + + # These are filled in on an as-needed basis. + env = { + "BUILT_FRAMEWORKS_DIR": built_products_dir, + "BUILT_PRODUCTS_DIR": built_products_dir, + "CONFIGURATION": configuration, + "PRODUCT_NAME": xcode_settings.GetProductName(), + # See /Developer/Platforms/MacOSX.platform/Developer/Library/Xcode/Specifications/MacOSX\ Product\ Types.xcspec for FULL_PRODUCT_NAME + "SRCROOT": srcroot, + "SOURCE_ROOT": "${SRCROOT}", + # This is not true for static libraries, but currently the env is only + # written for bundles: + "TARGET_BUILD_DIR": built_products_dir, + "TEMP_DIR": "${TMPDIR}", + "XCODE_VERSION_ACTUAL": XcodeVersion()[0], + } + if xcode_settings.GetPerConfigSetting("SDKROOT", configuration): + env["SDKROOT"] = xcode_settings._SdkPath(configuration) + else: + env["SDKROOT"] = "" + + if xcode_settings.mac_toolchain_dir: + env["DEVELOPER_DIR"] = xcode_settings.mac_toolchain_dir + + if spec["type"] in ( + "executable", + "static_library", + "shared_library", + "loadable_module", + ): + env["EXECUTABLE_NAME"] = xcode_settings.GetExecutableName() + env["EXECUTABLE_PATH"] = xcode_settings.GetExecutablePath() + env["FULL_PRODUCT_NAME"] = xcode_settings.GetFullProductName() + mach_o_type = xcode_settings.GetMachOType() + if mach_o_type: + env["MACH_O_TYPE"] = mach_o_type + env["PRODUCT_TYPE"] = xcode_settings.GetProductType() + if xcode_settings._IsBundle(): + # xcodeproj_file.py sets the same Xcode subfolder value for this as for + # FRAMEWORKS_FOLDER_PATH so Xcode builds will actually use FFP's value. + env["BUILT_FRAMEWORKS_DIR"] = os.path.join( + built_products_dir + os.sep + xcode_settings.GetBundleFrameworksFolderPath() + ) + env["CONTENTS_FOLDER_PATH"] = xcode_settings.GetBundleContentsFolderPath() + env["EXECUTABLE_FOLDER_PATH"] = xcode_settings.GetBundleExecutableFolderPath() + env[ + "UNLOCALIZED_RESOURCES_FOLDER_PATH" + ] = xcode_settings.GetBundleResourceFolder() + env["JAVA_FOLDER_PATH"] = xcode_settings.GetBundleJavaFolderPath() + env["FRAMEWORKS_FOLDER_PATH"] = xcode_settings.GetBundleFrameworksFolderPath() + env[ + "SHARED_FRAMEWORKS_FOLDER_PATH" + ] = xcode_settings.GetBundleSharedFrameworksFolderPath() + env[ + "SHARED_SUPPORT_FOLDER_PATH" + ] = xcode_settings.GetBundleSharedSupportFolderPath() + env["PLUGINS_FOLDER_PATH"] = xcode_settings.GetBundlePlugInsFolderPath() + env["XPCSERVICES_FOLDER_PATH"] = xcode_settings.GetBundleXPCServicesFolderPath() + env["INFOPLIST_PATH"] = xcode_settings.GetBundlePlistPath() + env["WRAPPER_NAME"] = xcode_settings.GetWrapperName() + + install_name = xcode_settings.GetInstallName() + if install_name: + env["LD_DYLIB_INSTALL_NAME"] = install_name + install_name_base = xcode_settings.GetInstallNameBase() + if install_name_base: + env["DYLIB_INSTALL_NAME_BASE"] = install_name_base + xcode_version, _ = XcodeVersion() + if xcode_version >= "0500" and not env.get("SDKROOT"): + sdk_root = xcode_settings._SdkRoot(configuration) + if not sdk_root: + sdk_root = xcode_settings._XcodeSdkPath("") + if sdk_root is None: + sdk_root = "" + env["SDKROOT"] = sdk_root + + if not additional_settings: + additional_settings = {} + else: + # Flatten lists to strings. + for k in additional_settings: + if not isinstance(additional_settings[k], str): + additional_settings[k] = " ".join(additional_settings[k]) + additional_settings.update(env) - return additional_settings + for k in additional_settings: + additional_settings[k] = _NormalizeEnvVarReferences(additional_settings[k]) + + return additional_settings def _NormalizeEnvVarReferences(str): - """Takes a string containing variable references in the form ${FOO}, $(FOO), + """Takes a string containing variable references in the form ${FOO}, $(FOO), or $FOO, and returns a string with all variable references in the form ${FOO}. """ - # $FOO -> ${FOO} - str = re.sub(r'\$([a-zA-Z_][a-zA-Z0-9_]*)', r'${\1}', str) + # $FOO -> ${FOO} + str = re.sub(r"\$([a-zA-Z_][a-zA-Z0-9_]*)", r"${\1}", str) - # $(FOO) -> ${FOO} - matches = re.findall(r'(\$\(([a-zA-Z0-9\-_]+)\))', str) - for match in matches: - to_replace, variable = match - assert '$(' not in match, '$($(FOO)) variables not supported: ' + match - str = str.replace(to_replace, '${' + variable + '}') + # $(FOO) -> ${FOO} + matches = re.findall(r"(\$\(([a-zA-Z0-9\-_]+)\))", str) + for match in matches: + to_replace, variable = match + assert "$(" not in match, "$($(FOO)) variables not supported: " + match + str = str.replace(to_replace, "${" + variable + "}") - return str + return str def ExpandEnvVars(string, expansions): - """Expands ${VARIABLES}, $(VARIABLES), and $VARIABLES in string per the + """Expands ${VARIABLES}, $(VARIABLES), and $VARIABLES in string per the expansions list. If the variable expands to something that references another variable, this variable is expanded as well if it's in env -- until no variables present in env are left.""" - for k, v in reversed(expansions): - string = string.replace('${' + k + '}', v) - string = string.replace('$(' + k + ')', v) - string = string.replace('$' + k, v) - return string + for k, v in reversed(expansions): + string = string.replace("${" + k + "}", v) + string = string.replace("$(" + k + ")", v) + string = string.replace("$" + k, v) + return string def _TopologicallySortedEnvVarKeys(env): - """Takes a dict |env| whose values are strings that can refer to other keys, + """Takes a dict |env| whose values are strings that can refer to other keys, for example env['foo'] = '$(bar) and $(baz)'. Returns a list L of all keys of env such that key2 is after key1 in L if env[key2] refers to env[key1]. Throws an Exception in case of dependency cycles. """ - # Since environment variables can refer to other variables, the evaluation - # order is important. Below is the logic to compute the dependency graph - # and sort it. - regex = re.compile(r'\$\{([a-zA-Z0-9\-_]+)\}') - def GetEdges(node): - # Use a definition of edges such that user_of_variable -> used_varible. - # This happens to be easier in this case, since a variable's - # definition contains all variables it references in a single string. - # We can then reverse the result of the topological sort at the end. - # Since: reverse(topsort(DAG)) = topsort(reverse_edges(DAG)) - matches = set([v for v in regex.findall(env[node]) if v in env]) - for dependee in matches: - assert '${' not in dependee, 'Nested variables not supported: ' + dependee - return matches - - try: - # Topologically sort, and then reverse, because we used an edge definition - # that's inverted from the expected result of this function (see comment - # above). - order = gyp.common.TopologicallySorted(env.keys(), GetEdges) - order.reverse() - return order - except gyp.common.CycleError as e: - raise GypError( - 'Xcode environment variables are cyclically dependent: ' + str(e.nodes)) - - -def GetSortedXcodeEnv(xcode_settings, built_products_dir, srcroot, - configuration, additional_settings=None): - env = _GetXcodeEnv(xcode_settings, built_products_dir, srcroot, configuration, - additional_settings) - return [(key, env[key]) for key in _TopologicallySortedEnvVarKeys(env)] + # Since environment variables can refer to other variables, the evaluation + # order is important. Below is the logic to compute the dependency graph + # and sort it. + regex = re.compile(r"\$\{([a-zA-Z0-9\-_]+)\}") + + def GetEdges(node): + # Use a definition of edges such that user_of_variable -> used_varible. + # This happens to be easier in this case, since a variable's + # definition contains all variables it references in a single string. + # We can then reverse the result of the topological sort at the end. + # Since: reverse(topsort(DAG)) = topsort(reverse_edges(DAG)) + matches = set([v for v in regex.findall(env[node]) if v in env]) + for dependee in matches: + assert "${" not in dependee, "Nested variables not supported: " + dependee + return matches + + try: + # Topologically sort, and then reverse, because we used an edge definition + # that's inverted from the expected result of this function (see comment + # above). + order = gyp.common.TopologicallySorted(env.keys(), GetEdges) + order.reverse() + return order + except gyp.common.CycleError as e: + raise GypError( + "Xcode environment variables are cyclically dependent: " + str(e.nodes) + ) + + +def GetSortedXcodeEnv( + xcode_settings, built_products_dir, srcroot, configuration, additional_settings=None +): + env = _GetXcodeEnv( + xcode_settings, built_products_dir, srcroot, configuration, additional_settings + ) + return [(key, env[key]) for key in _TopologicallySortedEnvVarKeys(env)] def GetSpecPostbuildCommands(spec, quiet=False): - """Returns the list of postbuilds explicitly defined on |spec|, in a form + """Returns the list of postbuilds explicitly defined on |spec|, in a form executable by a shell.""" - postbuilds = [] - for postbuild in spec.get('postbuilds', []): - if not quiet: - postbuilds.append('echo POSTBUILD\\(%s\\) %s' % ( - spec['target_name'], postbuild['postbuild_name'])) - postbuilds.append(gyp.common.EncodePOSIXShellList(postbuild['action'])) - return postbuilds + postbuilds = [] + for postbuild in spec.get("postbuilds", []): + if not quiet: + postbuilds.append( + "echo POSTBUILD\\(%s\\) %s" + % (spec["target_name"], postbuild["postbuild_name"]) + ) + postbuilds.append(gyp.common.EncodePOSIXShellList(postbuild["action"])) + return postbuilds def _HasIOSTarget(targets): - """Returns true if any target contains the iOS specific key + """Returns true if any target contains the iOS specific key IPHONEOS_DEPLOYMENT_TARGET.""" - for target_dict in targets.values(): - for config in target_dict['configurations'].values(): - if config.get('xcode_settings', {}).get('IPHONEOS_DEPLOYMENT_TARGET'): - return True - return False + for target_dict in targets.values(): + for config in target_dict["configurations"].values(): + if config.get("xcode_settings", {}).get("IPHONEOS_DEPLOYMENT_TARGET"): + return True + return False def _AddIOSDeviceConfigurations(targets): - """Clone all targets and append -iphoneos to the name. Configure these targets + """Clone all targets and append -iphoneos to the name. Configure these targets to build for iOS devices and use correct architectures for those builds.""" - for target_dict in targets.values(): - toolset = target_dict['toolset'] - configs = target_dict['configurations'] - for config_name, config_dict in dict(configs).items(): - iphoneos_config_dict = copy.deepcopy(config_dict) - configs[config_name + '-iphoneos'] = iphoneos_config_dict - configs[config_name + '-iphonesimulator'] = config_dict - if toolset == 'target': - iphoneos_config_dict['xcode_settings']['SDKROOT'] = 'iphoneos' - return targets + for target_dict in targets.values(): + toolset = target_dict["toolset"] + configs = target_dict["configurations"] + for config_name, simulator_config_dict in dict(configs).items(): + iphoneos_config_dict = copy.deepcopy(simulator_config_dict) + configs[config_name + "-iphoneos"] = iphoneos_config_dict + configs[config_name + "-iphonesimulator"] = simulator_config_dict + if toolset == "target": + simulator_config_dict["xcode_settings"]["SDKROOT"] = "iphonesimulator" + iphoneos_config_dict["xcode_settings"]["SDKROOT"] = "iphoneos" + return targets + def CloneConfigurationForDeviceAndEmulator(target_dicts): - """If |target_dicts| contains any iOS targets, automatically create -iphoneos + """If |target_dicts| contains any iOS targets, automatically create -iphoneos targets for iOS device builds.""" - if _HasIOSTarget(target_dicts): - return _AddIOSDeviceConfigurations(target_dicts) - return target_dicts + if _HasIOSTarget(target_dicts): + return _AddIOSDeviceConfigurations(target_dicts) + return target_dicts diff --git a/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/xcode_ninja.py b/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/xcode_ninja.py index d70eddc90a57d1..10ddcbccd0310b 100644 --- a/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/xcode_ninja.py +++ b/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/xcode_ninja.py @@ -20,111 +20,122 @@ def _WriteWorkspace(main_gyp, sources_gyp, params): - """ Create a workspace to wrap main and sources gyp paths. """ - (build_file_root, build_file_ext) = os.path.splitext(main_gyp) - workspace_path = build_file_root + '.xcworkspace' - options = params['options'] - if options.generator_output: - workspace_path = os.path.join(options.generator_output, workspace_path) - try: - os.makedirs(workspace_path) - except OSError as e: - if e.errno != errno.EEXIST: - raise - output_string = '\n' + \ - '\n' - for gyp_name in [main_gyp, sources_gyp]: - name = os.path.splitext(os.path.basename(gyp_name))[0] + '.xcodeproj' - name = xml.sax.saxutils.quoteattr("group:" + name) - output_string += ' \n' % name - output_string += '\n' - - workspace_file = os.path.join(workspace_path, "contents.xcworkspacedata") - - try: - with open(workspace_file, 'r') as input_file: - input_string = input_file.read() - if input_string == output_string: - return - except IOError: - # Ignore errors if the file doesn't exist. - pass - - with open(workspace_file, 'w') as output_file: - output_file.write(output_string) + """ Create a workspace to wrap main and sources gyp paths. """ + (build_file_root, build_file_ext) = os.path.splitext(main_gyp) + workspace_path = build_file_root + ".xcworkspace" + options = params["options"] + if options.generator_output: + workspace_path = os.path.join(options.generator_output, workspace_path) + try: + os.makedirs(workspace_path) + except OSError as e: + if e.errno != errno.EEXIST: + raise + output_string = ( + '\n' + '\n' + ) + for gyp_name in [main_gyp, sources_gyp]: + name = os.path.splitext(os.path.basename(gyp_name))[0] + ".xcodeproj" + name = xml.sax.saxutils.quoteattr("group:" + name) + output_string += " \n" % name + output_string += "\n" + + workspace_file = os.path.join(workspace_path, "contents.xcworkspacedata") + + try: + with open(workspace_file, "r") as input_file: + input_string = input_file.read() + if input_string == output_string: + return + except IOError: + # Ignore errors if the file doesn't exist. + pass + + with open(workspace_file, "w") as output_file: + output_file.write(output_string) + def _TargetFromSpec(old_spec, params): - """ Create fake target for xcode-ninja wrapper. """ - # Determine ninja top level build dir (e.g. /path/to/out). - ninja_toplevel = None - jobs = 0 - if params: - options = params['options'] - ninja_toplevel = \ - os.path.join(options.toplevel_dir, - gyp.generator.ninja.ComputeOutputDir(params)) - jobs = params.get('generator_flags', {}).get('xcode_ninja_jobs', 0) - - target_name = old_spec.get('target_name') - product_name = old_spec.get('product_name', target_name) - product_extension = old_spec.get('product_extension') - - ninja_target = {} - ninja_target['target_name'] = target_name - ninja_target['product_name'] = product_name - if product_extension: - ninja_target['product_extension'] = product_extension - ninja_target['toolset'] = old_spec.get('toolset') - ninja_target['default_configuration'] = old_spec.get('default_configuration') - ninja_target['configurations'] = {} - - # Tell Xcode to look in |ninja_toplevel| for build products. - new_xcode_settings = {} - if ninja_toplevel: - new_xcode_settings['CONFIGURATION_BUILD_DIR'] = \ - "%s/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)" % ninja_toplevel - - if 'configurations' in old_spec: - for config in old_spec['configurations']: - old_xcode_settings = \ - old_spec['configurations'][config].get('xcode_settings', {}) - if 'IPHONEOS_DEPLOYMENT_TARGET' in old_xcode_settings: - new_xcode_settings['CODE_SIGNING_REQUIRED'] = "NO" - new_xcode_settings['IPHONEOS_DEPLOYMENT_TARGET'] = \ - old_xcode_settings['IPHONEOS_DEPLOYMENT_TARGET'] - ninja_target['configurations'][config] = {} - ninja_target['configurations'][config]['xcode_settings'] = \ - new_xcode_settings - - ninja_target['mac_bundle'] = old_spec.get('mac_bundle', 0) - ninja_target['ios_app_extension'] = old_spec.get('ios_app_extension', 0) - ninja_target['ios_watchkit_extension'] = \ - old_spec.get('ios_watchkit_extension', 0) - ninja_target['ios_watchkit_app'] = old_spec.get('ios_watchkit_app', 0) - ninja_target['type'] = old_spec['type'] - if ninja_toplevel: - ninja_target['actions'] = [ - { - 'action_name': 'Compile and copy %s via ninja' % target_name, - 'inputs': [], - 'outputs': [], - 'action': [ - 'env', - 'PATH=%s' % os.environ['PATH'], - 'ninja', - '-C', - new_xcode_settings['CONFIGURATION_BUILD_DIR'], - target_name, - ], - 'message': 'Compile and copy %s via ninja' % target_name, - }, - ] - if jobs > 0: - ninja_target['actions'][0]['action'].extend(('-j', jobs)) - return ninja_target + """ Create fake target for xcode-ninja wrapper. """ + # Determine ninja top level build dir (e.g. /path/to/out). + ninja_toplevel = None + jobs = 0 + if params: + options = params["options"] + ninja_toplevel = os.path.join( + options.toplevel_dir, gyp.generator.ninja.ComputeOutputDir(params) + ) + jobs = params.get("generator_flags", {}).get("xcode_ninja_jobs", 0) + + target_name = old_spec.get("target_name") + product_name = old_spec.get("product_name", target_name) + product_extension = old_spec.get("product_extension") + + ninja_target = {} + ninja_target["target_name"] = target_name + ninja_target["product_name"] = product_name + if product_extension: + ninja_target["product_extension"] = product_extension + ninja_target["toolset"] = old_spec.get("toolset") + ninja_target["default_configuration"] = old_spec.get("default_configuration") + ninja_target["configurations"] = {} + + # Tell Xcode to look in |ninja_toplevel| for build products. + new_xcode_settings = {} + if ninja_toplevel: + new_xcode_settings["CONFIGURATION_BUILD_DIR"] = ( + "%s/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)" % ninja_toplevel + ) + + if "configurations" in old_spec: + for config in old_spec["configurations"]: + old_xcode_settings = old_spec["configurations"][config].get( + "xcode_settings", {} + ) + if "IPHONEOS_DEPLOYMENT_TARGET" in old_xcode_settings: + new_xcode_settings["CODE_SIGNING_REQUIRED"] = "NO" + new_xcode_settings["IPHONEOS_DEPLOYMENT_TARGET"] = old_xcode_settings[ + "IPHONEOS_DEPLOYMENT_TARGET" + ] + for key in ["BUNDLE_LOADER", "TEST_HOST"]: + if key in old_xcode_settings: + new_xcode_settings[key] = old_xcode_settings[key] + + ninja_target["configurations"][config] = {} + ninja_target["configurations"][config][ + "xcode_settings" + ] = new_xcode_settings + + ninja_target["mac_bundle"] = old_spec.get("mac_bundle", 0) + ninja_target["mac_xctest_bundle"] = old_spec.get("mac_xctest_bundle", 0) + ninja_target["ios_app_extension"] = old_spec.get("ios_app_extension", 0) + ninja_target["ios_watchkit_extension"] = old_spec.get("ios_watchkit_extension", 0) + ninja_target["ios_watchkit_app"] = old_spec.get("ios_watchkit_app", 0) + ninja_target["type"] = old_spec["type"] + if ninja_toplevel: + ninja_target["actions"] = [ + { + "action_name": "Compile and copy %s via ninja" % target_name, + "inputs": [], + "outputs": [], + "action": [ + "env", + "PATH=%s" % os.environ["PATH"], + "ninja", + "-C", + new_xcode_settings["CONFIGURATION_BUILD_DIR"], + target_name, + ], + "message": "Compile and copy %s via ninja" % target_name, + }, + ] + if jobs > 0: + ninja_target["actions"][0]["action"].extend(("-j", jobs)) + return ninja_target + def IsValidTargetForWrapper(target_extras, executable_target_pattern, spec): - """Limit targets for Xcode wrapper. + """Limit targets for Xcode wrapper. Xcode sometimes performs poorly with too many targets, so only include proper executable targets, with filters to customize. @@ -133,24 +144,27 @@ def IsValidTargetForWrapper(target_extras, executable_target_pattern, spec): executable_target_pattern: Regular expression limiting executable targets. spec: Specifications for target. """ - target_name = spec.get('target_name') - # Always include targets matching target_extras. - if target_extras is not None and re.search(target_extras, target_name): - return True - - # Otherwise just show executable targets. - if spec.get('type', '') == 'executable' and \ - spec.get('product_extension', '') != 'bundle': - - # If there is a filter and the target does not match, exclude the target. - if executable_target_pattern is not None: - if not re.search(executable_target_pattern, target_name): - return False - return True - return False + target_name = spec.get("target_name") + # Always include targets matching target_extras. + if target_extras is not None and re.search(target_extras, target_name): + return True + + # Otherwise just show executable targets and xc_tests. + if int(spec.get("mac_xctest_bundle", 0)) != 0 or ( + spec.get("type", "") == "executable" + and spec.get("product_extension", "") != "bundle" + ): + + # If there is a filter and the target does not match, exclude the target. + if executable_target_pattern is not None: + if not re.search(executable_target_pattern, target_name): + return False + return True + return False + def CreateWrapper(target_list, target_dicts, data, params): - """Initialize targets for the ninja wrapper. + """Initialize targets for the ninja wrapper. This sets up the necessary variables in the targets to generate Xcode projects that use ninja as an external builder. @@ -160,111 +174,129 @@ def CreateWrapper(target_list, target_dicts, data, params): data: Dict of flattened build files keyed on gyp path. params: Dict of global options for gyp. """ - orig_gyp = params['build_files'][0] - for gyp_name, gyp_dict in data.items(): - if gyp_name == orig_gyp: - depth = gyp_dict['_DEPTH'] - - # Check for custom main gyp name, otherwise use the default CHROMIUM_GYP_FILE - # and prepend .ninja before the .gyp extension. - generator_flags = params.get('generator_flags', {}) - main_gyp = generator_flags.get('xcode_ninja_main_gyp', None) - if main_gyp is None: - (build_file_root, build_file_ext) = os.path.splitext(orig_gyp) - main_gyp = build_file_root + ".ninja" + build_file_ext - - # Create new |target_list|, |target_dicts| and |data| data structures. - new_target_list = [] - new_target_dicts = {} - new_data = {} - - # Set base keys needed for |data|. - new_data[main_gyp] = {} - new_data[main_gyp]['included_files'] = [] - new_data[main_gyp]['targets'] = [] - new_data[main_gyp]['xcode_settings'] = \ - data[orig_gyp].get('xcode_settings', {}) - - # Normally the xcode-ninja generator includes only valid executable targets. - # If |xcode_ninja_executable_target_pattern| is set, that list is reduced to - # executable targets that match the pattern. (Default all) - executable_target_pattern = \ - generator_flags.get('xcode_ninja_executable_target_pattern', None) - - # For including other non-executable targets, add the matching target name - # to the |xcode_ninja_target_pattern| regular expression. (Default none) - target_extras = generator_flags.get('xcode_ninja_target_pattern', None) - - for old_qualified_target in target_list: - spec = target_dicts[old_qualified_target] - if IsValidTargetForWrapper(target_extras, executable_target_pattern, spec): - # Add to new_target_list. - target_name = spec.get('target_name') - new_target_name = '%s:%s#target' % (main_gyp, target_name) - new_target_list.append(new_target_name) - - # Add to new_target_dicts. - new_target_dicts[new_target_name] = _TargetFromSpec(spec, params) - - # Add to new_data. - for old_target in data[old_qualified_target.split(':')[0]]['targets']: - if old_target['target_name'] == target_name: - new_data_target = {} - new_data_target['target_name'] = old_target['target_name'] - new_data_target['toolset'] = old_target['toolset'] - new_data[main_gyp]['targets'].append(new_data_target) - - # Create sources target. - sources_target_name = 'sources_for_indexing' - sources_target = _TargetFromSpec( - { 'target_name' : sources_target_name, - 'toolset': 'target', - 'default_configuration': 'Default', - 'mac_bundle': '0', - 'type': 'executable' - }, None) - - # Tell Xcode to look everywhere for headers. - sources_target['configurations'] = {'Default': { 'include_dirs': [ depth ] } } - - sources = [] - for target, target_dict in target_dicts.items(): - base = os.path.dirname(target) - files = target_dict.get('sources', []) + \ - target_dict.get('mac_bundle_resources', []) - for action in target_dict.get('actions', []): - files.extend(action.get('inputs', [])) - # Remove files starting with $. These are mostly intermediate files for the - # build system. - files = [ file for file in files if not file.startswith('$')] - - # Make sources relative to root build file. - relative_path = os.path.dirname(main_gyp) - sources += [ os.path.relpath(os.path.join(base, file), relative_path) - for file in files ] - - sources_target['sources'] = sorted(set(sources)) - - # Put sources_to_index in it's own gyp. - sources_gyp = \ - os.path.join(os.path.dirname(main_gyp), sources_target_name + ".gyp") - fully_qualified_target_name = \ - '%s:%s#target' % (sources_gyp, sources_target_name) - - # Add to new_target_list, new_target_dicts and new_data. - new_target_list.append(fully_qualified_target_name) - new_target_dicts[fully_qualified_target_name] = sources_target - new_data_target = {} - new_data_target['target_name'] = sources_target['target_name'] - new_data_target['_DEPTH'] = depth - new_data_target['toolset'] = "target" - new_data[sources_gyp] = {} - new_data[sources_gyp]['targets'] = [] - new_data[sources_gyp]['included_files'] = [] - new_data[sources_gyp]['xcode_settings'] = \ - data[orig_gyp].get('xcode_settings', {}) - new_data[sources_gyp]['targets'].append(new_data_target) - - # Write workspace to file. - _WriteWorkspace(main_gyp, sources_gyp, params) - return (new_target_list, new_target_dicts, new_data) + orig_gyp = params["build_files"][0] + for gyp_name, gyp_dict in data.items(): + if gyp_name == orig_gyp: + depth = gyp_dict["_DEPTH"] + + # Check for custom main gyp name, otherwise use the default CHROMIUM_GYP_FILE + # and prepend .ninja before the .gyp extension. + generator_flags = params.get("generator_flags", {}) + main_gyp = generator_flags.get("xcode_ninja_main_gyp", None) + if main_gyp is None: + (build_file_root, build_file_ext) = os.path.splitext(orig_gyp) + main_gyp = build_file_root + ".ninja" + build_file_ext + + # Create new |target_list|, |target_dicts| and |data| data structures. + new_target_list = [] + new_target_dicts = {} + new_data = {} + + # Set base keys needed for |data|. + new_data[main_gyp] = {} + new_data[main_gyp]["included_files"] = [] + new_data[main_gyp]["targets"] = [] + new_data[main_gyp]["xcode_settings"] = data[orig_gyp].get("xcode_settings", {}) + + # Normally the xcode-ninja generator includes only valid executable targets. + # If |xcode_ninja_executable_target_pattern| is set, that list is reduced to + # executable targets that match the pattern. (Default all) + executable_target_pattern = generator_flags.get( + "xcode_ninja_executable_target_pattern", None + ) + + # For including other non-executable targets, add the matching target name + # to the |xcode_ninja_target_pattern| regular expression. (Default none) + target_extras = generator_flags.get("xcode_ninja_target_pattern", None) + + for old_qualified_target in target_list: + spec = target_dicts[old_qualified_target] + if IsValidTargetForWrapper(target_extras, executable_target_pattern, spec): + # Add to new_target_list. + target_name = spec.get("target_name") + new_target_name = "%s:%s#target" % (main_gyp, target_name) + new_target_list.append(new_target_name) + + # Add to new_target_dicts. + new_target_dicts[new_target_name] = _TargetFromSpec(spec, params) + + # Add to new_data. + for old_target in data[old_qualified_target.split(":")[0]]["targets"]: + if old_target["target_name"] == target_name: + new_data_target = {} + new_data_target["target_name"] = old_target["target_name"] + new_data_target["toolset"] = old_target["toolset"] + new_data[main_gyp]["targets"].append(new_data_target) + + # Create sources target. + sources_target_name = "sources_for_indexing" + sources_target = _TargetFromSpec( + { + "target_name": sources_target_name, + "toolset": "target", + "default_configuration": "Default", + "mac_bundle": "0", + "type": "executable", + }, + None, + ) + + # Tell Xcode to look everywhere for headers. + sources_target["configurations"] = {"Default": {"include_dirs": [depth]}} + + # Put excluded files into the sources target so they can be opened in Xcode. + skip_excluded_files = not generator_flags.get( + "xcode_ninja_list_excluded_files", True + ) + + sources = [] + for target, target_dict in target_dicts.items(): + base = os.path.dirname(target) + files = target_dict.get("sources", []) + target_dict.get( + "mac_bundle_resources", [] + ) + + if not skip_excluded_files: + files.extend( + target_dict.get("sources_excluded", []) + + target_dict.get("mac_bundle_resources_excluded", []) + ) + + for action in target_dict.get("actions", []): + files.extend(action.get("inputs", [])) + + if not skip_excluded_files: + files.extend(action.get("inputs_excluded", [])) + + # Remove files starting with $. These are mostly intermediate files for the + # build system. + files = [file for file in files if not file.startswith("$")] + + # Make sources relative to root build file. + relative_path = os.path.dirname(main_gyp) + sources += [ + os.path.relpath(os.path.join(base, file), relative_path) for file in files + ] + + sources_target["sources"] = sorted(set(sources)) + + # Put sources_to_index in it's own gyp. + sources_gyp = os.path.join(os.path.dirname(main_gyp), sources_target_name + ".gyp") + fully_qualified_target_name = "%s:%s#target" % (sources_gyp, sources_target_name) + + # Add to new_target_list, new_target_dicts and new_data. + new_target_list.append(fully_qualified_target_name) + new_target_dicts[fully_qualified_target_name] = sources_target + new_data_target = {} + new_data_target["target_name"] = sources_target["target_name"] + new_data_target["_DEPTH"] = depth + new_data_target["toolset"] = "target" + new_data[sources_gyp] = {} + new_data[sources_gyp]["targets"] = [] + new_data[sources_gyp]["included_files"] = [] + new_data[sources_gyp]["xcode_settings"] = data[orig_gyp].get("xcode_settings", {}) + new_data[sources_gyp]["targets"].append(new_data_target) + + # Write workspace to file. + _WriteWorkspace(main_gyp, sources_gyp, params) + return (new_target_list, new_target_dicts, new_data) diff --git a/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/xcodeproj_file.py b/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/xcodeproj_file.py index 93ffca7c901561..cde4f055f96320 100644 --- a/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/xcodeproj_file.py +++ b/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/xcodeproj_file.py @@ -145,11 +145,12 @@ import sys try: - basestring, cmp, unicode + basestring, cmp, unicode except NameError: # Python 3 - basestring = unicode = str - def cmp(x, y): - return (x > y) - (x < y) + basestring = unicode = str + + def cmp(x, y): + return (x > y) - (x < y) # See XCObject._EncodeString. This pattern is used to determine when a string @@ -158,11 +159,11 @@ def cmp(x, y): # transformed to be properly encoded. Note that this expression matches the # characters listed with "+", for 1 or more occurrences: if a string is empty, # it must not match this pattern, because it needs to be encoded as "". -_unquoted = re.compile('^[A-Za-z0-9$./_]+$') +_unquoted = re.compile("^[A-Za-z0-9$./_]+$") # Strings that match this pattern are quoted regardless of what _unquoted says. # Oddly, Xcode will quote any string with a run of three or more underscores. -_quoted = re.compile('___') +_quoted = re.compile("___") # This pattern should match any character that needs to be escaped by # XCObject._EncodeString. See that function. @@ -170,10 +171,11 @@ def cmp(x, y): # Used by SourceTreeAndPathFromPath -_path_leading_variable = re.compile(r'^\$\((.*?)\)(/(.*))?$') +_path_leading_variable = re.compile(r"^\$\((.*?)\)(/(.*))?$") + def SourceTreeAndPathFromPath(input_path): - """Given input_path, returns a tuple with sourceTree and path values. + """Given input_path, returns a tuple with sourceTree and path values. Examples: input_path (source_tree, output_path) @@ -182,21 +184,23 @@ def SourceTreeAndPathFromPath(input_path): 'path' (None, 'path') """ - source_group_match = _path_leading_variable.match(input_path) - if source_group_match: - source_tree = source_group_match.group(1) - output_path = source_group_match.group(3) # This may be None. - else: - source_tree = None - output_path = input_path + source_group_match = _path_leading_variable.match(input_path) + if source_group_match: + source_tree = source_group_match.group(1) + output_path = source_group_match.group(3) # This may be None. + else: + source_tree = None + output_path = input_path + + return (source_tree, output_path) - return (source_tree, output_path) def ConvertVariablesToShellSyntax(input_string): - return re.sub(r'\$\((.*?)\)', '${\\1}', input_string) + return re.sub(r"\$\((.*?)\)", "${\\1}", input_string) + class XCObject(object): - """The abstract base of all class types used in Xcode project files. + """The abstract base of all class types used in Xcode project files. Class variables: _schema: A dictionary defining the properties of this class. The keys to @@ -263,45 +267,45 @@ class XCObject(object): described by its class' _schema variable. """ - _schema = {} - _should_print_single_line = False - - # See _EncodeString. - _encode_transforms = [] - i = 0 - while i < ord(' '): - _encode_transforms.append('\\U%04x' % i) - i = i + 1 - _encode_transforms[7] = '\\a' - _encode_transforms[8] = '\\b' - _encode_transforms[9] = '\\t' - _encode_transforms[10] = '\\n' - _encode_transforms[11] = '\\v' - _encode_transforms[12] = '\\f' - _encode_transforms[13] = '\\n' - - _alternate_encode_transforms = list(_encode_transforms) - _alternate_encode_transforms[9] = chr(9) - _alternate_encode_transforms[10] = chr(10) - _alternate_encode_transforms[11] = chr(11) - - def __init__(self, properties=None, id=None, parent=None): - self.id = id - self.parent = parent - self._properties = {} - self._hashables = [] - self._SetDefaultsFromSchema() - self.UpdateProperties(properties) - - def __repr__(self): - try: - name = self.Name() - except NotImplementedError: - return '<%s at 0x%x>' % (self.__class__.__name__, id(self)) - return '<%s %r at 0x%x>' % (self.__class__.__name__, name, id(self)) - - def Copy(self): - """Make a copy of this object. + _schema = {} + _should_print_single_line = False + + # See _EncodeString. + _encode_transforms = [] + i = 0 + while i < ord(" "): + _encode_transforms.append("\\U%04x" % i) + i = i + 1 + _encode_transforms[7] = "\\a" + _encode_transforms[8] = "\\b" + _encode_transforms[9] = "\\t" + _encode_transforms[10] = "\\n" + _encode_transforms[11] = "\\v" + _encode_transforms[12] = "\\f" + _encode_transforms[13] = "\\n" + + _alternate_encode_transforms = list(_encode_transforms) + _alternate_encode_transforms[9] = chr(9) + _alternate_encode_transforms[10] = chr(10) + _alternate_encode_transforms[11] = chr(11) + + def __init__(self, properties=None, id=None, parent=None): + self.id = id + self.parent = parent + self._properties = {} + self._hashables = [] + self._SetDefaultsFromSchema() + self.UpdateProperties(properties) + + def __repr__(self): + try: + name = self.Name() + except NotImplementedError: + return "<%s at 0x%x>" % (self.__class__.__name__, id(self)) + return "<%s %r at 0x%x>" % (self.__class__.__name__, name, id(self)) + + def Copy(self): + """Make a copy of this object. The new object will have its own copy of lists and dicts. Any XCObject objects owned by this object (marked "strong") will be copied in the @@ -310,62 +314,70 @@ def Copy(self): object without making a copy. """ - that = self.__class__(id=self.id, parent=self.parent) - for key, value in self._properties.items(): - is_strong = self._schema[key][2] - - if isinstance(value, XCObject): - if is_strong: - new_value = value.Copy() - new_value.parent = that - that._properties[key] = new_value - else: - that._properties[key] = value - elif isinstance(value, (basestring, int)): - that._properties[key] = value - elif isinstance(value, list): - if is_strong: - # If is_strong is True, each element is an XCObject, so it's safe to - # call Copy. - that._properties[key] = [] - for item in value: - new_item = item.Copy() - new_item.parent = that - that._properties[key].append(new_item) - else: - that._properties[key] = value[:] - elif isinstance(value, dict): - # dicts are never strong. - if is_strong: - raise TypeError('Strong dict for key ' + key + ' in ' + \ - self.__class__.__name__) - else: - that._properties[key] = value.copy() - else: - raise TypeError('Unexpected type ' + value.__class__.__name__ + \ - ' for key ' + key + ' in ' + self.__class__.__name__) - - return that - - def Name(self): - """Return the name corresponding to an object. + that = self.__class__(id=self.id, parent=self.parent) + for key, value in self._properties.items(): + is_strong = self._schema[key][2] + + if isinstance(value, XCObject): + if is_strong: + new_value = value.Copy() + new_value.parent = that + that._properties[key] = new_value + else: + that._properties[key] = value + elif isinstance(value, (basestring, int)): + that._properties[key] = value + elif isinstance(value, list): + if is_strong: + # If is_strong is True, each element is an XCObject, so it's safe to + # call Copy. + that._properties[key] = [] + for item in value: + new_item = item.Copy() + new_item.parent = that + that._properties[key].append(new_item) + else: + that._properties[key] = value[:] + elif isinstance(value, dict): + # dicts are never strong. + if is_strong: + raise TypeError( + "Strong dict for key " + key + " in " + self.__class__.__name__ + ) + else: + that._properties[key] = value.copy() + else: + raise TypeError( + "Unexpected type " + + value.__class__.__name__ + + " for key " + + key + + " in " + + self.__class__.__name__ + ) + + return that + + def Name(self): + """Return the name corresponding to an object. Not all objects necessarily need to be nameable, and not all that do have a "name" property. Override as needed. """ - # If the schema indicates that "name" is required, try to access the - # property even if it doesn't exist. This will result in a KeyError - # being raised for the property that should be present, which seems more - # appropriate than NotImplementedError in this case. - if 'name' in self._properties or \ - ('name' in self._schema and self._schema['name'][3]): - return self._properties['name'] + # If the schema indicates that "name" is required, try to access the + # property even if it doesn't exist. This will result in a KeyError + # being raised for the property that should be present, which seems more + # appropriate than NotImplementedError in this case. + if "name" in self._properties or ( + "name" in self._schema and self._schema["name"][3] + ): + return self._properties["name"] - raise NotImplementedError(self.__class__.__name__ + ' must implement Name') + raise NotImplementedError(self.__class__.__name__ + " must implement Name") - def Comment(self): - """Return a comment string for the object. + def Comment(self): + """Return a comment string for the object. Most objects just use their name as the comment, but PBXProject uses different values. @@ -374,24 +386,24 @@ def Comment(self): strings applied to it. """ - return self.Name() + return self.Name() - def Hashables(self): - hashables = [self.__class__.__name__] + def Hashables(self): + hashables = [self.__class__.__name__] - name = self.Name() - if name != None: - hashables.append(name) + name = self.Name() + if name is not None: + hashables.append(name) - hashables.extend(self._hashables) + hashables.extend(self._hashables) - return hashables + return hashables - def HashablesForChild(self): - return None + def HashablesForChild(self): + return None - def ComputeIDs(self, recursive=True, overwrite=True, seed_hash=None): - """Set "id" properties deterministically. + def ComputeIDs(self, recursive=True, overwrite=True, seed_hash=None): + """Set "id" properties deterministically. An object's "id" property is set based on a hash of its class type and name, as well as the class type and name of all ancestor objects. As @@ -405,8 +417,8 @@ def ComputeIDs(self, recursive=True, overwrite=True, seed_hash=None): replaced. """ - def _HashUpdate(hash, data): - """Update hash with data's length and contents. + def _HashUpdate(hash, data): + """Update hash with data's length and contents. If the hash were updated only with the value of data, it would be possible for clowns to induce collisions by manipulating the names of @@ -414,161 +426,166 @@ def _HashUpdate(hash, data): ID collisions will be encountered, intentionally or not. """ - hash.update(struct.pack('>i', len(data))) - hash.update(data) - - if seed_hash is None: - seed_hash = hashlib.sha1() - - hash = seed_hash.copy() - - hashables = self.Hashables() - assert len(hashables) > 0 - for hashable in hashables: - _HashUpdate(hash, hashable) - - if recursive: - hashables_for_child = self.HashablesForChild() - if hashables_for_child is None: - child_hash = hash - else: - assert len(hashables_for_child) > 0 - child_hash = seed_hash.copy() - for hashable in hashables_for_child: - _HashUpdate(child_hash, hashable) - - for child in self.Children(): - child.ComputeIDs(recursive, overwrite, child_hash) - - if overwrite or self.id is None: - # Xcode IDs are only 96 bits (24 hex characters), but a SHA-1 digest is - # is 160 bits. Instead of throwing out 64 bits of the digest, xor them - # into the portion that gets used. - assert hash.digest_size % 4 == 0 - digest_int_count = hash.digest_size / 4 - digest_ints = struct.unpack('>' + 'I' * digest_int_count, hash.digest()) - id_ints = [0, 0, 0] - for index in range(0, digest_int_count): - id_ints[index % 3] ^= digest_ints[index] - self.id = '%08X%08X%08X' % tuple(id_ints) - - def EnsureNoIDCollisions(self): - """Verifies that no two objects have the same ID. Checks all descendants. + hash.update(struct.pack(">i", len(data))) + hash.update(data) + + if seed_hash is None: + seed_hash = hashlib.sha1() + + hash = seed_hash.copy() + + hashables = self.Hashables() + assert len(hashables) > 0 + for hashable in hashables: + _HashUpdate(hash, hashable) + + if recursive: + hashables_for_child = self.HashablesForChild() + if hashables_for_child is None: + child_hash = hash + else: + assert len(hashables_for_child) > 0 + child_hash = seed_hash.copy() + for hashable in hashables_for_child: + _HashUpdate(child_hash, hashable) + + for child in self.Children(): + child.ComputeIDs(recursive, overwrite, child_hash) + + if overwrite or self.id is None: + # Xcode IDs are only 96 bits (24 hex characters), but a SHA-1 digest is + # is 160 bits. Instead of throwing out 64 bits of the digest, xor them + # into the portion that gets used. + assert hash.digest_size % 4 == 0 + digest_int_count = hash.digest_size // 4 + digest_ints = struct.unpack(">" + "I" * digest_int_count, hash.digest()) + id_ints = [0, 0, 0] + for index in range(0, digest_int_count): + id_ints[index % 3] ^= digest_ints[index] + self.id = "%08X%08X%08X" % tuple(id_ints) + + def EnsureNoIDCollisions(self): + """Verifies that no two objects have the same ID. Checks all descendants. """ - ids = {} - descendants = self.Descendants() - for descendant in descendants: - if descendant.id in ids: - other = ids[descendant.id] - raise KeyError( - 'Duplicate ID %s, objects "%s" and "%s" in "%s"' % \ - (descendant.id, str(descendant._properties), - str(other._properties), self._properties['rootObject'].Name())) - ids[descendant.id] = descendant - - def Children(self): - """Returns a list of all of this object's owned (strong) children.""" - - children = [] - for property, attributes in self._schema.items(): - (is_list, property_type, is_strong) = attributes[0:3] - if is_strong and property in self._properties: - if not is_list: - children.append(self._properties[property]) - else: - children.extend(self._properties[property]) - return children - - def Descendants(self): - """Returns a list of all of this object's descendants, including this + ids = {} + descendants = self.Descendants() + for descendant in descendants: + if descendant.id in ids: + other = ids[descendant.id] + raise KeyError( + 'Duplicate ID %s, objects "%s" and "%s" in "%s"' + % ( + descendant.id, + str(descendant._properties), + str(other._properties), + self._properties["rootObject"].Name(), + ) + ) + ids[descendant.id] = descendant + + def Children(self): + """Returns a list of all of this object's owned (strong) children.""" + + children = [] + for property, attributes in self._schema.items(): + (is_list, property_type, is_strong) = attributes[0:3] + if is_strong and property in self._properties: + if not is_list: + children.append(self._properties[property]) + else: + children.extend(self._properties[property]) + return children + + def Descendants(self): + """Returns a list of all of this object's descendants, including this object. """ - children = self.Children() - descendants = [self] - for child in children: - descendants.extend(child.Descendants()) - return descendants + children = self.Children() + descendants = [self] + for child in children: + descendants.extend(child.Descendants()) + return descendants - def PBXProjectAncestor(self): - # The base case for recursion is defined at PBXProject.PBXProjectAncestor. - if self.parent: - return self.parent.PBXProjectAncestor() - return None + def PBXProjectAncestor(self): + # The base case for recursion is defined at PBXProject.PBXProjectAncestor. + if self.parent: + return self.parent.PBXProjectAncestor() + return None - def _EncodeComment(self, comment): - """Encodes a comment to be placed in the project file output, mimicing + def _EncodeComment(self, comment): + """Encodes a comment to be placed in the project file output, mimicing Xcode behavior. """ - # This mimics Xcode behavior by wrapping the comment in "/*" and "*/". If - # the string already contains a "*/", it is turned into "(*)/". This keeps - # the file writer from outputting something that would be treated as the - # end of a comment in the middle of something intended to be entirely a - # comment. - - return '/* ' + comment.replace('*/', '(*)/') + ' */' - - def _EncodeTransform(self, match): - # This function works closely with _EncodeString. It will only be called - # by re.sub with match.group(0) containing a character matched by the - # the _escaped expression. - char = match.group(0) - - # Backslashes (\) and quotation marks (") are always replaced with a - # backslash-escaped version of the same. Everything else gets its - # replacement from the class' _encode_transforms array. - if char == '\\': - return '\\\\' - if char == '"': - return '\\"' - return self._encode_transforms[ord(char)] - - def _EncodeString(self, value): - """Encodes a string to be placed in the project file output, mimicing + # This mimics Xcode behavior by wrapping the comment in "/*" and "*/". If + # the string already contains a "*/", it is turned into "(*)/". This keeps + # the file writer from outputting something that would be treated as the + # end of a comment in the middle of something intended to be entirely a + # comment. + + return "/* " + comment.replace("*/", "(*)/") + " */" + + def _EncodeTransform(self, match): + # This function works closely with _EncodeString. It will only be called + # by re.sub with match.group(0) containing a character matched by the + # the _escaped expression. + char = match.group(0) + + # Backslashes (\) and quotation marks (") are always replaced with a + # backslash-escaped version of the same. Everything else gets its + # replacement from the class' _encode_transforms array. + if char == "\\": + return "\\\\" + if char == '"': + return '\\"' + return self._encode_transforms[ord(char)] + + def _EncodeString(self, value): + """Encodes a string to be placed in the project file output, mimicing Xcode behavior. """ - # Use quotation marks when any character outside of the range A-Z, a-z, 0-9, - # $ (dollar sign), . (period), and _ (underscore) is present. Also use - # quotation marks to represent empty strings. - # - # Escape " (double-quote) and \ (backslash) by preceding them with a - # backslash. - # - # Some characters below the printable ASCII range are encoded specially: - # 7 ^G BEL is encoded as "\a" - # 8 ^H BS is encoded as "\b" - # 11 ^K VT is encoded as "\v" - # 12 ^L NP is encoded as "\f" - # 127 ^? DEL is passed through as-is without escaping - # - In PBXFileReference and PBXBuildFile objects: - # 9 ^I HT is passed through as-is without escaping - # 10 ^J NL is passed through as-is without escaping - # 13 ^M CR is passed through as-is without escaping - # - In other objects: - # 9 ^I HT is encoded as "\t" - # 10 ^J NL is encoded as "\n" - # 13 ^M CR is encoded as "\n" rendering it indistinguishable from - # 10 ^J NL - # All other characters within the ASCII control character range (0 through - # 31 inclusive) are encoded as "\U001f" referring to the Unicode code point - # in hexadecimal. For example, character 14 (^N SO) is encoded as "\U000e". - # Characters above the ASCII range are passed through to the output encoded - # as UTF-8 without any escaping. These mappings are contained in the - # class' _encode_transforms list. - - if _unquoted.search(value) and not _quoted.search(value): - return value - - return '"' + _escaped.sub(self._EncodeTransform, value) + '"' - - def _XCPrint(self, file, tabs, line): - file.write('\t' * tabs + line) - - def _XCPrintableValue(self, tabs, value, flatten_list=False): - """Returns a representation of value that may be printed in a project file, + # Use quotation marks when any character outside of the range A-Z, a-z, 0-9, + # $ (dollar sign), . (period), and _ (underscore) is present. Also use + # quotation marks to represent empty strings. + # + # Escape " (double-quote) and \ (backslash) by preceding them with a + # backslash. + # + # Some characters below the printable ASCII range are encoded specially: + # 7 ^G BEL is encoded as "\a" + # 8 ^H BS is encoded as "\b" + # 11 ^K VT is encoded as "\v" + # 12 ^L NP is encoded as "\f" + # 127 ^? DEL is passed through as-is without escaping + # - In PBXFileReference and PBXBuildFile objects: + # 9 ^I HT is passed through as-is without escaping + # 10 ^J NL is passed through as-is without escaping + # 13 ^M CR is passed through as-is without escaping + # - In other objects: + # 9 ^I HT is encoded as "\t" + # 10 ^J NL is encoded as "\n" + # 13 ^M CR is encoded as "\n" rendering it indistinguishable from + # 10 ^J NL + # All other characters within the ASCII control character range (0 through + # 31 inclusive) are encoded as "\U001f" referring to the Unicode code point + # in hexadecimal. For example, character 14 (^N SO) is encoded as "\U000e". + # Characters above the ASCII range are passed through to the output encoded + # as UTF-8 without any escaping. These mappings are contained in the + # class' _encode_transforms list. + + if _unquoted.search(value) and not _quoted.search(value): + return value + + return '"' + _escaped.sub(self._EncodeTransform, value) + '"' + + def _XCPrint(self, file, tabs, line): + file.write("\t" * tabs + line) + + def _XCPrintableValue(self, tabs, value, flatten_list=False): + """Returns a representation of value that may be printed in a project file, mimicing Xcode's behavior. _XCPrintableValue can handle str and int values, XCObjects (which are @@ -582,58 +599,65 @@ def _XCPrintableValue(self, tabs, value, flatten_list=False): strings. """ - printable = '' - comment = None + printable = "" + comment = None - if self._should_print_single_line: - sep = ' ' - element_tabs = '' - end_tabs = '' - else: - sep = '\n' - element_tabs = '\t' * (tabs + 1) - end_tabs = '\t' * tabs - - if isinstance(value, XCObject): - printable += value.id - comment = value.Comment() - elif isinstance(value, str): - printable += self._EncodeString(value) - elif isinstance(value, unicode): - printable += self._EncodeString(value.encode('utf-8')) - elif isinstance(value, int): - printable += str(value) - elif isinstance(value, list): - if flatten_list and len(value) <= 1: - if len(value) == 0: - printable += self._EncodeString('') + if self._should_print_single_line: + sep = " " + element_tabs = "" + end_tabs = "" else: - printable += self._EncodeString(value[0]) - else: - printable = '(' + sep - for item in value: - printable += element_tabs + \ - self._XCPrintableValue(tabs + 1, item, flatten_list) + \ - ',' + sep - printable += end_tabs + ')' - elif isinstance(value, dict): - printable = '{' + sep - for item_key, item_value in sorted(value.items()): - printable += element_tabs + \ - self._XCPrintableValue(tabs + 1, item_key, flatten_list) + ' = ' + \ - self._XCPrintableValue(tabs + 1, item_value, flatten_list) + ';' + \ - sep - printable += end_tabs + '}' - else: - raise TypeError("Can't make " + value.__class__.__name__ + ' printable') + sep = "\n" + element_tabs = "\t" * (tabs + 1) + end_tabs = "\t" * tabs + + if isinstance(value, XCObject): + printable += value.id + comment = value.Comment() + elif isinstance(value, str): + printable += self._EncodeString(value) + elif isinstance(value, basestring): + printable += self._EncodeString(value.encode("utf-8")) + elif isinstance(value, int): + printable += str(value) + elif isinstance(value, list): + if flatten_list and len(value) <= 1: + if len(value) == 0: + printable += self._EncodeString("") + else: + printable += self._EncodeString(value[0]) + else: + printable = "(" + sep + for item in value: + printable += ( + element_tabs + + self._XCPrintableValue(tabs + 1, item, flatten_list) + + "," + + sep + ) + printable += end_tabs + ")" + elif isinstance(value, dict): + printable = "{" + sep + for item_key, item_value in sorted(value.items()): + printable += ( + element_tabs + + self._XCPrintableValue(tabs + 1, item_key, flatten_list) + + " = " + + self._XCPrintableValue(tabs + 1, item_value, flatten_list) + + ";" + + sep + ) + printable += end_tabs + "}" + else: + raise TypeError("Can't make " + value.__class__.__name__ + " printable") - if comment != None: - printable += ' ' + self._EncodeComment(comment) + if comment: + printable += " " + self._EncodeComment(comment) - return printable + return printable - def _XCKVPrint(self, file, tabs, key, value): - """Prints a key and value, members of an XCObject's _properties dictionary, + def _XCKVPrint(self, file, tabs, key, value): + """Prints a key and value, members of an XCObject's _properties dictionary, to file. tabs is an int identifying the indentation level. If the class' @@ -641,99 +665,100 @@ def _XCKVPrint(self, file, tabs, key, value): key-value pair will be followed by a space insead of a newline. """ - if self._should_print_single_line: - printable = '' - after_kv = ' ' - else: - printable = '\t' * tabs - after_kv = '\n' - - # Xcode usually prints remoteGlobalIDString values in PBXContainerItemProxy - # objects without comments. Sometimes it prints them with comments, but - # the majority of the time, it doesn't. To avoid unnecessary changes to - # the project file after Xcode opens it, don't write comments for - # remoteGlobalIDString. This is a sucky hack and it would certainly be - # cleaner to extend the schema to indicate whether or not a comment should - # be printed, but since this is the only case where the problem occurs and - # Xcode itself can't seem to make up its mind, the hack will suffice. - # - # Also see PBXContainerItemProxy._schema['remoteGlobalIDString']. - if key == 'remoteGlobalIDString' and isinstance(self, - PBXContainerItemProxy): - value_to_print = value.id - else: - value_to_print = value + if self._should_print_single_line: + printable = "" + after_kv = " " + else: + printable = "\t" * tabs + after_kv = "\n" + + # Xcode usually prints remoteGlobalIDString values in PBXContainerItemProxy + # objects without comments. Sometimes it prints them with comments, but + # the majority of the time, it doesn't. To avoid unnecessary changes to + # the project file after Xcode opens it, don't write comments for + # remoteGlobalIDString. This is a sucky hack and it would certainly be + # cleaner to extend the schema to indicate whether or not a comment should + # be printed, but since this is the only case where the problem occurs and + # Xcode itself can't seem to make up its mind, the hack will suffice. + # + # Also see PBXContainerItemProxy._schema['remoteGlobalIDString']. + if key == "remoteGlobalIDString" and isinstance(self, PBXContainerItemProxy): + value_to_print = value.id + else: + value_to_print = value - # PBXBuildFile's settings property is represented in the output as a dict, - # but a hack here has it represented as a string. Arrange to strip off the - # quotes so that it shows up in the output as expected. - if key == 'settings' and isinstance(self, PBXBuildFile): - strip_value_quotes = True - else: - strip_value_quotes = False + # PBXBuildFile's settings property is represented in the output as a dict, + # but a hack here has it represented as a string. Arrange to strip off the + # quotes so that it shows up in the output as expected. + if key == "settings" and isinstance(self, PBXBuildFile): + strip_value_quotes = True + else: + strip_value_quotes = False - # In another one-off, let's set flatten_list on buildSettings properties - # of XCBuildConfiguration objects, because that's how Xcode treats them. - if key == 'buildSettings' and isinstance(self, XCBuildConfiguration): - flatten_list = True - else: - flatten_list = False - - try: - printable_key = self._XCPrintableValue(tabs, key, flatten_list) - printable_value = self._XCPrintableValue(tabs, value_to_print, - flatten_list) - if strip_value_quotes and len(printable_value) > 1 and \ - printable_value[0] == '"' and printable_value[-1] == '"': - printable_value = printable_value[1:-1] - printable += printable_key + ' = ' + printable_value + ';' + after_kv - except TypeError as e: - gyp.common.ExceptionAppend(e, - 'while printing key "%s"' % key) - raise - - self._XCPrint(file, 0, printable) - - def Print(self, file=sys.stdout): - """Prints a reprentation of this object to file, adhering to Xcode output + # In another one-off, let's set flatten_list on buildSettings properties + # of XCBuildConfiguration objects, because that's how Xcode treats them. + if key == "buildSettings" and isinstance(self, XCBuildConfiguration): + flatten_list = True + else: + flatten_list = False + + try: + printable_key = self._XCPrintableValue(tabs, key, flatten_list) + printable_value = self._XCPrintableValue(tabs, value_to_print, flatten_list) + if ( + strip_value_quotes + and len(printable_value) > 1 + and printable_value[0] == '"' + and printable_value[-1] == '"' + ): + printable_value = printable_value[1:-1] + printable += printable_key + " = " + printable_value + ";" + after_kv + except TypeError as e: + gyp.common.ExceptionAppend(e, 'while printing key "%s"' % key) + raise + + self._XCPrint(file, 0, printable) + + def Print(self, file=sys.stdout): + """Prints a reprentation of this object to file, adhering to Xcode output formatting. """ - self.VerifyHasRequiredProperties() - - if self._should_print_single_line: - # When printing an object in a single line, Xcode doesn't put any space - # between the beginning of a dictionary (or presumably a list) and the - # first contained item, so you wind up with snippets like - # ...CDEF = {isa = PBXFileReference; fileRef = 0123... - # If it were me, I would have put a space in there after the opening - # curly, but I guess this is just another one of those inconsistencies - # between how Xcode prints PBXFileReference and PBXBuildFile objects as - # compared to other objects. Mimic Xcode's behavior here by using an - # empty string for sep. - sep = '' - end_tabs = 0 - else: - sep = '\n' - end_tabs = 2 + self.VerifyHasRequiredProperties() + + if self._should_print_single_line: + # When printing an object in a single line, Xcode doesn't put any space + # between the beginning of a dictionary (or presumably a list) and the + # first contained item, so you wind up with snippets like + # ...CDEF = {isa = PBXFileReference; fileRef = 0123... + # If it were me, I would have put a space in there after the opening + # curly, but I guess this is just another one of those inconsistencies + # between how Xcode prints PBXFileReference and PBXBuildFile objects as + # compared to other objects. Mimic Xcode's behavior here by using an + # empty string for sep. + sep = "" + end_tabs = 0 + else: + sep = "\n" + end_tabs = 2 - # Start the object. For example, '\t\tPBXProject = {\n'. - self._XCPrint(file, 2, self._XCPrintableValue(2, self) + ' = {' + sep) + # Start the object. For example, '\t\tPBXProject = {\n'. + self._XCPrint(file, 2, self._XCPrintableValue(2, self) + " = {" + sep) - # "isa" isn't in the _properties dictionary, it's an intrinsic property - # of the class which the object belongs to. Xcode always outputs "isa" - # as the first element of an object dictionary. - self._XCKVPrint(file, 3, 'isa', self.__class__.__name__) + # "isa" isn't in the _properties dictionary, it's an intrinsic property + # of the class which the object belongs to. Xcode always outputs "isa" + # as the first element of an object dictionary. + self._XCKVPrint(file, 3, "isa", self.__class__.__name__) - # The remaining elements of an object dictionary are sorted alphabetically. - for property, value in sorted(self._properties.items()): - self._XCKVPrint(file, 3, property, value) + # The remaining elements of an object dictionary are sorted alphabetically. + for property, value in sorted(self._properties.items()): + self._XCKVPrint(file, 3, property, value) - # End the object. - self._XCPrint(file, end_tabs, '};\n') + # End the object. + self._XCPrint(file, end_tabs, "};\n") - def UpdateProperties(self, properties, do_copy=False): - """Merge the supplied properties into the _properties dictionary. + def UpdateProperties(self, properties, do_copy=False): + """Merge the supplied properties into the _properties dictionary. The input properties must adhere to the class schema or a KeyError or TypeError exception will be raised. If adding an object of an XCObject @@ -745,206 +770,244 @@ def UpdateProperties(self, properties, do_copy=False): references added. """ - if properties is None: - return - - for property, value in properties.items(): - # Make sure the property is in the schema. - if not property in self._schema: - raise KeyError(property + ' not in ' + self.__class__.__name__) - - # Make sure the property conforms to the schema. - (is_list, property_type, is_strong) = self._schema[property][0:3] - if is_list: - if value.__class__ != list: - raise TypeError( - property + ' of ' + self.__class__.__name__ + \ - ' must be list, not ' + value.__class__.__name__) - for item in value: - if not isinstance(item, property_type) and \ - not (item.__class__ == unicode and property_type == str): - # Accept unicode where str is specified. str is treated as - # UTF-8-encoded. - raise TypeError( - 'item of ' + property + ' of ' + self.__class__.__name__ + \ - ' must be ' + property_type.__name__ + ', not ' + \ - item.__class__.__name__) - elif not isinstance(value, property_type) and \ - not (value.__class__ == unicode and property_type == str): - # Accept unicode where str is specified. str is treated as - # UTF-8-encoded. - raise TypeError( - property + ' of ' + self.__class__.__name__ + ' must be ' + \ - property_type.__name__ + ', not ' + value.__class__.__name__) - - # Checks passed, perform the assignment. - if do_copy: - if isinstance(value, XCObject): - if is_strong: - self._properties[property] = value.Copy() - else: - self._properties[property] = value - elif isinstance(value, (basestring, int)): - self._properties[property] = value - elif isinstance(value, list): - if is_strong: - # If is_strong is True, each element is an XCObject, so it's safe - # to call Copy. - self._properties[property] = [] - for item in value: - self._properties[property].append(item.Copy()) - else: - self._properties[property] = value[:] - elif isinstance(value, dict): - self._properties[property] = value.copy() - else: - raise TypeError("Don't know how to copy a " + \ - value.__class__.__name__ + ' object for ' + \ - property + ' in ' + self.__class__.__name__) - else: - self._properties[property] = value - - # Set up the child's back-reference to this object. Don't use |value| - # any more because it may not be right if do_copy is true. - if is_strong: + if properties is None: + return + + for property, value in properties.items(): + # Make sure the property is in the schema. + if property not in self._schema: + raise KeyError(property + " not in " + self.__class__.__name__) + + # Make sure the property conforms to the schema. + (is_list, property_type, is_strong) = self._schema[property][0:3] + if is_list: + if value.__class__ != list: + raise TypeError( + property + + " of " + + self.__class__.__name__ + + " must be list, not " + + value.__class__.__name__ + ) + for item in value: + if not isinstance(item, property_type) and not ( + isinstance(item, basestring) and property_type == str + ): + # Accept unicode where str is specified. str is treated as + # UTF-8-encoded. + raise TypeError( + "item of " + + property + + " of " + + self.__class__.__name__ + + " must be " + + property_type.__name__ + + ", not " + + item.__class__.__name__ + ) + elif not isinstance(value, property_type) and not ( + isinstance(value, basestring) and property_type == str + ): + # Accept unicode where str is specified. str is treated as + # UTF-8-encoded. + raise TypeError( + property + + " of " + + self.__class__.__name__ + + " must be " + + property_type.__name__ + + ", not " + + value.__class__.__name__ + ) + + # Checks passed, perform the assignment. + if do_copy: + if isinstance(value, XCObject): + if is_strong: + self._properties[property] = value.Copy() + else: + self._properties[property] = value + elif isinstance(value, (basestring, int)): + self._properties[property] = value + elif isinstance(value, list): + if is_strong: + # If is_strong is True, each element is an XCObject, so it's safe + # to call Copy. + self._properties[property] = [] + for item in value: + self._properties[property].append(item.Copy()) + else: + self._properties[property] = value[:] + elif isinstance(value, dict): + self._properties[property] = value.copy() + else: + raise TypeError( + "Don't know how to copy a " + + value.__class__.__name__ + + " object for " + + property + + " in " + + self.__class__.__name__ + ) + else: + self._properties[property] = value + + # Set up the child's back-reference to this object. Don't use |value| + # any more because it may not be right if do_copy is true. + if is_strong: + if not is_list: + self._properties[property].parent = self + else: + for item in self._properties[property]: + item.parent = self + + def HasProperty(self, key): + return key in self._properties + + def GetProperty(self, key): + return self._properties[key] + + def SetProperty(self, key, value): + self.UpdateProperties({key: value}) + + def DelProperty(self, key): + if key in self._properties: + del self._properties[key] + + def AppendProperty(self, key, value): + # TODO(mark): Support ExtendProperty too (and make this call that)? + + # Schema validation. + if key not in self._schema: + raise KeyError(key + " not in " + self.__class__.__name__) + + (is_list, property_type, is_strong) = self._schema[key][0:3] if not is_list: - self._properties[property].parent = self - else: - for item in self._properties[property]: - item.parent = self - - def HasProperty(self, key): - return key in self._properties - - def GetProperty(self, key): - return self._properties[key] - - def SetProperty(self, key, value): - self.UpdateProperties({key: value}) - - def DelProperty(self, key): - if key in self._properties: - del self._properties[key] - - def AppendProperty(self, key, value): - # TODO(mark): Support ExtendProperty too (and make this call that)? - - # Schema validation. - if not key in self._schema: - raise KeyError(key + ' not in ' + self.__class__.__name__) - - (is_list, property_type, is_strong) = self._schema[key][0:3] - if not is_list: - raise TypeError(key + ' of ' + self.__class__.__name__ + ' must be list') - if not isinstance(value, property_type): - raise TypeError('item of ' + key + ' of ' + self.__class__.__name__ + \ - ' must be ' + property_type.__name__ + ', not ' + \ - value.__class__.__name__) - - # If the property doesn't exist yet, create a new empty list to receive the - # item. - if not key in self._properties: - self._properties[key] = [] - - # Set up the ownership link. - if is_strong: - value.parent = self + raise TypeError(key + " of " + self.__class__.__name__ + " must be list") + if not isinstance(value, property_type): + raise TypeError( + "item of " + + key + + " of " + + self.__class__.__name__ + + " must be " + + property_type.__name__ + + ", not " + + value.__class__.__name__ + ) + + # If the property doesn't exist yet, create a new empty list to receive the + # item. + self._properties[key] = self._properties.get(key, []) + + # Set up the ownership link. + if is_strong: + value.parent = self - # Store the item. - self._properties[key].append(value) + # Store the item. + self._properties[key].append(value) - def VerifyHasRequiredProperties(self): - """Ensure that all properties identified as required by the schema are + def VerifyHasRequiredProperties(self): + """Ensure that all properties identified as required by the schema are set. """ - # TODO(mark): A stronger verification mechanism is needed. Some - # subclasses need to perform validation beyond what the schema can enforce. - for property, attributes in self._schema.items(): - (is_list, property_type, is_strong, is_required) = attributes[0:4] - if is_required and not property in self._properties: - raise KeyError(self.__class__.__name__ + ' requires ' + property) + # TODO(mark): A stronger verification mechanism is needed. Some + # subclasses need to perform validation beyond what the schema can enforce. + for property, attributes in self._schema.items(): + (is_list, property_type, is_strong, is_required) = attributes[0:4] + if is_required and property not in self._properties: + raise KeyError(self.__class__.__name__ + " requires " + property) - def _SetDefaultsFromSchema(self): - """Assign object default values according to the schema. This will not + def _SetDefaultsFromSchema(self): + """Assign object default values according to the schema. This will not overwrite properties that have already been set.""" - defaults = {} - for property, attributes in self._schema.items(): - (is_list, property_type, is_strong, is_required) = attributes[0:4] - if is_required and len(attributes) >= 5 and \ - not property in self._properties: - default = attributes[4] + defaults = {} + for property, attributes in self._schema.items(): + (is_list, property_type, is_strong, is_required) = attributes[0:4] + if ( + is_required + and len(attributes) >= 5 + and property not in self._properties + ): + default = attributes[4] - defaults[property] = default + defaults[property] = default - if len(defaults) > 0: - # Use do_copy=True so that each new object gets its own copy of strong - # objects, lists, and dicts. - self.UpdateProperties(defaults, do_copy=True) + if len(defaults) > 0: + # Use do_copy=True so that each new object gets its own copy of strong + # objects, lists, and dicts. + self.UpdateProperties(defaults, do_copy=True) class XCHierarchicalElement(XCObject): - """Abstract base for PBXGroup and PBXFileReference. Not represented in a + """Abstract base for PBXGroup and PBXFileReference. Not represented in a project file.""" - # TODO(mark): Do name and path belong here? Probably so. - # If path is set and name is not, name may have a default value. Name will - # be set to the basename of path, if the basename of path is different from - # the full value of path. If path is already just a leaf name, name will - # not be set. - _schema = XCObject._schema.copy() - _schema.update({ - 'comments': [0, str, 0, 0], - 'fileEncoding': [0, str, 0, 0], - 'includeInIndex': [0, int, 0, 0], - 'indentWidth': [0, int, 0, 0], - 'lineEnding': [0, int, 0, 0], - 'sourceTree': [0, str, 0, 1, ''], - 'tabWidth': [0, int, 0, 0], - 'usesTabs': [0, int, 0, 0], - 'wrapsLines': [0, int, 0, 0], - }) - - def __init__(self, properties=None, id=None, parent=None): - # super - XCObject.__init__(self, properties, id, parent) - if 'path' in self._properties and not 'name' in self._properties: - path = self._properties['path'] - name = posixpath.basename(path) - if name != '' and path != name: - self.SetProperty('name', name) - - if 'path' in self._properties and \ - (not 'sourceTree' in self._properties or \ - self._properties['sourceTree'] == ''): - # If the pathname begins with an Xcode variable like "$(SDKROOT)/", take - # the variable out and make the path be relative to that variable by - # assigning the variable name as the sourceTree. - (source_tree, path) = SourceTreeAndPathFromPath(self._properties['path']) - if source_tree != None: - self._properties['sourceTree'] = source_tree - if path != None: - self._properties['path'] = path - if source_tree != None and path is None and \ - not 'name' in self._properties: - # The path was of the form "$(SDKROOT)" with no path following it. - # This object is now relative to that variable, so it has no path - # attribute of its own. It does, however, keep a name. - del self._properties['path'] - self._properties['name'] = source_tree - - def Name(self): - if 'name' in self._properties: - return self._properties['name'] - elif 'path' in self._properties: - return self._properties['path'] - else: - # This happens in the case of the root PBXGroup. - return None + # TODO(mark): Do name and path belong here? Probably so. + # If path is set and name is not, name may have a default value. Name will + # be set to the basename of path, if the basename of path is different from + # the full value of path. If path is already just a leaf name, name will + # not be set. + _schema = XCObject._schema.copy() + _schema.update( + { + "comments": [0, str, 0, 0], + "fileEncoding": [0, str, 0, 0], + "includeInIndex": [0, int, 0, 0], + "indentWidth": [0, int, 0, 0], + "lineEnding": [0, int, 0, 0], + "sourceTree": [0, str, 0, 1, ""], + "tabWidth": [0, int, 0, 0], + "usesTabs": [0, int, 0, 0], + "wrapsLines": [0, int, 0, 0], + } + ) + + def __init__(self, properties=None, id=None, parent=None): + # super + XCObject.__init__(self, properties, id, parent) + if "path" in self._properties and "name" not in self._properties: + path = self._properties["path"] + name = posixpath.basename(path) + if name != "" and path != name: + self.SetProperty("name", name) + + if "path" in self._properties and ( + "sourceTree" not in self._properties + or self._properties["sourceTree"] == "" + ): + # If the pathname begins with an Xcode variable like "$(SDKROOT)/", take + # the variable out and make the path be relative to that variable by + # assigning the variable name as the sourceTree. + (source_tree, path) = SourceTreeAndPathFromPath(self._properties["path"]) + if source_tree is not None: + self._properties["sourceTree"] = source_tree + if path is not None: + self._properties["path"] = path + if ( + source_tree is not None + and path is None + and "name" not in self._properties + ): + # The path was of the form "$(SDKROOT)" with no path following it. + # This object is now relative to that variable, so it has no path + # attribute of its own. It does, however, keep a name. + del self._properties["path"] + self._properties["name"] = source_tree + + def Name(self): + if "name" in self._properties: + return self._properties["name"] + elif "path" in self._properties: + return self._properties["path"] + else: + # This happens in the case of the root PBXGroup. + return None - def Hashables(self): - """Custom hashables for XCHierarchicalElements. + def Hashables(self): + """Custom hashables for XCHierarchicalElements. XCHierarchicalElements are special. Generally, their hashes shouldn't change if the paths don't change. The normal XCObject implementation of @@ -968,128 +1031,134 @@ def Hashables(self): is not considered a problem because there can be only one main group. """ - if self == self.PBXProjectAncestor()._properties['mainGroup']: - # super - return XCObject.Hashables(self) - - hashables = [] - - # Put the name in first, ensuring that if TakeOverOnlyChild collapses - # children into a top-level group like "Source", the name always goes - # into the list of hashables without interfering with path components. - if 'name' in self._properties: - # Make it less likely for people to manipulate hashes by following the - # pattern of always pushing an object type value onto the list first. - hashables.append(self.__class__.__name__ + '.name') - hashables.append(self._properties['name']) - - # NOTE: This still has the problem that if an absolute path is encountered, - # including paths with a sourceTree, they'll still inherit their parents' - # hashables, even though the paths aren't relative to their parents. This - # is not expected to be much of a problem in practice. - path = self.PathFromSourceTreeAndPath() - if path != None: - components = path.split(posixpath.sep) - for component in components: - hashables.append(self.__class__.__name__ + '.path') - hashables.append(component) - - hashables.extend(self._hashables) - - return hashables - - def Compare(self, other): - # Allow comparison of these types. PBXGroup has the highest sort rank; - # PBXVariantGroup is treated as equal to PBXFileReference. - valid_class_types = { - PBXFileReference: 'file', - PBXGroup: 'group', - PBXVariantGroup: 'file', - } - self_type = valid_class_types[self.__class__] - other_type = valid_class_types[other.__class__] - - if self_type == other_type: - # If the two objects are of the same sort rank, compare their names. - return cmp(self.Name(), other.Name()) - - # Otherwise, sort groups before everything else. - if self_type == 'group': - return -1 - return 1 - - def CompareRootGroup(self, other): - # This function should be used only to compare direct children of the - # containing PBXProject's mainGroup. These groups should appear in the - # listed order. - # TODO(mark): "Build" is used by gyp.generator.xcode, perhaps the - # generator should have a way of influencing this list rather than having - # to hardcode for the generator here. - order = ['Source', 'Intermediates', 'Projects', 'Frameworks', 'Products', - 'Build'] - - # If the groups aren't in the listed order, do a name comparison. - # Otherwise, groups in the listed order should come before those that - # aren't. - self_name = self.Name() - other_name = other.Name() - self_in = isinstance(self, PBXGroup) and self_name in order - other_in = isinstance(self, PBXGroup) and other_name in order - if not self_in and not other_in: - return self.Compare(other) - if self_name in order and not other_name in order: - return -1 - if other_name in order and not self_name in order: - return 1 - - # If both groups are in the listed order, go by the defined order. - self_index = order.index(self_name) - other_index = order.index(other_name) - if self_index < other_index: - return -1 - if self_index > other_index: - return 1 - return 0 - - def PathFromSourceTreeAndPath(self): - # Turn the object's sourceTree and path properties into a single flat - # string of a form comparable to the path parameter. If there's a - # sourceTree property other than "", wrap it in $(...) for the - # comparison. - components = [] - if self._properties['sourceTree'] != '': - components.append('$(' + self._properties['sourceTree'] + ')') - if 'path' in self._properties: - components.append(self._properties['path']) - - if len(components) > 0: - return posixpath.join(*components) - - return None - - def FullPath(self): - # Returns a full path to self relative to the project file, or relative - # to some other source tree. Start with self, and walk up the chain of - # parents prepending their paths, if any, until no more parents are - # available (project-relative path) or until a path relative to some - # source tree is found. - xche = self - path = None - while isinstance(xche, XCHierarchicalElement) and \ - (path is None or \ - (not path.startswith('/') and not path.startswith('$'))): - this_path = xche.PathFromSourceTreeAndPath() - if this_path != None and path != None: - path = posixpath.join(this_path, path) - elif this_path != None: - path = this_path - xche = xche.parent - - return path + if self == self.PBXProjectAncestor()._properties["mainGroup"]: + # super + return XCObject.Hashables(self) + + hashables = [] + + # Put the name in first, ensuring that if TakeOverOnlyChild collapses + # children into a top-level group like "Source", the name always goes + # into the list of hashables without interfering with path components. + if "name" in self._properties: + # Make it less likely for people to manipulate hashes by following the + # pattern of always pushing an object type value onto the list first. + hashables.append(self.__class__.__name__ + ".name") + hashables.append(self._properties["name"]) + + # NOTE: This still has the problem that if an absolute path is encountered, + # including paths with a sourceTree, they'll still inherit their parents' + # hashables, even though the paths aren't relative to their parents. This + # is not expected to be much of a problem in practice. + path = self.PathFromSourceTreeAndPath() + if path is not None: + components = path.split(posixpath.sep) + for component in components: + hashables.append(self.__class__.__name__ + ".path") + hashables.append(component) + + hashables.extend(self._hashables) + + return hashables + + def Compare(self, other): + # Allow comparison of these types. PBXGroup has the highest sort rank; + # PBXVariantGroup is treated as equal to PBXFileReference. + valid_class_types = { + PBXFileReference: "file", + PBXGroup: "group", + PBXVariantGroup: "file", + } + self_type = valid_class_types[self.__class__] + other_type = valid_class_types[other.__class__] + + if self_type == other_type: + # If the two objects are of the same sort rank, compare their names. + return cmp(self.Name(), other.Name()) + + # Otherwise, sort groups before everything else. + if self_type == "group": + return -1 + return 1 + + def CompareRootGroup(self, other): + # This function should be used only to compare direct children of the + # containing PBXProject's mainGroup. These groups should appear in the + # listed order. + # TODO(mark): "Build" is used by gyp.generator.xcode, perhaps the + # generator should have a way of influencing this list rather than having + # to hardcode for the generator here. + order = [ + "Source", + "Intermediates", + "Projects", + "Frameworks", + "Products", + "Build", + ] + + # If the groups aren't in the listed order, do a name comparison. + # Otherwise, groups in the listed order should come before those that + # aren't. + self_name = self.Name() + other_name = other.Name() + self_in = isinstance(self, PBXGroup) and self_name in order + other_in = isinstance(self, PBXGroup) and other_name in order + if not self_in and not other_in: + return self.Compare(other) + if self_name in order and other_name not in order: + return -1 + if other_name in order and self_name not in order: + return 1 + + # If both groups are in the listed order, go by the defined order. + self_index = order.index(self_name) + other_index = order.index(other_name) + if self_index < other_index: + return -1 + if self_index > other_index: + return 1 + return 0 + + def PathFromSourceTreeAndPath(self): + # Turn the object's sourceTree and path properties into a single flat + # string of a form comparable to the path parameter. If there's a + # sourceTree property other than "", wrap it in $(...) for the + # comparison. + components = [] + if self._properties["sourceTree"] != "": + components.append("$(" + self._properties["sourceTree"] + ")") + if "path" in self._properties: + components.append(self._properties["path"]) + + if len(components) > 0: + return posixpath.join(*components) + + return None + + def FullPath(self): + # Returns a full path to self relative to the project file, or relative + # to some other source tree. Start with self, and walk up the chain of + # parents prepending their paths, if any, until no more parents are + # available (project-relative path) or until a path relative to some + # source tree is found. + xche = self + path = None + while isinstance(xche, XCHierarchicalElement) and ( + path is None or (not path.startswith("/") and not path.startswith("$")) + ): + this_path = xche.PathFromSourceTreeAndPath() + if this_path is not None and path is not None: + path = posixpath.join(this_path, path) + elif this_path is not None: + path = this_path + xche = xche.parent + + return path class PBXGroup(XCHierarchicalElement): - """ + """ Attributes: _children_by_path: Maps pathnames of children of this PBXGroup to the actual child XCHierarchicalElement objects. @@ -1097,116 +1166,122 @@ class PBXGroup(XCHierarchicalElement): PBXVariantGroup children to the actual child PBXVariantGroup objects. """ - _schema = XCHierarchicalElement._schema.copy() - _schema.update({ - 'children': [1, XCHierarchicalElement, 1, 1, []], - 'name': [0, str, 0, 0], - 'path': [0, str, 0, 0], - }) - - def __init__(self, properties=None, id=None, parent=None): - # super - XCHierarchicalElement.__init__(self, properties, id, parent) - self._children_by_path = {} - self._variant_children_by_name_and_path = {} - for child in self._properties.get('children', []): - self._AddChildToDicts(child) - - def Hashables(self): - # super - hashables = XCHierarchicalElement.Hashables(self) - - # It is not sufficient to just rely on name and parent to build a unique - # hashable : a node could have two child PBXGroup sharing a common name. - # To add entropy the hashable is enhanced with the names of all its - # children. - for child in self._properties.get('children', []): - child_name = child.Name() - if child_name != None: - hashables.append(child_name) - - return hashables - - def HashablesForChild(self): - # To avoid a circular reference the hashables used to compute a child id do - # not include the child names. - return XCHierarchicalElement.Hashables(self) - - def _AddChildToDicts(self, child): - # Sets up this PBXGroup object's dicts to reference the child properly. - child_path = child.PathFromSourceTreeAndPath() - if child_path: - if child_path in self._children_by_path: - raise ValueError('Found multiple children with path ' + child_path) - self._children_by_path[child_path] = child - - if isinstance(child, PBXVariantGroup): - child_name = child._properties.get('name', None) - key = (child_name, child_path) - if key in self._variant_children_by_name_and_path: - raise ValueError('Found multiple PBXVariantGroup children with ' + \ - 'name ' + str(child_name) + ' and path ' + \ - str(child_path)) - self._variant_children_by_name_and_path[key] = child - - def AppendChild(self, child): - # Callers should use this instead of calling - # AppendProperty('children', child) directly because this function - # maintains the group's dicts. - self.AppendProperty('children', child) - self._AddChildToDicts(child) - - def GetChildByName(self, name): - # This is not currently optimized with a dict as GetChildByPath is because - # it has few callers. Most callers probably want GetChildByPath. This - # function is only useful to get children that have names but no paths, - # which is rare. The children of the main group ("Source", "Products", - # etc.) is pretty much the only case where this likely to come up. - # - # TODO(mark): Maybe this should raise an error if more than one child is - # present with the same name. - if not 'children' in self._properties: - return None + _schema = XCHierarchicalElement._schema.copy() + _schema.update( + { + "children": [1, XCHierarchicalElement, 1, 1, []], + "name": [0, str, 0, 0], + "path": [0, str, 0, 0], + } + ) + + def __init__(self, properties=None, id=None, parent=None): + # super + XCHierarchicalElement.__init__(self, properties, id, parent) + self._children_by_path = {} + self._variant_children_by_name_and_path = {} + for child in self._properties.get("children", []): + self._AddChildToDicts(child) + + def Hashables(self): + # super + hashables = XCHierarchicalElement.Hashables(self) + + # It is not sufficient to just rely on name and parent to build a unique + # hashable : a node could have two child PBXGroup sharing a common name. + # To add entropy the hashable is enhanced with the names of all its + # children. + for child in self._properties.get("children", []): + child_name = child.Name() + if child_name is not None: + hashables.append(child_name) + + return hashables + + def HashablesForChild(self): + # To avoid a circular reference the hashables used to compute a child id do + # not include the child names. + return XCHierarchicalElement.Hashables(self) + + def _AddChildToDicts(self, child): + # Sets up this PBXGroup object's dicts to reference the child properly. + child_path = child.PathFromSourceTreeAndPath() + if child_path: + if child_path in self._children_by_path: + raise ValueError("Found multiple children with path " + child_path) + self._children_by_path[child_path] = child + + if isinstance(child, PBXVariantGroup): + child_name = child._properties.get("name", None) + key = (child_name, child_path) + if key in self._variant_children_by_name_and_path: + raise ValueError( + "Found multiple PBXVariantGroup children with " + + "name " + + str(child_name) + + " and path " + + str(child_path) + ) + self._variant_children_by_name_and_path[key] = child + + def AppendChild(self, child): + # Callers should use this instead of calling + # AppendProperty('children', child) directly because this function + # maintains the group's dicts. + self.AppendProperty("children", child) + self._AddChildToDicts(child) + + def GetChildByName(self, name): + # This is not currently optimized with a dict as GetChildByPath is because + # it has few callers. Most callers probably want GetChildByPath. This + # function is only useful to get children that have names but no paths, + # which is rare. The children of the main group ("Source", "Products", + # etc.) is pretty much the only case where this likely to come up. + # + # TODO(mark): Maybe this should raise an error if more than one child is + # present with the same name. + if "children" not in self._properties: + return None - for child in self._properties['children']: - if child.Name() == name: - return child + for child in self._properties["children"]: + if child.Name() == name: + return child - return None + return None - def GetChildByPath(self, path): - if not path: - return None + def GetChildByPath(self, path): + if not path: + return None - if path in self._children_by_path: - return self._children_by_path[path] + if path in self._children_by_path: + return self._children_by_path[path] - return None + return None - def GetChildByRemoteObject(self, remote_object): - # This method is a little bit esoteric. Given a remote_object, which - # should be a PBXFileReference in another project file, this method will - # return this group's PBXReferenceProxy object serving as a local proxy - # for the remote PBXFileReference. - # - # This function might benefit from a dict optimization as GetChildByPath - # for some workloads, but profiling shows that it's not currently a - # problem. - if not 'children' in self._properties: - return None + def GetChildByRemoteObject(self, remote_object): + # This method is a little bit esoteric. Given a remote_object, which + # should be a PBXFileReference in another project file, this method will + # return this group's PBXReferenceProxy object serving as a local proxy + # for the remote PBXFileReference. + # + # This function might benefit from a dict optimization as GetChildByPath + # for some workloads, but profiling shows that it's not currently a + # problem. + if "children" not in self._properties: + return None - for child in self._properties['children']: - if not isinstance(child, PBXReferenceProxy): - continue + for child in self._properties["children"]: + if not isinstance(child, PBXReferenceProxy): + continue - container_proxy = child._properties['remoteRef'] - if container_proxy._properties['remoteGlobalIDString'] == remote_object: - return child + container_proxy = child._properties["remoteRef"] + if container_proxy._properties["remoteGlobalIDString"] == remote_object: + return child - return None + return None - def AddOrGetFileByPath(self, path, hierarchical): - """Returns an existing or new file reference corresponding to path. + def AddOrGetFileByPath(self, path, hierarchical): + """Returns an existing or new file reference corresponding to path. If hierarchical is True, this method will create or use the necessary hierarchical group structure corresponding to path. Otherwise, it will @@ -1223,83 +1298,88 @@ def AddOrGetFileByPath(self, path, hierarchical): all other paths, a "normal" PBXFileReference will be returned. """ - # Adding or getting a directory? Directories end with a trailing slash. - is_dir = False - if path.endswith('/'): - is_dir = True - path = posixpath.normpath(path) - if is_dir: - path = path + '/' - - # Adding or getting a variant? Variants are files inside directories - # with an ".lproj" extension. Xcode uses variants for localization. For - # a variant path/to/Language.lproj/MainMenu.nib, put a variant group named - # MainMenu.nib inside path/to, and give it a variant named Language. In - # this example, grandparent would be set to path/to and parent_root would - # be set to Language. - variant_name = None - parent = posixpath.dirname(path) - grandparent = posixpath.dirname(parent) - parent_basename = posixpath.basename(parent) - (parent_root, parent_ext) = posixpath.splitext(parent_basename) - if parent_ext == '.lproj': - variant_name = parent_root - if grandparent == '': - grandparent = None - - # Putting a directory inside a variant group is not currently supported. - assert not is_dir or variant_name is None - - path_split = path.split(posixpath.sep) - if len(path_split) == 1 or \ - ((is_dir or variant_name != None) and len(path_split) == 2) or \ - not hierarchical: - # The PBXFileReference or PBXVariantGroup will be added to or gotten from - # this PBXGroup, no recursion necessary. - if variant_name is None: - # Add or get a PBXFileReference. - file_ref = self.GetChildByPath(path) - if file_ref != None: - assert file_ref.__class__ == PBXFileReference + # Adding or getting a directory? Directories end with a trailing slash. + is_dir = False + if path.endswith("/"): + is_dir = True + path = posixpath.normpath(path) + if is_dir: + path = path + "/" + + # Adding or getting a variant? Variants are files inside directories + # with an ".lproj" extension. Xcode uses variants for localization. For + # a variant path/to/Language.lproj/MainMenu.nib, put a variant group named + # MainMenu.nib inside path/to, and give it a variant named Language. In + # this example, grandparent would be set to path/to and parent_root would + # be set to Language. + variant_name = None + parent = posixpath.dirname(path) + grandparent = posixpath.dirname(parent) + parent_basename = posixpath.basename(parent) + (parent_root, parent_ext) = posixpath.splitext(parent_basename) + if parent_ext == ".lproj": + variant_name = parent_root + if grandparent == "": + grandparent = None + + # Putting a directory inside a variant group is not currently supported. + assert not is_dir or variant_name is None + + path_split = path.split(posixpath.sep) + if ( + len(path_split) == 1 + or ((is_dir or variant_name is not None) and len(path_split) == 2) + or not hierarchical + ): + # The PBXFileReference or PBXVariantGroup will be added to or gotten from + # this PBXGroup, no recursion necessary. + if variant_name is None: + # Add or get a PBXFileReference. + file_ref = self.GetChildByPath(path) + if file_ref is not None: + assert file_ref.__class__ == PBXFileReference + else: + file_ref = PBXFileReference({"path": path}) + self.AppendChild(file_ref) + else: + # Add or get a PBXVariantGroup. The variant group name is the same + # as the basename (MainMenu.nib in the example above). grandparent + # specifies the path to the variant group itself, and path_split[-2:] + # is the path of the specific variant relative to its group. + variant_group_name = posixpath.basename(path) + variant_group_ref = self.AddOrGetVariantGroupByNameAndPath( + variant_group_name, grandparent + ) + variant_path = posixpath.sep.join(path_split[-2:]) + variant_ref = variant_group_ref.GetChildByPath(variant_path) + if variant_ref is not None: + assert variant_ref.__class__ == PBXFileReference + else: + variant_ref = PBXFileReference( + {"name": variant_name, "path": variant_path} + ) + variant_group_ref.AppendChild(variant_ref) + # The caller is interested in the variant group, not the specific + # variant file. + file_ref = variant_group_ref + return file_ref else: - file_ref = PBXFileReference({'path': path}) - self.AppendChild(file_ref) - else: - # Add or get a PBXVariantGroup. The variant group name is the same - # as the basename (MainMenu.nib in the example above). grandparent - # specifies the path to the variant group itself, and path_split[-2:] - # is the path of the specific variant relative to its group. - variant_group_name = posixpath.basename(path) - variant_group_ref = self.AddOrGetVariantGroupByNameAndPath( - variant_group_name, grandparent) - variant_path = posixpath.sep.join(path_split[-2:]) - variant_ref = variant_group_ref.GetChildByPath(variant_path) - if variant_ref != None: - assert variant_ref.__class__ == PBXFileReference - else: - variant_ref = PBXFileReference({'name': variant_name, - 'path': variant_path}) - variant_group_ref.AppendChild(variant_ref) - # The caller is interested in the variant group, not the specific - # variant file. - file_ref = variant_group_ref - return file_ref - else: - # Hierarchical recursion. Add or get a PBXGroup corresponding to the - # outermost path component, and then recurse into it, chopping off that - # path component. - next_dir = path_split[0] - group_ref = self.GetChildByPath(next_dir) - if group_ref != None: - assert group_ref.__class__ == PBXGroup - else: - group_ref = PBXGroup({'path': next_dir}) - self.AppendChild(group_ref) - return group_ref.AddOrGetFileByPath(posixpath.sep.join(path_split[1:]), - hierarchical) - - def AddOrGetVariantGroupByNameAndPath(self, name, path): - """Returns an existing or new PBXVariantGroup for name and path. + # Hierarchical recursion. Add or get a PBXGroup corresponding to the + # outermost path component, and then recurse into it, chopping off that + # path component. + next_dir = path_split[0] + group_ref = self.GetChildByPath(next_dir) + if group_ref is not None: + assert group_ref.__class__ == PBXGroup + else: + group_ref = PBXGroup({"path": next_dir}) + self.AppendChild(group_ref) + return group_ref.AddOrGetFileByPath( + posixpath.sep.join(path_split[1:]), hierarchical + ) + + def AddOrGetVariantGroupByNameAndPath(self, name, path): + """Returns an existing or new PBXVariantGroup for name and path. If a PBXVariantGroup identified by the name and path arguments is already present as a child of this object, it is returned. Otherwise, a new @@ -1311,22 +1391,22 @@ def AddOrGetVariantGroupByNameAndPath(self, name, path): passed to it. """ - key = (name, path) - if key in self._variant_children_by_name_and_path: - variant_group_ref = self._variant_children_by_name_and_path[key] - assert variant_group_ref.__class__ == PBXVariantGroup - return variant_group_ref + key = (name, path) + if key in self._variant_children_by_name_and_path: + variant_group_ref = self._variant_children_by_name_and_path[key] + assert variant_group_ref.__class__ == PBXVariantGroup + return variant_group_ref - variant_group_properties = {'name': name} - if path != None: - variant_group_properties['path'] = path - variant_group_ref = PBXVariantGroup(variant_group_properties) - self.AppendChild(variant_group_ref) + variant_group_properties = {"name": name} + if path is not None: + variant_group_properties["path"] = path + variant_group_ref = PBXVariantGroup(variant_group_properties) + self.AppendChild(variant_group_ref) - return variant_group_ref + return variant_group_ref - def TakeOverOnlyChild(self, recurse=False): - """If this PBXGroup has only one child and it's also a PBXGroup, take + def TakeOverOnlyChild(self, recurse=False): + """If this PBXGroup has only one child and it's also a PBXGroup, take it over by making all of its children this object's children. This function will continue to take over only children when those children @@ -1341,210 +1421,226 @@ def TakeOverOnlyChild(self, recurse=False): a group for a/b/c containing a group for d3/e. """ - # At this stage, check that child class types are PBXGroup exactly, - # instead of using isinstance. The only subclass of PBXGroup, - # PBXVariantGroup, should not participate in reparenting in the same way: - # reparenting by merging different object types would be wrong. - while len(self._properties['children']) == 1 and \ - self._properties['children'][0].__class__ == PBXGroup: - # Loop to take over the innermost only-child group possible. - - child = self._properties['children'][0] - - # Assume the child's properties, including its children. Save a copy - # of this object's old properties, because they'll still be needed. - # This object retains its existing id and parent attributes. - old_properties = self._properties - self._properties = child._properties - self._children_by_path = child._children_by_path - - if not 'sourceTree' in self._properties or \ - self._properties['sourceTree'] == '': - # The child was relative to its parent. Fix up the path. Note that - # children with a sourceTree other than "" are not relative to - # their parents, so no path fix-up is needed in that case. - if 'path' in old_properties: - if 'path' in self._properties: - # Both the original parent and child have paths set. - self._properties['path'] = posixpath.join(old_properties['path'], - self._properties['path']) - else: - # Only the original parent has a path, use it. - self._properties['path'] = old_properties['path'] - if 'sourceTree' in old_properties: - # The original parent had a sourceTree set, use it. - self._properties['sourceTree'] = old_properties['sourceTree'] - - # If the original parent had a name set, keep using it. If the original - # parent didn't have a name but the child did, let the child's name - # live on. If the name attribute seems unnecessary now, get rid of it. - if 'name' in old_properties and old_properties['name'] != None and \ - old_properties['name'] != self.Name(): - self._properties['name'] = old_properties['name'] - if 'name' in self._properties and 'path' in self._properties and \ - self._properties['name'] == self._properties['path']: - del self._properties['name'] - - # Notify all children of their new parent. - for child in self._properties['children']: - child.parent = self - - # If asked to recurse, recurse. - if recurse: - for child in self._properties['children']: - if child.__class__ == PBXGroup: - child.TakeOverOnlyChild(recurse) - - def SortGroup(self): - self._properties['children'] = \ - sorted(self._properties['children'], cmp=lambda x,y: x.Compare(y)) - - # Recurse. - for child in self._properties['children']: - if isinstance(child, PBXGroup): - child.SortGroup() + # At this stage, check that child class types are PBXGroup exactly, + # instead of using isinstance. The only subclass of PBXGroup, + # PBXVariantGroup, should not participate in reparenting in the same way: + # reparenting by merging different object types would be wrong. + while ( + len(self._properties["children"]) == 1 + and self._properties["children"][0].__class__ == PBXGroup + ): + # Loop to take over the innermost only-child group possible. + + child = self._properties["children"][0] + + # Assume the child's properties, including its children. Save a copy + # of this object's old properties, because they'll still be needed. + # This object retains its existing id and parent attributes. + old_properties = self._properties + self._properties = child._properties + self._children_by_path = child._children_by_path + + if ( + "sourceTree" not in self._properties + or self._properties["sourceTree"] == "" + ): + # The child was relative to its parent. Fix up the path. Note that + # children with a sourceTree other than "" are not relative to + # their parents, so no path fix-up is needed in that case. + if "path" in old_properties: + if "path" in self._properties: + # Both the original parent and child have paths set. + self._properties["path"] = posixpath.join( + old_properties["path"], self._properties["path"] + ) + else: + # Only the original parent has a path, use it. + self._properties["path"] = old_properties["path"] + if "sourceTree" in old_properties: + # The original parent had a sourceTree set, use it. + self._properties["sourceTree"] = old_properties["sourceTree"] + + # If the original parent had a name set, keep using it. If the original + # parent didn't have a name but the child did, let the child's name + # live on. If the name attribute seems unnecessary now, get rid of it. + if "name" in old_properties and old_properties["name"] not in ( + None, + self.Name(), + ): + self._properties["name"] = old_properties["name"] + if ( + "name" in self._properties + and "path" in self._properties + and self._properties["name"] == self._properties["path"] + ): + del self._properties["name"] + + # Notify all children of their new parent. + for child in self._properties["children"]: + child.parent = self + + # If asked to recurse, recurse. + if recurse: + for child in self._properties["children"]: + if child.__class__ == PBXGroup: + child.TakeOverOnlyChild(recurse) + + def SortGroup(self): + self._properties["children"] = sorted( + self._properties["children"], cmp=lambda x, y: x.Compare(y) + ) + + # Recurse. + for child in self._properties["children"]: + if isinstance(child, PBXGroup): + child.SortGroup() class XCFileLikeElement(XCHierarchicalElement): - # Abstract base for objects that can be used as the fileRef property of - # PBXBuildFile. - - def PathHashables(self): - # A PBXBuildFile that refers to this object will call this method to - # obtain additional hashables specific to this XCFileLikeElement. Don't - # just use this object's hashables, they're not specific and unique enough - # on their own (without access to the parent hashables.) Instead, provide - # hashables that identify this object by path by getting its hashables as - # well as the hashables of ancestor XCHierarchicalElement objects. - - hashables = [] - xche = self - while xche != None and isinstance(xche, XCHierarchicalElement): - xche_hashables = xche.Hashables() - for index in range(0, len(xche_hashables)): - hashables.insert(index, xche_hashables[index]) - xche = xche.parent - return hashables + # Abstract base for objects that can be used as the fileRef property of + # PBXBuildFile. + + def PathHashables(self): + # A PBXBuildFile that refers to this object will call this method to + # obtain additional hashables specific to this XCFileLikeElement. Don't + # just use this object's hashables, they're not specific and unique enough + # on their own (without access to the parent hashables.) Instead, provide + # hashables that identify this object by path by getting its hashables as + # well as the hashables of ancestor XCHierarchicalElement objects. + + hashables = [] + xche = self + while isinstance(xche, XCHierarchicalElement): + xche_hashables = xche.Hashables() + for index, xche_hashable in enumerate(xche_hashables): + hashables.insert(index, xche_hashable) + xche = xche.parent + return hashables class XCContainerPortal(XCObject): - # Abstract base for objects that can be used as the containerPortal property - # of PBXContainerItemProxy. - pass + # Abstract base for objects that can be used as the containerPortal property + # of PBXContainerItemProxy. + pass class XCRemoteObject(XCObject): - # Abstract base for objects that can be used as the remoteGlobalIDString - # property of PBXContainerItemProxy. - pass + # Abstract base for objects that can be used as the remoteGlobalIDString + # property of PBXContainerItemProxy. + pass class PBXFileReference(XCFileLikeElement, XCContainerPortal, XCRemoteObject): - _schema = XCFileLikeElement._schema.copy() - _schema.update({ - 'explicitFileType': [0, str, 0, 0], - 'lastKnownFileType': [0, str, 0, 0], - 'name': [0, str, 0, 0], - 'path': [0, str, 0, 1], - }) - - # Weird output rules for PBXFileReference. - _should_print_single_line = True - # super - _encode_transforms = XCFileLikeElement._alternate_encode_transforms - - def __init__(self, properties=None, id=None, parent=None): + _schema = XCFileLikeElement._schema.copy() + _schema.update( + { + "explicitFileType": [0, str, 0, 0], + "lastKnownFileType": [0, str, 0, 0], + "name": [0, str, 0, 0], + "path": [0, str, 0, 1], + } + ) + + # Weird output rules for PBXFileReference. + _should_print_single_line = True # super - XCFileLikeElement.__init__(self, properties, id, parent) - if 'path' in self._properties and self._properties['path'].endswith('/'): - self._properties['path'] = self._properties['path'][:-1] - is_dir = True - else: - is_dir = False - - if 'path' in self._properties and \ - not 'lastKnownFileType' in self._properties and \ - not 'explicitFileType' in self._properties: - # TODO(mark): This is the replacement for a replacement for a quick hack. - # It is no longer incredibly sucky, but this list needs to be extended. - extension_map = { - 'a': 'archive.ar', - 'app': 'wrapper.application', - 'bdic': 'file', - 'bundle': 'wrapper.cfbundle', - 'c': 'sourcecode.c.c', - 'cc': 'sourcecode.cpp.cpp', - 'cpp': 'sourcecode.cpp.cpp', - 'css': 'text.css', - 'cxx': 'sourcecode.cpp.cpp', - 'dart': 'sourcecode', - 'dylib': 'compiled.mach-o.dylib', - 'framework': 'wrapper.framework', - 'gyp': 'sourcecode', - 'gypi': 'sourcecode', - 'h': 'sourcecode.c.h', - 'hxx': 'sourcecode.cpp.h', - 'icns': 'image.icns', - 'java': 'sourcecode.java', - 'js': 'sourcecode.javascript', - 'kext': 'wrapper.kext', - 'm': 'sourcecode.c.objc', - 'mm': 'sourcecode.cpp.objcpp', - 'nib': 'wrapper.nib', - 'o': 'compiled.mach-o.objfile', - 'pdf': 'image.pdf', - 'pl': 'text.script.perl', - 'plist': 'text.plist.xml', - 'pm': 'text.script.perl', - 'png': 'image.png', - 'py': 'text.script.python', - 'r': 'sourcecode.rez', - 'rez': 'sourcecode.rez', - 's': 'sourcecode.asm', - 'storyboard': 'file.storyboard', - 'strings': 'text.plist.strings', - 'swift': 'sourcecode.swift', - 'ttf': 'file', - 'xcassets': 'folder.assetcatalog', - 'xcconfig': 'text.xcconfig', - 'xcdatamodel': 'wrapper.xcdatamodel', - 'xcdatamodeld':'wrapper.xcdatamodeld', - 'xib': 'file.xib', - 'y': 'sourcecode.yacc', - } - - prop_map = { - 'dart': 'explicitFileType', - 'gyp': 'explicitFileType', - 'gypi': 'explicitFileType', - } - - if is_dir: - file_type = 'folder' - prop_name = 'lastKnownFileType' - else: - basename = posixpath.basename(self._properties['path']) - (root, ext) = posixpath.splitext(basename) - # Check the map using a lowercase extension. - # TODO(mark): Maybe it should try with the original case first and fall - # back to lowercase, in case there are any instances where case - # matters. There currently aren't. - if ext != '': - ext = ext[1:].lower() - - # TODO(mark): "text" is the default value, but "file" is appropriate - # for unrecognized files not containing text. Xcode seems to choose - # based on content. - file_type = extension_map.get(ext, 'text') - prop_name = prop_map.get(ext, 'lastKnownFileType') - - self._properties[prop_name] = file_type + _encode_transforms = XCFileLikeElement._alternate_encode_transforms + + def __init__(self, properties=None, id=None, parent=None): + # super + XCFileLikeElement.__init__(self, properties, id, parent) + if "path" in self._properties and self._properties["path"].endswith("/"): + self._properties["path"] = self._properties["path"][:-1] + is_dir = True + else: + is_dir = False + + if ( + "path" in self._properties + and "lastKnownFileType" not in self._properties + and "explicitFileType" not in self._properties + ): + # TODO(mark): This is the replacement for a replacement for a quick hack. + # It is no longer incredibly sucky, but this list needs to be extended. + extension_map = { + "a": "archive.ar", + "app": "wrapper.application", + "bdic": "file", + "bundle": "wrapper.cfbundle", + "c": "sourcecode.c.c", + "cc": "sourcecode.cpp.cpp", + "cpp": "sourcecode.cpp.cpp", + "css": "text.css", + "cxx": "sourcecode.cpp.cpp", + "dart": "sourcecode", + "dylib": "compiled.mach-o.dylib", + "framework": "wrapper.framework", + "gyp": "sourcecode", + "gypi": "sourcecode", + "h": "sourcecode.c.h", + "hxx": "sourcecode.cpp.h", + "icns": "image.icns", + "java": "sourcecode.java", + "js": "sourcecode.javascript", + "kext": "wrapper.kext", + "m": "sourcecode.c.objc", + "mm": "sourcecode.cpp.objcpp", + "nib": "wrapper.nib", + "o": "compiled.mach-o.objfile", + "pdf": "image.pdf", + "pl": "text.script.perl", + "plist": "text.plist.xml", + "pm": "text.script.perl", + "png": "image.png", + "py": "text.script.python", + "r": "sourcecode.rez", + "rez": "sourcecode.rez", + "s": "sourcecode.asm", + "storyboard": "file.storyboard", + "strings": "text.plist.strings", + "swift": "sourcecode.swift", + "ttf": "file", + "xcassets": "folder.assetcatalog", + "xcconfig": "text.xcconfig", + "xcdatamodel": "wrapper.xcdatamodel", + "xcdatamodeld": "wrapper.xcdatamodeld", + "xib": "file.xib", + "y": "sourcecode.yacc", + } + + prop_map = { + "dart": "explicitFileType", + "gyp": "explicitFileType", + "gypi": "explicitFileType", + } + + if is_dir: + file_type = "folder" + prop_name = "lastKnownFileType" + else: + basename = posixpath.basename(self._properties["path"]) + (root, ext) = posixpath.splitext(basename) + # Check the map using a lowercase extension. + # TODO(mark): Maybe it should try with the original case first and fall + # back to lowercase, in case there are any instances where case + # matters. There currently aren't. + if ext != "": + ext = ext[1:].lower() + + # TODO(mark): "text" is the default value, but "file" is appropriate + # for unrecognized files not containing text. Xcode seems to choose + # based on content. + file_type = extension_map.get(ext, "text") + prop_name = prop_map.get(ext, "lastKnownFileType") + + self._properties[prop_name] = file_type class PBXVariantGroup(PBXGroup, XCFileLikeElement): - """PBXVariantGroup is used by Xcode to represent localizations.""" - # No additions to the schema relative to PBXGroup. - pass + """PBXVariantGroup is used by Xcode to represent localizations.""" + + # No additions to the schema relative to PBXGroup. + pass # PBXReferenceProxy is also an XCFileLikeElement subclass. It is defined below @@ -1552,65 +1648,77 @@ class PBXVariantGroup(PBXGroup, XCFileLikeElement): class XCBuildConfiguration(XCObject): - _schema = XCObject._schema.copy() - _schema.update({ - 'baseConfigurationReference': [0, PBXFileReference, 0, 0], - 'buildSettings': [0, dict, 0, 1, {}], - 'name': [0, str, 0, 1], - }) + _schema = XCObject._schema.copy() + _schema.update( + { + "baseConfigurationReference": [0, PBXFileReference, 0, 0], + "buildSettings": [0, dict, 0, 1, {}], + "name": [0, str, 0, 1], + } + ) + + def HasBuildSetting(self, key): + return key in self._properties["buildSettings"] - def HasBuildSetting(self, key): - return key in self._properties['buildSettings'] + def GetBuildSetting(self, key): + return self._properties["buildSettings"][key] - def GetBuildSetting(self, key): - return self._properties['buildSettings'][key] + def SetBuildSetting(self, key, value): + # TODO(mark): If a list, copy? + self._properties["buildSettings"][key] = value - def SetBuildSetting(self, key, value): - # TODO(mark): If a list, copy? - self._properties['buildSettings'][key] = value + def AppendBuildSetting(self, key, value): + if key not in self._properties["buildSettings"]: + self._properties["buildSettings"][key] = [] + self._properties["buildSettings"][key].append(value) - def AppendBuildSetting(self, key, value): - if not key in self._properties['buildSettings']: - self._properties['buildSettings'][key] = [] - self._properties['buildSettings'][key].append(value) + def DelBuildSetting(self, key): + if key in self._properties["buildSettings"]: + del self._properties["buildSettings"][key] - def DelBuildSetting(self, key): - if key in self._properties['buildSettings']: - del self._properties['buildSettings'][key] + def SetBaseConfiguration(self, value): + self._properties["baseConfigurationReference"] = value - def SetBaseConfiguration(self, value): - self._properties['baseConfigurationReference'] = value class XCConfigurationList(XCObject): - # _configs is the default list of configurations. - _configs = [ XCBuildConfiguration({'name': 'Debug'}), - XCBuildConfiguration({'name': 'Release'}) ] - - _schema = XCObject._schema.copy() - _schema.update({ - 'buildConfigurations': [1, XCBuildConfiguration, 1, 1, _configs], - 'defaultConfigurationIsVisible': [0, int, 0, 1, 1], - 'defaultConfigurationName': [0, str, 0, 1, 'Release'], - }) - - def Name(self): - return 'Build configuration list for ' + \ - self.parent.__class__.__name__ + ' "' + self.parent.Name() + '"' - - def ConfigurationNamed(self, name): - """Convenience accessor to obtain an XCBuildConfiguration by name.""" - for configuration in self._properties['buildConfigurations']: - if configuration._properties['name'] == name: - return configuration - - raise KeyError(name) - - def DefaultConfiguration(self): - """Convenience accessor to obtain the default XCBuildConfiguration.""" - return self.ConfigurationNamed(self._properties['defaultConfigurationName']) - - def HasBuildSetting(self, key): - """Determines the state of a build setting in all XCBuildConfiguration + # _configs is the default list of configurations. + _configs = [ + XCBuildConfiguration({"name": "Debug"}), + XCBuildConfiguration({"name": "Release"}), + ] + + _schema = XCObject._schema.copy() + _schema.update( + { + "buildConfigurations": [1, XCBuildConfiguration, 1, 1, _configs], + "defaultConfigurationIsVisible": [0, int, 0, 1, 1], + "defaultConfigurationName": [0, str, 0, 1, "Release"], + } + ) + + def Name(self): + return ( + "Build configuration list for " + + self.parent.__class__.__name__ + + ' "' + + self.parent.Name() + + '"' + ) + + def ConfigurationNamed(self, name): + """Convenience accessor to obtain an XCBuildConfiguration by name.""" + for configuration in self._properties["buildConfigurations"]: + if configuration._properties["name"] == name: + return configuration + + raise KeyError(name) + + def DefaultConfiguration(self): + """Convenience accessor to obtain the default XCBuildConfiguration.""" + return self.ConfigurationNamed(self._properties["defaultConfigurationName"]) + + def HasBuildSetting(self, key): + """Determines the state of a build setting in all XCBuildConfiguration child objects. If all child objects have key in their build settings, and the value is the @@ -1622,112 +1730,114 @@ def HasBuildSetting(self, key): or if any children have different values for the key, returns -1. """ - has = None - value = None - for configuration in self._properties['buildConfigurations']: - configuration_has = configuration.HasBuildSetting(key) - if has is None: - has = configuration_has - elif has != configuration_has: - return -1 + has = None + value = None + for configuration in self._properties["buildConfigurations"]: + configuration_has = configuration.HasBuildSetting(key) + if has is None: + has = configuration_has + elif has != configuration_has: + return -1 - if configuration_has: - configuration_value = configuration.GetBuildSetting(key) - if value is None: - value = configuration_value - elif value != configuration_value: - return -1 + if configuration_has: + configuration_value = configuration.GetBuildSetting(key) + if value is None: + value = configuration_value + elif value != configuration_value: + return -1 - if not has: - return 0 + if not has: + return 0 - return 1 + return 1 - def GetBuildSetting(self, key): - """Gets the build setting for key. + def GetBuildSetting(self, key): + """Gets the build setting for key. All child XCConfiguration objects must have the same value set for the setting, or a ValueError will be raised. """ - # TODO(mark): This is wrong for build settings that are lists. The list - # contents should be compared (and a list copy returned?) + # TODO(mark): This is wrong for build settings that are lists. The list + # contents should be compared (and a list copy returned?) - value = None - for configuration in self._properties['buildConfigurations']: - configuration_value = configuration.GetBuildSetting(key) - if value is None: - value = configuration_value - else: - if value != configuration_value: - raise ValueError('Variant values for ' + key) + value = None + for configuration in self._properties["buildConfigurations"]: + configuration_value = configuration.GetBuildSetting(key) + if value is None: + value = configuration_value + else: + if value != configuration_value: + raise ValueError("Variant values for " + key) - return value + return value - def SetBuildSetting(self, key, value): - """Sets the build setting for key to value in all child + def SetBuildSetting(self, key, value): + """Sets the build setting for key to value in all child XCBuildConfiguration objects. """ - for configuration in self._properties['buildConfigurations']: - configuration.SetBuildSetting(key, value) + for configuration in self._properties["buildConfigurations"]: + configuration.SetBuildSetting(key, value) - def AppendBuildSetting(self, key, value): - """Appends value to the build setting for key, which is treated as a list, + def AppendBuildSetting(self, key, value): + """Appends value to the build setting for key, which is treated as a list, in all child XCBuildConfiguration objects. """ - for configuration in self._properties['buildConfigurations']: - configuration.AppendBuildSetting(key, value) + for configuration in self._properties["buildConfigurations"]: + configuration.AppendBuildSetting(key, value) - def DelBuildSetting(self, key): - """Deletes the build setting key from all child XCBuildConfiguration + def DelBuildSetting(self, key): + """Deletes the build setting key from all child XCBuildConfiguration objects. """ - for configuration in self._properties['buildConfigurations']: - configuration.DelBuildSetting(key) + for configuration in self._properties["buildConfigurations"]: + configuration.DelBuildSetting(key) - def SetBaseConfiguration(self, value): - """Sets the build configuration in all child XCBuildConfiguration objects. + def SetBaseConfiguration(self, value): + """Sets the build configuration in all child XCBuildConfiguration objects. """ - for configuration in self._properties['buildConfigurations']: - configuration.SetBaseConfiguration(value) + for configuration in self._properties["buildConfigurations"]: + configuration.SetBaseConfiguration(value) class PBXBuildFile(XCObject): - _schema = XCObject._schema.copy() - _schema.update({ - 'fileRef': [0, XCFileLikeElement, 0, 1], - 'settings': [0, str, 0, 0], # hack, it's a dict - }) + _schema = XCObject._schema.copy() + _schema.update( + { + "fileRef": [0, XCFileLikeElement, 0, 1], + "settings": [0, str, 0, 0], # hack, it's a dict + } + ) - # Weird output rules for PBXBuildFile. - _should_print_single_line = True - _encode_transforms = XCObject._alternate_encode_transforms + # Weird output rules for PBXBuildFile. + _should_print_single_line = True + _encode_transforms = XCObject._alternate_encode_transforms - def Name(self): - # Example: "main.cc in Sources" - return self._properties['fileRef'].Name() + ' in ' + self.parent.Name() + def Name(self): + # Example: "main.cc in Sources" + return self._properties["fileRef"].Name() + " in " + self.parent.Name() - def Hashables(self): - # super - hashables = XCObject.Hashables(self) + def Hashables(self): + # super + hashables = XCObject.Hashables(self) - # It is not sufficient to just rely on Name() to get the - # XCFileLikeElement's name, because that is not a complete pathname. - # PathHashables returns hashables unique enough that no two - # PBXBuildFiles should wind up with the same set of hashables, unless - # someone adds the same file multiple times to the same target. That - # would be considered invalid anyway. - hashables.extend(self._properties['fileRef'].PathHashables()) + # It is not sufficient to just rely on Name() to get the + # XCFileLikeElement's name, because that is not a complete pathname. + # PathHashables returns hashables unique enough that no two + # PBXBuildFiles should wind up with the same set of hashables, unless + # someone adds the same file multiple times to the same target. That + # would be considered invalid anyway. + hashables.extend(self._properties["fileRef"].PathHashables()) - return hashables + return hashables class XCBuildPhase(XCObject): - """Abstract base for build phase classes. Not represented in a project + """Abstract base for build phase classes. Not represented in a project file. Attributes: @@ -1737,51 +1847,52 @@ class XCBuildPhase(XCObject): to the corresponding PBXBuildFile children (values). """ - # TODO(mark): Some build phase types, like PBXShellScriptBuildPhase, don't - # actually have a "files" list. XCBuildPhase should not have "files" but - # another abstract subclass of it should provide this, and concrete build - # phase types that do have "files" lists should be derived from that new - # abstract subclass. XCBuildPhase should only provide buildActionMask and - # runOnlyForDeploymentPostprocessing, and not files or the various - # file-related methods and attributes. - - _schema = XCObject._schema.copy() - _schema.update({ - 'buildActionMask': [0, int, 0, 1, 0x7fffffff], - 'files': [1, PBXBuildFile, 1, 1, []], - 'runOnlyForDeploymentPostprocessing': [0, int, 0, 1, 0], - }) - - def __init__(self, properties=None, id=None, parent=None): - # super - XCObject.__init__(self, properties, id, parent) + # TODO(mark): Some build phase types, like PBXShellScriptBuildPhase, don't + # actually have a "files" list. XCBuildPhase should not have "files" but + # another abstract subclass of it should provide this, and concrete build + # phase types that do have "files" lists should be derived from that new + # abstract subclass. XCBuildPhase should only provide buildActionMask and + # runOnlyForDeploymentPostprocessing, and not files or the various + # file-related methods and attributes. + + _schema = XCObject._schema.copy() + _schema.update( + { + "buildActionMask": [0, int, 0, 1, 0x7FFFFFFF], + "files": [1, PBXBuildFile, 1, 1, []], + "runOnlyForDeploymentPostprocessing": [0, int, 0, 1, 0], + } + ) - self._files_by_path = {} - self._files_by_xcfilelikeelement = {} - for pbxbuildfile in self._properties.get('files', []): - self._AddBuildFileToDicts(pbxbuildfile) + def __init__(self, properties=None, id=None, parent=None): + # super + XCObject.__init__(self, properties, id, parent) - def FileGroup(self, path): - # Subclasses must override this by returning a two-element tuple. The - # first item in the tuple should be the PBXGroup to which "path" should be - # added, either as a child or deeper descendant. The second item should - # be a boolean indicating whether files should be added into hierarchical - # groups or one single flat group. - raise NotImplementedError( - self.__class__.__name__ + ' must implement FileGroup') + self._files_by_path = {} + self._files_by_xcfilelikeelement = {} + for pbxbuildfile in self._properties.get("files", []): + self._AddBuildFileToDicts(pbxbuildfile) - def _AddPathToDict(self, pbxbuildfile, path): - """Adds path to the dict tracking paths belonging to this build phase. + def FileGroup(self, path): + # Subclasses must override this by returning a two-element tuple. The + # first item in the tuple should be the PBXGroup to which "path" should be + # added, either as a child or deeper descendant. The second item should + # be a boolean indicating whether files should be added into hierarchical + # groups or one single flat group. + raise NotImplementedError(self.__class__.__name__ + " must implement FileGroup") + + def _AddPathToDict(self, pbxbuildfile, path): + """Adds path to the dict tracking paths belonging to this build phase. If the path is already a member of this build phase, raises an exception. """ - if path in self._files_by_path: - raise ValueError('Found multiple build files with path ' + path) - self._files_by_path[path] = pbxbuildfile + if path in self._files_by_path: + raise ValueError("Found multiple build files with path " + path) + self._files_by_path[path] = pbxbuildfile - def _AddBuildFileToDicts(self, pbxbuildfile, path=None): - """Maintains the _files_by_path and _files_by_xcfilelikeelement dicts. + def _AddBuildFileToDicts(self, pbxbuildfile, path=None): + """Maintains the _files_by_path and _files_by_xcfilelikeelement dicts. If path is specified, then it is the path that is being added to the phase, and pbxbuildfile must contain either a PBXFileReference directly @@ -1806,684 +1917,823 @@ def _AddBuildFileToDicts(self, pbxbuildfile, path=None): the PBXBuildFile if it is already present in the list of children. """ - xcfilelikeelement = pbxbuildfile._properties['fileRef'] + xcfilelikeelement = pbxbuildfile._properties["fileRef"] - paths = [] - if path != None: - # It's best when the caller provides the path. - if isinstance(xcfilelikeelement, PBXVariantGroup): - paths.append(path) - else: - # If the caller didn't provide a path, there can be either multiple - # paths (PBXVariantGroup) or one. - if isinstance(xcfilelikeelement, PBXVariantGroup): - for variant in xcfilelikeelement._properties['children']: - paths.append(variant.FullPath()) - else: - paths.append(xcfilelikeelement.FullPath()) - - # Add the paths first, because if something's going to raise, the - # messages provided by _AddPathToDict are more useful owing to its - # having access to a real pathname and not just an object's Name(). - for a_path in paths: - self._AddPathToDict(pbxbuildfile, a_path) - - # If another PBXBuildFile references this XCFileLikeElement, there's a - # problem. - if xcfilelikeelement in self._files_by_xcfilelikeelement and \ - self._files_by_xcfilelikeelement[xcfilelikeelement] != pbxbuildfile: - raise ValueError('Found multiple build files for ' + \ - xcfilelikeelement.Name()) - self._files_by_xcfilelikeelement[xcfilelikeelement] = pbxbuildfile - - def AppendBuildFile(self, pbxbuildfile, path=None): - # Callers should use this instead of calling - # AppendProperty('files', pbxbuildfile) directly because this function - # maintains the object's dicts. Better yet, callers can just call AddFile - # with a pathname and not worry about building their own PBXBuildFile - # objects. - self.AppendProperty('files', pbxbuildfile) - self._AddBuildFileToDicts(pbxbuildfile, path) - - def AddFile(self, path, settings=None): - (file_group, hierarchical) = self.FileGroup(path) - file_ref = file_group.AddOrGetFileByPath(path, hierarchical) - - if file_ref in self._files_by_xcfilelikeelement and \ - isinstance(file_ref, PBXVariantGroup): - # There's already a PBXBuildFile in this phase corresponding to the - # PBXVariantGroup. path just provides a new variant that belongs to - # the group. Add the path to the dict. - pbxbuildfile = self._files_by_xcfilelikeelement[file_ref] - self._AddBuildFileToDicts(pbxbuildfile, path) - else: - # Add a new PBXBuildFile to get file_ref into the phase. - if settings is None: - pbxbuildfile = PBXBuildFile({'fileRef': file_ref}) - else: - pbxbuildfile = PBXBuildFile({'fileRef': file_ref, 'settings': settings}) - self.AppendBuildFile(pbxbuildfile, path) + paths = [] + if path is not None: + # It's best when the caller provides the path. + if isinstance(xcfilelikeelement, PBXVariantGroup): + paths.append(path) + else: + # If the caller didn't provide a path, there can be either multiple + # paths (PBXVariantGroup) or one. + if isinstance(xcfilelikeelement, PBXVariantGroup): + for variant in xcfilelikeelement._properties["children"]: + paths.append(variant.FullPath()) + else: + paths.append(xcfilelikeelement.FullPath()) + + # Add the paths first, because if something's going to raise, the + # messages provided by _AddPathToDict are more useful owing to its + # having access to a real pathname and not just an object's Name(). + for a_path in paths: + self._AddPathToDict(pbxbuildfile, a_path) + + # If another PBXBuildFile references this XCFileLikeElement, there's a + # problem. + if ( + xcfilelikeelement in self._files_by_xcfilelikeelement + and self._files_by_xcfilelikeelement[xcfilelikeelement] != pbxbuildfile + ): + raise ValueError( + "Found multiple build files for " + xcfilelikeelement.Name() + ) + self._files_by_xcfilelikeelement[xcfilelikeelement] = pbxbuildfile + + def AppendBuildFile(self, pbxbuildfile, path=None): + # Callers should use this instead of calling + # AppendProperty('files', pbxbuildfile) directly because this function + # maintains the object's dicts. Better yet, callers can just call AddFile + # with a pathname and not worry about building their own PBXBuildFile + # objects. + self.AppendProperty("files", pbxbuildfile) + self._AddBuildFileToDicts(pbxbuildfile, path) + + def AddFile(self, path, settings=None): + (file_group, hierarchical) = self.FileGroup(path) + file_ref = file_group.AddOrGetFileByPath(path, hierarchical) + + if file_ref in self._files_by_xcfilelikeelement and isinstance( + file_ref, PBXVariantGroup + ): + # There's already a PBXBuildFile in this phase corresponding to the + # PBXVariantGroup. path just provides a new variant that belongs to + # the group. Add the path to the dict. + pbxbuildfile = self._files_by_xcfilelikeelement[file_ref] + self._AddBuildFileToDicts(pbxbuildfile, path) + else: + # Add a new PBXBuildFile to get file_ref into the phase. + if settings is None: + pbxbuildfile = PBXBuildFile({"fileRef": file_ref}) + else: + pbxbuildfile = PBXBuildFile({"fileRef": file_ref, "settings": settings}) + self.AppendBuildFile(pbxbuildfile, path) class PBXHeadersBuildPhase(XCBuildPhase): - # No additions to the schema relative to XCBuildPhase. + # No additions to the schema relative to XCBuildPhase. - def Name(self): - return 'Headers' + def Name(self): + return "Headers" - def FileGroup(self, path): - return self.PBXProjectAncestor().RootGroupForPath(path) + def FileGroup(self, path): + return self.PBXProjectAncestor().RootGroupForPath(path) class PBXResourcesBuildPhase(XCBuildPhase): - # No additions to the schema relative to XCBuildPhase. + # No additions to the schema relative to XCBuildPhase. - def Name(self): - return 'Resources' + def Name(self): + return "Resources" - def FileGroup(self, path): - return self.PBXProjectAncestor().RootGroupForPath(path) + def FileGroup(self, path): + return self.PBXProjectAncestor().RootGroupForPath(path) class PBXSourcesBuildPhase(XCBuildPhase): - # No additions to the schema relative to XCBuildPhase. + # No additions to the schema relative to XCBuildPhase. - def Name(self): - return 'Sources' + def Name(self): + return "Sources" - def FileGroup(self, path): - return self.PBXProjectAncestor().RootGroupForPath(path) + def FileGroup(self, path): + return self.PBXProjectAncestor().RootGroupForPath(path) class PBXFrameworksBuildPhase(XCBuildPhase): - # No additions to the schema relative to XCBuildPhase. - - def Name(self): - return 'Frameworks' - - def FileGroup(self, path): - (root, ext) = posixpath.splitext(path) - if ext != '': - ext = ext[1:].lower() - if ext == 'o': - # .o files are added to Xcode Frameworks phases, but conceptually aren't - # frameworks, they're more like sources or intermediates. Redirect them - # to show up in one of those other groups. - return self.PBXProjectAncestor().RootGroupForPath(path) - else: - return (self.PBXProjectAncestor().FrameworksGroup(), False) + # No additions to the schema relative to XCBuildPhase. + + def Name(self): + return "Frameworks" + + def FileGroup(self, path): + (root, ext) = posixpath.splitext(path) + if ext != "": + ext = ext[1:].lower() + if ext == "o": + # .o files are added to Xcode Frameworks phases, but conceptually aren't + # frameworks, they're more like sources or intermediates. Redirect them + # to show up in one of those other groups. + return self.PBXProjectAncestor().RootGroupForPath(path) + else: + return (self.PBXProjectAncestor().FrameworksGroup(), False) class PBXShellScriptBuildPhase(XCBuildPhase): - _schema = XCBuildPhase._schema.copy() - _schema.update({ - 'inputPaths': [1, str, 0, 1, []], - 'name': [0, str, 0, 0], - 'outputPaths': [1, str, 0, 1, []], - 'shellPath': [0, str, 0, 1, '/bin/sh'], - 'shellScript': [0, str, 0, 1], - 'showEnvVarsInLog': [0, int, 0, 0], - }) + _schema = XCBuildPhase._schema.copy() + _schema.update( + { + "inputPaths": [1, str, 0, 1, []], + "name": [0, str, 0, 0], + "outputPaths": [1, str, 0, 1, []], + "shellPath": [0, str, 0, 1, "/bin/sh"], + "shellScript": [0, str, 0, 1], + "showEnvVarsInLog": [0, int, 0, 0], + } + ) - def Name(self): - if 'name' in self._properties: - return self._properties['name'] + def Name(self): + if "name" in self._properties: + return self._properties["name"] - return 'ShellScript' + return "ShellScript" class PBXCopyFilesBuildPhase(XCBuildPhase): - _schema = XCBuildPhase._schema.copy() - _schema.update({ - 'dstPath': [0, str, 0, 1], - 'dstSubfolderSpec': [0, int, 0, 1], - 'name': [0, str, 0, 0], - }) - - # path_tree_re matches "$(DIR)/path" or just "$(DIR)". Match group 1 is - # "DIR", match group 3 is "path" or None. - path_tree_re = re.compile('^\\$\\((.*)\\)(/(.*)|)$') - - # path_tree_to_subfolder maps names of Xcode variables to the associated - # dstSubfolderSpec property value used in a PBXCopyFilesBuildPhase object. - path_tree_to_subfolder = { - 'BUILT_FRAMEWORKS_DIR': 10, # Frameworks Directory - 'BUILT_PRODUCTS_DIR': 16, # Products Directory - # Other types that can be chosen via the Xcode UI. - # TODO(mark): Map Xcode variable names to these. - # : 1, # Wrapper - # : 6, # Executables: 6 - # : 7, # Resources - # : 15, # Java Resources - # : 11, # Shared Frameworks - # : 12, # Shared Support - # : 13, # PlugIns - } - - def Name(self): - if 'name' in self._properties: - return self._properties['name'] - - return 'CopyFiles' - - def FileGroup(self, path): - return self.PBXProjectAncestor().RootGroupForPath(path) - - def SetDestination(self, path): - """Set the dstSubfolderSpec and dstPath properties from path. + _schema = XCBuildPhase._schema.copy() + _schema.update( + { + "dstPath": [0, str, 0, 1], + "dstSubfolderSpec": [0, int, 0, 1], + "name": [0, str, 0, 0], + } + ) + + # path_tree_re matches "$(DIR)/path", "$(DIR)/$(DIR2)/path" or just "$(DIR)". + # Match group 1 is "DIR", group 3 is "path" or "$(DIR2") or "$(DIR2)/path" + # or None. If group 3 is "path", group 4 will be None otherwise group 4 is + # "DIR2" and group 6 is "path". + path_tree_re = re.compile(r"^\$\((.*?)\)(/(\$\((.*?)\)(/(.*)|)|(.*)|)|)$") + + # path_tree_{first,second}_to_subfolder map names of Xcode variables to the + # associated dstSubfolderSpec property value used in a PBXCopyFilesBuildPhase + # object. + path_tree_first_to_subfolder = { + # Types that can be chosen via the Xcode UI. + "BUILT_PRODUCTS_DIR": 16, # Products Directory + "BUILT_FRAMEWORKS_DIR": 10, # Not an official Xcode macro. + # Existed before support for the + # names below was added. Maps to + # "Frameworks". + } + + path_tree_second_to_subfolder = { + "WRAPPER_NAME": 1, # Wrapper + # Although Xcode's friendly name is "Executables", the destination + # is demonstrably the value of the build setting + # EXECUTABLE_FOLDER_PATH not EXECUTABLES_FOLDER_PATH. + "EXECUTABLE_FOLDER_PATH": 6, # Executables. + "UNLOCALIZED_RESOURCES_FOLDER_PATH": 7, # Resources + "JAVA_FOLDER_PATH": 15, # Java Resources + "FRAMEWORKS_FOLDER_PATH": 10, # Frameworks + "SHARED_FRAMEWORKS_FOLDER_PATH": 11, # Shared Frameworks + "SHARED_SUPPORT_FOLDER_PATH": 12, # Shared Support + "PLUGINS_FOLDER_PATH": 13, # PlugIns + # For XPC Services, Xcode sets both dstPath and dstSubfolderSpec. + # Note that it re-uses the BUILT_PRODUCTS_DIR value for + # dstSubfolderSpec. dstPath is set below. + "XPCSERVICES_FOLDER_PATH": 16, # XPC Services. + } + + def Name(self): + if "name" in self._properties: + return self._properties["name"] + + return "CopyFiles" + + def FileGroup(self, path): + return self.PBXProjectAncestor().RootGroupForPath(path) + + def SetDestination(self, path): + """Set the dstSubfolderSpec and dstPath properties from path. path may be specified in the same notation used for XCHierarchicalElements, specifically, "$(DIR)/path". """ - path_tree_match = self.path_tree_re.search(path) - if path_tree_match: - # Everything else needs to be relative to an Xcode variable. - path_tree = path_tree_match.group(1) - relative_path = path_tree_match.group(3) - - if path_tree in self.path_tree_to_subfolder: - subfolder = self.path_tree_to_subfolder[path_tree] - if relative_path is None: - relative_path = '' - else: - # The path starts with an unrecognized Xcode variable - # name like $(SRCROOT). Xcode will still handle this - # as an "absolute path" that starts with the variable. - subfolder = 0 - relative_path = path - elif path.startswith('/'): - # Special case. Absolute paths are in dstSubfolderSpec 0. - subfolder = 0 - relative_path = path[1:] - else: - raise ValueError('Can\'t use path %s in a %s' % \ - (path, self.__class__.__name__)) + path_tree_match = self.path_tree_re.search(path) + if path_tree_match: + path_tree = path_tree_match.group(1) + if path_tree in self.path_tree_first_to_subfolder: + subfolder = self.path_tree_first_to_subfolder[path_tree] + relative_path = path_tree_match.group(3) + if relative_path is None: + relative_path = "" + + if subfolder == 16 and path_tree_match.group(4) is not None: + # BUILT_PRODUCTS_DIR (16) is the first element in a path whose + # second element is possibly one of the variable names in + # path_tree_second_to_subfolder. Xcode sets the values of all these + # variables to relative paths so .gyp files must prefix them with + # BUILT_PRODUCTS_DIR, e.g. + # $(BUILT_PRODUCTS_DIR)/$(PLUGINS_FOLDER_PATH). Then + # xcode_emulation.py can export these variables with the same values + # as Xcode yet make & ninja files can determine the absolute path + # to the target. Xcode uses the dstSubfolderSpec value set here + # to determine the full path. + # + # An alternative of xcode_emulation.py setting the values to absolute + # paths when exporting these variables has been ruled out because + # then the values would be different depending on the build tool. + # + # Another alternative is to invent new names for the variables used + # to match to the subfolder indices in the second table. .gyp files + # then will not need to prepend $(BUILT_PRODUCTS_DIR) because + # xcode_emulation.py can set the values of those variables to + # the absolute paths when exporting. This is possibly the thinking + # behind BUILT_FRAMEWORKS_DIR which is used in exactly this manner. + # + # Requiring prepending BUILT_PRODUCTS_DIR has been chosen because + # this same way could be used to specify destinations in .gyp files + # that pre-date this addition to GYP. However they would only work + # with the Xcode generator. The previous version of xcode_emulation.py + # does not export these variables. Such files will get the benefit + # of the Xcode UI showing the proper destination name simply by + # regenerating the projects with this version of GYP. + path_tree = path_tree_match.group(4) + relative_path = path_tree_match.group(6) + separator = "/" + + if path_tree in self.path_tree_second_to_subfolder: + subfolder = self.path_tree_second_to_subfolder[path_tree] + if relative_path is None: + relative_path = "" + separator = "" + if path_tree == "XPCSERVICES_FOLDER_PATH": + relative_path = ( + "$(CONTENTS_FOLDER_PATH)/XPCServices" + + separator + + relative_path + ) + else: + # subfolder = 16 from above + # The second element of the path is an unrecognized variable. + # Include it and any remaining elements in relative_path. + relative_path = path_tree_match.group(3) + + else: + # The path starts with an unrecognized Xcode variable + # name like $(SRCROOT). Xcode will still handle this + # as an "absolute path" that starts with the variable. + subfolder = 0 + relative_path = path + elif path.startswith("/"): + # Special case. Absolute paths are in dstSubfolderSpec 0. + subfolder = 0 + relative_path = path[1:] + else: + raise ValueError( + "Can't use path %s in a %s" % (path, self.__class__.__name__) + ) - self._properties['dstPath'] = relative_path - self._properties['dstSubfolderSpec'] = subfolder + self._properties["dstPath"] = relative_path + self._properties["dstSubfolderSpec"] = subfolder class PBXBuildRule(XCObject): - _schema = XCObject._schema.copy() - _schema.update({ - 'compilerSpec': [0, str, 0, 1], - 'filePatterns': [0, str, 0, 0], - 'fileType': [0, str, 0, 1], - 'isEditable': [0, int, 0, 1, 1], - 'outputFiles': [1, str, 0, 1, []], - 'script': [0, str, 0, 0], - }) - - def Name(self): - # Not very inspired, but it's what Xcode uses. - return self.__class__.__name__ - - def Hashables(self): - # super - hashables = XCObject.Hashables(self) + _schema = XCObject._schema.copy() + _schema.update( + { + "compilerSpec": [0, str, 0, 1], + "filePatterns": [0, str, 0, 0], + "fileType": [0, str, 0, 1], + "isEditable": [0, int, 0, 1, 1], + "outputFiles": [1, str, 0, 1, []], + "script": [0, str, 0, 0], + } + ) - # Use the hashables of the weak objects that this object refers to. - hashables.append(self._properties['fileType']) - if 'filePatterns' in self._properties: - hashables.append(self._properties['filePatterns']) - return hashables + def Name(self): + # Not very inspired, but it's what Xcode uses. + return self.__class__.__name__ + + def Hashables(self): + # super + hashables = XCObject.Hashables(self) + + # Use the hashables of the weak objects that this object refers to. + hashables.append(self._properties["fileType"]) + if "filePatterns" in self._properties: + hashables.append(self._properties["filePatterns"]) + return hashables class PBXContainerItemProxy(XCObject): - # When referencing an item in this project file, containerPortal is the - # PBXProject root object of this project file. When referencing an item in - # another project file, containerPortal is a PBXFileReference identifying - # the other project file. - # - # When serving as a proxy to an XCTarget (in this project file or another), - # proxyType is 1. When serving as a proxy to a PBXFileReference (in another - # project file), proxyType is 2. Type 2 is used for references to the - # producs of the other project file's targets. - # - # Xcode is weird about remoteGlobalIDString. Usually, it's printed without - # a comment, indicating that it's tracked internally simply as a string, but - # sometimes it's printed with a comment (usually when the object is initially - # created), indicating that it's tracked as a project file object at least - # sometimes. This module always tracks it as an object, but contains a hack - # to prevent it from printing the comment in the project file output. See - # _XCKVPrint. - _schema = XCObject._schema.copy() - _schema.update({ - 'containerPortal': [0, XCContainerPortal, 0, 1], - 'proxyType': [0, int, 0, 1], - 'remoteGlobalIDString': [0, XCRemoteObject, 0, 1], - 'remoteInfo': [0, str, 0, 1], - }) - - def __repr__(self): - props = self._properties - name = '%s.gyp:%s' % (props['containerPortal'].Name(), props['remoteInfo']) - return '<%s %r at 0x%x>' % (self.__class__.__name__, name, id(self)) - - def Name(self): - # Admittedly not the best name, but it's what Xcode uses. - return self.__class__.__name__ - - def Hashables(self): - # super - hashables = XCObject.Hashables(self) + # When referencing an item in this project file, containerPortal is the + # PBXProject root object of this project file. When referencing an item in + # another project file, containerPortal is a PBXFileReference identifying + # the other project file. + # + # When serving as a proxy to an XCTarget (in this project file or another), + # proxyType is 1. When serving as a proxy to a PBXFileReference (in another + # project file), proxyType is 2. Type 2 is used for references to the + # producs of the other project file's targets. + # + # Xcode is weird about remoteGlobalIDString. Usually, it's printed without + # a comment, indicating that it's tracked internally simply as a string, but + # sometimes it's printed with a comment (usually when the object is initially + # created), indicating that it's tracked as a project file object at least + # sometimes. This module always tracks it as an object, but contains a hack + # to prevent it from printing the comment in the project file output. See + # _XCKVPrint. + _schema = XCObject._schema.copy() + _schema.update( + { + "containerPortal": [0, XCContainerPortal, 0, 1], + "proxyType": [0, int, 0, 1], + "remoteGlobalIDString": [0, XCRemoteObject, 0, 1], + "remoteInfo": [0, str, 0, 1], + } + ) + + def __repr__(self): + props = self._properties + name = "%s.gyp:%s" % (props["containerPortal"].Name(), props["remoteInfo"]) + return "<%s %r at 0x%x>" % (self.__class__.__name__, name, id(self)) + + def Name(self): + # Admittedly not the best name, but it's what Xcode uses. + return self.__class__.__name__ + + def Hashables(self): + # super + hashables = XCObject.Hashables(self) - # Use the hashables of the weak objects that this object refers to. - hashables.extend(self._properties['containerPortal'].Hashables()) - hashables.extend(self._properties['remoteGlobalIDString'].Hashables()) - return hashables + # Use the hashables of the weak objects that this object refers to. + hashables.extend(self._properties["containerPortal"].Hashables()) + hashables.extend(self._properties["remoteGlobalIDString"].Hashables()) + return hashables class PBXTargetDependency(XCObject): - # The "target" property accepts an XCTarget object, and obviously not - # NoneType. But XCTarget is defined below, so it can't be put into the - # schema yet. The definition of PBXTargetDependency can't be moved below - # XCTarget because XCTarget's own schema references PBXTargetDependency. - # Python doesn't deal well with this circular relationship, and doesn't have - # a real way to do forward declarations. To work around, the type of - # the "target" property is reset below, after XCTarget is defined. - # - # At least one of "name" and "target" is required. - _schema = XCObject._schema.copy() - _schema.update({ - 'name': [0, str, 0, 0], - 'target': [0, None.__class__, 0, 0], - 'targetProxy': [0, PBXContainerItemProxy, 1, 1], - }) - - def __repr__(self): - name = self._properties.get('name') or self._properties['target'].Name() - return '<%s %r at 0x%x>' % (self.__class__.__name__, name, id(self)) - - def Name(self): - # Admittedly not the best name, but it's what Xcode uses. - return self.__class__.__name__ - - def Hashables(self): - # super - hashables = XCObject.Hashables(self) + # The "target" property accepts an XCTarget object, and obviously not + # NoneType. But XCTarget is defined below, so it can't be put into the + # schema yet. The definition of PBXTargetDependency can't be moved below + # XCTarget because XCTarget's own schema references PBXTargetDependency. + # Python doesn't deal well with this circular relationship, and doesn't have + # a real way to do forward declarations. To work around, the type of + # the "target" property is reset below, after XCTarget is defined. + # + # At least one of "name" and "target" is required. + _schema = XCObject._schema.copy() + _schema.update( + { + "name": [0, str, 0, 0], + "target": [0, None.__class__, 0, 0], + "targetProxy": [0, PBXContainerItemProxy, 1, 1], + } + ) + + def __repr__(self): + name = self._properties.get("name") or self._properties["target"].Name() + return "<%s %r at 0x%x>" % (self.__class__.__name__, name, id(self)) + + def Name(self): + # Admittedly not the best name, but it's what Xcode uses. + return self.__class__.__name__ - # Use the hashables of the weak objects that this object refers to. - hashables.extend(self._properties['targetProxy'].Hashables()) - return hashables + def Hashables(self): + # super + hashables = XCObject.Hashables(self) + + # Use the hashables of the weak objects that this object refers to. + hashables.extend(self._properties["targetProxy"].Hashables()) + return hashables class PBXReferenceProxy(XCFileLikeElement): - _schema = XCFileLikeElement._schema.copy() - _schema.update({ - 'fileType': [0, str, 0, 1], - 'path': [0, str, 0, 1], - 'remoteRef': [0, PBXContainerItemProxy, 1, 1], - }) + _schema = XCFileLikeElement._schema.copy() + _schema.update( + { + "fileType": [0, str, 0, 1], + "path": [0, str, 0, 1], + "remoteRef": [0, PBXContainerItemProxy, 1, 1], + } + ) class XCTarget(XCRemoteObject): - # An XCTarget is really just an XCObject, the XCRemoteObject thing is just - # to allow PBXProject to be used in the remoteGlobalIDString property of - # PBXContainerItemProxy. - # - # Setting a "name" property at instantiation may also affect "productName", - # which may in turn affect the "PRODUCT_NAME" build setting in children of - # "buildConfigurationList". See __init__ below. - _schema = XCRemoteObject._schema.copy() - _schema.update({ - 'buildConfigurationList': [0, XCConfigurationList, 1, 1, - XCConfigurationList()], - 'buildPhases': [1, XCBuildPhase, 1, 1, []], - 'dependencies': [1, PBXTargetDependency, 1, 1, []], - 'name': [0, str, 0, 1], - 'productName': [0, str, 0, 1], - }) - - def __init__(self, properties=None, id=None, parent=None, - force_outdir=None, force_prefix=None, force_extension=None): - # super - XCRemoteObject.__init__(self, properties, id, parent) - - # Set up additional defaults not expressed in the schema. If a "name" - # property was supplied, set "productName" if it is not present. Also set - # the "PRODUCT_NAME" build setting in each configuration, but only if - # the setting is not present in any build configuration. - if 'name' in self._properties: - if not 'productName' in self._properties: - self.SetProperty('productName', self._properties['name']) - - if 'productName' in self._properties: - if 'buildConfigurationList' in self._properties: - configs = self._properties['buildConfigurationList'] - if configs.HasBuildSetting('PRODUCT_NAME') == 0: - configs.SetBuildSetting('PRODUCT_NAME', - self._properties['productName']) - - def AddDependency(self, other): - pbxproject = self.PBXProjectAncestor() - other_pbxproject = other.PBXProjectAncestor() - if pbxproject == other_pbxproject: - # Add a dependency to another target in the same project file. - container = PBXContainerItemProxy({'containerPortal': pbxproject, - 'proxyType': 1, - 'remoteGlobalIDString': other, - 'remoteInfo': other.Name()}) - dependency = PBXTargetDependency({'target': other, - 'targetProxy': container}) - self.AppendProperty('dependencies', dependency) - else: - # Add a dependency to a target in a different project file. - other_project_ref = \ - pbxproject.AddOrGetProjectReference(other_pbxproject)[1] - container = PBXContainerItemProxy({ - 'containerPortal': other_project_ref, - 'proxyType': 1, - 'remoteGlobalIDString': other, - 'remoteInfo': other.Name(), - }) - dependency = PBXTargetDependency({'name': other.Name(), - 'targetProxy': container}) - self.AppendProperty('dependencies', dependency) + # An XCTarget is really just an XCObject, the XCRemoteObject thing is just + # to allow PBXProject to be used in the remoteGlobalIDString property of + # PBXContainerItemProxy. + # + # Setting a "name" property at instantiation may also affect "productName", + # which may in turn affect the "PRODUCT_NAME" build setting in children of + # "buildConfigurationList". See __init__ below. + _schema = XCRemoteObject._schema.copy() + _schema.update( + { + "buildConfigurationList": [ + 0, + XCConfigurationList, + 1, + 1, + XCConfigurationList(), + ], + "buildPhases": [1, XCBuildPhase, 1, 1, []], + "dependencies": [1, PBXTargetDependency, 1, 1, []], + "name": [0, str, 0, 1], + "productName": [0, str, 0, 1], + } + ) + + def __init__( + self, + properties=None, + id=None, + parent=None, + force_outdir=None, + force_prefix=None, + force_extension=None, + ): + # super + XCRemoteObject.__init__(self, properties, id, parent) + + # Set up additional defaults not expressed in the schema. If a "name" + # property was supplied, set "productName" if it is not present. Also set + # the "PRODUCT_NAME" build setting in each configuration, but only if + # the setting is not present in any build configuration. + if "name" in self._properties: + if "productName" not in self._properties: + self.SetProperty("productName", self._properties["name"]) + + if "productName" in self._properties: + if "buildConfigurationList" in self._properties: + configs = self._properties["buildConfigurationList"] + if configs.HasBuildSetting("PRODUCT_NAME") == 0: + configs.SetBuildSetting( + "PRODUCT_NAME", self._properties["productName"] + ) + + def AddDependency(self, other): + pbxproject = self.PBXProjectAncestor() + other_pbxproject = other.PBXProjectAncestor() + if pbxproject == other_pbxproject: + # Add a dependency to another target in the same project file. + container = PBXContainerItemProxy( + { + "containerPortal": pbxproject, + "proxyType": 1, + "remoteGlobalIDString": other, + "remoteInfo": other.Name(), + } + ) + dependency = PBXTargetDependency( + {"target": other, "targetProxy": container} + ) + self.AppendProperty("dependencies", dependency) + else: + # Add a dependency to a target in a different project file. + other_project_ref = pbxproject.AddOrGetProjectReference(other_pbxproject)[1] + container = PBXContainerItemProxy( + { + "containerPortal": other_project_ref, + "proxyType": 1, + "remoteGlobalIDString": other, + "remoteInfo": other.Name(), + } + ) + dependency = PBXTargetDependency( + {"name": other.Name(), "targetProxy": container} + ) + self.AppendProperty("dependencies", dependency) - # Proxy all of these through to the build configuration list. + # Proxy all of these through to the build configuration list. - def ConfigurationNamed(self, name): - return self._properties['buildConfigurationList'].ConfigurationNamed(name) + def ConfigurationNamed(self, name): + return self._properties["buildConfigurationList"].ConfigurationNamed(name) - def DefaultConfiguration(self): - return self._properties['buildConfigurationList'].DefaultConfiguration() + def DefaultConfiguration(self): + return self._properties["buildConfigurationList"].DefaultConfiguration() - def HasBuildSetting(self, key): - return self._properties['buildConfigurationList'].HasBuildSetting(key) + def HasBuildSetting(self, key): + return self._properties["buildConfigurationList"].HasBuildSetting(key) - def GetBuildSetting(self, key): - return self._properties['buildConfigurationList'].GetBuildSetting(key) + def GetBuildSetting(self, key): + return self._properties["buildConfigurationList"].GetBuildSetting(key) - def SetBuildSetting(self, key, value): - return self._properties['buildConfigurationList'].SetBuildSetting(key, \ - value) + def SetBuildSetting(self, key, value): + return self._properties["buildConfigurationList"].SetBuildSetting(key, value) - def AppendBuildSetting(self, key, value): - return self._properties['buildConfigurationList'].AppendBuildSetting(key, \ - value) + def AppendBuildSetting(self, key, value): + return self._properties["buildConfigurationList"].AppendBuildSetting(key, value) - def DelBuildSetting(self, key): - return self._properties['buildConfigurationList'].DelBuildSetting(key) + def DelBuildSetting(self, key): + return self._properties["buildConfigurationList"].DelBuildSetting(key) # Redefine the type of the "target" property. See PBXTargetDependency._schema # above. -PBXTargetDependency._schema['target'][1] = XCTarget +PBXTargetDependency._schema["target"][1] = XCTarget class PBXNativeTarget(XCTarget): - # buildPhases is overridden in the schema to be able to set defaults. - # - # NOTE: Contrary to most objects, it is advisable to set parent when - # constructing PBXNativeTarget. A parent of an XCTarget must be a PBXProject - # object. A parent reference is required for a PBXNativeTarget during - # construction to be able to set up the target defaults for productReference, - # because a PBXBuildFile object must be created for the target and it must - # be added to the PBXProject's mainGroup hierarchy. - _schema = XCTarget._schema.copy() - _schema.update({ - 'buildPhases': [1, XCBuildPhase, 1, 1, - [PBXSourcesBuildPhase(), PBXFrameworksBuildPhase()]], - 'buildRules': [1, PBXBuildRule, 1, 1, []], - 'productReference': [0, PBXFileReference, 0, 1], - 'productType': [0, str, 0, 1], - }) - - # Mapping from Xcode product-types to settings. The settings are: - # filetype : used for explicitFileType in the project file - # prefix : the prefix for the file name - # suffix : the suffix for the file name - _product_filetypes = { - 'com.apple.product-type.application': ['wrapper.application', - '', '.app'], - 'com.apple.product-type.application.watchapp': ['wrapper.application', - '', '.app'], - 'com.apple.product-type.watchkit-extension': ['wrapper.app-extension', - '', '.appex'], - 'com.apple.product-type.app-extension': ['wrapper.app-extension', - '', '.appex'], - 'com.apple.product-type.bundle': ['wrapper.cfbundle', - '', '.bundle'], - 'com.apple.product-type.framework': ['wrapper.framework', - '', '.framework'], - 'com.apple.product-type.library.dynamic': ['compiled.mach-o.dylib', - 'lib', '.dylib'], - 'com.apple.product-type.library.static': ['archive.ar', - 'lib', '.a'], - 'com.apple.product-type.tool': ['compiled.mach-o.executable', - '', ''], - 'com.apple.product-type.bundle.unit-test': ['wrapper.cfbundle', - '', '.xctest'], - 'com.googlecode.gyp.xcode.bundle': ['compiled.mach-o.dylib', - '', '.so'], - 'com.apple.product-type.kernel-extension': ['wrapper.kext', - '', '.kext'], - } - - def __init__(self, properties=None, id=None, parent=None, - force_outdir=None, force_prefix=None, force_extension=None): - # super - XCTarget.__init__(self, properties, id, parent) - - if 'productName' in self._properties and \ - 'productType' in self._properties and \ - not 'productReference' in self._properties and \ - self._properties['productType'] in self._product_filetypes: - products_group = None - pbxproject = self.PBXProjectAncestor() - if pbxproject != None: - products_group = pbxproject.ProductsGroup() - - if products_group != None: - (filetype, prefix, suffix) = \ - self._product_filetypes[self._properties['productType']] - # Xcode does not have a distinct type for loadable modules that are - # pure BSD targets (not in a bundle wrapper). GYP allows such modules - # to be specified by setting a target type to loadable_module without - # having mac_bundle set. These are mapped to the pseudo-product type - # com.googlecode.gyp.xcode.bundle. - # - # By picking up this special type and converting it to a dynamic - # library (com.apple.product-type.library.dynamic) with fix-ups, - # single-file loadable modules can be produced. - # - # MACH_O_TYPE is changed to mh_bundle to produce the proper file type - # (as opposed to mh_dylib). In order for linking to succeed, - # DYLIB_CURRENT_VERSION and DYLIB_COMPATIBILITY_VERSION must be - # cleared. They are meaningless for type mh_bundle. - # - # Finally, the .so extension is forcibly applied over the default - # (.dylib), unless another forced extension is already selected. - # .dylib is plainly wrong, and .bundle is used by loadable_modules in - # bundle wrappers (com.apple.product-type.bundle). .so seems an odd - # choice because it's used as the extension on many other systems that - # don't distinguish between linkable shared libraries and non-linkable - # loadable modules, but there's precedent: Python loadable modules on - # Mac OS X use an .so extension. - if self._properties['productType'] == 'com.googlecode.gyp.xcode.bundle': - self._properties['productType'] = \ - 'com.apple.product-type.library.dynamic' - self.SetBuildSetting('MACH_O_TYPE', 'mh_bundle') - self.SetBuildSetting('DYLIB_CURRENT_VERSION', '') - self.SetBuildSetting('DYLIB_COMPATIBILITY_VERSION', '') - if force_extension is None: - force_extension = suffix[1:] - - if self._properties['productType'] == \ - 'com.apple.product-type-bundle.unit.test': - if force_extension is None: - force_extension = suffix[1:] - - if force_extension is not None: - # If it's a wrapper (bundle), set WRAPPER_EXTENSION. - # Extension override. - suffix = '.' + force_extension - if filetype.startswith('wrapper.'): - self.SetBuildSetting('WRAPPER_EXTENSION', force_extension) - else: - self.SetBuildSetting('EXECUTABLE_EXTENSION', force_extension) - - if filetype.startswith('compiled.mach-o.executable'): - product_name = self._properties['productName'] - product_name += suffix - suffix = '' - self.SetProperty('productName', product_name) - self.SetBuildSetting('PRODUCT_NAME', product_name) - - # Xcode handles most prefixes based on the target type, however there - # are exceptions. If a "BSD Dynamic Library" target is added in the - # Xcode UI, Xcode sets EXECUTABLE_PREFIX. This check duplicates that - # behavior. - if force_prefix is not None: - prefix = force_prefix - if filetype.startswith('wrapper.'): - self.SetBuildSetting('WRAPPER_PREFIX', prefix) - else: - self.SetBuildSetting('EXECUTABLE_PREFIX', prefix) - - if force_outdir is not None: - self.SetBuildSetting('TARGET_BUILD_DIR', force_outdir) - - # TODO(tvl): Remove the below hack. - # http://code.google.com/p/gyp/issues/detail?id=122 - - # Some targets include the prefix in the target_name. These targets - # really should just add a product_name setting that doesn't include - # the prefix. For example: - # target_name = 'libevent', product_name = 'event' - # This check cleans up for them. - product_name = self._properties['productName'] - prefix_len = len(prefix) - if prefix_len and (product_name[:prefix_len] == prefix): - product_name = product_name[prefix_len:] - self.SetProperty('productName', product_name) - self.SetBuildSetting('PRODUCT_NAME', product_name) - - ref_props = { - 'explicitFileType': filetype, - 'includeInIndex': 0, - 'path': prefix + product_name + suffix, - 'sourceTree': 'BUILT_PRODUCTS_DIR', + # buildPhases is overridden in the schema to be able to set defaults. + # + # NOTE: Contrary to most objects, it is advisable to set parent when + # constructing PBXNativeTarget. A parent of an XCTarget must be a PBXProject + # object. A parent reference is required for a PBXNativeTarget during + # construction to be able to set up the target defaults for productReference, + # because a PBXBuildFile object must be created for the target and it must + # be added to the PBXProject's mainGroup hierarchy. + _schema = XCTarget._schema.copy() + _schema.update( + { + "buildPhases": [ + 1, + XCBuildPhase, + 1, + 1, + [PBXSourcesBuildPhase(), PBXFrameworksBuildPhase()], + ], + "buildRules": [1, PBXBuildRule, 1, 1, []], + "productReference": [0, PBXFileReference, 0, 1], + "productType": [0, str, 0, 1], } - file_ref = PBXFileReference(ref_props) - products_group.AppendChild(file_ref) - self.SetProperty('productReference', file_ref) - - def GetBuildPhaseByType(self, type): - if not 'buildPhases' in self._properties: - return None - - the_phase = None - for phase in self._properties['buildPhases']: - if isinstance(phase, type): - # Some phases may be present in multiples in a well-formed project file, - # but phases like PBXSourcesBuildPhase may only be present singly, and - # this function is intended as an aid to GetBuildPhaseByType. Loop - # over the entire list of phases and assert if more than one of the - # desired type is found. - assert the_phase is None - the_phase = phase - - return the_phase - - def HeadersPhase(self): - headers_phase = self.GetBuildPhaseByType(PBXHeadersBuildPhase) - if headers_phase is None: - headers_phase = PBXHeadersBuildPhase() - - # The headers phase should come before the resources, sources, and - # frameworks phases, if any. - insert_at = len(self._properties['buildPhases']) - for index in range(0, len(self._properties['buildPhases'])): - phase = self._properties['buildPhases'][index] - if isinstance(phase, PBXResourcesBuildPhase) or \ - isinstance(phase, PBXSourcesBuildPhase) or \ - isinstance(phase, PBXFrameworksBuildPhase): - insert_at = index - break - - self._properties['buildPhases'].insert(insert_at, headers_phase) - headers_phase.parent = self - - return headers_phase - - def ResourcesPhase(self): - resources_phase = self.GetBuildPhaseByType(PBXResourcesBuildPhase) - if resources_phase is None: - resources_phase = PBXResourcesBuildPhase() - - # The resources phase should come before the sources and frameworks - # phases, if any. - insert_at = len(self._properties['buildPhases']) - for index in range(0, len(self._properties['buildPhases'])): - phase = self._properties['buildPhases'][index] - if isinstance(phase, PBXSourcesBuildPhase) or \ - isinstance(phase, PBXFrameworksBuildPhase): - insert_at = index - break - - self._properties['buildPhases'].insert(insert_at, resources_phase) - resources_phase.parent = self - - return resources_phase - - def SourcesPhase(self): - sources_phase = self.GetBuildPhaseByType(PBXSourcesBuildPhase) - if sources_phase is None: - sources_phase = PBXSourcesBuildPhase() - self.AppendProperty('buildPhases', sources_phase) - - return sources_phase - - def FrameworksPhase(self): - frameworks_phase = self.GetBuildPhaseByType(PBXFrameworksBuildPhase) - if frameworks_phase is None: - frameworks_phase = PBXFrameworksBuildPhase() - self.AppendProperty('buildPhases', frameworks_phase) - - return frameworks_phase - - def AddDependency(self, other): - # super - XCTarget.AddDependency(self, other) - - static_library_type = 'com.apple.product-type.library.static' - shared_library_type = 'com.apple.product-type.library.dynamic' - framework_type = 'com.apple.product-type.framework' - if isinstance(other, PBXNativeTarget) and \ - 'productType' in self._properties and \ - self._properties['productType'] != static_library_type and \ - 'productType' in other._properties and \ - (other._properties['productType'] == static_library_type or \ - ((other._properties['productType'] == shared_library_type or \ - other._properties['productType'] == framework_type) and \ - ((not other.HasBuildSetting('MACH_O_TYPE')) or - other.GetBuildSetting('MACH_O_TYPE') != 'mh_bundle'))): - - file_ref = other.GetProperty('productReference') - - pbxproject = self.PBXProjectAncestor() - other_pbxproject = other.PBXProjectAncestor() - if pbxproject != other_pbxproject: - other_project_product_group = \ - pbxproject.AddOrGetProjectReference(other_pbxproject)[0] - file_ref = other_project_product_group.GetChildByRemoteObject(file_ref) - - self.FrameworksPhase().AppendProperty('files', - PBXBuildFile({'fileRef': file_ref})) + ) + + # Mapping from Xcode product-types to settings. The settings are: + # filetype : used for explicitFileType in the project file + # prefix : the prefix for the file name + # suffix : the suffix for the file name + _product_filetypes = { + "com.apple.product-type.application": ["wrapper.application", "", ".app"], + "com.apple.product-type.application.watchapp": [ + "wrapper.application", + "", + ".app", + ], + "com.apple.product-type.watchkit-extension": [ + "wrapper.app-extension", + "", + ".appex", + ], + "com.apple.product-type.app-extension": ["wrapper.app-extension", "", ".appex"], + "com.apple.product-type.bundle": ["wrapper.cfbundle", "", ".bundle"], + "com.apple.product-type.framework": ["wrapper.framework", "", ".framework"], + "com.apple.product-type.library.dynamic": [ + "compiled.mach-o.dylib", + "lib", + ".dylib", + ], + "com.apple.product-type.library.static": ["archive.ar", "lib", ".a"], + "com.apple.product-type.tool": ["compiled.mach-o.executable", "", ""], + "com.apple.product-type.bundle.unit-test": ["wrapper.cfbundle", "", ".xctest"], + "com.apple.product-type.bundle.ui-testing": ["wrapper.cfbundle", "", ".xctest"], + "com.googlecode.gyp.xcode.bundle": ["compiled.mach-o.dylib", "", ".so"], + "com.apple.product-type.kernel-extension": ["wrapper.kext", "", ".kext"], + } + + def __init__( + self, + properties=None, + id=None, + parent=None, + force_outdir=None, + force_prefix=None, + force_extension=None, + ): + # super + XCTarget.__init__(self, properties, id, parent) + + if ( + "productName" in self._properties + and "productType" in self._properties + and "productReference" not in self._properties + and self._properties["productType"] in self._product_filetypes + ): + products_group = None + pbxproject = self.PBXProjectAncestor() + if pbxproject is not None: + products_group = pbxproject.ProductsGroup() + + if products_group is not None: + (filetype, prefix, suffix) = self._product_filetypes[ + self._properties["productType"] + ] + # Xcode does not have a distinct type for loadable modules that are + # pure BSD targets (not in a bundle wrapper). GYP allows such modules + # to be specified by setting a target type to loadable_module without + # having mac_bundle set. These are mapped to the pseudo-product type + # com.googlecode.gyp.xcode.bundle. + # + # By picking up this special type and converting it to a dynamic + # library (com.apple.product-type.library.dynamic) with fix-ups, + # single-file loadable modules can be produced. + # + # MACH_O_TYPE is changed to mh_bundle to produce the proper file type + # (as opposed to mh_dylib). In order for linking to succeed, + # DYLIB_CURRENT_VERSION and DYLIB_COMPATIBILITY_VERSION must be + # cleared. They are meaningless for type mh_bundle. + # + # Finally, the .so extension is forcibly applied over the default + # (.dylib), unless another forced extension is already selected. + # .dylib is plainly wrong, and .bundle is used by loadable_modules in + # bundle wrappers (com.apple.product-type.bundle). .so seems an odd + # choice because it's used as the extension on many other systems that + # don't distinguish between linkable shared libraries and non-linkable + # loadable modules, but there's precedent: Python loadable modules on + # Mac OS X use an .so extension. + if self._properties["productType"] == "com.googlecode.gyp.xcode.bundle": + self._properties[ + "productType" + ] = "com.apple.product-type.library.dynamic" + self.SetBuildSetting("MACH_O_TYPE", "mh_bundle") + self.SetBuildSetting("DYLIB_CURRENT_VERSION", "") + self.SetBuildSetting("DYLIB_COMPATIBILITY_VERSION", "") + if force_extension is None: + force_extension = suffix[1:] + + if ( + self._properties["productType"] + == "com.apple.product-type-bundle.unit.test" + or self._properties["productType"] + == "com.apple.product-type-bundle.ui-testing" + ): + if force_extension is None: + force_extension = suffix[1:] + + if force_extension is not None: + # If it's a wrapper (bundle), set WRAPPER_EXTENSION. + # Extension override. + suffix = "." + force_extension + if filetype.startswith("wrapper."): + self.SetBuildSetting("WRAPPER_EXTENSION", force_extension) + else: + self.SetBuildSetting("EXECUTABLE_EXTENSION", force_extension) + + if filetype.startswith("compiled.mach-o.executable"): + product_name = self._properties["productName"] + product_name += suffix + suffix = "" + self.SetProperty("productName", product_name) + self.SetBuildSetting("PRODUCT_NAME", product_name) + + # Xcode handles most prefixes based on the target type, however there + # are exceptions. If a "BSD Dynamic Library" target is added in the + # Xcode UI, Xcode sets EXECUTABLE_PREFIX. This check duplicates that + # behavior. + if force_prefix is not None: + prefix = force_prefix + if filetype.startswith("wrapper."): + self.SetBuildSetting("WRAPPER_PREFIX", prefix) + else: + self.SetBuildSetting("EXECUTABLE_PREFIX", prefix) + + if force_outdir is not None: + self.SetBuildSetting("TARGET_BUILD_DIR", force_outdir) + + # TODO(tvl): Remove the below hack. + # http://code.google.com/p/gyp/issues/detail?id=122 + + # Some targets include the prefix in the target_name. These targets + # really should just add a product_name setting that doesn't include + # the prefix. For example: + # target_name = 'libevent', product_name = 'event' + # This check cleans up for them. + product_name = self._properties["productName"] + prefix_len = len(prefix) + if prefix_len and (product_name[:prefix_len] == prefix): + product_name = product_name[prefix_len:] + self.SetProperty("productName", product_name) + self.SetBuildSetting("PRODUCT_NAME", product_name) + + ref_props = { + "explicitFileType": filetype, + "includeInIndex": 0, + "path": prefix + product_name + suffix, + "sourceTree": "BUILT_PRODUCTS_DIR", + } + file_ref = PBXFileReference(ref_props) + products_group.AppendChild(file_ref) + self.SetProperty("productReference", file_ref) + + def GetBuildPhaseByType(self, type): + if "buildPhases" not in self._properties: + return None + + the_phase = None + for phase in self._properties["buildPhases"]: + if isinstance(phase, type): + # Some phases may be present in multiples in a well-formed project file, + # but phases like PBXSourcesBuildPhase may only be present singly, and + # this function is intended as an aid to GetBuildPhaseByType. Loop + # over the entire list of phases and assert if more than one of the + # desired type is found. + assert the_phase is None + the_phase = phase + + return the_phase + + def HeadersPhase(self): + headers_phase = self.GetBuildPhaseByType(PBXHeadersBuildPhase) + if headers_phase is None: + headers_phase = PBXHeadersBuildPhase() + + # The headers phase should come before the resources, sources, and + # frameworks phases, if any. + insert_at = len(self._properties["buildPhases"]) + for index, phase in enumerate(self._properties["buildPhases"]): + if ( + isinstance(phase, PBXResourcesBuildPhase) + or isinstance(phase, PBXSourcesBuildPhase) + or isinstance(phase, PBXFrameworksBuildPhase) + ): + insert_at = index + break + + self._properties["buildPhases"].insert(insert_at, headers_phase) + headers_phase.parent = self + + return headers_phase + + def ResourcesPhase(self): + resources_phase = self.GetBuildPhaseByType(PBXResourcesBuildPhase) + if resources_phase is None: + resources_phase = PBXResourcesBuildPhase() + + # The resources phase should come before the sources and frameworks + # phases, if any. + insert_at = len(self._properties["buildPhases"]) + for index, phase in enumerate(self._properties["buildPhases"]): + if isinstance(phase, PBXSourcesBuildPhase) or isinstance( + phase, PBXFrameworksBuildPhase + ): + insert_at = index + break + + self._properties["buildPhases"].insert(insert_at, resources_phase) + resources_phase.parent = self + + return resources_phase + + def SourcesPhase(self): + sources_phase = self.GetBuildPhaseByType(PBXSourcesBuildPhase) + if sources_phase is None: + sources_phase = PBXSourcesBuildPhase() + self.AppendProperty("buildPhases", sources_phase) + + return sources_phase + + def FrameworksPhase(self): + frameworks_phase = self.GetBuildPhaseByType(PBXFrameworksBuildPhase) + if frameworks_phase is None: + frameworks_phase = PBXFrameworksBuildPhase() + self.AppendProperty("buildPhases", frameworks_phase) + + return frameworks_phase + + def AddDependency(self, other): + # super + XCTarget.AddDependency(self, other) + + static_library_type = "com.apple.product-type.library.static" + shared_library_type = "com.apple.product-type.library.dynamic" + framework_type = "com.apple.product-type.framework" + if ( + isinstance(other, PBXNativeTarget) + and "productType" in self._properties + and self._properties["productType"] != static_library_type + and "productType" in other._properties + and ( + other._properties["productType"] == static_library_type + or ( + ( + other._properties["productType"] == shared_library_type + or other._properties["productType"] == framework_type + ) + and ( + (not other.HasBuildSetting("MACH_O_TYPE")) + or other.GetBuildSetting("MACH_O_TYPE") != "mh_bundle" + ) + ) + ) + ): + + file_ref = other.GetProperty("productReference") + + pbxproject = self.PBXProjectAncestor() + other_pbxproject = other.PBXProjectAncestor() + if pbxproject != other_pbxproject: + other_project_product_group = pbxproject.AddOrGetProjectReference( + other_pbxproject + )[0] + file_ref = other_project_product_group.GetChildByRemoteObject(file_ref) + + self.FrameworksPhase().AppendProperty( + "files", PBXBuildFile({"fileRef": file_ref}) + ) class PBXAggregateTarget(XCTarget): - pass + pass class PBXProject(XCContainerPortal): - # A PBXProject is really just an XCObject, the XCContainerPortal thing is - # just to allow PBXProject to be used in the containerPortal property of - # PBXContainerItemProxy. - """ + # A PBXProject is really just an XCObject, the XCContainerPortal thing is + # just to allow PBXProject to be used in the containerPortal property of + # PBXContainerItemProxy. + """ Attributes: path: "sample.xcodeproj". TODO(mark) Document me! @@ -2493,91 +2743,98 @@ class PBXProject(XCContainerPortal): PBXProject. """ - _schema = XCContainerPortal._schema.copy() - _schema.update({ - 'attributes': [0, dict, 0, 0], - 'buildConfigurationList': [0, XCConfigurationList, 1, 1, - XCConfigurationList()], - 'compatibilityVersion': [0, str, 0, 1, 'Xcode 3.2'], - 'hasScannedForEncodings': [0, int, 0, 1, 1], - 'mainGroup': [0, PBXGroup, 1, 1, PBXGroup()], - 'projectDirPath': [0, str, 0, 1, ''], - 'projectReferences': [1, dict, 0, 0], - 'projectRoot': [0, str, 0, 1, ''], - 'targets': [1, XCTarget, 1, 1, []], - }) - - def __init__(self, properties=None, id=None, parent=None, path=None): - self.path = path - self._other_pbxprojects = {} - # super - return XCContainerPortal.__init__(self, properties, id, parent) + _schema = XCContainerPortal._schema.copy() + _schema.update( + { + "attributes": [0, dict, 0, 0], + "buildConfigurationList": [ + 0, + XCConfigurationList, + 1, + 1, + XCConfigurationList(), + ], + "compatibilityVersion": [0, str, 0, 1, "Xcode 3.2"], + "hasScannedForEncodings": [0, int, 0, 1, 1], + "mainGroup": [0, PBXGroup, 1, 1, PBXGroup()], + "projectDirPath": [0, str, 0, 1, ""], + "projectReferences": [1, dict, 0, 0], + "projectRoot": [0, str, 0, 1, ""], + "targets": [1, XCTarget, 1, 1, []], + } + ) - def Name(self): - name = self.path - if name[-10:] == '.xcodeproj': - name = name[:-10] - return posixpath.basename(name) + def __init__(self, properties=None, id=None, parent=None, path=None): + self.path = path + self._other_pbxprojects = {} + # super + return XCContainerPortal.__init__(self, properties, id, parent) - def Path(self): - return self.path + def Name(self): + name = self.path + if name[-10:] == ".xcodeproj": + name = name[:-10] + return posixpath.basename(name) - def Comment(self): - return 'Project object' + def Path(self): + return self.path - def Children(self): - # super - children = XCContainerPortal.Children(self) + def Comment(self): + return "Project object" + + def Children(self): + # super + children = XCContainerPortal.Children(self) - # Add children that the schema doesn't know about. Maybe there's a more - # elegant way around this, but this is the only case where we need to own - # objects in a dictionary (that is itself in a list), and three lines for - # a one-off isn't that big a deal. - if 'projectReferences' in self._properties: - for reference in self._properties['projectReferences']: - children.append(reference['ProductGroup']) + # Add children that the schema doesn't know about. Maybe there's a more + # elegant way around this, but this is the only case where we need to own + # objects in a dictionary (that is itself in a list), and three lines for + # a one-off isn't that big a deal. + if "projectReferences" in self._properties: + for reference in self._properties["projectReferences"]: + children.append(reference["ProductGroup"]) - return children + return children - def PBXProjectAncestor(self): - return self + def PBXProjectAncestor(self): + return self - def _GroupByName(self, name): - if not 'mainGroup' in self._properties: - self.SetProperty('mainGroup', PBXGroup()) + def _GroupByName(self, name): + if "mainGroup" not in self._properties: + self.SetProperty("mainGroup", PBXGroup()) - main_group = self._properties['mainGroup'] - group = main_group.GetChildByName(name) - if group is None: - group = PBXGroup({'name': name}) - main_group.AppendChild(group) + main_group = self._properties["mainGroup"] + group = main_group.GetChildByName(name) + if group is None: + group = PBXGroup({"name": name}) + main_group.AppendChild(group) - return group + return group - # SourceGroup and ProductsGroup are created by default in Xcode's own - # templates. - def SourceGroup(self): - return self._GroupByName('Source') + # SourceGroup and ProductsGroup are created by default in Xcode's own + # templates. + def SourceGroup(self): + return self._GroupByName("Source") - def ProductsGroup(self): - return self._GroupByName('Products') + def ProductsGroup(self): + return self._GroupByName("Products") - # IntermediatesGroup is used to collect source-like files that are generated - # by rules or script phases and are placed in intermediate directories such - # as DerivedSources. - def IntermediatesGroup(self): - return self._GroupByName('Intermediates') + # IntermediatesGroup is used to collect source-like files that are generated + # by rules or script phases and are placed in intermediate directories such + # as DerivedSources. + def IntermediatesGroup(self): + return self._GroupByName("Intermediates") - # FrameworksGroup and ProjectsGroup are top-level groups used to collect - # frameworks and projects. - def FrameworksGroup(self): - return self._GroupByName('Frameworks') + # FrameworksGroup and ProjectsGroup are top-level groups used to collect + # frameworks and projects. + def FrameworksGroup(self): + return self._GroupByName("Frameworks") - def ProjectsGroup(self): - return self._GroupByName('Projects') + def ProjectsGroup(self): + return self._GroupByName("Projects") - def RootGroupForPath(self, path): - """Returns a PBXGroup child of this object to which path should be added. + def RootGroupForPath(self, path): + """Returns a PBXGroup child of this object to which path should be added. This method is intended to choose between SourceGroup and IntermediatesGroup on the basis of whether path is present in a source @@ -2591,83 +2848,84 @@ def RootGroupForPath(self, path): organized hierarchically (True) or as a single flat list (False). """ - # TODO(mark): make this a class variable and bind to self on call? - # Also, this list is nowhere near exhaustive. - # INTERMEDIATE_DIR and SHARED_INTERMEDIATE_DIR are used by - # gyp.generator.xcode. There should probably be some way for that module - # to push the names in, rather than having to hard-code them here. - source_tree_groups = { - 'DERIVED_FILE_DIR': (self.IntermediatesGroup, True), - 'INTERMEDIATE_DIR': (self.IntermediatesGroup, True), - 'PROJECT_DERIVED_FILE_DIR': (self.IntermediatesGroup, True), - 'SHARED_INTERMEDIATE_DIR': (self.IntermediatesGroup, True), - } + # TODO(mark): make this a class variable and bind to self on call? + # Also, this list is nowhere near exhaustive. + # INTERMEDIATE_DIR and SHARED_INTERMEDIATE_DIR are used by + # gyp.generator.xcode. There should probably be some way for that module + # to push the names in, rather than having to hard-code them here. + source_tree_groups = { + "DERIVED_FILE_DIR": (self.IntermediatesGroup, True), + "INTERMEDIATE_DIR": (self.IntermediatesGroup, True), + "PROJECT_DERIVED_FILE_DIR": (self.IntermediatesGroup, True), + "SHARED_INTERMEDIATE_DIR": (self.IntermediatesGroup, True), + } - (source_tree, path) = SourceTreeAndPathFromPath(path) - if source_tree != None and source_tree in source_tree_groups: - (group_func, hierarchical) = source_tree_groups[source_tree] - group = group_func() - return (group, hierarchical) + (source_tree, path) = SourceTreeAndPathFromPath(path) + if source_tree is not None and source_tree in source_tree_groups: + (group_func, hierarchical) = source_tree_groups[source_tree] + group = group_func() + return (group, hierarchical) - # TODO(mark): make additional choices based on file extension. + # TODO(mark): make additional choices based on file extension. - return (self.SourceGroup(), True) + return (self.SourceGroup(), True) - def AddOrGetFileInRootGroup(self, path): - """Returns a PBXFileReference corresponding to path in the correct group + def AddOrGetFileInRootGroup(self, path): + """Returns a PBXFileReference corresponding to path in the correct group according to RootGroupForPath's heuristics. If an existing PBXFileReference for path exists, it will be returned. Otherwise, one will be created and returned. """ - (group, hierarchical) = self.RootGroupForPath(path) - return group.AddOrGetFileByPath(path, hierarchical) - - def RootGroupsTakeOverOnlyChildren(self, recurse=False): - """Calls TakeOverOnlyChild for all groups in the main group.""" - - for group in self._properties['mainGroup']._properties['children']: - if isinstance(group, PBXGroup): - group.TakeOverOnlyChild(recurse) - - def SortGroups(self): - # Sort the children of the mainGroup (like "Source" and "Products") - # according to their defined order. - self._properties['mainGroup']._properties['children'] = \ - sorted(self._properties['mainGroup']._properties['children'], - cmp=lambda x,y: x.CompareRootGroup(y)) - - # Sort everything else by putting group before files, and going - # alphabetically by name within sections of groups and files. SortGroup - # is recursive. - for group in self._properties['mainGroup']._properties['children']: - if not isinstance(group, PBXGroup): - continue - - if group.Name() == 'Products': - # The Products group is a special case. Instead of sorting - # alphabetically, sort things in the order of the targets that - # produce the products. To do this, just build up a new list of - # products based on the targets. - products = [] - for target in self._properties['targets']: - if not isinstance(target, PBXNativeTarget): - continue - product = target._properties['productReference'] - # Make sure that the product is already in the products group. - assert product in group._properties['children'] - products.append(product) - - # Make sure that this process doesn't miss anything that was already - # in the products group. - assert len(products) == len(group._properties['children']) - group._properties['children'] = products - else: - group.SortGroup() - - def AddOrGetProjectReference(self, other_pbxproject): - """Add a reference to another project file (via PBXProject object) to this + (group, hierarchical) = self.RootGroupForPath(path) + return group.AddOrGetFileByPath(path, hierarchical) + + def RootGroupsTakeOverOnlyChildren(self, recurse=False): + """Calls TakeOverOnlyChild for all groups in the main group.""" + + for group in self._properties["mainGroup"]._properties["children"]: + if isinstance(group, PBXGroup): + group.TakeOverOnlyChild(recurse) + + def SortGroups(self): + # Sort the children of the mainGroup (like "Source" and "Products") + # according to their defined order. + self._properties["mainGroup"]._properties["children"] = sorted( + self._properties["mainGroup"]._properties["children"], + cmp=lambda x, y: x.CompareRootGroup(y), + ) + + # Sort everything else by putting group before files, and going + # alphabetically by name within sections of groups and files. SortGroup + # is recursive. + for group in self._properties["mainGroup"]._properties["children"]: + if not isinstance(group, PBXGroup): + continue + + if group.Name() == "Products": + # The Products group is a special case. Instead of sorting + # alphabetically, sort things in the order of the targets that + # produce the products. To do this, just build up a new list of + # products based on the targets. + products = [] + for target in self._properties["targets"]: + if not isinstance(target, PBXNativeTarget): + continue + product = target._properties["productReference"] + # Make sure that the product is already in the products group. + assert product in group._properties["children"] + products.append(product) + + # Make sure that this process doesn't miss anything that was already + # in the products group. + assert len(products) == len(group._properties["children"]) + group._properties["children"] = products + else: + group.SortGroup() + + def AddOrGetProjectReference(self, other_pbxproject): + """Add a reference to another project file (via PBXProject object) to this one. Returns [ProductGroup, ProjectRef]. ProductGroup is a PBXGroup object in @@ -2680,243 +2938,259 @@ def AddOrGetProjectReference(self, other_pbxproject): still be updated if necessary. """ - if not 'projectReferences' in self._properties: - self._properties['projectReferences'] = [] - - product_group = None - project_ref = None - - if not other_pbxproject in self._other_pbxprojects: - # This project file isn't yet linked to the other one. Establish the - # link. - product_group = PBXGroup({'name': 'Products'}) - - # ProductGroup is strong. - product_group.parent = self - - # There's nothing unique about this PBXGroup, and if left alone, it will - # wind up with the same set of hashables as all other PBXGroup objects - # owned by the projectReferences list. Add the hashables of the - # remote PBXProject that it's related to. - product_group._hashables.extend(other_pbxproject.Hashables()) - - # The other project reports its path as relative to the same directory - # that this project's path is relative to. The other project's path - # is not necessarily already relative to this project. Figure out the - # pathname that this project needs to use to refer to the other one. - this_path = posixpath.dirname(self.Path()) - projectDirPath = self.GetProperty('projectDirPath') - if projectDirPath: - if posixpath.isabs(projectDirPath[0]): - this_path = projectDirPath + if "projectReferences" not in self._properties: + self._properties["projectReferences"] = [] + + product_group = None + project_ref = None + + if other_pbxproject not in self._other_pbxprojects: + # This project file isn't yet linked to the other one. Establish the + # link. + product_group = PBXGroup({"name": "Products"}) + + # ProductGroup is strong. + product_group.parent = self + + # There's nothing unique about this PBXGroup, and if left alone, it will + # wind up with the same set of hashables as all other PBXGroup objects + # owned by the projectReferences list. Add the hashables of the + # remote PBXProject that it's related to. + product_group._hashables.extend(other_pbxproject.Hashables()) + + # The other project reports its path as relative to the same directory + # that this project's path is relative to. The other project's path + # is not necessarily already relative to this project. Figure out the + # pathname that this project needs to use to refer to the other one. + this_path = posixpath.dirname(self.Path()) + projectDirPath = self.GetProperty("projectDirPath") + if projectDirPath: + if posixpath.isabs(projectDirPath[0]): + this_path = projectDirPath + else: + this_path = posixpath.join(this_path, projectDirPath) + other_path = gyp.common.RelativePath(other_pbxproject.Path(), this_path) + + # ProjectRef is weak (it's owned by the mainGroup hierarchy). + project_ref = PBXFileReference( + { + "lastKnownFileType": "wrapper.pb-project", + "path": other_path, + "sourceTree": "SOURCE_ROOT", + } + ) + self.ProjectsGroup().AppendChild(project_ref) + + ref_dict = {"ProductGroup": product_group, "ProjectRef": project_ref} + self._other_pbxprojects[other_pbxproject] = ref_dict + self.AppendProperty("projectReferences", ref_dict) + + # Xcode seems to sort this list case-insensitively + self._properties["projectReferences"] = sorted( + self._properties["projectReferences"], + cmp=lambda x, y: cmp( + x["ProjectRef"].Name().lower(), y["ProjectRef"].Name().lower() + ), + ) else: - this_path = posixpath.join(this_path, projectDirPath) - other_path = gyp.common.RelativePath(other_pbxproject.Path(), this_path) - - # ProjectRef is weak (it's owned by the mainGroup hierarchy). - project_ref = PBXFileReference({ - 'lastKnownFileType': 'wrapper.pb-project', - 'path': other_path, - 'sourceTree': 'SOURCE_ROOT', - }) - self.ProjectsGroup().AppendChild(project_ref) - - ref_dict = {'ProductGroup': product_group, 'ProjectRef': project_ref} - self._other_pbxprojects[other_pbxproject] = ref_dict - self.AppendProperty('projectReferences', ref_dict) - - # Xcode seems to sort this list case-insensitively - self._properties['projectReferences'] = \ - sorted(self._properties['projectReferences'], cmp=lambda x,y: - cmp(x['ProjectRef'].Name().lower(), - y['ProjectRef'].Name().lower())) - else: - # The link already exists. Pull out the relevnt data. - project_ref_dict = self._other_pbxprojects[other_pbxproject] - product_group = project_ref_dict['ProductGroup'] - project_ref = project_ref_dict['ProjectRef'] - - self._SetUpProductReferences(other_pbxproject, product_group, project_ref) - - inherit_unique_symroot = self._AllSymrootsUnique(other_pbxproject, False) - targets = other_pbxproject.GetProperty('targets') - if all(self._AllSymrootsUnique(t, inherit_unique_symroot) for t in targets): - dir_path = project_ref._properties['path'] - product_group._hashables.extend(dir_path) - - return [product_group, project_ref] - - def _AllSymrootsUnique(self, target, inherit_unique_symroot): - # Returns True if all configurations have a unique 'SYMROOT' attribute. - # The value of inherit_unique_symroot decides, if a configuration is assumed - # to inherit a unique 'SYMROOT' attribute from its parent, if it doesn't - # define an explicit value for 'SYMROOT'. - symroots = self._DefinedSymroots(target) - for s in self._DefinedSymroots(target): - if (s is not None and not self._IsUniqueSymrootForTarget(s) or - s is None and not inherit_unique_symroot): + # The link already exists. Pull out the relevnt data. + project_ref_dict = self._other_pbxprojects[other_pbxproject] + product_group = project_ref_dict["ProductGroup"] + project_ref = project_ref_dict["ProjectRef"] + + self._SetUpProductReferences(other_pbxproject, product_group, project_ref) + + inherit_unique_symroot = self._AllSymrootsUnique(other_pbxproject, False) + targets = other_pbxproject.GetProperty("targets") + if all(self._AllSymrootsUnique(t, inherit_unique_symroot) for t in targets): + dir_path = project_ref._properties["path"] + product_group._hashables.extend(dir_path) + + return [product_group, project_ref] + + def _AllSymrootsUnique(self, target, inherit_unique_symroot): + # Returns True if all configurations have a unique 'SYMROOT' attribute. + # The value of inherit_unique_symroot decides, if a configuration is assumed + # to inherit a unique 'SYMROOT' attribute from its parent, if it doesn't + # define an explicit value for 'SYMROOT'. + symroots = self._DefinedSymroots(target) + for s in self._DefinedSymroots(target): + if ( + s is not None + and not self._IsUniqueSymrootForTarget(s) + or s is None + and not inherit_unique_symroot + ): + return False + return True if symroots else inherit_unique_symroot + + def _DefinedSymroots(self, target): + # Returns all values for the 'SYMROOT' attribute defined in all + # configurations for this target. If any configuration doesn't define the + # 'SYMROOT' attribute, None is added to the returned set. If all + # configurations don't define the 'SYMROOT' attribute, an empty set is + # returned. + config_list = target.GetProperty("buildConfigurationList") + symroots = set() + for config in config_list.GetProperty("buildConfigurations"): + setting = config.GetProperty("buildSettings") + if "SYMROOT" in setting: + symroots.add(setting["SYMROOT"]) + else: + symroots.add(None) + if len(symroots) == 1 and None in symroots: + return set() + return symroots + + def _IsUniqueSymrootForTarget(self, symroot): + # This method returns True if all configurations in target contain a + # 'SYMROOT' attribute that is unique for the given target. A value is + # unique, if the Xcode macro '$SRCROOT' appears in it in any form. + uniquifier = ["$SRCROOT", "$(SRCROOT)"] + if any(x in symroot for x in uniquifier): + return True return False - return True if symroots else inherit_unique_symroot - - def _DefinedSymroots(self, target): - # Returns all values for the 'SYMROOT' attribute defined in all - # configurations for this target. If any configuration doesn't define the - # 'SYMROOT' attribute, None is added to the returned set. If all - # configurations don't define the 'SYMROOT' attribute, an empty set is - # returned. - config_list = target.GetProperty('buildConfigurationList') - symroots = set() - for config in config_list.GetProperty('buildConfigurations'): - setting = config.GetProperty('buildSettings') - if 'SYMROOT' in setting: - symroots.add(setting['SYMROOT']) - else: - symroots.add(None) - if len(symroots) == 1 and None in symroots: - return set() - return symroots - - def _IsUniqueSymrootForTarget(self, symroot): - # This method returns True if all configurations in target contain a - # 'SYMROOT' attribute that is unique for the given target. A value is - # unique, if the Xcode macro '$SRCROOT' appears in it in any form. - uniquifier = ['$SRCROOT', '$(SRCROOT)'] - if any(x in symroot for x in uniquifier): - return True - return False - - def _SetUpProductReferences(self, other_pbxproject, product_group, - project_ref): - # TODO(mark): This only adds references to products in other_pbxproject - # when they don't exist in this pbxproject. Perhaps it should also - # remove references from this pbxproject that are no longer present in - # other_pbxproject. Perhaps it should update various properties if they - # change. - for target in other_pbxproject._properties['targets']: - if not isinstance(target, PBXNativeTarget): - continue - - other_fileref = target._properties['productReference'] - if product_group.GetChildByRemoteObject(other_fileref) is None: - # Xcode sets remoteInfo to the name of the target and not the name - # of its product, despite this proxy being a reference to the product. - container_item = PBXContainerItemProxy({ - 'containerPortal': project_ref, - 'proxyType': 2, - 'remoteGlobalIDString': other_fileref, - 'remoteInfo': target.Name() - }) - # TODO(mark): Does sourceTree get copied straight over from the other - # project? Can the other project ever have lastKnownFileType here - # instead of explicitFileType? (Use it if so?) Can path ever be - # unset? (I don't think so.) Can other_fileref have name set, and - # does it impact the PBXReferenceProxy if so? These are the questions - # that perhaps will be answered one day. - reference_proxy = PBXReferenceProxy({ - 'fileType': other_fileref._properties['explicitFileType'], - 'path': other_fileref._properties['path'], - 'sourceTree': other_fileref._properties['sourceTree'], - 'remoteRef': container_item, - }) - - product_group.AppendChild(reference_proxy) - - def SortRemoteProductReferences(self): - # For each remote project file, sort the associated ProductGroup in the - # same order that the targets are sorted in the remote project file. This - # is the sort order used by Xcode. - - def CompareProducts(x, y, remote_products): - # x and y are PBXReferenceProxy objects. Go through their associated - # PBXContainerItem to get the remote PBXFileReference, which will be - # present in the remote_products list. - x_remote = x._properties['remoteRef']._properties['remoteGlobalIDString'] - y_remote = y._properties['remoteRef']._properties['remoteGlobalIDString'] - x_index = remote_products.index(x_remote) - y_index = remote_products.index(y_remote) - - # Use the order of each remote PBXFileReference in remote_products to - # determine the sort order. - return cmp(x_index, y_index) - - for other_pbxproject, ref_dict in self._other_pbxprojects.items(): - # Build up a list of products in the remote project file, ordered the - # same as the targets that produce them. - remote_products = [] - for target in other_pbxproject._properties['targets']: - if not isinstance(target, PBXNativeTarget): - continue - remote_products.append(target._properties['productReference']) - - # Sort the PBXReferenceProxy children according to the list of remote - # products. - product_group = ref_dict['ProductGroup'] - product_group._properties['children'] = sorted( - product_group._properties['children'], - cmp=lambda x, y, rp=remote_products: CompareProducts(x, y, rp)) + + def _SetUpProductReferences(self, other_pbxproject, product_group, project_ref): + # TODO(mark): This only adds references to products in other_pbxproject + # when they don't exist in this pbxproject. Perhaps it should also + # remove references from this pbxproject that are no longer present in + # other_pbxproject. Perhaps it should update various properties if they + # change. + for target in other_pbxproject._properties["targets"]: + if not isinstance(target, PBXNativeTarget): + continue + + other_fileref = target._properties["productReference"] + if product_group.GetChildByRemoteObject(other_fileref) is None: + # Xcode sets remoteInfo to the name of the target and not the name + # of its product, despite this proxy being a reference to the product. + container_item = PBXContainerItemProxy( + { + "containerPortal": project_ref, + "proxyType": 2, + "remoteGlobalIDString": other_fileref, + "remoteInfo": target.Name(), + } + ) + # TODO(mark): Does sourceTree get copied straight over from the other + # project? Can the other project ever have lastKnownFileType here + # instead of explicitFileType? (Use it if so?) Can path ever be + # unset? (I don't think so.) Can other_fileref have name set, and + # does it impact the PBXReferenceProxy if so? These are the questions + # that perhaps will be answered one day. + reference_proxy = PBXReferenceProxy( + { + "fileType": other_fileref._properties["explicitFileType"], + "path": other_fileref._properties["path"], + "sourceTree": other_fileref._properties["sourceTree"], + "remoteRef": container_item, + } + ) + + product_group.AppendChild(reference_proxy) + + def SortRemoteProductReferences(self): + # For each remote project file, sort the associated ProductGroup in the + # same order that the targets are sorted in the remote project file. This + # is the sort order used by Xcode. + + def CompareProducts(x, y, remote_products): + # x and y are PBXReferenceProxy objects. Go through their associated + # PBXContainerItem to get the remote PBXFileReference, which will be + # present in the remote_products list. + x_remote = x._properties["remoteRef"]._properties["remoteGlobalIDString"] + y_remote = y._properties["remoteRef"]._properties["remoteGlobalIDString"] + x_index = remote_products.index(x_remote) + y_index = remote_products.index(y_remote) + + # Use the order of each remote PBXFileReference in remote_products to + # determine the sort order. + return cmp(x_index, y_index) + + for other_pbxproject, ref_dict in self._other_pbxprojects.items(): + # Build up a list of products in the remote project file, ordered the + # same as the targets that produce them. + remote_products = [] + for target in other_pbxproject._properties["targets"]: + if not isinstance(target, PBXNativeTarget): + continue + remote_products.append(target._properties["productReference"]) + + # Sort the PBXReferenceProxy children according to the list of remote + # products. + product_group = ref_dict["ProductGroup"] + product_group._properties["children"] = sorted( + product_group._properties["children"], + cmp=lambda x, y, rp=remote_products: CompareProducts(x, y, rp), + ) class XCProjectFile(XCObject): - _schema = XCObject._schema.copy() - _schema.update({ - 'archiveVersion': [0, int, 0, 1, 1], - 'classes': [0, dict, 0, 1, {}], - 'objectVersion': [0, int, 0, 1, 46], - 'rootObject': [0, PBXProject, 1, 1], - }) - - def ComputeIDs(self, recursive=True, overwrite=True, hash=None): - # Although XCProjectFile is implemented here as an XCObject, it's not a - # proper object in the Xcode sense, and it certainly doesn't have its own - # ID. Pass through an attempt to update IDs to the real root object. - if recursive: - self._properties['rootObject'].ComputeIDs(recursive, overwrite, hash) - - def Print(self, file=sys.stdout): - self.VerifyHasRequiredProperties() - - # Add the special "objects" property, which will be caught and handled - # separately during printing. This structure allows a fairly standard - # loop do the normal printing. - self._properties['objects'] = {} - self._XCPrint(file, 0, '// !$*UTF8*$!\n') - if self._should_print_single_line: - self._XCPrint(file, 0, '{ ') - else: - self._XCPrint(file, 0, '{\n') - for property, value in sorted(self._properties.items(), - cmp=lambda x, y: cmp(x, y)): - if property == 'objects': - self._PrintObjects(file) - else: - self._XCKVPrint(file, 1, property, value) - self._XCPrint(file, 0, '}\n') - del self._properties['objects'] - - def _PrintObjects(self, file): - if self._should_print_single_line: - self._XCPrint(file, 0, 'objects = {') - else: - self._XCPrint(file, 1, 'objects = {\n') - - objects_by_class = {} - for object in self.Descendants(): - if object == self: - continue - class_name = object.__class__.__name__ - if not class_name in objects_by_class: - objects_by_class[class_name] = [] - objects_by_class[class_name].append(object) - - for class_name in sorted(objects_by_class): - self._XCPrint(file, 0, '\n') - self._XCPrint(file, 0, '/* Begin ' + class_name + ' section */\n') - for object in sorted(objects_by_class[class_name], - cmp=lambda x, y: cmp(x.id, y.id)): - object.Print(file) - self._XCPrint(file, 0, '/* End ' + class_name + ' section */\n') - - if self._should_print_single_line: - self._XCPrint(file, 0, '}; ') - else: - self._XCPrint(file, 1, '};\n') + _schema = XCObject._schema.copy() + _schema.update( + { + "archiveVersion": [0, int, 0, 1, 1], + "classes": [0, dict, 0, 1, {}], + "objectVersion": [0, int, 0, 1, 46], + "rootObject": [0, PBXProject, 1, 1], + } + ) + + def ComputeIDs(self, recursive=True, overwrite=True, hash=None): + # Although XCProjectFile is implemented here as an XCObject, it's not a + # proper object in the Xcode sense, and it certainly doesn't have its own + # ID. Pass through an attempt to update IDs to the real root object. + if recursive: + self._properties["rootObject"].ComputeIDs(recursive, overwrite, hash) + + def Print(self, file=sys.stdout): + self.VerifyHasRequiredProperties() + + # Add the special "objects" property, which will be caught and handled + # separately during printing. This structure allows a fairly standard + # loop do the normal printing. + self._properties["objects"] = {} + self._XCPrint(file, 0, "// !$*UTF8*$!\n") + if self._should_print_single_line: + self._XCPrint(file, 0, "{ ") + else: + self._XCPrint(file, 0, "{\n") + for property, value in sorted( + self._properties.items(), cmp=lambda x, y: cmp(x, y) + ): + if property == "objects": + self._PrintObjects(file) + else: + self._XCKVPrint(file, 1, property, value) + self._XCPrint(file, 0, "}\n") + del self._properties["objects"] + + def _PrintObjects(self, file): + if self._should_print_single_line: + self._XCPrint(file, 0, "objects = {") + else: + self._XCPrint(file, 1, "objects = {\n") + + objects_by_class = {} + for object in self.Descendants(): + if object == self: + continue + class_name = object.__class__.__name__ + if class_name not in objects_by_class: + objects_by_class[class_name] = [] + objects_by_class[class_name].append(object) + + for class_name in sorted(objects_by_class): + self._XCPrint(file, 0, "\n") + self._XCPrint(file, 0, "/* Begin " + class_name + " section */\n") + for object in sorted( + objects_by_class[class_name], cmp=lambda x, y: cmp(x.id, y.id) + ): + object.Print(file) + self._XCPrint(file, 0, "/* End " + class_name + " section */\n") + + if self._should_print_single_line: + self._XCPrint(file, 0, "}; ") + else: + self._XCPrint(file, 1, "};\n") diff --git a/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/xml_fix.py b/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/xml_fix.py index 5de848158d2899..0a945322b4587a 100644 --- a/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/xml_fix.py +++ b/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/xml_fix.py @@ -14,56 +14,52 @@ def _Replacement_write_data(writer, data, is_attrib=False): - """Writes datachars to writer.""" - data = data.replace("&", "&").replace("<", "<") - data = data.replace("\"", """).replace(">", ">") - if is_attrib: - data = data.replace( - "\r", " ").replace( - "\n", " ").replace( - "\t", " ") - writer.write(data) + """Writes datachars to writer.""" + data = data.replace("&", "&").replace("<", "<") + data = data.replace('"', """).replace(">", ">") + if is_attrib: + data = data.replace("\r", " ").replace("\n", " ").replace("\t", " ") + writer.write(data) def _Replacement_writexml(self, writer, indent="", addindent="", newl=""): - # indent = current indentation - # addindent = indentation to add to higher levels - # newl = newline string - writer.write(indent+"<" + self.tagName) + # indent = current indentation + # addindent = indentation to add to higher levels + # newl = newline string + writer.write(indent + "<" + self.tagName) - attrs = self._get_attributes() - a_names = attrs.keys() - a_names.sort() + attrs = self._get_attributes() + a_names = sorted(attrs.keys()) - for a_name in a_names: - writer.write(" %s=\"" % a_name) - _Replacement_write_data(writer, attrs[a_name].value, is_attrib=True) - writer.write("\"") - if self.childNodes: - writer.write(">%s" % newl) - for node in self.childNodes: - node.writexml(writer, indent + addindent, addindent, newl) - writer.write("%s%s" % (indent, self.tagName, newl)) - else: - writer.write("/>%s" % newl) + for a_name in a_names: + writer.write(' %s="' % a_name) + _Replacement_write_data(writer, attrs[a_name].value, is_attrib=True) + writer.write('"') + if self.childNodes: + writer.write(">%s" % newl) + for node in self.childNodes: + node.writexml(writer, indent + addindent, addindent, newl) + writer.write("%s%s" % (indent, self.tagName, newl)) + else: + writer.write("/>%s" % newl) class XmlFix(object): - """Object to manage temporary patching of xml.dom.minidom.""" + """Object to manage temporary patching of xml.dom.minidom.""" - def __init__(self): - # Preserve current xml.dom.minidom functions. - self.write_data = xml.dom.minidom._write_data - self.writexml = xml.dom.minidom.Element.writexml - # Inject replacement versions of a function and a method. - xml.dom.minidom._write_data = _Replacement_write_data - xml.dom.minidom.Element.writexml = _Replacement_writexml + def __init__(self): + # Preserve current xml.dom.minidom functions. + self.write_data = xml.dom.minidom._write_data + self.writexml = xml.dom.minidom.Element.writexml + # Inject replacement versions of a function and a method. + xml.dom.minidom._write_data = _Replacement_write_data + xml.dom.minidom.Element.writexml = _Replacement_writexml - def Cleanup(self): - if self.write_data: - xml.dom.minidom._write_data = self.write_data - xml.dom.minidom.Element.writexml = self.writexml - self.write_data = None + def Cleanup(self): + if self.write_data: + xml.dom.minidom._write_data = self.write_data + xml.dom.minidom.Element.writexml = self.writexml + self.write_data = None - def __del__(self): - self.Cleanup() + def __del__(self): + self.Cleanup() diff --git a/deps/npm/node_modules/node-gyp/gyp/requirements_dev.txt b/deps/npm/node_modules/node-gyp/gyp/requirements_dev.txt new file mode 100644 index 00000000000000..28ecacab602938 --- /dev/null +++ b/deps/npm/node_modules/node-gyp/gyp/requirements_dev.txt @@ -0,0 +1,2 @@ +flake8 +pytest diff --git a/deps/npm/node_modules/node-gyp/gyp/samples/samples b/deps/npm/node_modules/node-gyp/gyp/samples/samples deleted file mode 100755 index 804b618998747d..00000000000000 --- a/deps/npm/node_modules/node-gyp/gyp/samples/samples +++ /dev/null @@ -1,81 +0,0 @@ -#!/usr/bin/python - -# Copyright (c) 2009 Google Inc. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -import os.path -import shutil -import sys - - -gyps = [ - 'app/app.gyp', - 'base/base.gyp', - 'build/temp_gyp/googleurl.gyp', - 'build/all.gyp', - 'build/common.gypi', - 'build/external_code.gypi', - 'chrome/test/security_tests/security_tests.gyp', - 'chrome/third_party/hunspell/hunspell.gyp', - 'chrome/chrome.gyp', - 'media/media.gyp', - 'net/net.gyp', - 'printing/printing.gyp', - 'sdch/sdch.gyp', - 'skia/skia.gyp', - 'testing/gmock.gyp', - 'testing/gtest.gyp', - 'third_party/bzip2/bzip2.gyp', - 'third_party/icu38/icu38.gyp', - 'third_party/libevent/libevent.gyp', - 'third_party/libjpeg/libjpeg.gyp', - 'third_party/libpng/libpng.gyp', - 'third_party/libxml/libxml.gyp', - 'third_party/libxslt/libxslt.gyp', - 'third_party/lzma_sdk/lzma_sdk.gyp', - 'third_party/modp_b64/modp_b64.gyp', - 'third_party/npapi/npapi.gyp', - 'third_party/sqlite/sqlite.gyp', - 'third_party/zlib/zlib.gyp', - 'v8/tools/gyp/v8.gyp', - 'webkit/activex_shim/activex_shim.gyp', - 'webkit/activex_shim_dll/activex_shim_dll.gyp', - 'webkit/build/action_csspropertynames.py', - 'webkit/build/action_cssvaluekeywords.py', - 'webkit/build/action_jsconfig.py', - 'webkit/build/action_makenames.py', - 'webkit/build/action_maketokenizer.py', - 'webkit/build/action_useragentstylesheets.py', - 'webkit/build/rule_binding.py', - 'webkit/build/rule_bison.py', - 'webkit/build/rule_gperf.py', - 'webkit/tools/test_shell/test_shell.gyp', - 'webkit/webkit.gyp', -] - - -def Main(argv): - if len(argv) != 3 or argv[1] not in ['push', 'pull']: - print 'Usage: %s push/pull PATH_TO_CHROME' % argv[0] - return 1 - - path_to_chrome = argv[2] - - for g in gyps: - chrome_file = os.path.join(path_to_chrome, g) - local_file = os.path.join(os.path.dirname(argv[0]), os.path.split(g)[1]) - if argv[1] == 'push': - print 'Copying %s to %s' % (local_file, chrome_file) - shutil.copyfile(local_file, chrome_file) - elif argv[1] == 'pull': - print 'Copying %s to %s' % (chrome_file, local_file) - shutil.copyfile(chrome_file, local_file) - else: - assert False - - return 0 - - -if __name__ == '__main__': - sys.exit(Main(sys.argv)) diff --git a/deps/npm/node_modules/node-gyp/gyp/samples/samples.bat b/deps/npm/node_modules/node-gyp/gyp/samples/samples.bat deleted file mode 100644 index 568325565c5cfd..00000000000000 --- a/deps/npm/node_modules/node-gyp/gyp/samples/samples.bat +++ /dev/null @@ -1,5 +0,0 @@ -@rem Copyright (c) 2009 Google Inc. All rights reserved. -@rem Use of this source code is governed by a BSD-style license that can be -@rem found in the LICENSE file. - -@python %~dp0/samples %* diff --git a/deps/npm/node_modules/node-gyp/gyp/setup.py b/deps/npm/node_modules/node-gyp/gyp/setup.py index 75a42558d8026b..0f75a99b18d6c7 100755 --- a/deps/npm/node_modules/node-gyp/gyp/setup.py +++ b/deps/npm/node_modules/node-gyp/gyp/setup.py @@ -4,16 +4,41 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. +from os import path + from setuptools import setup +here = path.abspath(path.dirname(__file__)) +# Get the long description from the README file +with open(path.join(here, "README.md")) as in_file: + long_description = in_file.read() + setup( - name='gyp', - version='0.1', - description='Generate Your Projects', - author='Chromium Authors', - author_email='chromium-dev@googlegroups.com', - url='http://code.google.com/p/gyp', - package_dir = {'': 'pylib'}, - packages=['gyp', 'gyp.generator'], - entry_points = {'console_scripts': ['gyp=gyp:script_main'] } + name="gyp-next", + version="0.4.0", + description="A fork of the GYP build system for use in the Node.js projects", + long_description=long_description, + long_description_content_type="text/markdown", + author="Node.js contributors", + author_email="ryzokuken@disroot.org", + url="https://github.com/nodejs/gyp-next", + package_dir={"": "pylib"}, + packages=["gyp", "gyp.generator"], + entry_points={"console_scripts": ["gyp=gyp:script_main"]}, + python_requires=">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*", + classifiers=[ + "Development Status :: 3 - Alpha", + "Environment :: Console", + "Intended Audience :: Developers", + "License :: OSI Approved :: BSD License", + "Natural Language :: English", + "Programming Language :: Python", + "Programming Language :: Python :: 2", + "Programming Language :: Python :: 2.7", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.5", + "Programming Language :: Python :: 3.6", + "Programming Language :: Python :: 3.7", + "Programming Language :: Python :: 3.8", + ], ) diff --git a/deps/npm/node_modules/node-gyp/gyp/test_gyp.py b/deps/npm/node_modules/node-gyp/gyp/test_gyp.py new file mode 100755 index 00000000000000..382e75272d8b6b --- /dev/null +++ b/deps/npm/node_modules/node-gyp/gyp/test_gyp.py @@ -0,0 +1,268 @@ +#!/usr/bin/env python +# Copyright (c) 2012 Google Inc. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +"""gyptest.py -- test runner for GYP tests.""" + +from __future__ import print_function + +import argparse +import os +import platform +import subprocess +import sys +import time + + +def is_test_name(f): + return f.startswith("gyptest") and f.endswith(".py") + + +def find_all_gyptest_files(directory): + result = [] + for root, dirs, files in os.walk(directory): + result.extend([os.path.join(root, f) for f in files if is_test_name(f)]) + result.sort() + return result + + +def main(argv=None): + if argv is None: + argv = sys.argv + + parser = argparse.ArgumentParser() + parser.add_argument("-a", "--all", action="store_true", help="run all tests") + parser.add_argument("-C", "--chdir", action="store", help="change to directory") + parser.add_argument( + "-f", + "--format", + action="store", + default="", + help="run tests with the specified formats", + ) + parser.add_argument( + "-G", + "--gyp_option", + action="append", + default=[], + help="Add -G options to the gyp command line", + ) + parser.add_argument( + "-l", "--list", action="store_true", help="list available tests and exit" + ) + parser.add_argument( + "-n", + "--no-exec", + action="store_true", + help="no execute, just print the command line", + ) + parser.add_argument( + "--path", action="append", default=[], help="additional $PATH directory" + ) + parser.add_argument( + "-q", + "--quiet", + action="store_true", + help="quiet, don't print anything unless there are failures", + ) + parser.add_argument( + "-v", + "--verbose", + action="store_true", + help="print configuration info and test results.", + ) + parser.add_argument("tests", nargs="*") + args = parser.parse_args(argv[1:]) + + if args.chdir: + os.chdir(args.chdir) + + if args.path: + extra_path = [os.path.abspath(p) for p in args.path] + extra_path = os.pathsep.join(extra_path) + os.environ["PATH"] = extra_path + os.pathsep + os.environ["PATH"] + + if not args.tests: + if not args.all: + sys.stderr.write("Specify -a to get all tests.\n") + return 1 + args.tests = ["test"] + + tests = [] + for arg in args.tests: + if os.path.isdir(arg): + tests.extend(find_all_gyptest_files(os.path.normpath(arg))) + else: + if not is_test_name(os.path.basename(arg)): + print(arg, "is not a valid gyp test name.", file=sys.stderr) + sys.exit(1) + tests.append(arg) + + if args.list: + for test in tests: + print(test) + sys.exit(0) + + os.environ["PYTHONPATH"] = os.path.abspath("test/lib") + + if args.verbose: + print_configuration_info() + + if args.gyp_option and not args.quiet: + print("Extra Gyp options: %s\n" % args.gyp_option) + + if args.format: + format_list = args.format.split(",") + else: + format_list = { + "aix5": ["make"], + "freebsd7": ["make"], + "freebsd8": ["make"], + "openbsd5": ["make"], + "cygwin": ["msvs"], + "win32": ["msvs", "ninja"], + "linux": ["make", "ninja"], + "linux2": ["make", "ninja"], + "linux3": ["make", "ninja"], + # TODO: Re-enable xcode-ninja. + # https://bugs.chromium.org/p/gyp/issues/detail?id=530 + # 'darwin': ['make', 'ninja', 'xcode', 'xcode-ninja'], + "darwin": ["make", "ninja", "xcode"], + }[sys.platform] + + gyp_options = [] + for option in args.gyp_option: + gyp_options += ["-G", option] + + runner = Runner(format_list, tests, gyp_options, args.verbose) + runner.run() + + if not args.quiet: + runner.print_results() + + if runner.failures: + return 1 + else: + return 0 + + +def print_configuration_info(): + print("Test configuration:") + if sys.platform == "darwin": + sys.path.append(os.path.abspath("test/lib")) + import TestMac + + print(" Mac %s %s" % (platform.mac_ver()[0], platform.mac_ver()[2])) + print(" Xcode %s" % TestMac.Xcode.Version()) + elif sys.platform == "win32": + sys.path.append(os.path.abspath("pylib")) + import gyp.MSVSVersion + + print(" Win %s %s\n" % platform.win32_ver()[0:2]) + print(" MSVS %s" % gyp.MSVSVersion.SelectVisualStudioVersion().Description()) + elif sys.platform in ("linux", "linux2"): + print(" Linux %s" % " ".join(platform.linux_distribution())) + print(" Python %s" % platform.python_version()) + print(" PYTHONPATH=%s" % os.environ["PYTHONPATH"]) + print() + + +class Runner(object): + def __init__(self, formats, tests, gyp_options, verbose): + self.formats = formats + self.tests = tests + self.verbose = verbose + self.gyp_options = gyp_options + self.failures = [] + self.num_tests = len(formats) * len(tests) + num_digits = len(str(self.num_tests)) + self.fmt_str = "[%%%dd/%%%dd] (%%s) %%s" % (num_digits, num_digits) + self.isatty = sys.stdout.isatty() and not self.verbose + self.env = os.environ.copy() + self.hpos = 0 + + def run(self): + run_start = time.time() + + i = 1 + for fmt in self.formats: + for test in self.tests: + self.run_test(test, fmt, i) + i += 1 + + if self.isatty: + self.erase_current_line() + + self.took = time.time() - run_start + + def run_test(self, test, fmt, i): + if self.isatty: + self.erase_current_line() + + msg = self.fmt_str % (i, self.num_tests, fmt, test) + self.print_(msg) + + start = time.time() + cmd = [sys.executable, test] + self.gyp_options + self.env["TESTGYP_FORMAT"] = fmt + proc = subprocess.Popen( + cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, env=self.env + ) + proc.wait() + took = time.time() - start + + stdout = proc.stdout.read().decode("utf8") + if proc.returncode == 2: + res = "skipped" + elif proc.returncode: + res = "failed" + self.failures.append("(%s) %s" % (test, fmt)) + else: + res = "passed" + res_msg = " %s %.3fs" % (res, took) + self.print_(res_msg) + + if ( + stdout + and not stdout.endswith("PASSED\n") + and not (stdout.endswith("NO RESULT\n")) + ): + print() + print("\n".join(" %s" % line for line in stdout.splitlines())) + elif not self.isatty: + print() + + def print_(self, msg): + print(msg, end="") + index = msg.rfind("\n") + if index == -1: + self.hpos += len(msg) + else: + self.hpos = len(msg) - index + sys.stdout.flush() + + def erase_current_line(self): + print("\b" * self.hpos + " " * self.hpos + "\b" * self.hpos, end="") + sys.stdout.flush() + self.hpos = 0 + + def print_results(self): + num_failures = len(self.failures) + if num_failures: + print() + if num_failures == 1: + print("Failed the following test:") + else: + print("Failed the following %d tests:" % num_failures) + print("\t" + "\n\t".join(sorted(self.failures))) + print() + print( + "Ran %d tests in %.3fs, %d failed." + % (self.num_tests, self.took, num_failures) + ) + print() + + +if __name__ == "__main__": + sys.exit(main()) diff --git a/deps/npm/node_modules/node-gyp/gyp/tools/graphviz.py b/deps/npm/node_modules/node-gyp/gyp/tools/graphviz.py index 538b059da4a7e6..1f3acf37fccd8a 100755 --- a/deps/npm/node_modules/node-gyp/gyp/tools/graphviz.py +++ b/deps/npm/node_modules/node-gyp/gyp/tools/graphviz.py @@ -16,87 +16,88 @@ def ParseTarget(target): - target, _, suffix = target.partition('#') - filename, _, target = target.partition(':') - return filename, target, suffix + target, _, suffix = target.partition("#") + filename, _, target = target.partition(":") + return filename, target, suffix def LoadEdges(filename, targets): - """Load the edges map from the dump file, and filter it to only + """Load the edges map from the dump file, and filter it to only show targets in |targets| and their depedendents.""" - file = open('dump.json') - edges = json.load(file) - file.close() + file = open("dump.json") + edges = json.load(file) + file.close() - # Copy out only the edges we're interested in from the full edge list. - target_edges = {} - to_visit = targets[:] - while to_visit: - src = to_visit.pop() - if src in target_edges: - continue - target_edges[src] = edges[src] - to_visit.extend(edges[src]) + # Copy out only the edges we're interested in from the full edge list. + target_edges = {} + to_visit = targets[:] + while to_visit: + src = to_visit.pop() + if src in target_edges: + continue + target_edges[src] = edges[src] + to_visit.extend(edges[src]) - return target_edges + return target_edges def WriteGraph(edges): - """Print a graphviz graph to stdout. + """Print a graphviz graph to stdout. |edges| is a map of target to a list of other targets it depends on.""" - # Bucket targets by file. - files = collections.defaultdict(list) - for src, dst in edges.items(): - build_file, target_name, toolset = ParseTarget(src) - files[build_file].append(src) - - print('digraph D {') - print(' fontsize=8') # Used by subgraphs. - print(' node [fontsize=8]') - - # Output nodes by file. We must first write out each node within - # its file grouping before writing out any edges that may refer - # to those nodes. - for filename, targets in files.items(): - if len(targets) == 1: - # If there's only one node for this file, simplify - # the display by making it a box without an internal node. - target = targets[0] - build_file, target_name, toolset = ParseTarget(target) - print(' "%s" [shape=box, label="%s\\n%s"]' % (target, filename, - target_name)) - else: - # Group multiple nodes together in a subgraph. - print(' subgraph "cluster_%s" {' % filename) - print(' label = "%s"' % filename) - for target in targets: - build_file, target_name, toolset = ParseTarget(target) - print(' "%s" [label="%s"]' % (target, target_name)) - print(' }') - - # Now that we've placed all the nodes within subgraphs, output all - # the edges between nodes. - for src, dsts in edges.items(): - for dst in dsts: - print(' "%s" -> "%s"' % (src, dst)) - - print('}') + # Bucket targets by file. + files = collections.defaultdict(list) + for src, dst in edges.items(): + build_file, target_name, toolset = ParseTarget(src) + files[build_file].append(src) + + print("digraph D {") + print(" fontsize=8") # Used by subgraphs. + print(" node [fontsize=8]") + + # Output nodes by file. We must first write out each node within + # its file grouping before writing out any edges that may refer + # to those nodes. + for filename, targets in files.items(): + if len(targets) == 1: + # If there's only one node for this file, simplify + # the display by making it a box without an internal node. + target = targets[0] + build_file, target_name, toolset = ParseTarget(target) + print( + ' "%s" [shape=box, label="%s\\n%s"]' % (target, filename, target_name) + ) + else: + # Group multiple nodes together in a subgraph. + print(' subgraph "cluster_%s" {' % filename) + print(' label = "%s"' % filename) + for target in targets: + build_file, target_name, toolset = ParseTarget(target) + print(' "%s" [label="%s"]' % (target, target_name)) + print(" }") + + # Now that we've placed all the nodes within subgraphs, output all + # the edges between nodes. + for src, dsts in edges.items(): + for dst in dsts: + print(' "%s" -> "%s"' % (src, dst)) + + print("}") def main(): - if len(sys.argv) < 2: - print(__doc__, file=sys.stderr) - print(file=sys.stderr) - print('usage: %s target1 target2...' % (sys.argv[0]), file=sys.stderr) - return 1 + if len(sys.argv) < 2: + print(__doc__, file=sys.stderr) + print(file=sys.stderr) + print("usage: %s target1 target2..." % (sys.argv[0]), file=sys.stderr) + return 1 - edges = LoadEdges('dump.json', sys.argv[1:]) + edges = LoadEdges("dump.json", sys.argv[1:]) - WriteGraph(edges) - return 0 + WriteGraph(edges) + return 0 -if __name__ == '__main__': - sys.exit(main()) +if __name__ == "__main__": + sys.exit(main()) diff --git a/deps/npm/node_modules/node-gyp/gyp/tools/pretty_gyp.py b/deps/npm/node_modules/node-gyp/gyp/tools/pretty_gyp.py index 633048a59ad28c..7313b4fe1b6710 100755 --- a/deps/npm/node_modules/node-gyp/gyp/tools/pretty_gyp.py +++ b/deps/npm/node_modules/node-gyp/gyp/tools/pretty_gyp.py @@ -13,7 +13,7 @@ # Regex to remove comments when we're counting braces. -COMMENT_RE = re.compile(r'\s*#.*') +COMMENT_RE = re.compile(r"\s*#.*") # Regex to remove quoted strings when we're counting braces. # It takes into account quoted quotes, and makes sure that the quotes match. @@ -24,45 +24,47 @@ def comment_replace(matchobj): - return matchobj.group(1) + matchobj.group(2) + '#' * len(matchobj.group(3)) + return matchobj.group(1) + matchobj.group(2) + "#" * len(matchobj.group(3)) def mask_comments(input): - """Mask the quoted strings so we skip braces inside quoted strings.""" - search_re = re.compile(r'(.*?)(#)(.*)') - return [search_re.sub(comment_replace, line) for line in input] + """Mask the quoted strings so we skip braces inside quoted strings.""" + search_re = re.compile(r"(.*?)(#)(.*)") + return [search_re.sub(comment_replace, line) for line in input] def quote_replace(matchobj): - return "%s%s%s%s" % (matchobj.group(1), - matchobj.group(2), - 'x'*len(matchobj.group(3)), - matchobj.group(2)) + return "%s%s%s%s" % ( + matchobj.group(1), + matchobj.group(2), + "x" * len(matchobj.group(3)), + matchobj.group(2), + ) def mask_quotes(input): - """Mask the quoted strings so we skip braces inside quoted strings.""" - search_re = re.compile(r'(.*?)' + QUOTE_RE_STR) - return [search_re.sub(quote_replace, line) for line in input] + """Mask the quoted strings so we skip braces inside quoted strings.""" + search_re = re.compile(r"(.*?)" + QUOTE_RE_STR) + return [search_re.sub(quote_replace, line) for line in input] def do_split(input, masked_input, search_re): - output = [] - mask_output = [] - for (line, masked_line) in zip(input, masked_input): - m = search_re.match(masked_line) - while m: - split = len(m.group(1)) - line = line[:split] + r'\n' + line[split:] - masked_line = masked_line[:split] + r'\n' + masked_line[split:] - m = search_re.match(masked_line) - output.extend(line.split(r'\n')) - mask_output.extend(masked_line.split(r'\n')) - return (output, mask_output) + output = [] + mask_output = [] + for (line, masked_line) in zip(input, masked_input): + m = search_re.match(masked_line) + while m: + split = len(m.group(1)) + line = line[:split] + r"\n" + line[split:] + masked_line = masked_line[:split] + r"\n" + masked_line[split:] + m = search_re.match(masked_line) + output.extend(line.split(r"\n")) + mask_output.extend(masked_line.split(r"\n")) + return (output, mask_output) def split_double_braces(input): - """Masks out the quotes and comments, and then splits appropriate + """Masks out the quotes and comments, and then splits appropriate lines (lines that matche the double_*_brace re's above) before indenting them below. @@ -70,88 +72,86 @@ def split_double_braces(input): that the indentation looks prettier when all laid out (e.g. closing braces make a nice diagonal line). """ - double_open_brace_re = re.compile(r'(.*?[\[\{\(,])(\s*)([\[\{\(])') - double_close_brace_re = re.compile(r'(.*?[\]\}\)],?)(\s*)([\]\}\)])') + double_open_brace_re = re.compile(r"(.*?[\[\{\(,])(\s*)([\[\{\(])") + double_close_brace_re = re.compile(r"(.*?[\]\}\)],?)(\s*)([\]\}\)])") - masked_input = mask_quotes(input) - masked_input = mask_comments(masked_input) + masked_input = mask_quotes(input) + masked_input = mask_comments(masked_input) - (output, mask_output) = do_split(input, masked_input, double_open_brace_re) - (output, mask_output) = do_split(output, mask_output, double_close_brace_re) + (output, mask_output) = do_split(input, masked_input, double_open_brace_re) + (output, mask_output) = do_split(output, mask_output, double_close_brace_re) - return output + return output def count_braces(line): - """keeps track of the number of braces on a given line and returns the result. + """keeps track of the number of braces on a given line and returns the result. It starts at zero and subtracts for closed braces, and adds for open braces. """ - open_braces = ['[', '(', '{'] - close_braces = [']', ')', '}'] - closing_prefix_re = re.compile(r'(.*?[^\s\]\}\)]+.*?)([\]\}\)],?)\s*$') - cnt = 0 - stripline = COMMENT_RE.sub(r'', line) - stripline = QUOTE_RE.sub(r"''", stripline) - for char in stripline: - for brace in open_braces: - if char == brace: - cnt += 1 - for brace in close_braces: - if char == brace: - cnt -= 1 - - after = False - if cnt > 0: - after = True - - # This catches the special case of a closing brace having something - # other than just whitespace ahead of it -- we don't want to - # unindent that until after this line is printed so it stays with - # the previous indentation level. - if cnt < 0 and closing_prefix_re.match(stripline): - after = True - return (cnt, after) + open_braces = ["[", "(", "{"] + close_braces = ["]", ")", "}"] + closing_prefix_re = re.compile(r"(.*?[^\s\]\}\)]+.*?)([\]\}\)],?)\s*$") + cnt = 0 + stripline = COMMENT_RE.sub(r"", line) + stripline = QUOTE_RE.sub(r"''", stripline) + for char in stripline: + for brace in open_braces: + if char == brace: + cnt += 1 + for brace in close_braces: + if char == brace: + cnt -= 1 + + after = False + if cnt > 0: + after = True + + # This catches the special case of a closing brace having something + # other than just whitespace ahead of it -- we don't want to + # unindent that until after this line is printed so it stays with + # the previous indentation level. + if cnt < 0 and closing_prefix_re.match(stripline): + after = True + return (cnt, after) def prettyprint_input(lines): - """Does the main work of indenting the input based on the brace counts.""" - indent = 0 - basic_offset = 2 - last_line = "" - for line in lines: - if COMMENT_RE.match(line): - print(line) - else: - line = line.strip('\r\n\t ') # Otherwise doesn't strip \r on Unix. - if len(line) > 0: - (brace_diff, after) = count_braces(line) - if brace_diff != 0: - if after: - print(" " * (basic_offset * indent) + line) - indent += brace_diff - else: - indent += brace_diff - print(" " * (basic_offset * indent) + line) + """Does the main work of indenting the input based on the brace counts.""" + indent = 0 + basic_offset = 2 + for line in lines: + if COMMENT_RE.match(line): + print(line) else: - print(" " * (basic_offset * indent) + line) - else: - print("") - last_line = line + line = line.strip("\r\n\t ") # Otherwise doesn't strip \r on Unix. + if len(line) > 0: + (brace_diff, after) = count_braces(line) + if brace_diff != 0: + if after: + print(" " * (basic_offset * indent) + line) + indent += brace_diff + else: + indent += brace_diff + print(" " * (basic_offset * indent) + line) + else: + print(" " * (basic_offset * indent) + line) + else: + print("") def main(): - if len(sys.argv) > 1: - data = open(sys.argv[1]).read().splitlines() - else: - data = sys.stdin.read().splitlines() - # Split up the double braces. - lines = split_double_braces(data) + if len(sys.argv) > 1: + data = open(sys.argv[1]).read().splitlines() + else: + data = sys.stdin.read().splitlines() + # Split up the double braces. + lines = split_double_braces(data) - # Indent and print the output. - prettyprint_input(lines) - return 0 + # Indent and print the output. + prettyprint_input(lines) + return 0 -if __name__ == '__main__': - sys.exit(main()) +if __name__ == "__main__": + sys.exit(main()) diff --git a/deps/npm/node_modules/node-gyp/gyp/tools/pretty_sln.py b/deps/npm/node_modules/node-gyp/gyp/tools/pretty_sln.py index 196566fb9e4470..2b1cb1de747577 100755 --- a/deps/npm/node_modules/node-gyp/gyp/tools/pretty_sln.py +++ b/deps/npm/node_modules/node-gyp/gyp/tools/pretty_sln.py @@ -19,153 +19,164 @@ import sys import pretty_vcproj -__author__ = 'nsylvain (Nicolas Sylvain)' +__author__ = "nsylvain (Nicolas Sylvain)" + def BuildProject(project, built, projects, deps): - # if all dependencies are done, we can build it, otherwise we try to build the - # dependency. - # This is not infinite-recursion proof. - for dep in deps[project]: - if dep not in built: - BuildProject(dep, built, projects, deps) - print(project) - built.append(project) + # if all dependencies are done, we can build it, otherwise we try to build the + # dependency. + # This is not infinite-recursion proof. + for dep in deps[project]: + if dep not in built: + BuildProject(dep, built, projects, deps) + print(project) + built.append(project) + def ParseSolution(solution_file): - # All projects, their clsid and paths. - projects = dict() - - # A list of dependencies associated with a project. - dependencies = dict() - - # Regular expressions that matches the SLN format. - # The first line of a project definition. - begin_project = re.compile(r'^Project\("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942' - r'}"\) = "(.*)", "(.*)", "(.*)"$') - # The last line of a project definition. - end_project = re.compile('^EndProject$') - # The first line of a dependency list. - begin_dep = re.compile( - r'ProjectSection\(ProjectDependencies\) = postProject$') - # The last line of a dependency list. - end_dep = re.compile('EndProjectSection$') - # A line describing a dependency. - dep_line = re.compile(' *({.*}) = ({.*})$') - - in_deps = False - solution = open(solution_file) - for line in solution: - results = begin_project.search(line) - if results: - # Hack to remove icu because the diff is too different. - if results.group(1).find('icu') != -1: - continue - # We remove "_gyp" from the names because it helps to diff them. - current_project = results.group(1).replace('_gyp', '') - projects[current_project] = [results.group(2).replace('_gyp', ''), - results.group(3), - results.group(2)] - dependencies[current_project] = [] - continue - - results = end_project.search(line) - if results: - current_project = None - continue - - results = begin_dep.search(line) - if results: - in_deps = True - continue - - results = end_dep.search(line) - if results: - in_deps = False - continue - - results = dep_line.search(line) - if results and in_deps and current_project: - dependencies[current_project].append(results.group(1)) - continue - - # Change all dependencies clsid to name instead. - for project in dependencies: - # For each dependencies in this project - new_dep_array = [] - for dep in dependencies[project]: - # Look for the project name matching this cldis - for project_info in projects: - if projects[project_info][1] == dep: - new_dep_array.append(project_info) - dependencies[project] = sorted(new_dep_array) - - return (projects, dependencies) + # All projects, their clsid and paths. + projects = dict() + + # A list of dependencies associated with a project. + dependencies = dict() + + # Regular expressions that matches the SLN format. + # The first line of a project definition. + begin_project = re.compile( + r'^Project\("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942' + r'}"\) = "(.*)", "(.*)", "(.*)"$' + ) + # The last line of a project definition. + end_project = re.compile("^EndProject$") + # The first line of a dependency list. + begin_dep = re.compile(r"ProjectSection\(ProjectDependencies\) = postProject$") + # The last line of a dependency list. + end_dep = re.compile("EndProjectSection$") + # A line describing a dependency. + dep_line = re.compile(" *({.*}) = ({.*})$") + + in_deps = False + solution = open(solution_file) + for line in solution: + results = begin_project.search(line) + if results: + # Hack to remove icu because the diff is too different. + if results.group(1).find("icu") != -1: + continue + # We remove "_gyp" from the names because it helps to diff them. + current_project = results.group(1).replace("_gyp", "") + projects[current_project] = [ + results.group(2).replace("_gyp", ""), + results.group(3), + results.group(2), + ] + dependencies[current_project] = [] + continue + + results = end_project.search(line) + if results: + current_project = None + continue + + results = begin_dep.search(line) + if results: + in_deps = True + continue + + results = end_dep.search(line) + if results: + in_deps = False + continue + + results = dep_line.search(line) + if results and in_deps and current_project: + dependencies[current_project].append(results.group(1)) + continue + + # Change all dependencies clsid to name instead. + for project in dependencies: + # For each dependencies in this project + new_dep_array = [] + for dep in dependencies[project]: + # Look for the project name matching this cldis + for project_info in projects: + if projects[project_info][1] == dep: + new_dep_array.append(project_info) + dependencies[project] = sorted(new_dep_array) + + return (projects, dependencies) + def PrintDependencies(projects, deps): - print("---------------------------------------") - print("Dependencies for all projects") - print("---------------------------------------") - print("-- --") + print("---------------------------------------") + print("Dependencies for all projects") + print("---------------------------------------") + print("-- --") + + for (project, dep_list) in sorted(deps.items()): + print("Project : %s" % project) + print("Path : %s" % projects[project][0]) + if dep_list: + for dep in dep_list: + print(" - %s" % dep) + print("") - for (project, dep_list) in sorted(deps.items()): - print("Project : %s" % project) - print("Path : %s" % projects[project][0]) - if dep_list: - for dep in dep_list: - print(" - %s" % dep) - print("") + print("-- --") - print("-- --") def PrintBuildOrder(projects, deps): - print("---------------------------------------") - print("Build order ") - print("---------------------------------------") - print("-- --") + print("---------------------------------------") + print("Build order ") + print("---------------------------------------") + print("-- --") - built = [] - for (project, _) in sorted(deps.items()): - if project not in built: - BuildProject(project, built, projects, deps) + built = [] + for (project, _) in sorted(deps.items()): + if project not in built: + BuildProject(project, built, projects, deps) - print("-- --") + print("-- --") -def PrintVCProj(projects): - for project in projects: - print("-------------------------------------") - print("-------------------------------------") - print(project) - print(project) - print(project) - print("-------------------------------------") - print("-------------------------------------") +def PrintVCProj(projects): - project_path = os.path.abspath(os.path.join(os.path.dirname(sys.argv[1]), - projects[project][2])) + for project in projects: + print("-------------------------------------") + print("-------------------------------------") + print(project) + print(project) + print(project) + print("-------------------------------------") + print("-------------------------------------") + + project_path = os.path.abspath( + os.path.join(os.path.dirname(sys.argv[1]), projects[project][2]) + ) + + pretty = pretty_vcproj + argv = [ + "", + project_path, + "$(SolutionDir)=%s\\" % os.path.dirname(sys.argv[1]), + ] + argv.extend(sys.argv[3:]) + pretty.main(argv) - pretty = pretty_vcproj - argv = [ '', - project_path, - '$(SolutionDir)=%s\\' % os.path.dirname(sys.argv[1]), - ] - argv.extend(sys.argv[3:]) - pretty.main(argv) def main(): - # check if we have exactly 1 parameter. - if len(sys.argv) < 2: - print('Usage: %s "c:\\path\\to\\project.sln"' % sys.argv[0]) - return 1 + # check if we have exactly 1 parameter. + if len(sys.argv) < 2: + print('Usage: %s "c:\\path\\to\\project.sln"' % sys.argv[0]) + return 1 - (projects, deps) = ParseSolution(sys.argv[1]) - PrintDependencies(projects, deps) - PrintBuildOrder(projects, deps) + (projects, deps) = ParseSolution(sys.argv[1]) + PrintDependencies(projects, deps) + PrintBuildOrder(projects, deps) - if '--recursive' in sys.argv: - PrintVCProj(projects) - return 0 + if "--recursive" in sys.argv: + PrintVCProj(projects) + return 0 -if __name__ == '__main__': - sys.exit(main()) +if __name__ == "__main__": + sys.exit(main()) diff --git a/deps/npm/node_modules/node-gyp/gyp/tools/pretty_vcproj.py b/deps/npm/node_modules/node-gyp/gyp/tools/pretty_vcproj.py index 24e99282da9d9b..38fbf3fecf9b05 100755 --- a/deps/npm/node_modules/node-gyp/gyp/tools/pretty_vcproj.py +++ b/deps/npm/node_modules/node-gyp/gyp/tools/pretty_vcproj.py @@ -20,318 +20,326 @@ from xml.dom.minidom import parse from xml.dom.minidom import Node -__author__ = 'nsylvain (Nicolas Sylvain)' +__author__ = "nsylvain (Nicolas Sylvain)" try: - cmp + cmp except NameError: - def cmp(x, y): - return (x > y) - (x < y) + + def cmp(x, y): + return (x > y) - (x < y) + REPLACEMENTS = dict() ARGUMENTS = None class CmpTuple(object): - """Compare function between 2 tuple.""" - def __call__(self, x, y): - return cmp(x[0], y[0]) + """Compare function between 2 tuple.""" + + def __call__(self, x, y): + return cmp(x[0], y[0]) class CmpNode(object): - """Compare function between 2 xml nodes.""" + """Compare function between 2 xml nodes.""" - def __call__(self, x, y): - def get_string(node): - node_string = "node" - node_string += node.nodeName - if node.nodeValue: - node_string += node.nodeValue + def __call__(self, x, y): + def get_string(node): + node_string = "node" + node_string += node.nodeName + if node.nodeValue: + node_string += node.nodeValue - if node.attributes: - # We first sort by name, if present. - node_string += node.getAttribute("Name") + if node.attributes: + # We first sort by name, if present. + node_string += node.getAttribute("Name") - all_nodes = [] - for (name, value) in node.attributes.items(): - all_nodes.append((name, value)) + all_nodes = [] + for (name, value) in node.attributes.items(): + all_nodes.append((name, value)) - all_nodes.sort(CmpTuple()) - for (name, value) in all_nodes: - node_string += name - node_string += value + all_nodes.sort(CmpTuple()) + for (name, value) in all_nodes: + node_string += name + node_string += value - return node_string + return node_string - return cmp(get_string(x), get_string(y)) + return cmp(get_string(x), get_string(y)) def PrettyPrintNode(node, indent=0): - if node.nodeType == Node.TEXT_NODE: - if node.data.strip(): - print('%s%s' % (' '*indent, node.data.strip())) - return - - if node.childNodes: - node.normalize() - # Get the number of attributes - attr_count = 0 - if node.attributes: - attr_count = node.attributes.length - - # Print the main tag - if attr_count == 0: - print('%s<%s>' % (' '*indent, node.nodeName)) - else: - print('%s<%s' % (' '*indent, node.nodeName)) - - all_attributes = [] - for (name, value) in node.attributes.items(): - all_attributes.append((name, value)) - all_attributes.sort(CmpTuple()) - for (name, value) in all_attributes: - print('%s %s="%s"' % (' '*indent, name, value)) - print('%s>' % (' '*indent)) - if node.nodeValue: - print('%s %s' % (' '*indent, node.nodeValue)) - - for sub_node in node.childNodes: - PrettyPrintNode(sub_node, indent=indent+2) - print('%s' % (' '*indent, node.nodeName)) + if node.nodeType == Node.TEXT_NODE: + if node.data.strip(): + print("%s%s" % (" " * indent, node.data.strip())) + return + + if node.childNodes: + node.normalize() + # Get the number of attributes + attr_count = 0 + if node.attributes: + attr_count = node.attributes.length + + # Print the main tag + if attr_count == 0: + print("%s<%s>" % (" " * indent, node.nodeName)) + else: + print("%s<%s" % (" " * indent, node.nodeName)) + + all_attributes = [] + for (name, value) in node.attributes.items(): + all_attributes.append((name, value)) + all_attributes.sort(CmpTuple()) + for (name, value) in all_attributes: + print('%s %s="%s"' % (" " * indent, name, value)) + print("%s>" % (" " * indent)) + if node.nodeValue: + print("%s %s" % (" " * indent, node.nodeValue)) + + for sub_node in node.childNodes: + PrettyPrintNode(sub_node, indent=indent + 2) + print("%s" % (" " * indent, node.nodeName)) def FlattenFilter(node): - """Returns a list of all the node and sub nodes.""" - node_list = [] + """Returns a list of all the node and sub nodes.""" + node_list = [] - if (node.attributes and - node.getAttribute('Name') == '_excluded_files'): - # We don't add the "_excluded_files" filter. - return [] + if node.attributes and node.getAttribute("Name") == "_excluded_files": + # We don't add the "_excluded_files" filter. + return [] - for current in node.childNodes: - if current.nodeName == 'Filter': - node_list.extend(FlattenFilter(current)) - else: - node_list.append(current) + for current in node.childNodes: + if current.nodeName == "Filter": + node_list.extend(FlattenFilter(current)) + else: + node_list.append(current) - return node_list + return node_list def FixFilenames(filenames, current_directory): - new_list = [] - for filename in filenames: - if filename: - for key in REPLACEMENTS: - filename = filename.replace(key, REPLACEMENTS[key]) - os.chdir(current_directory) - filename = filename.strip('"\' ') - if filename.startswith('$'): - new_list.append(filename) - else: - new_list.append(os.path.abspath(filename)) - return new_list + new_list = [] + for filename in filenames: + if filename: + for key in REPLACEMENTS: + filename = filename.replace(key, REPLACEMENTS[key]) + os.chdir(current_directory) + filename = filename.strip("\"' ") + if filename.startswith("$"): + new_list.append(filename) + else: + new_list.append(os.path.abspath(filename)) + return new_list def AbsoluteNode(node): - """Makes all the properties we know about in this node absolute.""" - if node.attributes: - for (name, value) in node.attributes.items(): - if name in ['InheritedPropertySheets', 'RelativePath', - 'AdditionalIncludeDirectories', - 'IntermediateDirectory', 'OutputDirectory', - 'AdditionalLibraryDirectories']: - # We want to fix up these paths - path_list = value.split(';') - new_list = FixFilenames(path_list, os.path.dirname(ARGUMENTS[1])) - node.setAttribute(name, ';'.join(new_list)) - if not value: - node.removeAttribute(name) + """Makes all the properties we know about in this node absolute.""" + if node.attributes: + for (name, value) in node.attributes.items(): + if name in [ + "InheritedPropertySheets", + "RelativePath", + "AdditionalIncludeDirectories", + "IntermediateDirectory", + "OutputDirectory", + "AdditionalLibraryDirectories", + ]: + # We want to fix up these paths + path_list = value.split(";") + new_list = FixFilenames(path_list, os.path.dirname(ARGUMENTS[1])) + node.setAttribute(name, ";".join(new_list)) + if not value: + node.removeAttribute(name) def CleanupVcproj(node): - """For each sub node, we call recursively this function.""" - for sub_node in node.childNodes: - AbsoluteNode(sub_node) - CleanupVcproj(sub_node) - - # Normalize the node, and remove all extranous whitespaces. - for sub_node in node.childNodes: - if sub_node.nodeType == Node.TEXT_NODE: - sub_node.data = sub_node.data.replace("\r", "") - sub_node.data = sub_node.data.replace("\n", "") - sub_node.data = sub_node.data.rstrip() - - # Fix all the semicolon separated attributes to be sorted, and we also - # remove the dups. - if node.attributes: - for (name, value) in node.attributes.items(): - sorted_list = sorted(value.split(';')) - unique_list = [] - for i in sorted_list: - if not unique_list.count(i): - unique_list.append(i) - node.setAttribute(name, ';'.join(unique_list)) - if not value: - node.removeAttribute(name) - - if node.childNodes: - node.normalize() - - # For each node, take a copy, and remove it from the list. - node_array = [] - while node.childNodes and node.childNodes[0]: - # Take a copy of the node and remove it from the list. - current = node.childNodes[0] - node.removeChild(current) - - # If the child is a filter, we want to append all its children - # to this same list. - if current.nodeName == 'Filter': - node_array.extend(FlattenFilter(current)) - else: - node_array.append(current) - - - # Sort the list. - node_array.sort(CmpNode()) - - # Insert the nodes in the correct order. - for new_node in node_array: - # But don't append empty tool node. - if new_node.nodeName == 'Tool': - if new_node.attributes and new_node.attributes.length == 1: - # This one was empty. - continue - if new_node.nodeName == 'UserMacro': - continue - node.appendChild(new_node) + """For each sub node, we call recursively this function.""" + for sub_node in node.childNodes: + AbsoluteNode(sub_node) + CleanupVcproj(sub_node) + + # Normalize the node, and remove all extranous whitespaces. + for sub_node in node.childNodes: + if sub_node.nodeType == Node.TEXT_NODE: + sub_node.data = sub_node.data.replace("\r", "") + sub_node.data = sub_node.data.replace("\n", "") + sub_node.data = sub_node.data.rstrip() + + # Fix all the semicolon separated attributes to be sorted, and we also + # remove the dups. + if node.attributes: + for (name, value) in node.attributes.items(): + sorted_list = sorted(value.split(";")) + unique_list = [] + for i in sorted_list: + if not unique_list.count(i): + unique_list.append(i) + node.setAttribute(name, ";".join(unique_list)) + if not value: + node.removeAttribute(name) + + if node.childNodes: + node.normalize() + + # For each node, take a copy, and remove it from the list. + node_array = [] + while node.childNodes and node.childNodes[0]: + # Take a copy of the node and remove it from the list. + current = node.childNodes[0] + node.removeChild(current) + + # If the child is a filter, we want to append all its children + # to this same list. + if current.nodeName == "Filter": + node_array.extend(FlattenFilter(current)) + else: + node_array.append(current) + + # Sort the list. + node_array.sort(CmpNode()) + + # Insert the nodes in the correct order. + for new_node in node_array: + # But don't append empty tool node. + if new_node.nodeName == "Tool": + if new_node.attributes and new_node.attributes.length == 1: + # This one was empty. + continue + if new_node.nodeName == "UserMacro": + continue + node.appendChild(new_node) def GetConfiguationNodes(vcproj): - #TODO(nsylvain): Find a better way to navigate the xml. - nodes = [] - for node in vcproj.childNodes: - if node.nodeName == "Configurations": - for sub_node in node.childNodes: - if sub_node.nodeName == "Configuration": - nodes.append(sub_node) + # TODO(nsylvain): Find a better way to navigate the xml. + nodes = [] + for node in vcproj.childNodes: + if node.nodeName == "Configurations": + for sub_node in node.childNodes: + if sub_node.nodeName == "Configuration": + nodes.append(sub_node) - return nodes + return nodes def GetChildrenVsprops(filename): - dom = parse(filename) - if dom.documentElement.attributes: - vsprops = dom.documentElement.getAttribute('InheritedPropertySheets') - return FixFilenames(vsprops.split(';'), os.path.dirname(filename)) - return [] + dom = parse(filename) + if dom.documentElement.attributes: + vsprops = dom.documentElement.getAttribute("InheritedPropertySheets") + return FixFilenames(vsprops.split(";"), os.path.dirname(filename)) + return [] -def SeekToNode(node1, child2): - # A text node does not have properties. - if child2.nodeType == Node.TEXT_NODE: - return None - # Get the name of the current node. - current_name = child2.getAttribute("Name") - if not current_name: - # There is no name. We don't know how to merge. +def SeekToNode(node1, child2): + # A text node does not have properties. + if child2.nodeType == Node.TEXT_NODE: + return None + + # Get the name of the current node. + current_name = child2.getAttribute("Name") + if not current_name: + # There is no name. We don't know how to merge. + return None + + # Look through all the nodes to find a match. + for sub_node in node1.childNodes: + if sub_node.nodeName == child2.nodeName: + name = sub_node.getAttribute("Name") + if name == current_name: + return sub_node + + # No match. We give up. return None - # Look through all the nodes to find a match. - for sub_node in node1.childNodes: - if sub_node.nodeName == child2.nodeName: - name = sub_node.getAttribute("Name") - if name == current_name: - return sub_node - - # No match. We give up. - return None - def MergeAttributes(node1, node2): - # No attributes to merge? - if not node2.attributes: - return - - for (name, value2) in node2.attributes.items(): - # Don't merge the 'Name' attribute. - if name == 'Name': - continue - value1 = node1.getAttribute(name) - if value1: - # The attribute exist in the main node. If it's equal, we leave it - # untouched, otherwise we concatenate it. - if value1 != value2: - node1.setAttribute(name, ';'.join([value1, value2])) - else: - # The attribute does not exist in the main node. We append this one. - node1.setAttribute(name, value2) - - # If the attribute was a property sheet attributes, we remove it, since - # they are useless. - if name == 'InheritedPropertySheets': - node1.removeAttribute(name) + # No attributes to merge? + if not node2.attributes: + return + + for (name, value2) in node2.attributes.items(): + # Don't merge the 'Name' attribute. + if name == "Name": + continue + value1 = node1.getAttribute(name) + if value1: + # The attribute exist in the main node. If it's equal, we leave it + # untouched, otherwise we concatenate it. + if value1 != value2: + node1.setAttribute(name, ";".join([value1, value2])) + else: + # The attribute does not exist in the main node. We append this one. + node1.setAttribute(name, value2) + + # If the attribute was a property sheet attributes, we remove it, since + # they are useless. + if name == "InheritedPropertySheets": + node1.removeAttribute(name) def MergeProperties(node1, node2): - MergeAttributes(node1, node2) - for child2 in node2.childNodes: - child1 = SeekToNode(node1, child2) - if child1: - MergeProperties(child1, child2) - else: - node1.appendChild(child2.cloneNode(True)) + MergeAttributes(node1, node2) + for child2 in node2.childNodes: + child1 = SeekToNode(node1, child2) + if child1: + MergeProperties(child1, child2) + else: + node1.appendChild(child2.cloneNode(True)) def main(argv): - """Main function of this vcproj prettifier.""" - global ARGUMENTS - ARGUMENTS = argv - - # check if we have exactly 1 parameter. - if len(argv) < 2: - print(('Usage: %s "c:\\path\\to\\vcproj.vcproj" [key1=value1] ' - '[key2=value2]' % argv[0])) - return 1 - - # Parse the keys - for i in range(2, len(argv)): - (key, value) = argv[i].split('=') - REPLACEMENTS[key] = value - - # Open the vcproj and parse the xml. - dom = parse(argv[1]) - - # First thing we need to do is find the Configuration Node and merge them - # with the vsprops they include. - for configuration_node in GetConfiguationNodes(dom.documentElement): - # Get the property sheets associated with this configuration. - vsprops = configuration_node.getAttribute('InheritedPropertySheets') - - # Fix the filenames to be absolute. - vsprops_list = FixFilenames(vsprops.strip().split(';'), - os.path.dirname(argv[1])) - - # Extend the list of vsprops with all vsprops contained in the current - # vsprops. - for current_vsprops in vsprops_list: - vsprops_list.extend(GetChildrenVsprops(current_vsprops)) - - # Now that we have all the vsprops, we need to merge them. - for current_vsprops in vsprops_list: - MergeProperties(configuration_node, - parse(current_vsprops).documentElement) - - # Now that everything is merged, we need to cleanup the xml. - CleanupVcproj(dom.documentElement) - - # Finally, we use the prett xml function to print the vcproj back to the - # user. - #print dom.toprettyxml(newl="\n") - PrettyPrintNode(dom.documentElement) - return 0 - - -if __name__ == '__main__': - sys.exit(main(sys.argv)) + """Main function of this vcproj prettifier.""" + global ARGUMENTS + ARGUMENTS = argv + + # check if we have exactly 1 parameter. + if len(argv) < 2: + print( + 'Usage: %s "c:\\path\\to\\vcproj.vcproj" [key1=value1] ' + "[key2=value2]" % argv[0] + ) + return 1 + + # Parse the keys + for i in range(2, len(argv)): + (key, value) = argv[i].split("=") + REPLACEMENTS[key] = value + + # Open the vcproj and parse the xml. + dom = parse(argv[1]) + + # First thing we need to do is find the Configuration Node and merge them + # with the vsprops they include. + for configuration_node in GetConfiguationNodes(dom.documentElement): + # Get the property sheets associated with this configuration. + vsprops = configuration_node.getAttribute("InheritedPropertySheets") + + # Fix the filenames to be absolute. + vsprops_list = FixFilenames( + vsprops.strip().split(";"), os.path.dirname(argv[1]) + ) + + # Extend the list of vsprops with all vsprops contained in the current + # vsprops. + for current_vsprops in vsprops_list: + vsprops_list.extend(GetChildrenVsprops(current_vsprops)) + + # Now that we have all the vsprops, we need to merge them. + for current_vsprops in vsprops_list: + MergeProperties(configuration_node, parse(current_vsprops).documentElement) + + # Now that everything is merged, we need to cleanup the xml. + CleanupVcproj(dom.documentElement) + + # Finally, we use the prett xml function to print the vcproj back to the + # user. + # print dom.toprettyxml(newl="\n") + PrettyPrintNode(dom.documentElement) + return 0 + + +if __name__ == "__main__": + sys.exit(main(sys.argv)) diff --git a/deps/npm/node_modules/node-gyp/lib/configure.js b/deps/npm/node_modules/node-gyp/lib/configure.js index 564564eea4e6fb..d4342b9d76a60d 100644 --- a/deps/npm/node_modules/node-gyp/lib/configure.js +++ b/deps/npm/node_modules/node-gyp/lib/configure.js @@ -4,7 +4,6 @@ const fs = require('graceful-fs') const path = require('path') const log = require('npmlog') const os = require('os') -const mkdirp = require('mkdirp') const processRelease = require('./process-release') const win = process.platform === 'win32' const findNodeDirectory = require('./find-node-directory') @@ -73,7 +72,7 @@ function configure (gyp, argv, callback) { function createBuildDir () { log.verbose('build dir', 'attempting to create "build" dir: %s', buildDir) - mkdirp(buildDir, function (err, isNew) { + fs.mkdir(buildDir, { recursive: true }, function (err, isNew) { if (err) { return callback(err) } @@ -133,6 +132,7 @@ function configure (gyp, argv, callback) { variables.target_arch = gyp.opts.arch || process.arch || 'ia32' if (variables.target_arch === 'arm64') { defaults.msvs_configuration_platform = 'ARM64' + defaults.xcode_configuration_platform = 'arm64' } // set the node development directory diff --git a/deps/npm/node_modules/node-gyp/lib/find-python.js b/deps/npm/node_modules/node-gyp/lib/find-python.js index fabc4630f15d44..af269de2fc6ca3 100644 --- a/deps/npm/node_modules/node-gyp/lib/find-python.js +++ b/deps/npm/node_modules/node-gyp/lib/find-python.js @@ -18,7 +18,7 @@ PythonFinder.prototype = { log: logWithPrefix(log, 'find Python'), argsExecutable: ['-c', 'import sys; print(sys.executable);'], argsVersion: ['-c', 'import sys; print("%s.%s.%s" % sys.version_info[:3]);'], - semverRange: '^2.6.0 || >=3.5.0', + semverRange: '2.7.x || >=3.5.0', // These can be overridden for testing: execFile: cp.execFile, @@ -26,8 +26,8 @@ PythonFinder.prototype = { win: win, pyLauncher: 'py.exe', winDefaultLocations: [ - path.join(process.env.SystemDrive || 'C:', 'Python27', 'python.exe'), - path.join(process.env.SystemDrive || 'C:', 'Python37', 'python.exe') + path.join(process.env.SystemDrive || 'C:', 'Python37', 'python.exe'), + path.join(process.env.SystemDrive || 'C:', 'Python27', 'python.exe') ], // Logs a message at verbose level, but also saves it to be displayed later @@ -87,6 +87,11 @@ PythonFinder.prototype = { check: this.checkCommand, arg: this.env.PYTHON }, + { + before: () => { this.addLog('checking if "python3" can be used') }, + check: this.checkCommand, + arg: 'python3' + }, { before: () => { this.addLog('checking if "python" can be used') }, check: this.checkCommand, @@ -96,22 +101,10 @@ PythonFinder.prototype = { before: () => { this.addLog('checking if "python2" can be used') }, check: this.checkCommand, arg: 'python2' - }, - { - before: () => { this.addLog('checking if "python3" can be used') }, - check: this.checkCommand, - arg: 'python3' } ] if (this.win) { - checks.push({ - before: () => { - this.addLog( - 'checking if the py launcher can be used to find Python 2') - }, - check: this.checkPyLauncher - }) for (var i = 0; i < this.winDefaultLocations.length; ++i) { const location = this.winDefaultLocations[i] checks.push({ @@ -123,6 +116,13 @@ PythonFinder.prototype = { arg: location }) } + checks.push({ + before: () => { + this.addLog( + 'checking if the py launcher can be used to find Python') + }, + check: this.checkPyLauncher + }) } return checks @@ -188,15 +188,10 @@ PythonFinder.prototype = { // Distributions of Python on Windows by default install with the "py.exe" // Python launcher which is more likely to exist than the Python executable // being in the $PATH. - // Because the Python launcher supports all versions of Python, we have to - // explicitly request a Python 2 version. This is done by supplying "-2" as - // the first command line argument. Since "py.exe -2" would be an invalid - // executable for "execFile", we have to use the launcher to figure out - // where the actual "python.exe" executable is located. checkPyLauncher: function checkPyLauncher (errorCallback) { this.log.verbose( - `- executing "${this.pyLauncher}" to get Python 2 executable path`) - this.run(this.pyLauncher, ['-2', ...this.argsExecutable], false, + `- executing "${this.pyLauncher}" to get Python executable path`) + this.run(this.pyLauncher, this.argsExecutable, false, function (err, execPath) { // Possible outcomes: same as checkCommand if (err) { diff --git a/deps/npm/node_modules/node-gyp/lib/install.js b/deps/npm/node_modules/node-gyp/lib/install.js index c919c1058811ee..f9fa2b34bd30cb 100644 --- a/deps/npm/node_modules/node-gyp/lib/install.js +++ b/deps/npm/node_modules/node-gyp/lib/install.js @@ -8,7 +8,6 @@ const crypto = require('crypto') const log = require('npmlog') const semver = require('semver') const request = require('request') -const mkdir = require('mkdirp') const processRelease = require('./process-release') const win = process.platform === 'win32' const getProxyFromURI = require('./proxy') @@ -114,7 +113,7 @@ function install (fs, gyp, argv, callback) { log.verbose('ensuring nodedir is created', devDir) // first create the dir for the node dev files - mkdir(devDir, function (err, created) { + fs.mkdir(devDir, { recursive: true }, function (err, created) { if (err) { if (err.code === 'EACCES') { eaccesFallback(err) @@ -310,7 +309,7 @@ function install (fs, gyp, argv, callback) { log.verbose(name, 'dir', dir) log.verbose(name, 'url', libUrl) - mkdir(dir, function (err) { + fs.mkdir(dir, { recursive: true }, function (err) { if (err) { return done(err) } diff --git a/deps/npm/node_modules/node-gyp/macOS_Catalina.md b/deps/npm/node_modules/node-gyp/macOS_Catalina.md index d948f76caa074d..79bf6ff50be09b 100644 --- a/deps/npm/node_modules/node-gyp/macOS_Catalina.md +++ b/deps/npm/node_modules/node-gyp/macOS_Catalina.md @@ -2,7 +2,26 @@ _This document specifically refers to upgrades from previous versions of macOS to Catalina (10.15). It should be removed from the source repository when Catalina ceases to be the latest macOS version or when future Catalina versions no longer raise these issues._ -**Upgrading to macOS Catalina may cause normal `node-gyp` installations to fail.** +**Both upgrading to macOS Catalina and running a Software Update in Catalina may cause normal `node-gyp` installations to fail. This might manifest as the following error during `npm install`:** + +```console +gyp: No Xcode or CLT version detected! +``` + +## node-gyp v7 + +The newest release of `node-gyp` should solve this problem. If you are using `node-gyp` directly then you should be able to install v7 and use it as-is. + +If you need to use `node-gyp` from within `npm` (e.g. through `npm install`), you will have to install `node-gyp` (either globally with `-g` or to a predictable location) and tell `npm` where the new version is. Either use: + +* `npm config set node_gyp `; or +* run `npm` with an environment variable prefix: `npm_config_node_gyp= npm install` + +Where "path to node-gyp" is to the `node-gyp` executable which may be a symlink in your global bin directory (e.g. `/usr/local/bin/node-gyp`), or a path to the `node-gyp` installation directory and the `bin/node-gyp.js` file within it (e.g. `/usr/local/lib/node_modules/node-gyp/bin/node-gyp.js`). + +**If you use `npm config set` to change your global `node_gyp` you are responsible for keeping it up to date and can't rely on `npm` to give you a newer version when available.** Use `npm config delete node_gyp` to unset this configuration option. + +## Fixing Catalina for older versions of `node-gyp` ### Is my Mac running macOS Catalina? Let's first make sure that your Mac is running Catalina: @@ -17,14 +36,13 @@ If `ProductVersion` is less then `10.15` then this document is not for you. Norm ### The acid test To see if `Xcode Command Line Tools` is installed in a way that will work with `node-gyp`, run: -1. `/usr/sbin/pkgutil --packages | grep CL` - * `com.apple.pkg.CLTools_Executables` should be listed. If it isn't, this test failed. -2. `/usr/sbin/pkgutil --pkg-info com.apple.pkg.CLTools_Executables` - * `version: 11.0.0` (or later) should be listed. If it isn't, this test failed. +``` +curl -sL https://github.com/nodejs/node-gyp/raw/master/macOS_Catalina_acid_test.sh | bash +``` -If both tests succeeded, _you are done_! You should be ready to install `node-gyp`. +If test succeeded, _you are done_! You should be ready to install `node-gyp`. -If either test failed, there is a problem with your Xcode Command Line Tools installation. [Continue to Solutions](#Solutions). +If test failed, there is a problem with your Xcode Command Line Tools installation. [Continue to Solutions](#Solutions). ### Solutions There are three ways to install the Xcode libraries `node-gyp` needs on macOS. People running Catalina have had success with some but not others in a way that has been unpredictable. @@ -52,25 +70,27 @@ There are three ways to install the Xcode libraries `node-gyp` needs on macOS. P ### Installing `node-gyp` using the Xcode Command Line Tools via `xcode-select --install` 1. If the _acid test_ has not succeeded, then try `xcode-select --install` -2. Wait until the install process is _complete_. -3. `softwareupdate -l` # No listing is a good sign. +2. If the installation command returns `xcode-select: error: command line tools are already installed, use "Software Update" to install updates`, continue to [remove and reinstall](#i-did-all-that-and-the-acid-test-still-does-not-pass--) +3. Wait until the install process is _complete_. +4. `softwareupdate -l` # No listing is a good sign. * If Xcode or Tools upgrades are listed, use "Software Update" to install them. -4. `xcode-select -version` # Should return `xcode-select version 2370` or later. -5. `xcode-select -print-path` # Should return `/Library/Developer/CommandLineTools` -6. Try the [_acid test_ steps above](#The-acid-test) to see if your Mac is ready. -7. If the _acid test_ does _not_ pass then... -8. `sudo xcode-select --reset` # Enter root password. No output is normal. -9. Repeat step 5 above. Is the path different this time? Repeat the _acid test_. +5. `xcode-select -version` # Should return `xcode-select version 2370` or later. +6. `xcode-select -print-path` # Should return `/Library/Developer/CommandLineTools` +7. Try the [_acid test_ steps above](#The-acid-test) to see if your Mac is ready. +8. If the _acid test_ does _not_ pass then... +9. `sudo xcode-select --reset` # Enter root password. No output is normal. +10. Repeat step 5 above. Is the path different this time? Repeat the _acid test_. ### Installing `node-gyp` using the Xcode Command Line Tools via manual download -1. Download the appropriate version of the "Command Line Tools for Xcode" for your version of Catalina from developer.apple.com/download. As of MacOS 10.15.2, that's Command_Line_Tools_for_Xcode_11.3.dmg +1. Download the appropriate version of the "Command Line Tools for Xcode" for your version of Catalina from . As of MacOS 10.15.5, that's [Command_Line_Tools_for_Xcode_11.5.dmg](https://download.developer.apple.com/Developer_Tools/Command_Line_Tools_for_Xcode_11.5/Command_Line_Tools_for_Xcode_11.5.dmg) 2. Install the package. -3. Run the _acid test_. +3. Run the [_acid test_ steps above](#The-acid-test). ### I did all that and the acid test still does not pass :-( 1. `sudo rm -rf $(xcode-select -print-path)` # Enter root password. No output is normal. +2. `sudo rm -rf /Library/Developer/CommandLineTools` # Enter root password. 2. `xcode-select --install` -3. If the [_acid test_](#The-acid-test) still does _not_ pass then... +3. If the [_acid test_ steps above](#The-acid-test) still does _not_ pass then... 4. `npm explore npm -g -- npm install node-gyp@latest` 5. `npm explore npm -g -- npm explore npm-lifecycle -- npm install node-gyp@latest` 6. If the _acid test_ still does _not_ pass then... diff --git a/deps/npm/node_modules/node-gyp/macOS_Catalina_acid_test.sh b/deps/npm/node_modules/node-gyp/macOS_Catalina_acid_test.sh new file mode 100644 index 00000000000000..e1e98941a8e4c8 --- /dev/null +++ b/deps/npm/node_modules/node-gyp/macOS_Catalina_acid_test.sh @@ -0,0 +1,21 @@ +#!/bin/bash + +pkgs=( + "com.apple.pkg.DeveloperToolsCLILeo" # standalone + "com.apple.pkg.DeveloperToolsCLI" # from XCode + "com.apple.pkg.CLTools_Executables" # Mavericks +) + +for pkg in "${pkgs[@]}"; do + output=$(/usr/sbin/pkgutil --pkg-info "$pkg" 2>/dev/null) + if [ "$output" ]; then + version=$(echo "$output" | grep 'version' | cut -d' ' -f2) + break + fi +done + +if [ "$version" ]; then + echo "Command Line Tools version: $version" +else + echo >&2 'Command Line Tools not found' +fi diff --git a/deps/npm/node_modules/node-gyp/node_modules/nopt/CHANGELOG.md b/deps/npm/node_modules/node-gyp/node_modules/nopt/CHANGELOG.md new file mode 100644 index 00000000000000..82a09fb4bf809a --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/nopt/CHANGELOG.md @@ -0,0 +1,58 @@ +### v4.0.1 (2016-12-14) + +#### WHOOPS + +* [`fb9b1ce`](https://github.com/npm/nopt/commit/fb9b1ce57b3c69b4f7819015be87719204f77ef6) + Merged so many patches at once that the code fencing + ([@adius](https://github.com/adius)) added got broken. Sorry, + ([@adius](https://github.com/adius))! + ([@othiym23](https://github.com/othiym23)) + +### v4.0.0 (2016-12-13) + +#### BREAKING CHANGES + +* [`651d447`](https://github.com/npm/nopt/commit/651d4473946096d341a480bbe56793de3fc706aa) + When parsing String-typed arguments, if the next value is `""`, don't simply + swallow it. ([@samjonester](https://github.com/samjonester)) + +#### PERFORMANCE TWEAKS + +* [`3370ce8`](https://github.com/npm/nopt/commit/3370ce87a7618ba228883861db84ddbcdff252a9) + Simplify initialization. ([@elidoran](https://github.com/elidoran)) +* [`356e58e`](https://github.com/npm/nopt/commit/356e58e3b3b431a4b1af7fd7bdee44c2c0526a09) + Store `Array.isArray(types[arg])` for reuse. + ([@elidoran](https://github.com/elidoran)) +* [`0d95e90`](https://github.com/npm/nopt/commit/0d95e90515844f266015b56d2c80b94e5d14a07e) + Interpret single-item type arrays as a single type. + ([@samjonester](https://github.com/samjonester)) +* [`07c69d3`](https://github.com/npm/nopt/commit/07c69d38b5186450941fbb505550becb78a0e925) + Simplify key-value extraction. ([@elidoran](https://github.com/elidoran)) +* [`39b6e5c`](https://github.com/npm/nopt/commit/39b6e5c65ac47f60cd43a1fbeece5cd4c834c254) + Only call `Date.parse(val)` once. ([@elidoran](https://github.com/elidoran)) +* [`934943d`](https://github.com/npm/nopt/commit/934943dffecb55123a2b15959fe2a359319a5dbd) + Use `osenv.home()` to find a user's home directory instead of assuming it's + always `$HOME`. ([@othiym23](https://github.com/othiym23)) + +#### TEST & CI IMPROVEMENTS + +* [`326ffff`](https://github.com/npm/nopt/commit/326ffff7f78a00bcd316adecf69075f8a8093619) + Fix `/tmp` test to work on Windows. + ([@elidoran](https://github.com/elidoran)) +* [`c89d31a`](https://github.com/npm/nopt/commit/c89d31a49d14f2238bc6672db08da697bbc57f1b) + Only run Windows tests on Windows, only run Unix tests on a Unix. + ([@elidoran](https://github.com/elidoran)) +* [`affd3d1`](https://github.com/npm/nopt/commit/affd3d1d0addffa93006397b2013b18447339366) + Refresh Travis to run the tests against the currently-supported batch of npm + versions. ([@helio](https://github.com/helio)-frota) +* [`55f9449`](https://github.com/npm/nopt/commit/55f94497d163ed4d16dd55fd6c4fb95cc440e66d) + `tap@8.0.1` ([@othiym23](https://github.com/othiym23)) + +#### DOC TWEAKS + +* [`5271229`](https://github.com/npm/nopt/commit/5271229ee7c810217dd51616c086f5d9ab224581) + Use JavaScript code block for syntax highlighting. + ([@adius](https://github.com/adius)) +* [`c0d156f`](https://github.com/npm/nopt/commit/c0d156f229f9994c5dfcec4a8886eceff7a07682) + The code sample in the README had `many2: [ oneThing ]`, and now it has + `many2: [ two, things ]`. ([@silkentrance](https://github.com/silkentrance)) diff --git a/deps/npm/node_modules/read-package-tree/LICENSE b/deps/npm/node_modules/node-gyp/node_modules/nopt/LICENSE similarity index 100% rename from deps/npm/node_modules/read-package-tree/LICENSE rename to deps/npm/node_modules/node-gyp/node_modules/nopt/LICENSE diff --git a/deps/npm/node_modules/node-gyp/node_modules/nopt/README.md b/deps/npm/node_modules/node-gyp/node_modules/nopt/README.md new file mode 100644 index 00000000000000..a99531c04655fe --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/nopt/README.md @@ -0,0 +1,213 @@ +If you want to write an option parser, and have it be good, there are +two ways to do it. The Right Way, and the Wrong Way. + +The Wrong Way is to sit down and write an option parser. We've all done +that. + +The Right Way is to write some complex configurable program with so many +options that you hit the limit of your frustration just trying to +manage them all, and defer it with duct-tape solutions until you see +exactly to the core of the problem, and finally snap and write an +awesome option parser. + +If you want to write an option parser, don't write an option parser. +Write a package manager, or a source control system, or a service +restarter, or an operating system. You probably won't end up with a +good one of those, but if you don't give up, and you are relentless and +diligent enough in your procrastination, you may just end up with a very +nice option parser. + +## USAGE + +```javascript +// my-program.js +var nopt = require("nopt") + , Stream = require("stream").Stream + , path = require("path") + , knownOpts = { "foo" : [String, null] + , "bar" : [Stream, Number] + , "baz" : path + , "bloo" : [ "big", "medium", "small" ] + , "flag" : Boolean + , "pick" : Boolean + , "many1" : [String, Array] + , "many2" : [path, Array] + } + , shortHands = { "foofoo" : ["--foo", "Mr. Foo"] + , "b7" : ["--bar", "7"] + , "m" : ["--bloo", "medium"] + , "p" : ["--pick"] + , "f" : ["--flag"] + } + // everything is optional. + // knownOpts and shorthands default to {} + // arg list defaults to process.argv + // slice defaults to 2 + , parsed = nopt(knownOpts, shortHands, process.argv, 2) +console.log(parsed) +``` + +This would give you support for any of the following: + +```console +$ node my-program.js --foo "blerp" --no-flag +{ "foo" : "blerp", "flag" : false } + +$ node my-program.js ---bar 7 --foo "Mr. Hand" --flag +{ bar: 7, foo: "Mr. Hand", flag: true } + +$ node my-program.js --foo "blerp" -f -----p +{ foo: "blerp", flag: true, pick: true } + +$ node my-program.js -fp --foofoo +{ foo: "Mr. Foo", flag: true, pick: true } + +$ node my-program.js --foofoo -- -fp # -- stops the flag parsing. +{ foo: "Mr. Foo", argv: { remain: ["-fp"] } } + +$ node my-program.js --blatzk -fp # unknown opts are ok. +{ blatzk: true, flag: true, pick: true } + +$ node my-program.js --blatzk=1000 -fp # but you need to use = if they have a value +{ blatzk: 1000, flag: true, pick: true } + +$ node my-program.js --no-blatzk -fp # unless they start with "no-" +{ blatzk: false, flag: true, pick: true } + +$ node my-program.js --baz b/a/z # known paths are resolved. +{ baz: "/Users/isaacs/b/a/z" } + +# if Array is one of the types, then it can take many +# values, and will always be an array. The other types provided +# specify what types are allowed in the list. + +$ node my-program.js --many1 5 --many1 null --many1 foo +{ many1: ["5", "null", "foo"] } + +$ node my-program.js --many2 foo --many2 bar +{ many2: ["/path/to/foo", "path/to/bar"] } +``` + +Read the tests at the bottom of `lib/nopt.js` for more examples of +what this puppy can do. + +## Types + +The following types are supported, and defined on `nopt.typeDefs` + +* String: A normal string. No parsing is done. +* path: A file system path. Gets resolved against cwd if not absolute. +* url: A url. If it doesn't parse, it isn't accepted. +* Number: Must be numeric. +* Date: Must parse as a date. If it does, and `Date` is one of the options, + then it will return a Date object, not a string. +* Boolean: Must be either `true` or `false`. If an option is a boolean, + then it does not need a value, and its presence will imply `true` as + the value. To negate boolean flags, do `--no-whatever` or `--whatever + false` +* NaN: Means that the option is strictly not allowed. Any value will + fail. +* Stream: An object matching the "Stream" class in node. Valuable + for use when validating programmatically. (npm uses this to let you + supply any WriteStream on the `outfd` and `logfd` config options.) +* Array: If `Array` is specified as one of the types, then the value + will be parsed as a list of options. This means that multiple values + can be specified, and that the value will always be an array. + +If a type is an array of values not on this list, then those are +considered valid values. For instance, in the example above, the +`--bloo` option can only be one of `"big"`, `"medium"`, or `"small"`, +and any other value will be rejected. + +When parsing unknown fields, `"true"`, `"false"`, and `"null"` will be +interpreted as their JavaScript equivalents. + +You can also mix types and values, or multiple types, in a list. For +instance `{ blah: [Number, null] }` would allow a value to be set to +either a Number or null. When types are ordered, this implies a +preference, and the first type that can be used to properly interpret +the value will be used. + +To define a new type, add it to `nopt.typeDefs`. Each item in that +hash is an object with a `type` member and a `validate` method. The +`type` member is an object that matches what goes in the type list. The +`validate` method is a function that gets called with `validate(data, +key, val)`. Validate methods should assign `data[key]` to the valid +value of `val` if it can be handled properly, or return boolean +`false` if it cannot. + +You can also call `nopt.clean(data, types, typeDefs)` to clean up a +config object and remove its invalid properties. + +## Error Handling + +By default, nopt outputs a warning to standard error when invalid values for +known options are found. You can change this behavior by assigning a method +to `nopt.invalidHandler`. This method will be called with +the offending `nopt.invalidHandler(key, val, types)`. + +If no `nopt.invalidHandler` is assigned, then it will console.error +its whining. If it is assigned to boolean `false` then the warning is +suppressed. + +## Abbreviations + +Yes, they are supported. If you define options like this: + +```javascript +{ "foolhardyelephants" : Boolean +, "pileofmonkeys" : Boolean } +``` + +Then this will work: + +```bash +node program.js --foolhar --pil +node program.js --no-f --pileofmon +# etc. +``` + +## Shorthands + +Shorthands are a hash of shorter option names to a snippet of args that +they expand to. + +If multiple one-character shorthands are all combined, and the +combination does not unambiguously match any other option or shorthand, +then they will be broken up into their constituent parts. For example: + +```json +{ "s" : ["--loglevel", "silent"] +, "g" : "--global" +, "f" : "--force" +, "p" : "--parseable" +, "l" : "--long" +} +``` + +```bash +npm ls -sgflp +# just like doing this: +npm ls --loglevel silent --global --force --long --parseable +``` + +## The Rest of the args + +The config object returned by nopt is given a special member called +`argv`, which is an object with the following fields: + +* `remain`: The remaining args after all the parsing has occurred. +* `original`: The args as they originally appeared. +* `cooked`: The args after flags and shorthands are expanded. + +## Slicing + +Node programs are called with more or less the exact argv as it appears +in C land, after the v8 and node-specific options have been plucked off. +As such, `argv[0]` is always `node` and `argv[1]` is always the +JavaScript program being run. + +That's usually not very useful to you. So they're sliced off by +default. If you want them, then you can pass in `0` as the last +argument, or any other number that you'd like to slice off the start of +the list. diff --git a/deps/npm/node_modules/node-gyp/node_modules/nopt/bin/nopt.js b/deps/npm/node_modules/node-gyp/node_modules/nopt/bin/nopt.js new file mode 100755 index 00000000000000..3232d4c570fdcb --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/nopt/bin/nopt.js @@ -0,0 +1,54 @@ +#!/usr/bin/env node +var nopt = require("../lib/nopt") + , path = require("path") + , types = { num: Number + , bool: Boolean + , help: Boolean + , list: Array + , "num-list": [Number, Array] + , "str-list": [String, Array] + , "bool-list": [Boolean, Array] + , str: String + , clear: Boolean + , config: Boolean + , length: Number + , file: path + } + , shorthands = { s: [ "--str", "astring" ] + , b: [ "--bool" ] + , nb: [ "--no-bool" ] + , tft: [ "--bool-list", "--no-bool-list", "--bool-list", "true" ] + , "?": ["--help"] + , h: ["--help"] + , H: ["--help"] + , n: [ "--num", "125" ] + , c: ["--config"] + , l: ["--length"] + , f: ["--file"] + } + , parsed = nopt( types + , shorthands + , process.argv + , 2 ) + +console.log("parsed", parsed) + +if (parsed.help) { + console.log("") + console.log("nopt cli tester") + console.log("") + console.log("types") + console.log(Object.keys(types).map(function M (t) { + var type = types[t] + if (Array.isArray(type)) { + return [t, type.map(function (type) { return type.name })] + } + return [t, type && type.name] + }).reduce(function (s, i) { + s[i[0]] = i[1] + return s + }, {})) + console.log("") + console.log("shorthands") + console.log(shorthands) +} diff --git a/deps/npm/node_modules/node-gyp/node_modules/nopt/lib/nopt.js b/deps/npm/node_modules/node-gyp/node_modules/nopt/lib/nopt.js new file mode 100644 index 00000000000000..0ec5753d0cb898 --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/nopt/lib/nopt.js @@ -0,0 +1,441 @@ +// info about each config option. + +var debug = process.env.DEBUG_NOPT || process.env.NOPT_DEBUG + ? function () { console.error.apply(console, arguments) } + : function () {} + +var url = require("url") + , path = require("path") + , Stream = require("stream").Stream + , abbrev = require("abbrev") + , osenv = require("osenv") + +module.exports = exports = nopt +exports.clean = clean + +exports.typeDefs = + { String : { type: String, validate: validateString } + , Boolean : { type: Boolean, validate: validateBoolean } + , url : { type: url, validate: validateUrl } + , Number : { type: Number, validate: validateNumber } + , path : { type: path, validate: validatePath } + , Stream : { type: Stream, validate: validateStream } + , Date : { type: Date, validate: validateDate } + } + +function nopt (types, shorthands, args, slice) { + args = args || process.argv + types = types || {} + shorthands = shorthands || {} + if (typeof slice !== "number") slice = 2 + + debug(types, shorthands, args, slice) + + args = args.slice(slice) + var data = {} + , key + , argv = { + remain: [], + cooked: args, + original: args.slice(0) + } + + parse(args, data, argv.remain, types, shorthands) + // now data is full + clean(data, types, exports.typeDefs) + data.argv = argv + Object.defineProperty(data.argv, 'toString', { value: function () { + return this.original.map(JSON.stringify).join(" ") + }, enumerable: false }) + return data +} + +function clean (data, types, typeDefs) { + typeDefs = typeDefs || exports.typeDefs + var remove = {} + , typeDefault = [false, true, null, String, Array] + + Object.keys(data).forEach(function (k) { + if (k === "argv") return + var val = data[k] + , isArray = Array.isArray(val) + , type = types[k] + if (!isArray) val = [val] + if (!type) type = typeDefault + if (type === Array) type = typeDefault.concat(Array) + if (!Array.isArray(type)) type = [type] + + debug("val=%j", val) + debug("types=", type) + val = val.map(function (val) { + // if it's an unknown value, then parse false/true/null/numbers/dates + if (typeof val === "string") { + debug("string %j", val) + val = val.trim() + if ((val === "null" && ~type.indexOf(null)) + || (val === "true" && + (~type.indexOf(true) || ~type.indexOf(Boolean))) + || (val === "false" && + (~type.indexOf(false) || ~type.indexOf(Boolean)))) { + val = JSON.parse(val) + debug("jsonable %j", val) + } else if (~type.indexOf(Number) && !isNaN(val)) { + debug("convert to number", val) + val = +val + } else if (~type.indexOf(Date) && !isNaN(Date.parse(val))) { + debug("convert to date", val) + val = new Date(val) + } + } + + if (!types.hasOwnProperty(k)) { + return val + } + + // allow `--no-blah` to set 'blah' to null if null is allowed + if (val === false && ~type.indexOf(null) && + !(~type.indexOf(false) || ~type.indexOf(Boolean))) { + val = null + } + + var d = {} + d[k] = val + debug("prevalidated val", d, val, types[k]) + if (!validate(d, k, val, types[k], typeDefs)) { + if (exports.invalidHandler) { + exports.invalidHandler(k, val, types[k], data) + } else if (exports.invalidHandler !== false) { + debug("invalid: "+k+"="+val, types[k]) + } + return remove + } + debug("validated val", d, val, types[k]) + return d[k] + }).filter(function (val) { return val !== remove }) + + // if we allow Array specifically, then an empty array is how we + // express 'no value here', not null. Allow it. + if (!val.length && type.indexOf(Array) === -1) { + debug('VAL HAS NO LENGTH, DELETE IT', val, k, type.indexOf(Array)) + delete data[k] + } + else if (isArray) { + debug(isArray, data[k], val) + data[k] = val + } else data[k] = val[0] + + debug("k=%s val=%j", k, val, data[k]) + }) +} + +function validateString (data, k, val) { + data[k] = String(val) +} + +function validatePath (data, k, val) { + if (val === true) return false + if (val === null) return true + + val = String(val) + + var isWin = process.platform === 'win32' + , homePattern = isWin ? /^~(\/|\\)/ : /^~\// + , home = osenv.home() + + if (home && val.match(homePattern)) { + data[k] = path.resolve(home, val.substr(2)) + } else { + data[k] = path.resolve(val) + } + return true +} + +function validateNumber (data, k, val) { + debug("validate Number %j %j %j", k, val, isNaN(val)) + if (isNaN(val)) return false + data[k] = +val +} + +function validateDate (data, k, val) { + var s = Date.parse(val) + debug("validate Date %j %j %j", k, val, s) + if (isNaN(s)) return false + data[k] = new Date(val) +} + +function validateBoolean (data, k, val) { + if (val instanceof Boolean) val = val.valueOf() + else if (typeof val === "string") { + if (!isNaN(val)) val = !!(+val) + else if (val === "null" || val === "false") val = false + else val = true + } else val = !!val + data[k] = val +} + +function validateUrl (data, k, val) { + val = url.parse(String(val)) + if (!val.host) return false + data[k] = val.href +} + +function validateStream (data, k, val) { + if (!(val instanceof Stream)) return false + data[k] = val +} + +function validate (data, k, val, type, typeDefs) { + // arrays are lists of types. + if (Array.isArray(type)) { + for (var i = 0, l = type.length; i < l; i ++) { + if (type[i] === Array) continue + if (validate(data, k, val, type[i], typeDefs)) return true + } + delete data[k] + return false + } + + // an array of anything? + if (type === Array) return true + + // NaN is poisonous. Means that something is not allowed. + if (type !== type) { + debug("Poison NaN", k, val, type) + delete data[k] + return false + } + + // explicit list of values + if (val === type) { + debug("Explicitly allowed %j", val) + // if (isArray) (data[k] = data[k] || []).push(val) + // else data[k] = val + data[k] = val + return true + } + + // now go through the list of typeDefs, validate against each one. + var ok = false + , types = Object.keys(typeDefs) + for (var i = 0, l = types.length; i < l; i ++) { + debug("test type %j %j %j", k, val, types[i]) + var t = typeDefs[types[i]] + if (t && + ((type && type.name && t.type && t.type.name) ? (type.name === t.type.name) : (type === t.type))) { + var d = {} + ok = false !== t.validate(d, k, val) + val = d[k] + if (ok) { + // if (isArray) (data[k] = data[k] || []).push(val) + // else data[k] = val + data[k] = val + break + } + } + } + debug("OK? %j (%j %j %j)", ok, k, val, types[i]) + + if (!ok) delete data[k] + return ok +} + +function parse (args, data, remain, types, shorthands) { + debug("parse", args, data, remain) + + var key = null + , abbrevs = abbrev(Object.keys(types)) + , shortAbbr = abbrev(Object.keys(shorthands)) + + for (var i = 0; i < args.length; i ++) { + var arg = args[i] + debug("arg", arg) + + if (arg.match(/^-{2,}$/)) { + // done with keys. + // the rest are args. + remain.push.apply(remain, args.slice(i + 1)) + args[i] = "--" + break + } + var hadEq = false + if (arg.charAt(0) === "-" && arg.length > 1) { + var at = arg.indexOf('=') + if (at > -1) { + hadEq = true + var v = arg.substr(at + 1) + arg = arg.substr(0, at) + args.splice(i, 1, arg, v) + } + + // see if it's a shorthand + // if so, splice and back up to re-parse it. + var shRes = resolveShort(arg, shorthands, shortAbbr, abbrevs) + debug("arg=%j shRes=%j", arg, shRes) + if (shRes) { + debug(arg, shRes) + args.splice.apply(args, [i, 1].concat(shRes)) + if (arg !== shRes[0]) { + i -- + continue + } + } + arg = arg.replace(/^-+/, "") + var no = null + while (arg.toLowerCase().indexOf("no-") === 0) { + no = !no + arg = arg.substr(3) + } + + if (abbrevs[arg]) arg = abbrevs[arg] + + var argType = types[arg] + var isTypeArray = Array.isArray(argType) + if (isTypeArray && argType.length === 1) { + isTypeArray = false + argType = argType[0] + } + + var isArray = argType === Array || + isTypeArray && argType.indexOf(Array) !== -1 + + // allow unknown things to be arrays if specified multiple times. + if (!types.hasOwnProperty(arg) && data.hasOwnProperty(arg)) { + if (!Array.isArray(data[arg])) + data[arg] = [data[arg]] + isArray = true + } + + var val + , la = args[i + 1] + + var isBool = typeof no === 'boolean' || + argType === Boolean || + isTypeArray && argType.indexOf(Boolean) !== -1 || + (typeof argType === 'undefined' && !hadEq) || + (la === "false" && + (argType === null || + isTypeArray && ~argType.indexOf(null))) + + if (isBool) { + // just set and move along + val = !no + // however, also support --bool true or --bool false + if (la === "true" || la === "false") { + val = JSON.parse(la) + la = null + if (no) val = !val + i ++ + } + + // also support "foo":[Boolean, "bar"] and "--foo bar" + if (isTypeArray && la) { + if (~argType.indexOf(la)) { + // an explicit type + val = la + i ++ + } else if ( la === "null" && ~argType.indexOf(null) ) { + // null allowed + val = null + i ++ + } else if ( !la.match(/^-{2,}[^-]/) && + !isNaN(la) && + ~argType.indexOf(Number) ) { + // number + val = +la + i ++ + } else if ( !la.match(/^-[^-]/) && ~argType.indexOf(String) ) { + // string + val = la + i ++ + } + } + + if (isArray) (data[arg] = data[arg] || []).push(val) + else data[arg] = val + + continue + } + + if (argType === String) { + if (la === undefined) { + la = "" + } else if (la.match(/^-{1,2}[^-]+/)) { + la = "" + i -- + } + } + + if (la && la.match(/^-{2,}$/)) { + la = undefined + i -- + } + + val = la === undefined ? true : la + if (isArray) (data[arg] = data[arg] || []).push(val) + else data[arg] = val + + i ++ + continue + } + remain.push(arg) + } +} + +function resolveShort (arg, shorthands, shortAbbr, abbrevs) { + // handle single-char shorthands glommed together, like + // npm ls -glp, but only if there is one dash, and only if + // all of the chars are single-char shorthands, and it's + // not a match to some other abbrev. + arg = arg.replace(/^-+/, '') + + // if it's an exact known option, then don't go any further + if (abbrevs[arg] === arg) + return null + + // if it's an exact known shortopt, same deal + if (shorthands[arg]) { + // make it an array, if it's a list of words + if (shorthands[arg] && !Array.isArray(shorthands[arg])) + shorthands[arg] = shorthands[arg].split(/\s+/) + + return shorthands[arg] + } + + // first check to see if this arg is a set of single-char shorthands + var singles = shorthands.___singles + if (!singles) { + singles = Object.keys(shorthands).filter(function (s) { + return s.length === 1 + }).reduce(function (l,r) { + l[r] = true + return l + }, {}) + shorthands.___singles = singles + debug('shorthand singles', singles) + } + + var chrs = arg.split("").filter(function (c) { + return singles[c] + }) + + if (chrs.join("") === arg) return chrs.map(function (c) { + return shorthands[c] + }).reduce(function (l, r) { + return l.concat(r) + }, []) + + + // if it's an arg abbrev, and not a literal shorthand, then prefer the arg + if (abbrevs[arg] && !shorthands[arg]) + return null + + // if it's an abbr for a shorthand, then use that + if (shortAbbr[arg]) + arg = shortAbbr[arg] + + // make it an array, if it's a list of words + if (shorthands[arg] && !Array.isArray(shorthands[arg])) + shorthands[arg] = shorthands[arg].split(/\s+/) + + return shorthands[arg] +} diff --git a/deps/npm/node_modules/node-gyp/node_modules/nopt/package.json b/deps/npm/node_modules/node-gyp/node_modules/nopt/package.json new file mode 100644 index 00000000000000..ac6e169ae2416e --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/nopt/package.json @@ -0,0 +1,30 @@ +{ + "name": "nopt", + "version": "4.0.3", + "description": "Option parsing for Node, supporting types, shorthands, etc. Used by npm.", + "author": "Isaac Z. Schlueter (http://blog.izs.me/)", + "main": "lib/nopt.js", + "scripts": { + "preversion": "npm test", + "postversion": "npm publish", + "prepublishOnly": "git push origin --follow-tags", + "test": "tap test/*.js" + }, + "repository": { + "type": "git", + "url": "https://github.com/npm/nopt.git" + }, + "bin": "./bin/nopt.js", + "license": "ISC", + "dependencies": { + "abbrev": "1", + "osenv": "^0.1.4" + }, + "devDependencies": { + "tap": "^14.10.6" + }, + "files": [ + "bin", + "lib" + ] +} diff --git a/deps/npm/node_modules/node-gyp/node_modules/rimraf/LICENSE b/deps/npm/node_modules/node-gyp/node_modules/rimraf/LICENSE new file mode 100644 index 00000000000000..19129e315fe593 --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/rimraf/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter and Contributors + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/deps/npm/node_modules/node-gyp/node_modules/rimraf/README.md b/deps/npm/node_modules/node-gyp/node_modules/rimraf/README.md new file mode 100644 index 00000000000000..423b8cf854ad3e --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/rimraf/README.md @@ -0,0 +1,101 @@ +[![Build Status](https://travis-ci.org/isaacs/rimraf.svg?branch=master)](https://travis-ci.org/isaacs/rimraf) [![Dependency Status](https://david-dm.org/isaacs/rimraf.svg)](https://david-dm.org/isaacs/rimraf) [![devDependency Status](https://david-dm.org/isaacs/rimraf/dev-status.svg)](https://david-dm.org/isaacs/rimraf#info=devDependencies) + +The [UNIX command](http://en.wikipedia.org/wiki/Rm_(Unix)) `rm -rf` for node. + +Install with `npm install rimraf`, or just drop rimraf.js somewhere. + +## API + +`rimraf(f, [opts], callback)` + +The first parameter will be interpreted as a globbing pattern for files. If you +want to disable globbing you can do so with `opts.disableGlob` (defaults to +`false`). This might be handy, for instance, if you have filenames that contain +globbing wildcard characters. + +The callback will be called with an error if there is one. Certain +errors are handled for you: + +* Windows: `EBUSY` and `ENOTEMPTY` - rimraf will back off a maximum of + `opts.maxBusyTries` times before giving up, adding 100ms of wait + between each attempt. The default `maxBusyTries` is 3. +* `ENOENT` - If the file doesn't exist, rimraf will return + successfully, since your desired outcome is already the case. +* `EMFILE` - Since `readdir` requires opening a file descriptor, it's + possible to hit `EMFILE` if too many file descriptors are in use. + In the sync case, there's nothing to be done for this. But in the + async case, rimraf will gradually back off with timeouts up to + `opts.emfileWait` ms, which defaults to 1000. + +## options + +* unlink, chmod, stat, lstat, rmdir, readdir, + unlinkSync, chmodSync, statSync, lstatSync, rmdirSync, readdirSync + + In order to use a custom file system library, you can override + specific fs functions on the options object. + + If any of these functions are present on the options object, then + the supplied function will be used instead of the default fs + method. + + Sync methods are only relevant for `rimraf.sync()`, of course. + + For example: + + ```javascript + var myCustomFS = require('some-custom-fs') + + rimraf('some-thing', myCustomFS, callback) + ``` + +* maxBusyTries + + If an `EBUSY`, `ENOTEMPTY`, or `EPERM` error code is encountered + on Windows systems, then rimraf will retry with a linear backoff + wait of 100ms longer on each try. The default maxBusyTries is 3. + + Only relevant for async usage. + +* emfileWait + + If an `EMFILE` error is encountered, then rimraf will retry + repeatedly with a linear backoff of 1ms longer on each try, until + the timeout counter hits this max. The default limit is 1000. + + If you repeatedly encounter `EMFILE` errors, then consider using + [graceful-fs](http://npm.im/graceful-fs) in your program. + + Only relevant for async usage. + +* glob + + Set to `false` to disable [glob](http://npm.im/glob) pattern + matching. + + Set to an object to pass options to the glob module. The default + glob options are `{ nosort: true, silent: true }`. + + Glob version 6 is used in this module. + + Relevant for both sync and async usage. + +* disableGlob + + Set to any non-falsey value to disable globbing entirely. + (Equivalent to setting `glob: false`.) + +## rimraf.sync + +It can remove stuff synchronously, too. But that's not so good. Use +the async API. It's better. + +## CLI + +If installed with `npm install rimraf -g` it can be used as a global +command `rimraf [ ...]` which is useful for cross platform support. + +## mkdirp + +If you need to create a directory recursively, check out +[mkdirp](https://github.com/substack/node-mkdirp). diff --git a/deps/npm/node_modules/node-gyp/node_modules/rimraf/bin.js b/deps/npm/node_modules/node-gyp/node_modules/rimraf/bin.js new file mode 100755 index 00000000000000..0d1e17be701ec3 --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/rimraf/bin.js @@ -0,0 +1,50 @@ +#!/usr/bin/env node + +var rimraf = require('./') + +var help = false +var dashdash = false +var noglob = false +var args = process.argv.slice(2).filter(function(arg) { + if (dashdash) + return !!arg + else if (arg === '--') + dashdash = true + else if (arg === '--no-glob' || arg === '-G') + noglob = true + else if (arg === '--glob' || arg === '-g') + noglob = false + else if (arg.match(/^(-+|\/)(h(elp)?|\?)$/)) + help = true + else + return !!arg +}) + +if (help || args.length === 0) { + // If they didn't ask for help, then this is not a "success" + var log = help ? console.log : console.error + log('Usage: rimraf [ ...]') + log('') + log(' Deletes all files and folders at "path" recursively.') + log('') + log('Options:') + log('') + log(' -h, --help Display this usage info') + log(' -G, --no-glob Do not expand glob patterns in arguments') + log(' -g, --glob Expand glob patterns in arguments (default)') + process.exit(help ? 0 : 1) +} else + go(0) + +function go (n) { + if (n >= args.length) + return + var options = {} + if (noglob) + options = { glob: false } + rimraf(args[n], options, function (er) { + if (er) + throw er + go(n+1) + }) +} diff --git a/deps/npm/node_modules/node-gyp/node_modules/rimraf/package.json b/deps/npm/node_modules/node-gyp/node_modules/rimraf/package.json new file mode 100644 index 00000000000000..26e05d85ea2fdf --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/rimraf/package.json @@ -0,0 +1,29 @@ +{ + "name": "rimraf", + "version": "2.7.1", + "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 --all; git push origin --tags", + "test": "tap test/*.js" + }, + "bin": "./bin.js", + "dependencies": { + "glob": "^7.1.3" + }, + "files": [ + "LICENSE", + "README.md", + "bin.js", + "rimraf.js" + ], + "devDependencies": { + "mkdirp": "^0.5.1", + "tap": "^12.1.1" + } +} diff --git a/deps/npm/node_modules/node-gyp/node_modules/rimraf/rimraf.js b/deps/npm/node_modules/node-gyp/node_modules/rimraf/rimraf.js new file mode 100644 index 00000000000000..a90ad029f3ece1 --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/rimraf/rimraf.js @@ -0,0 +1,372 @@ +module.exports = rimraf +rimraf.sync = rimrafSync + +var assert = require("assert") +var path = require("path") +var fs = require("fs") +var glob = undefined +try { + glob = require("glob") +} catch (_err) { + // treat glob as optional. +} +var _0666 = parseInt('666', 8) + +var defaultGlobOpts = { + nosort: true, + silent: true +} + +// for EMFILE handling +var timeout = 0 + +var isWindows = (process.platform === "win32") + +function defaults (options) { + var methods = [ + 'unlink', + 'chmod', + 'stat', + 'lstat', + 'rmdir', + 'readdir' + ] + methods.forEach(function(m) { + options[m] = options[m] || fs[m] + m = m + 'Sync' + options[m] = options[m] || fs[m] + }) + + options.maxBusyTries = options.maxBusyTries || 3 + options.emfileWait = options.emfileWait || 1000 + if (options.glob === false) { + options.disableGlob = true + } + if (options.disableGlob !== true && glob === undefined) { + throw Error('glob dependency not found, set `options.disableGlob = true` if intentional') + } + options.disableGlob = options.disableGlob || false + options.glob = options.glob || defaultGlobOpts +} + +function rimraf (p, options, cb) { + if (typeof options === 'function') { + cb = options + options = {} + } + + assert(p, 'rimraf: missing path') + assert.equal(typeof p, 'string', 'rimraf: path should be a string') + assert.equal(typeof cb, 'function', 'rimraf: callback function required') + assert(options, 'rimraf: invalid options argument provided') + assert.equal(typeof options, 'object', 'rimraf: options should be object') + + defaults(options) + + var busyTries = 0 + var errState = null + var n = 0 + + if (options.disableGlob || !glob.hasMagic(p)) + return afterGlob(null, [p]) + + options.lstat(p, function (er, stat) { + if (!er) + return afterGlob(null, [p]) + + glob(p, options.glob, afterGlob) + }) + + function next (er) { + errState = errState || er + if (--n === 0) + cb(errState) + } + + function afterGlob (er, results) { + if (er) + return cb(er) + + n = results.length + if (n === 0) + return cb() + + results.forEach(function (p) { + rimraf_(p, options, function CB (er) { + if (er) { + if ((er.code === "EBUSY" || er.code === "ENOTEMPTY" || er.code === "EPERM") && + busyTries < options.maxBusyTries) { + busyTries ++ + var time = busyTries * 100 + // try again, with the same exact callback as this one. + return setTimeout(function () { + rimraf_(p, options, CB) + }, time) + } + + // this one won't happen if graceful-fs is used. + if (er.code === "EMFILE" && timeout < options.emfileWait) { + return setTimeout(function () { + rimraf_(p, options, CB) + }, timeout ++) + } + + // already gone + if (er.code === "ENOENT") er = null + } + + timeout = 0 + next(er) + }) + }) + } +} + +// Two possible strategies. +// 1. Assume it's a file. unlink it, then do the dir stuff on EPERM or EISDIR +// 2. Assume it's a directory. readdir, then do the file stuff on ENOTDIR +// +// Both result in an extra syscall when you guess wrong. However, there +// are likely far more normal files in the world than directories. This +// is based on the assumption that a the average number of files per +// directory is >= 1. +// +// If anyone ever complains about this, then I guess the strategy could +// be made configurable somehow. But until then, YAGNI. +function rimraf_ (p, options, cb) { + assert(p) + assert(options) + assert(typeof cb === 'function') + + // sunos lets the root user unlink directories, which is... weird. + // so we have to lstat here and make sure it's not a dir. + options.lstat(p, function (er, st) { + if (er && er.code === "ENOENT") + return cb(null) + + // Windows can EPERM on stat. Life is suffering. + if (er && er.code === "EPERM" && isWindows) + fixWinEPERM(p, options, er, cb) + + if (st && st.isDirectory()) + return rmdir(p, options, er, cb) + + options.unlink(p, function (er) { + if (er) { + if (er.code === "ENOENT") + return cb(null) + if (er.code === "EPERM") + return (isWindows) + ? fixWinEPERM(p, options, er, cb) + : rmdir(p, options, er, cb) + if (er.code === "EISDIR") + return rmdir(p, options, er, cb) + } + return cb(er) + }) + }) +} + +function fixWinEPERM (p, options, er, cb) { + assert(p) + assert(options) + assert(typeof cb === 'function') + if (er) + assert(er instanceof Error) + + options.chmod(p, _0666, function (er2) { + if (er2) + cb(er2.code === "ENOENT" ? null : er) + else + options.stat(p, function(er3, stats) { + if (er3) + cb(er3.code === "ENOENT" ? null : er) + else if (stats.isDirectory()) + rmdir(p, options, er, cb) + else + options.unlink(p, cb) + }) + }) +} + +function fixWinEPERMSync (p, options, er) { + assert(p) + assert(options) + if (er) + assert(er instanceof Error) + + try { + options.chmodSync(p, _0666) + } catch (er2) { + if (er2.code === "ENOENT") + return + else + throw er + } + + try { + var stats = options.statSync(p) + } catch (er3) { + if (er3.code === "ENOENT") + return + else + throw er + } + + if (stats.isDirectory()) + rmdirSync(p, options, er) + else + options.unlinkSync(p) +} + +function rmdir (p, options, originalEr, cb) { + assert(p) + assert(options) + if (originalEr) + assert(originalEr instanceof Error) + assert(typeof cb === 'function') + + // try to rmdir first, and only readdir on ENOTEMPTY or EEXIST (SunOS) + // if we guessed wrong, and it's not a directory, then + // raise the original error. + options.rmdir(p, function (er) { + if (er && (er.code === "ENOTEMPTY" || er.code === "EEXIST" || er.code === "EPERM")) + rmkids(p, options, cb) + else if (er && er.code === "ENOTDIR") + cb(originalEr) + else + cb(er) + }) +} + +function rmkids(p, options, cb) { + assert(p) + assert(options) + assert(typeof cb === 'function') + + options.readdir(p, function (er, files) { + if (er) + return cb(er) + var n = files.length + if (n === 0) + return options.rmdir(p, cb) + var errState + files.forEach(function (f) { + rimraf(path.join(p, f), options, function (er) { + if (errState) + return + if (er) + return cb(errState = er) + if (--n === 0) + options.rmdir(p, cb) + }) + }) + }) +} + +// this looks simpler, and is strictly *faster*, but will +// tie up the JavaScript thread and fail on excessively +// deep directory trees. +function rimrafSync (p, options) { + options = options || {} + defaults(options) + + assert(p, 'rimraf: missing path') + assert.equal(typeof p, 'string', 'rimraf: path should be a string') + assert(options, 'rimraf: missing options') + assert.equal(typeof options, 'object', 'rimraf: options should be object') + + var results + + if (options.disableGlob || !glob.hasMagic(p)) { + results = [p] + } else { + try { + options.lstatSync(p) + results = [p] + } catch (er) { + results = glob.sync(p, options.glob) + } + } + + if (!results.length) + return + + for (var i = 0; i < results.length; i++) { + var p = results[i] + + try { + var st = options.lstatSync(p) + } catch (er) { + if (er.code === "ENOENT") + return + + // Windows can EPERM on stat. Life is suffering. + if (er.code === "EPERM" && isWindows) + fixWinEPERMSync(p, options, er) + } + + try { + // sunos lets the root user unlink directories, which is... weird. + if (st && st.isDirectory()) + rmdirSync(p, options, null) + else + options.unlinkSync(p) + } catch (er) { + if (er.code === "ENOENT") + return + if (er.code === "EPERM") + return isWindows ? fixWinEPERMSync(p, options, er) : rmdirSync(p, options, er) + if (er.code !== "EISDIR") + throw er + + rmdirSync(p, options, er) + } + } +} + +function rmdirSync (p, options, originalEr) { + assert(p) + assert(options) + if (originalEr) + assert(originalEr instanceof Error) + + try { + options.rmdirSync(p) + } catch (er) { + if (er.code === "ENOENT") + return + if (er.code === "ENOTDIR") + throw originalEr + if (er.code === "ENOTEMPTY" || er.code === "EEXIST" || er.code === "EPERM") + rmkidsSync(p, options) + } +} + +function rmkidsSync (p, options) { + assert(p) + assert(options) + options.readdirSync(p).forEach(function (f) { + rimrafSync(path.join(p, f), options) + }) + + // We only end up here once we got ENOTEMPTY at least once, and + // at this point, we are guaranteed to have removed all the kids. + // So, we know that it won't be ENOENT or ENOTDIR or anything else. + // try really hard to delete stuff on windows, because it has a + // PROFOUNDLY annoying habit of not closing handles promptly when + // files are deleted, resulting in spurious ENOTEMPTY errors. + var retries = isWindows ? 100 : 1 + var i = 0 + do { + var threw = true + try { + var ret = options.rmdirSync(p, options) + threw = false + return ret + } finally { + if (++i < retries && threw) + continue + } + } while (true) +} diff --git a/deps/npm/node_modules/node-gyp/package.json b/deps/npm/node_modules/node-gyp/package.json index 4638db5a3f4a30..fd286374aa0af8 100644 --- a/deps/npm/node_modules/node-gyp/package.json +++ b/deps/npm/node_modules/node-gyp/package.json @@ -1,68 +1,7 @@ { - "_from": "node-gyp@5.1.0", - "_id": "node-gyp@5.1.0", - "_inBundle": false, - "_integrity": "sha512-OUTryc5bt/P8zVgNUmC6xdXiDJxLMAW8cF5tLQOT9E5sOQj+UeQxnnPy74K3CLCa/SOjjBlbuzDLR8ANwA+wmw==", - "_location": "/node-gyp", - "_phantomChildren": {}, - "_requested": { - "type": "version", - "registry": true, - "raw": "node-gyp@5.1.0", - "name": "node-gyp", - "escapedName": "node-gyp", - "rawSpec": "5.1.0", - "saveSpec": null, - "fetchSpec": "5.1.0" - }, - "_requiredBy": [ - "#USER", - "/", - "/npm-lifecycle" - ], - "_resolved": "https://registry.npmjs.org/node-gyp/-/node-gyp-5.1.0.tgz", - "_shasum": "8e31260a7af4a2e2f994b0673d4e0b3866156332", - "_spec": "node-gyp@5.1.0", - "_where": "/Users/darcyclarke/Documents/Repos/npm/cli", - "author": { - "name": "Nathan Rajlich", - "email": "nathan@tootallnate.net", - "url": "http://tootallnate.net" - }, - "bin": { - "node-gyp": "bin/node-gyp.js" - }, - "bugs": { - "url": "https://github.com/nodejs/node-gyp/issues" - }, - "bundleDependencies": false, - "dependencies": { - "env-paths": "^2.2.0", - "glob": "^7.1.4", - "graceful-fs": "^4.2.2", - "mkdirp": "^0.5.1", - "nopt": "^4.0.1", - "npmlog": "^4.1.2", - "request": "^2.88.0", - "rimraf": "^2.6.3", - "semver": "^5.7.1", - "tar": "^4.4.12", - "which": "^1.3.1" - }, - "deprecated": false, + "name": "node-gyp", "description": "Node.js native addon build tool", - "devDependencies": { - "bindings": "^1.5.0", - "nan": "^2.14.0", - "require-inject": "^1.4.4", - "standard": "^14.3.1", - "tap": "~12.7.0" - }, - "engines": { - "node": ">= 6.0.0" - }, - "homepage": "https://github.com/nodejs/node-gyp#readme", - "installVersion": 9, + "license": "MIT", "keywords": [ "native", "addon", @@ -72,17 +11,40 @@ "bindings", "gyp" ], - "license": "MIT", - "main": "./lib/node-gyp.js", - "name": "node-gyp", - "preferGlobal": true, + "version": "7.1.0", + "installVersion": 9, + "author": "Nathan Rajlich (http://tootallnate.net)", "repository": { "type": "git", "url": "git://github.com/nodejs/node-gyp.git" }, + "preferGlobal": true, + "bin": "./bin/node-gyp.js", + "main": "./lib/node-gyp.js", + "dependencies": { + "env-paths": "^2.2.0", + "glob": "^7.1.4", + "graceful-fs": "^4.2.3", + "nopt": "^4.0.3", + "npmlog": "^4.1.2", + "request": "^2.88.2", + "rimraf": "^2.6.3", + "semver": "^7.3.2", + "tar": "^6.0.1", + "which": "^2.0.2" + }, + "engines": { + "node": ">= 10.12.0" + }, + "devDependencies": { + "bindings": "^1.5.0", + "nan": "^2.14.1", + "require-inject": "^1.4.4", + "standard": "^14.3.4", + "tap": "^12.7.0" + }, "scripts": { "lint": "standard */*.js test/**/*.js", "test": "npm run lint && tap --timeout=120 test/test-*" - }, - "version": "5.1.0" + } } diff --git a/deps/npm/node_modules/node-gyp/test/test-configure-python.js b/deps/npm/node_modules/node-gyp/test/test-configure-python.js index d08f9e5ed38efd..ac25f7972ea239 100644 --- a/deps/npm/node_modules/node-gyp/test/test-configure-python.js +++ b/deps/npm/node_modules/node-gyp/test/test-configure-python.js @@ -10,7 +10,8 @@ const configure = requireInject('../lib/configure', { openSync: function () { return 0 }, closeSync: function () { }, writeFile: function (file, data, cb) { cb() }, - stat: function (file, cb) { cb(null, {}) } + stat: function (file, cb) { cb(null, {}) }, + mkdir: function (dir, options, cb) { cb() } } }) diff --git a/deps/npm/node_modules/node-gyp/test/test-find-python.js b/deps/npm/node_modules/node-gyp/test/test-find-python.js index 1c86f45b73b196..6be887f7eb3fcf 100644 --- a/deps/npm/node_modules/node-gyp/test/test-find-python.js +++ b/deps/npm/node_modules/node-gyp/test/test-find-python.js @@ -146,19 +146,20 @@ test('find python - no python2, no python, unix', function (t) { }) test('find python - no python, use python launcher', function (t) { - t.plan(4) + t.plan(3) var f = new TestPythonFinder(null, done) f.win = true f.execFile = function (program, args, opts, cb) { if (program === 'py.exe') { - t.notEqual(args.indexOf('-2'), -1) t.notEqual(args.indexOf('-c'), -1) return cb(null, 'Z:\\snake.exe') } if (/sys\.executable/.test(args[args.length - 1])) { cb(new Error('not found')) + } else if (f.winDefaultLocations.includes(program)) { + cb(new Error('not found')) } else if (/sys\.version_info/.test(args[args.length - 1])) { if (program === 'Z:\\snake.exe') { cb(null, '2.7.14') @@ -178,24 +179,21 @@ test('find python - no python, use python launcher', function (t) { }) test('find python - no python, no python launcher, good guess', function (t) { - t.plan(4) + t.plan(2) - var re = /C:[\\/]Python27[\\/]python[.]exe/ + var re = /C:[\\/]Python37[\\/]python[.]exe/ var f = new TestPythonFinder(null, done) f.win = true f.execFile = function (program, args, opts, cb) { if (program === 'py.exe') { - f.execFile = function (program, args, opts, cb) { - poison(f, 'execFile') - t.ok(re.test(program)) - t.ok(/sys\.version_info/.test(args[args.length - 1])) - cb(null, '2.7.14') - } return cb(new Error('not found')) } if (/sys\.executable/.test(args[args.length - 1])) { cb(new Error('not found')) + } else if (re.test(program) && + /sys\.version_info/.test(args[args.length - 1])) { + cb(null, '3.7.3') } else { t.fail() } diff --git a/deps/npm/node_modules/node-gyp/update-gyp.py b/deps/npm/node_modules/node-gyp/update-gyp.py new file mode 100755 index 00000000000000..c71d2376c0cb21 --- /dev/null +++ b/deps/npm/node_modules/node-gyp/update-gyp.py @@ -0,0 +1,45 @@ +#!/usr/bin/env python3 + +import argparse +import os +import shutil +import subprocess +import sys +import tarfile +import tempfile +import urllib.request + +BASE_URL = "https://github.com/nodejs/gyp-next/archive/" +CHECKOUT_PATH = os.path.dirname(os.path.realpath(__file__)) +CHECKOUT_GYP_PATH = os.path.join(CHECKOUT_PATH, 'gyp') + +parser = argparse.ArgumentParser() +parser.add_argument("tag", help="gyp tag to update to") +args = parser.parse_args() + +tar_url = BASE_URL + args.tag + ".tar.gz" + +changed_files = subprocess.check_output(["git", "diff", "--name-only"]).strip() +if changed_files: + raise Exception("Can't update gyp while you have uncommitted changes in node-gyp") + +with tempfile.TemporaryDirectory() as tmp_dir: + tar_file = os.path.join(tmp_dir, 'gyp.tar.gz') + unzip_target = os.path.join(tmp_dir, 'gyp') + with open(tar_file, 'wb') as f: + print("Downloading gyp-next@" + args.tag + " into temporary directory...") + print("From: " + tar_url) + with urllib.request.urlopen(tar_url) as in_file: + f.write(in_file.read()) + + print("Unzipping...") + with tarfile.open(tar_file, "r:gz") as tar_ref: + tar_ref.extractall(unzip_target) + + print("Moving to current checkout (" + CHECKOUT_PATH + ")...") + if os.path.exists(CHECKOUT_GYP_PATH): + shutil.rmtree(CHECKOUT_GYP_PATH) + shutil.move(os.path.join(unzip_target, os.listdir(unzip_target)[0]), CHECKOUT_GYP_PATH) + +subprocess.check_output(["git", "add", "gyp"], cwd=CHECKOUT_PATH) +subprocess.check_output(["git", "commit", "-m", "gyp: update gyp to " + args.tag]) diff --git a/deps/npm/node_modules/nopt/lib/nopt.js b/deps/npm/node_modules/nopt/lib/nopt.js index 0ec5753d0cb898..ecfa5da9336833 100644 --- a/deps/npm/node_modules/nopt/lib/nopt.js +++ b/deps/npm/node_modules/nopt/lib/nopt.js @@ -8,7 +8,7 @@ var url = require("url") , path = require("path") , Stream = require("stream").Stream , abbrev = require("abbrev") - , osenv = require("osenv") + , os = require("os") module.exports = exports = nopt exports.clean = clean @@ -140,7 +140,7 @@ function validatePath (data, k, val) { var isWin = process.platform === 'win32' , homePattern = isWin ? /^~(\/|\\)/ : /^~\// - , home = osenv.home() + , home = os.homedir() if (home && val.match(homePattern)) { data[k] = path.resolve(home, val.substr(2)) diff --git a/deps/npm/node_modules/nopt/package.json b/deps/npm/node_modules/nopt/package.json index 1490f6d25d75cf..12ed02da5a832d 100644 --- a/deps/npm/node_modules/nopt/package.json +++ b/deps/npm/node_modules/nopt/package.json @@ -1,47 +1,26 @@ { - "_from": "nopt@4.0.3", - "_id": "nopt@4.0.3", - "_inBundle": false, - "_integrity": "sha512-CvaGwVMztSMJLOeXPrez7fyfObdZqNUK1cPAEzLHrTybIua9pMdmmPR5YwtfNftIOMv3DPUhFaxsZMNTQO20Kg==", - "_location": "/nopt", - "_phantomChildren": {}, - "_requested": { - "type": "version", - "registry": true, - "raw": "nopt@4.0.3", - "name": "nopt", - "escapedName": "nopt", - "rawSpec": "4.0.3", - "saveSpec": null, - "fetchSpec": "4.0.3" + "name": "nopt", + "version": "5.0.0", + "description": "Option parsing for Node, supporting types, shorthands, etc. Used by npm.", + "author": "Isaac Z. Schlueter (http://blog.izs.me/)", + "main": "lib/nopt.js", + "scripts": { + "preversion": "npm test", + "postversion": "npm publish", + "prepublishOnly": "git push origin --follow-tags", + "test": "tap test/*.js" }, - "_requiredBy": [ - "#USER", - "/", - "/node-gyp" - ], - "_resolved": "https://registry.npmjs.org/nopt/-/nopt-4.0.3.tgz", - "_shasum": "a375cad9d02fd921278d954c2254d5aa57e15e48", - "_spec": "nopt@4.0.3", - "_where": "/Users/ruyadorno/Documents/workspace/cli", - "author": { - "name": "Isaac Z. Schlueter", - "email": "i@izs.me", - "url": "http://blog.izs.me/" + "repository": { + "type": "git", + "url": "https://github.com/npm/nopt.git" }, "bin": { "nopt": "bin/nopt.js" }, - "bugs": { - "url": "https://github.com/npm/nopt/issues" - }, - "bundleDependencies": false, + "license": "ISC", "dependencies": { - "abbrev": "1", - "osenv": "^0.1.4" + "abbrev": "1" }, - "deprecated": false, - "description": "Option parsing for Node, supporting types, shorthands, etc. Used by npm.", "devDependencies": { "tap": "^14.10.6" }, @@ -49,19 +28,7 @@ "bin", "lib" ], - "homepage": "https://github.com/npm/nopt#readme", - "license": "ISC", - "main": "lib/nopt.js", - "name": "nopt", - "repository": { - "type": "git", - "url": "git+https://github.com/npm/nopt.git" - }, - "scripts": { - "postversion": "npm publish", - "prepublishOnly": "git push origin --follow-tags", - "preversion": "npm test", - "test": "tap test/*.js" - }, - "version": "4.0.3" + "engines": { + "node": ">=6" + } } 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..4f86601e029e95 --- /dev/null +++ b/deps/npm/node_modules/normalize-package-data/node_modules/hosted-git-info/CHANGELOG.md @@ -0,0 +1,141 @@ +# 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. + + +## [2.8.8](https://github.com/npm/hosted-git-info/compare/v2.8.7...v2.8.8) (2020-02-29) + + +### Bug Fixes + +* [#61](https://github.com/npm/hosted-git-info/issues/61) & [#65](https://github.com/npm/hosted-git-info/issues/65) addressing issues w/ url.URL implmentation which regressed node 6 support ([5038b18](https://github.com/npm/hosted-git-info/commit/5038b18)), closes [#66](https://github.com/npm/hosted-git-info/issues/66) + + + + +## [2.8.7](https://github.com/npm/hosted-git-info/compare/v2.8.6...v2.8.7) (2020-02-26) + + +### Bug Fixes + +* Do not attempt to use url.URL when unavailable ([2d0bb66](https://github.com/npm/hosted-git-info/commit/2d0bb66)), closes [#61](https://github.com/npm/hosted-git-info/issues/61) [#62](https://github.com/npm/hosted-git-info/issues/62) +* Do not pass scp-style URLs to the WhatWG url.URL ([f2cdfcf](https://github.com/npm/hosted-git-info/commit/f2cdfcf)), closes [#60](https://github.com/npm/hosted-git-info/issues/60) + + + + +## [2.8.6](https://github.com/npm/hosted-git-info/compare/v2.8.5...v2.8.6) (2020-02-25) + + + + +## [2.8.5](https://github.com/npm/hosted-git-info/compare/v2.8.4...v2.8.5) (2019-10-07) + + +### Bug Fixes + +* updated pathmatch for gitlab ([e8325b5](https://github.com/npm/hosted-git-info/commit/e8325b5)), closes [#51](https://github.com/npm/hosted-git-info/issues/51) +* updated pathmatch for gitlab ([ffe056f](https://github.com/npm/hosted-git-info/commit/ffe056f)) + + + + +## [2.8.4](https://github.com/npm/hosted-git-info/compare/v2.8.3...v2.8.4) (2019-08-12) + + + + +## [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..7b723f6b9e2134 --- /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..8147e3348f5e80 --- /dev/null +++ b/deps/npm/node_modules/normalize-package-data/node_modules/hosted-git-info/git-host-info.js @@ -0,0 +1,79 @@ +'use strict' + +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\?=.*|\/repository\/[^/]+\/archive.tar.gz$)).*?)(?:[.]git|[/])?$/ + }, + gist: { + 'protocols': [ 'git', 'git+ssh', 'git+https', 'ssh', 'https' ], + 'domain': 'gist.github.com', + 'pathmatch': /^[/](?:([^/]+)[/])?([a-z0-9]{32,})(?:[.]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) + } + } +} + +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 +} + +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('|') + '):$') +}) + +function formatHashFragment (fragment) { + return fragment.toLowerCase().replace(/^\W+|\/|\W+$/g, '').replace(/\W+/g, '-') +} 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..9616fbaa6b4af0 --- /dev/null +++ b/deps/npm/node_modules/normalize-package-data/node_modules/hosted-git-info/git-host.js @@ -0,0 +1,156 @@ +'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 + + var keys = Object.keys(source) + var i = keys.length + while (i--) { + target[keys[i]] = source[keys[i]] + } + return target +} + +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 || {} +} + +GitHost.prototype.hash = function () { + return this.committish ? '#' + this.committish : '' +} + +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 { + vars[key] = encodeURIComponent(value) + } + }) + 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 + } +} + +GitHost.prototype.ssh = function (opts) { + return this._fill(this.sshtemplate, opts) +} + +GitHost.prototype.sshurl = function (opts) { + return this._fill(this.sshurltemplate, opts) +} + +GitHost.prototype.browse = function (P, F, opts) { + if (typeof P === 'string') { + if (typeof F !== 'string') { + opts = F + F = null + } + return this._fill(this.browsefiletemplate, extend({ + fragment: F, + path: P + }, opts)) + } else { + return this._fill(this.browsetemplate, P) + } +} + +GitHost.prototype.docs = function (opts) { + return this._fill(this.docstemplate, opts) +} + +GitHost.prototype.bugs = function (opts) { + return this._fill(this.bugstemplate, opts) +} + +GitHost.prototype.https = function (opts) { + return this._fill(this.httpstemplate, opts) +} + +GitHost.prototype.git = function (opts) { + return this._fill(this.gittemplate, opts) +} + +GitHost.prototype.shortcut = function (opts) { + return this._fill(this.shortcuttemplate, opts) +} + +GitHost.prototype.path = function (opts) { + return this._fill(this.pathtemplate, opts) +} + +GitHost.prototype.tarball = function (opts_) { + var opts = extend({}, opts_, { noCommittish: false }) + return this._fill(this.tarballtemplate, opts) +} + +GitHost.prototype.file = function (P, opts) { + return this._fill(this.filetemplate, extend({ path: P }, opts)) +} + +GitHost.prototype.getDefaultRepresentation = function () { + return this.default +} + +GitHost.prototype.toString = function (opts) { + if (this.default && typeof this[this.default] === 'function') return this[this.default](opts) + return this.sshurl(opts) +} 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..21e53fe3724be1 --- /dev/null +++ b/deps/npm/node_modules/normalize-package-data/node_modules/hosted-git-info/index.js @@ -0,0 +1,148 @@ +'use strict' +var url = require('url') +var gitHosts = require('./git-host-info.js') +var GitHost = module.exports = require('./git-host.js') + +var protocolToRepresentationMap = { + 'git+ssh:': 'sshurl', + 'git+https:': 'https', + 'ssh:': 'sshurl', + 'git:': 'git' +} + +function protocolToRepresentation (protocol) { + return protocolToRepresentationMap[protocol] || protocol.slice(0, -1) +} + +var authProtocols = { + 'git:': true, + 'https:': true, + 'git+https:': true, + 'http:': true, + 'git+http:': true +} + +var cache = {} + +module.exports.fromUrl = function (giturl, opts) { + if (typeof giturl !== 'string') return + var key = giturl + JSON.stringify(opts || {}) + + if (!(key in cache)) { + cache[key] = fromUrl(giturl, opts) + } + + return cache[key] +} + +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(new RegExp('^([^:]+):(?:(?:[^@:]+(?:[^@]+)?@)?([^/]*))[/](.+?)(?:[.]git)?($|#)')) + 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 + } + 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]) + 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(/^:/, '')) + } + project = decodeURIComponent(matched[2]) + defaultRepresentation = protocolToRepresentation(parsed.protocol) + } + return new GitHost(gitHostName, user, auth, project, committish, defaultRepresentation, opts) + } catch (ex) { + /* istanbul ignore else */ + if (ex instanceof URIError) { + } else throw ex + } + }).filter(function (gitHostInfo) { return gitHostInfo }) + if (matches.length !== 1) return + return matches[0] +} + +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) +} + +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 + } +} + +function parseGitUrl (giturl) { + var matched = giturl.match(/^([^@]+)@([^:/]+):[/]?((?:[^/]+[/])?[^/]+?)(?:[.]git)?(#.*)?$/) + if (!matched) { + var legacy = url.parse(giturl) + // If we don't have url.URL, then sorry, this is just not fixable. + // This affects Node <= 6.12. + if (legacy.auth && typeof url.URL === 'function') { + // 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. + var 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 + } + } + 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] || '') + } +} 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..e47c096ef2a620 --- /dev/null +++ b/deps/npm/node_modules/normalize-package-data/node_modules/hosted-git-info/package.json @@ -0,0 +1,40 @@ +{ + "name": "hosted-git-info", + "version": "2.8.8", + "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": { + "prerelease": "npm t", + "postrelease": "npm publish --tag=ancient-legacy-fixes && git push --follow-tags", + "posttest": "standard", + "release": "standard-version -s", + "test:coverage": "tap --coverage-report=html -J --coverage=90 --no-esm test/*.js", + "test": "tap -J --coverage=90 --no-esm test/*.js" + }, + "devDependencies": { + "standard": "^11.0.1", + "standard-version": "^4.4.0", + "tap": "^12.7.0" + }, + "files": [ + "index.js", + "git-host.js", + "git-host-info.js" + ] +} diff --git a/deps/npm/node_modules/normalize-package-data/node_modules/resolve/.editorconfig b/deps/npm/node_modules/normalize-package-data/node_modules/resolve/.editorconfig deleted file mode 100644 index bc228f8269443b..00000000000000 --- a/deps/npm/node_modules/normalize-package-data/node_modules/resolve/.editorconfig +++ /dev/null @@ -1,20 +0,0 @@ -root = true - -[*] -indent_style = tab -indent_size = 4 -end_of_line = lf -charset = utf-8 -trim_trailing_whitespace = true -insert_final_newline = true -max_line_length = 150 - -[CHANGELOG.md] -indent_style = space -indent_size = 2 - -[*.json] -max_line_length = off - -[Makefile] -max_line_length = off diff --git a/deps/npm/node_modules/normalize-package-data/node_modules/resolve/.travis.yml b/deps/npm/node_modules/normalize-package-data/node_modules/resolve/.travis.yml deleted file mode 100644 index 768129d572eeb8..00000000000000 --- a/deps/npm/node_modules/normalize-package-data/node_modules/resolve/.travis.yml +++ /dev/null @@ -1,269 +0,0 @@ -language: node_js -os: - - linux -node_js: - - "11.6" - - "10.15" - - "9.11" - - "8.15" - - "7.10" - - "6.16" - - "5.12" - - "4.9" - - "iojs-v3.3" - - "iojs-v2.5" - - "iojs-v1.8" - - "0.12" - - "0.10" - - "0.8" - - "0.6" -before_install: - - 'case "${TRAVIS_NODE_VERSION}" in 0.*) export NPM_CONFIG_STRICT_SSL=false ;; esac' - - 'nvm install-latest-npm' -install: - - 'if [ "${TRAVIS_NODE_VERSION}" = "0.6" ] || [ "${TRAVIS_NODE_VERSION}" = "0.9" ]; then nvm install --latest-npm 0.8 && npm install && nvm use "${TRAVIS_NODE_VERSION}"; else npm install; fi;' -script: - - 'if [ -n "${PRETEST-}" ]; then npm run pretest ; fi' - - 'if [ -n "${POSTTEST-}" ]; then npm run posttest ; fi' - - 'if [ -n "${COVERAGE-}" ]; then npm run coverage ; fi' - - 'if [ -n "${TEST-}" ]; then npm run tests-only ; fi' -sudo: false -env: - - TEST=true -matrix: - fast_finish: true - include: - - node_js: "lts/*" - env: PRETEST=true - - node_js: "lts/*" - env: POSTTEST=true - - node_js: "11.5" - env: TEST=true ALLOW_FAILURE=true - - node_js: "11.4" - env: TEST=true ALLOW_FAILURE=true - - node_js: "11.3" - env: TEST=true ALLOW_FAILURE=true - - node_js: "11.2" - env: TEST=true ALLOW_FAILURE=true - - node_js: "11.1" - env: TEST=true ALLOW_FAILURE=true - - node_js: "11.0" - env: TEST=true ALLOW_FAILURE=true - - node_js: "10.14" - env: TEST=true ALLOW_FAILURE=true - - node_js: "10.13" - env: TEST=true ALLOW_FAILURE=true - - node_js: "10.12" - env: TEST=true ALLOW_FAILURE=true - - node_js: "10.11" - env: TEST=true ALLOW_FAILURE=true - - node_js: "10.10" - env: TEST=true ALLOW_FAILURE=true - - node_js: "10.9" - env: TEST=true ALLOW_FAILURE=true - - node_js: "10.8" - env: TEST=true ALLOW_FAILURE=true - - node_js: "10.7" - env: TEST=true ALLOW_FAILURE=true - - node_js: "10.6" - env: TEST=true ALLOW_FAILURE=true - - node_js: "10.5" - env: TEST=true ALLOW_FAILURE=true - - node_js: "10.4" - env: TEST=true ALLOW_FAILURE=true - - node_js: "10.3" - env: TEST=true ALLOW_FAILURE=true - - node_js: "10.2" - env: TEST=true ALLOW_FAILURE=true - - node_js: "10.1" - env: TEST=true ALLOW_FAILURE=true - - node_js: "10.0" - env: TEST=true ALLOW_FAILURE=true - - node_js: "9.10" - env: TEST=true ALLOW_FAILURE=true - - node_js: "9.9" - env: TEST=true ALLOW_FAILURE=true - - node_js: "9.8" - env: TEST=true ALLOW_FAILURE=true - - node_js: "9.7" - env: TEST=true ALLOW_FAILURE=true - - node_js: "9.6" - env: TEST=true ALLOW_FAILURE=true - - node_js: "9.5" - env: TEST=true ALLOW_FAILURE=true - - node_js: "9.4" - env: TEST=true ALLOW_FAILURE=true - - node_js: "9.3" - env: TEST=true ALLOW_FAILURE=true - - node_js: "9.2" - env: TEST=true ALLOW_FAILURE=true - - node_js: "9.1" - env: TEST=true ALLOW_FAILURE=true - - node_js: "9.0" - env: TEST=true ALLOW_FAILURE=true - - node_js: "8.14" - env: TEST=true ALLOW_FAILURE=true - - node_js: "8.13" - env: TEST=true ALLOW_FAILURE=true - - node_js: "8.12" - env: TEST=true ALLOW_FAILURE=true - - node_js: "8.11" - env: TEST=true ALLOW_FAILURE=true - - node_js: "8.10" - env: TEST=true ALLOW_FAILURE=true - - node_js: "8.9" - env: TEST=true ALLOW_FAILURE=true - - node_js: "8.8" - env: TEST=true ALLOW_FAILURE=true - - node_js: "8.7" - env: TEST=true ALLOW_FAILURE=true - - node_js: "8.6" - env: TEST=true ALLOW_FAILURE=true - - node_js: "8.5" - env: TEST=true ALLOW_FAILURE=true - - node_js: "8.4" - env: TEST=true ALLOW_FAILURE=true - - node_js: "8.3" - env: TEST=true ALLOW_FAILURE=true - - node_js: "8.2" - env: TEST=true ALLOW_FAILURE=true - - node_js: "8.1" - env: TEST=true ALLOW_FAILURE=true - - node_js: "8.0" - env: TEST=true ALLOW_FAILURE=true - - node_js: "7.9" - env: TEST=true ALLOW_FAILURE=true - - node_js: "7.8" - env: TEST=true ALLOW_FAILURE=true - - node_js: "7.7" - env: TEST=true ALLOW_FAILURE=true - - node_js: "7.6" - env: TEST=true ALLOW_FAILURE=true - - node_js: "7.5" - env: TEST=true ALLOW_FAILURE=true - - node_js: "7.4" - env: TEST=true ALLOW_FAILURE=true - - node_js: "7.3" - env: TEST=true ALLOW_FAILURE=true - - node_js: "7.2" - env: TEST=true ALLOW_FAILURE=true - - node_js: "7.1" - env: TEST=true ALLOW_FAILURE=true - - node_js: "7.0" - env: TEST=true ALLOW_FAILURE=true - - node_js: "6.15" - env: TEST=true ALLOW_FAILURE=true - - node_js: "6.14" - env: TEST=true ALLOW_FAILURE=true - - node_js: "6.13" - env: TEST=true ALLOW_FAILURE=true - - node_js: "6.12" - env: TEST=true ALLOW_FAILURE=true - - node_js: "6.11" - env: TEST=true ALLOW_FAILURE=true - - node_js: "6.10" - env: TEST=true ALLOW_FAILURE=true - - node_js: "6.9" - env: TEST=true ALLOW_FAILURE=true - - node_js: "6.8" - env: TEST=true ALLOW_FAILURE=true - - node_js: "6.7" - env: TEST=true ALLOW_FAILURE=true - - node_js: "6.6" - env: TEST=true ALLOW_FAILURE=true - - node_js: "6.5" - env: TEST=true ALLOW_FAILURE=true - - node_js: "6.4" - env: TEST=true ALLOW_FAILURE=true - - node_js: "6.3" - env: TEST=true ALLOW_FAILURE=true - - node_js: "6.2" - env: TEST=true ALLOW_FAILURE=true - - node_js: "6.1" - env: TEST=true ALLOW_FAILURE=true - - node_js: "6.0" - env: TEST=true ALLOW_FAILURE=true - - node_js: "5.11" - env: TEST=true ALLOW_FAILURE=true - - node_js: "5.10" - env: TEST=true ALLOW_FAILURE=true - - node_js: "5.9" - env: TEST=true ALLOW_FAILURE=true - - node_js: "5.8" - env: TEST=true ALLOW_FAILURE=true - - node_js: "5.7" - env: TEST=true ALLOW_FAILURE=true - - node_js: "5.6" - env: TEST=true ALLOW_FAILURE=true - - node_js: "5.5" - env: TEST=true ALLOW_FAILURE=true - - node_js: "5.4" - env: TEST=true ALLOW_FAILURE=true - - node_js: "5.3" - env: TEST=true ALLOW_FAILURE=true - - node_js: "5.2" - env: TEST=true ALLOW_FAILURE=true - - node_js: "5.1" - env: TEST=true ALLOW_FAILURE=true - - node_js: "5.0" - env: TEST=true ALLOW_FAILURE=true - - node_js: "4.8" - env: TEST=true ALLOW_FAILURE=true - - node_js: "4.7" - env: TEST=true ALLOW_FAILURE=true - - node_js: "4.6" - env: TEST=true ALLOW_FAILURE=true - - node_js: "4.5" - env: TEST=true ALLOW_FAILURE=true - - node_js: "4.4" - env: TEST=true ALLOW_FAILURE=true - - node_js: "4.3" - env: TEST=true ALLOW_FAILURE=true - - node_js: "4.2" - env: TEST=true ALLOW_FAILURE=true - - node_js: "4.1" - env: TEST=true ALLOW_FAILURE=true - - node_js: "4.0" - env: TEST=true ALLOW_FAILURE=true - - node_js: "iojs-v3.2" - env: TEST=true ALLOW_FAILURE=true - - node_js: "iojs-v3.1" - env: TEST=true ALLOW_FAILURE=true - - node_js: "iojs-v3.0" - env: TEST=true ALLOW_FAILURE=true - - node_js: "iojs-v2.4" - env: TEST=true ALLOW_FAILURE=true - - node_js: "iojs-v2.3" - env: TEST=true ALLOW_FAILURE=true - - node_js: "iojs-v2.2" - env: TEST=true ALLOW_FAILURE=true - - node_js: "iojs-v2.1" - env: TEST=true ALLOW_FAILURE=true - - node_js: "iojs-v2.0" - env: TEST=true ALLOW_FAILURE=true - - node_js: "iojs-v1.7" - env: TEST=true ALLOW_FAILURE=true - - node_js: "iojs-v1.6" - env: TEST=true ALLOW_FAILURE=true - - node_js: "iojs-v1.5" - env: TEST=true ALLOW_FAILURE=true - - node_js: "iojs-v1.4" - env: TEST=true ALLOW_FAILURE=true - - node_js: "iojs-v1.3" - env: TEST=true ALLOW_FAILURE=true - - node_js: "iojs-v1.2" - env: TEST=true ALLOW_FAILURE=true - - node_js: "iojs-v1.1" - env: TEST=true ALLOW_FAILURE=true - - node_js: "iojs-v1.0" - env: TEST=true ALLOW_FAILURE=true - - node_js: "0.11" - env: TEST=true ALLOW_FAILURE=true - - node_js: "0.9" - env: TEST=true ALLOW_FAILURE=true - - node_js: "0.4" - env: TEST=true ALLOW_FAILURE=true - allow_failures: - - os: osx - - env: TEST=true ALLOW_FAILURE=true - - node_js: "0.6" diff --git a/deps/npm/node_modules/normalize-package-data/node_modules/resolve/CHANGELOG.md b/deps/npm/node_modules/normalize-package-data/node_modules/resolve/CHANGELOG.md deleted file mode 100644 index 832ee0272043e1..00000000000000 --- a/deps/npm/node_modules/normalize-package-data/node_modules/resolve/CHANGELOG.md +++ /dev/null @@ -1,629 +0,0 @@ -### Changelog - -All notable changes to this project will be documented in this file. Dates are displayed in UTC. - -#### [Unreleased](https://github.com/browserify/resolve/compare/v1.9.0...HEAD) - -- [Fix] `sync`/`async`: when package.json `main` is not a string, throw an error ([`#178`][]) -- [Tests] up to `v11.6`, `v10.15`, `v8.15`, `v6.16` (([`083e78c`][]) -- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `tape` (([`29a4994`][]) -- [Tests] add an additional test (([`2c67936`][]) - -[`083e78c`]: https://github.com/browserify/resolve/commit/083e78c1ae5c1708b7d41c9ad7c608caffeddcbf -[`29a4994`]: https://github.com/browserify/resolve/commit/29a499418d54b5befe9deef1bc7c38a9174cfbd8 -[`2c67936`]: https://github.com/browserify/resolve/commit/2c679363e852f7a0d570593527ea7038f0cd2c19 - -#### [v1.9.0](https://github.com/browserify/resolve/compare/v1.8.1...v1.9.0) - 17 December 2018 - -- [Fix] `sync`/`async`: fix `preserveSymlinks` option ([`#177`][]) -- [Fix] `sync`/`async`: when package.json `main` is not a string, throw an error ([`#178`][]) -- [Refactor] `node-modules-paths`: Change `paths` function option to receive a thunk for node modules resolution paths (([`d652f01`][]) -- [Tests] up to `node` `v11.4`, `v10.14`, `v8.14`, `v6.15` (([`2b4f3a8`][]) -- [New] `async`/`sync`/`node-modules-paths`: Adds support for “paths” being a function (([`7112873`][]) -- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `object-keys`, `safe-publish-latest`, `tape` (([`5542700`][]) -- [New] Implements a "normalize-options" pseudo-hook (([`f3961df`][]) -- [Tests] better failure messages (([`f839d20`][]) -- [Deps] update `path-parse` (([`1018c0e`][]) - -[`d652f01`]: https://github.com/browserify/resolve/commit/d652f018b2561f4863ffcd0f3ecdb0dfe65ee223 -[`2b4f3a8`]: https://github.com/browserify/resolve/commit/2b4f3a898a3943e45cdff539b542c4ebee2b608a -[`7112873`]: https://github.com/browserify/resolve/commit/711287339aad544788a4b8b5335221cea645572c -[`5542700`]: https://github.com/browserify/resolve/commit/554270035e1997ae34865500c629888249baa304 -[`f3961df`]: https://github.com/browserify/resolve/commit/f3961dfcb7b2993d935c255e65309e7028a88b8d -[`f839d20`]: https://github.com/browserify/resolve/commit/f839d20ab16ef814214d80183452d02379cbbf15 -[`1018c0e`]: https://github.com/browserify/resolve/commit/1018c0e49851bfb62176d8adbc94125ae85cd158 - -#### [v1.8.1](https://github.com/browserify/resolve/compare/v1.8.0...v1.8.1) - 17 June 2018 - -- [Docs] clean up readme code (([`f5394d8`][]) -- [Fix] resolution when `filename` option is passed (([`9c370c9`][]) -- [Tests] up to `node` `v10.4` (([`3a64219`][]) -- [Tests] improve output of symlink tests that fail on Mac (([`6f771b2`][]) - -[`f5394d8`]: https://github.com/browserify/resolve/commit/f5394d801350ff32be08dfc5ca37bcb677b4c08b -[`9c370c9`]: https://github.com/browserify/resolve/commit/9c370c9848eaecb36fb8e0b004930e2dd49e1e71 -[`3a64219`]: https://github.com/browserify/resolve/commit/3a64219a7385d5d51f3d4ff7b3de0ce749d6cf09 -[`6f771b2`]: https://github.com/browserify/resolve/commit/6f771b215b4f40b0ba0009ef564bde85212e79eb - -#### [v1.8.0](https://github.com/browserify/resolve/compare/v1.7.1...v1.8.0) - 15 June 2018 - -- [New] include filename in error message ([`#162`][]) -- [Tests] up to `node` `v10.1`, `v9.11`, `v8.11`, `v6.14`, `4.9` (([`ad16af2`][]) -- Fix eslint problems and update count of tests (([`def5931`][]) -- [New] add fs/promises to the list of core modules (([`756419a`][]) -- [New] core: add `trace_events`, `v8/tools/arguments` (([`bae0338`][]) -- [Fix] core: `_tls_legacy` is removed in node 10 (([`4225ac5`][]) - -[`#162`]: https://github.com/browserify/resolve/pull/162 -[`ad16af2`]: https://github.com/browserify/resolve/commit/ad16af2f4f6eb1dc964f5b119f6d94bd64b2607a -[`def5931`]: https://github.com/browserify/resolve/commit/def59317704d787adcddc9695b923e65c6bf5232 -[`756419a`]: https://github.com/browserify/resolve/commit/756419a94432fd753a62f5a58b797776efb543f9 -[`bae0338`]: https://github.com/browserify/resolve/commit/bae033824c82153ccb4f32abdd0e70ca677968bc -[`4225ac5`]: https://github.com/browserify/resolve/commit/4225ac5f4b90d26db664ed32f5b08416fea69b86 - -#### [v1.7.1](https://github.com/browserify/resolve/compare/v1.7.0...v1.7.1) - 12 April 2018 - -- [Fix] revert proper but unintended breaking change in sync packageFilter ([`#157`][]) - -#### [v1.7.0](https://github.com/browserify/resolve/compare/v1.6.0...v1.7.0) - 7 April 2018 - -- [Fix] Make loadAsFileSync() work the same as async loadAsFile() ([`#146`][]) -- [Tests] add more pathfilter tests (([`c3621a3`][]) -- [Tests] add some tests for browser field (([`13fb572`][]) -- [Refactor] cache default isFile functions at module level (([`fa6e6f5`][]) -- [Docs] fix default “isFile” implementations (([`0f29c93`][]) -- [Tests] add some tests for a non-directory basedir (([`0c18e40`][]) -- [Refactor] use "basedir" instead of "y", because meaningful variable names (([`876b0b0`][]) -- [Docs] fix options formatting (([`23df5f5`][]) -- Minor cleanup (([`c449d48`][]) -- [Fix] support `opts.package` in non-relative lookups (([`c8a2052`][]) -- [Tests] work around npm SSL issue (([`04cb0bb`][]) -- [Tests] add node 8 and 9 to appveyor (([`7cbd17a`][]) -- [Tests] work around npm SSL issue (([`4b10996`][]) - -[`#146`]: https://github.com/browserify/resolve/pull/146 -[`c3621a3`]: https://github.com/browserify/resolve/commit/c3621a35675b275b2b241dd367459ed7afe1c22a -[`13fb572`]: https://github.com/browserify/resolve/commit/13fb572337623622d06450696af6c15b68be26c3 -[`fa6e6f5`]: https://github.com/browserify/resolve/commit/fa6e6f5a2d34377f6973701733177a280adf0511 -[`0f29c93`]: https://github.com/browserify/resolve/commit/0f29c93f0c74fc4e52ec6ed6678ce0fec6347e2d -[`0c18e40`]: https://github.com/browserify/resolve/commit/0c18e40e4929ba2c9426a77079c153c43e50a025 -[`876b0b0`]: https://github.com/browserify/resolve/commit/876b0b08da9fe44d81681d0c815900485536be9e -[`23df5f5`]: https://github.com/browserify/resolve/commit/23df5f526823e27e33b01333016b7f58b4f63b6f -[`c449d48`]: https://github.com/browserify/resolve/commit/c449d4809cf8461a3d54e458780902b95119a969 -[`c8a2052`]: https://github.com/browserify/resolve/commit/c8a20524c7d08671c22903e70b952575b0502f7b -[`04cb0bb`]: https://github.com/browserify/resolve/commit/04cb0bb94628e560bfa4163e73637d3803591714 -[`7cbd17a`]: https://github.com/browserify/resolve/commit/7cbd17ae270f9ec24ef05779c3a5e9da3e75c598 -[`4b10996`]: https://github.com/browserify/resolve/commit/4b1099668477e28117c34f9db3509ff096a49190 - -#### [v1.6.0](https://github.com/browserify/resolve/compare/v1.5.0...v1.6.0) - 20 March 2018 - -- [New] add `async_hooks` core module, added in node 8 ([`#144`][]) -- [New] add many missing core modules. (([`88c0778`][]) -- Made loadAsFileSync() work the same as async loadAsFile(). (([`dc23387`][]) -- [Tests] up to `v9.8`, `v8.10`, `v6.13` (([`315d729`][]) -- [Tests] up to `node` `v9.3`, `v8.8`, `v6.12`; pin included builds to LTS (([`5091aa2`][]) -- [Tests] add a failing test (([`90b1192`][]) -- [Dev Deps] update `eslint`, `tape` (([`2acf953`][]) -- [Tests] restore node 0.6 (([`2764758`][]) -- [Dev Deps] update `eslint` (([`699a54e`][]) -- [Dev Deps] update `eslint` (([`2674fad`][]) - -[`88c0778`]: https://github.com/browserify/resolve/commit/88c0778be359caaeb4ca74b24a7b5f7903bc39e8 -[`dc23387`]: https://github.com/browserify/resolve/commit/dc23387adb93f497d67def7ee99fae48e5958fb3 -[`315d729`]: https://github.com/browserify/resolve/commit/315d729afe7074ffae5d6ca6509a73d747985d45 -[`5091aa2`]: https://github.com/browserify/resolve/commit/5091aa2c076b67ff762937401e81da66ef7988ca -[`90b1192`]: https://github.com/browserify/resolve/commit/90b11921181c2783209e9aa31f1e20d98c11ed17 -[`2acf953`]: https://github.com/browserify/resolve/commit/2acf953ce2a94b38528372b5f8848ac95a2aabe5 -[`2764758`]: https://github.com/browserify/resolve/commit/2764758aae576aef98f41af5d46f76ada3523012 -[`699a54e`]: https://github.com/browserify/resolve/commit/699a54e91222dc8b3e1f0af8e9859c734d99d50a -[`2674fad`]: https://github.com/browserify/resolve/commit/2674fadcfcf2b253fdcf5e9d8564fd2b23b0b57c - -#### [v1.5.0](https://github.com/browserify/resolve/compare/v1.4.0...v1.5.0) - 24 October 2017 - -- [New] node v8.8+ supports `http2` ([`#139`][]) -- [Fix] fix broken core tests; change core.json to be an object instead of an array; fix results (([`b826f30`][]) -- [Tests] up to `v8.4`; node 0.6 is failing due to travis-ci changes; allow it to fail for now. (([`e9d3a24`][]) -- [Tests] up to `node` `8.7`; use `nvm install-latest-npm` so new npm doesn’t break old node (([`d0de222`][]) -- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `tape` (([`76f28a3`][]) -- [Tests] on `node` `v8.8` (([`e0c5d51`][]) -- [Docs] update repo URL (([`3412f98`][]) -- [New] add `perf_hooks`, added in node v8.5 (([`e66117d`][]) -- [Dev Deps] update `eslint` (([`5bfb072`][]) - -[`b826f30`]: https://github.com/browserify/resolve/commit/b826f3007dc8903b95e39984f93c68bb5e4c85b9 -[`e9d3a24`]: https://github.com/browserify/resolve/commit/e9d3a24ae0a4d8e3eefc6431c918c23f7c8fc6d3 -[`d0de222`]: https://github.com/browserify/resolve/commit/d0de222e4b55b67224ddec0421ee66ce8cb5ee8d -[`76f28a3`]: https://github.com/browserify/resolve/commit/76f28a3d275a63b0511449d28900ab5749f27fa5 -[`e0c5d51`]: https://github.com/browserify/resolve/commit/e0c5d518abfaadc4107ca8f3f8c30caf46490444 -[`3412f98`]: https://github.com/browserify/resolve/commit/3412f984a03a345b9a5ef1f0642a0308d676a2c2 -[`e66117d`]: https://github.com/browserify/resolve/commit/e66117df49d9f967b46fde633770307c9d5a7066 -[`5bfb072`]: https://github.com/browserify/resolve/commit/5bfb072f152c77c8247f4c06c1efa9246bbdddb0 - -#### [v1.4.0](https://github.com/browserify/resolve/compare/v1.3.3...v1.4.0) - 26 July 2017 - -- [New]: add `preserveSymlinks` option ([`#130`][]) -- [Fix] `sync`: fix when package.json main = ‘.’ or main = ‘./‘ ([`#125`][]) -- [Tests] up to `node` `v8.2`, `v7.10`, `v6.11`; npm 4.6+ breaks on node < 4 (([`41a3604`][]) -- [Tests] fix 0.6 and linting (([`703517b`][]) -- Only apps should have lockfiles (([`11fb3d8`][]) -- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `tape` (([`bc2f7bf`][]) - -[`41a3604`]: https://github.com/browserify/resolve/commit/41a3604f6408dbe9693febf895251db924c87a8f -[`703517b`]: https://github.com/browserify/resolve/commit/703517b78e7e0f8093a79c0a7a413a708ac82d06 -[`11fb3d8`]: https://github.com/browserify/resolve/commit/11fb3d85bb107a24476bd8d764ba25b3c60c184a -[`bc2f7bf`]: https://github.com/browserify/resolve/commit/bc2f7bf29d172fa54d66cf909fb47a858f7765aa - -#### [v1.3.3](https://github.com/browserify/resolve/compare/v1.3.2...v1.3.3) - 20 April 2017 - -- [Fix] error code MODULE_NOT_FOUND instead of ENOTDIR ([`#121`][]) -- [Tests] [eslint] add `npm run lint` (([`3677928`][]) -- [Tests] up to `node` `v7.7`, `v6.10`, `v4.8`; comment out OSX builds since they block linux builds. (([`1d3883c`][]) -- [Fix] correctly resolve dir paths when file with the same name exists (([`a983d38`][]) -- [Tests] up to `node` `v7.9` (([`0da055c`][]) -- [Tests] improve failure scenarios. (([`1de578f`][]) -- [Fix] `sync`: ensure that the path is a string, explicitly. (([`b7ba83d`][]) -- [Dev Deps] update `eslint` (([`452fdf9`][]) -- [Tests] node 0.6 can’t support an npm that understands scoped packages (([`26369cf`][]) - -[`3677928`]: https://github.com/browserify/resolve/commit/36779282881ec4abce32b2c9b7f7b10bcd09d953 -[`1d3883c`]: https://github.com/browserify/resolve/commit/1d3883c40d55242d7dfeafa43fa782dc6f4ab4a6 -[`a983d38`]: https://github.com/browserify/resolve/commit/a983d38c47ea26e57e0824f22929985ecb24faca -[`0da055c`]: https://github.com/browserify/resolve/commit/0da055cc75bebd7e0044cd4184e7c5386a7bd7de -[`1de578f`]: https://github.com/browserify/resolve/commit/1de578f2879f83ba94789041420fd3d3b929127e -[`b7ba83d`]: https://github.com/browserify/resolve/commit/b7ba83d43519c3c77af823ef1badd7f452d8b8e3 -[`452fdf9`]: https://github.com/browserify/resolve/commit/452fdf981330f96d7fef88805b24e40ea24a89e1 -[`26369cf`]: https://github.com/browserify/resolve/commit/26369cfe6ce4eae7404f3c003c88618f098d6814 - -#### [v1.3.2](https://github.com/browserify/resolve/compare/v1.2.1...v1.3.2) - 26 February 2017 - -- Fix prepublish script. (([`1aa1d9d`][]) - -[`1aa1d9d`]: https://github.com/browserify/resolve/commit/1aa1d9d9adc60691431efbde8d915c143cd54916 - -#### [v1.3.1](https://github.com/browserify/resolve/compare/v1.3.0...v1.3.1) - 24 February 2017 - -- Revert "[New] add searched extensions to error messages" (([`68a081d`][]) - -[`68a081d`]: https://github.com/browserify/resolve/commit/68a081d1c7ff6e0fb58aeff4b6ac06aada7812c4 - -#### [v1.3.0](https://github.com/browserify/resolve/compare/v1.2.0...v1.3.0) - 24 February 2017 - -#### [v1.2.1](https://github.com/browserify/resolve/compare/v1.3.1...v1.2.1) - 26 February 2017 - -- [Fix] for browserify compat, do not assume `process.versions.node` exists. ([`#120`][]) -- [Fix] for browserify compat, do not assume `process.versions.node` exists. ([`#120`][]) - -#### [v1.2.0](https://github.com/browserify/resolve/compare/v1.1.7...v1.2.0) - 13 December 2016 - -- [Fix] `resolve.sync` should re-throw non `ENOENT errors. ([`#79`][]) -- [New] add missing core modules, and determine them dynamically by node version. ([`#100`][][`#110`][][`#111`][][`#112`][]) -- [Tests] test on every minor version of node. ([`#109`][][`#75`][][`#74`][][`#70`][]) -- code style: tabs → spaces (([`0ab33b2`][]) -- [Dev Deps] add `safe-publish-latest` (([`83c25dd`][]) -- [Fix] Create error outside process.nextTick (([`3fa5f02`][]) -- readme: update API docs link for require.resolve() (([`7e98547`][]) -- [Dev Deps] update `tape` (([`764f3a2`][]) -- gitignore node_modules (([`3e8a8da`][]) - -[`0ab33b2`]: https://github.com/browserify/resolve/commit/0ab33b29b814e030021ff2df391e60a1c52dcc46 -[`83c25dd`]: https://github.com/browserify/resolve/commit/83c25dde8aa5a663bc3863d946fdc62fab5fd080 -[`3fa5f02`]: https://github.com/browserify/resolve/commit/3fa5f02f2ace0683fbd42196619c4e2bbd9eef60 -[`7e98547`]: https://github.com/browserify/resolve/commit/7e98547319f1dada4f26d7a24f3b92a08f85c56b -[`764f3a2`]: https://github.com/browserify/resolve/commit/764f3a231c26c370c4e6b94f0bb10166c20551b7 -[`3e8a8da`]: https://github.com/browserify/resolve/commit/3e8a8da3c9d545e00e15f5bed24623eb134b2221 - -#### [v1.1.7](https://github.com/browserify/resolve/compare/v1.1.6...v1.1.7) - 24 January 2016 - -- (typo) Change againt to against ([`#83`][]) -- Fix node_modules paths on Windows (([`35b2b64`][]) - -[`#83`]: https://github.com/browserify/resolve/pull/83 -[`35b2b64`]: https://github.com/browserify/resolve/commit/35b2b642d91e9b81e7cc26b6fd19912e18901d55 - -#### [v1.1.6](https://github.com/browserify/resolve/compare/v1.1.5...v1.1.6) - 15 March 2015 - -- Use path.dirname to walk up looking for a package.json ([`#76`][]) -- add back pkg assertions to pick up the root package (([`4c25e45`][]) - -[`4c25e45`]: https://github.com/browserify/resolve/commit/4c25e45625fea7980463fc107fc843aab7e0d993 - -#### [v1.1.5](https://github.com/browserify/resolve/compare/v1.1.4...v1.1.5) - 21 February 2015 - -- another test, not quite the failing case (([`612cac2`][]) -- fix for the failing case (([`503c746`][]) - -[`612cac2`]: https://github.com/browserify/resolve/commit/612cac2beac41fb13b7b12a9dfdb4207391260c1 -[`503c746`]: https://github.com/browserify/resolve/commit/503c746a6e64d50f2c9b18b4476ffcfed49947f2 - -#### [v1.1.4](https://github.com/browserify/resolve/compare/v1.1.3...v1.1.4) - 20 February 2015 - -- finally seems to fully handle browser field from outside foo/bar resolution (([`5b737d5`][]) -- flatter nodeModules function (([`5ebb39a`][]) - -[`5b737d5`]: https://github.com/browserify/resolve/commit/5b737d58b38ce891ef3f06d600d0562dbbc8539c -[`5ebb39a`]: https://github.com/browserify/resolve/commit/5ebb39a19b62c052ff6201600c3d2fffb3f5fdcb - -#### [v1.1.3](https://github.com/browserify/resolve/compare/v1.1.2...v1.1.3) - 17 February 2015 - -- re-implemented pathfilter feature nearly passes the test (([`60ff554`][]) -- another precedence test (([`98d22e0`][]) -- move pathfilter test to its own file (([`90826f5`][]) -- path logic fix that seems to handle all the cases across this package and browserify (([`70146a5`][]) -- tape everywhere (([`47bbfcd`][]) -- move pathfilter files into their own dir (([`7f0a3f1`][]) -- failing precedence test (([`73e958e`][]) -- nearly nearly working (([`e7bffbf`][]) -- packageFilter should have been giving the pkgfile as an argument, fixed (([`70b71e7`][]) -- this fixes the directory precedence problem (([`caca9f9`][]) -- disable faulty basedir test except on windows for now (([`3be4b79`][]) -- passes pathfilter test (([`644f814`][]) -- fix node_path test, was clearly wrong for some reason (([`9aa36e7`][]) - -[`60ff554`]: https://github.com/browserify/resolve/commit/60ff5545ec3cd15367c89c08cf3f139fa9c23796 -[`98d22e0`]: https://github.com/browserify/resolve/commit/98d22e0e21dd57fe1ab8d9573c1f63903c2b7321 -[`90826f5`]: https://github.com/browserify/resolve/commit/90826f575fe37cb3852de17e764b62e3754484b2 -[`70146a5`]: https://github.com/browserify/resolve/commit/70146a5ebc4d96438383ada02785d4e722c6f5d9 -[`47bbfcd`]: https://github.com/browserify/resolve/commit/47bbfcd9d9c8a68ce97fa37e0563930cee67093d -[`7f0a3f1`]: https://github.com/browserify/resolve/commit/7f0a3f1545f4b53f1bdd099b67561f9516693325 -[`73e958e`]: https://github.com/browserify/resolve/commit/73e958e905eed000787f0596f81c212ca2cdb3b3 -[`e7bffbf`]: https://github.com/browserify/resolve/commit/e7bffbf1b39b6239732c0e7fb01eeb9dad605d15 -[`70b71e7`]: https://github.com/browserify/resolve/commit/70b71e7980b3235018a0f5ac0bd52b8393548beb -[`caca9f9`]: https://github.com/browserify/resolve/commit/caca9f9c3576c85d8972d25012ea5d12aeaa50f4 -[`3be4b79`]: https://github.com/browserify/resolve/commit/3be4b796f1a9aadfb293b36c0c7f781ca9169f09 -[`644f814`]: https://github.com/browserify/resolve/commit/644f81478c892874f9829aa6cca36ca72474db00 -[`9aa36e7`]: https://github.com/browserify/resolve/commit/9aa36e77eca50e177498984fdef5d564903d3964 - -#### [v1.1.2](https://github.com/browserify/resolve/compare/v1.1.0...v1.1.2) - 16 February 2015 - -- Adding pathFilter docs ([`#67`][]) -- adding pathFilter docs (([`44480ff`][]) - -[`#67`]: https://github.com/browserify/resolve/pull/67 -[`44480ff`]: https://github.com/browserify/resolve/commit/44480ff041f791f32b80d212302180be210901a1 - -#### [v1.1.0](https://github.com/browserify/resolve/compare/v1.0.0...v1.1.0) - 27 January 2015 - -- Update docs re: input and cb args. ([`#65`][]) -- Update main README--change word order for clarity ([`#55`][]) -- attempts to find package.json data for deep references https://github.com/substack/node-resolve/issues/62 (([`caff2ba`][]) -- formatting (([`b8d09e3`][]) -- Add failing test for parent filename in error msg. (([`96d38c6`][]) -- split before computing the pivot to prevent abcnode_modulesxyz from matching (([`10380e1`][]) -- Utilize opts.filename when available to ID parent. (([`f6edcd9`][]) - -[`#65`]: https://github.com/browserify/resolve/pull/65 -[`#55`]: https://github.com/browserify/resolve/pull/55 -[`caff2ba`]: https://github.com/browserify/resolve/commit/caff2ba60dc5d85eaded388dc6025afd05ba183b -[`b8d09e3`]: https://github.com/browserify/resolve/commit/b8d09e3a2d679f6b61515d49eca3f6d8d0d2ac7f -[`96d38c6`]: https://github.com/browserify/resolve/commit/96d38c6aaa575d12781c28b34243b4939359a335 -[`10380e1`]: https://github.com/browserify/resolve/commit/10380e16d3cf03f25941c3f1545ef73ed11bc1e1 -[`f6edcd9`]: https://github.com/browserify/resolve/commit/f6edcd95ad5d27bfbdee0fa51951aa3d45d77cba - -### [v1.0.0](https://github.com/browserify/resolve/compare/v0.7.4...v1.0.0) - 11 August 2014 - -- reformat package.json (([`695bbc1`][]) - -[`695bbc1`]: https://github.com/browserify/resolve/commit/695bbc1d9eeb35339b4a01e141c6f6e1dff3a6e3 - -#### [v0.7.4](https://github.com/browserify/resolve/compare/v0.7.3...v0.7.4) - 25 July 2014 - -- merged (([`5cae82f`][]) - -[`5cae82f`]: https://github.com/browserify/resolve/commit/5cae82fb22cb64d5b72f703c787dc0fd418ed412 - -#### [v0.7.3](https://github.com/browserify/resolve/compare/v0.7.2...v0.7.3) - 25 July 2014 - -- cb(err) for non-string args (([`965c70b`][]) - -[`965c70b`]: https://github.com/browserify/resolve/commit/965c70b27ff796fc0ac3dba186d95b61d82446df - -#### [v0.7.2](https://github.com/browserify/resolve/compare/v0.7.1...v0.7.2) - 25 July 2014 - -- failing dotdot test (([`3ee0f0e`][]) -- fixes for dotdot tests (([`a67f230`][]) -- failing sync dotdot test (([`55515e7`][]) - -[`3ee0f0e`]: https://github.com/browserify/resolve/commit/3ee0f0eb97971d246a4a3f183374f60938f1ca8a -[`a67f230`]: https://github.com/browserify/resolve/commit/a67f230133050568ca14a04c0d36aaf6bf14fa89 -[`55515e7`]: https://github.com/browserify/resolve/commit/55515e7f816571fb9d71fdd6d0f012185b2eeefb - -#### [v0.7.1](https://github.com/browserify/resolve/compare/v0.7.0...v0.7.1) - 9 June 2014 - -- [Fix] `node-modules-paths`: `opts` should be optional, and `opts.paths` should not be concatenated when omitted. ([`#96`][]) -- [Refactor] consistent spacing and quotes; run some basic linting manually. (([`f63faaf`][]) -- [Tests] use `path.join` more often to normalize paths across OS’s. (([`8280c53`][]) -- [Tests] use `path` methods to make tests pass on both linux and Windows. (([`af9a885`][]) -- [Tests] make matrix more efficient (([`7f0ce87`][]) -- [Tests] fix indentation, manual linting. (([`6984dcb`][]) -- [Tests] [Refactor] refactor `node-modules-paths` and add tests. (([`58b99a3`][]) -- [Tests] add `appveyor` (([`caffe35`][]) -- [new] Add err.code = 'MODULE_NOT_FOUND' (([`c622aef`][]) -- [New] add searched extensions to error messages (([`1260d9d`][]) -- node-modules-paths: absolutize the `start` path (([`9d6b7af`][]) -- [Refactor] `async`: remove unnecessary slashes, since `path.join` adds them. (([`dd50615`][]) -- [Tests] ensure node_path test is independent of the `tap` module’s “main” (([`ddca9ed`][]) - -[`f63faaf`]: https://github.com/browserify/resolve/commit/f63faaf9df5dbd8da388c674de0b14e3286e5e91 -[`8280c53`]: https://github.com/browserify/resolve/commit/8280c53eae6b612f586e133052ed2b2a56ae6649 -[`af9a885`]: https://github.com/browserify/resolve/commit/af9a8858a618ab64dd4bb311ef1be37822ade2b7 -[`7f0ce87`]: https://github.com/browserify/resolve/commit/7f0ce871b6d2b5cb2082b04cd72ddd4055cb7a05 -[`6984dcb`]: https://github.com/browserify/resolve/commit/6984dcb1407fec6af46f744ad2c63f502645bdd6 -[`58b99a3`]: https://github.com/browserify/resolve/commit/58b99a36f882d7ee65df725224f204abd27379db -[`caffe35`]: https://github.com/browserify/resolve/commit/caffe358566bb3c2f9b4cbd8c0f910debfb6df3b -[`c622aef`]: https://github.com/browserify/resolve/commit/c622aefeb286e479d536601e30bb828e69f86ec3 -[`1260d9d`]: https://github.com/browserify/resolve/commit/1260d9d1e2f55efb514540db9aa1b3d679f9db10 -[`9d6b7af`]: https://github.com/browserify/resolve/commit/9d6b7af28c054676d6ea8a5037353ed750ea13bb -[`dd50615`]: https://github.com/browserify/resolve/commit/dd506158089f7d071d2a9f61cd4385365d177219 -[`ddca9ed`]: https://github.com/browserify/resolve/commit/ddca9ed7e1d980d5ec561450875cb09463effd5a - -#### [v0.7.0](https://github.com/browserify/resolve/compare/v0.6.3...v0.7.0) - 17 May 2014 - -- array opts.moduleDirectory tests (([`0f6d088`][]) -- opts.moduleDirectory string tests (([`a15ffd6`][]) -- Support more than one directory in opts.moduleDirectory. (([`4183463`][]) -- formatting (([`b89f089`][]) -- Remove variable leftover from 325584a685 (([`12fa78c`][]) - -[`0f6d088`]: https://github.com/browserify/resolve/commit/0f6d08801db6bc2044df8767226421172a2d9461 -[`a15ffd6`]: https://github.com/browserify/resolve/commit/a15ffd6c20772831c41146189c117ab0a0650e0b -[`4183463`]: https://github.com/browserify/resolve/commit/41834633e84d76d86297968ba34c375f26fe4f08 -[`b89f089`]: https://github.com/browserify/resolve/commit/b89f08902e8551e07d66e81a3dc33840e24266c5 -[`12fa78c`]: https://github.com/browserify/resolve/commit/12fa78ce43c4363e1c9600b635d18cd295c6949f - -#### [v0.6.3](https://github.com/browserify/resolve/compare/v0.6.2...v0.6.3) - 16 April 2014 - -- Fixed the case when main is specified as "." or "./" causing the resolve to infinite loop as documented at https://github.com/substack/node-browserify/issues/732. (([`b11f273`][]) - -[`b11f273`]: https://github.com/browserify/resolve/commit/b11f2739ad8c9730e1076271eff54850755e2ee1 - -#### [v0.6.2](https://github.com/browserify/resolve/compare/v0.6.1...v0.6.2) - 21 March 2014 - -- passing tests for paths (([`4f56bb6`][]) -- faulty basedir does not always produce error properly in windows, because when the dirs are sliced down the final path has improper prefix, causing it to load relative to cwd (([`110168a`][]) - -[`4f56bb6`]: https://github.com/browserify/resolve/commit/4f56bb67fa45d35adfa6a0022cc77afbf8117234 -[`110168a`]: https://github.com/browserify/resolve/commit/110168adae1dfbedcb9a12086cacf0ce68cc67f6 - -#### [v0.6.1](https://github.com/browserify/resolve/compare/v0.6.0...v0.6.1) - 27 November 2013 - -- merged the context error patches (([`8408e6e`][]) - -[`8408e6e`]: https://github.com/browserify/resolve/commit/8408e6e8902b4bec8c859d606f53366e42058378 - -#### [v0.6.0](https://github.com/browserify/resolve/compare/v0.5.1...v0.6.0) - 26 November 2013 - -- fixes #25: resolve modules with the same name as node stdlib modules ([`#25`][]) - -#### [v0.5.1](https://github.com/browserify/resolve/compare/v0.5.0...v0.5.1) - 22 September 2013 - -- Separate duplicated nodeModulesPaths function (([`325584a`][]) -- Fix prefix for windows azure (([`b5ba043`][]) - -[`325584a`]: https://github.com/browserify/resolve/commit/325584a685db8f42aae3d4876ffbe64069233601 -[`b5ba043`]: https://github.com/browserify/resolve/commit/b5ba0430b012d93367a4f87c304f1d4c8c22941c - -#### [v0.5.0](https://github.com/browserify/resolve/compare/v0.4.3...v0.5.0) - 2 September 2013 - -- opts.modules => opts.moduleDirectory, documented (([`c46593d`][]) -- modules folder name is configurable (([`d65a422`][]) - -[`c46593d`]: https://github.com/browserify/resolve/commit/c46593de74b256196d7ea12c85422698652cff10 -[`d65a422`]: https://github.com/browserify/resolve/commit/d65a42238101ea284ddafb788debdad0e5a59504 - -#### [v0.4.3](https://github.com/browserify/resolve/compare/v0.4.2...v0.4.3) - 7 August 2013 - -- Fix default basedir calculation (([`cd7169b`][]) -- use getCaller() in both async and sync versions (([`20f8945`][]) - -[`cd7169b`]: https://github.com/browserify/resolve/commit/cd7169b204b9f474b6a924adf47564f33a469f07 -[`20f8945`]: https://github.com/browserify/resolve/commit/20f89456f7fc1d8e51b95ec1ab38b1ac154d9fc4 - -#### [v0.4.2](https://github.com/browserify/resolve/compare/v0.4.1...v0.4.2) - 3 August 2013 - -- Failing test case for pkg.main pointing to a directory. (([`b57a75a`][]) -- Fix for failing test case where pkg.main points to directory. (([`8c4078c`][]) - -[`b57a75a`]: https://github.com/browserify/resolve/commit/b57a75aefc394ead20d54ed107741f1f7151b90f -[`8c4078c`]: https://github.com/browserify/resolve/commit/8c4078c9dd45c6a92f1f409d70aaccc95be3bfc6 - -#### [v0.4.1](https://github.com/browserify/resolve/compare/v0.4.0...v0.4.1) - 30 July 2013 - -- adding tests to reproduce the problem (([`ad3a477`][]) -- async resolve now falls back to 'index.js' if main field in package.json is incorrect (([`62a5726`][]) - -[`ad3a477`]: https://github.com/browserify/resolve/commit/ad3a4772ddd7187ff38cb56e00635b37a491e1fa -[`62a5726`]: https://github.com/browserify/resolve/commit/62a572635f21bf1c28360ea5c2238be62736429b - -#### [v0.4.0](https://github.com/browserify/resolve/compare/v0.3.1...v0.4.0) - 9 June 2013 - -- Implement async support for returning package a module was resolved from. (([`b7b2806`][]) -- Document package option. (([`7f84028`][]) - -[`b7b2806`]: https://github.com/browserify/resolve/commit/b7b28069acb7c749a2053dbb0c8d606515954694 -[`7f84028`]: https://github.com/browserify/resolve/commit/7f8402881b725938cfaf1d4835ec2fb6cee4862d - -#### [v0.3.1](https://github.com/browserify/resolve/compare/v0.3.0...v0.3.1) - 29 March 2013 - -- use isFIFO() instead to more narrowly target <() usage (([`790cdf5`][]) -- check !isDirectory() instead of isFile() so that <(echo "beep") inline bash fds work (([`c396065`][]) - -[`790cdf5`]: https://github.com/browserify/resolve/commit/790cdf5ab7c92bb146e8ace05ba0b26c5f51ffb3 -[`c396065`]: https://github.com/browserify/resolve/commit/c3960650f1a1417e52238011e08a6da2b0d9fee4 - -#### [v0.3.0](https://github.com/browserify/resolve/compare/v0.2.8...v0.3.0) - 19 February 2013 - -- failing translated async test with parameterized readFile on account of 3-arg form (([`7033bbb`][]) -- factor out .sync into lib/sync.js (([`ba7038a`][]) -- updated the docs for async (([`34a958e`][]) -- first async test passes (([`e427ca8`][]) -- sync parity with async tests (([`d1191a9`][]) -- stub out async (([`f4b02e3`][]) -- factor out core into lib/ (([`a800954`][]) -- synchronous example (([`3534992`][]) -- adapted async test (([`c9111d2`][]) -- async example (([`e1a9809`][]) -- fix for async parameterized readFile (([`2d4e80e`][]) -- drop 0.4, add 0.8 in travis (([`8a1ba59`][]) - -[`7033bbb`]: https://github.com/browserify/resolve/commit/7033bbb6e21ecfd13476ca8de247580aa2f97e7c -[`ba7038a`]: https://github.com/browserify/resolve/commit/ba7038a56d78212329b64287dfaf895b1a85cf2c -[`34a958e`]: https://github.com/browserify/resolve/commit/34a958e84b7fc4cdccd7b71f9a116027a6f3a123 -[`e427ca8`]: https://github.com/browserify/resolve/commit/e427ca85b7e3b1d01b05f94783b76516b8594a03 -[`d1191a9`]: https://github.com/browserify/resolve/commit/d1191a9958581a040f4f18b3aecdd50714bffc7a -[`f4b02e3`]: https://github.com/browserify/resolve/commit/f4b02e3bbf0c3b09f83cfb2b22b12b0f55afdf92 -[`a800954`]: https://github.com/browserify/resolve/commit/a80095482ef2d16425e6e12759c9735d89f7f50b -[`3534992`]: https://github.com/browserify/resolve/commit/3534992946294811d20aaf9857ee453078cbe828 -[`c9111d2`]: https://github.com/browserify/resolve/commit/c9111d293ab35fb611d9c65ea2f88ae8cf853f8e -[`e1a9809`]: https://github.com/browserify/resolve/commit/e1a98093094cded0a251ef36f4f2eb0adb280acb -[`2d4e80e`]: https://github.com/browserify/resolve/commit/2d4e80e139d01176bf70132bc80caed946cd6682 -[`8a1ba59`]: https://github.com/browserify/resolve/commit/8a1ba593ab924995a45099e164cc7b769c44e9a0 - -#### [v0.2.8](https://github.com/browserify/resolve/compare/v0.2.7...v0.2.8) - 18 February 2013 - -- add the domain module to .core (([`2979cde`][]) - -[`2979cde`]: https://github.com/browserify/resolve/commit/2979cdea615fe724de62d88cb221c1d1824d0f10 - -#### [v0.2.7](https://github.com/browserify/resolve/compare/v0.2.6...v0.2.7) - 18 February 2013 - -#### [v0.2.6](https://github.com/browserify/resolve/compare/v0.2.5...v0.2.6) - 18 February 2013 - -#### [v0.2.5](https://github.com/browserify/resolve/compare/v0.2.4...v0.2.5) - 18 February 2013 - -#### [v0.2.4](https://github.com/browserify/resolve/compare/v0.2.3...v0.2.4) - 18 February 2013 - -- resolve '../baz' correct (([`46fe923`][]) - -[`46fe923`]: https://github.com/browserify/resolve/commit/46fe923c20feeceac783e67cfa84d07222bc17fa - -#### [v0.2.3](https://github.com/browserify/resolve/compare/v0.2.2...v0.2.3) - 12 August 2012 - -- license file (([`a964396`][]) -- existsSync (([`d1c1012`][]) -- pass dir to packageFilter (([`3bea5b6`][]) -- pkg.main may be a directory (([`3521c2f`][]) -- Prioritize parent tree in nodeModulesPathsSync before fallback options.paths/ NODE_PATH equivalent, in accordance with http://nodejs.org/docs/latest/api/all.html#all_loading_from_the_global_folders (([`27fa227`][]) - -[`a964396`]: https://github.com/browserify/resolve/commit/a9643965438eb4fcb068a5876b317f516199879a -[`d1c1012`]: https://github.com/browserify/resolve/commit/d1c1012f14c50212ea49a9a1255c902f5ad6cb37 -[`3bea5b6`]: https://github.com/browserify/resolve/commit/3bea5b6475b39e7f4974d29c6fa1e8eb8b1589af -[`3521c2f`]: https://github.com/browserify/resolve/commit/3521c2f2b93234e5a50dc47598554a76589d6d8c -[`27fa227`]: https://github.com/browserify/resolve/commit/27fa22707e87738ddde61cb4ad90508cfe0d7755 - -#### [v0.2.2](https://github.com/browserify/resolve/compare/v0.2.1...v0.2.2) - 30 April 2012 - -- fix indentation (([`98fc4a5`][]) -- Updated to work with windows, tested on Windows 7 64-bit and OS X 10.6 (([`a6646cc`][]) -- bump for windows fixes (([`d67d595`][]) - -[`98fc4a5`]: https://github.com/browserify/resolve/commit/98fc4a50b68456d497a862b9c4e4e0a79570c770 -[`a6646cc`]: https://github.com/browserify/resolve/commit/a6646ccceb1a6c411d5b9dfdc97106c80d8a0a09 -[`d67d595`]: https://github.com/browserify/resolve/commit/d67d5959e1be31eb67d5b62e7050bff318572373 - -#### [v0.2.1](https://github.com/browserify/resolve/compare/v0.2.0...v0.2.1) - 12 April 2012 - -- now using tap (([`b625169`][]) -- using travis (([`30cc7b3`][]) -- split on multiple slashes (([`ebeafab`][]) -- fix splitting of paths to support windows as well (([`5e7e24b`][]) - -[`b625169`]: https://github.com/browserify/resolve/commit/b62516922eaaafe533806cd385017109ea057baa -[`30cc7b3`]: https://github.com/browserify/resolve/commit/30cc7b3af9299a0e08f34c314015a1395ef16ea3 -[`ebeafab`]: https://github.com/browserify/resolve/commit/ebeafab4a43c6ac4df7a8a7ee578629f81b7b9e7 -[`5e7e24b`]: https://github.com/browserify/resolve/commit/5e7e24bf11c48f14385886d7dd3661f786cc109b - -#### [v0.2.0](https://github.com/browserify/resolve/compare/v0.1.3...v0.2.0) - 25 February 2012 - -- updated the core list for 0.6.11 (([`12d4c16`][]) - -[`12d4c16`]: https://github.com/browserify/resolve/commit/12d4c164ef99bd35c13b0f566feaa70bc3560082 - -#### [v0.1.3](https://github.com/browserify/resolve/compare/v0.1.2...v0.1.3) - 14 December 2011 - -- bump (([`2dffd07`][]) -- Added readline to core modules (([`4ab55a2`][]) - -[`2dffd07`]: https://github.com/browserify/resolve/commit/2dffd072ce65b4aae4974e934ca5b58ec741f598 -[`4ab55a2`]: https://github.com/browserify/resolve/commit/4ab55a2d4eb95be2399fe94fd5d33879271b5a9f - -#### [v0.1.2](https://github.com/browserify/resolve/compare/v0.1.1...v0.1.2) - 31 October 2011 - -- Add opts.paths to list of node_modules directories (([`7bb6ef4`][]) -- bump (([`5e3fcc6`][]) - -[`7bb6ef4`]: https://github.com/browserify/resolve/commit/7bb6ef4a1805523169f30b6ea38776796a714c3a -[`5e3fcc6`]: https://github.com/browserify/resolve/commit/5e3fcc63cfec322779be5435820d3236e6d13dba - -#### [v0.1.1](https://github.com/browserify/resolve/compare/v0.1.0...v0.1.1) - 18 October 2011 - -- bump for windows paths (([`3fb86d0`][]) -- Added support for Windows-style paths. (([`638951e`][]) - -[`3fb86d0`]: https://github.com/browserify/resolve/commit/3fb86d07c77b09a7d6fa6d2a8b89432a070a6aa0 -[`638951e`]: https://github.com/browserify/resolve/commit/638951ed92fa4435d9752df30c3bcb9eb49573cd - -#### [v0.1.0](https://github.com/browserify/resolve/compare/v0.0.4...v0.1.0) - 3 October 2011 - -- passing mock test (([`030f0d3`][]) -- passing mock test with package.json (([`d2b19c8`][]) -- isFile and readFileSync as parameters (([`d30c22d`][]) -- doc updates and a minor bump for custom isFile and readFileSync params (([`b0af4c3`][]) - -[`030f0d3`]: https://github.com/browserify/resolve/commit/030f0d391e02558574bc673077fb1b4057f8358d -[`d2b19c8`]: https://github.com/browserify/resolve/commit/d2b19c893b7f8c63154c5b5ff2c419ffdc8baa0c -[`d30c22d`]: https://github.com/browserify/resolve/commit/d30c22d1e13b000016f2592d6d6f3489a2d29988 -[`b0af4c3`]: https://github.com/browserify/resolve/commit/b0af4c3ac1a51acf9995cb4e078bf5619f257952 - -#### [v0.0.4](https://github.com/browserify/resolve/compare/v0.0.3...v0.0.4) - 21 June 2011 - -- bump for packageFilter and a note in the docs (([`9fbb632`][]) -- new packageFilter option (([`c92c883`][]) - -[`9fbb632`]: https://github.com/browserify/resolve/commit/9fbb632a5c0c38641ed7c10399306a56651e0789 -[`c92c883`]: https://github.com/browserify/resolve/commit/c92c883bed3e50dd8ed9a2e1d4b9fefc9f3ced64 - -#### [v0.0.3](https://github.com/browserify/resolve/compare/v0.0.2...v0.0.3) - 20 June 2011 - -- custom extensions now work (([`502b6e9`][]) -- failing test for extensions (([`ce56f56`][]) -- bump and a note in the docs for extensions (([`2ad8287`][]) -- passing normalize test (([`055c7ce`][]) - -[`502b6e9`]: https://github.com/browserify/resolve/commit/502b6e9c8b9f258e5c943954467016e9c048fa0f -[`ce56f56`]: https://github.com/browserify/resolve/commit/ce56f56b4e1a5c1df495a7bf061fb0242103b4d8 -[`2ad8287`]: https://github.com/browserify/resolve/commit/2ad8287bc8b34929c2074a739410d08955ccdea7 -[`055c7ce`]: https://github.com/browserify/resolve/commit/055c7cea391ff0ce9cd8c585e8244f553b62f6e7 - -#### [v0.0.2](https://github.com/browserify/resolve/compare/v0.0.1...v0.0.2) - 19 June 2011 - -- failing biz test for going up and down the path directory (([`cf4f5a5`][]) -- don't stop on the first node_modules since that's going away in node anyhow, all tests pass again (([`9049abf`][]) - -[`cf4f5a5`]: https://github.com/browserify/resolve/commit/cf4f5a58d092124c517c55dd180559f5a444eb06 -[`9049abf`]: https://github.com/browserify/resolve/commit/9049abfb60cac49bb547b8ca02cc2617d406ff1a - -#### v0.0.1 - -- implementation seems to work but no tests yet (([`5218f01`][]) -- a package.json all up in this (([`4084043`][]) -- new resolve.{core,isCore} with tests and documentation, bump to 0.0.1 (([`a9ef081`][]) -- failing foo test (([`463b108`][]) -- readme before any code (([`7885443`][]) -- opts.path => opts.basedir, more descriptive I think (([`78010b1`][]) -- failing bar test (([`c40c5c1`][]) -- passing baz test to check package.json resolution (([`410635e`][]) -- a path.resolve() fixed the relative loads (([`dfef4b6`][]) -- passing the bar test after taking out the dirname() around y (([`eda2247`][]) -- trailing comma in the package.json (([`2032753`][]) - -[`5218f01`]: https://github.com/browserify/resolve/commit/5218f0106e78edce4cfb905d0ea4492ed3fd38af -[`4084043`]: https://github.com/browserify/resolve/commit/40840435a621120db78126c1792df7fdd0570703 -[`a9ef081`]: https://github.com/browserify/resolve/commit/a9ef081a4897e9882bf6bc6b31457c53b8d0fc0d -[`463b108`]: https://github.com/browserify/resolve/commit/463b108dd6e750196cba150348bd68397522c908 -[`7885443`]: https://github.com/browserify/resolve/commit/7885443d8a3dba7223b1bfca2d62cafc08a46436 -[`78010b1`]: https://github.com/browserify/resolve/commit/78010b1f91251447d1e74c6ac9cd0baebc6ddf60 -[`c40c5c1`]: https://github.com/browserify/resolve/commit/c40c5c14038acbe8bec91cf979d12382c2e6ddfe -[`410635e`]: https://github.com/browserify/resolve/commit/410635ef6226c030f74c4475e73724a01a102896 -[`dfef4b6`]: https://github.com/browserify/resolve/commit/dfef4b6185d02259c119a10c8a938e1ab148b140 -[`eda2247`]: https://github.com/browserify/resolve/commit/eda22479bd47c5d0b2e8a88851d9ffabbea2329c -[`2032753`]: https://github.com/browserify/resolve/commit/20327532053284676a269ec2441a87f16456fbf3 diff --git a/deps/npm/node_modules/normalize-package-data/node_modules/resolve/LICENSE b/deps/npm/node_modules/normalize-package-data/node_modules/resolve/LICENSE deleted file mode 100644 index ee27ba4b4412b0..00000000000000 --- a/deps/npm/node_modules/normalize-package-data/node_modules/resolve/LICENSE +++ /dev/null @@ -1,18 +0,0 @@ -This software is released under the MIT license: - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of -the Software, and to permit persons to whom the Software is furnished to do so, -subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/deps/npm/node_modules/normalize-package-data/node_modules/resolve/appveyor.yml b/deps/npm/node_modules/normalize-package-data/node_modules/resolve/appveyor.yml deleted file mode 100644 index cc73cc18f084b2..00000000000000 --- a/deps/npm/node_modules/normalize-package-data/node_modules/resolve/appveyor.yml +++ /dev/null @@ -1,47 +0,0 @@ -version: 1.0.{build} -skip_branch_with_pr: true -build: off - -environment: - matrix: - - nodejs_version: "9" - - nodejs_version: "8" - - nodejs_version: "7" - - nodejs_version: "6" - - nodejs_version: "5" - - nodejs_version: "4" - - nodejs_version: "3" - - nodejs_version: "2" - - nodejs_version: "1" - - nodejs_version: "0.12" - - nodejs_version: "0.10" - - nodejs_version: "0.8" - - nodejs_version: "0.6" -matrix: - # fast_finish: true - allow_failures: - - nodejs_version: "0.8" - - nodejs_version: "0.6" - -platform: - - x86 - - x64 - -# Install scripts. (runs after repo cloning) -install: - # Get the latest stable version of Node.js or io.js - - ps: Install-Product node $env:nodejs_version $env:platform - - IF %nodejs_version% EQU 0.6 npm config set strict-ssl false && npm -g install npm@1.3 - - IF %nodejs_version% EQU 0.8 npm config set strict-ssl false && npm -g install npm@1.4.28 && npm install -g npm@4.5 - - set PATH=%APPDATA%\npm;%PATH% - #- IF %nodejs_version% NEQ 0.6 AND %nodejs_version% NEQ 0.8 npm -g install npm - # install modules - - npm install - -# Post-install test scripts. -test_script: - # Output useful info for debugging. - - node --version - - npm --version - # run tests - - npm run tests-only diff --git a/deps/npm/node_modules/normalize-package-data/node_modules/resolve/changelog.hbs b/deps/npm/node_modules/normalize-package-data/node_modules/resolve/changelog.hbs deleted file mode 100644 index addd7816b3fdbd..00000000000000 --- a/deps/npm/node_modules/normalize-package-data/node_modules/resolve/changelog.hbs +++ /dev/null @@ -1,36 +0,0 @@ -### Changelog - -All notable changes to this project will be documented in this file. Dates are displayed in UTC. -{{#each releases}} - - {{#if href}} - ###{{#unless major}}#{{/unless}} [{{title}}]({{href}}){{#if tag}} - {{niceDate}}{{/if}} - {{else}} - #### {{title}} - {{/if}} - - {{#if summary}} - Summary: - {{summary}} - {{/if}} - - {{#each fixes}} - - {{{commit.subject}}} ({{#each fixes}}{{#if href}}[`#{{id}}`][]{{/if}}{{/each}}) - {{/each}} - {{#each merges}} - - {{{message}}}{{#if href}} ([`#{{id}}`][]){{/if}} - {{/each}} - {{#each commits}} - - {{#if breaking}}**Breaking change:** {{/if}}{{{subject}}}{{#if href}} (([`{{shorthash}}`][]){{/if}} - {{/each}} - - {{#each fixes}} -{{#if href}}[`#{{id}}`]: {{href}}{{/if}} - {{/each}} - {{#each merges}} -{{#if href}}[`#{{id}}`]: {{href}}{{/if}} - {{/each}} - {{#each commits}} -{{#if href}}[`{{shorthash}}`]: {{href}}{{/if}} - {{/each}} -{{/each}} diff --git a/deps/npm/node_modules/normalize-package-data/node_modules/resolve/index.js b/deps/npm/node_modules/normalize-package-data/node_modules/resolve/index.js deleted file mode 100644 index eb6ba89e6c210c..00000000000000 --- a/deps/npm/node_modules/normalize-package-data/node_modules/resolve/index.js +++ /dev/null @@ -1,8 +0,0 @@ -var core = require('./lib/core'); -var async = require('./lib/async'); -async.core = core; -async.isCore = function isCore(x) { return core[x]; }; -async.sync = require('./lib/sync'); - -exports = async; -module.exports = async; diff --git a/deps/npm/node_modules/normalize-package-data/node_modules/resolve/lib/async.js b/deps/npm/node_modules/normalize-package-data/node_modules/resolve/lib/async.js deleted file mode 100644 index 54211cc66e2d2d..00000000000000 --- a/deps/npm/node_modules/normalize-package-data/node_modules/resolve/lib/async.js +++ /dev/null @@ -1,229 +0,0 @@ -var core = require('./core'); -var fs = require('fs'); -var path = require('path'); -var caller = require('./caller.js'); -var nodeModulesPaths = require('./node-modules-paths.js'); -var normalizeOptions = require('./normalize-options.js'); - -var defaultIsFile = function isFile(file, cb) { - fs.stat(file, function (err, stat) { - if (!err) { - return cb(null, stat.isFile() || stat.isFIFO()); - } - if (err.code === 'ENOENT' || err.code === 'ENOTDIR') return cb(null, false); - return cb(err); - }); -}; - -module.exports = function resolve(x, options, callback) { - var cb = callback; - var opts = options; - if (typeof options === 'function') { - cb = opts; - opts = {}; - } - if (typeof x !== 'string') { - var err = new TypeError('Path must be a string.'); - return process.nextTick(function () { - cb(err); - }); - } - - opts = normalizeOptions(x, opts); - - var isFile = opts.isFile || defaultIsFile; - var readFile = opts.readFile || fs.readFile; - - var extensions = opts.extensions || ['.js']; - var basedir = opts.basedir || path.dirname(caller()); - var parent = opts.filename || basedir; - - opts.paths = opts.paths || []; - - // ensure that `basedir` is an absolute path at this point, resolving against the process' current working directory - var absoluteStart = path.resolve(basedir); - - if (opts.preserveSymlinks === false) { - fs.realpath(absoluteStart, function (realPathErr, realStart) { - if (realPathErr && realPathErr.code !== 'ENOENT') cb(err); - else init(realPathErr ? absoluteStart : realStart); - }); - } else { - init(absoluteStart); - } - - var res; - function init(basedir) { - if ((/^(?:\.\.?(?:\/|$)|\/|([A-Za-z]:)?[/\\])/).test(x)) { - res = path.resolve(basedir, x); - if (x === '..' || x.slice(-1) === '/') res += '/'; - if ((/\/$/).test(x) && res === basedir) { - loadAsDirectory(res, opts.package, onfile); - } else loadAsFile(res, opts.package, onfile); - } else loadNodeModules(x, basedir, function (err, n, pkg) { - if (err) cb(err); - else if (n) cb(null, n, pkg); - else if (core[x]) return cb(null, x); - else { - var moduleError = new Error("Cannot find module '" + x + "' from '" + parent + "'"); - moduleError.code = 'MODULE_NOT_FOUND'; - cb(moduleError); - } - }); - } - - function onfile(err, m, pkg) { - if (err) cb(err); - else if (m) cb(null, m, pkg); - else loadAsDirectory(res, function (err, d, pkg) { - if (err) cb(err); - else if (d) cb(null, d, pkg); - else { - var moduleError = new Error("Cannot find module '" + x + "' from '" + parent + "'"); - moduleError.code = 'MODULE_NOT_FOUND'; - cb(moduleError); - } - }); - } - - function loadAsFile(x, thePackage, callback) { - var loadAsFilePackage = thePackage; - var cb = callback; - if (typeof loadAsFilePackage === 'function') { - cb = loadAsFilePackage; - loadAsFilePackage = undefined; - } - - var exts = [''].concat(extensions); - load(exts, x, loadAsFilePackage); - - function load(exts, x, loadPackage) { - if (exts.length === 0) return cb(null, undefined, loadPackage); - var file = x + exts[0]; - - var pkg = loadPackage; - if (pkg) onpkg(null, pkg); - else loadpkg(path.dirname(file), onpkg); - - function onpkg(err, pkg_, dir) { - pkg = pkg_; - if (err) return cb(err); - if (dir && pkg && opts.pathFilter) { - var rfile = path.relative(dir, file); - var rel = rfile.slice(0, rfile.length - exts[0].length); - var r = opts.pathFilter(pkg, x, rel); - if (r) return load( - [''].concat(extensions.slice()), - path.resolve(dir, r), - pkg - ); - } - isFile(file, onex); - } - function onex(err, ex) { - if (err) return cb(err); - if (ex) return cb(null, file, pkg); - load(exts.slice(1), x, pkg); - } - } - } - - function loadpkg(dir, cb) { - if (dir === '' || dir === '/') return cb(null); - if (process.platform === 'win32' && (/^\w:[/\\]*$/).test(dir)) { - return cb(null); - } - if ((/[/\\]node_modules[/\\]*$/).test(dir)) return cb(null); - - var pkgfile = path.join(dir, 'package.json'); - isFile(pkgfile, function (err, ex) { - // on err, ex is false - if (!ex) return loadpkg(path.dirname(dir), cb); - - readFile(pkgfile, function (err, body) { - if (err) cb(err); - try { var pkg = JSON.parse(body); } catch (jsonErr) {} - - if (pkg && opts.packageFilter) { - pkg = opts.packageFilter(pkg, pkgfile); - } - cb(null, pkg, dir); - }); - }); - } - - function loadAsDirectory(x, loadAsDirectoryPackage, callback) { - var cb = callback; - var fpkg = loadAsDirectoryPackage; - if (typeof fpkg === 'function') { - cb = fpkg; - fpkg = opts.package; - } - - var pkgfile = path.join(x, 'package.json'); - isFile(pkgfile, function (err, ex) { - if (err) return cb(err); - if (!ex) return loadAsFile(path.join(x, 'index'), fpkg, cb); - - readFile(pkgfile, function (err, body) { - if (err) return cb(err); - try { - var pkg = JSON.parse(body); - } catch (jsonErr) {} - - if (opts.packageFilter) { - pkg = opts.packageFilter(pkg, pkgfile); - } - - if (pkg.main) { - if (typeof pkg.main !== 'string') { - var mainError = new TypeError('package “' + pkg.name + '” `main` must be a string'); - mainError.code = 'INVALID_PACKAGE_MAIN'; - return cb(mainError); - } - if (pkg.main === '.' || pkg.main === './') { - pkg.main = 'index'; - } - loadAsFile(path.resolve(x, pkg.main), pkg, function (err, m, pkg) { - if (err) return cb(err); - if (m) return cb(null, m, pkg); - if (!pkg) return loadAsFile(path.join(x, 'index'), pkg, cb); - - var dir = path.resolve(x, pkg.main); - loadAsDirectory(dir, pkg, function (err, n, pkg) { - if (err) return cb(err); - if (n) return cb(null, n, pkg); - loadAsFile(path.join(x, 'index'), pkg, cb); - }); - }); - return; - } - - loadAsFile(path.join(x, '/index'), pkg, cb); - }); - }); - } - - function processDirs(cb, dirs) { - if (dirs.length === 0) return cb(null, undefined); - var dir = dirs[0]; - - var file = path.join(dir, x); - loadAsFile(file, opts.package, onfile); - - function onfile(err, m, pkg) { - if (err) return cb(err); - if (m) return cb(null, m, pkg); - loadAsDirectory(path.join(dir, x), opts.package, ondir); - } - - function ondir(err, n, pkg) { - if (err) return cb(err); - if (n) return cb(null, n, pkg); - processDirs(cb, dirs.slice(1)); - } - } - function loadNodeModules(x, start, cb) { - processDirs(cb, nodeModulesPaths(start, opts, x)); - } -}; diff --git a/deps/npm/node_modules/normalize-package-data/node_modules/resolve/lib/core.json b/deps/npm/node_modules/normalize-package-data/node_modules/resolve/lib/core.json deleted file mode 100644 index 1575db31b0eb2f..00000000000000 --- a/deps/npm/node_modules/normalize-package-data/node_modules/resolve/lib/core.json +++ /dev/null @@ -1,73 +0,0 @@ -{ - "assert": true, - "async_hooks": ">= 8", - "buffer_ieee754": "< 0.9.7", - "buffer": true, - "child_process": true, - "cluster": true, - "console": true, - "constants": true, - "crypto": true, - "_debugger": "< 8", - "dgram": true, - "dns": true, - "domain": true, - "events": true, - "freelist": "< 6", - "fs": true, - "fs/promises": ">= 10 && < 10.1", - "_http_agent": ">= 0.11.1", - "_http_client": ">= 0.11.1", - "_http_common": ">= 0.11.1", - "_http_incoming": ">= 0.11.1", - "_http_outgoing": ">= 0.11.1", - "_http_server": ">= 0.11.1", - "http": true, - "http2": ">= 8.8", - "https": true, - "inspector": ">= 8.0.0", - "_linklist": "< 8", - "module": true, - "net": true, - "node-inspect/lib/_inspect": ">= 7.6.0", - "node-inspect/lib/internal/inspect_client": ">= 7.6.0", - "node-inspect/lib/internal/inspect_repl": ">= 7.6.0", - "os": true, - "path": true, - "perf_hooks": ">= 8.5", - "process": ">= 1", - "punycode": true, - "querystring": true, - "readline": true, - "repl": true, - "smalloc": ">= 0.11.5 && < 3", - "_stream_duplex": ">= 0.9.4", - "_stream_transform": ">= 0.9.4", - "_stream_wrap": ">= 1.4.1", - "_stream_passthrough": ">= 0.9.4", - "_stream_readable": ">= 0.9.4", - "_stream_writable": ">= 0.9.4", - "stream": true, - "string_decoder": true, - "sys": true, - "timers": true, - "_tls_common": ">= 0.11.13", - "_tls_legacy": ">= 0.11.3 && < 10", - "_tls_wrap": ">= 0.11.3", - "tls": true, - "trace_events": ">= 10", - "tty": true, - "url": true, - "util": true, - "v8/tools/arguments": ">= 10", - "v8/tools/codemap": [">= 4.4.0 && < 5", ">= 5.2.0"], - "v8/tools/consarray": [">= 4.4.0 && < 5", ">= 5.2.0"], - "v8/tools/csvparser": [">= 4.4.0 && < 5", ">= 5.2.0"], - "v8/tools/logreader": [">= 4.4.0 && < 5", ">= 5.2.0"], - "v8/tools/profile_view": [">= 4.4.0 && < 5", ">= 5.2.0"], - "v8/tools/splaytree": [">= 4.4.0 && < 5", ">= 5.2.0"], - "v8": ">= 1", - "vm": true, - "worker_threads": ">= 11.7", - "zlib": true -} diff --git a/deps/npm/node_modules/normalize-package-data/node_modules/resolve/lib/node-modules-paths.js b/deps/npm/node_modules/normalize-package-data/node_modules/resolve/lib/node-modules-paths.js deleted file mode 100644 index df50f48baf4304..00000000000000 --- a/deps/npm/node_modules/normalize-package-data/node_modules/resolve/lib/node-modules-paths.js +++ /dev/null @@ -1,42 +0,0 @@ -var path = require('path'); -var parse = path.parse || require('path-parse'); - -var getNodeModulesDirs = function getNodeModulesDirs(absoluteStart, modules) { - var prefix = '/'; - if ((/^([A-Za-z]:)/).test(absoluteStart)) { - prefix = ''; - } else if ((/^\\\\/).test(absoluteStart)) { - prefix = '\\\\'; - } - - var paths = [absoluteStart]; - var parsed = parse(absoluteStart); - while (parsed.dir !== paths[paths.length - 1]) { - paths.push(parsed.dir); - parsed = parse(parsed.dir); - } - - return paths.reduce(function (dirs, aPath) { - return dirs.concat(modules.map(function (moduleDir) { - return path.join(prefix, aPath, moduleDir); - })); - }, []); -}; - -module.exports = function nodeModulesPaths(start, opts, request) { - var modules = opts && opts.moduleDirectory - ? [].concat(opts.moduleDirectory) - : ['node_modules']; - - if (opts && typeof opts.paths === 'function') { - return opts.paths( - request, - start, - function () { return getNodeModulesDirs(start, modules); }, - opts - ); - } - - var dirs = getNodeModulesDirs(start, modules); - return opts && opts.paths ? dirs.concat(opts.paths) : dirs; -}; diff --git a/deps/npm/node_modules/normalize-package-data/node_modules/resolve/lib/sync.js b/deps/npm/node_modules/normalize-package-data/node_modules/resolve/lib/sync.js deleted file mode 100644 index 33ad5da2f69ac7..00000000000000 --- a/deps/npm/node_modules/normalize-package-data/node_modules/resolve/lib/sync.js +++ /dev/null @@ -1,154 +0,0 @@ -var core = require('./core'); -var fs = require('fs'); -var path = require('path'); -var caller = require('./caller.js'); -var nodeModulesPaths = require('./node-modules-paths.js'); -var normalizeOptions = require('./normalize-options.js'); - -var defaultIsFile = function isFile(file) { - try { - var stat = fs.statSync(file); - } catch (e) { - if (e && (e.code === 'ENOENT' || e.code === 'ENOTDIR')) return false; - throw e; - } - return stat.isFile() || stat.isFIFO(); -}; - -module.exports = function (x, options) { - if (typeof x !== 'string') { - throw new TypeError('Path must be a string.'); - } - var opts = normalizeOptions(x, options); - - var isFile = opts.isFile || defaultIsFile; - var readFileSync = opts.readFileSync || fs.readFileSync; - - var extensions = opts.extensions || ['.js']; - var basedir = opts.basedir || path.dirname(caller()); - var parent = opts.filename || basedir; - - opts.paths = opts.paths || []; - - // ensure that `basedir` is an absolute path at this point, resolving against the process' current working directory - var absoluteStart = path.resolve(basedir); - - if (opts.preserveSymlinks === false) { - try { - absoluteStart = fs.realpathSync(absoluteStart); - } catch (realPathErr) { - if (realPathErr.code !== 'ENOENT') { - throw realPathErr; - } - } - } - - if ((/^(?:\.\.?(?:\/|$)|\/|([A-Za-z]:)?[/\\])/).test(x)) { - var res = path.resolve(absoluteStart, x); - if (x === '..' || x.slice(-1) === '/') res += '/'; - var m = loadAsFileSync(res) || loadAsDirectorySync(res); - if (m) return m; - } else { - var n = loadNodeModulesSync(x, absoluteStart); - if (n) return n; - } - - if (core[x]) return x; - - var err = new Error("Cannot find module '" + x + "' from '" + parent + "'"); - err.code = 'MODULE_NOT_FOUND'; - throw err; - - function loadAsFileSync(x) { - var pkg = loadpkg(path.dirname(x)); - - if (pkg && pkg.dir && pkg.pkg && opts.pathFilter) { - var rfile = path.relative(pkg.dir, x); - var r = opts.pathFilter(pkg.pkg, x, rfile); - if (r) { - x = path.resolve(pkg.dir, r); // eslint-disable-line no-param-reassign - } - } - - if (isFile(x)) { - return x; - } - - for (var i = 0; i < extensions.length; i++) { - var file = x + extensions[i]; - if (isFile(file)) { - return file; - } - } - } - - function loadpkg(dir) { - if (dir === '' || dir === '/') return; - if (process.platform === 'win32' && (/^\w:[/\\]*$/).test(dir)) { - return; - } - if ((/[/\\]node_modules[/\\]*$/).test(dir)) return; - - var pkgfile = path.join(dir, 'package.json'); - - if (!isFile(pkgfile)) { - return loadpkg(path.dirname(dir)); - } - - var body = readFileSync(pkgfile); - - try { - var pkg = JSON.parse(body); - } catch (jsonErr) {} - - if (pkg && opts.packageFilter) { - pkg = opts.packageFilter(pkg, dir); - } - - return { pkg: pkg, dir: dir }; - } - - function loadAsDirectorySync(x) { - var pkgfile = path.join(x, '/package.json'); - if (isFile(pkgfile)) { - try { - var body = readFileSync(pkgfile, 'UTF8'); - var pkg = JSON.parse(body); - } catch (e) {} - - if (opts.packageFilter) { - pkg = opts.packageFilter(pkg, x); - } - - if (pkg.main) { - if (typeof pkg.main !== 'string') { - var mainError = new TypeError('package “' + pkg.name + '” `main` must be a string'); - mainError.code = 'INVALID_PACKAGE_MAIN'; - throw mainError; - } - if (pkg.main === '.' || pkg.main === './') { - pkg.main = 'index'; - } - try { - var m = loadAsFileSync(path.resolve(x, pkg.main)); - if (m) return m; - var n = loadAsDirectorySync(path.resolve(x, pkg.main)); - if (n) return n; - } catch (e) {} - } - } - - return loadAsFileSync(path.join(x, '/index')); - } - - function loadNodeModulesSync(x, start) { - var dirs = nodeModulesPaths(start, opts, x); - for (var i = 0; i < dirs.length; i++) { - var dir = dirs[i]; - var m = loadAsFileSync(path.join(dir, '/', x)); - if (m) return m; - var n = loadAsDirectorySync(path.join(dir, '/', x)); - if (n) return n; - } - } -}; diff --git a/deps/npm/node_modules/normalize-package-data/node_modules/resolve/package.json b/deps/npm/node_modules/normalize-package-data/node_modules/resolve/package.json deleted file mode 100644 index a736a535f19897..00000000000000 --- a/deps/npm/node_modules/normalize-package-data/node_modules/resolve/package.json +++ /dev/null @@ -1,71 +0,0 @@ -{ - "_from": "resolve@^1.10.0", - "_id": "resolve@1.10.0", - "_inBundle": false, - "_integrity": "sha512-3sUr9aq5OfSg2S9pNtPA9hL1FVEAjvfOC4leW0SNf/mpnaakz2a9femSd6LqAww2RaFctwyf1lCqnTHuF1rxDg==", - "_location": "/normalize-package-data/resolve", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "resolve@^1.10.0", - "name": "resolve", - "escapedName": "resolve", - "rawSpec": "^1.10.0", - "saveSpec": null, - "fetchSpec": "^1.10.0" - }, - "_requiredBy": [ - "/normalize-package-data" - ], - "_resolved": "https://registry.npmjs.org/resolve/-/resolve-1.10.0.tgz", - "_shasum": "3bdaaeaf45cc07f375656dfd2e54ed0810b101ba", - "_spec": "resolve@^1.10.0", - "_where": "/Users/aeschright/code/npm-release/node_modules/normalize-package-data", - "author": { - "name": "James Halliday", - "email": "mail@substack.net", - "url": "http://substack.net" - }, - "bugs": { - "url": "https://github.com/browserify/resolve/issues" - }, - "bundleDependencies": false, - "dependencies": { - "path-parse": "^1.0.6" - }, - "deprecated": false, - "description": "resolve like require.resolve() on behalf of files asynchronously and synchronously", - "devDependencies": { - "@ljharb/eslint-config": "^13.1.1", - "eslint": "^5.12.0", - "object-keys": "^1.0.12", - "safe-publish-latest": "^1.1.2", - "tap": "0.4.13", - "tape": "^4.9.2" - }, - "homepage": "https://github.com/browserify/resolve#readme", - "keywords": [ - "resolve", - "require", - "node", - "module" - ], - "license": "MIT", - "main": "index.js", - "name": "resolve", - "repository": { - "type": "git", - "url": "git://github.com/browserify/resolve.git" - }, - "scripts": { - "lint": "eslint .", - "posttest": "npm run test:multirepo", - "prepublish": "safe-publish-latest", - "pretest": "npm run lint", - "test": "npm run --silent tests-only", - "test:multirepo": "cd ./test/resolver/multirepo && npm install && npm test", - "tests-only": "tape test/*.js" - }, - "version": "1.10.0" -} diff --git a/deps/npm/node_modules/normalize-package-data/node_modules/resolve/readme.markdown b/deps/npm/node_modules/normalize-package-data/node_modules/resolve/readme.markdown deleted file mode 100644 index 95be0f97a0f85c..00000000000000 --- a/deps/npm/node_modules/normalize-package-data/node_modules/resolve/readme.markdown +++ /dev/null @@ -1,179 +0,0 @@ -# resolve - -implements the [node `require.resolve()` -algorithm](https://nodejs.org/api/modules.html#modules_all_together) -such that you can `require.resolve()` on behalf of a file asynchronously and -synchronously - -[![build status](https://secure.travis-ci.org/browserify/node-resolve.png)](http://travis-ci.org/browserify/node-resolve) - -# example - -asynchronously resolve: - -```js -var resolve = require('resolve'); -resolve('tap', { basedir: __dirname }, function (err, res) { - if (err) console.error(err); - else console.log(res); -}); -``` - -``` -$ node example/async.js -/home/substack/projects/node-resolve/node_modules/tap/lib/main.js -``` - -synchronously resolve: - -```js -var resolve = require('resolve'); -var res = resolve.sync('tap', { basedir: __dirname }); -console.log(res); -``` - -``` -$ node example/sync.js -/home/substack/projects/node-resolve/node_modules/tap/lib/main.js -``` - -# methods - -```js -var resolve = require('resolve'); -``` - -## resolve(id, opts={}, cb) - -Asynchronously resolve the module path string `id` into `cb(err, res [, pkg])`, where `pkg` (if defined) is the data from `package.json`. - -options are: - -* opts.basedir - directory to begin resolving from - -* opts.package - `package.json` data applicable to the module being loaded - -* opts.extensions - array of file extensions to search in order - -* opts.readFile - how to read files asynchronously - -* opts.isFile - function to asynchronously test whether a file exists - -* `opts.packageFilter(pkg, pkgfile)` - transform the parsed package.json contents before looking at the "main" field - * pkg - package data - * pkgfile - path to package.json - -* `opts.pathFilter(pkg, path, relativePath)` - transform a path within a package - * pkg - package data - * path - the path being resolved - * relativePath - the path relative from the package.json location - * returns - a relative path that will be joined from the package.json location - -* opts.paths - require.paths array to use if nothing is found on the normal `node_modules` recursive walk (probably don't use this) - - For advanced users, `paths` can also be a `opts.paths(request, start, opts)` function - * request - the import specifier being resolved - * start - lookup path - * getNodeModulesDirs - a thunk (no-argument function) that returns the paths using standard `node_modules` resolution - * opts - the resolution options - -* opts.moduleDirectory - directory (or directories) in which to recursively look for modules. default: `"node_modules"` - -* opts.preserveSymlinks - if true, doesn't resolve `basedir` to real path before resolving. -This is the way Node resolves dependencies when executed with the [--preserve-symlinks](https://nodejs.org/api/all.html#cli_preserve_symlinks) flag. -**Note:** this property is currently `true` by default but it will be changed to -`false` in the next major version because *Node's resolution algorithm does not preserve symlinks by default*. - -default `opts` values: - -```js -{ - paths: [], - basedir: __dirname, - extensions: ['.js'], - readFile: fs.readFile, - isFile: function isFile(file, cb) { - fs.stat(file, function (err, stat) { - if (!err) { - return cb(null, stat.isFile() || stat.isFIFO()); - } - if (err.code === 'ENOENT' || err.code === 'ENOTDIR') return cb(null, false); - return cb(err); - }); - }, - moduleDirectory: 'node_modules', - preserveSymlinks: true -} -``` - -## resolve.sync(id, opts) - -Synchronously resolve the module path string `id`, returning the result and -throwing an error when `id` can't be resolved. - -options are: - -* opts.basedir - directory to begin resolving from - -* opts.extensions - array of file extensions to search in order - -* opts.readFile - how to read files synchronously - -* opts.isFile - function to synchronously test whether a file exists - -* `opts.packageFilter(pkg, dir)` - transform the parsed package.json contents before looking at the "main" field - * pkg - package data - * dir - directory for package.json (Note: the second argument will change to "pkgfile" in v2) - -* `opts.pathFilter(pkg, path, relativePath)` - transform a path within a package - * pkg - package data - * path - the path being resolved - * relativePath - the path relative from the package.json location - * returns - a relative path that will be joined from the package.json location - -* opts.paths - require.paths array to use if nothing is found on the normal `node_modules` recursive walk (probably don't use this) - -* opts.moduleDirectory - directory (or directories) in which to recursively look for modules. default: `"node_modules"` - -* opts.preserveSymlinks - if true, doesn't resolve `basedir` to real path before resolving. -This is the way Node resolves dependencies when executed with the [--preserve-symlinks](https://nodejs.org/api/all.html#cli_preserve_symlinks) flag. -**Note:** this property is currently `true` by default but it will be changed to -`false` in the next major version because *Node's resolution algorithm does not preserve symlinks by default*. - -default `opts` values: - -```js -{ - paths: [], - basedir: __dirname, - extensions: ['.js'], - readFileSync: fs.readFileSync, - isFile: function isFile(file) { - try { - var stat = fs.statSync(file); - } catch (e) { - if (e && (e.code === 'ENOENT' || e.code === 'ENOTDIR')) return false; - throw e; - } - return stat.isFile() || stat.isFIFO(); - }, - moduleDirectory: 'node_modules', - preserveSymlinks: true -} -``` - -## resolve.isCore(pkg) - -Return whether a package is in core. - -# install - -With [npm](https://npmjs.org) do: - -```sh -npm install resolve -``` - -# license - -MIT diff --git a/deps/npm/node_modules/normalize-package-data/node_modules/resolve/test/core.js b/deps/npm/node_modules/normalize-package-data/node_modules/resolve/test/core.js deleted file mode 100644 index 33d9f329499c61..00000000000000 --- a/deps/npm/node_modules/normalize-package-data/node_modules/resolve/test/core.js +++ /dev/null @@ -1,82 +0,0 @@ -var test = require('tape'); -var keys = require('object-keys'); -var resolve = require('../'); - -test('core modules', function (t) { - t.test('isCore()', function (st) { - st.ok(resolve.isCore('fs')); - st.ok(resolve.isCore('net')); - st.ok(resolve.isCore('http')); - - st.ok(!resolve.isCore('seq')); - st.ok(!resolve.isCore('../')); - st.end(); - }); - - t.test('core list', function (st) { - var cores = keys(resolve.core); - st.plan(cores.length); - - for (var i = 0; i < cores.length; ++i) { - var mod = cores[i]; - if (resolve.core[mod]) { - st.doesNotThrow( - function () { require(mod); }, // eslint-disable-line no-loop-func - mod + ' supported; requiring does not throw' - ); - } else { - st.throws( - function () { require(mod); }, // eslint-disable-line no-loop-func - mod + ' not supported; requiring throws' - ); - } - } - - st.end(); - }); - - t.test('core via repl module', { skip: !resolve.core.repl }, function (st) { - var libs = require('repl')._builtinLibs; // eslint-disable-line no-underscore-dangle - if (!libs) { - st.skip('module.builtinModules does not exist'); - return st.end(); - } - for (var i = 0; i < libs.length; ++i) { - var mod = libs[i]; - st.ok(resolve.core[mod], mod + ' is a core module'); - st.doesNotThrow( - function () { require(mod); }, // eslint-disable-line no-loop-func - 'requiring ' + mod + ' does not throw' - ); - } - st.end(); - }); - - t.test('core via builtinModules list', { skip: !resolve.core.module }, function (st) { - var libs = require('module').builtinModules; - if (!libs) { - st.skip('module.builtinModules does not exist'); - return st.end(); - } - var blacklist = [ - '_debug_agent', - 'v8/tools/tickprocessor-driver', - 'v8/tools/SourceMap', - 'v8/tools/tickprocessor', - 'v8/tools/profile' - ]; - for (var i = 0; i < libs.length; ++i) { - var mod = libs[i]; - if (blacklist.indexOf(mod) === -1) { - st.ok(resolve.core[mod], mod + ' is a core module'); - st.doesNotThrow( - function () { require(mod); }, // eslint-disable-line no-loop-func - 'requiring ' + mod + ' does not throw' - ); - } - } - st.end(); - }); - - t.end(); -}); diff --git a/deps/npm/node_modules/normalize-package-data/node_modules/resolve/test/filter.js b/deps/npm/node_modules/normalize-package-data/node_modules/resolve/test/filter.js deleted file mode 100644 index dfc622a874e165..00000000000000 --- a/deps/npm/node_modules/normalize-package-data/node_modules/resolve/test/filter.js +++ /dev/null @@ -1,34 +0,0 @@ -var path = require('path'); -var test = require('tape'); -var resolve = require('../'); - -test('filter', function (t) { - t.plan(4); - var dir = path.join(__dirname, 'resolver'); - var packageFilterArgs; - resolve('./baz', { - basedir: dir, - packageFilter: function (pkg, pkgfile) { - pkg.main = 'doom'; - packageFilterArgs = [pkg, pkgfile]; - return pkg; - } - }, function (err, res, pkg) { - if (err) t.fail(err); - - t.equal(res, path.join(dir, 'baz/doom.js'), 'changing the package "main" works'); - - var packageData = packageFilterArgs[0]; - t.equal(pkg, packageData, 'first packageFilter argument is "pkg"'); - t.equal(packageData.main, 'doom', 'package "main" was altered'); - - var packageFile = packageFilterArgs[1]; - t.equal( - packageFile, - path.join(dir, 'baz/package.json'), - 'second packageFilter argument is "pkgfile"' - ); - - t.end(); - }); -}); diff --git a/deps/npm/node_modules/normalize-package-data/node_modules/resolve/test/filter_sync.js b/deps/npm/node_modules/normalize-package-data/node_modules/resolve/test/filter_sync.js deleted file mode 100644 index 064052e160ff17..00000000000000 --- a/deps/npm/node_modules/normalize-package-data/node_modules/resolve/test/filter_sync.js +++ /dev/null @@ -1,26 +0,0 @@ -var path = require('path'); -var test = require('tape'); -var resolve = require('../'); - -test('filter', function (t) { - var dir = path.join(__dirname, 'resolver'); - var packageFilterArgs; - var res = resolve.sync('./baz', { - basedir: dir, - packageFilter: function (pkg, dir) { - pkg.main = 'doom'; - packageFilterArgs = [pkg, dir]; - return pkg; - } - }); - - t.equal(res, path.join(dir, 'baz/doom.js'), 'changing the package "main" works'); - - var packageData = packageFilterArgs[0]; - t.equal(packageData.main, 'doom', 'package "main" was altered'); - - var packageFile = packageFilterArgs[1]; - t.equal(packageFile, path.join(dir, 'baz'), 'second packageFilter argument is "dir"'); - - t.end(); -}); diff --git a/deps/npm/node_modules/normalize-package-data/node_modules/resolve/test/mock.js b/deps/npm/node_modules/normalize-package-data/node_modules/resolve/test/mock.js deleted file mode 100644 index a88059d4539197..00000000000000 --- a/deps/npm/node_modules/normalize-package-data/node_modules/resolve/test/mock.js +++ /dev/null @@ -1,143 +0,0 @@ -var path = require('path'); -var test = require('tape'); -var resolve = require('../'); - -test('mock', function (t) { - t.plan(8); - - var files = {}; - files[path.resolve('/foo/bar/baz.js')] = 'beep'; - - function opts(basedir) { - return { - basedir: path.resolve(basedir), - isFile: function (file, cb) { - cb(null, Object.prototype.hasOwnProperty.call(files, path.resolve(file))); - }, - readFile: function (file, cb) { - cb(null, files[path.resolve(file)]); - } - }; - } - - resolve('./baz', opts('/foo/bar'), function (err, res, pkg) { - if (err) return t.fail(err); - t.equal(res, path.resolve('/foo/bar/baz.js')); - t.equal(pkg, undefined); - }); - - resolve('./baz.js', opts('/foo/bar'), function (err, res, pkg) { - if (err) return t.fail(err); - t.equal(res, path.resolve('/foo/bar/baz.js')); - t.equal(pkg, undefined); - }); - - resolve('baz', opts('/foo/bar'), function (err, res) { - t.equal(err.message, "Cannot find module 'baz' from '" + path.resolve('/foo/bar') + "'"); - t.equal(err.code, 'MODULE_NOT_FOUND'); - }); - - resolve('../baz', opts('/foo/bar'), function (err, res) { - t.equal(err.message, "Cannot find module '../baz' from '" + path.resolve('/foo/bar') + "'"); - t.equal(err.code, 'MODULE_NOT_FOUND'); - }); -}); - -test('mock from package', function (t) { - t.plan(8); - - var files = {}; - files[path.resolve('/foo/bar/baz.js')] = 'beep'; - - function opts(basedir) { - return { - basedir: path.resolve(basedir), - isFile: function (file, cb) { - cb(null, Object.prototype.hasOwnProperty.call(files, file)); - }, - 'package': { main: 'bar' }, - readFile: function (file, cb) { - cb(null, files[file]); - } - }; - } - - resolve('./baz', opts('/foo/bar'), function (err, res, pkg) { - if (err) return t.fail(err); - t.equal(res, path.resolve('/foo/bar/baz.js')); - t.equal(pkg && pkg.main, 'bar'); - }); - - resolve('./baz.js', opts('/foo/bar'), function (err, res, pkg) { - if (err) return t.fail(err); - t.equal(res, path.resolve('/foo/bar/baz.js')); - t.equal(pkg && pkg.main, 'bar'); - }); - - resolve('baz', opts('/foo/bar'), function (err, res) { - t.equal(err.message, "Cannot find module 'baz' from '" + path.resolve('/foo/bar') + "'"); - t.equal(err.code, 'MODULE_NOT_FOUND'); - }); - - resolve('../baz', opts('/foo/bar'), function (err, res) { - t.equal(err.message, "Cannot find module '../baz' from '" + path.resolve('/foo/bar') + "'"); - t.equal(err.code, 'MODULE_NOT_FOUND'); - }); -}); - -test('mock package', function (t) { - t.plan(2); - - var files = {}; - files[path.resolve('/foo/node_modules/bar/baz.js')] = 'beep'; - files[path.resolve('/foo/node_modules/bar/package.json')] = JSON.stringify({ - main: './baz.js' - }); - - function opts(basedir) { - return { - basedir: path.resolve(basedir), - isFile: function (file, cb) { - cb(null, Object.prototype.hasOwnProperty.call(files, path.resolve(file))); - }, - readFile: function (file, cb) { - cb(null, files[path.resolve(file)]); - } - }; - } - - resolve('bar', opts('/foo'), function (err, res, pkg) { - if (err) return t.fail(err); - t.equal(res, path.resolve('/foo/node_modules/bar/baz.js')); - t.equal(pkg && pkg.main, './baz.js'); - }); -}); - -test('mock package from package', function (t) { - t.plan(2); - - var files = {}; - files[path.resolve('/foo/node_modules/bar/baz.js')] = 'beep'; - files[path.resolve('/foo/node_modules/bar/package.json')] = JSON.stringify({ - main: './baz.js' - }); - - function opts(basedir) { - return { - basedir: path.resolve(basedir), - isFile: function (file, cb) { - cb(null, Object.prototype.hasOwnProperty.call(files, path.resolve(file))); - }, - 'package': { main: 'bar' }, - readFile: function (file, cb) { - cb(null, files[path.resolve(file)]); - } - }; - } - - resolve('bar', opts('/foo'), function (err, res, pkg) { - if (err) return t.fail(err); - t.equal(res, path.resolve('/foo/node_modules/bar/baz.js')); - t.equal(pkg && pkg.main, './baz.js'); - }); -}); diff --git a/deps/npm/node_modules/normalize-package-data/node_modules/resolve/test/mock_sync.js b/deps/npm/node_modules/normalize-package-data/node_modules/resolve/test/mock_sync.js deleted file mode 100644 index 43af10289fd22d..00000000000000 --- a/deps/npm/node_modules/normalize-package-data/node_modules/resolve/test/mock_sync.js +++ /dev/null @@ -1,67 +0,0 @@ -var path = require('path'); -var test = require('tape'); -var resolve = require('../'); - -test('mock', function (t) { - t.plan(4); - - var files = {}; - files[path.resolve('/foo/bar/baz.js')] = 'beep'; - - function opts(basedir) { - return { - basedir: path.resolve(basedir), - isFile: function (file) { - return Object.prototype.hasOwnProperty.call(files, file); - }, - readFileSync: function (file) { - return files[file]; - } - }; - } - - t.equal( - resolve.sync('./baz', opts('/foo/bar')), - path.resolve('/foo/bar/baz.js') - ); - - t.equal( - resolve.sync('./baz.js', opts('/foo/bar')), - path.resolve('/foo/bar/baz.js') - ); - - t.throws(function () { - resolve.sync('baz', opts('/foo/bar')); - }); - - t.throws(function () { - resolve.sync('../baz', opts('/foo/bar')); - }); -}); - -test('mock package', function (t) { - t.plan(1); - - var files = {}; - files[path.resolve('/foo/node_modules/bar/baz.js')] = 'beep'; - files[path.resolve('/foo/node_modules/bar/package.json')] = JSON.stringify({ - main: './baz.js' - }); - - function opts(basedir) { - return { - basedir: path.resolve(basedir), - isFile: function (file) { - return Object.prototype.hasOwnProperty.call(files, file); - }, - readFileSync: function (file) { - return files[file]; - } - }; - } - - t.equal( - resolve.sync('bar', opts('/foo')), - path.resolve('/foo/node_modules/bar/baz.js') - ); -}); diff --git a/deps/npm/node_modules/normalize-package-data/node_modules/resolve/test/node-modules-paths.js b/deps/npm/node_modules/normalize-package-data/node_modules/resolve/test/node-modules-paths.js deleted file mode 100644 index 1500fb19998bc0..00000000000000 --- a/deps/npm/node_modules/normalize-package-data/node_modules/resolve/test/node-modules-paths.js +++ /dev/null @@ -1,121 +0,0 @@ -var test = require('tape'); -var path = require('path'); -var parse = path.parse || require('path-parse'); -var keys = require('object-keys'); - -var nodeModulesPaths = require('../lib/node-modules-paths'); - -var verifyDirs = function verifyDirs(t, start, dirs, moduleDirectories, paths) { - var moduleDirs = [].concat(moduleDirectories || 'node_modules'); - if (paths) { - for (var k = 0; k < paths.length; ++k) { - moduleDirs.push(path.basename(paths[k])); - } - } - - var foundModuleDirs = {}; - var uniqueDirs = {}; - var parsedDirs = {}; - for (var i = 0; i < dirs.length; ++i) { - var parsed = parse(dirs[i]); - if (!foundModuleDirs[parsed.base]) { foundModuleDirs[parsed.base] = 0; } - foundModuleDirs[parsed.base] += 1; - parsedDirs[parsed.dir] = true; - uniqueDirs[dirs[i]] = true; - } - t.equal(keys(parsedDirs).length >= start.split(path.sep).length, true, 'there are >= dirs than "start" has'); - var foundModuleDirNames = keys(foundModuleDirs); - t.deepEqual(foundModuleDirNames, moduleDirs, 'all desired module dirs were found'); - t.equal(keys(uniqueDirs).length, dirs.length, 'all dirs provided were unique'); - - var counts = {}; - for (var j = 0; j < foundModuleDirNames.length; ++j) { - counts[foundModuleDirs[j]] = true; - } - t.equal(keys(counts).length, 1, 'all found module directories had the same count'); -}; - -test('node-modules-paths', function (t) { - t.test('no options', function (t) { - var start = path.join(__dirname, 'resolver'); - var dirs = nodeModulesPaths(start); - - verifyDirs(t, start, dirs); - - t.end(); - }); - - t.test('empty options', function (t) { - var start = path.join(__dirname, 'resolver'); - var dirs = nodeModulesPaths(start, {}); - - verifyDirs(t, start, dirs); - - t.end(); - }); - - t.test('with paths=array option', function (t) { - var start = path.join(__dirname, 'resolver'); - var paths = ['a', 'b']; - var dirs = nodeModulesPaths(start, { paths: paths }); - - verifyDirs(t, start, dirs, null, paths); - - t.end(); - }); - - t.test('with paths=function option', function (t) { - var paths = function paths(request, absoluteStart, getNodeModulesDirs, opts) { - return getNodeModulesDirs().concat(path.join(absoluteStart, 'not node modules', request)); - }; - - var start = path.join(__dirname, 'resolver'); - var dirs = nodeModulesPaths(start, { paths: paths }, 'pkg'); - - verifyDirs(t, start, dirs, null, [path.join(start, 'not node modules', 'pkg')]); - - t.end(); - }); - - t.test('with paths=function skipping node modules resolution', function (t) { - var paths = function paths(request, absoluteStart, getNodeModulesDirs, opts) { - return []; - }; - var start = path.join(__dirname, 'resolver'); - var dirs = nodeModulesPaths(start, { paths: paths }); - t.deepEqual(dirs, [], 'no node_modules was computed'); - t.end(); - }); - - t.test('with moduleDirectory option', function (t) { - var start = path.join(__dirname, 'resolver'); - var moduleDirectory = 'not node modules'; - var dirs = nodeModulesPaths(start, { moduleDirectory: moduleDirectory }); - - verifyDirs(t, start, dirs, moduleDirectory); - - t.end(); - }); - - t.test('with 1 moduleDirectory and paths options', function (t) { - var start = path.join(__dirname, 'resolver'); - var paths = ['a', 'b']; - var moduleDirectory = 'not node modules'; - var dirs = nodeModulesPaths(start, { paths: paths, moduleDirectory: moduleDirectory }); - - verifyDirs(t, start, dirs, moduleDirectory, paths); - - t.end(); - }); - - t.test('with 1+ moduleDirectory and paths options', function (t) { - var start = path.join(__dirname, 'resolver'); - var paths = ['a', 'b']; - var moduleDirectories = ['not node modules', 'other modules']; - var dirs = nodeModulesPaths(start, { paths: paths, moduleDirectory: moduleDirectories }); - - verifyDirs(t, start, dirs, moduleDirectories, paths); - - t.end(); - }); -}); diff --git a/deps/npm/node_modules/normalize-package-data/node_modules/resolve/test/resolver/baz/package.json b/deps/npm/node_modules/normalize-package-data/node_modules/resolve/test/resolver/baz/package.json deleted file mode 100644 index c41e4dbf73d997..00000000000000 --- a/deps/npm/node_modules/normalize-package-data/node_modules/resolve/test/resolver/baz/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "main": "quux.js" -} diff --git a/deps/npm/node_modules/normalize-package-data/node_modules/resolve/test/resolver/cup.coffee b/deps/npm/node_modules/normalize-package-data/node_modules/resolve/test/resolver/cup.coffee deleted file mode 100644 index 8b137891791fe9..00000000000000 --- a/deps/npm/node_modules/normalize-package-data/node_modules/resolve/test/resolver/cup.coffee +++ /dev/null @@ -1 +0,0 @@ - diff --git a/deps/npm/node_modules/normalize-package-data/node_modules/resolve/test/symlinks.js b/deps/npm/node_modules/normalize-package-data/node_modules/resolve/test/symlinks.js deleted file mode 100644 index ea95a1e1a20fb9..00000000000000 --- a/deps/npm/node_modules/normalize-package-data/node_modules/resolve/test/symlinks.js +++ /dev/null @@ -1,56 +0,0 @@ -var path = require('path'); -var fs = require('fs'); -var test = require('tape'); -var resolve = require('../'); - -var symlinkDir = path.join(__dirname, 'resolver', 'symlinked', 'symlink'); -try { - fs.unlinkSync(symlinkDir); -} catch (err) {} -try { - fs.symlinkSync('./_/symlink_target', symlinkDir, 'dir'); -} catch (err) { - // if fails then it is probably on Windows and lets try to create a junction - fs.symlinkSync(path.join(__dirname, 'resolver', 'symlinked', '_', 'symlink_target') + '\\', symlinkDir, 'junction'); -} - -test('symlink', function (t) { - t.plan(2); - - resolve('foo', { basedir: symlinkDir, preserveSymlinks: false }, function (err, res, pkg) { - t.error(err); - t.equal(res, path.join(__dirname, 'resolver', 'symlinked', '_', 'node_modules', 'foo.js')); - }); -}); - -test('sync symlink when preserveSymlinks = true', function (t) { - t.plan(4); - - resolve('foo', { basedir: symlinkDir }, function (err, res, pkg) { - t.ok(err, 'there is an error'); - t.notOk(res, 'no result'); - - t.equal(err && err.code, 'MODULE_NOT_FOUND', 'error code matches require.resolve'); - t.equal( - err && err.message, - 'Cannot find module \'foo\' from \'' + symlinkDir + '\'', - 'can not find nonexistent module' - ); - }); -}); - -test('sync symlink', function (t) { - var start = new Date(); - t.doesNotThrow(function () { - t.equal(resolve.sync('foo', { basedir: symlinkDir, preserveSymlinks: false }), path.join(__dirname, 'resolver', 'symlinked', '_', 'node_modules', 'foo.js')); - }); - t.ok(new Date() - start < 50, 'resolve.sync timedout'); - t.end(); -}); - -test('sync symlink when preserveSymlinks = true', function (t) { - t.throws(function () { - resolve.sync('foo', { basedir: symlinkDir }); - }, /Cannot find module 'foo'/); - t.end(); -}); diff --git a/deps/npm/node_modules/normalize-package-data/node_modules/semver/CHANGELOG.md b/deps/npm/node_modules/normalize-package-data/node_modules/semver/CHANGELOG.md new file mode 100644 index 00000000000000..66304fdd23678a --- /dev/null +++ b/deps/npm/node_modules/normalize-package-data/node_modules/semver/CHANGELOG.md @@ -0,0 +1,39 @@ +# changes log + +## 5.7 + +* Add `minVersion` method + +## 5.6 + +* Move boolean `loose` param to an options object, with + backwards-compatibility protection. +* Add ability to opt out of special prerelease version handling with + the `includePrerelease` option flag. + +## 5.5 + +* Add version coercion capabilities + +## 5.4 + +* Add intersection checking + +## 5.3 + +* Add `minSatisfying` method + +## 5.2 + +* Add `prerelease(v)` that returns prerelease components + +## 5.1 + +* Add Backus-Naur for ranges +* Remove excessively cute inspection methods + +## 5.0 + +* Remove AMD/Browserified build artifacts +* Fix ltr and gtr when using the `*` range +* Fix for range `*` with a prerelease identifier diff --git a/deps/npm/node_modules/normalize-package-data/node_modules/semver/LICENSE b/deps/npm/node_modules/normalize-package-data/node_modules/semver/LICENSE new file mode 100644 index 00000000000000..19129e315fe593 --- /dev/null +++ b/deps/npm/node_modules/normalize-package-data/node_modules/semver/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter and Contributors + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/deps/npm/node_modules/normalize-package-data/node_modules/semver/README.md b/deps/npm/node_modules/normalize-package-data/node_modules/semver/README.md new file mode 100644 index 00000000000000..f8dfa5a0df5fc4 --- /dev/null +++ b/deps/npm/node_modules/normalize-package-data/node_modules/semver/README.md @@ -0,0 +1,412 @@ +semver(1) -- The semantic versioner for npm +=========================================== + +## Install + +```bash +npm install --save semver +```` + +## Usage + +As a node module: + +```js +const semver = require('semver') + +semver.valid('1.2.3') // '1.2.3' +semver.valid('a.b.c') // null +semver.clean(' =v1.2.3 ') // '1.2.3' +semver.satisfies('1.2.3', '1.x || >=2.5.0 || 5.0.0 - 7.2.3') // true +semver.gt('1.2.3', '9.8.7') // false +semver.lt('1.2.3', '9.8.7') // true +semver.minVersion('>=1.0.0') // '1.0.0' +semver.valid(semver.coerce('v2')) // '2.0.0' +semver.valid(semver.coerce('42.6.7.9.3-alpha')) // '42.6.7' +``` + +As a command-line utility: + +``` +$ semver -h + +A JavaScript implementation of the https://semver.org/ specification +Copyright Isaac Z. Schlueter + +Usage: semver [options] [ [...]] +Prints valid versions sorted by SemVer precedence + +Options: +-r --range + Print versions that match the specified range. + +-i --increment [] + Increment a version by the specified level. Level can + be one of: major, minor, patch, premajor, preminor, + prepatch, or prerelease. Default level is 'patch'. + Only one version may be specified. + +--preid + Identifier to be used to prefix premajor, preminor, + prepatch or prerelease version increments. + +-l --loose + Interpret versions and ranges loosely + +-p --include-prerelease + Always include prerelease versions in range matching + +-c --coerce + Coerce a string into SemVer if possible + (does not imply --loose) + +Program exits successfully if any valid version satisfies +all supplied ranges, and prints all satisfying versions. + +If no satisfying versions are found, then exits failure. + +Versions are printed in ascending order, so supplying +multiple versions to the utility will just sort them. +``` + +## Versions + +A "version" is described by the `v2.0.0` specification found at +. + +A leading `"="` or `"v"` character is stripped off and ignored. + +## Ranges + +A `version range` is a set of `comparators` which specify versions +that satisfy the range. + +A `comparator` is composed of an `operator` and a `version`. The set +of primitive `operators` is: + +* `<` Less than +* `<=` Less than or equal to +* `>` Greater than +* `>=` Greater than or equal to +* `=` Equal. If no operator is specified, then equality is assumed, + so this operator is optional, but MAY be included. + +For example, the comparator `>=1.2.7` would match the versions +`1.2.7`, `1.2.8`, `2.5.3`, and `1.3.9`, but not the versions `1.2.6` +or `1.1.0`. + +Comparators can be joined by whitespace to form a `comparator set`, +which is satisfied by the **intersection** of all of the comparators +it includes. + +A range is composed of one or more comparator sets, joined by `||`. A +version matches a range if and only if every comparator in at least +one of the `||`-separated comparator sets is satisfied by the version. + +For example, the range `>=1.2.7 <1.3.0` would match the versions +`1.2.7`, `1.2.8`, and `1.2.99`, but not the versions `1.2.6`, `1.3.0`, +or `1.1.0`. + +The range `1.2.7 || >=1.2.9 <2.0.0` would match the versions `1.2.7`, +`1.2.9`, and `1.4.6`, but not the versions `1.2.8` or `2.0.0`. + +### Prerelease Tags + +If a version has a prerelease tag (for example, `1.2.3-alpha.3`) then +it will only be allowed to satisfy comparator sets if at least one +comparator with the same `[major, minor, patch]` tuple also has a +prerelease tag. + +For example, the range `>1.2.3-alpha.3` would be allowed to match the +version `1.2.3-alpha.7`, but it would *not* be satisfied by +`3.4.5-alpha.9`, even though `3.4.5-alpha.9` is technically "greater +than" `1.2.3-alpha.3` according to the SemVer sort rules. The version +range only accepts prerelease tags on the `1.2.3` version. The +version `3.4.5` *would* satisfy the range, because it does not have a +prerelease flag, and `3.4.5` is greater than `1.2.3-alpha.7`. + +The purpose for this behavior is twofold. First, prerelease versions +frequently are updated very quickly, and contain many breaking changes +that are (by the author's design) not yet fit for public consumption. +Therefore, by default, they are excluded from range matching +semantics. + +Second, a user who has opted into using a prerelease version has +clearly indicated the intent to use *that specific* set of +alpha/beta/rc versions. By including a prerelease tag in the range, +the user is indicating that they are aware of the risk. However, it +is still not appropriate to assume that they have opted into taking a +similar risk on the *next* set of prerelease versions. + +Note that this behavior can be suppressed (treating all prerelease +versions as if they were normal versions, for the purpose of range +matching) by setting the `includePrerelease` flag on the options +object to any +[functions](https://github.com/npm/node-semver#functions) that do +range matching. + +#### Prerelease Identifiers + +The method `.inc` takes an additional `identifier` string argument that +will append the value of the string as a prerelease identifier: + +```javascript +semver.inc('1.2.3', 'prerelease', 'beta') +// '1.2.4-beta.0' +``` + +command-line example: + +```bash +$ semver 1.2.3 -i prerelease --preid beta +1.2.4-beta.0 +``` + +Which then can be used to increment further: + +```bash +$ semver 1.2.4-beta.0 -i prerelease +1.2.4-beta.1 +``` + +### Advanced Range Syntax + +Advanced range syntax desugars to primitive comparators in +deterministic ways. + +Advanced ranges may be combined in the same way as primitive +comparators using white space or `||`. + +#### Hyphen Ranges `X.Y.Z - A.B.C` + +Specifies an inclusive set. + +* `1.2.3 - 2.3.4` := `>=1.2.3 <=2.3.4` + +If a partial version is provided as the first version in the inclusive +range, then the missing pieces are replaced with zeroes. + +* `1.2 - 2.3.4` := `>=1.2.0 <=2.3.4` + +If a partial version is provided as the second version in the +inclusive range, then all versions that start with the supplied parts +of the tuple are accepted, but nothing that would be greater than the +provided tuple parts. + +* `1.2.3 - 2.3` := `>=1.2.3 <2.4.0` +* `1.2.3 - 2` := `>=1.2.3 <3.0.0` + +#### X-Ranges `1.2.x` `1.X` `1.2.*` `*` + +Any of `X`, `x`, or `*` may be used to "stand in" for one of the +numeric values in the `[major, minor, patch]` tuple. + +* `*` := `>=0.0.0` (Any version satisfies) +* `1.x` := `>=1.0.0 <2.0.0` (Matching major version) +* `1.2.x` := `>=1.2.0 <1.3.0` (Matching major and minor versions) + +A partial version range is treated as an X-Range, so the special +character is in fact optional. + +* `""` (empty string) := `*` := `>=0.0.0` +* `1` := `1.x.x` := `>=1.0.0 <2.0.0` +* `1.2` := `1.2.x` := `>=1.2.0 <1.3.0` + +#### Tilde Ranges `~1.2.3` `~1.2` `~1` + +Allows patch-level changes if a minor version is specified on the +comparator. Allows minor-level changes if not. + +* `~1.2.3` := `>=1.2.3 <1.(2+1).0` := `>=1.2.3 <1.3.0` +* `~1.2` := `>=1.2.0 <1.(2+1).0` := `>=1.2.0 <1.3.0` (Same as `1.2.x`) +* `~1` := `>=1.0.0 <(1+1).0.0` := `>=1.0.0 <2.0.0` (Same as `1.x`) +* `~0.2.3` := `>=0.2.3 <0.(2+1).0` := `>=0.2.3 <0.3.0` +* `~0.2` := `>=0.2.0 <0.(2+1).0` := `>=0.2.0 <0.3.0` (Same as `0.2.x`) +* `~0` := `>=0.0.0 <(0+1).0.0` := `>=0.0.0 <1.0.0` (Same as `0.x`) +* `~1.2.3-beta.2` := `>=1.2.3-beta.2 <1.3.0` Note that prereleases in + the `1.2.3` version will be allowed, if they are greater than or + equal to `beta.2`. So, `1.2.3-beta.4` would be allowed, but + `1.2.4-beta.2` would not, because it is a prerelease of a + different `[major, minor, patch]` tuple. + +#### Caret Ranges `^1.2.3` `^0.2.5` `^0.0.4` + +Allows changes that do not modify the left-most non-zero digit in the +`[major, minor, patch]` tuple. In other words, this allows patch and +minor updates for versions `1.0.0` and above, patch updates for +versions `0.X >=0.1.0`, and *no* updates for versions `0.0.X`. + +Many authors treat a `0.x` version as if the `x` were the major +"breaking-change" indicator. + +Caret ranges are ideal when an author may make breaking changes +between `0.2.4` and `0.3.0` releases, which is a common practice. +However, it presumes that there will *not* be breaking changes between +`0.2.4` and `0.2.5`. It allows for changes that are presumed to be +additive (but non-breaking), according to commonly observed practices. + +* `^1.2.3` := `>=1.2.3 <2.0.0` +* `^0.2.3` := `>=0.2.3 <0.3.0` +* `^0.0.3` := `>=0.0.3 <0.0.4` +* `^1.2.3-beta.2` := `>=1.2.3-beta.2 <2.0.0` Note that prereleases in + the `1.2.3` version will be allowed, if they are greater than or + equal to `beta.2`. So, `1.2.3-beta.4` would be allowed, but + `1.2.4-beta.2` would not, because it is a prerelease of a + different `[major, minor, patch]` tuple. +* `^0.0.3-beta` := `>=0.0.3-beta <0.0.4` Note that prereleases in the + `0.0.3` version *only* will be allowed, if they are greater than or + equal to `beta`. So, `0.0.3-pr.2` would be allowed. + +When parsing caret ranges, a missing `patch` value desugars to the +number `0`, but will allow flexibility within that value, even if the +major and minor versions are both `0`. + +* `^1.2.x` := `>=1.2.0 <2.0.0` +* `^0.0.x` := `>=0.0.0 <0.1.0` +* `^0.0` := `>=0.0.0 <0.1.0` + +A missing `minor` and `patch` values will desugar to zero, but also +allow flexibility within those values, even if the major version is +zero. + +* `^1.x` := `>=1.0.0 <2.0.0` +* `^0.x` := `>=0.0.0 <1.0.0` + +### Range Grammar + +Putting all this together, here is a Backus-Naur grammar for ranges, +for the benefit of parser authors: + +```bnf +range-set ::= range ( logical-or range ) * +logical-or ::= ( ' ' ) * '||' ( ' ' ) * +range ::= hyphen | simple ( ' ' simple ) * | '' +hyphen ::= partial ' - ' partial +simple ::= primitive | partial | tilde | caret +primitive ::= ( '<' | '>' | '>=' | '<=' | '=' ) partial +partial ::= xr ( '.' xr ( '.' xr qualifier ? )? )? +xr ::= 'x' | 'X' | '*' | nr +nr ::= '0' | ['1'-'9'] ( ['0'-'9'] ) * +tilde ::= '~' partial +caret ::= '^' partial +qualifier ::= ( '-' pre )? ( '+' build )? +pre ::= parts +build ::= parts +parts ::= part ( '.' part ) * +part ::= nr | [-0-9A-Za-z]+ +``` + +## Functions + +All methods and classes take a final `options` object argument. All +options in this object are `false` by default. The options supported +are: + +- `loose` Be more forgiving about not-quite-valid semver strings. + (Any resulting output will always be 100% strict compliant, of + course.) For backwards compatibility reasons, if the `options` + argument is a boolean value instead of an object, it is interpreted + to be the `loose` param. +- `includePrerelease` Set to suppress the [default + behavior](https://github.com/npm/node-semver#prerelease-tags) of + excluding prerelease tagged versions from ranges unless they are + explicitly opted into. + +Strict-mode Comparators and Ranges will be strict about the SemVer +strings that they parse. + +* `valid(v)`: Return the parsed version, or null if it's not valid. +* `inc(v, release)`: Return the version incremented by the release + type (`major`, `premajor`, `minor`, `preminor`, `patch`, + `prepatch`, or `prerelease`), or null if it's not valid + * `premajor` in one call will bump the version up to the next major + version and down to a prerelease of that major version. + `preminor`, and `prepatch` work the same way. + * If called from a non-prerelease version, the `prerelease` will work the + same as `prepatch`. It increments the patch version, then makes a + prerelease. If the input version is already a prerelease it simply + increments it. +* `prerelease(v)`: Returns an array of prerelease components, or null + if none exist. Example: `prerelease('1.2.3-alpha.1') -> ['alpha', 1]` +* `major(v)`: Return the major version number. +* `minor(v)`: Return the minor version number. +* `patch(v)`: Return the patch version number. +* `intersects(r1, r2, loose)`: Return true if the two supplied ranges + or comparators intersect. +* `parse(v)`: Attempt to parse a string as a semantic version, returning either + a `SemVer` object or `null`. + +### Comparison + +* `gt(v1, v2)`: `v1 > v2` +* `gte(v1, v2)`: `v1 >= v2` +* `lt(v1, v2)`: `v1 < v2` +* `lte(v1, v2)`: `v1 <= v2` +* `eq(v1, v2)`: `v1 == v2` This is true if they're logically equivalent, + even if they're not the exact same string. You already know how to + compare strings. +* `neq(v1, v2)`: `v1 != v2` The opposite of `eq`. +* `cmp(v1, comparator, v2)`: Pass in a comparison string, and it'll call + the corresponding function above. `"==="` and `"!=="` do simple + string comparison, but are included for completeness. Throws if an + invalid comparison string is provided. +* `compare(v1, v2)`: Return `0` if `v1 == v2`, or `1` if `v1` is greater, or `-1` if + `v2` is greater. Sorts in ascending order if passed to `Array.sort()`. +* `rcompare(v1, v2)`: The reverse of compare. Sorts an array of versions + in descending order when passed to `Array.sort()`. +* `diff(v1, v2)`: Returns difference between two versions by the release type + (`major`, `premajor`, `minor`, `preminor`, `patch`, `prepatch`, or `prerelease`), + or null if the versions are the same. + +### Comparators + +* `intersects(comparator)`: Return true if the comparators intersect + +### Ranges + +* `validRange(range)`: Return the valid range or null if it's not valid +* `satisfies(version, range)`: Return true if the version satisfies the + range. +* `maxSatisfying(versions, range)`: Return the highest version in the list + that satisfies the range, or `null` if none of them do. +* `minSatisfying(versions, range)`: Return the lowest version in the list + that satisfies the range, or `null` if none of them do. +* `minVersion(range)`: Return the lowest version that can possibly match + the given range. +* `gtr(version, range)`: Return `true` if version is greater than all the + versions possible in the range. +* `ltr(version, range)`: Return `true` if version is less than all the + versions possible in the range. +* `outside(version, range, hilo)`: Return true if the version is outside + the bounds of the range in either the high or low direction. The + `hilo` argument must be either the string `'>'` or `'<'`. (This is + the function called by `gtr` and `ltr`.) +* `intersects(range)`: Return true if any of the ranges comparators intersect + +Note that, since ranges may be non-contiguous, a version might not be +greater than a range, less than a range, *or* satisfy a range! For +example, the range `1.2 <1.2.9 || >2.0.0` would have a hole from `1.2.9` +until `2.0.0`, so the version `1.2.10` would not be greater than the +range (because `2.0.1` satisfies, which is higher), nor less than the +range (since `1.2.8` satisfies, which is lower), and it also does not +satisfy the range. + +If you want to know if a version satisfies or does not satisfy a +range, use the `satisfies(version, range)` function. + +### Coercion + +* `coerce(version)`: Coerces a string to semver if possible + +This aims to provide a very forgiving translation of a non-semver string to +semver. It looks for the first digit in a string, and consumes all +remaining characters which satisfy at least a partial semver (e.g., `1`, +`1.2`, `1.2.3`) up to the max permitted length (256 characters). Longer +versions are simply truncated (`4.6.3.9.2-alpha2` becomes `4.6.3`). All +surrounding text is simply ignored (`v3.4 replaces v3.3.1` becomes +`3.4.0`). Only text which lacks digits will fail coercion (`version one` +is not valid). The maximum length for any semver component considered for +coercion is 16 characters; longer components will be ignored +(`10000000000000000.4.7.4` becomes `4.7.4`). The maximum value for any +semver component is `Number.MAX_SAFE_INTEGER || (2**53 - 1)`; higher value +components are invalid (`9999999999999999.4.7.4` is likely invalid). diff --git a/deps/npm/node_modules/normalize-package-data/node_modules/semver/bin/semver b/deps/npm/node_modules/normalize-package-data/node_modules/semver/bin/semver new file mode 100755 index 00000000000000..801e77f1303c15 --- /dev/null +++ b/deps/npm/node_modules/normalize-package-data/node_modules/semver/bin/semver @@ -0,0 +1,160 @@ +#!/usr/bin/env node +// Standalone semver comparison program. +// Exits successfully and prints matching version(s) if +// any supplied version is valid and passes all tests. + +var argv = process.argv.slice(2) + +var versions = [] + +var range = [] + +var inc = null + +var version = require('../package.json').version + +var loose = false + +var includePrerelease = false + +var coerce = false + +var identifier + +var semver = require('../semver') + +var reverse = false + +var options = {} + +main() + +function main () { + if (!argv.length) return help() + while (argv.length) { + var a = argv.shift() + var indexOfEqualSign = a.indexOf('=') + if (indexOfEqualSign !== -1) { + a = a.slice(0, indexOfEqualSign) + argv.unshift(a.slice(indexOfEqualSign + 1)) + } + switch (a) { + case '-rv': case '-rev': case '--rev': case '--reverse': + reverse = true + break + case '-l': case '--loose': + loose = true + break + case '-p': case '--include-prerelease': + includePrerelease = true + break + case '-v': case '--version': + versions.push(argv.shift()) + break + case '-i': case '--inc': case '--increment': + switch (argv[0]) { + case 'major': case 'minor': case 'patch': case 'prerelease': + case 'premajor': case 'preminor': case 'prepatch': + inc = argv.shift() + break + default: + inc = 'patch' + break + } + break + case '--preid': + identifier = argv.shift() + break + case '-r': case '--range': + range.push(argv.shift()) + break + case '-c': case '--coerce': + coerce = true + break + case '-h': case '--help': case '-?': + return help() + default: + versions.push(a) + break + } + } + + var options = { loose: loose, includePrerelease: includePrerelease } + + versions = versions.map(function (v) { + return coerce ? (semver.coerce(v) || { version: v }).version : v + }).filter(function (v) { + return semver.valid(v) + }) + if (!versions.length) return fail() + if (inc && (versions.length !== 1 || range.length)) { return failInc() } + + for (var i = 0, l = range.length; i < l; i++) { + versions = versions.filter(function (v) { + return semver.satisfies(v, range[i], options) + }) + if (!versions.length) return fail() + } + return success(versions) +} + +function failInc () { + console.error('--inc can only be used on a single version with no range') + fail() +} + +function fail () { process.exit(1) } + +function success () { + var compare = reverse ? 'rcompare' : 'compare' + versions.sort(function (a, b) { + return semver[compare](a, b, options) + }).map(function (v) { + return semver.clean(v, options) + }).map(function (v) { + return inc ? semver.inc(v, inc, options, identifier) : v + }).forEach(function (v, i, _) { console.log(v) }) +} + +function help () { + console.log(['SemVer ' + version, + '', + 'A JavaScript implementation of the https://semver.org/ specification', + 'Copyright Isaac Z. Schlueter', + '', + 'Usage: semver [options] [ [...]]', + 'Prints valid versions sorted by SemVer precedence', + '', + 'Options:', + '-r --range ', + ' Print versions that match the specified range.', + '', + '-i --increment []', + ' Increment a version by the specified level. Level can', + ' be one of: major, minor, patch, premajor, preminor,', + " prepatch, or prerelease. Default level is 'patch'.", + ' Only one version may be specified.', + '', + '--preid ', + ' Identifier to be used to prefix premajor, preminor,', + ' prepatch or prerelease version increments.', + '', + '-l --loose', + ' Interpret versions and ranges loosely', + '', + '-p --include-prerelease', + ' Always include prerelease versions in range matching', + '', + '-c --coerce', + ' Coerce a string into SemVer if possible', + ' (does not imply --loose)', + '', + 'Program exits successfully if any valid version satisfies', + 'all supplied ranges, and prints all satisfying versions.', + '', + 'If no satisfying versions are found, then exits failure.', + '', + 'Versions are printed in ascending order, so supplying', + 'multiple versions to the utility will just sort them.' + ].join('\n')) +} diff --git a/deps/npm/node_modules/normalize-package-data/node_modules/semver/package.json b/deps/npm/node_modules/normalize-package-data/node_modules/semver/package.json new file mode 100644 index 00000000000000..69d2db162c9297 --- /dev/null +++ b/deps/npm/node_modules/normalize-package-data/node_modules/semver/package.json @@ -0,0 +1,28 @@ +{ + "name": "semver", + "version": "5.7.1", + "description": "The semantic version parser used by npm.", + "main": "semver.js", + "scripts": { + "test": "tap", + "preversion": "npm test", + "postversion": "npm publish", + "postpublish": "git push origin --all; git push origin --tags" + }, + "devDependencies": { + "tap": "^13.0.0-rc.18" + }, + "license": "ISC", + "repository": "https://github.com/npm/node-semver", + "bin": { + "semver": "./bin/semver" + }, + "files": [ + "bin", + "range.bnf", + "semver.js" + ], + "tap": { + "check-coverage": true + } +} diff --git a/deps/npm/node_modules/normalize-package-data/node_modules/semver/range.bnf b/deps/npm/node_modules/normalize-package-data/node_modules/semver/range.bnf new file mode 100644 index 00000000000000..d4c6ae0d76c9ac --- /dev/null +++ b/deps/npm/node_modules/normalize-package-data/node_modules/semver/range.bnf @@ -0,0 +1,16 @@ +range-set ::= range ( logical-or range ) * +logical-or ::= ( ' ' ) * '||' ( ' ' ) * +range ::= hyphen | simple ( ' ' simple ) * | '' +hyphen ::= partial ' - ' partial +simple ::= primitive | partial | tilde | caret +primitive ::= ( '<' | '>' | '>=' | '<=' | '=' ) partial +partial ::= xr ( '.' xr ( '.' xr qualifier ? )? )? +xr ::= 'x' | 'X' | '*' | nr +nr ::= '0' | [1-9] ( [0-9] ) * +tilde ::= '~' partial +caret ::= '^' partial +qualifier ::= ( '-' pre )? ( '+' build )? +pre ::= parts +build ::= parts +parts ::= part ( '.' part ) * +part ::= nr | [-0-9A-Za-z]+ diff --git a/deps/npm/node_modules/normalize-package-data/node_modules/semver/semver.js b/deps/npm/node_modules/normalize-package-data/node_modules/semver/semver.js new file mode 100644 index 00000000000000..d315d5d68b179e --- /dev/null +++ b/deps/npm/node_modules/normalize-package-data/node_modules/semver/semver.js @@ -0,0 +1,1483 @@ +exports = module.exports = SemVer + +var debug +/* istanbul ignore next */ +if (typeof process === 'object' && + process.env && + process.env.NODE_DEBUG && + /\bsemver\b/i.test(process.env.NODE_DEBUG)) { + debug = function () { + var args = Array.prototype.slice.call(arguments, 0) + args.unshift('SEMVER') + console.log.apply(console, args) + } +} else { + debug = function () {} +} + +// Note: this is the semver.org version of the spec that it implements +// Not necessarily the package version of this code. +exports.SEMVER_SPEC_VERSION = '2.0.0' + +var MAX_LENGTH = 256 +var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || + /* istanbul ignore next */ 9007199254740991 + +// Max safe segment length for coercion. +var MAX_SAFE_COMPONENT_LENGTH = 16 + +// The actual regexps go on exports.re +var re = exports.re = [] +var src = exports.src = [] +var R = 0 + +// The following Regular Expressions can be used for tokenizing, +// validating, and parsing SemVer version strings. + +// ## Numeric Identifier +// A single `0`, or a non-zero digit followed by zero or more digits. + +var NUMERICIDENTIFIER = R++ +src[NUMERICIDENTIFIER] = '0|[1-9]\\d*' +var NUMERICIDENTIFIERLOOSE = R++ +src[NUMERICIDENTIFIERLOOSE] = '[0-9]+' + +// ## Non-numeric Identifier +// Zero or more digits, followed by a letter or hyphen, and then zero or +// more letters, digits, or hyphens. + +var NONNUMERICIDENTIFIER = R++ +src[NONNUMERICIDENTIFIER] = '\\d*[a-zA-Z-][a-zA-Z0-9-]*' + +// ## Main Version +// Three dot-separated numeric identifiers. + +var MAINVERSION = R++ +src[MAINVERSION] = '(' + src[NUMERICIDENTIFIER] + ')\\.' + + '(' + src[NUMERICIDENTIFIER] + ')\\.' + + '(' + src[NUMERICIDENTIFIER] + ')' + +var MAINVERSIONLOOSE = R++ +src[MAINVERSIONLOOSE] = '(' + src[NUMERICIDENTIFIERLOOSE] + ')\\.' + + '(' + src[NUMERICIDENTIFIERLOOSE] + ')\\.' + + '(' + src[NUMERICIDENTIFIERLOOSE] + ')' + +// ## Pre-release Version Identifier +// A numeric identifier, or a non-numeric identifier. + +var PRERELEASEIDENTIFIER = R++ +src[PRERELEASEIDENTIFIER] = '(?:' + src[NUMERICIDENTIFIER] + + '|' + src[NONNUMERICIDENTIFIER] + ')' + +var PRERELEASEIDENTIFIERLOOSE = R++ +src[PRERELEASEIDENTIFIERLOOSE] = '(?:' + src[NUMERICIDENTIFIERLOOSE] + + '|' + src[NONNUMERICIDENTIFIER] + ')' + +// ## Pre-release Version +// Hyphen, followed by one or more dot-separated pre-release version +// identifiers. + +var PRERELEASE = R++ +src[PRERELEASE] = '(?:-(' + src[PRERELEASEIDENTIFIER] + + '(?:\\.' + src[PRERELEASEIDENTIFIER] + ')*))' + +var PRERELEASELOOSE = R++ +src[PRERELEASELOOSE] = '(?:-?(' + src[PRERELEASEIDENTIFIERLOOSE] + + '(?:\\.' + src[PRERELEASEIDENTIFIERLOOSE] + ')*))' + +// ## Build Metadata Identifier +// Any combination of digits, letters, or hyphens. + +var BUILDIDENTIFIER = R++ +src[BUILDIDENTIFIER] = '[0-9A-Za-z-]+' + +// ## Build Metadata +// Plus sign, followed by one or more period-separated build metadata +// identifiers. + +var BUILD = R++ +src[BUILD] = '(?:\\+(' + src[BUILDIDENTIFIER] + + '(?:\\.' + src[BUILDIDENTIFIER] + ')*))' + +// ## Full Version String +// A main version, followed optionally by a pre-release version and +// build metadata. + +// Note that the only major, minor, patch, and pre-release sections of +// the version string are capturing groups. The build metadata is not a +// capturing group, because it should not ever be used in version +// comparison. + +var FULL = R++ +var FULLPLAIN = 'v?' + src[MAINVERSION] + + src[PRERELEASE] + '?' + + src[BUILD] + '?' + +src[FULL] = '^' + FULLPLAIN + '$' + +// like full, but allows v1.2.3 and =1.2.3, which people do sometimes. +// also, 1.0.0alpha1 (prerelease without the hyphen) which is pretty +// common in the npm registry. +var LOOSEPLAIN = '[v=\\s]*' + src[MAINVERSIONLOOSE] + + src[PRERELEASELOOSE] + '?' + + src[BUILD] + '?' + +var LOOSE = R++ +src[LOOSE] = '^' + LOOSEPLAIN + '$' + +var GTLT = R++ +src[GTLT] = '((?:<|>)?=?)' + +// Something like "2.*" or "1.2.x". +// Note that "x.x" is a valid xRange identifer, meaning "any version" +// Only the first item is strictly required. +var XRANGEIDENTIFIERLOOSE = R++ +src[XRANGEIDENTIFIERLOOSE] = src[NUMERICIDENTIFIERLOOSE] + '|x|X|\\*' +var XRANGEIDENTIFIER = R++ +src[XRANGEIDENTIFIER] = src[NUMERICIDENTIFIER] + '|x|X|\\*' + +var XRANGEPLAIN = R++ +src[XRANGEPLAIN] = '[v=\\s]*(' + src[XRANGEIDENTIFIER] + ')' + + '(?:\\.(' + src[XRANGEIDENTIFIER] + ')' + + '(?:\\.(' + src[XRANGEIDENTIFIER] + ')' + + '(?:' + src[PRERELEASE] + ')?' + + src[BUILD] + '?' + + ')?)?' + +var XRANGEPLAINLOOSE = R++ +src[XRANGEPLAINLOOSE] = '[v=\\s]*(' + src[XRANGEIDENTIFIERLOOSE] + ')' + + '(?:\\.(' + src[XRANGEIDENTIFIERLOOSE] + ')' + + '(?:\\.(' + src[XRANGEIDENTIFIERLOOSE] + ')' + + '(?:' + src[PRERELEASELOOSE] + ')?' + + src[BUILD] + '?' + + ')?)?' + +var XRANGE = R++ +src[XRANGE] = '^' + src[GTLT] + '\\s*' + src[XRANGEPLAIN] + '$' +var XRANGELOOSE = R++ +src[XRANGELOOSE] = '^' + src[GTLT] + '\\s*' + src[XRANGEPLAINLOOSE] + '$' + +// Coercion. +// Extract anything that could conceivably be a part of a valid semver +var COERCE = R++ +src[COERCE] = '(?:^|[^\\d])' + + '(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '})' + + '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' + + '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' + + '(?:$|[^\\d])' + +// Tilde ranges. +// Meaning is "reasonably at or greater than" +var LONETILDE = R++ +src[LONETILDE] = '(?:~>?)' + +var TILDETRIM = R++ +src[TILDETRIM] = '(\\s*)' + src[LONETILDE] + '\\s+' +re[TILDETRIM] = new RegExp(src[TILDETRIM], 'g') +var tildeTrimReplace = '$1~' + +var TILDE = R++ +src[TILDE] = '^' + src[LONETILDE] + src[XRANGEPLAIN] + '$' +var TILDELOOSE = R++ +src[TILDELOOSE] = '^' + src[LONETILDE] + src[XRANGEPLAINLOOSE] + '$' + +// Caret ranges. +// Meaning is "at least and backwards compatible with" +var LONECARET = R++ +src[LONECARET] = '(?:\\^)' + +var CARETTRIM = R++ +src[CARETTRIM] = '(\\s*)' + src[LONECARET] + '\\s+' +re[CARETTRIM] = new RegExp(src[CARETTRIM], 'g') +var caretTrimReplace = '$1^' + +var CARET = R++ +src[CARET] = '^' + src[LONECARET] + src[XRANGEPLAIN] + '$' +var CARETLOOSE = R++ +src[CARETLOOSE] = '^' + src[LONECARET] + src[XRANGEPLAINLOOSE] + '$' + +// A simple gt/lt/eq thing, or just "" to indicate "any version" +var COMPARATORLOOSE = R++ +src[COMPARATORLOOSE] = '^' + src[GTLT] + '\\s*(' + LOOSEPLAIN + ')$|^$' +var COMPARATOR = R++ +src[COMPARATOR] = '^' + src[GTLT] + '\\s*(' + FULLPLAIN + ')$|^$' + +// An expression to strip any whitespace between the gtlt and the thing +// it modifies, so that `> 1.2.3` ==> `>1.2.3` +var COMPARATORTRIM = R++ +src[COMPARATORTRIM] = '(\\s*)' + src[GTLT] + + '\\s*(' + LOOSEPLAIN + '|' + src[XRANGEPLAIN] + ')' + +// this one has to use the /g flag +re[COMPARATORTRIM] = new RegExp(src[COMPARATORTRIM], 'g') +var comparatorTrimReplace = '$1$2$3' + +// Something like `1.2.3 - 1.2.4` +// Note that these all use the loose form, because they'll be +// checked against either the strict or loose comparator form +// later. +var HYPHENRANGE = R++ +src[HYPHENRANGE] = '^\\s*(' + src[XRANGEPLAIN] + ')' + + '\\s+-\\s+' + + '(' + src[XRANGEPLAIN] + ')' + + '\\s*$' + +var HYPHENRANGELOOSE = R++ +src[HYPHENRANGELOOSE] = '^\\s*(' + src[XRANGEPLAINLOOSE] + ')' + + '\\s+-\\s+' + + '(' + src[XRANGEPLAINLOOSE] + ')' + + '\\s*$' + +// Star ranges basically just allow anything at all. +var STAR = R++ +src[STAR] = '(<|>)?=?\\s*\\*' + +// Compile to actual regexp objects. +// All are flag-free, unless they were created above with a flag. +for (var i = 0; i < R; i++) { + debug(i, src[i]) + if (!re[i]) { + re[i] = new RegExp(src[i]) + } +} + +exports.parse = parse +function parse (version, options) { + if (!options || typeof options !== 'object') { + options = { + loose: !!options, + includePrerelease: false + } + } + + if (version instanceof SemVer) { + return version + } + + if (typeof version !== 'string') { + return null + } + + if (version.length > MAX_LENGTH) { + return null + } + + var r = options.loose ? re[LOOSE] : re[FULL] + if (!r.test(version)) { + return null + } + + try { + return new SemVer(version, options) + } catch (er) { + return null + } +} + +exports.valid = valid +function valid (version, options) { + var v = parse(version, options) + return v ? v.version : null +} + +exports.clean = clean +function clean (version, options) { + var s = parse(version.trim().replace(/^[=v]+/, ''), options) + return s ? s.version : null +} + +exports.SemVer = SemVer + +function SemVer (version, options) { + if (!options || typeof options !== 'object') { + options = { + loose: !!options, + includePrerelease: false + } + } + if (version instanceof SemVer) { + if (version.loose === options.loose) { + return version + } else { + version = version.version + } + } else if (typeof version !== 'string') { + throw new TypeError('Invalid Version: ' + version) + } + + if (version.length > MAX_LENGTH) { + throw new TypeError('version is longer than ' + MAX_LENGTH + ' characters') + } + + if (!(this instanceof SemVer)) { + return new SemVer(version, options) + } + + debug('SemVer', version, options) + this.options = options + this.loose = !!options.loose + + var m = version.trim().match(options.loose ? re[LOOSE] : re[FULL]) + + if (!m) { + throw new TypeError('Invalid Version: ' + version) + } + + this.raw = version + + // these are actually numbers + this.major = +m[1] + this.minor = +m[2] + this.patch = +m[3] + + if (this.major > MAX_SAFE_INTEGER || this.major < 0) { + throw new TypeError('Invalid major version') + } + + if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) { + throw new TypeError('Invalid minor version') + } + + if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) { + throw new TypeError('Invalid patch version') + } + + // numberify any prerelease numeric ids + if (!m[4]) { + this.prerelease = [] + } else { + this.prerelease = m[4].split('.').map(function (id) { + if (/^[0-9]+$/.test(id)) { + var num = +id + if (num >= 0 && num < MAX_SAFE_INTEGER) { + return num + } + } + return id + }) + } + + this.build = m[5] ? m[5].split('.') : [] + this.format() +} + +SemVer.prototype.format = function () { + this.version = this.major + '.' + this.minor + '.' + this.patch + if (this.prerelease.length) { + this.version += '-' + this.prerelease.join('.') + } + return this.version +} + +SemVer.prototype.toString = function () { + return this.version +} + +SemVer.prototype.compare = function (other) { + debug('SemVer.compare', this.version, this.options, other) + if (!(other instanceof SemVer)) { + other = new SemVer(other, this.options) + } + + return this.compareMain(other) || this.comparePre(other) +} + +SemVer.prototype.compareMain = function (other) { + if (!(other instanceof SemVer)) { + other = new SemVer(other, this.options) + } + + return compareIdentifiers(this.major, other.major) || + compareIdentifiers(this.minor, other.minor) || + compareIdentifiers(this.patch, other.patch) +} + +SemVer.prototype.comparePre = function (other) { + if (!(other instanceof SemVer)) { + other = new SemVer(other, this.options) + } + + // NOT having a prerelease is > having one + if (this.prerelease.length && !other.prerelease.length) { + return -1 + } else if (!this.prerelease.length && other.prerelease.length) { + return 1 + } else if (!this.prerelease.length && !other.prerelease.length) { + return 0 + } + + var i = 0 + do { + var a = this.prerelease[i] + var b = other.prerelease[i] + debug('prerelease compare', i, a, b) + if (a === undefined && b === undefined) { + return 0 + } else if (b === undefined) { + return 1 + } else if (a === undefined) { + return -1 + } else if (a === b) { + continue + } else { + return compareIdentifiers(a, b) + } + } while (++i) +} + +// preminor will bump the version up to the next minor release, and immediately +// down to pre-release. premajor and prepatch work the same way. +SemVer.prototype.inc = function (release, identifier) { + switch (release) { + case 'premajor': + this.prerelease.length = 0 + this.patch = 0 + this.minor = 0 + this.major++ + this.inc('pre', identifier) + break + case 'preminor': + this.prerelease.length = 0 + this.patch = 0 + this.minor++ + this.inc('pre', identifier) + break + case 'prepatch': + // If this is already a prerelease, it will bump to the next version + // drop any prereleases that might already exist, since they are not + // relevant at this point. + this.prerelease.length = 0 + this.inc('patch', identifier) + this.inc('pre', identifier) + break + // If the input is a non-prerelease version, this acts the same as + // prepatch. + case 'prerelease': + if (this.prerelease.length === 0) { + this.inc('patch', identifier) + } + this.inc('pre', identifier) + break + + case 'major': + // If this is a pre-major version, bump up to the same major version. + // Otherwise increment major. + // 1.0.0-5 bumps to 1.0.0 + // 1.1.0 bumps to 2.0.0 + if (this.minor !== 0 || + this.patch !== 0 || + this.prerelease.length === 0) { + this.major++ + } + this.minor = 0 + this.patch = 0 + this.prerelease = [] + break + case 'minor': + // If this is a pre-minor version, bump up to the same minor version. + // Otherwise increment minor. + // 1.2.0-5 bumps to 1.2.0 + // 1.2.1 bumps to 1.3.0 + if (this.patch !== 0 || this.prerelease.length === 0) { + this.minor++ + } + this.patch = 0 + this.prerelease = [] + break + case 'patch': + // If this is not a pre-release version, it will increment the patch. + // If it is a pre-release it will bump up to the same patch version. + // 1.2.0-5 patches to 1.2.0 + // 1.2.0 patches to 1.2.1 + if (this.prerelease.length === 0) { + this.patch++ + } + this.prerelease = [] + break + // This probably shouldn't be used publicly. + // 1.0.0 "pre" would become 1.0.0-0 which is the wrong direction. + case 'pre': + if (this.prerelease.length === 0) { + this.prerelease = [0] + } else { + var i = this.prerelease.length + while (--i >= 0) { + if (typeof this.prerelease[i] === 'number') { + this.prerelease[i]++ + i = -2 + } + } + if (i === -1) { + // didn't increment anything + this.prerelease.push(0) + } + } + if (identifier) { + // 1.2.0-beta.1 bumps to 1.2.0-beta.2, + // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0 + if (this.prerelease[0] === identifier) { + if (isNaN(this.prerelease[1])) { + this.prerelease = [identifier, 0] + } + } else { + this.prerelease = [identifier, 0] + } + } + break + + default: + throw new Error('invalid increment argument: ' + release) + } + this.format() + this.raw = this.version + return this +} + +exports.inc = inc +function inc (version, release, loose, identifier) { + if (typeof (loose) === 'string') { + identifier = loose + loose = undefined + } + + try { + return new SemVer(version, loose).inc(release, identifier).version + } catch (er) { + return null + } +} + +exports.diff = diff +function diff (version1, version2) { + if (eq(version1, version2)) { + return null + } else { + var v1 = parse(version1) + var v2 = parse(version2) + var prefix = '' + if (v1.prerelease.length || v2.prerelease.length) { + prefix = 'pre' + var defaultResult = 'prerelease' + } + for (var key in v1) { + if (key === 'major' || key === 'minor' || key === 'patch') { + if (v1[key] !== v2[key]) { + return prefix + key + } + } + } + return defaultResult // may be undefined + } +} + +exports.compareIdentifiers = compareIdentifiers + +var numeric = /^[0-9]+$/ +function compareIdentifiers (a, b) { + var anum = numeric.test(a) + var bnum = numeric.test(b) + + if (anum && bnum) { + a = +a + b = +b + } + + return a === b ? 0 + : (anum && !bnum) ? -1 + : (bnum && !anum) ? 1 + : a < b ? -1 + : 1 +} + +exports.rcompareIdentifiers = rcompareIdentifiers +function rcompareIdentifiers (a, b) { + return compareIdentifiers(b, a) +} + +exports.major = major +function major (a, loose) { + return new SemVer(a, loose).major +} + +exports.minor = minor +function minor (a, loose) { + return new SemVer(a, loose).minor +} + +exports.patch = patch +function patch (a, loose) { + return new SemVer(a, loose).patch +} + +exports.compare = compare +function compare (a, b, loose) { + return new SemVer(a, loose).compare(new SemVer(b, loose)) +} + +exports.compareLoose = compareLoose +function compareLoose (a, b) { + return compare(a, b, true) +} + +exports.rcompare = rcompare +function rcompare (a, b, loose) { + return compare(b, a, loose) +} + +exports.sort = sort +function sort (list, loose) { + return list.sort(function (a, b) { + return exports.compare(a, b, loose) + }) +} + +exports.rsort = rsort +function rsort (list, loose) { + return list.sort(function (a, b) { + return exports.rcompare(a, b, loose) + }) +} + +exports.gt = gt +function gt (a, b, loose) { + return compare(a, b, loose) > 0 +} + +exports.lt = lt +function lt (a, b, loose) { + return compare(a, b, loose) < 0 +} + +exports.eq = eq +function eq (a, b, loose) { + return compare(a, b, loose) === 0 +} + +exports.neq = neq +function neq (a, b, loose) { + return compare(a, b, loose) !== 0 +} + +exports.gte = gte +function gte (a, b, loose) { + return compare(a, b, loose) >= 0 +} + +exports.lte = lte +function lte (a, b, loose) { + return compare(a, b, loose) <= 0 +} + +exports.cmp = cmp +function cmp (a, op, b, loose) { + switch (op) { + case '===': + if (typeof a === 'object') + a = a.version + if (typeof b === 'object') + b = b.version + return a === b + + case '!==': + if (typeof a === 'object') + a = a.version + if (typeof b === 'object') + b = b.version + return a !== b + + case '': + case '=': + case '==': + return eq(a, b, loose) + + case '!=': + return neq(a, b, loose) + + case '>': + return gt(a, b, loose) + + case '>=': + return gte(a, b, loose) + + case '<': + return lt(a, b, loose) + + case '<=': + return lte(a, b, loose) + + default: + throw new TypeError('Invalid operator: ' + op) + } +} + +exports.Comparator = Comparator +function Comparator (comp, options) { + if (!options || typeof options !== 'object') { + options = { + loose: !!options, + includePrerelease: false + } + } + + if (comp instanceof Comparator) { + if (comp.loose === !!options.loose) { + return comp + } else { + comp = comp.value + } + } + + if (!(this instanceof Comparator)) { + return new Comparator(comp, options) + } + + debug('comparator', comp, options) + this.options = options + this.loose = !!options.loose + this.parse(comp) + + if (this.semver === ANY) { + this.value = '' + } else { + this.value = this.operator + this.semver.version + } + + debug('comp', this) +} + +var ANY = {} +Comparator.prototype.parse = function (comp) { + var r = this.options.loose ? re[COMPARATORLOOSE] : re[COMPARATOR] + var m = comp.match(r) + + if (!m) { + throw new TypeError('Invalid comparator: ' + comp) + } + + this.operator = m[1] + if (this.operator === '=') { + this.operator = '' + } + + // if it literally is just '>' or '' then allow anything. + if (!m[2]) { + this.semver = ANY + } else { + this.semver = new SemVer(m[2], this.options.loose) + } +} + +Comparator.prototype.toString = function () { + return this.value +} + +Comparator.prototype.test = function (version) { + debug('Comparator.test', version, this.options.loose) + + if (this.semver === ANY) { + return true + } + + if (typeof version === 'string') { + version = new SemVer(version, this.options) + } + + return cmp(version, this.operator, this.semver, this.options) +} + +Comparator.prototype.intersects = function (comp, options) { + if (!(comp instanceof Comparator)) { + throw new TypeError('a Comparator is required') + } + + if (!options || typeof options !== 'object') { + options = { + loose: !!options, + includePrerelease: false + } + } + + var rangeTmp + + if (this.operator === '') { + rangeTmp = new Range(comp.value, options) + return satisfies(this.value, rangeTmp, options) + } else if (comp.operator === '') { + rangeTmp = new Range(this.value, options) + return satisfies(comp.semver, rangeTmp, options) + } + + var sameDirectionIncreasing = + (this.operator === '>=' || this.operator === '>') && + (comp.operator === '>=' || comp.operator === '>') + var sameDirectionDecreasing = + (this.operator === '<=' || this.operator === '<') && + (comp.operator === '<=' || comp.operator === '<') + var sameSemVer = this.semver.version === comp.semver.version + var differentDirectionsInclusive = + (this.operator === '>=' || this.operator === '<=') && + (comp.operator === '>=' || comp.operator === '<=') + var oppositeDirectionsLessThan = + cmp(this.semver, '<', comp.semver, options) && + ((this.operator === '>=' || this.operator === '>') && + (comp.operator === '<=' || comp.operator === '<')) + var oppositeDirectionsGreaterThan = + cmp(this.semver, '>', comp.semver, options) && + ((this.operator === '<=' || this.operator === '<') && + (comp.operator === '>=' || comp.operator === '>')) + + return sameDirectionIncreasing || sameDirectionDecreasing || + (sameSemVer && differentDirectionsInclusive) || + oppositeDirectionsLessThan || oppositeDirectionsGreaterThan +} + +exports.Range = Range +function Range (range, options) { + if (!options || typeof options !== 'object') { + options = { + loose: !!options, + includePrerelease: false + } + } + + if (range instanceof Range) { + if (range.loose === !!options.loose && + range.includePrerelease === !!options.includePrerelease) { + return range + } else { + return new Range(range.raw, options) + } + } + + if (range instanceof Comparator) { + return new Range(range.value, options) + } + + if (!(this instanceof Range)) { + return new Range(range, options) + } + + this.options = options + this.loose = !!options.loose + this.includePrerelease = !!options.includePrerelease + + // First, split based on boolean or || + this.raw = range + this.set = range.split(/\s*\|\|\s*/).map(function (range) { + return this.parseRange(range.trim()) + }, this).filter(function (c) { + // throw out any that are not relevant for whatever reason + return c.length + }) + + if (!this.set.length) { + throw new TypeError('Invalid SemVer Range: ' + range) + } + + this.format() +} + +Range.prototype.format = function () { + this.range = this.set.map(function (comps) { + return comps.join(' ').trim() + }).join('||').trim() + return this.range +} + +Range.prototype.toString = function () { + return this.range +} + +Range.prototype.parseRange = function (range) { + var loose = this.options.loose + range = range.trim() + // `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4` + var hr = loose ? re[HYPHENRANGELOOSE] : re[HYPHENRANGE] + range = range.replace(hr, hyphenReplace) + debug('hyphen replace', range) + // `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5` + range = range.replace(re[COMPARATORTRIM], comparatorTrimReplace) + debug('comparator trim', range, re[COMPARATORTRIM]) + + // `~ 1.2.3` => `~1.2.3` + range = range.replace(re[TILDETRIM], tildeTrimReplace) + + // `^ 1.2.3` => `^1.2.3` + range = range.replace(re[CARETTRIM], caretTrimReplace) + + // normalize spaces + range = range.split(/\s+/).join(' ') + + // At this point, the range is completely trimmed and + // ready to be split into comparators. + + var compRe = loose ? re[COMPARATORLOOSE] : re[COMPARATOR] + var set = range.split(' ').map(function (comp) { + return parseComparator(comp, this.options) + }, this).join(' ').split(/\s+/) + if (this.options.loose) { + // in loose mode, throw out any that are not valid comparators + set = set.filter(function (comp) { + return !!comp.match(compRe) + }) + } + set = set.map(function (comp) { + return new Comparator(comp, this.options) + }, this) + + return set +} + +Range.prototype.intersects = function (range, options) { + if (!(range instanceof Range)) { + throw new TypeError('a Range is required') + } + + return this.set.some(function (thisComparators) { + return thisComparators.every(function (thisComparator) { + return range.set.some(function (rangeComparators) { + return rangeComparators.every(function (rangeComparator) { + return thisComparator.intersects(rangeComparator, options) + }) + }) + }) + }) +} + +// Mostly just for testing and legacy API reasons +exports.toComparators = toComparators +function toComparators (range, options) { + return new Range(range, options).set.map(function (comp) { + return comp.map(function (c) { + return c.value + }).join(' ').trim().split(' ') + }) +} + +// comprised of xranges, tildes, stars, and gtlt's at this point. +// already replaced the hyphen ranges +// turn into a set of JUST comparators. +function parseComparator (comp, options) { + debug('comp', comp, options) + comp = replaceCarets(comp, options) + debug('caret', comp) + comp = replaceTildes(comp, options) + debug('tildes', comp) + comp = replaceXRanges(comp, options) + debug('xrange', comp) + comp = replaceStars(comp, options) + debug('stars', comp) + return comp +} + +function isX (id) { + return !id || id.toLowerCase() === 'x' || id === '*' +} + +// ~, ~> --> * (any, kinda silly) +// ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0 <3.0.0 +// ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0 <2.1.0 +// ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0 +// ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0 +// ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0 +function replaceTildes (comp, options) { + return comp.trim().split(/\s+/).map(function (comp) { + return replaceTilde(comp, options) + }).join(' ') +} + +function replaceTilde (comp, options) { + var r = options.loose ? re[TILDELOOSE] : re[TILDE] + return comp.replace(r, function (_, M, m, p, pr) { + debug('tilde', comp, _, M, m, p, pr) + var ret + + if (isX(M)) { + ret = '' + } else if (isX(m)) { + ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0' + } else if (isX(p)) { + // ~1.2 == >=1.2.0 <1.3.0 + ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0' + } else if (pr) { + debug('replaceTilde pr', pr) + ret = '>=' + M + '.' + m + '.' + p + '-' + pr + + ' <' + M + '.' + (+m + 1) + '.0' + } else { + // ~1.2.3 == >=1.2.3 <1.3.0 + ret = '>=' + M + '.' + m + '.' + p + + ' <' + M + '.' + (+m + 1) + '.0' + } + + debug('tilde return', ret) + return ret + }) +} + +// ^ --> * (any, kinda silly) +// ^2, ^2.x, ^2.x.x --> >=2.0.0 <3.0.0 +// ^2.0, ^2.0.x --> >=2.0.0 <3.0.0 +// ^1.2, ^1.2.x --> >=1.2.0 <2.0.0 +// ^1.2.3 --> >=1.2.3 <2.0.0 +// ^1.2.0 --> >=1.2.0 <2.0.0 +function replaceCarets (comp, options) { + return comp.trim().split(/\s+/).map(function (comp) { + return replaceCaret(comp, options) + }).join(' ') +} + +function replaceCaret (comp, options) { + debug('caret', comp, options) + var r = options.loose ? re[CARETLOOSE] : re[CARET] + return comp.replace(r, function (_, M, m, p, pr) { + debug('caret', comp, _, M, m, p, pr) + var ret + + if (isX(M)) { + ret = '' + } else if (isX(m)) { + ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0' + } else if (isX(p)) { + if (M === '0') { + ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0' + } else { + ret = '>=' + M + '.' + m + '.0 <' + (+M + 1) + '.0.0' + } + } else if (pr) { + debug('replaceCaret pr', pr) + if (M === '0') { + if (m === '0') { + ret = '>=' + M + '.' + m + '.' + p + '-' + pr + + ' <' + M + '.' + m + '.' + (+p + 1) + } else { + ret = '>=' + M + '.' + m + '.' + p + '-' + pr + + ' <' + M + '.' + (+m + 1) + '.0' + } + } else { + ret = '>=' + M + '.' + m + '.' + p + '-' + pr + + ' <' + (+M + 1) + '.0.0' + } + } else { + debug('no pr') + if (M === '0') { + if (m === '0') { + ret = '>=' + M + '.' + m + '.' + p + + ' <' + M + '.' + m + '.' + (+p + 1) + } else { + ret = '>=' + M + '.' + m + '.' + p + + ' <' + M + '.' + (+m + 1) + '.0' + } + } else { + ret = '>=' + M + '.' + m + '.' + p + + ' <' + (+M + 1) + '.0.0' + } + } + + debug('caret return', ret) + return ret + }) +} + +function replaceXRanges (comp, options) { + debug('replaceXRanges', comp, options) + return comp.split(/\s+/).map(function (comp) { + return replaceXRange(comp, options) + }).join(' ') +} + +function replaceXRange (comp, options) { + comp = comp.trim() + var r = options.loose ? re[XRANGELOOSE] : re[XRANGE] + return comp.replace(r, function (ret, gtlt, M, m, p, pr) { + debug('xRange', comp, ret, gtlt, M, m, p, pr) + var xM = isX(M) + var xm = xM || isX(m) + var xp = xm || isX(p) + var anyX = xp + + if (gtlt === '=' && anyX) { + gtlt = '' + } + + if (xM) { + if (gtlt === '>' || gtlt === '<') { + // nothing is allowed + ret = '<0.0.0' + } else { + // nothing is forbidden + ret = '*' + } + } else if (gtlt && anyX) { + // we know patch is an x, because we have any x at all. + // replace X with 0 + if (xm) { + m = 0 + } + p = 0 + + if (gtlt === '>') { + // >1 => >=2.0.0 + // >1.2 => >=1.3.0 + // >1.2.3 => >= 1.2.4 + gtlt = '>=' + if (xm) { + M = +M + 1 + m = 0 + p = 0 + } else { + m = +m + 1 + p = 0 + } + } else if (gtlt === '<=') { + // <=0.7.x is actually <0.8.0, since any 0.7.x should + // pass. Similarly, <=7.x is actually <8.0.0, etc. + gtlt = '<' + if (xm) { + M = +M + 1 + } else { + m = +m + 1 + } + } + + ret = gtlt + M + '.' + m + '.' + p + } else if (xm) { + ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0' + } else if (xp) { + ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0' + } + + debug('xRange return', ret) + + return ret + }) +} + +// Because * is AND-ed with everything else in the comparator, +// and '' means "any version", just remove the *s entirely. +function replaceStars (comp, options) { + debug('replaceStars', comp, options) + // Looseness is ignored here. star is always as loose as it gets! + return comp.trim().replace(re[STAR], '') +} + +// This function is passed to string.replace(re[HYPHENRANGE]) +// M, m, patch, prerelease, build +// 1.2 - 3.4.5 => >=1.2.0 <=3.4.5 +// 1.2.3 - 3.4 => >=1.2.0 <3.5.0 Any 3.4.x will do +// 1.2 - 3.4 => >=1.2.0 <3.5.0 +function hyphenReplace ($0, + from, fM, fm, fp, fpr, fb, + to, tM, tm, tp, tpr, tb) { + if (isX(fM)) { + from = '' + } else if (isX(fm)) { + from = '>=' + fM + '.0.0' + } else if (isX(fp)) { + from = '>=' + fM + '.' + fm + '.0' + } else { + from = '>=' + from + } + + if (isX(tM)) { + to = '' + } else if (isX(tm)) { + to = '<' + (+tM + 1) + '.0.0' + } else if (isX(tp)) { + to = '<' + tM + '.' + (+tm + 1) + '.0' + } else if (tpr) { + to = '<=' + tM + '.' + tm + '.' + tp + '-' + tpr + } else { + to = '<=' + to + } + + return (from + ' ' + to).trim() +} + +// if ANY of the sets match ALL of its comparators, then pass +Range.prototype.test = function (version) { + if (!version) { + return false + } + + if (typeof version === 'string') { + version = new SemVer(version, this.options) + } + + for (var i = 0; i < this.set.length; i++) { + if (testSet(this.set[i], version, this.options)) { + return true + } + } + return false +} + +function testSet (set, version, options) { + for (var i = 0; i < set.length; i++) { + if (!set[i].test(version)) { + return false + } + } + + if (version.prerelease.length && !options.includePrerelease) { + // Find the set of versions that are allowed to have prereleases + // For example, ^1.2.3-pr.1 desugars to >=1.2.3-pr.1 <2.0.0 + // That should allow `1.2.3-pr.2` to pass. + // However, `1.2.4-alpha.notready` should NOT be allowed, + // even though it's within the range set by the comparators. + for (i = 0; i < set.length; i++) { + debug(set[i].semver) + if (set[i].semver === ANY) { + continue + } + + if (set[i].semver.prerelease.length > 0) { + var allowed = set[i].semver + if (allowed.major === version.major && + allowed.minor === version.minor && + allowed.patch === version.patch) { + return true + } + } + } + + // Version has a -pre, but it's not one of the ones we like. + return false + } + + return true +} + +exports.satisfies = satisfies +function satisfies (version, range, options) { + try { + range = new Range(range, options) + } catch (er) { + return false + } + return range.test(version) +} + +exports.maxSatisfying = maxSatisfying +function maxSatisfying (versions, range, options) { + var max = null + var maxSV = null + try { + var rangeObj = new Range(range, options) + } catch (er) { + return null + } + versions.forEach(function (v) { + if (rangeObj.test(v)) { + // satisfies(v, range, options) + if (!max || maxSV.compare(v) === -1) { + // compare(max, v, true) + max = v + maxSV = new SemVer(max, options) + } + } + }) + return max +} + +exports.minSatisfying = minSatisfying +function minSatisfying (versions, range, options) { + var min = null + var minSV = null + try { + var rangeObj = new Range(range, options) + } catch (er) { + return null + } + versions.forEach(function (v) { + if (rangeObj.test(v)) { + // satisfies(v, range, options) + if (!min || minSV.compare(v) === 1) { + // compare(min, v, true) + min = v + minSV = new SemVer(min, options) + } + } + }) + return min +} + +exports.minVersion = minVersion +function minVersion (range, loose) { + range = new Range(range, loose) + + var minver = new SemVer('0.0.0') + if (range.test(minver)) { + return minver + } + + minver = new SemVer('0.0.0-0') + if (range.test(minver)) { + return minver + } + + minver = null + for (var i = 0; i < range.set.length; ++i) { + var comparators = range.set[i] + + comparators.forEach(function (comparator) { + // Clone to avoid manipulating the comparator's semver object. + var compver = new SemVer(comparator.semver.version) + switch (comparator.operator) { + case '>': + if (compver.prerelease.length === 0) { + compver.patch++ + } else { + compver.prerelease.push(0) + } + compver.raw = compver.format() + /* fallthrough */ + case '': + case '>=': + if (!minver || gt(minver, compver)) { + minver = compver + } + break + case '<': + case '<=': + /* Ignore maximum versions */ + break + /* istanbul ignore next */ + default: + throw new Error('Unexpected operation: ' + comparator.operator) + } + }) + } + + if (minver && range.test(minver)) { + return minver + } + + return null +} + +exports.validRange = validRange +function validRange (range, options) { + try { + // Return '*' instead of '' so that truthiness works. + // This will throw if it's invalid anyway + return new Range(range, options).range || '*' + } catch (er) { + return null + } +} + +// Determine if version is less than all the versions possible in the range +exports.ltr = ltr +function ltr (version, range, options) { + return outside(version, range, '<', options) +} + +// Determine if version is greater than all the versions possible in the range. +exports.gtr = gtr +function gtr (version, range, options) { + return outside(version, range, '>', options) +} + +exports.outside = outside +function outside (version, range, hilo, options) { + version = new SemVer(version, options) + range = new Range(range, options) + + var gtfn, ltefn, ltfn, comp, ecomp + switch (hilo) { + case '>': + gtfn = gt + ltefn = lte + ltfn = lt + comp = '>' + ecomp = '>=' + break + case '<': + gtfn = lt + ltefn = gte + ltfn = gt + comp = '<' + ecomp = '<=' + break + default: + throw new TypeError('Must provide a hilo val of "<" or ">"') + } + + // If it satisifes the range it is not outside + if (satisfies(version, range, options)) { + return false + } + + // From now on, variable terms are as if we're in "gtr" mode. + // but note that everything is flipped for the "ltr" function. + + for (var i = 0; i < range.set.length; ++i) { + var comparators = range.set[i] + + var high = null + var low = null + + comparators.forEach(function (comparator) { + if (comparator.semver === ANY) { + comparator = new Comparator('>=0.0.0') + } + high = high || comparator + low = low || comparator + if (gtfn(comparator.semver, high.semver, options)) { + high = comparator + } else if (ltfn(comparator.semver, low.semver, options)) { + low = comparator + } + }) + + // If the edge version comparator has a operator then our version + // isn't outside it + if (high.operator === comp || high.operator === ecomp) { + return false + } + + // If the lowest version comparator has an operator and our version + // is less than it then it isn't higher than the range + if ((!low.operator || low.operator === comp) && + ltefn(version, low.semver)) { + return false + } else if (low.operator === ecomp && ltfn(version, low.semver)) { + return false + } + } + return true +} + +exports.prerelease = prerelease +function prerelease (version, options) { + var parsed = parse(version, options) + return (parsed && parsed.prerelease.length) ? parsed.prerelease : null +} + +exports.intersects = intersects +function intersects (r1, r2, options) { + r1 = new Range(r1, options) + r2 = new Range(r2, options) + return r1.intersects(r2) +} + +exports.coerce = coerce +function coerce (version) { + if (version instanceof SemVer) { + return version + } + + if (typeof version !== 'string') { + return null + } + + var match = version.match(re[COERCE]) + + if (match == null) { + return null + } + + return parse(match[1] + + '.' + (match[2] || '0') + + '.' + (match[3] || '0')) +} diff --git a/deps/npm/node_modules/normalize-package-data/package.json b/deps/npm/node_modules/normalize-package-data/package.json index a408d8c0ab602d..dea34bb7ffcec8 100644 --- a/deps/npm/node_modules/normalize-package-data/package.json +++ b/deps/npm/node_modules/normalize-package-data/package.json @@ -1,64 +1,23 @@ { - "_from": "normalize-package-data@2.5.0", - "_id": "normalize-package-data@2.5.0", - "_inBundle": false, - "_integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==", - "_location": "/normalize-package-data", - "_phantomChildren": { - "path-parse": "1.0.6" - }, - "_requested": { - "type": "version", - "registry": true, - "raw": "normalize-package-data@2.5.0", - "name": "normalize-package-data", - "escapedName": "normalize-package-data", - "rawSpec": "2.5.0", - "saveSpec": null, - "fetchSpec": "2.5.0" - }, - "_requiredBy": [ - "#USER", - "/", - "/libnpmpublish", - "/pacote", - "/read-package-json", - "/read-pkg" - ], - "_resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz", - "_shasum": "e66db1838b200c1dfc233225d12cb36520e234a8", - "_spec": "normalize-package-data@2.5.0", - "_where": "/Users/aeschright/code/npm-release", - "author": { - "name": "Meryn Stol", - "email": "merynstol@gmail.com" + "name": "normalize-package-data", + "version": "2.5.0", + "author": "Meryn Stol ", + "description": "Normalizes data that can be found in package.json files.", + "license": "BSD-2-Clause", + "repository": { + "type": "git", + "url": "git://github.com/npm/normalize-package-data.git" }, - "bugs": { - "url": "https://github.com/npm/normalize-package-data/issues" + "main": "lib/normalize.js", + "scripts": { + "test": "tap test/*.js" }, - "bundleDependencies": false, - "contributors": [ - { - "name": "Isaac Z. Schlueter", - "email": "i@izs.me" - }, - { - "name": "Meryn Stol", - "email": "merynstol@gmail.com" - }, - { - "name": "Robert Kowalski", - "email": "rok@kowalski.gd" - } - ], "dependencies": { "hosted-git-info": "^2.1.4", "resolve": "^1.10.0", "semver": "2 || 3 || 4 || 5", "validate-npm-package-license": "^3.0.1" }, - "deprecated": false, - "description": "Normalizes data that can be found in package.json files.", "devDependencies": { "async": "^2.6.1", "tap": "^12.4.0", @@ -68,17 +27,5 @@ "lib/*.js", "lib/*.json", "AUTHORS" - ], - "homepage": "https://github.com/npm/normalize-package-data#readme", - "license": "BSD-2-Clause", - "main": "lib/normalize.js", - "name": "normalize-package-data", - "repository": { - "type": "git", - "url": "git://github.com/npm/normalize-package-data.git" - }, - "scripts": { - "test": "tap test/*.js" - }, - "version": "2.5.0" + ] } diff --git a/deps/npm/node_modules/npm-audit-report/README.md b/deps/npm/node_modules/npm-audit-report/README.md index 1d1697f4f5205c..6eb2a3dfe56c16 100644 --- a/deps/npm/node_modules/npm-audit-report/README.md +++ b/deps/npm/node_modules/npm-audit-report/README.md @@ -2,10 +2,6 @@ Given a response from the npm security api, render it into a variety of security reports -[![Build Status](https://travis-ci.org/npm/npm-audit-report.svg?branch=master)](https://travis-ci.org/npm/npm-audit-report) -[![Build status](https://ci.appveyor.com/api/projects/status/qictiokvxmqkiuvi/branch/master?svg=true)](https://ci.appveyor.com/project/evilpacket/npm-audit-report/branch/master) -[![Coverage Status](https://coveralls.io/repos/github/npm/npm-audit-report/badge.svg?branch=master)](https://coveralls.io/github/npm/npm-audit-report?branch=master) - The response is an object that contains an output string (the report) and a suggested exitCode. ``` { @@ -17,6 +13,9 @@ The response is an object that contains an output string (the report) and a sugg ## Basic usage example +This is intended to be used along with +[`@npmcli/arborist`](http://npm.im/@npmcli/arborist)'s `AuditReport` class. + ``` 'use strict' const Report = require('npm-audit-report') @@ -24,17 +23,43 @@ const options = { reporter: 'json' } -Report(response, options, (result) => { - console.log(result.report) +const arb = new Arborist({ path: '/path/to/project' }) +arb.audit().then(report => { + const result = new Report(report, options) + console.log(result.output) process.exitCode = result.exitCode }) ``` +## Break from Version 1 + +Version 5 and 6 of the npm CLI make a request to the registry endpoint at +either the "Full Audit" endpoint at `/-/npm/v1/security/audits` or +the "Quick Audit" endpoint at `/-/npm/v1/security/audits/quick`. The Full +Audit endpoint calculates remediations necessary to correct problems based +on the shape of the tree. + +As of npm v7, the logic of how the cli manages trees is dramatically +rearchitected, rendering much of the remediations no longer valid. +Thus, it _only_ fetches the advisory data from the Quick Audit endpoint, +and uses [`@npmcli/arborist`](http://npm.im/@npmcli/arborist) to calculate +required remediations and affected nodes in the dependency graph. This +data is serialized and provided as an `"auditReportVersion": 2` object. + +Version 2 of this module expects to recieve an instance (or serialized JSON +version of) the `AuditReport` class from Arborist, which is returned by +`arborist.audit()` and stored on the instance as `arborist.auditReport`. + +Eventually, a new endpoint _may_ be added to move the `@npmcli/arborist` work +to the server-side, in which case version 2 style audit reports _may_ be +provided directly. ## options -| option | values | default | description | -| :--- | :--- | :--- |:--- | -| reporter     | `install`, `detail`, `json`, `quiet` | `install` | specify which output format you want to use | -| withColor     | `true`, `false`   | `true`   | indicates if some report elements should use colors | -| withUnicode   | `true`, `false`                  | `true` | indicates if unicode characters should be used| \ No newline at end of file +| option | values | default | description | +| :--- | :--- | :--- |:--- | +| reporter | `install`, `detail`, `json`, `quiet` | `install` | specify which output format you want to use | +| color   | `true`, `false`   | `true`   | indicates if some report elements should use colors | +| unicode  | `true`, `false`                  | `true` | indicates if unicode characters should be used| +| indent   | Number or String                | `2` | indentation for `'json'` report| +| auditLevel | 'info', 'low', 'moderate', 'high', 'critical', 'none' | `low` (ie, exit 0 if only `info` advisories are found) | level of vulnerability that will trigger a non-zero exit code (set to 'none' to always exit with a 0 status code) | diff --git a/deps/npm/node_modules/npm-audit-report/index.js b/deps/npm/node_modules/npm-audit-report/index.js deleted file mode 100644 index 4f9f5d677b9b02..00000000000000 --- a/deps/npm/node_modules/npm-audit-report/index.js +++ /dev/null @@ -1,25 +0,0 @@ -'use strict' - -const reporters = { - install: require('./reporters/install'), - parseable: require('./reporters/parseable'), - detail: require('./reporters/detail'), - json: require('./reporters/json'), - quiet: require('./reporters/quiet') -} - -const report = function (data, options) { - const defaults = { - reporter: 'install', - withColor: true, - withUnicode: true - } - - const config = Object.assign({}, defaults, options) - return new Promise((resolve) => { - const result = reporters[config.reporter](data, config) - return resolve(result) - }) -} - -module.exports = report diff --git a/deps/npm/node_modules/npm-audit-report/lib/colors.js b/deps/npm/node_modules/npm-audit-report/lib/colors.js new file mode 100644 index 00000000000000..ad76870fd6fda6 --- /dev/null +++ b/deps/npm/node_modules/npm-audit-report/lib/colors.js @@ -0,0 +1,24 @@ +const chalk = require('chalk') +module.exports = color => { + const identity = x => x + const green = color ? s => chalk.green.bold(s) : identity + const red = color ? s => chalk.red.bold(s) : identity + const magenta = color ? s => chalk.magenta.bold(s) : identity + const yellow = color ? s => chalk.yellow.bold(s) : identity + const white = color ? s => chalk.bold(s) : identity + const severity = (sev, s) => sev.toLowerCase() === 'moderate' ? yellow(s || sev) + : sev.toLowerCase() === 'high' ? red(s || sev) + : sev.toLowerCase() === 'critical' ? magenta(s || sev) + : white(s || sev) + const dim = color ? s => chalk.dim(s) : identity + + return { + dim, + green, + red, + magenta, + yellow, + white, + severity + } +} diff --git a/deps/npm/node_modules/npm-audit-report/lib/exit-code.js b/deps/npm/node_modules/npm-audit-report/lib/exit-code.js new file mode 100644 index 00000000000000..7a32ac6db47703 --- /dev/null +++ b/deps/npm/node_modules/npm-audit-report/lib/exit-code.js @@ -0,0 +1,14 @@ +// return 1 if any vulns in the set are at or above the specified severity +const severities = new Map(Object.entries([ + 'info', + 'low', + 'moderate', + 'high', + 'critical', + 'none' +]).map(s => s.reverse())) + +module.exports = (data, level) => + Object.entries(data.metadata.vulnerabilities) + .some(([sev, count]) => count > 0 && severities.has(sev) && + severities.get(sev) >= severities.get(level)) ? 1 : 0 diff --git a/deps/npm/node_modules/npm-audit-report/lib/index.js b/deps/npm/node_modules/npm-audit-report/lib/index.js new file mode 100644 index 00000000000000..464004c17518a9 --- /dev/null +++ b/deps/npm/node_modules/npm-audit-report/lib/index.js @@ -0,0 +1,37 @@ +'use strict' + +const reporters = { + install: require('./reporters/install'), + detail: require('./reporters/detail'), + json: require('./reporters/json'), + quiet: require('./reporters/quiet') +} + +const exitCode = require('./exit-code.js') + +module.exports = Object.assign((data, options = {}) => { + const { + reporter = 'install', + color = true, + unicode = true, + indent = 2, + auditLevel = 'low' + } = options + + if (!data) + throw Object.assign( + new TypeError('ENOAUDITDATA'), + { + code: 'ENOAUDITDATA', + message: 'missing audit data' + } + ) + + if (typeof data.toJSON === 'function') + data = data.toJSON() + + return { + report: reporters[reporter](data, { color, unicode, indent }), + exitCode: exitCode(data, auditLevel) + } +}, { reporters }) diff --git a/deps/npm/node_modules/npm-audit-report/lib/reporters/detail.js b/deps/npm/node_modules/npm-audit-report/lib/reporters/detail.js new file mode 100644 index 00000000000000..50451f057972df --- /dev/null +++ b/deps/npm/node_modules/npm-audit-report/lib/reporters/detail.js @@ -0,0 +1,84 @@ +'use strict' + +const colors = require('../colors.js') +const install = require('./install.js') + +module.exports = (data, { color }) => { + const summary = install.summary(data, { color }) + const none = data.metadata.vulnerabilities.total === 0 + return none ? summary : fullReport(data, {color, summary}) +} + +const fullReport = (data, { color, summary }) => { + const c = colors(color) + const output = [c.white('# npm audit report'), ''] + + const printed = new Set() + for (const [name, vuln] of Object.entries(data.vulnerabilities)) { + // only print starting from the top-level advisories + if (vuln.via.filter(v => typeof v !== 'string').length !== 0) + output.push(printVuln(vuln, c, data.vulnerabilities)) + } + + output.push(summary) + + return output.join('\n') +} + +const printVuln = (vuln, c, vulnerabilities, printed = new Set(), indent = '') => { + if (printed.has(vuln)) + return null + + printed.add(vuln) + const output = [] + + output.push(c.white(vuln.name) + ' ' + vuln.range) + + if (indent === '' && (vuln.severity !== 'low' || vuln.severity === 'info')) { + output.push(`Severity: ${c.severity(vuln.severity)}`) + } + + for (const via of vuln.via) { + if (typeof via === 'string') { + output.push(`Depends on vulnerable versions of ${c.white(via)}`) + } else if (indent === '') { + output.push(`${c.white(via.title)} - ${via.url}`) + } + } + + if (indent === '') { + const { fixAvailable: fa } = vuln + if (fa === false) { + output.push(c.red('No fix available')) + } else if (fa === true) { + output.push(c.green('fix available') + ' via `npm audit fix`') + } else { + /* istanbul ignore else - should be impossible, just being cautious */ + if (typeof fa === 'object' && indent === '') { + output.push( + `${c.yellow('fix available')} via \`npm audit fix --force\``, + `Will install ${fa.name}@${fa.version}` + + `, which is ${fa.isSemVerMajor ? 'a breaking change' : + 'outside the stated dependency range' }` + ) + } + } + } + + for (const path of vuln.nodes) { + output.push(c.dim(path)) + } + + for (const effect of vuln.effects) { + const vuln = vulnerabilities[effect] + const e = printVuln(vuln, c, vulnerabilities, printed, ' ') + if (e) + output.push(...e.split('\n')) + } + + if (indent === '') { + output.push('') + } + + return output.map(l => `${indent}${l}`).join('\n') +} diff --git a/deps/npm/node_modules/npm-audit-report/lib/reporters/install.js b/deps/npm/node_modules/npm-audit-report/lib/reporters/install.js new file mode 100644 index 00000000000000..fe53be3adad76b --- /dev/null +++ b/deps/npm/node_modules/npm-audit-report/lib/reporters/install.js @@ -0,0 +1,75 @@ +const colors = require('../colors.js') + +const calculate = (data, { color }) => { + const c = colors(color) + const output = [] + const { metadata: { vulnerabilities }} = data + const vulnCount = vulnerabilities.total + + let someFixable = false + let someForceFixable = false + let forceFixSemVerMajor = false + let someUnfixable = false + + if (vulnCount === 0) { + output.push(`found ${c.green('0')} vulnerabilities`) + } else { + for (const [name, vuln] of Object.entries(data.vulnerabilities)) { + const { fixAvailable } = vuln + someFixable = someFixable || fixAvailable === true + someUnfixable = someUnfixable || fixAvailable === false + if (typeof fixAvailable === 'object') { + someForceFixable = true + forceFixSemVerMajor = forceFixSemVerMajor || fixAvailable.isSemVerMajor + } + } + const total = vulnerabilities.total + const sevs = Object.entries(vulnerabilities).filter(([s, count]) => { + return (s === 'low' || s === 'moderate' || s === 'high' || s === 'critical') && + count > 0 + }) + + if (sevs.length > 1) { + const severities = sevs.map(([s, count]) => { + return `${count} ${c.severity(s)}` + }).join(', ') + output.push(`${c.red(total)} vulnerabilities (${severities})`) + } else { + const [sev, count] = sevs[0] + output.push(`${count} ${c.severity(sev)} severity vulnerabilit${count === 1 ? 'y' : 'ies'}`) + } + + // XXX use a different footer line if some aren't fixable easily. + // just 'run `npm audit` for details' maybe? + + if (someFixable) { + output.push('', 'To address ' + + (someForceFixable || someUnfixable ? 'issues that do not require attention' + : 'all issues') + ', run:\n npm audit fix') + } + + if (someForceFixable) { + output.push('', 'To address all issues' + + (someUnfixable ? ' possible' : '') + + (forceFixSemVerMajor ? ' (including breaking changes)' : '') + + ', run:\n npm audit fix --force') + } + + if (someUnfixable) { + output.push('', + 'Some issues need review, and may require choosing', + 'a different dependency.') + } + } + + const summary = output.join('\n') + return { + summary, + report: vulnCount > 0 ? `${summary}\n\nRun \`npm audit\` for details.` + : summary + } +} + +module.exports = Object.assign((data, opt) => calculate(data, opt).report, { + summary: (data, opt) => calculate(data, opt).summary +}) diff --git a/deps/npm/node_modules/npm-audit-report/lib/reporters/json.js b/deps/npm/node_modules/npm-audit-report/lib/reporters/json.js new file mode 100644 index 00000000000000..6714720a54e64e --- /dev/null +++ b/deps/npm/node_modules/npm-audit-report/lib/reporters/json.js @@ -0,0 +1 @@ +module.exports = (data, { indent }) => JSON.stringify(data, null, indent) diff --git a/deps/npm/node_modules/npm-audit-report/lib/reporters/quiet.js b/deps/npm/node_modules/npm-audit-report/lib/reporters/quiet.js new file mode 100644 index 00000000000000..57517aae8f19f3 --- /dev/null +++ b/deps/npm/node_modules/npm-audit-report/lib/reporters/quiet.js @@ -0,0 +1 @@ +module.exports = () => '' diff --git a/deps/npm/node_modules/npm-audit-report/lib/utils.js b/deps/npm/node_modules/npm-audit-report/lib/utils.js deleted file mode 100644 index 3b521a5f3bd96f..00000000000000 --- a/deps/npm/node_modules/npm-audit-report/lib/utils.js +++ /dev/null @@ -1,60 +0,0 @@ -'use strict' - -exports.severityLabel = severityLabel -exports.color = color -exports.totalVulnCount = totalVulnCount -exports.severities = severities - -const ccs = require('console-control-strings') - -const severityColors = { - critical: { - color: 'brightMagenta', - label: 'Critical' - }, - high: { - color: 'brightRed', - label: 'High' - }, - moderate: { - color: 'brightYellow', - label: 'Moderate' - }, - low: { - color: 'bold', - label: 'Low' - }, - info: { - color: '', - label: 'Info' - } -} - -function color (value, colorName, withColor) { - return (colorName && withColor) ? ccs.color(colorName) + value + ccs.color('reset') : value -} - -function severityLabel (sev, withColor, bold) { - if (!(sev in severityColors)) return sev.charAt(0).toUpperCase() + sev.substr(1).toLowerCase() - let colorName = severityColors[sev].color - if (bold) colorName = [colorName, 'bold'] - return color(severityColors[sev].label, colorName, withColor) -} - -function totalVulnCount (vulns) { - return Object.keys(vulns).reduce((accumulator, key) => { - const vulnCount = vulns[key] - accumulator += vulnCount - - return accumulator - }, 0) -} - -function severities (vulns) { - return Object.keys(vulns).reduce((accumulator, severity) => { - const vulnCount = vulns[severity] - if (vulnCount > 0) accumulator.push([severity, vulnCount]) - - return accumulator - }, []) -} diff --git a/deps/npm/node_modules/npm-audit-report/package.json b/deps/npm/node_modules/npm-audit-report/package.json index dfc8bda28f844d..66b4a6aa74b2c1 100644 --- a/deps/npm/node_modules/npm-audit-report/package.json +++ b/deps/npm/node_modules/npm-audit-report/package.json @@ -1,76 +1,52 @@ { - "_from": "npm-audit-report@1.3.3", - "_id": "npm-audit-report@1.3.3", - "_inBundle": false, - "_integrity": "sha512-8nH/JjsFfAWMvn474HB9mpmMjrnKb1Hx/oTAdjv4PT9iZBvBxiZ+wtDUapHCJwLqYGQVPaAfs+vL5+5k9QndXw==", - "_location": "/npm-audit-report", - "_phantomChildren": {}, - "_requested": { - "type": "version", - "registry": true, - "raw": "npm-audit-report@1.3.3", - "name": "npm-audit-report", - "escapedName": "npm-audit-report", - "rawSpec": "1.3.3", - "saveSpec": null, - "fetchSpec": "1.3.3" - }, - "_requiredBy": [ - "#USER", - "/" - ], - "_resolved": "https://registry.npmjs.org/npm-audit-report/-/npm-audit-report-1.3.3.tgz", - "_shasum": "8226deeb253b55176ed147592a3995442f2179ed", - "_spec": "npm-audit-report@1.3.3", - "_where": "/Users/claudiahdz/npm/cli", - "author": { - "name": "Adam Baldwin" - }, - "bugs": { - "url": "https://github.com/npm/npm-audit-report/issues" - }, - "bundleDependencies": false, - "dependencies": { - "cli-table3": "^0.5.0", - "console-control-strings": "^1.1.0" - }, - "deprecated": false, + "name": "npm-audit-report", + "version": "2.1.4", "description": "Given a response from the npm security api, render it into a variety of security reports", - "devDependencies": { - "keyfob": "^1.0.0", - "standard": "^11.0.1", - "standard-version": "^4.3.0", - "tap": "^11.1.5" + "main": "lib/index.js", + "scripts": { + "test": "tap", + "snap": "tap", + "preversion": "npm test", + "postversion": "npm publish", + "prepublishOnly": "git push origin --follow-tags" }, - "directories": { - "lib": "lib", - "test": "test" + "tap": { + "check-coverage": true, + "coverage-map": "map.js" }, - "files": [ - "index.js", - "lib", - "reporters" - ], - "homepage": "https://github.com/npm/npm-audit-report#readme", "keywords": [ "npm", "security", "report", "audit" ], + "author": "Adam Baldwin", "license": "ISC", - "main": "index.js", - "name": "npm-audit-report", + "dependencies": { + "chalk": "^4.0.0" + }, + "devDependencies": { + "tap": "^14.10.7", + "require-inject": "^1.4.4" + }, + "directories": { + "lib": "lib", + "test": "test" + }, "repository": { "type": "git", "url": "git+https://github.com/npm/npm-audit-report.git" }, - "scripts": { - "postrelease": "npm publish && git push --follow-tags", - "prerelease": "npm t", - "pretest": "standard", - "release": "standard-version -s", - "test": "tap --100 -J --coverage test/*.js" + "bugs": { + "url": "https://github.com/npm/npm-audit-report/issues" }, - "version": "1.3.3" + "homepage": "https://github.com/npm/npm-audit-report#readme", + "files": [ + "index.js", + "lib", + "reporters" + ], + "engines": { + "node": ">=10" + } } diff --git a/deps/npm/node_modules/npm-audit-report/reporters/detail.js b/deps/npm/node_modules/npm-audit-report/reporters/detail.js deleted file mode 100644 index f6e822eb7ae6f7..00000000000000 --- a/deps/npm/node_modules/npm-audit-report/reporters/detail.js +++ /dev/null @@ -1,197 +0,0 @@ -'use strict' - -const summary = require('./install.js').summary -const Table = require('cli-table3') -const Utils = require('../lib/utils') - -const report = function (data, options) { - const defaults = { - severityThreshold: 'info' - } - - const blankChars = { - 'top': ' ', - 'top-mid': ' ', - 'top-left': ' ', - 'top-right': ' ', - 'bottom': ' ', - 'bottom-mid': ' ', - 'bottom-left': ' ', - 'bottom-right': ' ', - 'left': ' ', - 'left-mid': ' ', - 'mid': ' ', - 'mid-mid': ' ', - 'right': ' ', - 'right-mid': ' ', - 'middle': ' ' - } - - const config = Object.assign({}, defaults, options) - - let output = '' - let exit = 0 - - const log = function (value) { - output = output + value + '\n' - } - - const footer = function (data) { - const total = Utils.totalVulnCount(data.metadata.vulnerabilities) - - if (total > 0) { - exit = 1 - } - log(`${summary(data, config)} in ${data.metadata.totalDependencies} scanned package${data.metadata.totalDependencies === 1 ? '' : 's'}`) - if (total) { - const counts = data.actions.reduce((acc, {action, isMajor, resolves}) => { - if (action === 'update' || (action === 'install' && !isMajor)) { - resolves.forEach(({id, path}) => acc.advisories.add(`${id}::${path}`)) - } - if (isMajor) { - resolves.forEach(({id, path}) => acc.major.add(`${id}::${path}`)) - } - if (action === 'review') { - resolves.forEach(({id, path}) => acc.review.add(`${id}::${path}`)) - } - return acc - }, {advisories: new Set(), major: new Set(), review: new Set()}) - if (counts.advisories.size) { - log(` run \`npm audit fix\` to fix ${counts.advisories.size} of them.`) - } - if (counts.major.size) { - const maj = counts.major.size - log(` ${maj} vulnerabilit${maj === 1 ? 'y' : 'ies'} require${maj === 1 ? 's' : ''} semver-major dependency updates.`) - } - if (counts.review.size) { - const rev = counts.review.size - log(` ${rev} vulnerabilit${rev === 1 ? 'y' : 'ies'} require${rev === 1 ? 's' : ''} manual review. See the full report for details.`) - } - } - } - - const reportTitle = function () { - const tableOptions = { - colWidths: [78] - } - tableOptions.chars = blankChars - const table = new Table(tableOptions) - table.push([{ - content: '=== npm audit security report ===', - vAlign: 'center', - hAlign: 'center' - }]) - log(table.toString()) - } - - const actions = function (data, config) { - reportTitle() - - if (Object.keys(data.advisories).length !== 0) { - // vulns found display a report. - - let reviewFlag = false - - data.actions.forEach((action) => { - if (action.action === 'update' || action.action === 'install') { - const recommendation = getRecommendation(action, config) - const label = action.resolves.length === 1 ? 'vulnerability' : 'vulnerabilities' - log(`# Run ${Utils.color(' ' + recommendation.cmd + ' ', 'inverse', config.withColor)} to resolve ${action.resolves.length} ${label}`) - if (recommendation.isBreaking) { - log(`SEMVER WARNING: Recommended action is a potentially breaking change`) - } - - action.resolves.forEach((resolution) => { - const advisory = data.advisories[resolution.id] - const tableOptions = { - colWidths: [15, 62], - wordWrap: true - } - if (!config.withUnicode) { - tableOptions.chars = blankChars - } - const table = new Table(tableOptions) - - table.push( - {[Utils.severityLabel(advisory.severity, config.withColor, true)]: Utils.color(advisory.title, 'bold', config.withColor)}, - {'Package': advisory.module_name}, - {'Dependency of': `${resolution.path.split('>')[0]} ${resolution.dev ? '[dev]' : ''}`}, - {'Path': `${resolution.path.split('>').join(Utils.color(' > ', 'grey', config.withColor))}`}, - {'More info': advisory.url || `https://www.npmjs.com/advisories/${advisory.id}`} - ) - - log(table.toString() + '\n\n') - }) - } - if (action.action === 'review') { - if (!reviewFlag) { - const tableOptions = { - colWidths: [78] - } - if (!config.withUnicode) { - tableOptions.chars = blankChars - } - const table = new Table(tableOptions) - table.push([{ - content: 'Manual Review\nSome vulnerabilities require your attention to resolve\n\nVisit https://go.npm.me/audit-guide for additional guidance', - vAlign: 'center', - hAlign: 'center' - }]) - - log(table.toString()) - } - reviewFlag = true - - action.resolves.forEach((resolution) => { - const advisory = data.advisories[resolution.id] - const tableOptions = { - colWidths: [15, 62], - wordWrap: true - } - if (!config.withUnicode) { - tableOptions.chars = blankChars - } - const table = new Table(tableOptions) - const patchedIn = advisory.patched_versions.replace(' ', '') === '<0.0.0' ? 'No patch available' : advisory.patched_versions - - table.push( - {[Utils.severityLabel(advisory.severity, config.withColor, true)]: Utils.color(advisory.title, 'bold', config.withColor)}, - {'Package': advisory.module_name}, - {'Patched in': patchedIn}, - {'Dependency of': `${resolution.path.split('>')[0]} ${resolution.dev ? '[dev]' : ''}`}, - {'Path': `${resolution.path.split('>').join(Utils.color(' > ', 'grey', config.withColor))}`}, - {'More info': advisory.url || `https://www.npmjs.com/advisories/${advisory.id}`} - ) - log(table.toString()) - }) - } - }) - } - } - - actions(data, config) - footer(data) - - return { - report: output.trim(), - exitCode: exit - } -} - -const getRecommendation = function (action, config) { - if (action.action === 'install') { - const isDev = action.resolves[0].dev - - return { - cmd: `npm install ${isDev ? '--save-dev ' : ''}${action.module}@${action.target}`, - isBreaking: action.isMajor - } - } else { - return { - cmd: `npm update ${action.module} --depth ${action.depth}`, - isBreaking: false - } - } -} - -module.exports = report diff --git a/deps/npm/node_modules/npm-audit-report/reporters/install.js b/deps/npm/node_modules/npm-audit-report/reporters/install.js deleted file mode 100644 index 96ea12bd814e44..00000000000000 --- a/deps/npm/node_modules/npm-audit-report/reporters/install.js +++ /dev/null @@ -1,61 +0,0 @@ -'use strict' - -const Utils = require('../lib/utils') - -module.exports = report -function report (data, options) { - let msg = summary(data, options) - if (!Object.keys(data.advisories).length) { - return { - report: msg, - exitCode: 0 - } - } else { - msg += '\n run `npm audit fix` to fix them, or `npm audit` for details' - return { - report: msg, - exitCode: 1 - } - } -} - -module.exports.summary = summary -function summary (data, options) { - const defaults = { - severityThreshold: 'info' - } - - const config = Object.assign({}, defaults, options) - - function clr (str, clr) { return Utils.color(str, clr, config.withColor) } - function green (str) { return clr(str, 'brightGreen') } - function red (str) { return clr(str, 'brightRed') } - - let output = '' - - const log = function (value) { - output = output + value + '\n' - } - - output += 'found ' - - if (Object.keys(data.advisories).length === 0) { - log(`${green('0')} vulnerabilities`) - return output - } else { - const total = Utils.totalVulnCount(data.metadata.vulnerabilities) - const sev = Utils.severities(data.metadata.vulnerabilities) - - if (sev.length > 1) { - const severities = sev.map((value) => { - return `${value[1]} ${Utils.severityLabel(value[0], config.withColor).toLowerCase()}` - }).join(', ') - log(`${red(total)} vulnerabilities (${severities})`) - } else { - const vulnCount = sev[0][1] - const vulnLabel = Utils.severityLabel(sev[0][0], config.withColor).toLowerCase() - log(`${vulnCount} ${vulnLabel} severity vulnerabilit${vulnCount === 1 ? 'y' : 'ies'}`) - } - } - return output.trim() -} diff --git a/deps/npm/node_modules/npm-audit-report/reporters/json.js b/deps/npm/node_modules/npm-audit-report/reporters/json.js deleted file mode 100644 index 6bf5097efd7ec9..00000000000000 --- a/deps/npm/node_modules/npm-audit-report/reporters/json.js +++ /dev/null @@ -1,17 +0,0 @@ -'use strict' - -const report = function (data, options) { - const defaults = { - indent: 2 - } - - const config = Object.assign({}, defaults, options) - - const json = JSON.stringify(data, null, config.indent) - return { - report: json, - exitCode: 0 - } -} - -module.exports = report diff --git a/deps/npm/node_modules/npm-audit-report/reporters/parseable.js b/deps/npm/node_modules/npm-audit-report/reporters/parseable.js deleted file mode 100644 index 1d46ef22716cd4..00000000000000 --- a/deps/npm/node_modules/npm-audit-report/reporters/parseable.js +++ /dev/null @@ -1,99 +0,0 @@ -'use strict' - -const report = function (data, options) { - const defaults = { - severityThreshold: 'info' - } - - const config = Object.assign({}, defaults, options) - - let exit = 0 - - const actions = function (data, config) { - let accumulator = { - critical: '', - high: '', - moderate: '', - low: '' - } - - if (Object.keys(data.advisories).length !== 0) { - data.actions.forEach((action) => { - let l = {} - // Start with install/update actions - if (action.action === 'update' || action.action === 'install') { - const recommendation = getRecommendation(action, config) - l.recommendation = recommendation.cmd - l.breaking = recommendation.isBreaking ? 'Y' : 'N' - - action.resolves.forEach((resolution) => { - const advisory = data.advisories[resolution.id] - - l.sevLevel = advisory.severity - l.severity = advisory.title - l.package = advisory.module_name - l.moreInfo = advisory.url || `https://www.npmjs.com/advisories/${advisory.id}` - l.path = resolution.path - - accumulator[advisory.severity] += [action.action, l.package, l.sevLevel, l.recommendation, l.severity, l.moreInfo, l.path, l.breaking] - .join('\t') + '\n' - }) // forEach resolves - } - - if (action.action === 'review') { - action.resolves.forEach((resolution) => { - const advisory = data.advisories[resolution.id] - - l.sevLevel = advisory.severity - l.severity = advisory.title - l.package = advisory.module_name - l.moreInfo = advisory.url || `https://www.npmjs.com/advisories/${advisory.id}` - l.patchedIn = advisory.patched_versions.replace(' ', '') === '<0.0.0' ? 'No patch available' : advisory.patched_versions - l.path = resolution.path - - accumulator[advisory.severity] += [action.action, l.package, l.sevLevel, l.patchedIn, l.severity, l.moreInfo, l.path].join('\t') + '\n' - }) // forEach resolves - } // is review - }) // forEach actions - } - return accumulator['critical'] + accumulator['high'] + accumulator['moderate'] + accumulator['low'] - } - - const exitCode = function (metadata) { - let total = 0 - const keys = Object.keys(metadata.vulnerabilities) - for (let key of keys) { - const value = metadata.vulnerabilities[key] - total = total + value - } - - if (total > 0) { - exit = 1 - } - } - - exitCode(data.metadata) - - return { - report: actions(data, config), - exitCode: exit - } -} - -const getRecommendation = function (action, config) { - if (action.action === 'install') { - const isDev = action.resolves[0].dev - - return { - cmd: `npm install ${isDev ? '--save-dev ' : ''}${action.module}@${action.target}`, - isBreaking: action.isMajor - } - } else { - return { - cmd: `npm update ${action.module} --depth ${action.depth}`, - isBreaking: false - } - } -} - -module.exports = report diff --git a/deps/npm/node_modules/npm-audit-report/reporters/quiet.js b/deps/npm/node_modules/npm-audit-report/reporters/quiet.js deleted file mode 100644 index d6f5c5846b98b3..00000000000000 --- a/deps/npm/node_modules/npm-audit-report/reporters/quiet.js +++ /dev/null @@ -1,14 +0,0 @@ -'use strict' - -const Utils = require('../lib/utils') - -const report = function (data) { - const totalVulnCount = Utils.totalVulnCount(data.metadata.vulnerabilities) - - return { - report: '', - exitCode: totalVulnCount === 0 ? 0 : 1 - } -} - -module.exports = report diff --git a/deps/npm/node_modules/npm-bundled/package.json b/deps/npm/node_modules/npm-bundled/package.json index 18c578a5cb72da..2ce536e673ee3c 100644 --- a/deps/npm/node_modules/npm-bundled/package.json +++ b/deps/npm/node_modules/npm-bundled/package.json @@ -1,63 +1,30 @@ { - "_from": "npm-bundled@^1.0.1", - "_id": "npm-bundled@1.1.1", - "_inBundle": false, - "_integrity": "sha512-gqkfgGePhTpAEgUsGEgcq1rqPXA+tv/aVBlgEzfXwA1yiUJF7xtEt3CtVwOjNYQOVknDk0F20w58Fnm3EtG0fA==", - "_location": "/npm-bundled", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "npm-bundled@^1.0.1", - "name": "npm-bundled", - "escapedName": "npm-bundled", - "rawSpec": "^1.0.1", - "saveSpec": null, - "fetchSpec": "^1.0.1" - }, - "_requiredBy": [ - "/npm-packlist" - ], - "_resolved": "https://registry.npmjs.org/npm-bundled/-/npm-bundled-1.1.1.tgz", - "_shasum": "1edd570865a94cdb1bc8220775e29466c9fb234b", - "_spec": "npm-bundled@^1.0.1", - "_where": "/Users/isaacs/dev/npm/cli/node_modules/npm-packlist", - "author": { - "name": "Isaac Z. Schlueter", - "email": "i@izs.me", - "url": "http://blog.izs.me/" - }, - "bugs": { - "url": "https://github.com/npm/npm-bundled/issues" - }, - "bundleDependencies": false, - "dependencies": { - "npm-normalize-package-bin": "^1.0.1" - }, - "deprecated": false, + "name": "npm-bundled", + "version": "1.1.1", "description": "list things in node_modules that are bundledDependencies, or transitive dependencies thereof", + "main": "index.js", + "repository": { + "type": "git", + "url": "git+https://github.com/npm/npm-bundled.git" + }, + "author": "Isaac Z. Schlueter (http://blog.izs.me/)", + "license": "ISC", "devDependencies": { "mkdirp": "^0.5.1", "mutate-fs": "^1.1.0", "rimraf": "^2.6.1", "tap": "^12.0.1" }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/npm/npm-bundled#readme", - "license": "ISC", - "main": "index.js", - "name": "npm-bundled", - "repository": { - "type": "git", - "url": "git+https://github.com/npm/npm-bundled.git" - }, "scripts": { - "postpublish": "git push origin --all; git push origin --tags", - "postversion": "npm publish", + "test": "tap test/*.js -J --100", "preversion": "npm test", - "test": "tap test/*.js -J --100" + "postversion": "npm publish", + "postpublish": "git push origin --all; git push origin --tags" }, - "version": "1.1.1" + "files": [ + "index.js" + ], + "dependencies": { + "npm-normalize-package-bin": "^1.0.1" + } } diff --git a/deps/npm/node_modules/npm-cache-filename/README.md b/deps/npm/node_modules/npm-cache-filename/README.md deleted file mode 100644 index 47bd08a4940c52..00000000000000 --- a/deps/npm/node_modules/npm-cache-filename/README.md +++ /dev/null @@ -1,21 +0,0 @@ -# npm-cache-filename - -Given a cache folder and url, return the appropriate cache folder. - -## USAGE - -```javascript -var cf = require('npm-cache-filename'); -console.log(cf('/tmp/cache', 'https://registry.npmjs.org:1234/foo/bar')); -// outputs: /tmp/cache/registry.npmjs.org_1234/foo/bar -``` - -As a bonus, you can also bind it to a specific root path: - -```javascript -var cf = require('npm-cache-filename'); -var getFile = cf('/tmp/cache'); - -console.log(getFile('https://registry.npmjs.org:1234/foo/bar')); -// outputs: /tmp/cache/registry.npmjs.org_1234/foo/bar -``` diff --git a/deps/npm/node_modules/npm-cache-filename/index.js b/deps/npm/node_modules/npm-cache-filename/index.js deleted file mode 100644 index 50d21792b2255d..00000000000000 --- a/deps/npm/node_modules/npm-cache-filename/index.js +++ /dev/null @@ -1,24 +0,0 @@ -var url = require('url');; -var path = require('path');; - -module.exports = cf;; - -function cf(root, u) { - if (!u) - return cf.bind(null, root);; - - u = url.parse(u);; - var h = u.host.replace(/:/g, '_');; - // Strip off any /-rev/... or ?rev=... bits - var revre = /(\?rev=|\?.*?&rev=|\/-rev\/).*$/;; - var parts = u.path.replace(revre, '').split('/').slice(1);; - // Make sure different git references get different folders - if (u.hash && u.hash.length > 1) { - parts.push(u.hash.slice(1));; - };; - var p = [root, h].concat(parts.map(function(part) { - return encodeURIComponent(part).replace(/%/g, '_');; - }));; - - return path.join.apply(path, p);; -} diff --git a/deps/npm/node_modules/npm-cache-filename/package.json b/deps/npm/node_modules/npm-cache-filename/package.json deleted file mode 100644 index 934fb2316da010..00000000000000 --- a/deps/npm/node_modules/npm-cache-filename/package.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "_args": [ - [ - "npm-cache-filename@1.0.2", - "/Users/rebecca/code/npm" - ] - ], - "_from": "npm-cache-filename@1.0.2", - "_id": "npm-cache-filename@1.0.2", - "_inBundle": false, - "_integrity": "sha1-3tMGxbC/yHCp6fr4I7xfKD4FrhE=", - "_location": "/npm-cache-filename", - "_phantomChildren": {}, - "_requested": { - "type": "version", - "registry": true, - "raw": "npm-cache-filename@1.0.2", - "name": "npm-cache-filename", - "escapedName": "npm-cache-filename", - "rawSpec": "1.0.2", - "saveSpec": null, - "fetchSpec": "1.0.2" - }, - "_requiredBy": [ - "/" - ], - "_resolved": "https://registry.npmjs.org/npm-cache-filename/-/npm-cache-filename-1.0.2.tgz", - "_spec": "1.0.2", - "_where": "/Users/rebecca/code/npm", - "author": { - "name": "Isaac Z. Schlueter", - "email": "i@izs.me", - "url": "http://blog.izs.me/" - }, - "bugs": { - "url": "https://github.com/npm/npm-cache-filename/issues" - }, - "dependencies": {}, - "description": "Given a cache folder and url, return the appropriate cache folder.", - "devDependencies": { - "tap": "^1.2.0" - }, - "homepage": "https://github.com/npm/npm-cache-filename", - "license": "ISC", - "main": "index.js", - "name": "npm-cache-filename", - "repository": { - "type": "git", - "url": "git://github.com/npm/npm-cache-filename.git" - }, - "scripts": { - "test": "tap test.js" - }, - "version": "1.0.2" -} diff --git a/deps/npm/node_modules/npm-cache-filename/test.js b/deps/npm/node_modules/npm-cache-filename/test.js deleted file mode 100644 index bdca80b50438cb..00000000000000 --- a/deps/npm/node_modules/npm-cache-filename/test.js +++ /dev/null @@ -1,23 +0,0 @@ -var test = require('tap').test;; -test('it does the thing it says it does', function(t) { - var cf = require('./');; - - t.equal(cf('/tmp/cache', 'https://foo:134/xyz?adf=foo:bar/baz'), - '/tmp/cache/foo_134/xyz_3Fadf_3Dfoo_3Abar/baz');; - - var getFile = cf('/tmp/cache');; - t.equal(getFile('https://foo:134/xyz?adf=foo:bar/baz'), - '/tmp/cache/foo_134/xyz_3Fadf_3Dfoo_3Abar/baz');; - - t.equal(cf("/tmp", "https://foo:134/xyz/-rev/baz"), - '/tmp/foo_134/xyz') - t.equal(cf("/tmp", "https://foo:134/xyz/?rev=baz"), - '/tmp/foo_134/xyz') - t.equal(cf("/tmp", "https://foo:134/xyz/?foo&rev=baz"), - '/tmp/foo_134/xyz') - t.equal(cf("/tmp", "https://foo:134/xyz-rev/baz"), - '/tmp/foo_134/xyz-rev/baz') - t.equal(cf("/tmp", "git://foo:134/xyz-rev/baz.git#master"), - '/tmp/foo_134/xyz-rev/baz.git/master') - t.end(); -});; diff --git a/deps/npm/node_modules/npm-install-checks/CHANGELOG.md b/deps/npm/node_modules/npm-install-checks/CHANGELOG.md index f16f72d2fb4a01..ae4f22fcf52c33 100644 --- a/deps/npm/node_modules/npm-install-checks/CHANGELOG.md +++ b/deps/npm/node_modules/npm-install-checks/CHANGELOG.md @@ -1,10 +1,18 @@ -### v3.0.0 2016-01-12 +# Change Log + +## v4.0 + +* Remove `checkCycle` and `checkGit`, as they are no longer used in npm v7 +* Synchronous throw-or-return API instead of taking a callback needlessly +* Modernize code and drop support for node versions less than 10 + +## v3 2016-01-12 * Change error messages to be more informative. * checkEngine, when not in strict mode, now calls back with the error object as the second argument instead of warning. * checkCycle no longer logs when cycle errors are found. -### v2.0.0 2015-01-20 +## v2 2015-01-20 * Remove checking of engineStrict in the package.json diff --git a/deps/npm/node_modules/npm-install-checks/README.md b/deps/npm/node_modules/npm-install-checks/README.md index 19ae5a4af3af51..e83356c1dd9ba5 100644 --- a/deps/npm/node_modules/npm-install-checks/README.md +++ b/deps/npm/node_modules/npm-install-checks/README.md @@ -1,27 +1,27 @@ # npm-install-checks -A package that contains checks that npm runs during the installation. +Check the engines and platform fields in package.json ## API -### .checkEngine(target, npmVer, nodeVer, force, strict, cb) -Check if node/npm version is supported by the package. If not -strict and it isn't supported, `cb` is called with the error -object as its second argument. +Both functions will throw an error if the check fails, or return +`undefined` if everything is ok. -Error type: `ENOTSUP` +Errors have a `required` and `current` fields. -### .checkPlatform(target, force, cb) -Check if OS/Arch is supported by the package. +### .checkEngine(pkg, npmVer, nodeVer, force = false) + +Check if node/npm version is supported by the package. If it isn't +supported, an error is thrown. -Error type: `EBADPLATFORM` +`force` argument will override the node version check, but not the npm +version check, as this typically would indicate that the current version of +npm is unable to install the package properly for some reason. -### .checkCycle(target, ancestors, cb) -Check for cyclic dependencies. +Error code: 'EBADENGINE' -Error type: `ECYCLE` +### .checkPlatform(pkg, force) -### .checkGit(folder, cb) -Check if a folder is a .git folder. +Check if OS/Arch is supported by the package. -Error type: `EISGIT` +Error code: 'EBADPLATFORM' diff --git a/deps/npm/node_modules/npm-install-checks/index.js b/deps/npm/node_modules/npm-install-checks/index.js index a533c9d36063e9..732888ef57b8a8 100644 --- a/deps/npm/node_modules/npm-install-checks/index.js +++ b/deps/npm/node_modules/npm-install-checks/index.js @@ -1,145 +1,79 @@ -var fs = require('fs') -var path = require('path') -var util = require('util') -var semver = require('semver') +const {format} = require('util') +const semver = require('semver') -exports.checkEngine = checkEngine -function checkEngine (target, npmVer, nodeVer, force, strict, cb) { - var nodev = force ? null : nodeVer - var eng = target.engines - var opt = { includePrerelease: true } - if (!eng) return cb() - if (nodev && eng.node && !semver.satisfies(nodev, eng.node, opt) || - eng.npm && !semver.satisfies(npmVer, eng.npm, opt)) { - var er = new Error(util.format('Unsupported engine for %s: wanted: %j (current: %j)', - target._id, eng, {node: nodev, npm: npmVer})) - er.code = 'ENOTSUP' - er.required = eng - er.pkgid = target._id - if (strict) { - return cb(er) - } else { - return cb(null, er) - } +const checkEngine = (target, npmVer, nodeVer, force = false) => { + const nodev = force ? null : nodeVer + const eng = target.engines + const opt = { includePrerelease: true } + if (!eng) { + return } - return cb() -} -exports.checkPlatform = checkPlatform -function checkPlatform (target, force, cb) { - var platform = process.platform - var arch = process.arch - var osOk = true - var cpuOk = true + const nodeFail = nodev && eng.node && !semver.satisfies(nodev, eng.node, opt) + const npmFail = npmVer && eng.npm && !semver.satisfies(npmVer, eng.npm, opt) + if (nodeFail || npmFail) { + throw Object.assign(new Error('Unsupported engine'), { + pkgid: target._id, + current: { node: nodeVer, npm: npmVer }, + required: eng, + code: 'EBADENGINE' + }) + } +} +const checkPlatform = (target, force = false) => { if (force) { - return cb() + return } - if (target.os) { - osOk = checkList(platform, target.os) - } - if (target.cpu) { - cpuOk = checkList(arch, target.cpu) - } + const platform = process.platform + const arch = process.arch + const osOk = target.os ? checkList(platform, target.os) : true + const cpuOk = target.cpu ? checkList(arch, target.cpu) : true + if (!osOk || !cpuOk) { - var er = new Error(util.format('Unsupported platform for %s: wanted %j (current: %j)', - target._id, target, {os: platform, cpu: arch})) - er.code = 'EBADPLATFORM' - er.os = target.os || ['any'] - er.cpu = target.cpu || ['any'] - er.pkgid = target._id - return cb(er) + throw Object.assign(new Error('Unsupported platform'), { + pkgid: target._id, + current: { + os: platform, + cpu: arch + }, + required: { + os: target.os, + cpu: target.cpu + }, + code: 'EBADPLATFORM' + }) } - return cb() } -function checkList (value, list) { - var tmp - var match = false - var blc = 0 +const checkList = (value, list) => { if (typeof list === 'string') { list = [list] } if (list.length === 1 && list[0] === 'any') { return true } - for (var i = 0; i < list.length; ++i) { - tmp = list[i] - if (tmp[0] === '!') { - tmp = tmp.slice(1) - if (tmp === value) { + // match none of the negated values, and at least one of the + // non-negated values, if any are present. + let negated = 0 + let match = false + for (const entry of list) { + const negate = entry.charAt(0) === '!' + const test = negate ? entry.slice(1) : entry + if (negate) { + negated ++ + if (value === test) { return false } - ++blc } else { - match = match || tmp === value + match = match || value === test } } - return match || blc === list.length + return match || negated === list.length } -exports.checkCycle = checkCycle -function checkCycle (target, ancestors, cb) { - // there are some very rare and pathological edge-cases where - // a cycle can cause npm to try to install a never-ending tree - // of stuff. - // Simplest: - // - // A -> B -> A' -> B' -> A -> B -> A' -> B' -> A -> ... - // - // Solution: Simply flat-out refuse to install any name@version - // that is already in the prototype tree of the ancestors object. - // A more correct, but more complex, solution would be to symlink - // the deeper thing into the new location. - // Will do that if anyone whines about this irl. - // - // Note: `npm install foo` inside of the `foo` package will abort - // earlier if `--force` is not set. However, if it IS set, then - // we need to still fail here, but just skip the first level. Of - // course, it'll still fail eventually if it's a true cycle, and - // leave things in an undefined state, but that's what is to be - // expected when `--force` is used. That is why getPrototypeOf - // is used *twice* here: to skip the first level of repetition. - - var p = Object.getPrototypeOf(Object.getPrototypeOf(ancestors)) - var name = target.name - var version = target.version - while (p && p !== Object.prototype && p[name] !== version) { - p = Object.getPrototypeOf(p) - } - if (p[name] !== version) return cb() - - var er = new Error(target._id + ': Unresolvable cycle detected') - var tree = [target._id, JSON.parse(JSON.stringify(ancestors))] - var t = Object.getPrototypeOf(ancestors) - while (t && t !== Object.prototype) { - if (t === p) t.THIS_IS_P = true - tree.push(JSON.parse(JSON.stringify(t))) - t = Object.getPrototypeOf(t) - } - er.pkgid = target._id - er.code = 'ECYCLE' - return cb(er) -} - -exports.checkGit = checkGit -function checkGit (folder, cb) { - // if it's a git repo then don't touch it! - fs.lstat(folder, function (er, s) { - if (er || !s.isDirectory()) return cb() - else checkGit_(folder, cb) - }) -} - -function checkGit_ (folder, cb) { - fs.stat(path.resolve(folder, '.git'), function (er, s) { - if (!er && s.isDirectory()) { - var e = new Error(folder + ': Appears to be a git repo or submodule.') - e.path = folder - e.code = 'EISGIT' - return cb(e) - } - cb() - }) +module.exports = { + checkEngine, + checkPlatform } diff --git a/deps/npm/node_modules/npm-install-checks/package.json b/deps/npm/node_modules/npm-install-checks/package.json index dc409c761cc54f..0eb597ae83480a 100644 --- a/deps/npm/node_modules/npm-install-checks/package.json +++ b/deps/npm/node_modules/npm-install-checks/package.json @@ -1,64 +1,33 @@ { - "_from": "npm-install-checks@3.0.2", - "_id": "npm-install-checks@3.0.2", - "_inBundle": false, - "_integrity": "sha512-E4kzkyZDIWoin6uT5howP8VDvkM+E8IQDcHAycaAxMbwkqhIg5eEYALnXOl3Hq9MrkdQB/2/g1xwBINXdKSRkg==", - "_location": "/npm-install-checks", - "_phantomChildren": {}, - "_requested": { - "type": "version", - "registry": true, - "raw": "npm-install-checks@3.0.2", - "name": "npm-install-checks", - "escapedName": "npm-install-checks", - "rawSpec": "3.0.2", - "saveSpec": null, - "fetchSpec": "3.0.2" - }, - "_requiredBy": [ - "#USER", - "/" - ], - "_resolved": "https://registry.npmjs.org/npm-install-checks/-/npm-install-checks-3.0.2.tgz", - "_shasum": "ab2e32ad27baa46720706908e5b14c1852de44d9", - "_spec": "npm-install-checks@3.0.2", - "_where": "/Users/isaacs/dev/npm/cli", - "author": { - "name": "Robert Kowalski", - "email": "rok@kowalski.gd" - }, - "bugs": { - "url": "https://github.com/npm/npm-install-checks/issues" - }, - "bundleDependencies": false, + "name": "npm-install-checks", + "version": "4.0.0", + "description": "Check the engines and platform fields in package.json", + "main": "index.js", "dependencies": { - "semver": "^2.3.0 || 3.x || 4 || 5" + "semver": "^7.1.1" }, - "deprecated": false, - "description": "checks that npm runs during the installation of a module", "devDependencies": { - "mkdirp": "^0.5.1", - "rimraf": "^2.6.3", - "standard": "^5.4.1", - "tap": "^12.4.0" + "tap": "^14.10.6" + }, + "scripts": { + "test": "tap", + "preversion": "npm test", + "postversion": "npm publish", + "postpublish": "git push origin --follow-tags" + }, + "repository": { + "type": "git", + "url": "git://github.com/npm/npm-install-checks.git" }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/npm/npm-install-checks", "keywords": [ "npm,", "install" ], "license": "BSD-2-Clause", - "main": "index.js", - "name": "npm-install-checks", - "repository": { - "type": "git", - "url": "git://github.com/npm/npm-install-checks.git" - }, - "scripts": { - "test": "standard && tap --coverage test/*.js" - }, - "version": "3.0.2" + "files": [ + "index.js" + ], + "engines": { + "node": ">=10" + } } diff --git a/deps/npm/node_modules/npm-lifecycle/CHANGELOG.md b/deps/npm/node_modules/npm-lifecycle/CHANGELOG.md deleted file mode 100644 index cf10c2f580aced..00000000000000 --- a/deps/npm/node_modules/npm-lifecycle/CHANGELOG.md +++ /dev/null @@ -1,189 +0,0 @@ -# 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.1.5](https://github.com/npm/lifecycle/compare/v3.1.4...v3.1.5) (2020-03-26) - - - - -## [3.1.4](https://github.com/npm/lifecycle/compare/v3.1.3...v3.1.4) (2019-09-18) - - -### Bug Fixes - -* filter functions and undefined out of makeEnv ([10c0c08](https://github.com/npm/lifecycle/commit/10c0c08)) - - - - -## [3.1.3](https://github.com/npm/lifecycle/compare/v3.1.2...v3.1.3) (2019-08-12) - - -### Bug Fixes - -* fail properly if uid-number raises an error ([e0e1b62](https://github.com/npm/lifecycle/commit/e0e1b62)) - - - - -## [3.1.2](https://github.com/npm/lifecycle/compare/v3.1.1...v3.1.2) (2019-07-22) - - -### Bug Fixes - -* do not exclude /path/ from process.env copying ([53e6318](https://github.com/npm/lifecycle/commit/53e6318)) - - - - -# [3.1.0](https://github.com/npm/lifecycle/compare/v3.0.0...v3.1.0) (2019-07-17) - - -### Bug Fixes - -* remove procInterrupt listener on SIGINT in procError ([ea18ed2](https://github.com/npm/lifecycle/commit/ea18ed2)), closes [#36](https://github.com/npm/lifecycle/issues/36) [#11](https://github.com/npm/lifecycle/issues/11) [#18](https://github.com/npm/lifecycle/issues/18) -* set only one PATH env variable for child proc ([3aaf954](https://github.com/npm/lifecycle/commit/3aaf954)), closes [#22](https://github.com/npm/lifecycle/issues/22) [#25](https://github.com/npm/lifecycle/issues/25) - - -### Features - -* **process.env.path:** Use platform specific path casing if present ([5523951](https://github.com/npm/lifecycle/commit/5523951)), closes [#29](https://github.com/npm/lifecycle/issues/29) [#30](https://github.com/npm/lifecycle/issues/30) - - - - -# [3.0.0](https://github.com/npm/lifecycle/compare/v2.1.1...v3.0.0) (2019-07-10) - - -* node-gyp@5.0.2 ([3c5aae6](https://github.com/npm/lifecycle/commit/3c5aae6)) - - -### BREAKING CHANGES - -* requires modifying the version of node-gyp in npm cli. - -Required for https://github.com/npm/cli/pull/208 -Fix: https://github.com/npm/npm-lifecycle/issues/37 -Close: https://github.com/npm/npm-lifecycle/issues/38 -PR-URL: https://github.com/npm/npm-lifecycle/pull/38 -Credit: @irega -Reviewed-by: @isaacs - - - - -## [2.1.1](https://github.com/npm/lifecycle/compare/v2.1.0...v2.1.1) (2019-05-08) - - -### Bug Fixes - -* **test:** update postinstall script for fixture ([220cd70](https://github.com/npm/lifecycle/commit/220cd70)) - - - - -# [2.1.0](https://github.com/npm/lifecycle/compare/v2.0.3...v2.1.0) (2018-08-13) - - -### Bug Fixes - -* **windows:** revert writing all possible cases of PATH variables ([#22](https://github.com/npm/lifecycle/issues/22)) ([8fcaa21](https://github.com/npm/lifecycle/commit/8fcaa21)), closes [#20](https://github.com/npm/lifecycle/issues/20) - - -### Features - -* **ci:** add node@10 to CI ([e206aa0](https://github.com/npm/lifecycle/commit/e206aa0)) - - - - -## [2.0.3](https://github.com/npm/lifecycle/compare/v2.0.2...v2.0.3) (2018-05-16) - - - - -## [2.0.2](https://github.com/npm/lifecycle/compare/v2.0.1...v2.0.2) (2018-05-16) - - -### Bug Fixes - -* **hooks:** run .hooks scripts even if package.json script is not present ([#13](https://github.com/npm/lifecycle/issues/13)) ([67adc2d](https://github.com/npm/lifecycle/commit/67adc2d)) -* **windows:** Write to all possible cases of PATH variables ([#17](https://github.com/npm/lifecycle/issues/17)) ([e4ecc54](https://github.com/npm/lifecycle/commit/e4ecc54)) - - - - -## [2.0.1](https://github.com/npm/lifecycle/compare/v2.0.0...v2.0.1) (2018-03-08) - - -### Bug Fixes - -* **log:** Fix formatting of invalid wd warning ([#12](https://github.com/npm/lifecycle/issues/12)) ([ced38f3](https://github.com/npm/lifecycle/commit/ced38f3)) - - - - -# [2.0.0](https://github.com/npm/lifecycle/compare/v1.0.3...v2.0.0) (2017-11-17) - - -### Features - -* **node-gyp:** use own node-gyp ([ae94ed2](https://github.com/npm/lifecycle/commit/ae94ed2)) -* **nodeOptions:** add "nodeOptions" option to set NODE_OPTIONS for child ([#7](https://github.com/npm/lifecycle/issues/7)) ([2eb7a38](https://github.com/npm/lifecycle/commit/2eb7a38)) -* **stdio:** add child process io options and default logging of piped stdout/err ([#3](https://github.com/npm/lifecycle/issues/3)) ([7b8281a](https://github.com/npm/lifecycle/commit/7b8281a)) - - -### BREAKING CHANGES - -* **node-gyp:** Previously you had to bring your own node-gyp AND you had -to provide access the way npm does, by having a `bin` dir with a -`node-gyp-bin` in it. - -Fixes: #4 - - - - -## [1.0.3](https://github.com/npm/lifecycle/compare/v1.0.2...v1.0.3) (2017-09-01) - - -### Bug Fixes - -* **runCmd:** add missing option to runCmd recursive queue call ([1a69ce8](https://github.com/npm/lifecycle/commit/1a69ce8)) - - - - -## [1.0.2](https://github.com/npm/lifecycle/compare/v1.0.1...v1.0.2) (2017-08-17) - - - - -## [1.0.1](https://github.com/npm/lifecycle/compare/v1.0.0...v1.0.1) (2017-08-16) - - -### Bug Fixes - -* **license:** fix up license documentation ([a784ca0](https://github.com/npm/lifecycle/commit/a784ca0)) - - - - -# 1.0.0 (2017-08-16) - - -### Bug Fixes - -* **misc:** use strict to fix node[@4](https://github.com/4) ([#2](https://github.com/npm/lifecycle/issues/2)) ([961ceb9](https://github.com/npm/lifecycle/commit/961ceb9)) - - -### Features - -* **api:** Extract from npm proper ([#1](https://github.com/npm/lifecycle/issues/1)) ([27d9930](https://github.com/npm/lifecycle/commit/27d9930)) - - -### BREAKING CHANGES - -* **api:** this is the initial implementation diff --git a/deps/npm/node_modules/npm-lifecycle/LICENSE b/deps/npm/node_modules/npm-lifecycle/LICENSE deleted file mode 100644 index 0b6c2287459632..00000000000000 --- a/deps/npm/node_modules/npm-lifecycle/LICENSE +++ /dev/null @@ -1,235 +0,0 @@ -The npm application -Copyright (c) npm, Inc. and Contributors -Licensed on the terms of The Artistic License 2.0 - -Node package dependencies of the npm application -Copyright (c) their respective copyright owners -Licensed on their respective license terms - -The npm public registry at https://registry.npmjs.org -and the npm website at https://www.npmjs.com -Operated by npm, Inc. -Use governed by terms published on https://www.npmjs.com - -"Node.js" -Trademark Joyent, Inc., https://joyent.com -Neither npm nor npm, Inc. are affiliated with Joyent, Inc. - -The Node.js application -Project of Node Foundation, https://nodejs.org - -The npm Logo -Copyright (c) Mathias Pettersson and Brian Hammond - -"Gubblebum Blocky" typeface -Copyright (c) Tjarda Koster, https://jelloween.deviantart.com -Used with permission - - --------- - - -The Artistic License 2.0 - -Copyright (c) 2000-2006, The Perl Foundation. - -Everyone is permitted to copy and distribute verbatim copies -of this license document, but changing it is not allowed. - -Preamble - -This license establishes the terms under which a given free software -Package may be copied, modified, distributed, and/or redistributed. -The intent is that the Copyright Holder maintains some artistic -control over the development of that Package while still keeping the -Package available as open source and free software. - -You are always permitted to make arrangements wholly outside of this -license directly with the Copyright Holder of a given Package. If the -terms of this license do not permit the full use that you propose to -make of the Package, you should contact the Copyright Holder and seek -a different licensing arrangement. - -Definitions - - "Copyright Holder" means the individual(s) or organization(s) - named in the copyright notice for the entire Package. - - "Contributor" means any party that has contributed code or other - material to the Package, in accordance with the Copyright Holder's - procedures. - - "You" and "your" means any person who would like to copy, - distribute, or modify the Package. - - "Package" means the collection of files distributed by the - Copyright Holder, and derivatives of that collection and/or of - those files. A given Package may consist of either the Standard - Version, or a Modified Version. - - "Distribute" means providing a copy of the Package or making it - accessible to anyone else, or in the case of a company or - organization, to others outside of your company or organization. - - "Distributor Fee" means any fee that you charge for Distributing - this Package or providing support for this Package to another - party. It does not mean licensing fees. - - "Standard Version" refers to the Package if it has not been - modified, or has been modified only in ways explicitly requested - by the Copyright Holder. - - "Modified Version" means the Package, if it has been changed, and - such changes were not explicitly requested by the Copyright - Holder. - - "Original License" means this Artistic License as Distributed with - the Standard Version of the Package, in its current version or as - it may be modified by The Perl Foundation in the future. - - "Source" form means the source code, documentation source, and - configuration files for the Package. - - "Compiled" form means the compiled bytecode, object code, binary, - or any other form resulting from mechanical transformation or - translation of the Source form. - - -Permission for Use and Modification Without Distribution - -(1) You are permitted to use the Standard Version and create and use -Modified Versions for any purpose without restriction, provided that -you do not Distribute the Modified Version. - - -Permissions for Redistribution of the Standard Version - -(2) You may Distribute verbatim copies of the Source form of the -Standard Version of this Package in any medium without restriction, -either gratis or for a Distributor Fee, provided that you duplicate -all of the original copyright notices and associated disclaimers. At -your discretion, such verbatim copies may or may not include a -Compiled form of the Package. - -(3) You may apply any bug fixes, portability changes, and other -modifications made available from the Copyright Holder. The resulting -Package will still be considered the Standard Version, and as such -will be subject to the Original License. - - -Distribution of Modified Versions of the Package as Source - -(4) You may Distribute your Modified Version as Source (either gratis -or for a Distributor Fee, and with or without a Compiled form of the -Modified Version) provided that you clearly document how it differs -from the Standard Version, including, but not limited to, documenting -any non-standard features, executables, or modules, and provided that -you do at least ONE of the following: - - (a) make the Modified Version available to the Copyright Holder - of the Standard Version, under the Original License, so that the - Copyright Holder may include your modifications in the Standard - Version. - - (b) ensure that installation of your Modified Version does not - prevent the user installing or running the Standard Version. In - addition, the Modified Version must bear a name that is different - from the name of the Standard Version. - - (c) allow anyone who receives a copy of the Modified Version to - make the Source form of the Modified Version available to others - under - - (i) the Original License or - - (ii) a license that permits the licensee to freely copy, - modify and redistribute the Modified Version using the same - licensing terms that apply to the copy that the licensee - received, and requires that the Source form of the Modified - Version, and of any works derived from it, be made freely - available in that license fees are prohibited but Distributor - Fees are allowed. - - -Distribution of Compiled Forms of the Standard Version -or Modified Versions without the Source - -(5) You may Distribute Compiled forms of the Standard Version without -the Source, provided that you include complete instructions on how to -get the Source of the Standard Version. Such instructions must be -valid at the time of your distribution. If these instructions, at any -time while you are carrying out such distribution, become invalid, you -must provide new instructions on demand or cease further distribution. -If you provide valid instructions or cease distribution within thirty -days after you become aware that the instructions are invalid, then -you do not forfeit any of your rights under this license. - -(6) You may Distribute a Modified Version in Compiled form without -the Source, provided that you comply with Section 4 with respect to -the Source of the Modified Version. - - -Aggregating or Linking the Package - -(7) You may aggregate the Package (either the Standard Version or -Modified Version) with other packages and Distribute the resulting -aggregation provided that you do not charge a licensing fee for the -Package. Distributor Fees are permitted, and licensing fees for other -components in the aggregation are permitted. The terms of this license -apply to the use and Distribution of the Standard or Modified Versions -as included in the aggregation. - -(8) You are permitted to link Modified and Standard Versions with -other works, to embed the Package in a larger work of your own, or to -build stand-alone binary or bytecode versions of applications that -include the Package, and Distribute the result without restriction, -provided the result does not expose a direct interface to the Package. - - -Items That are Not Considered Part of a Modified Version - -(9) Works (including, but not limited to, modules and scripts) that -merely extend or make use of the Package, do not, by themselves, cause -the Package to be a Modified Version. In addition, such works are not -considered parts of the Package itself, and are not subject to the -terms of this license. - - -General Provisions - -(10) Any use, modification, and distribution of the Standard or -Modified Versions is governed by this Artistic License. By using, -modifying or distributing the Package, you accept this license. Do not -use, modify, or distribute the Package, if you do not accept this -license. - -(11) If your Modified Version has been derived from a Modified -Version made by someone other than you, you are nevertheless required -to ensure that your Modified Version complies with the requirements of -this license. - -(12) This license does not grant you the right to use any trademark, -service mark, tradename, or logo of the Copyright Holder. - -(13) This license includes the non-exclusive, worldwide, -free-of-charge patent license to make, have made, use, offer to sell, -sell, import and otherwise transfer the Package with respect to any -patent claims licensable by the Copyright Holder that are necessarily -infringed by the Package. If you institute patent litigation -(including a cross-claim or counterclaim) against any party alleging -that the Package constitutes direct or contributory patent -infringement, then this Artistic License to you shall terminate on the -date that such litigation is filed. - -(14) Disclaimer of Warranty: -THE PACKAGE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS -IS' AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES. THE IMPLIED -WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR -NON-INFRINGEMENT ARE DISCLAIMED TO THE EXTENT PERMITTED BY YOUR LOCAL -LAW. UNLESS REQUIRED BY LAW, NO COPYRIGHT HOLDER OR CONTRIBUTOR WILL -BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL -DAMAGES ARISING IN ANY WAY OUT OF THE USE OF THE PACKAGE, EVEN IF -ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - - --------- diff --git a/deps/npm/node_modules/npm-lifecycle/README.md b/deps/npm/node_modules/npm-lifecycle/README.md deleted file mode 100644 index a22adf1c22421c..00000000000000 --- a/deps/npm/node_modules/npm-lifecycle/README.md +++ /dev/null @@ -1,49 +0,0 @@ -# Note: pending imminent deprecation - -**This module will be deprecated once npm v7 is released. Please do not rely -on it more than absolutely necessary.** - -The lifecycle script runner used in npm v7 is -[@npmcli/run-script](http://npm.im/@npmcli/run-script). Please use that -module moving forward. - ------ - -# npm-lifecycle - -[`npm-lifecycle`](https://github.com/npm/npm-lifecycle) is a standalone library for -executing packages' lifecycle scripts. It is extracted from npm itself and -intended to be fully compatible with the way npm executes individual scripts. - -## Install - -`$ npm install npm-lifecycle` - -## Table of Contents - -* [Example](#example) -* [Features](#features) -* [Contributing](#contributing) -* [API](#api) - * [`lifecycle`](#lifecycle) - -### Example - -```javascript -// idk yet -``` - -### API - -#### `> lifecycle(name, pkg, wd, [opts]) -> Promise` - -##### Arguments - -* `opts.stdio` - the [stdio](https://nodejs.org/api/child_process.html#child_process_options_stdio) -passed to the child process. `[0, 1, 2]` by default. - -##### Example - -```javascript -lifecycle() -``` diff --git a/deps/npm/node_modules/npm-lifecycle/index.js b/deps/npm/node_modules/npm-lifecycle/index.js deleted file mode 100644 index 337de71416879f..00000000000000 --- a/deps/npm/node_modules/npm-lifecycle/index.js +++ /dev/null @@ -1,497 +0,0 @@ -'use strict' - -exports = module.exports = lifecycle -exports.makeEnv = makeEnv -exports._incorrectWorkingDirectory = _incorrectWorkingDirectory - -// for testing -const platform = process.env.__TESTING_FAKE_PLATFORM__ || process.platform -const isWindows = platform === 'win32' -const spawn = require('./lib/spawn') -const path = require('path') -const Stream = require('stream').Stream -const fs = require('graceful-fs') -const chain = require('slide').chain -const uidNumber = require('uid-number') -const umask = require('umask') -const which = require('which') -const byline = require('byline') -const resolveFrom = require('resolve-from') - -const DEFAULT_NODE_GYP_PATH = resolveFrom(__dirname, 'node-gyp/bin/node-gyp') -const hookStatCache = new Map() - -let PATH = isWindows ? 'Path' : 'PATH' -exports._pathEnvName = PATH -const delimiter = path.delimiter - -// windows calls its path 'Path' usually, but this is not guaranteed. -// merge them all together in the order they appear in the object. -const mergePath = env => - Object.keys(env).filter(p => /^path$/i.test(p) && env[p]) - .map(p => env[p].split(delimiter)) - .reduce((set, p) => set.concat(p.filter(p => !set.includes(p))), []) - .join(delimiter) -exports._mergePath = mergePath - -const setPathEnv = (env, path) => { - // first ensure that the canonical value is set. - env[PATH] = path - // also set any other case values, because windows. - Object.keys(env) - .filter(p => p !== PATH && /^path$/i.test(p)) - .forEach(p => { env[p] = path }) -} -exports._setPathEnv = setPathEnv - -function logid (pkg, stage) { - return pkg._id + '~' + stage + ':' -} - -function hookStat (dir, stage, cb) { - const hook = path.join(dir, '.hooks', stage) - const cachedStatError = hookStatCache.get(hook) - - if (cachedStatError === undefined) { - return fs.stat(hook, function (statError) { - hookStatCache.set(hook, statError) - cb(statError) - }) - } - - return setImmediate(() => cb(cachedStatError)) -} - -function lifecycle (pkg, stage, wd, opts) { - return new Promise((resolve, reject) => { - while (pkg && pkg._data) pkg = pkg._data - if (!pkg) return reject(new Error('Invalid package data')) - - opts.log.info('lifecycle', logid(pkg, stage), pkg._id) - if (!pkg.scripts) pkg.scripts = {} - - if (stage === 'prepublish' && opts.ignorePrepublish) { - opts.log.info('lifecycle', logid(pkg, stage), 'ignored because ignore-prepublish is set to true', pkg._id) - delete pkg.scripts.prepublish - } - - hookStat(opts.dir, stage, function (statError) { - // makeEnv is a slow operation. This guard clause prevents makeEnv being called - // and avoids a ton of unnecessary work, and results in a major perf boost. - if (!pkg.scripts[stage] && statError) return resolve() - - validWd(wd || path.resolve(opts.dir, pkg.name), function (er, wd) { - if (er) return reject(er) - - if ((wd.indexOf(opts.dir) !== 0 || _incorrectWorkingDirectory(wd, pkg)) && - !opts.unsafePerm && pkg.scripts[stage]) { - opts.log.warn('lifecycle', logid(pkg, stage), 'cannot run in wd', pkg._id, pkg.scripts[stage], `(wd=${wd})`) - return resolve() - } - - // set the env variables, then run scripts as a child process. - var env = makeEnv(pkg, opts) - env.npm_lifecycle_event = stage - env.npm_node_execpath = env.NODE = env.NODE || process.execPath - env.npm_execpath = require.main.filename - env.INIT_CWD = process.cwd() - env.npm_config_node_gyp = env.npm_config_node_gyp || DEFAULT_NODE_GYP_PATH - - // 'nobody' typically doesn't have permission to write to /tmp - // even if it's never used, sh freaks out. - if (!opts.unsafePerm) env.TMPDIR = wd - - lifecycle_(pkg, stage, wd, opts, env, (er) => { - if (er) return reject(er) - return resolve() - }) - }) - }) - }) -} - -function _incorrectWorkingDirectory (wd, pkg) { - return wd.lastIndexOf(pkg.name) !== wd.length - pkg.name.length -} - -function lifecycle_ (pkg, stage, wd, opts, env, cb) { - var pathArr = [] - var p = wd.split(/[\\/]node_modules[\\/]/) - var acc = path.resolve(p.shift()) - - p.forEach(function (pp) { - pathArr.unshift(path.join(acc, 'node_modules', '.bin')) - acc = path.join(acc, 'node_modules', pp) - }) - pathArr.unshift(path.join(acc, 'node_modules', '.bin')) - - // we also unshift the bundled node-gyp-bin folder so that - // the bundled one will be used for installing things. - pathArr.unshift(path.join(__dirname, 'node-gyp-bin')) - - if (shouldPrependCurrentNodeDirToPATH(opts)) { - // prefer current node interpreter in child scripts - pathArr.push(path.dirname(process.execPath)) - } - - const existingPath = mergePath(env) - if (existingPath) pathArr.push(existingPath) - const envPath = pathArr.join(isWindows ? ';' : ':') - setPathEnv(env, envPath) - - var packageLifecycle = pkg.scripts && pkg.scripts.hasOwnProperty(stage) - - if (opts.ignoreScripts) { - opts.log.info('lifecycle', logid(pkg, stage), 'ignored because ignore-scripts is set to true', pkg._id) - packageLifecycle = false - } else if (packageLifecycle) { - // define this here so it's available to all scripts. - env.npm_lifecycle_script = pkg.scripts[stage] - } else { - opts.log.silly('lifecycle', logid(pkg, stage), 'no script for ' + stage + ', continuing') - } - - function done (er) { - if (er) { - if (opts.force) { - opts.log.info('lifecycle', logid(pkg, stage), 'forced, continuing', er) - er = null - } else if (opts.failOk) { - opts.log.warn('lifecycle', logid(pkg, stage), 'continuing anyway', er.message) - er = null - } - } - cb(er) - } - - chain( - [ - packageLifecycle && [runPackageLifecycle, pkg, stage, env, wd, opts], - [runHookLifecycle, pkg, stage, env, wd, opts] - ], - done - ) -} - -function shouldPrependCurrentNodeDirToPATH (opts) { - const cfgsetting = opts.scriptsPrependNodePath - if (cfgsetting === false) return false - if (cfgsetting === true) return true - - var isDifferentNodeInPath - - var foundExecPath - try { - foundExecPath = which.sync(path.basename(process.execPath), { pathExt: isWindows ? ';' : ':' }) - // Apply `fs.realpath()` here to avoid false positives when `node` is a symlinked executable. - isDifferentNodeInPath = fs.realpathSync(process.execPath).toUpperCase() !== - fs.realpathSync(foundExecPath).toUpperCase() - } catch (e) { - isDifferentNodeInPath = true - } - - if (cfgsetting === 'warn-only') { - if (isDifferentNodeInPath && !shouldPrependCurrentNodeDirToPATH.hasWarned) { - if (foundExecPath) { - opts.log.warn('lifecycle', 'The node binary used for scripts is', foundExecPath, 'but npm is using', process.execPath, 'itself. Use the `--scripts-prepend-node-path` option to include the path for the node binary npm was executed with.') - } else { - opts.log.warn('lifecycle', 'npm is using', process.execPath, 'but there is no node binary in the current PATH. Use the `--scripts-prepend-node-path` option to include the path for the node binary npm was executed with.') - } - shouldPrependCurrentNodeDirToPATH.hasWarned = true - } - - return false - } - - return isDifferentNodeInPath -} - -function validWd (d, cb) { - fs.stat(d, function (er, st) { - if (er || !st.isDirectory()) { - var p = path.dirname(d) - if (p === d) { - return cb(new Error('Could not find suitable wd')) - } - return validWd(p, cb) - } - return cb(null, d) - }) -} - -function runPackageLifecycle (pkg, stage, env, wd, opts, cb) { - // run package lifecycle scripts in the package root, or the nearest parent. - var cmd = env.npm_lifecycle_script - - var note = '\n> ' + pkg._id + ' ' + stage + ' ' + wd + - '\n> ' + cmd + '\n' - runCmd(note, cmd, pkg, env, stage, wd, opts, cb) -} - -var running = false -var queue = [] -function dequeue () { - running = false - if (queue.length) { - var r = queue.shift() - runCmd.apply(null, r) - } -} - -function runCmd (note, cmd, pkg, env, stage, wd, opts, cb) { - if (running) { - queue.push([note, cmd, pkg, env, stage, wd, opts, cb]) - return - } - - running = true - opts.log.pause() - var unsafe = opts.unsafePerm - var user = unsafe ? null : opts.user - var group = unsafe ? null : opts.group - - if (opts.log.level !== 'silent') { - opts.log.clearProgress() - console.log(note) - opts.log.showProgress() - } - opts.log.verbose('lifecycle', logid(pkg, stage), 'unsafe-perm in lifecycle', unsafe) - - if (isWindows) { - unsafe = true - } - - if (unsafe) { - runCmd_(cmd, pkg, env, wd, opts, stage, unsafe, 0, 0, cb) - } else { - uidNumber(user, group, function (er, uid, gid) { - if (er) { - er.code = 'EUIDLOOKUP' - opts.log.resume() - process.nextTick(dequeue) - return cb(er) - } - runCmd_(cmd, pkg, env, wd, opts, stage, unsafe, uid, gid, cb) - }) - } -} - -const getSpawnArgs = ({ cmd, wd, opts, uid, gid, unsafe, env }) => { - const conf = { - cwd: wd, - env: env, - stdio: opts.stdio || [ 0, 1, 2 ] - } - - if (!unsafe) { - conf.uid = uid ^ 0 - conf.gid = gid ^ 0 - } - - const customShell = opts.scriptShell - - let sh = 'sh' - let shFlag = '-c' - if (customShell) { - sh = customShell - } else if (isWindows || opts._TESTING_FAKE_WINDOWS_) { - sh = process.env.comspec || 'cmd' - // '/d /s /c' is used only for cmd.exe. - if (/^(?:.*\\)?cmd(?:\.exe)?$/i.test(sh)) { - shFlag = '/d /s /c' - conf.windowsVerbatimArguments = true - } - } - - return [sh, [shFlag, cmd], conf] -} - -exports._getSpawnArgs = getSpawnArgs - -function runCmd_ (cmd, pkg, env, wd, opts, stage, unsafe, uid, gid, cb_) { - function cb (er) { - cb_.apply(null, arguments) - opts.log.resume() - process.nextTick(dequeue) - } - - const [sh, args, conf] = getSpawnArgs({ cmd, wd, opts, uid, gid, unsafe, env }) - - opts.log.verbose('lifecycle', logid(pkg, stage), 'PATH:', env[PATH]) - opts.log.verbose('lifecycle', logid(pkg, stage), 'CWD:', wd) - opts.log.silly('lifecycle', logid(pkg, stage), 'Args:', args) - - var proc = spawn(sh, args, conf, opts.log) - - proc.on('error', procError) - proc.on('close', function (code, signal) { - opts.log.silly('lifecycle', logid(pkg, stage), 'Returned: code:', code, ' signal:', signal) - if (signal) { - process.kill(process.pid, signal) - } else if (code) { - var er = new Error('Exit status ' + code) - er.errno = code - } - procError(er) - }) - byline(proc.stdout).on('data', function (data) { - opts.log.verbose('lifecycle', logid(pkg, stage), 'stdout', data.toString()) - }) - byline(proc.stderr).on('data', function (data) { - opts.log.verbose('lifecycle', logid(pkg, stage), 'stderr', data.toString()) - }) - process.once('SIGTERM', procKill) - process.once('SIGINT', procInterupt) - - function procError (er) { - if (er) { - opts.log.info('lifecycle', logid(pkg, stage), 'Failed to exec ' + stage + ' script') - er.message = pkg._id + ' ' + stage + ': `' + cmd + '`\n' + - er.message - if (er.code !== 'EPERM') { - er.code = 'ELIFECYCLE' - } - fs.stat(opts.dir, function (statError, d) { - if (statError && statError.code === 'ENOENT' && opts.dir.split(path.sep).slice(-1)[0] === 'node_modules') { - opts.log.warn('', 'Local package.json exists, but node_modules missing, did you mean to install?') - } - }) - er.pkgid = pkg._id - er.stage = stage - er.script = cmd - er.pkgname = pkg.name - } - process.removeListener('SIGTERM', procKill) - process.removeListener('SIGTERM', procInterupt) - process.removeListener('SIGINT', procKill) - process.removeListener('SIGINT', procInterupt) - return cb(er) - } - function procKill () { - proc.kill() - } - function procInterupt () { - proc.kill('SIGINT') - proc.on('exit', function () { - process.exit() - }) - process.once('SIGINT', procKill) - } -} - -function runHookLifecycle (pkg, stage, env, wd, opts, cb) { - hookStat(opts.dir, stage, function (er) { - if (er) return cb() - var cmd = path.join(opts.dir, '.hooks', stage) - var note = '\n> ' + pkg._id + ' ' + stage + ' ' + wd + - '\n> ' + cmd - runCmd(note, cmd, pkg, env, stage, wd, opts, cb) - }) -} - -function makeEnv (data, opts, prefix, env) { - prefix = prefix || 'npm_package_' - if (!env) { - env = {} - for (var i in process.env) { - if (!i.match(/^npm_/)) { - env[i] = process.env[i] - } - } - - // express and others respect the NODE_ENV value. - if (opts.production) env.NODE_ENV = 'production' - } else if (!data.hasOwnProperty('_lifecycleEnv')) { - Object.defineProperty(data, '_lifecycleEnv', - { - value: env, - enumerable: false - } - ) - } - - if (opts.nodeOptions) env.NODE_OPTIONS = opts.nodeOptions - - for (i in data) { - if (i.charAt(0) !== '_') { - var envKey = (prefix + i).replace(/[^a-zA-Z0-9_]/g, '_') - if (i === 'readme') { - continue - } - if (data[i] && typeof data[i] === 'object') { - try { - // quick and dirty detection for cyclical structures - JSON.stringify(data[i]) - makeEnv(data[i], opts, envKey + '_', env) - } catch (ex) { - // usually these are package objects. - // just get the path and basic details. - var d = data[i] - makeEnv( - { name: d.name, version: d.version, path: d.path }, - opts, - envKey + '_', - env - ) - } - } else { - env[envKey] = String(data[i]) - env[envKey] = env[envKey].indexOf('\n') !== -1 - ? JSON.stringify(env[envKey]) - : env[envKey] - } - } - } - - if (prefix !== 'npm_package_') return env - - prefix = 'npm_config_' - var pkgConfig = {} - var pkgVerConfig = {} - var namePref = data.name + ':' - var verPref = data.name + '@' + data.version + ':' - - Object.keys(opts.config).forEach(function (i) { - // in some rare cases (e.g. working with nerf darts), there are segmented - // "private" (underscore-prefixed) config names -- don't export - if ((i.charAt(0) === '_' && i.indexOf('_' + namePref) !== 0) || i.match(/:_/)) { - return - } - var value = opts.config[i] - if (value instanceof Stream || Array.isArray(value) || typeof value === 'function') return - if (i.match(/umask/)) value = umask.toString(value) - - if (!value) value = '' - else if (typeof value === 'number') value = '' + value - else if (typeof value !== 'string') value = JSON.stringify(value) - - if (typeof value !== 'string') { - return - } - - value = value.indexOf('\n') !== -1 - ? JSON.stringify(value) - : value - i = i.replace(/^_+/, '') - var k - if (i.indexOf(namePref) === 0) { - k = i.substr(namePref.length).replace(/[^a-zA-Z0-9_]/g, '_') - pkgConfig[k] = value - } else if (i.indexOf(verPref) === 0) { - k = i.substr(verPref.length).replace(/[^a-zA-Z0-9_]/g, '_') - pkgVerConfig[k] = value - } - var envKey = (prefix + i).replace(/[^a-zA-Z0-9_]/g, '_') - env[envKey] = value - }) - - prefix = 'npm_package_config_' - ;[pkgConfig, pkgVerConfig].forEach(function (conf) { - for (var i in conf) { - var envKey = (prefix + i) - env[envKey] = conf[i] - } - }) - - return env -} diff --git a/deps/npm/node_modules/npm-lifecycle/lib/spawn.js b/deps/npm/node_modules/npm-lifecycle/lib/spawn.js deleted file mode 100644 index 30e5b81846977a..00000000000000 --- a/deps/npm/node_modules/npm-lifecycle/lib/spawn.js +++ /dev/null @@ -1,65 +0,0 @@ -'use strict' - -module.exports = spawn - -const _spawn = require('child_process').spawn -const EventEmitter = require('events').EventEmitter - -let progressEnabled -let running = 0 - -function startRunning (log) { - if (progressEnabled == null) progressEnabled = log.progressEnabled - if (progressEnabled) log.disableProgress() - ++running -} - -function stopRunning (log) { - --running - if (progressEnabled && running === 0) log.enableProgress() -} - -function willCmdOutput (stdio) { - if (stdio === 'inherit') return true - if (!Array.isArray(stdio)) return false - for (let fh = 1; fh <= 2; ++fh) { - if (stdio[fh] === 'inherit') return true - if (stdio[fh] === 1 || stdio[fh] === 2) return true - } - return false -} - -function spawn (cmd, args, options, log) { - const cmdWillOutput = willCmdOutput(options && options.stdio) - - if (cmdWillOutput) startRunning(log) - const raw = _spawn(cmd, args, options) - const cooked = new EventEmitter() - - raw.on('error', function (er) { - if (cmdWillOutput) stopRunning(log) - er.file = cmd - cooked.emit('error', er) - }).on('close', function (code, signal) { - if (cmdWillOutput) stopRunning(log) - // Create ENOENT error because Node.js v8.0 will not emit - // an `error` event if the command could not be found. - if (code === 127) { - const er = new Error('spawn ENOENT') - er.code = 'ENOENT' - er.errno = 'ENOENT' - er.syscall = 'spawn' - er.file = cmd - cooked.emit('error', er) - } else { - cooked.emit('close', code, signal) - } - }) - - cooked.stdin = raw.stdin - cooked.stdout = raw.stdout - cooked.stderr = raw.stderr - cooked.kill = function (sig) { return raw.kill(sig) } - - return cooked -} diff --git a/deps/npm/node_modules/npm-lifecycle/node-gyp-bin/node-gyp b/deps/npm/node_modules/npm-lifecycle/node-gyp-bin/node-gyp deleted file mode 100755 index 70efb6f339f768..00000000000000 --- a/deps/npm/node_modules/npm-lifecycle/node-gyp-bin/node-gyp +++ /dev/null @@ -1,6 +0,0 @@ -#!/usr/bin/env sh -if [ "x$npm_config_node_gyp" = "x" ]; then - node "`dirname "$0"`/../../node_modules/node-gyp/bin/node-gyp.js" "$@" -else - "$npm_config_node_gyp" "$@" -fi diff --git a/deps/npm/node_modules/npm-lifecycle/node-gyp-bin/node-gyp.cmd b/deps/npm/node_modules/npm-lifecycle/node-gyp-bin/node-gyp.cmd deleted file mode 100755 index 083c9c58a502a1..00000000000000 --- a/deps/npm/node_modules/npm-lifecycle/node-gyp-bin/node-gyp.cmd +++ /dev/null @@ -1,5 +0,0 @@ -if not defined npm_config_node_gyp ( - node "%~dp0\..\..\node_modules\node-gyp\bin\node-gyp.js" %* -) else ( - node "%npm_config_node_gyp%" %* -) diff --git a/deps/npm/node_modules/npm-lifecycle/package.json b/deps/npm/node_modules/npm-lifecycle/package.json deleted file mode 100644 index 35fdaa709901f3..00000000000000 --- a/deps/npm/node_modules/npm-lifecycle/package.json +++ /dev/null @@ -1,82 +0,0 @@ -{ - "_from": "npm-lifecycle@3.1.5", - "_id": "npm-lifecycle@3.1.5", - "_inBundle": false, - "_integrity": "sha512-lDLVkjfZmvmfvpvBzA4vzee9cn+Me4orq0QF8glbswJVEbIcSNWib7qGOffolysc3teCqbbPZZkzbr3GQZTL1g==", - "_location": "/npm-lifecycle", - "_phantomChildren": {}, - "_requested": { - "type": "version", - "registry": true, - "raw": "npm-lifecycle@3.1.5", - "name": "npm-lifecycle", - "escapedName": "npm-lifecycle", - "rawSpec": "3.1.5", - "saveSpec": null, - "fetchSpec": "3.1.5" - }, - "_requiredBy": [ - "#USER", - "/", - "/libcipm", - "/libnpm" - ], - "_resolved": "https://registry.npmjs.org/npm-lifecycle/-/npm-lifecycle-3.1.5.tgz", - "_shasum": "9882d3642b8c82c815782a12e6a1bfeed0026309", - "_spec": "npm-lifecycle@3.1.5", - "_where": "/Users/claudiahdz/npm/cli", - "author": { - "name": "Mike Sherov" - }, - "bugs": { - "url": "https://github.com/npm/lifecycle/issues" - }, - "bundleDependencies": false, - "dependencies": { - "byline": "^5.0.0", - "graceful-fs": "^4.1.15", - "node-gyp": "^5.0.2", - "resolve-from": "^4.0.0", - "slide": "^1.1.6", - "uid-number": "0.0.6", - "umask": "^1.1.0", - "which": "^1.3.1" - }, - "deprecated": false, - "description": "JavaScript package lifecycle hook runner", - "devDependencies": { - "nyc": "^14.1.0", - "sinon": "^7.2.3", - "standard": "^12.0.1", - "standard-version": "^4.4.0", - "tap": "^12.7.0" - }, - "files": [ - "index.js", - "lib/spawn.js", - "node-gyp-bin" - ], - "homepage": "https://github.com/npm/lifecycle#readme", - "keywords": [ - "npm", - "lifecycle", - "hook", - "runner" - ], - "license": "Artistic-2.0", - "main": "index.js", - "name": "npm-lifecycle", - "repository": { - "type": "git", - "url": "git://github.com/npm/lifecycle.git" - }, - "scripts": { - "postrelease": "npm publish && git push --follow-tags", - "prerelease": "npm t", - "pretest": "standard", - "release": "standard-version -s", - "snap": "TAP_SNAPSHOT=1 npm test", - "test": "tap -J --cov test/*.js" - }, - "version": "3.1.5" -} diff --git a/deps/npm/node_modules/npm-logical-tree/CHANGELOG.md b/deps/npm/node_modules/npm-logical-tree/CHANGELOG.md deleted file mode 100644 index 1a9b3711617153..00000000000000 --- a/deps/npm/node_modules/npm-logical-tree/CHANGELOG.md +++ /dev/null @@ -1,46 +0,0 @@ -# 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. - - -## [1.2.1](https://github.com/npm/logical-tree/compare/v1.2.0...v1.2.1) (2018-01-19) - - -### Bug Fixes - -* **requires:** stop requiring version match -- only what require would pick up ([6388fbd](https://github.com/npm/logical-tree/commit/6388fbd)) - - - - -# [1.2.0](https://github.com/npm/logical-tree/compare/v1.1.0...v1.2.0) (2017-10-13) - - -### Bug Fixes - -* **json:** fix repository url ([e51448a](https://github.com/npm/logical-tree/commit/e51448a)) - - -### Features - -* **api:** additional utility functions for dealing with trees ([23f6e69](https://github.com/npm/logical-tree/commit/23f6e69)) - - - - -# [1.1.0](https://github.com/npm/npm-logical-tree/compare/v1.0.0...v1.1.0) (2017-10-11) - - -### Features - -* **requiredBy:** add requiredBy field to nodes ([c4056fb](https://github.com/npm/npm-logical-tree/commit/c4056fb)) - - - - -# 1.0.0 (2017-10-07) - - -### Features - -* **api:** Initial Commit™ ([1025259](https://github.com/npm/npm-logical-tree/commit/1025259)) diff --git a/deps/npm/node_modules/npm-logical-tree/LICENSE.md b/deps/npm/node_modules/npm-logical-tree/LICENSE.md deleted file mode 100644 index 8d28acf866d932..00000000000000 --- a/deps/npm/node_modules/npm-logical-tree/LICENSE.md +++ /dev/null @@ -1,16 +0,0 @@ -ISC License - -Copyright (c) npm, Inc. - -Permission to use, copy, modify, and/or distribute this software for -any purpose with or without fee is hereby granted, provided that the -above copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE COPYRIGHT HOLDER DISCLAIMS -ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE -COPYRIGHT HOLDER BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR -CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS -OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE -OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE -USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/deps/npm/node_modules/npm-logical-tree/README.md b/deps/npm/node_modules/npm-logical-tree/README.md deleted file mode 100644 index 33260d9f2a5326..00000000000000 --- a/deps/npm/node_modules/npm-logical-tree/README.md +++ /dev/null @@ -1,147 +0,0 @@ -# npm-logical-tree [![npm version](https://img.shields.io/npm/v/npm-logical-tree.svg)](https://npm.im/npm-logical-tree) [![license](https://img.shields.io/npm/l/npm-logical-tree.svg)](https://npm.im/npm-logical-tree) [![Travis](https://img.shields.io/travis/npm/logical-tree.svg)](https://travis-ci.org/npm/logical-tree) [![AppVeyor](https://ci.appveyor.com/api/projects/status/github/npm/logical-tree?svg=true)](https://ci.appveyor.com/project/npm/logical-tree) [![Coverage Status](https://coveralls.io/repos/github/npm/logical-tree/badge.svg?branch=latest)](https://coveralls.io/github/npm/logical-tree?branch=latest) - -[`npm-logical-tree`](https://github.com/npm/npm-logical-tree) is a Node.js -library that takes the contents of a `package.json` and `package-lock.json` (or -`npm-shrinkwrap.json`) and returns a nested tree data structure representing the -logical relationships between the different dependencies. - -## Install - -`$ npm install npm-logical-tree` - -## Table of Contents - -* [Example](#example) -* [Contributing](#contributing) -* [API](#api) - * [`logicalTree`](#logical-tree) - * [`logicalTree.node`](#make-node) - * [`tree.isRoot`](#is-root) - * [`tree.addDep`](#add-dep) - * [`tree.delDep`](#del-dep) - * [`tree.getDep`](#get-dep) - * [`tree.path`](#path) - * [`tree.hasCycle`](#has-cycle) - * [`tree.forEach`](#for-each) - * [`tree.forEachAsync`](#for-each-async) - -### Example - -```javascript -const fs = require('fs') -const logicalTree = require('npm-logical-tree') - -const pkg = require('./package.json') -const pkgLock = require('./package-lock.json') - -logicalTree(pkg, pkgLock) -// returns: -LogicalTree { - name: 'npm-logical-tree', - version: '1.0.0', - address: null, - optional: false, - dev: false, - bundled: false, - resolved: undefined, - integrity: undefined, - requiredBy: Set { }, - dependencies: - Map { - 'foo' => LogicalTree { - name: 'foo', - version: '1.2.3', - address: 'foo', - optional: false, - dev: true, - bundled: false, - resolved: 'https://registry.npmjs.org/foo/-/foo-1.2.3.tgz', - integrity: 'sha1-rYUK/p261/SXByi0suR/7Rw4chw=', - dependencies: Map { ... }, - requiredBy: Set { ... }, - }, - ... - } -} -``` - -### Contributing - -The npm team enthusiastically welcomes contributions and project participation! -There's a bunch of things you can do if you want to contribute! The [Contributor -Guide](CONTRIBUTING.md) has all the information you need for everything from -reporting bugs to contributing entire new features. Please don't hesitate to -jump in if you'd like to, or even ask us questions if something isn't clear. - -All participants and maintainers in this project are expected to follow [Code of -Conduct](CODE_OF_CONDUCT.md), and just generally be excellent to each other. - -Please refer to the [Changelog](CHANGELOG.md) for project history details, too. - -Happy hacking! - -### API - -#### `> logicalTree(pkg, lock) -> LogicalTree` - -Calculates a logical tree based on a matching `package.json` and -`package-lock.json` pair. A "logical tree" is a fully-nested dependency graph -for an npm package, as opposed to a physical tree which might be flattened. - -`logical-tree` will represent deduplicated/flattened nodes using the same object -throughout the tree, so duplication can be checked by object identity. - -##### Example - -```javascript -const pkg = require('./package.json') -const pkgLock = require('./package-lock.json') - -logicalTree(pkg, pkgLock) -// returns: -LogicalTree { - name: 'npm-logical-tree', - version: '1.0.0', - address: null, - optional: false, - dev: false, - bundled: false, - resolved: undefined, - integrity: undefined, - requiredBy: Set { }, - dependencies: - Map { - 'foo' => LogicalTree { - name: 'foo', - version: '1.2.3', - address: 'foo', - optional: false, - dev: true, - bundled: false, - resolved: 'https://registry.npmjs.org/foo/-/foo-1.2.3.tgz', - integrity: 'sha1-rYUK/p261/SXByi0suR/7Rw4chw=', - requiredBy: Set { ... }, - dependencies: Map { ... } - }, - ... - } -} -``` - -#### `> logicalTree.node(name, [address, [opts]]) -> LogicalTree` - -Manually creates a new LogicalTree node. - -##### Options - -* `opts.version` - version of the node. -* `opts.optional` - is this node an optionalDep? -* `opts.dev` - is this node a devDep? -* `opts.bundled` - is this bundled? -* `opts.resolved` - resolved address. -* `opts.integrity` - SRI string. - -##### Example -```javascript -logicalTree.node('hello', 'subpath:to:@foo/bar', {dev: true}) -``` diff --git a/deps/npm/node_modules/npm-logical-tree/index.js b/deps/npm/node_modules/npm-logical-tree/index.js deleted file mode 100644 index 10ab7599f63a99..00000000000000 --- a/deps/npm/node_modules/npm-logical-tree/index.js +++ /dev/null @@ -1,192 +0,0 @@ -'use strict' - -let path - -class LogicalTree { - constructor (name, address, opts) { - this.name = name - this.version = opts.version - this.address = address || '' - this.optional = !!opts.optional - this.dev = !!opts.dev - this.bundled = !!opts.bundled - this.resolved = opts.resolved - this.integrity = opts.integrity - this.dependencies = new Map() - this.requiredBy = new Set() - } - - get isRoot () { return !this.requiredBy.size } - - addDep (dep) { - this.dependencies.set(dep.name, dep) - dep.requiredBy.add(this) - return this - } - - delDep (dep) { - this.dependencies.delete(dep.name) - dep.requiredBy.delete(this) - return this - } - - getDep (name) { - return this.dependencies.get(name) - } - - path (prefix) { - if (this.isRoot) { - // The address of the root is the prefix itself. - return prefix || '' - } else { - if (!path) { path = require('path') } - return path.join( - prefix || '', - 'node_modules', - this.address.replace(/:/g, '/node_modules/') - ) - } - } - - // This finds cycles _from_ a given node: if some deeper dep has - // its own cycle, but that cycle does not refer to this node, - // it will return false. - hasCycle (_seen, _from) { - if (!_seen) { _seen = new Set() } - if (!_from) { _from = this } - for (let dep of this.dependencies.values()) { - if (_seen.has(dep)) { continue } - _seen.add(dep) - if (dep === _from || dep.hasCycle(_seen, _from)) { - return true - } - } - return false - } - - forEachAsync (fn, opts, _pending) { - if (!opts) { opts = _pending || {} } - if (!_pending) { _pending = new Map() } - const P = opts.Promise || Promise - if (_pending.has(this)) { - return P.resolve(this.hasCycle() || _pending.get(this)) - } - const pending = P.resolve().then(() => { - return fn(this, () => { - return promiseMap( - this.dependencies.values(), - dep => dep.forEachAsync(fn, opts, _pending), - opts - ) - }) - }) - _pending.set(this, pending) - return pending - } - - forEach (fn, _seen) { - if (!_seen) { _seen = new Set() } - if (_seen.has(this)) { return } - _seen.add(this) - fn(this, () => { - for (let dep of this.dependencies.values()) { - dep.forEach(fn, _seen) - } - }) - } -} - -module.exports = lockTree -function lockTree (pkg, pkgLock, opts) { - const tree = makeNode(pkg.name, null, pkg) - const allDeps = new Map() - Array.from( - new Set(Object.keys(pkg.devDependencies || {}) - .concat(Object.keys(pkg.optionalDependencies || {})) - .concat(Object.keys(pkg.dependencies || {}))) - ).forEach(name => { - let dep = allDeps.get(name) - if (!dep) { - const depNode = (pkgLock.dependencies || {})[name] - dep = makeNode(name, name, depNode) - } - addChild(dep, tree, allDeps, pkgLock) - }) - return tree -} - -module.exports.node = makeNode -function makeNode (name, address, opts) { - return new LogicalTree(name, address, opts || {}) -} - -function addChild (dep, tree, allDeps, pkgLock) { - tree.addDep(dep) - allDeps.set(dep.address, dep) - const addr = dep.address - const lockNode = atAddr(pkgLock, addr) - Object.keys(lockNode.requires || {}).forEach(name => { - const tdepAddr = reqAddr(pkgLock, name, addr) - let tdep = allDeps.get(tdepAddr) - if (!tdep) { - tdep = makeNode(name, tdepAddr, atAddr(pkgLock, tdepAddr)) - addChild(tdep, dep, allDeps, pkgLock) - } else { - dep.addDep(tdep) - } - }) -} - -module.exports._reqAddr = reqAddr -function reqAddr (pkgLock, name, fromAddr) { - const lockNode = atAddr(pkgLock, fromAddr) - const child = (lockNode.dependencies || {})[name] - if (child) { - return `${fromAddr}:${name}` - } else { - const parts = fromAddr.split(':') - while (parts.length) { - parts.pop() - const joined = parts.join(':') - const parent = atAddr(pkgLock, joined) - if (parent) { - const child = (parent.dependencies || {})[name] - if (child) { - return `${joined}${parts.length ? ':' : ''}${name}` - } - } - } - const err = new Error(`${name} not accessible from ${fromAddr}`) - err.pkgLock = pkgLock - err.target = name - err.from = fromAddr - throw err - } -} - -module.exports._atAddr = atAddr -function atAddr (pkgLock, addr) { - if (!addr.length) { return pkgLock } - const parts = addr.split(':') - return parts.reduce((acc, next) => { - return acc && (acc.dependencies || {})[next] - }, pkgLock) -} - -function promiseMap (arr, fn, opts, _index) { - _index = _index || 0 - const P = (opts && opts.Promise) || Promise - if (P.map) { - return P.map(arr, fn, opts) - } else { - if (!(arr instanceof Array)) { - arr = Array.from(arr) - } - if (_index >= arr.length) { - return P.resolve() - } else { - return P.resolve(fn(arr[_index], _index, arr)) - .then(() => promiseMap(arr, fn, opts, _index + 1)) - } - } -} diff --git a/deps/npm/node_modules/npm-logical-tree/package.json b/deps/npm/node_modules/npm-logical-tree/package.json deleted file mode 100644 index 33e8f1d0e4db65..00000000000000 --- a/deps/npm/node_modules/npm-logical-tree/package.json +++ /dev/null @@ -1,83 +0,0 @@ -{ - "_from": "npm-logical-tree@^1.2.1", - "_id": "npm-logical-tree@1.2.1", - "_inBundle": false, - "_integrity": "sha512-AJI/qxDB2PWI4LG1CYN579AY1vCiNyWfkiquCsJWqntRu/WwimVrC8yXeILBFHDwxfOejxewlmnvW9XXjMlYIg==", - "_location": "/npm-logical-tree", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "npm-logical-tree@^1.2.1", - "name": "npm-logical-tree", - "escapedName": "npm-logical-tree", - "rawSpec": "^1.2.1", - "saveSpec": null, - "fetchSpec": "^1.2.1" - }, - "_requiredBy": [ - "/libcipm" - ], - "_resolved": "https://registry.npmjs.org/npm-logical-tree/-/npm-logical-tree-1.2.1.tgz", - "_shasum": "44610141ca24664cad35d1e607176193fd8f5b88", - "_spec": "npm-logical-tree@^1.2.1", - "_where": "/Users/rebecca/code/npm/node_modules/libcipm", - "author": { - "name": "Kat Marchán", - "email": "kzm@sykosomatic.org" - }, - "bugs": { - "url": "https://github.com/npm/logical-tree/issues" - }, - "bundleDependencies": false, - "config": { - "nyc": { - "exclude": [ - "node_modules/**", - "test/**" - ] - } - }, - "contributors": [ - { - "name": "Rebecca Turner", - "email": "me@re-becca.org" - } - ], - "deprecated": false, - "description": "Calculate 'logical' trees from a package.json + package-lock", - "devDependencies": { - "bluebird": "^3.5.1", - "nyc": "^11.1.0", - "standard": "^10.0.2", - "standard-version": "^4.2.0", - "tap": "^10.7.0", - "weallbehave": "^1.2.0", - "weallcontribute": "^1.0.8" - }, - "files": [ - "*.js" - ], - "homepage": "https://github.com/npm/logical-tree#readme", - "keywords": [ - "npm", - "package manager" - ], - "license": "ISC", - "main": "index.js", - "name": "npm-logical-tree", - "repository": { - "type": "git", - "url": "git+https://github.com/npm/logical-tree.git" - }, - "scripts": { - "postrelease": "npm publish && git push --follow-tags", - "prerelease": "npm t", - "pretest": "standard lib test *.js", - "release": "standard-version -s", - "test": "nyc --all -- tap -J test/*.js", - "update-coc": "weallbehave -o . && git add CODE_OF_CONDUCT.md && git commit -m 'docs(coc): updated CODE_OF_CONDUCT.md'", - "update-contrib": "weallcontribute -o . && git add CONTRIBUTING.md && git commit -m 'docs(contributing): updated CONTRIBUTING.md'" - }, - "version": "1.2.1" -} diff --git a/deps/npm/node_modules/npm-normalize-package-bin/package-lock.json b/deps/npm/node_modules/npm-normalize-package-bin/package-lock.json deleted file mode 100644 index 0d3390d4eee636..00000000000000 --- a/deps/npm/node_modules/npm-normalize-package-bin/package-lock.json +++ /dev/null @@ -1,3529 +0,0 @@ -{ - "name": "npm-normalize-package-bin", - "version": "1.0.1", - "lockfileVersion": 1, - "requires": true, - "dependencies": { - "@babel/code-frame": { - "version": "7.5.5", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.5.5.tgz", - "integrity": "sha512-27d4lZoomVyo51VegxI20xZPuSHusqbQag/ztrBC7wegWoQ1nLREPVSKSW8byhTlzTKyNE4ifaTA6lCp7JjpFw==", - "dev": true, - "requires": { - "@babel/highlight": "^7.0.0" - } - }, - "@babel/generator": { - "version": "7.7.4", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.7.4.tgz", - "integrity": "sha512-m5qo2WgdOJeyYngKImbkyQrnUN1mPceaG5BV+G0E3gWsa4l/jCSryWJdM2x8OuGAOyh+3d5pVYfZWCiNFtynxg==", - "dev": true, - "requires": { - "@babel/types": "^7.7.4", - "jsesc": "^2.5.1", - "lodash": "^4.17.13", - "source-map": "^0.5.0" - }, - "dependencies": { - "source-map": { - "version": "0.5.7", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", - "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", - "dev": true - } - } - }, - "@babel/helper-function-name": { - "version": "7.7.4", - "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.7.4.tgz", - "integrity": "sha512-AnkGIdiBhEuiwdoMnKm7jfPfqItZhgRaZfMg1XX3bS25INOnLPjPG1Ppnajh8eqgt5kPJnfqrRHqFqmjKDZLzQ==", - "dev": true, - "requires": { - "@babel/helper-get-function-arity": "^7.7.4", - "@babel/template": "^7.7.4", - "@babel/types": "^7.7.4" - } - }, - "@babel/helper-get-function-arity": { - "version": "7.7.4", - "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.7.4.tgz", - "integrity": "sha512-QTGKEdCkjgzgfJ3bAyRwF4yyT3pg+vDgan8DSivq1eS0gwi+KGKE5x8kRcbeFTb/673mkO5SN1IZfmCfA5o+EA==", - "dev": true, - "requires": { - "@babel/types": "^7.7.4" - } - }, - "@babel/helper-split-export-declaration": { - "version": "7.7.4", - "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.7.4.tgz", - "integrity": "sha512-guAg1SXFcVr04Guk9eq0S4/rWS++sbmyqosJzVs8+1fH5NI+ZcmkaSkc7dmtAFbHFva6yRJnjW3yAcGxjueDug==", - "dev": true, - "requires": { - "@babel/types": "^7.7.4" - } - }, - "@babel/highlight": { - "version": "7.5.0", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.5.0.tgz", - "integrity": "sha512-7dV4eu9gBxoM0dAnj/BCFDW9LFU0zvTrkq0ugM7pnHEgguOEeOz1so2ZghEdzviYzQEED0r4EAgpsBChKy1TRQ==", - "dev": true, - "requires": { - "chalk": "^2.0.0", - "esutils": "^2.0.2", - "js-tokens": "^4.0.0" - } - }, - "@babel/parser": { - "version": "7.7.5", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.7.5.tgz", - "integrity": "sha512-KNlOe9+/nk4i29g0VXgl8PEXIRms5xKLJeuZ6UptN0fHv+jDiriG+y94X6qAgWTR0h3KaoM1wK5G5h7MHFRSig==", - "dev": true - }, - "@babel/runtime": { - "version": "7.7.6", - "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.7.6.tgz", - "integrity": "sha512-BWAJxpNVa0QlE5gZdWjSxXtemZyZ9RmrmVozxt3NUXeZhVIJ5ANyqmMc0JDrivBZyxUuQvFxlvH4OWWOogGfUw==", - "dev": true, - "requires": { - "regenerator-runtime": "^0.13.2" - } - }, - "@babel/template": { - "version": "7.7.4", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.7.4.tgz", - "integrity": "sha512-qUzihgVPguAzXCK7WXw8pqs6cEwi54s3E+HrejlkuWO6ivMKx9hZl3Y2fSXp9i5HgyWmj7RKP+ulaYnKM4yYxw==", - "dev": true, - "requires": { - "@babel/code-frame": "^7.0.0", - "@babel/parser": "^7.7.4", - "@babel/types": "^7.7.4" - } - }, - "@babel/traverse": { - "version": "7.7.4", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.7.4.tgz", - "integrity": "sha512-P1L58hQyupn8+ezVA2z5KBm4/Zr4lCC8dwKCMYzsa5jFMDMQAzaBNy9W5VjB+KAmBjb40U7a/H6ao+Xo+9saIw==", - "dev": true, - "requires": { - "@babel/code-frame": "^7.5.5", - "@babel/generator": "^7.7.4", - "@babel/helper-function-name": "^7.7.4", - "@babel/helper-split-export-declaration": "^7.7.4", - "@babel/parser": "^7.7.4", - "@babel/types": "^7.7.4", - "debug": "^4.1.0", - "globals": "^11.1.0", - "lodash": "^4.17.13" - } - }, - "@babel/types": { - "version": "7.7.4", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.7.4.tgz", - "integrity": "sha512-cz5Ji23KCi4T+YIE/BolWosrJuSmoZeN1EFnRtBwF+KKLi8GG/Z2c2hOJJeCXPk4mwk4QFvTmwIodJowXgttRA==", - "dev": true, - "requires": { - "esutils": "^2.0.2", - "lodash": "^4.17.13", - "to-fast-properties": "^2.0.0" - } - }, - "ajv": { - "version": "6.10.2", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.10.2.tgz", - "integrity": "sha512-TXtUUEYHuaTEbLZWIKUr5pmBuhDLy+8KYtPYdcV8qC+pOZL+NKqYwvWSRrVXHn+ZmRRAu8vJTAznH7Oag6RVRw==", - "dev": true, - "requires": { - "fast-deep-equal": "^2.0.1", - "fast-json-stable-stringify": "^2.0.0", - "json-schema-traverse": "^0.4.1", - "uri-js": "^4.2.2" - } - }, - "ansi-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", - "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", - "dev": true - }, - "ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "requires": { - "color-convert": "^1.9.0" - } - }, - "anymatch": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.1.tgz", - "integrity": "sha512-mM8522psRCqzV+6LhomX5wgp25YVibjh8Wj23I5RPkPppSVSjyKD2A2mBJmWGa+KN7f2D6LNh9jkBCeyLktzjg==", - "dev": true, - "requires": { - "normalize-path": "^3.0.0", - "picomatch": "^2.0.4" - } - }, - "append-transform": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/append-transform/-/append-transform-1.0.0.tgz", - "integrity": "sha512-P009oYkeHyU742iSZJzZZywj4QRJdnTWffaKuJQLablCZ1uz6/cW4yaRgcDaoQ+uwOxxnt0gRUcwfsNP2ri0gw==", - "dev": true, - "requires": { - "default-require-extensions": "^2.0.0" - } - }, - "archy": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/archy/-/archy-1.0.0.tgz", - "integrity": "sha1-+cjBN1fMHde8N5rHeyxipcKGjEA=", - "dev": true - }, - "arg": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/arg/-/arg-4.1.2.tgz", - "integrity": "sha512-+ytCkGcBtHZ3V2r2Z06AncYO8jz46UEamcspGoU8lHcEbpn6J77QK0vdWvChsclg/tM5XIJC5tnjmPp7Eq6Obg==", - "dev": true - }, - "argparse": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", - "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", - "dev": true, - "requires": { - "sprintf-js": "~1.0.2" - } - }, - "asn1": { - "version": "0.2.4", - "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.4.tgz", - "integrity": "sha512-jxwzQpLQjSmWXgwaCZE9Nz+glAG01yF1QnWgbhGwHI5A6FRIEY6IVqtHhIepHqI7/kyEyQEagBC5mBEFlIYvdg==", - "dev": true, - "requires": { - "safer-buffer": "~2.1.0" - } - }, - "assert-plus": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", - "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=", - "dev": true - }, - "async-hook-domain": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/async-hook-domain/-/async-hook-domain-1.1.3.tgz", - "integrity": "sha512-ZovMxSbADV3+biB7oR1GL5lGyptI24alp0LWHlmz1OFc5oL47pz3EiIF6nXOkDW7yLqih4NtsiYduzdDW0i+Wg==", - "dev": true, - "requires": { - "source-map-support": "^0.5.11" - } - }, - "asynckit": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", - "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=", - "dev": true - }, - "aws-sign2": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz", - "integrity": "sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg=", - "dev": true - }, - "aws4": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.9.0.tgz", - "integrity": "sha512-Uvq6hVe90D0B2WEnUqtdgY1bATGz3mw33nH9Y+dmA+w5DHvUmBgkr5rM/KCHpCsiFNRUfokW/szpPPgMK2hm4A==", - "dev": true - }, - "balanced-match": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", - "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", - "dev": true - }, - "bcrypt-pbkdf": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz", - "integrity": "sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4=", - "dev": true, - "requires": { - "tweetnacl": "^0.14.3" - } - }, - "binary-extensions": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.0.0.tgz", - "integrity": "sha512-Phlt0plgpIIBOGTT/ehfFnbNlfsDEiqmzE2KRXoX1bLIlir4X/MR+zSyBEkL05ffWgnRSf/DXv+WrUAVr93/ow==", - "dev": true - }, - "bind-obj-methods": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/bind-obj-methods/-/bind-obj-methods-2.0.0.tgz", - "integrity": "sha512-3/qRXczDi2Cdbz6jE+W3IflJOutRVica8frpBn14de1mBOkzDo+6tY33kNhvkw54Kn3PzRRD2VnGbGPcTAk4sw==", - "dev": true - }, - "brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "dev": true, - "requires": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "braces": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", - "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", - "dev": true, - "requires": { - "fill-range": "^7.0.1" - } - }, - "browser-process-hrtime": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/browser-process-hrtime/-/browser-process-hrtime-1.0.0.tgz", - "integrity": "sha512-9o5UecI3GhkpM6DrXr69PblIuWxPKk9Y0jHBRhdocZ2y7YECBFCsHm79Pr3OyR2AvjhDkabFJaDJMYRazHgsow==", - "dev": true - }, - "buffer-from": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz", - "integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==", - "dev": true - }, - "caching-transform": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/caching-transform/-/caching-transform-3.0.2.tgz", - "integrity": "sha512-Mtgcv3lh3U0zRii/6qVgQODdPA4G3zhG+jtbCWj39RXuUFTMzH0vcdMtaJS1jPowd+It2Pqr6y3NJMQqOqCE2w==", - "dev": true, - "requires": { - "hasha": "^3.0.0", - "make-dir": "^2.0.0", - "package-hash": "^3.0.0", - "write-file-atomic": "^2.4.2" - }, - "dependencies": { - "write-file-atomic": { - "version": "2.4.3", - "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-2.4.3.tgz", - "integrity": "sha512-GaETH5wwsX+GcnzhPgKcKjJ6M2Cq3/iZp1WyY/X1CSqrW+jVNM9Y7D8EC2sM4ZG/V8wZlSniJnCKWPmBYAucRQ==", - "dev": true, - "requires": { - "graceful-fs": "^4.1.11", - "imurmurhash": "^0.1.4", - "signal-exit": "^3.0.2" - } - } - } - }, - "camelcase": { - "version": "5.3.1", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", - "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", - "dev": true - }, - "caseless": { - "version": "0.12.0", - "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", - "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=", - "dev": true - }, - "chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dev": true, - "requires": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - } - }, - "chokidar": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.3.0.tgz", - "integrity": "sha512-dGmKLDdT3Gdl7fBUe8XK+gAtGmzy5Fn0XkkWQuYxGIgWVPPse2CxFA5mtrlD0TOHaHjEUqkWNyP1XdHoJES/4A==", - "dev": true, - "requires": { - "anymatch": "~3.1.1", - "braces": "~3.0.2", - "fsevents": "~2.1.1", - "glob-parent": "~5.1.0", - "is-binary-path": "~2.1.0", - "is-glob": "~4.0.1", - "normalize-path": "~3.0.0", - "readdirp": "~3.2.0" - } - }, - "cliui": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-4.1.0.tgz", - "integrity": "sha512-4FG+RSG9DL7uEwRUZXZn3SS34DiDPfzP0VOiEwtUWlE+AR2EIg+hSyvrIgUUfhdgR/UkAeW2QHgeP+hWrXs7jQ==", - "dev": true, - "requires": { - "string-width": "^2.1.1", - "strip-ansi": "^4.0.0", - "wrap-ansi": "^2.0.0" - } - }, - "code-point-at": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", - "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=", - "dev": true - }, - "color-convert": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", - "dev": true, - "requires": { - "color-name": "1.1.3" - } - }, - "color-name": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", - "dev": true - }, - "color-support": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-support/-/color-support-1.1.3.tgz", - "integrity": "sha512-qiBjkpbMLO/HL68y+lh4q0/O1MZFj2RX6X/KmMa3+gJD3z+WwI1ZzDHysvqHGS3mP6mznPckpXmw1nI9cJjyRg==", - "dev": true - }, - "combined-stream": { - "version": "1.0.8", - "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", - "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", - "dev": true, - "requires": { - "delayed-stream": "~1.0.0" - } - }, - "commander": { - "version": "2.20.3", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", - "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", - "dev": true, - "optional": true - }, - "commondir": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz", - "integrity": "sha1-3dgA2gxmEnOTzKWVDqloo6rxJTs=", - "dev": true - }, - "concat-map": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", - "dev": true - }, - "convert-source-map": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.7.0.tgz", - "integrity": "sha512-4FJkXzKXEDB1snCFZlLP4gpC3JILicCpGbzG9f9G7tGqGCzETQ2hWPrcinA9oU4wtf2biUaEH5065UnMeR33oA==", - "dev": true, - "requires": { - "safe-buffer": "~5.1.1" - }, - "dependencies": { - "safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", - "dev": true - } - } - }, - "core-util-is": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", - "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", - "dev": true - }, - "coveralls": { - "version": "3.0.9", - "resolved": "https://registry.npmjs.org/coveralls/-/coveralls-3.0.9.tgz", - "integrity": "sha512-nNBg3B1+4iDox5A5zqHKzUTiwl2ey4k2o0NEcVZYvl+GOSJdKBj4AJGKLv6h3SvWch7tABHePAQOSZWM9E2hMg==", - "dev": true, - "requires": { - "js-yaml": "^3.13.1", - "lcov-parse": "^1.0.0", - "log-driver": "^1.2.7", - "minimist": "^1.2.0", - "request": "^2.88.0" - } - }, - "cp-file": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/cp-file/-/cp-file-6.2.0.tgz", - "integrity": "sha512-fmvV4caBnofhPe8kOcitBwSn2f39QLjnAnGq3gO9dfd75mUytzKNZB1hde6QHunW2Rt+OwuBOMc3i1tNElbszA==", - "dev": true, - "requires": { - "graceful-fs": "^4.1.2", - "make-dir": "^2.0.0", - "nested-error-stacks": "^2.0.0", - "pify": "^4.0.1", - "safe-buffer": "^5.0.1" - } - }, - "cross-spawn": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-4.0.2.tgz", - "integrity": "sha1-e5JHYhwjrf3ThWAEqCPL45dCTUE=", - "dev": true, - "requires": { - "lru-cache": "^4.0.1", - "which": "^1.2.9" - }, - "dependencies": { - "which": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", - "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", - "dev": true, - "requires": { - "isexe": "^2.0.0" - } - } - } - }, - "dashdash": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", - "integrity": "sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=", - "dev": true, - "requires": { - "assert-plus": "^1.0.0" - } - }, - "debug": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", - "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", - "dev": true, - "requires": { - "ms": "^2.1.1" - } - }, - "decamelize": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", - "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=", - "dev": true - }, - "default-require-extensions": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/default-require-extensions/-/default-require-extensions-2.0.0.tgz", - "integrity": "sha1-9fj7sYp9bVCyH2QfZJ67Uiz+JPc=", - "dev": true, - "requires": { - "strip-bom": "^3.0.0" - } - }, - "delayed-stream": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", - "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=", - "dev": true - }, - "diff": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.1.tgz", - "integrity": "sha512-s2+XdvhPCOF01LRQBC8hf4vhbVmI2CGS5aZnxLJlT5FtdhPCDFq80q++zK2KlrVorVDdL5BOGZ/VfLrVtYNF+Q==", - "dev": true - }, - "diff-frag": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/diff-frag/-/diff-frag-1.0.1.tgz", - "integrity": "sha512-6/v2PC/6UTGcWPPetb9acL8foberUg/CtPdALeJUdD1B/weHNvzftoo00gYznqHGRhHEbykUGzqfG9RWOSr5yw==", - "dev": true - }, - "ecc-jsbn": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz", - "integrity": "sha1-OoOpBOVDUyh4dMVkt1SThoSamMk=", - "dev": true, - "requires": { - "jsbn": "~0.1.0", - "safer-buffer": "^2.1.0" - } - }, - "emoji-regex": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", - "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==", - "dev": true - }, - "error-ex": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", - "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", - "dev": true, - "requires": { - "is-arrayish": "^0.2.1" - } - }, - "es6-error": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/es6-error/-/es6-error-4.1.1.tgz", - "integrity": "sha512-Um/+FxMr9CISWh0bi5Zv0iOD+4cFh5qLeks1qhAopKVAJw3drgKbKySikp7wGhDL0HPeaja0P5ULZrxLkniUVg==", - "dev": true - }, - "escape-string-regexp": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", - "dev": true - }, - "esm": { - "version": "3.2.25", - "resolved": "https://registry.npmjs.org/esm/-/esm-3.2.25.tgz", - "integrity": "sha512-U1suiZ2oDVWv4zPO56S0NcR5QriEahGtdN2OR6FiOG4WJvcjBVFB0qI4+eKoWFH483PKGuLuu6V8Z4T5g63UVA==", - "dev": true - }, - "esprima": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", - "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", - "dev": true - }, - "esutils": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", - "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", - "dev": true - }, - "events-to-array": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/events-to-array/-/events-to-array-1.1.2.tgz", - "integrity": "sha1-LUH1Y+H+QA7Uli/hpNXGp1Od9/Y=", - "dev": true - }, - "extend": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", - "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==", - "dev": true - }, - "extsprintf": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", - "integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=", - "dev": true - }, - "fast-deep-equal": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz", - "integrity": "sha1-ewUhjd+WZ79/Nwv3/bLLFf3Qqkk=", - "dev": true - }, - "fast-json-stable-stringify": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz", - "integrity": "sha1-1RQsDK7msRifh9OnYREGT4bIu/I=", - "dev": true - }, - "fill-range": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", - "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", - "dev": true, - "requires": { - "to-regex-range": "^5.0.1" - } - }, - "find-cache-dir": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-2.1.0.tgz", - "integrity": "sha512-Tq6PixE0w/VMFfCgbONnkiQIVol/JJL7nRMi20fqzA4NRs9AfeqMGeRdPi3wIhYkxjeBaWh2rxwapn5Tu3IqOQ==", - "dev": true, - "requires": { - "commondir": "^1.0.1", - "make-dir": "^2.0.0", - "pkg-dir": "^3.0.0" - } - }, - "find-up": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", - "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", - "dev": true, - "requires": { - "locate-path": "^3.0.0" - } - }, - "findit": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/findit/-/findit-2.0.0.tgz", - "integrity": "sha1-ZQnwEmr0wXhVHPqZOU4DLhOk1W4=", - "dev": true - }, - "flow-parser": { - "version": "0.113.0", - "resolved": "https://registry.npmjs.org/flow-parser/-/flow-parser-0.113.0.tgz", - "integrity": "sha512-+hRyEB1sVLNMTMniDdM1JIS8BJ3HUL7IFIJaxX+t/JUy0GNYdI0Tg1QLx8DJmOF8HeoCrUDcREpnDAc/pPta3w==", - "dev": true - }, - "flow-remove-types": { - "version": "2.113.0", - "resolved": "https://registry.npmjs.org/flow-remove-types/-/flow-remove-types-2.113.0.tgz", - "integrity": "sha512-Rp4hN/JlGmUjNxXuBXr6Or+MgDH9xKc+ZiUSRzl/fbpiH9RaCPAQKsgVEYNPcIE26q6RpAuMQfvzR0jQfuwUZQ==", - "dev": true, - "requires": { - "flow-parser": "^0.113.0", - "pirates": "^3.0.2", - "vlq": "^0.2.1" - } - }, - "foreground-child": { - "version": "1.5.6", - "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-1.5.6.tgz", - "integrity": "sha1-T9ca0t/elnibmApcCilZN8svXOk=", - "dev": true, - "requires": { - "cross-spawn": "^4", - "signal-exit": "^3.0.0" - } - }, - "forever-agent": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", - "integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=", - "dev": true - }, - "form-data": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.3.tgz", - "integrity": "sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ==", - "dev": true, - "requires": { - "asynckit": "^0.4.0", - "combined-stream": "^1.0.6", - "mime-types": "^2.1.12" - } - }, - "fs-exists-cached": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs-exists-cached/-/fs-exists-cached-1.0.0.tgz", - "integrity": "sha1-zyVVTKBQ3EmuZla0HeQiWJidy84=", - "dev": true - }, - "fs.realpath": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", - "dev": true - }, - "fsevents": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.1.2.tgz", - "integrity": "sha512-R4wDiBwZ0KzpgOWetKDug1FZcYhqYnUYKtfZYt4mD5SBz76q0KR4Q9o7GIPamsVPGmW3EYPPJ0dOOjvx32ldZA==", - "dev": true, - "optional": true - }, - "function-loop": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/function-loop/-/function-loop-1.0.2.tgz", - "integrity": "sha512-Iw4MzMfS3udk/rqxTiDDCllhGwlOrsr50zViTOO/W6lS/9y6B1J0BD2VZzrnWUYBJsl3aeqjgR5v7bWWhZSYbA==", - "dev": true - }, - "get-caller-file": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", - "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", - "dev": true - }, - "getpass": { - "version": "0.1.7", - "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", - "integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=", - "dev": true, - "requires": { - "assert-plus": "^1.0.0" - } - }, - "glob": { - "version": "7.1.6", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", - "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", - "dev": true, - "requires": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - } - }, - "glob-parent": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.0.tgz", - "integrity": "sha512-qjtRgnIVmOfnKUE3NJAQEdk+lKrxfw8t5ke7SXtfMTHcjsBfOfWXCQfdb30zfDoZQ2IRSIiidmjtbHZPZ++Ihw==", - "dev": true, - "requires": { - "is-glob": "^4.0.1" - } - }, - "globals": { - "version": "11.12.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", - "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", - "dev": true - }, - "graceful-fs": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.3.tgz", - "integrity": "sha512-a30VEBm4PEdx1dRB7MFK7BejejvCvBronbLjht+sHuGYj8PHs7M/5Z+rt5lw551vZ7yfTCj4Vuyy3mSJytDWRQ==", - "dev": true - }, - "handlebars": { - "version": "4.5.3", - "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.5.3.tgz", - "integrity": "sha512-3yPecJoJHK/4c6aZhSvxOyG4vJKDshV36VHp0iVCDVh7o9w2vwi3NSnL2MMPj3YdduqaBcu7cGbggJQM0br9xA==", - "dev": true, - "requires": { - "neo-async": "^2.6.0", - "optimist": "^0.6.1", - "source-map": "^0.6.1", - "uglify-js": "^3.1.4" - } - }, - "har-schema": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz", - "integrity": "sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI=", - "dev": true - }, - "har-validator": { - "version": "5.1.3", - "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.1.3.tgz", - "integrity": "sha512-sNvOCzEQNr/qrvJgc3UG/kD4QtlHycrzwS+6mfTrrSq97BvaYcPZZI1ZSqGSPR73Cxn4LKTD4PttRwfU7jWq5g==", - "dev": true, - "requires": { - "ajv": "^6.5.5", - "har-schema": "^2.0.0" - } - }, - "has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", - "dev": true - }, - "hasha": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/hasha/-/hasha-3.0.0.tgz", - "integrity": "sha1-UqMvq4Vp1BymmmH/GiFPjrfIvTk=", - "dev": true, - "requires": { - "is-stream": "^1.0.1" - } - }, - "hosted-git-info": { - "version": "2.8.5", - "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.5.tgz", - "integrity": "sha512-kssjab8CvdXfcXMXVcvsXum4Hwdq9XGtRD3TteMEvEbq0LXyiNQr6AprqKqfeaDXze7SxWvRxdpwE6ku7ikLkg==", - "dev": true - }, - "http-signature": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz", - "integrity": "sha1-muzZJRFHcvPZW2WmCruPfBj7rOE=", - "dev": true, - "requires": { - "assert-plus": "^1.0.0", - "jsprim": "^1.2.2", - "sshpk": "^1.7.0" - } - }, - "imurmurhash": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", - "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=", - "dev": true - }, - "inflight": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", - "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", - "dev": true, - "requires": { - "once": "^1.3.0", - "wrappy": "1" - } - }, - "inherits": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", - "dev": true - }, - "is-arrayish": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", - "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=", - "dev": true - }, - "is-binary-path": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", - "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", - "dev": true, - "requires": { - "binary-extensions": "^2.0.0" - } - }, - "is-extglob": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", - "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", - "dev": true - }, - "is-fullwidth-code-point": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", - "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", - "dev": true - }, - "is-glob": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz", - "integrity": "sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg==", - "dev": true, - "requires": { - "is-extglob": "^2.1.1" - } - }, - "is-number": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", - "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", - "dev": true - }, - "is-stream": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", - "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=", - "dev": true - }, - "is-typedarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", - "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=", - "dev": true - }, - "isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", - "dev": true, - "optional": true - }, - "isexe": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", - "dev": true - }, - "isstream": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", - "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=", - "dev": true - }, - "istanbul-lib-coverage": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.5.tgz", - "integrity": "sha512-8aXznuEPCJvGnMSRft4udDRDtb1V3pkQkMMI5LI+6HuQz5oQ4J2UFn1H82raA3qJtyOLkkwVqICBQkjnGtn5mA==", - "dev": true - }, - "istanbul-lib-hook": { - "version": "2.0.7", - "resolved": "https://registry.npmjs.org/istanbul-lib-hook/-/istanbul-lib-hook-2.0.7.tgz", - "integrity": "sha512-vrRztU9VRRFDyC+aklfLoeXyNdTfga2EI3udDGn4cZ6fpSXpHLV9X6CHvfoMCPtggg8zvDDmC4b9xfu0z6/llA==", - "dev": true, - "requires": { - "append-transform": "^1.0.0" - } - }, - "istanbul-lib-instrument": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-3.3.0.tgz", - "integrity": "sha512-5nnIN4vo5xQZHdXno/YDXJ0G+I3dAm4XgzfSVTPLQpj/zAV2dV6Juy0yaf10/zrJOJeHoN3fraFe+XRq2bFVZA==", - "dev": true, - "requires": { - "@babel/generator": "^7.4.0", - "@babel/parser": "^7.4.3", - "@babel/template": "^7.4.0", - "@babel/traverse": "^7.4.3", - "@babel/types": "^7.4.0", - "istanbul-lib-coverage": "^2.0.5", - "semver": "^6.0.0" - }, - "dependencies": { - "semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", - "dev": true - } - } - }, - "istanbul-lib-processinfo": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/istanbul-lib-processinfo/-/istanbul-lib-processinfo-1.0.0.tgz", - "integrity": "sha512-FY0cPmWa4WoQNlvB8VOcafiRoB5nB+l2Pz2xGuXHRSy1KM8QFOYfz/rN+bGMCAeejrY3mrpF5oJHcN0s/garCg==", - "dev": true, - "requires": { - "archy": "^1.0.0", - "cross-spawn": "^6.0.5", - "istanbul-lib-coverage": "^2.0.3", - "rimraf": "^2.6.3", - "uuid": "^3.3.2" - }, - "dependencies": { - "cross-spawn": { - "version": "6.0.5", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", - "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", - "dev": true, - "requires": { - "nice-try": "^1.0.4", - "path-key": "^2.0.1", - "semver": "^5.5.0", - "shebang-command": "^1.2.0", - "which": "^1.2.9" - } - }, - "which": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", - "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", - "dev": true, - "requires": { - "isexe": "^2.0.0" - } - } - } - }, - "istanbul-lib-report": { - "version": "2.0.8", - "resolved": "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-2.0.8.tgz", - "integrity": "sha512-fHBeG573EIihhAblwgxrSenp0Dby6tJMFR/HvlerBsrCTD5bkUuoNtn3gVh29ZCS824cGGBPn7Sg7cNk+2xUsQ==", - "dev": true, - "requires": { - "istanbul-lib-coverage": "^2.0.5", - "make-dir": "^2.1.0", - "supports-color": "^6.1.0" - }, - "dependencies": { - "supports-color": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-6.1.0.tgz", - "integrity": "sha512-qe1jfm1Mg7Nq/NSh6XE24gPXROEVsWHxC1LIx//XNlD9iw7YZQGjZNjYN7xGaEG6iKdA8EtNFW6R0gjnVXp+wQ==", - "dev": true, - "requires": { - "has-flag": "^3.0.0" - } - } - } - }, - "istanbul-lib-source-maps": { - "version": "3.0.6", - "resolved": "https://registry.npmjs.org/istanbul-lib-source-maps/-/istanbul-lib-source-maps-3.0.6.tgz", - "integrity": "sha512-R47KzMtDJH6X4/YW9XTx+jrLnZnscW4VpNN+1PViSYTejLVPWv7oov+Duf8YQSPyVRUvueQqz1TcsC6mooZTXw==", - "dev": true, - "requires": { - "debug": "^4.1.1", - "istanbul-lib-coverage": "^2.0.5", - "make-dir": "^2.1.0", - "rimraf": "^2.6.3", - "source-map": "^0.6.1" - } - }, - "istanbul-reports": { - "version": "2.2.6", - "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-2.2.6.tgz", - "integrity": "sha512-SKi4rnMyLBKe0Jy2uUdx28h8oG7ph2PPuQPvIAh31d+Ci+lSiEu4C+h3oBPuJ9+mPKhOyW0M8gY4U5NM1WLeXA==", - "dev": true, - "requires": { - "handlebars": "^4.1.2" - } - }, - "jackspeak": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-1.4.0.tgz", - "integrity": "sha512-VDcSunT+wcccoG46FtzuBAyQKlzhHjli4q31e1fIHGOsRspqNUFjVzGb+7eIFDlTvqLygxapDHPHS0ouT2o/tw==", - "dev": true, - "requires": { - "cliui": "^4.1.0" - } - }, - "js-tokens": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", - "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", - "dev": true - }, - "js-yaml": { - "version": "3.13.1", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.13.1.tgz", - "integrity": "sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw==", - "dev": true, - "requires": { - "argparse": "^1.0.7", - "esprima": "^4.0.0" - } - }, - "jsbn": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", - "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=", - "dev": true - }, - "jsesc": { - "version": "2.5.2", - "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz", - "integrity": "sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==", - "dev": true - }, - "json-parse-better-errors": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz", - "integrity": "sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==", - "dev": true - }, - "json-schema": { - "version": "0.2.3", - "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.2.3.tgz", - "integrity": "sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM=", - "dev": true - }, - "json-schema-traverse": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", - "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", - "dev": true - }, - "json-stringify-safe": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", - "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=", - "dev": true - }, - "jsprim": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.1.tgz", - "integrity": "sha1-MT5mvB5cwG5Di8G3SZwuXFastqI=", - "dev": true, - "requires": { - "assert-plus": "1.0.0", - "extsprintf": "1.3.0", - "json-schema": "0.2.3", - "verror": "1.10.0" - } - }, - "lcov-parse": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/lcov-parse/-/lcov-parse-1.0.0.tgz", - "integrity": "sha1-6w1GtUER68VhrLTECO+TY73I9+A=", - "dev": true - }, - "load-json-file": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-4.0.0.tgz", - "integrity": "sha1-L19Fq5HjMhYjT9U62rZo607AmTs=", - "dev": true, - "requires": { - "graceful-fs": "^4.1.2", - "parse-json": "^4.0.0", - "pify": "^3.0.0", - "strip-bom": "^3.0.0" - }, - "dependencies": { - "pify": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", - "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=", - "dev": true - } - } - }, - "locate-path": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", - "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", - "dev": true, - "requires": { - "p-locate": "^3.0.0", - "path-exists": "^3.0.0" - } - }, - "lodash": { - "version": "4.17.15", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", - "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==", - "dev": true - }, - "lodash.flattendeep": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/lodash.flattendeep/-/lodash.flattendeep-4.4.0.tgz", - "integrity": "sha1-+wMJF/hqMTTlvJvsDWngAT3f7bI=", - "dev": true - }, - "log-driver": { - "version": "1.2.7", - "resolved": "https://registry.npmjs.org/log-driver/-/log-driver-1.2.7.tgz", - "integrity": "sha512-U7KCmLdqsGHBLeWqYlFA0V0Sl6P08EE1ZrmA9cxjUE0WVqT9qnyVDPz1kzpFEP0jdJuFnasWIfSd7fsaNXkpbg==", - "dev": true - }, - "loose-envify": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", - "integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==", - "dev": true, - "requires": { - "js-tokens": "^3.0.0 || ^4.0.0" - } - }, - "lru-cache": { - "version": "4.1.5", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.5.tgz", - "integrity": "sha512-sWZlbEP2OsHNkXrMl5GYk/jKk70MBng6UU4YI/qGDYbgf6YbP4EvmqISbXCoJiRKs+1bSpFHVgQxvJ17F2li5g==", - "dev": true, - "requires": { - "pseudomap": "^1.0.2", - "yallist": "^2.1.2" - } - }, - "make-dir": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-2.1.0.tgz", - "integrity": "sha512-LS9X+dc8KLxXCb8dni79fLIIUA5VyZoyjSMCwTluaXA0o27cCK0bhXkpgw+sTXVpPy/lSO57ilRixqk0vDmtRA==", - "dev": true, - "requires": { - "pify": "^4.0.1", - "semver": "^5.6.0" - } - }, - "make-error": { - "version": "1.3.5", - "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.5.tgz", - "integrity": "sha512-c3sIjNUow0+8swNwVpqoH4YCShKNFkMaw6oH1mNS2haDZQqkeZFlHS3dhoeEbKKmJB4vXpJucU6oH75aDYeE9g==", - "dev": true - }, - "merge-source-map": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/merge-source-map/-/merge-source-map-1.1.0.tgz", - "integrity": "sha512-Qkcp7P2ygktpMPh2mCQZaf3jhN6D3Z/qVZHSdWvQ+2Ef5HgRAPBO57A77+ENm0CPx2+1Ce/MYKi3ymqdfuqibw==", - "dev": true, - "requires": { - "source-map": "^0.6.1" - } - }, - "mime-db": { - "version": "1.42.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.42.0.tgz", - "integrity": "sha512-UbfJCR4UAVRNgMpfImz05smAXK7+c+ZntjaA26ANtkXLlOe947Aag5zdIcKQULAiF9Cq4WxBi9jUs5zkA84bYQ==", - "dev": true - }, - "mime-types": { - "version": "2.1.25", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.25.tgz", - "integrity": "sha512-5KhStqB5xpTAeGqKBAMgwaYMnQik7teQN4IAzC7npDv6kzeU6prfkR67bc87J1kWMPGkoaZSq1npmexMgkmEVg==", - "dev": true, - "requires": { - "mime-db": "1.42.0" - } - }, - "minimatch": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", - "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", - "dev": true, - "requires": { - "brace-expansion": "^1.1.7" - } - }, - "minimist": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", - "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", - "dev": true - }, - "minipass": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.1.1.tgz", - "integrity": "sha512-UFqVihv6PQgwj8/yTGvl9kPz7xIAY+R5z6XYjRInD3Gk3qx6QGSD6zEcpeG4Dy/lQnv1J6zv8ejV90hyYIKf3w==", - "dev": true, - "requires": { - "yallist": "^4.0.0" - }, - "dependencies": { - "yallist": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", - "dev": true - } - } - }, - "mkdirp": { - "version": "0.5.1", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", - "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", - "dev": true, - "requires": { - "minimist": "0.0.8" - }, - "dependencies": { - "minimist": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", - "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", - "dev": true - } - } - }, - "ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true - }, - "neo-async": { - "version": "2.6.1", - "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.1.tgz", - "integrity": "sha512-iyam8fBuCUpWeKPGpaNMetEocMt364qkCsfL9JuhjXX6dRnguRVOfk2GZaDpPjcOKiiXCPINZC1GczQ7iTq3Zw==", - "dev": true - }, - "nested-error-stacks": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/nested-error-stacks/-/nested-error-stacks-2.1.0.tgz", - "integrity": "sha512-AO81vsIO1k1sM4Zrd6Hu7regmJN1NSiAja10gc4bX3F0wd+9rQmcuHQaHVQCYIEC8iFXnE+mavh23GOt7wBgug==", - "dev": true - }, - "nice-try": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz", - "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==", - "dev": true - }, - "node-modules-regexp": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/node-modules-regexp/-/node-modules-regexp-1.0.0.tgz", - "integrity": "sha1-jZ2+KJZKSsVxLpExZCEHxx6Q7EA=", - "dev": true - }, - "normalize-package-data": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz", - "integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==", - "dev": true, - "requires": { - "hosted-git-info": "^2.1.4", - "resolve": "^1.10.0", - "semver": "2 || 3 || 4 || 5", - "validate-npm-package-license": "^3.0.1" - } - }, - "normalize-path": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", - "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", - "dev": true - }, - "number-is-nan": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", - "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=", - "dev": true - }, - "nyc": { - "version": "14.1.1", - "resolved": "https://registry.npmjs.org/nyc/-/nyc-14.1.1.tgz", - "integrity": "sha512-OI0vm6ZGUnoGZv/tLdZ2esSVzDwUC88SNs+6JoSOMVxA+gKMB8Tk7jBwgemLx4O40lhhvZCVw1C+OYLOBOPXWw==", - "dev": true, - "requires": { - "archy": "^1.0.0", - "caching-transform": "^3.0.2", - "convert-source-map": "^1.6.0", - "cp-file": "^6.2.0", - "find-cache-dir": "^2.1.0", - "find-up": "^3.0.0", - "foreground-child": "^1.5.6", - "glob": "^7.1.3", - "istanbul-lib-coverage": "^2.0.5", - "istanbul-lib-hook": "^2.0.7", - "istanbul-lib-instrument": "^3.3.0", - "istanbul-lib-report": "^2.0.8", - "istanbul-lib-source-maps": "^3.0.6", - "istanbul-reports": "^2.2.4", - "js-yaml": "^3.13.1", - "make-dir": "^2.1.0", - "merge-source-map": "^1.1.0", - "resolve-from": "^4.0.0", - "rimraf": "^2.6.3", - "signal-exit": "^3.0.2", - "spawn-wrap": "^1.4.2", - "test-exclude": "^5.2.3", - "uuid": "^3.3.2", - "yargs": "^13.2.2", - "yargs-parser": "^13.0.0" - } - }, - "oauth-sign": { - "version": "0.9.0", - "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz", - "integrity": "sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==", - "dev": true - }, - "object-assign": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", - "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", - "dev": true - }, - "once": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", - "dev": true, - "requires": { - "wrappy": "1" - } - }, - "opener": { - "version": "1.5.1", - "resolved": "https://registry.npmjs.org/opener/-/opener-1.5.1.tgz", - "integrity": "sha512-goYSy5c2UXE4Ra1xixabeVh1guIX/ZV/YokJksb6q2lubWu6UbvPQ20p542/sFIll1nl8JnCyK9oBaOcCWXwvA==", - "dev": true - }, - "optimist": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/optimist/-/optimist-0.6.1.tgz", - "integrity": "sha1-2j6nRob6IaGaERwybpDrFaAZZoY=", - "dev": true, - "requires": { - "minimist": "~0.0.1", - "wordwrap": "~0.0.2" - }, - "dependencies": { - "minimist": { - "version": "0.0.10", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.10.tgz", - "integrity": "sha1-3j+YVD2/lggr5IrRoMfNqDYwHc8=", - "dev": true - } - } - }, - "os-homedir": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz", - "integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M=", - "dev": true - }, - "own-or": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/own-or/-/own-or-1.0.0.tgz", - "integrity": "sha1-Tod/vtqaLsgAD7wLyuOWRe6L+Nw=", - "dev": true - }, - "own-or-env": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/own-or-env/-/own-or-env-1.0.1.tgz", - "integrity": "sha512-y8qULRbRAlL6x2+M0vIe7jJbJx/kmUTzYonRAa2ayesR2qWLswninkVyeJe4x3IEXhdgoNodzjQRKAoEs6Fmrw==", - "dev": true, - "requires": { - "own-or": "^1.0.0" - } - }, - "p-limit": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.2.1.tgz", - "integrity": "sha512-85Tk+90UCVWvbDavCLKPOLC9vvY8OwEX/RtKF+/1OADJMVlFfEHOiMTPVyxg7mk/dKa+ipdHm0OUkTvCpMTuwg==", - "dev": true, - "requires": { - "p-try": "^2.0.0" - } - }, - "p-locate": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz", - "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", - "dev": true, - "requires": { - "p-limit": "^2.0.0" - } - }, - "p-try": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", - "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", - "dev": true - }, - "package-hash": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/package-hash/-/package-hash-3.0.0.tgz", - "integrity": "sha512-lOtmukMDVvtkL84rJHI7dpTYq+0rli8N2wlnqUcBuDWCfVhRUfOmnR9SsoHFMLpACvEV60dX7rd0rFaYDZI+FA==", - "dev": true, - "requires": { - "graceful-fs": "^4.1.15", - "hasha": "^3.0.0", - "lodash.flattendeep": "^4.4.0", - "release-zalgo": "^1.0.0" - } - }, - "parse-json": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-4.0.0.tgz", - "integrity": "sha1-vjX1Qlvh9/bHRxhPmKeIy5lHfuA=", - "dev": true, - "requires": { - "error-ex": "^1.3.1", - "json-parse-better-errors": "^1.0.1" - } - }, - "path-exists": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", - "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", - "dev": true - }, - "path-is-absolute": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", - "dev": true - }, - "path-key": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", - "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=", - "dev": true - }, - "path-parse": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz", - "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==", - "dev": true - }, - "path-type": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/path-type/-/path-type-3.0.0.tgz", - "integrity": "sha512-T2ZUsdZFHgA3u4e5PfPbjd7HDDpxPnQb5jN0SrDsjNSuVXHJqtwTnWqG0B1jZrgmJ/7lj1EmVIByWt1gxGkWvg==", - "dev": true, - "requires": { - "pify": "^3.0.0" - }, - "dependencies": { - "pify": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", - "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=", - "dev": true - } - } - }, - "performance-now": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", - "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=", - "dev": true - }, - "picomatch": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.1.1.tgz", - "integrity": "sha512-OYMyqkKzK7blWO/+XZYP6w8hH0LDvkBvdvKukti+7kqYFCiEAk+gI3DWnryapc0Dau05ugGTy0foQ6mqn4AHYA==", - "dev": true - }, - "pify": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz", - "integrity": "sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==", - "dev": true - }, - "pirates": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/pirates/-/pirates-3.0.2.tgz", - "integrity": "sha512-c5CgUJq6H2k6MJz72Ak1F5sN9n9wlSlJyEnwvpm9/y3WB4E3pHBDT2c6PEiS1vyJvq2bUxUAIu0EGf8Cx4Ic7Q==", - "dev": true, - "requires": { - "node-modules-regexp": "^1.0.0" - } - }, - "pkg-dir": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-3.0.0.tgz", - "integrity": "sha512-/E57AYkoeQ25qkxMj5PBOVgF8Kiu/h7cYS30Z5+R7WaiCCBfLq58ZI/dSeaEKb9WVJV5n/03QwrN3IeWIFllvw==", - "dev": true, - "requires": { - "find-up": "^3.0.0" - } - }, - "process-nextick-args": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", - "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==", - "dev": true, - "optional": true - }, - "prop-types": { - "version": "15.7.2", - "resolved": "https://registry.npmjs.org/prop-types/-/prop-types-15.7.2.tgz", - "integrity": "sha512-8QQikdH7//R2vurIJSutZ1smHYTcLpRWEOlHnzcWHmBYrOGUysKwSsrC89BCiFj3CbrfJ/nXFdJepOVrY1GCHQ==", - "dev": true, - "requires": { - "loose-envify": "^1.4.0", - "object-assign": "^4.1.1", - "react-is": "^16.8.1" - } - }, - "pseudomap": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz", - "integrity": "sha1-8FKijacOYYkX7wqKw0wa5aaChrM=", - "dev": true - }, - "psl": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/psl/-/psl-1.6.0.tgz", - "integrity": "sha512-SYKKmVel98NCOYXpkwUqZqh0ahZeeKfmisiLIcEZdsb+WbLv02g/dI5BUmZnIyOe7RzZtLax81nnb2HbvC2tzA==", - "dev": true - }, - "punycode": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", - "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", - "dev": true - }, - "qs": { - "version": "6.5.2", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.2.tgz", - "integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==", - "dev": true - }, - "react": { - "version": "16.12.0", - "resolved": "https://registry.npmjs.org/react/-/react-16.12.0.tgz", - "integrity": "sha512-fglqy3k5E+81pA8s+7K0/T3DBCF0ZDOher1elBFzF7O6arXJgzyu/FW+COxFvAWXJoJN9KIZbT2LXlukwphYTA==", - "dev": true, - "requires": { - "loose-envify": "^1.1.0", - "object-assign": "^4.1.1", - "prop-types": "^15.6.2" - } - }, - "react-is": { - "version": "16.12.0", - "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.12.0.tgz", - "integrity": "sha512-rPCkf/mWBtKc97aLL9/txD8DZdemK0vkA3JMLShjlJB3Pj3s+lpf1KaBzMfQrAmhMQB0n1cU/SUGgKKBCe837Q==", - "dev": true - }, - "read-pkg": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-3.0.0.tgz", - "integrity": "sha1-nLxoaXj+5l0WwA4rGcI3/Pbjg4k=", - "dev": true, - "requires": { - "load-json-file": "^4.0.0", - "normalize-package-data": "^2.3.2", - "path-type": "^3.0.0" - } - }, - "read-pkg-up": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-4.0.0.tgz", - "integrity": "sha512-6etQSH7nJGsK0RbG/2TeDzZFa8shjQ1um+SwQQ5cwKy0dhSXdOncEhb1CPpvQG4h7FyOV6EB6YlV0yJvZQNAkA==", - "dev": true, - "requires": { - "find-up": "^3.0.0", - "read-pkg": "^3.0.0" - } - }, - "readable-stream": { - "version": "2.3.6", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", - "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", - "dev": true, - "optional": true, - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - }, - "dependencies": { - "safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", - "dev": true, - "optional": true - } - } - }, - "readdirp": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.2.0.tgz", - "integrity": "sha512-crk4Qu3pmXwgxdSgGhgA/eXiJAPQiX4GMOZZMXnqKxHX7TaoL+3gQVo/WeuAiogr07DpnfjIMpXXa+PAIvwPGQ==", - "dev": true, - "requires": { - "picomatch": "^2.0.4" - } - }, - "regenerator-runtime": { - "version": "0.13.3", - "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.3.tgz", - "integrity": "sha512-naKIZz2GQ8JWh///G7L3X6LaQUAMp2lvb1rvwwsURe/VXwD6VMfr+/1NuNw3ag8v2kY1aQ/go5SNn79O9JU7yw==", - "dev": true - }, - "release-zalgo": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/release-zalgo/-/release-zalgo-1.0.0.tgz", - "integrity": "sha1-CXALflB0Mpc5Mw5TXFqQ+2eFFzA=", - "dev": true, - "requires": { - "es6-error": "^4.0.1" - } - }, - "request": { - "version": "2.88.0", - "resolved": "https://registry.npmjs.org/request/-/request-2.88.0.tgz", - "integrity": "sha512-NAqBSrijGLZdM0WZNsInLJpkJokL72XYjUpnB0iwsRgxh7dB6COrHnTBNwN0E+lHDAJzu7kLAkDeY08z2/A0hg==", - "dev": true, - "requires": { - "aws-sign2": "~0.7.0", - "aws4": "^1.8.0", - "caseless": "~0.12.0", - "combined-stream": "~1.0.6", - "extend": "~3.0.2", - "forever-agent": "~0.6.1", - "form-data": "~2.3.2", - "har-validator": "~5.1.0", - "http-signature": "~1.2.0", - "is-typedarray": "~1.0.0", - "isstream": "~0.1.2", - "json-stringify-safe": "~5.0.1", - "mime-types": "~2.1.19", - "oauth-sign": "~0.9.0", - "performance-now": "^2.1.0", - "qs": "~6.5.2", - "safe-buffer": "^5.1.2", - "tough-cookie": "~2.4.3", - "tunnel-agent": "^0.6.0", - "uuid": "^3.3.2" - } - }, - "require-directory": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", - "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=", - "dev": true - }, - "require-main-filename": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz", - "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==", - "dev": true - }, - "resolve": { - "version": "1.13.1", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.13.1.tgz", - "integrity": "sha512-CxqObCX8K8YtAhOBRg+lrcdn+LK+WYOS8tSjqSFbjtrI5PnS63QPhZl4+yKfrU9tdsbMu9Anr/amegT87M9Z6w==", - "dev": true, - "requires": { - "path-parse": "^1.0.6" - } - }, - "resolve-from": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", - "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", - "dev": true - }, - "rimraf": { - "version": "2.7.1", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", - "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==", - "dev": true, - "requires": { - "glob": "^7.1.3" - } - }, - "safe-buffer": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.0.tgz", - "integrity": "sha512-fZEwUGbVl7kouZs1jCdMLdt95hdIv0ZeHg6L7qPeciMZhZ+/gdesW4wgTARkrFWEpspjEATAzUGPG8N2jJiwbg==", - "dev": true - }, - "safer-buffer": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", - "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", - "dev": true - }, - "semver": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", - "dev": true - }, - "set-blocking": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", - "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=", - "dev": true - }, - "shebang-command": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", - "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=", - "dev": true, - "requires": { - "shebang-regex": "^1.0.0" - } - }, - "shebang-regex": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", - "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=", - "dev": true - }, - "signal-exit": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz", - "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=", - "dev": true - }, - "source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true - }, - "source-map-support": { - "version": "0.5.16", - "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.16.tgz", - "integrity": "sha512-efyLRJDr68D9hBBNIPWFjhpFzURh+KJykQwvMyW5UiZzYwoF6l4YMMDIJJEyFWxWCqfyxLzz6tSfUFR+kXXsVQ==", - "dev": true, - "requires": { - "buffer-from": "^1.0.0", - "source-map": "^0.6.0" - } - }, - "spawn-wrap": { - "version": "1.4.3", - "resolved": "https://registry.npmjs.org/spawn-wrap/-/spawn-wrap-1.4.3.tgz", - "integrity": "sha512-IgB8md0QW/+tWqcavuFgKYR/qIRvJkRLPJDFaoXtLLUaVcCDK0+HeFTkmQHj3eprcYhc+gOl0aEA1w7qZlYezw==", - "dev": true, - "requires": { - "foreground-child": "^1.5.6", - "mkdirp": "^0.5.0", - "os-homedir": "^1.0.1", - "rimraf": "^2.6.2", - "signal-exit": "^3.0.2", - "which": "^1.3.0" - }, - "dependencies": { - "which": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", - "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", - "dev": true, - "requires": { - "isexe": "^2.0.0" - } - } - } - }, - "spdx-correct": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.0.tgz", - "integrity": "sha512-lr2EZCctC2BNR7j7WzJ2FpDznxky1sjfxvvYEyzxNyb6lZXHODmEoJeFu4JupYlkfha1KZpJyoqiJ7pgA1qq8Q==", - "dev": true, - "requires": { - "spdx-expression-parse": "^3.0.0", - "spdx-license-ids": "^3.0.0" - } - }, - "spdx-exceptions": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.2.0.tgz", - "integrity": "sha512-2XQACfElKi9SlVb1CYadKDXvoajPgBVPn/gOQLrTvHdElaVhr7ZEbqJaRnJLVNeaI4cMEAgVCeBMKF6MWRDCRA==", - "dev": true - }, - "spdx-expression-parse": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.0.tgz", - "integrity": "sha512-Yg6D3XpRD4kkOmTpdgbUiEJFKghJH03fiC1OPll5h/0sO6neh2jqRDVHOQ4o/LMea0tgCkbMgea5ip/e+MkWyg==", - "dev": true, - "requires": { - "spdx-exceptions": "^2.1.0", - "spdx-license-ids": "^3.0.0" - } - }, - "spdx-license-ids": { - "version": "3.0.5", - "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.5.tgz", - "integrity": "sha512-J+FWzZoynJEXGphVIS+XEh3kFSjZX/1i9gFBaWQcB+/tmpe2qUsSBABpcxqxnAxFdiUFEgAX1bjYGQvIZmoz9Q==", - "dev": true - }, - "sprintf-js": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", - "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", - "dev": true - }, - "sshpk": { - "version": "1.16.1", - "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.16.1.tgz", - "integrity": "sha512-HXXqVUq7+pcKeLqqZj6mHFUMvXtOJt1uoUx09pFW6011inTMxqI8BA8PM95myrIyyKwdnzjdFjLiE6KBPVtJIg==", - "dev": true, - "requires": { - "asn1": "~0.2.3", - "assert-plus": "^1.0.0", - "bcrypt-pbkdf": "^1.0.0", - "dashdash": "^1.12.0", - "ecc-jsbn": "~0.1.1", - "getpass": "^0.1.1", - "jsbn": "~0.1.0", - "safer-buffer": "^2.0.2", - "tweetnacl": "~0.14.0" - } - }, - "stack-utils": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/stack-utils/-/stack-utils-1.0.2.tgz", - "integrity": "sha512-MTX+MeG5U994cazkjd/9KNAapsHnibjMLnfXodlkXw76JEea0UiNzrqidzo1emMwk7w5Qhc9jd4Bn9TBb1MFwA==", - "dev": true - }, - "string-width": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", - "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", - "dev": true, - "requires": { - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^4.0.0" - } - }, - "string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "dev": true, - "optional": true, - "requires": { - "safe-buffer": "~5.1.0" - }, - "dependencies": { - "safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", - "dev": true, - "optional": true - } - } - }, - "strip-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", - "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", - "dev": true, - "requires": { - "ansi-regex": "^3.0.0" - } - }, - "strip-bom": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", - "integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=", - "dev": true - }, - "supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, - "requires": { - "has-flag": "^3.0.0" - } - }, - "tap": { - "version": "14.10.2", - "resolved": "https://registry.npmjs.org/tap/-/tap-14.10.2.tgz", - "integrity": "sha512-JeUDsVrMFmR6b3p9hO9yIT/jibrK6LI7nFza5cqDGsxJyCp7yU3enRgS5nekuoAOzewbrU7P+9QDRDT01urROA==", - "dev": true, - "requires": { - "async-hook-domain": "^1.1.3", - "bind-obj-methods": "^2.0.0", - "browser-process-hrtime": "^1.0.0", - "chokidar": "^3.3.0", - "color-support": "^1.1.0", - "coveralls": "^3.0.8", - "diff": "^4.0.1", - "esm": "^3.2.25", - "findit": "^2.0.0", - "flow-remove-types": "^2.112.0", - "foreground-child": "^1.3.3", - "fs-exists-cached": "^1.0.0", - "function-loop": "^1.0.2", - "glob": "^7.1.6", - "import-jsx": "^3.0.0", - "ink": "^2.5.0", - "isexe": "^2.0.0", - "istanbul-lib-processinfo": "^1.0.0", - "jackspeak": "^1.4.0", - "minipass": "^3.1.1", - "mkdirp": "^0.5.1", - "nyc": "^14.1.1", - "opener": "^1.5.1", - "own-or": "^1.0.0", - "own-or-env": "^1.0.1", - "react": "^16.12.0", - "rimraf": "^2.7.1", - "signal-exit": "^3.0.0", - "source-map-support": "^0.5.16", - "stack-utils": "^1.0.2", - "tap-mocha-reporter": "^5.0.0", - "tap-parser": "^10.0.1", - "tap-yaml": "^1.0.0", - "tcompare": "^3.0.0", - "treport": "^1.0.0", - "trivial-deferred": "^1.0.1", - "ts-node": "^8.5.2", - "typescript": "^3.7.2", - "which": "^2.0.2", - "write-file-atomic": "^3.0.1", - "yaml": "^1.7.2", - "yapool": "^1.0.0" - }, - "dependencies": { - "@babel/code-frame": { - "version": "7.5.5", - "bundled": true, - "requires": { - "@babel/highlight": "^7.0.0" - } - }, - "@babel/core": { - "version": "7.7.4", - "bundled": true, - "dev": true, - "requires": { - "@babel/code-frame": "^7.5.5", - "@babel/generator": "^7.7.4", - "@babel/helpers": "^7.7.4", - "@babel/parser": "^7.7.4", - "@babel/template": "^7.7.4", - "@babel/traverse": "^7.7.4", - "@babel/types": "^7.7.4", - "convert-source-map": "^1.7.0", - "debug": "^4.1.0", - "json5": "^2.1.0", - "lodash": "^4.17.13", - "resolve": "^1.3.2", - "semver": "^5.4.1", - "source-map": "^0.5.0" - }, - "dependencies": { - "@babel/generator": { - "version": "7.7.4", - "bundled": true, - "dev": true, - "requires": { - "@babel/types": "^7.7.4", - "jsesc": "^2.5.1", - "lodash": "^4.17.13", - "source-map": "^0.5.0" - } - }, - "@babel/helper-function-name": { - "version": "7.7.4", - "bundled": true, - "dev": true, - "requires": { - "@babel/helper-get-function-arity": "^7.7.4", - "@babel/template": "^7.7.4", - "@babel/types": "^7.7.4" - } - }, - "@babel/helper-get-function-arity": { - "version": "7.7.4", - "bundled": true, - "dev": true, - "requires": { - "@babel/types": "^7.7.4" - } - }, - "@babel/helper-split-export-declaration": { - "version": "7.7.4", - "bundled": true, - "dev": true, - "requires": { - "@babel/types": "^7.7.4" - } - }, - "@babel/parser": { - "version": "7.7.4", - "bundled": true, - "dev": true - }, - "@babel/template": { - "version": "7.7.4", - "bundled": true, - "dev": true, - "requires": { - "@babel/code-frame": "^7.0.0", - "@babel/parser": "^7.7.4", - "@babel/types": "^7.7.4" - } - }, - "@babel/traverse": { - "version": "7.7.4", - "bundled": true, - "dev": true, - "requires": { - "@babel/code-frame": "^7.5.5", - "@babel/generator": "^7.7.4", - "@babel/helper-function-name": "^7.7.4", - "@babel/helper-split-export-declaration": "^7.7.4", - "@babel/parser": "^7.7.4", - "@babel/types": "^7.7.4", - "debug": "^4.1.0", - "globals": "^11.1.0", - "lodash": "^4.17.13" - } - }, - "@babel/types": { - "version": "7.7.4", - "bundled": true, - "dev": true, - "requires": { - "esutils": "^2.0.2", - "lodash": "^4.17.13", - "to-fast-properties": "^2.0.0" - } - }, - "convert-source-map": { - "version": "1.7.0", - "bundled": true, - "dev": true, - "requires": { - "safe-buffer": "~5.1.1" - } - }, - "debug": { - "version": "4.1.1", - "bundled": true, - "dev": true, - "requires": { - "ms": "^2.1.1" - } - }, - "ms": { - "version": "2.1.2", - "bundled": true, - "dev": true - }, - "safe-buffer": { - "version": "5.1.2", - "bundled": true, - "dev": true - }, - "source-map": { - "version": "0.5.7", - "bundled": true, - "dev": true - } - } - }, - "@babel/generator": { - "version": "7.7.2", - "bundled": true, - "requires": { - "@babel/types": "^7.7.2", - "jsesc": "^2.5.1", - "lodash": "^4.17.13", - "source-map": "^0.5.0" - }, - "dependencies": { - "source-map": { - "version": "0.5.7", - "bundled": true - } - } - }, - "@babel/helper-builder-react-jsx": { - "version": "7.7.4", - "bundled": true, - "dev": true, - "requires": { - "@babel/types": "^7.7.4", - "esutils": "^2.0.0" - }, - "dependencies": { - "@babel/types": { - "version": "7.7.4", - "bundled": true, - "dev": true, - "requires": { - "esutils": "^2.0.2", - "lodash": "^4.17.13", - "to-fast-properties": "^2.0.0" - } - } - } - }, - "@babel/helper-plugin-utils": { - "version": "7.0.0", - "bundled": true, - "dev": true - }, - "@babel/helpers": { - "version": "7.7.4", - "bundled": true, - "dev": true, - "requires": { - "@babel/template": "^7.7.4", - "@babel/traverse": "^7.7.4", - "@babel/types": "^7.7.4" - }, - "dependencies": { - "@babel/generator": { - "version": "7.7.4", - "bundled": true, - "dev": true, - "requires": { - "@babel/types": "^7.7.4", - "jsesc": "^2.5.1", - "lodash": "^4.17.13", - "source-map": "^0.5.0" - } - }, - "@babel/helper-function-name": { - "version": "7.7.4", - "bundled": true, - "dev": true, - "requires": { - "@babel/helper-get-function-arity": "^7.7.4", - "@babel/template": "^7.7.4", - "@babel/types": "^7.7.4" - } - }, - "@babel/helper-get-function-arity": { - "version": "7.7.4", - "bundled": true, - "dev": true, - "requires": { - "@babel/types": "^7.7.4" - } - }, - "@babel/helper-split-export-declaration": { - "version": "7.7.4", - "bundled": true, - "dev": true, - "requires": { - "@babel/types": "^7.7.4" - } - }, - "@babel/parser": { - "version": "7.7.4", - "bundled": true, - "dev": true - }, - "@babel/template": { - "version": "7.7.4", - "bundled": true, - "dev": true, - "requires": { - "@babel/code-frame": "^7.0.0", - "@babel/parser": "^7.7.4", - "@babel/types": "^7.7.4" - } - }, - "@babel/traverse": { - "version": "7.7.4", - "bundled": true, - "dev": true, - "requires": { - "@babel/code-frame": "^7.5.5", - "@babel/generator": "^7.7.4", - "@babel/helper-function-name": "^7.7.4", - "@babel/helper-split-export-declaration": "^7.7.4", - "@babel/parser": "^7.7.4", - "@babel/types": "^7.7.4", - "debug": "^4.1.0", - "globals": "^11.1.0", - "lodash": "^4.17.13" - } - }, - "@babel/types": { - "version": "7.7.4", - "bundled": true, - "dev": true, - "requires": { - "esutils": "^2.0.2", - "lodash": "^4.17.13", - "to-fast-properties": "^2.0.0" - } - }, - "debug": { - "version": "4.1.1", - "bundled": true, - "dev": true, - "requires": { - "ms": "^2.1.1" - } - }, - "ms": { - "version": "2.1.2", - "bundled": true, - "dev": true - }, - "source-map": { - "version": "0.5.7", - "bundled": true, - "dev": true - } - } - }, - "@babel/highlight": { - "version": "7.5.0", - "bundled": true, - "requires": { - "chalk": "^2.0.0", - "esutils": "^2.0.2", - "js-tokens": "^4.0.0" - }, - "dependencies": { - "js-tokens": { - "version": "4.0.0", - "bundled": true - } - } - }, - "@babel/parser": { - "version": "7.7.3", - "bundled": true - }, - "@babel/plugin-proposal-object-rest-spread": { - "version": "7.7.4", - "bundled": true, - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.0.0", - "@babel/plugin-syntax-object-rest-spread": "^7.7.4" - } - }, - "@babel/plugin-syntax-jsx": { - "version": "7.7.4", - "bundled": true, - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.0.0" - } - }, - "@babel/plugin-syntax-object-rest-spread": { - "version": "7.7.4", - "bundled": true, - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.0.0" - } - }, - "@babel/plugin-transform-destructuring": { - "version": "7.7.4", - "bundled": true, - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.0.0" - } - }, - "@babel/plugin-transform-react-jsx": { - "version": "7.7.4", - "bundled": true, - "dev": true, - "requires": { - "@babel/helper-builder-react-jsx": "^7.7.4", - "@babel/helper-plugin-utils": "^7.0.0", - "@babel/plugin-syntax-jsx": "^7.7.4" - } - }, - "@babel/runtime": { - "version": "7.7.4", - "bundled": true, - "dev": true, - "requires": { - "regenerator-runtime": "^0.13.2" - } - }, - "@babel/template": { - "version": "7.7.0", - "bundled": true, - "requires": { - "@babel/code-frame": "^7.0.0", - "@babel/parser": "^7.7.0", - "@babel/types": "^7.7.0" - } - }, - "@babel/types": { - "version": "7.7.2", - "bundled": true, - "requires": { - "esutils": "^2.0.2", - "lodash": "^4.17.13", - "to-fast-properties": "^2.0.0" - } - }, - "@types/color-name": { - "version": "1.1.1", - "bundled": true, - "dev": true - }, - "@types/prop-types": { - "version": "15.7.3", - "bundled": true, - "dev": true - }, - "@types/react": { - "version": "16.9.13", - "bundled": true, - "dev": true, - "requires": { - "@types/prop-types": "*", - "csstype": "^2.2.0" - } - }, - "ansi-escapes": { - "version": "4.3.0", - "bundled": true, - "dev": true, - "requires": { - "type-fest": "^0.8.1" - } - }, - "ansi-regex": { - "version": "2.1.1", - "bundled": true - }, - "ansi-styles": { - "version": "3.2.1", - "bundled": true, - "requires": { - "color-convert": "^1.9.0" - } - }, - "ansicolors": { - "version": "0.3.2", - "bundled": true, - "dev": true - }, - "arrify": { - "version": "1.0.1", - "bundled": true, - "dev": true - }, - "astral-regex": { - "version": "1.0.0", - "bundled": true, - "dev": true - }, - "auto-bind": { - "version": "2.1.1", - "bundled": true, - "dev": true, - "requires": { - "@types/react": "^16.8.12" - } - }, - "caller-callsite": { - "version": "2.0.0", - "bundled": true, - "dev": true, - "requires": { - "callsites": "^2.0.0" - } - }, - "caller-path": { - "version": "2.0.0", - "bundled": true, - "dev": true, - "requires": { - "caller-callsite": "^2.0.0" - } - }, - "callsites": { - "version": "2.0.0", - "bundled": true, - "dev": true - }, - "cardinal": { - "version": "2.1.1", - "bundled": true, - "dev": true, - "requires": { - "ansicolors": "~0.3.2", - "redeyed": "~2.1.0" - } - }, - "chalk": { - "version": "2.4.2", - "bundled": true, - "requires": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - } - }, - "ci-info": { - "version": "2.0.0", - "bundled": true, - "dev": true - }, - "cli-cursor": { - "version": "2.1.0", - "bundled": true, - "dev": true, - "requires": { - "restore-cursor": "^2.0.0" - } - }, - "cli-truncate": { - "version": "1.1.0", - "bundled": true, - "dev": true, - "requires": { - "slice-ansi": "^1.0.0", - "string-width": "^2.0.0" - } - }, - "color-convert": { - "version": "1.9.3", - "bundled": true, - "requires": { - "color-name": "1.1.3" - } - }, - "color-name": { - "version": "1.1.3", - "bundled": true - }, - "csstype": { - "version": "2.6.7", - "bundled": true, - "dev": true - }, - "debug": { - "version": "2.6.9", - "bundled": true, - "requires": { - "ms": "2.0.0" - } - }, - "emoji-regex": { - "version": "7.0.3", - "bundled": true, - "dev": true - }, - "escape-string-regexp": { - "version": "1.0.5", - "bundled": true - }, - "esprima": { - "version": "4.0.1", - "bundled": true, - "dev": true - }, - "esutils": { - "version": "2.0.3", - "bundled": true - }, - "events-to-array": { - "version": "1.1.2", - "bundled": true, - "dev": true - }, - "globals": { - "version": "11.12.0", - "bundled": true, - "dev": true - }, - "has-flag": { - "version": "3.0.0", - "bundled": true - }, - "import-jsx": { - "version": "3.0.0", - "bundled": true, - "dev": true, - "requires": { - "@babel/core": "^7.5.5", - "@babel/plugin-proposal-object-rest-spread": "^7.5.5", - "@babel/plugin-transform-destructuring": "^7.5.0", - "@babel/plugin-transform-react-jsx": "^7.3.0", - "caller-path": "^2.0.0", - "resolve-from": "^3.0.0" - } - }, - "ink": { - "version": "2.5.0", - "bundled": true, - "dev": true, - "requires": { - "@types/react": "^16.8.6", - "ansi-escapes": "^4.2.1", - "arrify": "^1.0.1", - "auto-bind": "^2.0.0", - "chalk": "^2.4.1", - "cli-cursor": "^2.1.0", - "cli-truncate": "^1.1.0", - "is-ci": "^2.0.0", - "lodash.throttle": "^4.1.1", - "log-update": "^3.0.0", - "prop-types": "^15.6.2", - "react-reconciler": "^0.21.0", - "scheduler": "^0.15.0", - "signal-exit": "^3.0.2", - "slice-ansi": "^1.0.0", - "string-length": "^2.0.0", - "widest-line": "^2.0.0", - "wrap-ansi": "^5.0.0", - "yoga-layout-prebuilt": "^1.9.3" - } - }, - "is-ci": { - "version": "2.0.0", - "bundled": true, - "dev": true, - "requires": { - "ci-info": "^2.0.0" - } - }, - "is-fullwidth-code-point": { - "version": "2.0.0", - "bundled": true, - "dev": true - }, - "js-tokens": { - "version": "3.0.2", - "bundled": true, - "dev": true - }, - "jsesc": { - "version": "2.5.2", - "bundled": true - }, - "json5": { - "version": "2.1.1", - "bundled": true, - "dev": true, - "requires": { - "minimist": "^1.2.0" - } - }, - "lodash": { - "version": "4.17.15", - "bundled": true - }, - "lodash.throttle": { - "version": "4.1.1", - "bundled": true, - "dev": true - }, - "log-update": { - "version": "3.3.0", - "bundled": true, - "dev": true, - "requires": { - "ansi-escapes": "^3.2.0", - "cli-cursor": "^2.1.0", - "wrap-ansi": "^5.0.0" - }, - "dependencies": { - "ansi-escapes": { - "version": "3.2.0", - "bundled": true, - "dev": true - } - } - }, - "loose-envify": { - "version": "1.4.0", - "bundled": true, - "dev": true, - "requires": { - "js-tokens": "^3.0.0 || ^4.0.0" - } - }, - "mimic-fn": { - "version": "1.2.0", - "bundled": true, - "dev": true - }, - "minimist": { - "version": "1.2.0", - "bundled": true, - "dev": true - }, - "minipass": { - "version": "3.1.1", - "bundled": true, - "dev": true, - "requires": { - "yallist": "^4.0.0" - }, - "dependencies": { - "yallist": { - "version": "4.0.0", - "bundled": true, - "dev": true - } - } - }, - "ms": { - "version": "2.0.0", - "bundled": true - }, - "object-assign": { - "version": "4.1.1", - "bundled": true, - "dev": true - }, - "onetime": { - "version": "2.0.1", - "bundled": true, - "dev": true, - "requires": { - "mimic-fn": "^1.0.0" - } - }, - "path-parse": { - "version": "1.0.6", - "bundled": true, - "dev": true - }, - "prop-types": { - "version": "15.7.2", - "bundled": true, - "dev": true, - "requires": { - "loose-envify": "^1.4.0", - "object-assign": "^4.1.1", - "react-is": "^16.8.1" - } - }, - "punycode": { - "version": "2.1.1", - "bundled": true, - "dev": true - }, - "react-is": { - "version": "16.10.2", - "bundled": true, - "dev": true - }, - "react-reconciler": { - "version": "0.21.0", - "bundled": true, - "dev": true, - "requires": { - "loose-envify": "^1.1.0", - "object-assign": "^4.1.1", - "prop-types": "^15.6.2", - "scheduler": "^0.15.0" - } - }, - "redeyed": { - "version": "2.1.1", - "bundled": true, - "dev": true, - "requires": { - "esprima": "~4.0.0" - } - }, - "regenerator-runtime": { - "version": "0.13.3", - "bundled": true, - "dev": true - }, - "resolve": { - "version": "1.12.0", - "bundled": true, - "dev": true, - "requires": { - "path-parse": "^1.0.6" - } - }, - "resolve-from": { - "version": "3.0.0", - "bundled": true, - "dev": true - }, - "restore-cursor": { - "version": "2.0.0", - "bundled": true, - "dev": true, - "requires": { - "onetime": "^2.0.0", - "signal-exit": "^3.0.2" - } - }, - "scheduler": { - "version": "0.15.0", - "bundled": true, - "dev": true, - "requires": { - "loose-envify": "^1.1.0", - "object-assign": "^4.1.1" - } - }, - "semver": { - "version": "5.7.1", - "bundled": true, - "dev": true - }, - "signal-exit": { - "version": "3.0.2", - "bundled": true, - "dev": true - }, - "slice-ansi": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "requires": { - "is-fullwidth-code-point": "^2.0.0" - } - }, - "source-map": { - "version": "0.6.1", - "bundled": true - }, - "string-length": { - "version": "2.0.0", - "bundled": true, - "dev": true, - "requires": { - "astral-regex": "^1.0.0", - "strip-ansi": "^4.0.0" - }, - "dependencies": { - "ansi-regex": { - "version": "3.0.0", - "bundled": true, - "dev": true - }, - "strip-ansi": { - "version": "4.0.0", - "bundled": true, - "dev": true, - "requires": { - "ansi-regex": "^3.0.0" - } - } - } - }, - "string-width": { - "version": "2.1.1", - "bundled": true, - "dev": true, - "requires": { - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^4.0.0" - }, - "dependencies": { - "ansi-regex": { - "version": "3.0.0", - "bundled": true, - "dev": true - }, - "strip-ansi": { - "version": "4.0.0", - "bundled": true, - "dev": true, - "requires": { - "ansi-regex": "^3.0.0" - } - } - } - }, - "strip-ansi": { - "version": "3.0.1", - "bundled": true, - "requires": { - "ansi-regex": "^2.0.0" - } - }, - "supports-color": { - "version": "5.5.0", - "bundled": true, - "requires": { - "has-flag": "^3.0.0" - } - }, - "tap-parser": { - "version": "10.0.1", - "bundled": true, - "dev": true, - "requires": { - "events-to-array": "^1.0.1", - "minipass": "^3.0.0", - "tap-yaml": "^1.0.0" - } - }, - "tap-yaml": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "requires": { - "yaml": "^1.5.0" - } - }, - "to-fast-properties": { - "version": "2.0.0", - "bundled": true - }, - "treport": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "requires": { - "cardinal": "^2.1.1", - "chalk": "^3.0.0", - "import-jsx": "^3.0.0", - "ink": "^2.5.0", - "ms": "^2.1.2", - "string-length": "^3.1.0", - "tap-parser": "^10.0.1", - "unicode-length": "^2.0.2" - }, - "dependencies": { - "ansi-regex": { - "version": "4.1.0", - "bundled": true, - "dev": true - }, - "ansi-styles": { - "version": "4.2.0", - "bundled": true, - "dev": true, - "requires": { - "@types/color-name": "^1.1.1", - "color-convert": "^2.0.1" - } - }, - "chalk": { - "version": "3.0.0", - "bundled": true, - "dev": true, - "requires": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - } - }, - "color-convert": { - "version": "2.0.1", - "bundled": true, - "dev": true, - "requires": { - "color-name": "~1.1.4" - } - }, - "color-name": { - "version": "1.1.4", - "bundled": true, - "dev": true - }, - "has-flag": { - "version": "4.0.0", - "bundled": true, - "dev": true - }, - "ms": { - "version": "2.1.2", - "bundled": true, - "dev": true - }, - "string-length": { - "version": "3.1.0", - "bundled": true, - "dev": true, - "requires": { - "astral-regex": "^1.0.0", - "strip-ansi": "^5.2.0" - } - }, - "strip-ansi": { - "version": "5.2.0", - "bundled": true, - "dev": true, - "requires": { - "ansi-regex": "^4.1.0" - } - }, - "supports-color": { - "version": "7.1.0", - "bundled": true, - "dev": true, - "requires": { - "has-flag": "^4.0.0" - } - }, - "unicode-length": { - "version": "2.0.2", - "bundled": true, - "dev": true, - "requires": { - "punycode": "^2.0.0", - "strip-ansi": "^3.0.1" - }, - "dependencies": { - "ansi-regex": { - "version": "2.1.1", - "bundled": true, - "dev": true - }, - "strip-ansi": { - "version": "3.0.1", - "bundled": true, - "dev": true, - "requires": { - "ansi-regex": "^2.0.0" - } - } - } - } - } - }, - "type-fest": { - "version": "0.8.1", - "bundled": true, - "dev": true - }, - "widest-line": { - "version": "2.0.1", - "bundled": true, - "dev": true, - "requires": { - "string-width": "^2.1.1" - } - }, - "wrap-ansi": { - "version": "5.1.0", - "bundled": true, - "dev": true, - "requires": { - "ansi-styles": "^3.2.0", - "string-width": "^3.0.0", - "strip-ansi": "^5.0.0" - }, - "dependencies": { - "ansi-regex": { - "version": "4.1.0", - "bundled": true, - "dev": true - }, - "string-width": { - "version": "3.1.0", - "bundled": true, - "dev": true, - "requires": { - "emoji-regex": "^7.0.1", - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^5.1.0" - } - }, - "strip-ansi": { - "version": "5.2.0", - "bundled": true, - "dev": true, - "requires": { - "ansi-regex": "^4.1.0" - } - } - } - }, - "yaml": { - "version": "1.7.2", - "bundled": true, - "dev": true, - "requires": { - "@babel/runtime": "^7.6.3" - } - }, - "yoga-layout-prebuilt": { - "version": "1.9.3", - "bundled": true, - "dev": true - } - } - }, - "tap-mocha-reporter": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/tap-mocha-reporter/-/tap-mocha-reporter-5.0.0.tgz", - "integrity": "sha512-8HlAtdmYGlDZuW83QbF/dc46L7cN+AGhLZcanX3I9ILvxUAl+G2/mtucNPSXecTlG/4iP1hv6oMo0tMhkn3Tsw==", - "dev": true, - "requires": { - "color-support": "^1.1.0", - "debug": "^2.1.3", - "diff": "^1.3.2", - "escape-string-regexp": "^1.0.3", - "glob": "^7.0.5", - "readable-stream": "^2.1.5", - "tap-parser": "^10.0.0", - "tap-yaml": "^1.0.0", - "unicode-length": "^1.0.0" - }, - "dependencies": { - "debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "dev": true, - "requires": { - "ms": "2.0.0" - } - }, - "diff": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/diff/-/diff-1.4.0.tgz", - "integrity": "sha1-fyjS657nsVqX79ic5j3P2qPMur8=", - "dev": true - }, - "ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", - "dev": true - } - } - }, - "tap-parser": { - "version": "10.0.1", - "resolved": "https://registry.npmjs.org/tap-parser/-/tap-parser-10.0.1.tgz", - "integrity": "sha512-qdT15H0DoJIi7zOqVXDn9X0gSM68JjNy1w3VemwTJlDnETjbi6SutnqmBfjDJAwkFS79NJ97gZKqie00ZCGmzg==", - "dev": true, - "requires": { - "events-to-array": "^1.0.1", - "minipass": "^3.0.0", - "tap-yaml": "^1.0.0" - } - }, - "tap-yaml": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/tap-yaml/-/tap-yaml-1.0.0.tgz", - "integrity": "sha512-Rxbx4EnrWkYk0/ztcm5u3/VznbyFJpyXO12dDBHKWiDVxy7O2Qw6MRrwO5H6Ww0U5YhRY/4C/VzWmFPhBQc4qQ==", - "dev": true, - "requires": { - "yaml": "^1.5.0" - } - }, - "tcompare": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/tcompare/-/tcompare-3.0.4.tgz", - "integrity": "sha512-Q3TitMVK59NyKgQyFh+857wTAUE329IzLDehuPgU4nF5e8g+EUQ+yUbjUy1/6ugiNnXztphT+NnqlCXolv9P3A==", - "dev": true, - "requires": { - "diff-frag": "^1.0.1" - } - }, - "test-exclude": { - "version": "5.2.3", - "resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-5.2.3.tgz", - "integrity": "sha512-M+oxtseCFO3EDtAaGH7iiej3CBkzXqFMbzqYAACdzKui4eZA+pq3tZEwChvOdNfa7xxy8BfbmgJSIr43cC/+2g==", - "dev": true, - "requires": { - "glob": "^7.1.3", - "minimatch": "^3.0.4", - "read-pkg-up": "^4.0.0", - "require-main-filename": "^2.0.0" - } - }, - "to-fast-properties": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", - "integrity": "sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4=", - "dev": true - }, - "to-regex-range": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", - "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", - "dev": true, - "requires": { - "is-number": "^7.0.0" - } - }, - "tough-cookie": { - "version": "2.4.3", - "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.4.3.tgz", - "integrity": "sha512-Q5srk/4vDM54WJsJio3XNn6K2sCG+CQ8G5Wz6bZhRZoAe/+TxjWB/GlFAnYEbkYVlON9FMk/fE3h2RLpPXo4lQ==", - "dev": true, - "requires": { - "psl": "^1.1.24", - "punycode": "^1.4.1" - }, - "dependencies": { - "punycode": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", - "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=", - "dev": true - } - } - }, - "trivial-deferred": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/trivial-deferred/-/trivial-deferred-1.0.1.tgz", - "integrity": "sha1-N21NKdlR1jaKb3oK6FwvTV4GWPM=", - "dev": true - }, - "ts-node": { - "version": "8.5.4", - "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-8.5.4.tgz", - "integrity": "sha512-izbVCRV68EasEPQ8MSIGBNK9dc/4sYJJKYA+IarMQct1RtEot6Xp0bXuClsbUSnKpg50ho+aOAx8en5c+y4OFw==", - "dev": true, - "requires": { - "arg": "^4.1.0", - "diff": "^4.0.1", - "make-error": "^1.1.1", - "source-map-support": "^0.5.6", - "yn": "^3.0.0" - } - }, - "tunnel-agent": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", - "integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=", - "dev": true, - "requires": { - "safe-buffer": "^5.0.1" - } - }, - "tweetnacl": { - "version": "0.14.5", - "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", - "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=", - "dev": true - }, - "typedarray-to-buffer": { - "version": "3.1.5", - "resolved": "https://registry.npmjs.org/typedarray-to-buffer/-/typedarray-to-buffer-3.1.5.tgz", - "integrity": "sha512-zdu8XMNEDepKKR+XYOXAVPtWui0ly0NtohUscw+UmaHiAWT8hrV1rr//H6V+0DvJ3OQ19S979M0laLfX8rm82Q==", - "dev": true, - "requires": { - "is-typedarray": "^1.0.0" - } - }, - "typescript": { - "version": "3.7.3", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.7.3.tgz", - "integrity": "sha512-Mcr/Qk7hXqFBXMN7p7Lusj1ktCBydylfQM/FZCk5glCNQJrCUKPkMHdo9R0MTFWsC/4kPFvDS0fDPvukfCkFsw==", - "dev": true - }, - "uglify-js": { - "version": "3.7.2", - "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.7.2.tgz", - "integrity": "sha512-uhRwZcANNWVLrxLfNFEdltoPNhECUR3lc+UdJoG9CBpMcSnKyWA94tc3eAujB1GcMY5Uwq8ZMp4qWpxWYDQmaA==", - "dev": true, - "optional": true, - "requires": { - "commander": "~2.20.3", - "source-map": "~0.6.1" - } - }, - "unicode-length": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/unicode-length/-/unicode-length-1.0.3.tgz", - "integrity": "sha1-Wtp6f+1RhBpBijKM8UlHisg1irs=", - "dev": true, - "requires": { - "punycode": "^1.3.2", - "strip-ansi": "^3.0.1" - }, - "dependencies": { - "ansi-regex": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", - "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", - "dev": true - }, - "punycode": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", - "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=", - "dev": true - }, - "strip-ansi": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", - "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", - "dev": true, - "requires": { - "ansi-regex": "^2.0.0" - } - } - } - }, - "uri-js": { - "version": "4.2.2", - "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.2.2.tgz", - "integrity": "sha512-KY9Frmirql91X2Qgjry0Wd4Y+YTdrdZheS8TFwvkbLWf/G5KNJDCh6pKL5OZctEW4+0Baa5idK2ZQuELRwPznQ==", - "dev": true, - "requires": { - "punycode": "^2.1.0" - } - }, - "util-deprecate": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", - "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", - "dev": true, - "optional": true - }, - "uuid": { - "version": "3.3.3", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.3.tgz", - "integrity": "sha512-pW0No1RGHgzlpHJO1nsVrHKpOEIxkGg1xB+v0ZmdNH5OAeAwzAVrCnI2/6Mtx+Uys6iaylxa+D3g4j63IKKjSQ==", - "dev": true - }, - "validate-npm-package-license": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", - "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==", - "dev": true, - "requires": { - "spdx-correct": "^3.0.0", - "spdx-expression-parse": "^3.0.0" - } - }, - "verror": { - "version": "1.10.0", - "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", - "integrity": "sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=", - "dev": true, - "requires": { - "assert-plus": "^1.0.0", - "core-util-is": "1.0.2", - "extsprintf": "^1.2.0" - } - }, - "vlq": { - "version": "0.2.3", - "resolved": "https://registry.npmjs.org/vlq/-/vlq-0.2.3.tgz", - "integrity": "sha512-DRibZL6DsNhIgYQ+wNdWDL2SL3bKPlVrRiBqV5yuMm++op8W4kGFtaQfCs4KEJn0wBZcHVHJ3eoywX8983k1ow==", - "dev": true - }, - "which": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", - "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", - "dev": true, - "requires": { - "isexe": "^2.0.0" - } - }, - "which-module": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz", - "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=", - "dev": true - }, - "wordwrap": { - "version": "0.0.3", - "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.3.tgz", - "integrity": "sha1-o9XabNXAvAAI03I0u68b7WMFkQc=", - "dev": true - }, - "wrap-ansi": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.1.0.tgz", - "integrity": "sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU=", - "dev": true, - "requires": { - "string-width": "^1.0.1", - "strip-ansi": "^3.0.1" - }, - "dependencies": { - "ansi-regex": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", - "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", - "dev": true - }, - "is-fullwidth-code-point": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", - "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", - "dev": true, - "requires": { - "number-is-nan": "^1.0.0" - } - }, - "string-width": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", - "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", - "dev": true, - "requires": { - "code-point-at": "^1.0.0", - "is-fullwidth-code-point": "^1.0.0", - "strip-ansi": "^3.0.0" - } - }, - "strip-ansi": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", - "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", - "dev": true, - "requires": { - "ansi-regex": "^2.0.0" - } - } - } - }, - "wrappy": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", - "dev": true - }, - "write-file-atomic": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-3.0.1.tgz", - "integrity": "sha512-JPStrIyyVJ6oCSz/691fAjFtefZ6q+fP6tm+OS4Qw6o+TGQxNp1ziY2PgS+X/m0V8OWhZiO/m4xSj+Pr4RrZvw==", - "dev": true, - "requires": { - "imurmurhash": "^0.1.4", - "is-typedarray": "^1.0.0", - "signal-exit": "^3.0.2", - "typedarray-to-buffer": "^3.1.5" - } - }, - "y18n": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.0.tgz", - "integrity": "sha512-r9S/ZyXu/Xu9q1tYlpsLIsa3EeLXXk0VwlxqTcFRfg9EhMW+17kbt9G0NrgCmhGb5vT2hyhJZLfDGx+7+5Uj/w==", - "dev": true - }, - "yallist": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz", - "integrity": "sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI=", - "dev": true - }, - "yaml": { - "version": "1.7.2", - "resolved": "https://registry.npmjs.org/yaml/-/yaml-1.7.2.tgz", - "integrity": "sha512-qXROVp90sb83XtAoqE8bP9RwAkTTZbugRUTm5YeFCBfNRPEp2YzTeqWiz7m5OORHzEvrA/qcGS8hp/E+MMROYw==", - "dev": true, - "requires": { - "@babel/runtime": "^7.6.3" - } - }, - "yapool": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/yapool/-/yapool-1.0.0.tgz", - "integrity": "sha1-9pPymjFbUNmp2iZGp6ZkXJaYW2o=", - "dev": true - }, - "yargs": { - "version": "13.3.0", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-13.3.0.tgz", - "integrity": "sha512-2eehun/8ALW8TLoIl7MVaRUrg+yCnenu8B4kBlRxj3GJGDKU1Og7sMXPNm1BYyM1DOJmTZ4YeN/Nwxv+8XJsUA==", - "dev": true, - "requires": { - "cliui": "^5.0.0", - "find-up": "^3.0.0", - "get-caller-file": "^2.0.1", - "require-directory": "^2.1.1", - "require-main-filename": "^2.0.0", - "set-blocking": "^2.0.0", - "string-width": "^3.0.0", - "which-module": "^2.0.0", - "y18n": "^4.0.0", - "yargs-parser": "^13.1.1" - }, - "dependencies": { - "ansi-regex": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", - "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", - "dev": true - }, - "cliui": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-5.0.0.tgz", - "integrity": "sha512-PYeGSEmmHM6zvoef2w8TPzlrnNpXIjTipYK780YswmIP9vjxmd6Y2a3CB2Ks6/AU8NHjZugXvo8w3oWM2qnwXA==", - "dev": true, - "requires": { - "string-width": "^3.1.0", - "strip-ansi": "^5.2.0", - "wrap-ansi": "^5.1.0" - } - }, - "string-width": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", - "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", - "dev": true, - "requires": { - "emoji-regex": "^7.0.1", - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^5.1.0" - } - }, - "strip-ansi": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", - "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", - "dev": true, - "requires": { - "ansi-regex": "^4.1.0" - } - }, - "wrap-ansi": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-5.1.0.tgz", - "integrity": "sha512-QC1/iN/2/RPVJ5jYK8BGttj5z83LmSKmvbvrXPNCLZSEb32KKVDJDl/MOt2N01qU2H/FkzEa9PKto1BqDjtd7Q==", - "dev": true, - "requires": { - "ansi-styles": "^3.2.0", - "string-width": "^3.0.0", - "strip-ansi": "^5.0.0" - } - } - } - }, - "yargs-parser": { - "version": "13.1.1", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-13.1.1.tgz", - "integrity": "sha512-oVAVsHz6uFrg3XQheFII8ESO2ssAf9luWuAd6Wexsu4F3OtIW0o8IribPXYrD4WC24LWtPrJlGy87y5udK+dxQ==", - "dev": true, - "requires": { - "camelcase": "^5.0.0", - "decamelize": "^1.2.0" - } - }, - "yn": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz", - "integrity": "sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==", - "dev": true - } - } -} diff --git a/deps/npm/node_modules/npm-normalize-package-bin/package.json b/deps/npm/node_modules/npm-normalize-package-bin/package.json index c0e548cc537bd0..a331a682e74e02 100644 --- a/deps/npm/node_modules/npm-normalize-package-bin/package.json +++ b/deps/npm/node_modules/npm-normalize-package-bin/package.json @@ -1,57 +1,21 @@ { - "_from": "npm-normalize-package-bin@^1.0.0", - "_id": "npm-normalize-package-bin@1.0.1", - "_inBundle": false, - "_integrity": "sha512-EPfafl6JL5/rU+ot6P3gRSCpPDW5VmIzX959Ob1+ySFUuuYHWHekXpwdUZcKP5C+DS4GEtdJluwBjnsNDl+fSA==", - "_location": "/npm-normalize-package-bin", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "npm-normalize-package-bin@^1.0.0", - "name": "npm-normalize-package-bin", - "escapedName": "npm-normalize-package-bin", - "rawSpec": "^1.0.0", - "saveSpec": null, - "fetchSpec": "^1.0.0" - }, - "_requiredBy": [ - "/bin-links" - ], - "_resolved": "https://registry.npmjs.org/npm-normalize-package-bin/-/npm-normalize-package-bin-1.0.1.tgz", - "_shasum": "6e79a41f23fd235c0623218228da7d9c23b8f6e2", - "_spec": "npm-normalize-package-bin@^1.0.0", - "_where": "/Users/isaacs/dev/npm/cli/node_modules/bin-links", - "author": { - "name": "Isaac Z. Schlueter", - "email": "i@izs.me", - "url": "https://izs.me" - }, - "bugs": { - "url": "https://github.com/npm/npm-normalize-package-bin/issues" - }, - "bundleDependencies": false, - "deprecated": false, + "name": "npm-normalize-package-bin", + "version": "1.0.1", "description": "Turn any flavor of allowable package.json bin into a normalized object", - "devDependencies": { - "tap": "^14.10.2" - }, - "homepage": "https://github.com/npm/npm-normalize-package-bin#readme", + "repository": "git+https://github.com/npm/npm-normalize-package-bin", + "author": "Isaac Z. Schlueter (https://izs.me)", "license": "ISC", - "name": "npm-normalize-package-bin", - "repository": { - "type": "git", - "url": "git+https://github.com/npm/npm-normalize-package-bin.git" - }, "scripts": { - "postpublish": "git push origin --follow-tags", - "postversion": "npm publish", - "preversion": "npm test", + "test": "tap", "snap": "tap", - "test": "tap" + "preversion": "npm test", + "postversion": "npm publish", + "postpublish": "git push origin --follow-tags" }, "tap": { "check-coverage": true }, - "version": "1.0.1" + "devDependencies": { + "tap": "^14.10.2" + } } diff --git a/deps/npm/node_modules/npm-package-arg/CHANGELOG.md b/deps/npm/node_modules/npm-package-arg/CHANGELOG.md index 1b3431acced775..390a3a3c4f2de0 100644 --- a/deps/npm/node_modules/npm-package-arg/CHANGELOG.md +++ b/deps/npm/node_modules/npm-package-arg/CHANGELOG.md @@ -1,7 +1,33 @@ -# Change Log +# 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. +## [8.0.0](https://github.com/npm/npm-package-arg/compare/v7.0.0...v8.0.0) (2019-12-15) + + +### ⚠ BREAKING CHANGES + +* Dropping support for node 6 and 8. It'll probably +still work on those versions, but they are no longer supported or +tested, since npm v7 is moving away from them. + +* drop support for node 6 and 8 ([ba85e68](https://github.com/npm/npm-package-arg/commit/ba85e68555d6270f672c3d59da17672f744d0376)) + + +# [7.0.0](https://github.com/npm/npm-package-arg/compare/v6.1.1...v7.0.0) (2019-11-11) + + +### deps + +* bump hosted-git-info to 3.0.2 ([68a4fc3](https://github.com/npm/npm-package-arg/commit/68a4fc3)), closes [/github.com/npm/hosted-git-info/pull/38#issuecomment-520243803](https://github.com//github.com/npm/hosted-git-info/pull/38/issues/issuecomment-520243803) + + +### BREAKING CHANGES + +* this drops support for ancient node versions. + + + ## [6.1.1](https://github.com/npm/npm-package-arg/compare/v6.1.0...v6.1.1) (2019-08-21) diff --git a/deps/npm/node_modules/npm-package-arg/LICENSE b/deps/npm/node_modules/npm-package-arg/LICENSE index 05eeeb88c2ef4c..19cec97b184683 100644 --- a/deps/npm/node_modules/npm-package-arg/LICENSE +++ b/deps/npm/node_modules/npm-package-arg/LICENSE @@ -1,6 +1,6 @@ The ISC License -Copyright (c) Isaac Z. Schlueter +Copyright (c) npm, Inc. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above diff --git a/deps/npm/node_modules/npm-package-arg/npa.js b/deps/npm/node_modules/npm-package-arg/npa.js index bf2c17cfd513fb..d18168b754b3ee 100644 --- a/deps/npm/node_modules/npm-package-arg/npa.js +++ b/deps/npm/node_modules/npm-package-arg/npa.js @@ -12,7 +12,7 @@ function path () { return path_ } let validatePackageName -let osenv +let os const isWindows = process.platform === 'win32' || global.FAKE_WINDOWS const hasSlashes = isWindows ? /\\|[/]/ : /[/]/ @@ -70,7 +70,7 @@ function resolve (name, spec, where, arg) { return fromAlias(res, where) } if (!HostedGit) HostedGit = require('hosted-git-info') - const hosted = HostedGit.fromUrl(spec, {noGitPlus: true, noCommittish: true}) + const hosted = HostedGit.fromUrl(spec, { noGitPlus: true, noCommittish: true }) if (hosted) { return fromHostedGit(res, hosted) } else if (spec && isURL.test(spec)) { @@ -174,8 +174,8 @@ function fromFile (res, where) { .replace(/^file:(?:[/]*([~./]))?/, '$1') if (/^~[/]/.test(spec)) { // this is needed for windows and for file:~/foo/bar - if (!osenv) osenv = require('osenv') - res.fetchSpec = resolvePath(osenv.home(), spec.slice(2)) + if (!os) os = require('os') + res.fetchSpec = resolvePath(os.homedir(), spec.slice(2)) res.saveSpec = 'file:' + spec } else { res.fetchSpec = resolvePath(where, spec) @@ -191,7 +191,7 @@ function fromFile (res, where) { function fromHostedGit (res, hosted) { res.type = 'git' res.hosted = hosted - res.saveSpec = hosted.toString({noGitPlus: false, noCommittish: false}) + res.saveSpec = hosted.toString({ noGitPlus: false, noCommittish: false }) res.fetchSpec = hosted.getDefaultRepresentation() === 'shortcut' ? null : hosted.toString() return setGitCommittish(res, hosted.committish) } diff --git a/deps/npm/node_modules/npm-package-arg/package.json b/deps/npm/node_modules/npm-package-arg/package.json index 7d978a4d48a5c0..a1a09c18bf6e93 100644 --- a/deps/npm/node_modules/npm-package-arg/package.json +++ b/deps/npm/node_modules/npm-package-arg/package.json @@ -1,84 +1,40 @@ { - "_from": "npm-package-arg@6.1.1", - "_id": "npm-package-arg@6.1.1", - "_inBundle": false, - "_integrity": "sha512-qBpssaL3IOZWi5vEKUKW0cO7kzLeT+EQO9W8RsLOZf76KF9E/K9+wH0C7t06HXPpaH8WH5xF1MExLuCwbTqRUg==", - "_location": "/npm-package-arg", - "_phantomChildren": {}, - "_requested": { - "type": "version", - "registry": true, - "raw": "npm-package-arg@6.1.1", - "name": "npm-package-arg", - "escapedName": "npm-package-arg", - "rawSpec": "6.1.1", - "saveSpec": null, - "fetchSpec": "6.1.1" + "name": "npm-package-arg", + "version": "8.0.1", + "description": "Parse the things that can be arguments to `npm install`", + "main": "npa.js", + "directories": { + "test": "test" }, - "_requiredBy": [ - "#USER", - "/", - "/init-package-json", - "/libcipm", - "/libnpm", - "/libnpmaccess", - "/libnpmpublish", - "/libnpx", - "/lock-verify", - "/npm-pick-manifest", - "/npm-registry-fetch", - "/pacote" + "files": [ + "npa.js" ], - "_resolved": "https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-6.1.1.tgz", - "_shasum": "02168cb0a49a2b75bf988a28698de7b529df5cb7", - "_spec": "npm-package-arg@6.1.1", - "_where": "/Users/isaacs/dev/npm/cli", - "author": { - "name": "Isaac Z. Schlueter", - "email": "i@izs.me", - "url": "http://blog.izs.me/" - }, - "bugs": { - "url": "https://github.com/npm/npm-package-arg/issues" - }, - "bundleDependencies": false, "dependencies": { - "hosted-git-info": "^2.7.1", - "osenv": "^0.1.5", - "semver": "^5.6.0", + "hosted-git-info": "^3.0.2", + "semver": "^7.0.0", "validate-npm-package-name": "^3.0.0" }, - "deprecated": false, - "description": "Parse the things that can be arguments to `npm install`", "devDependencies": { - "standard": "^11.0.1", - "standard-version": "^4.4.0", - "tap": "^12.5.0", - "weallbehave": "^1.2.0", - "weallcontribute": "^1.0.8" + "tap": "^14.10.2" }, - "directories": { - "test": "test" + "scripts": { + "preversion": "npm test", + "postversion": "npm publish", + "prepublishOnly": "git push origin --follow-tags", + "test": "tap", + "snap": "tap" }, - "files": [ - "npa.js" - ], - "homepage": "https://github.com/npm/npm-package-arg", - "license": "ISC", - "main": "npa.js", - "name": "npm-package-arg", "repository": { "type": "git", - "url": "git+https://github.com/npm/npm-package-arg.git" + "url": "https://github.com/npm/npm-package-arg" }, - "scripts": { - "postrelease": "npm publish && git push --follow-tags", - "prerelease": "npm t", - "pretest": "standard", - "release": "standard-version -s", - "test": "tap --100 -J --coverage test/*.js", - "update-coc": "weallbehave -o . && git add CODE_OF_CONDUCT.md && git commit -m 'docs(coc): updated CODE_OF_CONDUCT.md'", - "update-contrib": "weallcontribute -o . && git add CONTRIBUTING.md && git commit -m 'docs(contributing): updated CONTRIBUTING.md'" + "author": "Isaac Z. Schlueter (http://blog.izs.me/)", + "license": "ISC", + "bugs": { + "url": "https://github.com/npm/npm-package-arg/issues" }, - "version": "6.1.1" + "homepage": "https://github.com/npm/npm-package-arg", + "engines": { + "node": ">=10" + } } diff --git a/deps/npm/node_modules/npm-packlist/README.md b/deps/npm/node_modules/npm-packlist/README.md index ead5821e8e5451..9ec86afcd26cbc 100644 --- a/deps/npm/node_modules/npm-packlist/README.md +++ b/deps/npm/node_modules/npm-packlist/README.md @@ -2,7 +2,7 @@ [![Build Status](https://travis-ci.com/npm/npm-packlist.svg?token=hHeDp9pQmz9kvsgRNVHy&branch=master)](https://travis-ci.com/npm/npm-packlist) -Get a list of the files to add from a folder into an npm package +Get a list of the files to add from a folder into an npm package. These can be handed to [tar](http://npm.im/tar) like so to make an npm package tarball: @@ -57,6 +57,84 @@ This uses the following rules: You can explicitly re-include any of these with a `files` list in `package.json` or a negated ignore file rule. +Only the `package.json` file in the very root of the project is ever +inspected for a `files` list. Below the top level of the root package, +`package.json` is treated as just another file, and no package-specific +semantics are applied. + +### Interaction between `package.json` and `.npmignore` rules + +For simplicity, it is best to use _either_ a `files` list in `package.json` +_or_ a `.npmignore` file, and not both. If you only use one of these +methods, you can skip this documentation section. + +The `files` list in `package.json` is used to direct the exploration of the +tree. In other words, that's all the walker will ever look at when +exploring that level. + +In some cases this can lead to a `.npmignore` file being ignored. If a +_directory_ is listed in `files`, then any rules in a root or nested +`.npmignore` files will be honored. + +For example, with this package.json: + +```json +{ + "files": [ "dir" ] +} +``` + +a `.npmignore` file at `dir/.npmignore` (and any subsequent +sub-directories) will be honored. However, a `.npmignore` at the root +level will be skipped. + +Conversely, with this package.json: + +``` +{ + "files": ["dir/subdir"] +} +``` + +a `.npmignore` file at `dir/.npmignore` will not be honored. + +Any specific file matched by a glob or filename in the package.json `files` +list will be included, and cannot be excluded by any `.npmignore` files in +nested directories, or by a `.npmignore` file in the root package +directory, unless that root `.npmignore` file is also in the `files` list. + +The previous (v1) implementation used in npm 6 and below treated +`package.json` as a special sort of "reverse ignore" file. That is, it was +parsed and handled as if it was a `.npmignore` file with `!` prepended to +all of the globs in the `files` list. In order to include children of a +directory listed in `files`, they would _also_ have `/**` appended to them. + +This is tricky to explain, but is a significant improvement over the +previous (v1) implementation used in npm 6 and below, with the following +beneficial properties: + +- If you have `{"files":["lib"]}` in `package.json`, then the walker will + still ignore files such as `lib/.DS_Store` and `lib/.foo.swp`. The + previous implementation would include these files, as they'd be matched + by the computed `!lib/**` ignore rule. +- If you have `{"files":["lib/a.js","lib/b.js"]}` in `package.json`, and a + `lib/.npmignore` containing `a.js`, then the walker will still include + the two files indicated in `package.json`, and ignore the + `lib/.npmignore` file. The previous implementation would mark these + files for inclusion, but then _exclude_ them when it came to the nested + `.npmignore` file. (Ignore file semantics dictate that a "closer" ignore + file always takes precedence.) +- A file in `lib/pkg-template/package.json` will be included, and its + `files` list will not have any bearing on other files being included or + skipped. When treating `package.json` as just Yet Another ignore file, + this was not the case, leading to difficulty for modules that aim to + initialize a project. + +In general, this walk should work as a reasonable developer would expect. +Matching human expectation is tricky business, and if you find cases where +it violates those expectations, [please let us +know](https://github.com/npm/npm-packlist/issues). + ## API Same API as [ignore-walk](http://npm.im/ignore-walk), just hard-coded diff --git a/deps/npm/node_modules/npm-packlist/bin/index.js b/deps/npm/node_modules/npm-packlist/bin/index.js new file mode 100755 index 00000000000000..f06feffd9b55ae --- /dev/null +++ b/deps/npm/node_modules/npm-packlist/bin/index.js @@ -0,0 +1,24 @@ +#!/usr/bin/env node + +const dirs = [] +let doSort = false +process.argv.slice(2).forEach(arg => { + if (arg === '-h' || arg === '--help') { + console.log('usage: npm-packlist [-s --sort] [directory, directory, ...]') + process.exit(0) + } else if (arg === '-s' || arg === '--sort') + doSort = true + else + dirs.push(arg) +}) + +const sort = list => doSort ? list.sort((a, b) => a.localeCompare(b)) : list + +const packlist = require('../') +if (!dirs.length) + console.log(sort(packlist.sync({ path: process.cwd() })).join('\n')) +else + dirs.forEach(path => { + console.log(`> ${path}`) + console.log(sort(packlist.sync({ path })).join('\n')) + }) diff --git a/deps/npm/node_modules/npm-packlist/index.js b/deps/npm/node_modules/npm-packlist/index.js index eaf14b86617514..3bda08330afe22 100644 --- a/deps/npm/node_modules/npm-packlist/index.js +++ b/deps/npm/node_modules/npm-packlist/index.js @@ -19,6 +19,22 @@ const path = require('path') const normalizePackageBin = require('npm-normalize-package-bin') +// Weird side-effect of this: a readme (etc) file will be included +// if it exists anywhere within a folder with a package.json file. +// The original intent was only to include these files in the root, +// but now users in the wild are dependent on that behavior for +// localized documentation and other use cases. Adding a `/` to +// these rules, while tempting and arguably more "correct", is a +// significant change that will break existing use cases. +const packageMustHaveFileNames = + 'readme|copying|license|licence|notice|changes|changelog|history' + +const packageMustHaves = `@(${packageMustHaveFileNames}){,.*[^~$]}` +const packageMustHavesRE = new RegExp(`^(${packageMustHaveFileNames})(\\..*[^~\$])?$`, 'i') + +const fs = require('fs') +const glob = require('glob') + const defaultRules = [ '.npmignore', '.gitignore', @@ -43,14 +59,7 @@ const defaultRules = [ '*.orig', '/package-lock.json', '/yarn.lock', - 'archived-packages/**', - 'core', - '!core/', - '!**/core/', - '*.core', - '*.vgcore', - 'vgcore.*', - 'core.+([0-9])', + '/archived-packages/**', ] // There may be others, but :?|<> are handled by node-tar @@ -74,13 +83,23 @@ const npmWalker = Class => class Walker extends Class { opt.path = opt.path || process.cwd() const dirName = path.basename(opt.path) const parentName = path.basename(path.dirname(opt.path)) - opt.follow = - dirName === 'node_modules' || - (parentName === 'node_modules' && /^@/.test(dirName)) + + // only follow links in the root node_modules folder, because if those + // folders are included, it's because they're bundled, and bundles + // should include the contents, not the symlinks themselves. + // This regexp tests to see that we're either a node_modules folder, + // or a @scope within a node_modules folder, in the root's node_modules + // hierarchy (ie, not in test/foo/node_modules/ or something). + const followRe = /^(?:\/node_modules\/(?:@[^\/]+\/[^\/]+|[^\/]+)\/)*\/node_modules(?:\/@[^\/]+)?$/ + const rootPath = opt.parent ? opt.parent.root : opt.path + const followTestPath = opt.path.replace(/\\/g, '/').substr(rootPath.length) + opt.follow = followRe.test(followTestPath) + super(opt) // ignore a bunch of things by default at the root level. - // also ignore anything in node_modules, except bundled dependencies + // also ignore anything in the main project node_modules hierarchy, + // except bundled dependencies if (!this.parent) { this.bundled = opt.bundled || [] this.bundledScopes = Array.from(new Set( @@ -103,7 +122,133 @@ const npmWalker = Class => class Walker extends Class { !(e === 'node_modules' && this.bundled.length === 0) ) } - return super.onReaddir(entries) + + // if we have a package.json, then look in it for 'files' + // we _only_ do this in the root project, not bundled deps + // or other random folders. Bundled deps are always assumed + // to be in the state the user wants to include them, and + // a package.json somewhere else might be a template or + // test or something else entirely. + if (this.parent || !entries.includes('package.json')) { + return super.onReaddir(entries) + } + + // when the cache has been seeded with the root manifest, + // we must respect that (it may differ from the filesystem) + const ig = path.resolve(this.path, 'package.json') + + if (this.packageJsonCache.has(ig)) { + const pkg = this.packageJsonCache.get(ig) + + // fall back to filesystem when seeded manifest is invalid + if (!pkg || typeof pkg !== 'object') { + return this.readPackageJson(entries) + } + + // feels wonky, but this ensures package bin is _always_ + // normalized, as well as guarding against invalid JSON + return this.getPackageFiles(entries, JSON.stringify(pkg)) + } + + this.readPackageJson(entries) + } + + onReadPackageJson (entries, er, pkg) { + if (er) + this.emit('error', er) + else + this.getPackageFiles(entries, pkg) + } + + mustHaveFilesFromPackage (pkg) { + const files = [] + if (pkg.browser) + files.push('/' + pkg.browser) + if (pkg.main) + files.push('/' + pkg.main) + if (pkg.bin) { + // always an object because normalized already + for (const key in pkg.bin) + files.push('/' + pkg.bin[key]) + } + files.push( + '/package.json', + '/npm-shrinkwrap.json', + '!/package-lock.json', + packageMustHaves, + ) + return files + } + + getPackageFiles (entries, pkg) { + try { + pkg = normalizePackageBin(JSON.parse(pkg.toString())) + } catch (er) { + // not actually a valid package.json + return super.onReaddir(entries) + } + + const ig = path.resolve(this.path, 'package.json') + this.packageJsonCache.set(ig, pkg) + + // no files list, just return the normal readdir() result + if (!Array.isArray(pkg.files)) + return super.onReaddir(entries) + + pkg.files.push(...this.mustHaveFilesFromPackage(pkg)) + + // If the package has a files list, then it's unlikely to include + // node_modules, because why would you do that? but since we use + // the files list as the effective readdir result, that means it + // looks like we don't have a node_modules folder at all unless we + // include it here. + if (pkg.bundleDependencies && entries.includes('node_modules')) + pkg.files.push('node_modules') + + const patterns = Array.from(new Set(pkg.files)).reduce((set, pattern) => { + const excl = pattern.match(/^!+/) + if (excl) + pattern = pattern.substr(excl[0].length) + // strip off any / from the start of the pattern. /foo => foo + pattern = pattern.replace(/^\/+/, '') + // an odd number of ! means a negated pattern. !!foo ==> foo + const negate = excl && excl[0].length % 2 === 1 + set.push({ pattern, negate }) + return set + }, []) + + let n = patterns.length + const set = new Set() + const negates = new Set() + const then = (pattern, negate, er, fileList) => { + if (er) + return this.emit('error', er) + + if (negate) { + fileList.forEach(f => { + set.delete(f) + negates.add(f) + }) + } else { + fileList.forEach(f => { + set.add(f) + negates.delete(f) + }) + } + + if (--n === 0) { + const list = Array.from(set) + // replace the files array with our computed explicit set + pkg.files = list.concat(Array.from(negates).map(f => '!' + f)) + const rdResult = Array.from(new Set( + list.map(f => f.replace(/^\/+/, '')) + )) + super.onReaddir(rdResult) + } + } + + patterns.forEach(({pattern, negate}) => + this.globFiles(pattern, (er, res) => then(pattern, negate, er, res))) } filterEntry (entry, partial) { @@ -136,15 +281,23 @@ const npmWalker = Class => class Walker extends Class { // always include package.json at the root. : rootPJ ? true + // always include readmes etc in any included dir + : packageMustHavesRE.test(entry) ? true + + // npm-shrinkwrap and package.json always included in the root pkg + : isRoot && (entry === 'npm-shrinkwrap.json' || entry === 'package.json') + ? true + + // package-lock never included + : isRoot && entry === 'package-lock.json' ? false + // otherwise, follow ignore-walk's logic : super.filterEntry(entry, partial) ) } filterEntries () { - if (this.ignoreRules['package.json']) - this.ignoreRules['.gitignore'] = this.ignoreRules['.npmignore'] = null - else if (this.ignoreRules['.npmignore']) + if (this.ignoreRules['.npmignore']) this.ignoreRules['.gitignore'] = null this.filterEntries = super.filterEntries super.filterEntries() @@ -152,7 +305,9 @@ const npmWalker = Class => class Walker extends Class { addIgnoreFile (file, then) { const ig = path.resolve(this.path, file) - if (this.packageJsonCache.has(ig)) + if (file === 'package.json' && this.parent) + then() + else if (this.packageJsonCache.has(ig)) this.onPackageJson(ig, this.packageJsonCache.get(ig), then) else super.addIgnoreFile(file, then) @@ -161,38 +316,19 @@ const npmWalker = Class => class Walker extends Class { onPackageJson (ig, pkg, then) { this.packageJsonCache.set(ig, pkg) - // if there's a bin, browser or main, make sure we don't ignore it - // also, don't ignore the package.json itself! - // - // Weird side-effect of this: a readme (etc) file will be included - // if it exists anywhere within a folder with a package.json file. - // The original intent was only to include these files in the root, - // but now users in the wild are dependent on that behavior for - // localized documentation and other use cases. Adding a `/` to - // these rules, while tempting and arguably more "correct", is a - // breaking change. - const rules = [ - pkg.browser ? '!' + pkg.browser : '', - pkg.main ? '!' + pkg.main : '', - '!package.json', - '!npm-shrinkwrap.json', - '!@(readme|copying|license|licence|notice|changes|changelog|history){,.*[^~$]}' - ] - if (pkg.bin) { - // always an object, because normalized already - for (const key in pkg.bin) - rules.push('!' + pkg.bin[key]) - } - - const data = rules.filter(f => f).join('\n') + '\n' - super.onReadIgnoreFile(packageNecessaryRules, data, _=>_) - - if (Array.isArray(pkg.files)) - super.onReadIgnoreFile('package.json', '*\n' + pkg.files.map( - f => '!' + f + '\n!' + f.replace(/\/+$/, '') + '/**' + if (Array.isArray(pkg.files)) { + // in this case we already included all the must-haves + super.onReadIgnoreFile('package.json', pkg.files.map( + f => '!' + f ).join('\n') + '\n', then) - else - then() + } else { + // if there's a bin, browser or main, make sure we don't ignore it + // also, don't ignore the package.json itself, or any files that + // must be included in the package. + const rules = this.mustHaveFilesFromPackage(pkg).map(f => `!${f}`) + const data = rules.join('\n') + '\n' + super.onReadIgnoreFile(packageNecessaryRules, data, then) + } } // override parent stat function to completely skip any filenames @@ -214,15 +350,15 @@ const npmWalker = Class => class Walker extends Class { } onReadIgnoreFile (file, data, then) { - if (file === 'package.json') + if (file === 'package.json') { try { const ig = path.resolve(this.path, file) - this.onPackageJson(ig, normalizePackageBin(JSON.parse(data)), then) + this.onPackageJson(ig, JSON.parse(data), then) } catch (er) { // ignore package.json files that are not json then() } - else + } else super.onReadIgnoreFile(file, data, then) } @@ -232,12 +368,34 @@ const npmWalker = Class => class Walker extends Class { } class Walker extends npmWalker(IgnoreWalker) { + globFiles (pattern, cb) { + glob(pattern, { dot: true, cwd: this.path, nocase: true }, cb) + } + + readPackageJson (entries) { + fs.readFile(this.path + '/package.json', (er, pkg) => + this.onReadPackageJson(entries, er, pkg)) + } + walker (entry, then) { new Walker(this.walkerOpt(entry)).on('done', then).start() } } class WalkerSync extends npmWalker(IgnoreWalkerSync) { + globFiles (pattern, cb) { + cb(null, glob.sync(pattern, { dot: true, cwd: this.path, nocase: true })) + } + + readPackageJson (entries) { + const p = this.path + '/package.json' + try { + this.onReadPackageJson(entries, null, fs.readFileSync(p)) + } catch (er) { + this.onReadPackageJson(entries, er) + } + } + walker (entry, then) { new WalkerSync(this.walkerOpt(entry)).start() then() diff --git a/deps/npm/node_modules/npm-packlist/package.json b/deps/npm/node_modules/npm-packlist/package.json index 693c51b96140da..0c23b633e47962 100644 --- a/deps/npm/node_modules/npm-packlist/package.json +++ b/deps/npm/node_modules/npm-packlist/package.json @@ -1,76 +1,47 @@ { - "_from": "npm-packlist@1.4.8", - "_id": "npm-packlist@1.4.8", - "_inBundle": false, - "_integrity": "sha512-5+AZgwru5IevF5ZdnFglB5wNlHG1AOOuw28WhUq8/8emhBmLv6jX5by4WJCh7lW0uSYZYS6DXqIsyZVIXRZU9A==", - "_location": "/npm-packlist", - "_phantomChildren": {}, - "_requested": { - "type": "version", - "registry": true, - "raw": "npm-packlist@1.4.8", - "name": "npm-packlist", - "escapedName": "npm-packlist", - "rawSpec": "1.4.8", - "saveSpec": null, - "fetchSpec": "1.4.8" - }, - "_requiredBy": [ - "#USER", - "/", - "/pacote" - ], - "_resolved": "https://registry.npmjs.org/npm-packlist/-/npm-packlist-1.4.8.tgz", - "_shasum": "56ee6cc135b9f98ad3d51c1c95da22bbb9b2ef3e", - "_spec": "npm-packlist@1.4.8", - "_where": "/Users/darcyclarke/Documents/Repos/npm/cli", - "author": { - "name": "Isaac Z. Schlueter", - "email": "i@izs.me", - "url": "http://blog.izs.me/" - }, - "bugs": { - "url": "https://github.com/npm/npm-packlist/issues" - }, - "bundleDependencies": false, - "dependencies": { - "ignore-walk": "^3.0.1", - "npm-bundled": "^1.0.1", - "npm-normalize-package-bin": "^1.0.1" - }, - "deprecated": false, + "name": "npm-packlist", + "version": "2.1.2", "description": "Get a list of the files to add from a folder into an npm package", - "devDependencies": { - "mkdirp": "^0.5.1", - "rimraf": "^2.6.1", - "tap": "^14.6.9" - }, "directories": { "test": "test" }, + "main": "index.js", + "dependencies": { + "glob": "^7.1.6", + "ignore-walk": "^3.0.3", + "npm-bundled": "^1.1.1", + "npm-normalize-package-bin": "^1.0.1" + }, + "author": "Isaac Z. Schlueter (http://blog.izs.me/)", + "license": "ISC", "files": [ "index.js" ], - "homepage": "https://www.npmjs.com/package/npm-packlist", - "license": "ISC", - "main": "index.js", - "name": "npm-packlist", - "publishConfig": { - "tag": "legacy-v1" + "devDependencies": { + "mutate-fs": "^2.1.1", + "require-inject": "^1.4.4", + "tap": "^14.10.7" + }, + "scripts": { + "test": "tap", + "snap": "tap", + "preversion": "npm test", + "postversion": "npm publish", + "postpublish": "git push origin --follow-tags" }, "repository": { "type": "git", "url": "git+https://github.com/npm/npm-packlist.git" }, - "scripts": { - "postpublish": "git push origin --follow-tags", - "postversion": "npm publish", - "preversion": "npm test", - "snap": "tap", - "test": "tap" - }, "tap": { - "jobs": 1 - }, - "version": "1.4.8" + "check-coverage": true, + "nyc-arg": [ + "--include=index.js", + "--include=bin/index.js" + ] + }, + "bin": "bin/index.js", + "engines": { + "node": ">=10" + } } diff --git a/deps/npm/node_modules/npm-pick-manifest/CHANGELOG.md b/deps/npm/node_modules/npm-pick-manifest/CHANGELOG.md index c594ba140f72b1..a4ee13e92ab45c 100644 --- a/deps/npm/node_modules/npm-pick-manifest/CHANGELOG.md +++ b/deps/npm/node_modules/npm-pick-manifest/CHANGELOG.md @@ -1,7 +1,59 @@ -# Change Log +# 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. +## [6.1.0](https://github.com/npm/npm-pick-manifest/compare/v6.0.0...v6.1.0) (2020-04-07) + + +### Features + +* add 'avoid' semver range option ([c64973d](https://github.com/npm/npm-pick-manifest/commit/c64973d63ddf6797edf41c20df641f816d30ff03)) +* add avoidStrict option to strictly avoid ([c268796](https://github.com/npm/npm-pick-manifest/commit/c2687967b6294f5ce01aa6b59071e79272dc57de)), closes [#30](https://github.com/npm/npm-pick-manifest/issues/30) + +## [6.0.0](https://github.com/npm/npm-pick-manifest/compare/v5.0.0...v6.0.0) (2020-02-18) + + +### ⚠ BREAKING CHANGES + +* 'enjoyBy' is no longer an acceptable alias. + +### Features + +* add GitHub Actions file for ci ([8985247](https://github.com/npm/npm-pick-manifest/commit/898524727fa157f46fdf4eb0c11148ae4808226b)) + + +### Bug Fixes + +* Handle edge cases around before:Date and filtering staged publishes ([ed2f92e](https://github.com/npm/npm-pick-manifest/commit/ed2f92e7fdc9cc7836b13ebc73e17d8fd296a07e)) +* remove figgy pudding ([c24fed2](https://github.com/npm/npm-pick-manifest/commit/c24fed25b8f77fbbcc3107030f2dfed55fa54222)) +* remove outdated cruft from docs ([aae7ef7](https://github.com/npm/npm-pick-manifest/commit/aae7ef7625ddddbac0548287e5d57b8f76593322)) +* update some missing {loose:true} semver configs ([4015424](https://github.com/npm/npm-pick-manifest/commit/40154244a3fe1af86462bc1d6165199fc3315c10)) +* Use canonical 'before' config name ([029de59](https://github.com/npm/npm-pick-manifest/commit/029de59bda6d3376f03760a00efe4ac9d997c623)) + +## [5.0.0](https://github.com/npm/npm-pick-manifest/compare/v4.0.0...v5.0.0) (2019-12-15) + + +### ⚠ BREAKING CHANGES + +* This drops support for node < 10. + +* normalize settings, drop old nodes, update deps ([dc2e61c](https://github.com/npm/npm-pick-manifest/commit/dc2e61cc06bd19e079128e77397df7593741da50)) + + +# [4.0.0](https://github.com/npm/npm-pick-manifest/compare/v3.0.2...v4.0.0) (2019-11-11) + + +### deps + +* bump npm-package-arg to v7 ([42c76d8](https://github.com/npm/npm-pick-manifest/commit/42c76d8)), closes [/github.com/npm/hosted-git-info/pull/38#issuecomment-520243803](https://github.com//github.com/npm/hosted-git-info/pull/38/issues/issuecomment-520243803) + + +### BREAKING CHANGES + +* this drops support for ancient node versions. + + + ## [3.0.2](https://github.com/npm/npm-pick-manifest/compare/v3.0.1...v3.0.2) (2019-08-30) diff --git a/deps/npm/node_modules/npm-pick-manifest/README.md b/deps/npm/node_modules/npm-pick-manifest/README.md index d32d47af1997b6..26ee43e05e5313 100644 --- a/deps/npm/node_modules/npm-pick-manifest/README.md +++ b/deps/npm/node_modules/npm-pick-manifest/README.md @@ -1,4 +1,4 @@ -# npm-pick-manifest [![npm version](https://img.shields.io/npm/v/npm-pick-manifest.svg)](https://npm.im/npm-pick-manifest) [![license](https://img.shields.io/npm/l/npm-pick-manifest.svg)](https://npm.im/npm-pick-manifest) [![Travis](https://img.shields.io/travis/npm/npm-pick-manifest.svg)](https://travis-ci.org/npm/npm-pick-manifest) [![AppVeyor](https://ci.appveyor.com/api/projects/status/github/npm/npm-pick-manifest?svg=true)](https://ci.appveyor.com/project/npm/npm-pick-manifest) [![Coverage Status](https://coveralls.io/repos/github/npm/npm-pick-manifest/badge.svg?branch=latest)](https://coveralls.io/github/npm/npm-pick-manifest?branch=latest) +# npm-pick-manifest [![npm version](https://img.shields.io/npm/v/npm-pick-manifest.svg)](https://npm.im/npm-pick-manifest) [![license](https://img.shields.io/npm/l/npm-pick-manifest.svg)](https://npm.im/npm-pick-manifest) [![Travis](https://img.shields.io/travis/npm/npm-pick-manifest.svg)](https://travis-ci.org/npm/npm-pick-manifest) [![Coverage Status](https://coveralls.io/repos/github/npm/npm-pick-manifest/badge.svg?branch=latest)](https://coveralls.io/github/npm/npm-pick-manifest?branch=latest) [`npm-pick-manifest`](https://github.com/npm/npm-pick-manifest) is a standalone implementation of [npm](https://npmjs.com)'s semver range resolution algorithm. @@ -11,7 +11,6 @@ implementation of [npm](https://npmjs.com)'s semver range resolution algorithm. * [Example](#example) * [Features](#features) -* [Contributing](#contributing) * [API](#api) * [`pickManifest()`](#pick-manifest) @@ -29,22 +28,17 @@ fetch('https://registry.npmjs.org/npm-pick-manifest').then(res => { ### Features -* Uses npm's exact semver resolution algorithm -* Supports ranges, tags, and versions - -### Contributing - -The npm-pick-manifest team enthusiastically welcomes contributions and project participation! -There's a bunch of things you can do if you want to contribute! The [Contributor -Guide](CONTRIBUTING.md) has all the information you need for everything from -reporting bugs to contributing entire new features. Please don't hesitate to -jump in if you'd like to, or even ask us questions if something isn't clear. +* Uses npm's exact [semver resolution algorithm](http://npm.im/semver). +* Supports ranges, tags, and versions. +* Prefers non-deprecated versions to deprecated versions. +* Prefers versions whose `engines` requirements are satisfied over those + that will raise a warning or error at install time. ### API #### `> pickManifest(packument, selector, [opts]) -> manifest` -Returns the manifest that matches `selector`, or throws an error. +Returns the manifest that best matches `selector`, or throws an error. Packuments are anything returned by metadata URLs from the npm registry. That is, they're objects with the following shape (only fields used by @@ -65,20 +59,99 @@ is, they're objects with the following shape (only fields used by } ``` -The algorithm will follow npm's algorithm for semver resolution, and only `tag`, -`range`, and `version` selectors are supported. +The algorithm will follow npm's algorithm for semver resolution, and only +`tag`, `range`, and `version` selectors are supported. The function will throw `ETARGET` if there was no matching manifest, and `ENOVERSIONS` if the packument object has no valid versions in `versions`. - -If `opts.defaultTag` is provided, it will be used instead of `latest`. That is, -if that tag matches the selector, it will be used, even if a higher available -version matches the range. - -If `opts.enjoyBy` is provided, it should be something that can be passed to `new -Date(x)`, such as a `Date` object or a timestamp string. It will be used to -filter the selected versions such that only versions less than or equal to -`enjoyBy` are considered. - -If `opts.includeDeprecated` passed in as true, deprecated versions will be -selected. By default, deprecated versions other than `defaultTag` are ignored. +If the only matching manifest is included in a `policyRestrictions` section +of the packument, then an `E403` is raised. + +#### Options + +All options are optional. + +* `includeStaged` - Boolean, default `false`. Include manifests in the + `stagedVersions.versions` set, to support installing [staged + packages](https://github.com/npm/rfcs/pull/92) when appropriate. Note + that staged packages are always treated as lower priority than actual + publishes, even when `includeStaged` is set. +* `defaultTag` - String, default `'latest'`. The default `dist-tag` to + install when no specifier is provided. Note that the version indicated + by this specifier will be given top priority if it matches a supplied + semver range. +* `before` - String, Date, or Number, default `null`. This is passed to + `new Date()`, so anything that works there will be valid. Do not + consider _any_ manifests that were published after the date indicated. + Note that this is only relevant when the packument includes a `time` + field listing the publish date of all the packages. +* `nodeVersion` - String, default `process.version`. The Node.js version + to use when checking manifests for `engines` requirement satisfaction. +* `npmVersion` - String, default `null`. The npm version to use when + checking manifest for `engines` requirement satisfaction. (If `null`, + then this particular check is skipped.) +* `avoid` - String, default `null`. A SemVer range of + versions that should be avoided. An avoided version MAY be selected if + there is no other option, so when using this for version selection ensure + that you check the result against the range to see if there was no + alternative available. +* `avoidStrict` Boolean, default `false`. If set to true, then + `pickManifest` will never return a version in the `avoid` range. If the + only available version in the `wanted` range is a version that should be + avoided, then it will return a version _outside_ the `wanted` range, + preferring to do so without making a SemVer-major jump, if possible. If + there are no versions outside the `avoid` range, then throw an + `ETARGET` error. It does this by calling pickManifest first with the + `wanted` range, then with a `^` affixed to the version returned by the + `wanted` range, and then with a `*` version range, and throwing if + nothing could be found to satisfy the avoidance request. + +Return value is the manifest as it exists in the packument, possibly +decorated with the following boolean flags: + +* `_shouldAvoid` The version is in the `avoid` range. Watch out! +* `_outsideDependencyRange` The version is outside the `wanted` range, + because `avoidStrict: true` was set. +* `_isSemVerMajor` The `_outsideDependencyRange` result is a SemVer-major + step up from the version returned by the `wanted` range. + +### Algorithm + +1. Create list of all versions in `versions`, + `policyRestrictions.versions`, and (if `includeStaged` is set) + `stagedVersions.versions`. +2. If a `dist-tag` is requested, + 1. If the manifest is not after the specified `before` date, then + select that from the set. + 2. If the manifest is after the specified `before` date, then re-start + the selection looking for the highest SemVer range that is equal to + or less than the `dist-tag` target. +3. If a specific version is requested, + 1. If the manifest is not after the specified `before` date, then + select the specified manifest. + 2. If the manifest is after the specified `before` date, then raise + `ETARGET` error. (NB: this is a breaking change from v5, where a + specified version would override the `before` setting.) +4. (At this point we know a range is requested.) +5. If the `defaultTag` refers to a `dist-tag` that satisfies the range (or + if the range is `'*'` or `''`), and the manifest is published before the + `before` setting, then select that manifest. +6. If nothing is yet selected, sort by the following heuristics in order, + and select the top item: + 1. Prioritize versions that are not in the `avoid` range over those + that are. + 2. Prioritize versions that are not in `policyRestrictions` over those + that are. + 3. Prioritize published versions over staged versions. + 4. Prioritize versions that are not deprecated, and which have a + satisfied engines requirement, over those that are either deprecated + or have an engines mismatch. + 5. Prioritize versions that have a satisfied engines requirement over + those that do not. + 6. Prioritize versions that are not are not deprecated (but have a + mismatched engines requirement) over those that are deprecated. + 7. Prioritize higher SemVer precedence over lower SemVer precedence. +7. If no manifest was selected, raise an `ETARGET` error. +8. If the selected item is in the `policyRestrictions.versions` list, raise + an `E403` error. +9. Return the selected manifest. diff --git a/deps/npm/node_modules/npm-pick-manifest/index.js b/deps/npm/node_modules/npm-pick-manifest/index.js index 9eb2d82d100245..2b3ea6ffa4930e 100644 --- a/deps/npm/node_modules/npm-pick-manifest/index.js +++ b/deps/npm/node_modules/npm-pick-manifest/index.js @@ -1,136 +1,216 @@ 'use strict' -const figgyPudding = require('figgy-pudding') const npa = require('npm-package-arg') const semver = require('semver') - -const PickerOpts = figgyPudding({ - defaultTag: { default: 'latest' }, - enjoyBy: {}, - includeDeprecated: { default: false } -}) - -module.exports = pickManifest -function pickManifest (packument, wanted, opts) { - opts = PickerOpts(opts) - const time = opts.enjoyBy && packument.time && +(new Date(opts.enjoyBy)) - const spec = npa.resolve(packument.name, wanted) - const type = spec.type - if (type === 'version' || type === 'range') { - wanted = semver.clean(wanted, true) || wanted +const { checkEngine } = require('npm-install-checks') + +const engineOk = (manifest, npmVersion, nodeVersion) => { + try { + checkEngine(manifest, npmVersion, nodeVersion) + return true + } catch (_) { + return false } - const distTags = packument['dist-tags'] || {} - const versions = Object.keys(packument.versions || {}).filter(v => { - return semver.valid(v, true) - }) - const policyRestrictions = packument.policyRestrictions - const restrictedVersions = policyRestrictions - ? Object.keys(policyRestrictions.versions) : [] +} - function enjoyableBy (v) { - return !time || ( - packument.time[v] && time >= +(new Date(packument.time[v])) - ) - } +const isBefore = (verTimes, ver, time) => + !verTimes || !verTimes[ver] || Date.parse(verTimes[ver]) <= time + +const avoidSemverOpt = { includePrerelease: true, loose: true } +const shouldAvoid = (ver, avoid) => + avoid && semver.satisfies(ver, avoid, avoidSemverOpt) + +const decorateAvoid = (result, avoid) => + result && shouldAvoid(result.version, avoid) + ? { ...result, _shouldAvoid: true } + : result + +const pickManifest = (packument, wanted, opts) => { + const { + defaultTag = 'latest', + before = null, + nodeVersion = process.version, + npmVersion = null, + includeStaged = false, + avoid = null, + avoidStrict = false + } = opts + + const { name, time: verTimes } = packument + const versions = packument.versions || {} + + if (avoidStrict) { + const looseOpts = { + ...opts, + avoidStrict: false + } - let err + const result = pickManifest(packument, wanted, looseOpts) + if (!result || !result._shouldAvoid) { + return result + } - if (!versions.length && !restrictedVersions.length) { - err = new Error(`No valid versions available for ${packument.name}`) - err.code = 'ENOVERSIONS' - err.name = packument.name - err.type = type - err.wanted = wanted - throw err - } + const caret = pickManifest(packument, `^${result.version}`, looseOpts) + if (!caret || !caret._shouldAvoid) { + return { + ...caret, + _outsideDependencyRange: true, + _isSemVerMajor: false + } + } - let target + const star = pickManifest(packument, '*', looseOpts) + if (!star || !star._shouldAvoid) { + return { + ...star, + _outsideDependencyRange: true, + _isSemVerMajor: true + } + } - if (type === 'tag' && enjoyableBy(distTags[wanted])) { - target = distTags[wanted] - } else if (type === 'version') { - target = wanted - } else if (type !== 'range' && enjoyableBy(distTags[wanted])) { - throw new Error('Only tag, version, and range are supported') + throw Object.assign(new Error(`No avoidable versions for ${name}`), { + code: 'ETARGET', + name, + wanted, + avoid, + before, + versions: Object.keys(versions) + }) } - const tagVersion = distTags[opts.defaultTag] + const staged = (includeStaged && packument.stagedVersions && + packument.stagedVersions.versions) || {} + const restricted = (packument.policyRestrictions && + packument.policyRestrictions.versions) || {} - if ( - !target && - tagVersion && - packument.versions[tagVersion] && - enjoyableBy(tagVersion) && - semver.satisfies(tagVersion, wanted, true) - ) { - target = tagVersion - } + const time = before && verTimes ? +(new Date(before)) : Infinity + const spec = npa.resolve(name, wanted || defaultTag) + const type = spec.type + const distTags = packument['dist-tags'] || {} - if (!target && !opts.includeDeprecated) { - const undeprecated = versions.filter(v => !packument.versions[v].deprecated && enjoyableBy(v) - ) - target = semver.maxSatisfying(undeprecated, wanted, true) + if (type !== 'tag' && type !== 'version' && type !== 'range') { + throw new Error('Only tag, version, and range are supported') } - if (!target) { - const stillFresh = versions.filter(enjoyableBy) - target = semver.maxSatisfying(stillFresh, wanted, true) + + // if the type is 'tag', and not just the implicit default, then it must + // be that exactly, or nothing else will do. + if (wanted && type === 'tag') { + const ver = distTags[wanted] + // if the version in the dist-tags is before the before date, then + // we use that. Otherwise, we get the highest precedence version + // prior to the dist-tag. + if (isBefore(verTimes, ver, time)) { + return decorateAvoid(versions[ver] || staged[ver] || restricted[ver], avoid) + } else { + return pickManifest(packument, `<=${ver}`, opts) + } } - if (!target && wanted === '*' && enjoyableBy(tagVersion)) { - // This specific corner is meant for the case where - // someone is using `*` as a selector, but all versions - // are pre-releases, which don't match ranges at all. - target = tagVersion + // similarly, if a specific version, then only that version will do + if (wanted && type === 'version') { + const ver = semver.clean(wanted, { loose: true }) + const mani = versions[ver] || staged[ver] || restricted[ver] + return isBefore(verTimes, ver, time) ? decorateAvoid(mani, avoid) : null } - if ( - !target && - time && - type === 'tag' && - distTags[wanted] && - !enjoyableBy(distTags[wanted]) - ) { - const stillFresh = versions.filter(v => - enjoyableBy(v) && semver.lte(v, distTags[wanted], true) - ).sort(semver.rcompare) - target = stillFresh[0] + // ok, sort based on our heuristics, and pick the best fit + const range = type === 'range' ? wanted : '*' + + // if the range is *, then we prefer the 'latest' if available + // but skip this if it should be avoided, in that case we have + // to try a little harder. + const defaultVer = distTags[defaultTag] + if (defaultVer && + (range === '*' || semver.satisfies(defaultVer, range, { loose: true })) && + !shouldAvoid(defaultVer, avoid)) { + const mani = versions[defaultVer] + if (mani && isBefore(verTimes, defaultVer, time)) { + return mani + } } - if (!target && restrictedVersions) { - target = semver.maxSatisfying(restrictedVersions, wanted, true) + // ok, actually have to sort the list and take the winner + const allEntries = Object.entries(versions) + .concat(Object.entries(staged)) + .concat(Object.entries(restricted)) + .filter(([ver, mani]) => isBefore(verTimes, ver, time)) + + if (!allEntries.length) { + throw Object.assign(new Error(`No versions available for ${name}`), { + code: 'ENOVERSIONS', + name, + type, + wanted, + before, + versions: Object.keys(versions) + }) } - const manifest = ( - target && - packument.versions[target] - ) - if (!manifest) { - // Check if target is forbidden - const isForbidden = target && policyRestrictions && policyRestrictions.versions[target] - const pckg = `${packument.name}@${wanted}${ - opts.enjoyBy - ? ` with an Enjoy By date of ${ - new Date(opts.enjoyBy).toLocaleString() - }. Maybe try a different date?` - : '' - }` - - if (isForbidden) { - err = new Error(`Could not download ${pckg} due to policy violations.\n${policyRestrictions.message}\n`) - err.code = 'E403' - } else { - err = new Error(`No matching version found for ${pckg}.`) - err.code = 'ETARGET' - } + const sortSemverOpt = { loose: true } + const entries = allEntries.filter(([ver, mani]) => + semver.satisfies(ver, range, { loose: true })) + .sort((a, b) => { + const [vera, mania] = a + const [verb, manib] = b + const notavoida = !shouldAvoid(vera, avoid) + const notavoidb = !shouldAvoid(verb, avoid) + const notrestra = !restricted[a] + const notrestrb = !restricted[b] + const notstagea = !staged[a] + const notstageb = !staged[b] + const notdepra = !mania.deprecated + const notdeprb = !manib.deprecated + const enginea = engineOk(mania, npmVersion, nodeVersion) + const engineb = engineOk(manib, npmVersion, nodeVersion) + // sort by: + // - not an avoided version + // - not restricted + // - not staged + // - not deprecated and engine ok + // - engine ok + // - not deprecated + // - semver + return (notavoidb - notavoida) || + (notrestrb - notrestra) || + (notstageb - notstagea) || + ((notdeprb && engineb) - (notdepra && enginea)) || + (engineb - enginea) || + (notdeprb - notdepra) || + semver.rcompare(vera, verb, sortSemverOpt) + }) + + return decorateAvoid(entries[0] && entries[0][1], avoid) +} - err.name = packument.name - err.type = type - err.wanted = wanted - err.versions = versions - err.distTags = distTags - err.defaultTag = opts.defaultTag - throw err - } else { - return manifest +module.exports = (packument, wanted, opts = {}) => { + const picked = pickManifest(packument, wanted, opts) + const policyRestrictions = packument.policyRestrictions + const restricted = (policyRestrictions && policyRestrictions.versions) || {} + + if (picked && !restricted[picked.version]) { + return picked } + + const { before = null, defaultTag = 'latest' } = opts + const bstr = before ? new Date(before).toLocaleString() : '' + const { name } = packument + const pckg = `${name}@${wanted}` + + (before ? ` with a date before ${bstr}` : '') + + const isForbidden = picked && !!restricted[picked.version] + const polMsg = isForbidden ? policyRestrictions.message : '' + + const msg = !isForbidden ? `No matching version found for ${pckg}.` + : `Could not download ${pckg} due to policy violations:\n${polMsg}` + + const code = isForbidden ? 'E403' : 'ETARGET' + throw Object.assign(new Error(msg), { + code, + type: npa.resolve(packument.name, wanted).type, + wanted, + versions: Object.keys(packument.versions), + name, + distTags: packument['dist-tags'], + defaultTag + }) } diff --git a/deps/npm/node_modules/npm-pick-manifest/package.json b/deps/npm/node_modules/npm-pick-manifest/package.json index 5adbc269574858..805f5ac23a8463 100644 --- a/deps/npm/node_modules/npm-pick-manifest/package.json +++ b/deps/npm/node_modules/npm-pick-manifest/package.json @@ -1,84 +1,44 @@ { - "_from": "npm-pick-manifest@3.0.2", - "_id": "npm-pick-manifest@3.0.2", - "_inBundle": false, - "_integrity": "sha512-wNprTNg+X5nf+tDi+hbjdHhM4bX+mKqv6XmPh7B5eG+QY9VARfQPfCEH013H5GqfNj6ee8Ij2fg8yk0mzps1Vw==", - "_location": "/npm-pick-manifest", - "_phantomChildren": {}, - "_requested": { - "type": "version", - "registry": true, - "raw": "npm-pick-manifest@3.0.2", - "name": "npm-pick-manifest", - "escapedName": "npm-pick-manifest", - "rawSpec": "3.0.2", - "saveSpec": null, - "fetchSpec": "3.0.2" - }, - "_requiredBy": [ - "#USER", - "/", - "/pacote" - ], - "_resolved": "https://registry.npmjs.org/npm-pick-manifest/-/npm-pick-manifest-3.0.2.tgz", - "_shasum": "f4d9e5fd4be2153e5f4e5f9b7be8dc419a99abb7", - "_spec": "npm-pick-manifest@3.0.2", - "_where": "/Users/claudiahdz/npm/cli", - "author": { - "name": "Kat Marchán", - "email": "kzm@sykosomatic.org" - }, - "bugs": { - "url": "https://github.com/npm/npm-pick-manifest/issues" - }, - "bundleDependencies": false, - "config": { - "nyc": { - "exclude": [ - "node_modules/**", - "test/**" - ] - } - }, - "dependencies": { - "figgy-pudding": "^3.5.1", - "npm-package-arg": "^6.0.0", - "semver": "^5.4.1" - }, - "deprecated": false, + "name": "npm-pick-manifest", + "version": "6.1.0", "description": "Resolves a matching manifest from a package metadata document according to standard npm semver resolution rules.", - "devDependencies": { - "nyc": "^13.1.0", - "standard": "^10.0.3", - "standard-version": "^4.4.0", - "tap": "^12.0.1", - "weallbehave": "^1.2.0", - "weallcontribute": "^1.0.8" - }, + "main": "index.js", "files": [ "*.js" ], - "homepage": "https://github.com/npm/npm-pick-manifest#readme", + "scripts": { + "coverage": "tap", + "lint": "standard", + "postrelease": "npm publish", + "posttest": "npm run lint", + "prepublishOnly": "git push --follow-tags", + "prerelease": "npm t", + "release": "standard-version -s", + "test": "tap" + }, + "repository": "https://github.com/npm/npm-pick-manifest", "keywords": [ "npm", "semver", "package manager" ], + "author": { + "name": "Kat Marchán", + "email": "kzm@sykosomatic.org", + "twitter": "maybekatz" + }, "license": "ISC", - "main": "index.js", - "name": "npm-pick-manifest", - "repository": { - "type": "git", - "url": "git+https://github.com/npm/npm-pick-manifest.git" + "dependencies": { + "npm-install-checks": "^4.0.0", + "npm-package-arg": "^8.0.0", + "semver": "^7.0.0" }, - "scripts": { - "postrelease": "npm publish && git push --follow-tags", - "prerelease": "npm t", - "pretest": "standard", - "release": "standard-version -s", - "test": "tap -J --100 --coverage test/*.js", - "update-coc": "weallbehave -o . && git add CODE_OF_CONDUCT.md && git commit -m 'docs(coc): updated CODE_OF_CONDUCT.md'", - "update-contrib": "weallcontribute -o . && git add CONTRIBUTING.md && git commit -m 'docs(contributing): updated CONTRIBUTING.md'" + "devDependencies": { + "standard": "^14.3.1", + "standard-version": "^7.0.1", + "tap": "^14.10.2" }, - "version": "3.0.2" + "tap": { + "check-coverage": true + } } diff --git a/deps/npm/node_modules/npm-profile/CHANGELOG.md b/deps/npm/node_modules/npm-profile/CHANGELOG.md index 6d937580c307b0..3205cf532299bf 100644 --- a/deps/npm/node_modules/npm-profile/CHANGELOG.md +++ b/deps/npm/node_modules/npm-profile/CHANGELOG.md @@ -1,3 +1,20 @@ +# v5.0.0 (2020-02-27) + +- Drop the CLI from the project, just maintain the library +- Drop support for EOL Node.js versions +- Remove `Promise` option, just use native Promises +- Remove `figgy-pudding` +- Use `npm-registry-fetch` v8 +- fix: do not try to open invalid URLs for WebLogin + +# v4.0.3 (2020-02-27) + +- fix: do not try to open invalid URLs for WebLogin + +# v4.0.2 (2019-07-16) + +- Update `npm-registry-fetch` to 4.0.0 + # v4.0.1 (2018-08-29) - `opts.password` needs to be base64-encoded when passed in for login diff --git a/deps/npm/node_modules/npm-profile/README.md b/deps/npm/node_modules/npm-profile/README.md index 7a80a729e8996d..9f671d12a502a0 100644 --- a/deps/npm/node_modules/npm-profile/README.md +++ b/deps/npm/node_modules/npm-profile/README.md @@ -40,10 +40,6 @@ using the legacy CouchDB APIs. * `opener` Function (url) → Promise, returns a promise that resolves after a browser has been opened for the user at `url`. * `prompter` Function (creds) → Promise, returns a promise that resolves to an object with `username`, `email` and `password` properties. -* [`opts`](#opts) Object (optional) plus extra keys: - * `creds` Object, passed through to prompter, common values are: - * `username` String, default value for username - * `email` String, default value for email #### **Promise Value** @@ -71,9 +67,6 @@ using the legacy CouchDB APIs. * `opener` Function (url) → Promise, returns a promise that resolves after a browser has been opened for the user at `url`. * `prompter` Function (creds) → Promise, returns a promise that resolves to an object with `username`, and `password` properties. -* [`opts`](#opts) Object (optional) plus extra keys: - * `creds` Object, passed through to prompter, common values are: - * `name` String, default value for username #### **Promise Value** @@ -512,18 +505,24 @@ Otherwise the code will be the HTTP response code. ### options objects The various API functions accept an optional `opts` object as a final -argument. This opts object can either be a regular Object, or a -[`figgy-pudding`](https://npm.im/figgy-pudding) options object instance. +argument. -Unless otherwise noted, the options accepted are the same as the +Options are passed to [`npm-registry-fetch` -options](https://www.npmjs.com/package/npm-registry-fetch#fetch-opts). +options](https://www.npmjs.com/package/npm-registry-fetch#fetch-opts), so +anything provided to this module will affect the behavior of that one as +well. Of particular note are `opts.registry`, and the auth-related options: -* `opts.token` - used for Bearer auth +* `opts.creds` Object, passed through to prompter, common values are: + * `username` String, default value for username + * `email` String, default value for email * `opts.username` and `opts.password` - used for Basic auth -* `opts.otp` - the 2fa OTP token +* `opts.otp` String, the two-factor-auth one-time-password (Will prompt for + this if needed and not provided.) +* `opts.hostname` String, the hostname of the current machine, to show the + user during the WebAuth flow. (Defaults to `os.hostname()`.) ## Logging diff --git a/deps/npm/node_modules/npm-profile/index.js b/deps/npm/node_modules/npm-profile/index.js index d9c48c131bc927..4f2a2ae7cc2ff2 100644 --- a/deps/npm/node_modules/npm-profile/index.js +++ b/deps/npm/node_modules/npm-profile/index.js @@ -3,45 +3,15 @@ const fetch = require('npm-registry-fetch') const { HttpErrorBase } = require('npm-registry-fetch/errors.js') const os = require('os') -const pudding = require('figgy-pudding') -const validate = require('aproba') - -exports.adduserCouch = adduserCouch -exports.loginCouch = loginCouch -exports.adduserWeb = adduserWeb -exports.loginWeb = loginWeb -exports.login = login -exports.adduser = adduser -exports.get = get -exports.set = set -exports.listTokens = listTokens -exports.removeToken = removeToken -exports.createToken = createToken - -const url = require('url') - -const isValidUrl = u => { - if (u && typeof u === 'string') { - const p = url.parse(u) - return p.slashes && p.host && p.path && /^https?:$/.test(p.protocol) - } - return false -} - -const ProfileConfig = pudding({ - creds: {}, - hostname: {}, - otp: {} -}) +const { URL } = require('url') // try loginWeb, catch the "not supported" message and fall back to couch -function login (opener, prompter, opts) { - validate('FFO', arguments) - opts = ProfileConfig(opts) +const login = (opener, prompter, opts = {}) => { + const { creds } = opts return loginWeb(opener, opts).catch(er => { if (er instanceof WebLoginNotSupported) { process.emit('log', 'verbose', 'web login not supported, trying couch') - return prompter(opts.creds) + return prompter(creds) .then(data => loginCouch(data.username, data.password, opts)) } else { throw er @@ -49,13 +19,12 @@ function login (opener, prompter, opts) { }) } -function adduser (opener, prompter, opts) { - validate('FFO', arguments) - opts = ProfileConfig(opts) +const adduser = (opener, prompter, opts = {}) => { + const { creds } = opts return adduserWeb(opener, opts).catch(er => { if (er instanceof WebLoginNotSupported) { process.emit('log', 'verbose', 'web adduser not supported, trying couch') - return prompter(opts.creds) + return prompter(creds) .then(data => adduserCouch(data.username, data.email, data.password, opts)) } else { throw er @@ -63,27 +32,33 @@ function adduser (opener, prompter, opts) { }) } -function adduserWeb (opener, opts) { - validate('FO', arguments) - const body = { create: true } +const adduserWeb = (opener, opts = {}) => { process.emit('log', 'verbose', 'web adduser', 'before first POST') - return webAuth(opener, opts, body) + return webAuth(opener, opts, { create: true }) } -function loginWeb (opener, opts) { - validate('FO', arguments) +const loginWeb = (opener, opts = {}) => { process.emit('log', 'verbose', 'web login', 'before first POST') return webAuth(opener, opts, {}) } -function webAuth (opener, opts, body) { - opts = ProfileConfig(opts) - body.hostname = opts.hostname || os.hostname() +const isValidUrl = u => { + try { + return /^https?:$/.test(new URL(u).protocol) + } catch (er) { + return false + } +} + +const webAuth = (opener, opts, body) => { + const { hostname } = opts + body.hostname = hostname || os.hostname() const target = '/-/v1/login' - return fetch(target, opts.concat({ + return fetch(target, { + ...opts, method: 'POST', body - })).then(res => { + }).then(res => { return Promise.all([res, res.json()]) }).then(([res, content]) => { const { doneUrl, loginUrl } = content @@ -95,7 +70,7 @@ function webAuth (opener, opts, body) { }).then(({ doneUrl, loginUrl }) => { process.emit('log', 'verbose', 'web auth', 'opening url pair') return opener(loginUrl).then( - () => webAuthCheckLogin(doneUrl, opts.concat({ cache: false })) + () => webAuthCheckLogin(doneUrl, { ...opts, cache: false }) ) }).catch(er => { if ((er.statusCode >= 400 && er.statusCode <= 499) || er.statusCode === 500) { @@ -109,7 +84,7 @@ function webAuth (opener, opts, body) { }) } -function webAuthCheckLogin (doneUrl, opts) { +const webAuthCheckLogin = (doneUrl, opts) => { return fetch(doneUrl, opts).then(res => { return Promise.all([res, res.json()]) }).then(([res, content]) => { @@ -132,9 +107,7 @@ function webAuthCheckLogin (doneUrl, opts) { }) } -function adduserCouch (username, email, password, opts) { - validate('SSSO', arguments) - opts = ProfileConfig(opts) +const adduserCouch = (username, email, password, opts = {}) => { const body = { _id: 'org.couchdb.user:' + username, name: username, @@ -144,25 +117,24 @@ function adduserCouch (username, email, password, opts) { roles: [], date: new Date().toISOString() } - const logObj = {} - Object.keys(body).forEach(k => { - logObj[k] = k === 'password' ? 'XXXXX' : body[k] - }) + const logObj = { + ...body, + password: 'XXXXX' + } process.emit('log', 'verbose', 'adduser', 'before first PUT', logObj) const target = '/-/user/org.couchdb.user:' + encodeURIComponent(username) - return fetch.json(target, opts.concat({ + return fetch.json(target, { + ...opts, method: 'PUT', body - })).then(result => { + }).then(result => { result.username = username return result }) } -function loginCouch (username, password, opts) { - validate('SSO', arguments) - opts = ProfileConfig(opts) +const loginCouch = (username, password, opts = {}) => { const body = { _id: 'org.couchdb.user:' + username, name: username, @@ -171,39 +143,43 @@ function loginCouch (username, password, opts) { roles: [], date: new Date().toISOString() } - const logObj = {} - Object.keys(body).forEach(k => { - logObj[k] = k === 'password' ? 'XXXXX' : body[k] - }) + const logObj = { + ...body, + password: 'XXXXX' + } process.emit('log', 'verbose', 'login', 'before first PUT', logObj) const target = '-/user/org.couchdb.user:' + encodeURIComponent(username) - return fetch.json(target, opts.concat({ + return fetch.json(target, { + ...opts, method: 'PUT', body - })).catch(err => { + }).catch(err => { if (err.code === 'E400') { err.message = `There is no user with the username "${username}".` throw err } if (err.code !== 'E409') throw err - return fetch.json(target, opts.concat({ + return fetch.json(target, { + ...opts, query: { write: true } - })).then(result => { - Object.keys(result).forEach(function (k) { + }).then(result => { + Object.keys(result).forEach(k => { if (!body[k] || k === 'roles') { body[k] = result[k] } }) - return fetch.json(`${target}/-rev/${body._rev}`, opts.concat({ + const { otp } = opts + return fetch.json(`${target}/-rev/${body._rev}`, { + ...opts, method: 'PUT', body, forceAuth: { username, password: Buffer.from(password, 'utf8').toString('base64'), - otp: opts.otp + otp } - })) + }) }) }).then(result => { result.username = username @@ -211,30 +187,22 @@ function loginCouch (username, password, opts) { }) } -function get (opts) { - validate('O', arguments) - return fetch.json('/-/npm/v1/user', opts) -} +const get = (opts = {}) => fetch.json('/-/npm/v1/user', opts) -function set (profile, opts) { - validate('OO', arguments) +const set = (profile, opts = {}) => { Object.keys(profile).forEach(key => { // profile keys can't be empty strings, but they CAN be null if (profile[key] === '') profile[key] = null }) - return fetch.json('/-/npm/v1/user', ProfileConfig(opts, { + return fetch.json('/-/npm/v1/user', { + ...opts, method: 'POST', body: profile - })) + }) } -function listTokens (opts) { - validate('O', arguments) - opts = ProfileConfig(opts) - - return untilLastPage('/-/npm/v1/tokens') - - function untilLastPage (href, objects) { +const listTokens = (opts = {}) => { + const untilLastPage = (href, objects) => { return fetch.json(href, opts).then(result => { objects = objects ? objects.concat(result.objects) : result.objects if (result.urls.next) { @@ -244,27 +212,28 @@ function listTokens (opts) { } }) } + return untilLastPage('/-/npm/v1/tokens') } -function removeToken (tokenKey, opts) { - validate('SO', arguments) +const removeToken = (tokenKey, opts = {}) => { const target = `/-/npm/v1/tokens/token/${tokenKey}` - return fetch(target, ProfileConfig(opts, { + return fetch(target, { + ...opts, method: 'DELETE', ignoreBody: true - })).then(() => null) + }).then(() => null) } -function createToken (password, readonly, cidrs, opts) { - validate('SBAO', arguments) - return fetch.json('/-/npm/v1/tokens', ProfileConfig(opts, { +const createToken = (password, readonly, cidrs, opts = {}) => { + return fetch.json('/-/npm/v1/tokens', { + ...opts, method: 'POST', body: { password: password, readonly: readonly, cidr_whitelist: cidrs } - })) + }) } class WebLoginInvalidResponse extends HttpErrorBase { @@ -284,6 +253,19 @@ class WebLoginNotSupported extends HttpErrorBase { } } -function sleep (ms) { - return new Promise((resolve, reject) => setTimeout(resolve, ms)) +const sleep = (ms) => + new Promise((resolve, reject) => setTimeout(resolve, ms)) + +module.exports = { + adduserCouch, + loginCouch, + adduserWeb, + loginWeb, + login, + adduser, + get, + set, + listTokens, + removeToken, + createToken } diff --git a/deps/npm/node_modules/npm-profile/package.json b/deps/npm/node_modules/npm-profile/package.json index e90e16ddf975d9..41cac1ed679465 100644 --- a/deps/npm/node_modules/npm-profile/package.json +++ b/deps/npm/node_modules/npm-profile/package.json @@ -1,60 +1,39 @@ { - "_from": "npm-profile@4.0.4", - "_id": "npm-profile@4.0.4", - "_inBundle": false, - "_integrity": "sha512-Ta8xq8TLMpqssF0H60BXS1A90iMoM6GeKwsmravJ6wYjWwSzcYBTdyWa3DZCYqPutacBMEm7cxiOkiIeCUAHDQ==", - "_location": "/npm-profile", - "_phantomChildren": {}, - "_requested": { - "type": "version", - "registry": true, - "raw": "npm-profile@4.0.4", - "name": "npm-profile", - "escapedName": "npm-profile", - "rawSpec": "4.0.4", - "saveSpec": null, - "fetchSpec": "4.0.4" - }, - "_requiredBy": [ - "#USER", - "/", - "/libnpm" - ], - "_resolved": "https://registry.npmjs.org/npm-profile/-/npm-profile-4.0.4.tgz", - "_shasum": "28ee94390e936df6d084263ee2061336a6a1581b", - "_spec": "npm-profile@4.0.4", - "_where": "/Users/darcyclarke/Documents/Repos/npm/cli", - "author": { - "name": "Rebecca Turner", - "email": "me@re-becca.org", - "url": "http://re-becca.org/" - }, - "bugs": { - "url": "https://github.com/npm/npm-profile/issues" - }, - "bundleDependencies": false, - "dependencies": { - "aproba": "^1.1.2 || 2", - "figgy-pudding": "^3.4.1", - "npm-registry-fetch": "^4.0.0" - }, - "deprecated": false, + "name": "npm-profile", + "version": "5.0.1", "description": "Library for updating an npmjs.com profile", - "files": [ - "CHANGELOG.md", - "index.js" - ], - "homepage": "https://github.com/npm/npm-profile/tree/latest/lib#readme", "keywords": [], + "author": "Rebecca Turner (http://re-becca.org/)", "license": "ISC", - "main": "index.js", - "name": "npm-profile", - "publishConfig": { - "tag": "legacy-v4" + "dependencies": { + "npm-registry-fetch": "^8.0.0" }, + "main": "index.js", "repository": { "type": "git", "url": "git+https://github.com/npm/npm-profile.git" }, - "version": "4.0.4" + "files": [ + "index.js" + ], + "devDependencies": { + "nock": "^12.0.1", + "require-inject": "^1.4.4", + "standard": "^14.3.1", + "tap": "^14.10.6" + }, + "scripts": { + "preversion": "npm test", + "postversion": "npm publish", + "prepublishOnly": "git push origin --follow-tags", + "posttest": "standard index.js", + "test": "tap", + "snap": "tap" + }, + "tap": { + "check-coverage": true + }, + "engines": { + "node": ">=10" + } } diff --git a/deps/npm/node_modules/npm-registry-fetch/CHANGELOG.md b/deps/npm/node_modules/npm-registry-fetch/CHANGELOG.md index 04a4dd901b0f85..c121079bd445b1 100644 --- a/deps/npm/node_modules/npm-registry-fetch/CHANGELOG.md +++ b/deps/npm/node_modules/npm-registry-fetch/CHANGELOG.md @@ -1,45 +1,142 @@ -# Change Log +# 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. - -## [4.0.7](https://github.com/npm/registry-fetch/compare/v4.0.6...v4.0.7) (2020-08-17) +### [8.1.4](https://github.com/npm/registry-fetch/compare/v8.1.3...v8.1.4) (2020-08-17) ### Bug Fixes -* correct password redaction ([110032b](https://github.com/npm/registry-fetch/commit/110032b)) +* redact passwords from http logs ([3c294eb](https://github.com/npm/registry-fetch/commit/3c294ebbd7821725db4ff1bc5fe368c49613efcc)) +### [8.1.3](https://github.com/npm/registry-fetch/compare/v8.1.2...v8.1.3) (2020-07-21) +### [8.1.2](https://github.com/npm/registry-fetch/compare/v8.1.1...v8.1.2) (2020-07-11) - -## [4.0.6](https://github.com/npm/registry-fetch/compare/v4.0.5...v4.0.6) (2020-08-14) +### [8.1.1](https://github.com/npm/registry-fetch/compare/v8.1.0...v8.1.1) (2020-06-30) +## [8.1.0](https://github.com/npm/registry-fetch/compare/v8.0.3...v8.1.0) (2020-05-20) + + +### Features + +* add npm-command HTTP header ([1bb4eb2](https://github.com/npm/registry-fetch/commit/1bb4eb2c66ee8a0dc62558bdcff1b548e2bb9820)) + +### [8.0.3](https://github.com/npm/registry-fetch/compare/v8.0.2...v8.0.3) (2020-05-13) + + +### Bug Fixes + +* update minipass and make-fetch-happen to latest ([3b6c5d0](https://github.com/npm/registry-fetch/commit/3b6c5d0d8ccd4c4a97862a65acef956f19aec127)), closes [#23](https://github.com/npm/registry-fetch/issues/23) + +### [8.0.2](https://github.com/npm/registry-fetch/compare/v8.0.1...v8.0.2) (2020-05-04) + + +### Bug Fixes + +* update make-fetch-happen to 8.0.6 ([226df2c](https://github.com/npm/registry-fetch/commit/226df2c32e3f9ed8ceefcfdbd11efb178181b442)) + +## [8.0.0](https://github.com/npm/registry-fetch/compare/v7.0.1...v8.0.0) (2020-02-24) + + +### ⚠ BREAKING CHANGES + +* Removes the 'opts.refer' option and the HTTP Referer +header (unless explicitly added to the 'headers' option, of course). + +PR-URL: https://github.com/npm/npm-registry-fetch/pull/25 +Credit: @isaacs ### Bug Fixes -* import URL from url module ([cd35987](https://github.com/npm/registry-fetch/commit/cd35987)) +* remove referer header and opts.refer ([eb8f7af](https://github.com/npm/registry-fetch/commit/eb8f7af3c102834856604c1be664b00ca0fe8ef2)), closes [#25](https://github.com/npm/registry-fetch/issues/25) + +### [7.0.1](https://github.com/npm/registry-fetch/compare/v7.0.0...v7.0.1) (2020-02-24) + +## [7.0.0](https://github.com/npm/registry-fetch/compare/v6.0.2...v7.0.0) (2020-02-18) +### ⚠ BREAKING CHANGES - -## [4.0.5](https://github.com/npm/registry-fetch/compare/v4.0.4...v4.0.5) (2020-06-30) +* figgy pudding is now nowhere to be found. +* this removes figgy-pudding, and drops several option +aliases. +Defaults and behavior are all the same, and this module is now using the +canonical camelCase option names that npm v7 will provide to all its +deps. +Related to: https://github.com/npm/rfcs/pull/102 - -## [4.0.4](https://github.com/npm/registry-fetch/compare/v4.0.3...v4.0.4) (2020-04-28) +PR-URL: https://github.com/npm/npm-registry-fetch/pull/22 +Credit: @isaacs +### Bug Fixes + +* Remove figgy-pudding, use canonical option names ([ede3c08](https://github.com/npm/registry-fetch/commit/ede3c087007fd1808e02b1af70562220d03b18a9)), closes [#22](https://github.com/npm/registry-fetch/issues/22) - -## [4.0.3](https://github.com/npm/registry-fetch/compare/v4.0.2...v4.0.3) (2020-02-13) +* update cacache, ssri, make-fetch-happen ([57fcc88](https://github.com/npm/registry-fetch/commit/57fcc889bee03edcc0a2025d96a171039108c231)) + +### [6.0.2](https://github.com/npm/registry-fetch/compare/v6.0.1...v6.0.2) (2020-02-14) ### Bug Fixes -* always bypass cache when ?write=true ([ba8b4fe](https://github.com/npm/registry-fetch/commit/ba8b4fe)) -* use 30s default for timeout as per README ([69c2977](https://github.com/npm/registry-fetch/commit/69c2977)), closes [#20](https://github.com/npm/registry-fetch/issues/20) +* always bypass cache when ?write=true ([83f89f3](https://github.com/npm/registry-fetch/commit/83f89f35abd2ed0507c869e37f90ed746375772c)) + +### [6.0.1](https://github.com/npm/registry-fetch/compare/v6.0.0...v6.0.1) (2020-02-14) + + +### Bug Fixes + +* use 30s default for timeout as per README ([50e8afc](https://github.com/npm/registry-fetch/commit/50e8afc6ff850542feb588f9f9c64ebae59e72a0)), closes [#20](https://github.com/npm/registry-fetch/issues/20) + +## [6.0.0](https://github.com/npm/registry-fetch/compare/v5.0.1...v6.0.0) (2019-12-17) + + +### ⚠ BREAKING CHANGES + +* This drops support for node < 10. + +There are some lint failures due to standard pushing for using WhatWG URL +objects instead of url.parse/url.resolve. However, the code in this lib +does some fancy things with the query/search portions of the parsed url +object, so it'll take a bit of care to make it work properly. + +### Bug Fixes + +* detect CI so our tests don't fail in CI ([5813da6](https://github.com/npm/registry-fetch/commit/5813da634cef73b12e40373972d7937e6934fce0)) +* Use WhatWG URLs instead of url.parse ([8ccfa8a](https://github.com/npm/registry-fetch/commit/8ccfa8a72c38cfedb0f525b7f453644fd4444f99)) + + +* normalize settings, drop old nodes, update deps ([510b125](https://github.com/npm/registry-fetch/commit/510b1255cc7ed4bb397a34e0007757dae33e2275)) + + +## [5.0.1](https://github.com/npm/registry-fetch/compare/v5.0.0...v5.0.1) (2019-11-11) + + + + +# [5.0.0](https://github.com/npm/registry-fetch/compare/v4.0.2...v5.0.0) (2019-10-04) + + +### Bug Fixes + +* prefer const in getAuth function ([90ac7b1](https://github.com/npm/registry-fetch/commit/90ac7b1)) +* use minizlib instead of core zlib ([e64702e](https://github.com/npm/registry-fetch/commit/e64702e)) + + +### Features + +* refactor to use Minipass streams ([bb37f20](https://github.com/npm/registry-fetch/commit/bb37f20)) + + +### BREAKING CHANGES + +* this replaces all core streams (except for some +PassThrough streams in a few tests) with Minipass streams, and updates +all deps to the latest and greatest Minipass versions of things. diff --git a/deps/npm/node_modules/npm-registry-fetch/README.md b/deps/npm/node_modules/npm-registry-fetch/README.md index 9f9c6d0e808fd2..e660940e30dc47 100644 --- a/deps/npm/node_modules/npm-registry-fetch/README.md +++ b/deps/npm/node_modules/npm-registry-fetch/README.md @@ -1,4 +1,10 @@ -# npm-registry-fetch [![npm version](https://img.shields.io/npm/v/npm-registry-fetch.svg)](https://npm.im/npm-registry-fetch) [![license](https://img.shields.io/npm/l/npm-registry-fetch.svg)](https://npm.im/npm-registry-fetch) [![Travis](https://img.shields.io/travis/npm/npm-registry-fetch/latest.svg)](https://travis-ci.org/npm/npm-registry-fetch) [![AppVeyor](https://img.shields.io/appveyor/ci/zkat/npm-registry-fetch/latest.svg)](https://ci.appveyor.com/project/npm/npm-registry-fetch) [![Coverage Status](https://coveralls.io/repos/github/npm/npm-registry-fetch/badge.svg?branch=latest)](https://coveralls.io/github/npm/npm-registry-fetch?branch=latest) +# npm-registry-fetch + +[![npm version](https://img.shields.io/npm/v/npm-registry-fetch.svg)](https://npm.im/npm-registry-fetch) +[![license](https://img.shields.io/npm/l/npm-registry-fetch.svg)](https://npm.im/npm-registry-fetch) +[![Travis](https://img.shields.io/travis/npm/npm-registry-fetch/latest.svg)](https://travis-ci.org/npm/npm-registry-fetch) +[![AppVeyor](https://img.shields.io/appveyor/ci/npm/npm-registry-fetch/latest.svg)](https://ci.appveyor.com/project/npm/npm-registry-fetch) +[![Coverage Status](https://coveralls.io/repos/github/npm/npm-registry-fetch/badge.svg?branch=latest)](https://coveralls.io/github/npm/npm-registry-fetch?branch=latest) [`npm-registry-fetch`](https://github.com/npm/npm-registry-fetch) is a Node.js library that implements a `fetch`-like API for accessing npm registry APIs @@ -175,7 +181,7 @@ to trust only that specific signing authority. Multiple CAs can be trusted by specifying an array of certificates instead of a single string. -See also [`opts.strict-ssl`](#opts-strict-ssl), [`opts.ca`](#opts-ca) and +See also [`opts.strictSSL`](#opts-strictSSL), [`opts.ca`](#opts-ca) and [`opts.key`](#opts-key) ##### `opts.cache` @@ -188,8 +194,8 @@ will be cached according to [IETF RFC 7234](https://tools.ietf.org/html/rfc7234) rules. This will speed up future requests, as well as make the cached data available offline if necessary/requested. -See also [`offline`](#opts-offline), [`prefer-offline`](#opts-prefer-offline), -and [`prefer-online`](#opts-prefer-online). +See also [`offline`](#opts-offline), [`preferOffline`](#opts-preferOffline), +and [`preferOnline`](#opts-preferOnline). ##### `opts.cert` @@ -210,7 +216,7 @@ It is _not_ the path to a certificate file (and there is no "certfile" option). See also: [`opts.ca`](#opts-ca) and [`opts.key`](#opts-key) -##### `opts.fetch-retries` +##### `opts.fetchRetries` * Type: Number * Default: 2 @@ -221,7 +227,7 @@ packages from the registry. See also [`opts.retry`](#opts-retry) to provide all retry options as a single object. -##### `opts.fetch-retry-factor` +##### `opts.fetchRetryFactor` * Type: Number * Default: 10 @@ -232,7 +238,7 @@ packages. See also [`opts.retry`](#opts-retry) to provide all retry options as a single object. -##### `opts.fetch-retry-mintimeout` +##### `opts.fetchRetryMintimeout` * Type: Number * Default: 10000 (10 seconds) @@ -243,7 +249,7 @@ packages. See also [`opts.retry`](#opts-retry) to provide all retry options as a single object. -##### `opts.fetch-retry-maxtimeout` +##### `opts.fetchRetryMaxtimeout` * Type: Number * Default: 60000 (1 minute) @@ -254,9 +260,8 @@ packages. See also [`opts.retry`](#opts-retry) to provide all retry options as a single object. -##### `opts.force-auth` +##### `opts.forceAuth` -* Alias: `opts.forceAuth` * Type: Object * Default: null @@ -282,9 +287,8 @@ Additional headers for the outgoing request. This option can also be used to override headers automatically generated by `npm-registry-fetch`, such as `Content-Type`. -##### `opts.ignore-body` +##### `opts.ignoreBody` -* Alias: `opts.ignoreBody` * Type: Boolean * Default: false @@ -311,9 +315,8 @@ previously-generated integrity hash for the saved request information, so `EINTEGRITY` errors can happen if [`opts.cache`](#opts-cache) is used, even if `opts.integrity` is not passed in. -##### `opts.is-from-ci` +##### `opts.isFromCI` -* Alias: `opts.isFromCI` * Type: Boolean * Default: Based on environment variables @@ -337,7 +340,7 @@ It is _not_ the path to a key file (and there is no "keyfile" option). See also: [`opts.ca`](#opts-ca) and [`opts.cert`](#opts-cert) -##### `opts.local-address` +##### `opts.localAddress` * Type: IP Address String * Default: null @@ -355,9 +358,8 @@ See also [`opts.proxy`](#opts-proxy) Logger object to use for logging operation details. Must have the same methods as `npmlog`. -##### `opts.map-json` +##### `opts.mapJSON` -* Alias: `mapJson`, `mapJSON` * Type: Function * Default: undefined @@ -365,9 +367,8 @@ When using `fetch.json.stream()` (NOT `fetch.json()`), this will be passed down to [`JSONStream`](https://npm.im/JSONStream) as the second argument to `JSONStream.parse`, and can be used to transform stream data before output. -##### `opts.maxsockets` +##### `opts.maxSockets` -* Alias: `opts.max-sockets` * Type: Integer * Default: 12 @@ -388,9 +389,8 @@ HTTP method to use for the outgoing request. Case-insensitive. If true, proxying will be disabled even if [`opts.proxy`](#opts-proxy) is used. -##### `opts.npm-session` +##### `opts.npmSession` -* Alias: `opts.npmSession` * Type: String * Default: null @@ -398,6 +398,15 @@ If provided, will be sent in the `npm-session` header. This header is used by the npm registry to identify individual user sessions (usually individual invocations of the CLI). +##### `opts.npmCommand` + +* Type: String +* Default: null + +If provided, it will be sent in the `npm-command` header. This yeader is +used by the npm registry to identify the npm command that caused this +request to be made. + ##### `opts.offline` * Type: Boolean @@ -405,7 +414,7 @@ invocations of the CLI). Force offline mode: no network requests will be done during install. To allow `npm-registry-fetch` to fill in missing cache data, see -[`opts.prefer-offline`](#opts-prefer-offline). +[`opts.preferOffline`](#opts-preferOffline). This option is only really useful if you're also using [`opts.cache`](#opts-cache). @@ -442,7 +451,7 @@ That is: See also [`opts.username`](#opts-username) -##### `opts.prefer-offline` +##### `opts.preferOffline` * Type: Boolean * Default: false @@ -457,7 +466,7 @@ This option is generally only useful if you're also using This option is set to `false` when the request includes `write=true` in the query string. -##### `opts.prefer-online` +##### `opts.preferOnline` * Type: Boolean * Default: false @@ -471,9 +480,8 @@ This option is generally only useful if you're also using This option is set to `true` when the request includes `write=true` in the query string. -##### `opts.project-scope` +##### `opts.projectScope` -* Alias: `opts.projectScope` * Type: String * Default: null @@ -502,15 +510,6 @@ using If the request URI already has a query string, it will be merged with `opts.query`, preferring `opts.query` values. -##### `opts.refer` - -* Alias: `opts.referer` -* Type: String -* Default: null - -Value to use for the `Referer` header. The npm CLI itself uses this to serialize -the npm command line using the given request. - ##### `opts.registry` * Type: URL @@ -568,7 +567,7 @@ If provided, can be used to automatically configure [`opts.scope`](#opts-scope) based on a specific package name. Non-registry package specs will throw an error. -##### `opts.strict-ssl` +##### `opts.strictSSL` * Type: Boolean * Default: true @@ -581,7 +580,7 @@ See also [`opts.ca`](#opts-ca). ##### `opts.timeout` * Type: Milliseconds -* Default: 0 (no timeout) +* Default: 300000 (5 minutes) Time before a hanging request times out. @@ -601,7 +600,7 @@ Can be scoped to a registry by using a "nerf dart" for that registry. That is: } ``` -##### `opts.user-agent` +##### `opts.userAgent` * Type: String * Default: `'npm-registry-fetch@/node@+ ()'` diff --git a/deps/npm/node_modules/npm-registry-fetch/auth.js b/deps/npm/node_modules/npm-registry-fetch/auth.js index d583982d0a8b2e..11c3bde6b4e6c6 100644 --- a/deps/npm/node_modules/npm-registry-fetch/auth.js +++ b/deps/npm/node_modules/npm-registry-fetch/auth.js @@ -1,17 +1,14 @@ 'use strict' -const config = require('./config.js') +const defaultOpts = require('./default-opts.js') const url = require('url') module.exports = getAuth -function getAuth (registry, opts) { +function getAuth (registry, opts_ = {}) { if (!registry) { throw new Error('registry is required') } - opts = config(opts) - let AUTH = {} + const opts = opts_.forceAuth ? opts_.forceAuth : { ...defaultOpts, ...opts_ } + const AUTH = {} const regKey = registry && registryKey(registry) - if (opts.forceAuth) { - opts = opts.forceAuth - } const doKey = (key, alias) => addKey(opts, AUTH, regKey, key, alias) doKey('token') doKey('_authToken', 'token') @@ -47,11 +44,12 @@ function addKey (opts, obj, scope, key, objKey) { // Called a nerf dart in the main codebase. Used as a "safe" // key when fetching registry info from config. function registryKey (registry) { - const parsed = url.parse(registry) + const parsed = new url.URL(registry) const formatted = url.format({ + protocol: parsed.protocol, host: parsed.host, pathname: parsed.pathname, - slashes: parsed.slashes + slashes: true }) - return url.resolve(formatted, '.') + return url.format(new url.URL('.', formatted)).replace(/^[^:]+:/, '') } diff --git a/deps/npm/node_modules/npm-registry-fetch/check-response.js b/deps/npm/node_modules/npm-registry-fetch/check-response.js index 79170a7fbdaf3b..f151711f301606 100644 --- a/deps/npm/node_modules/npm-registry-fetch/check-response.js +++ b/deps/npm/node_modules/npm-registry-fetch/check-response.js @@ -1,12 +1,13 @@ 'use strict' -const config = require('./config.js') const errors = require('./errors.js') const LRU = require('lru-cache') +const { Response } = require('minipass-fetch') +const defaultOpts = require('./default-opts.js') module.exports = checkResponse -function checkResponse (method, res, registry, startTime, opts) { - opts = config(opts) +function checkResponse (method, res, registry, startTime, opts_ = {}) { + const opts = { ...defaultOpts, ...opts_ } if (res.headers.has('npm-notice') && !res.headers.has('x-local-cache')) { opts.log.notice('', res.headers.get('npm-notice')) } @@ -18,7 +19,7 @@ function checkResponse (method, res, registry, startTime, opts) { res.body.on('end', () => logRequest(method, res, startTime, opts)) if (opts.ignoreBody) { res.body.resume() - res.body = null + return new Response(null, res) } return res } @@ -32,7 +33,7 @@ function logRequest (method, res, startTime, opts) { let urlStr try { - const URL = require('url').URL + const { URL } = require('url') const url = new URL(res.url) if (url.password) { url.password = '***' @@ -54,17 +55,22 @@ const BAD_HOSTS = new LRU({ max: 50 }) function checkWarnings (res, registry, opts) { if (res.headers.has('warning') && !BAD_HOSTS.has(registry)) { const warnings = {} - res.headers.raw()['warning'].forEach(w => { - const match = w.match(WARNING_REGEXP) - if (match) { - warnings[match[1]] = { - code: match[1], - host: match[2], - message: match[3], - date: new Date(match[4]) + // note: headers.raw() will preserve case, so we might have a + // key on the object like 'WaRnInG' if that was used first + for (const [key, value] of Object.entries(res.headers.raw())) { + if (key.toLowerCase() !== 'warning') { continue } + value.forEach(w => { + const match = w.match(WARNING_REGEXP) + if (match) { + warnings[match[1]] = { + code: match[1], + host: match[2], + message: match[3], + date: new Date(match[4]) + } } - } - }) + }) + } BAD_HOSTS.set(registry, true) if (warnings['199']) { if (warnings['199'].message.match(/ENOTFOUND/)) { diff --git a/deps/npm/node_modules/npm-registry-fetch/config.js b/deps/npm/node_modules/npm-registry-fetch/config.js deleted file mode 100644 index c4e8b687412a58..00000000000000 --- a/deps/npm/node_modules/npm-registry-fetch/config.js +++ /dev/null @@ -1,98 +0,0 @@ -'use strict' - -const pkg = require('./package.json') -const figgyPudding = require('figgy-pudding') -const silentLog = require('./silentlog.js') - -const AUTH_REGEX = /^(?:.*:)?(token|_authToken|username|_password|password|email|always-auth|_auth|otp)$/ -const SCOPE_REGISTRY_REGEX = /@.*:registry$/gi -module.exports = figgyPudding({ - 'agent': {}, - 'algorithms': {}, - 'body': {}, - 'ca': {}, - 'cache': {}, - 'cert': {}, - 'fetch-retries': {}, - 'fetch-retry-factor': {}, - 'fetch-retry-maxtimeout': {}, - 'fetch-retry-mintimeout': {}, - 'force-auth': {}, - forceAuth: 'force-auth', - 'gzip': {}, - 'headers': {}, - 'https-proxy': {}, - 'ignore-body': {}, - ignoreBody: 'ignore-body', - 'integrity': {}, - 'is-from-ci': 'isFromCI', - 'isFromCI': { - default () { - return ( - process.env['CI'] === 'true' || - process.env['TDDIUM'] || - process.env['JENKINS_URL'] || - process.env['bamboo.buildKey'] || - process.env['GO_PIPELINE_NAME'] - ) - } - }, - 'key': {}, - 'local-address': {}, - 'log': { - default: silentLog - }, - 'map-json': 'mapJson', - 'mapJSON': 'mapJson', - 'mapJson': {}, - 'max-sockets': 'maxsockets', - 'maxsockets': { - default: 12 - }, - 'memoize': {}, - 'method': { - default: 'GET' - }, - 'no-proxy': {}, - 'noproxy': {}, - 'npm-session': 'npmSession', - 'npmSession': {}, - 'offline': {}, - 'otp': {}, - 'prefer-offline': {}, - 'prefer-online': {}, - 'projectScope': {}, - 'project-scope': 'projectScope', - 'Promise': {default: () => Promise}, - 'proxy': {}, - 'query': {}, - 'refer': {}, - 'referer': 'refer', - 'registry': { - default: 'https://registry.npmjs.org/' - }, - 'retry': {}, - 'scope': {}, - 'spec': {}, - 'strict-ssl': {}, - 'timeout': { - default: 0 - }, - 'user-agent': { - default: `${ - pkg.name - }@${ - pkg.version - }/node@${ - process.version - }+${ - process.arch - } (${ - process.platform - })` - } -}, { - other (key) { - return key.match(AUTH_REGEX) || key.match(SCOPE_REGISTRY_REGEX) - } -}) diff --git a/deps/npm/node_modules/npm-registry-fetch/default-opts.js b/deps/npm/node_modules/npm-registry-fetch/default-opts.js new file mode 100644 index 00000000000000..b742fd5a5fcd46 --- /dev/null +++ b/deps/npm/node_modules/npm-registry-fetch/default-opts.js @@ -0,0 +1,22 @@ +const pkg = require('./package.json') +const ciDetect = require('@npmcli/ci-detect') +module.exports = { + isFromCI: ciDetect(), + log: require('./silentlog.js'), + maxSockets: 12, + method: 'GET', + registry: 'https://registry.npmjs.org/', + timeout: 5 * 60 * 1000, // 5 minutes + strictSSL: true, + noProxy: process.env.NOPROXY, + userAgent: `${pkg.name + }@${ + pkg.version + }/node@${ + process.version + }+${ + process.arch + } (${ + process.platform + })` +} diff --git a/deps/npm/node_modules/npm-registry-fetch/errors.js b/deps/npm/node_modules/npm-registry-fetch/errors.js index ba78735fce1351..c41947e29952da 100644 --- a/deps/npm/node_modules/npm-registry-fetch/errors.js +++ b/deps/npm/node_modules/npm-registry-fetch/errors.js @@ -4,7 +4,7 @@ const url = require('url') function packageName (href) { try { - let basePath = url.parse(href).pathname.substr(1) + let basePath = new url.URL(href).pathname.substr(1) if (!basePath.match(/^-/)) { basePath = basePath.split('/') var index = basePath.indexOf('_rewrite') diff --git a/deps/npm/node_modules/npm-registry-fetch/index.js b/deps/npm/node_modules/npm-registry-fetch/index.js index 9bd0ad32d7c9e9..eb48ba6c052b06 100644 --- a/deps/npm/node_modules/npm-registry-fetch/index.js +++ b/deps/npm/node_modules/npm-registry-fetch/index.js @@ -1,91 +1,102 @@ 'use strict' -const Buffer = require('safe-buffer').Buffer - const checkResponse = require('./check-response.js') -const config = require('./config.js') const getAuth = require('./auth.js') const fetch = require('make-fetch-happen') -const JSONStream = require('JSONStream') +const JSONStream = require('minipass-json-stream') const npa = require('npm-package-arg') -const {PassThrough} = require('stream') const qs = require('querystring') const url = require('url') -const zlib = require('zlib') +const zlib = require('minizlib') +const Minipass = require('minipass') + +const defaultOpts = require('./default-opts.js') + +// WhatWG URL throws if it's not fully resolved +const urlIsValid = u => { + try { + return !!new url.URL(u) + } catch (_) { + return false + } +} module.exports = regFetch -function regFetch (uri, opts) { - opts = config(opts) - const registry = ( +function regFetch (uri, /* istanbul ignore next */ opts_ = {}) { + const opts = { + ...defaultOpts, + ...opts_ + } + const registry = opts.registry = ( (opts.spec && pickRegistry(opts.spec, opts)) || opts.registry || + /* istanbul ignore next */ 'https://registry.npmjs.org/' ) - uri = url.parse(uri).protocol - ? uri - : `${ + + if (!urlIsValid(uri)) { + uri = `${ registry.trim().replace(/\/?$/g, '') }/${ uri.trim().replace(/^\//, '') }` + } + + const method = opts.method || 'GET' + // through that takes into account the scope, the prefix of `uri`, etc const startTime = Date.now() const headers = getHeaders(registry, uri, opts) let body = opts.body - const bodyIsStream = body && + const bodyIsStream = Minipass.isStream(body) + const bodyIsPromise = body && typeof body === 'object' && - typeof body.pipe === 'function' - if (body && !bodyIsStream && typeof body !== 'string' && !Buffer.isBuffer(body)) { + typeof body.then === 'function' + + if (body && !bodyIsStream && !bodyIsPromise && typeof body !== 'string' && !Buffer.isBuffer(body)) { headers['content-type'] = headers['content-type'] || 'application/json' body = JSON.stringify(body) } else if (body && !headers['content-type']) { headers['content-type'] = 'application/octet-stream' } + if (opts.gzip) { headers['content-encoding'] = 'gzip' if (bodyIsStream) { - const gz = zlib.createGzip() - body.on('error', err => gz.emit('error', err)) + const gz = new zlib.Gzip() + body.on('error', /* istanbul ignore next: unlikely and hard to test */ + err => gz.emit('error', err)) body = body.pipe(gz) - } else { - body = new opts.Promise((resolve, reject) => { - zlib.gzip(body, (err, gz) => err ? reject(err) : resolve(gz)) - }) + } else if (!bodyIsPromise) { + body = new zlib.Gzip().end(body).concat() } } - let q = opts.query - if (q) { - if (typeof q === 'string') { - q = qs.parse(q) - } else if (typeof q !== 'object') { - throw new TypeError('invalid query option, must be string or object') - } + const parsed = new url.URL(uri) + + if (opts.query) { + const q = typeof opts.query === 'string' + ? qs.parse(opts.query) + : opts.query + Object.keys(q).forEach(key => { - if (q[key] === undefined) { - delete q[key] + if (q[key] !== undefined) { + parsed.searchParams.set(key, q[key]) } }) - } - const parsed = url.parse(uri) - - const query = parsed.query ? Object.assign(qs.parse(parsed.query), q || {}) - : Object.keys(q || {}).length ? q - : null - - if (query) { - if (String(query.write) === 'true' && opts.method === 'GET') { - opts = opts.concat({ - offline: false, - 'prefer-offline': false, - 'prefer-online': true - }) - } - parsed.search = '?' + qs.stringify(query) uri = url.format(parsed) } - return opts.Promise.resolve(body).then(body => fetch(uri, { + if (parsed.searchParams.get('write') === 'true' && method === 'GET') { + // do not cache, because this GET is fetching a rev that will be + // used for a subsequent PUT or DELETE, so we need to conditionally + // update cache. + opts.offline = false + opts.preferOffline = false + opts.preferOnline = true + } + + const doFetch = (body) => fetch(uri, { agent: opts.agent, algorithms: opts.algorithms, body, @@ -96,25 +107,25 @@ function regFetch (uri, opts) { headers, integrity: opts.integrity, key: opts.key, - localAddress: opts['local-address'], - maxSockets: opts.maxsockets, + localAddress: opts.localAddress, + maxSockets: opts.maxSockets, memoize: opts.memoize, - method: opts.method || 'GET', - noProxy: opts['no-proxy'] || opts.noproxy, - Promise: opts.Promise, - proxy: opts['https-proxy'] || opts.proxy, - referer: opts.refer, - retry: opts.retry != null ? opts.retry : { - retries: opts['fetch-retries'], - factor: opts['fetch-retry-factor'], - minTimeout: opts['fetch-retry-mintimeout'], - maxTimeout: opts['fetch-retry-maxtimeout'] + method: method, + noProxy: opts.noProxy, + proxy: opts.httpsProxy || opts.proxy, + retry: opts.retry ? opts.retry : { + retries: opts.fetchRetries, + factor: opts.fetchRetryFactor, + minTimeout: opts.fetchRetryMintimeout, + maxTimeout: opts.fetchRetryMaxtimeout }, - strictSSL: !!opts['strict-ssl'], - timeout: opts.timeout + strictSSL: opts.strictSSL, + timeout: opts.timeout || 30 * 1000 }).then(res => checkResponse( - opts.method || 'GET', res, registry, startTime, opts - ))) + method, res, registry, startTime, opts + )) + + return Promise.resolve(body).then(doFetch) } module.exports.json = fetchJSON @@ -123,22 +134,20 @@ function fetchJSON (uri, opts) { } module.exports.json.stream = fetchJSONStream -function fetchJSONStream (uri, jsonPath, opts) { - opts = config(opts) - const parser = JSONStream.parse(jsonPath, opts.mapJson) - const pt = parser.pipe(new PassThrough({objectMode: true})) - parser.on('error', err => pt.emit('error', err)) - regFetch(uri, opts).then(res => { - res.body.on('error', err => parser.emit('error', err)) - res.body.pipe(parser) - }, err => pt.emit('error', err)) - return pt +function fetchJSONStream (uri, jsonPath, /* istanbul ignore next */ opts_ = {}) { + const opts = { ...defaultOpts, ...opts_ } + const parser = JSONStream.parse(jsonPath, opts.mapJSON) + regFetch(uri, opts).then(res => + res.body.on('error', + /* istanbul ignore next: unlikely and difficult to test */ + er => parser.emit('error', er)).pipe(parser) + ).catch(er => parser.emit('error', er)) + return parser } module.exports.pickRegistry = pickRegistry -function pickRegistry (spec, opts) { +function pickRegistry (spec, opts = {}) { spec = npa(spec) - opts = config(opts) let registry = spec.scope && opts[spec.scope.replace(/^@?/, '@') + ':registry'] @@ -156,35 +165,37 @@ function pickRegistry (spec, opts) { function getCacheMode (opts) { return opts.offline ? 'only-if-cached' - : opts['prefer-offline'] + : opts.preferOffline ? 'force-cache' - : opts['prefer-online'] + : opts.preferOnline ? 'no-cache' : 'default' } function getHeaders (registry, uri, opts) { const headers = Object.assign({ - 'npm-in-ci': !!( - opts['is-from-ci'] || - process.env['CI'] === 'true' || - process.env['TDDIUM'] || - process.env['JENKINS_URL'] || - process.env['bamboo.buildKey'] || - process.env['GO_PIPELINE_NAME'] - ), - 'npm-scope': opts['project-scope'], - 'npm-session': opts['npm-session'], - 'user-agent': opts['user-agent'], - 'referer': opts.refer - }, opts.headers) + 'npm-in-ci': !!opts.isFromCI, + 'user-agent': opts.userAgent + }, opts.headers || {}) + + if (opts.projectScope) { + headers['npm-scope'] = opts.projectScope + } + + if (opts.npmSession) { + headers['npm-session'] = opts.npmSession + } + + if (opts.npmCommand) { + headers['npm-command'] = opts.npmCommand + } const auth = getAuth(registry, opts) // If a tarball is hosted on a different place than the manifest, only send // credentials on `alwaysAuth` const shouldAuth = ( auth.alwaysAuth || - url.parse(uri).host === url.parse(registry).host + new url.URL(uri).host === new url.URL(registry).host ) if (shouldAuth && auth.token) { headers.authorization = `Bearer ${auth.token}` diff --git a/deps/npm/node_modules/npm-registry-fetch/node_modules/safe-buffer/README.md b/deps/npm/node_modules/npm-registry-fetch/node_modules/safe-buffer/README.md deleted file mode 100644 index e9a81afd0406f0..00000000000000 --- a/deps/npm/node_modules/npm-registry-fetch/node_modules/safe-buffer/README.md +++ /dev/null @@ -1,584 +0,0 @@ -# safe-buffer [![travis][travis-image]][travis-url] [![npm][npm-image]][npm-url] [![downloads][downloads-image]][downloads-url] [![javascript style guide][standard-image]][standard-url] - -[travis-image]: https://img.shields.io/travis/feross/safe-buffer/master.svg -[travis-url]: https://travis-ci.org/feross/safe-buffer -[npm-image]: https://img.shields.io/npm/v/safe-buffer.svg -[npm-url]: https://npmjs.org/package/safe-buffer -[downloads-image]: https://img.shields.io/npm/dm/safe-buffer.svg -[downloads-url]: https://npmjs.org/package/safe-buffer -[standard-image]: https://img.shields.io/badge/code_style-standard-brightgreen.svg -[standard-url]: https://standardjs.com - -#### Safer Node.js Buffer API - -**Use the new Node.js Buffer APIs (`Buffer.from`, `Buffer.alloc`, -`Buffer.allocUnsafe`, `Buffer.allocUnsafeSlow`) in all versions of Node.js.** - -**Uses the built-in implementation when available.** - -## install - -``` -npm install safe-buffer -``` - -## usage - -The goal of this package is to provide a safe replacement for the node.js `Buffer`. - -It's a drop-in replacement for `Buffer`. You can use it by adding one `require` line to -the top of your node.js modules: - -```js -var Buffer = require('safe-buffer').Buffer - -// Existing buffer code will continue to work without issues: - -new Buffer('hey', 'utf8') -new Buffer([1, 2, 3], 'utf8') -new Buffer(obj) -new Buffer(16) // create an uninitialized buffer (potentially unsafe) - -// But you can use these new explicit APIs to make clear what you want: - -Buffer.from('hey', 'utf8') // convert from many types to a Buffer -Buffer.alloc(16) // create a zero-filled buffer (safe) -Buffer.allocUnsafe(16) // create an uninitialized buffer (potentially unsafe) -``` - -## api - -### Class Method: Buffer.from(array) - - -* `array` {Array} - -Allocates a new `Buffer` using an `array` of octets. - -```js -const buf = Buffer.from([0x62,0x75,0x66,0x66,0x65,0x72]); - // creates a new Buffer containing ASCII bytes - // ['b','u','f','f','e','r'] -``` - -A `TypeError` will be thrown if `array` is not an `Array`. - -### Class Method: Buffer.from(arrayBuffer[, byteOffset[, length]]) - - -* `arrayBuffer` {ArrayBuffer} The `.buffer` property of a `TypedArray` or - a `new ArrayBuffer()` -* `byteOffset` {Number} Default: `0` -* `length` {Number} Default: `arrayBuffer.length - byteOffset` - -When passed a reference to the `.buffer` property of a `TypedArray` instance, -the newly created `Buffer` will share the same allocated memory as the -TypedArray. - -```js -const arr = new Uint16Array(2); -arr[0] = 5000; -arr[1] = 4000; - -const buf = Buffer.from(arr.buffer); // shares the memory with arr; - -console.log(buf); - // Prints: - -// changing the TypedArray changes the Buffer also -arr[1] = 6000; - -console.log(buf); - // Prints: -``` - -The optional `byteOffset` and `length` arguments specify a memory range within -the `arrayBuffer` that will be shared by the `Buffer`. - -```js -const ab = new ArrayBuffer(10); -const buf = Buffer.from(ab, 0, 2); -console.log(buf.length); - // Prints: 2 -``` - -A `TypeError` will be thrown if `arrayBuffer` is not an `ArrayBuffer`. - -### Class Method: Buffer.from(buffer) - - -* `buffer` {Buffer} - -Copies the passed `buffer` data onto a new `Buffer` instance. - -```js -const buf1 = Buffer.from('buffer'); -const buf2 = Buffer.from(buf1); - -buf1[0] = 0x61; -console.log(buf1.toString()); - // 'auffer' -console.log(buf2.toString()); - // 'buffer' (copy is not changed) -``` - -A `TypeError` will be thrown if `buffer` is not a `Buffer`. - -### Class Method: Buffer.from(str[, encoding]) - - -* `str` {String} String to encode. -* `encoding` {String} Encoding to use, Default: `'utf8'` - -Creates a new `Buffer` containing the given JavaScript string `str`. If -provided, the `encoding` parameter identifies the character encoding. -If not provided, `encoding` defaults to `'utf8'`. - -```js -const buf1 = Buffer.from('this is a tést'); -console.log(buf1.toString()); - // prints: this is a tést -console.log(buf1.toString('ascii')); - // prints: this is a tC)st - -const buf2 = Buffer.from('7468697320697320612074c3a97374', 'hex'); -console.log(buf2.toString()); - // prints: this is a tést -``` - -A `TypeError` will be thrown if `str` is not a string. - -### Class Method: Buffer.alloc(size[, fill[, encoding]]) - - -* `size` {Number} -* `fill` {Value} Default: `undefined` -* `encoding` {String} Default: `utf8` - -Allocates a new `Buffer` of `size` bytes. If `fill` is `undefined`, the -`Buffer` will be *zero-filled*. - -```js -const buf = Buffer.alloc(5); -console.log(buf); - // -``` - -The `size` must be less than or equal to the value of -`require('buffer').kMaxLength` (on 64-bit architectures, `kMaxLength` is -`(2^31)-1`). Otherwise, a [`RangeError`][] is thrown. A zero-length Buffer will -be created if a `size` less than or equal to 0 is specified. - -If `fill` is specified, the allocated `Buffer` will be initialized by calling -`buf.fill(fill)`. See [`buf.fill()`][] for more information. - -```js -const buf = Buffer.alloc(5, 'a'); -console.log(buf); - // -``` - -If both `fill` and `encoding` are specified, the allocated `Buffer` will be -initialized by calling `buf.fill(fill, encoding)`. For example: - -```js -const buf = Buffer.alloc(11, 'aGVsbG8gd29ybGQ=', 'base64'); -console.log(buf); - // -``` - -Calling `Buffer.alloc(size)` can be significantly slower than the alternative -`Buffer.allocUnsafe(size)` but ensures that the newly created `Buffer` instance -contents will *never contain sensitive data*. - -A `TypeError` will be thrown if `size` is not a number. - -### Class Method: Buffer.allocUnsafe(size) - - -* `size` {Number} - -Allocates a new *non-zero-filled* `Buffer` of `size` bytes. The `size` must -be less than or equal to the value of `require('buffer').kMaxLength` (on 64-bit -architectures, `kMaxLength` is `(2^31)-1`). Otherwise, a [`RangeError`][] is -thrown. A zero-length Buffer will be created if a `size` less than or equal to -0 is specified. - -The underlying memory for `Buffer` instances created in this way is *not -initialized*. The contents of the newly created `Buffer` are unknown and -*may contain sensitive data*. Use [`buf.fill(0)`][] to initialize such -`Buffer` instances to zeroes. - -```js -const buf = Buffer.allocUnsafe(5); -console.log(buf); - // - // (octets will be different, every time) -buf.fill(0); -console.log(buf); - // -``` - -A `TypeError` will be thrown if `size` is not a number. - -Note that the `Buffer` module pre-allocates an internal `Buffer` instance of -size `Buffer.poolSize` that is used as a pool for the fast allocation of new -`Buffer` instances created using `Buffer.allocUnsafe(size)` (and the deprecated -`new Buffer(size)` constructor) only when `size` is less than or equal to -`Buffer.poolSize >> 1` (floor of `Buffer.poolSize` divided by two). The default -value of `Buffer.poolSize` is `8192` but can be modified. - -Use of this pre-allocated internal memory pool is a key difference between -calling `Buffer.alloc(size, fill)` vs. `Buffer.allocUnsafe(size).fill(fill)`. -Specifically, `Buffer.alloc(size, fill)` will *never* use the internal Buffer -pool, while `Buffer.allocUnsafe(size).fill(fill)` *will* use the internal -Buffer pool if `size` is less than or equal to half `Buffer.poolSize`. The -difference is subtle but can be important when an application requires the -additional performance that `Buffer.allocUnsafe(size)` provides. - -### Class Method: Buffer.allocUnsafeSlow(size) - - -* `size` {Number} - -Allocates a new *non-zero-filled* and non-pooled `Buffer` of `size` bytes. The -`size` must be less than or equal to the value of -`require('buffer').kMaxLength` (on 64-bit architectures, `kMaxLength` is -`(2^31)-1`). Otherwise, a [`RangeError`][] is thrown. A zero-length Buffer will -be created if a `size` less than or equal to 0 is specified. - -The underlying memory for `Buffer` instances created in this way is *not -initialized*. The contents of the newly created `Buffer` are unknown and -*may contain sensitive data*. Use [`buf.fill(0)`][] to initialize such -`Buffer` instances to zeroes. - -When using `Buffer.allocUnsafe()` to allocate new `Buffer` instances, -allocations under 4KB are, by default, sliced from a single pre-allocated -`Buffer`. This allows applications to avoid the garbage collection overhead of -creating many individually allocated Buffers. This approach improves both -performance and memory usage by eliminating the need to track and cleanup as -many `Persistent` objects. - -However, in the case where a developer may need to retain a small chunk of -memory from a pool for an indeterminate amount of time, it may be appropriate -to create an un-pooled Buffer instance using `Buffer.allocUnsafeSlow()` then -copy out the relevant bits. - -```js -// need to keep around a few small chunks of memory -const store = []; - -socket.on('readable', () => { - const data = socket.read(); - // allocate for retained data - const sb = Buffer.allocUnsafeSlow(10); - // copy the data into the new allocation - data.copy(sb, 0, 0, 10); - store.push(sb); -}); -``` - -Use of `Buffer.allocUnsafeSlow()` should be used only as a last resort *after* -a developer has observed undue memory retention in their applications. - -A `TypeError` will be thrown if `size` is not a number. - -### All the Rest - -The rest of the `Buffer` API is exactly the same as in node.js. -[See the docs](https://nodejs.org/api/buffer.html). - - -## Related links - -- [Node.js issue: Buffer(number) is unsafe](https://github.com/nodejs/node/issues/4660) -- [Node.js Enhancement Proposal: Buffer.from/Buffer.alloc/Buffer.zalloc/Buffer() soft-deprecate](https://github.com/nodejs/node-eps/pull/4) - -## Why is `Buffer` unsafe? - -Today, the node.js `Buffer` constructor is overloaded to handle many different argument -types like `String`, `Array`, `Object`, `TypedArrayView` (`Uint8Array`, etc.), -`ArrayBuffer`, and also `Number`. - -The API is optimized for convenience: you can throw any type at it, and it will try to do -what you want. - -Because the Buffer constructor is so powerful, you often see code like this: - -```js -// Convert UTF-8 strings to hex -function toHex (str) { - return new Buffer(str).toString('hex') -} -``` - -***But what happens if `toHex` is called with a `Number` argument?*** - -### Remote Memory Disclosure - -If an attacker can make your program call the `Buffer` constructor with a `Number` -argument, then they can make it allocate uninitialized memory from the node.js process. -This could potentially disclose TLS private keys, user data, or database passwords. - -When the `Buffer` constructor is passed a `Number` argument, it returns an -**UNINITIALIZED** block of memory of the specified `size`. When you create a `Buffer` like -this, you **MUST** overwrite the contents before returning it to the user. - -From the [node.js docs](https://nodejs.org/api/buffer.html#buffer_new_buffer_size): - -> `new Buffer(size)` -> -> - `size` Number -> -> The underlying memory for `Buffer` instances created in this way is not initialized. -> **The contents of a newly created `Buffer` are unknown and could contain sensitive -> data.** Use `buf.fill(0)` to initialize a Buffer to zeroes. - -(Emphasis our own.) - -Whenever the programmer intended to create an uninitialized `Buffer` you often see code -like this: - -```js -var buf = new Buffer(16) - -// Immediately overwrite the uninitialized buffer with data from another buffer -for (var i = 0; i < buf.length; i++) { - buf[i] = otherBuf[i] -} -``` - - -### Would this ever be a problem in real code? - -Yes. It's surprisingly common to forget to check the type of your variables in a -dynamically-typed language like JavaScript. - -Usually the consequences of assuming the wrong type is that your program crashes with an -uncaught exception. But the failure mode for forgetting to check the type of arguments to -the `Buffer` constructor is more catastrophic. - -Here's an example of a vulnerable service that takes a JSON payload and converts it to -hex: - -```js -// Take a JSON payload {str: "some string"} and convert it to hex -var server = http.createServer(function (req, res) { - var data = '' - req.setEncoding('utf8') - req.on('data', function (chunk) { - data += chunk - }) - req.on('end', function () { - var body = JSON.parse(data) - res.end(new Buffer(body.str).toString('hex')) - }) -}) - -server.listen(8080) -``` - -In this example, an http client just has to send: - -```json -{ - "str": 1000 -} -``` - -and it will get back 1,000 bytes of uninitialized memory from the server. - -This is a very serious bug. It's similar in severity to the -[the Heartbleed bug](http://heartbleed.com/) that allowed disclosure of OpenSSL process -memory by remote attackers. - - -### Which real-world packages were vulnerable? - -#### [`bittorrent-dht`](https://www.npmjs.com/package/bittorrent-dht) - -[Mathias Buus](https://github.com/mafintosh) and I -([Feross Aboukhadijeh](http://feross.org/)) found this issue in one of our own packages, -[`bittorrent-dht`](https://www.npmjs.com/package/bittorrent-dht). The bug would allow -anyone on the internet to send a series of messages to a user of `bittorrent-dht` and get -them to reveal 20 bytes at a time of uninitialized memory from the node.js process. - -Here's -[the commit](https://github.com/feross/bittorrent-dht/commit/6c7da04025d5633699800a99ec3fbadf70ad35b8) -that fixed it. We released a new fixed version, created a -[Node Security Project disclosure](https://nodesecurity.io/advisories/68), and deprecated all -vulnerable versions on npm so users will get a warning to upgrade to a newer version. - -#### [`ws`](https://www.npmjs.com/package/ws) - -That got us wondering if there were other vulnerable packages. Sure enough, within a short -period of time, we found the same issue in [`ws`](https://www.npmjs.com/package/ws), the -most popular WebSocket implementation in node.js. - -If certain APIs were called with `Number` parameters instead of `String` or `Buffer` as -expected, then uninitialized server memory would be disclosed to the remote peer. - -These were the vulnerable methods: - -```js -socket.send(number) -socket.ping(number) -socket.pong(number) -``` - -Here's a vulnerable socket server with some echo functionality: - -```js -server.on('connection', function (socket) { - socket.on('message', function (message) { - message = JSON.parse(message) - if (message.type === 'echo') { - socket.send(message.data) // send back the user's message - } - }) -}) -``` - -`socket.send(number)` called on the server, will disclose server memory. - -Here's [the release](https://github.com/websockets/ws/releases/tag/1.0.1) where the issue -was fixed, with a more detailed explanation. Props to -[Arnout Kazemier](https://github.com/3rd-Eden) for the quick fix. Here's the -[Node Security Project disclosure](https://nodesecurity.io/advisories/67). - - -### What's the solution? - -It's important that node.js offers a fast way to get memory otherwise performance-critical -applications would needlessly get a lot slower. - -But we need a better way to *signal our intent* as programmers. **When we want -uninitialized memory, we should request it explicitly.** - -Sensitive functionality should not be packed into a developer-friendly API that loosely -accepts many different types. This type of API encourages the lazy practice of passing -variables in without checking the type very carefully. - -#### A new API: `Buffer.allocUnsafe(number)` - -The functionality of creating buffers with uninitialized memory should be part of another -API. We propose `Buffer.allocUnsafe(number)`. This way, it's not part of an API that -frequently gets user input of all sorts of different types passed into it. - -```js -var buf = Buffer.allocUnsafe(16) // careful, uninitialized memory! - -// Immediately overwrite the uninitialized buffer with data from another buffer -for (var i = 0; i < buf.length; i++) { - buf[i] = otherBuf[i] -} -``` - - -### How do we fix node.js core? - -We sent [a PR to node.js core](https://github.com/nodejs/node/pull/4514) (merged as -`semver-major`) which defends against one case: - -```js -var str = 16 -new Buffer(str, 'utf8') -``` - -In this situation, it's implied that the programmer intended the first argument to be a -string, since they passed an encoding as a second argument. Today, node.js will allocate -uninitialized memory in the case of `new Buffer(number, encoding)`, which is probably not -what the programmer intended. - -But this is only a partial solution, since if the programmer does `new Buffer(variable)` -(without an `encoding` parameter) there's no way to know what they intended. If `variable` -is sometimes a number, then uninitialized memory will sometimes be returned. - -### What's the real long-term fix? - -We could deprecate and remove `new Buffer(number)` and use `Buffer.allocUnsafe(number)` when -we need uninitialized memory. But that would break 1000s of packages. - -~~We believe the best solution is to:~~ - -~~1. Change `new Buffer(number)` to return safe, zeroed-out memory~~ - -~~2. Create a new API for creating uninitialized Buffers. We propose: `Buffer.allocUnsafe(number)`~~ - -#### Update - -We now support adding three new APIs: - -- `Buffer.from(value)` - convert from any type to a buffer -- `Buffer.alloc(size)` - create a zero-filled buffer -- `Buffer.allocUnsafe(size)` - create an uninitialized buffer with given size - -This solves the core problem that affected `ws` and `bittorrent-dht` which is -`Buffer(variable)` getting tricked into taking a number argument. - -This way, existing code continues working and the impact on the npm ecosystem will be -minimal. Over time, npm maintainers can migrate performance-critical code to use -`Buffer.allocUnsafe(number)` instead of `new Buffer(number)`. - - -### Conclusion - -We think there's a serious design issue with the `Buffer` API as it exists today. It -promotes insecure software by putting high-risk functionality into a convenient API -with friendly "developer ergonomics". - -This wasn't merely a theoretical exercise because we found the issue in some of the -most popular npm packages. - -Fortunately, there's an easy fix that can be applied today. Use `safe-buffer` in place of -`buffer`. - -```js -var Buffer = require('safe-buffer').Buffer -``` - -Eventually, we hope that node.js core can switch to this new, safer behavior. We believe -the impact on the ecosystem would be minimal since it's not a breaking change. -Well-maintained, popular packages would be updated to use `Buffer.alloc` quickly, while -older, insecure packages would magically become safe from this attack vector. - - -## links - -- [Node.js PR: buffer: throw if both length and enc are passed](https://github.com/nodejs/node/pull/4514) -- [Node Security Project disclosure for `ws`](https://nodesecurity.io/advisories/67) -- [Node Security Project disclosure for`bittorrent-dht`](https://nodesecurity.io/advisories/68) - - -## credit - -The original issues in `bittorrent-dht` -([disclosure](https://nodesecurity.io/advisories/68)) and -`ws` ([disclosure](https://nodesecurity.io/advisories/67)) were discovered by -[Mathias Buus](https://github.com/mafintosh) and -[Feross Aboukhadijeh](http://feross.org/). - -Thanks to [Adam Baldwin](https://github.com/evilpacket) for helping disclose these issues -and for his work running the [Node Security Project](https://nodesecurity.io/). - -Thanks to [John Hiesey](https://github.com/jhiesey) for proofreading this README and -auditing the code. - - -## license - -MIT. Copyright (C) [Feross Aboukhadijeh](http://feross.org) diff --git a/deps/npm/node_modules/npm-registry-fetch/node_modules/safe-buffer/index.d.ts b/deps/npm/node_modules/npm-registry-fetch/node_modules/safe-buffer/index.d.ts deleted file mode 100644 index e9fed809a5ab51..00000000000000 --- a/deps/npm/node_modules/npm-registry-fetch/node_modules/safe-buffer/index.d.ts +++ /dev/null @@ -1,187 +0,0 @@ -declare module "safe-buffer" { - export class Buffer { - length: number - write(string: string, offset?: number, length?: number, encoding?: string): number; - toString(encoding?: string, start?: number, end?: number): string; - toJSON(): { type: 'Buffer', data: any[] }; - equals(otherBuffer: Buffer): boolean; - compare(otherBuffer: Buffer, targetStart?: number, targetEnd?: number, sourceStart?: number, sourceEnd?: number): number; - copy(targetBuffer: Buffer, targetStart?: number, sourceStart?: number, sourceEnd?: number): number; - slice(start?: number, end?: number): Buffer; - writeUIntLE(value: number, offset: number, byteLength: number, noAssert?: boolean): number; - writeUIntBE(value: number, offset: number, byteLength: number, noAssert?: boolean): number; - writeIntLE(value: number, offset: number, byteLength: number, noAssert?: boolean): number; - writeIntBE(value: number, offset: number, byteLength: number, noAssert?: boolean): number; - readUIntLE(offset: number, byteLength: number, noAssert?: boolean): number; - readUIntBE(offset: number, byteLength: number, noAssert?: boolean): number; - readIntLE(offset: number, byteLength: number, noAssert?: boolean): number; - readIntBE(offset: number, byteLength: number, noAssert?: boolean): number; - readUInt8(offset: number, noAssert?: boolean): number; - readUInt16LE(offset: number, noAssert?: boolean): number; - readUInt16BE(offset: number, noAssert?: boolean): number; - readUInt32LE(offset: number, noAssert?: boolean): number; - readUInt32BE(offset: number, noAssert?: boolean): number; - readInt8(offset: number, noAssert?: boolean): number; - readInt16LE(offset: number, noAssert?: boolean): number; - readInt16BE(offset: number, noAssert?: boolean): number; - readInt32LE(offset: number, noAssert?: boolean): number; - readInt32BE(offset: number, noAssert?: boolean): number; - readFloatLE(offset: number, noAssert?: boolean): number; - readFloatBE(offset: number, noAssert?: boolean): number; - readDoubleLE(offset: number, noAssert?: boolean): number; - readDoubleBE(offset: number, noAssert?: boolean): number; - swap16(): Buffer; - swap32(): Buffer; - swap64(): Buffer; - writeUInt8(value: number, offset: number, noAssert?: boolean): number; - writeUInt16LE(value: number, offset: number, noAssert?: boolean): number; - writeUInt16BE(value: number, offset: number, noAssert?: boolean): number; - writeUInt32LE(value: number, offset: number, noAssert?: boolean): number; - writeUInt32BE(value: number, offset: number, noAssert?: boolean): number; - writeInt8(value: number, offset: number, noAssert?: boolean): number; - writeInt16LE(value: number, offset: number, noAssert?: boolean): number; - writeInt16BE(value: number, offset: number, noAssert?: boolean): number; - writeInt32LE(value: number, offset: number, noAssert?: boolean): number; - writeInt32BE(value: number, offset: number, noAssert?: boolean): number; - writeFloatLE(value: number, offset: number, noAssert?: boolean): number; - writeFloatBE(value: number, offset: number, noAssert?: boolean): number; - writeDoubleLE(value: number, offset: number, noAssert?: boolean): number; - writeDoubleBE(value: number, offset: number, noAssert?: boolean): number; - fill(value: any, offset?: number, end?: number): this; - indexOf(value: string | number | Buffer, byteOffset?: number, encoding?: string): number; - lastIndexOf(value: string | number | Buffer, byteOffset?: number, encoding?: string): number; - includes(value: string | number | Buffer, byteOffset?: number, encoding?: string): boolean; - - /** - * Allocates a new buffer containing the given {str}. - * - * @param str String to store in buffer. - * @param encoding encoding to use, optional. Default is 'utf8' - */ - constructor (str: string, encoding?: string); - /** - * Allocates a new buffer of {size} octets. - * - * @param size count of octets to allocate. - */ - constructor (size: number); - /** - * Allocates a new buffer containing the given {array} of octets. - * - * @param array The octets to store. - */ - constructor (array: Uint8Array); - /** - * Produces a Buffer backed by the same allocated memory as - * the given {ArrayBuffer}. - * - * - * @param arrayBuffer The ArrayBuffer with which to share memory. - */ - constructor (arrayBuffer: ArrayBuffer); - /** - * Allocates a new buffer containing the given {array} of octets. - * - * @param array The octets to store. - */ - constructor (array: any[]); - /** - * Copies the passed {buffer} data onto a new {Buffer} instance. - * - * @param buffer The buffer to copy. - */ - constructor (buffer: Buffer); - prototype: Buffer; - /** - * Allocates a new Buffer using an {array} of octets. - * - * @param array - */ - static from(array: any[]): Buffer; - /** - * When passed a reference to the .buffer property of a TypedArray instance, - * the newly created Buffer will share the same allocated memory as the TypedArray. - * The optional {byteOffset} and {length} arguments specify a memory range - * within the {arrayBuffer} that will be shared by the Buffer. - * - * @param arrayBuffer The .buffer property of a TypedArray or a new ArrayBuffer() - * @param byteOffset - * @param length - */ - static from(arrayBuffer: ArrayBuffer, byteOffset?: number, length?: number): Buffer; - /** - * Copies the passed {buffer} data onto a new Buffer instance. - * - * @param buffer - */ - static from(buffer: Buffer): Buffer; - /** - * Creates a new Buffer containing the given JavaScript string {str}. - * If provided, the {encoding} parameter identifies the character encoding. - * If not provided, {encoding} defaults to 'utf8'. - * - * @param str - */ - static from(str: string, encoding?: string): Buffer; - /** - * Returns true if {obj} is a Buffer - * - * @param obj object to test. - */ - static isBuffer(obj: any): obj is Buffer; - /** - * Returns true if {encoding} is a valid encoding argument. - * Valid string encodings in Node 0.12: 'ascii'|'utf8'|'utf16le'|'ucs2'(alias of 'utf16le')|'base64'|'binary'(deprecated)|'hex' - * - * @param encoding string to test. - */ - static isEncoding(encoding: string): boolean; - /** - * Gives the actual byte length of a string. encoding defaults to 'utf8'. - * This is not the same as String.prototype.length since that returns the number of characters in a string. - * - * @param string string to test. - * @param encoding encoding used to evaluate (defaults to 'utf8') - */ - static byteLength(string: string, encoding?: string): number; - /** - * Returns a buffer which is the result of concatenating all the buffers in the list together. - * - * If the list has no items, or if the totalLength is 0, then it returns a zero-length buffer. - * If the list has exactly one item, then the first item of the list is returned. - * If the list has more than one item, then a new Buffer is created. - * - * @param list An array of Buffer objects to concatenate - * @param totalLength Total length of the buffers when concatenated. - * If totalLength is not provided, it is read from the buffers in the list. However, this adds an additional loop to the function, so it is faster to provide the length explicitly. - */ - static concat(list: Buffer[], totalLength?: number): Buffer; - /** - * The same as buf1.compare(buf2). - */ - static compare(buf1: Buffer, buf2: Buffer): number; - /** - * Allocates a new buffer of {size} octets. - * - * @param size count of octets to allocate. - * @param fill if specified, buffer will be initialized by calling buf.fill(fill). - * If parameter is omitted, buffer will be filled with zeros. - * @param encoding encoding used for call to buf.fill while initalizing - */ - static alloc(size: number, fill?: string | Buffer | number, encoding?: string): Buffer; - /** - * Allocates a new buffer of {size} octets, leaving memory not initialized, so the contents - * of the newly created Buffer are unknown and may contain sensitive data. - * - * @param size count of octets to allocate - */ - static allocUnsafe(size: number): Buffer; - /** - * Allocates a new non-pooled buffer of {size} octets, leaving memory not initialized, so the contents - * of the newly created Buffer are unknown and may contain sensitive data. - * - * @param size count of octets to allocate - */ - static allocUnsafeSlow(size: number): Buffer; - } -} \ No newline at end of file diff --git a/deps/npm/node_modules/npm-registry-fetch/node_modules/safe-buffer/index.js b/deps/npm/node_modules/npm-registry-fetch/node_modules/safe-buffer/index.js deleted file mode 100644 index f8d3ec98852f44..00000000000000 --- a/deps/npm/node_modules/npm-registry-fetch/node_modules/safe-buffer/index.js +++ /dev/null @@ -1,65 +0,0 @@ -/*! safe-buffer. MIT License. Feross Aboukhadijeh */ -/* eslint-disable node/no-deprecated-api */ -var buffer = require('buffer') -var Buffer = buffer.Buffer - -// alternative to using Object.keys for old browsers -function copyProps (src, dst) { - for (var key in src) { - dst[key] = src[key] - } -} -if (Buffer.from && Buffer.alloc && Buffer.allocUnsafe && Buffer.allocUnsafeSlow) { - module.exports = buffer -} else { - // Copy properties from require('buffer') - copyProps(buffer, exports) - exports.Buffer = SafeBuffer -} - -function SafeBuffer (arg, encodingOrOffset, length) { - return Buffer(arg, encodingOrOffset, length) -} - -SafeBuffer.prototype = Object.create(Buffer.prototype) - -// Copy static methods from Buffer -copyProps(Buffer, SafeBuffer) - -SafeBuffer.from = function (arg, encodingOrOffset, length) { - if (typeof arg === 'number') { - throw new TypeError('Argument must not be a number') - } - return Buffer(arg, encodingOrOffset, length) -} - -SafeBuffer.alloc = function (size, fill, encoding) { - if (typeof size !== 'number') { - throw new TypeError('Argument must be a number') - } - var buf = Buffer(size) - if (fill !== undefined) { - if (typeof encoding === 'string') { - buf.fill(fill, encoding) - } else { - buf.fill(fill) - } - } else { - buf.fill(0) - } - return buf -} - -SafeBuffer.allocUnsafe = function (size) { - if (typeof size !== 'number') { - throw new TypeError('Argument must be a number') - } - return Buffer(size) -} - -SafeBuffer.allocUnsafeSlow = function (size) { - if (typeof size !== 'number') { - throw new TypeError('Argument must be a number') - } - return buffer.SlowBuffer(size) -} diff --git a/deps/npm/node_modules/npm-registry-fetch/node_modules/safe-buffer/package.json b/deps/npm/node_modules/npm-registry-fetch/node_modules/safe-buffer/package.json deleted file mode 100644 index 5062922aecfe7c..00000000000000 --- a/deps/npm/node_modules/npm-registry-fetch/node_modules/safe-buffer/package.json +++ /dev/null @@ -1,76 +0,0 @@ -{ - "_from": "safe-buffer@^5.2.0", - "_id": "safe-buffer@5.2.1", - "_inBundle": false, - "_integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", - "_location": "/npm-registry-fetch/safe-buffer", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "safe-buffer@^5.2.0", - "name": "safe-buffer", - "escapedName": "safe-buffer", - "rawSpec": "^5.2.0", - "saveSpec": null, - "fetchSpec": "^5.2.0" - }, - "_requiredBy": [ - "/npm-registry-fetch" - ], - "_resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", - "_shasum": "1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6", - "_spec": "safe-buffer@^5.2.0", - "_where": "/Users/claudiahdz/npm/cli/node_modules/npm-registry-fetch", - "author": { - "name": "Feross Aboukhadijeh", - "email": "feross@feross.org", - "url": "https://feross.org" - }, - "bugs": { - "url": "https://github.com/feross/safe-buffer/issues" - }, - "bundleDependencies": false, - "deprecated": false, - "description": "Safer Node.js Buffer API", - "devDependencies": { - "standard": "*", - "tape": "^5.0.0" - }, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "homepage": "https://github.com/feross/safe-buffer", - "keywords": [ - "buffer", - "buffer allocate", - "node security", - "safe", - "safe-buffer", - "security", - "uninitialized" - ], - "license": "MIT", - "main": "index.js", - "name": "safe-buffer", - "repository": { - "type": "git", - "url": "git://github.com/feross/safe-buffer.git" - }, - "scripts": { - "test": "standard && tape test/*.js" - }, - "types": "index.d.ts", - "version": "5.2.1" -} diff --git a/deps/npm/node_modules/npm-registry-fetch/package.json b/deps/npm/node_modules/npm-registry-fetch/package.json index a5ac4817ff51ba..c68a42286a4511 100644 --- a/deps/npm/node_modules/npm-registry-fetch/package.json +++ b/deps/npm/node_modules/npm-registry-fetch/package.json @@ -1,106 +1,59 @@ { - "_from": "npm-registry-fetch@4.0.7", - "_id": "npm-registry-fetch@4.0.7", - "_inBundle": false, - "_integrity": "sha512-cny9v0+Mq6Tjz+e0erFAB+RYJ/AVGzkjnISiobqP8OWj9c9FLoZZu8/SPSKJWE17F1tk4018wfjV+ZbIbqC7fQ==", - "_location": "/npm-registry-fetch", - "_phantomChildren": {}, - "_requested": { - "type": "version", - "registry": true, - "raw": "npm-registry-fetch@4.0.7", - "name": "npm-registry-fetch", - "escapedName": "npm-registry-fetch", - "rawSpec": "4.0.7", - "saveSpec": null, - "fetchSpec": "4.0.7" - }, - "_requiredBy": [ - "#USER", - "/", - "/libnpm", - "/libnpmaccess", - "/libnpmhook", - "/libnpmorg", - "/libnpmpublish", - "/libnpmsearch", - "/libnpmteam", - "/npm-profile", - "/pacote" - ], - "_resolved": "https://registry.npmjs.org/npm-registry-fetch/-/npm-registry-fetch-4.0.7.tgz", - "_shasum": "57951bf6541e0246b34c9f9a38ab73607c9449d7", - "_spec": "npm-registry-fetch@4.0.7", - "_where": "/Users/ruyadorno/Documents/workspace/cli/latest", - "author": { - "name": "Kat Marchán", - "email": "kzm@sykosomatic.org" - }, - "bugs": { - "url": "https://github.com/npm/registry-fetch/issues" - }, - "bundleDependencies": false, - "config": { - "nyc": { - "exclude": [ - "node_modules/**", - "test/**" - ] - } - }, - "dependencies": { - "JSONStream": "^1.3.4", - "bluebird": "^3.5.1", - "figgy-pudding": "^3.4.1", - "lru-cache": "^5.1.1", - "make-fetch-happen": "^5.0.0", - "npm-package-arg": "^6.1.0", - "safe-buffer": "^5.2.0" - }, - "deprecated": false, + "name": "npm-registry-fetch", + "version": "8.1.4", "description": "Fetch-based http client for use with npm registry APIs", - "devDependencies": { - "cacache": "^12.0.0", - "get-stream": "^4.0.0", - "mkdirp": "^0.5.1", - "nock": "^9.4.3", - "npmlog": "^4.1.2", - "rimraf": "^2.6.2", - "ssri": "^6.0.0", - "standard": "^11.0.1", - "standard-version": "^4.4.0", - "tap": "^12.0.1", - "weallbehave": "^1.2.0", - "weallcontribute": "^1.0.8" - }, + "main": "index.js", "files": [ "*.js", "lib" ], - "homepage": "https://github.com/npm/registry-fetch#readme", + "scripts": { + "postrelease": "npm publish", + "posttest": "standard", + "prepublishOnly": "git push --follow-tags", + "prerelease": "npm t", + "release": "standard-version -s", + "test": "tap" + }, + "repository": "https://github.com/npm/registry-fetch", "keywords": [ "npm", "registry", "fetch" ], - "license": "ISC", - "main": "index.js", - "name": "npm-registry-fetch", - "publishConfig": { - "tag": "latest-v4" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/npm/registry-fetch.git" + "author": { + "name": "Kat Marchán", + "email": "kzm@sykosomatic.org", + "twitter": "maybekatz" }, - "scripts": { - "postrelease": "npm publish && git push --follow-tags", - "posttest": "standard", - "prerelease": "npm t", - "release": "standard-version -s", - "test": "tap -J --coverage test/*.js", - "update-coc": "weallbehave -o . && git add CODE_OF_CONDUCT.md && git commit -m 'docs(coc): updated CODE_OF_CONDUCT.md'", - "update-contrib": "weallcontribute -o . && git add CONTRIBUTING.md && git commit -m 'docs(contributing): updated CONTRIBUTING.md'" + "license": "ISC", + "dependencies": { + "@npmcli/ci-detect": "^1.0.0", + "lru-cache": "^6.0.0", + "make-fetch-happen": "^8.0.9", + "minipass": "^3.1.3", + "minipass-fetch": "^1.3.0", + "minipass-json-stream": "^1.0.1", + "minizlib": "^2.0.0", + "npm-package-arg": "^8.0.0" }, - "version": "4.0.7" + "devDependencies": { + "cacache": "^15.0.0", + "mkdirp": "^0.5.1", + "nock": "^11.7.0", + "npmlog": "^4.1.2", + "require-inject": "^1.4.4", + "rimraf": "^2.6.2", + "ssri": "^8.0.0", + "standard": "^14.3.3", + "standard-version": "^7.1.0", + "tap": "^14.10.7" + }, + "tap": { + "check-coverage": true, + "test-ignore": "test[\\\\/](util|cache)[\\\\/]" + }, + "engines": { + "node": ">=10" + } } diff --git a/deps/npm/node_modules/npm-run-path/index.js b/deps/npm/node_modules/npm-run-path/index.js deleted file mode 100644 index 56f31e47129ed0..00000000000000 --- a/deps/npm/node_modules/npm-run-path/index.js +++ /dev/null @@ -1,39 +0,0 @@ -'use strict'; -const path = require('path'); -const pathKey = require('path-key'); - -module.exports = opts => { - opts = Object.assign({ - cwd: process.cwd(), - path: process.env[pathKey()] - }, opts); - - let prev; - let pth = path.resolve(opts.cwd); - const ret = []; - - while (prev !== pth) { - ret.push(path.join(pth, 'node_modules/.bin')); - prev = pth; - pth = path.resolve(pth, '..'); - } - - // ensure the running `node` binary is used - ret.push(path.dirname(process.execPath)); - - return ret.concat(opts.path).join(path.delimiter); -}; - -module.exports.env = opts => { - opts = Object.assign({ - env: process.env - }, opts); - - const env = Object.assign({}, opts.env); - const path = pathKey({env}); - - opts.path = env[path]; - env[path] = module.exports(opts); - - return env; -}; diff --git a/deps/npm/node_modules/npm-run-path/license b/deps/npm/node_modules/npm-run-path/license deleted file mode 100644 index 654d0bfe943437..00000000000000 --- a/deps/npm/node_modules/npm-run-path/license +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -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/deps/npm/node_modules/npm-run-path/package.json b/deps/npm/node_modules/npm-run-path/package.json deleted file mode 100644 index 461cca14023228..00000000000000 --- a/deps/npm/node_modules/npm-run-path/package.json +++ /dev/null @@ -1,77 +0,0 @@ -{ - "_from": "npm-run-path@^2.0.0", - "_id": "npm-run-path@2.0.2", - "_inBundle": false, - "_integrity": "sha1-NakjLfo11wZ7TLLd8jV7GHFTbF8=", - "_location": "/npm-run-path", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "npm-run-path@^2.0.0", - "name": "npm-run-path", - "escapedName": "npm-run-path", - "rawSpec": "^2.0.0", - "saveSpec": null, - "fetchSpec": "^2.0.0" - }, - "_requiredBy": [ - "/execa" - ], - "_resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-2.0.2.tgz", - "_shasum": "35a9232dfa35d7067b4cb2ddf2357b1871536c5f", - "_spec": "npm-run-path@^2.0.0", - "_where": "/Users/rebecca/code/npm/node_modules/execa", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "bugs": { - "url": "https://github.com/sindresorhus/npm-run-path/issues" - }, - "bundleDependencies": false, - "dependencies": { - "path-key": "^2.0.0" - }, - "deprecated": false, - "description": "Get your PATH prepended with locally installed binaries", - "devDependencies": { - "ava": "*", - "xo": "*" - }, - "engines": { - "node": ">=4" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/sindresorhus/npm-run-path#readme", - "keywords": [ - "npm", - "run", - "path", - "package", - "bin", - "binary", - "binaries", - "script", - "cli", - "command-line", - "execute", - "executable" - ], - "license": "MIT", - "name": "npm-run-path", - "repository": { - "type": "git", - "url": "git+https://github.com/sindresorhus/npm-run-path.git" - }, - "scripts": { - "test": "xo && ava" - }, - "version": "2.0.2", - "xo": { - "esnext": true - } -} diff --git a/deps/npm/node_modules/npm-run-path/readme.md b/deps/npm/node_modules/npm-run-path/readme.md deleted file mode 100644 index 4ff4722a6ce82f..00000000000000 --- a/deps/npm/node_modules/npm-run-path/readme.md +++ /dev/null @@ -1,81 +0,0 @@ -# npm-run-path [![Build Status](https://travis-ci.org/sindresorhus/npm-run-path.svg?branch=master)](https://travis-ci.org/sindresorhus/npm-run-path) - -> Get your [PATH](https://en.wikipedia.org/wiki/PATH_(variable)) prepended with locally installed binaries - -In [npm run scripts](https://docs.npmjs.com/cli/run-script) you can execute locally installed binaries by name. This enables the same outside npm. - - -## Install - -``` -$ npm install --save npm-run-path -``` - - -## Usage - -```js -const childProcess = require('child_process'); -const npmRunPath = require('npm-run-path'); - -console.log(process.env.PATH); -//=> '/usr/local/bin' - -console.log(npmRunPath()); -//=> '/Users/sindresorhus/dev/foo/node_modules/.bin:/Users/sindresorhus/dev/node_modules/.bin:/Users/sindresorhus/node_modules/.bin:/Users/node_modules/.bin:/node_modules/.bin:/usr/local/bin' - -// `foo` is a locally installed binary -childProcess.execFileSync('foo', { - env: npmRunPath.env() -}); -``` - - -## API - -### npmRunPath([options]) - -#### options - -##### cwd - -Type: `string`
    -Default: `process.cwd()` - -Working directory. - -##### path - -Type: `string`
    -Default: [`PATH`](https://github.com/sindresorhus/path-key) - -PATH to be appended.
    -Set it to an empty string to exclude the default PATH. - -### npmRunPath.env([options]) - -#### options - -##### cwd - -Type: `string`
    -Default: `process.cwd()` - -Working directory. - -##### env - -Type: `Object` - -Accepts an object of environment variables, like `process.env`, and modifies the PATH using the correct [PATH key](https://github.com/sindresorhus/path-key). Use this if you're modifying the PATH for use in the `child_process` options. - - -## Related - -- [npm-run-path-cli](https://github.com/sindresorhus/npm-run-path-cli) - CLI for this module -- [execa](https://github.com/sindresorhus/execa) - Execute a locally installed binary - - -## License - -MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/deps/npm/node_modules/npm-user-validate/package.json b/deps/npm/node_modules/npm-user-validate/package.json index 36260f2d26bfc0..0509bab942c20c 100644 --- a/deps/npm/node_modules/npm-user-validate/package.json +++ b/deps/npm/node_modules/npm-user-validate/package.json @@ -1,64 +1,29 @@ { - "_args": [ - [ - "npm-user-validate@1.0.0", - "/Users/rebecca/code/npm" - ] - ], - "_from": "npm-user-validate@1.0.0", - "_id": "npm-user-validate@1.0.0", - "_inBundle": false, - "_integrity": "sha1-jOyg9c6gTU6TUZ73LQVXp1Ei6VE=", - "_location": "/npm-user-validate", - "_phantomChildren": {}, - "_requested": { - "type": "version", - "registry": true, - "raw": "npm-user-validate@1.0.0", - "name": "npm-user-validate", - "escapedName": "npm-user-validate", - "rawSpec": "1.0.0", - "saveSpec": null, - "fetchSpec": "1.0.0" - }, - "_requiredBy": [ - "/" - ], - "_resolved": "https://registry.npmjs.org/npm-user-validate/-/npm-user-validate-1.0.0.tgz", - "_spec": "1.0.0", - "_where": "/Users/rebecca/code/npm", - "author": { - "name": "Robert Kowalski", - "email": "rok@kowalski.gd" - }, - "bugs": { - "url": "https://github.com/npm/npm-user-validate/issues" - }, + "name": "npm-user-validate", + "version": "1.0.0", "description": "User validations for npm", + "main": "npm-user-validate.js", "devDependencies": { "standard": "^8.4.0", "standard-version": "^3.0.0", "tap": "^7.1.2" }, - "files": [ - "npm-user-validate.js" - ], - "homepage": "https://github.com/npm/npm-user-validate#readme", + "scripts": { + "pretest": "standard", + "test": "tap --100 test/*.js" + }, + "repository": { + "type": "git", + "url": "git://github.com/npm/npm-user-validate.git" + }, "keywords": [ "npm", "validation", "registry" ], + "author": "Robert Kowalski ", "license": "BSD-2-Clause", - "main": "npm-user-validate.js", - "name": "npm-user-validate", - "repository": { - "type": "git", - "url": "git://github.com/npm/npm-user-validate.git" - }, - "scripts": { - "pretest": "standard", - "test": "tap --100 test/*.js" - }, - "version": "1.0.0" + "files": [ + "npm-user-validate.js" + ] } diff --git a/deps/npm/node_modules/npmlog/package.json b/deps/npm/node_modules/npmlog/package.json index c4a470a155b6bf..7220f8e72a3c79 100644 --- a/deps/npm/node_modules/npmlog/package.json +++ b/deps/npm/node_modules/npmlog/package.json @@ -1,41 +1,18 @@ { - "_args": [ - [ - "npmlog@4.1.2", - "/Users/rebecca/code/npm" - ] - ], - "_from": "npmlog@4.1.2", - "_id": "npmlog@4.1.2", - "_inBundle": false, - "_integrity": "sha512-2uUqazuKlTaSI/dC8AzicUck7+IrEaOnN/e0jd3Xtt1KcGpwx30v50mL7oPyr/h9bL3E4aZccVwpwP+5W9Vjkg==", - "_location": "/npmlog", - "_phantomChildren": {}, - "_requested": { - "type": "version", - "registry": true, - "raw": "npmlog@4.1.2", - "name": "npmlog", - "escapedName": "npmlog", - "rawSpec": "4.1.2", - "saveSpec": null, - "fetchSpec": "4.1.2" + "author": "Isaac Z. Schlueter (http://blog.izs.me/)", + "name": "npmlog", + "description": "logger for npm", + "version": "4.1.2", + "repository": { + "type": "git", + "url": "https://github.com/npm/npmlog.git" }, - "_requiredBy": [ - "/", - "/node-gyp", - "/npm-registry-client" + "main": "log.js", + "files": [ + "log.js" ], - "_resolved": "https://registry.npmjs.org/npmlog/-/npmlog-4.1.2.tgz", - "_spec": "4.1.2", - "_where": "/Users/rebecca/code/npm", - "author": { - "name": "Isaac Z. Schlueter", - "email": "i@izs.me", - "url": "http://blog.izs.me/" - }, - "bugs": { - "url": "https://github.com/npm/npmlog/issues" + "scripts": { + "test": "standard && tap test/*.js" }, "dependencies": { "are-we-there-yet": "~1.1.2", @@ -43,24 +20,9 @@ "gauge": "~2.7.3", "set-blocking": "~2.0.0" }, - "description": "logger for npm", "devDependencies": { "standard": "~7.1.2", "tap": "~5.7.3" }, - "files": [ - "log.js" - ], - "homepage": "https://github.com/npm/npmlog#readme", - "license": "ISC", - "main": "log.js", - "name": "npmlog", - "repository": { - "type": "git", - "url": "git+https://github.com/npm/npmlog.git" - }, - "scripts": { - "test": "standard && tap test/*.js" - }, - "version": "4.1.2" + "license": "ISC" } diff --git a/deps/npm/node_modules/number-is-nan/package.json b/deps/npm/node_modules/number-is-nan/package.json index b469c48d08a3a8..d2f51d4b1d621d 100644 --- a/deps/npm/node_modules/number-is-nan/package.json +++ b/deps/npm/node_modules/number-is-nan/package.json @@ -1,52 +1,23 @@ { - "_from": "number-is-nan@^1.0.0", - "_id": "number-is-nan@1.0.1", - "_inBundle": false, - "_integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=", - "_location": "/number-is-nan", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "number-is-nan@^1.0.0", - "name": "number-is-nan", - "escapedName": "number-is-nan", - "rawSpec": "^1.0.0", - "saveSpec": null, - "fetchSpec": "^1.0.0" - }, - "_requiredBy": [ - "/cli-table2/is-fullwidth-code-point", - "/gauge/is-fullwidth-code-point", - "/tacks/is-fullwidth-code-point", - "/wide-align/is-fullwidth-code-point", - "/wrap-ansi/is-fullwidth-code-point" - ], - "_resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", - "_shasum": "097b602b53422a522c1afb8790318336941a011d", - "_spec": "number-is-nan@^1.0.0", - "_where": "/Users/rebecca/code/npm/node_modules/cli-table2/node_modules/is-fullwidth-code-point", + "name": "number-is-nan", + "version": "1.0.1", + "description": "ES2015 Number.isNaN() ponyfill", + "license": "MIT", + "repository": "sindresorhus/number-is-nan", "author": { "name": "Sindre Sorhus", "email": "sindresorhus@gmail.com", "url": "sindresorhus.com" }, - "bugs": { - "url": "https://github.com/sindresorhus/number-is-nan/issues" - }, - "bundleDependencies": false, - "deprecated": false, - "description": "ES2015 Number.isNaN() ponyfill", - "devDependencies": { - "ava": "*" - }, "engines": { "node": ">=0.10.0" }, + "scripts": { + "test": "ava" + }, "files": [ "index.js" ], - "homepage": "https://github.com/sindresorhus/number-is-nan#readme", "keywords": [ "es2015", "ecmascript", @@ -58,14 +29,7 @@ "nan", "not" ], - "license": "MIT", - "name": "number-is-nan", - "repository": { - "type": "git", - "url": "git+https://github.com/sindresorhus/number-is-nan.git" - }, - "scripts": { - "test": "ava" - }, - "version": "1.0.1" + "devDependencies": { + "ava": "*" + } } diff --git a/deps/npm/node_modules/oauth-sign/package.json b/deps/npm/node_modules/oauth-sign/package.json index 6b12e5a8768a25..036d2b0bc6687a 100644 --- a/deps/npm/node_modules/oauth-sign/package.json +++ b/deps/npm/node_modules/oauth-sign/package.json @@ -1,56 +1,23 @@ { - "_from": "oauth-sign@~0.9.0", - "_id": "oauth-sign@0.9.0", - "_inBundle": false, - "_integrity": "sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==", - "_location": "/oauth-sign", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "oauth-sign@~0.9.0", - "name": "oauth-sign", - "escapedName": "oauth-sign", - "rawSpec": "~0.9.0", - "saveSpec": null, - "fetchSpec": "~0.9.0" - }, - "_requiredBy": [ - "/request" - ], - "_resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz", - "_shasum": "47a7b016baa68b5fa0ecf3dee08a85c679ac6455", - "_spec": "oauth-sign@~0.9.0", - "_where": "/Users/zkat/Documents/code/work/npm/node_modules/request", - "author": { - "name": "Mikeal Rogers", - "email": "mikeal.rogers@gmail.com", - "url": "http://www.futurealoof.com" - }, - "bugs": { - "url": "https://github.com/mikeal/oauth-sign/issues" - }, - "bundleDependencies": false, - "dependencies": {}, - "deprecated": false, + "author": "Mikeal Rogers (http://www.futurealoof.com)", + "name": "oauth-sign", "description": "OAuth 1 signing. Formerly a vendor lib in mikeal/request, now a standalone module.", - "devDependencies": {}, - "engines": { - "node": "*" + "version": "0.9.0", + "license": "Apache-2.0", + "repository": { + "url": "https://github.com/mikeal/oauth-sign" }, + "main": "index.js", "files": [ "index.js" ], - "homepage": "https://github.com/mikeal/oauth-sign#readme", - "license": "Apache-2.0", - "main": "index.js", - "name": "oauth-sign", + "dependencies": {}, + "devDependencies": {}, "optionalDependencies": {}, - "repository": { - "url": "git+https://github.com/mikeal/oauth-sign.git" + "engines": { + "node": "*" }, "scripts": { "test": "node test.js" - }, - "version": "0.9.0" + } } diff --git a/deps/npm/node_modules/object-assign/package.json b/deps/npm/node_modules/object-assign/package.json index ad356bfb59faf0..503eb1e6d0f5a1 100644 --- a/deps/npm/node_modules/object-assign/package.json +++ b/deps/npm/node_modules/object-assign/package.json @@ -1,56 +1,24 @@ { - "_from": "object-assign@^4.1.0", - "_id": "object-assign@4.1.1", - "_inBundle": false, - "_integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", - "_location": "/object-assign", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "object-assign@^4.1.0", - "name": "object-assign", - "escapedName": "object-assign", - "rawSpec": "^4.1.0", - "saveSpec": null, - "fetchSpec": "^4.1.0" - }, - "_requiredBy": [ - "/del", - "/fbjs", - "/file-entry-cache", - "/gauge", - "/globby", - "/prop-types" - ], - "_resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", - "_shasum": "2109adc7965887cfc05cbbd442cac8bfbb360863", - "_spec": "object-assign@^4.1.0", - "_where": "/Users/rebecca/code/npm/node_modules/gauge", + "name": "object-assign", + "version": "4.1.1", + "description": "ES2015 `Object.assign()` ponyfill", + "license": "MIT", + "repository": "sindresorhus/object-assign", "author": { "name": "Sindre Sorhus", "email": "sindresorhus@gmail.com", "url": "sindresorhus.com" }, - "bugs": { - "url": "https://github.com/sindresorhus/object-assign/issues" - }, - "bundleDependencies": false, - "deprecated": false, - "description": "ES2015 `Object.assign()` ponyfill", - "devDependencies": { - "ava": "^0.16.0", - "lodash": "^4.16.4", - "matcha": "^0.7.0", - "xo": "^0.16.0" - }, "engines": { "node": ">=0.10.0" }, + "scripts": { + "test": "xo && ava", + "bench": "matcha bench.js" + }, "files": [ "index.js" ], - "homepage": "https://github.com/sindresorhus/object-assign#readme", "keywords": [ "object", "assign", @@ -65,15 +33,10 @@ "shim", "browser" ], - "license": "MIT", - "name": "object-assign", - "repository": { - "type": "git", - "url": "git+https://github.com/sindresorhus/object-assign.git" - }, - "scripts": { - "bench": "matcha bench.js", - "test": "xo && ava" - }, - "version": "4.1.1" + "devDependencies": { + "ava": "^0.16.0", + "lodash": "^4.16.4", + "matcha": "^0.7.0", + "xo": "^0.16.0" + } } diff --git a/deps/npm/node_modules/object-keys/.editorconfig b/deps/npm/node_modules/object-keys/.editorconfig deleted file mode 100644 index eaa214161f5cdb..00000000000000 --- a/deps/npm/node_modules/object-keys/.editorconfig +++ /dev/null @@ -1,13 +0,0 @@ -root = true - -[*] -indent_style = tab; -insert_final_newline = true; -quote_type = auto; -space_after_anonymous_functions = true; -space_after_control_statements = true; -spaces_around_operators = true; -trim_trailing_whitespace = true; -spaces_in_brackets = false; -end_of_line = lf; - diff --git a/deps/npm/node_modules/object-keys/.jscs.json b/deps/npm/node_modules/object-keys/.jscs.json deleted file mode 100644 index 47828965125a06..00000000000000 --- a/deps/npm/node_modules/object-keys/.jscs.json +++ /dev/null @@ -1,175 +0,0 @@ -{ - "es3": true, - - "additionalRules": [], - - "requireSemicolons": true, - - "disallowMultipleSpaces": true, - - "disallowIdentifierNames": [], - - "requireCurlyBraces": { - "allExcept": [], - "keywords": ["if", "else", "for", "while", "do", "try", "catch"] - }, - - "requireSpaceAfterKeywords": ["if", "else", "for", "while", "do", "switch", "return", "try", "catch", "function"], - - "disallowSpaceAfterKeywords": [], - - "disallowSpaceBeforeComma": true, - "disallowSpaceAfterComma": false, - "disallowSpaceBeforeSemicolon": true, - - "disallowNodeTypes": [ - "DebuggerStatement", - "LabeledStatement", - "SwitchCase", - "SwitchStatement", - "WithStatement" - ], - - "requireObjectKeysOnNewLine": { "allExcept": ["sameLine"] }, - - "requireSpacesInAnonymousFunctionExpression": { "beforeOpeningRoundBrace": true, "beforeOpeningCurlyBrace": true }, - "requireSpacesInNamedFunctionExpression": { "beforeOpeningCurlyBrace": true }, - "disallowSpacesInNamedFunctionExpression": { "beforeOpeningRoundBrace": true }, - "requireSpacesInFunctionDeclaration": { "beforeOpeningCurlyBrace": true }, - "disallowSpacesInFunctionDeclaration": { "beforeOpeningRoundBrace": true }, - - "requireSpaceBetweenArguments": true, - - "disallowSpacesInsideParentheses": true, - - "disallowSpacesInsideArrayBrackets": true, - - "disallowQuotedKeysInObjects": { "allExcept": ["reserved"] }, - - "disallowSpaceAfterObjectKeys": true, - - "requireCommaBeforeLineBreak": true, - - "disallowSpaceAfterPrefixUnaryOperators": ["++", "--", "+", "-", "~", "!"], - "requireSpaceAfterPrefixUnaryOperators": [], - - "disallowSpaceBeforePostfixUnaryOperators": ["++", "--"], - "requireSpaceBeforePostfixUnaryOperators": [], - - "disallowSpaceBeforeBinaryOperators": [], - "requireSpaceBeforeBinaryOperators": ["+", "-", "/", "*", "=", "==", "===", "!=", "!=="], - - "requireSpaceAfterBinaryOperators": ["+", "-", "/", "*", "=", "==", "===", "!=", "!=="], - "disallowSpaceAfterBinaryOperators": [], - - "disallowImplicitTypeConversion": ["binary", "string"], - - "disallowKeywords": ["with", "eval"], - - "requireKeywordsOnNewLine": [], - "disallowKeywordsOnNewLine": ["else"], - - "requireLineFeedAtFileEnd": true, - - "disallowTrailingWhitespace": true, - - "disallowTrailingComma": true, - - "excludeFiles": ["node_modules/**", "vendor/**"], - - "disallowMultipleLineStrings": true, - - "requireDotNotation": { "allExcept": ["keywords"] }, - - "requireParenthesesAroundIIFE": true, - - "validateLineBreaks": "LF", - - "validateQuoteMarks": { - "escape": true, - "mark": "'" - }, - - "disallowOperatorBeforeLineBreak": [], - - "requireSpaceBeforeKeywords": [ - "do", - "for", - "if", - "else", - "switch", - "case", - "try", - "catch", - "finally", - "while", - "with", - "return" - ], - - "validateAlignedFunctionParameters": { - "lineBreakAfterOpeningBraces": true, - "lineBreakBeforeClosingBraces": true - }, - - "requirePaddingNewLinesBeforeExport": true, - - "validateNewlineAfterArrayElements": { - "maximum": 7 - }, - - "requirePaddingNewLinesAfterUseStrict": true, - - "disallowArrowFunctions": true, - - "disallowMultiLineTernary": true, - - "validateOrderInObjectKeys": "asc-insensitive", - - "disallowIdenticalDestructuringNames": true, - - "disallowNestedTernaries": { "maxLevel": 1 }, - - "requireSpaceAfterComma": { "allExcept": ["trailing"] }, - "requireAlignedMultilineParams": false, - - "requireSpacesInGenerator": { - "afterStar": true - }, - - "disallowSpacesInGenerator": { - "beforeStar": true - }, - - "disallowVar": false, - - "requireArrayDestructuring": false, - - "requireEnhancedObjectLiterals": false, - - "requireObjectDestructuring": false, - - "requireEarlyReturn": false, - - "requireCapitalizedConstructorsNew": { - "allExcept": ["Function", "String", "Object", "Symbol", "Number", "Date", "RegExp", "Error", "Boolean", "Array"] - }, - - "requireImportAlphabetized": false, - - "requireSpaceBeforeObjectValues": true, - "requireSpaceBeforeDestructuredValues": true, - - "disallowSpacesInsideTemplateStringPlaceholders": true, - - "disallowArrayDestructuringReturn": false, - - "requireNewlineBeforeSingleStatementsInIf": false, - - "disallowUnusedVariables": true, - - "requireSpacesInsideImportedObjectBraces": true, - - "requireUseStrict": true -} - diff --git a/deps/npm/node_modules/object-keys/.travis.yml b/deps/npm/node_modules/object-keys/.travis.yml deleted file mode 100644 index 767256c8dd4843..00000000000000 --- a/deps/npm/node_modules/object-keys/.travis.yml +++ /dev/null @@ -1,225 +0,0 @@ -language: node_js -os: - - linux -node_js: - - "10.4" - - "9.11" - - "8.11" - - "7.10" - - "6.14" - - "5.12" - - "4.9" - - "iojs-v3.3" - - "iojs-v2.5" - - "iojs-v1.8" - - "0.12" - - "0.10" - - "0.8" -before_install: - - 'case "${TRAVIS_NODE_VERSION}" in 0.*) export NPM_CONFIG_STRICT_SSL=false ;; esac' - - 'nvm install-latest-npm' -install: - - 'if [ "${TRAVIS_NODE_VERSION}" = "0.6" ] || [ "${TRAVIS_NODE_VERSION}" = "0.9" ]; then nvm install --latest-npm 0.8 && npm install && nvm use "${TRAVIS_NODE_VERSION}"; else npm install; fi;' -script: - - 'if [ -n "${PRETEST-}" ]; then npm run pretest ; fi' - - 'if [ -n "${POSTTEST-}" ]; then npm run posttest ; fi' - - 'if [ -n "${COVERAGE-}" ]; then npm run coverage ; fi' - - 'if [ -n "${TEST-}" ]; then npm run tests-only ; fi' -sudo: false -env: - - TEST=true -matrix: - fast_finish: true - include: - - node_js: "lts/*" - env: PRETEST=true - - node_js: "lts/*" - env: POSTTEST=true - - node_js: "4" - env: COVERAGE=true - - node_js: "10.3" - env: TEST=true ALLOW_FAILURE=true - - node_js: "10.2" - env: TEST=true ALLOW_FAILURE=true - - node_js: "10.1" - env: TEST=true ALLOW_FAILURE=true - - node_js: "10.0" - env: TEST=true ALLOW_FAILURE=true - - node_js: "9.10" - env: TEST=true ALLOW_FAILURE=true - - node_js: "9.9" - env: TEST=true ALLOW_FAILURE=true - - node_js: "9.8" - env: TEST=true ALLOW_FAILURE=true - - node_js: "9.7" - env: TEST=true ALLOW_FAILURE=true - - node_js: "9.6" - env: TEST=true ALLOW_FAILURE=true - - node_js: "9.5" - env: TEST=true ALLOW_FAILURE=true - - node_js: "9.4" - env: TEST=true ALLOW_FAILURE=true - - node_js: "9.3" - env: TEST=true ALLOW_FAILURE=true - - node_js: "9.2" - env: TEST=true ALLOW_FAILURE=true - - node_js: "9.1" - env: TEST=true ALLOW_FAILURE=true - - node_js: "9.0" - env: TEST=true ALLOW_FAILURE=true - - node_js: "8.10" - env: TEST=true ALLOW_FAILURE=true - - node_js: "8.9" - env: TEST=true ALLOW_FAILURE=true - - node_js: "8.8" - env: TEST=true ALLOW_FAILURE=true - - node_js: "8.7" - env: TEST=true ALLOW_FAILURE=true - - node_js: "8.6" - env: TEST=true ALLOW_FAILURE=true - - node_js: "8.5" - env: TEST=true ALLOW_FAILURE=true - - node_js: "8.4" - env: TEST=true ALLOW_FAILURE=true - - node_js: "8.3" - env: TEST=true ALLOW_FAILURE=true - - node_js: "8.2" - env: TEST=true ALLOW_FAILURE=true - - node_js: "8.1" - env: TEST=true ALLOW_FAILURE=true - - node_js: "8.0" - env: TEST=true ALLOW_FAILURE=true - - node_js: "7.9" - env: TEST=true ALLOW_FAILURE=true - - node_js: "7.8" - env: TEST=true ALLOW_FAILURE=true - - node_js: "7.7" - env: TEST=true ALLOW_FAILURE=true - - node_js: "7.6" - env: TEST=true ALLOW_FAILURE=true - - node_js: "7.5" - env: TEST=true ALLOW_FAILURE=true - - node_js: "7.4" - env: TEST=true ALLOW_FAILURE=true - - node_js: "7.3" - env: TEST=true ALLOW_FAILURE=true - - node_js: "7.2" - env: TEST=true ALLOW_FAILURE=true - - node_js: "7.1" - env: TEST=true ALLOW_FAILURE=true - - node_js: "7.0" - env: TEST=true ALLOW_FAILURE=true - - node_js: "6.13" - env: TEST=true ALLOW_FAILURE=true - - node_js: "6.12" - env: TEST=true ALLOW_FAILURE=true - - node_js: "6.11" - env: TEST=true ALLOW_FAILURE=true - - node_js: "6.10" - env: TEST=true ALLOW_FAILURE=true - - node_js: "6.9" - env: TEST=true ALLOW_FAILURE=true - - node_js: "6.8" - env: TEST=true ALLOW_FAILURE=true - - node_js: "6.7" - env: TEST=true ALLOW_FAILURE=true - - node_js: "6.6" - env: TEST=true ALLOW_FAILURE=true - - node_js: "6.5" - env: TEST=true ALLOW_FAILURE=true - - node_js: "6.4" - env: TEST=true ALLOW_FAILURE=true - - node_js: "6.3" - env: TEST=true ALLOW_FAILURE=true - - node_js: "6.2" - env: TEST=true ALLOW_FAILURE=true - - node_js: "6.1" - env: TEST=true ALLOW_FAILURE=true - - node_js: "6.0" - env: TEST=true ALLOW_FAILURE=true - - node_js: "5.11" - env: TEST=true ALLOW_FAILURE=true - - node_js: "5.10" - env: TEST=true ALLOW_FAILURE=true - - node_js: "5.9" - env: TEST=true ALLOW_FAILURE=true - - node_js: "5.8" - env: TEST=true ALLOW_FAILURE=true - - node_js: "5.7" - env: TEST=true ALLOW_FAILURE=true - - node_js: "5.6" - env: TEST=true ALLOW_FAILURE=true - - node_js: "5.5" - env: TEST=true ALLOW_FAILURE=true - - node_js: "5.4" - env: TEST=true ALLOW_FAILURE=true - - node_js: "5.3" - env: TEST=true ALLOW_FAILURE=true - - node_js: "5.2" - env: TEST=true ALLOW_FAILURE=true - - node_js: "5.1" - env: TEST=true ALLOW_FAILURE=true - - node_js: "5.0" - env: TEST=true ALLOW_FAILURE=true - - node_js: "4.8" - env: TEST=true ALLOW_FAILURE=true - - node_js: "4.7" - env: TEST=true ALLOW_FAILURE=true - - node_js: "4.6" - env: TEST=true ALLOW_FAILURE=true - - node_js: "4.5" - env: TEST=true ALLOW_FAILURE=true - - node_js: "4.4" - env: TEST=true ALLOW_FAILURE=true - - node_js: "4.3" - env: TEST=true ALLOW_FAILURE=true - - node_js: "4.2" - env: TEST=true ALLOW_FAILURE=true - - node_js: "4.1" - env: TEST=true ALLOW_FAILURE=true - - node_js: "4.0" - env: TEST=true ALLOW_FAILURE=true - - node_js: "iojs-v3.2" - env: TEST=true ALLOW_FAILURE=true - - node_js: "iojs-v3.1" - env: TEST=true ALLOW_FAILURE=true - - node_js: "iojs-v3.0" - env: TEST=true ALLOW_FAILURE=true - - node_js: "iojs-v2.4" - env: TEST=true ALLOW_FAILURE=true - - node_js: "iojs-v2.3" - env: TEST=true ALLOW_FAILURE=true - - node_js: "iojs-v2.2" - env: TEST=true ALLOW_FAILURE=true - - node_js: "iojs-v2.1" - env: TEST=true ALLOW_FAILURE=true - - node_js: "iojs-v2.0" - env: TEST=true ALLOW_FAILURE=true - - node_js: "iojs-v1.7" - env: TEST=true ALLOW_FAILURE=true - - node_js: "iojs-v1.6" - env: TEST=true ALLOW_FAILURE=true - - node_js: "iojs-v1.5" - env: TEST=true ALLOW_FAILURE=true - - node_js: "iojs-v1.4" - env: TEST=true ALLOW_FAILURE=true - - node_js: "iojs-v1.3" - env: TEST=true ALLOW_FAILURE=true - - node_js: "iojs-v1.2" - env: TEST=true ALLOW_FAILURE=true - - node_js: "iojs-v1.1" - env: TEST=true ALLOW_FAILURE=true - - node_js: "iojs-v1.0" - env: TEST=true ALLOW_FAILURE=true - - node_js: "0.11" - env: TEST=true ALLOW_FAILURE=true - - node_js: "0.9" - env: TEST=true ALLOW_FAILURE=true - - node_js: "0.6" - env: TEST=true ALLOW_FAILURE=true - - node_js: "0.4" - env: TEST=true ALLOW_FAILURE=true - allow_failures: - - os: osx - - env: TEST=true ALLOW_FAILURE=true - - env: COVERAGE=true diff --git a/deps/npm/node_modules/object-keys/CHANGELOG.md b/deps/npm/node_modules/object-keys/CHANGELOG.md deleted file mode 100644 index 27123c475ef665..00000000000000 --- a/deps/npm/node_modules/object-keys/CHANGELOG.md +++ /dev/null @@ -1,220 +0,0 @@ -1.0.12 / 2018-06-18 -================= - * [Fix] avoid accessing `window.applicationCache`, to avoid issues with latest Chrome on HTTP (#46) - -1.0.11 / 2016-07-05 -================= - * [Fix] exclude keys regarding the style (eg. `pageYOffset`) on `window` to avoid reflow (#32) - -1.0.10 / 2016-07-04 -================= - * [Fix] exclude `height` and `width` keys on `window` to avoid reflow (#31) - * [Fix] In IE 6, `window.external` makes `Object.keys` throw - * [Tests] up to `node` `v6.2`, `v5.10`, `v4.4` - * [Tests] use pretest/posttest for linting/security - * [Dev Deps] update `tape`, `jscs`, `nsp`, `eslint`, `@ljharb/eslint-config` - * [Dev Deps] remove unused eccheck script + dep - -1.0.9 / 2015-10-19 -================= - * [Fix] Blacklist 'frame' property on window (#16, #17) - * [Dev Deps] update `jscs`, `eslint`, `@ljharb/eslint-config` - -1.0.8 / 2015-10-14 -================= - * [Fix] wrap automation equality bug checking in try/catch, per [es5-shim#327](https://github.com/es-shims/es5-shim/issues/327) - * [Fix] Blacklist 'window.frameElement' per [es5-shim#322](https://github.com/es-shims/es5-shim/issues/322) - * [Docs] Switch from vb.teelaun.ch to versionbadg.es for the npm version badge SVG - * [Tests] up to `io.js` `v3.3`, `node` `v4.2` - * [Dev Deps] update `eslint`, `tape`, `@ljharb/eslint-config`, `jscs` - -1.0.7 / 2015-07-18 -================= - * [Fix] A proper fix for 176f03335e90d5c8d0d8125a99f27819c9b9cdad / https://github.com/es-shims/es5-shim/issues/275 that doesn't break dontEnum/constructor fixes in IE 8. - * [Fix] Remove deprecation message in Chrome by touching deprecated window properties (#15) - * [Tests] Improve test output for automation equality bugfix - * [Tests] Test on `io.js` `v2.4` - -1.0.6 / 2015-07-09 -================= - * [Fix] Use an object lookup rather than ES5's `indexOf` (#14) - * [Tests] ES3 browsers don't have `Array.isArray` - * [Tests] Fix `no-shadow` rule, as well as an IE 8 bug caused by engine NFE shadowing bugs. - -1.0.5 / 2015-07-03 -================= - * [Fix] Fix a flabbergasting IE 8 bug where `localStorage.constructor.prototype === localStorage` throws - * [Tests] Test up to `io.js` `v2.3` - * [Dev Deps] Update `nsp`, `eslint` - -1.0.4 / 2015-05-23 -================= - * Fix a Safari 5.0 bug with `Object.keys` not working with `arguments` - * Test on latest `node` and `io.js` - * Update `jscs`, `tape`, `eslint`, `nsp`, `is`, `editorconfig-tools`, `covert` - -1.0.3 / 2015-01-06 -================= - * Revert "Make `object-keys` more robust against later environment tampering" to maintain ES3 compliance - -1.0.2 / 2014-12-28 -================= - * Update lots of dev dependencies - * Tweaks to README - * Make `object-keys` more robust against later environment tampering - -1.0.1 / 2014-09-03 -================= - * Update URLs and badges in README - -1.0.0 / 2014-08-26 -================= - * v1.0.0 - -0.6.1 / 2014-08-25 -================= - * v0.6.1 - * Updating dependencies (tape, covert, is) - * Update badges in readme - * Use separate var statements - -0.6.0 / 2014-04-23 -================= - * v0.6.0 - * Updating dependencies (tape, covert) - * Make sure boxed primitives, and arguments objects, work properly in ES3 browsers - * Improve test matrix: test all node versions, but only latest two stables are a failure - * Remove internal foreach shim. - -0.5.1 / 2014-03-09 -================= - * 0.5.1 - * Updating dependencies (tape, covert, is) - * Removing forEach from the module (but keeping it in tests) - -0.5.0 / 2014-01-30 -================= - * 0.5.0 - * Explicitly returning the shim, instead of returning native Object.keys when present - * Adding a changelog. - * Cleaning up IIFE wrapping - * Testing on node 0.4 through 0.11 - -0.4.0 / 2013-08-14 -================== - - * v0.4.0 - * In Chrome 4-10 and Safari 4, typeof (new RegExp) === 'function' - * If it's a string, make sure to use charAt instead of brackets. - * Only use Function#call if necessary. - * Making sure the context tests actually run. - * Better function detection - * Adding the android browser - * Fixing testling files - * Updating tape - * Removing the "is" dependency. - * Making an isArguments shim. - * Adding a local forEach shim and tests. - * Updating paths. - * Moving the shim test. - * v0.3.0 - -0.3.0 / 2013-05-18 -================== - - * README tweak. - * Fixing constructor enum issue. Fixes [#5](https://github.com/ljharb/object-keys/issues/5). - * Adding a test for [#5](https://github.com/ljharb/object-keys/issues/5) - * Updating readme. - * Updating dependencies. - * Giving credit to lodash. - * Make sure that a prototype's constructor property is not enumerable. Fixes [#3](https://github.com/ljharb/object-keys/issues/3). - * Adding additional tests to handle arguments objects, and to skip "prototype" in functions. Fixes [#2](https://github.com/ljharb/object-keys/issues/2). - * Fixing a typo on this test for [#3](https://github.com/ljharb/object-keys/issues/3). - * Adding node 0.10 to travis. - * Adding an IE < 9 test per [#3](https://github.com/ljharb/object-keys/issues/3) - * Adding an iOS 5 mobile Safari test per [#2](https://github.com/ljharb/object-keys/issues/2) - * Moving "indexof" and "is" to be dev dependencies. - * Making sure the shim works with functions. - * Flattening the tests. - -0.2.0 / 2013-05-10 -================== - - * v0.2.0 - * Object.keys should work with arrays. - -0.1.8 / 2013-05-10 -================== - - * v0.1.8 - * Upgrading dependencies. - * Using a simpler check. - * Fixing a bug in hasDontEnumBug browsers. - * Using the newest tape! - * Fixing this error test. - * "undefined" is probably a reserved word in ES3. - * Better test message. - -0.1.7 / 2013-04-17 -================== - - * Upgrading "is" once more. - * The key "null" is breaking some browsers. - -0.1.6 / 2013-04-17 -================== - - * v0.1.6 - * Upgrading "is" - -0.1.5 / 2013-04-14 -================== - - * Bumping version. - * Adding more testling browsers. - * Updating "is" - -0.1.4 / 2013-04-08 -================== - - * Using "is" instead of "is-extended". - -0.1.3 / 2013-04-07 -================== - - * Using "foreach" instead of my own shim. - * Removing "tap"; I'll just wait for "tape" to fix its node 0.10 bug. - -0.1.2 / 2013-04-03 -================== - - * Adding dependency status; moving links to an index at the bottom. - * Upgrading is-extended; version 0.1.2 - * Adding an npm version badge. - -0.1.1 / 2013-04-01 -================== - - * Adding Travis CI. - * Bumping the version. - * Adding indexOf since IE sucks. - * Adding a forEach shim since older browsers don't have Array#forEach. - * Upgrading tape - 0.3.2 uses Array#map - * Using explicit end instead of plan. - * Can't test with Array.isArray in older browsers. - * Using is-extended. - * Fixing testling files. - * JSHint/JSLint-ing. - * Removing an unused object. - * Using strict mode. - -0.1.0 / 2013-03-30 -================== - - * Changing the exports should have meant a higher version bump. - * Oops, fixing the repo URL. - * Adding more tests. - * 0.0.2 - * Merge branch 'export_one_thing'; closes [#1](https://github.com/ljharb/object-keys/issues/1) - * Move shim export to a separate file. diff --git a/deps/npm/node_modules/object-keys/LICENSE b/deps/npm/node_modules/object-keys/LICENSE deleted file mode 100644 index 28553fdd06841b..00000000000000 --- a/deps/npm/node_modules/object-keys/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (C) 2013 Jordan Harband - -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/deps/npm/node_modules/object-keys/README.md b/deps/npm/node_modules/object-keys/README.md deleted file mode 100644 index ed4c277023a8a4..00000000000000 --- a/deps/npm/node_modules/object-keys/README.md +++ /dev/null @@ -1,76 +0,0 @@ -#object-keys [![Version Badge][npm-version-svg]][package-url] - -[![Build Status][travis-svg]][travis-url] -[![dependency status][deps-svg]][deps-url] -[![dev dependency status][dev-deps-svg]][dev-deps-url] -[![License][license-image]][license-url] -[![Downloads][downloads-image]][downloads-url] - -[![npm badge][npm-badge-png]][package-url] - -[![browser support][testling-svg]][testling-url] - -An Object.keys shim. Invoke its "shim" method to shim Object.keys if it is unavailable. - -Most common usage: -```js -var keys = Object.keys || require('object-keys'); -``` - -## Example - -```js -var keys = require('object-keys'); -var assert = require('assert'); -var obj = { - a: true, - b: true, - c: true -}; - -assert.deepEqual(keys(obj), ['a', 'b', 'c']); -``` - -```js -var keys = require('object-keys'); -var assert = require('assert'); -/* when Object.keys is not present */ -delete Object.keys; -var shimmedKeys = keys.shim(); -assert.equal(shimmedKeys, keys); -assert.deepEqual(Object.keys(obj), keys(obj)); -``` - -```js -var keys = require('object-keys'); -var assert = require('assert'); -/* when Object.keys is present */ -var shimmedKeys = keys.shim(); -assert.equal(shimmedKeys, Object.keys); -assert.deepEqual(Object.keys(obj), keys(obj)); -``` - -## Source -Implementation taken directly from [es5-shim][es5-shim-url], with modifications, including from [lodash][lodash-url]. - -## Tests -Simply clone the repo, `npm install`, and run `npm test` - -[package-url]: https://npmjs.org/package/object-keys -[npm-version-svg]: http://versionbadg.es/ljharb/object-keys.svg -[travis-svg]: https://travis-ci.org/ljharb/object-keys.svg -[travis-url]: https://travis-ci.org/ljharb/object-keys -[deps-svg]: https://david-dm.org/ljharb/object-keys.svg -[deps-url]: https://david-dm.org/ljharb/object-keys -[dev-deps-svg]: https://david-dm.org/ljharb/object-keys/dev-status.svg -[dev-deps-url]: https://david-dm.org/ljharb/object-keys#info=devDependencies -[testling-svg]: https://ci.testling.com/ljharb/object-keys.png -[testling-url]: https://ci.testling.com/ljharb/object-keys -[es5-shim-url]: https://github.com/es-shims/es5-shim/blob/master/es5-shim.js#L542-589 -[lodash-url]: https://github.com/lodash/lodash -[npm-badge-png]: https://nodei.co/npm/object-keys.png?downloads=true&stars=true -[license-image]: http://img.shields.io/npm/l/object-keys.svg -[license-url]: LICENSE -[downloads-image]: http://img.shields.io/npm/dm/object-keys.svg -[downloads-url]: http://npm-stat.com/charts.html?package=object-keys - diff --git a/deps/npm/node_modules/object-keys/index.js b/deps/npm/node_modules/object-keys/index.js deleted file mode 100644 index 3f2463eb8040c1..00000000000000 --- a/deps/npm/node_modules/object-keys/index.js +++ /dev/null @@ -1,141 +0,0 @@ -'use strict'; - -// modified from https://github.com/es-shims/es5-shim -var has = Object.prototype.hasOwnProperty; -var toStr = Object.prototype.toString; -var slice = Array.prototype.slice; -var isArgs = require('./isArguments'); -var isEnumerable = Object.prototype.propertyIsEnumerable; -var hasDontEnumBug = !isEnumerable.call({ toString: null }, 'toString'); -var hasProtoEnumBug = isEnumerable.call(function () {}, 'prototype'); -var dontEnums = [ - 'toString', - 'toLocaleString', - 'valueOf', - 'hasOwnProperty', - 'isPrototypeOf', - 'propertyIsEnumerable', - 'constructor' -]; -var equalsConstructorPrototype = function (o) { - var ctor = o.constructor; - return ctor && ctor.prototype === o; -}; -var excludedKeys = { - $applicationCache: true, - $console: true, - $external: true, - $frame: true, - $frameElement: true, - $frames: true, - $innerHeight: true, - $innerWidth: true, - $outerHeight: true, - $outerWidth: true, - $pageXOffset: true, - $pageYOffset: true, - $parent: true, - $scrollLeft: true, - $scrollTop: true, - $scrollX: true, - $scrollY: true, - $self: true, - $webkitIndexedDB: true, - $webkitStorageInfo: true, - $window: true -}; -var hasAutomationEqualityBug = (function () { - /* global window */ - if (typeof window === 'undefined') { return false; } - for (var k in window) { - try { - if (!excludedKeys['$' + k] && has.call(window, k) && window[k] !== null && typeof window[k] === 'object') { - try { - equalsConstructorPrototype(window[k]); - } catch (e) { - return true; - } - } - } catch (e) { - return true; - } - } - return false; -}()); -var equalsConstructorPrototypeIfNotBuggy = function (o) { - /* global window */ - if (typeof window === 'undefined' || !hasAutomationEqualityBug) { - return equalsConstructorPrototype(o); - } - try { - return equalsConstructorPrototype(o); - } catch (e) { - return false; - } -}; - -var keysShim = function keys(object) { - var isObject = object !== null && typeof object === 'object'; - var isFunction = toStr.call(object) === '[object Function]'; - var isArguments = isArgs(object); - var isString = isObject && toStr.call(object) === '[object String]'; - var theKeys = []; - - if (!isObject && !isFunction && !isArguments) { - throw new TypeError('Object.keys called on a non-object'); - } - - var skipProto = hasProtoEnumBug && isFunction; - if (isString && object.length > 0 && !has.call(object, 0)) { - for (var i = 0; i < object.length; ++i) { - theKeys.push(String(i)); - } - } - - if (isArguments && object.length > 0) { - for (var j = 0; j < object.length; ++j) { - theKeys.push(String(j)); - } - } else { - for (var name in object) { - if (!(skipProto && name === 'prototype') && has.call(object, name)) { - theKeys.push(String(name)); - } - } - } - - if (hasDontEnumBug) { - var skipConstructor = equalsConstructorPrototypeIfNotBuggy(object); - - for (var k = 0; k < dontEnums.length; ++k) { - if (!(skipConstructor && dontEnums[k] === 'constructor') && has.call(object, dontEnums[k])) { - theKeys.push(dontEnums[k]); - } - } - } - return theKeys; -}; - -keysShim.shim = function shimObjectKeys() { - if (Object.keys) { - var keysWorksWithArguments = (function () { - // Safari 5.0 bug - return (Object.keys(arguments) || '').length === 2; - }(1, 2)); - if (!keysWorksWithArguments) { - var originalKeys = Object.keys; - Object.keys = function keys(object) { // eslint-disable-line func-name-matching - if (isArgs(object)) { - return originalKeys(slice.call(object)); - } else { - return originalKeys(object); - } - }; - } - } else { - Object.keys = keysShim; - } - return Object.keys || keysShim; -}; - -module.exports = keysShim; diff --git a/deps/npm/node_modules/object-keys/isArguments.js b/deps/npm/node_modules/object-keys/isArguments.js deleted file mode 100644 index f2a2a9014d925e..00000000000000 --- a/deps/npm/node_modules/object-keys/isArguments.js +++ /dev/null @@ -1,17 +0,0 @@ -'use strict'; - -var toStr = Object.prototype.toString; - -module.exports = function isArguments(value) { - var str = toStr.call(value); - var isArgs = str === '[object Arguments]'; - if (!isArgs) { - isArgs = str !== '[object Array]' && - value !== null && - typeof value === 'object' && - typeof value.length === 'number' && - value.length >= 0 && - toStr.call(value.callee) === '[object Function]'; - } - return isArgs; -}; diff --git a/deps/npm/node_modules/object-keys/package.json b/deps/npm/node_modules/object-keys/package.json deleted file mode 100644 index e988c2db4cbc79..00000000000000 --- a/deps/npm/node_modules/object-keys/package.json +++ /dev/null @@ -1,94 +0,0 @@ -{ - "name": "object-keys", - "version": "1.0.12", - "author": { - "name": "Jordan Harband", - "email": "ljharb@gmail.com", - "url": "http://ljharb.codes" - }, - "contributors": [ - { - "name": "Jordan Harband", - "email": "ljharb@gmail.com", - "url": "http://ljharb.codes" - }, - { - "name": "Raynos", - "email": "raynos2@gmail.com" - }, - { - "name": "Nathan Rajlich", - "email": "nathan@tootallnate.net" - }, - { - "name": "Ivan Starkov", - "email": "istarkov@gmail.com" - }, - { - "name": "Gary Katsevman", - "email": "git@gkatsev.com" - } - ], - "description": "An Object.keys replacement, in case Object.keys is not available. From https://github.com/es-shims/es5-shim", - "license": "MIT", - "main": "index.js", - "scripts": { - "pretest": "npm run --silent lint", - "test": "npm run --silent tests-only", - "posttest": "npm run --silent security", - "tests-only": "node test/index.js", - "coverage": "covert test/*.js", - "coverage-quiet": "covert test/*.js --quiet", - "lint": "npm run --silent jscs && npm run --silent eslint", - "jscs": "jscs test/*.js *.js", - "eslint": "eslint test/*.js *.js", - "security": "nsp check" - }, - "repository": { - "type": "git", - "url": "git://github.com/ljharb/object-keys.git" - }, - "keywords": [ - "Object.keys", - "keys", - "ES5", - "shim" - ], - "dependencies": {}, - "devDependencies": { - "@ljharb/eslint-config": "^12.2.1", - "covert": "^1.1.0", - "eslint": "^4.19.1", - "foreach": "^2.0.5", - "indexof": "^0.0.1", - "is": "^3.2.1", - "jscs": "^3.0.7", - "nsp": "^3.2.1", - "tape": "^4.9.1" - }, - "testling": { - "files": "test/index.js", - "browsers": [ - "iexplore/6.0..latest", - "firefox/3.0..6.0", - "firefox/15.0..latest", - "firefox/nightly", - "chrome/4.0..10.0", - "chrome/20.0..latest", - "chrome/canary", - "opera/10.0..latest", - "opera/next", - "safari/4.0..latest", - "ipad/6.0..latest", - "iphone/6.0..latest", - "android-browser/4.2" - ] - }, - "engines": { - "node": ">= 0.4" - } - -,"_resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.0.12.tgz" -,"_integrity": "sha512-FTMyFUm2wBcGHnH2eXmz7tC6IwlqQZ6mVZ+6dm6vZ4IQIHjs6FdNsQBuKGPuUUUY6NfJw2PshC08Tn6LzLDOag==" -,"_from": "object-keys@1.0.12" -} \ No newline at end of file diff --git a/deps/npm/node_modules/object-keys/test/index.js b/deps/npm/node_modules/object-keys/test/index.js deleted file mode 100644 index 5402465a19b5b6..00000000000000 --- a/deps/npm/node_modules/object-keys/test/index.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; - -require('./isArguments'); - -require('./shim'); diff --git a/deps/npm/node_modules/object.getownpropertydescriptors/.editorconfig b/deps/npm/node_modules/object.getownpropertydescriptors/.editorconfig deleted file mode 100644 index eaa214161f5cdb..00000000000000 --- a/deps/npm/node_modules/object.getownpropertydescriptors/.editorconfig +++ /dev/null @@ -1,13 +0,0 @@ -root = true - -[*] -indent_style = tab; -insert_final_newline = true; -quote_type = auto; -space_after_anonymous_functions = true; -space_after_control_statements = true; -spaces_around_operators = true; -trim_trailing_whitespace = true; -spaces_in_brackets = false; -end_of_line = lf; - diff --git a/deps/npm/node_modules/object.getownpropertydescriptors/.jscs.json b/deps/npm/node_modules/object.getownpropertydescriptors/.jscs.json deleted file mode 100644 index 3d099c4b1192c4..00000000000000 --- a/deps/npm/node_modules/object.getownpropertydescriptors/.jscs.json +++ /dev/null @@ -1,176 +0,0 @@ -{ - "es3": true, - - "additionalRules": [], - - "requireSemicolons": true, - - "disallowMultipleSpaces": true, - - "disallowIdentifierNames": [], - - "requireCurlyBraces": { - "allExcept": [], - "keywords": ["if", "else", "for", "while", "do", "try", "catch"] - }, - - "requireSpaceAfterKeywords": ["if", "else", "for", "while", "do", "switch", "return", "try", "catch", "function"], - - "disallowSpaceAfterKeywords": [], - - "disallowSpaceBeforeComma": true, - "disallowSpaceAfterComma": false, - "disallowSpaceBeforeSemicolon": true, - - "disallowNodeTypes": [ - "DebuggerStatement", - "ForInStatement", - "LabeledStatement", - "SwitchCase", - "SwitchStatement", - "WithStatement" - ], - - "requireObjectKeysOnNewLine": { "allExcept": ["sameLine"] }, - - "requireSpacesInAnonymousFunctionExpression": { "beforeOpeningRoundBrace": true, "beforeOpeningCurlyBrace": true }, - "requireSpacesInNamedFunctionExpression": { "beforeOpeningCurlyBrace": true }, - "disallowSpacesInNamedFunctionExpression": { "beforeOpeningRoundBrace": true }, - "requireSpacesInFunctionDeclaration": { "beforeOpeningCurlyBrace": true }, - "disallowSpacesInFunctionDeclaration": { "beforeOpeningRoundBrace": true }, - - "requireSpaceBetweenArguments": true, - - "disallowSpacesInsideParentheses": true, - - "disallowSpacesInsideArrayBrackets": true, - - "disallowQuotedKeysInObjects": { "allExcept": ["reserved"] }, - - "disallowSpaceAfterObjectKeys": true, - - "requireCommaBeforeLineBreak": true, - - "disallowSpaceAfterPrefixUnaryOperators": ["++", "--", "+", "-", "~", "!"], - "requireSpaceAfterPrefixUnaryOperators": [], - - "disallowSpaceBeforePostfixUnaryOperators": ["++", "--"], - "requireSpaceBeforePostfixUnaryOperators": [], - - "disallowSpaceBeforeBinaryOperators": [], - "requireSpaceBeforeBinaryOperators": ["+", "-", "/", "*", "=", "==", "===", "!=", "!=="], - - "requireSpaceAfterBinaryOperators": ["+", "-", "/", "*", "=", "==", "===", "!=", "!=="], - "disallowSpaceAfterBinaryOperators": [], - - "disallowImplicitTypeConversion": ["binary", "string"], - - "disallowKeywords": ["with", "eval"], - - "requireKeywordsOnNewLine": [], - "disallowKeywordsOnNewLine": ["else"], - - "requireLineFeedAtFileEnd": true, - - "disallowTrailingWhitespace": true, - - "disallowTrailingComma": true, - - "excludeFiles": ["node_modules/**", "vendor/**"], - - "disallowMultipleLineStrings": true, - - "requireDotNotation": { "allExcept": ["keywords"] }, - - "requireParenthesesAroundIIFE": true, - - "validateLineBreaks": "LF", - - "validateQuoteMarks": { - "escape": true, - "mark": "'" - }, - - "disallowOperatorBeforeLineBreak": [], - - "requireSpaceBeforeKeywords": [ - "do", - "for", - "if", - "else", - "switch", - "case", - "try", - "catch", - "finally", - "while", - "with", - "return" - ], - - "validateAlignedFunctionParameters": { - "lineBreakAfterOpeningBraces": true, - "lineBreakBeforeClosingBraces": true - }, - - "requirePaddingNewLinesBeforeExport": true, - - "validateNewlineAfterArrayElements": { - "maximum": 1 - }, - - "requirePaddingNewLinesAfterUseStrict": true, - - "disallowArrowFunctions": true, - - "disallowMultiLineTernary": true, - - "validateOrderInObjectKeys": "asc-insensitive", - - "disallowIdenticalDestructuringNames": true, - - "disallowNestedTernaries": { "maxLevel": 1 }, - - "requireSpaceAfterComma": { "allExcept": ["trailing"] }, - "requireAlignedMultilineParams": false, - - "requireSpacesInGenerator": { - "afterStar": true - }, - - "disallowSpacesInGenerator": { - "beforeStar": true - }, - - "disallowVar": false, - - "requireArrayDestructuring": false, - - "requireEnhancedObjectLiterals": false, - - "requireObjectDestructuring": false, - - "requireEarlyReturn": false, - - "requireCapitalizedConstructorsNew": { - "allExcept": ["Function", "String", "Object", "Symbol", "Number", "Date", "RegExp", "Error", "Boolean", "Array"] - }, - - "requireImportAlphabetized": false, - - "requireSpaceBeforeObjectValues": true, - "requireSpaceBeforeDestructuredValues": true, - - "disallowSpacesInsideTemplateStringPlaceholders": true, - - "disallowArrayDestructuringReturn": false, - - "requireNewlineBeforeSingleStatementsInIf": false, - - "disallowUnusedVariables": true, - - "requireSpacesInsideImportedObjectBraces": true, - - "requireUseStrict": true -} - diff --git a/deps/npm/node_modules/object.getownpropertydescriptors/.npmignore b/deps/npm/node_modules/object.getownpropertydescriptors/.npmignore deleted file mode 100644 index 59d842baa84c8b..00000000000000 --- a/deps/npm/node_modules/object.getownpropertydescriptors/.npmignore +++ /dev/null @@ -1,28 +0,0 @@ -# Logs -logs -*.log - -# Runtime data -pids -*.pid -*.seed - -# Directory for instrumented libs generated by jscoverage/JSCover -lib-cov - -# Coverage directory used by tools like istanbul -coverage - -# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) -.grunt - -# Compiled binary addons (http://nodejs.org/api/addons.html) -build/Release - -# Dependency directory -# Commenting this out is preferred by some people, see -# https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git- -node_modules - -# Users Environment Variables -.lock-wscript diff --git a/deps/npm/node_modules/object.getownpropertydescriptors/.travis.yml b/deps/npm/node_modules/object.getownpropertydescriptors/.travis.yml deleted file mode 100644 index 54ec28b3c4d854..00000000000000 --- a/deps/npm/node_modules/object.getownpropertydescriptors/.travis.yml +++ /dev/null @@ -1,96 +0,0 @@ -language: node_js -node_js: - - "6.2" - - "6.1" - - "6.0" - - "5.12" - - "5.11" - - "5.10" - - "5.9" - - "5.8" - - "5.7" - - "5.6" - - "5.5" - - "5.4" - - "5.3" - - "5.2" - - "5.1" - - "5.0" - - "4.4" - - "4.3" - - "4.2" - - "4.1" - - "4.0" - - "iojs-v3.3" - - "iojs-v3.2" - - "iojs-v3.1" - - "iojs-v3.0" - - "iojs-v2.5" - - "iojs-v2.4" - - "iojs-v2.3" - - "iojs-v2.2" - - "iojs-v2.1" - - "iojs-v2.0" - - "iojs-v1.8" - - "iojs-v1.7" - - "iojs-v1.6" - - "iojs-v1.5" - - "iojs-v1.4" - - "iojs-v1.3" - - "iojs-v1.2" - - "iojs-v1.1" - - "iojs-v1.0" - - "0.12" - - "0.11" - - "0.10" - - "0.9" - - "0.8" - - "0.6" - - "0.4" -before_install: - - 'if [ "${TRAVIS_NODE_VERSION}" != "0.9" ]; then case "$(npm --version)" in 1.*) npm install -g npm@1.4.28 ;; 2.*) npm install -g npm@2 ;; esac ; fi' - - 'if [ "${TRAVIS_NODE_VERSION}" != "0.6" ] && [ "${TRAVIS_NODE_VERSION}" != "0.9" ]; then npm install -g npm; fi' -script: - - 'if [ "${TRAVIS_NODE_VERSION}" != "4.4" ]; then npm run tests-only ; else npm test ; fi' -sudo: false -matrix: - fast_finish: true - allow_failures: - - node_js: "6.1" - - node_js: "6.0" - - node_js: "5.11" - - node_js: "5.10" - - node_js: "5.9" - - node_js: "5.8" - - node_js: "5.7" - - node_js: "5.6" - - node_js: "5.5" - - node_js: "5.4" - - node_js: "5.3" - - node_js: "5.2" - - node_js: "5.1" - - node_js: "5.0" - - node_js: "4.3" - - node_js: "4.2" - - node_js: "4.1" - - node_js: "4.0" - - node_js: "iojs-v3.2" - - node_js: "iojs-v3.1" - - node_js: "iojs-v3.0" - - node_js: "iojs-v2.4" - - node_js: "iojs-v2.3" - - node_js: "iojs-v2.2" - - node_js: "iojs-v2.1" - - node_js: "iojs-v2.0" - - node_js: "iojs-v1.7" - - node_js: "iojs-v1.6" - - node_js: "iojs-v1.5" - - node_js: "iojs-v1.4" - - node_js: "iojs-v1.3" - - node_js: "iojs-v1.2" - - node_js: "iojs-v1.1" - - node_js: "iojs-v1.0" - - node_js: "0.11" - - node_js: "0.9" - - node_js: "0.6" - - node_js: "0.4" diff --git a/deps/npm/node_modules/object.getownpropertydescriptors/CHANGELOG.md b/deps/npm/node_modules/object.getownpropertydescriptors/CHANGELOG.md deleted file mode 100644 index d7c2d15033b3dd..00000000000000 --- a/deps/npm/node_modules/object.getownpropertydescriptors/CHANGELOG.md +++ /dev/null @@ -1,51 +0,0 @@ -2.0.3 / 2016-07-26 -================= - * [Fix] Update implementation to not return `undefined` descriptors - * [Deps] update `es-abstract` - * [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `@es-shims/api`, `jscs`, `nsp`, `tape`, `semver` - * [Dev Deps] remove unused eccheck script + dep - * [Tests] up to `node` `v6.3`, `v5.12`, `v4.4` - * [Tests] use pretest/posttest for linting/security - * Update to stage 4 - -2.0.2 / 2016-01-27 -================= - * [Fix] ensure that `Object.getOwnPropertyDescriptors` does not fail when `Object.prototype` has a poisoned setter (#1, #2) - -2.0.1 / 2016-01-27 -================= - * [Deps] move `@es-shims/api` to dev deps - -2.0.0 / 2016-01-27 -================= - * [Breaking] implement the es-shims API - * [Deps] update `define-properties`, `es-abstract` - * [Dev Deps] update `tape`, `jscs`, `nsp`, `eslint`, `@ljharb/eslint-config`, `semver` - * [Tests] fix npm upgrades in older nodes - * [Tests] up to `node` `v5.5` - * [Docs] Switch from vb.teelaun.ch to versionbadg.es for the npm version badge SVG - -1.0.4 / 2015-07-20 -================= - * [Tests] Test on `io.js` `v2.4` - * [Deps, Dev Deps] Update `define-properties`, `tape`, `eslint`, `semver` - -1.0.3 / 2015-06-28 -================= - * Increase robustness by caching `Array#{concat, reduce}` - * [Deps] Update `define_properties` - * [Dev Deps] Update `eslint`, `semver`, `nsp` - * [Tests] Test up to `io.js` `v2.3` - -1.0.2 / 2015-05-23 -================= - * Update `es-abstract`, `tape`, `eslint`, `jscs`, `semver`, `covert` - * Test up to `io.js` `v2.0` - -1.0.1 / 2015-03-20 -================= - * Update `es-abstract`, `editorconfig-tools`, `nsp`, `eslint`, `semver`, `replace` - -1.0.0 / 2015-02-17 -================= - * v1.0.0 diff --git a/deps/npm/node_modules/object.getownpropertydescriptors/LICENSE b/deps/npm/node_modules/object.getownpropertydescriptors/LICENSE deleted file mode 100644 index b43df444e51828..00000000000000 --- a/deps/npm/node_modules/object.getownpropertydescriptors/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2015 Jordan Harband - -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/object.getownpropertydescriptors/Makefile b/deps/npm/node_modules/object.getownpropertydescriptors/Makefile deleted file mode 100644 index b9e4fe1aab3dde..00000000000000 --- a/deps/npm/node_modules/object.getownpropertydescriptors/Makefile +++ /dev/null @@ -1,61 +0,0 @@ -# Since we rely on paths relative to the makefile location, abort if make isn't being run from there. -$(if $(findstring /,$(MAKEFILE_LIST)),$(error Please only invoke this makefile from the directory it resides in)) - - # The files that need updating when incrementing the version number. -VERSIONED_FILES := *.js *.json README* - - -# Add the local npm packages' bin folder to the PATH, so that `make` can find them, when invoked directly. -# Note that rather than using `$(npm bin)` the 'node_modules/.bin' path component is hard-coded, so that invocation works even from an environment -# where npm is (temporarily) unavailable due to having deactivated an nvm instance loaded into the calling shell in order to avoid interference with tests. -export PATH := $(shell printf '%s' "$$PWD/node_modules/.bin:$$PATH") -UTILS := semver -# Make sure that all required utilities can be located. -UTIL_CHECK := $(or $(shell PATH="$(PATH)" which $(UTILS) >/dev/null && echo 'ok'),$(error Did you forget to run `npm install` after cloning the repo? At least one of the required supporting utilities not found: $(UTILS))) - -# Default target (by virtue of being the first non '.'-prefixed in the file). -.PHONY: _no-target-specified -_no-target-specified: - $(error Please specify the target to make - `make list` shows targets. Alternatively, use `npm test` to run the default tests; `npm run` shows all tests) - -# Lists all targets defined in this makefile. -.PHONY: list -list: - @$(MAKE) -pRrn : -f $(MAKEFILE_LIST) 2>/dev/null | awk -v RS= -F: '/^# File/,/^# Finished Make data base/ {if ($$1 !~ "^[#.]") {print $$1}}' | command grep -v -e '^[^[:alnum:]]' -e '^$@$$command ' | sort - -# All-tests target: invokes the specified test suites for ALL shells defined in $(SHELLS). -.PHONY: test -test: - @npm test - -.PHONY: _ensure-tag -_ensure-tag: -ifndef TAG - $(error Please invoke with `make TAG= release`, where is either an increment specifier (patch, minor, major, prepatch, preminor, premajor, prerelease), or an explicit major.minor.patch version number) -endif - -CHANGELOG_ERROR = $(error No CHANGELOG specified) -.PHONY: _ensure-changelog -_ensure-changelog: - @ (git status -sb --porcelain | command grep -E '^( M|[MA] ) CHANGELOG.md' > /dev/null) || (echo no CHANGELOG.md specified && exit 2) - -# Ensures that the git workspace is clean. -.PHONY: _ensure-clean -_ensure-clean: - @[ -z "$$((git status --porcelain --untracked-files=no || echo err) | command grep -v 'CHANGELOG.md')" ] || { echo "Workspace is not clean; please commit changes first." >&2; exit 2; } - -# Makes a release; invoke with `make TAG= release`. -.PHONY: release -release: _ensure-tag _ensure-changelog _ensure-clean - @old_ver=`git describe --abbrev=0 --tags --match 'v[0-9]*.[0-9]*.[0-9]*'` || { echo "Failed to determine current version." >&2; exit 1; }; old_ver=$${old_ver#v}; \ - new_ver=`echo "$(TAG)" | sed 's/^v//'`; new_ver=$${new_ver:-patch}; \ - if printf "$$new_ver" | command grep -q '^[0-9]'; then \ - semver "$$new_ver" >/dev/null || { echo 'Invalid version number specified: $(TAG) - must be major.minor.patch' >&2; exit 2; }; \ - semver -r "> $$old_ver" "$$new_ver" >/dev/null || { echo 'Invalid version number specified: $(TAG) - must be HIGHER than current one.' >&2; exit 2; } \ - else \ - new_ver=`semver -i "$$new_ver" "$$old_ver"` || { echo 'Invalid version-increment specifier: $(TAG)' >&2; exit 2; } \ - fi; \ - printf "=== Bumping version **$$old_ver** to **$$new_ver** before committing and tagging:\n=== TYPE 'proceed' TO PROCEED, anything else to abort: " && read response && [ "$$response" = 'proceed' ] || { echo 'Aborted.' >&2; exit 2; }; \ - replace "$$old_ver" "$$new_ver" -- $(VERSIONED_FILES) && \ - git commit -m "v$$new_ver" $(VERSIONED_FILES) CHANGELOG.md && \ - git tag -a -m "v$$new_ver" "v$$new_ver" diff --git a/deps/npm/node_modules/object.getownpropertydescriptors/README.md b/deps/npm/node_modules/object.getownpropertydescriptors/README.md deleted file mode 100644 index 0fc6c185a11d7c..00000000000000 --- a/deps/npm/node_modules/object.getownpropertydescriptors/README.md +++ /dev/null @@ -1,99 +0,0 @@ -#object.getownpropertydescriptors [![Version Badge][npm-version-svg]][package-url] - -[![Build Status][travis-svg]][travis-url] -[![dependency status][deps-svg]][deps-url] -[![dev dependency status][dev-deps-svg]][dev-deps-url] -[![License][license-image]][license-url] -[![Downloads][downloads-image]][downloads-url] - -[![npm badge][npm-badge-png]][package-url] - -[![browser support][testling-svg]][testling-url] - -An ES2017 spec-compliant shim for `Object.getOwnPropertyDescriptors` that works in ES5. -Invoke its "shim" method to shim `Object.getOwnPropertyDescriptors` if it is unavailable, and if `Object.getOwnPropertyDescriptor` is available. - -This package implements the [es-shim API](https://github.com/es-shims/api) interface. It works in an ES3-supported environment and complies with the [spec](https://github.com/tc39/ecma262/pull/582). - -## Example - -```js -var getDescriptors = require('object.getownpropertydescriptors'); -var assert = require('assert'); -var obj = { normal: Infinity }; -var enumDescriptor = { - enumerable: false, - writable: false, - configurable: true, - value: true -}; -var writableDescriptor = { - enumerable: true, - writable: true, - configurable: true, - value: 42 -}; -var symbol = Symbol(); -var symDescriptor = { - enumerable: true, - writable: true, - configurable: false, - value: [symbol] -}; - -Object.defineProperty(obj, 'enumerable', enumDescriptor); -Object.defineProperty(obj, 'writable', writableDescriptor); -Object.defineProperty(obj, 'symbol', symDescriptor); - -var descriptors = getDescriptors(obj); - -assert.deepEqual(descriptors, { - normal: { - enumerable: true, - writable: true, - configurable: true, - value: Infinity - }, - enumerable: enumDescriptor, - writable: writableDescriptor, - symbol: symDescriptor -}); -``` - -```js -var getDescriptors = require('object.getownpropertydescriptors'); -var assert = require('assert'); -/* when Object.getOwnPropertyDescriptors is not present */ -delete Object.getOwnPropertyDescriptors; -var shimmedDescriptors = getDescriptors.shim(); -assert.equal(shimmedDescriptors, getDescriptors); -assert.deepEqual(shimmedDescriptors(obj), getDescriptors(obj)); -``` - -```js -var getDescriptors = require('object.getownpropertydescriptors'); -var assert = require('assert'); -/* when Object.getOwnPropertyDescriptors is present */ -var shimmedDescriptors = getDescriptors.shim(); -assert.notEqual(shimmedDescriptors, getDescriptors); -assert.deepEqual(shimmedDescriptors(obj), getDescriptors(obj)); -``` - -## Tests -Simply clone the repo, `npm install`, and run `npm test` - -[package-url]: https://npmjs.org/package/object.getownpropertydescriptors -[npm-version-svg]: http://versionbadg.es/ljharb/object.getownpropertydescriptors.svg -[travis-svg]: https://travis-ci.org/ljharb/object.getownpropertydescriptors.svg -[travis-url]: https://travis-ci.org/ljharb/object.getownpropertydescriptors -[deps-svg]: https://david-dm.org/ljharb/object.getownpropertydescriptors.svg -[deps-url]: https://david-dm.org/ljharb/object.getownpropertydescriptors -[dev-deps-svg]: https://david-dm.org/ljharb/object.getownpropertydescriptors/dev-status.svg -[dev-deps-url]: https://david-dm.org/ljharb/object.getownpropertydescriptors#info=devDependencies -[testling-svg]: https://ci.testling.com/ljharb/object.getownpropertydescriptors.png -[testling-url]: https://ci.testling.com/ljharb/object.getownpropertydescriptors -[npm-badge-png]: https://nodei.co/npm/object.getownpropertydescriptors.png?downloads=true&stars=true -[license-image]: http://img.shields.io/npm/l/object.getownpropertydescriptors.svg -[license-url]: LICENSE -[downloads-image]: http://img.shields.io/npm/dm/object.getownpropertydescriptors.svg -[downloads-url]: http://npm-stat.com/charts.html?package=object.getownpropertydescriptors diff --git a/deps/npm/node_modules/object.getownpropertydescriptors/implementation.js b/deps/npm/node_modules/object.getownpropertydescriptors/implementation.js deleted file mode 100644 index 784c22c99ca3bc..00000000000000 --- a/deps/npm/node_modules/object.getownpropertydescriptors/implementation.js +++ /dev/null @@ -1,44 +0,0 @@ -'use strict'; - -var ES = require('es-abstract/es7'); - -var defineProperty = Object.defineProperty; -var getDescriptor = Object.getOwnPropertyDescriptor; -var getOwnNames = Object.getOwnPropertyNames; -var getSymbols = Object.getOwnPropertySymbols; -var concat = Function.call.bind(Array.prototype.concat); -var reduce = Function.call.bind(Array.prototype.reduce); -var getAll = getSymbols ? function (obj) { - return concat(getOwnNames(obj), getSymbols(obj)); -} : getOwnNames; - -var isES5 = ES.IsCallable(getDescriptor) && ES.IsCallable(getOwnNames); - -var safePut = function put(obj, prop, val) { // eslint-disable-line max-params - if (defineProperty && prop in obj) { - defineProperty(obj, prop, { - configurable: true, - enumerable: true, - value: val, - writable: true - }); - } else { - obj[prop] = val; - } -}; - -module.exports = function getOwnPropertyDescriptors(value) { - ES.RequireObjectCoercible(value); - if (!isES5) { - throw new TypeError('getOwnPropertyDescriptors requires Object.getOwnPropertyDescriptor'); - } - - var O = ES.ToObject(value); - return reduce(getAll(O), function (acc, key) { - var descriptor = getDescriptor(O, key); - if (typeof descriptor !== 'undefined') { - safePut(acc, key, descriptor); - } - return acc; - }, {}); -}; diff --git a/deps/npm/node_modules/object.getownpropertydescriptors/index.js b/deps/npm/node_modules/object.getownpropertydescriptors/index.js deleted file mode 100644 index bf2aec5d5006de..00000000000000 --- a/deps/npm/node_modules/object.getownpropertydescriptors/index.js +++ /dev/null @@ -1,15 +0,0 @@ -'use strict'; - -var define = require('define-properties'); - -var implementation = require('./implementation'); -var getPolyfill = require('./polyfill'); -var shim = require('./shim'); - -define(implementation, { - getPolyfill: getPolyfill, - implementation: implementation, - shim: shim -}); - -module.exports = implementation; diff --git a/deps/npm/node_modules/object.getownpropertydescriptors/package.json b/deps/npm/node_modules/object.getownpropertydescriptors/package.json deleted file mode 100644 index fb1bdfa934009f..00000000000000 --- a/deps/npm/node_modules/object.getownpropertydescriptors/package.json +++ /dev/null @@ -1,107 +0,0 @@ -{ - "_from": "object.getownpropertydescriptors@^2.0.3", - "_id": "object.getownpropertydescriptors@2.0.3", - "_inBundle": false, - "_integrity": "sha1-h1jIRvW0B62rDyNuCYbxSwUcqhY=", - "_location": "/object.getownpropertydescriptors", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "object.getownpropertydescriptors@^2.0.3", - "name": "object.getownpropertydescriptors", - "escapedName": "object.getownpropertydescriptors", - "rawSpec": "^2.0.3", - "saveSpec": null, - "fetchSpec": "^2.0.3" - }, - "_requiredBy": [ - "/util-promisify" - ], - "_resolved": "https://registry.npmjs.org/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.0.3.tgz", - "_shasum": "8758c846f5b407adab0f236e0986f14b051caa16", - "_spec": "object.getownpropertydescriptors@^2.0.3", - "_where": "/Users/isaacs/dev/npm/cli/node_modules/util-promisify", - "author": { - "name": "Jordan Harband" - }, - "bugs": { - "url": "https://github.com/ljharb/object.getownpropertydescriptors/issues" - }, - "bundleDependencies": false, - "dependencies": { - "define-properties": "^1.1.2", - "es-abstract": "^1.5.1" - }, - "deprecated": false, - "description": "ES2017 spec-compliant shim for `Object.getOwnPropertyDescriptors` that works in ES5.", - "devDependencies": { - "@es-shims/api": "^1.2.0", - "@ljharb/eslint-config": "^6.0.0", - "covert": "^1.1.0", - "eslint": "^3.1.1", - "jscs": "^3.0.7", - "nsp": "^2.6.1", - "replace": "^0.3.0", - "semver": "^5.3.0", - "tape": "^4.6.0" - }, - "engines": { - "node": ">= 0.8" - }, - "homepage": "https://github.com/ljharb/object.getownpropertydescriptors#readme", - "keywords": [ - "Object.getOwnPropertyDescriptors", - "descriptor", - "property descriptor", - "ES8", - "ES2017", - "shim", - "polyfill", - "getOwnPropertyDescriptor", - "es-shim API" - ], - "license": "MIT", - "main": "index.js", - "name": "object.getownpropertydescriptors", - "repository": { - "type": "git", - "url": "git://github.com/ljharb/object.getownpropertydescriptors.git" - }, - "scripts": { - "coverage": "covert test/*.js", - "coverage:quiet": "covert test/*.js --quiet", - "eslint": "eslint test/*.js *.js", - "jscs": "jscs test/*.js *.js", - "lint": "npm run --silent jscs && npm run --silent eslint", - "posttest": "npm run --silent security", - "pretest": "npm run --silent lint && es-shim-api", - "security": "nsp check", - "test": "npm run --silent tests-only", - "test:module": "node test/index.js", - "test:shimmed": "node test/shimmed.js", - "tests-only": "npm run --silent test:shimmed && npm run --silent test:module" - }, - "testling": { - "files": [ - "test/index.js", - "test/shimmed.js" - ], - "browsers": [ - "iexplore/9.0..latest", - "firefox/4.0..6.0", - "firefox/15.0..latest", - "firefox/nightly", - "chrome/5.0..10.0", - "chrome/20.0..latest", - "chrome/canary", - "opera/12.0..latest", - "opera/next", - "safari/5.0..latest", - "ipad/6.0..latest", - "iphone/6.0..latest", - "android-browser/4.2" - ] - }, - "version": "2.0.3" -} diff --git a/deps/npm/node_modules/object.getownpropertydescriptors/polyfill.js b/deps/npm/node_modules/object.getownpropertydescriptors/polyfill.js deleted file mode 100644 index 0424acfb1c862f..00000000000000 --- a/deps/npm/node_modules/object.getownpropertydescriptors/polyfill.js +++ /dev/null @@ -1,7 +0,0 @@ -'use strict'; - -var implementation = require('./implementation'); - -module.exports = function getPolyfill() { - return typeof Object.getOwnPropertyDescriptors === 'function' ? Object.getOwnPropertyDescriptors : implementation; -}; diff --git a/deps/npm/node_modules/object.getownpropertydescriptors/shim.js b/deps/npm/node_modules/object.getownpropertydescriptors/shim.js deleted file mode 100644 index 799c7d3c2477a8..00000000000000 --- a/deps/npm/node_modules/object.getownpropertydescriptors/shim.js +++ /dev/null @@ -1,14 +0,0 @@ -'use strict'; - -var getPolyfill = require('./polyfill'); -var define = require('define-properties'); - -module.exports = function shimGetOwnPropertyDescriptors() { - var polyfill = getPolyfill(); - define( - Object, - { getOwnPropertyDescriptors: polyfill }, - { getOwnPropertyDescriptors: function () { return Object.getOwnPropertyDescriptors !== polyfill; } } - ); - return polyfill; -}; diff --git a/deps/npm/node_modules/object.getownpropertydescriptors/test/index.js b/deps/npm/node_modules/object.getownpropertydescriptors/test/index.js deleted file mode 100644 index 618a205064d935..00000000000000 --- a/deps/npm/node_modules/object.getownpropertydescriptors/test/index.js +++ /dev/null @@ -1,17 +0,0 @@ -'use strict'; - -var getDescriptors = require('../'); -var test = require('tape'); -var runTests = require('./tests'); - -test('as a function', function (t) { - t.test('bad object/this value', function (st) { - st.throws(function () { return getDescriptors(undefined); }, TypeError, 'undefined is not an object'); - st.throws(function () { return getDescriptors(null); }, TypeError, 'null is not an object'); - st.end(); - }); - - runTests(getDescriptors, t); - - t.end(); -}); diff --git a/deps/npm/node_modules/object.getownpropertydescriptors/test/shimmed.js b/deps/npm/node_modules/object.getownpropertydescriptors/test/shimmed.js deleted file mode 100644 index c9af4c1d3853f7..00000000000000 --- a/deps/npm/node_modules/object.getownpropertydescriptors/test/shimmed.js +++ /dev/null @@ -1,35 +0,0 @@ -'use strict'; - -var getDescriptors = require('../'); -getDescriptors.shim(); - -var test = require('tape'); -var defineProperties = require('define-properties'); -var runTests = require('./tests'); -var isEnumerable = Object.prototype.propertyIsEnumerable; -var functionsHaveNames = function f() {}.name === 'f'; - -test('shimmed', function (t) { - t.equal(Object.getOwnPropertyDescriptors.length, 1, 'Object.getOwnPropertyDescriptors has a length of 1'); - t.test('Function name', { skip: !functionsHaveNames }, function (st) { - st.equal(Object.getOwnPropertyDescriptors.name, 'getOwnPropertyDescriptors', 'Object.getOwnPropertyDescriptors has name "getOwnPropertyDescriptors"'); - st.end(); - }); - - t.test('enumerability', { skip: !defineProperties.supportsDescriptors }, function (et) { - et.equal(false, isEnumerable.call(Object, 'getOwnPropertyDescriptors'), 'Object.getOwnPropertyDescriptors is not enumerable'); - et.end(); - }); - - var supportsStrictMode = (function () { return typeof this === 'undefined'; }()); - - t.test('bad object/this value', { skip: !supportsStrictMode }, function (st) { - st.throws(function () { return getDescriptors(undefined, 'a'); }, TypeError, 'undefined is not an object'); - st.throws(function () { return getDescriptors(null, 'a'); }, TypeError, 'null is not an object'); - st.end(); - }); - - runTests(Object.getOwnPropertyDescriptors, t); - - t.end(); -}); diff --git a/deps/npm/node_modules/object.getownpropertydescriptors/test/tests.js b/deps/npm/node_modules/object.getownpropertydescriptors/test/tests.js deleted file mode 100644 index b9aa29edf71cb0..00000000000000 --- a/deps/npm/node_modules/object.getownpropertydescriptors/test/tests.js +++ /dev/null @@ -1,127 +0,0 @@ -'use strict'; - -module.exports = function (getDescriptors, t) { - var enumDescriptor = { - configurable: true, - enumerable: false, - value: true, - writable: false - }; - var writableDescriptor = { - configurable: true, - enumerable: true, - value: 42, - writable: true - }; - - t.test('works with Object.prototype poisoned setter', { skip: !Object.defineProperty }, function (st) { - var key = 'foo'; - - var obj = {}; - obj[key] = 42; - - var expected = {}; - expected[key] = { - configurable: true, - enumerable: true, - value: 42, - writable: true - }; - - /* eslint-disable no-extend-native, accessor-pairs */ - Object.defineProperty(Object.prototype, key, { configurable: true, set: function (v) { throw new Error(v); } }); - /* eslint-enable no-extend-native, accessor-pairs */ - - var hasOwnNamesBug = false; - try { - Object.getOwnPropertyNames(obj); - } catch (e) { - // v8 in node 0.6 - 0.12 has a bug :-( - hasOwnNamesBug = true; - st.comment('SKIP: this engine has a bug with Object.getOwnPropertyNames: it can not handle a throwing setter on Object.prototype.'); - } - - if (!hasOwnNamesBug) { - st.doesNotThrow(function () { - var result = getDescriptors(obj); - st.deepEqual(result, expected, 'got expected descriptors'); - }); - } - - /* eslint-disable no-extend-native */ - delete Object.prototype[key]; - /* eslint-enable no-extend-native */ - st.end(); - }); - - t.test('gets all expected non-Symbol descriptors', function (st) { - var obj = { normal: Infinity }; - Object.defineProperty(obj, 'enumerable', enumDescriptor); - Object.defineProperty(obj, 'writable', writableDescriptor); - - var descriptors = getDescriptors(obj); - - st.deepEqual(descriptors, { - enumerable: enumDescriptor, - normal: { - configurable: true, - enumerable: true, - value: Infinity, - writable: true - }, - writable: writableDescriptor - }); - st.end(); - }); - - var supportsSymbols = typeof Symbol === 'function' && typeof Symbol() === 'symbol'; - t.test('gets Symbol descriptors too', { skip: !supportsSymbols }, function (st) { - var symbol = Symbol(); - var symDescriptor = { - configurable: false, - enumerable: true, - value: [symbol], - writable: true - }; - var obj = { normal: Infinity }; - Object.defineProperty(obj, 'enumerable', enumDescriptor); - Object.defineProperty(obj, 'writable', writableDescriptor); - Object.defineProperty(obj, 'symbol', symDescriptor); - - var descriptors = getDescriptors(obj); - - st.deepEqual(descriptors, { - enumerable: enumDescriptor, - normal: { - configurable: true, - enumerable: true, - value: Infinity, - writable: true - }, - symbol: symDescriptor, - writable: writableDescriptor - }); - st.end(); - }); - - /* global Proxy */ - var supportsProxy = typeof Proxy === 'function'; - t.test('Proxies that return an undefined descriptor', { skip: !supportsProxy }, function (st) { - var obj = { foo: true }; - var fooDescriptor = Object.getOwnPropertyDescriptor(obj, 'foo'); - - var proxy = new Proxy(obj, { - getOwnPropertyDescriptor: function (target, key) { - return Object.getOwnPropertyDescriptor(target, key); - }, - ownKeys: function () { - return [ - 'foo', - 'bar' - ]; - } - }); - st.deepEqual(getDescriptors(proxy), { foo: fooDescriptor }, 'object has no descriptors'); - st.end(); - }); -}; diff --git a/deps/npm/node_modules/once/package.json b/deps/npm/node_modules/once/package.json index 63ac415a1fc4ee..16815b2fa11193 100644 --- a/deps/npm/node_modules/once/package.json +++ b/deps/npm/node_modules/once/package.json @@ -1,80 +1,33 @@ { - "_args": [ - [ - "once@1.4.0", - "/Users/rebecca/code/npm" - ] - ], - "_from": "once@1.4.0", - "_id": "once@1.4.0", - "_inBundle": false, - "_integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", - "_location": "/once", - "_phantomChildren": {}, - "_requested": { - "type": "version", - "registry": true, - "raw": "once@1.4.0", - "name": "once", - "escapedName": "once", - "rawSpec": "1.4.0", - "saveSpec": null, - "fetchSpec": "1.4.0" - }, - "_requiredBy": [ - "/", - "/end-of-stream", - "/glob", - "/inflight", - "/npm-profile/mississippi/pump", - "/npm-profile/pump", - "/npm-registry-client", - "/npm-registry-fetch/pump", - "/pump", - "/pumpify/pump", - "/read-package-tree", - "/readdir-scoped-modules" - ], - "_resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "_spec": "1.4.0", - "_where": "/Users/rebecca/code/npm", - "author": { - "name": "Isaac Z. Schlueter", - "email": "i@izs.me", - "url": "http://blog.izs.me/" - }, - "bugs": { - "url": "https://github.com/isaacs/once/issues" + "name": "once", + "version": "1.4.0", + "description": "Run a function exactly one time", + "main": "once.js", + "directories": { + "test": "test" }, "dependencies": { "wrappy": "1" }, - "description": "Run a function exactly one time", "devDependencies": { "tap": "^7.0.1" }, - "directories": { - "test": "test" + "scripts": { + "test": "tap test/*.js" }, "files": [ "once.js" ], - "homepage": "https://github.com/isaacs/once#readme", + "repository": { + "type": "git", + "url": "git://github.com/isaacs/once" + }, "keywords": [ "once", "function", "one", "single" ], - "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" + "author": "Isaac Z. Schlueter (http://blog.izs.me/)", + "license": "ISC" } diff --git a/deps/npm/node_modules/opener/LICENSE.txt b/deps/npm/node_modules/opener/LICENSE.txt index 251b540e2e63ac..f74bd1310f4e02 100644 --- a/deps/npm/node_modules/opener/LICENSE.txt +++ b/deps/npm/node_modules/opener/LICENSE.txt @@ -2,7 +2,7 @@ Dual licensed under WTFPL and MIT: --- -Copyright © 2012–2018 Domenic Denicola +Copyright © 2012–2020 Domenic Denicola This work is free. You can redistribute it and/or modify it under the terms of the Do What The Fuck You Want To Public License, Version 2, @@ -26,7 +26,7 @@ as published by Sam Hocevar. See below for more details. The MIT License (MIT) -Copyright © 2012–2018 Domenic Denicola +Copyright © 2012–2020 Domenic Denicola 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/deps/npm/node_modules/opener/README.md b/deps/npm/node_modules/opener/README.md index 1d81513b160d06..51cc1a28c56d3b 100644 --- a/deps/npm/node_modules/opener/README.md +++ b/deps/npm/node_modules/opener/README.md @@ -34,7 +34,6 @@ editor.stdout.unref(); editor.stderr.unref(); ``` - ## Use It for Good Like opening the user's browser with a test harness in your package's test script: @@ -52,4 +51,4 @@ Like opening the user's browser with a test harness in your package's test scrip ## Why -Because Windows has `start`, Macs have `open`, and *nix has `xdg-open`. At least [according to some guy on StackOverflow](http://stackoverflow.com/q/1480971/3191). And I like things that work on all three. Like Node.js. And Opener. +Because Windows has `start`, Macs have `open`, and *nix has `xdg-open`. At least [according to some person on StackOverflow](http://stackoverflow.com/q/1480971/3191). And I like things that work on all three. Like Node.js. And Opener. diff --git a/deps/npm/node_modules/opener/lib/opener.js b/deps/npm/node_modules/opener/lib/opener.js index 5fa88f375ac854..08888c6bb8a2a7 100644 --- a/deps/npm/node_modules/opener/lib/opener.js +++ b/deps/npm/node_modules/opener/lib/opener.js @@ -55,9 +55,9 @@ module.exports = function opener(args, options, callback) { // Furthermore, if "cmd /c" double-quoted the first parameter, then "start" will interpret it as a window title, // so we need to add a dummy empty-string window title: http://stackoverflow.com/a/154090/3191 // - // Additionally, on Windows ampersand needs to be escaped when passed to "start" + // Additionally, on Windows ampersand and caret need to be escaped when passed to "start" args = args.map(function (value) { - return value.replace(/&/g, "^&"); + return value.replace(/[&^]/g, "^$&"); }); args = ["/c", "start", "\"\""].concat(args); } diff --git a/deps/npm/node_modules/opener/package.json b/deps/npm/node_modules/opener/package.json index e69aa39637e2a5..0af377d15f72a1 100644 --- a/deps/npm/node_modules/opener/package.json +++ b/deps/npm/node_modules/opener/package.json @@ -1,60 +1,20 @@ { - "_from": "opener@1.5.1", - "_id": "opener@1.5.1", - "_inBundle": false, - "_integrity": "sha512-goYSy5c2UXE4Ra1xixabeVh1guIX/ZV/YokJksb6q2lubWu6UbvPQ20p542/sFIll1nl8JnCyK9oBaOcCWXwvA==", - "_location": "/opener", - "_phantomChildren": {}, - "_requested": { - "type": "version", - "registry": true, - "raw": "opener@1.5.1", "name": "opener", - "escapedName": "opener", - "rawSpec": "1.5.1", - "saveSpec": null, - "fetchSpec": "1.5.1" - }, - "_requiredBy": [ - "#USER", - "/", - "/tap" - ], - "_resolved": "https://registry.npmjs.org/opener/-/opener-1.5.1.tgz", - "_shasum": "6d2f0e77f1a0af0032aca716c2c1fbb8e7e8abed", - "_spec": "opener@1.5.1", - "_where": "/Users/rebecca/code/npm", - "author": { - "name": "Domenic Denicola", - "email": "d@domenic.me", - "url": "https://domenic.me/" - }, - "bin": { - "opener": "bin/opener-bin.js" - }, - "bugs": { - "url": "https://github.com/domenic/opener/issues" - }, - "bundleDependencies": false, - "deprecated": false, - "description": "Opens stuff, like webpages and files and executables, cross-platform", - "devDependencies": { - "eslint": "^5.3.0" - }, - "files": [ - "lib/", - "bin/" - ], - "homepage": "https://github.com/domenic/opener#readme", - "license": "(WTFPL OR MIT)", - "main": "lib/opener.js", - "name": "opener", - "repository": { - "type": "git", - "url": "git+https://github.com/domenic/opener.git" - }, - "scripts": { - "lint": "eslint ." - }, - "version": "1.5.1" + "description": "Opens stuff, like webpages and files and executables, cross-platform", + "version": "1.5.2", + "author": "Domenic Denicola (https://domenic.me/)", + "license": "(WTFPL OR MIT)", + "repository": "domenic/opener", + "main": "lib/opener.js", + "bin": "bin/opener-bin.js", + "files": [ + "lib/", + "bin/" + ], + "scripts": { + "lint": "eslint ." + }, + "devDependencies": { + "eslint": "^7.7.0" + } } diff --git a/deps/npm/node_modules/os-homedir/package.json b/deps/npm/node_modules/os-homedir/package.json index 6693be307c3ee3..525b225172f2e9 100644 --- a/deps/npm/node_modules/os-homedir/package.json +++ b/deps/npm/node_modules/os-homedir/package.json @@ -1,51 +1,23 @@ { - "_from": "os-homedir@^1.0.0", - "_id": "os-homedir@1.0.2", - "_inBundle": false, - "_integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M=", - "_location": "/os-homedir", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "os-homedir@^1.0.0", - "name": "os-homedir", - "escapedName": "os-homedir", - "rawSpec": "^1.0.0", - "saveSpec": null, - "fetchSpec": "^1.0.0" - }, - "_requiredBy": [ - "/osenv", - "/tap" - ], - "_resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz", - "_shasum": "ffbc4988336e0e833de0c168c7ef152121aa7fb3", - "_spec": "os-homedir@^1.0.0", - "_where": "/Users/rebecca/code/npm/node_modules/osenv", + "name": "os-homedir", + "version": "1.0.2", + "description": "Node.js 4 `os.homedir()` ponyfill", + "license": "MIT", + "repository": "sindresorhus/os-homedir", "author": { "name": "Sindre Sorhus", "email": "sindresorhus@gmail.com", "url": "sindresorhus.com" }, - "bugs": { - "url": "https://github.com/sindresorhus/os-homedir/issues" - }, - "bundleDependencies": false, - "deprecated": false, - "description": "Node.js 4 `os.homedir()` ponyfill", - "devDependencies": { - "ava": "*", - "path-exists": "^2.0.0", - "xo": "^0.16.0" - }, "engines": { "node": ">=0.10.0" }, + "scripts": { + "test": "xo && ava" + }, "files": [ "index.js" ], - "homepage": "https://github.com/sindresorhus/os-homedir#readme", "keywords": [ "builtin", "core", @@ -61,14 +33,9 @@ "user", "path" ], - "license": "MIT", - "name": "os-homedir", - "repository": { - "type": "git", - "url": "git+https://github.com/sindresorhus/os-homedir.git" - }, - "scripts": { - "test": "xo && ava" - }, - "version": "1.0.2" + "devDependencies": { + "ava": "*", + "path-exists": "^2.0.0", + "xo": "^0.16.0" + } } diff --git a/deps/npm/node_modules/os-tmpdir/package.json b/deps/npm/node_modules/os-tmpdir/package.json index 1e8e86b946f7d4..180a3176b44e4f 100644 --- a/deps/npm/node_modules/os-tmpdir/package.json +++ b/deps/npm/node_modules/os-tmpdir/package.json @@ -1,50 +1,23 @@ { - "_from": "os-tmpdir@^1.0.0", - "_id": "os-tmpdir@1.0.2", - "_inBundle": false, - "_integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=", - "_location": "/os-tmpdir", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "os-tmpdir@^1.0.0", - "name": "os-tmpdir", - "escapedName": "os-tmpdir", - "rawSpec": "^1.0.0", - "saveSpec": null, - "fetchSpec": "^1.0.0" - }, - "_requiredBy": [ - "/osenv", - "/tmp" - ], - "_resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", - "_shasum": "bbe67406c79aa85c5cfec766fe5734555dfa1274", - "_spec": "os-tmpdir@^1.0.0", - "_where": "/Users/rebecca/code/npm/node_modules/osenv", + "name": "os-tmpdir", + "version": "1.0.2", + "description": "Node.js os.tmpdir() ponyfill", + "license": "MIT", + "repository": "sindresorhus/os-tmpdir", "author": { "name": "Sindre Sorhus", "email": "sindresorhus@gmail.com", "url": "sindresorhus.com" }, - "bugs": { - "url": "https://github.com/sindresorhus/os-tmpdir/issues" - }, - "bundleDependencies": false, - "deprecated": false, - "description": "Node.js os.tmpdir() ponyfill", - "devDependencies": { - "ava": "*", - "xo": "^0.16.0" - }, "engines": { "node": ">=0.10.0" }, + "scripts": { + "test": "xo && ava" + }, "files": [ "index.js" ], - "homepage": "https://github.com/sindresorhus/os-tmpdir#readme", "keywords": [ "built-in", "core", @@ -61,14 +34,8 @@ "env", "environment" ], - "license": "MIT", - "name": "os-tmpdir", - "repository": { - "type": "git", - "url": "git+https://github.com/sindresorhus/os-tmpdir.git" - }, - "scripts": { - "test": "xo && ava" - }, - "version": "1.0.2" + "devDependencies": { + "ava": "*", + "xo": "^0.16.0" + } } diff --git a/deps/npm/node_modules/osenv/package.json b/deps/npm/node_modules/osenv/package.json index ed6d0d4c48037a..90898f12cc0ac9 100644 --- a/deps/npm/node_modules/osenv/package.json +++ b/deps/npm/node_modules/osenv/package.json @@ -1,59 +1,24 @@ { - "_args": [ - [ - "osenv@0.1.5", - "/Users/rebecca/code/npm" - ] - ], - "_from": "osenv@0.1.5", - "_id": "osenv@0.1.5", - "_inBundle": false, - "_integrity": "sha512-0CWcCECdMVc2Rw3U5w9ZjqX6ga6ubk1xDVKxtBQPK7wis/0F2r9T6k4ydGYhecl7YUBxBVxhL5oisPsNxAPe2g==", - "_location": "/osenv", - "_phantomChildren": {}, - "_requested": { - "type": "version", - "registry": true, - "raw": "osenv@0.1.5", - "name": "osenv", - "escapedName": "osenv", - "rawSpec": "0.1.5", - "saveSpec": null, - "fetchSpec": "0.1.5" - }, - "_requiredBy": [ - "/", - "/node-gyp", - "/nopt", - "/npm-package-arg", - "/pacote" - ], - "_resolved": "https://registry.npmjs.org/osenv/-/osenv-0.1.5.tgz", - "_spec": "0.1.5", - "_where": "/Users/rebecca/code/npm", - "author": { - "name": "Isaac Z. Schlueter", - "email": "i@izs.me", - "url": "http://blog.izs.me/" - }, - "bugs": { - "url": "https://github.com/npm/osenv/issues" + "name": "osenv", + "version": "0.1.5", + "main": "osenv.js", + "directories": { + "test": "test" }, "dependencies": { "os-homedir": "^1.0.0", "os-tmpdir": "^1.0.0" }, - "description": "Look up environment settings specific to different operating systems", "devDependencies": { "tap": "^11.1.0" }, - "directories": { - "test": "test" + "scripts": { + "test": "tap test/*.js", + "preversion": "npm test", + "postversion": "npm publish", + "postpublish": "git push origin --all; git push origin --tags" }, - "files": [ - "osenv.js" - ], - "homepage": "https://github.com/npm/osenv#readme", + "repository": "https://github.com/npm/osenv", "keywords": [ "environment", "variable", @@ -63,18 +28,10 @@ "prompt", "ps1" ], + "author": "Isaac Z. Schlueter (http://blog.izs.me/)", "license": "ISC", - "main": "osenv.js", - "name": "osenv", - "repository": { - "type": "git", - "url": "git+https://github.com/npm/osenv.git" - }, - "scripts": { - "postpublish": "git push origin --all; git push origin --tags", - "postversion": "npm publish", - "preversion": "npm test", - "test": "tap test/*.js" - }, - "version": "0.1.5" + "description": "Look up environment settings specific to different operating systems", + "files": [ + "osenv.js" + ] } diff --git a/deps/npm/node_modules/p-finally/index.js b/deps/npm/node_modules/p-finally/index.js deleted file mode 100644 index 52b7b49c5f36ce..00000000000000 --- a/deps/npm/node_modules/p-finally/index.js +++ /dev/null @@ -1,15 +0,0 @@ -'use strict'; -module.exports = (promise, onFinally) => { - onFinally = onFinally || (() => {}); - - return promise.then( - val => new Promise(resolve => { - resolve(onFinally()); - }).then(() => val), - err => new Promise(resolve => { - resolve(onFinally()); - }).then(() => { - throw err; - }) - ); -}; diff --git a/deps/npm/node_modules/p-finally/license b/deps/npm/node_modules/p-finally/license deleted file mode 100644 index 654d0bfe943437..00000000000000 --- a/deps/npm/node_modules/p-finally/license +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -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/deps/npm/node_modules/p-finally/package.json b/deps/npm/node_modules/p-finally/package.json deleted file mode 100644 index a4763be4caaba3..00000000000000 --- a/deps/npm/node_modules/p-finally/package.json +++ /dev/null @@ -1,74 +0,0 @@ -{ - "_from": "p-finally@^1.0.0", - "_id": "p-finally@1.0.0", - "_inBundle": false, - "_integrity": "sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4=", - "_location": "/p-finally", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "p-finally@^1.0.0", - "name": "p-finally", - "escapedName": "p-finally", - "rawSpec": "^1.0.0", - "saveSpec": null, - "fetchSpec": "^1.0.0" - }, - "_requiredBy": [ - "/execa" - ], - "_resolved": "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz", - "_shasum": "3fbcfb15b899a44123b34b6dcc18b724336a2cae", - "_spec": "p-finally@^1.0.0", - "_where": "/Users/rebecca/code/npm/node_modules/execa", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "bugs": { - "url": "https://github.com/sindresorhus/p-finally/issues" - }, - "bundleDependencies": false, - "deprecated": false, - "description": "`Promise#finally()` ponyfill - Invoked when the promise is settled regardless of outcome", - "devDependencies": { - "ava": "*", - "xo": "*" - }, - "engines": { - "node": ">=4" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/sindresorhus/p-finally#readme", - "keywords": [ - "promise", - "finally", - "handler", - "function", - "async", - "await", - "promises", - "settled", - "ponyfill", - "polyfill", - "shim", - "bluebird" - ], - "license": "MIT", - "name": "p-finally", - "repository": { - "type": "git", - "url": "git+https://github.com/sindresorhus/p-finally.git" - }, - "scripts": { - "test": "xo && ava" - }, - "version": "1.0.0", - "xo": { - "esnext": true - } -} diff --git a/deps/npm/node_modules/p-finally/readme.md b/deps/npm/node_modules/p-finally/readme.md deleted file mode 100644 index 09ef36416b2f2b..00000000000000 --- a/deps/npm/node_modules/p-finally/readme.md +++ /dev/null @@ -1,47 +0,0 @@ -# p-finally [![Build Status](https://travis-ci.org/sindresorhus/p-finally.svg?branch=master)](https://travis-ci.org/sindresorhus/p-finally) - -> [`Promise#finally()`](https://github.com/tc39/proposal-promise-finally) [ponyfill](https://ponyfill.com) - Invoked when the promise is settled regardless of outcome - -Useful for cleanup. - - -## Install - -``` -$ npm install --save p-finally -``` - - -## Usage - -```js -const pFinally = require('p-finally'); - -const dir = createTempDir(); - -pFinally(write(dir), () => cleanup(dir)); -``` - - -## API - -### pFinally(promise, [onFinally]) - -Returns a `Promise`. - -#### onFinally - -Type: `Function` - -Note: Throwing or returning a rejected promise will reject `promise` with the rejection reason. - - -## Related - -- [p-try](https://github.com/sindresorhus/p-try) - `Promise#try()` ponyfill - Starts a promise chain -- [More…](https://github.com/sindresorhus/promise-fun) - - -## License - -MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/deps/npm/node_modules/p-map/index.d.ts b/deps/npm/node_modules/p-map/index.d.ts new file mode 100644 index 00000000000000..bcbe0afcee88d9 --- /dev/null +++ b/deps/npm/node_modules/p-map/index.d.ts @@ -0,0 +1,67 @@ +declare namespace pMap { + interface Options { + /** + Number of concurrently pending promises returned by `mapper`. + + Must be an integer from 1 and up or `Infinity`. + + @default Infinity + */ + readonly concurrency?: number; + + /** + When set to `false`, instead of stopping when a promise rejects, it will wait for all the promises to settle and then reject with an [aggregated error](https://github.com/sindresorhus/aggregate-error) containing all the errors from the rejected promises. + + @default true + */ + readonly stopOnError?: boolean; + } + + /** + Function which is called for every item in `input`. Expected to return a `Promise` or value. + + @param element - Iterated element. + @param index - Index of the element in the source array. + */ + type Mapper = ( + element: Element, + index: number + ) => NewElement | Promise; +} + +/** +@param input - Iterated over concurrently in the `mapper` function. +@param mapper - Function which is called for every item in `input`. Expected to return a `Promise` or value. +@returns A `Promise` that is fulfilled when all promises in `input` and ones returned from `mapper` are fulfilled, or rejects if any of the promises reject. The fulfilled value is an `Array` of the fulfilled values returned from `mapper` in `input` order. + +@example +``` +import pMap = require('p-map'); +import got = require('got'); + +const sites = [ + getWebsiteFromUsername('https://sindresorhus'), //=> Promise + 'https://ava.li', + 'https://github.com' +]; + +(async () => { + const mapper = async site => { + const {requestUrl} = await got.head(site); + return requestUrl; + }; + + const result = await pMap(sites, mapper, {concurrency: 2}); + + console.log(result); + //=> ['https://sindresorhus.com/', 'https://ava.li/', 'https://github.com/'] +})(); +``` +*/ +declare function pMap( + input: Iterable, + mapper: pMap.Mapper, + options?: pMap.Options +): Promise; + +export = pMap; diff --git a/deps/npm/node_modules/p-map/index.js b/deps/npm/node_modules/p-map/index.js new file mode 100644 index 00000000000000..c11a28512a4733 --- /dev/null +++ b/deps/npm/node_modules/p-map/index.js @@ -0,0 +1,81 @@ +'use strict'; +const AggregateError = require('aggregate-error'); + +module.exports = async ( + iterable, + mapper, + { + concurrency = Infinity, + stopOnError = true + } = {} +) => { + return new Promise((resolve, reject) => { + if (typeof mapper !== 'function') { + throw new TypeError('Mapper function is required'); + } + + if (!((Number.isSafeInteger(concurrency) || concurrency === Infinity) && concurrency >= 1)) { + throw new TypeError(`Expected \`concurrency\` to be an integer from 1 and up or \`Infinity\`, got \`${concurrency}\` (${typeof concurrency})`); + } + + const result = []; + const errors = []; + const iterator = iterable[Symbol.iterator](); + let isRejected = false; + let isIterableDone = false; + let resolvingCount = 0; + let currentIndex = 0; + + const next = () => { + if (isRejected) { + return; + } + + const nextItem = iterator.next(); + const index = currentIndex; + currentIndex++; + + if (nextItem.done) { + isIterableDone = true; + + if (resolvingCount === 0) { + if (!stopOnError && errors.length !== 0) { + reject(new AggregateError(errors)); + } else { + resolve(result); + } + } + + return; + } + + resolvingCount++; + + (async () => { + try { + const element = await nextItem.value; + result[index] = await mapper(element, index); + resolvingCount--; + next(); + } catch (error) { + if (stopOnError) { + isRejected = true; + reject(error); + } else { + errors.push(error); + resolvingCount--; + next(); + } + } + })(); + }; + + for (let i = 0; i < concurrency; i++) { + next(); + + if (isIterableDone) { + break; + } + } + }); +}; diff --git a/deps/npm/node_modules/p-map/license b/deps/npm/node_modules/p-map/license new file mode 100644 index 00000000000000..fa7ceba3eb4a96 --- /dev/null +++ b/deps/npm/node_modules/p-map/license @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) Sindre Sorhus (https://sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/deps/npm/node_modules/p-map/package.json b/deps/npm/node_modules/p-map/package.json new file mode 100644 index 00000000000000..042b1af553f2de --- /dev/null +++ b/deps/npm/node_modules/p-map/package.json @@ -0,0 +1,53 @@ +{ + "name": "p-map", + "version": "4.0.0", + "description": "Map over promises concurrently", + "license": "MIT", + "repository": "sindresorhus/p-map", + "funding": "https://github.com/sponsors/sindresorhus", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "https://sindresorhus.com" + }, + "engines": { + "node": ">=10" + }, + "scripts": { + "test": "xo && ava && tsd" + }, + "files": [ + "index.js", + "index.d.ts" + ], + "keywords": [ + "promise", + "map", + "resolved", + "wait", + "collection", + "iterable", + "iterator", + "race", + "fulfilled", + "async", + "await", + "promises", + "concurrently", + "concurrency", + "parallel", + "bluebird" + ], + "dependencies": { + "aggregate-error": "^3.0.0" + }, + "devDependencies": { + "ava": "^2.2.0", + "delay": "^4.1.0", + "in-range": "^2.0.0", + "random-int": "^2.0.0", + "time-span": "^3.1.0", + "tsd": "^0.7.4", + "xo": "^0.27.2" + } +} diff --git a/deps/npm/node_modules/p-map/readme.md b/deps/npm/node_modules/p-map/readme.md new file mode 100644 index 00000000000000..6c2638ee130a00 --- /dev/null +++ b/deps/npm/node_modules/p-map/readme.md @@ -0,0 +1,89 @@ +# p-map [![Build Status](https://travis-ci.org/sindresorhus/p-map.svg?branch=master)](https://travis-ci.org/sindresorhus/p-map) + +> Map over promises concurrently + +Useful when you need to run promise-returning & async functions multiple times with different inputs concurrently. + +## Install + +``` +$ npm install p-map +``` + +## Usage + +```js +const pMap = require('p-map'); +const got = require('got'); + +const sites = [ + getWebsiteFromUsername('https://sindresorhus'), //=> Promise + 'https://ava.li', + 'https://github.com' +]; + +(async () => { + const mapper = async site => { + const {requestUrl} = await got.head(site); + return requestUrl; + }; + + const result = await pMap(sites, mapper, {concurrency: 2}); + + console.log(result); + //=> ['https://sindresorhus.com/', 'https://ava.li/', 'https://github.com/'] +})(); +``` + +## API + +### pMap(input, mapper, options?) + +Returns a `Promise` that is fulfilled when all promises in `input` and ones returned from `mapper` are fulfilled, or rejects if any of the promises reject. The fulfilled value is an `Array` of the fulfilled values returned from `mapper` in `input` order. + +#### input + +Type: `Iterable` + +Iterated over concurrently in the `mapper` function. + +#### mapper(element, index) + +Type: `Function` + +Expected to return a `Promise` or value. + +#### options + +Type: `object` + +##### concurrency + +Type: `number` (Integer)\ +Default: `Infinity`\ +Minimum: `1` + +Number of concurrently pending promises returned by `mapper`. + +##### stopOnError + +Type: `boolean`\ +Default: `true` + +When set to `false`, instead of stopping when a promise rejects, it will wait for all the promises to settle and then reject with an [aggregated error](https://github.com/sindresorhus/aggregate-error) containing all the errors from the rejected promises. + +## p-map for enterprise + +Available as part of the Tidelift Subscription. + +The maintainers of p-map 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-p-map?utm_source=npm-p-map&utm_medium=referral&utm_campaign=enterprise&utm_term=repo) + +## Related + +- [p-all](https://github.com/sindresorhus/p-all) - Run promise-returning & async functions concurrently with optional limited concurrency +- [p-filter](https://github.com/sindresorhus/p-filter) - Filter promises concurrently +- [p-times](https://github.com/sindresorhus/p-times) - Run promise-returning & async functions a specific number of times concurrently +- [p-props](https://github.com/sindresorhus/p-props) - Like `Promise.all()` but for `Map` and `Object` +- [p-map-series](https://github.com/sindresorhus/p-map-series) - Map over promises serially +- [p-queue](https://github.com/sindresorhus/p-queue) - Promise queue with concurrency control +- [More…](https://github.com/sindresorhus/promise-fun) diff --git a/deps/npm/node_modules/package-json/index.js b/deps/npm/node_modules/package-json/index.js deleted file mode 100644 index 1e588b27e387e8..00000000000000 --- a/deps/npm/node_modules/package-json/index.js +++ /dev/null @@ -1,67 +0,0 @@ -'use strict'; -const url = require('url'); -const got = require('got'); -const registryUrl = require('registry-url'); -const registryAuthToken = require('registry-auth-token'); -const semver = require('semver'); - -module.exports = (name, opts) => { - const scope = name.split('/')[0]; - const regUrl = registryUrl(scope); - const pkgUrl = url.resolve(regUrl, encodeURIComponent(name).replace(/^%40/, '@')); - const authInfo = registryAuthToken(regUrl, {recursive: true}); - - opts = Object.assign({ - version: 'latest' - }, opts); - - const headers = { - accept: 'application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */*' - }; - - if (opts.fullMetadata) { - delete headers.accept; - } - - if (authInfo) { - headers.authorization = `${authInfo.type} ${authInfo.token}`; - } - - return got(pkgUrl, {json: true, headers}) - .then(res => { - let data = res.body; - let version = opts.version; - - if (opts.allVersions) { - return data; - } - - if (data['dist-tags'][version]) { - data = data.versions[data['dist-tags'][version]]; - } else if (version) { - if (!data.versions[version]) { - const versions = Object.keys(data.versions); - version = semver.maxSatisfying(versions, version); - - if (!version) { - throw new Error('Version doesn\'t exist'); - } - } - - data = data.versions[version]; - - if (!data) { - throw new Error('Version doesn\'t exist'); - } - } - - return data; - }) - .catch(err => { - if (err.statusCode === 404) { - throw new Error(`Package \`${name}\` doesn't exist`); - } - - throw err; - }); -}; diff --git a/deps/npm/node_modules/package-json/license b/deps/npm/node_modules/package-json/license deleted file mode 100644 index 654d0bfe943437..00000000000000 --- a/deps/npm/node_modules/package-json/license +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -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/deps/npm/node_modules/package-json/package.json b/deps/npm/node_modules/package-json/package.json deleted file mode 100644 index 643260f508c20f..00000000000000 --- a/deps/npm/node_modules/package-json/package.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "_from": "package-json@^4.0.0", - "_id": "package-json@4.0.1", - "_inBundle": false, - "_integrity": "sha1-iGmgQBJTZhxMTKPabCEh7VVfXu0=", - "_location": "/package-json", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "package-json@^4.0.0", - "name": "package-json", - "escapedName": "package-json", - "rawSpec": "^4.0.0", - "saveSpec": null, - "fetchSpec": "^4.0.0" - }, - "_requiredBy": [ - "/latest-version" - ], - "_resolved": "https://registry.npmjs.org/package-json/-/package-json-4.0.1.tgz", - "_shasum": "8869a0401253661c4c4ca3da6c2121ed555f5eed", - "_spec": "package-json@^4.0.0", - "_where": "/Users/rebecca/code/npm/node_modules/latest-version", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "bugs": { - "url": "https://github.com/sindresorhus/package-json/issues" - }, - "bundleDependencies": false, - "dependencies": { - "got": "^6.7.1", - "registry-auth-token": "^3.0.1", - "registry-url": "^3.0.3", - "semver": "^5.1.0" - }, - "deprecated": false, - "description": "Get metadata of a package from the npm registry", - "devDependencies": { - "ava": "*", - "mock-private-registry": "^1.1.0", - "xo": "*" - }, - "engines": { - "node": ">=4" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/sindresorhus/package-json#readme", - "keywords": [ - "npm", - "registry", - "package", - "pkg", - "package.json", - "json", - "module", - "scope", - "scoped" - ], - "license": "MIT", - "name": "package-json", - "repository": { - "type": "git", - "url": "git+https://github.com/sindresorhus/package-json.git" - }, - "scripts": { - "test": "xo && ava" - }, - "version": "4.0.1" -} diff --git a/deps/npm/node_modules/package-json/readme.md b/deps/npm/node_modules/package-json/readme.md deleted file mode 100644 index 477e25c2201e3c..00000000000000 --- a/deps/npm/node_modules/package-json/readme.md +++ /dev/null @@ -1,91 +0,0 @@ -# package-json [![Build Status](https://travis-ci.org/sindresorhus/package-json.svg?branch=master)](https://travis-ci.org/sindresorhus/package-json) - -> Get metadata of a package from the npm registry - - -## Install - -``` -$ npm install --save package-json -``` - - -## Usage - -```js -const packageJson = require('package-json'); - -packageJson('ava').then(json => { - console.log(json); - //=> {name: 'ava', ...} -}); - -// Also works with scoped packages -packageJson('@sindresorhus/df').then(json => { - console.log(json); - //=> {name: '@sindresorhus/df', ...} -}); -``` - - -## API - -### packageJson(name, [options]) - -#### name - -Type: `string` - -Name of the package. - -#### options - -Type: `Object` - -##### version - -Type: `string`
    -Default: `latest` - -Package version such as `1.0.0` or a [dist tag](https://docs.npmjs.com/cli/dist-tag) such as `latest`. - -The version can also be in any format supported by the [semver](https://github.com/npm/node-semver) module. For example: - -- `1` - get the latest `1.x.x` -- `1.2` - get the latest `1.2.x` -- `^1.2.3` - get the latest `1.x.x` but at least `1.2.3` -- `~1.2.3` - get the latest `1.2.x` but at least `1.2.3` - -##### fullMetadata - -Type: `boolean`
    -Default: `false` - -By default, only an abbreviated metadata object is returned for performance reasons. [Read more.](https://github.com/npm/registry/blob/master/docs/responses/package-metadata.md) - -##### allVersions - -Type: `boolean`
    -Default: `false` - -Return the [main entry](https://registry.npmjs.org/ava) containing all versions. - - -## Authentication - -Both public and private registries are supported, for both scoped and unscoped packages, as long as the registry uses either bearer tokens or basic authentication. - - -## Related - -- [package-json-cli](https://github.com/sindresorhus/package-json-cli) - CLI for this module -- [latest-version](https://github.com/sindresorhus/latest-version) - Get the latest version of an npm package -- [pkg-versions](https://github.com/sindresorhus/pkg-versions) - Get the version numbers of a package from the npm registry -- [npm-keyword](https://github.com/sindresorhus/npm-keyword) - Get a list of npm packages with a certain keyword -- [npm-user](https://github.com/sindresorhus/npm-user) - Get user info of an npm user -- [npm-email](https://github.com/sindresorhus/npm-email) - Get the email of an npm user - - -## License - -MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/deps/npm/node_modules/pacote/CHANGELOG.md b/deps/npm/node_modules/pacote/CHANGELOG.md deleted file mode 100644 index b632c4eb47d116..00000000000000 --- a/deps/npm/node_modules/pacote/CHANGELOG.md +++ /dev/null @@ -1,1417 +0,0 @@ -# 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. - - -## [9.5.12](https://github.com/npm/pacote/compare/v9.5.11...v9.5.12) (2020-01-06) - - -### Bug Fixes - -* **git:** Do not drop uid/gid when executing in root-owned directory ([d2f4176](https://github.com/npm/pacote/commit/d2f4176)) - - - - -## [9.5.11](https://github.com/npm/pacote/compare/v9.5.10...v9.5.11) (2019-12-09) - - -### Bug Fixes - -* sanitize and normalize package bin field ([6f229f7](https://github.com/npm/pacote/commit/6f229f7)) - - - - -## [9.5.10](https://github.com/npm/pacote/compare/v9.5.9...v9.5.10) (2019-12-04) - - -### Bug Fixes - -* Do not drop perms in git when not root ([5f33040](https://github.com/npm/pacote/commit/5f33040)), closes [#23](https://github.com/npm/pacote/issues/23) - - - - -## [9.5.9](https://github.com/npm/pacote/compare/v9.5.8...v9.5.9) (2019-10-29) - - -### Bug Fixes - -* include peerDependenciesMeta in manifest ([7a400d3](https://github.com/npm/pacote/commit/7a400d3)), closes [/github.com/npm/cli/pull/224#issuecomment-547666807](https://github.com//github.com/npm/cli/pull/224/issues/issuecomment-547666807) - - - - -## [9.5.8](https://github.com/npm/pacote/compare/v9.5.7...v9.5.8) (2019-08-20) - - - - -## [9.5.7](https://github.com/npm/pacote/compare/v9.5.6...v9.5.7) (2019-08-19) - - -### Bug Fixes - -* do not try to chown if not running as root ([bbc5da3](https://github.com/npm/pacote/commit/bbc5da3)) - - - - -## [9.5.6](https://github.com/npm/pacote/compare/v9.5.5...v9.5.6) (2019-08-15) - - -### Bug Fixes - -* **extract:** chown properly when more than one directory is made ([5161828](https://github.com/npm/pacote/commit/5161828)) - - - - -## [9.5.5](https://github.com/npm/pacote/compare/v9.5.4...v9.5.5) (2019-08-12) - - -### Bug Fixes - -* don't pass uid/gid to cacache ([0a0c73c](https://github.com/npm/pacote/commit/0a0c73c)) -* Infer owner of all unpacked files ([f12e7ef](https://github.com/npm/pacote/commit/f12e7ef)) -* invalid arg detection in extract() ([b4dc363](https://github.com/npm/pacote/commit/b4dc363)), closes [#5](https://github.com/npm/pacote/issues/5) [#6](https://github.com/npm/pacote/issues/6) - - - - -## [9.5.4](https://github.com/npm/pacote/compare/v9.5.3...v9.5.4) (2019-07-16) - - -### Bug Fixes - -* **git:** ensure stream failures are reported ([7f07b5d](https://github.com/npm/pacote/commit/7f07b5d)), closes [#1](https://github.com/npm/pacote/issues/1) - - - - -## [9.5.3](https://github.com/npm/pacote/compare/v9.5.2...v9.5.3) (2019-07-16) - - - - -## [9.5.2](https://github.com/npm/pacote/compare/v9.5.1...v9.5.2) (2019-07-12) - - -### Bug Fixes - -* always pass uid/gid to cacache.put ([3d08925](https://github.com/npm/pacote/commit/3d08925)) - - - - -## [9.5.1](https://github.com/npm/pacote/compare/v9.5.0...v9.5.1) (2019-06-17) - - -### Bug Fixes - -* **audit:** npm audit fix ([127a28b](https://github.com/npm/pacote/commit/127a28b)) -* **errors:** Fix "TypeError: err.code.match is not a function" error ([#170](https://github.com/npm/pacote/issues/170)) ([92f5e4c](https://github.com/zkat/pacote/commit/92f5e4c)) -* **git:** limit retry times, avoid unlimited retries ([#172](https://github.com/npm/pacote/issues/172)) ([8bbd051](https://github.com/zkat/pacote/commit/8bbd051)) - - - - -# [9.5.0](https://github.com/npm/pacote/compare/v9.4.1...v9.5.0) (2019-02-18) - - -### Features - -* **enjoy-by:** add `before` as an alias to enjoy-by ([75d62b7](https://github.com/npm/pacote/commit/75d62b7)) - - - - -## [9.4.1](https://github.com/npm/pacote/compare/v9.4.0...v9.4.1) (2019-01-24) - - -### Bug Fixes - -* **directory, finalize-manifest:** strip byte order marker from JSON ([723ad63](https://github.com/npm/pacote/commit/723ad63)) - - - - -# [9.4.0](https://github.com/npm/pacote/compare/v9.3.0...v9.4.0) (2019-01-14) - - -### Features - -* **registry:** fall back to fullfat if something might be wrong with corgis ([0e71d6b](https://github.com/npm/pacote/commit/0e71d6b)) - - - - -# [9.3.0](https://github.com/npm/pacote/compare/v9.2.3...v9.3.0) (2018-12-21) - - -### Bug Fixes - -* **git, file:** properly catch otherwise unhandled errors ([89d4897](https://github.com/npm/pacote/commit/89d4897)) -* **test:** set umask opt to fix extract-stream 'accepts dmode/fmode/umask opts' ([e51de83](https://github.com/npm/pacote/commit/e51de83)) - - -### Features - -* **git:** accept git path option ([#164](https://github.com/npm/pacote/issues/164)) ([f06c8c5](https://github.com/zkat/pacote/commit/f06c8c5)) - - - - -## [9.2.3](https://github.com/npm/pacote/compare/v9.2.2...v9.2.3) (2018-10-31) - - - - -## [9.2.2](https://github.com/npm/pacote/compare/v9.2.1...v9.2.2) (2018-10-31) - - - - -## [9.2.1](https://github.com/npm/pacote/compare/v9.2.0...v9.2.1) (2018-10-31) - - - - -# [9.2.0](https://github.com/npm/pacote/compare/v9.1.1...v9.2.0) (2018-10-30) - - -### Features - -* **enjoyBy:** add opts.enjoy-by option ([7df399c](https://github.com/npm/pacote/commit/7df399c)) - - - - -## [9.1.1](https://github.com/npm/pacote/compare/v9.1.0...v9.1.1) (2018-10-26) - - -### Bug Fixes - -* **deps:** bump protoduck to remove CC0-1.0 license in dep ([3d9d9a6](https://github.com/npm/pacote/commit/3d9d9a6)) -* **git:** Fix temp directory permissions for git fetcher ([#159](https://github.com/npm/pacote/issues/159)) ([97c3aeb](https://github.com/zkat/pacote/commit/97c3aeb)) -* **packument:** group together all registry specs in silly log ([2333a17](https://github.com/npm/pacote/commit/2333a17)) -* **standard:** standard --fix ([0ecb188](https://github.com/npm/pacote/commit/0ecb188)) - - - - -# [9.1.0](https://github.com/npm/pacote/compare/v9.0.0...v9.1.0) (2018-08-15) - - -### Bug Fixes - -* **docs:** tweaking ToC ([1eeb8a0](https://github.com/npm/pacote/commit/1eeb8a0)) -* **packument:** take accept header into account when memoizing ([3c637e8](https://github.com/npm/pacote/commit/3c637e8)) - - -### Features - -* **aliases:** add support for registry alias specs ([b173f26](https://github.com/npm/pacote/commit/b173f26)) -* **packument:** add packument api ([97888d9](https://github.com/npm/pacote/commit/97888d9)) - - - - -# [9.0.0](https://github.com/npm/pacote/compare/v8.1.6...v9.0.0) (2018-07-31) - - -### Bug Fixes - -* **travis:** idk why travis was failing ([ab593c9](https://github.com/npm/pacote/commit/ab593c9)) - - -### Features - -* **config:** convert to use figgy-pudding ([0b5bb82](https://github.com/npm/pacote/commit/0b5bb82)) -* **log:** use process.emit-style logging by default ([29ff8b3](https://github.com/npm/pacote/commit/29ff8b3)) -* **registry:** switch to npm-registry-fetch ([c43d6b0](https://github.com/npm/pacote/commit/c43d6b0)) - - -### BREAKING CHANGES - -* **log:** pacote will start emitting events on the process object by default now, instead of doing silent logging -* **registry:** config has changed significantly, especially -for auth and registry-related configs. Refer to README.md -for available options. - - - - -## [8.1.6](https://github.com/npm/pacote/compare/v8.1.5...v8.1.6) (2018-05-24) - - - - -## [8.1.5](https://github.com/npm/pacote/compare/v8.1.4...v8.1.5) (2018-05-22) - - - - -## [8.1.4](https://github.com/npm/pacote/compare/v8.1.3...v8.1.4) (2018-05-22) - - - - -## [8.1.3](https://github.com/npm/pacote/compare/v8.1.2...v8.1.3) (2018-05-20) - - -### Bug Fixes - -* **deps:** try reverting tar ([574ecff](https://github.com/npm/pacote/commit/574ecff)) -* **extract-stream:** address "write after end" issue ([#151](https://github.com/npm/pacote/issues/151)) ([50ed408](https://github.com/zkat/pacote/commit/50ed408)), closes [#142](https://github.com/zkat/pacote/issues/142) - - - - -## [8.1.2](https://github.com/npm/pacote/compare/v8.1.1...v8.1.2) (2018-05-16) - - -### Bug Fixes - -* **extract-stream:** nudge things to stop write-after-end heisenbug, hopefully ([a398715](https://github.com/npm/pacote/commit/a398715)) - - - - -## [8.1.1](https://github.com/npm/pacote/compare/v8.1.0...v8.1.1) (2018-04-24) - - -### Bug Fixes - -* **tarball:** Remove promise handler error ([#148](https://github.com/npm/pacote/issues/148)) ([47da3f6](https://github.com/zkat/pacote/commit/47da3f6)), closes [#145](https://github.com/zkat/pacote/issues/145) - - - - -# [8.1.0](https://github.com/npm/pacote/compare/v8.0.0...v8.1.0) (2018-04-18) - - -### Bug Fixes - -* **git:** workaround for mississippi.finished intermitent failures ([#144](https://github.com/npm/pacote/issues/144)) ([788fd13](https://github.com/zkat/pacote/commit/788fd13)), closes [#143](https://github.com/zkat/pacote/issues/143) - - -### Features - -* **tarball:** calculate shasum when missing, not just integrity ([#149](https://github.com/npm/pacote/issues/149)) ([ccc6e90](https://github.com/zkat/pacote/commit/ccc6e90)) - - - - -# [8.0.0](https://github.com/npm/pacote/compare/v7.6.1...v8.0.0) (2018-04-12) - - -### Bug Fixes - -* **git:** make full clones do a full mirror ([85b269b](https://github.com/npm/pacote/commit/85b269b)) - - -### deps - -* bump deps ([6737bf6](https://github.com/npm/pacote/commit/6737bf6)) - - -### meta - -* drop support for node@4 ([11478ff](https://github.com/npm/pacote/commit/11478ff)) - - -### BREAKING CHANGES - -* some dependencies were upgraded to versions that do not -support node@4. -* node@4 is no longer supported - - - - -## [7.6.1](https://github.com/npm/pacote/compare/v7.6.0...v7.6.1) (2018-03-08) - - -### Bug Fixes - -* **standard:** update to new standard rules ([bb52d02](https://github.com/npm/pacote/commit/bb52d02)) - - - - -# [7.6.0](https://github.com/npm/pacote/compare/v7.5.3...v7.6.0) (2018-03-08) - - -### Features - -* **git:** added retry logic for all git operations. ([#136](https://github.com/npm/pacote/issues/136)) ([425c58d](https://github.com/zkat/pacote/commit/425c58d)) - - - - -## [7.5.3](https://github.com/npm/pacote/compare/v7.5.2...v7.5.3) (2018-03-02) - - -### Bug Fixes - -* **tarball:** stop dropping stream errors on the floor ([3db03c2](https://github.com/npm/pacote/commit/3db03c2)) - - - - -## [7.5.2](https://github.com/npm/pacote/compare/v7.5.1...v7.5.2) (2018-03-02) - - -### Bug Fixes - -* **console:** remove spurious debugging console.log :< ([5b8b509](https://github.com/npm/pacote/commit/5b8b509)) - - - - -## [7.5.1](https://github.com/npm/pacote/compare/v7.5.0...v7.5.1) (2018-03-01) - - -### Bug Fixes - -* **tarball:** catch errors thrown from stream handler ([bdd6628](https://github.com/npm/pacote/commit/bdd6628)) - - - - -# [7.5.0](https://github.com/npm/pacote/compare/v7.4.2...v7.5.0) (2018-03-01) - - -### Features - -* **logging:** let users know when file: resolved packages fail integrity check ([0fb8037](https://github.com/npm/pacote/commit/0fb8037)) - - - - -## [7.4.2](https://github.com/npm/pacote/compare/v7.4.1...v7.4.2) (2018-02-23) - - -### Bug Fixes - -* **deps:** move mkdirp and rimraf to dependencies ([#140](https://github.com/npm/pacote/issues/140)) ([bba20c8](https://github.com/zkat/pacote/commit/bba20c8)), closes [#128](https://github.com/zkat/pacote/issues/128) - - - - -## [7.4.1](https://github.com/npm/pacote/compare/v7.4.0...v7.4.1) (2018-02-23) - - -### Bug Fixes - -* **tarball:** fix spurious errors from tarball.stream() ([0286ba5](https://github.com/npm/pacote/commit/0286ba5)) - - - - -# [7.4.0](https://github.com/npm/pacote/compare/v7.3.3...v7.4.0) (2018-02-17) - - -### Features - -* **tarball:** support file: opts.resolved shortcut ([a6cf279](https://github.com/npm/pacote/commit/a6cf279)) - - - - -## [7.3.3](https://github.com/npm/pacote/compare/v7.3.2...v7.3.3) (2018-02-15) - - -### Bug Fixes - -* **tarball:** another attempt at fixing opts.resolved ([aff3b6a](https://github.com/npm/pacote/commit/aff3b6a)) - - - - -## [7.3.2](https://github.com/npm/pacote/compare/v7.3.1...v7.3.2) (2018-02-15) - - -### Bug Fixes - -* **tarball:** opts.resolved impl was triggering extra registry lookups ([0a4729d](https://github.com/npm/pacote/commit/0a4729d)) - - - - -## [7.3.1](https://github.com/npm/pacote/compare/v7.3.0...v7.3.1) (2018-02-14) - - -### Bug Fixes - -* **tarball:** stop using mississippi.pipe() in tarball.js and extract.js ([f5c1da9](https://github.com/npm/pacote/commit/f5c1da9)) - - - - -# [7.3.0](https://github.com/npm/pacote/compare/v7.2.0...v7.3.0) (2018-02-07) - - -### Bug Fixes - -* **git:** fix resolution of prerelease versions ([#130](https://github.com/npm/pacote/issues/130)) ([83be46b](https://github.com/zkat/pacote/commit/83be46b)), closes [#129](https://github.com/zkat/pacote/issues/129) - - -### Features - -* **extract:** append _resolved and _integrity automatically ([#134](https://github.com/npm/pacote/issues/134)) ([6886b65](https://github.com/zkat/pacote/commit/6886b65)) - - - - -# [7.2.0](https://github.com/npm/pacote/compare/v7.1.1...v7.2.0) (2018-01-19) - - -### Features - -* **resolved:** tarball shortcut when opts.resolved is provided ([46a2f58](https://github.com/npm/pacote/commit/46a2f58)) - - - - -## [7.1.1](https://github.com/npm/pacote/compare/v7.1.0...v7.1.1) (2018-01-08) - - -### Bug Fixes - -* **publish:** a spurious file was included in the previous release ([296741a](https://github.com/npm/pacote/commit/296741a)) - - - - -# [7.1.0](https://github.com/npm/pacote/compare/v7.0.2...v7.1.0) (2018-01-07) - - -### Bug Fixes - -* **security:** deep-update debug due to vulnerabilities ([ff16da7](https://github.com/npm/pacote/commit/ff16da7)) - - -### Features - -* **resolved:** add opts.resolved for cache stuff ([#131](https://github.com/npm/pacote/issues/131)) ([149a4b5](https://github.com/zkat/pacote/commit/149a4b5)) - - - - -## [7.0.2](https://github.com/npm/pacote/compare/v7.0.1...v7.0.2) (2017-11-28) - - -### Bug Fixes - -* **git:** only resolvedRefs can be shallow-cloned ([899720f](https://github.com/npm/pacote/commit/899720f)) - - - - -## [7.0.1](https://github.com/npm/pacote/compare/v7.0.0...v7.0.1) (2017-11-15) - - -### Bug Fixes - -* **git:** use resolved ref if available when doing a full clone (#125) ([46ca45a](https://github.com/npm/pacote/commit/46ca45a)), closes [#125](https://github.com/zkat/pacote/issues/125) -* **move:** bump cacache for some cross-platform move fixes ([eebdcda](https://github.com/npm/pacote/commit/eebdcda)) -* **test:** missed a spot converting tests to promises ([c43caed](https://github.com/npm/pacote/commit/c43caed)) - - - - -# [7.0.0](https://github.com/npm/pacote/compare/v6.1.0...v7.0.0) (2017-11-15) - - -### Bug Fixes - -* **docs:** You totally should use pacote now (#126) ([d49a9b5](https://github.com/npm/pacote/commit/d49a9b5)) -* **git:** stop generating integrity for git ([d45363b](https://github.com/npm/pacote/commit/d45363b)) -* **integrity:** stop defaulting to sha1 hashes ([62f8cdf](https://github.com/npm/pacote/commit/62f8cdf)) -* **license:** relicense to MIT for OSI-compat ([ba6b3e0](https://github.com/npm/pacote/commit/ba6b3e0)) - - -### Features - -* **tarball:** add externall pacote.tarball() api ([e30bd49](https://github.com/npm/pacote/commit/e30bd49)) - - -### prefetch - -* deprecate pacote.prefetch ([e47e521](https://github.com/npm/pacote/commit/e47e521)) - - -### BREAKING CHANGES - -* **license:** The license has changed from CC0-1.0 to MIT, which is less permissive and also OSI-approved. -* pacote.prefetch is deprecated in favor of pacote.tarball - - - - -# [6.1.0](https://github.com/npm/pacote/compare/v6.0.4...v6.1.0) (2017-10-19) - - -### Bug Fixes - -* **git:** use actual default git branch instead of assuming master (#122) ([79ce949](https://github.com/npm/pacote/commit/79ce949)) -* **npa:** ensure spec is a valid npa instance ([1757b2b](https://github.com/npm/pacote/commit/1757b2b)) - - -### Features - -* **selection:** add opts.includeDeprecated (#123) ([2001549](https://github.com/npm/pacote/commit/2001549)) - - - - -## [6.0.4](https://github.com/npm/pacote/compare/v6.0.3...v6.0.4) (2017-10-05) - - -### Bug Fixes - -* **file:** include integrity hash for streamed tarballs too ([030cee7](https://github.com/npm/pacote/commit/030cee7)) - - - - -## [6.0.3](https://github.com/npm/pacote/compare/v6.0.2...v6.0.3) (2017-10-05) - - -### Bug Fixes - -* **extract:** clean up mode/fmode/dmode tests ([f915045](https://github.com/npm/pacote/commit/f915045)) -* **file:** make sure file tarballs are written to cache and have integrity data ([dae391a](https://github.com/npm/pacote/commit/dae391a)) -* **git:** version resolution regression from #115 (#119) ([9a68205](https://github.com/npm/pacote/commit/9a68205)) - - - - -## [6.0.2](https://github.com/npm/pacote/compare/v6.0.1...v6.0.2) (2017-09-06) - - -### Bug Fixes - -* **extract:** preserve executable perms on extracted files ([19b3dfd](https://github.com/npm/pacote/commit/19b3dfd)) - - -### Performance Improvements - -* replace some calls to .match() with .starts/endsWith() (#115) ([192a02f](https://github.com/npm/pacote/commit/192a02f)) - - - - -## [6.0.1](https://github.com/npm/pacote/compare/v6.0.0...v6.0.1) (2017-08-22) - - -### Bug Fixes - -* **finalize:** insist on getting a package.json ([f72ee91](https://github.com/npm/pacote/commit/f72ee91)) - - - - -# [6.0.0](https://github.com/npm/pacote/compare/v5.0.1...v6.0.0) (2017-08-19) - - -### Bug Fixes - -* **tar:** bring back the .gitignore -> .npmignore logic (#113) ([0dd518e](https://github.com/npm/pacote/commit/0dd518e)) - - -### BREAKING CHANGES - -* **tar:** this reverts a previous change to disable this feature. - - - - -## [5.0.1](https://github.com/npm/pacote/compare/v5.0.0...v5.0.1) (2017-08-17) - - -### Bug Fixes - -* **tar:** chown directories on extract as well ([2fa4598](https://github.com/npm/pacote/commit/2fa4598)) - - - - -# [5.0.0](https://github.com/npm/pacote/compare/v4.0.0...v5.0.0) (2017-08-16) - - -### Bug Fixes - -* **registry:** Pass maxSockets options down (#110) ([3f05b79](https://github.com/npm/pacote/commit/3f05b79)) - - -### Features - -* **deps:** replace tar-fs/tar-stream with tar[@3](https://github.com/3) ([28c80a9](https://github.com/npm/pacote/commit/28c80a9)) -* **tar:** switch to tarv3 ([53899c7](https://github.com/npm/pacote/commit/53899c7)) - - -### BREAKING CHANGES - -* **tar:** this changes the underlying tar library, and thus may introduce some subtle low-level incompatibility. Also: - -* The tarball packer built into pacote works much closer to how the one npm injects does. -* Special characters on Windows will now be escaped the way tar(1) usually does: by replacing them with the `0xf000` masked character on the way out. -* Directories won't be chowned. - - - - -# [4.0.0](https://github.com/npm/pacote/compare/v3.0.0...v4.0.0) (2017-06-29) - - -### Bug Fixes - -* **extract:** revert uid/gid change ([41852e0](https://github.com/npm/pacote/commit/41852e0)) - - -### BREAKING CHANGES - -* **extract:** behavior for setting uid/gid on extracted contents was restored to what it was in pacote@2 - - - - -# [3.0.0](https://github.com/npm/pacote/compare/v2.7.38...v3.0.0) (2017-06-29) - - -### Bug Fixes - -* **extract:** always extract as current user gid/uid ([6fc01a5](https://github.com/npm/pacote/commit/6fc01a5)) - - -### BREAKING CHANGES - -* **extract:** pacote will no longer set ownership of extracted -contents -- uid/gid will *only* be used for the cache and other internal -details. - - - - -## [2.7.38](https://github.com/npm/pacote/compare/v2.7.37...v2.7.38) (2017-06-29) - - -### Bug Fixes - -* **manifest:** bump npm-pick-manifest for loose semver fix ([b3d45ef](https://github.com/npm/pacote/commit/b3d45ef)) - - - - -## [2.7.37](https://github.com/npm/pacote/compare/v2.7.36...v2.7.37) (2017-06-29) - - -### Bug Fixes - -* **deps:** bump deps for fixes ([f156655](https://github.com/npm/pacote/commit/f156655)) - - - - -## [2.7.36](https://github.com/npm/pacote/compare/v2.7.35...v2.7.36) (2017-06-10) - - -### Bug Fixes - -* **deps:** update tar-fs with the special characters patch (#102) ([ed43aa3](https://github.com/npm/pacote/commit/ed43aa3)) - - - - -## [2.7.35](https://github.com/npm/pacote/compare/v2.7.34...v2.7.35) (2017-06-09) - - -### Bug Fixes - -* **registry:** only print one 199 warning (#100) ([b395138](https://github.com/npm/pacote/commit/b395138)) - - - - -## [2.7.34](https://github.com/npm/pacote/compare/v2.7.33...v2.7.34) (2017-06-09) - - -### Bug Fixes - -* **git:** whitelist specific shallow-cloneable hosts ([b210cc8](https://github.com/npm/pacote/commit/b210cc8)) - - - - -## [2.7.33](https://github.com/npm/pacote/compare/v2.7.32...v2.7.33) (2017-06-08) - - -### Bug Fixes - -* **git:** better error reporting when ls-remote fails ([10aae8f](https://github.com/npm/pacote/commit/10aae8f)) - - - - -## [2.7.32](https://github.com/npm/pacote/compare/v2.7.31...v2.7.32) (2017-06-07) - - -### Bug Fixes - -* **registry:** print both 111 and 199 warnings ([2f8c201](https://github.com/npm/pacote/commit/2f8c201)) - - - - -## [2.7.31](https://github.com/npm/pacote/compare/v2.7.30...v2.7.31) (2017-06-06) - - -### Bug Fixes - -* **extract:** always return a bluebird promise ([06ca91d](https://github.com/npm/pacote/commit/06ca91d)) -* **registry:** bump make-fetch-happen for local cache header issue fix ([868615c](https://github.com/npm/pacote/commit/868615c)) - - - - -## [2.7.30](https://github.com/npm/pacote/compare/v2.7.29...v2.7.30) (2017-06-05) - - -### Bug Fixes - -* **ssri:** bump ssri for bugfix ([70a859c](https://github.com/npm/pacote/commit/70a859c)) - - - - -## [2.7.29](https://github.com/npm/pacote/compare/v2.7.28...v2.7.29) (2017-06-05) - - -### Bug Fixes - -* **registry:** use cert instead of certfile opt ([a45880d](https://github.com/npm/pacote/commit/a45880d)) - - - - -## [2.7.28](https://github.com/npm/pacote/compare/v2.7.27...v2.7.28) (2017-06-05) - - -### Bug Fixes - -* **git:** limit ls-remote output to heads/tags (#97) ([c1e3dcd](https://github.com/npm/pacote/commit/c1e3dcd)) -* **proxy:** send certificate authority, key and other options (#95) ([c4b6128](https://github.com/npm/pacote/commit/c4b6128)) -* **registry:** add support for global auth and _auth token (#96) ([7919fb7](https://github.com/npm/pacote/commit/7919fb7)) -* **registry:** emit npm-session header (#98) ([9816b18](https://github.com/npm/pacote/commit/9816b18)) - - - - -## [2.7.27](https://github.com/npm/pacote/compare/v2.7.26...v2.7.27) (2017-06-01) - - -### Bug Fixes - -* **git:** fix semver range detection. oops ([76d9233](https://github.com/npm/pacote/commit/76d9233)) - - - - -## [2.7.26](https://github.com/npm/pacote/compare/v2.7.25...v2.7.26) (2017-06-01) - - -### Bug Fixes - -* **git:** hash was not being replaced/appended correctly ([6fcbed5](https://github.com/npm/pacote/commit/6fcbed5)) - - - - -## [2.7.25](https://github.com/npm/pacote/compare/v2.7.24...v2.7.25) (2017-05-31) - - -### Bug Fixes - -* **git:** git deps were getting _resolved without shasums ([96f0675](https://github.com/npm/pacote/commit/96f0675)) - - - - -## [2.7.24](https://github.com/npm/pacote/compare/v2.7.23...v2.7.24) (2017-05-31) - - -### Bug Fixes - -* **deps:** update dep versions with new patches ([dc2e4ff](https://github.com/npm/pacote/commit/dc2e4ff)) - - - - -## [2.7.23](https://github.com/npm/pacote/compare/v2.7.22...v2.7.23) (2017-05-31) - - -### Bug Fixes - -* **git:** fix ls-remote command and throw away ^{} junk ([62ba84d](https://github.com/npm/pacote/commit/62ba84d)) -* **git:** use the parsed git committish from npa ([77a676a](https://github.com/npm/pacote/commit/77a676a)) - - - - -## [2.7.22](https://github.com/npm/pacote/compare/v2.7.21...v2.7.22) (2017-05-31) - - -### Bug Fixes - -* **git:** accept shortened git hashes (#91) ([4466388](https://github.com/npm/pacote/commit/4466388)) - - - - -## [2.7.21](https://github.com/npm/pacote/compare/v2.7.20...v2.7.21) (2017-05-25) - - -### Bug Fixes - -* **registry:** stop URIEncoding username/password ([011c9a2](https://github.com/npm/pacote/commit/011c9a2)) - - - - -## [2.7.20](https://github.com/npm/pacote/compare/v2.7.19...v2.7.20) (2017-05-25) - - -### Bug Fixes - -* **registry:** encode username and password for auth ([c48b651](https://github.com/npm/pacote/commit/c48b651)) - - - - -## [2.7.19](https://github.com/npm/pacote/compare/v2.7.18...v2.7.19) (2017-05-25) - - -### Bug Fixes - -* **registry:** respect alwaysAuth ([150788a](https://github.com/npm/pacote/commit/150788a)) - - - - -## [2.7.18](https://github.com/npm/pacote/compare/v2.7.17...v2.7.18) (2017-05-25) - - -### Bug Fixes - -* **cache:** pass uid/gid settings through to mfh ([d8845df](https://github.com/npm/pacote/commit/d8845df)) -* **deps:** update m-f-h for cache opts fix ([faab6cd](https://github.com/npm/pacote/commit/faab6cd)) - - - - -## [2.7.17](https://github.com/npm/pacote/compare/v2.7.16...v2.7.17) (2017-05-25) - - -### Bug Fixes - -* **deps:** bump cacache ([34bd656](https://github.com/npm/pacote/commit/34bd656)) - - - - -## [2.7.16](https://github.com/npm/pacote/compare/v2.7.15...v2.7.16) (2017-05-24) - - -### Bug Fixes - -* **deps:** pull in various fixes from deps ([4354703](https://github.com/npm/pacote/commit/4354703)) - - - - -## [2.7.15](https://github.com/npm/pacote/compare/v2.7.14...v2.7.15) (2017-05-24) - - -### Bug Fixes - -* **proxy:** bump m-f-h with more patches ([26d4170](https://github.com/npm/pacote/commit/26d4170)) - - - - -## [2.7.14](https://github.com/npm/pacote/compare/v2.7.13...v2.7.14) (2017-05-24) - - -### Bug Fixes - -* **proxy:** pull in new m-f-h with fixed http proxies ([d6a14e0](https://github.com/npm/pacote/commit/d6a14e0)) - - - - -## [2.7.13](https://github.com/npm/pacote/compare/v2.7.12...v2.7.13) (2017-05-23) - - -### Bug Fixes - -* **deps:** bump dep versions to fix http redirect issues ([b23a9fa](https://github.com/npm/pacote/commit/b23a9fa)) - - - - -## [2.7.12](https://github.com/npm/pacote/compare/v2.7.11...v2.7.12) (2017-05-16) - - -### Bug Fixes - -* **fetch:** fix default userAgent ([4b9d344](https://github.com/npm/pacote/commit/4b9d344)) -* **registry:** log failed requests too ([0f23f06](https://github.com/npm/pacote/commit/0f23f06)) -* **remote:** send a useful pkg id header for remote tarballs ([ac13356](https://github.com/npm/pacote/commit/ac13356)) - - - - -## [2.7.11](https://github.com/npm/pacote/compare/v2.7.10...v2.7.11) (2017-05-12) - - -### Bug Fixes - -* **fetch:** make it play nicer with bundlers ([67cd713](https://github.com/npm/pacote/commit/67cd713)) - - - - -## [2.7.10](https://github.com/npm/pacote/compare/v2.7.9...v2.7.10) (2017-05-12) - - -### Bug Fixes - -* **logging:** shhhhhhh ([e7ea56e](https://github.com/npm/pacote/commit/e7ea56e)) -* **manifest:** _resolved is the only main field we do not overwrite ([4c12421](https://github.com/npm/pacote/commit/4c12421)) - - - - -## [2.7.9](https://github.com/npm/pacote/compare/v2.7.8...v2.7.9) (2017-05-09) - - -### Bug Fixes - -* **git:** Resolve to ref git specs w/o committishes (#88) ([cb885f5](https://github.com/npm/pacote/commit/cb885f5)), closes [#88](https://github.com/zkat/pacote/issues/88) - - - - -## [2.7.8](https://github.com/npm/pacote/compare/v2.7.7...v2.7.8) (2017-05-07) - - -### Bug Fixes - -* **git:** integrity hash was not always emitted ([97ed9e1](https://github.com/npm/pacote/commit/97ed9e1)) - - - - -## [2.7.7](https://github.com/npm/pacote/compare/v2.7.6...v2.7.7) (2017-05-06) - - -### Bug Fixes - -* **auth:** redirects no longer send auth to different host ([82e78c5](https://github.com/npm/pacote/commit/82e78c5)) - - - - -## [2.7.6](https://github.com/npm/pacote/compare/v2.7.5...v2.7.6) (2017-05-05) - - -### Bug Fixes - -* **git:** only use longpaths on win32 because old gits ([32846fc](https://github.com/npm/pacote/commit/32846fc)) - - - - -## [2.7.5](https://github.com/npm/pacote/compare/v2.7.4...v2.7.5) (2017-05-04) - - -### Bug Fixes - -* **registry-key:** Use pathname instead of path in registryKey (#85) ([5339831](https://github.com/npm/pacote/commit/5339831)) - - - - -## [2.7.4](https://github.com/npm/pacote/compare/v2.7.3...v2.7.4) (2017-05-04) - - -### Bug Fixes - -* **pick-manifest:** fix =1.2.3 semver range requests ([dd6911c](https://github.com/npm/pacote/commit/dd6911c)) - - - - -## [2.7.3](https://github.com/npm/pacote/compare/v2.7.2...v2.7.3) (2017-05-04) - - -### Bug Fixes - -* **pick-manifest:** spaces in requested version are now trimmed out ([6422b28](https://github.com/npm/pacote/commit/6422b28)) - - - - -## [2.7.2](https://github.com/npm/pacote/compare/v2.7.1...v2.7.2) (2017-05-04) - - -### Bug Fixes - -* **extract:** missing or corrupted content properly re-fetched again ([46f60c2](https://github.com/npm/pacote/commit/46f60c2)) - - - - -## [2.7.1](https://github.com/npm/pacote/compare/v2.7.0...v2.7.1) (2017-05-01) - - -### Bug Fixes - -* **logging:** log specs correctly on extract ([4b5bab0](https://github.com/npm/pacote/commit/4b5bab0)) -* **manifest:** obey opts.preferOnline when fetching from memoized ([26928a7](https://github.com/npm/pacote/commit/26928a7)) - - - - -# [2.7.0](https://github.com/npm/pacote/compare/v2.6.0...v2.7.0) (2017-04-29) - - -### Bug Fixes - -* **registry:** stop using integrity hashes for metadata. again. ([4595ab2](https://github.com/npm/pacote/commit/4595ab2)) - - -### Features - -* **manifest:** include _shasum for legacy compat ([b3a7eed](https://github.com/npm/pacote/commit/b3a7eed)) - - - - -# [2.6.0](https://github.com/npm/pacote/compare/v2.5.0...v2.6.0) (2017-04-29) - - -### Features - -* **manifest:** annotate manifests with _from ([e45e968](https://github.com/npm/pacote/commit/e45e968)) - - - - -# [2.5.0](https://github.com/npm/pacote/compare/v2.4.0...v2.5.0) (2017-04-28) - - -### Bug Fixes - -* **registry:** JSON text is not a valid header value ([78951ea](https://github.com/npm/pacote/commit/78951ea)) - - -### Features - -* **memoization:** allow injection and control of memoizers ([d8a2be7](https://github.com/npm/pacote/commit/d8a2be7)) - - - - -# [2.4.0](https://github.com/npm/pacote/compare/v2.3.2...v2.4.0) (2017-04-27) - - -### Bug Fixes - -* **tests:** nicer error message on registry 404 ([e8e71c8](https://github.com/npm/pacote/commit/e8e71c8)) - - -### Features - -* **auth:** added basic auth and always-auth support ([548aeb5](https://github.com/npm/pacote/commit/548aeb5)) -* **proxy:** proxy support for registry and remote deps ([3766bbb](https://github.com/npm/pacote/commit/3766bbb)) - - - - -## [2.3.2](https://github.com/npm/pacote/compare/v2.3.1...v2.3.2) (2017-04-26) - - -### Bug Fixes - -* **deps:** reduce deps size with m-f-h upgrade ([ba75461](https://github.com/npm/pacote/commit/ba75461)) - - - - -## [2.3.1](https://github.com/npm/pacote/compare/v2.3.0...v2.3.1) (2017-04-26) - - -### Bug Fixes - -* **git:** another attempt at fixing EPERM b.s. ([e445bef](https://github.com/npm/pacote/commit/e445bef)) - - - - -# [2.3.0](https://github.com/npm/pacote/compare/v2.2.2...v2.3.0) (2017-04-26) - - -### Bug Fixes - -* **git:** had ENOTSUP error on windows ([ee17c35](https://github.com/npm/pacote/commit/ee17c35)) -* **memoization:** actually memoize package metadata ([e2078c0](https://github.com/npm/pacote/commit/e2078c0)) - - -### Features - -* **memoization:** better packument memoization + pacote.clearMemoized() ([eb1bd4f](https://github.com/npm/pacote/commit/eb1bd4f)) - - - - -## [2.2.2](https://github.com/npm/pacote/compare/v2.2.1...v2.2.2) (2017-04-24) - - -### Bug Fixes - -* **prefetch:** pull in new cacache + fix prefetch hasContent call ([9f476b8](https://github.com/npm/pacote/commit/9f476b8)) - - - - -## [2.2.1](https://github.com/npm/pacote/compare/v2.2.0...v2.2.1) (2017-04-23) - - -### Bug Fixes - -* **finalize:** pass on engines/cpu/os ([0a73c78](https://github.com/npm/pacote/commit/0a73c78)) - - - - -# [2.2.0](https://github.com/npm/pacote/compare/v2.1.2...v2.2.0) (2017-04-22) - - -### Bug Fixes - -* **git:** fix shortcut fallback order again ([5759d40](https://github.com/npm/pacote/commit/5759d40)) -* **registry:** fix infinite manifetch loop ([6c6a62b](https://github.com/npm/pacote/commit/6c6a62b)) - - -### Features - -* **manifest:** opts.fullMetadata to get unfiltered manifests ([ff2945b](https://github.com/npm/pacote/commit/ff2945b)) - - - - -## [2.1.2](https://github.com/npm/pacote/compare/v2.1.1...v2.1.2) (2017-04-20) - - - - -## [2.1.1](https://github.com/npm/pacote/compare/v2.1.0...v2.1.1) (2017-04-19) - - -### Bug Fixes - -* **git:** use sshurl instead of ssh for ssh clones ([ff20803](https://github.com/npm/pacote/commit/ff20803)) -* **notice:** only log npm-notice if the packument came from network ([eeeb411](https://github.com/npm/pacote/commit/eeeb411)) -* **registry:** improve 404 error messages ([6a5cbdb](https://github.com/npm/pacote/commit/6a5cbdb)) - - - - -# [2.1.0](https://github.com/npm/pacote/compare/v2.0.5...v2.1.0) (2017-04-18) - - -### Bug Fixes - -* **cache:** bump deps for cache fixes ([9596434](https://github.com/npm/pacote/commit/9596434)) - - -### Features - -* **warn:** http warning headers now logged ([f22ce1d](https://github.com/npm/pacote/commit/f22ce1d)) - - - - -## [2.0.5](https://github.com/npm/pacote/compare/v2.0.4...v2.0.5) (2017-04-18) - - -### Bug Fixes - -* **file:** oops, the type for these is file ([e7a3d35](https://github.com/npm/pacote/commit/e7a3d35)) - - - - -## [2.0.4](https://github.com/npm/pacote/compare/v2.0.3...v2.0.4) (2017-04-18) - - -### Bug Fixes - -* **deps:** remove normalize-git-url ([12d464a](https://github.com/npm/pacote/commit/12d464a)) -* **git:** Correctly read in the HEAD ref after cloning ([dbe1b15](https://github.com/npm/pacote/commit/dbe1b15)) -* **git:** The full clone path doesn't have _resolved set ([ddce561](https://github.com/npm/pacote/commit/ddce561)) -* **manifest:** no _from ever ([15087c4](https://github.com/npm/pacote/commit/15087c4)) - - - - -## [2.0.3](https://github.com/npm/pacote/compare/v2.0.2...v2.0.3) (2017-04-15) - - -### Bug Fixes - -* **manifest:** meh just shove _from in there ([4396f09](https://github.com/npm/pacote/commit/4396f09)) -* **registry:** include CI header ([86ad911](https://github.com/npm/pacote/commit/86ad911)) -* **registry:** include npm-scope header ([574cd93](https://github.com/npm/pacote/commit/574cd93)) -* **registry:** make sure to send referer header ([2d3aaac](https://github.com/npm/pacote/commit/2d3aaac)) - - - - -## [2.0.2](https://github.com/npm/pacote/compare/v2.0.1...v2.0.2) (2017-04-15) - - -### Bug Fixes - -* **directory:** fix default pack-dir and write a test for it ([9d9266f](https://github.com/npm/pacote/commit/9d9266f)) -* **extract:** brainfart with extractByManifest fixed. lol. ([a1367fb](https://github.com/npm/pacote/commit/a1367fb)) - - - - -## [2.0.1](https://github.com/npm/pacote/compare/v2.0.0...v2.0.1) (2017-04-15) - - -### Bug Fixes - -* **tarball:** missed the local->tarball rename ([ac42dc4](https://github.com/npm/pacote/commit/ac42dc4)) - - - - -# [2.0.0](https://github.com/npm/pacote/compare/v1.0.0...v2.0.0) (2017-04-15) - - -### Bug Fixes - -* **api:** use npa[@5](https://github.com/5) for spec parsing (#78) ([3f56298](https://github.com/npm/pacote/commit/3f56298)) -* **deprecated:** remove underscore from manifest._deprecated ([9f4af93](https://github.com/npm/pacote/commit/9f4af93)) -* **directory:** add _resolved to directory manifests ([1d305db](https://github.com/npm/pacote/commit/1d305db)) -* **directory:** return null instead of throwing ([d35630d](https://github.com/npm/pacote/commit/d35630d)) -* **finalize:** don't try to cache manifests we can't get a good key for ([8ab1758](https://github.com/npm/pacote/commit/8ab1758)) -* **finalize:** refactored finalize-manifest code + add _integrity=false sentinel ([657b7fa](https://github.com/npm/pacote/commit/657b7fa)) -* **git:** cleaner handling of git tarball streams when caching ([11acd0a](https://github.com/npm/pacote/commit/11acd0a)) -* **git:** emit manifests from git tarball handler ([b139d4b](https://github.com/npm/pacote/commit/b139d4b)) -* **git:** fix .git exclusion, set mtime = 0 to make tarballs idempotent ([9a9fa1b](https://github.com/npm/pacote/commit/9a9fa1b)) -* **git:** fix fallback order and only fall back on hosted shortcuts ([551cb33](https://github.com/npm/pacote/commit/551cb33)) -* **git:** fix filling-out of git manifests ([95e807c](https://github.com/npm/pacote/commit/95e807c)) -* **git:** got dir packer option working with git ([7669b3e](https://github.com/npm/pacote/commit/7669b3e)) -* **headers:** nudge around some headers to make things behave ([db1e0a1](https://github.com/npm/pacote/commit/db1e0a1)) -* **manifest:** get rid of resolved-with-non-error warning ([d4d4917](https://github.com/npm/pacote/commit/d4d4917)) -* **manifest:** stop using digest for manifests ([4ddd2f5](https://github.com/npm/pacote/commit/4ddd2f5)) -* **opts:** bring opt-check up to date ([564419e](https://github.com/npm/pacote/commit/564419e)) -* **opts:** rename refreshCache to preferOnline cause much clearer ([94171d6](https://github.com/npm/pacote/commit/94171d6)) -* **prefetch:** fall back to the _integrity in the manifest if none calculated ([083ac79](https://github.com/npm/pacote/commit/083ac79)) -* **prefetch:** if there's no stream, just skip (for directory) ([714de91](https://github.com/npm/pacote/commit/714de91)) -* **registry:** fix error handling for registry tarballs ([e69539f](https://github.com/npm/pacote/commit/e69539f)) -* **registry:** nudging logging stuff around a bit ([61d62cc](https://github.com/npm/pacote/commit/61d62cc)) -* **registry:** only send auth info if tarball is hosted on the same registry ([1de5a2b](https://github.com/npm/pacote/commit/1de5a2b)) -* **registry:** redirect tarball urls to provided registry port+protocol if same host ([f50167e](https://github.com/npm/pacote/commit/f50167e)) -* **registry:** support memoizing packuments ([e7fff31](https://github.com/npm/pacote/commit/e7fff31)) -* **registry:** treat registry cache as "private" -- bumps m-f-h ([6fa1503](https://github.com/npm/pacote/commit/6fa1503)) - - -### Features - -* **directory:** implement local dir packing ([017d989](https://github.com/npm/pacote/commit/017d989)) -* **fetch:** bump make-fetch-happen for new restarts ([cf90716](https://github.com/npm/pacote/commit/cf90716)) -* **git:** support pulling in git submodules ([5825d33](https://github.com/npm/pacote/commit/5825d33)) -* **integrity:** replace http client (#72) ([189cdd2](https://github.com/npm/pacote/commit/189cdd2)) -* **prefetch:** return cache-related info on prefetch ([623b7f3](https://github.com/npm/pacote/commit/623b7f3)) -* **registry:** allow injection of request agents ([805e5ae](https://github.com/npm/pacote/commit/805e5ae)) -* **registry:** fast request pooling ([321f84b](https://github.com/npm/pacote/commit/321f84b)) -* **registry:** registry requests now follow cache spec more closely, respect Age, etc ([9e47098](https://github.com/npm/pacote/commit/9e47098)) - - -### BREAKING CHANGES - -* **api:** spec objects can no longer be realize-package-specifier objects. Pass a string or generate npa@>=5 spec objects to pass in. -* **integrity:** This PR replaces a pretty fundamental chunk of pacote. - -* Caching now follows standard-ish cache rules for http-related requests. - -* manifest() no longer includes the `_shasum` field. It's been replaced by `_integrity`, which is a Subresource Integrity hash string containing equivalent data. These strings can be parsed and managed using https://npm.im/ssri. - -* Any functions that accepted `opts.digest` and/or `opts.hashAlgorithm` now expect `opts.integrity` instead. - -* Packuments and finalized manifests are now cached using sha512. Tarballs can start using that hash (or any other more secure hash) once registries start supporting them: `packument.dist.integrity` will be prioritized over `packument.shasum`. - -* If opts.offline is used, a `ENOCACHE` error will be returned. - - - - -# [1.0.0](https://github.com/npm/pacote/compare/v0.1.1...v1.0.0) (2017-03-17) - - -### Bug Fixes - -* **extract-stream:** adapt to tar-fs api ([aa21308](https://github.com/npm/pacote/commit/aa21308)) -* add 'use strict' to all .js files (#26) ([021bd59](https://github.com/npm/pacote/commit/021bd59)) -* **cache:** this is really a user error, so just throw ([5c9c0fa](https://github.com/npm/pacote/commit/5c9c0fa)) -* **deps:** cacache[@5](https://github.com/5).0.3 ([37cddc5](https://github.com/npm/pacote/commit/37cddc5)) -* **deps:** tar-fs[@1](https://github.com/1).15.1 ([e0d853a](https://github.com/npm/pacote/commit/e0d853a)) -* **docs:** correct fixtures table (#57) ([23d2eb4](https://github.com/npm/pacote/commit/23d2eb4)) -* **extract:** correctly detect digest cache misses ([ec6672b](https://github.com/npm/pacote/commit/ec6672b)) -* **extract:** fixed race condition ([14fd2a8](https://github.com/npm/pacote/commit/14fd2a8)) -* **finalize-manifest:** use digest to uniquify cached manifests ([931a9cb](https://github.com/npm/pacote/commit/931a9cb)) -* **http:** Fixed cache-related race condition ([b70a4b1](https://github.com/npm/pacote/commit/b70a4b1)) -* **manifest:** dir manifests should throw ENOPACKAGEJSON ([b06882d](https://github.com/npm/pacote/commit/b06882d)) -* **manifest:** ETARGET when no packages match ([ea2127d](https://github.com/npm/pacote/commit/ea2127d)) -* **manifest:** local manifest fn should return a promise ([c700622](https://github.com/npm/pacote/commit/c700622)) -* **manifest:** retry registry manifests once on ETARGET (#66) ([3b99adc](https://github.com/npm/pacote/commit/3b99adc)) -* **prefetch:** hashAlgorithm is required for hasContent ([f03d51c](https://github.com/npm/pacote/commit/f03d51c)) -* **request:** report cache write errors on end ([c102b86](https://github.com/npm/pacote/commit/c102b86)) - - -### Features - -* **api:** support pre-realized specifiers as specs (#62) ([1d5bf39](https://github.com/npm/pacote/commit/1d5bf39)) -* **cache:** grabbing info and hasContent ([a559711](https://github.com/npm/pacote/commit/a559711)) -* **deps:** minimatch[@3](https://github.com/3).0.3 ([2bb8cd5](https://github.com/npm/pacote/commit/2bb8cd5)) -* **deps:** normalize-package-data[@2](https://github.com/2).3.5 ([4250e0d](https://github.com/npm/pacote/commit/4250e0d)) -* **directory:** directory dep support (#68) ([6d5307a](https://github.com/npm/pacote/commit/6d5307a)) -* **git:** baseline git support (#69) ([6d7eaf5](https://github.com/npm/pacote/commit/6d7eaf5)) -* **handlers:** added remote tarball support (#64) ([add1808](https://github.com/npm/pacote/commit/add1808)) -* **local:** local tarball support (#67) ([e50d625](https://github.com/npm/pacote/commit/e50d625)) -* **manifest:** handle deprecation notice (#60) ([db82dae](https://github.com/npm/pacote/commit/db82dae)) -* **manifest:** standardize manifest format ([3dd9a72](https://github.com/npm/pacote/commit/3dd9a72)) -* **manifest:** switch to cacache for caching ([8ba7249](https://github.com/npm/pacote/commit/8ba7249)) -* **prefetch:** added tarball prefetch support ([26c34ce](https://github.com/npm/pacote/commit/26c34ce)) -* **request:** accept maxSockets opt ([3987807](https://github.com/npm/pacote/commit/3987807)) -* **scopes:** new scopeTargets option (#59) ([b5db7ae](https://github.com/npm/pacote/commit/b5db7ae)) - - -### Performance Improvements - -* **finalize-manifest:** cache finalized manifests ([fa3c430](https://github.com/npm/pacote/commit/fa3c430)) - - -### BREAKING CHANGES - -* **manifest:** Toplevel APIs now return Promises instead of using callbacks. diff --git a/deps/npm/node_modules/pacote/LICENSE b/deps/npm/node_modules/pacote/LICENSE index 841ef53a26dff6..a03cd0ed0b338b 100644 --- a/deps/npm/node_modules/pacote/LICENSE +++ b/deps/npm/node_modules/pacote/LICENSE @@ -1,21 +1,15 @@ -The MIT License (MIT) -Copyright (c) Kat Marchán, npm, Inc., and Contributors +The ISC License -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: +Copyright (c) Isaac Z. Schlueter, Kat Marchán, npm, Inc., and Contributors -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. +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/pacote/README.md b/deps/npm/node_modules/pacote/README.md index f29d330d8cb546..49dbde6a929122 100644 --- a/deps/npm/node_modules/pacote/README.md +++ b/deps/npm/node_modules/pacote/README.md @@ -1,288 +1,244 @@ -# pacote [![npm version](https://img.shields.io/npm/v/pacote.svg)](https://npm.im/pacote) [![license](https://img.shields.io/npm/l/pacote.svg)](https://npm.im/pacote) [![Travis](https://img.shields.io/travis/npm/pacote.svg)](https://travis-ci.org/npm/pacote) [![AppVeyor](https://ci.appveyor.com/api/projects/status/github/npm/pacote?svg=true)](https://ci.appveyor.com/project/npm/pacote) [![Coverage Status](https://coveralls.io/repos/github/npm/pacote/badge.svg?branch=latest)](https://coveralls.io/github/npm/pacote?branch=latest) +# pacote -[`pacote`](https://github.com/npm/pacote) is a Node.js library for downloading -[npm](https://npmjs.org)-compatible packages. It supports all package specifier -syntax that `npm install` and its ilk support. It transparently caches anything -needed to reduce excess operations, using [`cacache`](https://npm.im/cacache). +JavaScript Package Handler -## Install +## USAGE -`$ npm install --save pacote` - -## Table of Contents - -* [Example](#example) -* [Features](#features) -* [Contributing](#contributing) -* [API](#api) - * [`manifest`](#manifest) - * [`packument`](#packument) - * [`extract`](#extract) - * [`tarball`](#tarball) - * [`tarball.stream`](#tarball-stream) - * [`tarball.toFile`](#tarball-to-file) - * ~~[`prefetch`](#prefetch)~~ (deprecated) - * [`clearMemoized`](#clearMemoized) - * [`options`](#options) - -### Example - -```javascript +```js const pacote = require('pacote') -pacote.manifest('pacote@^1').then(pkg => { - console.log('package manifest for registry pkg:', pkg) - // { "name": "pacote", "version": "1.0.0", ... } -}) +// get a package manifest +pacote.manifest('foo@1.x').then(manifest => console.log('got it', manifest)) -pacote.extract('http://hi.com/pkg.tgz', './here').then(() => { - console.log('remote tarball contents extracted to ./here') -}) -``` +// extract a package into a folder +pacote.extract('github:npm/cli', 'some/path', options) + .then(({from, resolved, integrity}) => { + console.log('extracted!', from, resolved, integrity) + }) -### Features - -* Handles all package types [npm](https://npm.im/npm) does -* [high-performance, reliable, verified local cache](https://npm.im/cacache) -* offline mode -* authentication support (private git, private npm registries, etc) -* github, gitlab, and bitbucket-aware -* semver range support for git dependencies - -### Contributing - -The pacote team enthusiastically welcomes contributions and project participation! There's a bunch of things you can do if you want to contribute! The [Contributor Guide](CONTRIBUTING.md) has all the information you need for everything from reporting bugs to contributing entire new features. Please don't hesitate to jump in if you'd like to, or even ask us questions if something isn't clear. - -### API - -#### `> pacote.manifest(spec, [opts])` - -Fetches the *manifest* for a package. Manifest objects are similar and based -on the `package.json` for that package, but with pre-processed and limited -fields. The object has the following shape: - -```javascript -{ - "name": PkgName, - "version": SemverString, - "dependencies": { PkgName: SemverString }, - "optionalDependencies": { PkgName: SemverString }, - "devDependencies": { PkgName: SemverString }, - "peerDependencies": { PkgName: SemverString }, - "bundleDependencies": false || [PkgName], - "bin": { BinName: Path }, - "_resolved": TarballSource, // different for each package type - "_integrity": SubresourceIntegrityHash, - "_shrinkwrap": null || ShrinkwrapJsonObj -} -``` - -Note that depending on the spec type, some additional fields might be present. -For example, packages from `registry.npmjs.org` have additional metadata -appended by the registry. - -##### Example - -```javascript -pacote.manifest('pacote@1.0.0').then(pkgJson => { - // fetched `package.json` data from the registry +pacote.tarball('https://server.com/package.tgz').then(data => { + console.log('got ' + data.length + ' bytes of tarball data') }) ``` -#### `> pacote.packument(spec, [opts])` - -Fetches the *packument* for a package. Packument objects are general metadata -about a project corresponding to registry metadata, and include version and -`dist-tag` information about a package's available versions, rather than a -specific version. It may include additional metadata not usually available -through the individual package metadata objects. - -It generally looks something like this: - -```javascript -{ - "name": PkgName, - "dist-tags": { - 'latest': VersionString, - [TagName]: VersionString, - ... - }, - "versions": { - [VersionString]: Manifest, - ... - } -} -``` +Anything that you can do to with kind of package, you can do to any kind of +package. Data that isn't relevant (like a packument for a tarball) will be +simulated. -Note that depending on the spec type, some additional fields might be present. -For example, packages from `registry.npmjs.org` have additional metadata -appended by the registry. +## CLI -##### Example +This module exports a command line interface that can do most of what is +described below. Run `pacote -h` to learn more. -```javascript -pacote.packument('pacote').then(pkgJson => { - // fetched package versions metadata from the registry -}) ``` +Pacote - The JavaScript Package Handler, v10.1.1 -#### `> pacote.extract(spec, destination, [opts])` +Usage: -Extracts package data identified by `` into a directory named -``, which will be created if it does not already exist. + pacote resolve + Resolve a specifier and output the fully resolved target + Returns integrity and from if '--long' flag is set. -If `opts.digest` is provided and the data it identifies is present in the cache, -`extract` will bypass most of its operations and go straight to extracting the -tarball. + pacote manifest + Fetch a manifest and print to stdout -##### Example + pacote packument + Fetch a full packument and print to stdout -```javascript -pacote.extract('pacote@1.0.0', './woot', { - digest: 'deadbeef' -}).then(() => { - // Succeeds as long as `pacote@1.0.0` still exists somewhere. Network and - // other operations are bypassed entirely if `digest` is present in the cache. -}) -``` - -#### `> pacote.tarball(spec, [opts])` - -Fetches package data identified by `` and returns the data as a buffer. + pacote tarball [] + Fetch a package tarball and save to + If is missing or '-', the tarball will be streamed to stdout. -This API has two variants: + pacote extract + Extract a package to the destination folder. -* `pacote.tarball.stream(spec, [opts])` - Same as `pacote.tarball`, except it returns a stream instead of a Promise. -* `pacote.tarball.toFile(spec, dest, [opts])` - Instead of returning data directly, data will be written directly to `dest`, and create any required directories along the way. +Configuration values all match the names of configs passed to npm, or +options passed to Pacote. Additional flags for this executable: -##### Example + --long Print an object from 'resolve', including integrity and spec. + --json Print result objects as JSON rather than node's default. + (This is the default if stdout is not a TTY.) + --help -h Print this helpful text. -```javascript -pacote.tarball('pacote@1.0.0', { cache: './my-cache' }).then(data => { - // data is the tarball data for pacote@1.0.0 -}) +For example '--cache=/path/to/folder' will use that folder as the cache. ``` -#### `> pacote.tarball.stream(spec, [opts])` - -Same as `pacote.tarball`, except it returns a stream instead of a Promise. - -##### Example +## API + +The `spec` refers to any kind of package specifier that npm can install. +If you can pass it to the npm CLI, you can pass it to pacote. (In fact, +that's exactly what the npm CLI does.) + +See below for valid `opts` values. + +* `pacote.resolve(spec, opts)` Resolve a specifier like `foo@latest` or + `github:user/project` all the way to a tarball url, tarball file, or git + repo with commit hash. + +* `pacote.extract(spec, dest, opts)` Extract a package's tarball into a + destination folder. Returns a promise that resolves to the + `{from,resolved,integrity}` of the extracted package. + +* `pacote.manifest(spec, opts)` Fetch (or simulate) a package's manifest + (basically, the `package.json` file, plus a bit of metadata). + See below for more on manifests and packuments. Returns a Promise that + resolves to the manifest object. + +* `pacote.packument(spec, opts)` Fetch (or simulate) a package's packument + (basically, the top-level package document listing all the manifests that + the registry returns). See below for more on manifests and packuments. + Returns a Promise that resolves to the packument object. + +* `pacote.tarball(spec, opts)` Get a package tarball data as a buffer in + memory. Returns a Promise that resolves to the tarball data Buffer, with + `from`, `resolved`, and `integrity` fields attached. + +* `pacote.tarball.file(spec, dest, opts)` Save a package tarball data to + a file on disk. Returns a Promise that resolves to + `{from,integrity,resolved}` of the fetched tarball. + +* `pacote.tarball.stream(spec, streamHandler, opts)` Fetch a tarball and + make the stream available to the `streamHandler` function. + + This is mostly an internal function, but it is exposed because it does + provide some functionality that may be difficult to achieve otherwise. + + The `streamHandler` function MUST return a Promise that resolves when + the stream (and all associated work) is ended, or rejects if the stream + has an error. + + The `streamHandler` function MAY be called multiple times, as Pacote + retries requests in some scenarios, such as cache corruption or + retriable network failures. + +### Options + +Options are passed to +[`npm-registry-fetch`](http://npm.im/npm-registry-fetch) and +[`cacache`](http://npm.im/cacache), so in addition to these, anything for +those modules can be given to pacote as well. + +Options object is cloned, and mutated along the way to add integrity, +resolved, and other properties, as they are determined. + +* `cache` Where to store cache entries and temp files. Passed to + [`cacache`](http://npm.im/cacache). Defaults to the same cache directory + that npm will use by default, based on platform and environment. +* `where` Base folder for resolving relative `file:` dependencies. +* `resolved` Shortcut for looking up resolved values. Should be specified + if known. +* `integrity` Expected integrity of fetched package tarball. If specified, + tarballs with mismatched integrity values will raise an `EINTEGRITY` + error. +* `umask` Permission mode mask for extracted files and directories. + Defaults to `0o22`. See "Extracted File Modes" below. +* `fmode` Minimum permission mode for extracted files. Defaults to + `0o666`. See "Extracted File Modes" below. +* `dmode` Minimum permission mode for extracted directories. Defaults to + `0o777`. See "Extracted File Modes" below. +* `log` A logger object with methods for various log levels. Typically, + this will be [`npmlog`](http://npm.im/npmlog) in the npm CLI use case, + but if not specified, the default is a logger that emits `'log'` events + on the `process` object. +* `preferOnline` Prefer to revalidate cache entries, even when it would not + be strictly necessary. Default `false`. +* `before` When picking a manifest from a packument, only consider + packages published before the specified date. Default `null`. +* `defaultTag` The default `dist-tag` to use when choosing a manifest from a + packument. Defaults to `latest`. +* `registry` The npm registry to use by default. Defaults to + `https://registry.npmjs.org/`. +* `fullMetadata` Fetch the full metadata from the registry for packuments, + including information not strictly required for installation (author, + description, etc.) Defaults to `true` when `before` is set, since the + version publish time is part of the extended packument metadata. + +## Extracted File Modes + +Files are extracted with a mode matching the following formula: -```javascript -pacote.tarball.stream('pacote@1.0.0') -.pipe(fs.createWriteStream('./pacote-1.0.0.tgz')) ``` - -#### `> pacote.tarball.toFile(spec, dest, [opts])` - -Like `pacote.tarball`, but instead of returning data directly, data will be -written directly to `dest`, and create any required directories along the way. - -##### Example - -```javascript -pacote.tarball.toFile('pacote@1.0.0', './pacote-1.0.0.tgz') -.then(() => /* pacote tarball written directly to ./pacote-1.0.0.tgz */) +( (tarball entry mode value) | (minimum mode option) ) ~ (umask) ``` -#### `> pacote.prefetch(spec, [opts])` - -##### THIS API IS DEPRECATED. USE `pacote.tarball()` INSTEAD +This is in order to prevent unreadable files or unlistable directories from +cluttering a project's `node_modules` folder, even if the package tarball +specifies that the file should be inaccessible. -Fetches package data identified by ``, usually for the purpose of warming -up the local package cache (with `opts.cache`). It does not return anything. +It also prevents files from being group- or world-writable without explicit +opt-in by the user, because all file and directory modes are masked against +the `umask` value. -##### Example +So, a file which is `0o771` in the tarball, using the default `fmode` of +`0o666` and `umask` of `0o22`, will result in a file mode of `0o755`: -```javascript -pacote.prefetch('pacote@1.0.0', { cache: './my-cache' }).then(() => { - // ./my-cache now has both the manifest and tarball for `pacote@1.0.0`. -}) ``` - -#### `> pacote.clearMemoized()` - -This utility function can be used to force pacote to release its references -to any memoized data in its various internal caches. It might help free -some memory. - -```javascript -pacote.manifest(...).then(() => pacote.clearMemoized) - +(0o771 | 0o666) => 0o777 +(0o777 ~ 0o22) => 0o755 ``` -#### `> options` - -`pacote` accepts [the options for -`npm-registry-fetch`](https://npm.im/npm-registry-fetch#fetch-options) as-is, -with a couple of additional `pacote-specific` ones: - -##### `opts.dirPacker` - -* Type: Function -* Default: Uses [`npm-packlist`](https://npm.im/npm-packlist) and [`tar`](https://npm.im/tar) to make a tarball. - -Expects a function that takes a single argument, `dir`, and returns a -`ReadableStream` that outputs packaged tarball data. Used when creating tarballs -for package specs that are not already packaged, such as git and directory -dependencies. The default `opts.dirPacker` does not execute `prepare` scripts, -even though npm itself does. - -##### `opts.enjoy-by` - -* Alias: `opts.enjoyBy`, `opts.before` -* Type: Date-able -* Default: undefined - -If passed in, will be used while resolving to filter the versions for **registry -dependencies** such that versions published **after** `opts.enjoy-by` are not -considered -- as if they'd never been published. - -##### `opts.include-deprecated` - -* Alias: `opts.includeDeprecated` -* Type: Boolean -* Default: false - -If false, deprecated versions will be skipped when selecting from registry range -specifiers. If true, deprecations do not affect version selection. - -##### `opts.full-metadata` - -* Type: Boolean -* Default: false - -If `true`, the full packument will be fetched when doing metadata requests. By -defaul, `pacote` only fetches the summarized packuments, also called "corgis". - -##### `opts.tag` - -* Alias: `opts.defaultTag` -* Type: String -* Default: `'latest'` - -Package version resolution tag. When processing registry spec ranges, this -option is used to determine what dist-tag to treat as "latest". For more details -about how `pacote` selects versions and how `tag` is involved, see [the -documentation for `npm-pick-manifest`](https://npm.im/npm-pick-manifest). - -##### `opts.resolved` - -* Type: String -* Default: null - -When fetching tarballs, this option can be passed in to skip registry metadata -lookups when downloading tarballs. If the string is a `file:` URL, pacote will -try to read the referenced local file before attempting to do any further -lookups. This option does not bypass integrity checks when `opts.integrity` is -passed in. - -##### `opts.where` - -* Type: String -* Default: null - -Passed as an argument to [`npm-package-arg`](https://npm.im/npm-package-arg) -when resolving `spec` arguments. Used to determine what path to resolve local -path specs relatively from. +In almost every case, the defaults are appropriate. To respect exactly +what is in the package tarball (even if this makes an unusable system), set +both `dmode` and `fmode` options to `0`. Otherwise, the `umask` config +should be used in most cases where file mode modifications are required, +and this functions more or less the same as the `umask` value in most Unix +systems. + +## Extracted File Ownership + +When running as `root` on Unix systems, all extracted files and folders +will have their owning `uid` and `gid` values set to match the ownership +of the containing folder. + +This prevents `root`-owned files showing up in a project's `node_modules` +folder when a user runs `sudo npm install`. + +## Manifests + +A `manifest` is similar to a `package.json` file. However, it has a few +pieces of extra metadata, and sometimes lacks metadata that is inessential +to package installation. + +In addition to the common `package.json` fields, manifests include: + +* `manifest._resolved` The tarball url or file path where the package + artifact can be found. +* `manifest._from` A normalized form of the spec passed in as an argument. +* `manifest._integrity` The integrity value for the package artifact. +* `manifest.dist` Registry manifests (those included in a packument) have a + `dist` object. Only `tarball` is required, though at least one of + `shasum` or `integrity` is almost always present. + + * `tarball` The url to the associated package artifact. (Copied by + Pacote to `manifest._resolved`.) + * `integrity` The integrity SRI string for the artifact. This may not + be present for older packages on the npm registry. (Copied by Pacote + to `manifest._integrity`.) + * `shasum` Legacy integrity value. Hexadecimal-encoded sha1 hash. + (Converted to an SRI string and copied by Pacote to + `manifest._integrity` when `dist.integrity` is not present.) + * `fileCount` Number of files in the tarball. + * `unpackedSize` Size on disk of the package when unpacked. + * `npm-signature` A signature of the package by the + [`npmregistry`](https://keybase.io/npmregistry) Keybase account. + (Obviously only present for packages published to + `https://registry.npmjs.org`.) + +## Packuments + +A packument is the top-level package document that lists the set of +manifests for available versions for a package. + +When a packument is fetched with `accept: +application/vnd.npm.install-v1+json` in the HTTP headers, only the most +minimum necessary metadata is returned. Additional metadata is returned +when fetched with only `accept: application/json`. + +For Pacote's purposes, the following fields are relevant: + +* `versions` An object where each key is a version, and each value is the + manifest for that version. +* `dist-tags` An object mapping dist-tags to version numbers. This is how + `foo@latest` gets turned into `foo@1.2.3`. +* `time` In the full packument, an object mapping version numbers to + publication times, for the `opts.before` functionality. diff --git a/deps/npm/node_modules/pacote/extract.js b/deps/npm/node_modules/pacote/extract.js deleted file mode 100644 index 6ed0b18aaae1a4..00000000000000 --- a/deps/npm/node_modules/pacote/extract.js +++ /dev/null @@ -1,99 +0,0 @@ -'use strict' - -const BB = require('bluebird') - -const extractStream = require('./lib/extract-stream.js') -const fs = require('fs') -const mkdirp = BB.promisify(require('mkdirp')) -const npa = require('npm-package-arg') -const optCheck = require('./lib/util/opt-check.js') -const path = require('path') -const rimraf = BB.promisify(require('rimraf')) -const withTarballStream = require('./lib/with-tarball-stream.js') -const inferOwner = require('infer-owner') -const chown = BB.promisify(require('chownr')) - -const truncateAsync = BB.promisify(fs.truncate) -const readFileAsync = BB.promisify(fs.readFile) -const appendFileAsync = BB.promisify(fs.appendFile) - -// you used to call me on my... -const selfOwner = process.getuid ? { - uid: process.getuid(), - gid: process.getgid() -} : { - uid: undefined, - gid: undefined -} - -module.exports = extract -function extract (spec, dest, opts) { - opts = optCheck(opts) - spec = npa(spec, opts.where) - if (spec.type === 'git' && !opts.cache) { - throw new TypeError('Extracting git packages requires a cache folder') - } - if (typeof dest !== 'string') { - throw new TypeError('Extract requires a destination') - } - const startTime = Date.now() - return inferOwner(dest).then(({ uid, gid }) => { - opts = opts.concat({ uid, gid }) - return withTarballStream(spec, opts, stream => { - return tryExtract(spec, stream, dest, opts) - }) - .then(() => { - if (!opts.resolved) { - const pjson = path.join(dest, 'package.json') - return readFileAsync(pjson, 'utf8') - .then(str => truncateAsync(pjson) - .then(() => appendFileAsync(pjson, str.replace( - /}\s*$/, - `\n,"_resolved": ${ - JSON.stringify(opts.resolved || '') - }\n,"_integrity": ${ - JSON.stringify(opts.integrity || '') - }\n,"_from": ${ - JSON.stringify(spec.toString()) - }\n}` - )))) - } - }) - .then(() => opts.log.silly( - 'extract', - `${spec} extracted to ${dest} (${Date.now() - startTime}ms)` - )) - }) -} - -function tryExtract (spec, tarStream, dest, opts) { - return new BB((resolve, reject) => { - tarStream.on('error', reject) - - rimraf(dest) - .then(() => mkdirp(dest)) - .then((made) => { - // respect the current ownership of unpack targets - // but don't try to chown if we're not root. - if (selfOwner.uid === 0 && - typeof selfOwner.gid === 'number' && - selfOwner.uid !== opts.uid && selfOwner.gid !== opts.gid) { - return chown(made || dest, opts.uid, opts.gid) - } - }) - .then(() => { - const xtractor = extractStream(spec, dest, opts) - xtractor.on('error', reject) - xtractor.on('close', resolve) - tarStream.pipe(xtractor) - }) - .catch(reject) - }) - .catch(err => { - if (err.code === 'EINTEGRITY') { - err.message = `Verification failed while extracting ${spec}:\n${err.message}` - } - - throw err - }) -} diff --git a/deps/npm/node_modules/pacote/index.js b/deps/npm/node_modules/pacote/index.js deleted file mode 100644 index a0ed9875975b0e..00000000000000 --- a/deps/npm/node_modules/pacote/index.js +++ /dev/null @@ -1,10 +0,0 @@ -'use strict' - -module.exports = { - extract: require('./extract'), - manifest: require('./manifest'), - packument: require('./packument'), - prefetch: require('./prefetch'), - tarball: require('./tarball'), - clearMemoized: require('./lib/fetch').clearMemoized -} diff --git a/deps/npm/node_modules/pacote/lib/bin.js b/deps/npm/node_modules/pacote/lib/bin.js new file mode 100755 index 00000000000000..c0409be1ff085e --- /dev/null +++ b/deps/npm/node_modules/pacote/lib/bin.js @@ -0,0 +1,149 @@ +#!/usr/bin/env node + +const run = conf => { + const pacote = require('../') + switch (conf._[0]) { + case 'resolve': + if (conf.long) + return pacote.manifest(conf._[1], conf).then(mani => ({ + resolved: mani._resolved, + integrity: mani._integrity, + from: mani._from, + })) + case 'manifest': + case 'packument': + return pacote[conf._[0]](conf._[1], conf) + + case 'tarball': + if (!conf._[2] || conf._[2] === '-') { + return pacote.tarball.stream(conf._[1], stream => { + stream.pipe(conf.testStdout || + /* istanbul ignore next */ process.stdout) + // make sure it resolves something falsey + return stream.promise().then(() => {}) + }, conf) + } else + return pacote.tarball.file(conf._[1], conf._[2], conf) + + case 'extract': + return pacote.extract(conf._[1], conf._[2], conf) + + default: /* istanbul ignore next */ { + throw new Error(`bad command: ${conf._[0]}`) + } + } +} + +const version = require('../package.json').version +const usage = () => +`Pacote - The JavaScript Package Handler, v${version} + +Usage: + + pacote resolve + Resolve a specifier and output the fully resolved target + Returns integrity and from if '--long' flag is set. + + pacote manifest + Fetch a manifest and print to stdout + + pacote packument + Fetch a full packument and print to stdout + + pacote tarball [] + Fetch a package tarball and save to + If is missing or '-', the tarball will be streamed to stdout. + + pacote extract + Extract a package to the destination folder. + +Configuration values all match the names of configs passed to npm, or +options passed to Pacote. Additional flags for this executable: + + --long Print an object from 'resolve', including integrity and spec. + --json Print result objects as JSON rather than node's default. + (This is the default if stdout is not a TTY.) + --help -h Print this helpful text. + +For example '--cache=/path/to/folder' will use that folder as the cache. +` + +const shouldJSON = (conf, result) => + conf.json || + !process.stdout.isTTY && + conf.json === undefined && + result && + typeof result === 'object' + +const pretty = (conf, result) => + shouldJSON(conf, result) ? JSON.stringify(result, 0, 2) : result + +let addedLogListener = false +const main = args => { + const conf = parse(args) + if (conf.help || conf.h) + return console.log(usage()) + + if (!addedLogListener) { + process.on('log', console.error) + addedLogListener = true + } + + try { + return run(conf) + .then(result => result && console.log(pretty(conf, result))) + .catch(er => { + console.error(er) + process.exit(1) + }) + } catch (er) { + console.error(er.message) + console.error(usage()) + } +} + +const parseArg = arg => { + const split = arg.slice(2).split('=') + const k = split.shift() + const v = split.join('=') + const no = /^no-/.test(k) && !v + const key = (no ? k.substr(3) : k) + .replace(/^tag$/, 'defaultTag') + .replace(/-([a-z])/g, (_, c) => c.toUpperCase()) + const value = v ? v.replace(/^~/, process.env.HOME) : !no + return { key, value } +} + +const parse = args => { + const conf = { + _: [], + cache: process.env.HOME + '/.npm/_cacache', + } + let dashdash = false + args.forEach(arg => { + if (dashdash) + conf._.push(arg) + else if (arg === '--') + dashdash = true + else if (arg === '-h') + conf.help = true + else if (/^--/.test(arg)) { + const {key, value} = parseArg(arg) + conf[key] = value + } else { + conf._.push(arg) + } + }) + return conf +} + +if (module === require.main) + main(process.argv.slice(2)) +else + module.exports = { + main, + run, + usage, + parseArg, + parse, + } diff --git a/deps/npm/node_modules/pacote/lib/dir.js b/deps/npm/node_modules/pacote/lib/dir.js new file mode 100644 index 00000000000000..16660d9821eb4b --- /dev/null +++ b/deps/npm/node_modules/pacote/lib/dir.js @@ -0,0 +1,105 @@ +const Fetcher = require('./fetcher.js') +const FileFetcher = require('./file.js') +const cacache = require('cacache') +const Minipass = require('minipass') +const { promisify } = require('util') +const readPackageJson = require('read-package-json-fast') +const isPackageBin = require('./util/is-package-bin.js') +const packlist = require('npm-packlist') +const tar = require('tar') +const _prepareDir = Symbol('_prepareDir') +const _tarcOpts = Symbol('_tarcOpts') +const { resolve } = require('path') + +const runScript = require('@npmcli/run-script') + +const _tarballFromResolved = Symbol.for('pacote.Fetcher._tarballFromResolved') +class DirFetcher extends Fetcher { + constructor (spec, opts) { + super(spec, opts) + // just the fully resolved filename + this.resolved = this.spec.fetchSpec + } + + get types () { + return ['directory'] + } + + [_prepareDir] () { + return this.manifest().then(mani => { + if (!mani.scripts || !mani.scripts.prepare) + return + + // we *only* run prepare. + // pre/post-pack is run by the npm CLI for publish and pack, + // but this function is *also* run when installing git deps + return runScript({ + pkg: mani, + event: 'prepare', + path: this.resolved, + stdioString: true, + env: { + npm_package_resolved: this.resolved, + npm_package_integrity: this.integrity, + npm_package_json: resolve(this.resolved, 'package.json'), + }, + }) + }) + } + + [_tarballFromResolved] () { + const stream = new Minipass() + stream.resolved = this.resolved + stream.integrity = this.integrity + + // run the prepare script, get the list of files, and tar it up + // pipe to the stream, and proxy errors the chain. + this[_prepareDir]() + .then(() => packlist({ path: this.resolved })) + .then(files => tar.c(this[_tarcOpts](), files) + .on('error', er => stream.emit('error', er)).pipe(stream)) + .catch(er => stream.emit('error', er)) + return stream + } + + [_tarcOpts] () { + return { + cwd: this.resolved, + prefix: 'package/', + portable: true, + gzip: true, + + // ensure that package bins are always executable + // Note that npm-packlist is already filtering out + // anything that is not a regular file, ignored by + // .npmignore or package.json "files", etc. + filter: (path, stat) => { + if (isPackageBin(this.package, path)) + stat.mode |= 0o111 + return true + }, + + // Provide a specific date in the 1980s for the benefit of zip, + // which is confounded by files dated at the Unix epoch 0. + mtime: new Date('1985-10-26T08:15:00.000Z'), + } + } + + manifest () { + if (this.package) + return Promise.resolve(this.package) + + return readPackageJson(this.resolved + '/package.json') + .then(mani => this.package = { + ...mani, + _integrity: this.integrity && String(this.integrity), + _resolved: this.resolved, + _from: this.from, + }) + } + + packument () { + return FileFetcher.prototype.packument.apply(this) + } +} +module.exports = DirFetcher diff --git a/deps/npm/node_modules/pacote/lib/extract-stream.js b/deps/npm/node_modules/pacote/lib/extract-stream.js deleted file mode 100644 index d967b9f8972760..00000000000000 --- a/deps/npm/node_modules/pacote/lib/extract-stream.js +++ /dev/null @@ -1,89 +0,0 @@ -'use strict' - -const Minipass = require('minipass') -const path = require('path') -const tar = require('tar') - -module.exports = extractStream -module.exports._computeMode = computeMode - -class Transformer extends Minipass { - constructor (spec, opts) { - super() - this.spec = spec - this.opts = opts - this.str = '' - } - write (data) { - this.str += data - return true - } - end () { - const replaced = this.str.replace( - /}\s*$/, - `\n,"_resolved": ${ - JSON.stringify(this.opts.resolved || '') - }\n,"_integrity": ${ - JSON.stringify(this.opts.integrity || '') - }\n,"_from": ${ - JSON.stringify(this.spec.toString()) - }\n}` - ) - super.write(replaced) - return super.end() - } -} - -function computeMode (fileMode, optMode, umask) { - return (fileMode | optMode) & ~(umask || 0) -} - -function pkgJsonTransform (spec, opts) { - return entry => { - if (entry.path === 'package.json') { - const transformed = new Transformer(spec, opts) - return transformed - } - } -} - -function extractStream (spec, dest, opts) { - opts = opts || {} - const sawIgnores = new Set() - return tar.x({ - cwd: dest, - filter: (name, entry) => !entry.header.type.match(/^.*link$/i), - strip: 1, - onwarn: msg => opts.log && opts.log.warn('tar', msg), - uid: opts.uid, - gid: opts.gid, - umask: opts.umask, - transform: opts.resolved && pkgJsonTransform(spec, opts), - onentry (entry) { - if (entry.type.toLowerCase() === 'file') { - entry.mode = computeMode(entry.mode, opts.fmode, opts.umask) - } else if (entry.type.toLowerCase() === 'directory') { - entry.mode = computeMode(entry.mode, opts.dmode, opts.umask) - } else { - entry.mode = computeMode(entry.mode, 0, opts.umask) - } - - // Note: This mirrors logic in the fs read operations that are - // employed during tarball creation, in the fstream-npm module. - // It is duplicated here to handle tarballs that are created - // using other means, such as system tar or git archive. - if (entry.type.toLowerCase() === 'file') { - const base = path.basename(entry.path) - if (base === '.npmignore') { - sawIgnores.add(entry.path) - } else if (base === '.gitignore') { - const npmignore = entry.path.replace(/\.gitignore$/, '.npmignore') - if (!sawIgnores.has(npmignore)) { - // Rename, may be clobbered later. - entry.path = npmignore - } - } - } - } - }) -} diff --git a/deps/npm/node_modules/pacote/lib/fetch.js b/deps/npm/node_modules/pacote/lib/fetch.js deleted file mode 100644 index 36fb6b6d3da1af..00000000000000 --- a/deps/npm/node_modules/pacote/lib/fetch.js +++ /dev/null @@ -1,82 +0,0 @@ -'use strict' - -const duck = require('protoduck') - -const Fetcher = duck.define(['spec', 'opts', 'manifest'], { - packument: ['spec', 'opts'], - manifest: ['spec', 'opts'], - tarball: ['spec', 'opts'], - fromManifest: ['manifest', 'spec', 'opts'], - clearMemoized () {} -}, { name: 'Fetcher' }) -module.exports = Fetcher - -module.exports.packument = packument -function packument (spec, opts) { - const fetcher = getFetcher(spec.type) - return fetcher.packument(spec, opts) -} - -module.exports.manifest = manifest -function manifest (spec, opts) { - const fetcher = getFetcher(spec.type) - return fetcher.manifest(spec, opts) -} - -module.exports.tarball = tarball -function tarball (spec, opts) { - return getFetcher(spec.type).tarball(spec, opts) -} - -module.exports.fromManifest = fromManifest -function fromManifest (manifest, spec, opts) { - return getFetcher(spec.type).fromManifest(manifest, spec, opts) -} - -const fetchers = {} - -module.exports.clearMemoized = clearMemoized -function clearMemoized () { - Object.keys(fetchers).forEach(k => { - fetchers[k].clearMemoized() - }) -} - -function getFetcher (type) { - if (!fetchers[type]) { - // This is spelled out both to prevent sketchy stuff and to make life - // easier for bundlers/preprocessors. - switch (type) { - case 'alias': - fetchers[type] = require('./fetchers/alias') - break - case 'directory': - fetchers[type] = require('./fetchers/directory') - break - case 'file': - fetchers[type] = require('./fetchers/file') - break - case 'git': - fetchers[type] = require('./fetchers/git') - break - case 'hosted': - fetchers[type] = require('./fetchers/hosted') - break - case 'range': - fetchers[type] = require('./fetchers/range') - break - case 'remote': - fetchers[type] = require('./fetchers/remote') - break - case 'tag': - fetchers[type] = require('./fetchers/tag') - break - case 'version': - fetchers[type] = require('./fetchers/version') - break - default: - throw new Error(`Invalid dependency type requested: ${type}`) - } - } - return fetchers[type] -} diff --git a/deps/npm/node_modules/pacote/lib/fetcher.js b/deps/npm/node_modules/pacote/lib/fetcher.js new file mode 100644 index 00000000000000..01058acb2bfef7 --- /dev/null +++ b/deps/npm/node_modules/pacote/lib/fetcher.js @@ -0,0 +1,470 @@ +// This is the base class that the other fetcher types in lib +// all descend from. +// It handles the unpacking and retry logic that is shared among +// all of the other Fetcher types. + +const npa = require('npm-package-arg') +const ssri = require('ssri') +const { promisify } = require('util') +const { basename, dirname } = require('path') +const rimraf = promisify(require('rimraf')) +const tar = require('tar') +const procLog = require('./util/proc-log.js') +const retry = require('promise-retry') +const fsm = require('fs-minipass') +const cacache = require('cacache') +const isPackageBin = require('./util/is-package-bin.js') +const getContents = require('@npmcli/installed-package-contents') + +// we only change ownership on unix platforms, and only if uid is 0 +const selfOwner = process.getuid && process.getuid() === 0 ? { + uid: 0, + gid: process.getgid(), +} : null +const chownr = selfOwner ? promisify(require('chownr')) : null +const inferOwner = selfOwner ? require('infer-owner') : null +const mkdirp = require('mkdirp') +const cacheDir = require('./util/cache-dir.js') + +// Private methods. +// Child classes should not have to override these. +// Users should never call them. +const _chown = Symbol('_chown') +const _extract = Symbol('_extract') +const _mkdir = Symbol('_mkdir') +const _empty = Symbol('_empty') +const _toFile = Symbol('_toFile') +const _tarxOptions = Symbol('_tarxOptions') +const _entryMode = Symbol('_entryMode') +const _istream = Symbol('_istream') +const _assertType = Symbol('_assertType') +const _tarballFromCache = Symbol('_tarballFromCache') +const _tarballFromResolved = Symbol.for('pacote.Fetcher._tarballFromResolved') + +class FetcherBase { + constructor (spec, opts) { + if (!opts || typeof opts !== 'object') + throw new TypeError('options object is required') + this.spec = npa(spec, opts.where) + + // a bit redundant because presumably the caller already knows this, + // but it makes it easier to not have to keep track of the requested + // spec when we're dispatching thousands of these at once, and normalizing + // is nice. saveSpec is preferred if set, because it turns stuff like + // x/y#committish into github:x/y#committish. use name@rawSpec for + // registry deps so that we turn xyz and xyz@ -> xyz@ + this.from = this.spec.registry + ? `${this.spec.name}@${this.spec.rawSpec}` : this.spec.saveSpec + + this[_assertType]() + // clone the opts object so that others aren't upset when we mutate it + // by adding/modifying the integrity value. + this.opts = {...opts} + this.cache = opts.cache || cacheDir() + this.resolved = opts.resolved || null + + // default to caching/verifying with sha512, that's what we usually have + // need to change this default, or start overriding it, when sha512 + // is no longer strong enough. + this.defaultIntegrityAlgorithm = opts.defaultIntegrityAlgorithm || 'sha512' + + if (typeof opts.integrity === 'string') + this.opts.integrity = ssri.parse(opts.integrity) + + this.package = null + this.type = this.constructor.name + this.fmode = opts.fmode || 0o666 + this.dmode = opts.dmode || 0o777 + this.umask = opts.umask || 0o022 + this.log = opts.log || procLog + + this.preferOnline = !!opts.preferOnline + this.preferOffline = !!opts.preferOffline + this.offline = !!opts.offline + + this.before = opts.before + this.fullMetadata = this.before ? true : !!opts.fullMetadata + + this.defaultTag = opts.defaultTag || 'latest' + this.registry = (opts.registry || 'https://registry.npmjs.org') + .replace(/\/+$/, '') + + // command to run 'prepare' scripts on directories and git dirs + // To use pacote with yarn, for example, set npmBin to 'yarn' + // and npmInstallCmd to ['add'], and npmCliConfig with yarn's equivalents. + this.npmBin = opts.npmBin || 'npm' + + // command to install deps for preparing + this.npmInstallCmd = opts.npmInstallCmd || [ + 'install', + '--only=dev', + '--prod', + '--ignore-prepublish', + '--no-progress', + '--no-save', + ] + + // XXX fill more of this in based on what we know from this.opts + // we explicitly DO NOT fill in --tag, though, since we are often + // going to be packing in the context of a publish, which may set + // a dist-tag, but certainly wants to keep defaulting to latest. + this.npmCliConfig = opts.npmCliConfig || [ + `--cache=${this.cache}`, + `--prefer-offline=${!!this.preferOffline}`, + `--prefer-online=${!!this.preferOnline}`, + `--offline=${!!this.offline}`, + `--before=${this.before ? this.before.toISOString() : ''}`, + ] + } + + get integrity () { + return this.opts.integrity || null + } + set integrity (i) { + if (!i) + return + + i = ssri.parse(i) + const current = this.opts.integrity + + // do not ever update an existing hash value, but do + // merge in NEW algos and hashes that we don't already have. + if (current) + current.merge(i) + else + this.opts.integrity = i + } + + get notImplementedError () { + return new Error('not implemented in this fetcher type: ' + this.type) + } + + // override in child classes + // Returns a Promise that resolves to this.resolved string value + resolve () { + return this.resolved ? Promise.resolve(this.resolved) + : Promise.reject(this.notImplementedError) + } + + packument () { + return Promise.reject(this.notImplementedError) + } + + // override in child class + // returns a manifest containing: + // - name + // - version + // - _resolved + // - _integrity + // - plus whatever else was in there (corgi, full metadata, or pj file) + manifest () { + return Promise.reject(this.notImplementedError) + } + + // private, should be overridden. + // Note that they should *not* calculate or check integrity, but *just* + // return the raw tarball data stream. + [_tarballFromResolved] () { + throw this.notImplementedError + } + + // public, should not be overridden + tarball () { + return this.tarballStream(stream => new Promise((res, rej) => { + const buf = [] + stream.on('error', er => rej(er)) + stream.on('end', () => { + const data = Buffer.concat(buf) + data.integrity = this.integrity && String(this.integrity) + data.resolved = this.resolved + data.from = this.from + return res(data) + }) + stream.on('data', d => buf.push(d)) + })) + } + + // private + // Note: cacache will raise a EINTEGRITY error if the integrity doesn't match + [_tarballFromCache] () { + return cacache.get.stream.byDigest(this.cache, this.integrity, this.opts) + } + + [_istream] (stream) { + // everyone will need one of these, either for verifying or calculating + // We always set it, because we have might only have a weak legacy hex + // sha1 in the packument, and this MAY upgrade it to a stronger algo. + // If we had an integrity, and it doesn't match, then this does not + // override that error; the istream will raise the error before it + // gets to the point of re-setting the integrity. + const istream = ssri.integrityStream(this.opts) + istream.on('integrity', i => this.integrity = i) + return stream.on('error', er => istream.emit('error', er)).pipe(istream) + } + + pickIntegrityAlgorithm () { + return this.integrity ? this.integrity.pickAlgorithm(this.opts) + : this.defaultIntegrityAlgorithm + } + + // TODO: check error class, once those are rolled out to our deps + isDataCorruptionError (er) { + return er.code === 'EINTEGRITY' || er.code === 'Z_DATA_ERROR' + } + + // override the types getter + get types () {} + [_assertType] () { + if (this.types && !this.types.includes(this.spec.type)) { + throw new TypeError(`Wrong spec type (${ + this.spec.type + }) for ${ + this.constructor.name + }. Supported types: ${this.types.join(', ')}`) + } + } + + // We allow ENOENTs from cacache, but not anywhere else. + // An ENOENT trying to read a tgz file, for example, is Right Out. + isRetriableError (er) { + // TODO: check error class, once those are rolled out to our deps + return this.isDataCorruptionError(er) || er.code === 'ENOENT' + } + + // Mostly internal, but has some uses + // Pass in a function which returns a promise + // Function will be called 1 or more times with streams that may fail. + // Retries: + // Function MUST handle errors on the stream by rejecting the promise, + // so that retry logic can pick it up and either retry or fail whatever + // promise it was making (ie, failing extraction, etc.) + // + // The return value of this method is a Promise that resolves the same + // as whatever the streamHandler resolves to. + // + // This should never be overridden by child classes, but it is public. + tarballStream (streamHandler) { + // Only short-circuit via cache if we have everything else we'll need, + // and the user has not expressed a preference for checking online. + + const fromCache = ( + !this.preferOnline && + this.integrity && + this.resolved + ) ? streamHandler(this[_tarballFromCache]()).catch(er => { + if (this.isDataCorruptionError(er)) { + this.log.warn('tarball', `cached data for ${ + this.spec + } (${this.integrity}) seems to be corrupted. Refreshing cache.`) + return this.cleanupCached().then(() => { throw er }) + } else { + throw er + } + }) : null + + const fromResolved = er => { + if (er) { + if (!this.isRetriableError(er)) + throw er + this.log.silly('tarball', `no local data for ${ + this.spec + }. Extracting by manifest.`) + } + return this.resolve().then(() => retry(tryAgain => + streamHandler(this[_istream](this[_tarballFromResolved]())) + .catch(er => { + // Most likely data integrity. A cache ENOENT error is unlikely + // here, since we're definitely not reading from the cache, but it + // IS possible that the fetch subsystem accessed the cache, and the + // entry got blown away or something. Try one more time to be sure. + if (this.isRetriableError(er)) { + this.log.warn('tarball', `tarball data for ${ + this.spec + } (${this.integrity}) seems to be corrupted. Trying again.`) + return this.cleanupCached().then(() => tryAgain(er)) + } + throw er + }), { retries: 1, minTimeout: 0, maxTimeout: 0 })) + } + + return fromCache ? fromCache.catch(fromResolved) : fromResolved() + } + + cleanupCached () { + return cacache.rm.content(this.cache, this.integrity, this.opts) + } + + [_chown] (path, uid, gid) { + return selfOwner && (selfOwner.gid !== gid || selfOwner.uid !== uid) + ? chownr(path, uid, gid) + : /* istanbul ignore next - we don't test in root-owned folders */ null + } + + [_empty] (path) { + return getContents({path, depth: 1}).then(contents => Promise.all( + contents.map(entry => rimraf(entry)))) + } + + [_mkdir] (dest) { + // if we're bothering to do owner inference, then do it. + // otherwise just make the dir, and return an empty object. + // always empty the dir dir to start with, but do so + // _after_ inferring the owner, in case there's an existing folder + // there that we would want to preserve which differs from the + // parent folder (rare, but probably happens sometimes). + return !inferOwner + ? this[_empty](dest).then(() => mkdirp(dest)).then(() => ({})) + : inferOwner(dest).then(({uid, gid}) => + this[_empty](dest) + .then(() => mkdirp(dest)) + .then(made => { + // ignore the || dest part in coverage. It's there to handle + // race conditions where the dir may be made by someone else + // after being removed by us. + const dir = made || /* istanbul ignore next */ dest + return this[_chown](dir, uid, gid) + }) + .then(() => ({uid, gid}))) + } + + // extraction is always the same. the only difference is where + // the tarball comes from. + extract (dest) { + return this[_mkdir](dest).then(({uid, gid}) => + this.tarballStream(tarball => this[_extract](dest, tarball, uid, gid))) + } + + [_toFile] (dest) { + return this.tarballStream(str => new Promise((res, rej) => { + const writer = new fsm.WriteStream(dest) + str.on('error', er => writer.emit('error', er)) + writer.on('error', er => rej(er)) + writer.on('close', () => res({ + integrity: this.integrity && String(this.integrity), + resolved: this.resolved, + from: this.from, + })) + str.pipe(writer) + })) + } + + // don't use this[_mkdir] because we don't want to rimraf anything + tarballFile (dest) { + const dir = dirname(dest) + return !inferOwner + ? mkdirp(dir).then(() => this[_toFile](dest)) + : inferOwner(dest).then(({uid, gid}) => + mkdirp(dir).then(made => this[_toFile](dest) + .then(res => this[_chown](made || dir, uid, gid) + .then(() => res)))) + } + + [_extract] (dest, tarball, uid, gid) { + const extractor = tar.x(this[_tarxOptions]({ cwd: dest, uid, gid })) + const p = new Promise((resolve, reject) => { + extractor.on('end', () => { + resolve({ + resolved: this.resolved, + integrity: this.integrity && String(this.integrity), + from: this.from, + }) + }) + + extractor.on('error', er => { + this.log.warn('tar', er.message) + this.log.silly('tar', er) + reject(er) + }) + + tarball.on('error', er => reject(er)) + }) + + tarball.pipe(extractor) + return p + } + + // always ensure that entries are at least as permissive as our configured + // dmode/fmode, but never more permissive than the umask allows. + [_entryMode] (path, mode, type) { + const m = /Directory|GNUDumpDir/.test(type) ? this.dmode + : /File$/.test(type) ? this.fmode + : /* istanbul ignore next - should never happen in a pkg */ 0 + + // make sure package bins are executable + const exe = isPackageBin(this.package, path) ? 0o111 : 0 + return ((mode | m) & ~this.umask) | exe + } + + [_tarxOptions] ({ cwd, uid, gid }) { + const sawIgnores = new Set() + return { + cwd, + filter: (name, entry) => { + if (/Link$/.test(entry.type)) + return false + entry.mode = this[_entryMode](entry.path, entry.mode, entry.type) + // this replicates the npm pack behavior where .gitignore files + // are treated like .npmignore files, but only if a .npmignore + // file is not present. + if (/File$/.test(entry.type)) { + const base = basename(entry.path) + if (base === '.npmignore') + sawIgnores.add(entry.path) + else if (base === '.gitignore') { + // rename, but only if there's not already a .npmignore + const ni = entry.path.replace(/\.gitignore$/, '.npmignore') + if (sawIgnores.has(ni)) + return false + entry.path = ni + } + return true + } + }, + strip: 1, + onwarn: /* istanbul ignore next - we can trust that tar logs */ + (code, msg, data) => { + this.log.warn('tar', code, msg) + this.log.silly('tar', code, msg, data) + }, + uid, + gid, + umask: this.umask, + } + } +} + +module.exports = FetcherBase + +// Child classes +const GitFetcher = require('./git.js') +const RegistryFetcher = require('./registry.js') +const FileFetcher = require('./file.js') +const DirFetcher = require('./dir.js') +const RemoteFetcher = require('./remote.js') + +// Get an appropriate fetcher object from a spec and options +FetcherBase.get = (rawSpec, opts = {}) => { + const spec = npa(rawSpec, opts.where) + switch (spec.type) { + case 'git': + return new GitFetcher(spec, opts) + + case 'remote': + return new RemoteFetcher(spec, opts) + + case 'version': + case 'range': + case 'tag': + case 'alias': + return new RegistryFetcher(spec.subSpec || spec, opts) + + case 'file': + return new FileFetcher(spec, opts) + + case 'directory': + return new DirFetcher(spec, opts) + + default: + throw new TypeError('Unknown spec type: ' + spec.type) + } +} diff --git a/deps/npm/node_modules/pacote/lib/fetchers/alias.js b/deps/npm/node_modules/pacote/lib/fetchers/alias.js deleted file mode 100644 index f22cbb1d7ca825..00000000000000 --- a/deps/npm/node_modules/pacote/lib/fetchers/alias.js +++ /dev/null @@ -1,24 +0,0 @@ -'use strict' - -const Fetcher = require('../fetch') -const fetchRegistry = require('./registry') - -const fetchRemote = module.exports = Object.create(null) - -Fetcher.impl(fetchRemote, { - packument (spec, opts) { - return fetchRegistry.packument(spec.subSpec, opts) - }, - - manifest (spec, opts) { - return fetchRegistry.manifest(spec.subSpec, opts) - }, - - tarball (spec, opts) { - return fetchRegistry.tarball(spec.subSpec, opts) - }, - - fromManifest (manifest, spec, opts) { - return fetchRegistry.fromManifest(manifest, spec.subSpec, opts) - } -}) diff --git a/deps/npm/node_modules/pacote/lib/fetchers/directory.js b/deps/npm/node_modules/pacote/lib/fetchers/directory.js deleted file mode 100644 index fc9c46cd3b7e9c..00000000000000 --- a/deps/npm/node_modules/pacote/lib/fetchers/directory.js +++ /dev/null @@ -1,89 +0,0 @@ -'use strict' - -const BB = require('bluebird') - -const Fetcher = require('../fetch') -const glob = BB.promisify(require('glob')) -const packDir = require('../util/pack-dir') -const readJson = require('../util/read-json') -const path = require('path') -const pipe = BB.promisify(require('mississippi').pipe) -const through = require('mississippi').through -const normalizePackageBin = require('npm-normalize-package-bin') - -const readFileAsync = BB.promisify(require('fs').readFile) - -const fetchDirectory = module.exports = Object.create(null) - -Fetcher.impl(fetchDirectory, { - packument (spec, opts) { - return this.manifest(spec, opts).then(manifest => { - return Object.assign({}, manifest, { - 'dist-tags': { - 'latest': manifest.version - }, - time: { - [manifest.version]: (new Date()).toISOString() - }, - versions: { - [manifest.version]: manifest - } - }) - }) - }, - // `directory` manifests come from the actual manifest/lockfile data. - manifest (spec, opts) { - const pkgPath = path.join(spec.fetchSpec, 'package.json') - const srPath = path.join(spec.fetchSpec, 'npm-shrinkwrap.json') - return BB.join( - readFileAsync(pkgPath).then(readJson).catch({ code: 'ENOENT' }, err => { - err.code = 'ENOPACKAGEJSON' - throw err - }), - readFileAsync(srPath).then(readJson).catch({ code: 'ENOENT' }, () => null), - (pkg, sr) => { - pkg._shrinkwrap = sr - pkg._hasShrinkwrap = !!sr - pkg._resolved = spec.fetchSpec - pkg._integrity = false // Don't auto-calculate integrity - pkg._shasum = false // Don't auto-calculate shasum either - return pkg - } - ).then(pkg => { - if (!pkg.bin && pkg.directories && pkg.directories.bin) { - const dirBin = pkg.directories.bin - return glob(path.join(spec.fetchSpec, dirBin, '/**'), { nodir: true }).then(matches => { - matches.forEach(filePath => { - const relative = path.relative(spec.fetchSpec, filePath) - if (relative && relative[0] !== '.') { - if (!pkg.bin) { pkg.bin = {} } - pkg.bin[path.basename(relative)] = relative - } - }) - }).then(() => pkg) - } else { - return pkg - } - }).then(pkg => normalizePackageBin(pkg)) - }, - - // As of npm@5, the npm installer doesn't pack + install directories: it just - // creates symlinks. This code is here because `npm pack` still needs the - // ability to create a tarball from a local directory. - tarball (spec, opts) { - const stream = through() - this.manifest(spec, opts).then(mani => { - return pipe(this.fromManifest(mani, spec, opts), stream) - }).catch(err => stream.emit('error', err)) - return stream - }, - - // `directory` tarballs are generated in a very similar way to git tarballs. - fromManifest (manifest, spec, opts) { - const stream = through() - packDir(manifest, manifest._resolved, manifest._resolved, stream, opts).catch(err => { - stream.emit('error', err) - }) - return stream - } -}) diff --git a/deps/npm/node_modules/pacote/lib/fetchers/file.js b/deps/npm/node_modules/pacote/lib/fetchers/file.js deleted file mode 100644 index a58e329130987f..00000000000000 --- a/deps/npm/node_modules/pacote/lib/fetchers/file.js +++ /dev/null @@ -1,78 +0,0 @@ -'use strict' - -const BB = require('bluebird') - -const cacache = require('cacache') -const Fetcher = require('../fetch') -const fs = require('fs') -const pipe = BB.promisify(require('mississippi').pipe) -const through = require('mississippi').through - -const readFileAsync = BB.promisify(fs.readFile) -const statAsync = BB.promisify(fs.stat) - -const MAX_BULK_SIZE = 2 * 1024 * 1024 // 2MB - -// `file` packages refer to local tarball files. -const fetchFile = module.exports = Object.create(null) - -Fetcher.impl(fetchFile, { - packument (spec, opts) { - return BB.reject(new Error('Not implemented yet')) - }, - - manifest (spec, opts) { - // We can't do much here. `finalizeManifest` will take care of - // calling `tarball` to fill out all the necessary details. - return BB.resolve(null) - }, - - // All the heavy lifting for `file` packages is done here. - // They're never cached. We just read straight out of the file. - // TODO - maybe they *should* be cached? - tarball (spec, opts) { - const src = spec._resolved || spec.fetchSpec - const stream = through() - statAsync(src).then(stat => { - if (spec._resolved) { stream.emit('manifest', spec) } - if (stat.size <= MAX_BULK_SIZE) { - // YAY LET'S DO THING IN BULK - return readFileAsync(src).then(data => { - if (opts.cache) { - return cacache.put( - opts.cache, `pacote:tarball:file:${src}`, data, { - integrity: opts.integrity - } - ).then(integrity => ({ data, integrity })) - } else { - return { data } - } - }).then(info => { - if (info.integrity) { stream.emit('integrity', info.integrity) } - stream.write(info.data, () => { - stream.end() - }) - }) - } else { - let integrity - const cacheWriter = !opts.cache - ? BB.resolve(null) - : (pipe( - fs.createReadStream(src), - cacache.put.stream(opts.cache, `pacote:tarball:${src}`, { - integrity: opts.integrity - }).on('integrity', d => { integrity = d }) - )) - return cacheWriter.then(() => { - if (integrity) { stream.emit('integrity', integrity) } - return pipe(fs.createReadStream(src), stream) - }) - } - }).catch(err => stream.emit('error', err)) - return stream - }, - - fromManifest (manifest, spec, opts) { - return this.tarball(manifest || spec, opts) - } -}) diff --git a/deps/npm/node_modules/pacote/lib/fetchers/git.js b/deps/npm/node_modules/pacote/lib/fetchers/git.js deleted file mode 100644 index a1579d1f943125..00000000000000 --- a/deps/npm/node_modules/pacote/lib/fetchers/git.js +++ /dev/null @@ -1,178 +0,0 @@ -'use strict' - -const BB = require('bluebird') - -const cacache = require('cacache') -const cacheKey = require('../util/cache-key') -const Fetcher = require('../fetch') -const git = require('../util/git') -const mkdirp = BB.promisify(require('mkdirp')) -const pickManifest = require('npm-pick-manifest') -const optCheck = require('../util/opt-check') -const osenv = require('osenv') -const packDir = require('../util/pack-dir') -const PassThrough = require('stream').PassThrough -const path = require('path') -const pipe = BB.promisify(require('mississippi').pipe) -const rimraf = BB.promisify(require('rimraf')) -const uniqueFilename = require('unique-filename') - -// `git` dependencies are fetched from git repositories and packed up. -const fetchGit = module.exports = Object.create(null) - -Fetcher.impl(fetchGit, { - packument (spec, opts) { - return BB.reject(new Error('Not implemented yet.')) - }, - - manifest (spec, opts) { - opts = optCheck(opts) - if (spec.hosted && spec.hosted.getDefaultRepresentation() === 'shortcut') { - return hostedManifest(spec, opts) - } else { - // If it's not a shortcut, don't do fallbacks. - return plainManifest(spec.fetchSpec, spec, opts) - } - }, - - tarball (spec, opts) { - opts = optCheck(opts) - const stream = new PassThrough() - this.manifest(spec, opts).then(manifest => { - stream.emit('manifest', manifest) - return pipe( - this.fromManifest( - manifest, spec, opts - ).on('integrity', i => stream.emit('integrity', i)), stream - ) - }).catch(err => stream.emit('error', err)) - return stream - }, - - fromManifest (manifest, spec, opts) { - opts = optCheck(opts) - let streamError - const stream = new PassThrough().on('error', e => { streamError = e }) - const cacheName = manifest._uniqueResolved || manifest._resolved || '' - const cacheStream = ( - opts.cache && - cacache.get.stream( - opts.cache, cacheKey('packed-dir', cacheName), opts - ).on('integrity', i => stream.emit('integrity', i)) - ) - cacheStream.pipe(stream) - cacheStream.on('error', err => { - if (err.code !== 'ENOENT') { - return stream.emit('error', err) - } else { - stream.emit('reset') - return withTmp(opts, tmp => { - if (streamError) { throw streamError } - return cloneRepo( - spec, manifest._repo, manifest._ref, manifest._rawRef, tmp, opts - ).then(HEAD => { - if (streamError) { throw streamError } - manifest._resolved = spec.saveSpec.replace(/(:?#.*)?$/, `#${HEAD}`) - manifest._uniqueResolved = manifest._resolved - return packDir(manifest, manifest._uniqueResolved, tmp, stream, opts) - }) - }).catch(err => stream.emit('error', err)) - } - }) - return stream - } -}) - -function hostedManifest (spec, opts) { - return BB.resolve(null).then(() => { - if (!spec.hosted.git()) { - throw new Error(`No git url for ${spec}`) - } - return plainManifest(spec.hosted.git(), spec, opts) - }).catch(err => { - if (!spec.hosted.https()) { - throw err - } - return plainManifest(spec.hosted.https(), spec, opts) - }).catch(err => { - if (!spec.hosted.sshurl()) { - throw err - } - return plainManifest(spec.hosted.sshurl(), spec, opts) - }) -} - -function plainManifest (repo, spec, opts) { - const rawRef = spec.gitCommittish || spec.gitRange - return resolve( - repo, spec, spec.name, opts - ).then(ref => { - if (ref) { - const resolved = spec.saveSpec.replace(/(?:#.*)?$/, `#${ref.sha}`) - return { - _repo: repo, - _resolved: resolved, - _spec: spec, - _ref: ref, - _rawRef: spec.gitCommittish || spec.gitRange, - _uniqueResolved: resolved, - _integrity: false, - _shasum: false - } - } else { - // We're SOL and need a full clone :( - // - // If we're confident enough that `rawRef` is a commit SHA, - // then we can at least get `finalize-manifest` to cache its result. - const resolved = spec.saveSpec.replace(/(?:#.*)?$/, rawRef ? `#${rawRef}` : '') - return { - _repo: repo, - _rawRef: rawRef, - _resolved: rawRef && rawRef.match(/^[a-f0-9]{40}$/) && resolved, - _uniqueResolved: rawRef && rawRef.match(/^[a-f0-9]{40}$/) && resolved, - _integrity: false, - _shasum: false - } - } - }) -} - -function resolve (url, spec, name, opts) { - const isSemver = !!spec.gitRange - return git.revs(url, opts).then(remoteRefs => { - return isSemver - ? pickManifest({ - versions: remoteRefs.versions, - 'dist-tags': remoteRefs['dist-tags'], - name: name - }, spec.gitRange, opts) - : remoteRefs - ? BB.resolve( - remoteRefs.refs[spec.gitCommittish] || remoteRefs.refs[remoteRefs.shas[spec.gitCommittish]] - ) - : null - }) -} - -function withTmp (opts, cb) { - if (opts.cache) { - // cacache has a special facility for working in a tmp dir - return cacache.tmp.withTmp(opts.cache, { tmpPrefix: 'git-clone' }, cb) - } else { - const tmpDir = path.join(osenv.tmpdir(), 'pacote-git-tmp') - const tmpName = uniqueFilename(tmpDir, 'git-clone') - const tmp = mkdirp(tmpName).then(() => tmpName).disposer(rimraf) - return BB.using(tmp, cb) - } -} - -// Only certain whitelisted hosted gits support shadow cloning -const SHALLOW_HOSTS = new Set(['github', 'gist', 'gitlab', 'bitbucket']) -function cloneRepo (spec, repo, resolvedRef, rawRef, tmp, opts) { - const ref = resolvedRef ? resolvedRef.ref : rawRef - if (resolvedRef && spec.hosted && SHALLOW_HOSTS.has(spec.hosted.type)) { - return git.shallow(repo, ref, tmp, opts) - } else { - return git.clone(repo, ref, tmp, opts) - } -} diff --git a/deps/npm/node_modules/pacote/lib/fetchers/hosted.js b/deps/npm/node_modules/pacote/lib/fetchers/hosted.js deleted file mode 100644 index d41793c810121b..00000000000000 --- a/deps/npm/node_modules/pacote/lib/fetchers/hosted.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict' - -module.exports = require('./git') diff --git a/deps/npm/node_modules/pacote/lib/fetchers/range.js b/deps/npm/node_modules/pacote/lib/fetchers/range.js deleted file mode 100644 index 9f172e9861f39b..00000000000000 --- a/deps/npm/node_modules/pacote/lib/fetchers/range.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict' - -module.exports = require('./registry') diff --git a/deps/npm/node_modules/pacote/lib/fetchers/registry/index.js b/deps/npm/node_modules/pacote/lib/fetchers/registry/index.js deleted file mode 100644 index 2cca7040bda4ae..00000000000000 --- a/deps/npm/node_modules/pacote/lib/fetchers/registry/index.js +++ /dev/null @@ -1,32 +0,0 @@ -'use strict' - -const cacache = require('cacache') -const Fetcher = require('../../fetch') -const regManifest = require('./manifest') -const regPackument = require('./packument') -const regTarball = require('./tarball') - -const fetchRegistry = module.exports = Object.create(null) - -Fetcher.impl(fetchRegistry, { - packument (spec, opts) { - return regPackument(spec, opts) - }, - - manifest (spec, opts) { - return regManifest(spec, opts) - }, - - tarball (spec, opts) { - return regTarball(spec, opts) - }, - - fromManifest (manifest, spec, opts) { - return regTarball.fromManifest(manifest, spec, opts) - }, - - clearMemoized () { - cacache.clearMemoized() - regPackument.clearMemoized() - } -}) diff --git a/deps/npm/node_modules/pacote/lib/fetchers/registry/manifest.js b/deps/npm/node_modules/pacote/lib/fetchers/registry/manifest.js deleted file mode 100644 index 00deb13af236de..00000000000000 --- a/deps/npm/node_modules/pacote/lib/fetchers/registry/manifest.js +++ /dev/null @@ -1,81 +0,0 @@ -'use strict' - -const fetch = require('npm-registry-fetch') -const fetchPackument = require('./packument') -const optCheck = require('../../util/opt-check') -const pickManifest = require('npm-pick-manifest') -const ssri = require('ssri') - -module.exports = manifest -function manifest (spec, opts) { - opts = optCheck(opts) - - return getManifest(spec, opts).then(manifest => { - return annotateManifest(spec, manifest, opts) - }) -} - -function getManifest (spec, opts) { - opts = opts.concat({ - fullMetadata: opts.enjoyBy ? true : opts.fullMetadata - }) - return fetchPackument(spec, opts).then(packument => { - try { - return pickManifest(packument, spec.fetchSpec, { - defaultTag: opts.defaultTag, - enjoyBy: opts.enjoyBy, - includeDeprecated: opts.includeDeprecated - }) - } catch (err) { - if ((err.code === 'ETARGET' || err.code === 'E403') && packument._cached && !opts.offline) { - opts.log.silly( - 'registry:manifest', - `no matching version for ${spec.name}@${spec.fetchSpec} in the cache. Forcing revalidation.` - ) - opts = opts.concat({ - preferOffline: false, - preferOnline: true - }) - return fetchPackument(spec, opts.concat({ - // Fetch full metadata in case ETARGET was due to corgi delay - fullMetadata: true - })).then(packument => { - return pickManifest(packument, spec.fetchSpec, { - defaultTag: opts.defaultTag, - enjoyBy: opts.enjoyBy - }) - }) - } else { - throw err - } - } - }) -} - -function annotateManifest (spec, manifest, opts) { - const shasum = manifest.dist && manifest.dist.shasum - manifest._integrity = manifest.dist && manifest.dist.integrity - manifest._shasum = shasum - if (!manifest._integrity && shasum) { - // Use legacy dist.shasum field if available. - manifest._integrity = ssri.fromHex(shasum, 'sha1').toString() - } - manifest._resolved = ( - manifest.dist && manifest.dist.tarball - ) - if (!manifest._resolved) { - const registry = fetch.pickRegistry(spec, opts) - const uri = registry.replace(/\/?$/, '/') + spec.escapedName - - const err = new Error( - `Manifest for ${manifest.name}@${manifest.version} from ${uri} is missing a tarball url (pkg.dist.tarball). Guessing a default.` - ) - err.code = 'ENOTARBALL' - err.manifest = manifest - if (!manifest._warnings) { manifest._warnings = [] } - manifest._warnings.push(err.message) - manifest._resolved = - `${registry}/${manifest.name}/-/${manifest.name}-${manifest.version}.tgz` - } - return manifest -} diff --git a/deps/npm/node_modules/pacote/lib/fetchers/registry/packument.js b/deps/npm/node_modules/pacote/lib/fetchers/registry/packument.js deleted file mode 100644 index f5286c80371c30..00000000000000 --- a/deps/npm/node_modules/pacote/lib/fetchers/registry/packument.js +++ /dev/null @@ -1,92 +0,0 @@ -'use strict' - -const BB = require('bluebird') - -const fetch = require('npm-registry-fetch') -const LRU = require('lru-cache') -const optCheck = require('../../util/opt-check') - -// Corgis are cute. 🐕🐶 -const CORGI_DOC = 'application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */*' -const JSON_DOC = 'application/json' - -module.exports = packument -function packument (spec, opts) { - opts = optCheck(opts) - - const registry = fetch.pickRegistry(spec, opts) - const uri = registry.replace(/\/?$/, '/') + spec.escapedName - - return fetchPackument(uri, registry, spec, opts) -} - -const MEMO = new LRU({ - length: m => m._contentLength, - max: 200 * 1024 * 1024, // 200MB - maxAge: 30 * 1000 // 30s -}) - -module.exports.clearMemoized = clearMemoized -function clearMemoized () { - MEMO.reset() -} - -function fetchPackument (uri, registry, spec, opts) { - const mem = pickMem(opts) - const accept = opts.fullMetadata ? JSON_DOC : CORGI_DOC - const memoKey = `${uri}~(${accept})` - if (mem && !opts.preferOnline && mem.has(memoKey)) { - return BB.resolve(mem.get(memoKey)) - } - - return fetch(uri, opts.concat({ - headers: { - 'pacote-req-type': 'packument', - 'pacote-pkg-id': `registry:${spec.name}`, - accept - }, - spec - }, opts, { - // Force integrity to null: we never check integrity hashes for manifests - integrity: null - })).then(res => res.json().then(packument => { - packument._cached = res.headers.has('x-local-cache') - packument._contentLength = +res.headers.get('content-length') - // NOTE - we need to call pickMem again because proxy - // objects get reused! - const mem = pickMem(opts) - if (mem) { - mem.set(memoKey, packument) - } - return packument - })).catch(err => { - if (err.code === 'E404' && !opts.fullMetadata) { - return fetchPackument(uri, registry, spec, opts.concat({ - fullMetadata: true - })) - } else { - throw err - } - }) -} - -class ObjProxy { - get (key) { return this.obj[key] } - set (key, val) { this.obj[key] = val } -} - -// This object is used synchronously and immediately, so -// we can safely reuse it instead of consing up new ones -const PROX = new ObjProxy() -function pickMem (opts) { - if (!opts || !opts.memoize) { - return MEMO - } else if (opts.memoize.get && opts.memoize.set) { - return opts.memoize - } else if (typeof opts.memoize === 'object') { - PROX.obj = opts.memoize - return PROX - } else { - return null - } -} diff --git a/deps/npm/node_modules/pacote/lib/fetchers/registry/tarball.js b/deps/npm/node_modules/pacote/lib/fetchers/registry/tarball.js deleted file mode 100644 index 134153280e6f55..00000000000000 --- a/deps/npm/node_modules/pacote/lib/fetchers/registry/tarball.js +++ /dev/null @@ -1,102 +0,0 @@ -'use strict' - -const BB = require('bluebird') - -const fetch = require('npm-registry-fetch') -const manifest = require('./manifest') -const optCheck = require('../../util/opt-check') -const PassThrough = require('stream').PassThrough -const ssri = require('ssri') -const url = require('url') - -module.exports = tarball -function tarball (spec, opts) { - opts = optCheck(opts) - const registry = fetch.pickRegistry(spec, opts) - const stream = new PassThrough() - let mani - if ( - opts.resolved && - // spec.type === 'version' && - opts.resolved.indexOf(registry) === 0 - ) { - // fakeChild is a shortcut to avoid looking up a manifest! - mani = BB.resolve({ - name: spec.name, - version: spec.fetchSpec, - _integrity: opts.integrity, - _resolved: opts.resolved, - _fakeChild: true - }) - } else { - // We can't trust opts.resolved if it's going to a separate host. - mani = manifest(spec, opts) - } - - mani.then(mani => { - !mani._fakeChild && stream.emit('manifest', mani) - const fetchStream = fromManifest(mani, spec, opts).on( - 'integrity', i => stream.emit('integrity', i) - ) - fetchStream.on('error', err => stream.emit('error', err)) - fetchStream.pipe(stream) - return null - }).catch(err => stream.emit('error', err)) - return stream -} - -module.exports.fromManifest = fromManifest -function fromManifest (manifest, spec, opts) { - opts = optCheck(opts) - if (spec.scope) { opts = opts.concat({ scope: spec.scope }) } - const stream = new PassThrough() - const registry = fetch.pickRegistry(spec, opts) - const uri = getTarballUrl(spec, registry, manifest, opts) - fetch(uri, opts.concat({ - headers: { - 'pacote-req-type': 'tarball', - 'pacote-pkg-id': `registry:${manifest.name}@${uri}` - }, - integrity: manifest._integrity, - algorithms: [ - manifest._integrity - ? ssri.parse(manifest._integrity).pickAlgorithm() - : 'sha1' - ], - spec - }, opts)) - .then(res => { - const hash = res.headers.get('x-local-cache-hash') - if (hash) { - stream.emit('integrity', decodeURIComponent(hash)) - } - res.body.on('error', err => stream.emit('error', err)) - res.body.pipe(stream) - return null - }) - .catch(err => stream.emit('error', err)) - return stream -} - -function getTarballUrl (spec, registry, mani, opts) { - const reg = url.parse(registry) - const tarball = url.parse(mani._resolved) - // https://github.com/npm/npm/pull/9471 - // - // TL;DR: Some alternative registries host tarballs on http and packuments - // on https, and vice-versa. There's also a case where people who can't use - // SSL to access the npm registry, for example, might use - // `--registry=http://registry.npmjs.org/`. In this case, we need to - // rewrite `tarball` to match the protocol. - // - if (reg.hostname === tarball.hostname && reg.protocol !== tarball.protocol) { - tarball.protocol = reg.protocol - // Ports might be same host different protocol! - if (reg.port !== tarball.port) { - delete tarball.host - tarball.port = reg.port - } - delete tarball.href - } - return url.format(tarball) -} diff --git a/deps/npm/node_modules/pacote/lib/fetchers/remote.js b/deps/npm/node_modules/pacote/lib/fetchers/remote.js deleted file mode 100644 index 8941f993815f87..00000000000000 --- a/deps/npm/node_modules/pacote/lib/fetchers/remote.js +++ /dev/null @@ -1,34 +0,0 @@ -'use strict' - -const BB = require('bluebird') - -const Fetcher = require('../fetch') -const fetchRegistry = require('./registry') - -const fetchRemote = module.exports = Object.create(null) - -Fetcher.impl(fetchRemote, { - packument (spec, opts) { - return BB.reject(new Error('Not implemented yet')) - }, - - manifest (spec, opts) { - // We can't get the manifest for a remote tarball until - // we extract the tarball itself. - // `finalize-manifest` takes care of this process of extracting - // a manifest based on ./tarball.js - return BB.resolve(null) - }, - - tarball (spec, opts) { - const uri = spec._resolved || spec.fetchSpec - return fetchRegistry.fromManifest({ - _resolved: uri, - _integrity: opts.integrity - }, spec, opts) - }, - - fromManifest (manifest, spec, opts) { - return this.tarball(manifest || spec, opts) - } -}) diff --git a/deps/npm/node_modules/pacote/lib/fetchers/tag.js b/deps/npm/node_modules/pacote/lib/fetchers/tag.js deleted file mode 100644 index 9f172e9861f39b..00000000000000 --- a/deps/npm/node_modules/pacote/lib/fetchers/tag.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict' - -module.exports = require('./registry') diff --git a/deps/npm/node_modules/pacote/lib/fetchers/version.js b/deps/npm/node_modules/pacote/lib/fetchers/version.js deleted file mode 100644 index 9f172e9861f39b..00000000000000 --- a/deps/npm/node_modules/pacote/lib/fetchers/version.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict' - -module.exports = require('./registry') diff --git a/deps/npm/node_modules/pacote/lib/file.js b/deps/npm/node_modules/pacote/lib/file.js new file mode 100644 index 00000000000000..d5c601aabd873d --- /dev/null +++ b/deps/npm/node_modules/pacote/lib/file.js @@ -0,0 +1,93 @@ +const Fetcher = require('./fetcher.js') +const fsm = require('fs-minipass') +const cacache = require('cacache') +const { promisify } = require('util') +const readPackageJson = require('read-package-json-fast') +const _tarballFromResolved = Symbol.for('pacote.Fetcher._tarballFromResolved') +const _exeBins = Symbol('_exeBins') +const { resolve } = require('path') +const fs = require('fs') + +class FileFetcher extends Fetcher { + constructor (spec, opts) { + super(spec, opts) + // just the fully resolved filename + this.resolved = this.spec.fetchSpec + } + + get types () { + return ['file'] + } + + manifest () { + if (this.package) + return Promise.resolve(this.package) + + // have to unpack the tarball for this. + return cacache.tmp.withTmp(this.cache, this.opts, dir => + this.extract(dir) + .then(() => readPackageJson(dir + '/package.json')) + .then(mani => this.package = { + ...mani, + _integrity: this.integrity && String(this.integrity), + _resolved: this.resolved, + _from: this.from, + })) + } + + [_exeBins] (pkg, dest) { + if (!pkg.bin) + return Promise.resolve() + + return Promise.all(Object.keys(pkg.bin).map(k => new Promise(res => { + const script = resolve(dest, pkg.bin[k]) + // Best effort. Ignore errors here, the only result is that + // a bin script is not executable. But if it's missing or + // something, we just leave it for a later stage to trip over + // when we can provide a more useful contextual error. + fs.stat(script, (er, st) => { + if (er) + return res() + const mode = st.mode | 0o111 + if (mode === st.mode) + return res() + fs.chmod(script, mode, res) + }) + }))) + } + + extract (dest) { + // if we've already loaded the manifest, then the super got it. + // but if not, read the unpacked manifest and chmod properly. + return super.extract(dest) + .then(result => this.package ? result + : readPackageJson(dest + '/package.json').then(pkg => + this[_exeBins](pkg, dest)).then(() => result)) + } + + [_tarballFromResolved] () { + // create a read stream and return it + return new fsm.ReadStream(this.resolved) + } + + packument () { + // simulate based on manifest + return this.manifest().then(mani => ({ + name: mani.name, + 'dist-tags': { + [this.defaultTag]: mani.version + }, + versions: { + [mani.version]: { + ...mani, + dist: { + tarball: `file:${this.resolved}`, + integrity: this.integrity && String(this.integrity), + } + } + } + })) + } +} + +module.exports = FileFetcher diff --git a/deps/npm/node_modules/pacote/lib/finalize-manifest.js b/deps/npm/node_modules/pacote/lib/finalize-manifest.js deleted file mode 100644 index 80b9cda73b6ee1..00000000000000 --- a/deps/npm/node_modules/pacote/lib/finalize-manifest.js +++ /dev/null @@ -1,248 +0,0 @@ -'use strict' - -const BB = require('bluebird') - -const cacache = require('cacache') -const cacheKey = require('./util/cache-key') -const fetchFromManifest = require('./fetch').fromManifest -const finished = require('./util/finished') -const minimatch = require('minimatch') -const normalize = require('normalize-package-data') -const optCheck = require('./util/opt-check') -const path = require('path') -const pipe = BB.promisify(require('mississippi').pipe) -const ssri = require('ssri') -const tar = require('tar') -const readJson = require('./util/read-json') -const normalizePackageBin = require('npm-normalize-package-bin') - -// `finalizeManifest` takes as input the various kinds of manifests that -// manifest handlers ('lib/fetchers/*.js#manifest()') return, and makes sure -// they are: -// -// * filled out with any required data that the handler couldn't fill in -// * formatted consistently -// * cached so we don't have to repeat this work more than necessary -// -// The biggest thing this package might do is do a full tarball extraction in -// order to find missing bits of metadata required by the npm installer. For -// example, it will fill in `_shrinkwrap`, `_integrity`, and other details that -// the plain manifest handlers would require a tarball to fill out. If a -// handler returns everything necessary, this process is skipped. -// -// If we get to the tarball phase, the corresponding tarball handler for the -// requested type will be invoked and the entire tarball will be read from the -// stream. -// -module.exports = finalizeManifest -function finalizeManifest (pkg, spec, opts) { - const key = finalKey(pkg, spec) - opts = optCheck(opts) - - const cachedManifest = (opts.cache && key && !opts.preferOnline && !opts.fullMetadata && !opts.enjoyBy) - ? cacache.get.info(opts.cache, key, opts) - : BB.resolve(null) - - return cachedManifest.then(cached => { - if (cached && cached.metadata && cached.metadata.manifest) { - return new Manifest(cached.metadata.manifest) - } else { - return tarballedProps(pkg, spec, opts).then(props => { - return pkg && pkg.name - ? new Manifest(pkg, props, opts.fullMetadata) - : new Manifest(props, null, opts.fullMetadata) - }).then(manifest => { - const cacheKey = key || finalKey(manifest, spec) - if (!opts.cache || !cacheKey) { - return manifest - } else { - return cacache.put( - opts.cache, cacheKey, '.', { - metadata: { - id: manifest._id, - manifest, - type: 'finalized-manifest' - } - } - ).then(() => manifest) - } - }) - } - }) -} - -module.exports.Manifest = Manifest -function Manifest (pkg, fromTarball, fullMetadata) { - fromTarball = fromTarball || {} - if (fullMetadata) { - Object.assign(this, pkg) - } - this.name = pkg.name - this.version = pkg.version - this.engines = pkg.engines || fromTarball.engines - this.cpu = pkg.cpu || fromTarball.cpu - this.os = pkg.os || fromTarball.os - this.dependencies = pkg.dependencies || {} - this.optionalDependencies = pkg.optionalDependencies || {} - this.peerDependenciesMeta = pkg.peerDependenciesMeta || {} - this.devDependencies = pkg.devDependencies || {} - const bundled = ( - pkg.bundledDependencies || - pkg.bundleDependencies || - false - ) - this.bundleDependencies = bundled - this.peerDependencies = pkg.peerDependencies || {} - this.deprecated = pkg.deprecated || false - - // These depend entirely on each handler - this._resolved = pkg._resolved - - // Not all handlers (or registries) provide these out of the box, - // and if they don't, we need to extract and read the tarball ourselves. - // These are details required by the installer. - this._integrity = pkg._integrity || fromTarball._integrity || null - this._shasum = pkg._shasum || fromTarball._shasum || null - this._shrinkwrap = pkg._shrinkwrap || fromTarball._shrinkwrap || null - this.bin = pkg.bin || fromTarball.bin || null - - // turn arrays and strings into a legit object, strip out bad stuff - normalizePackageBin(this) - - this._id = null - - // TODO - freezing and inextensibility pending npm changes. See test suite. - // Object.preventExtensions(this) - normalize(this) - - // I don't want this why did you give it to me. Go away. 🔥🔥🔥🔥 - delete this.readme - - // Object.freeze(this) -} - -// Some things aren't filled in by standard manifest fetching. -// If this function needs to do its work, it will grab the -// package tarball, extract it, and take whatever it needs -// from the stream. -function tarballedProps (pkg, spec, opts) { - const needsShrinkwrap = (!pkg || ( - pkg._hasShrinkwrap !== false && - !pkg._shrinkwrap - )) - const needsBin = !!(!pkg || ( - !pkg.bin && - pkg.directories && - pkg.directories.bin - )) - const needsIntegrity = !pkg || (!pkg._integrity && pkg._integrity !== false) - const needsShasum = !pkg || (!pkg._shasum && pkg._shasum !== false) - const needsHash = needsIntegrity || needsShasum - const needsManifest = !pkg || !pkg.name - const needsExtract = needsShrinkwrap || needsBin || needsManifest - if (!needsShrinkwrap && !needsBin && !needsHash && !needsManifest) { - return BB.resolve({}) - } else { - opts = optCheck(opts) - const tarStream = fetchFromManifest(pkg, spec, opts) - const extracted = needsExtract && new tar.Parse() - return BB.join( - needsShrinkwrap && jsonFromStream('npm-shrinkwrap.json', extracted), - needsManifest && jsonFromStream('package.json', extracted), - needsBin && getPaths(extracted), - needsHash && ssri.fromStream(tarStream, { algorithms: ['sha1', 'sha512'] }), - needsExtract && pipe(tarStream, extracted), - (sr, mani, paths, hash) => { - if (needsManifest && !mani) { - const err = new Error(`Non-registry package missing package.json: ${spec}.`) - err.code = 'ENOPACKAGEJSON' - throw err - } - const extraProps = mani || {} - delete extraProps._resolved - // drain out the rest of the tarball - tarStream.resume() - // if we have directories.bin, we need to collect any matching files - // to add to bin - if (paths && paths.length) { - const dirBin = mani - ? (mani && mani.directories && mani.directories.bin) - : (pkg && pkg.directories && pkg.directories.bin) - if (dirBin) { - extraProps.bin = {} - paths.forEach(filePath => { - if (minimatch(filePath, dirBin + '/**')) { - const relative = path.relative(dirBin, filePath) - if (relative && relative[0] !== '.') { - extraProps.bin[path.basename(relative)] = path.join(dirBin, relative) - } - } - }) - } - } - return Object.assign(extraProps, { - _shrinkwrap: sr, - _resolved: (mani && mani._resolved) || - (pkg && pkg._resolved) || - spec.fetchSpec, - _integrity: needsIntegrity && hash && hash.sha512 && hash.sha512[0].toString(), - _shasum: needsShasum && hash && hash.sha1 && hash.sha1[0].hexDigest() - }) - } - ) - } -} - -function jsonFromStream (filename, dataStream) { - return BB.fromNode(cb => { - dataStream.on('error', cb) - dataStream.on('close', cb) - dataStream.on('entry', entry => { - const filePath = entry.header.path.replace(/[^/]+\//, '') - if (filePath !== filename) { - entry.resume() - } else { - let data = '' - entry.on('error', cb) - finished(entry).then(() => { - try { - cb(null, readJson(data)) - } catch (err) { - cb(err) - } - }, err => { - cb(err) - }) - entry.on('data', d => { data += d }) - } - }) - }) -} - -function getPaths (dataStream) { - return BB.fromNode(cb => { - let paths = [] - dataStream.on('error', cb) - dataStream.on('close', () => cb(null, paths)) - dataStream.on('entry', function handler (entry) { - const filePath = entry.header.path.replace(/[^/]+\//, '') - entry.resume() - paths.push(filePath) - }) - }) -} - -function finalKey (pkg, spec) { - if (pkg && pkg._uniqueResolved) { - // git packages have a unique, identifiable id, but no tar sha - return cacheKey(`${spec.type}-manifest`, pkg._uniqueResolved) - } else { - return ( - pkg && pkg._integrity && - cacheKey( - `${spec.type}-manifest`, - `${pkg._resolved}:${ssri.stringify(pkg._integrity)}` - ) - ) - } -} diff --git a/deps/npm/node_modules/pacote/lib/git.js b/deps/npm/node_modules/pacote/lib/git.js new file mode 100644 index 00000000000000..81f7ca2567ce36 --- /dev/null +++ b/deps/npm/node_modules/pacote/lib/git.js @@ -0,0 +1,272 @@ +const Fetcher = require('./fetcher.js') +const FileFetcher = require('./file.js') +const RemoteFetcher = require('./remote.js') +const DirFetcher = require('./dir.js') +const hashre = /^[a-f0-9]{40}$/ +const git = require('@npmcli/git') +const pickManifest = require('npm-pick-manifest') +const npa = require('npm-package-arg') +const url = require('url') +const Minipass = require('minipass') +const cacache = require('cacache') +const { promisify } = require('util') +const readPackageJson = require('read-package-json-fast') +const npm = require('./util/npm.js') + +const _resolvedFromRepo = Symbol('_resolvedFromRepo') +const _resolvedFromHosted = Symbol('_resolvedFromHosted') +const _resolvedFromClone = Symbol('_resolvedFromClone') +const _tarballFromResolved = Symbol.for('pacote.Fetcher._tarballFromResolved') +const _addGitSha = Symbol('_addGitSha') +const _clone = Symbol('_clone') +const _cloneHosted = Symbol('_cloneHosted') +const _cloneRepo = Symbol('_cloneRepo') +const _setResolvedWithSha = Symbol('_setResolvedWithSha') +const _prepareDir = Symbol('_prepareDir') + +// get the repository url. prefer ssh, fall back to git:// +// We have to add the git+ back because npa suppresses it. +const repoUrl = (hosted, opts) => + hosted.sshurl && addGitPlus(hosted.sshurl(opts)) || + hosted.https && addGitPlus(hosted.https(opts)) + +const addGitPlus = url => url && `git+${url}` + +class GitFetcher extends Fetcher { + constructor (spec, opts) { + super(spec, opts) + this.resolvedRef = null + if (this.spec.hosted) + this.from = this.spec.hosted.shortcut({ noCommittish: false }) + + // shortcut: avoid full clone when we can go straight to the tgz + // if we have the full sha and it's a hosted git platform + if (this.spec.gitCommittish && hashre.test(this.spec.gitCommittish)) { + this.resolvedSha = this.spec.gitCommittish + // use hosted.tarball() when we shell to RemoteFetcher later + this.resolved = this.spec.hosted + ? repoUrl(this.spec.hosted, { noCommittish: false }) + : this.spec.fetchSpec + '#' + this.spec.gitCommittish + } else + this.resolvedSha = '' + } + + get types () { + return ['git'] + } + + resolve () { + // likely a hosted git repo with a sha, so get the tarball url + // but in general, no reason to resolve() more than necessary! + if (this.resolved) + return super.resolve() + + // fetch the git repo and then look at the current hash + const h = this.spec.hosted + // try to use ssh, fall back to git. + return h ? this[_resolvedFromHosted](h) + : this[_resolvedFromRepo](this.spec.fetchSpec) + } + + // first try https, since that's faster and passphrase-less for + // public repos. Fall back to SSH to support private repos. + // NB: we always store the SSH url in the 'resolved' field. + [_resolvedFromHosted] (hosted) { + return this[_resolvedFromRepo](hosted.https && hosted.https()) + .catch(er => { + const ssh = hosted.sshurl && hosted.sshurl() + if (!ssh) + throw er + return this[_resolvedFromRepo](ssh) + }) + } + + [_resolvedFromRepo] (gitRemote) { + // XXX make this a custom error class + if (!gitRemote) + return Promise.reject(new Error(`No git url for ${this.spec}`)) + const gitRange = this.spec.gitRange + const name = this.spec.name + return git.revs(gitRemote, this.opts).then(remoteRefs => { + return gitRange ? pickManifest({ + versions: remoteRefs.versions, + 'dist-tags': remoteRefs['dist-tags'], + name, + }, gitRange, this.opts) + : this.spec.gitCommittish ? + remoteRefs.refs[this.spec.gitCommittish] || + remoteRefs.refs[remoteRefs.shas[this.spec.gitCommittish]] + : remoteRefs.refs.HEAD // no git committish, get default head + }).then(revDoc => { + // the committish provided isn't in the rev list + // things like HEAD~3 or @yesterday can land here. + if (!revDoc || !revDoc.sha) + return this[_resolvedFromClone]() + + this.resolvedRef = revDoc + this.resolvedSha = revDoc.sha + this[_addGitSha](revDoc.sha) + return this.resolved + }) + } + + [_setResolvedWithSha] (withSha) { + // we haven't cloned, so a tgz download is still faster + // of course, if it's not a known host, we can't do that. + this.resolved = !this.spec.hosted ? withSha + : repoUrl(npa(withSha).hosted, { noCommittish: false }) + } + + // when we get the git sha, we affix it to our spec to build up + // either a git url with a hash, or a tarball download URL + [_addGitSha] (sha) { + if (this.spec.hosted) { + this[_setResolvedWithSha]( + this.spec.hosted.shortcut({ noCommittish: true }) + '#' + sha + ) + } else { + const u = url.format(new url.URL(`#${sha}`, this.spec.rawSpec)) + this[_setResolvedWithSha](url.format(u)) + } + } + + [_resolvedFromClone] () { + // do a full or shallow clone, then look at the HEAD + // kind of wasteful, but no other option, really + return this[_clone](dir => this.resolved) + } + + [_prepareDir] (dir) { + return readPackageJson(dir + '/package.json').then(mani => { + // no need if we aren't going to do any preparation. + const scripts = mani.scripts + if (!scripts || !( + scripts.postinstall || + scripts.build || + scripts.preinstall || + scripts.install || + scripts.prepare)) + return + + // the DirFetcher will do its own preparation to run the prepare scripts + // All we have to do is put the deps in place so that it can succeed. + return npm( + this.npmBin, + [].concat(this.npmInstallCmd).concat(this.npmCliConfig), + dir, + { message: 'git dep preparation failed' } + ) + }) + } + + [_tarballFromResolved] () { + const stream = new Minipass() + stream.resolved = this.resolved + stream.integrity = this.integrity + stream.from = this.from + + // check it out and then shell out to the DirFetcher tarball packer + this[_clone](dir => this[_prepareDir](dir) + .then(() => new Promise((res, rej) => { + const df = new DirFetcher(`file:${dir}`, { + ...this.opts, + resolved: null, + integrity: null, + }) + const dirStream = df[_tarballFromResolved]() + dirStream.on('error', rej) + dirStream.on('end', res) + dirStream.pipe(stream) + }))).catch( + /* istanbul ignore next: very unlikely and hard to test */ + er => stream.emit('error', er) + ) + return stream + } + + // clone a git repo into a temp folder (or fetch and unpack if possible) + // handler accepts a directory, and returns a promise that resolves + // when we're done with it, at which point, cacache deletes it + // + // TODO: after cloning, create a tarball of the folder, and add to the cache + // with cacache.put.stream(), using a key that's deterministic based on the + // spec and repo, so that we don't ever clone the same thing multiple times. + [_clone] (handler, tarballOk = true) { + const o = { tmpPrefix: 'git-clone' } + const ref = this.resolvedSha || this.spec.gitCommittish + const h = this.spec.hosted + const resolved = this.resolved + + // can be set manually to false to fall back to actual git clone + tarballOk = tarballOk && + h && resolved === repoUrl(h, { noCommittish: false }) && h.tarball + + return cacache.tmp.withTmp(this.cache, o, tmp => { + // if we're resolved, and have a tarball url, shell out to RemoteFetcher + if (tarballOk) { + const nameat = this.spec.name ? `${this.spec.name}@` : '' + return new RemoteFetcher(h.tarball({ noCommittish: false }), { + ...this.opts, + pkgid: `git:${nameat}${this.resolved}`, + resolved: this.resolved, + integrity: null, // it'll always be different, if we have one + }).extract(tmp).then(() => handler(tmp), er => { + // fall back to ssh download if tarball fails + if (er.constructor.name.match(/^Http/)) + return this[_clone](handler, false) + else + throw er + }) + } + + return ( + h ? this[_cloneHosted](ref, tmp) + : this[_cloneRepo](this.spec.fetchSpec, ref, tmp) + ).then(sha => { + this.resolvedSha = sha + if (!this.resolved) + this[_addGitSha](sha) + }) + .then(() => handler(tmp)) + }) + } + + [_cloneHosted] (ref, tmp) { + const hosted = this.spec.hosted + const https = hosted.https() + return this[_cloneRepo](hosted.https({ noCommittish: true }), ref, tmp) + .catch(er => { + const ssh = hosted.sshurl && hosted.sshurl({ noCommittish: true }) + /* istanbul ignore if - should be covered by the resolve() call */ + if (!ssh) + throw er + return this[_cloneRepo](ssh, ref, tmp) + }) + } + + [_cloneRepo] (repo, ref, tmp) { + const { opts, spec } = this + return git.clone(repo, ref, tmp, { ...opts, spec }) + } + + manifest () { + if (this.package) + return Promise.resolve(this.package) + + return this.spec.hosted && this.resolved + ? FileFetcher.prototype.manifest.apply(this) + : this[_clone](dir => + readPackageJson(dir + '/package.json') + .then(mani => this.package = { + ...mani, + _integrity: this.integrity && String(this.integrity), + _resolved: this.resolved, + _from: this.from, + })) + } + + packument () { + return FileFetcher.prototype.packument.apply(this) + } +} +module.exports = GitFetcher diff --git a/deps/npm/node_modules/pacote/lib/index.js b/deps/npm/node_modules/pacote/lib/index.js new file mode 100644 index 00000000000000..546ba960baa2ea --- /dev/null +++ b/deps/npm/node_modules/pacote/lib/index.js @@ -0,0 +1,12 @@ +const { get } = require('./fetcher.js') +module.exports = { + resolve: (spec, opts) => get(spec, opts).resolve(), + extract: (spec, dest, opts) => get(spec, opts).extract(dest), + manifest: (spec, opts) => get(spec, opts).manifest(), + tarball: (spec, opts) => get(spec, opts).tarball(), + packument: (spec, opts) => get(spec, opts).packument(), +} +module.exports.tarball.stream = (spec, handler, opts) => + get(spec, opts).tarballStream(handler) +module.exports.tarball.file = (spec, dest, opts) => + get(spec, opts).tarballFile(dest) diff --git a/deps/npm/node_modules/pacote/lib/registry.js b/deps/npm/node_modules/pacote/lib/registry.js new file mode 100644 index 00000000000000..b9df036146406d --- /dev/null +++ b/deps/npm/node_modules/pacote/lib/registry.js @@ -0,0 +1,159 @@ +const Fetcher = require('./fetcher.js') +const RemoteFetcher = require('./remote.js') +const _tarballFromResolved = Symbol.for('pacote.Fetcher._tarballFromResolved') +const pacoteVersion = require('../package.json').version +const npa = require('npm-package-arg') +const pickManifest = require('npm-pick-manifest') +const ssri = require('ssri') +const Minipass = require('minipass') + +// Corgis are cute. 🐕🐶 +const corgiDoc = 'application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */*' +const fullDoc = 'application/json' + +const fetch = require('npm-registry-fetch') + +// TODO: memoize reg requests, so we don't even have to check cache + +const _headers = Symbol('_headers') +class RegistryFetcher extends Fetcher { + constructor (spec, opts) { + super(spec, opts) + + // handle case when npm-package-arg guesses wrong. + if (this.spec.type === 'tag' && + this.spec.rawSpec === '' && + this.defaultTag !== 'latest') + this.spec = npa(`${this.spec.name}@${this.defaultTag}`) + this.registry = fetch.pickRegistry(spec, opts) + this.packumentUrl = this.registry.replace(/\/*$/, '/') + + this.spec.escapedName + + // XXX pacote <=9 has some logic to ignore opts.resolved if + // the resolved URL doesn't go to the same registry. + // Consider reproducing that here, to throw away this.resolved + // in that case. + } + + resolve () { + if (this.resolved) + return Promise.resolve(this.resolved) + + // fetching the manifest sets resolved and (usually) integrity + return this.manifest().then(() => { + if (this.resolved) + return this.resolved + + throw Object.assign( + new Error('Invalid package manifest: no `dist.tarball` field'), + { package: this.spec.toString() } + ) + }) + } + + [_headers] () { + return { + // npm will override UA, but ensure that we always send *something* + 'user-agent': this.opts.userAgent || + `pacote/${pacoteVersion} node/${process.version}`, + ...(this.opts.headers || {}), + 'pacote-version': pacoteVersion, + 'pacote-req-type': 'packument', + 'pacote-pkg-id': `registry:${this.spec.name}`, + accept: this.fullMetadata ? fullDoc : corgiDoc, + } + } + + packument () { + // npm-registry-fetch the packument + // set the appropriate header for corgis if fullMetadata isn't set + // return the res.json() promise + return fetch(this.packumentUrl, { + ...this.opts, + headers: this[_headers](), + spec: this.spec, + // never check integrity for packuments themselves + integrity: null, + }).then(res => res.json().then(packument => { + packument._cached = res.headers.has('x-local-cache') + packument._contentLength = +res.headers.get('content-length') + return packument + })).catch(er => { + if (er.code === 'E404' && !this.fullMetadata) { + // possible that corgis are not supported by this registry + this.fullMetadata = true + return this.packument() + } + throw er + }) + } + + manifest () { + if (this.package) + return Promise.resolve(this.package) + + return this.packument() + .then(packument => pickManifest(packument, this.spec.fetchSpec, { + ...this.opts, + defaultTag: this.defaultTag, + before: this.before, + }) /* XXX add ETARGET and E403 revalidation of cached packuments here */) + .then(mani => { + // add _resolved and _integrity from dist object + const { dist } = mani + if (dist) { + this.resolved = mani._resolved = dist.tarball + mani._from = this.from + const distIntegrity = dist.integrity ? ssri.parse(dist.integrity) + : dist.shasum ? ssri.fromHex(dist.shasum, 'sha1', {...this.opts}) + : null + if (distIntegrity) { + if (!this.integrity) + this.integrity = distIntegrity + else if (!this.integrity.match(distIntegrity)) { + // only bork if they have algos in common. + // otherwise we end up breaking if we have saved a sha512 + // previously for the tarball, but the manifest only + // provides a sha1, which is possible for older publishes. + // Otherwise, this is almost certainly a case of holding it + // wrong, and will result in weird or insecure behavior + // later on when building package tree. + for (const algo of Object.keys(this.integrity)) { + if (distIntegrity[algo]) { + throw Object.assign(new Error( + `Integrity checksum failed when using ${algo}: `+ + `wanted ${this.integrity} but got ${distIntegrity}.` + ), { code: 'EINTEGRITY' }) + } + } + // made it this far, the integrity is worthwhile. accept it. + // the setter here will take care of merging it into what we + // already had. + this.integrity = distIntegrity + } + } + } + if (this.integrity) + mani._integrity = String(this.integrity) + return this.package = mani + }) + } + + [_tarballFromResolved] () { + // we use a RemoteFetcher to get the actual tarball stream + return new RemoteFetcher(this.resolved, { + ...this.opts, + resolved: this.resolved, + pkgid: `registry:${this.spec.name}@${this.resolved}`, + })[_tarballFromResolved]() + } + + get types () { + return [ + 'tag', + 'version', + 'range', + ] + } +} +module.exports = RegistryFetcher diff --git a/deps/npm/node_modules/pacote/lib/remote.js b/deps/npm/node_modules/pacote/lib/remote.js new file mode 100644 index 00000000000000..91f6eb59daa6f9 --- /dev/null +++ b/deps/npm/node_modules/pacote/lib/remote.js @@ -0,0 +1,77 @@ +const Fetcher = require('./fetcher.js') +const FileFetcher = require('./file.js') +const _tarballFromResolved = Symbol.for('pacote.Fetcher._tarballFromResolved') +const pacoteVersion = require('../package.json').version +const fetch = require('npm-registry-fetch') +const ssri = require('ssri') +const Minipass = require('minipass') +// The default registry URL is a string of great magic. +const magic = /^https?:\/\/registry\.npmjs\.org\// + +const _headers = Symbol('_headers') +class RemoteFetcher extends Fetcher { + constructor (spec, opts) { + super(spec, opts) + this.resolved = this.spec.fetchSpec + if (magic.test(this.resolved) && !magic.test(this.registry + '/')) + this.resolved = this.resolved.replace(magic, this.registry + '/') + + // nam is a fermented pork sausage that is good to eat + const nameat = this.spec.name ? `${this.spec.name}@` : '' + this.pkgid = opts.pkgid ? opts.pkgid : `remote:${nameat}${this.resolved}` + } + + [_tarballFromResolved] () { + const stream = new Minipass() + const fetchOpts = { + ...this.opts, + headers: this[_headers](), + spec: this.spec, + integrity: this.integrity, + algorithms: [ this.pickIntegrityAlgorithm() ], + } + fetch(this.resolved, fetchOpts).then(res => { + const hash = res.headers.get('x-local-cache-hash') + if (hash) { + this.integrity = decodeURIComponent(hash) + } + + res.body.on('error', + /* istanbul ignore next - exceedingly rare and hard to simulate */ + er => stream.emit('error', er) + ).pipe(stream) + }).catch(er => stream.emit('error', er)) + + return stream + } + + [_headers] () { + return { + // npm will override this, but ensure that we always send *something* + 'user-agent': this.opts.userAgent || + `pacote/${pacoteVersion} node/${process.version}`, + ...(this.opts.headers || {}), + 'pacote-version': pacoteVersion, + 'pacote-req-type': 'tarball', + 'pacote-pkg-id': this.pkgid, + ...(this.integrity ? { 'pacote-integrity': String(this.integrity) } + : {}), + ...(this.opts.headers || {}), + } + } + + get types () { + return ['remote'] + } + + // getting a packument and/or manifest is the same as with a file: spec. + // unpack the tarball stream, and then read from the package.json file. + packument () { + return FileFetcher.prototype.packument.apply(this) + } + + manifest () { + return FileFetcher.prototype.manifest.apply(this) + } +} +module.exports = RemoteFetcher diff --git a/deps/npm/node_modules/pacote/lib/util/cache-dir.js b/deps/npm/node_modules/pacote/lib/util/cache-dir.js new file mode 100644 index 00000000000000..d5c0bf28fb81eb --- /dev/null +++ b/deps/npm/node_modules/pacote/lib/util/cache-dir.js @@ -0,0 +1,12 @@ +const os = require('os') +const {resolve} = require('path') + +module.exports = (fakePlatform = false) => { + const temp = os.tmpdir() + const uidOrPid = process.getuid ? process.getuid() : process.pid + const home = os.homedir() || resolve(temp, 'npm-' + uidOrPid) + const platform = fakePlatform || process.platform + const cacheExtra = platform === 'win32' ? 'npm-cache' : '.npm' + const cacheRoot = (platform === 'win32' && process.env.APPDATA) || home + return resolve(cacheRoot, cacheExtra) +} diff --git a/deps/npm/node_modules/pacote/lib/util/cache-key.js b/deps/npm/node_modules/pacote/lib/util/cache-key.js deleted file mode 100644 index 157e60b0dd64b2..00000000000000 --- a/deps/npm/node_modules/pacote/lib/util/cache-key.js +++ /dev/null @@ -1,6 +0,0 @@ -'use strict' - -module.exports = cacheKey -function cacheKey (type, identifier) { - return ['pacote', type, identifier].join(':') -} diff --git a/deps/npm/node_modules/pacote/lib/util/finished.js b/deps/npm/node_modules/pacote/lib/util/finished.js deleted file mode 100644 index 6dadc8b5b3b669..00000000000000 --- a/deps/npm/node_modules/pacote/lib/util/finished.js +++ /dev/null @@ -1,17 +0,0 @@ -'use strict' - -const BB = require('bluebird') - -module.exports = function (child, hasExitCode = false) { - return BB.fromNode(function (cb) { - child.on('error', cb) - child.on(hasExitCode ? 'close' : 'end', function (exitCode) { - if (exitCode === undefined || exitCode === 0) { - cb() - } else { - let err = new Error('exited with error code: ' + exitCode) - cb(err) - } - }) - }) -} diff --git a/deps/npm/node_modules/pacote/lib/util/git.js b/deps/npm/node_modules/pacote/lib/util/git.js deleted file mode 100644 index 7642eb2c856303..00000000000000 --- a/deps/npm/node_modules/pacote/lib/util/git.js +++ /dev/null @@ -1,292 +0,0 @@ -'use strict' - -const BB = require('bluebird') - -const cp = require('child_process') -const execFileAsync = BB.promisify(cp.execFile, { - multiArgs: true -}) -const finished = require('./finished') -const LRU = require('lru-cache') -const optCheck = require('./opt-check') -const osenv = require('osenv') -const path = require('path') -const pinflight = require('promise-inflight') -const promiseRetry = require('promise-retry') -const uniqueFilename = require('unique-filename') -const which = BB.promisify(require('which')) -const semver = require('semver') -const inferOwner = require('infer-owner') - -const GOOD_ENV_VARS = new Set([ - 'GIT_ASKPASS', - 'GIT_EXEC_PATH', - 'GIT_PROXY_COMMAND', - 'GIT_SSH', - 'GIT_SSH_COMMAND', - 'GIT_SSL_CAINFO', - 'GIT_SSL_NO_VERIFY' -]) - -const GIT_TRANSIENT_ERRORS = [ - 'remote error: Internal Server Error', - 'The remote end hung up unexpectedly', - 'Connection timed out', - 'Operation timed out', - 'Failed to connect to .* Timed out', - 'Connection reset by peer', - 'SSL_ERROR_SYSCALL', - 'The requested URL returned error: 503' -].join('|') - -const GIT_TRANSIENT_ERROR_RE = new RegExp(GIT_TRANSIENT_ERRORS) - -const GIT_TRANSIENT_ERROR_MAX_RETRY_NUMBER = 3 - -function shouldRetry (error, number) { - return GIT_TRANSIENT_ERROR_RE.test(error) && (number < GIT_TRANSIENT_ERROR_MAX_RETRY_NUMBER) -} - -const GIT_ = 'GIT_' -let GITENV -function gitEnv () { - if (GITENV) { return GITENV } - const tmpDir = path.join(osenv.tmpdir(), 'pacote-git-template-tmp') - const tmpName = uniqueFilename(tmpDir, 'git-clone') - GITENV = { - GIT_ASKPASS: 'echo', - GIT_TEMPLATE_DIR: tmpName - } - Object.keys(process.env).forEach(k => { - if (GOOD_ENV_VARS.has(k) || !k.startsWith(GIT_)) { - GITENV[k] = process.env[k] - } - }) - return GITENV -} - -let GITPATH -try { - GITPATH = which.sync('git') -} catch (e) {} - -module.exports.clone = fullClone -function fullClone (repo, committish, target, opts) { - opts = optCheck(opts) - const gitArgs = ['clone', '--mirror', '-q', repo, path.join(target, '.git')] - if (process.platform === 'win32') { - gitArgs.push('--config', 'core.longpaths=true') - } - return execGit(gitArgs, { cwd: target }, opts).then(() => { - return execGit(['init'], { cwd: target }, opts) - }).then(() => { - return execGit(['checkout', committish || 'HEAD'], { cwd: target }, opts) - }).then(() => { - return updateSubmodules(target, opts) - }).then(() => headSha(target, opts)) -} - -module.exports.shallow = shallowClone -function shallowClone (repo, branch, target, opts) { - opts = optCheck(opts) - const gitArgs = ['clone', '--depth=1', '-q'] - if (branch) { - gitArgs.push('-b', branch) - } - gitArgs.push(repo, target) - if (process.platform === 'win32') { - gitArgs.push('--config', 'core.longpaths=true') - } - return execGit(gitArgs, { - cwd: target - }, opts).then(() => { - return updateSubmodules(target, opts) - }).then(() => headSha(target, opts)) -} - -function updateSubmodules (localRepo, opts) { - const gitArgs = ['submodule', 'update', '-q', '--init', '--recursive'] - return execGit(gitArgs, { - cwd: localRepo - }, opts) -} - -function headSha (repo, opts) { - opts = optCheck(opts) - return execGit(['rev-parse', '--revs-only', 'HEAD'], { cwd: repo }, opts).spread(stdout => { - return stdout.trim() - }) -} - -const CARET_BRACES = '^{}' -const REVS = new LRU({ - max: 100, - maxAge: 5 * 60 * 1000 -}) -module.exports.revs = revs -function revs (repo, opts) { - opts = optCheck(opts) - const cached = REVS.get(repo) - if (cached) { - return BB.resolve(cached) - } - return pinflight(`ls-remote:${repo}`, () => { - return spawnGit(['ls-remote', '-h', '-t', repo], { - env: gitEnv() - }, opts).then((stdout) => { - return stdout.split('\n').reduce((revs, line) => { - const split = line.split(/\s+/, 2) - if (split.length < 2) { return revs } - const sha = split[0].trim() - const ref = split[1].trim().match(/(?:refs\/[^/]+\/)?(.*)/)[1] - if (!ref) { return revs } // ??? - if (ref.endsWith(CARET_BRACES)) { return revs } // refs/tags/x^{} crap - const type = refType(line) - const doc = { sha, ref, type } - - revs.refs[ref] = doc - // We can check out shallow clones on specific SHAs if we have a ref - if (revs.shas[sha]) { - revs.shas[sha].push(ref) - } else { - revs.shas[sha] = [ref] - } - - if (type === 'tag') { - const match = ref.match(/v?(\d+\.\d+\.\d+(?:[-+].+)?)$/) - if (match && semver.valid(match[1], true)) { - revs.versions[semver.clean(match[1], true)] = doc - } - } - - return revs - }, { versions: {}, 'dist-tags': {}, refs: {}, shas: {} }) - }, err => { - err.message = `Error while executing:\n${GITPATH} ls-remote -h -t ${repo}\n\n${err.stderr}\n${err.message}` - throw err - }).then(revs => { - if (revs.refs.HEAD) { - const HEAD = revs.refs.HEAD - Object.keys(revs.versions).forEach(v => { - if (v.sha === HEAD.sha) { - revs['dist-tags'].HEAD = v - if (!revs.refs.latest) { - revs['dist-tags'].latest = revs.refs.HEAD - } - } - }) - } - REVS.set(repo, revs) - return revs - }) - }) -} - -// infer the owner from the cwd git is operating in, if not the -// process cwd, but only if we're root. -// See: https://github.com/npm/cli/issues/624 -module.exports._cwdOwner = cwdOwner -function cwdOwner (gitOpts, opts) { - const isRoot = process.getuid && process.getuid() === 0 - if (!isRoot || !gitOpts.cwd) { return Promise.resolve() } - - return BB.resolve(inferOwner(gitOpts.cwd).then(owner => { - gitOpts.uid = owner.uid - gitOpts.gid = owner.gid - })) -} - -module.exports._exec = execGit -function execGit (gitArgs, gitOpts, opts) { - opts = optCheck(opts) - return BB.resolve(cwdOwner(gitOpts, opts).then(() => checkGit(opts).then(gitPath => { - return promiseRetry((retry, number) => { - if (number !== 1) { - opts.log.silly('pacote', 'Retrying git command: ' + gitArgs.join(' ') + ' attempt # ' + number) - } - return execFileAsync(gitPath, gitArgs, mkOpts(gitOpts, opts)).catch((err) => { - if (shouldRetry(err, number)) { - retry(err) - } else { - throw err - } - }) - }, opts.retry != null ? opts.retry : { - retries: opts['fetch-retries'], - factor: opts['fetch-retry-factor'], - maxTimeout: opts['fetch-retry-maxtimeout'], - minTimeout: opts['fetch-retry-mintimeout'] - }) - }))) -} - -module.exports._spawn = spawnGit -function spawnGit (gitArgs, gitOpts, opts) { - opts = optCheck(opts) - return BB.resolve(cwdOwner(gitOpts, opts).then(() => checkGit(opts).then(gitPath => { - return promiseRetry((retry, number) => { - if (number !== 1) { - opts.log.silly('pacote', 'Retrying git command: ' + gitArgs.join(' ') + ' attempt # ' + number) - } - const child = cp.spawn(gitPath, gitArgs, mkOpts(gitOpts, opts)) - - let stdout = '' - let stderr = '' - child.stdout.on('data', d => { stdout += d }) - child.stderr.on('data', d => { stderr += d }) - - return finished(child, true).catch(err => { - if (shouldRetry(stderr, number)) { - retry(err) - } else { - err.stderr = stderr - throw err - } - }).then(() => { - return stdout - }) - }, opts.retry) - }))) -} - -module.exports._mkOpts = mkOpts -function mkOpts (_gitOpts, opts) { - const gitOpts = { - env: gitEnv() - } - const isRoot = process.getuid && process.getuid() === 0 - // don't change child process uid/gid if not root - if (+opts.uid && !isNaN(opts.uid) && isRoot) { - gitOpts.uid = +opts.uid - } - if (+opts.gid && !isNaN(opts.gid) && isRoot) { - gitOpts.gid = +opts.gid - } - Object.assign(gitOpts, _gitOpts) - return gitOpts -} - -function checkGit (opts) { - if (opts.git) { - return BB.resolve(opts.git) - } else if (!GITPATH) { - const err = new Error('No git binary found in $PATH') - err.code = 'ENOGIT' - return BB.reject(err) - } else { - return BB.resolve(GITPATH) - } -} - -const REFS_TAGS = 'refs/tags/' -const REFS_HEADS = 'refs/heads/' -const HEAD = 'HEAD' -function refType (ref) { - return ref.indexOf(REFS_TAGS) !== -1 - ? 'tag' - : ref.indexOf(REFS_HEADS) !== -1 - ? 'branch' - : ref.endsWith(HEAD) - ? 'head' - : 'other' -} diff --git a/deps/npm/node_modules/pacote/lib/util/is-package-bin.js b/deps/npm/node_modules/pacote/lib/util/is-package-bin.js new file mode 100644 index 00000000000000..35cf0642703c7e --- /dev/null +++ b/deps/npm/node_modules/pacote/lib/util/is-package-bin.js @@ -0,0 +1,24 @@ +// Function to determine whether a path is in the package.bin set. +// Used to prevent issues when people publish a package from a +// windows machine, and then install with --no-bin-links. +// +// Note: this is not possible in remote or file fetchers, since +// we don't have the manifest until AFTER we've unpacked. But the +// main use case is registry fetching with git a distant second, +// so that's an acceptable edge case to not handle. + +const binObj = (name, bin) => + typeof bin === 'string' ? { [name]: bin } : bin + +const hasBin = (pkg, path) => { + const bin = binObj(pkg.name, pkg.bin) + const p = path.replace(/^[^\\\/]*\//, '') + for (const [k, v] of Object.entries(bin)) { + if (v === p) + return true + } + return false +} + +module.exports = (pkg, path) => + pkg && pkg.bin ? hasBin(pkg, path) : false diff --git a/deps/npm/node_modules/pacote/lib/util/npm.js b/deps/npm/node_modules/pacote/lib/util/npm.js new file mode 100644 index 00000000000000..293695525c7268 --- /dev/null +++ b/deps/npm/node_modules/pacote/lib/util/npm.js @@ -0,0 +1,9 @@ +// run an npm command +const spawn = require('@npmcli/promise-spawn') + +module.exports = (npmBin, npmCommand, cwd, extra) => { + const isJS = npmBin.endsWith('.js') + const cmd = isJS ? process.execPath : npmBin + const args = (isJS ? [npmBin] : []).concat(npmCommand) + return spawn(cmd, args, { cwd, stdioString: true }, extra) +} diff --git a/deps/npm/node_modules/pacote/lib/util/opt-check.js b/deps/npm/node_modules/pacote/lib/util/opt-check.js deleted file mode 100644 index 8b6b472f850eb2..00000000000000 --- a/deps/npm/node_modules/pacote/lib/util/opt-check.js +++ /dev/null @@ -1,48 +0,0 @@ -'use strict' - -const figgyPudding = require('figgy-pudding') -const logger = require('./proclog.js') - -const AUTH_REGEX = /^(?:.*:)?(token|_authToken|username|_password|password|email|always-auth|_auth|otp)$/ -const SCOPE_REGISTRY_REGEX = /@.*:registry$/gi -module.exports = figgyPudding({ - annotate: {}, - cache: {}, - defaultTag: 'tag', - dirPacker: {}, - dmode: {}, - 'enjoy-by': 'enjoyBy', - enjoyBy: {}, - before: 'enjoyBy', - fmode: {}, - 'fetch-retries': { default: 2 }, - 'fetch-retry-factor': { default: 10 }, - 'fetch-retry-maxtimeout': { default: 60000 }, - 'fetch-retry-mintimeout': { default: 10000 }, - fullMetadata: 'full-metadata', - 'full-metadata': { default: false }, - gid: {}, - git: {}, - includeDeprecated: { default: true }, - 'include-deprecated': 'includeDeprecated', - integrity: {}, - log: { default: logger }, - memoize: {}, - offline: {}, - preferOffline: 'prefer-offline', - 'prefer-offline': {}, - preferOnline: 'prefer-online', - 'prefer-online': {}, - registry: { default: 'https://registry.npmjs.org/' }, - resolved: {}, - retry: {}, - scope: {}, - tag: { default: 'latest' }, - uid: {}, - umask: {}, - where: {} -}, { - other (key) { - return key.match(AUTH_REGEX) || key.match(SCOPE_REGISTRY_REGEX) - } -}) diff --git a/deps/npm/node_modules/pacote/lib/util/pack-dir.js b/deps/npm/node_modules/pacote/lib/util/pack-dir.js deleted file mode 100644 index 157a9a82f8af83..00000000000000 --- a/deps/npm/node_modules/pacote/lib/util/pack-dir.js +++ /dev/null @@ -1,44 +0,0 @@ -'use strict' - -const BB = require('bluebird') - -const cacache = require('cacache') -const cacheKey = require('./cache-key') -const optCheck = require('./opt-check') -const packlist = require('npm-packlist') -const pipe = BB.promisify(require('mississippi').pipe) -const tar = require('tar') - -module.exports = packDir -function packDir (manifest, label, dir, target, opts) { - opts = optCheck(opts) - - const packer = opts.dirPacker - ? BB.resolve(opts.dirPacker(manifest, dir)) - : mkPacker(dir) - - if (!opts.cache) { - return packer.then(packer => pipe(packer, target)) - } else { - const cacher = cacache.put.stream( - opts.cache, cacheKey('packed-dir', label), opts - ).on('integrity', i => { - target.emit('integrity', i) - }) - return packer.then(packer => BB.all([ - pipe(packer, cacher), - pipe(packer, target) - ])) - } -} - -function mkPacker (dir) { - return packlist({ path: dir }).then(files => { - return tar.c({ - cwd: dir, - gzip: true, - portable: true, - prefix: 'package/' - }, files) - }) -} diff --git a/deps/npm/node_modules/pacote/lib/util/proc-log.js b/deps/npm/node_modules/pacote/lib/util/proc-log.js new file mode 100644 index 00000000000000..b2bdd9dc90205c --- /dev/null +++ b/deps/npm/node_modules/pacote/lib/util/proc-log.js @@ -0,0 +1,21 @@ +// default logger. +// emits 'log' events on the process +const LEVELS = [ + 'notice', + 'error', + 'warn', + 'info', + 'verbose', + 'http', + 'silly', + 'pause', + 'resume' +] + +const log = level => (...args) => process.emit('log', level, ...args) + +const logger = {} +for (const level of LEVELS) { + logger[level] = log(level) +} +module.exports = logger diff --git a/deps/npm/node_modules/pacote/lib/util/proclog.js b/deps/npm/node_modules/pacote/lib/util/proclog.js deleted file mode 100644 index e4a2bf8acf3e64..00000000000000 --- a/deps/npm/node_modules/pacote/lib/util/proclog.js +++ /dev/null @@ -1,23 +0,0 @@ -'use strict' - -const LEVELS = [ - 'notice', - 'error', - 'warn', - 'info', - 'verbose', - 'http', - 'silly', - 'pause', - 'resume' -] - -const logger = {} -for (const level of LEVELS) { - logger[level] = log(level) -} -module.exports = logger - -function log (level) { - return (category, ...args) => process.emit('log', level, category, ...args) -} diff --git a/deps/npm/node_modules/pacote/lib/util/read-json.js b/deps/npm/node_modules/pacote/lib/util/read-json.js deleted file mode 100644 index 32fffbc53746b5..00000000000000 --- a/deps/npm/node_modules/pacote/lib/util/read-json.js +++ /dev/null @@ -1,15 +0,0 @@ -'use strict' - -module.exports = function (content) { - // Code also yanked from read-package-json. - function stripBOM (content) { - content = content.toString() - // Remove byte order marker. This catches EF BB BF (the UTF-8 BOM) - // because the buffer-to-string conversion in `fs.readFileSync()` - // translates it to FEFF, the UTF-16 BOM. - if (content.charCodeAt(0) === 0xFEFF) return content.slice(1) - return content - } - - return JSON.parse(stripBOM(content)) -} diff --git a/deps/npm/node_modules/pacote/lib/with-tarball-stream.js b/deps/npm/node_modules/pacote/lib/with-tarball-stream.js deleted file mode 100644 index 0d84696d66932b..00000000000000 --- a/deps/npm/node_modules/pacote/lib/with-tarball-stream.js +++ /dev/null @@ -1,135 +0,0 @@ -'use strict' - -const BB = require('bluebird') - -const cacache = require('cacache') -const fetch = require('./fetch.js') -const fs = require('fs') -const npa = require('npm-package-arg') -const optCheck = require('./util/opt-check.js') -const path = require('path') -const ssri = require('ssri') -const retry = require('promise-retry') - -const statAsync = BB.promisify(fs.stat) - -const RETRIABLE_ERRORS = new Set(['ENOENT', 'EINTEGRITY', 'Z_DATA_ERROR']) - -module.exports = withTarballStream -function withTarballStream (spec, opts, streamHandler) { - opts = optCheck(opts) - spec = npa(spec, opts.where) - - // First, we check for a file: resolved shortcut - const tryFile = ( - !opts.preferOnline && - opts.integrity && - opts.resolved && - opts.resolved.startsWith('file:') - ) - ? BB.try(() => { - // NOTE - this is a special shortcut! Packages installed as files do not - // have a `resolved` field -- this specific case only occurs when you have, - // say, a git dependency or a registry dependency that you've packaged into - // a local file, and put that file: spec in the `resolved` field. - opts.log.silly('pacote', `trying ${spec} by local file: ${opts.resolved}`) - const file = path.resolve(opts.where || '.', opts.resolved.substr(5)) - return statAsync(file) - .then(() => { - const verifier = ssri.integrityStream({ integrity: opts.integrity }) - const stream = fs.createReadStream(file) - .on('error', err => verifier.emit('error', err)) - .pipe(verifier) - return streamHandler(stream) - }) - .catch(err => { - if (err.code === 'EINTEGRITY') { - opts.log.warn('pacote', `EINTEGRITY while extracting ${spec} from ${file}.You will have to recreate the file.`) - opts.log.verbose('pacote', `EINTEGRITY for ${spec}: ${err.message}`) - } - throw err - }) - }) - : BB.reject(Object.assign(new Error('no file!'), { code: 'ENOENT' })) - - const tryDigest = tryFile - .catch(err => { - if ( - opts.preferOnline || - !opts.cache || - !opts.integrity || - !RETRIABLE_ERRORS.has(err.code) - ) { - throw err - } else { - opts.log.silly('tarball', `trying ${spec} by hash: ${opts.integrity}`) - const stream = cacache.get.stream.byDigest( - opts.cache, opts.integrity, opts - ) - stream.once('error', err => stream.on('newListener', (ev, l) => { - if (ev === 'error') { l(err) } - })) - return streamHandler(stream) - .catch(err => { - if (err.code === 'EINTEGRITY' || err.code === 'Z_DATA_ERROR') { - opts.log.warn('tarball', `cached data for ${spec} (${opts.integrity}) seems to be corrupted. Refreshing cache.`) - return cleanUpCached(opts.cache, opts.integrity, opts) - .then(() => { throw err }) - } else { - throw err - } - }) - } - }) - - const trySpec = tryDigest - .catch(err => { - if (!RETRIABLE_ERRORS.has(err.code)) { - // If it's not one of our retriable errors, bail out and give up. - throw err - } else { - opts.log.silly( - 'tarball', - `no local data for ${spec}. Extracting by manifest.` - ) - return BB.resolve(retry((tryAgain, attemptNum) => { - const tardata = fetch.tarball(spec, opts) - if (!opts.resolved) { - tardata.on('manifest', m => { - opts = opts.concat({ resolved: m._resolved }) - }) - tardata.on('integrity', i => { - opts = opts.concat({ integrity: i }) - }) - } - return BB.try(() => streamHandler(tardata)) - .catch(err => { - // Retry once if we have a cache, to clear up any weird conditions. - // Don't retry network errors, though -- make-fetch-happen has already - // taken care of making sure we're all set on that front. - if (opts.cache && err.code && !String(err.code).match(/^E\d{3}$/)) { - if (err.code === 'EINTEGRITY' || err.code === 'Z_DATA_ERROR') { - opts.log.warn('tarball', `tarball data for ${spec} (${opts.integrity}) seems to be corrupted. Trying one more time.`) - } - return cleanUpCached(opts.cache, err.sri, opts) - .then(() => tryAgain(err)) - } else { - throw err - } - }) - }, { retries: 1 })) - } - }) - - return trySpec - .catch(err => { - if (err.code === 'EINTEGRITY') { - err.message = `Verification failed while extracting ${spec}:\n${err.message}` - } - throw err - }) -} - -function cleanUpCached (cachePath, integrity, opts) { - return cacache.rm.content(cachePath, integrity, opts) -} diff --git a/deps/npm/node_modules/pacote/manifest.js b/deps/npm/node_modules/pacote/manifest.js deleted file mode 100644 index 6a89ff76bef581..00000000000000 --- a/deps/npm/node_modules/pacote/manifest.js +++ /dev/null @@ -1,38 +0,0 @@ -'use strict' - -const fetchManifest = require('./lib/fetch').manifest -const finalizeManifest = require('./lib/finalize-manifest') -const optCheck = require('./lib/util/opt-check') -const pinflight = require('promise-inflight') -const npa = require('npm-package-arg') - -module.exports = manifest -function manifest (spec, opts) { - opts = optCheck(opts) - spec = npa(spec, opts.where) - - const label = [ - spec.name, - spec.saveSpec || spec.fetchSpec, - spec.type, - opts.cache, - opts.registry, - opts.scope - ].join(':') - return pinflight(label, () => { - const startTime = Date.now() - return fetchManifest(spec, opts).then(rawManifest => { - return finalizeManifest(rawManifest, spec, opts) - }).then(manifest => { - if (opts.annotate) { - manifest._from = spec.saveSpec || spec.raw - manifest._requested = spec - manifest._spec = spec.raw - manifest._where = opts.where - } - const elapsedTime = Date.now() - startTime - opts.log.silly('pacote', `${spec.type} manifest for ${spec.name}@${spec.saveSpec || spec.fetchSpec} fetched in ${elapsedTime}ms`) - return manifest - }) - }) -} diff --git a/deps/npm/node_modules/pacote/node_modules/minipass/README.md b/deps/npm/node_modules/pacote/node_modules/minipass/README.md deleted file mode 100644 index c989beea0e6d97..00000000000000 --- a/deps/npm/node_modules/pacote/node_modules/minipass/README.md +++ /dev/null @@ -1,606 +0,0 @@ -# minipass - -A _very_ minimal implementation of a [PassThrough -stream](https://nodejs.org/api/stream.html#stream_class_stream_passthrough) - -[It's very -fast](https://docs.google.com/spreadsheets/d/1oObKSrVwLX_7Ut4Z6g3fZW-AX1j1-k6w-cDsrkaSbHM/edit#gid=0) -for objects, strings, and buffers. - -Supports pipe()ing (including multi-pipe() and backpressure -transmission), buffering data until either a `data` event handler or -`pipe()` is added (so you don't lose the first chunk), and most other -cases where PassThrough is a good idea. - -There is a `read()` method, but it's much more efficient to consume -data from this stream via `'data'` events or by calling `pipe()` into -some other stream. Calling `read()` requires the buffer to be -flattened in some cases, which requires copying memory. - -There is also no `unpipe()` method. Once you start piping, there is -no stopping it! - -If you set `objectMode: true` in the options, then whatever is written -will be emitted. Otherwise, it'll do a minimal amount of Buffer -copying to ensure proper Streams semantics when `read(n)` is called. - -`objectMode` can also be set by doing `stream.objectMode = true`, or by -writing any non-string/non-buffer data. `objectMode` cannot be set to -false once it is set. - -This is not a `through` or `through2` stream. It doesn't transform -the data, it just passes it right through. If you want to transform -the data, extend the class, and override the `write()` method. Once -you're done transforming the data however you want, call -`super.write()` with the transform output. - -For some examples of streams that extend Minipass in various ways, check -out: - -- [minizlib](http://npm.im/minizlib) -- [fs-minipass](http://npm.im/fs-minipass) -- [tar](http://npm.im/tar) -- [minipass-collect](http://npm.im/minipass-collect) -- [minipass-flush](http://npm.im/minipass-flush) -- [minipass-pipeline](http://npm.im/minipass-pipeline) -- [tap](http://npm.im/tap) -- [tap-parser](http://npm.im/tap) -- [treport](http://npm.im/tap) - -## Differences from Node.js Streams - -There are several things that make Minipass streams different from (and in -some ways superior to) Node.js core streams. - -Please read these caveats if you are familiar with noode-core streams and -intend to use Minipass streams in your programs. - -### Timing - -Minipass streams are designed to support synchronous use-cases. Thus, data -is emitted as soon as it is available, always. It is buffered until read, -but no longer. Another way to look at it is that Minipass streams are -exactly as synchronous as the logic that writes into them. - -This can be surprising if your code relies on `PassThrough.write()` always -providing data on the next tick rather than the current one, or being able -to call `resume()` and not have the entire buffer disappear immediately. - -However, without this synchronicity guarantee, there would be no way for -Minipass to achieve the speeds it does, or support the synchronous use -cases that it does. Simply put, waiting takes time. - -This non-deferring approach makes Minipass streams much easier to reason -about, especially in the context of Promises and other flow-control -mechanisms. - -### No High/Low Water Marks - -Node.js core streams will optimistically fill up a buffer, returning `true` -on all writes until the limit is hit, even if the data has nowhere to go. -Then, they will not attempt to draw more data in until the buffer size dips -below a minimum value. - -Minipass streams are much simpler. The `write()` method will return `true` -if the data has somewhere to go (which is to say, given the timing -guarantees, that the data is already there by the time `write()` returns). - -If the data has nowhere to go, then `write()` returns false, and the data -sits in a buffer, to be drained out immediately as soon as anyone consumes -it. - -### Hazards of Buffering (or: Why Minipass Is So Fast) - -Since data written to a Minipass stream is immediately written all the way -through the pipeline, and `write()` always returns true/false based on -whether the data was fully flushed, backpressure is communicated -immediately to the upstream caller. This minimizes buffering. - -Consider this case: - -```js -const {PassThrough} = require('stream') -const p1 = new PassThrough({ highWaterMark: 1024 }) -const p2 = new PassThrough({ highWaterMark: 1024 }) -const p3 = new PassThrough({ highWaterMark: 1024 }) -const p4 = new PassThrough({ highWaterMark: 1024 }) - -p1.pipe(p2).pipe(p3).pipe(p4) -p4.on('data', () => console.log('made it through')) - -// this returns false and buffers, then writes to p2 on next tick (1) -// p2 returns false and buffers, pausing p1, then writes to p3 on next tick (2) -// p3 returns false and buffers, pausing p2, then writes to p4 on next tick (3) -// p4 returns false and buffers, pausing p3, then emits 'data' and 'drain' -// on next tick (4) -// p3 sees p4's 'drain' event, and calls resume(), emitting 'resume' and -// 'drain' on next tick (5) -// p2 sees p3's 'drain', calls resume(), emits 'resume' and 'drain' on next tick (6) -// p1 sees p2's 'drain', calls resume(), emits 'resume' and 'drain' on next -// tick (7) - -p1.write(Buffer.alloc(2048)) // returns false -``` - -Along the way, the data was buffered and deferred at each stage, and -multiple event deferrals happened, for an unblocked pipeline where it was -perfectly safe to write all the way through! - -Furthermore, setting a `highWaterMark` of `1024` might lead someone reading -the code to think an advisory maximum of 1KiB is being set for the -pipeline. However, the actual advisory buffering level is the _sum_ of -`highWaterMark` values, since each one has its own bucket. - -Consider the Minipass case: - -```js -const m1 = new Minipass() -const m2 = new Minipass() -const m3 = new Minipass() -const m4 = new Minipass() - -m1.pipe(m2).pipe(m3).pipe(m4) -m4.on('data', () => console.log('made it through')) - -// m1 is flowing, so it writes the data to m2 immediately -// m2 is flowing, so it writes the data to m3 immediately -// m3 is flowing, so it writes the data to m4 immediately -// m4 is flowing, so it fires the 'data' event immediately, returns true -// m4's write returned true, so m3 is still flowing, returns true -// m3's write returned true, so m2 is still flowing, returns true -// m2's write returned true, so m1 is still flowing, returns true -// No event deferrals or buffering along the way! - -m1.write(Buffer.alloc(2048)) // returns true -``` - -It is extremely unlikely that you _don't_ want to buffer any data written, -or _ever_ buffer data that can be flushed all the way through. Neither -node-core streams nor Minipass ever fail to buffer written data, but -node-core streams do a lot of unnecessary buffering and pausing. - -As always, the faster implementation is the one that does less stuff and -waits less time to do it. - -### Immediately emit `end` for empty streams (when not paused) - -If a stream is not paused, and `end()` is called before writing any data -into it, then it will emit `end` immediately. - -If you have logic that occurs on the `end` event which you don't want to -potentially happen immediately (for example, closing file descriptors, -moving on to the next entry in an archive parse stream, etc.) then be sure -to call `stream.pause()` on creation, and then `stream.resume()` once you -are ready to respond to the `end` event. - -### Emit `end` When Asked - -One hazard of immediately emitting `'end'` is that you may not yet have had -a chance to add a listener. In order to avoid this hazard, Minipass -streams safely re-emit the `'end'` event if a new listener is added after -`'end'` has been emitted. - -Ie, if you do `stream.on('end', someFunction)`, and the stream has already -emitted `end`, then it will call the handler right away. (You can think of -this somewhat like attaching a new `.then(fn)` to a previously-resolved -Promise.) - -To prevent calling handlers multiple times who would not expect multiple -ends to occur, all listeners are removed from the `'end'` event whenever it -is emitted. - -### Impact of "immediate flow" on Tee-streams - -A "tee stream" is a stream piping to multiple destinations: - -```js -const tee = new Minipass() -t.pipe(dest1) -t.pipe(dest2) -t.write('foo') // goes to both destinations -``` - -Since Minipass streams _immediately_ process any pending data through the -pipeline when a new pipe destination is added, this can have surprising -effects, especially when a stream comes in from some other function and may -or may not have data in its buffer. - -```js -// WARNING! WILL LOSE DATA! -const src = new Minipass() -src.write('foo') -src.pipe(dest1) // 'foo' chunk flows to dest1 immediately, and is gone -src.pipe(dest2) // gets nothing! -``` - -The solution is to create a dedicated tee-stream junction that pipes to -both locations, and then pipe to _that_ instead. - -```js -// Safe example: tee to both places -const src = new Minipass() -src.write('foo') -const tee = new Minipass() -tee.pipe(dest1) -tee.pipe(dest2) -stream.pipe(tee) // tee gets 'foo', pipes to both locations -``` - -The same caveat applies to `on('data')` event listeners. The first one -added will _immediately_ receive all of the data, leaving nothing for the -second: - -```js -// WARNING! WILL LOSE DATA! -const src = new Minipass() -src.write('foo') -src.on('data', handler1) // receives 'foo' right away -src.on('data', handler2) // nothing to see here! -``` - -Using a dedicated tee-stream can be used in this case as well: - -```js -// Safe example: tee to both data handlers -const src = new Minipass() -src.write('foo') -const tee = new Minipass() -tee.on('data', handler1) -tee.on('data', handler2) -src.pipe(tee) -``` - -## USAGE - -It's a stream! Use it like a stream and it'll most likely do what you want. - -```js -const Minipass = require('minipass') -const mp = new Minipass(options) // optional: { encoding, objectMode } -mp.write('foo') -mp.pipe(someOtherStream) -mp.end('bar') -``` - -### OPTIONS - -* `encoding` How would you like the data coming _out_ of the stream to be - encoded? Accepts any values that can be passed to `Buffer.toString()`. -* `objectMode` Emit data exactly as it comes in. This will be flipped on - by default if you write() something other than a string or Buffer at any - point. Setting `objectMode: true` will prevent setting any encoding - value. - -### API - -Implements the user-facing portions of Node.js's `Readable` and `Writable` -streams. - -### Methods - -* `write(chunk, [encoding], [callback])` - Put data in. (Note that, in the - base Minipass class, the same data will come out.) Returns `false` if - the stream will buffer the next write, or true if it's still in - "flowing" mode. -* `end([chunk, [encoding]], [callback])` - Signal that you have no more - data to write. This will queue an `end` event to be fired when all the - data has been consumed. -* `setEncoding(encoding)` - Set the encoding for data coming of the - stream. This can only be done once. -* `pause()` - No more data for a while, please. This also prevents `end` - from being emitted for empty streams until the stream is resumed. -* `resume()` - Resume the stream. If there's data in the buffer, it is - all discarded. Any buffered events are immediately emitted. -* `pipe(dest)` - Send all output to the stream provided. There is no way - to unpipe. When data is emitted, it is immediately written to any and - all pipe destinations. -* `on(ev, fn)`, `emit(ev, fn)` - Minipass streams are EventEmitters. - Some events are given special treatment, however. (See below under - "events".) -* `promise()` - Returns a Promise that resolves when the stream emits - `end`, or rejects if the stream emits `error`. -* `collect()` - Return a Promise that resolves on `end` with an array - containing each chunk of data that was emitted, or rejects if the - stream emits `error`. Note that this consumes the stream data. -* `concat()` - Same as `collect()`, but concatenates the data into a - single Buffer object. Will reject the returned promise if the stream is - in objectMode, or if it goes into objectMode by the end of the data. -* `read(n)` - Consume `n` bytes of data out of the buffer. If `n` is not - provided, then consume all of it. If `n` bytes are not available, then - it returns null. **Note** consuming streams in this way is less - efficient, and can lead to unnecessary Buffer copying. -* `destroy([er])` - Destroy the stream. If an error is provided, then an - `'error'` event is emitted. If the stream has a `close()` method, and - has not emitted a `'close'` event yet, then `stream.close()` will be - called. Any Promises returned by `.promise()`, `.collect()` or - `.concat()` will be rejected. After being destroyed, writing to the - stream will emit an error. No more data will be emitted if the stream is - destroyed, even if it was previously buffered. - -### Properties - -* `bufferLength` Read-only. Total number of bytes buffered, or in the case - of objectMode, the total number of objects. -* `encoding` The encoding that has been set. (Setting this is equivalent - to calling `setEncoding(enc)` and has the same prohibition against - setting multiple times.) -* `flowing` Read-only. Boolean indicating whether a chunk written to the - stream will be immediately emitted. -* `emittedEnd` Read-only. Boolean indicating whether the end-ish events - (ie, `end`, `prefinish`, `finish`) have been emitted. Note that - listening on any end-ish event will immediateyl re-emit it if it has - already been emitted. -* `writable` Whether the stream is writable. Default `true`. Set to - `false` when `end()` -* `readable` Whether the stream is readable. Default `true`. -* `buffer` A [yallist](http://npm.im/yallist) linked list of chunks written - to the stream that have not yet been emitted. (It's probably a bad idea - to mess with this.) -* `pipes` A [yallist](http://npm.im/yallist) linked list of streams that - this stream is piping into. (It's probably a bad idea to mess with - this.) -* `destroyed` A getter that indicates whether the stream was destroyed. -* `paused` True if the stream has been explicitly paused, otherwise false. -* `objectMode` Indicates whether the stream is in `objectMode`. Once set - to `true`, it cannot be set to `false`. - -### Events - -* `data` Emitted when there's data to read. Argument is the data to read. - This is never emitted while not flowing. If a listener is attached, that - will resume the stream. -* `end` Emitted when there's no more data to read. This will be emitted - immediately for empty streams when `end()` is called. If a listener is - attached, and `end` was already emitted, then it will be emitted again. - All listeners are removed when `end` is emitted. -* `prefinish` An end-ish event that follows the same logic as `end` and is - emitted in the same conditions where `end` is emitted. Emitted after - `'end'`. -* `finish` An end-ish event that follows the same logic as `end` and is - emitted in the same conditions where `end` is emitted. Emitted after - `'prefinish'`. -* `close` An indication that an underlying resource has been released. - Minipass does not emit this event, but will defer it until after `end` - has been emitted, since it throws off some stream libraries otherwise. -* `drain` Emitted when the internal buffer empties, and it is again - suitable to `write()` into the stream. -* `readable` Emitted when data is buffered and ready to be read by a - consumer. -* `resume` Emitted when stream changes state from buffering to flowing - mode. (Ie, when `resume` is called, `pipe` is called, or a `data` event - listener is added.) - -### Static Methods - -* `Minipass.isStream(stream)` Returns `true` if the argument is a stream, - and false otherwise. To be considered a stream, the object must be - either an instance of Minipass, or an EventEmitter that has either a - `pipe()` method, or both `write()` and `end()` methods. (Pretty much any - stream in node-land will return `true` for this.) - -## EXAMPLES - -Here are some examples of things you can do with Minipass streams. - -### simple "are you done yet" promise - -```js -mp.promise().then(() => { - // stream is finished -}, er => { - // stream emitted an error -}) -``` - -### collecting - -```js -mp.collect().then(all => { - // all is an array of all the data emitted - // encoding is supported in this case, so - // so the result will be a collection of strings if - // an encoding is specified, or buffers/objects if not. - // - // In an async function, you may do - // const data = await stream.collect() -}) -``` - -### collecting into a single blob - -This is a bit slower because it concatenates the data into one chunk for -you, but if you're going to do it yourself anyway, it's convenient this -way: - -```js -mp.concat().then(onebigchunk => { - // onebigchunk is a string if the stream - // had an encoding set, or a buffer otherwise. -}) -``` - -### iteration - -You can iterate over streams synchronously or asynchronously in -platforms that support it. - -Synchronous iteration will end when the currently available data is -consumed, even if the `end` event has not been reached. In string and -buffer mode, the data is concatenated, so unless multiple writes are -occurring in the same tick as the `read()`, sync iteration loops will -generally only have a single iteration. - -To consume chunks in this way exactly as they have been written, with -no flattening, create the stream with the `{ objectMode: true }` -option. - -```js -const mp = new Minipass({ objectMode: true }) -mp.write('a') -mp.write('b') -for (let letter of mp) { - console.log(letter) // a, b -} -mp.write('c') -mp.write('d') -for (let letter of mp) { - console.log(letter) // c, d -} -mp.write('e') -mp.end() -for (let letter of mp) { - console.log(letter) // e -} -for (let letter of mp) { - console.log(letter) // nothing -} -``` - -Asynchronous iteration will continue until the end event is reached, -consuming all of the data. - -```js -const mp = new Minipass({ encoding: 'utf8' }) - -// some source of some data -let i = 5 -const inter = setInterval(() => { - if (i --> 0) - mp.write(Buffer.from('foo\n', 'utf8')) - else { - mp.end() - clearInterval(inter) - } -}, 100) - -// consume the data with asynchronous iteration -async function consume () { - for await (let chunk of mp) { - console.log(chunk) - } - return 'ok' -} - -consume().then(res => console.log(res)) -// logs `foo\n` 5 times, and then `ok` -``` - -### subclass that `console.log()`s everything written into it - -```js -class Logger extends Minipass { - write (chunk, encoding, callback) { - console.log('WRITE', chunk, encoding) - return super.write(chunk, encoding, callback) - } - end (chunk, encoding, callback) { - console.log('END', chunk, encoding) - return super.end(chunk, encoding, callback) - } -} - -someSource.pipe(new Logger()).pipe(someDest) -``` - -### same thing, but using an inline anonymous class - -```js -// js classes are fun -someSource - .pipe(new (class extends Minipass { - emit (ev, ...data) { - // let's also log events, because debugging some weird thing - console.log('EMIT', ev) - return super.emit(ev, ...data) - } - write (chunk, encoding, callback) { - console.log('WRITE', chunk, encoding) - return super.write(chunk, encoding, callback) - } - end (chunk, encoding, callback) { - console.log('END', chunk, encoding) - return super.end(chunk, encoding, callback) - } - })) - .pipe(someDest) -``` - -### subclass that defers 'end' for some reason - -```js -class SlowEnd extends Minipass { - emit (ev, ...args) { - if (ev === 'end') { - console.log('going to end, hold on a sec') - setTimeout(() => { - console.log('ok, ready to end now') - super.emit('end', ...args) - }, 100) - } else { - return super.emit(ev, ...args) - } - } -} -``` - -### transform that creates newline-delimited JSON - -```js -class NDJSONEncode extends Minipass { - write (obj, cb) { - try { - // JSON.stringify can throw, emit an error on that - return super.write(JSON.stringify(obj) + '\n', 'utf8', cb) - } catch (er) { - this.emit('error', er) - } - } - end (obj, cb) { - if (typeof obj === 'function') { - cb = obj - obj = undefined - } - if (obj !== undefined) { - this.write(obj) - } - return super.end(cb) - } -} -``` - -### transform that parses newline-delimited JSON - -```js -class NDJSONDecode extends Minipass { - constructor (options) { - // always be in object mode, as far as Minipass is concerned - super({ objectMode: true }) - this._jsonBuffer = '' - } - write (chunk, encoding, cb) { - if (typeof chunk === 'string' && - typeof encoding === 'string' && - encoding !== 'utf8') { - chunk = Buffer.from(chunk, encoding).toString() - } else if (Buffer.isBuffer(chunk)) - chunk = chunk.toString() - } - if (typeof encoding === 'function') { - cb = encoding - } - const jsonData = (this._jsonBuffer + chunk).split('\n') - this._jsonBuffer = jsonData.pop() - for (let i = 0; i < jsonData.length; i++) { - let parsed - try { - super.write(parsed) - } catch (er) { - this.emit('error', er) - continue - } - } - if (cb) - cb() - } -} -``` diff --git a/deps/npm/node_modules/pacote/node_modules/minipass/index.js b/deps/npm/node_modules/pacote/node_modules/minipass/index.js deleted file mode 100644 index c072352d448a97..00000000000000 --- a/deps/npm/node_modules/pacote/node_modules/minipass/index.js +++ /dev/null @@ -1,537 +0,0 @@ -'use strict' -const EE = require('events') -const Yallist = require('yallist') -const SD = require('string_decoder').StringDecoder - -const EOF = Symbol('EOF') -const MAYBE_EMIT_END = Symbol('maybeEmitEnd') -const EMITTED_END = Symbol('emittedEnd') -const EMITTING_END = Symbol('emittingEnd') -const CLOSED = Symbol('closed') -const READ = Symbol('read') -const FLUSH = Symbol('flush') -const FLUSHCHUNK = Symbol('flushChunk') -const ENCODING = Symbol('encoding') -const DECODER = Symbol('decoder') -const FLOWING = Symbol('flowing') -const PAUSED = Symbol('paused') -const RESUME = Symbol('resume') -const BUFFERLENGTH = Symbol('bufferLength') -const BUFFERPUSH = Symbol('bufferPush') -const BUFFERSHIFT = Symbol('bufferShift') -const OBJECTMODE = Symbol('objectMode') -const DESTROYED = Symbol('destroyed') - -// TODO remove when Node v8 support drops -const doIter = global._MP_NO_ITERATOR_SYMBOLS_ !== '1' -const ASYNCITERATOR = doIter && Symbol.asyncIterator - || Symbol('asyncIterator not implemented') -const ITERATOR = doIter && Symbol.iterator - || Symbol('iterator not implemented') - -// Buffer in node 4.x < 4.5.0 doesn't have working Buffer.from -// or Buffer.alloc, and Buffer in node 10 deprecated the ctor. -// .M, this is fine .\^/M.. -const B = Buffer.alloc ? Buffer - : /* istanbul ignore next */ require('safe-buffer').Buffer - -// events that mean 'the stream is over' -// these are treated specially, and re-emitted -// if they are listened for after emitting. -const isEndish = ev => - ev === 'end' || - ev === 'finish' || - ev === 'prefinish' - -const isArrayBuffer = b => b instanceof ArrayBuffer || - typeof b === 'object' && - b.constructor && - b.constructor.name === 'ArrayBuffer' && - b.byteLength >= 0 - -const isArrayBufferView = b => !B.isBuffer(b) && ArrayBuffer.isView(b) - -module.exports = class Minipass extends EE { - constructor (options) { - super() - this[FLOWING] = false - // whether we're explicitly paused - this[PAUSED] = false - this.pipes = new Yallist() - this.buffer = new Yallist() - this[OBJECTMODE] = options && options.objectMode || false - if (this[OBJECTMODE]) - this[ENCODING] = null - else - this[ENCODING] = options && options.encoding || null - if (this[ENCODING] === 'buffer') - this[ENCODING] = null - this[DECODER] = this[ENCODING] ? new SD(this[ENCODING]) : null - this[EOF] = false - this[EMITTED_END] = false - this[EMITTING_END] = false - this[CLOSED] = false - this.writable = true - this.readable = true - this[BUFFERLENGTH] = 0 - this[DESTROYED] = false - } - - get bufferLength () { return this[BUFFERLENGTH] } - - get encoding () { return this[ENCODING] } - set encoding (enc) { - if (this[OBJECTMODE]) - throw new Error('cannot set encoding in objectMode') - - if (this[ENCODING] && enc !== this[ENCODING] && - (this[DECODER] && this[DECODER].lastNeed || this[BUFFERLENGTH])) - throw new Error('cannot change encoding') - - if (this[ENCODING] !== enc) { - this[DECODER] = enc ? new SD(enc) : null - if (this.buffer.length) - this.buffer = this.buffer.map(chunk => this[DECODER].write(chunk)) - } - - this[ENCODING] = enc - } - - setEncoding (enc) { - this.encoding = enc - } - - get objectMode () { return this[OBJECTMODE] } - set objectMode (ॐ ) { this[OBJECTMODE] = this[OBJECTMODE] || !!ॐ } - - write (chunk, encoding, cb) { - if (this[EOF]) - throw new Error('write after end') - - if (this[DESTROYED]) { - this.emit('error', Object.assign( - new Error('Cannot call write after a stream was destroyed'), - { code: 'ERR_STREAM_DESTROYED' } - )) - return true - } - - if (typeof encoding === 'function') - cb = encoding, encoding = 'utf8' - - if (!encoding) - encoding = 'utf8' - - // convert array buffers and typed array views into buffers - // at some point in the future, we may want to do the opposite! - // leave strings and buffers as-is - // anything else switches us into object mode - if (!this[OBJECTMODE] && !B.isBuffer(chunk)) { - if (isArrayBufferView(chunk)) - chunk = B.from(chunk.buffer, chunk.byteOffset, chunk.byteLength) - else if (isArrayBuffer(chunk)) - chunk = B.from(chunk) - else if (typeof chunk !== 'string') - // use the setter so we throw if we have encoding set - this.objectMode = true - } - - // this ensures at this point that the chunk is a buffer or string - // don't buffer it up or send it to the decoder - if (!this.objectMode && !chunk.length) { - const ret = this.flowing - if (this[BUFFERLENGTH] !== 0) - this.emit('readable') - if (cb) - cb() - return ret - } - - // fast-path writing strings of same encoding to a stream with - // an empty buffer, skipping the buffer/decoder dance - if (typeof chunk === 'string' && !this[OBJECTMODE] && - // unless it is a string already ready for us to use - !(encoding === this[ENCODING] && !this[DECODER].lastNeed)) { - chunk = B.from(chunk, encoding) - } - - if (B.isBuffer(chunk) && this[ENCODING]) - chunk = this[DECODER].write(chunk) - - try { - return this.flowing - ? (this.emit('data', chunk), this.flowing) - : (this[BUFFERPUSH](chunk), false) - } finally { - if (this[BUFFERLENGTH] !== 0) - this.emit('readable') - if (cb) - cb() - } - } - - read (n) { - if (this[DESTROYED]) - return null - - try { - if (this[BUFFERLENGTH] === 0 || n === 0 || n > this[BUFFERLENGTH]) - return null - - if (this[OBJECTMODE]) - n = null - - if (this.buffer.length > 1 && !this[OBJECTMODE]) { - if (this.encoding) - this.buffer = new Yallist([ - Array.from(this.buffer).join('') - ]) - else - this.buffer = new Yallist([ - B.concat(Array.from(this.buffer), this[BUFFERLENGTH]) - ]) - } - - return this[READ](n || null, this.buffer.head.value) - } finally { - this[MAYBE_EMIT_END]() - } - } - - [READ] (n, chunk) { - if (n === chunk.length || n === null) - this[BUFFERSHIFT]() - else { - this.buffer.head.value = chunk.slice(n) - chunk = chunk.slice(0, n) - this[BUFFERLENGTH] -= n - } - - this.emit('data', chunk) - - if (!this.buffer.length && !this[EOF]) - this.emit('drain') - - return chunk - } - - end (chunk, encoding, cb) { - if (typeof chunk === 'function') - cb = chunk, chunk = null - if (typeof encoding === 'function') - cb = encoding, encoding = 'utf8' - if (chunk) - this.write(chunk, encoding) - if (cb) - this.once('end', cb) - this[EOF] = true - this.writable = false - - // if we haven't written anything, then go ahead and emit, - // even if we're not reading. - // we'll re-emit if a new 'end' listener is added anyway. - // This makes MP more suitable to write-only use cases. - if (this.flowing || !this[PAUSED]) - this[MAYBE_EMIT_END]() - return this - } - - // don't let the internal resume be overwritten - [RESUME] () { - if (this[DESTROYED]) - return - - this[PAUSED] = false - this[FLOWING] = true - this.emit('resume') - if (this.buffer.length) - this[FLUSH]() - else if (this[EOF]) - this[MAYBE_EMIT_END]() - else - this.emit('drain') - } - - resume () { - return this[RESUME]() - } - - pause () { - this[FLOWING] = false - this[PAUSED] = true - } - - get destroyed () { - return this[DESTROYED] - } - - get flowing () { - return this[FLOWING] - } - - get paused () { - return this[PAUSED] - } - - [BUFFERPUSH] (chunk) { - if (this[OBJECTMODE]) - this[BUFFERLENGTH] += 1 - else - this[BUFFERLENGTH] += chunk.length - return this.buffer.push(chunk) - } - - [BUFFERSHIFT] () { - if (this.buffer.length) { - if (this[OBJECTMODE]) - this[BUFFERLENGTH] -= 1 - else - this[BUFFERLENGTH] -= this.buffer.head.value.length - } - return this.buffer.shift() - } - - [FLUSH] () { - do {} while (this[FLUSHCHUNK](this[BUFFERSHIFT]())) - - if (!this.buffer.length && !this[EOF]) - this.emit('drain') - } - - [FLUSHCHUNK] (chunk) { - return chunk ? (this.emit('data', chunk), this.flowing) : false - } - - pipe (dest, opts) { - if (this[DESTROYED]) - return - - const ended = this[EMITTED_END] - opts = opts || {} - if (dest === process.stdout || dest === process.stderr) - opts.end = false - else - opts.end = opts.end !== false - - const p = { dest: dest, opts: opts, ondrain: _ => this[RESUME]() } - this.pipes.push(p) - - dest.on('drain', p.ondrain) - this[RESUME]() - // piping an ended stream ends immediately - if (ended && p.opts.end) - p.dest.end() - return dest - } - - addListener (ev, fn) { - return this.on(ev, fn) - } - - on (ev, fn) { - try { - return super.on(ev, fn) - } finally { - if (ev === 'data' && !this.pipes.length && !this.flowing) - this[RESUME]() - else if (isEndish(ev) && this[EMITTED_END]) { - super.emit(ev) - this.removeAllListeners(ev) - } - } - } - - get emittedEnd () { - return this[EMITTED_END] - } - - [MAYBE_EMIT_END] () { - if (!this[EMITTING_END] && - !this[EMITTED_END] && - !this[DESTROYED] && - this.buffer.length === 0 && - this[EOF]) { - this[EMITTING_END] = true - this.emit('end') - this.emit('prefinish') - this.emit('finish') - if (this[CLOSED]) - this.emit('close') - this[EMITTING_END] = false - } - } - - emit (ev, data) { - // error and close are only events allowed after calling destroy() - if (ev !== 'error' && ev !== 'close' && ev !== DESTROYED && this[DESTROYED]) - return - else if (ev === 'data') { - if (!data) - return - - if (this.pipes.length) - this.pipes.forEach(p => - p.dest.write(data) === false && this.pause()) - } else if (ev === 'end') { - // only actual end gets this treatment - if (this[EMITTED_END] === true) - return - - this[EMITTED_END] = true - this.readable = false - - if (this[DECODER]) { - data = this[DECODER].end() - if (data) { - this.pipes.forEach(p => p.dest.write(data)) - super.emit('data', data) - } - } - - this.pipes.forEach(p => { - p.dest.removeListener('drain', p.ondrain) - if (p.opts.end) - p.dest.end() - }) - } else if (ev === 'close') { - this[CLOSED] = true - // don't emit close before 'end' and 'finish' - if (!this[EMITTED_END] && !this[DESTROYED]) - return - } - - // TODO: replace with a spread operator when Node v4 support drops - const args = new Array(arguments.length) - args[0] = ev - args[1] = data - if (arguments.length > 2) { - for (let i = 2; i < arguments.length; i++) { - args[i] = arguments[i] - } - } - - try { - return super.emit.apply(this, args) - } finally { - if (!isEndish(ev)) - this[MAYBE_EMIT_END]() - else - this.removeAllListeners(ev) - } - } - - // const all = await stream.collect() - collect () { - const buf = [] - buf.dataLength = 0 - this.on('data', c => { - buf.push(c) - buf.dataLength += c.length - }) - return this.promise().then(() => buf) - } - - // const data = await stream.concat() - concat () { - return this[OBJECTMODE] - ? Promise.reject(new Error('cannot concat in objectMode')) - : this.collect().then(buf => - this[OBJECTMODE] - ? Promise.reject(new Error('cannot concat in objectMode')) - : this[ENCODING] ? buf.join('') : B.concat(buf, buf.dataLength)) - } - - // stream.promise().then(() => done, er => emitted error) - promise () { - return new Promise((resolve, reject) => { - this.on(DESTROYED, () => reject(new Error('stream destroyed'))) - this.on('end', () => resolve()) - this.on('error', er => reject(er)) - }) - } - - // for await (let chunk of stream) - [ASYNCITERATOR] () { - const next = () => { - const res = this.read() - if (res !== null) - return Promise.resolve({ done: false, value: res }) - - if (this[EOF]) - return Promise.resolve({ done: true }) - - let resolve = null - let reject = null - const onerr = er => { - this.removeListener('data', ondata) - this.removeListener('end', onend) - reject(er) - } - const ondata = value => { - this.removeListener('error', onerr) - this.removeListener('end', onend) - this.pause() - resolve({ value: value, done: !!this[EOF] }) - } - const onend = () => { - this.removeListener('error', onerr) - this.removeListener('data', ondata) - resolve({ done: true }) - } - const ondestroy = () => onerr(new Error('stream destroyed')) - return new Promise((res, rej) => { - reject = rej - resolve = res - this.once(DESTROYED, ondestroy) - this.once('error', onerr) - this.once('end', onend) - this.once('data', ondata) - }) - } - - return { next } - } - - // for (let chunk of stream) - [ITERATOR] () { - const next = () => { - const value = this.read() - const done = value === null - return { value, done } - } - return { next } - } - - destroy (er) { - if (this[DESTROYED]) { - if (er) - this.emit('error', er) - else - this.emit(DESTROYED) - return this - } - - this[DESTROYED] = true - - // throw away all buffered data, it's never coming out - this.buffer = new Yallist() - this[BUFFERLENGTH] = 0 - - if (typeof this.close === 'function' && !this[CLOSED]) - this.close() - - if (er) - this.emit('error', er) - else // if no error to emit, still reject pending promises - this.emit(DESTROYED) - - return this - } - - static isStream (s) { - return !!s && (s instanceof Minipass || s instanceof EE && ( - typeof s.pipe === 'function' || // readable - (typeof s.write === 'function' && typeof s.end === 'function') // writable - )) - } -} diff --git a/deps/npm/node_modules/pacote/node_modules/minipass/package.json b/deps/npm/node_modules/pacote/node_modules/minipass/package.json deleted file mode 100644 index 59adc63528e772..00000000000000 --- a/deps/npm/node_modules/pacote/node_modules/minipass/package.json +++ /dev/null @@ -1,70 +0,0 @@ -{ - "_from": "minipass@^2.3.5", - "_id": "minipass@2.9.0", - "_inBundle": false, - "_integrity": "sha512-wxfUjg9WebH+CUDX/CdbRlh5SmfZiy/hpkxaRI16Y9W56Pa75sWgd/rvFilSgrauD9NyFymP/+JFV3KwzIsJeg==", - "_location": "/pacote/minipass", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "minipass@^2.3.5", - "name": "minipass", - "escapedName": "minipass", - "rawSpec": "^2.3.5", - "saveSpec": null, - "fetchSpec": "^2.3.5" - }, - "_requiredBy": [ - "/pacote" - ], - "_resolved": "https://registry.npmjs.org/minipass/-/minipass-2.9.0.tgz", - "_shasum": "e713762e7d3e32fed803115cf93e04bca9fcc9a6", - "_spec": "minipass@^2.3.5", - "_where": "/Users/ruyadorno/Documents/workspace/cli/node_modules/pacote", - "author": { - "name": "Isaac Z. Schlueter", - "email": "i@izs.me", - "url": "http://blog.izs.me/" - }, - "bugs": { - "url": "https://github.com/isaacs/minipass/issues" - }, - "bundleDependencies": false, - "dependencies": { - "safe-buffer": "^5.1.2", - "yallist": "^3.0.0" - }, - "deprecated": false, - "description": "minimal implementation of a PassThrough stream", - "devDependencies": { - "end-of-stream": "^1.4.0", - "tap": "^14.6.5", - "through2": "^2.0.3" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/isaacs/minipass#readme", - "keywords": [ - "passthrough", - "stream" - ], - "license": "ISC", - "main": "index.js", - "name": "minipass", - "repository": { - "type": "git", - "url": "git+https://github.com/isaacs/minipass.git" - }, - "scripts": { - "postpublish": "git push origin --follow-tags", - "postversion": "npm publish", - "preversion": "npm test", - "test": "tap" - }, - "tap": { - "check-coverage": true - }, - "version": "2.9.0" -} diff --git a/deps/npm/node_modules/pacote/package.json b/deps/npm/node_modules/pacote/package.json index d558df21856cf0..9cddf610995243 100644 --- a/deps/npm/node_modules/pacote/package.json +++ b/deps/npm/node_modules/pacote/package.json @@ -1,127 +1,61 @@ { - "_from": "pacote@9.5.12", - "_id": "pacote@9.5.12", - "_inBundle": false, - "_integrity": "sha512-BUIj/4kKbwWg4RtnBncXPJd15piFSVNpTzY0rysSr3VnMowTYgkGKcaHrbReepAkjTr8lH2CVWRi58Spg2CicQ==", - "_location": "/pacote", - "_phantomChildren": { - "safe-buffer": "5.1.2", - "yallist": "3.0.3" - }, - "_requested": { - "type": "version", - "registry": true, - "raw": "pacote@9.5.12", - "name": "pacote", - "escapedName": "pacote", - "rawSpec": "9.5.12", - "saveSpec": null, - "fetchSpec": "9.5.12" - }, - "_requiredBy": [ - "#USER", - "/", - "/libcipm", - "/libnpm" - ], - "_resolved": "https://registry.npmjs.org/pacote/-/pacote-9.5.12.tgz", - "_shasum": "1e11dd7a8d736bcc36b375a9804d41bb0377bf66", - "_spec": "pacote@9.5.12", - "_where": "/Users/ruyadorno/Documents/workspace/cli", - "author": { - "name": "Kat Marchán", - "email": "kzm@sykosomatic.org" - }, - "bugs": { - "url": "https://github.com/npm/pacote/issues" - }, - "bundleDependencies": false, - "contributors": [ - { - "name": "Charlotte Spencer", - "email": "charlottelaspencer@gmail.com" - }, - { - "name": "Rebecca Turner", - "email": "me@re-becca.org" - } - ], - "dependencies": { - "bluebird": "^3.5.3", - "cacache": "^12.0.2", - "chownr": "^1.1.2", - "figgy-pudding": "^3.5.1", - "get-stream": "^4.1.0", - "glob": "^7.1.3", - "infer-owner": "^1.0.4", - "lru-cache": "^5.1.1", - "make-fetch-happen": "^5.0.0", - "minimatch": "^3.0.4", - "minipass": "^2.3.5", - "mississippi": "^3.0.0", - "mkdirp": "^0.5.1", - "normalize-package-data": "^2.4.0", - "npm-normalize-package-bin": "^1.0.0", - "npm-package-arg": "^6.1.0", - "npm-packlist": "^1.1.12", - "npm-pick-manifest": "^3.0.0", - "npm-registry-fetch": "^4.0.0", - "osenv": "^0.1.5", - "promise-inflight": "^1.0.1", - "promise-retry": "^1.1.1", - "protoduck": "^5.0.1", - "rimraf": "^2.6.2", - "safe-buffer": "^5.1.2", - "semver": "^5.6.0", - "ssri": "^6.0.1", - "tar": "^4.4.10", - "unique-filename": "^1.1.1", - "which": "^1.3.1" - }, - "deprecated": false, + "name": "pacote", + "version": "11.1.11", "description": "JavaScript package downloader", + "author": "Isaac Z. Schlueter (https://izs.me)", + "bin": "lib/bin.js", + "license": "ISC", + "main": "lib/index.js", + "scripts": { + "test": "tap", + "snap": "tap", + "preversion": "npm test", + "postversion": "npm publish", + "postpublish": "git push origin --follow-tags" + }, + "tap": { + "timeout": 300, + "check-coverage": true, + "coverage-map": "map.js", + "esm": false + }, "devDependencies": { - "nock": "^10.0.3", - "npmlog": "^4.1.2", - "nyc": "^14.1.1", - "require-inject": "^1.4.3", - "standard": "^12.0.1", - "standard-version": "^4.4.0", - "tacks": "^1.2.7", - "tap": "^12.7.0", - "tar-stream": "^1.6.2", - "weallbehave": "^1.2.0", - "weallcontribute": "^1.0.7" + "mutate-fs": "^2.1.1", + "npm-registry-mock": "^1.3.1", + "require-inject": "^1.4.4", + "tap": "^14.10.6" }, "files": [ - "*.js", - "lib" + "lib/**/*.js" ], - "homepage": "https://github.com/npm/pacote#readme", "keywords": [ "packages", "npm", "git" ], - "license": "MIT", - "main": "index.js", - "name": "pacote", - "publishConfig": { - "tag": "v9-legacy" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/npm/pacote.git" + "dependencies": { + "@npmcli/git": "^2.0.1", + "@npmcli/installed-package-contents": "^1.0.5", + "@npmcli/promise-spawn": "^1.2.0", + "@npmcli/run-script": "^1.3.0", + "cacache": "^15.0.5", + "chownr": "^2.0.0", + "fs-minipass": "^2.1.0", + "infer-owner": "^1.0.4", + "minipass": "^3.1.3", + "mkdirp": "^1.0.3", + "npm-package-arg": "^8.0.1", + "npm-packlist": "^2.1.0", + "npm-pick-manifest": "^6.0.0", + "npm-registry-fetch": "^8.1.3", + "promise-retry": "^1.1.1", + "read-package-json-fast": "^1.1.3", + "rimraf": "^3.0.2", + "ssri": "^8.0.0", + "tar": "^6.0.1" }, - "scripts": { - "postrelease": "npm publish && git push --follow-tags", - "prerelease": "npm t", - "pretest": "standard", - "release": "standard-version -s", - "test": "nyc --all -- tap -J test/*.js", - "test-docker": "docker run -it --rm --name pacotest -v \"$PWD\":/tmp -w /tmp node:latest npm test", - "update-coc": "weallbehave -o . && git add CODE_OF_CONDUCT.md && git commit -m 'docs(coc): updated CODE_OF_CONDUCT.md'", - "update-contrib": "weallcontribute -o . && git add CONTRIBUTING.md && git commit -m 'docs(contributing): updated CONTRIBUTING.md'" + "engines": { + "node": ">=10" }, - "version": "9.5.12" + "repository": "git@github.com:npm/pacote" } diff --git a/deps/npm/node_modules/pacote/packument.js b/deps/npm/node_modules/pacote/packument.js deleted file mode 100644 index 0606b266f972a6..00000000000000 --- a/deps/npm/node_modules/pacote/packument.js +++ /dev/null @@ -1,29 +0,0 @@ -'use strict' - -const fetchPackument = require('./lib/fetch').packument -const optCheck = require('./lib/util/opt-check') -const pinflight = require('promise-inflight') -const npa = require('npm-package-arg') - -module.exports = packument -function packument (spec, opts) { - opts = optCheck(opts) - spec = npa(spec, opts.where) - - const label = [ - spec.name, - spec.saveSpec || spec.fetchSpec, - spec.type, - opts.cache, - opts.registry, - opts.scope - ].join(':') - const startTime = Date.now() - return pinflight(label, () => { - return fetchPackument(spec, opts) - }).then(p => { - const elapsedTime = Date.now() - startTime - opts.log.silly('pacote', `${spec.registry ? 'registry' : spec.type} packument for ${spec.name}@${spec.saveSpec || spec.fetchSpec} fetched in ${elapsedTime}ms`) - return p - }) -} diff --git a/deps/npm/node_modules/pacote/prefetch.js b/deps/npm/node_modules/pacote/prefetch.js deleted file mode 100644 index 9e6b5af12d7275..00000000000000 --- a/deps/npm/node_modules/pacote/prefetch.js +++ /dev/null @@ -1,64 +0,0 @@ -'use strict' - -const BB = require('bluebird') - -const cacache = require('cacache') -const finished = BB.promisify(require('mississippi').finished) -const optCheck = require('./lib/util/opt-check') -const npa = require('npm-package-arg') - -module.exports = prefetch -function prefetch (spec, opts) { - opts = optCheck(opts) - spec = npa(spec, opts.where) - opts.log.warn('prefetch', 'pacote.prefetch() is deprecated. Please use pacote.tarball() instead.') - const startTime = Date.now() - if (!opts.cache) { - opts.log.info('prefetch', 'skipping prefetch: no cache provided') - return BB.resolve({ spec }) - } - if (opts.integrity && !opts.preferOnline) { - opts.log.silly('prefetch', 'checking if', opts.integrity, 'is already cached') - return cacache.get.hasContent(opts.cache, opts.integrity).then(info => { - if (info) { - opts.log.silly('prefetch', `content already exists for ${spec} (${Date.now() - startTime}ms)`) - return { - spec, - integrity: info.integrity, - size: info.size, - byDigest: true - } - } else { - return prefetchByManifest(startTime, spec, opts) - } - }) - } else { - opts.log.silly('prefetch', `no integrity hash provided for ${spec} - fetching by manifest`) - return prefetchByManifest(startTime, spec, opts) - } -} - -let fetch -function prefetchByManifest (start, spec, opts) { - let manifest - let integrity - return BB.resolve().then(() => { - if (!fetch) { - fetch = require('./lib/fetch') - } - const stream = fetch.tarball(spec, opts) - if (!stream) { return } - stream.on('data', function () {}) - stream.on('manifest', m => { manifest = m }) - stream.on('integrity', i => { integrity = i }) - return finished(stream) - }).then(() => { - opts.log.silly('prefetch', `${spec} done in ${Date.now() - start}ms`) - return { - manifest, - spec, - integrity: integrity || (manifest && manifest._integrity), - byDigest: false - } - }) -} diff --git a/deps/npm/node_modules/pacote/tarball.js b/deps/npm/node_modules/pacote/tarball.js deleted file mode 100644 index e0ad52ab3e4311..00000000000000 --- a/deps/npm/node_modules/pacote/tarball.js +++ /dev/null @@ -1,67 +0,0 @@ -'use strict' - -const BB = require('bluebird') - -const fs = require('fs') -const getStream = require('get-stream') -const mkdirp = BB.promisify(require('mkdirp')) -const npa = require('npm-package-arg') -const optCheck = require('./lib/util/opt-check.js') -const PassThrough = require('stream').PassThrough -const path = require('path') -const rimraf = BB.promisify(require('rimraf')) -const withTarballStream = require('./lib/with-tarball-stream.js') - -module.exports = tarball -function tarball (spec, opts) { - opts = optCheck(opts) - spec = npa(spec, opts.where) - return withTarballStream(spec, opts, stream => getStream.buffer(stream)) -} - -module.exports.stream = tarballStream -function tarballStream (spec, opts) { - opts = optCheck(opts) - spec = npa(spec, opts.where) - const output = new PassThrough() - let hasTouchedOutput = false - let lastError = null - withTarballStream(spec, opts, stream => { - if (hasTouchedOutput && lastError) { - throw lastError - } else if (hasTouchedOutput) { - throw new Error('abort, abort!') - } else { - return new BB((resolve, reject) => { - stream.on('error', reject) - output.on('error', reject) - output.on('error', () => { hasTouchedOutput = true }) - output.on('finish', resolve) - stream.pipe(output) - stream.once('data', () => { hasTouchedOutput = true }) - }).catch(err => { - lastError = err - throw err - }) - } - }) - .catch(err => output.emit('error', err)) - return output -} - -module.exports.toFile = tarballToFile -function tarballToFile (spec, dest, opts) { - opts = optCheck(opts) - spec = npa(spec, opts.where) - return mkdirp(path.dirname(dest)) - .then(() => withTarballStream(spec, opts, stream => { - return rimraf(dest) - .then(() => new BB((resolve, reject) => { - const writer = fs.createWriteStream(dest) - stream.on('error', reject) - writer.on('error', reject) - writer.on('close', resolve) - stream.pipe(writer) - })) - })) -} diff --git a/deps/npm/node_modules/parallel-transform/.npmignore b/deps/npm/node_modules/parallel-transform/.npmignore deleted file mode 100644 index 3c3629e647f5dd..00000000000000 --- a/deps/npm/node_modules/parallel-transform/.npmignore +++ /dev/null @@ -1 +0,0 @@ -node_modules diff --git a/deps/npm/node_modules/parallel-transform/LICENSE b/deps/npm/node_modules/parallel-transform/LICENSE deleted file mode 100644 index 4b30ed5d9509cb..00000000000000 --- a/deps/npm/node_modules/parallel-transform/LICENSE +++ /dev/null @@ -1,20 +0,0 @@ -Copyright 2013 Mathias Buus - -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/parallel-transform/README.md b/deps/npm/node_modules/parallel-transform/README.md deleted file mode 100644 index f53e130849328f..00000000000000 --- a/deps/npm/node_modules/parallel-transform/README.md +++ /dev/null @@ -1,54 +0,0 @@ -# parallel-transform - -[Transform stream](http://nodejs.org/api/stream.html#stream_class_stream_transform_1) for Node.js that allows you to run your transforms -in parallel without changing the order of the output. - - npm install parallel-transform - -It is easy to use - -``` js -var transform = require('parallel-transform'); - -var stream = transform(10, function(data, callback) { // 10 is the parallism level - setTimeout(function() { - callback(null, data); - }, Math.random() * 1000); -}); - -for (var i = 0; i < 10; i++) { - stream.write(''+i); -} -stream.end(); - -stream.on('data', function(data) { - console.log(data); // prints 0,1,2,... -}); -stream.on('end', function() { - console.log('stream has ended'); -}); -``` - -If you run the above example you'll notice that it runs in parallel -(does not take ~1 second between each print) and that the order is preserved - -## Stream options - -All transforms are Node 0.10 streams. Per default they are created with the options `{objectMode:true}`. -If you want to use your own stream options pass them as the second parameter - -``` js -var stream = transform(10, {objectMode:false}, function(data, callback) { - // data is now a buffer - callback(null, data); -}); - -fs.createReadStream('filename').pipe(stream).pipe(process.stdout); -``` - -### Unordered -Passing the option `{ordered:false}` will output the data as soon as it's processed by a transform, without waiting to respect the order. - -## License - -MIT \ No newline at end of file diff --git a/deps/npm/node_modules/parallel-transform/index.js b/deps/npm/node_modules/parallel-transform/index.js deleted file mode 100644 index 77329e4ccfecf1..00000000000000 --- a/deps/npm/node_modules/parallel-transform/index.js +++ /dev/null @@ -1,105 +0,0 @@ -var Transform = require('readable-stream').Transform; -var inherits = require('inherits'); -var cyclist = require('cyclist'); -var util = require('util'); - -var ParallelTransform = function(maxParallel, opts, ontransform) { - if (!(this instanceof ParallelTransform)) return new ParallelTransform(maxParallel, opts, ontransform); - - if (typeof maxParallel === 'function') { - ontransform = maxParallel; - opts = null; - maxParallel = 1; - } - if (typeof opts === 'function') { - ontransform = opts; - opts = null; - } - - if (!opts) opts = {}; - if (!opts.highWaterMark) opts.highWaterMark = Math.max(maxParallel, 16); - if (opts.objectMode !== false) opts.objectMode = true; - - Transform.call(this, opts); - - this._maxParallel = maxParallel; - this._ontransform = ontransform; - this._destroyed = false; - this._flushed = false; - this._ordered = opts.ordered !== false; - this._buffer = this._ordered ? cyclist(maxParallel) : []; - this._top = 0; - this._bottom = 0; - this._ondrain = null; -}; - -inherits(ParallelTransform, Transform); - -ParallelTransform.prototype.destroy = function() { - if (this._destroyed) return; - this._destroyed = true; - this.emit('close'); -}; - -ParallelTransform.prototype._transform = function(chunk, enc, callback) { - var self = this; - var pos = this._top++; - - this._ontransform(chunk, function(err, data) { - if (self._destroyed) return; - if (err) { - self.emit('error', err); - self.push(null); - self.destroy(); - return; - } - if (self._ordered) { - self._buffer.put(pos, (data === undefined || data === null) ? null : data); - } - else { - self._buffer.push(data); - } - self._drain(); - }); - - if (this._top - this._bottom < this._maxParallel) return callback(); - this._ondrain = callback; -}; - -ParallelTransform.prototype._flush = function(callback) { - this._flushed = true; - this._ondrain = callback; - this._drain(); -}; - -ParallelTransform.prototype._drain = function() { - if (this._ordered) { - while (this._buffer.get(this._bottom) !== undefined) { - var data = this._buffer.del(this._bottom++); - if (data === null) continue; - this.push(data); - } - } - else { - while (this._buffer.length > 0) { - var data = this._buffer.pop(); - this._bottom++; - if (data === null) continue; - this.push(data); - } - } - - - if (!this._drained() || !this._ondrain) return; - - var ondrain = this._ondrain; - this._ondrain = null; - ondrain(); -}; - -ParallelTransform.prototype._drained = function() { - var diff = this._top - this._bottom; - return this._flushed ? !diff : diff < this._maxParallel; -}; - -module.exports = ParallelTransform; diff --git a/deps/npm/node_modules/parallel-transform/node_modules/readable-stream/.travis.yml b/deps/npm/node_modules/parallel-transform/node_modules/readable-stream/.travis.yml deleted file mode 100644 index 40992555bf5cc0..00000000000000 --- a/deps/npm/node_modules/parallel-transform/node_modules/readable-stream/.travis.yml +++ /dev/null @@ -1,55 +0,0 @@ -sudo: false -language: node_js -before_install: - - npm install -g npm@2 - - test $NPM_LEGACY && npm install -g npm@latest-3 || npm install npm -g -notifications: - email: false -matrix: - fast_finish: true - include: - - node_js: '0.8' - env: - - TASK=test - - NPM_LEGACY=true - - node_js: '0.10' - env: - - TASK=test - - NPM_LEGACY=true - - node_js: '0.11' - env: - - TASK=test - - NPM_LEGACY=true - - node_js: '0.12' - env: - - TASK=test - - NPM_LEGACY=true - - node_js: 1 - env: - - TASK=test - - NPM_LEGACY=true - - node_js: 2 - env: - - TASK=test - - NPM_LEGACY=true - - node_js: 3 - env: - - TASK=test - - NPM_LEGACY=true - - node_js: 4 - env: TASK=test - - node_js: 5 - env: TASK=test - - node_js: 6 - env: TASK=test - - node_js: 7 - env: TASK=test - - node_js: 8 - env: TASK=test - - node_js: 9 - env: TASK=test -script: "npm run $TASK" -env: - global: - - secure: rE2Vvo7vnjabYNULNyLFxOyt98BoJexDqsiOnfiD6kLYYsiQGfr/sbZkPMOFm9qfQG7pjqx+zZWZjGSswhTt+626C0t/njXqug7Yps4c3dFblzGfreQHp7wNX5TFsvrxd6dAowVasMp61sJcRnB2w8cUzoe3RAYUDHyiHktwqMc= - - secure: g9YINaKAdMatsJ28G9jCGbSaguXCyxSTy+pBO6Ch0Cf57ZLOTka3HqDj8p3nV28LUIHZ3ut5WO43CeYKwt4AUtLpBS3a0dndHdY6D83uY6b2qh5hXlrcbeQTq2cvw2y95F7hm4D1kwrgZ7ViqaKggRcEupAL69YbJnxeUDKWEdI= diff --git a/deps/npm/node_modules/parallel-transform/node_modules/readable-stream/GOVERNANCE.md b/deps/npm/node_modules/parallel-transform/node_modules/readable-stream/GOVERNANCE.md deleted file mode 100644 index 16ffb93f24bece..00000000000000 --- a/deps/npm/node_modules/parallel-transform/node_modules/readable-stream/GOVERNANCE.md +++ /dev/null @@ -1,136 +0,0 @@ -### Streams Working Group - -The Node.js Streams is jointly governed by a Working Group -(WG) -that is responsible for high-level guidance of the project. - -The WG has final authority over this project including: - -* Technical direction -* Project governance and process (including this policy) -* Contribution policy -* GitHub repository hosting -* Conduct guidelines -* Maintaining the list of additional Collaborators - -For the current list of WG members, see the project -[README.md](./README.md#current-project-team-members). - -### Collaborators - -The readable-stream GitHub repository is -maintained by the WG and additional Collaborators who are added by the -WG on an ongoing basis. - -Individuals making significant and valuable contributions are made -Collaborators and given commit-access to the project. These -individuals are identified by the WG and their addition as -Collaborators is discussed during the WG meeting. - -_Note:_ If you make a significant contribution and are not considered -for commit-access log an issue or contact a WG member directly and it -will be brought up in the next WG meeting. - -Modifications of the contents of the readable-stream repository are -made on -a collaborative basis. Anybody with a GitHub account may propose a -modification via pull request and it will be considered by the project -Collaborators. All pull requests must be reviewed and accepted by a -Collaborator with sufficient expertise who is able to take full -responsibility for the change. In the case of pull requests proposed -by an existing Collaborator, an additional Collaborator is required -for sign-off. Consensus should be sought if additional Collaborators -participate and there is disagreement around a particular -modification. See _Consensus Seeking Process_ below for further detail -on the consensus model used for governance. - -Collaborators may opt to elevate significant or controversial -modifications, or modifications that have not found consensus to the -WG for discussion by assigning the ***WG-agenda*** tag to a pull -request or issue. The WG should serve as the final arbiter where -required. - -For the current list of Collaborators, see the project -[README.md](./README.md#members). - -### WG Membership - -WG seats are not time-limited. There is no fixed size of the WG. -However, the expected target is between 6 and 12, to ensure adequate -coverage of important areas of expertise, balanced with the ability to -make decisions efficiently. - -There is no specific set of requirements or qualifications for WG -membership beyond these rules. - -The WG may add additional members to the WG by unanimous consensus. - -A WG member may be removed from the WG by voluntary resignation, or by -unanimous consensus of all other WG members. - -Changes to WG membership should be posted in the agenda, and may be -suggested as any other agenda item (see "WG Meetings" below). - -If an addition or removal is proposed during a meeting, and the full -WG is not in attendance to participate, then the addition or removal -is added to the agenda for the subsequent meeting. This is to ensure -that all members are given the opportunity to participate in all -membership decisions. If a WG member is unable to attend a meeting -where a planned membership decision is being made, then their consent -is assumed. - -No more than 1/3 of the WG members may be affiliated with the same -employer. If removal or resignation of a WG member, or a change of -employment by a WG member, creates a situation where more than 1/3 of -the WG membership shares an employer, then the situation must be -immediately remedied by the resignation or removal of one or more WG -members affiliated with the over-represented employer(s). - -### WG Meetings - -The WG meets occasionally on a Google Hangout On Air. A designated moderator -approved by the WG runs the meeting. Each meeting should be -published to YouTube. - -Items are added to the WG agenda that are considered contentious or -are modifications of governance, contribution policy, WG membership, -or release process. - -The intention of the agenda is not to approve or review all patches; -that should happen continuously on GitHub and be handled by the larger -group of Collaborators. - -Any community member or contributor can ask that something be added to -the next meeting's agenda by logging a GitHub Issue. Any Collaborator, -WG member or the moderator can add the item to the agenda by adding -the ***WG-agenda*** tag to the issue. - -Prior to each WG meeting the moderator will share the Agenda with -members of the WG. WG members can add any items they like to the -agenda at the beginning of each meeting. The moderator and the WG -cannot veto or remove items. - -The WG may invite persons or representatives from certain projects to -participate in a non-voting capacity. - -The moderator is responsible for summarizing the discussion of each -agenda item and sends it as a pull request after the meeting. - -### Consensus Seeking Process - -The WG follows a -[Consensus -Seeking](http://en.wikipedia.org/wiki/Consensus-seeking_decision-making) -decision-making model. - -When an agenda item has appeared to reach a consensus the moderator -will ask "Does anyone object?" as a final call for dissent from the -consensus. - -If an agenda item cannot reach a consensus a WG member can call for -either a closing vote or a vote to table the issue to the next -meeting. The call for a vote must be seconded by a majority of the WG -or else the discussion will continue. Simple majority wins. - -Note that changes to WG membership require a majority consensus. See -"WG Membership" above. diff --git a/deps/npm/node_modules/parallel-transform/node_modules/readable-stream/LICENSE b/deps/npm/node_modules/parallel-transform/node_modules/readable-stream/LICENSE deleted file mode 100644 index 2873b3b2e59507..00000000000000 --- a/deps/npm/node_modules/parallel-transform/node_modules/readable-stream/LICENSE +++ /dev/null @@ -1,47 +0,0 @@ -Node.js is licensed for use as follows: - -""" -Copyright Node.js contributors. All rights reserved. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to -deal in the Software without restriction, including without limitation the -rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -sell copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -IN THE SOFTWARE. -""" - -This license applies to parts of Node.js originating from the -https://github.com/joyent/node repository: - -""" -Copyright Joyent, Inc. and other Node contributors. All rights reserved. -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to -deal in the Software without restriction, including without limitation the -rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -sell copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -IN THE SOFTWARE. -""" diff --git a/deps/npm/node_modules/parallel-transform/node_modules/readable-stream/README.md b/deps/npm/node_modules/parallel-transform/node_modules/readable-stream/README.md deleted file mode 100644 index 23fe3f3e3009a2..00000000000000 --- a/deps/npm/node_modules/parallel-transform/node_modules/readable-stream/README.md +++ /dev/null @@ -1,58 +0,0 @@ -# readable-stream - -***Node-core v8.11.1 streams for userland*** [![Build Status](https://travis-ci.org/nodejs/readable-stream.svg?branch=master)](https://travis-ci.org/nodejs/readable-stream) - - -[![NPM](https://nodei.co/npm/readable-stream.png?downloads=true&downloadRank=true)](https://nodei.co/npm/readable-stream/) -[![NPM](https://nodei.co/npm-dl/readable-stream.png?&months=6&height=3)](https://nodei.co/npm/readable-stream/) - - -[![Sauce Test Status](https://saucelabs.com/browser-matrix/readable-stream.svg)](https://saucelabs.com/u/readable-stream) - -```bash -npm install --save readable-stream -``` - -***Node-core streams for userland*** - -This package is a mirror of the Streams2 and Streams3 implementations in -Node-core. - -Full documentation may be found on the [Node.js website](https://nodejs.org/dist/v8.11.1/docs/api/stream.html). - -If you want to guarantee a stable streams base, regardless of what version of -Node you, or the users of your libraries are using, use **readable-stream** *only* and avoid the *"stream"* module in Node-core, for background see [this blogpost](http://r.va.gg/2014/06/why-i-dont-use-nodes-core-stream-module.html). - -As of version 2.0.0 **readable-stream** uses semantic versioning. - -# Streams Working Group - -`readable-stream` is maintained by the Streams Working Group, which -oversees the development and maintenance of the Streams API within -Node.js. The responsibilities of the Streams Working Group include: - -* Addressing stream issues on the Node.js issue tracker. -* Authoring and editing stream documentation within the Node.js project. -* Reviewing changes to stream subclasses within the Node.js project. -* Redirecting changes to streams from the Node.js project to this - project. -* Assisting in the implementation of stream providers within Node.js. -* Recommending versions of `readable-stream` to be included in Node.js. -* Messaging about the future of streams to give the community advance - notice of changes. - - -## Team Members - -* **Chris Dickinson** ([@chrisdickinson](https://github.com/chrisdickinson)) <christopher.s.dickinson@gmail.com> - - Release GPG key: 9554F04D7259F04124DE6B476D5A82AC7E37093B -* **Calvin Metcalf** ([@calvinmetcalf](https://github.com/calvinmetcalf)) <calvin.metcalf@gmail.com> - - Release GPG key: F3EF5F62A87FC27A22E643F714CE4FF5015AA242 -* **Rod Vagg** ([@rvagg](https://github.com/rvagg)) <rod@vagg.org> - - Release GPG key: DD8F2338BAE7501E3DD5AC78C273792F7D83545D -* **Sam Newman** ([@sonewman](https://github.com/sonewman)) <newmansam@outlook.com> -* **Mathias Buus** ([@mafintosh](https://github.com/mafintosh)) <mathiasbuus@gmail.com> -* **Domenic Denicola** ([@domenic](https://github.com/domenic)) <d@domenic.me> -* **Matteo Collina** ([@mcollina](https://github.com/mcollina)) <matteo.collina@gmail.com> - - Release GPG key: 3ABC01543F22DD2239285CDD818674489FBC127E -* **Irina Shestak** ([@lrlna](https://github.com/lrlna)) <shestak.irina@gmail.com> diff --git a/deps/npm/node_modules/parallel-transform/node_modules/readable-stream/doc/wg-meetings/2015-01-30.md b/deps/npm/node_modules/parallel-transform/node_modules/readable-stream/doc/wg-meetings/2015-01-30.md deleted file mode 100644 index 83275f192e4077..00000000000000 --- a/deps/npm/node_modules/parallel-transform/node_modules/readable-stream/doc/wg-meetings/2015-01-30.md +++ /dev/null @@ -1,60 +0,0 @@ -# streams WG Meeting 2015-01-30 - -## Links - -* **Google Hangouts Video**: http://www.youtube.com/watch?v=I9nDOSGfwZg -* **GitHub Issue**: https://github.com/iojs/readable-stream/issues/106 -* **Original Minutes Google Doc**: https://docs.google.com/document/d/17aTgLnjMXIrfjgNaTUnHQO7m3xgzHR2VXBTmi03Qii4/ - -## Agenda - -Extracted from https://github.com/iojs/readable-stream/labels/wg-agenda prior to meeting. - -* adopt a charter [#105](https://github.com/iojs/readable-stream/issues/105) -* release and versioning strategy [#101](https://github.com/iojs/readable-stream/issues/101) -* simpler stream creation [#102](https://github.com/iojs/readable-stream/issues/102) -* proposal: deprecate implicit flowing of streams [#99](https://github.com/iojs/readable-stream/issues/99) - -## Minutes - -### adopt a charter - -* group: +1's all around - -### What versioning scheme should be adopted? -* group: +1’s 3.0.0 -* domenic+group: pulling in patches from other sources where appropriate -* mikeal: version independently, suggesting versions for io.js -* mikeal+domenic: work with TC to notify in advance of changes -simpler stream creation - -### streamline creation of streams -* sam: streamline creation of streams -* domenic: nice simple solution posted - but, we lose the opportunity to change the model - may not be backwards incompatible (double check keys) - - **action item:** domenic will check - -### remove implicit flowing of streams on(‘data’) -* add isFlowing / isPaused -* mikeal: worrying that we’re documenting polyfill methods – confuses users -* domenic: more reflective API is probably good, with warning labels for users -* new section for mad scientists (reflective stream access) -* calvin: name the “third state” -* mikeal: maybe borrow the name from whatwg? -* domenic: we’re missing the “third state” -* consensus: kind of difficult to name the third state -* mikeal: figure out differences in states / compat -* mathias: always flow on data – eliminates third state - * explore what it breaks - -**action items:** -* ask isaac for ability to list packages by what public io.js APIs they use (esp. Stream) -* ask rod/build for infrastructure -* **chris**: explore the “flow on data” approach -* add isPaused/isFlowing -* add new docs section -* move isPaused to that section - - diff --git a/deps/npm/node_modules/parallel-transform/node_modules/readable-stream/duplex-browser.js b/deps/npm/node_modules/parallel-transform/node_modules/readable-stream/duplex-browser.js deleted file mode 100644 index f8b2db83dbe733..00000000000000 --- a/deps/npm/node_modules/parallel-transform/node_modules/readable-stream/duplex-browser.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./lib/_stream_duplex.js'); diff --git a/deps/npm/node_modules/parallel-transform/node_modules/readable-stream/duplex.js b/deps/npm/node_modules/parallel-transform/node_modules/readable-stream/duplex.js deleted file mode 100644 index 46924cbfdf5387..00000000000000 --- a/deps/npm/node_modules/parallel-transform/node_modules/readable-stream/duplex.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./readable').Duplex diff --git a/deps/npm/node_modules/parallel-transform/node_modules/readable-stream/lib/_stream_duplex.js b/deps/npm/node_modules/parallel-transform/node_modules/readable-stream/lib/_stream_duplex.js deleted file mode 100644 index a1ca813e5acbd8..00000000000000 --- a/deps/npm/node_modules/parallel-transform/node_modules/readable-stream/lib/_stream_duplex.js +++ /dev/null @@ -1,131 +0,0 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - -// a duplex stream is just a stream that is both readable and writable. -// Since JS doesn't have multiple prototypal inheritance, this class -// prototypally inherits from Readable, and then parasitically from -// Writable. - -'use strict'; - -/**/ - -var pna = require('process-nextick-args'); -/**/ - -/**/ -var objectKeys = Object.keys || function (obj) { - var keys = []; - for (var key in obj) { - keys.push(key); - }return keys; -}; -/**/ - -module.exports = Duplex; - -/**/ -var util = require('core-util-is'); -util.inherits = require('inherits'); -/**/ - -var Readable = require('./_stream_readable'); -var Writable = require('./_stream_writable'); - -util.inherits(Duplex, Readable); - -{ - // avoid scope creep, the keys array can then be collected - var keys = objectKeys(Writable.prototype); - for (var v = 0; v < keys.length; v++) { - var method = keys[v]; - if (!Duplex.prototype[method]) Duplex.prototype[method] = Writable.prototype[method]; - } -} - -function Duplex(options) { - if (!(this instanceof Duplex)) return new Duplex(options); - - Readable.call(this, options); - Writable.call(this, options); - - if (options && options.readable === false) this.readable = false; - - if (options && options.writable === false) this.writable = false; - - this.allowHalfOpen = true; - if (options && options.allowHalfOpen === false) this.allowHalfOpen = false; - - this.once('end', onend); -} - -Object.defineProperty(Duplex.prototype, 'writableHighWaterMark', { - // making it explicit this property is not enumerable - // because otherwise some prototype manipulation in - // userland will fail - enumerable: false, - get: function () { - return this._writableState.highWaterMark; - } -}); - -// the no-half-open enforcer -function onend() { - // if we allow half-open state, or if the writable side ended, - // then we're ok. - if (this.allowHalfOpen || this._writableState.ended) return; - - // no more data can be written. - // But allow more writes to happen in this tick. - pna.nextTick(onEndNT, this); -} - -function onEndNT(self) { - self.end(); -} - -Object.defineProperty(Duplex.prototype, 'destroyed', { - get: function () { - if (this._readableState === undefined || this._writableState === undefined) { - return false; - } - return this._readableState.destroyed && this._writableState.destroyed; - }, - set: function (value) { - // we ignore the value if the stream - // has not been initialized yet - if (this._readableState === undefined || this._writableState === undefined) { - return; - } - - // backward compatibility, the user is explicitly - // managing destroyed - this._readableState.destroyed = value; - this._writableState.destroyed = value; - } -}); - -Duplex.prototype._destroy = function (err, cb) { - this.push(null); - this.end(); - - pna.nextTick(cb, err); -}; \ No newline at end of file diff --git a/deps/npm/node_modules/parallel-transform/node_modules/readable-stream/lib/_stream_passthrough.js b/deps/npm/node_modules/parallel-transform/node_modules/readable-stream/lib/_stream_passthrough.js deleted file mode 100644 index a9c835884828d8..00000000000000 --- a/deps/npm/node_modules/parallel-transform/node_modules/readable-stream/lib/_stream_passthrough.js +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - -// a passthrough stream. -// basically just the most minimal sort of Transform stream. -// Every written chunk gets output as-is. - -'use strict'; - -module.exports = PassThrough; - -var Transform = require('./_stream_transform'); - -/**/ -var util = require('core-util-is'); -util.inherits = require('inherits'); -/**/ - -util.inherits(PassThrough, Transform); - -function PassThrough(options) { - if (!(this instanceof PassThrough)) return new PassThrough(options); - - Transform.call(this, options); -} - -PassThrough.prototype._transform = function (chunk, encoding, cb) { - cb(null, chunk); -}; \ No newline at end of file diff --git a/deps/npm/node_modules/parallel-transform/node_modules/readable-stream/lib/_stream_readable.js b/deps/npm/node_modules/parallel-transform/node_modules/readable-stream/lib/_stream_readable.js deleted file mode 100644 index bf34ac65e1108f..00000000000000 --- a/deps/npm/node_modules/parallel-transform/node_modules/readable-stream/lib/_stream_readable.js +++ /dev/null @@ -1,1019 +0,0 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - -'use strict'; - -/**/ - -var pna = require('process-nextick-args'); -/**/ - -module.exports = Readable; - -/**/ -var isArray = require('isarray'); -/**/ - -/**/ -var Duplex; -/**/ - -Readable.ReadableState = ReadableState; - -/**/ -var EE = require('events').EventEmitter; - -var EElistenerCount = function (emitter, type) { - return emitter.listeners(type).length; -}; -/**/ - -/**/ -var Stream = require('./internal/streams/stream'); -/**/ - -/**/ - -var Buffer = require('safe-buffer').Buffer; -var OurUint8Array = global.Uint8Array || function () {}; -function _uint8ArrayToBuffer(chunk) { - return Buffer.from(chunk); -} -function _isUint8Array(obj) { - return Buffer.isBuffer(obj) || obj instanceof OurUint8Array; -} - -/**/ - -/**/ -var util = require('core-util-is'); -util.inherits = require('inherits'); -/**/ - -/**/ -var debugUtil = require('util'); -var debug = void 0; -if (debugUtil && debugUtil.debuglog) { - debug = debugUtil.debuglog('stream'); -} else { - debug = function () {}; -} -/**/ - -var BufferList = require('./internal/streams/BufferList'); -var destroyImpl = require('./internal/streams/destroy'); -var StringDecoder; - -util.inherits(Readable, Stream); - -var kProxyEvents = ['error', 'close', 'destroy', 'pause', 'resume']; - -function prependListener(emitter, event, fn) { - // Sadly this is not cacheable as some libraries bundle their own - // event emitter implementation with them. - if (typeof emitter.prependListener === 'function') return emitter.prependListener(event, fn); - - // This is a hack to make sure that our error handler is attached before any - // userland ones. NEVER DO THIS. This is here only because this code needs - // to continue to work with older versions of Node.js that do not include - // the prependListener() method. The goal is to eventually remove this hack. - if (!emitter._events || !emitter._events[event]) emitter.on(event, fn);else if (isArray(emitter._events[event])) emitter._events[event].unshift(fn);else emitter._events[event] = [fn, emitter._events[event]]; -} - -function ReadableState(options, stream) { - Duplex = Duplex || require('./_stream_duplex'); - - options = options || {}; - - // Duplex streams are both readable and writable, but share - // the same options object. - // However, some cases require setting options to different - // values for the readable and the writable sides of the duplex stream. - // These options can be provided separately as readableXXX and writableXXX. - var isDuplex = stream instanceof Duplex; - - // object stream flag. Used to make read(n) ignore n and to - // make all the buffer merging and length checks go away - this.objectMode = !!options.objectMode; - - if (isDuplex) this.objectMode = this.objectMode || !!options.readableObjectMode; - - // the point at which it stops calling _read() to fill the buffer - // Note: 0 is a valid value, means "don't call _read preemptively ever" - var hwm = options.highWaterMark; - var readableHwm = options.readableHighWaterMark; - var defaultHwm = this.objectMode ? 16 : 16 * 1024; - - if (hwm || hwm === 0) this.highWaterMark = hwm;else if (isDuplex && (readableHwm || readableHwm === 0)) this.highWaterMark = readableHwm;else this.highWaterMark = defaultHwm; - - // cast to ints. - this.highWaterMark = Math.floor(this.highWaterMark); - - // A linked list is used to store data chunks instead of an array because the - // linked list can remove elements from the beginning faster than - // array.shift() - this.buffer = new BufferList(); - this.length = 0; - this.pipes = null; - this.pipesCount = 0; - this.flowing = null; - this.ended = false; - this.endEmitted = false; - this.reading = false; - - // a flag to be able to tell if the event 'readable'/'data' is emitted - // immediately, or on a later tick. We set this to true at first, because - // any actions that shouldn't happen until "later" should generally also - // not happen before the first read call. - this.sync = true; - - // whenever we return null, then we set a flag to say - // that we're awaiting a 'readable' event emission. - this.needReadable = false; - this.emittedReadable = false; - this.readableListening = false; - this.resumeScheduled = false; - - // has it been destroyed - this.destroyed = false; - - // Crypto is kind of old and crusty. Historically, its default string - // encoding is 'binary' so we have to make this configurable. - // Everything else in the universe uses 'utf8', though. - this.defaultEncoding = options.defaultEncoding || 'utf8'; - - // the number of writers that are awaiting a drain event in .pipe()s - this.awaitDrain = 0; - - // if true, a maybeReadMore has been scheduled - this.readingMore = false; - - this.decoder = null; - this.encoding = null; - if (options.encoding) { - if (!StringDecoder) StringDecoder = require('string_decoder/').StringDecoder; - this.decoder = new StringDecoder(options.encoding); - this.encoding = options.encoding; - } -} - -function Readable(options) { - Duplex = Duplex || require('./_stream_duplex'); - - if (!(this instanceof Readable)) return new Readable(options); - - this._readableState = new ReadableState(options, this); - - // legacy - this.readable = true; - - if (options) { - if (typeof options.read === 'function') this._read = options.read; - - if (typeof options.destroy === 'function') this._destroy = options.destroy; - } - - Stream.call(this); -} - -Object.defineProperty(Readable.prototype, 'destroyed', { - get: function () { - if (this._readableState === undefined) { - return false; - } - return this._readableState.destroyed; - }, - set: function (value) { - // we ignore the value if the stream - // has not been initialized yet - if (!this._readableState) { - return; - } - - // backward compatibility, the user is explicitly - // managing destroyed - this._readableState.destroyed = value; - } -}); - -Readable.prototype.destroy = destroyImpl.destroy; -Readable.prototype._undestroy = destroyImpl.undestroy; -Readable.prototype._destroy = function (err, cb) { - this.push(null); - cb(err); -}; - -// Manually shove something into the read() buffer. -// This returns true if the highWaterMark has not been hit yet, -// similar to how Writable.write() returns true if you should -// write() some more. -Readable.prototype.push = function (chunk, encoding) { - var state = this._readableState; - var skipChunkCheck; - - if (!state.objectMode) { - if (typeof chunk === 'string') { - encoding = encoding || state.defaultEncoding; - if (encoding !== state.encoding) { - chunk = Buffer.from(chunk, encoding); - encoding = ''; - } - skipChunkCheck = true; - } - } else { - skipChunkCheck = true; - } - - return readableAddChunk(this, chunk, encoding, false, skipChunkCheck); -}; - -// Unshift should *always* be something directly out of read() -Readable.prototype.unshift = function (chunk) { - return readableAddChunk(this, chunk, null, true, false); -}; - -function readableAddChunk(stream, chunk, encoding, addToFront, skipChunkCheck) { - var state = stream._readableState; - if (chunk === null) { - state.reading = false; - onEofChunk(stream, state); - } else { - var er; - if (!skipChunkCheck) er = chunkInvalid(state, chunk); - if (er) { - stream.emit('error', er); - } else if (state.objectMode || chunk && chunk.length > 0) { - if (typeof chunk !== 'string' && !state.objectMode && Object.getPrototypeOf(chunk) !== Buffer.prototype) { - chunk = _uint8ArrayToBuffer(chunk); - } - - if (addToFront) { - if (state.endEmitted) stream.emit('error', new Error('stream.unshift() after end event'));else addChunk(stream, state, chunk, true); - } else if (state.ended) { - stream.emit('error', new Error('stream.push() after EOF')); - } else { - state.reading = false; - if (state.decoder && !encoding) { - chunk = state.decoder.write(chunk); - if (state.objectMode || chunk.length !== 0) addChunk(stream, state, chunk, false);else maybeReadMore(stream, state); - } else { - addChunk(stream, state, chunk, false); - } - } - } else if (!addToFront) { - state.reading = false; - } - } - - return needMoreData(state); -} - -function addChunk(stream, state, chunk, addToFront) { - if (state.flowing && state.length === 0 && !state.sync) { - stream.emit('data', chunk); - stream.read(0); - } else { - // update the buffer info. - state.length += state.objectMode ? 1 : chunk.length; - if (addToFront) state.buffer.unshift(chunk);else state.buffer.push(chunk); - - if (state.needReadable) emitReadable(stream); - } - maybeReadMore(stream, state); -} - -function chunkInvalid(state, chunk) { - var er; - if (!_isUint8Array(chunk) && typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) { - er = new TypeError('Invalid non-string/buffer chunk'); - } - return er; -} - -// if it's past the high water mark, we can push in some more. -// Also, if we have no data yet, we can stand some -// more bytes. This is to work around cases where hwm=0, -// such as the repl. Also, if the push() triggered a -// readable event, and the user called read(largeNumber) such that -// needReadable was set, then we ought to push more, so that another -// 'readable' event will be triggered. -function needMoreData(state) { - return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0); -} - -Readable.prototype.isPaused = function () { - return this._readableState.flowing === false; -}; - -// backwards compatibility. -Readable.prototype.setEncoding = function (enc) { - if (!StringDecoder) StringDecoder = require('string_decoder/').StringDecoder; - this._readableState.decoder = new StringDecoder(enc); - this._readableState.encoding = enc; - return this; -}; - -// Don't raise the hwm > 8MB -var MAX_HWM = 0x800000; -function computeNewHighWaterMark(n) { - if (n >= MAX_HWM) { - n = MAX_HWM; - } else { - // Get the next highest power of 2 to prevent increasing hwm excessively in - // tiny amounts - n--; - n |= n >>> 1; - n |= n >>> 2; - n |= n >>> 4; - n |= n >>> 8; - n |= n >>> 16; - n++; - } - return n; -} - -// This function is designed to be inlinable, so please take care when making -// changes to the function body. -function howMuchToRead(n, state) { - if (n <= 0 || state.length === 0 && state.ended) return 0; - if (state.objectMode) return 1; - if (n !== n) { - // Only flow one buffer at a time - if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length; - } - // If we're asking for more than the current hwm, then raise the hwm. - if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n); - if (n <= state.length) return n; - // Don't have enough - if (!state.ended) { - state.needReadable = true; - return 0; - } - return state.length; -} - -// you can override either this method, or the async _read(n) below. -Readable.prototype.read = function (n) { - debug('read', n); - n = parseInt(n, 10); - var state = this._readableState; - var nOrig = n; - - if (n !== 0) state.emittedReadable = false; - - // if we're doing read(0) to trigger a readable event, but we - // already have a bunch of data in the buffer, then just trigger - // the 'readable' event and move on. - if (n === 0 && state.needReadable && (state.length >= state.highWaterMark || state.ended)) { - debug('read: emitReadable', state.length, state.ended); - if (state.length === 0 && state.ended) endReadable(this);else emitReadable(this); - return null; - } - - n = howMuchToRead(n, state); - - // if we've ended, and we're now clear, then finish it up. - if (n === 0 && state.ended) { - if (state.length === 0) endReadable(this); - return null; - } - - // All the actual chunk generation logic needs to be - // *below* the call to _read. The reason is that in certain - // synthetic stream cases, such as passthrough streams, _read - // may be a completely synchronous operation which may change - // the state of the read buffer, providing enough data when - // before there was *not* enough. - // - // So, the steps are: - // 1. Figure out what the state of things will be after we do - // a read from the buffer. - // - // 2. If that resulting state will trigger a _read, then call _read. - // Note that this may be asynchronous, or synchronous. Yes, it is - // deeply ugly to write APIs this way, but that still doesn't mean - // that the Readable class should behave improperly, as streams are - // designed to be sync/async agnostic. - // Take note if the _read call is sync or async (ie, if the read call - // has returned yet), so that we know whether or not it's safe to emit - // 'readable' etc. - // - // 3. Actually pull the requested chunks out of the buffer and return. - - // if we need a readable event, then we need to do some reading. - var doRead = state.needReadable; - debug('need readable', doRead); - - // if we currently have less than the highWaterMark, then also read some - if (state.length === 0 || state.length - n < state.highWaterMark) { - doRead = true; - debug('length less than watermark', doRead); - } - - // however, if we've ended, then there's no point, and if we're already - // reading, then it's unnecessary. - if (state.ended || state.reading) { - doRead = false; - debug('reading or ended', doRead); - } else if (doRead) { - debug('do read'); - state.reading = true; - state.sync = true; - // if the length is currently zero, then we *need* a readable event. - if (state.length === 0) state.needReadable = true; - // call internal read method - this._read(state.highWaterMark); - state.sync = false; - // If _read pushed data synchronously, then `reading` will be false, - // and we need to re-evaluate how much data we can return to the user. - if (!state.reading) n = howMuchToRead(nOrig, state); - } - - var ret; - if (n > 0) ret = fromList(n, state);else ret = null; - - if (ret === null) { - state.needReadable = true; - n = 0; - } else { - state.length -= n; - } - - if (state.length === 0) { - // If we have nothing in the buffer, then we want to know - // as soon as we *do* get something into the buffer. - if (!state.ended) state.needReadable = true; - - // If we tried to read() past the EOF, then emit end on the next tick. - if (nOrig !== n && state.ended) endReadable(this); - } - - if (ret !== null) this.emit('data', ret); - - return ret; -}; - -function onEofChunk(stream, state) { - if (state.ended) return; - if (state.decoder) { - var chunk = state.decoder.end(); - if (chunk && chunk.length) { - state.buffer.push(chunk); - state.length += state.objectMode ? 1 : chunk.length; - } - } - state.ended = true; - - // emit 'readable' now to make sure it gets picked up. - emitReadable(stream); -} - -// Don't emit readable right away in sync mode, because this can trigger -// another read() call => stack overflow. This way, it might trigger -// a nextTick recursion warning, but that's not so bad. -function emitReadable(stream) { - var state = stream._readableState; - state.needReadable = false; - if (!state.emittedReadable) { - debug('emitReadable', state.flowing); - state.emittedReadable = true; - if (state.sync) pna.nextTick(emitReadable_, stream);else emitReadable_(stream); - } -} - -function emitReadable_(stream) { - debug('emit readable'); - stream.emit('readable'); - flow(stream); -} - -// at this point, the user has presumably seen the 'readable' event, -// and called read() to consume some data. that may have triggered -// in turn another _read(n) call, in which case reading = true if -// it's in progress. -// However, if we're not ended, or reading, and the length < hwm, -// then go ahead and try to read some more preemptively. -function maybeReadMore(stream, state) { - if (!state.readingMore) { - state.readingMore = true; - pna.nextTick(maybeReadMore_, stream, state); - } -} - -function maybeReadMore_(stream, state) { - var len = state.length; - while (!state.reading && !state.flowing && !state.ended && state.length < state.highWaterMark) { - debug('maybeReadMore read 0'); - stream.read(0); - if (len === state.length) - // didn't get any data, stop spinning. - break;else len = state.length; - } - state.readingMore = false; -} - -// abstract method. to be overridden in specific implementation classes. -// call cb(er, data) where data is <= n in length. -// for virtual (non-string, non-buffer) streams, "length" is somewhat -// arbitrary, and perhaps not very meaningful. -Readable.prototype._read = function (n) { - this.emit('error', new Error('_read() is not implemented')); -}; - -Readable.prototype.pipe = function (dest, pipeOpts) { - var src = this; - var state = this._readableState; - - switch (state.pipesCount) { - case 0: - state.pipes = dest; - break; - case 1: - state.pipes = [state.pipes, dest]; - break; - default: - state.pipes.push(dest); - break; - } - state.pipesCount += 1; - debug('pipe count=%d opts=%j', state.pipesCount, pipeOpts); - - var doEnd = (!pipeOpts || pipeOpts.end !== false) && dest !== process.stdout && dest !== process.stderr; - - var endFn = doEnd ? onend : unpipe; - if (state.endEmitted) pna.nextTick(endFn);else src.once('end', endFn); - - dest.on('unpipe', onunpipe); - function onunpipe(readable, unpipeInfo) { - debug('onunpipe'); - if (readable === src) { - if (unpipeInfo && unpipeInfo.hasUnpiped === false) { - unpipeInfo.hasUnpiped = true; - cleanup(); - } - } - } - - function onend() { - debug('onend'); - dest.end(); - } - - // when the dest drains, it reduces the awaitDrain counter - // on the source. This would be more elegant with a .once() - // handler in flow(), but adding and removing repeatedly is - // too slow. - var ondrain = pipeOnDrain(src); - dest.on('drain', ondrain); - - var cleanedUp = false; - function cleanup() { - debug('cleanup'); - // cleanup event handlers once the pipe is broken - dest.removeListener('close', onclose); - dest.removeListener('finish', onfinish); - dest.removeListener('drain', ondrain); - dest.removeListener('error', onerror); - dest.removeListener('unpipe', onunpipe); - src.removeListener('end', onend); - src.removeListener('end', unpipe); - src.removeListener('data', ondata); - - cleanedUp = true; - - // if the reader is waiting for a drain event from this - // specific writer, then it would cause it to never start - // flowing again. - // So, if this is awaiting a drain, then we just call it now. - // If we don't know, then assume that we are waiting for one. - if (state.awaitDrain && (!dest._writableState || dest._writableState.needDrain)) ondrain(); - } - - // If the user pushes more data while we're writing to dest then we'll end up - // in ondata again. However, we only want to increase awaitDrain once because - // dest will only emit one 'drain' event for the multiple writes. - // => Introduce a guard on increasing awaitDrain. - var increasedAwaitDrain = false; - src.on('data', ondata); - function ondata(chunk) { - debug('ondata'); - increasedAwaitDrain = false; - var ret = dest.write(chunk); - if (false === ret && !increasedAwaitDrain) { - // If the user unpiped during `dest.write()`, it is possible - // to get stuck in a permanently paused state if that write - // also returned false. - // => Check whether `dest` is still a piping destination. - if ((state.pipesCount === 1 && state.pipes === dest || state.pipesCount > 1 && indexOf(state.pipes, dest) !== -1) && !cleanedUp) { - debug('false write response, pause', src._readableState.awaitDrain); - src._readableState.awaitDrain++; - increasedAwaitDrain = true; - } - src.pause(); - } - } - - // if the dest has an error, then stop piping into it. - // however, don't suppress the throwing behavior for this. - function onerror(er) { - debug('onerror', er); - unpipe(); - dest.removeListener('error', onerror); - if (EElistenerCount(dest, 'error') === 0) dest.emit('error', er); - } - - // Make sure our error handler is attached before userland ones. - prependListener(dest, 'error', onerror); - - // Both close and finish should trigger unpipe, but only once. - function onclose() { - dest.removeListener('finish', onfinish); - unpipe(); - } - dest.once('close', onclose); - function onfinish() { - debug('onfinish'); - dest.removeListener('close', onclose); - unpipe(); - } - dest.once('finish', onfinish); - - function unpipe() { - debug('unpipe'); - src.unpipe(dest); - } - - // tell the dest that it's being piped to - dest.emit('pipe', src); - - // start the flow if it hasn't been started already. - if (!state.flowing) { - debug('pipe resume'); - src.resume(); - } - - return dest; -}; - -function pipeOnDrain(src) { - return function () { - var state = src._readableState; - debug('pipeOnDrain', state.awaitDrain); - if (state.awaitDrain) state.awaitDrain--; - if (state.awaitDrain === 0 && EElistenerCount(src, 'data')) { - state.flowing = true; - flow(src); - } - }; -} - -Readable.prototype.unpipe = function (dest) { - var state = this._readableState; - var unpipeInfo = { hasUnpiped: false }; - - // if we're not piping anywhere, then do nothing. - if (state.pipesCount === 0) return this; - - // just one destination. most common case. - if (state.pipesCount === 1) { - // passed in one, but it's not the right one. - if (dest && dest !== state.pipes) return this; - - if (!dest) dest = state.pipes; - - // got a match. - state.pipes = null; - state.pipesCount = 0; - state.flowing = false; - if (dest) dest.emit('unpipe', this, unpipeInfo); - return this; - } - - // slow case. multiple pipe destinations. - - if (!dest) { - // remove all. - var dests = state.pipes; - var len = state.pipesCount; - state.pipes = null; - state.pipesCount = 0; - state.flowing = false; - - for (var i = 0; i < len; i++) { - dests[i].emit('unpipe', this, unpipeInfo); - }return this; - } - - // try to find the right one. - var index = indexOf(state.pipes, dest); - if (index === -1) return this; - - state.pipes.splice(index, 1); - state.pipesCount -= 1; - if (state.pipesCount === 1) state.pipes = state.pipes[0]; - - dest.emit('unpipe', this, unpipeInfo); - - return this; -}; - -// set up data events if they are asked for -// Ensure readable listeners eventually get something -Readable.prototype.on = function (ev, fn) { - var res = Stream.prototype.on.call(this, ev, fn); - - if (ev === 'data') { - // Start flowing on next tick if stream isn't explicitly paused - if (this._readableState.flowing !== false) this.resume(); - } else if (ev === 'readable') { - var state = this._readableState; - if (!state.endEmitted && !state.readableListening) { - state.readableListening = state.needReadable = true; - state.emittedReadable = false; - if (!state.reading) { - pna.nextTick(nReadingNextTick, this); - } else if (state.length) { - emitReadable(this); - } - } - } - - return res; -}; -Readable.prototype.addListener = Readable.prototype.on; - -function nReadingNextTick(self) { - debug('readable nexttick read 0'); - self.read(0); -} - -// pause() and resume() are remnants of the legacy readable stream API -// If the user uses them, then switch into old mode. -Readable.prototype.resume = function () { - var state = this._readableState; - if (!state.flowing) { - debug('resume'); - state.flowing = true; - resume(this, state); - } - return this; -}; - -function resume(stream, state) { - if (!state.resumeScheduled) { - state.resumeScheduled = true; - pna.nextTick(resume_, stream, state); - } -} - -function resume_(stream, state) { - if (!state.reading) { - debug('resume read 0'); - stream.read(0); - } - - state.resumeScheduled = false; - state.awaitDrain = 0; - stream.emit('resume'); - flow(stream); - if (state.flowing && !state.reading) stream.read(0); -} - -Readable.prototype.pause = function () { - debug('call pause flowing=%j', this._readableState.flowing); - if (false !== this._readableState.flowing) { - debug('pause'); - this._readableState.flowing = false; - this.emit('pause'); - } - return this; -}; - -function flow(stream) { - var state = stream._readableState; - debug('flow', state.flowing); - while (state.flowing && stream.read() !== null) {} -} - -// wrap an old-style stream as the async data source. -// This is *not* part of the readable stream interface. -// It is an ugly unfortunate mess of history. -Readable.prototype.wrap = function (stream) { - var _this = this; - - var state = this._readableState; - var paused = false; - - stream.on('end', function () { - debug('wrapped end'); - if (state.decoder && !state.ended) { - var chunk = state.decoder.end(); - if (chunk && chunk.length) _this.push(chunk); - } - - _this.push(null); - }); - - stream.on('data', function (chunk) { - debug('wrapped data'); - if (state.decoder) chunk = state.decoder.write(chunk); - - // don't skip over falsy values in objectMode - if (state.objectMode && (chunk === null || chunk === undefined)) return;else if (!state.objectMode && (!chunk || !chunk.length)) return; - - var ret = _this.push(chunk); - if (!ret) { - paused = true; - stream.pause(); - } - }); - - // proxy all the other methods. - // important when wrapping filters and duplexes. - for (var i in stream) { - if (this[i] === undefined && typeof stream[i] === 'function') { - this[i] = function (method) { - return function () { - return stream[method].apply(stream, arguments); - }; - }(i); - } - } - - // proxy certain important events. - for (var n = 0; n < kProxyEvents.length; n++) { - stream.on(kProxyEvents[n], this.emit.bind(this, kProxyEvents[n])); - } - - // when we try to consume some more bytes, simply unpause the - // underlying stream. - this._read = function (n) { - debug('wrapped _read', n); - if (paused) { - paused = false; - stream.resume(); - } - }; - - return this; -}; - -Object.defineProperty(Readable.prototype, 'readableHighWaterMark', { - // making it explicit this property is not enumerable - // because otherwise some prototype manipulation in - // userland will fail - enumerable: false, - get: function () { - return this._readableState.highWaterMark; - } -}); - -// exposed for testing purposes only. -Readable._fromList = fromList; - -// Pluck off n bytes from an array of buffers. -// Length is the combined lengths of all the buffers in the list. -// This function is designed to be inlinable, so please take care when making -// changes to the function body. -function fromList(n, state) { - // nothing buffered - if (state.length === 0) return null; - - var ret; - if (state.objectMode) ret = state.buffer.shift();else if (!n || n >= state.length) { - // read it all, truncate the list - if (state.decoder) ret = state.buffer.join('');else if (state.buffer.length === 1) ret = state.buffer.head.data;else ret = state.buffer.concat(state.length); - state.buffer.clear(); - } else { - // read part of list - ret = fromListPartial(n, state.buffer, state.decoder); - } - - return ret; -} - -// Extracts only enough buffered data to satisfy the amount requested. -// This function is designed to be inlinable, so please take care when making -// changes to the function body. -function fromListPartial(n, list, hasStrings) { - var ret; - if (n < list.head.data.length) { - // slice is the same for buffers and strings - ret = list.head.data.slice(0, n); - list.head.data = list.head.data.slice(n); - } else if (n === list.head.data.length) { - // first chunk is a perfect match - ret = list.shift(); - } else { - // result spans more than one buffer - ret = hasStrings ? copyFromBufferString(n, list) : copyFromBuffer(n, list); - } - return ret; -} - -// Copies a specified amount of characters from the list of buffered data -// chunks. -// This function is designed to be inlinable, so please take care when making -// changes to the function body. -function copyFromBufferString(n, list) { - var p = list.head; - var c = 1; - var ret = p.data; - n -= ret.length; - while (p = p.next) { - var str = p.data; - var nb = n > str.length ? str.length : n; - if (nb === str.length) ret += str;else ret += str.slice(0, n); - n -= nb; - if (n === 0) { - if (nb === str.length) { - ++c; - if (p.next) list.head = p.next;else list.head = list.tail = null; - } else { - list.head = p; - p.data = str.slice(nb); - } - break; - } - ++c; - } - list.length -= c; - return ret; -} - -// Copies a specified amount of bytes from the list of buffered data chunks. -// This function is designed to be inlinable, so please take care when making -// changes to the function body. -function copyFromBuffer(n, list) { - var ret = Buffer.allocUnsafe(n); - var p = list.head; - var c = 1; - p.data.copy(ret); - n -= p.data.length; - while (p = p.next) { - var buf = p.data; - var nb = n > buf.length ? buf.length : n; - buf.copy(ret, ret.length - n, 0, nb); - n -= nb; - if (n === 0) { - if (nb === buf.length) { - ++c; - if (p.next) list.head = p.next;else list.head = list.tail = null; - } else { - list.head = p; - p.data = buf.slice(nb); - } - break; - } - ++c; - } - list.length -= c; - return ret; -} - -function endReadable(stream) { - var state = stream._readableState; - - // If we get here before consuming all the bytes, then that is a - // bug in node. Should never happen. - if (state.length > 0) throw new Error('"endReadable()" called on non-empty stream'); - - if (!state.endEmitted) { - state.ended = true; - pna.nextTick(endReadableNT, state, stream); - } -} - -function endReadableNT(state, stream) { - // Check that we didn't get one last unshift. - if (!state.endEmitted && state.length === 0) { - state.endEmitted = true; - stream.readable = false; - stream.emit('end'); - } -} - -function indexOf(xs, x) { - for (var i = 0, l = xs.length; i < l; i++) { - if (xs[i] === x) return i; - } - return -1; -} \ No newline at end of file diff --git a/deps/npm/node_modules/parallel-transform/node_modules/readable-stream/lib/_stream_transform.js b/deps/npm/node_modules/parallel-transform/node_modules/readable-stream/lib/_stream_transform.js deleted file mode 100644 index 5d1f8b876d98c7..00000000000000 --- a/deps/npm/node_modules/parallel-transform/node_modules/readable-stream/lib/_stream_transform.js +++ /dev/null @@ -1,214 +0,0 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - -// a transform stream is a readable/writable stream where you do -// something with the data. Sometimes it's called a "filter", -// but that's not a great name for it, since that implies a thing where -// some bits pass through, and others are simply ignored. (That would -// be a valid example of a transform, of course.) -// -// While the output is causally related to the input, it's not a -// necessarily symmetric or synchronous transformation. For example, -// a zlib stream might take multiple plain-text writes(), and then -// emit a single compressed chunk some time in the future. -// -// Here's how this works: -// -// The Transform stream has all the aspects of the readable and writable -// stream classes. When you write(chunk), that calls _write(chunk,cb) -// internally, and returns false if there's a lot of pending writes -// buffered up. When you call read(), that calls _read(n) until -// there's enough pending readable data buffered up. -// -// In a transform stream, the written data is placed in a buffer. When -// _read(n) is called, it transforms the queued up data, calling the -// buffered _write cb's as it consumes chunks. If consuming a single -// written chunk would result in multiple output chunks, then the first -// outputted bit calls the readcb, and subsequent chunks just go into -// the read buffer, and will cause it to emit 'readable' if necessary. -// -// This way, back-pressure is actually determined by the reading side, -// since _read has to be called to start processing a new chunk. However, -// a pathological inflate type of transform can cause excessive buffering -// here. For example, imagine a stream where every byte of input is -// interpreted as an integer from 0-255, and then results in that many -// bytes of output. Writing the 4 bytes {ff,ff,ff,ff} would result in -// 1kb of data being output. In this case, you could write a very small -// amount of input, and end up with a very large amount of output. In -// such a pathological inflating mechanism, there'd be no way to tell -// the system to stop doing the transform. A single 4MB write could -// cause the system to run out of memory. -// -// However, even in such a pathological case, only a single written chunk -// would be consumed, and then the rest would wait (un-transformed) until -// the results of the previous transformed chunk were consumed. - -'use strict'; - -module.exports = Transform; - -var Duplex = require('./_stream_duplex'); - -/**/ -var util = require('core-util-is'); -util.inherits = require('inherits'); -/**/ - -util.inherits(Transform, Duplex); - -function afterTransform(er, data) { - var ts = this._transformState; - ts.transforming = false; - - var cb = ts.writecb; - - if (!cb) { - return this.emit('error', new Error('write callback called multiple times')); - } - - ts.writechunk = null; - ts.writecb = null; - - if (data != null) // single equals check for both `null` and `undefined` - this.push(data); - - cb(er); - - var rs = this._readableState; - rs.reading = false; - if (rs.needReadable || rs.length < rs.highWaterMark) { - this._read(rs.highWaterMark); - } -} - -function Transform(options) { - if (!(this instanceof Transform)) return new Transform(options); - - Duplex.call(this, options); - - this._transformState = { - afterTransform: afterTransform.bind(this), - needTransform: false, - transforming: false, - writecb: null, - writechunk: null, - writeencoding: null - }; - - // start out asking for a readable event once data is transformed. - this._readableState.needReadable = true; - - // we have implemented the _read method, and done the other things - // that Readable wants before the first _read call, so unset the - // sync guard flag. - this._readableState.sync = false; - - if (options) { - if (typeof options.transform === 'function') this._transform = options.transform; - - if (typeof options.flush === 'function') this._flush = options.flush; - } - - // When the writable side finishes, then flush out anything remaining. - this.on('prefinish', prefinish); -} - -function prefinish() { - var _this = this; - - if (typeof this._flush === 'function') { - this._flush(function (er, data) { - done(_this, er, data); - }); - } else { - done(this, null, null); - } -} - -Transform.prototype.push = function (chunk, encoding) { - this._transformState.needTransform = false; - return Duplex.prototype.push.call(this, chunk, encoding); -}; - -// This is the part where you do stuff! -// override this function in implementation classes. -// 'chunk' is an input chunk. -// -// Call `push(newChunk)` to pass along transformed output -// to the readable side. You may call 'push' zero or more times. -// -// Call `cb(err)` when you are done with this chunk. If you pass -// an error, then that'll put the hurt on the whole operation. If you -// never call cb(), then you'll never get another chunk. -Transform.prototype._transform = function (chunk, encoding, cb) { - throw new Error('_transform() is not implemented'); -}; - -Transform.prototype._write = function (chunk, encoding, cb) { - var ts = this._transformState; - ts.writecb = cb; - ts.writechunk = chunk; - ts.writeencoding = encoding; - if (!ts.transforming) { - var rs = this._readableState; - if (ts.needTransform || rs.needReadable || rs.length < rs.highWaterMark) this._read(rs.highWaterMark); - } -}; - -// Doesn't matter what the args are here. -// _transform does all the work. -// That we got here means that the readable side wants more data. -Transform.prototype._read = function (n) { - var ts = this._transformState; - - if (ts.writechunk !== null && ts.writecb && !ts.transforming) { - ts.transforming = true; - this._transform(ts.writechunk, ts.writeencoding, ts.afterTransform); - } else { - // mark that we need a transform, so that any data that comes in - // will get processed, now that we've asked for it. - ts.needTransform = true; - } -}; - -Transform.prototype._destroy = function (err, cb) { - var _this2 = this; - - Duplex.prototype._destroy.call(this, err, function (err2) { - cb(err2); - _this2.emit('close'); - }); -}; - -function done(stream, er, data) { - if (er) return stream.emit('error', er); - - if (data != null) // single equals check for both `null` and `undefined` - stream.push(data); - - // if there's nothing in the write buffer, then that means - // that nothing more will ever be provided - if (stream._writableState.length) throw new Error('Calling transform done when ws.length != 0'); - - if (stream._transformState.transforming) throw new Error('Calling transform done when still transforming'); - - return stream.push(null); -} \ No newline at end of file diff --git a/deps/npm/node_modules/parallel-transform/node_modules/readable-stream/lib/_stream_writable.js b/deps/npm/node_modules/parallel-transform/node_modules/readable-stream/lib/_stream_writable.js deleted file mode 100644 index b3f4e85a2f6e35..00000000000000 --- a/deps/npm/node_modules/parallel-transform/node_modules/readable-stream/lib/_stream_writable.js +++ /dev/null @@ -1,687 +0,0 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - -// A bit simpler than readable streams. -// Implement an async ._write(chunk, encoding, cb), and it'll handle all -// the drain event emission and buffering. - -'use strict'; - -/**/ - -var pna = require('process-nextick-args'); -/**/ - -module.exports = Writable; - -/* */ -function WriteReq(chunk, encoding, cb) { - this.chunk = chunk; - this.encoding = encoding; - this.callback = cb; - this.next = null; -} - -// It seems a linked list but it is not -// there will be only 2 of these for each stream -function CorkedRequest(state) { - var _this = this; - - this.next = null; - this.entry = null; - this.finish = function () { - onCorkedFinish(_this, state); - }; -} -/* */ - -/**/ -var asyncWrite = !process.browser && ['v0.10', 'v0.9.'].indexOf(process.version.slice(0, 5)) > -1 ? setImmediate : pna.nextTick; -/**/ - -/**/ -var Duplex; -/**/ - -Writable.WritableState = WritableState; - -/**/ -var util = require('core-util-is'); -util.inherits = require('inherits'); -/**/ - -/**/ -var internalUtil = { - deprecate: require('util-deprecate') -}; -/**/ - -/**/ -var Stream = require('./internal/streams/stream'); -/**/ - -/**/ - -var Buffer = require('safe-buffer').Buffer; -var OurUint8Array = global.Uint8Array || function () {}; -function _uint8ArrayToBuffer(chunk) { - return Buffer.from(chunk); -} -function _isUint8Array(obj) { - return Buffer.isBuffer(obj) || obj instanceof OurUint8Array; -} - -/**/ - -var destroyImpl = require('./internal/streams/destroy'); - -util.inherits(Writable, Stream); - -function nop() {} - -function WritableState(options, stream) { - Duplex = Duplex || require('./_stream_duplex'); - - options = options || {}; - - // Duplex streams are both readable and writable, but share - // the same options object. - // However, some cases require setting options to different - // values for the readable and the writable sides of the duplex stream. - // These options can be provided separately as readableXXX and writableXXX. - var isDuplex = stream instanceof Duplex; - - // object stream flag to indicate whether or not this stream - // contains buffers or objects. - this.objectMode = !!options.objectMode; - - if (isDuplex) this.objectMode = this.objectMode || !!options.writableObjectMode; - - // the point at which write() starts returning false - // Note: 0 is a valid value, means that we always return false if - // the entire buffer is not flushed immediately on write() - var hwm = options.highWaterMark; - var writableHwm = options.writableHighWaterMark; - var defaultHwm = this.objectMode ? 16 : 16 * 1024; - - if (hwm || hwm === 0) this.highWaterMark = hwm;else if (isDuplex && (writableHwm || writableHwm === 0)) this.highWaterMark = writableHwm;else this.highWaterMark = defaultHwm; - - // cast to ints. - this.highWaterMark = Math.floor(this.highWaterMark); - - // if _final has been called - this.finalCalled = false; - - // drain event flag. - this.needDrain = false; - // at the start of calling end() - this.ending = false; - // when end() has been called, and returned - this.ended = false; - // when 'finish' is emitted - this.finished = false; - - // has it been destroyed - this.destroyed = false; - - // should we decode strings into buffers before passing to _write? - // this is here so that some node-core streams can optimize string - // handling at a lower level. - var noDecode = options.decodeStrings === false; - this.decodeStrings = !noDecode; - - // Crypto is kind of old and crusty. Historically, its default string - // encoding is 'binary' so we have to make this configurable. - // Everything else in the universe uses 'utf8', though. - this.defaultEncoding = options.defaultEncoding || 'utf8'; - - // not an actual buffer we keep track of, but a measurement - // of how much we're waiting to get pushed to some underlying - // socket or file. - this.length = 0; - - // a flag to see when we're in the middle of a write. - this.writing = false; - - // when true all writes will be buffered until .uncork() call - this.corked = 0; - - // a flag to be able to tell if the onwrite cb is called immediately, - // or on a later tick. We set this to true at first, because any - // actions that shouldn't happen until "later" should generally also - // not happen before the first write call. - this.sync = true; - - // a flag to know if we're processing previously buffered items, which - // may call the _write() callback in the same tick, so that we don't - // end up in an overlapped onwrite situation. - this.bufferProcessing = false; - - // the callback that's passed to _write(chunk,cb) - this.onwrite = function (er) { - onwrite(stream, er); - }; - - // the callback that the user supplies to write(chunk,encoding,cb) - this.writecb = null; - - // the amount that is being written when _write is called. - this.writelen = 0; - - this.bufferedRequest = null; - this.lastBufferedRequest = null; - - // number of pending user-supplied write callbacks - // this must be 0 before 'finish' can be emitted - this.pendingcb = 0; - - // emit prefinish if the only thing we're waiting for is _write cbs - // This is relevant for synchronous Transform streams - this.prefinished = false; - - // True if the error was already emitted and should not be thrown again - this.errorEmitted = false; - - // count buffered requests - this.bufferedRequestCount = 0; - - // allocate the first CorkedRequest, there is always - // one allocated and free to use, and we maintain at most two - this.corkedRequestsFree = new CorkedRequest(this); -} - -WritableState.prototype.getBuffer = function getBuffer() { - var current = this.bufferedRequest; - var out = []; - while (current) { - out.push(current); - current = current.next; - } - return out; -}; - -(function () { - try { - Object.defineProperty(WritableState.prototype, 'buffer', { - get: internalUtil.deprecate(function () { - return this.getBuffer(); - }, '_writableState.buffer is deprecated. Use _writableState.getBuffer ' + 'instead.', 'DEP0003') - }); - } catch (_) {} -})(); - -// Test _writableState for inheritance to account for Duplex streams, -// whose prototype chain only points to Readable. -var realHasInstance; -if (typeof Symbol === 'function' && Symbol.hasInstance && typeof Function.prototype[Symbol.hasInstance] === 'function') { - realHasInstance = Function.prototype[Symbol.hasInstance]; - Object.defineProperty(Writable, Symbol.hasInstance, { - value: function (object) { - if (realHasInstance.call(this, object)) return true; - if (this !== Writable) return false; - - return object && object._writableState instanceof WritableState; - } - }); -} else { - realHasInstance = function (object) { - return object instanceof this; - }; -} - -function Writable(options) { - Duplex = Duplex || require('./_stream_duplex'); - - // Writable ctor is applied to Duplexes, too. - // `realHasInstance` is necessary because using plain `instanceof` - // would return false, as no `_writableState` property is attached. - - // Trying to use the custom `instanceof` for Writable here will also break the - // Node.js LazyTransform implementation, which has a non-trivial getter for - // `_writableState` that would lead to infinite recursion. - if (!realHasInstance.call(Writable, this) && !(this instanceof Duplex)) { - return new Writable(options); - } - - this._writableState = new WritableState(options, this); - - // legacy. - this.writable = true; - - if (options) { - if (typeof options.write === 'function') this._write = options.write; - - if (typeof options.writev === 'function') this._writev = options.writev; - - if (typeof options.destroy === 'function') this._destroy = options.destroy; - - if (typeof options.final === 'function') this._final = options.final; - } - - Stream.call(this); -} - -// Otherwise people can pipe Writable streams, which is just wrong. -Writable.prototype.pipe = function () { - this.emit('error', new Error('Cannot pipe, not readable')); -}; - -function writeAfterEnd(stream, cb) { - var er = new Error('write after end'); - // TODO: defer error events consistently everywhere, not just the cb - stream.emit('error', er); - pna.nextTick(cb, er); -} - -// Checks that a user-supplied chunk is valid, especially for the particular -// mode the stream is in. Currently this means that `null` is never accepted -// and undefined/non-string values are only allowed in object mode. -function validChunk(stream, state, chunk, cb) { - var valid = true; - var er = false; - - if (chunk === null) { - er = new TypeError('May not write null values to stream'); - } else if (typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) { - er = new TypeError('Invalid non-string/buffer chunk'); - } - if (er) { - stream.emit('error', er); - pna.nextTick(cb, er); - valid = false; - } - return valid; -} - -Writable.prototype.write = function (chunk, encoding, cb) { - var state = this._writableState; - var ret = false; - var isBuf = !state.objectMode && _isUint8Array(chunk); - - if (isBuf && !Buffer.isBuffer(chunk)) { - chunk = _uint8ArrayToBuffer(chunk); - } - - if (typeof encoding === 'function') { - cb = encoding; - encoding = null; - } - - if (isBuf) encoding = 'buffer';else if (!encoding) encoding = state.defaultEncoding; - - if (typeof cb !== 'function') cb = nop; - - if (state.ended) writeAfterEnd(this, cb);else if (isBuf || validChunk(this, state, chunk, cb)) { - state.pendingcb++; - ret = writeOrBuffer(this, state, isBuf, chunk, encoding, cb); - } - - return ret; -}; - -Writable.prototype.cork = function () { - var state = this._writableState; - - state.corked++; -}; - -Writable.prototype.uncork = function () { - var state = this._writableState; - - if (state.corked) { - state.corked--; - - if (!state.writing && !state.corked && !state.finished && !state.bufferProcessing && state.bufferedRequest) clearBuffer(this, state); - } -}; - -Writable.prototype.setDefaultEncoding = function setDefaultEncoding(encoding) { - // node::ParseEncoding() requires lower case. - if (typeof encoding === 'string') encoding = encoding.toLowerCase(); - if (!(['hex', 'utf8', 'utf-8', 'ascii', 'binary', 'base64', 'ucs2', 'ucs-2', 'utf16le', 'utf-16le', 'raw'].indexOf((encoding + '').toLowerCase()) > -1)) throw new TypeError('Unknown encoding: ' + encoding); - this._writableState.defaultEncoding = encoding; - return this; -}; - -function decodeChunk(state, chunk, encoding) { - if (!state.objectMode && state.decodeStrings !== false && typeof chunk === 'string') { - chunk = Buffer.from(chunk, encoding); - } - return chunk; -} - -Object.defineProperty(Writable.prototype, 'writableHighWaterMark', { - // making it explicit this property is not enumerable - // because otherwise some prototype manipulation in - // userland will fail - enumerable: false, - get: function () { - return this._writableState.highWaterMark; - } -}); - -// if we're already writing something, then just put this -// in the queue, and wait our turn. Otherwise, call _write -// If we return false, then we need a drain event, so set that flag. -function writeOrBuffer(stream, state, isBuf, chunk, encoding, cb) { - if (!isBuf) { - var newChunk = decodeChunk(state, chunk, encoding); - if (chunk !== newChunk) { - isBuf = true; - encoding = 'buffer'; - chunk = newChunk; - } - } - var len = state.objectMode ? 1 : chunk.length; - - state.length += len; - - var ret = state.length < state.highWaterMark; - // we must ensure that previous needDrain will not be reset to false. - if (!ret) state.needDrain = true; - - if (state.writing || state.corked) { - var last = state.lastBufferedRequest; - state.lastBufferedRequest = { - chunk: chunk, - encoding: encoding, - isBuf: isBuf, - callback: cb, - next: null - }; - if (last) { - last.next = state.lastBufferedRequest; - } else { - state.bufferedRequest = state.lastBufferedRequest; - } - state.bufferedRequestCount += 1; - } else { - doWrite(stream, state, false, len, chunk, encoding, cb); - } - - return ret; -} - -function doWrite(stream, state, writev, len, chunk, encoding, cb) { - state.writelen = len; - state.writecb = cb; - state.writing = true; - state.sync = true; - if (writev) stream._writev(chunk, state.onwrite);else stream._write(chunk, encoding, state.onwrite); - state.sync = false; -} - -function onwriteError(stream, state, sync, er, cb) { - --state.pendingcb; - - if (sync) { - // defer the callback if we are being called synchronously - // to avoid piling up things on the stack - pna.nextTick(cb, er); - // this can emit finish, and it will always happen - // after error - pna.nextTick(finishMaybe, stream, state); - stream._writableState.errorEmitted = true; - stream.emit('error', er); - } else { - // the caller expect this to happen before if - // it is async - cb(er); - stream._writableState.errorEmitted = true; - stream.emit('error', er); - // this can emit finish, but finish must - // always follow error - finishMaybe(stream, state); - } -} - -function onwriteStateUpdate(state) { - state.writing = false; - state.writecb = null; - state.length -= state.writelen; - state.writelen = 0; -} - -function onwrite(stream, er) { - var state = stream._writableState; - var sync = state.sync; - var cb = state.writecb; - - onwriteStateUpdate(state); - - if (er) onwriteError(stream, state, sync, er, cb);else { - // Check if we're actually ready to finish, but don't emit yet - var finished = needFinish(state); - - if (!finished && !state.corked && !state.bufferProcessing && state.bufferedRequest) { - clearBuffer(stream, state); - } - - if (sync) { - /**/ - asyncWrite(afterWrite, stream, state, finished, cb); - /**/ - } else { - afterWrite(stream, state, finished, cb); - } - } -} - -function afterWrite(stream, state, finished, cb) { - if (!finished) onwriteDrain(stream, state); - state.pendingcb--; - cb(); - finishMaybe(stream, state); -} - -// Must force callback to be called on nextTick, so that we don't -// emit 'drain' before the write() consumer gets the 'false' return -// value, and has a chance to attach a 'drain' listener. -function onwriteDrain(stream, state) { - if (state.length === 0 && state.needDrain) { - state.needDrain = false; - stream.emit('drain'); - } -} - -// if there's something in the buffer waiting, then process it -function clearBuffer(stream, state) { - state.bufferProcessing = true; - var entry = state.bufferedRequest; - - if (stream._writev && entry && entry.next) { - // Fast case, write everything using _writev() - var l = state.bufferedRequestCount; - var buffer = new Array(l); - var holder = state.corkedRequestsFree; - holder.entry = entry; - - var count = 0; - var allBuffers = true; - while (entry) { - buffer[count] = entry; - if (!entry.isBuf) allBuffers = false; - entry = entry.next; - count += 1; - } - buffer.allBuffers = allBuffers; - - doWrite(stream, state, true, state.length, buffer, '', holder.finish); - - // doWrite is almost always async, defer these to save a bit of time - // as the hot path ends with doWrite - state.pendingcb++; - state.lastBufferedRequest = null; - if (holder.next) { - state.corkedRequestsFree = holder.next; - holder.next = null; - } else { - state.corkedRequestsFree = new CorkedRequest(state); - } - state.bufferedRequestCount = 0; - } else { - // Slow case, write chunks one-by-one - while (entry) { - var chunk = entry.chunk; - var encoding = entry.encoding; - var cb = entry.callback; - var len = state.objectMode ? 1 : chunk.length; - - doWrite(stream, state, false, len, chunk, encoding, cb); - entry = entry.next; - state.bufferedRequestCount--; - // if we didn't call the onwrite immediately, then - // it means that we need to wait until it does. - // also, that means that the chunk and cb are currently - // being processed, so move the buffer counter past them. - if (state.writing) { - break; - } - } - - if (entry === null) state.lastBufferedRequest = null; - } - - state.bufferedRequest = entry; - state.bufferProcessing = false; -} - -Writable.prototype._write = function (chunk, encoding, cb) { - cb(new Error('_write() is not implemented')); -}; - -Writable.prototype._writev = null; - -Writable.prototype.end = function (chunk, encoding, cb) { - var state = this._writableState; - - if (typeof chunk === 'function') { - cb = chunk; - chunk = null; - encoding = null; - } else if (typeof encoding === 'function') { - cb = encoding; - encoding = null; - } - - if (chunk !== null && chunk !== undefined) this.write(chunk, encoding); - - // .end() fully uncorks - if (state.corked) { - state.corked = 1; - this.uncork(); - } - - // ignore unnecessary end() calls. - if (!state.ending && !state.finished) endWritable(this, state, cb); -}; - -function needFinish(state) { - return state.ending && state.length === 0 && state.bufferedRequest === null && !state.finished && !state.writing; -} -function callFinal(stream, state) { - stream._final(function (err) { - state.pendingcb--; - if (err) { - stream.emit('error', err); - } - state.prefinished = true; - stream.emit('prefinish'); - finishMaybe(stream, state); - }); -} -function prefinish(stream, state) { - if (!state.prefinished && !state.finalCalled) { - if (typeof stream._final === 'function') { - state.pendingcb++; - state.finalCalled = true; - pna.nextTick(callFinal, stream, state); - } else { - state.prefinished = true; - stream.emit('prefinish'); - } - } -} - -function finishMaybe(stream, state) { - var need = needFinish(state); - if (need) { - prefinish(stream, state); - if (state.pendingcb === 0) { - state.finished = true; - stream.emit('finish'); - } - } - return need; -} - -function endWritable(stream, state, cb) { - state.ending = true; - finishMaybe(stream, state); - if (cb) { - if (state.finished) pna.nextTick(cb);else stream.once('finish', cb); - } - state.ended = true; - stream.writable = false; -} - -function onCorkedFinish(corkReq, state, err) { - var entry = corkReq.entry; - corkReq.entry = null; - while (entry) { - var cb = entry.callback; - state.pendingcb--; - cb(err); - entry = entry.next; - } - if (state.corkedRequestsFree) { - state.corkedRequestsFree.next = corkReq; - } else { - state.corkedRequestsFree = corkReq; - } -} - -Object.defineProperty(Writable.prototype, 'destroyed', { - get: function () { - if (this._writableState === undefined) { - return false; - } - return this._writableState.destroyed; - }, - set: function (value) { - // we ignore the value if the stream - // has not been initialized yet - if (!this._writableState) { - return; - } - - // backward compatibility, the user is explicitly - // managing destroyed - this._writableState.destroyed = value; - } -}); - -Writable.prototype.destroy = destroyImpl.destroy; -Writable.prototype._undestroy = destroyImpl.undestroy; -Writable.prototype._destroy = function (err, cb) { - this.end(); - cb(err); -}; \ No newline at end of file diff --git a/deps/npm/node_modules/parallel-transform/node_modules/readable-stream/lib/internal/streams/BufferList.js b/deps/npm/node_modules/parallel-transform/node_modules/readable-stream/lib/internal/streams/BufferList.js deleted file mode 100644 index aefc68bd90b9c2..00000000000000 --- a/deps/npm/node_modules/parallel-transform/node_modules/readable-stream/lib/internal/streams/BufferList.js +++ /dev/null @@ -1,79 +0,0 @@ -'use strict'; - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -var Buffer = require('safe-buffer').Buffer; -var util = require('util'); - -function copyBuffer(src, target, offset) { - src.copy(target, offset); -} - -module.exports = function () { - function BufferList() { - _classCallCheck(this, BufferList); - - this.head = null; - this.tail = null; - this.length = 0; - } - - BufferList.prototype.push = function push(v) { - var entry = { data: v, next: null }; - if (this.length > 0) this.tail.next = entry;else this.head = entry; - this.tail = entry; - ++this.length; - }; - - BufferList.prototype.unshift = function unshift(v) { - var entry = { data: v, next: this.head }; - if (this.length === 0) this.tail = entry; - this.head = entry; - ++this.length; - }; - - BufferList.prototype.shift = function shift() { - if (this.length === 0) return; - var ret = this.head.data; - if (this.length === 1) this.head = this.tail = null;else this.head = this.head.next; - --this.length; - return ret; - }; - - BufferList.prototype.clear = function clear() { - this.head = this.tail = null; - this.length = 0; - }; - - BufferList.prototype.join = function join(s) { - if (this.length === 0) return ''; - var p = this.head; - var ret = '' + p.data; - while (p = p.next) { - ret += s + p.data; - }return ret; - }; - - BufferList.prototype.concat = function concat(n) { - if (this.length === 0) return Buffer.alloc(0); - if (this.length === 1) return this.head.data; - var ret = Buffer.allocUnsafe(n >>> 0); - var p = this.head; - var i = 0; - while (p) { - copyBuffer(p.data, ret, i); - i += p.data.length; - p = p.next; - } - return ret; - }; - - return BufferList; -}(); - -if (util && util.inspect && util.inspect.custom) { - module.exports.prototype[util.inspect.custom] = function () { - var obj = util.inspect({ length: this.length }); - return this.constructor.name + ' ' + obj; - }; -} \ No newline at end of file diff --git a/deps/npm/node_modules/parallel-transform/node_modules/readable-stream/lib/internal/streams/destroy.js b/deps/npm/node_modules/parallel-transform/node_modules/readable-stream/lib/internal/streams/destroy.js deleted file mode 100644 index 5a0a0d88cec6f3..00000000000000 --- a/deps/npm/node_modules/parallel-transform/node_modules/readable-stream/lib/internal/streams/destroy.js +++ /dev/null @@ -1,74 +0,0 @@ -'use strict'; - -/**/ - -var pna = require('process-nextick-args'); -/**/ - -// undocumented cb() API, needed for core, not for public API -function destroy(err, cb) { - var _this = this; - - var readableDestroyed = this._readableState && this._readableState.destroyed; - var writableDestroyed = this._writableState && this._writableState.destroyed; - - if (readableDestroyed || writableDestroyed) { - if (cb) { - cb(err); - } else if (err && (!this._writableState || !this._writableState.errorEmitted)) { - pna.nextTick(emitErrorNT, this, err); - } - return this; - } - - // we set destroyed to true before firing error callbacks in order - // to make it re-entrance safe in case destroy() is called within callbacks - - if (this._readableState) { - this._readableState.destroyed = true; - } - - // if this is a duplex stream mark the writable part as destroyed as well - if (this._writableState) { - this._writableState.destroyed = true; - } - - this._destroy(err || null, function (err) { - if (!cb && err) { - pna.nextTick(emitErrorNT, _this, err); - if (_this._writableState) { - _this._writableState.errorEmitted = true; - } - } else if (cb) { - cb(err); - } - }); - - return this; -} - -function undestroy() { - if (this._readableState) { - this._readableState.destroyed = false; - this._readableState.reading = false; - this._readableState.ended = false; - this._readableState.endEmitted = false; - } - - if (this._writableState) { - this._writableState.destroyed = false; - this._writableState.ended = false; - this._writableState.ending = false; - this._writableState.finished = false; - this._writableState.errorEmitted = false; - } -} - -function emitErrorNT(self, err) { - self.emit('error', err); -} - -module.exports = { - destroy: destroy, - undestroy: undestroy -}; \ No newline at end of file diff --git a/deps/npm/node_modules/parallel-transform/node_modules/readable-stream/lib/internal/streams/stream-browser.js b/deps/npm/node_modules/parallel-transform/node_modules/readable-stream/lib/internal/streams/stream-browser.js deleted file mode 100644 index 9332a3fdae7060..00000000000000 --- a/deps/npm/node_modules/parallel-transform/node_modules/readable-stream/lib/internal/streams/stream-browser.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('events').EventEmitter; diff --git a/deps/npm/node_modules/parallel-transform/node_modules/readable-stream/lib/internal/streams/stream.js b/deps/npm/node_modules/parallel-transform/node_modules/readable-stream/lib/internal/streams/stream.js deleted file mode 100644 index ce2ad5b6ee57f4..00000000000000 --- a/deps/npm/node_modules/parallel-transform/node_modules/readable-stream/lib/internal/streams/stream.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('stream'); diff --git a/deps/npm/node_modules/parallel-transform/node_modules/readable-stream/package.json b/deps/npm/node_modules/parallel-transform/node_modules/readable-stream/package.json deleted file mode 100644 index 5429283d787ee6..00000000000000 --- a/deps/npm/node_modules/parallel-transform/node_modules/readable-stream/package.json +++ /dev/null @@ -1,81 +0,0 @@ -{ - "_from": "readable-stream@^2.1.5", - "_id": "readable-stream@2.3.6", - "_inBundle": false, - "_integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", - "_location": "/parallel-transform/readable-stream", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "readable-stream@^2.1.5", - "name": "readable-stream", - "escapedName": "readable-stream", - "rawSpec": "^2.1.5", - "saveSpec": null, - "fetchSpec": "^2.1.5" - }, - "_requiredBy": [ - "/parallel-transform" - ], - "_resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", - "_shasum": "b11c27d88b8ff1fbe070643cf94b0c79ae1b0aaf", - "_spec": "readable-stream@^2.1.5", - "_where": "/Users/aeschright/code/cli/node_modules/parallel-transform", - "browser": { - "util": false, - "./readable.js": "./readable-browser.js", - "./writable.js": "./writable-browser.js", - "./duplex.js": "./duplex-browser.js", - "./lib/internal/streams/stream.js": "./lib/internal/streams/stream-browser.js" - }, - "bugs": { - "url": "https://github.com/nodejs/readable-stream/issues" - }, - "bundleDependencies": false, - "dependencies": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - }, - "deprecated": false, - "description": "Streams3, a user-land copy of the stream library from Node.js", - "devDependencies": { - "assert": "^1.4.0", - "babel-polyfill": "^6.9.1", - "buffer": "^4.9.0", - "lolex": "^2.3.2", - "nyc": "^6.4.0", - "tap": "^0.7.0", - "tape": "^4.8.0" - }, - "homepage": "https://github.com/nodejs/readable-stream#readme", - "keywords": [ - "readable", - "stream", - "pipe" - ], - "license": "MIT", - "main": "readable.js", - "name": "readable-stream", - "nyc": { - "include": [ - "lib/**.js" - ] - }, - "repository": { - "type": "git", - "url": "git://github.com/nodejs/readable-stream.git" - }, - "scripts": { - "ci": "tap test/parallel/*.js test/ours/*.js --tap | tee test.tap && node test/verify-dependencies.js", - "cover": "nyc npm test", - "report": "nyc report --reporter=lcov", - "test": "tap test/parallel/*.js test/ours/*.js && node test/verify-dependencies.js" - }, - "version": "2.3.6" -} diff --git a/deps/npm/node_modules/parallel-transform/node_modules/readable-stream/passthrough.js b/deps/npm/node_modules/parallel-transform/node_modules/readable-stream/passthrough.js deleted file mode 100644 index ffd791d7ff275a..00000000000000 --- a/deps/npm/node_modules/parallel-transform/node_modules/readable-stream/passthrough.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./readable').PassThrough diff --git a/deps/npm/node_modules/parallel-transform/node_modules/readable-stream/readable-browser.js b/deps/npm/node_modules/parallel-transform/node_modules/readable-stream/readable-browser.js deleted file mode 100644 index e50372592ee6c6..00000000000000 --- a/deps/npm/node_modules/parallel-transform/node_modules/readable-stream/readable-browser.js +++ /dev/null @@ -1,7 +0,0 @@ -exports = module.exports = require('./lib/_stream_readable.js'); -exports.Stream = exports; -exports.Readable = exports; -exports.Writable = require('./lib/_stream_writable.js'); -exports.Duplex = require('./lib/_stream_duplex.js'); -exports.Transform = require('./lib/_stream_transform.js'); -exports.PassThrough = require('./lib/_stream_passthrough.js'); diff --git a/deps/npm/node_modules/parallel-transform/node_modules/readable-stream/readable.js b/deps/npm/node_modules/parallel-transform/node_modules/readable-stream/readable.js deleted file mode 100644 index ec89ec53306497..00000000000000 --- a/deps/npm/node_modules/parallel-transform/node_modules/readable-stream/readable.js +++ /dev/null @@ -1,19 +0,0 @@ -var Stream = require('stream'); -if (process.env.READABLE_STREAM === 'disable' && Stream) { - module.exports = Stream; - exports = module.exports = Stream.Readable; - exports.Readable = Stream.Readable; - exports.Writable = Stream.Writable; - exports.Duplex = Stream.Duplex; - exports.Transform = Stream.Transform; - exports.PassThrough = Stream.PassThrough; - exports.Stream = Stream; -} else { - exports = module.exports = require('./lib/_stream_readable.js'); - exports.Stream = Stream || exports; - exports.Readable = exports; - exports.Writable = require('./lib/_stream_writable.js'); - exports.Duplex = require('./lib/_stream_duplex.js'); - exports.Transform = require('./lib/_stream_transform.js'); - exports.PassThrough = require('./lib/_stream_passthrough.js'); -} diff --git a/deps/npm/node_modules/parallel-transform/node_modules/readable-stream/transform.js b/deps/npm/node_modules/parallel-transform/node_modules/readable-stream/transform.js deleted file mode 100644 index b1baba26da03dc..00000000000000 --- a/deps/npm/node_modules/parallel-transform/node_modules/readable-stream/transform.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./readable').Transform diff --git a/deps/npm/node_modules/parallel-transform/node_modules/readable-stream/writable-browser.js b/deps/npm/node_modules/parallel-transform/node_modules/readable-stream/writable-browser.js deleted file mode 100644 index ebdde6a85dcb19..00000000000000 --- a/deps/npm/node_modules/parallel-transform/node_modules/readable-stream/writable-browser.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./lib/_stream_writable.js'); diff --git a/deps/npm/node_modules/parallel-transform/node_modules/readable-stream/writable.js b/deps/npm/node_modules/parallel-transform/node_modules/readable-stream/writable.js deleted file mode 100644 index 3211a6f80d1abc..00000000000000 --- a/deps/npm/node_modules/parallel-transform/node_modules/readable-stream/writable.js +++ /dev/null @@ -1,8 +0,0 @@ -var Stream = require("stream") -var Writable = require("./lib/_stream_writable.js") - -if (process.env.READABLE_STREAM === 'disable') { - module.exports = Stream && Stream.Writable || Writable -} else { - module.exports = Writable -} diff --git a/deps/npm/node_modules/parallel-transform/node_modules/string_decoder/.travis.yml b/deps/npm/node_modules/parallel-transform/node_modules/string_decoder/.travis.yml deleted file mode 100644 index 3347a725465058..00000000000000 --- a/deps/npm/node_modules/parallel-transform/node_modules/string_decoder/.travis.yml +++ /dev/null @@ -1,50 +0,0 @@ -sudo: false -language: node_js -before_install: - - npm install -g npm@2 - - test $NPM_LEGACY && npm install -g npm@latest-3 || npm install npm -g -notifications: - email: false -matrix: - fast_finish: true - include: - - node_js: '0.8' - env: - - TASK=test - - NPM_LEGACY=true - - node_js: '0.10' - env: - - TASK=test - - NPM_LEGACY=true - - node_js: '0.11' - env: - - TASK=test - - NPM_LEGACY=true - - node_js: '0.12' - env: - - TASK=test - - NPM_LEGACY=true - - node_js: 1 - env: - - TASK=test - - NPM_LEGACY=true - - node_js: 2 - env: - - TASK=test - - NPM_LEGACY=true - - node_js: 3 - env: - - TASK=test - - NPM_LEGACY=true - - node_js: 4 - env: TASK=test - - node_js: 5 - env: TASK=test - - node_js: 6 - env: TASK=test - - node_js: 7 - env: TASK=test - - node_js: 8 - env: TASK=test - - node_js: 9 - env: TASK=test diff --git a/deps/npm/node_modules/parallel-transform/node_modules/string_decoder/LICENSE b/deps/npm/node_modules/parallel-transform/node_modules/string_decoder/LICENSE deleted file mode 100644 index 778edb20730ef4..00000000000000 --- a/deps/npm/node_modules/parallel-transform/node_modules/string_decoder/LICENSE +++ /dev/null @@ -1,48 +0,0 @@ -Node.js is licensed for use as follows: - -""" -Copyright Node.js contributors. All rights reserved. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to -deal in the Software without restriction, including without limitation the -rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -sell copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -IN THE SOFTWARE. -""" - -This license applies to parts of Node.js originating from the -https://github.com/joyent/node repository: - -""" -Copyright Joyent, Inc. and other Node contributors. All rights reserved. -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to -deal in the Software without restriction, including without limitation the -rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -sell copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -IN THE SOFTWARE. -""" - diff --git a/deps/npm/node_modules/parallel-transform/node_modules/string_decoder/README.md b/deps/npm/node_modules/parallel-transform/node_modules/string_decoder/README.md deleted file mode 100644 index 5fd58315ed5880..00000000000000 --- a/deps/npm/node_modules/parallel-transform/node_modules/string_decoder/README.md +++ /dev/null @@ -1,47 +0,0 @@ -# string_decoder - -***Node-core v8.9.4 string_decoder for userland*** - - -[![NPM](https://nodei.co/npm/string_decoder.png?downloads=true&downloadRank=true)](https://nodei.co/npm/string_decoder/) -[![NPM](https://nodei.co/npm-dl/string_decoder.png?&months=6&height=3)](https://nodei.co/npm/string_decoder/) - - -```bash -npm install --save string_decoder -``` - -***Node-core string_decoder for userland*** - -This package is a mirror of the string_decoder implementation in Node-core. - -Full documentation may be found on the [Node.js website](https://nodejs.org/dist/v8.9.4/docs/api/). - -As of version 1.0.0 **string_decoder** uses semantic versioning. - -## Previous versions - -Previous version numbers match the versions found in Node core, e.g. 0.10.24 matches Node 0.10.24, likewise 0.11.10 matches Node 0.11.10. - -## Update - -The *build/* directory contains a build script that will scrape the source from the [nodejs/node](https://github.com/nodejs/node) repo given a specific Node version. - -## Streams Working Group - -`string_decoder` is maintained by the Streams Working Group, which -oversees the development and maintenance of the Streams API within -Node.js. The responsibilities of the Streams Working Group include: - -* Addressing stream issues on the Node.js issue tracker. -* Authoring and editing stream documentation within the Node.js project. -* Reviewing changes to stream subclasses within the Node.js project. -* Redirecting changes to streams from the Node.js project to this - project. -* Assisting in the implementation of stream providers within Node.js. -* Recommending versions of `readable-stream` to be included in Node.js. -* Messaging about the future of streams to give the community advance - notice of changes. - -See [readable-stream](https://github.com/nodejs/readable-stream) for -more details. diff --git a/deps/npm/node_modules/parallel-transform/node_modules/string_decoder/lib/string_decoder.js b/deps/npm/node_modules/parallel-transform/node_modules/string_decoder/lib/string_decoder.js deleted file mode 100644 index 2e89e63f7933e4..00000000000000 --- a/deps/npm/node_modules/parallel-transform/node_modules/string_decoder/lib/string_decoder.js +++ /dev/null @@ -1,296 +0,0 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - -'use strict'; - -/**/ - -var Buffer = require('safe-buffer').Buffer; -/**/ - -var isEncoding = Buffer.isEncoding || function (encoding) { - encoding = '' + encoding; - switch (encoding && encoding.toLowerCase()) { - case 'hex':case 'utf8':case 'utf-8':case 'ascii':case 'binary':case 'base64':case 'ucs2':case 'ucs-2':case 'utf16le':case 'utf-16le':case 'raw': - return true; - default: - return false; - } -}; - -function _normalizeEncoding(enc) { - if (!enc) return 'utf8'; - var retried; - while (true) { - switch (enc) { - case 'utf8': - case 'utf-8': - return 'utf8'; - case 'ucs2': - case 'ucs-2': - case 'utf16le': - case 'utf-16le': - return 'utf16le'; - case 'latin1': - case 'binary': - return 'latin1'; - case 'base64': - case 'ascii': - case 'hex': - return enc; - default: - if (retried) return; // undefined - enc = ('' + enc).toLowerCase(); - retried = true; - } - } -}; - -// Do not cache `Buffer.isEncoding` when checking encoding names as some -// modules monkey-patch it to support additional encodings -function normalizeEncoding(enc) { - var nenc = _normalizeEncoding(enc); - if (typeof nenc !== 'string' && (Buffer.isEncoding === isEncoding || !isEncoding(enc))) throw new Error('Unknown encoding: ' + enc); - return nenc || enc; -} - -// StringDecoder provides an interface for efficiently splitting a series of -// buffers into a series of JS strings without breaking apart multi-byte -// characters. -exports.StringDecoder = StringDecoder; -function StringDecoder(encoding) { - this.encoding = normalizeEncoding(encoding); - var nb; - switch (this.encoding) { - case 'utf16le': - this.text = utf16Text; - this.end = utf16End; - nb = 4; - break; - case 'utf8': - this.fillLast = utf8FillLast; - nb = 4; - break; - case 'base64': - this.text = base64Text; - this.end = base64End; - nb = 3; - break; - default: - this.write = simpleWrite; - this.end = simpleEnd; - return; - } - this.lastNeed = 0; - this.lastTotal = 0; - this.lastChar = Buffer.allocUnsafe(nb); -} - -StringDecoder.prototype.write = function (buf) { - if (buf.length === 0) return ''; - var r; - var i; - if (this.lastNeed) { - r = this.fillLast(buf); - if (r === undefined) return ''; - i = this.lastNeed; - this.lastNeed = 0; - } else { - i = 0; - } - if (i < buf.length) return r ? r + this.text(buf, i) : this.text(buf, i); - return r || ''; -}; - -StringDecoder.prototype.end = utf8End; - -// Returns only complete characters in a Buffer -StringDecoder.prototype.text = utf8Text; - -// Attempts to complete a partial non-UTF-8 character using bytes from a Buffer -StringDecoder.prototype.fillLast = function (buf) { - if (this.lastNeed <= buf.length) { - buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, this.lastNeed); - return this.lastChar.toString(this.encoding, 0, this.lastTotal); - } - buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, buf.length); - this.lastNeed -= buf.length; -}; - -// Checks the type of a UTF-8 byte, whether it's ASCII, a leading byte, or a -// continuation byte. If an invalid byte is detected, -2 is returned. -function utf8CheckByte(byte) { - if (byte <= 0x7F) return 0;else if (byte >> 5 === 0x06) return 2;else if (byte >> 4 === 0x0E) return 3;else if (byte >> 3 === 0x1E) return 4; - return byte >> 6 === 0x02 ? -1 : -2; -} - -// Checks at most 3 bytes at the end of a Buffer in order to detect an -// incomplete multi-byte UTF-8 character. The total number of bytes (2, 3, or 4) -// needed to complete the UTF-8 character (if applicable) are returned. -function utf8CheckIncomplete(self, buf, i) { - var j = buf.length - 1; - if (j < i) return 0; - var nb = utf8CheckByte(buf[j]); - if (nb >= 0) { - if (nb > 0) self.lastNeed = nb - 1; - return nb; - } - if (--j < i || nb === -2) return 0; - nb = utf8CheckByte(buf[j]); - if (nb >= 0) { - if (nb > 0) self.lastNeed = nb - 2; - return nb; - } - if (--j < i || nb === -2) return 0; - nb = utf8CheckByte(buf[j]); - if (nb >= 0) { - if (nb > 0) { - if (nb === 2) nb = 0;else self.lastNeed = nb - 3; - } - return nb; - } - return 0; -} - -// Validates as many continuation bytes for a multi-byte UTF-8 character as -// needed or are available. If we see a non-continuation byte where we expect -// one, we "replace" the validated continuation bytes we've seen so far with -// a single UTF-8 replacement character ('\ufffd'), to match v8's UTF-8 decoding -// behavior. The continuation byte check is included three times in the case -// where all of the continuation bytes for a character exist in the same buffer. -// It is also done this way as a slight performance increase instead of using a -// loop. -function utf8CheckExtraBytes(self, buf, p) { - if ((buf[0] & 0xC0) !== 0x80) { - self.lastNeed = 0; - return '\ufffd'; - } - if (self.lastNeed > 1 && buf.length > 1) { - if ((buf[1] & 0xC0) !== 0x80) { - self.lastNeed = 1; - return '\ufffd'; - } - if (self.lastNeed > 2 && buf.length > 2) { - if ((buf[2] & 0xC0) !== 0x80) { - self.lastNeed = 2; - return '\ufffd'; - } - } - } -} - -// Attempts to complete a multi-byte UTF-8 character using bytes from a Buffer. -function utf8FillLast(buf) { - var p = this.lastTotal - this.lastNeed; - var r = utf8CheckExtraBytes(this, buf, p); - if (r !== undefined) return r; - if (this.lastNeed <= buf.length) { - buf.copy(this.lastChar, p, 0, this.lastNeed); - return this.lastChar.toString(this.encoding, 0, this.lastTotal); - } - buf.copy(this.lastChar, p, 0, buf.length); - this.lastNeed -= buf.length; -} - -// Returns all complete UTF-8 characters in a Buffer. If the Buffer ended on a -// partial character, the character's bytes are buffered until the required -// number of bytes are available. -function utf8Text(buf, i) { - var total = utf8CheckIncomplete(this, buf, i); - if (!this.lastNeed) return buf.toString('utf8', i); - this.lastTotal = total; - var end = buf.length - (total - this.lastNeed); - buf.copy(this.lastChar, 0, end); - return buf.toString('utf8', i, end); -} - -// For UTF-8, a replacement character is added when ending on a partial -// character. -function utf8End(buf) { - var r = buf && buf.length ? this.write(buf) : ''; - if (this.lastNeed) return r + '\ufffd'; - return r; -} - -// UTF-16LE typically needs two bytes per character, but even if we have an even -// number of bytes available, we need to check if we end on a leading/high -// surrogate. In that case, we need to wait for the next two bytes in order to -// decode the last character properly. -function utf16Text(buf, i) { - if ((buf.length - i) % 2 === 0) { - var r = buf.toString('utf16le', i); - if (r) { - var c = r.charCodeAt(r.length - 1); - if (c >= 0xD800 && c <= 0xDBFF) { - this.lastNeed = 2; - this.lastTotal = 4; - this.lastChar[0] = buf[buf.length - 2]; - this.lastChar[1] = buf[buf.length - 1]; - return r.slice(0, -1); - } - } - return r; - } - this.lastNeed = 1; - this.lastTotal = 2; - this.lastChar[0] = buf[buf.length - 1]; - return buf.toString('utf16le', i, buf.length - 1); -} - -// For UTF-16LE we do not explicitly append special replacement characters if we -// end on a partial character, we simply let v8 handle that. -function utf16End(buf) { - var r = buf && buf.length ? this.write(buf) : ''; - if (this.lastNeed) { - var end = this.lastTotal - this.lastNeed; - return r + this.lastChar.toString('utf16le', 0, end); - } - return r; -} - -function base64Text(buf, i) { - var n = (buf.length - i) % 3; - if (n === 0) return buf.toString('base64', i); - this.lastNeed = 3 - n; - this.lastTotal = 3; - if (n === 1) { - this.lastChar[0] = buf[buf.length - 1]; - } else { - this.lastChar[0] = buf[buf.length - 2]; - this.lastChar[1] = buf[buf.length - 1]; - } - return buf.toString('base64', i, buf.length - n); -} - -function base64End(buf) { - var r = buf && buf.length ? this.write(buf) : ''; - if (this.lastNeed) return r + this.lastChar.toString('base64', 0, 3 - this.lastNeed); - return r; -} - -// Pass bytes on through for single-byte encodings (e.g. ascii, latin1, hex) -function simpleWrite(buf) { - return buf.toString(this.encoding); -} - -function simpleEnd(buf) { - return buf && buf.length ? this.write(buf) : ''; -} \ No newline at end of file diff --git a/deps/npm/node_modules/parallel-transform/node_modules/string_decoder/package.json b/deps/npm/node_modules/parallel-transform/node_modules/string_decoder/package.json deleted file mode 100644 index 8c4d6e474852f6..00000000000000 --- a/deps/npm/node_modules/parallel-transform/node_modules/string_decoder/package.json +++ /dev/null @@ -1,59 +0,0 @@ -{ - "_from": "string_decoder@~1.1.1", - "_id": "string_decoder@1.1.1", - "_inBundle": false, - "_integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "_location": "/parallel-transform/string_decoder", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "string_decoder@~1.1.1", - "name": "string_decoder", - "escapedName": "string_decoder", - "rawSpec": "~1.1.1", - "saveSpec": null, - "fetchSpec": "~1.1.1" - }, - "_requiredBy": [ - "/parallel-transform/readable-stream" - ], - "_resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "_shasum": "9cf1611ba62685d7030ae9e4ba34149c3af03fc8", - "_spec": "string_decoder@~1.1.1", - "_where": "/Users/aeschright/code/cli/node_modules/parallel-transform/node_modules/readable-stream", - "bugs": { - "url": "https://github.com/nodejs/string_decoder/issues" - }, - "bundleDependencies": false, - "dependencies": { - "safe-buffer": "~5.1.0" - }, - "deprecated": false, - "description": "The string_decoder module from Node core", - "devDependencies": { - "babel-polyfill": "^6.23.0", - "core-util-is": "^1.0.2", - "inherits": "^2.0.3", - "tap": "~0.4.8" - }, - "homepage": "https://github.com/nodejs/string_decoder", - "keywords": [ - "string", - "decoder", - "browser", - "browserify" - ], - "license": "MIT", - "main": "lib/string_decoder.js", - "name": "string_decoder", - "repository": { - "type": "git", - "url": "git://github.com/nodejs/string_decoder.git" - }, - "scripts": { - "ci": "tap test/parallel/*.js test/ours/*.js --tap | tee test.tap && node test/verify-dependencies.js", - "test": "tap test/parallel/*.js && node test/verify-dependencies" - }, - "version": "1.1.1" -} diff --git a/deps/npm/node_modules/parallel-transform/package.json b/deps/npm/node_modules/parallel-transform/package.json deleted file mode 100644 index b3261189e75677..00000000000000 --- a/deps/npm/node_modules/parallel-transform/package.json +++ /dev/null @@ -1,58 +0,0 @@ -{ - "_from": "parallel-transform@^1.1.0", - "_id": "parallel-transform@1.1.0", - "_inBundle": false, - "_integrity": "sha1-1BDwZbBdojCB/NEPKIVMKb2jOwY=", - "_location": "/parallel-transform", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "parallel-transform@^1.1.0", - "name": "parallel-transform", - "escapedName": "parallel-transform", - "rawSpec": "^1.1.0", - "saveSpec": null, - "fetchSpec": "^1.1.0" - }, - "_requiredBy": [ - "/mississippi", - "/npm-profile/cacache/mississippi", - "/npm-profile/mississippi", - "/npm-registry-fetch/cacache/mississippi" - ], - "_resolved": "https://registry.npmjs.org/parallel-transform/-/parallel-transform-1.1.0.tgz", - "_shasum": "d410f065b05da23081fcd10f28854c29bda33b06", - "_spec": "parallel-transform@^1.1.0", - "_where": "/Users/rebecca/code/npm/node_modules/mississippi", - "author": { - "name": "Mathias Buus Madsen", - "email": "mathiasbuus@gmail.com" - }, - "bugs": { - "url": "https://github.com/mafintosh/parallel-transform/issues" - }, - "bundleDependencies": false, - "dependencies": { - "cyclist": "~0.2.2", - "inherits": "^2.0.3", - "readable-stream": "^2.1.5" - }, - "deprecated": false, - "description": "Transform stream that allows you to run your transforms in parallel without changing the order", - "homepage": "https://github.com/mafintosh/parallel-transform#readme", - "keywords": [ - "transform", - "stream", - "parallel", - "preserve", - "order" - ], - "license": "MIT", - "name": "parallel-transform", - "repository": { - "type": "git", - "url": "git://github.com/mafintosh/parallel-transform.git" - }, - "version": "1.1.0" -} diff --git a/deps/npm/node_modules/minizlib/node_modules/minipass/LICENSE b/deps/npm/node_modules/parse-conflict-json/LICENSE similarity index 100% rename from deps/npm/node_modules/minizlib/node_modules/minipass/LICENSE rename to deps/npm/node_modules/parse-conflict-json/LICENSE diff --git a/deps/npm/node_modules/parse-conflict-json/README.md b/deps/npm/node_modules/parse-conflict-json/README.md new file mode 100644 index 00000000000000..ee9e4fd564199b --- /dev/null +++ b/deps/npm/node_modules/parse-conflict-json/README.md @@ -0,0 +1,42 @@ +# parse-conflict-json + +Parse a JSON string that has git merge conflicts, resolving if possible. + +If the JSON is valid, it just does `JSON.parse` as normal. + +If either side of the conflict is invalid JSON, then an error is thrown for +that. + +## USAGE + +```js +// after a git merge that left some conflicts there +const data = fs.readFileSync('package-lock.json', 'utf8') + +// reviverFunction is passed to JSON.parse as the reviver function +// preference defaults to 'ours', set to 'theirs' to prefer the other +// side's changes. +const parsed = parseConflictJson(data, reviverFunction, preference) + +// returns true if the data looks like a conflicted diff file +parsed.isDiff(data) +``` + +## Algorithm + +If `prefer` is set to `theirs`, then the vaules of `theirs` and `ours` are +switched in the resolver function. (Ie, we'll apply their changes on top +of our object, rather than the other way around.) + +- Parse the conflicted file into 3 pieces: `ours`, `theirs`, and `parent` + +- Get the [diff](https://github.com/angus-c/just#just-diff) from `parent` + to `ours`. + +- [Apply](https://github.com/angus-c/just#just-diff-apply) each change of + that diff to `theirs`. + + If any change in the diff set cannot be applied (ie, because they + changed an object into a non-object and we changed a field on that + object), then replace the object at the specified path with the object + at the path in `ours`. diff --git a/deps/npm/node_modules/parse-conflict-json/index.js b/deps/npm/node_modules/parse-conflict-json/index.js new file mode 100644 index 00000000000000..8b5dbde40c08b5 --- /dev/null +++ b/deps/npm/node_modules/parse-conflict-json/index.js @@ -0,0 +1,92 @@ +const parseJSON = require('json-parse-even-better-errors') +const { diff } = require('just-diff') +const { diffApply } = require('just-diff-apply') + +const stripBOM = content => { + content = content.toString() + // Remove byte order marker. This catches EF BB BF (the UTF-8 BOM) + // because the buffer-to-string conversion in `fs.readFileSync()` + // translates it to FEFF, the UTF-16 BOM. + if (content.charCodeAt(0) === 0xFEFF) + content = content.slice(1) + return content +} + +const PARENT_RE = /\|{7,}/g +const OURS_RE = /<{7,}/g +const THEIRS_RE = /={7,}/g +const END_RE = />{7,}/g + +const isDiff = str => + str.match(OURS_RE) && str.match(THEIRS_RE) && str.match(END_RE) + +const parseConflictJSON = (str, reviver, prefer) => { + prefer = prefer || 'ours' + if (prefer !== 'theirs' && prefer !== 'ours') + throw new TypeError('prefer param must be "ours" or "theirs" if set') + + str = stripBOM(str) + + if (!isDiff(str)) + return parseJSON(str) + + const pieces = str.split(/[\n\r]+/g).reduce((acc, line) => { + if (line.match(PARENT_RE)) + acc.state = 'parent' + else if (line.match(OURS_RE)) + acc.state = 'ours' + else if (line.match(THEIRS_RE)) + acc.state = 'theirs' + else if (line.match(END_RE)) + acc.state = 'top' + else { + if (acc.state === 'top' || acc.state === 'ours') + acc.ours += line + if (acc.state === 'top' || acc.state === 'theirs') + acc.theirs += line + if (acc.state === 'top' || acc.state === 'parent') + acc.parent += line + } + return acc + }, { + state: 'top', + ours: '', + theirs: '', + parent: '' + }) + + // this will throw if either piece is not valid JSON, that's intended + const parent = parseJSON(pieces.parent, reviver) + const ours = parseJSON(pieces.ours, reviver) + const theirs = parseJSON(pieces.theirs, reviver) + + return prefer === 'ours' + ? resolve(parent, ours, theirs) + : resolve(parent, theirs, ours) +} + +const isObj = obj => obj && typeof obj === 'object' + +const copyPath = (to, from, path, i) => { + const p = path[i] + if (isObj(to[p]) && isObj(from[p]) && + Array.isArray(to[p]) === Array.isArray(from[p])) + return copyPath(to[p], from[p], path, i + 1) + to[p] = from[p] +} + +// get the diff from parent->ours and applying our changes on top of theirs. +// If they turned an object into a non-object, then put it back. +const resolve = (parent, ours, theirs) => { + const dours = diff(parent, ours) + for (let i = 0; i < dours.length; i++) { + try { + diffApply(theirs, [dours[i]]) + } catch (e) { + copyPath(theirs, ours, dours[i].path, 0) + } + } + return theirs +} + +module.exports = Object.assign(parseConflictJSON, { isDiff }) diff --git a/deps/npm/node_modules/parse-conflict-json/package.json b/deps/npm/node_modules/parse-conflict-json/package.json new file mode 100644 index 00000000000000..3962e22f339012 --- /dev/null +++ b/deps/npm/node_modules/parse-conflict-json/package.json @@ -0,0 +1,32 @@ +{ + "name": "parse-conflict-json", + "version": "1.1.1", + "description": "Parse a JSON string that has git merge conflicts, resolving if possible", + "author": "Isaac Z. Schlueter (https://izs.me)", + "license": "ISC", + "scripts": { + "test": "tap", + "snap": "tap", + "preversion": "npm test", + "postversion": "npm publish", + "postpublish": "git push origin --follow-tags" + }, + "tap": { + "check-coverage": true + }, + "devDependencies": { + "tap": "^14.6.1" + }, + "dependencies": { + "just-diff": "^3.0.1", + "just-diff-apply": "^3.0.0", + "json-parse-even-better-errors": "^2.3.0" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/npm/parse-conflict-json.git" + }, + "files": [ + "index.js" + ] +} diff --git a/deps/npm/node_modules/path-exists/index.js b/deps/npm/node_modules/path-exists/index.js deleted file mode 100644 index 16ae60acb18da4..00000000000000 --- a/deps/npm/node_modules/path-exists/index.js +++ /dev/null @@ -1,17 +0,0 @@ -'use strict'; -const fs = require('fs'); - -module.exports = fp => new Promise(resolve => { - fs.access(fp, err => { - resolve(!err); - }); -}); - -module.exports.sync = fp => { - try { - fs.accessSync(fp); - return true; - } catch (err) { - return false; - } -}; diff --git a/deps/npm/node_modules/path-exists/license b/deps/npm/node_modules/path-exists/license deleted file mode 100644 index 654d0bfe943437..00000000000000 --- a/deps/npm/node_modules/path-exists/license +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -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/deps/npm/node_modules/path-exists/package.json b/deps/npm/node_modules/path-exists/package.json deleted file mode 100644 index 539aff886d176b..00000000000000 --- a/deps/npm/node_modules/path-exists/package.json +++ /dev/null @@ -1,72 +0,0 @@ -{ - "_from": "path-exists@^3.0.0", - "_id": "path-exists@3.0.0", - "_inBundle": false, - "_integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", - "_location": "/path-exists", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "path-exists@^3.0.0", - "name": "path-exists", - "escapedName": "path-exists", - "rawSpec": "^3.0.0", - "saveSpec": null, - "fetchSpec": "^3.0.0" - }, - "_requiredBy": [ - "/locate-path" - ], - "_resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", - "_shasum": "ce0ebeaa5f78cb18925ea7d810d7b59b010fd515", - "_spec": "path-exists@^3.0.0", - "_where": "/Users/rebecca/code/npm/node_modules/locate-path", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "bugs": { - "url": "https://github.com/sindresorhus/path-exists/issues" - }, - "bundleDependencies": false, - "deprecated": false, - "description": "Check if a path exists", - "devDependencies": { - "ava": "*", - "xo": "*" - }, - "engines": { - "node": ">=4" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/sindresorhus/path-exists#readme", - "keywords": [ - "path", - "exists", - "exist", - "file", - "filepath", - "fs", - "filesystem", - "file-system", - "access", - "stat" - ], - "license": "MIT", - "name": "path-exists", - "repository": { - "type": "git", - "url": "git+https://github.com/sindresorhus/path-exists.git" - }, - "scripts": { - "test": "xo && ava" - }, - "version": "3.0.0", - "xo": { - "esnext": true - } -} diff --git a/deps/npm/node_modules/path-exists/readme.md b/deps/npm/node_modules/path-exists/readme.md deleted file mode 100644 index 1b65fa705d911a..00000000000000 --- a/deps/npm/node_modules/path-exists/readme.md +++ /dev/null @@ -1,50 +0,0 @@ -# path-exists [![Build Status](https://travis-ci.org/sindresorhus/path-exists.svg?branch=master)](https://travis-ci.org/sindresorhus/path-exists) - -> Check if a path exists - -Because [`fs.exists()`](https://nodejs.org/api/fs.html#fs_fs_exists_path_callback) is being [deprecated](https://github.com/iojs/io.js/issues/103), but there's still a genuine use-case of being able to check if a path exists for other purposes than doing IO with it. - -Never use this before handling a file though: - -> In particular, checking if a file exists before opening it is an anti-pattern that leaves you vulnerable to race conditions: another process may remove the file between the calls to `fs.exists()` and `fs.open()`. Just open the file and handle the error when it's not there. - - -## Install - -``` -$ npm install --save path-exists -``` - - -## Usage - -```js -// foo.js -const pathExists = require('path-exists'); - -pathExists('foo.js').then(exists => { - console.log(exists); - //=> true -}); -``` - - -## API - -### pathExists(path) - -Returns a promise for a boolean of whether the path exists. - -### pathExists.sync(path) - -Returns a boolean of whether the path exists. - - -## Related - -- [path-exists-cli](https://github.com/sindresorhus/path-exists-cli) - CLI for this module - - -## License - -MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/deps/npm/node_modules/path-is-absolute/package.json b/deps/npm/node_modules/path-is-absolute/package.json index 2161a3c2739c37..91196d5e9c1336 100644 --- a/deps/npm/node_modules/path-is-absolute/package.json +++ b/deps/npm/node_modules/path-is-absolute/package.json @@ -1,48 +1,23 @@ { - "_from": "path-is-absolute@^1.0.0", - "_id": "path-is-absolute@1.0.1", - "_inBundle": false, - "_integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", - "_location": "/path-is-absolute", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "path-is-absolute@^1.0.0", - "name": "path-is-absolute", - "escapedName": "path-is-absolute", - "rawSpec": "^1.0.0", - "saveSpec": null, - "fetchSpec": "^1.0.0" - }, - "_requiredBy": [ - "/glob" - ], - "_resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "_shasum": "174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f", - "_spec": "path-is-absolute@^1.0.0", - "_where": "/Users/rebecca/code/npm/node_modules/glob", + "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", @@ -62,14 +37,7 @@ "detect", "check" ], - "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" + "devDependencies": { + "xo": "^0.16.0" + } } diff --git a/deps/npm/node_modules/path-is-inside/LICENSE.txt b/deps/npm/node_modules/path-is-inside/LICENSE.txt deleted file mode 100644 index 0bdbb61c9decb1..00000000000000 --- a/deps/npm/node_modules/path-is-inside/LICENSE.txt +++ /dev/null @@ -1,47 +0,0 @@ -Dual licensed under WTFPL and MIT: - ---- - -Copyright © 2013–2016 Domenic Denicola - -This work is free. You can redistribute it and/or modify it under the -terms of the Do What The Fuck You Want To Public License, Version 2, -as published by Sam Hocevar. See below for more details. - - DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE - Version 2, December 2004 - - Copyright (C) 2004 Sam Hocevar - - Everyone is permitted to copy and distribute verbatim or modified - copies of this license document, and changing it is allowed as long - as the name is changed. - - DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. You just DO WHAT THE FUCK YOU WANT TO. - ---- - -The MIT License (MIT) - -Copyright © 2013–2016 Domenic Denicola - -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/path-is-inside/lib/path-is-inside.js b/deps/npm/node_modules/path-is-inside/lib/path-is-inside.js deleted file mode 100644 index 596dfd3b3c5d01..00000000000000 --- a/deps/npm/node_modules/path-is-inside/lib/path-is-inside.js +++ /dev/null @@ -1,28 +0,0 @@ -"use strict"; - -var path = require("path"); - -module.exports = function (thePath, potentialParent) { - // For inside-directory checking, we want to allow trailing slashes, so normalize. - thePath = stripTrailingSep(thePath); - potentialParent = stripTrailingSep(potentialParent); - - // Node treats only Windows as case-insensitive in its path module; we follow those conventions. - if (process.platform === "win32") { - thePath = thePath.toLowerCase(); - potentialParent = potentialParent.toLowerCase(); - } - - return thePath.lastIndexOf(potentialParent, 0) === 0 && - ( - thePath[potentialParent.length] === path.sep || - thePath[potentialParent.length] === undefined - ); -}; - -function stripTrailingSep(thePath) { - if (thePath[thePath.length - 1] === path.sep) { - return thePath.slice(0, -1); - } - return thePath; -} diff --git a/deps/npm/node_modules/path-is-inside/package.json b/deps/npm/node_modules/path-is-inside/package.json deleted file mode 100644 index 9ff6e104488705..00000000000000 --- a/deps/npm/node_modules/path-is-inside/package.json +++ /dev/null @@ -1,70 +0,0 @@ -{ - "_args": [ - [ - "path-is-inside@1.0.2", - "/Users/rebecca/code/npm" - ] - ], - "_from": "path-is-inside@1.0.2", - "_id": "path-is-inside@1.0.2", - "_inBundle": false, - "_integrity": "sha1-NlQX3t5EQw0cEa9hAn+s8HS9/FM=", - "_location": "/path-is-inside", - "_phantomChildren": {}, - "_requested": { - "type": "version", - "registry": true, - "raw": "path-is-inside@1.0.2", - "name": "path-is-inside", - "escapedName": "path-is-inside", - "rawSpec": "1.0.2", - "saveSpec": null, - "fetchSpec": "1.0.2" - }, - "_requiredBy": [ - "/", - "/eslint", - "/fs-vacuum", - "/gentle-fs", - "/is-path-inside" - ], - "_resolved": "https://registry.npmjs.org/path-is-inside/-/path-is-inside-1.0.2.tgz", - "_spec": "1.0.2", - "_where": "/Users/rebecca/code/npm", - "author": { - "name": "Domenic Denicola", - "email": "d@domenic.me", - "url": "https://domenic.me" - }, - "bugs": { - "url": "https://github.com/domenic/path-is-inside/issues" - }, - "description": "Tests whether one path is inside another path", - "devDependencies": { - "jshint": "~2.3.0", - "mocha": "~1.15.1" - }, - "files": [ - "lib" - ], - "homepage": "https://github.com/domenic/path-is-inside#readme", - "keywords": [ - "path", - "directory", - "folder", - "inside", - "relative" - ], - "license": "(WTFPL OR MIT)", - "main": "lib/path-is-inside.js", - "name": "path-is-inside", - "repository": { - "type": "git", - "url": "git+https://github.com/domenic/path-is-inside.git" - }, - "scripts": { - "lint": "jshint lib", - "test": "mocha" - }, - "version": "1.0.2" -} diff --git a/deps/npm/node_modules/path-key/index.js b/deps/npm/node_modules/path-key/index.js deleted file mode 100644 index 62c8250ab4e3ed..00000000000000 --- a/deps/npm/node_modules/path-key/index.js +++ /dev/null @@ -1,13 +0,0 @@ -'use strict'; -module.exports = opts => { - opts = opts || {}; - - const env = opts.env || process.env; - const platform = opts.platform || process.platform; - - if (platform !== 'win32') { - return 'PATH'; - } - - return Object.keys(env).find(x => x.toUpperCase() === 'PATH') || 'Path'; -}; diff --git a/deps/npm/node_modules/path-key/license b/deps/npm/node_modules/path-key/license deleted file mode 100644 index 654d0bfe943437..00000000000000 --- a/deps/npm/node_modules/path-key/license +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -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/deps/npm/node_modules/path-key/package.json b/deps/npm/node_modules/path-key/package.json deleted file mode 100644 index 68bfde6f7877c3..00000000000000 --- a/deps/npm/node_modules/path-key/package.json +++ /dev/null @@ -1,71 +0,0 @@ -{ - "_from": "path-key@^2.0.0", - "_id": "path-key@2.0.1", - "_inBundle": false, - "_integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=", - "_location": "/path-key", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "path-key@^2.0.0", - "name": "path-key", - "escapedName": "path-key", - "rawSpec": "^2.0.0", - "saveSpec": null, - "fetchSpec": "^2.0.0" - }, - "_requiredBy": [ - "/npm-run-path" - ], - "_resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", - "_shasum": "411cadb574c5a140d3a4b1910d40d80cc9f40b40", - "_spec": "path-key@^2.0.0", - "_where": "/Users/rebecca/code/npm/node_modules/npm-run-path", - "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": { - "ava": "*", - "xo": "*" - }, - "engines": { - "node": ">=4" - }, - "files": [ - "index.js" - ], - "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" - }, - "version": "2.0.1", - "xo": { - "esnext": true - } -} diff --git a/deps/npm/node_modules/path-key/readme.md b/deps/npm/node_modules/path-key/readme.md deleted file mode 100644 index cb5710aace72d2..00000000000000 --- a/deps/npm/node_modules/path-key/readme.md +++ /dev/null @@ -1,51 +0,0 @@ -# path-key [![Build Status](https://travis-ci.org/sindresorhus/path-key.svg?branch=master)](https://travis-ci.org/sindresorhus/path-key) - -> Get the [PATH](https://en.wikipedia.org/wiki/PATH_(variable)) environment variable key cross-platform - -It's usually `PATH`, but on Windows it can be any casing like `Path`... - - -## Install - -``` -$ npm install --save path-key -``` - - -## Usage - -```js -const pathKey = require('path-key'); - -const key = pathKey(); -//=> 'PATH' - -const PATH = process.env[key]; -//=> '/usr/local/bin:/usr/bin:/bin' -``` - - -## API - -### pathKey([options]) - -#### options - -##### env - -Type: `Object`
    -Default: [`process.env`](https://nodejs.org/api/process.html#process_process_env) - -Use a custom environment variables object. - -#### platform - -Type: `string`
    -Default: [`process.platform`](https://nodejs.org/api/process.html#process_process_platform) - -Get the PATH key for a specific platform. - - -## License - -MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/deps/npm/node_modules/path-parse/package.json b/deps/npm/node_modules/path-parse/package.json index 56d19c753c875b..21332bb14f8b7f 100644 --- a/deps/npm/node_modules/path-parse/package.json +++ b/deps/npm/node_modules/path-parse/package.json @@ -1,42 +1,15 @@ { - "_args": [ - [ - "path-parse@1.0.6", - "/Users/aeschright/code/npm-release" - ] - ], - "_development": true, - "_from": "path-parse@1.0.6", - "_id": "path-parse@1.0.6", - "_inBundle": false, - "_integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==", - "_location": "/path-parse", - "_phantomChildren": {}, - "_requested": { - "type": "version", - "registry": true, - "raw": "path-parse@1.0.6", - "name": "path-parse", - "escapedName": "path-parse", - "rawSpec": "1.0.6", - "saveSpec": null, - "fetchSpec": "1.0.6" - }, - "_requiredBy": [ - "/resolve" - ], - "_resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz", - "_spec": "1.0.6", - "_where": "/Users/aeschright/code/npm-release", - "author": { - "name": "Javier Blanco", - "email": "http://jbgutierrez.info" + "name": "path-parse", + "version": "1.0.6", + "description": "Node.js path.parse() ponyfill", + "main": "index.js", + "scripts": { + "test": "node test.js" }, - "bugs": { - "url": "https://github.com/jbgutierrez/path-parse/issues" + "repository": { + "type": "git", + "url": "https://github.com/jbgutierrez/path-parse.git" }, - "description": "Node.js path.parse() ponyfill", - "homepage": "https://github.com/jbgutierrez/path-parse#readme", "keywords": [ "path", "paths", @@ -51,15 +24,10 @@ "polyfill", "shim" ], + "author": "Javier Blanco ", "license": "MIT", - "main": "index.js", - "name": "path-parse", - "repository": { - "type": "git", - "url": "git+https://github.com/jbgutierrez/path-parse.git" - }, - "scripts": { - "test": "node test.js" + "bugs": { + "url": "https://github.com/jbgutierrez/path-parse/issues" }, - "version": "1.0.6" + "homepage": "https://github.com/jbgutierrez/path-parse#readme" } diff --git a/deps/npm/node_modules/performance-now/package.json b/deps/npm/node_modules/performance-now/package.json index 9f9595ac368a9b..962bfc85ff8fe1 100644 --- a/deps/npm/node_modules/performance-now/package.json +++ b/deps/npm/node_modules/performance-now/package.json @@ -1,38 +1,18 @@ { - "_from": "performance-now@^2.1.0", - "_id": "performance-now@2.1.0", - "_inBundle": false, - "_integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=", - "_location": "/performance-now", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "performance-now@^2.1.0", - "name": "performance-now", - "escapedName": "performance-now", - "rawSpec": "^2.1.0", - "saveSpec": null, - "fetchSpec": "^2.1.0" - }, - "_requiredBy": [ - "/request" - ], - "_resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", - "_shasum": "6309f4e0e5fa913ec1c69307ae364b4b377c9e7b", - "_spec": "performance-now@^2.1.0", - "_where": "/Users/zkat/Documents/code/work/npm/node_modules/request", - "author": { - "name": "Braveg1rl", - "email": "braveg1rl@outlook.com" - }, - "bugs": { - "url": "https://github.com/braveg1rl/performance-now/issues" + "name": "performance-now", + "description": "Implements performance.now (based on process.hrtime).", + "keywords": [], + "version": "2.1.0", + "author": "Braveg1rl ", + "license": "MIT", + "homepage": "https://github.com/braveg1rl/performance-now", + "bugs": "https://github.com/braveg1rl/performance-now/issues", + "repository": { + "type": "git", + "url": "git://github.com/braveg1rl/performance-now.git" }, - "bundleDependencies": false, + "private": false, "dependencies": {}, - "deprecated": false, - "description": "Implements performance.now (based on process.hrtime).", "devDependencies": { "bluebird": "^3.4.7", "call-delayed": "^1.0.0", @@ -42,24 +22,14 @@ "mocha": "~3.2.0", "pre-commit": "^1.2.2" }, - "homepage": "https://github.com/braveg1rl/performance-now", - "keywords": [], - "license": "MIT", - "main": "lib/performance-now.js", - "name": "performance-now", "optionalDependencies": {}, - "private": false, - "repository": { - "type": "git", - "url": "git://github.com/braveg1rl/performance-now.git" - }, + "main": "lib/performance-now.js", "scripts": { "build": "mkdir -p lib && rm -rf lib/* && node_modules/.bin/coffee --compile -m --output lib/ src/", "prepublish": "npm test", "pretest": "npm run build", - "test": "mocha", - "watch": "coffee --watch --compile --output lib/ src/" + "test": "node_modules/.bin/mocha", + "watch": "node_modules/.bin/coffee --watch --compile --output lib/ src/" }, - "typings": "src/index.d.ts", - "version": "2.1.0" + "typings": "src/index.d.ts" } diff --git a/deps/npm/node_modules/pify/index.js b/deps/npm/node_modules/pify/index.js deleted file mode 100644 index 1dee43ad08f62b..00000000000000 --- a/deps/npm/node_modules/pify/index.js +++ /dev/null @@ -1,84 +0,0 @@ -'use strict'; - -const processFn = (fn, opts) => function () { - const P = opts.promiseModule; - const args = new Array(arguments.length); - - for (let i = 0; i < arguments.length; i++) { - args[i] = arguments[i]; - } - - return new P((resolve, reject) => { - if (opts.errorFirst) { - args.push(function (err, result) { - if (opts.multiArgs) { - const results = new Array(arguments.length - 1); - - for (let i = 1; i < arguments.length; i++) { - results[i - 1] = arguments[i]; - } - - if (err) { - results.unshift(err); - reject(results); - } else { - resolve(results); - } - } else if (err) { - reject(err); - } else { - resolve(result); - } - }); - } else { - args.push(function (result) { - if (opts.multiArgs) { - const results = new Array(arguments.length - 1); - - for (let i = 0; i < arguments.length; i++) { - results[i] = arguments[i]; - } - - resolve(results); - } else { - resolve(result); - } - }); - } - - fn.apply(this, args); - }); -}; - -module.exports = (obj, opts) => { - opts = Object.assign({ - exclude: [/.+(Sync|Stream)$/], - errorFirst: true, - promiseModule: Promise - }, opts); - - const filter = key => { - const match = pattern => typeof pattern === 'string' ? key === pattern : pattern.test(key); - return opts.include ? opts.include.some(match) : !opts.exclude.some(match); - }; - - let ret; - if (typeof obj === 'function') { - ret = function () { - if (opts.excludeMain) { - return obj.apply(this, arguments); - } - - return processFn(obj, opts).apply(this, arguments); - }; - } else { - ret = Object.create(Object.getPrototypeOf(obj)); - } - - for (const key in obj) { // eslint-disable-line guard-for-in - const x = obj[key]; - ret[key] = typeof x === 'function' && filter(key) ? processFn(x, opts) : x; - } - - return ret; -}; diff --git a/deps/npm/node_modules/pify/license b/deps/npm/node_modules/pify/license deleted file mode 100644 index e7af2f77107d73..00000000000000 --- a/deps/npm/node_modules/pify/license +++ /dev/null @@ -1,9 +0,0 @@ -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/deps/npm/node_modules/pify/package.json b/deps/npm/node_modules/pify/package.json deleted file mode 100644 index 9c065821e6f2e0..00000000000000 --- a/deps/npm/node_modules/pify/package.json +++ /dev/null @@ -1,84 +0,0 @@ -{ - "_from": "pify@^3.0.0", - "_id": "pify@3.0.0", - "_inBundle": false, - "_integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=", - "_location": "/pify", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "pify@^3.0.0", - "name": "pify", - "escapedName": "pify", - "rawSpec": "^3.0.0", - "saveSpec": null, - "fetchSpec": "^3.0.0" - }, - "_requiredBy": [ - "/make-dir", - "/pkg-conf/load-json-file" - ], - "_resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", - "_shasum": "e5a4acd2c101fdf3d9a4d07f0dbc4db49dd28176", - "_spec": "pify@^3.0.0", - "_where": "/Users/rebecca/code/npm/node_modules/make-dir", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "bugs": { - "url": "https://github.com/sindresorhus/pify/issues" - }, - "bundleDependencies": false, - "deprecated": false, - "description": "Promisify a callback-style function", - "devDependencies": { - "ava": "*", - "pinkie-promise": "^2.0.0", - "v8-natives": "^1.0.0", - "xo": "*" - }, - "engines": { - "node": ">=4" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/sindresorhus/pify#readme", - "keywords": [ - "promise", - "promises", - "promisify", - "all", - "denodify", - "denodeify", - "callback", - "cb", - "node", - "then", - "thenify", - "convert", - "transform", - "wrap", - "wrapper", - "bind", - "to", - "async", - "await", - "es2015", - "bluebird" - ], - "license": "MIT", - "name": "pify", - "repository": { - "type": "git", - "url": "git+https://github.com/sindresorhus/pify.git" - }, - "scripts": { - "optimization-test": "node --allow-natives-syntax optimization-test.js", - "test": "xo && ava && npm run optimization-test" - }, - "version": "3.0.0" -} diff --git a/deps/npm/node_modules/pify/readme.md b/deps/npm/node_modules/pify/readme.md deleted file mode 100644 index 376ca4e59d74c4..00000000000000 --- a/deps/npm/node_modules/pify/readme.md +++ /dev/null @@ -1,131 +0,0 @@ -# pify [![Build Status](https://travis-ci.org/sindresorhus/pify.svg?branch=master)](https://travis-ci.org/sindresorhus/pify) - -> Promisify a callback-style function - - -## Install - -``` -$ npm install --save pify -``` - - -## Usage - -```js -const fs = require('fs'); -const pify = require('pify'); - -// Promisify a single function -pify(fs.readFile)('package.json', 'utf8').then(data => { - console.log(JSON.parse(data).name); - //=> 'pify' -}); - -// Promisify all methods in a module -pify(fs).readFile('package.json', 'utf8').then(data => { - console.log(JSON.parse(data).name); - //=> 'pify' -}); -``` - - -## API - -### pify(input, [options]) - -Returns a `Promise` wrapped version of the supplied function or module. - -#### input - -Type: `Function` `Object` - -Callback-style function or module whose methods you want to promisify. - -#### options - -##### multiArgs - -Type: `boolean`
    -Default: `false` - -By default, the promisified function will only return the second argument from the callback, which works fine for most APIs. This option can be useful for modules like `request` that return multiple arguments. Turning this on will make it return an array of all arguments from the callback, excluding the error argument, instead of just the second argument. This also applies to rejections, where it returns an array of all the callback arguments, including the error. - -```js -const request = require('request'); -const pify = require('pify'); - -pify(request, {multiArgs: true})('https://sindresorhus.com').then(result => { - const [httpResponse, body] = result; -}); -``` - -##### include - -Type: `string[]` `RegExp[]` - -Methods in a module to promisify. Remaining methods will be left untouched. - -##### exclude - -Type: `string[]` `RegExp[]`
    -Default: `[/.+(Sync|Stream)$/]` - -Methods in a module **not** to promisify. Methods with names ending with `'Sync'` are excluded by default. - -##### excludeMain - -Type: `boolean`
    -Default: `false` - -If given module is a function itself, it will be promisified. Turn this option on if you want to promisify only methods of the module. - -```js -const pify = require('pify'); - -function fn() { - return true; -} - -fn.method = (data, callback) => { - setImmediate(() => { - callback(null, data); - }); -}; - -// Promisify methods but not `fn()` -const promiseFn = pify(fn, {excludeMain: true}); - -if (promiseFn()) { - promiseFn.method('hi').then(data => { - console.log(data); - }); -} -``` - -##### errorFirst - -Type: `boolean`
    -Default: `true` - -Whether the callback has an error as the first argument. You'll want to set this to `false` if you're dealing with an API that doesn't have an error as the first argument, like `fs.exists()`, some browser APIs, Chrome Extension APIs, etc. - -##### promiseModule - -Type: `Function` - -Custom promise module to use instead of the native one. - -Check out [`pinkie-promise`](https://github.com/floatdrop/pinkie-promise) if you need a tiny promise polyfill. - - -## Related - -- [p-event](https://github.com/sindresorhus/p-event) - Promisify an event by waiting for it to be emitted -- [p-map](https://github.com/sindresorhus/p-map) - Map over promises concurrently -- [More…](https://github.com/sindresorhus/promise-fun) - - -## License - -MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/deps/npm/node_modules/prepend-http/index.js b/deps/npm/node_modules/prepend-http/index.js deleted file mode 100644 index 60f532ac59c414..00000000000000 --- a/deps/npm/node_modules/prepend-http/index.js +++ /dev/null @@ -1,14 +0,0 @@ -'use strict'; -module.exports = function (url) { - if (typeof url !== 'string') { - throw new TypeError('Expected a string, got ' + typeof url); - } - - url = url.trim(); - - if (/^\.*\/|^(?!localhost)\w+:/.test(url)) { - return url; - } - - return url.replace(/^(?!(?:\w+:)?\/\/)/, 'http://'); -}; diff --git a/deps/npm/node_modules/prepend-http/license b/deps/npm/node_modules/prepend-http/license deleted file mode 100644 index 654d0bfe943437..00000000000000 --- a/deps/npm/node_modules/prepend-http/license +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -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/deps/npm/node_modules/prepend-http/package.json b/deps/npm/node_modules/prepend-http/package.json deleted file mode 100644 index 163369f25ea251..00000000000000 --- a/deps/npm/node_modules/prepend-http/package.json +++ /dev/null @@ -1,67 +0,0 @@ -{ - "_from": "prepend-http@^1.0.1", - "_id": "prepend-http@1.0.4", - "_inBundle": false, - "_integrity": "sha1-1PRWKwzjaW5BrFLQ4ALlemNdxtw=", - "_location": "/prepend-http", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "prepend-http@^1.0.1", - "name": "prepend-http", - "escapedName": "prepend-http", - "rawSpec": "^1.0.1", - "saveSpec": null, - "fetchSpec": "^1.0.1" - }, - "_requiredBy": [ - "/url-parse-lax" - ], - "_resolved": "https://registry.npmjs.org/prepend-http/-/prepend-http-1.0.4.tgz", - "_shasum": "d4f4562b0ce3696e41ac52d0e002e57a635dc6dc", - "_spec": "prepend-http@^1.0.1", - "_where": "/Users/rebecca/code/npm/node_modules/url-parse-lax", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "bugs": { - "url": "https://github.com/sindresorhus/prepend-http/issues" - }, - "bundleDependencies": false, - "deprecated": false, - "description": "Prepend `http://` to humanized URLs like todomvc.com and localhost", - "devDependencies": { - "ava": "*", - "xo": "*" - }, - "engines": { - "node": ">=0.10.0" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/sindresorhus/prepend-http#readme", - "keywords": [ - "prepend", - "protocol", - "scheme", - "url", - "uri", - "http", - "https", - "humanized" - ], - "license": "MIT", - "name": "prepend-http", - "repository": { - "type": "git", - "url": "git+https://github.com/sindresorhus/prepend-http.git" - }, - "scripts": { - "test": "xo && ava" - }, - "version": "1.0.4" -} diff --git a/deps/npm/node_modules/prepend-http/readme.md b/deps/npm/node_modules/prepend-http/readme.md deleted file mode 100644 index df7557e368ec12..00000000000000 --- a/deps/npm/node_modules/prepend-http/readme.md +++ /dev/null @@ -1,31 +0,0 @@ -# prepend-http [![Build Status](https://travis-ci.org/sindresorhus/prepend-http.svg?branch=master)](https://travis-ci.org/sindresorhus/prepend-http) - -> Prepend `http://` to humanized URLs like `todomvc.com` and `localhost` - - -## Install - -``` -$ npm install --save prepend-http -``` - - -## Usage - -```js -const prependHttp = require('prepend-http'); - -prependHttp('todomvc.com'); -//=> 'http://todomvc.com' - -prependHttp('localhost'); -//=> 'http://localhost' - -prependHttp('http://todomvc.com'); -//=> 'http://todomvc.com' -``` - - -## License - -MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/deps/npm/node_modules/process-nextick-args/index.js b/deps/npm/node_modules/process-nextick-args/index.js index 5f585e8e767d14..3eecf11488531c 100644 --- a/deps/npm/node_modules/process-nextick-args/index.js +++ b/deps/npm/node_modules/process-nextick-args/index.js @@ -1,6 +1,7 @@ 'use strict'; -if (!process.version || +if (typeof process === 'undefined' || + !process.version || process.version.indexOf('v0.') === 0 || process.version.indexOf('v1.') === 0 && process.version.indexOf('v1.8.') !== 0) { module.exports = { nextTick: nextTick }; diff --git a/deps/npm/node_modules/process-nextick-args/package.json b/deps/npm/node_modules/process-nextick-args/package.json index 9eafcd2d08364f..6070b723fcd347 100644 --- a/deps/npm/node_modules/process-nextick-args/package.json +++ b/deps/npm/node_modules/process-nextick-args/package.json @@ -1,50 +1,25 @@ { - "_from": "process-nextick-args@~2.0.0", - "_id": "process-nextick-args@2.0.0", - "_inBundle": false, - "_integrity": "sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw==", - "_location": "/process-nextick-args", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "process-nextick-args@~2.0.0", - "name": "process-nextick-args", - "escapedName": "process-nextick-args", - "rawSpec": "~2.0.0", - "saveSpec": null, - "fetchSpec": "~2.0.0" - }, - "_requiredBy": [ - "/readable-stream" - ], - "_resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.0.tgz", - "_shasum": "a37d732f4271b4ab1ad070d35508e8290788ffaa", - "_spec": "process-nextick-args@~2.0.0", - "_where": "/Users/rebecca/code/npm/node_modules/readable-stream", - "author": "", - "bugs": { - "url": "https://github.com/calvinmetcalf/process-nextick-args/issues" - }, - "bundleDependencies": false, - "deprecated": false, + "name": "process-nextick-args", + "version": "2.0.1", "description": "process.nextTick but always with args", - "devDependencies": { - "tap": "~0.2.6" - }, + "main": "index.js", "files": [ "index.js" ], - "homepage": "https://github.com/calvinmetcalf/process-nextick-args", - "license": "MIT", - "main": "index.js", - "name": "process-nextick-args", + "scripts": { + "test": "node test.js" + }, "repository": { "type": "git", - "url": "git+https://github.com/calvinmetcalf/process-nextick-args.git" + "url": "https://github.com/calvinmetcalf/process-nextick-args.git" }, - "scripts": { - "test": "node test.js" + "author": "", + "license": "MIT", + "bugs": { + "url": "https://github.com/calvinmetcalf/process-nextick-args/issues" }, - "version": "2.0.0" + "homepage": "https://github.com/calvinmetcalf/process-nextick-args", + "devDependencies": { + "tap": "~0.2.6" + } } diff --git a/deps/npm/node_modules/promise-all-reject-late/.github/FUNDING.yml b/deps/npm/node_modules/promise-all-reject-late/.github/FUNDING.yml new file mode 100644 index 00000000000000..20d8c03a4dca66 --- /dev/null +++ b/deps/npm/node_modules/promise-all-reject-late/.github/FUNDING.yml @@ -0,0 +1,3 @@ +# These are supported funding model platforms + +github: [isaacs] diff --git a/deps/npm/node_modules/promise-all-reject-late/.npmignore b/deps/npm/node_modules/promise-all-reject-late/.npmignore new file mode 100644 index 00000000000000..3870bd5bb72079 --- /dev/null +++ b/deps/npm/node_modules/promise-all-reject-late/.npmignore @@ -0,0 +1,24 @@ +# ignore most things, include some others +/* +/.* + +!bin/ +!lib/ +!docs/ +!package.json +!package-lock.json +!README.md +!CONTRIBUTING.md +!LICENSE +!CHANGELOG.md +!example/ +!scripts/ +!tap-snapshots/ +!test/ +!.github/ +!.travis.yml +!.gitignore +!.gitattributes +!coverage-map.js +!map.js +!index.js diff --git a/deps/npm/node_modules/promise-all-reject-late/LICENSE b/deps/npm/node_modules/promise-all-reject-late/LICENSE new file mode 100644 index 00000000000000..05eeeb88c2ef4c --- /dev/null +++ b/deps/npm/node_modules/promise-all-reject-late/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/deps/npm/node_modules/promise-all-reject-late/README.md b/deps/npm/node_modules/promise-all-reject-late/README.md new file mode 100644 index 00000000000000..eda7c70627f632 --- /dev/null +++ b/deps/npm/node_modules/promise-all-reject-late/README.md @@ -0,0 +1,40 @@ +# promise-all-reject-late + +Like Promise.all, but save rejections until all promises are resolved. + +This is handy when you want to do a bunch of things in parallel, and +rollback on failure, without clobbering or conflicting with those parallel +actions that may be in flight. For example, creating a bunch of files, +and deleting any if they don't all succeed. + +Example: + +```js +const lateReject = require('promise-all-reject-late') + +const { promisify } = require('util') +const fs = require('fs') +const writeFile = promisify(fs.writeFile) + +const createFilesOrRollback = (files) => { + return lateReject(files.map(file => writeFile(file, 'some data'))) + .catch(er => { + // try to clean up, then fail with the initial error + // we know that all write attempts are finished at this point + return lateReject(files.map(file => rimraf(file))) + .catch(er => { + console.error('failed to clean up, youre on your own i guess', er) + }) + .then(() => { + // fail with the original error + throw er + }) + }) +} +``` + +## API + +* `lateReject([array, of, promises])` - Resolve all the promises, + returning a promise that rejects with the first error, or resolves with + the array of results, but only after all promises are settled. diff --git a/deps/npm/node_modules/promise-all-reject-late/index.js b/deps/npm/node_modules/promise-all-reject-late/index.js new file mode 100644 index 00000000000000..1425edcee12826 --- /dev/null +++ b/deps/npm/node_modules/promise-all-reject-late/index.js @@ -0,0 +1,27 @@ +const allSettled = + Promise.allSettled ? promises => Promise.allSettled(promises) + : promises => { + const reflections = [] + for (let i = 0; i < promises.length; i++) { + reflections[i] = Promise.resolve(promises[i]).then(value => ({ + status: 'fulfilled', + value, + }), reason => ({ + status: 'rejected', + reason, + })) + } + return Promise.all(reflections) + } + +module.exports = promises => allSettled(promises).then(results => { + let er = null + const ret = new Array(results.length) + results.forEach((result, i) => { + if (result.status === 'rejected') + throw result.reason + else + ret[i] = result.value + }) + return ret +}) diff --git a/deps/npm/node_modules/promise-all-reject-late/package.json b/deps/npm/node_modules/promise-all-reject-late/package.json new file mode 100644 index 00000000000000..5e82f6a3da58c4 --- /dev/null +++ b/deps/npm/node_modules/promise-all-reject-late/package.json @@ -0,0 +1,22 @@ +{ + "name": "promise-all-reject-late", + "version": "1.0.1", + "description": "Like Promise.all, but save rejections until all promises are resolved", + "author": "Isaac Z. Schlueter (https://izs.me)", + "license": "ISC", + "scripts": { + "test": "tap", + "preversion": "npm test", + "postversion": "npm publish", + "prepublishOnly": "git push origin --follow-tags" + }, + "tap": { + "check-coverage": true + }, + "devDependencies": { + "tap": "^14.10.5" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } +} diff --git a/deps/npm/node_modules/promise-all-reject-late/test/index.js b/deps/npm/node_modules/promise-all-reject-late/test/index.js new file mode 100644 index 00000000000000..2d7025412cf39e --- /dev/null +++ b/deps/npm/node_modules/promise-all-reject-late/test/index.js @@ -0,0 +1,88 @@ +const t = require('tap') + +const main = () => { + if (process.argv[2] === 'polyfill-all-settled') { + Promise.allSettled = null + runTests() + } else if (process.argv[2] === 'native-all-settled') { + Promise.allSettled = Promise.allSettled || ( + promises => { + const reflections = [] + for (let i = 0; i < promises.length; i++) { + reflections[i] = Promise.resolve(promises[i]).then(value => ({ + status: 'fulfilled', + value, + }), reason => ({ + status: 'rejected', + reason, + })) + } + return Promise.all(reflections) + } + ) + runTests() + } else { + t.spawn(process.execPath, [__filename, 'polyfill-all-settled']) + t.spawn(process.execPath, [__filename, 'native-all-settled']) + } +} + +const runTests = () => { + const lateFail = require('../') + + t.test('fail only after all promises resolve', t => { + let resolvedSlow = false + const fast = () => Promise.reject('nope') + const slow = () => new Promise(res => setTimeout(res, 100)) + .then(() => resolvedSlow = true) + + // throw some holes and junk in the array to verify that we handle it + return t.rejects(lateFail([fast(),,,,slow(), null, {not: 'a promise'},,,])) + .then(() => t.equal(resolvedSlow, true, 'resolved slow before failure')) + }) + + t.test('works just like Promise.all() otherwise', t => { + const one = () => Promise.resolve(1) + const two = () => Promise.resolve(2) + const tre = () => Promise.resolve(3) + const fur = () => Promise.resolve(4) + const fiv = () => Promise.resolve(5) + const six = () => Promise.resolve(6) + const svn = () => Promise.resolve(7) + const eit = () => Promise.resolve(8) + const nin = () => Promise.resolve(9) + const ten = () => Promise.resolve(10) + const expect = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] + const all = Promise.all([ + one(), + two(), + tre(), + fur(), + fiv(), + six(), + svn(), + eit(), + nin(), + ten(), + ]) + const late = lateFail([ + one(), + two(), + tre(), + fur(), + fiv(), + six(), + svn(), + eit(), + nin(), + ten(), + ]) + + return Promise.all([all, late]).then(([all, late]) => { + t.strictSame(all, expect) + t.strictSame(late, expect) + }) + }) +} + +main() diff --git a/deps/npm/node_modules/promise-call-limit/LICENSE b/deps/npm/node_modules/promise-call-limit/LICENSE new file mode 100644 index 00000000000000..05eeeb88c2ef4c --- /dev/null +++ b/deps/npm/node_modules/promise-call-limit/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/deps/npm/node_modules/promise-call-limit/README.md b/deps/npm/node_modules/promise-call-limit/README.md new file mode 100644 index 00000000000000..eae5de8ce0bfb5 --- /dev/null +++ b/deps/npm/node_modules/promise-call-limit/README.md @@ -0,0 +1,30 @@ +# promise-call-limit + +Call an array of promise-returning functions, restricting concurrency to a +specified limit. + +## USAGE + +```js +const promiseCallLimit = require('promise-call-limit') +const things = getLongListOfThingsToFrobulate() + +// frobulate no more than 4 things in parallel +promiseCallLimit(things.map(thing => () => frobulateThing(thing)), 4) + .then(results => console.log('frobulated 4 at a time', results)) +``` + +## API + +### promiseCallLimit(queue Array<() => Promise>, limit = defaultLimit) + +The default limit is the number of CPUs on the system - 1, or 1. + +The reason for subtracting one is that presumably the main thread is taking +up a CPU as well, so let's not be greedy. + +Note that the array should be a list of Promise-_returning_ functions, not +Promises themselves. If you have a bunch of Promises already, you're best +off just calling `Promise.all()`. + +The functions in the queue are called without any arguments. diff --git a/deps/npm/node_modules/promise-call-limit/index.js b/deps/npm/node_modules/promise-call-limit/index.js new file mode 100644 index 00000000000000..a093c2481c451d --- /dev/null +++ b/deps/npm/node_modules/promise-call-limit/index.js @@ -0,0 +1,43 @@ +const defLimit = require('os').cpus().length +const callLimit = (queue, limit = defLimit) => new Promise((res, rej) => { + let active = 0 + let current = 0 + const results = [] + + let rejected = false + const reject = er => { + if (rejected) + return + rejected = true + rej(er) + } + + let resolved = false + const resolve = () => { + if (resolved || active > 0) + return + resolved = true + res(results) + } + + const run = () => { + const c = current++ + if (c >= queue.length) { + return resolve() + } + + active ++ + results[c] = queue[c]().then(result => { + active -- + results[c] = result + run() + return result + }, reject) + } + + for (let i = 0; i < limit; i++) { + run() + } +}) + +module.exports = callLimit diff --git a/deps/npm/node_modules/promise-call-limit/package.json b/deps/npm/node_modules/promise-call-limit/package.json new file mode 100644 index 00000000000000..ae5e4617fbbd9e --- /dev/null +++ b/deps/npm/node_modules/promise-call-limit/package.json @@ -0,0 +1,29 @@ +{ + "name": "promise-call-limit", + "version": "1.0.1", + "files": [ + "index.js" + ], + "description": "Call an array of promise-returning functions, restricting concurrency to a specified limit.", + "repository": { + "type": "git", + "url": "git+https://github.com/isaacs/promise-call-limit" + }, + "author": "Isaac Z. Schlueter (https://izs.me)", + "license": "ISC", + "scripts": { + "test": "tap", + "preversion": "npm test", + "postversion": "npm publish", + "prepublishOnly": "git push origin --follow-tags" + }, + "tap": { + "check-coverage": true + }, + "devDependencies": { + "tap": "^14.10.6" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } +} diff --git a/deps/npm/node_modules/promise-inflight/package.json b/deps/npm/node_modules/promise-inflight/package.json index ff79836b588b28..0d8930c5b6d492 100644 --- a/deps/npm/node_modules/promise-inflight/package.json +++ b/deps/npm/node_modules/promise-inflight/package.json @@ -1,60 +1,24 @@ { - "_args": [ - [ - "promise-inflight@1.0.1", - "/Users/rebecca/code/npm" - ] - ], - "_from": "promise-inflight@1.0.1", - "_id": "promise-inflight@1.0.1", - "_inBundle": false, - "_integrity": "sha1-mEcocL8igTL8vdhoEputEsPAKeM=", - "_location": "/promise-inflight", - "_phantomChildren": {}, - "_requested": { - "type": "version", - "registry": true, - "raw": "promise-inflight@1.0.1", - "name": "promise-inflight", - "escapedName": "promise-inflight", - "rawSpec": "1.0.1", - "saveSpec": null, - "fetchSpec": "1.0.1" - }, - "_requiredBy": [ - "/", - "/cacache", - "/npm-profile/cacache", - "/npm-registry-fetch/cacache", - "/pacote" - ], - "_resolved": "https://registry.npmjs.org/promise-inflight/-/promise-inflight-1.0.1.tgz", - "_spec": "1.0.1", - "_where": "/Users/rebecca/code/npm", - "author": { - "name": "Rebecca Turner", - "email": "me@re-becca.org", - "url": "http://re-becca.org/" - }, - "bugs": { - "url": "https://github.com/iarna/promise-inflight/issues" - }, + "name": "promise-inflight", + "version": "1.0.1", "description": "One promise for multiple requests in flight to avoid async duplication", - "devDependencies": {}, + "main": "inflight.js", "files": [ "inflight.js" ], - "homepage": "https://github.com/iarna/promise-inflight#readme", - "keywords": [], "license": "ISC", - "main": "inflight.js", - "name": "promise-inflight", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "keywords": [], + "author": "Rebecca Turner (http://re-becca.org/)", + "devDependencies": {}, "repository": { "type": "git", "url": "git+https://github.com/iarna/promise-inflight.git" }, - "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" + "bugs": { + "url": "https://github.com/iarna/promise-inflight/issues" }, - "version": "1.0.1" + "homepage": "https://github.com/iarna/promise-inflight#readme" } diff --git a/deps/npm/node_modules/promise-retry/node_modules/retry/.npmignore b/deps/npm/node_modules/promise-retry/node_modules/retry/.npmignore deleted file mode 100644 index e7726a071b7f39..00000000000000 --- a/deps/npm/node_modules/promise-retry/node_modules/retry/.npmignore +++ /dev/null @@ -1,2 +0,0 @@ -/node_modules/* -npm-debug.log diff --git a/deps/npm/node_modules/promise-retry/node_modules/retry/License b/deps/npm/node_modules/promise-retry/node_modules/retry/License deleted file mode 100644 index 0b58de379fb308..00000000000000 --- a/deps/npm/node_modules/promise-retry/node_modules/retry/License +++ /dev/null @@ -1,21 +0,0 @@ -Copyright (c) 2011: -Tim Koschützki (tim@debuggable.com) -Felix Geisendörfer (felix@debuggable.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/deps/npm/node_modules/promise-retry/node_modules/retry/Makefile b/deps/npm/node_modules/promise-retry/node_modules/retry/Makefile deleted file mode 100644 index eee21a99dfc9ec..00000000000000 --- a/deps/npm/node_modules/promise-retry/node_modules/retry/Makefile +++ /dev/null @@ -1,22 +0,0 @@ -SHELL := /bin/bash - -test: - @node test/runner.js - -release-major: test - npm version major -m "Release %s" - git push - npm publish - -release-minor: test - npm version minor -m "Release %s" - git push - npm publish - -release-patch: test - npm version patch -m "Release %s" - git push - npm publish - -.PHONY: test - diff --git a/deps/npm/node_modules/promise-retry/node_modules/retry/README.md b/deps/npm/node_modules/promise-retry/node_modules/retry/README.md deleted file mode 100644 index eee05f7bb61537..00000000000000 --- a/deps/npm/node_modules/promise-retry/node_modules/retry/README.md +++ /dev/null @@ -1,215 +0,0 @@ -# retry - -Abstraction for exponential and custom retry strategies for failed operations. - -## Installation - - npm install retry - -## Current Status - -This module has been tested and is ready to be used. - -## Tutorial - -The example below will retry a potentially failing `dns.resolve` operation -`10` times using an exponential backoff strategy. With the default settings, this -means the last attempt is made after `17 minutes and 3 seconds`. - -``` javascript -var dns = require('dns'); -var retry = require('retry'); - -function faultTolerantResolve(address, cb) { - var operation = retry.operation(); - - operation.attempt(function(currentAttempt) { - dns.resolve(address, function(err, addresses) { - if (operation.retry(err)) { - return; - } - - cb(err ? operation.mainError() : null, addresses); - }); - }); -} - -faultTolerantResolve('nodejs.org', function(err, addresses) { - console.log(err, addresses); -}); -``` - -Of course you can also configure the factors that go into the exponential -backoff. See the API documentation below for all available settings. -currentAttempt is an int representing the number of attempts so far. - -``` javascript -var operation = retry.operation({ - retries: 5, - factor: 3, - minTimeout: 1 * 1000, - maxTimeout: 60 * 1000, - randomize: true, -}); -``` - -## API - -### retry.operation([options]) - -Creates a new `RetryOperation` object. `options` is the same as `retry.timeouts()`'s `options`, with two additions: - -* `forever`: Whether to retry forever, defaults to `false`. -* `unref`: Wether to [unref](https://nodejs.org/api/timers.html#timers_unref) the setTimeout's, defaults to `false`. - -### retry.timeouts([options]) - -Returns an array of timeouts. All time `options` and return values are in -milliseconds. If `options` is an array, a copy of that array is returned. - -`options` is a JS object that can contain any of the following keys: - -* `retries`: The maximum amount of times to retry the operation. Default is `10`. -* `factor`: The exponential factor to use. Default is `2`. -* `minTimeout`: The number of milliseconds before starting the first retry. Default is `1000`. -* `maxTimeout`: The maximum number of milliseconds between two retries. Default is `Infinity`. -* `randomize`: Randomizes the timeouts by multiplying with a factor between `1` to `2`. Default is `false`. - -The formula used to calculate the individual timeouts is: - -``` -Math.min(random * minTimeout * Math.pow(factor, attempt), maxTimeout) -``` - -Have a look at [this article][article] for a better explanation of approach. - -If you want to tune your `factor` / `times` settings to attempt the last retry -after a certain amount of time, you can use wolfram alpha. For example in order -to tune for `10` attempts in `5 minutes`, you can use this equation: - -![screenshot](https://github.com/tim-kos/node-retry/raw/master/equation.gif) - -Explaining the various values from left to right: - -* `k = 0 ... 9`: The `retries` value (10) -* `1000`: The `minTimeout` value in ms (1000) -* `x^k`: No need to change this, `x` will be your resulting factor -* `5 * 60 * 1000`: The desired total amount of time for retrying in ms (5 minutes) - -To make this a little easier for you, use wolfram alpha to do the calculations: - - - -[article]: http://dthain.blogspot.com/2009/02/exponential-backoff-in-distributed.html - -### retry.createTimeout(attempt, opts) - -Returns a new `timeout` (integer in milliseconds) based on the given parameters. - -`attempt` is an integer representing for which retry the timeout should be calculated. If your retry operation was executed 4 times you had one attempt and 3 retries. If you then want to calculate a new timeout, you should set `attempt` to 4 (attempts are zero-indexed). - -`opts` can include `factor`, `minTimeout`, `randomize` (boolean) and `maxTimeout`. They are documented above. - -`retry.createTimeout()` is used internally by `retry.timeouts()` and is public for you to be able to create your own timeouts for reinserting an item, see [issue #13](https://github.com/tim-kos/node-retry/issues/13). - -### retry.wrap(obj, [options], [methodNames]) - -Wrap all functions of the `obj` with retry. Optionally you can pass operation options and -an array of method names which need to be wrapped. - -``` -retry.wrap(obj) - -retry.wrap(obj, ['method1', 'method2']) - -retry.wrap(obj, {retries: 3}) - -retry.wrap(obj, {retries: 3}, ['method1', 'method2']) -``` -The `options` object can take any options that the usual call to `retry.operation` can take. - -### new RetryOperation(timeouts, [options]) - -Creates a new `RetryOperation` where `timeouts` is an array where each value is -a timeout given in milliseconds. - -Available options: -* `forever`: Whether to retry forever, defaults to `false`. -* `unref`: Wether to [unref](https://nodejs.org/api/timers.html#timers_unref) the setTimeout's, defaults to `false`. - -If `forever` is true, the following changes happen: -* `RetryOperation.errors()` will only output an array of one item: the last error. -* `RetryOperation` will repeatedly use the `timeouts` array. Once all of its timeouts have been used up, it restarts with the first timeout, then uses the second and so on. - -#### retryOperation.errors() - -Returns an array of all errors that have been passed to -`retryOperation.retry()` so far. - -#### retryOperation.mainError() - -A reference to the error object that occured most frequently. Errors are -compared using the `error.message` property. - -If multiple error messages occured the same amount of time, the last error -object with that message is returned. - -If no errors occured so far, the value is `null`. - -#### retryOperation.attempt(fn, timeoutOps) - -Defines the function `fn` that is to be retried and executes it for the first -time right away. The `fn` function can receive an optional `currentAttempt` callback that represents the number of attempts to execute `fn` so far. - -Optionally defines `timeoutOps` which is an object having a property `timeout` in miliseconds and a property `cb` callback function. -Whenever your retry operation takes longer than `timeout` to execute, the timeout callback function `cb` is called. - - -#### retryOperation.try(fn) - -This is an alias for `retryOperation.attempt(fn)`. This is deprecated. Please use `retryOperation.attempt(fn)` instead. - -#### retryOperation.start(fn) - -This is an alias for `retryOperation.attempt(fn)`. This is deprecated. Please use `retryOperation.attempt(fn)` instead. - -#### retryOperation.retry(error) - -Returns `false` when no `error` value is given, or the maximum amount of retries -has been reached. - -Otherwise it returns `true`, and retries the operation after the timeout for -the current attempt number. - -#### retryOperation.stop() - -Allows you to stop the operation being retried. Useful for aborting the operation on a fatal error etc. - -#### retryOperation.attempts() - -Returns an int representing the number of attempts it took to call `fn` before it was successful. - -## License - -retry is licensed under the MIT license. - - -# Changelog - -0.10.0 Adding `stop` functionality, thanks to @maxnachlinger. - -0.9.0 Adding `unref` functionality, thanks to @satazor. - -0.8.0 Implementing retry.wrap. - -0.7.0 Some bug fixes and made retry.createTimeout() public. Fixed issues [#10](https://github.com/tim-kos/node-retry/issues/10), [#12](https://github.com/tim-kos/node-retry/issues/12), and [#13](https://github.com/tim-kos/node-retry/issues/13). - -0.6.0 Introduced optional timeOps parameter for the attempt() function which is an object having a property timeout in milliseconds and a property cb callback function. Whenever your retry operation takes longer than timeout to execute, the timeout callback function cb is called. - -0.5.0 Some minor refactoring. - -0.4.0 Changed retryOperation.try() to retryOperation.attempt(). Deprecated the aliases start() and try() for it. - -0.3.0 Added retryOperation.start() which is an alias for retryOperation.try(). - -0.2.0 Added attempts() function and parameter to retryOperation.try() representing the number of attempts it took to call fn(). diff --git a/deps/npm/node_modules/promise-retry/node_modules/retry/equation.gif b/deps/npm/node_modules/promise-retry/node_modules/retry/equation.gif deleted file mode 100644 index 97107237ba19f51997d8d76135bc7d1486d856f0..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1209 zcmV;q1V;NuNk%w1VXpu&0M!5h000001ONyK2nY-a5D*X$6c88~7#JKFARr(hBp@j$ zDJd)|F)%SPG%-0iIXOHzK|n!4L_tbON=i&hQczM-RZ?16T3TINVqs!pWnyY+YHDq2 zb8&NXb#r@pdwYF*gMovCg@cQUi;Inml#!H_m6V*BoSdDUq@kpwrKGH?tgNoAw6e6c zwzR#vy}iD@#lpqK#>LIb&CSlu)za0~*45tH-rnBc=Hlk&=H~9|?(XjH_VV`j_V)k! z|NsC0EC2ui0IvWs000L6z@KnPEENVOfMTEH9c0Z7p9z3<`87kr4n!IH|Ew$buF^Tr6-3^@midQKv4UFk?fCD@~8E z@HgbfvLPrU7IV4gfp|8%C^H$l;qq zLJ;`y;|7BS2YlpEz->xcBQ#7@yHNtNkOmwQ1ek!X@sGzuLXR#jx2fyLw;309jQGe6 zL`?+$umPZ&50}J^BQGxGIN%{G2=u5hqw|pm*t2Ul0ssMk0vb%GI^lz~c)})l{~Qc?h2kCMJmBf=4KTfq+A}mV<6G&6wD3KiFu51s1j8f&fS0 zFaiqI41q&$@ZBIIl0*neBoe|cd1H+<3Zdf>DJ(#i62j@_f)Fj-_2my?IyGjQMd%>G z07WXH-J3lkxMd6n7?DE>JIL@P5d*{^#0>(>vA~&p4RL3ldlu2^8P z!OlGQ%z<|`+iWomtGr?~EJ7!(^wLZ>?ex=7N4-QZ)=BNMGD+xg!3P&;Y_%-ZByj;I zEWG$NFy8zC&JhLd@WT!ToDGaV{P^?c4^0Iv_b4i{ghbnK$GtZyTzMtL-DCey_TZ>w XwprD$S>S;MUNdg_<(OxVL=XTw-hl|W diff --git a/deps/npm/node_modules/promise-retry/node_modules/retry/example/dns.js b/deps/npm/node_modules/promise-retry/node_modules/retry/example/dns.js deleted file mode 100644 index 446729b6f9af6b..00000000000000 --- a/deps/npm/node_modules/promise-retry/node_modules/retry/example/dns.js +++ /dev/null @@ -1,31 +0,0 @@ -var dns = require('dns'); -var retry = require('../lib/retry'); - -function faultTolerantResolve(address, cb) { - var opts = { - retries: 2, - factor: 2, - minTimeout: 1 * 1000, - maxTimeout: 2 * 1000, - randomize: true - }; - var operation = retry.operation(opts); - - operation.attempt(function(currentAttempt) { - dns.resolve(address, function(err, addresses) { - if (operation.retry(err)) { - return; - } - - cb(operation.mainError(), operation.errors(), addresses); - }); - }); -} - -faultTolerantResolve('nodejs.org', function(err, errors, addresses) { - console.warn('err:'); - console.log(err); - - console.warn('addresses:'); - console.log(addresses); -}); \ No newline at end of file diff --git a/deps/npm/node_modules/promise-retry/node_modules/retry/example/stop.js b/deps/npm/node_modules/promise-retry/node_modules/retry/example/stop.js deleted file mode 100644 index e1ceafeebafc51..00000000000000 --- a/deps/npm/node_modules/promise-retry/node_modules/retry/example/stop.js +++ /dev/null @@ -1,40 +0,0 @@ -var retry = require('../lib/retry'); - -function attemptAsyncOperation(someInput, cb) { - var opts = { - retries: 2, - factor: 2, - minTimeout: 1 * 1000, - maxTimeout: 2 * 1000, - randomize: true - }; - var operation = retry.operation(opts); - - operation.attempt(function(currentAttempt) { - failingAsyncOperation(someInput, function(err, result) { - - if (err && err.message === 'A fatal error') { - operation.stop(); - return cb(err); - } - - if (operation.retry(err)) { - return; - } - - cb(operation.mainError(), operation.errors(), result); - }); - }); -} - -attemptAsyncOperation('test input', function(err, errors, result) { - console.warn('err:'); - console.log(err); - - console.warn('result:'); - console.log(result); -}); - -function failingAsyncOperation(input, cb) { - return setImmediate(cb.bind(null, new Error('A fatal error'))); -} diff --git a/deps/npm/node_modules/promise-retry/node_modules/retry/index.js b/deps/npm/node_modules/promise-retry/node_modules/retry/index.js deleted file mode 100644 index ee62f3a112c28b..00000000000000 --- a/deps/npm/node_modules/promise-retry/node_modules/retry/index.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./lib/retry'); \ No newline at end of file diff --git a/deps/npm/node_modules/promise-retry/node_modules/retry/lib/retry.js b/deps/npm/node_modules/promise-retry/node_modules/retry/lib/retry.js deleted file mode 100644 index 77428cfd0006fa..00000000000000 --- a/deps/npm/node_modules/promise-retry/node_modules/retry/lib/retry.js +++ /dev/null @@ -1,99 +0,0 @@ -var RetryOperation = require('./retry_operation'); - -exports.operation = function(options) { - var timeouts = exports.timeouts(options); - return new RetryOperation(timeouts, { - forever: options && options.forever, - unref: options && options.unref - }); -}; - -exports.timeouts = function(options) { - if (options instanceof Array) { - return [].concat(options); - } - - var opts = { - retries: 10, - factor: 2, - minTimeout: 1 * 1000, - maxTimeout: Infinity, - randomize: false - }; - for (var key in options) { - opts[key] = options[key]; - } - - if (opts.minTimeout > opts.maxTimeout) { - throw new Error('minTimeout is greater than maxTimeout'); - } - - var timeouts = []; - for (var i = 0; i < opts.retries; i++) { - timeouts.push(this.createTimeout(i, opts)); - } - - if (options && options.forever && !timeouts.length) { - timeouts.push(this.createTimeout(i, opts)); - } - - // sort the array numerically ascending - timeouts.sort(function(a,b) { - return a - b; - }); - - return timeouts; -}; - -exports.createTimeout = function(attempt, opts) { - var random = (opts.randomize) - ? (Math.random() + 1) - : 1; - - var timeout = Math.round(random * opts.minTimeout * Math.pow(opts.factor, attempt)); - timeout = Math.min(timeout, opts.maxTimeout); - - return timeout; -}; - -exports.wrap = function(obj, options, methods) { - if (options instanceof Array) { - methods = options; - options = null; - } - - if (!methods) { - methods = []; - for (var key in obj) { - if (typeof obj[key] === 'function') { - methods.push(key); - } - } - } - - for (var i = 0; i < methods.length; i++) { - var method = methods[i]; - var original = obj[method]; - - obj[method] = function retryWrapper() { - var op = exports.operation(options); - var args = Array.prototype.slice.call(arguments); - var callback = args.pop(); - - args.push(function(err) { - if (op.retry(err)) { - return; - } - if (err) { - arguments[0] = op.mainError(); - } - callback.apply(this, arguments); - }); - - op.attempt(function() { - original.apply(obj, args); - }); - }; - obj[method].options = options; - } -}; diff --git a/deps/npm/node_modules/promise-retry/node_modules/retry/lib/retry_operation.js b/deps/npm/node_modules/promise-retry/node_modules/retry/lib/retry_operation.js deleted file mode 100644 index 2b3db8e1776973..00000000000000 --- a/deps/npm/node_modules/promise-retry/node_modules/retry/lib/retry_operation.js +++ /dev/null @@ -1,143 +0,0 @@ -function RetryOperation(timeouts, options) { - // Compatibility for the old (timeouts, retryForever) signature - if (typeof options === 'boolean') { - options = { forever: options }; - } - - this._timeouts = timeouts; - this._options = options || {}; - this._fn = null; - this._errors = []; - this._attempts = 1; - this._operationTimeout = null; - this._operationTimeoutCb = null; - this._timeout = null; - - if (this._options.forever) { - this._cachedTimeouts = this._timeouts.slice(0); - } -} -module.exports = RetryOperation; - -RetryOperation.prototype.stop = function() { - if (this._timeout) { - clearTimeout(this._timeout); - } - - this._timeouts = []; - this._cachedTimeouts = null; -}; - -RetryOperation.prototype.retry = function(err) { - if (this._timeout) { - clearTimeout(this._timeout); - } - - if (!err) { - return false; - } - - this._errors.push(err); - - var timeout = this._timeouts.shift(); - if (timeout === undefined) { - if (this._cachedTimeouts) { - // retry forever, only keep last error - this._errors.splice(this._errors.length - 1, this._errors.length); - this._timeouts = this._cachedTimeouts.slice(0); - timeout = this._timeouts.shift(); - } else { - return false; - } - } - - var self = this; - var timer = setTimeout(function() { - self._attempts++; - - if (self._operationTimeoutCb) { - self._timeout = setTimeout(function() { - self._operationTimeoutCb(self._attempts); - }, self._operationTimeout); - - if (this._options.unref) { - self._timeout.unref(); - } - } - - self._fn(self._attempts); - }, timeout); - - if (this._options.unref) { - timer.unref(); - } - - return true; -}; - -RetryOperation.prototype.attempt = function(fn, timeoutOps) { - this._fn = fn; - - if (timeoutOps) { - if (timeoutOps.timeout) { - this._operationTimeout = timeoutOps.timeout; - } - if (timeoutOps.cb) { - this._operationTimeoutCb = timeoutOps.cb; - } - } - - var self = this; - if (this._operationTimeoutCb) { - this._timeout = setTimeout(function() { - self._operationTimeoutCb(); - }, self._operationTimeout); - } - - this._fn(this._attempts); -}; - -RetryOperation.prototype.try = function(fn) { - console.log('Using RetryOperation.try() is deprecated'); - this.attempt(fn); -}; - -RetryOperation.prototype.start = function(fn) { - console.log('Using RetryOperation.start() is deprecated'); - this.attempt(fn); -}; - -RetryOperation.prototype.start = RetryOperation.prototype.try; - -RetryOperation.prototype.errors = function() { - return this._errors; -}; - -RetryOperation.prototype.attempts = function() { - return this._attempts; -}; - -RetryOperation.prototype.mainError = function() { - if (this._errors.length === 0) { - return null; - } - - var counts = {}; - var mainError = null; - var mainErrorCount = 0; - - for (var i = 0; i < this._errors.length; i++) { - var error = this._errors[i]; - var message = error.message; - var count = (counts[message] || 0) + 1; - - counts[message] = count; - - if (count >= mainErrorCount) { - mainError = error; - mainErrorCount = count; - } - } - - return mainError; -}; diff --git a/deps/npm/node_modules/promise-retry/node_modules/retry/package.json b/deps/npm/node_modules/promise-retry/node_modules/retry/package.json deleted file mode 100644 index 7d6b1f99f54dc0..00000000000000 --- a/deps/npm/node_modules/promise-retry/node_modules/retry/package.json +++ /dev/null @@ -1,56 +0,0 @@ -{ - "_from": "retry@^0.10.0", - "_id": "retry@0.10.1", - "_inBundle": false, - "_integrity": "sha1-52OI0heZLCUnUCQdPTlW/tmNj/Q=", - "_location": "/promise-retry/retry", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "retry@^0.10.0", - "name": "retry", - "escapedName": "retry", - "rawSpec": "^0.10.0", - "saveSpec": null, - "fetchSpec": "^0.10.0" - }, - "_requiredBy": [ - "/promise-retry" - ], - "_resolved": "https://registry.npmjs.org/retry/-/retry-0.10.1.tgz", - "_shasum": "e76388d217992c252750241d3d3956fed98d8ff4", - "_spec": "retry@^0.10.0", - "_where": "/Users/rebecca/code/npm/node_modules/promise-retry", - "author": { - "name": "Tim Koschützki", - "email": "tim@debuggable.com", - "url": "http://debuggable.com/" - }, - "bugs": { - "url": "https://github.com/tim-kos/node-retry/issues" - }, - "bundleDependencies": false, - "dependencies": {}, - "deprecated": false, - "description": "Abstraction for exponential and custom retry strategies for failed operations.", - "devDependencies": { - "fake": "0.2.0", - "far": "0.0.1" - }, - "directories": { - "lib": "./lib" - }, - "engines": { - "node": "*" - }, - "homepage": "https://github.com/tim-kos/node-retry", - "license": "MIT", - "main": "index", - "name": "retry", - "repository": { - "type": "git", - "url": "git://github.com/tim-kos/node-retry.git" - }, - "version": "0.10.1" -} diff --git a/deps/npm/node_modules/promise-retry/node_modules/retry/test/common.js b/deps/npm/node_modules/promise-retry/node_modules/retry/test/common.js deleted file mode 100644 index 224720696ebac8..00000000000000 --- a/deps/npm/node_modules/promise-retry/node_modules/retry/test/common.js +++ /dev/null @@ -1,10 +0,0 @@ -var common = module.exports; -var path = require('path'); - -var rootDir = path.join(__dirname, '..'); -common.dir = { - lib: rootDir + '/lib' -}; - -common.assert = require('assert'); -common.fake = require('fake'); \ No newline at end of file diff --git a/deps/npm/node_modules/promise-retry/node_modules/retry/test/integration/test-forever.js b/deps/npm/node_modules/promise-retry/node_modules/retry/test/integration/test-forever.js deleted file mode 100644 index b41307cb529f12..00000000000000 --- a/deps/npm/node_modules/promise-retry/node_modules/retry/test/integration/test-forever.js +++ /dev/null @@ -1,24 +0,0 @@ -var common = require('../common'); -var assert = common.assert; -var retry = require(common.dir.lib + '/retry'); - -(function testForeverUsesFirstTimeout() { - var operation = retry.operation({ - retries: 0, - minTimeout: 100, - maxTimeout: 100, - forever: true - }); - - operation.attempt(function(numAttempt) { - console.log('>numAttempt', numAttempt); - var err = new Error("foo"); - if (numAttempt == 10) { - operation.stop(); - } - - if (operation.retry(err)) { - return; - } - }); -})(); diff --git a/deps/npm/node_modules/promise-retry/node_modules/retry/test/integration/test-retry-operation.js b/deps/npm/node_modules/promise-retry/node_modules/retry/test/integration/test-retry-operation.js deleted file mode 100644 index 916936424f073b..00000000000000 --- a/deps/npm/node_modules/promise-retry/node_modules/retry/test/integration/test-retry-operation.js +++ /dev/null @@ -1,176 +0,0 @@ -var common = require('../common'); -var assert = common.assert; -var fake = common.fake.create(); -var retry = require(common.dir.lib + '/retry'); - -(function testErrors() { - var operation = retry.operation(); - - var error = new Error('some error'); - var error2 = new Error('some other error'); - operation._errors.push(error); - operation._errors.push(error2); - - assert.deepEqual(operation.errors(), [error, error2]); -})(); - -(function testMainErrorReturnsMostFrequentError() { - var operation = retry.operation(); - var error = new Error('some error'); - var error2 = new Error('some other error'); - - operation._errors.push(error); - operation._errors.push(error2); - operation._errors.push(error); - - assert.strictEqual(operation.mainError(), error); -})(); - -(function testMainErrorReturnsLastErrorOnEqualCount() { - var operation = retry.operation(); - var error = new Error('some error'); - var error2 = new Error('some other error'); - - operation._errors.push(error); - operation._errors.push(error2); - - assert.strictEqual(operation.mainError(), error2); -})(); - -(function testAttempt() { - var operation = retry.operation(); - var fn = new Function(); - - var timeoutOpts = { - timeout: 1, - cb: function() {} - }; - operation.attempt(fn, timeoutOpts); - - assert.strictEqual(fn, operation._fn); - assert.strictEqual(timeoutOpts.timeout, operation._operationTimeout); - assert.strictEqual(timeoutOpts.cb, operation._operationTimeoutCb); -})(); - -(function testRetry() { - var times = 3; - var error = new Error('some error'); - var operation = retry.operation([1, 2, 3]); - var attempts = 0; - - var finalCallback = fake.callback('finalCallback'); - fake.expectAnytime(finalCallback); - - var fn = function() { - operation.attempt(function(currentAttempt) { - attempts++; - assert.equal(currentAttempt, attempts); - if (operation.retry(error)) { - return; - } - - assert.strictEqual(attempts, 4); - assert.strictEqual(operation.attempts(), attempts); - assert.strictEqual(operation.mainError(), error); - finalCallback(); - }); - }; - - fn(); -})(); - -(function testRetryForever() { - var error = new Error('some error'); - var operation = retry.operation({ retries: 3, forever: true }); - var attempts = 0; - - var finalCallback = fake.callback('finalCallback'); - fake.expectAnytime(finalCallback); - - var fn = function() { - operation.attempt(function(currentAttempt) { - attempts++; - assert.equal(currentAttempt, attempts); - if (attempts !== 6 && operation.retry(error)) { - return; - } - - assert.strictEqual(attempts, 6); - assert.strictEqual(operation.attempts(), attempts); - assert.strictEqual(operation.mainError(), error); - finalCallback(); - }); - }; - - fn(); -})(); - -(function testRetryForeverNoRetries() { - var error = new Error('some error'); - var delay = 50 - var operation = retry.operation({ - retries: null, - forever: true, - minTimeout: delay, - maxTimeout: delay - }); - - var attempts = 0; - var startTime = new Date().getTime(); - - var finalCallback = fake.callback('finalCallback'); - fake.expectAnytime(finalCallback); - - var fn = function() { - operation.attempt(function(currentAttempt) { - attempts++; - assert.equal(currentAttempt, attempts); - if (attempts !== 4 && operation.retry(error)) { - return; - } - - var endTime = new Date().getTime(); - var minTime = startTime + (delay * 3); - var maxTime = minTime + 20 // add a little headroom for code execution time - assert(endTime > minTime) - assert(endTime < maxTime) - assert.strictEqual(attempts, 4); - assert.strictEqual(operation.attempts(), attempts); - assert.strictEqual(operation.mainError(), error); - finalCallback(); - }); - }; - - fn(); -})(); - -(function testStop() { - var error = new Error('some error'); - var operation = retry.operation([1, 2, 3]); - var attempts = 0; - - var finalCallback = fake.callback('finalCallback'); - fake.expectAnytime(finalCallback); - - var fn = function() { - operation.attempt(function(currentAttempt) { - attempts++; - assert.equal(currentAttempt, attempts); - - if (attempts === 2) { - operation.stop(); - - assert.strictEqual(attempts, 2); - assert.strictEqual(operation.attempts(), attempts); - assert.strictEqual(operation.mainError(), error); - finalCallback(); - } - - if (operation.retry(error)) { - return; - } - }); - }; - - fn(); -})(); diff --git a/deps/npm/node_modules/promise-retry/node_modules/retry/test/integration/test-retry-wrap.js b/deps/npm/node_modules/promise-retry/node_modules/retry/test/integration/test-retry-wrap.js deleted file mode 100644 index 7ca8bc7eb596b5..00000000000000 --- a/deps/npm/node_modules/promise-retry/node_modules/retry/test/integration/test-retry-wrap.js +++ /dev/null @@ -1,77 +0,0 @@ -var common = require('../common'); -var assert = common.assert; -var fake = common.fake.create(); -var retry = require(common.dir.lib + '/retry'); - -function getLib() { - return { - fn1: function() {}, - fn2: function() {}, - fn3: function() {} - }; -} - -(function wrapAll() { - var lib = getLib(); - retry.wrap(lib); - assert.equal(lib.fn1.name, 'retryWrapper'); - assert.equal(lib.fn2.name, 'retryWrapper'); - assert.equal(lib.fn3.name, 'retryWrapper'); -}()); - -(function wrapAllPassOptions() { - var lib = getLib(); - retry.wrap(lib, {retries: 2}); - assert.equal(lib.fn1.name, 'retryWrapper'); - assert.equal(lib.fn2.name, 'retryWrapper'); - assert.equal(lib.fn3.name, 'retryWrapper'); - assert.equal(lib.fn1.options.retries, 2); - assert.equal(lib.fn2.options.retries, 2); - assert.equal(lib.fn3.options.retries, 2); -}()); - -(function wrapDefined() { - var lib = getLib(); - retry.wrap(lib, ['fn2', 'fn3']); - assert.notEqual(lib.fn1.name, 'retryWrapper'); - assert.equal(lib.fn2.name, 'retryWrapper'); - assert.equal(lib.fn3.name, 'retryWrapper'); -}()); - -(function wrapDefinedAndPassOptions() { - var lib = getLib(); - retry.wrap(lib, {retries: 2}, ['fn2', 'fn3']); - assert.notEqual(lib.fn1.name, 'retryWrapper'); - assert.equal(lib.fn2.name, 'retryWrapper'); - assert.equal(lib.fn3.name, 'retryWrapper'); - assert.equal(lib.fn2.options.retries, 2); - assert.equal(lib.fn3.options.retries, 2); -}()); - -(function runWrappedWithoutError() { - var callbackCalled; - var lib = {method: function(a, b, callback) { - assert.equal(a, 1); - assert.equal(b, 2); - assert.equal(typeof callback, 'function'); - callback(); - }}; - retry.wrap(lib); - lib.method(1, 2, function() { - callbackCalled = true; - }); - assert.ok(callbackCalled); -}()); - -(function runWrappedWithError() { - var callbackCalled; - var lib = {method: function(callback) { - callback(new Error('Some error')); - }}; - retry.wrap(lib, {retries: 1}); - lib.method(function(err) { - callbackCalled = true; - assert.ok(err instanceof Error); - }); - assert.ok(!callbackCalled); -}()); diff --git a/deps/npm/node_modules/promise-retry/node_modules/retry/test/integration/test-timeouts.js b/deps/npm/node_modules/promise-retry/node_modules/retry/test/integration/test-timeouts.js deleted file mode 100644 index 7206b0fb0b01d0..00000000000000 --- a/deps/npm/node_modules/promise-retry/node_modules/retry/test/integration/test-timeouts.js +++ /dev/null @@ -1,69 +0,0 @@ -var common = require('../common'); -var assert = common.assert; -var retry = require(common.dir.lib + '/retry'); - -(function testDefaultValues() { - var timeouts = retry.timeouts(); - - assert.equal(timeouts.length, 10); - assert.equal(timeouts[0], 1000); - assert.equal(timeouts[1], 2000); - assert.equal(timeouts[2], 4000); -})(); - -(function testDefaultValuesWithRandomize() { - var minTimeout = 5000; - var timeouts = retry.timeouts({ - minTimeout: minTimeout, - randomize: true - }); - - assert.equal(timeouts.length, 10); - assert.ok(timeouts[0] > minTimeout); - assert.ok(timeouts[1] > timeouts[0]); - assert.ok(timeouts[2] > timeouts[1]); -})(); - -(function testPassedTimeoutsAreUsed() { - var timeoutsArray = [1000, 2000, 3000]; - var timeouts = retry.timeouts(timeoutsArray); - assert.deepEqual(timeouts, timeoutsArray); - assert.notStrictEqual(timeouts, timeoutsArray); -})(); - -(function testTimeoutsAreWithinBoundaries() { - var minTimeout = 1000; - var maxTimeout = 10000; - var timeouts = retry.timeouts({ - minTimeout: minTimeout, - maxTimeout: maxTimeout - }); - for (var i = 0; i < timeouts; i++) { - assert.ok(timeouts[i] >= minTimeout); - assert.ok(timeouts[i] <= maxTimeout); - } -})(); - -(function testTimeoutsAreIncremental() { - var timeouts = retry.timeouts(); - var lastTimeout = timeouts[0]; - for (var i = 0; i < timeouts; i++) { - assert.ok(timeouts[i] > lastTimeout); - lastTimeout = timeouts[i]; - } -})(); - -(function testTimeoutsAreIncrementalForFactorsLessThanOne() { - var timeouts = retry.timeouts({ - retries: 3, - factor: 0.5 - }); - - var expected = [250, 500, 1000]; - assert.deepEqual(expected, timeouts); -})(); - -(function testRetries() { - var timeouts = retry.timeouts({retries: 2}); - assert.strictEqual(timeouts.length, 2); -})(); diff --git a/deps/npm/node_modules/promise-retry/package.json b/deps/npm/node_modules/promise-retry/package.json index 1e2f40d71a0447..4292524ab5380c 100644 --- a/deps/npm/node_modules/promise-retry/package.json +++ b/deps/npm/node_modules/promise-retry/package.json @@ -1,54 +1,18 @@ { - "_from": "promise-retry@^1.1.1", - "_id": "promise-retry@1.1.1", - "_inBundle": false, - "_integrity": "sha1-ZznpaOMFHaIM5kl/srUPaRHfPW0=", - "_location": "/promise-retry", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "promise-retry@^1.1.1", - "name": "promise-retry", - "escapedName": "promise-retry", - "rawSpec": "^1.1.1", - "saveSpec": null, - "fetchSpec": "^1.1.1" - }, - "_requiredBy": [ - "/make-fetch-happen", - "/npm-profile/make-fetch-happen", - "/npm-registry-fetch/make-fetch-happen", - "/pacote" - ], - "_resolved": "https://registry.npmjs.org/promise-retry/-/promise-retry-1.1.1.tgz", - "_shasum": "6739e968e3051da20ce6497fb2b50f6911df3d6d", - "_spec": "promise-retry@^1.1.1", - "_where": "/Users/rebecca/code/npm/node_modules/pacote", - "author": { - "name": "IndigoUnited", - "email": "hello@indigounited.com", - "url": "http://indigounited.com" + "name": "promise-retry", + "version": "1.1.1", + "description": "Retries a function that returns a promise, leveraging the power of the retry module.", + "main": "index.js", + "scripts": { + "test": "mocha --bail -t 10000" }, "bugs": { "url": "https://github.com/IndigoUnited/node-promise-retry/issues/" }, - "bundleDependencies": false, - "dependencies": { - "err-code": "^1.0.0", - "retry": "^0.10.0" - }, - "deprecated": false, - "description": "Retries a function that returns a promise, leveraging the power of the retry module.", - "devDependencies": { - "expect.js": "^0.3.1", - "mocha": "^3.0.0", - "sleep-promise": "^2.0.0" - }, - "engines": { - "node": ">=0.12" + "repository": { + "type": "git", + "url": "git://github.com/IndigoUnited/node-promise-retry.git" }, - "homepage": "https://github.com/IndigoUnited/node-promise-retry#readme", "keywords": [ "retry", "promise", @@ -56,15 +20,18 @@ "repeat", "replay" ], + "author": "IndigoUnited (http://indigounited.com)", "license": "MIT", - "main": "index.js", - "name": "promise-retry", - "repository": { - "type": "git", - "url": "git://github.com/IndigoUnited/node-promise-retry.git" + "devDependencies": { + "expect.js": "^0.3.1", + "mocha": "^3.0.0", + "sleep-promise": "^2.0.0" }, - "scripts": { - "test": "mocha --bail -t 10000" + "dependencies": { + "err-code": "^1.0.0", + "retry": "^0.10.0" }, - "version": "1.1.1" + "engines": { + "node": ">=0.12" + } } diff --git a/deps/npm/node_modules/promzard/package.json b/deps/npm/node_modules/promzard/package.json index dcc05e8dd1c1bd..77e3bd65513c92 100644 --- a/deps/npm/node_modules/promzard/package.json +++ b/deps/npm/node_modules/promzard/package.json @@ -1,53 +1,20 @@ { - "_from": "promzard@^0.3.0", - "_id": "promzard@0.3.0", - "_inBundle": false, - "_integrity": "sha1-JqXW7ox97kyxIggwWs+5O6OCqe4=", - "_location": "/promzard", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "promzard@^0.3.0", - "name": "promzard", - "escapedName": "promzard", - "rawSpec": "^0.3.0", - "saveSpec": null, - "fetchSpec": "^0.3.0" - }, - "_requiredBy": [ - "/init-package-json" - ], - "_resolved": "https://registry.npmjs.org/promzard/-/promzard-0.3.0.tgz", - "_shasum": "26a5d6ee8c7dee4cb12208305acfb93ba382a9ee", - "_spec": "promzard@^0.3.0", - "_where": "/Users/rebecca/code/npm/node_modules/init-package-json", - "author": { - "name": "Isaac Z. Schlueter", - "email": "i@izs.me", - "url": "http://blog.izs.me/" - }, - "bugs": { - "url": "https://github.com/isaacs/promzard/issues" + "author": "Isaac Z. Schlueter (http://blog.izs.me/)", + "name": "promzard", + "description": "prompting wizardly", + "version": "0.3.0", + "repository": { + "url": "git://github.com/isaacs/promzard" }, - "bundleDependencies": false, "dependencies": { "read": "1" }, - "deprecated": false, - "description": "prompting wizardly", "devDependencies": { "tap": "~0.2.5" }, - "homepage": "https://github.com/isaacs/promzard#readme", - "license": "ISC", "main": "promzard.js", - "name": "promzard", - "repository": { - "url": "git://github.com/isaacs/promzard.git" - }, "scripts": { "test": "tap test/*.js" }, - "version": "0.3.0" + "license": "ISC" } diff --git a/deps/npm/node_modules/proto-list/README.md b/deps/npm/node_modules/proto-list/README.md deleted file mode 100644 index 43cfa35893d8b0..00000000000000 --- a/deps/npm/node_modules/proto-list/README.md +++ /dev/null @@ -1,3 +0,0 @@ -A list of objects, bound by their prototype chain. - -Used in npm's config stuff. diff --git a/deps/npm/node_modules/proto-list/package.json b/deps/npm/node_modules/proto-list/package.json deleted file mode 100644 index 84c735f6b2dbb0..00000000000000 --- a/deps/npm/node_modules/proto-list/package.json +++ /dev/null @@ -1,51 +0,0 @@ -{ - "_from": "proto-list@~1.2.1", - "_id": "proto-list@1.2.4", - "_inBundle": false, - "_integrity": "sha1-IS1b/hMYMGpCD2QCuOJv85ZHqEk=", - "_location": "/proto-list", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "proto-list@~1.2.1", - "name": "proto-list", - "escapedName": "proto-list", - "rawSpec": "~1.2.1", - "saveSpec": null, - "fetchSpec": "~1.2.1" - }, - "_requiredBy": [ - "/config-chain" - ], - "_resolved": "https://registry.npmjs.org/proto-list/-/proto-list-1.2.4.tgz", - "_shasum": "212d5bfe1318306a420f6402b8e26ff39647a849", - "_spec": "proto-list@~1.2.1", - "_where": "/Users/rebecca/code/npm/node_modules/config-chain", - "author": { - "name": "Isaac Z. Schlueter", - "email": "i@izs.me", - "url": "http://blog.izs.me/" - }, - "bugs": { - "url": "https://github.com/isaacs/proto-list/issues" - }, - "bundleDependencies": false, - "deprecated": false, - "description": "A utility for managing a prototype chain", - "devDependencies": { - "tap": "0" - }, - "homepage": "https://github.com/isaacs/proto-list#readme", - "license": "ISC", - "main": "./proto-list.js", - "name": "proto-list", - "repository": { - "type": "git", - "url": "git+https://github.com/isaacs/proto-list.git" - }, - "scripts": { - "test": "tap test/*.js" - }, - "version": "1.2.4" -} diff --git a/deps/npm/node_modules/proto-list/proto-list.js b/deps/npm/node_modules/proto-list/proto-list.js deleted file mode 100644 index b55c25c052f223..00000000000000 --- a/deps/npm/node_modules/proto-list/proto-list.js +++ /dev/null @@ -1,88 +0,0 @@ - -module.exports = ProtoList - -function setProto(obj, proto) { - if (typeof Object.setPrototypeOf === "function") - return Object.setPrototypeOf(obj, proto) - else - obj.__proto__ = proto -} - -function ProtoList () { - this.list = [] - var root = null - Object.defineProperty(this, 'root', { - get: function () { return root }, - set: function (r) { - root = r - if (this.list.length) { - setProto(this.list[this.list.length - 1], r) - } - }, - enumerable: true, - configurable: true - }) -} - -ProtoList.prototype = - { get length () { return this.list.length } - , get keys () { - var k = [] - for (var i in this.list[0]) k.push(i) - return k - } - , get snapshot () { - var o = {} - this.keys.forEach(function (k) { o[k] = this.get(k) }, this) - return o - } - , get store () { - return this.list[0] - } - , push : function (obj) { - if (typeof obj !== "object") obj = {valueOf:obj} - if (this.list.length >= 1) { - setProto(this.list[this.list.length - 1], obj) - } - setProto(obj, this.root) - return this.list.push(obj) - } - , pop : function () { - if (this.list.length >= 2) { - setProto(this.list[this.list.length - 2], this.root) - } - return this.list.pop() - } - , unshift : function (obj) { - setProto(obj, this.list[0] || this.root) - return this.list.unshift(obj) - } - , shift : function () { - if (this.list.length === 1) { - setProto(this.list[0], this.root) - } - return this.list.shift() - } - , get : function (key) { - return this.list[0][key] - } - , set : function (key, val, save) { - if (!this.length) this.push({}) - if (save && this.list[0].hasOwnProperty(key)) this.push({}) - return this.list[0][key] = val - } - , forEach : function (fn, thisp) { - for (var key in this.list[0]) fn.call(thisp, key, this.list[0][key]) - } - , slice : function () { - return this.list.slice.apply(this.list, arguments) - } - , splice : function () { - // handle injections - var ret = this.list.splice.apply(this.list, arguments) - for (var i = 0, l = this.list.length; i < l; i++) { - setProto(this.list[i], this.list[i + 1] || this.root) - } - return ret - } - } diff --git a/deps/npm/node_modules/proto-list/test/basic.js b/deps/npm/node_modules/proto-list/test/basic.js deleted file mode 100644 index 5cd66bef157047..00000000000000 --- a/deps/npm/node_modules/proto-list/test/basic.js +++ /dev/null @@ -1,61 +0,0 @@ -var tap = require("tap") - , test = tap.test - , ProtoList = require("../proto-list.js") - -tap.plan(1) - -tap.test("protoList tests", function (t) { - var p = new ProtoList - p.push({foo:"bar"}) - p.push({}) - p.set("foo", "baz") - t.equal(p.get("foo"), "baz") - - var p = new ProtoList - p.push({foo:"bar"}) - p.set("foo", "baz") - t.equal(p.get("foo"), "baz") - t.equal(p.length, 1) - p.pop() - t.equal(p.length, 0) - p.set("foo", "asdf") - t.equal(p.length, 1) - t.equal(p.get("foo"), "asdf") - p.push({bar:"baz"}) - t.equal(p.length, 2) - t.equal(p.get("foo"), "asdf") - p.shift() - t.equal(p.length, 1) - t.equal(p.get("foo"), undefined) - - - p.unshift({foo:"blo", bar:"rab"}) - p.unshift({foo:"boo"}) - t.equal(p.length, 3) - t.equal(p.get("foo"), "boo") - t.equal(p.get("bar"), "rab") - - var ret = p.splice(1, 1, {bar:"bar"}) - t.same(ret, [{foo:"blo", bar:"rab"}]) - t.equal(p.get("bar"), "bar") - - // should not inherit default object properties - t.equal(p.get('hasOwnProperty'), undefined) - - // unless we give it those. - p.root = {} - t.equal(p.get('hasOwnProperty'), {}.hasOwnProperty) - - p.root = {default:'monkey'} - t.equal(p.get('default'), 'monkey') - - p.push({red:'blue'}) - p.push({red:'blue'}) - p.push({red:'blue'}) - while (p.length) { - t.equal(p.get('default'), 'monkey') - p.shift() - } - - t.end() -}) diff --git a/deps/npm/node_modules/protoduck/CHANGELOG.md b/deps/npm/node_modules/protoduck/CHANGELOG.md deleted file mode 100644 index f4902ab2d02672..00000000000000 --- a/deps/npm/node_modules/protoduck/CHANGELOG.md +++ /dev/null @@ -1,66 +0,0 @@ -# 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. - - -## [5.0.1](https://github.com/zkat/protoduck/compare/v5.0.0...v5.0.1) (2018-10-26) - - -### Bug Fixes - -* **security:** npm audit fix ([55a2007](https://github.com/zkat/protoduck/commit/55a2007)) -* **standard:** standard --fix ([2dedbb8](https://github.com/zkat/protoduck/commit/2dedbb8)) - - - - -# [5.0.0](https://github.com/zkat/protoduck/compare/v4.0.0...v5.0.0) (2017-12-12) - - -### Bug Fixes - -* **license:** relicense to MIT ([55cdd89](https://github.com/zkat/protoduck/commit/55cdd89)) -* **platforms:** drop support for node 4 and 7 ([07a19b1](https://github.com/zkat/protoduck/commit/07a19b1)) - - -### BREAKING CHANGES - -* **platforms:** node 4 and node 7 are no longer officially supported -* **license:** license changed from CC0-1.0 to MIT - - - - -# [4.0.0](https://github.com/zkat/protoduck/compare/v3.3.2...v4.0.0) (2017-04-17) - - -### Bug Fixes - -* **test:** .name is inconsistently available ([3483f4a](https://github.com/zkat/protoduck/commit/3483f4a)) - - -### Features - -* **api:** Fresh New API™ ([#2](https://github.com/zkat/protoduck/issues/2)) ([534e5cf](https://github.com/zkat/protoduck/commit/534e5cf)) -* **constraints:** added optional where-constraints ([16ad124](https://github.com/zkat/protoduck/commit/16ad124)) -* **defaults:** allow default impls without arrays in defs ([6cf7d84](https://github.com/zkat/protoduck/commit/6cf7d84)) -* **deps:** use genfun[@4](https://github.com/4) ([f6810a7](https://github.com/zkat/protoduck/commit/f6810a7)) -* **meta:** bringing project stuff up to date ([61791da](https://github.com/zkat/protoduck/commit/61791da)) - - -### BREAKING CHANGES - -* **api:** The API was significantly overhauled. - -* New protocol creating is now through protoduck.define() instead of protoduck() -* Implementations are through Duck#impl instead of Duck(...) -* The `private` option was removed -* Static protocols were removed -- only method-style protocols are available now. -* As part of that: the target argument to impl can no longer be omitted -* The main export object is now the metaobject. protoduck.impl can be used to extend to MOP -* .isDerivable is now a property on Duck instances, not a static method -* .hasImpl is now a method on Duck instances, not a static method -* Protoduck will now genfunnify existing functions as default methods for genfuns declared in a protocol when implementing -* Error messages have been overhauled to be more helpful -* **deps:** nextMethod is now an extra argument to methods -* **meta:** node@<4 is no longer supported diff --git a/deps/npm/node_modules/protoduck/LICENSE b/deps/npm/node_modules/protoduck/LICENSE deleted file mode 100644 index ab41caa64b86cf..00000000000000 --- a/deps/npm/node_modules/protoduck/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) -Copyright (c) 2017 Kat Marchán - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE -OR OTHER DEALINGS IN THE SOFTWARE. - diff --git a/deps/npm/node_modules/protoduck/README.md b/deps/npm/node_modules/protoduck/README.md deleted file mode 100644 index 2dc70a3071569c..00000000000000 --- a/deps/npm/node_modules/protoduck/README.md +++ /dev/null @@ -1,346 +0,0 @@ -# protoduck [![npm version](https://img.shields.io/npm/v/protoduck.svg)](https://npm.im/protoduck) [![license](https://img.shields.io/npm/l/protoduck.svg)](https://npm.im/protoduck) [![Travis](https://img.shields.io/travis/zkat/protoduck.svg)](https://travis-ci.org/zkat/protoduck) [![AppVeyor](https://ci.appveyor.com/api/projects/status/github/zkat/protoduck?svg=true)](https://ci.appveyor.com/project/zkat/protoduck) [![Coverage Status](https://coveralls.io/repos/github/zkat/protoduck/badge.svg?branch=latest)](https://coveralls.io/github/zkat/protoduck?branch=latest) - -[`protoduck`](https://github.com/zkat/protoduck) is a JavaScript library is a -library for making groups of methods, called "protocols". - -If you're familiar with the concept of ["duck -typing"](https://en.wikipedia.org/wiki/Duck_typing), then it might make sense to -think of protocols as things that explicitly define what methods you need in -order to "clearly be a duck". - -## Install - -`$ npm install -S protoduck` - -## Table of Contents - -* [Example](#example) -* [Features](#features) -* [Guide](#guide) - * [Introduction](#introduction) - * [Defining protocols](#defining-protocols) - * [Implementations](#protocol-impls) - * [Multiple dispatch](#multiple-dispatch) - * [Constraints](#constraints) -* [API](#api) - * [`define()`](#define) - * [`proto.impl()`](#impl) - -### Example - -```javascript -const protoduck = require('protoduck') - -// Quackable is a protocol that defines three methods -const Quackable = protoduck.define({ - walk: [], - talk: [], - isADuck: [() => true] // default implementation -- it's optional! -}) - -// `duck` must implement `Quackable` for this function to work. It doesn't -// matter what type or class duck is, as long as it implements Quackable. -function doStuffToDucks (duck) { - if (!duck.isADuck()) { - throw new Error('I want a duck!') - } else { - console.log(duck.walk()) - console.log(duck.talk()) - } -} - -// ...In a different package: -const ducks = require('./ducks') - -class Duck () {} - -// Implement the protocol on the Duck class. -ducks.Quackable.impl(Duck, { - walk () { return "*hobble hobble*" } - talk () { return "QUACK QUACK" } -}) - -// main.js -ducks.doStuffToDucks(new Duck()) // works! -``` - -### Features - -* Verifies implementations in case methods are missing or wrong ones added -* Helpful, informative error messages -* Optional default method implementations -* Fresh JavaScript Feel™ -- methods work just like native methods when called -* Methods can dispatch on arguments, not just `this` ([multimethods](https://npm.im/genfun)) -* Type constraints - -### Guide - -#### Introduction - -Like most Object-oriented languages, JavaScript comes with its own way of -defining methods: You simply add regular `function`s as properties to regular -objects, and when you do `obj.method()`, it calls the right code! ES6/ES2015 -further extended this by adding a `class` syntax that allowed this same system -to work with more familiar syntax sugar: `class Foo { method() { ... } }`. - -The point of "protocols" is to have a more explicit definitions of what methods -"go together". That is, a protocol is a description of a type of object your -code interacts with. If someone passes an object into your library, and it fits -your defined protocol, the assumption is that the object will work just as well. - -Duck typing is a common term for this sort of thing: If it walks like a duck, -and it talks like a duck, then it may as well be a duck, as far as any of our -code is concerned. - -Many other languages have similar or identical concepts under different names: -Java's interfaces, Haskell's typeclasses, Rust's traits. Elixir and Clojure both -call them "protocols" as well. - -One big advantage to using these protocols is that they let users define their -own versions of some abstraction, without requiring the type to inherit from -another -- protocols are independent of inheritance, even though they're able to -work together with it. If you've ever found yourself in some sort of inheritance -mess, this is exactly the sort of thing you use to escape it. - -#### Defining Protocols - -The first step to using `protoduck` is to define a protocol. Protocol -definitions look like this: - -```javascript -// import the library first! -const protoduck = require('protoduck') - -// `Ducklike` is the name of our protocol. It defines what it means for -// something to be "like a duck", as far as our code is concerned. -const Ducklike = protoduck.define([], { - walk: [], // This says that the protocol requires a "walk" method. - talk: [] // and ducks also need to talk - peck: [] // and they can even be pretty scary -}) -``` - -Protocols by themselves don't really *do* anything, they simply define what -methods are included in the protocol, and thus what will need to be implemented. - -#### Protocol Impls - -The simplest type of definitions for protocols are as regular methods. In this -style, protocols end up working exactly like normal JavaScript methods: they're -added as properties of the target type/object, and we call them using the -`foo.method()` syntax. `this` is accessible inside the methods, as usual. - -Implementation syntax is very similar to protocol definitions, using `.impl`: - -```javascript -class Dog {} - -// Implementing `Ducklike` for `Dog`s -Ducklike.impl(Dog, [], { - walk () { return '*pads on all fours*' } - talk () { return 'woof woof. I mean "quack" >_>' } - peck (victim) { return 'Can I just bite ' + victim + ' instead?...' } -}) -``` - -So now, our `Dog` class has two extra methods: `walk`, and `talk`, and we can -just call them: - -```javascript -const pupper = new Dog() - -pupper.walk() // *pads on all fours* -pupper.talk() // woof woof. I mean "quack" >_> -pupper.peck('this string') // Can I just bite this string instead?... -``` - -#### Multiple Dispatch - -You may have noticed before that we have these `[]` in various places that don't -seem to have any obvious purpose. - -These arrays allow protocols to be implemented not just for a single value of -`this`, but across *all arguments*. That is, you can have methods in these -protocols that use both `this`, and the first argument (or any other arguments) -in order to determine what code to actually execute. - -This type of method is called a multimethod, and is one of the differences -between protoduck and the default `class` syntax. - -To use it: in the protocol *definitions*, you put matching -strings in different spots where those empty arrays were, and when you -*implement* the protocol, you give the definition the actual types/objects you -want to implement it on, and it takes care of mapping types to the strings you -defined, and making sure the right code is run: - -```javascript -const Playful = protoduck.define(['friend'], {// <---\ - playWith: ['friend'] // <------------ these correspond to each other -}) - -class Cat {} -class Human {} -class Dog {} - -// The first protocol is for Cat/Human combination -Playful.impl(Cat, [Human], { - playWith (human) { - return '*headbutt* *purr* *cuddle* omg ilu, ' + human.name - } -}) - -// And we define it *again* for a different combination -Playful.impl(Cat, [Dog], { - playWith (dog) { - return '*scratches* *hisses* omg i h8 u, ' + dog.name - } -}) - -// depending on what you call it with, it runs different methods: -const cat = new Cat() -const human = new Human() -const dog = new Dog() - -cat.playWith(human) // *headbutt* *purr* *cuddle* omg ilu, Sam -cat.playWith(dog) // *scratches* *hisses* omg i h8 u, Pupper -``` - -#### Constraints - -Sometimes, you want to have all the functionality of a certain protocol, but you -want to add a few requirements or other bits an pieces. Usually, you would have -to define the entire functionality of the "parent" protocol in your own protocol -in order to pull this off. This isn't very DRY and thus prone to errors, missing -or out-of-sync functionality, or other issues. You could also just tell users -"hey, if you implement this, make sure to implement that", but there's no -guarantee they'll know about it, or know which arguments map to what. - -This is where constraints come in: You can define a protocol that expects -anything that implements it to *also* implement one or more "parent" protocols. - -```javascript -const Show = proto.define({ - // This syntax allows default impls without using arrays. - toString () { - return Object.prototype.toString.call(this) - }, - toJSON () { - return JSON.stringify(this) - } -}) - -const Log = proto.define({ - log () { console.log(this.toString()) } -}, { - where: Show() - // Also valid: - // [Show('this'), Show('a')] - // [Show('this', ['a', 'b'])] -}) - -// This fails with an error: must implement Show: -Log.impl(MyThing) - -// So derive Show first... -Show.impl(MyThing) -// And now it's ok! -Log.impl(MyThing) -``` - -### API - -#### `define(?, , )` - -Defines a new protocol on across arguments of types defined by ``, which -will expect implementations for the functions specified in ``. - -If `` is missing, it will be treated the same as if it were an empty -array. - -The types in `` entries must map, by string name, to the type names -specified in ``, or be an empty array if `` is omitted. The types -in `` will then be used to map between method implementations for the -individual functions, and the provided types in the impl. - -Protocols can include an `opts` object as the last argument, with the following -available options: - -* `opts.name` `{String}` - The name to use when referring to the protocol. - -* `opts.where` `{Array[Constraint]|Constraint}` - Protocol constraints to use. - -* `opts.metaobject` - Accepts an object implementing the - `Protoduck` protocol, which can be used to alter protocol definition - mechanisms in `protoduck`. - -##### Example - -```javascript -const Eq = protoduck.define(['a'], { - eq: ['a'] -}) -``` - -#### `proto.impl(, ?, ?)` - -Adds a new implementation to the given protocol across ``. - -`` must be an object with functions matching the protocol's -API. If given, the types in `` will be mapped to their corresponding -method arguments according to the original protocol definition. - -If a protocol is derivable -- that is, all its functions have default impls, -then the `` object can be omitted entirely, and the protocol -will be automatically derived for the given `` - -##### Example - -```javascript -import protoduck from 'protoduck' - -// Singly-dispatched protocols -const Show = protoduck.define({ - show: [] -}) - -class Foo { - constructor (name) { - this.name = name - } -} - -Show.impl(Foo, { - show () { return `[object Foo(${this.name})]` } -}) - -const f = new Foo('alex') -f.show() === '[object Foo(alex)]' -``` - -```javascript -import protoduck from 'protoduck' - -// Multi-dispatched protocols -const Comparable = protoduck.define(['target'], { - compare: ['target'], -}) - -class Foo {} -class Bar {} -class Baz {} - -Comparable.impl(Foo, [Bar], { - compare (bar) { return 'bars are ok' } -}) - -Comparable.impl(Foo, [Baz], { - compare (baz) { return 'but bazzes are better' } -}) - -const foo = new Foo() -const bar = new Bar() -const baz = new Baz() - -foo.compare(bar) // 'bars are ok' -foo.compare(baz) // 'but bazzes are better' -``` diff --git a/deps/npm/node_modules/protoduck/index.js b/deps/npm/node_modules/protoduck/index.js deleted file mode 100644 index b6a83e1f790129..00000000000000 --- a/deps/npm/node_modules/protoduck/index.js +++ /dev/null @@ -1,349 +0,0 @@ -'use strict' - -const genfun = require('genfun') - -class Duck extends Function { - // Duck.impl(Foo, [String, Array], { frob (str, arr) { ... }}) - impl (target, types, impls) { - if (!impls && !isArray(types)) { - impls = types - types = [] - } - if (!impls && this.isDerivable) { - impls = this._defaultImpls - } - if (!impls) { - impls = {} - } - if (typeof target === 'function' && !target.isGenfun) { - target = target.prototype - } - checkImpls(this, target, impls) - checkArgTypes(this, types) - this._constraints.forEach(c => { - if (!c.verify(target, types)) { - throw new Error(`Implementations of ${ - this.name || 'this protocol' - } must first implement ${ - c.parent.name || 'its constraint protocols defined in opts.where.' - }`) - } - }) - this._methodNames.forEach(name => { - defineMethod(this, name, target, types, impls) - }) - } - - hasImpl (arg, args) { - args = args || [] - const fns = this._methodNames - var gf - if (typeof arg === 'function' && !arg.isGenfun) { - arg = arg.prototype - } - args = args.map(arg => { - if (typeof arg === 'function' && !arg.isGenfun) { - return arg.prototype - } else { - return arg - } - }) - for (var i = 0; i < fns.length; i++) { - gf = arg[fns[i]] - if (!gf || - (gf.hasMethod - ? !gf.hasMethod.apply(gf, args) - : typeof gf === 'function')) { - return false - } - } - return true - } - - // MyDuck.matches('a', ['this', 'c']) - matches (thisType, argTypes) { - if (!argTypes && isArray(thisType)) { - argTypes = thisType - thisType = 'this' - } - if (!thisType) { - thisType = 'this' - } - if (!argTypes) { - argTypes = [] - } - return new Constraint(this, thisType, argTypes) - } -} -Duck.prototype.isDuck = true -Duck.prototype.isProtocol = true - -const Protoduck = module.exports = define(['duck'], { - createGenfun: ['duck', _metaCreateGenfun], - addMethod: ['duck', _metaAddMethod] -}, { name: 'Protoduck' }) - -const noImplFound = module.exports.noImplFound = genfun.noApplicableMethod - -module.exports.define = define -function define (types, spec, opts) { - if (!isArray(types)) { - // protocol(spec, opts?) syntax for method-based protocols - opts = spec - spec = types - types = [] - } - const duck = function (thisType, argTypes) { - return duck.matches(thisType, argTypes) - } - Object.setPrototypeOf(duck, Duck.prototype) - duck.isDerivable = true - Object.defineProperty(duck, 'name', { - value: (opts && opts.name) || 'Protocol' - }) - if (opts && opts.where) { - let where = opts.where - if (!isArray(opts.where)) { where = [opts.where] } - duck._constraints = where.map(w => w.isProtocol // `where: [Foo]` - ? w.matches() - : w - ) - } else { - duck._constraints = [] - } - duck.isProtocol = true - duck._metaobject = opts && opts.metaobject - duck._types = types - duck._defaultImpls = {} - duck._gfTypes = {} - duck._methodNames = Object.keys(spec) - duck._methodNames.forEach(name => { - checkMethodSpec(duck, name, spec) - }) - duck._constraints.forEach(c => c.attach(duck)) - return duck -} - -function checkMethodSpec (duck, name, spec) { - let gfTypes = spec[name] - if (typeof gfTypes === 'function') { - duck._defaultImpls[name] = gfTypes - gfTypes = [gfTypes] - } if (typeof gfTypes[gfTypes.length - 1] === 'function') { - duck._defaultImpls[name] = gfTypes.pop() - } else { - duck.isDerivable = false - } - duck._gfTypes[name] = gfTypes.map(typeId => { - const idx = duck._types.indexOf(typeId) - if (idx === -1) { - throw new Error( - `type '${ - typeId - }' for function '${ - name - }' does not match any protocol types (${ - duck._types.join(', ') - }).` - ) - } else { - return idx - } - }) -} - -function defineMethod (duck, name, target, types, impls) { - const methodTypes = duck._gfTypes[name].map(function (typeIdx) { - return types[typeIdx] - }) - for (let i = methodTypes.length - 1; i >= 0; i--) { - if (methodTypes[i] === undefined) { - methodTypes.pop() - } else { - break - } - } - const useMetaobject = duck._metaobject && duck._metaobject !== Protoduck - // `target` does not necessarily inherit from `Object` - if (!Object.prototype.hasOwnProperty.call(target, name)) { - // Make a genfun if there's nothing there - const gf = useMetaobject - ? duck._metaobject.createGenfun(duck, target, name, null) - : _metaCreateGenfun(duck, target, name, null) - target[name] = gf - } else if (typeof target[name] === 'function' && !target[name].isGenfun) { - // Turn non-gf functions into genfuns - const gf = useMetaobject - ? duck._metaobject.createGenfun(duck, target, name, target[name]) - : _metaCreateGenfun(duck, target, name, target[name]) - target[name] = gf - } - - const fn = impls[name] || duck._defaultImpls[name] - if (fn) { // checkImpls made sure this is safe - useMetaobject - ? duck._metaobject.addMethod(duck, target, name, methodTypes, fn) - : _metaAddMethod(duck, target, name, methodTypes, fn) - } -} - -function checkImpls (duck, target, impls) { - duck._methodNames.forEach(function (name) { - if ( - !impls[name] && - !duck._defaultImpls[name] && - // Existing methods on the target are acceptable defaults. - typeof target[name] !== 'function' - ) { - throw new Error(`Missing implementation for ${ - formatMethod(duck, name, duck.name) - }. Make sure the method is present in your ${ - duck.name || 'protocol' - } definition. Required methods: ${ - duck._methodNames.filter(m => { - return !duck._defaultImpls[m] - }).map(m => formatMethod(duck, m)).join(', ') - }.`) - } - }) - Object.keys(impls).forEach(function (name) { - if (duck._methodNames.indexOf(name) === -1) { - throw new Error( - `${name}() was included in the impl, but is not part of ${ - duck.name || 'the protocol' - }. Allowed methods: ${ - duck._methodNames.map(m => formatMethod(duck, m)).join(', ') - }.` - ) - } - }) -} - -function formatMethod (duck, name, withDuckName) { - return `${ - withDuckName && duck.name ? `${duck.name}#` : '' - }${name}(${duck._gfTypes[name].map(n => duck._types[n]).join(', ')})` -} - -function checkArgTypes (duck, types) { - var requiredTypes = duck._types - if (types.length > requiredTypes.length) { - throw new Error( - `${ - duck.name || 'Protocol' - } expects to be defined across ${ - requiredTypes.length - } type${requiredTypes.length > 1 ? 's' : ''}, but ${ - types.length - } ${types.length > 1 ? 'were' : 'was'} specified.` - ) - } -} - -function typeName (obj) { - return (/\[object ([a-zA-Z0-9]+)\]/).exec(({}).toString.call(obj))[1] -} - -function installMethodErrorMessage (proto, gf, target, name) { - noImplFound.add([gf], function (gf, thisArg, args) { - let parent = Object.getPrototypeOf(thisArg) - while (parent && parent[name] === gf) { - parent = Object.getPrototypeOf(parent) - } - if (parent && parent[name] && typeof parent[name] === 'function') { - } - var msg = `No ${typeName(thisArg)} impl for ${ - proto.name ? `${proto.name}#` : '' - }${name}(${[].map.call(args, typeName).join(', ')}). You must implement ${ - proto.name - ? formatMethod(proto, name, true) - : `the protocol ${formatMethod(proto, name)} belongs to` - } in order to call ${typeName(thisArg)}#${name}(${ - [].map.call(args, typeName).join(', ') - }).` - const err = new Error(msg) - err.protocol = proto - err.function = gf - err.thisArg = thisArg - err.args = args - err.code = 'ENOIMPL' - throw err - }) -} - -function isArray (x) { - return Object.prototype.toString.call(x) === '[object Array]' -} - -// Metaobject Protocol -Protoduck.impl(Protoduck) // defaults configured by definition - -function _metaCreateGenfun (proto, target, name, deflt) { - var gf = genfun({ - default: deflt, - name: `${proto.name ? `${proto.name}#` : ''}${name}` - }) - installMethodErrorMessage(proto, gf, target, name) - gf.duck = proto - return gf -} - -function _metaAddMethod (duck, target, name, methodTypes, fn) { - return target[name].add(methodTypes, fn) -} - -// Constraints -class Constraint { - constructor (parent, thisType, argTypes) { - this.parent = parent - this.target = thisType - this.types = argTypes - } - - attach (obj) { - this.child = obj - if (this.target === 'this') { - this.thisIdx = 'this' - } else { - const idx = this.child._types.indexOf(this.target) - if (idx === -1) { - this.thisIdx = null - } else { - this.thisIdx = idx - } - } - this.indices = this.types.map(typeId => { - if (typeId === 'this') { - return 'this' - } else { - const idx = this.child._types.indexOf(typeId) - if (idx === -1) { - return null - } else { - return idx - } - } - }) - } - - verify (target, types) { - const thisType = ( - this.thisIdx === 'this' || this.thisIdx == null - ) - ? target - : types[this.thisIdx] - const parentTypes = this.indices.map(idx => { - if (idx === 'this') { - return target - } else if (idx === 'this') { - return types[this.thisIdx] - } else if (idx === null) { - return Object - } else { - return types[idx] || Object.prototype - } - }) - return this.parent.hasImpl(thisType, parentTypes) - } -} -Constraint.prototype.isConstraint = true diff --git a/deps/npm/node_modules/protoduck/package.json b/deps/npm/node_modules/protoduck/package.json deleted file mode 100644 index 3ee47ac6adbaaf..00000000000000 --- a/deps/npm/node_modules/protoduck/package.json +++ /dev/null @@ -1,88 +0,0 @@ -{ - "_from": "protoduck@^5.0.1", - "_id": "protoduck@5.0.1", - "_inBundle": false, - "_integrity": "sha512-WxoCeDCoCBY55BMvj4cAEjdVUFGRWed9ZxPlqTKYyw1nDDTQ4pqmnIMAGfJlg7Dx35uB/M+PHJPTmGOvaCaPTg==", - "_location": "/protoduck", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "protoduck@^5.0.1", - "name": "protoduck", - "escapedName": "protoduck", - "rawSpec": "^5.0.1", - "saveSpec": null, - "fetchSpec": "^5.0.1" - }, - "_requiredBy": [ - "/pacote" - ], - "_resolved": "https://registry.npmjs.org/protoduck/-/protoduck-5.0.1.tgz", - "_shasum": "03c3659ca18007b69a50fd82a7ebcc516261151f", - "_spec": "protoduck@^5.0.1", - "_where": "/Users/zkat/Documents/code/work/npm/node_modules/pacote", - "author": { - "name": "Kat Marchán", - "email": "kzm@sykosomatic.org" - }, - "bugs": { - "url": "https://github.com/zkat/protoduck/issues" - }, - "bundleDependencies": false, - "dependencies": { - "genfun": "^5.0.0" - }, - "deprecated": false, - "description": "Fancy duck typing for the most serious of ducks.", - "devDependencies": { - "mocha": "^5.2.0", - "nyc": "^13.1.0", - "standard": "^12.0.1", - "standard-version": "^4.0.0", - "tap": "^12.0.1", - "weallbehave": "^1.0.3", - "weallcontribute": "^1.0.8" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/zkat/protoduck#readme", - "keywords": [ - "oop", - "util", - "object oriented", - "duck type", - "ducktype", - "ducktyping", - "protocols", - "multimethod", - "clojure", - "haskell", - "rust", - "generic", - "functions", - "clos", - "polymorphism", - "impl", - "typeclass", - "traits" - ], - "license": "MIT", - "main": "index.js", - "name": "protoduck", - "repository": { - "type": "git", - "url": "git+https://github.com/zkat/protoduck.git" - }, - "scripts": { - "postrelease": "npm publish && git push --follow-tags", - "prerelease": "npm t", - "pretest": "standard", - "release": "standard-version -s", - "test": "tap -J --coverage test/*.js", - "update-coc": "weallbehave -o . && git add CODE_OF_CONDUCT.md && git commit -m 'docs(coc): updated CODE_OF_CONDUCT.md'", - "update-contrib": "weallcontribute -o . && git add CONTRIBUTING.md && git commit -m 'docs(contributing): updated CONTRIBUTING.md'" - }, - "version": "5.0.1" -} diff --git a/deps/npm/node_modules/prr/.npmignore b/deps/npm/node_modules/prr/.npmignore deleted file mode 100644 index b512c09d476623..00000000000000 --- a/deps/npm/node_modules/prr/.npmignore +++ /dev/null @@ -1 +0,0 @@ -node_modules \ No newline at end of file diff --git a/deps/npm/node_modules/prr/.travis.yml b/deps/npm/node_modules/prr/.travis.yml deleted file mode 100644 index 33dcbc3a8681e1..00000000000000 --- a/deps/npm/node_modules/prr/.travis.yml +++ /dev/null @@ -1,10 +0,0 @@ -language: node_js -node_js: - - 0.8 - - "0.10" -branches: - only: - - master -notifications: - email: - - rod@vagg.org \ No newline at end of file diff --git a/deps/npm/node_modules/prr/LICENSE.md b/deps/npm/node_modules/prr/LICENSE.md deleted file mode 100644 index 29b95e39a595d1..00000000000000 --- a/deps/npm/node_modules/prr/LICENSE.md +++ /dev/null @@ -1,11 +0,0 @@ -The MIT License (MIT) -===================== - -Copyright (c) 2014 Rod Vagg ---------------------------- - -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/prr/README.md b/deps/npm/node_modules/prr/README.md deleted file mode 100644 index b93404823519fc..00000000000000 --- a/deps/npm/node_modules/prr/README.md +++ /dev/null @@ -1,47 +0,0 @@ -# prr [![Build Status](https://secure.travis-ci.org/rvagg/prr.png)](http://travis-ci.org/rvagg/prr) - -An sensible alternative to `Object.defineProperty()`. Available in npm and Ender as **prr**. - -## Usage - -Set the property `'foo'` (`obj.foo`) to have the value `'bar'` with default options (`'enumerable'`, `'configurable'` and `'writable'` are all `false`): - -```js -prr(obj, 'foo', 'bar') -``` - -Adjust the default options: - -```js -prr(obj, 'foo', 'bar', { enumerable: true, writable: true }) -``` - -Do the same operation for multiple properties: - -```js -prr(obj, { one: 'one', two: 'two' }) -// or with options: -prr(obj, { one: 'one', two: 'two' }, { enumerable: true, writable: true }) -``` - -### Simplify! - -But obviously, having to write out the full options object makes it nearly as bad as the original `Object.defineProperty()` so we can simplify. - -As an alternative method we can use an options string where each character represents a option: `'e'=='enumerable'`, `'c'=='configurable'` and `'w'=='writable'`: - -```js -prr(obj, 'foo', 'bar', 'ew') // enumerable and writable but not configurable -// muliple properties: -prr(obj, { one: 'one', two: 'two' }, 'ewc') // configurable too -``` - -## Where can I use it? - -Anywhere! For pre-ES5 environments *prr* will simply fall-back to an `object[property] = value` so you can get close to what you want. - -*prr* is Ender-compatible so you can include it in your Ender build and `$.prr(...)` or `var prr = require('prr'); prr(...)`. - -## Licence - -prr is Copyright (c) 2013 Rod Vagg [@rvagg](https://twitter.com/rvagg) and licensed under the MIT licence. All rights not explicitly granted in the MIT license are reserved. See the included LICENSE.md file for more details. diff --git a/deps/npm/node_modules/prr/package.json b/deps/npm/node_modules/prr/package.json deleted file mode 100644 index e0f4dde38bab0f..00000000000000 --- a/deps/npm/node_modules/prr/package.json +++ /dev/null @@ -1,58 +0,0 @@ -{ - "_from": "prr@~1.0.1", - "_id": "prr@1.0.1", - "_inBundle": false, - "_integrity": "sha1-0/wRS6BplaRexok/SEzrHXj19HY=", - "_location": "/prr", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "prr@~1.0.1", - "name": "prr", - "escapedName": "prr", - "rawSpec": "~1.0.1", - "saveSpec": null, - "fetchSpec": "~1.0.1" - }, - "_requiredBy": [ - "/errno" - ], - "_resolved": "https://registry.npmjs.org/prr/-/prr-1.0.1.tgz", - "_shasum": "d3fc114ba06995a45ec6893f484ceb1d78f5f476", - "_spec": "prr@~1.0.1", - "_where": "/Users/rebecca/code/npm/node_modules/errno", - "author": { - "name": "Rod Vagg", - "email": "rod@vagg.org", - "url": "https://github.com/rvagg" - }, - "bugs": { - "url": "https://github.com/rvagg/prr/issues" - }, - "bundleDependencies": false, - "dependencies": {}, - "deprecated": false, - "description": "A better Object.defineProperty()", - "devDependencies": { - "tap": "*" - }, - "homepage": "https://github.com/rvagg/prr", - "keywords": [ - "property", - "properties", - "defineProperty", - "ender" - ], - "license": "MIT", - "main": "./prr.js", - "name": "prr", - "repository": { - "type": "git", - "url": "git+https://github.com/rvagg/prr.git" - }, - "scripts": { - "test": "node ./test.js" - }, - "version": "1.0.1" -} diff --git a/deps/npm/node_modules/prr/prr.js b/deps/npm/node_modules/prr/prr.js deleted file mode 100644 index 94f58628be9bf3..00000000000000 --- a/deps/npm/node_modules/prr/prr.js +++ /dev/null @@ -1,63 +0,0 @@ -/*! - * prr - * (c) 2013 Rod Vagg - * https://github.com/rvagg/prr - * License: MIT - */ - -(function (name, context, definition) { - if (typeof module != 'undefined' && module.exports) - module.exports = definition() - else - context[name] = definition() -})('prr', this, function() { - - var setProperty = typeof Object.defineProperty == 'function' - ? function (obj, key, options) { - Object.defineProperty(obj, key, options) - return obj - } - : function (obj, key, options) { // < es5 - obj[key] = options.value - return obj - } - - , makeOptions = function (value, options) { - var oo = typeof options == 'object' - , os = !oo && typeof options == 'string' - , op = function (p) { - return oo - ? !!options[p] - : os - ? options.indexOf(p[0]) > -1 - : false - } - - return { - enumerable : op('enumerable') - , configurable : op('configurable') - , writable : op('writable') - , value : value - } - } - - , prr = function (obj, key, value, options) { - var k - - options = makeOptions(value, options) - - if (typeof key == 'object') { - for (k in key) { - if (Object.hasOwnProperty.call(key, k)) { - options.value = key[k] - setProperty(obj, k, options) - } - } - return obj - } - - return setProperty(obj, key, options) - } - - return prr -}) \ No newline at end of file diff --git a/deps/npm/node_modules/prr/test.js b/deps/npm/node_modules/prr/test.js deleted file mode 100644 index 5222e3073c8460..00000000000000 --- a/deps/npm/node_modules/prr/test.js +++ /dev/null @@ -1,169 +0,0 @@ -const test = require('tap').test - , prr = require('./') - -test('test prr(o, key, value) form', function (t) { - t.plan(2) - - var o = {} - prr(o, 'foo', 'bar') - t.equal(o.foo, 'bar', 'correct value') - t.deepEqual( - Object.getOwnPropertyDescriptor(o, 'foo') - , { - enumerable : false - , configurable : false - , writable : false - , value : 'bar' - } - , 'correct property descriptor' - ) - t.end() -}) - -test('test prr(o, { key: value }) form', function (t) { - t.plan(2) - - var o = {} - prr(o, { foo: 'bar' }) - - t.equal(o.foo, 'bar', 'correct value') - t.deepEqual( - Object.getOwnPropertyDescriptor(o, 'foo') - , { - enumerable : false - , configurable : false - , writable : false - , value : 'bar' - } - , 'correct property descriptor' - ) - t.end() -}) - -test('test multiple key:value pairs', function (t) { - var o = { foo: 'bar' } - - prr(o, { one: 'ONE', two: 'TWO', obj: { o: 'o' }}) - - t.deepEqual(o, { foo: 'bar' }, 'properties are not enumerable') - t.equal(o.one, 'ONE', 'correctly set property') - t.equal(o.two, 'TWO', 'correctly set property') - t.deepEqual(o.obj, { o: 'o' }, 'correctly set property') - - ;[ 'one', 'two', 'obj' ].forEach(function (p) { - t.deepEqual( - Object.getOwnPropertyDescriptor(o, p) - , { - enumerable : false - , configurable : false - , writable : false - , value : p == 'obj' ? { o: 'o' } : p.toUpperCase() - } - , 'correct property descriptor' - ) - }) - - t.end() -}) - -test('test descriptor options', function (t) { - var o = {} - - prr(o, 'foo', 'bar', { - enumerable : true - , configurable : false - }) - t.equal(o.foo, 'bar', 'correct value') - t.deepEqual( - Object.getOwnPropertyDescriptor(o, 'foo') - , { - enumerable : true - , configurable : false - , writable : false - , value : 'bar' - } - , 'correct property descriptor' - ) - - prr(o, 'foo2', 'bar2', { - enumerable : true - , configurable : true - , writable : false - }) - t.equal(o.foo2, 'bar2', 'correct value') - t.deepEqual( - Object.getOwnPropertyDescriptor(o, 'foo2') - , { - enumerable : true - , configurable : true - , writable : false - , value : 'bar2' - } - , 'correct property descriptor' - ) - - prr(o, 'foo3', 'bar3', { - enumerable : true - , configurable : true - , writable : true - }) - t.equal(o.foo3, 'bar3', 'correct value') - t.deepEqual( - Object.getOwnPropertyDescriptor(o, 'foo3') - , { - enumerable : true - , configurable : true - , writable : true - , value : 'bar3' - } - , 'correct property descriptor' - ) - - t.end() -}) - - -test('test descriptor options, string form', function (t) { - var o = {} - - prr(o, 'foo', 'bar', 'e') - t.equal(o.foo, 'bar', 'correct value') - t.deepEqual( - Object.getOwnPropertyDescriptor(o, 'foo') - , { - enumerable : true - , configurable : false - , writable : false - , value : 'bar' - } - , 'correct property descriptor' - ) - - prr(o, 'foo2', 'bar2', 'ec') - t.equal(o.foo2, 'bar2', 'correct value') - t.deepEqual( - Object.getOwnPropertyDescriptor(o, 'foo2') - , { - enumerable : true - , configurable : true - , writable : false - , value : 'bar2' - } - , 'correct property descriptor' - ) - - prr(o, 'foo3', 'bar3', 'ecw') - t.equal(o.foo3, 'bar3', 'correct value') - t.deepEqual( - Object.getOwnPropertyDescriptor(o, 'foo3') - , { - enumerable : true - , configurable : true - , writable : true - , value : 'bar3' - } - , 'correct property descriptor' - ) - - t.end() -}) diff --git a/deps/npm/node_modules/pseudomap/README.md b/deps/npm/node_modules/pseudomap/README.md deleted file mode 100644 index 778bf01dfaaf9f..00000000000000 --- a/deps/npm/node_modules/pseudomap/README.md +++ /dev/null @@ -1,60 +0,0 @@ -# pseudomap - -A thing that is a lot like ES6 `Map`, but without iterators, for use -in environments where `for..of` syntax and `Map` are not available. - -If you need iterators, or just in general a more faithful polyfill to -ES6 Maps, check out [es6-map](http://npm.im/es6-map). - -If you are in an environment where `Map` is supported, then that will -be returned instead, unless `process.env.TEST_PSEUDOMAP` is set. - -You can use any value as keys, and any value as data. Setting again -with the identical key will overwrite the previous value. - -Internally, data is stored on an `Object.create(null)` style object. -The key is coerced to a string to generate the key on the internal -data-bag object. The original key used is stored along with the data. - -In the event of a stringified-key collision, a new key is generated by -appending an increasing number to the stringified-key until finding -either the intended key or an empty spot. - -Note that because object traversal order of plain objects is not -guaranteed to be identical to insertion order, the insertion order -guarantee of `Map.prototype.forEach` is not guaranteed in this -implementation. However, in all versions of Node.js and V8 where this -module works, `forEach` does traverse data in insertion order. - -## API - -Most of the [Map -API](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map), -with the following exceptions: - -1. A `Map` object is not an iterator. -2. `values`, `keys`, and `entries` methods are not implemented, - because they return iterators. -3. The argument to the constructor can be an Array of `[key, value]` - pairs, or a `Map` or `PseudoMap` object. But, since iterators - aren't used, passing any plain-old iterator won't initialize the - map properly. - -## USAGE - -Use just like a regular ES6 Map. - -```javascript -var PseudoMap = require('pseudomap') - -// optionally provide a pseudomap, or an array of [key,value] pairs -// as the argument to initialize the map with -var myMap = new PseudoMap() - -myMap.set(1, 'number 1') -myMap.set('1', 'string 1') -var akey = {} -var bkey = {} -myMap.set(akey, { some: 'data' }) -myMap.set(bkey, { some: 'other data' }) -``` diff --git a/deps/npm/node_modules/pseudomap/map.js b/deps/npm/node_modules/pseudomap/map.js deleted file mode 100644 index 7db15994612fd9..00000000000000 --- a/deps/npm/node_modules/pseudomap/map.js +++ /dev/null @@ -1,9 +0,0 @@ -if (process.env.npm_package_name === 'pseudomap' && - process.env.npm_lifecycle_script === 'test') - process.env.TEST_PSEUDOMAP = 'true' - -if (typeof Map === 'function' && !process.env.TEST_PSEUDOMAP) { - module.exports = Map -} else { - module.exports = require('./pseudomap') -} diff --git a/deps/npm/node_modules/pseudomap/package.json b/deps/npm/node_modules/pseudomap/package.json deleted file mode 100644 index af3e4a1794e15b..00000000000000 --- a/deps/npm/node_modules/pseudomap/package.json +++ /dev/null @@ -1,54 +0,0 @@ -{ - "_from": "pseudomap@^1.0.2", - "_id": "pseudomap@1.0.2", - "_inBundle": false, - "_integrity": "sha1-8FKijacOYYkX7wqKw0wa5aaChrM=", - "_location": "/pseudomap", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "pseudomap@^1.0.2", - "name": "pseudomap", - "escapedName": "pseudomap", - "rawSpec": "^1.0.2", - "saveSpec": null, - "fetchSpec": "^1.0.2" - }, - "_requiredBy": [ - "/lru-cache" - ], - "_resolved": "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz", - "_shasum": "f052a28da70e618917ef0a8ac34c1ae5a68286b3", - "_spec": "pseudomap@^1.0.2", - "_where": "/Users/rebecca/code/npm/node_modules/lru-cache", - "author": { - "name": "Isaac Z. Schlueter", - "email": "i@izs.me", - "url": "http://blog.izs.me/" - }, - "bugs": { - "url": "https://github.com/isaacs/pseudomap/issues" - }, - "bundleDependencies": false, - "deprecated": false, - "description": "A thing that is a lot like ES6 `Map`, but without iterators, for use in environments where `for..of` syntax and `Map` are not available.", - "devDependencies": { - "tap": "^2.3.1" - }, - "directories": { - "test": "test" - }, - "homepage": "https://github.com/isaacs/pseudomap#readme", - "license": "ISC", - "main": "map.js", - "name": "pseudomap", - "repository": { - "type": "git", - "url": "git+https://github.com/isaacs/pseudomap.git" - }, - "scripts": { - "test": "tap test/*.js" - }, - "version": "1.0.2" -} diff --git a/deps/npm/node_modules/pseudomap/pseudomap.js b/deps/npm/node_modules/pseudomap/pseudomap.js deleted file mode 100644 index 25a21d829e8b3f..00000000000000 --- a/deps/npm/node_modules/pseudomap/pseudomap.js +++ /dev/null @@ -1,113 +0,0 @@ -var hasOwnProperty = Object.prototype.hasOwnProperty - -module.exports = PseudoMap - -function PseudoMap (set) { - if (!(this instanceof PseudoMap)) // whyyyyyyy - throw new TypeError("Constructor PseudoMap requires 'new'") - - this.clear() - - if (set) { - if ((set instanceof PseudoMap) || - (typeof Map === 'function' && set instanceof Map)) - set.forEach(function (value, key) { - this.set(key, value) - }, this) - else if (Array.isArray(set)) - set.forEach(function (kv) { - this.set(kv[0], kv[1]) - }, this) - else - throw new TypeError('invalid argument') - } -} - -PseudoMap.prototype.forEach = function (fn, thisp) { - thisp = thisp || this - Object.keys(this._data).forEach(function (k) { - if (k !== 'size') - fn.call(thisp, this._data[k].value, this._data[k].key) - }, this) -} - -PseudoMap.prototype.has = function (k) { - return !!find(this._data, k) -} - -PseudoMap.prototype.get = function (k) { - var res = find(this._data, k) - return res && res.value -} - -PseudoMap.prototype.set = function (k, v) { - set(this._data, k, v) -} - -PseudoMap.prototype.delete = function (k) { - var res = find(this._data, k) - if (res) { - delete this._data[res._index] - this._data.size-- - } -} - -PseudoMap.prototype.clear = function () { - var data = Object.create(null) - data.size = 0 - - Object.defineProperty(this, '_data', { - value: data, - enumerable: false, - configurable: true, - writable: false - }) -} - -Object.defineProperty(PseudoMap.prototype, 'size', { - get: function () { - return this._data.size - }, - set: function (n) {}, - enumerable: true, - configurable: true -}) - -PseudoMap.prototype.values = -PseudoMap.prototype.keys = -PseudoMap.prototype.entries = function () { - throw new Error('iterators are not implemented in this version') -} - -// Either identical, or both NaN -function same (a, b) { - return a === b || a !== a && b !== b -} - -function Entry (k, v, i) { - this.key = k - this.value = v - this._index = i -} - -function find (data, k) { - for (var i = 0, s = '_' + k, key = s; - hasOwnProperty.call(data, key); - key = s + i++) { - if (same(data[key].key, k)) - return data[key] - } -} - -function set (data, k, v) { - for (var i = 0, s = '_' + k, key = s; - hasOwnProperty.call(data, key); - key = s + i++) { - if (same(data[key].key, k)) { - data[key].value = v - return - } - } - data.size++ - data[key] = new Entry(k, v, key) -} diff --git a/deps/npm/node_modules/pseudomap/test/basic.js b/deps/npm/node_modules/pseudomap/test/basic.js deleted file mode 100644 index 4378e4541e9a14..00000000000000 --- a/deps/npm/node_modules/pseudomap/test/basic.js +++ /dev/null @@ -1,86 +0,0 @@ -var t = require('tap') - -process.env.TEST_PSEUDOMAP = 'true' - -var PM = require('../') -runTests(PM) - -// if possible, verify that Map also behaves the same way -if (typeof Map === 'function') - runTests(Map) - - -function runTests (Map) { - t.throws(Map) - - var m = new Map() - - t.equal(m.size, 0) - - m.set(1, '1 string') - t.equal(m.get(1), '1 string') - t.equal(m.size, 1) - m.size = 1000 - t.equal(m.size, 1) - m.size = 0 - t.equal(m.size, 1) - - m = new Map([[1, 'number 1'], ['1', 'string 1']]) - t.equal(m.get(1), 'number 1') - t.equal(m.get('1'), 'string 1') - t.equal(m.size, 2) - - m = new Map(m) - t.equal(m.get(1), 'number 1') - t.equal(m.get('1'), 'string 1') - t.equal(m.size, 2) - - var akey = {} - var bkey = {} - m.set(akey, { some: 'data' }) - m.set(bkey, { some: 'other data' }) - t.same(m.get(akey), { some: 'data' }) - t.same(m.get(bkey), { some: 'other data' }) - t.equal(m.size, 4) - - var x = /x/ - var y = /x/ - m.set(x, 'x regex') - m.set(y, 'y regex') - t.equal(m.get(x), 'x regex') - m.set(x, 'x again') - t.equal(m.get(x), 'x again') - t.equal(m.size, 6) - - m.set(NaN, 'not a number') - t.equal(m.get(NaN), 'not a number') - m.set(NaN, 'it is a ' + typeof NaN) - t.equal(m.get(NaN), 'it is a number') - m.set('NaN', 'stringie nan') - t.equal(m.get(NaN), 'it is a number') - t.equal(m.get('NaN'), 'stringie nan') - t.equal(m.size, 8) - - m.delete(NaN) - t.equal(m.get(NaN), undefined) - t.equal(m.size, 7) - - var expect = [ - { value: 'number 1', key: 1 }, - { value: 'string 1', key: '1' }, - { value: { some: 'data' }, key: {} }, - { value: { some: 'other data' }, key: {} }, - { value: 'x again', key: /x/ }, - { value: 'y regex', key: /x/ }, - { value: 'stringie nan', key: 'NaN' } - ] - var actual = [] - - m.forEach(function (value, key) { - actual.push({ value: value, key: key }) - }) - t.same(actual, expect) - - m.clear() - t.equal(m.size, 0) -} diff --git a/deps/npm/node_modules/psl/.eslintignore b/deps/npm/node_modules/psl/.eslintignore deleted file mode 100644 index 849ddff3b7ec91..00000000000000 --- a/deps/npm/node_modules/psl/.eslintignore +++ /dev/null @@ -1 +0,0 @@ -dist/ diff --git a/deps/npm/node_modules/psl/.travis.yml b/deps/npm/node_modules/psl/.travis.yml deleted file mode 100644 index 3d43f057993e5f..00000000000000 --- a/deps/npm/node_modules/psl/.travis.yml +++ /dev/null @@ -1,6 +0,0 @@ -language: node_js -node_js: - - 6 - - 8 - - 9 - - 10 diff --git a/deps/npm/node_modules/psl/LICENSE b/deps/npm/node_modules/psl/LICENSE new file mode 100644 index 00000000000000..78d792eda65f10 --- /dev/null +++ b/deps/npm/node_modules/psl/LICENSE @@ -0,0 +1,9 @@ +The MIT License (MIT) + +Copyright (c) 2017 Lupo Montero lupomontero@gmail.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/deps/npm/node_modules/psl/README.md b/deps/npm/node_modules/psl/README.md index 097fca2a8241e3..e876c3d6f64c4d 100644 --- a/deps/npm/node_modules/psl/README.md +++ b/deps/npm/node_modules/psl/README.md @@ -2,9 +2,9 @@ [![NPM](https://nodei.co/npm/psl.png?downloads=true&downloadRank=true)](https://nodei.co/npm/psl/) -[![Greenkeeper badge](https://badges.greenkeeper.io/wrangr/psl.svg)](https://greenkeeper.io/) -[![Build Status](https://travis-ci.org/wrangr/psl.svg?branch=master)](https://travis-ci.org/wrangr/psl) -[![devDependency Status](https://david-dm.org/wrangr/psl/dev-status.png)](https://david-dm.org/wrangr/psl#info=devDependencies) +[![Greenkeeper badge](https://badges.greenkeeper.io/lupomontero/psl.svg)](https://greenkeeper.io/) +[![Build Status](https://travis-ci.org/lupomontero/psl.svg?branch=master)](https://travis-ci.org/lupomontero/psl) +[![devDependency Status](https://david-dm.org/lupomontero/psl/dev-status.png)](https://david-dm.org/lupomontero/psl#info=devDependencies) `psl` is a `JavaScript` domain name parser based on the [Public Suffix List](https://publicsuffix.org/). @@ -13,6 +13,8 @@ This implementation is tested against the [test data hosted by Mozilla](http://mxr.mozilla.org/mozilla-central/source/netwerk/test/unit/data/test_psl.txt?raw=1) and kindly provided by [Comodo](https://www.comodo.com/). +Cross browser testing provided by +[BrowserStack](https://www.browserstack.com/) ## What is the Public Suffix List? @@ -40,7 +42,7 @@ npm install --save psl ### Browser -Download [psl.min.js](https://raw.githubusercontent.com/wrangr/psl/master/dist/psl.min.js) +Download [psl.min.js](https://raw.githubusercontent.com/lupomontero/psl/master/dist/psl.min.js) and include it in a script tag. ```html diff --git a/deps/npm/node_modules/psl/browserstack-logo.svg b/deps/npm/node_modules/psl/browserstack-logo.svg new file mode 100644 index 00000000000000..195f64d2feab41 --- /dev/null +++ b/deps/npm/node_modules/psl/browserstack-logo.svg @@ -0,0 +1,90 @@ + + + + +Browserstack-logo-white + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/deps/npm/node_modules/psl/data/rules.json b/deps/npm/node_modules/psl/data/rules.json index 38d8d8bdd5e50c..e19abdc8938dc4 100644 --- a/deps/npm/node_modules/psl/data/rules.json +++ b/deps/npm/node_modules/psl/data/rules.json @@ -1 +1,8834 @@ -["ac","com.ac","edu.ac","gov.ac","net.ac","mil.ac","org.ac","ad","nom.ad","ae","co.ae","net.ae","org.ae","sch.ae","ac.ae","gov.ae","mil.ae","aero","accident-investigation.aero","accident-prevention.aero","aerobatic.aero","aeroclub.aero","aerodrome.aero","agents.aero","aircraft.aero","airline.aero","airport.aero","air-surveillance.aero","airtraffic.aero","air-traffic-control.aero","ambulance.aero","amusement.aero","association.aero","author.aero","ballooning.aero","broker.aero","caa.aero","cargo.aero","catering.aero","certification.aero","championship.aero","charter.aero","civilaviation.aero","club.aero","conference.aero","consultant.aero","consulting.aero","control.aero","council.aero","crew.aero","design.aero","dgca.aero","educator.aero","emergency.aero","engine.aero","engineer.aero","entertainment.aero","equipment.aero","exchange.aero","express.aero","federation.aero","flight.aero","freight.aero","fuel.aero","gliding.aero","government.aero","groundhandling.aero","group.aero","hanggliding.aero","homebuilt.aero","insurance.aero","journal.aero","journalist.aero","leasing.aero","logistics.aero","magazine.aero","maintenance.aero","media.aero","microlight.aero","modelling.aero","navigation.aero","parachuting.aero","paragliding.aero","passenger-association.aero","pilot.aero","press.aero","production.aero","recreation.aero","repbody.aero","res.aero","research.aero","rotorcraft.aero","safety.aero","scientist.aero","services.aero","show.aero","skydiving.aero","software.aero","student.aero","trader.aero","trading.aero","trainer.aero","union.aero","workinggroup.aero","works.aero","af","gov.af","com.af","org.af","net.af","edu.af","ag","com.ag","org.ag","net.ag","co.ag","nom.ag","ai","off.ai","com.ai","net.ai","org.ai","al","com.al","edu.al","gov.al","mil.al","net.al","org.al","am","ao","ed.ao","gv.ao","og.ao","co.ao","pb.ao","it.ao","aq","ar","com.ar","edu.ar","gob.ar","gov.ar","int.ar","mil.ar","musica.ar","net.ar","org.ar","tur.ar","arpa","e164.arpa","in-addr.arpa","ip6.arpa","iris.arpa","uri.arpa","urn.arpa","as","gov.as","asia","at","ac.at","co.at","gv.at","or.at","au","com.au","net.au","org.au","edu.au","gov.au","asn.au","id.au","info.au","conf.au","oz.au","act.au","nsw.au","nt.au","qld.au","sa.au","tas.au","vic.au","wa.au","act.edu.au","nsw.edu.au","nt.edu.au","qld.edu.au","sa.edu.au","tas.edu.au","vic.edu.au","wa.edu.au","qld.gov.au","sa.gov.au","tas.gov.au","vic.gov.au","wa.gov.au","aw","com.aw","ax","az","com.az","net.az","int.az","gov.az","org.az","edu.az","info.az","pp.az","mil.az","name.az","pro.az","biz.az","ba","com.ba","edu.ba","gov.ba","mil.ba","net.ba","org.ba","bb","biz.bb","co.bb","com.bb","edu.bb","gov.bb","info.bb","net.bb","org.bb","store.bb","tv.bb","*.bd","be","ac.be","bf","gov.bf","bg","a.bg","b.bg","c.bg","d.bg","e.bg","f.bg","g.bg","h.bg","i.bg","j.bg","k.bg","l.bg","m.bg","n.bg","o.bg","p.bg","q.bg","r.bg","s.bg","t.bg","u.bg","v.bg","w.bg","x.bg","y.bg","z.bg","0.bg","1.bg","2.bg","3.bg","4.bg","5.bg","6.bg","7.bg","8.bg","9.bg","bh","com.bh","edu.bh","net.bh","org.bh","gov.bh","bi","co.bi","com.bi","edu.bi","or.bi","org.bi","biz","bj","asso.bj","barreau.bj","gouv.bj","bm","com.bm","edu.bm","gov.bm","net.bm","org.bm","*.bn","bo","com.bo","edu.bo","gob.bo","int.bo","org.bo","net.bo","mil.bo","tv.bo","web.bo","academia.bo","agro.bo","arte.bo","blog.bo","bolivia.bo","ciencia.bo","cooperativa.bo","democracia.bo","deporte.bo","ecologia.bo","economia.bo","empresa.bo","indigena.bo","industria.bo","info.bo","medicina.bo","movimiento.bo","musica.bo","natural.bo","nombre.bo","noticias.bo","patria.bo","politica.bo","profesional.bo","plurinacional.bo","pueblo.bo","revista.bo","salud.bo","tecnologia.bo","tksat.bo","transporte.bo","wiki.bo","br","9guacu.br","abc.br","adm.br","adv.br","agr.br","aju.br","am.br","anani.br","aparecida.br","arq.br","art.br","ato.br","b.br","barueri.br","belem.br","bhz.br","bio.br","blog.br","bmd.br","boavista.br","bsb.br","campinagrande.br","campinas.br","caxias.br","cim.br","cng.br","cnt.br","com.br","contagem.br","coop.br","cri.br","cuiaba.br","curitiba.br","def.br","ecn.br","eco.br","edu.br","emp.br","eng.br","esp.br","etc.br","eti.br","far.br","feira.br","flog.br","floripa.br","fm.br","fnd.br","fortal.br","fot.br","foz.br","fst.br","g12.br","ggf.br","goiania.br","gov.br","ac.gov.br","al.gov.br","am.gov.br","ap.gov.br","ba.gov.br","ce.gov.br","df.gov.br","es.gov.br","go.gov.br","ma.gov.br","mg.gov.br","ms.gov.br","mt.gov.br","pa.gov.br","pb.gov.br","pe.gov.br","pi.gov.br","pr.gov.br","rj.gov.br","rn.gov.br","ro.gov.br","rr.gov.br","rs.gov.br","sc.gov.br","se.gov.br","sp.gov.br","to.gov.br","gru.br","imb.br","ind.br","inf.br","jab.br","jampa.br","jdf.br","joinville.br","jor.br","jus.br","leg.br","lel.br","londrina.br","macapa.br","maceio.br","manaus.br","maringa.br","mat.br","med.br","mil.br","morena.br","mp.br","mus.br","natal.br","net.br","niteroi.br","*.nom.br","not.br","ntr.br","odo.br","org.br","osasco.br","palmas.br","poa.br","ppg.br","pro.br","psc.br","psi.br","pvh.br","qsl.br","radio.br","rec.br","recife.br","ribeirao.br","rio.br","riobranco.br","riopreto.br","salvador.br","sampa.br","santamaria.br","santoandre.br","saobernardo.br","saogonca.br","sjc.br","slg.br","slz.br","sorocaba.br","srv.br","taxi.br","teo.br","the.br","tmp.br","trd.br","tur.br","tv.br","udi.br","vet.br","vix.br","vlog.br","wiki.br","zlg.br","bs","com.bs","net.bs","org.bs","edu.bs","gov.bs","bt","com.bt","edu.bt","gov.bt","net.bt","org.bt","bv","bw","co.bw","org.bw","by","gov.by","mil.by","com.by","of.by","bz","com.bz","net.bz","org.bz","edu.bz","gov.bz","ca","ab.ca","bc.ca","mb.ca","nb.ca","nf.ca","nl.ca","ns.ca","nt.ca","nu.ca","on.ca","pe.ca","qc.ca","sk.ca","yk.ca","gc.ca","cat","cc","cd","gov.cd","cf","cg","ch","ci","org.ci","or.ci","com.ci","co.ci","edu.ci","ed.ci","ac.ci","net.ci","go.ci","asso.ci","aéroport.ci","int.ci","presse.ci","md.ci","gouv.ci","*.ck","!www.ck","cl","gov.cl","gob.cl","co.cl","mil.cl","cm","co.cm","com.cm","gov.cm","net.cm","cn","ac.cn","com.cn","edu.cn","gov.cn","net.cn","org.cn","mil.cn","公司.cn","网络.cn","網絡.cn","ah.cn","bj.cn","cq.cn","fj.cn","gd.cn","gs.cn","gz.cn","gx.cn","ha.cn","hb.cn","he.cn","hi.cn","hl.cn","hn.cn","jl.cn","js.cn","jx.cn","ln.cn","nm.cn","nx.cn","qh.cn","sc.cn","sd.cn","sh.cn","sn.cn","sx.cn","tj.cn","xj.cn","xz.cn","yn.cn","zj.cn","hk.cn","mo.cn","tw.cn","co","arts.co","com.co","edu.co","firm.co","gov.co","info.co","int.co","mil.co","net.co","nom.co","org.co","rec.co","web.co","com","coop","cr","ac.cr","co.cr","ed.cr","fi.cr","go.cr","or.cr","sa.cr","cu","com.cu","edu.cu","org.cu","net.cu","gov.cu","inf.cu","cv","cw","com.cw","edu.cw","net.cw","org.cw","cx","gov.cx","cy","ac.cy","biz.cy","com.cy","ekloges.cy","gov.cy","ltd.cy","name.cy","net.cy","org.cy","parliament.cy","press.cy","pro.cy","tm.cy","cz","de","dj","dk","dm","com.dm","net.dm","org.dm","edu.dm","gov.dm","do","art.do","com.do","edu.do","gob.do","gov.do","mil.do","net.do","org.do","sld.do","web.do","dz","com.dz","org.dz","net.dz","gov.dz","edu.dz","asso.dz","pol.dz","art.dz","ec","com.ec","info.ec","net.ec","fin.ec","k12.ec","med.ec","pro.ec","org.ec","edu.ec","gov.ec","gob.ec","mil.ec","edu","ee","edu.ee","gov.ee","riik.ee","lib.ee","med.ee","com.ee","pri.ee","aip.ee","org.ee","fie.ee","eg","com.eg","edu.eg","eun.eg","gov.eg","mil.eg","name.eg","net.eg","org.eg","sci.eg","*.er","es","com.es","nom.es","org.es","gob.es","edu.es","et","com.et","gov.et","org.et","edu.et","biz.et","name.et","info.et","net.et","eu","fi","aland.fi","*.fj","*.fk","fm","fo","fr","com.fr","asso.fr","nom.fr","prd.fr","presse.fr","tm.fr","aeroport.fr","assedic.fr","avocat.fr","avoues.fr","cci.fr","chambagri.fr","chirurgiens-dentistes.fr","experts-comptables.fr","geometre-expert.fr","gouv.fr","greta.fr","huissier-justice.fr","medecin.fr","notaires.fr","pharmacien.fr","port.fr","veterinaire.fr","ga","gb","gd","ge","com.ge","edu.ge","gov.ge","org.ge","mil.ge","net.ge","pvt.ge","gf","gg","co.gg","net.gg","org.gg","gh","com.gh","edu.gh","gov.gh","org.gh","mil.gh","gi","com.gi","ltd.gi","gov.gi","mod.gi","edu.gi","org.gi","gl","co.gl","com.gl","edu.gl","net.gl","org.gl","gm","gn","ac.gn","com.gn","edu.gn","gov.gn","org.gn","net.gn","gov","gp","com.gp","net.gp","mobi.gp","edu.gp","org.gp","asso.gp","gq","gr","com.gr","edu.gr","net.gr","org.gr","gov.gr","gs","gt","com.gt","edu.gt","gob.gt","ind.gt","mil.gt","net.gt","org.gt","gu","com.gu","edu.gu","gov.gu","guam.gu","info.gu","net.gu","org.gu","web.gu","gw","gy","co.gy","com.gy","edu.gy","gov.gy","net.gy","org.gy","hk","com.hk","edu.hk","gov.hk","idv.hk","net.hk","org.hk","公司.hk","教育.hk","敎育.hk","政府.hk","個人.hk","个人.hk","箇人.hk","網络.hk","网络.hk","组織.hk","網絡.hk","网絡.hk","组织.hk","組織.hk","組织.hk","hm","hn","com.hn","edu.hn","org.hn","net.hn","mil.hn","gob.hn","hr","iz.hr","from.hr","name.hr","com.hr","ht","com.ht","shop.ht","firm.ht","info.ht","adult.ht","net.ht","pro.ht","org.ht","med.ht","art.ht","coop.ht","pol.ht","asso.ht","edu.ht","rel.ht","gouv.ht","perso.ht","hu","co.hu","info.hu","org.hu","priv.hu","sport.hu","tm.hu","2000.hu","agrar.hu","bolt.hu","casino.hu","city.hu","erotica.hu","erotika.hu","film.hu","forum.hu","games.hu","hotel.hu","ingatlan.hu","jogasz.hu","konyvelo.hu","lakas.hu","media.hu","news.hu","reklam.hu","sex.hu","shop.hu","suli.hu","szex.hu","tozsde.hu","utazas.hu","video.hu","id","ac.id","biz.id","co.id","desa.id","go.id","mil.id","my.id","net.id","or.id","sch.id","web.id","ie","gov.ie","il","ac.il","co.il","gov.il","idf.il","k12.il","muni.il","net.il","org.il","im","ac.im","co.im","com.im","ltd.co.im","net.im","org.im","plc.co.im","tt.im","tv.im","in","co.in","firm.in","net.in","org.in","gen.in","ind.in","nic.in","ac.in","edu.in","res.in","gov.in","mil.in","info","int","eu.int","io","com.io","iq","gov.iq","edu.iq","mil.iq","com.iq","org.iq","net.iq","ir","ac.ir","co.ir","gov.ir","id.ir","net.ir","org.ir","sch.ir","ایران.ir","ايران.ir","is","net.is","com.is","edu.is","gov.is","org.is","int.is","it","gov.it","edu.it","abr.it","abruzzo.it","aosta-valley.it","aostavalley.it","bas.it","basilicata.it","cal.it","calabria.it","cam.it","campania.it","emilia-romagna.it","emiliaromagna.it","emr.it","friuli-v-giulia.it","friuli-ve-giulia.it","friuli-vegiulia.it","friuli-venezia-giulia.it","friuli-veneziagiulia.it","friuli-vgiulia.it","friuliv-giulia.it","friulive-giulia.it","friulivegiulia.it","friulivenezia-giulia.it","friuliveneziagiulia.it","friulivgiulia.it","fvg.it","laz.it","lazio.it","lig.it","liguria.it","lom.it","lombardia.it","lombardy.it","lucania.it","mar.it","marche.it","mol.it","molise.it","piedmont.it","piemonte.it","pmn.it","pug.it","puglia.it","sar.it","sardegna.it","sardinia.it","sic.it","sicilia.it","sicily.it","taa.it","tos.it","toscana.it","trentin-sud-tirol.it","trentin-süd-tirol.it","trentin-sudtirol.it","trentin-südtirol.it","trentin-sued-tirol.it","trentin-suedtirol.it","trentino-a-adige.it","trentino-aadige.it","trentino-alto-adige.it","trentino-altoadige.it","trentino-s-tirol.it","trentino-stirol.it","trentino-sud-tirol.it","trentino-süd-tirol.it","trentino-sudtirol.it","trentino-südtirol.it","trentino-sued-tirol.it","trentino-suedtirol.it","trentino.it","trentinoa-adige.it","trentinoaadige.it","trentinoalto-adige.it","trentinoaltoadige.it","trentinos-tirol.it","trentinostirol.it","trentinosud-tirol.it","trentinosüd-tirol.it","trentinosudtirol.it","trentinosüdtirol.it","trentinosued-tirol.it","trentinosuedtirol.it","trentinsud-tirol.it","trentinsüd-tirol.it","trentinsudtirol.it","trentinsüdtirol.it","trentinsued-tirol.it","trentinsuedtirol.it","tuscany.it","umb.it","umbria.it","val-d-aosta.it","val-daosta.it","vald-aosta.it","valdaosta.it","valle-aosta.it","valle-d-aosta.it","valle-daosta.it","valleaosta.it","valled-aosta.it","valledaosta.it","vallee-aoste.it","vallée-aoste.it","vallee-d-aoste.it","vallée-d-aoste.it","valleeaoste.it","valléeaoste.it","valleedaoste.it","valléedaoste.it","vao.it","vda.it","ven.it","veneto.it","ag.it","agrigento.it","al.it","alessandria.it","alto-adige.it","altoadige.it","an.it","ancona.it","andria-barletta-trani.it","andria-trani-barletta.it","andriabarlettatrani.it","andriatranibarletta.it","ao.it","aosta.it","aoste.it","ap.it","aq.it","aquila.it","ar.it","arezzo.it","ascoli-piceno.it","ascolipiceno.it","asti.it","at.it","av.it","avellino.it","ba.it","balsan-sudtirol.it","balsan-südtirol.it","balsan-suedtirol.it","balsan.it","bari.it","barletta-trani-andria.it","barlettatraniandria.it","belluno.it","benevento.it","bergamo.it","bg.it","bi.it","biella.it","bl.it","bn.it","bo.it","bologna.it","bolzano-altoadige.it","bolzano.it","bozen-sudtirol.it","bozen-südtirol.it","bozen-suedtirol.it","bozen.it","br.it","brescia.it","brindisi.it","bs.it","bt.it","bulsan-sudtirol.it","bulsan-südtirol.it","bulsan-suedtirol.it","bulsan.it","bz.it","ca.it","cagliari.it","caltanissetta.it","campidano-medio.it","campidanomedio.it","campobasso.it","carbonia-iglesias.it","carboniaiglesias.it","carrara-massa.it","carraramassa.it","caserta.it","catania.it","catanzaro.it","cb.it","ce.it","cesena-forli.it","cesena-forlì.it","cesenaforli.it","cesenaforlì.it","ch.it","chieti.it","ci.it","cl.it","cn.it","co.it","como.it","cosenza.it","cr.it","cremona.it","crotone.it","cs.it","ct.it","cuneo.it","cz.it","dell-ogliastra.it","dellogliastra.it","en.it","enna.it","fc.it","fe.it","fermo.it","ferrara.it","fg.it","fi.it","firenze.it","florence.it","fm.it","foggia.it","forli-cesena.it","forlì-cesena.it","forlicesena.it","forlìcesena.it","fr.it","frosinone.it","ge.it","genoa.it","genova.it","go.it","gorizia.it","gr.it","grosseto.it","iglesias-carbonia.it","iglesiascarbonia.it","im.it","imperia.it","is.it","isernia.it","kr.it","la-spezia.it","laquila.it","laspezia.it","latina.it","lc.it","le.it","lecce.it","lecco.it","li.it","livorno.it","lo.it","lodi.it","lt.it","lu.it","lucca.it","macerata.it","mantova.it","massa-carrara.it","massacarrara.it","matera.it","mb.it","mc.it","me.it","medio-campidano.it","mediocampidano.it","messina.it","mi.it","milan.it","milano.it","mn.it","mo.it","modena.it","monza-brianza.it","monza-e-della-brianza.it","monza.it","monzabrianza.it","monzaebrianza.it","monzaedellabrianza.it","ms.it","mt.it","na.it","naples.it","napoli.it","no.it","novara.it","nu.it","nuoro.it","og.it","ogliastra.it","olbia-tempio.it","olbiatempio.it","or.it","oristano.it","ot.it","pa.it","padova.it","padua.it","palermo.it","parma.it","pavia.it","pc.it","pd.it","pe.it","perugia.it","pesaro-urbino.it","pesarourbino.it","pescara.it","pg.it","pi.it","piacenza.it","pisa.it","pistoia.it","pn.it","po.it","pordenone.it","potenza.it","pr.it","prato.it","pt.it","pu.it","pv.it","pz.it","ra.it","ragusa.it","ravenna.it","rc.it","re.it","reggio-calabria.it","reggio-emilia.it","reggiocalabria.it","reggioemilia.it","rg.it","ri.it","rieti.it","rimini.it","rm.it","rn.it","ro.it","roma.it","rome.it","rovigo.it","sa.it","salerno.it","sassari.it","savona.it","si.it","siena.it","siracusa.it","so.it","sondrio.it","sp.it","sr.it","ss.it","suedtirol.it","südtirol.it","sv.it","ta.it","taranto.it","te.it","tempio-olbia.it","tempioolbia.it","teramo.it","terni.it","tn.it","to.it","torino.it","tp.it","tr.it","trani-andria-barletta.it","trani-barletta-andria.it","traniandriabarletta.it","tranibarlettaandria.it","trapani.it","trento.it","treviso.it","trieste.it","ts.it","turin.it","tv.it","ud.it","udine.it","urbino-pesaro.it","urbinopesaro.it","va.it","varese.it","vb.it","vc.it","ve.it","venezia.it","venice.it","verbania.it","vercelli.it","verona.it","vi.it","vibo-valentia.it","vibovalentia.it","vicenza.it","viterbo.it","vr.it","vs.it","vt.it","vv.it","je","co.je","net.je","org.je","*.jm","jo","com.jo","org.jo","net.jo","edu.jo","sch.jo","gov.jo","mil.jo","name.jo","jobs","jp","ac.jp","ad.jp","co.jp","ed.jp","go.jp","gr.jp","lg.jp","ne.jp","or.jp","aichi.jp","akita.jp","aomori.jp","chiba.jp","ehime.jp","fukui.jp","fukuoka.jp","fukushima.jp","gifu.jp","gunma.jp","hiroshima.jp","hokkaido.jp","hyogo.jp","ibaraki.jp","ishikawa.jp","iwate.jp","kagawa.jp","kagoshima.jp","kanagawa.jp","kochi.jp","kumamoto.jp","kyoto.jp","mie.jp","miyagi.jp","miyazaki.jp","nagano.jp","nagasaki.jp","nara.jp","niigata.jp","oita.jp","okayama.jp","okinawa.jp","osaka.jp","saga.jp","saitama.jp","shiga.jp","shimane.jp","shizuoka.jp","tochigi.jp","tokushima.jp","tokyo.jp","tottori.jp","toyama.jp","wakayama.jp","yamagata.jp","yamaguchi.jp","yamanashi.jp","栃木.jp","愛知.jp","愛媛.jp","兵庫.jp","熊本.jp","茨城.jp","北海道.jp","千葉.jp","和歌山.jp","長崎.jp","長野.jp","新潟.jp","青森.jp","静岡.jp","東京.jp","石川.jp","埼玉.jp","三重.jp","京都.jp","佐賀.jp","大分.jp","大阪.jp","奈良.jp","宮城.jp","宮崎.jp","富山.jp","山口.jp","山形.jp","山梨.jp","岩手.jp","岐阜.jp","岡山.jp","島根.jp","広島.jp","徳島.jp","沖縄.jp","滋賀.jp","神奈川.jp","福井.jp","福岡.jp","福島.jp","秋田.jp","群馬.jp","香川.jp","高知.jp","鳥取.jp","鹿児島.jp","*.kawasaki.jp","*.kitakyushu.jp","*.kobe.jp","*.nagoya.jp","*.sapporo.jp","*.sendai.jp","*.yokohama.jp","!city.kawasaki.jp","!city.kitakyushu.jp","!city.kobe.jp","!city.nagoya.jp","!city.sapporo.jp","!city.sendai.jp","!city.yokohama.jp","aisai.aichi.jp","ama.aichi.jp","anjo.aichi.jp","asuke.aichi.jp","chiryu.aichi.jp","chita.aichi.jp","fuso.aichi.jp","gamagori.aichi.jp","handa.aichi.jp","hazu.aichi.jp","hekinan.aichi.jp","higashiura.aichi.jp","ichinomiya.aichi.jp","inazawa.aichi.jp","inuyama.aichi.jp","isshiki.aichi.jp","iwakura.aichi.jp","kanie.aichi.jp","kariya.aichi.jp","kasugai.aichi.jp","kira.aichi.jp","kiyosu.aichi.jp","komaki.aichi.jp","konan.aichi.jp","kota.aichi.jp","mihama.aichi.jp","miyoshi.aichi.jp","nishio.aichi.jp","nisshin.aichi.jp","obu.aichi.jp","oguchi.aichi.jp","oharu.aichi.jp","okazaki.aichi.jp","owariasahi.aichi.jp","seto.aichi.jp","shikatsu.aichi.jp","shinshiro.aichi.jp","shitara.aichi.jp","tahara.aichi.jp","takahama.aichi.jp","tobishima.aichi.jp","toei.aichi.jp","togo.aichi.jp","tokai.aichi.jp","tokoname.aichi.jp","toyoake.aichi.jp","toyohashi.aichi.jp","toyokawa.aichi.jp","toyone.aichi.jp","toyota.aichi.jp","tsushima.aichi.jp","yatomi.aichi.jp","akita.akita.jp","daisen.akita.jp","fujisato.akita.jp","gojome.akita.jp","hachirogata.akita.jp","happou.akita.jp","higashinaruse.akita.jp","honjo.akita.jp","honjyo.akita.jp","ikawa.akita.jp","kamikoani.akita.jp","kamioka.akita.jp","katagami.akita.jp","kazuno.akita.jp","kitaakita.akita.jp","kosaka.akita.jp","kyowa.akita.jp","misato.akita.jp","mitane.akita.jp","moriyoshi.akita.jp","nikaho.akita.jp","noshiro.akita.jp","odate.akita.jp","oga.akita.jp","ogata.akita.jp","semboku.akita.jp","yokote.akita.jp","yurihonjo.akita.jp","aomori.aomori.jp","gonohe.aomori.jp","hachinohe.aomori.jp","hashikami.aomori.jp","hiranai.aomori.jp","hirosaki.aomori.jp","itayanagi.aomori.jp","kuroishi.aomori.jp","misawa.aomori.jp","mutsu.aomori.jp","nakadomari.aomori.jp","noheji.aomori.jp","oirase.aomori.jp","owani.aomori.jp","rokunohe.aomori.jp","sannohe.aomori.jp","shichinohe.aomori.jp","shingo.aomori.jp","takko.aomori.jp","towada.aomori.jp","tsugaru.aomori.jp","tsuruta.aomori.jp","abiko.chiba.jp","asahi.chiba.jp","chonan.chiba.jp","chosei.chiba.jp","choshi.chiba.jp","chuo.chiba.jp","funabashi.chiba.jp","futtsu.chiba.jp","hanamigawa.chiba.jp","ichihara.chiba.jp","ichikawa.chiba.jp","ichinomiya.chiba.jp","inzai.chiba.jp","isumi.chiba.jp","kamagaya.chiba.jp","kamogawa.chiba.jp","kashiwa.chiba.jp","katori.chiba.jp","katsuura.chiba.jp","kimitsu.chiba.jp","kisarazu.chiba.jp","kozaki.chiba.jp","kujukuri.chiba.jp","kyonan.chiba.jp","matsudo.chiba.jp","midori.chiba.jp","mihama.chiba.jp","minamiboso.chiba.jp","mobara.chiba.jp","mutsuzawa.chiba.jp","nagara.chiba.jp","nagareyama.chiba.jp","narashino.chiba.jp","narita.chiba.jp","noda.chiba.jp","oamishirasato.chiba.jp","omigawa.chiba.jp","onjuku.chiba.jp","otaki.chiba.jp","sakae.chiba.jp","sakura.chiba.jp","shimofusa.chiba.jp","shirako.chiba.jp","shiroi.chiba.jp","shisui.chiba.jp","sodegaura.chiba.jp","sosa.chiba.jp","tako.chiba.jp","tateyama.chiba.jp","togane.chiba.jp","tohnosho.chiba.jp","tomisato.chiba.jp","urayasu.chiba.jp","yachimata.chiba.jp","yachiyo.chiba.jp","yokaichiba.chiba.jp","yokoshibahikari.chiba.jp","yotsukaido.chiba.jp","ainan.ehime.jp","honai.ehime.jp","ikata.ehime.jp","imabari.ehime.jp","iyo.ehime.jp","kamijima.ehime.jp","kihoku.ehime.jp","kumakogen.ehime.jp","masaki.ehime.jp","matsuno.ehime.jp","matsuyama.ehime.jp","namikata.ehime.jp","niihama.ehime.jp","ozu.ehime.jp","saijo.ehime.jp","seiyo.ehime.jp","shikokuchuo.ehime.jp","tobe.ehime.jp","toon.ehime.jp","uchiko.ehime.jp","uwajima.ehime.jp","yawatahama.ehime.jp","echizen.fukui.jp","eiheiji.fukui.jp","fukui.fukui.jp","ikeda.fukui.jp","katsuyama.fukui.jp","mihama.fukui.jp","minamiechizen.fukui.jp","obama.fukui.jp","ohi.fukui.jp","ono.fukui.jp","sabae.fukui.jp","sakai.fukui.jp","takahama.fukui.jp","tsuruga.fukui.jp","wakasa.fukui.jp","ashiya.fukuoka.jp","buzen.fukuoka.jp","chikugo.fukuoka.jp","chikuho.fukuoka.jp","chikujo.fukuoka.jp","chikushino.fukuoka.jp","chikuzen.fukuoka.jp","chuo.fukuoka.jp","dazaifu.fukuoka.jp","fukuchi.fukuoka.jp","hakata.fukuoka.jp","higashi.fukuoka.jp","hirokawa.fukuoka.jp","hisayama.fukuoka.jp","iizuka.fukuoka.jp","inatsuki.fukuoka.jp","kaho.fukuoka.jp","kasuga.fukuoka.jp","kasuya.fukuoka.jp","kawara.fukuoka.jp","keisen.fukuoka.jp","koga.fukuoka.jp","kurate.fukuoka.jp","kurogi.fukuoka.jp","kurume.fukuoka.jp","minami.fukuoka.jp","miyako.fukuoka.jp","miyama.fukuoka.jp","miyawaka.fukuoka.jp","mizumaki.fukuoka.jp","munakata.fukuoka.jp","nakagawa.fukuoka.jp","nakama.fukuoka.jp","nishi.fukuoka.jp","nogata.fukuoka.jp","ogori.fukuoka.jp","okagaki.fukuoka.jp","okawa.fukuoka.jp","oki.fukuoka.jp","omuta.fukuoka.jp","onga.fukuoka.jp","onojo.fukuoka.jp","oto.fukuoka.jp","saigawa.fukuoka.jp","sasaguri.fukuoka.jp","shingu.fukuoka.jp","shinyoshitomi.fukuoka.jp","shonai.fukuoka.jp","soeda.fukuoka.jp","sue.fukuoka.jp","tachiarai.fukuoka.jp","tagawa.fukuoka.jp","takata.fukuoka.jp","toho.fukuoka.jp","toyotsu.fukuoka.jp","tsuiki.fukuoka.jp","ukiha.fukuoka.jp","umi.fukuoka.jp","usui.fukuoka.jp","yamada.fukuoka.jp","yame.fukuoka.jp","yanagawa.fukuoka.jp","yukuhashi.fukuoka.jp","aizubange.fukushima.jp","aizumisato.fukushima.jp","aizuwakamatsu.fukushima.jp","asakawa.fukushima.jp","bandai.fukushima.jp","date.fukushima.jp","fukushima.fukushima.jp","furudono.fukushima.jp","futaba.fukushima.jp","hanawa.fukushima.jp","higashi.fukushima.jp","hirata.fukushima.jp","hirono.fukushima.jp","iitate.fukushima.jp","inawashiro.fukushima.jp","ishikawa.fukushima.jp","iwaki.fukushima.jp","izumizaki.fukushima.jp","kagamiishi.fukushima.jp","kaneyama.fukushima.jp","kawamata.fukushima.jp","kitakata.fukushima.jp","kitashiobara.fukushima.jp","koori.fukushima.jp","koriyama.fukushima.jp","kunimi.fukushima.jp","miharu.fukushima.jp","mishima.fukushima.jp","namie.fukushima.jp","nango.fukushima.jp","nishiaizu.fukushima.jp","nishigo.fukushima.jp","okuma.fukushima.jp","omotego.fukushima.jp","ono.fukushima.jp","otama.fukushima.jp","samegawa.fukushima.jp","shimogo.fukushima.jp","shirakawa.fukushima.jp","showa.fukushima.jp","soma.fukushima.jp","sukagawa.fukushima.jp","taishin.fukushima.jp","tamakawa.fukushima.jp","tanagura.fukushima.jp","tenei.fukushima.jp","yabuki.fukushima.jp","yamato.fukushima.jp","yamatsuri.fukushima.jp","yanaizu.fukushima.jp","yugawa.fukushima.jp","anpachi.gifu.jp","ena.gifu.jp","gifu.gifu.jp","ginan.gifu.jp","godo.gifu.jp","gujo.gifu.jp","hashima.gifu.jp","hichiso.gifu.jp","hida.gifu.jp","higashishirakawa.gifu.jp","ibigawa.gifu.jp","ikeda.gifu.jp","kakamigahara.gifu.jp","kani.gifu.jp","kasahara.gifu.jp","kasamatsu.gifu.jp","kawaue.gifu.jp","kitagata.gifu.jp","mino.gifu.jp","minokamo.gifu.jp","mitake.gifu.jp","mizunami.gifu.jp","motosu.gifu.jp","nakatsugawa.gifu.jp","ogaki.gifu.jp","sakahogi.gifu.jp","seki.gifu.jp","sekigahara.gifu.jp","shirakawa.gifu.jp","tajimi.gifu.jp","takayama.gifu.jp","tarui.gifu.jp","toki.gifu.jp","tomika.gifu.jp","wanouchi.gifu.jp","yamagata.gifu.jp","yaotsu.gifu.jp","yoro.gifu.jp","annaka.gunma.jp","chiyoda.gunma.jp","fujioka.gunma.jp","higashiagatsuma.gunma.jp","isesaki.gunma.jp","itakura.gunma.jp","kanna.gunma.jp","kanra.gunma.jp","katashina.gunma.jp","kawaba.gunma.jp","kiryu.gunma.jp","kusatsu.gunma.jp","maebashi.gunma.jp","meiwa.gunma.jp","midori.gunma.jp","minakami.gunma.jp","naganohara.gunma.jp","nakanojo.gunma.jp","nanmoku.gunma.jp","numata.gunma.jp","oizumi.gunma.jp","ora.gunma.jp","ota.gunma.jp","shibukawa.gunma.jp","shimonita.gunma.jp","shinto.gunma.jp","showa.gunma.jp","takasaki.gunma.jp","takayama.gunma.jp","tamamura.gunma.jp","tatebayashi.gunma.jp","tomioka.gunma.jp","tsukiyono.gunma.jp","tsumagoi.gunma.jp","ueno.gunma.jp","yoshioka.gunma.jp","asaminami.hiroshima.jp","daiwa.hiroshima.jp","etajima.hiroshima.jp","fuchu.hiroshima.jp","fukuyama.hiroshima.jp","hatsukaichi.hiroshima.jp","higashihiroshima.hiroshima.jp","hongo.hiroshima.jp","jinsekikogen.hiroshima.jp","kaita.hiroshima.jp","kui.hiroshima.jp","kumano.hiroshima.jp","kure.hiroshima.jp","mihara.hiroshima.jp","miyoshi.hiroshima.jp","naka.hiroshima.jp","onomichi.hiroshima.jp","osakikamijima.hiroshima.jp","otake.hiroshima.jp","saka.hiroshima.jp","sera.hiroshima.jp","seranishi.hiroshima.jp","shinichi.hiroshima.jp","shobara.hiroshima.jp","takehara.hiroshima.jp","abashiri.hokkaido.jp","abira.hokkaido.jp","aibetsu.hokkaido.jp","akabira.hokkaido.jp","akkeshi.hokkaido.jp","asahikawa.hokkaido.jp","ashibetsu.hokkaido.jp","ashoro.hokkaido.jp","assabu.hokkaido.jp","atsuma.hokkaido.jp","bibai.hokkaido.jp","biei.hokkaido.jp","bifuka.hokkaido.jp","bihoro.hokkaido.jp","biratori.hokkaido.jp","chippubetsu.hokkaido.jp","chitose.hokkaido.jp","date.hokkaido.jp","ebetsu.hokkaido.jp","embetsu.hokkaido.jp","eniwa.hokkaido.jp","erimo.hokkaido.jp","esan.hokkaido.jp","esashi.hokkaido.jp","fukagawa.hokkaido.jp","fukushima.hokkaido.jp","furano.hokkaido.jp","furubira.hokkaido.jp","haboro.hokkaido.jp","hakodate.hokkaido.jp","hamatonbetsu.hokkaido.jp","hidaka.hokkaido.jp","higashikagura.hokkaido.jp","higashikawa.hokkaido.jp","hiroo.hokkaido.jp","hokuryu.hokkaido.jp","hokuto.hokkaido.jp","honbetsu.hokkaido.jp","horokanai.hokkaido.jp","horonobe.hokkaido.jp","ikeda.hokkaido.jp","imakane.hokkaido.jp","ishikari.hokkaido.jp","iwamizawa.hokkaido.jp","iwanai.hokkaido.jp","kamifurano.hokkaido.jp","kamikawa.hokkaido.jp","kamishihoro.hokkaido.jp","kamisunagawa.hokkaido.jp","kamoenai.hokkaido.jp","kayabe.hokkaido.jp","kembuchi.hokkaido.jp","kikonai.hokkaido.jp","kimobetsu.hokkaido.jp","kitahiroshima.hokkaido.jp","kitami.hokkaido.jp","kiyosato.hokkaido.jp","koshimizu.hokkaido.jp","kunneppu.hokkaido.jp","kuriyama.hokkaido.jp","kuromatsunai.hokkaido.jp","kushiro.hokkaido.jp","kutchan.hokkaido.jp","kyowa.hokkaido.jp","mashike.hokkaido.jp","matsumae.hokkaido.jp","mikasa.hokkaido.jp","minamifurano.hokkaido.jp","mombetsu.hokkaido.jp","moseushi.hokkaido.jp","mukawa.hokkaido.jp","muroran.hokkaido.jp","naie.hokkaido.jp","nakagawa.hokkaido.jp","nakasatsunai.hokkaido.jp","nakatombetsu.hokkaido.jp","nanae.hokkaido.jp","nanporo.hokkaido.jp","nayoro.hokkaido.jp","nemuro.hokkaido.jp","niikappu.hokkaido.jp","niki.hokkaido.jp","nishiokoppe.hokkaido.jp","noboribetsu.hokkaido.jp","numata.hokkaido.jp","obihiro.hokkaido.jp","obira.hokkaido.jp","oketo.hokkaido.jp","okoppe.hokkaido.jp","otaru.hokkaido.jp","otobe.hokkaido.jp","otofuke.hokkaido.jp","otoineppu.hokkaido.jp","oumu.hokkaido.jp","ozora.hokkaido.jp","pippu.hokkaido.jp","rankoshi.hokkaido.jp","rebun.hokkaido.jp","rikubetsu.hokkaido.jp","rishiri.hokkaido.jp","rishirifuji.hokkaido.jp","saroma.hokkaido.jp","sarufutsu.hokkaido.jp","shakotan.hokkaido.jp","shari.hokkaido.jp","shibecha.hokkaido.jp","shibetsu.hokkaido.jp","shikabe.hokkaido.jp","shikaoi.hokkaido.jp","shimamaki.hokkaido.jp","shimizu.hokkaido.jp","shimokawa.hokkaido.jp","shinshinotsu.hokkaido.jp","shintoku.hokkaido.jp","shiranuka.hokkaido.jp","shiraoi.hokkaido.jp","shiriuchi.hokkaido.jp","sobetsu.hokkaido.jp","sunagawa.hokkaido.jp","taiki.hokkaido.jp","takasu.hokkaido.jp","takikawa.hokkaido.jp","takinoue.hokkaido.jp","teshikaga.hokkaido.jp","tobetsu.hokkaido.jp","tohma.hokkaido.jp","tomakomai.hokkaido.jp","tomari.hokkaido.jp","toya.hokkaido.jp","toyako.hokkaido.jp","toyotomi.hokkaido.jp","toyoura.hokkaido.jp","tsubetsu.hokkaido.jp","tsukigata.hokkaido.jp","urakawa.hokkaido.jp","urausu.hokkaido.jp","uryu.hokkaido.jp","utashinai.hokkaido.jp","wakkanai.hokkaido.jp","wassamu.hokkaido.jp","yakumo.hokkaido.jp","yoichi.hokkaido.jp","aioi.hyogo.jp","akashi.hyogo.jp","ako.hyogo.jp","amagasaki.hyogo.jp","aogaki.hyogo.jp","asago.hyogo.jp","ashiya.hyogo.jp","awaji.hyogo.jp","fukusaki.hyogo.jp","goshiki.hyogo.jp","harima.hyogo.jp","himeji.hyogo.jp","ichikawa.hyogo.jp","inagawa.hyogo.jp","itami.hyogo.jp","kakogawa.hyogo.jp","kamigori.hyogo.jp","kamikawa.hyogo.jp","kasai.hyogo.jp","kasuga.hyogo.jp","kawanishi.hyogo.jp","miki.hyogo.jp","minamiawaji.hyogo.jp","nishinomiya.hyogo.jp","nishiwaki.hyogo.jp","ono.hyogo.jp","sanda.hyogo.jp","sannan.hyogo.jp","sasayama.hyogo.jp","sayo.hyogo.jp","shingu.hyogo.jp","shinonsen.hyogo.jp","shiso.hyogo.jp","sumoto.hyogo.jp","taishi.hyogo.jp","taka.hyogo.jp","takarazuka.hyogo.jp","takasago.hyogo.jp","takino.hyogo.jp","tamba.hyogo.jp","tatsuno.hyogo.jp","toyooka.hyogo.jp","yabu.hyogo.jp","yashiro.hyogo.jp","yoka.hyogo.jp","yokawa.hyogo.jp","ami.ibaraki.jp","asahi.ibaraki.jp","bando.ibaraki.jp","chikusei.ibaraki.jp","daigo.ibaraki.jp","fujishiro.ibaraki.jp","hitachi.ibaraki.jp","hitachinaka.ibaraki.jp","hitachiomiya.ibaraki.jp","hitachiota.ibaraki.jp","ibaraki.ibaraki.jp","ina.ibaraki.jp","inashiki.ibaraki.jp","itako.ibaraki.jp","iwama.ibaraki.jp","joso.ibaraki.jp","kamisu.ibaraki.jp","kasama.ibaraki.jp","kashima.ibaraki.jp","kasumigaura.ibaraki.jp","koga.ibaraki.jp","miho.ibaraki.jp","mito.ibaraki.jp","moriya.ibaraki.jp","naka.ibaraki.jp","namegata.ibaraki.jp","oarai.ibaraki.jp","ogawa.ibaraki.jp","omitama.ibaraki.jp","ryugasaki.ibaraki.jp","sakai.ibaraki.jp","sakuragawa.ibaraki.jp","shimodate.ibaraki.jp","shimotsuma.ibaraki.jp","shirosato.ibaraki.jp","sowa.ibaraki.jp","suifu.ibaraki.jp","takahagi.ibaraki.jp","tamatsukuri.ibaraki.jp","tokai.ibaraki.jp","tomobe.ibaraki.jp","tone.ibaraki.jp","toride.ibaraki.jp","tsuchiura.ibaraki.jp","tsukuba.ibaraki.jp","uchihara.ibaraki.jp","ushiku.ibaraki.jp","yachiyo.ibaraki.jp","yamagata.ibaraki.jp","yawara.ibaraki.jp","yuki.ibaraki.jp","anamizu.ishikawa.jp","hakui.ishikawa.jp","hakusan.ishikawa.jp","kaga.ishikawa.jp","kahoku.ishikawa.jp","kanazawa.ishikawa.jp","kawakita.ishikawa.jp","komatsu.ishikawa.jp","nakanoto.ishikawa.jp","nanao.ishikawa.jp","nomi.ishikawa.jp","nonoichi.ishikawa.jp","noto.ishikawa.jp","shika.ishikawa.jp","suzu.ishikawa.jp","tsubata.ishikawa.jp","tsurugi.ishikawa.jp","uchinada.ishikawa.jp","wajima.ishikawa.jp","fudai.iwate.jp","fujisawa.iwate.jp","hanamaki.iwate.jp","hiraizumi.iwate.jp","hirono.iwate.jp","ichinohe.iwate.jp","ichinoseki.iwate.jp","iwaizumi.iwate.jp","iwate.iwate.jp","joboji.iwate.jp","kamaishi.iwate.jp","kanegasaki.iwate.jp","karumai.iwate.jp","kawai.iwate.jp","kitakami.iwate.jp","kuji.iwate.jp","kunohe.iwate.jp","kuzumaki.iwate.jp","miyako.iwate.jp","mizusawa.iwate.jp","morioka.iwate.jp","ninohe.iwate.jp","noda.iwate.jp","ofunato.iwate.jp","oshu.iwate.jp","otsuchi.iwate.jp","rikuzentakata.iwate.jp","shiwa.iwate.jp","shizukuishi.iwate.jp","sumita.iwate.jp","tanohata.iwate.jp","tono.iwate.jp","yahaba.iwate.jp","yamada.iwate.jp","ayagawa.kagawa.jp","higashikagawa.kagawa.jp","kanonji.kagawa.jp","kotohira.kagawa.jp","manno.kagawa.jp","marugame.kagawa.jp","mitoyo.kagawa.jp","naoshima.kagawa.jp","sanuki.kagawa.jp","tadotsu.kagawa.jp","takamatsu.kagawa.jp","tonosho.kagawa.jp","uchinomi.kagawa.jp","utazu.kagawa.jp","zentsuji.kagawa.jp","akune.kagoshima.jp","amami.kagoshima.jp","hioki.kagoshima.jp","isa.kagoshima.jp","isen.kagoshima.jp","izumi.kagoshima.jp","kagoshima.kagoshima.jp","kanoya.kagoshima.jp","kawanabe.kagoshima.jp","kinko.kagoshima.jp","kouyama.kagoshima.jp","makurazaki.kagoshima.jp","matsumoto.kagoshima.jp","minamitane.kagoshima.jp","nakatane.kagoshima.jp","nishinoomote.kagoshima.jp","satsumasendai.kagoshima.jp","soo.kagoshima.jp","tarumizu.kagoshima.jp","yusui.kagoshima.jp","aikawa.kanagawa.jp","atsugi.kanagawa.jp","ayase.kanagawa.jp","chigasaki.kanagawa.jp","ebina.kanagawa.jp","fujisawa.kanagawa.jp","hadano.kanagawa.jp","hakone.kanagawa.jp","hiratsuka.kanagawa.jp","isehara.kanagawa.jp","kaisei.kanagawa.jp","kamakura.kanagawa.jp","kiyokawa.kanagawa.jp","matsuda.kanagawa.jp","minamiashigara.kanagawa.jp","miura.kanagawa.jp","nakai.kanagawa.jp","ninomiya.kanagawa.jp","odawara.kanagawa.jp","oi.kanagawa.jp","oiso.kanagawa.jp","sagamihara.kanagawa.jp","samukawa.kanagawa.jp","tsukui.kanagawa.jp","yamakita.kanagawa.jp","yamato.kanagawa.jp","yokosuka.kanagawa.jp","yugawara.kanagawa.jp","zama.kanagawa.jp","zushi.kanagawa.jp","aki.kochi.jp","geisei.kochi.jp","hidaka.kochi.jp","higashitsuno.kochi.jp","ino.kochi.jp","kagami.kochi.jp","kami.kochi.jp","kitagawa.kochi.jp","kochi.kochi.jp","mihara.kochi.jp","motoyama.kochi.jp","muroto.kochi.jp","nahari.kochi.jp","nakamura.kochi.jp","nankoku.kochi.jp","nishitosa.kochi.jp","niyodogawa.kochi.jp","ochi.kochi.jp","okawa.kochi.jp","otoyo.kochi.jp","otsuki.kochi.jp","sakawa.kochi.jp","sukumo.kochi.jp","susaki.kochi.jp","tosa.kochi.jp","tosashimizu.kochi.jp","toyo.kochi.jp","tsuno.kochi.jp","umaji.kochi.jp","yasuda.kochi.jp","yusuhara.kochi.jp","amakusa.kumamoto.jp","arao.kumamoto.jp","aso.kumamoto.jp","choyo.kumamoto.jp","gyokuto.kumamoto.jp","kamiamakusa.kumamoto.jp","kikuchi.kumamoto.jp","kumamoto.kumamoto.jp","mashiki.kumamoto.jp","mifune.kumamoto.jp","minamata.kumamoto.jp","minamioguni.kumamoto.jp","nagasu.kumamoto.jp","nishihara.kumamoto.jp","oguni.kumamoto.jp","ozu.kumamoto.jp","sumoto.kumamoto.jp","takamori.kumamoto.jp","uki.kumamoto.jp","uto.kumamoto.jp","yamaga.kumamoto.jp","yamato.kumamoto.jp","yatsushiro.kumamoto.jp","ayabe.kyoto.jp","fukuchiyama.kyoto.jp","higashiyama.kyoto.jp","ide.kyoto.jp","ine.kyoto.jp","joyo.kyoto.jp","kameoka.kyoto.jp","kamo.kyoto.jp","kita.kyoto.jp","kizu.kyoto.jp","kumiyama.kyoto.jp","kyotamba.kyoto.jp","kyotanabe.kyoto.jp","kyotango.kyoto.jp","maizuru.kyoto.jp","minami.kyoto.jp","minamiyamashiro.kyoto.jp","miyazu.kyoto.jp","muko.kyoto.jp","nagaokakyo.kyoto.jp","nakagyo.kyoto.jp","nantan.kyoto.jp","oyamazaki.kyoto.jp","sakyo.kyoto.jp","seika.kyoto.jp","tanabe.kyoto.jp","uji.kyoto.jp","ujitawara.kyoto.jp","wazuka.kyoto.jp","yamashina.kyoto.jp","yawata.kyoto.jp","asahi.mie.jp","inabe.mie.jp","ise.mie.jp","kameyama.mie.jp","kawagoe.mie.jp","kiho.mie.jp","kisosaki.mie.jp","kiwa.mie.jp","komono.mie.jp","kumano.mie.jp","kuwana.mie.jp","matsusaka.mie.jp","meiwa.mie.jp","mihama.mie.jp","minamiise.mie.jp","misugi.mie.jp","miyama.mie.jp","nabari.mie.jp","shima.mie.jp","suzuka.mie.jp","tado.mie.jp","taiki.mie.jp","taki.mie.jp","tamaki.mie.jp","toba.mie.jp","tsu.mie.jp","udono.mie.jp","ureshino.mie.jp","watarai.mie.jp","yokkaichi.mie.jp","furukawa.miyagi.jp","higashimatsushima.miyagi.jp","ishinomaki.miyagi.jp","iwanuma.miyagi.jp","kakuda.miyagi.jp","kami.miyagi.jp","kawasaki.miyagi.jp","marumori.miyagi.jp","matsushima.miyagi.jp","minamisanriku.miyagi.jp","misato.miyagi.jp","murata.miyagi.jp","natori.miyagi.jp","ogawara.miyagi.jp","ohira.miyagi.jp","onagawa.miyagi.jp","osaki.miyagi.jp","rifu.miyagi.jp","semine.miyagi.jp","shibata.miyagi.jp","shichikashuku.miyagi.jp","shikama.miyagi.jp","shiogama.miyagi.jp","shiroishi.miyagi.jp","tagajo.miyagi.jp","taiwa.miyagi.jp","tome.miyagi.jp","tomiya.miyagi.jp","wakuya.miyagi.jp","watari.miyagi.jp","yamamoto.miyagi.jp","zao.miyagi.jp","aya.miyazaki.jp","ebino.miyazaki.jp","gokase.miyazaki.jp","hyuga.miyazaki.jp","kadogawa.miyazaki.jp","kawaminami.miyazaki.jp","kijo.miyazaki.jp","kitagawa.miyazaki.jp","kitakata.miyazaki.jp","kitaura.miyazaki.jp","kobayashi.miyazaki.jp","kunitomi.miyazaki.jp","kushima.miyazaki.jp","mimata.miyazaki.jp","miyakonojo.miyazaki.jp","miyazaki.miyazaki.jp","morotsuka.miyazaki.jp","nichinan.miyazaki.jp","nishimera.miyazaki.jp","nobeoka.miyazaki.jp","saito.miyazaki.jp","shiiba.miyazaki.jp","shintomi.miyazaki.jp","takaharu.miyazaki.jp","takanabe.miyazaki.jp","takazaki.miyazaki.jp","tsuno.miyazaki.jp","achi.nagano.jp","agematsu.nagano.jp","anan.nagano.jp","aoki.nagano.jp","asahi.nagano.jp","azumino.nagano.jp","chikuhoku.nagano.jp","chikuma.nagano.jp","chino.nagano.jp","fujimi.nagano.jp","hakuba.nagano.jp","hara.nagano.jp","hiraya.nagano.jp","iida.nagano.jp","iijima.nagano.jp","iiyama.nagano.jp","iizuna.nagano.jp","ikeda.nagano.jp","ikusaka.nagano.jp","ina.nagano.jp","karuizawa.nagano.jp","kawakami.nagano.jp","kiso.nagano.jp","kisofukushima.nagano.jp","kitaaiki.nagano.jp","komagane.nagano.jp","komoro.nagano.jp","matsukawa.nagano.jp","matsumoto.nagano.jp","miasa.nagano.jp","minamiaiki.nagano.jp","minamimaki.nagano.jp","minamiminowa.nagano.jp","minowa.nagano.jp","miyada.nagano.jp","miyota.nagano.jp","mochizuki.nagano.jp","nagano.nagano.jp","nagawa.nagano.jp","nagiso.nagano.jp","nakagawa.nagano.jp","nakano.nagano.jp","nozawaonsen.nagano.jp","obuse.nagano.jp","ogawa.nagano.jp","okaya.nagano.jp","omachi.nagano.jp","omi.nagano.jp","ookuwa.nagano.jp","ooshika.nagano.jp","otaki.nagano.jp","otari.nagano.jp","sakae.nagano.jp","sakaki.nagano.jp","saku.nagano.jp","sakuho.nagano.jp","shimosuwa.nagano.jp","shinanomachi.nagano.jp","shiojiri.nagano.jp","suwa.nagano.jp","suzaka.nagano.jp","takagi.nagano.jp","takamori.nagano.jp","takayama.nagano.jp","tateshina.nagano.jp","tatsuno.nagano.jp","togakushi.nagano.jp","togura.nagano.jp","tomi.nagano.jp","ueda.nagano.jp","wada.nagano.jp","yamagata.nagano.jp","yamanouchi.nagano.jp","yasaka.nagano.jp","yasuoka.nagano.jp","chijiwa.nagasaki.jp","futsu.nagasaki.jp","goto.nagasaki.jp","hasami.nagasaki.jp","hirado.nagasaki.jp","iki.nagasaki.jp","isahaya.nagasaki.jp","kawatana.nagasaki.jp","kuchinotsu.nagasaki.jp","matsuura.nagasaki.jp","nagasaki.nagasaki.jp","obama.nagasaki.jp","omura.nagasaki.jp","oseto.nagasaki.jp","saikai.nagasaki.jp","sasebo.nagasaki.jp","seihi.nagasaki.jp","shimabara.nagasaki.jp","shinkamigoto.nagasaki.jp","togitsu.nagasaki.jp","tsushima.nagasaki.jp","unzen.nagasaki.jp","ando.nara.jp","gose.nara.jp","heguri.nara.jp","higashiyoshino.nara.jp","ikaruga.nara.jp","ikoma.nara.jp","kamikitayama.nara.jp","kanmaki.nara.jp","kashiba.nara.jp","kashihara.nara.jp","katsuragi.nara.jp","kawai.nara.jp","kawakami.nara.jp","kawanishi.nara.jp","koryo.nara.jp","kurotaki.nara.jp","mitsue.nara.jp","miyake.nara.jp","nara.nara.jp","nosegawa.nara.jp","oji.nara.jp","ouda.nara.jp","oyodo.nara.jp","sakurai.nara.jp","sango.nara.jp","shimoichi.nara.jp","shimokitayama.nara.jp","shinjo.nara.jp","soni.nara.jp","takatori.nara.jp","tawaramoto.nara.jp","tenkawa.nara.jp","tenri.nara.jp","uda.nara.jp","yamatokoriyama.nara.jp","yamatotakada.nara.jp","yamazoe.nara.jp","yoshino.nara.jp","aga.niigata.jp","agano.niigata.jp","gosen.niigata.jp","itoigawa.niigata.jp","izumozaki.niigata.jp","joetsu.niigata.jp","kamo.niigata.jp","kariwa.niigata.jp","kashiwazaki.niigata.jp","minamiuonuma.niigata.jp","mitsuke.niigata.jp","muika.niigata.jp","murakami.niigata.jp","myoko.niigata.jp","nagaoka.niigata.jp","niigata.niigata.jp","ojiya.niigata.jp","omi.niigata.jp","sado.niigata.jp","sanjo.niigata.jp","seiro.niigata.jp","seirou.niigata.jp","sekikawa.niigata.jp","shibata.niigata.jp","tagami.niigata.jp","tainai.niigata.jp","tochio.niigata.jp","tokamachi.niigata.jp","tsubame.niigata.jp","tsunan.niigata.jp","uonuma.niigata.jp","yahiko.niigata.jp","yoita.niigata.jp","yuzawa.niigata.jp","beppu.oita.jp","bungoono.oita.jp","bungotakada.oita.jp","hasama.oita.jp","hiji.oita.jp","himeshima.oita.jp","hita.oita.jp","kamitsue.oita.jp","kokonoe.oita.jp","kuju.oita.jp","kunisaki.oita.jp","kusu.oita.jp","oita.oita.jp","saiki.oita.jp","taketa.oita.jp","tsukumi.oita.jp","usa.oita.jp","usuki.oita.jp","yufu.oita.jp","akaiwa.okayama.jp","asakuchi.okayama.jp","bizen.okayama.jp","hayashima.okayama.jp","ibara.okayama.jp","kagamino.okayama.jp","kasaoka.okayama.jp","kibichuo.okayama.jp","kumenan.okayama.jp","kurashiki.okayama.jp","maniwa.okayama.jp","misaki.okayama.jp","nagi.okayama.jp","niimi.okayama.jp","nishiawakura.okayama.jp","okayama.okayama.jp","satosho.okayama.jp","setouchi.okayama.jp","shinjo.okayama.jp","shoo.okayama.jp","soja.okayama.jp","takahashi.okayama.jp","tamano.okayama.jp","tsuyama.okayama.jp","wake.okayama.jp","yakage.okayama.jp","aguni.okinawa.jp","ginowan.okinawa.jp","ginoza.okinawa.jp","gushikami.okinawa.jp","haebaru.okinawa.jp","higashi.okinawa.jp","hirara.okinawa.jp","iheya.okinawa.jp","ishigaki.okinawa.jp","ishikawa.okinawa.jp","itoman.okinawa.jp","izena.okinawa.jp","kadena.okinawa.jp","kin.okinawa.jp","kitadaito.okinawa.jp","kitanakagusuku.okinawa.jp","kumejima.okinawa.jp","kunigami.okinawa.jp","minamidaito.okinawa.jp","motobu.okinawa.jp","nago.okinawa.jp","naha.okinawa.jp","nakagusuku.okinawa.jp","nakijin.okinawa.jp","nanjo.okinawa.jp","nishihara.okinawa.jp","ogimi.okinawa.jp","okinawa.okinawa.jp","onna.okinawa.jp","shimoji.okinawa.jp","taketomi.okinawa.jp","tarama.okinawa.jp","tokashiki.okinawa.jp","tomigusuku.okinawa.jp","tonaki.okinawa.jp","urasoe.okinawa.jp","uruma.okinawa.jp","yaese.okinawa.jp","yomitan.okinawa.jp","yonabaru.okinawa.jp","yonaguni.okinawa.jp","zamami.okinawa.jp","abeno.osaka.jp","chihayaakasaka.osaka.jp","chuo.osaka.jp","daito.osaka.jp","fujiidera.osaka.jp","habikino.osaka.jp","hannan.osaka.jp","higashiosaka.osaka.jp","higashisumiyoshi.osaka.jp","higashiyodogawa.osaka.jp","hirakata.osaka.jp","ibaraki.osaka.jp","ikeda.osaka.jp","izumi.osaka.jp","izumiotsu.osaka.jp","izumisano.osaka.jp","kadoma.osaka.jp","kaizuka.osaka.jp","kanan.osaka.jp","kashiwara.osaka.jp","katano.osaka.jp","kawachinagano.osaka.jp","kishiwada.osaka.jp","kita.osaka.jp","kumatori.osaka.jp","matsubara.osaka.jp","minato.osaka.jp","minoh.osaka.jp","misaki.osaka.jp","moriguchi.osaka.jp","neyagawa.osaka.jp","nishi.osaka.jp","nose.osaka.jp","osakasayama.osaka.jp","sakai.osaka.jp","sayama.osaka.jp","sennan.osaka.jp","settsu.osaka.jp","shijonawate.osaka.jp","shimamoto.osaka.jp","suita.osaka.jp","tadaoka.osaka.jp","taishi.osaka.jp","tajiri.osaka.jp","takaishi.osaka.jp","takatsuki.osaka.jp","tondabayashi.osaka.jp","toyonaka.osaka.jp","toyono.osaka.jp","yao.osaka.jp","ariake.saga.jp","arita.saga.jp","fukudomi.saga.jp","genkai.saga.jp","hamatama.saga.jp","hizen.saga.jp","imari.saga.jp","kamimine.saga.jp","kanzaki.saga.jp","karatsu.saga.jp","kashima.saga.jp","kitagata.saga.jp","kitahata.saga.jp","kiyama.saga.jp","kouhoku.saga.jp","kyuragi.saga.jp","nishiarita.saga.jp","ogi.saga.jp","omachi.saga.jp","ouchi.saga.jp","saga.saga.jp","shiroishi.saga.jp","taku.saga.jp","tara.saga.jp","tosu.saga.jp","yoshinogari.saga.jp","arakawa.saitama.jp","asaka.saitama.jp","chichibu.saitama.jp","fujimi.saitama.jp","fujimino.saitama.jp","fukaya.saitama.jp","hanno.saitama.jp","hanyu.saitama.jp","hasuda.saitama.jp","hatogaya.saitama.jp","hatoyama.saitama.jp","hidaka.saitama.jp","higashichichibu.saitama.jp","higashimatsuyama.saitama.jp","honjo.saitama.jp","ina.saitama.jp","iruma.saitama.jp","iwatsuki.saitama.jp","kamiizumi.saitama.jp","kamikawa.saitama.jp","kamisato.saitama.jp","kasukabe.saitama.jp","kawagoe.saitama.jp","kawaguchi.saitama.jp","kawajima.saitama.jp","kazo.saitama.jp","kitamoto.saitama.jp","koshigaya.saitama.jp","kounosu.saitama.jp","kuki.saitama.jp","kumagaya.saitama.jp","matsubushi.saitama.jp","minano.saitama.jp","misato.saitama.jp","miyashiro.saitama.jp","miyoshi.saitama.jp","moroyama.saitama.jp","nagatoro.saitama.jp","namegawa.saitama.jp","niiza.saitama.jp","ogano.saitama.jp","ogawa.saitama.jp","ogose.saitama.jp","okegawa.saitama.jp","omiya.saitama.jp","otaki.saitama.jp","ranzan.saitama.jp","ryokami.saitama.jp","saitama.saitama.jp","sakado.saitama.jp","satte.saitama.jp","sayama.saitama.jp","shiki.saitama.jp","shiraoka.saitama.jp","soka.saitama.jp","sugito.saitama.jp","toda.saitama.jp","tokigawa.saitama.jp","tokorozawa.saitama.jp","tsurugashima.saitama.jp","urawa.saitama.jp","warabi.saitama.jp","yashio.saitama.jp","yokoze.saitama.jp","yono.saitama.jp","yorii.saitama.jp","yoshida.saitama.jp","yoshikawa.saitama.jp","yoshimi.saitama.jp","aisho.shiga.jp","gamo.shiga.jp","higashiomi.shiga.jp","hikone.shiga.jp","koka.shiga.jp","konan.shiga.jp","kosei.shiga.jp","koto.shiga.jp","kusatsu.shiga.jp","maibara.shiga.jp","moriyama.shiga.jp","nagahama.shiga.jp","nishiazai.shiga.jp","notogawa.shiga.jp","omihachiman.shiga.jp","otsu.shiga.jp","ritto.shiga.jp","ryuoh.shiga.jp","takashima.shiga.jp","takatsuki.shiga.jp","torahime.shiga.jp","toyosato.shiga.jp","yasu.shiga.jp","akagi.shimane.jp","ama.shimane.jp","gotsu.shimane.jp","hamada.shimane.jp","higashiizumo.shimane.jp","hikawa.shimane.jp","hikimi.shimane.jp","izumo.shimane.jp","kakinoki.shimane.jp","masuda.shimane.jp","matsue.shimane.jp","misato.shimane.jp","nishinoshima.shimane.jp","ohda.shimane.jp","okinoshima.shimane.jp","okuizumo.shimane.jp","shimane.shimane.jp","tamayu.shimane.jp","tsuwano.shimane.jp","unnan.shimane.jp","yakumo.shimane.jp","yasugi.shimane.jp","yatsuka.shimane.jp","arai.shizuoka.jp","atami.shizuoka.jp","fuji.shizuoka.jp","fujieda.shizuoka.jp","fujikawa.shizuoka.jp","fujinomiya.shizuoka.jp","fukuroi.shizuoka.jp","gotemba.shizuoka.jp","haibara.shizuoka.jp","hamamatsu.shizuoka.jp","higashiizu.shizuoka.jp","ito.shizuoka.jp","iwata.shizuoka.jp","izu.shizuoka.jp","izunokuni.shizuoka.jp","kakegawa.shizuoka.jp","kannami.shizuoka.jp","kawanehon.shizuoka.jp","kawazu.shizuoka.jp","kikugawa.shizuoka.jp","kosai.shizuoka.jp","makinohara.shizuoka.jp","matsuzaki.shizuoka.jp","minamiizu.shizuoka.jp","mishima.shizuoka.jp","morimachi.shizuoka.jp","nishiizu.shizuoka.jp","numazu.shizuoka.jp","omaezaki.shizuoka.jp","shimada.shizuoka.jp","shimizu.shizuoka.jp","shimoda.shizuoka.jp","shizuoka.shizuoka.jp","susono.shizuoka.jp","yaizu.shizuoka.jp","yoshida.shizuoka.jp","ashikaga.tochigi.jp","bato.tochigi.jp","haga.tochigi.jp","ichikai.tochigi.jp","iwafune.tochigi.jp","kaminokawa.tochigi.jp","kanuma.tochigi.jp","karasuyama.tochigi.jp","kuroiso.tochigi.jp","mashiko.tochigi.jp","mibu.tochigi.jp","moka.tochigi.jp","motegi.tochigi.jp","nasu.tochigi.jp","nasushiobara.tochigi.jp","nikko.tochigi.jp","nishikata.tochigi.jp","nogi.tochigi.jp","ohira.tochigi.jp","ohtawara.tochigi.jp","oyama.tochigi.jp","sakura.tochigi.jp","sano.tochigi.jp","shimotsuke.tochigi.jp","shioya.tochigi.jp","takanezawa.tochigi.jp","tochigi.tochigi.jp","tsuga.tochigi.jp","ujiie.tochigi.jp","utsunomiya.tochigi.jp","yaita.tochigi.jp","aizumi.tokushima.jp","anan.tokushima.jp","ichiba.tokushima.jp","itano.tokushima.jp","kainan.tokushima.jp","komatsushima.tokushima.jp","matsushige.tokushima.jp","mima.tokushima.jp","minami.tokushima.jp","miyoshi.tokushima.jp","mugi.tokushima.jp","nakagawa.tokushima.jp","naruto.tokushima.jp","sanagochi.tokushima.jp","shishikui.tokushima.jp","tokushima.tokushima.jp","wajiki.tokushima.jp","adachi.tokyo.jp","akiruno.tokyo.jp","akishima.tokyo.jp","aogashima.tokyo.jp","arakawa.tokyo.jp","bunkyo.tokyo.jp","chiyoda.tokyo.jp","chofu.tokyo.jp","chuo.tokyo.jp","edogawa.tokyo.jp","fuchu.tokyo.jp","fussa.tokyo.jp","hachijo.tokyo.jp","hachioji.tokyo.jp","hamura.tokyo.jp","higashikurume.tokyo.jp","higashimurayama.tokyo.jp","higashiyamato.tokyo.jp","hino.tokyo.jp","hinode.tokyo.jp","hinohara.tokyo.jp","inagi.tokyo.jp","itabashi.tokyo.jp","katsushika.tokyo.jp","kita.tokyo.jp","kiyose.tokyo.jp","kodaira.tokyo.jp","koganei.tokyo.jp","kokubunji.tokyo.jp","komae.tokyo.jp","koto.tokyo.jp","kouzushima.tokyo.jp","kunitachi.tokyo.jp","machida.tokyo.jp","meguro.tokyo.jp","minato.tokyo.jp","mitaka.tokyo.jp","mizuho.tokyo.jp","musashimurayama.tokyo.jp","musashino.tokyo.jp","nakano.tokyo.jp","nerima.tokyo.jp","ogasawara.tokyo.jp","okutama.tokyo.jp","ome.tokyo.jp","oshima.tokyo.jp","ota.tokyo.jp","setagaya.tokyo.jp","shibuya.tokyo.jp","shinagawa.tokyo.jp","shinjuku.tokyo.jp","suginami.tokyo.jp","sumida.tokyo.jp","tachikawa.tokyo.jp","taito.tokyo.jp","tama.tokyo.jp","toshima.tokyo.jp","chizu.tottori.jp","hino.tottori.jp","kawahara.tottori.jp","koge.tottori.jp","kotoura.tottori.jp","misasa.tottori.jp","nanbu.tottori.jp","nichinan.tottori.jp","sakaiminato.tottori.jp","tottori.tottori.jp","wakasa.tottori.jp","yazu.tottori.jp","yonago.tottori.jp","asahi.toyama.jp","fuchu.toyama.jp","fukumitsu.toyama.jp","funahashi.toyama.jp","himi.toyama.jp","imizu.toyama.jp","inami.toyama.jp","johana.toyama.jp","kamiichi.toyama.jp","kurobe.toyama.jp","nakaniikawa.toyama.jp","namerikawa.toyama.jp","nanto.toyama.jp","nyuzen.toyama.jp","oyabe.toyama.jp","taira.toyama.jp","takaoka.toyama.jp","tateyama.toyama.jp","toga.toyama.jp","tonami.toyama.jp","toyama.toyama.jp","unazuki.toyama.jp","uozu.toyama.jp","yamada.toyama.jp","arida.wakayama.jp","aridagawa.wakayama.jp","gobo.wakayama.jp","hashimoto.wakayama.jp","hidaka.wakayama.jp","hirogawa.wakayama.jp","inami.wakayama.jp","iwade.wakayama.jp","kainan.wakayama.jp","kamitonda.wakayama.jp","katsuragi.wakayama.jp","kimino.wakayama.jp","kinokawa.wakayama.jp","kitayama.wakayama.jp","koya.wakayama.jp","koza.wakayama.jp","kozagawa.wakayama.jp","kudoyama.wakayama.jp","kushimoto.wakayama.jp","mihama.wakayama.jp","misato.wakayama.jp","nachikatsuura.wakayama.jp","shingu.wakayama.jp","shirahama.wakayama.jp","taiji.wakayama.jp","tanabe.wakayama.jp","wakayama.wakayama.jp","yuasa.wakayama.jp","yura.wakayama.jp","asahi.yamagata.jp","funagata.yamagata.jp","higashine.yamagata.jp","iide.yamagata.jp","kahoku.yamagata.jp","kaminoyama.yamagata.jp","kaneyama.yamagata.jp","kawanishi.yamagata.jp","mamurogawa.yamagata.jp","mikawa.yamagata.jp","murayama.yamagata.jp","nagai.yamagata.jp","nakayama.yamagata.jp","nanyo.yamagata.jp","nishikawa.yamagata.jp","obanazawa.yamagata.jp","oe.yamagata.jp","oguni.yamagata.jp","ohkura.yamagata.jp","oishida.yamagata.jp","sagae.yamagata.jp","sakata.yamagata.jp","sakegawa.yamagata.jp","shinjo.yamagata.jp","shirataka.yamagata.jp","shonai.yamagata.jp","takahata.yamagata.jp","tendo.yamagata.jp","tozawa.yamagata.jp","tsuruoka.yamagata.jp","yamagata.yamagata.jp","yamanobe.yamagata.jp","yonezawa.yamagata.jp","yuza.yamagata.jp","abu.yamaguchi.jp","hagi.yamaguchi.jp","hikari.yamaguchi.jp","hofu.yamaguchi.jp","iwakuni.yamaguchi.jp","kudamatsu.yamaguchi.jp","mitou.yamaguchi.jp","nagato.yamaguchi.jp","oshima.yamaguchi.jp","shimonoseki.yamaguchi.jp","shunan.yamaguchi.jp","tabuse.yamaguchi.jp","tokuyama.yamaguchi.jp","toyota.yamaguchi.jp","ube.yamaguchi.jp","yuu.yamaguchi.jp","chuo.yamanashi.jp","doshi.yamanashi.jp","fuefuki.yamanashi.jp","fujikawa.yamanashi.jp","fujikawaguchiko.yamanashi.jp","fujiyoshida.yamanashi.jp","hayakawa.yamanashi.jp","hokuto.yamanashi.jp","ichikawamisato.yamanashi.jp","kai.yamanashi.jp","kofu.yamanashi.jp","koshu.yamanashi.jp","kosuge.yamanashi.jp","minami-alps.yamanashi.jp","minobu.yamanashi.jp","nakamichi.yamanashi.jp","nanbu.yamanashi.jp","narusawa.yamanashi.jp","nirasaki.yamanashi.jp","nishikatsura.yamanashi.jp","oshino.yamanashi.jp","otsuki.yamanashi.jp","showa.yamanashi.jp","tabayama.yamanashi.jp","tsuru.yamanashi.jp","uenohara.yamanashi.jp","yamanakako.yamanashi.jp","yamanashi.yamanashi.jp","ke","ac.ke","co.ke","go.ke","info.ke","me.ke","mobi.ke","ne.ke","or.ke","sc.ke","kg","org.kg","net.kg","com.kg","edu.kg","gov.kg","mil.kg","*.kh","ki","edu.ki","biz.ki","net.ki","org.ki","gov.ki","info.ki","com.ki","km","org.km","nom.km","gov.km","prd.km","tm.km","edu.km","mil.km","ass.km","com.km","coop.km","asso.km","presse.km","medecin.km","notaires.km","pharmaciens.km","veterinaire.km","gouv.km","kn","net.kn","org.kn","edu.kn","gov.kn","kp","com.kp","edu.kp","gov.kp","org.kp","rep.kp","tra.kp","kr","ac.kr","co.kr","es.kr","go.kr","hs.kr","kg.kr","mil.kr","ms.kr","ne.kr","or.kr","pe.kr","re.kr","sc.kr","busan.kr","chungbuk.kr","chungnam.kr","daegu.kr","daejeon.kr","gangwon.kr","gwangju.kr","gyeongbuk.kr","gyeonggi.kr","gyeongnam.kr","incheon.kr","jeju.kr","jeonbuk.kr","jeonnam.kr","seoul.kr","ulsan.kr","kw","com.kw","edu.kw","emb.kw","gov.kw","ind.kw","net.kw","org.kw","ky","edu.ky","gov.ky","com.ky","org.ky","net.ky","kz","org.kz","edu.kz","net.kz","gov.kz","mil.kz","com.kz","la","int.la","net.la","info.la","edu.la","gov.la","per.la","com.la","org.la","lb","com.lb","edu.lb","gov.lb","net.lb","org.lb","lc","com.lc","net.lc","co.lc","org.lc","edu.lc","gov.lc","li","lk","gov.lk","sch.lk","net.lk","int.lk","com.lk","org.lk","edu.lk","ngo.lk","soc.lk","web.lk","ltd.lk","assn.lk","grp.lk","hotel.lk","ac.lk","lr","com.lr","edu.lr","gov.lr","org.lr","net.lr","ls","co.ls","org.ls","lt","gov.lt","lu","lv","com.lv","edu.lv","gov.lv","org.lv","mil.lv","id.lv","net.lv","asn.lv","conf.lv","ly","com.ly","net.ly","gov.ly","plc.ly","edu.ly","sch.ly","med.ly","org.ly","id.ly","ma","co.ma","net.ma","gov.ma","org.ma","ac.ma","press.ma","mc","tm.mc","asso.mc","md","me","co.me","net.me","org.me","edu.me","ac.me","gov.me","its.me","priv.me","mg","org.mg","nom.mg","gov.mg","prd.mg","tm.mg","edu.mg","mil.mg","com.mg","co.mg","mh","mil","mk","com.mk","org.mk","net.mk","edu.mk","gov.mk","inf.mk","name.mk","ml","com.ml","edu.ml","gouv.ml","gov.ml","net.ml","org.ml","presse.ml","*.mm","mn","gov.mn","edu.mn","org.mn","mo","com.mo","net.mo","org.mo","edu.mo","gov.mo","mobi","mp","mq","mr","gov.mr","ms","com.ms","edu.ms","gov.ms","net.ms","org.ms","mt","com.mt","edu.mt","net.mt","org.mt","mu","com.mu","net.mu","org.mu","gov.mu","ac.mu","co.mu","or.mu","museum","academy.museum","agriculture.museum","air.museum","airguard.museum","alabama.museum","alaska.museum","amber.museum","ambulance.museum","american.museum","americana.museum","americanantiques.museum","americanart.museum","amsterdam.museum","and.museum","annefrank.museum","anthro.museum","anthropology.museum","antiques.museum","aquarium.museum","arboretum.museum","archaeological.museum","archaeology.museum","architecture.museum","art.museum","artanddesign.museum","artcenter.museum","artdeco.museum","arteducation.museum","artgallery.museum","arts.museum","artsandcrafts.museum","asmatart.museum","assassination.museum","assisi.museum","association.museum","astronomy.museum","atlanta.museum","austin.museum","australia.museum","automotive.museum","aviation.museum","axis.museum","badajoz.museum","baghdad.museum","bahn.museum","bale.museum","baltimore.museum","barcelona.museum","baseball.museum","basel.museum","baths.museum","bauern.museum","beauxarts.museum","beeldengeluid.museum","bellevue.museum","bergbau.museum","berkeley.museum","berlin.museum","bern.museum","bible.museum","bilbao.museum","bill.museum","birdart.museum","birthplace.museum","bonn.museum","boston.museum","botanical.museum","botanicalgarden.museum","botanicgarden.museum","botany.museum","brandywinevalley.museum","brasil.museum","bristol.museum","british.museum","britishcolumbia.museum","broadcast.museum","brunel.museum","brussel.museum","brussels.museum","bruxelles.museum","building.museum","burghof.museum","bus.museum","bushey.museum","cadaques.museum","california.museum","cambridge.museum","can.museum","canada.museum","capebreton.museum","carrier.museum","cartoonart.museum","casadelamoneda.museum","castle.museum","castres.museum","celtic.museum","center.museum","chattanooga.museum","cheltenham.museum","chesapeakebay.museum","chicago.museum","children.museum","childrens.museum","childrensgarden.museum","chiropractic.museum","chocolate.museum","christiansburg.museum","cincinnati.museum","cinema.museum","circus.museum","civilisation.museum","civilization.museum","civilwar.museum","clinton.museum","clock.museum","coal.museum","coastaldefence.museum","cody.museum","coldwar.museum","collection.museum","colonialwilliamsburg.museum","coloradoplateau.museum","columbia.museum","columbus.museum","communication.museum","communications.museum","community.museum","computer.museum","computerhistory.museum","comunicações.museum","contemporary.museum","contemporaryart.museum","convent.museum","copenhagen.museum","corporation.museum","correios-e-telecomunicações.museum","corvette.museum","costume.museum","countryestate.museum","county.museum","crafts.museum","cranbrook.museum","creation.museum","cultural.museum","culturalcenter.museum","culture.museum","cyber.museum","cymru.museum","dali.museum","dallas.museum","database.museum","ddr.museum","decorativearts.museum","delaware.museum","delmenhorst.museum","denmark.museum","depot.museum","design.museum","detroit.museum","dinosaur.museum","discovery.museum","dolls.museum","donostia.museum","durham.museum","eastafrica.museum","eastcoast.museum","education.museum","educational.museum","egyptian.museum","eisenbahn.museum","elburg.museum","elvendrell.museum","embroidery.museum","encyclopedic.museum","england.museum","entomology.museum","environment.museum","environmentalconservation.museum","epilepsy.museum","essex.museum","estate.museum","ethnology.museum","exeter.museum","exhibition.museum","family.museum","farm.museum","farmequipment.museum","farmers.museum","farmstead.museum","field.museum","figueres.museum","filatelia.museum","film.museum","fineart.museum","finearts.museum","finland.museum","flanders.museum","florida.museum","force.museum","fortmissoula.museum","fortworth.museum","foundation.museum","francaise.museum","frankfurt.museum","franziskaner.museum","freemasonry.museum","freiburg.museum","fribourg.museum","frog.museum","fundacio.museum","furniture.museum","gallery.museum","garden.museum","gateway.museum","geelvinck.museum","gemological.museum","geology.museum","georgia.museum","giessen.museum","glas.museum","glass.museum","gorge.museum","grandrapids.museum","graz.museum","guernsey.museum","halloffame.museum","hamburg.museum","handson.museum","harvestcelebration.museum","hawaii.museum","health.museum","heimatunduhren.museum","hellas.museum","helsinki.museum","hembygdsforbund.museum","heritage.museum","histoire.museum","historical.museum","historicalsociety.museum","historichouses.museum","historisch.museum","historisches.museum","history.museum","historyofscience.museum","horology.museum","house.museum","humanities.museum","illustration.museum","imageandsound.museum","indian.museum","indiana.museum","indianapolis.museum","indianmarket.museum","intelligence.museum","interactive.museum","iraq.museum","iron.museum","isleofman.museum","jamison.museum","jefferson.museum","jerusalem.museum","jewelry.museum","jewish.museum","jewishart.museum","jfk.museum","journalism.museum","judaica.museum","judygarland.museum","juedisches.museum","juif.museum","karate.museum","karikatur.museum","kids.museum","koebenhavn.museum","koeln.museum","kunst.museum","kunstsammlung.museum","kunstunddesign.museum","labor.museum","labour.museum","lajolla.museum","lancashire.museum","landes.museum","lans.museum","läns.museum","larsson.museum","lewismiller.museum","lincoln.museum","linz.museum","living.museum","livinghistory.museum","localhistory.museum","london.museum","losangeles.museum","louvre.museum","loyalist.museum","lucerne.museum","luxembourg.museum","luzern.museum","mad.museum","madrid.museum","mallorca.museum","manchester.museum","mansion.museum","mansions.museum","manx.museum","marburg.museum","maritime.museum","maritimo.museum","maryland.museum","marylhurst.museum","media.museum","medical.museum","medizinhistorisches.museum","meeres.museum","memorial.museum","mesaverde.museum","michigan.museum","midatlantic.museum","military.museum","mill.museum","miners.museum","mining.museum","minnesota.museum","missile.museum","missoula.museum","modern.museum","moma.museum","money.museum","monmouth.museum","monticello.museum","montreal.museum","moscow.museum","motorcycle.museum","muenchen.museum","muenster.museum","mulhouse.museum","muncie.museum","museet.museum","museumcenter.museum","museumvereniging.museum","music.museum","national.museum","nationalfirearms.museum","nationalheritage.museum","nativeamerican.museum","naturalhistory.museum","naturalhistorymuseum.museum","naturalsciences.museum","nature.museum","naturhistorisches.museum","natuurwetenschappen.museum","naumburg.museum","naval.museum","nebraska.museum","neues.museum","newhampshire.museum","newjersey.museum","newmexico.museum","newport.museum","newspaper.museum","newyork.museum","niepce.museum","norfolk.museum","north.museum","nrw.museum","nuernberg.museum","nuremberg.museum","nyc.museum","nyny.museum","oceanographic.museum","oceanographique.museum","omaha.museum","online.museum","ontario.museum","openair.museum","oregon.museum","oregontrail.museum","otago.museum","oxford.museum","pacific.museum","paderborn.museum","palace.museum","paleo.museum","palmsprings.museum","panama.museum","paris.museum","pasadena.museum","pharmacy.museum","philadelphia.museum","philadelphiaarea.museum","philately.museum","phoenix.museum","photography.museum","pilots.museum","pittsburgh.museum","planetarium.museum","plantation.museum","plants.museum","plaza.museum","portal.museum","portland.museum","portlligat.museum","posts-and-telecommunications.museum","preservation.museum","presidio.museum","press.museum","project.museum","public.museum","pubol.museum","quebec.museum","railroad.museum","railway.museum","research.museum","resistance.museum","riodejaneiro.museum","rochester.museum","rockart.museum","roma.museum","russia.museum","saintlouis.museum","salem.museum","salvadordali.museum","salzburg.museum","sandiego.museum","sanfrancisco.museum","santabarbara.museum","santacruz.museum","santafe.museum","saskatchewan.museum","satx.museum","savannahga.museum","schlesisches.museum","schoenbrunn.museum","schokoladen.museum","school.museum","schweiz.museum","science.museum","scienceandhistory.museum","scienceandindustry.museum","sciencecenter.museum","sciencecenters.museum","science-fiction.museum","sciencehistory.museum","sciences.museum","sciencesnaturelles.museum","scotland.museum","seaport.museum","settlement.museum","settlers.museum","shell.museum","sherbrooke.museum","sibenik.museum","silk.museum","ski.museum","skole.museum","society.museum","sologne.museum","soundandvision.museum","southcarolina.museum","southwest.museum","space.museum","spy.museum","square.museum","stadt.museum","stalbans.museum","starnberg.museum","state.museum","stateofdelaware.museum","station.museum","steam.museum","steiermark.museum","stjohn.museum","stockholm.museum","stpetersburg.museum","stuttgart.museum","suisse.museum","surgeonshall.museum","surrey.museum","svizzera.museum","sweden.museum","sydney.museum","tank.museum","tcm.museum","technology.museum","telekommunikation.museum","television.museum","texas.museum","textile.museum","theater.museum","time.museum","timekeeping.museum","topology.museum","torino.museum","touch.museum","town.museum","transport.museum","tree.museum","trolley.museum","trust.museum","trustee.museum","uhren.museum","ulm.museum","undersea.museum","university.museum","usa.museum","usantiques.museum","usarts.museum","uscountryestate.museum","usculture.museum","usdecorativearts.museum","usgarden.museum","ushistory.museum","ushuaia.museum","uslivinghistory.museum","utah.museum","uvic.museum","valley.museum","vantaa.museum","versailles.museum","viking.museum","village.museum","virginia.museum","virtual.museum","virtuel.museum","vlaanderen.museum","volkenkunde.museum","wales.museum","wallonie.museum","war.museum","washingtondc.museum","watchandclock.museum","watch-and-clock.museum","western.museum","westfalen.museum","whaling.museum","wildlife.museum","williamsburg.museum","windmill.museum","workshop.museum","york.museum","yorkshire.museum","yosemite.museum","youth.museum","zoological.museum","zoology.museum","ירושלים.museum","иком.museum","mv","aero.mv","biz.mv","com.mv","coop.mv","edu.mv","gov.mv","info.mv","int.mv","mil.mv","museum.mv","name.mv","net.mv","org.mv","pro.mv","mw","ac.mw","biz.mw","co.mw","com.mw","coop.mw","edu.mw","gov.mw","int.mw","museum.mw","net.mw","org.mw","mx","com.mx","org.mx","gob.mx","edu.mx","net.mx","my","com.my","net.my","org.my","gov.my","edu.my","mil.my","name.my","mz","ac.mz","adv.mz","co.mz","edu.mz","gov.mz","mil.mz","net.mz","org.mz","na","info.na","pro.na","name.na","school.na","or.na","dr.na","us.na","mx.na","ca.na","in.na","cc.na","tv.na","ws.na","mobi.na","co.na","com.na","org.na","name","nc","asso.nc","nom.nc","ne","net","nf","com.nf","net.nf","per.nf","rec.nf","web.nf","arts.nf","firm.nf","info.nf","other.nf","store.nf","ng","com.ng","edu.ng","gov.ng","i.ng","mil.ng","mobi.ng","name.ng","net.ng","org.ng","sch.ng","ni","ac.ni","biz.ni","co.ni","com.ni","edu.ni","gob.ni","in.ni","info.ni","int.ni","mil.ni","net.ni","nom.ni","org.ni","web.ni","nl","bv.nl","no","fhs.no","vgs.no","fylkesbibl.no","folkebibl.no","museum.no","idrett.no","priv.no","mil.no","stat.no","dep.no","kommune.no","herad.no","aa.no","ah.no","bu.no","fm.no","hl.no","hm.no","jan-mayen.no","mr.no","nl.no","nt.no","of.no","ol.no","oslo.no","rl.no","sf.no","st.no","svalbard.no","tm.no","tr.no","va.no","vf.no","gs.aa.no","gs.ah.no","gs.bu.no","gs.fm.no","gs.hl.no","gs.hm.no","gs.jan-mayen.no","gs.mr.no","gs.nl.no","gs.nt.no","gs.of.no","gs.ol.no","gs.oslo.no","gs.rl.no","gs.sf.no","gs.st.no","gs.svalbard.no","gs.tm.no","gs.tr.no","gs.va.no","gs.vf.no","akrehamn.no","åkrehamn.no","algard.no","ålgård.no","arna.no","brumunddal.no","bryne.no","bronnoysund.no","brønnøysund.no","drobak.no","drøbak.no","egersund.no","fetsund.no","floro.no","florø.no","fredrikstad.no","hokksund.no","honefoss.no","hønefoss.no","jessheim.no","jorpeland.no","jørpeland.no","kirkenes.no","kopervik.no","krokstadelva.no","langevag.no","langevåg.no","leirvik.no","mjondalen.no","mjøndalen.no","mo-i-rana.no","mosjoen.no","mosjøen.no","nesoddtangen.no","orkanger.no","osoyro.no","osøyro.no","raholt.no","råholt.no","sandnessjoen.no","sandnessjøen.no","skedsmokorset.no","slattum.no","spjelkavik.no","stathelle.no","stavern.no","stjordalshalsen.no","stjørdalshalsen.no","tananger.no","tranby.no","vossevangen.no","afjord.no","åfjord.no","agdenes.no","al.no","ål.no","alesund.no","ålesund.no","alstahaug.no","alta.no","áltá.no","alaheadju.no","álaheadju.no","alvdal.no","amli.no","åmli.no","amot.no","åmot.no","andebu.no","andoy.no","andøy.no","andasuolo.no","ardal.no","årdal.no","aremark.no","arendal.no","ås.no","aseral.no","åseral.no","asker.no","askim.no","askvoll.no","askoy.no","askøy.no","asnes.no","åsnes.no","audnedaln.no","aukra.no","aure.no","aurland.no","aurskog-holand.no","aurskog-høland.no","austevoll.no","austrheim.no","averoy.no","averøy.no","balestrand.no","ballangen.no","balat.no","bálát.no","balsfjord.no","bahccavuotna.no","báhccavuotna.no","bamble.no","bardu.no","beardu.no","beiarn.no","bajddar.no","bájddar.no","baidar.no","báidár.no","berg.no","bergen.no","berlevag.no","berlevåg.no","bearalvahki.no","bearalváhki.no","bindal.no","birkenes.no","bjarkoy.no","bjarkøy.no","bjerkreim.no","bjugn.no","bodo.no","bodø.no","badaddja.no","bådåddjå.no","budejju.no","bokn.no","bremanger.no","bronnoy.no","brønnøy.no","bygland.no","bykle.no","barum.no","bærum.no","bo.telemark.no","bø.telemark.no","bo.nordland.no","bø.nordland.no","bievat.no","bievát.no","bomlo.no","bømlo.no","batsfjord.no","båtsfjord.no","bahcavuotna.no","báhcavuotna.no","dovre.no","drammen.no","drangedal.no","dyroy.no","dyrøy.no","donna.no","dønna.no","eid.no","eidfjord.no","eidsberg.no","eidskog.no","eidsvoll.no","eigersund.no","elverum.no","enebakk.no","engerdal.no","etne.no","etnedal.no","evenes.no","evenassi.no","evenášši.no","evje-og-hornnes.no","farsund.no","fauske.no","fuossko.no","fuoisku.no","fedje.no","fet.no","finnoy.no","finnøy.no","fitjar.no","fjaler.no","fjell.no","flakstad.no","flatanger.no","flekkefjord.no","flesberg.no","flora.no","fla.no","flå.no","folldal.no","forsand.no","fosnes.no","frei.no","frogn.no","froland.no","frosta.no","frana.no","fræna.no","froya.no","frøya.no","fusa.no","fyresdal.no","forde.no","førde.no","gamvik.no","gangaviika.no","gáŋgaviika.no","gaular.no","gausdal.no","gildeskal.no","gildeskål.no","giske.no","gjemnes.no","gjerdrum.no","gjerstad.no","gjesdal.no","gjovik.no","gjøvik.no","gloppen.no","gol.no","gran.no","grane.no","granvin.no","gratangen.no","grimstad.no","grong.no","kraanghke.no","kråanghke.no","grue.no","gulen.no","hadsel.no","halden.no","halsa.no","hamar.no","hamaroy.no","habmer.no","hábmer.no","hapmir.no","hápmir.no","hammerfest.no","hammarfeasta.no","hámmárfeasta.no","haram.no","hareid.no","harstad.no","hasvik.no","aknoluokta.no","ákŋoluokta.no","hattfjelldal.no","aarborte.no","haugesund.no","hemne.no","hemnes.no","hemsedal.no","heroy.more-og-romsdal.no","herøy.møre-og-romsdal.no","heroy.nordland.no","herøy.nordland.no","hitra.no","hjartdal.no","hjelmeland.no","hobol.no","hobøl.no","hof.no","hol.no","hole.no","holmestrand.no","holtalen.no","holtålen.no","hornindal.no","horten.no","hurdal.no","hurum.no","hvaler.no","hyllestad.no","hagebostad.no","hægebostad.no","hoyanger.no","høyanger.no","hoylandet.no","høylandet.no","ha.no","hå.no","ibestad.no","inderoy.no","inderøy.no","iveland.no","jevnaker.no","jondal.no","jolster.no","jølster.no","karasjok.no","karasjohka.no","kárášjohka.no","karlsoy.no","galsa.no","gálsá.no","karmoy.no","karmøy.no","kautokeino.no","guovdageaidnu.no","klepp.no","klabu.no","klæbu.no","kongsberg.no","kongsvinger.no","kragero.no","kragerø.no","kristiansand.no","kristiansund.no","krodsherad.no","krødsherad.no","kvalsund.no","rahkkeravju.no","ráhkkerávju.no","kvam.no","kvinesdal.no","kvinnherad.no","kviteseid.no","kvitsoy.no","kvitsøy.no","kvafjord.no","kvæfjord.no","giehtavuoatna.no","kvanangen.no","kvænangen.no","navuotna.no","návuotna.no","kafjord.no","kåfjord.no","gaivuotna.no","gáivuotna.no","larvik.no","lavangen.no","lavagis.no","loabat.no","loabát.no","lebesby.no","davvesiida.no","leikanger.no","leirfjord.no","leka.no","leksvik.no","lenvik.no","leangaviika.no","leaŋgaviika.no","lesja.no","levanger.no","lier.no","lierne.no","lillehammer.no","lillesand.no","lindesnes.no","lindas.no","lindås.no","lom.no","loppa.no","lahppi.no","láhppi.no","lund.no","lunner.no","luroy.no","lurøy.no","luster.no","lyngdal.no","lyngen.no","ivgu.no","lardal.no","lerdal.no","lærdal.no","lodingen.no","lødingen.no","lorenskog.no","lørenskog.no","loten.no","løten.no","malvik.no","masoy.no","måsøy.no","muosat.no","muosát.no","mandal.no","marker.no","marnardal.no","masfjorden.no","meland.no","meldal.no","melhus.no","meloy.no","meløy.no","meraker.no","meråker.no","moareke.no","moåreke.no","midsund.no","midtre-gauldal.no","modalen.no","modum.no","molde.no","moskenes.no","moss.no","mosvik.no","malselv.no","målselv.no","malatvuopmi.no","málatvuopmi.no","namdalseid.no","aejrie.no","namsos.no","namsskogan.no","naamesjevuemie.no","nååmesjevuemie.no","laakesvuemie.no","nannestad.no","narvik.no","narviika.no","naustdal.no","nedre-eiker.no","nes.akershus.no","nes.buskerud.no","nesna.no","nesodden.no","nesseby.no","unjarga.no","unjárga.no","nesset.no","nissedal.no","nittedal.no","nord-aurdal.no","nord-fron.no","nord-odal.no","norddal.no","nordkapp.no","davvenjarga.no","davvenjárga.no","nordre-land.no","nordreisa.no","raisa.no","ráisa.no","nore-og-uvdal.no","notodden.no","naroy.no","nærøy.no","notteroy.no","nøtterøy.no","odda.no","oksnes.no","øksnes.no","oppdal.no","oppegard.no","oppegård.no","orkdal.no","orland.no","ørland.no","orskog.no","ørskog.no","orsta.no","ørsta.no","os.hedmark.no","os.hordaland.no","osen.no","osteroy.no","osterøy.no","ostre-toten.no","østre-toten.no","overhalla.no","ovre-eiker.no","øvre-eiker.no","oyer.no","øyer.no","oygarden.no","øygarden.no","oystre-slidre.no","øystre-slidre.no","porsanger.no","porsangu.no","porsáŋgu.no","porsgrunn.no","radoy.no","radøy.no","rakkestad.no","rana.no","ruovat.no","randaberg.no","rauma.no","rendalen.no","rennebu.no","rennesoy.no","rennesøy.no","rindal.no","ringebu.no","ringerike.no","ringsaker.no","rissa.no","risor.no","risør.no","roan.no","rollag.no","rygge.no","ralingen.no","rælingen.no","rodoy.no","rødøy.no","romskog.no","rømskog.no","roros.no","røros.no","rost.no","røst.no","royken.no","røyken.no","royrvik.no","røyrvik.no","rade.no","råde.no","salangen.no","siellak.no","saltdal.no","salat.no","sálát.no","sálat.no","samnanger.no","sande.more-og-romsdal.no","sande.møre-og-romsdal.no","sande.vestfold.no","sandefjord.no","sandnes.no","sandoy.no","sandøy.no","sarpsborg.no","sauda.no","sauherad.no","sel.no","selbu.no","selje.no","seljord.no","sigdal.no","siljan.no","sirdal.no","skaun.no","skedsmo.no","ski.no","skien.no","skiptvet.no","skjervoy.no","skjervøy.no","skierva.no","skiervá.no","skjak.no","skjåk.no","skodje.no","skanland.no","skånland.no","skanit.no","skánit.no","smola.no","smøla.no","snillfjord.no","snasa.no","snåsa.no","snoasa.no","snaase.no","snåase.no","sogndal.no","sokndal.no","sola.no","solund.no","songdalen.no","sortland.no","spydeberg.no","stange.no","stavanger.no","steigen.no","steinkjer.no","stjordal.no","stjørdal.no","stokke.no","stor-elvdal.no","stord.no","stordal.no","storfjord.no","omasvuotna.no","strand.no","stranda.no","stryn.no","sula.no","suldal.no","sund.no","sunndal.no","surnadal.no","sveio.no","svelvik.no","sykkylven.no","sogne.no","søgne.no","somna.no","sømna.no","sondre-land.no","søndre-land.no","sor-aurdal.no","sør-aurdal.no","sor-fron.no","sør-fron.no","sor-odal.no","sør-odal.no","sor-varanger.no","sør-varanger.no","matta-varjjat.no","mátta-várjjat.no","sorfold.no","sørfold.no","sorreisa.no","sørreisa.no","sorum.no","sørum.no","tana.no","deatnu.no","time.no","tingvoll.no","tinn.no","tjeldsund.no","dielddanuorri.no","tjome.no","tjøme.no","tokke.no","tolga.no","torsken.no","tranoy.no","tranøy.no","tromso.no","tromsø.no","tromsa.no","romsa.no","trondheim.no","troandin.no","trysil.no","trana.no","træna.no","trogstad.no","trøgstad.no","tvedestrand.no","tydal.no","tynset.no","tysfjord.no","divtasvuodna.no","divttasvuotna.no","tysnes.no","tysvar.no","tysvær.no","tonsberg.no","tønsberg.no","ullensaker.no","ullensvang.no","ulvik.no","utsira.no","vadso.no","vadsø.no","cahcesuolo.no","čáhcesuolo.no","vaksdal.no","valle.no","vang.no","vanylven.no","vardo.no","vardø.no","varggat.no","várggát.no","vefsn.no","vaapste.no","vega.no","vegarshei.no","vegårshei.no","vennesla.no","verdal.no","verran.no","vestby.no","vestnes.no","vestre-slidre.no","vestre-toten.no","vestvagoy.no","vestvågøy.no","vevelstad.no","vik.no","vikna.no","vindafjord.no","volda.no","voss.no","varoy.no","værøy.no","vagan.no","vågan.no","voagat.no","vagsoy.no","vågsøy.no","vaga.no","vågå.no","valer.ostfold.no","våler.østfold.no","valer.hedmark.no","våler.hedmark.no","*.np","nr","biz.nr","info.nr","gov.nr","edu.nr","org.nr","net.nr","com.nr","nu","nz","ac.nz","co.nz","cri.nz","geek.nz","gen.nz","govt.nz","health.nz","iwi.nz","kiwi.nz","maori.nz","mil.nz","māori.nz","net.nz","org.nz","parliament.nz","school.nz","om","co.om","com.om","edu.om","gov.om","med.om","museum.om","net.om","org.om","pro.om","onion","org","pa","ac.pa","gob.pa","com.pa","org.pa","sld.pa","edu.pa","net.pa","ing.pa","abo.pa","med.pa","nom.pa","pe","edu.pe","gob.pe","nom.pe","mil.pe","org.pe","com.pe","net.pe","pf","com.pf","org.pf","edu.pf","*.pg","ph","com.ph","net.ph","org.ph","gov.ph","edu.ph","ngo.ph","mil.ph","i.ph","pk","com.pk","net.pk","edu.pk","org.pk","fam.pk","biz.pk","web.pk","gov.pk","gob.pk","gok.pk","gon.pk","gop.pk","gos.pk","info.pk","pl","com.pl","net.pl","org.pl","aid.pl","agro.pl","atm.pl","auto.pl","biz.pl","edu.pl","gmina.pl","gsm.pl","info.pl","mail.pl","miasta.pl","media.pl","mil.pl","nieruchomosci.pl","nom.pl","pc.pl","powiat.pl","priv.pl","realestate.pl","rel.pl","sex.pl","shop.pl","sklep.pl","sos.pl","szkola.pl","targi.pl","tm.pl","tourism.pl","travel.pl","turystyka.pl","gov.pl","ap.gov.pl","ic.gov.pl","is.gov.pl","us.gov.pl","kmpsp.gov.pl","kppsp.gov.pl","kwpsp.gov.pl","psp.gov.pl","wskr.gov.pl","kwp.gov.pl","mw.gov.pl","ug.gov.pl","um.gov.pl","umig.gov.pl","ugim.gov.pl","upow.gov.pl","uw.gov.pl","starostwo.gov.pl","pa.gov.pl","po.gov.pl","psse.gov.pl","pup.gov.pl","rzgw.gov.pl","sa.gov.pl","so.gov.pl","sr.gov.pl","wsa.gov.pl","sko.gov.pl","uzs.gov.pl","wiih.gov.pl","winb.gov.pl","pinb.gov.pl","wios.gov.pl","witd.gov.pl","wzmiuw.gov.pl","piw.gov.pl","wiw.gov.pl","griw.gov.pl","wif.gov.pl","oum.gov.pl","sdn.gov.pl","zp.gov.pl","uppo.gov.pl","mup.gov.pl","wuoz.gov.pl","konsulat.gov.pl","oirm.gov.pl","augustow.pl","babia-gora.pl","bedzin.pl","beskidy.pl","bialowieza.pl","bialystok.pl","bielawa.pl","bieszczady.pl","boleslawiec.pl","bydgoszcz.pl","bytom.pl","cieszyn.pl","czeladz.pl","czest.pl","dlugoleka.pl","elblag.pl","elk.pl","glogow.pl","gniezno.pl","gorlice.pl","grajewo.pl","ilawa.pl","jaworzno.pl","jelenia-gora.pl","jgora.pl","kalisz.pl","kazimierz-dolny.pl","karpacz.pl","kartuzy.pl","kaszuby.pl","katowice.pl","kepno.pl","ketrzyn.pl","klodzko.pl","kobierzyce.pl","kolobrzeg.pl","konin.pl","konskowola.pl","kutno.pl","lapy.pl","lebork.pl","legnica.pl","lezajsk.pl","limanowa.pl","lomza.pl","lowicz.pl","lubin.pl","lukow.pl","malbork.pl","malopolska.pl","mazowsze.pl","mazury.pl","mielec.pl","mielno.pl","mragowo.pl","naklo.pl","nowaruda.pl","nysa.pl","olawa.pl","olecko.pl","olkusz.pl","olsztyn.pl","opoczno.pl","opole.pl","ostroda.pl","ostroleka.pl","ostrowiec.pl","ostrowwlkp.pl","pila.pl","pisz.pl","podhale.pl","podlasie.pl","polkowice.pl","pomorze.pl","pomorskie.pl","prochowice.pl","pruszkow.pl","przeworsk.pl","pulawy.pl","radom.pl","rawa-maz.pl","rybnik.pl","rzeszow.pl","sanok.pl","sejny.pl","slask.pl","slupsk.pl","sosnowiec.pl","stalowa-wola.pl","skoczow.pl","starachowice.pl","stargard.pl","suwalki.pl","swidnica.pl","swiebodzin.pl","swinoujscie.pl","szczecin.pl","szczytno.pl","tarnobrzeg.pl","tgory.pl","turek.pl","tychy.pl","ustka.pl","walbrzych.pl","warmia.pl","warszawa.pl","waw.pl","wegrow.pl","wielun.pl","wlocl.pl","wloclawek.pl","wodzislaw.pl","wolomin.pl","wroclaw.pl","zachpomor.pl","zagan.pl","zarow.pl","zgora.pl","zgorzelec.pl","pm","pn","gov.pn","co.pn","org.pn","edu.pn","net.pn","post","pr","com.pr","net.pr","org.pr","gov.pr","edu.pr","isla.pr","pro.pr","biz.pr","info.pr","name.pr","est.pr","prof.pr","ac.pr","pro","aaa.pro","aca.pro","acct.pro","avocat.pro","bar.pro","cpa.pro","eng.pro","jur.pro","law.pro","med.pro","recht.pro","ps","edu.ps","gov.ps","sec.ps","plo.ps","com.ps","org.ps","net.ps","pt","net.pt","gov.pt","org.pt","edu.pt","int.pt","publ.pt","com.pt","nome.pt","pw","co.pw","ne.pw","or.pw","ed.pw","go.pw","belau.pw","py","com.py","coop.py","edu.py","gov.py","mil.py","net.py","org.py","qa","com.qa","edu.qa","gov.qa","mil.qa","name.qa","net.qa","org.qa","sch.qa","re","asso.re","com.re","nom.re","ro","arts.ro","com.ro","firm.ro","info.ro","nom.ro","nt.ro","org.ro","rec.ro","store.ro","tm.ro","www.ro","rs","ac.rs","co.rs","edu.rs","gov.rs","in.rs","org.rs","ru","ac.ru","edu.ru","gov.ru","int.ru","mil.ru","test.ru","rw","gov.rw","net.rw","edu.rw","ac.rw","com.rw","co.rw","int.rw","mil.rw","gouv.rw","sa","com.sa","net.sa","org.sa","gov.sa","med.sa","pub.sa","edu.sa","sch.sa","sb","com.sb","edu.sb","gov.sb","net.sb","org.sb","sc","com.sc","gov.sc","net.sc","org.sc","edu.sc","sd","com.sd","net.sd","org.sd","edu.sd","med.sd","tv.sd","gov.sd","info.sd","se","a.se","ac.se","b.se","bd.se","brand.se","c.se","d.se","e.se","f.se","fh.se","fhsk.se","fhv.se","g.se","h.se","i.se","k.se","komforb.se","kommunalforbund.se","komvux.se","l.se","lanbib.se","m.se","n.se","naturbruksgymn.se","o.se","org.se","p.se","parti.se","pp.se","press.se","r.se","s.se","t.se","tm.se","u.se","w.se","x.se","y.se","z.se","sg","com.sg","net.sg","org.sg","gov.sg","edu.sg","per.sg","sh","com.sh","net.sh","gov.sh","org.sh","mil.sh","si","sj","sk","sl","com.sl","net.sl","edu.sl","gov.sl","org.sl","sm","sn","art.sn","com.sn","edu.sn","gouv.sn","org.sn","perso.sn","univ.sn","so","com.so","net.so","org.so","sr","st","co.st","com.st","consulado.st","edu.st","embaixada.st","gov.st","mil.st","net.st","org.st","principe.st","saotome.st","store.st","su","sv","com.sv","edu.sv","gob.sv","org.sv","red.sv","sx","gov.sx","sy","edu.sy","gov.sy","net.sy","mil.sy","com.sy","org.sy","sz","co.sz","ac.sz","org.sz","tc","td","tel","tf","tg","th","ac.th","co.th","go.th","in.th","mi.th","net.th","or.th","tj","ac.tj","biz.tj","co.tj","com.tj","edu.tj","go.tj","gov.tj","int.tj","mil.tj","name.tj","net.tj","nic.tj","org.tj","test.tj","web.tj","tk","tl","gov.tl","tm","com.tm","co.tm","org.tm","net.tm","nom.tm","gov.tm","mil.tm","edu.tm","tn","com.tn","ens.tn","fin.tn","gov.tn","ind.tn","intl.tn","nat.tn","net.tn","org.tn","info.tn","perso.tn","tourism.tn","edunet.tn","rnrt.tn","rns.tn","rnu.tn","mincom.tn","agrinet.tn","defense.tn","turen.tn","to","com.to","gov.to","net.to","org.to","edu.to","mil.to","tr","com.tr","info.tr","biz.tr","net.tr","org.tr","web.tr","gen.tr","tv.tr","av.tr","dr.tr","bbs.tr","name.tr","tel.tr","gov.tr","bel.tr","pol.tr","mil.tr","k12.tr","edu.tr","kep.tr","nc.tr","gov.nc.tr","tt","co.tt","com.tt","org.tt","net.tt","biz.tt","info.tt","pro.tt","int.tt","coop.tt","jobs.tt","mobi.tt","travel.tt","museum.tt","aero.tt","name.tt","gov.tt","edu.tt","tv","tw","edu.tw","gov.tw","mil.tw","com.tw","net.tw","org.tw","idv.tw","game.tw","ebiz.tw","club.tw","網路.tw","組織.tw","商業.tw","tz","ac.tz","co.tz","go.tz","hotel.tz","info.tz","me.tz","mil.tz","mobi.tz","ne.tz","or.tz","sc.tz","tv.tz","ua","com.ua","edu.ua","gov.ua","in.ua","net.ua","org.ua","cherkassy.ua","cherkasy.ua","chernigov.ua","chernihiv.ua","chernivtsi.ua","chernovtsy.ua","ck.ua","cn.ua","cr.ua","crimea.ua","cv.ua","dn.ua","dnepropetrovsk.ua","dnipropetrovsk.ua","dominic.ua","donetsk.ua","dp.ua","if.ua","ivano-frankivsk.ua","kh.ua","kharkiv.ua","kharkov.ua","kherson.ua","khmelnitskiy.ua","khmelnytskyi.ua","kiev.ua","kirovograd.ua","km.ua","kr.ua","krym.ua","ks.ua","kv.ua","kyiv.ua","lg.ua","lt.ua","lugansk.ua","lutsk.ua","lv.ua","lviv.ua","mk.ua","mykolaiv.ua","nikolaev.ua","od.ua","odesa.ua","odessa.ua","pl.ua","poltava.ua","rivne.ua","rovno.ua","rv.ua","sb.ua","sebastopol.ua","sevastopol.ua","sm.ua","sumy.ua","te.ua","ternopil.ua","uz.ua","uzhgorod.ua","vinnica.ua","vinnytsia.ua","vn.ua","volyn.ua","yalta.ua","zaporizhzhe.ua","zaporizhzhia.ua","zhitomir.ua","zhytomyr.ua","zp.ua","zt.ua","ug","co.ug","or.ug","ac.ug","sc.ug","go.ug","ne.ug","com.ug","org.ug","uk","ac.uk","co.uk","gov.uk","ltd.uk","me.uk","net.uk","nhs.uk","org.uk","plc.uk","police.uk","*.sch.uk","us","dni.us","fed.us","isa.us","kids.us","nsn.us","ak.us","al.us","ar.us","as.us","az.us","ca.us","co.us","ct.us","dc.us","de.us","fl.us","ga.us","gu.us","hi.us","ia.us","id.us","il.us","in.us","ks.us","ky.us","la.us","ma.us","md.us","me.us","mi.us","mn.us","mo.us","ms.us","mt.us","nc.us","nd.us","ne.us","nh.us","nj.us","nm.us","nv.us","ny.us","oh.us","ok.us","or.us","pa.us","pr.us","ri.us","sc.us","sd.us","tn.us","tx.us","ut.us","vi.us","vt.us","va.us","wa.us","wi.us","wv.us","wy.us","k12.ak.us","k12.al.us","k12.ar.us","k12.as.us","k12.az.us","k12.ca.us","k12.co.us","k12.ct.us","k12.dc.us","k12.de.us","k12.fl.us","k12.ga.us","k12.gu.us","k12.ia.us","k12.id.us","k12.il.us","k12.in.us","k12.ks.us","k12.ky.us","k12.la.us","k12.ma.us","k12.md.us","k12.me.us","k12.mi.us","k12.mn.us","k12.mo.us","k12.ms.us","k12.mt.us","k12.nc.us","k12.ne.us","k12.nh.us","k12.nj.us","k12.nm.us","k12.nv.us","k12.ny.us","k12.oh.us","k12.ok.us","k12.or.us","k12.pa.us","k12.pr.us","k12.ri.us","k12.sc.us","k12.tn.us","k12.tx.us","k12.ut.us","k12.vi.us","k12.vt.us","k12.va.us","k12.wa.us","k12.wi.us","k12.wy.us","cc.ak.us","cc.al.us","cc.ar.us","cc.as.us","cc.az.us","cc.ca.us","cc.co.us","cc.ct.us","cc.dc.us","cc.de.us","cc.fl.us","cc.ga.us","cc.gu.us","cc.hi.us","cc.ia.us","cc.id.us","cc.il.us","cc.in.us","cc.ks.us","cc.ky.us","cc.la.us","cc.ma.us","cc.md.us","cc.me.us","cc.mi.us","cc.mn.us","cc.mo.us","cc.ms.us","cc.mt.us","cc.nc.us","cc.nd.us","cc.ne.us","cc.nh.us","cc.nj.us","cc.nm.us","cc.nv.us","cc.ny.us","cc.oh.us","cc.ok.us","cc.or.us","cc.pa.us","cc.pr.us","cc.ri.us","cc.sc.us","cc.sd.us","cc.tn.us","cc.tx.us","cc.ut.us","cc.vi.us","cc.vt.us","cc.va.us","cc.wa.us","cc.wi.us","cc.wv.us","cc.wy.us","lib.ak.us","lib.al.us","lib.ar.us","lib.as.us","lib.az.us","lib.ca.us","lib.co.us","lib.ct.us","lib.dc.us","lib.fl.us","lib.ga.us","lib.gu.us","lib.hi.us","lib.ia.us","lib.id.us","lib.il.us","lib.in.us","lib.ks.us","lib.ky.us","lib.la.us","lib.ma.us","lib.md.us","lib.me.us","lib.mi.us","lib.mn.us","lib.mo.us","lib.ms.us","lib.mt.us","lib.nc.us","lib.nd.us","lib.ne.us","lib.nh.us","lib.nj.us","lib.nm.us","lib.nv.us","lib.ny.us","lib.oh.us","lib.ok.us","lib.or.us","lib.pa.us","lib.pr.us","lib.ri.us","lib.sc.us","lib.sd.us","lib.tn.us","lib.tx.us","lib.ut.us","lib.vi.us","lib.vt.us","lib.va.us","lib.wa.us","lib.wi.us","lib.wy.us","pvt.k12.ma.us","chtr.k12.ma.us","paroch.k12.ma.us","ann-arbor.mi.us","cog.mi.us","dst.mi.us","eaton.mi.us","gen.mi.us","mus.mi.us","tec.mi.us","washtenaw.mi.us","uy","com.uy","edu.uy","gub.uy","mil.uy","net.uy","org.uy","uz","co.uz","com.uz","net.uz","org.uz","va","vc","com.vc","net.vc","org.vc","gov.vc","mil.vc","edu.vc","ve","arts.ve","co.ve","com.ve","e12.ve","edu.ve","firm.ve","gob.ve","gov.ve","info.ve","int.ve","mil.ve","net.ve","org.ve","rec.ve","store.ve","tec.ve","web.ve","vg","vi","co.vi","com.vi","k12.vi","net.vi","org.vi","vn","com.vn","net.vn","org.vn","edu.vn","gov.vn","int.vn","ac.vn","biz.vn","info.vn","name.vn","pro.vn","health.vn","vu","com.vu","edu.vu","net.vu","org.vu","wf","ws","com.ws","net.ws","org.ws","gov.ws","edu.ws","yt","امارات","հայ","বাংলা","бг","бел","中国","中國","الجزائر","مصر","ею","გე","ελ","香港","公司.香港","教育.香港","政府.香港","個人.香港","網絡.香港","組織.香港","ಭಾರತ","ଭାରତ","ভাৰত","भारतम्","भारोत","ڀارت","ഭാരതം","भारत","بارت","بھارت","భారత్","ભારત","ਭਾਰਤ","ভারত","இந்தியா","ایران","ايران","عراق","الاردن","한국","қаз","ලංකා","இலங்கை","المغرب","мкд","мон","澳門","澳门","مليسيا","عمان","پاکستان","پاكستان","فلسطين","срб","пр.срб","орг.срб","обр.срб","од.срб","упр.срб","ак.срб","рф","قطر","السعودية","السعودیة","السعودیۃ","السعوديه","سودان","新加坡","சிங்கப்பூர்","سورية","سوريا","ไทย","ศึกษา.ไทย","ธุรกิจ.ไทย","รัฐบาล.ไทย","ทหาร.ไทย","เน็ต.ไทย","องค์กร.ไทย","تونس","台灣","台湾","臺灣","укр","اليمن","xxx","*.ye","ac.za","agric.za","alt.za","co.za","edu.za","gov.za","grondar.za","law.za","mil.za","net.za","ngo.za","nis.za","nom.za","org.za","school.za","tm.za","web.za","zm","ac.zm","biz.zm","co.zm","com.zm","edu.zm","gov.zm","info.zm","mil.zm","net.zm","org.zm","sch.zm","zw","ac.zw","co.zw","gov.zw","mil.zw","org.zw","aaa","aarp","abarth","abb","abbott","abbvie","abc","able","abogado","abudhabi","academy","accenture","accountant","accountants","aco","active","actor","adac","ads","adult","aeg","aetna","afamilycompany","afl","africa","agakhan","agency","aig","aigo","airbus","airforce","airtel","akdn","alfaromeo","alibaba","alipay","allfinanz","allstate","ally","alsace","alstom","americanexpress","americanfamily","amex","amfam","amica","amsterdam","analytics","android","anquan","anz","aol","apartments","app","apple","aquarelle","arab","aramco","archi","army","art","arte","asda","associates","athleta","attorney","auction","audi","audible","audio","auspost","author","auto","autos","avianca","aws","axa","azure","baby","baidu","banamex","bananarepublic","band","bank","bar","barcelona","barclaycard","barclays","barefoot","bargains","baseball","basketball","bauhaus","bayern","bbc","bbt","bbva","bcg","bcn","beats","beauty","beer","bentley","berlin","best","bestbuy","bet","bharti","bible","bid","bike","bing","bingo","bio","black","blackfriday","blanco","blockbuster","blog","bloomberg","blue","bms","bmw","bnl","bnpparibas","boats","boehringer","bofa","bom","bond","boo","book","booking","bosch","bostik","boston","bot","boutique","box","bradesco","bridgestone","broadway","broker","brother","brussels","budapest","bugatti","build","builders","business","buy","buzz","bzh","cab","cafe","cal","call","calvinklein","cam","camera","camp","cancerresearch","canon","capetown","capital","capitalone","car","caravan","cards","care","career","careers","cars","cartier","casa","case","caseih","cash","casino","catering","catholic","cba","cbn","cbre","cbs","ceb","center","ceo","cern","cfa","cfd","chanel","channel","charity","chase","chat","cheap","chintai","christmas","chrome","chrysler","church","cipriani","circle","cisco","citadel","citi","citic","city","cityeats","claims","cleaning","click","clinic","clinique","clothing","cloud","club","clubmed","coach","codes","coffee","college","cologne","comcast","commbank","community","company","compare","computer","comsec","condos","construction","consulting","contact","contractors","cooking","cookingchannel","cool","corsica","country","coupon","coupons","courses","credit","creditcard","creditunion","cricket","crown","crs","cruise","cruises","csc","cuisinella","cymru","cyou","dabur","dad","dance","data","date","dating","datsun","day","dclk","dds","deal","dealer","deals","degree","delivery","dell","deloitte","delta","democrat","dental","dentist","desi","design","dev","dhl","diamonds","diet","digital","direct","directory","discount","discover","dish","diy","dnp","docs","doctor","dodge","dog","doha","domains","dot","download","drive","dtv","dubai","duck","dunlop","duns","dupont","durban","dvag","dvr","earth","eat","eco","edeka","education","email","emerck","energy","engineer","engineering","enterprises","epost","epson","equipment","ericsson","erni","esq","estate","esurance","etisalat","eurovision","eus","events","everbank","exchange","expert","exposed","express","extraspace","fage","fail","fairwinds","faith","family","fan","fans","farm","farmers","fashion","fast","fedex","feedback","ferrari","ferrero","fiat","fidelity","fido","film","final","finance","financial","fire","firestone","firmdale","fish","fishing","fit","fitness","flickr","flights","flir","florist","flowers","fly","foo","food","foodnetwork","football","ford","forex","forsale","forum","foundation","fox","free","fresenius","frl","frogans","frontdoor","frontier","ftr","fujitsu","fujixerox","fun","fund","furniture","futbol","fyi","gal","gallery","gallo","gallup","game","games","gap","garden","gbiz","gdn","gea","gent","genting","george","ggee","gift","gifts","gives","giving","glade","glass","gle","global","globo","gmail","gmbh","gmo","gmx","godaddy","gold","goldpoint","golf","goo","goodhands","goodyear","goog","google","gop","got","grainger","graphics","gratis","green","gripe","grocery","group","guardian","gucci","guge","guide","guitars","guru","hair","hamburg","hangout","haus","hbo","hdfc","hdfcbank","health","healthcare","help","helsinki","here","hermes","hgtv","hiphop","hisamitsu","hitachi","hiv","hkt","hockey","holdings","holiday","homedepot","homegoods","homes","homesense","honda","honeywell","horse","hospital","host","hosting","hot","hoteles","hotels","hotmail","house","how","hsbc","hughes","hyatt","hyundai","ibm","icbc","ice","icu","ieee","ifm","ikano","imamat","imdb","immo","immobilien","inc","industries","infiniti","ing","ink","institute","insurance","insure","intel","international","intuit","investments","ipiranga","irish","iselect","ismaili","ist","istanbul","itau","itv","iveco","jaguar","java","jcb","jcp","jeep","jetzt","jewelry","jio","jlc","jll","jmp","jnj","joburg","jot","joy","jpmorgan","jprs","juegos","juniper","kaufen","kddi","kerryhotels","kerrylogistics","kerryproperties","kfh","kia","kim","kinder","kindle","kitchen","kiwi","koeln","komatsu","kosher","kpmg","kpn","krd","kred","kuokgroup","kyoto","lacaixa","ladbrokes","lamborghini","lamer","lancaster","lancia","lancome","land","landrover","lanxess","lasalle","lat","latino","latrobe","law","lawyer","lds","lease","leclerc","lefrak","legal","lego","lexus","lgbt","liaison","lidl","life","lifeinsurance","lifestyle","lighting","like","lilly","limited","limo","lincoln","linde","link","lipsy","live","living","lixil","llc","loan","loans","locker","locus","loft","lol","london","lotte","lotto","love","lpl","lplfinancial","ltd","ltda","lundbeck","lupin","luxe","luxury","macys","madrid","maif","maison","makeup","man","management","mango","map","market","marketing","markets","marriott","marshalls","maserati","mattel","mba","mckinsey","med","media","meet","melbourne","meme","memorial","men","menu","merckmsd","metlife","miami","microsoft","mini","mint","mit","mitsubishi","mlb","mls","mma","mobile","mobily","moda","moe","moi","mom","monash","money","monster","mopar","mormon","mortgage","moscow","moto","motorcycles","mov","movie","movistar","msd","mtn","mtr","mutual","nab","nadex","nagoya","nationwide","natura","navy","nba","nec","netbank","netflix","network","neustar","new","newholland","news","next","nextdirect","nexus","nfl","ngo","nhk","nico","nike","nikon","ninja","nissan","nissay","nokia","northwesternmutual","norton","now","nowruz","nowtv","nra","nrw","ntt","nyc","obi","observer","off","office","okinawa","olayan","olayangroup","oldnavy","ollo","omega","one","ong","onl","online","onyourside","ooo","open","oracle","orange","organic","origins","osaka","otsuka","ott","ovh","page","panasonic","panerai","paris","pars","partners","parts","party","passagens","pay","pccw","pet","pfizer","pharmacy","phd","philips","phone","photo","photography","photos","physio","piaget","pics","pictet","pictures","pid","pin","ping","pink","pioneer","pizza","place","play","playstation","plumbing","plus","pnc","pohl","poker","politie","porn","pramerica","praxi","press","prime","prod","productions","prof","progressive","promo","properties","property","protection","pru","prudential","pub","pwc","qpon","quebec","quest","qvc","racing","radio","raid","read","realestate","realtor","realty","recipes","red","redstone","redumbrella","rehab","reise","reisen","reit","reliance","ren","rent","rentals","repair","report","republican","rest","restaurant","review","reviews","rexroth","rich","richardli","ricoh","rightathome","ril","rio","rip","rmit","rocher","rocks","rodeo","rogers","room","rsvp","rugby","ruhr","run","rwe","ryukyu","saarland","safe","safety","sakura","sale","salon","samsclub","samsung","sandvik","sandvikcoromant","sanofi","sap","sarl","sas","save","saxo","sbi","sbs","sca","scb","schaeffler","schmidt","scholarships","school","schule","schwarz","science","scjohnson","scor","scot","search","seat","secure","security","seek","select","sener","services","ses","seven","sew","sex","sexy","sfr","shangrila","sharp","shaw","shell","shia","shiksha","shoes","shop","shopping","shouji","show","showtime","shriram","silk","sina","singles","site","ski","skin","sky","skype","sling","smart","smile","sncf","soccer","social","softbank","software","sohu","solar","solutions","song","sony","soy","space","spiegel","sport","spot","spreadbetting","srl","srt","stada","staples","star","starhub","statebank","statefarm","statoil","stc","stcgroup","stockholm","storage","store","stream","studio","study","style","sucks","supplies","supply","support","surf","surgery","suzuki","swatch","swiftcover","swiss","sydney","symantec","systems","tab","taipei","talk","taobao","target","tatamotors","tatar","tattoo","tax","taxi","tci","tdk","team","tech","technology","telecity","telefonica","temasek","tennis","teva","thd","theater","theatre","tiaa","tickets","tienda","tiffany","tips","tires","tirol","tjmaxx","tjx","tkmaxx","tmall","today","tokyo","tools","top","toray","toshiba","total","tours","town","toyota","toys","trade","trading","training","travel","travelchannel","travelers","travelersinsurance","trust","trv","tube","tui","tunes","tushu","tvs","ubank","ubs","uconnect","unicom","university","uno","uol","ups","vacations","vana","vanguard","vegas","ventures","verisign","versicherung","vet","viajes","video","vig","viking","villas","vin","vip","virgin","visa","vision","vista","vistaprint","viva","vivo","vlaanderen","vodka","volkswagen","volvo","vote","voting","voto","voyage","vuelos","wales","walmart","walter","wang","wanggou","warman","watch","watches","weather","weatherchannel","webcam","weber","website","wed","wedding","weibo","weir","whoswho","wien","wiki","williamhill","win","windows","wine","winners","wme","wolterskluwer","woodside","work","works","world","wow","wtc","wtf","xbox","xerox","xfinity","xihuan","xin","कॉम","セール","佛山","慈善","集团","在线","大众汽车","点看","คอม","八卦","موقع","公益","公司","香格里拉","网站","移动","我爱你","москва","католик","онлайн","сайт","联通","קום","时尚","微博","淡马锡","ファッション","орг","नेट","ストア","삼성","商标","商店","商城","дети","ポイント","新闻","工行","家電","كوم","中文网","中信","娱乐","谷歌","電訊盈科","购物","クラウド","通販","网店","संगठन","餐厅","网络","ком","诺基亚","食品","飞利浦","手表","手机","ارامكو","العليان","اتصالات","بازار","موبايلي","ابوظبي","كاثوليك","همراه","닷컴","政府","شبكة","بيتك","عرب","机构","组织机构","健康","招聘","рус","珠宝","大拿","みんな","グーグル","世界","書籍","网址","닷넷","コム","天主教","游戏","vermögensberater","vermögensberatung","企业","信息","嘉里大酒店","嘉里","广东","政务","xyz","yachts","yahoo","yamaxun","yandex","yodobashi","yoga","yokohama","you","youtube","yun","zappos","zara","zero","zip","zippo","zone","zuerich","cc.ua","inf.ua","ltd.ua","beep.pl","*.compute.estate","*.alces.network","alwaysdata.net","cloudfront.net","*.compute.amazonaws.com","*.compute-1.amazonaws.com","*.compute.amazonaws.com.cn","us-east-1.amazonaws.com","cn-north-1.eb.amazonaws.com.cn","elasticbeanstalk.com","ap-northeast-1.elasticbeanstalk.com","ap-northeast-2.elasticbeanstalk.com","ap-northeast-3.elasticbeanstalk.com","ap-south-1.elasticbeanstalk.com","ap-southeast-1.elasticbeanstalk.com","ap-southeast-2.elasticbeanstalk.com","ca-central-1.elasticbeanstalk.com","eu-central-1.elasticbeanstalk.com","eu-west-1.elasticbeanstalk.com","eu-west-2.elasticbeanstalk.com","eu-west-3.elasticbeanstalk.com","sa-east-1.elasticbeanstalk.com","us-east-1.elasticbeanstalk.com","us-east-2.elasticbeanstalk.com","us-gov-west-1.elasticbeanstalk.com","us-west-1.elasticbeanstalk.com","us-west-2.elasticbeanstalk.com","*.elb.amazonaws.com","*.elb.amazonaws.com.cn","s3.amazonaws.com","s3-ap-northeast-1.amazonaws.com","s3-ap-northeast-2.amazonaws.com","s3-ap-south-1.amazonaws.com","s3-ap-southeast-1.amazonaws.com","s3-ap-southeast-2.amazonaws.com","s3-ca-central-1.amazonaws.com","s3-eu-central-1.amazonaws.com","s3-eu-west-1.amazonaws.com","s3-eu-west-2.amazonaws.com","s3-eu-west-3.amazonaws.com","s3-external-1.amazonaws.com","s3-fips-us-gov-west-1.amazonaws.com","s3-sa-east-1.amazonaws.com","s3-us-gov-west-1.amazonaws.com","s3-us-east-2.amazonaws.com","s3-us-west-1.amazonaws.com","s3-us-west-2.amazonaws.com","s3.ap-northeast-2.amazonaws.com","s3.ap-south-1.amazonaws.com","s3.cn-north-1.amazonaws.com.cn","s3.ca-central-1.amazonaws.com","s3.eu-central-1.amazonaws.com","s3.eu-west-2.amazonaws.com","s3.eu-west-3.amazonaws.com","s3.us-east-2.amazonaws.com","s3.dualstack.ap-northeast-1.amazonaws.com","s3.dualstack.ap-northeast-2.amazonaws.com","s3.dualstack.ap-south-1.amazonaws.com","s3.dualstack.ap-southeast-1.amazonaws.com","s3.dualstack.ap-southeast-2.amazonaws.com","s3.dualstack.ca-central-1.amazonaws.com","s3.dualstack.eu-central-1.amazonaws.com","s3.dualstack.eu-west-1.amazonaws.com","s3.dualstack.eu-west-2.amazonaws.com","s3.dualstack.eu-west-3.amazonaws.com","s3.dualstack.sa-east-1.amazonaws.com","s3.dualstack.us-east-1.amazonaws.com","s3.dualstack.us-east-2.amazonaws.com","s3-website-us-east-1.amazonaws.com","s3-website-us-west-1.amazonaws.com","s3-website-us-west-2.amazonaws.com","s3-website-ap-northeast-1.amazonaws.com","s3-website-ap-southeast-1.amazonaws.com","s3-website-ap-southeast-2.amazonaws.com","s3-website-eu-west-1.amazonaws.com","s3-website-sa-east-1.amazonaws.com","s3-website.ap-northeast-2.amazonaws.com","s3-website.ap-south-1.amazonaws.com","s3-website.ca-central-1.amazonaws.com","s3-website.eu-central-1.amazonaws.com","s3-website.eu-west-2.amazonaws.com","s3-website.eu-west-3.amazonaws.com","s3-website.us-east-2.amazonaws.com","t3l3p0rt.net","tele.amune.org","on-aptible.com","user.party.eus","pimienta.org","poivron.org","potager.org","sweetpepper.org","myasustor.com","myfritz.net","*.awdev.ca","*.advisor.ws","backplaneapp.io","betainabox.com","bnr.la","blackbaudcdn.net","boomla.net","boxfuse.io","square7.ch","bplaced.com","bplaced.de","square7.de","bplaced.net","square7.net","browsersafetymark.io","mycd.eu","ae.org","ar.com","br.com","cn.com","com.de","com.se","de.com","eu.com","gb.com","gb.net","hu.com","hu.net","jp.net","jpn.com","kr.com","mex.com","no.com","qc.com","ru.com","sa.com","se.net","uk.com","uk.net","us.com","uy.com","za.bz","za.com","africa.com","gr.com","in.net","us.org","co.com","c.la","certmgr.org","xenapponazure.com","virtueeldomein.nl","cleverapps.io","c66.me","cloud66.ws","jdevcloud.com","wpdevcloud.com","cloudaccess.host","freesite.host","cloudaccess.net","cloudcontrolled.com","cloudcontrolapp.com","co.ca","*.otap.co","co.cz","c.cdn77.org","cdn77-ssl.net","r.cdn77.net","rsc.cdn77.org","ssl.origin.cdn77-secure.org","cloudns.asia","cloudns.biz","cloudns.club","cloudns.cc","cloudns.eu","cloudns.in","cloudns.info","cloudns.org","cloudns.pro","cloudns.pw","cloudns.us","cloudeity.net","cnpy.gdn","co.nl","co.no","webhosting.be","hosting-cluster.nl","dyn.cosidns.de","dynamisches-dns.de","dnsupdater.de","internet-dns.de","l-o-g-i-n.de","dynamic-dns.info","feste-ip.net","knx-server.net","static-access.net","realm.cz","*.cryptonomic.net","cupcake.is","cyon.link","cyon.site","daplie.me","localhost.daplie.me","dattolocal.com","dattorelay.com","dattoweb.com","mydatto.com","dattolocal.net","mydatto.net","biz.dk","co.dk","firm.dk","reg.dk","store.dk","debian.net","dedyn.io","dnshome.de","drayddns.com","dreamhosters.com","mydrobo.com","drud.io","drud.us","duckdns.org","dy.fi","tunk.org","dyndns-at-home.com","dyndns-at-work.com","dyndns-blog.com","dyndns-free.com","dyndns-home.com","dyndns-ip.com","dyndns-mail.com","dyndns-office.com","dyndns-pics.com","dyndns-remote.com","dyndns-server.com","dyndns-web.com","dyndns-wiki.com","dyndns-work.com","dyndns.biz","dyndns.info","dyndns.org","dyndns.tv","at-band-camp.net","ath.cx","barrel-of-knowledge.info","barrell-of-knowledge.info","better-than.tv","blogdns.com","blogdns.net","blogdns.org","blogsite.org","boldlygoingnowhere.org","broke-it.net","buyshouses.net","cechire.com","dnsalias.com","dnsalias.net","dnsalias.org","dnsdojo.com","dnsdojo.net","dnsdojo.org","does-it.net","doesntexist.com","doesntexist.org","dontexist.com","dontexist.net","dontexist.org","doomdns.com","doomdns.org","dvrdns.org","dyn-o-saur.com","dynalias.com","dynalias.net","dynalias.org","dynathome.net","dyndns.ws","endofinternet.net","endofinternet.org","endoftheinternet.org","est-a-la-maison.com","est-a-la-masion.com","est-le-patron.com","est-mon-blogueur.com","for-better.biz","for-more.biz","for-our.info","for-some.biz","for-the.biz","forgot.her.name","forgot.his.name","from-ak.com","from-al.com","from-ar.com","from-az.net","from-ca.com","from-co.net","from-ct.com","from-dc.com","from-de.com","from-fl.com","from-ga.com","from-hi.com","from-ia.com","from-id.com","from-il.com","from-in.com","from-ks.com","from-ky.com","from-la.net","from-ma.com","from-md.com","from-me.org","from-mi.com","from-mn.com","from-mo.com","from-ms.com","from-mt.com","from-nc.com","from-nd.com","from-ne.com","from-nh.com","from-nj.com","from-nm.com","from-nv.com","from-ny.net","from-oh.com","from-ok.com","from-or.com","from-pa.com","from-pr.com","from-ri.com","from-sc.com","from-sd.com","from-tn.com","from-tx.com","from-ut.com","from-va.com","from-vt.com","from-wa.com","from-wi.com","from-wv.com","from-wy.com","ftpaccess.cc","fuettertdasnetz.de","game-host.org","game-server.cc","getmyip.com","gets-it.net","go.dyndns.org","gotdns.com","gotdns.org","groks-the.info","groks-this.info","ham-radio-op.net","here-for-more.info","hobby-site.com","hobby-site.org","home.dyndns.org","homedns.org","homeftp.net","homeftp.org","homeip.net","homelinux.com","homelinux.net","homelinux.org","homeunix.com","homeunix.net","homeunix.org","iamallama.com","in-the-band.net","is-a-anarchist.com","is-a-blogger.com","is-a-bookkeeper.com","is-a-bruinsfan.org","is-a-bulls-fan.com","is-a-candidate.org","is-a-caterer.com","is-a-celticsfan.org","is-a-chef.com","is-a-chef.net","is-a-chef.org","is-a-conservative.com","is-a-cpa.com","is-a-cubicle-slave.com","is-a-democrat.com","is-a-designer.com","is-a-doctor.com","is-a-financialadvisor.com","is-a-geek.com","is-a-geek.net","is-a-geek.org","is-a-green.com","is-a-guru.com","is-a-hard-worker.com","is-a-hunter.com","is-a-knight.org","is-a-landscaper.com","is-a-lawyer.com","is-a-liberal.com","is-a-libertarian.com","is-a-linux-user.org","is-a-llama.com","is-a-musician.com","is-a-nascarfan.com","is-a-nurse.com","is-a-painter.com","is-a-patsfan.org","is-a-personaltrainer.com","is-a-photographer.com","is-a-player.com","is-a-republican.com","is-a-rockstar.com","is-a-socialist.com","is-a-soxfan.org","is-a-student.com","is-a-teacher.com","is-a-techie.com","is-a-therapist.com","is-an-accountant.com","is-an-actor.com","is-an-actress.com","is-an-anarchist.com","is-an-artist.com","is-an-engineer.com","is-an-entertainer.com","is-by.us","is-certified.com","is-found.org","is-gone.com","is-into-anime.com","is-into-cars.com","is-into-cartoons.com","is-into-games.com","is-leet.com","is-lost.org","is-not-certified.com","is-saved.org","is-slick.com","is-uberleet.com","is-very-bad.org","is-very-evil.org","is-very-good.org","is-very-nice.org","is-very-sweet.org","is-with-theband.com","isa-geek.com","isa-geek.net","isa-geek.org","isa-hockeynut.com","issmarterthanyou.com","isteingeek.de","istmein.de","kicks-ass.net","kicks-ass.org","knowsitall.info","land-4-sale.us","lebtimnetz.de","leitungsen.de","likes-pie.com","likescandy.com","merseine.nu","mine.nu","misconfused.org","mypets.ws","myphotos.cc","neat-url.com","office-on-the.net","on-the-web.tv","podzone.net","podzone.org","readmyblog.org","saves-the-whales.com","scrapper-site.net","scrapping.cc","selfip.biz","selfip.com","selfip.info","selfip.net","selfip.org","sells-for-less.com","sells-for-u.com","sells-it.net","sellsyourhome.org","servebbs.com","servebbs.net","servebbs.org","serveftp.net","serveftp.org","servegame.org","shacknet.nu","simple-url.com","space-to-rent.com","stuff-4-sale.org","stuff-4-sale.us","teaches-yoga.com","thruhere.net","traeumtgerade.de","webhop.biz","webhop.info","webhop.net","webhop.org","worse-than.tv","writesthisblog.com","ddnss.de","dyn.ddnss.de","dyndns.ddnss.de","dyndns1.de","dyn-ip24.de","home-webserver.de","dyn.home-webserver.de","myhome-server.de","ddnss.org","definima.net","definima.io","bci.dnstrace.pro","ddnsfree.com","ddnsgeek.com","giize.com","gleeze.com","kozow.com","loseyourip.com","ooguy.com","theworkpc.com","casacam.net","dynu.net","accesscam.org","camdvr.org","freeddns.org","mywire.org","webredirect.org","myddns.rocks","blogsite.xyz","dynv6.net","e4.cz","mytuleap.com","enonic.io","customer.enonic.io","eu.org","al.eu.org","asso.eu.org","at.eu.org","au.eu.org","be.eu.org","bg.eu.org","ca.eu.org","cd.eu.org","ch.eu.org","cn.eu.org","cy.eu.org","cz.eu.org","de.eu.org","dk.eu.org","edu.eu.org","ee.eu.org","es.eu.org","fi.eu.org","fr.eu.org","gr.eu.org","hr.eu.org","hu.eu.org","ie.eu.org","il.eu.org","in.eu.org","int.eu.org","is.eu.org","it.eu.org","jp.eu.org","kr.eu.org","lt.eu.org","lu.eu.org","lv.eu.org","mc.eu.org","me.eu.org","mk.eu.org","mt.eu.org","my.eu.org","net.eu.org","ng.eu.org","nl.eu.org","no.eu.org","nz.eu.org","paris.eu.org","pl.eu.org","pt.eu.org","q-a.eu.org","ro.eu.org","ru.eu.org","se.eu.org","si.eu.org","sk.eu.org","tr.eu.org","uk.eu.org","us.eu.org","eu-1.evennode.com","eu-2.evennode.com","eu-3.evennode.com","eu-4.evennode.com","us-1.evennode.com","us-2.evennode.com","us-3.evennode.com","us-4.evennode.com","twmail.cc","twmail.net","twmail.org","mymailer.com.tw","url.tw","apps.fbsbx.com","ru.net","adygeya.ru","bashkiria.ru","bir.ru","cbg.ru","com.ru","dagestan.ru","grozny.ru","kalmykia.ru","kustanai.ru","marine.ru","mordovia.ru","msk.ru","mytis.ru","nalchik.ru","nov.ru","pyatigorsk.ru","spb.ru","vladikavkaz.ru","vladimir.ru","abkhazia.su","adygeya.su","aktyubinsk.su","arkhangelsk.su","armenia.su","ashgabad.su","azerbaijan.su","balashov.su","bashkiria.su","bryansk.su","bukhara.su","chimkent.su","dagestan.su","east-kazakhstan.su","exnet.su","georgia.su","grozny.su","ivanovo.su","jambyl.su","kalmykia.su","kaluga.su","karacol.su","karaganda.su","karelia.su","khakassia.su","krasnodar.su","kurgan.su","kustanai.su","lenug.su","mangyshlak.su","mordovia.su","msk.su","murmansk.su","nalchik.su","navoi.su","north-kazakhstan.su","nov.su","obninsk.su","penza.su","pokrovsk.su","sochi.su","spb.su","tashkent.su","termez.su","togliatti.su","troitsk.su","tselinograd.su","tula.su","tuva.su","vladikavkaz.su","vladimir.su","vologda.su","channelsdvr.net","fastlylb.net","map.fastlylb.net","freetls.fastly.net","map.fastly.net","a.prod.fastly.net","global.prod.fastly.net","a.ssl.fastly.net","b.ssl.fastly.net","global.ssl.fastly.net","fastpanel.direct","fastvps-server.com","fhapp.xyz","fedorainfracloud.org","fedorapeople.org","cloud.fedoraproject.org","app.os.fedoraproject.org","app.os.stg.fedoraproject.org","filegear.me","firebaseapp.com","flynnhub.com","flynnhosting.net","freebox-os.com","freeboxos.com","fbx-os.fr","fbxos.fr","freebox-os.fr","freeboxos.fr","freedesktop.org","*.futurecms.at","*.ex.futurecms.at","*.in.futurecms.at","futurehosting.at","futuremailing.at","*.ex.ortsinfo.at","*.kunden.ortsinfo.at","*.statics.cloud","service.gov.uk","github.io","githubusercontent.com","gitlab.io","homeoffice.gov.uk","ro.im","shop.ro","goip.de","*.0emm.com","appspot.com","blogspot.ae","blogspot.al","blogspot.am","blogspot.ba","blogspot.be","blogspot.bg","blogspot.bj","blogspot.ca","blogspot.cf","blogspot.ch","blogspot.cl","blogspot.co.at","blogspot.co.id","blogspot.co.il","blogspot.co.ke","blogspot.co.nz","blogspot.co.uk","blogspot.co.za","blogspot.com","blogspot.com.ar","blogspot.com.au","blogspot.com.br","blogspot.com.by","blogspot.com.co","blogspot.com.cy","blogspot.com.ee","blogspot.com.eg","blogspot.com.es","blogspot.com.mt","blogspot.com.ng","blogspot.com.tr","blogspot.com.uy","blogspot.cv","blogspot.cz","blogspot.de","blogspot.dk","blogspot.fi","blogspot.fr","blogspot.gr","blogspot.hk","blogspot.hr","blogspot.hu","blogspot.ie","blogspot.in","blogspot.is","blogspot.it","blogspot.jp","blogspot.kr","blogspot.li","blogspot.lt","blogspot.lu","blogspot.md","blogspot.mk","blogspot.mr","blogspot.mx","blogspot.my","blogspot.nl","blogspot.no","blogspot.pe","blogspot.pt","blogspot.qa","blogspot.re","blogspot.ro","blogspot.rs","blogspot.ru","blogspot.se","blogspot.sg","blogspot.si","blogspot.sk","blogspot.sn","blogspot.td","blogspot.tw","blogspot.ug","blogspot.vn","cloudfunctions.net","cloud.goog","codespot.com","googleapis.com","googlecode.com","pagespeedmobilizer.com","publishproxy.com","withgoogle.com","withyoutube.com","hashbang.sh","hasura.app","hasura-app.io","hepforge.org","herokuapp.com","herokussl.com","myravendb.com","ravendb.community","ravendb.me","development.run","ravendb.run","moonscale.net","iki.fi","biz.at","info.at","info.cx","ac.leg.br","al.leg.br","am.leg.br","ap.leg.br","ba.leg.br","ce.leg.br","df.leg.br","es.leg.br","go.leg.br","ma.leg.br","mg.leg.br","ms.leg.br","mt.leg.br","pa.leg.br","pb.leg.br","pe.leg.br","pi.leg.br","pr.leg.br","rj.leg.br","rn.leg.br","ro.leg.br","rr.leg.br","rs.leg.br","sc.leg.br","se.leg.br","sp.leg.br","to.leg.br","pixolino.com","ipifony.net","mein-iserv.de","test-iserv.de","myjino.ru","*.hosting.myjino.ru","*.landing.myjino.ru","*.spectrum.myjino.ru","*.vps.myjino.ru","*.triton.zone","*.cns.joyent.com","js.org","keymachine.de","knightpoint.systems","co.krd","edu.krd","git-repos.de","lcube-server.de","svn-repos.de","app.lmpm.com","linkitools.space","linkyard.cloud","linkyard-cloud.ch","we.bs","uklugs.org","glug.org.uk","lug.org.uk","lugs.org.uk","barsy.bg","barsy.co.uk","barsyonline.co.uk","barsycenter.com","barsyonline.com","barsy.club","barsy.de","barsy.eu","barsy.in","barsy.info","barsy.io","barsy.me","barsy.menu","barsy.mobi","barsy.net","barsy.online","barsy.org","barsy.pro","barsy.pub","barsy.shop","barsy.site","barsy.support","barsy.uk","*.magentosite.cloud","mayfirst.info","mayfirst.org","hb.cldmail.ru","miniserver.com","memset.net","cloud.metacentrum.cz","custom.metacentrum.cz","flt.cloud.muni.cz","usr.cloud.muni.cz","meteorapp.com","eu.meteorapp.com","co.pl","azurecontainer.io","azurewebsites.net","azure-mobile.net","cloudapp.net","mozilla-iot.org","bmoattachments.org","net.ru","org.ru","pp.ru","bitballoon.com","netlify.com","4u.com","ngrok.io","nh-serv.co.uk","nfshost.com","dnsking.ch","mypi.co","n4t.co","001www.com","ddnslive.com","myiphost.com","forumz.info","16-b.it","32-b.it","64-b.it","soundcast.me","tcp4.me","dnsup.net","hicam.net","now-dns.net","ownip.net","vpndns.net","dynserv.org","now-dns.org","x443.pw","now-dns.top","ntdll.top","freeddns.us","crafting.xyz","zapto.xyz","nsupdate.info","nerdpol.ovh","blogsyte.com","brasilia.me","cable-modem.org","ciscofreak.com","collegefan.org","couchpotatofries.org","damnserver.com","ddns.me","ditchyourip.com","dnsfor.me","dnsiskinky.com","dvrcam.info","dynns.com","eating-organic.net","fantasyleague.cc","geekgalaxy.com","golffan.us","health-carereform.com","homesecuritymac.com","homesecuritypc.com","hopto.me","ilovecollege.info","loginto.me","mlbfan.org","mmafan.biz","myactivedirectory.com","mydissent.net","myeffect.net","mymediapc.net","mypsx.net","mysecuritycamera.com","mysecuritycamera.net","mysecuritycamera.org","net-freaks.com","nflfan.org","nhlfan.net","no-ip.ca","no-ip.co.uk","no-ip.net","noip.us","onthewifi.com","pgafan.net","point2this.com","pointto.us","privatizehealthinsurance.net","quicksytes.com","read-books.org","securitytactics.com","serveexchange.com","servehumour.com","servep2p.com","servesarcasm.com","stufftoread.com","ufcfan.org","unusualperson.com","workisboring.com","3utilities.com","bounceme.net","ddns.net","ddnsking.com","gotdns.ch","hopto.org","myftp.biz","myftp.org","myvnc.com","no-ip.biz","no-ip.info","no-ip.org","noip.me","redirectme.net","servebeer.com","serveblog.net","servecounterstrike.com","serveftp.com","servegame.com","servehalflife.com","servehttp.com","serveirc.com","serveminecraft.net","servemp3.com","servepics.com","servequake.com","sytes.net","webhop.me","zapto.org","stage.nodeart.io","nodum.co","nodum.io","pcloud.host","nyc.mn","nom.ae","nom.af","nom.ai","nom.al","nym.by","nym.bz","nom.cl","nom.gd","nom.ge","nom.gl","nym.gr","nom.gt","nym.gy","nom.hn","nym.ie","nom.im","nom.ke","nym.kz","nym.la","nym.lc","nom.li","nym.li","nym.lt","nym.lu","nym.me","nom.mk","nym.mn","nym.mx","nom.nu","nym.nz","nym.pe","nym.pt","nom.pw","nom.qa","nym.ro","nom.rs","nom.si","nym.sk","nom.st","nym.su","nym.sx","nom.tj","nym.tw","nom.ug","nom.uy","nom.vc","nom.vg","cya.gg","cloudycluster.net","nid.io","opencraft.hosting","operaunite.com","outsystemscloud.com","ownprovider.com","own.pm","ox.rs","oy.lc","pgfog.com","pagefrontapp.com","art.pl","gliwice.pl","krakow.pl","poznan.pl","wroc.pl","zakopane.pl","pantheonsite.io","gotpantheon.com","mypep.link","on-web.fr","*.platform.sh","*.platformsh.site","xen.prgmr.com","priv.at","protonet.io","chirurgiens-dentistes-en-france.fr","byen.site","ras.ru","qa2.com","dev-myqnapcloud.com","alpha-myqnapcloud.com","myqnapcloud.com","*.quipelements.com","vapor.cloud","vaporcloud.io","rackmaze.com","rackmaze.net","rhcloud.com","resindevice.io","devices.resinstaging.io","hzc.io","wellbeingzone.eu","ptplus.fit","wellbeingzone.co.uk","sandcats.io","logoip.de","logoip.com","schokokeks.net","scrysec.com","firewall-gateway.com","firewall-gateway.de","my-gateway.de","my-router.de","spdns.de","spdns.eu","firewall-gateway.net","my-firewall.org","myfirewall.org","spdns.org","*.s5y.io","*.sensiosite.cloud","biz.ua","co.ua","pp.ua","shiftedit.io","myshopblocks.com","1kapp.com","appchizi.com","applinzi.com","sinaapp.com","vipsinaapp.com","bounty-full.com","alpha.bounty-full.com","beta.bounty-full.com","static.land","dev.static.land","sites.static.land","apps.lair.io","*.stolos.io","spacekit.io","customer.speedpartner.de","storj.farm","utwente.io","temp-dns.com","diskstation.me","dscloud.biz","dscloud.me","dscloud.mobi","dsmynas.com","dsmynas.net","dsmynas.org","familyds.com","familyds.net","familyds.org","i234.me","myds.me","synology.me","vpnplus.to","taifun-dns.de","gda.pl","gdansk.pl","gdynia.pl","med.pl","sopot.pl","gwiddle.co.uk","cust.dev.thingdust.io","cust.disrec.thingdust.io","cust.prod.thingdust.io","cust.testing.thingdust.io","bloxcms.com","townnews-staging.com","12hp.at","2ix.at","4lima.at","lima-city.at","12hp.ch","2ix.ch","4lima.ch","lima-city.ch","trafficplex.cloud","de.cool","12hp.de","2ix.de","4lima.de","lima-city.de","1337.pictures","clan.rip","lima-city.rocks","webspace.rocks","lima.zone","*.transurl.be","*.transurl.eu","*.transurl.nl","tuxfamily.org","dd-dns.de","diskstation.eu","diskstation.org","dray-dns.de","draydns.de","dyn-vpn.de","dynvpn.de","mein-vigor.de","my-vigor.de","my-wan.de","syno-ds.de","synology-diskstation.de","synology-ds.de","uber.space","*.uberspace.de","hk.com","hk.org","ltd.hk","inc.hk","virtualuser.de","virtual-user.de","lib.de.us","2038.io","router.management","v-info.info","wedeploy.io","wedeploy.me","wedeploy.sh","remotewd.com","wmflabs.org","half.host","xnbay.com","u2.xnbay.com","u2-local.xnbay.com","cistron.nl","demon.nl","xs4all.space","official.academy","yolasite.com","ybo.faith","yombo.me","homelink.one","ybo.party","ybo.review","ybo.science","ybo.trade","nohost.me","noho.st","za.net","za.org","now.sh","zone.id"] \ No newline at end of file +[ +"ac", +"com.ac", +"edu.ac", +"gov.ac", +"net.ac", +"mil.ac", +"org.ac", +"ad", +"nom.ad", +"ae", +"co.ae", +"net.ae", +"org.ae", +"sch.ae", +"ac.ae", +"gov.ae", +"mil.ae", +"aero", +"accident-investigation.aero", +"accident-prevention.aero", +"aerobatic.aero", +"aeroclub.aero", +"aerodrome.aero", +"agents.aero", +"aircraft.aero", +"airline.aero", +"airport.aero", +"air-surveillance.aero", +"airtraffic.aero", +"air-traffic-control.aero", +"ambulance.aero", +"amusement.aero", +"association.aero", +"author.aero", +"ballooning.aero", +"broker.aero", +"caa.aero", +"cargo.aero", +"catering.aero", +"certification.aero", +"championship.aero", +"charter.aero", +"civilaviation.aero", +"club.aero", +"conference.aero", +"consultant.aero", +"consulting.aero", +"control.aero", +"council.aero", +"crew.aero", +"design.aero", +"dgca.aero", +"educator.aero", +"emergency.aero", +"engine.aero", +"engineer.aero", +"entertainment.aero", +"equipment.aero", +"exchange.aero", +"express.aero", +"federation.aero", +"flight.aero", +"freight.aero", +"fuel.aero", +"gliding.aero", +"government.aero", +"groundhandling.aero", +"group.aero", +"hanggliding.aero", +"homebuilt.aero", +"insurance.aero", +"journal.aero", +"journalist.aero", +"leasing.aero", +"logistics.aero", +"magazine.aero", +"maintenance.aero", +"media.aero", +"microlight.aero", +"modelling.aero", +"navigation.aero", +"parachuting.aero", +"paragliding.aero", +"passenger-association.aero", +"pilot.aero", +"press.aero", +"production.aero", +"recreation.aero", +"repbody.aero", +"res.aero", +"research.aero", +"rotorcraft.aero", +"safety.aero", +"scientist.aero", +"services.aero", +"show.aero", +"skydiving.aero", +"software.aero", +"student.aero", +"trader.aero", +"trading.aero", +"trainer.aero", +"union.aero", +"workinggroup.aero", +"works.aero", +"af", +"gov.af", +"com.af", +"org.af", +"net.af", +"edu.af", +"ag", +"com.ag", +"org.ag", +"net.ag", +"co.ag", +"nom.ag", +"ai", +"off.ai", +"com.ai", +"net.ai", +"org.ai", +"al", +"com.al", +"edu.al", +"gov.al", +"mil.al", +"net.al", +"org.al", +"am", +"co.am", +"com.am", +"commune.am", +"net.am", +"org.am", +"ao", +"ed.ao", +"gv.ao", +"og.ao", +"co.ao", +"pb.ao", +"it.ao", +"aq", +"ar", +"com.ar", +"edu.ar", +"gob.ar", +"gov.ar", +"int.ar", +"mil.ar", +"musica.ar", +"net.ar", +"org.ar", +"tur.ar", +"arpa", +"e164.arpa", +"in-addr.arpa", +"ip6.arpa", +"iris.arpa", +"uri.arpa", +"urn.arpa", +"as", +"gov.as", +"asia", +"at", +"ac.at", +"co.at", +"gv.at", +"or.at", +"au", +"com.au", +"net.au", +"org.au", +"edu.au", +"gov.au", +"asn.au", +"id.au", +"info.au", +"conf.au", +"oz.au", +"act.au", +"nsw.au", +"nt.au", +"qld.au", +"sa.au", +"tas.au", +"vic.au", +"wa.au", +"act.edu.au", +"catholic.edu.au", +"nsw.edu.au", +"nt.edu.au", +"qld.edu.au", +"sa.edu.au", +"tas.edu.au", +"vic.edu.au", +"wa.edu.au", +"qld.gov.au", +"sa.gov.au", +"tas.gov.au", +"vic.gov.au", +"wa.gov.au", +"education.tas.edu.au", +"schools.nsw.edu.au", +"aw", +"com.aw", +"ax", +"az", +"com.az", +"net.az", +"int.az", +"gov.az", +"org.az", +"edu.az", +"info.az", +"pp.az", +"mil.az", +"name.az", +"pro.az", +"biz.az", +"ba", +"com.ba", +"edu.ba", +"gov.ba", +"mil.ba", +"net.ba", +"org.ba", +"bb", +"biz.bb", +"co.bb", +"com.bb", +"edu.bb", +"gov.bb", +"info.bb", +"net.bb", +"org.bb", +"store.bb", +"tv.bb", +"*.bd", +"be", +"ac.be", +"bf", +"gov.bf", +"bg", +"a.bg", +"b.bg", +"c.bg", +"d.bg", +"e.bg", +"f.bg", +"g.bg", +"h.bg", +"i.bg", +"j.bg", +"k.bg", +"l.bg", +"m.bg", +"n.bg", +"o.bg", +"p.bg", +"q.bg", +"r.bg", +"s.bg", +"t.bg", +"u.bg", +"v.bg", +"w.bg", +"x.bg", +"y.bg", +"z.bg", +"0.bg", +"1.bg", +"2.bg", +"3.bg", +"4.bg", +"5.bg", +"6.bg", +"7.bg", +"8.bg", +"9.bg", +"bh", +"com.bh", +"edu.bh", +"net.bh", +"org.bh", +"gov.bh", +"bi", +"co.bi", +"com.bi", +"edu.bi", +"or.bi", +"org.bi", +"biz", +"bj", +"asso.bj", +"barreau.bj", +"gouv.bj", +"bm", +"com.bm", +"edu.bm", +"gov.bm", +"net.bm", +"org.bm", +"bn", +"com.bn", +"edu.bn", +"gov.bn", +"net.bn", +"org.bn", +"bo", +"com.bo", +"edu.bo", +"gob.bo", +"int.bo", +"org.bo", +"net.bo", +"mil.bo", +"tv.bo", +"web.bo", +"academia.bo", +"agro.bo", +"arte.bo", +"blog.bo", +"bolivia.bo", +"ciencia.bo", +"cooperativa.bo", +"democracia.bo", +"deporte.bo", +"ecologia.bo", +"economia.bo", +"empresa.bo", +"indigena.bo", +"industria.bo", +"info.bo", +"medicina.bo", +"movimiento.bo", +"musica.bo", +"natural.bo", +"nombre.bo", +"noticias.bo", +"patria.bo", +"politica.bo", +"profesional.bo", +"plurinacional.bo", +"pueblo.bo", +"revista.bo", +"salud.bo", +"tecnologia.bo", +"tksat.bo", +"transporte.bo", +"wiki.bo", +"br", +"9guacu.br", +"abc.br", +"adm.br", +"adv.br", +"agr.br", +"aju.br", +"am.br", +"anani.br", +"aparecida.br", +"arq.br", +"art.br", +"ato.br", +"b.br", +"barueri.br", +"belem.br", +"bhz.br", +"bio.br", +"blog.br", +"bmd.br", +"boavista.br", +"bsb.br", +"campinagrande.br", +"campinas.br", +"caxias.br", +"cim.br", +"cng.br", +"cnt.br", +"com.br", +"contagem.br", +"coop.br", +"cri.br", +"cuiaba.br", +"curitiba.br", +"def.br", +"ecn.br", +"eco.br", +"edu.br", +"emp.br", +"eng.br", +"esp.br", +"etc.br", +"eti.br", +"far.br", +"feira.br", +"flog.br", +"floripa.br", +"fm.br", +"fnd.br", +"fortal.br", +"fot.br", +"foz.br", +"fst.br", +"g12.br", +"ggf.br", +"goiania.br", +"gov.br", +"ac.gov.br", +"al.gov.br", +"am.gov.br", +"ap.gov.br", +"ba.gov.br", +"ce.gov.br", +"df.gov.br", +"es.gov.br", +"go.gov.br", +"ma.gov.br", +"mg.gov.br", +"ms.gov.br", +"mt.gov.br", +"pa.gov.br", +"pb.gov.br", +"pe.gov.br", +"pi.gov.br", +"pr.gov.br", +"rj.gov.br", +"rn.gov.br", +"ro.gov.br", +"rr.gov.br", +"rs.gov.br", +"sc.gov.br", +"se.gov.br", +"sp.gov.br", +"to.gov.br", +"gru.br", +"imb.br", +"ind.br", +"inf.br", +"jab.br", +"jampa.br", +"jdf.br", +"joinville.br", +"jor.br", +"jus.br", +"leg.br", +"lel.br", +"londrina.br", +"macapa.br", +"maceio.br", +"manaus.br", +"maringa.br", +"mat.br", +"med.br", +"mil.br", +"morena.br", +"mp.br", +"mus.br", +"natal.br", +"net.br", +"niteroi.br", +"*.nom.br", +"not.br", +"ntr.br", +"odo.br", +"ong.br", +"org.br", +"osasco.br", +"palmas.br", +"poa.br", +"ppg.br", +"pro.br", +"psc.br", +"psi.br", +"pvh.br", +"qsl.br", +"radio.br", +"rec.br", +"recife.br", +"ribeirao.br", +"rio.br", +"riobranco.br", +"riopreto.br", +"salvador.br", +"sampa.br", +"santamaria.br", +"santoandre.br", +"saobernardo.br", +"saogonca.br", +"sjc.br", +"slg.br", +"slz.br", +"sorocaba.br", +"srv.br", +"taxi.br", +"tc.br", +"teo.br", +"the.br", +"tmp.br", +"trd.br", +"tur.br", +"tv.br", +"udi.br", +"vet.br", +"vix.br", +"vlog.br", +"wiki.br", +"zlg.br", +"bs", +"com.bs", +"net.bs", +"org.bs", +"edu.bs", +"gov.bs", +"bt", +"com.bt", +"edu.bt", +"gov.bt", +"net.bt", +"org.bt", +"bv", +"bw", +"co.bw", +"org.bw", +"by", +"gov.by", +"mil.by", +"com.by", +"of.by", +"bz", +"com.bz", +"net.bz", +"org.bz", +"edu.bz", +"gov.bz", +"ca", +"ab.ca", +"bc.ca", +"mb.ca", +"nb.ca", +"nf.ca", +"nl.ca", +"ns.ca", +"nt.ca", +"nu.ca", +"on.ca", +"pe.ca", +"qc.ca", +"sk.ca", +"yk.ca", +"gc.ca", +"cat", +"cc", +"cd", +"gov.cd", +"cf", +"cg", +"ch", +"ci", +"org.ci", +"or.ci", +"com.ci", +"co.ci", +"edu.ci", +"ed.ci", +"ac.ci", +"net.ci", +"go.ci", +"asso.ci", +"aéroport.ci", +"int.ci", +"presse.ci", +"md.ci", +"gouv.ci", +"*.ck", +"!www.ck", +"cl", +"aprendemas.cl", +"co.cl", +"gob.cl", +"gov.cl", +"mil.cl", +"cm", +"co.cm", +"com.cm", +"gov.cm", +"net.cm", +"cn", +"ac.cn", +"com.cn", +"edu.cn", +"gov.cn", +"net.cn", +"org.cn", +"mil.cn", +"公司.cn", +"网络.cn", +"網絡.cn", +"ah.cn", +"bj.cn", +"cq.cn", +"fj.cn", +"gd.cn", +"gs.cn", +"gz.cn", +"gx.cn", +"ha.cn", +"hb.cn", +"he.cn", +"hi.cn", +"hl.cn", +"hn.cn", +"jl.cn", +"js.cn", +"jx.cn", +"ln.cn", +"nm.cn", +"nx.cn", +"qh.cn", +"sc.cn", +"sd.cn", +"sh.cn", +"sn.cn", +"sx.cn", +"tj.cn", +"xj.cn", +"xz.cn", +"yn.cn", +"zj.cn", +"hk.cn", +"mo.cn", +"tw.cn", +"co", +"arts.co", +"com.co", +"edu.co", +"firm.co", +"gov.co", +"info.co", +"int.co", +"mil.co", +"net.co", +"nom.co", +"org.co", +"rec.co", +"web.co", +"com", +"coop", +"cr", +"ac.cr", +"co.cr", +"ed.cr", +"fi.cr", +"go.cr", +"or.cr", +"sa.cr", +"cu", +"com.cu", +"edu.cu", +"org.cu", +"net.cu", +"gov.cu", +"inf.cu", +"cv", +"cw", +"com.cw", +"edu.cw", +"net.cw", +"org.cw", +"cx", +"gov.cx", +"cy", +"ac.cy", +"biz.cy", +"com.cy", +"ekloges.cy", +"gov.cy", +"ltd.cy", +"name.cy", +"net.cy", +"org.cy", +"parliament.cy", +"press.cy", +"pro.cy", +"tm.cy", +"cz", +"de", +"dj", +"dk", +"dm", +"com.dm", +"net.dm", +"org.dm", +"edu.dm", +"gov.dm", +"do", +"art.do", +"com.do", +"edu.do", +"gob.do", +"gov.do", +"mil.do", +"net.do", +"org.do", +"sld.do", +"web.do", +"dz", +"com.dz", +"org.dz", +"net.dz", +"gov.dz", +"edu.dz", +"asso.dz", +"pol.dz", +"art.dz", +"ec", +"com.ec", +"info.ec", +"net.ec", +"fin.ec", +"k12.ec", +"med.ec", +"pro.ec", +"org.ec", +"edu.ec", +"gov.ec", +"gob.ec", +"mil.ec", +"edu", +"ee", +"edu.ee", +"gov.ee", +"riik.ee", +"lib.ee", +"med.ee", +"com.ee", +"pri.ee", +"aip.ee", +"org.ee", +"fie.ee", +"eg", +"com.eg", +"edu.eg", +"eun.eg", +"gov.eg", +"mil.eg", +"name.eg", +"net.eg", +"org.eg", +"sci.eg", +"*.er", +"es", +"com.es", +"nom.es", +"org.es", +"gob.es", +"edu.es", +"et", +"com.et", +"gov.et", +"org.et", +"edu.et", +"biz.et", +"name.et", +"info.et", +"net.et", +"eu", +"fi", +"aland.fi", +"fj", +"ac.fj", +"biz.fj", +"com.fj", +"gov.fj", +"info.fj", +"mil.fj", +"name.fj", +"net.fj", +"org.fj", +"pro.fj", +"*.fk", +"fm", +"fo", +"fr", +"asso.fr", +"com.fr", +"gouv.fr", +"nom.fr", +"prd.fr", +"tm.fr", +"aeroport.fr", +"avocat.fr", +"avoues.fr", +"cci.fr", +"chambagri.fr", +"chirurgiens-dentistes.fr", +"experts-comptables.fr", +"geometre-expert.fr", +"greta.fr", +"huissier-justice.fr", +"medecin.fr", +"notaires.fr", +"pharmacien.fr", +"port.fr", +"veterinaire.fr", +"ga", +"gb", +"gd", +"ge", +"com.ge", +"edu.ge", +"gov.ge", +"org.ge", +"mil.ge", +"net.ge", +"pvt.ge", +"gf", +"gg", +"co.gg", +"net.gg", +"org.gg", +"gh", +"com.gh", +"edu.gh", +"gov.gh", +"org.gh", +"mil.gh", +"gi", +"com.gi", +"ltd.gi", +"gov.gi", +"mod.gi", +"edu.gi", +"org.gi", +"gl", +"co.gl", +"com.gl", +"edu.gl", +"net.gl", +"org.gl", +"gm", +"gn", +"ac.gn", +"com.gn", +"edu.gn", +"gov.gn", +"org.gn", +"net.gn", +"gov", +"gp", +"com.gp", +"net.gp", +"mobi.gp", +"edu.gp", +"org.gp", +"asso.gp", +"gq", +"gr", +"com.gr", +"edu.gr", +"net.gr", +"org.gr", +"gov.gr", +"gs", +"gt", +"com.gt", +"edu.gt", +"gob.gt", +"ind.gt", +"mil.gt", +"net.gt", +"org.gt", +"gu", +"com.gu", +"edu.gu", +"gov.gu", +"guam.gu", +"info.gu", +"net.gu", +"org.gu", +"web.gu", +"gw", +"gy", +"co.gy", +"com.gy", +"edu.gy", +"gov.gy", +"net.gy", +"org.gy", +"hk", +"com.hk", +"edu.hk", +"gov.hk", +"idv.hk", +"net.hk", +"org.hk", +"公司.hk", +"教育.hk", +"敎育.hk", +"政府.hk", +"個人.hk", +"个人.hk", +"箇人.hk", +"網络.hk", +"网络.hk", +"组織.hk", +"網絡.hk", +"网絡.hk", +"组织.hk", +"組織.hk", +"組织.hk", +"hm", +"hn", +"com.hn", +"edu.hn", +"org.hn", +"net.hn", +"mil.hn", +"gob.hn", +"hr", +"iz.hr", +"from.hr", +"name.hr", +"com.hr", +"ht", +"com.ht", +"shop.ht", +"firm.ht", +"info.ht", +"adult.ht", +"net.ht", +"pro.ht", +"org.ht", +"med.ht", +"art.ht", +"coop.ht", +"pol.ht", +"asso.ht", +"edu.ht", +"rel.ht", +"gouv.ht", +"perso.ht", +"hu", +"co.hu", +"info.hu", +"org.hu", +"priv.hu", +"sport.hu", +"tm.hu", +"2000.hu", +"agrar.hu", +"bolt.hu", +"casino.hu", +"city.hu", +"erotica.hu", +"erotika.hu", +"film.hu", +"forum.hu", +"games.hu", +"hotel.hu", +"ingatlan.hu", +"jogasz.hu", +"konyvelo.hu", +"lakas.hu", +"media.hu", +"news.hu", +"reklam.hu", +"sex.hu", +"shop.hu", +"suli.hu", +"szex.hu", +"tozsde.hu", +"utazas.hu", +"video.hu", +"id", +"ac.id", +"biz.id", +"co.id", +"desa.id", +"go.id", +"mil.id", +"my.id", +"net.id", +"or.id", +"ponpes.id", +"sch.id", +"web.id", +"ie", +"gov.ie", +"il", +"ac.il", +"co.il", +"gov.il", +"idf.il", +"k12.il", +"muni.il", +"net.il", +"org.il", +"im", +"ac.im", +"co.im", +"com.im", +"ltd.co.im", +"net.im", +"org.im", +"plc.co.im", +"tt.im", +"tv.im", +"in", +"co.in", +"firm.in", +"net.in", +"org.in", +"gen.in", +"ind.in", +"nic.in", +"ac.in", +"edu.in", +"res.in", +"gov.in", +"mil.in", +"info", +"int", +"eu.int", +"io", +"com.io", +"iq", +"gov.iq", +"edu.iq", +"mil.iq", +"com.iq", +"org.iq", +"net.iq", +"ir", +"ac.ir", +"co.ir", +"gov.ir", +"id.ir", +"net.ir", +"org.ir", +"sch.ir", +"ایران.ir", +"ايران.ir", +"is", +"net.is", +"com.is", +"edu.is", +"gov.is", +"org.is", +"int.is", +"it", +"gov.it", +"edu.it", +"abr.it", +"abruzzo.it", +"aosta-valley.it", +"aostavalley.it", +"bas.it", +"basilicata.it", +"cal.it", +"calabria.it", +"cam.it", +"campania.it", +"emilia-romagna.it", +"emiliaromagna.it", +"emr.it", +"friuli-v-giulia.it", +"friuli-ve-giulia.it", +"friuli-vegiulia.it", +"friuli-venezia-giulia.it", +"friuli-veneziagiulia.it", +"friuli-vgiulia.it", +"friuliv-giulia.it", +"friulive-giulia.it", +"friulivegiulia.it", +"friulivenezia-giulia.it", +"friuliveneziagiulia.it", +"friulivgiulia.it", +"fvg.it", +"laz.it", +"lazio.it", +"lig.it", +"liguria.it", +"lom.it", +"lombardia.it", +"lombardy.it", +"lucania.it", +"mar.it", +"marche.it", +"mol.it", +"molise.it", +"piedmont.it", +"piemonte.it", +"pmn.it", +"pug.it", +"puglia.it", +"sar.it", +"sardegna.it", +"sardinia.it", +"sic.it", +"sicilia.it", +"sicily.it", +"taa.it", +"tos.it", +"toscana.it", +"trentin-sud-tirol.it", +"trentin-süd-tirol.it", +"trentin-sudtirol.it", +"trentin-südtirol.it", +"trentin-sued-tirol.it", +"trentin-suedtirol.it", +"trentino-a-adige.it", +"trentino-aadige.it", +"trentino-alto-adige.it", +"trentino-altoadige.it", +"trentino-s-tirol.it", +"trentino-stirol.it", +"trentino-sud-tirol.it", +"trentino-süd-tirol.it", +"trentino-sudtirol.it", +"trentino-südtirol.it", +"trentino-sued-tirol.it", +"trentino-suedtirol.it", +"trentino.it", +"trentinoa-adige.it", +"trentinoaadige.it", +"trentinoalto-adige.it", +"trentinoaltoadige.it", +"trentinos-tirol.it", +"trentinostirol.it", +"trentinosud-tirol.it", +"trentinosüd-tirol.it", +"trentinosudtirol.it", +"trentinosüdtirol.it", +"trentinosued-tirol.it", +"trentinosuedtirol.it", +"trentinsud-tirol.it", +"trentinsüd-tirol.it", +"trentinsudtirol.it", +"trentinsüdtirol.it", +"trentinsued-tirol.it", +"trentinsuedtirol.it", +"tuscany.it", +"umb.it", +"umbria.it", +"val-d-aosta.it", +"val-daosta.it", +"vald-aosta.it", +"valdaosta.it", +"valle-aosta.it", +"valle-d-aosta.it", +"valle-daosta.it", +"valleaosta.it", +"valled-aosta.it", +"valledaosta.it", +"vallee-aoste.it", +"vallée-aoste.it", +"vallee-d-aoste.it", +"vallée-d-aoste.it", +"valleeaoste.it", +"valléeaoste.it", +"valleedaoste.it", +"valléedaoste.it", +"vao.it", +"vda.it", +"ven.it", +"veneto.it", +"ag.it", +"agrigento.it", +"al.it", +"alessandria.it", +"alto-adige.it", +"altoadige.it", +"an.it", +"ancona.it", +"andria-barletta-trani.it", +"andria-trani-barletta.it", +"andriabarlettatrani.it", +"andriatranibarletta.it", +"ao.it", +"aosta.it", +"aoste.it", +"ap.it", +"aq.it", +"aquila.it", +"ar.it", +"arezzo.it", +"ascoli-piceno.it", +"ascolipiceno.it", +"asti.it", +"at.it", +"av.it", +"avellino.it", +"ba.it", +"balsan-sudtirol.it", +"balsan-südtirol.it", +"balsan-suedtirol.it", +"balsan.it", +"bari.it", +"barletta-trani-andria.it", +"barlettatraniandria.it", +"belluno.it", +"benevento.it", +"bergamo.it", +"bg.it", +"bi.it", +"biella.it", +"bl.it", +"bn.it", +"bo.it", +"bologna.it", +"bolzano-altoadige.it", +"bolzano.it", +"bozen-sudtirol.it", +"bozen-südtirol.it", +"bozen-suedtirol.it", +"bozen.it", +"br.it", +"brescia.it", +"brindisi.it", +"bs.it", +"bt.it", +"bulsan-sudtirol.it", +"bulsan-südtirol.it", +"bulsan-suedtirol.it", +"bulsan.it", +"bz.it", +"ca.it", +"cagliari.it", +"caltanissetta.it", +"campidano-medio.it", +"campidanomedio.it", +"campobasso.it", +"carbonia-iglesias.it", +"carboniaiglesias.it", +"carrara-massa.it", +"carraramassa.it", +"caserta.it", +"catania.it", +"catanzaro.it", +"cb.it", +"ce.it", +"cesena-forli.it", +"cesena-forlì.it", +"cesenaforli.it", +"cesenaforlì.it", +"ch.it", +"chieti.it", +"ci.it", +"cl.it", +"cn.it", +"co.it", +"como.it", +"cosenza.it", +"cr.it", +"cremona.it", +"crotone.it", +"cs.it", +"ct.it", +"cuneo.it", +"cz.it", +"dell-ogliastra.it", +"dellogliastra.it", +"en.it", +"enna.it", +"fc.it", +"fe.it", +"fermo.it", +"ferrara.it", +"fg.it", +"fi.it", +"firenze.it", +"florence.it", +"fm.it", +"foggia.it", +"forli-cesena.it", +"forlì-cesena.it", +"forlicesena.it", +"forlìcesena.it", +"fr.it", +"frosinone.it", +"ge.it", +"genoa.it", +"genova.it", +"go.it", +"gorizia.it", +"gr.it", +"grosseto.it", +"iglesias-carbonia.it", +"iglesiascarbonia.it", +"im.it", +"imperia.it", +"is.it", +"isernia.it", +"kr.it", +"la-spezia.it", +"laquila.it", +"laspezia.it", +"latina.it", +"lc.it", +"le.it", +"lecce.it", +"lecco.it", +"li.it", +"livorno.it", +"lo.it", +"lodi.it", +"lt.it", +"lu.it", +"lucca.it", +"macerata.it", +"mantova.it", +"massa-carrara.it", +"massacarrara.it", +"matera.it", +"mb.it", +"mc.it", +"me.it", +"medio-campidano.it", +"mediocampidano.it", +"messina.it", +"mi.it", +"milan.it", +"milano.it", +"mn.it", +"mo.it", +"modena.it", +"monza-brianza.it", +"monza-e-della-brianza.it", +"monza.it", +"monzabrianza.it", +"monzaebrianza.it", +"monzaedellabrianza.it", +"ms.it", +"mt.it", +"na.it", +"naples.it", +"napoli.it", +"no.it", +"novara.it", +"nu.it", +"nuoro.it", +"og.it", +"ogliastra.it", +"olbia-tempio.it", +"olbiatempio.it", +"or.it", +"oristano.it", +"ot.it", +"pa.it", +"padova.it", +"padua.it", +"palermo.it", +"parma.it", +"pavia.it", +"pc.it", +"pd.it", +"pe.it", +"perugia.it", +"pesaro-urbino.it", +"pesarourbino.it", +"pescara.it", +"pg.it", +"pi.it", +"piacenza.it", +"pisa.it", +"pistoia.it", +"pn.it", +"po.it", +"pordenone.it", +"potenza.it", +"pr.it", +"prato.it", +"pt.it", +"pu.it", +"pv.it", +"pz.it", +"ra.it", +"ragusa.it", +"ravenna.it", +"rc.it", +"re.it", +"reggio-calabria.it", +"reggio-emilia.it", +"reggiocalabria.it", +"reggioemilia.it", +"rg.it", +"ri.it", +"rieti.it", +"rimini.it", +"rm.it", +"rn.it", +"ro.it", +"roma.it", +"rome.it", +"rovigo.it", +"sa.it", +"salerno.it", +"sassari.it", +"savona.it", +"si.it", +"siena.it", +"siracusa.it", +"so.it", +"sondrio.it", +"sp.it", +"sr.it", +"ss.it", +"suedtirol.it", +"südtirol.it", +"sv.it", +"ta.it", +"taranto.it", +"te.it", +"tempio-olbia.it", +"tempioolbia.it", +"teramo.it", +"terni.it", +"tn.it", +"to.it", +"torino.it", +"tp.it", +"tr.it", +"trani-andria-barletta.it", +"trani-barletta-andria.it", +"traniandriabarletta.it", +"tranibarlettaandria.it", +"trapani.it", +"trento.it", +"treviso.it", +"trieste.it", +"ts.it", +"turin.it", +"tv.it", +"ud.it", +"udine.it", +"urbino-pesaro.it", +"urbinopesaro.it", +"va.it", +"varese.it", +"vb.it", +"vc.it", +"ve.it", +"venezia.it", +"venice.it", +"verbania.it", +"vercelli.it", +"verona.it", +"vi.it", +"vibo-valentia.it", +"vibovalentia.it", +"vicenza.it", +"viterbo.it", +"vr.it", +"vs.it", +"vt.it", +"vv.it", +"je", +"co.je", +"net.je", +"org.je", +"*.jm", +"jo", +"com.jo", +"org.jo", +"net.jo", +"edu.jo", +"sch.jo", +"gov.jo", +"mil.jo", +"name.jo", +"jobs", +"jp", +"ac.jp", +"ad.jp", +"co.jp", +"ed.jp", +"go.jp", +"gr.jp", +"lg.jp", +"ne.jp", +"or.jp", +"aichi.jp", +"akita.jp", +"aomori.jp", +"chiba.jp", +"ehime.jp", +"fukui.jp", +"fukuoka.jp", +"fukushima.jp", +"gifu.jp", +"gunma.jp", +"hiroshima.jp", +"hokkaido.jp", +"hyogo.jp", +"ibaraki.jp", +"ishikawa.jp", +"iwate.jp", +"kagawa.jp", +"kagoshima.jp", +"kanagawa.jp", +"kochi.jp", +"kumamoto.jp", +"kyoto.jp", +"mie.jp", +"miyagi.jp", +"miyazaki.jp", +"nagano.jp", +"nagasaki.jp", +"nara.jp", +"niigata.jp", +"oita.jp", +"okayama.jp", +"okinawa.jp", +"osaka.jp", +"saga.jp", +"saitama.jp", +"shiga.jp", +"shimane.jp", +"shizuoka.jp", +"tochigi.jp", +"tokushima.jp", +"tokyo.jp", +"tottori.jp", +"toyama.jp", +"wakayama.jp", +"yamagata.jp", +"yamaguchi.jp", +"yamanashi.jp", +"栃木.jp", +"愛知.jp", +"愛媛.jp", +"兵庫.jp", +"熊本.jp", +"茨城.jp", +"北海道.jp", +"千葉.jp", +"和歌山.jp", +"長崎.jp", +"長野.jp", +"新潟.jp", +"青森.jp", +"静岡.jp", +"東京.jp", +"石川.jp", +"埼玉.jp", +"三重.jp", +"京都.jp", +"佐賀.jp", +"大分.jp", +"大阪.jp", +"奈良.jp", +"宮城.jp", +"宮崎.jp", +"富山.jp", +"山口.jp", +"山形.jp", +"山梨.jp", +"岩手.jp", +"岐阜.jp", +"岡山.jp", +"島根.jp", +"広島.jp", +"徳島.jp", +"沖縄.jp", +"滋賀.jp", +"神奈川.jp", +"福井.jp", +"福岡.jp", +"福島.jp", +"秋田.jp", +"群馬.jp", +"香川.jp", +"高知.jp", +"鳥取.jp", +"鹿児島.jp", +"*.kawasaki.jp", +"*.kitakyushu.jp", +"*.kobe.jp", +"*.nagoya.jp", +"*.sapporo.jp", +"*.sendai.jp", +"*.yokohama.jp", +"!city.kawasaki.jp", +"!city.kitakyushu.jp", +"!city.kobe.jp", +"!city.nagoya.jp", +"!city.sapporo.jp", +"!city.sendai.jp", +"!city.yokohama.jp", +"aisai.aichi.jp", +"ama.aichi.jp", +"anjo.aichi.jp", +"asuke.aichi.jp", +"chiryu.aichi.jp", +"chita.aichi.jp", +"fuso.aichi.jp", +"gamagori.aichi.jp", +"handa.aichi.jp", +"hazu.aichi.jp", +"hekinan.aichi.jp", +"higashiura.aichi.jp", +"ichinomiya.aichi.jp", +"inazawa.aichi.jp", +"inuyama.aichi.jp", +"isshiki.aichi.jp", +"iwakura.aichi.jp", +"kanie.aichi.jp", +"kariya.aichi.jp", +"kasugai.aichi.jp", +"kira.aichi.jp", +"kiyosu.aichi.jp", +"komaki.aichi.jp", +"konan.aichi.jp", +"kota.aichi.jp", +"mihama.aichi.jp", +"miyoshi.aichi.jp", +"nishio.aichi.jp", +"nisshin.aichi.jp", +"obu.aichi.jp", +"oguchi.aichi.jp", +"oharu.aichi.jp", +"okazaki.aichi.jp", +"owariasahi.aichi.jp", +"seto.aichi.jp", +"shikatsu.aichi.jp", +"shinshiro.aichi.jp", +"shitara.aichi.jp", +"tahara.aichi.jp", +"takahama.aichi.jp", +"tobishima.aichi.jp", +"toei.aichi.jp", +"togo.aichi.jp", +"tokai.aichi.jp", +"tokoname.aichi.jp", +"toyoake.aichi.jp", +"toyohashi.aichi.jp", +"toyokawa.aichi.jp", +"toyone.aichi.jp", +"toyota.aichi.jp", +"tsushima.aichi.jp", +"yatomi.aichi.jp", +"akita.akita.jp", +"daisen.akita.jp", +"fujisato.akita.jp", +"gojome.akita.jp", +"hachirogata.akita.jp", +"happou.akita.jp", +"higashinaruse.akita.jp", +"honjo.akita.jp", +"honjyo.akita.jp", +"ikawa.akita.jp", +"kamikoani.akita.jp", +"kamioka.akita.jp", +"katagami.akita.jp", +"kazuno.akita.jp", +"kitaakita.akita.jp", +"kosaka.akita.jp", +"kyowa.akita.jp", +"misato.akita.jp", +"mitane.akita.jp", +"moriyoshi.akita.jp", +"nikaho.akita.jp", +"noshiro.akita.jp", +"odate.akita.jp", +"oga.akita.jp", +"ogata.akita.jp", +"semboku.akita.jp", +"yokote.akita.jp", +"yurihonjo.akita.jp", +"aomori.aomori.jp", +"gonohe.aomori.jp", +"hachinohe.aomori.jp", +"hashikami.aomori.jp", +"hiranai.aomori.jp", +"hirosaki.aomori.jp", +"itayanagi.aomori.jp", +"kuroishi.aomori.jp", +"misawa.aomori.jp", +"mutsu.aomori.jp", +"nakadomari.aomori.jp", +"noheji.aomori.jp", +"oirase.aomori.jp", +"owani.aomori.jp", +"rokunohe.aomori.jp", +"sannohe.aomori.jp", +"shichinohe.aomori.jp", +"shingo.aomori.jp", +"takko.aomori.jp", +"towada.aomori.jp", +"tsugaru.aomori.jp", +"tsuruta.aomori.jp", +"abiko.chiba.jp", +"asahi.chiba.jp", +"chonan.chiba.jp", +"chosei.chiba.jp", +"choshi.chiba.jp", +"chuo.chiba.jp", +"funabashi.chiba.jp", +"futtsu.chiba.jp", +"hanamigawa.chiba.jp", +"ichihara.chiba.jp", +"ichikawa.chiba.jp", +"ichinomiya.chiba.jp", +"inzai.chiba.jp", +"isumi.chiba.jp", +"kamagaya.chiba.jp", +"kamogawa.chiba.jp", +"kashiwa.chiba.jp", +"katori.chiba.jp", +"katsuura.chiba.jp", +"kimitsu.chiba.jp", +"kisarazu.chiba.jp", +"kozaki.chiba.jp", +"kujukuri.chiba.jp", +"kyonan.chiba.jp", +"matsudo.chiba.jp", +"midori.chiba.jp", +"mihama.chiba.jp", +"minamiboso.chiba.jp", +"mobara.chiba.jp", +"mutsuzawa.chiba.jp", +"nagara.chiba.jp", +"nagareyama.chiba.jp", +"narashino.chiba.jp", +"narita.chiba.jp", +"noda.chiba.jp", +"oamishirasato.chiba.jp", +"omigawa.chiba.jp", +"onjuku.chiba.jp", +"otaki.chiba.jp", +"sakae.chiba.jp", +"sakura.chiba.jp", +"shimofusa.chiba.jp", +"shirako.chiba.jp", +"shiroi.chiba.jp", +"shisui.chiba.jp", +"sodegaura.chiba.jp", +"sosa.chiba.jp", +"tako.chiba.jp", +"tateyama.chiba.jp", +"togane.chiba.jp", +"tohnosho.chiba.jp", +"tomisato.chiba.jp", +"urayasu.chiba.jp", +"yachimata.chiba.jp", +"yachiyo.chiba.jp", +"yokaichiba.chiba.jp", +"yokoshibahikari.chiba.jp", +"yotsukaido.chiba.jp", +"ainan.ehime.jp", +"honai.ehime.jp", +"ikata.ehime.jp", +"imabari.ehime.jp", +"iyo.ehime.jp", +"kamijima.ehime.jp", +"kihoku.ehime.jp", +"kumakogen.ehime.jp", +"masaki.ehime.jp", +"matsuno.ehime.jp", +"matsuyama.ehime.jp", +"namikata.ehime.jp", +"niihama.ehime.jp", +"ozu.ehime.jp", +"saijo.ehime.jp", +"seiyo.ehime.jp", +"shikokuchuo.ehime.jp", +"tobe.ehime.jp", +"toon.ehime.jp", +"uchiko.ehime.jp", +"uwajima.ehime.jp", +"yawatahama.ehime.jp", +"echizen.fukui.jp", +"eiheiji.fukui.jp", +"fukui.fukui.jp", +"ikeda.fukui.jp", +"katsuyama.fukui.jp", +"mihama.fukui.jp", +"minamiechizen.fukui.jp", +"obama.fukui.jp", +"ohi.fukui.jp", +"ono.fukui.jp", +"sabae.fukui.jp", +"sakai.fukui.jp", +"takahama.fukui.jp", +"tsuruga.fukui.jp", +"wakasa.fukui.jp", +"ashiya.fukuoka.jp", +"buzen.fukuoka.jp", +"chikugo.fukuoka.jp", +"chikuho.fukuoka.jp", +"chikujo.fukuoka.jp", +"chikushino.fukuoka.jp", +"chikuzen.fukuoka.jp", +"chuo.fukuoka.jp", +"dazaifu.fukuoka.jp", +"fukuchi.fukuoka.jp", +"hakata.fukuoka.jp", +"higashi.fukuoka.jp", +"hirokawa.fukuoka.jp", +"hisayama.fukuoka.jp", +"iizuka.fukuoka.jp", +"inatsuki.fukuoka.jp", +"kaho.fukuoka.jp", +"kasuga.fukuoka.jp", +"kasuya.fukuoka.jp", +"kawara.fukuoka.jp", +"keisen.fukuoka.jp", +"koga.fukuoka.jp", +"kurate.fukuoka.jp", +"kurogi.fukuoka.jp", +"kurume.fukuoka.jp", +"minami.fukuoka.jp", +"miyako.fukuoka.jp", +"miyama.fukuoka.jp", +"miyawaka.fukuoka.jp", +"mizumaki.fukuoka.jp", +"munakata.fukuoka.jp", +"nakagawa.fukuoka.jp", +"nakama.fukuoka.jp", +"nishi.fukuoka.jp", +"nogata.fukuoka.jp", +"ogori.fukuoka.jp", +"okagaki.fukuoka.jp", +"okawa.fukuoka.jp", +"oki.fukuoka.jp", +"omuta.fukuoka.jp", +"onga.fukuoka.jp", +"onojo.fukuoka.jp", +"oto.fukuoka.jp", +"saigawa.fukuoka.jp", +"sasaguri.fukuoka.jp", +"shingu.fukuoka.jp", +"shinyoshitomi.fukuoka.jp", +"shonai.fukuoka.jp", +"soeda.fukuoka.jp", +"sue.fukuoka.jp", +"tachiarai.fukuoka.jp", +"tagawa.fukuoka.jp", +"takata.fukuoka.jp", +"toho.fukuoka.jp", +"toyotsu.fukuoka.jp", +"tsuiki.fukuoka.jp", +"ukiha.fukuoka.jp", +"umi.fukuoka.jp", +"usui.fukuoka.jp", +"yamada.fukuoka.jp", +"yame.fukuoka.jp", +"yanagawa.fukuoka.jp", +"yukuhashi.fukuoka.jp", +"aizubange.fukushima.jp", +"aizumisato.fukushima.jp", +"aizuwakamatsu.fukushima.jp", +"asakawa.fukushima.jp", +"bandai.fukushima.jp", +"date.fukushima.jp", +"fukushima.fukushima.jp", +"furudono.fukushima.jp", +"futaba.fukushima.jp", +"hanawa.fukushima.jp", +"higashi.fukushima.jp", +"hirata.fukushima.jp", +"hirono.fukushima.jp", +"iitate.fukushima.jp", +"inawashiro.fukushima.jp", +"ishikawa.fukushima.jp", +"iwaki.fukushima.jp", +"izumizaki.fukushima.jp", +"kagamiishi.fukushima.jp", +"kaneyama.fukushima.jp", +"kawamata.fukushima.jp", +"kitakata.fukushima.jp", +"kitashiobara.fukushima.jp", +"koori.fukushima.jp", +"koriyama.fukushima.jp", +"kunimi.fukushima.jp", +"miharu.fukushima.jp", +"mishima.fukushima.jp", +"namie.fukushima.jp", +"nango.fukushima.jp", +"nishiaizu.fukushima.jp", +"nishigo.fukushima.jp", +"okuma.fukushima.jp", +"omotego.fukushima.jp", +"ono.fukushima.jp", +"otama.fukushima.jp", +"samegawa.fukushima.jp", +"shimogo.fukushima.jp", +"shirakawa.fukushima.jp", +"showa.fukushima.jp", +"soma.fukushima.jp", +"sukagawa.fukushima.jp", +"taishin.fukushima.jp", +"tamakawa.fukushima.jp", +"tanagura.fukushima.jp", +"tenei.fukushima.jp", +"yabuki.fukushima.jp", +"yamato.fukushima.jp", +"yamatsuri.fukushima.jp", +"yanaizu.fukushima.jp", +"yugawa.fukushima.jp", +"anpachi.gifu.jp", +"ena.gifu.jp", +"gifu.gifu.jp", +"ginan.gifu.jp", +"godo.gifu.jp", +"gujo.gifu.jp", +"hashima.gifu.jp", +"hichiso.gifu.jp", +"hida.gifu.jp", +"higashishirakawa.gifu.jp", +"ibigawa.gifu.jp", +"ikeda.gifu.jp", +"kakamigahara.gifu.jp", +"kani.gifu.jp", +"kasahara.gifu.jp", +"kasamatsu.gifu.jp", +"kawaue.gifu.jp", +"kitagata.gifu.jp", +"mino.gifu.jp", +"minokamo.gifu.jp", +"mitake.gifu.jp", +"mizunami.gifu.jp", +"motosu.gifu.jp", +"nakatsugawa.gifu.jp", +"ogaki.gifu.jp", +"sakahogi.gifu.jp", +"seki.gifu.jp", +"sekigahara.gifu.jp", +"shirakawa.gifu.jp", +"tajimi.gifu.jp", +"takayama.gifu.jp", +"tarui.gifu.jp", +"toki.gifu.jp", +"tomika.gifu.jp", +"wanouchi.gifu.jp", +"yamagata.gifu.jp", +"yaotsu.gifu.jp", +"yoro.gifu.jp", +"annaka.gunma.jp", +"chiyoda.gunma.jp", +"fujioka.gunma.jp", +"higashiagatsuma.gunma.jp", +"isesaki.gunma.jp", +"itakura.gunma.jp", +"kanna.gunma.jp", +"kanra.gunma.jp", +"katashina.gunma.jp", +"kawaba.gunma.jp", +"kiryu.gunma.jp", +"kusatsu.gunma.jp", +"maebashi.gunma.jp", +"meiwa.gunma.jp", +"midori.gunma.jp", +"minakami.gunma.jp", +"naganohara.gunma.jp", +"nakanojo.gunma.jp", +"nanmoku.gunma.jp", +"numata.gunma.jp", +"oizumi.gunma.jp", +"ora.gunma.jp", +"ota.gunma.jp", +"shibukawa.gunma.jp", +"shimonita.gunma.jp", +"shinto.gunma.jp", +"showa.gunma.jp", +"takasaki.gunma.jp", +"takayama.gunma.jp", +"tamamura.gunma.jp", +"tatebayashi.gunma.jp", +"tomioka.gunma.jp", +"tsukiyono.gunma.jp", +"tsumagoi.gunma.jp", +"ueno.gunma.jp", +"yoshioka.gunma.jp", +"asaminami.hiroshima.jp", +"daiwa.hiroshima.jp", +"etajima.hiroshima.jp", +"fuchu.hiroshima.jp", +"fukuyama.hiroshima.jp", +"hatsukaichi.hiroshima.jp", +"higashihiroshima.hiroshima.jp", +"hongo.hiroshima.jp", +"jinsekikogen.hiroshima.jp", +"kaita.hiroshima.jp", +"kui.hiroshima.jp", +"kumano.hiroshima.jp", +"kure.hiroshima.jp", +"mihara.hiroshima.jp", +"miyoshi.hiroshima.jp", +"naka.hiroshima.jp", +"onomichi.hiroshima.jp", +"osakikamijima.hiroshima.jp", +"otake.hiroshima.jp", +"saka.hiroshima.jp", +"sera.hiroshima.jp", +"seranishi.hiroshima.jp", +"shinichi.hiroshima.jp", +"shobara.hiroshima.jp", +"takehara.hiroshima.jp", +"abashiri.hokkaido.jp", +"abira.hokkaido.jp", +"aibetsu.hokkaido.jp", +"akabira.hokkaido.jp", +"akkeshi.hokkaido.jp", +"asahikawa.hokkaido.jp", +"ashibetsu.hokkaido.jp", +"ashoro.hokkaido.jp", +"assabu.hokkaido.jp", +"atsuma.hokkaido.jp", +"bibai.hokkaido.jp", +"biei.hokkaido.jp", +"bifuka.hokkaido.jp", +"bihoro.hokkaido.jp", +"biratori.hokkaido.jp", +"chippubetsu.hokkaido.jp", +"chitose.hokkaido.jp", +"date.hokkaido.jp", +"ebetsu.hokkaido.jp", +"embetsu.hokkaido.jp", +"eniwa.hokkaido.jp", +"erimo.hokkaido.jp", +"esan.hokkaido.jp", +"esashi.hokkaido.jp", +"fukagawa.hokkaido.jp", +"fukushima.hokkaido.jp", +"furano.hokkaido.jp", +"furubira.hokkaido.jp", +"haboro.hokkaido.jp", +"hakodate.hokkaido.jp", +"hamatonbetsu.hokkaido.jp", +"hidaka.hokkaido.jp", +"higashikagura.hokkaido.jp", +"higashikawa.hokkaido.jp", +"hiroo.hokkaido.jp", +"hokuryu.hokkaido.jp", +"hokuto.hokkaido.jp", +"honbetsu.hokkaido.jp", +"horokanai.hokkaido.jp", +"horonobe.hokkaido.jp", +"ikeda.hokkaido.jp", +"imakane.hokkaido.jp", +"ishikari.hokkaido.jp", +"iwamizawa.hokkaido.jp", +"iwanai.hokkaido.jp", +"kamifurano.hokkaido.jp", +"kamikawa.hokkaido.jp", +"kamishihoro.hokkaido.jp", +"kamisunagawa.hokkaido.jp", +"kamoenai.hokkaido.jp", +"kayabe.hokkaido.jp", +"kembuchi.hokkaido.jp", +"kikonai.hokkaido.jp", +"kimobetsu.hokkaido.jp", +"kitahiroshima.hokkaido.jp", +"kitami.hokkaido.jp", +"kiyosato.hokkaido.jp", +"koshimizu.hokkaido.jp", +"kunneppu.hokkaido.jp", +"kuriyama.hokkaido.jp", +"kuromatsunai.hokkaido.jp", +"kushiro.hokkaido.jp", +"kutchan.hokkaido.jp", +"kyowa.hokkaido.jp", +"mashike.hokkaido.jp", +"matsumae.hokkaido.jp", +"mikasa.hokkaido.jp", +"minamifurano.hokkaido.jp", +"mombetsu.hokkaido.jp", +"moseushi.hokkaido.jp", +"mukawa.hokkaido.jp", +"muroran.hokkaido.jp", +"naie.hokkaido.jp", +"nakagawa.hokkaido.jp", +"nakasatsunai.hokkaido.jp", +"nakatombetsu.hokkaido.jp", +"nanae.hokkaido.jp", +"nanporo.hokkaido.jp", +"nayoro.hokkaido.jp", +"nemuro.hokkaido.jp", +"niikappu.hokkaido.jp", +"niki.hokkaido.jp", +"nishiokoppe.hokkaido.jp", +"noboribetsu.hokkaido.jp", +"numata.hokkaido.jp", +"obihiro.hokkaido.jp", +"obira.hokkaido.jp", +"oketo.hokkaido.jp", +"okoppe.hokkaido.jp", +"otaru.hokkaido.jp", +"otobe.hokkaido.jp", +"otofuke.hokkaido.jp", +"otoineppu.hokkaido.jp", +"oumu.hokkaido.jp", +"ozora.hokkaido.jp", +"pippu.hokkaido.jp", +"rankoshi.hokkaido.jp", +"rebun.hokkaido.jp", +"rikubetsu.hokkaido.jp", +"rishiri.hokkaido.jp", +"rishirifuji.hokkaido.jp", +"saroma.hokkaido.jp", +"sarufutsu.hokkaido.jp", +"shakotan.hokkaido.jp", +"shari.hokkaido.jp", +"shibecha.hokkaido.jp", +"shibetsu.hokkaido.jp", +"shikabe.hokkaido.jp", +"shikaoi.hokkaido.jp", +"shimamaki.hokkaido.jp", +"shimizu.hokkaido.jp", +"shimokawa.hokkaido.jp", +"shinshinotsu.hokkaido.jp", +"shintoku.hokkaido.jp", +"shiranuka.hokkaido.jp", +"shiraoi.hokkaido.jp", +"shiriuchi.hokkaido.jp", +"sobetsu.hokkaido.jp", +"sunagawa.hokkaido.jp", +"taiki.hokkaido.jp", +"takasu.hokkaido.jp", +"takikawa.hokkaido.jp", +"takinoue.hokkaido.jp", +"teshikaga.hokkaido.jp", +"tobetsu.hokkaido.jp", +"tohma.hokkaido.jp", +"tomakomai.hokkaido.jp", +"tomari.hokkaido.jp", +"toya.hokkaido.jp", +"toyako.hokkaido.jp", +"toyotomi.hokkaido.jp", +"toyoura.hokkaido.jp", +"tsubetsu.hokkaido.jp", +"tsukigata.hokkaido.jp", +"urakawa.hokkaido.jp", +"urausu.hokkaido.jp", +"uryu.hokkaido.jp", +"utashinai.hokkaido.jp", +"wakkanai.hokkaido.jp", +"wassamu.hokkaido.jp", +"yakumo.hokkaido.jp", +"yoichi.hokkaido.jp", +"aioi.hyogo.jp", +"akashi.hyogo.jp", +"ako.hyogo.jp", +"amagasaki.hyogo.jp", +"aogaki.hyogo.jp", +"asago.hyogo.jp", +"ashiya.hyogo.jp", +"awaji.hyogo.jp", +"fukusaki.hyogo.jp", +"goshiki.hyogo.jp", +"harima.hyogo.jp", +"himeji.hyogo.jp", +"ichikawa.hyogo.jp", +"inagawa.hyogo.jp", +"itami.hyogo.jp", +"kakogawa.hyogo.jp", +"kamigori.hyogo.jp", +"kamikawa.hyogo.jp", +"kasai.hyogo.jp", +"kasuga.hyogo.jp", +"kawanishi.hyogo.jp", +"miki.hyogo.jp", +"minamiawaji.hyogo.jp", +"nishinomiya.hyogo.jp", +"nishiwaki.hyogo.jp", +"ono.hyogo.jp", +"sanda.hyogo.jp", +"sannan.hyogo.jp", +"sasayama.hyogo.jp", +"sayo.hyogo.jp", +"shingu.hyogo.jp", +"shinonsen.hyogo.jp", +"shiso.hyogo.jp", +"sumoto.hyogo.jp", +"taishi.hyogo.jp", +"taka.hyogo.jp", +"takarazuka.hyogo.jp", +"takasago.hyogo.jp", +"takino.hyogo.jp", +"tamba.hyogo.jp", +"tatsuno.hyogo.jp", +"toyooka.hyogo.jp", +"yabu.hyogo.jp", +"yashiro.hyogo.jp", +"yoka.hyogo.jp", +"yokawa.hyogo.jp", +"ami.ibaraki.jp", +"asahi.ibaraki.jp", +"bando.ibaraki.jp", +"chikusei.ibaraki.jp", +"daigo.ibaraki.jp", +"fujishiro.ibaraki.jp", +"hitachi.ibaraki.jp", +"hitachinaka.ibaraki.jp", +"hitachiomiya.ibaraki.jp", +"hitachiota.ibaraki.jp", +"ibaraki.ibaraki.jp", +"ina.ibaraki.jp", +"inashiki.ibaraki.jp", +"itako.ibaraki.jp", +"iwama.ibaraki.jp", +"joso.ibaraki.jp", +"kamisu.ibaraki.jp", +"kasama.ibaraki.jp", +"kashima.ibaraki.jp", +"kasumigaura.ibaraki.jp", +"koga.ibaraki.jp", +"miho.ibaraki.jp", +"mito.ibaraki.jp", +"moriya.ibaraki.jp", +"naka.ibaraki.jp", +"namegata.ibaraki.jp", +"oarai.ibaraki.jp", +"ogawa.ibaraki.jp", +"omitama.ibaraki.jp", +"ryugasaki.ibaraki.jp", +"sakai.ibaraki.jp", +"sakuragawa.ibaraki.jp", +"shimodate.ibaraki.jp", +"shimotsuma.ibaraki.jp", +"shirosato.ibaraki.jp", +"sowa.ibaraki.jp", +"suifu.ibaraki.jp", +"takahagi.ibaraki.jp", +"tamatsukuri.ibaraki.jp", +"tokai.ibaraki.jp", +"tomobe.ibaraki.jp", +"tone.ibaraki.jp", +"toride.ibaraki.jp", +"tsuchiura.ibaraki.jp", +"tsukuba.ibaraki.jp", +"uchihara.ibaraki.jp", +"ushiku.ibaraki.jp", +"yachiyo.ibaraki.jp", +"yamagata.ibaraki.jp", +"yawara.ibaraki.jp", +"yuki.ibaraki.jp", +"anamizu.ishikawa.jp", +"hakui.ishikawa.jp", +"hakusan.ishikawa.jp", +"kaga.ishikawa.jp", +"kahoku.ishikawa.jp", +"kanazawa.ishikawa.jp", +"kawakita.ishikawa.jp", +"komatsu.ishikawa.jp", +"nakanoto.ishikawa.jp", +"nanao.ishikawa.jp", +"nomi.ishikawa.jp", +"nonoichi.ishikawa.jp", +"noto.ishikawa.jp", +"shika.ishikawa.jp", +"suzu.ishikawa.jp", +"tsubata.ishikawa.jp", +"tsurugi.ishikawa.jp", +"uchinada.ishikawa.jp", +"wajima.ishikawa.jp", +"fudai.iwate.jp", +"fujisawa.iwate.jp", +"hanamaki.iwate.jp", +"hiraizumi.iwate.jp", +"hirono.iwate.jp", +"ichinohe.iwate.jp", +"ichinoseki.iwate.jp", +"iwaizumi.iwate.jp", +"iwate.iwate.jp", +"joboji.iwate.jp", +"kamaishi.iwate.jp", +"kanegasaki.iwate.jp", +"karumai.iwate.jp", +"kawai.iwate.jp", +"kitakami.iwate.jp", +"kuji.iwate.jp", +"kunohe.iwate.jp", +"kuzumaki.iwate.jp", +"miyako.iwate.jp", +"mizusawa.iwate.jp", +"morioka.iwate.jp", +"ninohe.iwate.jp", +"noda.iwate.jp", +"ofunato.iwate.jp", +"oshu.iwate.jp", +"otsuchi.iwate.jp", +"rikuzentakata.iwate.jp", +"shiwa.iwate.jp", +"shizukuishi.iwate.jp", +"sumita.iwate.jp", +"tanohata.iwate.jp", +"tono.iwate.jp", +"yahaba.iwate.jp", +"yamada.iwate.jp", +"ayagawa.kagawa.jp", +"higashikagawa.kagawa.jp", +"kanonji.kagawa.jp", +"kotohira.kagawa.jp", +"manno.kagawa.jp", +"marugame.kagawa.jp", +"mitoyo.kagawa.jp", +"naoshima.kagawa.jp", +"sanuki.kagawa.jp", +"tadotsu.kagawa.jp", +"takamatsu.kagawa.jp", +"tonosho.kagawa.jp", +"uchinomi.kagawa.jp", +"utazu.kagawa.jp", +"zentsuji.kagawa.jp", +"akune.kagoshima.jp", +"amami.kagoshima.jp", +"hioki.kagoshima.jp", +"isa.kagoshima.jp", +"isen.kagoshima.jp", +"izumi.kagoshima.jp", +"kagoshima.kagoshima.jp", +"kanoya.kagoshima.jp", +"kawanabe.kagoshima.jp", +"kinko.kagoshima.jp", +"kouyama.kagoshima.jp", +"makurazaki.kagoshima.jp", +"matsumoto.kagoshima.jp", +"minamitane.kagoshima.jp", +"nakatane.kagoshima.jp", +"nishinoomote.kagoshima.jp", +"satsumasendai.kagoshima.jp", +"soo.kagoshima.jp", +"tarumizu.kagoshima.jp", +"yusui.kagoshima.jp", +"aikawa.kanagawa.jp", +"atsugi.kanagawa.jp", +"ayase.kanagawa.jp", +"chigasaki.kanagawa.jp", +"ebina.kanagawa.jp", +"fujisawa.kanagawa.jp", +"hadano.kanagawa.jp", +"hakone.kanagawa.jp", +"hiratsuka.kanagawa.jp", +"isehara.kanagawa.jp", +"kaisei.kanagawa.jp", +"kamakura.kanagawa.jp", +"kiyokawa.kanagawa.jp", +"matsuda.kanagawa.jp", +"minamiashigara.kanagawa.jp", +"miura.kanagawa.jp", +"nakai.kanagawa.jp", +"ninomiya.kanagawa.jp", +"odawara.kanagawa.jp", +"oi.kanagawa.jp", +"oiso.kanagawa.jp", +"sagamihara.kanagawa.jp", +"samukawa.kanagawa.jp", +"tsukui.kanagawa.jp", +"yamakita.kanagawa.jp", +"yamato.kanagawa.jp", +"yokosuka.kanagawa.jp", +"yugawara.kanagawa.jp", +"zama.kanagawa.jp", +"zushi.kanagawa.jp", +"aki.kochi.jp", +"geisei.kochi.jp", +"hidaka.kochi.jp", +"higashitsuno.kochi.jp", +"ino.kochi.jp", +"kagami.kochi.jp", +"kami.kochi.jp", +"kitagawa.kochi.jp", +"kochi.kochi.jp", +"mihara.kochi.jp", +"motoyama.kochi.jp", +"muroto.kochi.jp", +"nahari.kochi.jp", +"nakamura.kochi.jp", +"nankoku.kochi.jp", +"nishitosa.kochi.jp", +"niyodogawa.kochi.jp", +"ochi.kochi.jp", +"okawa.kochi.jp", +"otoyo.kochi.jp", +"otsuki.kochi.jp", +"sakawa.kochi.jp", +"sukumo.kochi.jp", +"susaki.kochi.jp", +"tosa.kochi.jp", +"tosashimizu.kochi.jp", +"toyo.kochi.jp", +"tsuno.kochi.jp", +"umaji.kochi.jp", +"yasuda.kochi.jp", +"yusuhara.kochi.jp", +"amakusa.kumamoto.jp", +"arao.kumamoto.jp", +"aso.kumamoto.jp", +"choyo.kumamoto.jp", +"gyokuto.kumamoto.jp", +"kamiamakusa.kumamoto.jp", +"kikuchi.kumamoto.jp", +"kumamoto.kumamoto.jp", +"mashiki.kumamoto.jp", +"mifune.kumamoto.jp", +"minamata.kumamoto.jp", +"minamioguni.kumamoto.jp", +"nagasu.kumamoto.jp", +"nishihara.kumamoto.jp", +"oguni.kumamoto.jp", +"ozu.kumamoto.jp", +"sumoto.kumamoto.jp", +"takamori.kumamoto.jp", +"uki.kumamoto.jp", +"uto.kumamoto.jp", +"yamaga.kumamoto.jp", +"yamato.kumamoto.jp", +"yatsushiro.kumamoto.jp", +"ayabe.kyoto.jp", +"fukuchiyama.kyoto.jp", +"higashiyama.kyoto.jp", +"ide.kyoto.jp", +"ine.kyoto.jp", +"joyo.kyoto.jp", +"kameoka.kyoto.jp", +"kamo.kyoto.jp", +"kita.kyoto.jp", +"kizu.kyoto.jp", +"kumiyama.kyoto.jp", +"kyotamba.kyoto.jp", +"kyotanabe.kyoto.jp", +"kyotango.kyoto.jp", +"maizuru.kyoto.jp", +"minami.kyoto.jp", +"minamiyamashiro.kyoto.jp", +"miyazu.kyoto.jp", +"muko.kyoto.jp", +"nagaokakyo.kyoto.jp", +"nakagyo.kyoto.jp", +"nantan.kyoto.jp", +"oyamazaki.kyoto.jp", +"sakyo.kyoto.jp", +"seika.kyoto.jp", +"tanabe.kyoto.jp", +"uji.kyoto.jp", +"ujitawara.kyoto.jp", +"wazuka.kyoto.jp", +"yamashina.kyoto.jp", +"yawata.kyoto.jp", +"asahi.mie.jp", +"inabe.mie.jp", +"ise.mie.jp", +"kameyama.mie.jp", +"kawagoe.mie.jp", +"kiho.mie.jp", +"kisosaki.mie.jp", +"kiwa.mie.jp", +"komono.mie.jp", +"kumano.mie.jp", +"kuwana.mie.jp", +"matsusaka.mie.jp", +"meiwa.mie.jp", +"mihama.mie.jp", +"minamiise.mie.jp", +"misugi.mie.jp", +"miyama.mie.jp", +"nabari.mie.jp", +"shima.mie.jp", +"suzuka.mie.jp", +"tado.mie.jp", +"taiki.mie.jp", +"taki.mie.jp", +"tamaki.mie.jp", +"toba.mie.jp", +"tsu.mie.jp", +"udono.mie.jp", +"ureshino.mie.jp", +"watarai.mie.jp", +"yokkaichi.mie.jp", +"furukawa.miyagi.jp", +"higashimatsushima.miyagi.jp", +"ishinomaki.miyagi.jp", +"iwanuma.miyagi.jp", +"kakuda.miyagi.jp", +"kami.miyagi.jp", +"kawasaki.miyagi.jp", +"marumori.miyagi.jp", +"matsushima.miyagi.jp", +"minamisanriku.miyagi.jp", +"misato.miyagi.jp", +"murata.miyagi.jp", +"natori.miyagi.jp", +"ogawara.miyagi.jp", +"ohira.miyagi.jp", +"onagawa.miyagi.jp", +"osaki.miyagi.jp", +"rifu.miyagi.jp", +"semine.miyagi.jp", +"shibata.miyagi.jp", +"shichikashuku.miyagi.jp", +"shikama.miyagi.jp", +"shiogama.miyagi.jp", +"shiroishi.miyagi.jp", +"tagajo.miyagi.jp", +"taiwa.miyagi.jp", +"tome.miyagi.jp", +"tomiya.miyagi.jp", +"wakuya.miyagi.jp", +"watari.miyagi.jp", +"yamamoto.miyagi.jp", +"zao.miyagi.jp", +"aya.miyazaki.jp", +"ebino.miyazaki.jp", +"gokase.miyazaki.jp", +"hyuga.miyazaki.jp", +"kadogawa.miyazaki.jp", +"kawaminami.miyazaki.jp", +"kijo.miyazaki.jp", +"kitagawa.miyazaki.jp", +"kitakata.miyazaki.jp", +"kitaura.miyazaki.jp", +"kobayashi.miyazaki.jp", +"kunitomi.miyazaki.jp", +"kushima.miyazaki.jp", +"mimata.miyazaki.jp", +"miyakonojo.miyazaki.jp", +"miyazaki.miyazaki.jp", +"morotsuka.miyazaki.jp", +"nichinan.miyazaki.jp", +"nishimera.miyazaki.jp", +"nobeoka.miyazaki.jp", +"saito.miyazaki.jp", +"shiiba.miyazaki.jp", +"shintomi.miyazaki.jp", +"takaharu.miyazaki.jp", +"takanabe.miyazaki.jp", +"takazaki.miyazaki.jp", +"tsuno.miyazaki.jp", +"achi.nagano.jp", +"agematsu.nagano.jp", +"anan.nagano.jp", +"aoki.nagano.jp", +"asahi.nagano.jp", +"azumino.nagano.jp", +"chikuhoku.nagano.jp", +"chikuma.nagano.jp", +"chino.nagano.jp", +"fujimi.nagano.jp", +"hakuba.nagano.jp", +"hara.nagano.jp", +"hiraya.nagano.jp", +"iida.nagano.jp", +"iijima.nagano.jp", +"iiyama.nagano.jp", +"iizuna.nagano.jp", +"ikeda.nagano.jp", +"ikusaka.nagano.jp", +"ina.nagano.jp", +"karuizawa.nagano.jp", +"kawakami.nagano.jp", +"kiso.nagano.jp", +"kisofukushima.nagano.jp", +"kitaaiki.nagano.jp", +"komagane.nagano.jp", +"komoro.nagano.jp", +"matsukawa.nagano.jp", +"matsumoto.nagano.jp", +"miasa.nagano.jp", +"minamiaiki.nagano.jp", +"minamimaki.nagano.jp", +"minamiminowa.nagano.jp", +"minowa.nagano.jp", +"miyada.nagano.jp", +"miyota.nagano.jp", +"mochizuki.nagano.jp", +"nagano.nagano.jp", +"nagawa.nagano.jp", +"nagiso.nagano.jp", +"nakagawa.nagano.jp", +"nakano.nagano.jp", +"nozawaonsen.nagano.jp", +"obuse.nagano.jp", +"ogawa.nagano.jp", +"okaya.nagano.jp", +"omachi.nagano.jp", +"omi.nagano.jp", +"ookuwa.nagano.jp", +"ooshika.nagano.jp", +"otaki.nagano.jp", +"otari.nagano.jp", +"sakae.nagano.jp", +"sakaki.nagano.jp", +"saku.nagano.jp", +"sakuho.nagano.jp", +"shimosuwa.nagano.jp", +"shinanomachi.nagano.jp", +"shiojiri.nagano.jp", +"suwa.nagano.jp", +"suzaka.nagano.jp", +"takagi.nagano.jp", +"takamori.nagano.jp", +"takayama.nagano.jp", +"tateshina.nagano.jp", +"tatsuno.nagano.jp", +"togakushi.nagano.jp", +"togura.nagano.jp", +"tomi.nagano.jp", +"ueda.nagano.jp", +"wada.nagano.jp", +"yamagata.nagano.jp", +"yamanouchi.nagano.jp", +"yasaka.nagano.jp", +"yasuoka.nagano.jp", +"chijiwa.nagasaki.jp", +"futsu.nagasaki.jp", +"goto.nagasaki.jp", +"hasami.nagasaki.jp", +"hirado.nagasaki.jp", +"iki.nagasaki.jp", +"isahaya.nagasaki.jp", +"kawatana.nagasaki.jp", +"kuchinotsu.nagasaki.jp", +"matsuura.nagasaki.jp", +"nagasaki.nagasaki.jp", +"obama.nagasaki.jp", +"omura.nagasaki.jp", +"oseto.nagasaki.jp", +"saikai.nagasaki.jp", +"sasebo.nagasaki.jp", +"seihi.nagasaki.jp", +"shimabara.nagasaki.jp", +"shinkamigoto.nagasaki.jp", +"togitsu.nagasaki.jp", +"tsushima.nagasaki.jp", +"unzen.nagasaki.jp", +"ando.nara.jp", +"gose.nara.jp", +"heguri.nara.jp", +"higashiyoshino.nara.jp", +"ikaruga.nara.jp", +"ikoma.nara.jp", +"kamikitayama.nara.jp", +"kanmaki.nara.jp", +"kashiba.nara.jp", +"kashihara.nara.jp", +"katsuragi.nara.jp", +"kawai.nara.jp", +"kawakami.nara.jp", +"kawanishi.nara.jp", +"koryo.nara.jp", +"kurotaki.nara.jp", +"mitsue.nara.jp", +"miyake.nara.jp", +"nara.nara.jp", +"nosegawa.nara.jp", +"oji.nara.jp", +"ouda.nara.jp", +"oyodo.nara.jp", +"sakurai.nara.jp", +"sango.nara.jp", +"shimoichi.nara.jp", +"shimokitayama.nara.jp", +"shinjo.nara.jp", +"soni.nara.jp", +"takatori.nara.jp", +"tawaramoto.nara.jp", +"tenkawa.nara.jp", +"tenri.nara.jp", +"uda.nara.jp", +"yamatokoriyama.nara.jp", +"yamatotakada.nara.jp", +"yamazoe.nara.jp", +"yoshino.nara.jp", +"aga.niigata.jp", +"agano.niigata.jp", +"gosen.niigata.jp", +"itoigawa.niigata.jp", +"izumozaki.niigata.jp", +"joetsu.niigata.jp", +"kamo.niigata.jp", +"kariwa.niigata.jp", +"kashiwazaki.niigata.jp", +"minamiuonuma.niigata.jp", +"mitsuke.niigata.jp", +"muika.niigata.jp", +"murakami.niigata.jp", +"myoko.niigata.jp", +"nagaoka.niigata.jp", +"niigata.niigata.jp", +"ojiya.niigata.jp", +"omi.niigata.jp", +"sado.niigata.jp", +"sanjo.niigata.jp", +"seiro.niigata.jp", +"seirou.niigata.jp", +"sekikawa.niigata.jp", +"shibata.niigata.jp", +"tagami.niigata.jp", +"tainai.niigata.jp", +"tochio.niigata.jp", +"tokamachi.niigata.jp", +"tsubame.niigata.jp", +"tsunan.niigata.jp", +"uonuma.niigata.jp", +"yahiko.niigata.jp", +"yoita.niigata.jp", +"yuzawa.niigata.jp", +"beppu.oita.jp", +"bungoono.oita.jp", +"bungotakada.oita.jp", +"hasama.oita.jp", +"hiji.oita.jp", +"himeshima.oita.jp", +"hita.oita.jp", +"kamitsue.oita.jp", +"kokonoe.oita.jp", +"kuju.oita.jp", +"kunisaki.oita.jp", +"kusu.oita.jp", +"oita.oita.jp", +"saiki.oita.jp", +"taketa.oita.jp", +"tsukumi.oita.jp", +"usa.oita.jp", +"usuki.oita.jp", +"yufu.oita.jp", +"akaiwa.okayama.jp", +"asakuchi.okayama.jp", +"bizen.okayama.jp", +"hayashima.okayama.jp", +"ibara.okayama.jp", +"kagamino.okayama.jp", +"kasaoka.okayama.jp", +"kibichuo.okayama.jp", +"kumenan.okayama.jp", +"kurashiki.okayama.jp", +"maniwa.okayama.jp", +"misaki.okayama.jp", +"nagi.okayama.jp", +"niimi.okayama.jp", +"nishiawakura.okayama.jp", +"okayama.okayama.jp", +"satosho.okayama.jp", +"setouchi.okayama.jp", +"shinjo.okayama.jp", +"shoo.okayama.jp", +"soja.okayama.jp", +"takahashi.okayama.jp", +"tamano.okayama.jp", +"tsuyama.okayama.jp", +"wake.okayama.jp", +"yakage.okayama.jp", +"aguni.okinawa.jp", +"ginowan.okinawa.jp", +"ginoza.okinawa.jp", +"gushikami.okinawa.jp", +"haebaru.okinawa.jp", +"higashi.okinawa.jp", +"hirara.okinawa.jp", +"iheya.okinawa.jp", +"ishigaki.okinawa.jp", +"ishikawa.okinawa.jp", +"itoman.okinawa.jp", +"izena.okinawa.jp", +"kadena.okinawa.jp", +"kin.okinawa.jp", +"kitadaito.okinawa.jp", +"kitanakagusuku.okinawa.jp", +"kumejima.okinawa.jp", +"kunigami.okinawa.jp", +"minamidaito.okinawa.jp", +"motobu.okinawa.jp", +"nago.okinawa.jp", +"naha.okinawa.jp", +"nakagusuku.okinawa.jp", +"nakijin.okinawa.jp", +"nanjo.okinawa.jp", +"nishihara.okinawa.jp", +"ogimi.okinawa.jp", +"okinawa.okinawa.jp", +"onna.okinawa.jp", +"shimoji.okinawa.jp", +"taketomi.okinawa.jp", +"tarama.okinawa.jp", +"tokashiki.okinawa.jp", +"tomigusuku.okinawa.jp", +"tonaki.okinawa.jp", +"urasoe.okinawa.jp", +"uruma.okinawa.jp", +"yaese.okinawa.jp", +"yomitan.okinawa.jp", +"yonabaru.okinawa.jp", +"yonaguni.okinawa.jp", +"zamami.okinawa.jp", +"abeno.osaka.jp", +"chihayaakasaka.osaka.jp", +"chuo.osaka.jp", +"daito.osaka.jp", +"fujiidera.osaka.jp", +"habikino.osaka.jp", +"hannan.osaka.jp", +"higashiosaka.osaka.jp", +"higashisumiyoshi.osaka.jp", +"higashiyodogawa.osaka.jp", +"hirakata.osaka.jp", +"ibaraki.osaka.jp", +"ikeda.osaka.jp", +"izumi.osaka.jp", +"izumiotsu.osaka.jp", +"izumisano.osaka.jp", +"kadoma.osaka.jp", +"kaizuka.osaka.jp", +"kanan.osaka.jp", +"kashiwara.osaka.jp", +"katano.osaka.jp", +"kawachinagano.osaka.jp", +"kishiwada.osaka.jp", +"kita.osaka.jp", +"kumatori.osaka.jp", +"matsubara.osaka.jp", +"minato.osaka.jp", +"minoh.osaka.jp", +"misaki.osaka.jp", +"moriguchi.osaka.jp", +"neyagawa.osaka.jp", +"nishi.osaka.jp", +"nose.osaka.jp", +"osakasayama.osaka.jp", +"sakai.osaka.jp", +"sayama.osaka.jp", +"sennan.osaka.jp", +"settsu.osaka.jp", +"shijonawate.osaka.jp", +"shimamoto.osaka.jp", +"suita.osaka.jp", +"tadaoka.osaka.jp", +"taishi.osaka.jp", +"tajiri.osaka.jp", +"takaishi.osaka.jp", +"takatsuki.osaka.jp", +"tondabayashi.osaka.jp", +"toyonaka.osaka.jp", +"toyono.osaka.jp", +"yao.osaka.jp", +"ariake.saga.jp", +"arita.saga.jp", +"fukudomi.saga.jp", +"genkai.saga.jp", +"hamatama.saga.jp", +"hizen.saga.jp", +"imari.saga.jp", +"kamimine.saga.jp", +"kanzaki.saga.jp", +"karatsu.saga.jp", +"kashima.saga.jp", +"kitagata.saga.jp", +"kitahata.saga.jp", +"kiyama.saga.jp", +"kouhoku.saga.jp", +"kyuragi.saga.jp", +"nishiarita.saga.jp", +"ogi.saga.jp", +"omachi.saga.jp", +"ouchi.saga.jp", +"saga.saga.jp", +"shiroishi.saga.jp", +"taku.saga.jp", +"tara.saga.jp", +"tosu.saga.jp", +"yoshinogari.saga.jp", +"arakawa.saitama.jp", +"asaka.saitama.jp", +"chichibu.saitama.jp", +"fujimi.saitama.jp", +"fujimino.saitama.jp", +"fukaya.saitama.jp", +"hanno.saitama.jp", +"hanyu.saitama.jp", +"hasuda.saitama.jp", +"hatogaya.saitama.jp", +"hatoyama.saitama.jp", +"hidaka.saitama.jp", +"higashichichibu.saitama.jp", +"higashimatsuyama.saitama.jp", +"honjo.saitama.jp", +"ina.saitama.jp", +"iruma.saitama.jp", +"iwatsuki.saitama.jp", +"kamiizumi.saitama.jp", +"kamikawa.saitama.jp", +"kamisato.saitama.jp", +"kasukabe.saitama.jp", +"kawagoe.saitama.jp", +"kawaguchi.saitama.jp", +"kawajima.saitama.jp", +"kazo.saitama.jp", +"kitamoto.saitama.jp", +"koshigaya.saitama.jp", +"kounosu.saitama.jp", +"kuki.saitama.jp", +"kumagaya.saitama.jp", +"matsubushi.saitama.jp", +"minano.saitama.jp", +"misato.saitama.jp", +"miyashiro.saitama.jp", +"miyoshi.saitama.jp", +"moroyama.saitama.jp", +"nagatoro.saitama.jp", +"namegawa.saitama.jp", +"niiza.saitama.jp", +"ogano.saitama.jp", +"ogawa.saitama.jp", +"ogose.saitama.jp", +"okegawa.saitama.jp", +"omiya.saitama.jp", +"otaki.saitama.jp", +"ranzan.saitama.jp", +"ryokami.saitama.jp", +"saitama.saitama.jp", +"sakado.saitama.jp", +"satte.saitama.jp", +"sayama.saitama.jp", +"shiki.saitama.jp", +"shiraoka.saitama.jp", +"soka.saitama.jp", +"sugito.saitama.jp", +"toda.saitama.jp", +"tokigawa.saitama.jp", +"tokorozawa.saitama.jp", +"tsurugashima.saitama.jp", +"urawa.saitama.jp", +"warabi.saitama.jp", +"yashio.saitama.jp", +"yokoze.saitama.jp", +"yono.saitama.jp", +"yorii.saitama.jp", +"yoshida.saitama.jp", +"yoshikawa.saitama.jp", +"yoshimi.saitama.jp", +"aisho.shiga.jp", +"gamo.shiga.jp", +"higashiomi.shiga.jp", +"hikone.shiga.jp", +"koka.shiga.jp", +"konan.shiga.jp", +"kosei.shiga.jp", +"koto.shiga.jp", +"kusatsu.shiga.jp", +"maibara.shiga.jp", +"moriyama.shiga.jp", +"nagahama.shiga.jp", +"nishiazai.shiga.jp", +"notogawa.shiga.jp", +"omihachiman.shiga.jp", +"otsu.shiga.jp", +"ritto.shiga.jp", +"ryuoh.shiga.jp", +"takashima.shiga.jp", +"takatsuki.shiga.jp", +"torahime.shiga.jp", +"toyosato.shiga.jp", +"yasu.shiga.jp", +"akagi.shimane.jp", +"ama.shimane.jp", +"gotsu.shimane.jp", +"hamada.shimane.jp", +"higashiizumo.shimane.jp", +"hikawa.shimane.jp", +"hikimi.shimane.jp", +"izumo.shimane.jp", +"kakinoki.shimane.jp", +"masuda.shimane.jp", +"matsue.shimane.jp", +"misato.shimane.jp", +"nishinoshima.shimane.jp", +"ohda.shimane.jp", +"okinoshima.shimane.jp", +"okuizumo.shimane.jp", +"shimane.shimane.jp", +"tamayu.shimane.jp", +"tsuwano.shimane.jp", +"unnan.shimane.jp", +"yakumo.shimane.jp", +"yasugi.shimane.jp", +"yatsuka.shimane.jp", +"arai.shizuoka.jp", +"atami.shizuoka.jp", +"fuji.shizuoka.jp", +"fujieda.shizuoka.jp", +"fujikawa.shizuoka.jp", +"fujinomiya.shizuoka.jp", +"fukuroi.shizuoka.jp", +"gotemba.shizuoka.jp", +"haibara.shizuoka.jp", +"hamamatsu.shizuoka.jp", +"higashiizu.shizuoka.jp", +"ito.shizuoka.jp", +"iwata.shizuoka.jp", +"izu.shizuoka.jp", +"izunokuni.shizuoka.jp", +"kakegawa.shizuoka.jp", +"kannami.shizuoka.jp", +"kawanehon.shizuoka.jp", +"kawazu.shizuoka.jp", +"kikugawa.shizuoka.jp", +"kosai.shizuoka.jp", +"makinohara.shizuoka.jp", +"matsuzaki.shizuoka.jp", +"minamiizu.shizuoka.jp", +"mishima.shizuoka.jp", +"morimachi.shizuoka.jp", +"nishiizu.shizuoka.jp", +"numazu.shizuoka.jp", +"omaezaki.shizuoka.jp", +"shimada.shizuoka.jp", +"shimizu.shizuoka.jp", +"shimoda.shizuoka.jp", +"shizuoka.shizuoka.jp", +"susono.shizuoka.jp", +"yaizu.shizuoka.jp", +"yoshida.shizuoka.jp", +"ashikaga.tochigi.jp", +"bato.tochigi.jp", +"haga.tochigi.jp", +"ichikai.tochigi.jp", +"iwafune.tochigi.jp", +"kaminokawa.tochigi.jp", +"kanuma.tochigi.jp", +"karasuyama.tochigi.jp", +"kuroiso.tochigi.jp", +"mashiko.tochigi.jp", +"mibu.tochigi.jp", +"moka.tochigi.jp", +"motegi.tochigi.jp", +"nasu.tochigi.jp", +"nasushiobara.tochigi.jp", +"nikko.tochigi.jp", +"nishikata.tochigi.jp", +"nogi.tochigi.jp", +"ohira.tochigi.jp", +"ohtawara.tochigi.jp", +"oyama.tochigi.jp", +"sakura.tochigi.jp", +"sano.tochigi.jp", +"shimotsuke.tochigi.jp", +"shioya.tochigi.jp", +"takanezawa.tochigi.jp", +"tochigi.tochigi.jp", +"tsuga.tochigi.jp", +"ujiie.tochigi.jp", +"utsunomiya.tochigi.jp", +"yaita.tochigi.jp", +"aizumi.tokushima.jp", +"anan.tokushima.jp", +"ichiba.tokushima.jp", +"itano.tokushima.jp", +"kainan.tokushima.jp", +"komatsushima.tokushima.jp", +"matsushige.tokushima.jp", +"mima.tokushima.jp", +"minami.tokushima.jp", +"miyoshi.tokushima.jp", +"mugi.tokushima.jp", +"nakagawa.tokushima.jp", +"naruto.tokushima.jp", +"sanagochi.tokushima.jp", +"shishikui.tokushima.jp", +"tokushima.tokushima.jp", +"wajiki.tokushima.jp", +"adachi.tokyo.jp", +"akiruno.tokyo.jp", +"akishima.tokyo.jp", +"aogashima.tokyo.jp", +"arakawa.tokyo.jp", +"bunkyo.tokyo.jp", +"chiyoda.tokyo.jp", +"chofu.tokyo.jp", +"chuo.tokyo.jp", +"edogawa.tokyo.jp", +"fuchu.tokyo.jp", +"fussa.tokyo.jp", +"hachijo.tokyo.jp", +"hachioji.tokyo.jp", +"hamura.tokyo.jp", +"higashikurume.tokyo.jp", +"higashimurayama.tokyo.jp", +"higashiyamato.tokyo.jp", +"hino.tokyo.jp", +"hinode.tokyo.jp", +"hinohara.tokyo.jp", +"inagi.tokyo.jp", +"itabashi.tokyo.jp", +"katsushika.tokyo.jp", +"kita.tokyo.jp", +"kiyose.tokyo.jp", +"kodaira.tokyo.jp", +"koganei.tokyo.jp", +"kokubunji.tokyo.jp", +"komae.tokyo.jp", +"koto.tokyo.jp", +"kouzushima.tokyo.jp", +"kunitachi.tokyo.jp", +"machida.tokyo.jp", +"meguro.tokyo.jp", +"minato.tokyo.jp", +"mitaka.tokyo.jp", +"mizuho.tokyo.jp", +"musashimurayama.tokyo.jp", +"musashino.tokyo.jp", +"nakano.tokyo.jp", +"nerima.tokyo.jp", +"ogasawara.tokyo.jp", +"okutama.tokyo.jp", +"ome.tokyo.jp", +"oshima.tokyo.jp", +"ota.tokyo.jp", +"setagaya.tokyo.jp", +"shibuya.tokyo.jp", +"shinagawa.tokyo.jp", +"shinjuku.tokyo.jp", +"suginami.tokyo.jp", +"sumida.tokyo.jp", +"tachikawa.tokyo.jp", +"taito.tokyo.jp", +"tama.tokyo.jp", +"toshima.tokyo.jp", +"chizu.tottori.jp", +"hino.tottori.jp", +"kawahara.tottori.jp", +"koge.tottori.jp", +"kotoura.tottori.jp", +"misasa.tottori.jp", +"nanbu.tottori.jp", +"nichinan.tottori.jp", +"sakaiminato.tottori.jp", +"tottori.tottori.jp", +"wakasa.tottori.jp", +"yazu.tottori.jp", +"yonago.tottori.jp", +"asahi.toyama.jp", +"fuchu.toyama.jp", +"fukumitsu.toyama.jp", +"funahashi.toyama.jp", +"himi.toyama.jp", +"imizu.toyama.jp", +"inami.toyama.jp", +"johana.toyama.jp", +"kamiichi.toyama.jp", +"kurobe.toyama.jp", +"nakaniikawa.toyama.jp", +"namerikawa.toyama.jp", +"nanto.toyama.jp", +"nyuzen.toyama.jp", +"oyabe.toyama.jp", +"taira.toyama.jp", +"takaoka.toyama.jp", +"tateyama.toyama.jp", +"toga.toyama.jp", +"tonami.toyama.jp", +"toyama.toyama.jp", +"unazuki.toyama.jp", +"uozu.toyama.jp", +"yamada.toyama.jp", +"arida.wakayama.jp", +"aridagawa.wakayama.jp", +"gobo.wakayama.jp", +"hashimoto.wakayama.jp", +"hidaka.wakayama.jp", +"hirogawa.wakayama.jp", +"inami.wakayama.jp", +"iwade.wakayama.jp", +"kainan.wakayama.jp", +"kamitonda.wakayama.jp", +"katsuragi.wakayama.jp", +"kimino.wakayama.jp", +"kinokawa.wakayama.jp", +"kitayama.wakayama.jp", +"koya.wakayama.jp", +"koza.wakayama.jp", +"kozagawa.wakayama.jp", +"kudoyama.wakayama.jp", +"kushimoto.wakayama.jp", +"mihama.wakayama.jp", +"misato.wakayama.jp", +"nachikatsuura.wakayama.jp", +"shingu.wakayama.jp", +"shirahama.wakayama.jp", +"taiji.wakayama.jp", +"tanabe.wakayama.jp", +"wakayama.wakayama.jp", +"yuasa.wakayama.jp", +"yura.wakayama.jp", +"asahi.yamagata.jp", +"funagata.yamagata.jp", +"higashine.yamagata.jp", +"iide.yamagata.jp", +"kahoku.yamagata.jp", +"kaminoyama.yamagata.jp", +"kaneyama.yamagata.jp", +"kawanishi.yamagata.jp", +"mamurogawa.yamagata.jp", +"mikawa.yamagata.jp", +"murayama.yamagata.jp", +"nagai.yamagata.jp", +"nakayama.yamagata.jp", +"nanyo.yamagata.jp", +"nishikawa.yamagata.jp", +"obanazawa.yamagata.jp", +"oe.yamagata.jp", +"oguni.yamagata.jp", +"ohkura.yamagata.jp", +"oishida.yamagata.jp", +"sagae.yamagata.jp", +"sakata.yamagata.jp", +"sakegawa.yamagata.jp", +"shinjo.yamagata.jp", +"shirataka.yamagata.jp", +"shonai.yamagata.jp", +"takahata.yamagata.jp", +"tendo.yamagata.jp", +"tozawa.yamagata.jp", +"tsuruoka.yamagata.jp", +"yamagata.yamagata.jp", +"yamanobe.yamagata.jp", +"yonezawa.yamagata.jp", +"yuza.yamagata.jp", +"abu.yamaguchi.jp", +"hagi.yamaguchi.jp", +"hikari.yamaguchi.jp", +"hofu.yamaguchi.jp", +"iwakuni.yamaguchi.jp", +"kudamatsu.yamaguchi.jp", +"mitou.yamaguchi.jp", +"nagato.yamaguchi.jp", +"oshima.yamaguchi.jp", +"shimonoseki.yamaguchi.jp", +"shunan.yamaguchi.jp", +"tabuse.yamaguchi.jp", +"tokuyama.yamaguchi.jp", +"toyota.yamaguchi.jp", +"ube.yamaguchi.jp", +"yuu.yamaguchi.jp", +"chuo.yamanashi.jp", +"doshi.yamanashi.jp", +"fuefuki.yamanashi.jp", +"fujikawa.yamanashi.jp", +"fujikawaguchiko.yamanashi.jp", +"fujiyoshida.yamanashi.jp", +"hayakawa.yamanashi.jp", +"hokuto.yamanashi.jp", +"ichikawamisato.yamanashi.jp", +"kai.yamanashi.jp", +"kofu.yamanashi.jp", +"koshu.yamanashi.jp", +"kosuge.yamanashi.jp", +"minami-alps.yamanashi.jp", +"minobu.yamanashi.jp", +"nakamichi.yamanashi.jp", +"nanbu.yamanashi.jp", +"narusawa.yamanashi.jp", +"nirasaki.yamanashi.jp", +"nishikatsura.yamanashi.jp", +"oshino.yamanashi.jp", +"otsuki.yamanashi.jp", +"showa.yamanashi.jp", +"tabayama.yamanashi.jp", +"tsuru.yamanashi.jp", +"uenohara.yamanashi.jp", +"yamanakako.yamanashi.jp", +"yamanashi.yamanashi.jp", +"ke", +"ac.ke", +"co.ke", +"go.ke", +"info.ke", +"me.ke", +"mobi.ke", +"ne.ke", +"or.ke", +"sc.ke", +"kg", +"org.kg", +"net.kg", +"com.kg", +"edu.kg", +"gov.kg", +"mil.kg", +"*.kh", +"ki", +"edu.ki", +"biz.ki", +"net.ki", +"org.ki", +"gov.ki", +"info.ki", +"com.ki", +"km", +"org.km", +"nom.km", +"gov.km", +"prd.km", +"tm.km", +"edu.km", +"mil.km", +"ass.km", +"com.km", +"coop.km", +"asso.km", +"presse.km", +"medecin.km", +"notaires.km", +"pharmaciens.km", +"veterinaire.km", +"gouv.km", +"kn", +"net.kn", +"org.kn", +"edu.kn", +"gov.kn", +"kp", +"com.kp", +"edu.kp", +"gov.kp", +"org.kp", +"rep.kp", +"tra.kp", +"kr", +"ac.kr", +"co.kr", +"es.kr", +"go.kr", +"hs.kr", +"kg.kr", +"mil.kr", +"ms.kr", +"ne.kr", +"or.kr", +"pe.kr", +"re.kr", +"sc.kr", +"busan.kr", +"chungbuk.kr", +"chungnam.kr", +"daegu.kr", +"daejeon.kr", +"gangwon.kr", +"gwangju.kr", +"gyeongbuk.kr", +"gyeonggi.kr", +"gyeongnam.kr", +"incheon.kr", +"jeju.kr", +"jeonbuk.kr", +"jeonnam.kr", +"seoul.kr", +"ulsan.kr", +"kw", +"com.kw", +"edu.kw", +"emb.kw", +"gov.kw", +"ind.kw", +"net.kw", +"org.kw", +"ky", +"edu.ky", +"gov.ky", +"com.ky", +"org.ky", +"net.ky", +"kz", +"org.kz", +"edu.kz", +"net.kz", +"gov.kz", +"mil.kz", +"com.kz", +"la", +"int.la", +"net.la", +"info.la", +"edu.la", +"gov.la", +"per.la", +"com.la", +"org.la", +"lb", +"com.lb", +"edu.lb", +"gov.lb", +"net.lb", +"org.lb", +"lc", +"com.lc", +"net.lc", +"co.lc", +"org.lc", +"edu.lc", +"gov.lc", +"li", +"lk", +"gov.lk", +"sch.lk", +"net.lk", +"int.lk", +"com.lk", +"org.lk", +"edu.lk", +"ngo.lk", +"soc.lk", +"web.lk", +"ltd.lk", +"assn.lk", +"grp.lk", +"hotel.lk", +"ac.lk", +"lr", +"com.lr", +"edu.lr", +"gov.lr", +"org.lr", +"net.lr", +"ls", +"ac.ls", +"biz.ls", +"co.ls", +"edu.ls", +"gov.ls", +"info.ls", +"net.ls", +"org.ls", +"sc.ls", +"lt", +"gov.lt", +"lu", +"lv", +"com.lv", +"edu.lv", +"gov.lv", +"org.lv", +"mil.lv", +"id.lv", +"net.lv", +"asn.lv", +"conf.lv", +"ly", +"com.ly", +"net.ly", +"gov.ly", +"plc.ly", +"edu.ly", +"sch.ly", +"med.ly", +"org.ly", +"id.ly", +"ma", +"co.ma", +"net.ma", +"gov.ma", +"org.ma", +"ac.ma", +"press.ma", +"mc", +"tm.mc", +"asso.mc", +"md", +"me", +"co.me", +"net.me", +"org.me", +"edu.me", +"ac.me", +"gov.me", +"its.me", +"priv.me", +"mg", +"org.mg", +"nom.mg", +"gov.mg", +"prd.mg", +"tm.mg", +"edu.mg", +"mil.mg", +"com.mg", +"co.mg", +"mh", +"mil", +"mk", +"com.mk", +"org.mk", +"net.mk", +"edu.mk", +"gov.mk", +"inf.mk", +"name.mk", +"ml", +"com.ml", +"edu.ml", +"gouv.ml", +"gov.ml", +"net.ml", +"org.ml", +"presse.ml", +"*.mm", +"mn", +"gov.mn", +"edu.mn", +"org.mn", +"mo", +"com.mo", +"net.mo", +"org.mo", +"edu.mo", +"gov.mo", +"mobi", +"mp", +"mq", +"mr", +"gov.mr", +"ms", +"com.ms", +"edu.ms", +"gov.ms", +"net.ms", +"org.ms", +"mt", +"com.mt", +"edu.mt", +"net.mt", +"org.mt", +"mu", +"com.mu", +"net.mu", +"org.mu", +"gov.mu", +"ac.mu", +"co.mu", +"or.mu", +"museum", +"academy.museum", +"agriculture.museum", +"air.museum", +"airguard.museum", +"alabama.museum", +"alaska.museum", +"amber.museum", +"ambulance.museum", +"american.museum", +"americana.museum", +"americanantiques.museum", +"americanart.museum", +"amsterdam.museum", +"and.museum", +"annefrank.museum", +"anthro.museum", +"anthropology.museum", +"antiques.museum", +"aquarium.museum", +"arboretum.museum", +"archaeological.museum", +"archaeology.museum", +"architecture.museum", +"art.museum", +"artanddesign.museum", +"artcenter.museum", +"artdeco.museum", +"arteducation.museum", +"artgallery.museum", +"arts.museum", +"artsandcrafts.museum", +"asmatart.museum", +"assassination.museum", +"assisi.museum", +"association.museum", +"astronomy.museum", +"atlanta.museum", +"austin.museum", +"australia.museum", +"automotive.museum", +"aviation.museum", +"axis.museum", +"badajoz.museum", +"baghdad.museum", +"bahn.museum", +"bale.museum", +"baltimore.museum", +"barcelona.museum", +"baseball.museum", +"basel.museum", +"baths.museum", +"bauern.museum", +"beauxarts.museum", +"beeldengeluid.museum", +"bellevue.museum", +"bergbau.museum", +"berkeley.museum", +"berlin.museum", +"bern.museum", +"bible.museum", +"bilbao.museum", +"bill.museum", +"birdart.museum", +"birthplace.museum", +"bonn.museum", +"boston.museum", +"botanical.museum", +"botanicalgarden.museum", +"botanicgarden.museum", +"botany.museum", +"brandywinevalley.museum", +"brasil.museum", +"bristol.museum", +"british.museum", +"britishcolumbia.museum", +"broadcast.museum", +"brunel.museum", +"brussel.museum", +"brussels.museum", +"bruxelles.museum", +"building.museum", +"burghof.museum", +"bus.museum", +"bushey.museum", +"cadaques.museum", +"california.museum", +"cambridge.museum", +"can.museum", +"canada.museum", +"capebreton.museum", +"carrier.museum", +"cartoonart.museum", +"casadelamoneda.museum", +"castle.museum", +"castres.museum", +"celtic.museum", +"center.museum", +"chattanooga.museum", +"cheltenham.museum", +"chesapeakebay.museum", +"chicago.museum", +"children.museum", +"childrens.museum", +"childrensgarden.museum", +"chiropractic.museum", +"chocolate.museum", +"christiansburg.museum", +"cincinnati.museum", +"cinema.museum", +"circus.museum", +"civilisation.museum", +"civilization.museum", +"civilwar.museum", +"clinton.museum", +"clock.museum", +"coal.museum", +"coastaldefence.museum", +"cody.museum", +"coldwar.museum", +"collection.museum", +"colonialwilliamsburg.museum", +"coloradoplateau.museum", +"columbia.museum", +"columbus.museum", +"communication.museum", +"communications.museum", +"community.museum", +"computer.museum", +"computerhistory.museum", +"comunicações.museum", +"contemporary.museum", +"contemporaryart.museum", +"convent.museum", +"copenhagen.museum", +"corporation.museum", +"correios-e-telecomunicações.museum", +"corvette.museum", +"costume.museum", +"countryestate.museum", +"county.museum", +"crafts.museum", +"cranbrook.museum", +"creation.museum", +"cultural.museum", +"culturalcenter.museum", +"culture.museum", +"cyber.museum", +"cymru.museum", +"dali.museum", +"dallas.museum", +"database.museum", +"ddr.museum", +"decorativearts.museum", +"delaware.museum", +"delmenhorst.museum", +"denmark.museum", +"depot.museum", +"design.museum", +"detroit.museum", +"dinosaur.museum", +"discovery.museum", +"dolls.museum", +"donostia.museum", +"durham.museum", +"eastafrica.museum", +"eastcoast.museum", +"education.museum", +"educational.museum", +"egyptian.museum", +"eisenbahn.museum", +"elburg.museum", +"elvendrell.museum", +"embroidery.museum", +"encyclopedic.museum", +"england.museum", +"entomology.museum", +"environment.museum", +"environmentalconservation.museum", +"epilepsy.museum", +"essex.museum", +"estate.museum", +"ethnology.museum", +"exeter.museum", +"exhibition.museum", +"family.museum", +"farm.museum", +"farmequipment.museum", +"farmers.museum", +"farmstead.museum", +"field.museum", +"figueres.museum", +"filatelia.museum", +"film.museum", +"fineart.museum", +"finearts.museum", +"finland.museum", +"flanders.museum", +"florida.museum", +"force.museum", +"fortmissoula.museum", +"fortworth.museum", +"foundation.museum", +"francaise.museum", +"frankfurt.museum", +"franziskaner.museum", +"freemasonry.museum", +"freiburg.museum", +"fribourg.museum", +"frog.museum", +"fundacio.museum", +"furniture.museum", +"gallery.museum", +"garden.museum", +"gateway.museum", +"geelvinck.museum", +"gemological.museum", +"geology.museum", +"georgia.museum", +"giessen.museum", +"glas.museum", +"glass.museum", +"gorge.museum", +"grandrapids.museum", +"graz.museum", +"guernsey.museum", +"halloffame.museum", +"hamburg.museum", +"handson.museum", +"harvestcelebration.museum", +"hawaii.museum", +"health.museum", +"heimatunduhren.museum", +"hellas.museum", +"helsinki.museum", +"hembygdsforbund.museum", +"heritage.museum", +"histoire.museum", +"historical.museum", +"historicalsociety.museum", +"historichouses.museum", +"historisch.museum", +"historisches.museum", +"history.museum", +"historyofscience.museum", +"horology.museum", +"house.museum", +"humanities.museum", +"illustration.museum", +"imageandsound.museum", +"indian.museum", +"indiana.museum", +"indianapolis.museum", +"indianmarket.museum", +"intelligence.museum", +"interactive.museum", +"iraq.museum", +"iron.museum", +"isleofman.museum", +"jamison.museum", +"jefferson.museum", +"jerusalem.museum", +"jewelry.museum", +"jewish.museum", +"jewishart.museum", +"jfk.museum", +"journalism.museum", +"judaica.museum", +"judygarland.museum", +"juedisches.museum", +"juif.museum", +"karate.museum", +"karikatur.museum", +"kids.museum", +"koebenhavn.museum", +"koeln.museum", +"kunst.museum", +"kunstsammlung.museum", +"kunstunddesign.museum", +"labor.museum", +"labour.museum", +"lajolla.museum", +"lancashire.museum", +"landes.museum", +"lans.museum", +"läns.museum", +"larsson.museum", +"lewismiller.museum", +"lincoln.museum", +"linz.museum", +"living.museum", +"livinghistory.museum", +"localhistory.museum", +"london.museum", +"losangeles.museum", +"louvre.museum", +"loyalist.museum", +"lucerne.museum", +"luxembourg.museum", +"luzern.museum", +"mad.museum", +"madrid.museum", +"mallorca.museum", +"manchester.museum", +"mansion.museum", +"mansions.museum", +"manx.museum", +"marburg.museum", +"maritime.museum", +"maritimo.museum", +"maryland.museum", +"marylhurst.museum", +"media.museum", +"medical.museum", +"medizinhistorisches.museum", +"meeres.museum", +"memorial.museum", +"mesaverde.museum", +"michigan.museum", +"midatlantic.museum", +"military.museum", +"mill.museum", +"miners.museum", +"mining.museum", +"minnesota.museum", +"missile.museum", +"missoula.museum", +"modern.museum", +"moma.museum", +"money.museum", +"monmouth.museum", +"monticello.museum", +"montreal.museum", +"moscow.museum", +"motorcycle.museum", +"muenchen.museum", +"muenster.museum", +"mulhouse.museum", +"muncie.museum", +"museet.museum", +"museumcenter.museum", +"museumvereniging.museum", +"music.museum", +"national.museum", +"nationalfirearms.museum", +"nationalheritage.museum", +"nativeamerican.museum", +"naturalhistory.museum", +"naturalhistorymuseum.museum", +"naturalsciences.museum", +"nature.museum", +"naturhistorisches.museum", +"natuurwetenschappen.museum", +"naumburg.museum", +"naval.museum", +"nebraska.museum", +"neues.museum", +"newhampshire.museum", +"newjersey.museum", +"newmexico.museum", +"newport.museum", +"newspaper.museum", +"newyork.museum", +"niepce.museum", +"norfolk.museum", +"north.museum", +"nrw.museum", +"nyc.museum", +"nyny.museum", +"oceanographic.museum", +"oceanographique.museum", +"omaha.museum", +"online.museum", +"ontario.museum", +"openair.museum", +"oregon.museum", +"oregontrail.museum", +"otago.museum", +"oxford.museum", +"pacific.museum", +"paderborn.museum", +"palace.museum", +"paleo.museum", +"palmsprings.museum", +"panama.museum", +"paris.museum", +"pasadena.museum", +"pharmacy.museum", +"philadelphia.museum", +"philadelphiaarea.museum", +"philately.museum", +"phoenix.museum", +"photography.museum", +"pilots.museum", +"pittsburgh.museum", +"planetarium.museum", +"plantation.museum", +"plants.museum", +"plaza.museum", +"portal.museum", +"portland.museum", +"portlligat.museum", +"posts-and-telecommunications.museum", +"preservation.museum", +"presidio.museum", +"press.museum", +"project.museum", +"public.museum", +"pubol.museum", +"quebec.museum", +"railroad.museum", +"railway.museum", +"research.museum", +"resistance.museum", +"riodejaneiro.museum", +"rochester.museum", +"rockart.museum", +"roma.museum", +"russia.museum", +"saintlouis.museum", +"salem.museum", +"salvadordali.museum", +"salzburg.museum", +"sandiego.museum", +"sanfrancisco.museum", +"santabarbara.museum", +"santacruz.museum", +"santafe.museum", +"saskatchewan.museum", +"satx.museum", +"savannahga.museum", +"schlesisches.museum", +"schoenbrunn.museum", +"schokoladen.museum", +"school.museum", +"schweiz.museum", +"science.museum", +"scienceandhistory.museum", +"scienceandindustry.museum", +"sciencecenter.museum", +"sciencecenters.museum", +"science-fiction.museum", +"sciencehistory.museum", +"sciences.museum", +"sciencesnaturelles.museum", +"scotland.museum", +"seaport.museum", +"settlement.museum", +"settlers.museum", +"shell.museum", +"sherbrooke.museum", +"sibenik.museum", +"silk.museum", +"ski.museum", +"skole.museum", +"society.museum", +"sologne.museum", +"soundandvision.museum", +"southcarolina.museum", +"southwest.museum", +"space.museum", +"spy.museum", +"square.museum", +"stadt.museum", +"stalbans.museum", +"starnberg.museum", +"state.museum", +"stateofdelaware.museum", +"station.museum", +"steam.museum", +"steiermark.museum", +"stjohn.museum", +"stockholm.museum", +"stpetersburg.museum", +"stuttgart.museum", +"suisse.museum", +"surgeonshall.museum", +"surrey.museum", +"svizzera.museum", +"sweden.museum", +"sydney.museum", +"tank.museum", +"tcm.museum", +"technology.museum", +"telekommunikation.museum", +"television.museum", +"texas.museum", +"textile.museum", +"theater.museum", +"time.museum", +"timekeeping.museum", +"topology.museum", +"torino.museum", +"touch.museum", +"town.museum", +"transport.museum", +"tree.museum", +"trolley.museum", +"trust.museum", +"trustee.museum", +"uhren.museum", +"ulm.museum", +"undersea.museum", +"university.museum", +"usa.museum", +"usantiques.museum", +"usarts.museum", +"uscountryestate.museum", +"usculture.museum", +"usdecorativearts.museum", +"usgarden.museum", +"ushistory.museum", +"ushuaia.museum", +"uslivinghistory.museum", +"utah.museum", +"uvic.museum", +"valley.museum", +"vantaa.museum", +"versailles.museum", +"viking.museum", +"village.museum", +"virginia.museum", +"virtual.museum", +"virtuel.museum", +"vlaanderen.museum", +"volkenkunde.museum", +"wales.museum", +"wallonie.museum", +"war.museum", +"washingtondc.museum", +"watchandclock.museum", +"watch-and-clock.museum", +"western.museum", +"westfalen.museum", +"whaling.museum", +"wildlife.museum", +"williamsburg.museum", +"windmill.museum", +"workshop.museum", +"york.museum", +"yorkshire.museum", +"yosemite.museum", +"youth.museum", +"zoological.museum", +"zoology.museum", +"ירושלים.museum", +"иком.museum", +"mv", +"aero.mv", +"biz.mv", +"com.mv", +"coop.mv", +"edu.mv", +"gov.mv", +"info.mv", +"int.mv", +"mil.mv", +"museum.mv", +"name.mv", +"net.mv", +"org.mv", +"pro.mv", +"mw", +"ac.mw", +"biz.mw", +"co.mw", +"com.mw", +"coop.mw", +"edu.mw", +"gov.mw", +"int.mw", +"museum.mw", +"net.mw", +"org.mw", +"mx", +"com.mx", +"org.mx", +"gob.mx", +"edu.mx", +"net.mx", +"my", +"com.my", +"net.my", +"org.my", +"gov.my", +"edu.my", +"mil.my", +"name.my", +"mz", +"ac.mz", +"adv.mz", +"co.mz", +"edu.mz", +"gov.mz", +"mil.mz", +"net.mz", +"org.mz", +"na", +"info.na", +"pro.na", +"name.na", +"school.na", +"or.na", +"dr.na", +"us.na", +"mx.na", +"ca.na", +"in.na", +"cc.na", +"tv.na", +"ws.na", +"mobi.na", +"co.na", +"com.na", +"org.na", +"name", +"nc", +"asso.nc", +"nom.nc", +"ne", +"net", +"nf", +"com.nf", +"net.nf", +"per.nf", +"rec.nf", +"web.nf", +"arts.nf", +"firm.nf", +"info.nf", +"other.nf", +"store.nf", +"ng", +"com.ng", +"edu.ng", +"gov.ng", +"i.ng", +"mil.ng", +"mobi.ng", +"name.ng", +"net.ng", +"org.ng", +"sch.ng", +"ni", +"ac.ni", +"biz.ni", +"co.ni", +"com.ni", +"edu.ni", +"gob.ni", +"in.ni", +"info.ni", +"int.ni", +"mil.ni", +"net.ni", +"nom.ni", +"org.ni", +"web.ni", +"nl", +"no", +"fhs.no", +"vgs.no", +"fylkesbibl.no", +"folkebibl.no", +"museum.no", +"idrett.no", +"priv.no", +"mil.no", +"stat.no", +"dep.no", +"kommune.no", +"herad.no", +"aa.no", +"ah.no", +"bu.no", +"fm.no", +"hl.no", +"hm.no", +"jan-mayen.no", +"mr.no", +"nl.no", +"nt.no", +"of.no", +"ol.no", +"oslo.no", +"rl.no", +"sf.no", +"st.no", +"svalbard.no", +"tm.no", +"tr.no", +"va.no", +"vf.no", +"gs.aa.no", +"gs.ah.no", +"gs.bu.no", +"gs.fm.no", +"gs.hl.no", +"gs.hm.no", +"gs.jan-mayen.no", +"gs.mr.no", +"gs.nl.no", +"gs.nt.no", +"gs.of.no", +"gs.ol.no", +"gs.oslo.no", +"gs.rl.no", +"gs.sf.no", +"gs.st.no", +"gs.svalbard.no", +"gs.tm.no", +"gs.tr.no", +"gs.va.no", +"gs.vf.no", +"akrehamn.no", +"åkrehamn.no", +"algard.no", +"ålgård.no", +"arna.no", +"brumunddal.no", +"bryne.no", +"bronnoysund.no", +"brønnøysund.no", +"drobak.no", +"drøbak.no", +"egersund.no", +"fetsund.no", +"floro.no", +"florø.no", +"fredrikstad.no", +"hokksund.no", +"honefoss.no", +"hønefoss.no", +"jessheim.no", +"jorpeland.no", +"jørpeland.no", +"kirkenes.no", +"kopervik.no", +"krokstadelva.no", +"langevag.no", +"langevåg.no", +"leirvik.no", +"mjondalen.no", +"mjøndalen.no", +"mo-i-rana.no", +"mosjoen.no", +"mosjøen.no", +"nesoddtangen.no", +"orkanger.no", +"osoyro.no", +"osøyro.no", +"raholt.no", +"råholt.no", +"sandnessjoen.no", +"sandnessjøen.no", +"skedsmokorset.no", +"slattum.no", +"spjelkavik.no", +"stathelle.no", +"stavern.no", +"stjordalshalsen.no", +"stjørdalshalsen.no", +"tananger.no", +"tranby.no", +"vossevangen.no", +"afjord.no", +"åfjord.no", +"agdenes.no", +"al.no", +"ål.no", +"alesund.no", +"ålesund.no", +"alstahaug.no", +"alta.no", +"áltá.no", +"alaheadju.no", +"álaheadju.no", +"alvdal.no", +"amli.no", +"åmli.no", +"amot.no", +"åmot.no", +"andebu.no", +"andoy.no", +"andøy.no", +"andasuolo.no", +"ardal.no", +"årdal.no", +"aremark.no", +"arendal.no", +"ås.no", +"aseral.no", +"åseral.no", +"asker.no", +"askim.no", +"askvoll.no", +"askoy.no", +"askøy.no", +"asnes.no", +"åsnes.no", +"audnedaln.no", +"aukra.no", +"aure.no", +"aurland.no", +"aurskog-holand.no", +"aurskog-høland.no", +"austevoll.no", +"austrheim.no", +"averoy.no", +"averøy.no", +"balestrand.no", +"ballangen.no", +"balat.no", +"bálát.no", +"balsfjord.no", +"bahccavuotna.no", +"báhccavuotna.no", +"bamble.no", +"bardu.no", +"beardu.no", +"beiarn.no", +"bajddar.no", +"bájddar.no", +"baidar.no", +"báidár.no", +"berg.no", +"bergen.no", +"berlevag.no", +"berlevåg.no", +"bearalvahki.no", +"bearalváhki.no", +"bindal.no", +"birkenes.no", +"bjarkoy.no", +"bjarkøy.no", +"bjerkreim.no", +"bjugn.no", +"bodo.no", +"bodø.no", +"badaddja.no", +"bådåddjå.no", +"budejju.no", +"bokn.no", +"bremanger.no", +"bronnoy.no", +"brønnøy.no", +"bygland.no", +"bykle.no", +"barum.no", +"bærum.no", +"bo.telemark.no", +"bø.telemark.no", +"bo.nordland.no", +"bø.nordland.no", +"bievat.no", +"bievát.no", +"bomlo.no", +"bømlo.no", +"batsfjord.no", +"båtsfjord.no", +"bahcavuotna.no", +"báhcavuotna.no", +"dovre.no", +"drammen.no", +"drangedal.no", +"dyroy.no", +"dyrøy.no", +"donna.no", +"dønna.no", +"eid.no", +"eidfjord.no", +"eidsberg.no", +"eidskog.no", +"eidsvoll.no", +"eigersund.no", +"elverum.no", +"enebakk.no", +"engerdal.no", +"etne.no", +"etnedal.no", +"evenes.no", +"evenassi.no", +"evenášši.no", +"evje-og-hornnes.no", +"farsund.no", +"fauske.no", +"fuossko.no", +"fuoisku.no", +"fedje.no", +"fet.no", +"finnoy.no", +"finnøy.no", +"fitjar.no", +"fjaler.no", +"fjell.no", +"flakstad.no", +"flatanger.no", +"flekkefjord.no", +"flesberg.no", +"flora.no", +"fla.no", +"flå.no", +"folldal.no", +"forsand.no", +"fosnes.no", +"frei.no", +"frogn.no", +"froland.no", +"frosta.no", +"frana.no", +"fræna.no", +"froya.no", +"frøya.no", +"fusa.no", +"fyresdal.no", +"forde.no", +"førde.no", +"gamvik.no", +"gangaviika.no", +"gáŋgaviika.no", +"gaular.no", +"gausdal.no", +"gildeskal.no", +"gildeskål.no", +"giske.no", +"gjemnes.no", +"gjerdrum.no", +"gjerstad.no", +"gjesdal.no", +"gjovik.no", +"gjøvik.no", +"gloppen.no", +"gol.no", +"gran.no", +"grane.no", +"granvin.no", +"gratangen.no", +"grimstad.no", +"grong.no", +"kraanghke.no", +"kråanghke.no", +"grue.no", +"gulen.no", +"hadsel.no", +"halden.no", +"halsa.no", +"hamar.no", +"hamaroy.no", +"habmer.no", +"hábmer.no", +"hapmir.no", +"hápmir.no", +"hammerfest.no", +"hammarfeasta.no", +"hámmárfeasta.no", +"haram.no", +"hareid.no", +"harstad.no", +"hasvik.no", +"aknoluokta.no", +"ákŋoluokta.no", +"hattfjelldal.no", +"aarborte.no", +"haugesund.no", +"hemne.no", +"hemnes.no", +"hemsedal.no", +"heroy.more-og-romsdal.no", +"herøy.møre-og-romsdal.no", +"heroy.nordland.no", +"herøy.nordland.no", +"hitra.no", +"hjartdal.no", +"hjelmeland.no", +"hobol.no", +"hobøl.no", +"hof.no", +"hol.no", +"hole.no", +"holmestrand.no", +"holtalen.no", +"holtålen.no", +"hornindal.no", +"horten.no", +"hurdal.no", +"hurum.no", +"hvaler.no", +"hyllestad.no", +"hagebostad.no", +"hægebostad.no", +"hoyanger.no", +"høyanger.no", +"hoylandet.no", +"høylandet.no", +"ha.no", +"hå.no", +"ibestad.no", +"inderoy.no", +"inderøy.no", +"iveland.no", +"jevnaker.no", +"jondal.no", +"jolster.no", +"jølster.no", +"karasjok.no", +"karasjohka.no", +"kárášjohka.no", +"karlsoy.no", +"galsa.no", +"gálsá.no", +"karmoy.no", +"karmøy.no", +"kautokeino.no", +"guovdageaidnu.no", +"klepp.no", +"klabu.no", +"klæbu.no", +"kongsberg.no", +"kongsvinger.no", +"kragero.no", +"kragerø.no", +"kristiansand.no", +"kristiansund.no", +"krodsherad.no", +"krødsherad.no", +"kvalsund.no", +"rahkkeravju.no", +"ráhkkerávju.no", +"kvam.no", +"kvinesdal.no", +"kvinnherad.no", +"kviteseid.no", +"kvitsoy.no", +"kvitsøy.no", +"kvafjord.no", +"kvæfjord.no", +"giehtavuoatna.no", +"kvanangen.no", +"kvænangen.no", +"navuotna.no", +"návuotna.no", +"kafjord.no", +"kåfjord.no", +"gaivuotna.no", +"gáivuotna.no", +"larvik.no", +"lavangen.no", +"lavagis.no", +"loabat.no", +"loabát.no", +"lebesby.no", +"davvesiida.no", +"leikanger.no", +"leirfjord.no", +"leka.no", +"leksvik.no", +"lenvik.no", +"leangaviika.no", +"leaŋgaviika.no", +"lesja.no", +"levanger.no", +"lier.no", +"lierne.no", +"lillehammer.no", +"lillesand.no", +"lindesnes.no", +"lindas.no", +"lindås.no", +"lom.no", +"loppa.no", +"lahppi.no", +"láhppi.no", +"lund.no", +"lunner.no", +"luroy.no", +"lurøy.no", +"luster.no", +"lyngdal.no", +"lyngen.no", +"ivgu.no", +"lardal.no", +"lerdal.no", +"lærdal.no", +"lodingen.no", +"lødingen.no", +"lorenskog.no", +"lørenskog.no", +"loten.no", +"løten.no", +"malvik.no", +"masoy.no", +"måsøy.no", +"muosat.no", +"muosát.no", +"mandal.no", +"marker.no", +"marnardal.no", +"masfjorden.no", +"meland.no", +"meldal.no", +"melhus.no", +"meloy.no", +"meløy.no", +"meraker.no", +"meråker.no", +"moareke.no", +"moåreke.no", +"midsund.no", +"midtre-gauldal.no", +"modalen.no", +"modum.no", +"molde.no", +"moskenes.no", +"moss.no", +"mosvik.no", +"malselv.no", +"målselv.no", +"malatvuopmi.no", +"málatvuopmi.no", +"namdalseid.no", +"aejrie.no", +"namsos.no", +"namsskogan.no", +"naamesjevuemie.no", +"nååmesjevuemie.no", +"laakesvuemie.no", +"nannestad.no", +"narvik.no", +"narviika.no", +"naustdal.no", +"nedre-eiker.no", +"nes.akershus.no", +"nes.buskerud.no", +"nesna.no", +"nesodden.no", +"nesseby.no", +"unjarga.no", +"unjárga.no", +"nesset.no", +"nissedal.no", +"nittedal.no", +"nord-aurdal.no", +"nord-fron.no", +"nord-odal.no", +"norddal.no", +"nordkapp.no", +"davvenjarga.no", +"davvenjárga.no", +"nordre-land.no", +"nordreisa.no", +"raisa.no", +"ráisa.no", +"nore-og-uvdal.no", +"notodden.no", +"naroy.no", +"nærøy.no", +"notteroy.no", +"nøtterøy.no", +"odda.no", +"oksnes.no", +"øksnes.no", +"oppdal.no", +"oppegard.no", +"oppegård.no", +"orkdal.no", +"orland.no", +"ørland.no", +"orskog.no", +"ørskog.no", +"orsta.no", +"ørsta.no", +"os.hedmark.no", +"os.hordaland.no", +"osen.no", +"osteroy.no", +"osterøy.no", +"ostre-toten.no", +"østre-toten.no", +"overhalla.no", +"ovre-eiker.no", +"øvre-eiker.no", +"oyer.no", +"øyer.no", +"oygarden.no", +"øygarden.no", +"oystre-slidre.no", +"øystre-slidre.no", +"porsanger.no", +"porsangu.no", +"porsáŋgu.no", +"porsgrunn.no", +"radoy.no", +"radøy.no", +"rakkestad.no", +"rana.no", +"ruovat.no", +"randaberg.no", +"rauma.no", +"rendalen.no", +"rennebu.no", +"rennesoy.no", +"rennesøy.no", +"rindal.no", +"ringebu.no", +"ringerike.no", +"ringsaker.no", +"rissa.no", +"risor.no", +"risør.no", +"roan.no", +"rollag.no", +"rygge.no", +"ralingen.no", +"rælingen.no", +"rodoy.no", +"rødøy.no", +"romskog.no", +"rømskog.no", +"roros.no", +"røros.no", +"rost.no", +"røst.no", +"royken.no", +"røyken.no", +"royrvik.no", +"røyrvik.no", +"rade.no", +"råde.no", +"salangen.no", +"siellak.no", +"saltdal.no", +"salat.no", +"sálát.no", +"sálat.no", +"samnanger.no", +"sande.more-og-romsdal.no", +"sande.møre-og-romsdal.no", +"sande.vestfold.no", +"sandefjord.no", +"sandnes.no", +"sandoy.no", +"sandøy.no", +"sarpsborg.no", +"sauda.no", +"sauherad.no", +"sel.no", +"selbu.no", +"selje.no", +"seljord.no", +"sigdal.no", +"siljan.no", +"sirdal.no", +"skaun.no", +"skedsmo.no", +"ski.no", +"skien.no", +"skiptvet.no", +"skjervoy.no", +"skjervøy.no", +"skierva.no", +"skiervá.no", +"skjak.no", +"skjåk.no", +"skodje.no", +"skanland.no", +"skånland.no", +"skanit.no", +"skánit.no", +"smola.no", +"smøla.no", +"snillfjord.no", +"snasa.no", +"snåsa.no", +"snoasa.no", +"snaase.no", +"snåase.no", +"sogndal.no", +"sokndal.no", +"sola.no", +"solund.no", +"songdalen.no", +"sortland.no", +"spydeberg.no", +"stange.no", +"stavanger.no", +"steigen.no", +"steinkjer.no", +"stjordal.no", +"stjørdal.no", +"stokke.no", +"stor-elvdal.no", +"stord.no", +"stordal.no", +"storfjord.no", +"omasvuotna.no", +"strand.no", +"stranda.no", +"stryn.no", +"sula.no", +"suldal.no", +"sund.no", +"sunndal.no", +"surnadal.no", +"sveio.no", +"svelvik.no", +"sykkylven.no", +"sogne.no", +"søgne.no", +"somna.no", +"sømna.no", +"sondre-land.no", +"søndre-land.no", +"sor-aurdal.no", +"sør-aurdal.no", +"sor-fron.no", +"sør-fron.no", +"sor-odal.no", +"sør-odal.no", +"sor-varanger.no", +"sør-varanger.no", +"matta-varjjat.no", +"mátta-várjjat.no", +"sorfold.no", +"sørfold.no", +"sorreisa.no", +"sørreisa.no", +"sorum.no", +"sørum.no", +"tana.no", +"deatnu.no", +"time.no", +"tingvoll.no", +"tinn.no", +"tjeldsund.no", +"dielddanuorri.no", +"tjome.no", +"tjøme.no", +"tokke.no", +"tolga.no", +"torsken.no", +"tranoy.no", +"tranøy.no", +"tromso.no", +"tromsø.no", +"tromsa.no", +"romsa.no", +"trondheim.no", +"troandin.no", +"trysil.no", +"trana.no", +"træna.no", +"trogstad.no", +"trøgstad.no", +"tvedestrand.no", +"tydal.no", +"tynset.no", +"tysfjord.no", +"divtasvuodna.no", +"divttasvuotna.no", +"tysnes.no", +"tysvar.no", +"tysvær.no", +"tonsberg.no", +"tønsberg.no", +"ullensaker.no", +"ullensvang.no", +"ulvik.no", +"utsira.no", +"vadso.no", +"vadsø.no", +"cahcesuolo.no", +"čáhcesuolo.no", +"vaksdal.no", +"valle.no", +"vang.no", +"vanylven.no", +"vardo.no", +"vardø.no", +"varggat.no", +"várggát.no", +"vefsn.no", +"vaapste.no", +"vega.no", +"vegarshei.no", +"vegårshei.no", +"vennesla.no", +"verdal.no", +"verran.no", +"vestby.no", +"vestnes.no", +"vestre-slidre.no", +"vestre-toten.no", +"vestvagoy.no", +"vestvågøy.no", +"vevelstad.no", +"vik.no", +"vikna.no", +"vindafjord.no", +"volda.no", +"voss.no", +"varoy.no", +"værøy.no", +"vagan.no", +"vågan.no", +"voagat.no", +"vagsoy.no", +"vågsøy.no", +"vaga.no", +"vågå.no", +"valer.ostfold.no", +"våler.østfold.no", +"valer.hedmark.no", +"våler.hedmark.no", +"*.np", +"nr", +"biz.nr", +"info.nr", +"gov.nr", +"edu.nr", +"org.nr", +"net.nr", +"com.nr", +"nu", +"nz", +"ac.nz", +"co.nz", +"cri.nz", +"geek.nz", +"gen.nz", +"govt.nz", +"health.nz", +"iwi.nz", +"kiwi.nz", +"maori.nz", +"mil.nz", +"māori.nz", +"net.nz", +"org.nz", +"parliament.nz", +"school.nz", +"om", +"co.om", +"com.om", +"edu.om", +"gov.om", +"med.om", +"museum.om", +"net.om", +"org.om", +"pro.om", +"onion", +"org", +"pa", +"ac.pa", +"gob.pa", +"com.pa", +"org.pa", +"sld.pa", +"edu.pa", +"net.pa", +"ing.pa", +"abo.pa", +"med.pa", +"nom.pa", +"pe", +"edu.pe", +"gob.pe", +"nom.pe", +"mil.pe", +"org.pe", +"com.pe", +"net.pe", +"pf", +"com.pf", +"org.pf", +"edu.pf", +"*.pg", +"ph", +"com.ph", +"net.ph", +"org.ph", +"gov.ph", +"edu.ph", +"ngo.ph", +"mil.ph", +"i.ph", +"pk", +"com.pk", +"net.pk", +"edu.pk", +"org.pk", +"fam.pk", +"biz.pk", +"web.pk", +"gov.pk", +"gob.pk", +"gok.pk", +"gon.pk", +"gop.pk", +"gos.pk", +"info.pk", +"pl", +"com.pl", +"net.pl", +"org.pl", +"aid.pl", +"agro.pl", +"atm.pl", +"auto.pl", +"biz.pl", +"edu.pl", +"gmina.pl", +"gsm.pl", +"info.pl", +"mail.pl", +"miasta.pl", +"media.pl", +"mil.pl", +"nieruchomosci.pl", +"nom.pl", +"pc.pl", +"powiat.pl", +"priv.pl", +"realestate.pl", +"rel.pl", +"sex.pl", +"shop.pl", +"sklep.pl", +"sos.pl", +"szkola.pl", +"targi.pl", +"tm.pl", +"tourism.pl", +"travel.pl", +"turystyka.pl", +"gov.pl", +"ap.gov.pl", +"ic.gov.pl", +"is.gov.pl", +"us.gov.pl", +"kmpsp.gov.pl", +"kppsp.gov.pl", +"kwpsp.gov.pl", +"psp.gov.pl", +"wskr.gov.pl", +"kwp.gov.pl", +"mw.gov.pl", +"ug.gov.pl", +"um.gov.pl", +"umig.gov.pl", +"ugim.gov.pl", +"upow.gov.pl", +"uw.gov.pl", +"starostwo.gov.pl", +"pa.gov.pl", +"po.gov.pl", +"psse.gov.pl", +"pup.gov.pl", +"rzgw.gov.pl", +"sa.gov.pl", +"so.gov.pl", +"sr.gov.pl", +"wsa.gov.pl", +"sko.gov.pl", +"uzs.gov.pl", +"wiih.gov.pl", +"winb.gov.pl", +"pinb.gov.pl", +"wios.gov.pl", +"witd.gov.pl", +"wzmiuw.gov.pl", +"piw.gov.pl", +"wiw.gov.pl", +"griw.gov.pl", +"wif.gov.pl", +"oum.gov.pl", +"sdn.gov.pl", +"zp.gov.pl", +"uppo.gov.pl", +"mup.gov.pl", +"wuoz.gov.pl", +"konsulat.gov.pl", +"oirm.gov.pl", +"augustow.pl", +"babia-gora.pl", +"bedzin.pl", +"beskidy.pl", +"bialowieza.pl", +"bialystok.pl", +"bielawa.pl", +"bieszczady.pl", +"boleslawiec.pl", +"bydgoszcz.pl", +"bytom.pl", +"cieszyn.pl", +"czeladz.pl", +"czest.pl", +"dlugoleka.pl", +"elblag.pl", +"elk.pl", +"glogow.pl", +"gniezno.pl", +"gorlice.pl", +"grajewo.pl", +"ilawa.pl", +"jaworzno.pl", +"jelenia-gora.pl", +"jgora.pl", +"kalisz.pl", +"kazimierz-dolny.pl", +"karpacz.pl", +"kartuzy.pl", +"kaszuby.pl", +"katowice.pl", +"kepno.pl", +"ketrzyn.pl", +"klodzko.pl", +"kobierzyce.pl", +"kolobrzeg.pl", +"konin.pl", +"konskowola.pl", +"kutno.pl", +"lapy.pl", +"lebork.pl", +"legnica.pl", +"lezajsk.pl", +"limanowa.pl", +"lomza.pl", +"lowicz.pl", +"lubin.pl", +"lukow.pl", +"malbork.pl", +"malopolska.pl", +"mazowsze.pl", +"mazury.pl", +"mielec.pl", +"mielno.pl", +"mragowo.pl", +"naklo.pl", +"nowaruda.pl", +"nysa.pl", +"olawa.pl", +"olecko.pl", +"olkusz.pl", +"olsztyn.pl", +"opoczno.pl", +"opole.pl", +"ostroda.pl", +"ostroleka.pl", +"ostrowiec.pl", +"ostrowwlkp.pl", +"pila.pl", +"pisz.pl", +"podhale.pl", +"podlasie.pl", +"polkowice.pl", +"pomorze.pl", +"pomorskie.pl", +"prochowice.pl", +"pruszkow.pl", +"przeworsk.pl", +"pulawy.pl", +"radom.pl", +"rawa-maz.pl", +"rybnik.pl", +"rzeszow.pl", +"sanok.pl", +"sejny.pl", +"slask.pl", +"slupsk.pl", +"sosnowiec.pl", +"stalowa-wola.pl", +"skoczow.pl", +"starachowice.pl", +"stargard.pl", +"suwalki.pl", +"swidnica.pl", +"swiebodzin.pl", +"swinoujscie.pl", +"szczecin.pl", +"szczytno.pl", +"tarnobrzeg.pl", +"tgory.pl", +"turek.pl", +"tychy.pl", +"ustka.pl", +"walbrzych.pl", +"warmia.pl", +"warszawa.pl", +"waw.pl", +"wegrow.pl", +"wielun.pl", +"wlocl.pl", +"wloclawek.pl", +"wodzislaw.pl", +"wolomin.pl", +"wroclaw.pl", +"zachpomor.pl", +"zagan.pl", +"zarow.pl", +"zgora.pl", +"zgorzelec.pl", +"pm", +"pn", +"gov.pn", +"co.pn", +"org.pn", +"edu.pn", +"net.pn", +"post", +"pr", +"com.pr", +"net.pr", +"org.pr", +"gov.pr", +"edu.pr", +"isla.pr", +"pro.pr", +"biz.pr", +"info.pr", +"name.pr", +"est.pr", +"prof.pr", +"ac.pr", +"pro", +"aaa.pro", +"aca.pro", +"acct.pro", +"avocat.pro", +"bar.pro", +"cpa.pro", +"eng.pro", +"jur.pro", +"law.pro", +"med.pro", +"recht.pro", +"ps", +"edu.ps", +"gov.ps", +"sec.ps", +"plo.ps", +"com.ps", +"org.ps", +"net.ps", +"pt", +"net.pt", +"gov.pt", +"org.pt", +"edu.pt", +"int.pt", +"publ.pt", +"com.pt", +"nome.pt", +"pw", +"co.pw", +"ne.pw", +"or.pw", +"ed.pw", +"go.pw", +"belau.pw", +"py", +"com.py", +"coop.py", +"edu.py", +"gov.py", +"mil.py", +"net.py", +"org.py", +"qa", +"com.qa", +"edu.qa", +"gov.qa", +"mil.qa", +"name.qa", +"net.qa", +"org.qa", +"sch.qa", +"re", +"asso.re", +"com.re", +"nom.re", +"ro", +"arts.ro", +"com.ro", +"firm.ro", +"info.ro", +"nom.ro", +"nt.ro", +"org.ro", +"rec.ro", +"store.ro", +"tm.ro", +"www.ro", +"rs", +"ac.rs", +"co.rs", +"edu.rs", +"gov.rs", +"in.rs", +"org.rs", +"ru", +"rw", +"ac.rw", +"co.rw", +"coop.rw", +"gov.rw", +"mil.rw", +"net.rw", +"org.rw", +"sa", +"com.sa", +"net.sa", +"org.sa", +"gov.sa", +"med.sa", +"pub.sa", +"edu.sa", +"sch.sa", +"sb", +"com.sb", +"edu.sb", +"gov.sb", +"net.sb", +"org.sb", +"sc", +"com.sc", +"gov.sc", +"net.sc", +"org.sc", +"edu.sc", +"sd", +"com.sd", +"net.sd", +"org.sd", +"edu.sd", +"med.sd", +"tv.sd", +"gov.sd", +"info.sd", +"se", +"a.se", +"ac.se", +"b.se", +"bd.se", +"brand.se", +"c.se", +"d.se", +"e.se", +"f.se", +"fh.se", +"fhsk.se", +"fhv.se", +"g.se", +"h.se", +"i.se", +"k.se", +"komforb.se", +"kommunalforbund.se", +"komvux.se", +"l.se", +"lanbib.se", +"m.se", +"n.se", +"naturbruksgymn.se", +"o.se", +"org.se", +"p.se", +"parti.se", +"pp.se", +"press.se", +"r.se", +"s.se", +"t.se", +"tm.se", +"u.se", +"w.se", +"x.se", +"y.se", +"z.se", +"sg", +"com.sg", +"net.sg", +"org.sg", +"gov.sg", +"edu.sg", +"per.sg", +"sh", +"com.sh", +"net.sh", +"gov.sh", +"org.sh", +"mil.sh", +"si", +"sj", +"sk", +"sl", +"com.sl", +"net.sl", +"edu.sl", +"gov.sl", +"org.sl", +"sm", +"sn", +"art.sn", +"com.sn", +"edu.sn", +"gouv.sn", +"org.sn", +"perso.sn", +"univ.sn", +"so", +"com.so", +"edu.so", +"gov.so", +"me.so", +"net.so", +"org.so", +"sr", +"ss", +"biz.ss", +"com.ss", +"edu.ss", +"gov.ss", +"net.ss", +"org.ss", +"st", +"co.st", +"com.st", +"consulado.st", +"edu.st", +"embaixada.st", +"gov.st", +"mil.st", +"net.st", +"org.st", +"principe.st", +"saotome.st", +"store.st", +"su", +"sv", +"com.sv", +"edu.sv", +"gob.sv", +"org.sv", +"red.sv", +"sx", +"gov.sx", +"sy", +"edu.sy", +"gov.sy", +"net.sy", +"mil.sy", +"com.sy", +"org.sy", +"sz", +"co.sz", +"ac.sz", +"org.sz", +"tc", +"td", +"tel", +"tf", +"tg", +"th", +"ac.th", +"co.th", +"go.th", +"in.th", +"mi.th", +"net.th", +"or.th", +"tj", +"ac.tj", +"biz.tj", +"co.tj", +"com.tj", +"edu.tj", +"go.tj", +"gov.tj", +"int.tj", +"mil.tj", +"name.tj", +"net.tj", +"nic.tj", +"org.tj", +"test.tj", +"web.tj", +"tk", +"tl", +"gov.tl", +"tm", +"com.tm", +"co.tm", +"org.tm", +"net.tm", +"nom.tm", +"gov.tm", +"mil.tm", +"edu.tm", +"tn", +"com.tn", +"ens.tn", +"fin.tn", +"gov.tn", +"ind.tn", +"intl.tn", +"nat.tn", +"net.tn", +"org.tn", +"info.tn", +"perso.tn", +"tourism.tn", +"edunet.tn", +"rnrt.tn", +"rns.tn", +"rnu.tn", +"mincom.tn", +"agrinet.tn", +"defense.tn", +"turen.tn", +"to", +"com.to", +"gov.to", +"net.to", +"org.to", +"edu.to", +"mil.to", +"tr", +"av.tr", +"bbs.tr", +"bel.tr", +"biz.tr", +"com.tr", +"dr.tr", +"edu.tr", +"gen.tr", +"gov.tr", +"info.tr", +"mil.tr", +"k12.tr", +"kep.tr", +"name.tr", +"net.tr", +"org.tr", +"pol.tr", +"tel.tr", +"tsk.tr", +"tv.tr", +"web.tr", +"nc.tr", +"gov.nc.tr", +"tt", +"co.tt", +"com.tt", +"org.tt", +"net.tt", +"biz.tt", +"info.tt", +"pro.tt", +"int.tt", +"coop.tt", +"jobs.tt", +"mobi.tt", +"travel.tt", +"museum.tt", +"aero.tt", +"name.tt", +"gov.tt", +"edu.tt", +"tv", +"tw", +"edu.tw", +"gov.tw", +"mil.tw", +"com.tw", +"net.tw", +"org.tw", +"idv.tw", +"game.tw", +"ebiz.tw", +"club.tw", +"網路.tw", +"組織.tw", +"商業.tw", +"tz", +"ac.tz", +"co.tz", +"go.tz", +"hotel.tz", +"info.tz", +"me.tz", +"mil.tz", +"mobi.tz", +"ne.tz", +"or.tz", +"sc.tz", +"tv.tz", +"ua", +"com.ua", +"edu.ua", +"gov.ua", +"in.ua", +"net.ua", +"org.ua", +"cherkassy.ua", +"cherkasy.ua", +"chernigov.ua", +"chernihiv.ua", +"chernivtsi.ua", +"chernovtsy.ua", +"ck.ua", +"cn.ua", +"cr.ua", +"crimea.ua", +"cv.ua", +"dn.ua", +"dnepropetrovsk.ua", +"dnipropetrovsk.ua", +"dominic.ua", +"donetsk.ua", +"dp.ua", +"if.ua", +"ivano-frankivsk.ua", +"kh.ua", +"kharkiv.ua", +"kharkov.ua", +"kherson.ua", +"khmelnitskiy.ua", +"khmelnytskyi.ua", +"kiev.ua", +"kirovograd.ua", +"km.ua", +"kr.ua", +"krym.ua", +"ks.ua", +"kv.ua", +"kyiv.ua", +"lg.ua", +"lt.ua", +"lugansk.ua", +"lutsk.ua", +"lv.ua", +"lviv.ua", +"mk.ua", +"mykolaiv.ua", +"nikolaev.ua", +"od.ua", +"odesa.ua", +"odessa.ua", +"pl.ua", +"poltava.ua", +"rivne.ua", +"rovno.ua", +"rv.ua", +"sb.ua", +"sebastopol.ua", +"sevastopol.ua", +"sm.ua", +"sumy.ua", +"te.ua", +"ternopil.ua", +"uz.ua", +"uzhgorod.ua", +"vinnica.ua", +"vinnytsia.ua", +"vn.ua", +"volyn.ua", +"yalta.ua", +"zaporizhzhe.ua", +"zaporizhzhia.ua", +"zhitomir.ua", +"zhytomyr.ua", +"zp.ua", +"zt.ua", +"ug", +"co.ug", +"or.ug", +"ac.ug", +"sc.ug", +"go.ug", +"ne.ug", +"com.ug", +"org.ug", +"uk", +"ac.uk", +"co.uk", +"gov.uk", +"ltd.uk", +"me.uk", +"net.uk", +"nhs.uk", +"org.uk", +"plc.uk", +"police.uk", +"*.sch.uk", +"us", +"dni.us", +"fed.us", +"isa.us", +"kids.us", +"nsn.us", +"ak.us", +"al.us", +"ar.us", +"as.us", +"az.us", +"ca.us", +"co.us", +"ct.us", +"dc.us", +"de.us", +"fl.us", +"ga.us", +"gu.us", +"hi.us", +"ia.us", +"id.us", +"il.us", +"in.us", +"ks.us", +"ky.us", +"la.us", +"ma.us", +"md.us", +"me.us", +"mi.us", +"mn.us", +"mo.us", +"ms.us", +"mt.us", +"nc.us", +"nd.us", +"ne.us", +"nh.us", +"nj.us", +"nm.us", +"nv.us", +"ny.us", +"oh.us", +"ok.us", +"or.us", +"pa.us", +"pr.us", +"ri.us", +"sc.us", +"sd.us", +"tn.us", +"tx.us", +"ut.us", +"vi.us", +"vt.us", +"va.us", +"wa.us", +"wi.us", +"wv.us", +"wy.us", +"k12.ak.us", +"k12.al.us", +"k12.ar.us", +"k12.as.us", +"k12.az.us", +"k12.ca.us", +"k12.co.us", +"k12.ct.us", +"k12.dc.us", +"k12.de.us", +"k12.fl.us", +"k12.ga.us", +"k12.gu.us", +"k12.ia.us", +"k12.id.us", +"k12.il.us", +"k12.in.us", +"k12.ks.us", +"k12.ky.us", +"k12.la.us", +"k12.ma.us", +"k12.md.us", +"k12.me.us", +"k12.mi.us", +"k12.mn.us", +"k12.mo.us", +"k12.ms.us", +"k12.mt.us", +"k12.nc.us", +"k12.ne.us", +"k12.nh.us", +"k12.nj.us", +"k12.nm.us", +"k12.nv.us", +"k12.ny.us", +"k12.oh.us", +"k12.ok.us", +"k12.or.us", +"k12.pa.us", +"k12.pr.us", +"k12.ri.us", +"k12.sc.us", +"k12.tn.us", +"k12.tx.us", +"k12.ut.us", +"k12.vi.us", +"k12.vt.us", +"k12.va.us", +"k12.wa.us", +"k12.wi.us", +"k12.wy.us", +"cc.ak.us", +"cc.al.us", +"cc.ar.us", +"cc.as.us", +"cc.az.us", +"cc.ca.us", +"cc.co.us", +"cc.ct.us", +"cc.dc.us", +"cc.de.us", +"cc.fl.us", +"cc.ga.us", +"cc.gu.us", +"cc.hi.us", +"cc.ia.us", +"cc.id.us", +"cc.il.us", +"cc.in.us", +"cc.ks.us", +"cc.ky.us", +"cc.la.us", +"cc.ma.us", +"cc.md.us", +"cc.me.us", +"cc.mi.us", +"cc.mn.us", +"cc.mo.us", +"cc.ms.us", +"cc.mt.us", +"cc.nc.us", +"cc.nd.us", +"cc.ne.us", +"cc.nh.us", +"cc.nj.us", +"cc.nm.us", +"cc.nv.us", +"cc.ny.us", +"cc.oh.us", +"cc.ok.us", +"cc.or.us", +"cc.pa.us", +"cc.pr.us", +"cc.ri.us", +"cc.sc.us", +"cc.sd.us", +"cc.tn.us", +"cc.tx.us", +"cc.ut.us", +"cc.vi.us", +"cc.vt.us", +"cc.va.us", +"cc.wa.us", +"cc.wi.us", +"cc.wv.us", +"cc.wy.us", +"lib.ak.us", +"lib.al.us", +"lib.ar.us", +"lib.as.us", +"lib.az.us", +"lib.ca.us", +"lib.co.us", +"lib.ct.us", +"lib.dc.us", +"lib.fl.us", +"lib.ga.us", +"lib.gu.us", +"lib.hi.us", +"lib.ia.us", +"lib.id.us", +"lib.il.us", +"lib.in.us", +"lib.ks.us", +"lib.ky.us", +"lib.la.us", +"lib.ma.us", +"lib.md.us", +"lib.me.us", +"lib.mi.us", +"lib.mn.us", +"lib.mo.us", +"lib.ms.us", +"lib.mt.us", +"lib.nc.us", +"lib.nd.us", +"lib.ne.us", +"lib.nh.us", +"lib.nj.us", +"lib.nm.us", +"lib.nv.us", +"lib.ny.us", +"lib.oh.us", +"lib.ok.us", +"lib.or.us", +"lib.pa.us", +"lib.pr.us", +"lib.ri.us", +"lib.sc.us", +"lib.sd.us", +"lib.tn.us", +"lib.tx.us", +"lib.ut.us", +"lib.vi.us", +"lib.vt.us", +"lib.va.us", +"lib.wa.us", +"lib.wi.us", +"lib.wy.us", +"pvt.k12.ma.us", +"chtr.k12.ma.us", +"paroch.k12.ma.us", +"ann-arbor.mi.us", +"cog.mi.us", +"dst.mi.us", +"eaton.mi.us", +"gen.mi.us", +"mus.mi.us", +"tec.mi.us", +"washtenaw.mi.us", +"uy", +"com.uy", +"edu.uy", +"gub.uy", +"mil.uy", +"net.uy", +"org.uy", +"uz", +"co.uz", +"com.uz", +"net.uz", +"org.uz", +"va", +"vc", +"com.vc", +"net.vc", +"org.vc", +"gov.vc", +"mil.vc", +"edu.vc", +"ve", +"arts.ve", +"co.ve", +"com.ve", +"e12.ve", +"edu.ve", +"firm.ve", +"gob.ve", +"gov.ve", +"info.ve", +"int.ve", +"mil.ve", +"net.ve", +"org.ve", +"rec.ve", +"store.ve", +"tec.ve", +"web.ve", +"vg", +"vi", +"co.vi", +"com.vi", +"k12.vi", +"net.vi", +"org.vi", +"vn", +"com.vn", +"net.vn", +"org.vn", +"edu.vn", +"gov.vn", +"int.vn", +"ac.vn", +"biz.vn", +"info.vn", +"name.vn", +"pro.vn", +"health.vn", +"vu", +"com.vu", +"edu.vu", +"net.vu", +"org.vu", +"wf", +"ws", +"com.ws", +"net.ws", +"org.ws", +"gov.ws", +"edu.ws", +"yt", +"امارات", +"հայ", +"বাংলা", +"бг", +"бел", +"中国", +"中國", +"الجزائر", +"مصر", +"ею", +"ευ", +"موريتانيا", +"გე", +"ελ", +"香港", +"公司.香港", +"教育.香港", +"政府.香港", +"個人.香港", +"網絡.香港", +"組織.香港", +"ಭಾರತ", +"ଭାରତ", +"ভাৰত", +"भारतम्", +"भारोत", +"ڀارت", +"ഭാരതം", +"भारत", +"بارت", +"بھارت", +"భారత్", +"ભારત", +"ਭਾਰਤ", +"ভারত", +"இந்தியா", +"ایران", +"ايران", +"عراق", +"الاردن", +"한국", +"қаз", +"ලංකා", +"இலங்கை", +"المغرب", +"мкд", +"мон", +"澳門", +"澳门", +"مليسيا", +"عمان", +"پاکستان", +"پاكستان", +"فلسطين", +"срб", +"пр.срб", +"орг.срб", +"обр.срб", +"од.срб", +"упр.срб", +"ак.срб", +"рф", +"قطر", +"السعودية", +"السعودیة", +"السعودیۃ", +"السعوديه", +"سودان", +"新加坡", +"சிங்கப்பூர்", +"سورية", +"سوريا", +"ไทย", +"ศึกษา.ไทย", +"ธุรกิจ.ไทย", +"รัฐบาล.ไทย", +"ทหาร.ไทย", +"เน็ต.ไทย", +"องค์กร.ไทย", +"تونس", +"台灣", +"台湾", +"臺灣", +"укр", +"اليمن", +"xxx", +"*.ye", +"ac.za", +"agric.za", +"alt.za", +"co.za", +"edu.za", +"gov.za", +"grondar.za", +"law.za", +"mil.za", +"net.za", +"ngo.za", +"nic.za", +"nis.za", +"nom.za", +"org.za", +"school.za", +"tm.za", +"web.za", +"zm", +"ac.zm", +"biz.zm", +"co.zm", +"com.zm", +"edu.zm", +"gov.zm", +"info.zm", +"mil.zm", +"net.zm", +"org.zm", +"sch.zm", +"zw", +"ac.zw", +"co.zw", +"gov.zw", +"mil.zw", +"org.zw", +"aaa", +"aarp", +"abarth", +"abb", +"abbott", +"abbvie", +"abc", +"able", +"abogado", +"abudhabi", +"academy", +"accenture", +"accountant", +"accountants", +"aco", +"actor", +"adac", +"ads", +"adult", +"aeg", +"aetna", +"afamilycompany", +"afl", +"africa", +"agakhan", +"agency", +"aig", +"aigo", +"airbus", +"airforce", +"airtel", +"akdn", +"alfaromeo", +"alibaba", +"alipay", +"allfinanz", +"allstate", +"ally", +"alsace", +"alstom", +"amazon", +"americanexpress", +"americanfamily", +"amex", +"amfam", +"amica", +"amsterdam", +"analytics", +"android", +"anquan", +"anz", +"aol", +"apartments", +"app", +"apple", +"aquarelle", +"arab", +"aramco", +"archi", +"army", +"art", +"arte", +"asda", +"associates", +"athleta", +"attorney", +"auction", +"audi", +"audible", +"audio", +"auspost", +"author", +"auto", +"autos", +"avianca", +"aws", +"axa", +"azure", +"baby", +"baidu", +"banamex", +"bananarepublic", +"band", +"bank", +"bar", +"barcelona", +"barclaycard", +"barclays", +"barefoot", +"bargains", +"baseball", +"basketball", +"bauhaus", +"bayern", +"bbc", +"bbt", +"bbva", +"bcg", +"bcn", +"beats", +"beauty", +"beer", +"bentley", +"berlin", +"best", +"bestbuy", +"bet", +"bharti", +"bible", +"bid", +"bike", +"bing", +"bingo", +"bio", +"black", +"blackfriday", +"blockbuster", +"blog", +"bloomberg", +"blue", +"bms", +"bmw", +"bnpparibas", +"boats", +"boehringer", +"bofa", +"bom", +"bond", +"boo", +"book", +"booking", +"bosch", +"bostik", +"boston", +"bot", +"boutique", +"box", +"bradesco", +"bridgestone", +"broadway", +"broker", +"brother", +"brussels", +"budapest", +"bugatti", +"build", +"builders", +"business", +"buy", +"buzz", +"bzh", +"cab", +"cafe", +"cal", +"call", +"calvinklein", +"cam", +"camera", +"camp", +"cancerresearch", +"canon", +"capetown", +"capital", +"capitalone", +"car", +"caravan", +"cards", +"care", +"career", +"careers", +"cars", +"casa", +"case", +"caseih", +"cash", +"casino", +"catering", +"catholic", +"cba", +"cbn", +"cbre", +"cbs", +"ceb", +"center", +"ceo", +"cern", +"cfa", +"cfd", +"chanel", +"channel", +"charity", +"chase", +"chat", +"cheap", +"chintai", +"christmas", +"chrome", +"church", +"cipriani", +"circle", +"cisco", +"citadel", +"citi", +"citic", +"city", +"cityeats", +"claims", +"cleaning", +"click", +"clinic", +"clinique", +"clothing", +"cloud", +"club", +"clubmed", +"coach", +"codes", +"coffee", +"college", +"cologne", +"comcast", +"commbank", +"community", +"company", +"compare", +"computer", +"comsec", +"condos", +"construction", +"consulting", +"contact", +"contractors", +"cooking", +"cookingchannel", +"cool", +"corsica", +"country", +"coupon", +"coupons", +"courses", +"cpa", +"credit", +"creditcard", +"creditunion", +"cricket", +"crown", +"crs", +"cruise", +"cruises", +"csc", +"cuisinella", +"cymru", +"cyou", +"dabur", +"dad", +"dance", +"data", +"date", +"dating", +"datsun", +"day", +"dclk", +"dds", +"deal", +"dealer", +"deals", +"degree", +"delivery", +"dell", +"deloitte", +"delta", +"democrat", +"dental", +"dentist", +"desi", +"design", +"dev", +"dhl", +"diamonds", +"diet", +"digital", +"direct", +"directory", +"discount", +"discover", +"dish", +"diy", +"dnp", +"docs", +"doctor", +"dog", +"domains", +"dot", +"download", +"drive", +"dtv", +"dubai", +"duck", +"dunlop", +"dupont", +"durban", +"dvag", +"dvr", +"earth", +"eat", +"eco", +"edeka", +"education", +"email", +"emerck", +"energy", +"engineer", +"engineering", +"enterprises", +"epson", +"equipment", +"ericsson", +"erni", +"esq", +"estate", +"esurance", +"etisalat", +"eurovision", +"eus", +"events", +"exchange", +"expert", +"exposed", +"express", +"extraspace", +"fage", +"fail", +"fairwinds", +"faith", +"family", +"fan", +"fans", +"farm", +"farmers", +"fashion", +"fast", +"fedex", +"feedback", +"ferrari", +"ferrero", +"fiat", +"fidelity", +"fido", +"film", +"final", +"finance", +"financial", +"fire", +"firestone", +"firmdale", +"fish", +"fishing", +"fit", +"fitness", +"flickr", +"flights", +"flir", +"florist", +"flowers", +"fly", +"foo", +"food", +"foodnetwork", +"football", +"ford", +"forex", +"forsale", +"forum", +"foundation", +"fox", +"free", +"fresenius", +"frl", +"frogans", +"frontdoor", +"frontier", +"ftr", +"fujitsu", +"fujixerox", +"fun", +"fund", +"furniture", +"futbol", +"fyi", +"gal", +"gallery", +"gallo", +"gallup", +"game", +"games", +"gap", +"garden", +"gay", +"gbiz", +"gdn", +"gea", +"gent", +"genting", +"george", +"ggee", +"gift", +"gifts", +"gives", +"giving", +"glade", +"glass", +"gle", +"global", +"globo", +"gmail", +"gmbh", +"gmo", +"gmx", +"godaddy", +"gold", +"goldpoint", +"golf", +"goo", +"goodyear", +"goog", +"google", +"gop", +"got", +"grainger", +"graphics", +"gratis", +"green", +"gripe", +"grocery", +"group", +"guardian", +"gucci", +"guge", +"guide", +"guitars", +"guru", +"hair", +"hamburg", +"hangout", +"haus", +"hbo", +"hdfc", +"hdfcbank", +"health", +"healthcare", +"help", +"helsinki", +"here", +"hermes", +"hgtv", +"hiphop", +"hisamitsu", +"hitachi", +"hiv", +"hkt", +"hockey", +"holdings", +"holiday", +"homedepot", +"homegoods", +"homes", +"homesense", +"honda", +"horse", +"hospital", +"host", +"hosting", +"hot", +"hoteles", +"hotels", +"hotmail", +"house", +"how", +"hsbc", +"hughes", +"hyatt", +"hyundai", +"ibm", +"icbc", +"ice", +"icu", +"ieee", +"ifm", +"ikano", +"imamat", +"imdb", +"immo", +"immobilien", +"inc", +"industries", +"infiniti", +"ing", +"ink", +"institute", +"insurance", +"insure", +"intel", +"international", +"intuit", +"investments", +"ipiranga", +"irish", +"ismaili", +"ist", +"istanbul", +"itau", +"itv", +"iveco", +"jaguar", +"java", +"jcb", +"jcp", +"jeep", +"jetzt", +"jewelry", +"jio", +"jll", +"jmp", +"jnj", +"joburg", +"jot", +"joy", +"jpmorgan", +"jprs", +"juegos", +"juniper", +"kaufen", +"kddi", +"kerryhotels", +"kerrylogistics", +"kerryproperties", +"kfh", +"kia", +"kim", +"kinder", +"kindle", +"kitchen", +"kiwi", +"koeln", +"komatsu", +"kosher", +"kpmg", +"kpn", +"krd", +"kred", +"kuokgroup", +"kyoto", +"lacaixa", +"lamborghini", +"lamer", +"lancaster", +"lancia", +"land", +"landrover", +"lanxess", +"lasalle", +"lat", +"latino", +"latrobe", +"law", +"lawyer", +"lds", +"lease", +"leclerc", +"lefrak", +"legal", +"lego", +"lexus", +"lgbt", +"lidl", +"life", +"lifeinsurance", +"lifestyle", +"lighting", +"like", +"lilly", +"limited", +"limo", +"lincoln", +"linde", +"link", +"lipsy", +"live", +"living", +"lixil", +"llc", +"llp", +"loan", +"loans", +"locker", +"locus", +"loft", +"lol", +"london", +"lotte", +"lotto", +"love", +"lpl", +"lplfinancial", +"ltd", +"ltda", +"lundbeck", +"lupin", +"luxe", +"luxury", +"macys", +"madrid", +"maif", +"maison", +"makeup", +"man", +"management", +"mango", +"map", +"market", +"marketing", +"markets", +"marriott", +"marshalls", +"maserati", +"mattel", +"mba", +"mckinsey", +"med", +"media", +"meet", +"melbourne", +"meme", +"memorial", +"men", +"menu", +"merckmsd", +"metlife", +"miami", +"microsoft", +"mini", +"mint", +"mit", +"mitsubishi", +"mlb", +"mls", +"mma", +"mobile", +"moda", +"moe", +"moi", +"mom", +"monash", +"money", +"monster", +"mormon", +"mortgage", +"moscow", +"moto", +"motorcycles", +"mov", +"movie", +"msd", +"mtn", +"mtr", +"mutual", +"nab", +"nadex", +"nagoya", +"nationwide", +"natura", +"navy", +"nba", +"nec", +"netbank", +"netflix", +"network", +"neustar", +"new", +"newholland", +"news", +"next", +"nextdirect", +"nexus", +"nfl", +"ngo", +"nhk", +"nico", +"nike", +"nikon", +"ninja", +"nissan", +"nissay", +"nokia", +"northwesternmutual", +"norton", +"now", +"nowruz", +"nowtv", +"nra", +"nrw", +"ntt", +"nyc", +"obi", +"observer", +"off", +"office", +"okinawa", +"olayan", +"olayangroup", +"oldnavy", +"ollo", +"omega", +"one", +"ong", +"onl", +"online", +"onyourside", +"ooo", +"open", +"oracle", +"orange", +"organic", +"origins", +"osaka", +"otsuka", +"ott", +"ovh", +"page", +"panasonic", +"paris", +"pars", +"partners", +"parts", +"party", +"passagens", +"pay", +"pccw", +"pet", +"pfizer", +"pharmacy", +"phd", +"philips", +"phone", +"photo", +"photography", +"photos", +"physio", +"pics", +"pictet", +"pictures", +"pid", +"pin", +"ping", +"pink", +"pioneer", +"pizza", +"place", +"play", +"playstation", +"plumbing", +"plus", +"pnc", +"pohl", +"poker", +"politie", +"porn", +"pramerica", +"praxi", +"press", +"prime", +"prod", +"productions", +"prof", +"progressive", +"promo", +"properties", +"property", +"protection", +"pru", +"prudential", +"pub", +"pwc", +"qpon", +"quebec", +"quest", +"qvc", +"racing", +"radio", +"raid", +"read", +"realestate", +"realtor", +"realty", +"recipes", +"red", +"redstone", +"redumbrella", +"rehab", +"reise", +"reisen", +"reit", +"reliance", +"ren", +"rent", +"rentals", +"repair", +"report", +"republican", +"rest", +"restaurant", +"review", +"reviews", +"rexroth", +"rich", +"richardli", +"ricoh", +"rightathome", +"ril", +"rio", +"rip", +"rmit", +"rocher", +"rocks", +"rodeo", +"rogers", +"room", +"rsvp", +"rugby", +"ruhr", +"run", +"rwe", +"ryukyu", +"saarland", +"safe", +"safety", +"sakura", +"sale", +"salon", +"samsclub", +"samsung", +"sandvik", +"sandvikcoromant", +"sanofi", +"sap", +"sarl", +"sas", +"save", +"saxo", +"sbi", +"sbs", +"sca", +"scb", +"schaeffler", +"schmidt", +"scholarships", +"school", +"schule", +"schwarz", +"science", +"scjohnson", +"scor", +"scot", +"search", +"seat", +"secure", +"security", +"seek", +"select", +"sener", +"services", +"ses", +"seven", +"sew", +"sex", +"sexy", +"sfr", +"shangrila", +"sharp", +"shaw", +"shell", +"shia", +"shiksha", +"shoes", +"shop", +"shopping", +"shouji", +"show", +"showtime", +"shriram", +"silk", +"sina", +"singles", +"site", +"ski", +"skin", +"sky", +"skype", +"sling", +"smart", +"smile", +"sncf", +"soccer", +"social", +"softbank", +"software", +"sohu", +"solar", +"solutions", +"song", +"sony", +"soy", +"spa", +"space", +"sport", +"spot", +"spreadbetting", +"srl", +"stada", +"staples", +"star", +"statebank", +"statefarm", +"stc", +"stcgroup", +"stockholm", +"storage", +"store", +"stream", +"studio", +"study", +"style", +"sucks", +"supplies", +"supply", +"support", +"surf", +"surgery", +"suzuki", +"swatch", +"swiftcover", +"swiss", +"sydney", +"symantec", +"systems", +"tab", +"taipei", +"talk", +"taobao", +"target", +"tatamotors", +"tatar", +"tattoo", +"tax", +"taxi", +"tci", +"tdk", +"team", +"tech", +"technology", +"temasek", +"tennis", +"teva", +"thd", +"theater", +"theatre", +"tiaa", +"tickets", +"tienda", +"tiffany", +"tips", +"tires", +"tirol", +"tjmaxx", +"tjx", +"tkmaxx", +"tmall", +"today", +"tokyo", +"tools", +"top", +"toray", +"toshiba", +"total", +"tours", +"town", +"toyota", +"toys", +"trade", +"trading", +"training", +"travel", +"travelchannel", +"travelers", +"travelersinsurance", +"trust", +"trv", +"tube", +"tui", +"tunes", +"tushu", +"tvs", +"ubank", +"ubs", +"unicom", +"university", +"uno", +"uol", +"ups", +"vacations", +"vana", +"vanguard", +"vegas", +"ventures", +"verisign", +"versicherung", +"vet", +"viajes", +"video", +"vig", +"viking", +"villas", +"vin", +"vip", +"virgin", +"visa", +"vision", +"viva", +"vivo", +"vlaanderen", +"vodka", +"volkswagen", +"volvo", +"vote", +"voting", +"voto", +"voyage", +"vuelos", +"wales", +"walmart", +"walter", +"wang", +"wanggou", +"watch", +"watches", +"weather", +"weatherchannel", +"webcam", +"weber", +"website", +"wed", +"wedding", +"weibo", +"weir", +"whoswho", +"wien", +"wiki", +"williamhill", +"win", +"windows", +"wine", +"winners", +"wme", +"wolterskluwer", +"woodside", +"work", +"works", +"world", +"wow", +"wtc", +"wtf", +"xbox", +"xerox", +"xfinity", +"xihuan", +"xin", +"कॉम", +"セール", +"佛山", +"慈善", +"集团", +"在线", +"大众汽车", +"点看", +"คอม", +"八卦", +"موقع", +"公益", +"公司", +"香格里拉", +"网站", +"移动", +"我爱你", +"москва", +"католик", +"онлайн", +"сайт", +"联通", +"קום", +"时尚", +"微博", +"淡马锡", +"ファッション", +"орг", +"नेट", +"ストア", +"アマゾン", +"삼성", +"商标", +"商店", +"商城", +"дети", +"ポイント", +"新闻", +"工行", +"家電", +"كوم", +"中文网", +"中信", +"娱乐", +"谷歌", +"電訊盈科", +"购物", +"クラウド", +"通販", +"网店", +"संगठन", +"餐厅", +"网络", +"ком", +"亚马逊", +"诺基亚", +"食品", +"飞利浦", +"手表", +"手机", +"ارامكو", +"العليان", +"اتصالات", +"بازار", +"ابوظبي", +"كاثوليك", +"همراه", +"닷컴", +"政府", +"شبكة", +"بيتك", +"عرب", +"机构", +"组织机构", +"健康", +"招聘", +"рус", +"珠宝", +"大拿", +"みんな", +"グーグル", +"世界", +"書籍", +"网址", +"닷넷", +"コム", +"天主教", +"游戏", +"vermögensberater", +"vermögensberatung", +"企业", +"信息", +"嘉里大酒店", +"嘉里", +"广东", +"政务", +"xyz", +"yachts", +"yahoo", +"yamaxun", +"yandex", +"yodobashi", +"yoga", +"yokohama", +"you", +"youtube", +"yun", +"zappos", +"zara", +"zero", +"zip", +"zone", +"zuerich", +"cc.ua", +"inf.ua", +"ltd.ua", +"adobeaemcloud.com", +"adobeaemcloud.net", +"*.dev.adobeaemcloud.com", +"beep.pl", +"barsy.ca", +"*.compute.estate", +"*.alces.network", +"altervista.org", +"alwaysdata.net", +"cloudfront.net", +"*.compute.amazonaws.com", +"*.compute-1.amazonaws.com", +"*.compute.amazonaws.com.cn", +"us-east-1.amazonaws.com", +"cn-north-1.eb.amazonaws.com.cn", +"cn-northwest-1.eb.amazonaws.com.cn", +"elasticbeanstalk.com", +"ap-northeast-1.elasticbeanstalk.com", +"ap-northeast-2.elasticbeanstalk.com", +"ap-northeast-3.elasticbeanstalk.com", +"ap-south-1.elasticbeanstalk.com", +"ap-southeast-1.elasticbeanstalk.com", +"ap-southeast-2.elasticbeanstalk.com", +"ca-central-1.elasticbeanstalk.com", +"eu-central-1.elasticbeanstalk.com", +"eu-west-1.elasticbeanstalk.com", +"eu-west-2.elasticbeanstalk.com", +"eu-west-3.elasticbeanstalk.com", +"sa-east-1.elasticbeanstalk.com", +"us-east-1.elasticbeanstalk.com", +"us-east-2.elasticbeanstalk.com", +"us-gov-west-1.elasticbeanstalk.com", +"us-west-1.elasticbeanstalk.com", +"us-west-2.elasticbeanstalk.com", +"*.elb.amazonaws.com", +"*.elb.amazonaws.com.cn", +"s3.amazonaws.com", +"s3-ap-northeast-1.amazonaws.com", +"s3-ap-northeast-2.amazonaws.com", +"s3-ap-south-1.amazonaws.com", +"s3-ap-southeast-1.amazonaws.com", +"s3-ap-southeast-2.amazonaws.com", +"s3-ca-central-1.amazonaws.com", +"s3-eu-central-1.amazonaws.com", +"s3-eu-west-1.amazonaws.com", +"s3-eu-west-2.amazonaws.com", +"s3-eu-west-3.amazonaws.com", +"s3-external-1.amazonaws.com", +"s3-fips-us-gov-west-1.amazonaws.com", +"s3-sa-east-1.amazonaws.com", +"s3-us-gov-west-1.amazonaws.com", +"s3-us-east-2.amazonaws.com", +"s3-us-west-1.amazonaws.com", +"s3-us-west-2.amazonaws.com", +"s3.ap-northeast-2.amazonaws.com", +"s3.ap-south-1.amazonaws.com", +"s3.cn-north-1.amazonaws.com.cn", +"s3.ca-central-1.amazonaws.com", +"s3.eu-central-1.amazonaws.com", +"s3.eu-west-2.amazonaws.com", +"s3.eu-west-3.amazonaws.com", +"s3.us-east-2.amazonaws.com", +"s3.dualstack.ap-northeast-1.amazonaws.com", +"s3.dualstack.ap-northeast-2.amazonaws.com", +"s3.dualstack.ap-south-1.amazonaws.com", +"s3.dualstack.ap-southeast-1.amazonaws.com", +"s3.dualstack.ap-southeast-2.amazonaws.com", +"s3.dualstack.ca-central-1.amazonaws.com", +"s3.dualstack.eu-central-1.amazonaws.com", +"s3.dualstack.eu-west-1.amazonaws.com", +"s3.dualstack.eu-west-2.amazonaws.com", +"s3.dualstack.eu-west-3.amazonaws.com", +"s3.dualstack.sa-east-1.amazonaws.com", +"s3.dualstack.us-east-1.amazonaws.com", +"s3.dualstack.us-east-2.amazonaws.com", +"s3-website-us-east-1.amazonaws.com", +"s3-website-us-west-1.amazonaws.com", +"s3-website-us-west-2.amazonaws.com", +"s3-website-ap-northeast-1.amazonaws.com", +"s3-website-ap-southeast-1.amazonaws.com", +"s3-website-ap-southeast-2.amazonaws.com", +"s3-website-eu-west-1.amazonaws.com", +"s3-website-sa-east-1.amazonaws.com", +"s3-website.ap-northeast-2.amazonaws.com", +"s3-website.ap-south-1.amazonaws.com", +"s3-website.ca-central-1.amazonaws.com", +"s3-website.eu-central-1.amazonaws.com", +"s3-website.eu-west-2.amazonaws.com", +"s3-website.eu-west-3.amazonaws.com", +"s3-website.us-east-2.amazonaws.com", +"amsw.nl", +"t3l3p0rt.net", +"tele.amune.org", +"apigee.io", +"on-aptible.com", +"user.aseinet.ne.jp", +"gv.vc", +"d.gv.vc", +"user.party.eus", +"pimienta.org", +"poivron.org", +"potager.org", +"sweetpepper.org", +"myasustor.com", +"myfritz.net", +"*.awdev.ca", +"*.advisor.ws", +"b-data.io", +"backplaneapp.io", +"balena-devices.com", +"app.banzaicloud.io", +"betainabox.com", +"bnr.la", +"blackbaudcdn.net", +"boomla.net", +"boxfuse.io", +"square7.ch", +"bplaced.com", +"bplaced.de", +"square7.de", +"bplaced.net", +"square7.net", +"browsersafetymark.io", +"uk0.bigv.io", +"dh.bytemark.co.uk", +"vm.bytemark.co.uk", +"mycd.eu", +"carrd.co", +"crd.co", +"uwu.ai", +"ae.org", +"ar.com", +"br.com", +"cn.com", +"com.de", +"com.se", +"de.com", +"eu.com", +"gb.com", +"gb.net", +"hu.com", +"hu.net", +"jp.net", +"jpn.com", +"kr.com", +"mex.com", +"no.com", +"qc.com", +"ru.com", +"sa.com", +"se.net", +"uk.com", +"uk.net", +"us.com", +"uy.com", +"za.bz", +"za.com", +"africa.com", +"gr.com", +"in.net", +"us.org", +"co.com", +"c.la", +"certmgr.org", +"xenapponazure.com", +"discourse.group", +"discourse.team", +"virtueeldomein.nl", +"cleverapps.io", +"*.lcl.dev", +"*.stg.dev", +"c66.me", +"cloud66.ws", +"cloud66.zone", +"jdevcloud.com", +"wpdevcloud.com", +"cloudaccess.host", +"freesite.host", +"cloudaccess.net", +"cloudcontrolled.com", +"cloudcontrolapp.com", +"cloudera.site", +"trycloudflare.com", +"workers.dev", +"wnext.app", +"co.ca", +"*.otap.co", +"co.cz", +"c.cdn77.org", +"cdn77-ssl.net", +"r.cdn77.net", +"rsc.cdn77.org", +"ssl.origin.cdn77-secure.org", +"cloudns.asia", +"cloudns.biz", +"cloudns.club", +"cloudns.cc", +"cloudns.eu", +"cloudns.in", +"cloudns.info", +"cloudns.org", +"cloudns.pro", +"cloudns.pw", +"cloudns.us", +"cloudeity.net", +"cnpy.gdn", +"co.nl", +"co.no", +"webhosting.be", +"hosting-cluster.nl", +"ac.ru", +"edu.ru", +"gov.ru", +"int.ru", +"mil.ru", +"test.ru", +"dyn.cosidns.de", +"dynamisches-dns.de", +"dnsupdater.de", +"internet-dns.de", +"l-o-g-i-n.de", +"dynamic-dns.info", +"feste-ip.net", +"knx-server.net", +"static-access.net", +"realm.cz", +"*.cryptonomic.net", +"cupcake.is", +"*.customer-oci.com", +"*.oci.customer-oci.com", +"*.ocp.customer-oci.com", +"*.ocs.customer-oci.com", +"cyon.link", +"cyon.site", +"daplie.me", +"localhost.daplie.me", +"dattolocal.com", +"dattorelay.com", +"dattoweb.com", +"mydatto.com", +"dattolocal.net", +"mydatto.net", +"biz.dk", +"co.dk", +"firm.dk", +"reg.dk", +"store.dk", +"*.dapps.earth", +"*.bzz.dapps.earth", +"builtwithdark.com", +"edgestack.me", +"debian.net", +"dedyn.io", +"dnshome.de", +"online.th", +"shop.th", +"drayddns.com", +"dreamhosters.com", +"mydrobo.com", +"drud.io", +"drud.us", +"duckdns.org", +"dy.fi", +"tunk.org", +"dyndns-at-home.com", +"dyndns-at-work.com", +"dyndns-blog.com", +"dyndns-free.com", +"dyndns-home.com", +"dyndns-ip.com", +"dyndns-mail.com", +"dyndns-office.com", +"dyndns-pics.com", +"dyndns-remote.com", +"dyndns-server.com", +"dyndns-web.com", +"dyndns-wiki.com", +"dyndns-work.com", +"dyndns.biz", +"dyndns.info", +"dyndns.org", +"dyndns.tv", +"at-band-camp.net", +"ath.cx", +"barrel-of-knowledge.info", +"barrell-of-knowledge.info", +"better-than.tv", +"blogdns.com", +"blogdns.net", +"blogdns.org", +"blogsite.org", +"boldlygoingnowhere.org", +"broke-it.net", +"buyshouses.net", +"cechire.com", +"dnsalias.com", +"dnsalias.net", +"dnsalias.org", +"dnsdojo.com", +"dnsdojo.net", +"dnsdojo.org", +"does-it.net", +"doesntexist.com", +"doesntexist.org", +"dontexist.com", +"dontexist.net", +"dontexist.org", +"doomdns.com", +"doomdns.org", +"dvrdns.org", +"dyn-o-saur.com", +"dynalias.com", +"dynalias.net", +"dynalias.org", +"dynathome.net", +"dyndns.ws", +"endofinternet.net", +"endofinternet.org", +"endoftheinternet.org", +"est-a-la-maison.com", +"est-a-la-masion.com", +"est-le-patron.com", +"est-mon-blogueur.com", +"for-better.biz", +"for-more.biz", +"for-our.info", +"for-some.biz", +"for-the.biz", +"forgot.her.name", +"forgot.his.name", +"from-ak.com", +"from-al.com", +"from-ar.com", +"from-az.net", +"from-ca.com", +"from-co.net", +"from-ct.com", +"from-dc.com", +"from-de.com", +"from-fl.com", +"from-ga.com", +"from-hi.com", +"from-ia.com", +"from-id.com", +"from-il.com", +"from-in.com", +"from-ks.com", +"from-ky.com", +"from-la.net", +"from-ma.com", +"from-md.com", +"from-me.org", +"from-mi.com", +"from-mn.com", +"from-mo.com", +"from-ms.com", +"from-mt.com", +"from-nc.com", +"from-nd.com", +"from-ne.com", +"from-nh.com", +"from-nj.com", +"from-nm.com", +"from-nv.com", +"from-ny.net", +"from-oh.com", +"from-ok.com", +"from-or.com", +"from-pa.com", +"from-pr.com", +"from-ri.com", +"from-sc.com", +"from-sd.com", +"from-tn.com", +"from-tx.com", +"from-ut.com", +"from-va.com", +"from-vt.com", +"from-wa.com", +"from-wi.com", +"from-wv.com", +"from-wy.com", +"ftpaccess.cc", +"fuettertdasnetz.de", +"game-host.org", +"game-server.cc", +"getmyip.com", +"gets-it.net", +"go.dyndns.org", +"gotdns.com", +"gotdns.org", +"groks-the.info", +"groks-this.info", +"ham-radio-op.net", +"here-for-more.info", +"hobby-site.com", +"hobby-site.org", +"home.dyndns.org", +"homedns.org", +"homeftp.net", +"homeftp.org", +"homeip.net", +"homelinux.com", +"homelinux.net", +"homelinux.org", +"homeunix.com", +"homeunix.net", +"homeunix.org", +"iamallama.com", +"in-the-band.net", +"is-a-anarchist.com", +"is-a-blogger.com", +"is-a-bookkeeper.com", +"is-a-bruinsfan.org", +"is-a-bulls-fan.com", +"is-a-candidate.org", +"is-a-caterer.com", +"is-a-celticsfan.org", +"is-a-chef.com", +"is-a-chef.net", +"is-a-chef.org", +"is-a-conservative.com", +"is-a-cpa.com", +"is-a-cubicle-slave.com", +"is-a-democrat.com", +"is-a-designer.com", +"is-a-doctor.com", +"is-a-financialadvisor.com", +"is-a-geek.com", +"is-a-geek.net", +"is-a-geek.org", +"is-a-green.com", +"is-a-guru.com", +"is-a-hard-worker.com", +"is-a-hunter.com", +"is-a-knight.org", +"is-a-landscaper.com", +"is-a-lawyer.com", +"is-a-liberal.com", +"is-a-libertarian.com", +"is-a-linux-user.org", +"is-a-llama.com", +"is-a-musician.com", +"is-a-nascarfan.com", +"is-a-nurse.com", +"is-a-painter.com", +"is-a-patsfan.org", +"is-a-personaltrainer.com", +"is-a-photographer.com", +"is-a-player.com", +"is-a-republican.com", +"is-a-rockstar.com", +"is-a-socialist.com", +"is-a-soxfan.org", +"is-a-student.com", +"is-a-teacher.com", +"is-a-techie.com", +"is-a-therapist.com", +"is-an-accountant.com", +"is-an-actor.com", +"is-an-actress.com", +"is-an-anarchist.com", +"is-an-artist.com", +"is-an-engineer.com", +"is-an-entertainer.com", +"is-by.us", +"is-certified.com", +"is-found.org", +"is-gone.com", +"is-into-anime.com", +"is-into-cars.com", +"is-into-cartoons.com", +"is-into-games.com", +"is-leet.com", +"is-lost.org", +"is-not-certified.com", +"is-saved.org", +"is-slick.com", +"is-uberleet.com", +"is-very-bad.org", +"is-very-evil.org", +"is-very-good.org", +"is-very-nice.org", +"is-very-sweet.org", +"is-with-theband.com", +"isa-geek.com", +"isa-geek.net", +"isa-geek.org", +"isa-hockeynut.com", +"issmarterthanyou.com", +"isteingeek.de", +"istmein.de", +"kicks-ass.net", +"kicks-ass.org", +"knowsitall.info", +"land-4-sale.us", +"lebtimnetz.de", +"leitungsen.de", +"likes-pie.com", +"likescandy.com", +"merseine.nu", +"mine.nu", +"misconfused.org", +"mypets.ws", +"myphotos.cc", +"neat-url.com", +"office-on-the.net", +"on-the-web.tv", +"podzone.net", +"podzone.org", +"readmyblog.org", +"saves-the-whales.com", +"scrapper-site.net", +"scrapping.cc", +"selfip.biz", +"selfip.com", +"selfip.info", +"selfip.net", +"selfip.org", +"sells-for-less.com", +"sells-for-u.com", +"sells-it.net", +"sellsyourhome.org", +"servebbs.com", +"servebbs.net", +"servebbs.org", +"serveftp.net", +"serveftp.org", +"servegame.org", +"shacknet.nu", +"simple-url.com", +"space-to-rent.com", +"stuff-4-sale.org", +"stuff-4-sale.us", +"teaches-yoga.com", +"thruhere.net", +"traeumtgerade.de", +"webhop.biz", +"webhop.info", +"webhop.net", +"webhop.org", +"worse-than.tv", +"writesthisblog.com", +"ddnss.de", +"dyn.ddnss.de", +"dyndns.ddnss.de", +"dyndns1.de", +"dyn-ip24.de", +"home-webserver.de", +"dyn.home-webserver.de", +"myhome-server.de", +"ddnss.org", +"definima.net", +"definima.io", +"bci.dnstrace.pro", +"ddnsfree.com", +"ddnsgeek.com", +"giize.com", +"gleeze.com", +"kozow.com", +"loseyourip.com", +"ooguy.com", +"theworkpc.com", +"casacam.net", +"dynu.net", +"accesscam.org", +"camdvr.org", +"freeddns.org", +"mywire.org", +"webredirect.org", +"myddns.rocks", +"blogsite.xyz", +"dynv6.net", +"e4.cz", +"en-root.fr", +"mytuleap.com", +"onred.one", +"staging.onred.one", +"enonic.io", +"customer.enonic.io", +"eu.org", +"al.eu.org", +"asso.eu.org", +"at.eu.org", +"au.eu.org", +"be.eu.org", +"bg.eu.org", +"ca.eu.org", +"cd.eu.org", +"ch.eu.org", +"cn.eu.org", +"cy.eu.org", +"cz.eu.org", +"de.eu.org", +"dk.eu.org", +"edu.eu.org", +"ee.eu.org", +"es.eu.org", +"fi.eu.org", +"fr.eu.org", +"gr.eu.org", +"hr.eu.org", +"hu.eu.org", +"ie.eu.org", +"il.eu.org", +"in.eu.org", +"int.eu.org", +"is.eu.org", +"it.eu.org", +"jp.eu.org", +"kr.eu.org", +"lt.eu.org", +"lu.eu.org", +"lv.eu.org", +"mc.eu.org", +"me.eu.org", +"mk.eu.org", +"mt.eu.org", +"my.eu.org", +"net.eu.org", +"ng.eu.org", +"nl.eu.org", +"no.eu.org", +"nz.eu.org", +"paris.eu.org", +"pl.eu.org", +"pt.eu.org", +"q-a.eu.org", +"ro.eu.org", +"ru.eu.org", +"se.eu.org", +"si.eu.org", +"sk.eu.org", +"tr.eu.org", +"uk.eu.org", +"us.eu.org", +"eu-1.evennode.com", +"eu-2.evennode.com", +"eu-3.evennode.com", +"eu-4.evennode.com", +"us-1.evennode.com", +"us-2.evennode.com", +"us-3.evennode.com", +"us-4.evennode.com", +"twmail.cc", +"twmail.net", +"twmail.org", +"mymailer.com.tw", +"url.tw", +"apps.fbsbx.com", +"ru.net", +"adygeya.ru", +"bashkiria.ru", +"bir.ru", +"cbg.ru", +"com.ru", +"dagestan.ru", +"grozny.ru", +"kalmykia.ru", +"kustanai.ru", +"marine.ru", +"mordovia.ru", +"msk.ru", +"mytis.ru", +"nalchik.ru", +"nov.ru", +"pyatigorsk.ru", +"spb.ru", +"vladikavkaz.ru", +"vladimir.ru", +"abkhazia.su", +"adygeya.su", +"aktyubinsk.su", +"arkhangelsk.su", +"armenia.su", +"ashgabad.su", +"azerbaijan.su", +"balashov.su", +"bashkiria.su", +"bryansk.su", +"bukhara.su", +"chimkent.su", +"dagestan.su", +"east-kazakhstan.su", +"exnet.su", +"georgia.su", +"grozny.su", +"ivanovo.su", +"jambyl.su", +"kalmykia.su", +"kaluga.su", +"karacol.su", +"karaganda.su", +"karelia.su", +"khakassia.su", +"krasnodar.su", +"kurgan.su", +"kustanai.su", +"lenug.su", +"mangyshlak.su", +"mordovia.su", +"msk.su", +"murmansk.su", +"nalchik.su", +"navoi.su", +"north-kazakhstan.su", +"nov.su", +"obninsk.su", +"penza.su", +"pokrovsk.su", +"sochi.su", +"spb.su", +"tashkent.su", +"termez.su", +"togliatti.su", +"troitsk.su", +"tselinograd.su", +"tula.su", +"tuva.su", +"vladikavkaz.su", +"vladimir.su", +"vologda.su", +"channelsdvr.net", +"u.channelsdvr.net", +"fastly-terrarium.com", +"fastlylb.net", +"map.fastlylb.net", +"freetls.fastly.net", +"map.fastly.net", +"a.prod.fastly.net", +"global.prod.fastly.net", +"a.ssl.fastly.net", +"b.ssl.fastly.net", +"global.ssl.fastly.net", +"fastpanel.direct", +"fastvps-server.com", +"fhapp.xyz", +"fedorainfracloud.org", +"fedorapeople.org", +"cloud.fedoraproject.org", +"app.os.fedoraproject.org", +"app.os.stg.fedoraproject.org", +"mydobiss.com", +"filegear.me", +"filegear-au.me", +"filegear-de.me", +"filegear-gb.me", +"filegear-ie.me", +"filegear-jp.me", +"filegear-sg.me", +"firebaseapp.com", +"flynnhub.com", +"flynnhosting.net", +"0e.vc", +"freebox-os.com", +"freeboxos.com", +"fbx-os.fr", +"fbxos.fr", +"freebox-os.fr", +"freeboxos.fr", +"freedesktop.org", +"*.futurecms.at", +"*.ex.futurecms.at", +"*.in.futurecms.at", +"futurehosting.at", +"futuremailing.at", +"*.ex.ortsinfo.at", +"*.kunden.ortsinfo.at", +"*.statics.cloud", +"service.gov.uk", +"gehirn.ne.jp", +"usercontent.jp", +"gentapps.com", +"lab.ms", +"github.io", +"githubusercontent.com", +"gitlab.io", +"glitch.me", +"lolipop.io", +"cloudapps.digital", +"london.cloudapps.digital", +"homeoffice.gov.uk", +"ro.im", +"shop.ro", +"goip.de", +"run.app", +"a.run.app", +"web.app", +"*.0emm.com", +"appspot.com", +"*.r.appspot.com", +"blogspot.ae", +"blogspot.al", +"blogspot.am", +"blogspot.ba", +"blogspot.be", +"blogspot.bg", +"blogspot.bj", +"blogspot.ca", +"blogspot.cf", +"blogspot.ch", +"blogspot.cl", +"blogspot.co.at", +"blogspot.co.id", +"blogspot.co.il", +"blogspot.co.ke", +"blogspot.co.nz", +"blogspot.co.uk", +"blogspot.co.za", +"blogspot.com", +"blogspot.com.ar", +"blogspot.com.au", +"blogspot.com.br", +"blogspot.com.by", +"blogspot.com.co", +"blogspot.com.cy", +"blogspot.com.ee", +"blogspot.com.eg", +"blogspot.com.es", +"blogspot.com.mt", +"blogspot.com.ng", +"blogspot.com.tr", +"blogspot.com.uy", +"blogspot.cv", +"blogspot.cz", +"blogspot.de", +"blogspot.dk", +"blogspot.fi", +"blogspot.fr", +"blogspot.gr", +"blogspot.hk", +"blogspot.hr", +"blogspot.hu", +"blogspot.ie", +"blogspot.in", +"blogspot.is", +"blogspot.it", +"blogspot.jp", +"blogspot.kr", +"blogspot.li", +"blogspot.lt", +"blogspot.lu", +"blogspot.md", +"blogspot.mk", +"blogspot.mr", +"blogspot.mx", +"blogspot.my", +"blogspot.nl", +"blogspot.no", +"blogspot.pe", +"blogspot.pt", +"blogspot.qa", +"blogspot.re", +"blogspot.ro", +"blogspot.rs", +"blogspot.ru", +"blogspot.se", +"blogspot.sg", +"blogspot.si", +"blogspot.sk", +"blogspot.sn", +"blogspot.td", +"blogspot.tw", +"blogspot.ug", +"blogspot.vn", +"cloudfunctions.net", +"cloud.goog", +"codespot.com", +"googleapis.com", +"googlecode.com", +"pagespeedmobilizer.com", +"publishproxy.com", +"withgoogle.com", +"withyoutube.com", +"awsmppl.com", +"fin.ci", +"free.hr", +"caa.li", +"ua.rs", +"conf.se", +"hs.zone", +"hs.run", +"hashbang.sh", +"hasura.app", +"hasura-app.io", +"hepforge.org", +"herokuapp.com", +"herokussl.com", +"myravendb.com", +"ravendb.community", +"ravendb.me", +"development.run", +"ravendb.run", +"bpl.biz", +"orx.biz", +"ng.city", +"biz.gl", +"ng.ink", +"col.ng", +"firm.ng", +"gen.ng", +"ltd.ng", +"ngo.ng", +"ng.school", +"sch.so", +"häkkinen.fi", +"*.moonscale.io", +"moonscale.net", +"iki.fi", +"dyn-berlin.de", +"in-berlin.de", +"in-brb.de", +"in-butter.de", +"in-dsl.de", +"in-dsl.net", +"in-dsl.org", +"in-vpn.de", +"in-vpn.net", +"in-vpn.org", +"biz.at", +"info.at", +"info.cx", +"ac.leg.br", +"al.leg.br", +"am.leg.br", +"ap.leg.br", +"ba.leg.br", +"ce.leg.br", +"df.leg.br", +"es.leg.br", +"go.leg.br", +"ma.leg.br", +"mg.leg.br", +"ms.leg.br", +"mt.leg.br", +"pa.leg.br", +"pb.leg.br", +"pe.leg.br", +"pi.leg.br", +"pr.leg.br", +"rj.leg.br", +"rn.leg.br", +"ro.leg.br", +"rr.leg.br", +"rs.leg.br", +"sc.leg.br", +"se.leg.br", +"sp.leg.br", +"to.leg.br", +"pixolino.com", +"ipifony.net", +"mein-iserv.de", +"test-iserv.de", +"iserv.dev", +"iobb.net", +"myjino.ru", +"*.hosting.myjino.ru", +"*.landing.myjino.ru", +"*.spectrum.myjino.ru", +"*.vps.myjino.ru", +"*.triton.zone", +"*.cns.joyent.com", +"js.org", +"kaas.gg", +"khplay.nl", +"keymachine.de", +"kinghost.net", +"uni5.net", +"knightpoint.systems", +"oya.to", +"co.krd", +"edu.krd", +"git-repos.de", +"lcube-server.de", +"svn-repos.de", +"leadpages.co", +"lpages.co", +"lpusercontent.com", +"lelux.site", +"co.business", +"co.education", +"co.events", +"co.financial", +"co.network", +"co.place", +"co.technology", +"app.lmpm.com", +"linkitools.space", +"linkyard.cloud", +"linkyard-cloud.ch", +"members.linode.com", +"nodebalancer.linode.com", +"we.bs", +"loginline.app", +"loginline.dev", +"loginline.io", +"loginline.services", +"loginline.site", +"krasnik.pl", +"leczna.pl", +"lubartow.pl", +"lublin.pl", +"poniatowa.pl", +"swidnik.pl", +"uklugs.org", +"glug.org.uk", +"lug.org.uk", +"lugs.org.uk", +"barsy.bg", +"barsy.co.uk", +"barsyonline.co.uk", +"barsycenter.com", +"barsyonline.com", +"barsy.club", +"barsy.de", +"barsy.eu", +"barsy.in", +"barsy.info", +"barsy.io", +"barsy.me", +"barsy.menu", +"barsy.mobi", +"barsy.net", +"barsy.online", +"barsy.org", +"barsy.pro", +"barsy.pub", +"barsy.shop", +"barsy.site", +"barsy.support", +"barsy.uk", +"*.magentosite.cloud", +"mayfirst.info", +"mayfirst.org", +"hb.cldmail.ru", +"miniserver.com", +"memset.net", +"cloud.metacentrum.cz", +"custom.metacentrum.cz", +"flt.cloud.muni.cz", +"usr.cloud.muni.cz", +"meteorapp.com", +"eu.meteorapp.com", +"co.pl", +"azurecontainer.io", +"azurewebsites.net", +"azure-mobile.net", +"cloudapp.net", +"mozilla-iot.org", +"bmoattachments.org", +"net.ru", +"org.ru", +"pp.ru", +"ui.nabu.casa", +"pony.club", +"of.fashion", +"on.fashion", +"of.football", +"in.london", +"of.london", +"for.men", +"and.mom", +"for.mom", +"for.one", +"for.sale", +"of.work", +"to.work", +"nctu.me", +"bitballoon.com", +"netlify.com", +"4u.com", +"ngrok.io", +"nh-serv.co.uk", +"nfshost.com", +"dnsking.ch", +"mypi.co", +"n4t.co", +"001www.com", +"ddnslive.com", +"myiphost.com", +"forumz.info", +"16-b.it", +"32-b.it", +"64-b.it", +"soundcast.me", +"tcp4.me", +"dnsup.net", +"hicam.net", +"now-dns.net", +"ownip.net", +"vpndns.net", +"dynserv.org", +"now-dns.org", +"x443.pw", +"now-dns.top", +"ntdll.top", +"freeddns.us", +"crafting.xyz", +"zapto.xyz", +"nsupdate.info", +"nerdpol.ovh", +"blogsyte.com", +"brasilia.me", +"cable-modem.org", +"ciscofreak.com", +"collegefan.org", +"couchpotatofries.org", +"damnserver.com", +"ddns.me", +"ditchyourip.com", +"dnsfor.me", +"dnsiskinky.com", +"dvrcam.info", +"dynns.com", +"eating-organic.net", +"fantasyleague.cc", +"geekgalaxy.com", +"golffan.us", +"health-carereform.com", +"homesecuritymac.com", +"homesecuritypc.com", +"hopto.me", +"ilovecollege.info", +"loginto.me", +"mlbfan.org", +"mmafan.biz", +"myactivedirectory.com", +"mydissent.net", +"myeffect.net", +"mymediapc.net", +"mypsx.net", +"mysecuritycamera.com", +"mysecuritycamera.net", +"mysecuritycamera.org", +"net-freaks.com", +"nflfan.org", +"nhlfan.net", +"no-ip.ca", +"no-ip.co.uk", +"no-ip.net", +"noip.us", +"onthewifi.com", +"pgafan.net", +"point2this.com", +"pointto.us", +"privatizehealthinsurance.net", +"quicksytes.com", +"read-books.org", +"securitytactics.com", +"serveexchange.com", +"servehumour.com", +"servep2p.com", +"servesarcasm.com", +"stufftoread.com", +"ufcfan.org", +"unusualperson.com", +"workisboring.com", +"3utilities.com", +"bounceme.net", +"ddns.net", +"ddnsking.com", +"gotdns.ch", +"hopto.org", +"myftp.biz", +"myftp.org", +"myvnc.com", +"no-ip.biz", +"no-ip.info", +"no-ip.org", +"noip.me", +"redirectme.net", +"servebeer.com", +"serveblog.net", +"servecounterstrike.com", +"serveftp.com", +"servegame.com", +"servehalflife.com", +"servehttp.com", +"serveirc.com", +"serveminecraft.net", +"servemp3.com", +"servepics.com", +"servequake.com", +"sytes.net", +"webhop.me", +"zapto.org", +"stage.nodeart.io", +"nodum.co", +"nodum.io", +"pcloud.host", +"nyc.mn", +"nom.ae", +"nom.af", +"nom.ai", +"nom.al", +"nym.by", +"nom.bz", +"nym.bz", +"nom.cl", +"nym.ec", +"nom.gd", +"nom.ge", +"nom.gl", +"nym.gr", +"nom.gt", +"nym.gy", +"nym.hk", +"nom.hn", +"nym.ie", +"nom.im", +"nom.ke", +"nym.kz", +"nym.la", +"nym.lc", +"nom.li", +"nym.li", +"nym.lt", +"nym.lu", +"nom.lv", +"nym.me", +"nom.mk", +"nym.mn", +"nym.mx", +"nom.nu", +"nym.nz", +"nym.pe", +"nym.pt", +"nom.pw", +"nom.qa", +"nym.ro", +"nom.rs", +"nom.si", +"nym.sk", +"nom.st", +"nym.su", +"nym.sx", +"nom.tj", +"nym.tw", +"nom.ug", +"nom.uy", +"nom.vc", +"nom.vg", +"static.observableusercontent.com", +"cya.gg", +"cloudycluster.net", +"nid.io", +"opencraft.hosting", +"operaunite.com", +"skygearapp.com", +"outsystemscloud.com", +"ownprovider.com", +"own.pm", +"ox.rs", +"oy.lc", +"pgfog.com", +"pagefrontapp.com", +"art.pl", +"gliwice.pl", +"krakow.pl", +"poznan.pl", +"wroc.pl", +"zakopane.pl", +"pantheonsite.io", +"gotpantheon.com", +"mypep.link", +"perspecta.cloud", +"on-web.fr", +"*.platform.sh", +"*.platformsh.site", +"dyn53.io", +"co.bn", +"xen.prgmr.com", +"priv.at", +"prvcy.page", +"*.dweb.link", +"protonet.io", +"chirurgiens-dentistes-en-france.fr", +"byen.site", +"pubtls.org", +"qualifioapp.com", +"qbuser.com", +"instantcloud.cn", +"ras.ru", +"qa2.com", +"qcx.io", +"*.sys.qcx.io", +"dev-myqnapcloud.com", +"alpha-myqnapcloud.com", +"myqnapcloud.com", +"*.quipelements.com", +"vapor.cloud", +"vaporcloud.io", +"rackmaze.com", +"rackmaze.net", +"*.on-k3s.io", +"*.on-rancher.cloud", +"*.on-rio.io", +"readthedocs.io", +"rhcloud.com", +"app.render.com", +"onrender.com", +"repl.co", +"repl.run", +"resindevice.io", +"devices.resinstaging.io", +"hzc.io", +"wellbeingzone.eu", +"ptplus.fit", +"wellbeingzone.co.uk", +"git-pages.rit.edu", +"sandcats.io", +"logoip.de", +"logoip.com", +"schokokeks.net", +"gov.scot", +"scrysec.com", +"firewall-gateway.com", +"firewall-gateway.de", +"my-gateway.de", +"my-router.de", +"spdns.de", +"spdns.eu", +"firewall-gateway.net", +"my-firewall.org", +"myfirewall.org", +"spdns.org", +"senseering.net", +"biz.ua", +"co.ua", +"pp.ua", +"shiftedit.io", +"myshopblocks.com", +"shopitsite.com", +"mo-siemens.io", +"1kapp.com", +"appchizi.com", +"applinzi.com", +"sinaapp.com", +"vipsinaapp.com", +"siteleaf.net", +"bounty-full.com", +"alpha.bounty-full.com", +"beta.bounty-full.com", +"stackhero-network.com", +"static.land", +"dev.static.land", +"sites.static.land", +"apps.lair.io", +"*.stolos.io", +"spacekit.io", +"customer.speedpartner.de", +"api.stdlib.com", +"storj.farm", +"utwente.io", +"soc.srcf.net", +"user.srcf.net", +"temp-dns.com", +"applicationcloud.io", +"scapp.io", +"*.s5y.io", +"*.sensiosite.cloud", +"syncloud.it", +"diskstation.me", +"dscloud.biz", +"dscloud.me", +"dscloud.mobi", +"dsmynas.com", +"dsmynas.net", +"dsmynas.org", +"familyds.com", +"familyds.net", +"familyds.org", +"i234.me", +"myds.me", +"synology.me", +"vpnplus.to", +"direct.quickconnect.to", +"taifun-dns.de", +"gda.pl", +"gdansk.pl", +"gdynia.pl", +"med.pl", +"sopot.pl", +"edugit.org", +"telebit.app", +"telebit.io", +"*.telebit.xyz", +"gwiddle.co.uk", +"thingdustdata.com", +"cust.dev.thingdust.io", +"cust.disrec.thingdust.io", +"cust.prod.thingdust.io", +"cust.testing.thingdust.io", +"arvo.network", +"azimuth.network", +"bloxcms.com", +"townnews-staging.com", +"12hp.at", +"2ix.at", +"4lima.at", +"lima-city.at", +"12hp.ch", +"2ix.ch", +"4lima.ch", +"lima-city.ch", +"trafficplex.cloud", +"de.cool", +"12hp.de", +"2ix.de", +"4lima.de", +"lima-city.de", +"1337.pictures", +"clan.rip", +"lima-city.rocks", +"webspace.rocks", +"lima.zone", +"*.transurl.be", +"*.transurl.eu", +"*.transurl.nl", +"tuxfamily.org", +"dd-dns.de", +"diskstation.eu", +"diskstation.org", +"dray-dns.de", +"draydns.de", +"dyn-vpn.de", +"dynvpn.de", +"mein-vigor.de", +"my-vigor.de", +"my-wan.de", +"syno-ds.de", +"synology-diskstation.de", +"synology-ds.de", +"uber.space", +"*.uberspace.de", +"hk.com", +"hk.org", +"ltd.hk", +"inc.hk", +"virtualuser.de", +"virtual-user.de", +"urown.cloud", +"dnsupdate.info", +"lib.de.us", +"2038.io", +"router.management", +"v-info.info", +"voorloper.cloud", +"v.ua", +"wafflecell.com", +"*.webhare.dev", +"wedeploy.io", +"wedeploy.me", +"wedeploy.sh", +"remotewd.com", +"wmflabs.org", +"myforum.community", +"community-pro.de", +"diskussionsbereich.de", +"community-pro.net", +"meinforum.net", +"half.host", +"xnbay.com", +"u2.xnbay.com", +"u2-local.xnbay.com", +"cistron.nl", +"demon.nl", +"xs4all.space", +"yandexcloud.net", +"storage.yandexcloud.net", +"website.yandexcloud.net", +"official.academy", +"yolasite.com", +"ybo.faith", +"yombo.me", +"homelink.one", +"ybo.party", +"ybo.review", +"ybo.science", +"ybo.trade", +"nohost.me", +"noho.st", +"za.net", +"za.org", +"now.sh", +"bss.design", +"basicserver.io", +"virtualserver.io", +"enterprisecloud.nu" +] \ No newline at end of file diff --git a/deps/npm/node_modules/psl/dist/psl.js b/deps/npm/node_modules/psl/dist/psl.js index 24f5933bd15b44..f4b9b8925bcf3a 100644 --- a/deps/npm/node_modules/psl/dist/psl.js +++ b/deps/npm/node_modules/psl/dist/psl.js @@ -1,5 +1,8838 @@ (function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.psl = f()}})(function(){var define,module,exports;return (function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i= 0x80 (not a basic code point)","invalid-input":"Invalid input"},c=b-y,x=Math.floor,q=String.fromCharCode;function A(a){throw new RangeError(k[a])}function g(a,o){for(var i=a.length,e=[];i--;)e[i]=o(a[i]);return e}function l(a,o){var i=a.split("@"),e="";return 1>>10&1023|55296),a=56320|1023&a),o+=q(a)}).join("")}function L(a,o){return a+22+75*(a<26)-((0!=o)<<5)}function I(a,o,i){var e=0;for(a=i?x(a/t):a>>1,a+=x(a/o);c*f>>1x((d-l)/m))&&A("overflow"),l+=u*m,!(u<(r=t<=j?y:j+f<=t?f:t-j));t+=b)m>x(d/(p=b-r))&&A("overflow"),m*=p;j=I(l-s,o=c.length+1,0==s),x(l/o)>d-h&&A("overflow"),h+=x(l/o),l%=o,c.splice(l++,0,h)}return _(c)}function j(a){var o,i,e,n,s,m,t,u,r,p,k,c,g,l,h,j=[];for(c=(a=O(a)).length,o=w,s=v,m=i=0;mx((d-i)/(g=e+1))&&A("overflow"),i+=(t-o)*g,o=t,m=0;md&&A("overflow"),k==o){for(u=i,r=b;!(u<(p=r<=s?y:s+f<=r?f:r-s));r+=b)h=u-p,l=b-p,j.push(q(L(p+h%l,0))),u=x(h/l);j.push(q(L(u,0))),s=I(i,g,e==n),i=0,++e}++i,++o}return j.join("")}if(n={version:"1.4.1",ucs2:{decode:O,encode:_},decode:h,encode:j,toASCII:function(a){return l(a,function(a){return r.test(a)?"xn--"+j(a):a})},toUnicode:function(a){return l(a,function(a){return u.test(a)?h(a.slice(4).toLowerCase()):a})}},o&&i)if(T.exports==o)i.exports=n;else for(s in n)n.hasOwnProperty(s)&&(o[s]=n[s]);else a.punycode=n}(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}]},{},[2])(2)}); +!function(a){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=a();else if("function"==typeof define&&define.amd)define([],a);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).psl=a()}}(function(){return function s(m,t,u){function r(o,a){if(!t[o]){if(!m[o]){var i="function"==typeof require&&require;if(!a&&i)return i(o,!0);if(p)return p(o,!0);var e=new Error("Cannot find module '"+o+"'");throw e.code="MODULE_NOT_FOUND",e}var n=t[o]={exports:{}};m[o][0].call(n.exports,function(a){return r(m[o][1][a]||a)},n,n.exports,s,m,t,u)}return t[o].exports}for(var p="function"==typeof require&&require,a=0;a= 0x80 (not a basic code point)","invalid-input":"Invalid input"},c=b-y,x=Math.floor,q=String.fromCharCode;function A(a){throw new RangeError(k[a])}function l(a,o){for(var i=a.length,e=[];i--;)e[i]=o(a[i]);return e}function g(a,o){var i=a.split("@"),e="";return 1>>10&1023|55296),a=56320|1023&a),o+=q(a)}).join("")}function L(a,o){return a+22+75*(a<26)-((0!=o)<<5)}function I(a,o,i){var e=0;for(a=i?x(a/t):a>>1,a+=x(a/o);c*f>>1x((d-g)/m))&&A("overflow"),g+=u*m,!(u<(r=t<=j?y:j+f<=t?f:t-j));t+=b)m>x(d/(p=b-r))&&A("overflow"),m*=p;j=I(g-s,o=c.length+1,0==s),x(g/o)>d-h&&A("overflow"),h+=x(g/o),g%=o,c.splice(g++,0,h)}return _(c)}function j(a){var o,i,e,n,s,m,t,u,r,p,k,c,l,g,h,j=[];for(c=(a=O(a)).length,o=w,s=v,m=i=0;mx((d-i)/(l=e+1))&&A("overflow"),i+=(t-o)*l,o=t,m=0;md&&A("overflow"),k==o){for(u=i,r=b;!(u<(p=r<=s?y:s+f<=r?f:r-s));r+=b)h=u-p,g=b-p,j.push(q(L(p+h%g,0))),u=x(h/g);j.push(q(L(u,0))),s=I(i,l,e==n),i=0,++e}++i,++o}return j.join("")}if(n={version:"1.4.1",ucs2:{decode:O,encode:_},decode:h,encode:j,toASCII:function(a){return g(a,function(a){return r.test(a)?"xn--"+j(a):a})},toUnicode:function(a){return g(a,function(a){return u.test(a)?h(a.slice(4).toLowerCase()):a})}},0,o&&i)if(T.exports==o)i.exports=n;else for(s in n)n.hasOwnProperty(s)&&(o[s]=n[s]);else a.punycode=n}(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}]},{},[2])(2)}); diff --git a/deps/npm/node_modules/psl/karma.conf.js b/deps/npm/node_modules/psl/karma.conf.js deleted file mode 100644 index f5b99819c79032..00000000000000 --- a/deps/npm/node_modules/psl/karma.conf.js +++ /dev/null @@ -1,38 +0,0 @@ -'use strict'; - - -module.exports = function (config) { - - config.set({ - - browsers: ['PhantomJS'], - - frameworks: ['browserify', 'mocha'], - - files: [ - 'test/**/*.spec.js' - ], - - preprocessors: { - 'test/**/*.spec.js': ['browserify'] - }, - - reporters: ['mocha'], - - client: { - mocha: { - reporter: 'tap' - } - }, - - plugins: [ - 'karma-browserify', - 'karma-mocha', - 'karma-mocha-reporter', - 'karma-phantomjs-launcher' - ] - - }); - -}; - diff --git a/deps/npm/node_modules/psl/package.json b/deps/npm/node_modules/psl/package.json index f18f9348c19e0f..ee2da19fa2d628 100644 --- a/deps/npm/node_modules/psl/package.json +++ b/deps/npm/node_modules/psl/package.json @@ -1,73 +1,44 @@ { - "_from": "psl@^1.1.24", - "_id": "psl@1.1.29", - "_inBundle": false, - "_integrity": "sha512-AeUmQ0oLN02flVHXWh9sSJF7mcdFq0ppid/JkErufc3hGIV/AMa8Fo9VgDo/cT2jFdOWoFvHp90qqBH54W+gjQ==", - "_location": "/psl", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "psl@^1.1.24", - "name": "psl", - "escapedName": "psl", - "rawSpec": "^1.1.24", - "saveSpec": null, - "fetchSpec": "^1.1.24" - }, - "_requiredBy": [ - "/request/tough-cookie" - ], - "_resolved": "https://registry.npmjs.org/psl/-/psl-1.1.29.tgz", - "_shasum": "60f580d360170bb722a797cc704411e6da850c67", - "_spec": "psl@^1.1.24", - "_where": "/Users/zkat/Documents/code/work/npm/node_modules/request/node_modules/tough-cookie", - "author": { - "name": "Lupo Montero" + "name": "psl", + "version": "1.8.0", + "description": "Domain name parser based on the Public Suffix List", + "repository": { + "type": "git", + "url": "git@github.com:lupomontero/psl.git" }, - "bugs": { - "url": "https://github.com/wrangr/psl/issues" + "main": "index.js", + "scripts": { + "pretest": "eslint .", + "test": "mocha test && karma start ./karma.conf.js --single-run", + "watch": "mocha test --watch", + "prebuild": "./scripts/update-rules.js", + "build": "browserify ./index.js --standalone=psl > ./dist/psl.js", + "postbuild": "cat ./dist/psl.js | uglifyjs -c -m > ./dist/psl.min.js", + "commit-and-pr": "commit-and-pr", + "changelog": "git log $(git describe --tags --abbrev=0)..HEAD --oneline --format=\"%h %s (%an <%ae>)\"" }, - "bundleDependencies": false, - "deprecated": false, - "description": "Domain name parser based on the Public Suffix List", + "keywords": [ + "publicsuffix", + "publicsuffixlist" + ], + "author": "Lupo Montero (https://lupomontero.com/)", + "license": "MIT", "devDependencies": { - "JSONStream": "^1.3.3", - "browserify": "^16.2.2", - "eslint": "^5.2.0", + "JSONStream": "^1.3.5", + "browserify": "^16.5.0", + "commit-and-pr": "^1.0.4", + "eslint": "^6.8.0", "eslint-config-hapi": "^12.0.0", "eslint-plugin-hapi": "^4.1.0", - "event-stream": "^3.3.4", - "karma": "^2.0.5", - "karma-browserify": "^5.3.0", + "karma": "^4.4.1", + "karma-browserify": "^7.0.0", "karma-mocha": "^1.3.0", "karma-mocha-reporter": "^2.2.5", "karma-phantomjs-launcher": "^1.0.4", - "mocha": "^5.2.0", + "mocha": "^7.1.1", "phantomjs-prebuilt": "^2.1.16", - "request": "^2.87.0", - "uglify-js": "^3.4.6", - "watchify": "^3.11.0" - }, - "homepage": "https://github.com/wrangr/psl#readme", - "keywords": [ - "publicsuffix", - "publicsuffixlist" - ], - "license": "MIT", - "main": "index.js", - "name": "psl", - "repository": { - "type": "git", - "url": "git+ssh://git@github.com/wrangr/psl.git" - }, - "scripts": { - "build": "browserify ./index.js --standalone=psl > ./dist/psl.js", - "postbuild": "cat ./dist/psl.js | uglifyjs -c -m > ./dist/psl.min.js", - "prebuild": "node ./data/build.js", - "pretest": "eslint .", - "test": "mocha test && karma start ./karma.conf.js --single-run", - "watch": "mocha test --watch" - }, - "version": "1.1.29" + "request": "^2.88.2", + "uglify-js": "^3.8.0", + "watchify": "^3.11.1" + } } diff --git a/deps/npm/node_modules/psl/yarn.lock b/deps/npm/node_modules/psl/yarn.lock deleted file mode 100644 index 8735efe995a617..00000000000000 --- a/deps/npm/node_modules/psl/yarn.lock +++ /dev/null @@ -1,4532 +0,0 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. -# yarn lockfile v1 - - -JSONStream@^1.0.3: - version "1.3.2" - resolved "https://registry.yarnpkg.com/JSONStream/-/JSONStream-1.3.2.tgz#c102371b6ec3a7cf3b847ca00c20bb0fce4c6dea" - dependencies: - jsonparse "^1.2.0" - through ">=2.2.7 <3" - -JSONStream@^1.3.3: - version "1.3.3" - resolved "https://registry.yarnpkg.com/JSONStream/-/JSONStream-1.3.3.tgz#27b4b8fbbfeab4e71bcf551e7f27be8d952239bf" - dependencies: - jsonparse "^1.2.0" - through ">=2.2.7 <3" - -abbrev@1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/abbrev/-/abbrev-1.1.1.tgz#f8f2c887ad10bf67f634f005b6987fed3179aac8" - -accepts@~1.3.4: - version "1.3.5" - resolved "https://registry.yarnpkg.com/accepts/-/accepts-1.3.5.tgz#eb777df6011723a3b14e8a72c0805c8e86746bd2" - dependencies: - mime-types "~2.1.18" - negotiator "0.6.1" - -acorn-jsx@^4.1.1: - version "4.1.1" - resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-4.1.1.tgz#e8e41e48ea2fe0c896740610ab6a4ffd8add225e" - dependencies: - acorn "^5.0.3" - -acorn-node@^1.2.0, acorn-node@^1.3.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/acorn-node/-/acorn-node-1.3.0.tgz#5f86d73346743810ef1269b901dbcbded020861b" - dependencies: - acorn "^5.4.1" - xtend "^4.0.1" - -acorn@^4.0.3: - version "4.0.13" - resolved "https://registry.yarnpkg.com/acorn/-/acorn-4.0.13.tgz#105495ae5361d697bd195c825192e1ad7f253787" - -acorn@^5.0.3, acorn@^5.6.0: - version "5.7.1" - resolved "https://registry.yarnpkg.com/acorn/-/acorn-5.7.1.tgz#f095829297706a7c9776958c0afc8930a9b9d9d8" - -acorn@^5.4.1: - version "5.5.3" - resolved "https://registry.yarnpkg.com/acorn/-/acorn-5.5.3.tgz#f473dd47e0277a08e28e9bec5aeeb04751f0b8c9" - -addressparser@1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/addressparser/-/addressparser-1.0.1.tgz#47afbe1a2a9262191db6838e4fd1d39b40821746" - -after@0.8.2: - version "0.8.2" - resolved "https://registry.yarnpkg.com/after/-/after-0.8.2.tgz#fedb394f9f0e02aa9768e702bda23b505fae7e1f" - -agent-base@4, agent-base@^4.1.0, agent-base@^4.2.0, agent-base@~4.2.0: - version "4.2.1" - resolved "https://registry.yarnpkg.com/agent-base/-/agent-base-4.2.1.tgz#d89e5999f797875674c07d87f260fc41e83e8ca9" - dependencies: - es6-promisify "^5.0.0" - -ajv-keywords@^3.0.0: - version "3.2.0" - resolved "https://registry.yarnpkg.com/ajv-keywords/-/ajv-keywords-3.2.0.tgz#e86b819c602cf8821ad637413698f1dec021847a" - -ajv@^5.1.0: - version "5.5.2" - resolved "https://registry.yarnpkg.com/ajv/-/ajv-5.5.2.tgz#73b5eeca3fab653e3d3f9422b341ad42205dc965" - dependencies: - co "^4.6.0" - fast-deep-equal "^1.0.0" - fast-json-stable-stringify "^2.0.0" - json-schema-traverse "^0.3.0" - -ajv@^6.0.1, ajv@^6.5.0: - version "6.5.2" - resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.5.2.tgz#678495f9b82f7cca6be248dd92f59bff5e1f4360" - dependencies: - fast-deep-equal "^2.0.1" - fast-json-stable-stringify "^2.0.0" - json-schema-traverse "^0.4.1" - uri-js "^4.2.1" - -amqplib@^0.5.2: - version "0.5.2" - resolved "https://registry.yarnpkg.com/amqplib/-/amqplib-0.5.2.tgz#d2d7313c7ffaa4d10bcf1e6252de4591b6cc7b63" - dependencies: - bitsyntax "~0.0.4" - bluebird "^3.4.6" - buffer-more-ints "0.0.2" - readable-stream "1.x >=1.1.9" - safe-buffer "^5.0.1" - -ansi-escapes@^3.0.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-3.1.0.tgz#f73207bb81207d75fd6c83f125af26eea378ca30" - -ansi-regex@^2.0.0: - version "2.1.1" - resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df" - -ansi-regex@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-3.0.0.tgz#ed0317c322064f79466c02966bddb605ab37d998" - -ansi-styles@^2.2.1: - version "2.2.1" - resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-2.2.1.tgz#b432dd3358b634cf75e1e4664368240533c1ddbe" - -ansi-styles@^3.2.1: - version "3.2.1" - resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d" - dependencies: - color-convert "^1.9.0" - -anymatch@^1.3.0: - version "1.3.2" - resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-1.3.2.tgz#553dcb8f91e3c889845dfdba34c77721b90b9d7a" - dependencies: - micromatch "^2.1.5" - normalize-path "^2.0.0" - -anymatch@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-2.0.0.tgz#bcb24b4f37934d9aa7ac17b4adaf89e7c76ef2eb" - dependencies: - micromatch "^3.1.4" - normalize-path "^2.1.1" - -aproba@^1.0.3: - version "1.2.0" - resolved "https://registry.yarnpkg.com/aproba/-/aproba-1.2.0.tgz#6802e6264efd18c790a1b0d517f0f2627bf2c94a" - -are-we-there-yet@~1.1.2: - version "1.1.4" - resolved "https://registry.yarnpkg.com/are-we-there-yet/-/are-we-there-yet-1.1.4.tgz#bb5dca382bb94f05e15194373d16fd3ba1ca110d" - dependencies: - delegates "^1.0.0" - readable-stream "^2.0.6" - -argparse@^1.0.7: - version "1.0.10" - resolved "https://registry.yarnpkg.com/argparse/-/argparse-1.0.10.tgz#bcd6791ea5ae09725e17e5ad988134cd40b3d911" - dependencies: - sprintf-js "~1.0.2" - -arr-diff@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/arr-diff/-/arr-diff-2.0.0.tgz#8f3b827f955a8bd669697e4a4256ac3ceae356cf" - dependencies: - arr-flatten "^1.0.1" - -arr-diff@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/arr-diff/-/arr-diff-4.0.0.tgz#d6461074febfec71e7e15235761a329a5dc7c520" - -arr-flatten@^1.0.1, arr-flatten@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/arr-flatten/-/arr-flatten-1.1.0.tgz#36048bbff4e7b47e136644316c99669ea5ae91f1" - -arr-union@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/arr-union/-/arr-union-3.1.0.tgz#e39b09aea9def866a8f206e288af63919bae39c4" - -array-filter@~0.0.0: - version "0.0.1" - resolved "https://registry.yarnpkg.com/array-filter/-/array-filter-0.0.1.tgz#7da8cf2e26628ed732803581fd21f67cacd2eeec" - -array-map@~0.0.0: - version "0.0.0" - resolved "https://registry.yarnpkg.com/array-map/-/array-map-0.0.0.tgz#88a2bab73d1cf7bcd5c1b118a003f66f665fa662" - -array-reduce@~0.0.0: - version "0.0.0" - resolved "https://registry.yarnpkg.com/array-reduce/-/array-reduce-0.0.0.tgz#173899d3ffd1c7d9383e4479525dbe278cab5f2b" - -array-slice@^0.2.3: - version "0.2.3" - resolved "https://registry.yarnpkg.com/array-slice/-/array-slice-0.2.3.tgz#dd3cfb80ed7973a75117cdac69b0b99ec86186f5" - -array-union@^1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/array-union/-/array-union-1.0.2.tgz#9a34410e4f4e3da23dea375be5be70f24778ec39" - dependencies: - array-uniq "^1.0.1" - -array-uniq@^1.0.1: - version "1.0.3" - resolved "https://registry.yarnpkg.com/array-uniq/-/array-uniq-1.0.3.tgz#af6ac877a25cc7f74e058894753858dfdb24fdb6" - -array-unique@^0.2.1: - version "0.2.1" - resolved "https://registry.yarnpkg.com/array-unique/-/array-unique-0.2.1.tgz#a1d97ccafcbc2625cc70fadceb36a50c58b01a53" - -array-unique@^0.3.2: - version "0.3.2" - resolved "https://registry.yarnpkg.com/array-unique/-/array-unique-0.3.2.tgz#a894b75d4bc4f6cd679ef3244a9fd8f46ae2d428" - -arraybuffer.slice@~0.0.7: - version "0.0.7" - resolved "https://registry.yarnpkg.com/arraybuffer.slice/-/arraybuffer.slice-0.0.7.tgz#3bbc4275dd584cc1b10809b89d4e8b63a69e7675" - -arrify@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/arrify/-/arrify-1.0.1.tgz#898508da2226f380df904728456849c1501a4b0d" - -asn1.js@^4.0.0: - version "4.10.1" - resolved "https://registry.yarnpkg.com/asn1.js/-/asn1.js-4.10.1.tgz#b9c2bf5805f1e64aadeed6df3a2bfafb5a73f5a0" - dependencies: - bn.js "^4.0.0" - inherits "^2.0.1" - minimalistic-assert "^1.0.0" - -asn1@~0.2.3: - version "0.2.3" - resolved "https://registry.yarnpkg.com/asn1/-/asn1-0.2.3.tgz#dac8787713c9966849fc8180777ebe9c1ddf3b86" - -assert-plus@1.0.0, assert-plus@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/assert-plus/-/assert-plus-1.0.0.tgz#f12e0f3c5d77b0b1cdd9146942e4e96c1e4dd525" - -assert-plus@^0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/assert-plus/-/assert-plus-0.2.0.tgz#d74e1b87e7affc0db8aadb7021f3fe48101ab234" - -assert@^1.4.0: - version "1.4.1" - resolved "https://registry.yarnpkg.com/assert/-/assert-1.4.1.tgz#99912d591836b5a6f5b345c0f07eefc08fc65d91" - dependencies: - util "0.10.3" - -assign-symbols@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/assign-symbols/-/assign-symbols-1.0.0.tgz#59667f41fadd4f20ccbc2bb96b8d4f7f78ec0367" - -ast-types@0.x.x: - version "0.11.3" - resolved "https://registry.yarnpkg.com/ast-types/-/ast-types-0.11.3.tgz#c20757fe72ee71278ea0ff3d87e5c2ca30d9edf8" - -astw@^2.0.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/astw/-/astw-2.2.0.tgz#7bd41784d32493987aeb239b6b4e1c57a873b917" - dependencies: - acorn "^4.0.3" - -async-each@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/async-each/-/async-each-1.0.1.tgz#19d386a1d9edc6e7c1c85d388aedbcc56d33602d" - -async-limiter@~1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/async-limiter/-/async-limiter-1.0.0.tgz#78faed8c3d074ab81f22b4e985d79e8738f720f8" - -async@~2.6.0: - version "2.6.1" - resolved "https://registry.yarnpkg.com/async/-/async-2.6.1.tgz#b245a23ca71930044ec53fa46aa00a3e87c6a610" - dependencies: - lodash "^4.17.10" - -asynckit@^0.4.0: - version "0.4.0" - resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" - -atob@^2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/atob/-/atob-2.1.1.tgz#ae2d5a729477f289d60dd7f96a6314a22dd6c22a" - -aws-sign2@~0.6.0: - version "0.6.0" - resolved "https://registry.yarnpkg.com/aws-sign2/-/aws-sign2-0.6.0.tgz#14342dd38dbcc94d0e5b87d763cd63612c0e794f" - -aws-sign2@~0.7.0: - version "0.7.0" - resolved "https://registry.yarnpkg.com/aws-sign2/-/aws-sign2-0.7.0.tgz#b46e890934a9591f2d2f6f86d7e6a9f1b3fe76a8" - -aws4@^1.2.1, aws4@^1.6.0: - version "1.7.0" - resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.7.0.tgz#d4d0e9b9dbfca77bf08eeb0a8a471550fe39e289" - -axios@^0.15.3: - version "0.15.3" - resolved "https://registry.yarnpkg.com/axios/-/axios-0.15.3.tgz#2c9d638b2e191a08ea1d6cc988eadd6ba5bdc053" - dependencies: - follow-redirects "1.0.0" - -babel-code-frame@^6.26.0: - version "6.26.0" - resolved "https://registry.yarnpkg.com/babel-code-frame/-/babel-code-frame-6.26.0.tgz#63fd43f7dc1e3bb7ce35947db8fe369a3f58c74b" - dependencies: - chalk "^1.1.3" - esutils "^2.0.2" - js-tokens "^3.0.2" - -backo2@1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/backo2/-/backo2-1.0.2.tgz#31ab1ac8b129363463e35b3ebb69f4dfcfba7947" - -balanced-match@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767" - -base64-arraybuffer@0.1.5: - version "0.1.5" - resolved "https://registry.yarnpkg.com/base64-arraybuffer/-/base64-arraybuffer-0.1.5.tgz#73926771923b5a19747ad666aa5cd4bf9c6e9ce8" - -base64-js@^1.0.2: - version "1.3.0" - resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.3.0.tgz#cab1e6118f051095e58b5281aea8c1cd22bfc0e3" - -base64id@1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/base64id/-/base64id-1.0.0.tgz#47688cb99bb6804f0e06d3e763b1c32e57d8e6b6" - -base@^0.11.1: - version "0.11.2" - resolved "https://registry.yarnpkg.com/base/-/base-0.11.2.tgz#7bde5ced145b6d551a90db87f83c558b4eb48a8f" - dependencies: - cache-base "^1.0.1" - class-utils "^0.3.5" - component-emitter "^1.2.1" - define-property "^1.0.0" - isobject "^3.0.1" - mixin-deep "^1.2.0" - pascalcase "^0.1.1" - -bcrypt-pbkdf@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.1.tgz#63bc5dcb61331b92bc05fd528953c33462a06f8d" - dependencies: - tweetnacl "^0.14.3" - -better-assert@~1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/better-assert/-/better-assert-1.0.2.tgz#40866b9e1b9e0b55b481894311e68faffaebc522" - dependencies: - callsite "1.0.0" - -binary-extensions@^1.0.0: - version "1.11.0" - resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-1.11.0.tgz#46aa1751fb6a2f93ee5e689bb1087d4b14c6c205" - -bitsyntax@~0.0.4: - version "0.0.4" - resolved "https://registry.yarnpkg.com/bitsyntax/-/bitsyntax-0.0.4.tgz#eb10cc6f82b8c490e3e85698f07e83d46e0cba82" - dependencies: - buffer-more-ints "0.0.2" - -bl@~1.1.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/bl/-/bl-1.1.2.tgz#fdca871a99713aa00d19e3bbba41c44787a65398" - dependencies: - readable-stream "~2.0.5" - -blob@0.0.4: - version "0.0.4" - resolved "https://registry.yarnpkg.com/blob/-/blob-0.0.4.tgz#bcf13052ca54463f30f9fc7e95b9a47630a94921" - -bluebird@^3.3.0, bluebird@^3.4.6: - version "3.5.1" - resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-3.5.1.tgz#d9551f9de98f1fcda1e683d17ee91a0602ee2eb9" - -bn.js@^4.0.0, bn.js@^4.1.0, bn.js@^4.1.1, bn.js@^4.4.0: - version "4.11.8" - resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-4.11.8.tgz#2cde09eb5ee341f484746bb0309b3253b1b1442f" - -body-parser@^1.16.1: - version "1.18.2" - resolved "https://registry.yarnpkg.com/body-parser/-/body-parser-1.18.2.tgz#87678a19d84b47d859b83199bd59bce222b10454" - dependencies: - bytes "3.0.0" - content-type "~1.0.4" - debug "2.6.9" - depd "~1.1.1" - http-errors "~1.6.2" - iconv-lite "0.4.19" - on-finished "~2.3.0" - qs "6.5.1" - raw-body "2.3.2" - type-is "~1.6.15" - -boom@2.x.x: - version "2.10.1" - resolved "https://registry.yarnpkg.com/boom/-/boom-2.10.1.tgz#39c8918ceff5799f83f9492a848f625add0c766f" - dependencies: - hoek "2.x.x" - -boom@4.x.x: - version "4.3.1" - resolved "https://registry.yarnpkg.com/boom/-/boom-4.3.1.tgz#4f8a3005cb4a7e3889f749030fd25b96e01d2e31" - dependencies: - hoek "4.x.x" - -boom@5.x.x: - version "5.2.0" - resolved "https://registry.yarnpkg.com/boom/-/boom-5.2.0.tgz#5dd9da6ee3a5f302077436290cb717d3f4a54e02" - dependencies: - hoek "4.x.x" - -brace-expansion@^1.1.7: - version "1.1.11" - resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" - dependencies: - balanced-match "^1.0.0" - concat-map "0.0.1" - -braces@^0.1.2: - version "0.1.5" - resolved "https://registry.yarnpkg.com/braces/-/braces-0.1.5.tgz#c085711085291d8b75fdd74eab0f8597280711e6" - dependencies: - expand-range "^0.1.0" - -braces@^1.8.2: - version "1.8.5" - resolved "https://registry.yarnpkg.com/braces/-/braces-1.8.5.tgz#ba77962e12dff969d6b76711e914b737857bf6a7" - dependencies: - expand-range "^1.8.1" - preserve "^0.2.0" - repeat-element "^1.1.2" - -braces@^2.3.0, braces@^2.3.1: - version "2.3.2" - resolved "https://registry.yarnpkg.com/braces/-/braces-2.3.2.tgz#5979fd3f14cd531565e5fa2df1abfff1dfaee729" - dependencies: - arr-flatten "^1.1.0" - array-unique "^0.3.2" - extend-shallow "^2.0.1" - fill-range "^4.0.0" - isobject "^3.0.1" - repeat-element "^1.1.2" - snapdragon "^0.8.1" - snapdragon-node "^2.0.1" - split-string "^3.0.2" - to-regex "^3.0.1" - -brorand@^1.0.1: - version "1.1.0" - resolved "https://registry.yarnpkg.com/brorand/-/brorand-1.1.0.tgz#12c25efe40a45e3c323eb8675a0a0ce57b22371f" - -browser-pack@^6.0.1: - version "6.1.0" - resolved "https://registry.yarnpkg.com/browser-pack/-/browser-pack-6.1.0.tgz#c34ba10d0b9ce162b5af227c7131c92c2ecd5774" - dependencies: - JSONStream "^1.0.3" - combine-source-map "~0.8.0" - defined "^1.0.0" - safe-buffer "^5.1.1" - through2 "^2.0.0" - umd "^3.0.0" - -browser-resolve@^1.11.0, browser-resolve@^1.7.0: - version "1.11.2" - resolved "https://registry.yarnpkg.com/browser-resolve/-/browser-resolve-1.11.2.tgz#8ff09b0a2c421718a1051c260b32e48f442938ce" - dependencies: - resolve "1.1.7" - -browser-stdout@1.3.1: - version "1.3.1" - resolved "https://registry.yarnpkg.com/browser-stdout/-/browser-stdout-1.3.1.tgz#baa559ee14ced73452229bad7326467c61fabd60" - -browserify-aes@^1.0.0, browserify-aes@^1.0.4: - version "1.2.0" - resolved "https://registry.yarnpkg.com/browserify-aes/-/browserify-aes-1.2.0.tgz#326734642f403dabc3003209853bb70ad428ef48" - dependencies: - buffer-xor "^1.0.3" - cipher-base "^1.0.0" - create-hash "^1.1.0" - evp_bytestokey "^1.0.3" - inherits "^2.0.1" - safe-buffer "^5.0.1" - -browserify-cipher@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/browserify-cipher/-/browserify-cipher-1.0.1.tgz#8d6474c1b870bfdabcd3bcfcc1934a10e94f15f0" - dependencies: - browserify-aes "^1.0.4" - browserify-des "^1.0.0" - evp_bytestokey "^1.0.0" - -browserify-des@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/browserify-des/-/browserify-des-1.0.1.tgz#3343124db6d7ad53e26a8826318712bdc8450f9c" - dependencies: - cipher-base "^1.0.1" - des.js "^1.0.0" - inherits "^2.0.1" - -browserify-rsa@^4.0.0: - version "4.0.1" - resolved "https://registry.yarnpkg.com/browserify-rsa/-/browserify-rsa-4.0.1.tgz#21e0abfaf6f2029cf2fafb133567a701d4135524" - dependencies: - bn.js "^4.1.0" - randombytes "^2.0.1" - -browserify-sign@^4.0.0: - version "4.0.4" - resolved "https://registry.yarnpkg.com/browserify-sign/-/browserify-sign-4.0.4.tgz#aa4eb68e5d7b658baa6bf6a57e630cbd7a93d298" - dependencies: - bn.js "^4.1.1" - browserify-rsa "^4.0.0" - create-hash "^1.1.0" - create-hmac "^1.1.2" - elliptic "^6.0.0" - inherits "^2.0.1" - parse-asn1 "^5.0.0" - -browserify-zlib@~0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/browserify-zlib/-/browserify-zlib-0.2.0.tgz#2869459d9aa3be245fe8fe2ca1f46e2e7f54d73f" - dependencies: - pako "~1.0.5" - -browserify@^16.1.0: - version "16.2.0" - resolved "https://registry.yarnpkg.com/browserify/-/browserify-16.2.0.tgz#04ba47c4150555532978453818160666aa3bd8a7" - dependencies: - JSONStream "^1.0.3" - assert "^1.4.0" - browser-pack "^6.0.1" - browser-resolve "^1.11.0" - browserify-zlib "~0.2.0" - buffer "^5.0.2" - cached-path-relative "^1.0.0" - concat-stream "^1.6.0" - console-browserify "^1.1.0" - constants-browserify "~1.0.0" - crypto-browserify "^3.0.0" - defined "^1.0.0" - deps-sort "^2.0.0" - domain-browser "^1.2.0" - duplexer2 "~0.1.2" - events "^2.0.0" - glob "^7.1.0" - has "^1.0.0" - htmlescape "^1.1.0" - https-browserify "^1.0.0" - inherits "~2.0.1" - insert-module-globals "^7.0.0" - labeled-stream-splicer "^2.0.0" - mkdirp "^0.5.0" - module-deps "^6.0.0" - os-browserify "~0.3.0" - parents "^1.0.1" - path-browserify "~0.0.0" - process "~0.11.0" - punycode "^1.3.2" - querystring-es3 "~0.2.0" - read-only-stream "^2.0.0" - readable-stream "^2.0.2" - resolve "^1.1.4" - shasum "^1.0.0" - shell-quote "^1.6.1" - stream-browserify "^2.0.0" - stream-http "^2.0.0" - string_decoder "^1.1.1" - subarg "^1.0.0" - syntax-error "^1.1.1" - through2 "^2.0.0" - timers-browserify "^1.0.1" - tty-browserify "0.0.1" - url "~0.11.0" - util "~0.10.1" - vm-browserify "^1.0.0" - xtend "^4.0.0" - -browserify@^16.2.2: - version "16.2.2" - resolved "https://registry.yarnpkg.com/browserify/-/browserify-16.2.2.tgz#4b1f66ba0e54fa39dbc5aa4be9629142143d91b0" - dependencies: - JSONStream "^1.0.3" - assert "^1.4.0" - browser-pack "^6.0.1" - browser-resolve "^1.11.0" - browserify-zlib "~0.2.0" - buffer "^5.0.2" - cached-path-relative "^1.0.0" - concat-stream "^1.6.0" - console-browserify "^1.1.0" - constants-browserify "~1.0.0" - crypto-browserify "^3.0.0" - defined "^1.0.0" - deps-sort "^2.0.0" - domain-browser "^1.2.0" - duplexer2 "~0.1.2" - events "^2.0.0" - glob "^7.1.0" - has "^1.0.0" - htmlescape "^1.1.0" - https-browserify "^1.0.0" - inherits "~2.0.1" - insert-module-globals "^7.0.0" - labeled-stream-splicer "^2.0.0" - mkdirp "^0.5.0" - module-deps "^6.0.0" - os-browserify "~0.3.0" - parents "^1.0.1" - path-browserify "~0.0.0" - process "~0.11.0" - punycode "^1.3.2" - querystring-es3 "~0.2.0" - read-only-stream "^2.0.0" - readable-stream "^2.0.2" - resolve "^1.1.4" - shasum "^1.0.0" - shell-quote "^1.6.1" - stream-browserify "^2.0.0" - stream-http "^2.0.0" - string_decoder "^1.1.1" - subarg "^1.0.0" - syntax-error "^1.1.1" - through2 "^2.0.0" - timers-browserify "^1.0.1" - tty-browserify "0.0.1" - url "~0.11.0" - util "~0.10.1" - vm-browserify "^1.0.0" - xtend "^4.0.0" - -buffer-from@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.0.0.tgz#4cb8832d23612589b0406e9e2956c17f06fdf531" - -buffer-more-ints@0.0.2: - version "0.0.2" - resolved "https://registry.yarnpkg.com/buffer-more-ints/-/buffer-more-ints-0.0.2.tgz#26b3885d10fa13db7fc01aae3aab870199e0124c" - -buffer-xor@^1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/buffer-xor/-/buffer-xor-1.0.3.tgz#26e61ed1422fb70dd42e6e36729ed51d855fe8d9" - -buffer@^5.0.2: - version "5.1.0" - resolved "https://registry.yarnpkg.com/buffer/-/buffer-5.1.0.tgz#c913e43678c7cb7c8bd16afbcddb6c5505e8f9fe" - dependencies: - base64-js "^1.0.2" - ieee754 "^1.1.4" - -buildmail@4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/buildmail/-/buildmail-4.0.1.tgz#877f7738b78729871c9a105e3b837d2be11a7a72" - dependencies: - addressparser "1.0.1" - libbase64 "0.1.0" - libmime "3.0.0" - libqp "1.1.0" - nodemailer-fetch "1.6.0" - nodemailer-shared "1.1.0" - punycode "1.4.1" - -builtin-status-codes@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/builtin-status-codes/-/builtin-status-codes-3.0.0.tgz#85982878e21b98e1c66425e03d0174788f569ee8" - -bytes@3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/bytes/-/bytes-3.0.0.tgz#d32815404d689699f85a4ea4fa8755dd13a96048" - -cache-base@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/cache-base/-/cache-base-1.0.1.tgz#0a7f46416831c8b662ee36fe4e7c59d76f666ab2" - dependencies: - collection-visit "^1.0.0" - component-emitter "^1.2.1" - get-value "^2.0.6" - has-value "^1.0.0" - isobject "^3.0.1" - set-value "^2.0.0" - to-object-path "^0.3.0" - union-value "^1.0.0" - unset-value "^1.0.0" - -cached-path-relative@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/cached-path-relative/-/cached-path-relative-1.0.1.tgz#d09c4b52800aa4c078e2dd81a869aac90d2e54e7" - -caller-path@^0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/caller-path/-/caller-path-0.1.0.tgz#94085ef63581ecd3daa92444a8fe94e82577751f" - dependencies: - callsites "^0.2.0" - -callsite@1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/callsite/-/callsite-1.0.0.tgz#280398e5d664bd74038b6f0905153e6e8af1bc20" - -callsites@^0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/callsites/-/callsites-0.2.0.tgz#afab96262910a7f33c19a5775825c69f34e350ca" - -caseless@~0.11.0: - version "0.11.0" - resolved "https://registry.yarnpkg.com/caseless/-/caseless-0.11.0.tgz#715b96ea9841593cc33067923f5ec60ebda4f7d7" - -caseless@~0.12.0: - version "0.12.0" - resolved "https://registry.yarnpkg.com/caseless/-/caseless-0.12.0.tgz#1b681c21ff84033c826543090689420d187151dc" - -chalk@^1.1.1, chalk@^1.1.3: - version "1.1.3" - resolved "https://registry.yarnpkg.com/chalk/-/chalk-1.1.3.tgz#a8115c55e4a702fe4d150abd3872822a7e09fc98" - dependencies: - ansi-styles "^2.2.1" - escape-string-regexp "^1.0.2" - has-ansi "^2.0.0" - strip-ansi "^3.0.0" - supports-color "^2.0.0" - -chalk@^2.0.0, chalk@^2.0.1, chalk@^2.1.0: - version "2.4.1" - resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.1.tgz#18c49ab16a037b6eb0152cc83e3471338215b66e" - dependencies: - ansi-styles "^3.2.1" - escape-string-regexp "^1.0.5" - supports-color "^5.3.0" - -chardet@^0.4.0: - version "0.4.2" - resolved "https://registry.yarnpkg.com/chardet/-/chardet-0.4.2.tgz#b5473b33dc97c424e5d98dc87d55d4d8a29c8bf2" - -chokidar@^1.0.0: - version "1.7.0" - resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-1.7.0.tgz#798e689778151c8076b4b360e5edd28cda2bb468" - dependencies: - anymatch "^1.3.0" - async-each "^1.0.0" - glob-parent "^2.0.0" - inherits "^2.0.1" - is-binary-path "^1.0.0" - is-glob "^2.0.0" - path-is-absolute "^1.0.0" - readdirp "^2.0.0" - optionalDependencies: - fsevents "^1.0.0" - -chokidar@^2.0.3: - version "2.0.4" - resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-2.0.4.tgz#356ff4e2b0e8e43e322d18a372460bbcf3accd26" - dependencies: - anymatch "^2.0.0" - async-each "^1.0.0" - braces "^2.3.0" - glob-parent "^3.1.0" - inherits "^2.0.1" - is-binary-path "^1.0.0" - is-glob "^4.0.0" - lodash.debounce "^4.0.8" - normalize-path "^2.1.1" - path-is-absolute "^1.0.0" - readdirp "^2.0.0" - upath "^1.0.5" - optionalDependencies: - fsevents "^1.2.2" - -chownr@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/chownr/-/chownr-1.0.1.tgz#e2a75042a9551908bebd25b8523d5f9769d79181" - -cipher-base@^1.0.0, cipher-base@^1.0.1, cipher-base@^1.0.3: - version "1.0.4" - resolved "https://registry.yarnpkg.com/cipher-base/-/cipher-base-1.0.4.tgz#8760e4ecc272f4c363532f926d874aae2c1397de" - dependencies: - inherits "^2.0.1" - safe-buffer "^5.0.1" - -circular-json@^0.3.1: - version "0.3.3" - resolved "https://registry.yarnpkg.com/circular-json/-/circular-json-0.3.3.tgz#815c99ea84f6809529d2f45791bdf82711352d66" - -circular-json@^0.5.4: - version "0.5.5" - resolved "https://registry.yarnpkg.com/circular-json/-/circular-json-0.5.5.tgz#64182ef359042d37cd8e767fc9de878b1e9447d3" - -class-utils@^0.3.5: - version "0.3.6" - resolved "https://registry.yarnpkg.com/class-utils/-/class-utils-0.3.6.tgz#f93369ae8b9a7ce02fd41faad0ca83033190c463" - dependencies: - arr-union "^3.1.0" - define-property "^0.2.5" - isobject "^3.0.0" - static-extend "^0.1.1" - -cli-cursor@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/cli-cursor/-/cli-cursor-2.1.0.tgz#b35dac376479facc3e94747d41d0d0f5238ffcb5" - dependencies: - restore-cursor "^2.0.0" - -cli-width@^2.0.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/cli-width/-/cli-width-2.2.0.tgz#ff19ede8a9a5e579324147b0c11f0fbcbabed639" - -co@^4.6.0: - version "4.6.0" - resolved "https://registry.yarnpkg.com/co/-/co-4.6.0.tgz#6ea6bdf3d853ae54ccb8e47bfa0bf3f9031fb184" - -code-point-at@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/code-point-at/-/code-point-at-1.1.0.tgz#0d070b4d043a5bea33a2f1a40e2edb3d9a4ccf77" - -collection-visit@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/collection-visit/-/collection-visit-1.0.0.tgz#4bc0373c164bc3291b4d368c829cf1a80a59dca0" - dependencies: - map-visit "^1.0.0" - object-visit "^1.0.0" - -color-convert@^1.9.0: - version "1.9.1" - resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.1.tgz#c1261107aeb2f294ebffec9ed9ecad529a6097ed" - dependencies: - color-name "^1.1.1" - -color-name@^1.1.1: - version "1.1.3" - resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.3.tgz#a7d0558bd89c42f795dd42328f740831ca53bc25" - -colors@^1.1.0: - version "1.2.3" - resolved "https://registry.yarnpkg.com/colors/-/colors-1.2.3.tgz#1b152a9c4f6c9f74bc4bb96233ad0b7983b79744" - -combine-lists@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/combine-lists/-/combine-lists-1.0.1.tgz#458c07e09e0d900fc28b70a3fec2dacd1d2cb7f6" - dependencies: - lodash "^4.5.0" - -combine-source-map@^0.8.0, combine-source-map@~0.8.0: - version "0.8.0" - resolved "https://registry.yarnpkg.com/combine-source-map/-/combine-source-map-0.8.0.tgz#a58d0df042c186fcf822a8e8015f5450d2d79a8b" - dependencies: - convert-source-map "~1.1.0" - inline-source-map "~0.6.0" - lodash.memoize "~3.0.3" - source-map "~0.5.3" - -combined-stream@1.0.6, combined-stream@^1.0.5, combined-stream@~1.0.5: - version "1.0.6" - resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.6.tgz#723e7df6e801ac5613113a7e445a9b69cb632818" - dependencies: - delayed-stream "~1.0.0" - -commander@2.15.1, commander@^2.9.0: - version "2.15.1" - resolved "https://registry.yarnpkg.com/commander/-/commander-2.15.1.tgz#df46e867d0fc2aec66a34662b406a9ccafff5b0f" - -commander@~2.16.0: - version "2.16.0" - resolved "https://registry.yarnpkg.com/commander/-/commander-2.16.0.tgz#f16390593996ceb4f3eeb020b31d78528f7f8a50" - -component-bind@1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/component-bind/-/component-bind-1.0.0.tgz#00c608ab7dcd93897c0009651b1d3a8e1e73bbd1" - -component-emitter@1.2.1, component-emitter@^1.2.1: - version "1.2.1" - resolved "https://registry.yarnpkg.com/component-emitter/-/component-emitter-1.2.1.tgz#137918d6d78283f7df7a6b7c5a63e140e69425e6" - -component-inherit@0.0.3: - version "0.0.3" - resolved "https://registry.yarnpkg.com/component-inherit/-/component-inherit-0.0.3.tgz#645fc4adf58b72b649d5cae65135619db26ff143" - -concat-map@0.0.1: - version "0.0.1" - resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" - -concat-stream@1.6.0: - version "1.6.0" - resolved "https://registry.yarnpkg.com/concat-stream/-/concat-stream-1.6.0.tgz#0aac662fd52be78964d5532f694784e70110acf7" - dependencies: - inherits "^2.0.3" - readable-stream "^2.2.2" - typedarray "^0.0.6" - -concat-stream@^1.6.0, concat-stream@^1.6.1, concat-stream@~1.6.0: - version "1.6.2" - resolved "https://registry.yarnpkg.com/concat-stream/-/concat-stream-1.6.2.tgz#904bdf194cd3122fc675c77fc4ac3d4ff0fd1a34" - dependencies: - buffer-from "^1.0.0" - inherits "^2.0.3" - readable-stream "^2.2.2" - typedarray "^0.0.6" - -connect@^3.6.0: - version "3.6.6" - resolved "https://registry.yarnpkg.com/connect/-/connect-3.6.6.tgz#09eff6c55af7236e137135a72574858b6786f524" - dependencies: - debug "2.6.9" - finalhandler "1.1.0" - parseurl "~1.3.2" - utils-merge "1.0.1" - -console-browserify@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/console-browserify/-/console-browserify-1.1.0.tgz#f0241c45730a9fc6323b206dbf38edc741d0bb10" - dependencies: - date-now "^0.1.4" - -console-control-strings@^1.0.0, console-control-strings@~1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/console-control-strings/-/console-control-strings-1.1.0.tgz#3d7cf4464db6446ea644bf4b39507f9851008e8e" - -constants-browserify@~1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/constants-browserify/-/constants-browserify-1.0.0.tgz#c20b96d8c617748aaf1c16021760cd27fcb8cb75" - -content-type@~1.0.4: - version "1.0.4" - resolved "https://registry.yarnpkg.com/content-type/-/content-type-1.0.4.tgz#e138cc75e040c727b1966fe5e5f8c9aee256fe3b" - -convert-source-map@^1.1.3: - version "1.5.1" - resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.5.1.tgz#b8278097b9bc229365de5c62cf5fcaed8b5599e5" - -convert-source-map@~1.1.0: - version "1.1.3" - resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.1.3.tgz#4829c877e9fe49b3161f3bf3673888e204699860" - -cookie@0.3.1: - version "0.3.1" - resolved "https://registry.yarnpkg.com/cookie/-/cookie-0.3.1.tgz#e7e0a1f9ef43b4c8ba925c5c5a96e806d16873bb" - -copy-descriptor@^0.1.0: - version "0.1.1" - resolved "https://registry.yarnpkg.com/copy-descriptor/-/copy-descriptor-0.1.1.tgz#676f6eb3c39997c2ee1ac3a924fd6124748f578d" - -core-js@^2.2.0: - version "2.5.5" - resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.5.5.tgz#b14dde936c640c0579a6b50cabcc132dd6127e3b" - -core-util-is@1.0.2, core-util-is@~1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7" - -create-ecdh@^4.0.0: - version "4.0.1" - resolved "https://registry.yarnpkg.com/create-ecdh/-/create-ecdh-4.0.1.tgz#44223dfed533193ba5ba54e0df5709b89acf1f82" - dependencies: - bn.js "^4.1.0" - elliptic "^6.0.0" - -create-hash@^1.1.0, create-hash@^1.1.2: - version "1.2.0" - resolved "https://registry.yarnpkg.com/create-hash/-/create-hash-1.2.0.tgz#889078af11a63756bcfb59bd221996be3a9ef196" - dependencies: - cipher-base "^1.0.1" - inherits "^2.0.1" - md5.js "^1.3.4" - ripemd160 "^2.0.1" - sha.js "^2.4.0" - -create-hmac@^1.1.0, create-hmac@^1.1.2, create-hmac@^1.1.4: - version "1.1.7" - resolved "https://registry.yarnpkg.com/create-hmac/-/create-hmac-1.1.7.tgz#69170c78b3ab957147b2b8b04572e47ead2243ff" - dependencies: - cipher-base "^1.0.3" - create-hash "^1.1.0" - inherits "^2.0.1" - ripemd160 "^2.0.0" - safe-buffer "^5.0.1" - sha.js "^2.4.8" - -cross-spawn@^6.0.5: - version "6.0.5" - resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-6.0.5.tgz#4a5ec7c64dfae22c3a14124dbacdee846d80cbc4" - dependencies: - nice-try "^1.0.4" - path-key "^2.0.1" - semver "^5.5.0" - shebang-command "^1.2.0" - which "^1.2.9" - -cryptiles@2.x.x: - version "2.0.5" - resolved "https://registry.yarnpkg.com/cryptiles/-/cryptiles-2.0.5.tgz#3bdfecdc608147c1c67202fa291e7dca59eaa3b8" - dependencies: - boom "2.x.x" - -cryptiles@3.x.x: - version "3.1.2" - resolved "https://registry.yarnpkg.com/cryptiles/-/cryptiles-3.1.2.tgz#a89fbb220f5ce25ec56e8c4aa8a4fd7b5b0d29fe" - dependencies: - boom "5.x.x" - -crypto-browserify@^3.0.0: - version "3.12.0" - resolved "https://registry.yarnpkg.com/crypto-browserify/-/crypto-browserify-3.12.0.tgz#396cf9f3137f03e4b8e532c58f698254e00f80ec" - dependencies: - browserify-cipher "^1.0.0" - browserify-sign "^4.0.0" - create-ecdh "^4.0.0" - create-hash "^1.1.0" - create-hmac "^1.1.0" - diffie-hellman "^5.0.0" - inherits "^2.0.1" - pbkdf2 "^3.0.3" - public-encrypt "^4.0.0" - randombytes "^2.0.0" - randomfill "^1.0.3" - -custom-event@~1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/custom-event/-/custom-event-1.0.1.tgz#5d02a46850adf1b4a317946a3928fccb5bfd0425" - -dashdash@^1.12.0: - version "1.14.1" - resolved "https://registry.yarnpkg.com/dashdash/-/dashdash-1.14.1.tgz#853cfa0f7cbe2fed5de20326b8dd581035f6e2f0" - dependencies: - assert-plus "^1.0.0" - -data-uri-to-buffer@1: - version "1.2.0" - resolved "https://registry.yarnpkg.com/data-uri-to-buffer/-/data-uri-to-buffer-1.2.0.tgz#77163ea9c20d8641b4707e8f18abdf9a78f34835" - -date-format@^1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/date-format/-/date-format-1.2.0.tgz#615e828e233dd1ab9bb9ae0950e0ceccfa6ecad8" - -date-now@^0.1.4: - version "0.1.4" - resolved "https://registry.yarnpkg.com/date-now/-/date-now-0.1.4.tgz#eaf439fd4d4848ad74e5cc7dbef200672b9e345b" - -debug@2, debug@2.6.9, debug@^2.1.2, debug@^2.2.0, debug@^2.3.3, debug@~2.6.4, debug@~2.6.6: - version "2.6.9" - resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f" - dependencies: - ms "2.0.0" - -debug@3.1.0, debug@^3.1.0, debug@~3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/debug/-/debug-3.1.0.tgz#5bb5a0672628b64149566ba16819e61518c67261" - dependencies: - ms "2.0.0" - -decode-uri-component@^0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/decode-uri-component/-/decode-uri-component-0.2.0.tgz#eb3913333458775cb84cd1a1fae062106bb87545" - -deep-extend@^0.5.1: - version "0.5.1" - resolved "https://registry.yarnpkg.com/deep-extend/-/deep-extend-0.5.1.tgz#b894a9dd90d3023fbf1c55a394fb858eb2066f1f" - -deep-extend@^0.6.0: - version "0.6.0" - resolved "https://registry.yarnpkg.com/deep-extend/-/deep-extend-0.6.0.tgz#c4fa7c95404a17a9c3e8ca7e1537312b736330ac" - -deep-is@~0.1.3: - version "0.1.3" - resolved "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.3.tgz#b369d6fb5dbc13eecf524f91b070feedc357cf34" - -define-properties@^1.1.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/define-properties/-/define-properties-1.1.2.tgz#83a73f2fea569898fb737193c8f873caf6d45c94" - dependencies: - foreach "^2.0.5" - object-keys "^1.0.8" - -define-property@^0.2.5: - version "0.2.5" - resolved "https://registry.yarnpkg.com/define-property/-/define-property-0.2.5.tgz#c35b1ef918ec3c990f9a5bc57be04aacec5c8116" - dependencies: - is-descriptor "^0.1.0" - -define-property@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/define-property/-/define-property-1.0.0.tgz#769ebaaf3f4a63aad3af9e8d304c9bbe79bfb0e6" - dependencies: - is-descriptor "^1.0.0" - -define-property@^2.0.2: - version "2.0.2" - resolved "https://registry.yarnpkg.com/define-property/-/define-property-2.0.2.tgz#d459689e8d654ba77e02a817f8710d702cb16e9d" - dependencies: - is-descriptor "^1.0.2" - isobject "^3.0.1" - -defined@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/defined/-/defined-1.0.0.tgz#c98d9bcef75674188e110969151199e39b1fa693" - -degenerator@^1.0.4: - version "1.0.4" - resolved "https://registry.yarnpkg.com/degenerator/-/degenerator-1.0.4.tgz#fcf490a37ece266464d9cc431ab98c5819ced095" - dependencies: - ast-types "0.x.x" - escodegen "1.x.x" - esprima "3.x.x" - -del@^2.0.2: - version "2.2.2" - resolved "https://registry.yarnpkg.com/del/-/del-2.2.2.tgz#c12c981d067846c84bcaf862cff930d907ffd1a8" - dependencies: - globby "^5.0.0" - is-path-cwd "^1.0.0" - is-path-in-cwd "^1.0.0" - object-assign "^4.0.1" - pify "^2.0.0" - pinkie-promise "^2.0.0" - rimraf "^2.2.8" - -delayed-stream@~1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619" - -delegates@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/delegates/-/delegates-1.0.0.tgz#84c6e159b81904fdca59a0ef44cd870d31250f9a" - -depd@1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/depd/-/depd-1.1.1.tgz#5783b4e1c459f06fa5ca27f991f3d06e7a310359" - -depd@~1.1.1, depd@~1.1.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/depd/-/depd-1.1.2.tgz#9bcd52e14c097763e749b274c4346ed2e560b5a9" - -deps-sort@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/deps-sort/-/deps-sort-2.0.0.tgz#091724902e84658260eb910748cccd1af6e21fb5" - dependencies: - JSONStream "^1.0.3" - shasum "^1.0.0" - subarg "^1.0.0" - through2 "^2.0.0" - -des.js@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/des.js/-/des.js-1.0.0.tgz#c074d2e2aa6a8a9a07dbd61f9a15c2cd83ec8ecc" - dependencies: - inherits "^2.0.1" - minimalistic-assert "^1.0.0" - -detect-libc@^1.0.2: - version "1.0.3" - resolved "https://registry.yarnpkg.com/detect-libc/-/detect-libc-1.0.3.tgz#fa137c4bd698edf55cd5cd02ac559f91a4c4ba9b" - -detective@^5.0.2: - version "5.1.0" - resolved "https://registry.yarnpkg.com/detective/-/detective-5.1.0.tgz#7a20d89236d7b331ccea65832e7123b5551bb7cb" - dependencies: - acorn-node "^1.3.0" - defined "^1.0.0" - minimist "^1.1.1" - -di@^0.0.1: - version "0.0.1" - resolved "https://registry.yarnpkg.com/di/-/di-0.0.1.tgz#806649326ceaa7caa3306d75d985ea2748ba913c" - -diff@3.5.0: - version "3.5.0" - resolved "https://registry.yarnpkg.com/diff/-/diff-3.5.0.tgz#800c0dd1e0a8bfbc95835c202ad220fe317e5a12" - -diffie-hellman@^5.0.0: - version "5.0.3" - resolved "https://registry.yarnpkg.com/diffie-hellman/-/diffie-hellman-5.0.3.tgz#40e8ee98f55a2149607146921c63e1ae5f3d2875" - dependencies: - bn.js "^4.1.0" - miller-rabin "^4.0.0" - randombytes "^2.0.0" - -doctrine@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-2.1.0.tgz#5cd01fc101621b42c4cd7f5d1a66243716d3f39d" - dependencies: - esutils "^2.0.2" - -dom-serialize@^2.2.0: - version "2.2.1" - resolved "https://registry.yarnpkg.com/dom-serialize/-/dom-serialize-2.2.1.tgz#562ae8999f44be5ea3076f5419dcd59eb43ac95b" - dependencies: - custom-event "~1.0.0" - ent "~2.2.0" - extend "^3.0.0" - void-elements "^2.0.0" - -domain-browser@^1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/domain-browser/-/domain-browser-1.2.0.tgz#3d31f50191a6749dd1375a7f522e823d42e54eda" - -double-ended-queue@^2.1.0-0: - version "2.1.0-0" - resolved "https://registry.yarnpkg.com/double-ended-queue/-/double-ended-queue-2.1.0-0.tgz#103d3527fd31528f40188130c841efdd78264e5c" - -duplexer2@^0.1.2, duplexer2@~0.1.0, duplexer2@~0.1.2: - version "0.1.4" - resolved "https://registry.yarnpkg.com/duplexer2/-/duplexer2-0.1.4.tgz#8b12dab878c0d69e3e7891051662a32fc6bddcc1" - dependencies: - readable-stream "^2.0.2" - -duplexer@~0.1.1: - version "0.1.1" - resolved "https://registry.yarnpkg.com/duplexer/-/duplexer-0.1.1.tgz#ace6ff808c1ce66b57d1ebf97977acb02334cfc1" - -ecc-jsbn@~0.1.1: - version "0.1.1" - resolved "https://registry.yarnpkg.com/ecc-jsbn/-/ecc-jsbn-0.1.1.tgz#0fc73a9ed5f0d53c38193398523ef7e543777505" - dependencies: - jsbn "~0.1.0" - -ee-first@1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/ee-first/-/ee-first-1.1.1.tgz#590c61156b0ae2f4f0255732a158b266bc56b21d" - -elliptic@^6.0.0: - version "6.4.0" - resolved "https://registry.yarnpkg.com/elliptic/-/elliptic-6.4.0.tgz#cac9af8762c85836187003c8dfe193e5e2eae5df" - dependencies: - bn.js "^4.4.0" - brorand "^1.0.1" - hash.js "^1.0.0" - hmac-drbg "^1.0.0" - inherits "^2.0.1" - minimalistic-assert "^1.0.0" - minimalistic-crypto-utils "^1.0.0" - -encodeurl@~1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/encodeurl/-/encodeurl-1.0.2.tgz#ad3ff4c86ec2d029322f5a02c3a9a606c95b3f59" - -engine.io-client@~3.1.0: - version "3.1.6" - resolved "https://registry.yarnpkg.com/engine.io-client/-/engine.io-client-3.1.6.tgz#5bdeb130f8b94a50ac5cbeb72583e7a4a063ddfd" - dependencies: - component-emitter "1.2.1" - component-inherit "0.0.3" - debug "~3.1.0" - engine.io-parser "~2.1.1" - has-cors "1.1.0" - indexof "0.0.1" - parseqs "0.0.5" - parseuri "0.0.5" - ws "~3.3.1" - xmlhttprequest-ssl "~1.5.4" - yeast "0.1.2" - -engine.io-parser@~2.1.0, engine.io-parser@~2.1.1: - version "2.1.2" - resolved "https://registry.yarnpkg.com/engine.io-parser/-/engine.io-parser-2.1.2.tgz#4c0f4cff79aaeecbbdcfdea66a823c6085409196" - dependencies: - after "0.8.2" - arraybuffer.slice "~0.0.7" - base64-arraybuffer "0.1.5" - blob "0.0.4" - has-binary2 "~1.0.2" - -engine.io@~3.1.0: - version "3.1.5" - resolved "https://registry.yarnpkg.com/engine.io/-/engine.io-3.1.5.tgz#0e7ef9d690eb0b35597f1d4ad02a26ca2dba3845" - dependencies: - accepts "~1.3.4" - base64id "1.0.0" - cookie "0.3.1" - debug "~3.1.0" - engine.io-parser "~2.1.0" - ws "~3.3.1" - optionalDependencies: - uws "~9.14.0" - -ent@~2.2.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/ent/-/ent-2.2.0.tgz#e964219325a21d05f44466a2f686ed6ce5f5dd1d" - -es-abstract@^1.10.0: - version "1.12.0" - resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.12.0.tgz#9dbbdd27c6856f0001421ca18782d786bf8a6165" - dependencies: - es-to-primitive "^1.1.1" - function-bind "^1.1.1" - has "^1.0.1" - is-callable "^1.1.3" - is-regex "^1.0.4" - -es-to-primitive@^1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/es-to-primitive/-/es-to-primitive-1.1.1.tgz#45355248a88979034b6792e19bb81f2b7975dd0d" - dependencies: - is-callable "^1.1.1" - is-date-object "^1.0.1" - is-symbol "^1.0.1" - -es6-promise@^4.0.3: - version "4.2.4" - resolved "https://registry.yarnpkg.com/es6-promise/-/es6-promise-4.2.4.tgz#dc4221c2b16518760bd8c39a52d8f356fc00ed29" - -es6-promisify@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/es6-promisify/-/es6-promisify-5.0.0.tgz#5109d62f3e56ea967c4b63505aef08291c8a5203" - dependencies: - es6-promise "^4.0.3" - -escape-html@~1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/escape-html/-/escape-html-1.0.3.tgz#0258eae4d3d0c0974de1c169188ef0051d1d1988" - -escape-string-regexp@1.0.5, escape-string-regexp@^1.0.2, escape-string-regexp@^1.0.5: - version "1.0.5" - resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" - -escodegen@1.x.x: - version "1.9.1" - resolved "https://registry.yarnpkg.com/escodegen/-/escodegen-1.9.1.tgz#dbae17ef96c8e4bedb1356f4504fa4cc2f7cb7e2" - dependencies: - esprima "^3.1.3" - estraverse "^4.2.0" - esutils "^2.0.2" - optionator "^0.8.1" - optionalDependencies: - source-map "~0.6.1" - -eslint-config-hapi@^12.0.0: - version "12.0.0" - resolved "https://registry.yarnpkg.com/eslint-config-hapi/-/eslint-config-hapi-12.0.0.tgz#2bcacc0e050d6734f95df077dc921fa755576d7e" - -eslint-plugin-hapi@^4.1.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/eslint-plugin-hapi/-/eslint-plugin-hapi-4.1.0.tgz#ca6b97b7621ae45cf70ab92f8c847a85414a56c9" - dependencies: - hapi-capitalize-modules "1.x.x" - hapi-for-you "1.x.x" - hapi-no-var "1.x.x" - hapi-scope-start "2.x.x" - no-arrowception "1.x.x" - -eslint-scope@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-4.0.0.tgz#50bf3071e9338bcdc43331794a0cb533f0136172" - dependencies: - esrecurse "^4.1.0" - estraverse "^4.1.1" - -eslint-utils@^1.3.1: - version "1.3.1" - resolved "https://registry.yarnpkg.com/eslint-utils/-/eslint-utils-1.3.1.tgz#9a851ba89ee7c460346f97cf8939c7298827e512" - -eslint-visitor-keys@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-1.0.0.tgz#3f3180fb2e291017716acb4c9d6d5b5c34a6a81d" - -eslint@^5.2.0: - version "5.2.0" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-5.2.0.tgz#3901ae249195d473e633c4acbc370068b1c964dc" - dependencies: - ajv "^6.5.0" - babel-code-frame "^6.26.0" - chalk "^2.1.0" - cross-spawn "^6.0.5" - debug "^3.1.0" - doctrine "^2.1.0" - eslint-scope "^4.0.0" - eslint-utils "^1.3.1" - eslint-visitor-keys "^1.0.0" - espree "^4.0.0" - esquery "^1.0.1" - esutils "^2.0.2" - file-entry-cache "^2.0.0" - functional-red-black-tree "^1.0.1" - glob "^7.1.2" - globals "^11.7.0" - ignore "^4.0.2" - imurmurhash "^0.1.4" - inquirer "^5.2.0" - is-resolvable "^1.1.0" - js-yaml "^3.11.0" - json-stable-stringify-without-jsonify "^1.0.1" - levn "^0.3.0" - lodash "^4.17.5" - minimatch "^3.0.4" - mkdirp "^0.5.1" - natural-compare "^1.4.0" - optionator "^0.8.2" - path-is-inside "^1.0.2" - pluralize "^7.0.0" - progress "^2.0.0" - regexpp "^1.1.0" - require-uncached "^1.0.3" - semver "^5.5.0" - string.prototype.matchall "^2.0.0" - strip-ansi "^4.0.0" - strip-json-comments "^2.0.1" - table "^4.0.3" - text-table "^0.2.0" - -espree@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/espree/-/espree-4.0.0.tgz#253998f20a0f82db5d866385799d912a83a36634" - dependencies: - acorn "^5.6.0" - acorn-jsx "^4.1.1" - -esprima@3.x.x, esprima@^3.1.3: - version "3.1.3" - resolved "https://registry.yarnpkg.com/esprima/-/esprima-3.1.3.tgz#fdca51cee6133895e3c88d535ce49dbff62a4633" - -esprima@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.0.tgz#4499eddcd1110e0b218bacf2fa7f7f59f55ca804" - -esquery@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/esquery/-/esquery-1.0.1.tgz#406c51658b1f5991a5f9b62b1dc25b00e3e5c708" - dependencies: - estraverse "^4.0.0" - -esrecurse@^4.1.0: - version "4.2.1" - resolved "https://registry.yarnpkg.com/esrecurse/-/esrecurse-4.2.1.tgz#007a3b9fdbc2b3bb87e4879ea19c92fdbd3942cf" - dependencies: - estraverse "^4.1.0" - -estraverse@^4.0.0, estraverse@^4.1.0, estraverse@^4.1.1, estraverse@^4.2.0: - version "4.2.0" - resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-4.2.0.tgz#0dee3fed31fcd469618ce7342099fc1afa0bdb13" - -esutils@^2.0.2: - version "2.0.2" - resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.2.tgz#0abf4f1caa5bcb1f7a9d8acc6dea4faaa04bac9b" - -event-stream@^3.3.4: - version "3.3.4" - resolved "http://registry.npmjs.org/event-stream/-/event-stream-3.3.4.tgz#4ab4c9a0f5a54db9338b4c34d86bfce8f4b35571" - dependencies: - duplexer "~0.1.1" - from "~0" - map-stream "~0.1.0" - pause-stream "0.0.11" - split "0.3" - stream-combiner "~0.0.4" - through "~2.3.1" - -eventemitter3@^3.0.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/eventemitter3/-/eventemitter3-3.1.0.tgz#090b4d6cdbd645ed10bf750d4b5407942d7ba163" - -events@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/events/-/events-2.0.0.tgz#cbbb56bf3ab1ac18d71c43bb32c86255062769f2" - -evp_bytestokey@^1.0.0, evp_bytestokey@^1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/evp_bytestokey/-/evp_bytestokey-1.0.3.tgz#7fcbdb198dc71959432efe13842684e0525acb02" - dependencies: - md5.js "^1.3.4" - safe-buffer "^5.1.1" - -expand-braces@^0.1.1: - version "0.1.2" - resolved "https://registry.yarnpkg.com/expand-braces/-/expand-braces-0.1.2.tgz#488b1d1d2451cb3d3a6b192cfc030f44c5855fea" - dependencies: - array-slice "^0.2.3" - array-unique "^0.2.1" - braces "^0.1.2" - -expand-brackets@^0.1.4: - version "0.1.5" - resolved "https://registry.yarnpkg.com/expand-brackets/-/expand-brackets-0.1.5.tgz#df07284e342a807cd733ac5af72411e581d1177b" - dependencies: - is-posix-bracket "^0.1.0" - -expand-brackets@^2.1.4: - version "2.1.4" - resolved "https://registry.yarnpkg.com/expand-brackets/-/expand-brackets-2.1.4.tgz#b77735e315ce30f6b6eff0f83b04151a22449622" - dependencies: - debug "^2.3.3" - define-property "^0.2.5" - extend-shallow "^2.0.1" - posix-character-classes "^0.1.0" - regex-not "^1.0.0" - snapdragon "^0.8.1" - to-regex "^3.0.1" - -expand-range@^0.1.0: - version "0.1.1" - resolved "https://registry.yarnpkg.com/expand-range/-/expand-range-0.1.1.tgz#4cb8eda0993ca56fa4f41fc42f3cbb4ccadff044" - dependencies: - is-number "^0.1.1" - repeat-string "^0.2.2" - -expand-range@^1.8.1: - version "1.8.2" - resolved "https://registry.yarnpkg.com/expand-range/-/expand-range-1.8.2.tgz#a299effd335fe2721ebae8e257ec79644fc85337" - dependencies: - fill-range "^2.1.0" - -extend-shallow@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/extend-shallow/-/extend-shallow-2.0.1.tgz#51af7d614ad9a9f610ea1bafbb989d6b1c56890f" - dependencies: - is-extendable "^0.1.0" - -extend-shallow@^3.0.0, extend-shallow@^3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/extend-shallow/-/extend-shallow-3.0.2.tgz#26a71aaf073b39fb2127172746131c2704028db8" - dependencies: - assign-symbols "^1.0.0" - is-extendable "^1.0.1" - -extend@3, extend@^3.0.0, extend@~3.0.0, extend@~3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.1.tgz#a755ea7bc1adfcc5a31ce7e762dbaadc5e636444" - -external-editor@^2.1.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/external-editor/-/external-editor-2.2.0.tgz#045511cfd8d133f3846673d1047c154e214ad3d5" - dependencies: - chardet "^0.4.0" - iconv-lite "^0.4.17" - tmp "^0.0.33" - -extglob@^0.3.1: - version "0.3.2" - resolved "https://registry.yarnpkg.com/extglob/-/extglob-0.3.2.tgz#2e18ff3d2f49ab2765cec9023f011daa8d8349a1" - dependencies: - is-extglob "^1.0.0" - -extglob@^2.0.4: - version "2.0.4" - resolved "https://registry.yarnpkg.com/extglob/-/extglob-2.0.4.tgz#ad00fe4dc612a9232e8718711dc5cb5ab0285543" - dependencies: - array-unique "^0.3.2" - define-property "^1.0.0" - expand-brackets "^2.1.4" - extend-shallow "^2.0.1" - fragment-cache "^0.2.1" - regex-not "^1.0.0" - snapdragon "^0.8.1" - to-regex "^3.0.1" - -extract-zip@^1.6.5: - version "1.6.6" - resolved "https://registry.yarnpkg.com/extract-zip/-/extract-zip-1.6.6.tgz#1290ede8d20d0872b429fd3f351ca128ec5ef85c" - dependencies: - concat-stream "1.6.0" - debug "2.6.9" - mkdirp "0.5.0" - yauzl "2.4.1" - -extsprintf@1.3.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.3.0.tgz#96918440e3041a7a414f8c52e3c574eb3c3e1e05" - -extsprintf@^1.2.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.4.0.tgz#e2689f8f356fad62cca65a3a91c5df5f9551692f" - -fast-deep-equal@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-1.1.0.tgz#c053477817c86b51daa853c81e059b733d023614" - -fast-deep-equal@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz#7b05218ddf9667bf7f370bf7fdb2cb15fdd0aa49" - -fast-json-stable-stringify@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz#d5142c0caee6b1189f87d3a76111064f86c8bbf2" - -fast-levenshtein@~2.0.4: - version "2.0.6" - resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917" - -fd-slicer@~1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/fd-slicer/-/fd-slicer-1.0.1.tgz#8b5bcbd9ec327c5041bf9ab023fd6750f1177e65" - dependencies: - pend "~1.2.0" - -figures@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/figures/-/figures-2.0.0.tgz#3ab1a2d2a62c8bfb431a0c94cb797a2fce27c962" - dependencies: - escape-string-regexp "^1.0.5" - -file-entry-cache@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/file-entry-cache/-/file-entry-cache-2.0.0.tgz#c392990c3e684783d838b8c84a45d8a048458361" - dependencies: - flat-cache "^1.2.1" - object-assign "^4.0.1" - -file-uri-to-path@1: - version "1.0.0" - resolved "https://registry.yarnpkg.com/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz#553a7b8446ff6f684359c445f1e37a05dacc33dd" - -filename-regex@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/filename-regex/-/filename-regex-2.0.1.tgz#c1c4b9bee3e09725ddb106b75c1e301fe2f18b26" - -fill-range@^2.1.0: - version "2.2.3" - resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-2.2.3.tgz#50b77dfd7e469bc7492470963699fe7a8485a723" - dependencies: - is-number "^2.1.0" - isobject "^2.0.0" - randomatic "^1.1.3" - repeat-element "^1.1.2" - repeat-string "^1.5.2" - -fill-range@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-4.0.0.tgz#d544811d428f98eb06a63dc402d2403c328c38f7" - dependencies: - extend-shallow "^2.0.1" - is-number "^3.0.0" - repeat-string "^1.6.1" - to-regex-range "^2.1.0" - -finalhandler@1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/finalhandler/-/finalhandler-1.1.0.tgz#ce0b6855b45853e791b2fcc680046d88253dd7f5" - dependencies: - debug "2.6.9" - encodeurl "~1.0.1" - escape-html "~1.0.3" - on-finished "~2.3.0" - parseurl "~1.3.2" - statuses "~1.3.1" - unpipe "~1.0.0" - -flat-cache@^1.2.1: - version "1.3.0" - resolved "https://registry.yarnpkg.com/flat-cache/-/flat-cache-1.3.0.tgz#d3030b32b38154f4e3b7e9c709f490f7ef97c481" - dependencies: - circular-json "^0.3.1" - del "^2.0.2" - graceful-fs "^4.1.2" - write "^0.2.1" - -follow-redirects@1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.0.0.tgz#8e34298cbd2e176f254effec75a1c78cc849fd37" - dependencies: - debug "^2.2.0" - -follow-redirects@^1.0.0: - version "1.4.1" - resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.4.1.tgz#d8120f4518190f55aac65bb6fc7b85fcd666d6aa" - dependencies: - debug "^3.1.0" - -for-in@^1.0.1, for-in@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/for-in/-/for-in-1.0.2.tgz#81068d295a8142ec0ac726c6e2200c30fb6d5e80" - -for-own@^0.1.4: - version "0.1.5" - resolved "https://registry.yarnpkg.com/for-own/-/for-own-0.1.5.tgz#5265c681a4f294dabbf17c9509b6763aa84510ce" - dependencies: - for-in "^1.0.1" - -foreach@^2.0.5: - version "2.0.5" - resolved "https://registry.yarnpkg.com/foreach/-/foreach-2.0.5.tgz#0bee005018aeb260d0a3af3ae658dd0136ec1b99" - -forever-agent@~0.6.1: - version "0.6.1" - resolved "https://registry.yarnpkg.com/forever-agent/-/forever-agent-0.6.1.tgz#fbc71f0c41adeb37f96c577ad1ed42d8fdacca91" - -form-data@~2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/form-data/-/form-data-2.0.0.tgz#6f0aebadcc5da16c13e1ecc11137d85f9b883b25" - dependencies: - asynckit "^0.4.0" - combined-stream "^1.0.5" - mime-types "^2.1.11" - -form-data@~2.3.0, form-data@~2.3.1: - version "2.3.2" - resolved "https://registry.yarnpkg.com/form-data/-/form-data-2.3.2.tgz#4970498be604c20c005d4f5c23aecd21d6b49099" - dependencies: - asynckit "^0.4.0" - combined-stream "1.0.6" - mime-types "^2.1.12" - -fragment-cache@^0.2.1: - version "0.2.1" - resolved "https://registry.yarnpkg.com/fragment-cache/-/fragment-cache-0.2.1.tgz#4290fad27f13e89be7f33799c6bc5a0abfff0d19" - dependencies: - map-cache "^0.2.2" - -from@~0: - version "0.1.7" - resolved "https://registry.yarnpkg.com/from/-/from-0.1.7.tgz#83c60afc58b9c56997007ed1a768b3ab303a44fe" - -fs-extra@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-1.0.0.tgz#cd3ce5f7e7cb6145883fcae3191e9877f8587950" - dependencies: - graceful-fs "^4.1.2" - jsonfile "^2.1.0" - klaw "^1.0.0" - -fs-minipass@^1.2.5: - version "1.2.5" - resolved "https://registry.yarnpkg.com/fs-minipass/-/fs-minipass-1.2.5.tgz#06c277218454ec288df77ada54a03b8702aacb9d" - dependencies: - minipass "^2.2.1" - -fs.realpath@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" - -fsevents@^1.0.0: - version "1.2.3" - resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-1.2.3.tgz#08292982e7059f6674c93d8b829c1e8604979ac0" - dependencies: - nan "^2.9.2" - node-pre-gyp "^0.9.0" - -fsevents@^1.2.2: - version "1.2.4" - resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-1.2.4.tgz#f41dcb1af2582af3692da36fc55cbd8e1041c426" - dependencies: - nan "^2.9.2" - node-pre-gyp "^0.10.0" - -ftp@~0.3.10: - version "0.3.10" - resolved "https://registry.yarnpkg.com/ftp/-/ftp-0.3.10.tgz#9197d861ad8142f3e63d5a83bfe4c59f7330885d" - dependencies: - readable-stream "1.1.x" - xregexp "2.0.0" - -function-bind@^1.0.2, function-bind@^1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.1.tgz#a56899d3ea3c9bab874bb9773b7c5ede92f4895d" - -functional-red-black-tree@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz#1b0ab3bd553b2a0d6399d29c0e3ea0b252078327" - -gauge@~2.7.3: - version "2.7.4" - resolved "https://registry.yarnpkg.com/gauge/-/gauge-2.7.4.tgz#2c03405c7538c39d7eb37b317022e325fb018bf7" - dependencies: - aproba "^1.0.3" - console-control-strings "^1.0.0" - has-unicode "^2.0.0" - object-assign "^4.1.0" - signal-exit "^3.0.0" - string-width "^1.0.1" - strip-ansi "^3.0.1" - wide-align "^1.1.0" - -generate-function@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/generate-function/-/generate-function-2.0.0.tgz#6858fe7c0969b7d4e9093337647ac79f60dfbe74" - -generate-object-property@^1.1.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/generate-object-property/-/generate-object-property-1.2.0.tgz#9c0e1c40308ce804f4783618b937fa88f99d50d0" - dependencies: - is-property "^1.0.0" - -get-uri@^2.0.0: - version "2.0.2" - resolved "https://registry.yarnpkg.com/get-uri/-/get-uri-2.0.2.tgz#5c795e71326f6ca1286f2fc82575cd2bab2af578" - dependencies: - data-uri-to-buffer "1" - debug "2" - extend "3" - file-uri-to-path "1" - ftp "~0.3.10" - readable-stream "2" - -get-value@^2.0.3, get-value@^2.0.6: - version "2.0.6" - resolved "https://registry.yarnpkg.com/get-value/-/get-value-2.0.6.tgz#dc15ca1c672387ca76bd37ac0a395ba2042a2c28" - -getpass@^0.1.1: - version "0.1.7" - resolved "https://registry.yarnpkg.com/getpass/-/getpass-0.1.7.tgz#5eff8e3e684d569ae4cb2b1282604e8ba62149fa" - dependencies: - assert-plus "^1.0.0" - -glob-base@^0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/glob-base/-/glob-base-0.3.0.tgz#dbb164f6221b1c0b1ccf82aea328b497df0ea3c4" - dependencies: - glob-parent "^2.0.0" - is-glob "^2.0.0" - -glob-parent@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-2.0.0.tgz#81383d72db054fcccf5336daa902f182f6edbb28" - dependencies: - is-glob "^2.0.0" - -glob-parent@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-3.1.0.tgz#9e6af6299d8d3bd2bd40430832bd113df906c5ae" - dependencies: - is-glob "^3.1.0" - path-dirname "^1.0.0" - -glob@7.1.2, glob@^7.0.3, glob@^7.0.5, glob@^7.1.0, glob@^7.1.1, glob@^7.1.2: - version "7.1.2" - resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.2.tgz#c19c9df9a028702d678612384a6552404c636d15" - dependencies: - fs.realpath "^1.0.0" - inflight "^1.0.4" - inherits "2" - minimatch "^3.0.4" - once "^1.3.0" - path-is-absolute "^1.0.0" - -globals@^11.7.0: - version "11.7.0" - resolved "https://registry.yarnpkg.com/globals/-/globals-11.7.0.tgz#a583faa43055b1aca771914bf68258e2fc125673" - -globby@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/globby/-/globby-5.0.0.tgz#ebd84667ca0dbb330b99bcfc68eac2bc54370e0d" - dependencies: - array-union "^1.0.1" - arrify "^1.0.0" - glob "^7.0.3" - object-assign "^4.0.1" - pify "^2.0.0" - pinkie-promise "^2.0.0" - -graceful-fs@^4.1.2, graceful-fs@^4.1.6, graceful-fs@^4.1.9: - version "4.1.11" - resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.1.11.tgz#0e8bdfe4d1ddb8854d64e04ea7c00e2a026e5658" - -growl@1.10.5: - version "1.10.5" - resolved "https://registry.yarnpkg.com/growl/-/growl-1.10.5.tgz#f2735dc2283674fa67478b10181059355c369e5e" - -hapi-capitalize-modules@1.x.x: - version "1.1.6" - resolved "https://registry.yarnpkg.com/hapi-capitalize-modules/-/hapi-capitalize-modules-1.1.6.tgz#7991171415e15e6aa3231e64dda73c8146665318" - -hapi-for-you@1.x.x: - version "1.0.0" - resolved "https://registry.yarnpkg.com/hapi-for-you/-/hapi-for-you-1.0.0.tgz#d362fbee8d7bda9c2c7801e207e5a5cd1a0b6a7b" - -hapi-no-var@1.x.x: - version "1.0.1" - resolved "https://registry.yarnpkg.com/hapi-no-var/-/hapi-no-var-1.0.1.tgz#e9d87fd4de6149104a3fca797ef5c2ef5c182342" - -hapi-scope-start@2.x.x: - version "2.1.1" - resolved "https://registry.yarnpkg.com/hapi-scope-start/-/hapi-scope-start-2.1.1.tgz#7495a726fe72b7bca8de2cdcc1d87cd8ce6ab4f2" - -har-schema@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/har-schema/-/har-schema-2.0.0.tgz#a94c2224ebcac04782a0d9035521f24735b7ec92" - -har-validator@~2.0.6: - version "2.0.6" - resolved "https://registry.yarnpkg.com/har-validator/-/har-validator-2.0.6.tgz#cdcbc08188265ad119b6a5a7c8ab70eecfb5d27d" - dependencies: - chalk "^1.1.1" - commander "^2.9.0" - is-my-json-valid "^2.12.4" - pinkie-promise "^2.0.0" - -har-validator@~5.0.3: - version "5.0.3" - resolved "https://registry.yarnpkg.com/har-validator/-/har-validator-5.0.3.tgz#ba402c266194f15956ef15e0fcf242993f6a7dfd" - dependencies: - ajv "^5.1.0" - har-schema "^2.0.0" - -has-ansi@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/has-ansi/-/has-ansi-2.0.0.tgz#34f5049ce1ecdf2b0649af3ef24e45ed35416d91" - dependencies: - ansi-regex "^2.0.0" - -has-binary2@~1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/has-binary2/-/has-binary2-1.0.2.tgz#e83dba49f0b9be4d026d27365350d9f03f54be98" - dependencies: - isarray "2.0.1" - -has-cors@1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/has-cors/-/has-cors-1.1.0.tgz#5e474793f7ea9843d1bb99c23eef49ff126fff39" - -has-flag@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd" - -has-symbols@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/has-symbols/-/has-symbols-1.0.0.tgz#ba1a8f1af2a0fc39650f5c850367704122063b44" - -has-unicode@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/has-unicode/-/has-unicode-2.0.1.tgz#e0e6fe6a28cf51138855e086d1691e771de2a8b9" - -has-value@^0.3.1: - version "0.3.1" - resolved "https://registry.yarnpkg.com/has-value/-/has-value-0.3.1.tgz#7b1f58bada62ca827ec0a2078025654845995e1f" - dependencies: - get-value "^2.0.3" - has-values "^0.1.4" - isobject "^2.0.0" - -has-value@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/has-value/-/has-value-1.0.0.tgz#18b281da585b1c5c51def24c930ed29a0be6b177" - dependencies: - get-value "^2.0.6" - has-values "^1.0.0" - isobject "^3.0.0" - -has-values@^0.1.4: - version "0.1.4" - resolved "https://registry.yarnpkg.com/has-values/-/has-values-0.1.4.tgz#6d61de95d91dfca9b9a02089ad384bff8f62b771" - -has-values@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/has-values/-/has-values-1.0.0.tgz#95b0b63fec2146619a6fe57fe75628d5a39efe4f" - dependencies: - is-number "^3.0.0" - kind-of "^4.0.0" - -has@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/has/-/has-1.0.1.tgz#8461733f538b0837c9361e39a9ab9e9704dc2f28" - dependencies: - function-bind "^1.0.2" - -has@^1.0.1: - version "1.0.3" - resolved "https://registry.yarnpkg.com/has/-/has-1.0.3.tgz#722d7cbfc1f6aa8241f16dd814e011e1f41e8796" - dependencies: - function-bind "^1.1.1" - -hash-base@^3.0.0: - version "3.0.4" - resolved "https://registry.yarnpkg.com/hash-base/-/hash-base-3.0.4.tgz#5fc8686847ecd73499403319a6b0a3f3f6ae4918" - dependencies: - inherits "^2.0.1" - safe-buffer "^5.0.1" - -hash.js@^1.0.0, hash.js@^1.0.3: - version "1.1.3" - resolved "https://registry.yarnpkg.com/hash.js/-/hash.js-1.1.3.tgz#340dedbe6290187151c1ea1d777a3448935df846" - dependencies: - inherits "^2.0.3" - minimalistic-assert "^1.0.0" - -hasha@^2.2.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/hasha/-/hasha-2.2.0.tgz#78d7cbfc1e6d66303fe79837365984517b2f6ee1" - dependencies: - is-stream "^1.0.1" - pinkie-promise "^2.0.0" - -hat@^0.0.3: - version "0.0.3" - resolved "https://registry.yarnpkg.com/hat/-/hat-0.0.3.tgz#bb014a9e64b3788aed8005917413d4ff3d502d8a" - -hawk@~3.1.3: - version "3.1.3" - resolved "https://registry.yarnpkg.com/hawk/-/hawk-3.1.3.tgz#078444bd7c1640b0fe540d2c9b73d59678e8e1c4" - dependencies: - boom "2.x.x" - cryptiles "2.x.x" - hoek "2.x.x" - sntp "1.x.x" - -hawk@~6.0.2: - version "6.0.2" - resolved "https://registry.yarnpkg.com/hawk/-/hawk-6.0.2.tgz#af4d914eb065f9b5ce4d9d11c1cb2126eecc3038" - dependencies: - boom "4.x.x" - cryptiles "3.x.x" - hoek "4.x.x" - sntp "2.x.x" - -he@1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/he/-/he-1.1.1.tgz#93410fd21b009735151f8868c2f271f3427e23fd" - -hipchat-notifier@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/hipchat-notifier/-/hipchat-notifier-1.1.0.tgz#b6d249755437c191082367799d3ba9a0f23b231e" - dependencies: - lodash "^4.0.0" - request "^2.0.0" - -hmac-drbg@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/hmac-drbg/-/hmac-drbg-1.0.1.tgz#d2745701025a6c775a6c545793ed502fc0c649a1" - dependencies: - hash.js "^1.0.3" - minimalistic-assert "^1.0.0" - minimalistic-crypto-utils "^1.0.1" - -hoek@2.x.x: - version "2.16.3" - resolved "https://registry.yarnpkg.com/hoek/-/hoek-2.16.3.tgz#20bb7403d3cea398e91dc4710a8ff1b8274a25ed" - -hoek@4.x.x: - version "4.2.1" - resolved "https://registry.yarnpkg.com/hoek/-/hoek-4.2.1.tgz#9634502aa12c445dd5a7c5734b572bb8738aacbb" - -htmlescape@^1.1.0: - version "1.1.1" - resolved "https://registry.yarnpkg.com/htmlescape/-/htmlescape-1.1.1.tgz#3a03edc2214bca3b66424a3e7959349509cb0351" - -http-errors@1.6.2: - version "1.6.2" - resolved "https://registry.yarnpkg.com/http-errors/-/http-errors-1.6.2.tgz#0a002cc85707192a7e7946ceedc11155f60ec736" - dependencies: - depd "1.1.1" - inherits "2.0.3" - setprototypeof "1.0.3" - statuses ">= 1.3.1 < 2" - -http-errors@1.6.3, http-errors@~1.6.2: - version "1.6.3" - resolved "https://registry.yarnpkg.com/http-errors/-/http-errors-1.6.3.tgz#8b55680bb4be283a0b5bf4ea2e38580be1d9320d" - dependencies: - depd "~1.1.2" - inherits "2.0.3" - setprototypeof "1.1.0" - statuses ">= 1.4.0 < 2" - -http-proxy-agent@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/http-proxy-agent/-/http-proxy-agent-2.1.0.tgz#e4821beef5b2142a2026bd73926fe537631c5405" - dependencies: - agent-base "4" - debug "3.1.0" - -http-proxy@^1.13.0: - version "1.17.0" - resolved "https://registry.yarnpkg.com/http-proxy/-/http-proxy-1.17.0.tgz#7ad38494658f84605e2f6db4436df410f4e5be9a" - dependencies: - eventemitter3 "^3.0.0" - follow-redirects "^1.0.0" - requires-port "^1.0.0" - -http-signature@~1.1.0: - version "1.1.1" - resolved "https://registry.yarnpkg.com/http-signature/-/http-signature-1.1.1.tgz#df72e267066cd0ac67fb76adf8e134a8fbcf91bf" - dependencies: - assert-plus "^0.2.0" - jsprim "^1.2.2" - sshpk "^1.7.0" - -http-signature@~1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/http-signature/-/http-signature-1.2.0.tgz#9aecd925114772f3d95b65a60abb8f7c18fbace1" - dependencies: - assert-plus "^1.0.0" - jsprim "^1.2.2" - sshpk "^1.7.0" - -httpntlm@1.6.1: - version "1.6.1" - resolved "https://registry.yarnpkg.com/httpntlm/-/httpntlm-1.6.1.tgz#ad01527143a2e8773cfae6a96f58656bb52a34b2" - dependencies: - httpreq ">=0.4.22" - underscore "~1.7.0" - -httpreq@>=0.4.22: - version "0.4.24" - resolved "https://registry.yarnpkg.com/httpreq/-/httpreq-0.4.24.tgz#4335ffd82cd969668a39465c929ac61d6393627f" - -https-browserify@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/https-browserify/-/https-browserify-1.0.0.tgz#ec06c10e0a34c0f2faf199f7fd7fc78fffd03c73" - -https-proxy-agent@^2.2.1: - version "2.2.1" - resolved "https://registry.yarnpkg.com/https-proxy-agent/-/https-proxy-agent-2.2.1.tgz#51552970fa04d723e04c56d04178c3f92592bbc0" - dependencies: - agent-base "^4.1.0" - debug "^3.1.0" - -iconv-lite@0.4.15: - version "0.4.15" - resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.15.tgz#fe265a218ac6a57cfe854927e9d04c19825eddeb" - -iconv-lite@0.4.19: - version "0.4.19" - resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.19.tgz#f7468f60135f5e5dad3399c0a81be9a1603a082b" - -iconv-lite@0.4.23: - version "0.4.23" - resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.23.tgz#297871f63be507adcfbfca715d0cd0eed84e9a63" - dependencies: - safer-buffer ">= 2.1.2 < 3" - -iconv-lite@^0.4.17, iconv-lite@^0.4.4: - version "0.4.21" - resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.21.tgz#c47f8733d02171189ebc4a400f3218d348094798" - dependencies: - safer-buffer "^2.1.0" - -ieee754@^1.1.4: - version "1.1.11" - resolved "https://registry.yarnpkg.com/ieee754/-/ieee754-1.1.11.tgz#c16384ffe00f5b7835824e67b6f2bd44a5229455" - -ignore-walk@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/ignore-walk/-/ignore-walk-3.0.1.tgz#a83e62e7d272ac0e3b551aaa82831a19b69f82f8" - dependencies: - minimatch "^3.0.4" - -ignore@^4.0.2: - version "4.0.3" - resolved "https://registry.yarnpkg.com/ignore/-/ignore-4.0.3.tgz#e2d58c9654d75b542529fa28d80ac95b29e4f467" - -imurmurhash@^0.1.4: - version "0.1.4" - resolved "https://registry.yarnpkg.com/imurmurhash/-/imurmurhash-0.1.4.tgz#9218b9b2b928a238b13dc4fb6b6d576f231453ea" - -indexof@0.0.1: - version "0.0.1" - resolved "https://registry.yarnpkg.com/indexof/-/indexof-0.0.1.tgz#82dc336d232b9062179d05ab3293a66059fd435d" - -inflection@~1.12.0: - version "1.12.0" - resolved "https://registry.yarnpkg.com/inflection/-/inflection-1.12.0.tgz#a200935656d6f5f6bc4dc7502e1aecb703228416" - -inflection@~1.3.0: - version "1.3.8" - resolved "https://registry.yarnpkg.com/inflection/-/inflection-1.3.8.tgz#cbd160da9f75b14c3cc63578d4f396784bf3014e" - -inflight@^1.0.4: - version "1.0.6" - resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" - dependencies: - once "^1.3.0" - wrappy "1" - -inherits@2, inherits@2.0.3, inherits@^2.0.1, inherits@^2.0.3, inherits@~2.0.1, inherits@~2.0.3: - version "2.0.3" - resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" - -inherits@2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.1.tgz#b17d08d326b4423e568eff719f91b0b1cbdf69f1" - -ini@~1.3.0: - version "1.3.5" - resolved "https://registry.yarnpkg.com/ini/-/ini-1.3.5.tgz#eee25f56db1c9ec6085e0c22778083f596abf927" - -inline-source-map@~0.6.0: - version "0.6.2" - resolved "https://registry.yarnpkg.com/inline-source-map/-/inline-source-map-0.6.2.tgz#f9393471c18a79d1724f863fa38b586370ade2a5" - dependencies: - source-map "~0.5.3" - -inquirer@^5.2.0: - version "5.2.0" - resolved "https://registry.yarnpkg.com/inquirer/-/inquirer-5.2.0.tgz#db350c2b73daca77ff1243962e9f22f099685726" - dependencies: - ansi-escapes "^3.0.0" - chalk "^2.0.0" - cli-cursor "^2.1.0" - cli-width "^2.0.0" - external-editor "^2.1.0" - figures "^2.0.0" - lodash "^4.3.0" - mute-stream "0.0.7" - run-async "^2.2.0" - rxjs "^5.5.2" - string-width "^2.1.0" - strip-ansi "^4.0.0" - through "^2.3.6" - -insert-module-globals@^7.0.0: - version "7.0.6" - resolved "https://registry.yarnpkg.com/insert-module-globals/-/insert-module-globals-7.0.6.tgz#15a31d9d394e76d08838b9173016911d7fd4ea1b" - dependencies: - JSONStream "^1.0.3" - combine-source-map "^0.8.0" - concat-stream "^1.6.1" - is-buffer "^1.1.0" - lexical-scope "^1.2.0" - path-is-absolute "^1.0.1" - process "~0.11.0" - through2 "^2.0.0" - xtend "^4.0.0" - -ip@^1.1.2, ip@^1.1.4, ip@^1.1.5: - version "1.1.5" - resolved "https://registry.yarnpkg.com/ip/-/ip-1.1.5.tgz#bdded70114290828c0a039e72ef25f5aaec4354a" - -is-accessor-descriptor@^0.1.6: - version "0.1.6" - resolved "https://registry.yarnpkg.com/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz#a9e12cb3ae8d876727eeef3843f8a0897b5c98d6" - dependencies: - kind-of "^3.0.2" - -is-accessor-descriptor@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz#169c2f6d3df1f992618072365c9b0ea1f6878656" - dependencies: - kind-of "^6.0.0" - -is-binary-path@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/is-binary-path/-/is-binary-path-1.0.1.tgz#75f16642b480f187a711c814161fd3a4a7655898" - dependencies: - binary-extensions "^1.0.0" - -is-buffer@^1.1.0, is-buffer@^1.1.5: - version "1.1.6" - resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.6.tgz#efaa2ea9daa0d7ab2ea13a97b2b8ad51fefbe8be" - -is-callable@^1.1.1, is-callable@^1.1.3: - version "1.1.4" - resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.1.4.tgz#1e1adf219e1eeb684d691f9d6a05ff0d30a24d75" - -is-data-descriptor@^0.1.4: - version "0.1.4" - resolved "https://registry.yarnpkg.com/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz#0b5ee648388e2c860282e793f1856fec3f301b56" - dependencies: - kind-of "^3.0.2" - -is-data-descriptor@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz#d84876321d0e7add03990406abbbbd36ba9268c7" - dependencies: - kind-of "^6.0.0" - -is-date-object@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/is-date-object/-/is-date-object-1.0.1.tgz#9aa20eb6aeebbff77fbd33e74ca01b33581d3a16" - -is-descriptor@^0.1.0: - version "0.1.6" - resolved "https://registry.yarnpkg.com/is-descriptor/-/is-descriptor-0.1.6.tgz#366d8240dde487ca51823b1ab9f07a10a78251ca" - dependencies: - is-accessor-descriptor "^0.1.6" - is-data-descriptor "^0.1.4" - kind-of "^5.0.0" - -is-descriptor@^1.0.0, is-descriptor@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/is-descriptor/-/is-descriptor-1.0.2.tgz#3b159746a66604b04f8c81524ba365c5f14d86ec" - dependencies: - is-accessor-descriptor "^1.0.0" - is-data-descriptor "^1.0.0" - kind-of "^6.0.2" - -is-dotfile@^1.0.0: - version "1.0.3" - resolved "https://registry.yarnpkg.com/is-dotfile/-/is-dotfile-1.0.3.tgz#a6a2f32ffd2dfb04f5ca25ecd0f6b83cf798a1e1" - -is-equal-shallow@^0.1.3: - version "0.1.3" - resolved "https://registry.yarnpkg.com/is-equal-shallow/-/is-equal-shallow-0.1.3.tgz#2238098fc221de0bcfa5d9eac4c45d638aa1c534" - dependencies: - is-primitive "^2.0.0" - -is-extendable@^0.1.0, is-extendable@^0.1.1: - version "0.1.1" - resolved "https://registry.yarnpkg.com/is-extendable/-/is-extendable-0.1.1.tgz#62b110e289a471418e3ec36a617d472e301dfc89" - -is-extendable@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/is-extendable/-/is-extendable-1.0.1.tgz#a7470f9e426733d81bd81e1155264e3a3507cab4" - dependencies: - is-plain-object "^2.0.4" - -is-extglob@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-1.0.0.tgz#ac468177c4943405a092fc8f29760c6ffc6206c0" - -is-extglob@^2.1.0, is-extglob@^2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2" - -is-fullwidth-code-point@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz#ef9e31386f031a7f0d643af82fde50c457ef00cb" - dependencies: - number-is-nan "^1.0.0" - -is-fullwidth-code-point@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz#a3b30a5c4f199183167aaab93beefae3ddfb654f" - -is-glob@^2.0.0, is-glob@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-2.0.1.tgz#d096f926a3ded5600f3fdfd91198cb0888c2d863" - dependencies: - is-extglob "^1.0.0" - -is-glob@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-3.1.0.tgz#7ba5ae24217804ac70707b96922567486cc3e84a" - dependencies: - is-extglob "^2.1.0" - -is-glob@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.0.tgz#9521c76845cc2610a85203ddf080a958c2ffabc0" - dependencies: - is-extglob "^2.1.1" - -is-my-ip-valid@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-my-ip-valid/-/is-my-ip-valid-1.0.0.tgz#7b351b8e8edd4d3995d4d066680e664d94696824" - -is-my-json-valid@^2.12.4: - version "2.17.2" - resolved "https://registry.yarnpkg.com/is-my-json-valid/-/is-my-json-valid-2.17.2.tgz#6b2103a288e94ef3de5cf15d29dd85fc4b78d65c" - dependencies: - generate-function "^2.0.0" - generate-object-property "^1.1.0" - is-my-ip-valid "^1.0.0" - jsonpointer "^4.0.0" - xtend "^4.0.0" - -is-number@^0.1.1: - version "0.1.1" - resolved "https://registry.yarnpkg.com/is-number/-/is-number-0.1.1.tgz#69a7af116963d47206ec9bd9b48a14216f1e3806" - -is-number@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/is-number/-/is-number-2.1.0.tgz#01fcbbb393463a548f2f466cce16dece49db908f" - dependencies: - kind-of "^3.0.2" - -is-number@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/is-number/-/is-number-3.0.0.tgz#24fd6201a4782cf50561c810276afc7d12d71195" - dependencies: - kind-of "^3.0.2" - -is-path-cwd@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-path-cwd/-/is-path-cwd-1.0.0.tgz#d225ec23132e89edd38fda767472e62e65f1106d" - -is-path-in-cwd@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/is-path-in-cwd/-/is-path-in-cwd-1.0.1.tgz#5ac48b345ef675339bd6c7a48a912110b241cf52" - dependencies: - is-path-inside "^1.0.0" - -is-path-inside@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/is-path-inside/-/is-path-inside-1.0.1.tgz#8ef5b7de50437a3fdca6b4e865ef7aa55cb48036" - dependencies: - path-is-inside "^1.0.1" - -is-plain-object@^2.0.1, is-plain-object@^2.0.3, is-plain-object@^2.0.4: - version "2.0.4" - resolved "https://registry.yarnpkg.com/is-plain-object/-/is-plain-object-2.0.4.tgz#2c163b3fafb1b606d9d17928f05c2a1c38e07677" - dependencies: - isobject "^3.0.1" - -is-posix-bracket@^0.1.0: - version "0.1.1" - resolved "https://registry.yarnpkg.com/is-posix-bracket/-/is-posix-bracket-0.1.1.tgz#3334dc79774368e92f016e6fbc0a88f5cd6e6bc4" - -is-primitive@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/is-primitive/-/is-primitive-2.0.0.tgz#207bab91638499c07b2adf240a41a87210034575" - -is-promise@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/is-promise/-/is-promise-2.1.0.tgz#79a2a9ece7f096e80f36d2b2f3bc16c1ff4bf3fa" - -is-property@^1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/is-property/-/is-property-1.0.2.tgz#57fe1c4e48474edd65b09911f26b1cd4095dda84" - -is-regex@^1.0.4: - version "1.0.4" - resolved "https://registry.yarnpkg.com/is-regex/-/is-regex-1.0.4.tgz#5517489b547091b0930e095654ced25ee97e9491" - dependencies: - has "^1.0.1" - -is-resolvable@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/is-resolvable/-/is-resolvable-1.1.0.tgz#fb18f87ce1feb925169c9a407c19318a3206ed88" - -is-stream@^1.0.1, is-stream@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-1.1.0.tgz#12d4a3dd4e68e0b79ceb8dbc84173ae80d91ca44" - -is-symbol@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/is-symbol/-/is-symbol-1.0.1.tgz#3cc59f00025194b6ab2e38dbae6689256b660572" - -is-typedarray@~1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-typedarray/-/is-typedarray-1.0.0.tgz#e479c80858df0c1b11ddda6940f96011fcda4a9a" - -is-windows@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/is-windows/-/is-windows-1.0.2.tgz#d1850eb9791ecd18e6182ce12a30f396634bb19d" - -isarray@0.0.1: - version "0.0.1" - resolved "https://registry.yarnpkg.com/isarray/-/isarray-0.0.1.tgz#8a18acfca9a8f4177e09abfc6038939b05d1eedf" - -isarray@1.0.0, isarray@~1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" - -isarray@2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/isarray/-/isarray-2.0.1.tgz#a37d94ed9cda2d59865c9f76fe596ee1f338741e" - -isarray@^2.0.4: - version "2.0.4" - resolved "https://registry.yarnpkg.com/isarray/-/isarray-2.0.4.tgz#38e7bcbb0f3ba1b7933c86ba1894ddfc3781bbb7" - -isbinaryfile@^3.0.0: - version "3.0.2" - resolved "https://registry.yarnpkg.com/isbinaryfile/-/isbinaryfile-3.0.2.tgz#4a3e974ec0cba9004d3fc6cde7209ea69368a621" - -isexe@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" - -isobject@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/isobject/-/isobject-2.1.0.tgz#f065561096a3f1da2ef46272f815c840d87e0c89" - dependencies: - isarray "1.0.0" - -isobject@^3.0.0, isobject@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/isobject/-/isobject-3.0.1.tgz#4e431e92b11a9731636aa1f9c8d1ccbcfdab78df" - -isstream@~0.1.2: - version "0.1.2" - resolved "https://registry.yarnpkg.com/isstream/-/isstream-0.1.2.tgz#47e63f7af55afa6f92e1500e690eb8b8529c099a" - -js-string-escape@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/js-string-escape/-/js-string-escape-1.0.1.tgz#e2625badbc0d67c7533e9edc1068c587ae4137ef" - -js-tokens@^3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-3.0.2.tgz#9866df395102130e38f7f996bceb65443209c25b" - -js-yaml@^3.11.0: - version "3.12.0" - resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.12.0.tgz#eaed656ec8344f10f527c6bfa1b6e2244de167d1" - dependencies: - argparse "^1.0.7" - esprima "^4.0.0" - -jsbn@~0.1.0: - version "0.1.1" - resolved "https://registry.yarnpkg.com/jsbn/-/jsbn-0.1.1.tgz#a5e654c2e5a2deb5f201d96cefbca80c0ef2f513" - -json-schema-traverse@^0.3.0: - version "0.3.1" - resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-0.3.1.tgz#349a6d44c53a51de89b40805c5d5e59b417d3340" - -json-schema-traverse@^0.4.1: - version "0.4.1" - resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz#69f6a87d9513ab8bb8fe63bdb0979c448e684660" - -json-schema@0.2.3: - version "0.2.3" - resolved "https://registry.yarnpkg.com/json-schema/-/json-schema-0.2.3.tgz#b480c892e59a2f05954ce727bd3f2a4e882f9e13" - -json-stable-stringify-without-jsonify@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz#9db7b59496ad3f3cfef30a75142d2d930ad72651" - -json-stable-stringify@~0.0.0: - version "0.0.1" - resolved "https://registry.yarnpkg.com/json-stable-stringify/-/json-stable-stringify-0.0.1.tgz#611c23e814db375527df851193db59dd2af27f45" - dependencies: - jsonify "~0.0.0" - -json-stringify-safe@5.0.x, json-stringify-safe@~5.0.1: - version "5.0.1" - resolved "https://registry.yarnpkg.com/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz#1296a2d58fd45f19a0f6ce01d65701e2c735b6eb" - -jsonfile@^2.1.0: - version "2.4.0" - resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-2.4.0.tgz#3736a2b428b87bbda0cc83b53fa3d633a35c2ae8" - optionalDependencies: - graceful-fs "^4.1.6" - -jsonify@~0.0.0: - version "0.0.0" - resolved "https://registry.yarnpkg.com/jsonify/-/jsonify-0.0.0.tgz#2c74b6ee41d93ca51b7b5aaee8f503631d252a73" - -jsonparse@^1.2.0: - version "1.3.1" - resolved "https://registry.yarnpkg.com/jsonparse/-/jsonparse-1.3.1.tgz#3f4dae4a91fac315f71062f8521cc239f1366280" - -jsonpointer@^4.0.0: - version "4.0.1" - resolved "https://registry.yarnpkg.com/jsonpointer/-/jsonpointer-4.0.1.tgz#4fd92cb34e0e9db3c89c8622ecf51f9b978c6cb9" - -jsprim@^1.2.2: - version "1.4.1" - resolved "https://registry.yarnpkg.com/jsprim/-/jsprim-1.4.1.tgz#313e66bc1e5cc06e438bc1b7499c2e5c56acb6a2" - dependencies: - assert-plus "1.0.0" - extsprintf "1.3.0" - json-schema "0.2.3" - verror "1.10.0" - -karma-browserify@^5.3.0: - version "5.3.0" - resolved "https://registry.yarnpkg.com/karma-browserify/-/karma-browserify-5.3.0.tgz#9001796dfd1196cbc0327b022a00c6345a28e5dd" - dependencies: - convert-source-map "^1.1.3" - hat "^0.0.3" - js-string-escape "^1.0.0" - lodash "^4.17.10" - minimatch "^3.0.0" - os-shim "^0.1.3" - -karma-mocha-reporter@^2.2.5: - version "2.2.5" - resolved "https://registry.yarnpkg.com/karma-mocha-reporter/-/karma-mocha-reporter-2.2.5.tgz#15120095e8ed819186e47a0b012f3cd741895560" - dependencies: - chalk "^2.1.0" - log-symbols "^2.1.0" - strip-ansi "^4.0.0" - -karma-mocha@^1.3.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/karma-mocha/-/karma-mocha-1.3.0.tgz#eeaac7ffc0e201eb63c467440d2b69c7cf3778bf" - dependencies: - minimist "1.2.0" - -karma-phantomjs-launcher@^1.0.4: - version "1.0.4" - resolved "https://registry.yarnpkg.com/karma-phantomjs-launcher/-/karma-phantomjs-launcher-1.0.4.tgz#d23ca34801bda9863ad318e3bb4bd4062b13acd2" - dependencies: - lodash "^4.0.1" - phantomjs-prebuilt "^2.1.7" - -karma@^2.0.5: - version "2.0.5" - resolved "https://registry.yarnpkg.com/karma/-/karma-2.0.5.tgz#3710c7a2e71b1c439313f283846d88e04e4f918c" - dependencies: - bluebird "^3.3.0" - body-parser "^1.16.1" - chokidar "^2.0.3" - colors "^1.1.0" - combine-lists "^1.0.0" - connect "^3.6.0" - core-js "^2.2.0" - di "^0.0.1" - dom-serialize "^2.2.0" - expand-braces "^0.1.1" - glob "^7.1.1" - graceful-fs "^4.1.2" - http-proxy "^1.13.0" - isbinaryfile "^3.0.0" - lodash "^4.17.4" - log4js "^2.5.3" - mime "^1.3.4" - minimatch "^3.0.2" - optimist "^0.6.1" - qjobs "^1.1.4" - range-parser "^1.2.0" - rimraf "^2.6.0" - safe-buffer "^5.0.1" - socket.io "2.0.4" - source-map "^0.6.1" - tmp "0.0.33" - useragent "2.2.1" - -kew@^0.7.0: - version "0.7.0" - resolved "https://registry.yarnpkg.com/kew/-/kew-0.7.0.tgz#79d93d2d33363d6fdd2970b335d9141ad591d79b" - -kind-of@^3.0.2, kind-of@^3.0.3, kind-of@^3.2.0: - version "3.2.2" - resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-3.2.2.tgz#31ea21a734bab9bbb0f32466d893aea51e4a3c64" - dependencies: - is-buffer "^1.1.5" - -kind-of@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-4.0.0.tgz#20813df3d712928b207378691a45066fae72dd57" - dependencies: - is-buffer "^1.1.5" - -kind-of@^5.0.0: - version "5.1.0" - resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-5.1.0.tgz#729c91e2d857b7a419a1f9aa65685c4c33f5845d" - -kind-of@^6.0.0, kind-of@^6.0.2: - version "6.0.2" - resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-6.0.2.tgz#01146b36a6218e64e58f3a8d66de5d7fc6f6d051" - -klaw@^1.0.0: - version "1.3.1" - resolved "https://registry.yarnpkg.com/klaw/-/klaw-1.3.1.tgz#4088433b46b3b1ba259d78785d8e96f73ba02439" - optionalDependencies: - graceful-fs "^4.1.9" - -labeled-stream-splicer@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/labeled-stream-splicer/-/labeled-stream-splicer-2.0.1.tgz#9cffa32fd99e1612fd1d86a8db962416d5292926" - dependencies: - inherits "^2.0.1" - isarray "^2.0.4" - stream-splicer "^2.0.0" - -levn@^0.3.0, levn@~0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/levn/-/levn-0.3.0.tgz#3b09924edf9f083c0490fdd4c0bc4421e04764ee" - dependencies: - prelude-ls "~1.1.2" - type-check "~0.3.2" - -lexical-scope@^1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/lexical-scope/-/lexical-scope-1.2.0.tgz#fcea5edc704a4b3a8796cdca419c3a0afaf22df4" - dependencies: - astw "^2.0.0" - -libbase64@0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/libbase64/-/libbase64-0.1.0.tgz#62351a839563ac5ff5bd26f12f60e9830bb751e6" - -libmime@3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/libmime/-/libmime-3.0.0.tgz#51a1a9e7448ecbd32cda54421675bb21bc093da6" - dependencies: - iconv-lite "0.4.15" - libbase64 "0.1.0" - libqp "1.1.0" - -libqp@1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/libqp/-/libqp-1.1.0.tgz#f5e6e06ad74b794fb5b5b66988bf728ef1dedbe8" - -lodash.debounce@^4.0.8: - version "4.0.8" - resolved "https://registry.yarnpkg.com/lodash.debounce/-/lodash.debounce-4.0.8.tgz#82d79bff30a67c4005ffd5e2515300ad9ca4d7af" - -lodash.memoize@~3.0.3: - version "3.0.4" - resolved "https://registry.yarnpkg.com/lodash.memoize/-/lodash.memoize-3.0.4.tgz#2dcbd2c287cbc0a55cc42328bd0c736150d53e3f" - -lodash@^4.0.0, lodash@^4.0.1, lodash@^4.15.0, lodash@^4.17.10, lodash@^4.17.4, lodash@^4.17.5, lodash@^4.3.0, lodash@^4.5.0: - version "4.17.10" - resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.10.tgz#1b7793cf7259ea38fb3661d4d38b3260af8ae4e7" - -log-symbols@^2.1.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/log-symbols/-/log-symbols-2.2.0.tgz#5740e1c5d6f0dfda4ad9323b5332107ef6b4c40a" - dependencies: - chalk "^2.0.1" - -log4js@^2.5.3: - version "2.11.0" - resolved "https://registry.yarnpkg.com/log4js/-/log4js-2.11.0.tgz#bf3902eff65c6923d9ce9cfbd2db54160e34005a" - dependencies: - circular-json "^0.5.4" - date-format "^1.2.0" - debug "^3.1.0" - semver "^5.5.0" - streamroller "0.7.0" - optionalDependencies: - amqplib "^0.5.2" - axios "^0.15.3" - hipchat-notifier "^1.1.0" - loggly "^1.1.0" - mailgun-js "^0.18.0" - nodemailer "^2.5.0" - redis "^2.7.1" - slack-node "~0.2.0" - -loggly@^1.1.0: - version "1.1.1" - resolved "https://registry.yarnpkg.com/loggly/-/loggly-1.1.1.tgz#0a0fc1d3fa3a5ec44fdc7b897beba2a4695cebee" - dependencies: - json-stringify-safe "5.0.x" - request "2.75.x" - timespan "2.3.x" - -lru-cache@2.2.x: - version "2.2.4" - resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-2.2.4.tgz#6c658619becf14031d0d0b594b16042ce4dc063d" - -lru-cache@^4.1.2: - version "4.1.3" - resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-4.1.3.tgz#a1175cf3496dfc8436c156c334b4955992bce69c" - dependencies: - pseudomap "^1.0.2" - yallist "^2.1.2" - -mailcomposer@4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/mailcomposer/-/mailcomposer-4.0.1.tgz#0e1c44b2a07cf740ee17dc149ba009f19cadfeb4" - dependencies: - buildmail "4.0.1" - libmime "3.0.0" - -mailgun-js@^0.18.0: - version "0.18.1" - resolved "https://registry.yarnpkg.com/mailgun-js/-/mailgun-js-0.18.1.tgz#ee39aa18d7bb598a5ce9ede84afb681defc8a6b0" - dependencies: - async "~2.6.0" - debug "~3.1.0" - form-data "~2.3.0" - inflection "~1.12.0" - is-stream "^1.1.0" - path-proxy "~1.0.0" - promisify-call "^2.0.2" - proxy-agent "~3.0.0" - tsscmp "~1.0.0" - -map-cache@^0.2.2: - version "0.2.2" - resolved "https://registry.yarnpkg.com/map-cache/-/map-cache-0.2.2.tgz#c32abd0bd6525d9b051645bb4f26ac5dc98a0dbf" - -map-stream@~0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/map-stream/-/map-stream-0.1.0.tgz#e56aa94c4c8055a16404a0674b78f215f7c8e194" - -map-visit@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/map-visit/-/map-visit-1.0.0.tgz#ecdca8f13144e660f1b5bd41f12f3479d98dfb8f" - dependencies: - object-visit "^1.0.0" - -md5.js@^1.3.4: - version "1.3.4" - resolved "https://registry.yarnpkg.com/md5.js/-/md5.js-1.3.4.tgz#e9bdbde94a20a5ac18b04340fc5764d5b09d901d" - dependencies: - hash-base "^3.0.0" - inherits "^2.0.1" - -media-typer@0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/media-typer/-/media-typer-0.3.0.tgz#8710d7af0aa626f8fffa1ce00168545263255748" - -micromatch@^2.1.5: - version "2.3.11" - resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-2.3.11.tgz#86677c97d1720b363431d04d0d15293bd38c1565" - dependencies: - arr-diff "^2.0.0" - array-unique "^0.2.1" - braces "^1.8.2" - expand-brackets "^0.1.4" - extglob "^0.3.1" - filename-regex "^2.0.0" - is-extglob "^1.0.0" - is-glob "^2.0.1" - kind-of "^3.0.2" - normalize-path "^2.0.1" - object.omit "^2.0.0" - parse-glob "^3.0.4" - regex-cache "^0.4.2" - -micromatch@^3.1.4: - version "3.1.10" - resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-3.1.10.tgz#70859bc95c9840952f359a068a3fc49f9ecfac23" - dependencies: - arr-diff "^4.0.0" - array-unique "^0.3.2" - braces "^2.3.1" - define-property "^2.0.2" - extend-shallow "^3.0.2" - extglob "^2.0.4" - fragment-cache "^0.2.1" - kind-of "^6.0.2" - nanomatch "^1.2.9" - object.pick "^1.3.0" - regex-not "^1.0.0" - snapdragon "^0.8.1" - to-regex "^3.0.2" - -miller-rabin@^4.0.0: - version "4.0.1" - resolved "https://registry.yarnpkg.com/miller-rabin/-/miller-rabin-4.0.1.tgz#f080351c865b0dc562a8462966daa53543c78a4d" - dependencies: - bn.js "^4.0.0" - brorand "^1.0.1" - -mime-db@~1.33.0: - version "1.33.0" - resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.33.0.tgz#a3492050a5cb9b63450541e39d9788d2272783db" - -mime-types@^2.1.11, mime-types@^2.1.12, mime-types@~2.1.17, mime-types@~2.1.18, mime-types@~2.1.7: - version "2.1.18" - resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.18.tgz#6f323f60a83d11146f831ff11fd66e2fe5503bb8" - dependencies: - mime-db "~1.33.0" - -mime@^1.3.4: - version "1.6.0" - resolved "https://registry.yarnpkg.com/mime/-/mime-1.6.0.tgz#32cd9e5c64553bd58d19a568af452acff04981b1" - -mimic-fn@^1.0.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-1.2.0.tgz#820c86a39334640e99516928bd03fca88057d022" - -minimalistic-assert@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz#2e194de044626d4a10e7f7fbc00ce73e83e4d5c7" - -minimalistic-crypto-utils@^1.0.0, minimalistic-crypto-utils@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz#f6c00c1c0b082246e5c4d99dfb8c7c083b2b582a" - -minimatch@3.0.4, minimatch@^3.0.0, minimatch@^3.0.2, minimatch@^3.0.4: - version "3.0.4" - resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" - dependencies: - brace-expansion "^1.1.7" - -minimist@0.0.8: - version "0.0.8" - resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d" - -minimist@1.2.0, minimist@^1.1.0, minimist@^1.1.1, minimist@^1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.0.tgz#a35008b20f41383eec1fb914f4cd5df79a264284" - -minimist@~0.0.1: - version "0.0.10" - resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.10.tgz#de3f98543dbf96082be48ad1a0c7cda836301dcf" - -minipass@^2.2.1, minipass@^2.2.4: - version "2.2.4" - resolved "https://registry.yarnpkg.com/minipass/-/minipass-2.2.4.tgz#03c824d84551ec38a8d1bb5bc350a5a30a354a40" - dependencies: - safe-buffer "^5.1.1" - yallist "^3.0.0" - -minizlib@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/minizlib/-/minizlib-1.1.0.tgz#11e13658ce46bc3a70a267aac58359d1e0c29ceb" - dependencies: - minipass "^2.2.1" - -mixin-deep@^1.2.0: - version "1.3.1" - resolved "https://registry.yarnpkg.com/mixin-deep/-/mixin-deep-1.3.1.tgz#a49e7268dce1a0d9698e45326c5626df3543d0fe" - dependencies: - for-in "^1.0.2" - is-extendable "^1.0.1" - -mkdirp@0.5.0: - version "0.5.0" - resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.0.tgz#1d73076a6df986cd9344e15e71fcc05a4c9abf12" - dependencies: - minimist "0.0.8" - -mkdirp@0.5.1, mkdirp@^0.5.0, mkdirp@^0.5.1: - version "0.5.1" - resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.1.tgz#30057438eac6cf7f8c4767f38648d6697d75c903" - dependencies: - minimist "0.0.8" - -mocha@^5.2.0: - version "5.2.0" - resolved "https://registry.yarnpkg.com/mocha/-/mocha-5.2.0.tgz#6d8ae508f59167f940f2b5b3c4a612ae50c90ae6" - dependencies: - browser-stdout "1.3.1" - commander "2.15.1" - debug "3.1.0" - diff "3.5.0" - escape-string-regexp "1.0.5" - glob "7.1.2" - growl "1.10.5" - he "1.1.1" - minimatch "3.0.4" - mkdirp "0.5.1" - supports-color "5.4.0" - -module-deps@^6.0.0: - version "6.0.2" - resolved "https://registry.yarnpkg.com/module-deps/-/module-deps-6.0.2.tgz#660217d1602b863ac8d4d16951a3720dd9aa4c80" - dependencies: - JSONStream "^1.0.3" - browser-resolve "^1.7.0" - cached-path-relative "^1.0.0" - concat-stream "~1.6.0" - defined "^1.0.0" - detective "^5.0.2" - duplexer2 "^0.1.2" - inherits "^2.0.1" - parents "^1.0.0" - readable-stream "^2.0.2" - resolve "^1.4.0" - stream-combiner2 "^1.1.1" - subarg "^1.0.0" - through2 "^2.0.0" - xtend "^4.0.0" - -ms@2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8" - -mute-stream@0.0.7: - version "0.0.7" - resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-0.0.7.tgz#3075ce93bc21b8fab43e1bc4da7e8115ed1e7bab" - -nan@^2.9.2: - version "2.10.0" - resolved "https://registry.yarnpkg.com/nan/-/nan-2.10.0.tgz#96d0cd610ebd58d4b4de9cc0c6828cda99c7548f" - -nanomatch@^1.2.9: - version "1.2.13" - resolved "https://registry.yarnpkg.com/nanomatch/-/nanomatch-1.2.13.tgz#b87a8aa4fc0de8fe6be88895b38983ff265bd119" - dependencies: - arr-diff "^4.0.0" - array-unique "^0.3.2" - define-property "^2.0.2" - extend-shallow "^3.0.2" - fragment-cache "^0.2.1" - is-windows "^1.0.2" - kind-of "^6.0.2" - object.pick "^1.3.0" - regex-not "^1.0.0" - snapdragon "^0.8.1" - to-regex "^3.0.1" - -natural-compare@^1.4.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7" - -needle@^2.2.0, needle@^2.2.1: - version "2.2.1" - resolved "https://registry.yarnpkg.com/needle/-/needle-2.2.1.tgz#b5e325bd3aae8c2678902fa296f729455d1d3a7d" - dependencies: - debug "^2.1.2" - iconv-lite "^0.4.4" - sax "^1.2.4" - -negotiator@0.6.1: - version "0.6.1" - resolved "https://registry.yarnpkg.com/negotiator/-/negotiator-0.6.1.tgz#2b327184e8992101177b28563fb5e7102acd0ca9" - -netmask@^1.0.6: - version "1.0.6" - resolved "https://registry.yarnpkg.com/netmask/-/netmask-1.0.6.tgz#20297e89d86f6f6400f250d9f4f6b4c1945fcd35" - -nice-try@^1.0.4: - version "1.0.4" - resolved "https://registry.yarnpkg.com/nice-try/-/nice-try-1.0.4.tgz#d93962f6c52f2c1558c0fbda6d512819f1efe1c4" - -no-arrowception@1.x.x: - version "1.0.0" - resolved "https://registry.yarnpkg.com/no-arrowception/-/no-arrowception-1.0.0.tgz#5bf3e95eb9c41b57384a805333daa3b734ee327a" - -node-pre-gyp@^0.10.0: - version "0.10.3" - resolved "https://registry.yarnpkg.com/node-pre-gyp/-/node-pre-gyp-0.10.3.tgz#3070040716afdc778747b61b6887bf78880b80fc" - dependencies: - detect-libc "^1.0.2" - mkdirp "^0.5.1" - needle "^2.2.1" - nopt "^4.0.1" - npm-packlist "^1.1.6" - npmlog "^4.0.2" - rc "^1.2.7" - rimraf "^2.6.1" - semver "^5.3.0" - tar "^4" - -node-pre-gyp@^0.9.0: - version "0.9.1" - resolved "https://registry.yarnpkg.com/node-pre-gyp/-/node-pre-gyp-0.9.1.tgz#f11c07516dd92f87199dbc7e1838eab7cd56c9e0" - dependencies: - detect-libc "^1.0.2" - mkdirp "^0.5.1" - needle "^2.2.0" - nopt "^4.0.1" - npm-packlist "^1.1.6" - npmlog "^4.0.2" - rc "^1.1.7" - rimraf "^2.6.1" - semver "^5.3.0" - tar "^4" - -node-uuid@~1.4.7: - version "1.4.8" - resolved "https://registry.yarnpkg.com/node-uuid/-/node-uuid-1.4.8.tgz#b040eb0923968afabf8d32fb1f17f1167fdab907" - -nodemailer-direct-transport@3.3.2: - version "3.3.2" - resolved "https://registry.yarnpkg.com/nodemailer-direct-transport/-/nodemailer-direct-transport-3.3.2.tgz#e96fafb90358560947e569017d97e60738a50a86" - dependencies: - nodemailer-shared "1.1.0" - smtp-connection "2.12.0" - -nodemailer-fetch@1.6.0: - version "1.6.0" - resolved "https://registry.yarnpkg.com/nodemailer-fetch/-/nodemailer-fetch-1.6.0.tgz#79c4908a1c0f5f375b73fe888da9828f6dc963a4" - -nodemailer-shared@1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/nodemailer-shared/-/nodemailer-shared-1.1.0.tgz#cf5994e2fd268d00f5cf0fa767a08169edb07ec0" - dependencies: - nodemailer-fetch "1.6.0" - -nodemailer-smtp-pool@2.8.2: - version "2.8.2" - resolved "https://registry.yarnpkg.com/nodemailer-smtp-pool/-/nodemailer-smtp-pool-2.8.2.tgz#2eb94d6cf85780b1b4725ce853b9cbd5e8da8c72" - dependencies: - nodemailer-shared "1.1.0" - nodemailer-wellknown "0.1.10" - smtp-connection "2.12.0" - -nodemailer-smtp-transport@2.7.2: - version "2.7.2" - resolved "https://registry.yarnpkg.com/nodemailer-smtp-transport/-/nodemailer-smtp-transport-2.7.2.tgz#03d71c76314f14ac7dbc7bf033a6a6d16d67fb77" - dependencies: - nodemailer-shared "1.1.0" - nodemailer-wellknown "0.1.10" - smtp-connection "2.12.0" - -nodemailer-wellknown@0.1.10: - version "0.1.10" - resolved "https://registry.yarnpkg.com/nodemailer-wellknown/-/nodemailer-wellknown-0.1.10.tgz#586db8101db30cb4438eb546737a41aad0cf13d5" - -nodemailer@^2.5.0: - version "2.7.2" - resolved "https://registry.yarnpkg.com/nodemailer/-/nodemailer-2.7.2.tgz#f242e649aeeae39b6c7ed740ef7b061c404d30f9" - dependencies: - libmime "3.0.0" - mailcomposer "4.0.1" - nodemailer-direct-transport "3.3.2" - nodemailer-shared "1.1.0" - nodemailer-smtp-pool "2.8.2" - nodemailer-smtp-transport "2.7.2" - socks "1.1.9" - -nopt@^4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/nopt/-/nopt-4.0.1.tgz#d0d4685afd5415193c8c7505602d0d17cd64474d" - dependencies: - abbrev "1" - osenv "^0.1.4" - -normalize-path@^2.0.0, normalize-path@^2.0.1, normalize-path@^2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-2.1.1.tgz#1ab28b556e198363a8c1a6f7e6fa20137fe6aed9" - dependencies: - remove-trailing-separator "^1.0.1" - -npm-bundled@^1.0.1: - version "1.0.3" - resolved "https://registry.yarnpkg.com/npm-bundled/-/npm-bundled-1.0.3.tgz#7e71703d973af3370a9591bafe3a63aca0be2308" - -npm-packlist@^1.1.6: - version "1.1.10" - resolved "https://registry.yarnpkg.com/npm-packlist/-/npm-packlist-1.1.10.tgz#1039db9e985727e464df066f4cf0ab6ef85c398a" - dependencies: - ignore-walk "^3.0.1" - npm-bundled "^1.0.1" - -npmlog@^4.0.2: - version "4.1.2" - resolved "https://registry.yarnpkg.com/npmlog/-/npmlog-4.1.2.tgz#08a7f2a8bf734604779a9efa4ad5cc717abb954b" - dependencies: - are-we-there-yet "~1.1.2" - console-control-strings "~1.1.0" - gauge "~2.7.3" - set-blocking "~2.0.0" - -number-is-nan@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/number-is-nan/-/number-is-nan-1.0.1.tgz#097b602b53422a522c1afb8790318336941a011d" - -oauth-sign@~0.8.1, oauth-sign@~0.8.2: - version "0.8.2" - resolved "https://registry.yarnpkg.com/oauth-sign/-/oauth-sign-0.8.2.tgz#46a6ab7f0aead8deae9ec0565780b7d4efeb9d43" - -object-assign@^4.0.1, object-assign@^4.1.0: - version "4.1.1" - resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" - -object-component@0.0.3: - version "0.0.3" - resolved "https://registry.yarnpkg.com/object-component/-/object-component-0.0.3.tgz#f0c69aa50efc95b866c186f400a33769cb2f1291" - -object-copy@^0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/object-copy/-/object-copy-0.1.0.tgz#7e7d858b781bd7c991a41ba975ed3812754e998c" - dependencies: - copy-descriptor "^0.1.0" - define-property "^0.2.5" - kind-of "^3.0.3" - -object-keys@^1.0.8: - version "1.0.12" - resolved "https://registry.yarnpkg.com/object-keys/-/object-keys-1.0.12.tgz#09c53855377575310cca62f55bb334abff7b3ed2" - -object-visit@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/object-visit/-/object-visit-1.0.1.tgz#f79c4493af0c5377b59fe39d395e41042dd045bb" - dependencies: - isobject "^3.0.0" - -object.omit@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/object.omit/-/object.omit-2.0.1.tgz#1a9c744829f39dbb858c76ca3579ae2a54ebd1fa" - dependencies: - for-own "^0.1.4" - is-extendable "^0.1.1" - -object.pick@^1.3.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/object.pick/-/object.pick-1.3.0.tgz#87a10ac4c1694bd2e1cbf53591a66141fb5dd747" - dependencies: - isobject "^3.0.1" - -on-finished@~2.3.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/on-finished/-/on-finished-2.3.0.tgz#20f1336481b083cd75337992a16971aa2d906947" - dependencies: - ee-first "1.1.1" - -once@^1.3.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" - dependencies: - wrappy "1" - -onetime@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/onetime/-/onetime-2.0.1.tgz#067428230fd67443b2794b22bba528b6867962d4" - dependencies: - mimic-fn "^1.0.0" - -optimist@^0.6.1: - version "0.6.1" - resolved "https://registry.yarnpkg.com/optimist/-/optimist-0.6.1.tgz#da3ea74686fa21a19a111c326e90eb15a0196686" - dependencies: - minimist "~0.0.1" - wordwrap "~0.0.2" - -optionator@^0.8.1, optionator@^0.8.2: - version "0.8.2" - resolved "https://registry.yarnpkg.com/optionator/-/optionator-0.8.2.tgz#364c5e409d3f4d6301d6c0b4c05bba50180aeb64" - dependencies: - deep-is "~0.1.3" - fast-levenshtein "~2.0.4" - levn "~0.3.0" - prelude-ls "~1.1.2" - type-check "~0.3.2" - wordwrap "~1.0.0" - -os-browserify@~0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/os-browserify/-/os-browserify-0.3.0.tgz#854373c7f5c2315914fc9bfc6bd8238fdda1ec27" - -os-homedir@^1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/os-homedir/-/os-homedir-1.0.2.tgz#ffbc4988336e0e833de0c168c7ef152121aa7fb3" - -os-shim@^0.1.3: - version "0.1.3" - resolved "https://registry.yarnpkg.com/os-shim/-/os-shim-0.1.3.tgz#6b62c3791cf7909ea35ed46e17658bb417cb3917" - -os-tmpdir@^1.0.0, os-tmpdir@~1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274" - -osenv@^0.1.4: - version "0.1.5" - resolved "https://registry.yarnpkg.com/osenv/-/osenv-0.1.5.tgz#85cdfafaeb28e8677f416e287592b5f3f49ea410" - dependencies: - os-homedir "^1.0.0" - os-tmpdir "^1.0.0" - -outpipe@^1.1.0: - version "1.1.1" - resolved "https://registry.yarnpkg.com/outpipe/-/outpipe-1.1.1.tgz#50cf8616365e87e031e29a5ec9339a3da4725fa2" - dependencies: - shell-quote "^1.4.2" - -pac-proxy-agent@^2.0.1: - version "2.0.2" - resolved "https://registry.yarnpkg.com/pac-proxy-agent/-/pac-proxy-agent-2.0.2.tgz#90d9f6730ab0f4d2607dcdcd4d3d641aa26c3896" - dependencies: - agent-base "^4.2.0" - debug "^3.1.0" - get-uri "^2.0.0" - http-proxy-agent "^2.1.0" - https-proxy-agent "^2.2.1" - pac-resolver "^3.0.0" - raw-body "^2.2.0" - socks-proxy-agent "^3.0.0" - -pac-resolver@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/pac-resolver/-/pac-resolver-3.0.0.tgz#6aea30787db0a891704deb7800a722a7615a6f26" - dependencies: - co "^4.6.0" - degenerator "^1.0.4" - ip "^1.1.5" - netmask "^1.0.6" - thunkify "^2.1.2" - -pako@~1.0.5: - version "1.0.6" - resolved "https://registry.yarnpkg.com/pako/-/pako-1.0.6.tgz#0101211baa70c4bca4a0f63f2206e97b7dfaf258" - -parents@^1.0.0, parents@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/parents/-/parents-1.0.1.tgz#fedd4d2bf193a77745fe71e371d73c3307d9c751" - dependencies: - path-platform "~0.11.15" - -parse-asn1@^5.0.0: - version "5.1.1" - resolved "https://registry.yarnpkg.com/parse-asn1/-/parse-asn1-5.1.1.tgz#f6bf293818332bd0dab54efb16087724745e6ca8" - dependencies: - asn1.js "^4.0.0" - browserify-aes "^1.0.0" - create-hash "^1.1.0" - evp_bytestokey "^1.0.0" - pbkdf2 "^3.0.3" - -parse-glob@^3.0.4: - version "3.0.4" - resolved "https://registry.yarnpkg.com/parse-glob/-/parse-glob-3.0.4.tgz#b2c376cfb11f35513badd173ef0bb6e3a388391c" - dependencies: - glob-base "^0.3.0" - is-dotfile "^1.0.0" - is-extglob "^1.0.0" - is-glob "^2.0.0" - -parseqs@0.0.5: - version "0.0.5" - resolved "https://registry.yarnpkg.com/parseqs/-/parseqs-0.0.5.tgz#d5208a3738e46766e291ba2ea173684921a8b89d" - dependencies: - better-assert "~1.0.0" - -parseuri@0.0.5: - version "0.0.5" - resolved "https://registry.yarnpkg.com/parseuri/-/parseuri-0.0.5.tgz#80204a50d4dbb779bfdc6ebe2778d90e4bce320a" - dependencies: - better-assert "~1.0.0" - -parseurl@~1.3.2: - version "1.3.2" - resolved "https://registry.yarnpkg.com/parseurl/-/parseurl-1.3.2.tgz#fc289d4ed8993119460c156253262cdc8de65bf3" - -pascalcase@^0.1.1: - version "0.1.1" - resolved "https://registry.yarnpkg.com/pascalcase/-/pascalcase-0.1.1.tgz#b363e55e8006ca6fe21784d2db22bd15d7917f14" - -path-browserify@~0.0.0: - version "0.0.0" - resolved "https://registry.yarnpkg.com/path-browserify/-/path-browserify-0.0.0.tgz#a0b870729aae214005b7d5032ec2cbbb0fb4451a" - -path-dirname@^1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/path-dirname/-/path-dirname-1.0.2.tgz#cc33d24d525e099a5388c0336c6e32b9160609e0" - -path-is-absolute@^1.0.0, path-is-absolute@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" - -path-is-inside@^1.0.1, path-is-inside@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/path-is-inside/-/path-is-inside-1.0.2.tgz#365417dede44430d1c11af61027facf074bdfc53" - -path-key@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/path-key/-/path-key-2.0.1.tgz#411cadb574c5a140d3a4b1910d40d80cc9f40b40" - -path-parse@^1.0.5: - version "1.0.5" - resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.5.tgz#3c1adf871ea9cd6c9431b6ea2bd74a0ff055c4c1" - -path-platform@~0.11.15: - version "0.11.15" - resolved "https://registry.yarnpkg.com/path-platform/-/path-platform-0.11.15.tgz#e864217f74c36850f0852b78dc7bf7d4a5721bf2" - -path-proxy@~1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/path-proxy/-/path-proxy-1.0.0.tgz#18e8a36859fc9d2f1a53b48dee138543c020de5e" - dependencies: - inflection "~1.3.0" - -pause-stream@0.0.11: - version "0.0.11" - resolved "https://registry.yarnpkg.com/pause-stream/-/pause-stream-0.0.11.tgz#fe5a34b0cbce12b5aa6a2b403ee2e73b602f1445" - dependencies: - through "~2.3" - -pbkdf2@^3.0.3: - version "3.0.16" - resolved "https://registry.yarnpkg.com/pbkdf2/-/pbkdf2-3.0.16.tgz#7404208ec6b01b62d85bf83853a8064f8d9c2a5c" - dependencies: - create-hash "^1.1.2" - create-hmac "^1.1.4" - ripemd160 "^2.0.1" - safe-buffer "^5.0.1" - sha.js "^2.4.8" - -pend@~1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/pend/-/pend-1.2.0.tgz#7a57eb550a6783f9115331fcf4663d5c8e007a50" - -performance-now@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/performance-now/-/performance-now-2.1.0.tgz#6309f4e0e5fa913ec1c69307ae364b4b377c9e7b" - -phantomjs-prebuilt@^2.1.16, phantomjs-prebuilt@^2.1.7: - version "2.1.16" - resolved "https://registry.yarnpkg.com/phantomjs-prebuilt/-/phantomjs-prebuilt-2.1.16.tgz#efd212a4a3966d3647684ea8ba788549be2aefef" - dependencies: - es6-promise "^4.0.3" - extract-zip "^1.6.5" - fs-extra "^1.0.0" - hasha "^2.2.0" - kew "^0.7.0" - progress "^1.1.8" - request "^2.81.0" - request-progress "^2.0.1" - which "^1.2.10" - -pify@^2.0.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/pify/-/pify-2.3.0.tgz#ed141a6ac043a849ea588498e7dca8b15330e90c" - -pinkie-promise@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/pinkie-promise/-/pinkie-promise-2.0.1.tgz#2135d6dfa7a358c069ac9b178776288228450ffa" - dependencies: - pinkie "^2.0.0" - -pinkie@^2.0.0: - version "2.0.4" - resolved "https://registry.yarnpkg.com/pinkie/-/pinkie-2.0.4.tgz#72556b80cfa0d48a974e80e77248e80ed4f7f870" - -pluralize@^7.0.0: - version "7.0.0" - resolved "https://registry.yarnpkg.com/pluralize/-/pluralize-7.0.0.tgz#298b89df8b93b0221dbf421ad2b1b1ea23fc6777" - -posix-character-classes@^0.1.0: - version "0.1.1" - resolved "https://registry.yarnpkg.com/posix-character-classes/-/posix-character-classes-0.1.1.tgz#01eac0fe3b5af71a2a6c02feabb8c1fef7e00eab" - -prelude-ls@~1.1.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.1.2.tgz#21932a549f5e52ffd9a827f570e04be62a97da54" - -preserve@^0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/preserve/-/preserve-0.2.0.tgz#815ed1f6ebc65926f865b310c0713bcb3315ce4b" - -process-nextick-args@~1.0.6: - version "1.0.7" - resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-1.0.7.tgz#150e20b756590ad3f91093f25a4f2ad8bff30ba3" - -process-nextick-args@~2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-2.0.0.tgz#a37d732f4271b4ab1ad070d35508e8290788ffaa" - -process@~0.11.0: - version "0.11.10" - resolved "https://registry.yarnpkg.com/process/-/process-0.11.10.tgz#7332300e840161bda3e69a1d1d91a7d4bc16f182" - -progress@^1.1.8: - version "1.1.8" - resolved "https://registry.yarnpkg.com/progress/-/progress-1.1.8.tgz#e260c78f6161cdd9b0e56cc3e0a85de17c7a57be" - -progress@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/progress/-/progress-2.0.0.tgz#8a1be366bf8fc23db2bd23f10c6fe920b4389d1f" - -promisify-call@^2.0.2: - version "2.0.4" - resolved "https://registry.yarnpkg.com/promisify-call/-/promisify-call-2.0.4.tgz#d48c2d45652ccccd52801ddecbd533a6d4bd5fba" - dependencies: - with-callback "^1.0.2" - -proxy-agent@~3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/proxy-agent/-/proxy-agent-3.0.1.tgz#4fb7b61b1476d0fe8e3a3384d90e2460bbded3f9" - dependencies: - agent-base "^4.2.0" - debug "^3.1.0" - http-proxy-agent "^2.1.0" - https-proxy-agent "^2.2.1" - lru-cache "^4.1.2" - pac-proxy-agent "^2.0.1" - proxy-from-env "^1.0.0" - socks-proxy-agent "^4.0.1" - -proxy-from-env@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/proxy-from-env/-/proxy-from-env-1.0.0.tgz#33c50398f70ea7eb96d21f7b817630a55791c7ee" - -pseudomap@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/pseudomap/-/pseudomap-1.0.2.tgz#f052a28da70e618917ef0a8ac34c1ae5a68286b3" - -public-encrypt@^4.0.0: - version "4.0.2" - resolved "https://registry.yarnpkg.com/public-encrypt/-/public-encrypt-4.0.2.tgz#46eb9107206bf73489f8b85b69d91334c6610994" - dependencies: - bn.js "^4.1.0" - browserify-rsa "^4.0.0" - create-hash "^1.1.0" - parse-asn1 "^5.0.0" - randombytes "^2.0.1" - -punycode@1.3.2: - version "1.3.2" - resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.3.2.tgz#9653a036fb7c1ee42342f2325cceefea3926c48d" - -punycode@1.4.1, punycode@^1.3.2, punycode@^1.4.1: - version "1.4.1" - resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.4.1.tgz#c0d5a63b2718800ad8e1eb0fa5269c84dd41845e" - -punycode@^2.1.0: - version "2.1.1" - resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.1.tgz#b58b010ac40c22c5657616c8d2c2c02c7bf479ec" - -qjobs@^1.1.4: - version "1.2.0" - resolved "https://registry.yarnpkg.com/qjobs/-/qjobs-1.2.0.tgz#c45e9c61800bd087ef88d7e256423bdd49e5d071" - -qs@6.5.1: - version "6.5.1" - resolved "https://registry.yarnpkg.com/qs/-/qs-6.5.1.tgz#349cdf6eef89ec45c12d7d5eb3fc0c870343a6d8" - -qs@~6.2.0: - version "6.2.3" - resolved "https://registry.yarnpkg.com/qs/-/qs-6.2.3.tgz#1cfcb25c10a9b2b483053ff39f5dfc9233908cfe" - -qs@~6.5.1: - version "6.5.2" - resolved "https://registry.yarnpkg.com/qs/-/qs-6.5.2.tgz#cb3ae806e8740444584ef154ce8ee98d403f3e36" - -querystring-es3@~0.2.0: - version "0.2.1" - resolved "https://registry.yarnpkg.com/querystring-es3/-/querystring-es3-0.2.1.tgz#9ec61f79049875707d69414596fd907a4d711e73" - -querystring@0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/querystring/-/querystring-0.2.0.tgz#b209849203bb25df820da756e747005878521620" - -randomatic@^1.1.3: - version "1.1.7" - resolved "https://registry.yarnpkg.com/randomatic/-/randomatic-1.1.7.tgz#c7abe9cc8b87c0baa876b19fde83fd464797e38c" - dependencies: - is-number "^3.0.0" - kind-of "^4.0.0" - -randombytes@^2.0.0, randombytes@^2.0.1, randombytes@^2.0.5: - version "2.0.6" - resolved "https://registry.yarnpkg.com/randombytes/-/randombytes-2.0.6.tgz#d302c522948588848a8d300c932b44c24231da80" - dependencies: - safe-buffer "^5.1.0" - -randomfill@^1.0.3: - version "1.0.4" - resolved "https://registry.yarnpkg.com/randomfill/-/randomfill-1.0.4.tgz#c92196fc86ab42be983f1bf31778224931d61458" - dependencies: - randombytes "^2.0.5" - safe-buffer "^5.1.0" - -range-parser@^1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/range-parser/-/range-parser-1.2.0.tgz#f49be6b487894ddc40dcc94a322f611092e00d5e" - -raw-body@2.3.2: - version "2.3.2" - resolved "https://registry.yarnpkg.com/raw-body/-/raw-body-2.3.2.tgz#bcd60c77d3eb93cde0050295c3f379389bc88f89" - dependencies: - bytes "3.0.0" - http-errors "1.6.2" - iconv-lite "0.4.19" - unpipe "1.0.0" - -raw-body@^2.2.0: - version "2.3.3" - resolved "https://registry.yarnpkg.com/raw-body/-/raw-body-2.3.3.tgz#1b324ece6b5706e153855bc1148c65bb7f6ea0c3" - dependencies: - bytes "3.0.0" - http-errors "1.6.3" - iconv-lite "0.4.23" - unpipe "1.0.0" - -rc@^1.1.7: - version "1.2.7" - resolved "https://registry.yarnpkg.com/rc/-/rc-1.2.7.tgz#8a10ca30d588d00464360372b890d06dacd02297" - dependencies: - deep-extend "^0.5.1" - ini "~1.3.0" - minimist "^1.2.0" - strip-json-comments "~2.0.1" - -rc@^1.2.7: - version "1.2.8" - resolved "https://registry.yarnpkg.com/rc/-/rc-1.2.8.tgz#cd924bf5200a075b83c188cd6b9e211b7fc0d3ed" - dependencies: - deep-extend "^0.6.0" - ini "~1.3.0" - minimist "^1.2.0" - strip-json-comments "~2.0.1" - -read-only-stream@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/read-only-stream/-/read-only-stream-2.0.0.tgz#2724fd6a8113d73764ac288d4386270c1dbf17f0" - dependencies: - readable-stream "^2.0.2" - -readable-stream@1.1.x, "readable-stream@1.x >=1.1.9": - version "1.1.14" - resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-1.1.14.tgz#7cf4c54ef648e3813084c636dd2079e166c081d9" - dependencies: - core-util-is "~1.0.0" - inherits "~2.0.1" - isarray "0.0.1" - string_decoder "~0.10.x" - -readable-stream@2, readable-stream@^2.0.2, readable-stream@^2.0.6, readable-stream@^2.1.5, readable-stream@^2.2.2, readable-stream@^2.3.0, readable-stream@^2.3.3: - version "2.3.6" - resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.6.tgz#b11c27d88b8ff1fbe070643cf94b0c79ae1b0aaf" - dependencies: - core-util-is "~1.0.0" - inherits "~2.0.3" - isarray "~1.0.0" - process-nextick-args "~2.0.0" - safe-buffer "~5.1.1" - string_decoder "~1.1.1" - util-deprecate "~1.0.1" - -readable-stream@~2.0.5: - version "2.0.6" - resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.0.6.tgz#8f90341e68a53ccc928788dacfcd11b36eb9b78e" - dependencies: - core-util-is "~1.0.0" - inherits "~2.0.1" - isarray "~1.0.0" - process-nextick-args "~1.0.6" - string_decoder "~0.10.x" - util-deprecate "~1.0.1" - -readdirp@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-2.1.0.tgz#4ed0ad060df3073300c48440373f72d1cc642d78" - dependencies: - graceful-fs "^4.1.2" - minimatch "^3.0.2" - readable-stream "^2.0.2" - set-immediate-shim "^1.0.1" - -redis-commands@^1.2.0: - version "1.3.5" - resolved "https://registry.yarnpkg.com/redis-commands/-/redis-commands-1.3.5.tgz#4495889414f1e886261180b1442e7295602d83a2" - -redis-parser@^2.6.0: - version "2.6.0" - resolved "https://registry.yarnpkg.com/redis-parser/-/redis-parser-2.6.0.tgz#52ed09dacac108f1a631c07e9b69941e7a19504b" - -redis@^2.7.1: - version "2.8.0" - resolved "https://registry.yarnpkg.com/redis/-/redis-2.8.0.tgz#202288e3f58c49f6079d97af7a10e1303ae14b02" - dependencies: - double-ended-queue "^2.1.0-0" - redis-commands "^1.2.0" - redis-parser "^2.6.0" - -regex-cache@^0.4.2: - version "0.4.4" - resolved "https://registry.yarnpkg.com/regex-cache/-/regex-cache-0.4.4.tgz#75bdc58a2a1496cec48a12835bc54c8d562336dd" - dependencies: - is-equal-shallow "^0.1.3" - -regex-not@^1.0.0, regex-not@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/regex-not/-/regex-not-1.0.2.tgz#1f4ece27e00b0b65e0247a6810e6a85d83a5752c" - dependencies: - extend-shallow "^3.0.2" - safe-regex "^1.1.0" - -regexp.prototype.flags@^1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/regexp.prototype.flags/-/regexp.prototype.flags-1.2.0.tgz#6b30724e306a27833eeb171b66ac8890ba37e41c" - dependencies: - define-properties "^1.1.2" - -regexpp@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/regexpp/-/regexpp-1.1.0.tgz#0e3516dd0b7904f413d2d4193dce4618c3a689ab" - -remove-trailing-separator@^1.0.1: - version "1.1.0" - resolved "https://registry.yarnpkg.com/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz#c24bce2a283adad5bc3f58e0d48249b92379d8ef" - -repeat-element@^1.1.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/repeat-element/-/repeat-element-1.1.2.tgz#ef089a178d1483baae4d93eb98b4f9e4e11d990a" - -repeat-string@^0.2.2: - version "0.2.2" - resolved "https://registry.yarnpkg.com/repeat-string/-/repeat-string-0.2.2.tgz#c7a8d3236068362059a7e4651fc6884e8b1fb4ae" - -repeat-string@^1.5.2, repeat-string@^1.6.1: - version "1.6.1" - resolved "https://registry.yarnpkg.com/repeat-string/-/repeat-string-1.6.1.tgz#8dcae470e1c88abc2d600fff4a776286da75e637" - -request-progress@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/request-progress/-/request-progress-2.0.1.tgz#5d36bb57961c673aa5b788dbc8141fdf23b44e08" - dependencies: - throttleit "^1.0.0" - -request@2.75.x: - version "2.75.0" - resolved "https://registry.yarnpkg.com/request/-/request-2.75.0.tgz#d2b8268a286da13eaa5d01adf5d18cc90f657d93" - dependencies: - aws-sign2 "~0.6.0" - aws4 "^1.2.1" - bl "~1.1.2" - caseless "~0.11.0" - combined-stream "~1.0.5" - extend "~3.0.0" - forever-agent "~0.6.1" - form-data "~2.0.0" - har-validator "~2.0.6" - hawk "~3.1.3" - http-signature "~1.1.0" - is-typedarray "~1.0.0" - isstream "~0.1.2" - json-stringify-safe "~5.0.1" - mime-types "~2.1.7" - node-uuid "~1.4.7" - oauth-sign "~0.8.1" - qs "~6.2.0" - stringstream "~0.0.4" - tough-cookie "~2.3.0" - tunnel-agent "~0.4.1" - -request@^2.0.0, request@^2.74.0, request@^2.81.0: - version "2.85.0" - resolved "https://registry.yarnpkg.com/request/-/request-2.85.0.tgz#5a03615a47c61420b3eb99b7dba204f83603e1fa" - dependencies: - aws-sign2 "~0.7.0" - aws4 "^1.6.0" - caseless "~0.12.0" - combined-stream "~1.0.5" - extend "~3.0.1" - forever-agent "~0.6.1" - form-data "~2.3.1" - har-validator "~5.0.3" - hawk "~6.0.2" - http-signature "~1.2.0" - is-typedarray "~1.0.0" - isstream "~0.1.2" - json-stringify-safe "~5.0.1" - mime-types "~2.1.17" - oauth-sign "~0.8.2" - performance-now "^2.1.0" - qs "~6.5.1" - safe-buffer "^5.1.1" - stringstream "~0.0.5" - tough-cookie "~2.3.3" - tunnel-agent "^0.6.0" - uuid "^3.1.0" - -request@^2.87.0: - version "2.87.0" - resolved "https://registry.yarnpkg.com/request/-/request-2.87.0.tgz#32f00235cd08d482b4d0d68db93a829c0ed5756e" - dependencies: - aws-sign2 "~0.7.0" - aws4 "^1.6.0" - caseless "~0.12.0" - combined-stream "~1.0.5" - extend "~3.0.1" - forever-agent "~0.6.1" - form-data "~2.3.1" - har-validator "~5.0.3" - http-signature "~1.2.0" - is-typedarray "~1.0.0" - isstream "~0.1.2" - json-stringify-safe "~5.0.1" - mime-types "~2.1.17" - oauth-sign "~0.8.2" - performance-now "^2.1.0" - qs "~6.5.1" - safe-buffer "^5.1.1" - tough-cookie "~2.3.3" - tunnel-agent "^0.6.0" - uuid "^3.1.0" - -requestretry@^1.2.2: - version "1.13.0" - resolved "https://registry.yarnpkg.com/requestretry/-/requestretry-1.13.0.tgz#213ec1006eeb750e8b8ce54176283d15a8d55d94" - dependencies: - extend "^3.0.0" - lodash "^4.15.0" - request "^2.74.0" - when "^3.7.7" - -require-uncached@^1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/require-uncached/-/require-uncached-1.0.3.tgz#4e0d56d6c9662fd31e43011c4b95aa49955421d3" - dependencies: - caller-path "^0.1.0" - resolve-from "^1.0.0" - -requires-port@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/requires-port/-/requires-port-1.0.0.tgz#925d2601d39ac485e091cf0da5c6e694dc3dcaff" - -resolve-from@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-1.0.1.tgz#26cbfe935d1aeeeabb29bc3fe5aeb01e93d44226" - -resolve-url@^0.2.1: - version "0.2.1" - resolved "https://registry.yarnpkg.com/resolve-url/-/resolve-url-0.2.1.tgz#2c637fe77c893afd2a663fe21aa9080068e2052a" - -resolve@1.1.7: - version "1.1.7" - resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.1.7.tgz#203114d82ad2c5ed9e8e0411b3932875e889e97b" - -resolve@^1.1.4, resolve@^1.4.0: - version "1.7.1" - resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.7.1.tgz#aadd656374fd298aee895bc026b8297418677fd3" - dependencies: - path-parse "^1.0.5" - -restore-cursor@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/restore-cursor/-/restore-cursor-2.0.0.tgz#9f7ee287f82fd326d4fd162923d62129eee0dfaf" - dependencies: - onetime "^2.0.0" - signal-exit "^3.0.2" - -ret@~0.1.10: - version "0.1.15" - resolved "https://registry.yarnpkg.com/ret/-/ret-0.1.15.tgz#b8a4825d5bdb1fc3f6f53c2bc33f81388681c7bc" - -rimraf@^2.2.8, rimraf@^2.6.0, rimraf@^2.6.1: - version "2.6.2" - resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.6.2.tgz#2ed8150d24a16ea8651e6d6ef0f47c4158ce7a36" - dependencies: - glob "^7.0.5" - -ripemd160@^2.0.0, ripemd160@^2.0.1: - version "2.0.2" - resolved "https://registry.yarnpkg.com/ripemd160/-/ripemd160-2.0.2.tgz#a1c1a6f624751577ba5d07914cbc92850585890c" - dependencies: - hash-base "^3.0.0" - inherits "^2.0.1" - -run-async@^2.2.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/run-async/-/run-async-2.3.0.tgz#0371ab4ae0bdd720d4166d7dfda64ff7a445a6c0" - dependencies: - is-promise "^2.1.0" - -rxjs@^5.5.2: - version "5.5.11" - resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-5.5.11.tgz#f733027ca43e3bec6b994473be4ab98ad43ced87" - dependencies: - symbol-observable "1.0.1" - -safe-buffer@^5.0.1, safe-buffer@^5.1.0, safe-buffer@^5.1.1, safe-buffer@^5.1.2, safe-buffer@~5.1.0, safe-buffer@~5.1.1: - version "5.1.2" - resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d" - -safe-regex@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/safe-regex/-/safe-regex-1.1.0.tgz#40a3669f3b077d1e943d44629e157dd48023bf2e" - dependencies: - ret "~0.1.10" - -"safer-buffer@>= 2.1.2 < 3", safer-buffer@^2.1.0: - version "2.1.2" - resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" - -sax@^1.2.4: - version "1.2.4" - resolved "https://registry.yarnpkg.com/sax/-/sax-1.2.4.tgz#2816234e2378bddc4e5354fab5caa895df7100d9" - -semver@^5.3.0, semver@^5.5.0: - version "5.5.0" - resolved "https://registry.yarnpkg.com/semver/-/semver-5.5.0.tgz#dc4bbc7a6ca9d916dee5d43516f0092b58f7b8ab" - -set-blocking@~2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/set-blocking/-/set-blocking-2.0.0.tgz#045f9782d011ae9a6803ddd382b24392b3d890f7" - -set-immediate-shim@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/set-immediate-shim/-/set-immediate-shim-1.0.1.tgz#4b2b1b27eb808a9f8dcc481a58e5e56f599f3f61" - -set-value@^0.4.3: - version "0.4.3" - resolved "https://registry.yarnpkg.com/set-value/-/set-value-0.4.3.tgz#7db08f9d3d22dc7f78e53af3c3bf4666ecdfccf1" - dependencies: - extend-shallow "^2.0.1" - is-extendable "^0.1.1" - is-plain-object "^2.0.1" - to-object-path "^0.3.0" - -set-value@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/set-value/-/set-value-2.0.0.tgz#71ae4a88f0feefbbf52d1ea604f3fb315ebb6274" - dependencies: - extend-shallow "^2.0.1" - is-extendable "^0.1.1" - is-plain-object "^2.0.3" - split-string "^3.0.1" - -setprototypeof@1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/setprototypeof/-/setprototypeof-1.0.3.tgz#66567e37043eeb4f04d91bd658c0cbefb55b8e04" - -setprototypeof@1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/setprototypeof/-/setprototypeof-1.1.0.tgz#d0bd85536887b6fe7c0d818cb962d9d91c54e656" - -sha.js@^2.4.0, sha.js@^2.4.8, sha.js@~2.4.4: - version "2.4.11" - resolved "https://registry.yarnpkg.com/sha.js/-/sha.js-2.4.11.tgz#37a5cf0b81ecbc6943de109ba2960d1b26584ae7" - dependencies: - inherits "^2.0.1" - safe-buffer "^5.0.1" - -shasum@^1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/shasum/-/shasum-1.0.2.tgz#e7012310d8f417f4deb5712150e5678b87ae565f" - dependencies: - json-stable-stringify "~0.0.0" - sha.js "~2.4.4" - -shebang-command@^1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-1.2.0.tgz#44aac65b695b03398968c39f363fee5deafdf1ea" - dependencies: - shebang-regex "^1.0.0" - -shebang-regex@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-1.0.0.tgz#da42f49740c0b42db2ca9728571cb190c98efea3" - -shell-quote@^1.4.2, shell-quote@^1.6.1: - version "1.6.1" - resolved "https://registry.yarnpkg.com/shell-quote/-/shell-quote-1.6.1.tgz#f4781949cce402697127430ea3b3c5476f481767" - dependencies: - array-filter "~0.0.0" - array-map "~0.0.0" - array-reduce "~0.0.0" - jsonify "~0.0.0" - -signal-exit@^3.0.0, signal-exit@^3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.2.tgz#b5fdc08f1287ea1178628e415e25132b73646c6d" - -slack-node@~0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/slack-node/-/slack-node-0.2.0.tgz#de4b8dddaa8b793f61dbd2938104fdabf37dfa30" - dependencies: - requestretry "^1.2.2" - -slice-ansi@1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/slice-ansi/-/slice-ansi-1.0.0.tgz#044f1a49d8842ff307aad6b505ed178bd950134d" - dependencies: - is-fullwidth-code-point "^2.0.0" - -smart-buffer@^1.0.13, smart-buffer@^1.0.4: - version "1.1.15" - resolved "https://registry.yarnpkg.com/smart-buffer/-/smart-buffer-1.1.15.tgz#7f114b5b65fab3e2a35aa775bb12f0d1c649bf16" - -smart-buffer@^4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/smart-buffer/-/smart-buffer-4.0.1.tgz#07ea1ca8d4db24eb4cac86537d7d18995221ace3" - -smtp-connection@2.12.0: - version "2.12.0" - resolved "https://registry.yarnpkg.com/smtp-connection/-/smtp-connection-2.12.0.tgz#d76ef9127cb23c2259edb1e8349c2e8d5e2d74c1" - dependencies: - httpntlm "1.6.1" - nodemailer-shared "1.1.0" - -snapdragon-node@^2.0.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/snapdragon-node/-/snapdragon-node-2.1.1.tgz#6c175f86ff14bdb0724563e8f3c1b021a286853b" - dependencies: - define-property "^1.0.0" - isobject "^3.0.0" - snapdragon-util "^3.0.1" - -snapdragon-util@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/snapdragon-util/-/snapdragon-util-3.0.1.tgz#f956479486f2acd79700693f6f7b805e45ab56e2" - dependencies: - kind-of "^3.2.0" - -snapdragon@^0.8.1: - version "0.8.2" - resolved "https://registry.yarnpkg.com/snapdragon/-/snapdragon-0.8.2.tgz#64922e7c565b0e14204ba1aa7d6964278d25182d" - dependencies: - base "^0.11.1" - debug "^2.2.0" - define-property "^0.2.5" - extend-shallow "^2.0.1" - map-cache "^0.2.2" - source-map "^0.5.6" - source-map-resolve "^0.5.0" - use "^3.1.0" - -sntp@1.x.x: - version "1.0.9" - resolved "https://registry.yarnpkg.com/sntp/-/sntp-1.0.9.tgz#6541184cc90aeea6c6e7b35e2659082443c66198" - dependencies: - hoek "2.x.x" - -sntp@2.x.x: - version "2.1.0" - resolved "https://registry.yarnpkg.com/sntp/-/sntp-2.1.0.tgz#2c6cec14fedc2222739caf9b5c3d85d1cc5a2cc8" - dependencies: - hoek "4.x.x" - -socket.io-adapter@~1.1.0: - version "1.1.1" - resolved "https://registry.yarnpkg.com/socket.io-adapter/-/socket.io-adapter-1.1.1.tgz#2a805e8a14d6372124dd9159ad4502f8cb07f06b" - -socket.io-client@2.0.4: - version "2.0.4" - resolved "https://registry.yarnpkg.com/socket.io-client/-/socket.io-client-2.0.4.tgz#0918a552406dc5e540b380dcd97afc4a64332f8e" - dependencies: - backo2 "1.0.2" - base64-arraybuffer "0.1.5" - component-bind "1.0.0" - component-emitter "1.2.1" - debug "~2.6.4" - engine.io-client "~3.1.0" - has-cors "1.1.0" - indexof "0.0.1" - object-component "0.0.3" - parseqs "0.0.5" - parseuri "0.0.5" - socket.io-parser "~3.1.1" - to-array "0.1.4" - -socket.io-parser@~3.1.1: - version "3.1.3" - resolved "https://registry.yarnpkg.com/socket.io-parser/-/socket.io-parser-3.1.3.tgz#ed2da5ee79f10955036e3da413bfd7f1e4d86c8e" - dependencies: - component-emitter "1.2.1" - debug "~3.1.0" - has-binary2 "~1.0.2" - isarray "2.0.1" - -socket.io@2.0.4: - version "2.0.4" - resolved "https://registry.yarnpkg.com/socket.io/-/socket.io-2.0.4.tgz#c1a4590ceff87ecf13c72652f046f716b29e6014" - dependencies: - debug "~2.6.6" - engine.io "~3.1.0" - socket.io-adapter "~1.1.0" - socket.io-client "2.0.4" - socket.io-parser "~3.1.1" - -socks-proxy-agent@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/socks-proxy-agent/-/socks-proxy-agent-3.0.1.tgz#2eae7cf8e2a82d34565761539a7f9718c5617659" - dependencies: - agent-base "^4.1.0" - socks "^1.1.10" - -socks-proxy-agent@^4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/socks-proxy-agent/-/socks-proxy-agent-4.0.1.tgz#5936bf8b707a993079c6f37db2091821bffa6473" - dependencies: - agent-base "~4.2.0" - socks "~2.2.0" - -socks@1.1.9: - version "1.1.9" - resolved "https://registry.yarnpkg.com/socks/-/socks-1.1.9.tgz#628d7e4d04912435445ac0b6e459376cb3e6d691" - dependencies: - ip "^1.1.2" - smart-buffer "^1.0.4" - -socks@^1.1.10: - version "1.1.10" - resolved "https://registry.yarnpkg.com/socks/-/socks-1.1.10.tgz#5b8b7fc7c8f341c53ed056e929b7bf4de8ba7b5a" - dependencies: - ip "^1.1.4" - smart-buffer "^1.0.13" - -socks@~2.2.0: - version "2.2.1" - resolved "https://registry.yarnpkg.com/socks/-/socks-2.2.1.tgz#68ad678b3642fbc5d99c64c165bc561eab0215f9" - dependencies: - ip "^1.1.5" - smart-buffer "^4.0.1" - -source-map-resolve@^0.5.0: - version "0.5.2" - resolved "https://registry.yarnpkg.com/source-map-resolve/-/source-map-resolve-0.5.2.tgz#72e2cc34095543e43b2c62b2c4c10d4a9054f259" - dependencies: - atob "^2.1.1" - decode-uri-component "^0.2.0" - resolve-url "^0.2.1" - source-map-url "^0.4.0" - urix "^0.1.0" - -source-map-url@^0.4.0: - version "0.4.0" - resolved "https://registry.yarnpkg.com/source-map-url/-/source-map-url-0.4.0.tgz#3e935d7ddd73631b97659956d55128e87b5084a3" - -source-map@^0.5.6, source-map@~0.5.3: - version "0.5.7" - resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.7.tgz#8a039d2d1021d22d1ea14c80d8ea468ba2ef3fcc" - -source-map@^0.6.1, source-map@~0.6.1: - version "0.6.1" - resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" - -split-string@^3.0.1, split-string@^3.0.2: - version "3.1.0" - resolved "https://registry.yarnpkg.com/split-string/-/split-string-3.1.0.tgz#7cb09dda3a86585705c64b39a6466038682e8fe2" - dependencies: - extend-shallow "^3.0.0" - -split@0.3: - version "0.3.3" - resolved "https://registry.yarnpkg.com/split/-/split-0.3.3.tgz#cd0eea5e63a211dfff7eb0f091c4133e2d0dd28f" - dependencies: - through "2" - -sprintf-js@~1.0.2: - version "1.0.3" - resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c" - -sshpk@^1.7.0: - version "1.14.1" - resolved "https://registry.yarnpkg.com/sshpk/-/sshpk-1.14.1.tgz#130f5975eddad963f1d56f92b9ac6c51fa9f83eb" - dependencies: - asn1 "~0.2.3" - assert-plus "^1.0.0" - dashdash "^1.12.0" - getpass "^0.1.1" - optionalDependencies: - bcrypt-pbkdf "^1.0.0" - ecc-jsbn "~0.1.1" - jsbn "~0.1.0" - tweetnacl "~0.14.0" - -static-extend@^0.1.1: - version "0.1.2" - resolved "https://registry.yarnpkg.com/static-extend/-/static-extend-0.1.2.tgz#60809c39cbff55337226fd5e0b520f341f1fb5c6" - dependencies: - define-property "^0.2.5" - object-copy "^0.1.0" - -"statuses@>= 1.3.1 < 2", "statuses@>= 1.4.0 < 2": - version "1.5.0" - resolved "https://registry.yarnpkg.com/statuses/-/statuses-1.5.0.tgz#161c7dac177659fd9811f43771fa99381478628c" - -statuses@~1.3.1: - version "1.3.1" - resolved "https://registry.yarnpkg.com/statuses/-/statuses-1.3.1.tgz#faf51b9eb74aaef3b3acf4ad5f61abf24cb7b93e" - -stream-browserify@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/stream-browserify/-/stream-browserify-2.0.1.tgz#66266ee5f9bdb9940a4e4514cafb43bb71e5c9db" - dependencies: - inherits "~2.0.1" - readable-stream "^2.0.2" - -stream-combiner2@^1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/stream-combiner2/-/stream-combiner2-1.1.1.tgz#fb4d8a1420ea362764e21ad4780397bebcb41cbe" - dependencies: - duplexer2 "~0.1.0" - readable-stream "^2.0.2" - -stream-combiner@~0.0.4: - version "0.0.4" - resolved "https://registry.yarnpkg.com/stream-combiner/-/stream-combiner-0.0.4.tgz#4d5e433c185261dde623ca3f44c586bcf5c4ad14" - dependencies: - duplexer "~0.1.1" - -stream-http@^2.0.0: - version "2.8.1" - resolved "https://registry.yarnpkg.com/stream-http/-/stream-http-2.8.1.tgz#d0441be1a457a73a733a8a7b53570bebd9ef66a4" - dependencies: - builtin-status-codes "^3.0.0" - inherits "^2.0.1" - readable-stream "^2.3.3" - to-arraybuffer "^1.0.0" - xtend "^4.0.0" - -stream-splicer@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/stream-splicer/-/stream-splicer-2.0.0.tgz#1b63be438a133e4b671cc1935197600175910d83" - dependencies: - inherits "^2.0.1" - readable-stream "^2.0.2" - -streamroller@0.7.0: - version "0.7.0" - resolved "https://registry.yarnpkg.com/streamroller/-/streamroller-0.7.0.tgz#a1d1b7cf83d39afb0d63049a5acbf93493bdf64b" - dependencies: - date-format "^1.2.0" - debug "^3.1.0" - mkdirp "^0.5.1" - readable-stream "^2.3.0" - -string-width@^1.0.1, string-width@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/string-width/-/string-width-1.0.2.tgz#118bdf5b8cdc51a2a7e70d211e07e2b0b9b107d3" - dependencies: - code-point-at "^1.0.0" - is-fullwidth-code-point "^1.0.0" - strip-ansi "^3.0.0" - -string-width@^2.1.0, string-width@^2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/string-width/-/string-width-2.1.1.tgz#ab93f27a8dc13d28cac815c462143a6d9012ae9e" - dependencies: - is-fullwidth-code-point "^2.0.0" - strip-ansi "^4.0.0" - -string.prototype.matchall@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/string.prototype.matchall/-/string.prototype.matchall-2.0.0.tgz#2af8fe3d2d6dc53ca2a59bd376b089c3c152b3c8" - dependencies: - define-properties "^1.1.2" - es-abstract "^1.10.0" - function-bind "^1.1.1" - has-symbols "^1.0.0" - regexp.prototype.flags "^1.2.0" - -string_decoder@^1.1.1, string_decoder@~1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.1.1.tgz#9cf1611ba62685d7030ae9e4ba34149c3af03fc8" - dependencies: - safe-buffer "~5.1.0" - -string_decoder@~0.10.x: - version "0.10.31" - resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-0.10.31.tgz#62e203bc41766c6c28c9fc84301dab1c5310fa94" - -stringstream@~0.0.4, stringstream@~0.0.5: - version "0.0.5" - resolved "https://registry.yarnpkg.com/stringstream/-/stringstream-0.0.5.tgz#4e484cd4de5a0bbbee18e46307710a8a81621878" - -strip-ansi@^3.0.0, strip-ansi@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-3.0.1.tgz#6a385fb8853d952d5ff05d0e8aaf94278dc63dcf" - dependencies: - ansi-regex "^2.0.0" - -strip-ansi@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-4.0.0.tgz#a8479022eb1ac368a871389b635262c505ee368f" - dependencies: - ansi-regex "^3.0.0" - -strip-json-comments@^2.0.1, strip-json-comments@~2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a" - -subarg@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/subarg/-/subarg-1.0.0.tgz#f62cf17581e996b48fc965699f54c06ae268b8d2" - dependencies: - minimist "^1.1.0" - -supports-color@5.4.0, supports-color@^5.3.0: - version "5.4.0" - resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.4.0.tgz#1c6b337402c2137605efe19f10fec390f6faab54" - dependencies: - has-flag "^3.0.0" - -supports-color@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-2.0.0.tgz#535d045ce6b6363fa40117084629995e9df324c7" - -symbol-observable@1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/symbol-observable/-/symbol-observable-1.0.1.tgz#8340fc4702c3122df5d22288f88283f513d3fdd4" - -syntax-error@^1.1.1: - version "1.4.0" - resolved "https://registry.yarnpkg.com/syntax-error/-/syntax-error-1.4.0.tgz#2d9d4ff5c064acb711594a3e3b95054ad51d907c" - dependencies: - acorn-node "^1.2.0" - -table@^4.0.3: - version "4.0.3" - resolved "https://registry.yarnpkg.com/table/-/table-4.0.3.tgz#00b5e2b602f1794b9acaf9ca908a76386a7813bc" - dependencies: - ajv "^6.0.1" - ajv-keywords "^3.0.0" - chalk "^2.1.0" - lodash "^4.17.4" - slice-ansi "1.0.0" - string-width "^2.1.1" - -tar@^4: - version "4.4.2" - resolved "https://registry.yarnpkg.com/tar/-/tar-4.4.2.tgz#60685211ba46b38847b1ae7ee1a24d744a2cd462" - dependencies: - chownr "^1.0.1" - fs-minipass "^1.2.5" - minipass "^2.2.4" - minizlib "^1.1.0" - mkdirp "^0.5.0" - safe-buffer "^5.1.2" - yallist "^3.0.2" - -text-table@^0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/text-table/-/text-table-0.2.0.tgz#7f5ee823ae805207c00af2df4a84ec3fcfa570b4" - -throttleit@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/throttleit/-/throttleit-1.0.0.tgz#9e785836daf46743145a5984b6268d828528ac6c" - -through2@^2.0.0: - version "2.0.3" - resolved "https://registry.yarnpkg.com/through2/-/through2-2.0.3.tgz#0004569b37c7c74ba39c43f3ced78d1ad94140be" - dependencies: - readable-stream "^2.1.5" - xtend "~4.0.1" - -through@2, "through@>=2.2.7 <3", through@^2.3.6, through@~2.3, through@~2.3.1: - version "2.3.8" - resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5" - -thunkify@^2.1.2: - version "2.1.2" - resolved "https://registry.yarnpkg.com/thunkify/-/thunkify-2.1.2.tgz#faa0e9d230c51acc95ca13a361ac05ca7e04553d" - -timers-browserify@^1.0.1: - version "1.4.2" - resolved "https://registry.yarnpkg.com/timers-browserify/-/timers-browserify-1.4.2.tgz#c9c58b575be8407375cb5e2462dacee74359f41d" - dependencies: - process "~0.11.0" - -timespan@2.3.x: - version "2.3.0" - resolved "https://registry.yarnpkg.com/timespan/-/timespan-2.3.0.tgz#4902ce040bd13d845c8f59b27e9d59bad6f39929" - -tmp@0.0.33, tmp@0.0.x, tmp@^0.0.33: - version "0.0.33" - resolved "https://registry.yarnpkg.com/tmp/-/tmp-0.0.33.tgz#6d34335889768d21b2bcda0aa277ced3b1bfadf9" - dependencies: - os-tmpdir "~1.0.2" - -to-array@0.1.4: - version "0.1.4" - resolved "https://registry.yarnpkg.com/to-array/-/to-array-0.1.4.tgz#17e6c11f73dd4f3d74cda7a4ff3238e9ad9bf890" - -to-arraybuffer@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/to-arraybuffer/-/to-arraybuffer-1.0.1.tgz#7d229b1fcc637e466ca081180836a7aabff83f43" - -to-object-path@^0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/to-object-path/-/to-object-path-0.3.0.tgz#297588b7b0e7e0ac08e04e672f85c1f4999e17af" - dependencies: - kind-of "^3.0.2" - -to-regex-range@^2.1.0: - version "2.1.1" - resolved "https://registry.yarnpkg.com/to-regex-range/-/to-regex-range-2.1.1.tgz#7c80c17b9dfebe599e27367e0d4dd5590141db38" - dependencies: - is-number "^3.0.0" - repeat-string "^1.6.1" - -to-regex@^3.0.1, to-regex@^3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/to-regex/-/to-regex-3.0.2.tgz#13cfdd9b336552f30b51f33a8ae1b42a7a7599ce" - dependencies: - define-property "^2.0.2" - extend-shallow "^3.0.2" - regex-not "^1.0.2" - safe-regex "^1.1.0" - -tough-cookie@~2.3.0, tough-cookie@~2.3.3: - version "2.3.4" - resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-2.3.4.tgz#ec60cee38ac675063ffc97a5c18970578ee83655" - dependencies: - punycode "^1.4.1" - -tsscmp@~1.0.0: - version "1.0.5" - resolved "https://registry.yarnpkg.com/tsscmp/-/tsscmp-1.0.5.tgz#7dc4a33af71581ab4337da91d85ca5427ebd9a97" - -tty-browserify@0.0.1: - version "0.0.1" - resolved "https://registry.yarnpkg.com/tty-browserify/-/tty-browserify-0.0.1.tgz#3f05251ee17904dfd0677546670db9651682b811" - -tunnel-agent@^0.6.0: - version "0.6.0" - resolved "https://registry.yarnpkg.com/tunnel-agent/-/tunnel-agent-0.6.0.tgz#27a5dea06b36b04a0a9966774b290868f0fc40fd" - dependencies: - safe-buffer "^5.0.1" - -tunnel-agent@~0.4.1: - version "0.4.3" - resolved "https://registry.yarnpkg.com/tunnel-agent/-/tunnel-agent-0.4.3.tgz#6373db76909fe570e08d73583365ed828a74eeeb" - -tweetnacl@^0.14.3, tweetnacl@~0.14.0: - version "0.14.5" - resolved "https://registry.yarnpkg.com/tweetnacl/-/tweetnacl-0.14.5.tgz#5ae68177f192d4456269d108afa93ff8743f4f64" - -type-check@~0.3.2: - version "0.3.2" - resolved "https://registry.yarnpkg.com/type-check/-/type-check-0.3.2.tgz#5884cab512cf1d355e3fb784f30804b2b520db72" - dependencies: - prelude-ls "~1.1.2" - -type-is@~1.6.15: - version "1.6.16" - resolved "https://registry.yarnpkg.com/type-is/-/type-is-1.6.16.tgz#f89ce341541c672b25ee7ae3c73dee3b2be50194" - dependencies: - media-typer "0.3.0" - mime-types "~2.1.18" - -typedarray@^0.0.6: - version "0.0.6" - resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" - -uglify-js@^3.4.6: - version "3.4.6" - resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-3.4.6.tgz#bc546d53f3e02b05d97d0ca5a7abfe0fb0384ddb" - dependencies: - commander "~2.16.0" - source-map "~0.6.1" - -ultron@~1.1.0: - version "1.1.1" - resolved "https://registry.yarnpkg.com/ultron/-/ultron-1.1.1.tgz#9fe1536a10a664a65266a1e3ccf85fd36302bc9c" - -umd@^3.0.0: - version "3.0.3" - resolved "https://registry.yarnpkg.com/umd/-/umd-3.0.3.tgz#aa9fe653c42b9097678489c01000acb69f0b26cf" - -underscore@~1.7.0: - version "1.7.0" - resolved "https://registry.yarnpkg.com/underscore/-/underscore-1.7.0.tgz#6bbaf0877500d36be34ecaa584e0db9fef035209" - -union-value@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/union-value/-/union-value-1.0.0.tgz#5c71c34cb5bad5dcebe3ea0cd08207ba5aa1aea4" - dependencies: - arr-union "^3.1.0" - get-value "^2.0.6" - is-extendable "^0.1.1" - set-value "^0.4.3" - -unpipe@1.0.0, unpipe@~1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/unpipe/-/unpipe-1.0.0.tgz#b2bf4ee8514aae6165b4817829d21b2ef49904ec" - -unset-value@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/unset-value/-/unset-value-1.0.0.tgz#8376873f7d2335179ffb1e6fc3a8ed0dfc8ab559" - dependencies: - has-value "^0.3.1" - isobject "^3.0.0" - -upath@^1.0.5: - version "1.1.0" - resolved "https://registry.yarnpkg.com/upath/-/upath-1.1.0.tgz#35256597e46a581db4793d0ce47fa9aebfc9fabd" - -uri-js@^4.2.1: - version "4.2.2" - resolved "https://registry.yarnpkg.com/uri-js/-/uri-js-4.2.2.tgz#94c540e1ff772956e2299507c010aea6c8838eb0" - dependencies: - punycode "^2.1.0" - -urix@^0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/urix/-/urix-0.1.0.tgz#da937f7a62e21fec1fd18d49b35c2935067a6c72" - -url@~0.11.0: - version "0.11.0" - resolved "https://registry.yarnpkg.com/url/-/url-0.11.0.tgz#3838e97cfc60521eb73c525a8e55bfdd9e2e28f1" - dependencies: - punycode "1.3.2" - querystring "0.2.0" - -use@^3.1.0: - version "3.1.1" - resolved "https://registry.yarnpkg.com/use/-/use-3.1.1.tgz#d50c8cac79a19fbc20f2911f56eb973f4e10070f" - -useragent@2.2.1: - version "2.2.1" - resolved "https://registry.yarnpkg.com/useragent/-/useragent-2.2.1.tgz#cf593ef4f2d175875e8bb658ea92e18a4fd06d8e" - dependencies: - lru-cache "2.2.x" - tmp "0.0.x" - -util-deprecate@~1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" - -util@0.10.3, util@~0.10.1: - version "0.10.3" - resolved "https://registry.yarnpkg.com/util/-/util-0.10.3.tgz#7afb1afe50805246489e3db7fe0ed379336ac0f9" - dependencies: - inherits "2.0.1" - -utils-merge@1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/utils-merge/-/utils-merge-1.0.1.tgz#9f95710f50a267947b2ccc124741c1028427e713" - -uuid@^3.1.0: - version "3.2.1" - resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.2.1.tgz#12c528bb9d58d0b9265d9a2f6f0fe8be17ff1f14" - -uws@~9.14.0: - version "9.14.0" - resolved "https://registry.yarnpkg.com/uws/-/uws-9.14.0.tgz#fac8386befc33a7a3705cbd58dc47b430ca4dd95" - -verror@1.10.0: - version "1.10.0" - resolved "https://registry.yarnpkg.com/verror/-/verror-1.10.0.tgz#3a105ca17053af55d6e270c1f8288682e18da400" - dependencies: - assert-plus "^1.0.0" - core-util-is "1.0.2" - extsprintf "^1.2.0" - -vm-browserify@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/vm-browserify/-/vm-browserify-1.0.1.tgz#a15d7762c4c48fa6bf9f3309a21340f00ed23063" - -void-elements@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/void-elements/-/void-elements-2.0.1.tgz#c066afb582bb1cb4128d60ea92392e94d5e9dbec" - -watchify@^3.11.0: - version "3.11.0" - resolved "https://registry.yarnpkg.com/watchify/-/watchify-3.11.0.tgz#03f1355c643955e7ab8dcbf399f624644221330f" - dependencies: - anymatch "^1.3.0" - browserify "^16.1.0" - chokidar "^1.0.0" - defined "^1.0.0" - outpipe "^1.1.0" - through2 "^2.0.0" - xtend "^4.0.0" - -when@^3.7.7: - version "3.7.8" - resolved "https://registry.yarnpkg.com/when/-/when-3.7.8.tgz#c7130b6a7ea04693e842cdc9e7a1f2aa39a39f82" - -which@^1.2.10, which@^1.2.9: - version "1.3.0" - resolved "https://registry.yarnpkg.com/which/-/which-1.3.0.tgz#ff04bdfc010ee547d780bec38e1ac1c2777d253a" - dependencies: - isexe "^2.0.0" - -wide-align@^1.1.0: - version "1.1.2" - resolved "https://registry.yarnpkg.com/wide-align/-/wide-align-1.1.2.tgz#571e0f1b0604636ebc0dfc21b0339bbe31341710" - dependencies: - string-width "^1.0.2" - -with-callback@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/with-callback/-/with-callback-1.0.2.tgz#a09629b9a920028d721404fb435bdcff5c91bc21" - -wordwrap@~0.0.2: - version "0.0.3" - resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-0.0.3.tgz#a3d5da6cd5c0bc0008d37234bbaf1bed63059107" - -wordwrap@~1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-1.0.0.tgz#27584810891456a4171c8d0226441ade90cbcaeb" - -wrappy@1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" - -write@^0.2.1: - version "0.2.1" - resolved "https://registry.yarnpkg.com/write/-/write-0.2.1.tgz#5fc03828e264cea3fe91455476f7a3c566cb0757" - dependencies: - mkdirp "^0.5.1" - -ws@~3.3.1: - version "3.3.3" - resolved "https://registry.yarnpkg.com/ws/-/ws-3.3.3.tgz#f1cf84fe2d5e901ebce94efaece785f187a228f2" - dependencies: - async-limiter "~1.0.0" - safe-buffer "~5.1.0" - ultron "~1.1.0" - -xmlhttprequest-ssl@~1.5.4: - version "1.5.5" - resolved "https://registry.yarnpkg.com/xmlhttprequest-ssl/-/xmlhttprequest-ssl-1.5.5.tgz#c2876b06168aadc40e57d97e81191ac8f4398b3e" - -xregexp@2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/xregexp/-/xregexp-2.0.0.tgz#52a63e56ca0b84a7f3a5f3d61872f126ad7a5943" - -xtend@^4.0.0, xtend@^4.0.1, xtend@~4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/xtend/-/xtend-4.0.1.tgz#a5c6d532be656e23db820efb943a1f04998d63af" - -yallist@^2.1.2: - version "2.1.2" - resolved "https://registry.yarnpkg.com/yallist/-/yallist-2.1.2.tgz#1c11f9218f076089a47dd512f93c6699a6a81d52" - -yallist@^3.0.0, yallist@^3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/yallist/-/yallist-3.0.2.tgz#8452b4bb7e83c7c188d8041c1a837c773d6d8bb9" - -yauzl@2.4.1: - version "2.4.1" - resolved "https://registry.yarnpkg.com/yauzl/-/yauzl-2.4.1.tgz#9528f442dab1b2284e58b4379bb194e22e0c4005" - dependencies: - fd-slicer "~1.0.1" - -yeast@0.1.2: - version "0.1.2" - resolved "https://registry.yarnpkg.com/yeast/-/yeast-0.1.2.tgz#008e06d8094320c372dbc2f8ed76a0ca6c8ac419" diff --git a/deps/npm/node_modules/pump/.travis.yml b/deps/npm/node_modules/pump/.travis.yml deleted file mode 100644 index 17f94330e70bc8..00000000000000 --- a/deps/npm/node_modules/pump/.travis.yml +++ /dev/null @@ -1,5 +0,0 @@ -language: node_js -node_js: - - "0.10" - -script: "npm test" diff --git a/deps/npm/node_modules/pump/LICENSE b/deps/npm/node_modules/pump/LICENSE deleted file mode 100644 index 757562ec59276b..00000000000000 --- a/deps/npm/node_modules/pump/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2014 Mathias Buus - -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/deps/npm/node_modules/pump/README.md b/deps/npm/node_modules/pump/README.md deleted file mode 100644 index 4c81471a0ef04b..00000000000000 --- a/deps/npm/node_modules/pump/README.md +++ /dev/null @@ -1,65 +0,0 @@ -# pump - -pump is a small node module that pipes streams together and destroys all of them if one of them closes. - -``` -npm install pump -``` - -[![build status](http://img.shields.io/travis/mafintosh/pump.svg?style=flat)](http://travis-ci.org/mafintosh/pump) - -## What problem does it solve? - -When using standard `source.pipe(dest)` source will _not_ be destroyed if dest emits close or an error. -You are also not able to provide a callback to tell when then pipe has finished. - -pump does these two things for you - -## Usage - -Simply pass the streams you want to pipe together to pump and add an optional callback - -``` js -var pump = require('pump') -var fs = require('fs') - -var source = fs.createReadStream('/dev/random') -var dest = fs.createWriteStream('/dev/null') - -pump(source, dest, function(err) { - console.log('pipe finished', err) -}) - -setTimeout(function() { - dest.destroy() // when dest is closed pump will destroy source -}, 1000) -``` - -You can use pump to pipe more than two streams together as well - -``` js -var transform = someTransformStream() - -pump(source, transform, anotherTransform, dest, function(err) { - console.log('pipe finished', err) -}) -``` - -If `source`, `transform`, `anotherTransform` or `dest` closes all of them will be destroyed. - -Similarly to `stream.pipe()`, `pump()` returns the last stream passed in, so you can do: - -``` -return pump(s1, s2) // returns s2 -``` - -If you want to return a stream that combines *both* s1 and s2 to a single stream use -[pumpify](https://github.com/mafintosh/pumpify) instead. - -## License - -MIT - -## Related - -`pump` is part of the [mississippi stream utility collection](https://github.com/maxogden/mississippi) which includes more useful stream modules similar to this one. diff --git a/deps/npm/node_modules/pump/index.js b/deps/npm/node_modules/pump/index.js deleted file mode 100644 index c15059f176c794..00000000000000 --- a/deps/npm/node_modules/pump/index.js +++ /dev/null @@ -1,82 +0,0 @@ -var once = require('once') -var eos = require('end-of-stream') -var fs = require('fs') // we only need fs to get the ReadStream and WriteStream prototypes - -var noop = function () {} -var ancient = /^v?\.0/.test(process.version) - -var isFn = function (fn) { - return typeof fn === 'function' -} - -var isFS = function (stream) { - if (!ancient) return false // newer node version do not need to care about fs is a special way - if (!fs) return false // browser - return (stream instanceof (fs.ReadStream || noop) || stream instanceof (fs.WriteStream || noop)) && isFn(stream.close) -} - -var isRequest = function (stream) { - return stream.setHeader && isFn(stream.abort) -} - -var destroyer = function (stream, reading, writing, callback) { - callback = once(callback) - - var closed = false - stream.on('close', function () { - closed = true - }) - - eos(stream, {readable: reading, writable: writing}, function (err) { - if (err) return callback(err) - closed = true - callback() - }) - - var destroyed = false - return function (err) { - if (closed) return - if (destroyed) return - destroyed = true - - if (isFS(stream)) return stream.close(noop) // use close for fs streams to avoid fd leaks - if (isRequest(stream)) return stream.abort() // request.destroy just do .end - .abort is what we want - - if (isFn(stream.destroy)) return stream.destroy() - - callback(err || new Error('stream was destroyed')) - } -} - -var call = function (fn) { - fn() -} - -var pipe = function (from, to) { - return from.pipe(to) -} - -var pump = function () { - var streams = Array.prototype.slice.call(arguments) - var callback = isFn(streams[streams.length - 1] || noop) && streams.pop() || noop - - if (Array.isArray(streams[0])) streams = streams[0] - if (streams.length < 2) throw new Error('pump requires two streams per minimum') - - var error - var destroys = streams.map(function (stream, i) { - var reading = i < streams.length - 1 - var writing = i > 0 - return destroyer(stream, reading, writing, function (err) { - if (!error) error = err - if (err) destroys.forEach(call) - if (reading) return - destroys.forEach(call) - callback(error) - }) - }) - - return streams.reduce(pipe) -} - -module.exports = pump diff --git a/deps/npm/node_modules/pump/package.json b/deps/npm/node_modules/pump/package.json deleted file mode 100644 index b797bee12387a3..00000000000000 --- a/deps/npm/node_modules/pump/package.json +++ /dev/null @@ -1,59 +0,0 @@ -{ - "_from": "pump@^3.0.0", - "_id": "pump@3.0.0", - "_inBundle": false, - "_integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", - "_location": "/pump", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "pump@^3.0.0", - "name": "pump", - "escapedName": "pump", - "rawSpec": "^3.0.0", - "saveSpec": null, - "fetchSpec": "^3.0.0" - }, - "_requiredBy": [ - "/mississippi" - ], - "_resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", - "_shasum": "b4a2116815bde2f4e1ea602354e8c75565107a64", - "_spec": "pump@^3.0.0", - "_where": "/Users/rebecca/code/npm/node_modules/mississippi", - "author": { - "name": "Mathias Buus Madsen", - "email": "mathiasbuus@gmail.com" - }, - "browser": { - "fs": false - }, - "bugs": { - "url": "https://github.com/mafintosh/pump/issues" - }, - "bundleDependencies": false, - "dependencies": { - "end-of-stream": "^1.1.0", - "once": "^1.3.1" - }, - "deprecated": false, - "description": "pipe streams together and close all of them if one of them closes", - "homepage": "https://github.com/mafintosh/pump#readme", - "keywords": [ - "streams", - "pipe", - "destroy", - "callback" - ], - "license": "MIT", - "name": "pump", - "repository": { - "type": "git", - "url": "git://github.com/mafintosh/pump.git" - }, - "scripts": { - "test": "node test-browser.js && node test-node.js" - }, - "version": "3.0.0" -} diff --git a/deps/npm/node_modules/pump/test-browser.js b/deps/npm/node_modules/pump/test-browser.js deleted file mode 100644 index 9a06c8a4ccb58c..00000000000000 --- a/deps/npm/node_modules/pump/test-browser.js +++ /dev/null @@ -1,66 +0,0 @@ -var stream = require('stream') -var pump = require('./index') - -var rs = new stream.Readable() -var ws = new stream.Writable() - -rs._read = function (size) { - this.push(Buffer(size).fill('abc')) -} - -ws._write = function (chunk, encoding, cb) { - setTimeout(function () { - cb() - }, 100) -} - -var toHex = function () { - var reverse = new (require('stream').Transform)() - - reverse._transform = function (chunk, enc, callback) { - reverse.push(chunk.toString('hex')) - callback() - } - - return reverse -} - -var wsClosed = false -var rsClosed = false -var callbackCalled = false - -var check = function () { - if (wsClosed && rsClosed && callbackCalled) { - console.log('test-browser.js passes') - clearTimeout(timeout) - } -} - -ws.on('finish', function () { - wsClosed = true - check() -}) - -rs.on('end', function () { - rsClosed = true - check() -}) - -var res = pump(rs, toHex(), toHex(), toHex(), ws, function () { - callbackCalled = true - check() -}) - -if (res !== ws) { - throw new Error('should return last stream') -} - -setTimeout(function () { - rs.push(null) - rs.emit('close') -}, 1000) - -var timeout = setTimeout(function () { - check() - throw new Error('timeout') -}, 5000) diff --git a/deps/npm/node_modules/pump/test-node.js b/deps/npm/node_modules/pump/test-node.js deleted file mode 100644 index 561251a0826c71..00000000000000 --- a/deps/npm/node_modules/pump/test-node.js +++ /dev/null @@ -1,53 +0,0 @@ -var pump = require('./index') - -var rs = require('fs').createReadStream('/dev/random') -var ws = require('fs').createWriteStream('/dev/null') - -var toHex = function () { - var reverse = new (require('stream').Transform)() - - reverse._transform = function (chunk, enc, callback) { - reverse.push(chunk.toString('hex')) - callback() - } - - return reverse -} - -var wsClosed = false -var rsClosed = false -var callbackCalled = false - -var check = function () { - if (wsClosed && rsClosed && callbackCalled) { - console.log('test-node.js passes') - clearTimeout(timeout) - } -} - -ws.on('close', function () { - wsClosed = true - check() -}) - -rs.on('close', function () { - rsClosed = true - check() -}) - -var res = pump(rs, toHex(), toHex(), toHex(), ws, function () { - callbackCalled = true - check() -}) - -if (res !== ws) { - throw new Error('should return last stream') -} - -setTimeout(function () { - rs.destroy() -}, 1000) - -var timeout = setTimeout(function () { - throw new Error('timeout') -}, 5000) diff --git a/deps/npm/node_modules/pumpify/.travis.yml b/deps/npm/node_modules/pumpify/.travis.yml deleted file mode 100644 index 32e71a6b554e4b..00000000000000 --- a/deps/npm/node_modules/pumpify/.travis.yml +++ /dev/null @@ -1,8 +0,0 @@ -language: node_js - -node_js: - - "0.10" - - "4" - - "5" - -sudo: false diff --git a/deps/npm/node_modules/pumpify/LICENSE b/deps/npm/node_modules/pumpify/LICENSE deleted file mode 100644 index 757562ec59276b..00000000000000 --- a/deps/npm/node_modules/pumpify/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2014 Mathias Buus - -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/deps/npm/node_modules/pumpify/README.md b/deps/npm/node_modules/pumpify/README.md deleted file mode 100644 index 4988f7b12606c4..00000000000000 --- a/deps/npm/node_modules/pumpify/README.md +++ /dev/null @@ -1,56 +0,0 @@ -# pumpify - -Combine an array of streams into a single duplex stream using [pump](https://github.com/mafintosh/pump) and [duplexify](https://github.com/mafintosh/duplexify). -If one of the streams closes/errors all streams in the pipeline will be destroyed. - -``` -npm install pumpify -``` - -[![build status](http://img.shields.io/travis/mafintosh/pumpify.svg?style=flat)](http://travis-ci.org/mafintosh/pumpify) - -## Usage - -Pass the streams you want to pipe together to pumpify `pipeline = pumpify(s1, s2, s3, ...)`. -`pipeline` is a duplex stream that writes to the first streams and reads from the last one. -Streams are piped together using [pump](https://github.com/mafintosh/pump) so if one of them closes -all streams will be destroyed. - -``` js -var pumpify = require('pumpify') -var tar = require('tar-fs') -var zlib = require('zlib') -var fs = require('fs') - -var untar = pumpify(zlib.createGunzip(), tar.extract('output-folder')) -// you can also pass an array instead -// var untar = pumpify([zlib.createGunzip(), tar.extract('output-folder')]) - -fs.createReadStream('some-gzipped-tarball.tgz').pipe(untar) -``` - -If you are pumping object streams together use `pipeline = pumpify.obj(s1, s2, ...)`. -Call `pipeline.destroy()` to destroy the pipeline (including the streams passed to pumpify). - -### Using `setPipeline(s1, s2, ...)` - -Similar to [duplexify](https://github.com/mafintosh/duplexify) you can also define the pipeline asynchronously using `setPipeline(s1, s2, ...)` - -``` js -var untar = pumpify() - -setTimeout(function() { - // will start draining the input now - untar.setPipeline(zlib.createGunzip(), tar.extract('output-folder')) -}, 1000) - -fs.createReadStream('some-gzipped-tarball.tgz').pipe(untar) -``` - -## License - -MIT - -## Related - -`pumpify` is part of the [mississippi stream utility collection](https://github.com/maxogden/mississippi) which includes more useful stream modules similar to this one. diff --git a/deps/npm/node_modules/pumpify/index.js b/deps/npm/node_modules/pumpify/index.js deleted file mode 100644 index 473e25663bfb3e..00000000000000 --- a/deps/npm/node_modules/pumpify/index.js +++ /dev/null @@ -1,60 +0,0 @@ -var pump = require('pump') -var inherits = require('inherits') -var Duplexify = require('duplexify') - -var toArray = function(args) { - if (!args.length) return [] - return Array.isArray(args[0]) ? args[0] : Array.prototype.slice.call(args) -} - -var define = function(opts) { - var Pumpify = function() { - var streams = toArray(arguments) - if (!(this instanceof Pumpify)) return new Pumpify(streams) - Duplexify.call(this, null, null, opts) - if (streams.length) this.setPipeline(streams) - } - - inherits(Pumpify, Duplexify) - - Pumpify.prototype.setPipeline = function() { - var streams = toArray(arguments) - var self = this - var ended = false - var w = streams[0] - var r = streams[streams.length-1] - - r = r.readable ? r : null - w = w.writable ? w : null - - var onclose = function() { - streams[0].emit('error', new Error('stream was destroyed')) - } - - this.on('close', onclose) - this.on('prefinish', function() { - if (!ended) self.cork() - }) - - pump(streams, function(err) { - self.removeListener('close', onclose) - if (err) return self.destroy(err.message === 'premature close' ? null : err) - ended = true - // pump ends after the last stream is not writable *but* - // pumpify still forwards the readable part so we need to catch errors - // still, so reenable autoDestroy in this case - if (self._autoDestroy === false) self._autoDestroy = true - self.uncork() - }) - - if (this.destroyed) return onclose() - this.setWritable(w) - this.setReadable(r) - } - - return Pumpify -} - -module.exports = define({autoDestroy:false, destroy:false}) -module.exports.obj = define({autoDestroy: false, destroy:false, objectMode:true, highWaterMark:16}) -module.exports.ctor = define diff --git a/deps/npm/node_modules/pumpify/node_modules/pump/.travis.yml b/deps/npm/node_modules/pumpify/node_modules/pump/.travis.yml deleted file mode 100644 index 17f94330e70bc8..00000000000000 --- a/deps/npm/node_modules/pumpify/node_modules/pump/.travis.yml +++ /dev/null @@ -1,5 +0,0 @@ -language: node_js -node_js: - - "0.10" - -script: "npm test" diff --git a/deps/npm/node_modules/pumpify/node_modules/pump/LICENSE b/deps/npm/node_modules/pumpify/node_modules/pump/LICENSE deleted file mode 100644 index 757562ec59276b..00000000000000 --- a/deps/npm/node_modules/pumpify/node_modules/pump/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2014 Mathias Buus - -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/deps/npm/node_modules/pumpify/node_modules/pump/README.md b/deps/npm/node_modules/pumpify/node_modules/pump/README.md deleted file mode 100644 index 5029b27d6817e5..00000000000000 --- a/deps/npm/node_modules/pumpify/node_modules/pump/README.md +++ /dev/null @@ -1,56 +0,0 @@ -# pump - -pump is a small node module that pipes streams together and destroys all of them if one of them closes. - -``` -npm install pump -``` - -[![build status](http://img.shields.io/travis/mafintosh/pump.svg?style=flat)](http://travis-ci.org/mafintosh/pump) - -## What problem does it solve? - -When using standard `source.pipe(dest)` source will _not_ be destroyed if dest emits close or an error. -You are also not able to provide a callback to tell when then pipe has finished. - -pump does these two things for you - -## Usage - -Simply pass the streams you want to pipe together to pump and add an optional callback - -``` js -var pump = require('pump') -var fs = require('fs') - -var source = fs.createReadStream('/dev/random') -var dest = fs.createWriteStream('/dev/null') - -pump(source, dest, function(err) { - console.log('pipe finished', err) -}) - -setTimeout(function() { - dest.destroy() // when dest is closed pump will destroy source -}, 1000) -``` - -You can use pump to pipe more than two streams together as well - -``` js -var transform = someTransformStream() - -pump(source, transform, anotherTransform, dest, function(err) { - console.log('pipe finished', err) -}) -``` - -If `source`, `transform`, `anotherTransform` or `dest` closes all of them will be destroyed. - -## License - -MIT - -## Related - -`pump` is part of the [mississippi stream utility collection](https://github.com/maxogden/mississippi) which includes more useful stream modules similar to this one. diff --git a/deps/npm/node_modules/pumpify/node_modules/pump/index.js b/deps/npm/node_modules/pumpify/node_modules/pump/index.js deleted file mode 100644 index d9ca0335cbc1ad..00000000000000 --- a/deps/npm/node_modules/pumpify/node_modules/pump/index.js +++ /dev/null @@ -1,82 +0,0 @@ -var once = require('once') -var eos = require('end-of-stream') -var fs = require('fs') // we only need fs to get the ReadStream and WriteStream prototypes - -var noop = function () {} -var ancient = /^v?\.0/.test(process.version) - -var isFn = function (fn) { - return typeof fn === 'function' -} - -var isFS = function (stream) { - if (!ancient) return false // newer node version do not need to care about fs is a special way - if (!fs) return false // browser - return (stream instanceof (fs.ReadStream || noop) || stream instanceof (fs.WriteStream || noop)) && isFn(stream.close) -} - -var isRequest = function (stream) { - return stream.setHeader && isFn(stream.abort) -} - -var destroyer = function (stream, reading, writing, callback) { - callback = once(callback) - - var closed = false - stream.on('close', function () { - closed = true - }) - - eos(stream, {readable: reading, writable: writing}, function (err) { - if (err) return callback(err) - closed = true - callback() - }) - - var destroyed = false - return function (err) { - if (closed) return - if (destroyed) return - destroyed = true - - if (isFS(stream)) return stream.close(noop) // use close for fs streams to avoid fd leaks - if (isRequest(stream)) return stream.abort() // request.destroy just do .end - .abort is what we want - - if (isFn(stream.destroy)) return stream.destroy() - - callback(err || new Error('stream was destroyed')) - } -} - -var call = function (fn) { - fn() -} - -var pipe = function (from, to) { - return from.pipe(to) -} - -var pump = function () { - var streams = Array.prototype.slice.call(arguments) - var callback = isFn(streams[streams.length - 1] || noop) && streams.pop() || noop - - if (Array.isArray(streams[0])) streams = streams[0] - if (streams.length < 2) throw new Error('pump requires two streams per minimum') - - var error - var destroys = streams.map(function (stream, i) { - var reading = i < streams.length - 1 - var writing = i > 0 - return destroyer(stream, reading, writing, function (err) { - if (!error) error = err - if (err) destroys.forEach(call) - if (reading) return - destroys.forEach(call) - callback(error) - }) - }) - - streams.reduce(pipe) -} - -module.exports = pump diff --git a/deps/npm/node_modules/pumpify/node_modules/pump/package.json b/deps/npm/node_modules/pumpify/node_modules/pump/package.json deleted file mode 100644 index 4557d165343dd1..00000000000000 --- a/deps/npm/node_modules/pumpify/node_modules/pump/package.json +++ /dev/null @@ -1,59 +0,0 @@ -{ - "_from": "pump@^2.0.0", - "_id": "pump@2.0.1", - "_inBundle": false, - "_integrity": "sha512-ruPMNRkN3MHP1cWJc9OWr+T/xDP0jhXYCLfJcBuX54hhfIBnaQmAUMfDcG4DM5UMWByBbJY69QSphm3jtDKIkA==", - "_location": "/pumpify/pump", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "pump@^2.0.0", - "name": "pump", - "escapedName": "pump", - "rawSpec": "^2.0.0", - "saveSpec": null, - "fetchSpec": "^2.0.0" - }, - "_requiredBy": [ - "/pumpify" - ], - "_resolved": "https://registry.npmjs.org/pump/-/pump-2.0.1.tgz", - "_shasum": "12399add6e4cf7526d973cbc8b5ce2e2908b3909", - "_spec": "pump@^2.0.0", - "_where": "/Users/rebecca/code/npm/node_modules/pumpify", - "author": { - "name": "Mathias Buus Madsen", - "email": "mathiasbuus@gmail.com" - }, - "browser": { - "fs": false - }, - "bugs": { - "url": "https://github.com/mafintosh/pump/issues" - }, - "bundleDependencies": false, - "dependencies": { - "end-of-stream": "^1.1.0", - "once": "^1.3.1" - }, - "deprecated": false, - "description": "pipe streams together and close all of them if one of them closes", - "homepage": "https://github.com/mafintosh/pump#readme", - "keywords": [ - "streams", - "pipe", - "destroy", - "callback" - ], - "license": "MIT", - "name": "pump", - "repository": { - "type": "git", - "url": "git://github.com/mafintosh/pump.git" - }, - "scripts": { - "test": "node test-browser.js && node test-node.js" - }, - "version": "2.0.1" -} diff --git a/deps/npm/node_modules/pumpify/node_modules/pump/test-browser.js b/deps/npm/node_modules/pumpify/node_modules/pump/test-browser.js deleted file mode 100644 index 75ea4a292e209f..00000000000000 --- a/deps/npm/node_modules/pumpify/node_modules/pump/test-browser.js +++ /dev/null @@ -1,62 +0,0 @@ -var stream = require('stream') -var pump = require('./index') - -var rs = new stream.Readable() -var ws = new stream.Writable() - -rs._read = function (size) { - this.push(Buffer(size).fill('abc')) -} - -ws._write = function (chunk, encoding, cb) { - setTimeout(function () { - cb() - }, 100) -} - -var toHex = function () { - var reverse = new (require('stream').Transform)() - - reverse._transform = function (chunk, enc, callback) { - reverse.push(chunk.toString('hex')) - callback() - } - - return reverse -} - -var wsClosed = false -var rsClosed = false -var callbackCalled = false - -var check = function () { - if (wsClosed && rsClosed && callbackCalled) { - console.log('test-browser.js passes') - clearTimeout(timeout) - } -} - -ws.on('finish', function () { - wsClosed = true - check() -}) - -rs.on('end', function () { - rsClosed = true - check() -}) - -pump(rs, toHex(), toHex(), toHex(), ws, function () { - callbackCalled = true - check() -}) - -setTimeout(function () { - rs.push(null) - rs.emit('close') -}, 1000) - -var timeout = setTimeout(function () { - check() - throw new Error('timeout') -}, 5000) diff --git a/deps/npm/node_modules/pumpify/node_modules/pump/test-node.js b/deps/npm/node_modules/pumpify/node_modules/pump/test-node.js deleted file mode 100644 index 034a65414d1b36..00000000000000 --- a/deps/npm/node_modules/pumpify/node_modules/pump/test-node.js +++ /dev/null @@ -1,53 +0,0 @@ -var pump = require('./index') - -var rs = require('fs').createReadStream('/dev/random') -var ws = require('fs').createWriteStream('/dev/null') - -var toHex = function () { - var reverse = new (require('stream').Transform)() - - reverse._transform = function (chunk, enc, callback) { - reverse.push(chunk.toString('hex')) - callback() - } - - return reverse -} - -var wsClosed = false -var rsClosed = false -var callbackCalled = false - -var check = function () { - if (wsClosed && rsClosed && callbackCalled) { - console.log('test-node.js passes') - clearTimeout(timeout) - } -} - -ws.on('close', function () { - wsClosed = true - check() -}) - -rs.on('close', function () { - rsClosed = true - check() -}) - -var res = pump(rs, toHex(), toHex(), toHex(), ws, function () { - callbackCalled = true - check() -}) - -if (res) { - process.exit(1) -} - -setTimeout(function () { - rs.destroy() -}, 1000) - -var timeout = setTimeout(function () { - throw new Error('timeout') -}, 5000) diff --git a/deps/npm/node_modules/pumpify/package.json b/deps/npm/node_modules/pumpify/package.json deleted file mode 100644 index 91b291b35e21f8..00000000000000 --- a/deps/npm/node_modules/pumpify/package.json +++ /dev/null @@ -1,70 +0,0 @@ -{ - "_from": "pumpify@^1.3.3", - "_id": "pumpify@1.5.1", - "_inBundle": false, - "_integrity": "sha512-oClZI37HvuUJJxSKKrC17bZ9Cu0ZYhEAGPsPUy9KlMUmv9dKX2o77RUmq7f3XjIxbwyGwYzbzQ1L2Ks8sIradQ==", - "_location": "/pumpify", - "_phantomChildren": { - "end-of-stream": "1.4.1", - "once": "1.4.0" - }, - "_requested": { - "type": "range", - "registry": true, - "raw": "pumpify@^1.3.3", - "name": "pumpify", - "escapedName": "pumpify", - "rawSpec": "^1.3.3", - "saveSpec": null, - "fetchSpec": "^1.3.3" - }, - "_requiredBy": [ - "/mississippi", - "/npm-profile/cacache/mississippi", - "/npm-profile/mississippi", - "/npm-registry-fetch/cacache/mississippi" - ], - "_resolved": "https://registry.npmjs.org/pumpify/-/pumpify-1.5.1.tgz", - "_shasum": "36513be246ab27570b1a374a5ce278bfd74370ce", - "_spec": "pumpify@^1.3.3", - "_where": "/Users/rebecca/code/npm/node_modules/mississippi", - "author": { - "name": "Mathias Buus" - }, - "bugs": { - "url": "https://github.com/mafintosh/pumpify/issues" - }, - "bundleDependencies": false, - "dependencies": { - "duplexify": "^3.6.0", - "inherits": "^2.0.3", - "pump": "^2.0.0" - }, - "deprecated": false, - "description": "Combine an array of streams into a single duplex stream using pump and duplexify", - "devDependencies": { - "tape": "^4.8.0", - "through2": "^2.0.3" - }, - "homepage": "https://github.com/mafintosh/pumpify", - "keywords": [ - "pump", - "duplexify", - "duplex", - "streams", - "stream", - "pipeline", - "combine" - ], - "license": "MIT", - "main": "index.js", - "name": "pumpify", - "repository": { - "type": "git", - "url": "git://github.com/mafintosh/pumpify.git" - }, - "scripts": { - "test": "tape test.js" - }, - "version": "1.5.1" -} diff --git a/deps/npm/node_modules/pumpify/test.js b/deps/npm/node_modules/pumpify/test.js deleted file mode 100644 index b603c4d80a33d8..00000000000000 --- a/deps/npm/node_modules/pumpify/test.js +++ /dev/null @@ -1,235 +0,0 @@ -var tape = require('tape') -var through = require('through2') -var pumpify = require('./') -var stream = require('stream') -var duplexify = require('duplexify') - -tape('basic', function(t) { - t.plan(3) - - var pipeline = pumpify( - through(function(data, enc, cb) { - t.same(data.toString(), 'hello') - cb(null, data.toString().toUpperCase()) - }), - through(function(data, enc, cb) { - t.same(data.toString(), 'HELLO') - cb(null, data.toString().toLowerCase()) - }) - ) - - pipeline.write('hello') - pipeline.on('data', function(data) { - t.same(data.toString(), 'hello') - t.end() - }) -}) - -tape('3 times', function(t) { - t.plan(4) - - var pipeline = pumpify( - through(function(data, enc, cb) { - t.same(data.toString(), 'hello') - cb(null, data.toString().toUpperCase()) - }), - through(function(data, enc, cb) { - t.same(data.toString(), 'HELLO') - cb(null, data.toString().toLowerCase()) - }), - through(function(data, enc, cb) { - t.same(data.toString(), 'hello') - cb(null, data.toString().toUpperCase()) - }) - ) - - pipeline.write('hello') - pipeline.on('data', function(data) { - t.same(data.toString(), 'HELLO') - t.end() - }) -}) - -tape('destroy', function(t) { - var test = through() - test.destroy = function() { - t.ok(true) - t.end() - } - - var pipeline = pumpify(through(), test) - - pipeline.destroy() -}) - -tape('close', function(t) { - var test = through() - var pipeline = pumpify(through(), test) - - pipeline.on('error', function(err) { - t.same(err.message, 'lol') - t.end() - }) - - test.emit('error', new Error('lol')) -}) - -tape('end waits for last one', function(t) { - var ran = false - - var a = through() - var b = through() - var c = through(function(data, enc, cb) { - setTimeout(function() { - ran = true - cb() - }, 100) - }) - - var pipeline = pumpify(a, b, c) - - pipeline.write('foo') - pipeline.end(function() { - t.ok(ran) - t.end() - }) - - t.ok(!ran) -}) - -tape('always wait for finish', function(t) { - var a = new stream.Readable() - a._read = function() {} - a.push('hello') - - var pipeline = pumpify(a, through(), through()) - var ran = false - - pipeline.on('finish', function() { - t.ok(ran) - t.end() - }) - - setTimeout(function() { - ran = true - a.push(null) - }, 100) -}) - -tape('async', function(t) { - var pipeline = pumpify() - - t.plan(4) - - pipeline.write('hello') - pipeline.on('data', function(data) { - t.same(data.toString(), 'HELLO') - t.end() - }) - - setTimeout(function() { - pipeline.setPipeline( - through(function(data, enc, cb) { - t.same(data.toString(), 'hello') - cb(null, data.toString().toUpperCase()) - }), - through(function(data, enc, cb) { - t.same(data.toString(), 'HELLO') - cb(null, data.toString().toLowerCase()) - }), - through(function(data, enc, cb) { - t.same(data.toString(), 'hello') - cb(null, data.toString().toUpperCase()) - }) - ) - }, 100) -}) - -tape('early destroy', function(t) { - var a = through() - var b = through() - var c = through() - - b.destroy = function() { - t.ok(true) - t.end() - } - - var pipeline = pumpify() - - pipeline.destroy() - setTimeout(function() { - pipeline.setPipeline(a, b, c) - }, 100) -}) - -tape('preserves error', function (t) { - var a = through() - var b = through(function (data, enc, cb) { - cb(new Error('stop')) - }) - var c = through() - var s = pumpify() - - s.on('error', function (err) { - t.same(err.message, 'stop') - t.end() - }) - - s.setPipeline(a, b, c) - s.resume() - s.write('hi') -}) - -tape('preserves error again', function (t) { - var ws = new stream.Writable() - var rs = new stream.Readable({highWaterMark: 16}) - - ws._write = function (data, enc, cb) { - cb(null) - } - - rs._read = function () { - process.nextTick(function () { - rs.push('hello world') - }) - } - - var pumpifyErr = pumpify( - through(), - through(function(chunk, _, cb) { - cb(new Error('test')) - }), - ws - ) - - rs.pipe(pumpifyErr) - .on('error', function (err) { - t.ok(err) - t.ok(err.message !== 'premature close', 'does not close with premature close') - t.end() - }) -}) - -tape('returns error from duplexify', function (t) { - var a = through() - var b = duplexify() - var s = pumpify() - - s.setPipeline(a, b) - - s.on('error', function (err) { - t.same(err.message, 'stop') - t.end() - }) - - s.write('data') - // Test passes if `.end()` is not called - s.end() - - b.setWritable(through()) - - setImmediate(function () { - b.destroy(new Error('stop')) - }) -}) diff --git a/deps/npm/node_modules/punycode/README.md b/deps/npm/node_modules/punycode/README.md index 7ad7d1faaac833..ee2f9d63320c0d 100644 --- a/deps/npm/node_modules/punycode/README.md +++ b/deps/npm/node_modules/punycode/README.md @@ -1,6 +1,6 @@ -# Punycode.js [![Build status](https://travis-ci.org/bestiejs/punycode.js.svg?branch=master)](https://travis-ci.org/bestiejs/punycode.js) [![Code coverage status](http://img.shields.io/coveralls/bestiejs/punycode.js/master.svg)](https://coveralls.io/r/bestiejs/punycode.js) [![Dependency status](https://gemnasium.com/bestiejs/punycode.js.svg)](https://gemnasium.com/bestiejs/punycode.js) +# Punycode.js [![Build status](https://travis-ci.org/bestiejs/punycode.js.svg?branch=master)](https://travis-ci.org/bestiejs/punycode.js) [![Code coverage status](http://img.shields.io/codecov/c/github/bestiejs/punycode.js.svg)](https://codecov.io/gh/bestiejs/punycode.js) [![Dependency status](https://gemnasium.com/bestiejs/punycode.js.svg)](https://gemnasium.com/bestiejs/punycode.js) -A robust Punycode converter that fully complies to [RFC 3492](https://tools.ietf.org/html/rfc3492) and [RFC 5891](https://tools.ietf.org/html/rfc5891), and works on nearly all JavaScript platforms. +Punycode.js is a robust Punycode converter that fully complies to [RFC 3492](https://tools.ietf.org/html/rfc3492) and [RFC 5891](https://tools.ietf.org/html/rfc5891). This JavaScript library is the result of comparing, optimizing and documenting different open-source implementations of the Punycode algorithm: @@ -10,60 +10,22 @@ This JavaScript library is the result of comparing, optimizing and documenting d * [JavaScript implementation by _some_](http://stackoverflow.com/questions/183485/can-anyone-recommend-a-good-free-javascript-for-punycode-to-unicode-conversion/301287#301287) * [`punycode.js` by _Ben Noordhuis_](https://github.com/joyent/node/blob/426298c8c1c0d5b5224ac3658c41e7c2a3fe9377/lib/punycode.js) (note: [not fully compliant](https://github.com/joyent/node/issues/2072)) -This project is [bundled](https://github.com/joyent/node/blob/master/lib/punycode.js) with [Node.js v0.6.2+](https://github.com/joyent/node/compare/975f1930b1...61e796decc) and [io.js v1.0.0+](https://github.com/iojs/io.js/blob/v1.x/lib/punycode.js). +This project was [bundled](https://github.com/joyent/node/blob/master/lib/punycode.js) with Node.js from [v0.6.2+](https://github.com/joyent/node/compare/975f1930b1...61e796decc) until [v7](https://github.com/nodejs/node/pull/7941) (soft-deprecated). -## Installation - -Via [npm](https://www.npmjs.com/) (only required for Node.js releases older than v0.6.2): +The current version supports recent versions of Node.js only. It provides a CommonJS module and an ES6 module. For the old version that offers the same functionality with broader support, including Rhino, Ringo, Narwhal, and web browsers, see [v1.4.1](https://github.com/bestiejs/punycode.js/releases/tag/v1.4.1). -```bash -npm install punycode -``` - -Via [Bower](http://bower.io/): - -```bash -bower install punycode -``` +## Installation -Via [Component](https://github.com/component/component): +Via [npm](https://www.npmjs.com/): ```bash -component install bestiejs/punycode.js -``` - -In a browser: - -```html - -``` - -In [Node.js](https://nodejs.org/), [io.js](https://iojs.org/), [Narwhal](http://narwhaljs.org/), and [RingoJS](http://ringojs.org/): - -```js -var punycode = require('punycode'); +npm install punycode --save ``` -In [Rhino](http://www.mozilla.org/rhino/): +In [Node.js](https://nodejs.org/): ```js -load('punycode.js'); -``` - -Using an AMD loader like [RequireJS](http://requirejs.org/): - -```js -require( - { - 'paths': { - 'punycode': 'path/to/punycode' - } - }, - ['punycode'], - function(punycode) { - console.log(punycode); - } -); +const punycode = require('punycode'); ``` ## API @@ -149,28 +111,12 @@ punycode.ucs2.encode([0x1D306]); A string representing the current Punycode.js version number. -## Unit tests & code coverage - -After cloning this repository, run `npm install --dev` to install the dependencies needed for Punycode.js development and testing. You may want to install Istanbul _globally_ using `npm install istanbul -g`. - -Once that’s done, you can run the unit tests in Node using `npm test` or `node tests/tests.js`. To run the tests in Rhino, Ringo, Narwhal, PhantomJS, and web browsers as well, use `grunt test`. - -To generate the code coverage report, use `grunt cover`. - -Feel free to fork if you see possible improvements! - ## Author | [![twitter/mathias](https://gravatar.com/avatar/24e08a9ea84deb17ae121074d0f17125?s=70)](https://twitter.com/mathias "Follow @mathias on Twitter") | |---| | [Mathias Bynens](https://mathiasbynens.be/) | -## Contributors - -| [![twitter/jdalton](https://gravatar.com/avatar/299a3d891ff1920b69c364d061007043?s=70)](https://twitter.com/jdalton "Follow @jdalton on Twitter") | -|---| -| [John-David Dalton](http://allyoucanleet.com/) | - ## License Punycode.js is available under the [MIT](https://mths.be/mit) license. diff --git a/deps/npm/node_modules/punycode/package.json b/deps/npm/node_modules/punycode/package.json index 1bc2edc043783f..9202ccf8c0c8f7 100644 --- a/deps/npm/node_modules/punycode/package.json +++ b/deps/npm/node_modules/punycode/package.json @@ -1,88 +1,58 @@ { - "_from": "punycode@^1.4.1", - "_id": "punycode@1.4.1", - "_inBundle": false, - "_integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=", - "_location": "/punycode", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "punycode@^1.4.1", - "name": "punycode", - "escapedName": "punycode", - "rawSpec": "^1.4.1", - "saveSpec": null, - "fetchSpec": "^1.4.1" + "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" }, - "_requiredBy": [ - "/tough-cookie", - "/unicode-length" + "keywords": [ + "punycode", + "unicode", + "idn", + "idna", + "dns", + "url", + "domain" ], - "_resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", - "_shasum": "c0d5a63b2718800ad8e1eb0fa5269c84dd41845e", - "_spec": "punycode@^1.4.1", - "_where": "/Users/rebecca/code/npm/node_modules/tough-cookie", + "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/" - }, - { - "name": "John-David Dalton", - "url": "http://allyoucanleet.com/" } ], - "deprecated": false, - "description": "A robust Punycode converter that fully complies to RFC 3492 and RFC 5891, and works on nearly all JavaScript platforms.", - "devDependencies": { - "coveralls": "^2.11.4", - "grunt": "^0.4.5", - "grunt-contrib-uglify": "^0.11.0", - "grunt-shell": "^1.1.2", - "istanbul": "^0.4.1", - "qunit-extras": "^1.4.4", - "qunitjs": "~1.11.0", - "requirejs": "^2.1.22" + "repository": { + "type": "git", + "url": "https://github.com/bestiejs/punycode.js.git" }, + "bugs": "https://github.com/bestiejs/punycode.js/issues", "files": [ "LICENSE-MIT.txt", - "punycode.js" + "punycode.js", + "punycode.es6.js" ], - "homepage": "https://mths.be/punycode", + "scripts": { + "test": "mocha tests", + "prepublish": "node scripts/prepublish.js" + }, + "devDependencies": { + "codecov": "^1.0.1", + "istanbul": "^0.4.1", + "mocha": "^2.5.3" + }, "jspm": { "map": { "./punycode.js": { "node": "@node/punycode" } } - }, - "keywords": [ - "punycode", - "unicode", - "idn", - "idna", - "dns", - "url", - "domain" - ], - "license": "MIT", - "main": "punycode.js", - "name": "punycode", - "repository": { - "type": "git", - "url": "git+https://github.com/bestiejs/punycode.js.git" - }, - "scripts": { - "test": "node tests/tests.js" - }, - "version": "1.4.1" + } } diff --git a/deps/npm/node_modules/punycode/punycode.es6.js b/deps/npm/node_modules/punycode/punycode.es6.js new file mode 100644 index 00000000000000..4610bc9ebf2974 --- /dev/null +++ b/deps/npm/node_modules/punycode/punycode.es6.js @@ -0,0 +1,441 @@ +'use strict'; + +/** Highest positive signed 32-bit float value */ +const maxInt = 2147483647; // aka. 0x7FFFFFFF or 2^31-1 + +/** Bootstring parameters */ +const base = 36; +const tMin = 1; +const tMax = 26; +const skew = 38; +const damp = 700; +const initialBias = 72; +const initialN = 128; // 0x80 +const delimiter = '-'; // '\x2D' + +/** Regular expressions */ +const regexPunycode = /^xn--/; +const regexNonASCII = /[^\0-\x7E]/; // non-ASCII chars +const regexSeparators = /[\x2E\u3002\uFF0E\uFF61]/g; // RFC 3490 separators + +/** Error messages */ +const errors = { + 'overflow': 'Overflow: input needs wider integers to process', + 'not-basic': 'Illegal input >= 0x80 (not a basic code point)', + 'invalid-input': 'Invalid input' +}; + +/** Convenience shortcuts */ +const baseMinusTMin = base - tMin; +const floor = Math.floor; +const stringFromCharCode = String.fromCharCode; + +/*--------------------------------------------------------------------------*/ + +/** + * A generic error utility function. + * @private + * @param {String} type The error type. + * @returns {Error} Throws a `RangeError` with the applicable error message. + */ +function error(type) { + throw new RangeError(errors[type]); +} + +/** + * A generic `Array#map` utility function. + * @private + * @param {Array} array The array to iterate over. + * @param {Function} callback The function that gets called for every array + * item. + * @returns {Array} A new array of values returned by the callback function. + */ +function map(array, fn) { + const result = []; + let length = array.length; + while (length--) { + result[length] = fn(array[length]); + } + return result; +} + +/** + * A simple `Array#map`-like wrapper to work with domain name strings or email + * addresses. + * @private + * @param {String} domain The domain name or email address. + * @param {Function} callback The function that gets called for every + * character. + * @returns {Array} A new string of characters returned by the callback + * function. + */ +function mapDomain(string, fn) { + const parts = string.split('@'); + let result = ''; + if (parts.length > 1) { + // In email addresses, only the domain name should be punycoded. Leave + // the local part (i.e. everything up to `@`) intact. + result = parts[0] + '@'; + string = parts[1]; + } + // Avoid `split(regex)` for IE8 compatibility. See #17. + string = string.replace(regexSeparators, '\x2E'); + const labels = string.split('.'); + const encoded = map(labels, fn).join('.'); + return result + encoded; +} + +/** + * Creates an array containing the numeric code points of each Unicode + * character in the string. While JavaScript uses UCS-2 internally, + * this function will convert a pair of surrogate halves (each of which + * UCS-2 exposes as separate characters) into a single code point, + * matching UTF-16. + * @see `punycode.ucs2.encode` + * @see + * @memberOf punycode.ucs2 + * @name decode + * @param {String} string The Unicode input string (UCS-2). + * @returns {Array} The new array of code points. + */ +function ucs2decode(string) { + const output = []; + let counter = 0; + const length = string.length; + while (counter < length) { + const value = string.charCodeAt(counter++); + if (value >= 0xD800 && value <= 0xDBFF && counter < length) { + // It's a high surrogate, and there is a next character. + const extra = string.charCodeAt(counter++); + if ((extra & 0xFC00) == 0xDC00) { // Low surrogate. + output.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000); + } else { + // It's an unmatched surrogate; only append this code unit, in case the + // next code unit is the high surrogate of a surrogate pair. + output.push(value); + counter--; + } + } else { + output.push(value); + } + } + return output; +} + +/** + * Creates a string based on an array of numeric code points. + * @see `punycode.ucs2.decode` + * @memberOf punycode.ucs2 + * @name encode + * @param {Array} codePoints The array of numeric code points. + * @returns {String} The new Unicode string (UCS-2). + */ +const ucs2encode = array => String.fromCodePoint(...array); + +/** + * Converts a basic code point into a digit/integer. + * @see `digitToBasic()` + * @private + * @param {Number} codePoint The basic numeric code point value. + * @returns {Number} The numeric value of a basic code point (for use in + * representing integers) in the range `0` to `base - 1`, or `base` if + * the code point does not represent a value. + */ +const basicToDigit = function(codePoint) { + if (codePoint - 0x30 < 0x0A) { + return codePoint - 0x16; + } + if (codePoint - 0x41 < 0x1A) { + return codePoint - 0x41; + } + if (codePoint - 0x61 < 0x1A) { + return codePoint - 0x61; + } + return base; +}; + +/** + * Converts a digit/integer into a basic code point. + * @see `basicToDigit()` + * @private + * @param {Number} digit The numeric value of a basic code point. + * @returns {Number} The basic code point whose value (when used for + * representing integers) is `digit`, which needs to be in the range + * `0` to `base - 1`. If `flag` is non-zero, the uppercase form is + * used; else, the lowercase form is used. The behavior is undefined + * if `flag` is non-zero and `digit` has no uppercase form. + */ +const digitToBasic = function(digit, flag) { + // 0..25 map to ASCII a..z or A..Z + // 26..35 map to ASCII 0..9 + return digit + 22 + 75 * (digit < 26) - ((flag != 0) << 5); +}; + +/** + * Bias adaptation function as per section 3.4 of RFC 3492. + * https://tools.ietf.org/html/rfc3492#section-3.4 + * @private + */ +const adapt = function(delta, numPoints, firstTime) { + let k = 0; + delta = firstTime ? floor(delta / damp) : delta >> 1; + delta += floor(delta / numPoints); + for (/* no initialization */; delta > baseMinusTMin * tMax >> 1; k += base) { + delta = floor(delta / baseMinusTMin); + } + return floor(k + (baseMinusTMin + 1) * delta / (delta + skew)); +}; + +/** + * Converts a Punycode string of ASCII-only symbols to a string of Unicode + * symbols. + * @memberOf punycode + * @param {String} input The Punycode string of ASCII-only symbols. + * @returns {String} The resulting string of Unicode symbols. + */ +const decode = function(input) { + // Don't use UCS-2. + const output = []; + const inputLength = input.length; + let i = 0; + let n = initialN; + let bias = initialBias; + + // Handle the basic code points: let `basic` be the number of input code + // points before the last delimiter, or `0` if there is none, then copy + // the first basic code points to the output. + + let basic = input.lastIndexOf(delimiter); + if (basic < 0) { + basic = 0; + } + + for (let j = 0; j < basic; ++j) { + // if it's not a basic code point + if (input.charCodeAt(j) >= 0x80) { + error('not-basic'); + } + output.push(input.charCodeAt(j)); + } + + // Main decoding loop: start just after the last delimiter if any basic code + // points were copied; start at the beginning otherwise. + + for (let index = basic > 0 ? basic + 1 : 0; index < inputLength; /* no final expression */) { + + // `index` is the index of the next character to be consumed. + // Decode a generalized variable-length integer into `delta`, + // which gets added to `i`. The overflow checking is easier + // if we increase `i` as we go, then subtract off its starting + // value at the end to obtain `delta`. + let oldi = i; + for (let w = 1, k = base; /* no condition */; k += base) { + + if (index >= inputLength) { + error('invalid-input'); + } + + const digit = basicToDigit(input.charCodeAt(index++)); + + if (digit >= base || digit > floor((maxInt - i) / w)) { + error('overflow'); + } + + i += digit * w; + const t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias); + + if (digit < t) { + break; + } + + const baseMinusT = base - t; + if (w > floor(maxInt / baseMinusT)) { + error('overflow'); + } + + w *= baseMinusT; + + } + + const out = output.length + 1; + bias = adapt(i - oldi, out, oldi == 0); + + // `i` was supposed to wrap around from `out` to `0`, + // incrementing `n` each time, so we'll fix that now: + if (floor(i / out) > maxInt - n) { + error('overflow'); + } + + n += floor(i / out); + i %= out; + + // Insert `n` at position `i` of the output. + output.splice(i++, 0, n); + + } + + return String.fromCodePoint(...output); +}; + +/** + * Converts a string of Unicode symbols (e.g. a domain name label) to a + * Punycode string of ASCII-only symbols. + * @memberOf punycode + * @param {String} input The string of Unicode symbols. + * @returns {String} The resulting Punycode string of ASCII-only symbols. + */ +const encode = function(input) { + const output = []; + + // Convert the input in UCS-2 to an array of Unicode code points. + input = ucs2decode(input); + + // Cache the length. + let inputLength = input.length; + + // Initialize the state. + let n = initialN; + let delta = 0; + let bias = initialBias; + + // Handle the basic code points. + for (const currentValue of input) { + if (currentValue < 0x80) { + output.push(stringFromCharCode(currentValue)); + } + } + + let basicLength = output.length; + let handledCPCount = basicLength; + + // `handledCPCount` is the number of code points that have been handled; + // `basicLength` is the number of basic code points. + + // Finish the basic string with a delimiter unless it's empty. + if (basicLength) { + output.push(delimiter); + } + + // Main encoding loop: + while (handledCPCount < inputLength) { + + // All non-basic code points < n have been handled already. Find the next + // larger one: + let m = maxInt; + for (const currentValue of input) { + if (currentValue >= n && currentValue < m) { + m = currentValue; + } + } + + // Increase `delta` enough to advance the decoder's state to , + // but guard against overflow. + const handledCPCountPlusOne = handledCPCount + 1; + if (m - n > floor((maxInt - delta) / handledCPCountPlusOne)) { + error('overflow'); + } + + delta += (m - n) * handledCPCountPlusOne; + n = m; + + for (const currentValue of input) { + if (currentValue < n && ++delta > maxInt) { + error('overflow'); + } + if (currentValue == n) { + // Represent delta as a generalized variable-length integer. + let q = delta; + for (let k = base; /* no condition */; k += base) { + const t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias); + if (q < t) { + break; + } + const qMinusT = q - t; + const baseMinusT = base - t; + output.push( + stringFromCharCode(digitToBasic(t + qMinusT % baseMinusT, 0)) + ); + q = floor(qMinusT / baseMinusT); + } + + output.push(stringFromCharCode(digitToBasic(q, 0))); + bias = adapt(delta, handledCPCountPlusOne, handledCPCount == basicLength); + delta = 0; + ++handledCPCount; + } + } + + ++delta; + ++n; + + } + return output.join(''); +}; + +/** + * Converts a Punycode string representing a domain name or an email address + * to Unicode. Only the Punycoded parts of the input will be converted, i.e. + * it doesn't matter if you call it on a string that has already been + * converted to Unicode. + * @memberOf punycode + * @param {String} input The Punycoded domain name or email address to + * convert to Unicode. + * @returns {String} The Unicode representation of the given Punycode + * string. + */ +const toUnicode = function(input) { + return mapDomain(input, function(string) { + return regexPunycode.test(string) + ? decode(string.slice(4).toLowerCase()) + : string; + }); +}; + +/** + * Converts a Unicode string representing a domain name or an email address to + * Punycode. Only the non-ASCII parts of the domain name will be converted, + * i.e. it doesn't matter if you call it with a domain that's already in + * ASCII. + * @memberOf punycode + * @param {String} input The domain name or email address to convert, as a + * Unicode string. + * @returns {String} The Punycode representation of the given domain name or + * email address. + */ +const toASCII = function(input) { + return mapDomain(input, function(string) { + return regexNonASCII.test(string) + ? 'xn--' + encode(string) + : string; + }); +}; + +/*--------------------------------------------------------------------------*/ + +/** Define the public API */ +const punycode = { + /** + * A string representing the current Punycode.js version number. + * @memberOf punycode + * @type String + */ + 'version': '2.1.0', + /** + * An object of methods to convert from JavaScript's internal character + * representation (UCS-2) to Unicode code points, and back. + * @see + * @memberOf punycode + * @type Object + */ + 'ucs2': { + 'decode': ucs2decode, + 'encode': ucs2encode + }, + 'decode': decode, + 'encode': encode, + 'toASCII': toASCII, + 'toUnicode': toUnicode +}; + +export { ucs2decode, ucs2encode, decode, encode, toASCII, toUnicode }; +export default punycode; diff --git a/deps/npm/node_modules/punycode/punycode.js b/deps/npm/node_modules/punycode/punycode.js index 2c87f6cc485733..ea61fd0d39a39d 100644 --- a/deps/npm/node_modules/punycode/punycode.js +++ b/deps/npm/node_modules/punycode/punycode.js @@ -1,533 +1,440 @@ -/*! https://mths.be/punycode v1.4.1 by @mathias */ -;(function(root) { - - /** Detect free variables */ - var freeExports = typeof exports == 'object' && exports && - !exports.nodeType && exports; - var freeModule = typeof module == 'object' && module && - !module.nodeType && module; - var freeGlobal = typeof global == 'object' && global; - if ( - freeGlobal.global === freeGlobal || - freeGlobal.window === freeGlobal || - freeGlobal.self === freeGlobal - ) { - root = freeGlobal; +'use strict'; + +/** Highest positive signed 32-bit float value */ +const maxInt = 2147483647; // aka. 0x7FFFFFFF or 2^31-1 + +/** Bootstring parameters */ +const base = 36; +const tMin = 1; +const tMax = 26; +const skew = 38; +const damp = 700; +const initialBias = 72; +const initialN = 128; // 0x80 +const delimiter = '-'; // '\x2D' + +/** Regular expressions */ +const regexPunycode = /^xn--/; +const regexNonASCII = /[^\0-\x7E]/; // non-ASCII chars +const regexSeparators = /[\x2E\u3002\uFF0E\uFF61]/g; // RFC 3490 separators + +/** Error messages */ +const errors = { + 'overflow': 'Overflow: input needs wider integers to process', + 'not-basic': 'Illegal input >= 0x80 (not a basic code point)', + 'invalid-input': 'Invalid input' +}; + +/** Convenience shortcuts */ +const baseMinusTMin = base - tMin; +const floor = Math.floor; +const stringFromCharCode = String.fromCharCode; + +/*--------------------------------------------------------------------------*/ + +/** + * A generic error utility function. + * @private + * @param {String} type The error type. + * @returns {Error} Throws a `RangeError` with the applicable error message. + */ +function error(type) { + throw new RangeError(errors[type]); +} + +/** + * A generic `Array#map` utility function. + * @private + * @param {Array} array The array to iterate over. + * @param {Function} callback The function that gets called for every array + * item. + * @returns {Array} A new array of values returned by the callback function. + */ +function map(array, fn) { + const result = []; + let length = array.length; + while (length--) { + result[length] = fn(array[length]); } - - /** - * The `punycode` object. - * @name punycode - * @type Object - */ - var punycode, - - /** Highest positive signed 32-bit float value */ - maxInt = 2147483647, // aka. 0x7FFFFFFF or 2^31-1 - - /** Bootstring parameters */ - base = 36, - tMin = 1, - tMax = 26, - skew = 38, - damp = 700, - initialBias = 72, - initialN = 128, // 0x80 - delimiter = '-', // '\x2D' - - /** Regular expressions */ - regexPunycode = /^xn--/, - regexNonASCII = /[^\x20-\x7E]/, // unprintable ASCII chars + non-ASCII chars - regexSeparators = /[\x2E\u3002\uFF0E\uFF61]/g, // RFC 3490 separators - - /** Error messages */ - errors = { - 'overflow': 'Overflow: input needs wider integers to process', - 'not-basic': 'Illegal input >= 0x80 (not a basic code point)', - 'invalid-input': 'Invalid input' - }, - - /** Convenience shortcuts */ - baseMinusTMin = base - tMin, - floor = Math.floor, - stringFromCharCode = String.fromCharCode, - - /** Temporary variable */ - key; - - /*--------------------------------------------------------------------------*/ - - /** - * A generic error utility function. - * @private - * @param {String} type The error type. - * @returns {Error} Throws a `RangeError` with the applicable error message. - */ - function error(type) { - throw new RangeError(errors[type]); + return result; +} + +/** + * A simple `Array#map`-like wrapper to work with domain name strings or email + * addresses. + * @private + * @param {String} domain The domain name or email address. + * @param {Function} callback The function that gets called for every + * character. + * @returns {Array} A new string of characters returned by the callback + * function. + */ +function mapDomain(string, fn) { + const parts = string.split('@'); + let result = ''; + if (parts.length > 1) { + // In email addresses, only the domain name should be punycoded. Leave + // the local part (i.e. everything up to `@`) intact. + result = parts[0] + '@'; + string = parts[1]; } - - /** - * A generic `Array#map` utility function. - * @private - * @param {Array} array The array to iterate over. - * @param {Function} callback The function that gets called for every array - * item. - * @returns {Array} A new array of values returned by the callback function. - */ - function map(array, fn) { - var length = array.length; - var result = []; - while (length--) { - result[length] = fn(array[length]); - } - return result; - } - - /** - * A simple `Array#map`-like wrapper to work with domain name strings or email - * addresses. - * @private - * @param {String} domain The domain name or email address. - * @param {Function} callback The function that gets called for every - * character. - * @returns {Array} A new string of characters returned by the callback - * function. - */ - function mapDomain(string, fn) { - var parts = string.split('@'); - var result = ''; - if (parts.length > 1) { - // In email addresses, only the domain name should be punycoded. Leave - // the local part (i.e. everything up to `@`) intact. - result = parts[0] + '@'; - string = parts[1]; - } - // Avoid `split(regex)` for IE8 compatibility. See #17. - string = string.replace(regexSeparators, '\x2E'); - var labels = string.split('.'); - var encoded = map(labels, fn).join('.'); - return result + encoded; - } - - /** - * Creates an array containing the numeric code points of each Unicode - * character in the string. While JavaScript uses UCS-2 internally, - * this function will convert a pair of surrogate halves (each of which - * UCS-2 exposes as separate characters) into a single code point, - * matching UTF-16. - * @see `punycode.ucs2.encode` - * @see - * @memberOf punycode.ucs2 - * @name decode - * @param {String} string The Unicode input string (UCS-2). - * @returns {Array} The new array of code points. - */ - function ucs2decode(string) { - var output = [], - counter = 0, - length = string.length, - value, - extra; - while (counter < length) { - value = string.charCodeAt(counter++); - if (value >= 0xD800 && value <= 0xDBFF && counter < length) { - // high surrogate, and there is a next character - extra = string.charCodeAt(counter++); - if ((extra & 0xFC00) == 0xDC00) { // low surrogate - output.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000); - } else { - // unmatched surrogate; only append this code unit, in case the next - // code unit is the high surrogate of a surrogate pair - output.push(value); - counter--; - } + // Avoid `split(regex)` for IE8 compatibility. See #17. + string = string.replace(regexSeparators, '\x2E'); + const labels = string.split('.'); + const encoded = map(labels, fn).join('.'); + return result + encoded; +} + +/** + * Creates an array containing the numeric code points of each Unicode + * character in the string. While JavaScript uses UCS-2 internally, + * this function will convert a pair of surrogate halves (each of which + * UCS-2 exposes as separate characters) into a single code point, + * matching UTF-16. + * @see `punycode.ucs2.encode` + * @see + * @memberOf punycode.ucs2 + * @name decode + * @param {String} string The Unicode input string (UCS-2). + * @returns {Array} The new array of code points. + */ +function ucs2decode(string) { + const output = []; + let counter = 0; + const length = string.length; + while (counter < length) { + const value = string.charCodeAt(counter++); + if (value >= 0xD800 && value <= 0xDBFF && counter < length) { + // It's a high surrogate, and there is a next character. + const extra = string.charCodeAt(counter++); + if ((extra & 0xFC00) == 0xDC00) { // Low surrogate. + output.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000); } else { + // It's an unmatched surrogate; only append this code unit, in case the + // next code unit is the high surrogate of a surrogate pair. output.push(value); + counter--; } + } else { + output.push(value); } - return output; } - - /** - * Creates a string based on an array of numeric code points. - * @see `punycode.ucs2.decode` - * @memberOf punycode.ucs2 - * @name encode - * @param {Array} codePoints The array of numeric code points. - * @returns {String} The new Unicode string (UCS-2). - */ - function ucs2encode(array) { - return map(array, function(value) { - var output = ''; - if (value > 0xFFFF) { - value -= 0x10000; - output += stringFromCharCode(value >>> 10 & 0x3FF | 0xD800); - value = 0xDC00 | value & 0x3FF; - } - output += stringFromCharCode(value); - return output; - }).join(''); + return output; +} + +/** + * Creates a string based on an array of numeric code points. + * @see `punycode.ucs2.decode` + * @memberOf punycode.ucs2 + * @name encode + * @param {Array} codePoints The array of numeric code points. + * @returns {String} The new Unicode string (UCS-2). + */ +const ucs2encode = array => String.fromCodePoint(...array); + +/** + * Converts a basic code point into a digit/integer. + * @see `digitToBasic()` + * @private + * @param {Number} codePoint The basic numeric code point value. + * @returns {Number} The numeric value of a basic code point (for use in + * representing integers) in the range `0` to `base - 1`, or `base` if + * the code point does not represent a value. + */ +const basicToDigit = function(codePoint) { + if (codePoint - 0x30 < 0x0A) { + return codePoint - 0x16; } - - /** - * Converts a basic code point into a digit/integer. - * @see `digitToBasic()` - * @private - * @param {Number} codePoint The basic numeric code point value. - * @returns {Number} The numeric value of a basic code point (for use in - * representing integers) in the range `0` to `base - 1`, or `base` if - * the code point does not represent a value. - */ - function basicToDigit(codePoint) { - if (codePoint - 48 < 10) { - return codePoint - 22; - } - if (codePoint - 65 < 26) { - return codePoint - 65; - } - if (codePoint - 97 < 26) { - return codePoint - 97; - } - return base; + if (codePoint - 0x41 < 0x1A) { + return codePoint - 0x41; } - - /** - * Converts a digit/integer into a basic code point. - * @see `basicToDigit()` - * @private - * @param {Number} digit The numeric value of a basic code point. - * @returns {Number} The basic code point whose value (when used for - * representing integers) is `digit`, which needs to be in the range - * `0` to `base - 1`. If `flag` is non-zero, the uppercase form is - * used; else, the lowercase form is used. The behavior is undefined - * if `flag` is non-zero and `digit` has no uppercase form. - */ - function digitToBasic(digit, flag) { - // 0..25 map to ASCII a..z or A..Z - // 26..35 map to ASCII 0..9 - return digit + 22 + 75 * (digit < 26) - ((flag != 0) << 5); + if (codePoint - 0x61 < 0x1A) { + return codePoint - 0x61; } - - /** - * Bias adaptation function as per section 3.4 of RFC 3492. - * https://tools.ietf.org/html/rfc3492#section-3.4 - * @private - */ - function adapt(delta, numPoints, firstTime) { - var k = 0; - delta = firstTime ? floor(delta / damp) : delta >> 1; - delta += floor(delta / numPoints); - for (/* no initialization */; delta > baseMinusTMin * tMax >> 1; k += base) { - delta = floor(delta / baseMinusTMin); - } - return floor(k + (baseMinusTMin + 1) * delta / (delta + skew)); + return base; +}; + +/** + * Converts a digit/integer into a basic code point. + * @see `basicToDigit()` + * @private + * @param {Number} digit The numeric value of a basic code point. + * @returns {Number} The basic code point whose value (when used for + * representing integers) is `digit`, which needs to be in the range + * `0` to `base - 1`. If `flag` is non-zero, the uppercase form is + * used; else, the lowercase form is used. The behavior is undefined + * if `flag` is non-zero and `digit` has no uppercase form. + */ +const digitToBasic = function(digit, flag) { + // 0..25 map to ASCII a..z or A..Z + // 26..35 map to ASCII 0..9 + return digit + 22 + 75 * (digit < 26) - ((flag != 0) << 5); +}; + +/** + * Bias adaptation function as per section 3.4 of RFC 3492. + * https://tools.ietf.org/html/rfc3492#section-3.4 + * @private + */ +const adapt = function(delta, numPoints, firstTime) { + let k = 0; + delta = firstTime ? floor(delta / damp) : delta >> 1; + delta += floor(delta / numPoints); + for (/* no initialization */; delta > baseMinusTMin * tMax >> 1; k += base) { + delta = floor(delta / baseMinusTMin); + } + return floor(k + (baseMinusTMin + 1) * delta / (delta + skew)); +}; + +/** + * Converts a Punycode string of ASCII-only symbols to a string of Unicode + * symbols. + * @memberOf punycode + * @param {String} input The Punycode string of ASCII-only symbols. + * @returns {String} The resulting string of Unicode symbols. + */ +const decode = function(input) { + // Don't use UCS-2. + const output = []; + const inputLength = input.length; + let i = 0; + let n = initialN; + let bias = initialBias; + + // Handle the basic code points: let `basic` be the number of input code + // points before the last delimiter, or `0` if there is none, then copy + // the first basic code points to the output. + + let basic = input.lastIndexOf(delimiter); + if (basic < 0) { + basic = 0; } - /** - * Converts a Punycode string of ASCII-only symbols to a string of Unicode - * symbols. - * @memberOf punycode - * @param {String} input The Punycode string of ASCII-only symbols. - * @returns {String} The resulting string of Unicode symbols. - */ - function decode(input) { - // Don't use UCS-2 - var output = [], - inputLength = input.length, - out, - i = 0, - n = initialN, - bias = initialBias, - basic, - j, - index, - oldi, - w, - k, - digit, - t, - /** Cached calculation results */ - baseMinusT; - - // Handle the basic code points: let `basic` be the number of input code - // points before the last delimiter, or `0` if there is none, then copy - // the first basic code points to the output. - - basic = input.lastIndexOf(delimiter); - if (basic < 0) { - basic = 0; - } - - for (j = 0; j < basic; ++j) { - // if it's not a basic code point - if (input.charCodeAt(j) >= 0x80) { - error('not-basic'); - } - output.push(input.charCodeAt(j)); + for (let j = 0; j < basic; ++j) { + // if it's not a basic code point + if (input.charCodeAt(j) >= 0x80) { + error('not-basic'); } + output.push(input.charCodeAt(j)); + } - // Main decoding loop: start just after the last delimiter if any basic code - // points were copied; start at the beginning otherwise. - - for (index = basic > 0 ? basic + 1 : 0; index < inputLength; /* no final expression */) { - - // `index` is the index of the next character to be consumed. - // Decode a generalized variable-length integer into `delta`, - // which gets added to `i`. The overflow checking is easier - // if we increase `i` as we go, then subtract off its starting - // value at the end to obtain `delta`. - for (oldi = i, w = 1, k = base; /* no condition */; k += base) { - - if (index >= inputLength) { - error('invalid-input'); - } + // Main decoding loop: start just after the last delimiter if any basic code + // points were copied; start at the beginning otherwise. - digit = basicToDigit(input.charCodeAt(index++)); + for (let index = basic > 0 ? basic + 1 : 0; index < inputLength; /* no final expression */) { - if (digit >= base || digit > floor((maxInt - i) / w)) { - error('overflow'); - } + // `index` is the index of the next character to be consumed. + // Decode a generalized variable-length integer into `delta`, + // which gets added to `i`. The overflow checking is easier + // if we increase `i` as we go, then subtract off its starting + // value at the end to obtain `delta`. + let oldi = i; + for (let w = 1, k = base; /* no condition */; k += base) { - i += digit * w; - t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias); + if (index >= inputLength) { + error('invalid-input'); + } - if (digit < t) { - break; - } + const digit = basicToDigit(input.charCodeAt(index++)); - baseMinusT = base - t; - if (w > floor(maxInt / baseMinusT)) { - error('overflow'); - } + if (digit >= base || digit > floor((maxInt - i) / w)) { + error('overflow'); + } - w *= baseMinusT; + i += digit * w; + const t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias); + if (digit < t) { + break; } - out = output.length + 1; - bias = adapt(i - oldi, out, oldi == 0); - - // `i` was supposed to wrap around from `out` to `0`, - // incrementing `n` each time, so we'll fix that now: - if (floor(i / out) > maxInt - n) { + const baseMinusT = base - t; + if (w > floor(maxInt / baseMinusT)) { error('overflow'); } - n += floor(i / out); - i %= out; - - // Insert `n` at position `i` of the output - output.splice(i++, 0, n); + w *= baseMinusT; } - return ucs2encode(output); - } + const out = output.length + 1; + bias = adapt(i - oldi, out, oldi == 0); - /** - * Converts a string of Unicode symbols (e.g. a domain name label) to a - * Punycode string of ASCII-only symbols. - * @memberOf punycode - * @param {String} input The string of Unicode symbols. - * @returns {String} The resulting Punycode string of ASCII-only symbols. - */ - function encode(input) { - var n, - delta, - handledCPCount, - basicLength, - bias, - j, - m, - q, - k, - t, - currentValue, - output = [], - /** `inputLength` will hold the number of code points in `input`. */ - inputLength, - /** Cached calculation results */ - handledCPCountPlusOne, - baseMinusT, - qMinusT; - - // Convert the input in UCS-2 to Unicode - input = ucs2decode(input); - - // Cache the length - inputLength = input.length; - - // Initialize the state - n = initialN; - delta = 0; - bias = initialBias; - - // Handle the basic code points - for (j = 0; j < inputLength; ++j) { - currentValue = input[j]; - if (currentValue < 0x80) { - output.push(stringFromCharCode(currentValue)); - } + // `i` was supposed to wrap around from `out` to `0`, + // incrementing `n` each time, so we'll fix that now: + if (floor(i / out) > maxInt - n) { + error('overflow'); } - handledCPCount = basicLength = output.length; + n += floor(i / out); + i %= out; - // `handledCPCount` is the number of code points that have been handled; - // `basicLength` is the number of basic code points. + // Insert `n` at position `i` of the output. + output.splice(i++, 0, n); - // Finish the basic string - if it is not empty - with a delimiter - if (basicLength) { - output.push(delimiter); + } + + return String.fromCodePoint(...output); +}; + +/** + * Converts a string of Unicode symbols (e.g. a domain name label) to a + * Punycode string of ASCII-only symbols. + * @memberOf punycode + * @param {String} input The string of Unicode symbols. + * @returns {String} The resulting Punycode string of ASCII-only symbols. + */ +const encode = function(input) { + const output = []; + + // Convert the input in UCS-2 to an array of Unicode code points. + input = ucs2decode(input); + + // Cache the length. + let inputLength = input.length; + + // Initialize the state. + let n = initialN; + let delta = 0; + let bias = initialBias; + + // Handle the basic code points. + for (const currentValue of input) { + if (currentValue < 0x80) { + output.push(stringFromCharCode(currentValue)); } + } - // Main encoding loop: - while (handledCPCount < inputLength) { + let basicLength = output.length; + let handledCPCount = basicLength; - // All non-basic code points < n have been handled already. Find the next - // larger one: - for (m = maxInt, j = 0; j < inputLength; ++j) { - currentValue = input[j]; - if (currentValue >= n && currentValue < m) { - m = currentValue; - } - } + // `handledCPCount` is the number of code points that have been handled; + // `basicLength` is the number of basic code points. - // Increase `delta` enough to advance the decoder's state to , - // but guard against overflow - handledCPCountPlusOne = handledCPCount + 1; - if (m - n > floor((maxInt - delta) / handledCPCountPlusOne)) { - error('overflow'); - } + // Finish the basic string with a delimiter unless it's empty. + if (basicLength) { + output.push(delimiter); + } - delta += (m - n) * handledCPCountPlusOne; - n = m; + // Main encoding loop: + while (handledCPCount < inputLength) { - for (j = 0; j < inputLength; ++j) { - currentValue = input[j]; + // All non-basic code points < n have been handled already. Find the next + // larger one: + let m = maxInt; + for (const currentValue of input) { + if (currentValue >= n && currentValue < m) { + m = currentValue; + } + } - if (currentValue < n && ++delta > maxInt) { - error('overflow'); - } + // Increase `delta` enough to advance the decoder's state to , + // but guard against overflow. + const handledCPCountPlusOne = handledCPCount + 1; + if (m - n > floor((maxInt - delta) / handledCPCountPlusOne)) { + error('overflow'); + } - if (currentValue == n) { - // Represent delta as a generalized variable-length integer - for (q = delta, k = base; /* no condition */; k += base) { - t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias); - if (q < t) { - break; - } - qMinusT = q - t; - baseMinusT = base - t; - output.push( - stringFromCharCode(digitToBasic(t + qMinusT % baseMinusT, 0)) - ); - q = floor(qMinusT / baseMinusT); - } + delta += (m - n) * handledCPCountPlusOne; + n = m; - output.push(stringFromCharCode(digitToBasic(q, 0))); - bias = adapt(delta, handledCPCountPlusOne, handledCPCount == basicLength); - delta = 0; - ++handledCPCount; + for (const currentValue of input) { + if (currentValue < n && ++delta > maxInt) { + error('overflow'); + } + if (currentValue == n) { + // Represent delta as a generalized variable-length integer. + let q = delta; + for (let k = base; /* no condition */; k += base) { + const t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias); + if (q < t) { + break; + } + const qMinusT = q - t; + const baseMinusT = base - t; + output.push( + stringFromCharCode(digitToBasic(t + qMinusT % baseMinusT, 0)) + ); + q = floor(qMinusT / baseMinusT); } + + output.push(stringFromCharCode(digitToBasic(q, 0))); + bias = adapt(delta, handledCPCountPlusOne, handledCPCount == basicLength); + delta = 0; + ++handledCPCount; } + } - ++delta; - ++n; + ++delta; + ++n; - } - return output.join(''); } - + return output.join(''); +}; + +/** + * Converts a Punycode string representing a domain name or an email address + * to Unicode. Only the Punycoded parts of the input will be converted, i.e. + * it doesn't matter if you call it on a string that has already been + * converted to Unicode. + * @memberOf punycode + * @param {String} input The Punycoded domain name or email address to + * convert to Unicode. + * @returns {String} The Unicode representation of the given Punycode + * string. + */ +const toUnicode = function(input) { + return mapDomain(input, function(string) { + return regexPunycode.test(string) + ? decode(string.slice(4).toLowerCase()) + : string; + }); +}; + +/** + * Converts a Unicode string representing a domain name or an email address to + * Punycode. Only the non-ASCII parts of the domain name will be converted, + * i.e. it doesn't matter if you call it with a domain that's already in + * ASCII. + * @memberOf punycode + * @param {String} input The domain name or email address to convert, as a + * Unicode string. + * @returns {String} The Punycode representation of the given domain name or + * email address. + */ +const toASCII = function(input) { + return mapDomain(input, function(string) { + return regexNonASCII.test(string) + ? 'xn--' + encode(string) + : string; + }); +}; + +/*--------------------------------------------------------------------------*/ + +/** Define the public API */ +const punycode = { /** - * Converts a Punycode string representing a domain name or an email address - * to Unicode. Only the Punycoded parts of the input will be converted, i.e. - * it doesn't matter if you call it on a string that has already been - * converted to Unicode. + * A string representing the current Punycode.js version number. * @memberOf punycode - * @param {String} input The Punycoded domain name or email address to - * convert to Unicode. - * @returns {String} The Unicode representation of the given Punycode - * string. + * @type String */ - function toUnicode(input) { - return mapDomain(input, function(string) { - return regexPunycode.test(string) - ? decode(string.slice(4).toLowerCase()) - : string; - }); - } - + 'version': '2.1.0', /** - * Converts a Unicode string representing a domain name or an email address to - * Punycode. Only the non-ASCII parts of the domain name will be converted, - * i.e. it doesn't matter if you call it with a domain that's already in - * ASCII. + * An object of methods to convert from JavaScript's internal character + * representation (UCS-2) to Unicode code points, and back. + * @see * @memberOf punycode - * @param {String} input The domain name or email address to convert, as a - * Unicode string. - * @returns {String} The Punycode representation of the given domain name or - * email address. + * @type Object */ - function toASCII(input) { - return mapDomain(input, function(string) { - return regexNonASCII.test(string) - ? 'xn--' + encode(string) - : string; - }); - } - - /*--------------------------------------------------------------------------*/ - - /** Define the public API */ - punycode = { - /** - * A string representing the current Punycode.js version number. - * @memberOf punycode - * @type String - */ - 'version': '1.4.1', - /** - * An object of methods to convert from JavaScript's internal character - * representation (UCS-2) to Unicode code points, and back. - * @see - * @memberOf punycode - * @type Object - */ - 'ucs2': { - 'decode': ucs2decode, - 'encode': ucs2encode - }, - 'decode': decode, - 'encode': encode, - 'toASCII': toASCII, - 'toUnicode': toUnicode - }; - - /** Expose `punycode` */ - // Some AMD build optimizers, like r.js, check for specific condition patterns - // like the following: - if ( - typeof define == 'function' && - typeof define.amd == 'object' && - define.amd - ) { - define('punycode', function() { - return punycode; - }); - } else if (freeExports && freeModule) { - if (module.exports == freeExports) { - // in Node.js, io.js, or RingoJS v0.8.0+ - freeModule.exports = punycode; - } else { - // in Narwhal or RingoJS v0.7.0- - for (key in punycode) { - punycode.hasOwnProperty(key) && (freeExports[key] = punycode[key]); - } - } - } else { - // in Rhino or a web browser - root.punycode = punycode; - } + 'ucs2': { + 'decode': ucs2decode, + 'encode': ucs2encode + }, + 'decode': decode, + 'encode': encode, + 'toASCII': toASCII, + 'toUnicode': toUnicode +}; -}(this)); +module.exports = punycode; diff --git a/deps/npm/node_modules/qrcode-terminal/package.json b/deps/npm/node_modules/qrcode-terminal/package.json index 5ce56c352b199f..9a6b9e78448936 100644 --- a/deps/npm/node_modules/qrcode-terminal/package.json +++ b/deps/npm/node_modules/qrcode-terminal/package.json @@ -1,78 +1,37 @@ { - "_args": [ - [ - "qrcode-terminal@0.12.0", - "/Users/rebecca/code/npm" - ] - ], - "_from": "qrcode-terminal@0.12.0", - "_id": "qrcode-terminal@0.12.0", - "_inBundle": false, - "_integrity": "sha512-EXtzRZmC+YGmGlDFbXKxQiMZNwCLEO6BANKXG4iCtSIM0yqc/pappSx3RIKr4r0uh5JsBckOXeKrB3Iz7mdQpQ==", - "_location": "/qrcode-terminal", - "_phantomChildren": {}, - "_requested": { - "type": "version", - "registry": true, - "raw": "qrcode-terminal@0.12.0", - "name": "qrcode-terminal", - "escapedName": "qrcode-terminal", - "rawSpec": "0.12.0", - "saveSpec": null, - "fetchSpec": "0.12.0" + "name": "qrcode-terminal", + "keywords": ["ansi", "ascii", "qrcode", "console"], + "version" : "0.12.0", + "description" : "QRCodes, in the terminal", + "homepage": "https://github.com/gtanner/qrcode-terminal", + "repository": { + "type": "git", + "url": "https://github.com/gtanner/qrcode-terminal" }, - "_requiredBy": [ - "/" - ], - "_resolved": "https://registry.npmjs.org/qrcode-terminal/-/qrcode-terminal-0.12.0.tgz", - "_spec": "0.12.0", - "_where": "/Users/rebecca/code/npm", + "contributors": [{ + "name": "Gord Tanner", + "email": "gtanner@gmail.com", + "url": "http://github.com/gtanner" + }, { + "name": "Michael Brooks", + "email": "mikeywbrooks@gmail.com", + "url": "http://github.com/mwbrooks" + }], + "licenses": [{ + "type": "Apache 2.0" + }], + "main": "./lib/main", "bin": { - "qrcode-terminal": "./bin/qrcode-terminal.js" + "qrcode-terminal": "./bin/qrcode-terminal.js" }, - "bugs": { - "url": "https://github.com/gtanner/qrcode-terminal/issues" - }, - "contributors": [ - { - "name": "Gord Tanner", - "email": "gtanner@gmail.com", - "url": "http://github.com/gtanner" - }, - { - "name": "Michael Brooks", - "email": "mikeywbrooks@gmail.com", - "url": "http://github.com/mwbrooks" - } - ], - "description": "QRCodes, in the terminal", + "preferGlobal": false, "devDependencies": { - "expect.js": "*", - "jshint": "*", + "sinon": "*", "mocha": "*", - "sinon": "*" - }, - "homepage": "https://github.com/gtanner/qrcode-terminal", - "keywords": [ - "ansi", - "ascii", - "qrcode", - "console" - ], - "licenses": [ - { - "type": "Apache 2.0" - } - ], - "main": "./lib/main", - "name": "qrcode-terminal", - "preferGlobal": false, - "repository": { - "type": "git", - "url": "git+https://github.com/gtanner/qrcode-terminal.git" + "expect.js": "*", + "jshint": "*" }, "scripts": { "test": "./node_modules/jshint/bin/jshint lib vendor && node example/basic.js && ./node_modules/mocha/bin/mocha -R nyan" - }, - "version": "0.12.0" + } } diff --git a/deps/npm/node_modules/qs/package.json b/deps/npm/node_modules/qs/package.json index 0b912b242b6dd0..2c6549003c47e2 100644 --- a/deps/npm/node_modules/qs/package.json +++ b/deps/npm/node_modules/qs/package.json @@ -1,80 +1,52 @@ { - "_from": "qs@~6.5.1", - "_id": "qs@6.5.2", - "_inBundle": false, - "_integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==", - "_location": "/qs", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "qs@~6.5.1", "name": "qs", - "escapedName": "qs", - "rawSpec": "~6.5.1", - "saveSpec": null, - "fetchSpec": "~6.5.1" - }, - "_requiredBy": [ - "/request" - ], - "_resolved": "https://registry.npmjs.org/qs/-/qs-6.5.2.tgz", - "_shasum": "cb3ae806e8740444584ef154ce8ee98d403f3e36", - "_spec": "qs@~6.5.1", - "_where": "/Users/zkat/Documents/code/work/npm/node_modules/request", - "bugs": { - "url": "https://github.com/ljharb/qs/issues" - }, - "bundleDependencies": false, - "contributors": [ - { - "name": "Jordan Harband", - "email": "ljharb@gmail.com", - "url": "http://ljharb.codes" - } - ], - "dependencies": {}, - "deprecated": false, - "description": "A querystring parser that supports nesting and arrays, with a depth limit", - "devDependencies": { - "@ljharb/eslint-config": "^12.2.1", - "browserify": "^16.2.0", - "covert": "^1.1.0", - "editorconfig-tools": "^0.1.1", - "eslint": "^4.19.1", - "evalmd": "^0.0.17", - "iconv-lite": "^0.4.21", - "mkdirp": "^0.5.1", - "qs-iconv": "^1.0.4", - "safe-publish-latest": "^1.1.1", - "safer-buffer": "^2.1.2", - "tape": "^4.9.0" - }, - "engines": { - "node": ">=0.6" - }, - "homepage": "https://github.com/ljharb/qs", - "keywords": [ - "querystring", - "qs" - ], - "license": "BSD-3-Clause", - "main": "lib/index.js", - "name": "qs", - "repository": { - "type": "git", - "url": "git+https://github.com/ljharb/qs.git" - }, - "scripts": { - "coverage": "covert test", - "dist": "mkdirp dist && browserify --standalone Qs lib/index.js > dist/qs.js", - "lint": "eslint lib/*.js test/*.js", - "prelint": "editorconfig-tools check * lib/* test/*", - "prepublish": "safe-publish-latest && npm run dist", - "pretest": "npm run --silent readme && npm run --silent lint", - "readme": "evalmd README.md", - "test": "npm run --silent coverage", - "tests-only": "node test" - }, - "version": "6.5.2" + "description": "A querystring parser that supports nesting and arrays, with a depth limit", + "homepage": "https://github.com/ljharb/qs", + "version": "6.5.2", + "repository": { + "type": "git", + "url": "https://github.com/ljharb/qs.git" + }, + "main": "lib/index.js", + "contributors": [ + { + "name": "Jordan Harband", + "email": "ljharb@gmail.com", + "url": "http://ljharb.codes" + } + ], + "keywords": [ + "querystring", + "qs" + ], + "engines": { + "node": ">=0.6" + }, + "dependencies": {}, + "devDependencies": { + "@ljharb/eslint-config": "^12.2.1", + "browserify": "^16.2.0", + "covert": "^1.1.0", + "editorconfig-tools": "^0.1.1", + "eslint": "^4.19.1", + "evalmd": "^0.0.17", + "iconv-lite": "^0.4.21", + "mkdirp": "^0.5.1", + "qs-iconv": "^1.0.4", + "safe-publish-latest": "^1.1.1", + "safer-buffer": "^2.1.2", + "tape": "^4.9.0" + }, + "scripts": { + "prepublish": "safe-publish-latest && npm run dist", + "pretest": "npm run --silent readme && npm run --silent lint", + "test": "npm run --silent coverage", + "tests-only": "node test", + "readme": "evalmd README.md", + "prelint": "editorconfig-tools check * lib/* test/*", + "lint": "eslint lib/*.js test/*.js", + "coverage": "covert test", + "dist": "mkdirp dist && browserify --standalone Qs lib/index.js > dist/qs.js" + }, + "license": "BSD-3-Clause" } diff --git a/deps/npm/node_modules/query-string/index.d.ts b/deps/npm/node_modules/query-string/index.d.ts deleted file mode 100644 index a5bd661c2991d7..00000000000000 --- a/deps/npm/node_modules/query-string/index.d.ts +++ /dev/null @@ -1,208 +0,0 @@ -export interface ParseOptions { - /** - Decode the keys and values. URI components are decoded with [`decode-uri-component`](https://github.com/SamVerschueren/decode-uri-component). - - @default true - */ - readonly decode?: boolean; - - /** - @default 'none' - - - `bracket`: Parse arrays with bracket representation: - - ``` - queryString.parse('foo[]=1&foo[]=2&foo[]=3', {arrayFormat: 'bracket'}); - //=> {foo: ['1', '2', '3']} - ``` - - - `index`: Parse arrays with index representation: - - ``` - queryString.parse('foo[0]=1&foo[1]=2&foo[3]=3', {arrayFormat: 'index'}); - //=> {foo: ['1', '2', '3']} - ``` - - - `comma`: Parse arrays with elements separated by comma: - - ``` - queryString.parse('foo=1,2,3', {arrayFormat: 'comma'}); - //=> {foo: ['1', '2', '3']} - ``` - - - `none`: Parse arrays with elements using duplicate keys: - - ``` - queryString.parse('foo=1&foo=2&foo=3'); - //=> {foo: ['1', '2', '3']} - ``` - */ - readonly arrayFormat?: 'bracket' | 'index' | 'comma' | 'none'; - - /** - Supports both `Function` as a custom sorting function or `false` to disable sorting. - - If omitted, keys are sorted using `Array#sort`, which means, converting them to strings and comparing strings in Unicode code point order. - - @default true - - @example - ``` - const order = ['c', 'a', 'b']; - - queryString.parse('?a=one&b=two&c=three', { - sort: (itemLeft, itemRight) => order.indexOf(itemLeft) - order.indexOf(itemRight) - }); - // => {c: 'three', a: 'one', b: 'two'} - ``` - - queryString.parse('?a=one&c=three&b=two', {sort: false}); - // => {a: 'one', c: 'three', b: 'two'} - ``` - */ - readonly sort?: ((itemLeft: string, itemRight: string) => number) | false; - - /** - Parse the value as a number type instead of string type if it's a number. - - @default false - - @example - ```js - queryString.parse('foo=1', {parseNumbers: true}); - //=> {foo: 1} - ``` - */ - readonly parseNumbers?: boolean; - - /** - Parse the value as a boolean type instead of string type if it's a boolean. - - @default false - - @example - ``` - queryString.parse('foo=true', {parseBooleans: true}); - //=> {foo: true} - ``` - */ - readonly parseBooleans?: boolean; -} - -export interface ParsedQuery { - [key: string]: T | T[] | null | undefined; -} - -/** -Parse a query string into an object. Leading `?` or `#` are ignored, so you can pass `location.search` or `location.hash` directly. - -The returned object is created with [`Object.create(null)`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/create) and thus does not have a `prototype`. - -@param query - The query string to parse. -*/ -export function parse(query: string, options: {parseBooleans: true, parseNumbers: true} & ParseOptions): ParsedQuery; -export function parse(query: string, options: {parseBooleans: true} & ParseOptions): ParsedQuery; -export function parse(query: string, options: {parseNumbers: true} & ParseOptions): ParsedQuery; -export function parse(query: string, options?: ParseOptions): ParsedQuery; - -export interface ParsedUrl { - readonly url: string; - readonly query: ParsedQuery; -} - -/** -Extract the URL and the query string as an object. - -@param url - The URL to parse. - -@example -``` -queryString.parseUrl('https://foo.bar?foo=bar'); -//=> {url: 'https://foo.bar', query: {foo: 'bar'}} -``` -*/ -export function parseUrl(url: string, options?: ParseOptions): ParsedUrl; - -export interface StringifyOptions { - /** - Strictly encode URI components with [`strict-uri-encode`](https://github.com/kevva/strict-uri-encode). It uses [`encodeURIComponent`](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/encodeURIComponent) if set to `false`. You probably [don't care](https://github.com/sindresorhus/query-string/issues/42) about this option. - - @default true - */ - readonly strict?: boolean; - - /** - [URL encode](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/encodeURIComponent) the keys and values. - - @default true - */ - readonly encode?: boolean; - - /** - @default 'none' - - - `bracket`: Serialize arrays using bracket representation: - - ``` - queryString.stringify({foo: [1, 2, 3]}, {arrayFormat: 'bracket'}); - //=> 'foo[]=1&foo[]=2&foo[]=3' - ``` - - - `index`: Serialize arrays using index representation: - - ``` - queryString.stringify({foo: [1, 2, 3]}, {arrayFormat: 'index'}); - //=> 'foo[0]=1&foo[1]=2&foo[2]=3' - ``` - - - `comma`: Serialize arrays by separating elements with comma: - - ``` - queryString.stringify({foo: [1, 2, 3]}, {arrayFormat: 'comma'}); - //=> 'foo=1,2,3' - ``` - - - `none`: Serialize arrays by using duplicate keys: - - ``` - queryString.stringify({foo: [1, 2, 3]}); - //=> 'foo=1&foo=2&foo=3' - ``` - */ - readonly arrayFormat?: 'bracket' | 'index' | 'comma' | 'none'; - - /** - Supports both `Function` as a custom sorting function or `false` to disable sorting. - - If omitted, keys are sorted using `Array#sort`, which means, converting them to strings and comparing strings in Unicode code point order. - - @default true - - @example - ``` - const order = ['c', 'a', 'b']; - - queryString.stringify({a: 1, b: 2, c: 3}, { - sort: (itemLeft, itemRight) => order.indexOf(itemLeft) - order.indexOf(itemRight) - }); - // => 'c=3&a=1&b=2' - - queryString.stringify({b: 1, c: 2, a: 3}, {sort: false}); - // => 'b=1&c=2&a=3' - ``` - */ - readonly sort?: ((itemLeft: string, itemRight: string) => number) | false; -} - -/** -Stringify an object into a query string and sort the keys. -*/ -export function stringify( - object: {[key: string]: any}, - options?: StringifyOptions -): string; - -/** -Extract a query string from a URL that can be passed into `.parse()`. -*/ -export function extract(url: string): string; diff --git a/deps/npm/node_modules/query-string/index.js b/deps/npm/node_modules/query-string/index.js deleted file mode 100644 index 35c13e1a665659..00000000000000 --- a/deps/npm/node_modules/query-string/index.js +++ /dev/null @@ -1,278 +0,0 @@ -'use strict'; -const strictUriEncode = require('strict-uri-encode'); -const decodeComponent = require('decode-uri-component'); -const splitOnFirst = require('split-on-first'); - -function encoderForArrayFormat(options) { - switch (options.arrayFormat) { - case 'index': - return key => (result, value) => { - const index = result.length; - if (value === undefined) { - return result; - } - - if (value === null) { - return [...result, [encode(key, options), '[', index, ']'].join('')]; - } - - return [ - ...result, - [encode(key, options), '[', encode(index, options), ']=', encode(value, options)].join('') - ]; - }; - - case 'bracket': - return key => (result, value) => { - if (value === undefined) { - return result; - } - - if (value === null) { - return [...result, [encode(key, options), '[]'].join('')]; - } - - return [...result, [encode(key, options), '[]=', encode(value, options)].join('')]; - }; - - case 'comma': - return key => (result, value, index) => { - if (value === null || value === undefined || value.length === 0) { - return result; - } - - if (index === 0) { - return [[encode(key, options), '=', encode(value, options)].join('')]; - } - - return [[result, encode(value, options)].join(',')]; - }; - - default: - return key => (result, value) => { - if (value === undefined) { - return result; - } - - if (value === null) { - return [...result, encode(key, options)]; - } - - return [...result, [encode(key, options), '=', encode(value, options)].join('')]; - }; - } -} - -function parserForArrayFormat(options) { - let result; - - switch (options.arrayFormat) { - case 'index': - return (key, value, accumulator) => { - result = /\[(\d*)\]$/.exec(key); - - key = key.replace(/\[\d*\]$/, ''); - - if (!result) { - accumulator[key] = value; - return; - } - - if (accumulator[key] === undefined) { - accumulator[key] = {}; - } - - accumulator[key][result[1]] = value; - }; - - case 'bracket': - return (key, value, accumulator) => { - result = /(\[\])$/.exec(key); - key = key.replace(/\[\]$/, ''); - - if (!result) { - accumulator[key] = value; - return; - } - - if (accumulator[key] === undefined) { - accumulator[key] = [value]; - return; - } - - accumulator[key] = [].concat(accumulator[key], value); - }; - - case 'comma': - return (key, value, accumulator) => { - const isArray = typeof value === 'string' && value.split('').indexOf(',') > -1; - const newValue = isArray ? value.split(',') : value; - accumulator[key] = newValue; - }; - - default: - return (key, value, accumulator) => { - if (accumulator[key] === undefined) { - accumulator[key] = value; - return; - } - - accumulator[key] = [].concat(accumulator[key], value); - }; - } -} - -function encode(value, options) { - if (options.encode) { - return options.strict ? strictUriEncode(value) : encodeURIComponent(value); - } - - return value; -} - -function decode(value, options) { - if (options.decode) { - return decodeComponent(value); - } - - return value; -} - -function keysSorter(input) { - if (Array.isArray(input)) { - return input.sort(); - } - - if (typeof input === 'object') { - return keysSorter(Object.keys(input)) - .sort((a, b) => Number(a) - Number(b)) - .map(key => input[key]); - } - - return input; -} - -function removeHash(input) { - const hashStart = input.indexOf('#'); - if (hashStart !== -1) { - input = input.slice(0, hashStart); - } - - return input; -} - -function extract(input) { - input = removeHash(input); - const queryStart = input.indexOf('?'); - if (queryStart === -1) { - return ''; - } - - return input.slice(queryStart + 1); -} - -function parse(input, options) { - options = Object.assign({ - decode: true, - sort: true, - arrayFormat: 'none', - parseNumbers: false, - parseBooleans: false - }, options); - - const formatter = parserForArrayFormat(options); - - // Create an object with no prototype - const ret = Object.create(null); - - if (typeof input !== 'string') { - return ret; - } - - input = input.trim().replace(/^[?#&]/, ''); - - if (!input) { - return ret; - } - - for (const param of input.split('&')) { - let [key, value] = splitOnFirst(param.replace(/\+/g, ' '), '='); - - // Missing `=` should be `null`: - // http://w3.org/TR/2012/WD-url-20120524/#collect-url-parameters - value = value === undefined ? null : decode(value, options); - - if (options.parseNumbers && !Number.isNaN(Number(value)) && (typeof value === 'string' && value.trim() !== '')) { - value = Number(value); - } else if (options.parseBooleans && value !== null && (value.toLowerCase() === 'true' || value.toLowerCase() === 'false')) { - value = value.toLowerCase() === 'true'; - } - - formatter(decode(key, options), value, ret); - } - - if (options.sort === false) { - return ret; - } - - return (options.sort === true ? Object.keys(ret).sort() : Object.keys(ret).sort(options.sort)).reduce((result, key) => { - const value = ret[key]; - if (Boolean(value) && typeof value === 'object' && !Array.isArray(value)) { - // Sort object keys, not values - result[key] = keysSorter(value); - } else { - result[key] = value; - } - - return result; - }, Object.create(null)); -} - -exports.extract = extract; -exports.parse = parse; - -exports.stringify = (object, options) => { - if (!object) { - return ''; - } - - options = Object.assign({ - encode: true, - strict: true, - arrayFormat: 'none' - }, options); - - const formatter = encoderForArrayFormat(options); - const keys = Object.keys(object); - - if (options.sort !== false) { - keys.sort(options.sort); - } - - return keys.map(key => { - const value = object[key]; - - if (value === undefined) { - return ''; - } - - if (value === null) { - return encode(key, options); - } - - if (Array.isArray(value)) { - return value - .reduce(formatter(key), []) - .join('&'); - } - - return encode(key, options) + '=' + encode(value, options); - }).filter(x => x.length > 0).join('&'); -}; - -exports.parseUrl = (input, options) => { - return { - url: removeHash(input).split('?')[0] || '', - query: parse(extract(input), options) - }; -}; diff --git a/deps/npm/node_modules/query-string/license b/deps/npm/node_modules/query-string/license deleted file mode 100644 index e7af2f77107d73..00000000000000 --- a/deps/npm/node_modules/query-string/license +++ /dev/null @@ -1,9 +0,0 @@ -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/deps/npm/node_modules/query-string/package.json b/deps/npm/node_modules/query-string/package.json deleted file mode 100644 index 4df6b20ef0e918..00000000000000 --- a/deps/npm/node_modules/query-string/package.json +++ /dev/null @@ -1,82 +0,0 @@ -{ - "_from": "query-string@6.8.2", - "_id": "query-string@6.8.2", - "_inBundle": false, - "_integrity": "sha512-J3Qi8XZJXh93t2FiKyd/7Ec6GNifsjKXUsVFkSBj/kjLsDylWhnCz4NT1bkPcKotttPW+QbKGqqPH8OoI2pdqw==", - "_location": "/query-string", - "_phantomChildren": {}, - "_requested": { - "type": "version", - "registry": true, - "raw": "query-string@6.8.2", - "name": "query-string", - "escapedName": "query-string", - "rawSpec": "6.8.2", - "saveSpec": null, - "fetchSpec": "6.8.2" - }, - "_requiredBy": [ - "#USER", - "/" - ], - "_resolved": "https://registry.npmjs.org/query-string/-/query-string-6.8.2.tgz", - "_shasum": "36cb7e452ae11a4b5e9efee83375e0954407b2f6", - "_spec": "query-string@6.8.2", - "_where": "/Users/isaacs/dev/npm/cli", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "bugs": { - "url": "https://github.com/sindresorhus/query-string/issues" - }, - "bundleDependencies": false, - "dependencies": { - "decode-uri-component": "^0.2.0", - "split-on-first": "^1.0.0", - "strict-uri-encode": "^2.0.0" - }, - "deprecated": false, - "description": "Parse and stringify URL query strings", - "devDependencies": { - "ava": "^1.4.1", - "deep-equal": "^1.0.1", - "fast-check": "^1.5.0", - "tsd": "^0.7.3", - "xo": "^0.24.0" - }, - "engines": { - "node": ">=6" - }, - "files": [ - "index.js", - "index.d.ts" - ], - "homepage": "https://github.com/sindresorhus/query-string#readme", - "keywords": [ - "browser", - "querystring", - "query", - "string", - "qs", - "param", - "parameter", - "url", - "parse", - "stringify", - "encode", - "decode", - "searchparams" - ], - "license": "MIT", - "name": "query-string", - "repository": { - "type": "git", - "url": "git+https://github.com/sindresorhus/query-string.git" - }, - "scripts": { - "test": "xo && ava && tsd" - }, - "version": "6.8.2" -} diff --git a/deps/npm/node_modules/query-string/readme.md b/deps/npm/node_modules/query-string/readme.md deleted file mode 100644 index 297a47d5a00e96..00000000000000 --- a/deps/npm/node_modules/query-string/readme.md +++ /dev/null @@ -1,278 +0,0 @@ -# query-string [![Build Status](https://travis-ci.org/sindresorhus/query-string.svg?branch=master)](https://travis-ci.org/sindresorhus/query-string) - -> Parse and stringify URL [query strings](https://en.wikipedia.org/wiki/Query_string) - - -## Install - -``` -$ npm install query-string -``` - -This module targets Node.js 6 or later and the latest version of Chrome, Firefox, and Safari. If you want support for older browsers, or, [if your project is using create-react-app v1](https://github.com/sindresorhus/query-string/pull/148#issuecomment-399656020), use version 5: `npm install query-string@5`. - - -## Usage - -```js -const queryString = require('query-string'); - -console.log(location.search); -//=> '?foo=bar' - -const parsed = queryString.parse(location.search); -console.log(parsed); -//=> {foo: 'bar'} - -console.log(location.hash); -//=> '#token=bada55cafe' - -const parsedHash = queryString.parse(location.hash); -console.log(parsedHash); -//=> {token: 'bada55cafe'} - -parsed.foo = 'unicorn'; -parsed.ilike = 'pizza'; - -const stringified = queryString.stringify(parsed); -//=> 'foo=unicorn&ilike=pizza' - -location.search = stringified; -// note that `location.search` automatically prepends a question mark -console.log(location.search); -//=> '?foo=unicorn&ilike=pizza' -``` - - -## API - -### .parse(string, options?) - -Parse a query string into an object. Leading `?` or `#` are ignored, so you can pass `location.search` or `location.hash` directly. - -The returned object is created with [`Object.create(null)`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/create) and thus does not have a `prototype`. - -#### options - -Type: `object` - -##### decode - -Type: `boolean`
    -Default: `true` - -Decode the keys and values. URL components are decoded with [`decode-uri-component`](https://github.com/SamVerschueren/decode-uri-component). - -##### arrayFormat - -Type: `string`
    -Default: `'none'` - -- `'bracket'`: Parse arrays with bracket representation: - -```js -queryString.parse('foo[]=1&foo[]=2&foo[]=3', {arrayFormat: 'bracket'}); -//=> {foo: ['1', '2', '3']} -``` - -- `'index'`: Parse arrays with index representation: - -```js -queryString.parse('foo[0]=1&foo[1]=2&foo[3]=3', {arrayFormat: 'index'}); -//=> {foo: ['1', '2', '3']} -``` - -- `'comma'`: Parse arrays with elements separated by comma: - -```js -queryString.parse('foo=1,2,3', {arrayFormat: 'comma'}); -//=> {foo: ['1', '2', '3']} -``` - -- `'none'`: Parse arrays with elements using duplicate keys: - -```js -queryString.parse('foo=1&foo=2&foo=3'); -//=> {foo: ['1', '2', '3']} -``` - -##### sort - -Type: `Function | boolean`
    -Default: `true` - -Supports both `Function` as a custom sorting function or `false` to disable sorting. - -##### parseNumbers - -Type: `boolean`
    -Default: `false` - -```js -queryString.parse('foo=1', {parseNumbers: true}); -//=> {foo: 1} -``` - -Parse the value as a number type instead of string type if it's a number. - -##### parseBooleans - -Type: `boolean`
    -Default: `false` - -```js -queryString.parse('foo=true', {parseBooleans: true}); -//=> {foo: true} -``` - -Parse the value as a boolean type instead of string type if it's a boolean. - -### .stringify(object, [options]) - -Stringify an object into a query string and sorting the keys. - -#### options - -Type: `object` - -##### strict - -Type: `boolean`
    -Default: `true` - -Strictly encode URI components with [strict-uri-encode](https://github.com/kevva/strict-uri-encode). It uses [encodeURIComponent](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/encodeURIComponent) if set to false. You probably [don't care](https://github.com/sindresorhus/query-string/issues/42) about this option. - -##### encode - -Type: `boolean`
    -Default: `true` - -[URL encode](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/encodeURIComponent) the keys and values. - -##### arrayFormat - -Type: `string`
    -Default: `'none'` - -- `'bracket'`: Serialize arrays using bracket representation: - -```js -queryString.stringify({foo: [1, 2, 3]}, {arrayFormat: 'bracket'}); -//=> 'foo[]=1&foo[]=2&foo[]=3' -``` - -- `'index'`: Serialize arrays using index representation: - -```js -queryString.stringify({foo: [1, 2, 3]}, {arrayFormat: 'index'}); -//=> 'foo[0]=1&foo[1]=2&foo[2]=3' -``` - -- `'comma'`: Serialize arrays by separating elements with comma: - -```js -queryString.stringify({foo: [1, 2, 3]}, {arrayFormat: 'comma'}); -//=> 'foo=1,2,3' -``` - -- `'none'`: Serialize arrays by using duplicate keys: - -```js -queryString.stringify({foo: [1, 2, 3]}); -//=> 'foo=1&foo=2&foo=3' -``` - -##### sort - -Type: `Function | boolean` - -Supports both `Function` as a custom sorting function or `false` to disable sorting. - -```js -const order = ['c', 'a', 'b']; - -queryString.stringify({a: 1, b: 2, c: 3}, { - sort: (a, b) => order.indexOf(a) - order.indexOf(b) -}); -//=> 'c=3&a=1&b=2' -``` - -```js -queryString.stringify({b: 1, c: 2, a: 3}, {sort: false}); -//=> 'b=1&c=2&a=3' -``` - -If omitted, keys are sorted using `Array#sort()`, which means, converting them to strings and comparing strings in Unicode code point order. - -### .extract(string) - -Extract a query string from a URL that can be passed into `.parse()`. - -### .parseUrl(string, options?) - -Extract the URL and the query string as an object. - -The `options` are the same as for `.parse()`. - -Returns an object with a `url` and `query` property. - -```js -queryString.parseUrl('https://foo.bar?foo=bar'); -//=> {url: 'https://foo.bar', query: {foo: 'bar'}} -``` - - -## Nesting - -This module intentionally doesn't support nesting as it's not spec'd and varies between implementations, which causes a lot of [edge cases](https://github.com/visionmedia/node-querystring/issues). - -You're much better off just converting the object to a JSON string: - -```js -queryString.stringify({ - foo: 'bar', - nested: JSON.stringify({ - unicorn: 'cake' - }) -}); -//=> 'foo=bar&nested=%7B%22unicorn%22%3A%22cake%22%7D' -``` - -However, there is support for multiple instances of the same key: - -```js -queryString.parse('likes=cake&name=bob&likes=icecream'); -//=> {likes: ['cake', 'icecream'], name: 'bob'} - -queryString.stringify({color: ['taupe', 'chartreuse'], id: '515'}); -//=> 'color=taupe&color=chartreuse&id=515' -``` - - -## Falsy values - -Sometimes you want to unset a key, or maybe just make it present without assigning a value to it. Here is how falsy values are stringified: - -```js -queryString.stringify({foo: false}); -//=> 'foo=false' - -queryString.stringify({foo: null}); -//=> 'foo' - -queryString.stringify({foo: undefined}); -//=> '' -``` - - ---- - -
    - - 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/deps/npm/node_modules/qw/LICENSE b/deps/npm/node_modules/qw/LICENSE deleted file mode 100644 index 51bcf57ee3d16a..00000000000000 --- a/deps/npm/node_modules/qw/LICENSE +++ /dev/null @@ -1,14 +0,0 @@ -Copyright (c) 2016, 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/qw/README.md b/deps/npm/node_modules/qw/README.md deleted file mode 100644 index e42fc66d52d3e4..00000000000000 --- a/deps/npm/node_modules/qw/README.md +++ /dev/null @@ -1,35 +0,0 @@ -# qw - -Quoted word literals! - -```js -const qw = require('qw') - -const myword = qw` this is - a long list - of words` -// equiv of: -const myword = [ 'this', 'is', 'a', 'long', 'list', 'of', 'words' ] -``` - -You can embed vars in the usual way: - -```js -const mywords = qw`product ${23 * 5} also ${'escaping a string'}` -// equiv of: -const mywords = [ 'product', 23 * 5, 'also', 'escaping a string' ] -``` - -You can also embed vars inside strings: - -```js -const mywords = qw`product=${23 * 5} also "${'escaping a string'}"` -// equiv of: -const mywords = [ 'product=' + (23 * 5), 'also', '"escaping a string"' ] -``` - -## DESCRIPTION - -This uses template strings to bring over this little common convenience from -Perl-land. - diff --git a/deps/npm/node_modules/qw/package.json b/deps/npm/node_modules/qw/package.json deleted file mode 100644 index dd53aac491397d..00000000000000 --- a/deps/npm/node_modules/qw/package.json +++ /dev/null @@ -1,62 +0,0 @@ -{ - "_args": [ - [ - "qw@1.0.1", - "/Users/rebecca/code/npm" - ] - ], - "_from": "qw@1.0.1", - "_id": "qw@1.0.1", - "_inBundle": false, - "_integrity": "sha1-77/cdA+a0FQwRCassYNBLMi5ltQ=", - "_location": "/qw", - "_phantomChildren": {}, - "_requested": { - "type": "version", - "registry": true, - "raw": "qw@1.0.1", - "name": "qw", - "escapedName": "qw", - "rawSpec": "1.0.1", - "saveSpec": null, - "fetchSpec": "1.0.1" - }, - "_requiredBy": [ - "/" - ], - "_resolved": "https://registry.npmjs.org/qw/-/qw-1.0.1.tgz", - "_spec": "1.0.1", - "_where": "/Users/rebecca/code/npm", - "author": { - "name": "Rebecca Turner", - "email": "me@re-becca.org", - "url": "http://re-becca.org/" - }, - "bugs": { - "url": "https://github.com/iarna/node-qw/issues" - }, - "dependencies": {}, - "description": "Quoted word literals!", - "devDependencies": { - "tap": "^8.0.0" - }, - "directories": { - "test": "test" - }, - "files": [ - "qw.js" - ], - "homepage": "https://github.com/iarna/node-qw#readme", - "keywords": [], - "license": "ISC", - "main": "qw.js", - "name": "qw", - "repository": { - "type": "git", - "url": "git+https://github.com/iarna/node-qw.git" - }, - "scripts": { - "test": "tap test" - }, - "version": "1.0.1" -} diff --git a/deps/npm/node_modules/qw/qw.js b/deps/npm/node_modules/qw/qw.js deleted file mode 100644 index 239e5a565ef94e..00000000000000 --- a/deps/npm/node_modules/qw/qw.js +++ /dev/null @@ -1,43 +0,0 @@ -'use strict' -module.exports = qw - -function appendLast (arr, str) { - var last = arr.length - 1 - if (last < 0) { - arr.push(str) - } else { - var lastValue = String(arr[last]) - return arr[last] = lastValue + String(str) - } -} - -function qw () { - const args = Object.assign([], arguments[0]) - const values = [].slice.call(arguments, 1) - const words = [] - let lastWordWasValue = false - while (args.length) { - const arg = args.shift() - const concatValue = arg.length === 0 || arg.slice(-1) !== ' ' - if (arg.trim() !== '') { - const theseWords = arg.replace(/^\s+|\s+$/g, '').replace(/\s+/g, ' ').split(/ /) - if (lastWordWasValue && arg[0] !== ' ') { - appendLast(words, theseWords.shift()) - } - words.push.apply(words, theseWords) - } - - if (values.length) { - const val = values.shift() - if (concatValue) { - appendLast(words, val) - } else { - words.push(val) - } - lastWordWasValue = true - } else { - lastWordWasValue = false - } - } - return words -} diff --git a/deps/npm/node_modules/rc/LICENSE.APACHE2 b/deps/npm/node_modules/rc/LICENSE.APACHE2 deleted file mode 100644 index 6366c04716fb9e..00000000000000 --- a/deps/npm/node_modules/rc/LICENSE.APACHE2 +++ /dev/null @@ -1,15 +0,0 @@ -Apache License, Version 2.0 - -Copyright (c) 2011 Dominic Tarr - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. diff --git a/deps/npm/node_modules/rc/LICENSE.BSD b/deps/npm/node_modules/rc/LICENSE.BSD deleted file mode 100644 index 96bb796aa5f2d2..00000000000000 --- a/deps/npm/node_modules/rc/LICENSE.BSD +++ /dev/null @@ -1,26 +0,0 @@ -Copyright (c) 2013, Dominic Tarr -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR -ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -The views and conclusions contained in the software and documentation are those -of the authors and should not be interpreted as representing official policies, -either expressed or implied, of the FreeBSD Project. diff --git a/deps/npm/node_modules/rc/LICENSE.MIT b/deps/npm/node_modules/rc/LICENSE.MIT deleted file mode 100644 index 6eafbd734a6e06..00000000000000 --- a/deps/npm/node_modules/rc/LICENSE.MIT +++ /dev/null @@ -1,24 +0,0 @@ -The MIT License - -Copyright (c) 2011 Dominic Tarr - -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/rc/README.md b/deps/npm/node_modules/rc/README.md deleted file mode 100644 index e6522e26788f14..00000000000000 --- a/deps/npm/node_modules/rc/README.md +++ /dev/null @@ -1,227 +0,0 @@ -# rc - -The non-configurable configuration loader for lazy people. - -## Usage - -The only option is to pass rc the name of your app, and your default configuration. - -```javascript -var conf = require('rc')(appname, { - //defaults go here. - port: 2468, - - //defaults which are objects will be merged, not replaced - views: { - engine: 'jade' - } -}); -``` - -`rc` will return your configuration options merged with the defaults you specify. -If you pass in a predefined defaults object, it will be mutated: - -```javascript -var conf = {}; -require('rc')(appname, conf); -``` - -If `rc` finds any config files for your app, the returned config object will have -a `configs` array containing their paths: - -```javascript -var appCfg = require('rc')(appname, conf); -appCfg.configs[0] // /etc/appnamerc -appCfg.configs[1] // /home/dominictarr/.config/appname -appCfg.config // same as appCfg.configs[appCfg.configs.length - 1] -``` - -## Standards - -Given your application name (`appname`), rc will look in all the obvious places for configuration. - - * command line arguments, parsed by minimist _(e.g. `--foo baz`, also nested: `--foo.bar=baz`)_ - * environment variables prefixed with `${appname}_` - * or use "\_\_" to indicate nested properties
    _(e.g. `appname_foo__bar__baz` => `foo.bar.baz`)_ - * if you passed an option `--config file` then from that file - * a local `.${appname}rc` or the first found looking in `./ ../ ../../ ../../../` etc. - * `$HOME/.${appname}rc` - * `$HOME/.${appname}/config` - * `$HOME/.config/${appname}` - * `$HOME/.config/${appname}/config` - * `/etc/${appname}rc` - * `/etc/${appname}/config` - * the defaults object you passed in. - -All configuration sources that were found will be flattened into one object, -so that sources **earlier** in this list override later ones. - - -## Configuration File Formats - -Configuration files (e.g. `.appnamerc`) may be in either [json](http://json.org/example) or [ini](http://en.wikipedia.org/wiki/INI_file) format. **No** file extension (`.json` or `.ini`) should be used. The example configurations below are equivalent: - - -#### Formatted as `ini` - -``` -; You can include comments in `ini` format if you want. - -dependsOn=0.10.0 - - -; `rc` has built-in support for ini sections, see? - -[commands] - www = ./commands/www - console = ./commands/repl - - -; You can even do nested sections - -[generators.options] - engine = ejs - -[generators.modules] - new = generate-new - engine = generate-backend - -``` - -#### Formatted as `json` - -```javascript -{ - // You can even comment your JSON, if you want - "dependsOn": "0.10.0", - "commands": { - "www": "./commands/www", - "console": "./commands/repl" - }, - "generators": { - "options": { - "engine": "ejs" - }, - "modules": { - "new": "generate-new", - "backend": "generate-backend" - } - } -} -``` - -Comments are stripped from JSON config via [strip-json-comments](https://github.com/sindresorhus/strip-json-comments). - -> Since ini, and env variables do not have a standard for types, your application needs be prepared for strings. - -To ensure that string representations of booleans and numbers are always converted into their proper types (especially useful if you intend to do strict `===` comparisons), consider using a module such as [parse-strings-in-object](https://github.com/anselanza/parse-strings-in-object) to wrap the config object returned from rc. - - -## Simple example demonstrating precedence -Assume you have an application like this (notice the hard-coded defaults passed to rc): -``` -const conf = require('rc')('myapp', { - port: 12345, - mode: 'test' -}); - -console.log(JSON.stringify(conf, null, 2)); -``` -You also have a file `config.json`, with these contents: -``` -{ - "port": 9000, - "foo": "from config json", - "something": "else" -} -``` -And a file `.myapprc` in the same folder, with these contents: -``` -{ - "port": "3001", - "foo": "bar" -} -``` -Here is the expected output from various commands: - -`node .` -``` -{ - "port": "3001", - "mode": "test", - "foo": "bar", - "_": [], - "configs": [ - "/Users/stephen/repos/conftest/.myapprc" - ], - "config": "/Users/stephen/repos/conftest/.myapprc" -} -``` -*Default `mode` from hard-coded object is retained, but port is overridden by `.myapprc` file (automatically found based on appname match), and `foo` is added.* - - -`node . --foo baz` -``` -{ - "port": "3001", - "mode": "test", - "foo": "baz", - "_": [], - "configs": [ - "/Users/stephen/repos/conftest/.myapprc" - ], - "config": "/Users/stephen/repos/conftest/.myapprc" -} -``` -*Same result as above but `foo` is overridden because command-line arguments take precedence over `.myapprc` file.* - -`node . --foo barbar --config config.json` -``` -{ - "port": 9000, - "mode": "test", - "foo": "barbar", - "something": "else", - "_": [], - "config": "config.json", - "configs": [ - "/Users/stephen/repos/conftest/.myapprc", - "config.json" - ] -} -``` -*Now the `port` comes from the `config.json` file specified (overriding the value from `.myapprc`), and `foo` value is overriden by command-line despite also being specified in the `config.json` file.* - - - -## Advanced Usage - -#### Pass in your own `argv` - -You may pass in your own `argv` as the third argument to `rc`. This is in case you want to [use your own command-line opts parser](https://github.com/dominictarr/rc/pull/12). - -```javascript -require('rc')(appname, defaults, customArgvParser); -``` - -## Pass in your own parser - -If you have a special need to use a non-standard parser, -you can do so by passing in the parser as the 4th argument. -(leave the 3rd as null to get the default args parser) - -```javascript -require('rc')(appname, defaults, null, parser); -``` - -This may also be used to force a more strict format, -such as strict, valid JSON only. - -## Note on Performance - -`rc` is running `fs.statSync`-- so make sure you don't use it in a hot code path (e.g. a request handler) - - -## License - -Multi-licensed under the two-clause BSD License, MIT License, or Apache License, version 2.0 diff --git a/deps/npm/node_modules/rc/browser.js b/deps/npm/node_modules/rc/browser.js deleted file mode 100644 index 8c230c5cd2d397..00000000000000 --- a/deps/npm/node_modules/rc/browser.js +++ /dev/null @@ -1,7 +0,0 @@ - -// when this is loaded into the browser, -// just use the defaults... - -module.exports = function (name, defaults) { - return defaults -} diff --git a/deps/npm/node_modules/rc/cli.js b/deps/npm/node_modules/rc/cli.js deleted file mode 100755 index ab05b6072b0170..00000000000000 --- a/deps/npm/node_modules/rc/cli.js +++ /dev/null @@ -1,4 +0,0 @@ -#! /usr/bin/env node -var rc = require('./index') - -console.log(JSON.stringify(rc(process.argv[2]), false, 2)) diff --git a/deps/npm/node_modules/rc/index.js b/deps/npm/node_modules/rc/index.js deleted file mode 100755 index 65eb47afe20f7b..00000000000000 --- a/deps/npm/node_modules/rc/index.js +++ /dev/null @@ -1,53 +0,0 @@ -var cc = require('./lib/utils') -var join = require('path').join -var deepExtend = require('deep-extend') -var etc = '/etc' -var win = process.platform === "win32" -var home = win - ? process.env.USERPROFILE - : process.env.HOME - -module.exports = function (name, defaults, argv, parse) { - if('string' !== typeof name) - throw new Error('rc(name): name *must* be string') - if(!argv) - argv = require('minimist')(process.argv.slice(2)) - defaults = ( - 'string' === typeof defaults - ? cc.json(defaults) : defaults - ) || {} - - parse = parse || cc.parse - - var env = cc.env(name + '_') - - var configs = [defaults] - var configFiles = [] - function addConfigFile (file) { - if (configFiles.indexOf(file) >= 0) return - var fileConfig = cc.file(file) - if (fileConfig) { - configs.push(parse(fileConfig)) - configFiles.push(file) - } - } - - // which files do we look at? - if (!win) - [join(etc, name, 'config'), - join(etc, name + 'rc')].forEach(addConfigFile) - if (home) - [join(home, '.config', name, 'config'), - join(home, '.config', name), - join(home, '.' + name, 'config'), - join(home, '.' + name + 'rc')].forEach(addConfigFile) - addConfigFile(cc.find('.'+name+'rc')) - if (env.config) addConfigFile(env.config) - if (argv.config) addConfigFile(argv.config) - - return deepExtend.apply(null, configs.concat([ - env, - argv, - configFiles.length ? {configs: configFiles, config: configFiles[configFiles.length - 1]} : undefined, - ])) -} diff --git a/deps/npm/node_modules/rc/lib/utils.js b/deps/npm/node_modules/rc/lib/utils.js deleted file mode 100644 index 8b3beffa3295b6..00000000000000 --- a/deps/npm/node_modules/rc/lib/utils.js +++ /dev/null @@ -1,104 +0,0 @@ -'use strict'; -var fs = require('fs') -var ini = require('ini') -var path = require('path') -var stripJsonComments = require('strip-json-comments') - -var parse = exports.parse = function (content) { - - //if it ends in .json or starts with { then it must be json. - //must be done this way, because ini accepts everything. - //can't just try and parse it and let it throw if it's not ini. - //everything is ini. even json with a syntax error. - - if(/^\s*{/.test(content)) - return JSON.parse(stripJsonComments(content)) - return ini.parse(content) - -} - -var file = exports.file = function () { - var args = [].slice.call(arguments).filter(function (arg) { return arg != null }) - - //path.join breaks if it's a not a string, so just skip this. - for(var i in args) - if('string' !== typeof args[i]) - return - - var file = path.join.apply(null, args) - var content - try { - return fs.readFileSync(file,'utf-8') - } catch (err) { - return - } -} - -var json = exports.json = function () { - var content = file.apply(null, arguments) - return content ? parse(content) : null -} - -var env = exports.env = function (prefix, env) { - env = env || process.env - var obj = {} - var l = prefix.length - for(var k in env) { - if(k.toLowerCase().indexOf(prefix.toLowerCase()) === 0) { - - var keypath = k.substring(l).split('__') - - // Trim empty strings from keypath array - var _emptyStringIndex - while ((_emptyStringIndex=keypath.indexOf('')) > -1) { - keypath.splice(_emptyStringIndex, 1) - } - - var cursor = obj - keypath.forEach(function _buildSubObj(_subkey,i){ - - // (check for _subkey first so we ignore empty strings) - // (check for cursor to avoid assignment to primitive objects) - if (!_subkey || typeof cursor !== 'object') - return - - // If this is the last key, just stuff the value in there - // Assigns actual value from env variable to final key - // (unless it's just an empty string- in that case use the last valid key) - if (i === keypath.length-1) - cursor[_subkey] = env[k] - - - // Build sub-object if nothing already exists at the keypath - if (cursor[_subkey] === undefined) - cursor[_subkey] = {} - - // Increment cursor used to track the object at the current depth - cursor = cursor[_subkey] - - }) - - } - - } - - return obj -} - -var find = exports.find = function () { - var rel = path.join.apply(null, [].slice.call(arguments)) - - function find(start, rel) { - var file = path.join(start, rel) - try { - fs.statSync(file) - return file - } catch (err) { - if(path.dirname(start) !== start) // root - return find(path.dirname(start), rel) - } - } - return find(process.cwd(), rel) -} - - diff --git a/deps/npm/node_modules/rc/package.json b/deps/npm/node_modules/rc/package.json deleted file mode 100644 index db6599e664b743..00000000000000 --- a/deps/npm/node_modules/rc/package.json +++ /dev/null @@ -1,65 +0,0 @@ -{ - "_from": "rc@^1.1.6", - "_id": "rc@1.2.8", - "_inBundle": false, - "_integrity": "sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==", - "_location": "/rc", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "rc@^1.1.6", - "name": "rc", - "escapedName": "rc", - "rawSpec": "^1.1.6", - "saveSpec": null, - "fetchSpec": "^1.1.6" - }, - "_requiredBy": [ - "/registry-auth-token", - "/registry-url" - ], - "_resolved": "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz", - "_shasum": "cd924bf5200a075b83c188cd6b9e211b7fc0d3ed", - "_spec": "rc@^1.1.6", - "_where": "/Users/ruyadorno/Documents/workspace/cli/node_modules/registry-auth-token", - "author": { - "name": "Dominic Tarr", - "email": "dominic.tarr@gmail.com", - "url": "dominictarr.com" - }, - "bin": { - "rc": "cli.js" - }, - "browser": "browser.js", - "bugs": { - "url": "https://github.com/dominictarr/rc/issues" - }, - "bundleDependencies": false, - "dependencies": { - "deep-extend": "^0.6.0", - "ini": "~1.3.0", - "minimist": "^1.2.0", - "strip-json-comments": "~2.0.1" - }, - "deprecated": false, - "description": "hardwired configuration loader", - "homepage": "https://github.com/dominictarr/rc#readme", - "keywords": [ - "config", - "rc", - "unix", - "defaults" - ], - "license": "(BSD-2-Clause OR MIT OR Apache-2.0)", - "main": "index.js", - "name": "rc", - "repository": { - "type": "git", - "url": "git+https://github.com/dominictarr/rc.git" - }, - "scripts": { - "test": "set -e; node test/test.js; node test/ini.js; node test/nested-env-vars.js" - }, - "version": "1.2.8" -} diff --git a/deps/npm/node_modules/rc/test/ini.js b/deps/npm/node_modules/rc/test/ini.js deleted file mode 100644 index e6857f8b382cf9..00000000000000 --- a/deps/npm/node_modules/rc/test/ini.js +++ /dev/null @@ -1,16 +0,0 @@ -var cc =require('../lib/utils') -var INI = require('ini') -var assert = require('assert') - -function test(obj) { - - var _json, _ini - var json = cc.parse (_json = JSON.stringify(obj)) - var ini = cc.parse (_ini = INI.stringify(obj)) - console.log(_ini, _json) - assert.deepEqual(json, ini) -} - - -test({hello: true}) - diff --git a/deps/npm/node_modules/rc/test/nested-env-vars.js b/deps/npm/node_modules/rc/test/nested-env-vars.js deleted file mode 100644 index 0ecd176344018e..00000000000000 --- a/deps/npm/node_modules/rc/test/nested-env-vars.js +++ /dev/null @@ -1,50 +0,0 @@ - -var seed = Math.random(); -var n = 'rc'+ seed; -var N = 'RC'+ seed; -var assert = require('assert') - - -// Basic usage -process.env[n+'_someOpt__a'] = 42 -process.env[n+'_someOpt__x__'] = 99 -process.env[n+'_someOpt__a__b'] = 186 -process.env[n+'_someOpt__a__b__c'] = 243 -process.env[n+'_someOpt__x__y'] = 1862 -process.env[n+'_someOpt__z'] = 186577 - -// Should ignore empty strings from orphaned '__' -process.env[n+'_someOpt__z__x__'] = 18629 -process.env[n+'_someOpt__w__w__'] = 18629 - -// Leading '__' should ignore everything up to 'z' -process.env[n+'___z__i__'] = 9999 - -// should ignore case for config name section. -process.env[N+'_test_upperCase'] = 187 - -function testPrefix(prefix) { - var config = require('../')(prefix, { - option: true - }) - - console.log('\n\n------ nested-env-vars ------\n',{prefix: prefix}, '\n', config); - - assert.equal(config.option, true) - assert.equal(config.someOpt.a, 42) - assert.equal(config.someOpt.x, 99) - // Should not override `a` once it's been set - assert.equal(config.someOpt.a/*.b*/, 42) - // Should not override `x` once it's been set - assert.equal(config.someOpt.x/*.y*/, 99) - assert.equal(config.someOpt.z, 186577) - // Should not override `z` once it's been set - assert.equal(config.someOpt.z/*.x*/, 186577) - assert.equal(config.someOpt.w.w, 18629) - assert.equal(config.z.i, 9999) - - assert.equal(config.test_upperCase, 187) -} - -testPrefix(n); -testPrefix(N); diff --git a/deps/npm/node_modules/rc/test/test.js b/deps/npm/node_modules/rc/test/test.js deleted file mode 100644 index 4f6335189b6f81..00000000000000 --- a/deps/npm/node_modules/rc/test/test.js +++ /dev/null @@ -1,59 +0,0 @@ - -var n = 'rc'+Math.random() -var assert = require('assert') - -process.env[n+'_envOption'] = 42 - -var config = require('../')(n, { - option: true -}) - -console.log(config) - -assert.equal(config.option, true) -assert.equal(config.envOption, 42) - -var customArgv = require('../')(n, { - option: true -}, { // nopt-like argv - option: false, - envOption: 24, - argv: { - remain: [], - cooked: ['--no-option', '--envOption', '24'], - original: ['--no-option', '--envOption=24'] - } -}) - -console.log(customArgv) - -assert.equal(customArgv.option, false) -assert.equal(customArgv.envOption, 24) - -var fs = require('fs') -var path = require('path') -var jsonrc = path.resolve('.' + n + 'rc'); - -fs.writeFileSync(jsonrc, [ - '{', - '// json overrides default', - '"option": false,', - '/* env overrides json */', - '"envOption": 24', - '}' -].join('\n')); - -var commentedJSON = require('../')(n, { - option: true -}) - -fs.unlinkSync(jsonrc); - -console.log(commentedJSON) - -assert.equal(commentedJSON.option, false) -assert.equal(commentedJSON.envOption, 42) - -assert.equal(commentedJSON.config, jsonrc) -assert.equal(commentedJSON.configs.length, 1) -assert.equal(commentedJSON.configs[0], jsonrc) diff --git a/deps/npm/node_modules/read-cmd-shim/README.md b/deps/npm/node_modules/read-cmd-shim/README.md index b139ea7ff638c4..457e36e35fca55 100644 --- a/deps/npm/node_modules/read-cmd-shim/README.md +++ b/deps/npm/node_modules/read-cmd-shim/README.md @@ -7,18 +7,18 @@ is pointing at. This acts as the equivalent of ### Usage ``` -var readCmdShim = require('read-cmd-shim') +const readCmdShim = require('read-cmd-shim') -readCmdShim('/path/to/shim.cmd', function (er, destination) { +readCmdShim('/path/to/shim.cmd').then(destination => { … }) -var destination = readCmdShim.sync('/path/to/shim.cmd') +const destination = readCmdShim.sync('/path/to/shim.cmd') ``` -### readCmdShim(path, callback) +### readCmdShim(path) -> Promise -Reads the `cmd-shim` located at `path` and calls back with the _relative_ +Reads the `cmd-shim` located at `path` and resolves with the _relative_ path that the shim points at. Consider this as roughly the equivalent of `fs.readlink`. @@ -31,7 +31,6 @@ return a special `ENOTASHIM` exception, when it can't find a cmd-shim in the file referenced by `path`. This should only happen if you pass in a non-command shim. - ### readCmdShim.sync(path) Same as above but synchronous. Errors are thrown. diff --git a/deps/npm/node_modules/read-cmd-shim/index.js b/deps/npm/node_modules/read-cmd-shim/index.js index 3af2512f6cb432..4ac050fc3846e0 100644 --- a/deps/npm/node_modules/read-cmd-shim/index.js +++ b/deps/npm/node_modules/read-cmd-shim/index.js @@ -1,7 +1,9 @@ -'use strict' -var fs = require('graceful-fs') +const fs = require('fs') +const {promisify} = require('util') +const {readFileSync} = fs +const readFile = promisify(fs.readFile) -function extractPath (path, cmdshimContents) { +const extractPath = (path, cmdshimContents) => { if (/[.]cmd$/.test(path)) { return extractPathFromCmd(cmdshimContents) } else if (/[.]ps1$/.test(path)) { @@ -11,51 +13,57 @@ function extractPath (path, cmdshimContents) { } } -function extractPathFromPowershell (cmdshimContents) { - var matches = cmdshimContents.match(/"[$]basedir[/]([^"]+?)"\s+[$]args/) +const extractPathFromPowershell = cmdshimContents => { + const matches = cmdshimContents.match(/"[$]basedir[/]([^"]+?)"\s+[$]args/) return matches && matches[1] } -function extractPathFromCmd (cmdshimContents) { - var matches = cmdshimContents.match(/"%(?:~dp0|dp0%)\\([^"]+?)"\s+%[*]/) +const extractPathFromCmd = cmdshimContents => { + const matches = cmdshimContents.match(/"%(?:~dp0|dp0%)\\([^"]+?)"\s+%[*]/) return matches && matches[1] } -function extractPathFromCygwin (cmdshimContents) { - var matches = cmdshimContents.match(/"[$]basedir[/]([^"]+?)"\s+"[$]@"/) +const extractPathFromCygwin = cmdshimContents => { + const matches = cmdshimContents.match(/"[$]basedir[/]([^"]+?)"\s+"[$]@"/) return matches && matches[1] } -function wrapError (thrown, newError) { +const wrapError = (thrown, newError) => { newError.message = thrown.message newError.code = thrown.code + newError.path = thrown.path return newError } -function notaShim (path, er) { +const notaShim = (path, er) => { if (!er) { er = new Error() Error.captureStackTrace(er, notaShim) } er.code = 'ENOTASHIM' - er.message = "Can't read shim path from '" + path + "', it doesn't appear to be a cmd-shim" + er.message = `Can't read shim path from '${path}', ` + + `it doesn't appear to be a cmd-shim` return er } -var readCmdShim = module.exports = function (path, cb) { - var er = new Error() +const readCmdShim = path => { + // create a new error to capture the stack trace from this point, + // instead of getting some opaque stack into node's internals + const er = new Error() Error.captureStackTrace(er, readCmdShim) - fs.readFile(path, function (readFileEr, contents) { - if (readFileEr) return cb(wrapError(readFileEr, er)) - var destination = extractPath(path, contents.toString()) - if (destination) return cb(null, destination) - return cb(notaShim(path, er)) - }) + return readFile(path).then(contents => { + const destination = extractPath(path, contents.toString()) + if (destination) return destination + return Promise.reject(notaShim(path, er)) + }, readFileEr => Promise.reject(wrapError(readFileEr, er))) } -module.exports.sync = function (path) { - var contents = fs.readFileSync(path) - var destination = extractPath(path, contents.toString()) +const readCmdShimSync = path => { + const contents = readFileSync(path) + const destination = extractPath(path, contents.toString()) if (!destination) throw notaShim(path) return destination } + +readCmdShim.sync = readCmdShimSync +module.exports = readCmdShim diff --git a/deps/npm/node_modules/read-cmd-shim/package.json b/deps/npm/node_modules/read-cmd-shim/package.json index 101651109d4ff5..2a76dc3b1632ed 100644 --- a/deps/npm/node_modules/read-cmd-shim/package.json +++ b/deps/npm/node_modules/read-cmd-shim/package.json @@ -1,63 +1,29 @@ { - "_from": "read-cmd-shim@1.0.5", - "_id": "read-cmd-shim@1.0.5", - "_inBundle": false, - "_integrity": "sha512-v5yCqQ/7okKoZZkBQUAfTsQ3sVJtXdNfbPnI5cceppoxEVLYA3k+VtV2omkeo8MS94JCy4fSiUwlRBAwCVRPUA==", - "_location": "/read-cmd-shim", - "_phantomChildren": {}, - "_requested": { - "type": "version", - "registry": true, - "raw": "read-cmd-shim@1.0.5", - "name": "read-cmd-shim", - "escapedName": "read-cmd-shim", - "rawSpec": "1.0.5", - "saveSpec": null, - "fetchSpec": "1.0.5" - }, - "_requiredBy": [ - "#USER", - "/", - "/gentle-fs" - ], - "_resolved": "https://registry.npmjs.org/read-cmd-shim/-/read-cmd-shim-1.0.5.tgz", - "_shasum": "87e43eba50098ba5a32d0ceb583ab8e43b961c16", - "_spec": "read-cmd-shim@1.0.5", - "_where": "/Users/ruyadorno/Documents/workspace/cli", - "author": { - "name": "Rebecca Turner", - "email": "me@re-becca.org", - "url": "http://re-becca.org/" - }, - "bugs": { - "url": "https://github.com/npm/read-cmd-shim/issues" - }, - "bundleDependencies": false, - "dependencies": { - "graceful-fs": "^4.1.2" - }, - "deprecated": false, + "name": "read-cmd-shim", + "version": "2.0.0", "description": "Figure out what a cmd-shim is pointing at. This acts as the equivalent of fs.readlink.", + "main": "index.js", "devDependencies": { - "cmd-shim": "^3.0.0", - "rimraf": "^2.4.3", - "standard": "^5.2.2", - "tap": "^12.7.0" + "cmd-shim": "^4.0.0", + "rimraf": "^3.0.0", + "tap": "^14.10.6" + }, + "scripts": { + "preversion": "npm t", + "postversion": "npm publish", + "prepublishOnly": "git push --follow-tags", + "test": "tap" + }, + "tap": { + "check-coverage": true }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/npm/read-cmd-shim#readme", - "license": "ISC", - "main": "index.js", - "name": "read-cmd-shim", "repository": { "type": "git", "url": "git+https://github.com/npm/read-cmd-shim.git" }, - "scripts": { - "pretest": "standard", - "test": "tap test/*.js --100" - }, - "version": "1.0.5" + "license": "ISC", + "homepage": "https://github.com/npm/read-cmd-shim#readme", + "files": [ + "index.js" + ] } diff --git a/deps/npm/node_modules/read-installed/.npmignore b/deps/npm/node_modules/read-installed/.npmignore deleted file mode 100644 index 8c23deeb34b05e..00000000000000 --- a/deps/npm/node_modules/read-installed/.npmignore +++ /dev/null @@ -1,13 +0,0 @@ -*.swp -.*.swp - -.DS_Store -*~ -.project -.settings -npm-debug.log -coverage.html -.idea -lib-cov - -node_modules diff --git a/deps/npm/node_modules/read-installed/.travis.yml b/deps/npm/node_modules/read-installed/.travis.yml deleted file mode 100644 index 848ffd1c5f5fd3..00000000000000 --- a/deps/npm/node_modules/read-installed/.travis.yml +++ /dev/null @@ -1,9 +0,0 @@ -language: node_js -before_install: - - '[ "${TRAVIS_NODE_VERSION}" != "0.8" ] || npm install -g npm@1.4.28' - - npm install -g npm@latest -node_js: - - '0.8' - - '0.10' - - '0.12' - - 'iojs' diff --git a/deps/npm/node_modules/read-installed/LICENSE b/deps/npm/node_modules/read-installed/LICENSE deleted file mode 100644 index dea3013d6710ee..00000000000000 --- a/deps/npm/node_modules/read-installed/LICENSE +++ /dev/null @@ -1,16 +0,0 @@ -The ISC License - -Copyright (c) Isaac Z. Schlueter - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted, provided that the above -copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND -FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. - diff --git a/deps/npm/node_modules/read-installed/README.md b/deps/npm/node_modules/read-installed/README.md deleted file mode 100644 index 312153b4fe9ef2..00000000000000 --- a/deps/npm/node_modules/read-installed/README.md +++ /dev/null @@ -1,27 +0,0 @@ -# read-installed - -Read all the installed packages in a folder, and return a tree -structure with all the data. - -npm uses this. - -## 2.0.0 - -Breaking changes in `2.0.0`: - -The second argument is now an `Object` that contains the following keys: - - * `depth` optional, defaults to Infinity - * `log` optional log Function - * `dev` optional, default false, set to true to include devDependencies - -## Usage - -```javascript -var readInstalled = require("read-installed") -// optional options -var options = { dev: false, log: fn, depth: 2 } -readInstalled(folder, options, function (er, data) { - ... -}) -``` diff --git a/deps/npm/node_modules/read-installed/package.json b/deps/npm/node_modules/read-installed/package.json deleted file mode 100644 index f84ec7566558b1..00000000000000 --- a/deps/npm/node_modules/read-installed/package.json +++ /dev/null @@ -1,68 +0,0 @@ -{ - "_args": [ - [ - "read-installed@4.0.3", - "/Users/rebecca/code/npm" - ] - ], - "_from": "read-installed@4.0.3", - "_id": "read-installed@4.0.3", - "_inBundle": false, - "_integrity": "sha1-/5uLZ/GH0eTCm5/rMfayI6zRkGc=", - "_location": "/read-installed", - "_phantomChildren": {}, - "_requested": { - "type": "version", - "registry": true, - "raw": "read-installed@4.0.3", - "name": "read-installed", - "escapedName": "read-installed", - "rawSpec": "4.0.3", - "saveSpec": null, - "fetchSpec": "4.0.3" - }, - "_requiredBy": [ - "/" - ], - "_resolved": "https://registry.npmjs.org/read-installed/-/read-installed-4.0.3.tgz", - "_spec": "4.0.3", - "_where": "/Users/rebecca/code/npm", - "author": { - "name": "Isaac Z. Schlueter", - "email": "i@izs.me", - "url": "http://blog.izs.me/" - }, - "bugs": { - "url": "https://github.com/isaacs/read-installed/issues" - }, - "dependencies": { - "debuglog": "^1.0.1", - "graceful-fs": "^4.1.2", - "read-package-json": "^2.0.0", - "readdir-scoped-modules": "^1.0.0", - "semver": "2 || 3 || 4 || 5", - "slide": "~1.1.3", - "util-extend": "^1.0.1" - }, - "description": "Read all the installed packages in a folder, and return a tree structure with all the data.", - "devDependencies": { - "mkdirp": "^0.5.0", - "rimraf": "^2.2.8", - "tap": "^1.2.0" - }, - "homepage": "https://github.com/isaacs/read-installed#readme", - "license": "ISC", - "main": "read-installed.js", - "name": "read-installed", - "optionalDependencies": { - "graceful-fs": "^4.1.2" - }, - "repository": { - "type": "git", - "url": "git://github.com/isaacs/read-installed.git" - }, - "scripts": { - "test": "tap ./test/*.js" - }, - "version": "4.0.3" -} diff --git a/deps/npm/node_modules/read-installed/read-installed.js b/deps/npm/node_modules/read-installed/read-installed.js deleted file mode 100644 index 19e77be91bbe91..00000000000000 --- a/deps/npm/node_modules/read-installed/read-installed.js +++ /dev/null @@ -1,407 +0,0 @@ - -// Walk through the file-system "database" of installed -// packages, and create a data object related to the -// installed versions of each package. - -/* -This will traverse through all node_modules folders, -resolving the dependencies object to the object corresponding to -the package that meets that dep, or just the version/range if -unmet. - -Assuming that you had this folder structure: - -/path/to -+-- package.json { name = "root" } -`-- node_modules - +-- foo {bar, baz, asdf} - | +-- node_modules - | +-- bar { baz } - | `-- baz - `-- asdf - -where "foo" depends on bar, baz, and asdf, bar depends on baz, -and bar and baz are bundled with foo, whereas "asdf" is at -the higher level (sibling to foo), you'd get this object structure: - -{ -, path: "/path/to" -, parent: null -, dependencies: - { foo : - { version: "1.2.3" - , path: "/path/to/node_modules/foo" - , parent: - , dependencies: - { bar: - { parent: - , path: "/path/to/node_modules/foo/node_modules/bar" - , version: "2.3.4" - , dependencies: { baz: } - } - , baz: { ... } - , asdf: - } - } - , asdf: { ... } - } -} - -Unmet deps are left as strings. -Extraneous deps are marked with extraneous:true -deps that don't meet a requirement are marked with invalid:true -deps that don't meet a peer requirement are marked with peerInvalid:true - -to READ(packagefolder, parentobj, name, reqver) -obj = read package.json -installed = ./node_modules/* -if parentobj is null, and no package.json - obj = {dependencies:{:ANY}} -deps = Object.keys(obj.dependencies) -obj.path = packagefolder -obj.parent = parentobj -if name, && obj.name !== name, obj.invalid = true -if reqver, && obj.version !satisfies reqver, obj.invalid = true -if !reqver && parentobj, obj.extraneous = true -for each folder in installed - obj.dependencies[folder] = READ(packagefolder+node_modules+folder, - obj, folder, obj.dependencies[folder]) -# walk tree to find unmet deps -for each dep in obj.dependencies not in installed - r = obj.parent - while r - if r.dependencies[dep] - if r.dependencies[dep].verion !satisfies obj.dependencies[dep] - WARN - r.dependencies[dep].invalid = true - obj.dependencies[dep] = r.dependencies[dep] - r = null - else r = r.parent -return obj - - -TODO: -1. Find unmet deps in parent directories, searching as node does up -as far as the left-most node_modules folder. -2. Ignore anything in node_modules that isn't a package folder. - -*/ - -try { - var fs = require("graceful-fs") -} catch (er) { - var fs = require("fs") -} - -var path = require("path") -var asyncMap = require("slide").asyncMap -var semver = require("semver") -var readJson = require("read-package-json") -var url = require("url") -var util = require("util") -var extend = require("util-extend") - -var debug = require("debuglog")("read-installed") - -var readdir = require("readdir-scoped-modules") - -// Sentinel catch-all version constraint used when a dependency is not -// listed in the package.json file. -var ANY = {} - -module.exports = readInstalled - -function readInstalled (folder, opts, cb) { - if (typeof opts === 'function') { - cb = opts - opts = {} - } else { - opts = extend({}, opts) - } - - if (typeof opts.depth !== 'number') - opts.depth = Infinity - - opts.depth = Math.max(0, opts.depth) - - if (typeof opts.log !== 'function') - opts.log = function () {} - - opts.dev = !!opts.dev - opts.realpathSeen = {} - opts.findUnmetSeen = [] - - - readInstalled_(folder, null, null, null, 0, opts, function (er, obj) { - if (er) return cb(er) - // now obj has all the installed things, where they're installed - // figure out the inheritance links, now that the object is built. - resolveInheritance(obj, opts) - obj.root = true - unmarkExtraneous(obj, opts) - cb(null, obj) - }) -} - -function readInstalled_ (folder, parent, name, reqver, depth, opts, cb) { - var installed - , obj - , real - , link - , realpathSeen = opts.realpathSeen - - readdir(path.resolve(folder, "node_modules"), function (er, i) { - // error indicates that nothing is installed here - if (er) i = [] - installed = i.filter(function (f) { return f.charAt(0) !== "." }) - next() - }) - - readJson(path.resolve(folder, "package.json"), function (er, data) { - obj = copy(data) - - if (!parent) { - obj = obj || true - er = null - } - return next(er) - }) - - fs.lstat(folder, function (er, st) { - if (er) { - if (!parent) real = true - return next(er) - } - fs.realpath(folder, function (er, rp) { - debug("realpath(%j) = %j", folder, rp) - real = rp - if (st.isSymbolicLink()) link = rp - next(er) - }) - }) - - var errState = null - , called = false - function next (er) { - if (errState) return - if (er) { - errState = er - return cb(null, []) - } - debug('next', installed, obj && typeof obj, name, real) - if (!installed || !obj || !real || called) return - called = true - if (realpathSeen[real]) return cb(null, realpathSeen[real]) - if (obj === true) { - obj = {dependencies:{}, path:folder} - installed.forEach(function (i) { obj.dependencies[i] = ANY }) - } - if (name && obj.name !== name) obj.invalid = true - obj.realName = name || obj.name - obj.dependencies = obj.dependencies || {} - - // At this point, figure out what dependencies we NEED to get met - obj._dependencies = copy(obj.dependencies) - - if (reqver === ANY) { - // We were unable to determine the required version of this - // dependency from the package.json file, but we now know its actual - // version, so treat that version as the required version to avoid - // marking the dependency as invalid below. See #40. - reqver = obj.version; - } - - // "foo":"http://blah" and "foo":"latest" are always presumed valid - if (reqver - && semver.validRange(reqver, true) - && !semver.satisfies(obj.version, reqver, true)) { - obj.invalid = true - } - - // Mark as extraneous at this point. - // This will be un-marked in unmarkExtraneous, where we mark as - // not-extraneous everything that is required in some way from - // the root object. - obj.extraneous = true - - obj.path = obj.path || folder - obj.realPath = real - obj.link = link - if (parent && !obj.link) obj.parent = parent - realpathSeen[real] = obj - obj.depth = depth - //if (depth >= opts.depth) return cb(null, obj) - asyncMap(installed, function (pkg, cb) { - var rv = obj.dependencies[pkg] - if (!rv && obj.devDependencies && opts.dev) - rv = obj.devDependencies[pkg] - - if (depth > opts.depth) { - obj.dependencies = {} - return cb(null, obj) - } - - readInstalled_( path.resolve(folder, "node_modules/"+pkg) - , obj, pkg, obj.dependencies[pkg], depth + 1, opts - , cb ) - - }, function (er, installedData) { - if (er) return cb(er) - installedData.forEach(function (dep) { - obj.dependencies[dep.realName] = dep - }) - - // any strings here are unmet things. however, if it's - // optional, then that's fine, so just delete it. - if (obj.optionalDependencies) { - Object.keys(obj.optionalDependencies).forEach(function (dep) { - if (typeof obj.dependencies[dep] === "string") { - delete obj.dependencies[dep] - } - }) - } - return cb(null, obj) - }) - } -} - -// starting from a root object, call findUnmet on each layer of children -var riSeen = [] -function resolveInheritance (obj, opts) { - if (typeof obj !== "object") return - if (riSeen.indexOf(obj) !== -1) return - riSeen.push(obj) - if (typeof obj.dependencies !== "object") { - obj.dependencies = {} - } - Object.keys(obj.dependencies).forEach(function (dep) { - findUnmet(obj.dependencies[dep], opts) - }) - Object.keys(obj.dependencies).forEach(function (dep) { - if (typeof obj.dependencies[dep] === "object") { - resolveInheritance(obj.dependencies[dep], opts) - } else { - debug("unmet dep! %s %s@%s", obj.name, dep, obj.dependencies[dep]) - } - }) - findUnmet(obj, opts) -} - -// find unmet deps by walking up the tree object. -// No I/O -function findUnmet (obj, opts) { - var findUnmetSeen = opts.findUnmetSeen - if (findUnmetSeen.indexOf(obj) !== -1) return - findUnmetSeen.push(obj) - debug("find unmet parent=%s obj=", obj.parent && obj.parent.name, obj.name || obj) - var deps = obj.dependencies = obj.dependencies || {} - - debug(deps) - Object.keys(deps) - .filter(function (d) { return typeof deps[d] === "string" }) - .forEach(function (d) { - var found = findDep(obj, d) - debug("finding dep %j", d, found && found.name || found) - // "foo":"http://blah" and "foo":"latest" are always presumed valid - if (typeof deps[d] === "string" && - semver.validRange(deps[d], true) && - found && - !semver.satisfies(found.version, deps[d], true)) { - // the bad thing will happen - opts.log( "unmet dependency" - , obj.path + " requires "+d+"@'"+deps[d] - + "' but will load\n" - + found.path+",\nwhich is version "+found.version ) - found.invalid = true - } - if (found) { - deps[d] = found - } - }) - - var peerDeps = obj.peerDependencies = obj.peerDependencies || {} - Object.keys(peerDeps).forEach(function (d) { - var dependency - - if (!obj.parent) { - dependency = obj.dependencies[d] - - // read it as a missing dep - if (!dependency) { - obj.dependencies[d] = peerDeps[d] - } - } else { - var r = obj.parent - while (r && !dependency) { - dependency = r.dependencies && r.dependencies[d] - r = r.link ? null : r.parent - } - } - - if (!dependency) { - // mark as a missing dep! - obj.dependencies[d] = peerDeps[d] - } else if (!semver.satisfies(dependency.version, peerDeps[d], true)) { - dependency.peerInvalid = true - } - }) - - return obj -} - -function unmarkExtraneous (obj, opts) { - // Mark all non-required deps as extraneous. - // start from the root object and mark as non-extraneous all modules - // that haven't been previously flagged as extraneous then propagate - // to all their dependencies - - obj.extraneous = false - - var deps = obj._dependencies || [] - if (opts.dev && obj.devDependencies && (obj.root || obj.link)) { - Object.keys(obj.devDependencies).forEach(function (k) { - deps[k] = obj.devDependencies[k] - }) - } - - if (obj.peerDependencies) { - Object.keys(obj.peerDependencies).forEach(function (k) { - deps[k] = obj.peerDependencies[k] - }) - } - - debug("not extraneous", obj._id, deps) - Object.keys(deps).forEach(function (d) { - var dep = findDep(obj, d) - if (dep && dep.extraneous) { - unmarkExtraneous(dep, opts) - } - }) -} - -// Find the one that will actually be loaded by require() -// so we can make sure it's valid etc. -function findDep (obj, d) { - var r = obj - , found = null - while (r && !found) { - // if r is a valid choice, then use that. - // kinda weird if a pkg depends on itself, but after the first - // iteration of this loop, it indicates a dep cycle. - if (typeof r.dependencies[d] === "object") { - found = r.dependencies[d] - } - if (!found && r.realName === d) found = r - r = r.link ? null : r.parent - } - return found -} - -function copy (obj) { - if (!obj || typeof obj !== 'object') return obj - if (Array.isArray(obj)) return obj.map(copy) - - var o = {} - for (var i in obj) o[i] = copy(obj[i]) - return o -} diff --git a/deps/npm/node_modules/read-installed/test/basic.js b/deps/npm/node_modules/read-installed/test/basic.js deleted file mode 100644 index f497848879d768..00000000000000 --- a/deps/npm/node_modules/read-installed/test/basic.js +++ /dev/null @@ -1,46 +0,0 @@ -var readInstalled = require("../read-installed.js") -var json = require("../package.json") -var d = Object.keys(json.dependencies) -var dd = Object.keys(json.devDependencies) -var od = Object.keys(json.optionalDependencies) -var known = d.concat(dd).concat(od).sort() -var test = require("tap").test -var path = require("path") - -test("make sure that it works", function (t) { - readInstalled(path.join(__dirname, "../"), { - dev: true, - log: console.error - }, function (er, map) { - t.notOk(er, "er should be bull") - t.ok(map, "map should be data") - if (er) return console.error(er.stack || er.message) - cleanup(map) - var deps = Object.keys(map.dependencies).sort() - t.equal(known.length, deps.length, "array lengths are equal") - t.deepEqual(known, deps, "arrays should be equal") - t.notOk(map.dependencies.tap.extraneous, 'extraneous not set on devDep') - t.end() - }) -}) - -var seen = [] -function cleanup (map) { - if (seen.indexOf(map) !== -1) return - seen.push(map) - for (var i in map) switch (i) { - case "_id": - case "path": - case "extraneous": case "invalid": - case "dependencies": case "name": - continue - default: delete map[i] - } - var dep = map.dependencies - if (dep) { - for (var i in dep) if (typeof dep[i] === "object") { - cleanup(dep[i]) - } - } - return map -} diff --git a/deps/npm/node_modules/read-installed/test/cyclic-extraneous-peer-deps.js b/deps/npm/node_modules/read-installed/test/cyclic-extraneous-peer-deps.js deleted file mode 100644 index 58bf6a649a09f3..00000000000000 --- a/deps/npm/node_modules/read-installed/test/cyclic-extraneous-peer-deps.js +++ /dev/null @@ -1,81 +0,0 @@ -var test = require("tap").test -var mkdirp = require("mkdirp") -var rimraf = require("rimraf") -var fs = require("fs") -var path = require("path") -var readInstalled = require("../read-installed.js") - -var parent = { - name: "parent", - version: "1.2.3", - dependencies: {}, - devDependencies: { - "child1":"*" - }, - readme:"." -} - -var child1 = { - name: "child1", - version: "1.2.3", - peerDependencies: { - child2: "*" - }, - readme:"." -} - -var child2 = { - name: "child2", - version: "1.2.3", - peerDependencies: { - child1: "*" - }, - readme:"." -} - - -var root = path.resolve(__dirname, "cyclic-extraneous-peer-deps") -var parentjson = path.resolve(root, "package.json") -var child1root = path.resolve(root, "node_modules/child1") -var child1json = path.resolve(child1root, "package.json") -var child2root = path.resolve(root, "node_modules/child2") -var child2json = path.resolve(child2root, "package.json") - -test("setup", function (t) { - rimraf.sync(root) - mkdirp.sync(child1root) - mkdirp.sync(child2root) - fs.writeFileSync(parentjson, JSON.stringify(parent, null, 2) + "\n", "utf8") - fs.writeFileSync(child1json, JSON.stringify(child1, null, 2) + "\n", "utf8") - fs.writeFileSync(child2json, JSON.stringify(child2, null, 2) + "\n", "utf8") - t.pass("setup done") - t.end() -}) - -test("dev mode", function (t) { - // peer dev deps should both be not extraneous. - readInstalled(root, { dev: true }, function (er, data) { - if (er) - throw er - t.notOk(data.dependencies.child1.extraneous, "c1 not extra") - t.notOk(data.dependencies.child2.extraneous, "c2 not extra") - t.end() - }) -}) - -test("prod mode", function (t) { - readInstalled(root, { dev: false }, function (er, data) { - if (er) - throw er - t.ok(data.dependencies.child1.extraneous, "c1 extra") - t.ok(data.dependencies.child2.extraneous, "c2 extra") - t.end() - }) -}) - - -test("cleanup", function (t) { - rimraf.sync(root) - t.pass("cleanup done") - t.end() -}) diff --git a/deps/npm/node_modules/read-installed/test/depth-0.js b/deps/npm/node_modules/read-installed/test/depth-0.js deleted file mode 100644 index 459df8a729e412..00000000000000 --- a/deps/npm/node_modules/read-installed/test/depth-0.js +++ /dev/null @@ -1,27 +0,0 @@ -var readInstalled = require("../read-installed.js") -var test = require("tap").test -var json = require("../package.json") -var path = require("path") -var known = [].concat(Object.keys(json.dependencies) - , Object.keys(json.optionalDependencies) - , Object.keys(json.devDependencies)).sort() - -test("make sure that it works with depth=0", function (t) { - readInstalled(path.join(__dirname, "../"), { - depth: 0 - }, function (er, map) { - t.notOk(er, "er should be bull") - t.ok(map, "map should be data") - if (er) return console.error(er.stack || er.message) - // Exclude self from dependencies when depth = 0 - delete map.dependencies[json.name] - var subdeps = Object.keys(map.dependencies).reduce(function(acc, dep) { - // Exclude self from dependencies when depth = current depth - delete map.dependencies[dep].dependencies[dep] - acc += Object.keys(map.dependencies[dep].dependencies).length; - return acc; - }, 0); - t.equal(subdeps, 0, "there should be no sub dependencies") - t.end() - }) -}) diff --git a/deps/npm/node_modules/read-installed/test/depth-1.js b/deps/npm/node_modules/read-installed/test/depth-1.js deleted file mode 100644 index 977c9276f4beff..00000000000000 --- a/deps/npm/node_modules/read-installed/test/depth-1.js +++ /dev/null @@ -1,23 +0,0 @@ -var readInstalled = require("../read-installed.js") -var test = require("tap").test -var json = require("../package.json") -var path = require("path") -var known = [].concat(Object.keys(json.dependencies) - , Object.keys(json.optionalDependencies) - , Object.keys(json.devDependencies)).sort() - -test("make sure that it works with depth=1", function (t) { - readInstalled(path.join(__dirname, "../"), { - depth: 1 - }, function (er, map) { - t.notOk(er, "er should be bull") - t.ok(map, "map should be data") - if (er) return console.error(er.stack || er.message) - var subdeps = Object.keys(map.dependencies).reduce(function(acc, dep) { - acc += Object.keys(map.dependencies[dep].dependencies).length; - return acc; - }, 0); - t.notEqual(subdeps, 0, "there should some sub dependencies") - t.end() - }) -}) diff --git a/deps/npm/node_modules/read-installed/test/dev.js b/deps/npm/node_modules/read-installed/test/dev.js deleted file mode 100644 index 5e5a994a88d4eb..00000000000000 --- a/deps/npm/node_modules/read-installed/test/dev.js +++ /dev/null @@ -1,23 +0,0 @@ -var readInstalled = require("../read-installed.js") -var test = require("tap").test -var json = require("../package.json") -var path = require("path") -var known = [].concat(Object.keys(json.dependencies) - , Object.keys(json.optionalDependencies) - , Object.keys(json.devDependencies)).sort() - -test("make sure that it works without dev deps", function (t) { - readInstalled(path.join(__dirname, "../"), { - log: console.error, - dev: false - }, function (er, map) { - t.notOk(er, "er should be bull") - t.ok(map, "map should be data") - if (er) return console.error(er.stack || er.message) - var deps = Object.keys(map.dependencies).sort() - t.equal(deps.length, known.length, "array lengths are equal") - t.deepEqual(deps, known, "arrays should be equal") - t.ok(map.dependencies.tap.extraneous, "extraneous is set on devDep") - t.end() - }) -}) diff --git a/deps/npm/node_modules/read-installed/test/empty.js b/deps/npm/node_modules/read-installed/test/empty.js deleted file mode 100644 index 09ace074f5cb21..00000000000000 --- a/deps/npm/node_modules/read-installed/test/empty.js +++ /dev/null @@ -1,16 +0,0 @@ -var readInstalled = require("../read-installed.js"); -var test = require("tap").test; -var path = require("path"); - -test("Handle bad path", function (t) { - readInstalled(path.join(__dirname, "../unknown"), { - dev: true, - log: console.error - }, function (er, map) { - t.notOk(er, "er should be null"); - t.ok(map, "map should be data"); - t.equal(Object.keys(map.dependencies).length, 0, "Dependencies should have no keys"); - if (er) return console.error(er.stack || er.message); - t.end(); - }); -}); diff --git a/deps/npm/node_modules/read-installed/test/extraneous-dev.js b/deps/npm/node_modules/read-installed/test/extraneous-dev.js deleted file mode 100644 index 2f9012d548b8e0..00000000000000 --- a/deps/npm/node_modules/read-installed/test/extraneous-dev.js +++ /dev/null @@ -1,20 +0,0 @@ -var readInstalled = require("../read-installed.js") -var test = require("tap").test -var path = require("path") - -test("extraneous detected", function(t) { - // This test verifies read-installed#16 - readInstalled( - path.join(__dirname, "fixtures/extraneous-dev-dep"), - { - log: console.error, - dev: true - }, - function (err, map) { - t.ifError(err, "read-installed made it") - - t.notOk(map.dependencies.d.extraneous, "d is not extraneous, it's required by root") - t.ok(map.dependencies.x.extraneous, "x is extraneous, it's only a dev dep of d") - t.end() - }) -}) diff --git a/deps/npm/node_modules/read-installed/test/extraneous.js b/deps/npm/node_modules/read-installed/test/extraneous.js deleted file mode 100644 index e999c9b4fc3ec3..00000000000000 --- a/deps/npm/node_modules/read-installed/test/extraneous.js +++ /dev/null @@ -1,17 +0,0 @@ -var readInstalled = require('../read-installed.js') -var test = require('tap').test -var path = require('path') - -test('extraneous detected', function(t) { - // This test verifies read-installed#16 - readInstalled( - path.join(__dirname, 'fixtures/extraneous-detected'), - { log: console.error }, - function(err, map) { - t.ok(map.dependencies.foo.extraneous, 'foo is extraneous, it\'s not required by any module') - t.ok(map.dependencies.bar.extraneous, 'bar is extraneous, it\'s not required by any module') - t.notOk(map.dependencies.asdf.extraneous, 'asdf is not extraneous, it\'s required by ghjk') - t.notOk(map.dependencies.ghjk.extraneous, 'ghjk is not extraneous, it\'s required by our root module') - t.end() - }) -}) diff --git a/deps/npm/node_modules/read-installed/test/fixtures/extraneous-detected/package.json b/deps/npm/node_modules/read-installed/test/fixtures/extraneous-detected/package.json deleted file mode 100644 index f61531551cfad5..00000000000000 --- a/deps/npm/node_modules/read-installed/test/fixtures/extraneous-detected/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": "extraneous-detected", - "version": "0.0.0", - "dependencies": { - "ghjk": "0.0.0" - } -} diff --git a/deps/npm/node_modules/read-installed/test/fixtures/extraneous-dev-dep/package.json b/deps/npm/node_modules/read-installed/test/fixtures/extraneous-dev-dep/package.json deleted file mode 100644 index 9bfa7ce8f589b1..00000000000000 --- a/deps/npm/node_modules/read-installed/test/fixtures/extraneous-dev-dep/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": "extraneous-dev-dep", - "version": "0.0.0", - "dependencies": { - "d": "1.0.0" - } -} diff --git a/deps/npm/node_modules/read-installed/test/fixtures/grandparent-peer-dev/package.json b/deps/npm/node_modules/read-installed/test/fixtures/grandparent-peer-dev/package.json deleted file mode 100644 index 1a229c1cff01e1..00000000000000 --- a/deps/npm/node_modules/read-installed/test/fixtures/grandparent-peer-dev/package.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "name": "example", - "version": "0.0.0", - "devDependencies": { - "plugin-wrapper": "0.0.0", - "framework": "0.0.0" - } -} diff --git a/deps/npm/node_modules/read-installed/test/fixtures/grandparent-peer/package.json b/deps/npm/node_modules/read-installed/test/fixtures/grandparent-peer/package.json deleted file mode 100644 index 51c12935f08a9b..00000000000000 --- a/deps/npm/node_modules/read-installed/test/fixtures/grandparent-peer/package.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "name": "example", - "version": "0.0.0", - "dependencies": { - "plugin-wrapper": "0.0.0", - "framework": "0.0.0" - } -} diff --git a/deps/npm/node_modules/read-installed/test/fixtures/package.json b/deps/npm/node_modules/read-installed/test/fixtures/package.json deleted file mode 100644 index 8f4f11916b71ee..00000000000000 --- a/deps/npm/node_modules/read-installed/test/fixtures/package.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "name": "read-installed", - "description": "Read all the installed packages in a folder, and return a tree structure with all the data.", - "version": "1.0.0", - "repository": { - "type": "git", - "url": "git://github.com/isaacs/read-installed" - }, - "main": "read-installed.js", - "scripts": { - "test": "tap ./test/" - }, - "dependencies": { - "semver": "2", - "slide": "~1.1.3", - "read-package-json": "1", - "util-extend":"1" - }, - "optionalDependencies": { - "graceful-fs": "~2" - }, - "author": "Isaac Z. Schlueter (http://blog.izs.me/)", - "license": "ISC", - "devDependencies": { - "tap": "~0.4.8" - } -} diff --git a/deps/npm/node_modules/read-installed/test/grandparent-peer-dev.js b/deps/npm/node_modules/read-installed/test/grandparent-peer-dev.js deleted file mode 100644 index fd7c2d2bc9cbd2..00000000000000 --- a/deps/npm/node_modules/read-installed/test/grandparent-peer-dev.js +++ /dev/null @@ -1,20 +0,0 @@ -var readInstalled = require('../read-installed.js') -var test = require('tap').test -var path = require('path'); - -function allValid(t, map) { - var deps = Object.keys(map.dependencies || {}) - deps.forEach(function (dep) { - t.ok(map.dependencies[dep].extraneous, 'dependency ' + dep + ' of ' + map.name + ' is extraneous') - }) -} - -test('grandparent dev peer dependencies should be extraneous', function(t) { - readInstalled( - path.join(__dirname, 'fixtures/grandparent-peer-dev'), - { log: console.error }, - function(err, map) { - allValid(t, map) - t.end() - }) -}) diff --git a/deps/npm/node_modules/read-installed/test/grandparent-peer.js b/deps/npm/node_modules/read-installed/test/grandparent-peer.js deleted file mode 100644 index 8b51a0985a0798..00000000000000 --- a/deps/npm/node_modules/read-installed/test/grandparent-peer.js +++ /dev/null @@ -1,24 +0,0 @@ -var readInstalled = require('../read-installed.js') -var test = require('tap').test -var path = require('path'); - -function allValid(t, map) { - var deps = Object.keys(map.dependencies || {}) - deps.forEach(function (dep) { - t.notOk(map.dependencies[dep].invalid, 'dependency ' + dep + ' of ' + map.name + ' is not invalid') - t.notOk(typeof map.dependencies[dep] === 'string', 'dependency ' + dep + ' of ' + map.name + ' is not missing') - }) - deps.forEach(function (dep) { - allValid(t, map.dependencies[dep]) - }) -} - -test('grandparent can satisfy peer dependencies', function(t) { - readInstalled( - path.join(__dirname, 'fixtures/grandparent-peer'), - { log: console.error }, - function(err, map) { - allValid(t, map) - t.end() - }) -}) diff --git a/deps/npm/node_modules/read-installed/test/issue-40.js b/deps/npm/node_modules/read-installed/test/issue-40.js deleted file mode 100644 index 3105fe24aef6c1..00000000000000 --- a/deps/npm/node_modules/read-installed/test/issue-40.js +++ /dev/null @@ -1,15 +0,0 @@ -var readInstalled = require('../read-installed.js'); -var test = require('tap').test; -var path = require('path'); - -test('prerelease packages should not be marked invalid', function(t) { - readInstalled( - path.join(__dirname, 'fixtures/issue-40'), - { log: console.error }, - function(err, map) { - t.strictEqual(map.dependencies.fake.version, '0.1.0-2'); - t.notOk(map.dependencies.fake.invalid); - t.end(); - } - ); -}); diff --git a/deps/npm/node_modules/read-installed/test/linked-dep-dev-deps-extraneous.js b/deps/npm/node_modules/read-installed/test/linked-dep-dev-deps-extraneous.js deleted file mode 100644 index 656051330456e7..00000000000000 --- a/deps/npm/node_modules/read-installed/test/linked-dep-dev-deps-extraneous.js +++ /dev/null @@ -1,59 +0,0 @@ -var test = require('tap').test -var path = require('path') -var fs = require('fs') -var mkdirp = require('mkdirp') -var rimraf = require('rimraf') -var readInstalled = require('../') - -var root = path.resolve(__dirname, 'root') -var pkg = path.resolve(root, 'pkg') -var pkgnm = path.resolve(pkg, 'node_modules') -var linkdepSrc = path.resolve(root, 'linkdep') -var linkdepLink = path.resolve(pkgnm, 'linkdep') -var devdep = path.resolve(linkdepSrc, 'node_modules', 'devdep') - -function pjson (dir, data) { - mkdirp.sync(dir) - var d = path.resolve(dir, 'package.json') - fs.writeFileSync(d, JSON.stringify(data)) -} - -test('setup', function (t) { - rimraf.sync(root) - pjson(pkg, { - name: 'root', - version: '1.2.3', - dependencies: { - linkdep: '' - } - }) - pjson(linkdepSrc, { - name: 'linkdep', - version: '1.2.3', - devDependencies: { - devdep: '' - } - }) - pjson(devdep, { - name: 'devdep', - version: '1.2.3' - }) - - mkdirp.sync(pkgnm) - fs.symlinkSync(linkdepSrc, linkdepLink, 'dir') - - t.end() -}) - -test('basic', function (t) { - readInstalled(pkg, { dev: true }, function (er, data) { - var dd = data.dependencies.linkdep.dependencies.devdep - t.notOk(dd.extraneous, 'linked dev dep should not be extraneous') - t.end() - }) -}) - -test('cleanup', function (t) { - rimraf.sync(root) - t.end() -}) diff --git a/deps/npm/node_modules/read-installed/test/noargs.js b/deps/npm/node_modules/read-installed/test/noargs.js deleted file mode 100644 index 66fabeb74ecb4c..00000000000000 --- a/deps/npm/node_modules/read-installed/test/noargs.js +++ /dev/null @@ -1,21 +0,0 @@ -var readInstalled = require("../read-installed.js") -var test = require("tap").test -var json = require("../package.json") -var path = require("path") -var known = [].concat(Object.keys(json.dependencies) - , Object.keys(json.optionalDependencies) - , Object.keys(json.devDependencies)).sort() - -test("make sure that it works without dev deps", function (t) { - readInstalled(path.join(__dirname, "../"), function (er, map) { - t.notOk(er, "er should be bull") - t.ok(map, "map should be data") - if (er) return console.error(er.stack || er.message) - var deps = Object.keys(map.dependencies).sort() - t.equal(deps.length, known.length, "array lengths are equal") - t.deepEqual(deps, known, "arrays should be equal") - t.ok(map.dependencies.tap.extraneous, 'extraneous is set on devDep') - t.end() - }) -}) - diff --git a/deps/npm/node_modules/read-installed/test/peer-dep-at-latest.js b/deps/npm/node_modules/read-installed/test/peer-dep-at-latest.js deleted file mode 100644 index 8f2436fa1ecf57..00000000000000 --- a/deps/npm/node_modules/read-installed/test/peer-dep-at-latest.js +++ /dev/null @@ -1,14 +0,0 @@ -var readInstalled = require('../read-installed.js') -var test = require('tap').test -var path = require('path'); - -test('"latest" version is valid', function(t) { - // This test verifies npm#3860 - readInstalled( - path.join(__dirname, 'fixtures/peer-at-latest'), - { log: console.error }, - function(err, map) { - t.notOk(map.dependencies.debug.invalid, 'debug@latest is satisfied by a peer') - t.end() - }) -}) diff --git a/deps/npm/node_modules/npm-cache-filename/LICENSE b/deps/npm/node_modules/read-package-json-fast/LICENSE similarity index 100% rename from deps/npm/node_modules/npm-cache-filename/LICENSE rename to deps/npm/node_modules/read-package-json-fast/LICENSE diff --git a/deps/npm/node_modules/read-package-json-fast/README.md b/deps/npm/node_modules/read-package-json-fast/README.md new file mode 100644 index 00000000000000..5ab6adbece8259 --- /dev/null +++ b/deps/npm/node_modules/read-package-json-fast/README.md @@ -0,0 +1,79 @@ +# read-package-json-fast + +Like [`read-package-json`](http://npm.im/read-package-json), but faster and +more accepting of "missing" data. + +This is only suitable for reading package.json files in a node_modules +tree, since it doesn't do the various cleanups, normalization, and warnings +that are beneficial at the root level in a package being published. + +## USAGE + +```js +const rpj = require('read-package-json-fast') + +// typical promisey type API +rpj('/path/to/package.json') + .then(data => ...) + .catch(er => ...) + +// or just normalize a package manifest +const normalized = rpj.normalize(packageJsonObject) +``` + +Errors raised from parsing will use +[`json-parse-even-better-errors`](http://npm.im/json-parse-even-better-errors), +so they'll be of type `JSONParseError` and have a `code: 'EJSONPARSE'` +property. Errors will also always have a `path` member referring to the +path originally passed into the function. + +## Indentation + +To preserve indentation when the file is saved back to disk, use +`data[Symbol.for('indent')]` as the third argument to `JSON.stringify`, and +if you want to preserve windows `\r\n` newlines, replace the `\n` chars in +the string with `data[Symbol.for('newline')]`. + +For example: + +```js +const data = await readPackageJsonFast('./package.json') +const indent = Symbol.for('indent') +const newline = Symbol.for('newline') +// .. do some stuff to the data .. +const string = JSON.stringify(data, null, data[indent]) + '\n' +const eolFixed = data[newline] === '\n' ? string + : string.replace(/\n/g, data[newline]) +await writeFile('./package.json', eolFixed) +``` + +Indentation is determined by looking at the whitespace between the initial +`{` and the first `"` that follows it. If you have lots of weird +inconsistent indentation, then it won't track that or give you any way to +preserve it. Whether this is a bug or a feature is debatable ;) + +## WHAT THIS MODULE DOES + +- Parse JSON +- Normalize `bundledDependencies`/`bundleDependencies` naming to just + `bundleDependencies` (without the extra `d`) +- Handle `true`, `false`, or object values passed to `bundleDependencies` +- Normalize `funding: ` to `funding: { url: }` +- Remove any `scripts` members that are not a string value. +- Normalize a string `bin` member to `{ [name]: bin }`. +- Fold `optionalDependencies` into `dependencies`. +- Set the `_id` property if name and version are set. (This is + load-bearing in a few places within the npm CLI.) + +## WHAT THIS MODULE DOES NOT DO + +- Warn about invalid/missing name, version, repository, etc. +- Extract a description from the `README.md` file, or attach the readme to + the parsed data object. +- Read the `HEAD` value out of the `.git` folder. +- Warn about potentially typo'ed scripts (eg, `tset` instead of `test`) +- Check to make sure that all the files in the `files` field exist and are + valid files. +- Fix bundleDependencies that are not listed in `dependencies`. +- Fix `dependencies` fields that are not strictly objects of string values. +- Anything involving the `directories` field (ie, bins, mans, and so on). diff --git a/deps/npm/node_modules/read-package-json-fast/index.js b/deps/npm/node_modules/read-package-json-fast/index.js new file mode 100644 index 00000000000000..bfef5d6abcacc0 --- /dev/null +++ b/deps/npm/node_modules/read-package-json-fast/index.js @@ -0,0 +1,82 @@ +const {promisify} = require('util') +const fs = require('fs') +const readFile = promisify(fs.readFile) +const parse = require('json-parse-even-better-errors') +const rpj = path => readFile(path, 'utf8') + .then(data => normalize(parse(data))) + .catch(er => { + er.path = path + throw er + }) +const normalizePackageBin = require('npm-normalize-package-bin') + +const normalize = data => { + add_id(data) + fixBundled(data) + foldinOptionalDeps(data) + fixScripts(data) + fixFunding(data) + normalizePackageBin(data) + return data +} + +rpj.normalize = normalize + +const add_id = data => { + if (data.name && data.version) + data._id = `${data.name}@${data.version}` + return data +} + +const foldinOptionalDeps = data => { + const od = data.optionalDependencies + if (od && typeof od === 'object') { + data.dependencies = data.dependencies || {} + for (const [name, spec] of Object.entries(od)) { + data.dependencies[name] = spec + } + } + return data +} + +const fixBundled = data => { + const bdd = data.bundledDependencies + const bd = data.bundleDependencies === undefined ? bdd + : data.bundleDependencies + + if (bd === false) + data.bundleDependencies = [] + else if (bd === true) + data.bundleDependencies = Object.keys(data.dependencies || {}) + else if (bd && typeof bd === 'object') { + if (!Array.isArray(bd)) + data.bundleDependencies = Object.keys(bd) + else + data.bundleDependencies = bd + } else + delete data.bundleDependencies + + delete data.bundledDependencies + return data +} + +const fixScripts = data => { + if (!data.scripts || typeof data.scripts !== 'object') { + delete data.scripts + return data + } + + for (const [name, script] of Object.entries(data.scripts)) { + if (typeof script !== 'string') + delete data.scripts[name] + } + return data +} + +const fixFunding = data => { + if (data.funding && typeof data.funding === 'string') + data.funding = { url: data.funding } + return data +} + +module.exports = rpj diff --git a/deps/npm/node_modules/read-package-json-fast/package.json b/deps/npm/node_modules/read-package-json-fast/package.json new file mode 100644 index 00000000000000..a59a3b2e86e9bc --- /dev/null +++ b/deps/npm/node_modules/read-package-json-fast/package.json @@ -0,0 +1,31 @@ +{ + "name": "read-package-json-fast", + "version": "1.2.1", + "description": "Like read-package-json, but faster", + "author": "Isaac Z. Schlueter (https://izs.me)", + "license": "ISC", + "scripts": { + "test": "tap", + "snap": "tap", + "preversion": "npm test", + "postversion": "npm publish", + "postpublish": "git push origin --follow-tags" + }, + "tap": { + "check-coverage": true + }, + "devDependencies": { + "tap": "^14.10.1" + }, + "dependencies": { + "json-parse-even-better-errors": "^2.3.0", + "npm-normalize-package-bin": "^1.0.1" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/npm/read-package-json-fast.git" + }, + "files": [ + "index.js" + ] +} diff --git a/deps/npm/node_modules/read-package-json/CHANGELOG.md b/deps/npm/node_modules/read-package-json/CHANGELOG.md index e6f26e59d28ef8..4b710cb2ab1059 100644 --- a/deps/npm/node_modules/read-package-json/CHANGELOG.md +++ b/deps/npm/node_modules/read-package-json/CHANGELOG.md @@ -2,6 +2,16 @@ 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. + +## [2.1.2](https://github.com/npm/read-package-json/compare/v2.1.1...v2.1.2) (2020-08-20) + + +### Bug Fixes + +* even better json errors, remove graceful-fs ([fdbf082](https://github.com/npm/read-package-json/commit/fdbf082)) + + + ## [2.1.1](https://github.com/npm/read-package-json/compare/v2.1.0...v2.1.1) (2019-12-09) diff --git a/deps/npm/node_modules/read-package-json/package.json b/deps/npm/node_modules/read-package-json/package.json index 7920e43589939a..988508baa4b1fc 100644 --- a/deps/npm/node_modules/read-package-json/package.json +++ b/deps/npm/node_modules/read-package-json/package.json @@ -1,76 +1,33 @@ { - "_from": "read-package-json@2.1.1", - "_id": "read-package-json@2.1.1", - "_inBundle": false, - "_integrity": "sha512-dAiqGtVc/q5doFz6096CcnXhpYk0ZN8dEKVkGLU0CsASt8SrgF6SF7OTKAYubfvFhWaqofl+Y8HK19GR8jwW+A==", - "_location": "/read-package-json", - "_phantomChildren": {}, - "_requested": { - "type": "version", - "registry": true, - "raw": "read-package-json@2.1.1", - "name": "read-package-json", - "escapedName": "read-package-json", - "rawSpec": "2.1.1", - "saveSpec": null, - "fetchSpec": "2.1.1" - }, - "_requiredBy": [ - "#USER", - "/", - "/init-package-json", - "/libcipm", - "/libnpm", - "/read-installed", - "/read-package-tree" - ], - "_resolved": "https://registry.npmjs.org/read-package-json/-/read-package-json-2.1.1.tgz", - "_shasum": "16aa66c59e7d4dad6288f179dd9295fd59bb98f1", - "_spec": "read-package-json@2.1.1", - "_where": "/Users/isaacs/dev/npm/cli", - "author": { - "name": "Isaac Z. Schlueter", - "email": "i@izs.me", - "url": "http://blog.izs.me/" + "name": "read-package-json", + "version": "2.1.2", + "author": "Isaac Z. Schlueter (http://blog.izs.me/)", + "description": "The thing npm uses to read package.json files with semantics and defaults and validation", + "repository": { + "type": "git", + "url": "https://github.com/npm/read-package-json.git" }, - "bugs": { - "url": "https://github.com/npm/read-package-json/issues" + "main": "read-json.js", + "scripts": { + "prerelease": "npm t", + "postrelease": "npm publish && git push --follow-tags", + "pretest": "standard", + "release": "standard-version -s", + "test": "tap --nyc-arg=--all --coverage test/*.js" }, - "bundleDependencies": false, "dependencies": { "glob": "^7.1.1", - "graceful-fs": "^4.1.2", - "json-parse-better-errors": "^1.0.1", "normalize-package-data": "^2.0.0", - "npm-normalize-package-bin": "^1.0.0" + "npm-normalize-package-bin": "^1.0.0", + "json-parse-even-better-errors": "^2.3.0" }, - "deprecated": false, - "description": "The thing npm uses to read package.json files with semantics and defaults and validation", "devDependencies": { "standard": "^11.0.0", "standard-version": "^4.3.0", "tap": "^11.1.2" }, + "license": "ISC", "files": [ "read-json.js" - ], - "homepage": "https://github.com/npm/read-package-json#readme", - "license": "ISC", - "main": "read-json.js", - "name": "read-package-json", - "optionalDependencies": { - "graceful-fs": "^4.1.2" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/npm/read-package-json.git" - }, - "scripts": { - "postrelease": "npm publish && git push --follow-tags", - "prerelease": "npm t", - "pretest": "standard", - "release": "standard-version -s", - "test": "tap --nyc-arg=--all --coverage test/*.js" - }, - "version": "2.1.1" + ] } diff --git a/deps/npm/node_modules/read-package-json/read-json.js b/deps/npm/node_modules/read-package-json/read-json.js index 03da84762eb293..0e91e784ec4fdf 100644 --- a/deps/npm/node_modules/read-package-json/read-json.js +++ b/deps/npm/node_modules/read-package-json/read-json.js @@ -1,15 +1,10 @@ -var fs -try { - fs = require('graceful-fs') -} catch (er) { - fs = require('fs') -} +var fs = require('fs') var path = require('path') var glob = require('glob') var normalizeData = require('normalize-package-data') -var safeJSON = require('json-parse-better-errors') +var safeJSON = require('json-parse-even-better-errors') var util = require('util') var normalizePackageBin = require('npm-normalize-package-bin') diff --git a/deps/npm/node_modules/read-package-tree/README.md b/deps/npm/node_modules/read-package-tree/README.md deleted file mode 100644 index aa0cc934cf47e7..00000000000000 --- a/deps/npm/node_modules/read-package-tree/README.md +++ /dev/null @@ -1,73 +0,0 @@ -# read-package-tree - -[![Build Status](https://travis-ci.org/npm/read-package-tree.svg?branch=master)](https://travis-ci.org/npm/read-package-tree) - -Read the contents of node_modules. - -## USAGE - -```javascript -var rpt = require ('read-package-tree') -rpt('/path/to/pkg/root', function (node, kidName) { - // optional filter function– if included, each package folder found is passed to - // it to see if it should be included in the final tree - // node is what we're adding children to - // kidName is the directory name of the module we're considering adding - // return true -> include, false -> skip -}, function (er, data) { - // er means that something didn't work. - // data is a structure like: - // { - // package: - // package.name: defaults to `basename(path)` - // children: [ ] - // parent: - // path: - // realpath: - // isLink: - // target: - // error: - // } -}) - -// or promise-style -rpt('/path/to/pkg/root').then(data => { ... }) -``` - -That's it. It doesn't figure out if dependencies are met, it doesn't -mutate package.json data objects (beyond what -[read-package-json](http://npm.im/read-package-json) already does), it -doesn't limit its search to include/exclude `devDependencies`, or -anything else. - -Just follows the links in the `node_modules` hierarchy and reads the -package.json files it finds therein. - -## Symbolic Links - -When there are symlinks to packages in the `node_modules` hierarchy, a -`Link` object will be created, with a `target` that is a `Node` -object. - -For the most part, you can treat `Link` objects just the same as -`Node` objects. But if your tree-walking program needs to treat -symlinks differently from normal folders, then make sure to check the -object. - -In a given `read-package-tree` run, a specific `path` will always -correspond to a single object, and a specific `realpath` will always -correspond to a single `Node` object. This means that you may not be -able to pass the resulting data object to `JSON.stringify`, because it -may contain cycles. - -## Errors - -Errors parsing or finding a package.json in node_modules will result in a -node with the error property set. We will still find deeper node_modules -if any exist. *Prior to `5.0.0` these aborted tree reading with an error -callback.* - -Only a few classes of errors are fatal (result in an error callback): - -* If the top level location is entirely missing, that will error. -* if `fs.realpath` returns an error for any path its trying to resolve. diff --git a/deps/npm/node_modules/read-package-tree/package.json b/deps/npm/node_modules/read-package-tree/package.json deleted file mode 100644 index 2173171af80ff6..00000000000000 --- a/deps/npm/node_modules/read-package-tree/package.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "_from": "read-package-tree@latest", - "_id": "read-package-tree@5.3.1", - "_inBundle": false, - "_integrity": "sha512-mLUDsD5JVtlZxjSlPPx1RETkNjjvQYuweKwNVt1Sn8kP5Jh44pvYuUHCp6xSVDZWbNxVxG5lyZJ921aJH61sTw==", - "_location": "/read-package-tree", - "_phantomChildren": {}, - "_requested": { - "type": "tag", - "registry": true, - "raw": "read-package-tree@latest", - "name": "read-package-tree", - "escapedName": "read-package-tree", - "rawSpec": "latest", - "saveSpec": null, - "fetchSpec": "latest" - }, - "_requiredBy": [ - "#USER", - "/", - "/licensee" - ], - "_resolved": "https://registry.npmjs.org/read-package-tree/-/read-package-tree-5.3.1.tgz", - "_shasum": "a32cb64c7f31eb8a6f31ef06f9cedf74068fe636", - "_spec": "read-package-tree@latest", - "_where": "/Users/isaacs/dev/npm/cli", - "author": { - "name": "Isaac Z. Schlueter", - "email": "i@izs.me", - "url": "http://blog.izs.me/" - }, - "bugs": { - "url": "https://github.com/npm/read-package-tree/issues" - }, - "bundleDependencies": false, - "dependencies": { - "read-package-json": "^2.0.0", - "readdir-scoped-modules": "^1.0.0", - "util-promisify": "^2.1.0" - }, - "deprecated": false, - "description": "Read the contents of node_modules.", - "devDependencies": { - "archy": "^1.0.0", - "mkdirp": "^0.5.1", - "tacks": "^1.2.1", - "tap": "^12.7.0" - }, - "directories": { - "test": "test" - }, - "files": [ - "rpt.js", - "realpath.js" - ], - "homepage": "https://github.com/npm/read-package-tree", - "license": "ISC", - "main": "rpt.js", - "name": "read-package-tree", - "repository": { - "type": "git", - "url": "git+https://github.com/npm/read-package-tree.git" - }, - "scripts": { - "postpublish": "git push origin --follow-tags", - "postversion": "npm publish", - "preversion": "npm test", - "snap": "TAP_SNAPSHOT=1 tap test/*.js --100", - "test": "tap test/*.js --100" - }, - "tap": { - "100": true - }, - "version": "5.3.1" -} diff --git a/deps/npm/node_modules/read-package-tree/rpt.js b/deps/npm/node_modules/read-package-tree/rpt.js deleted file mode 100644 index b12a09dfb3b202..00000000000000 --- a/deps/npm/node_modules/read-package-tree/rpt.js +++ /dev/null @@ -1,169 +0,0 @@ -const fs = require('fs') -/* istanbul ignore next */ -const promisify = require('util').promisify || require('util-promisify') -const { resolve, basename, dirname, join } = require('path') -const rpj = promisify(require('read-package-json')) -const readdir = promisify(require('readdir-scoped-modules')) -const realpath = require('./realpath.js') - -let ID = 0 -class Node { - constructor (pkg, logical, physical, er, cache) { - // should be impossible. - const cached = cache.get(physical) - /* istanbul ignore next */ - if (cached && !cached.then) - throw new Error('re-creating already instantiated node') - - cache.set(physical, this) - - const parent = basename(dirname(logical)) - if (parent.charAt(0) === '@') - this.name = `${parent}/${basename(logical)}` - else - this.name = basename(logical) - this.path = logical - this.realpath = physical - this.error = er - this.id = ID++ - this.package = pkg || {} - this.parent = null - this.isLink = false - this.children = [] - } -} - -class Link extends Node { - constructor (pkg, logical, physical, realpath, er, cache) { - super(pkg, logical, physical, er, cache) - - // if the target has started, but not completed, then - // a Promise will be in the cache to indicate this. - const cachedTarget = cache.get(realpath) - if (cachedTarget && cachedTarget.then) - cachedTarget.then(node => { - this.target = node - this.children = node.children - }) - - this.target = cachedTarget || new Node(pkg, logical, realpath, er, cache) - this.realpath = realpath - this.isLink = true - this.error = er - this.children = this.target.children - } -} - -// this is the way it is to expose a timing issue which is difficult to -// test otherwise. The creation of a Node may take slightly longer than -// the creation of a Link that targets it. If the Node has _begun_ its -// creation phase (and put a Promise in the cache) then the Link will -// get a Promise as its cachedTarget instead of an actual Node object. -// This is not a problem, because it gets resolved prior to returning -// the tree or attempting to load children. However, it IS remarkably -// difficult to get to happen in a test environment to verify reliably. -// Hence this kludge. -const newNode = (pkg, logical, physical, er, cache) => - process.env._TEST_RPT_SLOW_LINK_TARGET_ === '1' - ? new Promise(res => setTimeout(() => - res(new Node(pkg, logical, physical, er, cache)), 10)) - : new Node(pkg, logical, physical, er, cache) - -const loadNode = (logical, physical, cache, rpcache, stcache) => { - // cache temporarily holds a promise placeholder so we - // don't try to create the same node multiple times. - // this is very rare to encounter, given the aggressive - // caching on fs.realpath and fs.lstat calls, but - // it can happen in theory. - const cached = cache.get(physical) - /* istanbul ignore next */ - if (cached) - return Promise.resolve(cached) - - const p = realpath(physical, rpcache, stcache, 0).then(real => - rpj(join(real, 'package.json')) - .then(pkg => [pkg, null], er => [null, er]) - .then(([pkg, er]) => - physical === real ? newNode(pkg, logical, physical, er, cache) - : new Link(pkg, logical, physical, real, er, cache) - ), - // if the realpath fails, don't bother with the rest - er => new Node(null, logical, physical, er, cache)) - - cache.set(physical, p) - return p -} - -const loadChildren = (node, cache, filterWith, rpcache, stcache) => { - // if a Link target has started, but not completed, then - // a Promise will be in the cache to indicate this. - // - // XXX When we can one day loadChildren on the link *target* instead of - // the link itself, to match real dep resolution, then we may end up with - // a node target in the cache that isn't yet done resolving when we get - // here. For now, though, this line will never be reached, so it's hidden - // - // if (node.then) - // return node.then(node => loadChildren(node, cache, filterWith, rpcache, stcache)) - - const nm = join(node.path, 'node_modules') - return realpath(nm, rpcache, stcache, 0) - .then(rm => readdir(rm).then(kids => [rm, kids])) - .then(([rm, kids]) => Promise.all( - kids.filter(kid => - kid.charAt(0) !== '.' && (!filterWith || filterWith(node, kid))) - .map(kid => loadNode(join(nm, kid), join(rm, kid), cache, rpcache, stcache))) - ).then(kidNodes => { - kidNodes.forEach(k => k.parent = node) - node.children.push.apply(node.children, kidNodes.sort((a, b) => - (a.package.name ? a.package.name.toLowerCase() : a.path) - .localeCompare( - (b.package.name ? b.package.name.toLowerCase() : b.path) - ))) - return node - }) - .catch(() => node) -} - -const loadTree = (node, did, cache, filterWith, rpcache, stcache) => { - // impossible except in pathological ELOOP cases - /* istanbul ignore next */ - if (did.has(node.realpath)) - return Promise.resolve(node) - - did.add(node.realpath) - - // load children on the target, not the link - return loadChildren(node, cache, filterWith, rpcache, stcache) - .then(node => Promise.all( - node.children - .filter(kid => !did.has(kid.realpath)) - .map(kid => loadTree(kid, did, cache, filterWith, rpcache, stcache)) - )).then(() => node) -} - -// XXX Drop filterWith and/or cb in next semver major bump -const rpt = (root, filterWith, cb) => { - if (!cb && typeof filterWith === 'function') { - cb = filterWith - filterWith = null - } - - const cache = new Map() - // we can assume that the cwd is real enough - const cwd = process.cwd() - const rpcache = new Map([[ cwd, cwd ]]) - const stcache = new Map() - const p = realpath(root, rpcache, stcache, 0) - .then(realRoot => loadNode(root, realRoot, cache, rpcache, stcache)) - .then(node => loadTree(node, new Set(), cache, filterWith, rpcache, stcache)) - - if (typeof cb === 'function') - p.then(tree => cb(null, tree), cb) - - return p -} - -rpt.Node = Node -rpt.Link = Link -module.exports = rpt diff --git a/deps/npm/node_modules/read/package.json b/deps/npm/node_modules/read/package.json index 4f04e477719843..3b480aa7691175 100644 --- a/deps/npm/node_modules/read/package.json +++ b/deps/npm/node_modules/read/package.json @@ -1,65 +1,27 @@ { - "_args": [ - [ - "read@1.0.7", - "/Users/rebecca/code/npm" - ] - ], - "_from": "read@1.0.7", - "_id": "read@1.0.7", - "_inBundle": false, - "_integrity": "sha1-s9oZvQUkMal2cdRKQmNK33ELQMQ=", - "_location": "/read", - "_phantomChildren": {}, - "_requested": { - "type": "version", - "registry": true, - "raw": "read@1.0.7", - "name": "read", - "escapedName": "read", - "rawSpec": "1.0.7", - "saveSpec": null, - "fetchSpec": "1.0.7" - }, - "_requiredBy": [ - "/", - "/init-package-json", - "/promzard" - ], - "_resolved": "https://registry.npmjs.org/read/-/read-1.0.7.tgz", - "_spec": "1.0.7", - "_where": "/Users/rebecca/code/npm", - "author": { - "name": "Isaac Z. Schlueter", - "email": "i@izs.me", - "url": "http://blog.izs.me/" - }, - "bugs": { - "url": "https://github.com/isaacs/read/issues" - }, + "name": "read", + "version": "1.0.7", + "main": "lib/read.js", "dependencies": { "mute-stream": "~0.0.4" }, - "description": "read(1) for node programs", "devDependencies": { "tap": "^1.2.0" }, "engines": { "node": ">=0.8" }, - "files": [ - "lib/read.js" - ], - "homepage": "https://github.com/isaacs/read#readme", - "license": "ISC", - "main": "lib/read.js", - "name": "read", + "author": "Isaac Z. Schlueter (http://blog.izs.me/)", + "description": "read(1) for node programs", "repository": { "type": "git", "url": "git://github.com/isaacs/read.git" }, + "license": "ISC", "scripts": { "test": "tap test/*.js" }, - "version": "1.0.7" + "files": [ + "lib/read.js" + ] } diff --git a/deps/npm/node_modules/readable-stream/.travis.yml b/deps/npm/node_modules/readable-stream/.travis.yml new file mode 100644 index 00000000000000..f62cdac0686da6 --- /dev/null +++ b/deps/npm/node_modules/readable-stream/.travis.yml @@ -0,0 +1,34 @@ +sudo: false +language: node_js +before_install: + - (test $NPM_LEGACY && npm install -g npm@2 && npm install -g npm@3) || true +notifications: + email: false +matrix: + fast_finish: true + include: + - node_js: '0.8' + env: NPM_LEGACY=true + - node_js: '0.10' + env: NPM_LEGACY=true + - node_js: '0.11' + env: NPM_LEGACY=true + - node_js: '0.12' + env: NPM_LEGACY=true + - node_js: 1 + env: NPM_LEGACY=true + - node_js: 2 + env: NPM_LEGACY=true + - node_js: 3 + env: NPM_LEGACY=true + - node_js: 4 + - node_js: 5 + - node_js: 6 + - node_js: 7 + - node_js: 8 + - node_js: 9 +script: "npm run test" +env: + global: + - secure: rE2Vvo7vnjabYNULNyLFxOyt98BoJexDqsiOnfiD6kLYYsiQGfr/sbZkPMOFm9qfQG7pjqx+zZWZjGSswhTt+626C0t/njXqug7Yps4c3dFblzGfreQHp7wNX5TFsvrxd6dAowVasMp61sJcRnB2w8cUzoe3RAYUDHyiHktwqMc= + - secure: g9YINaKAdMatsJ28G9jCGbSaguXCyxSTy+pBO6Ch0Cf57ZLOTka3HqDj8p3nV28LUIHZ3ut5WO43CeYKwt4AUtLpBS3a0dndHdY6D83uY6b2qh5hXlrcbeQTq2cvw2y95F7hm4D1kwrgZ7ViqaKggRcEupAL69YbJnxeUDKWEdI= diff --git a/deps/npm/node_modules/readable-stream/CONTRIBUTING.md b/deps/npm/node_modules/readable-stream/CONTRIBUTING.md new file mode 100644 index 00000000000000..f478d58dca85b2 --- /dev/null +++ b/deps/npm/node_modules/readable-stream/CONTRIBUTING.md @@ -0,0 +1,38 @@ +# Developer's Certificate of Origin 1.1 + +By making a contribution to this project, I certify that: + +* (a) The contribution was created in whole or in part by me and I + have the right to submit it under the open source license + indicated in the file; or + +* (b) The contribution is based upon previous work that, to the best + of my knowledge, is covered under an appropriate open source + license and I have the right under that license to submit that + work with modifications, whether created in whole or in part + by me, under the same open source license (unless I am + permitted to submit under a different license), as indicated + in the file; or + +* (c) The contribution was provided directly to me by some other + person who certified (a), (b) or (c) and I have not modified + it. + +* (d) I understand and agree that this project and the contribution + are public and that a record of the contribution (including all + personal information I submit with it, including my sign-off) is + maintained indefinitely and may be redistributed consistent with + this project or the open source license(s) involved. + +## Moderation Policy + +The [Node.js Moderation Policy] applies to this WG. + +## Code of Conduct + +The [Node.js Code of Conduct][] applies to this WG. + +[Node.js Code of Conduct]: +https://github.com/nodejs/node/blob/master/CODE_OF_CONDUCT.md +[Node.js Moderation Policy]: +https://github.com/nodejs/TSC/blob/master/Moderation-Policy.md diff --git a/deps/npm/node_modules/readable-stream/README.md b/deps/npm/node_modules/readable-stream/README.md index 6f035ab16f29dd..23fe3f3e3009a2 100644 --- a/deps/npm/node_modules/readable-stream/README.md +++ b/deps/npm/node_modules/readable-stream/README.md @@ -1,81 +1,30 @@ # readable-stream -***Node.js core streams for userland*** [![Build Status](https://travis-ci.com/nodejs/readable-stream.svg?branch=master)](https://travis-ci.com/nodejs/readable-stream) +***Node-core v8.11.1 streams for userland*** [![Build Status](https://travis-ci.org/nodejs/readable-stream.svg?branch=master)](https://travis-ci.org/nodejs/readable-stream) [![NPM](https://nodei.co/npm/readable-stream.png?downloads=true&downloadRank=true)](https://nodei.co/npm/readable-stream/) [![NPM](https://nodei.co/npm-dl/readable-stream.png?&months=6&height=3)](https://nodei.co/npm/readable-stream/) -[![Sauce Test Status](https://saucelabs.com/browser-matrix/readabe-stream.svg)](https://saucelabs.com/u/readabe-stream) +[![Sauce Test Status](https://saucelabs.com/browser-matrix/readable-stream.svg)](https://saucelabs.com/u/readable-stream) ```bash npm install --save readable-stream ``` -This package is a mirror of the streams implementations in Node.js. +***Node-core streams for userland*** -Full documentation may be found on the [Node.js website](https://nodejs.org/dist/v10.19.0/docs/api/stream.html). +This package is a mirror of the Streams2 and Streams3 implementations in +Node-core. + +Full documentation may be found on the [Node.js website](https://nodejs.org/dist/v8.11.1/docs/api/stream.html). If you want to guarantee a stable streams base, regardless of what version of Node you, or the users of your libraries are using, use **readable-stream** *only* and avoid the *"stream"* module in Node-core, for background see [this blogpost](http://r.va.gg/2014/06/why-i-dont-use-nodes-core-stream-module.html). As of version 2.0.0 **readable-stream** uses semantic versioning. -## Version 3.x.x - -v3.x.x of `readable-stream` is a cut from Node 10. This version supports Node 6, 8, and 10, as well as evergreen browsers, IE 11 and latest Safari. The breaking changes introduced by v3 are composed by the combined breaking changes in [Node v9](https://nodejs.org/en/blog/release/v9.0.0/) and [Node v10](https://nodejs.org/en/blog/release/v10.0.0/), as follows: - -1. Error codes: https://github.com/nodejs/node/pull/13310, - https://github.com/nodejs/node/pull/13291, - https://github.com/nodejs/node/pull/16589, - https://github.com/nodejs/node/pull/15042, - https://github.com/nodejs/node/pull/15665, - https://github.com/nodejs/readable-stream/pull/344 -2. 'readable' have precedence over flowing - https://github.com/nodejs/node/pull/18994 -3. make virtual methods errors consistent - https://github.com/nodejs/node/pull/18813 -4. updated streams error handling - https://github.com/nodejs/node/pull/18438 -5. writable.end should return this. - https://github.com/nodejs/node/pull/18780 -6. readable continues to read when push('') - https://github.com/nodejs/node/pull/18211 -7. add custom inspect to BufferList - https://github.com/nodejs/node/pull/17907 -8. always defer 'readable' with nextTick - https://github.com/nodejs/node/pull/17979 - -## Version 2.x.x -v2.x.x of `readable-stream` is a cut of the stream module from Node 8 (there have been no semver-major changes from Node 4 to 8). This version supports all Node.js versions from 0.8, as well as evergreen browsers and IE 10 & 11. - -### Big Thanks - -Cross-browser Testing Platform and Open Source <3 Provided by [Sauce Labs][sauce] - -# Usage - -You can swap your `require('stream')` with `require('readable-stream')` -without any changes, if you are just using one of the main classes and -functions. - -```js -const { - Readable, - Writable, - Transform, - Duplex, - pipeline, - finished -} = require('readable-stream') -```` - -Note that `require('stream')` will return `Stream`, while -`require('readable-stream')` will return `Readable`. We discourage using -whatever is exported directly, but rather use one of the properties as -shown in the example above. - # Streams Working Group `readable-stream` is maintained by the Streams Working Group, which @@ -95,12 +44,15 @@ Node.js. The responsibilities of the Streams Working Group include: ## Team Members +* **Chris Dickinson** ([@chrisdickinson](https://github.com/chrisdickinson)) <christopher.s.dickinson@gmail.com> + - Release GPG key: 9554F04D7259F04124DE6B476D5A82AC7E37093B * **Calvin Metcalf** ([@calvinmetcalf](https://github.com/calvinmetcalf)) <calvin.metcalf@gmail.com> - Release GPG key: F3EF5F62A87FC27A22E643F714CE4FF5015AA242 +* **Rod Vagg** ([@rvagg](https://github.com/rvagg)) <rod@vagg.org> + - Release GPG key: DD8F2338BAE7501E3DD5AC78C273792F7D83545D +* **Sam Newman** ([@sonewman](https://github.com/sonewman)) <newmansam@outlook.com> * **Mathias Buus** ([@mafintosh](https://github.com/mafintosh)) <mathiasbuus@gmail.com> +* **Domenic Denicola** ([@domenic](https://github.com/domenic)) <d@domenic.me> * **Matteo Collina** ([@mcollina](https://github.com/mcollina)) <matteo.collina@gmail.com> - Release GPG key: 3ABC01543F22DD2239285CDD818674489FBC127E * **Irina Shestak** ([@lrlna](https://github.com/lrlna)) <shestak.irina@gmail.com> -* **Yoshua Wyuts** ([@yoshuawuyts](https://github.com/yoshuawuyts)) <yoshuawuyts@gmail.com> - -[sauce]: https://saucelabs.com diff --git a/deps/npm/node_modules/readable-stream/doc/wg-meetings/2015-01-30.md b/deps/npm/node_modules/readable-stream/doc/wg-meetings/2015-01-30.md new file mode 100644 index 00000000000000..c141a99c26c638 --- /dev/null +++ b/deps/npm/node_modules/readable-stream/doc/wg-meetings/2015-01-30.md @@ -0,0 +1,58 @@ +# streams WG Meeting 2015-01-30 + +## Links + +* **Google Hangouts Video**: http://www.youtube.com/watch?v=I9nDOSGfwZg +* **GitHub Issue**: https://github.com/iojs/readable-stream/issues/106 +* **Original Minutes Google Doc**: https://docs.google.com/document/d/17aTgLnjMXIrfjgNaTUnHQO7m3xgzHR2VXBTmi03Qii4/ + +## Agenda + +Extracted from https://github.com/iojs/readable-stream/labels/wg-agenda prior to meeting. + +* adopt a charter [#105](https://github.com/iojs/readable-stream/issues/105) +* release and versioning strategy [#101](https://github.com/iojs/readable-stream/issues/101) +* simpler stream creation [#102](https://github.com/iojs/readable-stream/issues/102) +* proposal: deprecate implicit flowing of streams [#99](https://github.com/iojs/readable-stream/issues/99) + +## Minutes + +### adopt a charter + +* group: +1's all around + +### What versioning scheme should be adopted? +* group: +1’s 3.0.0 +* domenic+group: pulling in patches from other sources where appropriate +* mikeal: version independently, suggesting versions for io.js +* mikeal+domenic: work with TC to notify in advance of changes +simpler stream creation + +### streamline creation of streams +* sam: streamline creation of streams +* domenic: nice simple solution posted + but, we lose the opportunity to change the model + may not be backwards incompatible (double check keys) + + **action item:** domenic will check + +### remove implicit flowing of streams on(‘data’) +* add isFlowing / isPaused +* mikeal: worrying that we’re documenting polyfill methods – confuses users +* domenic: more reflective API is probably good, with warning labels for users +* new section for mad scientists (reflective stream access) +* calvin: name the “third state” +* mikeal: maybe borrow the name from whatwg? +* domenic: we’re missing the “third state” +* consensus: kind of difficult to name the third state +* mikeal: figure out differences in states / compat +* mathias: always flow on data – eliminates third state + * explore what it breaks + +**action items:** +* ask isaac for ability to list packages by what public io.js APIs they use (esp. Stream) +* ask rod/build for infrastructure +* **chris**: explore the “flow on data” approach +* add isPaused/isFlowing +* add new docs section +* move isPaused to that section diff --git a/deps/npm/node_modules/are-we-there-yet/node_modules/readable-stream/duplex-browser.js b/deps/npm/node_modules/readable-stream/duplex-browser.js similarity index 100% rename from deps/npm/node_modules/are-we-there-yet/node_modules/readable-stream/duplex-browser.js rename to deps/npm/node_modules/readable-stream/duplex-browser.js diff --git a/deps/npm/node_modules/are-we-there-yet/node_modules/readable-stream/duplex.js b/deps/npm/node_modules/readable-stream/duplex.js similarity index 100% rename from deps/npm/node_modules/are-we-there-yet/node_modules/readable-stream/duplex.js rename to deps/npm/node_modules/readable-stream/duplex.js diff --git a/deps/npm/node_modules/readable-stream/errors-browser.js b/deps/npm/node_modules/readable-stream/errors-browser.js deleted file mode 100644 index fb8e73e1893b10..00000000000000 --- a/deps/npm/node_modules/readable-stream/errors-browser.js +++ /dev/null @@ -1,127 +0,0 @@ -'use strict'; - -function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; } - -var codes = {}; - -function createErrorType(code, message, Base) { - if (!Base) { - Base = Error; - } - - function getMessage(arg1, arg2, arg3) { - if (typeof message === 'string') { - return message; - } else { - return message(arg1, arg2, arg3); - } - } - - var NodeError = - /*#__PURE__*/ - function (_Base) { - _inheritsLoose(NodeError, _Base); - - function NodeError(arg1, arg2, arg3) { - return _Base.call(this, getMessage(arg1, arg2, arg3)) || this; - } - - return NodeError; - }(Base); - - NodeError.prototype.name = Base.name; - NodeError.prototype.code = code; - codes[code] = NodeError; -} // https://github.com/nodejs/node/blob/v10.8.0/lib/internal/errors.js - - -function oneOf(expected, thing) { - if (Array.isArray(expected)) { - var len = expected.length; - expected = expected.map(function (i) { - return String(i); - }); - - if (len > 2) { - return "one of ".concat(thing, " ").concat(expected.slice(0, len - 1).join(', '), ", or ") + expected[len - 1]; - } else if (len === 2) { - return "one of ".concat(thing, " ").concat(expected[0], " or ").concat(expected[1]); - } else { - return "of ".concat(thing, " ").concat(expected[0]); - } - } else { - return "of ".concat(thing, " ").concat(String(expected)); - } -} // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/startsWith - - -function startsWith(str, search, pos) { - return str.substr(!pos || pos < 0 ? 0 : +pos, search.length) === search; -} // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/endsWith - - -function endsWith(str, search, this_len) { - if (this_len === undefined || this_len > str.length) { - this_len = str.length; - } - - return str.substring(this_len - search.length, this_len) === search; -} // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/includes - - -function includes(str, search, start) { - if (typeof start !== 'number') { - start = 0; - } - - if (start + search.length > str.length) { - return false; - } else { - return str.indexOf(search, start) !== -1; - } -} - -createErrorType('ERR_INVALID_OPT_VALUE', function (name, value) { - return 'The value "' + value + '" is invalid for option "' + name + '"'; -}, TypeError); -createErrorType('ERR_INVALID_ARG_TYPE', function (name, expected, actual) { - // determiner: 'must be' or 'must not be' - var determiner; - - if (typeof expected === 'string' && startsWith(expected, 'not ')) { - determiner = 'must not be'; - expected = expected.replace(/^not /, ''); - } else { - determiner = 'must be'; - } - - var msg; - - if (endsWith(name, ' argument')) { - // For cases like 'first argument' - msg = "The ".concat(name, " ").concat(determiner, " ").concat(oneOf(expected, 'type')); - } else { - var type = includes(name, '.') ? 'property' : 'argument'; - msg = "The \"".concat(name, "\" ").concat(type, " ").concat(determiner, " ").concat(oneOf(expected, 'type')); - } - - msg += ". Received type ".concat(typeof actual); - return msg; -}, TypeError); -createErrorType('ERR_STREAM_PUSH_AFTER_EOF', 'stream.push() after EOF'); -createErrorType('ERR_METHOD_NOT_IMPLEMENTED', function (name) { - return 'The ' + name + ' method is not implemented'; -}); -createErrorType('ERR_STREAM_PREMATURE_CLOSE', 'Premature close'); -createErrorType('ERR_STREAM_DESTROYED', function (name) { - return 'Cannot call ' + name + ' after a stream was destroyed'; -}); -createErrorType('ERR_MULTIPLE_CALLBACK', 'Callback called multiple times'); -createErrorType('ERR_STREAM_CANNOT_PIPE', 'Cannot pipe, not readable'); -createErrorType('ERR_STREAM_WRITE_AFTER_END', 'write after end'); -createErrorType('ERR_STREAM_NULL_VALUES', 'May not write null values to stream', TypeError); -createErrorType('ERR_UNKNOWN_ENCODING', function (arg) { - return 'Unknown encoding: ' + arg; -}, TypeError); -createErrorType('ERR_STREAM_UNSHIFT_AFTER_END_EVENT', 'stream.unshift() after end event'); -module.exports.codes = codes; diff --git a/deps/npm/node_modules/readable-stream/errors.js b/deps/npm/node_modules/readable-stream/errors.js deleted file mode 100644 index 8471526d6e7f75..00000000000000 --- a/deps/npm/node_modules/readable-stream/errors.js +++ /dev/null @@ -1,116 +0,0 @@ -'use strict'; - -const codes = {}; - -function createErrorType(code, message, Base) { - if (!Base) { - Base = Error - } - - function getMessage (arg1, arg2, arg3) { - if (typeof message === 'string') { - return message - } else { - return message(arg1, arg2, arg3) - } - } - - class NodeError extends Base { - constructor (arg1, arg2, arg3) { - super(getMessage(arg1, arg2, arg3)); - } - } - - NodeError.prototype.name = Base.name; - NodeError.prototype.code = code; - - codes[code] = NodeError; -} - -// https://github.com/nodejs/node/blob/v10.8.0/lib/internal/errors.js -function oneOf(expected, thing) { - if (Array.isArray(expected)) { - const len = expected.length; - expected = expected.map((i) => String(i)); - if (len > 2) { - return `one of ${thing} ${expected.slice(0, len - 1).join(', ')}, or ` + - expected[len - 1]; - } else if (len === 2) { - return `one of ${thing} ${expected[0]} or ${expected[1]}`; - } else { - return `of ${thing} ${expected[0]}`; - } - } else { - return `of ${thing} ${String(expected)}`; - } -} - -// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/startsWith -function startsWith(str, search, pos) { - return str.substr(!pos || pos < 0 ? 0 : +pos, search.length) === search; -} - -// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/endsWith -function endsWith(str, search, this_len) { - if (this_len === undefined || this_len > str.length) { - this_len = str.length; - } - return str.substring(this_len - search.length, this_len) === search; -} - -// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/includes -function includes(str, search, start) { - if (typeof start !== 'number') { - start = 0; - } - - if (start + search.length > str.length) { - return false; - } else { - return str.indexOf(search, start) !== -1; - } -} - -createErrorType('ERR_INVALID_OPT_VALUE', function (name, value) { - return 'The value "' + value + '" is invalid for option "' + name + '"' -}, TypeError); -createErrorType('ERR_INVALID_ARG_TYPE', function (name, expected, actual) { - // determiner: 'must be' or 'must not be' - let determiner; - if (typeof expected === 'string' && startsWith(expected, 'not ')) { - determiner = 'must not be'; - expected = expected.replace(/^not /, ''); - } else { - determiner = 'must be'; - } - - let msg; - if (endsWith(name, ' argument')) { - // For cases like 'first argument' - msg = `The ${name} ${determiner} ${oneOf(expected, 'type')}`; - } else { - const type = includes(name, '.') ? 'property' : 'argument'; - msg = `The "${name}" ${type} ${determiner} ${oneOf(expected, 'type')}`; - } - - msg += `. Received type ${typeof actual}`; - return msg; -}, TypeError); -createErrorType('ERR_STREAM_PUSH_AFTER_EOF', 'stream.push() after EOF'); -createErrorType('ERR_METHOD_NOT_IMPLEMENTED', function (name) { - return 'The ' + name + ' method is not implemented' -}); -createErrorType('ERR_STREAM_PREMATURE_CLOSE', 'Premature close'); -createErrorType('ERR_STREAM_DESTROYED', function (name) { - return 'Cannot call ' + name + ' after a stream was destroyed'; -}); -createErrorType('ERR_MULTIPLE_CALLBACK', 'Callback called multiple times'); -createErrorType('ERR_STREAM_CANNOT_PIPE', 'Cannot pipe, not readable'); -createErrorType('ERR_STREAM_WRITE_AFTER_END', 'write after end'); -createErrorType('ERR_STREAM_NULL_VALUES', 'May not write null values to stream', TypeError); -createErrorType('ERR_UNKNOWN_ENCODING', function (arg) { - return 'Unknown encoding: ' + arg -}, TypeError); -createErrorType('ERR_STREAM_UNSHIFT_AFTER_END_EVENT', 'stream.unshift() after end event'); - -module.exports.codes = codes; diff --git a/deps/npm/node_modules/readable-stream/experimentalWarning.js b/deps/npm/node_modules/readable-stream/experimentalWarning.js deleted file mode 100644 index 78e841495bf24d..00000000000000 --- a/deps/npm/node_modules/readable-stream/experimentalWarning.js +++ /dev/null @@ -1,17 +0,0 @@ -'use strict' - -var experimentalWarnings = new Set(); - -function emitExperimentalWarning(feature) { - if (experimentalWarnings.has(feature)) return; - var msg = feature + ' is an experimental feature. This feature could ' + - 'change at any time'; - experimentalWarnings.add(feature); - process.emitWarning(msg, 'ExperimentalWarning'); -} - -function noop() {} - -module.exports.emitExperimentalWarning = process.emitWarning - ? emitExperimentalWarning - : noop; diff --git a/deps/npm/node_modules/readable-stream/lib/_stream_duplex.js b/deps/npm/node_modules/readable-stream/lib/_stream_duplex.js index 67525192250f6d..57003c32d256c0 100644 --- a/deps/npm/node_modules/readable-stream/lib/_stream_duplex.js +++ b/deps/npm/node_modules/readable-stream/lib/_stream_duplex.js @@ -18,37 +18,43 @@ // 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. + // a duplex stream is just a stream that is both readable and writable. // Since JS doesn't have multiple prototypal inheritance, this class // prototypally inherits from Readable, and then parasitically from // Writable. + 'use strict'; + /**/ +var pna = require('process-nextick-args'); +/**/ + +/**/ var objectKeys = Object.keys || function (obj) { var keys = []; - for (var key in obj) { keys.push(key); - } - - return keys; + }return keys; }; /**/ - module.exports = Duplex; -var Readable = require('./_stream_readable'); +/**/ +var util = Object.create(require('core-util-is')); +util.inherits = require('inherits'); +/**/ +var Readable = require('./_stream_readable'); var Writable = require('./_stream_writable'); -require('inherits')(Duplex, Readable); +util.inherits(Duplex, Readable); { - // Allow the keys array to be GC'ed. + // avoid scope creep, the keys array can then be collected var keys = objectKeys(Writable.prototype); - for (var v = 0; v < keys.length; v++) { var method = keys[v]; if (!Duplex.prototype[method]) Duplex.prototype[method] = Writable.prototype[method]; @@ -57,19 +63,18 @@ require('inherits')(Duplex, Readable); function Duplex(options) { if (!(this instanceof Duplex)) return new Duplex(options); + Readable.call(this, options); Writable.call(this, options); - this.allowHalfOpen = true; - if (options) { - if (options.readable === false) this.readable = false; - if (options.writable === false) this.writable = false; + if (options && options.readable === false) this.readable = false; - if (options.allowHalfOpen === false) { - this.allowHalfOpen = false; - this.once('end', onend); - } - } + if (options && options.writable === false) this.writable = false; + + this.allowHalfOpen = true; + if (options && options.allowHalfOpen === false) this.allowHalfOpen = false; + + this.once('end', onend); } Object.defineProperty(Duplex.prototype, 'writableHighWaterMark', { @@ -77,35 +82,20 @@ Object.defineProperty(Duplex.prototype, 'writableHighWaterMark', { // because otherwise some prototype manipulation in // userland will fail enumerable: false, - get: function get() { + get: function () { return this._writableState.highWaterMark; } }); -Object.defineProperty(Duplex.prototype, 'writableBuffer', { - // making it explicit this property is not enumerable - // because otherwise some prototype manipulation in - // userland will fail - enumerable: false, - get: function get() { - return this._writableState && this._writableState.getBuffer(); - } -}); -Object.defineProperty(Duplex.prototype, 'writableLength', { - // making it explicit this property is not enumerable - // because otherwise some prototype manipulation in - // userland will fail - enumerable: false, - get: function get() { - return this._writableState.length; - } -}); // the no-half-open enforcer +// the no-half-open enforcer function onend() { - // If the writable side ended, then we're ok. - if (this._writableState.ended) return; // no more data can be written. - // But allow more writes to happen in this tick. + // if we allow half-open state, or if the writable side ended, + // then we're ok. + if (this.allowHalfOpen || this._writableState.ended) return; - process.nextTick(onEndNT, this); + // no more data can be written. + // But allow more writes to happen in this tick. + pna.nextTick(onEndNT, this); } function onEndNT(self) { @@ -113,27 +103,29 @@ function onEndNT(self) { } Object.defineProperty(Duplex.prototype, 'destroyed', { - // making it explicit this property is not enumerable - // because otherwise some prototype manipulation in - // userland will fail - enumerable: false, - get: function get() { + get: function () { if (this._readableState === undefined || this._writableState === undefined) { return false; } - return this._readableState.destroyed && this._writableState.destroyed; }, - set: function set(value) { + set: function (value) { // we ignore the value if the stream // has not been initialized yet if (this._readableState === undefined || this._writableState === undefined) { return; - } // backward compatibility, the user is explicitly - // managing destroyed - + } + // backward compatibility, the user is explicitly + // managing destroyed this._readableState.destroyed = value; this._writableState.destroyed = value; } -}); \ No newline at end of file +}); + +Duplex.prototype._destroy = function (err, cb) { + this.push(null); + this.end(); + + pna.nextTick(cb, err); +}; \ No newline at end of file diff --git a/deps/npm/node_modules/readable-stream/lib/_stream_passthrough.js b/deps/npm/node_modules/readable-stream/lib/_stream_passthrough.js index 32e7414c5a8271..612edb4d8b443f 100644 --- a/deps/npm/node_modules/readable-stream/lib/_stream_passthrough.js +++ b/deps/npm/node_modules/readable-stream/lib/_stream_passthrough.js @@ -18,19 +18,27 @@ // 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. + // a passthrough stream. // basically just the most minimal sort of Transform stream. // Every written chunk gets output as-is. + 'use strict'; module.exports = PassThrough; var Transform = require('./_stream_transform'); -require('inherits')(PassThrough, Transform); +/**/ +var util = Object.create(require('core-util-is')); +util.inherits = require('inherits'); +/**/ + +util.inherits(PassThrough, Transform); function PassThrough(options) { if (!(this instanceof PassThrough)) return new PassThrough(options); + Transform.call(this, options); } diff --git a/deps/npm/node_modules/readable-stream/lib/_stream_readable.js b/deps/npm/node_modules/readable-stream/lib/_stream_readable.js index 192d451488f208..0f807646b0f67d 100644 --- a/deps/npm/node_modules/readable-stream/lib/_stream_readable.js +++ b/deps/npm/node_modules/readable-stream/lib/_stream_readable.js @@ -18,110 +18,118 @@ // 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. + 'use strict'; +/**/ + +var pna = require('process-nextick-args'); +/**/ + module.exports = Readable; + /**/ +var isArray = require('isarray'); +/**/ +/**/ var Duplex; /**/ Readable.ReadableState = ReadableState; -/**/ +/**/ var EE = require('events').EventEmitter; -var EElistenerCount = function EElistenerCount(emitter, type) { +var EElistenerCount = function (emitter, type) { return emitter.listeners(type).length; }; /**/ /**/ - - var Stream = require('./internal/streams/stream'); /**/ +/**/ -var Buffer = require('buffer').Buffer; - +var Buffer = require('safe-buffer').Buffer; var OurUint8Array = global.Uint8Array || function () {}; - function _uint8ArrayToBuffer(chunk) { return Buffer.from(chunk); } - function _isUint8Array(obj) { return Buffer.isBuffer(obj) || obj instanceof OurUint8Array; } -/**/ - -var debugUtil = require('util'); +/**/ -var debug; +/**/ +var util = Object.create(require('core-util-is')); +util.inherits = require('inherits'); +/**/ +/**/ +var debugUtil = require('util'); +var debug = void 0; if (debugUtil && debugUtil.debuglog) { debug = debugUtil.debuglog('stream'); } else { - debug = function debug() {}; + debug = function () {}; } /**/ - -var BufferList = require('./internal/streams/buffer_list'); - +var BufferList = require('./internal/streams/BufferList'); var destroyImpl = require('./internal/streams/destroy'); - -var _require = require('./internal/streams/state'), - getHighWaterMark = _require.getHighWaterMark; - -var _require$codes = require('../errors').codes, - ERR_INVALID_ARG_TYPE = _require$codes.ERR_INVALID_ARG_TYPE, - ERR_STREAM_PUSH_AFTER_EOF = _require$codes.ERR_STREAM_PUSH_AFTER_EOF, - ERR_METHOD_NOT_IMPLEMENTED = _require$codes.ERR_METHOD_NOT_IMPLEMENTED, - ERR_STREAM_UNSHIFT_AFTER_END_EVENT = _require$codes.ERR_STREAM_UNSHIFT_AFTER_END_EVENT; // Lazy loaded to improve the startup performance. - - var StringDecoder; -var createReadableStreamAsyncIterator; -var from; -require('inherits')(Readable, Stream); +util.inherits(Readable, Stream); -var errorOrDestroy = destroyImpl.errorOrDestroy; var kProxyEvents = ['error', 'close', 'destroy', 'pause', 'resume']; function prependListener(emitter, event, fn) { // Sadly this is not cacheable as some libraries bundle their own // event emitter implementation with them. - if (typeof emitter.prependListener === 'function') return emitter.prependListener(event, fn); // This is a hack to make sure that our error handler is attached before any + if (typeof emitter.prependListener === 'function') return emitter.prependListener(event, fn); + + // This is a hack to make sure that our error handler is attached before any // userland ones. NEVER DO THIS. This is here only because this code needs // to continue to work with older versions of Node.js that do not include // the prependListener() method. The goal is to eventually remove this hack. - - if (!emitter._events || !emitter._events[event]) emitter.on(event, fn);else if (Array.isArray(emitter._events[event])) emitter._events[event].unshift(fn);else emitter._events[event] = [fn, emitter._events[event]]; + if (!emitter._events || !emitter._events[event]) emitter.on(event, fn);else if (isArray(emitter._events[event])) emitter._events[event].unshift(fn);else emitter._events[event] = [fn, emitter._events[event]]; } -function ReadableState(options, stream, isDuplex) { +function ReadableState(options, stream) { Duplex = Duplex || require('./_stream_duplex'); - options = options || {}; // Duplex streams are both readable and writable, but share + + options = options || {}; + + // Duplex streams are both readable and writable, but share // the same options object. // However, some cases require setting options to different // values for the readable and the writable sides of the duplex stream. // These options can be provided separately as readableXXX and writableXXX. + var isDuplex = stream instanceof Duplex; - if (typeof isDuplex !== 'boolean') isDuplex = stream instanceof Duplex; // object stream flag. Used to make read(n) ignore n and to + // object stream flag. Used to make read(n) ignore n and to // make all the buffer merging and length checks go away - this.objectMode = !!options.objectMode; - if (isDuplex) this.objectMode = this.objectMode || !!options.readableObjectMode; // the point at which it stops calling _read() to fill the buffer + + if (isDuplex) this.objectMode = this.objectMode || !!options.readableObjectMode; + + // the point at which it stops calling _read() to fill the buffer // Note: 0 is a valid value, means "don't call _read preemptively ever" + var hwm = options.highWaterMark; + var readableHwm = options.readableHighWaterMark; + var defaultHwm = this.objectMode ? 16 : 16 * 1024; + + if (hwm || hwm === 0) this.highWaterMark = hwm;else if (isDuplex && (readableHwm || readableHwm === 0)) this.highWaterMark = readableHwm;else this.highWaterMark = defaultHwm; + + // cast to ints. + this.highWaterMark = Math.floor(this.highWaterMark); - this.highWaterMark = getHighWaterMark(this, options, 'readableHighWaterMark', isDuplex); // A linked list is used to store data chunks instead of an array because the + // A linked list is used to store data chunks instead of an array because the // linked list can remove elements from the beginning faster than // array.shift() - this.buffer = new BufferList(); this.length = 0; this.pipes = null; @@ -129,36 +137,37 @@ function ReadableState(options, stream, isDuplex) { this.flowing = null; this.ended = false; this.endEmitted = false; - this.reading = false; // a flag to be able to tell if the event 'readable'/'data' is emitted + this.reading = false; + + // a flag to be able to tell if the event 'readable'/'data' is emitted // immediately, or on a later tick. We set this to true at first, because // any actions that shouldn't happen until "later" should generally also // not happen before the first read call. + this.sync = true; - this.sync = true; // whenever we return null, then we set a flag to say + // whenever we return null, then we set a flag to say // that we're awaiting a 'readable' event emission. - this.needReadable = false; this.emittedReadable = false; this.readableListening = false; this.resumeScheduled = false; - this.paused = true; // Should close be emitted on destroy. Defaults to true. - this.emitClose = options.emitClose !== false; // Should .destroy() be called after 'end' (and potentially 'finish') + // has it been destroyed + this.destroyed = false; - this.autoDestroy = !!options.autoDestroy; // has it been destroyed - - this.destroyed = false; // Crypto is kind of old and crusty. Historically, its default string + // Crypto is kind of old and crusty. Historically, its default string // encoding is 'binary' so we have to make this configurable. // Everything else in the universe uses 'utf8', though. + this.defaultEncoding = options.defaultEncoding || 'utf8'; - this.defaultEncoding = options.defaultEncoding || 'utf8'; // the number of writers that are awaiting a drain event in .pipe()s - - this.awaitDrain = 0; // if true, a maybeReadMore has been scheduled + // the number of writers that are awaiting a drain event in .pipe()s + this.awaitDrain = 0; + // if true, a maybeReadMore has been scheduled this.readingMore = false; + this.decoder = null; this.encoding = null; - if (options.encoding) { if (!StringDecoder) StringDecoder = require('string_decoder/').StringDecoder; this.decoder = new StringDecoder(options.encoding); @@ -168,16 +177,17 @@ function ReadableState(options, stream, isDuplex) { function Readable(options) { Duplex = Duplex || require('./_stream_duplex'); - if (!(this instanceof Readable)) return new Readable(options); // Checking for a Stream.Duplex instance is faster here instead of inside - // the ReadableState constructor, at least with V8 6.5 - var isDuplex = this instanceof Duplex; - this._readableState = new ReadableState(options, this, isDuplex); // legacy + if (!(this instanceof Readable)) return new Readable(options); + + this._readableState = new ReadableState(options, this); + // legacy this.readable = true; if (options) { if (typeof options.read === 'function') this._read = options.read; + if (typeof options.destroy === 'function') this._destroy = options.destroy; } @@ -185,40 +195,36 @@ function Readable(options) { } Object.defineProperty(Readable.prototype, 'destroyed', { - // making it explicit this property is not enumerable - // because otherwise some prototype manipulation in - // userland will fail - enumerable: false, - get: function get() { + get: function () { if (this._readableState === undefined) { return false; } - return this._readableState.destroyed; }, - set: function set(value) { + set: function (value) { // we ignore the value if the stream // has not been initialized yet if (!this._readableState) { return; - } // backward compatibility, the user is explicitly - // managing destroyed - + } + // backward compatibility, the user is explicitly + // managing destroyed this._readableState.destroyed = value; } }); + Readable.prototype.destroy = destroyImpl.destroy; Readable.prototype._undestroy = destroyImpl.undestroy; - Readable.prototype._destroy = function (err, cb) { + this.push(null); cb(err); -}; // Manually shove something into the read() buffer. +}; + +// Manually shove something into the read() buffer. // This returns true if the highWaterMark has not been hit yet, // similar to how Writable.write() returns true if you should // write() some more. - - Readable.prototype.push = function (chunk, encoding) { var state = this._readableState; var skipChunkCheck; @@ -226,12 +232,10 @@ Readable.prototype.push = function (chunk, encoding) { if (!state.objectMode) { if (typeof chunk === 'string') { encoding = encoding || state.defaultEncoding; - if (encoding !== state.encoding) { chunk = Buffer.from(chunk, encoding); encoding = ''; } - skipChunkCheck = true; } } else { @@ -239,40 +243,34 @@ Readable.prototype.push = function (chunk, encoding) { } return readableAddChunk(this, chunk, encoding, false, skipChunkCheck); -}; // Unshift should *always* be something directly out of read() - +}; +// Unshift should *always* be something directly out of read() Readable.prototype.unshift = function (chunk) { return readableAddChunk(this, chunk, null, true, false); }; function readableAddChunk(stream, chunk, encoding, addToFront, skipChunkCheck) { - debug('readableAddChunk', chunk); var state = stream._readableState; - if (chunk === null) { state.reading = false; onEofChunk(stream, state); } else { var er; if (!skipChunkCheck) er = chunkInvalid(state, chunk); - if (er) { - errorOrDestroy(stream, er); + stream.emit('error', er); } else if (state.objectMode || chunk && chunk.length > 0) { if (typeof chunk !== 'string' && !state.objectMode && Object.getPrototypeOf(chunk) !== Buffer.prototype) { chunk = _uint8ArrayToBuffer(chunk); } if (addToFront) { - if (state.endEmitted) errorOrDestroy(stream, new ERR_STREAM_UNSHIFT_AFTER_END_EVENT());else addChunk(stream, state, chunk, true); + if (state.endEmitted) stream.emit('error', new Error('stream.unshift() after end event'));else addChunk(stream, state, chunk, true); } else if (state.ended) { - errorOrDestroy(stream, new ERR_STREAM_PUSH_AFTER_EOF()); - } else if (state.destroyed) { - return false; + stream.emit('error', new Error('stream.push() after EOF')); } else { state.reading = false; - if (state.decoder && !encoding) { chunk = state.decoder.write(chunk); if (state.objectMode || chunk.length !== 0) addChunk(stream, state, chunk, false);else maybeReadMore(stream, state); @@ -282,73 +280,61 @@ function readableAddChunk(stream, chunk, encoding, addToFront, skipChunkCheck) { } } else if (!addToFront) { state.reading = false; - maybeReadMore(stream, state); } - } // We can push more data if we are below the highWaterMark. - // Also, if we have no data yet, we can stand some more bytes. - // This is to work around cases where hwm=0, such as the repl. - + } - return !state.ended && (state.length < state.highWaterMark || state.length === 0); + return needMoreData(state); } function addChunk(stream, state, chunk, addToFront) { if (state.flowing && state.length === 0 && !state.sync) { - state.awaitDrain = 0; stream.emit('data', chunk); + stream.read(0); } else { // update the buffer info. state.length += state.objectMode ? 1 : chunk.length; if (addToFront) state.buffer.unshift(chunk);else state.buffer.push(chunk); + if (state.needReadable) emitReadable(stream); } - maybeReadMore(stream, state); } function chunkInvalid(state, chunk) { var er; - if (!_isUint8Array(chunk) && typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) { - er = new ERR_INVALID_ARG_TYPE('chunk', ['string', 'Buffer', 'Uint8Array'], chunk); + er = new TypeError('Invalid non-string/buffer chunk'); } - return er; } +// if it's past the high water mark, we can push in some more. +// Also, if we have no data yet, we can stand some +// more bytes. This is to work around cases where hwm=0, +// such as the repl. Also, if the push() triggered a +// readable event, and the user called read(largeNumber) such that +// needReadable was set, then we ought to push more, so that another +// 'readable' event will be triggered. +function needMoreData(state) { + return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0); +} + Readable.prototype.isPaused = function () { return this._readableState.flowing === false; -}; // backwards compatibility. - +}; +// backwards compatibility. Readable.prototype.setEncoding = function (enc) { if (!StringDecoder) StringDecoder = require('string_decoder/').StringDecoder; - var decoder = new StringDecoder(enc); - this._readableState.decoder = decoder; // If setEncoding(null), decoder.encoding equals utf8 - - this._readableState.encoding = this._readableState.decoder.encoding; // Iterate over current buffer to convert already stored Buffers: - - var p = this._readableState.buffer.head; - var content = ''; - - while (p !== null) { - content += decoder.write(p.data); - p = p.next; - } - - this._readableState.buffer.clear(); - - if (content !== '') this._readableState.buffer.push(content); - this._readableState.length = content.length; + this._readableState.decoder = new StringDecoder(enc); + this._readableState.encoding = enc; return this; -}; // Don't raise the hwm > 1GB - - -var MAX_HWM = 0x40000000; +}; +// Don't raise the hwm > 8MB +var MAX_HWM = 0x800000; function computeNewHighWaterMark(n) { if (n >= MAX_HWM) { - // TODO(ronag): Throw ERR_VALUE_OUT_OF_RANGE. n = MAX_HWM; } else { // Get the next highest power of 2 to prevent increasing hwm excessively in @@ -361,55 +347,56 @@ function computeNewHighWaterMark(n) { n |= n >>> 16; n++; } - return n; -} // This function is designed to be inlinable, so please take care when making -// changes to the function body. - +} +// This function is designed to be inlinable, so please take care when making +// changes to the function body. function howMuchToRead(n, state) { if (n <= 0 || state.length === 0 && state.ended) return 0; if (state.objectMode) return 1; - if (n !== n) { // Only flow one buffer at a time if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length; - } // If we're asking for more than the current hwm, then raise the hwm. - - + } + // If we're asking for more than the current hwm, then raise the hwm. if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n); - if (n <= state.length) return n; // Don't have enough - + if (n <= state.length) return n; + // Don't have enough if (!state.ended) { state.needReadable = true; return 0; } - return state.length; -} // you can override either this method, or the async _read(n) below. - +} +// you can override either this method, or the async _read(n) below. Readable.prototype.read = function (n) { debug('read', n); n = parseInt(n, 10); var state = this._readableState; var nOrig = n; - if (n !== 0) state.emittedReadable = false; // if we're doing read(0) to trigger a readable event, but we + + if (n !== 0) state.emittedReadable = false; + + // if we're doing read(0) to trigger a readable event, but we // already have a bunch of data in the buffer, then just trigger // the 'readable' event and move on. - - if (n === 0 && state.needReadable && ((state.highWaterMark !== 0 ? state.length >= state.highWaterMark : state.length > 0) || state.ended)) { + if (n === 0 && state.needReadable && (state.length >= state.highWaterMark || state.ended)) { debug('read: emitReadable', state.length, state.ended); if (state.length === 0 && state.ended) endReadable(this);else emitReadable(this); return null; } - n = howMuchToRead(n, state); // if we've ended, and we're now clear, then finish it up. + n = howMuchToRead(n, state); + // if we've ended, and we're now clear, then finish it up. if (n === 0 && state.ended) { if (state.length === 0) endReadable(this); return null; - } // All the actual chunk generation logic needs to be + } + + // All the actual chunk generation logic needs to be // *below* the call to _read. The reason is that in certain // synthetic stream cases, such as passthrough streams, _read // may be a completely synchronous operation which may change @@ -430,34 +417,33 @@ Readable.prototype.read = function (n) { // 'readable' etc. // // 3. Actually pull the requested chunks out of the buffer and return. - // if we need a readable event, then we need to do some reading. - + // if we need a readable event, then we need to do some reading. var doRead = state.needReadable; - debug('need readable', doRead); // if we currently have less than the highWaterMark, then also read some + debug('need readable', doRead); + // if we currently have less than the highWaterMark, then also read some if (state.length === 0 || state.length - n < state.highWaterMark) { doRead = true; debug('length less than watermark', doRead); - } // however, if we've ended, then there's no point, and if we're already - // reading, then it's unnecessary. - + } + // however, if we've ended, then there's no point, and if we're already + // reading, then it's unnecessary. if (state.ended || state.reading) { doRead = false; debug('reading or ended', doRead); } else if (doRead) { debug('do read'); state.reading = true; - state.sync = true; // if the length is currently zero, then we *need* a readable event. - - if (state.length === 0) state.needReadable = true; // call internal read method - + state.sync = true; + // if the length is currently zero, then we *need* a readable event. + if (state.length === 0) state.needReadable = true; + // call internal read method this._read(state.highWaterMark); - - state.sync = false; // If _read pushed data synchronously, then `reading` will be false, + state.sync = false; + // If _read pushed data synchronously, then `reading` will be false, // and we need to re-evaluate how much data we can return to the user. - if (!state.reading) n = howMuchToRead(nOrig, state); } @@ -465,144 +451,91 @@ Readable.prototype.read = function (n) { if (n > 0) ret = fromList(n, state);else ret = null; if (ret === null) { - state.needReadable = state.length <= state.highWaterMark; + state.needReadable = true; n = 0; } else { state.length -= n; - state.awaitDrain = 0; } if (state.length === 0) { // If we have nothing in the buffer, then we want to know // as soon as we *do* get something into the buffer. - if (!state.ended) state.needReadable = true; // If we tried to read() past the EOF, then emit end on the next tick. + if (!state.ended) state.needReadable = true; + // If we tried to read() past the EOF, then emit end on the next tick. if (nOrig !== n && state.ended) endReadable(this); } if (ret !== null) this.emit('data', ret); + return ret; }; function onEofChunk(stream, state) { - debug('onEofChunk'); if (state.ended) return; - if (state.decoder) { var chunk = state.decoder.end(); - if (chunk && chunk.length) { state.buffer.push(chunk); state.length += state.objectMode ? 1 : chunk.length; } } - state.ended = true; - if (state.sync) { - // if we are sync, wait until next tick to emit the data. - // Otherwise we risk emitting data in the flow() - // the readable code triggers during a read() call - emitReadable(stream); - } else { - // emit 'readable' now to make sure it gets picked up. - state.needReadable = false; + // emit 'readable' now to make sure it gets picked up. + emitReadable(stream); +} - if (!state.emittedReadable) { - state.emittedReadable = true; - emitReadable_(stream); - } - } -} // Don't emit readable right away in sync mode, because this can trigger +// Don't emit readable right away in sync mode, because this can trigger // another read() call => stack overflow. This way, it might trigger // a nextTick recursion warning, but that's not so bad. - - function emitReadable(stream) { var state = stream._readableState; - debug('emitReadable', state.needReadable, state.emittedReadable); state.needReadable = false; - if (!state.emittedReadable) { debug('emitReadable', state.flowing); state.emittedReadable = true; - process.nextTick(emitReadable_, stream); + if (state.sync) pna.nextTick(emitReadable_, stream);else emitReadable_(stream); } } function emitReadable_(stream) { - var state = stream._readableState; - debug('emitReadable_', state.destroyed, state.length, state.ended); - - if (!state.destroyed && (state.length || state.ended)) { - stream.emit('readable'); - state.emittedReadable = false; - } // The stream needs another readable event if - // 1. It is not flowing, as the flow mechanism will take - // care of it. - // 2. It is not ended. - // 3. It is below the highWaterMark, so we can schedule - // another readable later. - - - state.needReadable = !state.flowing && !state.ended && state.length <= state.highWaterMark; + debug('emit readable'); + stream.emit('readable'); flow(stream); -} // at this point, the user has presumably seen the 'readable' event, +} + +// at this point, the user has presumably seen the 'readable' event, // and called read() to consume some data. that may have triggered // in turn another _read(n) call, in which case reading = true if // it's in progress. // However, if we're not ended, or reading, and the length < hwm, // then go ahead and try to read some more preemptively. - - function maybeReadMore(stream, state) { if (!state.readingMore) { state.readingMore = true; - process.nextTick(maybeReadMore_, stream, state); + pna.nextTick(maybeReadMore_, stream, state); } } function maybeReadMore_(stream, state) { - // Attempt to read more data if we should. - // - // The conditions for reading more data are (one of): - // - Not enough data buffered (state.length < state.highWaterMark). The loop - // is responsible for filling the buffer with enough data if such data - // is available. If highWaterMark is 0 and we are not in the flowing mode - // we should _not_ attempt to buffer any extra data. We'll get more data - // when the stream consumer calls read() instead. - // - No data in the buffer, and the stream is in flowing mode. In this mode - // the loop below is responsible for ensuring read() is called. Failing to - // call read here would abort the flow and there's no other mechanism for - // continuing the flow if the stream consumer has just subscribed to the - // 'data' event. - // - // In addition to the above conditions to keep reading data, the following - // conditions prevent the data from being read: - // - The stream has ended (state.ended). - // - There is already a pending 'read' operation (state.reading). This is a - // case where the the stream has called the implementation defined _read() - // method, but they are processing the call asynchronously and have _not_ - // called push() with new data. In this case we skip performing more - // read()s. The execution ends in this method again after the _read() ends - // up calling push() with more data. - while (!state.reading && !state.ended && (state.length < state.highWaterMark || state.flowing && state.length === 0)) { - var len = state.length; + var len = state.length; + while (!state.reading && !state.flowing && !state.ended && state.length < state.highWaterMark) { debug('maybeReadMore read 0'); stream.read(0); - if (len === state.length) // didn't get any data, stop spinning. - break; + if (len === state.length) + // didn't get any data, stop spinning. + break;else len = state.length; } - state.readingMore = false; -} // abstract method. to be overridden in specific implementation classes. +} + +// abstract method. to be overridden in specific implementation classes. // call cb(er, data) where data is <= n in length. // for virtual (non-string, non-buffer) streams, "length" is somewhat // arbitrary, and perhaps not very meaningful. - - Readable.prototype._read = function (n) { - errorOrDestroy(this, new ERR_METHOD_NOT_IMPLEMENTED('_read()')); + this.emit('error', new Error('_read() is not implemented')); }; Readable.prototype.pipe = function (dest, pipeOpts) { @@ -613,26 +546,24 @@ Readable.prototype.pipe = function (dest, pipeOpts) { case 0: state.pipes = dest; break; - case 1: state.pipes = [state.pipes, dest]; break; - default: state.pipes.push(dest); break; } - state.pipesCount += 1; debug('pipe count=%d opts=%j', state.pipesCount, pipeOpts); + var doEnd = (!pipeOpts || pipeOpts.end !== false) && dest !== process.stdout && dest !== process.stderr; + var endFn = doEnd ? onend : unpipe; - if (state.endEmitted) process.nextTick(endFn);else src.once('end', endFn); - dest.on('unpipe', onunpipe); + if (state.endEmitted) pna.nextTick(endFn);else src.once('end', endFn); + dest.on('unpipe', onunpipe); function onunpipe(readable, unpipeInfo) { debug('onunpipe'); - if (readable === src) { if (unpipeInfo && unpipeInfo.hasUnpiped === false) { unpipeInfo.hasUnpiped = true; @@ -644,19 +575,19 @@ Readable.prototype.pipe = function (dest, pipeOpts) { function onend() { debug('onend'); dest.end(); - } // when the dest drains, it reduces the awaitDrain counter + } + + // when the dest drains, it reduces the awaitDrain counter // on the source. This would be more elegant with a .once() // handler in flow(), but adding and removing repeatedly is // too slow. - - var ondrain = pipeOnDrain(src); dest.on('drain', ondrain); - var cleanedUp = false; + var cleanedUp = false; function cleanup() { - debug('cleanup'); // cleanup event handlers once the pipe is broken - + debug('cleanup'); + // cleanup event handlers once the pipe is broken dest.removeListener('close', onclose); dest.removeListener('finish', onfinish); dest.removeListener('drain', ondrain); @@ -665,71 +596,75 @@ Readable.prototype.pipe = function (dest, pipeOpts) { src.removeListener('end', onend); src.removeListener('end', unpipe); src.removeListener('data', ondata); - cleanedUp = true; // if the reader is waiting for a drain event from this + + cleanedUp = true; + + // if the reader is waiting for a drain event from this // specific writer, then it would cause it to never start // flowing again. // So, if this is awaiting a drain, then we just call it now. // If we don't know, then assume that we are waiting for one. - if (state.awaitDrain && (!dest._writableState || dest._writableState.needDrain)) ondrain(); } + // If the user pushes more data while we're writing to dest then we'll end up + // in ondata again. However, we only want to increase awaitDrain once because + // dest will only emit one 'drain' event for the multiple writes. + // => Introduce a guard on increasing awaitDrain. + var increasedAwaitDrain = false; src.on('data', ondata); - function ondata(chunk) { debug('ondata'); + increasedAwaitDrain = false; var ret = dest.write(chunk); - debug('dest.write', ret); - - if (ret === false) { + if (false === ret && !increasedAwaitDrain) { // If the user unpiped during `dest.write()`, it is possible // to get stuck in a permanently paused state if that write // also returned false. // => Check whether `dest` is still a piping destination. if ((state.pipesCount === 1 && state.pipes === dest || state.pipesCount > 1 && indexOf(state.pipes, dest) !== -1) && !cleanedUp) { - debug('false write response, pause', state.awaitDrain); - state.awaitDrain++; + debug('false write response, pause', src._readableState.awaitDrain); + src._readableState.awaitDrain++; + increasedAwaitDrain = true; } - src.pause(); } - } // if the dest has an error, then stop piping into it. - // however, don't suppress the throwing behavior for this. - + } + // if the dest has an error, then stop piping into it. + // however, don't suppress the throwing behavior for this. function onerror(er) { debug('onerror', er); unpipe(); dest.removeListener('error', onerror); - if (EElistenerCount(dest, 'error') === 0) errorOrDestroy(dest, er); - } // Make sure our error handler is attached before userland ones. - + if (EElistenerCount(dest, 'error') === 0) dest.emit('error', er); + } - prependListener(dest, 'error', onerror); // Both close and finish should trigger unpipe, but only once. + // Make sure our error handler is attached before userland ones. + prependListener(dest, 'error', onerror); + // Both close and finish should trigger unpipe, but only once. function onclose() { dest.removeListener('finish', onfinish); unpipe(); } - dest.once('close', onclose); - function onfinish() { debug('onfinish'); dest.removeListener('close', onclose); unpipe(); } - dest.once('finish', onfinish); function unpipe() { debug('unpipe'); src.unpipe(dest); - } // tell the dest that it's being piped to - + } - dest.emit('pipe', src); // start the flow if it hasn't been started already. + // tell the dest that it's being piped to + dest.emit('pipe', src); + // start the flow if it hasn't been started already. if (!state.flowing) { debug('pipe resume'); src.resume(); @@ -739,11 +674,10 @@ Readable.prototype.pipe = function (dest, pipeOpts) { }; function pipeOnDrain(src) { - return function pipeOnDrainFunctionResult() { + return function () { var state = src._readableState; debug('pipeOnDrain', state.awaitDrain); if (state.awaitDrain) state.awaitDrain--; - if (state.awaitDrain === 0 && EElistenerCount(src, 'data')) { state.flowing = true; flow(src); @@ -753,24 +687,27 @@ function pipeOnDrain(src) { Readable.prototype.unpipe = function (dest) { var state = this._readableState; - var unpipeInfo = { - hasUnpiped: false - }; // if we're not piping anywhere, then do nothing. + var unpipeInfo = { hasUnpiped: false }; - if (state.pipesCount === 0) return this; // just one destination. most common case. + // if we're not piping anywhere, then do nothing. + if (state.pipesCount === 0) return this; + // just one destination. most common case. if (state.pipesCount === 1) { // passed in one, but it's not the right one. if (dest && dest !== state.pipes) return this; - if (!dest) dest = state.pipes; // got a match. + if (!dest) dest = state.pipes; + + // got a match. state.pipes = null; state.pipesCount = 0; state.flowing = false; if (dest) dest.emit('unpipe', this, unpipeInfo); return this; - } // slow case. multiple pipe destinations. + } + // slow case. multiple pipe destinations. if (!dest) { // remove all. @@ -781,139 +718,80 @@ Readable.prototype.unpipe = function (dest) { state.flowing = false; for (var i = 0; i < len; i++) { - dests[i].emit('unpipe', this, { - hasUnpiped: false - }); - } - - return this; - } // try to find the right one. - + dests[i].emit('unpipe', this, unpipeInfo); + }return this; + } + // try to find the right one. var index = indexOf(state.pipes, dest); if (index === -1) return this; + state.pipes.splice(index, 1); state.pipesCount -= 1; if (state.pipesCount === 1) state.pipes = state.pipes[0]; + dest.emit('unpipe', this, unpipeInfo); - return this; -}; // set up data events if they are asked for -// Ensure readable listeners eventually get something + return this; +}; +// set up data events if they are asked for +// Ensure readable listeners eventually get something Readable.prototype.on = function (ev, fn) { var res = Stream.prototype.on.call(this, ev, fn); - var state = this._readableState; if (ev === 'data') { - // update readableListening so that resume() may be a no-op - // a few lines down. This is needed to support once('readable'). - state.readableListening = this.listenerCount('readable') > 0; // Try start flowing on next tick if stream isn't explicitly paused - - if (state.flowing !== false) this.resume(); + // Start flowing on next tick if stream isn't explicitly paused + if (this._readableState.flowing !== false) this.resume(); } else if (ev === 'readable') { + var state = this._readableState; if (!state.endEmitted && !state.readableListening) { state.readableListening = state.needReadable = true; - state.flowing = false; state.emittedReadable = false; - debug('on readable', state.length, state.reading); - - if (state.length) { + if (!state.reading) { + pna.nextTick(nReadingNextTick, this); + } else if (state.length) { emitReadable(this); - } else if (!state.reading) { - process.nextTick(nReadingNextTick, this); } } } return res; }; - Readable.prototype.addListener = Readable.prototype.on; -Readable.prototype.removeListener = function (ev, fn) { - var res = Stream.prototype.removeListener.call(this, ev, fn); - - if (ev === 'readable') { - // We need to check if there is someone still listening to - // readable and reset the state. However this needs to happen - // after readable has been emitted but before I/O (nextTick) to - // support once('readable', fn) cycles. This means that calling - // resume within the same tick will have no - // effect. - process.nextTick(updateReadableListening, this); - } - - return res; -}; - -Readable.prototype.removeAllListeners = function (ev) { - var res = Stream.prototype.removeAllListeners.apply(this, arguments); - - if (ev === 'readable' || ev === undefined) { - // We need to check if there is someone still listening to - // readable and reset the state. However this needs to happen - // after readable has been emitted but before I/O (nextTick) to - // support once('readable', fn) cycles. This means that calling - // resume within the same tick will have no - // effect. - process.nextTick(updateReadableListening, this); - } - - return res; -}; - -function updateReadableListening(self) { - var state = self._readableState; - state.readableListening = self.listenerCount('readable') > 0; - - if (state.resumeScheduled && !state.paused) { - // flowing needs to be set to true now, otherwise - // the upcoming resume will not flow. - state.flowing = true; // crude way to check if we should resume - } else if (self.listenerCount('data') > 0) { - self.resume(); - } -} - function nReadingNextTick(self) { debug('readable nexttick read 0'); self.read(0); -} // pause() and resume() are remnants of the legacy readable stream API -// If the user uses them, then switch into old mode. - +} +// pause() and resume() are remnants of the legacy readable stream API +// If the user uses them, then switch into old mode. Readable.prototype.resume = function () { var state = this._readableState; - if (!state.flowing) { - debug('resume'); // we flow only if there is no one listening - // for readable, but we still have to call - // resume() - - state.flowing = !state.readableListening; + debug('resume'); + state.flowing = true; resume(this, state); } - - state.paused = false; return this; }; function resume(stream, state) { if (!state.resumeScheduled) { state.resumeScheduled = true; - process.nextTick(resume_, stream, state); + pna.nextTick(resume_, stream, state); } } function resume_(stream, state) { - debug('resume', state.reading); - if (!state.reading) { + debug('resume read 0'); stream.read(0); } state.resumeScheduled = false; + state.awaitDrain = 0; stream.emit('resume'); flow(stream); if (state.flowing && !state.reading) stream.read(0); @@ -921,37 +799,31 @@ function resume_(stream, state) { Readable.prototype.pause = function () { debug('call pause flowing=%j', this._readableState.flowing); - - if (this._readableState.flowing !== false) { + if (false !== this._readableState.flowing) { debug('pause'); this._readableState.flowing = false; this.emit('pause'); } - - this._readableState.paused = true; return this; }; function flow(stream) { var state = stream._readableState; debug('flow', state.flowing); + while (state.flowing && stream.read() !== null) {} +} - while (state.flowing && stream.read() !== null) { - ; - } -} // wrap an old-style stream as the async data source. +// wrap an old-style stream as the async data source. // This is *not* part of the readable stream interface. // It is an ugly unfortunate mess of history. - - Readable.prototype.wrap = function (stream) { var _this = this; var state = this._readableState; var paused = false; + stream.on('end', function () { debug('wrapped end'); - if (state.decoder && !state.ended) { var chunk = state.decoder.end(); if (chunk && chunk.length) _this.push(chunk); @@ -959,41 +831,42 @@ Readable.prototype.wrap = function (stream) { _this.push(null); }); + stream.on('data', function (chunk) { debug('wrapped data'); - if (state.decoder) chunk = state.decoder.write(chunk); // don't skip over falsy values in objectMode + if (state.decoder) chunk = state.decoder.write(chunk); + // don't skip over falsy values in objectMode if (state.objectMode && (chunk === null || chunk === undefined)) return;else if (!state.objectMode && (!chunk || !chunk.length)) return; var ret = _this.push(chunk); - if (!ret) { paused = true; stream.pause(); } - }); // proxy all the other methods. - // important when wrapping filters and duplexes. + }); + // proxy all the other methods. + // important when wrapping filters and duplexes. for (var i in stream) { if (this[i] === undefined && typeof stream[i] === 'function') { - this[i] = function methodWrap(method) { - return function methodWrapReturnFunction() { + this[i] = function (method) { + return function () { return stream[method].apply(stream, arguments); }; }(i); } - } // proxy certain important events. - + } + // proxy certain important events. for (var n = 0; n < kProxyEvents.length; n++) { stream.on(kProxyEvents[n], this.emit.bind(this, kProxyEvents[n])); - } // when we try to consume some more bytes, simply unpause the - // underlying stream. - + } + // when we try to consume some more bytes, simply unpause the + // underlying stream. this._read = function (n) { debug('wrapped _read', n); - if (paused) { paused = false; stream.resume(); @@ -1003,122 +876,144 @@ Readable.prototype.wrap = function (stream) { return this; }; -if (typeof Symbol === 'function') { - Readable.prototype[Symbol.asyncIterator] = function () { - if (createReadableStreamAsyncIterator === undefined) { - createReadableStreamAsyncIterator = require('./internal/streams/async_iterator'); - } - - return createReadableStreamAsyncIterator(this); - }; -} - Object.defineProperty(Readable.prototype, 'readableHighWaterMark', { // making it explicit this property is not enumerable // because otherwise some prototype manipulation in // userland will fail enumerable: false, - get: function get() { + get: function () { return this._readableState.highWaterMark; } }); -Object.defineProperty(Readable.prototype, 'readableBuffer', { - // making it explicit this property is not enumerable - // because otherwise some prototype manipulation in - // userland will fail - enumerable: false, - get: function get() { - return this._readableState && this._readableState.buffer; - } -}); -Object.defineProperty(Readable.prototype, 'readableFlowing', { - // making it explicit this property is not enumerable - // because otherwise some prototype manipulation in - // userland will fail - enumerable: false, - get: function get() { - return this._readableState.flowing; - }, - set: function set(state) { - if (this._readableState) { - this._readableState.flowing = state; - } - } -}); // exposed for testing purposes only. +// exposed for testing purposes only. Readable._fromList = fromList; -Object.defineProperty(Readable.prototype, 'readableLength', { - // making it explicit this property is not enumerable - // because otherwise some prototype manipulation in - // userland will fail - enumerable: false, - get: function get() { - return this._readableState.length; - } -}); // Pluck off n bytes from an array of buffers. + +// Pluck off n bytes from an array of buffers. // Length is the combined lengths of all the buffers in the list. // This function is designed to be inlinable, so please take care when making // changes to the function body. - function fromList(n, state) { // nothing buffered if (state.length === 0) return null; + var ret; if (state.objectMode) ret = state.buffer.shift();else if (!n || n >= state.length) { // read it all, truncate the list - if (state.decoder) ret = state.buffer.join('');else if (state.buffer.length === 1) ret = state.buffer.first();else ret = state.buffer.concat(state.length); + if (state.decoder) ret = state.buffer.join('');else if (state.buffer.length === 1) ret = state.buffer.head.data;else ret = state.buffer.concat(state.length); state.buffer.clear(); } else { // read part of list - ret = state.buffer.consume(n, state.decoder); + ret = fromListPartial(n, state.buffer, state.decoder); } + + return ret; +} + +// Extracts only enough buffered data to satisfy the amount requested. +// This function is designed to be inlinable, so please take care when making +// changes to the function body. +function fromListPartial(n, list, hasStrings) { + var ret; + if (n < list.head.data.length) { + // slice is the same for buffers and strings + ret = list.head.data.slice(0, n); + list.head.data = list.head.data.slice(n); + } else if (n === list.head.data.length) { + // first chunk is a perfect match + ret = list.shift(); + } else { + // result spans more than one buffer + ret = hasStrings ? copyFromBufferString(n, list) : copyFromBuffer(n, list); + } + return ret; +} + +// Copies a specified amount of characters from the list of buffered data +// chunks. +// This function is designed to be inlinable, so please take care when making +// changes to the function body. +function copyFromBufferString(n, list) { + var p = list.head; + var c = 1; + var ret = p.data; + n -= ret.length; + while (p = p.next) { + var str = p.data; + var nb = n > str.length ? str.length : n; + if (nb === str.length) ret += str;else ret += str.slice(0, n); + n -= nb; + if (n === 0) { + if (nb === str.length) { + ++c; + if (p.next) list.head = p.next;else list.head = list.tail = null; + } else { + list.head = p; + p.data = str.slice(nb); + } + break; + } + ++c; + } + list.length -= c; + return ret; +} + +// Copies a specified amount of bytes from the list of buffered data chunks. +// This function is designed to be inlinable, so please take care when making +// changes to the function body. +function copyFromBuffer(n, list) { + var ret = Buffer.allocUnsafe(n); + var p = list.head; + var c = 1; + p.data.copy(ret); + n -= p.data.length; + while (p = p.next) { + var buf = p.data; + var nb = n > buf.length ? buf.length : n; + buf.copy(ret, ret.length - n, 0, nb); + n -= nb; + if (n === 0) { + if (nb === buf.length) { + ++c; + if (p.next) list.head = p.next;else list.head = list.tail = null; + } else { + list.head = p; + p.data = buf.slice(nb); + } + break; + } + ++c; + } + list.length -= c; return ret; } function endReadable(stream) { var state = stream._readableState; - debug('endReadable', state.endEmitted); + + // If we get here before consuming all the bytes, then that is a + // bug in node. Should never happen. + if (state.length > 0) throw new Error('"endReadable()" called on non-empty stream'); if (!state.endEmitted) { state.ended = true; - process.nextTick(endReadableNT, state, stream); + pna.nextTick(endReadableNT, state, stream); } } function endReadableNT(state, stream) { - debug('endReadableNT', state.endEmitted, state.length); // Check that we didn't get one last unshift. - + // Check that we didn't get one last unshift. if (!state.endEmitted && state.length === 0) { state.endEmitted = true; stream.readable = false; stream.emit('end'); - - if (state.autoDestroy) { - // In case of duplex streams we need a way to detect - // if the writable side is ready for autoDestroy as well - var wState = stream._writableState; - - if (!wState || wState.autoDestroy && wState.finished) { - stream.destroy(); - } - } } } -if (typeof Symbol === 'function') { - Readable.from = function (iterable, opts) { - if (from === undefined) { - from = require('./internal/streams/from'); - } - - return from(Readable, iterable, opts); - }; -} - function indexOf(xs, x) { for (var i = 0, l = xs.length; i < l; i++) { if (xs[i] === x) return i; } - return -1; } \ No newline at end of file diff --git a/deps/npm/node_modules/readable-stream/lib/_stream_transform.js b/deps/npm/node_modules/readable-stream/lib/_stream_transform.js index 41a738c4e93599..fcfc105af8e9a1 100644 --- a/deps/npm/node_modules/readable-stream/lib/_stream_transform.js +++ b/deps/npm/node_modules/readable-stream/lib/_stream_transform.js @@ -18,6 +18,7 @@ // 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. + // a transform stream is a readable/writable stream where you do // something with the data. Sometimes it's called a "filter", // but that's not a great name for it, since that implies a thing where @@ -59,37 +60,40 @@ // However, even in such a pathological case, only a single written chunk // would be consumed, and then the rest would wait (un-transformed) until // the results of the previous transformed chunk were consumed. + 'use strict'; module.exports = Transform; -var _require$codes = require('../errors').codes, - ERR_METHOD_NOT_IMPLEMENTED = _require$codes.ERR_METHOD_NOT_IMPLEMENTED, - ERR_MULTIPLE_CALLBACK = _require$codes.ERR_MULTIPLE_CALLBACK, - ERR_TRANSFORM_ALREADY_TRANSFORMING = _require$codes.ERR_TRANSFORM_ALREADY_TRANSFORMING, - ERR_TRANSFORM_WITH_LENGTH_0 = _require$codes.ERR_TRANSFORM_WITH_LENGTH_0; - var Duplex = require('./_stream_duplex'); -require('inherits')(Transform, Duplex); +/**/ +var util = Object.create(require('core-util-is')); +util.inherits = require('inherits'); +/**/ + +util.inherits(Transform, Duplex); function afterTransform(er, data) { var ts = this._transformState; ts.transforming = false; + var cb = ts.writecb; - if (cb === null) { - return this.emit('error', new ERR_MULTIPLE_CALLBACK()); + if (!cb) { + return this.emit('error', new Error('write callback called multiple times')); } ts.writechunk = null; ts.writecb = null; + if (data != null) // single equals check for both `null` and `undefined` this.push(data); + cb(er); + var rs = this._readableState; rs.reading = false; - if (rs.needReadable || rs.length < rs.highWaterMark) { this._read(rs.highWaterMark); } @@ -97,7 +101,9 @@ function afterTransform(er, data) { function Transform(options) { if (!(this instanceof Transform)) return new Transform(options); + Duplex.call(this, options); + this._transformState = { afterTransform: afterTransform.bind(this), needTransform: false, @@ -105,27 +111,30 @@ function Transform(options) { writecb: null, writechunk: null, writeencoding: null - }; // start out asking for a readable event once data is transformed. + }; + + // start out asking for a readable event once data is transformed. + this._readableState.needReadable = true; - this._readableState.needReadable = true; // we have implemented the _read method, and done the other things + // we have implemented the _read method, and done the other things // that Readable wants before the first _read call, so unset the // sync guard flag. - this._readableState.sync = false; if (options) { if (typeof options.transform === 'function') this._transform = options.transform; - if (typeof options.flush === 'function') this._flush = options.flush; - } // When the writable side finishes, then flush out anything remaining. + if (typeof options.flush === 'function') this._flush = options.flush; + } + // When the writable side finishes, then flush out anything remaining. this.on('prefinish', prefinish); } function prefinish() { var _this = this; - if (typeof this._flush === 'function' && !this._readableState.destroyed) { + if (typeof this._flush === 'function') { this._flush(function (er, data) { done(_this, er, data); }); @@ -137,7 +146,9 @@ function prefinish() { Transform.prototype.push = function (chunk, encoding) { this._transformState.needTransform = false; return Duplex.prototype.push.call(this, chunk, encoding); -}; // This is the part where you do stuff! +}; + +// This is the part where you do stuff! // override this function in implementation classes. // 'chunk' is an input chunk. // @@ -147,10 +158,8 @@ Transform.prototype.push = function (chunk, encoding) { // Call `cb(err)` when you are done with this chunk. If you pass // an error, then that'll put the hurt on the whole operation. If you // never call cb(), then you'll never get another chunk. - - Transform.prototype._transform = function (chunk, encoding, cb) { - cb(new ERR_METHOD_NOT_IMPLEMENTED('_transform()')); + throw new Error('_transform() is not implemented'); }; Transform.prototype._write = function (chunk, encoding, cb) { @@ -158,22 +167,20 @@ Transform.prototype._write = function (chunk, encoding, cb) { ts.writecb = cb; ts.writechunk = chunk; ts.writeencoding = encoding; - if (!ts.transforming) { var rs = this._readableState; if (ts.needTransform || rs.needReadable || rs.length < rs.highWaterMark) this._read(rs.highWaterMark); } -}; // Doesn't matter what the args are here. +}; + +// Doesn't matter what the args are here. // _transform does all the work. // That we got here means that the readable side wants more data. - - Transform.prototype._read = function (n) { var ts = this._transformState; - if (ts.writechunk !== null && !ts.transforming) { + if (ts.writechunk !== null && ts.writecb && !ts.transforming) { ts.transforming = true; - this._transform(ts.writechunk, ts.writeencoding, ts.afterTransform); } else { // mark that we need a transform, so that any data that comes in @@ -183,19 +190,25 @@ Transform.prototype._read = function (n) { }; Transform.prototype._destroy = function (err, cb) { + var _this2 = this; + Duplex.prototype._destroy.call(this, err, function (err2) { cb(err2); + _this2.emit('close'); }); }; function done(stream, er, data) { if (er) return stream.emit('error', er); + if (data != null) // single equals check for both `null` and `undefined` - stream.push(data); // TODO(BridgeAR): Write a test for these two error cases + stream.push(data); + // if there's nothing in the write buffer, then that means // that nothing more will ever be provided + if (stream._writableState.length) throw new Error('Calling transform done when ws.length != 0'); + + if (stream._transformState.transforming) throw new Error('Calling transform done when still transforming'); - if (stream._writableState.length) throw new ERR_TRANSFORM_WITH_LENGTH_0(); - if (stream._transformState.transforming) throw new ERR_TRANSFORM_ALREADY_TRANSFORMING(); return stream.push(null); } \ No newline at end of file diff --git a/deps/npm/node_modules/readable-stream/lib/_stream_writable.js b/deps/npm/node_modules/readable-stream/lib/_stream_writable.js index a2634d7c24fd5e..b0b02200cd7233 100644 --- a/deps/npm/node_modules/readable-stream/lib/_stream_writable.js +++ b/deps/npm/node_modules/readable-stream/lib/_stream_writable.js @@ -18,29 +18,35 @@ // 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. + // A bit simpler than readable streams. // Implement an async ._write(chunk, encoding, cb), and it'll handle all // the drain event emission and buffering. + 'use strict'; +/**/ + +var pna = require('process-nextick-args'); +/**/ + module.exports = Writable; -/* */ +/* */ function WriteReq(chunk, encoding, cb) { this.chunk = chunk; this.encoding = encoding; this.callback = cb; this.next = null; -} // It seems a linked list but it is not -// there will be only 2 of these for each stream - +} +// It seems a linked list but it is not +// there will be only 2 of these for each stream function CorkedRequest(state) { var _this = this; this.next = null; this.entry = null; - this.finish = function () { onCorkedFinish(_this, state); }; @@ -48,247 +54,266 @@ function CorkedRequest(state) { /* */ /**/ +var asyncWrite = !process.browser && ['v0.10', 'v0.9.'].indexOf(process.version.slice(0, 5)) > -1 ? setImmediate : pna.nextTick; +/**/ - +/**/ var Duplex; /**/ Writable.WritableState = WritableState; + /**/ +var util = Object.create(require('core-util-is')); +util.inherits = require('inherits'); +/**/ +/**/ var internalUtil = { deprecate: require('util-deprecate') }; /**/ /**/ - var Stream = require('./internal/streams/stream'); /**/ +/**/ -var Buffer = require('buffer').Buffer; - +var Buffer = require('safe-buffer').Buffer; var OurUint8Array = global.Uint8Array || function () {}; - function _uint8ArrayToBuffer(chunk) { return Buffer.from(chunk); } - function _isUint8Array(obj) { return Buffer.isBuffer(obj) || obj instanceof OurUint8Array; } -var destroyImpl = require('./internal/streams/destroy'); - -var _require = require('./internal/streams/state'), - getHighWaterMark = _require.getHighWaterMark; - -var _require$codes = require('../errors').codes, - ERR_INVALID_ARG_TYPE = _require$codes.ERR_INVALID_ARG_TYPE, - ERR_METHOD_NOT_IMPLEMENTED = _require$codes.ERR_METHOD_NOT_IMPLEMENTED, - ERR_MULTIPLE_CALLBACK = _require$codes.ERR_MULTIPLE_CALLBACK, - ERR_STREAM_CANNOT_PIPE = _require$codes.ERR_STREAM_CANNOT_PIPE, - ERR_STREAM_DESTROYED = _require$codes.ERR_STREAM_DESTROYED, - ERR_STREAM_NULL_VALUES = _require$codes.ERR_STREAM_NULL_VALUES, - ERR_STREAM_WRITE_AFTER_END = _require$codes.ERR_STREAM_WRITE_AFTER_END, - ERR_UNKNOWN_ENCODING = _require$codes.ERR_UNKNOWN_ENCODING; +/**/ -var errorOrDestroy = destroyImpl.errorOrDestroy; +var destroyImpl = require('./internal/streams/destroy'); -require('inherits')(Writable, Stream); +util.inherits(Writable, Stream); function nop() {} -function WritableState(options, stream, isDuplex) { +function WritableState(options, stream) { Duplex = Duplex || require('./_stream_duplex'); - options = options || {}; // Duplex streams are both readable and writable, but share + + options = options || {}; + + // Duplex streams are both readable and writable, but share // the same options object. // However, some cases require setting options to different - // values for the readable and the writable sides of the duplex stream, - // e.g. options.readableObjectMode vs. options.writableObjectMode, etc. + // values for the readable and the writable sides of the duplex stream. + // These options can be provided separately as readableXXX and writableXXX. + var isDuplex = stream instanceof Duplex; - if (typeof isDuplex !== 'boolean') isDuplex = stream instanceof Duplex; // object stream flag to indicate whether or not this stream + // object stream flag to indicate whether or not this stream // contains buffers or objects. - this.objectMode = !!options.objectMode; - if (isDuplex) this.objectMode = this.objectMode || !!options.writableObjectMode; // the point at which write() starts returning false + + if (isDuplex) this.objectMode = this.objectMode || !!options.writableObjectMode; + + // the point at which write() starts returning false // Note: 0 is a valid value, means that we always return false if // the entire buffer is not flushed immediately on write() + var hwm = options.highWaterMark; + var writableHwm = options.writableHighWaterMark; + var defaultHwm = this.objectMode ? 16 : 16 * 1024; - this.highWaterMark = getHighWaterMark(this, options, 'writableHighWaterMark', isDuplex); // if _final has been called - - this.finalCalled = false; // drain event flag. + if (hwm || hwm === 0) this.highWaterMark = hwm;else if (isDuplex && (writableHwm || writableHwm === 0)) this.highWaterMark = writableHwm;else this.highWaterMark = defaultHwm; - this.needDrain = false; // at the start of calling end() + // cast to ints. + this.highWaterMark = Math.floor(this.highWaterMark); - this.ending = false; // when end() has been called, and returned + // if _final has been called + this.finalCalled = false; - this.ended = false; // when 'finish' is emitted + // drain event flag. + this.needDrain = false; + // at the start of calling end() + this.ending = false; + // when end() has been called, and returned + this.ended = false; + // when 'finish' is emitted + this.finished = false; - this.finished = false; // has it been destroyed + // has it been destroyed + this.destroyed = false; - this.destroyed = false; // should we decode strings into buffers before passing to _write? + // should we decode strings into buffers before passing to _write? // this is here so that some node-core streams can optimize string // handling at a lower level. - var noDecode = options.decodeStrings === false; - this.decodeStrings = !noDecode; // Crypto is kind of old and crusty. Historically, its default string + this.decodeStrings = !noDecode; + + // Crypto is kind of old and crusty. Historically, its default string // encoding is 'binary' so we have to make this configurable. // Everything else in the universe uses 'utf8', though. + this.defaultEncoding = options.defaultEncoding || 'utf8'; - this.defaultEncoding = options.defaultEncoding || 'utf8'; // not an actual buffer we keep track of, but a measurement + // not an actual buffer we keep track of, but a measurement // of how much we're waiting to get pushed to some underlying // socket or file. + this.length = 0; - this.length = 0; // a flag to see when we're in the middle of a write. + // a flag to see when we're in the middle of a write. + this.writing = false; - this.writing = false; // when true all writes will be buffered until .uncork() call + // when true all writes will be buffered until .uncork() call + this.corked = 0; - this.corked = 0; // a flag to be able to tell if the onwrite cb is called immediately, + // a flag to be able to tell if the onwrite cb is called immediately, // or on a later tick. We set this to true at first, because any // actions that shouldn't happen until "later" should generally also // not happen before the first write call. + this.sync = true; - this.sync = true; // a flag to know if we're processing previously buffered items, which + // a flag to know if we're processing previously buffered items, which // may call the _write() callback in the same tick, so that we don't // end up in an overlapped onwrite situation. + this.bufferProcessing = false; - this.bufferProcessing = false; // the callback that's passed to _write(chunk,cb) - + // the callback that's passed to _write(chunk,cb) this.onwrite = function (er) { onwrite(stream, er); - }; // the callback that the user supplies to write(chunk,encoding,cb) - + }; - this.writecb = null; // the amount that is being written when _write is called. + // the callback that the user supplies to write(chunk,encoding,cb) + this.writecb = null; + // the amount that is being written when _write is called. this.writelen = 0; + this.bufferedRequest = null; - this.lastBufferedRequest = null; // number of pending user-supplied write callbacks + this.lastBufferedRequest = null; + + // number of pending user-supplied write callbacks // this must be 0 before 'finish' can be emitted + this.pendingcb = 0; - this.pendingcb = 0; // emit prefinish if the only thing we're waiting for is _write cbs + // emit prefinish if the only thing we're waiting for is _write cbs // This is relevant for synchronous Transform streams + this.prefinished = false; - this.prefinished = false; // True if the error was already emitted and should not be thrown again + // True if the error was already emitted and should not be thrown again + this.errorEmitted = false; - this.errorEmitted = false; // Should close be emitted on destroy. Defaults to true. + // count buffered requests + this.bufferedRequestCount = 0; - this.emitClose = options.emitClose !== false; // Should .destroy() be called after 'finish' (and potentially 'end') - - this.autoDestroy = !!options.autoDestroy; // count buffered requests - - this.bufferedRequestCount = 0; // allocate the first CorkedRequest, there is always + // allocate the first CorkedRequest, there is always // one allocated and free to use, and we maintain at most two - this.corkedRequestsFree = new CorkedRequest(this); } WritableState.prototype.getBuffer = function getBuffer() { var current = this.bufferedRequest; var out = []; - while (current) { out.push(current); current = current.next; } - return out; }; (function () { try { Object.defineProperty(WritableState.prototype, 'buffer', { - get: internalUtil.deprecate(function writableStateBufferGetter() { + get: internalUtil.deprecate(function () { return this.getBuffer(); }, '_writableState.buffer is deprecated. Use _writableState.getBuffer ' + 'instead.', 'DEP0003') }); } catch (_) {} -})(); // Test _writableState for inheritance to account for Duplex streams, -// whose prototype chain only points to Readable. - +})(); +// Test _writableState for inheritance to account for Duplex streams, +// whose prototype chain only points to Readable. var realHasInstance; - if (typeof Symbol === 'function' && Symbol.hasInstance && typeof Function.prototype[Symbol.hasInstance] === 'function') { realHasInstance = Function.prototype[Symbol.hasInstance]; Object.defineProperty(Writable, Symbol.hasInstance, { - value: function value(object) { + value: function (object) { if (realHasInstance.call(this, object)) return true; if (this !== Writable) return false; + return object && object._writableState instanceof WritableState; } }); } else { - realHasInstance = function realHasInstance(object) { + realHasInstance = function (object) { return object instanceof this; }; } function Writable(options) { - Duplex = Duplex || require('./_stream_duplex'); // Writable ctor is applied to Duplexes, too. + Duplex = Duplex || require('./_stream_duplex'); + + // Writable ctor is applied to Duplexes, too. // `realHasInstance` is necessary because using plain `instanceof` // would return false, as no `_writableState` property is attached. + // Trying to use the custom `instanceof` for Writable here will also break the // Node.js LazyTransform implementation, which has a non-trivial getter for // `_writableState` that would lead to infinite recursion. - // Checking for a Stream.Duplex instance is faster here instead of inside - // the WritableState constructor, at least with V8 6.5 + if (!realHasInstance.call(Writable, this) && !(this instanceof Duplex)) { + return new Writable(options); + } - var isDuplex = this instanceof Duplex; - if (!isDuplex && !realHasInstance.call(Writable, this)) return new Writable(options); - this._writableState = new WritableState(options, this, isDuplex); // legacy. + this._writableState = new WritableState(options, this); + // legacy. this.writable = true; if (options) { if (typeof options.write === 'function') this._write = options.write; + if (typeof options.writev === 'function') this._writev = options.writev; + if (typeof options.destroy === 'function') this._destroy = options.destroy; + if (typeof options.final === 'function') this._final = options.final; } Stream.call(this); -} // Otherwise people can pipe Writable streams, which is just wrong. - +} +// Otherwise people can pipe Writable streams, which is just wrong. Writable.prototype.pipe = function () { - errorOrDestroy(this, new ERR_STREAM_CANNOT_PIPE()); + this.emit('error', new Error('Cannot pipe, not readable')); }; function writeAfterEnd(stream, cb) { - var er = new ERR_STREAM_WRITE_AFTER_END(); // TODO: defer error events consistently everywhere, not just the cb + var er = new Error('write after end'); + // TODO: defer error events consistently everywhere, not just the cb + stream.emit('error', er); + pna.nextTick(cb, er); +} - errorOrDestroy(stream, er); - process.nextTick(cb, er); -} // Checks that a user-supplied chunk is valid, especially for the particular +// Checks that a user-supplied chunk is valid, especially for the particular // mode the stream is in. Currently this means that `null` is never accepted // and undefined/non-string values are only allowed in object mode. - - function validChunk(stream, state, chunk, cb) { - var er; + var valid = true; + var er = false; if (chunk === null) { - er = new ERR_STREAM_NULL_VALUES(); - } else if (typeof chunk !== 'string' && !state.objectMode) { - er = new ERR_INVALID_ARG_TYPE('chunk', ['string', 'Buffer'], chunk); + er = new TypeError('May not write null values to stream'); + } else if (typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) { + er = new TypeError('Invalid non-string/buffer chunk'); } - if (er) { - errorOrDestroy(stream, er); - process.nextTick(cb, er); - return false; + stream.emit('error', er); + pna.nextTick(cb, er); + valid = false; } - - return true; + return valid; } Writable.prototype.write = function (chunk, encoding, cb) { var state = this._writableState; var ret = false; - var isBuf = !state.objectMode && _isUint8Array(chunk); if (isBuf && !Buffer.isBuffer(chunk)) { @@ -301,16 +326,21 @@ Writable.prototype.write = function (chunk, encoding, cb) { } if (isBuf) encoding = 'buffer';else if (!encoding) encoding = state.defaultEncoding; + if (typeof cb !== 'function') cb = nop; - if (state.ending) writeAfterEnd(this, cb);else if (isBuf || validChunk(this, state, chunk, cb)) { + + if (state.ended) writeAfterEnd(this, cb);else if (isBuf || validChunk(this, state, chunk, cb)) { state.pendingcb++; ret = writeOrBuffer(this, state, isBuf, chunk, encoding, cb); } + return ret; }; Writable.prototype.cork = function () { - this._writableState.corked++; + var state = this._writableState; + + state.corked++; }; Writable.prototype.uncork = function () { @@ -318,33 +348,23 @@ Writable.prototype.uncork = function () { if (state.corked) { state.corked--; - if (!state.writing && !state.corked && !state.bufferProcessing && state.bufferedRequest) clearBuffer(this, state); + + if (!state.writing && !state.corked && !state.finished && !state.bufferProcessing && state.bufferedRequest) clearBuffer(this, state); } }; Writable.prototype.setDefaultEncoding = function setDefaultEncoding(encoding) { // node::ParseEncoding() requires lower case. if (typeof encoding === 'string') encoding = encoding.toLowerCase(); - if (!(['hex', 'utf8', 'utf-8', 'ascii', 'binary', 'base64', 'ucs2', 'ucs-2', 'utf16le', 'utf-16le', 'raw'].indexOf((encoding + '').toLowerCase()) > -1)) throw new ERR_UNKNOWN_ENCODING(encoding); + if (!(['hex', 'utf8', 'utf-8', 'ascii', 'binary', 'base64', 'ucs2', 'ucs-2', 'utf16le', 'utf-16le', 'raw'].indexOf((encoding + '').toLowerCase()) > -1)) throw new TypeError('Unknown encoding: ' + encoding); this._writableState.defaultEncoding = encoding; return this; }; -Object.defineProperty(Writable.prototype, 'writableBuffer', { - // making it explicit this property is not enumerable - // because otherwise some prototype manipulation in - // userland will fail - enumerable: false, - get: function get() { - return this._writableState && this._writableState.getBuffer(); - } -}); - function decodeChunk(state, chunk, encoding) { if (!state.objectMode && state.decodeStrings !== false && typeof chunk === 'string') { chunk = Buffer.from(chunk, encoding); } - return chunk; } @@ -353,28 +373,29 @@ Object.defineProperty(Writable.prototype, 'writableHighWaterMark', { // because otherwise some prototype manipulation in // userland will fail enumerable: false, - get: function get() { + get: function () { return this._writableState.highWaterMark; } -}); // if we're already writing something, then just put this +}); + +// if we're already writing something, then just put this // in the queue, and wait our turn. Otherwise, call _write // If we return false, then we need a drain event, so set that flag. - function writeOrBuffer(stream, state, isBuf, chunk, encoding, cb) { if (!isBuf) { var newChunk = decodeChunk(state, chunk, encoding); - if (chunk !== newChunk) { isBuf = true; encoding = 'buffer'; chunk = newChunk; } } - var len = state.objectMode ? 1 : chunk.length; + state.length += len; - var ret = state.length < state.highWaterMark; // we must ensure that previous needDrain will not be reset to false. + var ret = state.length < state.highWaterMark; + // we must ensure that previous needDrain will not be reset to false. if (!ret) state.needDrain = true; if (state.writing || state.corked) { @@ -386,13 +407,11 @@ function writeOrBuffer(stream, state, isBuf, chunk, encoding, cb) { callback: cb, next: null }; - if (last) { last.next = state.lastBufferedRequest; } else { state.bufferedRequest = state.lastBufferedRequest; } - state.bufferedRequestCount += 1; } else { doWrite(stream, state, false, len, chunk, encoding, cb); @@ -406,7 +425,7 @@ function doWrite(stream, state, writev, len, chunk, encoding, cb) { state.writecb = cb; state.writing = true; state.sync = true; - if (state.destroyed) state.onwrite(new ERR_STREAM_DESTROYED('write'));else if (writev) stream._writev(chunk, state.onwrite);else stream._write(chunk, encoding, state.onwrite); + if (writev) stream._writev(chunk, state.onwrite);else stream._write(chunk, encoding, state.onwrite); state.sync = false; } @@ -416,20 +435,20 @@ function onwriteError(stream, state, sync, er, cb) { if (sync) { // defer the callback if we are being called synchronously // to avoid piling up things on the stack - process.nextTick(cb, er); // this can emit finish, and it will always happen + pna.nextTick(cb, er); + // this can emit finish, and it will always happen // after error - - process.nextTick(finishMaybe, stream, state); + pna.nextTick(finishMaybe, stream, state); stream._writableState.errorEmitted = true; - errorOrDestroy(stream, er); + stream.emit('error', er); } else { // the caller expect this to happen before if // it is async cb(er); stream._writableState.errorEmitted = true; - errorOrDestroy(stream, er); // this can emit finish, but finish must + stream.emit('error', er); + // this can emit finish, but finish must // always follow error - finishMaybe(stream, state); } } @@ -445,18 +464,21 @@ function onwrite(stream, er) { var state = stream._writableState; var sync = state.sync; var cb = state.writecb; - if (typeof cb !== 'function') throw new ERR_MULTIPLE_CALLBACK(); + onwriteStateUpdate(state); + if (er) onwriteError(stream, state, sync, er, cb);else { // Check if we're actually ready to finish, but don't emit yet - var finished = needFinish(state) || stream.destroyed; + var finished = needFinish(state); if (!finished && !state.corked && !state.bufferProcessing && state.bufferedRequest) { clearBuffer(stream, state); } if (sync) { - process.nextTick(afterWrite, stream, state, finished, cb); + /**/ + asyncWrite(afterWrite, stream, state, finished, cb); + /**/ } else { afterWrite(stream, state, finished, cb); } @@ -468,19 +490,19 @@ function afterWrite(stream, state, finished, cb) { state.pendingcb--; cb(); finishMaybe(stream, state); -} // Must force callback to be called on nextTick, so that we don't +} + +// Must force callback to be called on nextTick, so that we don't // emit 'drain' before the write() consumer gets the 'false' return // value, and has a chance to attach a 'drain' listener. - - function onwriteDrain(stream, state) { if (state.length === 0 && state.needDrain) { state.needDrain = false; stream.emit('drain'); } -} // if there's something in the buffer waiting, then process it - +} +// if there's something in the buffer waiting, then process it function clearBuffer(stream, state) { state.bufferProcessing = true; var entry = state.bufferedRequest; @@ -491,30 +513,29 @@ function clearBuffer(stream, state) { var buffer = new Array(l); var holder = state.corkedRequestsFree; holder.entry = entry; + var count = 0; var allBuffers = true; - while (entry) { buffer[count] = entry; if (!entry.isBuf) allBuffers = false; entry = entry.next; count += 1; } - buffer.allBuffers = allBuffers; - doWrite(stream, state, true, state.length, buffer, '', holder.finish); // doWrite is almost always async, defer these to save a bit of time - // as the hot path ends with doWrite + doWrite(stream, state, true, state.length, buffer, '', holder.finish); + + // doWrite is almost always async, defer these to save a bit of time + // as the hot path ends with doWrite state.pendingcb++; state.lastBufferedRequest = null; - if (holder.next) { state.corkedRequestsFree = holder.next; holder.next = null; } else { state.corkedRequestsFree = new CorkedRequest(state); } - state.bufferedRequestCount = 0; } else { // Slow case, write chunks one-by-one @@ -523,13 +544,14 @@ function clearBuffer(stream, state) { var encoding = entry.encoding; var cb = entry.callback; var len = state.objectMode ? 1 : chunk.length; + doWrite(stream, state, false, len, chunk, encoding, cb); entry = entry.next; - state.bufferedRequestCount--; // if we didn't call the onwrite immediately, then + state.bufferedRequestCount--; + // if we didn't call the onwrite immediately, then // it means that we need to wait until it does. // also, that means that the chunk and cb are currently // being processed, so move the buffer counter past them. - if (state.writing) { break; } @@ -543,7 +565,7 @@ function clearBuffer(stream, state) { } Writable.prototype._write = function (chunk, encoding, cb) { - cb(new ERR_METHOD_NOT_IMPLEMENTED('_write()')); + cb(new Error('_write() is not implemented')); }; Writable.prototype._writev = null; @@ -560,52 +582,38 @@ Writable.prototype.end = function (chunk, encoding, cb) { encoding = null; } - if (chunk !== null && chunk !== undefined) this.write(chunk, encoding); // .end() fully uncorks + if (chunk !== null && chunk !== undefined) this.write(chunk, encoding); + // .end() fully uncorks if (state.corked) { state.corked = 1; this.uncork(); - } // ignore unnecessary end() calls. - + } - if (!state.ending) endWritable(this, state, cb); - return this; + // ignore unnecessary end() calls. + if (!state.ending && !state.finished) endWritable(this, state, cb); }; -Object.defineProperty(Writable.prototype, 'writableLength', { - // making it explicit this property is not enumerable - // because otherwise some prototype manipulation in - // userland will fail - enumerable: false, - get: function get() { - return this._writableState.length; - } -}); - function needFinish(state) { return state.ending && state.length === 0 && state.bufferedRequest === null && !state.finished && !state.writing; } - function callFinal(stream, state) { stream._final(function (err) { state.pendingcb--; - if (err) { - errorOrDestroy(stream, err); + stream.emit('error', err); } - state.prefinished = true; stream.emit('prefinish'); finishMaybe(stream, state); }); } - function prefinish(stream, state) { if (!state.prefinished && !state.finalCalled) { - if (typeof stream._final === 'function' && !state.destroyed) { + if (typeof stream._final === 'function') { state.pendingcb++; state.finalCalled = true; - process.nextTick(callFinal, stream, state); + pna.nextTick(callFinal, stream, state); } else { state.prefinished = true; stream.emit('prefinish'); @@ -615,37 +623,22 @@ function prefinish(stream, state) { function finishMaybe(stream, state) { var need = needFinish(state); - if (need) { prefinish(stream, state); - if (state.pendingcb === 0) { state.finished = true; stream.emit('finish'); - - if (state.autoDestroy) { - // In case of duplex streams we need a way to detect - // if the readable side is ready for autoDestroy as well - var rState = stream._readableState; - - if (!rState || rState.autoDestroy && rState.endEmitted) { - stream.destroy(); - } - } } } - return need; } function endWritable(stream, state, cb) { state.ending = true; finishMaybe(stream, state); - if (cb) { - if (state.finished) process.nextTick(cb);else stream.once('finish', cb); + if (state.finished) pna.nextTick(cb);else stream.once('finish', cb); } - state.ended = true; stream.writable = false; } @@ -653,45 +646,42 @@ function endWritable(stream, state, cb) { function onCorkedFinish(corkReq, state, err) { var entry = corkReq.entry; corkReq.entry = null; - while (entry) { var cb = entry.callback; state.pendingcb--; cb(err); entry = entry.next; - } // reuse the free corkReq. - - - state.corkedRequestsFree.next = corkReq; + } + if (state.corkedRequestsFree) { + state.corkedRequestsFree.next = corkReq; + } else { + state.corkedRequestsFree = corkReq; + } } Object.defineProperty(Writable.prototype, 'destroyed', { - // making it explicit this property is not enumerable - // because otherwise some prototype manipulation in - // userland will fail - enumerable: false, - get: function get() { + get: function () { if (this._writableState === undefined) { return false; } - return this._writableState.destroyed; }, - set: function set(value) { + set: function (value) { // we ignore the value if the stream // has not been initialized yet if (!this._writableState) { return; - } // backward compatibility, the user is explicitly - // managing destroyed - + } + // backward compatibility, the user is explicitly + // managing destroyed this._writableState.destroyed = value; } }); + Writable.prototype.destroy = destroyImpl.destroy; Writable.prototype._undestroy = destroyImpl.undestroy; - Writable.prototype._destroy = function (err, cb) { + this.end(); cb(err); }; \ No newline at end of file diff --git a/deps/npm/node_modules/are-we-there-yet/node_modules/readable-stream/lib/internal/streams/BufferList.js b/deps/npm/node_modules/readable-stream/lib/internal/streams/BufferList.js similarity index 100% rename from deps/npm/node_modules/are-we-there-yet/node_modules/readable-stream/lib/internal/streams/BufferList.js rename to deps/npm/node_modules/readable-stream/lib/internal/streams/BufferList.js diff --git a/deps/npm/node_modules/readable-stream/lib/internal/streams/async_iterator.js b/deps/npm/node_modules/readable-stream/lib/internal/streams/async_iterator.js deleted file mode 100644 index 9fb615a2f3bc44..00000000000000 --- a/deps/npm/node_modules/readable-stream/lib/internal/streams/async_iterator.js +++ /dev/null @@ -1,207 +0,0 @@ -'use strict'; - -var _Object$setPrototypeO; - -function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } - -var finished = require('./end-of-stream'); - -var kLastResolve = Symbol('lastResolve'); -var kLastReject = Symbol('lastReject'); -var kError = Symbol('error'); -var kEnded = Symbol('ended'); -var kLastPromise = Symbol('lastPromise'); -var kHandlePromise = Symbol('handlePromise'); -var kStream = Symbol('stream'); - -function createIterResult(value, done) { - return { - value: value, - done: done - }; -} - -function readAndResolve(iter) { - var resolve = iter[kLastResolve]; - - if (resolve !== null) { - var data = iter[kStream].read(); // we defer if data is null - // we can be expecting either 'end' or - // 'error' - - if (data !== null) { - iter[kLastPromise] = null; - iter[kLastResolve] = null; - iter[kLastReject] = null; - resolve(createIterResult(data, false)); - } - } -} - -function onReadable(iter) { - // we wait for the next tick, because it might - // emit an error with process.nextTick - process.nextTick(readAndResolve, iter); -} - -function wrapForNext(lastPromise, iter) { - return function (resolve, reject) { - lastPromise.then(function () { - if (iter[kEnded]) { - resolve(createIterResult(undefined, true)); - return; - } - - iter[kHandlePromise](resolve, reject); - }, reject); - }; -} - -var AsyncIteratorPrototype = Object.getPrototypeOf(function () {}); -var ReadableStreamAsyncIteratorPrototype = Object.setPrototypeOf((_Object$setPrototypeO = { - get stream() { - return this[kStream]; - }, - - next: function next() { - var _this = this; - - // if we have detected an error in the meanwhile - // reject straight away - var error = this[kError]; - - if (error !== null) { - return Promise.reject(error); - } - - if (this[kEnded]) { - return Promise.resolve(createIterResult(undefined, true)); - } - - if (this[kStream].destroyed) { - // We need to defer via nextTick because if .destroy(err) is - // called, the error will be emitted via nextTick, and - // we cannot guarantee that there is no error lingering around - // waiting to be emitted. - return new Promise(function (resolve, reject) { - process.nextTick(function () { - if (_this[kError]) { - reject(_this[kError]); - } else { - resolve(createIterResult(undefined, true)); - } - }); - }); - } // if we have multiple next() calls - // we will wait for the previous Promise to finish - // this logic is optimized to support for await loops, - // where next() is only called once at a time - - - var lastPromise = this[kLastPromise]; - var promise; - - if (lastPromise) { - promise = new Promise(wrapForNext(lastPromise, this)); - } else { - // fast path needed to support multiple this.push() - // without triggering the next() queue - var data = this[kStream].read(); - - if (data !== null) { - return Promise.resolve(createIterResult(data, false)); - } - - promise = new Promise(this[kHandlePromise]); - } - - this[kLastPromise] = promise; - return promise; - } -}, _defineProperty(_Object$setPrototypeO, Symbol.asyncIterator, function () { - return this; -}), _defineProperty(_Object$setPrototypeO, "return", function _return() { - var _this2 = this; - - // destroy(err, cb) is a private API - // we can guarantee we have that here, because we control the - // Readable class this is attached to - return new Promise(function (resolve, reject) { - _this2[kStream].destroy(null, function (err) { - if (err) { - reject(err); - return; - } - - resolve(createIterResult(undefined, true)); - }); - }); -}), _Object$setPrototypeO), AsyncIteratorPrototype); - -var createReadableStreamAsyncIterator = function createReadableStreamAsyncIterator(stream) { - var _Object$create; - - var iterator = Object.create(ReadableStreamAsyncIteratorPrototype, (_Object$create = {}, _defineProperty(_Object$create, kStream, { - value: stream, - writable: true - }), _defineProperty(_Object$create, kLastResolve, { - value: null, - writable: true - }), _defineProperty(_Object$create, kLastReject, { - value: null, - writable: true - }), _defineProperty(_Object$create, kError, { - value: null, - writable: true - }), _defineProperty(_Object$create, kEnded, { - value: stream._readableState.endEmitted, - writable: true - }), _defineProperty(_Object$create, kHandlePromise, { - value: function value(resolve, reject) { - var data = iterator[kStream].read(); - - if (data) { - iterator[kLastPromise] = null; - iterator[kLastResolve] = null; - iterator[kLastReject] = null; - resolve(createIterResult(data, false)); - } else { - iterator[kLastResolve] = resolve; - iterator[kLastReject] = reject; - } - }, - writable: true - }), _Object$create)); - iterator[kLastPromise] = null; - finished(stream, function (err) { - if (err && err.code !== 'ERR_STREAM_PREMATURE_CLOSE') { - var reject = iterator[kLastReject]; // reject if we are waiting for data in the Promise - // returned by next() and store the error - - if (reject !== null) { - iterator[kLastPromise] = null; - iterator[kLastResolve] = null; - iterator[kLastReject] = null; - reject(err); - } - - iterator[kError] = err; - return; - } - - var resolve = iterator[kLastResolve]; - - if (resolve !== null) { - iterator[kLastPromise] = null; - iterator[kLastResolve] = null; - iterator[kLastReject] = null; - resolve(createIterResult(undefined, true)); - } - - iterator[kEnded] = true; - }); - stream.on('readable', onReadable.bind(null, iterator)); - return iterator; -}; - -module.exports = createReadableStreamAsyncIterator; \ No newline at end of file diff --git a/deps/npm/node_modules/readable-stream/lib/internal/streams/buffer_list.js b/deps/npm/node_modules/readable-stream/lib/internal/streams/buffer_list.js deleted file mode 100644 index cdea425f19dd96..00000000000000 --- a/deps/npm/node_modules/readable-stream/lib/internal/streams/buffer_list.js +++ /dev/null @@ -1,210 +0,0 @@ -'use strict'; - -function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } - -function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } - -function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } - -function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } - -var _require = require('buffer'), - Buffer = _require.Buffer; - -var _require2 = require('util'), - inspect = _require2.inspect; - -var custom = inspect && inspect.custom || 'inspect'; - -function copyBuffer(src, target, offset) { - Buffer.prototype.copy.call(src, target, offset); -} - -module.exports = -/*#__PURE__*/ -function () { - function BufferList() { - _classCallCheck(this, BufferList); - - this.head = null; - this.tail = null; - this.length = 0; - } - - _createClass(BufferList, [{ - key: "push", - value: function push(v) { - var entry = { - data: v, - next: null - }; - if (this.length > 0) this.tail.next = entry;else this.head = entry; - this.tail = entry; - ++this.length; - } - }, { - key: "unshift", - value: function unshift(v) { - var entry = { - data: v, - next: this.head - }; - if (this.length === 0) this.tail = entry; - this.head = entry; - ++this.length; - } - }, { - key: "shift", - value: function shift() { - if (this.length === 0) return; - var ret = this.head.data; - if (this.length === 1) this.head = this.tail = null;else this.head = this.head.next; - --this.length; - return ret; - } - }, { - key: "clear", - value: function clear() { - this.head = this.tail = null; - this.length = 0; - } - }, { - key: "join", - value: function join(s) { - if (this.length === 0) return ''; - var p = this.head; - var ret = '' + p.data; - - while (p = p.next) { - ret += s + p.data; - } - - return ret; - } - }, { - key: "concat", - value: function concat(n) { - if (this.length === 0) return Buffer.alloc(0); - var ret = Buffer.allocUnsafe(n >>> 0); - var p = this.head; - var i = 0; - - while (p) { - copyBuffer(p.data, ret, i); - i += p.data.length; - p = p.next; - } - - return ret; - } // Consumes a specified amount of bytes or characters from the buffered data. - - }, { - key: "consume", - value: function consume(n, hasStrings) { - var ret; - - if (n < this.head.data.length) { - // `slice` is the same for buffers and strings. - ret = this.head.data.slice(0, n); - this.head.data = this.head.data.slice(n); - } else if (n === this.head.data.length) { - // First chunk is a perfect match. - ret = this.shift(); - } else { - // Result spans more than one buffer. - ret = hasStrings ? this._getString(n) : this._getBuffer(n); - } - - return ret; - } - }, { - key: "first", - value: function first() { - return this.head.data; - } // Consumes a specified amount of characters from the buffered data. - - }, { - key: "_getString", - value: function _getString(n) { - var p = this.head; - var c = 1; - var ret = p.data; - n -= ret.length; - - while (p = p.next) { - var str = p.data; - var nb = n > str.length ? str.length : n; - if (nb === str.length) ret += str;else ret += str.slice(0, n); - n -= nb; - - if (n === 0) { - if (nb === str.length) { - ++c; - if (p.next) this.head = p.next;else this.head = this.tail = null; - } else { - this.head = p; - p.data = str.slice(nb); - } - - break; - } - - ++c; - } - - this.length -= c; - return ret; - } // Consumes a specified amount of bytes from the buffered data. - - }, { - key: "_getBuffer", - value: function _getBuffer(n) { - var ret = Buffer.allocUnsafe(n); - var p = this.head; - var c = 1; - p.data.copy(ret); - n -= p.data.length; - - while (p = p.next) { - var buf = p.data; - var nb = n > buf.length ? buf.length : n; - buf.copy(ret, ret.length - n, 0, nb); - n -= nb; - - if (n === 0) { - if (nb === buf.length) { - ++c; - if (p.next) this.head = p.next;else this.head = this.tail = null; - } else { - this.head = p; - p.data = buf.slice(nb); - } - - break; - } - - ++c; - } - - this.length -= c; - return ret; - } // Make sure the linked list only shows the minimal necessary information. - - }, { - key: custom, - value: function value(_, options) { - return inspect(this, _objectSpread({}, options, { - // Only inspect one level. - depth: 0, - // It should not recurse. - customInspect: false - })); - } - }]); - - return BufferList; -}(); \ No newline at end of file diff --git a/deps/npm/node_modules/readable-stream/lib/internal/streams/destroy.js b/deps/npm/node_modules/readable-stream/lib/internal/streams/destroy.js index 3268a16f3b6f23..5a0a0d88cec6f3 100644 --- a/deps/npm/node_modules/readable-stream/lib/internal/streams/destroy.js +++ b/deps/npm/node_modules/readable-stream/lib/internal/streams/destroy.js @@ -1,5 +1,11 @@ -'use strict'; // undocumented cb() API, needed for core, not for public API +'use strict'; +/**/ + +var pna = require('process-nextick-args'); +/**/ + +// undocumented cb() API, needed for core, not for public API function destroy(err, cb) { var _this = this; @@ -9,61 +15,38 @@ function destroy(err, cb) { if (readableDestroyed || writableDestroyed) { if (cb) { cb(err); - } else if (err) { - if (!this._writableState) { - process.nextTick(emitErrorNT, this, err); - } else if (!this._writableState.errorEmitted) { - this._writableState.errorEmitted = true; - process.nextTick(emitErrorNT, this, err); - } + } else if (err && (!this._writableState || !this._writableState.errorEmitted)) { + pna.nextTick(emitErrorNT, this, err); } - return this; - } // we set destroyed to true before firing error callbacks in order - // to make it re-entrance safe in case destroy() is called within callbacks + } + // we set destroyed to true before firing error callbacks in order + // to make it re-entrance safe in case destroy() is called within callbacks if (this._readableState) { this._readableState.destroyed = true; - } // if this is a duplex stream mark the writable part as destroyed as well - + } + // if this is a duplex stream mark the writable part as destroyed as well if (this._writableState) { this._writableState.destroyed = true; } this._destroy(err || null, function (err) { if (!cb && err) { - if (!_this._writableState) { - process.nextTick(emitErrorAndCloseNT, _this, err); - } else if (!_this._writableState.errorEmitted) { + pna.nextTick(emitErrorNT, _this, err); + if (_this._writableState) { _this._writableState.errorEmitted = true; - process.nextTick(emitErrorAndCloseNT, _this, err); - } else { - process.nextTick(emitCloseNT, _this); } } else if (cb) { - process.nextTick(emitCloseNT, _this); cb(err); - } else { - process.nextTick(emitCloseNT, _this); } }); return this; } -function emitErrorAndCloseNT(self, err) { - emitErrorNT(self, err); - emitCloseNT(self); -} - -function emitCloseNT(self) { - if (self._writableState && !self._writableState.emitClose) return; - if (self._readableState && !self._readableState.emitClose) return; - self.emit('close'); -} - function undestroy() { if (this._readableState) { this._readableState.destroyed = false; @@ -76,8 +59,6 @@ function undestroy() { this._writableState.destroyed = false; this._writableState.ended = false; this._writableState.ending = false; - this._writableState.finalCalled = false; - this._writableState.prefinished = false; this._writableState.finished = false; this._writableState.errorEmitted = false; } @@ -87,19 +68,7 @@ function emitErrorNT(self, err) { self.emit('error', err); } -function errorOrDestroy(stream, err) { - // We have tests that rely on errors being emitted - // in the same tick, so changing this is semver major. - // For now when you opt-in to autoDestroy we allow - // the error to be emitted nextTick. In a future - // semver major update we should change the default to this. - var rState = stream._readableState; - var wState = stream._writableState; - if (rState && rState.autoDestroy || wState && wState.autoDestroy) stream.destroy(err);else stream.emit('error', err); -} - module.exports = { destroy: destroy, - undestroy: undestroy, - errorOrDestroy: errorOrDestroy + undestroy: undestroy }; \ No newline at end of file diff --git a/deps/npm/node_modules/readable-stream/lib/internal/streams/end-of-stream.js b/deps/npm/node_modules/readable-stream/lib/internal/streams/end-of-stream.js deleted file mode 100644 index 831f286d98fa95..00000000000000 --- a/deps/npm/node_modules/readable-stream/lib/internal/streams/end-of-stream.js +++ /dev/null @@ -1,104 +0,0 @@ -// Ported from https://github.com/mafintosh/end-of-stream with -// permission from the author, Mathias Buus (@mafintosh). -'use strict'; - -var ERR_STREAM_PREMATURE_CLOSE = require('../../../errors').codes.ERR_STREAM_PREMATURE_CLOSE; - -function once(callback) { - var called = false; - return function () { - if (called) return; - called = true; - - for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - - callback.apply(this, args); - }; -} - -function noop() {} - -function isRequest(stream) { - return stream.setHeader && typeof stream.abort === 'function'; -} - -function eos(stream, opts, callback) { - if (typeof opts === 'function') return eos(stream, null, opts); - if (!opts) opts = {}; - callback = once(callback || noop); - var readable = opts.readable || opts.readable !== false && stream.readable; - var writable = opts.writable || opts.writable !== false && stream.writable; - - var onlegacyfinish = function onlegacyfinish() { - if (!stream.writable) onfinish(); - }; - - var writableEnded = stream._writableState && stream._writableState.finished; - - var onfinish = function onfinish() { - writable = false; - writableEnded = true; - if (!readable) callback.call(stream); - }; - - var readableEnded = stream._readableState && stream._readableState.endEmitted; - - var onend = function onend() { - readable = false; - readableEnded = true; - if (!writable) callback.call(stream); - }; - - var onerror = function onerror(err) { - callback.call(stream, err); - }; - - var onclose = function onclose() { - var err; - - if (readable && !readableEnded) { - if (!stream._readableState || !stream._readableState.ended) err = new ERR_STREAM_PREMATURE_CLOSE(); - return callback.call(stream, err); - } - - if (writable && !writableEnded) { - if (!stream._writableState || !stream._writableState.ended) err = new ERR_STREAM_PREMATURE_CLOSE(); - return callback.call(stream, err); - } - }; - - var onrequest = function onrequest() { - stream.req.on('finish', onfinish); - }; - - if (isRequest(stream)) { - stream.on('complete', onfinish); - stream.on('abort', onclose); - if (stream.req) onrequest();else stream.on('request', onrequest); - } else if (writable && !stream._writableState) { - // legacy streams - stream.on('end', onlegacyfinish); - stream.on('close', onlegacyfinish); - } - - stream.on('end', onend); - stream.on('finish', onfinish); - if (opts.error !== false) stream.on('error', onerror); - stream.on('close', onclose); - return function () { - stream.removeListener('complete', onfinish); - stream.removeListener('abort', onclose); - stream.removeListener('request', onrequest); - if (stream.req) stream.req.removeListener('finish', onfinish); - stream.removeListener('end', onlegacyfinish); - stream.removeListener('close', onlegacyfinish); - stream.removeListener('finish', onfinish); - stream.removeListener('end', onend); - stream.removeListener('error', onerror); - stream.removeListener('close', onclose); - }; -} - -module.exports = eos; \ No newline at end of file diff --git a/deps/npm/node_modules/readable-stream/lib/internal/streams/from-browser.js b/deps/npm/node_modules/readable-stream/lib/internal/streams/from-browser.js deleted file mode 100644 index a4ce56f3c90f60..00000000000000 --- a/deps/npm/node_modules/readable-stream/lib/internal/streams/from-browser.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = function () { - throw new Error('Readable.from is not available in the browser') -}; diff --git a/deps/npm/node_modules/readable-stream/lib/internal/streams/from.js b/deps/npm/node_modules/readable-stream/lib/internal/streams/from.js deleted file mode 100644 index 6c41284416799c..00000000000000 --- a/deps/npm/node_modules/readable-stream/lib/internal/streams/from.js +++ /dev/null @@ -1,64 +0,0 @@ -'use strict'; - -function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } } - -function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; } - -function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } - -function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } - -function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } - -var ERR_INVALID_ARG_TYPE = require('../../../errors').codes.ERR_INVALID_ARG_TYPE; - -function from(Readable, iterable, opts) { - var iterator; - - if (iterable && typeof iterable.next === 'function') { - iterator = iterable; - } else if (iterable && iterable[Symbol.asyncIterator]) iterator = iterable[Symbol.asyncIterator]();else if (iterable && iterable[Symbol.iterator]) iterator = iterable[Symbol.iterator]();else throw new ERR_INVALID_ARG_TYPE('iterable', ['Iterable'], iterable); - - var readable = new Readable(_objectSpread({ - objectMode: true - }, opts)); // Reading boolean to protect against _read - // being called before last iteration completion. - - var reading = false; - - readable._read = function () { - if (!reading) { - reading = true; - next(); - } - }; - - function next() { - return _next2.apply(this, arguments); - } - - function _next2() { - _next2 = _asyncToGenerator(function* () { - try { - var _ref = yield iterator.next(), - value = _ref.value, - done = _ref.done; - - if (done) { - readable.push(null); - } else if (readable.push((yield value))) { - next(); - } else { - reading = false; - } - } catch (err) { - readable.destroy(err); - } - }); - return _next2.apply(this, arguments); - } - - return readable; -} - -module.exports = from; \ No newline at end of file diff --git a/deps/npm/node_modules/readable-stream/lib/internal/streams/pipeline.js b/deps/npm/node_modules/readable-stream/lib/internal/streams/pipeline.js deleted file mode 100644 index 6589909889c585..00000000000000 --- a/deps/npm/node_modules/readable-stream/lib/internal/streams/pipeline.js +++ /dev/null @@ -1,97 +0,0 @@ -// Ported from https://github.com/mafintosh/pump with -// permission from the author, Mathias Buus (@mafintosh). -'use strict'; - -var eos; - -function once(callback) { - var called = false; - return function () { - if (called) return; - called = true; - callback.apply(void 0, arguments); - }; -} - -var _require$codes = require('../../../errors').codes, - ERR_MISSING_ARGS = _require$codes.ERR_MISSING_ARGS, - ERR_STREAM_DESTROYED = _require$codes.ERR_STREAM_DESTROYED; - -function noop(err) { - // Rethrow the error if it exists to avoid swallowing it - if (err) throw err; -} - -function isRequest(stream) { - return stream.setHeader && typeof stream.abort === 'function'; -} - -function destroyer(stream, reading, writing, callback) { - callback = once(callback); - var closed = false; - stream.on('close', function () { - closed = true; - }); - if (eos === undefined) eos = require('./end-of-stream'); - eos(stream, { - readable: reading, - writable: writing - }, function (err) { - if (err) return callback(err); - closed = true; - callback(); - }); - var destroyed = false; - return function (err) { - if (closed) return; - if (destroyed) return; - destroyed = true; // request.destroy just do .end - .abort is what we want - - if (isRequest(stream)) return stream.abort(); - if (typeof stream.destroy === 'function') return stream.destroy(); - callback(err || new ERR_STREAM_DESTROYED('pipe')); - }; -} - -function call(fn) { - fn(); -} - -function pipe(from, to) { - return from.pipe(to); -} - -function popCallback(streams) { - if (!streams.length) return noop; - if (typeof streams[streams.length - 1] !== 'function') return noop; - return streams.pop(); -} - -function pipeline() { - for (var _len = arguments.length, streams = new Array(_len), _key = 0; _key < _len; _key++) { - streams[_key] = arguments[_key]; - } - - var callback = popCallback(streams); - if (Array.isArray(streams[0])) streams = streams[0]; - - if (streams.length < 2) { - throw new ERR_MISSING_ARGS('streams'); - } - - var error; - var destroys = streams.map(function (stream, i) { - var reading = i < streams.length - 1; - var writing = i > 0; - return destroyer(stream, reading, writing, function (err) { - if (!error) error = err; - if (err) destroys.forEach(call); - if (reading) return; - destroys.forEach(call); - callback(error); - }); - }); - return streams.reduce(pipe); -} - -module.exports = pipeline; \ No newline at end of file diff --git a/deps/npm/node_modules/readable-stream/lib/internal/streams/state.js b/deps/npm/node_modules/readable-stream/lib/internal/streams/state.js deleted file mode 100644 index 19887eb8a9070e..00000000000000 --- a/deps/npm/node_modules/readable-stream/lib/internal/streams/state.js +++ /dev/null @@ -1,27 +0,0 @@ -'use strict'; - -var ERR_INVALID_OPT_VALUE = require('../../../errors').codes.ERR_INVALID_OPT_VALUE; - -function highWaterMarkFrom(options, isDuplex, duplexKey) { - return options.highWaterMark != null ? options.highWaterMark : isDuplex ? options[duplexKey] : null; -} - -function getHighWaterMark(state, options, duplexKey, isDuplex) { - var hwm = highWaterMarkFrom(options, isDuplex, duplexKey); - - if (hwm != null) { - if (!(isFinite(hwm) && Math.floor(hwm) === hwm) || hwm < 0) { - var name = isDuplex ? duplexKey : 'highWaterMark'; - throw new ERR_INVALID_OPT_VALUE(name, hwm); - } - - return Math.floor(hwm); - } // Default value - - - return state.objectMode ? 16 : 16 * 1024; -} - -module.exports = { - getHighWaterMark: getHighWaterMark -}; \ No newline at end of file diff --git a/deps/npm/node_modules/readable-stream/package.json b/deps/npm/node_modules/readable-stream/package.json index 9c29e095cbd6be..2afa6fbd81e225 100644 --- a/deps/npm/node_modules/readable-stream/package.json +++ b/deps/npm/node_modules/readable-stream/package.json @@ -1,100 +1,52 @@ { - "_from": "readable-stream@3.6.0", - "_id": "readable-stream@3.6.0", - "_inBundle": false, - "_integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", - "_location": "/readable-stream", - "_phantomChildren": {}, - "_requested": { - "type": "version", - "registry": true, - "raw": "readable-stream@3.6.0", - "name": "readable-stream", - "escapedName": "readable-stream", - "rawSpec": "3.6.0", - "saveSpec": null, - "fetchSpec": "3.6.0" - }, - "_requiredBy": [ - "#USER", - "/", - "/bl", - "/tar-stream" - ], - "_resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", - "_shasum": "337bbda3adc0706bd3e024426a286d4b4b2c9198", - "_spec": "readable-stream@3.6.0", - "_where": "/Users/darcyclarke/Documents/Repos/npm/cli", - "browser": { - "util": false, - "worker_threads": false, - "./errors": "./errors-browser.js", - "./readable.js": "./readable-browser.js", - "./lib/internal/streams/from.js": "./lib/internal/streams/from-browser.js", - "./lib/internal/streams/stream.js": "./lib/internal/streams/stream-browser.js" - }, - "bugs": { - "url": "https://github.com/nodejs/readable-stream/issues" - }, - "bundleDependencies": false, + "name": "readable-stream", + "version": "2.3.7", + "description": "Streams3, a user-land copy of the stream library from Node.js", + "main": "readable.js", "dependencies": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" }, - "deprecated": false, - "description": "Streams3, a user-land copy of the stream library from Node.js", "devDependencies": { - "@babel/cli": "^7.2.0", - "@babel/core": "^7.2.0", - "@babel/polyfill": "^7.0.0", - "@babel/preset-env": "^7.2.0", - "airtap": "0.0.9", "assert": "^1.4.0", - "bl": "^2.0.0", - "deep-strict-equal": "^0.2.0", - "events.once": "^2.0.2", - "glob": "^7.1.2", - "gunzip-maybe": "^1.4.1", - "hyperquest": "^2.1.3", - "lolex": "^2.6.0", - "nyc": "^11.0.0", - "pump": "^3.0.0", - "rimraf": "^2.6.2", - "tap": "^12.0.0", - "tape": "^4.9.0", - "tar-fs": "^1.16.2", - "util-promisify": "^2.1.0" + "babel-polyfill": "^6.9.1", + "buffer": "^4.9.0", + "lolex": "^2.3.2", + "nyc": "^6.4.0", + "tap": "^0.7.0", + "tape": "^4.8.0" + }, + "scripts": { + "test": "tap test/parallel/*.js test/ours/*.js && node test/verify-dependencies.js", + "ci": "tap test/parallel/*.js test/ours/*.js --tap | tee test.tap && node test/verify-dependencies.js", + "cover": "nyc npm test", + "report": "nyc report --reporter=lcov" }, - "engines": { - "node": ">= 6" + "repository": { + "type": "git", + "url": "git://github.com/nodejs/readable-stream" }, - "homepage": "https://github.com/nodejs/readable-stream#readme", "keywords": [ "readable", "stream", "pipe" ], - "license": "MIT", - "main": "readable.js", - "name": "readable-stream", + "browser": { + "util": false, + "./readable.js": "./readable-browser.js", + "./writable.js": "./writable-browser.js", + "./duplex.js": "./duplex-browser.js", + "./lib/internal/streams/stream.js": "./lib/internal/streams/stream-browser.js" + }, "nyc": { "include": [ "lib/**.js" ] }, - "repository": { - "type": "git", - "url": "git://github.com/nodejs/readable-stream.git" - }, - "scripts": { - "ci": "TAP=1 tap --no-esm test/parallel/*.js test/ours/*.js | tee test.tap", - "cover": "nyc npm test", - "report": "nyc report --reporter=lcov", - "test": "tap -J --no-esm test/parallel/*.js test/ours/*.js", - "test-browser-local": "airtap --open --local -- test/browser.js", - "test-browsers": "airtap --sauce-connect --loopback airtap.local -- test/browser.js", - "update-browser-errors": "babel -o errors-browser.js errors.js" - }, - "version": "3.6.0" + "license": "MIT" } diff --git a/deps/npm/node_modules/are-we-there-yet/node_modules/readable-stream/passthrough.js b/deps/npm/node_modules/readable-stream/passthrough.js similarity index 100% rename from deps/npm/node_modules/are-we-there-yet/node_modules/readable-stream/passthrough.js rename to deps/npm/node_modules/readable-stream/passthrough.js diff --git a/deps/npm/node_modules/readable-stream/readable-browser.js b/deps/npm/node_modules/readable-stream/readable-browser.js index adbf60de832f9d..e50372592ee6c6 100644 --- a/deps/npm/node_modules/readable-stream/readable-browser.js +++ b/deps/npm/node_modules/readable-stream/readable-browser.js @@ -5,5 +5,3 @@ exports.Writable = require('./lib/_stream_writable.js'); exports.Duplex = require('./lib/_stream_duplex.js'); exports.Transform = require('./lib/_stream_transform.js'); exports.PassThrough = require('./lib/_stream_passthrough.js'); -exports.finished = require('./lib/internal/streams/end-of-stream.js'); -exports.pipeline = require('./lib/internal/streams/pipeline.js'); diff --git a/deps/npm/node_modules/readable-stream/readable.js b/deps/npm/node_modules/readable-stream/readable.js index 9e0ca120ded827..ec89ec53306497 100644 --- a/deps/npm/node_modules/readable-stream/readable.js +++ b/deps/npm/node_modules/readable-stream/readable.js @@ -1,8 +1,13 @@ var Stream = require('stream'); if (process.env.READABLE_STREAM === 'disable' && Stream) { - module.exports = Stream.Readable; - Object.assign(module.exports, Stream); - module.exports.Stream = Stream; + module.exports = Stream; + exports = module.exports = Stream.Readable; + exports.Readable = Stream.Readable; + exports.Writable = Stream.Writable; + exports.Duplex = Stream.Duplex; + exports.Transform = Stream.Transform; + exports.PassThrough = Stream.PassThrough; + exports.Stream = Stream; } else { exports = module.exports = require('./lib/_stream_readable.js'); exports.Stream = Stream || exports; @@ -11,6 +16,4 @@ if (process.env.READABLE_STREAM === 'disable' && Stream) { exports.Duplex = require('./lib/_stream_duplex.js'); exports.Transform = require('./lib/_stream_transform.js'); exports.PassThrough = require('./lib/_stream_passthrough.js'); - exports.finished = require('./lib/internal/streams/end-of-stream.js'); - exports.pipeline = require('./lib/internal/streams/pipeline.js'); } diff --git a/deps/npm/node_modules/are-we-there-yet/node_modules/readable-stream/transform.js b/deps/npm/node_modules/readable-stream/transform.js similarity index 100% rename from deps/npm/node_modules/are-we-there-yet/node_modules/readable-stream/transform.js rename to deps/npm/node_modules/readable-stream/transform.js diff --git a/deps/npm/node_modules/are-we-there-yet/node_modules/readable-stream/writable-browser.js b/deps/npm/node_modules/readable-stream/writable-browser.js similarity index 100% rename from deps/npm/node_modules/are-we-there-yet/node_modules/readable-stream/writable-browser.js rename to deps/npm/node_modules/readable-stream/writable-browser.js diff --git a/deps/npm/node_modules/are-we-there-yet/node_modules/readable-stream/writable.js b/deps/npm/node_modules/readable-stream/writable.js similarity index 100% rename from deps/npm/node_modules/are-we-there-yet/node_modules/readable-stream/writable.js rename to deps/npm/node_modules/readable-stream/writable.js diff --git a/deps/npm/node_modules/readdir-scoped-modules/package.json b/deps/npm/node_modules/readdir-scoped-modules/package.json index 08e6e67b29a6bd..d41b99c2643a22 100644 --- a/deps/npm/node_modules/readdir-scoped-modules/package.json +++ b/deps/npm/node_modules/readdir-scoped-modules/package.json @@ -1,67 +1,34 @@ { - "_from": "readdir-scoped-modules@*", - "_id": "readdir-scoped-modules@1.1.0", - "_inBundle": false, - "_integrity": "sha512-asaikDeqAQg7JifRsZn1NJZXo9E+VwlyCfbkZhwyISinqk5zNS6266HS5kah6P0SaQKGF6SkNnZVHUzHFYxYDw==", - "_location": "/readdir-scoped-modules", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "readdir-scoped-modules@*", - "name": "readdir-scoped-modules", - "escapedName": "readdir-scoped-modules", - "rawSpec": "*", - "saveSpec": null, - "fetchSpec": "*" - }, - "_requiredBy": [ - "#USER", - "/", - "/npm-registry-mock", - "/read-installed", - "/read-package-tree" - ], - "_resolved": "https://registry.npmjs.org/readdir-scoped-modules/-/readdir-scoped-modules-1.1.0.tgz", - "_shasum": "8d45407b4f870a0dcaebc0e28670d18e74514309", - "_spec": "readdir-scoped-modules@*", - "_where": "/Users/isaacs/dev/npm/cli", - "author": { - "name": "Isaac Z. Schlueter", - "email": "i@izs.me", - "url": "http://blog.izs.me/" - }, - "bugs": { - "url": "https://github.com/npm/readdir-scoped-modules/issues" + "name": "readdir-scoped-modules", + "version": "1.1.0", + "description": "Like `fs.readdir` but handling `@org/module` dirs as if they were a single entry.", + "main": "readdir.js", + "directories": { + "test": "test" }, - "bundleDependencies": false, "dependencies": { "debuglog": "^1.0.1", "dezalgo": "^1.0.0", "graceful-fs": "^4.1.2", "once": "^1.3.0" }, - "deprecated": false, - "description": "Like `fs.readdir` but handling `@org/module` dirs as if they were a single entry.", "devDependencies": { "tap": "^1.2.0" }, - "directories": { - "test": "test" + "scripts": { + "test": "tap test/*.js" }, - "files": [ - "readdir.js" - ], - "homepage": "https://github.com/npm/readdir-scoped-modules", - "license": "ISC", - "main": "readdir.js", - "name": "readdir-scoped-modules", "repository": { "type": "git", - "url": "git+https://github.com/npm/readdir-scoped-modules.git" + "url": "https://github.com/npm/readdir-scoped-modules" }, - "scripts": { - "test": "tap test/*.js" + "author": "Isaac Z. Schlueter (http://blog.izs.me/)", + "license": "ISC", + "bugs": { + "url": "https://github.com/npm/readdir-scoped-modules/issues" }, - "version": "1.1.0" + "homepage": "https://github.com/npm/readdir-scoped-modules", + "files": [ + "readdir.js" + ] } diff --git a/deps/npm/node_modules/registry-auth-token/.npmignore b/deps/npm/node_modules/registry-auth-token/.npmignore deleted file mode 100644 index 4196028460bfcb..00000000000000 --- a/deps/npm/node_modules/registry-auth-token/.npmignore +++ /dev/null @@ -1,6 +0,0 @@ -.editorconfig -.eslintignore -.eslintrc -.travis.yml -npm-debug.log -coverage diff --git a/deps/npm/node_modules/registry-auth-token/CHANGELOG.md b/deps/npm/node_modules/registry-auth-token/CHANGELOG.md deleted file mode 100644 index 20e82e870ef454..00000000000000 --- a/deps/npm/node_modules/registry-auth-token/CHANGELOG.md +++ /dev/null @@ -1,112 +0,0 @@ -# Change Log - -All notable changes will be documented in this file. - -## [3.4.0] - 2019-03-20 - -### Changes - -- Enabled legacy auth token to be read from environment variable (Martin Flodin) - -## [3.3.2] - 2018-01-26 - -### Changes - -- Support password with ENV variable tokens (Nowell Strite) - -## [3.3.1] - 2017-05-02 - -### Fixes - -- Auth legacy token is basic auth (Hutson Betts) - -## [3.3.0] - 2017-04-24 - -### Changes - -- Support legacy auth token config key (Zoltan Kochan) -- Use safe-buffer module for backwards-compatible base64 encoding/decoding (Espen Hovlandsdal) -- Change to standard.js coding style (Espen Hovlandsdal) - -## [3.2.0] - 2017-04-20 - -### Changes - -- Allow passing parsed npmrc from outside (Zoltan Kochan) - -## [3.1.2] - 2017-04-07 - -### Changes - -- Avoid infinite loop on invalid URL (Zoltan Kochan) - -## [3.1.1] - 2017-04-06 - -### Changes - -- Nerf-dart URLs even if recursive is set to false (Espen Hovlandsdal) - -## [3.1.0] - 2016-10-19 - -### Changes - -- Return the password and username for Basic authorization (Zoltan Kochan) - -## [3.0.1] - 2016-08-07 - -### Changes - -- Fix recursion bug (Lukas Eipert) -- Implement alternative base64 encoding/decoding implementation for Node 6 (Lukas Eipert) - -## [3.0.0] - 2016-08-04 - -### Added - -- Support for Basic Authentication (username/password) (Lukas Eipert) - -### Changes - -- The result format of the output changed from a simple string to an object which contains the token type - -```js - // before: returns 'tokenString' - // after: returns {token: 'tokenString', type: 'Bearer'} - getAuthToken() -``` - -## [2.1.1] - 2016-07-10 - -### Changes - -- Fix infinite loop when recursively resolving registry URLs on Windows (Espen Hovlandsdal) - -## [2.1.0] - 2016-07-07 - -### Added - -- Add feature to find configured registry URL for a scope (Espen Hovlandsdal) - -## [2.0.0] - 2016-06-17 - -### Changes - -- Fix tokens defined by reference to environment variables (Dan MacTough) - -## [1.1.1] - 2016-04-26 - -### Changes - -- Fix for registries with port number in URL (Ryan Day) - -[1.1.1]: https://github.com/rexxars/registry-auth-token/compare/a5b4fe2f5ff982110eb8a813ba1b3b3c5d851af1...v1.1.1 -[2.0.0]: https://github.com/rexxars/registry-auth-token/compare/v1.1.1...v2.0.0 -[2.1.0]: https://github.com/rexxars/registry-auth-token/compare/v2.0.0...v2.1.0 -[2.1.1]: https://github.com/rexxars/registry-auth-token/compare/v2.1.0...v2.1.1 -[3.0.0]: https://github.com/rexxars/registry-auth-token/compare/v2.1.1...v3.0.0 -[3.0.1]: https://github.com/rexxars/registry-auth-token/compare/v3.0.0...v3.0.1 -[3.1.0]: https://github.com/rexxars/registry-auth-token/compare/v3.0.1...v3.1.0 -[3.1.1]: https://github.com/rexxars/registry-auth-token/compare/v3.1.0...v3.1.1 -[3.1.2]: https://github.com/rexxars/registry-auth-token/compare/v3.1.1...v3.1.2 -[3.2.0]: https://github.com/rexxars/registry-auth-token/compare/v3.1.2...v3.2.0 -[3.3.0]: https://github.com/rexxars/registry-auth-token/compare/v3.2.0...v3.3.0 diff --git a/deps/npm/node_modules/registry-auth-token/LICENSE b/deps/npm/node_modules/registry-auth-token/LICENSE deleted file mode 100644 index 0de12e3380f4cc..00000000000000 --- a/deps/npm/node_modules/registry-auth-token/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2016 Espen Hovlandsdal - -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/registry-auth-token/README.md b/deps/npm/node_modules/registry-auth-token/README.md deleted file mode 100644 index 5ac9c1ab6c88e6..00000000000000 --- a/deps/npm/node_modules/registry-auth-token/README.md +++ /dev/null @@ -1,65 +0,0 @@ -# registry-auth-token - -[![npm version](http://img.shields.io/npm/v/registry-auth-token.svg?style=flat-square)](http://browsenpm.org/package/registry-auth-token)[![Build Status](http://img.shields.io/travis/rexxars/registry-auth-token/master.svg?style=flat-square)](https://travis-ci.org/rexxars/registry-auth-token) - -Get the auth token set for an npm registry from `.npmrc`. Also allows fetching the configured registry URL for a given npm scope. - -## Installing - -``` -npm install --save registry-auth-token -``` - -## Usage - -Returns an object containing `token` and `type`, or `undefined` if no token can be found. `type` can be either `Bearer` or `Basic`. - -```js -var getAuthToken = require('registry-auth-token') -var getRegistryUrl = require('registry-auth-token/registry-url') - -// Get auth token and type for default `registry` set in `.npmrc` -console.log(getAuthToken()) // {token: 'someToken', type: 'Bearer'} - -// Get auth token for a specific registry URL -console.log(getAuthToken('//registry.foo.bar')) - -// Find the registry auth token for a given URL (with deep path): -// If registry is at `//some.host/registry` -// URL passed is `//some.host/registry/deep/path` -// Will find token the closest matching path; `//some.host/registry` -console.log(getAuthToken('//some.host/registry/deep/path', {recursive: true})) - -// Find the configured registry url for scope `@foobar`. -// Falls back to the global registry if not defined. -console.log(getRegistryUrl('@foobar')) - -// Use the npm config that is passed in -console.log(getRegistryUrl('http://registry.foobar.eu/', { - npmrc: { - 'registry': 'http://registry.foobar.eu/', - '//registry.foobar.eu/:_authToken': 'qar' - } -})) -``` - -## Return value - -```js -// If auth info can be found: -{token: 'someToken', type: 'Bearer'} - -// Or: -{token: 'someOtherToken', type: 'Basic'} - -// Or, if nothing is found: -undefined -``` - -## Security - -Please be careful when using this. Leaking your auth token is dangerous. - -## License - -MIT-licensed. See LICENSE. diff --git a/deps/npm/node_modules/registry-auth-token/base64.js b/deps/npm/node_modules/registry-auth-token/base64.js deleted file mode 100644 index d208ae18ddedd2..00000000000000 --- a/deps/npm/node_modules/registry-auth-token/base64.js +++ /dev/null @@ -1,14 +0,0 @@ -const safeBuffer = require('safe-buffer').Buffer - -function decodeBase64 (base64) { - return safeBuffer.from(base64, 'base64').toString('utf8') -} - -function encodeBase64 (string) { - return safeBuffer.from(string, 'utf8').toString('base64') -} - -module.exports = { - decodeBase64: decodeBase64, - encodeBase64: encodeBase64 -} diff --git a/deps/npm/node_modules/registry-auth-token/index.js b/deps/npm/node_modules/registry-auth-token/index.js deleted file mode 100644 index f8c6216eab9cd8..00000000000000 --- a/deps/npm/node_modules/registry-auth-token/index.js +++ /dev/null @@ -1,123 +0,0 @@ -var url = require('url') -var base64 = require('./base64') - -var decodeBase64 = base64.decodeBase64 -var encodeBase64 = base64.encodeBase64 - -var tokenKey = ':_authToken' -var userKey = ':username' -var passwordKey = ':_password' - -module.exports = function () { - var checkUrl - var options - if (arguments.length >= 2) { - checkUrl = arguments[0] - options = arguments[1] - } else if (typeof arguments[0] === 'string') { - checkUrl = arguments[0] - } else { - options = arguments[0] - } - options = options || {} - options.npmrc = options.npmrc || require('rc')('npm', {registry: 'https://registry.npmjs.org/'}) - checkUrl = checkUrl || options.npmrc.registry - return getRegistryAuthInfo(checkUrl, options) || getLegacyAuthInfo(options.npmrc) -} - -function getRegistryAuthInfo (checkUrl, options) { - var parsed = url.parse(checkUrl, false, true) - var pathname - - while (pathname !== '/' && parsed.pathname !== pathname) { - pathname = parsed.pathname || '/' - - var regUrl = '//' + parsed.host + pathname.replace(/\/$/, '') - var authInfo = getAuthInfoForUrl(regUrl, options.npmrc) - if (authInfo) { - return authInfo - } - - // break if not recursive - if (!options.recursive) { - return /\/$/.test(checkUrl) - ? undefined - : getRegistryAuthInfo(url.resolve(checkUrl, '.'), options) - } - - parsed.pathname = url.resolve(normalizePath(pathname), '..') || '/' - } - - return undefined -} - -function getLegacyAuthInfo (npmrc) { - if (!npmrc._auth) { - return undefined - } - - var token = replaceEnvironmentVariable(npmrc._auth) - - return {token: token, type: 'Basic'} -} - -function normalizePath (path) { - return path[path.length - 1] === '/' ? path : path + '/' -} - -function getAuthInfoForUrl (regUrl, npmrc) { - // try to get bearer token - var bearerAuth = getBearerToken(npmrc[regUrl + tokenKey] || npmrc[regUrl + '/' + tokenKey]) - if (bearerAuth) { - return bearerAuth - } - - // try to get basic token - var username = npmrc[regUrl + userKey] || npmrc[regUrl + '/' + userKey] - var password = npmrc[regUrl + passwordKey] || npmrc[regUrl + '/' + passwordKey] - var basicAuth = getTokenForUsernameAndPassword(username, password) - if (basicAuth) { - return basicAuth - } - - return undefined -} - -function replaceEnvironmentVariable (token) { - return token.replace(/^\$\{?([^}]*)\}?$/, function (fullMatch, envVar) { - return process.env[envVar] - }) -} - -function getBearerToken (tok) { - if (!tok) { - return undefined - } - - // check if bearer token is set as environment variable - var token = replaceEnvironmentVariable(tok) - - return {token: token, type: 'Bearer'} -} - -function getTokenForUsernameAndPassword (username, password) { - if (!username || !password) { - return undefined - } - - // passwords are base64 encoded, so we need to decode it - // See https://github.com/npm/npm/blob/v3.10.6/lib/config/set-credentials-by-uri.js#L26 - var pass = decodeBase64(replaceEnvironmentVariable(password)) - - // a basic auth token is base64 encoded 'username:password' - // See https://github.com/npm/npm/blob/v3.10.6/lib/config/get-credentials-by-uri.js#L70 - var token = encodeBase64(username + ':' + pass) - - // we found a basicToken token so let's exit the loop - return { - token: token, - type: 'Basic', - password: pass, - username: username - } -} diff --git a/deps/npm/node_modules/registry-auth-token/package.json b/deps/npm/node_modules/registry-auth-token/package.json deleted file mode 100644 index dd090a836b569a..00000000000000 --- a/deps/npm/node_modules/registry-auth-token/package.json +++ /dev/null @@ -1,74 +0,0 @@ -{ - "_from": "registry-auth-token@^3.0.1", - "_id": "registry-auth-token@3.4.0", - "_inBundle": false, - "_integrity": "sha512-4LM6Fw8eBQdwMYcES4yTnn2TqIasbXuwDx3um+QRs7S55aMKCBKBxvPXl2RiUjHwuJLTyYfxSpmfSAjQpcuP+A==", - "_location": "/registry-auth-token", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "registry-auth-token@^3.0.1", - "name": "registry-auth-token", - "escapedName": "registry-auth-token", - "rawSpec": "^3.0.1", - "saveSpec": null, - "fetchSpec": "^3.0.1" - }, - "_requiredBy": [ - "/package-json" - ], - "_resolved": "https://registry.npmjs.org/registry-auth-token/-/registry-auth-token-3.4.0.tgz", - "_shasum": "d7446815433f5d5ed6431cd5dca21048f66b397e", - "_spec": "registry-auth-token@^3.0.1", - "_where": "/Users/ruyadorno/Documents/workspace/cli/node_modules/package-json", - "author": { - "name": "Espen Hovlandsdal", - "email": "espen@hovlandsdal.com" - }, - "bugs": { - "url": "https://github.com/rexxars/registry-auth-token/issues" - }, - "bundleDependencies": false, - "dependencies": { - "rc": "^1.1.6", - "safe-buffer": "^5.0.1" - }, - "deprecated": false, - "description": "Get the auth token set for an npm registry (if any)", - "devDependencies": { - "istanbul": "^0.4.2", - "mocha": "^3.3.0", - "require-uncached": "^1.0.2", - "standard": "^10.0.2" - }, - "homepage": "https://github.com/rexxars/registry-auth-token#readme", - "keywords": [ - "npm", - "conf", - "config", - "npmconf", - "registry", - "auth", - "token", - "authtoken" - ], - "license": "MIT", - "main": "index.js", - "name": "registry-auth-token", - "repository": { - "type": "git", - "url": "git+ssh://git@github.com/rexxars/registry-auth-token.git" - }, - "scripts": { - "coverage": "istanbul cover _mocha", - "posttest": "standard", - "test": "mocha" - }, - "standard": { - "ignore": [ - "coverage/**" - ] - }, - "version": "3.4.0" -} diff --git a/deps/npm/node_modules/registry-auth-token/registry-url.js b/deps/npm/node_modules/registry-auth-token/registry-url.js deleted file mode 100644 index 9da9a44bfb45de..00000000000000 --- a/deps/npm/node_modules/registry-auth-token/registry-url.js +++ /dev/null @@ -1,5 +0,0 @@ -module.exports = function (scope, npmrc) { - var rc = npmrc || require('rc')('npm', {registry: 'https://registry.npmjs.org/'}) - var url = rc[scope + ':registry'] || rc.registry - return url.slice(-1) === '/' ? url : url + '/' -} diff --git a/deps/npm/node_modules/registry-auth-token/test/auth-token.test.js b/deps/npm/node_modules/registry-auth-token/test/auth-token.test.js deleted file mode 100644 index 5db6f5a192890a..00000000000000 --- a/deps/npm/node_modules/registry-auth-token/test/auth-token.test.js +++ /dev/null @@ -1,455 +0,0 @@ -var fs = require('fs') -var path = require('path') -var mocha = require('mocha') -var assert = require('assert') -var requireUncached = require('require-uncached') - -var npmRcPath = path.join(__dirname, '..', '.npmrc') -var afterEach = mocha.afterEach -var describe = mocha.describe -var it = mocha.it - -var base64 = require('../base64') -var decodeBase64 = base64.decodeBase64 -var encodeBase64 = base64.encodeBase64 - -/* eslint max-nested-callbacks: ["error", 4] */ - -describe('auth-token', function () { - afterEach(function (done) { - fs.unlink(npmRcPath, function () { - done() - }) - }) - - it('should read global if no local is found', function () { - var getAuthToken = requireUncached('../index') - getAuthToken() - }) - - it('should return undefined if no auth token is given for registry', function (done) { - fs.writeFile(npmRcPath, 'registry=http://registry.npmjs.eu/', function (err) { - var getAuthToken = requireUncached('../index') - assert(!err, err) - assert(!getAuthToken()) - done() - }) - }) - - describe('legacy auth token', function () { - it('should return auth token if it is defined in the legacy way via the `_auth` key', function (done) { - var content = [ - '_auth=foobar', - 'registry=http://registry.foobar.eu/' - ].join('\n') - - fs.writeFile(npmRcPath, content, function (err) { - var getAuthToken = requireUncached('../index') - assert(!err, err) - assert.deepEqual(getAuthToken(), {token: 'foobar', type: 'Basic'}) - done() - }) - }) - - it('should return legacy auth token defined by reference to an environment variable (with curly braces)', function (done) { - var environmentVariable = '__REGISTRY_AUTH_TOKEN_NPM_TOKEN__' - var content = [ - '_auth=${' + environmentVariable + '}', - 'registry=http://registry.foobar.eu/' - ].join('\n') - - process.env[environmentVariable] = 'foobar' - - fs.writeFile(npmRcPath, content, function (err) { - var getAuthToken = requireUncached('../index') - assert(!err, err) - assert.deepEqual(getAuthToken(), {token: 'foobar', type: 'Basic'}) - delete process.env[environmentVariable] - done() - }) - }) - - it('should return legacy auth token defined by reference to an environment variable (without curly braces)', function (done) { - var environmentVariable = '__REGISTRY_AUTH_TOKEN_NPM_TOKEN__' - var content = [ - '_auth=$' + environmentVariable, - 'registry=http://registry.foobar.eu/' - ].join('\n') - - process.env[environmentVariable] = 'foobar' - - fs.writeFile(npmRcPath, content, function (err) { - var getAuthToken = requireUncached('../index') - assert(!err, err) - assert.deepEqual(getAuthToken(), {token: 'foobar', type: 'Basic'}) - delete process.env[environmentVariable] - done() - }) - }) - }) - - describe('bearer token', function () { - it('should return auth token if registry is defined', function (done) { - var content = [ - 'registry=http://registry.foobar.eu/', - '//registry.foobar.eu/:_authToken=foobar', '' - ].join('\n') - - fs.writeFile(npmRcPath, content, function (err) { - var getAuthToken = requireUncached('../index') - assert(!err, err) - assert.deepEqual(getAuthToken(), {token: 'foobar', type: 'Bearer'}) - done() - }) - }) - - it('should use npmrc passed in', function (done) { - var content = [ - 'registry=http://registry.foobar.eu/', - '//registry.foobar.eu/:_authToken=foobar', '' - ].join('\n') - - fs.writeFile(npmRcPath, content, function (err) { - var getAuthToken = requireUncached('../index') - assert(!err, err) - const npmrc = { - 'registry': 'http://registry.foobar.eu/', - '//registry.foobar.eu/:_authToken': 'qar' - } - assert.deepEqual(getAuthToken({npmrc: npmrc}), {token: 'qar', type: 'Bearer'}) - done() - }) - }) - - it('should return auth token if registry url has port specified', function (done) { - var content = [ - 'registry=http://localhost:8770/', - // before the patch this token was selected. - '//localhost/:_authToken=ohno', - '//localhost:8770/:_authToken=beepboop', '' - ].join('\n') - - fs.writeFile(npmRcPath, content, function (err) { - var getAuthToken = requireUncached('../index') - assert(!err, err) - assert.deepEqual(getAuthToken(), {token: 'beepboop', type: 'Bearer'}) - done() - }) - }) - - it('should return auth token defined by reference to an environment variable (with curly braces)', function (done) { - var environmentVariable = '__REGISTRY_AUTH_TOKEN_NPM_TOKEN__' - var content = [ - 'registry=http://registry.foobar.cc/', - '//registry.foobar.cc/:_authToken=${' + environmentVariable + '}', '' - ].join('\n') - process.env[environmentVariable] = 'foobar' - - fs.writeFile(npmRcPath, content, function (err) { - var getAuthToken = requireUncached('../index') - assert(!err, err) - assert.deepEqual(getAuthToken(), {token: 'foobar', type: 'Bearer'}) - delete process.env[environmentVariable] - done() - }) - }) - - it('should return auth token defined by reference to an environment variable (without curly braces)', function (done) { - var environmentVariable = '__REGISTRY_AUTH_TOKEN_NPM_TOKEN__' - var content = [ - 'registry=http://registry.foobar.cc/', - '//registry.foobar.cc/:_authToken=$' + environmentVariable, '' - ].join('\n') - process.env[environmentVariable] = 'foobar' - - fs.writeFile(npmRcPath, content, function (err) { - var getAuthToken = requireUncached('../index') - assert(!err, err) - assert.deepEqual(getAuthToken(), {token: 'foobar', type: 'Bearer'}) - delete process.env[environmentVariable] - done() - }) - }) - - it('should try with and without a slash at the end of registry url', function (done) { - var content = [ - 'registry=http://registry.foobar.eu', - '//registry.foobar.eu:_authToken=barbaz', '' - ].join('\n') - - fs.writeFile(npmRcPath, content, function (err) { - var getAuthToken = requireUncached('../index') - assert(!err, err) - assert.deepEqual(getAuthToken(), {token: 'barbaz', type: 'Bearer'}) - done() - }) - }) - - it('should fetch for the registry given (if defined)', function (done) { - var content = [ - '//registry.foobar.eu:_authToken=barbaz', - '//registry.blah.foo:_authToken=whatev', - '//registry.last.thing:_authToken=yep', '' - ].join('\n') - - fs.writeFile(npmRcPath, content, function (err) { - var getAuthToken = requireUncached('../index') - assert(!err, err) - assert.deepEqual(getAuthToken('//registry.blah.foo'), {token: 'whatev', type: 'Bearer'}) - done() - }) - }) - - it('recursively finds registries for deep url if option is set', function (done, undef) { - var opts = {recursive: true} - var content = [ - '//registry.blah.com/foo:_authToken=whatev', - '//registry.blah.org/foo/bar:_authToken=recurseExactlyOneLevel', - '//registry.blah.edu/foo/bar/baz:_authToken=recurseNoLevel', - '//registry.blah.eu:_authToken=yep', '' - ].join('\n') - - fs.writeFile(npmRcPath, content, function (err) { - var getAuthToken = requireUncached('../index') - assert(!err, err) - assert.deepEqual(getAuthToken('https://registry.blah.edu/foo/bar/baz', opts), {token: 'recurseNoLevel', type: 'Bearer'}) - assert.deepEqual(getAuthToken('https://registry.blah.org/foo/bar/baz', opts), {token: 'recurseExactlyOneLevel', type: 'Bearer'}) - assert.deepEqual(getAuthToken('https://registry.blah.com/foo/bar/baz', opts), {token: 'whatev', type: 'Bearer'}) - assert.deepEqual(getAuthToken('http://registry.blah.eu/what/ever', opts), {token: 'yep', type: 'Bearer'}) - assert.deepEqual(getAuthToken('http://registry.blah.eu//what/ever', opts), undefined, 'does not hang') - assert.equal(getAuthToken('//some.registry', opts), undef) - done() - }) - }) - - it('should try both with and without trailing slash', function (done) { - fs.writeFile(npmRcPath, '//registry.blah.com:_authToken=whatev', function (err) { - var getAuthToken = requireUncached('../index') - assert(!err, err) - assert.deepEqual(getAuthToken('https://registry.blah.com'), {token: 'whatev', type: 'Bearer'}) - done() - }) - }) - - it('should prefer bearer token over basic token', function (done) { - var content = [ - 'registry=http://registry.foobar.eu/', - 'registry=http://registry.foobar.eu/', - '//registry.foobar.eu/:_authToken=bearerToken', - '//registry.foobar.eu/:_password=' + encodeBase64('foobar'), - '//registry.foobar.eu/:username=foobar', '' - ].join('\n') - - fs.writeFile(npmRcPath, content, function (err) { - var getAuthToken = requireUncached('../index') - assert(!err, err) - assert.deepEqual(getAuthToken('//registry.foobar.eu'), {token: 'bearerToken', type: 'Bearer'}) - done() - }) - }) - - it('"nerf darts" registry urls', function (done, undef) { - fs.writeFile(npmRcPath, '//contoso.pkgs.visualstudio.com/_packaging/MyFeed/npm/:_authToken=heider', function (err) { - var getAuthToken = requireUncached('../index') - assert(!err, err) - assert.deepEqual( - getAuthToken('https://contoso.pkgs.visualstudio.com/_packaging/MyFeed/npm/registry'), - {token: 'heider', type: 'Bearer'} - ) - done() - }) - }) - }) - - describe('basic token', function () { - it('should return undefined if password or username are missing', function (done, undef) { - var content = [ - 'registry=http://registry.foobar.eu/', - '//registry.foobar.eu/:_password=' + encodeBase64('foobar'), - '//registry.foobar.com/:username=foobar', '' - ].join('\n') - - fs.writeFile(npmRcPath, content, function (err) { - var getAuthToken = requireUncached('../index') - assert(!err, err) - assert.equal(getAuthToken('//registry.foobar.eu'), undef) - assert.equal(getAuthToken('//registry.foobar.com'), undef) - done() - }) - }) - - it('should return basic token if username and password are defined', function (done) { - var content = [ - 'registry=http://registry.foobar.eu/', - '//registry.foobar.eu/:_password=' + encodeBase64('foobar'), - '//registry.foobar.eu/:username=foobar', '' - ].join('\n') - - fs.writeFile(npmRcPath, content, function (err) { - var getAuthToken = requireUncached('../index') - assert(!err, err) - var token = getAuthToken() - assert.deepEqual(token, { - token: 'Zm9vYmFyOmZvb2Jhcg==', - type: 'Basic', - username: 'foobar', - password: 'foobar' - }) - assert.equal(decodeBase64(token.token), 'foobar:foobar') - done() - }) - }) - - it('should return basic token if registry url has port specified', function (done) { - var content = [ - 'registry=http://localhost:8770/', - // before the patch this token was selected. - '//localhost/:_authToken=ohno', - '//localhost:8770/:_password=' + encodeBase64('foobar'), - '//localhost:8770/:username=foobar', '' - ].join('\n') - - fs.writeFile(npmRcPath, content, function (err) { - var getAuthToken = requireUncached('../index') - assert(!err, err) - var token = getAuthToken() - assert.deepEqual(token, { - token: 'Zm9vYmFyOmZvb2Jhcg==', - type: 'Basic', - username: 'foobar', - password: 'foobar' - }) - assert.equal(decodeBase64(token.token), 'foobar:foobar') - done() - }) - }) - - it('should return password defined by reference to an environment variable (with curly braces)', function (done) { - var environmentVariable = '__REGISTRY_PASSWORD__' - var content = [ - 'registry=http://registry.foobar.cc/', - '//registry.foobar.cc/:username=username', - '//registry.foobar.cc/:_password=${' + environmentVariable + '}', '' - ].join('\n') - process.env[environmentVariable] = encodeBase64('password') - - fs.writeFile(npmRcPath, content, function (err) { - var getAuthToken = requireUncached('../index') - assert(!err, err) - var token = getAuthToken() - assert.deepEqual(token, { - type: 'Basic', - username: 'username', - password: 'password', - token: 'dXNlcm5hbWU6cGFzc3dvcmQ=' - }) - assert.equal(decodeBase64(token.token), 'username:password') - delete process.env[environmentVariable] - done() - }) - }) - - it('should return password defined by reference to an environment variable (without curly braces)', function (done) { - var environmentVariable = '__REGISTRY_PASSWORD__' - var content = [ - 'registry=http://registry.foobar.cc/', - '//registry.foobar.cc/:username=username', - '//registry.foobar.cc/:_password=$' + environmentVariable, '' - ].join('\n') - process.env[environmentVariable] = encodeBase64('password') - - fs.writeFile(npmRcPath, content, function (err) { - var getAuthToken = requireUncached('../index') - assert(!err, err) - var token = getAuthToken() - assert.deepEqual(token, { - type: 'Basic', - username: 'username', - password: 'password', - token: 'dXNlcm5hbWU6cGFzc3dvcmQ=' - }) - assert.equal(decodeBase64(token.token), 'username:password') - delete process.env[environmentVariable] - done() - }) - }) - - it('should try with and without a slash at the end of registry url', function (done) { - var content = [ - 'registry=http://registry.foobar.eu', - '//registry.foobar.eu:_password=' + encodeBase64('barbay'), - '//registry.foobar.eu:username=barbaz', '' - ].join('\n') - - fs.writeFile(npmRcPath, content, function (err) { - var getAuthToken = requireUncached('../index') - assert(!err, err) - var token = getAuthToken() - assert.deepEqual(token, { - token: 'YmFyYmF6OmJhcmJheQ==', - type: 'Basic', - password: 'barbay', - username: 'barbaz' - }) - assert.equal(decodeBase64(token.token), 'barbaz:barbay') - done() - }) - }) - - it('should fetch for the registry given (if defined)', function (done) { - var content = [ - '//registry.foobar.eu:_authToken=barbaz', - '//registry.blah.foo:_password=' + encodeBase64('barbay'), - '//registry.blah.foo:username=barbaz', - '//registry.last.thing:_authToken=yep', '' - ].join('\n') - - fs.writeFile(npmRcPath, content, function (err) { - var getAuthToken = requireUncached('../index') - assert(!err, err) - var token = getAuthToken('//registry.blah.foo') - assert.deepEqual(token, { - token: 'YmFyYmF6OmJhcmJheQ==', - type: 'Basic', - password: 'barbay', - username: 'barbaz' - }) - assert.equal(decodeBase64(token.token), 'barbaz:barbay') - done() - }) - }) - - it('recursively finds registries for deep url if option is set', function (done, undef) { - var opts = {recursive: true} - var content = [ - '//registry.blah.com/foo:_password=' + encodeBase64('barbay'), - '//registry.blah.com/foo:username=barbaz', - '//registry.blah.eu:username=barbaz', - '//registry.blah.eu:_password=' + encodeBase64('foobaz'), '' - ].join('\n') - - fs.writeFile(npmRcPath, content, function (err) { - var getAuthToken = requireUncached('../index') - assert(!err, err) - var token = getAuthToken('https://registry.blah.com/foo/bar/baz', opts) - assert.deepEqual(token, { - token: 'YmFyYmF6OmJhcmJheQ==', - type: 'Basic', - password: 'barbay', - username: 'barbaz' - }) - assert.equal(decodeBase64(token.token), 'barbaz:barbay') - token = getAuthToken('https://registry.blah.eu/foo/bar/baz', opts) - assert.deepEqual(token, { - token: 'YmFyYmF6OmZvb2Jheg==', - type: 'Basic', - password: 'foobaz', - username: 'barbaz' - }) - assert.equal(decodeBase64(token.token), 'barbaz:foobaz') - assert.equal(getAuthToken('//some.registry', opts), undef) - done() - }) - }) - }) -}) diff --git a/deps/npm/node_modules/registry-auth-token/test/registry-url.test.js b/deps/npm/node_modules/registry-auth-token/test/registry-url.test.js deleted file mode 100644 index adb6951bad7393..00000000000000 --- a/deps/npm/node_modules/registry-auth-token/test/registry-url.test.js +++ /dev/null @@ -1,64 +0,0 @@ -var fs = require('fs') -var path = require('path') -var mocha = require('mocha') -var assert = require('assert') -var requireUncached = require('require-uncached') - -var npmRcPath = path.join(__dirname, '..', '.npmrc') -var afterEach = mocha.afterEach -var describe = mocha.describe -var it = mocha.it - -describe('registry-url', function () { - afterEach(function (done) { - fs.unlink(npmRcPath, function () { - done() - }) - }) - - it('should read global if no local is found', function () { - var getRegistryUrl = requireUncached('../registry-url') - getRegistryUrl() - }) - - it('should return default registry if no url is given for scope', function (done) { - fs.writeFile(npmRcPath, 'registry=https://registry.npmjs.org/', function (err) { - var getRegistryUrl = requireUncached('../registry-url') - assert(!err, err) - assert.equal(getRegistryUrl('@somescope'), 'https://registry.npmjs.org/') - done() - }) - }) - - it('should return registry url if url is given for scope ', function (done) { - fs.writeFile(npmRcPath, '@somescope:registry=https://some.registry/', function (err) { - var getRegistryUrl = requireUncached('../registry-url') - assert(!err, err) - assert.equal(getRegistryUrl('@somescope'), 'https://some.registry/') - done() - }) - }) - - it('should append trailing slash if not present', function (done) { - fs.writeFile(npmRcPath, '@somescope:registry=https://some.registry', function (err) { - var getRegistryUrl = requireUncached('../registry-url') - assert(!err, err) - assert.equal(getRegistryUrl('@somescope'), 'https://some.registry/') - done() - }) - }) - - it('should return configured global registry if given', function (done) { - var content = [ - 'registry=http://registry.foobar.eu/', - '@somescope:registry=https://some.url/', '' - ].join('\n') - - fs.writeFile(npmRcPath, content, function (err) { - var getRegistryUrl = requireUncached('../registry-url') - assert(!err, err) - assert.equal(getRegistryUrl(), 'http://registry.foobar.eu/') - done() - }) - }) -}) diff --git a/deps/npm/node_modules/registry-auth-token/yarn.lock b/deps/npm/node_modules/registry-auth-token/yarn.lock deleted file mode 100644 index 46c1357274cf6c..00000000000000 --- a/deps/npm/node_modules/registry-auth-token/yarn.lock +++ /dev/null @@ -1,1516 +0,0 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. -# yarn lockfile v1 - - -abbrev@1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/abbrev/-/abbrev-1.1.1.tgz#f8f2c887ad10bf67f634f005b6987fed3179aac8" - -abbrev@1.0.x: - version "1.0.9" - resolved "https://registry.yarnpkg.com/abbrev/-/abbrev-1.0.9.tgz#91b4792588a7738c25f35dd6f63752a2f8776135" - -acorn-jsx@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-3.0.1.tgz#afdf9488fb1ecefc8348f6fb22f464e32a58b36b" - dependencies: - acorn "^3.0.4" - -acorn@^3.0.4: - version "3.3.0" - resolved "https://registry.yarnpkg.com/acorn/-/acorn-3.3.0.tgz#45e37fb39e8da3f25baee3ff5369e2bb5f22017a" - -acorn@^5.2.1: - version "5.3.0" - resolved "https://registry.yarnpkg.com/acorn/-/acorn-5.3.0.tgz#7446d39459c54fb49a80e6ee6478149b940ec822" - -ajv-keywords@^1.0.0: - version "1.5.1" - resolved "https://registry.yarnpkg.com/ajv-keywords/-/ajv-keywords-1.5.1.tgz#314dd0a4b3368fad3dfcdc54ede6171b886daf3c" - -ajv@^4.7.0: - version "4.11.8" - resolved "https://registry.yarnpkg.com/ajv/-/ajv-4.11.8.tgz#82ffb02b29e662ae53bdc20af15947706739c536" - dependencies: - co "^4.6.0" - json-stable-stringify "^1.0.1" - -align-text@^0.1.1, align-text@^0.1.3: - version "0.1.4" - resolved "https://registry.yarnpkg.com/align-text/-/align-text-0.1.4.tgz#0cd90a561093f35d0a99256c22b7069433fad117" - dependencies: - kind-of "^3.0.2" - longest "^1.0.1" - repeat-string "^1.5.2" - -amdefine@>=0.0.4: - version "1.0.1" - resolved "https://registry.yarnpkg.com/amdefine/-/amdefine-1.0.1.tgz#4a5282ac164729e93619bcfd3ad151f817ce91f5" - -ansi-escapes@^1.1.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-1.4.0.tgz#d3a8a83b319aa67793662b13e761c7911422306e" - -ansi-regex@^2.0.0: - version "2.1.1" - resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df" - -ansi-regex@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-3.0.0.tgz#ed0317c322064f79466c02966bddb605ab37d998" - -ansi-styles@^2.2.1: - version "2.2.1" - resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-2.2.1.tgz#b432dd3358b634cf75e1e4664368240533c1ddbe" - -argparse@^1.0.7: - version "1.0.9" - resolved "https://registry.yarnpkg.com/argparse/-/argparse-1.0.9.tgz#73d83bc263f86e97f8cc4f6bae1b0e90a7d22c86" - dependencies: - sprintf-js "~1.0.2" - -array-union@^1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/array-union/-/array-union-1.0.2.tgz#9a34410e4f4e3da23dea375be5be70f24778ec39" - dependencies: - array-uniq "^1.0.1" - -array-uniq@^1.0.1: - version "1.0.3" - resolved "https://registry.yarnpkg.com/array-uniq/-/array-uniq-1.0.3.tgz#af6ac877a25cc7f74e058894753858dfdb24fdb6" - -array.prototype.find@^2.0.1: - version "2.0.4" - resolved "https://registry.yarnpkg.com/array.prototype.find/-/array.prototype.find-2.0.4.tgz#556a5c5362c08648323ddaeb9de9d14bc1864c90" - dependencies: - define-properties "^1.1.2" - es-abstract "^1.7.0" - -arrify@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/arrify/-/arrify-1.0.1.tgz#898508da2226f380df904728456849c1501a4b0d" - -async@1.x, async@^1.4.0: - version "1.5.2" - resolved "https://registry.yarnpkg.com/async/-/async-1.5.2.tgz#ec6a61ae56480c0c3cb241c95618e20892f9672a" - -babel-code-frame@^6.16.0: - version "6.26.0" - resolved "https://registry.yarnpkg.com/babel-code-frame/-/babel-code-frame-6.26.0.tgz#63fd43f7dc1e3bb7ce35947db8fe369a3f58c74b" - dependencies: - chalk "^1.1.3" - esutils "^2.0.2" - js-tokens "^3.0.2" - -balanced-match@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767" - -brace-expansion@^1.1.7: - version "1.1.8" - resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.8.tgz#c07b211c7c952ec1f8efd51a77ef0d1d3990a292" - dependencies: - balanced-match "^1.0.0" - concat-map "0.0.1" - -browser-stdout@1.3.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/browser-stdout/-/browser-stdout-1.3.0.tgz#f351d32969d32fa5d7a5567154263d928ae3bd1f" - -builtin-modules@^1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/builtin-modules/-/builtin-modules-1.1.1.tgz#270f076c5a72c02f5b65a47df94c5fe3a278892f" - -caller-path@^0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/caller-path/-/caller-path-0.1.0.tgz#94085ef63581ecd3daa92444a8fe94e82577751f" - dependencies: - callsites "^0.2.0" - -callsites@^0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/callsites/-/callsites-0.2.0.tgz#afab96262910a7f33c19a5775825c69f34e350ca" - -camelcase@^1.0.2: - version "1.2.1" - resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-1.2.1.tgz#9bb5304d2e0b56698b2c758b08a3eaa9daa58a39" - -center-align@^0.1.1: - version "0.1.3" - resolved "https://registry.yarnpkg.com/center-align/-/center-align-0.1.3.tgz#aa0d32629b6ee972200411cbd4461c907bc2b7ad" - dependencies: - align-text "^0.1.3" - lazy-cache "^1.0.3" - -chalk@^1.0.0, chalk@^1.1.1, chalk@^1.1.3: - version "1.1.3" - resolved "https://registry.yarnpkg.com/chalk/-/chalk-1.1.3.tgz#a8115c55e4a702fe4d150abd3872822a7e09fc98" - dependencies: - ansi-styles "^2.2.1" - escape-string-regexp "^1.0.2" - has-ansi "^2.0.0" - strip-ansi "^3.0.0" - supports-color "^2.0.0" - -circular-json@^0.3.1: - version "0.3.3" - resolved "https://registry.yarnpkg.com/circular-json/-/circular-json-0.3.3.tgz#815c99ea84f6809529d2f45791bdf82711352d66" - -cli-cursor@^1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/cli-cursor/-/cli-cursor-1.0.2.tgz#64da3f7d56a54412e59794bd62dc35295e8f2987" - dependencies: - restore-cursor "^1.0.1" - -cli-width@^2.0.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/cli-width/-/cli-width-2.2.0.tgz#ff19ede8a9a5e579324147b0c11f0fbcbabed639" - -cliui@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/cliui/-/cliui-2.1.0.tgz#4b475760ff80264c762c3a1719032e91c7fea0d1" - dependencies: - center-align "^0.1.1" - right-align "^0.1.1" - wordwrap "0.0.2" - -co@^4.6.0: - version "4.6.0" - resolved "https://registry.yarnpkg.com/co/-/co-4.6.0.tgz#6ea6bdf3d853ae54ccb8e47bfa0bf3f9031fb184" - -code-point-at@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/code-point-at/-/code-point-at-1.1.0.tgz#0d070b4d043a5bea33a2f1a40e2edb3d9a4ccf77" - -commander@2.9.0: - version "2.9.0" - resolved "https://registry.yarnpkg.com/commander/-/commander-2.9.0.tgz#9c99094176e12240cb22d6c5146098400fe0f7d4" - dependencies: - graceful-readlink ">= 1.0.0" - -concat-map@0.0.1: - version "0.0.1" - resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" - -concat-stream@^1.5.2: - version "1.6.0" - resolved "https://registry.yarnpkg.com/concat-stream/-/concat-stream-1.6.0.tgz#0aac662fd52be78964d5532f694784e70110acf7" - dependencies: - inherits "^2.0.3" - readable-stream "^2.2.2" - typedarray "^0.0.6" - -contains-path@^0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/contains-path/-/contains-path-0.1.0.tgz#fe8cf184ff6670b6baef01a9d4861a5cbec4120a" - -core-util-is@~1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7" - -d@1: - version "1.0.0" - resolved "https://registry.yarnpkg.com/d/-/d-1.0.0.tgz#754bb5bfe55451da69a58b94d45f4c5b0462d58f" - dependencies: - es5-ext "^0.10.9" - -debug-log@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/debug-log/-/debug-log-1.0.1.tgz#2307632d4c04382b8df8a32f70b895046d52745f" - -debug@2.6.8: - version "2.6.8" - resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.8.tgz#e731531ca2ede27d188222427da17821d68ff4fc" - dependencies: - ms "2.0.0" - -debug@^2.1.1, debug@^2.2.0, debug@^2.6.8: - version "2.6.9" - resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f" - dependencies: - ms "2.0.0" - -decamelize@^1.0.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290" - -deep-extend@^0.6.0: - version "0.6.0" - resolved "https://registry.yarnpkg.com/deep-extend/-/deep-extend-0.6.0.tgz#c4fa7c95404a17a9c3e8ca7e1537312b736330ac" - -deep-is@~0.1.3: - version "0.1.3" - resolved "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.3.tgz#b369d6fb5dbc13eecf524f91b070feedc357cf34" - -define-properties@^1.1.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/define-properties/-/define-properties-1.1.2.tgz#83a73f2fea569898fb737193c8f873caf6d45c94" - dependencies: - foreach "^2.0.5" - object-keys "^1.0.8" - -deglob@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/deglob/-/deglob-2.1.0.tgz#4d44abe16ef32c779b4972bd141a80325029a14a" - dependencies: - find-root "^1.0.0" - glob "^7.0.5" - ignore "^3.0.9" - pkg-config "^1.1.0" - run-parallel "^1.1.2" - uniq "^1.0.1" - -del@^2.0.2: - version "2.2.2" - resolved "https://registry.yarnpkg.com/del/-/del-2.2.2.tgz#c12c981d067846c84bcaf862cff930d907ffd1a8" - dependencies: - globby "^5.0.0" - is-path-cwd "^1.0.0" - is-path-in-cwd "^1.0.0" - object-assign "^4.0.1" - pify "^2.0.0" - pinkie-promise "^2.0.0" - rimraf "^2.2.8" - -diff@3.2.0: - version "3.2.0" - resolved "https://registry.yarnpkg.com/diff/-/diff-3.2.0.tgz#c9ce393a4b7cbd0b058a725c93df299027868ff9" - -doctrine@1.5.0, doctrine@^1.2.2: - version "1.5.0" - resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-1.5.0.tgz#379dce730f6166f76cefa4e6707a159b02c5a6fa" - dependencies: - esutils "^2.0.2" - isarray "^1.0.0" - -doctrine@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-2.1.0.tgz#5cd01fc101621b42c4cd7f5d1a66243716d3f39d" - dependencies: - esutils "^2.0.2" - -error-ex@^1.3.1: - version "1.3.1" - resolved "https://registry.yarnpkg.com/error-ex/-/error-ex-1.3.1.tgz#f855a86ce61adc4e8621c3cda21e7a7612c3a8dc" - dependencies: - is-arrayish "^0.2.1" - -es-abstract@^1.7.0: - version "1.10.0" - resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.10.0.tgz#1ecb36c197842a00d8ee4c2dfd8646bb97d60864" - dependencies: - es-to-primitive "^1.1.1" - function-bind "^1.1.1" - has "^1.0.1" - is-callable "^1.1.3" - is-regex "^1.0.4" - -es-to-primitive@^1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/es-to-primitive/-/es-to-primitive-1.1.1.tgz#45355248a88979034b6792e19bb81f2b7975dd0d" - dependencies: - is-callable "^1.1.1" - is-date-object "^1.0.1" - is-symbol "^1.0.1" - -es5-ext@^0.10.14, es5-ext@^0.10.35, es5-ext@^0.10.9, es5-ext@~0.10.14: - version "0.10.38" - resolved "https://registry.yarnpkg.com/es5-ext/-/es5-ext-0.10.38.tgz#fa7d40d65bbc9bb8a67e1d3f9cc656a00530eed3" - dependencies: - es6-iterator "~2.0.3" - es6-symbol "~3.1.1" - -es6-iterator@^2.0.1, es6-iterator@~2.0.1, es6-iterator@~2.0.3: - version "2.0.3" - resolved "https://registry.yarnpkg.com/es6-iterator/-/es6-iterator-2.0.3.tgz#a7de889141a05a94b0854403b2d0a0fbfa98f3b7" - dependencies: - d "1" - es5-ext "^0.10.35" - es6-symbol "^3.1.1" - -es6-map@^0.1.3: - version "0.1.5" - resolved "https://registry.yarnpkg.com/es6-map/-/es6-map-0.1.5.tgz#9136e0503dcc06a301690f0bb14ff4e364e949f0" - dependencies: - d "1" - es5-ext "~0.10.14" - es6-iterator "~2.0.1" - es6-set "~0.1.5" - es6-symbol "~3.1.1" - event-emitter "~0.3.5" - -es6-set@~0.1.5: - version "0.1.5" - resolved "https://registry.yarnpkg.com/es6-set/-/es6-set-0.1.5.tgz#d2b3ec5d4d800ced818db538d28974db0a73ccb1" - dependencies: - d "1" - es5-ext "~0.10.14" - es6-iterator "~2.0.1" - es6-symbol "3.1.1" - event-emitter "~0.3.5" - -es6-symbol@3.1.1, es6-symbol@^3.1.1, es6-symbol@~3.1.1: - version "3.1.1" - resolved "https://registry.yarnpkg.com/es6-symbol/-/es6-symbol-3.1.1.tgz#bf00ef4fdab6ba1b46ecb7b629b4c7ed5715cc77" - dependencies: - d "1" - es5-ext "~0.10.14" - -es6-weak-map@^2.0.1: - version "2.0.2" - resolved "https://registry.yarnpkg.com/es6-weak-map/-/es6-weak-map-2.0.2.tgz#5e3ab32251ffd1538a1f8e5ffa1357772f92d96f" - dependencies: - d "1" - es5-ext "^0.10.14" - es6-iterator "^2.0.1" - es6-symbol "^3.1.1" - -escape-string-regexp@1.0.5, escape-string-regexp@^1.0.2, escape-string-regexp@^1.0.5: - version "1.0.5" - resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" - -escodegen@1.8.x: - version "1.8.1" - resolved "https://registry.yarnpkg.com/escodegen/-/escodegen-1.8.1.tgz#5a5b53af4693110bebb0867aa3430dd3b70a1018" - dependencies: - esprima "^2.7.1" - estraverse "^1.9.1" - esutils "^2.0.2" - optionator "^0.8.1" - optionalDependencies: - source-map "~0.2.0" - -escope@^3.6.0: - version "3.6.0" - resolved "https://registry.yarnpkg.com/escope/-/escope-3.6.0.tgz#e01975e812781a163a6dadfdd80398dc64c889c3" - dependencies: - es6-map "^0.1.3" - es6-weak-map "^2.0.1" - esrecurse "^4.1.0" - estraverse "^4.1.1" - -eslint-config-standard-jsx@4.0.2: - version "4.0.2" - resolved "https://registry.yarnpkg.com/eslint-config-standard-jsx/-/eslint-config-standard-jsx-4.0.2.tgz#009e53c4ddb1e9ee70b4650ffe63a7f39f8836e1" - -eslint-config-standard@10.2.1: - version "10.2.1" - resolved "https://registry.yarnpkg.com/eslint-config-standard/-/eslint-config-standard-10.2.1.tgz#c061e4d066f379dc17cd562c64e819b4dd454591" - -eslint-import-resolver-node@^0.2.0: - version "0.2.3" - resolved "https://registry.yarnpkg.com/eslint-import-resolver-node/-/eslint-import-resolver-node-0.2.3.tgz#5add8106e8c928db2cba232bcd9efa846e3da16c" - dependencies: - debug "^2.2.0" - object-assign "^4.0.1" - resolve "^1.1.6" - -eslint-module-utils@^2.0.0: - version "2.1.1" - resolved "https://registry.yarnpkg.com/eslint-module-utils/-/eslint-module-utils-2.1.1.tgz#abaec824177613b8a95b299639e1b6facf473449" - dependencies: - debug "^2.6.8" - pkg-dir "^1.0.0" - -eslint-plugin-import@~2.2.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/eslint-plugin-import/-/eslint-plugin-import-2.2.0.tgz#72ba306fad305d67c4816348a4699a4229ac8b4e" - dependencies: - builtin-modules "^1.1.1" - contains-path "^0.1.0" - debug "^2.2.0" - doctrine "1.5.0" - eslint-import-resolver-node "^0.2.0" - eslint-module-utils "^2.0.0" - has "^1.0.1" - lodash.cond "^4.3.0" - minimatch "^3.0.3" - pkg-up "^1.0.0" - -eslint-plugin-node@~4.2.2: - version "4.2.3" - resolved "https://registry.yarnpkg.com/eslint-plugin-node/-/eslint-plugin-node-4.2.3.tgz#c04390ab8dbcbb6887174023d6f3a72769e63b97" - dependencies: - ignore "^3.0.11" - minimatch "^3.0.2" - object-assign "^4.0.1" - resolve "^1.1.7" - semver "5.3.0" - -eslint-plugin-promise@~3.5.0: - version "3.5.0" - resolved "https://registry.yarnpkg.com/eslint-plugin-promise/-/eslint-plugin-promise-3.5.0.tgz#78fbb6ffe047201627569e85a6c5373af2a68fca" - -eslint-plugin-react@~6.10.0: - version "6.10.3" - resolved "https://registry.yarnpkg.com/eslint-plugin-react/-/eslint-plugin-react-6.10.3.tgz#c5435beb06774e12c7db2f6abaddcbf900cd3f78" - dependencies: - array.prototype.find "^2.0.1" - doctrine "^1.2.2" - has "^1.0.1" - jsx-ast-utils "^1.3.4" - object.assign "^4.0.4" - -eslint-plugin-standard@~3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/eslint-plugin-standard/-/eslint-plugin-standard-3.0.1.tgz#34d0c915b45edc6f010393c7eef3823b08565cf2" - -eslint@~3.19.0: - version "3.19.0" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-3.19.0.tgz#c8fc6201c7f40dd08941b87c085767386a679acc" - dependencies: - babel-code-frame "^6.16.0" - chalk "^1.1.3" - concat-stream "^1.5.2" - debug "^2.1.1" - doctrine "^2.0.0" - escope "^3.6.0" - espree "^3.4.0" - esquery "^1.0.0" - estraverse "^4.2.0" - esutils "^2.0.2" - file-entry-cache "^2.0.0" - glob "^7.0.3" - globals "^9.14.0" - ignore "^3.2.0" - imurmurhash "^0.1.4" - inquirer "^0.12.0" - is-my-json-valid "^2.10.0" - is-resolvable "^1.0.0" - js-yaml "^3.5.1" - json-stable-stringify "^1.0.0" - levn "^0.3.0" - lodash "^4.0.0" - mkdirp "^0.5.0" - natural-compare "^1.4.0" - optionator "^0.8.2" - path-is-inside "^1.0.1" - pluralize "^1.2.1" - progress "^1.1.8" - require-uncached "^1.0.2" - shelljs "^0.7.5" - strip-bom "^3.0.0" - strip-json-comments "~2.0.1" - table "^3.7.8" - text-table "~0.2.0" - user-home "^2.0.0" - -espree@^3.4.0: - version "3.5.2" - resolved "https://registry.yarnpkg.com/espree/-/espree-3.5.2.tgz#756ada8b979e9dcfcdb30aad8d1a9304a905e1ca" - dependencies: - acorn "^5.2.1" - acorn-jsx "^3.0.0" - -esprima@2.7.x, esprima@^2.7.1: - version "2.7.3" - resolved "https://registry.yarnpkg.com/esprima/-/esprima-2.7.3.tgz#96e3b70d5779f6ad49cd032673d1c312767ba581" - -esprima@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.0.tgz#4499eddcd1110e0b218bacf2fa7f7f59f55ca804" - -esquery@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/esquery/-/esquery-1.0.0.tgz#cfba8b57d7fba93f17298a8a006a04cda13d80fa" - dependencies: - estraverse "^4.0.0" - -esrecurse@^4.1.0: - version "4.2.0" - resolved "https://registry.yarnpkg.com/esrecurse/-/esrecurse-4.2.0.tgz#fa9568d98d3823f9a41d91e902dcab9ea6e5b163" - dependencies: - estraverse "^4.1.0" - object-assign "^4.0.1" - -estraverse@^1.9.1: - version "1.9.3" - resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-1.9.3.tgz#af67f2dc922582415950926091a4005d29c9bb44" - -estraverse@^4.0.0, estraverse@^4.1.0, estraverse@^4.1.1, estraverse@^4.2.0: - version "4.2.0" - resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-4.2.0.tgz#0dee3fed31fcd469618ce7342099fc1afa0bdb13" - -esutils@^2.0.2: - version "2.0.2" - resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.2.tgz#0abf4f1caa5bcb1f7a9d8acc6dea4faaa04bac9b" - -event-emitter@~0.3.5: - version "0.3.5" - resolved "https://registry.yarnpkg.com/event-emitter/-/event-emitter-0.3.5.tgz#df8c69eef1647923c7157b9ce83840610b02cc39" - dependencies: - d "1" - es5-ext "~0.10.14" - -exit-hook@^1.0.0: - version "1.1.1" - resolved "https://registry.yarnpkg.com/exit-hook/-/exit-hook-1.1.1.tgz#f05ca233b48c05d54fff07765df8507e95c02ff8" - -fast-levenshtein@~2.0.4: - version "2.0.6" - resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917" - -figures@^1.3.5: - version "1.7.0" - resolved "https://registry.yarnpkg.com/figures/-/figures-1.7.0.tgz#cbe1e3affcf1cd44b80cadfed28dc793a9701d2e" - dependencies: - escape-string-regexp "^1.0.5" - object-assign "^4.1.0" - -file-entry-cache@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/file-entry-cache/-/file-entry-cache-2.0.0.tgz#c392990c3e684783d838b8c84a45d8a048458361" - dependencies: - flat-cache "^1.2.1" - object-assign "^4.0.1" - -find-root@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/find-root/-/find-root-1.1.0.tgz#abcfc8ba76f708c42a97b3d685b7e9450bfb9ce4" - -find-up@^1.0.0: - version "1.1.2" - resolved "https://registry.yarnpkg.com/find-up/-/find-up-1.1.2.tgz#6b2e9822b1a2ce0a60ab64d610eccad53cb24d0f" - dependencies: - path-exists "^2.0.0" - pinkie-promise "^2.0.0" - -find-up@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/find-up/-/find-up-2.1.0.tgz#45d1b7e506c717ddd482775a2b77920a3c0c57a7" - dependencies: - locate-path "^2.0.0" - -flat-cache@^1.2.1: - version "1.3.0" - resolved "https://registry.yarnpkg.com/flat-cache/-/flat-cache-1.3.0.tgz#d3030b32b38154f4e3b7e9c709f490f7ef97c481" - dependencies: - circular-json "^0.3.1" - del "^2.0.2" - graceful-fs "^4.1.2" - write "^0.2.1" - -foreach@^2.0.5: - version "2.0.5" - resolved "https://registry.yarnpkg.com/foreach/-/foreach-2.0.5.tgz#0bee005018aeb260d0a3af3ae658dd0136ec1b99" - -fs.realpath@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" - -function-bind@^1.0.2, function-bind@^1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.1.tgz#a56899d3ea3c9bab874bb9773b7c5ede92f4895d" - -generate-function@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/generate-function/-/generate-function-2.0.0.tgz#6858fe7c0969b7d4e9093337647ac79f60dfbe74" - -generate-object-property@^1.1.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/generate-object-property/-/generate-object-property-1.2.0.tgz#9c0e1c40308ce804f4783618b937fa88f99d50d0" - dependencies: - is-property "^1.0.0" - -get-stdin@^5.0.1: - version "5.0.1" - resolved "https://registry.yarnpkg.com/get-stdin/-/get-stdin-5.0.1.tgz#122e161591e21ff4c52530305693f20e6393a398" - -glob@7.1.1: - version "7.1.1" - resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.1.tgz#805211df04faaf1c63a3600306cdf5ade50b2ec8" - dependencies: - fs.realpath "^1.0.0" - inflight "^1.0.4" - inherits "2" - minimatch "^3.0.2" - once "^1.3.0" - path-is-absolute "^1.0.0" - -glob@^5.0.15: - version "5.0.15" - resolved "https://registry.yarnpkg.com/glob/-/glob-5.0.15.tgz#1bc936b9e02f4a603fcc222ecf7633d30b8b93b1" - dependencies: - inflight "^1.0.4" - inherits "2" - minimatch "2 || 3" - once "^1.3.0" - path-is-absolute "^1.0.0" - -glob@^7.0.0, glob@^7.0.3, glob@^7.0.5: - version "7.1.2" - resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.2.tgz#c19c9df9a028702d678612384a6552404c636d15" - dependencies: - fs.realpath "^1.0.0" - inflight "^1.0.4" - inherits "2" - minimatch "^3.0.4" - once "^1.3.0" - path-is-absolute "^1.0.0" - -globals@^9.14.0: - version "9.18.0" - resolved "https://registry.yarnpkg.com/globals/-/globals-9.18.0.tgz#aa3896b3e69b487f17e31ed2143d69a8e30c2d8a" - -globby@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/globby/-/globby-5.0.0.tgz#ebd84667ca0dbb330b99bcfc68eac2bc54370e0d" - dependencies: - array-union "^1.0.1" - arrify "^1.0.0" - glob "^7.0.3" - object-assign "^4.0.1" - pify "^2.0.0" - pinkie-promise "^2.0.0" - -graceful-fs@^4.1.2: - version "4.1.11" - resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.1.11.tgz#0e8bdfe4d1ddb8854d64e04ea7c00e2a026e5658" - -"graceful-readlink@>= 1.0.0": - version "1.0.1" - resolved "https://registry.yarnpkg.com/graceful-readlink/-/graceful-readlink-1.0.1.tgz#4cafad76bc62f02fa039b2f94e9a3dd3a391a725" - -growl@1.9.2: - version "1.9.2" - resolved "https://registry.yarnpkg.com/growl/-/growl-1.9.2.tgz#0ea7743715db8d8de2c5ede1775e1b45ac85c02f" - -handlebars@^4.0.1: - version "4.0.11" - resolved "https://registry.yarnpkg.com/handlebars/-/handlebars-4.0.11.tgz#630a35dfe0294bc281edae6ffc5d329fc7982dcc" - dependencies: - async "^1.4.0" - optimist "^0.6.1" - source-map "^0.4.4" - optionalDependencies: - uglify-js "^2.6" - -has-ansi@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/has-ansi/-/has-ansi-2.0.0.tgz#34f5049ce1ecdf2b0649af3ef24e45ed35416d91" - dependencies: - ansi-regex "^2.0.0" - -has-flag@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-1.0.0.tgz#9d9e793165ce017a00f00418c43f942a7b1d11fa" - -has-symbols@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/has-symbols/-/has-symbols-1.0.0.tgz#ba1a8f1af2a0fc39650f5c850367704122063b44" - -has@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/has/-/has-1.0.1.tgz#8461733f538b0837c9361e39a9ab9e9704dc2f28" - dependencies: - function-bind "^1.0.2" - -he@1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/he/-/he-1.1.1.tgz#93410fd21b009735151f8868c2f271f3427e23fd" - -ignore@^3.0.11, ignore@^3.0.9, ignore@^3.2.0: - version "3.3.7" - resolved "https://registry.yarnpkg.com/ignore/-/ignore-3.3.7.tgz#612289bfb3c220e186a58118618d5be8c1bab021" - -imurmurhash@^0.1.4: - version "0.1.4" - resolved "https://registry.yarnpkg.com/imurmurhash/-/imurmurhash-0.1.4.tgz#9218b9b2b928a238b13dc4fb6b6d576f231453ea" - -inflight@^1.0.4: - version "1.0.6" - resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" - dependencies: - once "^1.3.0" - wrappy "1" - -inherits@2, inherits@^2.0.3, inherits@~2.0.3: - version "2.0.3" - resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" - -ini@~1.3.0: - version "1.3.5" - resolved "https://registry.yarnpkg.com/ini/-/ini-1.3.5.tgz#eee25f56db1c9ec6085e0c22778083f596abf927" - -inquirer@^0.12.0: - version "0.12.0" - resolved "https://registry.yarnpkg.com/inquirer/-/inquirer-0.12.0.tgz#1ef2bfd63504df0bc75785fff8c2c41df12f077e" - dependencies: - ansi-escapes "^1.1.0" - ansi-regex "^2.0.0" - chalk "^1.0.0" - cli-cursor "^1.0.1" - cli-width "^2.0.0" - figures "^1.3.5" - lodash "^4.3.0" - readline2 "^1.0.1" - run-async "^0.1.0" - rx-lite "^3.1.2" - string-width "^1.0.1" - strip-ansi "^3.0.0" - through "^2.3.6" - -interpret@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/interpret/-/interpret-1.1.0.tgz#7ed1b1410c6a0e0f78cf95d3b8440c63f78b8614" - -is-arrayish@^0.2.1: - version "0.2.1" - resolved "https://registry.yarnpkg.com/is-arrayish/-/is-arrayish-0.2.1.tgz#77c99840527aa8ecb1a8ba697b80645a7a926a9d" - -is-buffer@^1.1.5: - version "1.1.6" - resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.6.tgz#efaa2ea9daa0d7ab2ea13a97b2b8ad51fefbe8be" - -is-callable@^1.1.1, is-callable@^1.1.3: - version "1.1.3" - resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.1.3.tgz#86eb75392805ddc33af71c92a0eedf74ee7604b2" - -is-date-object@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/is-date-object/-/is-date-object-1.0.1.tgz#9aa20eb6aeebbff77fbd33e74ca01b33581d3a16" - -is-fullwidth-code-point@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz#ef9e31386f031a7f0d643af82fde50c457ef00cb" - dependencies: - number-is-nan "^1.0.0" - -is-fullwidth-code-point@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz#a3b30a5c4f199183167aaab93beefae3ddfb654f" - -is-my-json-valid@^2.10.0: - version "2.17.1" - resolved "https://registry.yarnpkg.com/is-my-json-valid/-/is-my-json-valid-2.17.1.tgz#3da98914a70a22f0a8563ef1511a246c6fc55471" - dependencies: - generate-function "^2.0.0" - generate-object-property "^1.1.0" - jsonpointer "^4.0.0" - xtend "^4.0.0" - -is-path-cwd@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-path-cwd/-/is-path-cwd-1.0.0.tgz#d225ec23132e89edd38fda767472e62e65f1106d" - -is-path-in-cwd@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-path-in-cwd/-/is-path-in-cwd-1.0.0.tgz#6477582b8214d602346094567003be8a9eac04dc" - dependencies: - is-path-inside "^1.0.0" - -is-path-inside@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/is-path-inside/-/is-path-inside-1.0.1.tgz#8ef5b7de50437a3fdca6b4e865ef7aa55cb48036" - dependencies: - path-is-inside "^1.0.1" - -is-property@^1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/is-property/-/is-property-1.0.2.tgz#57fe1c4e48474edd65b09911f26b1cd4095dda84" - -is-regex@^1.0.4: - version "1.0.4" - resolved "https://registry.yarnpkg.com/is-regex/-/is-regex-1.0.4.tgz#5517489b547091b0930e095654ced25ee97e9491" - dependencies: - has "^1.0.1" - -is-resolvable@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/is-resolvable/-/is-resolvable-1.1.0.tgz#fb18f87ce1feb925169c9a407c19318a3206ed88" - -is-symbol@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/is-symbol/-/is-symbol-1.0.1.tgz#3cc59f00025194b6ab2e38dbae6689256b660572" - -isarray@^1.0.0, isarray@~1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" - -isexe@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" - -istanbul@^0.4.2: - version "0.4.5" - resolved "https://registry.yarnpkg.com/istanbul/-/istanbul-0.4.5.tgz#65c7d73d4c4da84d4f3ac310b918fb0b8033733b" - dependencies: - abbrev "1.0.x" - async "1.x" - escodegen "1.8.x" - esprima "2.7.x" - glob "^5.0.15" - handlebars "^4.0.1" - js-yaml "3.x" - mkdirp "0.5.x" - nopt "3.x" - once "1.x" - resolve "1.1.x" - supports-color "^3.1.0" - which "^1.1.1" - wordwrap "^1.0.0" - -js-tokens@^3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-3.0.2.tgz#9866df395102130e38f7f996bceb65443209c25b" - -js-yaml@3.x, js-yaml@^3.5.1: - version "3.10.0" - resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.10.0.tgz#2e78441646bd4682e963f22b6e92823c309c62dc" - dependencies: - argparse "^1.0.7" - esprima "^4.0.0" - -json-parse-better-errors@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/json-parse-better-errors/-/json-parse-better-errors-1.0.1.tgz#50183cd1b2d25275de069e9e71b467ac9eab973a" - -json-stable-stringify@^1.0.0, json-stable-stringify@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/json-stable-stringify/-/json-stable-stringify-1.0.1.tgz#9a759d39c5f2ff503fd5300646ed445f88c4f9af" - dependencies: - jsonify "~0.0.0" - -json3@3.3.2: - version "3.3.2" - resolved "https://registry.yarnpkg.com/json3/-/json3-3.3.2.tgz#3c0434743df93e2f5c42aee7b19bcb483575f4e1" - -jsonify@~0.0.0: - version "0.0.0" - resolved "https://registry.yarnpkg.com/jsonify/-/jsonify-0.0.0.tgz#2c74b6ee41d93ca51b7b5aaee8f503631d252a73" - -jsonpointer@^4.0.0: - version "4.0.1" - resolved "https://registry.yarnpkg.com/jsonpointer/-/jsonpointer-4.0.1.tgz#4fd92cb34e0e9db3c89c8622ecf51f9b978c6cb9" - -jsx-ast-utils@^1.3.4: - version "1.4.1" - resolved "https://registry.yarnpkg.com/jsx-ast-utils/-/jsx-ast-utils-1.4.1.tgz#3867213e8dd79bf1e8f2300c0cfc1efb182c0df1" - -kind-of@^3.0.2: - version "3.2.2" - resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-3.2.2.tgz#31ea21a734bab9bbb0f32466d893aea51e4a3c64" - dependencies: - is-buffer "^1.1.5" - -lazy-cache@^1.0.3: - version "1.0.4" - resolved "https://registry.yarnpkg.com/lazy-cache/-/lazy-cache-1.0.4.tgz#a1d78fc3a50474cb80845d3b3b6e1da49a446e8e" - -levn@^0.3.0, levn@~0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/levn/-/levn-0.3.0.tgz#3b09924edf9f083c0490fdd4c0bc4421e04764ee" - dependencies: - prelude-ls "~1.1.2" - type-check "~0.3.2" - -load-json-file@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/load-json-file/-/load-json-file-4.0.0.tgz#2f5f45ab91e33216234fd53adab668eb4ec0993b" - dependencies: - graceful-fs "^4.1.2" - parse-json "^4.0.0" - pify "^3.0.0" - strip-bom "^3.0.0" - -locate-path@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-2.0.0.tgz#2b568b265eec944c6d9c0de9c3dbbbca0354cd8e" - dependencies: - p-locate "^2.0.0" - path-exists "^3.0.0" - -lodash._baseassign@^3.0.0: - version "3.2.0" - resolved "https://registry.yarnpkg.com/lodash._baseassign/-/lodash._baseassign-3.2.0.tgz#8c38a099500f215ad09e59f1722fd0c52bfe0a4e" - dependencies: - lodash._basecopy "^3.0.0" - lodash.keys "^3.0.0" - -lodash._basecopy@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/lodash._basecopy/-/lodash._basecopy-3.0.1.tgz#8da0e6a876cf344c0ad8a54882111dd3c5c7ca36" - -lodash._basecreate@^3.0.0: - version "3.0.3" - resolved "https://registry.yarnpkg.com/lodash._basecreate/-/lodash._basecreate-3.0.3.tgz#1bc661614daa7fc311b7d03bf16806a0213cf821" - -lodash._getnative@^3.0.0: - version "3.9.1" - resolved "https://registry.yarnpkg.com/lodash._getnative/-/lodash._getnative-3.9.1.tgz#570bc7dede46d61cdcde687d65d3eecbaa3aaff5" - -lodash._isiterateecall@^3.0.0: - version "3.0.9" - resolved "https://registry.yarnpkg.com/lodash._isiterateecall/-/lodash._isiterateecall-3.0.9.tgz#5203ad7ba425fae842460e696db9cf3e6aac057c" - -lodash.cond@^4.3.0: - version "4.5.2" - resolved "https://registry.yarnpkg.com/lodash.cond/-/lodash.cond-4.5.2.tgz#f471a1da486be60f6ab955d17115523dd1d255d5" - -lodash.create@3.1.1: - version "3.1.1" - resolved "https://registry.yarnpkg.com/lodash.create/-/lodash.create-3.1.1.tgz#d7f2849f0dbda7e04682bb8cd72ab022461debe7" - dependencies: - lodash._baseassign "^3.0.0" - lodash._basecreate "^3.0.0" - lodash._isiterateecall "^3.0.0" - -lodash.isarguments@^3.0.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/lodash.isarguments/-/lodash.isarguments-3.1.0.tgz#2f573d85c6a24289ff00663b491c1d338ff3458a" - -lodash.isarray@^3.0.0: - version "3.0.4" - resolved "https://registry.yarnpkg.com/lodash.isarray/-/lodash.isarray-3.0.4.tgz#79e4eb88c36a8122af86f844aa9bcd851b5fbb55" - -lodash.keys@^3.0.0: - version "3.1.2" - resolved "https://registry.yarnpkg.com/lodash.keys/-/lodash.keys-3.1.2.tgz#4dbc0472b156be50a0b286855d1bd0b0c656098a" - dependencies: - lodash._getnative "^3.0.0" - lodash.isarguments "^3.0.0" - lodash.isarray "^3.0.0" - -lodash@^4.0.0, lodash@^4.3.0: - version "4.17.4" - resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.4.tgz#78203a4d1c328ae1d86dca6460e369b57f4055ae" - -longest@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/longest/-/longest-1.0.1.tgz#30a0b2da38f73770e8294a0d22e6625ed77d0097" - -"minimatch@2 || 3", minimatch@^3.0.2, minimatch@^3.0.3, minimatch@^3.0.4: - version "3.0.4" - resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" - dependencies: - brace-expansion "^1.1.7" - -minimist@0.0.8: - version "0.0.8" - resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d" - -minimist@^1.1.0, minimist@^1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.0.tgz#a35008b20f41383eec1fb914f4cd5df79a264284" - -minimist@~0.0.1: - version "0.0.10" - resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.10.tgz#de3f98543dbf96082be48ad1a0c7cda836301dcf" - -mkdirp@0.5.1, mkdirp@0.5.x, mkdirp@^0.5.0, mkdirp@^0.5.1: - version "0.5.1" - resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.1.tgz#30057438eac6cf7f8c4767f38648d6697d75c903" - dependencies: - minimist "0.0.8" - -mocha@^3.3.0: - version "3.5.3" - resolved "https://registry.yarnpkg.com/mocha/-/mocha-3.5.3.tgz#1e0480fe36d2da5858d1eb6acc38418b26eaa20d" - dependencies: - browser-stdout "1.3.0" - commander "2.9.0" - debug "2.6.8" - diff "3.2.0" - escape-string-regexp "1.0.5" - glob "7.1.1" - growl "1.9.2" - he "1.1.1" - json3 "3.3.2" - lodash.create "3.1.1" - mkdirp "0.5.1" - supports-color "3.1.2" - -ms@2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8" - -mute-stream@0.0.5: - version "0.0.5" - resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-0.0.5.tgz#8fbfabb0a98a253d3184331f9e8deb7372fac6c0" - -natural-compare@^1.4.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7" - -nopt@3.x: - version "3.0.6" - resolved "https://registry.yarnpkg.com/nopt/-/nopt-3.0.6.tgz#c6465dbf08abcd4db359317f79ac68a646b28ff9" - dependencies: - abbrev "1" - -number-is-nan@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/number-is-nan/-/number-is-nan-1.0.1.tgz#097b602b53422a522c1afb8790318336941a011d" - -object-assign@^4.0.1, object-assign@^4.1.0: - version "4.1.1" - resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" - -object-keys@^1.0.11, object-keys@^1.0.8: - version "1.0.11" - resolved "https://registry.yarnpkg.com/object-keys/-/object-keys-1.0.11.tgz#c54601778ad560f1142ce0e01bcca8b56d13426d" - -object.assign@^4.0.4: - version "4.1.0" - resolved "https://registry.yarnpkg.com/object.assign/-/object.assign-4.1.0.tgz#968bf1100d7956bb3ca086f006f846b3bc4008da" - dependencies: - define-properties "^1.1.2" - function-bind "^1.1.1" - has-symbols "^1.0.0" - object-keys "^1.0.11" - -once@1.x, once@^1.3.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" - dependencies: - wrappy "1" - -onetime@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/onetime/-/onetime-1.1.0.tgz#a1f7838f8314c516f05ecefcbc4ccfe04b4ed789" - -optimist@^0.6.1: - version "0.6.1" - resolved "https://registry.yarnpkg.com/optimist/-/optimist-0.6.1.tgz#da3ea74686fa21a19a111c326e90eb15a0196686" - dependencies: - minimist "~0.0.1" - wordwrap "~0.0.2" - -optionator@^0.8.1, optionator@^0.8.2: - version "0.8.2" - resolved "https://registry.yarnpkg.com/optionator/-/optionator-0.8.2.tgz#364c5e409d3f4d6301d6c0b4c05bba50180aeb64" - dependencies: - deep-is "~0.1.3" - fast-levenshtein "~2.0.4" - levn "~0.3.0" - prelude-ls "~1.1.2" - type-check "~0.3.2" - wordwrap "~1.0.0" - -os-homedir@^1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/os-homedir/-/os-homedir-1.0.2.tgz#ffbc4988336e0e833de0c168c7ef152121aa7fb3" - -p-limit@^1.1.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-1.2.0.tgz#0e92b6bedcb59f022c13d0f1949dc82d15909f1c" - dependencies: - p-try "^1.0.0" - -p-locate@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-2.0.0.tgz#20a0103b222a70c8fd39cc2e580680f3dde5ec43" - dependencies: - p-limit "^1.1.0" - -p-try@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/p-try/-/p-try-1.0.0.tgz#cbc79cdbaf8fd4228e13f621f2b1a237c1b207b3" - -parse-json@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/parse-json/-/parse-json-4.0.0.tgz#be35f5425be1f7f6c747184f98a788cb99477ee0" - dependencies: - error-ex "^1.3.1" - json-parse-better-errors "^1.0.1" - -path-exists@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-2.1.0.tgz#0feb6c64f0fc518d9a754dd5efb62c7022761f4b" - dependencies: - pinkie-promise "^2.0.0" - -path-exists@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-3.0.0.tgz#ce0ebeaa5f78cb18925ea7d810d7b59b010fd515" - -path-is-absolute@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" - -path-is-inside@^1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/path-is-inside/-/path-is-inside-1.0.2.tgz#365417dede44430d1c11af61027facf074bdfc53" - -path-parse@^1.0.5: - version "1.0.5" - resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.5.tgz#3c1adf871ea9cd6c9431b6ea2bd74a0ff055c4c1" - -pify@^2.0.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/pify/-/pify-2.3.0.tgz#ed141a6ac043a849ea588498e7dca8b15330e90c" - -pify@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/pify/-/pify-3.0.0.tgz#e5a4acd2c101fdf3d9a4d07f0dbc4db49dd28176" - -pinkie-promise@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/pinkie-promise/-/pinkie-promise-2.0.1.tgz#2135d6dfa7a358c069ac9b178776288228450ffa" - dependencies: - pinkie "^2.0.0" - -pinkie@^2.0.0: - version "2.0.4" - resolved "https://registry.yarnpkg.com/pinkie/-/pinkie-2.0.4.tgz#72556b80cfa0d48a974e80e77248e80ed4f7f870" - -pkg-conf@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/pkg-conf/-/pkg-conf-2.1.0.tgz#2126514ca6f2abfebd168596df18ba57867f0058" - dependencies: - find-up "^2.0.0" - load-json-file "^4.0.0" - -pkg-config@^1.1.0: - version "1.1.1" - resolved "https://registry.yarnpkg.com/pkg-config/-/pkg-config-1.1.1.tgz#557ef22d73da3c8837107766c52eadabde298fe4" - dependencies: - debug-log "^1.0.0" - find-root "^1.0.0" - xtend "^4.0.1" - -pkg-dir@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/pkg-dir/-/pkg-dir-1.0.0.tgz#7a4b508a8d5bb2d629d447056ff4e9c9314cf3d4" - dependencies: - find-up "^1.0.0" - -pkg-up@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/pkg-up/-/pkg-up-1.0.0.tgz#3e08fb461525c4421624a33b9f7e6d0af5b05a26" - dependencies: - find-up "^1.0.0" - -pluralize@^1.2.1: - version "1.2.1" - resolved "https://registry.yarnpkg.com/pluralize/-/pluralize-1.2.1.tgz#d1a21483fd22bb41e58a12fa3421823140897c45" - -prelude-ls@~1.1.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.1.2.tgz#21932a549f5e52ffd9a827f570e04be62a97da54" - -process-nextick-args@~1.0.6: - version "1.0.7" - resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-1.0.7.tgz#150e20b756590ad3f91093f25a4f2ad8bff30ba3" - -progress@^1.1.8: - version "1.1.8" - resolved "https://registry.yarnpkg.com/progress/-/progress-1.1.8.tgz#e260c78f6161cdd9b0e56cc3e0a85de17c7a57be" - -rc@^1.2.8: - version "1.2.8" - resolved "https://registry.yarnpkg.com/rc/-/rc-1.2.8.tgz#cd924bf5200a075b83c188cd6b9e211b7fc0d3ed" - dependencies: - deep-extend "^0.6.0" - ini "~1.3.0" - minimist "^1.2.0" - strip-json-comments "~2.0.1" - -readable-stream@^2.2.2: - version "2.3.3" - resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.3.tgz#368f2512d79f9d46fdfc71349ae7878bbc1eb95c" - dependencies: - core-util-is "~1.0.0" - inherits "~2.0.3" - isarray "~1.0.0" - process-nextick-args "~1.0.6" - safe-buffer "~5.1.1" - string_decoder "~1.0.3" - util-deprecate "~1.0.1" - -readline2@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/readline2/-/readline2-1.0.1.tgz#41059608ffc154757b715d9989d199ffbf372e35" - dependencies: - code-point-at "^1.0.0" - is-fullwidth-code-point "^1.0.0" - mute-stream "0.0.5" - -rechoir@^0.6.2: - version "0.6.2" - resolved "https://registry.yarnpkg.com/rechoir/-/rechoir-0.6.2.tgz#85204b54dba82d5742e28c96756ef43af50e3384" - dependencies: - resolve "^1.1.6" - -repeat-string@^1.5.2: - version "1.6.1" - resolved "https://registry.yarnpkg.com/repeat-string/-/repeat-string-1.6.1.tgz#8dcae470e1c88abc2d600fff4a776286da75e637" - -require-uncached@^1.0.2: - version "1.0.3" - resolved "https://registry.yarnpkg.com/require-uncached/-/require-uncached-1.0.3.tgz#4e0d56d6c9662fd31e43011c4b95aa49955421d3" - dependencies: - caller-path "^0.1.0" - resolve-from "^1.0.0" - -resolve-from@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-1.0.1.tgz#26cbfe935d1aeeeabb29bc3fe5aeb01e93d44226" - -resolve@1.1.x: - version "1.1.7" - resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.1.7.tgz#203114d82ad2c5ed9e8e0411b3932875e889e97b" - -resolve@^1.1.6, resolve@^1.1.7: - version "1.5.0" - resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.5.0.tgz#1f09acce796c9a762579f31b2c1cc4c3cddf9f36" - dependencies: - path-parse "^1.0.5" - -restore-cursor@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/restore-cursor/-/restore-cursor-1.0.1.tgz#34661f46886327fed2991479152252df92daa541" - dependencies: - exit-hook "^1.0.0" - onetime "^1.0.0" - -right-align@^0.1.1: - version "0.1.3" - resolved "https://registry.yarnpkg.com/right-align/-/right-align-0.1.3.tgz#61339b722fe6a3515689210d24e14c96148613ef" - dependencies: - align-text "^0.1.1" - -rimraf@^2.2.8: - version "2.6.2" - resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.6.2.tgz#2ed8150d24a16ea8651e6d6ef0f47c4158ce7a36" - dependencies: - glob "^7.0.5" - -run-async@^0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/run-async/-/run-async-0.1.0.tgz#c8ad4a5e110661e402a7d21b530e009f25f8e389" - dependencies: - once "^1.3.0" - -run-parallel@^1.1.2: - version "1.1.6" - resolved "https://registry.yarnpkg.com/run-parallel/-/run-parallel-1.1.6.tgz#29003c9a2163e01e2d2dfc90575f2c6c1d61a039" - -rx-lite@^3.1.2: - version "3.1.2" - resolved "https://registry.yarnpkg.com/rx-lite/-/rx-lite-3.1.2.tgz#19ce502ca572665f3b647b10939f97fd1615f102" - -safe-buffer@^5.1.2: - version "5.1.2" - resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d" - -safe-buffer@~5.1.0, safe-buffer@~5.1.1: - version "5.1.1" - resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.1.tgz#893312af69b2123def71f57889001671eeb2c853" - -semver@5.3.0: - version "5.3.0" - resolved "https://registry.yarnpkg.com/semver/-/semver-5.3.0.tgz#9b2ce5d3de02d17c6012ad326aa6b4d0cf54f94f" - -shelljs@^0.7.5: - version "0.7.8" - resolved "https://registry.yarnpkg.com/shelljs/-/shelljs-0.7.8.tgz#decbcf874b0d1e5fb72e14b164a9683048e9acb3" - dependencies: - glob "^7.0.0" - interpret "^1.0.0" - rechoir "^0.6.2" - -slice-ansi@0.0.4: - version "0.0.4" - resolved "https://registry.yarnpkg.com/slice-ansi/-/slice-ansi-0.0.4.tgz#edbf8903f66f7ce2f8eafd6ceed65e264c831b35" - -source-map@^0.4.4: - version "0.4.4" - resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.4.4.tgz#eba4f5da9c0dc999de68032d8b4f76173652036b" - dependencies: - amdefine ">=0.0.4" - -source-map@~0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.2.0.tgz#dab73fbcfc2ba819b4de03bd6f6eaa48164b3f9d" - dependencies: - amdefine ">=0.0.4" - -source-map@~0.5.1: - version "0.5.7" - resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.7.tgz#8a039d2d1021d22d1ea14c80d8ea468ba2ef3fcc" - -sprintf-js@~1.0.2: - version "1.0.3" - resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c" - -standard-engine@~7.0.0: - version "7.0.0" - resolved "https://registry.yarnpkg.com/standard-engine/-/standard-engine-7.0.0.tgz#ebb77b9c8fc2c8165ffa353bd91ba0dff41af690" - dependencies: - deglob "^2.1.0" - get-stdin "^5.0.1" - minimist "^1.1.0" - pkg-conf "^2.0.0" - -standard@^10.0.2: - version "10.0.3" - resolved "https://registry.yarnpkg.com/standard/-/standard-10.0.3.tgz#7869bcbf422bdeeaab689a1ffb1fea9677dd50ea" - dependencies: - eslint "~3.19.0" - eslint-config-standard "10.2.1" - eslint-config-standard-jsx "4.0.2" - eslint-plugin-import "~2.2.0" - eslint-plugin-node "~4.2.2" - eslint-plugin-promise "~3.5.0" - eslint-plugin-react "~6.10.0" - eslint-plugin-standard "~3.0.1" - standard-engine "~7.0.0" - -string-width@^1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/string-width/-/string-width-1.0.2.tgz#118bdf5b8cdc51a2a7e70d211e07e2b0b9b107d3" - dependencies: - code-point-at "^1.0.0" - is-fullwidth-code-point "^1.0.0" - strip-ansi "^3.0.0" - -string-width@^2.0.0: - version "2.1.1" - resolved "https://registry.yarnpkg.com/string-width/-/string-width-2.1.1.tgz#ab93f27a8dc13d28cac815c462143a6d9012ae9e" - dependencies: - is-fullwidth-code-point "^2.0.0" - strip-ansi "^4.0.0" - -string_decoder@~1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.0.3.tgz#0fc67d7c141825de94282dd536bec6b9bce860ab" - dependencies: - safe-buffer "~5.1.0" - -strip-ansi@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-3.0.1.tgz#6a385fb8853d952d5ff05d0e8aaf94278dc63dcf" - dependencies: - ansi-regex "^2.0.0" - -strip-ansi@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-4.0.0.tgz#a8479022eb1ac368a871389b635262c505ee368f" - dependencies: - ansi-regex "^3.0.0" - -strip-bom@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-3.0.0.tgz#2334c18e9c759f7bdd56fdef7e9ae3d588e68ed3" - -strip-json-comments@~2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a" - -supports-color@3.1.2: - version "3.1.2" - resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-3.1.2.tgz#72a262894d9d408b956ca05ff37b2ed8a6e2a2d5" - dependencies: - has-flag "^1.0.0" - -supports-color@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-2.0.0.tgz#535d045ce6b6363fa40117084629995e9df324c7" - -supports-color@^3.1.0: - version "3.2.3" - resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-3.2.3.tgz#65ac0504b3954171d8a64946b2ae3cbb8a5f54f6" - dependencies: - has-flag "^1.0.0" - -table@^3.7.8: - version "3.8.3" - resolved "https://registry.yarnpkg.com/table/-/table-3.8.3.tgz#2bbc542f0fda9861a755d3947fefd8b3f513855f" - dependencies: - ajv "^4.7.0" - ajv-keywords "^1.0.0" - chalk "^1.1.1" - lodash "^4.0.0" - slice-ansi "0.0.4" - string-width "^2.0.0" - -text-table@~0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/text-table/-/text-table-0.2.0.tgz#7f5ee823ae805207c00af2df4a84ec3fcfa570b4" - -through@^2.3.6: - version "2.3.8" - resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5" - -type-check@~0.3.2: - version "0.3.2" - resolved "https://registry.yarnpkg.com/type-check/-/type-check-0.3.2.tgz#5884cab512cf1d355e3fb784f30804b2b520db72" - dependencies: - prelude-ls "~1.1.2" - -typedarray@^0.0.6: - version "0.0.6" - resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" - -uglify-js@^2.6: - version "2.8.29" - resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-2.8.29.tgz#29c5733148057bb4e1f75df35b7a9cb72e6a59dd" - dependencies: - source-map "~0.5.1" - yargs "~3.10.0" - optionalDependencies: - uglify-to-browserify "~1.0.0" - -uglify-to-browserify@~1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/uglify-to-browserify/-/uglify-to-browserify-1.0.2.tgz#6e0924d6bda6b5afe349e39a6d632850a0f882b7" - -uniq@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/uniq/-/uniq-1.0.1.tgz#b31c5ae8254844a3a8281541ce2b04b865a734ff" - -user-home@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/user-home/-/user-home-2.0.0.tgz#9c70bfd8169bc1dcbf48604e0f04b8b49cde9e9f" - dependencies: - os-homedir "^1.0.0" - -util-deprecate@~1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" - -which@^1.1.1: - version "1.3.0" - resolved "https://registry.yarnpkg.com/which/-/which-1.3.0.tgz#ff04bdfc010ee547d780bec38e1ac1c2777d253a" - dependencies: - isexe "^2.0.0" - -window-size@0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/window-size/-/window-size-0.1.0.tgz#5438cd2ea93b202efa3a19fe8887aee7c94f9c9d" - -wordwrap@0.0.2: - version "0.0.2" - resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-0.0.2.tgz#b79669bb42ecb409f83d583cad52ca17eaa1643f" - -wordwrap@^1.0.0, wordwrap@~1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-1.0.0.tgz#27584810891456a4171c8d0226441ade90cbcaeb" - -wordwrap@~0.0.2: - version "0.0.3" - resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-0.0.3.tgz#a3d5da6cd5c0bc0008d37234bbaf1bed63059107" - -wrappy@1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" - -write@^0.2.1: - version "0.2.1" - resolved "https://registry.yarnpkg.com/write/-/write-0.2.1.tgz#5fc03828e264cea3fe91455476f7a3c566cb0757" - dependencies: - mkdirp "^0.5.1" - -xtend@^4.0.0, xtend@^4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/xtend/-/xtend-4.0.1.tgz#a5c6d532be656e23db820efb943a1f04998d63af" - -yargs@~3.10.0: - version "3.10.0" - resolved "https://registry.yarnpkg.com/yargs/-/yargs-3.10.0.tgz#f7ee7bd857dd7c1d2d38c0e74efbd681d1431fd1" - dependencies: - camelcase "^1.0.2" - cliui "^2.1.0" - decamelize "^1.0.0" - window-size "0.1.0" diff --git a/deps/npm/node_modules/registry-url/index.js b/deps/npm/node_modules/registry-url/index.js deleted file mode 100644 index 5502a235ab33cc..00000000000000 --- a/deps/npm/node_modules/registry-url/index.js +++ /dev/null @@ -1,6 +0,0 @@ -'use strict'; -module.exports = function (scope) { - var rc = require('rc')('npm', {registry: 'https://registry.npmjs.org/'}); - var url = rc[scope + ':registry'] || rc.registry; - return url.slice(-1) === '/' ? url : url + '/'; -}; diff --git a/deps/npm/node_modules/registry-url/license b/deps/npm/node_modules/registry-url/license deleted file mode 100644 index 654d0bfe943437..00000000000000 --- a/deps/npm/node_modules/registry-url/license +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -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/deps/npm/node_modules/registry-url/package.json b/deps/npm/node_modules/registry-url/package.json deleted file mode 100644 index 4845d876ad83bd..00000000000000 --- a/deps/npm/node_modules/registry-url/package.json +++ /dev/null @@ -1,72 +0,0 @@ -{ - "_from": "registry-url@^3.0.3", - "_id": "registry-url@3.1.0", - "_inBundle": false, - "_integrity": "sha1-PU74cPc93h138M+aOBQyRE4XSUI=", - "_location": "/registry-url", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "registry-url@^3.0.3", - "name": "registry-url", - "escapedName": "registry-url", - "rawSpec": "^3.0.3", - "saveSpec": null, - "fetchSpec": "^3.0.3" - }, - "_requiredBy": [ - "/package-json" - ], - "_resolved": "https://registry.npmjs.org/registry-url/-/registry-url-3.1.0.tgz", - "_shasum": "3d4ef870f73dde1d77f0cf9a381432444e174942", - "_spec": "registry-url@^3.0.3", - "_where": "/Users/rebecca/code/npm/node_modules/package-json", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "bugs": { - "url": "https://github.com/sindresorhus/registry-url/issues" - }, - "bundleDependencies": false, - "dependencies": { - "rc": "^1.0.1" - }, - "deprecated": false, - "description": "Get the set npm registry URL", - "devDependencies": { - "ava": "*", - "pify": "^2.3.0", - "require-uncached": "^1.0.2", - "xo": "*" - }, - "engines": { - "node": ">=0.10.0" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/sindresorhus/registry-url#readme", - "keywords": [ - "npm", - "conf", - "config", - "npmconf", - "registry", - "url", - "uri", - "scope" - ], - "license": "MIT", - "name": "registry-url", - "repository": { - "type": "git", - "url": "git+https://github.com/sindresorhus/registry-url.git" - }, - "scripts": { - "test": "xo && ava --serial" - }, - "version": "3.1.0" -} diff --git a/deps/npm/node_modules/registry-url/readme.md b/deps/npm/node_modules/registry-url/readme.md deleted file mode 100644 index 6fc55bc5fe96bf..00000000000000 --- a/deps/npm/node_modules/registry-url/readme.md +++ /dev/null @@ -1,50 +0,0 @@ -# registry-url [![Build Status](https://travis-ci.org/sindresorhus/registry-url.svg?branch=master)](https://travis-ci.org/sindresorhus/registry-url) - -> Get the set npm registry URL - -It's usually `https://registry.npmjs.org/`, but [configurable](https://www.npmjs.org/doc/misc/npm-config.html#registry). - -Use this if you do anything with the npm registry as users will expect it to use their configured registry. - - -## Install - -``` -$ npm install --save registry-url -``` - - -## Usage - -```ini -# .npmrc -registry = 'https://custom-registry.com/' -``` - -```js -const registryUrl = require('registry-url'); - -console.log(registryUrl()); -//=> 'https://custom-registry.com/' -``` - -It can also retrieve the registry URL associated with an [npm scope](https://docs.npmjs.com/misc/scope). - -```ini -# .npmrc -@myco:registry = 'https://custom-registry.com/' -``` - -```js -const registryUrl = require('registry-url'); - -console.log(registryUrl('@myco')); -//=> 'https://custom-registry.com/' -``` - -If the provided scope is not in the user's `.npmrc` file, then `registry-url` will check for the existence of `registry`, or if that's not set, fallback to the default npm registry. - - -## License - -MIT © [Sindre Sorhus](http://sindresorhus.com) diff --git a/deps/npm/node_modules/request/CHANGELOG.md b/deps/npm/node_modules/request/CHANGELOG.md index 751514d28b25a2..d3ffcd00d2e623 100644 --- a/deps/npm/node_modules/request/CHANGELOG.md +++ b/deps/npm/node_modules/request/CHANGELOG.md @@ -1,5 +1,13 @@ ## Change Log +### v2.88.0 (2018/08/10) +- [#2996](https://github.com/request/request/pull/2996) fix(uuid): import versioned uuid (@kwonoj) +- [#2994](https://github.com/request/request/pull/2994) Update to oauth-sign 0.9.0 (@dlecocq) +- [#2993](https://github.com/request/request/pull/2993) Fix header tests (@simov) +- [#2904](https://github.com/request/request/pull/2904) #515, #2894 Strip port suffix from Host header if the protocol is known. (#2904) (@paambaati) +- [#2791](https://github.com/request/request/pull/2791) Improve AWS SigV4 support. (#2791) (@vikhyat) +- [#2977](https://github.com/request/request/pull/2977) Update test certificates (@simov) + ### v2.87.0 (2018/05/21) - [#2943](https://github.com/request/request/pull/2943) Replace hawk dependency with a local implemenation (#2943) (@hueniverse) diff --git a/deps/npm/node_modules/request/README.md b/deps/npm/node_modules/request/README.md index b91623d2e3652e..56684125a2089c 100644 --- a/deps/npm/node_modules/request/README.md +++ b/deps/npm/node_modules/request/README.md @@ -1,3 +1,9 @@ +# Deprecated! + +As of Feb 11th 2020, request is fully deprecated. No new changes are expected land. In fact, none have landed for some time. + +For more information about why request is deprecated and possible alternatives refer to +[this issue](https://github.com/request/request/issues/3142). # Request - Simplified HTTP client @@ -16,9 +22,9 @@ Request is designed to be the simplest way possible to make http calls. It supports HTTPS and follows redirects by default. ```js -var request = require('request'); +const request = require('request'); request('http://www.google.com', function (error, response, body) { - console.log('error:', error); // Print the error if one occurred + console.error('error:', error); // Print the error if one occurred console.log('statusCode:', response && response.statusCode); // Print the response status code if a response was received console.log('body:', body); // Print the HTML for the Google homepage. }); @@ -86,7 +92,7 @@ To easily handle errors when streaming requests, listen to the `error` event bef request .get('http://mysite.com/doodle.png') .on('error', function(err) { - console.log(err) + console.error(err) }) .pipe(fs.createWriteStream('doodle.png')) ``` @@ -110,7 +116,7 @@ You can also `pipe()` from `http.ServerRequest` instances, as well as to `http.S ```js http.createServer(function (req, resp) { if (req.url === '/doodle.png') { - var x = request('http://mysite.com/doodle.png') + const x = request('http://mysite.com/doodle.png') req.pipe(x) x.pipe(resp) } @@ -126,7 +132,7 @@ req.pipe(request('http://mysite.com/doodle.png')).pipe(resp) Also, none of this new functionality conflicts with requests previous features, it just expands them. ```js -var r = request.defaults({'proxy':'http://localproxy.com'}) +const r = request.defaults({'proxy':'http://localproxy.com'}) http.createServer(function (req, resp) { if (req.url === '/doodle.png') { @@ -152,6 +158,8 @@ Several alternative interfaces are provided by the request team, including: - [`request-promise-native`](https://github.com/request/request-promise-native) (uses native Promises) - [`request-promise-any`](https://github.com/request/request-promise-any) (uses [any-promise](https://www.npmjs.com/package/any-promise) Promises) +Also, [`util.promisify`](https://nodejs.org/api/util.html#util_util_promisify_original), which is available from Node.js v8.0 can be used to convert a regular function that takes a callback to return a promise instead. + [back to top](#table-of-contents) @@ -183,7 +191,7 @@ For `multipart/form-data` we use the [form-data](https://github.com/form-data/fo ```js -var formData = { +const formData = { // Pass a simple key-value pair my_field: 'my_value', // Pass data via Buffers @@ -218,8 +226,8 @@ For advanced cases, you can access the form-data object itself via `r.form()`. T ```js // NOTE: Advanced use-case, for normal use see 'formData' usage above -var r = request.post('http://service.com/upload', function optionalCallback(err, httpResponse, body) {...}) -var form = r.form(); +const r = request.post('http://service.com/upload', function optionalCallback(err, httpResponse, body) {...}) +const form = r.form(); form.append('my_field', 'my_value'); form.append('my_buffer', Buffer.from([1, 2, 3])); form.append('custom_file', fs.createReadStream(__dirname + '/unicycle.jpg'), {filename: 'unicycle.jpg'}); @@ -314,11 +322,11 @@ detailed in [RFC 1738](http://www.ietf.org/rfc/rfc1738.txt). Simply pass the `user:password` before the host with an `@` sign: ```js -var username = 'username', +const username = 'username', password = 'password', url = 'http://' + username + ':' + password + '@some.server.com'; -request({url: url}, function (error, response, body) { +request({url}, function (error, response, body) { // Do more stuff with 'body' here }); ``` @@ -347,9 +355,9 @@ of stars and forks for the request repository. This requires a custom `User-Agent` header as well as https. ```js -var request = require('request'); +const request = require('request'); -var options = { +const options = { url: 'https://api.github.com/repos/request/request', headers: { 'User-Agent': 'request' @@ -358,7 +366,7 @@ var options = { function callback(error, response, body) { if (!error && response.statusCode == 200) { - var info = JSON.parse(body); + const info = JSON.parse(body); console.log(info.stargazers_count + " Stars"); console.log(info.forks_count + " Forks"); } @@ -382,7 +390,7 @@ default signing algorithm is ```js // OAuth1.0 - 3-legged server side flow (Twitter example) // step 1 -var qs = require('querystring') +const qs = require('querystring') , oauth = { callback: 'http://mysite.com/callback/' , consumer_key: CONSUMER_KEY @@ -397,14 +405,14 @@ request.post({url:url, oauth:oauth}, function (e, r, body) { // verified with twitter that they are authorizing your app. // step 2 - var req_data = qs.parse(body) - var uri = 'https://api.twitter.com/oauth/authenticate' + const req_data = qs.parse(body) + const uri = 'https://api.twitter.com/oauth/authenticate' + '?' + qs.stringify({oauth_token: req_data.oauth_token}) // redirect the user to the authorize uri // step 3 // after the user is redirected back to your server - var auth_data = qs.parse(body) + const auth_data = qs.parse(body) , oauth = { consumer_key: CONSUMER_KEY , consumer_secret: CONSUMER_SECRET @@ -416,7 +424,7 @@ request.post({url:url, oauth:oauth}, function (e, r, body) { ; request.post({url:url, oauth:oauth}, function (e, r, body) { // ready to make signed requests on behalf of the user - var perm_data = qs.parse(body) + const perm_data = qs.parse(body) , oauth = { consumer_key: CONSUMER_KEY , consumer_secret: CONSUMER_SECRET @@ -605,14 +613,14 @@ TLS/SSL Protocol options, such as `cert`, `key` and `passphrase`, can be set directly in `options` object, in the `agentOptions` property of the `options` object, or even in `https.globalAgent.options`. Keep in mind that, although `agentOptions` allows for a slightly wider range of configurations, the recommended way is via `options` object directly, as using `agentOptions` or `https.globalAgent.options` would not be applied in the same way in proxied environments (as data travels through a TLS connection instead of an http/https agent). ```js -var fs = require('fs') +const fs = require('fs') , path = require('path') , certFile = path.resolve(__dirname, 'ssl/client.crt') , keyFile = path.resolve(__dirname, 'ssl/client.key') , caFile = path.resolve(__dirname, 'ssl/ca.cert.pem') , request = require('request'); -var options = { +const options = { url: 'https://api.some-server.com/', cert: fs.readFileSync(certFile), key: fs.readFileSync(keyFile), @@ -629,13 +637,13 @@ In the example below, we call an API that requires client side SSL certificate (in PEM format) with passphrase protected private key (in PEM format) and disable the SSLv3 protocol: ```js -var fs = require('fs') +const fs = require('fs') , path = require('path') , certFile = path.resolve(__dirname, 'ssl/client.crt') , keyFile = path.resolve(__dirname, 'ssl/client.key') , request = require('request'); -var options = { +const options = { url: 'https://api.some-server.com/', agentOptions: { cert: fs.readFileSync(certFile), @@ -675,6 +683,25 @@ request.get({ }); ``` +The `ca` value can be an array of certificates, in the event you have a private or internal corporate public-key infrastructure hierarchy. For example, if you want to connect to https://api.some-server.com which presents a key chain consisting of: +1. its own public key, which is signed by: +2. an intermediate "Corp Issuing Server", that is in turn signed by: +3. a root CA "Corp Root CA"; + +you can configure your request as follows: + +```js +request.get({ + url: 'https://api.some-server.com/', + agentOptions: { + ca: [ + fs.readFileSync('Corp Issuing Server.pem'), + fs.readFileSync('Corp Root CA.pem') + ] + } +}); +``` + [back to top](#table-of-contents) @@ -687,7 +714,7 @@ The `options.har` property will override the values: `url`, `method`, `qs`, `hea A validation step will check if the HAR Request format matches the latest spec (v1.2) and will skip parsing if not matching. ```js - var request = require('request') + const request = require('request') request({ // will be ignored method: 'GET', @@ -802,11 +829,9 @@ The first argument can be either a `url` or an `options` object. The only requir work around this, either use [`request.defaults`](#requestdefaultsoptions) with your pool options or create the pool object with the `maxSockets` property outside of the loop. -- `timeout` - integer containing the number of milliseconds to wait for a -server to send response headers (and start the response body) before aborting -the request. Note that if the underlying TCP connection cannot be established, -the OS-wide TCP connection timeout will overrule the `timeout` option ([the -default in Linux can be anywhere from 20-120 seconds][linux-timeout]). +- `timeout` - integer containing number of milliseconds, controls two timeouts. + - **Read timeout**: Time to wait for a server to send response headers (and start the response body) before aborting the request. + - **Connection timeout**: Sets the socket to timeout after `timeout` milliseconds of inactivity. Note that increasing the timeout beyond the OS-wide TCP connection timeout will not have any effect ([the default in Linux can be anywhere from 20-120 seconds][linux-timeout]) [linux-timeout]: http://www.sekuda.com/overriding_the_default_linux_kernel_20_second_tcp_socket_connect_timeout @@ -847,7 +872,7 @@ default in Linux can be anywhere from 20-120 seconds][linux-timeout]). - `download`: Duration of HTTP download (`timings.end` - `timings.response`) - `total`: Duration entire HTTP round-trip (`timings.end`) -- `har` - a [HAR 1.2 Request Object](http://www.softwareishard.com/blog/har-12-spec/#request), will be processed from HAR format into options overwriting matching values *(see the [HAR 1.2 section](#support-for-har-1.2) for details)* +- `har` - a [HAR 1.2 Request Object](http://www.softwareishard.com/blog/har-12-spec/#request), will be processed from HAR format into options overwriting matching values *(see the [HAR 1.2 section](#support-for-har-12) for details)* - `callback` - alternatively pass the request's callback in the options object The callback argument gets 3 arguments: @@ -880,13 +905,13 @@ instead, it **returns a wrapper** that has your default settings applied to it. For example: ```js //requests using baseRequest() will set the 'x-token' header -var baseRequest = request.defaults({ +const baseRequest = request.defaults({ headers: {'x-token': 'my-token'} }) //requests using specialRequest() will include the 'x-token' header set in //baseRequest and will also include the 'special' header -var specialRequest = baseRequest.defaults({ +const specialRequest = baseRequest.defaults({ headers: {special: 'special value'} }) ``` @@ -918,6 +943,17 @@ Function that creates a new cookie jar. request.jar() ``` +### response.caseless.get('header-name') + +Function that returns the specified response header field using a [case-insensitive match](https://tools.ietf.org/html/rfc7230#section-3.2) + +```js +request('http://www.google.com', function (error, response, body) { + // print the Content-Type header even if the server returned it as 'content-type' (lowercase) + console.log('Content-Type is:', response.caseless.get('Content-Type')); +}); +``` + [back to top](#table-of-contents) @@ -975,7 +1011,7 @@ request.get('http://10.255.255.1', {timeout: 1500}, function(err) { ## Examples: ```js - var request = require('request') + const request = require('request') , rand = Math.floor(Math.random()*100000000).toString() ; request( @@ -1006,7 +1042,7 @@ while the response object is unmodified and will contain compressed data if the server sent a compressed response. ```js - var request = require('request') + const request = require('request') request( { method: 'GET' , uri: 'http://www.google.com' @@ -1034,7 +1070,7 @@ the server sent a compressed response. Cookies are disabled by default (else, they would be used in subsequent requests). To enable cookies, set `jar` to `true` (either in `defaults` or `options`). ```js -var request = request.defaults({jar: true}) +const request = request.defaults({jar: true}) request('http://www.google.com', function () { request('http://images.google.com') }) @@ -1043,8 +1079,8 @@ request('http://www.google.com', function () { To use a custom cookie jar (instead of `request`’s global cookie jar), set `jar` to an instance of `request.jar()` (either in `defaults` or `options`) ```js -var j = request.jar() -var request = request.defaults({jar:j}) +const j = request.jar() +const request = request.defaults({jar:j}) request('http://www.google.com', function () { request('http://images.google.com') }) @@ -1053,9 +1089,9 @@ request('http://www.google.com', function () { OR ```js -var j = request.jar(); -var cookie = request.cookie('key1=value1'); -var url = 'http://www.google.com'; +const j = request.jar(); +const cookie = request.cookie('key1=value1'); +const url = 'http://www.google.com'; j.setCookie(cookie, url); request({url: url, jar: j}, function () { request('http://images.google.com') @@ -1068,9 +1104,9 @@ which supports saving to and restoring from JSON files), pass it as a parameter to `request.jar()`: ```js -var FileCookieStore = require('tough-cookie-filestore'); +const FileCookieStore = require('tough-cookie-filestore'); // NOTE - currently the 'cookies.json' file must already exist! -var j = request.jar(new FileCookieStore('cookies.json')); +const j = request.jar(new FileCookieStore('cookies.json')); request = request.defaults({ jar : j }) request('http://www.google.com', function() { request('http://images.google.com') @@ -1080,16 +1116,16 @@ request('http://www.google.com', function() { The cookie store must be a [`tough-cookie`](https://github.com/SalesforceEng/tough-cookie) store and it must support synchronous operations; see the -[`CookieStore` API docs](https://github.com/SalesforceEng/tough-cookie#cookiestore-api) +[`CookieStore` API docs](https://github.com/SalesforceEng/tough-cookie#api) for details. To inspect your cookie jar after a request: ```js -var j = request.jar() +const j = request.jar() request({url: 'http://www.google.com', jar: j}, function () { - var cookie_string = j.getCookieString(url); // "key1=value1; key2=value2; ..." - var cookies = j.getCookies(url); + const cookie_string = j.getCookieString(url); // "key1=value1; key2=value2; ..." + const cookies = j.getCookies(url); // [{key: 'key1', value: 'value1', domain: "www.google.com", ...}, ...] }) ``` diff --git a/deps/npm/node_modules/request/index.js b/deps/npm/node_modules/request/index.js index f9b480a1d0e3df..d50f9917b5f014 100755 --- a/deps/npm/node_modules/request/index.js +++ b/deps/npm/node_modules/request/index.js @@ -27,7 +27,7 @@ function initParams (uri, options, callback) { } var params = {} - if (typeof options === 'object') { + if (options !== null && typeof options === 'object') { extend(params, options, {uri: uri}) } else if (typeof uri === 'string') { extend(params, {uri: uri}) diff --git a/deps/npm/node_modules/request/lib/auth.js b/deps/npm/node_modules/request/lib/auth.js index f5edf32c34b9c9..02f203869324c3 100644 --- a/deps/npm/node_modules/request/lib/auth.js +++ b/deps/npm/node_modules/request/lib/auth.js @@ -62,7 +62,7 @@ Auth.prototype.digest = function (method, path, authHeader) { var challenge = {} var re = /([a-z0-9_-]+)=(?:"([^"]+)"|([a-z0-9_-]+))/gi - for (;;) { + while (true) { var match = re.exec(authHeader) if (!match) { break diff --git a/deps/npm/node_modules/request/lib/getProxyFromURI.js b/deps/npm/node_modules/request/lib/getProxyFromURI.js index 4633ba5f63cde0..0b9b18e5acfe13 100644 --- a/deps/npm/node_modules/request/lib/getProxyFromURI.js +++ b/deps/npm/node_modules/request/lib/getProxyFromURI.js @@ -40,7 +40,7 @@ function uriInNoProxy (uri, noProxy) { function getProxyFromURI (uri) { // Decide the proper request proxy to use based on the request URI object and the // environmental variables (NO_PROXY, HTTP_PROXY, etc.) - // respect NO_PROXY environment variables (see: http://lynx.isc.org/current/breakout/lynx_help/keystrokes/environments.html) + // respect NO_PROXY environment variables (see: https://lynx.invisible-island.net/lynx2.8.7/breakout/lynx_help/keystrokes/environments.html) var noProxy = process.env.NO_PROXY || process.env.no_proxy || '' diff --git a/deps/npm/node_modules/request/lib/har.js b/deps/npm/node_modules/request/lib/har.js index 2f660309d8cc91..0dedee44475e93 100644 --- a/deps/npm/node_modules/request/lib/har.js +++ b/deps/npm/node_modules/request/lib/har.js @@ -172,7 +172,7 @@ Har.prototype.options = function (options) { req.postData.params.forEach(function (param) { var attachment = {} - if (!param.fileName && !param.fileName && !param.contentType) { + if (!param.fileName && !param.contentType) { options.formData[param.name] = param.value return } diff --git a/deps/npm/node_modules/uuid/AUTHORS b/deps/npm/node_modules/request/node_modules/uuid/AUTHORS similarity index 100% rename from deps/npm/node_modules/uuid/AUTHORS rename to deps/npm/node_modules/request/node_modules/uuid/AUTHORS diff --git a/deps/npm/node_modules/request/node_modules/uuid/CHANGELOG.md b/deps/npm/node_modules/request/node_modules/uuid/CHANGELOG.md new file mode 100644 index 00000000000000..f811b8a0cb91cb --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/uuid/CHANGELOG.md @@ -0,0 +1,119 @@ +# 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. + +## [3.4.0](https://github.com/uuidjs/uuid/compare/v3.3.3...v3.4.0) (2020-01-16) + + +### Features + +* rename repository to github:uuidjs/uuid ([#351](https://github.com/uuidjs/uuid/issues/351)) ([e2d7314](https://github.com/uuidjs/uuid/commit/e2d7314)), closes [#338](https://github.com/uuidjs/uuid/issues/338) + +### [3.3.3](https://github.com/uuidjs/uuid/compare/v3.3.2...v3.3.3) (2019-08-19) + + +## [3.3.2](https://github.com/uuidjs/uuid/compare/v3.3.1...v3.3.2) (2018-06-28) + + +### Bug Fixes + +* typo ([305d877](https://github.com/uuidjs/uuid/commit/305d877)) + + + + +## [3.3.1](https://github.com/uuidjs/uuid/compare/v3.3.0...v3.3.1) (2018-06-28) + + +### Bug Fixes + +* fix [#284](https://github.com/uuidjs/uuid/issues/284) by setting function name in try-catch ([f2a60f2](https://github.com/uuidjs/uuid/commit/f2a60f2)) + + + + +# [3.3.0](https://github.com/uuidjs/uuid/compare/v3.2.1...v3.3.0) (2018-06-22) + + +### Bug Fixes + +* assignment to readonly property to allow running in strict mode ([#270](https://github.com/uuidjs/uuid/issues/270)) ([d062fdc](https://github.com/uuidjs/uuid/commit/d062fdc)) +* fix [#229](https://github.com/uuidjs/uuid/issues/229) ([c9684d4](https://github.com/uuidjs/uuid/commit/c9684d4)) +* Get correct version of IE11 crypto ([#274](https://github.com/uuidjs/uuid/issues/274)) ([153d331](https://github.com/uuidjs/uuid/commit/153d331)) +* mem issue when generating uuid ([#267](https://github.com/uuidjs/uuid/issues/267)) ([c47702c](https://github.com/uuidjs/uuid/commit/c47702c)) + +### Features + +* enforce Conventional Commit style commit messages ([#282](https://github.com/uuidjs/uuid/issues/282)) ([cc9a182](https://github.com/uuidjs/uuid/commit/cc9a182)) + + + +## [3.2.1](https://github.com/uuidjs/uuid/compare/v3.2.0...v3.2.1) (2018-01-16) + + +### Bug Fixes + +* use msCrypto if available. Fixes [#241](https://github.com/uuidjs/uuid/issues/241) ([#247](https://github.com/uuidjs/uuid/issues/247)) ([1fef18b](https://github.com/uuidjs/uuid/commit/1fef18b)) + + + + +# [3.2.0](https://github.com/uuidjs/uuid/compare/v3.1.0...v3.2.0) (2018-01-16) + + +### Bug Fixes + +* remove mistakenly added typescript dependency, rollback version (standard-version will auto-increment) ([09fa824](https://github.com/uuidjs/uuid/commit/09fa824)) +* use msCrypto if available. Fixes [#241](https://github.com/uuidjs/uuid/issues/241) ([#247](https://github.com/uuidjs/uuid/issues/247)) ([1fef18b](https://github.com/uuidjs/uuid/commit/1fef18b)) + + +### Features + +* Add v3 Support ([#217](https://github.com/uuidjs/uuid/issues/217)) ([d94f726](https://github.com/uuidjs/uuid/commit/d94f726)) + + +# [3.1.0](https://github.com/uuidjs/uuid/compare/v3.1.0...v3.0.1) (2017-06-17) + +### Bug Fixes + +* (fix) Add .npmignore file to exclude test/ and other non-essential files from packing. (#183) +* Fix typo (#178) +* Simple typo fix (#165) + +### Features +* v5 support in CLI (#197) +* V5 support (#188) + + +# 3.0.1 (2016-11-28) + +* split uuid versions into separate files + + +# 3.0.0 (2016-11-17) + +* remove .parse and .unparse + + +# 2.0.0 + +* Removed uuid.BufferClass + + +# 1.4.0 + +* Improved module context detection +* Removed public RNG functions + + +# 1.3.2 + +* Improve tests and handling of v1() options (Issue #24) +* Expose RNG option to allow for perf testing with different generators + + +# 1.3.0 + +* Support for version 1 ids, thanks to [@ctavan](https://github.com/ctavan)! +* Support for node.js crypto API +* De-emphasizing performance in favor of a) cryptographic quality PRNGs where available and b) more manageable code diff --git a/deps/npm/node_modules/request/node_modules/uuid/LICENSE.md b/deps/npm/node_modules/request/node_modules/uuid/LICENSE.md new file mode 100644 index 00000000000000..8c84e398668b79 --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/uuid/LICENSE.md @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2010-2016 Robert Kieffer and other contributors + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/deps/npm/node_modules/request/node_modules/uuid/README.md b/deps/npm/node_modules/request/node_modules/uuid/README.md new file mode 100644 index 00000000000000..6bccc345ee08e4 --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/uuid/README.md @@ -0,0 +1,276 @@ + + +# uuid [![Build Status](https://secure.travis-ci.org/kelektiv/node-uuid.svg?branch=master)](http://travis-ci.org/kelektiv/node-uuid) # + +Simple, fast generation of [RFC4122](http://www.ietf.org/rfc/rfc4122.txt) UUIDS. + +Features: + +* Support for version 1, 3, 4 and 5 UUIDs +* Cross-platform +* Uses cryptographically-strong random number APIs (when available) +* Zero-dependency, small footprint (... but not [this small](https://gist.github.com/982883)) + +[**Deprecation warning**: The use of `require('uuid')` is deprecated and will not be +supported after version 3.x of this module. Instead, use `require('uuid/[v1|v3|v4|v5]')` as shown in the examples below.] + +## Quickstart - CommonJS (Recommended) + +```shell +npm install uuid +``` + +Then generate your uuid version of choice ... + +Version 1 (timestamp): + +```javascript +const uuidv1 = require('uuid/v1'); +uuidv1(); // ⇨ '2c5ea4c0-4067-11e9-8bad-9b1deb4d3b7d' + +``` + +Version 3 (namespace): + +```javascript +const uuidv3 = require('uuid/v3'); + +// ... using predefined DNS namespace (for domain names) +uuidv3('hello.example.com', uuidv3.DNS); // ⇨ '9125a8dc-52ee-365b-a5aa-81b0b3681cf6' + +// ... using predefined URL namespace (for, well, URLs) +uuidv3('http://example.com/hello', uuidv3.URL); // ⇨ 'c6235813-3ba4-3801-ae84-e0a6ebb7d138' + +// ... using a custom namespace +// +// Note: Custom namespaces should be a UUID string specific to your application! +// E.g. the one here was generated using this modules `uuid` CLI. +const MY_NAMESPACE = '1b671a64-40d5-491e-99b0-da01ff1f3341'; +uuidv3('Hello, World!', MY_NAMESPACE); // ⇨ 'e8b5a51d-11c8-3310-a6ab-367563f20686' + +``` + +Version 4 (random): + +```javascript +const uuidv4 = require('uuid/v4'); +uuidv4(); // ⇨ '1b9d6bcd-bbfd-4b2d-9b5d-ab8dfbbd4bed' + +``` + +Version 5 (namespace): + +```javascript +const uuidv5 = require('uuid/v5'); + +// ... using predefined DNS namespace (for domain names) +uuidv5('hello.example.com', uuidv5.DNS); // ⇨ 'fdda765f-fc57-5604-a269-52a7df8164ec' + +// ... using predefined URL namespace (for, well, URLs) +uuidv5('http://example.com/hello', uuidv5.URL); // ⇨ '3bbcee75-cecc-5b56-8031-b6641c1ed1f1' + +// ... using a custom namespace +// +// Note: Custom namespaces should be a UUID string specific to your application! +// E.g. the one here was generated using this modules `uuid` CLI. +const MY_NAMESPACE = '1b671a64-40d5-491e-99b0-da01ff1f3341'; +uuidv5('Hello, World!', MY_NAMESPACE); // ⇨ '630eb68f-e0fa-5ecc-887a-7c7a62614681' + +``` + +## API + +### Version 1 + +```javascript +const uuidv1 = require('uuid/v1'); + +// Incantations +uuidv1(); +uuidv1(options); +uuidv1(options, buffer, offset); +``` + +Generate and return a RFC4122 v1 (timestamp-based) UUID. + +* `options` - (Object) Optional uuid state to apply. Properties may include: + + * `node` - (Array) Node id as Array of 6 bytes (per 4.1.6). Default: Randomly generated ID. See note 1. + * `clockseq` - (Number between 0 - 0x3fff) RFC clock sequence. Default: An internally maintained clockseq is used. + * `msecs` - (Number) Time in milliseconds since unix Epoch. Default: The current time is used. + * `nsecs` - (Number between 0-9999) additional time, in 100-nanosecond units. Ignored if `msecs` is unspecified. Default: internal uuid counter is used, as per 4.2.1.2. + +* `buffer` - (Array | Buffer) Array or buffer where UUID bytes are to be written. +* `offset` - (Number) Starting index in `buffer` at which to begin writing. + +Returns `buffer`, if specified, otherwise the string form of the UUID + +Note: The default [node id](https://tools.ietf.org/html/rfc4122#section-4.1.6) (the last 12 digits in the UUID) is generated once, randomly, on process startup, and then remains unchanged for the duration of the process. + +Example: Generate string UUID with fully-specified options + +```javascript +const v1options = { + node: [0x01, 0x23, 0x45, 0x67, 0x89, 0xab], + clockseq: 0x1234, + msecs: new Date('2011-11-01').getTime(), + nsecs: 5678 +}; +uuidv1(v1options); // ⇨ '710b962e-041c-11e1-9234-0123456789ab' + +``` + +Example: In-place generation of two binary IDs + +```javascript +// Generate two ids in an array +const arr = new Array(); +uuidv1(null, arr, 0); // ⇨ + // [ + // 44, 94, 164, 192, 64, 103, + // 17, 233, 146, 52, 155, 29, + // 235, 77, 59, 125 + // ] +uuidv1(null, arr, 16); // ⇨ + // [ + // 44, 94, 164, 192, 64, 103, 17, 233, + // 146, 52, 155, 29, 235, 77, 59, 125, + // 44, 94, 164, 193, 64, 103, 17, 233, + // 146, 52, 155, 29, 235, 77, 59, 125 + // ] + +``` + +### Version 3 + +```javascript +const uuidv3 = require('uuid/v3'); + +// Incantations +uuidv3(name, namespace); +uuidv3(name, namespace, buffer); +uuidv3(name, namespace, buffer, offset); +``` + +Generate and return a RFC4122 v3 UUID. + +* `name` - (String | Array[]) "name" to create UUID with +* `namespace` - (String | Array[]) "namespace" UUID either as a String or Array[16] of byte values +* `buffer` - (Array | Buffer) Array or buffer where UUID bytes are to be written. +* `offset` - (Number) Starting index in `buffer` at which to begin writing. Default = 0 + +Returns `buffer`, if specified, otherwise the string form of the UUID + +Example: + +```javascript +uuidv3('hello world', MY_NAMESPACE); // ⇨ '042ffd34-d989-321c-ad06-f60826172424' + +``` + +### Version 4 + +```javascript +const uuidv4 = require('uuid/v4') + +// Incantations +uuidv4(); +uuidv4(options); +uuidv4(options, buffer, offset); +``` + +Generate and return a RFC4122 v4 UUID. + +* `options` - (Object) Optional uuid state to apply. Properties may include: + * `random` - (Number[16]) Array of 16 numbers (0-255) to use in place of randomly generated values + * `rng` - (Function) Random # generator function that returns an Array[16] of byte values (0-255) +* `buffer` - (Array | Buffer) Array or buffer where UUID bytes are to be written. +* `offset` - (Number) Starting index in `buffer` at which to begin writing. + +Returns `buffer`, if specified, otherwise the string form of the UUID + +Example: Generate string UUID with predefined `random` values + +```javascript +const v4options = { + random: [ + 0x10, 0x91, 0x56, 0xbe, 0xc4, 0xfb, 0xc1, 0xea, + 0x71, 0xb4, 0xef, 0xe1, 0x67, 0x1c, 0x58, 0x36 + ] +}; +uuidv4(v4options); // ⇨ '109156be-c4fb-41ea-b1b4-efe1671c5836' + +``` + +Example: Generate two IDs in a single buffer + +```javascript +const buffer = new Array(); +uuidv4(null, buffer, 0); // ⇨ + // [ + // 155, 29, 235, 77, 59, + // 125, 75, 173, 155, 221, + // 43, 13, 123, 61, 203, + // 109 + // ] +uuidv4(null, buffer, 16); // ⇨ + // [ + // 155, 29, 235, 77, 59, 125, 75, 173, + // 155, 221, 43, 13, 123, 61, 203, 109, + // 27, 157, 107, 205, 187, 253, 75, 45, + // 155, 93, 171, 141, 251, 189, 75, 237 + // ] + +``` + +### Version 5 + +```javascript +const uuidv5 = require('uuid/v5'); + +// Incantations +uuidv5(name, namespace); +uuidv5(name, namespace, buffer); +uuidv5(name, namespace, buffer, offset); +``` + +Generate and return a RFC4122 v5 UUID. + +* `name` - (String | Array[]) "name" to create UUID with +* `namespace` - (String | Array[]) "namespace" UUID either as a String or Array[16] of byte values +* `buffer` - (Array | Buffer) Array or buffer where UUID bytes are to be written. +* `offset` - (Number) Starting index in `buffer` at which to begin writing. Default = 0 + +Returns `buffer`, if specified, otherwise the string form of the UUID + +Example: + +```javascript +uuidv5('hello world', MY_NAMESPACE); // ⇨ '9f282611-e0fd-5650-8953-89c8e342da0b' + +``` + +## Command Line + +UUIDs can be generated from the command line with the `uuid` command. + +```shell +$ uuid +ddeb27fb-d9a0-4624-be4d-4615062daed4 + +$ uuid v1 +02d37060-d446-11e7-a9fa-7bdae751ebe1 +``` + +Type `uuid --help` for usage details + +## Testing + +```shell +npm test +``` + +---- +Markdown generated from [README_js.md](README_js.md) by [![RunMD Logo](http://i.imgur.com/h0FVyzU.png)](https://github.com/broofa/runmd) \ No newline at end of file diff --git a/deps/npm/node_modules/uuid/bin/uuid b/deps/npm/node_modules/request/node_modules/uuid/bin/uuid similarity index 100% rename from deps/npm/node_modules/uuid/bin/uuid rename to deps/npm/node_modules/request/node_modules/uuid/bin/uuid diff --git a/deps/npm/node_modules/uuid/index.js b/deps/npm/node_modules/request/node_modules/uuid/index.js similarity index 100% rename from deps/npm/node_modules/uuid/index.js rename to deps/npm/node_modules/request/node_modules/uuid/index.js diff --git a/deps/npm/node_modules/request/node_modules/uuid/lib/bytesToUuid.js b/deps/npm/node_modules/request/node_modules/uuid/lib/bytesToUuid.js new file mode 100644 index 00000000000000..24b60412a2d44f --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/uuid/lib/bytesToUuid.js @@ -0,0 +1,26 @@ +/** + * Convert array of 16 byte values to UUID string format of the form: + * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX + */ +var byteToHex = []; +for (var i = 0; i < 256; ++i) { + byteToHex[i] = (i + 0x100).toString(16).substr(1); +} + +function bytesToUuid(buf, offset) { + var i = offset || 0; + var bth = byteToHex; + // join used to fix memory issue caused by concatenation: https://bugs.chromium.org/p/v8/issues/detail?id=3175#c4 + return ([ + bth[buf[i++]], bth[buf[i++]], + bth[buf[i++]], bth[buf[i++]], '-', + bth[buf[i++]], bth[buf[i++]], '-', + bth[buf[i++]], bth[buf[i++]], '-', + bth[buf[i++]], bth[buf[i++]], '-', + bth[buf[i++]], bth[buf[i++]], + bth[buf[i++]], bth[buf[i++]], + bth[buf[i++]], bth[buf[i++]] + ]).join(''); +} + +module.exports = bytesToUuid; diff --git a/deps/npm/node_modules/uuid/lib/md5-browser.js b/deps/npm/node_modules/request/node_modules/uuid/lib/md5-browser.js similarity index 100% rename from deps/npm/node_modules/uuid/lib/md5-browser.js rename to deps/npm/node_modules/request/node_modules/uuid/lib/md5-browser.js diff --git a/deps/npm/node_modules/uuid/lib/md5.js b/deps/npm/node_modules/request/node_modules/uuid/lib/md5.js similarity index 100% rename from deps/npm/node_modules/uuid/lib/md5.js rename to deps/npm/node_modules/request/node_modules/uuid/lib/md5.js diff --git a/deps/npm/node_modules/uuid/lib/rng-browser.js b/deps/npm/node_modules/request/node_modules/uuid/lib/rng-browser.js similarity index 100% rename from deps/npm/node_modules/uuid/lib/rng-browser.js rename to deps/npm/node_modules/request/node_modules/uuid/lib/rng-browser.js diff --git a/deps/npm/node_modules/uuid/lib/rng.js b/deps/npm/node_modules/request/node_modules/uuid/lib/rng.js similarity index 100% rename from deps/npm/node_modules/uuid/lib/rng.js rename to deps/npm/node_modules/request/node_modules/uuid/lib/rng.js diff --git a/deps/npm/node_modules/uuid/lib/sha1-browser.js b/deps/npm/node_modules/request/node_modules/uuid/lib/sha1-browser.js similarity index 100% rename from deps/npm/node_modules/uuid/lib/sha1-browser.js rename to deps/npm/node_modules/request/node_modules/uuid/lib/sha1-browser.js diff --git a/deps/npm/node_modules/uuid/lib/sha1.js b/deps/npm/node_modules/request/node_modules/uuid/lib/sha1.js similarity index 100% rename from deps/npm/node_modules/uuid/lib/sha1.js rename to deps/npm/node_modules/request/node_modules/uuid/lib/sha1.js diff --git a/deps/npm/node_modules/uuid/lib/v35.js b/deps/npm/node_modules/request/node_modules/uuid/lib/v35.js similarity index 100% rename from deps/npm/node_modules/uuid/lib/v35.js rename to deps/npm/node_modules/request/node_modules/uuid/lib/v35.js diff --git a/deps/npm/node_modules/request/node_modules/uuid/package.json b/deps/npm/node_modules/request/node_modules/uuid/package.json new file mode 100644 index 00000000000000..efc07b8f6c3f73 --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/uuid/package.json @@ -0,0 +1,49 @@ +{ + "name": "uuid", + "version": "3.4.0", + "description": "RFC4122 (v1, v4, and v5) UUIDs", + "commitlint": { + "extends": [ + "@commitlint/config-conventional" + ] + }, + "keywords": [ + "uuid", + "guid", + "rfc4122" + ], + "license": "MIT", + "bin": { + "uuid": "./bin/uuid" + }, + "devDependencies": { + "@commitlint/cli": "~8.2.0", + "@commitlint/config-conventional": "~8.2.0", + "eslint": "~6.4.0", + "husky": "~3.0.5", + "mocha": "6.2.0", + "runmd": "1.2.1", + "standard-version": "7.0.0" + }, + "scripts": { + "lint": "eslint .", + "test": "npm run lint && mocha test/test.js", + "md": "runmd --watch --output=README.md README_js.md", + "release": "standard-version", + "prepare": "runmd --output=README.md README_js.md" + }, + "browser": { + "./lib/rng.js": "./lib/rng-browser.js", + "./lib/sha1.js": "./lib/sha1-browser.js", + "./lib/md5.js": "./lib/md5-browser.js" + }, + "repository": { + "type": "git", + "url": "https://github.com/uuidjs/uuid.git" + }, + "husky": { + "hooks": { + "commit-msg": "commitlint -E HUSKY_GIT_PARAMS" + } + } +} diff --git a/deps/npm/node_modules/request/node_modules/uuid/v1.js b/deps/npm/node_modules/request/node_modules/uuid/v1.js new file mode 100644 index 00000000000000..8c245de43dbbcd --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/uuid/v1.js @@ -0,0 +1,109 @@ +var rng = require('./lib/rng'); +var bytesToUuid = require('./lib/bytesToUuid'); + +// **`v1()` - Generate time-based UUID** +// +// Inspired by https://github.com/LiosK/UUID.js +// and http://docs.python.org/library/uuid.html + +var _nodeId; +var _clockseq; + +// Previous uuid creation time +var _lastMSecs = 0; +var _lastNSecs = 0; + +// See https://github.com/uuidjs/uuid for API details +function v1(options, buf, offset) { + var i = buf && offset || 0; + var b = buf || []; + + options = options || {}; + var node = options.node || _nodeId; + var clockseq = options.clockseq !== undefined ? options.clockseq : _clockseq; + + // node and clockseq need to be initialized to random values if they're not + // specified. We do this lazily to minimize issues related to insufficient + // system entropy. See #189 + if (node == null || clockseq == null) { + var seedBytes = rng(); + if (node == null) { + // Per 4.5, create and 48-bit node id, (47 random bits + multicast bit = 1) + node = _nodeId = [ + seedBytes[0] | 0x01, + seedBytes[1], seedBytes[2], seedBytes[3], seedBytes[4], seedBytes[5] + ]; + } + if (clockseq == null) { + // Per 4.2.2, randomize (14 bit) clockseq + clockseq = _clockseq = (seedBytes[6] << 8 | seedBytes[7]) & 0x3fff; + } + } + + // UUID timestamps are 100 nano-second units since the Gregorian epoch, + // (1582-10-15 00:00). JSNumbers aren't precise enough for this, so + // time is handled internally as 'msecs' (integer milliseconds) and 'nsecs' + // (100-nanoseconds offset from msecs) since unix epoch, 1970-01-01 00:00. + var msecs = options.msecs !== undefined ? options.msecs : new Date().getTime(); + + // Per 4.2.1.2, use count of uuid's generated during the current clock + // cycle to simulate higher resolution clock + var nsecs = options.nsecs !== undefined ? options.nsecs : _lastNSecs + 1; + + // Time since last uuid creation (in msecs) + var dt = (msecs - _lastMSecs) + (nsecs - _lastNSecs)/10000; + + // Per 4.2.1.2, Bump clockseq on clock regression + if (dt < 0 && options.clockseq === undefined) { + clockseq = clockseq + 1 & 0x3fff; + } + + // Reset nsecs if clock regresses (new clockseq) or we've moved onto a new + // time interval + if ((dt < 0 || msecs > _lastMSecs) && options.nsecs === undefined) { + nsecs = 0; + } + + // Per 4.2.1.2 Throw error if too many uuids are requested + if (nsecs >= 10000) { + throw new Error('uuid.v1(): Can\'t create more than 10M uuids/sec'); + } + + _lastMSecs = msecs; + _lastNSecs = nsecs; + _clockseq = clockseq; + + // Per 4.1.4 - Convert from unix epoch to Gregorian epoch + msecs += 12219292800000; + + // `time_low` + var tl = ((msecs & 0xfffffff) * 10000 + nsecs) % 0x100000000; + b[i++] = tl >>> 24 & 0xff; + b[i++] = tl >>> 16 & 0xff; + b[i++] = tl >>> 8 & 0xff; + b[i++] = tl & 0xff; + + // `time_mid` + var tmh = (msecs / 0x100000000 * 10000) & 0xfffffff; + b[i++] = tmh >>> 8 & 0xff; + b[i++] = tmh & 0xff; + + // `time_high_and_version` + b[i++] = tmh >>> 24 & 0xf | 0x10; // include version + b[i++] = tmh >>> 16 & 0xff; + + // `clock_seq_hi_and_reserved` (Per 4.2.2 - include variant) + b[i++] = clockseq >>> 8 | 0x80; + + // `clock_seq_low` + b[i++] = clockseq & 0xff; + + // `node` + for (var n = 0; n < 6; ++n) { + b[i + n] = node[n]; + } + + return buf ? buf : bytesToUuid(b); +} + +module.exports = v1; diff --git a/deps/npm/node_modules/uuid/v3.js b/deps/npm/node_modules/request/node_modules/uuid/v3.js similarity index 100% rename from deps/npm/node_modules/uuid/v3.js rename to deps/npm/node_modules/request/node_modules/uuid/v3.js diff --git a/deps/npm/node_modules/uuid/v4.js b/deps/npm/node_modules/request/node_modules/uuid/v4.js similarity index 100% rename from deps/npm/node_modules/uuid/v4.js rename to deps/npm/node_modules/request/node_modules/uuid/v4.js diff --git a/deps/npm/node_modules/uuid/v5.js b/deps/npm/node_modules/request/node_modules/uuid/v5.js similarity index 100% rename from deps/npm/node_modules/uuid/v5.js rename to deps/npm/node_modules/request/node_modules/uuid/v5.js diff --git a/deps/npm/node_modules/request/package.json b/deps/npm/node_modules/request/package.json index ca78c960745870..cbb2f2ede0f67e 100644 --- a/deps/npm/node_modules/request/package.json +++ b/deps/npm/node_modules/request/package.json @@ -1,42 +1,31 @@ { - "_from": "request@latest", - "_id": "request@2.88.0", - "_inBundle": false, - "_integrity": "sha512-NAqBSrijGLZdM0WZNsInLJpkJokL72XYjUpnB0iwsRgxh7dB6COrHnTBNwN0E+lHDAJzu7kLAkDeY08z2/A0hg==", - "_location": "/request", - "_phantomChildren": {}, - "_requested": { - "type": "tag", - "registry": true, - "raw": "request@latest", - "name": "request", - "escapedName": "request", - "rawSpec": "latest", - "saveSpec": null, - "fetchSpec": "latest" - }, - "_requiredBy": [ - "#USER", - "/", - "/cloudant-follow", - "/couchapp", - "/coveralls", - "/nano", - "/node-gyp", - "/npm-registry-client" + "name": "request", + "description": "Simplified HTTP request client.", + "keywords": [ + "http", + "simple", + "util", + "utility" ], - "_resolved": "https://registry.npmjs.org/request/-/request-2.88.0.tgz", - "_shasum": "9c2fca4f7d35b592efe57c7f0a55e81052124fef", - "_spec": "request@latest", - "_where": "/Users/zkat/Documents/code/work/npm", - "author": { - "name": "Mikeal Rogers", - "email": "mikeal.rogers@gmail.com" + "version": "2.88.2", + "author": "Mikeal Rogers ", + "repository": { + "type": "git", + "url": "https://github.com/request/request.git" }, "bugs": { "url": "http://github.com/request/request/issues" }, - "bundleDependencies": false, + "license": "Apache-2.0", + "engines": { + "node": ">= 6" + }, + "main": "index.js", + "files": [ + "lib/", + "index.js", + "request.js" + ], "dependencies": { "aws-sign2": "~0.7.0", "aws4": "^1.8.0", @@ -45,7 +34,7 @@ "extend": "~3.0.2", "forever-agent": "~0.6.1", "form-data": "~2.3.2", - "har-validator": "~5.1.0", + "har-validator": "~5.1.3", "http-signature": "~1.2.0", "is-typedarray": "~1.0.0", "isstream": "~0.1.2", @@ -55,12 +44,17 @@ "performance-now": "^2.1.0", "qs": "~6.5.2", "safe-buffer": "^5.1.2", - "tough-cookie": "~2.4.3", + "tough-cookie": "~2.5.0", "tunnel-agent": "^0.6.0", "uuid": "^3.3.2" }, - "deprecated": false, - "description": "Simplified HTTP request client.", + "scripts": { + "test": "npm run lint && npm run test-ci && npm run test-browser", + "test-ci": "taper tests/test-*.js", + "test-cov": "nyc --reporter=lcov tape tests/test-*.js", + "test-browser": "node tests/browser/start.js", + "lint": "standard" + }, "devDependencies": { "bluebird": "^3.2.1", "browserify": "^13.0.1", @@ -69,13 +63,13 @@ "codecov": "^3.0.4", "coveralls": "^3.0.2", "function-bind": "^1.0.2", - "istanbul": "^0.4.0", "karma": "^3.0.0", "karma-browserify": "^5.0.1", "karma-cli": "^1.0.0", "karma-coverage": "^1.0.0", "karma-phantomjs-launcher": "^1.0.0", "karma-tap": "^3.0.1", + "nyc": "^14.1.1", "phantomjs-prebuilt": "^2.1.3", "rimraf": "^2.2.8", "server-destroy": "^1.0.1", @@ -83,40 +77,10 @@ "tape": "^4.6.0", "taper": "^0.5.0" }, - "engines": { - "node": ">= 4" - }, - "files": [ - "lib/", - "index.js", - "request.js" - ], "greenkeeper": { "ignore": [ "hawk", "har-validator" ] - }, - "homepage": "https://github.com/request/request#readme", - "keywords": [ - "http", - "simple", - "util", - "utility" - ], - "license": "Apache-2.0", - "main": "index.js", - "name": "request", - "repository": { - "type": "git", - "url": "git+https://github.com/request/request.git" - }, - "scripts": { - "lint": "standard", - "test": "npm run lint && npm run test-ci && npm run test-browser", - "test-browser": "node tests/browser/start.js", - "test-ci": "taper tests/test-*.js", - "test-cov": "istanbul cover tape tests/test-*.js" - }, - "version": "2.88.0" + } } diff --git a/deps/npm/node_modules/request/request.js b/deps/npm/node_modules/request/request.js index 90bed4f4acb70d..198b76093c799c 100644 --- a/deps/npm/node_modules/request/request.js +++ b/deps/npm/node_modules/request/request.js @@ -828,8 +828,7 @@ Request.prototype.start = function () { if (isConnecting) { var onReqSockConnect = function () { socket.removeListener('connect', onReqSockConnect) - clearTimeout(self.timeoutTimer) - self.timeoutTimer = null + self.clearTimeout() setReqTimeout() } @@ -874,10 +873,7 @@ Request.prototype.onRequestError = function (error) { self.req.end() return } - if (self.timeout && self.timeoutTimer) { - clearTimeout(self.timeoutTimer) - self.timeoutTimer = null - } + self.clearTimeout() self.emit('error', error) } @@ -964,10 +960,7 @@ Request.prototype.onRequestResponse = function (response) { if (self.setHost) { self.removeHeader('host') } - if (self.timeout && self.timeoutTimer) { - clearTimeout(self.timeoutTimer) - self.timeoutTimer = null - } + self.clearTimeout() var targetCookieJar = (self._jar && self._jar.setCookie) ? self._jar : globalCookieJar var addCookie = function (cookie) { @@ -1172,6 +1165,7 @@ Request.prototype.abort = function () { self.response.destroy() } + self.clearTimeout() self.emit('abort') } @@ -1448,7 +1442,7 @@ Request.prototype.jar = function (jar) { cookies = false self._disableCookies = true } else { - var targetCookieJar = (jar && jar.getCookieString) ? jar : globalCookieJar + var targetCookieJar = jar.getCookieString ? jar : globalCookieJar var urihref = self.uri.href // fetch cookie in the Specified host if (targetCookieJar) { @@ -1532,6 +1526,7 @@ Request.prototype.resume = function () { } Request.prototype.destroy = function () { var self = this + this.clearTimeout() if (!self._ended) { self.end() } else if (self.response) { @@ -1539,6 +1534,13 @@ Request.prototype.destroy = function () { } } +Request.prototype.clearTimeout = function () { + if (this.timeoutTimer) { + clearTimeout(this.timeoutTimer) + this.timeoutTimer = null + } +} + Request.defaultProxyHeaderWhiteList = Tunnel.defaultProxyHeaderWhiteList.slice() diff --git a/deps/npm/node_modules/require-directory/.npmignore b/deps/npm/node_modules/require-directory/.npmignore deleted file mode 100644 index 47cf365a0785e3..00000000000000 --- a/deps/npm/node_modules/require-directory/.npmignore +++ /dev/null @@ -1 +0,0 @@ -test/** diff --git a/deps/npm/node_modules/require-directory/.travis.yml b/deps/npm/node_modules/require-directory/.travis.yml deleted file mode 100644 index 20fd86b6a5bee3..00000000000000 --- a/deps/npm/node_modules/require-directory/.travis.yml +++ /dev/null @@ -1,3 +0,0 @@ -language: node_js -node_js: - - 0.10 diff --git a/deps/npm/node_modules/require-directory/LICENSE b/deps/npm/node_modules/require-directory/LICENSE deleted file mode 100644 index a70f253aa4b5c7..00000000000000 --- a/deps/npm/node_modules/require-directory/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2011 Troy Goode - -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/require-directory/README.markdown b/deps/npm/node_modules/require-directory/README.markdown deleted file mode 100644 index 926a063ed1f897..00000000000000 --- a/deps/npm/node_modules/require-directory/README.markdown +++ /dev/null @@ -1,184 +0,0 @@ -# require-directory - -Recursively iterates over specified directory, `require()`'ing each file, and returning a nested hash structure containing those modules. - -**[Follow me (@troygoode) on Twitter!](https://twitter.com/intent/user?screen_name=troygoode)** - -[![NPM](https://nodei.co/npm/require-directory.png?downloads=true&stars=true)](https://nodei.co/npm/require-directory/) - -[![build status](https://secure.travis-ci.org/troygoode/node-require-directory.png)](http://travis-ci.org/troygoode/node-require-directory) - -## How To Use - -### Installation (via [npm](https://npmjs.org/package/require-directory)) - -```bash -$ npm install require-directory -``` - -### Usage - -A common pattern in node.js is to include an index file which creates a hash of the files in its current directory. Given a directory structure like so: - -* app.js -* routes/ - * index.js - * home.js - * auth/ - * login.js - * logout.js - * register.js - -`routes/index.js` uses `require-directory` to build the hash (rather than doing so manually) like so: - -```javascript -var requireDirectory = require('require-directory'); -module.exports = requireDirectory(module); -``` - -`app.js` references `routes/index.js` like any other module, but it now has a hash/tree of the exports from the `./routes/` directory: - -```javascript -var routes = require('./routes'); - -// snip - -app.get('/', routes.home); -app.get('/register', routes.auth.register); -app.get('/login', routes.auth.login); -app.get('/logout', routes.auth.logout); -``` - -The `routes` variable above is the equivalent of this: - -```javascript -var routes = { - home: require('routes/home.js'), - auth: { - login: require('routes/auth/login.js'), - logout: require('routes/auth/logout.js'), - register: require('routes/auth/register.js') - } -}; -``` - -*Note that `routes.index` will be `undefined` as you would hope.* - -### Specifying Another Directory - -You can specify which directory you want to build a tree of (if it isn't the current directory for whatever reason) by passing it as the second parameter. Not specifying the path (`requireDirectory(module)`) is the equivelant of `requireDirectory(module, __dirname)`: - -```javascript -var requireDirectory = require('require-directory'); -module.exports = requireDirectory(module, './some/subdirectory'); -``` - -For example, in the [example in the Usage section](#usage) we could have avoided creating `routes/index.js` and instead changed the first lines of `app.js` to: - -```javascript -var requireDirectory = require('require-directory'); -var routes = requireDirectory(module, './routes'); -``` - -## Options - -You can pass an options hash to `require-directory` as the 2nd parameter (or 3rd if you're passing the path to another directory as the 2nd parameter already). Here are the available options: - -### Whitelisting - -Whitelisting (either via RegExp or function) allows you to specify that only certain files be loaded. - -```javascript -var requireDirectory = require('require-directory'), - whitelist = /onlyinclude.js$/, - hash = requireDirectory(module, {include: whitelist}); -``` - -```javascript -var requireDirectory = require('require-directory'), - check = function(path){ - if(/onlyinclude.js$/.test(path)){ - return true; // don't include - }else{ - return false; // go ahead and include - } - }, - hash = requireDirectory(module, {include: check}); -``` - -### Blacklisting - -Blacklisting (either via RegExp or function) allows you to specify that all but certain files should be loaded. - -```javascript -var requireDirectory = require('require-directory'), - blacklist = /dontinclude\.js$/, - hash = requireDirectory(module, {exclude: blacklist}); -``` - -```javascript -var requireDirectory = require('require-directory'), - check = function(path){ - if(/dontinclude\.js$/.test(path)){ - return false; // don't include - }else{ - return true; // go ahead and include - } - }, - hash = requireDirectory(module, {exclude: check}); -``` - -### Visiting Objects As They're Loaded - -`require-directory` takes a function as the `visit` option that will be called for each module that is added to module.exports. - -```javascript -var requireDirectory = require('require-directory'), - visitor = function(obj) { - console.log(obj); // will be called for every module that is loaded - }, - hash = requireDirectory(module, {visit: visitor}); -``` - -The visitor can also transform the objects by returning a value: - -```javascript -var requireDirectory = require('require-directory'), - visitor = function(obj) { - return obj(new Date()); - }, - hash = requireDirectory(module, {visit: visitor}); -``` - -### Renaming Keys - -```javascript -var requireDirectory = require('require-directory'), - renamer = function(name) { - return name.toUpperCase(); - }, - hash = requireDirectory(module, {rename: renamer}); -``` - -### No Recursion - -```javascript -var requireDirectory = require('require-directory'), - hash = requireDirectory(module, {recurse: false}); -``` - -## Run Unit Tests - -```bash -$ npm run lint -$ npm test -``` - -## License - -[MIT License](http://www.opensource.org/licenses/mit-license.php) - -## Author - -[Troy Goode](https://github.com/TroyGoode) ([troygoode@gmail.com](mailto:troygoode@gmail.com)) - diff --git a/deps/npm/node_modules/require-directory/index.js b/deps/npm/node_modules/require-directory/index.js deleted file mode 100644 index cd37da7ea87094..00000000000000 --- a/deps/npm/node_modules/require-directory/index.js +++ /dev/null @@ -1,86 +0,0 @@ -'use strict'; - -var fs = require('fs'), - join = require('path').join, - resolve = require('path').resolve, - dirname = require('path').dirname, - defaultOptions = { - extensions: ['js', 'json', 'coffee'], - recurse: true, - rename: function (name) { - return name; - }, - visit: function (obj) { - return obj; - } - }; - -function checkFileInclusion(path, filename, options) { - return ( - // verify file has valid extension - (new RegExp('\\.(' + options.extensions.join('|') + ')$', 'i').test(filename)) && - - // if options.include is a RegExp, evaluate it and make sure the path passes - !(options.include && options.include instanceof RegExp && !options.include.test(path)) && - - // if options.include is a function, evaluate it and make sure the path passes - !(options.include && typeof options.include === 'function' && !options.include(path, filename)) && - - // if options.exclude is a RegExp, evaluate it and make sure the path doesn't pass - !(options.exclude && options.exclude instanceof RegExp && options.exclude.test(path)) && - - // if options.exclude is a function, evaluate it and make sure the path doesn't pass - !(options.exclude && typeof options.exclude === 'function' && options.exclude(path, filename)) - ); -} - -function requireDirectory(m, path, options) { - var retval = {}; - - // path is optional - if (path && !options && typeof path !== 'string') { - options = path; - path = null; - } - - // default options - options = options || {}; - for (var prop in defaultOptions) { - if (typeof options[prop] === 'undefined') { - options[prop] = defaultOptions[prop]; - } - } - - // if no path was passed in, assume the equivelant of __dirname from caller - // otherwise, resolve path relative to the equivalent of __dirname - path = !path ? dirname(m.filename) : resolve(dirname(m.filename), path); - - // get the path of each file in specified directory, append to current tree node, recurse - fs.readdirSync(path).forEach(function (filename) { - var joined = join(path, filename), - files, - key, - obj; - - if (fs.statSync(joined).isDirectory() && options.recurse) { - // this node is a directory; recurse - files = requireDirectory(m, joined, options); - // exclude empty directories - if (Object.keys(files).length) { - retval[options.rename(filename, joined, filename)] = files; - } - } else { - if (joined !== m.filename && checkFileInclusion(joined, filename, options)) { - // hash node key shouldn't include file extension - key = filename.substring(0, filename.lastIndexOf('.')); - obj = m.require(joined); - retval[options.rename(key, joined, filename)] = options.visit(obj, joined, filename) || obj; - } - } - }); - - return retval; -} - -module.exports = requireDirectory; -module.exports.defaults = defaultOptions; diff --git a/deps/npm/node_modules/require-directory/package.json b/deps/npm/node_modules/require-directory/package.json deleted file mode 100644 index 469036976a9be4..00000000000000 --- a/deps/npm/node_modules/require-directory/package.json +++ /dev/null @@ -1,69 +0,0 @@ -{ - "_from": "require-directory@^2.1.1", - "_id": "require-directory@2.1.1", - "_inBundle": false, - "_integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=", - "_location": "/require-directory", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "require-directory@^2.1.1", - "name": "require-directory", - "escapedName": "require-directory", - "rawSpec": "^2.1.1", - "saveSpec": null, - "fetchSpec": "^2.1.1" - }, - "_requiredBy": [ - "/yargs" - ], - "_resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", - "_shasum": "8c64ad5fd30dab1c976e2344ffe7f792a6a6df42", - "_spec": "require-directory@^2.1.1", - "_where": "/Users/rebecca/code/npm/node_modules/yargs", - "author": { - "name": "Troy Goode", - "email": "troygoode@gmail.com", - "url": "http://github.com/troygoode/" - }, - "bugs": { - "url": "http://github.com/troygoode/node-require-directory/issues/" - }, - "bundleDependencies": false, - "contributors": [ - { - "name": "Troy Goode", - "email": "troygoode@gmail.com", - "url": "http://github.com/troygoode/" - } - ], - "deprecated": false, - "description": "Recursively iterates over specified directory, require()'ing each file, and returning a nested hash structure containing those modules.", - "devDependencies": { - "jshint": "^2.6.0", - "mocha": "^2.1.0" - }, - "engines": { - "node": ">=0.10.0" - }, - "homepage": "https://github.com/troygoode/node-require-directory/", - "keywords": [ - "require", - "directory", - "library", - "recursive" - ], - "license": "MIT", - "main": "index.js", - "name": "require-directory", - "repository": { - "type": "git", - "url": "git://github.com/troygoode/node-require-directory.git" - }, - "scripts": { - "lint": "jshint index.js test/test.js", - "test": "mocha" - }, - "version": "2.1.1" -} diff --git a/deps/npm/node_modules/require-main-filename/CHANGELOG.md b/deps/npm/node_modules/require-main-filename/CHANGELOG.md deleted file mode 100644 index 717d59e35e2e17..00000000000000 --- a/deps/npm/node_modules/require-main-filename/CHANGELOG.md +++ /dev/null @@ -1,26 +0,0 @@ -# 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. - - -# [2.0.0](https://github.com/yargs/require-main-filename/compare/v1.0.2...v2.0.0) (2019-01-28) - - -### Chores - -* drop support for Node 0.10 ([#11](https://github.com/yargs/require-main-filename/issues/11)) ([87f4e13](https://github.com/yargs/require-main-filename/commit/87f4e13)) - - -### BREAKING CHANGES - -* drop support for Node 0.10/0.12 - - - - -## [1.0.2](https://github.com/yargs/require-main-filename/compare/v1.0.1...v1.0.2) (2017-06-16) - - -### Bug Fixes - -* add files to package.json ([#4](https://github.com/yargs/require-main-filename/issues/4)) ([fa29988](https://github.com/yargs/require-main-filename/commit/fa29988)) diff --git a/deps/npm/node_modules/require-main-filename/LICENSE.txt b/deps/npm/node_modules/require-main-filename/LICENSE.txt deleted file mode 100644 index 836440bef7cf14..00000000000000 --- a/deps/npm/node_modules/require-main-filename/LICENSE.txt +++ /dev/null @@ -1,14 +0,0 @@ -Copyright (c) 2016, Contributors - -Permission to use, copy, modify, and/or distribute this software -for any purpose with or without fee is hereby granted, provided -that the above copyright notice and this permission notice -appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES -OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE -LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES -OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/deps/npm/node_modules/require-main-filename/README.md b/deps/npm/node_modules/require-main-filename/README.md deleted file mode 100644 index 820d9f58959cdc..00000000000000 --- a/deps/npm/node_modules/require-main-filename/README.md +++ /dev/null @@ -1,26 +0,0 @@ -# require-main-filename - -[![Build Status](https://travis-ci.org/yargs/require-main-filename.png)](https://travis-ci.org/yargs/require-main-filename) -[![Coverage Status](https://coveralls.io/repos/yargs/require-main-filename/badge.svg?branch=master)](https://coveralls.io/r/yargs/require-main-filename?branch=master) -[![NPM version](https://img.shields.io/npm/v/require-main-filename.svg)](https://www.npmjs.com/package/require-main-filename) - -`require.main.filename` is great for figuring out the entry -point for the current application. This can be combined with a module like -[pkg-conf](https://www.npmjs.com/package/pkg-conf) to, _as if by magic_, load -top-level configuration. - -Unfortunately, `require.main.filename` sometimes fails when an application is -executed with an alternative process manager, e.g., [iisnode](https://github.com/tjanczuk/iisnode). - -`require-main-filename` is a shim that addresses this problem. - -## Usage - -```js -var main = require('require-main-filename')() -// use main as an alternative to require.main.filename. -``` - -## License - -ISC diff --git a/deps/npm/node_modules/require-main-filename/index.js b/deps/npm/node_modules/require-main-filename/index.js deleted file mode 100644 index dca7f0cc1e3946..00000000000000 --- a/deps/npm/node_modules/require-main-filename/index.js +++ /dev/null @@ -1,18 +0,0 @@ -module.exports = function (_require) { - _require = _require || require - var main = _require.main - if (main && isIISNode(main)) return handleIISNode(main) - else return main ? main.filename : process.cwd() -} - -function isIISNode (main) { - return /\\iisnode\\/.test(main.filename) -} - -function handleIISNode (main) { - if (!main.children.length) { - return main.filename - } else { - return main.children[0].filename - } -} diff --git a/deps/npm/node_modules/require-main-filename/package.json b/deps/npm/node_modules/require-main-filename/package.json deleted file mode 100644 index db63765c7fa725..00000000000000 --- a/deps/npm/node_modules/require-main-filename/package.json +++ /dev/null @@ -1,63 +0,0 @@ -{ - "_from": "require-main-filename@^2.0.0", - "_id": "require-main-filename@2.0.0", - "_inBundle": false, - "_integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==", - "_location": "/require-main-filename", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "require-main-filename@^2.0.0", - "name": "require-main-filename", - "escapedName": "require-main-filename", - "rawSpec": "^2.0.0", - "saveSpec": null, - "fetchSpec": "^2.0.0" - }, - "_requiredBy": [ - "/yargs" - ], - "_resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz", - "_shasum": "d0b329ecc7cc0f61649f62215be69af54aa8989b", - "_spec": "require-main-filename@^2.0.0", - "_where": "/Users/claudiahdz/npm/cli/node_modules/yargs", - "author": { - "name": "Ben Coe", - "email": "ben@npmjs.com" - }, - "bugs": { - "url": "https://github.com/yargs/require-main-filename/issues" - }, - "bundleDependencies": false, - "deprecated": false, - "description": "shim for require.main.filename() that works in as many environments as possible", - "devDependencies": { - "chai": "^4.0.0", - "standard": "^10.0.3", - "standard-version": "^4.0.0", - "tap": "^11.0.0" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/yargs/require-main-filename#readme", - "keywords": [ - "require", - "shim", - "iisnode" - ], - "license": "ISC", - "main": "index.js", - "name": "require-main-filename", - "repository": { - "type": "git", - "url": "git+ssh://git@github.com/yargs/require-main-filename.git" - }, - "scripts": { - "pretest": "standard", - "release": "standard-version", - "test": "tap --coverage test.js" - }, - "version": "2.0.0" -} diff --git a/deps/npm/node_modules/resolve-from/index.js b/deps/npm/node_modules/resolve-from/index.js deleted file mode 100644 index d092447e9945c4..00000000000000 --- a/deps/npm/node_modules/resolve-from/index.js +++ /dev/null @@ -1,47 +0,0 @@ -'use strict'; -const path = require('path'); -const Module = require('module'); -const fs = require('fs'); - -const resolveFrom = (fromDir, moduleId, silent) => { - if (typeof fromDir !== 'string') { - throw new TypeError(`Expected \`fromDir\` to be of type \`string\`, got \`${typeof fromDir}\``); - } - - if (typeof moduleId !== 'string') { - throw new TypeError(`Expected \`moduleId\` to be of type \`string\`, got \`${typeof moduleId}\``); - } - - try { - fromDir = fs.realpathSync(fromDir); - } catch (err) { - if (err.code === 'ENOENT') { - fromDir = path.resolve(fromDir); - } else if (silent) { - return null; - } else { - throw err; - } - } - - const fromFile = path.join(fromDir, 'noop.js'); - - const resolveFileName = () => Module._resolveFilename(moduleId, { - id: fromFile, - filename: fromFile, - paths: Module._nodeModulePaths(fromDir) - }); - - if (silent) { - try { - return resolveFileName(); - } catch (err) { - return null; - } - } - - return resolveFileName(); -}; - -module.exports = (fromDir, moduleId) => resolveFrom(fromDir, moduleId); -module.exports.silent = (fromDir, moduleId) => resolveFrom(fromDir, moduleId, true); diff --git a/deps/npm/node_modules/resolve-from/license b/deps/npm/node_modules/resolve-from/license deleted file mode 100644 index e7af2f77107d73..00000000000000 --- a/deps/npm/node_modules/resolve-from/license +++ /dev/null @@ -1,9 +0,0 @@ -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/deps/npm/node_modules/resolve-from/package.json b/deps/npm/node_modules/resolve-from/package.json deleted file mode 100644 index 28ff716c0dabea..00000000000000 --- a/deps/npm/node_modules/resolve-from/package.json +++ /dev/null @@ -1,66 +0,0 @@ -{ - "_from": "resolve-from@^4.0.0", - "_id": "resolve-from@4.0.0", - "_inBundle": false, - "_integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", - "_location": "/resolve-from", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "resolve-from@^4.0.0", - "name": "resolve-from", - "escapedName": "resolve-from", - "rawSpec": "^4.0.0", - "saveSpec": null, - "fetchSpec": "^4.0.0" - }, - "_requiredBy": [ - "/npm-lifecycle" - ], - "_resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", - "_shasum": "4abcd852ad32dd7baabfe9b40e00a36db5f392e6", - "_spec": "resolve-from@^4.0.0", - "_where": "/Users/rebecca/code/npm/node_modules/npm-lifecycle", - "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" -} diff --git a/deps/npm/node_modules/resolve-from/readme.md b/deps/npm/node_modules/resolve-from/readme.md deleted file mode 100644 index e539f858ef45d9..00000000000000 --- a/deps/npm/node_modules/resolve-from/readme.md +++ /dev/null @@ -1,72 +0,0 @@ -# resolve-from [![Build Status](https://travis-ci.org/sindresorhus/resolve-from.svg?branch=master)](https://travis-ci.org/sindresorhus/resolve-from) - -> Resolve the path of a module like [`require.resolve()`](https://nodejs.org/api/globals.html#globals_require_resolve) but from a given path - - -## Install - -``` -$ npm install resolve-from -``` - - -## Usage - -```js -const resolveFrom = require('resolve-from'); - -// There is a file at `./foo/bar.js` - -resolveFrom('foo', './bar'); -//=> '/Users/sindresorhus/dev/test/foo/bar.js' -``` - - -## API - -### resolveFrom(fromDir, moduleId) - -Like `require()`, throws when the module can't be found. - -### resolveFrom.silent(fromDir, moduleId) - -Returns `null` instead of throwing when the module can't be found. - -#### fromDir - -Type: `string` - -Directory to resolve from. - -#### moduleId - -Type: `string` - -What you would use in `require()`. - - -## Tip - -Create a partial using a bound function if you want to resolve from the same `fromDir` multiple times: - -```js -const resolveFromFoo = resolveFrom.bind(null, 'foo'); - -resolveFromFoo('./bar'); -resolveFromFoo('./baz'); -``` - - -## Related - -- [resolve-cwd](https://github.com/sindresorhus/resolve-cwd) - Resolve the path of a module from the current working directory -- [import-from](https://github.com/sindresorhus/import-from) - Import a module from a given path -- [import-cwd](https://github.com/sindresorhus/import-cwd) - Import a module from the current working directory -- [resolve-pkg](https://github.com/sindresorhus/resolve-pkg) - Resolve the path of a package regardless of it having an entry point -- [import-lazy](https://github.com/sindresorhus/import-lazy) - Import a module lazily -- [resolve-global](https://github.com/sindresorhus/resolve-global) - Resolve the path of a globally installed module - - -## License - -MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/deps/npm/node_modules/es-to-primitive/.editorconfig b/deps/npm/node_modules/resolve/.editorconfig similarity index 100% rename from deps/npm/node_modules/es-to-primitive/.editorconfig rename to deps/npm/node_modules/resolve/.editorconfig diff --git a/deps/npm/node_modules/normalize-package-data/node_modules/resolve/.eslintignore b/deps/npm/node_modules/resolve/.eslintignore similarity index 100% rename from deps/npm/node_modules/normalize-package-data/node_modules/resolve/.eslintignore rename to deps/npm/node_modules/resolve/.eslintignore diff --git a/deps/npm/node_modules/resolve/.travis.yml b/deps/npm/node_modules/resolve/.travis.yml new file mode 100644 index 00000000000000..5ed0fa52f90b73 --- /dev/null +++ b/deps/npm/node_modules/resolve/.travis.yml @@ -0,0 +1,8 @@ +version: ~> 1.0 +language: node_js +os: + - linux +import: + - ljharb/travis-ci:node/all.yml + - ljharb/travis-ci:node/pretest.yml + - ljharb/travis-ci:node/posttest.yml diff --git a/deps/npm/node_modules/resolve/LICENSE b/deps/npm/node_modules/resolve/LICENSE new file mode 100644 index 00000000000000..ff4fce28af33a4 --- /dev/null +++ b/deps/npm/node_modules/resolve/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2012 James Halliday + +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/resolve/appveyor.yml b/deps/npm/node_modules/resolve/appveyor.yml new file mode 100644 index 00000000000000..9458fb82b12447 --- /dev/null +++ b/deps/npm/node_modules/resolve/appveyor.yml @@ -0,0 +1,54 @@ +version: 1.0.{build} +skip_branch_with_pr: true +build: off + +environment: + matrix: + - nodejs_version: "12" + - nodejs_version: "11" + - nodejs_version: "10" + - nodejs_version: "9" + - nodejs_version: "8" + - nodejs_version: "7" + - nodejs_version: "6" + - nodejs_version: "5" + - nodejs_version: "4" + - nodejs_version: "3" + - nodejs_version: "2" + - nodejs_version: "1" + - nodejs_version: "0.12" + - nodejs_version: "0.10" + - nodejs_version: "0.8" + - nodejs_version: "0.6" +matrix: + # fast_finish: true + allow_failures: + - nodejs_version: "5" # due to windows npm bug, registry-side + - nodejs_version: "0.8" + - nodejs_version: "0.6" + +platform: + - x86 + - x64 + +# Install scripts. (runs after repo cloning) +install: + # Fix symlinks in working copy (see https://github.com/appveyor/ci/issues/650#issuecomment-186592582) / https://github.com/charleskorn/batect/commit/d08986802ec43086902958c4ee7e57ff3e71dbef + - git config core.symlinks true + - git reset --hard + # Get the latest stable version of Node.js or io.js + - ps: Install-Product node $env:nodejs_version $env:platform + - IF %nodejs_version% EQU 0.6 npm config set strict-ssl false && npm -g install npm@1.3 + - IF %nodejs_version% EQU 0.8 npm config set strict-ssl false && npm -g install npm@1.4.28 && npm install -g npm@4.5 + - set PATH=%APPDATA%\npm;%PATH% + #- IF %nodejs_version% NEQ 0.6 AND %nodejs_version% NEQ 0.8 npm -g install npm + # install modules + - npm install + +# Post-install test scripts. +test_script: + # Output useful info for debugging. + - node --version + - npm --version + # run tests + - npm run tests-only diff --git a/deps/npm/node_modules/normalize-package-data/node_modules/resolve/example/async.js b/deps/npm/node_modules/resolve/example/async.js similarity index 100% rename from deps/npm/node_modules/normalize-package-data/node_modules/resolve/example/async.js rename to deps/npm/node_modules/resolve/example/async.js diff --git a/deps/npm/node_modules/normalize-package-data/node_modules/resolve/example/sync.js b/deps/npm/node_modules/resolve/example/sync.js similarity index 100% rename from deps/npm/node_modules/normalize-package-data/node_modules/resolve/example/sync.js rename to deps/npm/node_modules/resolve/example/sync.js diff --git a/deps/npm/node_modules/resolve/index.js b/deps/npm/node_modules/resolve/index.js new file mode 100644 index 00000000000000..125d8146423596 --- /dev/null +++ b/deps/npm/node_modules/resolve/index.js @@ -0,0 +1,6 @@ +var async = require('./lib/async'); +async.core = require('./lib/core'); +async.isCore = require('./lib/is-core'); +async.sync = require('./lib/sync'); + +module.exports = async; diff --git a/deps/npm/node_modules/resolve/lib/async.js b/deps/npm/node_modules/resolve/lib/async.js new file mode 100644 index 00000000000000..06aa4588335cb7 --- /dev/null +++ b/deps/npm/node_modules/resolve/lib/async.js @@ -0,0 +1,298 @@ +var fs = require('fs'); +var path = require('path'); +var caller = require('./caller.js'); +var nodeModulesPaths = require('./node-modules-paths.js'); +var normalizeOptions = require('./normalize-options.js'); +var isCore = require('./is-core'); + +var realpathFS = fs.realpath && typeof fs.realpath.native === 'function' ? fs.realpath.native : fs.realpath; + +var defaultIsFile = function isFile(file, cb) { + fs.stat(file, function (err, stat) { + if (!err) { + return cb(null, stat.isFile() || stat.isFIFO()); + } + if (err.code === 'ENOENT' || err.code === 'ENOTDIR') return cb(null, false); + return cb(err); + }); +}; + +var defaultIsDir = function isDirectory(dir, cb) { + fs.stat(dir, function (err, stat) { + if (!err) { + return cb(null, stat.isDirectory()); + } + if (err.code === 'ENOENT' || err.code === 'ENOTDIR') return cb(null, false); + return cb(err); + }); +}; + +var defaultRealpath = function realpath(x, cb) { + realpathFS(x, function (realpathErr, realPath) { + if (realpathErr && realpathErr.code !== 'ENOENT') cb(realpathErr); + else cb(null, realpathErr ? x : realPath); + }); +}; + +var maybeRealpath = function maybeRealpath(realpath, x, opts, cb) { + if (opts && opts.preserveSymlinks === false) { + realpath(x, cb); + } else { + cb(null, x); + } +}; + +var getPackageCandidates = function getPackageCandidates(x, start, opts) { + var dirs = nodeModulesPaths(start, opts, x); + for (var i = 0; i < dirs.length; i++) { + dirs[i] = path.join(dirs[i], x); + } + return dirs; +}; + +module.exports = function resolve(x, options, callback) { + var cb = callback; + var opts = options; + if (typeof options === 'function') { + cb = opts; + opts = {}; + } + if (typeof x !== 'string') { + var err = new TypeError('Path must be a string.'); + return process.nextTick(function () { + cb(err); + }); + } + + opts = normalizeOptions(x, opts); + + var isFile = opts.isFile || defaultIsFile; + var isDirectory = opts.isDirectory || defaultIsDir; + var readFile = opts.readFile || fs.readFile; + var realpath = opts.realpath || defaultRealpath; + var packageIterator = opts.packageIterator; + + var extensions = opts.extensions || ['.js']; + var basedir = opts.basedir || path.dirname(caller()); + var parent = opts.filename || basedir; + + opts.paths = opts.paths || []; + + // ensure that `basedir` is an absolute path at this point, resolving against the process' current working directory + var absoluteStart = path.resolve(basedir); + + maybeRealpath( + realpath, + absoluteStart, + opts, + function (err, realStart) { + if (err) cb(err); + else init(realStart); + } + ); + + var res; + function init(basedir) { + if ((/^(?:\.\.?(?:\/|$)|\/|([A-Za-z]:)?[/\\])/).test(x)) { + res = path.resolve(basedir, x); + if (x === '.' || x === '..' || x.slice(-1) === '/') res += '/'; + if ((/\/$/).test(x) && res === basedir) { + loadAsDirectory(res, opts.package, onfile); + } else loadAsFile(res, opts.package, onfile); + } else if (isCore(x)) { + return cb(null, x); + } else loadNodeModules(x, basedir, function (err, n, pkg) { + if (err) cb(err); + else if (n) { + return maybeRealpath(realpath, n, opts, function (err, realN) { + if (err) { + cb(err); + } else { + cb(null, realN, pkg); + } + }); + } else { + var moduleError = new Error("Cannot find module '" + x + "' from '" + parent + "'"); + moduleError.code = 'MODULE_NOT_FOUND'; + cb(moduleError); + } + }); + } + + function onfile(err, m, pkg) { + if (err) cb(err); + else if (m) cb(null, m, pkg); + else loadAsDirectory(res, function (err, d, pkg) { + if (err) cb(err); + else if (d) { + maybeRealpath(realpath, d, opts, function (err, realD) { + if (err) { + cb(err); + } else { + cb(null, realD, pkg); + } + }); + } else { + var moduleError = new Error("Cannot find module '" + x + "' from '" + parent + "'"); + moduleError.code = 'MODULE_NOT_FOUND'; + cb(moduleError); + } + }); + } + + function loadAsFile(x, thePackage, callback) { + var loadAsFilePackage = thePackage; + var cb = callback; + if (typeof loadAsFilePackage === 'function') { + cb = loadAsFilePackage; + loadAsFilePackage = undefined; + } + + var exts = [''].concat(extensions); + load(exts, x, loadAsFilePackage); + + function load(exts, x, loadPackage) { + if (exts.length === 0) return cb(null, undefined, loadPackage); + var file = x + exts[0]; + + var pkg = loadPackage; + if (pkg) onpkg(null, pkg); + else loadpkg(path.dirname(file), onpkg); + + function onpkg(err, pkg_, dir) { + pkg = pkg_; + if (err) return cb(err); + if (dir && pkg && opts.pathFilter) { + var rfile = path.relative(dir, file); + var rel = rfile.slice(0, rfile.length - exts[0].length); + var r = opts.pathFilter(pkg, x, rel); + if (r) return load( + [''].concat(extensions.slice()), + path.resolve(dir, r), + pkg + ); + } + isFile(file, onex); + } + function onex(err, ex) { + if (err) return cb(err); + if (ex) return cb(null, file, pkg); + load(exts.slice(1), x, pkg); + } + } + } + + function loadpkg(dir, cb) { + if (dir === '' || dir === '/') return cb(null); + if (process.platform === 'win32' && (/^\w:[/\\]*$/).test(dir)) { + return cb(null); + } + if ((/[/\\]node_modules[/\\]*$/).test(dir)) return cb(null); + + maybeRealpath(realpath, dir, opts, function (unwrapErr, pkgdir) { + if (unwrapErr) return loadpkg(path.dirname(dir), cb); + var pkgfile = path.join(pkgdir, 'package.json'); + isFile(pkgfile, function (err, ex) { + // on err, ex is false + if (!ex) return loadpkg(path.dirname(dir), cb); + + readFile(pkgfile, function (err, body) { + if (err) cb(err); + try { var pkg = JSON.parse(body); } catch (jsonErr) {} + + if (pkg && opts.packageFilter) { + pkg = opts.packageFilter(pkg, pkgfile); + } + cb(null, pkg, dir); + }); + }); + }); + } + + function loadAsDirectory(x, loadAsDirectoryPackage, callback) { + var cb = callback; + var fpkg = loadAsDirectoryPackage; + if (typeof fpkg === 'function') { + cb = fpkg; + fpkg = opts.package; + } + + maybeRealpath(realpath, x, opts, function (unwrapErr, pkgdir) { + if (unwrapErr) return cb(unwrapErr); + var pkgfile = path.join(pkgdir, 'package.json'); + isFile(pkgfile, function (err, ex) { + if (err) return cb(err); + if (!ex) return loadAsFile(path.join(x, 'index'), fpkg, cb); + + readFile(pkgfile, function (err, body) { + if (err) return cb(err); + try { + var pkg = JSON.parse(body); + } catch (jsonErr) {} + + if (pkg && opts.packageFilter) { + pkg = opts.packageFilter(pkg, pkgfile); + } + + if (pkg && pkg.main) { + if (typeof pkg.main !== 'string') { + var mainError = new TypeError('package “' + pkg.name + '” `main` must be a string'); + mainError.code = 'INVALID_PACKAGE_MAIN'; + return cb(mainError); + } + if (pkg.main === '.' || pkg.main === './') { + pkg.main = 'index'; + } + loadAsFile(path.resolve(x, pkg.main), pkg, function (err, m, pkg) { + if (err) return cb(err); + if (m) return cb(null, m, pkg); + if (!pkg) return loadAsFile(path.join(x, 'index'), pkg, cb); + + var dir = path.resolve(x, pkg.main); + loadAsDirectory(dir, pkg, function (err, n, pkg) { + if (err) return cb(err); + if (n) return cb(null, n, pkg); + loadAsFile(path.join(x, 'index'), pkg, cb); + }); + }); + return; + } + + loadAsFile(path.join(x, '/index'), pkg, cb); + }); + }); + }); + } + + function processDirs(cb, dirs) { + if (dirs.length === 0) return cb(null, undefined); + var dir = dirs[0]; + + isDirectory(path.dirname(dir), isdir); + + function isdir(err, isdir) { + if (err) return cb(err); + if (!isdir) return processDirs(cb, dirs.slice(1)); + loadAsFile(dir, opts.package, onfile); + } + + function onfile(err, m, pkg) { + if (err) return cb(err); + if (m) return cb(null, m, pkg); + loadAsDirectory(dir, opts.package, ondir); + } + + function ondir(err, n, pkg) { + if (err) return cb(err); + if (n) return cb(null, n, pkg); + processDirs(cb, dirs.slice(1)); + } + } + function loadNodeModules(x, start, cb) { + var thunk = function () { return getPackageCandidates(x, start, opts); }; + processDirs( + cb, + packageIterator ? packageIterator(x, start, thunk, opts) : thunk() + ); + } +}; diff --git a/deps/npm/node_modules/normalize-package-data/node_modules/resolve/lib/caller.js b/deps/npm/node_modules/resolve/lib/caller.js similarity index 100% rename from deps/npm/node_modules/normalize-package-data/node_modules/resolve/lib/caller.js rename to deps/npm/node_modules/resolve/lib/caller.js diff --git a/deps/npm/node_modules/normalize-package-data/node_modules/resolve/lib/core.js b/deps/npm/node_modules/resolve/lib/core.js similarity index 100% rename from deps/npm/node_modules/normalize-package-data/node_modules/resolve/lib/core.js rename to deps/npm/node_modules/resolve/lib/core.js diff --git a/deps/npm/node_modules/resolve/lib/core.json b/deps/npm/node_modules/resolve/lib/core.json new file mode 100644 index 00000000000000..d51b70b149acb2 --- /dev/null +++ b/deps/npm/node_modules/resolve/lib/core.json @@ -0,0 +1,75 @@ +{ + "assert": true, + "async_hooks": ">= 8", + "buffer_ieee754": "< 0.9.7", + "buffer": true, + "child_process": true, + "cluster": true, + "console": true, + "constants": true, + "crypto": true, + "_debug_agent": ">= 1 && < 8", + "_debugger": "< 8", + "dgram": true, + "dns": true, + "domain": true, + "events": true, + "freelist": "< 6", + "fs": true, + "fs/promises": [">= 10 && < 10.1", ">= 14"], + "_http_agent": ">= 0.11.1", + "_http_client": ">= 0.11.1", + "_http_common": ">= 0.11.1", + "_http_incoming": ">= 0.11.1", + "_http_outgoing": ">= 0.11.1", + "_http_server": ">= 0.11.1", + "http": true, + "http2": ">= 8.8", + "https": true, + "inspector": ">= 8.0.0", + "_linklist": "< 8", + "module": true, + "net": true, + "node-inspect/lib/_inspect": ">= 7.6.0 && < 12", + "node-inspect/lib/internal/inspect_client": ">= 7.6.0 && < 12", + "node-inspect/lib/internal/inspect_repl": ">= 7.6.0 && < 12", + "os": true, + "path": true, + "perf_hooks": ">= 8.5", + "process": ">= 1", + "punycode": true, + "querystring": true, + "readline": true, + "repl": true, + "smalloc": ">= 0.11.5 && < 3", + "_stream_duplex": ">= 0.9.4", + "_stream_transform": ">= 0.9.4", + "_stream_wrap": ">= 1.4.1", + "_stream_passthrough": ">= 0.9.4", + "_stream_readable": ">= 0.9.4", + "_stream_writable": ">= 0.9.4", + "stream": true, + "string_decoder": true, + "sys": true, + "timers": true, + "_tls_common": ">= 0.11.13", + "_tls_legacy": ">= 0.11.3 && < 10", + "_tls_wrap": ">= 0.11.3", + "tls": true, + "trace_events": ">= 10", + "tty": true, + "url": true, + "util": true, + "v8/tools/arguments": ">= 10 && < 12", + "v8/tools/codemap": [">= 4.4.0 && < 5", ">= 5.2.0 && < 12"], + "v8/tools/consarray": [">= 4.4.0 && < 5", ">= 5.2.0 && < 12"], + "v8/tools/csvparser": [">= 4.4.0 && < 5", ">= 5.2.0 && < 12"], + "v8/tools/logreader": [">= 4.4.0 && < 5", ">= 5.2.0 && < 12"], + "v8/tools/profile_view": [">= 4.4.0 && < 5", ">= 5.2.0 && < 12"], + "v8/tools/splaytree": [">= 4.4.0 && < 5", ">= 5.2.0 && < 12"], + "v8": ">= 1", + "vm": true, + "wasi": ">= 13.4 && < 13.5", + "worker_threads": ">= 11.7", + "zlib": true +} diff --git a/deps/npm/node_modules/resolve/lib/is-core.js b/deps/npm/node_modules/resolve/lib/is-core.js new file mode 100644 index 00000000000000..48bc96c47eadc5 --- /dev/null +++ b/deps/npm/node_modules/resolve/lib/is-core.js @@ -0,0 +1,5 @@ +var core = require('./core'); + +module.exports = function isCore(x) { + return Object.prototype.hasOwnProperty.call(core, x); +}; diff --git a/deps/npm/node_modules/resolve/lib/node-modules-paths.js b/deps/npm/node_modules/resolve/lib/node-modules-paths.js new file mode 100644 index 00000000000000..2b43813a7a561b --- /dev/null +++ b/deps/npm/node_modules/resolve/lib/node-modules-paths.js @@ -0,0 +1,42 @@ +var path = require('path'); +var parse = path.parse || require('path-parse'); + +var getNodeModulesDirs = function getNodeModulesDirs(absoluteStart, modules) { + var prefix = '/'; + if ((/^([A-Za-z]:)/).test(absoluteStart)) { + prefix = ''; + } else if ((/^\\\\/).test(absoluteStart)) { + prefix = '\\\\'; + } + + var paths = [absoluteStart]; + var parsed = parse(absoluteStart); + while (parsed.dir !== paths[paths.length - 1]) { + paths.push(parsed.dir); + parsed = parse(parsed.dir); + } + + return paths.reduce(function (dirs, aPath) { + return dirs.concat(modules.map(function (moduleDir) { + return path.resolve(prefix, aPath, moduleDir); + })); + }, []); +}; + +module.exports = function nodeModulesPaths(start, opts, request) { + var modules = opts && opts.moduleDirectory + ? [].concat(opts.moduleDirectory) + : ['node_modules']; + + if (opts && typeof opts.paths === 'function') { + return opts.paths( + request, + start, + function () { return getNodeModulesDirs(start, modules); }, + opts + ); + } + + var dirs = getNodeModulesDirs(start, modules); + return opts && opts.paths ? dirs.concat(opts.paths) : dirs; +}; diff --git a/deps/npm/node_modules/normalize-package-data/node_modules/resolve/lib/normalize-options.js b/deps/npm/node_modules/resolve/lib/normalize-options.js similarity index 100% rename from deps/npm/node_modules/normalize-package-data/node_modules/resolve/lib/normalize-options.js rename to deps/npm/node_modules/resolve/lib/normalize-options.js diff --git a/deps/npm/node_modules/resolve/lib/sync.js b/deps/npm/node_modules/resolve/lib/sync.js new file mode 100644 index 00000000000000..da74e19d0cb564 --- /dev/null +++ b/deps/npm/node_modules/resolve/lib/sync.js @@ -0,0 +1,191 @@ +var isCore = require('./is-core'); +var fs = require('fs'); +var path = require('path'); +var caller = require('./caller.js'); +var nodeModulesPaths = require('./node-modules-paths.js'); +var normalizeOptions = require('./normalize-options.js'); + +var realpathFS = fs.realpathSync && typeof fs.realpathSync.native === 'function' ? fs.realpathSync.native : fs.realpathSync; + +var defaultIsFile = function isFile(file) { + try { + var stat = fs.statSync(file); + } catch (e) { + if (e && (e.code === 'ENOENT' || e.code === 'ENOTDIR')) return false; + throw e; + } + return stat.isFile() || stat.isFIFO(); +}; + +var defaultIsDir = function isDirectory(dir) { + try { + var stat = fs.statSync(dir); + } catch (e) { + if (e && (e.code === 'ENOENT' || e.code === 'ENOTDIR')) return false; + throw e; + } + return stat.isDirectory(); +}; + +var defaultRealpathSync = function realpathSync(x) { + try { + return realpathFS(x); + } catch (realpathErr) { + if (realpathErr.code !== 'ENOENT') { + throw realpathErr; + } + } + return x; +}; + +var maybeRealpathSync = function maybeRealpathSync(realpathSync, x, opts) { + if (opts && opts.preserveSymlinks === false) { + return realpathSync(x); + } + return x; +}; + +var getPackageCandidates = function getPackageCandidates(x, start, opts) { + var dirs = nodeModulesPaths(start, opts, x); + for (var i = 0; i < dirs.length; i++) { + dirs[i] = path.join(dirs[i], x); + } + return dirs; +}; + +module.exports = function resolveSync(x, options) { + if (typeof x !== 'string') { + throw new TypeError('Path must be a string.'); + } + var opts = normalizeOptions(x, options); + + var isFile = opts.isFile || defaultIsFile; + var readFileSync = opts.readFileSync || fs.readFileSync; + var isDirectory = opts.isDirectory || defaultIsDir; + var realpathSync = opts.realpathSync || defaultRealpathSync; + var packageIterator = opts.packageIterator; + + var extensions = opts.extensions || ['.js']; + var basedir = opts.basedir || path.dirname(caller()); + var parent = opts.filename || basedir; + + opts.paths = opts.paths || []; + + // ensure that `basedir` is an absolute path at this point, resolving against the process' current working directory + var absoluteStart = maybeRealpathSync(realpathSync, path.resolve(basedir), opts); + + if ((/^(?:\.\.?(?:\/|$)|\/|([A-Za-z]:)?[/\\])/).test(x)) { + var res = path.resolve(absoluteStart, x); + if (x === '.' || x === '..' || x.slice(-1) === '/') res += '/'; + var m = loadAsFileSync(res) || loadAsDirectorySync(res); + if (m) return maybeRealpathSync(realpathSync, m, opts); + } else if (isCore(x)) { + return x; + } else { + var n = loadNodeModulesSync(x, absoluteStart); + if (n) return maybeRealpathSync(realpathSync, n, opts); + } + + var err = new Error("Cannot find module '" + x + "' from '" + parent + "'"); + err.code = 'MODULE_NOT_FOUND'; + throw err; + + function loadAsFileSync(x) { + var pkg = loadpkg(path.dirname(x)); + + if (pkg && pkg.dir && pkg.pkg && opts.pathFilter) { + var rfile = path.relative(pkg.dir, x); + var r = opts.pathFilter(pkg.pkg, x, rfile); + if (r) { + x = path.resolve(pkg.dir, r); // eslint-disable-line no-param-reassign + } + } + + if (isFile(x)) { + return x; + } + + for (var i = 0; i < extensions.length; i++) { + var file = x + extensions[i]; + if (isFile(file)) { + return file; + } + } + } + + function loadpkg(dir) { + if (dir === '' || dir === '/') return; + if (process.platform === 'win32' && (/^\w:[/\\]*$/).test(dir)) { + return; + } + if ((/[/\\]node_modules[/\\]*$/).test(dir)) return; + + var pkgfile = path.join(maybeRealpathSync(realpathSync, dir, opts), 'package.json'); + + if (!isFile(pkgfile)) { + return loadpkg(path.dirname(dir)); + } + + var body = readFileSync(pkgfile); + + try { + var pkg = JSON.parse(body); + } catch (jsonErr) {} + + if (pkg && opts.packageFilter) { + // v2 will pass pkgfile + pkg = opts.packageFilter(pkg, /*pkgfile,*/ dir); // eslint-disable-line spaced-comment + } + + return { pkg: pkg, dir: dir }; + } + + function loadAsDirectorySync(x) { + var pkgfile = path.join(maybeRealpathSync(realpathSync, x, opts), '/package.json'); + if (isFile(pkgfile)) { + try { + var body = readFileSync(pkgfile, 'UTF8'); + var pkg = JSON.parse(body); + } catch (e) {} + + if (pkg && opts.packageFilter) { + // v2 will pass pkgfile + pkg = opts.packageFilter(pkg, /*pkgfile,*/ x); // eslint-disable-line spaced-comment + } + + if (pkg && pkg.main) { + if (typeof pkg.main !== 'string') { + var mainError = new TypeError('package “' + pkg.name + '” `main` must be a string'); + mainError.code = 'INVALID_PACKAGE_MAIN'; + throw mainError; + } + if (pkg.main === '.' || pkg.main === './') { + pkg.main = 'index'; + } + try { + var m = loadAsFileSync(path.resolve(x, pkg.main)); + if (m) return m; + var n = loadAsDirectorySync(path.resolve(x, pkg.main)); + if (n) return n; + } catch (e) {} + } + } + + return loadAsFileSync(path.join(x, '/index')); + } + + function loadNodeModulesSync(x, start) { + var thunk = function () { return getPackageCandidates(x, start, opts); }; + var dirs = packageIterator ? packageIterator(x, start, thunk, opts) : thunk(); + + for (var i = 0; i < dirs.length; i++) { + var dir = dirs[i]; + if (isDirectory(path.dirname(dir))) { + var m = loadAsFileSync(dir); + if (m) return m; + var n = loadAsDirectorySync(dir); + if (n) return n; + } + } + } +}; diff --git a/deps/npm/node_modules/resolve/package.json b/deps/npm/node_modules/resolve/package.json new file mode 100644 index 00000000000000..b6d3bec191d686 --- /dev/null +++ b/deps/npm/node_modules/resolve/package.json @@ -0,0 +1,47 @@ +{ + "name": "resolve", + "description": "resolve like require.resolve() on behalf of files asynchronously and synchronously", + "version": "1.17.0", + "repository": { + "type": "git", + "url": "git://github.com/browserify/resolve.git" + }, + "main": "index.js", + "keywords": [ + "resolve", + "require", + "node", + "module" + ], + "scripts": { + "prepublish": "safe-publish-latest", + "lint": "eslint .", + "pretests-only": "cd ./test/resolver/nested_symlinks && node mylib/sync && node mylib/async", + "tests-only": "tape test/*.js", + "pretest": "npm run lint", + "test": "npm run --silent tests-only", + "posttest": "npm run test:multirepo", + "test:multirepo": "cd ./test/resolver/multirepo && npm install && npm test" + }, + "devDependencies": { + "@ljharb/eslint-config": "^16.0.0", + "array.prototype.map": "^1.0.2", + "eslint": "^6.8.0", + "object-keys": "^1.1.1", + "safe-publish-latest": "^1.1.4", + "tap": "0.4.13", + "tape": "^5.0.0-next.5" + }, + "license": "MIT", + "author": { + "name": "James Halliday", + "email": "mail@substack.net", + "url": "http://substack.net" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + }, + "dependencies": { + "path-parse": "^1.0.6" + } +} diff --git a/deps/npm/node_modules/resolve/readme.markdown b/deps/npm/node_modules/resolve/readme.markdown new file mode 100644 index 00000000000000..5e1aea331767de --- /dev/null +++ b/deps/npm/node_modules/resolve/readme.markdown @@ -0,0 +1,242 @@ +# resolve + +implements the [node `require.resolve()` +algorithm](https://nodejs.org/api/modules.html#modules_all_together) +such that you can `require.resolve()` on behalf of a file asynchronously and +synchronously + +[![build status](https://secure.travis-ci.org/browserify/resolve.png)](http://travis-ci.org/browserify/resolve) + +# example + +asynchronously resolve: + +```js +var resolve = require('resolve'); +resolve('tap', { basedir: __dirname }, function (err, res) { + if (err) console.error(err); + else console.log(res); +}); +``` + +``` +$ node example/async.js +/home/substack/projects/node-resolve/node_modules/tap/lib/main.js +``` + +synchronously resolve: + +```js +var resolve = require('resolve'); +var res = resolve.sync('tap', { basedir: __dirname }); +console.log(res); +``` + +``` +$ node example/sync.js +/home/substack/projects/node-resolve/node_modules/tap/lib/main.js +``` + +# methods + +```js +var resolve = require('resolve'); +``` + +## resolve(id, opts={}, cb) + +Asynchronously resolve the module path string `id` into `cb(err, res [, pkg])`, where `pkg` (if defined) is the data from `package.json`. + +options are: + +* opts.basedir - directory to begin resolving from + +* opts.package - `package.json` data applicable to the module being loaded + +* opts.extensions - array of file extensions to search in order + +* opts.readFile - how to read files asynchronously + +* opts.isFile - function to asynchronously test whether a file exists + +* opts.isDirectory - function to asynchronously test whether a directory exists + +* opts.realpath - function to asynchronously resolve a potential symlink to its real path + +* `opts.packageFilter(pkg, pkgfile, dir)` - transform the parsed package.json contents before looking at the "main" field + * pkg - package data + * pkgfile - path to package.json + * dir - directory for package.json + +* `opts.pathFilter(pkg, path, relativePath)` - transform a path within a package + * pkg - package data + * path - the path being resolved + * relativePath - the path relative from the package.json location + * returns - a relative path that will be joined from the package.json location + +* opts.paths - require.paths array to use if nothing is found on the normal `node_modules` recursive walk (probably don't use this) + + For advanced users, `paths` can also be a `opts.paths(request, start, opts)` function + * request - the import specifier being resolved + * start - lookup path + * getNodeModulesDirs - a thunk (no-argument function) that returns the paths using standard `node_modules` resolution + * opts - the resolution options + +* `opts.packageIterator(request, start, opts)` - return the list of candidate paths where the packages sources may be found (probably don't use this) + * request - the import specifier being resolved + * start - lookup path + * getPackageCandidates - a thunk (no-argument function) that returns the paths using standard `node_modules` resolution + * opts - the resolution options + +* opts.moduleDirectory - directory (or directories) in which to recursively look for modules. default: `"node_modules"` + +* opts.preserveSymlinks - if true, doesn't resolve `basedir` to real path before resolving. +This is the way Node resolves dependencies when executed with the [--preserve-symlinks](https://nodejs.org/api/all.html#cli_preserve_symlinks) flag. +**Note:** this property is currently `true` by default but it will be changed to +`false` in the next major version because *Node's resolution algorithm does not preserve symlinks by default*. + +default `opts` values: + +```js +{ + paths: [], + basedir: __dirname, + extensions: ['.js'], + readFile: fs.readFile, + isFile: function isFile(file, cb) { + fs.stat(file, function (err, stat) { + if (!err) { + return cb(null, stat.isFile() || stat.isFIFO()); + } + if (err.code === 'ENOENT' || err.code === 'ENOTDIR') return cb(null, false); + return cb(err); + }); + }, + isDirectory: function isDirectory(dir, cb) { + fs.stat(dir, function (err, stat) { + if (!err) { + return cb(null, stat.isDirectory()); + } + if (err.code === 'ENOENT' || err.code === 'ENOTDIR') return cb(null, false); + return cb(err); + }); + }, + realpath: function realpath(file, cb) { + var realpath = typeof fs.realpath.native === 'function' ? fs.realpath.native : fs.realpath; + realpath(file, function (realPathErr, realPath) { + if (realPathErr && realPathErr.code !== 'ENOENT') cb(realPathErr); + else cb(null, realPathErr ? file : realPath); + }); + }, + moduleDirectory: 'node_modules', + preserveSymlinks: true +} +``` + +## resolve.sync(id, opts) + +Synchronously resolve the module path string `id`, returning the result and +throwing an error when `id` can't be resolved. + +options are: + +* opts.basedir - directory to begin resolving from + +* opts.extensions - array of file extensions to search in order + +* opts.readFile - how to read files synchronously + +* opts.isFile - function to synchronously test whether a file exists + +* opts.isDirectory - function to synchronously test whether a directory exists + +* opts.realpathSync - function to synchronously resolve a potential symlink to its real path + +* `opts.packageFilter(pkg, dir)` - transform the parsed package.json contents before looking at the "main" field + * pkg - package data + * dir - directory for package.json (Note: the second argument will change to "pkgfile" in v2) + +* `opts.pathFilter(pkg, path, relativePath)` - transform a path within a package + * pkg - package data + * path - the path being resolved + * relativePath - the path relative from the package.json location + * returns - a relative path that will be joined from the package.json location + +* opts.paths - require.paths array to use if nothing is found on the normal `node_modules` recursive walk (probably don't use this) + + For advanced users, `paths` can also be a `opts.paths(request, start, opts)` function + * request - the import specifier being resolved + * start - lookup path + * getNodeModulesDirs - a thunk (no-argument function) that returns the paths using standard `node_modules` resolution + * opts - the resolution options + +* `opts.packageIterator(request, start, opts)` - return the list of candidate paths where the packages sources may be found (probably don't use this) + * request - the import specifier being resolved + * start - lookup path + * getPackageCandidates - a thunk (no-argument function) that returns the paths using standard `node_modules` resolution + * opts - the resolution options + +* opts.moduleDirectory - directory (or directories) in which to recursively look for modules. default: `"node_modules"` + +* opts.preserveSymlinks - if true, doesn't resolve `basedir` to real path before resolving. +This is the way Node resolves dependencies when executed with the [--preserve-symlinks](https://nodejs.org/api/all.html#cli_preserve_symlinks) flag. +**Note:** this property is currently `true` by default but it will be changed to +`false` in the next major version because *Node's resolution algorithm does not preserve symlinks by default*. + +default `opts` values: + +```js +{ + paths: [], + basedir: __dirname, + extensions: ['.js'], + readFileSync: fs.readFileSync, + isFile: function isFile(file) { + try { + var stat = fs.statSync(file); + } catch (e) { + if (e && (e.code === 'ENOENT' || e.code === 'ENOTDIR')) return false; + throw e; + } + return stat.isFile() || stat.isFIFO(); + }, + isDirectory: function isDirectory(dir) { + try { + var stat = fs.statSync(dir); + } catch (e) { + if (e && (e.code === 'ENOENT' || e.code === 'ENOTDIR')) return false; + throw e; + } + return stat.isDirectory(); + }, + realpathSync: function realpathSync(file) { + try { + var realpath = typeof fs.realpathSync.native === 'function' ? fs.realpathSync.native : fs.realpathSync; + return realpath(file); + } catch (realPathErr) { + if (realPathErr.code !== 'ENOENT') { + throw realPathErr; + } + } + return file; + }, + moduleDirectory: 'node_modules', + preserveSymlinks: true +} +``` + +## resolve.isCore(pkg) + +Return whether a package is in core. + +# install + +With [npm](https://npmjs.org) do: + +```sh +npm install resolve +``` + +# license + +MIT diff --git a/deps/npm/node_modules/resolve/test/core.js b/deps/npm/node_modules/resolve/test/core.js new file mode 100644 index 00000000000000..4c111e1dde7797 --- /dev/null +++ b/deps/npm/node_modules/resolve/test/core.js @@ -0,0 +1,85 @@ +var test = require('tape'); +var keys = require('object-keys'); +var resolve = require('../'); + +test('core modules', function (t) { + t.test('isCore()', function (st) { + st.ok(resolve.isCore('fs')); + st.ok(resolve.isCore('net')); + st.ok(resolve.isCore('http')); + + st.ok(!resolve.isCore('seq')); + st.ok(!resolve.isCore('../')); + + st.ok(!resolve.isCore('toString')); + + st.end(); + }); + + t.test('core list', function (st) { + var cores = keys(resolve.core); + st.plan(cores.length); + + for (var i = 0; i < cores.length; ++i) { + var mod = cores[i]; + if (resolve.core[mod]) { + st.doesNotThrow( + function () { require(mod); }, // eslint-disable-line no-loop-func + mod + ' supported; requiring does not throw' + ); + } else { + st.throws( + function () { require(mod); }, // eslint-disable-line no-loop-func + mod + ' not supported; requiring throws' + ); + } + } + + st.end(); + }); + + t.test('core via repl module', { skip: !resolve.core.repl }, function (st) { + var libs = require('repl')._builtinLibs; // eslint-disable-line no-underscore-dangle + if (!libs) { + st.skip('module.builtinModules does not exist'); + return st.end(); + } + for (var i = 0; i < libs.length; ++i) { + var mod = libs[i]; + st.ok(resolve.core[mod], mod + ' is a core module'); + st.doesNotThrow( + function () { require(mod); }, // eslint-disable-line no-loop-func + 'requiring ' + mod + ' does not throw' + ); + } + st.end(); + }); + + t.test('core via builtinModules list', { skip: !resolve.core.module }, function (st) { + var libs = require('module').builtinModules; + if (!libs) { + st.skip('module.builtinModules does not exist'); + return st.end(); + } + var blacklist = [ + '_debug_agent', + 'v8/tools/tickprocessor-driver', + 'v8/tools/SourceMap', + 'v8/tools/tickprocessor', + 'v8/tools/profile' + ]; + for (var i = 0; i < libs.length; ++i) { + var mod = libs[i]; + if (blacklist.indexOf(mod) === -1) { + st.ok(resolve.core[mod], mod + ' is a core module'); + st.doesNotThrow( + function () { require(mod); }, // eslint-disable-line no-loop-func + 'requiring ' + mod + ' does not throw' + ); + } + } + st.end(); + }); + + t.end(); +}); diff --git a/deps/npm/node_modules/normalize-package-data/node_modules/resolve/test/dotdot.js b/deps/npm/node_modules/resolve/test/dotdot.js similarity index 100% rename from deps/npm/node_modules/normalize-package-data/node_modules/resolve/test/dotdot.js rename to deps/npm/node_modules/resolve/test/dotdot.js diff --git a/deps/npm/node_modules/normalize-package-data/node_modules/resolve/test/dotdot/abc/index.js b/deps/npm/node_modules/resolve/test/dotdot/abc/index.js similarity index 100% rename from deps/npm/node_modules/normalize-package-data/node_modules/resolve/test/dotdot/abc/index.js rename to deps/npm/node_modules/resolve/test/dotdot/abc/index.js diff --git a/deps/npm/node_modules/normalize-package-data/node_modules/resolve/test/dotdot/index.js b/deps/npm/node_modules/resolve/test/dotdot/index.js similarity index 100% rename from deps/npm/node_modules/normalize-package-data/node_modules/resolve/test/dotdot/index.js rename to deps/npm/node_modules/resolve/test/dotdot/index.js diff --git a/deps/npm/node_modules/normalize-package-data/node_modules/resolve/test/faulty_basedir.js b/deps/npm/node_modules/resolve/test/faulty_basedir.js similarity index 100% rename from deps/npm/node_modules/normalize-package-data/node_modules/resolve/test/faulty_basedir.js rename to deps/npm/node_modules/resolve/test/faulty_basedir.js diff --git a/deps/npm/node_modules/resolve/test/filter.js b/deps/npm/node_modules/resolve/test/filter.js new file mode 100644 index 00000000000000..8f8cccdb2f59f3 --- /dev/null +++ b/deps/npm/node_modules/resolve/test/filter.js @@ -0,0 +1,34 @@ +var path = require('path'); +var test = require('tape'); +var resolve = require('../'); + +test('filter', function (t) { + t.plan(4); + var dir = path.join(__dirname, 'resolver'); + var packageFilterArgs; + resolve('./baz', { + basedir: dir, + packageFilter: function (pkg, pkgfile) { + pkg.main = 'doom'; // eslint-disable-line no-param-reassign + packageFilterArgs = [pkg, pkgfile]; + return pkg; + } + }, function (err, res, pkg) { + if (err) t.fail(err); + + t.equal(res, path.join(dir, 'baz/doom.js'), 'changing the package "main" works'); + + var packageData = packageFilterArgs[0]; + t.equal(pkg, packageData, 'first packageFilter argument is "pkg"'); + t.equal(packageData.main, 'doom', 'package "main" was altered'); + + var packageFile = packageFilterArgs[1]; + t.equal( + packageFile, + path.join(dir, 'baz/package.json'), + 'second packageFilter argument is "pkgfile"' + ); + + t.end(); + }); +}); diff --git a/deps/npm/node_modules/resolve/test/filter_sync.js b/deps/npm/node_modules/resolve/test/filter_sync.js new file mode 100644 index 00000000000000..8a43b9818973df --- /dev/null +++ b/deps/npm/node_modules/resolve/test/filter_sync.js @@ -0,0 +1,33 @@ +var path = require('path'); +var test = require('tape'); +var resolve = require('../'); + +test('filter', function (t) { + var dir = path.join(__dirname, 'resolver'); + var packageFilterArgs; + var res = resolve.sync('./baz', { + basedir: dir, + // NOTE: in v2.x, this will be `pkg, pkgfile, dir`, but must remain "broken" here in v1.x for compatibility + packageFilter: function (pkg, /*pkgfile,*/ dir) { // eslint-disable-line spaced-comment + pkg.main = 'doom'; // eslint-disable-line no-param-reassign + packageFilterArgs = 'is 1.x' ? [pkg, dir] : [pkg, pkgfile, dir]; // eslint-disable-line no-constant-condition, no-undef + return pkg; + } + }); + + t.equal(res, path.join(dir, 'baz/doom.js'), 'changing the package "main" works'); + + var packageData = packageFilterArgs[0]; + t.equal(packageData.main, 'doom', 'package "main" was altered'); + + if (!'is 1.x') { // eslint-disable-line no-constant-condition + var packageFile = packageFilterArgs[1]; + t.equal(packageFile, path.join(dir, 'baz', 'package.json'), 'package.json path is correct'); + } + + var packageDir = packageFilterArgs['is 1.x' ? 1 : 2]; // eslint-disable-line no-constant-condition + // eslint-disable-next-line no-constant-condition + t.equal(packageDir, path.join(dir, 'baz'), ('is 1.x' ? 'second' : 'third') + ' packageFilter argument is "dir"'); + + t.end(); +}); diff --git a/deps/npm/node_modules/resolve/test/mock.js b/deps/npm/node_modules/resolve/test/mock.js new file mode 100644 index 00000000000000..b9f17fe238292e --- /dev/null +++ b/deps/npm/node_modules/resolve/test/mock.js @@ -0,0 +1,239 @@ +var path = require('path'); +var test = require('tape'); +var resolve = require('../'); + +test('mock', function (t) { + t.plan(8); + + var files = {}; + files[path.resolve('/foo/bar/baz.js')] = 'beep'; + + var dirs = {}; + dirs[path.resolve('/foo/bar')] = true; + + function opts(basedir) { + return { + basedir: path.resolve(basedir), + isFile: function (file, cb) { + cb(null, Object.prototype.hasOwnProperty.call(files, path.resolve(file))); + }, + isDirectory: function (dir, cb) { + cb(null, !!dirs[path.resolve(dir)]); + }, + readFile: function (file, cb) { + cb(null, files[path.resolve(file)]); + }, + realpath: function (file, cb) { + cb(null, file); + } + }; + } + + resolve('./baz', opts('/foo/bar'), function (err, res, pkg) { + if (err) return t.fail(err); + t.equal(res, path.resolve('/foo/bar/baz.js')); + t.equal(pkg, undefined); + }); + + resolve('./baz.js', opts('/foo/bar'), function (err, res, pkg) { + if (err) return t.fail(err); + t.equal(res, path.resolve('/foo/bar/baz.js')); + t.equal(pkg, undefined); + }); + + resolve('baz', opts('/foo/bar'), function (err, res) { + t.equal(err.message, "Cannot find module 'baz' from '" + path.resolve('/foo/bar') + "'"); + t.equal(err.code, 'MODULE_NOT_FOUND'); + }); + + resolve('../baz', opts('/foo/bar'), function (err, res) { + t.equal(err.message, "Cannot find module '../baz' from '" + path.resolve('/foo/bar') + "'"); + t.equal(err.code, 'MODULE_NOT_FOUND'); + }); +}); + +test('mock from package', function (t) { + t.plan(8); + + var files = {}; + files[path.resolve('/foo/bar/baz.js')] = 'beep'; + + var dirs = {}; + dirs[path.resolve('/foo/bar')] = true; + + function opts(basedir) { + return { + basedir: path.resolve(basedir), + isFile: function (file, cb) { + cb(null, Object.prototype.hasOwnProperty.call(files, file)); + }, + isDirectory: function (dir, cb) { + cb(null, !!dirs[path.resolve(dir)]); + }, + 'package': { main: 'bar' }, + readFile: function (file, cb) { + cb(null, files[file]); + }, + realpath: function (file, cb) { + cb(null, file); + } + }; + } + + resolve('./baz', opts('/foo/bar'), function (err, res, pkg) { + if (err) return t.fail(err); + t.equal(res, path.resolve('/foo/bar/baz.js')); + t.equal(pkg && pkg.main, 'bar'); + }); + + resolve('./baz.js', opts('/foo/bar'), function (err, res, pkg) { + if (err) return t.fail(err); + t.equal(res, path.resolve('/foo/bar/baz.js')); + t.equal(pkg && pkg.main, 'bar'); + }); + + resolve('baz', opts('/foo/bar'), function (err, res) { + t.equal(err.message, "Cannot find module 'baz' from '" + path.resolve('/foo/bar') + "'"); + t.equal(err.code, 'MODULE_NOT_FOUND'); + }); + + resolve('../baz', opts('/foo/bar'), function (err, res) { + t.equal(err.message, "Cannot find module '../baz' from '" + path.resolve('/foo/bar') + "'"); + t.equal(err.code, 'MODULE_NOT_FOUND'); + }); +}); + +test('mock package', function (t) { + t.plan(2); + + var files = {}; + files[path.resolve('/foo/node_modules/bar/baz.js')] = 'beep'; + files[path.resolve('/foo/node_modules/bar/package.json')] = JSON.stringify({ + main: './baz.js' + }); + + var dirs = {}; + dirs[path.resolve('/foo')] = true; + dirs[path.resolve('/foo/node_modules')] = true; + + function opts(basedir) { + return { + basedir: path.resolve(basedir), + isFile: function (file, cb) { + cb(null, Object.prototype.hasOwnProperty.call(files, path.resolve(file))); + }, + isDirectory: function (dir, cb) { + cb(null, !!dirs[path.resolve(dir)]); + }, + readFile: function (file, cb) { + cb(null, files[path.resolve(file)]); + }, + realpath: function (file, cb) { + cb(null, file); + } + }; + } + + resolve('bar', opts('/foo'), function (err, res, pkg) { + if (err) return t.fail(err); + t.equal(res, path.resolve('/foo/node_modules/bar/baz.js')); + t.equal(pkg && pkg.main, './baz.js'); + }); +}); + +test('mock package from package', function (t) { + t.plan(2); + + var files = {}; + files[path.resolve('/foo/node_modules/bar/baz.js')] = 'beep'; + files[path.resolve('/foo/node_modules/bar/package.json')] = JSON.stringify({ + main: './baz.js' + }); + + var dirs = {}; + dirs[path.resolve('/foo')] = true; + dirs[path.resolve('/foo/node_modules')] = true; + + function opts(basedir) { + return { + basedir: path.resolve(basedir), + isFile: function (file, cb) { + cb(null, Object.prototype.hasOwnProperty.call(files, path.resolve(file))); + }, + isDirectory: function (dir, cb) { + cb(null, !!dirs[path.resolve(dir)]); + }, + 'package': { main: 'bar' }, + readFile: function (file, cb) { + cb(null, files[path.resolve(file)]); + }, + realpath: function (file, cb) { + cb(null, file); + } + }; + } + + resolve('bar', opts('/foo'), function (err, res, pkg) { + if (err) return t.fail(err); + t.equal(res, path.resolve('/foo/node_modules/bar/baz.js')); + t.equal(pkg && pkg.main, './baz.js'); + }); +}); + +test('symlinked', function (t) { + t.plan(4); + + var files = {}; + files[path.resolve('/foo/bar/baz.js')] = 'beep'; + files[path.resolve('/foo/bar/symlinked/baz.js')] = 'beep'; + + var dirs = {}; + dirs[path.resolve('/foo/bar')] = true; + dirs[path.resolve('/foo/bar/symlinked')] = true; + + function opts(basedir) { + return { + preserveSymlinks: false, + basedir: path.resolve(basedir), + isFile: function (file, cb) { + cb(null, Object.prototype.hasOwnProperty.call(files, path.resolve(file))); + }, + isDirectory: function (dir, cb) { + cb(null, !!dirs[path.resolve(dir)]); + }, + readFile: function (file, cb) { + cb(null, files[path.resolve(file)]); + }, + realpath: function (file, cb) { + var resolved = path.resolve(file); + + if (resolved.indexOf('symlinked') >= 0) { + cb(null, resolved); + return; + } + + var ext = path.extname(resolved); + + if (ext) { + var dir = path.dirname(resolved); + var base = path.basename(resolved); + cb(null, path.join(dir, 'symlinked', base)); + } else { + cb(null, path.join(resolved, 'symlinked')); + } + } + }; + } + + resolve('./baz', opts('/foo/bar'), function (err, res, pkg) { + if (err) return t.fail(err); + t.equal(res, path.resolve('/foo/bar/symlinked/baz.js')); + t.equal(pkg, undefined); + }); + + resolve('./baz.js', opts('/foo/bar'), function (err, res, pkg) { + if (err) return t.fail(err); + t.equal(res, path.resolve('/foo/bar/symlinked/baz.js')); + t.equal(pkg, undefined); + }); +}); diff --git a/deps/npm/node_modules/resolve/test/mock_sync.js b/deps/npm/node_modules/resolve/test/mock_sync.js new file mode 100644 index 00000000000000..fcf811444a1f4d --- /dev/null +++ b/deps/npm/node_modules/resolve/test/mock_sync.js @@ -0,0 +1,141 @@ +var path = require('path'); +var test = require('tape'); +var resolve = require('../'); + +test('mock', function (t) { + t.plan(4); + + var files = {}; + files[path.resolve('/foo/bar/baz.js')] = 'beep'; + + var dirs = {}; + dirs[path.resolve('/foo/bar')] = true; + + function opts(basedir) { + return { + basedir: path.resolve(basedir), + isFile: function (file) { + return Object.prototype.hasOwnProperty.call(files, path.resolve(file)); + }, + isDirectory: function (dir) { + return !!dirs[path.resolve(dir)]; + }, + readFileSync: function (file) { + return files[path.resolve(file)]; + }, + realpathSync: function (file) { + return file; + } + }; + } + + t.equal( + resolve.sync('./baz', opts('/foo/bar')), + path.resolve('/foo/bar/baz.js') + ); + + t.equal( + resolve.sync('./baz.js', opts('/foo/bar')), + path.resolve('/foo/bar/baz.js') + ); + + t.throws(function () { + resolve.sync('baz', opts('/foo/bar')); + }); + + t.throws(function () { + resolve.sync('../baz', opts('/foo/bar')); + }); +}); + +test('mock package', function (t) { + t.plan(1); + + var files = {}; + files[path.resolve('/foo/node_modules/bar/baz.js')] = 'beep'; + files[path.resolve('/foo/node_modules/bar/package.json')] = JSON.stringify({ + main: './baz.js' + }); + + var dirs = {}; + dirs[path.resolve('/foo')] = true; + dirs[path.resolve('/foo/node_modules')] = true; + + function opts(basedir) { + return { + basedir: path.resolve(basedir), + isFile: function (file) { + return Object.prototype.hasOwnProperty.call(files, path.resolve(file)); + }, + isDirectory: function (dir) { + return !!dirs[path.resolve(dir)]; + }, + readFileSync: function (file) { + return files[path.resolve(file)]; + }, + realpathSync: function (file) { + return file; + } + }; + } + + t.equal( + resolve.sync('bar', opts('/foo')), + path.resolve('/foo/node_modules/bar/baz.js') + ); +}); + +test('symlinked', function (t) { + t.plan(2); + + var files = {}; + files[path.resolve('/foo/bar/baz.js')] = 'beep'; + files[path.resolve('/foo/bar/symlinked/baz.js')] = 'beep'; + + var dirs = {}; + dirs[path.resolve('/foo/bar')] = true; + dirs[path.resolve('/foo/bar/symlinked')] = true; + + function opts(basedir) { + return { + preserveSymlinks: false, + basedir: path.resolve(basedir), + isFile: function (file) { + return Object.prototype.hasOwnProperty.call(files, path.resolve(file)); + }, + isDirectory: function (dir) { + return !!dirs[path.resolve(dir)]; + }, + readFileSync: function (file) { + return files[path.resolve(file)]; + }, + realpathSync: function (file) { + var resolved = path.resolve(file); + + if (resolved.indexOf('symlinked') >= 0) { + return resolved; + } + + var ext = path.extname(resolved); + + if (ext) { + var dir = path.dirname(resolved); + var base = path.basename(resolved); + return path.join(dir, 'symlinked', base); + } else { + return path.join(resolved, 'symlinked'); + } + } + }; + } + + t.equal( + resolve.sync('./baz', opts('/foo/bar')), + path.resolve('/foo/bar/symlinked/baz.js') + ); + + t.equal( + resolve.sync('./baz.js', opts('/foo/bar')), + path.resolve('/foo/bar/symlinked/baz.js') + ); +}); diff --git a/deps/npm/node_modules/normalize-package-data/node_modules/resolve/test/module_dir.js b/deps/npm/node_modules/resolve/test/module_dir.js similarity index 100% rename from deps/npm/node_modules/normalize-package-data/node_modules/resolve/test/module_dir.js rename to deps/npm/node_modules/resolve/test/module_dir.js diff --git a/deps/npm/node_modules/normalize-package-data/node_modules/resolve/test/module_dir/xmodules/aaa/index.js b/deps/npm/node_modules/resolve/test/module_dir/xmodules/aaa/index.js similarity index 100% rename from deps/npm/node_modules/normalize-package-data/node_modules/resolve/test/module_dir/xmodules/aaa/index.js rename to deps/npm/node_modules/resolve/test/module_dir/xmodules/aaa/index.js diff --git a/deps/npm/node_modules/normalize-package-data/node_modules/resolve/test/module_dir/ymodules/aaa/index.js b/deps/npm/node_modules/resolve/test/module_dir/ymodules/aaa/index.js similarity index 100% rename from deps/npm/node_modules/normalize-package-data/node_modules/resolve/test/module_dir/ymodules/aaa/index.js rename to deps/npm/node_modules/resolve/test/module_dir/ymodules/aaa/index.js diff --git a/deps/npm/node_modules/normalize-package-data/node_modules/resolve/test/module_dir/zmodules/bbb/main.js b/deps/npm/node_modules/resolve/test/module_dir/zmodules/bbb/main.js similarity index 100% rename from deps/npm/node_modules/normalize-package-data/node_modules/resolve/test/module_dir/zmodules/bbb/main.js rename to deps/npm/node_modules/resolve/test/module_dir/zmodules/bbb/main.js diff --git a/deps/npm/node_modules/normalize-package-data/node_modules/resolve/test/module_dir/zmodules/bbb/package.json b/deps/npm/node_modules/resolve/test/module_dir/zmodules/bbb/package.json similarity index 100% rename from deps/npm/node_modules/normalize-package-data/node_modules/resolve/test/module_dir/zmodules/bbb/package.json rename to deps/npm/node_modules/resolve/test/module_dir/zmodules/bbb/package.json diff --git a/deps/npm/node_modules/resolve/test/node-modules-paths.js b/deps/npm/node_modules/resolve/test/node-modules-paths.js new file mode 100644 index 00000000000000..675441db2ced7b --- /dev/null +++ b/deps/npm/node_modules/resolve/test/node-modules-paths.js @@ -0,0 +1,143 @@ +var test = require('tape'); +var path = require('path'); +var parse = path.parse || require('path-parse'); +var keys = require('object-keys'); + +var nodeModulesPaths = require('../lib/node-modules-paths'); + +var verifyDirs = function verifyDirs(t, start, dirs, moduleDirectories, paths) { + var moduleDirs = [].concat(moduleDirectories || 'node_modules'); + if (paths) { + for (var k = 0; k < paths.length; ++k) { + moduleDirs.push(path.basename(paths[k])); + } + } + + var foundModuleDirs = {}; + var uniqueDirs = {}; + var parsedDirs = {}; + for (var i = 0; i < dirs.length; ++i) { + var parsed = parse(dirs[i]); + if (!foundModuleDirs[parsed.base]) { foundModuleDirs[parsed.base] = 0; } + foundModuleDirs[parsed.base] += 1; + parsedDirs[parsed.dir] = true; + uniqueDirs[dirs[i]] = true; + } + t.equal(keys(parsedDirs).length >= start.split(path.sep).length, true, 'there are >= dirs than "start" has'); + var foundModuleDirNames = keys(foundModuleDirs); + t.deepEqual(foundModuleDirNames, moduleDirs, 'all desired module dirs were found'); + t.equal(keys(uniqueDirs).length, dirs.length, 'all dirs provided were unique'); + + var counts = {}; + for (var j = 0; j < foundModuleDirNames.length; ++j) { + counts[foundModuleDirs[j]] = true; + } + t.equal(keys(counts).length, 1, 'all found module directories had the same count'); +}; + +test('node-modules-paths', function (t) { + t.test('no options', function (t) { + var start = path.join(__dirname, 'resolver'); + var dirs = nodeModulesPaths(start); + + verifyDirs(t, start, dirs); + + t.end(); + }); + + t.test('empty options', function (t) { + var start = path.join(__dirname, 'resolver'); + var dirs = nodeModulesPaths(start, {}); + + verifyDirs(t, start, dirs); + + t.end(); + }); + + t.test('with paths=array option', function (t) { + var start = path.join(__dirname, 'resolver'); + var paths = ['a', 'b']; + var dirs = nodeModulesPaths(start, { paths: paths }); + + verifyDirs(t, start, dirs, null, paths); + + t.end(); + }); + + t.test('with paths=function option', function (t) { + var paths = function paths(request, absoluteStart, getNodeModulesDirs, opts) { + return getNodeModulesDirs().concat(path.join(absoluteStart, 'not node modules', request)); + }; + + var start = path.join(__dirname, 'resolver'); + var dirs = nodeModulesPaths(start, { paths: paths }, 'pkg'); + + verifyDirs(t, start, dirs, null, [path.join(start, 'not node modules', 'pkg')]); + + t.end(); + }); + + t.test('with paths=function skipping node modules resolution', function (t) { + var paths = function paths(request, absoluteStart, getNodeModulesDirs, opts) { + return []; + }; + var start = path.join(__dirname, 'resolver'); + var dirs = nodeModulesPaths(start, { paths: paths }); + t.deepEqual(dirs, [], 'no node_modules was computed'); + t.end(); + }); + + t.test('with moduleDirectory option', function (t) { + var start = path.join(__dirname, 'resolver'); + var moduleDirectory = 'not node modules'; + var dirs = nodeModulesPaths(start, { moduleDirectory: moduleDirectory }); + + verifyDirs(t, start, dirs, moduleDirectory); + + t.end(); + }); + + t.test('with 1 moduleDirectory and paths options', function (t) { + var start = path.join(__dirname, 'resolver'); + var paths = ['a', 'b']; + var moduleDirectory = 'not node modules'; + var dirs = nodeModulesPaths(start, { paths: paths, moduleDirectory: moduleDirectory }); + + verifyDirs(t, start, dirs, moduleDirectory, paths); + + t.end(); + }); + + t.test('with 1+ moduleDirectory and paths options', function (t) { + var start = path.join(__dirname, 'resolver'); + var paths = ['a', 'b']; + var moduleDirectories = ['not node modules', 'other modules']; + var dirs = nodeModulesPaths(start, { paths: paths, moduleDirectory: moduleDirectories }); + + verifyDirs(t, start, dirs, moduleDirectories, paths); + + t.end(); + }); + + t.test('combine paths correctly on Windows', function (t) { + var start = 'C:\\Users\\username\\myProject\\src'; + var paths = []; + var moduleDirectories = ['node_modules', start]; + var dirs = nodeModulesPaths(start, { paths: paths, moduleDirectory: moduleDirectories }); + + t.equal(dirs.indexOf(path.resolve(start)) > -1, true, 'should contain start dir'); + + t.end(); + }); + + t.test('combine paths correctly on non-Windows', { skip: process.platform === 'win32' }, function (t) { + var start = '/Users/username/git/myProject/src'; + var paths = []; + var moduleDirectories = ['node_modules', '/Users/username/git/myProject/src']; + var dirs = nodeModulesPaths(start, { paths: paths, moduleDirectory: moduleDirectories }); + + t.equal(dirs.indexOf(path.resolve(start)) > -1, true, 'should contain start dir'); + + t.end(); + }); +}); diff --git a/deps/npm/node_modules/normalize-package-data/node_modules/resolve/test/node_path.js b/deps/npm/node_modules/resolve/test/node_path.js similarity index 100% rename from deps/npm/node_modules/normalize-package-data/node_modules/resolve/test/node_path.js rename to deps/npm/node_modules/resolve/test/node_path.js diff --git a/deps/npm/node_modules/normalize-package-data/node_modules/resolve/test/node_path/x/aaa/index.js b/deps/npm/node_modules/resolve/test/node_path/x/aaa/index.js similarity index 100% rename from deps/npm/node_modules/normalize-package-data/node_modules/resolve/test/node_path/x/aaa/index.js rename to deps/npm/node_modules/resolve/test/node_path/x/aaa/index.js diff --git a/deps/npm/node_modules/normalize-package-data/node_modules/resolve/test/node_path/x/ccc/index.js b/deps/npm/node_modules/resolve/test/node_path/x/ccc/index.js similarity index 100% rename from deps/npm/node_modules/normalize-package-data/node_modules/resolve/test/node_path/x/ccc/index.js rename to deps/npm/node_modules/resolve/test/node_path/x/ccc/index.js diff --git a/deps/npm/node_modules/normalize-package-data/node_modules/resolve/test/node_path/y/bbb/index.js b/deps/npm/node_modules/resolve/test/node_path/y/bbb/index.js similarity index 100% rename from deps/npm/node_modules/normalize-package-data/node_modules/resolve/test/node_path/y/bbb/index.js rename to deps/npm/node_modules/resolve/test/node_path/y/bbb/index.js diff --git a/deps/npm/node_modules/normalize-package-data/node_modules/resolve/test/node_path/y/ccc/index.js b/deps/npm/node_modules/resolve/test/node_path/y/ccc/index.js similarity index 100% rename from deps/npm/node_modules/normalize-package-data/node_modules/resolve/test/node_path/y/ccc/index.js rename to deps/npm/node_modules/resolve/test/node_path/y/ccc/index.js diff --git a/deps/npm/node_modules/normalize-package-data/node_modules/resolve/test/nonstring.js b/deps/npm/node_modules/resolve/test/nonstring.js similarity index 100% rename from deps/npm/node_modules/normalize-package-data/node_modules/resolve/test/nonstring.js rename to deps/npm/node_modules/resolve/test/nonstring.js diff --git a/deps/npm/node_modules/normalize-package-data/node_modules/resolve/test/pathfilter.js b/deps/npm/node_modules/resolve/test/pathfilter.js similarity index 100% rename from deps/npm/node_modules/normalize-package-data/node_modules/resolve/test/pathfilter.js rename to deps/npm/node_modules/resolve/test/pathfilter.js diff --git a/deps/npm/node_modules/normalize-package-data/node_modules/resolve/test/pathfilter/deep_ref/main.js b/deps/npm/node_modules/resolve/test/pathfilter/deep_ref/main.js similarity index 100% rename from deps/npm/node_modules/normalize-package-data/node_modules/resolve/test/pathfilter/deep_ref/main.js rename to deps/npm/node_modules/resolve/test/pathfilter/deep_ref/main.js diff --git a/deps/npm/node_modules/normalize-package-data/node_modules/resolve/test/precedence.js b/deps/npm/node_modules/resolve/test/precedence.js similarity index 100% rename from deps/npm/node_modules/normalize-package-data/node_modules/resolve/test/precedence.js rename to deps/npm/node_modules/resolve/test/precedence.js diff --git a/deps/npm/node_modules/normalize-package-data/node_modules/resolve/test/precedence/aaa.js b/deps/npm/node_modules/resolve/test/precedence/aaa.js similarity index 100% rename from deps/npm/node_modules/normalize-package-data/node_modules/resolve/test/precedence/aaa.js rename to deps/npm/node_modules/resolve/test/precedence/aaa.js diff --git a/deps/npm/node_modules/normalize-package-data/node_modules/resolve/test/precedence/aaa/index.js b/deps/npm/node_modules/resolve/test/precedence/aaa/index.js similarity index 100% rename from deps/npm/node_modules/normalize-package-data/node_modules/resolve/test/precedence/aaa/index.js rename to deps/npm/node_modules/resolve/test/precedence/aaa/index.js diff --git a/deps/npm/node_modules/normalize-package-data/node_modules/resolve/test/precedence/aaa/main.js b/deps/npm/node_modules/resolve/test/precedence/aaa/main.js similarity index 100% rename from deps/npm/node_modules/normalize-package-data/node_modules/resolve/test/precedence/aaa/main.js rename to deps/npm/node_modules/resolve/test/precedence/aaa/main.js diff --git a/deps/npm/node_modules/normalize-package-data/node_modules/resolve/test/precedence/bbb.js b/deps/npm/node_modules/resolve/test/precedence/bbb.js similarity index 100% rename from deps/npm/node_modules/normalize-package-data/node_modules/resolve/test/precedence/bbb.js rename to deps/npm/node_modules/resolve/test/precedence/bbb.js diff --git a/deps/npm/node_modules/normalize-package-data/node_modules/resolve/test/precedence/bbb/main.js b/deps/npm/node_modules/resolve/test/precedence/bbb/main.js similarity index 100% rename from deps/npm/node_modules/normalize-package-data/node_modules/resolve/test/precedence/bbb/main.js rename to deps/npm/node_modules/resolve/test/precedence/bbb/main.js diff --git a/deps/npm/node_modules/normalize-package-data/node_modules/resolve/test/resolver.js b/deps/npm/node_modules/resolve/test/resolver.js similarity index 92% rename from deps/npm/node_modules/normalize-package-data/node_modules/resolve/test/resolver.js rename to deps/npm/node_modules/resolve/test/resolver.js index f7fcd292bdff97..aa36ee1149ba77 100644 --- a/deps/npm/node_modules/normalize-package-data/node_modules/resolve/test/resolver.js +++ b/deps/npm/node_modules/resolve/test/resolver.js @@ -256,6 +256,22 @@ test('other path', function (t) { }); }); +test('path iterator', function (t) { + t.plan(2); + + var resolverDir = path.join(__dirname, 'resolver'); + + var exactIterator = function (x, start, getPackageCandidates, opts) { + return [path.join(resolverDir, x)]; + }; + + resolve('baz', { packageIterator: exactIterator }, function (err, res, pkg) { + if (err) t.fail(err); + t.equal(res, path.join(resolverDir, 'baz/quux.js')); + t.equal(pkg && pkg.name, 'baz'); + }); +}); + test('incorrect main', function (t) { t.plan(1); @@ -283,28 +299,33 @@ test('without basedir', function (t) { }); }); -test('#25: node modules with the same name as node stdlib modules', function (t) { - t.plan(1); +test('#52 - incorrectly resolves module-paths like "./someFolder/" when there is a file of the same name', function (t) { + t.plan(2); - var resolverDir = path.join(__dirname, 'resolver/punycode'); + var dir = path.join(__dirname, 'resolver'); - resolve('punycode', { basedir: resolverDir }, function (err, res, pkg) { + resolve('./foo', { basedir: path.join(dir, 'same_names') }, function (err, res, pkg) { + if (err) t.fail(err); + t.equal(res, path.join(dir, 'same_names/foo.js')); + }); + + resolve('./foo/', { basedir: path.join(dir, 'same_names') }, function (err, res, pkg) { if (err) t.fail(err); - t.equal(res, path.join(resolverDir, 'node_modules/punycode/index.js')); + t.equal(res, path.join(dir, 'same_names/foo/index.js')); }); }); -test('#52 - incorrectly resolves module-paths like "./someFolder/" when there is a file of the same name', function (t) { +test('#211 - incorrectly resolves module-paths like "." when from inside a folder with a sibling file of the same name', function (t) { t.plan(2); var dir = path.join(__dirname, 'resolver'); - resolve('./foo', { basedir: path.join(dir, 'same_names') }, function (err, res, pkg) { + resolve('./', { basedir: path.join(dir, 'same_names/foo') }, function (err, res, pkg) { if (err) t.fail(err); - t.equal(res, path.join(dir, 'same_names/foo.js')); + t.equal(res, path.join(dir, 'same_names/foo/index.js')); }); - resolve('./foo/', { basedir: path.join(dir, 'same_names') }, function (err, res, pkg) { + resolve('.', { basedir: path.join(dir, 'same_names/foo') }, function (err, res, pkg) { if (err) t.fail(err); t.equal(res, path.join(dir, 'same_names/foo/index.js')); }); @@ -413,8 +434,8 @@ test('browser field in package.json', function (t) { basedir: dir, packageFilter: function packageFilter(pkg) { if (pkg.browser) { - pkg.main = pkg.browser; - delete pkg.browser; + pkg.main = pkg.browser; // eslint-disable-line no-param-reassign + delete pkg.browser; // eslint-disable-line no-param-reassign } return pkg; } diff --git a/deps/npm/node_modules/normalize-package-data/node_modules/resolve/test/resolver/baz/doom.js b/deps/npm/node_modules/resolve/test/resolver/baz/doom.js similarity index 100% rename from deps/npm/node_modules/normalize-package-data/node_modules/resolve/test/resolver/baz/doom.js rename to deps/npm/node_modules/resolve/test/resolver/baz/doom.js diff --git a/deps/npm/node_modules/resolve/test/resolver/baz/package.json b/deps/npm/node_modules/resolve/test/resolver/baz/package.json new file mode 100644 index 00000000000000..2f77720b8672a0 --- /dev/null +++ b/deps/npm/node_modules/resolve/test/resolver/baz/package.json @@ -0,0 +1,4 @@ +{ + "name": "baz", + "main": "quux.js" +} diff --git a/deps/npm/node_modules/normalize-package-data/node_modules/resolve/test/resolver/baz/quux.js b/deps/npm/node_modules/resolve/test/resolver/baz/quux.js similarity index 100% rename from deps/npm/node_modules/normalize-package-data/node_modules/resolve/test/resolver/baz/quux.js rename to deps/npm/node_modules/resolve/test/resolver/baz/quux.js diff --git a/deps/npm/node_modules/normalize-package-data/node_modules/resolve/test/resolver/browser_field/a.js b/deps/npm/node_modules/resolve/test/resolver/browser_field/a.js similarity index 100% rename from deps/npm/node_modules/normalize-package-data/node_modules/resolve/test/resolver/browser_field/a.js rename to deps/npm/node_modules/resolve/test/resolver/browser_field/a.js diff --git a/deps/npm/node_modules/normalize-package-data/node_modules/resolve/test/resolver/browser_field/b.js b/deps/npm/node_modules/resolve/test/resolver/browser_field/b.js similarity index 100% rename from deps/npm/node_modules/normalize-package-data/node_modules/resolve/test/resolver/browser_field/b.js rename to deps/npm/node_modules/resolve/test/resolver/browser_field/b.js diff --git a/deps/npm/node_modules/normalize-package-data/node_modules/resolve/test/resolver/browser_field/package.json b/deps/npm/node_modules/resolve/test/resolver/browser_field/package.json similarity index 100% rename from deps/npm/node_modules/normalize-package-data/node_modules/resolve/test/resolver/browser_field/package.json rename to deps/npm/node_modules/resolve/test/resolver/browser_field/package.json diff --git a/deps/npm/node_modules/normalize-package-data/node_modules/resolve/test/resolver/mug.coffee b/deps/npm/node_modules/resolve/test/resolver/cup.coffee similarity index 100% rename from deps/npm/node_modules/normalize-package-data/node_modules/resolve/test/resolver/mug.coffee rename to deps/npm/node_modules/resolve/test/resolver/cup.coffee diff --git a/deps/npm/node_modules/normalize-package-data/node_modules/resolve/test/resolver/dot_main/index.js b/deps/npm/node_modules/resolve/test/resolver/dot_main/index.js similarity index 100% rename from deps/npm/node_modules/normalize-package-data/node_modules/resolve/test/resolver/dot_main/index.js rename to deps/npm/node_modules/resolve/test/resolver/dot_main/index.js diff --git a/deps/npm/node_modules/normalize-package-data/node_modules/resolve/test/resolver/dot_main/package.json b/deps/npm/node_modules/resolve/test/resolver/dot_main/package.json similarity index 100% rename from deps/npm/node_modules/normalize-package-data/node_modules/resolve/test/resolver/dot_main/package.json rename to deps/npm/node_modules/resolve/test/resolver/dot_main/package.json diff --git a/deps/npm/node_modules/normalize-package-data/node_modules/resolve/test/resolver/dot_slash_main/index.js b/deps/npm/node_modules/resolve/test/resolver/dot_slash_main/index.js similarity index 100% rename from deps/npm/node_modules/normalize-package-data/node_modules/resolve/test/resolver/dot_slash_main/index.js rename to deps/npm/node_modules/resolve/test/resolver/dot_slash_main/index.js diff --git a/deps/npm/node_modules/normalize-package-data/node_modules/resolve/test/resolver/dot_slash_main/package.json b/deps/npm/node_modules/resolve/test/resolver/dot_slash_main/package.json similarity index 100% rename from deps/npm/node_modules/normalize-package-data/node_modules/resolve/test/resolver/dot_slash_main/package.json rename to deps/npm/node_modules/resolve/test/resolver/dot_slash_main/package.json diff --git a/deps/npm/node_modules/normalize-package-data/node_modules/resolve/test/resolver/foo.js b/deps/npm/node_modules/resolve/test/resolver/foo.js similarity index 100% rename from deps/npm/node_modules/normalize-package-data/node_modules/resolve/test/resolver/foo.js rename to deps/npm/node_modules/resolve/test/resolver/foo.js diff --git a/deps/npm/node_modules/normalize-package-data/node_modules/resolve/test/resolver/incorrect_main/index.js b/deps/npm/node_modules/resolve/test/resolver/incorrect_main/index.js similarity index 100% rename from deps/npm/node_modules/normalize-package-data/node_modules/resolve/test/resolver/incorrect_main/index.js rename to deps/npm/node_modules/resolve/test/resolver/incorrect_main/index.js diff --git a/deps/npm/node_modules/normalize-package-data/node_modules/resolve/test/resolver/incorrect_main/package.json b/deps/npm/node_modules/resolve/test/resolver/incorrect_main/package.json similarity index 100% rename from deps/npm/node_modules/normalize-package-data/node_modules/resolve/test/resolver/incorrect_main/package.json rename to deps/npm/node_modules/resolve/test/resolver/incorrect_main/package.json diff --git a/deps/npm/node_modules/normalize-package-data/node_modules/resolve/test/resolver/invalid_main/package.json b/deps/npm/node_modules/resolve/test/resolver/invalid_main/package.json similarity index 100% rename from deps/npm/node_modules/normalize-package-data/node_modules/resolve/test/resolver/invalid_main/package.json rename to deps/npm/node_modules/resolve/test/resolver/invalid_main/package.json diff --git a/deps/npm/node_modules/normalize-package-data/node_modules/resolve/test/resolver/mug.js b/deps/npm/node_modules/resolve/test/resolver/mug.coffee similarity index 100% rename from deps/npm/node_modules/normalize-package-data/node_modules/resolve/test/resolver/mug.js rename to deps/npm/node_modules/resolve/test/resolver/mug.coffee diff --git a/deps/npm/node_modules/normalize-package-data/node_modules/resolve/test/resolver/multirepo/packages/package-b/index.js b/deps/npm/node_modules/resolve/test/resolver/mug.js similarity index 100% rename from deps/npm/node_modules/normalize-package-data/node_modules/resolve/test/resolver/multirepo/packages/package-b/index.js rename to deps/npm/node_modules/resolve/test/resolver/mug.js diff --git a/deps/npm/node_modules/normalize-package-data/node_modules/resolve/test/resolver/multirepo/lerna.json b/deps/npm/node_modules/resolve/test/resolver/multirepo/lerna.json similarity index 100% rename from deps/npm/node_modules/normalize-package-data/node_modules/resolve/test/resolver/multirepo/lerna.json rename to deps/npm/node_modules/resolve/test/resolver/multirepo/lerna.json diff --git a/deps/npm/node_modules/normalize-package-data/node_modules/resolve/test/resolver/multirepo/package.json b/deps/npm/node_modules/resolve/test/resolver/multirepo/package.json similarity index 100% rename from deps/npm/node_modules/normalize-package-data/node_modules/resolve/test/resolver/multirepo/package.json rename to deps/npm/node_modules/resolve/test/resolver/multirepo/package.json diff --git a/deps/npm/node_modules/normalize-package-data/node_modules/resolve/test/resolver/multirepo/packages/package-a/index.js b/deps/npm/node_modules/resolve/test/resolver/multirepo/packages/package-a/index.js similarity index 100% rename from deps/npm/node_modules/normalize-package-data/node_modules/resolve/test/resolver/multirepo/packages/package-a/index.js rename to deps/npm/node_modules/resolve/test/resolver/multirepo/packages/package-a/index.js diff --git a/deps/npm/node_modules/normalize-package-data/node_modules/resolve/test/resolver/multirepo/packages/package-a/package.json b/deps/npm/node_modules/resolve/test/resolver/multirepo/packages/package-a/package.json similarity index 100% rename from deps/npm/node_modules/normalize-package-data/node_modules/resolve/test/resolver/multirepo/packages/package-a/package.json rename to deps/npm/node_modules/resolve/test/resolver/multirepo/packages/package-a/package.json diff --git a/deps/npm/node_modules/normalize-package-data/node_modules/resolve/test/resolver/other_path/lib/other-lib.js b/deps/npm/node_modules/resolve/test/resolver/multirepo/packages/package-b/index.js similarity index 100% rename from deps/npm/node_modules/normalize-package-data/node_modules/resolve/test/resolver/other_path/lib/other-lib.js rename to deps/npm/node_modules/resolve/test/resolver/multirepo/packages/package-b/index.js diff --git a/deps/npm/node_modules/normalize-package-data/node_modules/resolve/test/resolver/multirepo/packages/package-b/package.json b/deps/npm/node_modules/resolve/test/resolver/multirepo/packages/package-b/package.json similarity index 100% rename from deps/npm/node_modules/normalize-package-data/node_modules/resolve/test/resolver/multirepo/packages/package-b/package.json rename to deps/npm/node_modules/resolve/test/resolver/multirepo/packages/package-b/package.json diff --git a/deps/npm/node_modules/resolve/test/resolver/nested_symlinks/mylib/async.js b/deps/npm/node_modules/resolve/test/resolver/nested_symlinks/mylib/async.js new file mode 100644 index 00000000000000..3d2c6b8e10bf0c --- /dev/null +++ b/deps/npm/node_modules/resolve/test/resolver/nested_symlinks/mylib/async.js @@ -0,0 +1,25 @@ +var a = require.resolve('buffer/').replace(process.cwd(), '$CWD'); +var b; +var c; + +var test = function test() { + console.log(a, ': require.resolve, preserveSymlinks ' + (process.execArgv.indexOf('preserve-symlinks') > -1 ? 'true' : 'false')); + console.log(b, ': preserveSymlinks true'); + console.log(c, ': preserveSymlinks false'); + + if (a !== b && a !== c) { + throw 'async: no match'; + } + console.log('async: success! a matched either b or c\n'); +}; + +require('resolve')('buffer/', { preserveSymlinks: true }, function (err, result) { + if (err) { throw err; } + b = result.replace(process.cwd(), '$CWD'); + if (b && c) { test(); } +}); +require('resolve')('buffer/', { preserveSymlinks: false }, function (err, result) { + if (err) { throw err; } + c = result.replace(process.cwd(), '$CWD'); + if (b && c) { test(); } +}); diff --git a/deps/npm/node_modules/resolve/test/resolver/nested_symlinks/mylib/package.json b/deps/npm/node_modules/resolve/test/resolver/nested_symlinks/mylib/package.json new file mode 100644 index 00000000000000..acfe9e9517720a --- /dev/null +++ b/deps/npm/node_modules/resolve/test/resolver/nested_symlinks/mylib/package.json @@ -0,0 +1,15 @@ +{ + "name": "mylib", + "version": "0.0.0", + "description": "", + "private": true, + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "keywords": [], + "author": "", + "license": "ISC", + "dependencies": { + "buffer": "*" + } +} diff --git a/deps/npm/node_modules/resolve/test/resolver/nested_symlinks/mylib/sync.js b/deps/npm/node_modules/resolve/test/resolver/nested_symlinks/mylib/sync.js new file mode 100644 index 00000000000000..3283efc2ec81f8 --- /dev/null +++ b/deps/npm/node_modules/resolve/test/resolver/nested_symlinks/mylib/sync.js @@ -0,0 +1,12 @@ +var a = require.resolve('buffer/').replace(process.cwd(), '$CWD'); +var b = require('resolve').sync('buffer/', { preserveSymlinks: true }).replace(process.cwd(), '$CWD'); +var c = require('resolve').sync('buffer/', { preserveSymlinks: false }).replace(process.cwd(), '$CWD'); + +console.log(a, ': require.resolve, preserveSymlinks ' + (process.execArgv.indexOf('preserve-symlinks') > -1 ? 'true' : 'false')); +console.log(b, ': preserveSymlinks true'); +console.log(c, ': preserveSymlinks false'); + +if (a !== b && a !== c) { + throw 'sync: no match'; +} +console.log('sync: success! a matched either b or c\n'); diff --git a/deps/npm/node_modules/normalize-package-data/node_modules/resolve/test/resolver/other_path/root.js b/deps/npm/node_modules/resolve/test/resolver/other_path/lib/other-lib.js similarity index 100% rename from deps/npm/node_modules/normalize-package-data/node_modules/resolve/test/resolver/other_path/root.js rename to deps/npm/node_modules/resolve/test/resolver/other_path/lib/other-lib.js diff --git a/deps/npm/node_modules/normalize-package-data/node_modules/resolve/test/resolver/symlinked/_/node_modules/foo.js b/deps/npm/node_modules/resolve/test/resolver/other_path/root.js similarity index 100% rename from deps/npm/node_modules/normalize-package-data/node_modules/resolve/test/resolver/symlinked/_/node_modules/foo.js rename to deps/npm/node_modules/resolve/test/resolver/other_path/root.js diff --git a/deps/npm/node_modules/normalize-package-data/node_modules/resolve/test/resolver/quux/foo/index.js b/deps/npm/node_modules/resolve/test/resolver/quux/foo/index.js similarity index 100% rename from deps/npm/node_modules/normalize-package-data/node_modules/resolve/test/resolver/quux/foo/index.js rename to deps/npm/node_modules/resolve/test/resolver/quux/foo/index.js diff --git a/deps/npm/node_modules/normalize-package-data/node_modules/resolve/test/resolver/same_names/foo.js b/deps/npm/node_modules/resolve/test/resolver/same_names/foo.js similarity index 100% rename from deps/npm/node_modules/normalize-package-data/node_modules/resolve/test/resolver/same_names/foo.js rename to deps/npm/node_modules/resolve/test/resolver/same_names/foo.js diff --git a/deps/npm/node_modules/normalize-package-data/node_modules/resolve/test/resolver/same_names/foo/index.js b/deps/npm/node_modules/resolve/test/resolver/same_names/foo/index.js similarity index 100% rename from deps/npm/node_modules/normalize-package-data/node_modules/resolve/test/resolver/same_names/foo/index.js rename to deps/npm/node_modules/resolve/test/resolver/same_names/foo/index.js diff --git a/deps/npm/node_modules/normalize-package-data/node_modules/resolve/test/resolver/symlinked/_/symlink_target/.gitkeep b/deps/npm/node_modules/resolve/test/resolver/symlinked/_/node_modules/foo.js similarity index 100% rename from deps/npm/node_modules/normalize-package-data/node_modules/resolve/test/resolver/symlinked/_/symlink_target/.gitkeep rename to deps/npm/node_modules/resolve/test/resolver/symlinked/_/node_modules/foo.js diff --git a/deps/npm/node_modules/resolve/test/resolver/symlinked/_/symlink_target/.gitkeep b/deps/npm/node_modules/resolve/test/resolver/symlinked/_/symlink_target/.gitkeep new file mode 100644 index 00000000000000..e69de29bb2d1d6 diff --git a/deps/npm/node_modules/resolve/test/resolver/symlinked/package/bar.js b/deps/npm/node_modules/resolve/test/resolver/symlinked/package/bar.js new file mode 100644 index 00000000000000..cb1c2c01e753b3 --- /dev/null +++ b/deps/npm/node_modules/resolve/test/resolver/symlinked/package/bar.js @@ -0,0 +1 @@ +module.exports = 'bar'; diff --git a/deps/npm/node_modules/resolve/test/resolver/symlinked/package/package.json b/deps/npm/node_modules/resolve/test/resolver/symlinked/package/package.json new file mode 100644 index 00000000000000..8e1b585914a7b4 --- /dev/null +++ b/deps/npm/node_modules/resolve/test/resolver/symlinked/package/package.json @@ -0,0 +1,3 @@ +{ + "main": "bar.js" +} \ No newline at end of file diff --git a/deps/npm/node_modules/normalize-package-data/node_modules/resolve/test/resolver/without_basedir/main.js b/deps/npm/node_modules/resolve/test/resolver/without_basedir/main.js similarity index 100% rename from deps/npm/node_modules/normalize-package-data/node_modules/resolve/test/resolver/without_basedir/main.js rename to deps/npm/node_modules/resolve/test/resolver/without_basedir/main.js diff --git a/deps/npm/node_modules/normalize-package-data/node_modules/resolve/test/resolver_sync.js b/deps/npm/node_modules/resolve/test/resolver_sync.js similarity index 89% rename from deps/npm/node_modules/normalize-package-data/node_modules/resolve/test/resolver_sync.js rename to deps/npm/node_modules/resolve/test/resolver_sync.js index f33143903c140e..3082c96e58b74f 100644 --- a/deps/npm/node_modules/normalize-package-data/node_modules/resolve/test/resolver_sync.js +++ b/deps/npm/node_modules/resolve/test/resolver_sync.js @@ -172,24 +172,28 @@ test('other path', function (t) { t.end(); }); -test('incorrect main', function (t) { +test('path iterator', function (t) { var resolverDir = path.join(__dirname, 'resolver'); - var dir = path.join(resolverDir, 'incorrect_main'); + + var exactIterator = function (x, start, getPackageCandidates, opts) { + return [path.join(resolverDir, x)]; + }; t.equal( - resolve.sync('./incorrect_main', { basedir: resolverDir }), - path.join(dir, 'index.js') + resolve.sync('baz', { packageIterator: exactIterator }), + path.join(resolverDir, 'baz/quux.js') ); t.end(); }); -test('#25: node modules with the same name as node stdlib modules', function (t) { - var resolverDir = path.join(__dirname, 'resolver/punycode'); +test('incorrect main', function (t) { + var resolverDir = path.join(__dirname, 'resolver'); + var dir = path.join(resolverDir, 'incorrect_main'); t.equal( - resolve.sync('punycode', { basedir: resolverDir }), - path.join(resolverDir, 'node_modules/punycode/index.js') + resolve.sync('./incorrect_main', { basedir: resolverDir }), + path.join(dir, 'index.js') ); t.end(); @@ -234,6 +238,20 @@ test('#52 - incorrectly resolves module-paths like "./someFolder/" when there is t.end(); }); +test('#211 - incorrectly resolves module-paths like "." when from inside a folder with a sibling file of the same name', function (t) { + var dir = path.join(__dirname, 'resolver'); + + t.equal( + resolve.sync('./', { basedir: path.join(dir, 'same_names/foo') }), + path.join(dir, 'same_names/foo/index.js') + ); + t.equal( + resolve.sync('.', { basedir: path.join(dir, 'same_names/foo') }), + path.join(dir, 'same_names/foo/index.js') + ); + t.end(); +}); + test('sync: #121 - treating an existing file as a dir when no basedir', function (t) { var testFile = path.basename(__filename); @@ -329,8 +347,8 @@ test('browser field in package.json', function (t) { basedir: dir, packageFilter: function packageFilter(pkg) { if (pkg.browser) { - pkg.main = pkg.browser; - delete pkg.browser; + pkg.main = pkg.browser; // eslint-disable-line no-param-reassign + delete pkg.browser; // eslint-disable-line no-param-reassign } return pkg; } diff --git a/deps/npm/node_modules/resolve/test/shadowed_core.js b/deps/npm/node_modules/resolve/test/shadowed_core.js new file mode 100644 index 00000000000000..3b4739898d1cc9 --- /dev/null +++ b/deps/npm/node_modules/resolve/test/shadowed_core.js @@ -0,0 +1,37 @@ +var test = require('tape'); +var resolve = require('../'); +var path = require('path'); + +test('shadowed core modules still return core module', function (t) { + t.plan(2); + + resolve('util', { basedir: path.join(__dirname, 'shadowed_core') }, function (err, res) { + t.ifError(err); + t.equal(res, 'util'); + }); +}); + +test('shadowed core modules still return core module [sync]', function (t) { + t.plan(1); + + var res = resolve.sync('util', { basedir: path.join(__dirname, 'shadowed_core') }); + + t.equal(res, 'util'); +}); + +test('shadowed core modules return shadow when appending `/`', function (t) { + t.plan(2); + + resolve('util/', { basedir: path.join(__dirname, 'shadowed_core') }, function (err, res) { + t.ifError(err); + t.equal(res, path.join(__dirname, 'shadowed_core/node_modules/util/index.js')); + }); +}); + +test('shadowed core modules return shadow when appending `/` [sync]', function (t) { + t.plan(1); + + var res = resolve.sync('util/', { basedir: path.join(__dirname, 'shadowed_core') }); + + t.equal(res, path.join(__dirname, 'shadowed_core/node_modules/util/index.js')); +}); diff --git a/deps/npm/node_modules/resolve/test/shadowed_core/node_modules/util/index.js b/deps/npm/node_modules/resolve/test/shadowed_core/node_modules/util/index.js new file mode 100644 index 00000000000000..e69de29bb2d1d6 diff --git a/deps/npm/node_modules/normalize-package-data/node_modules/resolve/test/subdirs.js b/deps/npm/node_modules/resolve/test/subdirs.js similarity index 100% rename from deps/npm/node_modules/normalize-package-data/node_modules/resolve/test/subdirs.js rename to deps/npm/node_modules/resolve/test/subdirs.js diff --git a/deps/npm/node_modules/resolve/test/symlinks.js b/deps/npm/node_modules/resolve/test/symlinks.js new file mode 100644 index 00000000000000..152d14ef2d1991 --- /dev/null +++ b/deps/npm/node_modules/resolve/test/symlinks.js @@ -0,0 +1,173 @@ +var path = require('path'); +var fs = require('fs'); +var test = require('tape'); +var map = require('array.prototype.map'); +var resolve = require('../'); + +var symlinkDir = path.join(__dirname, 'resolver', 'symlinked', 'symlink'); +var packageDir = path.join(__dirname, 'resolver', 'symlinked', '_', 'node_modules', 'package'); +var modADir = path.join(__dirname, 'symlinks', 'source', 'node_modules', 'mod-a'); +var symlinkModADir = path.join(__dirname, 'symlinks', 'dest', 'node_modules', 'mod-a'); +try { + fs.unlinkSync(symlinkDir); +} catch (err) {} +try { + fs.unlinkSync(packageDir); +} catch (err) {} +try { + fs.unlinkSync(modADir); +} catch (err) {} +try { + fs.unlinkSync(symlinkModADir); +} catch (err) {} + +try { + fs.symlinkSync('./_/symlink_target', symlinkDir, 'dir'); +} catch (err) { + // if fails then it is probably on Windows and lets try to create a junction + fs.symlinkSync(path.join(__dirname, 'resolver', 'symlinked', '_', 'symlink_target') + '\\', symlinkDir, 'junction'); +} +try { + fs.symlinkSync('../../package', packageDir, 'dir'); +} catch (err) { + // if fails then it is probably on Windows and lets try to create a junction + fs.symlinkSync(path.join(__dirname, '..', '..', 'package') + '\\', packageDir, 'junction'); +} +try { + fs.symlinkSync('../../source/node_modules/mod-a', symlinkModADir, 'dir'); +} catch (err) { + // if fails then it is probably on Windows and lets try to create a junction + fs.symlinkSync(path.join(__dirname, '..', '..', 'source', 'node_modules', 'mod-a') + '\\', symlinkModADir, 'junction'); +} + +test('symlink', function (t) { + t.plan(2); + + resolve('foo', { basedir: symlinkDir, preserveSymlinks: false }, function (err, res, pkg) { + t.error(err); + t.equal(res, path.join(__dirname, 'resolver', 'symlinked', '_', 'node_modules', 'foo.js')); + }); +}); + +test('sync symlink when preserveSymlinks = true', function (t) { + t.plan(4); + + resolve('foo', { basedir: symlinkDir }, function (err, res, pkg) { + t.ok(err, 'there is an error'); + t.notOk(res, 'no result'); + + t.equal(err && err.code, 'MODULE_NOT_FOUND', 'error code matches require.resolve'); + t.equal( + err && err.message, + 'Cannot find module \'foo\' from \'' + symlinkDir + '\'', + 'can not find nonexistent module' + ); + }); +}); + +test('sync symlink', function (t) { + var start = new Date(); + t.doesNotThrow(function () { + t.equal(resolve.sync('foo', { basedir: symlinkDir, preserveSymlinks: false }), path.join(__dirname, 'resolver', 'symlinked', '_', 'node_modules', 'foo.js')); + }); + t.ok(new Date() - start < 50, 'resolve.sync timedout'); + t.end(); +}); + +test('sync symlink when preserveSymlinks = true', function (t) { + t.throws(function () { + resolve.sync('foo', { basedir: symlinkDir }); + }, /Cannot find module 'foo'/); + t.end(); +}); + +test('sync symlink from node_modules to other dir when preserveSymlinks = false', function (t) { + var basedir = path.join(__dirname, 'resolver', 'symlinked', '_'); + var fn = resolve.sync('package', { basedir: basedir, preserveSymlinks: false }); + + t.equal(fn, path.resolve(__dirname, 'resolver/symlinked/package/bar.js')); + t.end(); +}); + +test('async symlink from node_modules to other dir when preserveSymlinks = false', function (t) { + t.plan(2); + var basedir = path.join(__dirname, 'resolver', 'symlinked', '_'); + resolve('package', { basedir: basedir, preserveSymlinks: false }, function (err, result) { + t.notOk(err, 'no error'); + t.equal(result, path.resolve(__dirname, 'resolver/symlinked/package/bar.js')); + }); +}); + +test('packageFilter', function (t) { + function relative(x) { + return path.relative(__dirname, x); + } + + function testPackageFilter(preserveSymlinks) { + return function (st) { + st.plan('is 1.x' ? 3 : 5); // eslint-disable-line no-constant-condition + + var destMain = 'symlinks/dest/node_modules/mod-a/index.js'; + var destPkg = 'symlinks/dest/node_modules/mod-a/package.json'; + var sourceMain = 'symlinks/source/node_modules/mod-a/index.js'; + var sourcePkg = 'symlinks/source/node_modules/mod-a/package.json'; + var destDir = path.join(__dirname, 'symlinks', 'dest'); + + /* eslint multiline-comment-style: 0 */ + /* v2.x will restore these tests + var packageFilterPath = []; + var actualPath = resolve.sync('mod-a', { + basedir: destDir, + preserveSymlinks: preserveSymlinks, + packageFilter: function (pkg, pkgfile, dir) { + packageFilterPath.push(pkgfile); + } + }); + st.equal( + relative(actualPath), + path.normalize(preserveSymlinks ? destMain : sourceMain), + 'sync: actual path is correct' + ); + st.deepEqual( + map(packageFilterPath, relative), + map(preserveSymlinks ? [destPkg, destPkg] : [sourcePkg, sourcePkg], path.normalize), + 'sync: packageFilter pkgfile arg is correct' + ); + */ + + var asyncPackageFilterPath = []; + resolve( + 'mod-a', + { + basedir: destDir, + preserveSymlinks: preserveSymlinks, + packageFilter: function (pkg, pkgfile) { + asyncPackageFilterPath.push(pkgfile); + } + }, + function (err, actualPath) { + st.error(err, 'no error'); + st.equal( + relative(actualPath), + path.normalize(preserveSymlinks ? destMain : sourceMain), + 'async: actual path is correct' + ); + st.deepEqual( + map(asyncPackageFilterPath, relative), + map( + preserveSymlinks ? [destPkg, destPkg, destPkg] : [sourcePkg, sourcePkg, sourcePkg], + path.normalize + ), + 'async: packageFilter pkgfile arg is correct' + ); + } + ); + }; + } + + t.test('preserveSymlinks: false', testPackageFilter(false)); + + t.test('preserveSymlinks: true', testPackageFilter(true)); + + t.end(); +}); diff --git a/deps/npm/node_modules/retry/.npmignore b/deps/npm/node_modules/retry/.npmignore index 432f2855d6839d..e7726a071b7f39 100644 --- a/deps/npm/node_modules/retry/.npmignore +++ b/deps/npm/node_modules/retry/.npmignore @@ -1,3 +1,2 @@ /node_modules/* npm-debug.log -coverage diff --git a/deps/npm/node_modules/retry/.travis.yml b/deps/npm/node_modules/retry/.travis.yml deleted file mode 100644 index bcde2122b90065..00000000000000 --- a/deps/npm/node_modules/retry/.travis.yml +++ /dev/null @@ -1,15 +0,0 @@ -language: node_js -node_js: - - "4" -before_install: - - pip install --user codecov -after_success: - - codecov --file coverage/lcov.info --disable search -# travis encrypt [subdomain]:[api token]@[room id] -# notifications: -# email: false -# campfire: -# rooms: -# secure: xyz -# on_failure: always -# on_success: always diff --git a/deps/npm/node_modules/retry/Makefile b/deps/npm/node_modules/retry/Makefile index 1968d8ff8b07bc..98e7167bbe359f 100644 --- a/deps/npm/node_modules/retry/Makefile +++ b/deps/npm/node_modules/retry/Makefile @@ -1,5 +1,8 @@ SHELL := /bin/bash +test: + @node test/runner.js + release-major: test npm version major -m "Release %s" git push @@ -15,4 +18,4 @@ release-patch: test git push npm publish -.PHONY: test release-major release-minor release-patch +.PHONY: test diff --git a/deps/npm/node_modules/retry/Readme.md b/deps/npm/node_modules/retry/Readme.md index 16e28ec267d6da..eee05f7bb61537 100644 --- a/deps/npm/node_modules/retry/Readme.md +++ b/deps/npm/node_modules/retry/Readme.md @@ -1,8 +1,3 @@ - -[![Build Status](https://secure.travis-ci.org/tim-kos/node-retry.png?branch=master)](http://travis-ci.org/tim-kos/node-retry "Check this project's build status on TravisCI") -[![codecov](https://codecov.io/gh/tim-kos/node-retry/branch/master/graph/badge.svg)](https://codecov.io/gh/tim-kos/node-retry) - - # retry Abstraction for exponential and custom retry strategies for failed operations. @@ -65,8 +60,7 @@ var operation = retry.operation({ Creates a new `RetryOperation` object. `options` is the same as `retry.timeouts()`'s `options`, with two additions: * `forever`: Whether to retry forever, defaults to `false`. -* `unref`: Whether to [unref](https://nodejs.org/api/timers.html#timers_unref) the setTimeout's, defaults to `false`. -* `maxRetryTime`: The maximum time (in milliseconds) that the retried operation is allowed to run. Default is `Infinity`. +* `unref`: Wether to [unref](https://nodejs.org/api/timers.html#timers_unref) the setTimeout's, defaults to `false`. ### retry.timeouts([options]) @@ -75,7 +69,7 @@ milliseconds. If `options` is an array, a copy of that array is returned. `options` is a JS object that can contain any of the following keys: -* `retries`: The maximum amount of times to retry the operation. Default is `10`. Seting this to `1` means `do it once, then retry it once`. +* `retries`: The maximum amount of times to retry the operation. Default is `10`. * `factor`: The exponential factor to use. Default is `2`. * `minTimeout`: The number of milliseconds before starting the first retry. Default is `1000`. * `maxTimeout`: The maximum number of milliseconds between two retries. Default is `Infinity`. @@ -149,10 +143,8 @@ If `forever` is true, the following changes happen: #### retryOperation.errors() -Returns an array of all errors that have been passed to `retryOperation.retry()` so far. The -returning array has the errors ordered chronologically based on when they were passed to -`retryOperation.retry()`, which means the first passed error is at index zero and the last is -at the last index. +Returns an array of all errors that have been passed to +`retryOperation.retry()` so far. #### retryOperation.mainError() @@ -193,10 +185,6 @@ the current attempt number. Allows you to stop the operation being retried. Useful for aborting the operation on a fatal error etc. -#### retryOperation.reset() - -Resets the internal state of the operation object, so that you can call `attempt()` again as if this was a new operation object. - #### retryOperation.attempts() Returns an int representing the number of attempts it took to call `fn` before it was successful. diff --git a/deps/npm/node_modules/retry/lib/retry.js b/deps/npm/node_modules/retry/lib/retry.js index dcb57680727948..77428cfd0006fa 100644 --- a/deps/npm/node_modules/retry/lib/retry.js +++ b/deps/npm/node_modules/retry/lib/retry.js @@ -4,8 +4,7 @@ exports.operation = function(options) { var timeouts = exports.timeouts(options); return new RetryOperation(timeouts, { forever: options && options.forever, - unref: options && options.unref, - maxRetryTime: options && options.maxRetryTime + unref: options && options.unref }); }; @@ -76,9 +75,9 @@ exports.wrap = function(obj, options, methods) { var method = methods[i]; var original = obj[method]; - obj[method] = function retryWrapper(original) { + obj[method] = function retryWrapper() { var op = exports.operation(options); - var args = Array.prototype.slice.call(arguments, 1); + var args = Array.prototype.slice.call(arguments); var callback = args.pop(); args.push(function(err) { @@ -94,7 +93,7 @@ exports.wrap = function(obj, options, methods) { op.attempt(function() { original.apply(obj, args); }); - }.bind(obj, original); + }; obj[method].options = options; } }; diff --git a/deps/npm/node_modules/retry/lib/retry_operation.js b/deps/npm/node_modules/retry/lib/retry_operation.js index 1e564696fe7e07..2b3db8e1776973 100644 --- a/deps/npm/node_modules/retry/lib/retry_operation.js +++ b/deps/npm/node_modules/retry/lib/retry_operation.js @@ -4,17 +4,14 @@ function RetryOperation(timeouts, options) { options = { forever: options }; } - this._originalTimeouts = JSON.parse(JSON.stringify(timeouts)); this._timeouts = timeouts; this._options = options || {}; - this._maxRetryTime = options && options.maxRetryTime || Infinity; this._fn = null; this._errors = []; this._attempts = 1; this._operationTimeout = null; this._operationTimeoutCb = null; this._timeout = null; - this._operationStart = null; if (this._options.forever) { this._cachedTimeouts = this._timeouts.slice(0); @@ -22,11 +19,6 @@ function RetryOperation(timeouts, options) { } module.exports = RetryOperation; -RetryOperation.prototype.reset = function() { - this._attempts = 1; - this._timeouts = this._originalTimeouts; -} - RetryOperation.prototype.stop = function() { if (this._timeout) { clearTimeout(this._timeout); @@ -44,11 +36,6 @@ RetryOperation.prototype.retry = function(err) { if (!err) { return false; } - var currentTime = new Date().getTime(); - if (err && currentTime - this._operationStart >= this._maxRetryTime) { - this._errors.unshift(new Error('RetryOperation timeout occurred')); - return false; - } this._errors.push(err); @@ -73,7 +60,7 @@ RetryOperation.prototype.retry = function(err) { self._operationTimeoutCb(self._attempts); }, self._operationTimeout); - if (self._options.unref) { + if (this._options.unref) { self._timeout.unref(); } } @@ -107,8 +94,6 @@ RetryOperation.prototype.attempt = function(fn, timeoutOps) { }, self._operationTimeout); } - this._operationStart = new Date().getTime(); - this._fn(this._attempts); }; diff --git a/deps/npm/node_modules/retry/package.json b/deps/npm/node_modules/retry/package.json index 09a88a8abc2ee9..5ac60c858009fa 100644 --- a/deps/npm/node_modules/retry/package.json +++ b/deps/npm/node_modules/retry/package.json @@ -1,67 +1,24 @@ { - "_args": [ - [ - "retry@0.12.0", - "/Users/rebecca/code/npm" - ] - ], - "_from": "retry@0.12.0", - "_id": "retry@0.12.0", - "_inBundle": false, - "_integrity": "sha1-G0KmJmoh8HQh0bC1S33BZ7AcATs=", - "_location": "/retry", - "_phantomChildren": {}, - "_requested": { - "type": "version", - "registry": true, - "raw": "retry@0.12.0", - "name": "retry", - "escapedName": "retry", - "rawSpec": "0.12.0", - "saveSpec": null, - "fetchSpec": "0.12.0" - }, - "_requiredBy": [ - "/" - ], - "_resolved": "https://registry.npmjs.org/retry/-/retry-0.12.0.tgz", - "_spec": "0.12.0", - "_where": "/Users/rebecca/code/npm", - "author": { - "name": "Tim Koschützki", - "email": "tim@debuggable.com", - "url": "http://debuggable.com/" - }, - "bugs": { - "url": "https://github.com/tim-kos/node-retry/issues" - }, - "dependencies": {}, + "author": "Tim Koschützki (http://debuggable.com/)", + "name": "retry", "description": "Abstraction for exponential and custom retry strategies for failed operations.", - "devDependencies": { - "fake": "0.2.0", - "istanbul": "^0.4.5", - "tape": "^4.8.0" - }, - "directories": { - "lib": "./lib" - }, - "engines": { - "node": ">= 4" - }, - "homepage": "https://github.com/tim-kos/node-retry", "license": "MIT", - "main": "index", - "name": "retry", + "version": "0.10.1", + "homepage": "https://github.com/tim-kos/node-retry", "repository": { "type": "git", "url": "git://github.com/tim-kos/node-retry.git" }, - "scripts": { - "release": "npm version ${SEMANTIC:-patch} -m \"Release %s\" && git push && git push --tags && npm publish", - "release:major": "env SEMANTIC=major npm run release", - "release:minor": "env SEMANTIC=minor npm run release", - "release:patch": "env SEMANTIC=patch npm run release", - "test": "istanbul cover ./node_modules/tape/bin/tape ./test/integration/*.js" + "directories": { + "lib": "./lib" + }, + "main": "index", + "engines": { + "node": "*" }, - "version": "0.12.0" + "dependencies": {}, + "devDependencies": { + "fake": "0.2.0", + "far": "0.0.1" + } } diff --git a/deps/npm/node_modules/retry/test/integration/test-retry-operation.js b/deps/npm/node_modules/retry/test/integration/test-retry-operation.js index e351bb683ed449..916936424f073b 100644 --- a/deps/npm/node_modules/retry/test/integration/test-retry-operation.js +++ b/deps/npm/node_modules/retry/test/integration/test-retry-operation.js @@ -3,45 +3,6 @@ var assert = common.assert; var fake = common.fake.create(); var retry = require(common.dir.lib + '/retry'); -(function testReset() { - var error = new Error('some error'); - var operation = retry.operation([1, 2, 3]); - var attempts = 0; - - var finalCallback = fake.callback('finalCallback'); - fake.expectAnytime(finalCallback); - - var expectedFinishes = 1; - var finishes = 0; - - var fn = function() { - operation.attempt(function(currentAttempt) { - attempts++; - assert.equal(currentAttempt, attempts); - if (operation.retry(error)) { - return; - } - - finishes++ - assert.equal(expectedFinishes, finishes); - assert.strictEqual(attempts, 4); - assert.strictEqual(operation.attempts(), attempts); - assert.strictEqual(operation.mainError(), error); - - if (finishes < 2) { - attempts = 0; - expectedFinishes++; - operation.reset(); - fn() - } else { - finalCallback(); - } - }); - }; - - fn(); -})(); - (function testErrors() { var operation = retry.operation(); @@ -92,6 +53,7 @@ var retry = require(common.dir.lib + '/retry'); })(); (function testRetry() { + var times = 3; var error = new Error('some error'); var operation = retry.operation([1, 2, 3]); var attempts = 0; @@ -170,7 +132,7 @@ var retry = require(common.dir.lib + '/retry'); var endTime = new Date().getTime(); var minTime = startTime + (delay * 3); var maxTime = minTime + 20 // add a little headroom for code execution time - assert(endTime >= minTime) + assert(endTime > minTime) assert(endTime < maxTime) assert.strictEqual(attempts, 4); assert.strictEqual(operation.attempts(), attempts); @@ -212,47 +174,3 @@ var retry = require(common.dir.lib + '/retry'); fn(); })(); - -(function testMaxRetryTime() { - var error = new Error('some error'); - var maxRetryTime = 30; - var operation = retry.operation({ - minTimeout: 1, - maxRetryTime: maxRetryTime - }); - var attempts = 0; - - var finalCallback = fake.callback('finalCallback'); - fake.expectAnytime(finalCallback); - - var longAsyncFunction = function (wait, callback){ - setTimeout(callback, wait); - }; - - var fn = function() { - var startTime = new Date().getTime(); - operation.attempt(function(currentAttempt) { - attempts++; - assert.equal(currentAttempt, attempts); - - if (attempts !== 2) { - if (operation.retry(error)) { - return; - } - } else { - var curTime = new Date().getTime(); - longAsyncFunction(maxRetryTime - (curTime - startTime - 1), function(){ - if (operation.retry(error)) { - assert.fail('timeout should be occurred'); - return; - } - - assert.strictEqual(operation.mainError(), error); - finalCallback(); - }); - } - }); - }; - - fn(); -})(); diff --git a/deps/npm/node_modules/retry/test/integration/test-retry-wrap.js b/deps/npm/node_modules/retry/test/integration/test-retry-wrap.js index 3d2b6bfa6436d2..7ca8bc7eb596b5 100644 --- a/deps/npm/node_modules/retry/test/integration/test-retry-wrap.js +++ b/deps/npm/node_modules/retry/test/integration/test-retry-wrap.js @@ -14,17 +14,17 @@ function getLib() { (function wrapAll() { var lib = getLib(); retry.wrap(lib); - assert.equal(lib.fn1.name, 'bound retryWrapper'); - assert.equal(lib.fn2.name, 'bound retryWrapper'); - assert.equal(lib.fn3.name, 'bound retryWrapper'); + assert.equal(lib.fn1.name, 'retryWrapper'); + assert.equal(lib.fn2.name, 'retryWrapper'); + assert.equal(lib.fn3.name, 'retryWrapper'); }()); (function wrapAllPassOptions() { var lib = getLib(); retry.wrap(lib, {retries: 2}); - assert.equal(lib.fn1.name, 'bound retryWrapper'); - assert.equal(lib.fn2.name, 'bound retryWrapper'); - assert.equal(lib.fn3.name, 'bound retryWrapper'); + assert.equal(lib.fn1.name, 'retryWrapper'); + assert.equal(lib.fn2.name, 'retryWrapper'); + assert.equal(lib.fn3.name, 'retryWrapper'); assert.equal(lib.fn1.options.retries, 2); assert.equal(lib.fn2.options.retries, 2); assert.equal(lib.fn3.options.retries, 2); @@ -33,17 +33,17 @@ function getLib() { (function wrapDefined() { var lib = getLib(); retry.wrap(lib, ['fn2', 'fn3']); - assert.notEqual(lib.fn1.name, 'bound retryWrapper'); - assert.equal(lib.fn2.name, 'bound retryWrapper'); - assert.equal(lib.fn3.name, 'bound retryWrapper'); + assert.notEqual(lib.fn1.name, 'retryWrapper'); + assert.equal(lib.fn2.name, 'retryWrapper'); + assert.equal(lib.fn3.name, 'retryWrapper'); }()); (function wrapDefinedAndPassOptions() { var lib = getLib(); retry.wrap(lib, {retries: 2}, ['fn2', 'fn3']); - assert.notEqual(lib.fn1.name, 'bound retryWrapper'); - assert.equal(lib.fn2.name, 'bound retryWrapper'); - assert.equal(lib.fn3.name, 'bound retryWrapper'); + assert.notEqual(lib.fn1.name, 'retryWrapper'); + assert.equal(lib.fn2.name, 'retryWrapper'); + assert.equal(lib.fn3.name, 'retryWrapper'); assert.equal(lib.fn2.options.retries, 2); assert.equal(lib.fn3.options.retries, 2); }()); @@ -63,30 +63,6 @@ function getLib() { assert.ok(callbackCalled); }()); -(function runWrappedSeveralWithoutError() { - var callbacksCalled = 0; - var lib = { - fn1: function (a, callback) { - assert.equal(a, 1); - assert.equal(typeof callback, 'function'); - callback(); - }, - fn2: function (a, callback) { - assert.equal(a, 2); - assert.equal(typeof callback, 'function'); - callback(); - } - }; - retry.wrap(lib, {}, ['fn1', 'fn2']); - lib.fn1(1, function() { - callbacksCalled++; - }); - lib.fn2(2, function() { - callbacksCalled++; - }); - assert.equal(callbacksCalled, 2); -}()); - (function runWrappedWithError() { var callbackCalled; var lib = {method: function(callback) { diff --git a/deps/npm/node_modules/promise-retry/node_modules/retry/test/runner.js b/deps/npm/node_modules/retry/test/runner.js similarity index 100% rename from deps/npm/node_modules/promise-retry/node_modules/retry/test/runner.js rename to deps/npm/node_modules/retry/test/runner.js diff --git a/deps/npm/node_modules/rimraf/CHANGELOG.md b/deps/npm/node_modules/rimraf/CHANGELOG.md new file mode 100644 index 00000000000000..f116f1414d76dd --- /dev/null +++ b/deps/npm/node_modules/rimraf/CHANGELOG.md @@ -0,0 +1,65 @@ +# v3.0 + +- Add `--preserve-root` option to executable (default true) +- Drop support for Node.js below version 6 + +# v2.7 + +- Make `glob` an optional dependency + +# 2.6 + +- Retry on EBUSY on non-windows platforms as well +- Make `rimraf.sync` 10000% more reliable on Windows + +# 2.5 + +- Handle Windows EPERM when lstat-ing read-only dirs +- Add glob option to pass options to glob + +# 2.4 + +- Add EPERM to delay/retry loop +- Add `disableGlob` option + +# 2.3 + +- Make maxBusyTries and emfileWait configurable +- Handle weird SunOS unlink-dir issue +- Glob the CLI arg for better Windows support + +# 2.2 + +- Handle ENOENT properly on Windows +- Allow overriding fs methods +- Treat EPERM as indicative of non-empty dir +- Remove optional graceful-fs dep +- Consistently return null error instead of undefined on success +- win32: Treat ENOTEMPTY the same as EBUSY +- Add `rimraf` binary + +# 2.1 + +- Fix SunOS error code for a non-empty directory +- Try rmdir before readdir +- Treat EISDIR like EPERM +- Remove chmod +- Remove lstat polyfill, node 0.7 is not supported + +# 2.0 + +- Fix myGid call to check process.getgid +- Simplify the EBUSY backoff logic. +- Use fs.lstat in node >= 0.7.9 +- Remove gently option +- remove fiber implementation +- Delete files that are marked read-only + +# 1.0 + +- Allow ENOENT in sync method +- Throw when no callback is provided +- Make opts.gently an absolute path +- use 'stat' if 'lstat' is not available +- Consistent error naming, and rethrow non-ENOENT stat errors +- add fiber implementation diff --git a/deps/npm/node_modules/rimraf/bin.js b/deps/npm/node_modules/rimraf/bin.js index 0d1e17be701ec3..023814cc93e849 100755 --- a/deps/npm/node_modules/rimraf/bin.js +++ b/deps/npm/node_modules/rimraf/bin.js @@ -1,11 +1,24 @@ #!/usr/bin/env node -var rimraf = require('./') +const rimraf = require('./') -var help = false -var dashdash = false -var noglob = false -var args = process.argv.slice(2).filter(function(arg) { +const path = require('path') + +const isRoot = arg => /^(\/|[a-zA-Z]:\\)$/.test(path.resolve(arg)) +const filterOutRoot = arg => { + const ok = preserveRoot === false || !isRoot(arg) + if (!ok) { + console.error(`refusing to remove ${arg}`) + console.error('Set --no-preserve-root to allow this') + } + return ok +} + +let help = false +let dashdash = false +let noglob = false +let preserveRoot = true +const args = process.argv.slice(2).filter(arg => { if (dashdash) return !!arg else if (arg === '--') @@ -16,35 +29,40 @@ var args = process.argv.slice(2).filter(function(arg) { noglob = false else if (arg.match(/^(-+|\/)(h(elp)?|\?)$/)) help = true + else if (arg === '--preserve-root') + preserveRoot = true + else if (arg === '--no-preserve-root') + preserveRoot = false else return !!arg -}) +}).filter(arg => !preserveRoot || filterOutRoot(arg)) + +const go = n => { + if (n >= args.length) + return + const options = noglob ? { glob: false } : {} + rimraf(args[n], options, er => { + if (er) + throw er + go(n+1) + }) +} if (help || args.length === 0) { // If they didn't ask for help, then this is not a "success" - var log = help ? console.log : console.error + const log = help ? console.log : console.error log('Usage: rimraf [ ...]') log('') log(' Deletes all files and folders at "path" recursively.') log('') log('Options:') log('') - log(' -h, --help Display this usage info') - log(' -G, --no-glob Do not expand glob patterns in arguments') - log(' -g, --glob Expand glob patterns in arguments (default)') + log(' -h, --help Display this usage info') + log(' -G, --no-glob Do not expand glob patterns in arguments') + log(' -g, --glob Expand glob patterns in arguments (default)') + log(' --preserve-root Do not remove \'/\' (default)') + log(' --no-preserve-root Do not treat \'/\' specially') + log(' -- Stop parsing flags') process.exit(help ? 0 : 1) } else go(0) - -function go (n) { - if (n >= args.length) - return - var options = {} - if (noglob) - options = { glob: false } - rimraf(args[n], options, function (er) { - if (er) - throw er - go(n+1) - }) -} diff --git a/deps/npm/node_modules/rimraf/package.json b/deps/npm/node_modules/rimraf/package.json index 48f172fb29f5c0..1bf8d5e38775d7 100644 --- a/deps/npm/node_modules/rimraf/package.json +++ b/deps/npm/node_modules/rimraf/package.json @@ -1,80 +1,32 @@ { - "_from": "rimraf@2.7.1", - "_id": "rimraf@2.7.1", - "_inBundle": false, - "_integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==", - "_location": "/rimraf", - "_phantomChildren": {}, - "_requested": { - "type": "version", - "registry": true, - "raw": "rimraf@2.7.1", - "name": "rimraf", - "escapedName": "rimraf", - "rawSpec": "2.7.1", - "saveSpec": null, - "fetchSpec": "2.7.1" - }, - "_requiredBy": [ - "#USER", - "/", - "/cacache", - "/copy-concurrently", - "/fs-vacuum", - "/istanbul-lib-source-maps", - "/libcipm", - "/libnpx", - "/move-concurrently", - "/node-gyp", - "/nyc", - "/pacote", - "/spawn-wrap", - "/tap" - ], - "_resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", - "_shasum": "35797f13a7fdadc566142c29d4f07ccad483e3ec", - "_spec": "rimraf@2.7.1", - "_where": "/Users/darcyclarke/Documents/Repos/npm/npm/cli", - "author": { - "name": "Isaac Z. Schlueter", - "email": "i@izs.me", - "url": "http://blog.izs.me/" - }, - "bin": { - "rimraf": "bin.js" - }, - "bugs": { - "url": "https://github.com/isaacs/rimraf/issues" + "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" }, - "bundleDependencies": false, + "bin": "./bin.js", "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" ], - "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 --all; git push origin --tags", - "postversion": "npm publish", - "preversion": "npm test", - "test": "tap test/*.js" + "devDependencies": { + "mkdirp": "^0.5.1", + "tap": "^12.1.1" }, - "version": "2.7.1" + "funding": { + "url": "https://github.com/sponsors/isaacs" + } } diff --git a/deps/npm/node_modules/rimraf/rimraf.js b/deps/npm/node_modules/rimraf/rimraf.js index a90ad029f3ece1..34da4171d75598 100644 --- a/deps/npm/node_modules/rimraf/rimraf.js +++ b/deps/npm/node_modules/rimraf/rimraf.js @@ -1,29 +1,25 @@ -module.exports = rimraf -rimraf.sync = rimrafSync - -var assert = require("assert") -var path = require("path") -var fs = require("fs") -var glob = undefined +const assert = require("assert") +const path = require("path") +const fs = require("fs") +let glob = undefined try { glob = require("glob") } catch (_err) { // treat glob as optional. } -var _0666 = parseInt('666', 8) -var defaultGlobOpts = { +const defaultGlobOpts = { nosort: true, silent: true } // for EMFILE handling -var timeout = 0 +let timeout = 0 -var isWindows = (process.platform === "win32") +const isWindows = (process.platform === "win32") -function defaults (options) { - var methods = [ +const defaults = options => { + const methods = [ 'unlink', 'chmod', 'stat', @@ -31,7 +27,7 @@ function defaults (options) { 'rmdir', 'readdir' ] - methods.forEach(function(m) { + methods.forEach(m => { options[m] = options[m] || fs[m] m = m + 'Sync' options[m] = options[m] || fs[m] @@ -49,7 +45,7 @@ function defaults (options) { options.glob = options.glob || defaultGlobOpts } -function rimraf (p, options, cb) { +const rimraf = (p, options, cb) => { if (typeof options === 'function') { cb = options options = {} @@ -63,27 +59,17 @@ function rimraf (p, options, cb) { defaults(options) - var busyTries = 0 - var errState = null - var n = 0 - - if (options.disableGlob || !glob.hasMagic(p)) - return afterGlob(null, [p]) - - options.lstat(p, function (er, stat) { - if (!er) - return afterGlob(null, [p]) + let busyTries = 0 + let errState = null + let n = 0 - glob(p, options.glob, afterGlob) - }) - - function next (er) { + const next = (er) => { errState = errState || er if (--n === 0) cb(errState) } - function afterGlob (er, results) { + const afterGlob = (er, results) => { if (er) return cb(er) @@ -91,24 +77,19 @@ function rimraf (p, options, cb) { if (n === 0) return cb() - results.forEach(function (p) { - rimraf_(p, options, function CB (er) { + results.forEach(p => { + const CB = (er) => { if (er) { if ((er.code === "EBUSY" || er.code === "ENOTEMPTY" || er.code === "EPERM") && busyTries < options.maxBusyTries) { busyTries ++ - var time = busyTries * 100 // try again, with the same exact callback as this one. - return setTimeout(function () { - rimraf_(p, options, CB) - }, time) + return setTimeout(() => rimraf_(p, options, CB), busyTries * 100) } // this one won't happen if graceful-fs is used. if (er.code === "EMFILE" && timeout < options.emfileWait) { - return setTimeout(function () { - rimraf_(p, options, CB) - }, timeout ++) + return setTimeout(() => rimraf_(p, options, CB), timeout ++) } // already gone @@ -117,9 +98,21 @@ function rimraf (p, options, cb) { timeout = 0 next(er) - }) + } + rimraf_(p, options, CB) }) } + + if (options.disableGlob || !glob.hasMagic(p)) + return afterGlob(null, [p]) + + options.lstat(p, (er, stat) => { + if (!er) + return afterGlob(null, [p]) + + glob(p, options.glob, afterGlob) + }) + } // Two possible strategies. @@ -133,14 +126,14 @@ function rimraf (p, options, cb) { // // If anyone ever complains about this, then I guess the strategy could // be made configurable somehow. But until then, YAGNI. -function rimraf_ (p, options, cb) { +const rimraf_ = (p, options, cb) => { assert(p) assert(options) assert(typeof cb === 'function') // sunos lets the root user unlink directories, which is... weird. // so we have to lstat here and make sure it's not a dir. - options.lstat(p, function (er, st) { + options.lstat(p, (er, st) => { if (er && er.code === "ENOENT") return cb(null) @@ -151,7 +144,7 @@ function rimraf_ (p, options, cb) { if (st && st.isDirectory()) return rmdir(p, options, er, cb) - options.unlink(p, function (er) { + options.unlink(p, er => { if (er) { if (er.code === "ENOENT") return cb(null) @@ -167,18 +160,16 @@ function rimraf_ (p, options, cb) { }) } -function fixWinEPERM (p, options, er, cb) { +const fixWinEPERM = (p, options, er, cb) => { assert(p) assert(options) assert(typeof cb === 'function') - if (er) - assert(er instanceof Error) - options.chmod(p, _0666, function (er2) { + options.chmod(p, 0o666, er2 => { if (er2) cb(er2.code === "ENOENT" ? null : er) else - options.stat(p, function(er3, stats) { + options.stat(p, (er3, stats) => { if (er3) cb(er3.code === "ENOENT" ? null : er) else if (stats.isDirectory()) @@ -189,14 +180,12 @@ function fixWinEPERM (p, options, er, cb) { }) } -function fixWinEPERMSync (p, options, er) { +const fixWinEPERMSync = (p, options, er) => { assert(p) assert(options) - if (er) - assert(er instanceof Error) try { - options.chmodSync(p, _0666) + options.chmodSync(p, 0o666) } catch (er2) { if (er2.code === "ENOENT") return @@ -204,8 +193,9 @@ function fixWinEPERMSync (p, options, er) { throw er } + let stats try { - var stats = options.statSync(p) + stats = options.statSync(p) } catch (er3) { if (er3.code === "ENOENT") return @@ -219,17 +209,15 @@ function fixWinEPERMSync (p, options, er) { options.unlinkSync(p) } -function rmdir (p, options, originalEr, cb) { +const rmdir = (p, options, originalEr, cb) => { assert(p) assert(options) - if (originalEr) - assert(originalEr instanceof Error) assert(typeof cb === 'function') // try to rmdir first, and only readdir on ENOTEMPTY or EEXIST (SunOS) // if we guessed wrong, and it's not a directory, then // raise the original error. - options.rmdir(p, function (er) { + options.rmdir(p, er => { if (er && (er.code === "ENOTEMPTY" || er.code === "EEXIST" || er.code === "EPERM")) rmkids(p, options, cb) else if (er && er.code === "ENOTDIR") @@ -239,20 +227,20 @@ function rmdir (p, options, originalEr, cb) { }) } -function rmkids(p, options, cb) { +const rmkids = (p, options, cb) => { assert(p) assert(options) assert(typeof cb === 'function') - options.readdir(p, function (er, files) { + options.readdir(p, (er, files) => { if (er) return cb(er) - var n = files.length + let n = files.length if (n === 0) return options.rmdir(p, cb) - var errState - files.forEach(function (f) { - rimraf(path.join(p, f), options, function (er) { + let errState + files.forEach(f => { + rimraf(path.join(p, f), options, er => { if (errState) return if (er) @@ -267,7 +255,7 @@ function rmkids(p, options, cb) { // this looks simpler, and is strictly *faster*, but will // tie up the JavaScript thread and fail on excessively // deep directory trees. -function rimrafSync (p, options) { +const rimrafSync = (p, options) => { options = options || {} defaults(options) @@ -276,7 +264,7 @@ function rimrafSync (p, options) { assert(options, 'rimraf: missing options') assert.equal(typeof options, 'object', 'rimraf: options should be object') - var results + let results if (options.disableGlob || !glob.hasMagic(p)) { results = [p] @@ -292,11 +280,12 @@ function rimrafSync (p, options) { if (!results.length) return - for (var i = 0; i < results.length; i++) { - var p = results[i] + for (let i = 0; i < results.length; i++) { + const p = results[i] + let st try { - var st = options.lstatSync(p) + st = options.lstatSync(p) } catch (er) { if (er.code === "ENOENT") return @@ -325,11 +314,9 @@ function rimrafSync (p, options) { } } -function rmdirSync (p, options, originalEr) { +const rmdirSync = (p, options, originalEr) => { assert(p) assert(options) - if (originalEr) - assert(originalEr instanceof Error) try { options.rmdirSync(p) @@ -343,12 +330,10 @@ function rmdirSync (p, options, originalEr) { } } -function rmkidsSync (p, options) { +const rmkidsSync = (p, options) => { assert(p) assert(options) - options.readdirSync(p).forEach(function (f) { - rimrafSync(path.join(p, f), options) - }) + options.readdirSync(p).forEach(f => rimrafSync(path.join(p, f), options)) // We only end up here once we got ENOTEMPTY at least once, and // at this point, we are guaranteed to have removed all the kids. @@ -356,12 +341,12 @@ function rmkidsSync (p, options) { // try really hard to delete stuff on windows, because it has a // PROFOUNDLY annoying habit of not closing handles promptly when // files are deleted, resulting in spurious ENOTEMPTY errors. - var retries = isWindows ? 100 : 1 - var i = 0 + const retries = isWindows ? 100 : 1 + let i = 0 do { - var threw = true + let threw = true try { - var ret = options.rmdirSync(p, options) + const ret = options.rmdirSync(p, options) threw = false return ret } finally { @@ -370,3 +355,6 @@ function rmkidsSync (p, options) { } } while (true) } + +module.exports = rimraf +rimraf.sync = rimrafSync diff --git a/deps/npm/node_modules/run-queue/README.md b/deps/npm/node_modules/run-queue/README.md deleted file mode 100644 index e84214d1f0a0d1..00000000000000 --- a/deps/npm/node_modules/run-queue/README.md +++ /dev/null @@ -1,86 +0,0 @@ -# run-queue - -A promise based, dynamic priority queue runner, with concurrency limiting. - -```js -const RunQueue = require('run-queue') - -const queue = new RunQueue({ - maxConcurrency: 1 -}) - -queue.add(1, example, [-1]) -for (let ii = 0; ii < 5; ++ii) { - queue.add(0, example, [ii]) -} -const finished = [] -queue.run().then( - console.log(finished) -}) - -function example (num, next) { - setTimeout(() => { - finished.push(num) - next() - }, 5 - Math.abs(num)) -} -``` - -would output - -``` -[ 0, 1, 2, 3, 4, -1 ] -``` - -If you bump concurrency to `2`, then you get: - -``` -[ 1, 0, 3, 2, 4, -1 ] -``` - -The concurrency means that they don't finish in order, because some take -longer than others. Each priority level must finish entirely before the -next priority level is run. See -[PRIORITIES](https://github.com/iarna/run-queue#priorities) below. This is -even true if concurrency is set high enough that all of the regular queue -can execute at once, for instance, with `maxConcurrency: 10`: - -``` -[ 4, 3, 2, 1, 0, -1 ] -``` - -## API - -### const queue = new RunQueue(options) - -Create a new queue. Options may contain: - -* maxConcurrency - (Default: `1`) The maximum number of jobs to execute at once. -* Promise - (Default: global.Promise) The promise implementation to use. - -### queue.add (prio, fn, args) - -Add a new job to the end of the queue at priority `prio` that will run `fn` -with `args`. If `fn` is async then it should return a Promise. - -### queue.run () - -Start running the job queue. Returns a Promise that resolves when either -all the jobs are complete or a job ends in error (throws or returns a -rejected promise). If a job ended in error then this Promise will be rejected -with that error and no further queue running will be done. - -## PRIORITIES - -Priorities are any integer value >= 0. - -Lowest is executed first. - -Priorities essentially represent distinct job queues. All jobs in a queue -must complete before the next highest priority job queue is executed. - -This means that if you have two queues, `0` and `1` then ALL jobs in `0` -must complete before ANY execute in `1`. If you add new `0` level jobs -while `1` level jobs are running then it will switch back processing the `0` -queue and won't execute any more `1` jobs till all of the new `0` jobs -complete. diff --git a/deps/npm/node_modules/run-queue/node_modules/aproba/LICENSE b/deps/npm/node_modules/run-queue/node_modules/aproba/LICENSE deleted file mode 100644 index f4be44d881b2d9..00000000000000 --- a/deps/npm/node_modules/run-queue/node_modules/aproba/LICENSE +++ /dev/null @@ -1,14 +0,0 @@ -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/run-queue/node_modules/aproba/README.md b/deps/npm/node_modules/run-queue/node_modules/aproba/README.md deleted file mode 100644 index 0bfc594c56a372..00000000000000 --- a/deps/npm/node_modules/run-queue/node_modules/aproba/README.md +++ /dev/null @@ -1,94 +0,0 @@ -aproba -====== - -A ridiculously light-weight function argument validator - -``` -var validate = require("aproba") - -function myfunc(a, b, c) { - // `a` must be a string, `b` a number, `c` a function - validate('SNF', arguments) // [a,b,c] is also valid -} - -myfunc('test', 23, function () {}) // ok -myfunc(123, 23, function () {}) // type error -myfunc('test', 23) // missing arg error -myfunc('test', 23, function () {}, true) // too many args error - -``` - -Valid types are: - -| type | description -| :--: | :---------- -| * | matches any type -| A | `Array.isArray` OR an `arguments` object -| S | typeof == string -| N | typeof == number -| F | typeof == function -| O | typeof == object and not type A and not type E -| B | typeof == boolean -| E | `instanceof Error` OR `null` **(special: see below)** -| Z | == `null` - -Validation failures throw one of three exception types, distinguished by a -`code` property of `EMISSINGARG`, `EINVALIDTYPE` or `ETOOMANYARGS`. - -If you pass in an invalid type then it will throw with a code of -`EUNKNOWNTYPE`. - -If an **error** argument is found and is not null then the remaining -arguments are optional. That is, if you say `ESO` then that's like using a -non-magical `E` in: `E|ESO|ZSO`. - -### But I have optional arguments?! - -You can provide more than one signature by separating them with pipes `|`. -If any signature matches the arguments then they'll be considered valid. - -So for example, say you wanted to write a signature for -`fs.createWriteStream`. The docs for it describe it thusly: - -``` -fs.createWriteStream(path[, options]) -``` - -This would be a signature of `SO|S`. That is, a string and and object, or -just a string. - -Now, if you read the full `fs` docs, you'll see that actually path can ALSO -be a buffer. And options can be a string, that is: -``` -path | -options | -``` - -To reproduce this you have to fully enumerate all of the possible -combinations and that implies a signature of `SO|SS|OO|OS|S|O`. The -awkwardness is a feature: It reminds you of the complexity you're adding to -your API when you do this sort of thing. - - -### Browser support - -This has no dependencies and should work in browsers, though you'll have -noisier stack traces. - -### Why this exists - -I wanted a very simple argument validator. It needed to do two things: - -1. Be more concise and easier to use than assertions - -2. Not encourage an infinite bikeshed of DSLs - -This is why types are specified by a single character and there's no such -thing as an optional argument. - -This is not intended to validate user data. This is specifically about -asserting the interface of your functions. - -If you need greater validation, I encourage you to write them by hand or -look elsewhere. - diff --git a/deps/npm/node_modules/run-queue/node_modules/aproba/index.js b/deps/npm/node_modules/run-queue/node_modules/aproba/index.js deleted file mode 100644 index 6f3f797c09a750..00000000000000 --- a/deps/npm/node_modules/run-queue/node_modules/aproba/index.js +++ /dev/null @@ -1,105 +0,0 @@ -'use strict' - -function isArguments (thingy) { - return thingy != null && typeof thingy === 'object' && thingy.hasOwnProperty('callee') -} - -var types = { - '*': {label: 'any', check: function () { return true }}, - A: {label: 'array', check: function (thingy) { return Array.isArray(thingy) || isArguments(thingy) }}, - S: {label: 'string', check: function (thingy) { return typeof thingy === 'string' }}, - N: {label: 'number', check: function (thingy) { return typeof thingy === 'number' }}, - F: {label: 'function', check: function (thingy) { return typeof thingy === 'function' }}, - O: {label: 'object', check: function (thingy) { return typeof thingy === 'object' && thingy != null && !types.A.check(thingy) && !types.E.check(thingy) }}, - B: {label: 'boolean', check: function (thingy) { return typeof thingy === 'boolean' }}, - E: {label: 'error', check: function (thingy) { return thingy instanceof Error }}, - Z: {label: 'null', check: function (thingy) { return thingy == null }} -} - -function addSchema (schema, arity) { - var group = arity[schema.length] = arity[schema.length] || [] - if (group.indexOf(schema) === -1) group.push(schema) -} - -var validate = module.exports = function (rawSchemas, args) { - if (arguments.length !== 2) throw wrongNumberOfArgs(['SA'], arguments.length) - if (!rawSchemas) throw missingRequiredArg(0, 'rawSchemas') - if (!args) throw missingRequiredArg(1, 'args') - if (!types.S.check(rawSchemas)) throw invalidType(0, ['string'], rawSchemas) - if (!types.A.check(args)) throw invalidType(1, ['array'], args) - var schemas = rawSchemas.split('|') - var arity = {} - - schemas.forEach(function (schema) { - for (var ii = 0; ii < schema.length; ++ii) { - var type = schema[ii] - if (!types[type]) throw unknownType(ii, type) - } - if (/E.*E/.test(schema)) throw moreThanOneError(schema) - addSchema(schema, arity) - if (/E/.test(schema)) { - addSchema(schema.replace(/E.*$/, 'E'), arity) - addSchema(schema.replace(/E/, 'Z'), arity) - if (schema.length === 1) addSchema('', arity) - } - }) - var matching = arity[args.length] - if (!matching) { - throw wrongNumberOfArgs(Object.keys(arity), args.length) - } - for (var ii = 0; ii < args.length; ++ii) { - var newMatching = matching.filter(function (schema) { - var type = schema[ii] - var typeCheck = types[type].check - return typeCheck(args[ii]) - }) - if (!newMatching.length) { - var labels = matching.map(function (schema) { - return types[schema[ii]].label - }).filter(function (schema) { return schema != null }) - throw invalidType(ii, labels, args[ii]) - } - matching = newMatching - } -} - -function missingRequiredArg (num) { - return newException('EMISSINGARG', 'Missing required argument #' + (num + 1)) -} - -function unknownType (num, type) { - return newException('EUNKNOWNTYPE', 'Unknown type ' + type + ' in argument #' + (num + 1)) -} - -function invalidType (num, expectedTypes, value) { - var valueType - Object.keys(types).forEach(function (typeCode) { - if (types[typeCode].check(value)) valueType = types[typeCode].label - }) - return newException('EINVALIDTYPE', 'Argument #' + (num + 1) + ': Expected ' + - englishList(expectedTypes) + ' but got ' + valueType) -} - -function englishList (list) { - return list.join(', ').replace(/, ([^,]+)$/, ' or $1') -} - -function wrongNumberOfArgs (expected, got) { - var english = englishList(expected) - var args = expected.every(function (ex) { return ex.length === 1 }) - ? 'argument' - : 'arguments' - return newException('EWRONGARGCOUNT', 'Expected ' + english + ' ' + args + ' but got ' + got) -} - -function moreThanOneError (schema) { - return newException('ETOOMANYERRORTYPES', - 'Only one error type per argument signature is allowed, more than one found in "' + schema + '"') -} - -function newException (code, msg) { - var e = new Error(msg) - e.code = code - if (Error.captureStackTrace) Error.captureStackTrace(e, validate) - return e -} diff --git a/deps/npm/node_modules/run-queue/node_modules/aproba/package.json b/deps/npm/node_modules/run-queue/node_modules/aproba/package.json deleted file mode 100644 index 04fb91f559b0d4..00000000000000 --- a/deps/npm/node_modules/run-queue/node_modules/aproba/package.json +++ /dev/null @@ -1,62 +0,0 @@ -{ - "_from": "aproba@^1.1.1", - "_id": "aproba@1.2.0", - "_inBundle": false, - "_integrity": "sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw==", - "_location": "/run-queue/aproba", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "aproba@^1.1.1", - "name": "aproba", - "escapedName": "aproba", - "rawSpec": "^1.1.1", - "saveSpec": null, - "fetchSpec": "^1.1.1" - }, - "_requiredBy": [ - "/run-queue" - ], - "_resolved": "https://registry.npmjs.org/aproba/-/aproba-1.2.0.tgz", - "_shasum": "6802e6264efd18c790a1b0d517f0f2627bf2c94a", - "_spec": "aproba@^1.1.1", - "_where": "/Users/aeschright/code/cli/node_modules/run-queue", - "author": { - "name": "Rebecca Turner", - "email": "me@re-becca.org" - }, - "bugs": { - "url": "https://github.com/iarna/aproba/issues" - }, - "bundleDependencies": false, - "dependencies": {}, - "deprecated": false, - "description": "A ridiculously light-weight argument validator (now browser friendly)", - "devDependencies": { - "standard": "^10.0.3", - "tap": "^10.0.2" - }, - "directories": { - "test": "test" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/iarna/aproba", - "keywords": [ - "argument", - "validate" - ], - "license": "ISC", - "main": "index.js", - "name": "aproba", - "repository": { - "type": "git", - "url": "git+https://github.com/iarna/aproba.git" - }, - "scripts": { - "test": "standard && tap -j3 test/*.js" - }, - "version": "1.2.0" -} diff --git a/deps/npm/node_modules/run-queue/package.json b/deps/npm/node_modules/run-queue/package.json deleted file mode 100644 index f786a7d4374ea2..00000000000000 --- a/deps/npm/node_modules/run-queue/package.json +++ /dev/null @@ -1,63 +0,0 @@ -{ - "_from": "run-queue@^1.0.3", - "_id": "run-queue@1.0.3", - "_inBundle": false, - "_integrity": "sha1-6Eg5bwV9Ij8kOGkkYY4laUFh7Ec=", - "_location": "/run-queue", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "run-queue@^1.0.3", - "name": "run-queue", - "escapedName": "run-queue", - "rawSpec": "^1.0.3", - "saveSpec": null, - "fetchSpec": "^1.0.3" - }, - "_requiredBy": [ - "/copy-concurrently", - "/move-concurrently" - ], - "_resolved": "https://registry.npmjs.org/run-queue/-/run-queue-1.0.3.tgz", - "_shasum": "e848396f057d223f24386924618e25694161ec47", - "_spec": "run-queue@^1.0.3", - "_where": "/Users/rebecca/code/npm/node_modules/move-concurrently", - "author": { - "name": "Rebecca Turner", - "email": "me@re-becca.org", - "url": "http://re-becca.org/" - }, - "bugs": { - "url": "https://github.com/iarna/run-queue/issues" - }, - "bundleDependencies": false, - "dependencies": { - "aproba": "^1.1.1" - }, - "deprecated": false, - "description": "A promise based, dynamic priority queue runner, with concurrency limiting.", - "devDependencies": { - "standard": "^8.6.0", - "tap": "^10.2.0" - }, - "directories": { - "test": "test" - }, - "files": [ - "queue.js" - ], - "homepage": "https://npmjs.com/package/run-queue", - "keywords": [], - "license": "ISC", - "main": "queue.js", - "name": "run-queue", - "repository": { - "type": "git", - "url": "git+https://github.com/iarna/run-queue.git" - }, - "scripts": { - "test": "standard && tap -J test" - }, - "version": "1.0.3" -} diff --git a/deps/npm/node_modules/run-queue/queue.js b/deps/npm/node_modules/run-queue/queue.js deleted file mode 100644 index 500bf293d306f8..00000000000000 --- a/deps/npm/node_modules/run-queue/queue.js +++ /dev/null @@ -1,95 +0,0 @@ -'use strict' -module.exports = RunQueue - -var validate = require('aproba') - -function RunQueue (opts) { - validate('Z|O', [opts]) - if (!opts) opts = {} - this.finished = false - this.inflight = 0 - this.maxConcurrency = opts.maxConcurrency || 1 - this.queued = 0 - this.queue = [] - this.currentPrio = null - this.currentQueue = null - this.Promise = opts.Promise || global.Promise - this.deferred = {} -} - -RunQueue.prototype = {} - -RunQueue.prototype.run = function () { - if (arguments.length !== 0) throw new Error('RunQueue.run takes no arguments') - var self = this - var deferred = this.deferred - if (!deferred.promise) { - deferred.promise = new this.Promise(function (resolve, reject) { - deferred.resolve = resolve - deferred.reject = reject - self._runQueue() - }) - } - return deferred.promise -} - -RunQueue.prototype._runQueue = function () { - var self = this - - while ((this.inflight < this.maxConcurrency) && this.queued) { - if (!this.currentQueue || this.currentQueue.length === 0) { - // wait till the current priority is entirely processed before - // starting a new one - if (this.inflight) return - var prios = Object.keys(this.queue) - for (var ii = 0; ii < prios.length; ++ii) { - var prioQueue = this.queue[prios[ii]] - if (prioQueue.length) { - this.currentQueue = prioQueue - this.currentPrio = prios[ii] - break - } - } - } - - --this.queued - ++this.inflight - var next = this.currentQueue.shift() - var args = next.args || [] - - // we explicitly construct a promise here so that queue items can throw - // or immediately return to resolve - var queueEntry = new this.Promise(function (resolve) { - resolve(next.cmd.apply(null, args)) - }) - - queueEntry.then(function () { - --self.inflight - if (self.finished) return - if (self.queued <= 0 && self.inflight <= 0) { - self.finished = true - self.deferred.resolve() - } - self._runQueue() - }, function (err) { - self.finished = true - self.deferred.reject(err) - }) - } -} - -RunQueue.prototype.add = function (prio, cmd, args) { - if (this.finished) throw new Error("Can't add to a finished queue. Create a new queue.") - if (Math.abs(Math.floor(prio)) !== prio) throw new Error('Priorities must be a positive integer value.') - validate('NFA|NFZ', [prio, cmd, args]) - prio = Number(prio) - if (!this.queue[prio]) this.queue[prio] = [] - ++this.queued - this.queue[prio].push({cmd: cmd, args: args}) - // if this priority is higher than the one we're currently processing, - // switch back to processing its queue. - if (this.currentPrio > prio) { - this.currentQueue = this.queue[prio] - this.currentPrio = prio - } -} diff --git a/deps/npm/node_modules/safe-buffer/package.json b/deps/npm/node_modules/safe-buffer/package.json index 7a8235c14faacd..623fbc3f6b0c48 100644 --- a/deps/npm/node_modules/safe-buffer/package.json +++ b/deps/npm/node_modules/safe-buffer/package.json @@ -1,48 +1,7 @@ { - "_args": [ - [ - "safe-buffer@5.1.2", - "/Users/rebecca/code/npm" - ] - ], - "_from": "safe-buffer@5.1.2", - "_id": "safe-buffer@5.1.2", - "_inBundle": false, - "_integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", - "_location": "/safe-buffer", - "_phantomChildren": {}, - "_requested": { - "type": "version", - "registry": true, - "raw": "safe-buffer@5.1.2", - "name": "safe-buffer", - "escapedName": "safe-buffer", - "rawSpec": "5.1.2", - "saveSpec": null, - "fetchSpec": "5.1.2" - }, - "_requiredBy": [ - "/", - "/got", - "/libnpx", - "/minipass", - "/node-fetch-npm", - "/npm-profile/ssri", - "/npm-registry-client", - "/npm-registry-client/ssri", - "/npm-registry-fetch", - "/npm-registry-fetch/ssri", - "/pacote", - "/readable-stream", - "/registry-auth-token", - "/request", - "/string_decoder", - "/tar", - "/tunnel-agent" - ], - "_resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "_spec": "5.1.2", - "_where": "/Users/rebecca/code/npm", + "name": "safe-buffer", + "description": "Safer Node.js Buffer API", + "version": "5.1.2", "author": { "name": "Feross Aboukhadijeh", "email": "feross@feross.org", @@ -51,7 +10,6 @@ "bugs": { "url": "https://github.com/feross/safe-buffer/issues" }, - "description": "Safer Node.js Buffer API", "devDependencies": { "standard": "*", "tape": "^4.0.0" @@ -68,14 +26,12 @@ ], "license": "MIT", "main": "index.js", - "name": "safe-buffer", + "types": "index.d.ts", "repository": { "type": "git", "url": "git://github.com/feross/safe-buffer.git" }, "scripts": { "test": "standard && tape test/*.js" - }, - "types": "index.d.ts", - "version": "5.1.2" + } } diff --git a/deps/npm/node_modules/safer-buffer/package.json b/deps/npm/node_modules/safer-buffer/package.json index a017e4b7f05b28..d452b04aef3bb4 100644 --- a/deps/npm/node_modules/safer-buffer/package.json +++ b/deps/npm/node_modules/safer-buffer/package.json @@ -1,38 +1,25 @@ { - "_from": "safer-buffer@>= 2.1.2 < 3", - "_id": "safer-buffer@2.1.2", - "_inBundle": false, - "_integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", - "_location": "/safer-buffer", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "safer-buffer@>= 2.1.2 < 3", - "name": "safer-buffer", - "escapedName": "safer-buffer", - "rawSpec": ">= 2.1.2 < 3", - "saveSpec": null, - "fetchSpec": ">= 2.1.2 < 3" + "name": "safer-buffer", + "version": "2.1.2", + "description": "Modern Buffer API polyfill without footguns", + "main": "safer.js", + "scripts": { + "browserify-test": "browserify --external tape tests.js > browserify-tests.js && tape browserify-tests.js", + "test": "standard && tape tests.js" }, - "_requiredBy": [ - "/iconv-lite" - ], - "_resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", - "_shasum": "44fa161b0187b9549dd84bb91802f9bd8385cd6a", - "_spec": "safer-buffer@>= 2.1.2 < 3", - "_where": "/Users/rebecca/code/npm/node_modules/iconv-lite", "author": { "name": "Nikita Skovoroda", "email": "chalkerx@gmail.com", "url": "https://github.com/ChALkeR" }, + "license": "MIT", + "repository": { + "type": "git", + "url": "git+https://github.com/ChALkeR/safer-buffer.git" + }, "bugs": { "url": "https://github.com/ChALkeR/safer-buffer/issues" }, - "bundleDependencies": false, - "deprecated": false, - "description": "Modern Buffer API polyfill without footguns", "devDependencies": { "standard": "^11.0.1", "tape": "^4.9.0" @@ -43,18 +30,5 @@ "tests.js", "dangerous.js", "safer.js" - ], - "homepage": "https://github.com/ChALkeR/safer-buffer#readme", - "license": "MIT", - "main": "safer.js", - "name": "safer-buffer", - "repository": { - "type": "git", - "url": "git+https://github.com/ChALkeR/safer-buffer.git" - }, - "scripts": { - "browserify-test": "browserify --external tape tests.js > browserify-tests.js && tape browserify-tests.js", - "test": "standard && tape tests.js" - }, - "version": "2.1.2" + ] } diff --git a/deps/npm/node_modules/semver-diff/index.js b/deps/npm/node_modules/semver-diff/index.js deleted file mode 100644 index 92c9c9700aac7d..00000000000000 --- a/deps/npm/node_modules/semver-diff/index.js +++ /dev/null @@ -1,27 +0,0 @@ -'use strict'; -var semver = require('semver'); - -module.exports = function (a, b) { - if (semver.gt(a, b)) { - return null; - } - - a = semver.parse(a); - b = semver.parse(b); - - for (var key in a) { - if (key === 'major' || key === 'minor' || key === 'patch') { - if (a[key] !== b[key]) { - return key; - } - } - - if (key === 'prerelease' || key === 'build') { - if (JSON.stringify(a[key]) !== JSON.stringify(b[key])) { - return key; - } - } - } - - return null; -}; diff --git a/deps/npm/node_modules/semver-diff/license b/deps/npm/node_modules/semver-diff/license deleted file mode 100644 index 654d0bfe943437..00000000000000 --- a/deps/npm/node_modules/semver-diff/license +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -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/deps/npm/node_modules/semver-diff/package.json b/deps/npm/node_modules/semver-diff/package.json deleted file mode 100644 index 05ad451e3cfe4f..00000000000000 --- a/deps/npm/node_modules/semver-diff/package.json +++ /dev/null @@ -1,66 +0,0 @@ -{ - "_from": "semver-diff@^2.0.0", - "_id": "semver-diff@2.1.0", - "_inBundle": false, - "_integrity": "sha1-S7uEN8jTfksM8aaP1ybsbWRdbTY=", - "_location": "/semver-diff", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "semver-diff@^2.0.0", - "name": "semver-diff", - "escapedName": "semver-diff", - "rawSpec": "^2.0.0", - "saveSpec": null, - "fetchSpec": "^2.0.0" - }, - "_requiredBy": [ - "/update-notifier" - ], - "_resolved": "https://registry.npmjs.org/semver-diff/-/semver-diff-2.1.0.tgz", - "_shasum": "4bbb8437c8d37e4b0cf1a68fd726ec6d645d6d36", - "_spec": "semver-diff@^2.0.0", - "_where": "/Users/rebecca/code/npm/node_modules/update-notifier", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "http://sindresorhus.com" - }, - "bugs": { - "url": "https://github.com/sindresorhus/semver-diff/issues" - }, - "bundleDependencies": false, - "dependencies": { - "semver": "^5.0.3" - }, - "deprecated": false, - "description": "Get the diff type of two semver versions: 0.0.1 0.0.2 → patch", - "devDependencies": { - "mocha": "*" - }, - "engines": { - "node": ">=0.10.0" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/sindresorhus/semver-diff#readme", - "keywords": [ - "semver", - "version", - "semantic", - "diff", - "difference" - ], - "license": "MIT", - "name": "semver-diff", - "repository": { - "type": "git", - "url": "git+https://github.com/sindresorhus/semver-diff.git" - }, - "scripts": { - "test": "mocha" - }, - "version": "2.1.0" -} diff --git a/deps/npm/node_modules/semver-diff/readme.md b/deps/npm/node_modules/semver-diff/readme.md deleted file mode 100644 index 06a172f16afa4f..00000000000000 --- a/deps/npm/node_modules/semver-diff/readme.md +++ /dev/null @@ -1,52 +0,0 @@ -# semver-diff [![Build Status](https://travis-ci.org/sindresorhus/semver-diff.svg?branch=master)](https://travis-ci.org/sindresorhus/semver-diff) - -> Get the diff type of two [semver](https://github.com/isaacs/node-semver) versions: `0.0.1 0.0.2` → `patch` - - -## Install - -```sh -$ npm install --save semver-diff -``` - - -## Usage - -```js -var semverDiff = require('semver-diff'); - -semverDiff('1.1.1', '1.1.2'); -//=> 'patch' - -semverDiff('0.0.1', '1.0.0'); -//=> 'major' - -semverDiff('0.0.1', '0.1.0'); -//=> 'minor' - -semverDiff('0.0.1-foo', '0.0.1-foo.bar'); -//=> 'prerelease' - -semverDiff('0.1.0', '0.1.0+foo'); -//=> 'build' - -semverDiff('0.0.1', '0.0.1'); -//=> null - -semverDiff('0.0.2', '0.0.1'); -//=> null -``` - - -## API - -### semverDiff(versionA, versionB) - -Returns the difference type between two semver versions, or `null` if they're identical or the second one is lower than the first. - -Possible values: `'major'`, `'minor'`, `'patch'`, `'prerelease'`, `'build'`, `null`. - - -## License - -MIT © [Sindre Sorhus](http://sindresorhus.com) diff --git a/deps/npm/node_modules/semver/CHANGELOG.md b/deps/npm/node_modules/semver/CHANGELOG.md index 66304fdd23678a..220af176f748ec 100644 --- a/deps/npm/node_modules/semver/CHANGELOG.md +++ b/deps/npm/node_modules/semver/CHANGELOG.md @@ -1,5 +1,77 @@ # changes log +## 7.3.0 + +* Add `subset(r1, r2)` method to determine if `r1` range is entirely + contained by `r2` range. + +## 7.2.3 + +* Fix handling of `includePrelease` mode where version ranges like `1.0.0 - + 2.0.0` would include `3.0.0-pre` and not `1.0.0-pre`. + +## 7.2.2 + +* Fix bug where `2.0.0-pre` would be included in `^1.0.0` if + `includePrerelease` was set to true. + +## 7.2.0 + +* Add `simplifyRange` method to attempt to generate a more human-readable + range expression that is equivalent to a supplied range, for a given set + of versions. + +## 7.1.2 + +* Remove fancy lazy-loading logic, as it was causing problems for webpack + users. + +## 7.1.0 + +* Add `require('semver/preload')` to load the entire module without using + lazy getter methods. + +## 7.0.0 + +* Refactor module into separate files for better tree-shaking +* Drop support for very old node versions, use const/let, `=>` functions, + and classes. + +## 6.3.0 + +* Expose the token enum on the exports + +## 6.2.0 + +* Coerce numbers to strings when passed to semver.coerce() +* Add `rtl` option to coerce from right to left + +## 6.1.3 + +* Handle X-ranges properly in includePrerelease mode + +## 6.1.2 + +* Do not throw when testing invalid version strings + +## 6.1.1 + +* Add options support for semver.coerce() +* Handle undefined version passed to Range.test + +## 6.1.0 + +* Add semver.compareBuild function +* Support `*` in semver.intersects + +## 6.0 + +* Fix `intersects` logic. + + This is technically a bug fix, but since it is also a change to behavior + that may require users updating their code, it is marked as a major + version increment. + ## 5.7 * Add `minVersion` method diff --git a/deps/npm/node_modules/semver/README.md b/deps/npm/node_modules/semver/README.md index f8dfa5a0df5fc4..9bef045af21acd 100644 --- a/deps/npm/node_modules/semver/README.md +++ b/deps/npm/node_modules/semver/README.md @@ -4,7 +4,7 @@ semver(1) -- The semantic versioner for npm ## Install ```bash -npm install --save semver +npm install semver ```` ## Usage @@ -25,6 +25,63 @@ semver.valid(semver.coerce('v2')) // '2.0.0' semver.valid(semver.coerce('42.6.7.9.3-alpha')) // '42.6.7' ``` +You can also just load the module for the function that you care about, if +you'd like to minimize your footprint. + +```js +// load the whole API at once in a single object +const semver = require('semver') + +// or just load the bits you need +// all of them listed here, just pick and choose what you want + +// classes +const SemVer = require('semver/classes/semver') +const Comparator = require('semver/classes/comparator') +const Range = require('semver/classes/range') + +// functions for working with versions +const semverParse = require('semver/functions/parse') +const semverValid = require('semver/functions/valid') +const semverClean = require('semver/functions/clean') +const semverInc = require('semver/functions/inc') +const semverDiff = require('semver/functions/diff') +const semverMajor = require('semver/functions/major') +const semverMinor = require('semver/functions/minor') +const semverPatch = require('semver/functions/patch') +const semverPrerelease = require('semver/functions/prerelease') +const semverCompare = require('semver/functions/compare') +const semverRcompare = require('semver/functions/rcompare') +const semverCompareLoose = require('semver/functions/compare-loose') +const semverCompareBuild = require('semver/functions/compare-build') +const semverSort = require('semver/functions/sort') +const semverRsort = require('semver/functions/rsort') + +// low-level comparators between versions +const semverGt = require('semver/functions/gt') +const semverLt = require('semver/functions/lt') +const semverEq = require('semver/functions/eq') +const semverNeq = require('semver/functions/neq') +const semverGte = require('semver/functions/gte') +const semverLte = require('semver/functions/lte') +const semverCmp = require('semver/functions/cmp') +const semverCoerce = require('semver/functions/coerce') + +// working with ranges +const semverSatisfies = require('semver/functions/satisfies') +const semverMaxSatisfying = require('semver/ranges/max-satisfying') +const semverMinSatisfying = require('semver/ranges/min-satisfying') +const semverToComparators = require('semver/ranges/to-comparators') +const semverMinVersion = require('semver/ranges/min-version') +const semverValidRange = require('semver/ranges/valid') +const semverOutside = require('semver/ranges/outside') +const semverGtr = require('semver/ranges/gtr') +const semverLtr = require('semver/ranges/ltr') +const semverIntersects = require('semver/ranges/intersects') +const simplifyRange = require('semver/ranges/simplify') +const rangeSubset = require('semver/ranges/subset') +``` + As a command-line utility: ``` @@ -60,6 +117,12 @@ Options: Coerce a string into SemVer if possible (does not imply --loose) +--rtl + Coerce version strings right to left + +--ltr + Coerce version strings left to right (default) + Program exits successfully if any valid version satisfies all supplied ranges, and prints all satisfying versions. @@ -193,8 +256,8 @@ inclusive range, then all versions that start with the supplied parts of the tuple are accepted, but nothing that would be greater than the provided tuple parts. -* `1.2.3 - 2.3` := `>=1.2.3 <2.4.0` -* `1.2.3 - 2` := `>=1.2.3 <3.0.0` +* `1.2.3 - 2.3` := `>=1.2.3 <2.4.0-0` +* `1.2.3 - 2` := `>=1.2.3 <3.0.0-0` #### X-Ranges `1.2.x` `1.X` `1.2.*` `*` @@ -202,28 +265,28 @@ Any of `X`, `x`, or `*` may be used to "stand in" for one of the numeric values in the `[major, minor, patch]` tuple. * `*` := `>=0.0.0` (Any version satisfies) -* `1.x` := `>=1.0.0 <2.0.0` (Matching major version) -* `1.2.x` := `>=1.2.0 <1.3.0` (Matching major and minor versions) +* `1.x` := `>=1.0.0 <2.0.0-0` (Matching major version) +* `1.2.x` := `>=1.2.0 <1.3.0-0` (Matching major and minor versions) A partial version range is treated as an X-Range, so the special character is in fact optional. * `""` (empty string) := `*` := `>=0.0.0` -* `1` := `1.x.x` := `>=1.0.0 <2.0.0` -* `1.2` := `1.2.x` := `>=1.2.0 <1.3.0` +* `1` := `1.x.x` := `>=1.0.0 <2.0.0-0` +* `1.2` := `1.2.x` := `>=1.2.0 <1.3.0-0` #### Tilde Ranges `~1.2.3` `~1.2` `~1` Allows patch-level changes if a minor version is specified on the comparator. Allows minor-level changes if not. -* `~1.2.3` := `>=1.2.3 <1.(2+1).0` := `>=1.2.3 <1.3.0` -* `~1.2` := `>=1.2.0 <1.(2+1).0` := `>=1.2.0 <1.3.0` (Same as `1.2.x`) -* `~1` := `>=1.0.0 <(1+1).0.0` := `>=1.0.0 <2.0.0` (Same as `1.x`) -* `~0.2.3` := `>=0.2.3 <0.(2+1).0` := `>=0.2.3 <0.3.0` -* `~0.2` := `>=0.2.0 <0.(2+1).0` := `>=0.2.0 <0.3.0` (Same as `0.2.x`) -* `~0` := `>=0.0.0 <(0+1).0.0` := `>=0.0.0 <1.0.0` (Same as `0.x`) -* `~1.2.3-beta.2` := `>=1.2.3-beta.2 <1.3.0` Note that prereleases in +* `~1.2.3` := `>=1.2.3 <1.(2+1).0` := `>=1.2.3 <1.3.0-0` +* `~1.2` := `>=1.2.0 <1.(2+1).0` := `>=1.2.0 <1.3.0-0` (Same as `1.2.x`) +* `~1` := `>=1.0.0 <(1+1).0.0` := `>=1.0.0 <2.0.0-0` (Same as `1.x`) +* `~0.2.3` := `>=0.2.3 <0.(2+1).0` := `>=0.2.3 <0.3.0-0` +* `~0.2` := `>=0.2.0 <0.(2+1).0` := `>=0.2.0 <0.3.0-0` (Same as `0.2.x`) +* `~0` := `>=0.0.0 <(0+1).0.0` := `>=0.0.0 <1.0.0-0` (Same as `0.x`) +* `~1.2.3-beta.2` := `>=1.2.3-beta.2 <1.3.0-0` Note that prereleases in the `1.2.3` version will be allowed, if they are greater than or equal to `beta.2`. So, `1.2.3-beta.4` would be allowed, but `1.2.4-beta.2` would not, because it is a prerelease of a @@ -231,7 +294,7 @@ comparator. Allows minor-level changes if not. #### Caret Ranges `^1.2.3` `^0.2.5` `^0.0.4` -Allows changes that do not modify the left-most non-zero digit in the +Allows changes that do not modify the left-most non-zero element in the `[major, minor, patch]` tuple. In other words, this allows patch and minor updates for versions `1.0.0` and above, patch updates for versions `0.X >=0.1.0`, and *no* updates for versions `0.0.X`. @@ -245,15 +308,15 @@ However, it presumes that there will *not* be breaking changes between `0.2.4` and `0.2.5`. It allows for changes that are presumed to be additive (but non-breaking), according to commonly observed practices. -* `^1.2.3` := `>=1.2.3 <2.0.0` -* `^0.2.3` := `>=0.2.3 <0.3.0` -* `^0.0.3` := `>=0.0.3 <0.0.4` -* `^1.2.3-beta.2` := `>=1.2.3-beta.2 <2.0.0` Note that prereleases in +* `^1.2.3` := `>=1.2.3 <2.0.0-0` +* `^0.2.3` := `>=0.2.3 <0.3.0-0` +* `^0.0.3` := `>=0.0.3 <0.0.4-0` +* `^1.2.3-beta.2` := `>=1.2.3-beta.2 <2.0.0-0` Note that prereleases in the `1.2.3` version will be allowed, if they are greater than or equal to `beta.2`. So, `1.2.3-beta.4` would be allowed, but `1.2.4-beta.2` would not, because it is a prerelease of a different `[major, minor, patch]` tuple. -* `^0.0.3-beta` := `>=0.0.3-beta <0.0.4` Note that prereleases in the +* `^0.0.3-beta` := `>=0.0.3-beta <0.0.4-0` Note that prereleases in the `0.0.3` version *only* will be allowed, if they are greater than or equal to `beta`. So, `0.0.3-pr.2` would be allowed. @@ -261,16 +324,16 @@ When parsing caret ranges, a missing `patch` value desugars to the number `0`, but will allow flexibility within that value, even if the major and minor versions are both `0`. -* `^1.2.x` := `>=1.2.0 <2.0.0` -* `^0.0.x` := `>=0.0.0 <0.1.0` -* `^0.0` := `>=0.0.0 <0.1.0` +* `^1.2.x` := `>=1.2.0 <2.0.0-0` +* `^0.0.x` := `>=0.0.0 <0.1.0-0` +* `^0.0` := `>=0.0.0 <0.1.0-0` A missing `minor` and `patch` values will desugar to zero, but also allow flexibility within those values, even if the major version is zero. -* `^1.x` := `>=1.0.0 <2.0.0` -* `^0.x` := `>=0.0.0 <1.0.0` +* `^1.x` := `>=1.0.0 <2.0.0-0` +* `^0.x` := `>=0.0.0 <1.0.0-0` ### Range Grammar @@ -354,6 +417,9 @@ strings that they parse. `v2` is greater. Sorts in ascending order if passed to `Array.sort()`. * `rcompare(v1, v2)`: The reverse of compare. Sorts an array of versions in descending order when passed to `Array.sort()`. +* `compareBuild(v1, v2)`: The same as `compare` but considers `build` when two versions + are equal. Sorts in ascending order if passed to `Array.sort()`. + `v2` is greater. Sorts in ascending order if passed to `Array.sort()`. * `diff(v1, v2)`: Returns difference between two versions by the release type (`major`, `premajor`, `minor`, `preminor`, `patch`, `prepatch`, or `prerelease`), or null if the versions are the same. @@ -382,6 +448,16 @@ strings that they parse. `hilo` argument must be either the string `'>'` or `'<'`. (This is the function called by `gtr` and `ltr`.) * `intersects(range)`: Return true if any of the ranges comparators intersect +* `simplifyRange(versions, range)`: Return a "simplified" range that + matches the same items in `versions` list as the range specified. Note + that it does *not* guarantee that it would match the same versions in all + cases, only for the set of versions provided. This is useful when + generating ranges by joining together multiple versions with `||` + programmatically, to provide the user with something a bit more + ergonomic. If the provided range is shorter in string-length than the + generated range, then that is returned. +* `subset(subRange, superRange)`: Return `true` if the `subRange` range is + entirely contained by the `superRange` range. Note that, since ranges may be non-contiguous, a version might not be greater than a range, less than a range, *or* satisfy a range! For @@ -396,7 +472,7 @@ range, use the `satisfies(version, range)` function. ### Coercion -* `coerce(version)`: Coerces a string to semver if possible +* `coerce(version, options)`: Coerces a string to semver if possible This aims to provide a very forgiving translation of a non-semver string to semver. It looks for the first digit in a string, and consumes all @@ -410,3 +486,81 @@ coercion is 16 characters; longer components will be ignored (`10000000000000000.4.7.4` becomes `4.7.4`). The maximum value for any semver component is `Number.MAX_SAFE_INTEGER || (2**53 - 1)`; higher value components are invalid (`9999999999999999.4.7.4` is likely invalid). + +If the `options.rtl` flag is set, then `coerce` will return the right-most +coercible tuple that does not share an ending index with a longer coercible +tuple. For example, `1.2.3.4` will return `2.3.4` in rtl mode, not +`4.0.0`. `1.2.3/4` will return `4.0.0`, because the `4` is not a part of +any other overlapping SemVer tuple. + +### Clean + +* `clean(version)`: Clean a string to be a valid semver if possible + +This will return a cleaned and trimmed semver version. If the provided +version is not valid a null will be returned. This does not work for +ranges. + +ex. +* `s.clean(' = v 2.1.5foo')`: `null` +* `s.clean(' = v 2.1.5foo', { loose: true })`: `'2.1.5-foo'` +* `s.clean(' = v 2.1.5-foo')`: `null` +* `s.clean(' = v 2.1.5-foo', { loose: true })`: `'2.1.5-foo'` +* `s.clean('=v2.1.5')`: `'2.1.5'` +* `s.clean(' =v2.1.5')`: `2.1.5` +* `s.clean(' 2.1.5 ')`: `'2.1.5'` +* `s.clean('~1.0.0')`: `null` + +## Exported Modules + + + +You may pull in just the part of this semver utility that you need, if you +are sensitive to packing and tree-shaking concerns. The main +`require('semver')` export uses getter functions to lazily load the parts +of the API that are used. + +The following modules are available: + +* `require('semver')` +* `require('semver/classes')` +* `require('semver/classes/comparator')` +* `require('semver/classes/range')` +* `require('semver/classes/semver')` +* `require('semver/functions/clean')` +* `require('semver/functions/cmp')` +* `require('semver/functions/coerce')` +* `require('semver/functions/compare')` +* `require('semver/functions/compare-build')` +* `require('semver/functions/compare-loose')` +* `require('semver/functions/diff')` +* `require('semver/functions/eq')` +* `require('semver/functions/gt')` +* `require('semver/functions/gte')` +* `require('semver/functions/inc')` +* `require('semver/functions/lt')` +* `require('semver/functions/lte')` +* `require('semver/functions/major')` +* `require('semver/functions/minor')` +* `require('semver/functions/neq')` +* `require('semver/functions/parse')` +* `require('semver/functions/patch')` +* `require('semver/functions/prerelease')` +* `require('semver/functions/rcompare')` +* `require('semver/functions/rsort')` +* `require('semver/functions/satisfies')` +* `require('semver/functions/sort')` +* `require('semver/functions/valid')` +* `require('semver/ranges/gtr')` +* `require('semver/ranges/intersects')` +* `require('semver/ranges/ltr')` +* `require('semver/ranges/max-satisfying')` +* `require('semver/ranges/min-satisfying')` +* `require('semver/ranges/min-version')` +* `require('semver/ranges/outside')` +* `require('semver/ranges/to-comparators')` +* `require('semver/ranges/valid')` diff --git a/deps/npm/node_modules/semver/bin/semver.js b/deps/npm/node_modules/semver/bin/semver.js new file mode 100755 index 00000000000000..73fe29538ad574 --- /dev/null +++ b/deps/npm/node_modules/semver/bin/semver.js @@ -0,0 +1,173 @@ +#!/usr/bin/env node +// Standalone semver comparison program. +// Exits successfully and prints matching version(s) if +// any supplied version is valid and passes all tests. + +const argv = process.argv.slice(2) + +let versions = [] + +const range = [] + +let inc = null + +const version = require('../package.json').version + +let loose = false + +let includePrerelease = false + +let coerce = false + +let rtl = false + +let identifier + +const semver = require('../') + +let reverse = false + +const options = {} + +const main = () => { + if (!argv.length) return help() + while (argv.length) { + let a = argv.shift() + const indexOfEqualSign = a.indexOf('=') + if (indexOfEqualSign !== -1) { + a = a.slice(0, indexOfEqualSign) + argv.unshift(a.slice(indexOfEqualSign + 1)) + } + switch (a) { + case '-rv': case '-rev': case '--rev': case '--reverse': + reverse = true + break + case '-l': case '--loose': + loose = true + break + case '-p': case '--include-prerelease': + includePrerelease = true + break + case '-v': case '--version': + versions.push(argv.shift()) + break + case '-i': case '--inc': case '--increment': + switch (argv[0]) { + case 'major': case 'minor': case 'patch': case 'prerelease': + case 'premajor': case 'preminor': case 'prepatch': + inc = argv.shift() + break + default: + inc = 'patch' + break + } + break + case '--preid': + identifier = argv.shift() + break + case '-r': case '--range': + range.push(argv.shift()) + break + case '-c': case '--coerce': + coerce = true + break + case '--rtl': + rtl = true + break + case '--ltr': + rtl = false + break + case '-h': case '--help': case '-?': + return help() + default: + versions.push(a) + break + } + } + + const options = { loose: loose, includePrerelease: includePrerelease, rtl: rtl } + + versions = versions.map((v) => { + return coerce ? (semver.coerce(v, options) || { version: v }).version : v + }).filter((v) => { + return semver.valid(v) + }) + if (!versions.length) return fail() + if (inc && (versions.length !== 1 || range.length)) { return failInc() } + + for (let i = 0, l = range.length; i < l; i++) { + versions = versions.filter((v) => { + return semver.satisfies(v, range[i], options) + }) + if (!versions.length) return fail() + } + return success(versions) +} + + +const failInc = () => { + console.error('--inc can only be used on a single version with no range') + fail() +} + +const fail = () => process.exit(1) + +const success = () => { + const compare = reverse ? 'rcompare' : 'compare' + versions.sort((a, b) => { + return semver[compare](a, b, options) + }).map((v) => { + return semver.clean(v, options) + }).map((v) => { + return inc ? semver.inc(v, inc, options, identifier) : v + }).forEach((v, i, _) => { console.log(v) }) +} + +const help = () => console.log( +`SemVer ${version} + +A JavaScript implementation of the https://semver.org/ specification +Copyright Isaac Z. Schlueter + +Usage: semver [options] [ [...]] +Prints valid versions sorted by SemVer precedence + +Options: +-r --range + Print versions that match the specified range. + +-i --increment [] + Increment a version by the specified level. Level can + be one of: major, minor, patch, premajor, preminor, + prepatch, or prerelease. Default level is 'patch'. + Only one version may be specified. + +--preid + Identifier to be used to prefix premajor, preminor, + prepatch or prerelease version increments. + +-l --loose + Interpret versions and ranges loosely + +-p --include-prerelease + Always include prerelease versions in range matching + +-c --coerce + Coerce a string into SemVer if possible + (does not imply --loose) + +--rtl + Coerce version strings right to left + +--ltr + Coerce version strings left to right (default) + +Program exits successfully if any valid version satisfies +all supplied ranges, and prints all satisfying versions. + +If no satisfying versions are found, then exits failure. + +Versions are printed in ascending order, so supplying +multiple versions to the utility will just sort them.`) + +main() diff --git a/deps/npm/node_modules/semver/classes/comparator.js b/deps/npm/node_modules/semver/classes/comparator.js new file mode 100644 index 00000000000000..3595792d0ed0cc --- /dev/null +++ b/deps/npm/node_modules/semver/classes/comparator.js @@ -0,0 +1,139 @@ +const ANY = Symbol('SemVer ANY') +// hoisted class for cyclic dependency +class Comparator { + static get ANY () { + return ANY + } + constructor (comp, options) { + if (!options || typeof options !== 'object') { + options = { + loose: !!options, + includePrerelease: false + } + } + + if (comp instanceof Comparator) { + if (comp.loose === !!options.loose) { + return comp + } else { + comp = comp.value + } + } + + debug('comparator', comp, options) + this.options = options + this.loose = !!options.loose + this.parse(comp) + + if (this.semver === ANY) { + this.value = '' + } else { + this.value = this.operator + this.semver.version + } + + debug('comp', this) + } + + parse (comp) { + const r = this.options.loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR] + const m = comp.match(r) + + if (!m) { + throw new TypeError(`Invalid comparator: ${comp}`) + } + + this.operator = m[1] !== undefined ? m[1] : '' + if (this.operator === '=') { + this.operator = '' + } + + // if it literally is just '>' or '' then allow anything. + if (!m[2]) { + this.semver = ANY + } else { + this.semver = new SemVer(m[2], this.options.loose) + } + } + + toString () { + return this.value + } + + test (version) { + debug('Comparator.test', version, this.options.loose) + + if (this.semver === ANY || version === ANY) { + return true + } + + if (typeof version === 'string') { + try { + version = new SemVer(version, this.options) + } catch (er) { + return false + } + } + + return cmp(version, this.operator, this.semver, this.options) + } + + intersects (comp, options) { + if (!(comp instanceof Comparator)) { + throw new TypeError('a Comparator is required') + } + + if (!options || typeof options !== 'object') { + options = { + loose: !!options, + includePrerelease: false + } + } + + if (this.operator === '') { + if (this.value === '') { + return true + } + return new Range(comp.value, options).test(this.value) + } else if (comp.operator === '') { + if (comp.value === '') { + return true + } + return new Range(this.value, options).test(comp.semver) + } + + const sameDirectionIncreasing = + (this.operator === '>=' || this.operator === '>') && + (comp.operator === '>=' || comp.operator === '>') + const sameDirectionDecreasing = + (this.operator === '<=' || this.operator === '<') && + (comp.operator === '<=' || comp.operator === '<') + const sameSemVer = this.semver.version === comp.semver.version + const differentDirectionsInclusive = + (this.operator === '>=' || this.operator === '<=') && + (comp.operator === '>=' || comp.operator === '<=') + const oppositeDirectionsLessThan = + cmp(this.semver, '<', comp.semver, options) && + (this.operator === '>=' || this.operator === '>') && + (comp.operator === '<=' || comp.operator === '<') + const oppositeDirectionsGreaterThan = + cmp(this.semver, '>', comp.semver, options) && + (this.operator === '<=' || this.operator === '<') && + (comp.operator === '>=' || comp.operator === '>') + + return ( + sameDirectionIncreasing || + sameDirectionDecreasing || + (sameSemVer && differentDirectionsInclusive) || + oppositeDirectionsLessThan || + oppositeDirectionsGreaterThan + ) + } +} + +module.exports = Comparator + +const {re, t} = require('../internal/re') +const cmp = require('../functions/cmp') +const debug = require('../internal/debug') +const SemVer = require('./semver') +const Range = require('./range') diff --git a/deps/npm/node_modules/semver/classes/index.js b/deps/npm/node_modules/semver/classes/index.js new file mode 100644 index 00000000000000..198b84d6645cf4 --- /dev/null +++ b/deps/npm/node_modules/semver/classes/index.js @@ -0,0 +1,5 @@ +module.exports = { + SemVer: require('./semver.js'), + Range: require('./range.js'), + Comparator: require('./comparator.js') +} diff --git a/deps/npm/node_modules/semver/classes/range.js b/deps/npm/node_modules/semver/classes/range.js new file mode 100644 index 00000000000000..83f8967717ebbf --- /dev/null +++ b/deps/npm/node_modules/semver/classes/range.js @@ -0,0 +1,463 @@ +// hoisted class for cyclic dependency +class Range { + constructor (range, options) { + if (!options || typeof options !== 'object') { + options = { + loose: !!options, + includePrerelease: false + } + } + + if (range instanceof Range) { + if ( + range.loose === !!options.loose && + range.includePrerelease === !!options.includePrerelease + ) { + return range + } else { + return new Range(range.raw, options) + } + } + + if (range instanceof Comparator) { + // just put it in the set and return + this.raw = range.value + this.set = [[range]] + this.format() + return this + } + + this.options = options + this.loose = !!options.loose + this.includePrerelease = !!options.includePrerelease + + // First, split based on boolean or || + this.raw = range + this.set = range + .split(/\s*\|\|\s*/) + // map the range to a 2d array of comparators + .map(range => this.parseRange(range.trim())) + // throw out any comparator lists that are empty + // this generally means that it was not a valid range, which is allowed + // in loose mode, but will still throw if the WHOLE range is invalid. + .filter(c => c.length) + + if (!this.set.length) { + throw new TypeError(`Invalid SemVer Range: ${range}`) + } + + this.format() + } + + format () { + this.range = this.set + .map((comps) => { + return comps.join(' ').trim() + }) + .join('||') + .trim() + return this.range + } + + toString () { + return this.range + } + + parseRange (range) { + const loose = this.options.loose + range = range.trim() + // `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4` + const hr = loose ? re[t.HYPHENRANGELOOSE] : re[t.HYPHENRANGE] + range = range.replace(hr, hyphenReplace(this.options.includePrerelease)) + debug('hyphen replace', range) + // `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5` + range = range.replace(re[t.COMPARATORTRIM], comparatorTrimReplace) + debug('comparator trim', range, re[t.COMPARATORTRIM]) + + // `~ 1.2.3` => `~1.2.3` + range = range.replace(re[t.TILDETRIM], tildeTrimReplace) + + // `^ 1.2.3` => `^1.2.3` + range = range.replace(re[t.CARETTRIM], caretTrimReplace) + + // normalize spaces + range = range.split(/\s+/).join(' ') + + // At this point, the range is completely trimmed and + // ready to be split into comparators. + + const compRe = loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR] + return range + .split(' ') + .map(comp => parseComparator(comp, this.options)) + .join(' ') + .split(/\s+/) + .map(comp => replaceGTE0(comp, this.options)) + // in loose mode, throw out any that are not valid comparators + .filter(this.options.loose ? comp => !!comp.match(compRe) : () => true) + .map(comp => new Comparator(comp, this.options)) + } + + intersects (range, options) { + if (!(range instanceof Range)) { + throw new TypeError('a Range is required') + } + + return this.set.some((thisComparators) => { + return ( + isSatisfiable(thisComparators, options) && + range.set.some((rangeComparators) => { + return ( + isSatisfiable(rangeComparators, options) && + thisComparators.every((thisComparator) => { + return rangeComparators.every((rangeComparator) => { + return thisComparator.intersects(rangeComparator, options) + }) + }) + ) + }) + ) + }) + } + + // if ANY of the sets match ALL of its comparators, then pass + test (version) { + if (!version) { + return false + } + + if (typeof version === 'string') { + try { + version = new SemVer(version, this.options) + } catch (er) { + return false + } + } + + for (let i = 0; i < this.set.length; i++) { + if (testSet(this.set[i], version, this.options)) { + return true + } + } + return false + } +} +module.exports = Range + +const Comparator = require('./comparator') +const debug = require('../internal/debug') +const SemVer = require('./semver') +const { + re, + t, + comparatorTrimReplace, + tildeTrimReplace, + caretTrimReplace +} = require('../internal/re') + +// take a set of comparators and determine whether there +// exists a version which can satisfy it +const isSatisfiable = (comparators, options) => { + let result = true + const remainingComparators = comparators.slice() + let testComparator = remainingComparators.pop() + + while (result && remainingComparators.length) { + result = remainingComparators.every((otherComparator) => { + return testComparator.intersects(otherComparator, options) + }) + + testComparator = remainingComparators.pop() + } + + return result +} + +// comprised of xranges, tildes, stars, and gtlt's at this point. +// already replaced the hyphen ranges +// turn into a set of JUST comparators. +const parseComparator = (comp, options) => { + debug('comp', comp, options) + comp = replaceCarets(comp, options) + debug('caret', comp) + comp = replaceTildes(comp, options) + debug('tildes', comp) + comp = replaceXRanges(comp, options) + debug('xrange', comp) + comp = replaceStars(comp, options) + debug('stars', comp) + return comp +} + +const isX = id => !id || id.toLowerCase() === 'x' || id === '*' + +// ~, ~> --> * (any, kinda silly) +// ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0 <3.0.0-0 +// ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0 <2.1.0-0 +// ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0-0 +// ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0-0 +// ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0-0 +const replaceTildes = (comp, options) => + comp.trim().split(/\s+/).map((comp) => { + return replaceTilde(comp, options) + }).join(' ') + +const replaceTilde = (comp, options) => { + const r = options.loose ? re[t.TILDELOOSE] : re[t.TILDE] + return comp.replace(r, (_, M, m, p, pr) => { + debug('tilde', comp, _, M, m, p, pr) + let ret + + if (isX(M)) { + ret = '' + } else if (isX(m)) { + ret = `>=${M}.0.0 <${+M + 1}.0.0-0` + } else if (isX(p)) { + // ~1.2 == >=1.2.0 <1.3.0-0 + ret = `>=${M}.${m}.0 <${M}.${+m + 1}.0-0` + } else if (pr) { + debug('replaceTilde pr', pr) + ret = `>=${M}.${m}.${p}-${pr + } <${M}.${+m + 1}.0-0` + } else { + // ~1.2.3 == >=1.2.3 <1.3.0-0 + ret = `>=${M}.${m}.${p + } <${M}.${+m + 1}.0-0` + } + + debug('tilde return', ret) + return ret + }) +} + +// ^ --> * (any, kinda silly) +// ^2, ^2.x, ^2.x.x --> >=2.0.0 <3.0.0-0 +// ^2.0, ^2.0.x --> >=2.0.0 <3.0.0-0 +// ^1.2, ^1.2.x --> >=1.2.0 <2.0.0-0 +// ^1.2.3 --> >=1.2.3 <2.0.0-0 +// ^1.2.0 --> >=1.2.0 <2.0.0-0 +const replaceCarets = (comp, options) => + comp.trim().split(/\s+/).map((comp) => { + return replaceCaret(comp, options) + }).join(' ') + +const replaceCaret = (comp, options) => { + debug('caret', comp, options) + const r = options.loose ? re[t.CARETLOOSE] : re[t.CARET] + const z = options.includePrerelease ? '-0' : '' + return comp.replace(r, (_, M, m, p, pr) => { + debug('caret', comp, _, M, m, p, pr) + let ret + + if (isX(M)) { + ret = '' + } else if (isX(m)) { + ret = `>=${M}.0.0${z} <${+M + 1}.0.0-0` + } else if (isX(p)) { + if (M === '0') { + ret = `>=${M}.${m}.0${z} <${M}.${+m + 1}.0-0` + } else { + ret = `>=${M}.${m}.0${z} <${+M + 1}.0.0-0` + } + } else if (pr) { + debug('replaceCaret pr', pr) + if (M === '0') { + if (m === '0') { + ret = `>=${M}.${m}.${p}-${pr + } <${M}.${m}.${+p + 1}-0` + } else { + ret = `>=${M}.${m}.${p}-${pr + } <${M}.${+m + 1}.0-0` + } + } else { + ret = `>=${M}.${m}.${p}-${pr + } <${+M + 1}.0.0-0` + } + } else { + debug('no pr') + if (M === '0') { + if (m === '0') { + ret = `>=${M}.${m}.${p + }${z} <${M}.${m}.${+p + 1}-0` + } else { + ret = `>=${M}.${m}.${p + }${z} <${M}.${+m + 1}.0-0` + } + } else { + ret = `>=${M}.${m}.${p + } <${+M + 1}.0.0-0` + } + } + + debug('caret return', ret) + return ret + }) +} + +const replaceXRanges = (comp, options) => { + debug('replaceXRanges', comp, options) + return comp.split(/\s+/).map((comp) => { + return replaceXRange(comp, options) + }).join(' ') +} + +const replaceXRange = (comp, options) => { + comp = comp.trim() + const r = options.loose ? re[t.XRANGELOOSE] : re[t.XRANGE] + return comp.replace(r, (ret, gtlt, M, m, p, pr) => { + debug('xRange', comp, ret, gtlt, M, m, p, pr) + const xM = isX(M) + const xm = xM || isX(m) + const xp = xm || isX(p) + const anyX = xp + + if (gtlt === '=' && anyX) { + gtlt = '' + } + + // if we're including prereleases in the match, then we need + // to fix this to -0, the lowest possible prerelease value + pr = options.includePrerelease ? '-0' : '' + + if (xM) { + if (gtlt === '>' || gtlt === '<') { + // nothing is allowed + ret = '<0.0.0-0' + } else { + // nothing is forbidden + ret = '*' + } + } else if (gtlt && anyX) { + // we know patch is an x, because we have any x at all. + // replace X with 0 + if (xm) { + m = 0 + } + p = 0 + + if (gtlt === '>') { + // >1 => >=2.0.0 + // >1.2 => >=1.3.0 + gtlt = '>=' + if (xm) { + M = +M + 1 + m = 0 + p = 0 + } else { + m = +m + 1 + p = 0 + } + } else if (gtlt === '<=') { + // <=0.7.x is actually <0.8.0, since any 0.7.x should + // pass. Similarly, <=7.x is actually <8.0.0, etc. + gtlt = '<' + if (xm) { + M = +M + 1 + } else { + m = +m + 1 + } + } + + if (gtlt === '<') + pr = '-0' + + ret = `${gtlt + M}.${m}.${p}${pr}` + } else if (xm) { + ret = `>=${M}.0.0${pr} <${+M + 1}.0.0-0` + } else if (xp) { + ret = `>=${M}.${m}.0${pr + } <${M}.${+m + 1}.0-0` + } + + debug('xRange return', ret) + + return ret + }) +} + +// Because * is AND-ed with everything else in the comparator, +// and '' means "any version", just remove the *s entirely. +const replaceStars = (comp, options) => { + debug('replaceStars', comp, options) + // Looseness is ignored here. star is always as loose as it gets! + return comp.trim().replace(re[t.STAR], '') +} + +const replaceGTE0 = (comp, options) => { + debug('replaceGTE0', comp, options) + return comp.trim() + .replace(re[options.includePrerelease ? t.GTE0PRE : t.GTE0], '') +} + +// This function is passed to string.replace(re[t.HYPHENRANGE]) +// M, m, patch, prerelease, build +// 1.2 - 3.4.5 => >=1.2.0 <=3.4.5 +// 1.2.3 - 3.4 => >=1.2.0 <3.5.0-0 Any 3.4.x will do +// 1.2 - 3.4 => >=1.2.0 <3.5.0-0 +const hyphenReplace = incPr => ($0, + from, fM, fm, fp, fpr, fb, + to, tM, tm, tp, tpr, tb) => { + if (isX(fM)) { + from = '' + } else if (isX(fm)) { + from = `>=${fM}.0.0${incPr ? '-0' : ''}` + } else if (isX(fp)) { + from = `>=${fM}.${fm}.0${incPr ? '-0' : ''}` + } else if (fpr) { + from = `>=${from}` + } else { + from = `>=${from}${incPr ? '-0' : ''}` + } + + if (isX(tM)) { + to = '' + } else if (isX(tm)) { + to = `<${+tM + 1}.0.0-0` + } else if (isX(tp)) { + to = `<${tM}.${+tm + 1}.0-0` + } else if (tpr) { + to = `<=${tM}.${tm}.${tp}-${tpr}` + } else if (incPr) { + to = `<${tM}.${tm}.${+tp + 1}-0` + } else { + to = `<=${to}` + } + + return (`${from} ${to}`).trim() +} + +const testSet = (set, version, options) => { + for (let i = 0; i < set.length; i++) { + if (!set[i].test(version)) { + return false + } + } + + if (version.prerelease.length && !options.includePrerelease) { + // Find the set of versions that are allowed to have prereleases + // For example, ^1.2.3-pr.1 desugars to >=1.2.3-pr.1 <2.0.0 + // That should allow `1.2.3-pr.2` to pass. + // However, `1.2.4-alpha.notready` should NOT be allowed, + // even though it's within the range set by the comparators. + for (let i = 0; i < set.length; i++) { + debug(set[i].semver) + if (set[i].semver === Comparator.ANY) { + continue + } + + if (set[i].semver.prerelease.length > 0) { + const allowed = set[i].semver + if (allowed.major === version.major && + allowed.minor === version.minor && + allowed.patch === version.patch) { + return true + } + } + } + + // Version has a -pre, but it's not one of the ones we like. + return false + } + + return true +} diff --git a/deps/npm/node_modules/semver/classes/semver.js b/deps/npm/node_modules/semver/classes/semver.js new file mode 100644 index 00000000000000..73247ad2b7eabc --- /dev/null +++ b/deps/npm/node_modules/semver/classes/semver.js @@ -0,0 +1,290 @@ +const debug = require('../internal/debug') +const { MAX_LENGTH, MAX_SAFE_INTEGER } = require('../internal/constants') +const { re, t } = require('../internal/re') + +const { compareIdentifiers } = require('../internal/identifiers') +class SemVer { + constructor (version, options) { + if (!options || typeof options !== 'object') { + options = { + loose: !!options, + includePrerelease: false + } + } + if (version instanceof SemVer) { + if (version.loose === !!options.loose && + version.includePrerelease === !!options.includePrerelease) { + return version + } else { + version = version.version + } + } else if (typeof version !== 'string') { + throw new TypeError(`Invalid Version: ${version}`) + } + + if (version.length > MAX_LENGTH) { + throw new TypeError( + `version is longer than ${MAX_LENGTH} characters` + ) + } + + debug('SemVer', version, options) + this.options = options + this.loose = !!options.loose + // this isn't actually relevant for versions, but keep it so that we + // don't run into trouble passing this.options around. + this.includePrerelease = !!options.includePrerelease + + const m = version.trim().match(options.loose ? re[t.LOOSE] : re[t.FULL]) + + if (!m) { + throw new TypeError(`Invalid Version: ${version}`) + } + + this.raw = version + + // these are actually numbers + this.major = +m[1] + this.minor = +m[2] + this.patch = +m[3] + + if (this.major > MAX_SAFE_INTEGER || this.major < 0) { + throw new TypeError('Invalid major version') + } + + if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) { + throw new TypeError('Invalid minor version') + } + + if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) { + throw new TypeError('Invalid patch version') + } + + // numberify any prerelease numeric ids + if (!m[4]) { + this.prerelease = [] + } else { + this.prerelease = m[4].split('.').map((id) => { + if (/^[0-9]+$/.test(id)) { + const num = +id + if (num >= 0 && num < MAX_SAFE_INTEGER) { + return num + } + } + return id + }) + } + + this.build = m[5] ? m[5].split('.') : [] + this.format() + } + + format () { + this.version = `${this.major}.${this.minor}.${this.patch}` + if (this.prerelease.length) { + this.version += `-${this.prerelease.join('.')}` + } + return this.version + } + + toString () { + return this.version + } + + compare (other) { + debug('SemVer.compare', this.version, this.options, other) + if (!(other instanceof SemVer)) { + if (typeof other === 'string' && other === this.version) { + return 0 + } + other = new SemVer(other, this.options) + } + + if (other.version === this.version) { + return 0 + } + + return this.compareMain(other) || this.comparePre(other) + } + + compareMain (other) { + if (!(other instanceof SemVer)) { + other = new SemVer(other, this.options) + } + + return ( + compareIdentifiers(this.major, other.major) || + compareIdentifiers(this.minor, other.minor) || + compareIdentifiers(this.patch, other.patch) + ) + } + + comparePre (other) { + if (!(other instanceof SemVer)) { + other = new SemVer(other, this.options) + } + + // NOT having a prerelease is > having one + if (this.prerelease.length && !other.prerelease.length) { + return -1 + } else if (!this.prerelease.length && other.prerelease.length) { + return 1 + } else if (!this.prerelease.length && !other.prerelease.length) { + return 0 + } + + let i = 0 + do { + const a = this.prerelease[i] + const b = other.prerelease[i] + debug('prerelease compare', i, a, b) + if (a === undefined && b === undefined) { + return 0 + } else if (b === undefined) { + return 1 + } else if (a === undefined) { + return -1 + } else if (a === b) { + continue + } else { + return compareIdentifiers(a, b) + } + } while (++i) + } + + compareBuild (other) { + if (!(other instanceof SemVer)) { + other = new SemVer(other, this.options) + } + + let i = 0 + do { + const a = this.build[i] + const b = other.build[i] + debug('prerelease compare', i, a, b) + if (a === undefined && b === undefined) { + return 0 + } else if (b === undefined) { + return 1 + } else if (a === undefined) { + return -1 + } else if (a === b) { + continue + } else { + return compareIdentifiers(a, b) + } + } while (++i) + } + + // preminor will bump the version up to the next minor release, and immediately + // down to pre-release. premajor and prepatch work the same way. + inc (release, identifier) { + switch (release) { + case 'premajor': + this.prerelease.length = 0 + this.patch = 0 + this.minor = 0 + this.major++ + this.inc('pre', identifier) + break + case 'preminor': + this.prerelease.length = 0 + this.patch = 0 + this.minor++ + this.inc('pre', identifier) + break + case 'prepatch': + // If this is already a prerelease, it will bump to the next version + // drop any prereleases that might already exist, since they are not + // relevant at this point. + this.prerelease.length = 0 + this.inc('patch', identifier) + this.inc('pre', identifier) + break + // If the input is a non-prerelease version, this acts the same as + // prepatch. + case 'prerelease': + if (this.prerelease.length === 0) { + this.inc('patch', identifier) + } + this.inc('pre', identifier) + break + + case 'major': + // If this is a pre-major version, bump up to the same major version. + // Otherwise increment major. + // 1.0.0-5 bumps to 1.0.0 + // 1.1.0 bumps to 2.0.0 + if ( + this.minor !== 0 || + this.patch !== 0 || + this.prerelease.length === 0 + ) { + this.major++ + } + this.minor = 0 + this.patch = 0 + this.prerelease = [] + break + case 'minor': + // If this is a pre-minor version, bump up to the same minor version. + // Otherwise increment minor. + // 1.2.0-5 bumps to 1.2.0 + // 1.2.1 bumps to 1.3.0 + if (this.patch !== 0 || this.prerelease.length === 0) { + this.minor++ + } + this.patch = 0 + this.prerelease = [] + break + case 'patch': + // If this is not a pre-release version, it will increment the patch. + // If it is a pre-release it will bump up to the same patch version. + // 1.2.0-5 patches to 1.2.0 + // 1.2.0 patches to 1.2.1 + if (this.prerelease.length === 0) { + this.patch++ + } + this.prerelease = [] + break + // This probably shouldn't be used publicly. + // 1.0.0 'pre' would become 1.0.0-0 which is the wrong direction. + case 'pre': + if (this.prerelease.length === 0) { + this.prerelease = [0] + } else { + let i = this.prerelease.length + while (--i >= 0) { + if (typeof this.prerelease[i] === 'number') { + this.prerelease[i]++ + i = -2 + } + } + if (i === -1) { + // didn't increment anything + this.prerelease.push(0) + } + } + if (identifier) { + // 1.2.0-beta.1 bumps to 1.2.0-beta.2, + // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0 + if (this.prerelease[0] === identifier) { + if (isNaN(this.prerelease[1])) { + this.prerelease = [identifier, 0] + } + } else { + this.prerelease = [identifier, 0] + } + } + break + + default: + throw new Error(`invalid increment argument: ${release}`) + } + this.format() + this.raw = this.version + return this + } +} + +module.exports = SemVer diff --git a/deps/npm/node_modules/semver/functions/clean.js b/deps/npm/node_modules/semver/functions/clean.js new file mode 100644 index 00000000000000..811fe6b82cb73e --- /dev/null +++ b/deps/npm/node_modules/semver/functions/clean.js @@ -0,0 +1,6 @@ +const parse = require('./parse') +const clean = (version, options) => { + const s = parse(version.trim().replace(/^[=v]+/, ''), options) + return s ? s.version : null +} +module.exports = clean diff --git a/deps/npm/node_modules/semver/functions/cmp.js b/deps/npm/node_modules/semver/functions/cmp.js new file mode 100644 index 00000000000000..3b89db779108a0 --- /dev/null +++ b/deps/npm/node_modules/semver/functions/cmp.js @@ -0,0 +1,48 @@ +const eq = require('./eq') +const neq = require('./neq') +const gt = require('./gt') +const gte = require('./gte') +const lt = require('./lt') +const lte = require('./lte') + +const cmp = (a, op, b, loose) => { + switch (op) { + case '===': + if (typeof a === 'object') + a = a.version + if (typeof b === 'object') + b = b.version + return a === b + + case '!==': + if (typeof a === 'object') + a = a.version + if (typeof b === 'object') + b = b.version + return a !== b + + case '': + case '=': + case '==': + return eq(a, b, loose) + + case '!=': + return neq(a, b, loose) + + case '>': + return gt(a, b, loose) + + case '>=': + return gte(a, b, loose) + + case '<': + return lt(a, b, loose) + + case '<=': + return lte(a, b, loose) + + default: + throw new TypeError(`Invalid operator: ${op}`) + } +} +module.exports = cmp diff --git a/deps/npm/node_modules/semver/functions/coerce.js b/deps/npm/node_modules/semver/functions/coerce.js new file mode 100644 index 00000000000000..106ca71c9af92e --- /dev/null +++ b/deps/npm/node_modules/semver/functions/coerce.js @@ -0,0 +1,51 @@ +const SemVer = require('../classes/semver') +const parse = require('./parse') +const {re, t} = require('../internal/re') + +const coerce = (version, options) => { + if (version instanceof SemVer) { + return version + } + + if (typeof version === 'number') { + version = String(version) + } + + if (typeof version !== 'string') { + return null + } + + options = options || {} + + let match = null + if (!options.rtl) { + match = version.match(re[t.COERCE]) + } else { + // Find the right-most coercible string that does not share + // a terminus with a more left-ward coercible string. + // Eg, '1.2.3.4' wants to coerce '2.3.4', not '3.4' or '4' + // + // Walk through the string checking with a /g regexp + // Manually set the index so as to pick up overlapping matches. + // Stop when we get a match that ends at the string end, since no + // coercible string can be more right-ward without the same terminus. + let next + while ((next = re[t.COERCERTL].exec(version)) && + (!match || match.index + match[0].length !== version.length) + ) { + if (!match || + next.index + next[0].length !== match.index + match[0].length) { + match = next + } + re[t.COERCERTL].lastIndex = next.index + next[1].length + next[2].length + } + // leave it in a clean state + re[t.COERCERTL].lastIndex = -1 + } + + if (match === null) + return null + + return parse(`${match[2]}.${match[3] || '0'}.${match[4] || '0'}`, options) +} +module.exports = coerce diff --git a/deps/npm/node_modules/semver/functions/compare-build.js b/deps/npm/node_modules/semver/functions/compare-build.js new file mode 100644 index 00000000000000..9eb881bef0fddc --- /dev/null +++ b/deps/npm/node_modules/semver/functions/compare-build.js @@ -0,0 +1,7 @@ +const SemVer = require('../classes/semver') +const compareBuild = (a, b, loose) => { + const versionA = new SemVer(a, loose) + const versionB = new SemVer(b, loose) + return versionA.compare(versionB) || versionA.compareBuild(versionB) +} +module.exports = compareBuild diff --git a/deps/npm/node_modules/semver/functions/compare-loose.js b/deps/npm/node_modules/semver/functions/compare-loose.js new file mode 100644 index 00000000000000..4881fbe00250c5 --- /dev/null +++ b/deps/npm/node_modules/semver/functions/compare-loose.js @@ -0,0 +1,3 @@ +const compare = require('./compare') +const compareLoose = (a, b) => compare(a, b, true) +module.exports = compareLoose diff --git a/deps/npm/node_modules/semver/functions/compare.js b/deps/npm/node_modules/semver/functions/compare.js new file mode 100644 index 00000000000000..748b7afa514a9f --- /dev/null +++ b/deps/npm/node_modules/semver/functions/compare.js @@ -0,0 +1,5 @@ +const SemVer = require('../classes/semver') +const compare = (a, b, loose) => + new SemVer(a, loose).compare(new SemVer(b, loose)) + +module.exports = compare diff --git a/deps/npm/node_modules/semver/functions/diff.js b/deps/npm/node_modules/semver/functions/diff.js new file mode 100644 index 00000000000000..87200ef3b88e8f --- /dev/null +++ b/deps/npm/node_modules/semver/functions/diff.js @@ -0,0 +1,23 @@ +const parse = require('./parse') +const eq = require('./eq') + +const diff = (version1, version2) => { + if (eq(version1, version2)) { + return null + } else { + const v1 = parse(version1) + const v2 = parse(version2) + const hasPre = v1.prerelease.length || v2.prerelease.length + const prefix = hasPre ? 'pre' : '' + const defaultResult = hasPre ? 'prerelease' : '' + for (const key in v1) { + if (key === 'major' || key === 'minor' || key === 'patch') { + if (v1[key] !== v2[key]) { + return prefix + key + } + } + } + return defaultResult // may be undefined + } +} +module.exports = diff diff --git a/deps/npm/node_modules/semver/functions/eq.js b/deps/npm/node_modules/semver/functions/eq.js new file mode 100644 index 00000000000000..271fed976f34a6 --- /dev/null +++ b/deps/npm/node_modules/semver/functions/eq.js @@ -0,0 +1,3 @@ +const compare = require('./compare') +const eq = (a, b, loose) => compare(a, b, loose) === 0 +module.exports = eq diff --git a/deps/npm/node_modules/semver/functions/gt.js b/deps/npm/node_modules/semver/functions/gt.js new file mode 100644 index 00000000000000..d9b2156d8b56c3 --- /dev/null +++ b/deps/npm/node_modules/semver/functions/gt.js @@ -0,0 +1,3 @@ +const compare = require('./compare') +const gt = (a, b, loose) => compare(a, b, loose) > 0 +module.exports = gt diff --git a/deps/npm/node_modules/semver/functions/gte.js b/deps/npm/node_modules/semver/functions/gte.js new file mode 100644 index 00000000000000..5aeaa634707a0c --- /dev/null +++ b/deps/npm/node_modules/semver/functions/gte.js @@ -0,0 +1,3 @@ +const compare = require('./compare') +const gte = (a, b, loose) => compare(a, b, loose) >= 0 +module.exports = gte diff --git a/deps/npm/node_modules/semver/functions/inc.js b/deps/npm/node_modules/semver/functions/inc.js new file mode 100644 index 00000000000000..aa4d83ab4c2895 --- /dev/null +++ b/deps/npm/node_modules/semver/functions/inc.js @@ -0,0 +1,15 @@ +const SemVer = require('../classes/semver') + +const inc = (version, release, options, identifier) => { + if (typeof (options) === 'string') { + identifier = options + options = undefined + } + + try { + return new SemVer(version, options).inc(release, identifier).version + } catch (er) { + return null + } +} +module.exports = inc diff --git a/deps/npm/node_modules/semver/functions/lt.js b/deps/npm/node_modules/semver/functions/lt.js new file mode 100644 index 00000000000000..b440ab7d4212d3 --- /dev/null +++ b/deps/npm/node_modules/semver/functions/lt.js @@ -0,0 +1,3 @@ +const compare = require('./compare') +const lt = (a, b, loose) => compare(a, b, loose) < 0 +module.exports = lt diff --git a/deps/npm/node_modules/semver/functions/lte.js b/deps/npm/node_modules/semver/functions/lte.js new file mode 100644 index 00000000000000..6dcc956505584e --- /dev/null +++ b/deps/npm/node_modules/semver/functions/lte.js @@ -0,0 +1,3 @@ +const compare = require('./compare') +const lte = (a, b, loose) => compare(a, b, loose) <= 0 +module.exports = lte diff --git a/deps/npm/node_modules/semver/functions/major.js b/deps/npm/node_modules/semver/functions/major.js new file mode 100644 index 00000000000000..4283165e9d2719 --- /dev/null +++ b/deps/npm/node_modules/semver/functions/major.js @@ -0,0 +1,3 @@ +const SemVer = require('../classes/semver') +const major = (a, loose) => new SemVer(a, loose).major +module.exports = major diff --git a/deps/npm/node_modules/semver/functions/minor.js b/deps/npm/node_modules/semver/functions/minor.js new file mode 100644 index 00000000000000..57b3455f827bac --- /dev/null +++ b/deps/npm/node_modules/semver/functions/minor.js @@ -0,0 +1,3 @@ +const SemVer = require('../classes/semver') +const minor = (a, loose) => new SemVer(a, loose).minor +module.exports = minor diff --git a/deps/npm/node_modules/semver/functions/neq.js b/deps/npm/node_modules/semver/functions/neq.js new file mode 100644 index 00000000000000..f944c01576973f --- /dev/null +++ b/deps/npm/node_modules/semver/functions/neq.js @@ -0,0 +1,3 @@ +const compare = require('./compare') +const neq = (a, b, loose) => compare(a, b, loose) !== 0 +module.exports = neq diff --git a/deps/npm/node_modules/semver/functions/parse.js b/deps/npm/node_modules/semver/functions/parse.js new file mode 100644 index 00000000000000..457fee04a95c83 --- /dev/null +++ b/deps/npm/node_modules/semver/functions/parse.js @@ -0,0 +1,37 @@ +const {MAX_LENGTH} = require('../internal/constants') +const { re, t } = require('../internal/re') +const SemVer = require('../classes/semver') + +const parse = (version, options) => { + if (!options || typeof options !== 'object') { + options = { + loose: !!options, + includePrerelease: false + } + } + + if (version instanceof SemVer) { + return version + } + + if (typeof version !== 'string') { + return null + } + + if (version.length > MAX_LENGTH) { + return null + } + + const r = options.loose ? re[t.LOOSE] : re[t.FULL] + if (!r.test(version)) { + return null + } + + try { + return new SemVer(version, options) + } catch (er) { + return null + } +} + +module.exports = parse diff --git a/deps/npm/node_modules/semver/functions/patch.js b/deps/npm/node_modules/semver/functions/patch.js new file mode 100644 index 00000000000000..63afca2524fca9 --- /dev/null +++ b/deps/npm/node_modules/semver/functions/patch.js @@ -0,0 +1,3 @@ +const SemVer = require('../classes/semver') +const patch = (a, loose) => new SemVer(a, loose).patch +module.exports = patch diff --git a/deps/npm/node_modules/semver/functions/prerelease.js b/deps/npm/node_modules/semver/functions/prerelease.js new file mode 100644 index 00000000000000..06aa13248ae651 --- /dev/null +++ b/deps/npm/node_modules/semver/functions/prerelease.js @@ -0,0 +1,6 @@ +const parse = require('./parse') +const prerelease = (version, options) => { + const parsed = parse(version, options) + return (parsed && parsed.prerelease.length) ? parsed.prerelease : null +} +module.exports = prerelease diff --git a/deps/npm/node_modules/semver/functions/rcompare.js b/deps/npm/node_modules/semver/functions/rcompare.js new file mode 100644 index 00000000000000..0ac509e79dc8cf --- /dev/null +++ b/deps/npm/node_modules/semver/functions/rcompare.js @@ -0,0 +1,3 @@ +const compare = require('./compare') +const rcompare = (a, b, loose) => compare(b, a, loose) +module.exports = rcompare diff --git a/deps/npm/node_modules/semver/functions/rsort.js b/deps/npm/node_modules/semver/functions/rsort.js new file mode 100644 index 00000000000000..82404c5cfe0266 --- /dev/null +++ b/deps/npm/node_modules/semver/functions/rsort.js @@ -0,0 +1,3 @@ +const compareBuild = require('./compare-build') +const rsort = (list, loose) => list.sort((a, b) => compareBuild(b, a, loose)) +module.exports = rsort diff --git a/deps/npm/node_modules/semver/functions/satisfies.js b/deps/npm/node_modules/semver/functions/satisfies.js new file mode 100644 index 00000000000000..50af1c199b6cae --- /dev/null +++ b/deps/npm/node_modules/semver/functions/satisfies.js @@ -0,0 +1,10 @@ +const Range = require('../classes/range') +const satisfies = (version, range, options) => { + try { + range = new Range(range, options) + } catch (er) { + return false + } + return range.test(version) +} +module.exports = satisfies diff --git a/deps/npm/node_modules/semver/functions/sort.js b/deps/npm/node_modules/semver/functions/sort.js new file mode 100644 index 00000000000000..4d10917aba8e5a --- /dev/null +++ b/deps/npm/node_modules/semver/functions/sort.js @@ -0,0 +1,3 @@ +const compareBuild = require('./compare-build') +const sort = (list, loose) => list.sort((a, b) => compareBuild(a, b, loose)) +module.exports = sort diff --git a/deps/npm/node_modules/semver/functions/valid.js b/deps/npm/node_modules/semver/functions/valid.js new file mode 100644 index 00000000000000..f27bae10731c0c --- /dev/null +++ b/deps/npm/node_modules/semver/functions/valid.js @@ -0,0 +1,6 @@ +const parse = require('./parse') +const valid = (version, options) => { + const v = parse(version, options) + return v ? v.version : null +} +module.exports = valid diff --git a/deps/npm/node_modules/semver/index.js b/deps/npm/node_modules/semver/index.js new file mode 100644 index 00000000000000..57e2ae649479bc --- /dev/null +++ b/deps/npm/node_modules/semver/index.js @@ -0,0 +1,48 @@ +// just pre-load all the stuff that index.js lazily exports +const internalRe = require('./internal/re') +module.exports = { + re: internalRe.re, + src: internalRe.src, + tokens: internalRe.t, + SEMVER_SPEC_VERSION: require('./internal/constants').SEMVER_SPEC_VERSION, + SemVer: require('./classes/semver'), + compareIdentifiers: require('./internal/identifiers').compareIdentifiers, + rcompareIdentifiers: require('./internal/identifiers').rcompareIdentifiers, + parse: require('./functions/parse'), + valid: require('./functions/valid'), + clean: require('./functions/clean'), + inc: require('./functions/inc'), + diff: require('./functions/diff'), + major: require('./functions/major'), + minor: require('./functions/minor'), + patch: require('./functions/patch'), + prerelease: require('./functions/prerelease'), + compare: require('./functions/compare'), + rcompare: require('./functions/rcompare'), + compareLoose: require('./functions/compare-loose'), + compareBuild: require('./functions/compare-build'), + sort: require('./functions/sort'), + rsort: require('./functions/rsort'), + gt: require('./functions/gt'), + lt: require('./functions/lt'), + eq: require('./functions/eq'), + neq: require('./functions/neq'), + gte: require('./functions/gte'), + lte: require('./functions/lte'), + cmp: require('./functions/cmp'), + coerce: require('./functions/coerce'), + Comparator: require('./classes/comparator'), + Range: require('./classes/range'), + satisfies: require('./functions/satisfies'), + toComparators: require('./ranges/to-comparators'), + maxSatisfying: require('./ranges/max-satisfying'), + minSatisfying: require('./ranges/min-satisfying'), + minVersion: require('./ranges/min-version'), + validRange: require('./ranges/valid'), + outside: require('./ranges/outside'), + gtr: require('./ranges/gtr'), + ltr: require('./ranges/ltr'), + intersects: require('./ranges/intersects'), + simplifyRange: require('./ranges/simplify'), + subset: require('./ranges/subset'), +} diff --git a/deps/npm/node_modules/semver/internal/constants.js b/deps/npm/node_modules/semver/internal/constants.js new file mode 100644 index 00000000000000..49df215ad554da --- /dev/null +++ b/deps/npm/node_modules/semver/internal/constants.js @@ -0,0 +1,17 @@ +// Note: this is the semver.org version of the spec that it implements +// Not necessarily the package version of this code. +const SEMVER_SPEC_VERSION = '2.0.0' + +const MAX_LENGTH = 256 +const MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || + /* istanbul ignore next */ 9007199254740991 + +// Max safe segment length for coercion. +const MAX_SAFE_COMPONENT_LENGTH = 16 + +module.exports = { + SEMVER_SPEC_VERSION, + MAX_LENGTH, + MAX_SAFE_INTEGER, + MAX_SAFE_COMPONENT_LENGTH +} diff --git a/deps/npm/node_modules/semver/internal/debug.js b/deps/npm/node_modules/semver/internal/debug.js new file mode 100644 index 00000000000000..1c00e1369aa2a0 --- /dev/null +++ b/deps/npm/node_modules/semver/internal/debug.js @@ -0,0 +1,9 @@ +const debug = ( + typeof process === 'object' && + process.env && + process.env.NODE_DEBUG && + /\bsemver\b/i.test(process.env.NODE_DEBUG) +) ? (...args) => console.error('SEMVER', ...args) + : () => {} + +module.exports = debug diff --git a/deps/npm/node_modules/semver/internal/identifiers.js b/deps/npm/node_modules/semver/internal/identifiers.js new file mode 100644 index 00000000000000..ed130942175207 --- /dev/null +++ b/deps/npm/node_modules/semver/internal/identifiers.js @@ -0,0 +1,23 @@ +const numeric = /^[0-9]+$/ +const compareIdentifiers = (a, b) => { + const anum = numeric.test(a) + const bnum = numeric.test(b) + + if (anum && bnum) { + a = +a + b = +b + } + + return a === b ? 0 + : (anum && !bnum) ? -1 + : (bnum && !anum) ? 1 + : a < b ? -1 + : 1 +} + +const rcompareIdentifiers = (a, b) => compareIdentifiers(b, a) + +module.exports = { + compareIdentifiers, + rcompareIdentifiers +} diff --git a/deps/npm/node_modules/semver/internal/re.js b/deps/npm/node_modules/semver/internal/re.js new file mode 100644 index 00000000000000..54d4176deaf232 --- /dev/null +++ b/deps/npm/node_modules/semver/internal/re.js @@ -0,0 +1,182 @@ +const { MAX_SAFE_COMPONENT_LENGTH } = require('./constants') +const debug = require('./debug') +exports = module.exports = {} + +// The actual regexps go on exports.re +const re = exports.re = [] +const src = exports.src = [] +const t = exports.t = {} +let R = 0 + +const createToken = (name, value, isGlobal) => { + const index = R++ + debug(index, value) + t[name] = index + src[index] = value + re[index] = new RegExp(value, isGlobal ? 'g' : undefined) +} + +// The following Regular Expressions can be used for tokenizing, +// validating, and parsing SemVer version strings. + +// ## Numeric Identifier +// A single `0`, or a non-zero digit followed by zero or more digits. + +createToken('NUMERICIDENTIFIER', '0|[1-9]\\d*') +createToken('NUMERICIDENTIFIERLOOSE', '[0-9]+') + +// ## Non-numeric Identifier +// Zero or more digits, followed by a letter or hyphen, and then zero or +// more letters, digits, or hyphens. + +createToken('NONNUMERICIDENTIFIER', '\\d*[a-zA-Z-][a-zA-Z0-9-]*') + +// ## Main Version +// Three dot-separated numeric identifiers. + +createToken('MAINVERSION', `(${src[t.NUMERICIDENTIFIER]})\\.` + + `(${src[t.NUMERICIDENTIFIER]})\\.` + + `(${src[t.NUMERICIDENTIFIER]})`) + +createToken('MAINVERSIONLOOSE', `(${src[t.NUMERICIDENTIFIERLOOSE]})\\.` + + `(${src[t.NUMERICIDENTIFIERLOOSE]})\\.` + + `(${src[t.NUMERICIDENTIFIERLOOSE]})`) + +// ## Pre-release Version Identifier +// A numeric identifier, or a non-numeric identifier. + +createToken('PRERELEASEIDENTIFIER', `(?:${src[t.NUMERICIDENTIFIER] +}|${src[t.NONNUMERICIDENTIFIER]})`) + +createToken('PRERELEASEIDENTIFIERLOOSE', `(?:${src[t.NUMERICIDENTIFIERLOOSE] +}|${src[t.NONNUMERICIDENTIFIER]})`) + +// ## Pre-release Version +// Hyphen, followed by one or more dot-separated pre-release version +// identifiers. + +createToken('PRERELEASE', `(?:-(${src[t.PRERELEASEIDENTIFIER] +}(?:\\.${src[t.PRERELEASEIDENTIFIER]})*))`) + +createToken('PRERELEASELOOSE', `(?:-?(${src[t.PRERELEASEIDENTIFIERLOOSE] +}(?:\\.${src[t.PRERELEASEIDENTIFIERLOOSE]})*))`) + +// ## Build Metadata Identifier +// Any combination of digits, letters, or hyphens. + +createToken('BUILDIDENTIFIER', '[0-9A-Za-z-]+') + +// ## Build Metadata +// Plus sign, followed by one or more period-separated build metadata +// identifiers. + +createToken('BUILD', `(?:\\+(${src[t.BUILDIDENTIFIER] +}(?:\\.${src[t.BUILDIDENTIFIER]})*))`) + +// ## Full Version String +// A main version, followed optionally by a pre-release version and +// build metadata. + +// Note that the only major, minor, patch, and pre-release sections of +// the version string are capturing groups. The build metadata is not a +// capturing group, because it should not ever be used in version +// comparison. + +createToken('FULLPLAIN', `v?${src[t.MAINVERSION] +}${src[t.PRERELEASE]}?${ + src[t.BUILD]}?`) + +createToken('FULL', `^${src[t.FULLPLAIN]}$`) + +// like full, but allows v1.2.3 and =1.2.3, which people do sometimes. +// also, 1.0.0alpha1 (prerelease without the hyphen) which is pretty +// common in the npm registry. +createToken('LOOSEPLAIN', `[v=\\s]*${src[t.MAINVERSIONLOOSE] +}${src[t.PRERELEASELOOSE]}?${ + src[t.BUILD]}?`) + +createToken('LOOSE', `^${src[t.LOOSEPLAIN]}$`) + +createToken('GTLT', '((?:<|>)?=?)') + +// Something like "2.*" or "1.2.x". +// Note that "x.x" is a valid xRange identifer, meaning "any version" +// Only the first item is strictly required. +createToken('XRANGEIDENTIFIERLOOSE', `${src[t.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`) +createToken('XRANGEIDENTIFIER', `${src[t.NUMERICIDENTIFIER]}|x|X|\\*`) + +createToken('XRANGEPLAIN', `[v=\\s]*(${src[t.XRANGEIDENTIFIER]})` + + `(?:\\.(${src[t.XRANGEIDENTIFIER]})` + + `(?:\\.(${src[t.XRANGEIDENTIFIER]})` + + `(?:${src[t.PRERELEASE]})?${ + src[t.BUILD]}?` + + `)?)?`) + +createToken('XRANGEPLAINLOOSE', `[v=\\s]*(${src[t.XRANGEIDENTIFIERLOOSE]})` + + `(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})` + + `(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})` + + `(?:${src[t.PRERELEASELOOSE]})?${ + src[t.BUILD]}?` + + `)?)?`) + +createToken('XRANGE', `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAIN]}$`) +createToken('XRANGELOOSE', `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAINLOOSE]}$`) + +// Coercion. +// Extract anything that could conceivably be a part of a valid semver +createToken('COERCE', `${'(^|[^\\d])' + + '(\\d{1,'}${MAX_SAFE_COMPONENT_LENGTH}})` + + `(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?` + + `(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?` + + `(?:$|[^\\d])`) +createToken('COERCERTL', src[t.COERCE], true) + +// Tilde ranges. +// Meaning is "reasonably at or greater than" +createToken('LONETILDE', '(?:~>?)') + +createToken('TILDETRIM', `(\\s*)${src[t.LONETILDE]}\\s+`, true) +exports.tildeTrimReplace = '$1~' + +createToken('TILDE', `^${src[t.LONETILDE]}${src[t.XRANGEPLAIN]}$`) +createToken('TILDELOOSE', `^${src[t.LONETILDE]}${src[t.XRANGEPLAINLOOSE]}$`) + +// Caret ranges. +// Meaning is "at least and backwards compatible with" +createToken('LONECARET', '(?:\\^)') + +createToken('CARETTRIM', `(\\s*)${src[t.LONECARET]}\\s+`, true) +exports.caretTrimReplace = '$1^' + +createToken('CARET', `^${src[t.LONECARET]}${src[t.XRANGEPLAIN]}$`) +createToken('CARETLOOSE', `^${src[t.LONECARET]}${src[t.XRANGEPLAINLOOSE]}$`) + +// A simple gt/lt/eq thing, or just "" to indicate "any version" +createToken('COMPARATORLOOSE', `^${src[t.GTLT]}\\s*(${src[t.LOOSEPLAIN]})$|^$`) +createToken('COMPARATOR', `^${src[t.GTLT]}\\s*(${src[t.FULLPLAIN]})$|^$`) + +// An expression to strip any whitespace between the gtlt and the thing +// it modifies, so that `> 1.2.3` ==> `>1.2.3` +createToken('COMPARATORTRIM', `(\\s*)${src[t.GTLT] +}\\s*(${src[t.LOOSEPLAIN]}|${src[t.XRANGEPLAIN]})`, true) +exports.comparatorTrimReplace = '$1$2$3' + +// Something like `1.2.3 - 1.2.4` +// Note that these all use the loose form, because they'll be +// checked against either the strict or loose comparator form +// later. +createToken('HYPHENRANGE', `^\\s*(${src[t.XRANGEPLAIN]})` + + `\\s+-\\s+` + + `(${src[t.XRANGEPLAIN]})` + + `\\s*$`) + +createToken('HYPHENRANGELOOSE', `^\\s*(${src[t.XRANGEPLAINLOOSE]})` + + `\\s+-\\s+` + + `(${src[t.XRANGEPLAINLOOSE]})` + + `\\s*$`) + +// Star ranges basically just allow anything at all. +createToken('STAR', '(<|>)?=?\\s*\\*') +// >=0.0.0 is like a star +createToken('GTE0', '^\\s*>=\\s*0\.0\.0\\s*$') +createToken('GTE0PRE', '^\\s*>=\\s*0\.0\.0-0\\s*$') diff --git a/deps/npm/node_modules/semver/package.json b/deps/npm/node_modules/semver/package.json index 7c0576b7fe0a81..07867975d152ce 100644 --- a/deps/npm/node_modules/semver/package.json +++ b/deps/npm/node_modules/semver/package.json @@ -1,81 +1,38 @@ { - "_from": "semver@5.7.1", - "_id": "semver@5.7.1", - "_inBundle": false, - "_integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", - "_location": "/semver", - "_phantomChildren": {}, - "_requested": { - "type": "version", - "registry": true, - "raw": "semver@5.7.1", - "name": "semver", - "escapedName": "semver", - "rawSpec": "5.7.1", - "saveSpec": null, - "fetchSpec": "5.7.1" - }, - "_requiredBy": [ - "#USER", - "/", - "/caching-transform/make-dir", - "/cp-file/make-dir", - "/eslint", - "/eslint-plugin-node", - "/find-cache-dir/make-dir", - "/init-package-json", - "/istanbul-lib-report/make-dir", - "/istanbul-lib-source-maps/make-dir", - "/libnpmpublish", - "/lock-verify", - "/normalize-package-data", - "/npm-install-checks", - "/npm-package-arg", - "/npm-pick-manifest", - "/nyc/cross-spawn", - "/nyc/make-dir", - "/package-json", - "/pacote", - "/read-installed", - "/semver-diff" - ], - "_resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "_shasum": "a954f931aeba508d307bbf069eff0c01c96116f7", - "_spec": "semver@5.7.1", - "_where": "/Users/isaacs/dev/npm/cli", - "bin": { - "semver": "./bin/semver" - }, - "bugs": { - "url": "https://github.com/npm/node-semver/issues" - }, - "bundleDependencies": false, - "deprecated": false, + "name": "semver", + "version": "7.3.2", "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" + }, "devDependencies": { - "tap": "^13.0.0-rc.18" + "tap": "^14.10.7" + }, + "license": "ISC", + "repository": "https://github.com/npm/node-semver", + "bin": { + "semver": "./bin/semver.js" }, "files": [ - "bin", + "bin/**/*.js", "range.bnf", - "semver.js" + "classes/**/*.js", + "functions/**/*.js", + "internal/**/*.js", + "ranges/**/*.js", + "index.js", + "preload.js" ], - "homepage": "https://github.com/npm/node-semver#readme", - "license": "ISC", - "main": "semver.js", - "name": "semver", - "repository": { - "type": "git", - "url": "git+https://github.com/npm/node-semver.git" - }, - "scripts": { - "postpublish": "git push origin --all; git push origin --tags", - "postversion": "npm publish", - "preversion": "npm test", - "test": "tap" - }, "tap": { - "check-coverage": true + "check-coverage": true, + "coverage-map": "map.js" }, - "version": "5.7.1" + "engines": { + "node": ">=10" + } } diff --git a/deps/npm/node_modules/semver/preload.js b/deps/npm/node_modules/semver/preload.js new file mode 100644 index 00000000000000..947cd4f7917fff --- /dev/null +++ b/deps/npm/node_modules/semver/preload.js @@ -0,0 +1,2 @@ +// XXX remove in v8 or beyond +module.exports = require('./index.js') diff --git a/deps/npm/node_modules/semver/ranges/gtr.js b/deps/npm/node_modules/semver/ranges/gtr.js new file mode 100644 index 00000000000000..db7e35599dd566 --- /dev/null +++ b/deps/npm/node_modules/semver/ranges/gtr.js @@ -0,0 +1,4 @@ +// Determine if version is greater than all the versions possible in the range. +const outside = require('./outside') +const gtr = (version, range, options) => outside(version, range, '>', options) +module.exports = gtr diff --git a/deps/npm/node_modules/semver/ranges/intersects.js b/deps/npm/node_modules/semver/ranges/intersects.js new file mode 100644 index 00000000000000..3d1a6f31dfbe00 --- /dev/null +++ b/deps/npm/node_modules/semver/ranges/intersects.js @@ -0,0 +1,7 @@ +const Range = require('../classes/range') +const intersects = (r1, r2, options) => { + r1 = new Range(r1, options) + r2 = new Range(r2, options) + return r1.intersects(r2) +} +module.exports = intersects diff --git a/deps/npm/node_modules/semver/ranges/ltr.js b/deps/npm/node_modules/semver/ranges/ltr.js new file mode 100644 index 00000000000000..528a885ebdfcdb --- /dev/null +++ b/deps/npm/node_modules/semver/ranges/ltr.js @@ -0,0 +1,4 @@ +const outside = require('./outside') +// Determine if version is less than all the versions possible in the range +const ltr = (version, range, options) => outside(version, range, '<', options) +module.exports = ltr diff --git a/deps/npm/node_modules/semver/ranges/max-satisfying.js b/deps/npm/node_modules/semver/ranges/max-satisfying.js new file mode 100644 index 00000000000000..6e3d993c67860c --- /dev/null +++ b/deps/npm/node_modules/semver/ranges/max-satisfying.js @@ -0,0 +1,25 @@ +const SemVer = require('../classes/semver') +const Range = require('../classes/range') + +const maxSatisfying = (versions, range, options) => { + let max = null + let maxSV = null + let rangeObj = null + try { + rangeObj = new Range(range, options) + } catch (er) { + return null + } + versions.forEach((v) => { + if (rangeObj.test(v)) { + // satisfies(v, range, options) + if (!max || maxSV.compare(v) === -1) { + // compare(max, v, true) + max = v + maxSV = new SemVer(max, options) + } + } + }) + return max +} +module.exports = maxSatisfying diff --git a/deps/npm/node_modules/semver/ranges/min-satisfying.js b/deps/npm/node_modules/semver/ranges/min-satisfying.js new file mode 100644 index 00000000000000..9b60974e2253a0 --- /dev/null +++ b/deps/npm/node_modules/semver/ranges/min-satisfying.js @@ -0,0 +1,24 @@ +const SemVer = require('../classes/semver') +const Range = require('../classes/range') +const minSatisfying = (versions, range, options) => { + let min = null + let minSV = null + let rangeObj = null + try { + rangeObj = new Range(range, options) + } catch (er) { + return null + } + versions.forEach((v) => { + if (rangeObj.test(v)) { + // satisfies(v, range, options) + if (!min || minSV.compare(v) === 1) { + // compare(min, v, true) + min = v + minSV = new SemVer(min, options) + } + } + }) + return min +} +module.exports = minSatisfying diff --git a/deps/npm/node_modules/semver/ranges/min-version.js b/deps/npm/node_modules/semver/ranges/min-version.js new file mode 100644 index 00000000000000..7118d237bf5c41 --- /dev/null +++ b/deps/npm/node_modules/semver/ranges/min-version.js @@ -0,0 +1,57 @@ +const SemVer = require('../classes/semver') +const Range = require('../classes/range') +const gt = require('../functions/gt') + +const minVersion = (range, loose) => { + range = new Range(range, loose) + + let minver = new SemVer('0.0.0') + if (range.test(minver)) { + return minver + } + + minver = new SemVer('0.0.0-0') + if (range.test(minver)) { + return minver + } + + minver = null + for (let i = 0; i < range.set.length; ++i) { + const comparators = range.set[i] + + comparators.forEach((comparator) => { + // Clone to avoid manipulating the comparator's semver object. + const compver = new SemVer(comparator.semver.version) + switch (comparator.operator) { + case '>': + if (compver.prerelease.length === 0) { + compver.patch++ + } else { + compver.prerelease.push(0) + } + compver.raw = compver.format() + /* fallthrough */ + case '': + case '>=': + if (!minver || gt(minver, compver)) { + minver = compver + } + break + case '<': + case '<=': + /* Ignore maximum versions */ + break + /* istanbul ignore next */ + default: + throw new Error(`Unexpected operation: ${comparator.operator}`) + } + }) + } + + if (minver && range.test(minver)) { + return minver + } + + return null +} +module.exports = minVersion diff --git a/deps/npm/node_modules/semver/ranges/outside.js b/deps/npm/node_modules/semver/ranges/outside.js new file mode 100644 index 00000000000000..e35ed1176c84ed --- /dev/null +++ b/deps/npm/node_modules/semver/ranges/outside.js @@ -0,0 +1,80 @@ +const SemVer = require('../classes/semver') +const Comparator = require('../classes/comparator') +const {ANY} = Comparator +const Range = require('../classes/range') +const satisfies = require('../functions/satisfies') +const gt = require('../functions/gt') +const lt = require('../functions/lt') +const lte = require('../functions/lte') +const gte = require('../functions/gte') + +const outside = (version, range, hilo, options) => { + version = new SemVer(version, options) + range = new Range(range, options) + + let gtfn, ltefn, ltfn, comp, ecomp + switch (hilo) { + case '>': + gtfn = gt + ltefn = lte + ltfn = lt + comp = '>' + ecomp = '>=' + break + case '<': + gtfn = lt + ltefn = gte + ltfn = gt + comp = '<' + ecomp = '<=' + break + default: + throw new TypeError('Must provide a hilo val of "<" or ">"') + } + + // If it satisifes the range it is not outside + if (satisfies(version, range, options)) { + return false + } + + // From now on, variable terms are as if we're in "gtr" mode. + // but note that everything is flipped for the "ltr" function. + + for (let i = 0; i < range.set.length; ++i) { + const comparators = range.set[i] + + let high = null + let low = null + + comparators.forEach((comparator) => { + if (comparator.semver === ANY) { + comparator = new Comparator('>=0.0.0') + } + high = high || comparator + low = low || comparator + if (gtfn(comparator.semver, high.semver, options)) { + high = comparator + } else if (ltfn(comparator.semver, low.semver, options)) { + low = comparator + } + }) + + // If the edge version comparator has a operator then our version + // isn't outside it + if (high.operator === comp || high.operator === ecomp) { + return false + } + + // If the lowest version comparator has an operator and our version + // is less than it then it isn't higher than the range + if ((!low.operator || low.operator === comp) && + ltefn(version, low.semver)) { + return false + } else if (low.operator === ecomp && ltfn(version, low.semver)) { + return false + } + } + return true +} + +module.exports = outside diff --git a/deps/npm/node_modules/semver/ranges/simplify.js b/deps/npm/node_modules/semver/ranges/simplify.js new file mode 100644 index 00000000000000..b792f972964542 --- /dev/null +++ b/deps/npm/node_modules/semver/ranges/simplify.js @@ -0,0 +1,44 @@ +// given a set of versions and a range, create a "simplified" range +// that includes the same versions that the original range does +// If the original range is shorter than the simplified one, return that. +const satisfies = require('../functions/satisfies.js') +const compare = require('../functions/compare.js') +module.exports = (versions, range, options) => { + const set = [] + let min = null + let prev = null + const v = versions.sort((a, b) => compare(a, b, options)) + for (const version of v) { + const included = satisfies(version, range, options) + if (included) { + prev = version + if (!min) + min = version + } else { + if (prev) { + set.push([min, prev]) + } + prev = null + min = null + } + } + if (min) + set.push([min, null]) + + const ranges = [] + for (const [min, max] of set) { + if (min === max) + ranges.push(min) + else if (!max && min === v[0]) + ranges.push('*') + else if (!max) + ranges.push(`>=${min}`) + else if (min === v[0]) + ranges.push(`<=${max}`) + else + ranges.push(`${min} - ${max}`) + } + const simplified = ranges.join(' || ') + const original = typeof range.raw === 'string' ? range.raw : String(range) + return simplified.length < original.length ? simplified : range +} diff --git a/deps/npm/node_modules/semver/ranges/subset.js b/deps/npm/node_modules/semver/ranges/subset.js new file mode 100644 index 00000000000000..6ae29a3c92b892 --- /dev/null +++ b/deps/npm/node_modules/semver/ranges/subset.js @@ -0,0 +1,155 @@ +const Range = require('../classes/range.js') +const { ANY } = require('../classes/comparator.js') +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, ...` +// +// 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 +// - 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 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) +// - If EQ satisfies every C, return true +// - Else return false +// - If GT +// - If GT is lower than any > or >= comp in C, return false +// - If GT is >=, and GT.semver does not satisfy every C, return false +// - If LT +// - If LT.semver is greater than that of any > 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 +// - Else return true + +const subset = (sub, dom, options) => { + sub = new Range(sub, options) + dom = new Range(dom, options) + let sawNonNull = false + + OUTER: for (const simpleSub of sub.set) { + for (const simpleDom of dom.set) { + const isSub = simpleSubset(simpleSub, simpleDom, options) + sawNonNull = sawNonNull || isSub !== null + if (isSub) + continue OUTER + } + // the null set is a subset of everything, but null simple ranges in + // a complex range should be ignored. so if we saw a non-null range, + // then we know this isn't a subset, but if EVERY simple range was null, + // then it is a subset. + if (sawNonNull) + return false + } + return true +} + +const simpleSubset = (sub, dom, options) => { + if (sub.length === 1 && sub[0].semver === ANY) + return dom.length === 1 && dom[0].semver === ANY + + const eqSet = new Set() + let gt, lt + for (const c of sub) { + if (c.operator === '>' || c.operator === '>=') + gt = higherGT(gt, c, options) + else if (c.operator === '<' || c.operator === '<=') + lt = lowerLT(lt, c, options) + else + eqSet.add(c.semver) + } + + if (eqSet.size > 1) + return null + + let gtltComp + if (gt && lt) { + gtltComp = compare(gt.semver, lt.semver, options) + if (gtltComp > 0) + return null + else if (gtltComp === 0 && (gt.operator !== '>=' || lt.operator !== '<=')) + return null + } + + // will iterate one or zero times + for (const eq of eqSet) { + if (gt && !satisfies(eq, String(gt), options)) + return null + + if (lt && !satisfies(eq, String(lt), options)) + return null + + for (const c of dom) { + if (!satisfies(eq, String(c), options)) + return false + } + return true + } + + let higher, lower + let hasDomLT, hasDomGT + for (const c of dom) { + hasDomGT = hasDomGT || c.operator === '>' || c.operator === '>=' + hasDomLT = hasDomLT || c.operator === '<' || c.operator === '<=' + if (gt) { + if (c.operator === '>' || c.operator === '>=') { + higher = higherGT(gt, c, options) + if (higher === c) + return false + } else if (gt.operator === '>=' && !satisfies(gt.semver, String(c), options)) + return false + } + if (lt) { + if (c.operator === '<' || c.operator === '<=') { + lower = lowerLT(lt, c, options) + if (lower === c) + return false + } else if (lt.operator === '<=' && !satisfies(lt.semver, String(c), options)) + return false + } + if (!c.operator && (lt || gt) && gtltComp !== 0) + return false + } + + // if there was a < or >, and nothing in the dom, then must be false + // UNLESS it was limited by another range in the other direction. + // Eg, >1.0.0 <1.0.1 is still a subset of <2.0.0 + if (gt && hasDomLT && !lt && gtltComp !== 0) + return false + + if (lt && hasDomGT && !gt && gtltComp !== 0) + return false + + return true +} + +// >=1.2.3 is lower than >1.2.3 +const higherGT = (a, b, options) => { + if (!a) + return b + const comp = compare(a.semver, b.semver, options) + return comp > 0 ? a + : comp < 0 ? b + : b.operator === '>' && a.operator === '>=' ? b + : a +} + +// <=1.2.3 is higher than <1.2.3 +const lowerLT = (a, b, options) => { + if (!a) + return b + const comp = compare(a.semver, b.semver, options) + return comp < 0 ? a + : comp > 0 ? b + : b.operator === '<' && a.operator === '<=' ? b + : a +} + +module.exports = subset diff --git a/deps/npm/node_modules/semver/ranges/to-comparators.js b/deps/npm/node_modules/semver/ranges/to-comparators.js new file mode 100644 index 00000000000000..6c8bc7e6f15a40 --- /dev/null +++ b/deps/npm/node_modules/semver/ranges/to-comparators.js @@ -0,0 +1,8 @@ +const Range = require('../classes/range') + +// Mostly just for testing and legacy API reasons +const toComparators = (range, options) => + new Range(range, options).set + .map(comp => comp.map(c => c.value).join(' ').trim().split(' ')) + +module.exports = toComparators diff --git a/deps/npm/node_modules/semver/ranges/valid.js b/deps/npm/node_modules/semver/ranges/valid.js new file mode 100644 index 00000000000000..365f35689d358b --- /dev/null +++ b/deps/npm/node_modules/semver/ranges/valid.js @@ -0,0 +1,11 @@ +const Range = require('../classes/range') +const validRange = (range, options) => { + try { + // Return '*' instead of '' so that truthiness works. + // This will throw if it's invalid anyway + return new Range(range, options).range || '*' + } catch (er) { + return null + } +} +module.exports = validRange diff --git a/deps/npm/node_modules/set-blocking/package.json b/deps/npm/node_modules/set-blocking/package.json index 7517e7f615fd72..c082db72c6259d 100644 --- a/deps/npm/node_modules/set-blocking/package.json +++ b/deps/npm/node_modules/set-blocking/package.json @@ -1,38 +1,32 @@ { - "_from": "set-blocking@~2.0.0", - "_id": "set-blocking@2.0.0", - "_inBundle": false, - "_integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=", - "_location": "/set-blocking", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "set-blocking@~2.0.0", - "name": "set-blocking", - "escapedName": "set-blocking", - "rawSpec": "~2.0.0", - "saveSpec": null, - "fetchSpec": "~2.0.0" + "name": "set-blocking", + "version": "2.0.0", + "description": "set blocking stdio and stderr ensuring that terminal output does not truncate", + "main": "index.js", + "scripts": { + "pretest": "standard", + "test": "nyc mocha ./test/*.js", + "coverage": "nyc report --reporter=text-lcov | coveralls", + "version": "standard-version" }, - "_requiredBy": [ - "/npmlog", - "/yargs" - ], - "_resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", - "_shasum": "045f9782d011ae9a6803ddd382b24392b3d890f7", - "_spec": "set-blocking@~2.0.0", - "_where": "/Users/rebecca/code/npm/node_modules/npmlog", - "author": { - "name": "Ben Coe", - "email": "ben@npmjs.com" + "repository": { + "type": "git", + "url": "git+https://github.com/yargs/set-blocking.git" }, + "keywords": [ + "flush", + "terminal", + "blocking", + "shim", + "stdio", + "stderr" + ], + "author": "Ben Coe ", + "license": "ISC", "bugs": { "url": "https://github.com/yargs/set-blocking/issues" }, - "bundleDependencies": false, - "deprecated": false, - "description": "set blocking stdio and stderr ensuring that terminal output does not truncate", + "homepage": "https://github.com/yargs/set-blocking#readme", "devDependencies": { "chai": "^3.5.0", "coveralls": "^2.11.9", @@ -44,28 +38,5 @@ "files": [ "index.js", "LICENSE.txt" - ], - "homepage": "https://github.com/yargs/set-blocking#readme", - "keywords": [ - "flush", - "terminal", - "blocking", - "shim", - "stdio", - "stderr" - ], - "license": "ISC", - "main": "index.js", - "name": "set-blocking", - "repository": { - "type": "git", - "url": "git+https://github.com/yargs/set-blocking.git" - }, - "scripts": { - "coverage": "nyc report --reporter=text-lcov | coveralls", - "pretest": "standard", - "test": "nyc mocha ./test/*.js", - "version": "standard-version" - }, - "version": "2.0.0" -} + ] +} \ No newline at end of file diff --git a/deps/npm/node_modules/sha/LICENSE b/deps/npm/node_modules/sha/LICENSE deleted file mode 100644 index 048a6f99d223f0..00000000000000 --- a/deps/npm/node_modules/sha/LICENSE +++ /dev/null @@ -1,46 +0,0 @@ -Copyright (c) 2013 Forbes Lindesay - -The BSD License - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS -BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR -BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE -OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN -IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -The MIT License (MIT) - -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/deps/npm/node_modules/sha/README.md b/deps/npm/node_modules/sha/README.md deleted file mode 100644 index 43742bf4797926..00000000000000 --- a/deps/npm/node_modules/sha/README.md +++ /dev/null @@ -1,49 +0,0 @@ -# sha - -Check and get file hashes (using any algorithm) - -[![Build Status](https://img.shields.io/travis/ForbesLindesay/sha/master.svg)](https://travis-ci.org/ForbesLindesay/sha) -[![Dependency Status](https://img.shields.io/david/ForbesLindesay/sha.svg)](https://david-dm.org/ForbesLindesay/sha) -[![NPM version](https://img.shields.io/npm/v/sha.svg)](https://www.npmjs.com/package/sha) - -## Installation - - $ npm install sha - -## API - -### check(fileName, expected, [options,] cb) / checkSync(filename, expected, [options]) - -Asynchronously check that `fileName` has a "hash" of `expected`. The callback will be called with either `null` or an error (indicating that they did not match). - -Options: - -- algorithm: defaults to `sha1` and can be any of the algorithms supported by `crypto.createHash` - -### get(fileName, [options,] cb) / getSync(filename, [options]) - -Asynchronously get the "hash" of `fileName`. The callback will be called with an optional `error` object and the (lower cased) hex digest of the hash. - -Options: - -- algorithm: defaults to `sha1` and can be any of the algorithms supported by `crypto.createHash` - -### stream(expected, [options]) - -Check the hash of a stream without ever buffering it. This is a pass through stream so you can do things like: - -```js -fs.createReadStream('src') - .pipe(sha.stream('expected')) - .pipe(fs.createWriteStream('dest')) -``` - -`dest` will be a complete copy of `src` and an error will be emitted if the hash did not match `'expected'`. - -Options: - -- algorithm: defaults to `sha1` and can be any of the algorithms supported by `crypto.createHash` - -## License - -You may use this software under the BSD or MIT. Take your pick. If you want me to release it under another license, open a pull request. \ No newline at end of file diff --git a/deps/npm/node_modules/sha/index.js b/deps/npm/node_modules/sha/index.js deleted file mode 100644 index 3aed3e9ccf190a..00000000000000 --- a/deps/npm/node_modules/sha/index.js +++ /dev/null @@ -1,107 +0,0 @@ -'use strict' - -var Transform = require('stream').Transform -var crypto = require('crypto') -var fs = require('graceful-fs') - -exports.check = check -exports.checkSync = checkSync -exports.get = get -exports.getSync = getSync -exports.stream = stream - -function check(file, expected, options, cb) { - if (typeof options === 'function') { - cb = options - options = undefined - } - expected = expected.toLowerCase().trim() - get(file, options, function (er, actual) { - if (er) { - if (er.message) er.message += ' while getting shasum for ' + file - return cb(er) - } - if (actual === expected) return cb(null) - cb(new Error( - 'shasum check failed for ' + file + '\n' - + 'Expected: ' + expected + '\n' - + 'Actual: ' + actual)) - }) -} -function checkSync(file, expected, options) { - expected = expected.toLowerCase().trim() - var actual - try { - actual = getSync(file, options) - } catch (er) { - if (er.message) er.message += ' while getting shasum for ' + file - throw er - } - if (actual !== expected) { - var ex = new Error( - 'shasum check failed for ' + file + '\n' - + 'Expected: ' + expected + '\n' - + 'Actual: ' + actual) - throw ex - } -} - - -function get(file, options, cb) { - if (typeof options === 'function') { - cb = options - options = undefined - } - options = options || {} - var algorithm = options.algorithm || 'sha1' - var hash = crypto.createHash(algorithm) - var source = fs.createReadStream(file) - var errState = null - source - .on('error', function (er) { - if (errState) return - return cb(errState = er) - }) - .on('data', function (chunk) { - if (errState) return - hash.update(chunk) - }) - .on('end', function () { - if (errState) return - var actual = hash.digest("hex").toLowerCase().trim() - cb(null, actual) - }) -} - -function getSync(file, options) { - options = options || {} - var algorithm = options.algorithm || 'sha1' - var hash = crypto.createHash(algorithm) - var source = fs.readFileSync(file) - hash.update(source) - return hash.digest("hex").toLowerCase().trim() -} - -function stream(expected, options) { - expected = expected.toLowerCase().trim() - options = options || {} - var algorithm = options.algorithm || 'sha1' - var hash = crypto.createHash(algorithm) - - var stream = new Transform() - stream._transform = function (chunk, encoding, callback) { - hash.update(chunk) - stream.push(chunk) - callback() - } - stream._flush = function (cb) { - var actual = hash.digest("hex").toLowerCase().trim() - if (actual === expected) return cb(null) - cb(new Error( - 'shasum check failed for:\n' - + ' Expected: ' + expected + '\n' - + ' Actual: ' + actual)) - this.push(null) - } - return stream -} \ No newline at end of file diff --git a/deps/npm/node_modules/sha/package.json b/deps/npm/node_modules/sha/package.json deleted file mode 100644 index 43b78423286e91..00000000000000 --- a/deps/npm/node_modules/sha/package.json +++ /dev/null @@ -1,52 +0,0 @@ -{ - "_from": "sha@3.0.0", - "_id": "sha@3.0.0", - "_inBundle": false, - "_integrity": "sha512-DOYnM37cNsLNSGIG/zZWch5CKIRNoLdYUQTQlcgkRkoYIUwDYjqDyye16YcDZg/OPdcbUgTKMjc4SY6TB7ZAPw==", - "_location": "/sha", - "_phantomChildren": {}, - "_requested": { - "type": "version", - "registry": true, - "raw": "sha@3.0.0", - "name": "sha", - "escapedName": "sha", - "rawSpec": "3.0.0", - "saveSpec": null, - "fetchSpec": "3.0.0" - }, - "_requiredBy": [ - "#USER", - "/" - ], - "_resolved": "https://registry.npmjs.org/sha/-/sha-3.0.0.tgz", - "_shasum": "b2f2f90af690c16a3a839a6a6c680ea51fedd1ae", - "_spec": "sha@3.0.0", - "_where": "/Users/aeschright/code/cli", - "bugs": { - "url": "https://github.com/ForbesLindesay/sha/issues" - }, - "bundleDependencies": false, - "dependencies": { - "graceful-fs": "^4.1.2" - }, - "deprecated": false, - "description": "Check and get file hashes", - "devDependencies": { - "mocha": "~1.9.0" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/ForbesLindesay/sha#readme", - "license": "(BSD-2-Clause OR MIT)", - "name": "sha", - "repository": { - "type": "git", - "url": "git+https://github.com/ForbesLindesay/sha.git" - }, - "scripts": { - "test": "mocha -R spec" - }, - "version": "3.0.0" -} diff --git a/deps/npm/node_modules/shebang-command/index.js b/deps/npm/node_modules/shebang-command/index.js deleted file mode 100644 index 2de70b0742665d..00000000000000 --- a/deps/npm/node_modules/shebang-command/index.js +++ /dev/null @@ -1,19 +0,0 @@ -'use strict'; -var shebangRegex = require('shebang-regex'); - -module.exports = function (str) { - var match = str.match(shebangRegex); - - if (!match) { - return null; - } - - var arr = match[0].replace(/#! ?/, '').split(' '); - var bin = arr[0].split('/').pop(); - var arg = arr[1]; - - return (bin === 'env' ? - arg : - bin + (arg ? ' ' + arg : '') - ); -}; diff --git a/deps/npm/node_modules/shebang-command/license b/deps/npm/node_modules/shebang-command/license deleted file mode 100644 index 0f8cf79c3c93ad..00000000000000 --- a/deps/npm/node_modules/shebang-command/license +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) Kevin Martensson (github.com/kevva) - -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/shebang-command/package.json b/deps/npm/node_modules/shebang-command/package.json deleted file mode 100644 index ca7a16a3e63494..00000000000000 --- a/deps/npm/node_modules/shebang-command/package.json +++ /dev/null @@ -1,71 +0,0 @@ -{ - "_from": "shebang-command@^1.2.0", - "_id": "shebang-command@1.2.0", - "_inBundle": false, - "_integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=", - "_location": "/shebang-command", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "shebang-command@^1.2.0", - "name": "shebang-command", - "escapedName": "shebang-command", - "rawSpec": "^1.2.0", - "saveSpec": null, - "fetchSpec": "^1.2.0" - }, - "_requiredBy": [ - "/cross-spawn" - ], - "_resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", - "_shasum": "44aac65b695b03398968c39f363fee5deafdf1ea", - "_spec": "shebang-command@^1.2.0", - "_where": "/Users/rebecca/code/npm/node_modules/cross-spawn", - "author": { - "name": "Kevin Martensson", - "email": "kevinmartensson@gmail.com", - "url": "github.com/kevva" - }, - "bugs": { - "url": "https://github.com/kevva/shebang-command/issues" - }, - "bundleDependencies": false, - "dependencies": { - "shebang-regex": "^1.0.0" - }, - "deprecated": false, - "description": "Get the command from a shebang", - "devDependencies": { - "ava": "*", - "xo": "*" - }, - "engines": { - "node": ">=0.10.0" - }, - "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": "1.2.0", - "xo": { - "ignores": [ - "test.js" - ] - } -} diff --git a/deps/npm/node_modules/shebang-command/readme.md b/deps/npm/node_modules/shebang-command/readme.md deleted file mode 100644 index 16b0be4d7d09fa..00000000000000 --- a/deps/npm/node_modules/shebang-command/readme.md +++ /dev/null @@ -1,39 +0,0 @@ -# shebang-command [![Build Status](https://travis-ci.org/kevva/shebang-command.svg?branch=master)](https://travis-ci.org/kevva/shebang-command) - -> Get the command from a shebang - - -## Install - -``` -$ npm install --save shebang-command -``` - - -## Usage - -```js -const shebangCommand = require('shebang-command'); - -shebangCommand('#!/usr/bin/env node'); -//=> 'node' - -shebangCommand('#!/bin/bash'); -//=> 'bash' -``` - - -## API - -### shebangCommand(string) - -#### string - -Type: `string` - -String containing a shebang. - - -## License - -MIT © [Kevin Martensson](http://github.com/kevva) diff --git a/deps/npm/node_modules/shebang-regex/index.js b/deps/npm/node_modules/shebang-regex/index.js deleted file mode 100644 index d052d2e05e60c7..00000000000000 --- a/deps/npm/node_modules/shebang-regex/index.js +++ /dev/null @@ -1,2 +0,0 @@ -'use strict'; -module.exports = /^#!.*/; diff --git a/deps/npm/node_modules/shebang-regex/license b/deps/npm/node_modules/shebang-regex/license deleted file mode 100644 index 654d0bfe943437..00000000000000 --- a/deps/npm/node_modules/shebang-regex/license +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -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/deps/npm/node_modules/shebang-regex/package.json b/deps/npm/node_modules/shebang-regex/package.json deleted file mode 100644 index 3dd6ea1f39a590..00000000000000 --- a/deps/npm/node_modules/shebang-regex/package.json +++ /dev/null @@ -1,64 +0,0 @@ -{ - "_from": "shebang-regex@^1.0.0", - "_id": "shebang-regex@1.0.0", - "_inBundle": false, - "_integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=", - "_location": "/shebang-regex", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "shebang-regex@^1.0.0", - "name": "shebang-regex", - "escapedName": "shebang-regex", - "rawSpec": "^1.0.0", - "saveSpec": null, - "fetchSpec": "^1.0.0" - }, - "_requiredBy": [ - "/shebang-command" - ], - "_resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", - "_shasum": "da42f49740c0b42db2ca9728571cb190c98efea3", - "_spec": "shebang-regex@^1.0.0", - "_where": "/Users/rebecca/code/npm/node_modules/shebang-command", - "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", - "devDependencies": { - "ava": "0.0.4" - }, - "engines": { - "node": ">=0.10.0" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/sindresorhus/shebang-regex#readme", - "keywords": [ - "re", - "regex", - "regexp", - "shebang", - "match", - "test" - ], - "license": "MIT", - "name": "shebang-regex", - "repository": { - "type": "git", - "url": "git+https://github.com/sindresorhus/shebang-regex.git" - }, - "scripts": { - "test": "node test.js" - }, - "version": "1.0.0" -} diff --git a/deps/npm/node_modules/shebang-regex/readme.md b/deps/npm/node_modules/shebang-regex/readme.md deleted file mode 100644 index ef75e51b5bf0fe..00000000000000 --- a/deps/npm/node_modules/shebang-regex/readme.md +++ /dev/null @@ -1,29 +0,0 @@ -# shebang-regex [![Build Status](https://travis-ci.org/sindresorhus/shebang-regex.svg?branch=master)](https://travis-ci.org/sindresorhus/shebang-regex) - -> Regular expression for matching a [shebang](https://en.wikipedia.org/wiki/Shebang_(Unix)) - - -## Install - -``` -$ npm install --save shebang-regex -``` - - -## Usage - -```js -var shebangRegex = require('shebang-regex'); -var str = '#!/usr/bin/env node\nconsole.log("unicorns");'; - -shebangRegex.test(str); -//=> true - -shebangRegex.exec(str)[0]; -//=> '#!/usr/bin/env node' -``` - - -## License - -MIT © [Sindre Sorhus](http://sindresorhus.com) diff --git a/deps/npm/node_modules/signal-exit/CHANGELOG.md b/deps/npm/node_modules/signal-exit/CHANGELOG.md index e2f70d22503634..ed104f41bb71b6 100644 --- a/deps/npm/node_modules/signal-exit/CHANGELOG.md +++ b/deps/npm/node_modules/signal-exit/CHANGELOG.md @@ -1,7 +1,15 @@ -# Change Log +# 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. +### [3.0.3](https://github.com/tapjs/signal-exit/compare/v3.0.2...v3.0.3) (2020-03-26) + + +### Bug Fixes + +* patch `SIGHUP` to `SIGINT` when on Windows ([cfd1046](https://github.com/tapjs/signal-exit/commit/cfd1046079af4f0e44f93c69c237a09de8c23ef2)) +* **ci:** use Travis for Windows builds ([007add7](https://github.com/tapjs/signal-exit/commit/007add793d2b5ae3c382512103adbf321768a0b8)) + ## [3.0.1](https://github.com/tapjs/signal-exit/compare/v3.0.0...v3.0.1) (2016-09-08) diff --git a/deps/npm/node_modules/signal-exit/README.md b/deps/npm/node_modules/signal-exit/README.md index 8ebccabecaea4c..9f8eb5917dc790 100644 --- a/deps/npm/node_modules/signal-exit/README.md +++ b/deps/npm/node_modules/signal-exit/README.md @@ -3,7 +3,6 @@ [![Build Status](https://travis-ci.org/tapjs/signal-exit.png)](https://travis-ci.org/tapjs/signal-exit) [![Coverage](https://coveralls.io/repos/tapjs/signal-exit/badge.svg?branch=master)](https://coveralls.io/r/tapjs/signal-exit?branch=master) [![NPM version](https://img.shields.io/npm/v/signal-exit.svg)](https://www.npmjs.com/package/signal-exit) -[![Windows Tests](https://img.shields.io/appveyor/ci/bcoe/signal-exit/master.svg?label=Windows%20Tests)](https://ci.appveyor.com/project/bcoe/signal-exit) [![Standard Version](https://img.shields.io/badge/release-standard%20version-brightgreen.svg)](https://github.com/conventional-changelog/standard-version) When you want to fire an event no matter how a process exits: diff --git a/deps/npm/node_modules/signal-exit/index.js b/deps/npm/node_modules/signal-exit/index.js index 337f691ed23b1c..6b6c43acadd48c 100644 --- a/deps/npm/node_modules/signal-exit/index.js +++ b/deps/npm/node_modules/signal-exit/index.js @@ -3,6 +3,7 @@ // ignored, since we can never get coverage for them. var assert = require('assert') var signals = require('./signals.js') +var isWin = /^win/i.test(process.platform) var EE = require('events') /* istanbul ignore if */ @@ -92,6 +93,11 @@ signals.forEach(function (sig) { /* istanbul ignore next */ emit('afterexit', null, sig) /* istanbul ignore next */ + if (isWin && sig === 'SIGHUP') { + // "SIGHUP" throws an `ENOSYS` error on Windows, + // so use a supported signal instead + sig = 'SIGINT' + } process.kill(process.pid, sig) } } diff --git a/deps/npm/node_modules/signal-exit/package.json b/deps/npm/node_modules/signal-exit/package.json index 50d5591490cb02..59b0ac126d39bb 100644 --- a/deps/npm/node_modules/signal-exit/package.json +++ b/deps/npm/node_modules/signal-exit/package.json @@ -1,72 +1,38 @@ { - "_from": "signal-exit@^3.0.2", - "_id": "signal-exit@3.0.2", - "_inBundle": false, - "_integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=", - "_location": "/signal-exit", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "signal-exit@^3.0.2", - "name": "signal-exit", - "escapedName": "signal-exit", - "rawSpec": "^3.0.2", - "saveSpec": null, - "fetchSpec": "^3.0.2" - }, - "_requiredBy": [ - "/execa", - "/foreground-child", - "/gauge", - "/lockfile", - "/restore-cursor", - "/tap", - "/write-file-atomic" - ], - "_resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz", - "_shasum": "b5fdc08f1287ea1178628e415e25132b73646c6d", - "_spec": "signal-exit@^3.0.2", - "_where": "/Users/rebecca/code/npm/node_modules/write-file-atomic", - "author": { - "name": "Ben Coe", - "email": "ben@npmjs.com" - }, - "bugs": { - "url": "https://github.com/tapjs/signal-exit/issues" - }, - "bundleDependencies": false, - "deprecated": false, + "name": "signal-exit", + "version": "3.0.3", "description": "when you want to fire an event no matter how a process exits.", - "devDependencies": { - "chai": "^3.5.0", - "coveralls": "^2.11.10", - "nyc": "^8.1.0", - "standard": "^7.1.2", - "standard-version": "^2.3.0", - "tap": "^8.0.1" + "main": "index.js", + "scripts": { + "pretest": "standard", + "test": "tap --timeout=240 ./test/*.js --cov", + "coverage": "nyc report --reporter=text-lcov | coveralls", + "release": "standard-version" }, "files": [ "index.js", "signals.js" ], - "homepage": "https://github.com/tapjs/signal-exit", + "repository": { + "type": "git", + "url": "https://github.com/tapjs/signal-exit.git" + }, "keywords": [ "signal", "exit" ], + "author": "Ben Coe ", "license": "ISC", - "main": "index.js", - "name": "signal-exit", - "repository": { - "type": "git", - "url": "git+https://github.com/tapjs/signal-exit.git" - }, - "scripts": { - "coverage": "nyc report --reporter=text-lcov | coveralls", - "pretest": "standard", - "release": "standard-version", - "test": "tap --timeout=240 ./test/*.js --cov" + "bugs": { + "url": "https://github.com/tapjs/signal-exit/issues" }, - "version": "3.0.2" + "homepage": "https://github.com/tapjs/signal-exit", + "devDependencies": { + "chai": "^3.5.0", + "coveralls": "^2.11.10", + "nyc": "^8.1.0", + "standard": "^8.1.0", + "standard-version": "^2.3.0", + "tap": "^8.0.1" + } } diff --git a/deps/npm/node_modules/slide/README.md b/deps/npm/node_modules/slide/README.md deleted file mode 100644 index 59ad738bca2e50..00000000000000 --- a/deps/npm/node_modules/slide/README.md +++ /dev/null @@ -1,143 +0,0 @@ -# Controlling Flow: callbacks are easy - -## What's actually hard? - -- Doing a bunch of things in a specific order. -- Knowing when stuff is done. -- Handling failures. -- Breaking up functionality into parts (avoid nested inline callbacks) - - -## Common Mistakes - -- Abandoning convention and consistency. -- Putting all callbacks inline. -- Using libraries without grokking them. -- Trying to make async code look sync. - -## Define Conventions - -- Two kinds of functions: *actors* take action, *callbacks* get results. -- Essentially the continuation pattern. Resulting code *looks* similar - to fibers, but is *much* simpler to implement. -- Node works this way in the lowlevel APIs already, and it's very flexible. - -## Callbacks - -- Simple responders -- Must always be prepared to handle errors, that's why it's the first argument. -- Often inline anonymous, but not always. -- Can trap and call other callbacks with modified data, or pass errors upwards. - -## Actors - -- Last argument is a callback. -- If any error occurs, and can't be handled, pass it to the callback and return. -- Must not throw. Return value ignored. -- return x ==> return cb(null, x) -- throw er ==> return cb(er) - -```javascript -// return true if a path is either -// a symlink or a directory. -function isLinkOrDir (path, cb) { - fs.lstat(path, function (er, s) { - if (er) return cb(er) - return cb(null, s.isDirectory() || s.isSymbolicLink()) - }) -} -``` - -# asyncMap - -## Usecases - -- I have a list of 10 files, and need to read all of them, and then continue when they're all done. -- I have a dozen URLs, and need to fetch them all, and then continue when they're all done. -- I have 4 connected users, and need to send a message to all of them, and then continue when that's done. -- I have a list of n things, and I need to dosomething with all of them, in parallel, and get the results once they're all complete. - - -## Solution - -```javascript -var asyncMap = require("slide").asyncMap -function writeFiles (files, what, cb) { - asyncMap(files, function (f, cb) { - fs.writeFile(f, what, cb) - }, cb) -} -writeFiles([my, file, list], "foo", cb) -``` - -# chain - -## Usecases - -- I have to do a bunch of things, in order. Get db credentials out of a file, - read the data from the db, write that data to another file. -- If anything fails, do not continue. -- I still have to provide an array of functions, which is a lot of boilerplate, - and a pita if your functions take args like - -```javascript -function (cb) { - blah(a, b, c, cb) -} -``` - -- Results are discarded, which is a bit lame. -- No way to branch. - -## Solution - -- reduces boilerplate by converting an array of [fn, args] to an actor - that takes no arguments (except cb) -- A bit like Function#bind, but tailored for our use-case. -- bindActor(obj, "method", a, b, c) -- bindActor(fn, a, b, c) -- bindActor(obj, fn, a, b, c) -- branching, skipping over falsey arguments - -```javascript -chain([ - doThing && [thing, a, b, c] -, isFoo && [doFoo, "foo"] -, subChain && [chain, [one, two]] -], cb) -``` - -- tracking results: results are stored in an optional array passed as argument, - last result is always in results[results.length - 1]. -- treat chain.first and chain.last as placeholders for the first/last - result up until that point. - - -## Non-trivial example - -- Read number files in a directory -- Add the results together -- Ping a web service with the result -- Write the response to a file -- Delete the number files - -```javascript -var chain = require("slide").chain -function myProgram (cb) { - var res = [], last = chain.last, first = chain.first - chain([ - [fs, "readdir", "the-directory"] - , [readFiles, "the-directory", last] - , [sum, last] - , [ping, "POST", "example.com", 80, "/foo", last] - , [fs, "writeFile", "result.txt", last] - , [rmFiles, "./the-directory", first] - ], res, cb) -} -``` - -# Conclusion: Convention Profits - -- Consistent API from top to bottom. -- Sneak in at any point to inject functionality. Testable, reusable, ... -- When ruby and python users whine, you can smile condescendingly. diff --git a/deps/npm/node_modules/slide/index.js b/deps/npm/node_modules/slide/index.js deleted file mode 100644 index 0a9277f6eef52a..00000000000000 --- a/deps/npm/node_modules/slide/index.js +++ /dev/null @@ -1 +0,0 @@ -module.exports=require("./lib/slide") diff --git a/deps/npm/node_modules/slide/lib/async-map-ordered.js b/deps/npm/node_modules/slide/lib/async-map-ordered.js deleted file mode 100644 index 5cca79a82c330b..00000000000000 --- a/deps/npm/node_modules/slide/lib/async-map-ordered.js +++ /dev/null @@ -1,65 +0,0 @@ - -throw new Error("TODO: Not yet implemented.") - -/* -usage: - -Like asyncMap, but only can take a single cb, and guarantees -the order of the results. -*/ - -module.exports = asyncMapOrdered - -function asyncMapOrdered (list, fn, cb_) { - if (typeof cb_ !== "function") throw new Error( - "No callback provided to asyncMapOrdered") - - if (typeof fn !== "function") throw new Error( - "No map function provided to asyncMapOrdered") - - if (list === undefined || list === null) return cb_(null, []) - if (!Array.isArray(list)) list = [list] - if (!list.length) return cb_(null, []) - - var errState = null - , l = list.length - , a = l - , res = [] - , resCount = 0 - , maxArgLen = 0 - - function cb (index) { return function () { - if (errState) return - var er = arguments[0] - var argLen = arguments.length - maxArgLen = Math.max(maxArgLen, argLen) - res[index] = argLen === 1 ? [er] : Array.apply(null, arguments) - - // see if any new things have been added. - if (list.length > l) { - var newList = list.slice(l) - a += (list.length - l) - var oldLen = l - l = list.length - process.nextTick(function () { - newList.forEach(function (ar, i) { fn(ar, cb(i + oldLen)) }) - }) - } - - if (er || --a === 0) { - errState = er - cb_.apply(null, [errState].concat(flip(res, resCount, maxArgLen))) - } - }} - // expect the supplied cb function to be called - // "n" times for each thing in the array. - list.forEach(function (ar) { - steps.forEach(function (fn, i) { fn(ar, cb(i)) }) - }) -} - -function flip (res, resCount, argLen) { - var flat = [] - // res = [[er, x, y], [er, x1, y1], [er, x2, y2, z2]] - // return [[x, x1, x2], [y, y1, y2], [undefined, undefined, z2]] - diff --git a/deps/npm/node_modules/slide/lib/async-map.js b/deps/npm/node_modules/slide/lib/async-map.js deleted file mode 100644 index ccf345f3c7815e..00000000000000 --- a/deps/npm/node_modules/slide/lib/async-map.js +++ /dev/null @@ -1,54 +0,0 @@ - -/* -usage: - -// do something to a list of things -asyncMap(myListOfStuff, function (thing, cb) { doSomething(thing.foo, cb) }, cb) -// do more than one thing to each item -asyncMap(list, fooFn, barFn, cb) - -*/ - -module.exports = asyncMap - -function asyncMap () { - var steps = Array.prototype.slice.call(arguments) - , list = steps.shift() || [] - , cb_ = steps.pop() - if (typeof cb_ !== "function") throw new Error( - "No callback provided to asyncMap") - if (!list) return cb_(null, []) - if (!Array.isArray(list)) list = [list] - var n = steps.length - , data = [] // 2d array - , errState = null - , l = list.length - , a = l * n - if (!a) return cb_(null, []) - function cb (er) { - if (er && !errState) errState = er - - var argLen = arguments.length - for (var i = 1; i < argLen; i ++) if (arguments[i] !== undefined) { - data[i - 1] = (data[i - 1] || []).concat(arguments[i]) - } - // see if any new things have been added. - if (list.length > l) { - var newList = list.slice(l) - a += (list.length - l) * n - l = list.length - process.nextTick(function () { - newList.forEach(function (ar) { - steps.forEach(function (fn) { fn(ar, cb) }) - }) - }) - } - - if (--a === 0) cb_.apply(null, [errState].concat(data)) - } - // expect the supplied cb function to be called - // "n" times for each thing in the array. - list.forEach(function (ar) { - steps.forEach(function (fn) { fn(ar, cb) }) - }) -} diff --git a/deps/npm/node_modules/slide/lib/bind-actor.js b/deps/npm/node_modules/slide/lib/bind-actor.js deleted file mode 100644 index 6a370727494a3d..00000000000000 --- a/deps/npm/node_modules/slide/lib/bind-actor.js +++ /dev/null @@ -1,16 +0,0 @@ -module.exports = bindActor -function bindActor () { - var args = - Array.prototype.slice.call - (arguments) // jswtf. - , obj = null - , fn - if (typeof args[0] === "object") { - obj = args.shift() - fn = args.shift() - if (typeof fn === "string") - fn = obj[ fn ] - } else fn = args.shift() - return function (cb) { - fn.apply(obj, args.concat(cb)) } -} diff --git a/deps/npm/node_modules/slide/lib/chain.js b/deps/npm/node_modules/slide/lib/chain.js deleted file mode 100644 index 17b37114940b92..00000000000000 --- a/deps/npm/node_modules/slide/lib/chain.js +++ /dev/null @@ -1,20 +0,0 @@ -module.exports = chain -var bindActor = require("./bind-actor.js") -chain.first = {} ; chain.last = {} -function chain (things, cb) { - var res = [] - ;(function LOOP (i, len) { - if (i >= len) return cb(null,res) - if (Array.isArray(things[i])) - things[i] = bindActor.apply(null, - things[i].map(function(i){ - return (i===chain.first) ? res[0] - : (i===chain.last) - ? res[res.length - 1] : i })) - if (!things[i]) return LOOP(i + 1, len) - things[i](function (er, data) { - if (er) return cb(er, res) - if (data !== undefined) res = res.concat(data) - LOOP(i + 1, len) - }) - })(0, things.length) } diff --git a/deps/npm/node_modules/slide/lib/slide.js b/deps/npm/node_modules/slide/lib/slide.js deleted file mode 100644 index 6e9ec2327ae397..00000000000000 --- a/deps/npm/node_modules/slide/lib/slide.js +++ /dev/null @@ -1,3 +0,0 @@ -exports.asyncMap = require("./async-map") -exports.bindActor = require("./bind-actor") -exports.chain = require("./chain") diff --git a/deps/npm/node_modules/slide/package.json b/deps/npm/node_modules/slide/package.json deleted file mode 100644 index 1045c5cad8e1c9..00000000000000 --- a/deps/npm/node_modules/slide/package.json +++ /dev/null @@ -1,64 +0,0 @@ -{ - "_args": [ - [ - "slide@1.1.6", - "/Users/rebecca/code/npm" - ] - ], - "_from": "slide@1.1.6", - "_id": "slide@1.1.6", - "_inBundle": false, - "_integrity": "sha1-VusCfWW00tzmyy4tMsTUr8nh1wc=", - "_location": "/slide", - "_phantomChildren": {}, - "_requested": { - "type": "version", - "registry": true, - "raw": "slide@1.1.6", - "name": "slide", - "escapedName": "slide", - "rawSpec": "1.1.6", - "saveSpec": null, - "fetchSpec": "1.1.6" - }, - "_requiredBy": [ - "/", - "/gentle-fs", - "/npm-lifecycle", - "/npm-registry-client", - "/read-installed" - ], - "_resolved": "https://registry.npmjs.org/slide/-/slide-1.1.6.tgz", - "_spec": "1.1.6", - "_where": "/Users/rebecca/code/npm", - "author": { - "name": "Isaac Z. Schlueter", - "email": "i@izs.me", - "url": "http://blog.izs.me/" - }, - "bugs": { - "url": "https://github.com/isaacs/slide-flow-control/issues" - }, - "contributors": [ - { - "name": "S. Sriram", - "email": "ssriram@gmail.com", - "url": "http://www.565labs.com" - } - ], - "dependencies": {}, - "description": "A flow control lib small enough to fit on in a slide presentation. Derived live at Oak.JS", - "devDependencies": {}, - "engines": { - "node": "*" - }, - "homepage": "https://github.com/isaacs/slide-flow-control#readme", - "license": "ISC", - "main": "./lib/slide.js", - "name": "slide", - "repository": { - "type": "git", - "url": "git://github.com/isaacs/slide-flow-control.git" - }, - "version": "1.1.6" -} diff --git a/deps/npm/node_modules/smart-buffer/package.json b/deps/npm/node_modules/smart-buffer/package.json index c6d3c31214cf3d..a6d68dd7472d0b 100644 --- a/deps/npm/node_modules/smart-buffer/package.json +++ b/deps/npm/node_modules/smart-buffer/package.json @@ -1,37 +1,32 @@ { - "_from": "smart-buffer@^4.1.0", - "_id": "smart-buffer@4.1.0", - "_inBundle": false, - "_integrity": "sha512-iVICrxOzCynf/SNaBQCw34eM9jROU/s5rzIhpOvzhzuYHfJR/DhZfDkXiZSgKXfgv26HT3Yni3AV/DGw0cGnnw==", - "_location": "/smart-buffer", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "smart-buffer@^4.1.0", - "name": "smart-buffer", - "escapedName": "smart-buffer", - "rawSpec": "^4.1.0", - "saveSpec": null, - "fetchSpec": "^4.1.0" - }, - "_requiredBy": [ - "/socks" - ], - "_resolved": "https://registry.npmjs.org/smart-buffer/-/smart-buffer-4.1.0.tgz", - "_shasum": "91605c25d91652f4661ea69ccf45f1b331ca21ba", - "_spec": "smart-buffer@^4.1.0", - "_where": "/Users/claudiahdz/npm/cli/node_modules/socks", - "author": { - "name": "Josh Glazebrook" + "name": "smart-buffer", + "version": "4.1.0", + "description": "smart-buffer is a Buffer wrapper that adds automatic read & write offset tracking, string operations, data insertions, and more.", + "main": "build/smartbuffer.js", + "homepage": "https://github.com/JoshGlazebrook/smart-buffer/", + "repository": { + "type": "git", + "url": "https://github.com/JoshGlazebrook/smart-buffer.git" }, "bugs": { "url": "https://github.com/JoshGlazebrook/smart-buffer/issues" }, - "bundleDependencies": false, - "dependencies": {}, - "deprecated": false, - "description": "smart-buffer is a Buffer wrapper that adds automatic read & write offset tracking, string operations, data insertions, and more.", + "keywords": [ + "buffer", + "smart", + "packet", + "serialize", + "network", + "cursor", + "simple" + ], + "engines": { + "node": ">= 6.0.0", + "npm": ">= 3.0.0" + }, + "author": "Josh Glazebrook", + "license": "MIT", + "readmeFilename": "README.md", "devDependencies": { "@types/chai": "4.1.7", "@types/mocha": "5.2.7", @@ -47,23 +42,16 @@ "tslint": "5.18.0", "typescript": "^3.2.1" }, - "engines": { - "node": ">= 6.0.0", - "npm": ">= 3.0.0" + "typings": "typings/smartbuffer.d.ts", + "dependencies": {}, + "scripts": { + "prepublish": "npm install -g typescript && npm run build", + "test": "NODE_ENV=test mocha --recursive --require ts-node/register test/**/*.ts", + "coverage": "NODE_ENV=test nyc npm test", + "coveralls": "NODE_ENV=test nyc npm test && nyc report --reporter=text-lcov | coveralls", + "lint": "tslint --type-check --project tsconfig.json 'src/**/*.ts'", + "build": "tsc -p ./" }, - "homepage": "https://github.com/JoshGlazebrook/smart-buffer/", - "keywords": [ - "buffer", - "smart", - "packet", - "serialize", - "network", - "cursor", - "simple" - ], - "license": "MIT", - "main": "build/smartbuffer.js", - "name": "smart-buffer", "nyc": { "extension": [ ".ts", @@ -86,19 +74,5 @@ "html" ], "all": true - }, - "repository": { - "type": "git", - "url": "git+https://github.com/JoshGlazebrook/smart-buffer.git" - }, - "scripts": { - "build": "tsc -p ./", - "coverage": "NODE_ENV=test nyc npm test", - "coveralls": "NODE_ENV=test nyc npm test && nyc report --reporter=text-lcov | coveralls", - "lint": "tslint --type-check --project tsconfig.json 'src/**/*.ts'", - "prepublish": "npm install -g typescript && npm run build", - "test": "NODE_ENV=test mocha --recursive --require ts-node/register test/**/*.ts" - }, - "typings": "typings/smartbuffer.d.ts", - "version": "4.1.0" + } } diff --git a/deps/npm/node_modules/socks-proxy-agent/.travis.yml b/deps/npm/node_modules/socks-proxy-agent/.travis.yml deleted file mode 100644 index 1ff82daa2e96c9..00000000000000 --- a/deps/npm/node_modules/socks-proxy-agent/.travis.yml +++ /dev/null @@ -1,21 +0,0 @@ -sudo: false - -language: node_js - -node_js: - - "6" - - "7" - - "8" - - "9" - -install: - - PATH="`npm bin`:`npm bin -g`:$PATH" - # Install dependencies and build - - npm install - -script: - # Output useful info for debugging - - node --version - - npm --version - # Run tests - - npm test diff --git a/deps/npm/node_modules/socks-proxy-agent/History.md b/deps/npm/node_modules/socks-proxy-agent/History.md deleted file mode 100644 index b0266b5e35f9ad..00000000000000 --- a/deps/npm/node_modules/socks-proxy-agent/History.md +++ /dev/null @@ -1,96 +0,0 @@ - -3.0.1 / 2017-09-18 -================== - - * update "agent-base" to v4.1.0 - -3.0.0 / 2017-06-13 -================== - - * [BREAKING] drop support for Node < 4 - * update deps, remove `extend` dependency - * rename `socks-proxy-agent.js` to `index.js` - -2.1.1 / 2017-06-13 -================== - - * fix a bug where `close` would emit before `end` - * use "raw-body" module for tests - * prettier - -2.1.0 / 2017-05-24 -================== - - * DRY post-lookup logic - * Fix an error in readme (#13, @599316527) - * travis: test node v5 - * travis: test iojs v1, 2, 3 and node.js v4 - * test: use ssl-cert-snakeoil cert files - * Authentication support (#9, @baryshev) - -2.0.0 / 2015-07-10 -================== - - * API CHANGE! Removed `secure` boolean second argument in constructor - * upgrade to "agent-base" v2 API - * package: update "extend" to v3 - -1.0.2 / 2015-07-01 -================== - - * remove "v4a" from description - * socks-proxy-agent: cast `port` to a Number - * travis: attempt to make node v0.8 work - * travis: test node v0.12, don't test v0.11 - * test: pass `rejectUnauthorized` as a proxy opt - * test: catch http.ClientRequest errors - * test: add self-signed SSL server cert files - * test: refactor to use local SOCKS, HTTP and HTTPS servers - * README: use SVG for Travis-CI badge - -1.0.1 / 2015-03-01 -================== - - * switched from using "socks-client" to "socks" (#5, @JoshGlazebrook) - -1.0.0 / 2015-02-11 -================== - - * add client-side DNS lookup logic for 4 and 5 version socks proxies - * remove dead `onproxyconnect()` code function - * use a switch statement to decide the socks `version` - * refactor to use "socks-client" instead of "rainbowsocks" - * package: remove "rainbowsocks" dependency - * package: allow any "mocha" v2 - -0.1.2 / 2014-06-11 -================== - - * package: update "rainbowsocks" to v0.1.2 - * travis: don't test node v0.9 - -0.1.1 / 2014-04-09 -================== - - * package: update outdated dependencies - * socks-proxy-agent: pass `secure` flag when no `new` - * socks-proxy-agent: small code cleanup - -0.1.0 / 2013-11-19 -================== - - * add .travis.yml file - * socks-proxy-agent: properly mix in the proxy options - * socks-proxy-agent: coerce the `secureEndpoint` into a Boolean - * socks-proxy-agent: use "extend" module - * socks-proxy-agent: update to "agent-base" v1 API - -0.0.2 / 2013-07-24 -================== - - * socks-proxy-agent: properly set the `defaultPort` property - -0.0.1 / 2013-07-11 -================== - - * Initial release diff --git a/deps/npm/node_modules/socks-proxy-agent/README.md b/deps/npm/node_modules/socks-proxy-agent/README.md index 36028ad9f689fc..4df184ffaac8a4 100644 --- a/deps/npm/node_modules/socks-proxy-agent/README.md +++ b/deps/npm/node_modules/socks-proxy-agent/README.md @@ -1,11 +1,11 @@ socks-proxy-agent ================ ### A SOCKS proxy `http.Agent` implementation for HTTP and HTTPS -[![Build Status](https://travis-ci.org/TooTallNate/node-socks-proxy-agent.svg?branch=master)](https://travis-ci.org/TooTallNate/node-socks-proxy-agent) +[![Build Status](https://github.com/TooTallNate/node-socks-proxy-agent/workflows/Node%20CI/badge.svg)](https://github.com/TooTallNate/node-socks-proxy-agent/actions?workflow=Node+CI) This module provides an `http.Agent` implementation that connects to a specified SOCKS proxy server, and can be used with the built-in `http` -or `https` modules. +and `https` modules. It can also be used in conjunction with the `ws` module to establish a WebSocket connection over a SOCKS proxy. See the "Examples" section below. @@ -23,15 +23,34 @@ $ npm install socks-proxy-agent Examples -------- +#### TypeScript example + +```ts +import https from 'https'; +import { SocksProxyAgent } from 'socks-proxy-agent'; + +const info = { + host: 'br41.nordvpn.com', + userId: 'your-name@gmail.com', + password: 'abcdef12345124' +}; +const agent = new SocksProxyAgent(info); + +https.get('https://jsonip.org', { agent }, (res) => { + console.log(res.headers); + res.pipe(process.stdout); +}); +``` + #### `http` module example -``` js +```js var url = require('url'); var http = require('http'); var SocksProxyAgent = require('socks-proxy-agent'); // SOCKS proxy to connect to -var proxy = process.env.socks_proxy || 'socks://127.0.0.1:9050'; +var proxy = process.env.socks_proxy || 'socks://127.0.0.1:1080'; console.log('using proxy server %j', proxy); // HTTP endpoint for the proxy to connect to @@ -44,20 +63,20 @@ var agent = new SocksProxyAgent(proxy); opts.agent = agent; http.get(opts, function (res) { - console.log('"response" event!', res.headers); - res.pipe(process.stdout); + console.log('"response" event!', res.headers); + res.pipe(process.stdout); }); ``` #### `https` module example -``` js +```js var url = require('url'); var https = require('https'); var SocksProxyAgent = require('socks-proxy-agent'); // SOCKS proxy to connect to -var proxy = process.env.socks_proxy || 'socks://127.0.0.1:9050'; +var proxy = process.env.socks_proxy || 'socks://127.0.0.1:1080'; console.log('using proxy server %j', proxy); // HTTP endpoint for the proxy to connect to @@ -70,8 +89,8 @@ var agent = new SocksProxyAgent(proxy); opts.agent = agent; https.get(opts, function (res) { - console.log('"response" event!', res.headers); - res.pipe(process.stdout); + console.log('"response" event!', res.headers); + res.pipe(process.stdout); }); ``` @@ -82,7 +101,7 @@ var WebSocket = require('ws'); var SocksProxyAgent = require('socks-proxy-agent'); // SOCKS proxy to connect to -var proxy = process.env.socks_proxy || 'socks://127.0.0.1:9050'; +var proxy = process.env.socks_proxy || 'socks://127.0.0.1:1080'; console.log('using proxy server %j', proxy); // WebSocket endpoint for the proxy to connect to @@ -96,13 +115,13 @@ var agent = new SocksProxyAgent(proxy); var socket = new WebSocket(endpoint, { agent: agent }); socket.on('open', function () { - console.log('"open" event!'); - socket.send('hello world'); + console.log('"open" event!'); + socket.send('hello world'); }); socket.on('message', function (data, flags) { - console.log('"message" event! %j %j', data, flags); - socket.close(); + console.log('"message" event! %j %j', data, flags); + socket.close(); }); ``` diff --git a/deps/npm/node_modules/socks-proxy-agent/dist/agent.d.ts b/deps/npm/node_modules/socks-proxy-agent/dist/agent.d.ts new file mode 100644 index 00000000000000..52341a1b55d90b --- /dev/null +++ b/deps/npm/node_modules/socks-proxy-agent/dist/agent.d.ts @@ -0,0 +1,21 @@ +/// +import net from 'net'; +import { Agent, ClientRequest, RequestOptions } from 'agent-base'; +import { SocksProxyAgentOptions } from '.'; +/** + * The `SocksProxyAgent`. + * + * @api public + */ +export default class SocksProxyAgent extends Agent { + private lookup; + private proxy; + constructor(_opts: string | SocksProxyAgentOptions); + /** + * Initiates a SOCKS connection to the specified SOCKS proxy server, + * which in turn connects to the specified remote host and port. + * + * @api protected + */ + callback(req: ClientRequest, opts: RequestOptions): Promise; +} diff --git a/deps/npm/node_modules/socks-proxy-agent/dist/agent.js b/deps/npm/node_modules/socks-proxy-agent/dist/agent.js new file mode 100644 index 00000000000000..f779732bbc78d7 --- /dev/null +++ b/deps/npm/node_modules/socks-proxy-agent/dist/agent.js @@ -0,0 +1,182 @@ +"use strict"; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const dns_1 = __importDefault(require("dns")); +const tls_1 = __importDefault(require("tls")); +const url_1 = __importDefault(require("url")); +const debug_1 = __importDefault(require("debug")); +const agent_base_1 = require("agent-base"); +const socks_1 = require("socks"); +const debug = debug_1.default('socks-proxy-agent'); +function dnsLookup(host) { + return new Promise((resolve, reject) => { + dns_1.default.lookup(host, (err, res) => { + if (err) { + reject(err); + } + else { + resolve(res); + } + }); + }); +} +function parseSocksProxy(opts) { + let port = 0; + let lookup = false; + let type = 5; + // Prefer `hostname` over `host`, because of `url.parse()` + const host = opts.hostname || opts.host; + if (!host) { + throw new TypeError('No "host"'); + } + if (typeof opts.port === 'number') { + port = opts.port; + } + else if (typeof opts.port === 'string') { + port = parseInt(opts.port, 10); + } + // From RFC 1928, Section 3: https://tools.ietf.org/html/rfc1928#section-3 + // "The SOCKS service is conventionally located on TCP port 1080" + if (!port) { + port = 1080; + } + // figure out if we want socks v4 or v5, based on the "protocol" used. + // Defaults to 5. + if (opts.protocol) { + switch (opts.protocol) { + case 'socks4:': + lookup = true; + // pass through + case 'socks4a:': + type = 4; + break; + case 'socks5:': + lookup = true; + // pass through + case 'socks:': // no version specified, default to 5h + case 'socks5h:': + type = 5; + break; + default: + throw new TypeError(`A "socks" protocol must be specified! Got: ${opts.protocol}`); + } + } + if (typeof opts.type !== 'undefined') { + if (opts.type === 4 || opts.type === 5) { + type = opts.type; + } + else { + throw new TypeError(`"type" must be 4 or 5, got: ${opts.type}`); + } + } + const proxy = { + host, + port, + type + }; + let userId = opts.userId; + let password = opts.password; + if (opts.auth) { + const auth = opts.auth.split(':'); + userId = auth[0]; + password = auth[1]; + } + if (userId) { + Object.defineProperty(proxy, 'userId', { + value: userId, + enumerable: false + }); + } + if (password) { + Object.defineProperty(proxy, 'password', { + value: password, + enumerable: false + }); + } + return { lookup, proxy }; +} +/** + * The `SocksProxyAgent`. + * + * @api public + */ +class SocksProxyAgent extends agent_base_1.Agent { + constructor(_opts) { + let opts; + if (typeof _opts === 'string') { + opts = url_1.default.parse(_opts); + } + else { + opts = _opts; + } + if (!opts) { + throw new TypeError('a SOCKS proxy server `host` and `port` must be specified!'); + } + super(opts); + const parsedProxy = parseSocksProxy(opts); + this.lookup = parsedProxy.lookup; + this.proxy = parsedProxy.proxy; + } + /** + * Initiates a SOCKS connection to the specified SOCKS proxy server, + * which in turn connects to the specified remote host and port. + * + * @api protected + */ + callback(req, opts) { + return __awaiter(this, void 0, void 0, function* () { + const { lookup, proxy } = this; + let { host, port } = opts; + if (!host) { + throw new Error('No `host` defined!'); + } + if (lookup) { + // Client-side DNS resolution for "4" and "5" socks proxy versions. + host = yield dnsLookup(host); + } + const socksOpts = { + proxy, + destination: { host, port }, + command: 'connect' + }; + debug('Creating socks proxy connection: %o', socksOpts); + const { socket } = yield socks_1.SocksClient.createConnection(socksOpts); + debug('Successfully created socks proxy connection'); + if (opts.secureEndpoint) { + const servername = opts.servername || opts.host; + if (!servername) { + throw new Error('Could not determine "servername"'); + } + // The proxy is connecting to a TLS server, so upgrade + // this socket connection to a TLS connection. + debug('Upgrading socket connection to TLS'); + return tls_1.default.connect(Object.assign(Object.assign({}, omit(opts, 'host', 'hostname', 'path', 'port')), { socket, + servername })); + } + return socket; + }); + } +} +exports.default = SocksProxyAgent; +function omit(obj, ...keys) { + const ret = {}; + let key; + for (key in obj) { + if (!keys.includes(key)) { + ret[key] = obj[key]; + } + } + return ret; +} +//# sourceMappingURL=agent.js.map \ No newline at end of file diff --git a/deps/npm/node_modules/socks-proxy-agent/dist/agent.js.map b/deps/npm/node_modules/socks-proxy-agent/dist/agent.js.map new file mode 100644 index 00000000000000..033d913eaf49a0 --- /dev/null +++ b/deps/npm/node_modules/socks-proxy-agent/dist/agent.js.map @@ -0,0 +1 @@ +{"version":3,"file":"agent.js","sourceRoot":"","sources":["../src/agent.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,8CAAsB;AAEtB,8CAAsB;AACtB,8CAAsB;AACtB,kDAAgC;AAChC,2CAAkE;AAClE,iCAAoE;AAGpE,MAAM,KAAK,GAAG,eAAW,CAAC,mBAAmB,CAAC,CAAC;AAE/C,SAAS,SAAS,CAAC,IAAY;IAC9B,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QACtC,aAAG,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE;YAC7B,IAAI,GAAG,EAAE;gBACR,MAAM,CAAC,GAAG,CAAC,CAAC;aACZ;iBAAM;gBACN,OAAO,CAAC,GAAG,CAAC,CAAC;aACb;QACF,CAAC,CAAC,CAAC;IACJ,CAAC,CAAC,CAAC;AACJ,CAAC;AAED,SAAS,eAAe,CACvB,IAA4B;IAE5B,IAAI,IAAI,GAAG,CAAC,CAAC;IACb,IAAI,MAAM,GAAG,KAAK,CAAC;IACnB,IAAI,IAAI,GAAuB,CAAC,CAAC;IAEjC,0DAA0D;IAC1D,MAAM,IAAI,GAAG,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,IAAI,CAAC;IACxC,IAAI,CAAC,IAAI,EAAE;QACV,MAAM,IAAI,SAAS,CAAC,WAAW,CAAC,CAAC;KACjC;IAED,IAAI,OAAO,IAAI,CAAC,IAAI,KAAK,QAAQ,EAAE;QAClC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC;KACjB;SAAM,IAAI,OAAO,IAAI,CAAC,IAAI,KAAK,QAAQ,EAAE;QACzC,IAAI,GAAG,QAAQ,CAAC,IAAI,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;KAC/B;IAED,0EAA0E;IAC1E,iEAAiE;IACjE,IAAI,CAAC,IAAI,EAAE;QACV,IAAI,GAAG,IAAI,CAAC;KACZ;IAED,sEAAsE;IACtE,iBAAiB;IACjB,IAAI,IAAI,CAAC,QAAQ,EAAE;QAClB,QAAQ,IAAI,CAAC,QAAQ,EAAE;YACtB,KAAK,SAAS;gBACb,MAAM,GAAG,IAAI,CAAC;YACf,eAAe;YACf,KAAK,UAAU;gBACd,IAAI,GAAG,CAAC,CAAC;gBACT,MAAM;YACP,KAAK,SAAS;gBACb,MAAM,GAAG,IAAI,CAAC;YACf,eAAe;YACf,KAAK,QAAQ,CAAC,CAAC,sCAAsC;YACrD,KAAK,UAAU;gBACd,IAAI,GAAG,CAAC,CAAC;gBACT,MAAM;YACP;gBACC,MAAM,IAAI,SAAS,CAClB,8CAA8C,IAAI,CAAC,QAAQ,EAAE,CAC7D,CAAC;SACH;KACD;IAED,IAAI,OAAO,IAAI,CAAC,IAAI,KAAK,WAAW,EAAE;QACrC,IAAI,IAAI,CAAC,IAAI,KAAK,CAAC,IAAI,IAAI,CAAC,IAAI,KAAK,CAAC,EAAE;YACvC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC;SACjB;aAAM;YACN,MAAM,IAAI,SAAS,CAAC,+BAA+B,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC;SAChE;KACD;IAED,MAAM,KAAK,GAAe;QACzB,IAAI;QACJ,IAAI;QACJ,IAAI;KACJ,CAAC;IAEF,IAAI,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;IACzB,IAAI,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC;IAC7B,IAAI,IAAI,CAAC,IAAI,EAAE;QACd,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QAClC,MAAM,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;QACjB,QAAQ,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;KACnB;IACD,IAAI,MAAM,EAAE;QACX,MAAM,CAAC,cAAc,CAAC,KAAK,EAAE,QAAQ,EAAE;YACtC,KAAK,EAAE,MAAM;YACb,UAAU,EAAE,KAAK;SACjB,CAAC,CAAC;KACH;IACD,IAAI,QAAQ,EAAE;QACb,MAAM,CAAC,cAAc,CAAC,KAAK,EAAE,UAAU,EAAE;YACxC,KAAK,EAAE,QAAQ;YACf,UAAU,EAAE,KAAK;SACjB,CAAC,CAAC;KACH;IAED,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC;AAC1B,CAAC;AAED;;;;GAIG;AACH,MAAqB,eAAgB,SAAQ,kBAAK;IAIjD,YAAY,KAAsC;QACjD,IAAI,IAA4B,CAAC;QACjC,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;YAC9B,IAAI,GAAG,aAAG,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;SACxB;aAAM;YACN,IAAI,GAAG,KAAK,CAAC;SACb;QACD,IAAI,CAAC,IAAI,EAAE;YACV,MAAM,IAAI,SAAS,CAClB,2DAA2D,CAC3D,CAAC;SACF;QACD,KAAK,CAAC,IAAI,CAAC,CAAC;QAEZ,MAAM,WAAW,GAAG,eAAe,CAAC,IAAI,CAAC,CAAC;QAC1C,IAAI,CAAC,MAAM,GAAG,WAAW,CAAC,MAAM,CAAC;QACjC,IAAI,CAAC,KAAK,GAAG,WAAW,CAAC,KAAK,CAAC;IAChC,CAAC;IAED;;;;;OAKG;IACG,QAAQ,CACb,GAAkB,EAClB,IAAoB;;YAEpB,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,IAAI,CAAC;YAC/B,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,GAAG,IAAI,CAAC;YAE1B,IAAI,CAAC,IAAI,EAAE;gBACV,MAAM,IAAI,KAAK,CAAC,oBAAoB,CAAC,CAAC;aACtC;YAED,IAAI,MAAM,EAAE;gBACX,mEAAmE;gBACnE,IAAI,GAAG,MAAM,SAAS,CAAC,IAAI,CAAC,CAAC;aAC7B;YAED,MAAM,SAAS,GAAuB;gBACrC,KAAK;gBACL,WAAW,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE;gBAC3B,OAAO,EAAE,SAAS;aAClB,CAAC;YACF,KAAK,CAAC,qCAAqC,EAAE,SAAS,CAAC,CAAC;YACxD,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,mBAAW,CAAC,gBAAgB,CAAC,SAAS,CAAC,CAAC;YACjE,KAAK,CAAC,6CAA6C,CAAC,CAAC;YAErD,IAAI,IAAI,CAAC,cAAc,EAAE;gBACxB,MAAM,UAAU,GAAG,IAAI,CAAC,UAAU,IAAI,IAAI,CAAC,IAAI,CAAC;gBAChD,IAAI,CAAC,UAAU,EAAE;oBAChB,MAAM,IAAI,KAAK,CAAC,kCAAkC,CAAC,CAAC;iBACpD;gBACD,sDAAsD;gBACtD,8CAA8C;gBAC9C,KAAK,CAAC,oCAAoC,CAAC,CAAC;gBAC5C,OAAO,aAAG,CAAC,OAAO,iCACd,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,CAAC,KACjD,MAAM;oBACN,UAAU,IACT,CAAC;aACH;YAED,OAAO,MAAM,CAAC;QACf,CAAC;KAAA;CACD;AAvED,kCAuEC;AAED,SAAS,IAAI,CACZ,GAAM,EACN,GAAG,IAAO;IAIV,MAAM,GAAG,GAAG,EAEX,CAAC;IACF,IAAI,GAAqB,CAAC;IAC1B,KAAK,GAAG,IAAI,GAAG,EAAE;QAChB,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE;YACxB,GAAG,CAAC,GAAG,CAAC,GAAG,GAAG,CAAC,GAAG,CAAC,CAAC;SACpB;KACD;IACD,OAAO,GAAG,CAAC;AACZ,CAAC"} \ No newline at end of file diff --git a/deps/npm/node_modules/socks-proxy-agent/dist/index.d.ts b/deps/npm/node_modules/socks-proxy-agent/dist/index.d.ts new file mode 100644 index 00000000000000..eb92e04ffee613 --- /dev/null +++ b/deps/npm/node_modules/socks-proxy-agent/dist/index.d.ts @@ -0,0 +1,18 @@ +/// +import { Url } from 'url'; +import { SocksProxy } from 'socks'; +import { AgentOptions } from 'agent-base'; +import _SocksProxyAgent from './agent'; +declare function createSocksProxyAgent(opts: string | createSocksProxyAgent.SocksProxyAgentOptions): _SocksProxyAgent; +declare namespace createSocksProxyAgent { + interface BaseSocksProxyAgentOptions { + host?: string | null; + port?: string | number | null; + } + export interface SocksProxyAgentOptions extends AgentOptions, BaseSocksProxyAgentOptions, Partial> { + } + export type SocksProxyAgent = _SocksProxyAgent; + export const SocksProxyAgent: typeof _SocksProxyAgent; + export {}; +} +export = createSocksProxyAgent; diff --git a/deps/npm/node_modules/socks-proxy-agent/dist/index.js b/deps/npm/node_modules/socks-proxy-agent/dist/index.js new file mode 100644 index 00000000000000..dd1e49a77e436c --- /dev/null +++ b/deps/npm/node_modules/socks-proxy-agent/dist/index.js @@ -0,0 +1,14 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +const agent_1 = __importDefault(require("./agent")); +function createSocksProxyAgent(opts) { + return new agent_1.default(opts); +} +(function (createSocksProxyAgent) { + createSocksProxyAgent.SocksProxyAgent = agent_1.default; + createSocksProxyAgent.prototype = agent_1.default.prototype; +})(createSocksProxyAgent || (createSocksProxyAgent = {})); +module.exports = createSocksProxyAgent; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/deps/npm/node_modules/socks-proxy-agent/dist/index.js.map b/deps/npm/node_modules/socks-proxy-agent/dist/index.js.map new file mode 100644 index 00000000000000..074fe255cd3ccc --- /dev/null +++ b/deps/npm/node_modules/socks-proxy-agent/dist/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;AAGA,oDAAuC;AAEvC,SAAS,qBAAqB,CAC7B,IAA2D;IAE3D,OAAO,IAAI,eAAgB,CAAC,IAAI,CAAC,CAAC;AACnC,CAAC;AAED,WAAU,qBAAqB;IAYjB,qCAAe,GAAG,eAAgB,CAAC;IAEhD,qBAAqB,CAAC,SAAS,GAAG,eAAgB,CAAC,SAAS,CAAC;AAC9D,CAAC,EAfS,qBAAqB,KAArB,qBAAqB,QAe9B;AAED,iBAAS,qBAAqB,CAAC"} \ No newline at end of file diff --git a/deps/npm/node_modules/socks-proxy-agent/index.js b/deps/npm/node_modules/socks-proxy-agent/index.js deleted file mode 100644 index 5418abfac6635d..00000000000000 --- a/deps/npm/node_modules/socks-proxy-agent/index.js +++ /dev/null @@ -1,145 +0,0 @@ -/** - * Module dependencies. - */ - -var tls; // lazy-loaded... -var url = require('url'); -var dns = require('dns'); -var Agent = require('agent-base'); -var SocksClient = require('socks').SocksClient; -var inherits = require('util').inherits; - -/** - * Module exports. - */ - -module.exports = SocksProxyAgent; - -/** - * The `SocksProxyAgent`. - * - * @api public - */ - -function SocksProxyAgent(opts) { - if (!(this instanceof SocksProxyAgent)) return new SocksProxyAgent(opts); - if ('string' == typeof opts) opts = url.parse(opts); - if (!opts) - throw new Error( - 'a SOCKS proxy server `host` and `port` must be specified!' - ); - Agent.call(this, opts); - - var proxy = Object.assign({}, opts); - - // prefer `hostname` over `host`, because of `url.parse()` - proxy.host = proxy.hostname || proxy.host; - - // SOCKS doesn't *technically* have a default port, but this is - // the same default that `curl(1)` uses - proxy.port = +proxy.port || 1080; - - if (proxy.host && proxy.path) { - // if both a `host` and `path` are specified then it's most likely the - // result of a `url.parse()` call... we need to remove the `path` portion so - // that `net.connect()` doesn't attempt to open that as a unix socket file. - delete proxy.path; - delete proxy.pathname; - } - - // figure out if we want socks v4 or v5, based on the "protocol" used. - // Defaults to 5. - proxy.lookup = false; - switch (proxy.protocol) { - case 'socks4:': - proxy.lookup = true; - // pass through - case 'socks4a:': - proxy.version = 4; - break; - case 'socks5:': - proxy.lookup = true; - // pass through - case 'socks:': // no version specified, default to 5h - case 'socks5h:': - proxy.version = 5; - break; - default: - throw new TypeError( - 'A "socks" protocol must be specified! Got: ' + proxy.protocol - ); - } - - if (proxy.auth) { - var auth = proxy.auth.split(':'); - proxy.authentication = { username: auth[0], password: auth[1] }; - proxy.userid = auth[0]; - } - this.proxy = proxy; -} -inherits(SocksProxyAgent, Agent); - -/** - * Initiates a SOCKS connection to the specified SOCKS proxy server, - * which in turn connects to the specified remote host and port. - * - * @api public - */ - -SocksProxyAgent.prototype.callback = function connect(req, opts, fn) { - var proxy = this.proxy; - - // called once the SOCKS proxy has connected to the specified remote endpoint - function onhostconnect(err, result) { - if (err) return fn(err); - - var socket = result.socket; - - var s = socket; - if (opts.secureEndpoint) { - // since the proxy is connecting to an SSL server, we have - // to upgrade this socket connection to an SSL connection - if (!tls) tls = require('tls'); - opts.socket = socket; - opts.servername = opts.host; - opts.host = null; - opts.hostname = null; - opts.port = null; - s = tls.connect(opts); - } - - fn(null, s); - } - - // called for the `dns.lookup()` callback - function onlookup(err, ip) { - if (err) return fn(err); - options.destination.host = ip; - SocksClient.createConnection(options, onhostconnect); - } - - var options = { - proxy: { - ipaddress: proxy.host, - port: +proxy.port, - type: proxy.version - }, - destination: { - port: +opts.port - }, - command: 'connect' - }; - - if (proxy.authentication) { - options.proxy.userId = proxy.userid; - options.proxy.password = proxy.authentication.password; - } - - if (proxy.lookup) { - // client-side DNS resolution for "4" and "5" socks proxy versions - dns.lookup(opts.host, onlookup); - } else { - // proxy hostname DNS resolution for "4a" and "5h" socks proxy servers - onlookup(null, opts.host); - } -} diff --git a/deps/npm/node_modules/socks-proxy-agent/node_modules/agent-base/.travis.yml b/deps/npm/node_modules/socks-proxy-agent/node_modules/agent-base/.travis.yml deleted file mode 100644 index 6ce862c6f63a77..00000000000000 --- a/deps/npm/node_modules/socks-proxy-agent/node_modules/agent-base/.travis.yml +++ /dev/null @@ -1,23 +0,0 @@ -sudo: false - -language: node_js - -node_js: - - "4" - - "5" - - "6" - - "7" - - "8" - - "9" - -install: - - PATH="`npm bin`:`npm bin -g`:$PATH" - # Install dependencies and build - - npm install - -script: - # Output useful info for debugging - - node --version - - npm --version - # Run tests - - npm test diff --git a/deps/npm/node_modules/socks-proxy-agent/node_modules/agent-base/History.md b/deps/npm/node_modules/socks-proxy-agent/node_modules/agent-base/History.md deleted file mode 100644 index 80c88dc401f960..00000000000000 --- a/deps/npm/node_modules/socks-proxy-agent/node_modules/agent-base/History.md +++ /dev/null @@ -1,113 +0,0 @@ - -4.2.0 / 2018-01-15 -================== - - * Add support for returning an `http.Agent` instance - * Optimize promisifying logic - * Set `timeout` to null for proper cleanup - * Remove Node.js <= 0.11.3 special-casing from test case - -4.1.2 / 2017-11-20 -================== - - * test Node 9 on Travis - * ensure that `https.get()` uses the patched `https.request()` - -4.1.1 / 2017-07-20 -================== - - * Correct `https.request()` with a String (#9) - -4.1.0 / 2017-06-26 -================== - - * mix in Agent options into Request options - * throw when nothing is returned from agent-base callback - * do not modify the options object for https requests - -4.0.1 / 2017-06-13 -================== - - * add `this` context tests and fixes - -4.0.0 / 2017-06-06 -================== - - * drop support for Node.js < 4 - * drop old versions of Node.js from Travis-CI - * specify Node.js >= 4.0.0 in `engines.node` - * remove more old code - * remove "extend" dependency - * remove "semver" dependency - * make the Promise logic a bit cleaner - * add async function pseudo-example to README - * use direct return in README example - -3.0.0 / 2017-06-02 -================== - - * drop support for Node.js v0.8 and v0.10 - * add support for async, Promises, and direct return - * add a couple `options` test cases - * implement a `"timeout"` option - * rename main file to `index.js` - * test Node 8 on Travis - -2.1.1 / 2017-05-30 -================== - - * Revert [`fe2162e`](https://github.com/TooTallNate/node-agent-base/commit/fe2162e0ba18123f5b301cba4de1e9dd74e437cd) and [`270bdc9`](https://github.com/TooTallNate/node-agent-base/commit/270bdc92eb8e3bd0444d1e5266e8e9390aeb3095) (fixes #7) - -2.1.0 / 2017-05-26 -================== - - * unref is not supported for node < 0.9.1 (@pi0) - * add tests to dangling socket (@pi0) - * check unref() is supported (@pi0) - * fix dangling sockets problem (@pi0) - * add basic "ws" module tests - * make `Agent` be subclassable - * turn `addRequest()` into a named function - * test: Node.js v4 likes to call `cork` on the stream (#3, @tomhughes) - * travis: test node v4, v5, v6 and v7 - -2.0.1 / 2015-09-10 -================== - - * package: update "semver" to v5.0.1 for WebPack (#1, @vhpoet) - -2.0.0 / 2015-07-10 -================== - - * refactor to patch Node.js core for more consistent `opts` values - * ensure that HTTP(s) default port numbers are always given - * test: use ssl-cert-snakeoil SSL certs - * test: add tests for arbitrary options - * README: add API section - * README: make the Agent HTTP/HTTPS generic in the example - * README: use SVG for Travis-CI badge - -1.0.2 / 2015-06-27 -================== - - * agent: set `req._hadError` to true after emitting "error" - * package: update "mocha" to v2 - * test: add artificial HTTP GET request test - * test: add artificial data events test - * test: fix artifical GET response test on node > v0.11.3 - * test: use a real timeout for the async error test - -1.0.1 / 2013-09-09 -================== - - * Fix passing an "error" object to the callback function on the first tick - -1.0.0 / 2013-09-09 -================== - - * New API: now you pass a callback function directly - -0.0.1 / 2013-07-09 -================== - - * Initial release diff --git a/deps/npm/node_modules/socks-proxy-agent/node_modules/agent-base/README.md b/deps/npm/node_modules/socks-proxy-agent/node_modules/agent-base/README.md deleted file mode 100644 index dbeceab8a125f6..00000000000000 --- a/deps/npm/node_modules/socks-proxy-agent/node_modules/agent-base/README.md +++ /dev/null @@ -1,145 +0,0 @@ -agent-base -========== -### Turn a function into an [`http.Agent`][http.Agent] instance -[![Build Status](https://travis-ci.org/TooTallNate/node-agent-base.svg?branch=master)](https://travis-ci.org/TooTallNate/node-agent-base) - -This module provides an `http.Agent` generator. That is, you pass it an async -callback function, and it returns a new `http.Agent` instance that will invoke the -given callback function when sending outbound HTTP requests. - -#### Some subclasses: - -Here's some more interesting uses of `agent-base`. -Send a pull request to list yours! - - * [`http-proxy-agent`][http-proxy-agent]: An HTTP(s) proxy `http.Agent` implementation for HTTP endpoints - * [`https-proxy-agent`][https-proxy-agent]: An HTTP(s) proxy `http.Agent` implementation for HTTPS endpoints - * [`pac-proxy-agent`][pac-proxy-agent]: A PAC file proxy `http.Agent` implementation for HTTP and HTTPS - * [`socks-proxy-agent`][socks-proxy-agent]: A SOCKS (v4a) proxy `http.Agent` implementation for HTTP and HTTPS - - -Installation ------------- - -Install with `npm`: - -``` bash -$ npm install agent-base -``` - - -Example -------- - -Here's a minimal example that creates a new `net.Socket` connection to the server -for every HTTP request (i.e. the equivalent of `agent: false` option): - -```js -var net = require('net'); -var tls = require('tls'); -var url = require('url'); -var http = require('http'); -var agent = require('agent-base'); - -var endpoint = 'http://nodejs.org/api/'; -var parsed = url.parse(endpoint); - -// This is the important part! -parsed.agent = agent(function (req, opts) { - var socket; - // `secureEndpoint` is true when using the https module - if (opts.secureEndpoint) { - socket = tls.connect(opts); - } else { - socket = net.connect(opts); - } - return socket; -}); - -// Everything else works just like normal... -http.get(parsed, function (res) { - console.log('"response" event!', res.headers); - res.pipe(process.stdout); -}); -``` - -Returning a Promise or using an `async` function is also supported: - -```js -agent(async function (req, opts) { - await sleep(1000); - // etc… -}); -``` - -Return another `http.Agent` instance to "pass through" the responsibility -for that HTTP request to that agent: - -```js -agent(function (req, opts) { - return opts.secureEndpoint ? https.globalAgent : http.globalAgent; -}); -``` - - -API ---- - -## Agent(Function callback[, Object options]) → [http.Agent][] - -Creates a base `http.Agent` that will execute the callback function `callback` -for every HTTP request that it is used as the `agent` for. The callback function -is responsible for creating a `stream.Duplex` instance of some kind that will be -used as the underlying socket in the HTTP request. - -The `options` object accepts the following properties: - - * `timeout` - Number - Timeout for the `callback()` function in milliseconds. Defaults to Infinity (optional). - -The callback function should have the following signature: - -### callback(http.ClientRequest req, Object options, Function cb) → undefined - -The ClientRequest `req` can be accessed to read request headers and -and the path, etc. The `options` object contains the options passed -to the `http.request()`/`https.request()` function call, and is formatted -to be directly passed to `net.connect()`/`tls.connect()`, or however -else you want a Socket to be created. Pass the created socket to -the callback function `cb` once created, and the HTTP request will -continue to proceed. - -If the `https` module is used to invoke the HTTP request, then the -`secureEndpoint` property on `options` _will be set to `true`_. - - -License -------- - -(The MIT License) - -Copyright (c) 2013 Nathan Rajlich <nathan@tootallnate.net> - -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. - -[http-proxy-agent]: https://github.com/TooTallNate/node-http-proxy-agent -[https-proxy-agent]: https://github.com/TooTallNate/node-https-proxy-agent -[pac-proxy-agent]: https://github.com/TooTallNate/node-pac-proxy-agent -[socks-proxy-agent]: https://github.com/TooTallNate/node-socks-proxy-agent -[http.Agent]: https://nodejs.org/api/http.html#http_class_http_agent diff --git a/deps/npm/node_modules/socks-proxy-agent/node_modules/agent-base/index.js b/deps/npm/node_modules/socks-proxy-agent/node_modules/agent-base/index.js deleted file mode 100644 index 0ee6b29699a670..00000000000000 --- a/deps/npm/node_modules/socks-proxy-agent/node_modules/agent-base/index.js +++ /dev/null @@ -1,170 +0,0 @@ -'use strict'; -require('./patch-core'); -const inherits = require('util').inherits; -const promisify = require('es6-promisify'); -const EventEmitter = require('events').EventEmitter; - -module.exports = Agent; - -function isAgent(v) { - return v && typeof v.addRequest === 'function'; -} - -/** - * Base `http.Agent` implementation. - * No pooling/keep-alive is implemented by default. - * - * @param {Function} callback - * @api public - */ -function Agent(callback, _opts) { - if (!(this instanceof Agent)) { - return new Agent(callback, _opts); - } - - EventEmitter.call(this); - - // The callback gets promisified if it has 3 parameters - // (i.e. it has a callback function) lazily - this._promisifiedCallback = false; - - let opts = _opts; - if ('function' === typeof callback) { - this.callback = callback; - } else if (callback) { - opts = callback; - } - - // timeout for the socket to be returned from the callback - this.timeout = (opts && opts.timeout) || null; - - this.options = opts; -} -inherits(Agent, EventEmitter); - -/** - * Override this function in your subclass! - */ -Agent.prototype.callback = function callback(req, opts) { - throw new Error( - '"agent-base" has no default implementation, you must subclass and override `callback()`' - ); -}; - -/** - * Called by node-core's "_http_client.js" module when creating - * a new HTTP request with this Agent instance. - * - * @api public - */ -Agent.prototype.addRequest = function addRequest(req, _opts) { - const ownOpts = Object.assign({}, _opts); - - // Set default `host` for HTTP to localhost - if (null == ownOpts.host) { - ownOpts.host = 'localhost'; - } - - // Set default `port` for HTTP if none was explicitly specified - if (null == ownOpts.port) { - ownOpts.port = ownOpts.secureEndpoint ? 443 : 80; - } - - const opts = Object.assign({}, this.options, ownOpts); - - if (opts.host && opts.path) { - // If both a `host` and `path` are specified then it's most likely the - // result of a `url.parse()` call... we need to remove the `path` portion so - // that `net.connect()` doesn't attempt to open that as a unix socket file. - delete opts.path; - } - - delete opts.agent; - delete opts.hostname; - delete opts._defaultAgent; - delete opts.defaultPort; - delete opts.createConnection; - - // Hint to use "Connection: close" - // XXX: non-documented `http` module API :( - req._last = true; - req.shouldKeepAlive = false; - - // Create the `stream.Duplex` instance - let timeout; - let timedOut = false; - const timeoutMs = this.timeout; - const freeSocket = this.freeSocket; - - function onerror(err) { - if (req._hadError) return; - req.emit('error', err); - // For Safety. Some additional errors might fire later on - // and we need to make sure we don't double-fire the error event. - req._hadError = true; - } - - function ontimeout() { - timeout = null; - timedOut = true; - const err = new Error( - 'A "socket" was not created for HTTP request before ' + timeoutMs + 'ms' - ); - err.code = 'ETIMEOUT'; - onerror(err); - } - - function callbackError(err) { - if (timedOut) return; - if (timeout != null) { - clearTimeout(timeout); - timeout = null; - } - onerror(err); - } - - function onsocket(socket) { - if (timedOut) return; - if (timeout != null) { - clearTimeout(timeout); - timeout = null; - } - if (isAgent(socket)) { - // `socket` is actually an http.Agent instance, so relinquish - // responsibility for this `req` to the Agent from here on - socket.addRequest(req, opts); - } else if (socket) { - function onfree() { - freeSocket(socket, opts); - } - socket.on('free', onfree); - req.onSocket(socket); - } else { - const err = new Error( - 'no Duplex stream was returned to agent-base for `' + req.method + ' ' + req.path + '`' - ); - onerror(err); - } - } - - if (!this._promisifiedCallback && this.callback.length >= 3) { - // Legacy callback function - convert to a Promise - this.callback = promisify(this.callback, this); - this._promisifiedCallback = true; - } - - if (timeoutMs > 0) { - timeout = setTimeout(ontimeout, timeoutMs); - } - - try { - Promise.resolve(this.callback(req, opts)).then(onsocket, callbackError); - } catch (err) { - Promise.reject(err).catch(callbackError); - } -}; - -Agent.prototype.freeSocket = function freeSocket(socket, opts) { - // TODO reuse sockets - socket.destroy(); -}; diff --git a/deps/npm/node_modules/socks-proxy-agent/node_modules/agent-base/package.json b/deps/npm/node_modules/socks-proxy-agent/node_modules/agent-base/package.json deleted file mode 100644 index 01139d0a640006..00000000000000 --- a/deps/npm/node_modules/socks-proxy-agent/node_modules/agent-base/package.json +++ /dev/null @@ -1,65 +0,0 @@ -{ - "_from": "agent-base@~4.2.1", - "_id": "agent-base@4.2.1", - "_inBundle": false, - "_integrity": "sha512-JVwXMr9nHYTUXsBFKUqhJwvlcYU/blreOEUkhNR2eXZIvwd+c+o5V4MgDPKWnMS/56awN3TRzIP+KoPn+roQtg==", - "_location": "/socks-proxy-agent/agent-base", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "agent-base@~4.2.1", - "name": "agent-base", - "escapedName": "agent-base", - "rawSpec": "~4.2.1", - "saveSpec": null, - "fetchSpec": "~4.2.1" - }, - "_requiredBy": [ - "/socks-proxy-agent" - ], - "_resolved": "https://registry.npmjs.org/agent-base/-/agent-base-4.2.1.tgz", - "_shasum": "d89e5999f797875674c07d87f260fc41e83e8ca9", - "_spec": "agent-base@~4.2.1", - "_where": "/Users/isaacs/dev/npm/cli/node_modules/socks-proxy-agent", - "author": { - "name": "Nathan Rajlich", - "email": "nathan@tootallnate.net", - "url": "http://n8.io/" - }, - "bugs": { - "url": "https://github.com/TooTallNate/node-agent-base/issues" - }, - "bundleDependencies": false, - "dependencies": { - "es6-promisify": "^5.0.0" - }, - "deprecated": false, - "description": "Turn a function into an `http.Agent` instance", - "devDependencies": { - "mocha": "^3.4.2", - "ws": "^3.0.0" - }, - "engines": { - "node": ">= 4.0.0" - }, - "homepage": "https://github.com/TooTallNate/node-agent-base#readme", - "keywords": [ - "http", - "agent", - "base", - "barebones", - "https" - ], - "license": "MIT", - "main": "./index.js", - "name": "agent-base", - "repository": { - "type": "git", - "url": "git://github.com/TooTallNate/node-agent-base.git" - }, - "scripts": { - "test": "mocha --reporter spec" - }, - "version": "4.2.1" -} diff --git a/deps/npm/node_modules/socks-proxy-agent/node_modules/agent-base/patch-core.js b/deps/npm/node_modules/socks-proxy-agent/node_modules/agent-base/patch-core.js deleted file mode 100644 index 47d26a72b0a65e..00000000000000 --- a/deps/npm/node_modules/socks-proxy-agent/node_modules/agent-base/patch-core.js +++ /dev/null @@ -1,37 +0,0 @@ -'use strict'; -const url = require('url'); -const https = require('https'); - -/** - * This currently needs to be applied to all Node.js versions - * in order to determine if the `req` is an HTTP or HTTPS request. - * - * There is currently no PR attempting to move this property upstream. - */ -https.request = (function(request) { - return function(_options, cb) { - let options; - if (typeof _options === 'string') { - options = url.parse(_options); - } else { - options = Object.assign({}, _options); - } - if (null == options.port) { - options.port = 443; - } - options.secureEndpoint = true; - return request.call(https, options, cb); - }; -})(https.request); - -/** - * This is needed for Node.js >= 9.0.0 to make sure `https.get()` uses the - * patched `https.request()`. - * - * Ref: https://github.com/nodejs/node/commit/5118f31 - */ -https.get = function(options, cb) { - const req = https.request(options, cb); - req.end(); - return req; -}; diff --git a/deps/npm/node_modules/socks-proxy-agent/node_modules/agent-base/test/ssl-cert-snakeoil.key b/deps/npm/node_modules/socks-proxy-agent/node_modules/agent-base/test/ssl-cert-snakeoil.key deleted file mode 100644 index fd12501220a564..00000000000000 --- a/deps/npm/node_modules/socks-proxy-agent/node_modules/agent-base/test/ssl-cert-snakeoil.key +++ /dev/null @@ -1,15 +0,0 @@ ------BEGIN RSA PRIVATE KEY----- -MIICWwIBAAKBgQCzURxIqzer0ACAbX/lHdsn4Gd9PLKrf7EeDYfIdV0HZKPD8WDr -bBx2/fBu0OW2sjnzv/SVZbJ0DAuPE/p0+eT0qb2qC10iz9iTD7ribd7gxhirVb8y -b3fBjXsxc8V8p4Ny1LcvNSqCjwUbJqdRogfoJeTiqPM58z5sNzuv5iq7iwIDAQAB -AoGAPMQy4olrP0UotlzlJ36bowLP70ffgHCwU+/f4NWs5fF78c3du0oSx1w820Dd -Z7E0JF8bgnlJJTxjumPZz0RUCugrEHBKJmzEz3cxF5E3+7NvteZcjKn9D67RrM5x -1/uSZ9cqKE9cYvY4fSuHx18diyZ4axR/wB1Pea2utjjDM+ECQQDb9ZbmmaWMiRpQ -5Up+loxP7BZNPsEVsm+DVJmEFbaFgGfncWBqSIqnPNjMwTwj0OigTwCAEGPkfRVW -T0pbYWCxAkEA0LK7SCTwzyDmhASUalk0x+3uCAA6ryFdwJf/wd8TRAvVOmkTEldX -uJ7ldLvfrONYO3v56uKTU/SoNdZYzKtO+wJAX2KM4ctXYy5BXztPpr2acz4qHa1N -Bh+vBAC34fOYhyQ76r3b1btHhWZ5jbFuZwm9F2erC94Ps5IaoqcX07DSwQJAPKGw -h2U0EPkd/3zVIZCJJQya+vgWFIs9EZcXVtvYXQyTBkVApTN66MhBIYjzkub5205J -bVQmOV37AKklY1DhwQJAA1wos0cYxro02edzatxd0DIR2r4qqOqLkw6BhYHhq6HJ -ZvIcQkHqdSXzdETFc01I1znDGGIrJHcnvKWgBPoEUg== ------END RSA PRIVATE KEY----- diff --git a/deps/npm/node_modules/socks-proxy-agent/node_modules/agent-base/test/ssl-cert-snakeoil.pem b/deps/npm/node_modules/socks-proxy-agent/node_modules/agent-base/test/ssl-cert-snakeoil.pem deleted file mode 100644 index b115a5e91498de..00000000000000 --- a/deps/npm/node_modules/socks-proxy-agent/node_modules/agent-base/test/ssl-cert-snakeoil.pem +++ /dev/null @@ -1,12 +0,0 @@ ------BEGIN CERTIFICATE----- -MIIB1TCCAT4CCQDV5mPlzm9+izANBgkqhkiG9w0BAQUFADAvMS0wKwYDVQQDEyQ3 -NTI3YmQ3Ny1hYjNlLTQ3NGItYWNlNy1lZWQ2MDUzOTMxZTcwHhcNMTUwNzA2MjI0 -NTA3WhcNMjUwNzAzMjI0NTA3WjAvMS0wKwYDVQQDEyQ3NTI3YmQ3Ny1hYjNlLTQ3 -NGItYWNlNy1lZWQ2MDUzOTMxZTcwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGB -ALNRHEirN6vQAIBtf+Ud2yfgZ308sqt/sR4Nh8h1XQdko8PxYOtsHHb98G7Q5bay -OfO/9JVlsnQMC48T+nT55PSpvaoLXSLP2JMPuuJt3uDGGKtVvzJvd8GNezFzxXyn -g3LUty81KoKPBRsmp1GiB+gl5OKo8znzPmw3O6/mKruLAgMBAAEwDQYJKoZIhvcN -AQEFBQADgYEACzoHUF8UV2Z6541Q2wKEA0UFUzmUjf/E1XwBO+1P15ZZ64uw34B4 -1RwMPtAo9RY/PmICTWtNxWGxkzwb2JtDWtnxVER/lF8k2XcXPE76fxTHJF/BKk9J -QU8OTD1dd9gHCBviQB9TqntRZ5X7axjtuWjb2umY+owBYzAHZkp1HKI= ------END CERTIFICATE----- diff --git a/deps/npm/node_modules/socks-proxy-agent/node_modules/agent-base/test/test.js b/deps/npm/node_modules/socks-proxy-agent/node_modules/agent-base/test/test.js deleted file mode 100644 index 6a8ca68e0dcbf7..00000000000000 --- a/deps/npm/node_modules/socks-proxy-agent/node_modules/agent-base/test/test.js +++ /dev/null @@ -1,697 +0,0 @@ -/** - * Module dependencies. - */ - -var fs = require('fs'); -var url = require('url'); -var net = require('net'); -var tls = require('tls'); -var http = require('http'); -var https = require('https'); -var WebSocket = require('ws'); -var assert = require('assert'); -var events = require('events'); -var inherits = require('util').inherits; -var Agent = require('../'); - -var PassthroughAgent = Agent(function(req, opts) { - return opts.secureEndpoint ? https.globalAgent : http.globalAgent; -}); - -describe('Agent', function() { - describe('subclass', function() { - it('should be subclassable', function(done) { - function MyAgent() { - Agent.call(this); - } - inherits(MyAgent, Agent); - - MyAgent.prototype.callback = function(req, opts, fn) { - assert.equal(req.path, '/foo'); - assert.equal(req.getHeader('host'), '127.0.0.1:1234'); - assert.equal(opts.secureEndpoint, true); - done(); - }; - - var info = url.parse('https://127.0.0.1:1234/foo'); - info.agent = new MyAgent(); - https.get(info); - }); - }); - describe('options', function() { - it('should support an options Object as first argument', function() { - var agent = new Agent({ timeout: 1000 }); - assert.equal(1000, agent.timeout); - }); - it('should support an options Object as second argument', function() { - var agent = new Agent(function() {}, { timeout: 1000 }); - assert.equal(1000, agent.timeout); - }); - it('should be mixed in with HTTP request options', function(done) { - var agent = new Agent({ - host: 'my-proxy.com', - port: 3128, - foo: 'bar' - }); - agent.callback = function(req, opts, fn) { - assert.equal('bar', opts.foo); - assert.equal('a', opts.b); - - // `host` and `port` are special-cases, and should always be - // overwritten in the request `opts` inside the agent-base callback - assert.equal('localhost', opts.host); - assert.equal(80, opts.port); - done(); - }; - var opts = { - b: 'a', - agent: agent - }; - http.get(opts); - }); - }); - describe('`this` context', function() { - it('should be the Agent instance', function(done) { - var called = false; - var agent = new Agent(); - agent.callback = function() { - called = true; - assert.equal(this, agent); - }; - var info = url.parse('http://127.0.0.1/foo'); - info.agent = agent; - var req = http.get(info); - req.on('error', function(err) { - assert(/no Duplex stream was returned/.test(err.message)); - done(); - }); - }); - it('should be the Agent instance with callback signature', function(done) { - var called = false; - var agent = new Agent(); - agent.callback = function(req, opts, fn) { - called = true; - assert.equal(this, agent); - fn(); - }; - var info = url.parse('http://127.0.0.1/foo'); - info.agent = agent; - var req = http.get(info); - req.on('error', function(err) { - assert(/no Duplex stream was returned/.test(err.message)); - done(); - }); - }); - }); - describe('"error" event', function() { - it('should be invoked on `http.ClientRequest` instance if `callback()` has not been defined', function( - done - ) { - var agent = new Agent(); - var info = url.parse('http://127.0.0.1/foo'); - info.agent = agent; - var req = http.get(info); - req.on('error', function(err) { - assert.equal( - '"agent-base" has no default implementation, you must subclass and override `callback()`', - err.message - ); - done(); - }); - }); - it('should be invoked on `http.ClientRequest` instance if Error passed to callback function on the first tick', function( - done - ) { - var agent = new Agent(function(req, opts, fn) { - fn(new Error('is this caught?')); - }); - var info = url.parse('http://127.0.0.1/foo'); - info.agent = agent; - var req = http.get(info); - req.on('error', function(err) { - assert.equal('is this caught?', err.message); - done(); - }); - }); - it('should be invoked on `http.ClientRequest` instance if Error passed to callback function after the first tick', function( - done - ) { - var agent = new Agent(function(req, opts, fn) { - setTimeout(function() { - fn(new Error('is this caught?')); - }, 10); - }); - var info = url.parse('http://127.0.0.1/foo'); - info.agent = agent; - var req = http.get(info); - req.on('error', function(err) { - assert.equal('is this caught?', err.message); - done(); - }); - }); - }); - describe('artificial "streams"', function() { - it('should send a GET request', function(done) { - var stream = new events.EventEmitter(); - - // needed for the `http` module to call .write() on the stream - stream.writable = true; - - stream.write = function(str) { - assert(0 == str.indexOf('GET / HTTP/1.1')); - done(); - }; - - // needed for `http` module in Node.js 4 - stream.cork = function() {}; - - var opts = { - method: 'GET', - host: '127.0.0.1', - path: '/', - port: 80, - agent: new Agent(function(req, opts, fn) { - fn(null, stream); - }) - }; - var req = http.request(opts); - req.end(); - }); - it('should receive a GET response', function(done) { - var stream = new events.EventEmitter(); - var opts = { - method: 'GET', - host: '127.0.0.1', - path: '/', - port: 80, - agent: new Agent(function(req, opts, fn) { - fn(null, stream); - }) - }; - var req = http.request(opts, function(res) { - assert.equal('0.9', res.httpVersion); - assert.equal(111, res.statusCode); - assert.equal('bar', res.headers.foo); - done(); - }); - - // have to wait for the "socket" event since `http.ClientRequest` - // doesn't *actually* attach the listeners to the "stream" until - // this happens - req.once('socket', function() { - var buf = new Buffer( - 'HTTP/0.9 111\r\n' + - 'Foo: bar\r\n' + - 'Set-Cookie: 1\r\n' + - 'Set-Cookie: 2\r\n\r\n' - ); - stream.emit('data', buf); - }); - - req.end(); - }); - }); -}); - -describe('"http" module', function() { - var server; - var port; - - // setup test HTTP server - before(function(done) { - server = http.createServer(); - server.listen(0, function() { - port = server.address().port; - done(); - }); - }); - - // shut down test HTTP server - after(function(done) { - server.once('close', function() { - done(); - }); - server.close(); - }); - - it('should work for basic HTTP requests', function(done) { - var called = false; - var agent = new Agent(function(req, opts, fn) { - called = true; - var socket = net.connect(opts); - fn(null, socket); - }); - - // add HTTP server "request" listener - var gotReq = false; - server.once('request', function(req, res) { - gotReq = true; - res.setHeader('X-Foo', 'bar'); - res.setHeader('X-Url', req.url); - res.end(); - }); - - var info = url.parse('http://127.0.0.1:' + port + '/foo'); - info.agent = agent; - http.get(info, function(res) { - assert.equal('bar', res.headers['x-foo']); - assert.equal('/foo', res.headers['x-url']); - assert(gotReq); - assert(called); - done(); - }); - }); - - it('should support direct return in `connect()`', function(done) { - var called = false; - var agent = new Agent(function(req, opts) { - called = true; - return net.connect(opts); - }); - - // add HTTP server "request" listener - var gotReq = false; - server.once('request', function(req, res) { - gotReq = true; - res.setHeader('X-Foo', 'bar'); - res.setHeader('X-Url', req.url); - res.end(); - }); - - var info = url.parse('http://127.0.0.1:' + port + '/foo'); - info.agent = agent; - http.get(info, function(res) { - assert.equal('bar', res.headers['x-foo']); - assert.equal('/foo', res.headers['x-url']); - assert(gotReq); - assert(called); - done(); - }); - }); - - it('should support returning a Promise in `connect()`', function(done) { - var called = false; - var agent = new Agent(function(req, opts) { - return new Promise(function(resolve, reject) { - called = true; - resolve(net.connect(opts)); - }); - }); - - // add HTTP server "request" listener - var gotReq = false; - server.once('request', function(req, res) { - gotReq = true; - res.setHeader('X-Foo', 'bar'); - res.setHeader('X-Url', req.url); - res.end(); - }); - - var info = url.parse('http://127.0.0.1:' + port + '/foo'); - info.agent = agent; - http.get(info, function(res) { - assert.equal('bar', res.headers['x-foo']); - assert.equal('/foo', res.headers['x-url']); - assert(gotReq); - assert(called); - done(); - }); - }); - - it('should set the `Connection: close` response header', function(done) { - var called = false; - var agent = new Agent(function(req, opts, fn) { - called = true; - var socket = net.connect(opts); - fn(null, socket); - }); - - // add HTTP server "request" listener - var gotReq = false; - server.once('request', function(req, res) { - gotReq = true; - res.setHeader('X-Url', req.url); - assert.equal('close', req.headers.connection); - res.end(); - }); - - var info = url.parse('http://127.0.0.1:' + port + '/bar'); - info.agent = agent; - http.get(info, function(res) { - assert.equal('/bar', res.headers['x-url']); - assert.equal('close', res.headers.connection); - assert(gotReq); - assert(called); - done(); - }); - }); - - it('should pass through options from `http.request()`', function(done) { - var agent = new Agent(function(req, opts, fn) { - assert.equal('google.com', opts.host); - assert.equal('bar', opts.foo); - done(); - }); - - http.get({ - host: 'google.com', - foo: 'bar', - agent: agent - }); - }); - - it('should default to port 80', function(done) { - var agent = new Agent(function(req, opts, fn) { - assert.equal(80, opts.port); - done(); - }); - - // (probably) not hitting a real HTTP server here, - // so no need to add a httpServer request listener - http.get({ - host: '127.0.0.1', - path: '/foo', - agent: agent - }); - }); - - it('should support the "timeout" option', function(done) { - // ensure we timeout after the "error" event had a chance to trigger - this.timeout(1000); - this.slow(800); - - var agent = new Agent( - function(req, opts, fn) { - // this function will time out - }, - { timeout: 100 } - ); - - var opts = url.parse('http://nodejs.org'); - opts.agent = agent; - - var req = http.get(opts); - req.once('error', function(err) { - assert.equal('ETIMEOUT', err.code); - req.abort(); - done(); - }); - }); - - it('should free sockets after use', function(done) { - var agent = new Agent(function(req, opts, fn) { - var socket = net.connect(opts); - fn(null, socket); - }); - - // add HTTP server "request" listener - var gotReq = false; - server.once('request', function(req, res) { - gotReq = true; - res.end(); - }); - - var info = url.parse('http://127.0.0.1:' + port + '/foo'); - info.agent = agent; - http.get(info, function(res) { - res.socket.emit('free'); - assert.equal(true, res.socket.destroyed); - assert(gotReq); - done(); - }); - }); - - - describe('PassthroughAgent', function() { - it('should pass through to `http.globalAgent`', function(done) { - // add HTTP server "request" listener - var gotReq = false; - server.once('request', function(req, res) { - gotReq = true; - res.setHeader('X-Foo', 'bar'); - res.setHeader('X-Url', req.url); - res.end(); - }); - - var info = url.parse('http://127.0.0.1:' + port + '/foo'); - info.agent = PassthroughAgent; - http.get(info, function(res) { - assert.equal('bar', res.headers['x-foo']); - assert.equal('/foo', res.headers['x-url']); - assert(gotReq); - done(); - }); - }); - }); -}); - -describe('"https" module', function() { - var server; - var port; - - // setup test HTTPS server - before(function(done) { - var options = { - key: fs.readFileSync(__dirname + '/ssl-cert-snakeoil.key'), - cert: fs.readFileSync(__dirname + '/ssl-cert-snakeoil.pem') - }; - server = https.createServer(options); - server.listen(0, function() { - port = server.address().port; - done(); - }); - }); - - // shut down test HTTP server - after(function(done) { - server.once('close', function() { - done(); - }); - server.close(); - }); - - it('should not modify the passed in Options object', function(done) { - var called = false; - var agent = new Agent(function(req, opts, fn) { - called = true; - assert.equal(true, opts.secureEndpoint); - assert.equal(443, opts.port); - assert.equal('localhost', opts.host); - }); - var opts = { agent: agent }; - var req = https.request(opts); - assert.equal(true, called); - assert.equal(false, 'secureEndpoint' in opts); - assert.equal(false, 'port' in opts); - done(); - }); - - it('should work with a String URL', function(done) { - var endpoint = 'https://127.0.0.1:' + port; - var req = https.get(endpoint); - - // it's gonna error out since `rejectUnauthorized` is not being passed in - req.on('error', function(err) { - assert.equal(err.code, 'DEPTH_ZERO_SELF_SIGNED_CERT'); - done(); - }); - }); - - it('should work for basic HTTPS requests', function(done) { - var called = false; - var agent = new Agent(function(req, opts, fn) { - called = true; - assert(opts.secureEndpoint); - var socket = tls.connect(opts); - fn(null, socket); - }); - - // add HTTPS server "request" listener - var gotReq = false; - server.once('request', function(req, res) { - gotReq = true; - res.setHeader('X-Foo', 'bar'); - res.setHeader('X-Url', req.url); - res.end(); - }); - - var info = url.parse('https://127.0.0.1:' + port + '/foo'); - info.agent = agent; - info.rejectUnauthorized = false; - https.get(info, function(res) { - assert.equal('bar', res.headers['x-foo']); - assert.equal('/foo', res.headers['x-url']); - assert(gotReq); - assert(called); - done(); - }); - }); - - it('should pass through options from `https.request()`', function(done) { - var agent = new Agent(function(req, opts, fn) { - assert.equal('google.com', opts.host); - assert.equal('bar', opts.foo); - done(); - }); - - https.get({ - host: 'google.com', - foo: 'bar', - agent: agent - }); - }); - - it('should default to port 443', function(done) { - var agent = new Agent(function(req, opts, fn) { - assert.equal(true, opts.secureEndpoint); - assert.equal(false, opts.rejectUnauthorized); - assert.equal(443, opts.port); - done(); - }); - - // (probably) not hitting a real HTTPS server here, - // so no need to add a httpsServer request listener - https.get({ - host: '127.0.0.1', - path: '/foo', - agent: agent, - rejectUnauthorized: false - }); - }); - - describe('PassthroughAgent', function() { - it('should pass through to `https.globalAgent`', function(done) { - // add HTTP server "request" listener - var gotReq = false; - server.once('request', function(req, res) { - gotReq = true; - res.setHeader('X-Foo', 'bar'); - res.setHeader('X-Url', req.url); - res.end(); - }); - - var info = url.parse('https://127.0.0.1:' + port + '/foo'); - info.agent = PassthroughAgent; - info.rejectUnauthorized = false; - https.get(info, function(res) { - assert.equal('bar', res.headers['x-foo']); - assert.equal('/foo', res.headers['x-url']); - assert(gotReq); - done(); - }); - }); - }); -}); - -describe('"ws" server', function() { - var wss; - var server; - var port; - - // setup test HTTP server - before(function(done) { - server = http.createServer(); - wss = new WebSocket.Server({ server: server }); - server.listen(0, function() { - port = server.address().port; - done(); - }); - }); - - // shut down test HTTP server - after(function(done) { - server.once('close', function() { - done(); - }); - server.close(); - }); - - it('should work for basic WebSocket connections', function(done) { - function onconnection(ws) { - ws.on('message', function(data) { - assert.equal('ping', data); - ws.send('pong'); - }); - } - wss.on('connection', onconnection); - - var agent = new Agent(function(req, opts, fn) { - var socket = net.connect(opts); - fn(null, socket); - }); - - var client = new WebSocket('ws://127.0.0.1:' + port + '/', { - agent: agent - }); - - client.on('open', function() { - client.send('ping'); - }); - - client.on('message', function(data) { - assert.equal('pong', data); - client.close(); - wss.removeListener('connection', onconnection); - done(); - }); - }); -}); - -describe('"wss" server', function() { - var wss; - var server; - var port; - - // setup test HTTP server - before(function(done) { - var options = { - key: fs.readFileSync(__dirname + '/ssl-cert-snakeoil.key'), - cert: fs.readFileSync(__dirname + '/ssl-cert-snakeoil.pem') - }; - server = https.createServer(options); - wss = new WebSocket.Server({ server: server }); - server.listen(0, function() { - port = server.address().port; - done(); - }); - }); - - // shut down test HTTP server - after(function(done) { - server.once('close', function() { - done(); - }); - server.close(); - }); - - it('should work for secure WebSocket connections', function(done) { - function onconnection(ws) { - ws.on('message', function(data) { - assert.equal('ping', data); - ws.send('pong'); - }); - } - wss.on('connection', onconnection); - - var agent = new Agent(function(req, opts, fn) { - var socket = tls.connect(opts); - fn(null, socket); - }); - - var client = new WebSocket('wss://127.0.0.1:' + port + '/', { - agent: agent, - rejectUnauthorized: false - }); - - client.on('open', function() { - client.send('ping'); - }); - - client.on('message', function(data) { - assert.equal('pong', data); - client.close(); - wss.removeListener('connection', onconnection); - done(); - }); - }); -}); diff --git a/deps/npm/node_modules/socks-proxy-agent/package.json b/deps/npm/node_modules/socks-proxy-agent/package.json index 7f7023f5a76d22..b5e6dc8c44fc68 100644 --- a/deps/npm/node_modules/socks-proxy-agent/package.json +++ b/deps/npm/node_modules/socks-proxy-agent/package.json @@ -1,71 +1,64 @@ { - "_from": "socks-proxy-agent@^4.0.0", - "_id": "socks-proxy-agent@4.0.2", - "_inBundle": false, - "_integrity": "sha512-NT6syHhI9LmuEMSK6Kd2V7gNv5KFZoLE7V5udWmn0de+3Mkj3UMA/AJPLyeNUVmElCurSHtUdM3ETpR3z770Wg==", - "_location": "/socks-proxy-agent", - "_phantomChildren": { - "es6-promisify": "5.0.0" - }, - "_requested": { - "type": "range", - "registry": true, - "raw": "socks-proxy-agent@^4.0.0", - "name": "socks-proxy-agent", - "escapedName": "socks-proxy-agent", - "rawSpec": "^4.0.0", - "saveSpec": null, - "fetchSpec": "^4.0.0" - }, - "_requiredBy": [ - "/make-fetch-happen" - ], - "_resolved": "https://registry.npmjs.org/socks-proxy-agent/-/socks-proxy-agent-4.0.2.tgz", - "_shasum": "3c8991f3145b2799e70e11bd5fbc8b1963116386", - "_spec": "socks-proxy-agent@^4.0.0", - "_where": "/Users/isaacs/dev/npm/cli/node_modules/make-fetch-happen", - "author": { - "name": "Nathan Rajlich", - "email": "nathan@tootallnate.net", - "url": "http://n8.io/" - }, - "bugs": { - "url": "https://github.com/TooTallNate/node-socks-proxy-agent/issues" - }, - "bundleDependencies": false, - "dependencies": { - "agent-base": "~4.2.1", - "socks": "~2.3.2" - }, - "deprecated": false, + "name": "socks-proxy-agent", + "version": "5.0.0", "description": "A SOCKS proxy `http.Agent` implementation for HTTP and HTTPS", - "devDependencies": { - "mocha": "~5.1.0", - "raw-body": "~2.3.2", - "socksv5": "0.0.6" + "main": "dist/index", + "typings": "dist/index", + "files": [ + "dist" + ], + "scripts": { + "prebuild": "rimraf dist", + "build": "tsc", + "test": "mocha --reporter spec", + "test-lint": "eslint src --ext .js,.ts", + "prepublishOnly": "npm run build" }, - "engines": { - "node": ">= 6" + "repository": { + "type": "git", + "url": "git://github.com/TooTallNate/node-socks-proxy-agent.git" }, - "homepage": "https://github.com/TooTallNate/node-socks-proxy-agent#readme", "keywords": [ "socks", "socks4", "socks4a", + "socks5", + "socks5h", "proxy", "http", "https", "agent" ], + "author": "Nathan Rajlich (http://n8.io/)", "license": "MIT", - "main": "./index.js", - "name": "socks-proxy-agent", - "repository": { - "type": "git", - "url": "git://github.com/TooTallNate/node-socks-proxy-agent.git" + "bugs": { + "url": "https://github.com/TooTallNate/node-socks-proxy-agent/issues" }, - "scripts": { - "test": "mocha --reporter spec" + "dependencies": { + "agent-base": "6", + "debug": "4", + "socks": "^2.3.3" }, - "version": "4.0.2" + "devDependencies": { + "@types/debug": "4", + "@types/node": "^12.12.11", + "@typescript-eslint/eslint-plugin": "1.6.0", + "@typescript-eslint/parser": "1.1.0", + "eslint": "5.16.0", + "eslint-config-airbnb": "17.1.0", + "eslint-config-prettier": "4.1.0", + "eslint-import-resolver-typescript": "1.1.1", + "eslint-plugin-import": "2.16.0", + "eslint-plugin-jsx-a11y": "6.2.1", + "eslint-plugin-react": "7.12.4", + "mocha": "^6.2.2", + "proxy": "1", + "raw-body": "^2.3.2", + "rimraf": "^3.0.0", + "socksv5": "TooTallNate/socksv5#fix/dstSock-close-event", + "typescript": "^3.5.3" + }, + "engines": { + "node": ">= 6" + } } diff --git a/deps/npm/node_modules/socks-proxy-agent/test/ssl-cert-snakeoil.key b/deps/npm/node_modules/socks-proxy-agent/test/ssl-cert-snakeoil.key deleted file mode 100644 index fd12501220a564..00000000000000 --- a/deps/npm/node_modules/socks-proxy-agent/test/ssl-cert-snakeoil.key +++ /dev/null @@ -1,15 +0,0 @@ ------BEGIN RSA PRIVATE KEY----- -MIICWwIBAAKBgQCzURxIqzer0ACAbX/lHdsn4Gd9PLKrf7EeDYfIdV0HZKPD8WDr -bBx2/fBu0OW2sjnzv/SVZbJ0DAuPE/p0+eT0qb2qC10iz9iTD7ribd7gxhirVb8y -b3fBjXsxc8V8p4Ny1LcvNSqCjwUbJqdRogfoJeTiqPM58z5sNzuv5iq7iwIDAQAB -AoGAPMQy4olrP0UotlzlJ36bowLP70ffgHCwU+/f4NWs5fF78c3du0oSx1w820Dd -Z7E0JF8bgnlJJTxjumPZz0RUCugrEHBKJmzEz3cxF5E3+7NvteZcjKn9D67RrM5x -1/uSZ9cqKE9cYvY4fSuHx18diyZ4axR/wB1Pea2utjjDM+ECQQDb9ZbmmaWMiRpQ -5Up+loxP7BZNPsEVsm+DVJmEFbaFgGfncWBqSIqnPNjMwTwj0OigTwCAEGPkfRVW -T0pbYWCxAkEA0LK7SCTwzyDmhASUalk0x+3uCAA6ryFdwJf/wd8TRAvVOmkTEldX -uJ7ldLvfrONYO3v56uKTU/SoNdZYzKtO+wJAX2KM4ctXYy5BXztPpr2acz4qHa1N -Bh+vBAC34fOYhyQ76r3b1btHhWZ5jbFuZwm9F2erC94Ps5IaoqcX07DSwQJAPKGw -h2U0EPkd/3zVIZCJJQya+vgWFIs9EZcXVtvYXQyTBkVApTN66MhBIYjzkub5205J -bVQmOV37AKklY1DhwQJAA1wos0cYxro02edzatxd0DIR2r4qqOqLkw6BhYHhq6HJ -ZvIcQkHqdSXzdETFc01I1znDGGIrJHcnvKWgBPoEUg== ------END RSA PRIVATE KEY----- diff --git a/deps/npm/node_modules/socks-proxy-agent/test/ssl-cert-snakeoil.pem b/deps/npm/node_modules/socks-proxy-agent/test/ssl-cert-snakeoil.pem deleted file mode 100644 index b115a5e91498de..00000000000000 --- a/deps/npm/node_modules/socks-proxy-agent/test/ssl-cert-snakeoil.pem +++ /dev/null @@ -1,12 +0,0 @@ ------BEGIN CERTIFICATE----- -MIIB1TCCAT4CCQDV5mPlzm9+izANBgkqhkiG9w0BAQUFADAvMS0wKwYDVQQDEyQ3 -NTI3YmQ3Ny1hYjNlLTQ3NGItYWNlNy1lZWQ2MDUzOTMxZTcwHhcNMTUwNzA2MjI0 -NTA3WhcNMjUwNzAzMjI0NTA3WjAvMS0wKwYDVQQDEyQ3NTI3YmQ3Ny1hYjNlLTQ3 -NGItYWNlNy1lZWQ2MDUzOTMxZTcwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGB -ALNRHEirN6vQAIBtf+Ud2yfgZ308sqt/sR4Nh8h1XQdko8PxYOtsHHb98G7Q5bay -OfO/9JVlsnQMC48T+nT55PSpvaoLXSLP2JMPuuJt3uDGGKtVvzJvd8GNezFzxXyn -g3LUty81KoKPBRsmp1GiB+gl5OKo8znzPmw3O6/mKruLAgMBAAEwDQYJKoZIhvcN -AQEFBQADgYEACzoHUF8UV2Z6541Q2wKEA0UFUzmUjf/E1XwBO+1P15ZZ64uw34B4 -1RwMPtAo9RY/PmICTWtNxWGxkzwb2JtDWtnxVER/lF8k2XcXPE76fxTHJF/BKk9J -QU8OTD1dd9gHCBviQB9TqntRZ5X7axjtuWjb2umY+owBYzAHZkp1HKI= ------END CERTIFICATE----- diff --git a/deps/npm/node_modules/socks-proxy-agent/test/test.js b/deps/npm/node_modules/socks-proxy-agent/test/test.js deleted file mode 100644 index 968ef650fb6d7b..00000000000000 --- a/deps/npm/node_modules/socks-proxy-agent/test/test.js +++ /dev/null @@ -1,144 +0,0 @@ - -/** - * Module dependencies. - */ - -var fs = require('fs'); -var url = require('url'); -var http = require('http'); -var https = require('https'); -var assert = require('assert'); -var socks = require('socksv5'); -var getRawBody = require('raw-body'); -var SocksProxyAgent = require('../'); - -describe('SocksProxyAgent', function () { - var httpServer, httpPort; - var httpsServer, httpsPort; - var socksServer, socksPort; - - before(function (done) { - // setup SOCKS proxy server - socksServer = socks.createServer(function(info, accept, deny) { - accept(); - }); - socksServer.listen(0, '127.0.0.1', function() { - socksPort = socksServer.address().port; - //console.log('SOCKS server listening on port %d', socksPort); - done(); - }); - socksServer.useAuth(socks.auth.None()); - //socksServer.useAuth(socks.auth.UserPassword(function(user, password, cb) { - // cb(user === 'nodejs' && password === 'rules!'); - //})); - }); - - before(function (done) { - // setup target HTTP server - httpServer = http.createServer(); - httpServer.listen(function () { - httpPort = httpServer.address().port; - done(); - }); - }); - - before(function (done) { - // setup target SSL HTTPS server - var options = { - key: fs.readFileSync(__dirname + '/ssl-cert-snakeoil.key'), - cert: fs.readFileSync(__dirname + '/ssl-cert-snakeoil.pem') - }; - httpsServer = https.createServer(options); - httpsServer.listen(function () { - httpsPort = httpsServer.address().port; - done(); - }); - }); - - after(function (done) { - socksServer.once('close', function () { done(); }); - socksServer.close(); - }); - - after(function (done) { - httpServer.once('close', function () { done(); }); - httpServer.close(); - }); - - after(function (done) { - httpsServer.once('close', function () { done(); }); - httpsServer.close(); - }); - - describe('constructor', function () { - it('should throw an Error if no "proxy" argument is given', function () { - assert.throws(function () { - new SocksProxyAgent(); - }); - }); - it('should accept a "string" proxy argument', function () { - var agent = new SocksProxyAgent('socks://127.0.0.1:' + socksPort); - assert.equal('127.0.0.1', agent.proxy.host); - assert.equal(socksPort, agent.proxy.port); - }); - it('should accept a `url.parse()` result object argument', function () { - var opts = url.parse('socks://127.0.0.1:' + socksPort); - var agent = new SocksProxyAgent(opts); - assert.equal('127.0.0.1', agent.proxy.host); - assert.equal(socksPort, agent.proxy.port); - }); - }); - - describe('"http" module', function () { - it('should work against an HTTP endpoint', function (done) { - httpServer.once('request', function (req, res) { - assert.equal('/foo', req.url); - res.statusCode = 404; - res.end(JSON.stringify(req.headers)); - }); - - var agent = new SocksProxyAgent('socks://127.0.0.1:' + socksPort); - var opts = url.parse('http://127.0.0.1:' + httpPort + '/foo'); - opts.agent = agent; - opts.headers = { foo: 'bar' }; - var req = http.get(opts, function (res) { - assert.equal(404, res.statusCode); - getRawBody(res, 'utf8', function (err, buf) { - if (err) return done(err); - var data = JSON.parse(buf); - assert.equal('bar', data.foo); - done(); - }); - }); - req.once('error', done); - }); - }); - - describe('"https" module', function () { - it('should work against an HTTPS endpoint', function (done) { - httpsServer.once('request', function (req, res) { - assert.equal('/foo', req.url); - res.statusCode = 404; - res.end(JSON.stringify(req.headers)); - }); - - var agent = new SocksProxyAgent('socks://127.0.0.1:' + socksPort); - var opts = url.parse('https://127.0.0.1:' + httpsPort + '/foo'); - opts.agent = agent; - opts.rejectUnauthorized = false; - - opts.headers = { foo: 'bar' }; - var req = https.get(opts, function (res) { - assert.equal(404, res.statusCode); - getRawBody(res, 'utf8', function (err, buf) { - if (err) return done(err); - var data = JSON.parse(buf); - assert.equal('bar', data.foo); - done(); - }); - }); - req.once('error', done); - }); - }); - -}); diff --git a/deps/npm/node_modules/socks-proxy-agent/yarn.lock b/deps/npm/node_modules/socks-proxy-agent/yarn.lock deleted file mode 100644 index 337f8152b79dcf..00000000000000 --- a/deps/npm/node_modules/socks-proxy-agent/yarn.lock +++ /dev/null @@ -1,354 +0,0 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. -# yarn lockfile v1 - - -agent-base@~4.2.1: - version "4.2.1" - resolved "https://registry.yarnpkg.com/agent-base/-/agent-base-4.2.1.tgz#d89e5999f797875674c07d87f260fc41e83e8ca9" - integrity sha512-JVwXMr9nHYTUXsBFKUqhJwvlcYU/blreOEUkhNR2eXZIvwd+c+o5V4MgDPKWnMS/56awN3TRzIP+KoPn+roQtg== - dependencies: - es6-promisify "^5.0.0" - -async@0.2.x: - version "0.2.10" - resolved "https://registry.yarnpkg.com/async/-/async-0.2.10.tgz#b6bbe0b0674b9d719708ca38de8c237cb526c3d1" - integrity sha1-trvgsGdLnXGXCMo43owjfLUmw9E= - -balanced-match@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767" - integrity sha1-ibTRmasr7kneFk6gK4nORi1xt2c= - -brace-expansion@^1.1.7: - version "1.1.11" - resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" - integrity sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA== - dependencies: - balanced-match "^1.0.0" - concat-map "0.0.1" - -browser-stdout@1.3.1: - version "1.3.1" - resolved "https://registry.yarnpkg.com/browser-stdout/-/browser-stdout-1.3.1.tgz#baa559ee14ced73452229bad7326467c61fabd60" - integrity sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw== - -bytes@3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/bytes/-/bytes-3.0.0.tgz#d32815404d689699f85a4ea4fa8755dd13a96048" - integrity sha1-0ygVQE1olpn4Wk6k+odV3ROpYEg= - -cli@0.4.x: - version "0.4.5" - resolved "https://registry.yarnpkg.com/cli/-/cli-0.4.5.tgz#78f9485cd161b566e9a6c72d7170c4270e81db61" - integrity sha1-ePlIXNFhtWbppsctcXDEJw6B22E= - dependencies: - glob ">= 3.1.4" - -cliff@0.1.x: - version "0.1.10" - resolved "https://registry.yarnpkg.com/cliff/-/cliff-0.1.10.tgz#53be33ea9f59bec85609ee300ac4207603e52013" - integrity sha1-U74z6p9ZvshWCe4wCsQgdgPlIBM= - dependencies: - colors "~1.0.3" - eyes "~0.1.8" - winston "0.8.x" - -colors@0.6.x: - version "0.6.2" - resolved "https://registry.yarnpkg.com/colors/-/colors-0.6.2.tgz#2423fe6678ac0c5dae8852e5d0e5be08c997abcc" - integrity sha1-JCP+ZnisDF2uiFLl0OW+CMmXq8w= - -colors@~1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/colors/-/colors-1.0.3.tgz#0433f44d809680fdeb60ed260f1b0c262e82a40b" - integrity sha1-BDP0TYCWgP3rYO0mDxsMJi6CpAs= - -commander@2.11.0: - version "2.11.0" - resolved "https://registry.yarnpkg.com/commander/-/commander-2.11.0.tgz#157152fd1e7a6c8d98a5b715cf376df928004563" - integrity sha512-b0553uYA5YAEGgyYIGYROzKQ7X5RAqedkfjiZxwi0kL1g3bOaBNNZfYkzt/CL0umgD5wc9Jec2FbB98CjkMRvQ== - -concat-map@0.0.1: - version "0.0.1" - resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" - integrity sha1-2Klr13/Wjfd5OnMDajug1UBdR3s= - -cycle@1.0.x: - version "1.0.3" - resolved "https://registry.yarnpkg.com/cycle/-/cycle-1.0.3.tgz#21e80b2be8580f98b468f379430662b046c34ad2" - integrity sha1-IegLK+hYD5i0aPN5QwZisEbDStI= - -debug@3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/debug/-/debug-3.1.0.tgz#5bb5a0672628b64149566ba16819e61518c67261" - integrity sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g== - dependencies: - ms "2.0.0" - -depd@~1.1.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/depd/-/depd-1.1.2.tgz#9bcd52e14c097763e749b274c4346ed2e560b5a9" - integrity sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak= - -diff@3.5.0: - version "3.5.0" - resolved "https://registry.yarnpkg.com/diff/-/diff-3.5.0.tgz#800c0dd1e0a8bfbc95835c202ad220fe317e5a12" - integrity sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA== - -es6-promise@^4.0.3: - version "4.2.6" - resolved "https://registry.yarnpkg.com/es6-promise/-/es6-promise-4.2.6.tgz#b685edd8258886365ea62b57d30de28fadcd974f" - integrity sha512-aRVgGdnmW2OiySVPUC9e6m+plolMAJKjZnQlCwNSuK5yQ0JN61DZSO1X1Ufd1foqWRAlig0rhduTCHe7sVtK5Q== - -es6-promisify@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/es6-promisify/-/es6-promisify-5.0.0.tgz#5109d62f3e56ea967c4b63505aef08291c8a5203" - integrity sha1-UQnWLz5W6pZ8S2NQWu8IKRyKUgM= - dependencies: - es6-promise "^4.0.3" - -escape-string-regexp@1.0.5: - version "1.0.5" - resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" - integrity sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ= - -eyes@0.1.x, eyes@~0.1.8: - version "0.1.8" - resolved "https://registry.yarnpkg.com/eyes/-/eyes-0.1.8.tgz#62cf120234c683785d902348a800ef3e0cc20bc0" - integrity sha1-Ys8SAjTGg3hdkCNIqADvPgzCC8A= - -fs.realpath@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" - integrity sha1-FQStJSMVjKpA20onh8sBQRmU6k8= - -glob@7.1.2: - version "7.1.2" - resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.2.tgz#c19c9df9a028702d678612384a6552404c636d15" - integrity sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ== - dependencies: - fs.realpath "^1.0.0" - inflight "^1.0.4" - inherits "2" - minimatch "^3.0.4" - once "^1.3.0" - path-is-absolute "^1.0.0" - -"glob@>= 3.1.4": - version "7.1.3" - resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.3.tgz#3960832d3f1574108342dafd3a67b332c0969df1" - integrity sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ== - dependencies: - fs.realpath "^1.0.0" - inflight "^1.0.4" - inherits "2" - minimatch "^3.0.4" - once "^1.3.0" - path-is-absolute "^1.0.0" - -growl@1.10.3: - version "1.10.3" - resolved "https://registry.yarnpkg.com/growl/-/growl-1.10.3.tgz#1926ba90cf3edfe2adb4927f5880bc22c66c790f" - integrity sha512-hKlsbA5Vu3xsh1Cg3J7jSmX/WaW6A5oBeqzM88oNbCRQFz+zUaXm6yxS4RVytp1scBoJzSYl4YAEOQIt6O8V1Q== - -has-flag@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-2.0.0.tgz#e8207af1cc7b30d446cc70b734b5e8be18f88d51" - integrity sha1-6CB68cx7MNRGzHC3NLXovhj4jVE= - -he@1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/he/-/he-1.1.1.tgz#93410fd21b009735151f8868c2f271f3427e23fd" - integrity sha1-k0EP0hsAlzUVH4howvJx80J+I/0= - -http-errors@1.6.3: - version "1.6.3" - resolved "https://registry.yarnpkg.com/http-errors/-/http-errors-1.6.3.tgz#8b55680bb4be283a0b5bf4ea2e38580be1d9320d" - integrity sha1-i1VoC7S+KDoLW/TqLjhYC+HZMg0= - dependencies: - depd "~1.1.2" - inherits "2.0.3" - setprototypeof "1.1.0" - statuses ">= 1.4.0 < 2" - -iconv-lite@0.4.23: - version "0.4.23" - resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.23.tgz#297871f63be507adcfbfca715d0cd0eed84e9a63" - integrity sha512-neyTUVFtahjf0mB3dZT77u+8O0QB89jFdnBkd5P1JgYPbPaia3gXXOVL2fq8VyU2gMMD7SaN7QukTB/pmXYvDA== - dependencies: - safer-buffer ">= 2.1.2 < 3" - -inflight@^1.0.4: - version "1.0.6" - resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" - integrity sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk= - dependencies: - once "^1.3.0" - wrappy "1" - -inherits@2, inherits@2.0.3: - version "2.0.3" - resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" - integrity sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4= - -ip@^1.1.5: - version "1.1.5" - resolved "https://registry.yarnpkg.com/ip/-/ip-1.1.5.tgz#bdded70114290828c0a039e72ef25f5aaec4354a" - integrity sha1-vd7XARQpCCjAoDnnLvJfWq7ENUo= - -ipv6@*: - version "3.1.3" - resolved "https://registry.yarnpkg.com/ipv6/-/ipv6-3.1.3.tgz#4d9064f9c2dafa0dd10b8b7d76ffca4aad31b3b9" - integrity sha1-TZBk+cLa+g3RC4t9dv/KSq0xs7k= - dependencies: - cli "0.4.x" - cliff "0.1.x" - sprintf "0.1.x" - -isstream@0.1.x: - version "0.1.2" - resolved "https://registry.yarnpkg.com/isstream/-/isstream-0.1.2.tgz#47e63f7af55afa6f92e1500e690eb8b8529c099a" - integrity sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo= - -minimatch@3.0.4, minimatch@^3.0.4: - version "3.0.4" - resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" - integrity sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA== - dependencies: - brace-expansion "^1.1.7" - -minimist@0.0.8: - version "0.0.8" - resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d" - integrity sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0= - -mkdirp@0.5.1: - version "0.5.1" - resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.1.tgz#30057438eac6cf7f8c4767f38648d6697d75c903" - integrity sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM= - dependencies: - minimist "0.0.8" - -mocha@~5.1.0: - version "5.1.1" - resolved "https://registry.yarnpkg.com/mocha/-/mocha-5.1.1.tgz#b774c75609dac05eb48f4d9ba1d827b97fde8a7b" - integrity sha512-kKKs/H1KrMMQIEsWNxGmb4/BGsmj0dkeyotEvbrAuQ01FcWRLssUNXCEUZk6SZtyJBi6EE7SL0zDDtItw1rGhw== - dependencies: - browser-stdout "1.3.1" - commander "2.11.0" - debug "3.1.0" - diff "3.5.0" - escape-string-regexp "1.0.5" - glob "7.1.2" - growl "1.10.3" - he "1.1.1" - minimatch "3.0.4" - mkdirp "0.5.1" - supports-color "4.4.0" - -ms@2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8" - integrity sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g= - -once@^1.3.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" - integrity sha1-WDsap3WWHUsROsF9nFC6753Xa9E= - dependencies: - wrappy "1" - -path-is-absolute@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" - integrity sha1-F0uSaHNVNP+8es5r9TpanhtcX18= - -pkginfo@0.3.x: - version "0.3.1" - resolved "https://registry.yarnpkg.com/pkginfo/-/pkginfo-0.3.1.tgz#5b29f6a81f70717142e09e765bbeab97b4f81e21" - integrity sha1-Wyn2qB9wcXFC4J52W76rl7T4HiE= - -raw-body@~2.3.2: - version "2.3.3" - resolved "https://registry.yarnpkg.com/raw-body/-/raw-body-2.3.3.tgz#1b324ece6b5706e153855bc1148c65bb7f6ea0c3" - integrity sha512-9esiElv1BrZoI3rCDuOuKCBRbuApGGaDPQfjSflGxdy4oyzqghxu6klEkkVIvBje+FF0BX9coEv8KqW6X/7njw== - dependencies: - bytes "3.0.0" - http-errors "1.6.3" - iconv-lite "0.4.23" - unpipe "1.0.0" - -"safer-buffer@>= 2.1.2 < 3": - version "2.1.2" - resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" - integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg== - -setprototypeof@1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/setprototypeof/-/setprototypeof-1.1.0.tgz#d0bd85536887b6fe7c0d818cb962d9d91c54e656" - integrity sha512-BvE/TwpZX4FXExxOxZyRGQQv651MSwmWKZGqvmPcRIjDqWub67kTKuIMx43cZZrS/cBBzwBcNDWoFxt2XEFIpQ== - -smart-buffer@4.0.2: - version "4.0.2" - resolved "https://registry.yarnpkg.com/smart-buffer/-/smart-buffer-4.0.2.tgz#5207858c3815cc69110703c6b94e46c15634395d" - integrity sha512-JDhEpTKzXusOqXZ0BUIdH+CjFdO/CR3tLlf5CN34IypI+xMmXW1uB16OOY8z3cICbJlDAVJzNbwBhNO0wt9OAw== - -socks@~2.3.2: - version "2.3.2" - resolved "https://registry.yarnpkg.com/socks/-/socks-2.3.2.tgz#ade388e9e6d87fdb11649c15746c578922a5883e" - integrity sha512-pCpjxQgOByDHLlNqlnh/mNSAxIUkyBBuwwhTcV+enZGbDaClPvHdvm6uvOwZfFJkam7cGhBNbb4JxiP8UZkRvQ== - dependencies: - ip "^1.1.5" - smart-buffer "4.0.2" - -socksv5@0.0.6: - version "0.0.6" - resolved "https://registry.yarnpkg.com/socksv5/-/socksv5-0.0.6.tgz#1327235ff7e8de21ac434a0a579dc69c3f071061" - integrity sha1-EycjX/fo3iGsQ0oKV53GnD8HEGE= - dependencies: - ipv6 "*" - -sprintf@0.1.x: - version "0.1.5" - resolved "https://registry.yarnpkg.com/sprintf/-/sprintf-0.1.5.tgz#8f83e39a9317c1a502cb7db8050e51c679f6edcf" - integrity sha1-j4PjmpMXwaUCy324BQ5Rxnn27c8= - -stack-trace@0.0.x: - version "0.0.10" - resolved "https://registry.yarnpkg.com/stack-trace/-/stack-trace-0.0.10.tgz#547c70b347e8d32b4e108ea1a2a159e5fdde19c0" - integrity sha1-VHxws0fo0ytOEI6hoqFZ5f3eGcA= - -"statuses@>= 1.4.0 < 2": - version "1.5.0" - resolved "https://registry.yarnpkg.com/statuses/-/statuses-1.5.0.tgz#161c7dac177659fd9811f43771fa99381478628c" - integrity sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow= - -supports-color@4.4.0: - version "4.4.0" - resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-4.4.0.tgz#883f7ddabc165142b2a61427f3352ded195d1a3e" - integrity sha512-rKC3+DyXWgK0ZLKwmRsrkyHVZAjNkfzeehuFWdGGcqGDTZFH73+RH6S/RDAAxl9GusSjZSUWYLmT9N5pzXFOXQ== - dependencies: - has-flag "^2.0.0" - -unpipe@1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/unpipe/-/unpipe-1.0.0.tgz#b2bf4ee8514aae6165b4817829d21b2ef49904ec" - integrity sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw= - -winston@0.8.x: - version "0.8.3" - resolved "https://registry.yarnpkg.com/winston/-/winston-0.8.3.tgz#64b6abf4cd01adcaefd5009393b1d8e8bec19db0" - integrity sha1-ZLar9M0Brcrv1QCTk7HY6L7BnbA= - dependencies: - async "0.2.x" - colors "0.6.x" - cycle "1.0.x" - eyes "0.1.x" - isstream "0.1.x" - pkginfo "0.3.x" - stack-trace "0.0.x" - -wrappy@1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" - integrity sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8= diff --git a/deps/npm/node_modules/socks/.prettierrc.yaml b/deps/npm/node_modules/socks/.prettierrc.yaml index a977335a82b4c0..d7b7335049b99b 100644 --- a/deps/npm/node_modules/socks/.prettierrc.yaml +++ b/deps/npm/node_modules/socks/.prettierrc.yaml @@ -2,4 +2,6 @@ parser: typescript printWidth: 80 tabWidth: 2 singleQuote: true -trailingComma: none +trailingComma: all +arrowParens: always +bracketSpacing: false \ No newline at end of file diff --git a/deps/npm/node_modules/socks/.travis.yml b/deps/npm/node_modules/socks/.travis.yml index f3f06280551fe9..2c6099bcdc2be1 100644 --- a/deps/npm/node_modules/socks/.travis.yml +++ b/deps/npm/node_modules/socks/.travis.yml @@ -1,12 +1,11 @@ language: node_js node_js: - - 6 - - 8 - 10 - 12 + - 14 - stable before_install: - - yarn global add typescript prettier tslint coveralls + - npm add -g typescript prettier tslint coveralls -script: "yarn run build && yarn run coveralls" \ No newline at end of file +script: "npm run build && npm run coveralls" \ No newline at end of file diff --git a/deps/npm/node_modules/socks/README.md b/deps/npm/node_modules/socks/README.md index 1aca04ac147387..f7fba45748711d 100644 --- a/deps/npm/node_modules/socks/README.md +++ b/deps/npm/node_modules/socks/README.md @@ -14,7 +14,7 @@ Fully featured SOCKS proxy client supporting SOCKSv4, SOCKSv4a, and SOCKSv5. Inc ### Requirements -* Node.js v6.0+ (Please use [v1](https://github.com/JoshGlazebrook/socks/tree/82d83923ad960693d8b774cafe17443ded7ed584) for older versions of Node.js) +* Node.js v10.0+ (Please use [v1](https://github.com/JoshGlazebrook/socks/tree/82d83923ad960693d8b774cafe17443ded7ed584) for older versions of Node.js) ### Looking for v1? * Docs for v1 are available [here](https://github.com/JoshGlazebrook/socks/tree/82d83923ad960693d8b774cafe17443ded7ed584) diff --git a/deps/npm/node_modules/socks/build/client/socksclient.js b/deps/npm/node_modules/socks/build/client/socksclient.js index 5eb80ce911dcdb..df3058a05aa3ce 100644 --- a/deps/npm/node_modules/socks/build/client/socksclient.js +++ b/deps/npm/node_modules/socks/build/client/socksclient.js @@ -9,6 +9,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge }); }; Object.defineProperty(exports, "__esModule", { value: true }); +exports.SocksClientError = exports.SocksClient = void 0; const events_1 = require("events"); const net = require("net"); const ip = require("ip"); @@ -17,14 +18,15 @@ const constants_1 = require("../common/constants"); const helpers_1 = require("../common/helpers"); const receivebuffer_1 = require("../common/receivebuffer"); const util_1 = require("../common/util"); +Object.defineProperty(exports, "SocksClientError", { enumerable: true, get: function () { return util_1.SocksClientError; } }); class SocksClient extends events_1.EventEmitter { constructor(options) { super(); - this._options = Object.assign({}, options); + this.options = Object.assign({}, options); // Validate SocksClientOptions helpers_1.validateSocksClientOptions(options); // Default state - this.state = constants_1.SocksClientState.Created; + this.setState(constants_1.SocksClientState.Created); } /** * Creates a new SOCKS connection. @@ -82,6 +84,7 @@ class SocksClient extends events_1.EventEmitter { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { let sock; try { + // tslint:disable-next-line:no-increment-decrement for (let i = 0; i < options.proxies.length; i++) { const nextProxy = options.proxies[i]; // If we've reached the last proxy in the chain, the destination is the actual destination, otherwise it's the next proxy. @@ -89,14 +92,13 @@ class SocksClient extends events_1.EventEmitter { ? options.destination : { host: options.proxies[i + 1].ipaddress, - port: options.proxies[i + 1].port + port: options.proxies[i + 1].port, }; // Creates the next connection in the chain. const result = yield SocksClient.createConnection({ command: 'connect', proxy: nextProxy, - destination: nextDestination - // Initial connection ignores this as sock is undefined. Subsequent connections re-use the first proxy socket to form a chain. + destination: nextDestination, }); // If sock is undefined, assign it here. if (!sock) { @@ -174,69 +176,63 @@ class SocksClient extends events_1.EventEmitter { frameNumber, remoteHost: { host: remoteHost, - port: remotePort + port: remotePort, }, - data: buff.readBuffer() + data: buff.readBuffer(), }; } - /** - * Gets the SocksClient internal state. - */ - get state() { - return this._state; - } /** * Internal state setter. If the SocksClient is in an error state, it cannot be changed to a non error state. */ - set state(newState) { - if (this._state !== constants_1.SocksClientState.Error) { - this._state = newState; + setState(newState) { + if (this.state !== constants_1.SocksClientState.Error) { + this.state = newState; } } /** * Starts the connection establishment to the proxy and destination. - * @param existing_socket Connected socket to use instead of creating a new one (internal use). + * @param existingSocket Connected socket to use instead of creating a new one (internal use). */ - connect(existing_socket) { - this._onDataReceived = (data) => this.onDataReceived(data); - this._onClose = () => this.onClose(); - this._onError = (err) => this.onError(err); - this._onConnect = () => this.onConnect(); + connect(existingSocket) { + this.onDataReceived = (data) => this.onDataReceivedHandler(data); + this.onClose = () => this.onCloseHandler(); + this.onError = (err) => this.onErrorHandler(err); + this.onConnect = () => this.onConnectHandler(); // Start timeout timer (defaults to 30 seconds) - const timer = setTimeout(() => this.onEstablishedTimeout(), this._options.timeout || constants_1.DEFAULT_TIMEOUT); + const timer = setTimeout(() => this.onEstablishedTimeout(), this.options.timeout || constants_1.DEFAULT_TIMEOUT); // check whether unref is available as it differs from browser to NodeJS (#33) if (timer.unref && typeof timer.unref === 'function') { timer.unref(); } // If an existing socket is provided, use it to negotiate SOCKS handshake. Otherwise create a new Socket. - if (existing_socket) { - this._socket = existing_socket; + if (existingSocket) { + this.socket = existingSocket; } else { - this._socket = new net.Socket(); + this.socket = new net.Socket(); } // Attach Socket error handlers. - this._socket.once('close', this._onClose); - this._socket.once('error', this._onError); - this._socket.once('connect', this._onConnect); - this._socket.on('data', this._onDataReceived); - this.state = constants_1.SocksClientState.Connecting; - this._receiveBuffer = new receivebuffer_1.ReceiveBuffer(); - if (existing_socket) { - this._socket.emit('connect'); + this.socket.once('close', this.onClose); + this.socket.once('error', this.onError); + this.socket.once('connect', this.onConnect); + this.socket.on('data', this.onDataReceived); + this.setState(constants_1.SocksClientState.Connecting); + this.receiveBuffer = new receivebuffer_1.ReceiveBuffer(); + if (existingSocket) { + this.socket.emit('connect'); } else { - this._socket.connect(this.getSocketOptions()); - if (this._options.set_tcp_nodelay !== undefined && - this._options.set_tcp_nodelay !== null) { - this._socket.setNoDelay(!!this._options.set_tcp_nodelay); + this.socket.connect(this.getSocketOptions()); + if (this.options.set_tcp_nodelay !== undefined && + this.options.set_tcp_nodelay !== null) { + this.socket.setNoDelay(!!this.options.set_tcp_nodelay); } } // Listen for established event so we can re-emit any excess data received during handshakes. - this.prependOnceListener('established', info => { + this.prependOnceListener('established', (info) => { setImmediate(() => { - if (this._receiveBuffer.length > 0) { - const excessData = this._receiveBuffer.get(this._receiveBuffer.length); + if (this.receiveBuffer.length > 0) { + const excessData = this.receiveBuffer.get(this.receiveBuffer.length); info.socket.emit('data', excessData); } info.socket.resume(); @@ -245,7 +241,7 @@ class SocksClient extends events_1.EventEmitter { } // Socket options (defaults host/port to options.proxy.host/options.proxy.port) getSocketOptions() { - return Object.assign(Object.assign({}, this._options.socket_options), { host: this._options.proxy.host || this._options.proxy.ipaddress, port: this._options.proxy.port }); + return Object.assign(Object.assign({}, this.options.socket_options), { host: this.options.proxy.host || this.options.proxy.ipaddress, port: this.options.proxy.port }); } /** * Handles internal Socks timeout callback. @@ -254,33 +250,33 @@ class SocksClient extends events_1.EventEmitter { onEstablishedTimeout() { if (this.state !== constants_1.SocksClientState.Established && this.state !== constants_1.SocksClientState.BoundWaitingForConnection) { - this._closeSocket(constants_1.ERRORS.ProxyConnectionTimedOut); + this.closeSocket(constants_1.ERRORS.ProxyConnectionTimedOut); } } /** * Handles Socket connect event. */ - onConnect() { - this.state = constants_1.SocksClientState.Connected; + onConnectHandler() { + this.setState(constants_1.SocksClientState.Connected); // Send initial handshake. - if (this._options.proxy.type === 4) { + if (this.options.proxy.type === 4) { this.sendSocks4InitialHandshake(); } else { this.sendSocks5InitialHandshake(); } - this.state = constants_1.SocksClientState.SentInitialHandshake; + this.setState(constants_1.SocksClientState.SentInitialHandshake); } /** * Handles Socket data event. * @param data */ - onDataReceived(data) { + onDataReceivedHandler(data) { /* All received data is appended to a ReceiveBuffer. This makes sure that all the data we need is received before we attempt to process it. */ - this._receiveBuffer.append(data); + this.receiveBuffer.append(data); // Process data that we have. this.processData(); } @@ -289,10 +285,12 @@ class SocksClient extends events_1.EventEmitter { */ processData() { // If we have enough data to process the next step in the SOCKS handshake, proceed. - if (this._receiveBuffer.length >= this._nextRequiredPacketBufferSize) { + while (this.state !== constants_1.SocksClientState.Established && + this.state !== constants_1.SocksClientState.Error && + this.receiveBuffer.length >= this.nextRequiredPacketBufferSize) { // Sent initial handshake, waiting for response. if (this.state === constants_1.SocksClientState.SentInitialHandshake) { - if (this._options.proxy.type === 4) { + if (this.options.proxy.type === 4) { // Socks v4 only has one handshake response. this.handleSocks4FinalHandshakeResponse(); } @@ -311,18 +309,16 @@ class SocksClient extends events_1.EventEmitter { // Socks BIND established. Waiting for remote connection via proxy. } else if (this.state === constants_1.SocksClientState.BoundWaitingForConnection) { - if (this._options.proxy.type === 4) { + if (this.options.proxy.type === 4) { this.handleSocks4IncomingConnectionResponse(); } else { this.handleSocks5IncomingConnectionResponse(); } } - else if (this.state === constants_1.SocksClientState.Established) { - // do nothing (prevents closing of the socket) - } else { - this._closeSocket(constants_1.ERRORS.InternalError); + this.closeSocket(constants_1.ERRORS.InternalError); + break; } } } @@ -330,56 +326,56 @@ class SocksClient extends events_1.EventEmitter { * Handles Socket close event. * @param had_error */ - onClose() { - this._closeSocket(constants_1.ERRORS.SocketClosed); + onCloseHandler() { + this.closeSocket(constants_1.ERRORS.SocketClosed); } /** * Handles Socket error event. * @param err */ - onError(err) { - this._closeSocket(err.message); + onErrorHandler(err) { + this.closeSocket(err.message); } /** * Removes internal event listeners on the underlying Socket. */ removeInternalSocketHandlers() { // Pauses data flow of the socket (this is internally resumed after 'established' is emitted) - this._socket.pause(); - this._socket.removeListener('data', this._onDataReceived); - this._socket.removeListener('close', this._onClose); - this._socket.removeListener('error', this._onError); - this._socket.removeListener('connect', this.onConnect); + this.socket.pause(); + this.socket.removeListener('data', this.onDataReceived); + this.socket.removeListener('close', this.onClose); + this.socket.removeListener('error', this.onError); + this.socket.removeListener('connect', this.onConnect); } /** * Closes and destroys the underlying Socket. Emits an error event. * @param err { String } An error string to include in error event. */ - _closeSocket(err) { + closeSocket(err) { // Make sure only one 'error' event is fired for the lifetime of this SocksClient instance. if (this.state !== constants_1.SocksClientState.Error) { // Set internal state to Error. - this.state = constants_1.SocksClientState.Error; + this.setState(constants_1.SocksClientState.Error); // Destroy Socket - this._socket.destroy(); + this.socket.destroy(); // Remove internal listeners this.removeInternalSocketHandlers(); // Fire 'error' event. - this.emit('error', new util_1.SocksClientError(err, this._options)); + this.emit('error', new util_1.SocksClientError(err, this.options)); } } /** * Sends initial Socks v4 handshake request. */ sendSocks4InitialHandshake() { - const userId = this._options.proxy.userId || ''; + const userId = this.options.proxy.userId || ''; const buff = new smart_buffer_1.SmartBuffer(); buff.writeUInt8(0x04); - buff.writeUInt8(constants_1.SocksCommand[this._options.command]); - buff.writeUInt16BE(this._options.destination.port); + buff.writeUInt8(constants_1.SocksCommand[this.options.command]); + buff.writeUInt16BE(this.options.destination.port); // Socks 4 (IPv4) - if (net.isIPv4(this._options.destination.host)) { - buff.writeBuffer(ip.toBuffer(this._options.destination.host)); + if (net.isIPv4(this.options.destination.host)) { + buff.writeBuffer(ip.toBuffer(this.options.destination.host)); buff.writeStringNT(userId); // Socks 4a (hostname) } @@ -389,42 +385,42 @@ class SocksClient extends events_1.EventEmitter { buff.writeUInt8(0x00); buff.writeUInt8(0x01); buff.writeStringNT(userId); - buff.writeStringNT(this._options.destination.host); + buff.writeStringNT(this.options.destination.host); } - this._nextRequiredPacketBufferSize = + this.nextRequiredPacketBufferSize = constants_1.SOCKS_INCOMING_PACKET_SIZES.Socks4Response; - this._socket.write(buff.toBuffer()); + this.socket.write(buff.toBuffer()); } /** * Handles Socks v4 handshake response. * @param data */ handleSocks4FinalHandshakeResponse() { - const data = this._receiveBuffer.get(8); + const data = this.receiveBuffer.get(8); if (data[1] !== constants_1.Socks4Response.Granted) { - this._closeSocket(`${constants_1.ERRORS.Socks4ProxyRejectedConnection} - (${constants_1.Socks4Response[data[1]]})`); + this.closeSocket(`${constants_1.ERRORS.Socks4ProxyRejectedConnection} - (${constants_1.Socks4Response[data[1]]})`); } else { // Bind response - if (constants_1.SocksCommand[this._options.command] === constants_1.SocksCommand.bind) { + if (constants_1.SocksCommand[this.options.command] === constants_1.SocksCommand.bind) { const buff = smart_buffer_1.SmartBuffer.fromBuffer(data); buff.readOffset = 2; const remoteHost = { port: buff.readUInt16BE(), - host: ip.fromLong(buff.readUInt32BE()) + host: ip.fromLong(buff.readUInt32BE()), }; // If host is 0.0.0.0, set to proxy host. if (remoteHost.host === '0.0.0.0') { - remoteHost.host = this._options.proxy.ipaddress; + remoteHost.host = this.options.proxy.ipaddress; } - this.state = constants_1.SocksClientState.BoundWaitingForConnection; - this.emit('bound', { socket: this._socket, remoteHost }); + this.setState(constants_1.SocksClientState.BoundWaitingForConnection); + this.emit('bound', { remoteHost, socket: this.socket }); // Connect response } else { - this.state = constants_1.SocksClientState.Established; + this.setState(constants_1.SocksClientState.Established); this.removeInternalSocketHandlers(); - this.emit('established', { socket: this._socket }); + this.emit('established', { socket: this.socket }); } } } @@ -433,20 +429,20 @@ class SocksClient extends events_1.EventEmitter { * @param data */ handleSocks4IncomingConnectionResponse() { - const data = this._receiveBuffer.get(8); + const data = this.receiveBuffer.get(8); if (data[1] !== constants_1.Socks4Response.Granted) { - this._closeSocket(`${constants_1.ERRORS.Socks4ProxyRejectedIncomingBoundConnection} - (${constants_1.Socks4Response[data[1]]})`); + this.closeSocket(`${constants_1.ERRORS.Socks4ProxyRejectedIncomingBoundConnection} - (${constants_1.Socks4Response[data[1]]})`); } else { const buff = smart_buffer_1.SmartBuffer.fromBuffer(data); buff.readOffset = 2; const remoteHost = { port: buff.readUInt16BE(), - host: ip.fromLong(buff.readUInt32BE()) + host: ip.fromLong(buff.readUInt32BE()), }; - this.state = constants_1.SocksClientState.Established; + this.setState(constants_1.SocksClientState.Established); this.removeInternalSocketHandlers(); - this.emit('established', { socket: this._socket, remoteHost }); + this.emit('established', { remoteHost, socket: this.socket }); } } /** @@ -457,7 +453,7 @@ class SocksClient extends events_1.EventEmitter { buff.writeUInt8(0x05); // We should only tell the proxy we support user/pass auth if auth info is actually provided. // Note: As of Tor v0.3.5.7+, if user/pass auth is an option from the client, by default it will always take priority. - if (this._options.proxy.userId || this._options.proxy.password) { + if (this.options.proxy.userId || this.options.proxy.password) { buff.writeUInt8(2); buff.writeUInt8(constants_1.Socks5Auth.NoAuth); buff.writeUInt8(constants_1.Socks5Auth.UserPass); @@ -466,22 +462,22 @@ class SocksClient extends events_1.EventEmitter { buff.writeUInt8(1); buff.writeUInt8(constants_1.Socks5Auth.NoAuth); } - this._nextRequiredPacketBufferSize = + this.nextRequiredPacketBufferSize = constants_1.SOCKS_INCOMING_PACKET_SIZES.Socks5InitialHandshakeResponse; - this._socket.write(buff.toBuffer()); - this.state = constants_1.SocksClientState.SentInitialHandshake; + this.socket.write(buff.toBuffer()); + this.setState(constants_1.SocksClientState.SentInitialHandshake); } /** * Handles initial Socks v5 handshake response. * @param data */ handleInitialSocks5HandshakeResponse() { - const data = this._receiveBuffer.get(2); + const data = this.receiveBuffer.get(2); if (data[0] !== 0x05) { - this._closeSocket(constants_1.ERRORS.InvalidSocks5IntiailHandshakeSocksVersion); + this.closeSocket(constants_1.ERRORS.InvalidSocks5IntiailHandshakeSocksVersion); } else if (data[1] === 0xff) { - this._closeSocket(constants_1.ERRORS.InvalidSocks5InitialHandshakeNoAcceptedAuthType); + this.closeSocket(constants_1.ERRORS.InvalidSocks5InitialHandshakeNoAcceptedAuthType); } else { // If selected Socks v5 auth method is no auth, send final handshake request. @@ -493,7 +489,7 @@ class SocksClient extends events_1.EventEmitter { this.sendSocks5UserPassAuthentication(); } else { - this._closeSocket(constants_1.ERRORS.InvalidSocks5InitialHandshakeUnknownAuthType); + this.closeSocket(constants_1.ERRORS.InvalidSocks5InitialHandshakeUnknownAuthType); } } } @@ -503,28 +499,28 @@ class SocksClient extends events_1.EventEmitter { * Note: No auth and user/pass are currently supported. */ sendSocks5UserPassAuthentication() { - const userId = this._options.proxy.userId || ''; - const password = this._options.proxy.password || ''; + const userId = this.options.proxy.userId || ''; + const password = this.options.proxy.password || ''; const buff = new smart_buffer_1.SmartBuffer(); buff.writeUInt8(0x01); buff.writeUInt8(Buffer.byteLength(userId)); buff.writeString(userId); buff.writeUInt8(Buffer.byteLength(password)); buff.writeString(password); - this._nextRequiredPacketBufferSize = + this.nextRequiredPacketBufferSize = constants_1.SOCKS_INCOMING_PACKET_SIZES.Socks5UserPassAuthenticationResponse; - this._socket.write(buff.toBuffer()); - this.state = constants_1.SocksClientState.SentAuthentication; + this.socket.write(buff.toBuffer()); + this.setState(constants_1.SocksClientState.SentAuthentication); } /** * Handles Socks v5 auth handshake response. * @param data */ handleInitialSocks5AuthenticationHandshakeResponse() { - this.state = constants_1.SocksClientState.ReceivedAuthenticationResponse; - const data = this._receiveBuffer.get(2); + this.setState(constants_1.SocksClientState.ReceivedAuthenticationResponse); + const data = this.receiveBuffer.get(2); if (data[1] !== 0x00) { - this._closeSocket(constants_1.ERRORS.Socks5AuthenticationFailed); + this.closeSocket(constants_1.ERRORS.Socks5AuthenticationFailed); } else { this.sendSocks5CommandRequest(); @@ -536,27 +532,27 @@ class SocksClient extends events_1.EventEmitter { sendSocks5CommandRequest() { const buff = new smart_buffer_1.SmartBuffer(); buff.writeUInt8(0x05); - buff.writeUInt8(constants_1.SocksCommand[this._options.command]); + buff.writeUInt8(constants_1.SocksCommand[this.options.command]); buff.writeUInt8(0x00); // ipv4, ipv6, domain? - if (net.isIPv4(this._options.destination.host)) { + if (net.isIPv4(this.options.destination.host)) { buff.writeUInt8(constants_1.Socks5HostType.IPv4); - buff.writeBuffer(ip.toBuffer(this._options.destination.host)); + buff.writeBuffer(ip.toBuffer(this.options.destination.host)); } - else if (net.isIPv6(this._options.destination.host)) { + else if (net.isIPv6(this.options.destination.host)) { buff.writeUInt8(constants_1.Socks5HostType.IPv6); - buff.writeBuffer(ip.toBuffer(this._options.destination.host)); + buff.writeBuffer(ip.toBuffer(this.options.destination.host)); } else { buff.writeUInt8(constants_1.Socks5HostType.Hostname); - buff.writeUInt8(this._options.destination.host.length); - buff.writeString(this._options.destination.host); + buff.writeUInt8(this.options.destination.host.length); + buff.writeString(this.options.destination.host); } - buff.writeUInt16BE(this._options.destination.port); - this._nextRequiredPacketBufferSize = + buff.writeUInt16BE(this.options.destination.port); + this.nextRequiredPacketBufferSize = constants_1.SOCKS_INCOMING_PACKET_SIZES.Socks5ResponseHeader; - this._socket.write(buff.toBuffer()); - this.state = constants_1.SocksClientState.SentFinalHandshake; + this.socket.write(buff.toBuffer()); + this.setState(constants_1.SocksClientState.SentFinalHandshake); } /** * Handles Socks v5 final handshake response. @@ -564,9 +560,9 @@ class SocksClient extends events_1.EventEmitter { */ handleSocks5FinalHandshakeResponse() { // Peek at available data (we need at least 5 bytes to get the hostname length) - const header = this._receiveBuffer.peek(5); + const header = this.receiveBuffer.peek(5); if (header[0] !== 0x05 || header[1] !== constants_1.Socks5Response.Granted) { - this._closeSocket(`${constants_1.ERRORS.InvalidSocks5FinalHandshakeRejected} - ${constants_1.Socks5Response[header[1]]}`); + this.closeSocket(`${constants_1.ERRORS.InvalidSocks5FinalHandshakeRejected} - ${constants_1.Socks5Response[header[1]]}`); } else { // Read address type @@ -577,18 +573,18 @@ class SocksClient extends events_1.EventEmitter { if (addressType === constants_1.Socks5HostType.IPv4) { // Check if data is available. const dataNeeded = constants_1.SOCKS_INCOMING_PACKET_SIZES.Socks5ResponseIPv4; - if (this._receiveBuffer.length < dataNeeded) { - this._nextRequiredPacketBufferSize = dataNeeded; + if (this.receiveBuffer.length < dataNeeded) { + this.nextRequiredPacketBufferSize = dataNeeded; return; } - buff = smart_buffer_1.SmartBuffer.fromBuffer(this._receiveBuffer.get(dataNeeded).slice(4)); + buff = smart_buffer_1.SmartBuffer.fromBuffer(this.receiveBuffer.get(dataNeeded).slice(4)); remoteHost = { host: ip.fromLong(buff.readUInt32BE()), - port: buff.readUInt16BE() + port: buff.readUInt16BE(), }; // If given host is 0.0.0.0, assume remote proxy ip instead. if (remoteHost.host === '0.0.0.0') { - remoteHost.host = this._options.proxy.ipaddress; + remoteHost.host = this.options.proxy.ipaddress; } // Hostname } @@ -596,55 +592,57 @@ class SocksClient extends events_1.EventEmitter { const hostLength = header[4]; const dataNeeded = constants_1.SOCKS_INCOMING_PACKET_SIZES.Socks5ResponseHostname(hostLength); // header + host length + host + port // Check if data is available. - if (this._receiveBuffer.length < dataNeeded) { - this._nextRequiredPacketBufferSize = dataNeeded; + if (this.receiveBuffer.length < dataNeeded) { + this.nextRequiredPacketBufferSize = dataNeeded; return; } - buff = smart_buffer_1.SmartBuffer.fromBuffer(this._receiveBuffer.get(dataNeeded).slice(5) // Slice at 5 to skip host length - ); + buff = smart_buffer_1.SmartBuffer.fromBuffer(this.receiveBuffer.get(dataNeeded).slice(5)); remoteHost = { host: buff.readString(hostLength), - port: buff.readUInt16BE() + port: buff.readUInt16BE(), }; // IPv6 } else if (addressType === constants_1.Socks5HostType.IPv6) { // Check if data is available. const dataNeeded = constants_1.SOCKS_INCOMING_PACKET_SIZES.Socks5ResponseIPv6; - if (this._receiveBuffer.length < dataNeeded) { - this._nextRequiredPacketBufferSize = dataNeeded; + if (this.receiveBuffer.length < dataNeeded) { + this.nextRequiredPacketBufferSize = dataNeeded; return; } - buff = smart_buffer_1.SmartBuffer.fromBuffer(this._receiveBuffer.get(dataNeeded).slice(4)); + buff = smart_buffer_1.SmartBuffer.fromBuffer(this.receiveBuffer.get(dataNeeded).slice(4)); remoteHost = { host: ip.toString(buff.readBuffer(16)), - port: buff.readUInt16BE() + port: buff.readUInt16BE(), }; } // We have everything we need - this.state = constants_1.SocksClientState.ReceivedFinalResponse; + this.setState(constants_1.SocksClientState.ReceivedFinalResponse); // If using CONNECT, the client is now in the established state. - if (constants_1.SocksCommand[this._options.command] === constants_1.SocksCommand.connect) { - this.state = constants_1.SocksClientState.Established; + if (constants_1.SocksCommand[this.options.command] === constants_1.SocksCommand.connect) { + this.setState(constants_1.SocksClientState.Established); this.removeInternalSocketHandlers(); - this.emit('established', { socket: this._socket }); + this.emit('established', { socket: this.socket }); } - else if (constants_1.SocksCommand[this._options.command] === constants_1.SocksCommand.bind) { + else if (constants_1.SocksCommand[this.options.command] === constants_1.SocksCommand.bind) { /* If using BIND, the Socks client is now in BoundWaitingForConnection state. This means that the remote proxy server is waiting for a remote connection to the bound port. */ - this.state = constants_1.SocksClientState.BoundWaitingForConnection; - this._nextRequiredPacketBufferSize = + this.setState(constants_1.SocksClientState.BoundWaitingForConnection); + this.nextRequiredPacketBufferSize = constants_1.SOCKS_INCOMING_PACKET_SIZES.Socks5ResponseHeader; - this.emit('bound', { socket: this._socket, remoteHost }); + this.emit('bound', { remoteHost, socket: this.socket }); /* If using Associate, the Socks client is now Established. And the proxy server is now accepting UDP packets at the given bound port. This initial Socks TCP connection must remain open for the UDP relay to continue to work. */ } - else if (constants_1.SocksCommand[this._options.command] === constants_1.SocksCommand.associate) { - this.state = constants_1.SocksClientState.Established; + else if (constants_1.SocksCommand[this.options.command] === constants_1.SocksCommand.associate) { + this.setState(constants_1.SocksClientState.Established); this.removeInternalSocketHandlers(); - this.emit('established', { socket: this._socket, remoteHost }); + this.emit('established', { + remoteHost, + socket: this.socket, + }); } } } @@ -653,9 +651,9 @@ class SocksClient extends events_1.EventEmitter { */ handleSocks5IncomingConnectionResponse() { // Peek at available data (we need at least 5 bytes to get the hostname length) - const header = this._receiveBuffer.peek(5); + const header = this.receiveBuffer.peek(5); if (header[0] !== 0x05 || header[1] !== constants_1.Socks5Response.Granted) { - this._closeSocket(`${constants_1.ERRORS.Socks5ProxyRejectedIncomingBoundConnection} - ${constants_1.Socks5Response[header[1]]}`); + this.closeSocket(`${constants_1.ERRORS.Socks5ProxyRejectedIncomingBoundConnection} - ${constants_1.Socks5Response[header[1]]}`); } else { // Read address type @@ -666,18 +664,18 @@ class SocksClient extends events_1.EventEmitter { if (addressType === constants_1.Socks5HostType.IPv4) { // Check if data is available. const dataNeeded = constants_1.SOCKS_INCOMING_PACKET_SIZES.Socks5ResponseIPv4; - if (this._receiveBuffer.length < dataNeeded) { - this._nextRequiredPacketBufferSize = dataNeeded; + if (this.receiveBuffer.length < dataNeeded) { + this.nextRequiredPacketBufferSize = dataNeeded; return; } - buff = smart_buffer_1.SmartBuffer.fromBuffer(this._receiveBuffer.get(dataNeeded).slice(4)); + buff = smart_buffer_1.SmartBuffer.fromBuffer(this.receiveBuffer.get(dataNeeded).slice(4)); remoteHost = { host: ip.fromLong(buff.readUInt32BE()), - port: buff.readUInt16BE() + port: buff.readUInt16BE(), }; // If given host is 0.0.0.0, assume remote proxy ip instead. if (remoteHost.host === '0.0.0.0') { - remoteHost.host = this._options.proxy.ipaddress; + remoteHost.host = this.options.proxy.ipaddress; } // Hostname } @@ -685,38 +683,37 @@ class SocksClient extends events_1.EventEmitter { const hostLength = header[4]; const dataNeeded = constants_1.SOCKS_INCOMING_PACKET_SIZES.Socks5ResponseHostname(hostLength); // header + host length + port // Check if data is available. - if (this._receiveBuffer.length < dataNeeded) { - this._nextRequiredPacketBufferSize = dataNeeded; + if (this.receiveBuffer.length < dataNeeded) { + this.nextRequiredPacketBufferSize = dataNeeded; return; } - buff = smart_buffer_1.SmartBuffer.fromBuffer(this._receiveBuffer.get(dataNeeded).slice(5) // Slice at 5 to skip host length - ); + buff = smart_buffer_1.SmartBuffer.fromBuffer(this.receiveBuffer.get(dataNeeded).slice(5)); remoteHost = { host: buff.readString(hostLength), - port: buff.readUInt16BE() + port: buff.readUInt16BE(), }; // IPv6 } else if (addressType === constants_1.Socks5HostType.IPv6) { // Check if data is available. const dataNeeded = constants_1.SOCKS_INCOMING_PACKET_SIZES.Socks5ResponseIPv6; - if (this._receiveBuffer.length < dataNeeded) { - this._nextRequiredPacketBufferSize = dataNeeded; + if (this.receiveBuffer.length < dataNeeded) { + this.nextRequiredPacketBufferSize = dataNeeded; return; } - buff = smart_buffer_1.SmartBuffer.fromBuffer(this._receiveBuffer.get(dataNeeded).slice(4)); + buff = smart_buffer_1.SmartBuffer.fromBuffer(this.receiveBuffer.get(dataNeeded).slice(4)); remoteHost = { host: ip.toString(buff.readBuffer(16)), - port: buff.readUInt16BE() + port: buff.readUInt16BE(), }; } - this.state = constants_1.SocksClientState.Established; + this.setState(constants_1.SocksClientState.Established); this.removeInternalSocketHandlers(); - this.emit('established', { socket: this._socket, remoteHost }); + this.emit('established', { remoteHost, socket: this.socket }); } } get socksClientOptions() { - return Object.assign({}, this._options); + return Object.assign({}, this.options); } } exports.SocksClient = SocksClient; diff --git a/deps/npm/node_modules/socks/build/client/socksclient.js.map b/deps/npm/node_modules/socks/build/client/socksclient.js.map index eb73a25856978a..8fdc0ec620403b 100644 --- a/deps/npm/node_modules/socks/build/client/socksclient.js.map +++ b/deps/npm/node_modules/socks/build/client/socksclient.js.map @@ -1 +1 @@ -{"version":3,"file":"socksclient.js","sourceRoot":"","sources":["../../src/client/socksclient.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,mCAAsC;AACtC,2BAA2B;AAC3B,yBAAyB;AACzB,+CAA2C;AAC3C,mDAiB6B;AAC7B,+CAG2B;AAC3B,2DAAwD;AACxD,yCAAgE;AA0BhE,MAAM,WAAY,SAAQ,qBAAY;IAepC,YAAY,OAA2B;QACrC,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,QAAQ,qBACR,OAAO,CACX,CAAC;QAEF,8BAA8B;QAC9B,oCAA0B,CAAC,OAAO,CAAC,CAAC;QAEpC,gBAAgB;QAChB,IAAI,CAAC,KAAK,GAAG,4BAAgB,CAAC,OAAO,CAAC;IACxC,CAAC;IAED;;;;;;;OAOG;IACH,MAAM,CAAC,gBAAgB,CACrB,OAA2B,EAC3B,QAAmB;QAEnB,8BAA8B;QAC9B,oCAA0B,CAAC,OAAO,EAAE,CAAC,SAAS,CAAC,CAAC,CAAC;QAEjD,OAAO,IAAI,OAAO,CAA8B,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;YAClE,MAAM,MAAM,GAAG,IAAI,WAAW,CAAC,OAAO,CAAC,CAAC;YACxC,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,eAAe,CAAC,CAAC;YACxC,MAAM,CAAC,IAAI,CAAC,aAAa,EAAE,CAAC,IAAiC,EAAE,EAAE;gBAC/D,MAAM,CAAC,kBAAkB,EAAE,CAAC;gBAC5B,IAAI,OAAO,QAAQ,KAAK,UAAU,EAAE;oBAClC,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;oBACrB,OAAO,EAAE,CAAC,CAAC,oDAAoD;iBAChE;qBAAM;oBACL,OAAO,CAAC,IAAI,CAAC,CAAC;iBACf;YACH,CAAC,CAAC,CAAC;YAEH,kDAAkD;YAClD,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,GAAU,EAAE,EAAE;gBAClC,MAAM,CAAC,kBAAkB,EAAE,CAAC;gBAC5B,IAAI,OAAO,QAAQ,KAAK,UAAU,EAAE;oBAClC,QAAQ,CAAC,GAAG,CAAC,CAAC;oBACd,OAAO,EAAE,CAAC,CAAC,oDAAoD;iBAChE;qBAAM;oBACL,MAAM,CAAC,GAAG,CAAC,CAAC;iBACb;YACH,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;OAQG;IACH,MAAM,CAAC,qBAAqB,CAC1B,OAAgC,EAChC,QAAmB;QAEnB,mCAAmC;QACnC,yCAA+B,CAAC,OAAO,CAAC,CAAC;QAEzC,kBAAkB;QAClB,IAAI,OAAO,CAAC,cAAc,EAAE;YAC1B,mBAAY,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;SAC/B;QAED,OAAO,IAAI,OAAO,CAA8B,CAAO,OAAO,EAAE,MAAM,EAAE,EAAE;YACxE,IAAI,IAAgB,CAAC;YAErB,IAAI;gBACF,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,OAAO,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;oBAC/C,MAAM,SAAS,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;oBAErC,0HAA0H;oBAC1H,MAAM,eAAe,GACnB,CAAC,KAAK,OAAO,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC;wBAC9B,CAAC,CAAC,OAAO,CAAC,WAAW;wBACrB,CAAC,CAAC;4BACE,IAAI,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,SAAS;4BACtC,IAAI,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI;yBAClC,CAAC;oBAER,4CAA4C;oBAC5C,MAAM,MAAM,GAAG,MAAM,WAAW,CAAC,gBAAgB,CAAC;wBAChD,OAAO,EAAE,SAAS;wBAClB,KAAK,EAAE,SAAS;wBAChB,WAAW,EAAE,eAAe;wBAC5B,8HAA8H;qBAC/H,CAAC,CAAC;oBAEH,wCAAwC;oBACxC,IAAI,CAAC,IAAI,EAAE;wBACT,IAAI,GAAG,MAAM,CAAC,MAAM,CAAC;qBACtB;iBACF;gBAED,IAAI,OAAO,QAAQ,KAAK,UAAU,EAAE;oBAClC,QAAQ,CAAC,IAAI,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC;oBACjC,OAAO,EAAE,CAAC,CAAC,oDAAoD;iBAChE;qBAAM;oBACL,OAAO,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC;iBAC3B;aACF;YAAC,OAAO,GAAG,EAAE;gBACZ,IAAI,OAAO,QAAQ,KAAK,UAAU,EAAE;oBAClC,QAAQ,CAAC,GAAG,CAAC,CAAC;oBACd,OAAO,EAAE,CAAC,CAAC,oDAAoD;iBAChE;qBAAM;oBACL,MAAM,CAAC,GAAG,CAAC,CAAC;iBACb;aACF;QACH,CAAC,CAAA,CAAC,CAAC;IACL,CAAC;IAED;;;OAGG;IACH,MAAM,CAAC,cAAc,CAAC,OAA6B;QACjD,MAAM,IAAI,GAAG,IAAI,0BAAW,EAAE,CAAC;QAC/B,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC;QACtB,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,WAAW,IAAI,CAAC,CAAC,CAAC;QAE1C,qBAAqB;QACrB,IAAI,GAAG,CAAC,MAAM,CAAC,OAAO,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE;YACvC,IAAI,CAAC,UAAU,CAAC,0BAAc,CAAC,IAAI,CAAC,CAAC;YACrC,IAAI,CAAC,aAAa,CAAC,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC;SACxD;aAAM,IAAI,GAAG,CAAC,MAAM,CAAC,OAAO,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE;YAC9C,IAAI,CAAC,UAAU,CAAC,0BAAc,CAAC,IAAI,CAAC,CAAC;YACrC,IAAI,CAAC,WAAW,CAAC,EAAE,CAAC,QAAQ,CAAC,OAAO,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC;SACxD;aAAM;YACL,IAAI,CAAC,UAAU,CAAC,0BAAc,CAAC,QAAQ,CAAC,CAAC;YACzC,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,UAAU,CAAC,OAAO,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC;YAC5D,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;SAC3C;QAED,OAAO;QACP,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;QAE5C,OAAO;QACP,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QAE/B,OAAO,IAAI,CAAC,QAAQ,EAAE,CAAC;IACzB,CAAC;IAED;;;OAGG;IACH,MAAM,CAAC,aAAa,CAAC,IAAY;QAC/B,MAAM,IAAI,GAAG,0BAAW,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;QAC1C,IAAI,CAAC,UAAU,GAAG,CAAC,CAAC;QAEpB,MAAM,WAAW,GAAG,IAAI,CAAC,SAAS,EAAE,CAAC;QACrC,MAAM,QAAQ,GAAmB,IAAI,CAAC,SAAS,EAAE,CAAC;QAClD,IAAI,UAAU,CAAC;QAEf,IAAI,QAAQ,KAAK,0BAAc,CAAC,IAAI,EAAE;YACpC,UAAU,GAAG,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,YAAY,EAAE,CAAC,CAAC;SAC/C;aAAM,IAAI,QAAQ,KAAK,0BAAc,CAAC,IAAI,EAAE;YAC3C,UAAU,GAAG,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC,CAAC;SAC/C;aAAM;YACL,UAAU,GAAG,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,SAAS,EAAE,CAAC,CAAC;SAChD;QAED,MAAM,UAAU,GAAG,IAAI,CAAC,YAAY,EAAE,CAAC;QAEvC,OAAO;YACL,WAAW;YACX,UAAU,EAAE;gBACV,IAAI,EAAE,UAAU;gBAChB,IAAI,EAAE,UAAU;aACjB;YACD,IAAI,EAAE,IAAI,CAAC,UAAU,EAAE;SACxB,CAAC;IACJ,CAAC;IAED;;OAEG;IACH,IAAY,KAAK;QACf,OAAO,IAAI,CAAC,MAAM,CAAC;IACrB,CAAC;IAED;;OAEG;IACH,IAAY,KAAK,CAAC,QAA0B;QAC1C,IAAI,IAAI,CAAC,MAAM,KAAK,4BAAgB,CAAC,KAAK,EAAE;YAC1C,IAAI,CAAC,MAAM,GAAG,QAAQ,CAAC;SACxB;IACH,CAAC;IAED;;;OAGG;IACI,OAAO,CAAC,eAAwB;QACrC,IAAI,CAAC,eAAe,GAAG,CAAC,IAAY,EAAE,EAAE,CAAC,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC;QACnE,IAAI,CAAC,QAAQ,GAAG,GAAG,EAAE,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC;QACrC,IAAI,CAAC,QAAQ,GAAG,CAAC,GAAU,EAAE,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;QAClD,IAAI,CAAC,UAAU,GAAG,GAAG,EAAE,CAAC,IAAI,CAAC,SAAS,EAAE,CAAC;QAEzC,+CAA+C;QAC/C,MAAM,KAAK,GAAG,UAAU,CACtB,GAAG,EAAE,CAAC,IAAI,CAAC,oBAAoB,EAAE,EACjC,IAAI,CAAC,QAAQ,CAAC,OAAO,IAAI,2BAAe,CACzC,CAAC;QAEF,8EAA8E;QAC9E,IAAI,KAAK,CAAC,KAAK,IAAI,OAAO,KAAK,CAAC,KAAK,KAAK,UAAU,EAAE;YACpD,KAAK,CAAC,KAAK,EAAE,CAAC;SACf;QAED,yGAAyG;QACzG,IAAI,eAAe,EAAE;YACnB,IAAI,CAAC,OAAO,GAAG,eAAe,CAAC;SAChC;aAAM;YACL,IAAI,CAAC,OAAO,GAAG,IAAI,GAAG,CAAC,MAAM,EAAE,CAAC;SACjC;QAED,gCAAgC;QAChC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC;QAC1C,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC;QAC1C,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC;QAC9C,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,MAAM,EAAE,IAAI,CAAC,eAAe,CAAC,CAAC;QAE9C,IAAI,CAAC,KAAK,GAAG,4BAAgB,CAAC,UAAU,CAAC;QACzC,IAAI,CAAC,cAAc,GAAG,IAAI,6BAAa,EAAE,CAAC;QAE1C,IAAI,eAAe,EAAE;YACnB,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;SAC9B;aAAM;YACJ,IAAI,CAAC,OAAsB,CAAC,OAAO,CAAC,IAAI,CAAC,gBAAgB,EAAE,CAAC,CAAC;YAE9D,IACE,IAAI,CAAC,QAAQ,CAAC,eAAe,KAAK,SAAS;gBAC3C,IAAI,CAAC,QAAQ,CAAC,eAAe,KAAK,IAAI,EACtC;gBACC,IAAI,CAAC,OAAsB,CAAC,UAAU,CACrC,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,eAAe,CAChC,CAAC;aACH;SACF;QAED,6FAA6F;QAC7F,IAAI,CAAC,mBAAmB,CAAC,aAAa,EAAE,IAAI,CAAC,EAAE;YAC7C,YAAY,CAAC,GAAG,EAAE;gBAChB,IAAI,IAAI,CAAC,cAAc,CAAC,MAAM,GAAG,CAAC,EAAE;oBAClC,MAAM,UAAU,GAAG,IAAI,CAAC,cAAc,CAAC,GAAG,CACxC,IAAI,CAAC,cAAc,CAAC,MAAM,CAC3B,CAAC;oBAEF,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;iBACtC;gBACD,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC;YACvB,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC;IAED,+EAA+E;IACvE,gBAAgB;QACtB,uCACK,IAAI,CAAC,QAAQ,CAAC,cAAc,KAC/B,IAAI,EAAE,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,IAAI,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,SAAS,EAC/D,IAAI,EAAE,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,IAC9B;IACJ,CAAC;IAED;;;OAGG;IACK,oBAAoB;QAC1B,IACE,IAAI,CAAC,KAAK,KAAK,4BAAgB,CAAC,WAAW;YAC3C,IAAI,CAAC,KAAK,KAAK,4BAAgB,CAAC,yBAAyB,EACzD;YACA,IAAI,CAAC,YAAY,CAAC,kBAAM,CAAC,uBAAuB,CAAC,CAAC;SACnD;IACH,CAAC;IAED;;OAEG;IACK,SAAS;QACf,IAAI,CAAC,KAAK,GAAG,4BAAgB,CAAC,SAAS,CAAC;QAExC,0BAA0B;QAC1B,IAAI,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,EAAE;YAClC,IAAI,CAAC,0BAA0B,EAAE,CAAC;SACnC;aAAM;YACL,IAAI,CAAC,0BAA0B,EAAE,CAAC;SACnC;QAED,IAAI,CAAC,KAAK,GAAG,4BAAgB,CAAC,oBAAoB,CAAC;IACrD,CAAC;IAED;;;OAGG;IACK,cAAc,CAAC,IAAY;QACjC;;;UAGE;QACF,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;QAEjC,6BAA6B;QAC7B,IAAI,CAAC,WAAW,EAAE,CAAC;IACrB,CAAC;IAED;;OAEG;IACK,WAAW;QACjB,mFAAmF;QACnF,IAAI,IAAI,CAAC,cAAc,CAAC,MAAM,IAAI,IAAI,CAAC,6BAA6B,EAAE;YACpE,gDAAgD;YAChD,IAAI,IAAI,CAAC,KAAK,KAAK,4BAAgB,CAAC,oBAAoB,EAAE;gBACxD,IAAI,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,EAAE;oBAClC,4CAA4C;oBAC5C,IAAI,CAAC,kCAAkC,EAAE,CAAC;iBAC3C;qBAAM;oBACL,wDAAwD;oBACxD,IAAI,CAAC,oCAAoC,EAAE,CAAC;iBAC7C;gBACD,wDAAwD;aACzD;iBAAM,IAAI,IAAI,CAAC,KAAK,KAAK,4BAAgB,CAAC,kBAAkB,EAAE;gBAC7D,IAAI,CAAC,kDAAkD,EAAE,CAAC;gBAC1D,6DAA6D;aAC9D;iBAAM,IAAI,IAAI,CAAC,KAAK,KAAK,4BAAgB,CAAC,kBAAkB,EAAE;gBAC7D,IAAI,CAAC,kCAAkC,EAAE,CAAC;gBAC1C,mEAAmE;aACpE;iBAAM,IAAI,IAAI,CAAC,KAAK,KAAK,4BAAgB,CAAC,yBAAyB,EAAE;gBACpE,IAAI,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,EAAE;oBAClC,IAAI,CAAC,sCAAsC,EAAE,CAAC;iBAC/C;qBAAM;oBACL,IAAI,CAAC,sCAAsC,EAAE,CAAC;iBAC/C;aACF;iBAAM,IAAI,IAAI,CAAC,KAAK,KAAK,4BAAgB,CAAC,WAAW,EAAE;gBACtD,8CAA8C;aAC/C;iBAAM;gBACL,IAAI,CAAC,YAAY,CAAC,kBAAM,CAAC,aAAa,CAAC,CAAC;aACzC;SACF;IACH,CAAC;IAED;;;OAGG;IACK,OAAO;QACb,IAAI,CAAC,YAAY,CAAC,kBAAM,CAAC,YAAY,CAAC,CAAC;IACzC,CAAC;IAED;;;OAGG;IACK,OAAO,CAAC,GAAU;QACxB,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;IACjC,CAAC;IAED;;OAEG;IACK,4BAA4B;QAClC,6FAA6F;QAC7F,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC;QACrB,IAAI,CAAC,OAAO,CAAC,cAAc,CAAC,MAAM,EAAE,IAAI,CAAC,eAAe,CAAC,CAAC;QAC1D,IAAI,CAAC,OAAO,CAAC,cAAc,CAAC,OAAO,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC;QACpD,IAAI,CAAC,OAAO,CAAC,cAAc,CAAC,OAAO,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC;QACpD,IAAI,CAAC,OAAO,CAAC,cAAc,CAAC,SAAS,EAAE,IAAI,CAAC,SAAS,CAAC,CAAC;IACzD,CAAC;IAED;;;OAGG;IACK,YAAY,CAAC,GAAW;QAC9B,2FAA2F;QAC3F,IAAI,IAAI,CAAC,KAAK,KAAK,4BAAgB,CAAC,KAAK,EAAE;YACzC,+BAA+B;YAC/B,IAAI,CAAC,KAAK,GAAG,4BAAgB,CAAC,KAAK,CAAC;YAEpC,iBAAiB;YACjB,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC;YAEvB,4BAA4B;YAC5B,IAAI,CAAC,4BAA4B,EAAE,CAAC;YAEpC,sBAAsB;YACtB,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,uBAAgB,CAAC,GAAG,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC;SAC9D;IACH,CAAC;IAED;;OAEG;IACK,0BAA0B;QAChC,MAAM,MAAM,GAAG,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,MAAM,IAAI,EAAE,CAAC;QAEhD,MAAM,IAAI,GAAG,IAAI,0BAAW,EAAE,CAAC;QAC/B,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;QACtB,IAAI,CAAC,UAAU,CAAC,wBAAY,CAAC,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC;QACrD,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;QAEnD,iBAAiB;QACjB,IAAI,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAC,IAAI,CAAC,EAAE;YAC9C,IAAI,CAAC,WAAW,CAAC,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC;YAC9D,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC;YAC3B,sBAAsB;SACvB;aAAM;YACL,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;YACtB,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;YACtB,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;YACtB,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;YACtB,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC;YAC3B,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;SACpD;QAED,IAAI,CAAC,6BAA6B;YAChC,uCAA2B,CAAC,cAAc,CAAC;QAC7C,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC;IACtC,CAAC;IAED;;;OAGG;IACK,kCAAkC;QACxC,MAAM,IAAI,GAAG,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;QAExC,IAAI,IAAI,CAAC,CAAC,CAAC,KAAK,0BAAc,CAAC,OAAO,EAAE;YACtC,IAAI,CAAC,YAAY,CACf,GAAG,kBAAM,CAAC,6BAA6B,OAAO,0BAAc,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,GAAG,CACzE,CAAC;SACH;aAAM;YACL,gBAAgB;YAChB,IAAI,wBAAY,CAAC,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,KAAK,wBAAY,CAAC,IAAI,EAAE;gBAC7D,MAAM,IAAI,GAAG,0BAAW,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;gBAC1C,IAAI,CAAC,UAAU,GAAG,CAAC,CAAC;gBAEpB,MAAM,UAAU,GAAoB;oBAClC,IAAI,EAAE,IAAI,CAAC,YAAY,EAAE;oBACzB,IAAI,EAAE,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,YAAY,EAAE,CAAC;iBACvC,CAAC;gBAEF,yCAAyC;gBACzC,IAAI,UAAU,CAAC,IAAI,KAAK,SAAS,EAAE;oBACjC,UAAU,CAAC,IAAI,GAAG,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,SAAS,CAAC;iBACjD;gBACD,IAAI,CAAC,KAAK,GAAG,4BAAgB,CAAC,yBAAyB,CAAC;gBACxD,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,EAAE,MAAM,EAAE,IAAI,CAAC,OAAO,EAAE,UAAU,EAAE,CAAC,CAAC;gBAEzD,mBAAmB;aACpB;iBAAM;gBACL,IAAI,CAAC,KAAK,GAAG,4BAAgB,CAAC,WAAW,CAAC;gBAC1C,IAAI,CAAC,4BAA4B,EAAE,CAAC;gBACpC,IAAI,CAAC,IAAI,CAAC,aAAa,EAAE,EAAE,MAAM,EAAE,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC;aACpD;SACF;IACH,CAAC;IAED;;;OAGG;IACK,sCAAsC;QAC5C,MAAM,IAAI,GAAG,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;QAExC,IAAI,IAAI,CAAC,CAAC,CAAC,KAAK,0BAAc,CAAC,OAAO,EAAE;YACtC,IAAI,CAAC,YAAY,CACf,GAAG,kBAAM,CAAC,0CAA0C,OAClD,0BAAc,CAAC,IAAI,CAAC,CAAC,CAAC,CACxB,GAAG,CACJ,CAAC;SACH;aAAM;YACL,MAAM,IAAI,GAAG,0BAAW,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;YAC1C,IAAI,CAAC,UAAU,GAAG,CAAC,CAAC;YAEpB,MAAM,UAAU,GAAoB;gBAClC,IAAI,EAAE,IAAI,CAAC,YAAY,EAAE;gBACzB,IAAI,EAAE,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,YAAY,EAAE,CAAC;aACvC,CAAC;YAEF,IAAI,CAAC,KAAK,GAAG,4BAAgB,CAAC,WAAW,CAAC;YAC1C,IAAI,CAAC,4BAA4B,EAAE,CAAC;YACpC,IAAI,CAAC,IAAI,CAAC,aAAa,EAAE,EAAE,MAAM,EAAE,IAAI,CAAC,OAAO,EAAE,UAAU,EAAE,CAAC,CAAC;SAChE;IACH,CAAC;IAED;;OAEG;IACK,0BAA0B;QAChC,MAAM,IAAI,GAAG,IAAI,0BAAW,EAAE,CAAC;QAC/B,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;QAEtB,6FAA6F;QAC7F,sHAAsH;QACtH,IAAI,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,MAAM,IAAI,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,QAAQ,EAAE;YAC9D,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;YACnB,IAAI,CAAC,UAAU,CAAC,sBAAU,CAAC,MAAM,CAAC,CAAC;YACnC,IAAI,CAAC,UAAU,CAAC,sBAAU,CAAC,QAAQ,CAAC,CAAC;SACtC;aAAM;YACL,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;YACnB,IAAI,CAAC,UAAU,CAAC,sBAAU,CAAC,MAAM,CAAC,CAAC;SACpC;QAED,IAAI,CAAC,6BAA6B;YAChC,uCAA2B,CAAC,8BAA8B,CAAC;QAC7D,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC;QACpC,IAAI,CAAC,KAAK,GAAG,4BAAgB,CAAC,oBAAoB,CAAC;IACrD,CAAC;IAED;;;OAGG;IACK,oCAAoC;QAC1C,MAAM,IAAI,GAAG,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;QAExC,IAAI,IAAI,CAAC,CAAC,CAAC,KAAK,IAAI,EAAE;YACpB,IAAI,CAAC,YAAY,CAAC,kBAAM,CAAC,yCAAyC,CAAC,CAAC;SACrE;aAAM,IAAI,IAAI,CAAC,CAAC,CAAC,KAAK,IAAI,EAAE;YAC3B,IAAI,CAAC,YAAY,CAAC,kBAAM,CAAC,+CAA+C,CAAC,CAAC;SAC3E;aAAM;YACL,6EAA6E;YAC7E,IAAI,IAAI,CAAC,CAAC,CAAC,KAAK,sBAAU,CAAC,MAAM,EAAE;gBACjC,IAAI,CAAC,wBAAwB,EAAE,CAAC;gBAChC,0EAA0E;aAC3E;iBAAM,IAAI,IAAI,CAAC,CAAC,CAAC,KAAK,sBAAU,CAAC,QAAQ,EAAE;gBAC1C,IAAI,CAAC,gCAAgC,EAAE,CAAC;aACzC;iBAAM;gBACL,IAAI,CAAC,YAAY,CAAC,kBAAM,CAAC,4CAA4C,CAAC,CAAC;aACxE;SACF;IACH,CAAC;IAED;;;;OAIG;IACK,gCAAgC;QACtC,MAAM,MAAM,GAAG,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,MAAM,IAAI,EAAE,CAAC;QAChD,MAAM,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,QAAQ,IAAI,EAAE,CAAC;QAEpD,MAAM,IAAI,GAAG,IAAI,0BAAW,EAAE,CAAC;QAC/B,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;QACtB,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC;QAC3C,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;QACzB,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,CAAC;QAC7C,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC;QAE3B,IAAI,CAAC,6BAA6B;YAChC,uCAA2B,CAAC,oCAAoC,CAAC;QACnE,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC;QACpC,IAAI,CAAC,KAAK,GAAG,4BAAgB,CAAC,kBAAkB,CAAC;IACnD,CAAC;IAED;;;OAGG;IACK,kDAAkD;QACxD,IAAI,CAAC,KAAK,GAAG,4BAAgB,CAAC,8BAA8B,CAAC;QAE7D,MAAM,IAAI,GAAG,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;QAExC,IAAI,IAAI,CAAC,CAAC,CAAC,KAAK,IAAI,EAAE;YACpB,IAAI,CAAC,YAAY,CAAC,kBAAM,CAAC,0BAA0B,CAAC,CAAC;SACtD;aAAM;YACL,IAAI,CAAC,wBAAwB,EAAE,CAAC;SACjC;IACH,CAAC;IAED;;OAEG;IACK,wBAAwB;QAC9B,MAAM,IAAI,GAAG,IAAI,0BAAW,EAAE,CAAC;QAE/B,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;QACtB,IAAI,CAAC,UAAU,CAAC,wBAAY,CAAC,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC;QACrD,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;QAEtB,sBAAsB;QACtB,IAAI,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAC,IAAI,CAAC,EAAE;YAC9C,IAAI,CAAC,UAAU,CAAC,0BAAc,CAAC,IAAI,CAAC,CAAC;YACrC,IAAI,CAAC,WAAW,CAAC,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC;SAC/D;aAAM,IAAI,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAC,IAAI,CAAC,EAAE;YACrD,IAAI,CAAC,UAAU,CAAC,0BAAc,CAAC,IAAI,CAAC,CAAC;YACrC,IAAI,CAAC,WAAW,CAAC,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC;SAC/D;aAAM;YACL,IAAI,CAAC,UAAU,CAAC,0BAAc,CAAC,QAAQ,CAAC,CAAC;YACzC,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;YACvD,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;SAClD;QACD,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;QAEnD,IAAI,CAAC,6BAA6B;YAChC,uCAA2B,CAAC,oBAAoB,CAAC;QACnD,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC;QACpC,IAAI,CAAC,KAAK,GAAG,4BAAgB,CAAC,kBAAkB,CAAC;IACnD,CAAC;IAED;;;OAGG;IACK,kCAAkC;QACxC,+EAA+E;QAC/E,MAAM,MAAM,GAAG,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAE3C,IAAI,MAAM,CAAC,CAAC,CAAC,KAAK,IAAI,IAAI,MAAM,CAAC,CAAC,CAAC,KAAK,0BAAc,CAAC,OAAO,EAAE;YAC9D,IAAI,CAAC,YAAY,CACf,GAAG,kBAAM,CAAC,mCAAmC,MAC3C,0BAAc,CAAC,MAAM,CAAC,CAAC,CAAC,CAC1B,EAAE,CACH,CAAC;SACH;aAAM;YACL,oBAAoB;YACpB,MAAM,WAAW,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;YAE9B,IAAI,UAA2B,CAAC;YAChC,IAAI,IAAiB,CAAC;YAEtB,OAAO;YACP,IAAI,WAAW,KAAK,0BAAc,CAAC,IAAI,EAAE;gBACvC,8BAA8B;gBAC9B,MAAM,UAAU,GAAG,uCAA2B,CAAC,kBAAkB,CAAC;gBAClE,IAAI,IAAI,CAAC,cAAc,CAAC,MAAM,GAAG,UAAU,EAAE;oBAC3C,IAAI,CAAC,6BAA6B,GAAG,UAAU,CAAC;oBAChD,OAAO;iBACR;gBAED,IAAI,GAAG,0BAAW,CAAC,UAAU,CAC3B,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAC7C,CAAC;gBAEF,UAAU,GAAG;oBACX,IAAI,EAAE,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,YAAY,EAAE,CAAC;oBACtC,IAAI,EAAE,IAAI,CAAC,YAAY,EAAE;iBAC1B,CAAC;gBAEF,4DAA4D;gBAC5D,IAAI,UAAU,CAAC,IAAI,KAAK,SAAS,EAAE;oBACjC,UAAU,CAAC,IAAI,GAAG,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,SAAS,CAAC;iBACjD;gBAED,WAAW;aACZ;iBAAM,IAAI,WAAW,KAAK,0BAAc,CAAC,QAAQ,EAAE;gBAClD,MAAM,UAAU,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;gBAC7B,MAAM,UAAU,GAAG,uCAA2B,CAAC,sBAAsB,CACnE,UAAU,CACX,CAAC,CAAC,qCAAqC;gBAExC,8BAA8B;gBAC9B,IAAI,IAAI,CAAC,cAAc,CAAC,MAAM,GAAG,UAAU,EAAE;oBAC3C,IAAI,CAAC,6BAA6B,GAAG,UAAU,CAAC;oBAChD,OAAO;iBACR;gBAED,IAAI,GAAG,0BAAW,CAAC,UAAU,CAC3B,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,iCAAiC;iBAC/E,CAAC;gBAEF,UAAU,GAAG;oBACX,IAAI,EAAE,IAAI,CAAC,UAAU,CAAC,UAAU,CAAC;oBACjC,IAAI,EAAE,IAAI,CAAC,YAAY,EAAE;iBAC1B,CAAC;gBACF,OAAO;aACR;iBAAM,IAAI,WAAW,KAAK,0BAAc,CAAC,IAAI,EAAE;gBAC9C,8BAA8B;gBAC9B,MAAM,UAAU,GAAG,uCAA2B,CAAC,kBAAkB,CAAC;gBAClE,IAAI,IAAI,CAAC,cAAc,CAAC,MAAM,GAAG,UAAU,EAAE;oBAC3C,IAAI,CAAC,6BAA6B,GAAG,UAAU,CAAC;oBAChD,OAAO;iBACR;gBAED,IAAI,GAAG,0BAAW,CAAC,UAAU,CAC3B,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAC7C,CAAC;gBAEF,UAAU,GAAG;oBACX,IAAI,EAAE,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC;oBACtC,IAAI,EAAE,IAAI,CAAC,YAAY,EAAE;iBAC1B,CAAC;aACH;YAED,6BAA6B;YAC7B,IAAI,CAAC,KAAK,GAAG,4BAAgB,CAAC,qBAAqB,CAAC;YAEpD,gEAAgE;YAChE,IAAI,wBAAY,CAAC,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,KAAK,wBAAY,CAAC,OAAO,EAAE;gBAChE,IAAI,CAAC,KAAK,GAAG,4BAAgB,CAAC,WAAW,CAAC;gBAC1C,IAAI,CAAC,4BAA4B,EAAE,CAAC;gBACpC,IAAI,CAAC,IAAI,CAAC,aAAa,EAAE,EAAE,MAAM,EAAE,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC;aACpD;iBAAM,IAAI,wBAAY,CAAC,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,KAAK,wBAAY,CAAC,IAAI,EAAE;gBACpE;mHACmG;gBACnG,IAAI,CAAC,KAAK,GAAG,4BAAgB,CAAC,yBAAyB,CAAC;gBACxD,IAAI,CAAC,6BAA6B;oBAChC,uCAA2B,CAAC,oBAAoB,CAAC;gBACnD,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,EAAE,MAAM,EAAE,IAAI,CAAC,OAAO,EAAE,UAAU,EAAE,CAAC,CAAC;gBACzD;;;kBAGE;aACH;iBAAM,IACL,wBAAY,CAAC,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,KAAK,wBAAY,CAAC,SAAS,EAC9D;gBACA,IAAI,CAAC,KAAK,GAAG,4BAAgB,CAAC,WAAW,CAAC;gBAC1C,IAAI,CAAC,4BAA4B,EAAE,CAAC;gBACpC,IAAI,CAAC,IAAI,CAAC,aAAa,EAAE,EAAE,MAAM,EAAE,IAAI,CAAC,OAAO,EAAE,UAAU,EAAE,CAAC,CAAC;aAChE;SACF;IACH,CAAC;IAED;;OAEG;IACK,sCAAsC;QAC5C,+EAA+E;QAC/E,MAAM,MAAM,GAAG,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAE3C,IAAI,MAAM,CAAC,CAAC,CAAC,KAAK,IAAI,IAAI,MAAM,CAAC,CAAC,CAAC,KAAK,0BAAc,CAAC,OAAO,EAAE;YAC9D,IAAI,CAAC,YAAY,CACf,GAAG,kBAAM,CAAC,0CAA0C,MAClD,0BAAc,CAAC,MAAM,CAAC,CAAC,CAAC,CAC1B,EAAE,CACH,CAAC;SACH;aAAM;YACL,oBAAoB;YACpB,MAAM,WAAW,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;YAE9B,IAAI,UAA2B,CAAC;YAChC,IAAI,IAAiB,CAAC;YAEtB,OAAO;YACP,IAAI,WAAW,KAAK,0BAAc,CAAC,IAAI,EAAE;gBACvC,8BAA8B;gBAC9B,MAAM,UAAU,GAAG,uCAA2B,CAAC,kBAAkB,CAAC;gBAClE,IAAI,IAAI,CAAC,cAAc,CAAC,MAAM,GAAG,UAAU,EAAE;oBAC3C,IAAI,CAAC,6BAA6B,GAAG,UAAU,CAAC;oBAChD,OAAO;iBACR;gBAED,IAAI,GAAG,0BAAW,CAAC,UAAU,CAC3B,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAC7C,CAAC;gBAEF,UAAU,GAAG;oBACX,IAAI,EAAE,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,YAAY,EAAE,CAAC;oBACtC,IAAI,EAAE,IAAI,CAAC,YAAY,EAAE;iBAC1B,CAAC;gBAEF,4DAA4D;gBAC5D,IAAI,UAAU,CAAC,IAAI,KAAK,SAAS,EAAE;oBACjC,UAAU,CAAC,IAAI,GAAG,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,SAAS,CAAC;iBACjD;gBAED,WAAW;aACZ;iBAAM,IAAI,WAAW,KAAK,0BAAc,CAAC,QAAQ,EAAE;gBAClD,MAAM,UAAU,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;gBAC7B,MAAM,UAAU,GAAG,uCAA2B,CAAC,sBAAsB,CACnE,UAAU,CACX,CAAC,CAAC,8BAA8B;gBAEjC,8BAA8B;gBAC9B,IAAI,IAAI,CAAC,cAAc,CAAC,MAAM,GAAG,UAAU,EAAE;oBAC3C,IAAI,CAAC,6BAA6B,GAAG,UAAU,CAAC;oBAChD,OAAO;iBACR;gBAED,IAAI,GAAG,0BAAW,CAAC,UAAU,CAC3B,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,iCAAiC;iBAC/E,CAAC;gBAEF,UAAU,GAAG;oBACX,IAAI,EAAE,IAAI,CAAC,UAAU,CAAC,UAAU,CAAC;oBACjC,IAAI,EAAE,IAAI,CAAC,YAAY,EAAE;iBAC1B,CAAC;gBACF,OAAO;aACR;iBAAM,IAAI,WAAW,KAAK,0BAAc,CAAC,IAAI,EAAE;gBAC9C,8BAA8B;gBAC9B,MAAM,UAAU,GAAG,uCAA2B,CAAC,kBAAkB,CAAC;gBAClE,IAAI,IAAI,CAAC,cAAc,CAAC,MAAM,GAAG,UAAU,EAAE;oBAC3C,IAAI,CAAC,6BAA6B,GAAG,UAAU,CAAC;oBAChD,OAAO;iBACR;gBAED,IAAI,GAAG,0BAAW,CAAC,UAAU,CAC3B,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAC7C,CAAC;gBAEF,UAAU,GAAG;oBACX,IAAI,EAAE,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC;oBACtC,IAAI,EAAE,IAAI,CAAC,YAAY,EAAE;iBAC1B,CAAC;aACH;YAED,IAAI,CAAC,KAAK,GAAG,4BAAgB,CAAC,WAAW,CAAC;YAC1C,IAAI,CAAC,4BAA4B,EAAE,CAAC;YACpC,IAAI,CAAC,IAAI,CAAC,aAAa,EAAE,EAAE,MAAM,EAAE,IAAI,CAAC,OAAO,EAAE,UAAU,EAAE,CAAC,CAAC;SAChE;IACH,CAAC;IAED,IAAI,kBAAkB;QACpB,yBACK,IAAI,CAAC,QAAQ,EAChB;IACJ,CAAC;CACF;AAGC,kCAAW"} \ No newline at end of file +{"version":3,"file":"socksclient.js","sourceRoot":"","sources":["../../src/client/socksclient.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,mCAAoC;AACpC,2BAA2B;AAC3B,yBAAyB;AACzB,+CAAyC;AACzC,mDAiB6B;AAC7B,+CAG2B;AAC3B,2DAAsD;AACtD,yCAA8D;AAs2B5D,iGAt2BM,uBAAgB,OAs2BN;AA50BlB,MAAM,WAAY,SAAQ,qBAAY;IAepC,YAAY,OAA2B;QACrC,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,OAAO,qBACP,OAAO,CACX,CAAC;QAEF,8BAA8B;QAC9B,oCAA0B,CAAC,OAAO,CAAC,CAAC;QAEpC,gBAAgB;QAChB,IAAI,CAAC,QAAQ,CAAC,4BAAgB,CAAC,OAAO,CAAC,CAAC;IAC1C,CAAC;IAED;;;;;;;OAOG;IACH,MAAM,CAAC,gBAAgB,CACrB,OAA2B,EAC3B,QAAmB;QAEnB,8BAA8B;QAC9B,oCAA0B,CAAC,OAAO,EAAE,CAAC,SAAS,CAAC,CAAC,CAAC;QAEjD,OAAO,IAAI,OAAO,CAA8B,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;YAClE,MAAM,MAAM,GAAG,IAAI,WAAW,CAAC,OAAO,CAAC,CAAC;YACxC,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,eAAe,CAAC,CAAC;YACxC,MAAM,CAAC,IAAI,CAAC,aAAa,EAAE,CAAC,IAAiC,EAAE,EAAE;gBAC/D,MAAM,CAAC,kBAAkB,EAAE,CAAC;gBAC5B,IAAI,OAAO,QAAQ,KAAK,UAAU,EAAE;oBAClC,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;oBACrB,OAAO,EAAE,CAAC,CAAC,oDAAoD;iBAChE;qBAAM;oBACL,OAAO,CAAC,IAAI,CAAC,CAAC;iBACf;YACH,CAAC,CAAC,CAAC;YAEH,kDAAkD;YAClD,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,GAAU,EAAE,EAAE;gBAClC,MAAM,CAAC,kBAAkB,EAAE,CAAC;gBAC5B,IAAI,OAAO,QAAQ,KAAK,UAAU,EAAE;oBAClC,QAAQ,CAAC,GAAG,CAAC,CAAC;oBACd,OAAO,EAAE,CAAC,CAAC,oDAAoD;iBAChE;qBAAM;oBACL,MAAM,CAAC,GAAG,CAAC,CAAC;iBACb;YACH,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;OAQG;IACH,MAAM,CAAC,qBAAqB,CAC1B,OAAgC,EAChC,QAAmB;QAEnB,mCAAmC;QACnC,yCAA+B,CAAC,OAAO,CAAC,CAAC;QAEzC,kBAAkB;QAClB,IAAI,OAAO,CAAC,cAAc,EAAE;YAC1B,mBAAY,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;SAC/B;QAED,OAAO,IAAI,OAAO,CAA8B,CAAO,OAAO,EAAE,MAAM,EAAE,EAAE;YACxE,IAAI,IAAgB,CAAC;YAErB,IAAI;gBACF,kDAAkD;gBAClD,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,OAAO,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;oBAC/C,MAAM,SAAS,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;oBAErC,0HAA0H;oBAC1H,MAAM,eAAe,GACnB,CAAC,KAAK,OAAO,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC;wBAC9B,CAAC,CAAC,OAAO,CAAC,WAAW;wBACrB,CAAC,CAAC;4BACE,IAAI,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,SAAS;4BACtC,IAAI,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI;yBAClC,CAAC;oBAER,4CAA4C;oBAC5C,MAAM,MAAM,GAAG,MAAM,WAAW,CAAC,gBAAgB,CAAC;wBAChD,OAAO,EAAE,SAAS;wBAClB,KAAK,EAAE,SAAS;wBAChB,WAAW,EAAE,eAAe;qBAE7B,CAAC,CAAC;oBAEH,wCAAwC;oBACxC,IAAI,CAAC,IAAI,EAAE;wBACT,IAAI,GAAG,MAAM,CAAC,MAAM,CAAC;qBACtB;iBACF;gBAED,IAAI,OAAO,QAAQ,KAAK,UAAU,EAAE;oBAClC,QAAQ,CAAC,IAAI,EAAE,EAAC,MAAM,EAAE,IAAI,EAAC,CAAC,CAAC;oBAC/B,OAAO,EAAE,CAAC,CAAC,oDAAoD;iBAChE;qBAAM;oBACL,OAAO,CAAC,EAAC,MAAM,EAAE,IAAI,EAAC,CAAC,CAAC;iBACzB;aACF;YAAC,OAAO,GAAG,EAAE;gBACZ,IAAI,OAAO,QAAQ,KAAK,UAAU,EAAE;oBAClC,QAAQ,CAAC,GAAG,CAAC,CAAC;oBACd,OAAO,EAAE,CAAC,CAAC,oDAAoD;iBAChE;qBAAM;oBACL,MAAM,CAAC,GAAG,CAAC,CAAC;iBACb;aACF;QACH,CAAC,CAAA,CAAC,CAAC;IACL,CAAC;IAED;;;OAGG;IACH,MAAM,CAAC,cAAc,CAAC,OAA6B;QACjD,MAAM,IAAI,GAAG,IAAI,0BAAW,EAAE,CAAC;QAC/B,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC;QACtB,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,WAAW,IAAI,CAAC,CAAC,CAAC;QAE1C,qBAAqB;QACrB,IAAI,GAAG,CAAC,MAAM,CAAC,OAAO,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE;YACvC,IAAI,CAAC,UAAU,CAAC,0BAAc,CAAC,IAAI,CAAC,CAAC;YACrC,IAAI,CAAC,aAAa,CAAC,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC;SACxD;aAAM,IAAI,GAAG,CAAC,MAAM,CAAC,OAAO,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE;YAC9C,IAAI,CAAC,UAAU,CAAC,0BAAc,CAAC,IAAI,CAAC,CAAC;YACrC,IAAI,CAAC,WAAW,CAAC,EAAE,CAAC,QAAQ,CAAC,OAAO,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC;SACxD;aAAM;YACL,IAAI,CAAC,UAAU,CAAC,0BAAc,CAAC,QAAQ,CAAC,CAAC;YACzC,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,UAAU,CAAC,OAAO,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC;YAC5D,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;SAC3C;QAED,OAAO;QACP,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;QAE5C,OAAO;QACP,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QAE/B,OAAO,IAAI,CAAC,QAAQ,EAAE,CAAC;IACzB,CAAC;IAED;;;OAGG;IACH,MAAM,CAAC,aAAa,CAAC,IAAY;QAC/B,MAAM,IAAI,GAAG,0BAAW,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;QAC1C,IAAI,CAAC,UAAU,GAAG,CAAC,CAAC;QAEpB,MAAM,WAAW,GAAG,IAAI,CAAC,SAAS,EAAE,CAAC;QACrC,MAAM,QAAQ,GAAmB,IAAI,CAAC,SAAS,EAAE,CAAC;QAClD,IAAI,UAAU,CAAC;QAEf,IAAI,QAAQ,KAAK,0BAAc,CAAC,IAAI,EAAE;YACpC,UAAU,GAAG,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,YAAY,EAAE,CAAC,CAAC;SAC/C;aAAM,IAAI,QAAQ,KAAK,0BAAc,CAAC,IAAI,EAAE;YAC3C,UAAU,GAAG,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC,CAAC;SAC/C;aAAM;YACL,UAAU,GAAG,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,SAAS,EAAE,CAAC,CAAC;SAChD;QAED,MAAM,UAAU,GAAG,IAAI,CAAC,YAAY,EAAE,CAAC;QAEvC,OAAO;YACL,WAAW;YACX,UAAU,EAAE;gBACV,IAAI,EAAE,UAAU;gBAChB,IAAI,EAAE,UAAU;aACjB;YACD,IAAI,EAAE,IAAI,CAAC,UAAU,EAAE;SACxB,CAAC;IACJ,CAAC;IAED;;OAEG;IACK,QAAQ,CAAC,QAA0B;QACzC,IAAI,IAAI,CAAC,KAAK,KAAK,4BAAgB,CAAC,KAAK,EAAE;YACzC,IAAI,CAAC,KAAK,GAAG,QAAQ,CAAC;SACvB;IACH,CAAC;IAED;;;OAGG;IACI,OAAO,CAAC,cAAuB;QACpC,IAAI,CAAC,cAAc,GAAG,CAAC,IAAY,EAAE,EAAE,CAAC,IAAI,CAAC,qBAAqB,CAAC,IAAI,CAAC,CAAC;QACzE,IAAI,CAAC,OAAO,GAAG,GAAG,EAAE,CAAC,IAAI,CAAC,cAAc,EAAE,CAAC;QAC3C,IAAI,CAAC,OAAO,GAAG,CAAC,GAAU,EAAE,EAAE,CAAC,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC;QACxD,IAAI,CAAC,SAAS,GAAG,GAAG,EAAE,CAAC,IAAI,CAAC,gBAAgB,EAAE,CAAC;QAE/C,+CAA+C;QAC/C,MAAM,KAAK,GAAG,UAAU,CACtB,GAAG,EAAE,CAAC,IAAI,CAAC,oBAAoB,EAAE,EACjC,IAAI,CAAC,OAAO,CAAC,OAAO,IAAI,2BAAe,CACxC,CAAC;QAEF,8EAA8E;QAC9E,IAAI,KAAK,CAAC,KAAK,IAAI,OAAO,KAAK,CAAC,KAAK,KAAK,UAAU,EAAE;YACpD,KAAK,CAAC,KAAK,EAAE,CAAC;SACf;QAED,yGAAyG;QACzG,IAAI,cAAc,EAAE;YAClB,IAAI,CAAC,MAAM,GAAG,cAAc,CAAC;SAC9B;aAAM;YACL,IAAI,CAAC,MAAM,GAAG,IAAI,GAAG,CAAC,MAAM,EAAE,CAAC;SAChC;QAED,gCAAgC;QAChC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;QACxC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;QACxC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,SAAS,CAAC,CAAC;QAC5C,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,IAAI,CAAC,cAAc,CAAC,CAAC;QAE5C,IAAI,CAAC,QAAQ,CAAC,4BAAgB,CAAC,UAAU,CAAC,CAAC;QAC3C,IAAI,CAAC,aAAa,GAAG,IAAI,6BAAa,EAAE,CAAC;QAEzC,IAAI,cAAc,EAAE;YAClB,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;SAC7B;aAAM;YACJ,IAAI,CAAC,MAAqB,CAAC,OAAO,CAAC,IAAI,CAAC,gBAAgB,EAAE,CAAC,CAAC;YAE7D,IACE,IAAI,CAAC,OAAO,CAAC,eAAe,KAAK,SAAS;gBAC1C,IAAI,CAAC,OAAO,CAAC,eAAe,KAAK,IAAI,EACrC;gBACC,IAAI,CAAC,MAAqB,CAAC,UAAU,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC,CAAC;aACxE;SACF;QAED,6FAA6F;QAC7F,IAAI,CAAC,mBAAmB,CAAC,aAAa,EAAE,CAAC,IAAI,EAAE,EAAE;YAC/C,YAAY,CAAC,GAAG,EAAE;gBAChB,IAAI,IAAI,CAAC,aAAa,CAAC,MAAM,GAAG,CAAC,EAAE;oBACjC,MAAM,UAAU,GAAG,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC;oBAErE,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;iBACtC;gBACD,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC;YACvB,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC;IAED,+EAA+E;IACvE,gBAAgB;QACtB,uCACK,IAAI,CAAC,OAAO,CAAC,cAAc,KAC9B,IAAI,EAAE,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,IAAI,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,SAAS,EAC7D,IAAI,EAAE,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,IAC7B;IACJ,CAAC;IAED;;;OAGG;IACK,oBAAoB;QAC1B,IACE,IAAI,CAAC,KAAK,KAAK,4BAAgB,CAAC,WAAW;YAC3C,IAAI,CAAC,KAAK,KAAK,4BAAgB,CAAC,yBAAyB,EACzD;YACA,IAAI,CAAC,WAAW,CAAC,kBAAM,CAAC,uBAAuB,CAAC,CAAC;SAClD;IACH,CAAC;IAED;;OAEG;IACK,gBAAgB;QACtB,IAAI,CAAC,QAAQ,CAAC,4BAAgB,CAAC,SAAS,CAAC,CAAC;QAE1C,0BAA0B;QAC1B,IAAI,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,EAAE;YACjC,IAAI,CAAC,0BAA0B,EAAE,CAAC;SACnC;aAAM;YACL,IAAI,CAAC,0BAA0B,EAAE,CAAC;SACnC;QAED,IAAI,CAAC,QAAQ,CAAC,4BAAgB,CAAC,oBAAoB,CAAC,CAAC;IACvD,CAAC;IAED;;;OAGG;IACK,qBAAqB,CAAC,IAAY;QACxC;;;UAGE;QACF,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;QAEhC,6BAA6B;QAC7B,IAAI,CAAC,WAAW,EAAE,CAAC;IACrB,CAAC;IAED;;OAEG;IACK,WAAW;QACjB,mFAAmF;QACnF,OACE,IAAI,CAAC,KAAK,KAAK,4BAAgB,CAAC,WAAW;YAC3C,IAAI,CAAC,KAAK,KAAK,4BAAgB,CAAC,KAAK;YACrC,IAAI,CAAC,aAAa,CAAC,MAAM,IAAI,IAAI,CAAC,4BAA4B,EAC9D;YACA,gDAAgD;YAChD,IAAI,IAAI,CAAC,KAAK,KAAK,4BAAgB,CAAC,oBAAoB,EAAE;gBACxD,IAAI,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,EAAE;oBACjC,4CAA4C;oBAC5C,IAAI,CAAC,kCAAkC,EAAE,CAAC;iBAC3C;qBAAM;oBACL,wDAAwD;oBACxD,IAAI,CAAC,oCAAoC,EAAE,CAAC;iBAC7C;gBACD,wDAAwD;aACzD;iBAAM,IAAI,IAAI,CAAC,KAAK,KAAK,4BAAgB,CAAC,kBAAkB,EAAE;gBAC7D,IAAI,CAAC,kDAAkD,EAAE,CAAC;gBAC1D,6DAA6D;aAC9D;iBAAM,IAAI,IAAI,CAAC,KAAK,KAAK,4BAAgB,CAAC,kBAAkB,EAAE;gBAC7D,IAAI,CAAC,kCAAkC,EAAE,CAAC;gBAC1C,mEAAmE;aACpE;iBAAM,IAAI,IAAI,CAAC,KAAK,KAAK,4BAAgB,CAAC,yBAAyB,EAAE;gBACpE,IAAI,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,EAAE;oBACjC,IAAI,CAAC,sCAAsC,EAAE,CAAC;iBAC/C;qBAAM;oBACL,IAAI,CAAC,sCAAsC,EAAE,CAAC;iBAC/C;aACF;iBAAM;gBACL,IAAI,CAAC,WAAW,CAAC,kBAAM,CAAC,aAAa,CAAC,CAAC;gBACvC,MAAM;aACP;SACF;IACH,CAAC;IAED;;;OAGG;IACK,cAAc;QACpB,IAAI,CAAC,WAAW,CAAC,kBAAM,CAAC,YAAY,CAAC,CAAC;IACxC,CAAC;IAED;;;OAGG;IACK,cAAc,CAAC,GAAU;QAC/B,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;IAChC,CAAC;IAED;;OAEG;IACK,4BAA4B;QAClC,6FAA6F;QAC7F,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC;QACpB,IAAI,CAAC,MAAM,CAAC,cAAc,CAAC,MAAM,EAAE,IAAI,CAAC,cAAc,CAAC,CAAC;QACxD,IAAI,CAAC,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;QAClD,IAAI,CAAC,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;QAClD,IAAI,CAAC,MAAM,CAAC,cAAc,CAAC,SAAS,EAAE,IAAI,CAAC,SAAS,CAAC,CAAC;IACxD,CAAC;IAED;;;OAGG;IACK,WAAW,CAAC,GAAW;QAC7B,2FAA2F;QAC3F,IAAI,IAAI,CAAC,KAAK,KAAK,4BAAgB,CAAC,KAAK,EAAE;YACzC,+BAA+B;YAC/B,IAAI,CAAC,QAAQ,CAAC,4BAAgB,CAAC,KAAK,CAAC,CAAC;YAEtC,iBAAiB;YACjB,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;YAEtB,4BAA4B;YAC5B,IAAI,CAAC,4BAA4B,EAAE,CAAC;YAEpC,sBAAsB;YACtB,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,uBAAgB,CAAC,GAAG,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC;SAC7D;IACH,CAAC;IAED;;OAEG;IACK,0BAA0B;QAChC,MAAM,MAAM,GAAG,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,MAAM,IAAI,EAAE,CAAC;QAE/C,MAAM,IAAI,GAAG,IAAI,0BAAW,EAAE,CAAC;QAC/B,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;QACtB,IAAI,CAAC,UAAU,CAAC,wBAAY,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC;QACpD,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;QAElD,iBAAiB;QACjB,IAAI,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,IAAI,CAAC,EAAE;YAC7C,IAAI,CAAC,WAAW,CAAC,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC;YAC7D,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC;YAC3B,sBAAsB;SACvB;aAAM;YACL,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;YACtB,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;YACtB,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;YACtB,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;YACtB,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC;YAC3B,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;SACnD;QAED,IAAI,CAAC,4BAA4B;YAC/B,uCAA2B,CAAC,cAAc,CAAC;QAC7C,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC;IACrC,CAAC;IAED;;;OAGG;IACK,kCAAkC;QACxC,MAAM,IAAI,GAAG,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;QAEvC,IAAI,IAAI,CAAC,CAAC,CAAC,KAAK,0BAAc,CAAC,OAAO,EAAE;YACtC,IAAI,CAAC,WAAW,CACd,GAAG,kBAAM,CAAC,6BAA6B,OACrC,0BAAc,CAAC,IAAI,CAAC,CAAC,CAAC,CACxB,GAAG,CACJ,CAAC;SACH;aAAM;YACL,gBAAgB;YAChB,IAAI,wBAAY,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,KAAK,wBAAY,CAAC,IAAI,EAAE;gBAC5D,MAAM,IAAI,GAAG,0BAAW,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;gBAC1C,IAAI,CAAC,UAAU,GAAG,CAAC,CAAC;gBAEpB,MAAM,UAAU,GAAoB;oBAClC,IAAI,EAAE,IAAI,CAAC,YAAY,EAAE;oBACzB,IAAI,EAAE,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,YAAY,EAAE,CAAC;iBACvC,CAAC;gBAEF,yCAAyC;gBACzC,IAAI,UAAU,CAAC,IAAI,KAAK,SAAS,EAAE;oBACjC,UAAU,CAAC,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,SAAS,CAAC;iBAChD;gBACD,IAAI,CAAC,QAAQ,CAAC,4BAAgB,CAAC,yBAAyB,CAAC,CAAC;gBAC1D,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,EAAC,UAAU,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,EAAC,CAAC,CAAC;gBAEtD,mBAAmB;aACpB;iBAAM;gBACL,IAAI,CAAC,QAAQ,CAAC,4BAAgB,CAAC,WAAW,CAAC,CAAC;gBAC5C,IAAI,CAAC,4BAA4B,EAAE,CAAC;gBACpC,IAAI,CAAC,IAAI,CAAC,aAAa,EAAE,EAAC,MAAM,EAAE,IAAI,CAAC,MAAM,EAAC,CAAC,CAAC;aACjD;SACF;IACH,CAAC;IAED;;;OAGG;IACK,sCAAsC;QAC5C,MAAM,IAAI,GAAG,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;QAEvC,IAAI,IAAI,CAAC,CAAC,CAAC,KAAK,0BAAc,CAAC,OAAO,EAAE;YACtC,IAAI,CAAC,WAAW,CACd,GAAG,kBAAM,CAAC,0CAA0C,OAClD,0BAAc,CAAC,IAAI,CAAC,CAAC,CAAC,CACxB,GAAG,CACJ,CAAC;SACH;aAAM;YACL,MAAM,IAAI,GAAG,0BAAW,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;YAC1C,IAAI,CAAC,UAAU,GAAG,CAAC,CAAC;YAEpB,MAAM,UAAU,GAAoB;gBAClC,IAAI,EAAE,IAAI,CAAC,YAAY,EAAE;gBACzB,IAAI,EAAE,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,YAAY,EAAE,CAAC;aACvC,CAAC;YAEF,IAAI,CAAC,QAAQ,CAAC,4BAAgB,CAAC,WAAW,CAAC,CAAC;YAC5C,IAAI,CAAC,4BAA4B,EAAE,CAAC;YACpC,IAAI,CAAC,IAAI,CAAC,aAAa,EAAE,EAAC,UAAU,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,EAAC,CAAC,CAAC;SAC7D;IACH,CAAC;IAED;;OAEG;IACK,0BAA0B;QAChC,MAAM,IAAI,GAAG,IAAI,0BAAW,EAAE,CAAC;QAC/B,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;QAEtB,6FAA6F;QAC7F,sHAAsH;QACtH,IAAI,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,MAAM,IAAI,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,QAAQ,EAAE;YAC5D,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;YACnB,IAAI,CAAC,UAAU,CAAC,sBAAU,CAAC,MAAM,CAAC,CAAC;YACnC,IAAI,CAAC,UAAU,CAAC,sBAAU,CAAC,QAAQ,CAAC,CAAC;SACtC;aAAM;YACL,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;YACnB,IAAI,CAAC,UAAU,CAAC,sBAAU,CAAC,MAAM,CAAC,CAAC;SACpC;QAED,IAAI,CAAC,4BAA4B;YAC/B,uCAA2B,CAAC,8BAA8B,CAAC;QAC7D,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC;QACnC,IAAI,CAAC,QAAQ,CAAC,4BAAgB,CAAC,oBAAoB,CAAC,CAAC;IACvD,CAAC;IAED;;;OAGG;IACK,oCAAoC;QAC1C,MAAM,IAAI,GAAG,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;QAEvC,IAAI,IAAI,CAAC,CAAC,CAAC,KAAK,IAAI,EAAE;YACpB,IAAI,CAAC,WAAW,CAAC,kBAAM,CAAC,yCAAyC,CAAC,CAAC;SACpE;aAAM,IAAI,IAAI,CAAC,CAAC,CAAC,KAAK,IAAI,EAAE;YAC3B,IAAI,CAAC,WAAW,CAAC,kBAAM,CAAC,+CAA+C,CAAC,CAAC;SAC1E;aAAM;YACL,6EAA6E;YAC7E,IAAI,IAAI,CAAC,CAAC,CAAC,KAAK,sBAAU,CAAC,MAAM,EAAE;gBACjC,IAAI,CAAC,wBAAwB,EAAE,CAAC;gBAChC,0EAA0E;aAC3E;iBAAM,IAAI,IAAI,CAAC,CAAC,CAAC,KAAK,sBAAU,CAAC,QAAQ,EAAE;gBAC1C,IAAI,CAAC,gCAAgC,EAAE,CAAC;aACzC;iBAAM;gBACL,IAAI,CAAC,WAAW,CAAC,kBAAM,CAAC,4CAA4C,CAAC,CAAC;aACvE;SACF;IACH,CAAC;IAED;;;;OAIG;IACK,gCAAgC;QACtC,MAAM,MAAM,GAAG,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,MAAM,IAAI,EAAE,CAAC;QAC/C,MAAM,QAAQ,GAAG,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,QAAQ,IAAI,EAAE,CAAC;QAEnD,MAAM,IAAI,GAAG,IAAI,0BAAW,EAAE,CAAC;QAC/B,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;QACtB,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC;QAC3C,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;QACzB,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,CAAC;QAC7C,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC;QAE3B,IAAI,CAAC,4BAA4B;YAC/B,uCAA2B,CAAC,oCAAoC,CAAC;QACnE,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC;QACnC,IAAI,CAAC,QAAQ,CAAC,4BAAgB,CAAC,kBAAkB,CAAC,CAAC;IACrD,CAAC;IAED;;;OAGG;IACK,kDAAkD;QACxD,IAAI,CAAC,QAAQ,CAAC,4BAAgB,CAAC,8BAA8B,CAAC,CAAC;QAE/D,MAAM,IAAI,GAAG,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;QAEvC,IAAI,IAAI,CAAC,CAAC,CAAC,KAAK,IAAI,EAAE;YACpB,IAAI,CAAC,WAAW,CAAC,kBAAM,CAAC,0BAA0B,CAAC,CAAC;SACrD;aAAM;YACL,IAAI,CAAC,wBAAwB,EAAE,CAAC;SACjC;IACH,CAAC;IAED;;OAEG;IACK,wBAAwB;QAC9B,MAAM,IAAI,GAAG,IAAI,0BAAW,EAAE,CAAC;QAE/B,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;QACtB,IAAI,CAAC,UAAU,CAAC,wBAAY,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC;QACpD,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;QAEtB,sBAAsB;QACtB,IAAI,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,IAAI,CAAC,EAAE;YAC7C,IAAI,CAAC,UAAU,CAAC,0BAAc,CAAC,IAAI,CAAC,CAAC;YACrC,IAAI,CAAC,WAAW,CAAC,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC;SAC9D;aAAM,IAAI,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,IAAI,CAAC,EAAE;YACpD,IAAI,CAAC,UAAU,CAAC,0BAAc,CAAC,IAAI,CAAC,CAAC;YACrC,IAAI,CAAC,WAAW,CAAC,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC;SAC9D;aAAM;YACL,IAAI,CAAC,UAAU,CAAC,0BAAc,CAAC,QAAQ,CAAC,CAAC;YACzC,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;YACtD,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;SACjD;QACD,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;QAElD,IAAI,CAAC,4BAA4B;YAC/B,uCAA2B,CAAC,oBAAoB,CAAC;QACnD,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC;QACnC,IAAI,CAAC,QAAQ,CAAC,4BAAgB,CAAC,kBAAkB,CAAC,CAAC;IACrD,CAAC;IAED;;;OAGG;IACK,kCAAkC;QACxC,+EAA+E;QAC/E,MAAM,MAAM,GAAG,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAE1C,IAAI,MAAM,CAAC,CAAC,CAAC,KAAK,IAAI,IAAI,MAAM,CAAC,CAAC,CAAC,KAAK,0BAAc,CAAC,OAAO,EAAE;YAC9D,IAAI,CAAC,WAAW,CACd,GAAG,kBAAM,CAAC,mCAAmC,MAC3C,0BAAc,CAAC,MAAM,CAAC,CAAC,CAAC,CAC1B,EAAE,CACH,CAAC;SACH;aAAM;YACL,oBAAoB;YACpB,MAAM,WAAW,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;YAE9B,IAAI,UAA2B,CAAC;YAChC,IAAI,IAAiB,CAAC;YAEtB,OAAO;YACP,IAAI,WAAW,KAAK,0BAAc,CAAC,IAAI,EAAE;gBACvC,8BAA8B;gBAC9B,MAAM,UAAU,GAAG,uCAA2B,CAAC,kBAAkB,CAAC;gBAClE,IAAI,IAAI,CAAC,aAAa,CAAC,MAAM,GAAG,UAAU,EAAE;oBAC1C,IAAI,CAAC,4BAA4B,GAAG,UAAU,CAAC;oBAC/C,OAAO;iBACR;gBAED,IAAI,GAAG,0BAAW,CAAC,UAAU,CAC3B,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAC5C,CAAC;gBAEF,UAAU,GAAG;oBACX,IAAI,EAAE,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,YAAY,EAAE,CAAC;oBACtC,IAAI,EAAE,IAAI,CAAC,YAAY,EAAE;iBAC1B,CAAC;gBAEF,4DAA4D;gBAC5D,IAAI,UAAU,CAAC,IAAI,KAAK,SAAS,EAAE;oBACjC,UAAU,CAAC,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,SAAS,CAAC;iBAChD;gBAED,WAAW;aACZ;iBAAM,IAAI,WAAW,KAAK,0BAAc,CAAC,QAAQ,EAAE;gBAClD,MAAM,UAAU,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;gBAC7B,MAAM,UAAU,GAAG,uCAA2B,CAAC,sBAAsB,CACnE,UAAU,CACX,CAAC,CAAC,qCAAqC;gBAExC,8BAA8B;gBAC9B,IAAI,IAAI,CAAC,aAAa,CAAC,MAAM,GAAG,UAAU,EAAE;oBAC1C,IAAI,CAAC,4BAA4B,GAAG,UAAU,CAAC;oBAC/C,OAAO;iBACR;gBAED,IAAI,GAAG,0BAAW,CAAC,UAAU,CAC3B,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAC5C,CAAC;gBAEF,UAAU,GAAG;oBACX,IAAI,EAAE,IAAI,CAAC,UAAU,CAAC,UAAU,CAAC;oBACjC,IAAI,EAAE,IAAI,CAAC,YAAY,EAAE;iBAC1B,CAAC;gBACF,OAAO;aACR;iBAAM,IAAI,WAAW,KAAK,0BAAc,CAAC,IAAI,EAAE;gBAC9C,8BAA8B;gBAC9B,MAAM,UAAU,GAAG,uCAA2B,CAAC,kBAAkB,CAAC;gBAClE,IAAI,IAAI,CAAC,aAAa,CAAC,MAAM,GAAG,UAAU,EAAE;oBAC1C,IAAI,CAAC,4BAA4B,GAAG,UAAU,CAAC;oBAC/C,OAAO;iBACR;gBAED,IAAI,GAAG,0BAAW,CAAC,UAAU,CAC3B,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAC5C,CAAC;gBAEF,UAAU,GAAG;oBACX,IAAI,EAAE,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC;oBACtC,IAAI,EAAE,IAAI,CAAC,YAAY,EAAE;iBAC1B,CAAC;aACH;YAED,6BAA6B;YAC7B,IAAI,CAAC,QAAQ,CAAC,4BAAgB,CAAC,qBAAqB,CAAC,CAAC;YAEtD,gEAAgE;YAChE,IAAI,wBAAY,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,KAAK,wBAAY,CAAC,OAAO,EAAE;gBAC/D,IAAI,CAAC,QAAQ,CAAC,4BAAgB,CAAC,WAAW,CAAC,CAAC;gBAC5C,IAAI,CAAC,4BAA4B,EAAE,CAAC;gBACpC,IAAI,CAAC,IAAI,CAAC,aAAa,EAAE,EAAC,MAAM,EAAE,IAAI,CAAC,MAAM,EAAC,CAAC,CAAC;aACjD;iBAAM,IAAI,wBAAY,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,KAAK,wBAAY,CAAC,IAAI,EAAE;gBACnE;mHACmG;gBACnG,IAAI,CAAC,QAAQ,CAAC,4BAAgB,CAAC,yBAAyB,CAAC,CAAC;gBAC1D,IAAI,CAAC,4BAA4B;oBAC/B,uCAA2B,CAAC,oBAAoB,CAAC;gBACnD,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,EAAC,UAAU,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,EAAC,CAAC,CAAC;gBACtD;;;kBAGE;aACH;iBAAM,IACL,wBAAY,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,KAAK,wBAAY,CAAC,SAAS,EAC7D;gBACA,IAAI,CAAC,QAAQ,CAAC,4BAAgB,CAAC,WAAW,CAAC,CAAC;gBAC5C,IAAI,CAAC,4BAA4B,EAAE,CAAC;gBACpC,IAAI,CAAC,IAAI,CAAC,aAAa,EAAE;oBACvB,UAAU;oBACV,MAAM,EAAE,IAAI,CAAC,MAAM;iBACpB,CAAC,CAAC;aACJ;SACF;IACH,CAAC;IAED;;OAEG;IACK,sCAAsC;QAC5C,+EAA+E;QAC/E,MAAM,MAAM,GAAG,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAE1C,IAAI,MAAM,CAAC,CAAC,CAAC,KAAK,IAAI,IAAI,MAAM,CAAC,CAAC,CAAC,KAAK,0BAAc,CAAC,OAAO,EAAE;YAC9D,IAAI,CAAC,WAAW,CACd,GAAG,kBAAM,CAAC,0CAA0C,MAClD,0BAAc,CAAC,MAAM,CAAC,CAAC,CAAC,CAC1B,EAAE,CACH,CAAC;SACH;aAAM;YACL,oBAAoB;YACpB,MAAM,WAAW,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;YAE9B,IAAI,UAA2B,CAAC;YAChC,IAAI,IAAiB,CAAC;YAEtB,OAAO;YACP,IAAI,WAAW,KAAK,0BAAc,CAAC,IAAI,EAAE;gBACvC,8BAA8B;gBAC9B,MAAM,UAAU,GAAG,uCAA2B,CAAC,kBAAkB,CAAC;gBAClE,IAAI,IAAI,CAAC,aAAa,CAAC,MAAM,GAAG,UAAU,EAAE;oBAC1C,IAAI,CAAC,4BAA4B,GAAG,UAAU,CAAC;oBAC/C,OAAO;iBACR;gBAED,IAAI,GAAG,0BAAW,CAAC,UAAU,CAC3B,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAC5C,CAAC;gBAEF,UAAU,GAAG;oBACX,IAAI,EAAE,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,YAAY,EAAE,CAAC;oBACtC,IAAI,EAAE,IAAI,CAAC,YAAY,EAAE;iBAC1B,CAAC;gBAEF,4DAA4D;gBAC5D,IAAI,UAAU,CAAC,IAAI,KAAK,SAAS,EAAE;oBACjC,UAAU,CAAC,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,SAAS,CAAC;iBAChD;gBAED,WAAW;aACZ;iBAAM,IAAI,WAAW,KAAK,0BAAc,CAAC,QAAQ,EAAE;gBAClD,MAAM,UAAU,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;gBAC7B,MAAM,UAAU,GAAG,uCAA2B,CAAC,sBAAsB,CACnE,UAAU,CACX,CAAC,CAAC,8BAA8B;gBAEjC,8BAA8B;gBAC9B,IAAI,IAAI,CAAC,aAAa,CAAC,MAAM,GAAG,UAAU,EAAE;oBAC1C,IAAI,CAAC,4BAA4B,GAAG,UAAU,CAAC;oBAC/C,OAAO;iBACR;gBAED,IAAI,GAAG,0BAAW,CAAC,UAAU,CAC3B,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAC5C,CAAC;gBAEF,UAAU,GAAG;oBACX,IAAI,EAAE,IAAI,CAAC,UAAU,CAAC,UAAU,CAAC;oBACjC,IAAI,EAAE,IAAI,CAAC,YAAY,EAAE;iBAC1B,CAAC;gBACF,OAAO;aACR;iBAAM,IAAI,WAAW,KAAK,0BAAc,CAAC,IAAI,EAAE;gBAC9C,8BAA8B;gBAC9B,MAAM,UAAU,GAAG,uCAA2B,CAAC,kBAAkB,CAAC;gBAClE,IAAI,IAAI,CAAC,aAAa,CAAC,MAAM,GAAG,UAAU,EAAE;oBAC1C,IAAI,CAAC,4BAA4B,GAAG,UAAU,CAAC;oBAC/C,OAAO;iBACR;gBAED,IAAI,GAAG,0BAAW,CAAC,UAAU,CAC3B,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAC5C,CAAC;gBAEF,UAAU,GAAG;oBACX,IAAI,EAAE,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC;oBACtC,IAAI,EAAE,IAAI,CAAC,YAAY,EAAE;iBAC1B,CAAC;aACH;YAED,IAAI,CAAC,QAAQ,CAAC,4BAAgB,CAAC,WAAW,CAAC,CAAC;YAC5C,IAAI,CAAC,4BAA4B,EAAE,CAAC;YACpC,IAAI,CAAC,IAAI,CAAC,aAAa,EAAE,EAAC,UAAU,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,EAAC,CAAC,CAAC;SAC7D;IACH,CAAC;IAED,IAAI,kBAAkB;QACpB,yBACK,IAAI,CAAC,OAAO,EACf;IACJ,CAAC;CACF;AAGC,kCAAW"} \ No newline at end of file diff --git a/deps/npm/node_modules/socks/build/common/constants.js b/deps/npm/node_modules/socks/build/common/constants.js index d76b2101147189..8f8f5436ca142f 100644 --- a/deps/npm/node_modules/socks/build/common/constants.js +++ b/deps/npm/node_modules/socks/build/common/constants.js @@ -1,5 +1,6 @@ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); +exports.SOCKS_INCOMING_PACKET_SIZES = exports.SocksClientState = exports.Socks5Response = exports.Socks5HostType = exports.Socks5Auth = exports.Socks4Response = exports.SocksCommand = exports.ERRORS = exports.DEFAULT_TIMEOUT = void 0; const DEFAULT_TIMEOUT = 30000; exports.DEFAULT_TIMEOUT = DEFAULT_TIMEOUT; // prettier-ignore @@ -40,7 +41,7 @@ const SOCKS_INCOMING_PACKET_SIZES = { Socks5ResponseIPv6: 22, Socks5ResponseHostname: (hostNameLength) => hostNameLength + 7, // Command response + incoming connection (bind) - Socks4Response: 8 // 2 header + 2 port + 4 ip + Socks4Response: 8, }; exports.SOCKS_INCOMING_PACKET_SIZES = SOCKS_INCOMING_PACKET_SIZES; var SocksCommand; diff --git a/deps/npm/node_modules/socks/build/common/constants.js.map b/deps/npm/node_modules/socks/build/common/constants.js.map index a8677f72d7f1ab..70d31db294c55a 100644 --- a/deps/npm/node_modules/socks/build/common/constants.js.map +++ b/deps/npm/node_modules/socks/build/common/constants.js.map @@ -1 +1 @@ -{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/common/constants.ts"],"names":[],"mappings":";;AAIA,MAAM,eAAe,GAAG,KAAK,CAAC;AA6L5B,0CAAe;AAzLjB,kBAAkB;AAClB,MAAM,MAAM,GAAG;IACb,mBAAmB,EAAE,wFAAwF;IAC7G,+BAA+B,EAAE,oGAAoG;IACrI,wBAAwB,EAAE,8FAA8F;IACxH,oCAAoC,EAAE,2CAA2C;IACjF,uCAAuC,EAAE,uFAAuF;IAChI,8BAA8B,EAAE,4CAA4C;IAC5E,gCAAgC,EAAE,8EAA8E;IAChH,sCAAsC,EAAE,2DAA2D;IACnG,gBAAgB,EAAE,mBAAmB;IACrC,YAAY,EAAE,eAAe;IAC7B,uBAAuB,EAAE,4BAA4B;IACrD,aAAa,EAAE,qDAAqD;IACpE,8BAA8B,EAAE,4CAA4C;IAC5E,6BAA6B,EAAE,kCAAkC;IACjE,uCAAuC,EAAE,6CAA6C;IACtF,0CAA0C,EAAE,iDAAiD;IAC7F,qCAAqC,EAAE,oDAAoD;IAC3F,yCAAyC,EAAE,mEAAmE;IAC9G,+CAA+C,EAAE,6EAA6E;IAC9H,4CAA4C,EAAE,yEAAyE;IACvH,0BAA0B,EAAE,8BAA8B;IAC1D,2BAA2B,EAAE,kDAAkD;IAC/E,mCAAmC,EAAE,kCAAkC;IACvE,uCAAuC,EAAE,sDAAsD;IAC/F,0CAA0C,EAAE,iDAAiD;CAC9F,CAAC;AA+JA,wBAAM;AA7JR,MAAM,2BAA2B,GAAG;IAClC,8BAA8B,EAAE,CAAC;IACjC,oCAAoC,EAAE,CAAC;IACvC,gDAAgD;IAChD,oBAAoB,EAAE,CAAC;IACvB,kBAAkB,EAAE,EAAE;IACtB,kBAAkB,EAAE,EAAE;IACtB,sBAAsB,EAAE,CAAC,cAAsB,EAAE,EAAE,CAAC,cAAc,GAAG,CAAC;IACtE,gDAAgD;IAChD,cAAc,EAAE,CAAC,CAAC,2BAA2B;CAC9C,CAAC;AAmKA,kEAA2B;AA/J7B,IAAK,YAIJ;AAJD,WAAK,YAAY;IACf,qDAAc,CAAA;IACd,+CAAW,CAAA;IACX,yDAAgB,CAAA;AAClB,CAAC,EAJI,YAAY,KAAZ,YAAY,QAIhB;AA6IC,oCAAY;AA3Id,IAAK,cAKJ;AALD,WAAK,cAAc;IACjB,0DAAc,CAAA;IACd,wDAAa,CAAA;IACb,4DAAe,CAAA;IACf,sEAAoB,CAAA;AACtB,CAAC,EALI,cAAc,KAAd,cAAc,QAKlB;AAuIC,wCAAc;AArIhB,IAAK,UAIJ;AAJD,WAAK,UAAU;IACb,+CAAa,CAAA;IACb,+CAAa,CAAA;IACb,mDAAe,CAAA;AACjB,CAAC,EAJI,UAAU,KAAV,UAAU,QAId;AAkIC,gCAAU;AAhIZ,IAAK,cAUJ;AAVD,WAAK,cAAc;IACjB,yDAAc,CAAA;IACd,yDAAc,CAAA;IACd,+DAAiB,CAAA;IACjB,+EAAyB,CAAA;IACzB,yEAAsB,CAAA;IACtB,6EAAwB,CAAA;IACxB,+DAAiB,CAAA;IACjB,iFAA0B,CAAA;IAC1B,iFAA0B,CAAA;AAC5B,CAAC,EAVI,cAAc,KAAd,cAAc,QAUlB;AAwHC,wCAAc;AAtHhB,IAAK,cAIJ;AAJD,WAAK,cAAc;IACjB,mDAAW,CAAA;IACX,2DAAe,CAAA;IACf,mDAAW,CAAA;AACb,CAAC,EAJI,cAAc,KAAd,cAAc,QAIlB;AAiHC,wCAAc;AA/GhB,IAAK,gBAcJ;AAdD,WAAK,gBAAgB;IACnB,6DAAW,CAAA;IACX,mEAAc,CAAA;IACd,iEAAa,CAAA;IACb,uFAAwB,CAAA;IACxB,+GAAoC,CAAA;IACpC,mFAAsB,CAAA;IACtB,2GAAkC,CAAA;IAClC,mFAAsB,CAAA;IACtB,yFAAyB,CAAA;IACzB,iGAA6B,CAAA;IAC7B,sEAAgB,CAAA;IAChB,wEAAiB,CAAA;IACjB,0DAAU,CAAA;AACZ,CAAC,EAdI,gBAAgB,KAAhB,gBAAgB,QAcpB;AAmGC,4CAAgB"} \ No newline at end of file +{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/common/constants.ts"],"names":[],"mappings":";;;AAIA,MAAM,eAAe,GAAG,KAAK,CAAC;AA6L5B,0CAAe;AAzLjB,kBAAkB;AAClB,MAAM,MAAM,GAAG;IACb,mBAAmB,EAAE,wFAAwF;IAC7G,+BAA+B,EAAE,oGAAoG;IACrI,wBAAwB,EAAE,8FAA8F;IACxH,oCAAoC,EAAE,2CAA2C;IACjF,uCAAuC,EAAE,uFAAuF;IAChI,8BAA8B,EAAE,4CAA4C;IAC5E,gCAAgC,EAAE,8EAA8E;IAChH,sCAAsC,EAAE,2DAA2D;IACnG,gBAAgB,EAAE,mBAAmB;IACrC,YAAY,EAAE,eAAe;IAC7B,uBAAuB,EAAE,4BAA4B;IACrD,aAAa,EAAE,qDAAqD;IACpE,8BAA8B,EAAE,4CAA4C;IAC5E,6BAA6B,EAAE,kCAAkC;IACjE,uCAAuC,EAAE,6CAA6C;IACtF,0CAA0C,EAAE,iDAAiD;IAC7F,qCAAqC,EAAE,oDAAoD;IAC3F,yCAAyC,EAAE,mEAAmE;IAC9G,+CAA+C,EAAE,6EAA6E;IAC9H,4CAA4C,EAAE,yEAAyE;IACvH,0BAA0B,EAAE,8BAA8B;IAC1D,2BAA2B,EAAE,kDAAkD;IAC/E,mCAAmC,EAAE,kCAAkC;IACvE,uCAAuC,EAAE,sDAAsD;IAC/F,0CAA0C,EAAE,iDAAiD;CAC9F,CAAC;AA+JA,wBAAM;AA7JR,MAAM,2BAA2B,GAAG;IAClC,8BAA8B,EAAE,CAAC;IACjC,oCAAoC,EAAE,CAAC;IACvC,gDAAgD;IAChD,oBAAoB,EAAE,CAAC;IACvB,kBAAkB,EAAE,EAAE;IACtB,kBAAkB,EAAE,EAAE;IACtB,sBAAsB,EAAE,CAAC,cAAsB,EAAE,EAAE,CAAC,cAAc,GAAG,CAAC;IACtE,gDAAgD;IAChD,cAAc,EAAE,CAAC;CAClB,CAAC;AAmKA,kEAA2B;AA/J7B,IAAK,YAIJ;AAJD,WAAK,YAAY;IACf,qDAAc,CAAA;IACd,+CAAW,CAAA;IACX,yDAAgB,CAAA;AAClB,CAAC,EAJI,YAAY,KAAZ,YAAY,QAIhB;AA6IC,oCAAY;AA3Id,IAAK,cAKJ;AALD,WAAK,cAAc;IACjB,0DAAc,CAAA;IACd,wDAAa,CAAA;IACb,4DAAe,CAAA;IACf,sEAAoB,CAAA;AACtB,CAAC,EALI,cAAc,KAAd,cAAc,QAKlB;AAuIC,wCAAc;AArIhB,IAAK,UAIJ;AAJD,WAAK,UAAU;IACb,+CAAa,CAAA;IACb,+CAAa,CAAA;IACb,mDAAe,CAAA;AACjB,CAAC,EAJI,UAAU,KAAV,UAAU,QAId;AAkIC,gCAAU;AAhIZ,IAAK,cAUJ;AAVD,WAAK,cAAc;IACjB,yDAAc,CAAA;IACd,yDAAc,CAAA;IACd,+DAAiB,CAAA;IACjB,+EAAyB,CAAA;IACzB,yEAAsB,CAAA;IACtB,6EAAwB,CAAA;IACxB,+DAAiB,CAAA;IACjB,iFAA0B,CAAA;IAC1B,iFAA0B,CAAA;AAC5B,CAAC,EAVI,cAAc,KAAd,cAAc,QAUlB;AAwHC,wCAAc;AAtHhB,IAAK,cAIJ;AAJD,WAAK,cAAc;IACjB,mDAAW,CAAA;IACX,2DAAe,CAAA;IACf,mDAAW,CAAA;AACb,CAAC,EAJI,cAAc,KAAd,cAAc,QAIlB;AAiHC,wCAAc;AA/GhB,IAAK,gBAcJ;AAdD,WAAK,gBAAgB;IACnB,6DAAW,CAAA;IACX,mEAAc,CAAA;IACd,iEAAa,CAAA;IACb,uFAAwB,CAAA;IACxB,+GAAoC,CAAA;IACpC,mFAAsB,CAAA;IACtB,2GAAkC,CAAA;IAClC,mFAAsB,CAAA;IACtB,yFAAyB,CAAA;IACzB,iGAA6B,CAAA;IAC7B,sEAAgB,CAAA;IAChB,wEAAiB,CAAA;IACjB,0DAAU,CAAA;AACZ,CAAC,EAdI,gBAAgB,KAAhB,gBAAgB,QAcpB;AAmGC,4CAAgB"} \ No newline at end of file diff --git a/deps/npm/node_modules/socks/build/common/helpers.js b/deps/npm/node_modules/socks/build/common/helpers.js index 88153aabdd1b2e..5bf4cc47744c5e 100644 --- a/deps/npm/node_modules/socks/build/common/helpers.js +++ b/deps/npm/node_modules/socks/build/common/helpers.js @@ -1,5 +1,6 @@ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); +exports.validateSocksClientChainOptions = exports.validateSocksClientOptions = void 0; const util_1 = require("./util"); const constants_1 = require("./constants"); const stream = require("stream"); diff --git a/deps/npm/node_modules/socks/build/common/helpers.js.map b/deps/npm/node_modules/socks/build/common/helpers.js.map index f02465f135174f..3313a3c0323af1 100644 --- a/deps/npm/node_modules/socks/build/common/helpers.js.map +++ b/deps/npm/node_modules/socks/build/common/helpers.js.map @@ -1 +1 @@ -{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../src/common/helpers.ts"],"names":[],"mappings":";;AAKA,iCAA0C;AAC1C,2CAA+D;AAC/D,iCAAiC;AAEjC;;;;GAIG;AACH,SAAS,0BAA0B,CACjC,OAA2B,EAC3B,gBAAgB,GAAG,CAAC,SAAS,EAAE,MAAM,EAAE,WAAW,CAAC;IAEnD,8BAA8B;IAC9B,IAAI,CAAC,wBAAY,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE;QAClC,MAAM,IAAI,uBAAgB,CAAC,kBAAM,CAAC,mBAAmB,EAAE,OAAO,CAAC,CAAC;KACjE;IAED,6CAA6C;IAC7C,IAAI,gBAAgB,CAAC,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE;QACpD,MAAM,IAAI,uBAAgB,CAAC,kBAAM,CAAC,+BAA+B,EAAE,OAAO,CAAC,CAAC;KAC7E;IAED,oBAAoB;IACpB,IAAI,CAAC,sBAAsB,CAAC,OAAO,CAAC,WAAW,CAAC,EAAE;QAChD,MAAM,IAAI,uBAAgB,CACxB,kBAAM,CAAC,oCAAoC,EAC3C,OAAO,CACR,CAAC;KACH;IAED,2BAA2B;IAC3B,IAAI,CAAC,iBAAiB,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE;QACrC,MAAM,IAAI,uBAAgB,CAAC,kBAAM,CAAC,8BAA8B,EAAE,OAAO,CAAC,CAAC;KAC5E;IAED,gBAAgB;IAChB,IAAI,OAAO,CAAC,OAAO,IAAI,CAAC,mBAAmB,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE;QAC5D,MAAM,IAAI,uBAAgB,CACxB,kBAAM,CAAC,gCAAgC,EACvC,OAAO,CACR,CAAC;KACH;IAED,sCAAsC;IACtC,IACE,OAAO,CAAC,eAAe;QACvB,CAAC,CAAC,OAAO,CAAC,eAAe,YAAY,MAAM,CAAC,MAAM,CAAC,EACnD;QACA,MAAM,IAAI,uBAAgB,CACxB,kBAAM,CAAC,uCAAuC,EAC9C,OAAO,CACR,CAAC;KACH;AACH,CAAC;AA0FQ,gEAA0B;AAxFnC;;;GAGG;AACH,SAAS,+BAA+B,CAAC,OAAgC;IACvE,2CAA2C;IAC3C,IAAI,OAAO,CAAC,OAAO,KAAK,SAAS,EAAE;QACjC,MAAM,IAAI,uBAAgB,CAAC,kBAAM,CAAC,wBAAwB,EAAE,OAAO,CAAC,CAAC;KACtE;IAED,oBAAoB;IACpB,IAAI,CAAC,sBAAsB,CAAC,OAAO,CAAC,WAAW,CAAC,EAAE;QAChD,MAAM,IAAI,uBAAgB,CACxB,kBAAM,CAAC,oCAAoC,EAC3C,OAAO,CACR,CAAC;KACH;IAED,4BAA4B;IAC5B,IACE,CAAC,CACC,OAAO,CAAC,OAAO;QACf,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC;QAC9B,OAAO,CAAC,OAAO,CAAC,MAAM,IAAI,CAAC,CAC5B,EACD;QACA,MAAM,IAAI,uBAAgB,CACxB,kBAAM,CAAC,sCAAsC,EAC7C,OAAO,CACR,CAAC;KACH;IAED,mBAAmB;IACnB,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,KAAiB,EAAE,EAAE;QAC5C,IAAI,CAAC,iBAAiB,CAAC,KAAK,CAAC,EAAE;YAC7B,MAAM,IAAI,uBAAgB,CACxB,kBAAM,CAAC,8BAA8B,EACrC,OAAO,CACR,CAAC;SACH;IACH,CAAC,CAAC,CAAC;IAEH,gBAAgB;IAChB,IAAI,OAAO,CAAC,OAAO,IAAI,CAAC,mBAAmB,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE;QAC5D,MAAM,IAAI,uBAAgB,CACxB,kBAAM,CAAC,gCAAgC,EACvC,OAAO,CACR,CAAC;KACH;AACH,CAAC;AAuCoC,0EAA+B;AArCpE;;;GAGG;AACH,SAAS,sBAAsB,CAAC,UAA2B;IACzD,OAAO,CACL,UAAU;QACV,OAAO,UAAU,CAAC,IAAI,KAAK,QAAQ;QACnC,OAAO,UAAU,CAAC,IAAI,KAAK,QAAQ;QACnC,UAAU,CAAC,IAAI,IAAI,CAAC;QACpB,UAAU,CAAC,IAAI,IAAI,KAAK,CACzB,CAAC;AACJ,CAAC;AAED;;;GAGG;AACH,SAAS,iBAAiB,CAAC,KAAiB;IAC1C,OAAO,CACL,KAAK;QACL,CAAC,OAAO,KAAK,CAAC,IAAI,KAAK,QAAQ,IAAI,OAAO,KAAK,CAAC,SAAS,KAAK,QAAQ,CAAC;QACvE,OAAO,KAAK,CAAC,IAAI,KAAK,QAAQ;QAC9B,KAAK,CAAC,IAAI,IAAI,CAAC;QACf,KAAK,CAAC,IAAI,IAAI,KAAK;QACnB,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,IAAI,KAAK,CAAC,IAAI,KAAK,CAAC,CAAC,CACvC,CAAC;AACJ,CAAC;AAED;;;GAGG;AACH,SAAS,mBAAmB,CAAC,KAAa;IACxC,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,GAAG,CAAC,CAAC;AAChD,CAAC"} \ No newline at end of file +{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../src/common/helpers.ts"],"names":[],"mappings":";;;AAKA,iCAAwC;AACxC,2CAA6D;AAC7D,iCAAiC;AAEjC;;;;GAIG;AACH,SAAS,0BAA0B,CACjC,OAA2B,EAC3B,gBAAgB,GAAG,CAAC,SAAS,EAAE,MAAM,EAAE,WAAW,CAAC;IAEnD,8BAA8B;IAC9B,IAAI,CAAC,wBAAY,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE;QAClC,MAAM,IAAI,uBAAgB,CAAC,kBAAM,CAAC,mBAAmB,EAAE,OAAO,CAAC,CAAC;KACjE;IAED,6CAA6C;IAC7C,IAAI,gBAAgB,CAAC,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE;QACpD,MAAM,IAAI,uBAAgB,CAAC,kBAAM,CAAC,+BAA+B,EAAE,OAAO,CAAC,CAAC;KAC7E;IAED,oBAAoB;IACpB,IAAI,CAAC,sBAAsB,CAAC,OAAO,CAAC,WAAW,CAAC,EAAE;QAChD,MAAM,IAAI,uBAAgB,CACxB,kBAAM,CAAC,oCAAoC,EAC3C,OAAO,CACR,CAAC;KACH;IAED,2BAA2B;IAC3B,IAAI,CAAC,iBAAiB,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE;QACrC,MAAM,IAAI,uBAAgB,CAAC,kBAAM,CAAC,8BAA8B,EAAE,OAAO,CAAC,CAAC;KAC5E;IAED,gBAAgB;IAChB,IAAI,OAAO,CAAC,OAAO,IAAI,CAAC,mBAAmB,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE;QAC5D,MAAM,IAAI,uBAAgB,CACxB,kBAAM,CAAC,gCAAgC,EACvC,OAAO,CACR,CAAC;KACH;IAED,sCAAsC;IACtC,IACE,OAAO,CAAC,eAAe;QACvB,CAAC,CAAC,OAAO,CAAC,eAAe,YAAY,MAAM,CAAC,MAAM,CAAC,EACnD;QACA,MAAM,IAAI,uBAAgB,CACxB,kBAAM,CAAC,uCAAuC,EAC9C,OAAO,CACR,CAAC;KACH;AACH,CAAC;AA0FO,gEAA0B;AAxFlC;;;GAGG;AACH,SAAS,+BAA+B,CAAC,OAAgC;IACvE,2CAA2C;IAC3C,IAAI,OAAO,CAAC,OAAO,KAAK,SAAS,EAAE;QACjC,MAAM,IAAI,uBAAgB,CAAC,kBAAM,CAAC,wBAAwB,EAAE,OAAO,CAAC,CAAC;KACtE;IAED,oBAAoB;IACpB,IAAI,CAAC,sBAAsB,CAAC,OAAO,CAAC,WAAW,CAAC,EAAE;QAChD,MAAM,IAAI,uBAAgB,CACxB,kBAAM,CAAC,oCAAoC,EAC3C,OAAO,CACR,CAAC;KACH;IAED,4BAA4B;IAC5B,IACE,CAAC,CACC,OAAO,CAAC,OAAO;QACf,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC;QAC9B,OAAO,CAAC,OAAO,CAAC,MAAM,IAAI,CAAC,CAC5B,EACD;QACA,MAAM,IAAI,uBAAgB,CACxB,kBAAM,CAAC,sCAAsC,EAC7C,OAAO,CACR,CAAC;KACH;IAED,mBAAmB;IACnB,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,KAAiB,EAAE,EAAE;QAC5C,IAAI,CAAC,iBAAiB,CAAC,KAAK,CAAC,EAAE;YAC7B,MAAM,IAAI,uBAAgB,CACxB,kBAAM,CAAC,8BAA8B,EACrC,OAAO,CACR,CAAC;SACH;IACH,CAAC,CAAC,CAAC;IAEH,gBAAgB;IAChB,IAAI,OAAO,CAAC,OAAO,IAAI,CAAC,mBAAmB,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE;QAC5D,MAAM,IAAI,uBAAgB,CACxB,kBAAM,CAAC,gCAAgC,EACvC,OAAO,CACR,CAAC;KACH;AACH,CAAC;AAuCmC,0EAA+B;AArCnE;;;GAGG;AACH,SAAS,sBAAsB,CAAC,UAA2B;IACzD,OAAO,CACL,UAAU;QACV,OAAO,UAAU,CAAC,IAAI,KAAK,QAAQ;QACnC,OAAO,UAAU,CAAC,IAAI,KAAK,QAAQ;QACnC,UAAU,CAAC,IAAI,IAAI,CAAC;QACpB,UAAU,CAAC,IAAI,IAAI,KAAK,CACzB,CAAC;AACJ,CAAC;AAED;;;GAGG;AACH,SAAS,iBAAiB,CAAC,KAAiB;IAC1C,OAAO,CACL,KAAK;QACL,CAAC,OAAO,KAAK,CAAC,IAAI,KAAK,QAAQ,IAAI,OAAO,KAAK,CAAC,SAAS,KAAK,QAAQ,CAAC;QACvE,OAAO,KAAK,CAAC,IAAI,KAAK,QAAQ;QAC9B,KAAK,CAAC,IAAI,IAAI,CAAC;QACf,KAAK,CAAC,IAAI,IAAI,KAAK;QACnB,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,IAAI,KAAK,CAAC,IAAI,KAAK,CAAC,CAAC,CACvC,CAAC;AACJ,CAAC;AAED;;;GAGG;AACH,SAAS,mBAAmB,CAAC,KAAa;IACxC,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,GAAG,CAAC,CAAC;AAChD,CAAC"} \ No newline at end of file diff --git a/deps/npm/node_modules/socks/build/common/receivebuffer.js b/deps/npm/node_modules/socks/build/common/receivebuffer.js index 180fa749d0c429..3dacbf9b95139f 100644 --- a/deps/npm/node_modules/socks/build/common/receivebuffer.js +++ b/deps/npm/node_modules/socks/build/common/receivebuffer.js @@ -1,40 +1,41 @@ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); +exports.ReceiveBuffer = void 0; class ReceiveBuffer { constructor(size = 4096) { - this._buffer = Buffer.allocUnsafe(size); - this._offset = 0; - this._originalSize = size; + this.buffer = Buffer.allocUnsafe(size); + this.offset = 0; + this.originalSize = size; } get length() { - return this._offset; + return this.offset; } append(data) { if (!Buffer.isBuffer(data)) { throw new Error('Attempted to append a non-buffer instance to ReceiveBuffer.'); } - if (this._offset + data.length >= this._buffer.length) { - const tmp = this._buffer; - this._buffer = Buffer.allocUnsafe(Math.max(this._buffer.length + this._originalSize, this._buffer.length + data.length)); - tmp.copy(this._buffer); + if (this.offset + data.length >= this.buffer.length) { + const tmp = this.buffer; + this.buffer = Buffer.allocUnsafe(Math.max(this.buffer.length + this.originalSize, this.buffer.length + data.length)); + tmp.copy(this.buffer); } - data.copy(this._buffer, this._offset); - return (this._offset += data.length); + data.copy(this.buffer, this.offset); + return (this.offset += data.length); } peek(length) { - if (length > this._offset) { + if (length > this.offset) { throw new Error('Attempted to read beyond the bounds of the managed internal data.'); } - return this._buffer.slice(0, length); + return this.buffer.slice(0, length); } get(length) { - if (length > this._offset) { + if (length > this.offset) { throw new Error('Attempted to read beyond the bounds of the managed internal data.'); } const value = Buffer.allocUnsafe(length); - this._buffer.slice(0, length).copy(value); - this._buffer.copyWithin(0, length, length + this._offset - length); - this._offset -= length; + this.buffer.slice(0, length).copy(value); + this.buffer.copyWithin(0, length, length + this.offset - length); + this.offset -= length; return value; } } diff --git a/deps/npm/node_modules/socks/build/common/receivebuffer.js.map b/deps/npm/node_modules/socks/build/common/receivebuffer.js.map index ed6ab3ac919d49..144edb0b9b336c 100644 --- a/deps/npm/node_modules/socks/build/common/receivebuffer.js.map +++ b/deps/npm/node_modules/socks/build/common/receivebuffer.js.map @@ -1 +1 @@ -{"version":3,"file":"receivebuffer.js","sourceRoot":"","sources":["../../src/common/receivebuffer.ts"],"names":[],"mappings":";;AAAA,MAAM,aAAa;IAKjB,YAAY,OAAe,IAAI;QAC7B,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;QACxC,IAAI,CAAC,OAAO,GAAG,CAAC,CAAC;QACjB,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC;IAC5B,CAAC;IAED,IAAI,MAAM;QACR,OAAO,IAAI,CAAC,OAAO,CAAC;IACtB,CAAC;IAED,MAAM,CAAC,IAAY;QACjB,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE;YAC1B,MAAM,IAAI,KAAK,CACb,6DAA6D,CAC9D,CAAC;SACH;QAED,IAAI,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE;YACrD,MAAM,GAAG,GAAG,IAAI,CAAC,OAAO,CAAC;YACzB,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC,WAAW,CAC/B,IAAI,CAAC,GAAG,CACN,IAAI,CAAC,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,aAAa,EACxC,IAAI,CAAC,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,CAClC,CACF,CAAC;YACF,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;SACxB;QAED,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;QACtC,OAAO,CAAC,IAAI,CAAC,OAAO,IAAI,IAAI,CAAC,MAAM,CAAC,CAAC;IACvC,CAAC;IAED,IAAI,CAAC,MAAc;QACjB,IAAI,MAAM,GAAG,IAAI,CAAC,OAAO,EAAE;YACzB,MAAM,IAAI,KAAK,CACb,mEAAmE,CACpE,CAAC;SACH;QACD,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC;IACvC,CAAC;IAED,GAAG,CAAC,MAAc;QAChB,IAAI,MAAM,GAAG,IAAI,CAAC,OAAO,EAAE;YACzB,MAAM,IAAI,KAAK,CACb,mEAAmE,CACpE,CAAC;SACH;QAED,MAAM,KAAK,GAAG,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;QACzC,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QAC1C,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC,CAAC;QACnE,IAAI,CAAC,OAAO,IAAI,MAAM,CAAC;QAEvB,OAAO,KAAK,CAAC;IACf,CAAC;CACF;AAEQ,sCAAa"} \ No newline at end of file +{"version":3,"file":"receivebuffer.js","sourceRoot":"","sources":["../../src/common/receivebuffer.ts"],"names":[],"mappings":";;;AAAA,MAAM,aAAa;IAKjB,YAAY,OAAe,IAAI;QAC7B,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;QACvC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC;QAChB,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC;IAC3B,CAAC;IAED,IAAI,MAAM;QACR,OAAO,IAAI,CAAC,MAAM,CAAC;IACrB,CAAC;IAED,MAAM,CAAC,IAAY;QACjB,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE;YAC1B,MAAM,IAAI,KAAK,CACb,6DAA6D,CAC9D,CAAC;SACH;QAED,IAAI,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE;YACnD,MAAM,GAAG,GAAG,IAAI,CAAC,MAAM,CAAC;YACxB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC,WAAW,CAC9B,IAAI,CAAC,GAAG,CACN,IAAI,CAAC,MAAM,CAAC,MAAM,GAAG,IAAI,CAAC,YAAY,EACtC,IAAI,CAAC,MAAM,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,CACjC,CACF,CAAC;YACF,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;SACvB;QAED,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;QACpC,OAAO,CAAC,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,MAAM,CAAC,CAAC;IACtC,CAAC;IAED,IAAI,CAAC,MAAc;QACjB,IAAI,MAAM,GAAG,IAAI,CAAC,MAAM,EAAE;YACxB,MAAM,IAAI,KAAK,CACb,mEAAmE,CACpE,CAAC;SACH;QACD,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC;IACtC,CAAC;IAED,GAAG,CAAC,MAAc;QAChB,IAAI,MAAM,GAAG,IAAI,CAAC,MAAM,EAAE;YACxB,MAAM,IAAI,KAAK,CACb,mEAAmE,CACpE,CAAC;SACH;QAED,MAAM,KAAK,GAAG,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;QACzC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACzC,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC,CAAC;QACjE,IAAI,CAAC,MAAM,IAAI,MAAM,CAAC;QAEtB,OAAO,KAAK,CAAC;IACf,CAAC;CACF;AAEO,sCAAa"} \ No newline at end of file diff --git a/deps/npm/node_modules/socks/build/common/util.js b/deps/npm/node_modules/socks/build/common/util.js index 347d9292fd1ec2..283314a0d4456e 100644 --- a/deps/npm/node_modules/socks/build/common/util.js +++ b/deps/npm/node_modules/socks/build/common/util.js @@ -1,5 +1,6 @@ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); +exports.shuffleArray = exports.SocksClientError = void 0; /** * Error wrapper for SocksClient */ @@ -15,8 +16,9 @@ exports.SocksClientError = SocksClientError; * @param array The array to shuffle. */ function shuffleArray(array) { + // tslint:disable-next-line:no-increment-decrement for (let i = array.length - 1; i > 0; i--) { - let j = Math.floor(Math.random() * (i + 1)); + const j = Math.floor(Math.random() * (i + 1)); [array[i], array[j]] = [array[j], array[i]]; } } diff --git a/deps/npm/node_modules/socks/build/common/util.js.map b/deps/npm/node_modules/socks/build/common/util.js.map index 40f971c60aefdd..8d94a2ace787af 100644 --- a/deps/npm/node_modules/socks/build/common/util.js.map +++ b/deps/npm/node_modules/socks/build/common/util.js.map @@ -1 +1 @@ -{"version":3,"file":"util.js","sourceRoot":"","sources":["../../src/common/util.ts"],"names":[],"mappings":";;AAEA;;GAEG;AACH,MAAM,gBAAiB,SAAQ,KAAK;IAClC,YACE,OAAe,EACR,OAAqD;QAE5D,KAAK,CAAC,OAAO,CAAC,CAAC;QAFR,YAAO,GAAP,OAAO,CAA8C;IAG9D,CAAC;CACF;AAuBwB,4CAAgB;AArBzC;;;GAGG;AACH,SAAS,YAAY,CAAC,KAAY;IAChC,KAAK,IAAI,CAAC,GAAG,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;QACzC,IAAI,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;QAC5C,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;KAC7C;AACH,CAAC;AAY0C,oCAAY"} \ No newline at end of file +{"version":3,"file":"util.js","sourceRoot":"","sources":["../../src/common/util.ts"],"names":[],"mappings":";;;AAEA;;GAEG;AACH,MAAM,gBAAiB,SAAQ,KAAK;IAClC,YACE,OAAe,EACR,OAAqD;QAE5D,KAAK,CAAC,OAAO,CAAC,CAAC;QAFR,YAAO,GAAP,OAAO,CAA8C;IAG9D,CAAC;CACF;AAwBuB,4CAAgB;AAtBxC;;;GAGG;AACH,SAAS,YAAY,CAAC,KAAY;IAChC,kDAAkD;IAClD,KAAK,IAAI,CAAC,GAAG,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;QACzC,MAAM,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;QAC9C,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;KAC7C;AACH,CAAC;AAYyC,oCAAY"} \ No newline at end of file diff --git a/deps/npm/node_modules/socks/build/index.js b/deps/npm/node_modules/socks/build/index.js index e017b095df028c..17b6f42df8e5bb 100644 --- a/deps/npm/node_modules/socks/build/index.js +++ b/deps/npm/node_modules/socks/build/index.js @@ -1,7 +1,14 @@ "use strict"; -function __export(m) { - for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; -} +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; Object.defineProperty(exports, "__esModule", { value: true }); -__export(require("./client/socksclient")); +__exportStar(require("./client/socksclient"), exports); //# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/deps/npm/node_modules/socks/build/index.js.map b/deps/npm/node_modules/socks/build/index.js.map index 435a746473cf02..ff654a08e01b32 100644 --- a/deps/npm/node_modules/socks/build/index.js.map +++ b/deps/npm/node_modules/socks/build/index.js.map @@ -1 +1 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;AAAA,0CAAqC"} \ No newline at end of file +{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,uDAAqC"} \ No newline at end of file diff --git a/deps/npm/node_modules/socks/package.json b/deps/npm/node_modules/socks/package.json index 1dc66256633ff5..dc69653e21a761 100644 --- a/deps/npm/node_modules/socks/package.json +++ b/deps/npm/node_modules/socks/package.json @@ -1,65 +1,18 @@ { - "_from": "socks@~2.3.2", - "_id": "socks@2.3.3", - "_inBundle": false, - "_integrity": "sha512-o5t52PCNtVdiOvzMry7wU4aOqYWL0PeCXRWBEiJow4/i/wr+wpsJQ9awEu1EonLIqsfGd5qSgDdxEOvCdmBEpA==", - "_location": "/socks", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "socks@~2.3.2", - "name": "socks", - "escapedName": "socks", - "rawSpec": "~2.3.2", - "saveSpec": null, - "fetchSpec": "~2.3.2" - }, - "_requiredBy": [ - "/socks-proxy-agent" - ], - "_resolved": "https://registry.npmjs.org/socks/-/socks-2.3.3.tgz", - "_shasum": "01129f0a5d534d2b897712ed8aceab7ee65d78e3", - "_spec": "socks@~2.3.2", - "_where": "/Users/claudiahdz/npm/cli/node_modules/socks-proxy-agent", - "author": { - "name": "Josh Glazebrook" + "name": "socks", + "private": false, + "version": "2.4.4", + "description": "Fully featured SOCKS proxy client supporting SOCKSv4, SOCKSv4a, and SOCKSv5. Includes Bind and Associate functionality.", + "main": "build/index.js", + "typings": "typings", + "homepage": "https://github.com/JoshGlazebrook/socks/", + "repository": { + "type": "git", + "url": "https://github.com/JoshGlazebrook/socks.git" }, "bugs": { "url": "https://github.com/JoshGlazebrook/socks/issues" }, - "bundleDependencies": false, - "contributors": [ - { - "name": "castorw" - } - ], - "dependencies": { - "ip": "1.1.5", - "smart-buffer": "^4.1.0" - }, - "deprecated": false, - "description": "Fully featured SOCKS proxy client supporting SOCKSv4, SOCKSv4a, and SOCKSv5. Includes Bind and Associate functionality.", - "devDependencies": { - "@types/chai": "4.2.4", - "@types/ip": "1.1.0", - "@types/mocha": "5.2.7", - "@types/node": "12.12.6", - "chai": "^4.1.2", - "coveralls": "^3.0.0", - "mocha": "6.2.2", - "nyc": "14.1.1", - "prettier": "^1.9.2", - "socks5-server": "^0.1.1", - "ts-node": "8.4.1", - "tslint": "^5.8.0", - "typescript": "3.7.2" - }, - "engines": { - "node": ">= 6.0.0", - "npm": ">= 3.0.0" - }, - "homepage": "https://github.com/JoshGlazebrook/socks/", "keywords": [ "socks", "proxy", @@ -69,9 +22,45 @@ "socks4", "socks5" ], + "engines": { + "node": ">= 10.13.0", + "npm": ">= 3.0.0" + }, + "author": "Josh Glazebrook", + "contributors": [ + "castorw" + ], "license": "MIT", - "main": "build/index.js", - "name": "socks", + "readmeFilename": "README.md", + "devDependencies": { + "@types/chai": "^4.2.12", + "@types/ip": "1.1.0", + "@types/mocha": "^8.0.3", + "@types/node": "^14.6.2", + "chai": "^4.1.2", + "coveralls": "3.1.0", + "mocha": "^8.1.3", + "nyc": "15.1.0", + "prettier": "^2.1.1", + "socks5-server": "^0.1.1", + "ts-node": "^9.0.0", + "tslint": "^6.1.3", + "tslint-config-airbnb": "^5.11.2", + "typescript": "^4.0.2" + }, + "dependencies": { + "ip": "^1.1.5", + "smart-buffer": "^4.1.0" + }, + "scripts": { + "prepublish": "npm install -g typescript && npm run build", + "test": "NODE_ENV=test mocha --recursive --require ts-node/register test/**/*.ts", + "prettier": "prettier --write ./src/**/*.ts --config .prettierrc.yaml", + "coverage": "NODE_ENV=test nyc npm test", + "coveralls": "NODE_ENV=test nyc npm test && nyc report --reporter=text-lcov | coveralls", + "lint": "tslint --project tsconfig.json 'src/**/*.ts'", + "build": "tslint --project tsconfig.json && prettier --write ./src/**/*.ts --config .prettierrc.yaml && tsc -p ." + }, "nyc": { "extension": [ ".ts", @@ -94,20 +83,5 @@ "html" ], "all": true - }, - "private": false, - "repository": { - "type": "git", - "url": "git+https://github.com/JoshGlazebrook/socks.git" - }, - "scripts": { - "build": "tslint --project tsconfig.json && prettier --write ./src/**/*.ts --config .prettierrc.yaml && tsc -p .", - "coverage": "NODE_ENV=test nyc npm test", - "coveralls": "NODE_ENV=test nyc npm test && nyc report --reporter=text-lcov | coveralls", - "lint": "tslint --project tsconfig.json 'src/**/*.ts'", - "prepublish": "npm install -g typescript && npm run build", - "test": "NODE_ENV=test mocha --recursive --require ts-node/register test/**/*.ts" - }, - "typings": "typings", - "version": "2.3.3" + } } diff --git a/deps/npm/node_modules/socks/typings/client/socksclient.d.ts b/deps/npm/node_modules/socks/typings/client/socksclient.d.ts index bd0b6ff4d2d604..ff762a8a663f3a 100644 --- a/deps/npm/node_modules/socks/typings/client/socksclient.d.ts +++ b/deps/npm/node_modules/socks/typings/client/socksclient.d.ts @@ -17,15 +17,15 @@ declare interface SocksClient { emit(event: 'established', info: SocksClientEstablishedEvent): boolean; } declare class SocksClient extends EventEmitter implements SocksClient { - private _options; - private _socket; - private _state; - private _receiveBuffer; - private _nextRequiredPacketBufferSize; - private _onDataReceived; - private _onClose; - private _onError; - private _onConnect; + private options; + private socket; + private state; + private receiveBuffer; + private nextRequiredPacketBufferSize; + private onDataReceived; + private onClose; + private onError; + private onConnect; constructor(options: SocksClientOptions); /** * Creates a new SOCKS connection. @@ -56,19 +56,15 @@ declare class SocksClient extends EventEmitter implements SocksClient { * @param data */ static parseUDPFrame(data: Buffer): SocksUDPFrameDetails; - /** - * Gets the SocksClient internal state. - */ - private get state(); /** * Internal state setter. If the SocksClient is in an error state, it cannot be changed to a non error state. */ - private set state(value); + private setState; /** * Starts the connection establishment to the proxy and destination. - * @param existing_socket Connected socket to use instead of creating a new one (internal use). + * @param existingSocket Connected socket to use instead of creating a new one (internal use). */ - connect(existing_socket?: Duplex): void; + connect(existingSocket?: Duplex): void; private getSocketOptions; /** * Handles internal Socks timeout callback. @@ -78,12 +74,12 @@ declare class SocksClient extends EventEmitter implements SocksClient { /** * Handles Socket connect event. */ - private onConnect; + private onConnectHandler; /** * Handles Socket data event. * @param data */ - private onDataReceived; + private onDataReceivedHandler; /** * Handles processing of the data we have received. */ @@ -92,12 +88,12 @@ declare class SocksClient extends EventEmitter implements SocksClient { * Handles Socket close event. * @param had_error */ - private onClose; + private onCloseHandler; /** * Handles Socket error event. * @param err */ - private onError; + private onErrorHandler; /** * Removes internal event listeners on the underlying Socket. */ @@ -106,7 +102,7 @@ declare class SocksClient extends EventEmitter implements SocksClient { * Closes and destroys the underlying Socket. Emits an error event. * @param err { String } An error string to include in error event. */ - private _closeSocket; + private closeSocket; /** * Sends initial Socks v4 handshake request. */ @@ -156,4 +152,4 @@ declare class SocksClient extends EventEmitter implements SocksClient { private handleSocks5IncomingConnectionResponse; get socksClientOptions(): SocksClientOptions; } -export { SocksClient, SocksClientOptions, SocksClientChainOptions, SocksRemoteHost, SocksProxy, SocksUDPFrameDetails }; +export { SocksClient, SocksClientOptions, SocksClientChainOptions, SocksClientError, SocksRemoteHost, SocksProxy, SocksUDPFrameDetails, }; diff --git a/deps/npm/node_modules/socks/typings/common/constants.d.ts b/deps/npm/node_modules/socks/typings/common/constants.d.ts index 546fe3cfd967bc..b801c1e0607e9e 100644 --- a/deps/npm/node_modules/socks/typings/common/constants.d.ts +++ b/deps/npm/node_modules/socks/typings/common/constants.d.ts @@ -138,4 +138,4 @@ interface SocksUDPFrameDetails { remoteHost: SocksRemoteHost; data: Buffer; } -export { DEFAULT_TIMEOUT, ERRORS, SocksProxyType, SocksCommand, Socks4Response, Socks5Auth, Socks5HostType, Socks5Response, SocksClientState, SocksProxy, SocksRemoteHost, SocksCommandOption, SocksClientOptions, SocksClientChainOptions, SocksClientEstablishedEvent, SocksClientBoundEvent, SocksUDPFrameDetails, SOCKS_INCOMING_PACKET_SIZES }; +export { DEFAULT_TIMEOUT, ERRORS, SocksProxyType, SocksCommand, Socks4Response, Socks5Auth, Socks5HostType, Socks5Response, SocksClientState, SocksProxy, SocksRemoteHost, SocksCommandOption, SocksClientOptions, SocksClientChainOptions, SocksClientEstablishedEvent, SocksClientBoundEvent, SocksUDPFrameDetails, SOCKS_INCOMING_PACKET_SIZES, }; diff --git a/deps/npm/node_modules/socks/typings/common/receiveBuffer.d.ts b/deps/npm/node_modules/socks/typings/common/receiveBuffer.d.ts index 7af56db12198f3..756e98b5893ed8 100644 --- a/deps/npm/node_modules/socks/typings/common/receiveBuffer.d.ts +++ b/deps/npm/node_modules/socks/typings/common/receiveBuffer.d.ts @@ -1,8 +1,8 @@ /// declare class ReceiveBuffer { - private _buffer; - private _offset; - private _originalSize; + private buffer; + private offset; + private originalSize; constructor(size?: number); get length(): number; append(data: Buffer): number; diff --git a/deps/npm/node_modules/sorted-object/package.json b/deps/npm/node_modules/sorted-object/package.json index 8feacaa3f91a4b..2e81f36d6efc75 100644 --- a/deps/npm/node_modules/sorted-object/package.json +++ b/deps/npm/node_modules/sorted-object/package.json @@ -1,64 +1,25 @@ { - "_args": [ - [ - "sorted-object@2.0.1", - "/Users/rebecca/code/npm" - ] - ], - "_from": "sorted-object@2.0.1", - "_id": "sorted-object@2.0.1", - "_inBundle": false, - "_integrity": "sha1-fWMfS9OnmKJK8d/8+/6DM3pd9fw=", - "_location": "/sorted-object", - "_phantomChildren": {}, - "_requested": { - "type": "version", - "registry": true, - "raw": "sorted-object@2.0.1", - "name": "sorted-object", - "escapedName": "sorted-object", - "rawSpec": "2.0.1", - "saveSpec": null, - "fetchSpec": "2.0.1" - }, - "_requiredBy": [ - "/" - ], - "_resolved": "https://registry.npmjs.org/sorted-object/-/sorted-object-2.0.1.tgz", - "_spec": "2.0.1", - "_where": "/Users/rebecca/code/npm", - "author": { - "name": "Domenic Denicola", - "email": "d@domenic.me", - "url": "https://domenic.me/" - }, - "bugs": { - "url": "https://github.com/domenic/sorted-object/issues" - }, + "name": "sorted-object", "description": "Returns a copy of an object with its keys sorted", - "devDependencies": { - "eslint": "^2.4.0", - "tape": "^4.5.1" - }, - "files": [ - "lib/" - ], - "homepage": "https://github.com/domenic/sorted-object#readme", "keywords": [ "sort", "keys", "object" ], + "version": "2.0.1", + "author": "Domenic Denicola (https://domenic.me/)", "license": "(WTFPL OR MIT)", + "repository": "domenic/sorted-object", "main": "lib/sorted-object.js", - "name": "sorted-object", - "repository": { - "type": "git", - "url": "git+https://github.com/domenic/sorted-object.git" - }, + "files": [ + "lib/" + ], "scripts": { - "lint": "eslint .", - "test": "tape test/tests.js" + "test": "tape test/tests.js", + "lint": "eslint ." }, - "version": "2.0.1" + "devDependencies": { + "eslint": "^2.4.0", + "tape": "^4.5.1" + } } diff --git a/deps/npm/node_modules/sorted-union-stream/.npmignore b/deps/npm/node_modules/sorted-union-stream/.npmignore deleted file mode 100644 index 3c3629e647f5dd..00000000000000 --- a/deps/npm/node_modules/sorted-union-stream/.npmignore +++ /dev/null @@ -1 +0,0 @@ -node_modules diff --git a/deps/npm/node_modules/sorted-union-stream/.travis.yml b/deps/npm/node_modules/sorted-union-stream/.travis.yml deleted file mode 100644 index 17f94330e70bc8..00000000000000 --- a/deps/npm/node_modules/sorted-union-stream/.travis.yml +++ /dev/null @@ -1,5 +0,0 @@ -language: node_js -node_js: - - "0.10" - -script: "npm test" diff --git a/deps/npm/node_modules/sorted-union-stream/LICENSE b/deps/npm/node_modules/sorted-union-stream/LICENSE deleted file mode 100644 index 757562ec59276b..00000000000000 --- a/deps/npm/node_modules/sorted-union-stream/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2014 Mathias Buus - -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/deps/npm/node_modules/sorted-union-stream/README.md b/deps/npm/node_modules/sorted-union-stream/README.md deleted file mode 100644 index bb2959b0de697d..00000000000000 --- a/deps/npm/node_modules/sorted-union-stream/README.md +++ /dev/null @@ -1,80 +0,0 @@ -# sorted-union-stream - -Get the union of two sorted streams - -``` -npm install sorted-union-stream -``` - -[![build status](https://secure.travis-ci.org/mafintosh/sorted-union-stream.png)](http://travis-ci.org/mafintosh/sorted-union-stream) - -## Usage - -``` js -var union = require('sorted-union-stream') -var from = require('from2-array') - -// es.readArray converts an array into a stream -var sorted1 = from.obj([1,10,24,42,43,50,55]) -var sorted2 = from.obj([10,42,53,55,60]) - -// combine the two streams into a single sorted stream -var u = union(sorted1, sorted2) - -u.on('data', function(data) { - console.log(data) -}) -u.on('end', function() { - console.log('no more data') -}) -``` - -Running the above example will print - -``` -1 -10 -24 -42 -43 -50 -53 -55 -60 -no more data -``` - -## Streaming objects - -If you are streaming objects sorting is based on `.key`. - -If this property is not present you should add a `toKey` function as the third parameter. -`toKey` should return an key representation of the data that can be used to compare objects. - -_The keys MUST be sorted_ - -``` js -var sorted1 = from.obj([{foo:'a'}, {foo:'b'}, {foo:'c'}]) -var sorted2 = from.obj([{foo:'b'}, {foo:'d'}]) - -var u = union(sorted1, sorted2, function(data) { - return data.foo // the foo property is sorted -}) - -union.on('data', function(data) { - console.log(data) -}); -``` - -Running the above will print - -``` -{foo:'a'} -{foo:'b'} -{foo:'c'} -{foo:'d'} -``` - -## License - -MIT diff --git a/deps/npm/node_modules/sorted-union-stream/example.js b/deps/npm/node_modules/sorted-union-stream/example.js deleted file mode 100644 index 846d2b110301e1..00000000000000 --- a/deps/npm/node_modules/sorted-union-stream/example.js +++ /dev/null @@ -1,15 +0,0 @@ -var union = require('./') -var from = require('from2') - -var sorted1 = from.obj([{key: 'a'}, {key: 'b'}, {key: 'c'}]) -var sorted2 = from.obj([{key: 'b'}, {key: 'd'}]) - -var u = union(sorted1, sorted2) - -u.on('data', function (data) { - console.log(data) -}) - -u.on('end', function () { - console.log('no more data') -}) diff --git a/deps/npm/node_modules/sorted-union-stream/index.js b/deps/npm/node_modules/sorted-union-stream/index.js deleted file mode 100644 index 8c73c57d697bfe..00000000000000 --- a/deps/npm/node_modules/sorted-union-stream/index.js +++ /dev/null @@ -1,59 +0,0 @@ -var iterate = require('stream-iterate') -var from = require('from2') - -var defaultKey = function (val) { - return val.key || val -} - -var union = function (streamA, streamB, toKey) { - var readA = iterate(streamA) - var readB = iterate(streamB) - - if (!toKey) toKey = defaultKey - - var stream = from.obj(function loop (size, cb) { - readA(function (err, dataA, nextA) { - if (err) return cb(err) - readB(function (err, dataB, nextB) { - if (err) return cb(err) - - if (!dataA && !dataB) return cb(null, null) - - if (!dataA) { - nextB() - return cb(null, dataB) - } - - if (!dataB) { - nextA() - return cb(null, dataA) - } - - var keyA = toKey(dataA) - var keyB = toKey(dataB) - - if (keyA === keyB) { - nextB() - return loop(size, cb) - } - - if (keyA < keyB) { - nextA() - return cb(null, dataA) - } - - nextB() - cb(null, dataB) - }) - }) - }) - - stream.on('close', function () { - if (streamA.destroy) streamA.destroy() - if (streamB.destroy) streamB.destroy() - }) - - return stream -} - -module.exports = union diff --git a/deps/npm/node_modules/sorted-union-stream/node_modules/from2/LICENSE.md b/deps/npm/node_modules/sorted-union-stream/node_modules/from2/LICENSE.md deleted file mode 100644 index 146cb32a7ded92..00000000000000 --- a/deps/npm/node_modules/sorted-union-stream/node_modules/from2/LICENSE.md +++ /dev/null @@ -1,21 +0,0 @@ -## The MIT License (MIT) ## - -Copyright (c) 2014 Hugh Kennedy - -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/sorted-union-stream/node_modules/from2/README.md b/deps/npm/node_modules/sorted-union-stream/node_modules/from2/README.md deleted file mode 100644 index a890140bb1ce62..00000000000000 --- a/deps/npm/node_modules/sorted-union-stream/node_modules/from2/README.md +++ /dev/null @@ -1,67 +0,0 @@ -# from2 [![Flattr this!](https://api.flattr.com/button/flattr-badge-large.png)](https://flattr.com/submit/auto?user_id=hughskennedy&url=http://github.com/hughsk/from2&title=from2&description=hughsk/from2%20on%20GitHub&language=en_GB&tags=flattr,github,javascript&category=software)[![experimental](http://hughsk.github.io/stability-badges/dist/experimental.svg)](http://github.com/hughsk/stability-badges) # - -`from2` is a high-level module for creating readable streams that properly handle backpressure. - -Convience wrapper for -[readable-stream](http://github.com/isaacs/readable-stream)'s `ReadableStream` -base class, with an API lifted from -[from](http://github.com/dominictarr/from) and -[through2](http://github.com/rvagg/through2). - -## Usage ## - -[![from2](https://nodei.co/npm/from2.png?mini=true)](https://nodei.co/npm/from2) - -### `stream = from2([opts], read)` ### - -Where `opts` are the options to pass on to the `ReadableStream` constructor, -and `read(size, next)` is called when data is requested from the stream. - -* `size` is the recommended amount of data (in bytes) to retrieve. -* `next(err)` should be called when you're ready to emit more data. - -For example, here's a readable stream that emits the contents of a given -string: - -``` javascript -var from = require('from2') - -module.exports = fromString - -function fromString(string) { - return from(function(size, next) { - // if there's no more content - // left in the string, close the stream. - if (string.length <= 0) return this.push(null) - - // Pull in a new chunk of text, - // removing it from the string. - var chunk = string.slice(0, size) - string = string.slice(size) - - // Emit "chunk" from the stream. - next(null, chunk) - }) -} - -// pipe "hello world" out -// to stdout. -fromString('hello world').pipe(process.stdout) -``` - -### `stream = from2.obj([opts], read)` ### - -Shorthand for `from2({ objectMode: true }, read)`. - -### `createStream = from2.ctor([opts], read)` ### - -If you're creating similar streams in quick succession you can improve -performance by generating a stream **constructor** that you can reuse instead -of creating one-off streams on each call. - -Takes the same options as `from2`, instead returning a constructor which you -can use to create new streams. - -## License ## - -MIT. See [LICENSE.md](http://github.com/hughsk/from2/blob/master/LICENSE.md) for details. diff --git a/deps/npm/node_modules/sorted-union-stream/node_modules/from2/index.js b/deps/npm/node_modules/sorted-union-stream/node_modules/from2/index.js deleted file mode 100644 index 1e58cdee1fad55..00000000000000 --- a/deps/npm/node_modules/sorted-union-stream/node_modules/from2/index.js +++ /dev/null @@ -1,93 +0,0 @@ -var Readable = require('readable-stream').Readable -var inherits = require('inherits') - -module.exports = from2 - -from2.ctor = ctor -from2.obj = obj - -var Proto = ctor() - -function toFunction(list) { - list = list.slice() - return function (_, cb) { - cb(null, list.length ? list.shift() : null) - } -} - -function from2(opts, read) { - if (typeof opts !== 'object' || Array.isArray(opts)) { - read = opts - opts = {} - } - - if (Array.isArray(read)) read = toFunction(read) - - var rs = new Proto(opts) - rs._from = read - return rs -} - -function ctor(opts, read) { - if (typeof opts === 'function') { - read = opts - opts = {} - } - - opts = defaults(opts) - - inherits(Class, Readable) - function Class(override) { - if (!(this instanceof Class)) return new Class(override) - this._reading = false - this.destroyed = false - Readable.call(this, override || opts) - } - - Class.prototype._from = read - Class.prototype._read = function(size) { - var self = this - - if (this._reading || this.destroyed) return - this._reading = true - this._from(size, check) - function check(err, data) { - if (self.destroyed) return - if (err) return self.destroy(err) - if (data === null) return self.push(null) - self._reading = false - if (self.push(data)) self._read() - } - } - - Class.prototype.destroy = function(err) { - if (this.destroyed) return - this.destroyed = true - - var self = this - process.nextTick(function() { - if (err) self.emit('error', err) - self.emit('close') - }) - } - - return Class -} - -function obj(opts, read) { - if (typeof opts === 'function' || Array.isArray(opts)) { - read = opts - opts = {} - } - - opts = defaults(opts) - opts.objectMode = true - opts.highWaterMark = 16 - - return from2(opts, read) -} - -function defaults(opts) { - opts = opts || {} - return opts -} diff --git a/deps/npm/node_modules/sorted-union-stream/node_modules/from2/package.json b/deps/npm/node_modules/sorted-union-stream/node_modules/from2/package.json deleted file mode 100644 index f5932495586c37..00000000000000 --- a/deps/npm/node_modules/sorted-union-stream/node_modules/from2/package.json +++ /dev/null @@ -1,69 +0,0 @@ -{ - "_from": "from2@^1.3.0", - "_id": "from2@1.3.0", - "_inBundle": false, - "_integrity": "sha1-iEE7qqX5pZfP3pIh2GmGzTwGHf0=", - "_location": "/sorted-union-stream/from2", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "from2@^1.3.0", - "name": "from2", - "escapedName": "from2", - "rawSpec": "^1.3.0", - "saveSpec": null, - "fetchSpec": "^1.3.0" - }, - "_requiredBy": [ - "/sorted-union-stream" - ], - "_resolved": "https://registry.npmjs.org/from2/-/from2-1.3.0.tgz", - "_shasum": "88413baaa5f9a597cfde9221d86986cd3c061dfd", - "_spec": "from2@^1.3.0", - "_where": "/Users/rebecca/code/npm/node_modules/sorted-union-stream", - "author": { - "name": "Hugh Kennedy", - "email": "hughskennedy@gmail.com", - "url": "http://hughsk.io/" - }, - "bugs": { - "url": "https://github.com/hughsk/from2/issues" - }, - "bundleDependencies": false, - "contributors": [ - { - "name": "Mathias Buus", - "email": "mathiasbuus@gmail.com" - } - ], - "dependencies": { - "inherits": "~2.0.1", - "readable-stream": "~1.1.10" - }, - "deprecated": false, - "description": "Convenience wrapper for ReadableStream, with an API lifted from \"from\" and \"through2\"", - "devDependencies": { - "tape": "~2.4.2" - }, - "homepage": "https://github.com/hughsk/from2", - "keywords": [ - "from", - "stream", - "readable", - "pull", - "convenience", - "wrapper" - ], - "license": "MIT", - "main": "index.js", - "name": "from2", - "repository": { - "type": "git", - "url": "git://github.com/hughsk/from2.git" - }, - "scripts": { - "test": "node test" - }, - "version": "1.3.0" -} diff --git a/deps/npm/node_modules/sorted-union-stream/node_modules/from2/test.js b/deps/npm/node_modules/sorted-union-stream/node_modules/from2/test.js deleted file mode 100644 index aee046352a0b30..00000000000000 --- a/deps/npm/node_modules/sorted-union-stream/node_modules/from2/test.js +++ /dev/null @@ -1,86 +0,0 @@ -var test = require('tape') -var path = require('path') -var from = require('./') -var fs = require('fs') - -var tmp = path.resolve( - __dirname, 'tmp.txt' -) - -function fromString(string) { - return from(function(size, next) { - if (string.length <= 0) return next() - var chunk = string.slice(0, size) - string = string.slice(size) - next(null, chunk) - }) -} - -test('from2', function(t) { - var contents = fs.readFileSync(__filename, 'utf8') - var stream = fromString(contents) - - stream - .pipe(fs.createWriteStream(tmp)) - .on('close', function() { - t.equal(fs.readFileSync(tmp, 'utf8'), contents) - fs.unlinkSync(tmp) - t.end() - }) -}) - -test('old mode', function(t) { - var contents = fs.readFileSync(__filename, 'utf8') - var stream = fromString(contents) - var buffer = '' - - stream.on('data', function(data) { - buffer += data - }).on('end', function() { - t.equal(buffer, contents) - t.end() - }) -}) - -test('destroy', function(t) { - var stream = from(function(size, next) { - process.nextTick(function() { - next(null, 'no') - }) - }) - - stream.on('data', function(data) { - t.ok(false) - }).on('close', function() { - t.ok(true) - t.end() - }) - - stream.destroy() -}) - -test('arrays', function (t) { - var input = ['a', 'b', 'c'] - var stream = from(input) - var output = [] - stream.on('data', function (letter) { - output.push(letter.toString()) - }) - stream.on('end', function () { - t.deepEqual(input, output) - t.end() - }) -}) - -test('obj arrays', function (t) { - var input = [{foo:'a'}, {foo:'b'}, {foo:'c'}] - var stream = from.obj(input) - var output = [] - stream.on('data', function (letter) { - output.push(letter) - }) - stream.on('end', function () { - t.deepEqual(input, output) - t.end() - }) -}) diff --git a/deps/npm/node_modules/sorted-union-stream/node_modules/isarray/README.md b/deps/npm/node_modules/sorted-union-stream/node_modules/isarray/README.md deleted file mode 100644 index 052a62b8d7b7ae..00000000000000 --- a/deps/npm/node_modules/sorted-union-stream/node_modules/isarray/README.md +++ /dev/null @@ -1,54 +0,0 @@ - -# isarray - -`Array#isArray` for older browsers. - -## Usage - -```js -var isArray = require('isarray'); - -console.log(isArray([])); // => true -console.log(isArray({})); // => false -``` - -## Installation - -With [npm](http://npmjs.org) do - -```bash -$ npm install isarray -``` - -Then bundle for the browser with -[browserify](https://github.com/substack/browserify). - -With [component](http://component.io) do - -```bash -$ component install juliangruber/isarray -``` - -## License - -(MIT) - -Copyright (c) 2013 Julian Gruber <julian@juliangruber.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/deps/npm/node_modules/sorted-union-stream/node_modules/isarray/build/build.js b/deps/npm/node_modules/sorted-union-stream/node_modules/isarray/build/build.js deleted file mode 100644 index ec58596aeebe4e..00000000000000 --- a/deps/npm/node_modules/sorted-union-stream/node_modules/isarray/build/build.js +++ /dev/null @@ -1,209 +0,0 @@ - -/** - * Require the given path. - * - * @param {String} path - * @return {Object} exports - * @api public - */ - -function require(path, parent, orig) { - var resolved = require.resolve(path); - - // lookup failed - if (null == resolved) { - orig = orig || path; - parent = parent || 'root'; - var err = new Error('Failed to require "' + orig + '" from "' + parent + '"'); - err.path = orig; - err.parent = parent; - err.require = true; - throw err; - } - - var module = require.modules[resolved]; - - // perform real require() - // by invoking the module's - // registered function - if (!module.exports) { - module.exports = {}; - module.client = module.component = true; - module.call(this, module.exports, require.relative(resolved), module); - } - - return module.exports; -} - -/** - * Registered modules. - */ - -require.modules = {}; - -/** - * Registered aliases. - */ - -require.aliases = {}; - -/** - * Resolve `path`. - * - * Lookup: - * - * - PATH/index.js - * - PATH.js - * - PATH - * - * @param {String} path - * @return {String} path or null - * @api private - */ - -require.resolve = function(path) { - if (path.charAt(0) === '/') path = path.slice(1); - var index = path + '/index.js'; - - var paths = [ - path, - path + '.js', - path + '.json', - path + '/index.js', - path + '/index.json' - ]; - - for (var i = 0; i < paths.length; i++) { - var path = paths[i]; - if (require.modules.hasOwnProperty(path)) return path; - } - - if (require.aliases.hasOwnProperty(index)) { - return require.aliases[index]; - } -}; - -/** - * Normalize `path` relative to the current path. - * - * @param {String} curr - * @param {String} path - * @return {String} - * @api private - */ - -require.normalize = function(curr, path) { - var segs = []; - - if ('.' != path.charAt(0)) return path; - - curr = curr.split('/'); - path = path.split('/'); - - for (var i = 0; i < path.length; ++i) { - if ('..' == path[i]) { - curr.pop(); - } else if ('.' != path[i] && '' != path[i]) { - segs.push(path[i]); - } - } - - return curr.concat(segs).join('/'); -}; - -/** - * Register module at `path` with callback `definition`. - * - * @param {String} path - * @param {Function} definition - * @api private - */ - -require.register = function(path, definition) { - require.modules[path] = definition; -}; - -/** - * Alias a module definition. - * - * @param {String} from - * @param {String} to - * @api private - */ - -require.alias = function(from, to) { - if (!require.modules.hasOwnProperty(from)) { - throw new Error('Failed to alias "' + from + '", it does not exist'); - } - require.aliases[to] = from; -}; - -/** - * Return a require function relative to the `parent` path. - * - * @param {String} parent - * @return {Function} - * @api private - */ - -require.relative = function(parent) { - var p = require.normalize(parent, '..'); - - /** - * lastIndexOf helper. - */ - - function lastIndexOf(arr, obj) { - var i = arr.length; - while (i--) { - if (arr[i] === obj) return i; - } - return -1; - } - - /** - * The relative require() itself. - */ - - function localRequire(path) { - var resolved = localRequire.resolve(path); - return require(resolved, parent, path); - } - - /** - * Resolve relative to the parent. - */ - - localRequire.resolve = function(path) { - var c = path.charAt(0); - if ('/' == c) return path.slice(1); - if ('.' == c) return require.normalize(p, path); - - // resolve deps by returning - // the dep in the nearest "deps" - // directory - var segs = parent.split('/'); - var i = lastIndexOf(segs, 'deps') + 1; - if (!i) i = 0; - path = segs.slice(0, i + 1).join('/') + '/deps/' + path; - return path; - }; - - /** - * Check if module is defined at `path`. - */ - - localRequire.exists = function(path) { - return require.modules.hasOwnProperty(localRequire.resolve(path)); - }; - - return localRequire; -}; -require.register("isarray/index.js", function(exports, require, module){ -module.exports = Array.isArray || function (arr) { - return Object.prototype.toString.call(arr) == '[object Array]'; -}; - -}); -require.alias("isarray/index.js", "isarray/index.js"); - diff --git a/deps/npm/node_modules/sorted-union-stream/node_modules/isarray/component.json b/deps/npm/node_modules/sorted-union-stream/node_modules/isarray/component.json deleted file mode 100644 index 9e31b683889015..00000000000000 --- a/deps/npm/node_modules/sorted-union-stream/node_modules/isarray/component.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name" : "isarray", - "description" : "Array#isArray for older browsers", - "version" : "0.0.1", - "repository" : "juliangruber/isarray", - "homepage": "https://github.com/juliangruber/isarray", - "main" : "index.js", - "scripts" : [ - "index.js" - ], - "dependencies" : {}, - "keywords": ["browser","isarray","array"], - "author": { - "name": "Julian Gruber", - "email": "mail@juliangruber.com", - "url": "http://juliangruber.com" - }, - "license": "MIT" -} diff --git a/deps/npm/node_modules/sorted-union-stream/node_modules/isarray/index.js b/deps/npm/node_modules/sorted-union-stream/node_modules/isarray/index.js deleted file mode 100644 index 5f5ad45d46dda9..00000000000000 --- a/deps/npm/node_modules/sorted-union-stream/node_modules/isarray/index.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = Array.isArray || function (arr) { - return Object.prototype.toString.call(arr) == '[object Array]'; -}; diff --git a/deps/npm/node_modules/sorted-union-stream/node_modules/isarray/package.json b/deps/npm/node_modules/sorted-union-stream/node_modules/isarray/package.json deleted file mode 100644 index 7ffb74081007fd..00000000000000 --- a/deps/npm/node_modules/sorted-union-stream/node_modules/isarray/package.json +++ /dev/null @@ -1,57 +0,0 @@ -{ - "_from": "isarray@0.0.1", - "_id": "isarray@0.0.1", - "_inBundle": false, - "_integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=", - "_location": "/sorted-union-stream/isarray", - "_phantomChildren": {}, - "_requested": { - "type": "version", - "registry": true, - "raw": "isarray@0.0.1", - "name": "isarray", - "escapedName": "isarray", - "rawSpec": "0.0.1", - "saveSpec": null, - "fetchSpec": "0.0.1" - }, - "_requiredBy": [ - "/sorted-union-stream/readable-stream" - ], - "_resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", - "_shasum": "8a18acfca9a8f4177e09abfc6038939b05d1eedf", - "_spec": "isarray@0.0.1", - "_where": "/Users/rebecca/code/npm/node_modules/sorted-union-stream/node_modules/readable-stream", - "author": { - "name": "Julian Gruber", - "email": "mail@juliangruber.com", - "url": "http://juliangruber.com" - }, - "bugs": { - "url": "https://github.com/juliangruber/isarray/issues" - }, - "bundleDependencies": false, - "dependencies": {}, - "deprecated": false, - "description": "Array#isArray for older browsers", - "devDependencies": { - "tap": "*" - }, - "homepage": "https://github.com/juliangruber/isarray", - "keywords": [ - "browser", - "isarray", - "array" - ], - "license": "MIT", - "main": "index.js", - "name": "isarray", - "repository": { - "type": "git", - "url": "git://github.com/juliangruber/isarray.git" - }, - "scripts": { - "test": "tap test/*.js" - }, - "version": "0.0.1" -} diff --git a/deps/npm/node_modules/sorted-union-stream/node_modules/readable-stream/.npmignore b/deps/npm/node_modules/sorted-union-stream/node_modules/readable-stream/.npmignore deleted file mode 100644 index 38344f87a62766..00000000000000 --- a/deps/npm/node_modules/sorted-union-stream/node_modules/readable-stream/.npmignore +++ /dev/null @@ -1,5 +0,0 @@ -build/ -test/ -examples/ -fs.js -zlib.js \ No newline at end of file diff --git a/deps/npm/node_modules/sorted-union-stream/node_modules/readable-stream/LICENSE b/deps/npm/node_modules/sorted-union-stream/node_modules/readable-stream/LICENSE deleted file mode 100644 index e3d4e695a4cff2..00000000000000 --- a/deps/npm/node_modules/sorted-union-stream/node_modules/readable-stream/LICENSE +++ /dev/null @@ -1,18 +0,0 @@ -Copyright Joyent, Inc. and other Node contributors. All rights reserved. -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to -deal in the Software without restriction, including without limitation the -rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -sell copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -IN THE SOFTWARE. diff --git a/deps/npm/node_modules/sorted-union-stream/node_modules/readable-stream/README.md b/deps/npm/node_modules/sorted-union-stream/node_modules/readable-stream/README.md deleted file mode 100644 index e46b823903d2c6..00000000000000 --- a/deps/npm/node_modules/sorted-union-stream/node_modules/readable-stream/README.md +++ /dev/null @@ -1,15 +0,0 @@ -# readable-stream - -***Node-core streams for userland*** - -[![NPM](https://nodei.co/npm/readable-stream.png?downloads=true&downloadRank=true)](https://nodei.co/npm/readable-stream/) -[![NPM](https://nodei.co/npm-dl/readable-stream.png&months=6&height=3)](https://nodei.co/npm/readable-stream/) - -This package is a mirror of the Streams2 and Streams3 implementations in Node-core. - -If you want to guarantee a stable streams base, regardless of what version of Node you, or the users of your libraries are using, use **readable-stream** *only* and avoid the *"stream"* module in Node-core. - -**readable-stream** comes in two major versions, v1.0.x and v1.1.x. The former tracks the Streams2 implementation in Node 0.10, including bug-fixes and minor improvements as they are added. The latter tracks Streams3 as it develops in Node 0.11; we will likely see a v1.2.x branch for Node 0.12. - -**readable-stream** uses proper patch-level versioning so if you pin to `"~1.0.0"` you’ll get the latest Node 0.10 Streams2 implementation, including any fixes and minor non-breaking improvements. The patch-level versions of 1.0.x and 1.1.x should mirror the patch-level versions of Node-core releases. You should prefer the **1.0.x** releases for now and when you’re ready to start using Streams3, pin to `"~1.1.0"` - diff --git a/deps/npm/node_modules/sorted-union-stream/node_modules/readable-stream/duplex.js b/deps/npm/node_modules/sorted-union-stream/node_modules/readable-stream/duplex.js deleted file mode 100644 index ca807af87620dd..00000000000000 --- a/deps/npm/node_modules/sorted-union-stream/node_modules/readable-stream/duplex.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require("./lib/_stream_duplex.js") diff --git a/deps/npm/node_modules/sorted-union-stream/node_modules/readable-stream/float.patch b/deps/npm/node_modules/sorted-union-stream/node_modules/readable-stream/float.patch deleted file mode 100644 index b984607a41cc1f..00000000000000 --- a/deps/npm/node_modules/sorted-union-stream/node_modules/readable-stream/float.patch +++ /dev/null @@ -1,923 +0,0 @@ -diff --git a/lib/_stream_duplex.js b/lib/_stream_duplex.js -index c5a741c..a2e0d8e 100644 ---- a/lib/_stream_duplex.js -+++ b/lib/_stream_duplex.js -@@ -26,8 +26,8 @@ - - module.exports = Duplex; - var util = require('util'); --var Readable = require('_stream_readable'); --var Writable = require('_stream_writable'); -+var Readable = require('./_stream_readable'); -+var Writable = require('./_stream_writable'); - - util.inherits(Duplex, Readable); - -diff --git a/lib/_stream_passthrough.js b/lib/_stream_passthrough.js -index a5e9864..330c247 100644 ---- a/lib/_stream_passthrough.js -+++ b/lib/_stream_passthrough.js -@@ -25,7 +25,7 @@ - - module.exports = PassThrough; - --var Transform = require('_stream_transform'); -+var Transform = require('./_stream_transform'); - var util = require('util'); - util.inherits(PassThrough, Transform); - -diff --git a/lib/_stream_readable.js b/lib/_stream_readable.js -index 0c3fe3e..90a8298 100644 ---- a/lib/_stream_readable.js -+++ b/lib/_stream_readable.js -@@ -23,10 +23,34 @@ module.exports = Readable; - Readable.ReadableState = ReadableState; - - var EE = require('events').EventEmitter; -+if (!EE.listenerCount) EE.listenerCount = function(emitter, type) { -+ return emitter.listeners(type).length; -+}; -+ -+if (!global.setImmediate) global.setImmediate = function setImmediate(fn) { -+ return setTimeout(fn, 0); -+}; -+if (!global.clearImmediate) global.clearImmediate = function clearImmediate(i) { -+ return clearTimeout(i); -+}; -+ - var Stream = require('stream'); - var util = require('util'); -+if (!util.isUndefined) { -+ var utilIs = require('core-util-is'); -+ for (var f in utilIs) { -+ util[f] = utilIs[f]; -+ } -+} - var StringDecoder; --var debug = util.debuglog('stream'); -+var debug; -+if (util.debuglog) -+ debug = util.debuglog('stream'); -+else try { -+ debug = require('debuglog')('stream'); -+} catch (er) { -+ debug = function() {}; -+} - - util.inherits(Readable, Stream); - -@@ -380,7 +404,7 @@ function chunkInvalid(state, chunk) { - - - function onEofChunk(stream, state) { -- if (state.decoder && !state.ended) { -+ if (state.decoder && !state.ended && state.decoder.end) { - var chunk = state.decoder.end(); - if (chunk && chunk.length) { - state.buffer.push(chunk); -diff --git a/lib/_stream_transform.js b/lib/_stream_transform.js -index b1f9fcc..b0caf57 100644 ---- a/lib/_stream_transform.js -+++ b/lib/_stream_transform.js -@@ -64,8 +64,14 @@ - - module.exports = Transform; - --var Duplex = require('_stream_duplex'); -+var Duplex = require('./_stream_duplex'); - var util = require('util'); -+if (!util.isUndefined) { -+ var utilIs = require('core-util-is'); -+ for (var f in utilIs) { -+ util[f] = utilIs[f]; -+ } -+} - util.inherits(Transform, Duplex); - - -diff --git a/lib/_stream_writable.js b/lib/_stream_writable.js -index ba2e920..f49288b 100644 ---- a/lib/_stream_writable.js -+++ b/lib/_stream_writable.js -@@ -27,6 +27,12 @@ module.exports = Writable; - Writable.WritableState = WritableState; - - var util = require('util'); -+if (!util.isUndefined) { -+ var utilIs = require('core-util-is'); -+ for (var f in utilIs) { -+ util[f] = utilIs[f]; -+ } -+} - var Stream = require('stream'); - - util.inherits(Writable, Stream); -@@ -119,7 +125,7 @@ function WritableState(options, stream) { - function Writable(options) { - // Writable ctor is applied to Duplexes, though they're not - // instanceof Writable, they're instanceof Readable. -- if (!(this instanceof Writable) && !(this instanceof Stream.Duplex)) -+ if (!(this instanceof Writable) && !(this instanceof require('./_stream_duplex'))) - return new Writable(options); - - this._writableState = new WritableState(options, this); -diff --git a/test/simple/test-stream-big-push.js b/test/simple/test-stream-big-push.js -index e3787e4..8cd2127 100644 ---- a/test/simple/test-stream-big-push.js -+++ b/test/simple/test-stream-big-push.js -@@ -21,7 +21,7 @@ - - var common = require('../common'); - var assert = require('assert'); --var stream = require('stream'); -+var stream = require('../../'); - var str = 'asdfasdfasdfasdfasdf'; - - var r = new stream.Readable({ -diff --git a/test/simple/test-stream-end-paused.js b/test/simple/test-stream-end-paused.js -index bb73777..d40efc7 100644 ---- a/test/simple/test-stream-end-paused.js -+++ b/test/simple/test-stream-end-paused.js -@@ -25,7 +25,7 @@ var gotEnd = false; - - // Make sure we don't miss the end event for paused 0-length streams - --var Readable = require('stream').Readable; -+var Readable = require('../../').Readable; - var stream = new Readable(); - var calledRead = false; - stream._read = function() { -diff --git a/test/simple/test-stream-pipe-after-end.js b/test/simple/test-stream-pipe-after-end.js -index b46ee90..0be8366 100644 ---- a/test/simple/test-stream-pipe-after-end.js -+++ b/test/simple/test-stream-pipe-after-end.js -@@ -22,8 +22,8 @@ - var common = require('../common'); - var assert = require('assert'); - --var Readable = require('_stream_readable'); --var Writable = require('_stream_writable'); -+var Readable = require('../../lib/_stream_readable'); -+var Writable = require('../../lib/_stream_writable'); - var util = require('util'); - - util.inherits(TestReadable, Readable); -diff --git a/test/simple/test-stream-pipe-cleanup.js b/test/simple/test-stream-pipe-cleanup.js -deleted file mode 100644 -index f689358..0000000 ---- a/test/simple/test-stream-pipe-cleanup.js -+++ /dev/null -@@ -1,122 +0,0 @@ --// Copyright Joyent, Inc. and other Node contributors. --// --// Permission is hereby granted, free of charge, to any person obtaining a --// copy of this software and associated documentation files (the --// "Software"), to deal in the Software without restriction, including --// without limitation the rights to use, copy, modify, merge, publish, --// distribute, sublicense, and/or sell copies of the Software, and to permit --// persons to whom the Software is furnished to do so, subject to the --// following conditions: --// --// The above copyright notice and this permission notice shall be included --// in all copies or substantial portions of the Software. --// --// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS --// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF --// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN --// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, --// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR --// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE --// USE OR OTHER DEALINGS IN THE SOFTWARE. -- --// This test asserts that Stream.prototype.pipe does not leave listeners --// hanging on the source or dest. -- --var common = require('../common'); --var stream = require('stream'); --var assert = require('assert'); --var util = require('util'); -- --function Writable() { -- this.writable = true; -- this.endCalls = 0; -- stream.Stream.call(this); --} --util.inherits(Writable, stream.Stream); --Writable.prototype.end = function() { -- this.endCalls++; --}; -- --Writable.prototype.destroy = function() { -- this.endCalls++; --}; -- --function Readable() { -- this.readable = true; -- stream.Stream.call(this); --} --util.inherits(Readable, stream.Stream); -- --function Duplex() { -- this.readable = true; -- Writable.call(this); --} --util.inherits(Duplex, Writable); -- --var i = 0; --var limit = 100; -- --var w = new Writable(); -- --var r; -- --for (i = 0; i < limit; i++) { -- r = new Readable(); -- r.pipe(w); -- r.emit('end'); --} --assert.equal(0, r.listeners('end').length); --assert.equal(limit, w.endCalls); -- --w.endCalls = 0; -- --for (i = 0; i < limit; i++) { -- r = new Readable(); -- r.pipe(w); -- r.emit('close'); --} --assert.equal(0, r.listeners('close').length); --assert.equal(limit, w.endCalls); -- --w.endCalls = 0; -- --r = new Readable(); -- --for (i = 0; i < limit; i++) { -- w = new Writable(); -- r.pipe(w); -- w.emit('close'); --} --assert.equal(0, w.listeners('close').length); -- --r = new Readable(); --w = new Writable(); --var d = new Duplex(); --r.pipe(d); // pipeline A --d.pipe(w); // pipeline B --assert.equal(r.listeners('end').length, 2); // A.onend, A.cleanup --assert.equal(r.listeners('close').length, 2); // A.onclose, A.cleanup --assert.equal(d.listeners('end').length, 2); // B.onend, B.cleanup --assert.equal(d.listeners('close').length, 3); // A.cleanup, B.onclose, B.cleanup --assert.equal(w.listeners('end').length, 0); --assert.equal(w.listeners('close').length, 1); // B.cleanup -- --r.emit('end'); --assert.equal(d.endCalls, 1); --assert.equal(w.endCalls, 0); --assert.equal(r.listeners('end').length, 0); --assert.equal(r.listeners('close').length, 0); --assert.equal(d.listeners('end').length, 2); // B.onend, B.cleanup --assert.equal(d.listeners('close').length, 2); // B.onclose, B.cleanup --assert.equal(w.listeners('end').length, 0); --assert.equal(w.listeners('close').length, 1); // B.cleanup -- --d.emit('end'); --assert.equal(d.endCalls, 1); --assert.equal(w.endCalls, 1); --assert.equal(r.listeners('end').length, 0); --assert.equal(r.listeners('close').length, 0); --assert.equal(d.listeners('end').length, 0); --assert.equal(d.listeners('close').length, 0); --assert.equal(w.listeners('end').length, 0); --assert.equal(w.listeners('close').length, 0); -diff --git a/test/simple/test-stream-pipe-error-handling.js b/test/simple/test-stream-pipe-error-handling.js -index c5d724b..c7d6b7d 100644 ---- a/test/simple/test-stream-pipe-error-handling.js -+++ b/test/simple/test-stream-pipe-error-handling.js -@@ -21,7 +21,7 @@ - - var common = require('../common'); - var assert = require('assert'); --var Stream = require('stream').Stream; -+var Stream = require('../../').Stream; - - (function testErrorListenerCatches() { - var source = new Stream(); -diff --git a/test/simple/test-stream-pipe-event.js b/test/simple/test-stream-pipe-event.js -index cb9d5fe..56f8d61 100644 ---- a/test/simple/test-stream-pipe-event.js -+++ b/test/simple/test-stream-pipe-event.js -@@ -20,7 +20,7 @@ - // USE OR OTHER DEALINGS IN THE SOFTWARE. - - var common = require('../common'); --var stream = require('stream'); -+var stream = require('../../'); - var assert = require('assert'); - var util = require('util'); - -diff --git a/test/simple/test-stream-push-order.js b/test/simple/test-stream-push-order.js -index f2e6ec2..a5c9bf9 100644 ---- a/test/simple/test-stream-push-order.js -+++ b/test/simple/test-stream-push-order.js -@@ -20,7 +20,7 @@ - // USE OR OTHER DEALINGS IN THE SOFTWARE. - - var common = require('../common.js'); --var Readable = require('stream').Readable; -+var Readable = require('../../').Readable; - var assert = require('assert'); - - var s = new Readable({ -diff --git a/test/simple/test-stream-push-strings.js b/test/simple/test-stream-push-strings.js -index 06f43dc..1701a9a 100644 ---- a/test/simple/test-stream-push-strings.js -+++ b/test/simple/test-stream-push-strings.js -@@ -22,7 +22,7 @@ - var common = require('../common'); - var assert = require('assert'); - --var Readable = require('stream').Readable; -+var Readable = require('../../').Readable; - var util = require('util'); - - util.inherits(MyStream, Readable); -diff --git a/test/simple/test-stream-readable-event.js b/test/simple/test-stream-readable-event.js -index ba6a577..a8e6f7b 100644 ---- a/test/simple/test-stream-readable-event.js -+++ b/test/simple/test-stream-readable-event.js -@@ -22,7 +22,7 @@ - var common = require('../common'); - var assert = require('assert'); - --var Readable = require('stream').Readable; -+var Readable = require('../../').Readable; - - (function first() { - // First test, not reading when the readable is added. -diff --git a/test/simple/test-stream-readable-flow-recursion.js b/test/simple/test-stream-readable-flow-recursion.js -index 2891ad6..11689ba 100644 ---- a/test/simple/test-stream-readable-flow-recursion.js -+++ b/test/simple/test-stream-readable-flow-recursion.js -@@ -27,7 +27,7 @@ var assert = require('assert'); - // more data continuously, but without triggering a nextTick - // warning or RangeError. - --var Readable = require('stream').Readable; -+var Readable = require('../../').Readable; - - // throw an error if we trigger a nextTick warning. - process.throwDeprecation = true; -diff --git a/test/simple/test-stream-unshift-empty-chunk.js b/test/simple/test-stream-unshift-empty-chunk.js -index 0c96476..7827538 100644 ---- a/test/simple/test-stream-unshift-empty-chunk.js -+++ b/test/simple/test-stream-unshift-empty-chunk.js -@@ -24,7 +24,7 @@ var assert = require('assert'); - - // This test verifies that stream.unshift(Buffer(0)) or - // stream.unshift('') does not set state.reading=false. --var Readable = require('stream').Readable; -+var Readable = require('../../').Readable; - - var r = new Readable(); - var nChunks = 10; -diff --git a/test/simple/test-stream-unshift-read-race.js b/test/simple/test-stream-unshift-read-race.js -index 83fd9fa..17c18aa 100644 ---- a/test/simple/test-stream-unshift-read-race.js -+++ b/test/simple/test-stream-unshift-read-race.js -@@ -29,7 +29,7 @@ var assert = require('assert'); - // 3. push() after the EOF signaling null is an error. - // 4. _read() is not called after pushing the EOF null chunk. - --var stream = require('stream'); -+var stream = require('../../'); - var hwm = 10; - var r = stream.Readable({ highWaterMark: hwm }); - var chunks = 10; -@@ -51,7 +51,14 @@ r._read = function(n) { - - function push(fast) { - assert(!pushedNull, 'push() after null push'); -- var c = pos >= data.length ? null : data.slice(pos, pos + n); -+ var c; -+ if (pos >= data.length) -+ c = null; -+ else { -+ if (n + pos > data.length) -+ n = data.length - pos; -+ c = data.slice(pos, pos + n); -+ } - pushedNull = c === null; - if (fast) { - pos += n; -diff --git a/test/simple/test-stream-writev.js b/test/simple/test-stream-writev.js -index 5b49e6e..b5321f3 100644 ---- a/test/simple/test-stream-writev.js -+++ b/test/simple/test-stream-writev.js -@@ -22,7 +22,7 @@ - var common = require('../common'); - var assert = require('assert'); - --var stream = require('stream'); -+var stream = require('../../'); - - var queue = []; - for (var decode = 0; decode < 2; decode++) { -diff --git a/test/simple/test-stream2-basic.js b/test/simple/test-stream2-basic.js -index 3814bf0..248c1be 100644 ---- a/test/simple/test-stream2-basic.js -+++ b/test/simple/test-stream2-basic.js -@@ -21,7 +21,7 @@ - - - var common = require('../common.js'); --var R = require('_stream_readable'); -+var R = require('../../lib/_stream_readable'); - var assert = require('assert'); - - var util = require('util'); -diff --git a/test/simple/test-stream2-compatibility.js b/test/simple/test-stream2-compatibility.js -index 6cdd4e9..f0fa84b 100644 ---- a/test/simple/test-stream2-compatibility.js -+++ b/test/simple/test-stream2-compatibility.js -@@ -21,7 +21,7 @@ - - - var common = require('../common.js'); --var R = require('_stream_readable'); -+var R = require('../../lib/_stream_readable'); - var assert = require('assert'); - - var util = require('util'); -diff --git a/test/simple/test-stream2-finish-pipe.js b/test/simple/test-stream2-finish-pipe.js -index 39b274f..006a19b 100644 ---- a/test/simple/test-stream2-finish-pipe.js -+++ b/test/simple/test-stream2-finish-pipe.js -@@ -20,7 +20,7 @@ - // USE OR OTHER DEALINGS IN THE SOFTWARE. - - var common = require('../common.js'); --var stream = require('stream'); -+var stream = require('../../'); - var Buffer = require('buffer').Buffer; - - var r = new stream.Readable(); -diff --git a/test/simple/test-stream2-fs.js b/test/simple/test-stream2-fs.js -deleted file mode 100644 -index e162406..0000000 ---- a/test/simple/test-stream2-fs.js -+++ /dev/null -@@ -1,72 +0,0 @@ --// Copyright Joyent, Inc. and other Node contributors. --// --// Permission is hereby granted, free of charge, to any person obtaining a --// copy of this software and associated documentation files (the --// "Software"), to deal in the Software without restriction, including --// without limitation the rights to use, copy, modify, merge, publish, --// distribute, sublicense, and/or sell copies of the Software, and to permit --// persons to whom the Software is furnished to do so, subject to the --// following conditions: --// --// The above copyright notice and this permission notice shall be included --// in all copies or substantial portions of the Software. --// --// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS --// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF --// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN --// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, --// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR --// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE --// USE OR OTHER DEALINGS IN THE SOFTWARE. -- -- --var common = require('../common.js'); --var R = require('_stream_readable'); --var assert = require('assert'); -- --var fs = require('fs'); --var FSReadable = fs.ReadStream; -- --var path = require('path'); --var file = path.resolve(common.fixturesDir, 'x1024.txt'); -- --var size = fs.statSync(file).size; -- --var expectLengths = [1024]; -- --var util = require('util'); --var Stream = require('stream'); -- --util.inherits(TestWriter, Stream); -- --function TestWriter() { -- Stream.apply(this); -- this.buffer = []; -- this.length = 0; --} -- --TestWriter.prototype.write = function(c) { -- this.buffer.push(c.toString()); -- this.length += c.length; -- return true; --}; -- --TestWriter.prototype.end = function(c) { -- if (c) this.buffer.push(c.toString()); -- this.emit('results', this.buffer); --} -- --var r = new FSReadable(file); --var w = new TestWriter(); -- --w.on('results', function(res) { -- console.error(res, w.length); -- assert.equal(w.length, size); -- var l = 0; -- assert.deepEqual(res.map(function (c) { -- return c.length; -- }), expectLengths); -- console.log('ok'); --}); -- --r.pipe(w); -diff --git a/test/simple/test-stream2-httpclient-response-end.js b/test/simple/test-stream2-httpclient-response-end.js -deleted file mode 100644 -index 15cffc2..0000000 ---- a/test/simple/test-stream2-httpclient-response-end.js -+++ /dev/null -@@ -1,52 +0,0 @@ --// Copyright Joyent, Inc. and other Node contributors. --// --// Permission is hereby granted, free of charge, to any person obtaining a --// copy of this software and associated documentation files (the --// "Software"), to deal in the Software without restriction, including --// without limitation the rights to use, copy, modify, merge, publish, --// distribute, sublicense, and/or sell copies of the Software, and to permit --// persons to whom the Software is furnished to do so, subject to the --// following conditions: --// --// The above copyright notice and this permission notice shall be included --// in all copies or substantial portions of the Software. --// --// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS --// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF --// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN --// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, --// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR --// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE --// USE OR OTHER DEALINGS IN THE SOFTWARE. -- --var common = require('../common.js'); --var assert = require('assert'); --var http = require('http'); --var msg = 'Hello'; --var readable_event = false; --var end_event = false; --var server = http.createServer(function(req, res) { -- res.writeHead(200, {'Content-Type': 'text/plain'}); -- res.end(msg); --}).listen(common.PORT, function() { -- http.get({port: common.PORT}, function(res) { -- var data = ''; -- res.on('readable', function() { -- console.log('readable event'); -- readable_event = true; -- data += res.read(); -- }); -- res.on('end', function() { -- console.log('end event'); -- end_event = true; -- assert.strictEqual(msg, data); -- server.close(); -- }); -- }); --}); -- --process.on('exit', function() { -- assert(readable_event); -- assert(end_event); --}); -- -diff --git a/test/simple/test-stream2-large-read-stall.js b/test/simple/test-stream2-large-read-stall.js -index 2fbfbca..667985b 100644 ---- a/test/simple/test-stream2-large-read-stall.js -+++ b/test/simple/test-stream2-large-read-stall.js -@@ -30,7 +30,7 @@ var PUSHSIZE = 20; - var PUSHCOUNT = 1000; - var HWM = 50; - --var Readable = require('stream').Readable; -+var Readable = require('../../').Readable; - var r = new Readable({ - highWaterMark: HWM - }); -@@ -39,23 +39,23 @@ var rs = r._readableState; - r._read = push; - - r.on('readable', function() { -- console.error('>> readable'); -+ //console.error('>> readable'); - do { -- console.error(' > read(%d)', READSIZE); -+ //console.error(' > read(%d)', READSIZE); - var ret = r.read(READSIZE); -- console.error(' < %j (%d remain)', ret && ret.length, rs.length); -+ //console.error(' < %j (%d remain)', ret && ret.length, rs.length); - } while (ret && ret.length === READSIZE); - -- console.error('<< after read()', -- ret && ret.length, -- rs.needReadable, -- rs.length); -+ //console.error('<< after read()', -+ // ret && ret.length, -+ // rs.needReadable, -+ // rs.length); - }); - - var endEmitted = false; - r.on('end', function() { - endEmitted = true; -- console.error('end'); -+ //console.error('end'); - }); - - var pushes = 0; -@@ -64,11 +64,11 @@ function push() { - return; - - if (pushes++ === PUSHCOUNT) { -- console.error(' push(EOF)'); -+ //console.error(' push(EOF)'); - return r.push(null); - } - -- console.error(' push #%d', pushes); -+ //console.error(' push #%d', pushes); - if (r.push(new Buffer(PUSHSIZE))) - setTimeout(push); - } -diff --git a/test/simple/test-stream2-objects.js b/test/simple/test-stream2-objects.js -index 3e6931d..ff47d89 100644 ---- a/test/simple/test-stream2-objects.js -+++ b/test/simple/test-stream2-objects.js -@@ -21,8 +21,8 @@ - - - var common = require('../common.js'); --var Readable = require('_stream_readable'); --var Writable = require('_stream_writable'); -+var Readable = require('../../lib/_stream_readable'); -+var Writable = require('../../lib/_stream_writable'); - var assert = require('assert'); - - // tiny node-tap lookalike. -diff --git a/test/simple/test-stream2-pipe-error-handling.js b/test/simple/test-stream2-pipe-error-handling.js -index cf7531c..e3f3e4e 100644 ---- a/test/simple/test-stream2-pipe-error-handling.js -+++ b/test/simple/test-stream2-pipe-error-handling.js -@@ -21,7 +21,7 @@ - - var common = require('../common'); - var assert = require('assert'); --var stream = require('stream'); -+var stream = require('../../'); - - (function testErrorListenerCatches() { - var count = 1000; -diff --git a/test/simple/test-stream2-pipe-error-once-listener.js b/test/simple/test-stream2-pipe-error-once-listener.js -index 5e8e3cb..53b2616 100755 ---- a/test/simple/test-stream2-pipe-error-once-listener.js -+++ b/test/simple/test-stream2-pipe-error-once-listener.js -@@ -24,7 +24,7 @@ var common = require('../common.js'); - var assert = require('assert'); - - var util = require('util'); --var stream = require('stream'); -+var stream = require('../../'); - - - var Read = function() { -diff --git a/test/simple/test-stream2-push.js b/test/simple/test-stream2-push.js -index b63edc3..eb2b0e9 100644 ---- a/test/simple/test-stream2-push.js -+++ b/test/simple/test-stream2-push.js -@@ -20,7 +20,7 @@ - // USE OR OTHER DEALINGS IN THE SOFTWARE. - - var common = require('../common.js'); --var stream = require('stream'); -+var stream = require('../../'); - var Readable = stream.Readable; - var Writable = stream.Writable; - var assert = require('assert'); -diff --git a/test/simple/test-stream2-read-sync-stack.js b/test/simple/test-stream2-read-sync-stack.js -index e8a7305..9740a47 100644 ---- a/test/simple/test-stream2-read-sync-stack.js -+++ b/test/simple/test-stream2-read-sync-stack.js -@@ -21,7 +21,7 @@ - - var common = require('../common'); - var assert = require('assert'); --var Readable = require('stream').Readable; -+var Readable = require('../../').Readable; - var r = new Readable(); - var N = 256 * 1024; - -diff --git a/test/simple/test-stream2-readable-empty-buffer-no-eof.js b/test/simple/test-stream2-readable-empty-buffer-no-eof.js -index cd30178..4b1659d 100644 ---- a/test/simple/test-stream2-readable-empty-buffer-no-eof.js -+++ b/test/simple/test-stream2-readable-empty-buffer-no-eof.js -@@ -22,10 +22,9 @@ - var common = require('../common'); - var assert = require('assert'); - --var Readable = require('stream').Readable; -+var Readable = require('../../').Readable; - - test1(); --test2(); - - function test1() { - var r = new Readable(); -@@ -88,31 +87,3 @@ function test1() { - console.log('ok'); - }); - } -- --function test2() { -- var r = new Readable({ encoding: 'base64' }); -- var reads = 5; -- r._read = function(n) { -- if (!reads--) -- return r.push(null); // EOF -- else -- return r.push(new Buffer('x')); -- }; -- -- var results = []; -- function flow() { -- var chunk; -- while (null !== (chunk = r.read())) -- results.push(chunk + ''); -- } -- r.on('readable', flow); -- r.on('end', function() { -- results.push('EOF'); -- }); -- flow(); -- -- process.on('exit', function() { -- assert.deepEqual(results, [ 'eHh4', 'eHg=', 'EOF' ]); -- console.log('ok'); -- }); --} -diff --git a/test/simple/test-stream2-readable-from-list.js b/test/simple/test-stream2-readable-from-list.js -index 7c96ffe..04a96f5 100644 ---- a/test/simple/test-stream2-readable-from-list.js -+++ b/test/simple/test-stream2-readable-from-list.js -@@ -21,7 +21,7 @@ - - var assert = require('assert'); - var common = require('../common.js'); --var fromList = require('_stream_readable')._fromList; -+var fromList = require('../../lib/_stream_readable')._fromList; - - // tiny node-tap lookalike. - var tests = []; -diff --git a/test/simple/test-stream2-readable-legacy-drain.js b/test/simple/test-stream2-readable-legacy-drain.js -index 675da8e..51fd3d5 100644 ---- a/test/simple/test-stream2-readable-legacy-drain.js -+++ b/test/simple/test-stream2-readable-legacy-drain.js -@@ -22,7 +22,7 @@ - var common = require('../common'); - var assert = require('assert'); - --var Stream = require('stream'); -+var Stream = require('../../'); - var Readable = Stream.Readable; - - var r = new Readable(); -diff --git a/test/simple/test-stream2-readable-non-empty-end.js b/test/simple/test-stream2-readable-non-empty-end.js -index 7314ae7..c971898 100644 ---- a/test/simple/test-stream2-readable-non-empty-end.js -+++ b/test/simple/test-stream2-readable-non-empty-end.js -@@ -21,7 +21,7 @@ - - var assert = require('assert'); - var common = require('../common.js'); --var Readable = require('_stream_readable'); -+var Readable = require('../../lib/_stream_readable'); - - var len = 0; - var chunks = new Array(10); -diff --git a/test/simple/test-stream2-readable-wrap-empty.js b/test/simple/test-stream2-readable-wrap-empty.js -index 2e5cf25..fd8a3dc 100644 ---- a/test/simple/test-stream2-readable-wrap-empty.js -+++ b/test/simple/test-stream2-readable-wrap-empty.js -@@ -22,7 +22,7 @@ - var common = require('../common'); - var assert = require('assert'); - --var Readable = require('_stream_readable'); -+var Readable = require('../../lib/_stream_readable'); - var EE = require('events').EventEmitter; - - var oldStream = new EE(); -diff --git a/test/simple/test-stream2-readable-wrap.js b/test/simple/test-stream2-readable-wrap.js -index 90eea01..6b177f7 100644 ---- a/test/simple/test-stream2-readable-wrap.js -+++ b/test/simple/test-stream2-readable-wrap.js -@@ -22,8 +22,8 @@ - var common = require('../common'); - var assert = require('assert'); - --var Readable = require('_stream_readable'); --var Writable = require('_stream_writable'); -+var Readable = require('../../lib/_stream_readable'); -+var Writable = require('../../lib/_stream_writable'); - var EE = require('events').EventEmitter; - - var testRuns = 0, completedRuns = 0; -diff --git a/test/simple/test-stream2-set-encoding.js b/test/simple/test-stream2-set-encoding.js -index 5d2c32a..685531b 100644 ---- a/test/simple/test-stream2-set-encoding.js -+++ b/test/simple/test-stream2-set-encoding.js -@@ -22,7 +22,7 @@ - - var common = require('../common.js'); - var assert = require('assert'); --var R = require('_stream_readable'); -+var R = require('../../lib/_stream_readable'); - var util = require('util'); - - // tiny node-tap lookalike. -diff --git a/test/simple/test-stream2-transform.js b/test/simple/test-stream2-transform.js -index 9c9ddd8..a0cacc6 100644 ---- a/test/simple/test-stream2-transform.js -+++ b/test/simple/test-stream2-transform.js -@@ -21,8 +21,8 @@ - - var assert = require('assert'); - var common = require('../common.js'); --var PassThrough = require('_stream_passthrough'); --var Transform = require('_stream_transform'); -+var PassThrough = require('../../').PassThrough; -+var Transform = require('../../').Transform; - - // tiny node-tap lookalike. - var tests = []; -diff --git a/test/simple/test-stream2-unpipe-drain.js b/test/simple/test-stream2-unpipe-drain.js -index d66dc3c..365b327 100644 ---- a/test/simple/test-stream2-unpipe-drain.js -+++ b/test/simple/test-stream2-unpipe-drain.js -@@ -22,7 +22,7 @@ - - var common = require('../common.js'); - var assert = require('assert'); --var stream = require('stream'); -+var stream = require('../../'); - var crypto = require('crypto'); - - var util = require('util'); -diff --git a/test/simple/test-stream2-unpipe-leak.js b/test/simple/test-stream2-unpipe-leak.js -index 99f8746..17c92ae 100644 ---- a/test/simple/test-stream2-unpipe-leak.js -+++ b/test/simple/test-stream2-unpipe-leak.js -@@ -22,7 +22,7 @@ - - var common = require('../common.js'); - var assert = require('assert'); --var stream = require('stream'); -+var stream = require('../../'); - - var chunk = new Buffer('hallo'); - -diff --git a/test/simple/test-stream2-writable.js b/test/simple/test-stream2-writable.js -index 704100c..209c3a6 100644 ---- a/test/simple/test-stream2-writable.js -+++ b/test/simple/test-stream2-writable.js -@@ -20,8 +20,8 @@ - // USE OR OTHER DEALINGS IN THE SOFTWARE. - - var common = require('../common.js'); --var W = require('_stream_writable'); --var D = require('_stream_duplex'); -+var W = require('../../').Writable; -+var D = require('../../').Duplex; - var assert = require('assert'); - - var util = require('util'); -diff --git a/test/simple/test-stream3-pause-then-read.js b/test/simple/test-stream3-pause-then-read.js -index b91bde3..2f72c15 100644 ---- a/test/simple/test-stream3-pause-then-read.js -+++ b/test/simple/test-stream3-pause-then-read.js -@@ -22,7 +22,7 @@ - var common = require('../common'); - var assert = require('assert'); - --var stream = require('stream'); -+var stream = require('../../'); - var Readable = stream.Readable; - var Writable = stream.Writable; - diff --git a/deps/npm/node_modules/sorted-union-stream/node_modules/readable-stream/lib/_stream_duplex.js b/deps/npm/node_modules/sorted-union-stream/node_modules/readable-stream/lib/_stream_duplex.js deleted file mode 100644 index b513d61a963a40..00000000000000 --- a/deps/npm/node_modules/sorted-union-stream/node_modules/readable-stream/lib/_stream_duplex.js +++ /dev/null @@ -1,89 +0,0 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - -// a duplex stream is just a stream that is both readable and writable. -// Since JS doesn't have multiple prototypal inheritance, this class -// prototypally inherits from Readable, and then parasitically from -// Writable. - -module.exports = Duplex; - -/**/ -var objectKeys = Object.keys || function (obj) { - var keys = []; - for (var key in obj) keys.push(key); - return keys; -} -/**/ - - -/**/ -var util = require('core-util-is'); -util.inherits = require('inherits'); -/**/ - -var Readable = require('./_stream_readable'); -var Writable = require('./_stream_writable'); - -util.inherits(Duplex, Readable); - -forEach(objectKeys(Writable.prototype), function(method) { - if (!Duplex.prototype[method]) - Duplex.prototype[method] = Writable.prototype[method]; -}); - -function Duplex(options) { - if (!(this instanceof Duplex)) - return new Duplex(options); - - Readable.call(this, options); - Writable.call(this, options); - - if (options && options.readable === false) - this.readable = false; - - if (options && options.writable === false) - this.writable = false; - - this.allowHalfOpen = true; - if (options && options.allowHalfOpen === false) - this.allowHalfOpen = false; - - this.once('end', onend); -} - -// the no-half-open enforcer -function onend() { - // if we allow half-open state, or if the writable side ended, - // then we're ok. - if (this.allowHalfOpen || this._writableState.ended) - return; - - // no more data can be written. - // But allow more writes to happen in this tick. - process.nextTick(this.end.bind(this)); -} - -function forEach (xs, f) { - for (var i = 0, l = xs.length; i < l; i++) { - f(xs[i], i); - } -} diff --git a/deps/npm/node_modules/sorted-union-stream/node_modules/readable-stream/lib/_stream_passthrough.js b/deps/npm/node_modules/sorted-union-stream/node_modules/readable-stream/lib/_stream_passthrough.js deleted file mode 100644 index 895ca50a1d208a..00000000000000 --- a/deps/npm/node_modules/sorted-union-stream/node_modules/readable-stream/lib/_stream_passthrough.js +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - -// a passthrough stream. -// basically just the most minimal sort of Transform stream. -// Every written chunk gets output as-is. - -module.exports = PassThrough; - -var Transform = require('./_stream_transform'); - -/**/ -var util = require('core-util-is'); -util.inherits = require('inherits'); -/**/ - -util.inherits(PassThrough, Transform); - -function PassThrough(options) { - if (!(this instanceof PassThrough)) - return new PassThrough(options); - - Transform.call(this, options); -} - -PassThrough.prototype._transform = function(chunk, encoding, cb) { - cb(null, chunk); -}; diff --git a/deps/npm/node_modules/sorted-union-stream/node_modules/readable-stream/lib/_stream_readable.js b/deps/npm/node_modules/sorted-union-stream/node_modules/readable-stream/lib/_stream_readable.js deleted file mode 100644 index 19ab3588984252..00000000000000 --- a/deps/npm/node_modules/sorted-union-stream/node_modules/readable-stream/lib/_stream_readable.js +++ /dev/null @@ -1,951 +0,0 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - -module.exports = Readable; - -/**/ -var isArray = require('isarray'); -/**/ - - -/**/ -var Buffer = require('buffer').Buffer; -/**/ - -Readable.ReadableState = ReadableState; - -var EE = require('events').EventEmitter; - -/**/ -if (!EE.listenerCount) EE.listenerCount = function(emitter, type) { - return emitter.listeners(type).length; -}; -/**/ - -var Stream = require('stream'); - -/**/ -var util = require('core-util-is'); -util.inherits = require('inherits'); -/**/ - -var StringDecoder; - - -/**/ -var debug = require('util'); -if (debug && debug.debuglog) { - debug = debug.debuglog('stream'); -} else { - debug = function () {}; -} -/**/ - - -util.inherits(Readable, Stream); - -function ReadableState(options, stream) { - var Duplex = require('./_stream_duplex'); - - options = options || {}; - - // the point at which it stops calling _read() to fill the buffer - // Note: 0 is a valid value, means "don't call _read preemptively ever" - var hwm = options.highWaterMark; - var defaultHwm = options.objectMode ? 16 : 16 * 1024; - this.highWaterMark = (hwm || hwm === 0) ? hwm : defaultHwm; - - // cast to ints. - this.highWaterMark = ~~this.highWaterMark; - - this.buffer = []; - this.length = 0; - this.pipes = null; - this.pipesCount = 0; - this.flowing = null; - this.ended = false; - this.endEmitted = false; - this.reading = false; - - // a flag to be able to tell if the onwrite cb is called immediately, - // or on a later tick. We set this to true at first, because any - // actions that shouldn't happen until "later" should generally also - // not happen before the first write call. - this.sync = true; - - // whenever we return null, then we set a flag to say - // that we're awaiting a 'readable' event emission. - this.needReadable = false; - this.emittedReadable = false; - this.readableListening = false; - - - // object stream flag. Used to make read(n) ignore n and to - // make all the buffer merging and length checks go away - this.objectMode = !!options.objectMode; - - if (stream instanceof Duplex) - this.objectMode = this.objectMode || !!options.readableObjectMode; - - // Crypto is kind of old and crusty. Historically, its default string - // encoding is 'binary' so we have to make this configurable. - // Everything else in the universe uses 'utf8', though. - this.defaultEncoding = options.defaultEncoding || 'utf8'; - - // when piping, we only care about 'readable' events that happen - // after read()ing all the bytes and not getting any pushback. - this.ranOut = false; - - // the number of writers that are awaiting a drain event in .pipe()s - this.awaitDrain = 0; - - // if true, a maybeReadMore has been scheduled - this.readingMore = false; - - this.decoder = null; - this.encoding = null; - if (options.encoding) { - if (!StringDecoder) - StringDecoder = require('string_decoder/').StringDecoder; - this.decoder = new StringDecoder(options.encoding); - this.encoding = options.encoding; - } -} - -function Readable(options) { - var Duplex = require('./_stream_duplex'); - - if (!(this instanceof Readable)) - return new Readable(options); - - this._readableState = new ReadableState(options, this); - - // legacy - this.readable = true; - - Stream.call(this); -} - -// Manually shove something into the read() buffer. -// This returns true if the highWaterMark has not been hit yet, -// similar to how Writable.write() returns true if you should -// write() some more. -Readable.prototype.push = function(chunk, encoding) { - var state = this._readableState; - - if (util.isString(chunk) && !state.objectMode) { - encoding = encoding || state.defaultEncoding; - if (encoding !== state.encoding) { - chunk = new Buffer(chunk, encoding); - encoding = ''; - } - } - - return readableAddChunk(this, state, chunk, encoding, false); -}; - -// Unshift should *always* be something directly out of read() -Readable.prototype.unshift = function(chunk) { - var state = this._readableState; - return readableAddChunk(this, state, chunk, '', true); -}; - -function readableAddChunk(stream, state, chunk, encoding, addToFront) { - var er = chunkInvalid(state, chunk); - if (er) { - stream.emit('error', er); - } else if (util.isNullOrUndefined(chunk)) { - state.reading = false; - if (!state.ended) - onEofChunk(stream, state); - } else if (state.objectMode || chunk && chunk.length > 0) { - if (state.ended && !addToFront) { - var e = new Error('stream.push() after EOF'); - stream.emit('error', e); - } else if (state.endEmitted && addToFront) { - var e = new Error('stream.unshift() after end event'); - stream.emit('error', e); - } else { - if (state.decoder && !addToFront && !encoding) - chunk = state.decoder.write(chunk); - - if (!addToFront) - state.reading = false; - - // if we want the data now, just emit it. - if (state.flowing && state.length === 0 && !state.sync) { - stream.emit('data', chunk); - stream.read(0); - } else { - // update the buffer info. - state.length += state.objectMode ? 1 : chunk.length; - if (addToFront) - state.buffer.unshift(chunk); - else - state.buffer.push(chunk); - - if (state.needReadable) - emitReadable(stream); - } - - maybeReadMore(stream, state); - } - } else if (!addToFront) { - state.reading = false; - } - - return needMoreData(state); -} - - - -// if it's past the high water mark, we can push in some more. -// Also, if we have no data yet, we can stand some -// more bytes. This is to work around cases where hwm=0, -// such as the repl. Also, if the push() triggered a -// readable event, and the user called read(largeNumber) such that -// needReadable was set, then we ought to push more, so that another -// 'readable' event will be triggered. -function needMoreData(state) { - return !state.ended && - (state.needReadable || - state.length < state.highWaterMark || - state.length === 0); -} - -// backwards compatibility. -Readable.prototype.setEncoding = function(enc) { - if (!StringDecoder) - StringDecoder = require('string_decoder/').StringDecoder; - this._readableState.decoder = new StringDecoder(enc); - this._readableState.encoding = enc; - return this; -}; - -// Don't raise the hwm > 128MB -var MAX_HWM = 0x800000; -function roundUpToNextPowerOf2(n) { - if (n >= MAX_HWM) { - n = MAX_HWM; - } else { - // Get the next highest power of 2 - n--; - for (var p = 1; p < 32; p <<= 1) n |= n >> p; - n++; - } - return n; -} - -function howMuchToRead(n, state) { - if (state.length === 0 && state.ended) - return 0; - - if (state.objectMode) - return n === 0 ? 0 : 1; - - if (isNaN(n) || util.isNull(n)) { - // only flow one buffer at a time - if (state.flowing && state.buffer.length) - return state.buffer[0].length; - else - return state.length; - } - - if (n <= 0) - return 0; - - // If we're asking for more than the target buffer level, - // then raise the water mark. Bump up to the next highest - // power of 2, to prevent increasing it excessively in tiny - // amounts. - if (n > state.highWaterMark) - state.highWaterMark = roundUpToNextPowerOf2(n); - - // don't have that much. return null, unless we've ended. - if (n > state.length) { - if (!state.ended) { - state.needReadable = true; - return 0; - } else - return state.length; - } - - return n; -} - -// you can override either this method, or the async _read(n) below. -Readable.prototype.read = function(n) { - debug('read', n); - var state = this._readableState; - var nOrig = n; - - if (!util.isNumber(n) || n > 0) - state.emittedReadable = false; - - // if we're doing read(0) to trigger a readable event, but we - // already have a bunch of data in the buffer, then just trigger - // the 'readable' event and move on. - if (n === 0 && - state.needReadable && - (state.length >= state.highWaterMark || state.ended)) { - debug('read: emitReadable', state.length, state.ended); - if (state.length === 0 && state.ended) - endReadable(this); - else - emitReadable(this); - return null; - } - - n = howMuchToRead(n, state); - - // if we've ended, and we're now clear, then finish it up. - if (n === 0 && state.ended) { - if (state.length === 0) - endReadable(this); - return null; - } - - // All the actual chunk generation logic needs to be - // *below* the call to _read. The reason is that in certain - // synthetic stream cases, such as passthrough streams, _read - // may be a completely synchronous operation which may change - // the state of the read buffer, providing enough data when - // before there was *not* enough. - // - // So, the steps are: - // 1. Figure out what the state of things will be after we do - // a read from the buffer. - // - // 2. If that resulting state will trigger a _read, then call _read. - // Note that this may be asynchronous, or synchronous. Yes, it is - // deeply ugly to write APIs this way, but that still doesn't mean - // that the Readable class should behave improperly, as streams are - // designed to be sync/async agnostic. - // Take note if the _read call is sync or async (ie, if the read call - // has returned yet), so that we know whether or not it's safe to emit - // 'readable' etc. - // - // 3. Actually pull the requested chunks out of the buffer and return. - - // if we need a readable event, then we need to do some reading. - var doRead = state.needReadable; - debug('need readable', doRead); - - // if we currently have less than the highWaterMark, then also read some - if (state.length === 0 || state.length - n < state.highWaterMark) { - doRead = true; - debug('length less than watermark', doRead); - } - - // however, if we've ended, then there's no point, and if we're already - // reading, then it's unnecessary. - if (state.ended || state.reading) { - doRead = false; - debug('reading or ended', doRead); - } - - if (doRead) { - debug('do read'); - state.reading = true; - state.sync = true; - // if the length is currently zero, then we *need* a readable event. - if (state.length === 0) - state.needReadable = true; - // call internal read method - this._read(state.highWaterMark); - state.sync = false; - } - - // If _read pushed data synchronously, then `reading` will be false, - // and we need to re-evaluate how much data we can return to the user. - if (doRead && !state.reading) - n = howMuchToRead(nOrig, state); - - var ret; - if (n > 0) - ret = fromList(n, state); - else - ret = null; - - if (util.isNull(ret)) { - state.needReadable = true; - n = 0; - } - - state.length -= n; - - // If we have nothing in the buffer, then we want to know - // as soon as we *do* get something into the buffer. - if (state.length === 0 && !state.ended) - state.needReadable = true; - - // If we tried to read() past the EOF, then emit end on the next tick. - if (nOrig !== n && state.ended && state.length === 0) - endReadable(this); - - if (!util.isNull(ret)) - this.emit('data', ret); - - return ret; -}; - -function chunkInvalid(state, chunk) { - var er = null; - if (!util.isBuffer(chunk) && - !util.isString(chunk) && - !util.isNullOrUndefined(chunk) && - !state.objectMode) { - er = new TypeError('Invalid non-string/buffer chunk'); - } - return er; -} - - -function onEofChunk(stream, state) { - if (state.decoder && !state.ended) { - var chunk = state.decoder.end(); - if (chunk && chunk.length) { - state.buffer.push(chunk); - state.length += state.objectMode ? 1 : chunk.length; - } - } - state.ended = true; - - // emit 'readable' now to make sure it gets picked up. - emitReadable(stream); -} - -// Don't emit readable right away in sync mode, because this can trigger -// another read() call => stack overflow. This way, it might trigger -// a nextTick recursion warning, but that's not so bad. -function emitReadable(stream) { - var state = stream._readableState; - state.needReadable = false; - if (!state.emittedReadable) { - debug('emitReadable', state.flowing); - state.emittedReadable = true; - if (state.sync) - process.nextTick(function() { - emitReadable_(stream); - }); - else - emitReadable_(stream); - } -} - -function emitReadable_(stream) { - debug('emit readable'); - stream.emit('readable'); - flow(stream); -} - - -// at this point, the user has presumably seen the 'readable' event, -// and called read() to consume some data. that may have triggered -// in turn another _read(n) call, in which case reading = true if -// it's in progress. -// However, if we're not ended, or reading, and the length < hwm, -// then go ahead and try to read some more preemptively. -function maybeReadMore(stream, state) { - if (!state.readingMore) { - state.readingMore = true; - process.nextTick(function() { - maybeReadMore_(stream, state); - }); - } -} - -function maybeReadMore_(stream, state) { - var len = state.length; - while (!state.reading && !state.flowing && !state.ended && - state.length < state.highWaterMark) { - debug('maybeReadMore read 0'); - stream.read(0); - if (len === state.length) - // didn't get any data, stop spinning. - break; - else - len = state.length; - } - state.readingMore = false; -} - -// abstract method. to be overridden in specific implementation classes. -// call cb(er, data) where data is <= n in length. -// for virtual (non-string, non-buffer) streams, "length" is somewhat -// arbitrary, and perhaps not very meaningful. -Readable.prototype._read = function(n) { - this.emit('error', new Error('not implemented')); -}; - -Readable.prototype.pipe = function(dest, pipeOpts) { - var src = this; - var state = this._readableState; - - switch (state.pipesCount) { - case 0: - state.pipes = dest; - break; - case 1: - state.pipes = [state.pipes, dest]; - break; - default: - state.pipes.push(dest); - break; - } - state.pipesCount += 1; - debug('pipe count=%d opts=%j', state.pipesCount, pipeOpts); - - var doEnd = (!pipeOpts || pipeOpts.end !== false) && - dest !== process.stdout && - dest !== process.stderr; - - var endFn = doEnd ? onend : cleanup; - if (state.endEmitted) - process.nextTick(endFn); - else - src.once('end', endFn); - - dest.on('unpipe', onunpipe); - function onunpipe(readable) { - debug('onunpipe'); - if (readable === src) { - cleanup(); - } - } - - function onend() { - debug('onend'); - dest.end(); - } - - // when the dest drains, it reduces the awaitDrain counter - // on the source. This would be more elegant with a .once() - // handler in flow(), but adding and removing repeatedly is - // too slow. - var ondrain = pipeOnDrain(src); - dest.on('drain', ondrain); - - function cleanup() { - debug('cleanup'); - // cleanup event handlers once the pipe is broken - dest.removeListener('close', onclose); - dest.removeListener('finish', onfinish); - dest.removeListener('drain', ondrain); - dest.removeListener('error', onerror); - dest.removeListener('unpipe', onunpipe); - src.removeListener('end', onend); - src.removeListener('end', cleanup); - src.removeListener('data', ondata); - - // if the reader is waiting for a drain event from this - // specific writer, then it would cause it to never start - // flowing again. - // So, if this is awaiting a drain, then we just call it now. - // If we don't know, then assume that we are waiting for one. - if (state.awaitDrain && - (!dest._writableState || dest._writableState.needDrain)) - ondrain(); - } - - src.on('data', ondata); - function ondata(chunk) { - debug('ondata'); - var ret = dest.write(chunk); - if (false === ret) { - debug('false write response, pause', - src._readableState.awaitDrain); - src._readableState.awaitDrain++; - src.pause(); - } - } - - // if the dest has an error, then stop piping into it. - // however, don't suppress the throwing behavior for this. - function onerror(er) { - debug('onerror', er); - unpipe(); - dest.removeListener('error', onerror); - if (EE.listenerCount(dest, 'error') === 0) - dest.emit('error', er); - } - // This is a brutally ugly hack to make sure that our error handler - // is attached before any userland ones. NEVER DO THIS. - if (!dest._events || !dest._events.error) - dest.on('error', onerror); - else if (isArray(dest._events.error)) - dest._events.error.unshift(onerror); - else - dest._events.error = [onerror, dest._events.error]; - - - - // Both close and finish should trigger unpipe, but only once. - function onclose() { - dest.removeListener('finish', onfinish); - unpipe(); - } - dest.once('close', onclose); - function onfinish() { - debug('onfinish'); - dest.removeListener('close', onclose); - unpipe(); - } - dest.once('finish', onfinish); - - function unpipe() { - debug('unpipe'); - src.unpipe(dest); - } - - // tell the dest that it's being piped to - dest.emit('pipe', src); - - // start the flow if it hasn't been started already. - if (!state.flowing) { - debug('pipe resume'); - src.resume(); - } - - return dest; -}; - -function pipeOnDrain(src) { - return function() { - var state = src._readableState; - debug('pipeOnDrain', state.awaitDrain); - if (state.awaitDrain) - state.awaitDrain--; - if (state.awaitDrain === 0 && EE.listenerCount(src, 'data')) { - state.flowing = true; - flow(src); - } - }; -} - - -Readable.prototype.unpipe = function(dest) { - var state = this._readableState; - - // if we're not piping anywhere, then do nothing. - if (state.pipesCount === 0) - return this; - - // just one destination. most common case. - if (state.pipesCount === 1) { - // passed in one, but it's not the right one. - if (dest && dest !== state.pipes) - return this; - - if (!dest) - dest = state.pipes; - - // got a match. - state.pipes = null; - state.pipesCount = 0; - state.flowing = false; - if (dest) - dest.emit('unpipe', this); - return this; - } - - // slow case. multiple pipe destinations. - - if (!dest) { - // remove all. - var dests = state.pipes; - var len = state.pipesCount; - state.pipes = null; - state.pipesCount = 0; - state.flowing = false; - - for (var i = 0; i < len; i++) - dests[i].emit('unpipe', this); - return this; - } - - // try to find the right one. - var i = indexOf(state.pipes, dest); - if (i === -1) - return this; - - state.pipes.splice(i, 1); - state.pipesCount -= 1; - if (state.pipesCount === 1) - state.pipes = state.pipes[0]; - - dest.emit('unpipe', this); - - return this; -}; - -// set up data events if they are asked for -// Ensure readable listeners eventually get something -Readable.prototype.on = function(ev, fn) { - var res = Stream.prototype.on.call(this, ev, fn); - - // If listening to data, and it has not explicitly been paused, - // then call resume to start the flow of data on the next tick. - if (ev === 'data' && false !== this._readableState.flowing) { - this.resume(); - } - - if (ev === 'readable' && this.readable) { - var state = this._readableState; - if (!state.readableListening) { - state.readableListening = true; - state.emittedReadable = false; - state.needReadable = true; - if (!state.reading) { - var self = this; - process.nextTick(function() { - debug('readable nexttick read 0'); - self.read(0); - }); - } else if (state.length) { - emitReadable(this, state); - } - } - } - - return res; -}; -Readable.prototype.addListener = Readable.prototype.on; - -// pause() and resume() are remnants of the legacy readable stream API -// If the user uses them, then switch into old mode. -Readable.prototype.resume = function() { - var state = this._readableState; - if (!state.flowing) { - debug('resume'); - state.flowing = true; - if (!state.reading) { - debug('resume read 0'); - this.read(0); - } - resume(this, state); - } - return this; -}; - -function resume(stream, state) { - if (!state.resumeScheduled) { - state.resumeScheduled = true; - process.nextTick(function() { - resume_(stream, state); - }); - } -} - -function resume_(stream, state) { - state.resumeScheduled = false; - stream.emit('resume'); - flow(stream); - if (state.flowing && !state.reading) - stream.read(0); -} - -Readable.prototype.pause = function() { - debug('call pause flowing=%j', this._readableState.flowing); - if (false !== this._readableState.flowing) { - debug('pause'); - this._readableState.flowing = false; - this.emit('pause'); - } - return this; -}; - -function flow(stream) { - var state = stream._readableState; - debug('flow', state.flowing); - if (state.flowing) { - do { - var chunk = stream.read(); - } while (null !== chunk && state.flowing); - } -} - -// wrap an old-style stream as the async data source. -// This is *not* part of the readable stream interface. -// It is an ugly unfortunate mess of history. -Readable.prototype.wrap = function(stream) { - var state = this._readableState; - var paused = false; - - var self = this; - stream.on('end', function() { - debug('wrapped end'); - if (state.decoder && !state.ended) { - var chunk = state.decoder.end(); - if (chunk && chunk.length) - self.push(chunk); - } - - self.push(null); - }); - - stream.on('data', function(chunk) { - debug('wrapped data'); - if (state.decoder) - chunk = state.decoder.write(chunk); - if (!chunk || !state.objectMode && !chunk.length) - return; - - var ret = self.push(chunk); - if (!ret) { - paused = true; - stream.pause(); - } - }); - - // proxy all the other methods. - // important when wrapping filters and duplexes. - for (var i in stream) { - if (util.isFunction(stream[i]) && util.isUndefined(this[i])) { - this[i] = function(method) { return function() { - return stream[method].apply(stream, arguments); - }}(i); - } - } - - // proxy certain important events. - var events = ['error', 'close', 'destroy', 'pause', 'resume']; - forEach(events, function(ev) { - stream.on(ev, self.emit.bind(self, ev)); - }); - - // when we try to consume some more bytes, simply unpause the - // underlying stream. - self._read = function(n) { - debug('wrapped _read', n); - if (paused) { - paused = false; - stream.resume(); - } - }; - - return self; -}; - - - -// exposed for testing purposes only. -Readable._fromList = fromList; - -// Pluck off n bytes from an array of buffers. -// Length is the combined lengths of all the buffers in the list. -function fromList(n, state) { - var list = state.buffer; - var length = state.length; - var stringMode = !!state.decoder; - var objectMode = !!state.objectMode; - var ret; - - // nothing in the list, definitely empty. - if (list.length === 0) - return null; - - if (length === 0) - ret = null; - else if (objectMode) - ret = list.shift(); - else if (!n || n >= length) { - // read it all, truncate the array. - if (stringMode) - ret = list.join(''); - else - ret = Buffer.concat(list, length); - list.length = 0; - } else { - // read just some of it. - if (n < list[0].length) { - // just take a part of the first list item. - // slice is the same for buffers and strings. - var buf = list[0]; - ret = buf.slice(0, n); - list[0] = buf.slice(n); - } else if (n === list[0].length) { - // first list is a perfect match - ret = list.shift(); - } else { - // complex case. - // we have enough to cover it, but it spans past the first buffer. - if (stringMode) - ret = ''; - else - ret = new Buffer(n); - - var c = 0; - for (var i = 0, l = list.length; i < l && c < n; i++) { - var buf = list[0]; - var cpy = Math.min(n - c, buf.length); - - if (stringMode) - ret += buf.slice(0, cpy); - else - buf.copy(ret, c, 0, cpy); - - if (cpy < buf.length) - list[0] = buf.slice(cpy); - else - list.shift(); - - c += cpy; - } - } - } - - return ret; -} - -function endReadable(stream) { - var state = stream._readableState; - - // If we get here before consuming all the bytes, then that is a - // bug in node. Should never happen. - if (state.length > 0) - throw new Error('endReadable called on non-empty stream'); - - if (!state.endEmitted) { - state.ended = true; - process.nextTick(function() { - // Check that we didn't get one last unshift. - if (!state.endEmitted && state.length === 0) { - state.endEmitted = true; - stream.readable = false; - stream.emit('end'); - } - }); - } -} - -function forEach (xs, f) { - for (var i = 0, l = xs.length; i < l; i++) { - f(xs[i], i); - } -} - -function indexOf (xs, x) { - for (var i = 0, l = xs.length; i < l; i++) { - if (xs[i] === x) return i; - } - return -1; -} diff --git a/deps/npm/node_modules/sorted-union-stream/node_modules/readable-stream/lib/_stream_transform.js b/deps/npm/node_modules/sorted-union-stream/node_modules/readable-stream/lib/_stream_transform.js deleted file mode 100644 index 905c5e450758b3..00000000000000 --- a/deps/npm/node_modules/sorted-union-stream/node_modules/readable-stream/lib/_stream_transform.js +++ /dev/null @@ -1,209 +0,0 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - - -// a transform stream is a readable/writable stream where you do -// something with the data. Sometimes it's called a "filter", -// but that's not a great name for it, since that implies a thing where -// some bits pass through, and others are simply ignored. (That would -// be a valid example of a transform, of course.) -// -// While the output is causally related to the input, it's not a -// necessarily symmetric or synchronous transformation. For example, -// a zlib stream might take multiple plain-text writes(), and then -// emit a single compressed chunk some time in the future. -// -// Here's how this works: -// -// The Transform stream has all the aspects of the readable and writable -// stream classes. When you write(chunk), that calls _write(chunk,cb) -// internally, and returns false if there's a lot of pending writes -// buffered up. When you call read(), that calls _read(n) until -// there's enough pending readable data buffered up. -// -// In a transform stream, the written data is placed in a buffer. When -// _read(n) is called, it transforms the queued up data, calling the -// buffered _write cb's as it consumes chunks. If consuming a single -// written chunk would result in multiple output chunks, then the first -// outputted bit calls the readcb, and subsequent chunks just go into -// the read buffer, and will cause it to emit 'readable' if necessary. -// -// This way, back-pressure is actually determined by the reading side, -// since _read has to be called to start processing a new chunk. However, -// a pathological inflate type of transform can cause excessive buffering -// here. For example, imagine a stream where every byte of input is -// interpreted as an integer from 0-255, and then results in that many -// bytes of output. Writing the 4 bytes {ff,ff,ff,ff} would result in -// 1kb of data being output. In this case, you could write a very small -// amount of input, and end up with a very large amount of output. In -// such a pathological inflating mechanism, there'd be no way to tell -// the system to stop doing the transform. A single 4MB write could -// cause the system to run out of memory. -// -// However, even in such a pathological case, only a single written chunk -// would be consumed, and then the rest would wait (un-transformed) until -// the results of the previous transformed chunk were consumed. - -module.exports = Transform; - -var Duplex = require('./_stream_duplex'); - -/**/ -var util = require('core-util-is'); -util.inherits = require('inherits'); -/**/ - -util.inherits(Transform, Duplex); - - -function TransformState(options, stream) { - this.afterTransform = function(er, data) { - return afterTransform(stream, er, data); - }; - - this.needTransform = false; - this.transforming = false; - this.writecb = null; - this.writechunk = null; -} - -function afterTransform(stream, er, data) { - var ts = stream._transformState; - ts.transforming = false; - - var cb = ts.writecb; - - if (!cb) - return stream.emit('error', new Error('no writecb in Transform class')); - - ts.writechunk = null; - ts.writecb = null; - - if (!util.isNullOrUndefined(data)) - stream.push(data); - - if (cb) - cb(er); - - var rs = stream._readableState; - rs.reading = false; - if (rs.needReadable || rs.length < rs.highWaterMark) { - stream._read(rs.highWaterMark); - } -} - - -function Transform(options) { - if (!(this instanceof Transform)) - return new Transform(options); - - Duplex.call(this, options); - - this._transformState = new TransformState(options, this); - - // when the writable side finishes, then flush out anything remaining. - var stream = this; - - // start out asking for a readable event once data is transformed. - this._readableState.needReadable = true; - - // we have implemented the _read method, and done the other things - // that Readable wants before the first _read call, so unset the - // sync guard flag. - this._readableState.sync = false; - - this.once('prefinish', function() { - if (util.isFunction(this._flush)) - this._flush(function(er) { - done(stream, er); - }); - else - done(stream); - }); -} - -Transform.prototype.push = function(chunk, encoding) { - this._transformState.needTransform = false; - return Duplex.prototype.push.call(this, chunk, encoding); -}; - -// This is the part where you do stuff! -// override this function in implementation classes. -// 'chunk' is an input chunk. -// -// Call `push(newChunk)` to pass along transformed output -// to the readable side. You may call 'push' zero or more times. -// -// Call `cb(err)` when you are done with this chunk. If you pass -// an error, then that'll put the hurt on the whole operation. If you -// never call cb(), then you'll never get another chunk. -Transform.prototype._transform = function(chunk, encoding, cb) { - throw new Error('not implemented'); -}; - -Transform.prototype._write = function(chunk, encoding, cb) { - var ts = this._transformState; - ts.writecb = cb; - ts.writechunk = chunk; - ts.writeencoding = encoding; - if (!ts.transforming) { - var rs = this._readableState; - if (ts.needTransform || - rs.needReadable || - rs.length < rs.highWaterMark) - this._read(rs.highWaterMark); - } -}; - -// Doesn't matter what the args are here. -// _transform does all the work. -// That we got here means that the readable side wants more data. -Transform.prototype._read = function(n) { - var ts = this._transformState; - - if (!util.isNull(ts.writechunk) && ts.writecb && !ts.transforming) { - ts.transforming = true; - this._transform(ts.writechunk, ts.writeencoding, ts.afterTransform); - } else { - // mark that we need a transform, so that any data that comes in - // will get processed, now that we've asked for it. - ts.needTransform = true; - } -}; - - -function done(stream, er) { - if (er) - return stream.emit('error', er); - - // if there's nothing in the write buffer, then that means - // that nothing more will ever be provided - var ws = stream._writableState; - var ts = stream._transformState; - - if (ws.length) - throw new Error('calling transform done when ws.length != 0'); - - if (ts.transforming) - throw new Error('calling transform done when still transforming'); - - return stream.push(null); -} diff --git a/deps/npm/node_modules/sorted-union-stream/node_modules/readable-stream/lib/_stream_writable.js b/deps/npm/node_modules/sorted-union-stream/node_modules/readable-stream/lib/_stream_writable.js deleted file mode 100644 index db8539cd5b818d..00000000000000 --- a/deps/npm/node_modules/sorted-union-stream/node_modules/readable-stream/lib/_stream_writable.js +++ /dev/null @@ -1,477 +0,0 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - -// A bit simpler than readable streams. -// Implement an async ._write(chunk, cb), and it'll handle all -// the drain event emission and buffering. - -module.exports = Writable; - -/**/ -var Buffer = require('buffer').Buffer; -/**/ - -Writable.WritableState = WritableState; - - -/**/ -var util = require('core-util-is'); -util.inherits = require('inherits'); -/**/ - -var Stream = require('stream'); - -util.inherits(Writable, Stream); - -function WriteReq(chunk, encoding, cb) { - this.chunk = chunk; - this.encoding = encoding; - this.callback = cb; -} - -function WritableState(options, stream) { - var Duplex = require('./_stream_duplex'); - - options = options || {}; - - // the point at which write() starts returning false - // Note: 0 is a valid value, means that we always return false if - // the entire buffer is not flushed immediately on write() - var hwm = options.highWaterMark; - var defaultHwm = options.objectMode ? 16 : 16 * 1024; - this.highWaterMark = (hwm || hwm === 0) ? hwm : defaultHwm; - - // object stream flag to indicate whether or not this stream - // contains buffers or objects. - this.objectMode = !!options.objectMode; - - if (stream instanceof Duplex) - this.objectMode = this.objectMode || !!options.writableObjectMode; - - // cast to ints. - this.highWaterMark = ~~this.highWaterMark; - - this.needDrain = false; - // at the start of calling end() - this.ending = false; - // when end() has been called, and returned - this.ended = false; - // when 'finish' is emitted - this.finished = false; - - // should we decode strings into buffers before passing to _write? - // this is here so that some node-core streams can optimize string - // handling at a lower level. - var noDecode = options.decodeStrings === false; - this.decodeStrings = !noDecode; - - // Crypto is kind of old and crusty. Historically, its default string - // encoding is 'binary' so we have to make this configurable. - // Everything else in the universe uses 'utf8', though. - this.defaultEncoding = options.defaultEncoding || 'utf8'; - - // not an actual buffer we keep track of, but a measurement - // of how much we're waiting to get pushed to some underlying - // socket or file. - this.length = 0; - - // a flag to see when we're in the middle of a write. - this.writing = false; - - // when true all writes will be buffered until .uncork() call - this.corked = 0; - - // a flag to be able to tell if the onwrite cb is called immediately, - // or on a later tick. We set this to true at first, because any - // actions that shouldn't happen until "later" should generally also - // not happen before the first write call. - this.sync = true; - - // a flag to know if we're processing previously buffered items, which - // may call the _write() callback in the same tick, so that we don't - // end up in an overlapped onwrite situation. - this.bufferProcessing = false; - - // the callback that's passed to _write(chunk,cb) - this.onwrite = function(er) { - onwrite(stream, er); - }; - - // the callback that the user supplies to write(chunk,encoding,cb) - this.writecb = null; - - // the amount that is being written when _write is called. - this.writelen = 0; - - this.buffer = []; - - // number of pending user-supplied write callbacks - // this must be 0 before 'finish' can be emitted - this.pendingcb = 0; - - // emit prefinish if the only thing we're waiting for is _write cbs - // This is relevant for synchronous Transform streams - this.prefinished = false; - - // True if the error was already emitted and should not be thrown again - this.errorEmitted = false; -} - -function Writable(options) { - var Duplex = require('./_stream_duplex'); - - // Writable ctor is applied to Duplexes, though they're not - // instanceof Writable, they're instanceof Readable. - if (!(this instanceof Writable) && !(this instanceof Duplex)) - return new Writable(options); - - this._writableState = new WritableState(options, this); - - // legacy. - this.writable = true; - - Stream.call(this); -} - -// Otherwise people can pipe Writable streams, which is just wrong. -Writable.prototype.pipe = function() { - this.emit('error', new Error('Cannot pipe. Not readable.')); -}; - - -function writeAfterEnd(stream, state, cb) { - var er = new Error('write after end'); - // TODO: defer error events consistently everywhere, not just the cb - stream.emit('error', er); - process.nextTick(function() { - cb(er); - }); -} - -// If we get something that is not a buffer, string, null, or undefined, -// and we're not in objectMode, then that's an error. -// Otherwise stream chunks are all considered to be of length=1, and the -// watermarks determine how many objects to keep in the buffer, rather than -// how many bytes or characters. -function validChunk(stream, state, chunk, cb) { - var valid = true; - if (!util.isBuffer(chunk) && - !util.isString(chunk) && - !util.isNullOrUndefined(chunk) && - !state.objectMode) { - var er = new TypeError('Invalid non-string/buffer chunk'); - stream.emit('error', er); - process.nextTick(function() { - cb(er); - }); - valid = false; - } - return valid; -} - -Writable.prototype.write = function(chunk, encoding, cb) { - var state = this._writableState; - var ret = false; - - if (util.isFunction(encoding)) { - cb = encoding; - encoding = null; - } - - if (util.isBuffer(chunk)) - encoding = 'buffer'; - else if (!encoding) - encoding = state.defaultEncoding; - - if (!util.isFunction(cb)) - cb = function() {}; - - if (state.ended) - writeAfterEnd(this, state, cb); - else if (validChunk(this, state, chunk, cb)) { - state.pendingcb++; - ret = writeOrBuffer(this, state, chunk, encoding, cb); - } - - return ret; -}; - -Writable.prototype.cork = function() { - var state = this._writableState; - - state.corked++; -}; - -Writable.prototype.uncork = function() { - var state = this._writableState; - - if (state.corked) { - state.corked--; - - if (!state.writing && - !state.corked && - !state.finished && - !state.bufferProcessing && - state.buffer.length) - clearBuffer(this, state); - } -}; - -function decodeChunk(state, chunk, encoding) { - if (!state.objectMode && - state.decodeStrings !== false && - util.isString(chunk)) { - chunk = new Buffer(chunk, encoding); - } - return chunk; -} - -// if we're already writing something, then just put this -// in the queue, and wait our turn. Otherwise, call _write -// If we return false, then we need a drain event, so set that flag. -function writeOrBuffer(stream, state, chunk, encoding, cb) { - chunk = decodeChunk(state, chunk, encoding); - if (util.isBuffer(chunk)) - encoding = 'buffer'; - var len = state.objectMode ? 1 : chunk.length; - - state.length += len; - - var ret = state.length < state.highWaterMark; - // we must ensure that previous needDrain will not be reset to false. - if (!ret) - state.needDrain = true; - - if (state.writing || state.corked) - state.buffer.push(new WriteReq(chunk, encoding, cb)); - else - doWrite(stream, state, false, len, chunk, encoding, cb); - - return ret; -} - -function doWrite(stream, state, writev, len, chunk, encoding, cb) { - state.writelen = len; - state.writecb = cb; - state.writing = true; - state.sync = true; - if (writev) - stream._writev(chunk, state.onwrite); - else - stream._write(chunk, encoding, state.onwrite); - state.sync = false; -} - -function onwriteError(stream, state, sync, er, cb) { - if (sync) - process.nextTick(function() { - state.pendingcb--; - cb(er); - }); - else { - state.pendingcb--; - cb(er); - } - - stream._writableState.errorEmitted = true; - stream.emit('error', er); -} - -function onwriteStateUpdate(state) { - state.writing = false; - state.writecb = null; - state.length -= state.writelen; - state.writelen = 0; -} - -function onwrite(stream, er) { - var state = stream._writableState; - var sync = state.sync; - var cb = state.writecb; - - onwriteStateUpdate(state); - - if (er) - onwriteError(stream, state, sync, er, cb); - else { - // Check if we're actually ready to finish, but don't emit yet - var finished = needFinish(stream, state); - - if (!finished && - !state.corked && - !state.bufferProcessing && - state.buffer.length) { - clearBuffer(stream, state); - } - - if (sync) { - process.nextTick(function() { - afterWrite(stream, state, finished, cb); - }); - } else { - afterWrite(stream, state, finished, cb); - } - } -} - -function afterWrite(stream, state, finished, cb) { - if (!finished) - onwriteDrain(stream, state); - state.pendingcb--; - cb(); - finishMaybe(stream, state); -} - -// Must force callback to be called on nextTick, so that we don't -// emit 'drain' before the write() consumer gets the 'false' return -// value, and has a chance to attach a 'drain' listener. -function onwriteDrain(stream, state) { - if (state.length === 0 && state.needDrain) { - state.needDrain = false; - stream.emit('drain'); - } -} - - -// if there's something in the buffer waiting, then process it -function clearBuffer(stream, state) { - state.bufferProcessing = true; - - if (stream._writev && state.buffer.length > 1) { - // Fast case, write everything using _writev() - var cbs = []; - for (var c = 0; c < state.buffer.length; c++) - cbs.push(state.buffer[c].callback); - - // count the one we are adding, as well. - // TODO(isaacs) clean this up - state.pendingcb++; - doWrite(stream, state, true, state.length, state.buffer, '', function(err) { - for (var i = 0; i < cbs.length; i++) { - state.pendingcb--; - cbs[i](err); - } - }); - - // Clear buffer - state.buffer = []; - } else { - // Slow case, write chunks one-by-one - for (var c = 0; c < state.buffer.length; c++) { - var entry = state.buffer[c]; - var chunk = entry.chunk; - var encoding = entry.encoding; - var cb = entry.callback; - var len = state.objectMode ? 1 : chunk.length; - - doWrite(stream, state, false, len, chunk, encoding, cb); - - // if we didn't call the onwrite immediately, then - // it means that we need to wait until it does. - // also, that means that the chunk and cb are currently - // being processed, so move the buffer counter past them. - if (state.writing) { - c++; - break; - } - } - - if (c < state.buffer.length) - state.buffer = state.buffer.slice(c); - else - state.buffer.length = 0; - } - - state.bufferProcessing = false; -} - -Writable.prototype._write = function(chunk, encoding, cb) { - cb(new Error('not implemented')); - -}; - -Writable.prototype._writev = null; - -Writable.prototype.end = function(chunk, encoding, cb) { - var state = this._writableState; - - if (util.isFunction(chunk)) { - cb = chunk; - chunk = null; - encoding = null; - } else if (util.isFunction(encoding)) { - cb = encoding; - encoding = null; - } - - if (!util.isNullOrUndefined(chunk)) - this.write(chunk, encoding); - - // .end() fully uncorks - if (state.corked) { - state.corked = 1; - this.uncork(); - } - - // ignore unnecessary end() calls. - if (!state.ending && !state.finished) - endWritable(this, state, cb); -}; - - -function needFinish(stream, state) { - return (state.ending && - state.length === 0 && - !state.finished && - !state.writing); -} - -function prefinish(stream, state) { - if (!state.prefinished) { - state.prefinished = true; - stream.emit('prefinish'); - } -} - -function finishMaybe(stream, state) { - var need = needFinish(stream, state); - if (need) { - if (state.pendingcb === 0) { - prefinish(stream, state); - state.finished = true; - stream.emit('finish'); - } else - prefinish(stream, state); - } - return need; -} - -function endWritable(stream, state, cb) { - state.ending = true; - finishMaybe(stream, state); - if (cb) { - if (state.finished) - process.nextTick(cb); - else - stream.once('finish', cb); - } - state.ended = true; -} diff --git a/deps/npm/node_modules/sorted-union-stream/node_modules/readable-stream/package.json b/deps/npm/node_modules/sorted-union-stream/node_modules/readable-stream/package.json deleted file mode 100644 index c09cce6e070d2e..00000000000000 --- a/deps/npm/node_modules/sorted-union-stream/node_modules/readable-stream/package.json +++ /dev/null @@ -1,65 +0,0 @@ -{ - "_from": "readable-stream@~1.1.10", - "_id": "readable-stream@1.1.14", - "_inBundle": false, - "_integrity": "sha1-fPTFTvZI44EwhMY23SB54WbAgdk=", - "_location": "/sorted-union-stream/readable-stream", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "readable-stream@~1.1.10", - "name": "readable-stream", - "escapedName": "readable-stream", - "rawSpec": "~1.1.10", - "saveSpec": null, - "fetchSpec": "~1.1.10" - }, - "_requiredBy": [ - "/sorted-union-stream/from2" - ], - "_resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz", - "_shasum": "7cf4c54ef648e3813084c636dd2079e166c081d9", - "_spec": "readable-stream@~1.1.10", - "_where": "/Users/rebecca/code/npm/node_modules/sorted-union-stream/node_modules/from2", - "author": { - "name": "Isaac Z. Schlueter", - "email": "i@izs.me", - "url": "http://blog.izs.me/" - }, - "browser": { - "util": false - }, - "bugs": { - "url": "https://github.com/isaacs/readable-stream/issues" - }, - "bundleDependencies": false, - "dependencies": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.1", - "isarray": "0.0.1", - "string_decoder": "~0.10.x" - }, - "deprecated": false, - "description": "Streams3, a user-land copy of the stream library from Node.js v0.11.x", - "devDependencies": { - "tap": "~0.2.6" - }, - "homepage": "https://github.com/isaacs/readable-stream#readme", - "keywords": [ - "readable", - "stream", - "pipe" - ], - "license": "MIT", - "main": "readable.js", - "name": "readable-stream", - "repository": { - "type": "git", - "url": "git://github.com/isaacs/readable-stream.git" - }, - "scripts": { - "test": "tap test/simple/*.js" - }, - "version": "1.1.14" -} diff --git a/deps/npm/node_modules/sorted-union-stream/node_modules/readable-stream/passthrough.js b/deps/npm/node_modules/sorted-union-stream/node_modules/readable-stream/passthrough.js deleted file mode 100644 index 27e8d8a55165f9..00000000000000 --- a/deps/npm/node_modules/sorted-union-stream/node_modules/readable-stream/passthrough.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require("./lib/_stream_passthrough.js") diff --git a/deps/npm/node_modules/sorted-union-stream/node_modules/readable-stream/readable.js b/deps/npm/node_modules/sorted-union-stream/node_modules/readable-stream/readable.js deleted file mode 100644 index 2a8b5c6b56336f..00000000000000 --- a/deps/npm/node_modules/sorted-union-stream/node_modules/readable-stream/readable.js +++ /dev/null @@ -1,10 +0,0 @@ -exports = module.exports = require('./lib/_stream_readable.js'); -exports.Stream = require('stream'); -exports.Readable = exports; -exports.Writable = require('./lib/_stream_writable.js'); -exports.Duplex = require('./lib/_stream_duplex.js'); -exports.Transform = require('./lib/_stream_transform.js'); -exports.PassThrough = require('./lib/_stream_passthrough.js'); -if (!process.browser && process.env.READABLE_STREAM === 'disable') { - module.exports = require('stream'); -} diff --git a/deps/npm/node_modules/sorted-union-stream/node_modules/readable-stream/transform.js b/deps/npm/node_modules/sorted-union-stream/node_modules/readable-stream/transform.js deleted file mode 100644 index 5d482f0780e993..00000000000000 --- a/deps/npm/node_modules/sorted-union-stream/node_modules/readable-stream/transform.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require("./lib/_stream_transform.js") diff --git a/deps/npm/node_modules/sorted-union-stream/node_modules/readable-stream/writable.js b/deps/npm/node_modules/sorted-union-stream/node_modules/readable-stream/writable.js deleted file mode 100644 index e1e9efdf3c12e9..00000000000000 --- a/deps/npm/node_modules/sorted-union-stream/node_modules/readable-stream/writable.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require("./lib/_stream_writable.js") diff --git a/deps/npm/node_modules/sorted-union-stream/node_modules/string_decoder/.npmignore b/deps/npm/node_modules/sorted-union-stream/node_modules/string_decoder/.npmignore deleted file mode 100644 index 206320cc1d21b9..00000000000000 --- a/deps/npm/node_modules/sorted-union-stream/node_modules/string_decoder/.npmignore +++ /dev/null @@ -1,2 +0,0 @@ -build -test diff --git a/deps/npm/node_modules/sorted-union-stream/node_modules/string_decoder/LICENSE b/deps/npm/node_modules/sorted-union-stream/node_modules/string_decoder/LICENSE deleted file mode 100644 index 6de584a48f5c89..00000000000000 --- a/deps/npm/node_modules/sorted-union-stream/node_modules/string_decoder/LICENSE +++ /dev/null @@ -1,20 +0,0 @@ -Copyright Joyent, Inc. and other Node contributors. - -Permission is hereby granted, free of charge, to any person obtaining a -copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to permit -persons to whom the Software is furnished to do so, subject to the -following conditions: - -The above copyright notice and this permission notice shall be included -in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/deps/npm/node_modules/sorted-union-stream/node_modules/string_decoder/README.md b/deps/npm/node_modules/sorted-union-stream/node_modules/string_decoder/README.md deleted file mode 100644 index 4d2aa001501107..00000000000000 --- a/deps/npm/node_modules/sorted-union-stream/node_modules/string_decoder/README.md +++ /dev/null @@ -1,7 +0,0 @@ -**string_decoder.js** (`require('string_decoder')`) from Node.js core - -Copyright Joyent, Inc. and other Node contributors. See LICENCE file for details. - -Version numbers match the versions found in Node core, e.g. 0.10.24 matches Node 0.10.24, likewise 0.11.10 matches Node 0.11.10. **Prefer the stable version over the unstable.** - -The *build/* directory contains a build script that will scrape the source from the [joyent/node](https://github.com/joyent/node) repo given a specific Node version. \ No newline at end of file diff --git a/deps/npm/node_modules/sorted-union-stream/node_modules/string_decoder/index.js b/deps/npm/node_modules/sorted-union-stream/node_modules/string_decoder/index.js deleted file mode 100644 index b00e54fb790982..00000000000000 --- a/deps/npm/node_modules/sorted-union-stream/node_modules/string_decoder/index.js +++ /dev/null @@ -1,221 +0,0 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - -var Buffer = require('buffer').Buffer; - -var isBufferEncoding = Buffer.isEncoding - || function(encoding) { - switch (encoding && encoding.toLowerCase()) { - case 'hex': case 'utf8': case 'utf-8': case 'ascii': case 'binary': case 'base64': case 'ucs2': case 'ucs-2': case 'utf16le': case 'utf-16le': case 'raw': return true; - default: return false; - } - } - - -function assertEncoding(encoding) { - if (encoding && !isBufferEncoding(encoding)) { - throw new Error('Unknown encoding: ' + encoding); - } -} - -// StringDecoder provides an interface for efficiently splitting a series of -// buffers into a series of JS strings without breaking apart multi-byte -// characters. CESU-8 is handled as part of the UTF-8 encoding. -// -// @TODO Handling all encodings inside a single object makes it very difficult -// to reason about this code, so it should be split up in the future. -// @TODO There should be a utf8-strict encoding that rejects invalid UTF-8 code -// points as used by CESU-8. -var StringDecoder = exports.StringDecoder = function(encoding) { - this.encoding = (encoding || 'utf8').toLowerCase().replace(/[-_]/, ''); - assertEncoding(encoding); - switch (this.encoding) { - case 'utf8': - // CESU-8 represents each of Surrogate Pair by 3-bytes - this.surrogateSize = 3; - break; - case 'ucs2': - case 'utf16le': - // UTF-16 represents each of Surrogate Pair by 2-bytes - this.surrogateSize = 2; - this.detectIncompleteChar = utf16DetectIncompleteChar; - break; - case 'base64': - // Base-64 stores 3 bytes in 4 chars, and pads the remainder. - this.surrogateSize = 3; - this.detectIncompleteChar = base64DetectIncompleteChar; - break; - default: - this.write = passThroughWrite; - return; - } - - // Enough space to store all bytes of a single character. UTF-8 needs 4 - // bytes, but CESU-8 may require up to 6 (3 bytes per surrogate). - this.charBuffer = new Buffer(6); - // Number of bytes received for the current incomplete multi-byte character. - this.charReceived = 0; - // Number of bytes expected for the current incomplete multi-byte character. - this.charLength = 0; -}; - - -// write decodes the given buffer and returns it as JS string that is -// guaranteed to not contain any partial multi-byte characters. Any partial -// character found at the end of the buffer is buffered up, and will be -// returned when calling write again with the remaining bytes. -// -// Note: Converting a Buffer containing an orphan surrogate to a String -// currently works, but converting a String to a Buffer (via `new Buffer`, or -// Buffer#write) will replace incomplete surrogates with the unicode -// replacement character. See https://codereview.chromium.org/121173009/ . -StringDecoder.prototype.write = function(buffer) { - var charStr = ''; - // if our last write ended with an incomplete multibyte character - while (this.charLength) { - // determine how many remaining bytes this buffer has to offer for this char - var available = (buffer.length >= this.charLength - this.charReceived) ? - this.charLength - this.charReceived : - buffer.length; - - // add the new bytes to the char buffer - buffer.copy(this.charBuffer, this.charReceived, 0, available); - this.charReceived += available; - - if (this.charReceived < this.charLength) { - // still not enough chars in this buffer? wait for more ... - return ''; - } - - // remove bytes belonging to the current character from the buffer - buffer = buffer.slice(available, buffer.length); - - // get the character that was split - charStr = this.charBuffer.slice(0, this.charLength).toString(this.encoding); - - // CESU-8: lead surrogate (D800-DBFF) is also the incomplete character - var charCode = charStr.charCodeAt(charStr.length - 1); - if (charCode >= 0xD800 && charCode <= 0xDBFF) { - this.charLength += this.surrogateSize; - charStr = ''; - continue; - } - this.charReceived = this.charLength = 0; - - // if there are no more bytes in this buffer, just emit our char - if (buffer.length === 0) { - return charStr; - } - break; - } - - // determine and set charLength / charReceived - this.detectIncompleteChar(buffer); - - var end = buffer.length; - if (this.charLength) { - // buffer the incomplete character bytes we got - buffer.copy(this.charBuffer, 0, buffer.length - this.charReceived, end); - end -= this.charReceived; - } - - charStr += buffer.toString(this.encoding, 0, end); - - var end = charStr.length - 1; - var charCode = charStr.charCodeAt(end); - // CESU-8: lead surrogate (D800-DBFF) is also the incomplete character - if (charCode >= 0xD800 && charCode <= 0xDBFF) { - var size = this.surrogateSize; - this.charLength += size; - this.charReceived += size; - this.charBuffer.copy(this.charBuffer, size, 0, size); - buffer.copy(this.charBuffer, 0, 0, size); - return charStr.substring(0, end); - } - - // or just emit the charStr - return charStr; -}; - -// detectIncompleteChar determines if there is an incomplete UTF-8 character at -// the end of the given buffer. If so, it sets this.charLength to the byte -// length that character, and sets this.charReceived to the number of bytes -// that are available for this character. -StringDecoder.prototype.detectIncompleteChar = function(buffer) { - // determine how many bytes we have to check at the end of this buffer - var i = (buffer.length >= 3) ? 3 : buffer.length; - - // Figure out if one of the last i bytes of our buffer announces an - // incomplete char. - for (; i > 0; i--) { - var c = buffer[buffer.length - i]; - - // See http://en.wikipedia.org/wiki/UTF-8#Description - - // 110XXXXX - if (i == 1 && c >> 5 == 0x06) { - this.charLength = 2; - break; - } - - // 1110XXXX - if (i <= 2 && c >> 4 == 0x0E) { - this.charLength = 3; - break; - } - - // 11110XXX - if (i <= 3 && c >> 3 == 0x1E) { - this.charLength = 4; - break; - } - } - this.charReceived = i; -}; - -StringDecoder.prototype.end = function(buffer) { - var res = ''; - if (buffer && buffer.length) - res = this.write(buffer); - - if (this.charReceived) { - var cr = this.charReceived; - var buf = this.charBuffer; - var enc = this.encoding; - res += buf.slice(0, cr).toString(enc); - } - - return res; -}; - -function passThroughWrite(buffer) { - return buffer.toString(this.encoding); -} - -function utf16DetectIncompleteChar(buffer) { - this.charReceived = buffer.length % 2; - this.charLength = this.charReceived ? 2 : 0; -} - -function base64DetectIncompleteChar(buffer) { - this.charReceived = buffer.length % 3; - this.charLength = this.charReceived ? 3 : 0; -} diff --git a/deps/npm/node_modules/sorted-union-stream/node_modules/string_decoder/package.json b/deps/npm/node_modules/sorted-union-stream/node_modules/string_decoder/package.json deleted file mode 100644 index 3c7014f039245d..00000000000000 --- a/deps/npm/node_modules/sorted-union-stream/node_modules/string_decoder/package.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "_from": "string_decoder@~0.10.x", - "_id": "string_decoder@0.10.31", - "_inBundle": false, - "_integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=", - "_location": "/sorted-union-stream/string_decoder", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "string_decoder@~0.10.x", - "name": "string_decoder", - "escapedName": "string_decoder", - "rawSpec": "~0.10.x", - "saveSpec": null, - "fetchSpec": "~0.10.x" - }, - "_requiredBy": [ - "/sorted-union-stream/readable-stream" - ], - "_resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", - "_shasum": "62e203bc41766c6c28c9fc84301dab1c5310fa94", - "_spec": "string_decoder@~0.10.x", - "_where": "/Users/rebecca/code/npm/node_modules/sorted-union-stream/node_modules/readable-stream", - "bugs": { - "url": "https://github.com/rvagg/string_decoder/issues" - }, - "bundleDependencies": false, - "dependencies": {}, - "deprecated": false, - "description": "The string_decoder module from Node core", - "devDependencies": { - "tap": "~0.4.8" - }, - "homepage": "https://github.com/rvagg/string_decoder", - "keywords": [ - "string", - "decoder", - "browser", - "browserify" - ], - "license": "MIT", - "main": "index.js", - "name": "string_decoder", - "repository": { - "type": "git", - "url": "git://github.com/rvagg/string_decoder.git" - }, - "scripts": { - "test": "tap test/simple/*.js" - }, - "version": "0.10.31" -} diff --git a/deps/npm/node_modules/sorted-union-stream/package.json b/deps/npm/node_modules/sorted-union-stream/package.json deleted file mode 100644 index dd56c35d7fc224..00000000000000 --- a/deps/npm/node_modules/sorted-union-stream/package.json +++ /dev/null @@ -1,66 +0,0 @@ -{ - "_args": [ - [ - "sorted-union-stream@2.1.3", - "/Users/rebecca/code/npm" - ] - ], - "_from": "sorted-union-stream@2.1.3", - "_id": "sorted-union-stream@2.1.3", - "_inBundle": false, - "_integrity": "sha1-x3lMfgd4gAUv9xqNSi27Sppjisc=", - "_location": "/sorted-union-stream", - "_phantomChildren": { - "core-util-is": "1.0.2", - "inherits": "2.0.3" - }, - "_requested": { - "type": "version", - "registry": true, - "raw": "sorted-union-stream@2.1.3", - "name": "sorted-union-stream", - "escapedName": "sorted-union-stream", - "rawSpec": "2.1.3", - "saveSpec": null, - "fetchSpec": "2.1.3" - }, - "_requiredBy": [ - "/" - ], - "_resolved": "https://registry.npmjs.org/sorted-union-stream/-/sorted-union-stream-2.1.3.tgz", - "_spec": "2.1.3", - "_where": "/Users/rebecca/code/npm", - "author": { - "name": "Mathias Buus Madsen", - "email": "mathiasbuus@gmail.com" - }, - "bugs": { - "url": "https://github.com/mafintosh/sorted-union-stream/issues" - }, - "dependencies": { - "from2": "^1.3.0", - "stream-iterate": "^1.1.0" - }, - "description": "Get the union of two sorted streams", - "devDependencies": { - "standard": "^3.3.0", - "tape": "^3.0.0" - }, - "homepage": "https://github.com/mafintosh/sorted-union-stream", - "keywords": [ - "union", - "sorted", - "stream" - ], - "license": "MIT", - "main": "index.js", - "name": "sorted-union-stream", - "repository": { - "type": "git", - "url": "git://github.com/mafintosh/sorted-union-stream.git" - }, - "scripts": { - "test": "tape test.js" - }, - "version": "2.1.3" -} diff --git a/deps/npm/node_modules/sorted-union-stream/test.js b/deps/npm/node_modules/sorted-union-stream/test.js deleted file mode 100644 index 488e10f3abeae3..00000000000000 --- a/deps/npm/node_modules/sorted-union-stream/test.js +++ /dev/null @@ -1,154 +0,0 @@ -var Readable = require('stream').Readable -var tape = require('tape') -var union = require('./') - -tape('numbers', function (t) { - var a = new Readable({objectMode: true}) - var b = new Readable({objectMode: true}) - a._read = b._read = function () {} - - a.push(4) - a.push(6) - a.push(10) - a.push(14) - a.push(15) - a.push(20) - a.push(22) - a.push(null) - - b.push(6) - b.push(11) - b.push(20) - b.push(null) - - var u = union(a, b) - var expected = [4, 6, 10, 11, 14, 15, 20, 22] - - u.on('data', function (data) { - t.same(data, expected.shift()) - }) - - u.on('end', function () { - t.same(expected.length, 0, 'no more data') - t.end() - }) -}) - -tape('string', function (t) { - var a = new Readable({objectMode: true}) - var b = new Readable({objectMode: true}) - a._read = b._read = function () {} - - a.push('04') - a.push('06') - a.push('10') - a.push('14') - a.push('15') - a.push('20') - a.push('22') - a.push(null) - - b.push('06') - b.push('11') - b.push('20') - b.push(null) - - var u = union(a, b) - var expected = ['04', '06', '10', '11', '14', '15', '20', '22'] - - u.on('data', function (data) { - t.same(data, expected.shift()) - }) - - u.on('end', function () { - t.same(expected.length, 0, 'no more data') - t.end() - }) -}) - -tape('objects', function (t) { - var a = new Readable({objectMode: true}) - var b = new Readable({objectMode: true}) - a._read = b._read = function () {} - - a.push({key: '04'}) - a.push({key: '06'}) - a.push({key: '10'}) - a.push({key: '14'}) - a.push({key: '15'}) - a.push({key: '20'}) - a.push({key: '22'}) - a.push(null) - - b.push({key: '06'}) - b.push({key: '11'}) - b.push({key: '20'}) - b.push(null) - - var u = union(a, b) - var expected = [{key: '04'}, {key: '06'}, {key: '10'}, {key: '11'}, {key: '14'}, {key: '15'}, {key: '20'}, {key: '22'}] - - u.on('data', function (data) { - t.same(data, expected.shift()) - }) - - u.on('end', function () { - t.same(expected.length, 0, 'no more data') - t.end() - }) -}) - -tape('custom objects', function (t) { - var a = new Readable({objectMode: true}) - var b = new Readable({objectMode: true}) - a._read = b._read = function () {} - - a.push({bar: '04'}) - a.push({bar: '06'}) - a.push({bar: '10'}) - a.push({bar: '14'}) - a.push({bar: '15'}) - a.push({bar: '20'}) - a.push({bar: '22'}) - a.push(null) - - b.push({bar: '06'}) - b.push({bar: '11'}) - b.push({bar: '20'}) - b.push(null) - - var u = union(a, b, function (data) { - return data.bar - }) - - var expected = [{bar: '04'}, {bar: '06'}, {bar: '10'}, {bar: '11'}, {bar: '14'}, {bar: '15'}, {bar: '20'}, {bar: '22'}] - - u.on('data', function (data) { - t.same(data, expected.shift()) - }) - - u.on('end', function () { - t.same(expected.length, 0, 'no more data') - t.end() - }) -}) - -tape('destroy stream', function (t) { - var a = new Readable({objectMode: true}) - var b = new Readable({objectMode: true}) - - a._read = function () {} - b._read = function () {} - - t.plan(2) - - a.destroy = function () { - t.ok(true) - } - - b.destroy = function () { - t.ok(true) - } - - union(a, b).destroy() -}) diff --git a/deps/npm/node_modules/spdx-correct/README.md b/deps/npm/node_modules/spdx-correct/README.md index 4169e61e193448..ab388cf9406486 100644 --- a/deps/npm/node_modules/spdx-correct/README.md +++ b/deps/npm/node_modules/spdx-correct/README.md @@ -7,4 +7,8 @@ assert.equal(correct('mit'), 'MIT') assert.equal(correct('Apache 2'), 'Apache-2.0') assert(correct('No idea what license') === null) + +// disable upgrade option +assert(correct('GPL-3.0'), 'GPL-3.0-or-later') +assert(correct('GPL-3.0', { upgrade: false }), 'GPL-3.0') ``` diff --git a/deps/npm/node_modules/spdx-correct/index.js b/deps/npm/node_modules/spdx-correct/index.js index a5ff877bc0e41f..c51a79f5d1c80a 100644 --- a/deps/npm/node_modules/spdx-correct/index.js +++ b/deps/npm/node_modules/spdx-correct/index.js @@ -1,5 +1,5 @@ /* -Copyright 2015 Kyle E. Mitchell +Copyright spdx-correct.js contributors Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -49,6 +49,7 @@ var transpositions = [ ['GNU GENERAL PUBLIC LICENSE', 'GPL'], ['MTI', 'MIT'], ['Mozilla Public License', 'MPL'], + ['Universal Permissive License', 'UPL'], ['WTH', 'WTF'], ['-License', ''] ] @@ -138,6 +139,26 @@ var transforms = [ function (argument) { return argument.replace(/(-| )clause(-| )(\d)/, '-$3-Clause') }, + // e.g. 'New BSD license' + function (argument) { + return argument.replace(/\b(Modified|New|Revised)(-| )?BSD((-| )License)?/i, 'BSD-3-Clause') + }, + // e.g. 'Simplified BSD license' + function (argument) { + return argument.replace(/\bSimplified(-| )?BSD((-| )License)?/i, 'BSD-2-Clause') + }, + // e.g. 'Free BSD license' + function (argument) { + return argument.replace(/\b(Free|Net)(-| )?BSD((-| )License)?/i, 'BSD-2-Clause-$1BSD') + }, + // e.g. 'Clear BSD license' + function (argument) { + return argument.replace(/\bClear(-| )?BSD((-| )License)?/i, 'BSD-3-Clause-Clear') + }, + // e.g. 'Old BSD License' + function (argument) { + return argument.replace(/\b(Old|Original)(-| )?BSD((-| )License)?/i, 'BSD-4-Clause') + }, // e.g. 'BY-NC-4.0' function (argument) { return 'CC-' + argument @@ -224,7 +245,9 @@ var lastResorts = [ ['GNU', 'GPL-3.0-or-later'], ['LGPL', 'LGPL-3.0-or-later'], ['GPLV1', 'GPL-1.0-only'], + ['GPL-1', 'GPL-1.0-only'], ['GPLV2', 'GPL-2.0-only'], + ['GPL-2', 'GPL-2.0-only'], ['GPL', 'GPL-3.0-or-later'], ['MIT +NO-FALSE-ATTRIBS', 'MITNFA'], ['MIT', 'MIT'], @@ -275,7 +298,12 @@ var anyCorrection = function (identifier, check) { return null } -module.exports = function (identifier) { +module.exports = function (identifier, options) { + options = options || {} + var upgrade = options.upgrade === undefined ? true : !!options.upgrade + function postprocess (value) { + return upgrade ? upgradeGPLs(value) : value + } var validArugment = ( typeof identifier === 'string' && identifier.trim().length !== 0 @@ -283,13 +311,17 @@ module.exports = function (identifier) { if (!validArugment) { throw Error('Invalid argument. Expected non-empty string.') } - identifier = identifier.replace(/\+$/, '').trim() + identifier = identifier.trim() if (valid(identifier)) { - return upgradeGPLs(identifier) + return postprocess(identifier) + } + var noPlus = identifier.replace(/\+$/, '').trim() + if (valid(noPlus)) { + return postprocess(noPlus) } var transformed = validTransformation(identifier) if (transformed !== null) { - return upgradeGPLs(transformed) + return postprocess(transformed) } transformed = anyCorrection(identifier, function (argument) { if (valid(argument)) { @@ -298,15 +330,15 @@ module.exports = function (identifier) { return validTransformation(argument) }) if (transformed !== null) { - return upgradeGPLs(transformed) + return postprocess(transformed) } transformed = validLastResort(identifier) if (transformed !== null) { - return upgradeGPLs(transformed) + return postprocess(transformed) } transformed = anyCorrection(identifier, validLastResort) if (transformed !== null) { - return upgradeGPLs(transformed) + return postprocess(transformed) } return null } @@ -318,6 +350,12 @@ function upgradeGPLs (value) { 'LGPL-2.1' ].indexOf(value) !== -1) { return value + '-only' + } else if ([ + 'GPL-1.0+', 'GPL-2.0+', 'GPL-3.0+', + 'LGPL-2.0+', 'LGPL-2.1+', 'LGPL-3.0+', + 'AGPL-1.0+', 'AGPL-3.0+' + ].indexOf(value) !== -1) { + return value.replace(/\+$/, '-or-later') } else if (['GPL-3.0', 'LGPL-3.0', 'AGPL-3.0'].indexOf(value) !== -1) { return value + '-or-later' } else { diff --git a/deps/npm/node_modules/spdx-correct/package.json b/deps/npm/node_modules/spdx-correct/package.json index c252d65f9a7159..35c68bdaa6c61a 100644 --- a/deps/npm/node_modules/spdx-correct/package.json +++ b/deps/npm/node_modules/spdx-correct/package.json @@ -1,53 +1,18 @@ { - "_from": "spdx-correct@^3.0.0", - "_id": "spdx-correct@3.0.0", - "_inBundle": false, - "_integrity": "sha512-N19o9z5cEyc8yQQPukRCZ9EUmb4HUpnrmaL/fxS2pBo2jbfcFRVuFZ/oFC+vZz0MNNk0h80iMn5/S6qGZOL5+g==", - "_location": "/spdx-correct", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "spdx-correct@^3.0.0", - "name": "spdx-correct", - "escapedName": "spdx-correct", - "rawSpec": "^3.0.0", - "saveSpec": null, - "fetchSpec": "^3.0.0" - }, - "_requiredBy": [ - "/validate-npm-package-license" - ], - "_resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.0.0.tgz", - "_shasum": "05a5b4d7153a195bc92c3c425b69f3b2a9524c82", - "_spec": "spdx-correct@^3.0.0", - "_where": "/Users/rebecca/code/npm/node_modules/validate-npm-package-license", - "author": { - "name": "Kyle E. Mitchell", - "email": "kyle@kemitchell.com", - "url": "https://kemitchell.com" - }, - "bugs": { - "url": "https://github.com/jslicense/spdx-correct.js/issues" - }, - "bundleDependencies": false, + "name": "spdx-correct", + "description": "correct invalid SPDX expressions", + "version": "3.1.1", + "author": "Kyle E. Mitchell (https://kemitchell.com)", "contributors": [ - { - "name": "Kyle E. Mitchell", - "email": "kyle@kemitchell.com", - "url": "https://kemitchell.com" - }, - { - "name": "Christian Zommerfelds", - "email": "aero_super@yahoo.com" - } + "Kyle E. Mitchell (https://kemitchell.com)", + "Christian Zommerfelds ", + "Tal Einat ", + "Dan Butvinik " ], "dependencies": { "spdx-expression-parse": "^3.0.0", "spdx-license-ids": "^3.0.0" }, - "deprecated": false, - "description": "correct invalid SPDX expressions", "devDependencies": { "defence-cli": "^2.0.1", "replace-require-self": "^1.0.0", @@ -58,7 +23,6 @@ "files": [ "index.js" ], - "homepage": "https://github.com/jslicense/spdx-correct.js#readme", "keywords": [ "SPDX", "law", @@ -67,14 +31,9 @@ "metadata" ], "license": "Apache-2.0", - "name": "spdx-correct", - "repository": { - "type": "git", - "url": "git+https://github.com/jslicense/spdx-correct.js.git" - }, + "repository": "jslicense/spdx-correct.js", "scripts": { - "lint": "standard && standard-markdown", + "lint": "standard && standard-markdown README.md", "test": "defence README.md | replace-require-self | node && node test.js" - }, - "version": "3.0.0" + } } diff --git a/deps/npm/node_modules/spdx-exceptions/index.json b/deps/npm/node_modules/spdx-exceptions/index.json index 6981ce38458f93..f88f088ab2fa16 100644 --- a/deps/npm/node_modules/spdx-exceptions/index.json +++ b/deps/npm/node_modules/spdx-exceptions/index.json @@ -4,26 +4,37 @@ "Autoconf-exception-3.0", "Bison-exception-2.2", "Bootloader-exception", - "CLISP-exception-2.0", "Classpath-exception-2.0", + "CLISP-exception-2.0", "DigiRule-FOSS-exception", - "FLTK-exception", + "eCos-exception-2.0", "Fawkes-Runtime-exception", + "FLTK-exception", "Font-exception-2.0", + "freertos-exception-2.0", "GCC-exception-2.0", "GCC-exception-3.1", - "LZMA-exception", + "gnu-javamail-exception", + "GPL-3.0-linking-exception", + "GPL-3.0-linking-source-exception", + "GPL-CC-1.0", + "i2p-gpl-java-exception", "Libtool-exception", "Linux-syscall-note", + "LLVM-exception", + "LZMA-exception", + "mif-exception", "Nokia-Qt-exception-1.1", + "OCaml-LGPL-linking-exception", "OCCT-exception-1.0", - "Qwt-exception-1.0", - "WxWindows-exception-3.1", - "eCos-exception-2.0", - "freertos-exception-2.0", - "gnu-javamail-exception", - "i2p-gpl-java-exception", - "mif-exception", + "OpenJDK-assembly-exception-1.0", "openvpn-openssl-exception", - "u-boot-exception-2.0" + "PS-or-PDF-font-exception-20170817", + "Qt-GPL-exception-1.0", + "Qt-LGPL-exception-1.1", + "Qwt-exception-1.0", + "Swift-exception", + "u-boot-exception-2.0", + "Universal-FOSS-exception-1.0", + "WxWindows-exception-3.1" ] diff --git a/deps/npm/node_modules/spdx-exceptions/package.json b/deps/npm/node_modules/spdx-exceptions/package.json index e674073b7d435d..2bafc6a38b2431 100644 --- a/deps/npm/node_modules/spdx-exceptions/package.json +++ b/deps/npm/node_modules/spdx-exceptions/package.json @@ -1,49 +1,17 @@ { - "_from": "spdx-exceptions@^2.1.0", - "_id": "spdx-exceptions@2.1.0", - "_inBundle": false, - "_integrity": "sha512-4K1NsmrlCU1JJgUrtgEeTVyfx8VaYea9J9LvARxhbHtVtohPs/gFGG5yy49beySjlIMhhXZ4QqujIZEfS4l6Cg==", - "_location": "/spdx-exceptions", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "spdx-exceptions@^2.1.0", - "name": "spdx-exceptions", - "escapedName": "spdx-exceptions", - "rawSpec": "^2.1.0", - "saveSpec": null, - "fetchSpec": "^2.1.0" - }, - "_requiredBy": [ - "/spdx-expression-parse" - ], - "_resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.1.0.tgz", - "_shasum": "2c7ae61056c714a5b9b9b2b2af7d311ef5c78fe9", - "_spec": "spdx-exceptions@^2.1.0", - "_where": "/Users/rebecca/code/npm/node_modules/spdx-expression-parse", - "author": { - "name": "The Linux Foundation" - }, - "bugs": { - "url": "https://github.com/kemitchell/spdx-exceptions.json/issues" - }, - "bundleDependencies": false, + "name": "spdx-exceptions", + "description": "list of SPDX standard license exceptions", + "version": "2.3.0", + "author": "The Linux Foundation", "contributors": [ - { - "name": "Kyle E. Mitchell", - "email": "kyle@kemitchell.com", - "url": "https://kemitchell.com/" - } + "Kyle E. Mitchell (https://kemitchell.com/)" ], - "deprecated": false, - "description": "list of SPDX standard license exceptions", - "homepage": "https://github.com/kemitchell/spdx-exceptions.json#readme", "license": "CC-BY-3.0", - "name": "spdx-exceptions", - "repository": { - "type": "git", - "url": "git+https://github.com/kemitchell/spdx-exceptions.json.git" - }, - "version": "2.1.0" + "repository": "kemitchell/spdx-exceptions.json", + "files": [ + "index.json" + ], + "scripts": { + "build": "node build.js" + } } diff --git a/deps/npm/node_modules/spdx-expression-parse/README.md b/deps/npm/node_modules/spdx-expression-parse/README.md index 514895b7d31c86..9406462e3cff33 100644 --- a/deps/npm/node_modules/spdx-expression-parse/README.md +++ b/deps/npm/node_modules/spdx-expression-parse/README.md @@ -39,7 +39,7 @@ The syntax comes from the [Software Package Data eXchange (SPDX)](https://spdx.o The bulk of the SPDX standard describes syntax and semantics of XML metadata files. This package implements two lightweight, plain-text components of that larger standard: -1. The [license list](https://spdx.org/licenses), a mapping from specific string identifiers, like `Apache-2.0`, to standard form license texts and bolt-on license exceptions. The [spdx-license-ids](https://www.npmjs.com/package/spdx-exceptions) and [spdx-exceptions](https://www.npmjs.com/package/spdx-license-ids) packages implement the license list. `spdx-expression-parse` depends on and `require()`s them. +1. The [license list](https://spdx.org/licenses), a mapping from specific string identifiers, like `Apache-2.0`, to standard form license texts and bolt-on license exceptions. The [spdx-license-ids](https://www.npmjs.com/package/spdx-license-ids) and [spdx-exceptions](https://www.npmjs.com/package/spdx-exceptions) packages implement the license list. `spdx-expression-parse` depends on and `require()`s them. Any license identifier from the license list is a valid license expression: diff --git a/deps/npm/node_modules/spdx-expression-parse/package.json b/deps/npm/node_modules/spdx-expression-parse/package.json index 8f7fa1d268858d..c9edc9f939cdf6 100644 --- a/deps/npm/node_modules/spdx-expression-parse/package.json +++ b/deps/npm/node_modules/spdx-expression-parse/package.json @@ -1,76 +1,23 @@ { - "_from": "spdx-expression-parse@^3.0.0", - "_id": "spdx-expression-parse@3.0.0", - "_inBundle": false, - "_integrity": "sha512-Yg6D3XpRD4kkOmTpdgbUiEJFKghJH03fiC1OPll5h/0sO6neh2jqRDVHOQ4o/LMea0tgCkbMgea5ip/e+MkWyg==", - "_location": "/spdx-expression-parse", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "spdx-expression-parse@^3.0.0", - "name": "spdx-expression-parse", - "escapedName": "spdx-expression-parse", - "rawSpec": "^3.0.0", - "saveSpec": null, - "fetchSpec": "^3.0.0" - }, - "_requiredBy": [ - "/spdx-correct", - "/validate-npm-package-license" - ], - "_resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.0.tgz", - "_shasum": "99e119b7a5da00e05491c9fa338b7904823b41d0", - "_spec": "spdx-expression-parse@^3.0.0", - "_where": "/Users/rebecca/code/npm/node_modules/validate-npm-package-license", - "author": { - "name": "Kyle E. Mitchell", - "email": "kyle@kemitchell.com", - "url": "http://kemitchell.com" - }, - "bugs": { - "url": "https://github.com/jslicense/spdx-expression-parse.js/issues" - }, - "bundleDependencies": false, - "contributors": [ - { - "name": "C. Scott Ananian", - "email": "cscott@cscott.net", - "url": "http://cscott.net" - }, - { - "name": "Kyle E. Mitchell", - "email": "kyle@kemitchell.com", - "url": "https://kemitchell.com" - }, - { - "name": "Shinnosuke Watanabe", - "email": "snnskwtnb@gmail.com" - }, - { - "name": "Antoine Motet", - "email": "antoine.motet@gmail.com" - } + "name": "spdx-expression-parse", + "description": "parse SPDX license expressions", + "version": "3.0.1", + "author": "Kyle E. Mitchell (https://kemitchell.com)", + "files": [ + "AUTHORS", + "index.js", + "parse.js", + "scan.js" ], "dependencies": { "spdx-exceptions": "^2.1.0", "spdx-license-ids": "^3.0.0" }, - "deprecated": false, - "description": "parse SPDX license expressions", "devDependencies": { - "defence-cli": "^2.0.1", - "mocha": "^3.4.2", + "defence-cli": "^3.0.1", "replace-require-self": "^1.0.0", - "standard": "^10.0.2" + "standard": "^14.1.0" }, - "files": [ - "AUTHORS", - "index.js", - "parse.js", - "scan.js" - ], - "homepage": "https://github.com/jslicense/spdx-expression-parse.js#readme", "keywords": [ "SPDX", "law", @@ -82,16 +29,11 @@ "standards" ], "license": "MIT", - "name": "spdx-expression-parse", - "repository": { - "type": "git", - "url": "git+https://github.com/jslicense/spdx-expression-parse.js.git" - }, + "repository": "jslicense/spdx-expression-parse.js", "scripts": { "lint": "standard", - "test": "npm run test:mocha && npm run test:readme", - "test:mocha": "mocha test/index.js", - "test:readme": "defence -i javascript README.md | replace-require-self | node" - }, - "version": "3.0.0" + "test:readme": "defence -i javascript README.md | replace-require-self | node", + "test:suite": "node test.js", + "test": "npm run test:suite && npm run test:readme" + } } diff --git a/deps/npm/node_modules/spdx-expression-parse/parse.js b/deps/npm/node_modules/spdx-expression-parse/parse.js index a4a52ce93c7c04..5a00b45c5799c4 100644 --- a/deps/npm/node_modules/spdx-expression-parse/parse.js +++ b/deps/npm/node_modules/spdx-expression-parse/parse.js @@ -60,7 +60,7 @@ module.exports = function (tokens) { if (t.type === 'LICENSEREF') { next() string += 'LicenseRef-' + t.string - return {license: string} + return { license: string } } index = begin } @@ -69,7 +69,7 @@ module.exports = function (tokens) { var t = token() if (t && t.type === 'LICENSE') { next() - var node = {license: t.string} + var node = { license: t.string } if (parseOperator('+')) { node.plus = true } diff --git a/deps/npm/node_modules/spdx-expression-parse/scan.js b/deps/npm/node_modules/spdx-expression-parse/scan.js index d0567f494b5e59..b74fce2e2c6632 100644 --- a/deps/npm/node_modules/spdx-expression-parse/scan.js +++ b/deps/npm/node_modules/spdx-expression-parse/scan.js @@ -70,14 +70,14 @@ module.exports = function (source) { function documentRef () { if (read('DocumentRef-')) { var string = expectIdstring() - return {type: 'DOCUMENTREF', string: string} + return { type: 'DOCUMENTREF', string: string } } } function licenseRef () { if (read('LicenseRef-')) { var string = expectIdstring() - return {type: 'LICENSEREF', string: string} + return { type: 'LICENSEREF', string: string } } } diff --git a/deps/npm/node_modules/spdx-license-ids/deprecated.json b/deps/npm/node_modules/spdx-license-ids/deprecated.json index 1681f4870d5d96..c7de09858ff350 100644 --- a/deps/npm/node_modules/spdx-license-ids/deprecated.json +++ b/deps/npm/node_modules/spdx-license-ids/deprecated.json @@ -1,6 +1,8 @@ [ "AGPL-1.0", "AGPL-3.0", + "BSD-2-Clause-FreeBSD", + "BSD-2-Clause-NetBSD", "GFDL-1.1", "GFDL-1.2", "GFDL-1.3", diff --git a/deps/npm/node_modules/spdx-license-ids/index.json b/deps/npm/node_modules/spdx-license-ids/index.json index 5283c78dc77c31..de204732913a72 100644 --- a/deps/npm/node_modules/spdx-license-ids/index.json +++ b/deps/npm/node_modules/spdx-license-ids/index.json @@ -35,9 +35,8 @@ "Artistic-2.0", "BSD-1-Clause", "BSD-2-Clause", - "BSD-2-Clause-FreeBSD", - "BSD-2-Clause-NetBSD", "BSD-2-Clause-Patent", + "BSD-2-Clause-Views", "BSD-3-Clause", "BSD-3-Clause-Attribution", "BSD-3-Clause-Clear", @@ -58,11 +57,14 @@ "BitTorrent-1.1", "BlueOak-1.0.0", "Borceux", + "CAL-1.0", + "CAL-1.0-Combined-Work-Exception", "CATOSL-1.1", "CC-BY-1.0", "CC-BY-2.0", "CC-BY-2.5", "CC-BY-3.0", + "CC-BY-3.0-AT", "CC-BY-4.0", "CC-BY-NC-1.0", "CC-BY-NC-2.0", @@ -73,6 +75,7 @@ "CC-BY-NC-ND-2.0", "CC-BY-NC-ND-2.5", "CC-BY-NC-ND-3.0", + "CC-BY-NC-ND-3.0-IGO", "CC-BY-NC-ND-4.0", "CC-BY-NC-SA-1.0", "CC-BY-NC-SA-2.0", @@ -88,6 +91,7 @@ "CC-BY-SA-2.0", "CC-BY-SA-2.5", "CC-BY-SA-3.0", + "CC-BY-SA-3.0-AT", "CC-BY-SA-4.0", "CC-PDDC", "CC0-1.0", @@ -103,6 +107,9 @@ "CECILL-C", "CERN-OHL-1.1", "CERN-OHL-1.2", + "CERN-OHL-P-2.0", + "CERN-OHL-S-2.0", + "CERN-OHL-W-2.0", "CNRI-Jython", "CNRI-Python", "CNRI-Python-GPL-Compatible", @@ -124,6 +131,7 @@ "ECL-2.0", "EFL-1.0", "EFL-2.0", + "EPICS", "EPL-1.0", "EPL-2.0", "EUDatagrid", @@ -140,13 +148,26 @@ "Fair", "Frameworx-1.0", "FreeImage", + "GFDL-1.1-invariants-only", + "GFDL-1.1-invariants-or-later", + "GFDL-1.1-no-invariants-only", + "GFDL-1.1-no-invariants-or-later", "GFDL-1.1-only", "GFDL-1.1-or-later", + "GFDL-1.2-invariants-only", + "GFDL-1.2-invariants-or-later", + "GFDL-1.2-no-invariants-only", + "GFDL-1.2-no-invariants-or-later", "GFDL-1.2-only", "GFDL-1.2-or-later", + "GFDL-1.3-invariants-only", + "GFDL-1.3-invariants-or-later", + "GFDL-1.3-no-invariants-only", + "GFDL-1.3-no-invariants-or-later", "GFDL-1.3-only", "GFDL-1.3-or-later", "GL2PS", + "GLWTPL", "GPL-1.0-only", "GPL-1.0-or-later", "GPL-2.0-only", @@ -159,6 +180,7 @@ "HPND", "HPND-sell-variant", "HaskellReport", + "Hippocratic-2.1", "IBM-pibs", "ICU", "IJG", @@ -214,12 +236,17 @@ "MakeIndex", "MirOS", "Motosoto", + "MulanPSL-1.0", + "MulanPSL-2.0", "Multics", "Mup", "NASA-1.3", "NBPL-1.0", + "NCGL-UK-2.0", "NCSA", "NGPL", + "NIST-PD", + "NIST-PD-fallback", "NLOD-1.0", "NLPL", "NOSL", @@ -228,18 +255,26 @@ "NPOSL-3.0", "NRL", "NTP", + "NTP-0", "Naumen", "Net-SNMP", "NetCDF", "Newsletr", "Nokia", "Noweb", + "O-UDA-1.0", "OCCT-PL", "OCLC-2.0", "ODC-By-1.0", "ODbL-1.0", "OFL-1.0", + "OFL-1.0-RFN", + "OFL-1.0-no-RFN", "OFL-1.1", + "OFL-1.1-RFN", + "OFL-1.1-no-RFN", + "OGC-1.0", + "OGL-Canada-2.0", "OGL-UK-1.0", "OGL-UK-2.0", "OGL-UK-3.0", @@ -272,8 +307,12 @@ "PDDL-1.0", "PHP-3.0", "PHP-3.01", + "PSF-2.0", "Parity-6.0.0", + "Parity-7.0.0", "Plexus", + "PolyForm-Noncommercial-1.0.0", + "PolyForm-Small-Business-1.0.0", "PostgreSQL", "Python-2.0", "QPL-1.0", @@ -299,6 +338,8 @@ "SMPPL", "SNIA", "SPL-1.0", + "SSH-OpenSSH", + "SSH-short", "SSPL-1.0", "SWL", "Saxpath", @@ -318,6 +359,7 @@ "TOSL", "TU-Berlin-1.0", "TU-Berlin-2.0", + "UCL-1.0", "UPL-1.0", "Unicode-DFS-2015", "Unicode-DFS-2016", @@ -356,10 +398,12 @@ "diffmark", "dvipdfm", "eGenix", + "etalab-2.0", "gSOAP-1.3b", "gnuplot", "iMatix", "libpng-2.0", + "libselinux-1.0", "libtiff", "mpich2", "psfrag", diff --git a/deps/npm/node_modules/spdx-license-ids/package.json b/deps/npm/node_modules/spdx-license-ids/package.json index 45cc6c3041aa71..5653f9d08fcb95 100644 --- a/deps/npm/node_modules/spdx-license-ids/package.json +++ b/deps/npm/node_modules/spdx-license-ids/package.json @@ -1,77 +1,39 @@ { - "_from": "spdx-license-ids@3.0.5", - "_id": "spdx-license-ids@3.0.5", - "_inBundle": false, - "_integrity": "sha512-J+FWzZoynJEXGphVIS+XEh3kFSjZX/1i9gFBaWQcB+/tmpe2qUsSBABpcxqxnAxFdiUFEgAX1bjYGQvIZmoz9Q==", - "_location": "/spdx-license-ids", - "_phantomChildren": {}, - "_requested": { - "type": "version", - "registry": true, - "raw": "spdx-license-ids@3.0.5", - "name": "spdx-license-ids", - "escapedName": "spdx-license-ids", - "rawSpec": "3.0.5", - "saveSpec": null, - "fetchSpec": "3.0.5" - }, - "_requiredBy": [ - "#USER", - "/", - "/spdx-correct", - "/spdx-expression-parse" - ], - "_resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.5.tgz", - "_shasum": "3694b5804567a458d3c8045842a6358632f62654", - "_spec": "spdx-license-ids@3.0.5", - "_where": "/home/kyle/cli", - "author": { - "name": "Shinnosuke Watanabe", - "url": "https://github.com/shinnn" - }, - "bugs": { - "url": "https://github.com/shinnn/spdx-license-ids/issues" - }, - "bundleDependencies": false, - "deprecated": false, - "description": "A list of SPDX license identifiers", - "devDependencies": { - "@shinnn/eslint-config": "^6.8.7", - "chalk": "^2.4.1", - "eslint": "^5.10.0", - "get-spdx-license-ids": "^2.1.0", - "rmfr": "^2.0.0", - "tape": "^4.9.1" - }, - "eslintConfig": { - "extends": "@shinnn" - }, - "files": [ - "deprecated.json", - "index.json" - ], - "homepage": "https://github.com/shinnn/spdx-license-ids#readme", - "keywords": [ - "spdx", - "license", - "licenses", - "id", - "identifier", - "identifiers", - "json", - "array", - "oss" - ], - "license": "CC0-1.0", - "name": "spdx-license-ids", - "repository": { - "type": "git", - "url": "git+https://github.com/shinnn/spdx-license-ids.git" - }, - "scripts": { - "build": "node build.js", - "pretest": "eslint .", - "test": "node test.js" - }, - "version": "3.0.5" + "name": "spdx-license-ids", + "version": "3.0.6", + "description": "A list of SPDX license identifiers", + "repository": "jslicense/spdx-license-ids", + "author": "Shinnosuke Watanabe (https://github.com/shinnn)", + "license": "CC0-1.0", + "scripts": { + "build": "node build.js", + "pretest": "eslint .", + "test": "node test.js" + }, + "files": [ + "deprecated.json", + "index.json" + ], + "keywords": [ + "spdx", + "license", + "licenses", + "id", + "identifier", + "identifiers", + "json", + "array", + "oss" + ], + "devDependencies": { + "@shinnn/eslint-config": "^6.8.7", + "chalk": "^2.4.1", + "eslint": "^5.10.0", + "get-spdx-license-ids": "^2.1.0", + "rmfr": "^2.0.0", + "tape": "^4.9.1" + }, + "eslintConfig": { + "extends": "@shinnn" + } } diff --git a/deps/npm/node_modules/split-on-first/index.d.ts b/deps/npm/node_modules/split-on-first/index.d.ts deleted file mode 100644 index 6123bef9126ab4..00000000000000 --- a/deps/npm/node_modules/split-on-first/index.d.ts +++ /dev/null @@ -1,29 +0,0 @@ -/** -Split a string on the first occurrence of a given separator. - -@param string - The string to split. -@param separator - The separator to split on. - -@example -``` -import splitOnFirst = require('split-on-first'); - -splitOnFirst('a-b-c', '-'); -//=> ['a', 'b-c'] - -splitOnFirst('key:value:value2', ':'); -//=> ['key', 'value:value2'] - -splitOnFirst('a---b---c', '---'); -//=> ['a', 'b---c'] - -splitOnFirst('a-b-c', '+'); -//=> ['a-b-c'] -``` -*/ -declare function splitOnFirst( - string: string, - separator: string -): [string, string?]; - -export = splitOnFirst; diff --git a/deps/npm/node_modules/split-on-first/index.js b/deps/npm/node_modules/split-on-first/index.js deleted file mode 100644 index d9140706dd05b2..00000000000000 --- a/deps/npm/node_modules/split-on-first/index.js +++ /dev/null @@ -1,22 +0,0 @@ -'use strict'; - -module.exports = (string, separator) => { - if (!(typeof string === 'string' && typeof separator === 'string')) { - throw new TypeError('Expected the arguments to be of type `string`'); - } - - if (separator === '') { - return [string]; - } - - const separatorIndex = string.indexOf(separator); - - if (separatorIndex === -1) { - return [string]; - } - - return [ - string.slice(0, separatorIndex), - string.slice(separatorIndex + separator.length) - ]; -}; diff --git a/deps/npm/node_modules/split-on-first/license b/deps/npm/node_modules/split-on-first/license deleted file mode 100644 index e7af2f77107d73..00000000000000 --- a/deps/npm/node_modules/split-on-first/license +++ /dev/null @@ -1,9 +0,0 @@ -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/deps/npm/node_modules/split-on-first/package.json b/deps/npm/node_modules/split-on-first/package.json deleted file mode 100644 index d6f46a90163826..00000000000000 --- a/deps/npm/node_modules/split-on-first/package.json +++ /dev/null @@ -1,68 +0,0 @@ -{ - "_from": "split-on-first@^1.0.0", - "_id": "split-on-first@1.1.0", - "_inBundle": false, - "_integrity": "sha512-43ZssAJaMusuKWL8sKUBQXHWOpq8d6CfN/u1p4gUzfJkM05C8rxTmYrkIPTXapZpORA6LkkzcUulJ8FqA7Uudw==", - "_location": "/split-on-first", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "split-on-first@^1.0.0", - "name": "split-on-first", - "escapedName": "split-on-first", - "rawSpec": "^1.0.0", - "saveSpec": null, - "fetchSpec": "^1.0.0" - }, - "_requiredBy": [ - "/query-string" - ], - "_resolved": "https://registry.npmjs.org/split-on-first/-/split-on-first-1.1.0.tgz", - "_shasum": "f610afeee3b12bce1d0c30425e76398b78249a5f", - "_spec": "split-on-first@^1.0.0", - "_where": "/Users/isaacs/dev/npm/cli/node_modules/query-string", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "bugs": { - "url": "https://github.com/sindresorhus/split-on-first/issues" - }, - "bundleDependencies": false, - "deprecated": false, - "description": "Split a string on the first occurance of a given separator", - "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/split-on-first#readme", - "keywords": [ - "split", - "string", - "first", - "occurrence", - "separator", - "delimiter", - "text" - ], - "license": "MIT", - "name": "split-on-first", - "repository": { - "type": "git", - "url": "git+https://github.com/sindresorhus/split-on-first.git" - }, - "scripts": { - "test": "xo && ava && tsd" - }, - "version": "1.1.0" -} diff --git a/deps/npm/node_modules/split-on-first/readme.md b/deps/npm/node_modules/split-on-first/readme.md deleted file mode 100644 index 2463cf1cce4674..00000000000000 --- a/deps/npm/node_modules/split-on-first/readme.md +++ /dev/null @@ -1,58 +0,0 @@ -# split-on-first [![Build Status](https://travis-ci.com/sindresorhus/split-on-first.svg?branch=master)](https://travis-ci.com/sindresorhus/split-on-first) - -> Split a string on the first occurrence of a given separator - -This is similar to [`String#split()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/split), but that one splits on all the occurrences, not just the first one. - - -## Install - -``` -$ npm install split-on-first -``` - - -## Usage - -```js -const splitOnFirst = require('split-on-first'); - -splitOnFirst('a-b-c', '-'); -//=> ['a', 'b-c'] - -splitOnFirst('key:value:value2', ':'); -//=> ['key', 'value:value2'] - -splitOnFirst('a---b---c', '---'); -//=> ['a', 'b---c'] - -splitOnFirst('a-b-c', '+'); -//=> ['a-b-c'] -``` - - -## API - -### splitOnFirst(string, separator) - -#### string - -Type: `string` - -The string to split. - -#### separator - -Type: `string` - -The separator to split on. - - -## Related - -- [split-at](https://github.com/sindresorhus/split-at) - Split a string at one or more indices - - -## License - -MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/deps/npm/node_modules/sshpk/README.md b/deps/npm/node_modules/sshpk/README.md index 310c2ee98cdbe0..5740f74d17327a 100644 --- a/deps/npm/node_modules/sshpk/README.md +++ b/deps/npm/node_modules/sshpk/README.md @@ -126,6 +126,9 @@ Parameters - `rfc4253`: raw OpenSSH wire format - `openssh`: new post-OpenSSH 6.5 internal format, produced by `ssh-keygen -o` + - `dnssec`: `.key` file format output by `dnssec-keygen` etc + - `putty`: the PuTTY `.ppk` file format (supports truncated variant without + all the lines from `Private-Lines:` onwards) - `options` -- Optional Object, extra options, with keys: - `filename` -- Optional String, name for the key being parsed (eg. the filename that was opened). Used to generate @@ -174,7 +177,7 @@ Parameters Same as `this.toBuffer(format).toString()`. -### `Key#fingerprint([algorithm = 'sha256'])` +### `Key#fingerprint([algorithm = 'sha256'[, hashType = 'ssh']])` Creates a new `Fingerprint` object representing this Key's fingerprint. @@ -182,6 +185,9 @@ Parameters - `algorithm` -- String name of hash algorithm to use, valid options are `md5`, `sha1`, `sha256`, `sha384`, `sha512` +- `hashType` -- String name of fingerprint hash type to use, valid options are + `ssh` (the type of fingerprint used by OpenSSH, e.g. in + `ssh-keygen`), `spki` (used by HPKP, some OpenSSL applications) ### `Key#createVerify([hashAlgorithm])` @@ -231,6 +237,7 @@ Parameters `ssh-keygen -o` - `pkcs1`, `pkcs8`: variants of `pem` - `rfc4253`: raw OpenSSH wire format + - `dnssec`: `.private` format output by `dnssec-keygen` etc. - `options` -- Optional Object, extra options, with keys: - `filename` -- Optional String, name for the key being parsed (eg. the filename that was opened). Used to generate @@ -333,7 +340,7 @@ Parameters ## Fingerprints -### `parseFingerprint(fingerprint[, algorithms])` +### `parseFingerprint(fingerprint[, options])` Pre-parses a fingerprint, creating a `Fingerprint` object that can be used to quickly locate a key by using the `Fingerprint#matches` function. @@ -341,9 +348,15 @@ quickly locate a key by using the `Fingerprint#matches` function. Parameters - `fingerprint` -- String, the fingerprint value, in any supported format -- `algorithms` -- Optional list of strings, names of hash algorithms to limit - support to. If `fingerprint` uses a hash algorithm not on - this list, throws `InvalidAlgorithmError`. +- `options` -- Optional Object, with properties: + - `algorithms` -- Array of strings, names of hash algorithms to limit + support to. If `fingerprint` uses a hash algorithm not on + this list, throws `InvalidAlgorithmError`. + - `hashType` -- String, the type of hash the fingerprint uses, either `ssh` + or `spki` (normally auto-detected based on the format, but + can be overridden) + - `type` -- String, the entity this fingerprint identifies, either `key` or + `certificate` ### `Fingerprint.isFingerprint(obj)` @@ -364,14 +377,19 @@ Parameters `base64`. If this `Fingerprint` uses the `md5` algorithm, the default format is `hex`. Otherwise, the default is `base64`. -### `Fingerprint#matches(key)` +### `Fingerprint#matches(keyOrCertificate)` -Verifies whether or not this `Fingerprint` matches a given `Key`. This function -uses double-hashing to avoid leaking timing information. Returns a boolean. +Verifies whether or not this `Fingerprint` matches a given `Key` or +`Certificate`. This function uses double-hashing to avoid leaking timing +information. Returns a boolean. + +Note that a `Key`-type Fingerprint will always return `false` if asked to match +a `Certificate` and vice versa. Parameters -- `key` -- a `Key` object, the key to match this fingerprint against +- `keyOrCertificate` -- a `Key` object or `Certificate` object, the entity to + match this fingerprint against ## Signatures @@ -507,6 +525,24 @@ is valid for. The possible strings at the moment are: Authority) * `'crl'` -- key can be used to sign Certificate Revocation Lists (CRLs) +### `Certificate#getExtension(nameOrOid)` + +Retrieves information about a certificate extension, if present, or returns +`undefined` if not. The string argument `nameOrOid` should be either the OID +(for X509 extensions) or the name (for OpenSSH extensions) of the extension +to retrieve. + +The object returned will have the following properties: + + * `format` -- String, set to either `'x509'` or `'openssh'` + * `name` or `oid` -- String, only one set based on value of `format` + * `data` -- Buffer, the raw data inside the extension + +### `Certificate#getExtensions()` + +Returns an Array of all present certificate extensions, in the same manner and +format as `getExtension()`. + ### `Certificate#isExpired([when])` Tests whether the Certificate is currently expired (i.e. the `validFrom` and @@ -614,6 +650,44 @@ Parameters Returns an Identity instance. +### `identityFromArray(arr)` + +Constructs an Identity from an array of DN components (see `Identity#toArray()` +for the format). + +Parameters + + - `arr` -- an Array of Objects, DN components with `name` and `value` + +Returns an Identity instance. + + +Supported attributes in DNs: + +| Attribute name | OID | +| -------------- | --- | +| `cn` | `2.5.4.3` | +| `o` | `2.5.4.10` | +| `ou` | `2.5.4.11` | +| `l` | `2.5.4.7` | +| `s` | `2.5.4.8` | +| `c` | `2.5.4.6` | +| `sn` | `2.5.4.4` | +| `postalCode` | `2.5.4.17` | +| `serialNumber` | `2.5.4.5` | +| `street` | `2.5.4.9` | +| `x500UniqueIdentifier` | `2.5.4.45` | +| `role` | `2.5.4.72` | +| `telephoneNumber` | `2.5.4.20` | +| `description` | `2.5.4.13` | +| `dc` | `0.9.2342.19200300.100.1.25` | +| `uid` | `0.9.2342.19200300.100.1.1` | +| `mail` | `0.9.2342.19200300.100.1.3` | +| `title` | `2.5.4.12` | +| `gn` | `2.5.4.42` | +| `initials` | `2.5.4.43` | +| `pseudonym` | `2.5.4.65` | + ### `Identity#toString()` Returns the identity as an LDAP-style DN string. @@ -631,7 +705,39 @@ Set when `type` is `'host'`, `'user'`, or `'email'`, respectively. Strings. ### `Identity#cn` -The value of the first `CN=` in the DN, if any. +The value of the first `CN=` in the DN, if any. It's probably better to use +the `#get()` method instead of this property. + +### `Identity#get(name[, asArray])` + +Returns the value of a named attribute in the Identity DN. If there is no +attribute of the given name, returns `undefined`. If multiple components +of the DN contain an attribute of this name, an exception is thrown unless +the `asArray` argument is given as `true` -- then they will be returned as +an Array in the same order they appear in the DN. + +Parameters + + - `name` -- a String + - `asArray` -- an optional Boolean + +### `Identity#toArray()` + +Returns the Identity as an Array of DN component objects. This looks like: + +```js +[ { + "name": "cn", + "value": "Joe Bloggs" +}, +{ + "name": "o", + "value": "Organisation Ltd" +} ] +``` + +Each object has a `name` and a `value` property. The returned objects may be +safely modified. Errors ------ diff --git a/deps/npm/node_modules/sshpk/bin/sshpk-conv b/deps/npm/node_modules/sshpk/bin/sshpk-conv index 856a03ed013d0e..e839ede5b0c42f 100755 --- a/deps/npm/node_modules/sshpk/bin/sshpk-conv +++ b/deps/npm/node_modules/sshpk/bin/sshpk-conv @@ -1,7 +1,7 @@ #!/usr/bin/env node // -*- mode: js -*- // vim: set filetype=javascript : -// Copyright 2015 Joyent, Inc. All rights reserved. +// Copyright 2018 Joyent, Inc. All rights reserved. var dashdash = require('dashdash'); var sshpk = require('../lib/index'); @@ -47,6 +47,21 @@ var options = [ type: 'bool', help: 'Print key metadata instead of converting' }, + { + names: ['fingerprint', 'F'], + type: 'bool', + help: 'Output key fingerprint' + }, + { + names: ['hash', 'H'], + type: 'string', + help: 'Hash function to use for key fingeprint with -F' + }, + { + names: ['spki', 's'], + type: 'bool', + help: 'With -F, generates an SPKI fingerprint instead of SSH' + }, { names: ['comment', 'c'], type: 'string', @@ -75,13 +90,18 @@ if (require.main === module) { var help = parser.help({}).trimRight(); console.error('sshpk-conv: converts between SSH key formats\n'); console.error(help); - console.error('\navailable formats:'); + console.error('\navailable key formats:'); console.error(' - pem, pkcs1 eg id_rsa'); console.error(' - ssh eg id_rsa.pub'); console.error(' - pkcs8 format you want for openssl'); console.error(' - openssh like output of ssh-keygen -o'); console.error(' - rfc4253 raw OpenSSH wire format'); console.error(' - dnssec dnssec-keygen format'); + console.error(' - putty PuTTY ppk format'); + console.error('\navailable fingerprint formats:'); + console.error(' - hex colon-separated hex for SSH'); + console.error(' straight hex for SPKI'); + console.error(' - base64 SHA256:* format from OpenSSH'); process.exit(1); } @@ -111,9 +131,7 @@ if (require.main === module) { inFile = fs.createReadStream(inFilePath); } } catch (e) { - console.error('sshpk-conv: error opening input file' + - ': ' + e.name + ': ' + e.message); - process.exit(1); + ifError(e, 'error opening input file'); } var outFile = process.stdout; @@ -124,9 +142,7 @@ if (require.main === module) { outFile = fs.createWriteStream(opts.out); } } catch (e) { - console.error('sshpk-conv: error opening output file' + - ': ' + e.name + ': ' + e.message); - process.exit(1); + ifError(e, 'error opening output file'); } var bufs = []; @@ -150,20 +166,14 @@ if (require.main === module) { } catch (e) { if (e.name === 'KeyEncryptedError') { getPassword(function (err, pw) { - if (err) { - console.log('sshpk-conv: ' + - err.name + ': ' + - err.message); - process.exit(1); - } + if (err) + ifError(err); parseOpts.passphrase = pw; processKey(); }); return; } - console.error('sshpk-conv: ' + - e.name + ': ' + e.message); - process.exit(1); + ifError(e); } if (opts.derive) @@ -172,18 +182,7 @@ if (require.main === module) { if (opts.comment) key.comment = opts.comment; - if (!opts.identify) { - fmt = undefined; - if (opts.outformat) - fmt = opts.outformat; - outFile.write(key.toBuffer(fmt)); - if (fmt === 'ssh' || - (!opts.private && fmt === undefined)) - outFile.write('\n'); - outFile.once('drain', function () { - process.exit(0); - }); - } else { + if (opts.identify) { var kind = 'public'; if (sshpk.PrivateKey.isPrivateKey(key)) kind = 'private'; @@ -193,10 +192,52 @@ if (require.main === module) { console.log('ECDSA curve: %s', key.curve); if (key.comment) console.log('Comment: %s', key.comment); - console.log('Fingerprint:'); - console.log(' ' + key.fingerprint().toString()); - console.log(' ' + key.fingerprint('md5').toString()); + console.log('SHA256 fingerprint: ' + + key.fingerprint('sha256').toString()); + console.log('MD5 fingerprint: ' + + key.fingerprint('md5').toString()); + console.log('SPKI-SHA256 fingerprint: ' + + key.fingerprint('sha256', 'spki').toString()); process.exit(0); + return; + } + + if (opts.fingerprint) { + var hash = opts.hash; + var type = opts.spki ? 'spki' : 'ssh'; + var format = opts.outformat; + var fp = key.fingerprint(hash, type).toString(format); + outFile.write(fp); + outFile.write('\n'); + outFile.once('drain', function () { + process.exit(0); + }); + return; } + + fmt = undefined; + if (opts.outformat) + fmt = opts.outformat; + outFile.write(key.toBuffer(fmt)); + if (fmt === 'ssh' || + (!opts.private && fmt === undefined)) + outFile.write('\n'); + outFile.once('drain', function () { + process.exit(0); + }); }); } + +function ifError(e, txt) { + if (txt) + txt = txt + ': '; + else + txt = ''; + console.error('sshpk-conv: ' + txt + e.name + ': ' + e.message); + if (process.env['DEBUG'] || process.env['V']) { + console.error(e.stack); + if (e.innerErr) + console.error(e.innerErr.stack); + } + process.exit(1); +} diff --git a/deps/npm/node_modules/sshpk/lib/certificate.js b/deps/npm/node_modules/sshpk/lib/certificate.js index f08d66ac5579da..69323570731a99 100644 --- a/deps/npm/node_modules/sshpk/lib/certificate.js +++ b/deps/npm/node_modules/sshpk/lib/certificate.js @@ -120,6 +120,37 @@ Certificate.prototype.isSignedBy = function (issuerCert) { return (this.isSignedByKey(issuerCert.subjectKey)); }; +Certificate.prototype.getExtension = function (keyOrOid) { + assert.string(keyOrOid, 'keyOrOid'); + var ext = this.getExtensions().filter(function (maybeExt) { + if (maybeExt.format === 'x509') + return (maybeExt.oid === keyOrOid); + if (maybeExt.format === 'openssh') + return (maybeExt.name === keyOrOid); + return (false); + })[0]; + return (ext); +}; + +Certificate.prototype.getExtensions = function () { + var exts = []; + var x509 = this.signatures.x509; + if (x509 && x509.extras && x509.extras.exts) { + x509.extras.exts.forEach(function (ext) { + ext.format = 'x509'; + exts.push(ext); + }); + } + var openssh = this.signatures.openssh; + if (openssh && openssh.exts) { + openssh.exts.forEach(function (ext) { + ext.format = 'openssh'; + exts.push(ext); + }); + } + return (exts); +}; + Certificate.prototype.isSignedByKey = function (issuerKey) { utils.assertCompatible(issuerKey, Key, [1, 2], 'issuerKey'); @@ -370,8 +401,9 @@ Certificate.isCertificate = function (obj, ver) { /* * API versions for Certificate: * [1,0] -- initial ver + * [1,1] -- openssh format now unpacks extensions */ -Certificate.prototype._sshpkApiVersion = [1, 0]; +Certificate.prototype._sshpkApiVersion = [1, 1]; Certificate._oldVersionDetect = function (obj) { return ([1, 0]); diff --git a/deps/npm/node_modules/sshpk/lib/dhe.js b/deps/npm/node_modules/sshpk/lib/dhe.js index de0a10a72c631a..a3c8032cf13b1d 100644 --- a/deps/npm/node_modules/sshpk/lib/dhe.js +++ b/deps/npm/node_modules/sshpk/lib/dhe.js @@ -11,14 +11,16 @@ var crypto = require('crypto'); var Buffer = require('safer-buffer').Buffer; var algs = require('./algs'); var utils = require('./utils'); -var nacl; +var nacl = require('tweetnacl'); var Key = require('./key'); var PrivateKey = require('./private-key'); var CRYPTO_HAVE_ECDH = (crypto.createECDH !== undefined); -var ecdh, ec, jsbn; +var ecdh = require('ecc-jsbn'); +var ec = require('ecc-jsbn/lib/ec'); +var jsbn = require('jsbn').BigInteger; function DiffieHellman(key) { utils.assertCompatible(key, Key, [1, 4], 'key'); @@ -43,13 +45,6 @@ function DiffieHellman(key) { } else if (key.type === 'ecdsa') { if (!CRYPTO_HAVE_ECDH) { - if (ecdh === undefined) - ecdh = require('ecc-jsbn'); - if (ec === undefined) - ec = require('ecc-jsbn/lib/ec'); - if (jsbn === undefined) - jsbn = require('jsbn').BigInteger; - this._ecParams = new X9ECParameters(this._curve); if (this._isPriv) { @@ -76,9 +71,6 @@ function DiffieHellman(key) { this._dh.setPublicKey(key.part.Q.data); } else if (key.type === 'curve25519') { - if (nacl === undefined) - nacl = require('tweetnacl'); - if (this._isPriv) { utils.assertCompatible(key, PrivateKey, [1, 5], 'key'); this._priv = key.part.k.data; @@ -321,9 +313,6 @@ ECPrivate.prototype.deriveSharedSecret = function (pubKey) { }; function generateED25519() { - if (nacl === undefined) - nacl = require('tweetnacl'); - var pair = nacl.sign.keyPair(); var priv = Buffer.from(pair.secretKey); var pub = Buffer.from(pair.publicKey); @@ -374,12 +363,6 @@ function generateECDSA(curve) { }); return (key); } else { - if (ecdh === undefined) - ecdh = require('ecc-jsbn'); - if (ec === undefined) - ec = require('ecc-jsbn/lib/ec'); - if (jsbn === undefined) - jsbn = require('jsbn').BigInteger; var ecParams = new X9ECParameters(curve); diff --git a/deps/npm/node_modules/sshpk/lib/ed-compat.js b/deps/npm/node_modules/sshpk/lib/ed-compat.js index 129c2fc307aae4..70732e1f704355 100644 --- a/deps/npm/node_modules/sshpk/lib/ed-compat.js +++ b/deps/npm/node_modules/sshpk/lib/ed-compat.js @@ -5,7 +5,7 @@ module.exports = { Signer: Signer }; -var nacl; +var nacl = require('tweetnacl'); var stream = require('stream'); var util = require('util'); var assert = require('assert-plus'); @@ -13,9 +13,6 @@ var Buffer = require('safer-buffer').Buffer; var Signature = require('./signature'); function Verifier(key, hashAlgo) { - if (nacl === undefined) - nacl = require('tweetnacl'); - if (hashAlgo.toLowerCase() !== 'sha512') throw (new Error('ED25519 only supports the use of ' + 'SHA-512 hashes')); @@ -61,9 +58,6 @@ Verifier.prototype.verify = function (signature, fmt) { }; function Signer(key, hashAlgo) { - if (nacl === undefined) - nacl = require('tweetnacl'); - if (hashAlgo.toLowerCase() !== 'sha512') throw (new Error('ED25519 only supports the use of ' + 'SHA-512 hashes')); diff --git a/deps/npm/node_modules/sshpk/lib/fingerprint.js b/deps/npm/node_modules/sshpk/lib/fingerprint.js index 4e75e6667fc626..0004b376ec6902 100644 --- a/deps/npm/node_modules/sshpk/lib/fingerprint.js +++ b/deps/npm/node_modules/sshpk/lib/fingerprint.js @@ -1,4 +1,4 @@ -// Copyright 2015 Joyent, Inc. +// Copyright 2018 Joyent, Inc. module.exports = Fingerprint; @@ -8,6 +8,7 @@ var algs = require('./algs'); var crypto = require('crypto'); var errs = require('./errors'); var Key = require('./key'); +var PrivateKey = require('./private-key'); var Certificate = require('./certificate'); var utils = require('./utils'); @@ -26,11 +27,12 @@ function Fingerprint(opts) { this.hash = opts.hash; this.type = opts.type; + this.hashType = opts.hashType; } Fingerprint.prototype.toString = function (format) { if (format === undefined) { - if (this.algorithm === 'md5') + if (this.algorithm === 'md5' || this.hashType === 'spki') format = 'hex'; else format = 'base64'; @@ -39,8 +41,12 @@ Fingerprint.prototype.toString = function (format) { switch (format) { case 'hex': + if (this.hashType === 'spki') + return (this.hash.toString('hex')); return (addColons(this.hash.toString('hex'))); case 'base64': + if (this.hashType === 'spki') + return (this.hash.toString('base64')); return (sshBase64Format(this.algorithm, this.hash.toString('base64'))); default: @@ -50,14 +56,20 @@ Fingerprint.prototype.toString = function (format) { Fingerprint.prototype.matches = function (other) { assert.object(other, 'key or certificate'); - if (this.type === 'key') { + if (this.type === 'key' && this.hashType !== 'ssh') { + utils.assertCompatible(other, Key, [1, 7], 'key with spki'); + if (PrivateKey.isPrivateKey(other)) { + utils.assertCompatible(other, PrivateKey, [1, 6], + 'privatekey with spki support'); + } + } else if (this.type === 'key') { utils.assertCompatible(other, Key, [1, 0], 'key'); } else { utils.assertCompatible(other, Certificate, [1, 0], 'certificate'); } - var theirHash = other.hash(this.algorithm); + var theirHash = other.hash(this.algorithm, this.hashType); var theirHash2 = crypto.createHash(this.algorithm). update(theirHash).digest('base64'); @@ -68,6 +80,11 @@ Fingerprint.prototype.matches = function (other) { return (this.hash2 === theirHash2); }; +/*JSSTYLED*/ +var base64RE = /^[A-Za-z0-9+\/=]+$/; +/*JSSTYLED*/ +var hexRE = /^[a-fA-F0-9]+$/; + Fingerprint.parse = function (fp, options) { assert.string(fp, 'fingerprint'); @@ -81,13 +98,18 @@ Fingerprint.parse = function (fp, options) { options = {}; if (options.enAlgs !== undefined) enAlgs = options.enAlgs; + if (options.algorithms !== undefined) + enAlgs = options.algorithms; assert.optionalArrayOfString(enAlgs, 'algorithms'); + var hashType = 'ssh'; + if (options.hashType !== undefined) + hashType = options.hashType; + assert.string(hashType, 'options.hashType'); + var parts = fp.split(':'); if (parts.length == 2) { alg = parts[0].toLowerCase(); - /*JSSTYLED*/ - var base64RE = /^[A-Za-z0-9+\/=]+$/; if (!base64RE.test(parts[1])) throw (new FingerprintFormatError(fp)); try { @@ -99,16 +121,50 @@ Fingerprint.parse = function (fp, options) { alg = 'md5'; if (parts[0].toLowerCase() === 'md5') parts = parts.slice(1); + parts = parts.map(function (p) { + while (p.length < 2) + p = '0' + p; + if (p.length > 2) + throw (new FingerprintFormatError(fp)); + return (p); + }); parts = parts.join(''); - /*JSSTYLED*/ - var md5RE = /^[a-fA-F0-9]+$/; - if (!md5RE.test(parts)) + if (!hexRE.test(parts) || parts.length % 2 !== 0) throw (new FingerprintFormatError(fp)); try { hash = Buffer.from(parts, 'hex'); } catch (e) { throw (new FingerprintFormatError(fp)); } + } else { + if (hexRE.test(fp)) { + hash = Buffer.from(fp, 'hex'); + } else if (base64RE.test(fp)) { + hash = Buffer.from(fp, 'base64'); + } else { + throw (new FingerprintFormatError(fp)); + } + + switch (hash.length) { + case 32: + alg = 'sha256'; + break; + case 16: + alg = 'md5'; + break; + case 20: + alg = 'sha1'; + break; + case 64: + alg = 'sha512'; + break; + default: + throw (new FingerprintFormatError(fp)); + } + + /* Plain hex/base64: guess it's probably SPKI unless told. */ + if (options.hashType === undefined) + hashType = 'spki'; } if (alg === undefined) @@ -126,7 +182,8 @@ Fingerprint.parse = function (fp, options) { return (new Fingerprint({ algorithm: alg, hash: hash, - type: options.type || 'key' + type: options.type || 'key', + hashType: hashType })); }; @@ -152,8 +209,9 @@ Fingerprint.isFingerprint = function (obj, ver) { * API versions for Fingerprint: * [1,0] -- initial ver * [1,1] -- first tagged ver + * [1,2] -- hashType and spki support */ -Fingerprint.prototype._sshpkApiVersion = [1, 1]; +Fingerprint.prototype._sshpkApiVersion = [1, 2]; Fingerprint._oldVersionDetect = function (obj) { assert.func(obj.toString); diff --git a/deps/npm/node_modules/sshpk/lib/formats/auto.js b/deps/npm/node_modules/sshpk/lib/formats/auto.js index 56e430d5a7f1ea..f32cd9648bcf68 100644 --- a/deps/npm/node_modules/sshpk/lib/formats/auto.js +++ b/deps/npm/node_modules/sshpk/lib/formats/auto.js @@ -1,4 +1,4 @@ -// Copyright 2015 Joyent, Inc. +// Copyright 2018 Joyent, Inc. module.exports = { read: read, @@ -15,6 +15,7 @@ var pem = require('./pem'); var ssh = require('./ssh'); var rfc4253 = require('./rfc4253'); var dnssec = require('./dnssec'); +var putty = require('./putty'); var DNSSEC_PRIVKEY_HEADER_PREFIX = 'Private-key-format: v1'; @@ -26,6 +27,8 @@ function read(buf, options) { return (ssh.read(buf, options)); if (buf.match(/^\s*ecdsa-/)) return (ssh.read(buf, options)); + if (buf.match(/^putty-user-key-file-2:/i)) + return (putty.read(buf, options)); if (findDNSSECHeader(buf)) return (dnssec.read(buf, options)); buf = Buffer.from(buf, 'binary'); @@ -35,6 +38,8 @@ function read(buf, options) { return (pem.read(buf, options)); if (findSSHHeader(buf)) return (ssh.read(buf, options)); + if (findPuTTYHeader(buf)) + return (putty.read(buf, options)); if (findDNSSECHeader(buf)) return (dnssec.read(buf, options)); } @@ -43,6 +48,18 @@ function read(buf, options) { throw (new Error('Failed to auto-detect format of key')); } +function findPuTTYHeader(buf) { + var offset = 0; + while (offset < buf.length && + (buf[offset] === 32 || buf[offset] === 10 || buf[offset] === 9)) + ++offset; + if (offset + 22 <= buf.length && + buf.slice(offset, offset + 22).toString('ascii').toLowerCase() === + 'putty-user-key-file-2:') + return (true); + return (false); +} + function findSSHHeader(buf) { var offset = 0; while (offset < buf.length && diff --git a/deps/npm/node_modules/sshpk/lib/formats/openssh-cert.js b/deps/npm/node_modules/sshpk/lib/formats/openssh-cert.js index 0b95e89049dd6c..766f3d39cb31da 100644 --- a/deps/npm/node_modules/sshpk/lib/formats/openssh-cert.js +++ b/deps/npm/node_modules/sshpk/lib/formats/openssh-cert.js @@ -122,8 +122,23 @@ function fromBuffer(data, algo, partial) { cert.validFrom = int64ToDate(sshbuf.readInt64()); cert.validUntil = int64ToDate(sshbuf.readInt64()); - cert.signatures.openssh.critical = sshbuf.readBuffer(); - cert.signatures.openssh.exts = sshbuf.readBuffer(); + var exts = []; + var extbuf = new SSHBuffer({ buffer: sshbuf.readBuffer() }); + var ext; + while (!extbuf.atEnd()) { + ext = { critical: true }; + ext.name = extbuf.readString(); + ext.data = extbuf.readBuffer(); + exts.push(ext); + } + extbuf = new SSHBuffer({ buffer: sshbuf.readBuffer() }); + while (!extbuf.atEnd()) { + ext = { critical: false }; + ext.name = extbuf.readString(); + ext.data = extbuf.readBuffer(); + exts.push(ext); + } + cert.signatures.openssh.exts = exts; /* reserved */ sshbuf.readBuffer(); @@ -278,13 +293,27 @@ function toBuffer(cert, noSig) { buf.writeInt64(dateToInt64(cert.validFrom)); buf.writeInt64(dateToInt64(cert.validUntil)); - if (sig.critical === undefined) - sig.critical = Buffer.alloc(0); - buf.writeBuffer(sig.critical); + var exts = sig.exts; + if (exts === undefined) + exts = []; - if (sig.exts === undefined) - sig.exts = Buffer.alloc(0); - buf.writeBuffer(sig.exts); + var extbuf = new SSHBuffer({}); + exts.forEach(function (ext) { + if (ext.critical !== true) + return; + extbuf.writeString(ext.name); + extbuf.writeBuffer(ext.data); + }); + buf.writeBuffer(extbuf.toBuffer()); + + extbuf = new SSHBuffer({}); + exts.forEach(function (ext) { + if (ext.critical === true) + return; + extbuf.writeString(ext.name); + extbuf.writeBuffer(ext.data); + }); + buf.writeBuffer(extbuf.toBuffer()); /* reserved */ buf.writeBuffer(Buffer.alloc(0)); diff --git a/deps/npm/node_modules/sshpk/lib/formats/pem.js b/deps/npm/node_modules/sshpk/lib/formats/pem.js index 859cfa13fca324..bbe78fcb56f360 100644 --- a/deps/npm/node_modules/sshpk/lib/formats/pem.js +++ b/deps/npm/node_modules/sshpk/lib/formats/pem.js @@ -1,4 +1,4 @@ -// Copyright 2015 Joyent, Inc. +// Copyright 2018 Joyent, Inc. module.exports = { read: read, @@ -21,6 +21,29 @@ var rfc4253 = require('./rfc4253'); var errors = require('../errors'); +var OID_PBES2 = '1.2.840.113549.1.5.13'; +var OID_PBKDF2 = '1.2.840.113549.1.5.12'; + +var OID_TO_CIPHER = { + '1.2.840.113549.3.7': '3des-cbc', + '2.16.840.1.101.3.4.1.2': 'aes128-cbc', + '2.16.840.1.101.3.4.1.42': 'aes256-cbc' +}; +var CIPHER_TO_OID = {}; +Object.keys(OID_TO_CIPHER).forEach(function (k) { + CIPHER_TO_OID[OID_TO_CIPHER[k]] = k; +}); + +var OID_TO_HASH = { + '1.2.840.113549.2.7': 'sha1', + '1.2.840.113549.2.9': 'sha256', + '1.2.840.113549.2.11': 'sha512' +}; +var HASH_TO_OID = {}; +Object.keys(OID_TO_HASH).forEach(function (k) { + HASH_TO_OID[OID_TO_HASH[k]] = k; +}); + /* * For reading we support both PKCS#1 and PKCS#8. If we find a private key, * we just take the public component of it and use that. @@ -32,14 +55,22 @@ function read(buf, options, forceType) { buf = buf.toString('ascii'); } - var lines = buf.trim().split('\n'); + var lines = buf.trim().split(/[\r\n]+/g); - var m = lines[0].match(/*JSSTYLED*/ - /[-]+[ ]*BEGIN ([A-Z0-9][A-Za-z0-9]+ )?(PUBLIC|PRIVATE) KEY[ ]*[-]+/); + var m; + var si = -1; + while (!m && si < lines.length) { + m = lines[++si].match(/*JSSTYLED*/ + /[-]+[ ]*BEGIN ([A-Z0-9][A-Za-z0-9]+ )?(PUBLIC|PRIVATE) KEY[ ]*[-]+/); + } assert.ok(m, 'invalid PEM header'); - var m2 = lines[lines.length - 1].match(/*JSSTYLED*/ - /[-]+[ ]*END ([A-Z0-9][A-Za-z0-9]+ )?(PUBLIC|PRIVATE) KEY[ ]*[-]+/); + var m2; + var ei = lines.length; + while (!m2 && ei > 0) { + m2 = lines[--ei].match(/*JSSTYLED*/ + /[-]+[ ]*END ([A-Z0-9][A-Za-z0-9]+ )?(PUBLIC|PRIVATE) KEY[ ]*[-]+/); + } assert.ok(m2, 'invalid PEM footer'); /* Begin and end banners must match key type */ @@ -53,6 +84,8 @@ function read(buf, options, forceType) { alg = m[1].trim(); } + lines = lines.slice(si, ei + 1); + var headers = {}; while (true) { lines = lines.slice(1); @@ -63,6 +96,10 @@ function read(buf, options, forceType) { headers[m[1].toLowerCase()] = m[2]; } + /* Chop off the first and last lines */ + lines = lines.slice(0, -1).join(''); + buf = Buffer.from(lines, 'base64'); + var cipher, key, iv; if (headers['proc-type']) { var parts = headers['proc-type'].split(','); @@ -85,9 +122,70 @@ function read(buf, options, forceType) { } } - /* Chop off the first and last lines */ - lines = lines.slice(0, -1).join(''); - buf = Buffer.from(lines, 'base64'); + if (alg && alg.toLowerCase() === 'encrypted') { + var eder = new asn1.BerReader(buf); + var pbesEnd; + eder.readSequence(); + + eder.readSequence(); + pbesEnd = eder.offset + eder.length; + + var method = eder.readOID(); + if (method !== OID_PBES2) { + throw (new Error('Unsupported PEM/PKCS8 encryption ' + + 'scheme: ' + method)); + } + + eder.readSequence(); /* PBES2-params */ + + eder.readSequence(); /* keyDerivationFunc */ + var kdfEnd = eder.offset + eder.length; + var kdfOid = eder.readOID(); + if (kdfOid !== OID_PBKDF2) + throw (new Error('Unsupported PBES2 KDF: ' + kdfOid)); + eder.readSequence(); + var salt = eder.readString(asn1.Ber.OctetString, true); + var iterations = eder.readInt(); + var hashAlg = 'sha1'; + if (eder.offset < kdfEnd) { + eder.readSequence(); + var hashAlgOid = eder.readOID(); + hashAlg = OID_TO_HASH[hashAlgOid]; + if (hashAlg === undefined) { + throw (new Error('Unsupported PBKDF2 hash: ' + + hashAlgOid)); + } + } + eder._offset = kdfEnd; + + eder.readSequence(); /* encryptionScheme */ + var cipherOid = eder.readOID(); + cipher = OID_TO_CIPHER[cipherOid]; + if (cipher === undefined) { + throw (new Error('Unsupported PBES2 cipher: ' + + cipherOid)); + } + iv = eder.readString(asn1.Ber.OctetString, true); + + eder._offset = pbesEnd; + buf = eder.readString(asn1.Ber.OctetString, true); + + if (typeof (options.passphrase) === 'string') { + options.passphrase = Buffer.from( + options.passphrase, 'utf-8'); + } + if (!Buffer.isBuffer(options.passphrase)) { + throw (new errors.KeyEncryptedError( + options.filename, 'PEM')); + } + + var cinfo = utils.opensshCipherInfo(cipher); + + cipher = cinfo.opensslName; + key = utils.pbkdf2(hashAlg, salt, iterations, cinfo.keySize, + options.passphrase); + alg = undefined; + } if (cipher && key && iv) { var cipherStream = crypto.createDecipheriv(cipher, key, iv); diff --git a/deps/npm/node_modules/sshpk/lib/formats/pkcs8.js b/deps/npm/node_modules/sshpk/lib/formats/pkcs8.js index aa27427c174e70..2ca3ca7a26014e 100644 --- a/deps/npm/node_modules/sshpk/lib/formats/pkcs8.js +++ b/deps/npm/node_modules/sshpk/lib/formats/pkcs8.js @@ -1,10 +1,11 @@ -// Copyright 2015 Joyent, Inc. +// Copyright 2018 Joyent, Inc. module.exports = { read: read, readPkcs8: readPkcs8, write: write, writePkcs8: writePkcs8, + pkcs8ToBuffer: pkcs8ToBuffer, readECDSACurve: readECDSACurve, writeECDSACurve: writeECDSACurve @@ -300,10 +301,22 @@ function readPkcs8ECDSAPrivate(der) { assert.equal(version[0], 1, 'unknown version of ECDSA key'); var d = der.readString(asn1.Ber.OctetString, true); - der.readSequence(0xa1); + var Q; - var Q = der.readString(asn1.Ber.BitString, true); - Q = utils.ecNormalize(Q); + if (der.peek() == 0xa0) { + der.readSequence(0xa0); + der._offset += der.length; + } + if (der.peek() == 0xa1) { + der.readSequence(0xa1); + Q = der.readString(asn1.Ber.BitString, true); + Q = utils.ecNormalize(Q); + } + + if (Q === undefined) { + var pub = utils.publicFromPrivateECDSA(curveName, d); + Q = pub.part.Q.data; + } var key = { type: 'ecdsa', @@ -412,6 +425,12 @@ function readPkcs8X25519Private(der) { return (new PrivateKey(key)); } +function pkcs8ToBuffer(key) { + var der = new asn1.BerWriter(); + writePkcs8(der, key); + return (der.buffer); +} + function writePkcs8(der, key) { der.startSequence(); diff --git a/deps/npm/node_modules/sshpk/lib/formats/putty.js b/deps/npm/node_modules/sshpk/lib/formats/putty.js new file mode 100644 index 00000000000000..344419f980efb4 --- /dev/null +++ b/deps/npm/node_modules/sshpk/lib/formats/putty.js @@ -0,0 +1,99 @@ +// Copyright 2018 Joyent, Inc. + +module.exports = { + read: read, + write: write +}; + +var assert = require('assert-plus'); +var Buffer = require('safer-buffer').Buffer; +var rfc4253 = require('./rfc4253'); +var Key = require('../key'); + +var errors = require('../errors'); + +function read(buf, options) { + var lines = buf.toString('ascii').split(/[\r\n]+/); + var found = false; + var parts; + var si = 0; + while (si < lines.length) { + parts = splitHeader(lines[si++]); + if (parts && + parts[0].toLowerCase() === 'putty-user-key-file-2') { + found = true; + break; + } + } + if (!found) { + throw (new Error('No PuTTY format first line found')); + } + var alg = parts[1]; + + parts = splitHeader(lines[si++]); + assert.equal(parts[0].toLowerCase(), 'encryption'); + + parts = splitHeader(lines[si++]); + assert.equal(parts[0].toLowerCase(), 'comment'); + var comment = parts[1]; + + parts = splitHeader(lines[si++]); + assert.equal(parts[0].toLowerCase(), 'public-lines'); + var publicLines = parseInt(parts[1], 10); + if (!isFinite(publicLines) || publicLines < 0 || + publicLines > lines.length) { + throw (new Error('Invalid public-lines count')); + } + + var publicBuf = Buffer.from( + lines.slice(si, si + publicLines).join(''), 'base64'); + var keyType = rfc4253.algToKeyType(alg); + var key = rfc4253.read(publicBuf); + if (key.type !== keyType) { + throw (new Error('Outer key algorithm mismatch')); + } + key.comment = comment; + return (key); +} + +function splitHeader(line) { + var idx = line.indexOf(':'); + if (idx === -1) + return (null); + var header = line.slice(0, idx); + ++idx; + while (line[idx] === ' ') + ++idx; + var rest = line.slice(idx); + return ([header, rest]); +} + +function write(key, options) { + assert.object(key); + if (!Key.isKey(key)) + throw (new Error('Must be a public key')); + + var alg = rfc4253.keyTypeToAlg(key); + var buf = rfc4253.write(key); + var comment = key.comment || ''; + + var b64 = buf.toString('base64'); + var lines = wrap(b64, 64); + + lines.unshift('Public-Lines: ' + lines.length); + lines.unshift('Comment: ' + comment); + lines.unshift('Encryption: none'); + lines.unshift('PuTTY-User-Key-File-2: ' + alg); + + return (Buffer.from(lines.join('\n') + '\n')); +} + +function wrap(txt, len) { + var lines = []; + var pos = 0; + while (pos < txt.length) { + lines.push(txt.slice(pos, pos + 64)); + pos += 64; + } + return (lines); +} diff --git a/deps/npm/node_modules/sshpk/lib/formats/x509-pem.js b/deps/npm/node_modules/sshpk/lib/formats/x509-pem.js index 56d78eb583c4d4..3155ef0b3a1468 100644 --- a/deps/npm/node_modules/sshpk/lib/formats/x509-pem.js +++ b/deps/npm/node_modules/sshpk/lib/formats/x509-pem.js @@ -29,14 +29,24 @@ function read(buf, options) { var lines = buf.trim().split(/[\r\n]+/g); - var m = lines[0].match(/*JSSTYLED*/ - /[-]+[ ]*BEGIN CERTIFICATE[ ]*[-]+/); + var m; + var si = -1; + while (!m && si < lines.length) { + m = lines[++si].match(/*JSSTYLED*/ + /[-]+[ ]*BEGIN CERTIFICATE[ ]*[-]+/); + } assert.ok(m, 'invalid PEM header'); - var m2 = lines[lines.length - 1].match(/*JSSTYLED*/ - /[-]+[ ]*END CERTIFICATE[ ]*[-]+/); + var m2; + var ei = lines.length; + while (!m2 && ei > 0) { + m2 = lines[--ei].match(/*JSSTYLED*/ + /[-]+[ ]*END CERTIFICATE[ ]*[-]+/); + } assert.ok(m2, 'invalid PEM footer'); + lines = lines.slice(si, ei + 1); + var headers = {}; while (true) { lines = lines.slice(1); diff --git a/deps/npm/node_modules/sshpk/lib/formats/x509.js b/deps/npm/node_modules/sshpk/lib/formats/x509.js index 219953c4e000d0..0144c4449133bd 100644 --- a/deps/npm/node_modules/sshpk/lib/formats/x509.js +++ b/deps/npm/node_modules/sshpk/lib/formats/x509.js @@ -203,6 +203,14 @@ function readDate(der) { } } +function writeDate(der, date) { + if (date.getUTCFullYear() >= 2050 || date.getUTCFullYear() < 1950) { + der.writeString(dateToGTime(date), asn1.Ber.GeneralizedTime); + } else { + der.writeString(dateToUTCTime(date), asn1.Ber.UTCTime); + } +} + /* RFC5280, section 4.2.1.6 (GeneralName type) */ var ALTNAME = { OtherName: Local(0), @@ -242,7 +250,8 @@ function readExtension(cert, buf, der) { var extId = der.readOID(); var id; var sig = cert.signatures.x509; - sig.extras.exts = []; + if (!sig.extras.exts) + sig.extras.exts = []; var critical; if (der.peek() === asn1.Ber.Boolean) @@ -414,9 +423,11 @@ function gTimeToDate(t) { return (d); } -function zeroPad(n) { +function zeroPad(n, m) { + if (m === undefined) + m = 2; var s = '' + n; - while (s.length < 2) + while (s.length < m) s = '0' + s; return (s); } @@ -433,6 +444,18 @@ function dateToUTCTime(d) { return (s); } +function dateToGTime(d) { + var s = ''; + s += zeroPad(d.getUTCFullYear(), 4); + s += zeroPad(d.getUTCMonth() + 1); + s += zeroPad(d.getUTCDate()); + s += zeroPad(d.getUTCHours()); + s += zeroPad(d.getUTCMinutes()); + s += zeroPad(d.getUTCSeconds()); + s += 'Z'; + return (s); +} + function sign(cert, key) { if (cert.signatures.x509 === undefined) cert.signatures.x509 = {}; @@ -531,8 +554,8 @@ function writeTBSCert(cert, der) { cert.issuer.toAsn1(der); der.startSequence(); - der.writeString(dateToUTCTime(cert.validFrom), asn1.Ber.UTCTime); - der.writeString(dateToUTCTime(cert.validUntil), asn1.Ber.UTCTime); + writeDate(der, cert.validFrom); + writeDate(der, cert.validUntil); der.endSequence(); var subject = cert.subjects[0]; diff --git a/deps/npm/node_modules/sshpk/lib/identity.js b/deps/npm/node_modules/sshpk/lib/identity.js index 495b83a6cf8dfe..7d75b6671b62a8 100644 --- a/deps/npm/node_modules/sshpk/lib/identity.js +++ b/deps/npm/node_modules/sshpk/lib/identity.js @@ -24,9 +24,21 @@ oids.l = '2.5.4.7'; oids.s = '2.5.4.8'; oids.c = '2.5.4.6'; oids.sn = '2.5.4.4'; +oids.postalCode = '2.5.4.17'; +oids.serialNumber = '2.5.4.5'; +oids.street = '2.5.4.9'; +oids.x500UniqueIdentifier = '2.5.4.45'; +oids.role = '2.5.4.72'; +oids.telephoneNumber = '2.5.4.20'; +oids.description = '2.5.4.13'; oids.dc = '0.9.2342.19200300.100.1.25'; oids.uid = '0.9.2342.19200300.100.1.1'; oids.mail = '0.9.2342.19200300.100.1.3'; +oids.title = '2.5.4.12'; +oids.gn = '2.5.4.42'; +oids.initials = '2.5.4.43'; +oids.pseudonym = '2.5.4.65'; +oids.emailAddress = '1.2.840.113549.1.9.1'; var unoids = {}; Object.keys(oids).forEach(function (k) { @@ -113,10 +125,39 @@ function Identity(opts) { Identity.prototype.toString = function () { return (this.components.map(function (c) { - return (c.name.toUpperCase() + '=' + c.value); + var n = c.name.toUpperCase(); + /*JSSTYLED*/ + n = n.replace(/=/g, '\\='); + var v = c.value; + /*JSSTYLED*/ + v = v.replace(/,/g, '\\,'); + return (n + '=' + v); }).join(', ')); }; +Identity.prototype.get = function (name, asArray) { + assert.string(name, 'name'); + var arr = this.componentLookup[name]; + if (arr === undefined || arr.length === 0) + return (undefined); + if (!asArray && arr.length > 1) + throw (new Error('Multiple values for attribute ' + name)); + if (!asArray) + return (arr[0].value); + return (arr.map(function (c) { + return (c.value); + })); +}; + +Identity.prototype.toArray = function (idx) { + return (this.components.map(function (c) { + return ({ + name: c.name, + value: c.value + }); + })); +}; + /* * These are from X.680 -- PrintableString allowed chars are in section 37.4 * table 8. Spec for IA5Strings is "1,6 + SPACE + DEL" where 1 refers to @@ -224,17 +265,60 @@ Identity.forEmail = function (email) { Identity.parseDN = function (dn) { assert.string(dn, 'dn'); - var parts = dn.split(','); + var parts = ['']; + var idx = 0; + var rem = dn; + while (rem.length > 0) { + var m; + /*JSSTYLED*/ + if ((m = /^,/.exec(rem)) !== null) { + parts[++idx] = ''; + rem = rem.slice(m[0].length); + /*JSSTYLED*/ + } else if ((m = /^\\,/.exec(rem)) !== null) { + parts[idx] += ','; + rem = rem.slice(m[0].length); + /*JSSTYLED*/ + } else if ((m = /^\\./.exec(rem)) !== null) { + parts[idx] += m[0]; + rem = rem.slice(m[0].length); + /*JSSTYLED*/ + } else if ((m = /^[^\\,]+/.exec(rem)) !== null) { + parts[idx] += m[0]; + rem = rem.slice(m[0].length); + } else { + throw (new Error('Failed to parse DN')); + } + } var cmps = parts.map(function (c) { c = c.trim(); var eqPos = c.indexOf('='); - var name = c.slice(0, eqPos).toLowerCase(); + while (eqPos > 0 && c.charAt(eqPos - 1) === '\\') + eqPos = c.indexOf('=', eqPos + 1); + if (eqPos === -1) { + throw (new Error('Failed to parse DN')); + } + /*JSSTYLED*/ + var name = c.slice(0, eqPos).toLowerCase().replace(/\\=/g, '='); var value = c.slice(eqPos + 1); return ({ name: name, value: value }); }); return (new Identity({ components: cmps })); }; +Identity.fromArray = function (components) { + assert.arrayOfObject(components, 'components'); + components.forEach(function (cmp) { + assert.object(cmp, 'component'); + assert.string(cmp.name, 'component.name'); + if (!Buffer.isBuffer(cmp.value) && + !(typeof (cmp.value) === 'string')) { + throw (new Error('Invalid component value')); + } + }); + return (new Identity({ components: components })); +}; + Identity.parseAsn1 = function (der, top) { var components = []; der.readSequence(top); diff --git a/deps/npm/node_modules/sshpk/lib/index.js b/deps/npm/node_modules/sshpk/lib/index.js index cb8cd1a1b88152..f76db7918dc360 100644 --- a/deps/npm/node_modules/sshpk/lib/index.js +++ b/deps/npm/node_modules/sshpk/lib/index.js @@ -28,6 +28,7 @@ module.exports = { identityForHost: Identity.forHost, identityForUser: Identity.forUser, identityForEmail: Identity.forEmail, + identityFromArray: Identity.fromArray, /* errors */ FingerprintFormatError: errs.FingerprintFormatError, diff --git a/deps/npm/node_modules/sshpk/lib/key.js b/deps/npm/node_modules/sshpk/lib/key.js index f8ef22dc71164b..706f83400d554a 100644 --- a/deps/npm/node_modules/sshpk/lib/key.js +++ b/deps/npm/node_modules/sshpk/lib/key.js @@ -1,4 +1,4 @@ -// Copyright 2017 Joyent, Inc. +// Copyright 2018 Joyent, Inc. module.exports = Key; @@ -32,6 +32,8 @@ formats['ssh'] = require('./formats/ssh'); formats['ssh-private'] = require('./formats/ssh-private'); formats['openssh'] = formats['ssh-private']; formats['dnssec'] = require('./formats/dnssec'); +formats['putty'] = require('./formats/putty'); +formats['ppk'] = formats['putty']; function Key(opts) { assert.object(opts, 'options'); @@ -98,28 +100,44 @@ Key.prototype.toString = function (format, options) { return (this.toBuffer(format, options).toString()); }; -Key.prototype.hash = function (algo) { +Key.prototype.hash = function (algo, type) { assert.string(algo, 'algorithm'); + assert.optionalString(type, 'type'); + if (type === undefined) + type = 'ssh'; algo = algo.toLowerCase(); if (algs.hashAlgs[algo] === undefined) throw (new InvalidAlgorithmError(algo)); - if (this._hashCache[algo]) - return (this._hashCache[algo]); - var hash = crypto.createHash(algo). - update(this.toBuffer('rfc4253')).digest(); - this._hashCache[algo] = hash; + var cacheKey = algo + '||' + type; + if (this._hashCache[cacheKey]) + return (this._hashCache[cacheKey]); + + var buf; + if (type === 'ssh') { + buf = this.toBuffer('rfc4253'); + } else if (type === 'spki') { + buf = formats.pkcs8.pkcs8ToBuffer(this); + } else { + throw (new Error('Hash type ' + type + ' not supported')); + } + var hash = crypto.createHash(algo).update(buf).digest(); + this._hashCache[cacheKey] = hash; return (hash); }; -Key.prototype.fingerprint = function (algo) { +Key.prototype.fingerprint = function (algo, type) { if (algo === undefined) algo = 'sha256'; + if (type === undefined) + type = 'ssh'; assert.string(algo, 'algorithm'); + assert.string(type, 'type'); var opts = { type: 'key', - hash: this.hash(algo), - algorithm: algo + hash: this.hash(algo, type), + algorithm: algo, + hashType: type }; return (new Fingerprint(opts)); }; @@ -257,8 +275,9 @@ Key.isKey = function (obj, ver) { * [1,4] -- added ed support, createDH * [1,5] -- first explicitly tagged version * [1,6] -- changed ed25519 part names + * [1,7] -- spki hash types */ -Key.prototype._sshpkApiVersion = [1, 6]; +Key.prototype._sshpkApiVersion = [1, 7]; Key._oldVersionDetect = function (obj) { assert.func(obj.toBuffer); diff --git a/deps/npm/node_modules/sshpk/lib/private-key.js b/deps/npm/node_modules/sshpk/lib/private-key.js index 77f667cd2a71db..560083801ece1a 100644 --- a/deps/npm/node_modules/sshpk/lib/private-key.js +++ b/deps/npm/node_modules/sshpk/lib/private-key.js @@ -14,14 +14,8 @@ var utils = require('./utils'); var dhe = require('./dhe'); var generateECDSA = dhe.generateECDSA; var generateED25519 = dhe.generateED25519; -var edCompat; -var nacl; - -try { - edCompat = require('./ed-compat'); -} catch (e) { - /* Just continue through, and bail out if we try to use it. */ -} +var edCompat = require('./ed-compat'); +var nacl = require('tweetnacl'); var Key = require('./key'); @@ -60,8 +54,12 @@ PrivateKey.prototype.toBuffer = function (format, options) { return (formats[format].write(this, options)); }; -PrivateKey.prototype.hash = function (algo) { - return (this.toPublic().hash(algo)); +PrivateKey.prototype.hash = function (algo, type) { + return (this.toPublic().hash(algo, type)); +}; + +PrivateKey.prototype.fingerprint = function (algo, type) { + return (this.toPublic().fingerprint(algo, type)); }; PrivateKey.prototype.toPublic = function () { @@ -90,9 +88,6 @@ PrivateKey.prototype.derive = function (newType) { var priv, pub, pair; if (this.type === 'ed25519' && newType === 'curve25519') { - if (nacl === undefined) - nacl = require('tweetnacl'); - priv = this.part.k.data; if (priv[0] === 0x00) priv = priv.slice(1); @@ -108,9 +103,6 @@ PrivateKey.prototype.derive = function (newType) { ] })); } else if (this.type === 'curve25519' && newType === 'ed25519') { - if (nacl === undefined) - nacl = require('tweetnacl'); - priv = this.part.k.data; if (priv[0] === 0x00) priv = priv.slice(1); @@ -237,8 +229,9 @@ PrivateKey.generate = function (type, options) { * [1,3] -- added derive, ed, createDH * [1,4] -- first tagged version * [1,5] -- changed ed25519 part names and format + * [1,6] -- type arguments for hash() and fingerprint() */ -PrivateKey.prototype._sshpkApiVersion = [1, 5]; +PrivateKey.prototype._sshpkApiVersion = [1, 6]; PrivateKey._oldVersionDetect = function (obj) { assert.func(obj.toPublic); diff --git a/deps/npm/node_modules/sshpk/lib/utils.js b/deps/npm/node_modules/sshpk/lib/utils.js index 4dcaf9c7a9c018..6b83a322d151b0 100644 --- a/deps/npm/node_modules/sshpk/lib/utils.js +++ b/deps/npm/node_modules/sshpk/lib/utils.js @@ -17,7 +17,8 @@ module.exports = { publicFromPrivateECDSA: publicFromPrivateECDSA, zeroPadToLength: zeroPadToLength, writeBitString: writeBitString, - readBitString: readBitString + readBitString: readBitString, + pbkdf2: pbkdf2 }; var assert = require('assert-plus'); @@ -28,8 +29,9 @@ var crypto = require('crypto'); var algs = require('./algs'); var asn1 = require('asn1'); -var ec, jsbn; -var nacl; +var ec = require('ecc-jsbn/lib/ec'); +var jsbn = require('jsbn').BigInteger; +var nacl = require('tweetnacl'); var MAX_CLASS_DEPTH = 3; @@ -86,8 +88,9 @@ function assertCompatible(obj, klass, needVer, name) { } var CIPHER_LEN = { - 'des-ede3-cbc': { key: 7, iv: 8 }, - 'aes-128-cbc': { key: 16, iv: 16 } + 'des-ede3-cbc': { key: 24, iv: 8 }, + 'aes-128-cbc': { key: 16, iv: 16 }, + 'aes-256-cbc': { key: 32, iv: 16 } }; var PKCS5_SALT_LEN = 8; @@ -122,6 +125,40 @@ function opensslKeyDeriv(cipher, salt, passphrase, count) { }); } +/* See: RFC2898 */ +function pbkdf2(hashAlg, salt, iterations, size, passphrase) { + var hkey = Buffer.alloc(salt.length + 4); + salt.copy(hkey); + + var gen = 0, ts = []; + var i = 1; + while (gen < size) { + var t = T(i++); + gen += t.length; + ts.push(t); + } + return (Buffer.concat(ts).slice(0, size)); + + function T(I) { + hkey.writeUInt32BE(I, hkey.length - 4); + + var hmac = crypto.createHmac(hashAlg, passphrase); + hmac.update(hkey); + + var Ti = hmac.digest(); + var Uc = Ti; + var c = 1; + while (c++ < iterations) { + hmac = crypto.createHmac(hashAlg, passphrase); + hmac.update(Uc); + Uc = hmac.digest(); + for (var x = 0; x < Ti.length; ++x) + Ti[x] ^= Uc[x]; + } + return (Ti); + } +} + /* Count leading zero bits on a buffer */ function countZeros(buf) { var o = 0, obit = 8; @@ -256,15 +293,9 @@ function calculateDSAPublic(g, p, x) { assert.buffer(g); assert.buffer(p); assert.buffer(x); - try { - var bigInt = require('jsbn').BigInteger; - } catch (e) { - throw (new Error('To load a PKCS#8 format DSA private key, ' + - 'the node jsbn library is required.')); - } - g = new bigInt(g); - p = new bigInt(p); - x = new bigInt(x); + g = new jsbn(g); + p = new jsbn(p); + x = new jsbn(x); var y = g.modPow(x, p); var ybuf = bigintToMpBuf(y); return (ybuf); @@ -273,9 +304,6 @@ function calculateDSAPublic(g, p, x) { function calculateED25519Public(k) { assert.buffer(k); - if (nacl === undefined) - nacl = require('tweetnacl'); - var kp = nacl.sign.keyPair.fromSeed(new Uint8Array(k)); return (Buffer.from(kp.publicKey)); } @@ -283,9 +311,6 @@ function calculateED25519Public(k) { function calculateX25519Public(k) { assert.buffer(k); - if (nacl === undefined) - nacl = require('tweetnacl'); - var kp = nacl.box.keyPair.fromSeed(new Uint8Array(k)); return (Buffer.from(kp.publicKey)); } @@ -293,18 +318,12 @@ function calculateX25519Public(k) { function addRSAMissing(key) { assert.object(key); assertCompatible(key, PrivateKey, [1, 1]); - try { - var bigInt = require('jsbn').BigInteger; - } catch (e) { - throw (new Error('To write a PEM private key from ' + - 'this source, the node jsbn lib is required.')); - } - var d = new bigInt(key.part.d.data); + var d = new jsbn(key.part.d.data); var buf; if (!key.part.dmodp) { - var p = new bigInt(key.part.p.data); + var p = new jsbn(key.part.p.data); var dmodp = d.mod(p.subtract(1)); buf = bigintToMpBuf(dmodp); @@ -312,7 +331,7 @@ function addRSAMissing(key) { key.parts.push(key.part.dmodp); } if (!key.part.dmodq) { - var q = new bigInt(key.part.q.data); + var q = new jsbn(key.part.q.data); var dmodq = d.mod(q.subtract(1)); buf = bigintToMpBuf(dmodq); @@ -324,10 +343,6 @@ function addRSAMissing(key) { function publicFromPrivateECDSA(curveName, priv) { assert.string(curveName, 'curveName'); assert.buffer(priv); - if (ec === undefined) - ec = require('ecc-jsbn/lib/ec'); - if (jsbn === undefined) - jsbn = require('jsbn').BigInteger; var params = algs.curves[curveName]; var p = new jsbn(params.p); var a = new jsbn(params.a); diff --git a/deps/npm/node_modules/sshpk/package.json b/deps/npm/node_modules/sshpk/package.json index 14d6658cebd434..cc78787f8c2af7 100644 --- a/deps/npm/node_modules/sshpk/package.json +++ b/deps/npm/node_modules/sshpk/package.json @@ -1,39 +1,16 @@ { - "_from": "sshpk@^1.7.0", - "_id": "sshpk@1.14.2", - "_inBundle": false, - "_integrity": "sha1-xvxhZIo9nE52T9P8306hBeSSupg=", - "_location": "/sshpk", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "sshpk@^1.7.0", - "name": "sshpk", - "escapedName": "sshpk", - "rawSpec": "^1.7.0", - "saveSpec": null, - "fetchSpec": "^1.7.0" - }, - "_requiredBy": [ - "/http-signature" - ], - "_resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.14.2.tgz", - "_shasum": "c6fc61648a3d9c4e764fd3fcdf4ea105e492ba98", - "_spec": "sshpk@^1.7.0", - "_where": "/Users/rebecca/code/npm/node_modules/http-signature", - "author": { - "name": "Joyent, Inc" - }, - "bin": { - "sshpk-conv": "bin/sshpk-conv", - "sshpk-sign": "bin/sshpk-sign", - "sshpk-verify": "bin/sshpk-verify" + "name": "sshpk", + "version": "1.16.1", + "description": "A library for finding and using SSH public keys", + "main": "lib/index.js", + "scripts": { + "test": "tape test/*.js" }, - "bugs": { - "url": "https://github.com/arekinath/node-sshpk/issues" + "repository": { + "type": "git", + "url": "git+https://github.com/joyent/node-sshpk.git" }, - "bundleDependencies": false, + "author": "Joyent, Inc", "contributors": [ { "name": "Dave Eddy", @@ -48,54 +25,36 @@ "email": "alex@cooperi.net" } ], - "dependencies": { - "asn1": "~0.2.3", - "assert-plus": "^1.0.0", - "bcrypt-pbkdf": "^1.0.0", - "dashdash": "^1.12.0", - "ecc-jsbn": "~0.1.1", - "getpass": "^0.1.1", - "jsbn": "~0.1.0", - "safer-buffer": "^2.0.2", - "tweetnacl": "~0.14.0" + "license": "MIT", + "bugs": { + "url": "https://github.com/arekinath/node-sshpk/issues" }, - "deprecated": false, - "description": "A library for finding and using SSH public keys", - "devDependencies": { - "benchmark": "^1.0.0", - "sinon": "^1.17.2", - "tape": "^3.5.0", - "temp": "^0.8.2" + "engines": { + "node": ">=0.10.0" }, "directories": { "bin": "./bin", "lib": "./lib", "man": "./man/man1" }, - "engines": { - "node": ">=0.10.0" - }, "homepage": "https://github.com/arekinath/node-sshpk#readme", - "license": "MIT", - "main": "lib/index.js", - "man": [ - "/Users/rebecca/code/npm/node_modules/sshpk/man/man1/sshpk-conv.1", - "/Users/rebecca/code/npm/node_modules/sshpk/man/man1/sshpk-sign.1", - "/Users/rebecca/code/npm/node_modules/sshpk/man/man1/sshpk-verify.1" - ], - "name": "sshpk", - "optionalDependencies": { - "bcrypt-pbkdf": "^1.0.0", - "ecc-jsbn": "~0.1.1", + "dependencies": { + "asn1": "~0.2.3", + "assert-plus": "^1.0.0", + "dashdash": "^1.12.0", + "getpass": "^0.1.1", + "safer-buffer": "^2.0.2", "jsbn": "~0.1.0", - "tweetnacl": "~0.14.0" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/arekinath/node-sshpk.git" + "tweetnacl": "~0.14.0", + "ecc-jsbn": "~0.1.1", + "bcrypt-pbkdf": "^1.0.0" }, - "scripts": { - "test": "tape test/*.js" + "optionalDependencies": { }, - "version": "1.14.2" + "devDependencies": { + "tape": "^3.5.0", + "benchmark": "^1.0.0", + "sinon": "^1.17.2", + "temp": "^0.8.2" + } } diff --git a/deps/npm/node_modules/ssri/CHANGELOG.md b/deps/npm/node_modules/ssri/CHANGELOG.md index d4c5897902d12e..822e8506e7c634 100644 --- a/deps/npm/node_modules/ssri/CHANGELOG.md +++ b/deps/npm/node_modules/ssri/CHANGELOG.md @@ -1,29 +1,91 @@ -# Change Log +# 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. +## [8.0.0](https://github.com/npm/ssri/compare/v7.1.0...v8.0.0) (2020-02-18) + + +### ⚠ BREAKING CHANGES + +* SRI values with `../` in the algorithm name now throw +as invalid (which they always probably should have!) +* adds a new error that will be thrown. Empty SRIs are +no longer considered valid for checking, only when using integrityStream +to calculate the SRI value. + +PR-URL: https://github.com/npm/ssri/pull/12 +Credit: @claudiahdz + +### Features + +* remove figgy-pudding ([0e78fd7](https://github.com/npm/ssri/commit/0e78fd7b754e2d098875eb4c57238709d96d7c27)) + + +### Bug Fixes + +* harden SRI parsing against ../ funny business ([4062735](https://github.com/npm/ssri/commit/4062735d1281941fd32ac4320b9f9965fcec278b)) +* IntegrityStream responds to mutating opts object mid-stream ([4a963e5](https://github.com/npm/ssri/commit/4a963e5982478c6b07f86848cdb72d142c765195)) +* throw null when sri is empty or bad ([a6811cb](https://github.com/npm/ssri/commit/a6811cba71e20ea1fdefa6e50c9ea3c67efc2500)), closes [#12](https://github.com/npm/ssri/issues/12) + +## [7.1.0](https://github.com/npm/ssri/compare/v7.0.1...v7.1.0) (2019-10-24) + + +### Bug Fixes + +* Do not blow up if the opts object is mutated ([806e8c8](https://github.com/npm/ssri/commit/806e8c8)) + + +### Features + +* Add Integrity#merge method ([0572c1d](https://github.com/npm/ssri/commit/0572c1d)), closes [#4](https://github.com/npm/ssri/issues/4) + +### [7.0.1](https://github.com/npm/ssri/compare/v7.0.0...v7.0.1) (2019-09-30) + +## [7.0.0](https://github.com/npm/ssri/compare/v6.0.1...v7.0.0) (2019-09-18) + + +### ⚠ BREAKING CHANGES + +* ssri no longer accepts a Promise option, and does not +use, return, or rely on Bluebird promises. +* drop support for Node.js v6. + +We knew this was coming, and the Stream changes are breaking anyway. +May as well do this now. +* **streams:** this replaces the Node.js stream with a Minipass +stream. See http://npm.im/minipass for documentation. + +### Bug Fixes + +* return super.write() return value ([55b055d](https://github.com/npm/ssri/commit/55b055d)) + + +* Use native promises only ([6d13165](https://github.com/npm/ssri/commit/6d13165)) +* update tap, standard, standard-version, travis ([2e54956](https://github.com/npm/ssri/commit/2e54956)) +* **streams:** replace transform streams with minipass ([363995e](https://github.com/npm/ssri/commit/363995e)) + -## [6.0.1](https://github.com/zkat/ssri/compare/v6.0.0...v6.0.1) (2018-08-27) +## [6.0.1](https://github.com/npm/ssri/compare/v6.0.0...v6.0.1) (2018-08-27) ### Bug Fixes -* **opts:** use figgy-pudding to specify consumed opts ([cf86553](https://github.com/zkat/ssri/commit/cf86553)) +* **opts:** use figgy-pudding to specify consumed opts ([cf86553](https://github.com/npm/ssri/commit/cf86553)) -# [6.0.0](https://github.com/zkat/ssri/compare/v5.3.0...v6.0.0) (2018-04-09) +# [6.0.0](https://github.com/npm/ssri/compare/v5.3.0...v6.0.0) (2018-04-09) ### Bug Fixes -* **docs:** minor typo ([b71ef17](https://github.com/zkat/ssri/commit/b71ef17)) +* **docs:** minor typo ([b71ef17](https://github.com/npm/ssri/commit/b71ef17)) ### meta -* drop support for node@4 ([d9bf359](https://github.com/zkat/ssri/commit/d9bf359)) +* drop support for node@4 ([d9bf359](https://github.com/npm/ssri/commit/d9bf359)) ### BREAKING CHANGES @@ -33,78 +95,78 @@ All notable changes to this project will be documented in this file. See [standa -# [5.3.0](https://github.com/zkat/ssri/compare/v5.2.4...v5.3.0) (2018-03-13) +# [5.3.0](https://github.com/npm/ssri/compare/v5.2.4...v5.3.0) (2018-03-13) ### Features -* **checkData:** optionally throw when checkData fails ([bf26b84](https://github.com/zkat/ssri/commit/bf26b84)) +* **checkData:** optionally throw when checkData fails ([bf26b84](https://github.com/npm/ssri/commit/bf26b84)) -## [5.2.4](https://github.com/zkat/ssri/compare/v5.2.3...v5.2.4) (2018-02-16) +## [5.2.4](https://github.com/npm/ssri/compare/v5.2.3...v5.2.4) (2018-02-16) -## [5.2.3](https://github.com/zkat/ssri/compare/v5.2.2...v5.2.3) (2018-02-16) +## [5.2.3](https://github.com/npm/ssri/compare/v5.2.2...v5.2.3) (2018-02-16) ### Bug Fixes -* **hashes:** filter hash priority list by available hashes ([2fa30b8](https://github.com/zkat/ssri/commit/2fa30b8)) -* **integrityStream:** dedupe algorithms to generate ([d56c654](https://github.com/zkat/ssri/commit/d56c654)) +* **hashes:** filter hash priority list by available hashes ([2fa30b8](https://github.com/npm/ssri/commit/2fa30b8)) +* **integrityStream:** dedupe algorithms to generate ([d56c654](https://github.com/npm/ssri/commit/d56c654)) -## [5.2.2](https://github.com/zkat/ssri/compare/v5.2.1...v5.2.2) (2018-02-14) +## [5.2.2](https://github.com/npm/ssri/compare/v5.2.1...v5.2.2) (2018-02-14) ### Bug Fixes -* **security:** tweak strict SRI regex ([#10](https://github.com/zkat/ssri/issues/10)) ([d0ebcdc](https://github.com/zkat/ssri/commit/d0ebcdc)) +* **security:** tweak strict SRI regex ([#10](https://github.com/npm/ssri/issues/10)) ([d0ebcdc](https://github.com/npm/ssri/commit/d0ebcdc)) -## [5.2.1](https://github.com/zkat/ssri/compare/v5.2.0...v5.2.1) (2018-02-06) +## [5.2.1](https://github.com/npm/ssri/compare/v5.2.0...v5.2.1) (2018-02-06) -# [5.2.0](https://github.com/zkat/ssri/compare/v5.1.0...v5.2.0) (2018-02-06) +# [5.2.0](https://github.com/npm/ssri/compare/v5.1.0...v5.2.0) (2018-02-06) ### Features -* **match:** add integrity.match() ([3c49cc4](https://github.com/zkat/ssri/commit/3c49cc4)) +* **match:** add integrity.match() ([3c49cc4](https://github.com/npm/ssri/commit/3c49cc4)) -# [5.1.0](https://github.com/zkat/ssri/compare/v5.0.0...v5.1.0) (2018-01-18) +# [5.1.0](https://github.com/npm/ssri/compare/v5.0.0...v5.1.0) (2018-01-18) ### Bug Fixes -* **checkStream:** integrityStream now takes opts.integrity algos into account ([d262910](https://github.com/zkat/ssri/commit/d262910)) +* **checkStream:** integrityStream now takes opts.integrity algos into account ([d262910](https://github.com/npm/ssri/commit/d262910)) ### Features -* **sha3:** do some guesswork about upcoming sha3 ([7fdd9df](https://github.com/zkat/ssri/commit/7fdd9df)) +* **sha3:** do some guesswork about upcoming sha3 ([7fdd9df](https://github.com/npm/ssri/commit/7fdd9df)) -# [5.0.0](https://github.com/zkat/ssri/compare/v4.1.6...v5.0.0) (2017-10-23) +# [5.0.0](https://github.com/npm/ssri/compare/v4.1.6...v5.0.0) (2017-10-23) ### Features -* **license:** relicense to ISC (#9) ([c82983a](https://github.com/zkat/ssri/commit/c82983a)) +* **license:** relicense to ISC (#9) ([c82983a](https://github.com/npm/ssri/commit/c82983a)) ### BREAKING CHANGES @@ -114,82 +176,82 @@ All notable changes to this project will be documented in this file. See [standa -## [4.1.6](https://github.com/zkat/ssri/compare/v4.1.5...v4.1.6) (2017-06-07) +## [4.1.6](https://github.com/npm/ssri/compare/v4.1.5...v4.1.6) (2017-06-07) ### Bug Fixes -* **checkStream:** make sure to pass all opts through ([0b1bcbe](https://github.com/zkat/ssri/commit/0b1bcbe)) +* **checkStream:** make sure to pass all opts through ([0b1bcbe](https://github.com/npm/ssri/commit/0b1bcbe)) -## [4.1.5](https://github.com/zkat/ssri/compare/v4.1.4...v4.1.5) (2017-06-05) +## [4.1.5](https://github.com/npm/ssri/compare/v4.1.4...v4.1.5) (2017-06-05) ### Bug Fixes -* **integrityStream:** stop crashing if opts.algorithms and opts.integrity have an algo mismatch ([fb1293e](https://github.com/zkat/ssri/commit/fb1293e)) +* **integrityStream:** stop crashing if opts.algorithms and opts.integrity have an algo mismatch ([fb1293e](https://github.com/npm/ssri/commit/fb1293e)) -## [4.1.4](https://github.com/zkat/ssri/compare/v4.1.3...v4.1.4) (2017-05-31) +## [4.1.4](https://github.com/npm/ssri/compare/v4.1.3...v4.1.4) (2017-05-31) ### Bug Fixes -* **node:** older versions of node[@4](https://github.com/4) do not support base64buffer string parsing ([513df4e](https://github.com/zkat/ssri/commit/513df4e)) +* **node:** older versions of node[@4](https://github.com/4) do not support base64buffer string parsing ([513df4e](https://github.com/npm/ssri/commit/513df4e)) -## [4.1.3](https://github.com/zkat/ssri/compare/v4.1.2...v4.1.3) (2017-05-24) +## [4.1.3](https://github.com/npm/ssri/compare/v4.1.2...v4.1.3) (2017-05-24) ### Bug Fixes -* **check:** handle various bad hash corner cases better ([c2c262b](https://github.com/zkat/ssri/commit/c2c262b)) +* **check:** handle various bad hash corner cases better ([c2c262b](https://github.com/npm/ssri/commit/c2c262b)) -## [4.1.2](https://github.com/zkat/ssri/compare/v4.1.1...v4.1.2) (2017-04-18) +## [4.1.2](https://github.com/npm/ssri/compare/v4.1.1...v4.1.2) (2017-04-18) ### Bug Fixes -* **stream:** _flush can be called multiple times. use on("end") ([b1c4805](https://github.com/zkat/ssri/commit/b1c4805)) +* **stream:** _flush can be called multiple times. use on("end") ([b1c4805](https://github.com/npm/ssri/commit/b1c4805)) -## [4.1.1](https://github.com/zkat/ssri/compare/v4.1.0...v4.1.1) (2017-04-12) +## [4.1.1](https://github.com/npm/ssri/compare/v4.1.0...v4.1.1) (2017-04-12) ### Bug Fixes -* **pickAlgorithm:** error if pickAlgorithm() is used in an empty Integrity ([fab470e](https://github.com/zkat/ssri/commit/fab470e)) +* **pickAlgorithm:** error if pickAlgorithm() is used in an empty Integrity ([fab470e](https://github.com/npm/ssri/commit/fab470e)) -# [4.1.0](https://github.com/zkat/ssri/compare/v4.0.0...v4.1.0) (2017-04-07) +# [4.1.0](https://github.com/npm/ssri/compare/v4.0.0...v4.1.0) (2017-04-07) ### Features -* adding ssri.create for a crypto style interface (#2) ([96f52ad](https://github.com/zkat/ssri/commit/96f52ad)) +* adding ssri.create for a crypto style interface (#2) ([96f52ad](https://github.com/npm/ssri/commit/96f52ad)) -# [4.0.0](https://github.com/zkat/ssri/compare/v3.0.2...v4.0.0) (2017-04-03) +# [4.0.0](https://github.com/npm/ssri/compare/v3.0.2...v4.0.0) (2017-04-03) ### Bug Fixes -* **integrity:** should have changed the error code before. oops ([8381afa](https://github.com/zkat/ssri/commit/8381afa)) +* **integrity:** should have changed the error code before. oops ([8381afa](https://github.com/npm/ssri/commit/8381afa)) ### BREAKING CHANGES @@ -199,40 +261,40 @@ All notable changes to this project will be documented in this file. See [standa -## [3.0.2](https://github.com/zkat/ssri/compare/v3.0.1...v3.0.2) (2017-04-03) +## [3.0.2](https://github.com/npm/ssri/compare/v3.0.1...v3.0.2) (2017-04-03) -## [3.0.1](https://github.com/zkat/ssri/compare/v3.0.0...v3.0.1) (2017-04-03) +## [3.0.1](https://github.com/npm/ssri/compare/v3.0.0...v3.0.1) (2017-04-03) ### Bug Fixes -* **package.json:** really should have these in the keywords because search ([a6ac6d0](https://github.com/zkat/ssri/commit/a6ac6d0)) +* **package.json:** really should have these in the keywords because search ([a6ac6d0](https://github.com/npm/ssri/commit/a6ac6d0)) -# [3.0.0](https://github.com/zkat/ssri/compare/v2.0.0...v3.0.0) (2017-04-03) +# [3.0.0](https://github.com/npm/ssri/compare/v2.0.0...v3.0.0) (2017-04-03) ### Bug Fixes -* **hashes:** IntegrityMetadata -> Hash ([d04aa1f](https://github.com/zkat/ssri/commit/d04aa1f)) +* **hashes:** IntegrityMetadata -> Hash ([d04aa1f](https://github.com/npm/ssri/commit/d04aa1f)) ### Features -* **check:** return IntegrityMetadata on check success ([2301e74](https://github.com/zkat/ssri/commit/2301e74)) -* **fromHex:** ssri.fromHex to make it easier to generate them from hex valus ([049b89e](https://github.com/zkat/ssri/commit/049b89e)) -* **hex:** utility function for getting hex version of digest ([a9f021c](https://github.com/zkat/ssri/commit/a9f021c)) -* **hexDigest:** added hexDigest method to Integrity objects too ([85208ba](https://github.com/zkat/ssri/commit/85208ba)) -* **integrity:** add .isIntegrity and .isIntegrityMetadata ([1b29e6f](https://github.com/zkat/ssri/commit/1b29e6f)) -* **integrityStream:** new stream that can both generate and check streamed data ([fd23e1b](https://github.com/zkat/ssri/commit/fd23e1b)) -* **parse:** allow parsing straight into a single IntegrityMetadata object ([c8ddf48](https://github.com/zkat/ssri/commit/c8ddf48)) -* **pickAlgorithm:** Intergrity#pickAlgorithm() added ([b97a796](https://github.com/zkat/ssri/commit/b97a796)) -* **size:** calculate and update stream sizes ([02ed1ad](https://github.com/zkat/ssri/commit/02ed1ad)) +* **check:** return IntegrityMetadata on check success ([2301e74](https://github.com/npm/ssri/commit/2301e74)) +* **fromHex:** ssri.fromHex to make it easier to generate them from hex valus ([049b89e](https://github.com/npm/ssri/commit/049b89e)) +* **hex:** utility function for getting hex version of digest ([a9f021c](https://github.com/npm/ssri/commit/a9f021c)) +* **hexDigest:** added hexDigest method to Integrity objects too ([85208ba](https://github.com/npm/ssri/commit/85208ba)) +* **integrity:** add .isIntegrity and .isIntegrityMetadata ([1b29e6f](https://github.com/npm/ssri/commit/1b29e6f)) +* **integrityStream:** new stream that can both generate and check streamed data ([fd23e1b](https://github.com/npm/ssri/commit/fd23e1b)) +* **parse:** allow parsing straight into a single IntegrityMetadata object ([c8ddf48](https://github.com/npm/ssri/commit/c8ddf48)) +* **pickAlgorithm:** Intergrity#pickAlgorithm() added ([b97a796](https://github.com/npm/ssri/commit/b97a796)) +* **size:** calculate and update stream sizes ([02ed1ad](https://github.com/npm/ssri/commit/02ed1ad)) ### BREAKING CHANGES @@ -246,22 +308,22 @@ To convert existing createCheckerStream code, move the `sri` argument into `opts -# [2.0.0](https://github.com/zkat/ssri/compare/v1.0.0...v2.0.0) (2017-03-24) +# [2.0.0](https://github.com/npm/ssri/compare/v1.0.0...v2.0.0) (2017-03-24) ### Bug Fixes -* **strict-mode:** make regexes more rigid ([122a32c](https://github.com/zkat/ssri/commit/122a32c)) +* **strict-mode:** make regexes more rigid ([122a32c](https://github.com/npm/ssri/commit/122a32c)) ### Features -* **api:** added serialize alias for unparse ([999b421](https://github.com/zkat/ssri/commit/999b421)) -* **concat:** add Integrity#concat() ([cae12c7](https://github.com/zkat/ssri/commit/cae12c7)) -* **pickAlgo:** pick the strongest algorithm provided, by default ([58c18f7](https://github.com/zkat/ssri/commit/58c18f7)) -* **strict-mode:** strict SRI support ([3f0b64c](https://github.com/zkat/ssri/commit/3f0b64c)) -* **stringify:** replaced unparse/serialize with stringify ([4acad30](https://github.com/zkat/ssri/commit/4acad30)) -* **verification:** add opts.pickAlgorithm ([f72e658](https://github.com/zkat/ssri/commit/f72e658)) +* **api:** added serialize alias for unparse ([999b421](https://github.com/npm/ssri/commit/999b421)) +* **concat:** add Integrity#concat() ([cae12c7](https://github.com/npm/ssri/commit/cae12c7)) +* **pickAlgo:** pick the strongest algorithm provided, by default ([58c18f7](https://github.com/npm/ssri/commit/58c18f7)) +* **strict-mode:** strict SRI support ([3f0b64c](https://github.com/npm/ssri/commit/3f0b64c)) +* **stringify:** replaced unparse/serialize with stringify ([4acad30](https://github.com/npm/ssri/commit/4acad30)) +* **verification:** add opts.pickAlgorithm ([f72e658](https://github.com/npm/ssri/commit/f72e658)) ### BREAKING CHANGES @@ -278,7 +340,7 @@ To convert existing createCheckerStream code, move the `sri` argument into `opts ### Features -* **api:** implemented initial api ([4fbb16b](https://github.com/zkat/ssri/commit/4fbb16b)) +* **api:** implemented initial api ([4fbb16b](https://github.com/npm/ssri/commit/4fbb16b)) ### BREAKING CHANGES diff --git a/deps/npm/node_modules/ssri/README.md b/deps/npm/node_modules/ssri/README.md index c250961bd3c6ba..0cd41be8985966 100644 --- a/deps/npm/node_modules/ssri/README.md +++ b/deps/npm/node_modules/ssri/README.md @@ -1,6 +1,6 @@ -# ssri [![npm version](https://img.shields.io/npm/v/ssri.svg)](https://npm.im/ssri) [![license](https://img.shields.io/npm/l/ssri.svg)](https://npm.im/ssri) [![Travis](https://img.shields.io/travis/zkat/ssri.svg)](https://travis-ci.org/zkat/ssri) [![AppVeyor](https://ci.appveyor.com/api/projects/status/github/zkat/ssri?svg=true)](https://ci.appveyor.com/project/zkat/ssri) [![Coverage Status](https://coveralls.io/repos/github/zkat/ssri/badge.svg?branch=latest)](https://coveralls.io/github/zkat/ssri?branch=latest) +# ssri [![npm version](https://img.shields.io/npm/v/ssri.svg)](https://npm.im/ssri) [![license](https://img.shields.io/npm/l/ssri.svg)](https://npm.im/ssri) [![Travis](https://img.shields.io/travis/npm/ssri.svg)](https://travis-ci.org/npm/ssri) [![AppVeyor](https://ci.appveyor.com/api/projects/status/github/npm/ssri?svg=true)](https://ci.appveyor.com/project/npm/ssri) [![Coverage Status](https://coveralls.io/repos/github/npm/ssri/badge.svg?branch=latest)](https://coveralls.io/github/npm/ssri?branch=latest) -[`ssri`](https://github.com/zkat/ssri), short for Standard Subresource +[`ssri`](https://github.com/npm/ssri), short for Standard Subresource Integrity, is a Node.js utility for parsing, manipulating, serializing, generating, and verifying [Subresource Integrity](https://w3c.github.io/webappsec/specs/subresourceintegrity/) hashes. @@ -19,6 +19,7 @@ Integrity](https://w3c.github.io/webappsec/specs/subresourceintegrity/) hashes. * [`parse`](#parse) * [`stringify`](#stringify) * [`Integrity#concat`](#integrity-concat) + * [`Integrity#merge`](#integrity-merge) * [`Integrity#toString`](#integrity-to-string) * [`Integrity#toJSON`](#integrity-to-json) * [`Integrity#match`](#integrity-match) @@ -184,6 +185,45 @@ const mobileIntegrity = ssri.fromData(fs.readFileSync('./index.mobile.js')) desktopIntegrity.concat(mobileIntegrity) ``` +#### `> Integrity#merge(otherIntegrity, [opts])` + +Safely merges another IntegrityLike or integrity string into an `Integrity` +object. + +If the other integrity value has any algorithms in common with the current +object, then the hash digests must match, or an error is thrown. + +Any new hashes will be added to the current object's set. + +This is useful when an integrity value may be upgraded with a stronger +algorithm, you wish to prevent accidentally supressing integrity errors by +overwriting the expected integrity value. + +##### Example + +```javascript +const data = fs.readFileSync('data.txt') + +// integrity.txt contains 'sha1-X1UT+IIv2+UUWvM7ZNjZcNz5XG4=' +// because we were young, and didn't realize sha1 would not last +const expectedIntegrity = ssri.parse(fs.readFileSync('integrity.txt', 'utf8')) +const match = ssri.checkData(data, expectedIntegrity, { + algorithms: ['sha512', 'sha1'] +}) +if (!match) { + throw new Error('data corrupted or something!') +} + +// get a stronger algo! +if (match && match.algorithm !== 'sha512') { + const updatedIntegrity = ssri.fromData(data, { algorithms: ['sha512'] }) + expectedIntegrity.merge(updatedIntegrity) + fs.writeFileSync('integrity.txt', expectedIntegrity.toString()) + // file now contains + // 'sha1-X1UT+IIv2+UUWvM7ZNjZcNz5XG4= sha512-yzd8ELD1piyANiWnmdnpCL5F52f10UfUdEkHywVZeqTt0ymgrxR63Qz0GB7TKPoeeZQmWCaz7T1+9vBnypkYWg==' +} +``` + #### `> Integrity#toString([opts]) -> String` Returns the string representation of an `Integrity` object. All hash entries diff --git a/deps/npm/node_modules/ssri/index.js b/deps/npm/node_modules/ssri/index.js index e102892b0bcd08..950548cf28f2e6 100644 --- a/deps/npm/node_modules/ssri/index.js +++ b/deps/npm/node_modules/ssri/index.js @@ -1,41 +1,129 @@ 'use strict' const crypto = require('crypto') -const figgyPudding = require('figgy-pudding') -const Transform = require('stream').Transform +const MiniPass = require('minipass') const SPEC_ALGORITHMS = ['sha256', 'sha384', 'sha512'] +// TODO: this should really be a hardcoded list of algorithms we support, +// rather than [a-z0-9]. const BASE64_REGEX = /^[a-z0-9+/]+(?:=?=?)$/i -const SRI_REGEX = /^([^-]+)-([^?]+)([?\S*]*)$/ -const STRICT_SRI_REGEX = /^([^-]+)-([A-Za-z0-9+/=]{44,88})(\?[\x21-\x7E]*)*$/ +const SRI_REGEX = /^([a-z0-9]+)-([^?]+)([?\S*]*)$/ +const STRICT_SRI_REGEX = /^([a-z0-9]+)-([A-Za-z0-9+/=]{44,88})(\?[\x21-\x7E]*)*$/ const VCHAR_REGEX = /^[\x21-\x7E]+$/ -const SsriOpts = figgyPudding({ - algorithms: {default: ['sha512']}, - error: {default: false}, - integrity: {}, - options: {default: []}, - pickAlgorithm: {default: () => getPrioritizedHash}, - Promise: {default: () => Promise}, - sep: {default: ' '}, - single: {default: false}, - size: {}, - strict: {default: false} -}) +const defaultOpts = { + algorithms: ['sha512'], + error: false, + options: [], + pickAlgorithm: getPrioritizedHash, + sep: ' ', + single: false, + strict: false +} + +const ssriOpts = (opts = {}) => ({ ...defaultOpts, ...opts }) + +const getOptString = options => !options || !options.length ? '' + : `?${options.join('?')}` + +const _onEnd = Symbol('_onEnd') +const _getOptions = Symbol('_getOptions') +class IntegrityStream extends MiniPass { + constructor (opts) { + super() + this.size = 0 + this.opts = opts + + // may be overridden later, but set now for class consistency + this[_getOptions]() + + // options used for calculating stream. can't be changed. + const { algorithms = defaultOpts.algorithms } = opts + this.algorithms = Array.from( + new Set(algorithms.concat(this.algorithm ? [this.algorithm] : [])) + ) + this.hashes = this.algorithms.map(crypto.createHash) + } + + [_getOptions] () { + const { + integrity, + size, + options + } = { ...defaultOpts, ...this.opts } + + // For verification + this.sri = integrity ? parse(integrity, this.opts) : null + this.expectedSize = size + this.goodSri = this.sri ? !!Object.keys(this.sri).length : false + this.algorithm = this.goodSri ? this.sri.pickAlgorithm(this.opts) : null + this.digests = this.goodSri ? this.sri[this.algorithm] : null + this.optString = getOptString(options) + } + + emit (ev, data) { + if (ev === 'end') this[_onEnd]() + return super.emit(ev, data) + } + + write (data) { + this.size += data.length + this.hashes.forEach(h => h.update(data)) + return super.write(data) + } + + [_onEnd] () { + if (!this.goodSri) { + this[_getOptions]() + } + const newSri = parse(this.hashes.map((h, i) => { + return `${this.algorithms[i]}-${h.digest('base64')}${this.optString}` + }).join(' '), this.opts) + // Integrity verification mode + const match = this.goodSri && newSri.match(this.sri, this.opts) + if (typeof this.expectedSize === 'number' && this.size !== this.expectedSize) { + const err = new Error(`stream size mismatch when checking ${this.sri}.\n Wanted: ${this.expectedSize}\n Found: ${this.size}`) + err.code = 'EBADSIZE' + err.found = this.size + err.expected = this.expectedSize + err.sri = this.sri + this.emit('error', err) + } else if (this.sri && !match) { + const err = new Error(`${this.sri} integrity checksum failed when using ${this.algorithm}: wanted ${this.digests} but got ${newSri}. (${this.size} bytes)`) + err.code = 'EINTEGRITY' + err.found = newSri + err.expected = this.digests + err.algorithm = this.algorithm + err.sri = this.sri + this.emit('error', err) + } else { + this.emit('size', this.size) + this.emit('integrity', newSri) + match && this.emit('verified', match) + } + } +} class Hash { get isHash () { return true } constructor (hash, opts) { - opts = SsriOpts(opts) + opts = ssriOpts(opts) const strict = !!opts.strict this.source = hash.trim() + + // set default values so that we make V8 happy to + // always see a familiar object template. + this.digest = '' + this.algorithm = '' + this.options = [] + // 3.1. Integrity metadata (called "Hash" by ssri) // https://w3c.github.io/webappsec-subresource-integrity/#integrity-metadata-description const match = this.source.match( strict - ? STRICT_SRI_REGEX - : SRI_REGEX + ? STRICT_SRI_REGEX + : SRI_REGEX ) if (!match) { return } if (strict && !SPEC_ALGORITHMS.some(a => a === match[1])) { return } @@ -43,16 +131,21 @@ class Hash { this.digest = match[2] const rawOpts = match[3] - this.options = rawOpts ? rawOpts.slice(1).split('?') : [] + if (rawOpts) { + this.options = rawOpts.slice(1).split('?') + } } + hexDigest () { return this.digest && Buffer.from(this.digest, 'base64').toString('hex') } + toJSON () { return this.toString() } + toString (opts) { - opts = SsriOpts(opts) + opts = ssriOpts(opts) if (opts.strict) { // Strict mode enforces the standard as close to the foot of the // letter as it can. @@ -68,14 +161,14 @@ class Hash { // Option syntax is strictly visual chars. // https://w3c.github.io/webappsec-subresource-integrity/#grammardef-option-expression // https://tools.ietf.org/html/rfc5234#appendix-B.1 - (this.options || []).every(opt => opt.match(VCHAR_REGEX)) + this.options.every(opt => opt.match(VCHAR_REGEX)) )) { return '' } } const options = this.options && this.options.length - ? `?${this.options.join('?')}` - : '' + ? `?${this.options.join('?')}` + : '' return `${this.algorithm}-${this.digest}${options}` } } @@ -85,8 +178,13 @@ class Integrity { toJSON () { return this.toString() } + + isEmpty () { + return Object.keys(this).length === 0 + } + toString (opts) { - opts = SsriOpts(opts) + opts = ssriOpts(opts) let sep = opts.sep || ' ' if (opts.strict) { // Entries must be separated by whitespace, according to spec. @@ -98,18 +196,39 @@ class Integrity { }).filter(x => x.length).join(sep) }).filter(x => x.length).join(sep) } + concat (integrity, opts) { - opts = SsriOpts(opts) + opts = ssriOpts(opts) const other = typeof integrity === 'string' - ? integrity - : stringify(integrity, opts) + ? integrity + : stringify(integrity, opts) return parse(`${this.toString(opts)} ${other}`, opts) } + hexDigest () { - return parse(this, {single: true}).hexDigest() + return parse(this, { single: true }).hexDigest() } + + // add additional hashes to an integrity value, but prevent + // *changing* an existing integrity hash. + merge (integrity, opts) { + opts = ssriOpts(opts) + const other = parse(integrity, opts) + for (const algo in other) { + if (this[algo]) { + if (!this[algo].find(hash => + other[algo].find(otherhash => + hash.digest === otherhash.digest))) { + throw new Error('hashes do not match, cannot update integrity') + } + } else { + this[algo] = other[algo] + } + } + } + match (integrity, opts) { - opts = SsriOpts(opts) + opts = ssriOpts(opts) const other = parse(integrity, opts) const algo = other.pickAlgorithm(opts) return ( @@ -122,15 +241,11 @@ class Integrity { ) ) || false } + pickAlgorithm (opts) { - opts = SsriOpts(opts) + opts = ssriOpts(opts) const pickAlgorithm = opts.pickAlgorithm const keys = Object.keys(this) - if (!keys.length) { - throw new Error(`No algorithms available for ${ - JSON.stringify(this.toString()) - }`) - } return keys.reduce((acc, algo) => { return pickAlgorithm(acc, algo) || acc }) @@ -139,7 +254,8 @@ class Integrity { module.exports.parse = parse function parse (sri, opts) { - opts = SsriOpts(opts) + if (!sri) return null + opts = ssriOpts(opts) if (typeof sri === 'string') { return _parse(sri, opts) } else if (sri.algorithm && sri.digest) { @@ -157,7 +273,7 @@ function _parse (integrity, opts) { if (opts.single) { return new Hash(integrity, opts) } - return integrity.trim().split(/\s+/).reduce((acc, string) => { + const hashes = integrity.trim().split(/\s+/).reduce((acc, string) => { const hash = new Hash(string, opts) if (hash.algorithm && hash.digest) { const algo = hash.algorithm @@ -166,11 +282,12 @@ function _parse (integrity, opts) { } return acc }, new Integrity()) + return hashes.isEmpty() ? null : hashes } module.exports.stringify = stringify function stringify (obj, opts) { - opts = SsriOpts(opts) + opts = ssriOpts(opts) if (obj.algorithm && obj.digest) { return Hash.prototype.toString.call(obj, opts) } else if (typeof obj === 'string') { @@ -182,10 +299,8 @@ function stringify (obj, opts) { module.exports.fromHex = fromHex function fromHex (hexDigest, algorithm, opts) { - opts = SsriOpts(opts) - const optString = opts.options && opts.options.length - ? `?${opts.options.join('?')}` - : '' + opts = ssriOpts(opts) + const optString = getOptString(opts.options) return parse( `${algorithm}-${ Buffer.from(hexDigest, 'hex').toString('base64') @@ -195,17 +310,18 @@ function fromHex (hexDigest, algorithm, opts) { module.exports.fromData = fromData function fromData (data, opts) { - opts = SsriOpts(opts) + opts = ssriOpts(opts) const algorithms = opts.algorithms - const optString = opts.options && opts.options.length - ? `?${opts.options.join('?')}` - : '' + const optString = getOptString(opts.options) return algorithms.reduce((acc, algo) => { const digest = crypto.createHash(algo).update(data).digest('base64') const hash = new Hash( `${algo}-${digest}${optString}`, - opts + opts ) + /* istanbul ignore else - it would be VERY strange if the string we + * just calculated with an algo did not have an algo or digest. + */ if (hash.algorithm && hash.digest) { const algo = hash.algorithm if (!acc[algo]) { acc[algo] = [] } @@ -217,10 +333,9 @@ function fromData (data, opts) { module.exports.fromStream = fromStream function fromStream (stream, opts) { - opts = SsriOpts(opts) - const P = opts.Promise || Promise + opts = ssriOpts(opts) const istream = integrityStream(opts) - return new P((resolve, reject) => { + return new Promise((resolve, reject) => { stream.pipe(istream) stream.on('error', reject) istream.on('error', reject) @@ -233,9 +348,9 @@ function fromStream (stream, opts) { module.exports.checkData = checkData function checkData (data, sri, opts) { - opts = SsriOpts(opts) + opts = ssriOpts(opts) sri = parse(sri, opts) - if (!Object.keys(sri).length) { + if (!sri || !Object.keys(sri).length) { if (opts.error) { throw Object.assign( new Error('No valid integrity hashes to check against'), { @@ -248,7 +363,7 @@ function checkData (data, sri, opts) { } const algorithm = sri.pickAlgorithm(opts) const digest = crypto.createHash(algorithm).update(data).digest('base64') - const newSri = parse({algorithm, digest}) + const newSri = parse({ algorithm, digest }) const match = newSri.match(sri, opts) if (match || !opts.error) { return match @@ -272,12 +387,18 @@ function checkData (data, sri, opts) { module.exports.checkStream = checkStream function checkStream (stream, sri, opts) { - opts = SsriOpts(opts) - const P = opts.Promise || Promise - const checker = integrityStream(opts.concat({ - integrity: sri - })) - return new P((resolve, reject) => { + opts = ssriOpts(opts) + opts.integrity = sri + sri = parse(sri, opts) + if (!sri || !Object.keys(sri).length) { + return Promise.reject(Object.assign( + new Error('No valid integrity hashes to check against'), { + code: 'EINTEGRITY' + } + )) + } + const checker = integrityStream(opts) + return new Promise((resolve, reject) => { stream.pipe(checker) stream.on('error', reject) checker.on('error', reject) @@ -289,65 +410,15 @@ function checkStream (stream, sri, opts) { } module.exports.integrityStream = integrityStream -function integrityStream (opts) { - opts = SsriOpts(opts) - // For verification - const sri = opts.integrity && parse(opts.integrity, opts) - const goodSri = sri && Object.keys(sri).length - const algorithm = goodSri && sri.pickAlgorithm(opts) - const digests = goodSri && sri[algorithm] - // Calculating stream - const algorithms = Array.from( - new Set(opts.algorithms.concat(algorithm ? [algorithm] : [])) - ) - const hashes = algorithms.map(crypto.createHash) - let streamSize = 0 - const stream = new Transform({ - transform (chunk, enc, cb) { - streamSize += chunk.length - hashes.forEach(h => h.update(chunk, enc)) - cb(null, chunk, enc) - } - }).on('end', () => { - const optString = (opts.options && opts.options.length) - ? `?${opts.options.join('?')}` - : '' - const newSri = parse(hashes.map((h, i) => { - return `${algorithms[i]}-${h.digest('base64')}${optString}` - }).join(' '), opts) - // Integrity verification mode - const match = goodSri && newSri.match(sri, opts) - if (typeof opts.size === 'number' && streamSize !== opts.size) { - const err = new Error(`stream size mismatch when checking ${sri}.\n Wanted: ${opts.size}\n Found: ${streamSize}`) - err.code = 'EBADSIZE' - err.found = streamSize - err.expected = opts.size - err.sri = sri - stream.emit('error', err) - } else if (opts.integrity && !match) { - const err = new Error(`${sri} integrity checksum failed when using ${algorithm}: wanted ${digests} but got ${newSri}. (${streamSize} bytes)`) - err.code = 'EINTEGRITY' - err.found = newSri - err.expected = digests - err.algorithm = algorithm - err.sri = sri - stream.emit('error', err) - } else { - stream.emit('size', streamSize) - stream.emit('integrity', newSri) - match && stream.emit('verified', match) - } - }) - return stream +function integrityStream (opts = {}) { + return new IntegrityStream(opts) } module.exports.create = createIntegrity function createIntegrity (opts) { - opts = SsriOpts(opts) + opts = ssriOpts(opts) const algorithms = opts.algorithms - const optString = opts.options.length - ? `?${opts.options.join('?')}` - : '' + const optString = getOptString(opts.options) const hashes = algorithms.map(crypto.createHash) @@ -363,6 +434,9 @@ function createIntegrity (opts) { `${algo}-${digest}${optString}`, opts ) + /* istanbul ignore else - it would be VERY strange if the hash we + * just calculated with an algo did not have an algo or digest. + */ if (hash.algorithm && hash.digest) { const algo = hash.algorithm if (!acc[algo]) { acc[algo] = [] } @@ -390,6 +464,6 @@ const DEFAULT_PRIORITY = [ function getPrioritizedHash (algo1, algo2) { return DEFAULT_PRIORITY.indexOf(algo1.toLowerCase()) >= DEFAULT_PRIORITY.indexOf(algo2.toLowerCase()) - ? algo1 - : algo2 + ? algo1 + : algo2 } diff --git a/deps/npm/node_modules/ssri/package.json b/deps/npm/node_modules/ssri/package.json index 5dd740daa27827..aece8a6fbbd1d5 100644 --- a/deps/npm/node_modules/ssri/package.json +++ b/deps/npm/node_modules/ssri/package.json @@ -1,64 +1,23 @@ { - "_from": "ssri@latest", - "_id": "ssri@6.0.1", - "_inBundle": false, - "_integrity": "sha512-3Wge10hNcT1Kur4PDFwEieXSCMCJs/7WvSACcrMYrNp+b8kDL1/0wJch5Ni2WrtwEa2IO8OsVfeKIciKCDx/QA==", - "_location": "/ssri", - "_phantomChildren": {}, - "_requested": { - "type": "tag", - "registry": true, - "raw": "ssri@latest", - "name": "ssri", - "escapedName": "ssri", - "rawSpec": "latest", - "saveSpec": null, - "fetchSpec": "latest" - }, - "_requiredBy": [ - "#USER", - "/", - "/cacache", - "/make-fetch-happen", - "/pacote" - ], - "_resolved": "https://registry.npmjs.org/ssri/-/ssri-6.0.1.tgz", - "_shasum": "2a3c41b28dd45b62b63676ecb74001265ae9edd8", - "_spec": "ssri@latest", - "_where": "/Users/zkat/Documents/code/work/npm", - "author": { - "name": "Kat Marchán", - "email": "kzm@sykosomatic.org" - }, - "bugs": { - "url": "https://github.com/zkat/ssri/issues" - }, - "bundleDependencies": false, - "config": { - "nyc": { - "exclude": [ - "node_modules/**", - "test/**" - ] - } + "name": "ssri", + "version": "8.0.0", + "description": "Standard Subresource Integrity library -- parses, serializes, generates, and verifies integrity metadata according to the SRI spec.", + "main": "index.js", + "files": [], + "scripts": { + "prerelease": "npm t", + "postrelease": "npm publish", + "prepublishOnly": "git push --follow-tags", + "posttest": "npm run lint", + "release": "standard-version -s", + "test": "tap", + "coverage": "tap", + "lint": "standard" }, - "dependencies": { - "figgy-pudding": "^3.5.1" + "tap": { + "check-coverage": true }, - "deprecated": false, - "description": "Standard Subresource Integrity library -- parses, serializes, generates, and verifies integrity metadata according to the SRI spec.", - "devDependencies": { - "nyc": "^11.4.1", - "standard": "^10.0.3", - "standard-version": "^4.3.0", - "tap": "^11.1.0", - "weallbehave": "^1.2.0", - "weallcontribute": "^1.0.8" - }, - "files": [ - "*.js" - ], - "homepage": "https://github.com/zkat/ssri#readme", + "repository": "https://github.com/npm/ssri", "keywords": [ "w3c", "web", @@ -73,21 +32,21 @@ "sri generator", "html" ], + "author": { + "name": "Kat Marchán", + "email": "kzm@sykosomatic.org", + "twitter": "maybekatz" + }, "license": "ISC", - "main": "index.js", - "name": "ssri", - "repository": { - "type": "git", - "url": "git+https://github.com/zkat/ssri.git" + "dependencies": { + "minipass": "^3.1.1" }, - "scripts": { - "postrelease": "npm publish && git push --follow-tags", - "prerelease": "npm t", - "pretest": "standard", - "release": "standard-version -s", - "test": "tap -J --coverage test/*.js", - "update-coc": "weallbehave -o . && git add CODE_OF_CONDUCT.md && git commit -m 'docs(coc): updated CODE_OF_CONDUCT.md'", - "update-contrib": "weallcontribute -o . && git add CONTRIBUTING.md && git commit -m 'docs(contributing): updated CONTRIBUTING.md'" + "devDependencies": { + "standard": "^14.3.1", + "standard-version": "^7.1.0", + "tap": "^14.10.6" }, - "version": "6.0.1" + "engines": { + "node": ">= 8" + } } diff --git a/deps/npm/node_modules/stream-each/.npmignore b/deps/npm/node_modules/stream-each/.npmignore deleted file mode 100644 index 3c3629e647f5dd..00000000000000 --- a/deps/npm/node_modules/stream-each/.npmignore +++ /dev/null @@ -1 +0,0 @@ -node_modules diff --git a/deps/npm/node_modules/stream-each/.travis.yml b/deps/npm/node_modules/stream-each/.travis.yml deleted file mode 100644 index aa89858a8ac6b3..00000000000000 --- a/deps/npm/node_modules/stream-each/.travis.yml +++ /dev/null @@ -1,5 +0,0 @@ -language: node_js -node_js: - - '0.10' - - '0.12' - - 'stable' diff --git a/deps/npm/node_modules/stream-each/LICENSE b/deps/npm/node_modules/stream-each/LICENSE deleted file mode 100644 index 66a4d2a149a666..00000000000000 --- a/deps/npm/node_modules/stream-each/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2015 Mathias Buus - -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/stream-each/README.md b/deps/npm/node_modules/stream-each/README.md deleted file mode 100644 index e0832d55bdac94..00000000000000 --- a/deps/npm/node_modules/stream-each/README.md +++ /dev/null @@ -1,41 +0,0 @@ -# stream-each - -Iterate all the data in a stream - -``` -npm install stream-each -``` - -[![build status](http://img.shields.io/travis/mafintosh/stream-each.svg?style=flat)](http://travis-ci.org/mafintosh/stream-each) - -## Usage - -``` js -var each = require('stream-each') - -each(stream, function (data, next) { - console.log('data from stream', data) - // when ready to consume next chunk - next() -}, function (err) { - console.log('no more data') -}) -``` - -## API - -#### `each(stream, iterator, cb)` - -Iterate the data in the stream by calling the iterator function with `(data, next)` -where data is a data chunk and next is a callback. Call next when you are ready to -consume the next chunk. Optionally you can call next with an error to destroy the stream - -When the stream ends/errors the callback is called if provided - -## License - -MIT - -## Related - -`stream-each` is part of the [mississippi stream utility collection](https://github.com/maxogden/mississippi) which includes more useful stream modules similar to this one. diff --git a/deps/npm/node_modules/stream-each/collaborators.md b/deps/npm/node_modules/stream-each/collaborators.md deleted file mode 100644 index fc16de25f916b5..00000000000000 --- a/deps/npm/node_modules/stream-each/collaborators.md +++ /dev/null @@ -1,7 +0,0 @@ -## Collaborators - -stream-each is only possible due to the excellent work of the following collaborators: - - - -
    maxogdenGitHub/maxogden
    mafintoshGitHub/mafintosh
    diff --git a/deps/npm/node_modules/stream-each/index.js b/deps/npm/node_modules/stream-each/index.js deleted file mode 100644 index 7e67f7337ad9fb..00000000000000 --- a/deps/npm/node_modules/stream-each/index.js +++ /dev/null @@ -1,58 +0,0 @@ -var eos = require('end-of-stream') -var shift = require('stream-shift') - -module.exports = each - -function each (stream, fn, cb) { - var want = true - var error = null - var ended = false - var running = false - var calling = false - - stream.on('readable', onreadable) - onreadable() - - if (cb) eos(stream, {readable: true, writable: false}, done) - return stream - - function done (err) { - if (!error) error = err - ended = true - if (!running) cb(error) - } - - function onreadable () { - if (want) read() - } - - function afterRead (err) { - running = false - - if (err) { - error = err - if (ended) return cb(error) - stream.destroy(err) - return - } - if (ended) return cb(error) - if (!calling) read() - } - - function read () { - while (!running && !ended) { - want = false - - var data = shift(stream) - if (data === null) { - want = true - return - } - - running = true - calling = true - fn(data, afterRead) - calling = false - } - } -} diff --git a/deps/npm/node_modules/stream-each/package.json b/deps/npm/node_modules/stream-each/package.json deleted file mode 100644 index 16d8cb2af8b9d8..00000000000000 --- a/deps/npm/node_modules/stream-each/package.json +++ /dev/null @@ -1,59 +0,0 @@ -{ - "_from": "stream-each@^1.1.0", - "_id": "stream-each@1.2.2", - "_inBundle": false, - "_integrity": "sha512-mc1dbFhGBxvTM3bIWmAAINbqiuAk9TATcfIQC8P+/+HJefgaiTlMn2dHvkX8qlI12KeYKSQ1Ua9RrIqrn1VPoA==", - "_location": "/stream-each", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "stream-each@^1.1.0", - "name": "stream-each", - "escapedName": "stream-each", - "rawSpec": "^1.1.0", - "saveSpec": null, - "fetchSpec": "^1.1.0" - }, - "_requiredBy": [ - "/mississippi", - "/npm-profile/cacache/mississippi", - "/npm-profile/mississippi", - "/npm-registry-fetch/cacache/mississippi" - ], - "_resolved": "https://registry.npmjs.org/stream-each/-/stream-each-1.2.2.tgz", - "_shasum": "8e8c463f91da8991778765873fe4d960d8f616bd", - "_spec": "stream-each@^1.1.0", - "_where": "/Users/rebecca/code/npm/node_modules/mississippi", - "author": { - "name": "Mathias Buus", - "url": "@mafintosh" - }, - "bugs": { - "url": "https://github.com/mafintosh/stream-each/issues" - }, - "bundleDependencies": false, - "dependencies": { - "end-of-stream": "^1.1.0", - "stream-shift": "^1.0.0" - }, - "deprecated": false, - "description": "Iterate all the data in a stream", - "devDependencies": { - "standard": "^5.3.1", - "tape": "^4.2.1", - "through2": "^2.0.0" - }, - "homepage": "https://github.com/mafintosh/stream-each", - "license": "MIT", - "main": "index.js", - "name": "stream-each", - "repository": { - "type": "git", - "url": "git+https://github.com/mafintosh/stream-each.git" - }, - "scripts": { - "test": "standard && tape test.js" - }, - "version": "1.2.2" -} diff --git a/deps/npm/node_modules/stream-each/test.js b/deps/npm/node_modules/stream-each/test.js deleted file mode 100644 index 277634cd05fcb8..00000000000000 --- a/deps/npm/node_modules/stream-each/test.js +++ /dev/null @@ -1,122 +0,0 @@ -var tape = require('tape') -var through = require('through2') -var each = require('./') - -tape('each', function (t) { - var s = through.obj() - s.write('a') - s.write('b') - s.write('c') - s.end() - - s.on('end', function () { - t.end() - }) - - var expected = ['a', 'b', 'c'] - each(s, function (data, next) { - t.same(data, expected.shift()) - next() - }) -}) - -tape('each and callback', function (t) { - var s = through.obj() - s.write('a') - s.write('b') - s.write('c') - s.end() - - var expected = ['a', 'b', 'c'] - each(s, function (data, next) { - t.same(data, expected.shift()) - next() - }, function () { - t.end() - }) -}) - -tape('each (write after)', function (t) { - var s = through.obj() - s.on('end', function () { - t.end() - }) - - var expected = ['a', 'b', 'c'] - each(s, function (data, next) { - t.same(data, expected.shift()) - next() - }) - - setTimeout(function () { - s.write('a') - s.write('b') - s.write('c') - s.end() - }, 100) -}) - -tape('each error', function (t) { - var s = through.obj() - s.write('hello') - s.on('error', function (err) { - t.same(err.message, 'stop') - t.end() - }) - - each(s, function (data, next) { - next(new Error('stop')) - }) -}) - -tape('each error and callback', function (t) { - var s = through.obj() - s.write('hello') - - each(s, function (data, next) { - next(new Error('stop')) - }, function (err) { - t.same(err.message, 'stop') - t.end() - }) -}) - -tape('each with falsey values', function (t) { - var s = through.obj() - s.write(0) - s.write(false) - s.write(undefined) - s.end() - - s.on('end', function () { - t.end() - }) - - var expected = [0, false] - var count = 0 - each(s, function (data, next) { - count++ - t.same(data, expected.shift()) - next() - }, function () { - t.same(count, 2) - }) -}) - -tape('huge stack', function (t) { - var s = through.obj() - - for (var i = 0; i < 5000; i++) { - s.write('foo') - } - - s.end() - - each(s, function (data, cb) { - if (data !== 'foo') t.fail('bad data') - cb() - }, function (err) { - t.error(err, 'no error') - t.end() - }) -}) diff --git a/deps/npm/node_modules/stream-iterate/.npmignore b/deps/npm/node_modules/stream-iterate/.npmignore deleted file mode 100644 index 3c3629e647f5dd..00000000000000 --- a/deps/npm/node_modules/stream-iterate/.npmignore +++ /dev/null @@ -1 +0,0 @@ -node_modules diff --git a/deps/npm/node_modules/stream-iterate/.travis.yml b/deps/npm/node_modules/stream-iterate/.travis.yml deleted file mode 100644 index 89d7548954c9b7..00000000000000 --- a/deps/npm/node_modules/stream-iterate/.travis.yml +++ /dev/null @@ -1,5 +0,0 @@ -language: node_js -node_js: - - "0.10" - - '0.12' - - 'iojs' diff --git a/deps/npm/node_modules/stream-iterate/LICENSE b/deps/npm/node_modules/stream-iterate/LICENSE deleted file mode 100644 index 66a4d2a149a666..00000000000000 --- a/deps/npm/node_modules/stream-iterate/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2015 Mathias Buus - -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/stream-iterate/README.md b/deps/npm/node_modules/stream-iterate/README.md deleted file mode 100644 index 001112045b517a..00000000000000 --- a/deps/npm/node_modules/stream-iterate/README.md +++ /dev/null @@ -1,39 +0,0 @@ -# stream-iterate - -Iterate through the values in a stream. - -``` -npm install stream-iterate -``` - -[![build status](http://img.shields.io/travis/mafintosh/stream-iterate.svg?style=flat)](http://travis-ci.org/mafintosh/stream-iterate) - -## Usage - -``` js -var iterate = require('stream-iterate') -var from = require('from2') - -var stream = from.obj(['a', 'b', 'c']) - -var read = iterate(stream) - -loop() - -// recursively iterates through each item in the stream -function loop () { - read(function (err, data, next) { - console.log(err, data) - next() - loop() - }) -} -``` - -If you don't call `next` and call `read` again the same `(err, value)` pair will be returned. - -You can use this module to implement stuff like [a streaming merge sort](https://github.com/mafintosh/stream-iterate/blob/master/test.js#L5-L47). - -## License - -[MIT](LICENSE) diff --git a/deps/npm/node_modules/stream-iterate/index.js b/deps/npm/node_modules/stream-iterate/index.js deleted file mode 100644 index c60d6ab5501696..00000000000000 --- a/deps/npm/node_modules/stream-iterate/index.js +++ /dev/null @@ -1,70 +0,0 @@ -var Readable = require('readable-stream').Readable -var shift = require('stream-shift') - -var stream2 = function (stream) { - if (stream._readableState) return stream - return new Readable({objectMode: true, highWaterMark: 16}).wrap(stream) -} - -module.exports = function (stream) { - stream = stream2(stream) - - var ended = false - var data = null - var err = null - var destroyed = false - var fn = null - - var consume = function (e) { - if (e) { - destroyed = true - if (stream.destroy) stream.destroy(e) - return - } - - data = null - err = null - } - - var onresult = function () { - if (!fn) return - var tmp = fn - fn = undefined - tmp(err, data, consume) - } - - var update = function () { - if (!fn) return - data = shift(stream) - if (data === null && !ended) return - onresult() - } - - var onend = function () { - ended = true - onresult() - } - - stream.on('readable', update) - - stream.on('error', function (e) { - err = e - onresult() - }) - - stream.on('close', function () { - if (stream._readableState.ended) return - onend() - }) - - stream.on('end', onend) - - return function (callback) { - if (destroyed) return - if (err) return callback(err, null, consume) - if (data) return callback(null, data, consume) - if (ended) return callback(null, null, consume) - fn = callback - update() - } -} diff --git a/deps/npm/node_modules/stream-iterate/node_modules/readable-stream/.travis.yml b/deps/npm/node_modules/stream-iterate/node_modules/readable-stream/.travis.yml deleted file mode 100644 index 40992555bf5cc0..00000000000000 --- a/deps/npm/node_modules/stream-iterate/node_modules/readable-stream/.travis.yml +++ /dev/null @@ -1,55 +0,0 @@ -sudo: false -language: node_js -before_install: - - npm install -g npm@2 - - test $NPM_LEGACY && npm install -g npm@latest-3 || npm install npm -g -notifications: - email: false -matrix: - fast_finish: true - include: - - node_js: '0.8' - env: - - TASK=test - - NPM_LEGACY=true - - node_js: '0.10' - env: - - TASK=test - - NPM_LEGACY=true - - node_js: '0.11' - env: - - TASK=test - - NPM_LEGACY=true - - node_js: '0.12' - env: - - TASK=test - - NPM_LEGACY=true - - node_js: 1 - env: - - TASK=test - - NPM_LEGACY=true - - node_js: 2 - env: - - TASK=test - - NPM_LEGACY=true - - node_js: 3 - env: - - TASK=test - - NPM_LEGACY=true - - node_js: 4 - env: TASK=test - - node_js: 5 - env: TASK=test - - node_js: 6 - env: TASK=test - - node_js: 7 - env: TASK=test - - node_js: 8 - env: TASK=test - - node_js: 9 - env: TASK=test -script: "npm run $TASK" -env: - global: - - secure: rE2Vvo7vnjabYNULNyLFxOyt98BoJexDqsiOnfiD6kLYYsiQGfr/sbZkPMOFm9qfQG7pjqx+zZWZjGSswhTt+626C0t/njXqug7Yps4c3dFblzGfreQHp7wNX5TFsvrxd6dAowVasMp61sJcRnB2w8cUzoe3RAYUDHyiHktwqMc= - - secure: g9YINaKAdMatsJ28G9jCGbSaguXCyxSTy+pBO6Ch0Cf57ZLOTka3HqDj8p3nV28LUIHZ3ut5WO43CeYKwt4AUtLpBS3a0dndHdY6D83uY6b2qh5hXlrcbeQTq2cvw2y95F7hm4D1kwrgZ7ViqaKggRcEupAL69YbJnxeUDKWEdI= diff --git a/deps/npm/node_modules/stream-iterate/node_modules/readable-stream/GOVERNANCE.md b/deps/npm/node_modules/stream-iterate/node_modules/readable-stream/GOVERNANCE.md deleted file mode 100644 index 16ffb93f24bece..00000000000000 --- a/deps/npm/node_modules/stream-iterate/node_modules/readable-stream/GOVERNANCE.md +++ /dev/null @@ -1,136 +0,0 @@ -### Streams Working Group - -The Node.js Streams is jointly governed by a Working Group -(WG) -that is responsible for high-level guidance of the project. - -The WG has final authority over this project including: - -* Technical direction -* Project governance and process (including this policy) -* Contribution policy -* GitHub repository hosting -* Conduct guidelines -* Maintaining the list of additional Collaborators - -For the current list of WG members, see the project -[README.md](./README.md#current-project-team-members). - -### Collaborators - -The readable-stream GitHub repository is -maintained by the WG and additional Collaborators who are added by the -WG on an ongoing basis. - -Individuals making significant and valuable contributions are made -Collaborators and given commit-access to the project. These -individuals are identified by the WG and their addition as -Collaborators is discussed during the WG meeting. - -_Note:_ If you make a significant contribution and are not considered -for commit-access log an issue or contact a WG member directly and it -will be brought up in the next WG meeting. - -Modifications of the contents of the readable-stream repository are -made on -a collaborative basis. Anybody with a GitHub account may propose a -modification via pull request and it will be considered by the project -Collaborators. All pull requests must be reviewed and accepted by a -Collaborator with sufficient expertise who is able to take full -responsibility for the change. In the case of pull requests proposed -by an existing Collaborator, an additional Collaborator is required -for sign-off. Consensus should be sought if additional Collaborators -participate and there is disagreement around a particular -modification. See _Consensus Seeking Process_ below for further detail -on the consensus model used for governance. - -Collaborators may opt to elevate significant or controversial -modifications, or modifications that have not found consensus to the -WG for discussion by assigning the ***WG-agenda*** tag to a pull -request or issue. The WG should serve as the final arbiter where -required. - -For the current list of Collaborators, see the project -[README.md](./README.md#members). - -### WG Membership - -WG seats are not time-limited. There is no fixed size of the WG. -However, the expected target is between 6 and 12, to ensure adequate -coverage of important areas of expertise, balanced with the ability to -make decisions efficiently. - -There is no specific set of requirements or qualifications for WG -membership beyond these rules. - -The WG may add additional members to the WG by unanimous consensus. - -A WG member may be removed from the WG by voluntary resignation, or by -unanimous consensus of all other WG members. - -Changes to WG membership should be posted in the agenda, and may be -suggested as any other agenda item (see "WG Meetings" below). - -If an addition or removal is proposed during a meeting, and the full -WG is not in attendance to participate, then the addition or removal -is added to the agenda for the subsequent meeting. This is to ensure -that all members are given the opportunity to participate in all -membership decisions. If a WG member is unable to attend a meeting -where a planned membership decision is being made, then their consent -is assumed. - -No more than 1/3 of the WG members may be affiliated with the same -employer. If removal or resignation of a WG member, or a change of -employment by a WG member, creates a situation where more than 1/3 of -the WG membership shares an employer, then the situation must be -immediately remedied by the resignation or removal of one or more WG -members affiliated with the over-represented employer(s). - -### WG Meetings - -The WG meets occasionally on a Google Hangout On Air. A designated moderator -approved by the WG runs the meeting. Each meeting should be -published to YouTube. - -Items are added to the WG agenda that are considered contentious or -are modifications of governance, contribution policy, WG membership, -or release process. - -The intention of the agenda is not to approve or review all patches; -that should happen continuously on GitHub and be handled by the larger -group of Collaborators. - -Any community member or contributor can ask that something be added to -the next meeting's agenda by logging a GitHub Issue. Any Collaborator, -WG member or the moderator can add the item to the agenda by adding -the ***WG-agenda*** tag to the issue. - -Prior to each WG meeting the moderator will share the Agenda with -members of the WG. WG members can add any items they like to the -agenda at the beginning of each meeting. The moderator and the WG -cannot veto or remove items. - -The WG may invite persons or representatives from certain projects to -participate in a non-voting capacity. - -The moderator is responsible for summarizing the discussion of each -agenda item and sends it as a pull request after the meeting. - -### Consensus Seeking Process - -The WG follows a -[Consensus -Seeking](http://en.wikipedia.org/wiki/Consensus-seeking_decision-making) -decision-making model. - -When an agenda item has appeared to reach a consensus the moderator -will ask "Does anyone object?" as a final call for dissent from the -consensus. - -If an agenda item cannot reach a consensus a WG member can call for -either a closing vote or a vote to table the issue to the next -meeting. The call for a vote must be seconded by a majority of the WG -or else the discussion will continue. Simple majority wins. - -Note that changes to WG membership require a majority consensus. See -"WG Membership" above. diff --git a/deps/npm/node_modules/stream-iterate/node_modules/readable-stream/LICENSE b/deps/npm/node_modules/stream-iterate/node_modules/readable-stream/LICENSE deleted file mode 100644 index 2873b3b2e59507..00000000000000 --- a/deps/npm/node_modules/stream-iterate/node_modules/readable-stream/LICENSE +++ /dev/null @@ -1,47 +0,0 @@ -Node.js is licensed for use as follows: - -""" -Copyright Node.js contributors. All rights reserved. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to -deal in the Software without restriction, including without limitation the -rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -sell copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -IN THE SOFTWARE. -""" - -This license applies to parts of Node.js originating from the -https://github.com/joyent/node repository: - -""" -Copyright Joyent, Inc. and other Node contributors. All rights reserved. -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to -deal in the Software without restriction, including without limitation the -rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -sell copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -IN THE SOFTWARE. -""" diff --git a/deps/npm/node_modules/stream-iterate/node_modules/readable-stream/README.md b/deps/npm/node_modules/stream-iterate/node_modules/readable-stream/README.md deleted file mode 100644 index 23fe3f3e3009a2..00000000000000 --- a/deps/npm/node_modules/stream-iterate/node_modules/readable-stream/README.md +++ /dev/null @@ -1,58 +0,0 @@ -# readable-stream - -***Node-core v8.11.1 streams for userland*** [![Build Status](https://travis-ci.org/nodejs/readable-stream.svg?branch=master)](https://travis-ci.org/nodejs/readable-stream) - - -[![NPM](https://nodei.co/npm/readable-stream.png?downloads=true&downloadRank=true)](https://nodei.co/npm/readable-stream/) -[![NPM](https://nodei.co/npm-dl/readable-stream.png?&months=6&height=3)](https://nodei.co/npm/readable-stream/) - - -[![Sauce Test Status](https://saucelabs.com/browser-matrix/readable-stream.svg)](https://saucelabs.com/u/readable-stream) - -```bash -npm install --save readable-stream -``` - -***Node-core streams for userland*** - -This package is a mirror of the Streams2 and Streams3 implementations in -Node-core. - -Full documentation may be found on the [Node.js website](https://nodejs.org/dist/v8.11.1/docs/api/stream.html). - -If you want to guarantee a stable streams base, regardless of what version of -Node you, or the users of your libraries are using, use **readable-stream** *only* and avoid the *"stream"* module in Node-core, for background see [this blogpost](http://r.va.gg/2014/06/why-i-dont-use-nodes-core-stream-module.html). - -As of version 2.0.0 **readable-stream** uses semantic versioning. - -# Streams Working Group - -`readable-stream` is maintained by the Streams Working Group, which -oversees the development and maintenance of the Streams API within -Node.js. The responsibilities of the Streams Working Group include: - -* Addressing stream issues on the Node.js issue tracker. -* Authoring and editing stream documentation within the Node.js project. -* Reviewing changes to stream subclasses within the Node.js project. -* Redirecting changes to streams from the Node.js project to this - project. -* Assisting in the implementation of stream providers within Node.js. -* Recommending versions of `readable-stream` to be included in Node.js. -* Messaging about the future of streams to give the community advance - notice of changes. - - -## Team Members - -* **Chris Dickinson** ([@chrisdickinson](https://github.com/chrisdickinson)) <christopher.s.dickinson@gmail.com> - - Release GPG key: 9554F04D7259F04124DE6B476D5A82AC7E37093B -* **Calvin Metcalf** ([@calvinmetcalf](https://github.com/calvinmetcalf)) <calvin.metcalf@gmail.com> - - Release GPG key: F3EF5F62A87FC27A22E643F714CE4FF5015AA242 -* **Rod Vagg** ([@rvagg](https://github.com/rvagg)) <rod@vagg.org> - - Release GPG key: DD8F2338BAE7501E3DD5AC78C273792F7D83545D -* **Sam Newman** ([@sonewman](https://github.com/sonewman)) <newmansam@outlook.com> -* **Mathias Buus** ([@mafintosh](https://github.com/mafintosh)) <mathiasbuus@gmail.com> -* **Domenic Denicola** ([@domenic](https://github.com/domenic)) <d@domenic.me> -* **Matteo Collina** ([@mcollina](https://github.com/mcollina)) <matteo.collina@gmail.com> - - Release GPG key: 3ABC01543F22DD2239285CDD818674489FBC127E -* **Irina Shestak** ([@lrlna](https://github.com/lrlna)) <shestak.irina@gmail.com> diff --git a/deps/npm/node_modules/stream-iterate/node_modules/readable-stream/doc/wg-meetings/2015-01-30.md b/deps/npm/node_modules/stream-iterate/node_modules/readable-stream/doc/wg-meetings/2015-01-30.md deleted file mode 100644 index 83275f192e4077..00000000000000 --- a/deps/npm/node_modules/stream-iterate/node_modules/readable-stream/doc/wg-meetings/2015-01-30.md +++ /dev/null @@ -1,60 +0,0 @@ -# streams WG Meeting 2015-01-30 - -## Links - -* **Google Hangouts Video**: http://www.youtube.com/watch?v=I9nDOSGfwZg -* **GitHub Issue**: https://github.com/iojs/readable-stream/issues/106 -* **Original Minutes Google Doc**: https://docs.google.com/document/d/17aTgLnjMXIrfjgNaTUnHQO7m3xgzHR2VXBTmi03Qii4/ - -## Agenda - -Extracted from https://github.com/iojs/readable-stream/labels/wg-agenda prior to meeting. - -* adopt a charter [#105](https://github.com/iojs/readable-stream/issues/105) -* release and versioning strategy [#101](https://github.com/iojs/readable-stream/issues/101) -* simpler stream creation [#102](https://github.com/iojs/readable-stream/issues/102) -* proposal: deprecate implicit flowing of streams [#99](https://github.com/iojs/readable-stream/issues/99) - -## Minutes - -### adopt a charter - -* group: +1's all around - -### What versioning scheme should be adopted? -* group: +1’s 3.0.0 -* domenic+group: pulling in patches from other sources where appropriate -* mikeal: version independently, suggesting versions for io.js -* mikeal+domenic: work with TC to notify in advance of changes -simpler stream creation - -### streamline creation of streams -* sam: streamline creation of streams -* domenic: nice simple solution posted - but, we lose the opportunity to change the model - may not be backwards incompatible (double check keys) - - **action item:** domenic will check - -### remove implicit flowing of streams on(‘data’) -* add isFlowing / isPaused -* mikeal: worrying that we’re documenting polyfill methods – confuses users -* domenic: more reflective API is probably good, with warning labels for users -* new section for mad scientists (reflective stream access) -* calvin: name the “third state” -* mikeal: maybe borrow the name from whatwg? -* domenic: we’re missing the “third state” -* consensus: kind of difficult to name the third state -* mikeal: figure out differences in states / compat -* mathias: always flow on data – eliminates third state - * explore what it breaks - -**action items:** -* ask isaac for ability to list packages by what public io.js APIs they use (esp. Stream) -* ask rod/build for infrastructure -* **chris**: explore the “flow on data” approach -* add isPaused/isFlowing -* add new docs section -* move isPaused to that section - - diff --git a/deps/npm/node_modules/stream-iterate/node_modules/readable-stream/duplex-browser.js b/deps/npm/node_modules/stream-iterate/node_modules/readable-stream/duplex-browser.js deleted file mode 100644 index f8b2db83dbe733..00000000000000 --- a/deps/npm/node_modules/stream-iterate/node_modules/readable-stream/duplex-browser.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./lib/_stream_duplex.js'); diff --git a/deps/npm/node_modules/stream-iterate/node_modules/readable-stream/duplex.js b/deps/npm/node_modules/stream-iterate/node_modules/readable-stream/duplex.js deleted file mode 100644 index 46924cbfdf5387..00000000000000 --- a/deps/npm/node_modules/stream-iterate/node_modules/readable-stream/duplex.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./readable').Duplex diff --git a/deps/npm/node_modules/stream-iterate/node_modules/readable-stream/lib/_stream_duplex.js b/deps/npm/node_modules/stream-iterate/node_modules/readable-stream/lib/_stream_duplex.js deleted file mode 100644 index a1ca813e5acbd8..00000000000000 --- a/deps/npm/node_modules/stream-iterate/node_modules/readable-stream/lib/_stream_duplex.js +++ /dev/null @@ -1,131 +0,0 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - -// a duplex stream is just a stream that is both readable and writable. -// Since JS doesn't have multiple prototypal inheritance, this class -// prototypally inherits from Readable, and then parasitically from -// Writable. - -'use strict'; - -/**/ - -var pna = require('process-nextick-args'); -/**/ - -/**/ -var objectKeys = Object.keys || function (obj) { - var keys = []; - for (var key in obj) { - keys.push(key); - }return keys; -}; -/**/ - -module.exports = Duplex; - -/**/ -var util = require('core-util-is'); -util.inherits = require('inherits'); -/**/ - -var Readable = require('./_stream_readable'); -var Writable = require('./_stream_writable'); - -util.inherits(Duplex, Readable); - -{ - // avoid scope creep, the keys array can then be collected - var keys = objectKeys(Writable.prototype); - for (var v = 0; v < keys.length; v++) { - var method = keys[v]; - if (!Duplex.prototype[method]) Duplex.prototype[method] = Writable.prototype[method]; - } -} - -function Duplex(options) { - if (!(this instanceof Duplex)) return new Duplex(options); - - Readable.call(this, options); - Writable.call(this, options); - - if (options && options.readable === false) this.readable = false; - - if (options && options.writable === false) this.writable = false; - - this.allowHalfOpen = true; - if (options && options.allowHalfOpen === false) this.allowHalfOpen = false; - - this.once('end', onend); -} - -Object.defineProperty(Duplex.prototype, 'writableHighWaterMark', { - // making it explicit this property is not enumerable - // because otherwise some prototype manipulation in - // userland will fail - enumerable: false, - get: function () { - return this._writableState.highWaterMark; - } -}); - -// the no-half-open enforcer -function onend() { - // if we allow half-open state, or if the writable side ended, - // then we're ok. - if (this.allowHalfOpen || this._writableState.ended) return; - - // no more data can be written. - // But allow more writes to happen in this tick. - pna.nextTick(onEndNT, this); -} - -function onEndNT(self) { - self.end(); -} - -Object.defineProperty(Duplex.prototype, 'destroyed', { - get: function () { - if (this._readableState === undefined || this._writableState === undefined) { - return false; - } - return this._readableState.destroyed && this._writableState.destroyed; - }, - set: function (value) { - // we ignore the value if the stream - // has not been initialized yet - if (this._readableState === undefined || this._writableState === undefined) { - return; - } - - // backward compatibility, the user is explicitly - // managing destroyed - this._readableState.destroyed = value; - this._writableState.destroyed = value; - } -}); - -Duplex.prototype._destroy = function (err, cb) { - this.push(null); - this.end(); - - pna.nextTick(cb, err); -}; \ No newline at end of file diff --git a/deps/npm/node_modules/stream-iterate/node_modules/readable-stream/lib/_stream_passthrough.js b/deps/npm/node_modules/stream-iterate/node_modules/readable-stream/lib/_stream_passthrough.js deleted file mode 100644 index a9c835884828d8..00000000000000 --- a/deps/npm/node_modules/stream-iterate/node_modules/readable-stream/lib/_stream_passthrough.js +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - -// a passthrough stream. -// basically just the most minimal sort of Transform stream. -// Every written chunk gets output as-is. - -'use strict'; - -module.exports = PassThrough; - -var Transform = require('./_stream_transform'); - -/**/ -var util = require('core-util-is'); -util.inherits = require('inherits'); -/**/ - -util.inherits(PassThrough, Transform); - -function PassThrough(options) { - if (!(this instanceof PassThrough)) return new PassThrough(options); - - Transform.call(this, options); -} - -PassThrough.prototype._transform = function (chunk, encoding, cb) { - cb(null, chunk); -}; \ No newline at end of file diff --git a/deps/npm/node_modules/stream-iterate/node_modules/readable-stream/lib/_stream_readable.js b/deps/npm/node_modules/stream-iterate/node_modules/readable-stream/lib/_stream_readable.js deleted file mode 100644 index bf34ac65e1108f..00000000000000 --- a/deps/npm/node_modules/stream-iterate/node_modules/readable-stream/lib/_stream_readable.js +++ /dev/null @@ -1,1019 +0,0 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - -'use strict'; - -/**/ - -var pna = require('process-nextick-args'); -/**/ - -module.exports = Readable; - -/**/ -var isArray = require('isarray'); -/**/ - -/**/ -var Duplex; -/**/ - -Readable.ReadableState = ReadableState; - -/**/ -var EE = require('events').EventEmitter; - -var EElistenerCount = function (emitter, type) { - return emitter.listeners(type).length; -}; -/**/ - -/**/ -var Stream = require('./internal/streams/stream'); -/**/ - -/**/ - -var Buffer = require('safe-buffer').Buffer; -var OurUint8Array = global.Uint8Array || function () {}; -function _uint8ArrayToBuffer(chunk) { - return Buffer.from(chunk); -} -function _isUint8Array(obj) { - return Buffer.isBuffer(obj) || obj instanceof OurUint8Array; -} - -/**/ - -/**/ -var util = require('core-util-is'); -util.inherits = require('inherits'); -/**/ - -/**/ -var debugUtil = require('util'); -var debug = void 0; -if (debugUtil && debugUtil.debuglog) { - debug = debugUtil.debuglog('stream'); -} else { - debug = function () {}; -} -/**/ - -var BufferList = require('./internal/streams/BufferList'); -var destroyImpl = require('./internal/streams/destroy'); -var StringDecoder; - -util.inherits(Readable, Stream); - -var kProxyEvents = ['error', 'close', 'destroy', 'pause', 'resume']; - -function prependListener(emitter, event, fn) { - // Sadly this is not cacheable as some libraries bundle their own - // event emitter implementation with them. - if (typeof emitter.prependListener === 'function') return emitter.prependListener(event, fn); - - // This is a hack to make sure that our error handler is attached before any - // userland ones. NEVER DO THIS. This is here only because this code needs - // to continue to work with older versions of Node.js that do not include - // the prependListener() method. The goal is to eventually remove this hack. - if (!emitter._events || !emitter._events[event]) emitter.on(event, fn);else if (isArray(emitter._events[event])) emitter._events[event].unshift(fn);else emitter._events[event] = [fn, emitter._events[event]]; -} - -function ReadableState(options, stream) { - Duplex = Duplex || require('./_stream_duplex'); - - options = options || {}; - - // Duplex streams are both readable and writable, but share - // the same options object. - // However, some cases require setting options to different - // values for the readable and the writable sides of the duplex stream. - // These options can be provided separately as readableXXX and writableXXX. - var isDuplex = stream instanceof Duplex; - - // object stream flag. Used to make read(n) ignore n and to - // make all the buffer merging and length checks go away - this.objectMode = !!options.objectMode; - - if (isDuplex) this.objectMode = this.objectMode || !!options.readableObjectMode; - - // the point at which it stops calling _read() to fill the buffer - // Note: 0 is a valid value, means "don't call _read preemptively ever" - var hwm = options.highWaterMark; - var readableHwm = options.readableHighWaterMark; - var defaultHwm = this.objectMode ? 16 : 16 * 1024; - - if (hwm || hwm === 0) this.highWaterMark = hwm;else if (isDuplex && (readableHwm || readableHwm === 0)) this.highWaterMark = readableHwm;else this.highWaterMark = defaultHwm; - - // cast to ints. - this.highWaterMark = Math.floor(this.highWaterMark); - - // A linked list is used to store data chunks instead of an array because the - // linked list can remove elements from the beginning faster than - // array.shift() - this.buffer = new BufferList(); - this.length = 0; - this.pipes = null; - this.pipesCount = 0; - this.flowing = null; - this.ended = false; - this.endEmitted = false; - this.reading = false; - - // a flag to be able to tell if the event 'readable'/'data' is emitted - // immediately, or on a later tick. We set this to true at first, because - // any actions that shouldn't happen until "later" should generally also - // not happen before the first read call. - this.sync = true; - - // whenever we return null, then we set a flag to say - // that we're awaiting a 'readable' event emission. - this.needReadable = false; - this.emittedReadable = false; - this.readableListening = false; - this.resumeScheduled = false; - - // has it been destroyed - this.destroyed = false; - - // Crypto is kind of old and crusty. Historically, its default string - // encoding is 'binary' so we have to make this configurable. - // Everything else in the universe uses 'utf8', though. - this.defaultEncoding = options.defaultEncoding || 'utf8'; - - // the number of writers that are awaiting a drain event in .pipe()s - this.awaitDrain = 0; - - // if true, a maybeReadMore has been scheduled - this.readingMore = false; - - this.decoder = null; - this.encoding = null; - if (options.encoding) { - if (!StringDecoder) StringDecoder = require('string_decoder/').StringDecoder; - this.decoder = new StringDecoder(options.encoding); - this.encoding = options.encoding; - } -} - -function Readable(options) { - Duplex = Duplex || require('./_stream_duplex'); - - if (!(this instanceof Readable)) return new Readable(options); - - this._readableState = new ReadableState(options, this); - - // legacy - this.readable = true; - - if (options) { - if (typeof options.read === 'function') this._read = options.read; - - if (typeof options.destroy === 'function') this._destroy = options.destroy; - } - - Stream.call(this); -} - -Object.defineProperty(Readable.prototype, 'destroyed', { - get: function () { - if (this._readableState === undefined) { - return false; - } - return this._readableState.destroyed; - }, - set: function (value) { - // we ignore the value if the stream - // has not been initialized yet - if (!this._readableState) { - return; - } - - // backward compatibility, the user is explicitly - // managing destroyed - this._readableState.destroyed = value; - } -}); - -Readable.prototype.destroy = destroyImpl.destroy; -Readable.prototype._undestroy = destroyImpl.undestroy; -Readable.prototype._destroy = function (err, cb) { - this.push(null); - cb(err); -}; - -// Manually shove something into the read() buffer. -// This returns true if the highWaterMark has not been hit yet, -// similar to how Writable.write() returns true if you should -// write() some more. -Readable.prototype.push = function (chunk, encoding) { - var state = this._readableState; - var skipChunkCheck; - - if (!state.objectMode) { - if (typeof chunk === 'string') { - encoding = encoding || state.defaultEncoding; - if (encoding !== state.encoding) { - chunk = Buffer.from(chunk, encoding); - encoding = ''; - } - skipChunkCheck = true; - } - } else { - skipChunkCheck = true; - } - - return readableAddChunk(this, chunk, encoding, false, skipChunkCheck); -}; - -// Unshift should *always* be something directly out of read() -Readable.prototype.unshift = function (chunk) { - return readableAddChunk(this, chunk, null, true, false); -}; - -function readableAddChunk(stream, chunk, encoding, addToFront, skipChunkCheck) { - var state = stream._readableState; - if (chunk === null) { - state.reading = false; - onEofChunk(stream, state); - } else { - var er; - if (!skipChunkCheck) er = chunkInvalid(state, chunk); - if (er) { - stream.emit('error', er); - } else if (state.objectMode || chunk && chunk.length > 0) { - if (typeof chunk !== 'string' && !state.objectMode && Object.getPrototypeOf(chunk) !== Buffer.prototype) { - chunk = _uint8ArrayToBuffer(chunk); - } - - if (addToFront) { - if (state.endEmitted) stream.emit('error', new Error('stream.unshift() after end event'));else addChunk(stream, state, chunk, true); - } else if (state.ended) { - stream.emit('error', new Error('stream.push() after EOF')); - } else { - state.reading = false; - if (state.decoder && !encoding) { - chunk = state.decoder.write(chunk); - if (state.objectMode || chunk.length !== 0) addChunk(stream, state, chunk, false);else maybeReadMore(stream, state); - } else { - addChunk(stream, state, chunk, false); - } - } - } else if (!addToFront) { - state.reading = false; - } - } - - return needMoreData(state); -} - -function addChunk(stream, state, chunk, addToFront) { - if (state.flowing && state.length === 0 && !state.sync) { - stream.emit('data', chunk); - stream.read(0); - } else { - // update the buffer info. - state.length += state.objectMode ? 1 : chunk.length; - if (addToFront) state.buffer.unshift(chunk);else state.buffer.push(chunk); - - if (state.needReadable) emitReadable(stream); - } - maybeReadMore(stream, state); -} - -function chunkInvalid(state, chunk) { - var er; - if (!_isUint8Array(chunk) && typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) { - er = new TypeError('Invalid non-string/buffer chunk'); - } - return er; -} - -// if it's past the high water mark, we can push in some more. -// Also, if we have no data yet, we can stand some -// more bytes. This is to work around cases where hwm=0, -// such as the repl. Also, if the push() triggered a -// readable event, and the user called read(largeNumber) such that -// needReadable was set, then we ought to push more, so that another -// 'readable' event will be triggered. -function needMoreData(state) { - return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0); -} - -Readable.prototype.isPaused = function () { - return this._readableState.flowing === false; -}; - -// backwards compatibility. -Readable.prototype.setEncoding = function (enc) { - if (!StringDecoder) StringDecoder = require('string_decoder/').StringDecoder; - this._readableState.decoder = new StringDecoder(enc); - this._readableState.encoding = enc; - return this; -}; - -// Don't raise the hwm > 8MB -var MAX_HWM = 0x800000; -function computeNewHighWaterMark(n) { - if (n >= MAX_HWM) { - n = MAX_HWM; - } else { - // Get the next highest power of 2 to prevent increasing hwm excessively in - // tiny amounts - n--; - n |= n >>> 1; - n |= n >>> 2; - n |= n >>> 4; - n |= n >>> 8; - n |= n >>> 16; - n++; - } - return n; -} - -// This function is designed to be inlinable, so please take care when making -// changes to the function body. -function howMuchToRead(n, state) { - if (n <= 0 || state.length === 0 && state.ended) return 0; - if (state.objectMode) return 1; - if (n !== n) { - // Only flow one buffer at a time - if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length; - } - // If we're asking for more than the current hwm, then raise the hwm. - if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n); - if (n <= state.length) return n; - // Don't have enough - if (!state.ended) { - state.needReadable = true; - return 0; - } - return state.length; -} - -// you can override either this method, or the async _read(n) below. -Readable.prototype.read = function (n) { - debug('read', n); - n = parseInt(n, 10); - var state = this._readableState; - var nOrig = n; - - if (n !== 0) state.emittedReadable = false; - - // if we're doing read(0) to trigger a readable event, but we - // already have a bunch of data in the buffer, then just trigger - // the 'readable' event and move on. - if (n === 0 && state.needReadable && (state.length >= state.highWaterMark || state.ended)) { - debug('read: emitReadable', state.length, state.ended); - if (state.length === 0 && state.ended) endReadable(this);else emitReadable(this); - return null; - } - - n = howMuchToRead(n, state); - - // if we've ended, and we're now clear, then finish it up. - if (n === 0 && state.ended) { - if (state.length === 0) endReadable(this); - return null; - } - - // All the actual chunk generation logic needs to be - // *below* the call to _read. The reason is that in certain - // synthetic stream cases, such as passthrough streams, _read - // may be a completely synchronous operation which may change - // the state of the read buffer, providing enough data when - // before there was *not* enough. - // - // So, the steps are: - // 1. Figure out what the state of things will be after we do - // a read from the buffer. - // - // 2. If that resulting state will trigger a _read, then call _read. - // Note that this may be asynchronous, or synchronous. Yes, it is - // deeply ugly to write APIs this way, but that still doesn't mean - // that the Readable class should behave improperly, as streams are - // designed to be sync/async agnostic. - // Take note if the _read call is sync or async (ie, if the read call - // has returned yet), so that we know whether or not it's safe to emit - // 'readable' etc. - // - // 3. Actually pull the requested chunks out of the buffer and return. - - // if we need a readable event, then we need to do some reading. - var doRead = state.needReadable; - debug('need readable', doRead); - - // if we currently have less than the highWaterMark, then also read some - if (state.length === 0 || state.length - n < state.highWaterMark) { - doRead = true; - debug('length less than watermark', doRead); - } - - // however, if we've ended, then there's no point, and if we're already - // reading, then it's unnecessary. - if (state.ended || state.reading) { - doRead = false; - debug('reading or ended', doRead); - } else if (doRead) { - debug('do read'); - state.reading = true; - state.sync = true; - // if the length is currently zero, then we *need* a readable event. - if (state.length === 0) state.needReadable = true; - // call internal read method - this._read(state.highWaterMark); - state.sync = false; - // If _read pushed data synchronously, then `reading` will be false, - // and we need to re-evaluate how much data we can return to the user. - if (!state.reading) n = howMuchToRead(nOrig, state); - } - - var ret; - if (n > 0) ret = fromList(n, state);else ret = null; - - if (ret === null) { - state.needReadable = true; - n = 0; - } else { - state.length -= n; - } - - if (state.length === 0) { - // If we have nothing in the buffer, then we want to know - // as soon as we *do* get something into the buffer. - if (!state.ended) state.needReadable = true; - - // If we tried to read() past the EOF, then emit end on the next tick. - if (nOrig !== n && state.ended) endReadable(this); - } - - if (ret !== null) this.emit('data', ret); - - return ret; -}; - -function onEofChunk(stream, state) { - if (state.ended) return; - if (state.decoder) { - var chunk = state.decoder.end(); - if (chunk && chunk.length) { - state.buffer.push(chunk); - state.length += state.objectMode ? 1 : chunk.length; - } - } - state.ended = true; - - // emit 'readable' now to make sure it gets picked up. - emitReadable(stream); -} - -// Don't emit readable right away in sync mode, because this can trigger -// another read() call => stack overflow. This way, it might trigger -// a nextTick recursion warning, but that's not so bad. -function emitReadable(stream) { - var state = stream._readableState; - state.needReadable = false; - if (!state.emittedReadable) { - debug('emitReadable', state.flowing); - state.emittedReadable = true; - if (state.sync) pna.nextTick(emitReadable_, stream);else emitReadable_(stream); - } -} - -function emitReadable_(stream) { - debug('emit readable'); - stream.emit('readable'); - flow(stream); -} - -// at this point, the user has presumably seen the 'readable' event, -// and called read() to consume some data. that may have triggered -// in turn another _read(n) call, in which case reading = true if -// it's in progress. -// However, if we're not ended, or reading, and the length < hwm, -// then go ahead and try to read some more preemptively. -function maybeReadMore(stream, state) { - if (!state.readingMore) { - state.readingMore = true; - pna.nextTick(maybeReadMore_, stream, state); - } -} - -function maybeReadMore_(stream, state) { - var len = state.length; - while (!state.reading && !state.flowing && !state.ended && state.length < state.highWaterMark) { - debug('maybeReadMore read 0'); - stream.read(0); - if (len === state.length) - // didn't get any data, stop spinning. - break;else len = state.length; - } - state.readingMore = false; -} - -// abstract method. to be overridden in specific implementation classes. -// call cb(er, data) where data is <= n in length. -// for virtual (non-string, non-buffer) streams, "length" is somewhat -// arbitrary, and perhaps not very meaningful. -Readable.prototype._read = function (n) { - this.emit('error', new Error('_read() is not implemented')); -}; - -Readable.prototype.pipe = function (dest, pipeOpts) { - var src = this; - var state = this._readableState; - - switch (state.pipesCount) { - case 0: - state.pipes = dest; - break; - case 1: - state.pipes = [state.pipes, dest]; - break; - default: - state.pipes.push(dest); - break; - } - state.pipesCount += 1; - debug('pipe count=%d opts=%j', state.pipesCount, pipeOpts); - - var doEnd = (!pipeOpts || pipeOpts.end !== false) && dest !== process.stdout && dest !== process.stderr; - - var endFn = doEnd ? onend : unpipe; - if (state.endEmitted) pna.nextTick(endFn);else src.once('end', endFn); - - dest.on('unpipe', onunpipe); - function onunpipe(readable, unpipeInfo) { - debug('onunpipe'); - if (readable === src) { - if (unpipeInfo && unpipeInfo.hasUnpiped === false) { - unpipeInfo.hasUnpiped = true; - cleanup(); - } - } - } - - function onend() { - debug('onend'); - dest.end(); - } - - // when the dest drains, it reduces the awaitDrain counter - // on the source. This would be more elegant with a .once() - // handler in flow(), but adding and removing repeatedly is - // too slow. - var ondrain = pipeOnDrain(src); - dest.on('drain', ondrain); - - var cleanedUp = false; - function cleanup() { - debug('cleanup'); - // cleanup event handlers once the pipe is broken - dest.removeListener('close', onclose); - dest.removeListener('finish', onfinish); - dest.removeListener('drain', ondrain); - dest.removeListener('error', onerror); - dest.removeListener('unpipe', onunpipe); - src.removeListener('end', onend); - src.removeListener('end', unpipe); - src.removeListener('data', ondata); - - cleanedUp = true; - - // if the reader is waiting for a drain event from this - // specific writer, then it would cause it to never start - // flowing again. - // So, if this is awaiting a drain, then we just call it now. - // If we don't know, then assume that we are waiting for one. - if (state.awaitDrain && (!dest._writableState || dest._writableState.needDrain)) ondrain(); - } - - // If the user pushes more data while we're writing to dest then we'll end up - // in ondata again. However, we only want to increase awaitDrain once because - // dest will only emit one 'drain' event for the multiple writes. - // => Introduce a guard on increasing awaitDrain. - var increasedAwaitDrain = false; - src.on('data', ondata); - function ondata(chunk) { - debug('ondata'); - increasedAwaitDrain = false; - var ret = dest.write(chunk); - if (false === ret && !increasedAwaitDrain) { - // If the user unpiped during `dest.write()`, it is possible - // to get stuck in a permanently paused state if that write - // also returned false. - // => Check whether `dest` is still a piping destination. - if ((state.pipesCount === 1 && state.pipes === dest || state.pipesCount > 1 && indexOf(state.pipes, dest) !== -1) && !cleanedUp) { - debug('false write response, pause', src._readableState.awaitDrain); - src._readableState.awaitDrain++; - increasedAwaitDrain = true; - } - src.pause(); - } - } - - // if the dest has an error, then stop piping into it. - // however, don't suppress the throwing behavior for this. - function onerror(er) { - debug('onerror', er); - unpipe(); - dest.removeListener('error', onerror); - if (EElistenerCount(dest, 'error') === 0) dest.emit('error', er); - } - - // Make sure our error handler is attached before userland ones. - prependListener(dest, 'error', onerror); - - // Both close and finish should trigger unpipe, but only once. - function onclose() { - dest.removeListener('finish', onfinish); - unpipe(); - } - dest.once('close', onclose); - function onfinish() { - debug('onfinish'); - dest.removeListener('close', onclose); - unpipe(); - } - dest.once('finish', onfinish); - - function unpipe() { - debug('unpipe'); - src.unpipe(dest); - } - - // tell the dest that it's being piped to - dest.emit('pipe', src); - - // start the flow if it hasn't been started already. - if (!state.flowing) { - debug('pipe resume'); - src.resume(); - } - - return dest; -}; - -function pipeOnDrain(src) { - return function () { - var state = src._readableState; - debug('pipeOnDrain', state.awaitDrain); - if (state.awaitDrain) state.awaitDrain--; - if (state.awaitDrain === 0 && EElistenerCount(src, 'data')) { - state.flowing = true; - flow(src); - } - }; -} - -Readable.prototype.unpipe = function (dest) { - var state = this._readableState; - var unpipeInfo = { hasUnpiped: false }; - - // if we're not piping anywhere, then do nothing. - if (state.pipesCount === 0) return this; - - // just one destination. most common case. - if (state.pipesCount === 1) { - // passed in one, but it's not the right one. - if (dest && dest !== state.pipes) return this; - - if (!dest) dest = state.pipes; - - // got a match. - state.pipes = null; - state.pipesCount = 0; - state.flowing = false; - if (dest) dest.emit('unpipe', this, unpipeInfo); - return this; - } - - // slow case. multiple pipe destinations. - - if (!dest) { - // remove all. - var dests = state.pipes; - var len = state.pipesCount; - state.pipes = null; - state.pipesCount = 0; - state.flowing = false; - - for (var i = 0; i < len; i++) { - dests[i].emit('unpipe', this, unpipeInfo); - }return this; - } - - // try to find the right one. - var index = indexOf(state.pipes, dest); - if (index === -1) return this; - - state.pipes.splice(index, 1); - state.pipesCount -= 1; - if (state.pipesCount === 1) state.pipes = state.pipes[0]; - - dest.emit('unpipe', this, unpipeInfo); - - return this; -}; - -// set up data events if they are asked for -// Ensure readable listeners eventually get something -Readable.prototype.on = function (ev, fn) { - var res = Stream.prototype.on.call(this, ev, fn); - - if (ev === 'data') { - // Start flowing on next tick if stream isn't explicitly paused - if (this._readableState.flowing !== false) this.resume(); - } else if (ev === 'readable') { - var state = this._readableState; - if (!state.endEmitted && !state.readableListening) { - state.readableListening = state.needReadable = true; - state.emittedReadable = false; - if (!state.reading) { - pna.nextTick(nReadingNextTick, this); - } else if (state.length) { - emitReadable(this); - } - } - } - - return res; -}; -Readable.prototype.addListener = Readable.prototype.on; - -function nReadingNextTick(self) { - debug('readable nexttick read 0'); - self.read(0); -} - -// pause() and resume() are remnants of the legacy readable stream API -// If the user uses them, then switch into old mode. -Readable.prototype.resume = function () { - var state = this._readableState; - if (!state.flowing) { - debug('resume'); - state.flowing = true; - resume(this, state); - } - return this; -}; - -function resume(stream, state) { - if (!state.resumeScheduled) { - state.resumeScheduled = true; - pna.nextTick(resume_, stream, state); - } -} - -function resume_(stream, state) { - if (!state.reading) { - debug('resume read 0'); - stream.read(0); - } - - state.resumeScheduled = false; - state.awaitDrain = 0; - stream.emit('resume'); - flow(stream); - if (state.flowing && !state.reading) stream.read(0); -} - -Readable.prototype.pause = function () { - debug('call pause flowing=%j', this._readableState.flowing); - if (false !== this._readableState.flowing) { - debug('pause'); - this._readableState.flowing = false; - this.emit('pause'); - } - return this; -}; - -function flow(stream) { - var state = stream._readableState; - debug('flow', state.flowing); - while (state.flowing && stream.read() !== null) {} -} - -// wrap an old-style stream as the async data source. -// This is *not* part of the readable stream interface. -// It is an ugly unfortunate mess of history. -Readable.prototype.wrap = function (stream) { - var _this = this; - - var state = this._readableState; - var paused = false; - - stream.on('end', function () { - debug('wrapped end'); - if (state.decoder && !state.ended) { - var chunk = state.decoder.end(); - if (chunk && chunk.length) _this.push(chunk); - } - - _this.push(null); - }); - - stream.on('data', function (chunk) { - debug('wrapped data'); - if (state.decoder) chunk = state.decoder.write(chunk); - - // don't skip over falsy values in objectMode - if (state.objectMode && (chunk === null || chunk === undefined)) return;else if (!state.objectMode && (!chunk || !chunk.length)) return; - - var ret = _this.push(chunk); - if (!ret) { - paused = true; - stream.pause(); - } - }); - - // proxy all the other methods. - // important when wrapping filters and duplexes. - for (var i in stream) { - if (this[i] === undefined && typeof stream[i] === 'function') { - this[i] = function (method) { - return function () { - return stream[method].apply(stream, arguments); - }; - }(i); - } - } - - // proxy certain important events. - for (var n = 0; n < kProxyEvents.length; n++) { - stream.on(kProxyEvents[n], this.emit.bind(this, kProxyEvents[n])); - } - - // when we try to consume some more bytes, simply unpause the - // underlying stream. - this._read = function (n) { - debug('wrapped _read', n); - if (paused) { - paused = false; - stream.resume(); - } - }; - - return this; -}; - -Object.defineProperty(Readable.prototype, 'readableHighWaterMark', { - // making it explicit this property is not enumerable - // because otherwise some prototype manipulation in - // userland will fail - enumerable: false, - get: function () { - return this._readableState.highWaterMark; - } -}); - -// exposed for testing purposes only. -Readable._fromList = fromList; - -// Pluck off n bytes from an array of buffers. -// Length is the combined lengths of all the buffers in the list. -// This function is designed to be inlinable, so please take care when making -// changes to the function body. -function fromList(n, state) { - // nothing buffered - if (state.length === 0) return null; - - var ret; - if (state.objectMode) ret = state.buffer.shift();else if (!n || n >= state.length) { - // read it all, truncate the list - if (state.decoder) ret = state.buffer.join('');else if (state.buffer.length === 1) ret = state.buffer.head.data;else ret = state.buffer.concat(state.length); - state.buffer.clear(); - } else { - // read part of list - ret = fromListPartial(n, state.buffer, state.decoder); - } - - return ret; -} - -// Extracts only enough buffered data to satisfy the amount requested. -// This function is designed to be inlinable, so please take care when making -// changes to the function body. -function fromListPartial(n, list, hasStrings) { - var ret; - if (n < list.head.data.length) { - // slice is the same for buffers and strings - ret = list.head.data.slice(0, n); - list.head.data = list.head.data.slice(n); - } else if (n === list.head.data.length) { - // first chunk is a perfect match - ret = list.shift(); - } else { - // result spans more than one buffer - ret = hasStrings ? copyFromBufferString(n, list) : copyFromBuffer(n, list); - } - return ret; -} - -// Copies a specified amount of characters from the list of buffered data -// chunks. -// This function is designed to be inlinable, so please take care when making -// changes to the function body. -function copyFromBufferString(n, list) { - var p = list.head; - var c = 1; - var ret = p.data; - n -= ret.length; - while (p = p.next) { - var str = p.data; - var nb = n > str.length ? str.length : n; - if (nb === str.length) ret += str;else ret += str.slice(0, n); - n -= nb; - if (n === 0) { - if (nb === str.length) { - ++c; - if (p.next) list.head = p.next;else list.head = list.tail = null; - } else { - list.head = p; - p.data = str.slice(nb); - } - break; - } - ++c; - } - list.length -= c; - return ret; -} - -// Copies a specified amount of bytes from the list of buffered data chunks. -// This function is designed to be inlinable, so please take care when making -// changes to the function body. -function copyFromBuffer(n, list) { - var ret = Buffer.allocUnsafe(n); - var p = list.head; - var c = 1; - p.data.copy(ret); - n -= p.data.length; - while (p = p.next) { - var buf = p.data; - var nb = n > buf.length ? buf.length : n; - buf.copy(ret, ret.length - n, 0, nb); - n -= nb; - if (n === 0) { - if (nb === buf.length) { - ++c; - if (p.next) list.head = p.next;else list.head = list.tail = null; - } else { - list.head = p; - p.data = buf.slice(nb); - } - break; - } - ++c; - } - list.length -= c; - return ret; -} - -function endReadable(stream) { - var state = stream._readableState; - - // If we get here before consuming all the bytes, then that is a - // bug in node. Should never happen. - if (state.length > 0) throw new Error('"endReadable()" called on non-empty stream'); - - if (!state.endEmitted) { - state.ended = true; - pna.nextTick(endReadableNT, state, stream); - } -} - -function endReadableNT(state, stream) { - // Check that we didn't get one last unshift. - if (!state.endEmitted && state.length === 0) { - state.endEmitted = true; - stream.readable = false; - stream.emit('end'); - } -} - -function indexOf(xs, x) { - for (var i = 0, l = xs.length; i < l; i++) { - if (xs[i] === x) return i; - } - return -1; -} \ No newline at end of file diff --git a/deps/npm/node_modules/stream-iterate/node_modules/readable-stream/lib/_stream_transform.js b/deps/npm/node_modules/stream-iterate/node_modules/readable-stream/lib/_stream_transform.js deleted file mode 100644 index 5d1f8b876d98c7..00000000000000 --- a/deps/npm/node_modules/stream-iterate/node_modules/readable-stream/lib/_stream_transform.js +++ /dev/null @@ -1,214 +0,0 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - -// a transform stream is a readable/writable stream where you do -// something with the data. Sometimes it's called a "filter", -// but that's not a great name for it, since that implies a thing where -// some bits pass through, and others are simply ignored. (That would -// be a valid example of a transform, of course.) -// -// While the output is causally related to the input, it's not a -// necessarily symmetric or synchronous transformation. For example, -// a zlib stream might take multiple plain-text writes(), and then -// emit a single compressed chunk some time in the future. -// -// Here's how this works: -// -// The Transform stream has all the aspects of the readable and writable -// stream classes. When you write(chunk), that calls _write(chunk,cb) -// internally, and returns false if there's a lot of pending writes -// buffered up. When you call read(), that calls _read(n) until -// there's enough pending readable data buffered up. -// -// In a transform stream, the written data is placed in a buffer. When -// _read(n) is called, it transforms the queued up data, calling the -// buffered _write cb's as it consumes chunks. If consuming a single -// written chunk would result in multiple output chunks, then the first -// outputted bit calls the readcb, and subsequent chunks just go into -// the read buffer, and will cause it to emit 'readable' if necessary. -// -// This way, back-pressure is actually determined by the reading side, -// since _read has to be called to start processing a new chunk. However, -// a pathological inflate type of transform can cause excessive buffering -// here. For example, imagine a stream where every byte of input is -// interpreted as an integer from 0-255, and then results in that many -// bytes of output. Writing the 4 bytes {ff,ff,ff,ff} would result in -// 1kb of data being output. In this case, you could write a very small -// amount of input, and end up with a very large amount of output. In -// such a pathological inflating mechanism, there'd be no way to tell -// the system to stop doing the transform. A single 4MB write could -// cause the system to run out of memory. -// -// However, even in such a pathological case, only a single written chunk -// would be consumed, and then the rest would wait (un-transformed) until -// the results of the previous transformed chunk were consumed. - -'use strict'; - -module.exports = Transform; - -var Duplex = require('./_stream_duplex'); - -/**/ -var util = require('core-util-is'); -util.inherits = require('inherits'); -/**/ - -util.inherits(Transform, Duplex); - -function afterTransform(er, data) { - var ts = this._transformState; - ts.transforming = false; - - var cb = ts.writecb; - - if (!cb) { - return this.emit('error', new Error('write callback called multiple times')); - } - - ts.writechunk = null; - ts.writecb = null; - - if (data != null) // single equals check for both `null` and `undefined` - this.push(data); - - cb(er); - - var rs = this._readableState; - rs.reading = false; - if (rs.needReadable || rs.length < rs.highWaterMark) { - this._read(rs.highWaterMark); - } -} - -function Transform(options) { - if (!(this instanceof Transform)) return new Transform(options); - - Duplex.call(this, options); - - this._transformState = { - afterTransform: afterTransform.bind(this), - needTransform: false, - transforming: false, - writecb: null, - writechunk: null, - writeencoding: null - }; - - // start out asking for a readable event once data is transformed. - this._readableState.needReadable = true; - - // we have implemented the _read method, and done the other things - // that Readable wants before the first _read call, so unset the - // sync guard flag. - this._readableState.sync = false; - - if (options) { - if (typeof options.transform === 'function') this._transform = options.transform; - - if (typeof options.flush === 'function') this._flush = options.flush; - } - - // When the writable side finishes, then flush out anything remaining. - this.on('prefinish', prefinish); -} - -function prefinish() { - var _this = this; - - if (typeof this._flush === 'function') { - this._flush(function (er, data) { - done(_this, er, data); - }); - } else { - done(this, null, null); - } -} - -Transform.prototype.push = function (chunk, encoding) { - this._transformState.needTransform = false; - return Duplex.prototype.push.call(this, chunk, encoding); -}; - -// This is the part where you do stuff! -// override this function in implementation classes. -// 'chunk' is an input chunk. -// -// Call `push(newChunk)` to pass along transformed output -// to the readable side. You may call 'push' zero or more times. -// -// Call `cb(err)` when you are done with this chunk. If you pass -// an error, then that'll put the hurt on the whole operation. If you -// never call cb(), then you'll never get another chunk. -Transform.prototype._transform = function (chunk, encoding, cb) { - throw new Error('_transform() is not implemented'); -}; - -Transform.prototype._write = function (chunk, encoding, cb) { - var ts = this._transformState; - ts.writecb = cb; - ts.writechunk = chunk; - ts.writeencoding = encoding; - if (!ts.transforming) { - var rs = this._readableState; - if (ts.needTransform || rs.needReadable || rs.length < rs.highWaterMark) this._read(rs.highWaterMark); - } -}; - -// Doesn't matter what the args are here. -// _transform does all the work. -// That we got here means that the readable side wants more data. -Transform.prototype._read = function (n) { - var ts = this._transformState; - - if (ts.writechunk !== null && ts.writecb && !ts.transforming) { - ts.transforming = true; - this._transform(ts.writechunk, ts.writeencoding, ts.afterTransform); - } else { - // mark that we need a transform, so that any data that comes in - // will get processed, now that we've asked for it. - ts.needTransform = true; - } -}; - -Transform.prototype._destroy = function (err, cb) { - var _this2 = this; - - Duplex.prototype._destroy.call(this, err, function (err2) { - cb(err2); - _this2.emit('close'); - }); -}; - -function done(stream, er, data) { - if (er) return stream.emit('error', er); - - if (data != null) // single equals check for both `null` and `undefined` - stream.push(data); - - // if there's nothing in the write buffer, then that means - // that nothing more will ever be provided - if (stream._writableState.length) throw new Error('Calling transform done when ws.length != 0'); - - if (stream._transformState.transforming) throw new Error('Calling transform done when still transforming'); - - return stream.push(null); -} \ No newline at end of file diff --git a/deps/npm/node_modules/stream-iterate/node_modules/readable-stream/lib/_stream_writable.js b/deps/npm/node_modules/stream-iterate/node_modules/readable-stream/lib/_stream_writable.js deleted file mode 100644 index b3f4e85a2f6e35..00000000000000 --- a/deps/npm/node_modules/stream-iterate/node_modules/readable-stream/lib/_stream_writable.js +++ /dev/null @@ -1,687 +0,0 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - -// A bit simpler than readable streams. -// Implement an async ._write(chunk, encoding, cb), and it'll handle all -// the drain event emission and buffering. - -'use strict'; - -/**/ - -var pna = require('process-nextick-args'); -/**/ - -module.exports = Writable; - -/* */ -function WriteReq(chunk, encoding, cb) { - this.chunk = chunk; - this.encoding = encoding; - this.callback = cb; - this.next = null; -} - -// It seems a linked list but it is not -// there will be only 2 of these for each stream -function CorkedRequest(state) { - var _this = this; - - this.next = null; - this.entry = null; - this.finish = function () { - onCorkedFinish(_this, state); - }; -} -/* */ - -/**/ -var asyncWrite = !process.browser && ['v0.10', 'v0.9.'].indexOf(process.version.slice(0, 5)) > -1 ? setImmediate : pna.nextTick; -/**/ - -/**/ -var Duplex; -/**/ - -Writable.WritableState = WritableState; - -/**/ -var util = require('core-util-is'); -util.inherits = require('inherits'); -/**/ - -/**/ -var internalUtil = { - deprecate: require('util-deprecate') -}; -/**/ - -/**/ -var Stream = require('./internal/streams/stream'); -/**/ - -/**/ - -var Buffer = require('safe-buffer').Buffer; -var OurUint8Array = global.Uint8Array || function () {}; -function _uint8ArrayToBuffer(chunk) { - return Buffer.from(chunk); -} -function _isUint8Array(obj) { - return Buffer.isBuffer(obj) || obj instanceof OurUint8Array; -} - -/**/ - -var destroyImpl = require('./internal/streams/destroy'); - -util.inherits(Writable, Stream); - -function nop() {} - -function WritableState(options, stream) { - Duplex = Duplex || require('./_stream_duplex'); - - options = options || {}; - - // Duplex streams are both readable and writable, but share - // the same options object. - // However, some cases require setting options to different - // values for the readable and the writable sides of the duplex stream. - // These options can be provided separately as readableXXX and writableXXX. - var isDuplex = stream instanceof Duplex; - - // object stream flag to indicate whether or not this stream - // contains buffers or objects. - this.objectMode = !!options.objectMode; - - if (isDuplex) this.objectMode = this.objectMode || !!options.writableObjectMode; - - // the point at which write() starts returning false - // Note: 0 is a valid value, means that we always return false if - // the entire buffer is not flushed immediately on write() - var hwm = options.highWaterMark; - var writableHwm = options.writableHighWaterMark; - var defaultHwm = this.objectMode ? 16 : 16 * 1024; - - if (hwm || hwm === 0) this.highWaterMark = hwm;else if (isDuplex && (writableHwm || writableHwm === 0)) this.highWaterMark = writableHwm;else this.highWaterMark = defaultHwm; - - // cast to ints. - this.highWaterMark = Math.floor(this.highWaterMark); - - // if _final has been called - this.finalCalled = false; - - // drain event flag. - this.needDrain = false; - // at the start of calling end() - this.ending = false; - // when end() has been called, and returned - this.ended = false; - // when 'finish' is emitted - this.finished = false; - - // has it been destroyed - this.destroyed = false; - - // should we decode strings into buffers before passing to _write? - // this is here so that some node-core streams can optimize string - // handling at a lower level. - var noDecode = options.decodeStrings === false; - this.decodeStrings = !noDecode; - - // Crypto is kind of old and crusty. Historically, its default string - // encoding is 'binary' so we have to make this configurable. - // Everything else in the universe uses 'utf8', though. - this.defaultEncoding = options.defaultEncoding || 'utf8'; - - // not an actual buffer we keep track of, but a measurement - // of how much we're waiting to get pushed to some underlying - // socket or file. - this.length = 0; - - // a flag to see when we're in the middle of a write. - this.writing = false; - - // when true all writes will be buffered until .uncork() call - this.corked = 0; - - // a flag to be able to tell if the onwrite cb is called immediately, - // or on a later tick. We set this to true at first, because any - // actions that shouldn't happen until "later" should generally also - // not happen before the first write call. - this.sync = true; - - // a flag to know if we're processing previously buffered items, which - // may call the _write() callback in the same tick, so that we don't - // end up in an overlapped onwrite situation. - this.bufferProcessing = false; - - // the callback that's passed to _write(chunk,cb) - this.onwrite = function (er) { - onwrite(stream, er); - }; - - // the callback that the user supplies to write(chunk,encoding,cb) - this.writecb = null; - - // the amount that is being written when _write is called. - this.writelen = 0; - - this.bufferedRequest = null; - this.lastBufferedRequest = null; - - // number of pending user-supplied write callbacks - // this must be 0 before 'finish' can be emitted - this.pendingcb = 0; - - // emit prefinish if the only thing we're waiting for is _write cbs - // This is relevant for synchronous Transform streams - this.prefinished = false; - - // True if the error was already emitted and should not be thrown again - this.errorEmitted = false; - - // count buffered requests - this.bufferedRequestCount = 0; - - // allocate the first CorkedRequest, there is always - // one allocated and free to use, and we maintain at most two - this.corkedRequestsFree = new CorkedRequest(this); -} - -WritableState.prototype.getBuffer = function getBuffer() { - var current = this.bufferedRequest; - var out = []; - while (current) { - out.push(current); - current = current.next; - } - return out; -}; - -(function () { - try { - Object.defineProperty(WritableState.prototype, 'buffer', { - get: internalUtil.deprecate(function () { - return this.getBuffer(); - }, '_writableState.buffer is deprecated. Use _writableState.getBuffer ' + 'instead.', 'DEP0003') - }); - } catch (_) {} -})(); - -// Test _writableState for inheritance to account for Duplex streams, -// whose prototype chain only points to Readable. -var realHasInstance; -if (typeof Symbol === 'function' && Symbol.hasInstance && typeof Function.prototype[Symbol.hasInstance] === 'function') { - realHasInstance = Function.prototype[Symbol.hasInstance]; - Object.defineProperty(Writable, Symbol.hasInstance, { - value: function (object) { - if (realHasInstance.call(this, object)) return true; - if (this !== Writable) return false; - - return object && object._writableState instanceof WritableState; - } - }); -} else { - realHasInstance = function (object) { - return object instanceof this; - }; -} - -function Writable(options) { - Duplex = Duplex || require('./_stream_duplex'); - - // Writable ctor is applied to Duplexes, too. - // `realHasInstance` is necessary because using plain `instanceof` - // would return false, as no `_writableState` property is attached. - - // Trying to use the custom `instanceof` for Writable here will also break the - // Node.js LazyTransform implementation, which has a non-trivial getter for - // `_writableState` that would lead to infinite recursion. - if (!realHasInstance.call(Writable, this) && !(this instanceof Duplex)) { - return new Writable(options); - } - - this._writableState = new WritableState(options, this); - - // legacy. - this.writable = true; - - if (options) { - if (typeof options.write === 'function') this._write = options.write; - - if (typeof options.writev === 'function') this._writev = options.writev; - - if (typeof options.destroy === 'function') this._destroy = options.destroy; - - if (typeof options.final === 'function') this._final = options.final; - } - - Stream.call(this); -} - -// Otherwise people can pipe Writable streams, which is just wrong. -Writable.prototype.pipe = function () { - this.emit('error', new Error('Cannot pipe, not readable')); -}; - -function writeAfterEnd(stream, cb) { - var er = new Error('write after end'); - // TODO: defer error events consistently everywhere, not just the cb - stream.emit('error', er); - pna.nextTick(cb, er); -} - -// Checks that a user-supplied chunk is valid, especially for the particular -// mode the stream is in. Currently this means that `null` is never accepted -// and undefined/non-string values are only allowed in object mode. -function validChunk(stream, state, chunk, cb) { - var valid = true; - var er = false; - - if (chunk === null) { - er = new TypeError('May not write null values to stream'); - } else if (typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) { - er = new TypeError('Invalid non-string/buffer chunk'); - } - if (er) { - stream.emit('error', er); - pna.nextTick(cb, er); - valid = false; - } - return valid; -} - -Writable.prototype.write = function (chunk, encoding, cb) { - var state = this._writableState; - var ret = false; - var isBuf = !state.objectMode && _isUint8Array(chunk); - - if (isBuf && !Buffer.isBuffer(chunk)) { - chunk = _uint8ArrayToBuffer(chunk); - } - - if (typeof encoding === 'function') { - cb = encoding; - encoding = null; - } - - if (isBuf) encoding = 'buffer';else if (!encoding) encoding = state.defaultEncoding; - - if (typeof cb !== 'function') cb = nop; - - if (state.ended) writeAfterEnd(this, cb);else if (isBuf || validChunk(this, state, chunk, cb)) { - state.pendingcb++; - ret = writeOrBuffer(this, state, isBuf, chunk, encoding, cb); - } - - return ret; -}; - -Writable.prototype.cork = function () { - var state = this._writableState; - - state.corked++; -}; - -Writable.prototype.uncork = function () { - var state = this._writableState; - - if (state.corked) { - state.corked--; - - if (!state.writing && !state.corked && !state.finished && !state.bufferProcessing && state.bufferedRequest) clearBuffer(this, state); - } -}; - -Writable.prototype.setDefaultEncoding = function setDefaultEncoding(encoding) { - // node::ParseEncoding() requires lower case. - if (typeof encoding === 'string') encoding = encoding.toLowerCase(); - if (!(['hex', 'utf8', 'utf-8', 'ascii', 'binary', 'base64', 'ucs2', 'ucs-2', 'utf16le', 'utf-16le', 'raw'].indexOf((encoding + '').toLowerCase()) > -1)) throw new TypeError('Unknown encoding: ' + encoding); - this._writableState.defaultEncoding = encoding; - return this; -}; - -function decodeChunk(state, chunk, encoding) { - if (!state.objectMode && state.decodeStrings !== false && typeof chunk === 'string') { - chunk = Buffer.from(chunk, encoding); - } - return chunk; -} - -Object.defineProperty(Writable.prototype, 'writableHighWaterMark', { - // making it explicit this property is not enumerable - // because otherwise some prototype manipulation in - // userland will fail - enumerable: false, - get: function () { - return this._writableState.highWaterMark; - } -}); - -// if we're already writing something, then just put this -// in the queue, and wait our turn. Otherwise, call _write -// If we return false, then we need a drain event, so set that flag. -function writeOrBuffer(stream, state, isBuf, chunk, encoding, cb) { - if (!isBuf) { - var newChunk = decodeChunk(state, chunk, encoding); - if (chunk !== newChunk) { - isBuf = true; - encoding = 'buffer'; - chunk = newChunk; - } - } - var len = state.objectMode ? 1 : chunk.length; - - state.length += len; - - var ret = state.length < state.highWaterMark; - // we must ensure that previous needDrain will not be reset to false. - if (!ret) state.needDrain = true; - - if (state.writing || state.corked) { - var last = state.lastBufferedRequest; - state.lastBufferedRequest = { - chunk: chunk, - encoding: encoding, - isBuf: isBuf, - callback: cb, - next: null - }; - if (last) { - last.next = state.lastBufferedRequest; - } else { - state.bufferedRequest = state.lastBufferedRequest; - } - state.bufferedRequestCount += 1; - } else { - doWrite(stream, state, false, len, chunk, encoding, cb); - } - - return ret; -} - -function doWrite(stream, state, writev, len, chunk, encoding, cb) { - state.writelen = len; - state.writecb = cb; - state.writing = true; - state.sync = true; - if (writev) stream._writev(chunk, state.onwrite);else stream._write(chunk, encoding, state.onwrite); - state.sync = false; -} - -function onwriteError(stream, state, sync, er, cb) { - --state.pendingcb; - - if (sync) { - // defer the callback if we are being called synchronously - // to avoid piling up things on the stack - pna.nextTick(cb, er); - // this can emit finish, and it will always happen - // after error - pna.nextTick(finishMaybe, stream, state); - stream._writableState.errorEmitted = true; - stream.emit('error', er); - } else { - // the caller expect this to happen before if - // it is async - cb(er); - stream._writableState.errorEmitted = true; - stream.emit('error', er); - // this can emit finish, but finish must - // always follow error - finishMaybe(stream, state); - } -} - -function onwriteStateUpdate(state) { - state.writing = false; - state.writecb = null; - state.length -= state.writelen; - state.writelen = 0; -} - -function onwrite(stream, er) { - var state = stream._writableState; - var sync = state.sync; - var cb = state.writecb; - - onwriteStateUpdate(state); - - if (er) onwriteError(stream, state, sync, er, cb);else { - // Check if we're actually ready to finish, but don't emit yet - var finished = needFinish(state); - - if (!finished && !state.corked && !state.bufferProcessing && state.bufferedRequest) { - clearBuffer(stream, state); - } - - if (sync) { - /**/ - asyncWrite(afterWrite, stream, state, finished, cb); - /**/ - } else { - afterWrite(stream, state, finished, cb); - } - } -} - -function afterWrite(stream, state, finished, cb) { - if (!finished) onwriteDrain(stream, state); - state.pendingcb--; - cb(); - finishMaybe(stream, state); -} - -// Must force callback to be called on nextTick, so that we don't -// emit 'drain' before the write() consumer gets the 'false' return -// value, and has a chance to attach a 'drain' listener. -function onwriteDrain(stream, state) { - if (state.length === 0 && state.needDrain) { - state.needDrain = false; - stream.emit('drain'); - } -} - -// if there's something in the buffer waiting, then process it -function clearBuffer(stream, state) { - state.bufferProcessing = true; - var entry = state.bufferedRequest; - - if (stream._writev && entry && entry.next) { - // Fast case, write everything using _writev() - var l = state.bufferedRequestCount; - var buffer = new Array(l); - var holder = state.corkedRequestsFree; - holder.entry = entry; - - var count = 0; - var allBuffers = true; - while (entry) { - buffer[count] = entry; - if (!entry.isBuf) allBuffers = false; - entry = entry.next; - count += 1; - } - buffer.allBuffers = allBuffers; - - doWrite(stream, state, true, state.length, buffer, '', holder.finish); - - // doWrite is almost always async, defer these to save a bit of time - // as the hot path ends with doWrite - state.pendingcb++; - state.lastBufferedRequest = null; - if (holder.next) { - state.corkedRequestsFree = holder.next; - holder.next = null; - } else { - state.corkedRequestsFree = new CorkedRequest(state); - } - state.bufferedRequestCount = 0; - } else { - // Slow case, write chunks one-by-one - while (entry) { - var chunk = entry.chunk; - var encoding = entry.encoding; - var cb = entry.callback; - var len = state.objectMode ? 1 : chunk.length; - - doWrite(stream, state, false, len, chunk, encoding, cb); - entry = entry.next; - state.bufferedRequestCount--; - // if we didn't call the onwrite immediately, then - // it means that we need to wait until it does. - // also, that means that the chunk and cb are currently - // being processed, so move the buffer counter past them. - if (state.writing) { - break; - } - } - - if (entry === null) state.lastBufferedRequest = null; - } - - state.bufferedRequest = entry; - state.bufferProcessing = false; -} - -Writable.prototype._write = function (chunk, encoding, cb) { - cb(new Error('_write() is not implemented')); -}; - -Writable.prototype._writev = null; - -Writable.prototype.end = function (chunk, encoding, cb) { - var state = this._writableState; - - if (typeof chunk === 'function') { - cb = chunk; - chunk = null; - encoding = null; - } else if (typeof encoding === 'function') { - cb = encoding; - encoding = null; - } - - if (chunk !== null && chunk !== undefined) this.write(chunk, encoding); - - // .end() fully uncorks - if (state.corked) { - state.corked = 1; - this.uncork(); - } - - // ignore unnecessary end() calls. - if (!state.ending && !state.finished) endWritable(this, state, cb); -}; - -function needFinish(state) { - return state.ending && state.length === 0 && state.bufferedRequest === null && !state.finished && !state.writing; -} -function callFinal(stream, state) { - stream._final(function (err) { - state.pendingcb--; - if (err) { - stream.emit('error', err); - } - state.prefinished = true; - stream.emit('prefinish'); - finishMaybe(stream, state); - }); -} -function prefinish(stream, state) { - if (!state.prefinished && !state.finalCalled) { - if (typeof stream._final === 'function') { - state.pendingcb++; - state.finalCalled = true; - pna.nextTick(callFinal, stream, state); - } else { - state.prefinished = true; - stream.emit('prefinish'); - } - } -} - -function finishMaybe(stream, state) { - var need = needFinish(state); - if (need) { - prefinish(stream, state); - if (state.pendingcb === 0) { - state.finished = true; - stream.emit('finish'); - } - } - return need; -} - -function endWritable(stream, state, cb) { - state.ending = true; - finishMaybe(stream, state); - if (cb) { - if (state.finished) pna.nextTick(cb);else stream.once('finish', cb); - } - state.ended = true; - stream.writable = false; -} - -function onCorkedFinish(corkReq, state, err) { - var entry = corkReq.entry; - corkReq.entry = null; - while (entry) { - var cb = entry.callback; - state.pendingcb--; - cb(err); - entry = entry.next; - } - if (state.corkedRequestsFree) { - state.corkedRequestsFree.next = corkReq; - } else { - state.corkedRequestsFree = corkReq; - } -} - -Object.defineProperty(Writable.prototype, 'destroyed', { - get: function () { - if (this._writableState === undefined) { - return false; - } - return this._writableState.destroyed; - }, - set: function (value) { - // we ignore the value if the stream - // has not been initialized yet - if (!this._writableState) { - return; - } - - // backward compatibility, the user is explicitly - // managing destroyed - this._writableState.destroyed = value; - } -}); - -Writable.prototype.destroy = destroyImpl.destroy; -Writable.prototype._undestroy = destroyImpl.undestroy; -Writable.prototype._destroy = function (err, cb) { - this.end(); - cb(err); -}; \ No newline at end of file diff --git a/deps/npm/node_modules/stream-iterate/node_modules/readable-stream/lib/internal/streams/BufferList.js b/deps/npm/node_modules/stream-iterate/node_modules/readable-stream/lib/internal/streams/BufferList.js deleted file mode 100644 index aefc68bd90b9c2..00000000000000 --- a/deps/npm/node_modules/stream-iterate/node_modules/readable-stream/lib/internal/streams/BufferList.js +++ /dev/null @@ -1,79 +0,0 @@ -'use strict'; - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -var Buffer = require('safe-buffer').Buffer; -var util = require('util'); - -function copyBuffer(src, target, offset) { - src.copy(target, offset); -} - -module.exports = function () { - function BufferList() { - _classCallCheck(this, BufferList); - - this.head = null; - this.tail = null; - this.length = 0; - } - - BufferList.prototype.push = function push(v) { - var entry = { data: v, next: null }; - if (this.length > 0) this.tail.next = entry;else this.head = entry; - this.tail = entry; - ++this.length; - }; - - BufferList.prototype.unshift = function unshift(v) { - var entry = { data: v, next: this.head }; - if (this.length === 0) this.tail = entry; - this.head = entry; - ++this.length; - }; - - BufferList.prototype.shift = function shift() { - if (this.length === 0) return; - var ret = this.head.data; - if (this.length === 1) this.head = this.tail = null;else this.head = this.head.next; - --this.length; - return ret; - }; - - BufferList.prototype.clear = function clear() { - this.head = this.tail = null; - this.length = 0; - }; - - BufferList.prototype.join = function join(s) { - if (this.length === 0) return ''; - var p = this.head; - var ret = '' + p.data; - while (p = p.next) { - ret += s + p.data; - }return ret; - }; - - BufferList.prototype.concat = function concat(n) { - if (this.length === 0) return Buffer.alloc(0); - if (this.length === 1) return this.head.data; - var ret = Buffer.allocUnsafe(n >>> 0); - var p = this.head; - var i = 0; - while (p) { - copyBuffer(p.data, ret, i); - i += p.data.length; - p = p.next; - } - return ret; - }; - - return BufferList; -}(); - -if (util && util.inspect && util.inspect.custom) { - module.exports.prototype[util.inspect.custom] = function () { - var obj = util.inspect({ length: this.length }); - return this.constructor.name + ' ' + obj; - }; -} \ No newline at end of file diff --git a/deps/npm/node_modules/stream-iterate/node_modules/readable-stream/lib/internal/streams/destroy.js b/deps/npm/node_modules/stream-iterate/node_modules/readable-stream/lib/internal/streams/destroy.js deleted file mode 100644 index 5a0a0d88cec6f3..00000000000000 --- a/deps/npm/node_modules/stream-iterate/node_modules/readable-stream/lib/internal/streams/destroy.js +++ /dev/null @@ -1,74 +0,0 @@ -'use strict'; - -/**/ - -var pna = require('process-nextick-args'); -/**/ - -// undocumented cb() API, needed for core, not for public API -function destroy(err, cb) { - var _this = this; - - var readableDestroyed = this._readableState && this._readableState.destroyed; - var writableDestroyed = this._writableState && this._writableState.destroyed; - - if (readableDestroyed || writableDestroyed) { - if (cb) { - cb(err); - } else if (err && (!this._writableState || !this._writableState.errorEmitted)) { - pna.nextTick(emitErrorNT, this, err); - } - return this; - } - - // we set destroyed to true before firing error callbacks in order - // to make it re-entrance safe in case destroy() is called within callbacks - - if (this._readableState) { - this._readableState.destroyed = true; - } - - // if this is a duplex stream mark the writable part as destroyed as well - if (this._writableState) { - this._writableState.destroyed = true; - } - - this._destroy(err || null, function (err) { - if (!cb && err) { - pna.nextTick(emitErrorNT, _this, err); - if (_this._writableState) { - _this._writableState.errorEmitted = true; - } - } else if (cb) { - cb(err); - } - }); - - return this; -} - -function undestroy() { - if (this._readableState) { - this._readableState.destroyed = false; - this._readableState.reading = false; - this._readableState.ended = false; - this._readableState.endEmitted = false; - } - - if (this._writableState) { - this._writableState.destroyed = false; - this._writableState.ended = false; - this._writableState.ending = false; - this._writableState.finished = false; - this._writableState.errorEmitted = false; - } -} - -function emitErrorNT(self, err) { - self.emit('error', err); -} - -module.exports = { - destroy: destroy, - undestroy: undestroy -}; \ No newline at end of file diff --git a/deps/npm/node_modules/stream-iterate/node_modules/readable-stream/lib/internal/streams/stream-browser.js b/deps/npm/node_modules/stream-iterate/node_modules/readable-stream/lib/internal/streams/stream-browser.js deleted file mode 100644 index 9332a3fdae7060..00000000000000 --- a/deps/npm/node_modules/stream-iterate/node_modules/readable-stream/lib/internal/streams/stream-browser.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('events').EventEmitter; diff --git a/deps/npm/node_modules/stream-iterate/node_modules/readable-stream/lib/internal/streams/stream.js b/deps/npm/node_modules/stream-iterate/node_modules/readable-stream/lib/internal/streams/stream.js deleted file mode 100644 index ce2ad5b6ee57f4..00000000000000 --- a/deps/npm/node_modules/stream-iterate/node_modules/readable-stream/lib/internal/streams/stream.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('stream'); diff --git a/deps/npm/node_modules/stream-iterate/node_modules/readable-stream/package.json b/deps/npm/node_modules/stream-iterate/node_modules/readable-stream/package.json deleted file mode 100644 index 2d5b4eae1d9006..00000000000000 --- a/deps/npm/node_modules/stream-iterate/node_modules/readable-stream/package.json +++ /dev/null @@ -1,81 +0,0 @@ -{ - "_from": "readable-stream@^2.1.5", - "_id": "readable-stream@2.3.6", - "_inBundle": false, - "_integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", - "_location": "/stream-iterate/readable-stream", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "readable-stream@^2.1.5", - "name": "readable-stream", - "escapedName": "readable-stream", - "rawSpec": "^2.1.5", - "saveSpec": null, - "fetchSpec": "^2.1.5" - }, - "_requiredBy": [ - "/stream-iterate" - ], - "_resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", - "_shasum": "b11c27d88b8ff1fbe070643cf94b0c79ae1b0aaf", - "_spec": "readable-stream@^2.1.5", - "_where": "/Users/aeschright/code/cli/node_modules/stream-iterate", - "browser": { - "util": false, - "./readable.js": "./readable-browser.js", - "./writable.js": "./writable-browser.js", - "./duplex.js": "./duplex-browser.js", - "./lib/internal/streams/stream.js": "./lib/internal/streams/stream-browser.js" - }, - "bugs": { - "url": "https://github.com/nodejs/readable-stream/issues" - }, - "bundleDependencies": false, - "dependencies": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - }, - "deprecated": false, - "description": "Streams3, a user-land copy of the stream library from Node.js", - "devDependencies": { - "assert": "^1.4.0", - "babel-polyfill": "^6.9.1", - "buffer": "^4.9.0", - "lolex": "^2.3.2", - "nyc": "^6.4.0", - "tap": "^0.7.0", - "tape": "^4.8.0" - }, - "homepage": "https://github.com/nodejs/readable-stream#readme", - "keywords": [ - "readable", - "stream", - "pipe" - ], - "license": "MIT", - "main": "readable.js", - "name": "readable-stream", - "nyc": { - "include": [ - "lib/**.js" - ] - }, - "repository": { - "type": "git", - "url": "git://github.com/nodejs/readable-stream.git" - }, - "scripts": { - "ci": "tap test/parallel/*.js test/ours/*.js --tap | tee test.tap && node test/verify-dependencies.js", - "cover": "nyc npm test", - "report": "nyc report --reporter=lcov", - "test": "tap test/parallel/*.js test/ours/*.js && node test/verify-dependencies.js" - }, - "version": "2.3.6" -} diff --git a/deps/npm/node_modules/stream-iterate/node_modules/readable-stream/passthrough.js b/deps/npm/node_modules/stream-iterate/node_modules/readable-stream/passthrough.js deleted file mode 100644 index ffd791d7ff275a..00000000000000 --- a/deps/npm/node_modules/stream-iterate/node_modules/readable-stream/passthrough.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./readable').PassThrough diff --git a/deps/npm/node_modules/stream-iterate/node_modules/readable-stream/readable-browser.js b/deps/npm/node_modules/stream-iterate/node_modules/readable-stream/readable-browser.js deleted file mode 100644 index e50372592ee6c6..00000000000000 --- a/deps/npm/node_modules/stream-iterate/node_modules/readable-stream/readable-browser.js +++ /dev/null @@ -1,7 +0,0 @@ -exports = module.exports = require('./lib/_stream_readable.js'); -exports.Stream = exports; -exports.Readable = exports; -exports.Writable = require('./lib/_stream_writable.js'); -exports.Duplex = require('./lib/_stream_duplex.js'); -exports.Transform = require('./lib/_stream_transform.js'); -exports.PassThrough = require('./lib/_stream_passthrough.js'); diff --git a/deps/npm/node_modules/stream-iterate/node_modules/readable-stream/readable.js b/deps/npm/node_modules/stream-iterate/node_modules/readable-stream/readable.js deleted file mode 100644 index ec89ec53306497..00000000000000 --- a/deps/npm/node_modules/stream-iterate/node_modules/readable-stream/readable.js +++ /dev/null @@ -1,19 +0,0 @@ -var Stream = require('stream'); -if (process.env.READABLE_STREAM === 'disable' && Stream) { - module.exports = Stream; - exports = module.exports = Stream.Readable; - exports.Readable = Stream.Readable; - exports.Writable = Stream.Writable; - exports.Duplex = Stream.Duplex; - exports.Transform = Stream.Transform; - exports.PassThrough = Stream.PassThrough; - exports.Stream = Stream; -} else { - exports = module.exports = require('./lib/_stream_readable.js'); - exports.Stream = Stream || exports; - exports.Readable = exports; - exports.Writable = require('./lib/_stream_writable.js'); - exports.Duplex = require('./lib/_stream_duplex.js'); - exports.Transform = require('./lib/_stream_transform.js'); - exports.PassThrough = require('./lib/_stream_passthrough.js'); -} diff --git a/deps/npm/node_modules/stream-iterate/node_modules/readable-stream/transform.js b/deps/npm/node_modules/stream-iterate/node_modules/readable-stream/transform.js deleted file mode 100644 index b1baba26da03dc..00000000000000 --- a/deps/npm/node_modules/stream-iterate/node_modules/readable-stream/transform.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./readable').Transform diff --git a/deps/npm/node_modules/stream-iterate/node_modules/readable-stream/writable-browser.js b/deps/npm/node_modules/stream-iterate/node_modules/readable-stream/writable-browser.js deleted file mode 100644 index ebdde6a85dcb19..00000000000000 --- a/deps/npm/node_modules/stream-iterate/node_modules/readable-stream/writable-browser.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./lib/_stream_writable.js'); diff --git a/deps/npm/node_modules/stream-iterate/node_modules/readable-stream/writable.js b/deps/npm/node_modules/stream-iterate/node_modules/readable-stream/writable.js deleted file mode 100644 index 3211a6f80d1abc..00000000000000 --- a/deps/npm/node_modules/stream-iterate/node_modules/readable-stream/writable.js +++ /dev/null @@ -1,8 +0,0 @@ -var Stream = require("stream") -var Writable = require("./lib/_stream_writable.js") - -if (process.env.READABLE_STREAM === 'disable') { - module.exports = Stream && Stream.Writable || Writable -} else { - module.exports = Writable -} diff --git a/deps/npm/node_modules/stream-iterate/node_modules/string_decoder/.travis.yml b/deps/npm/node_modules/stream-iterate/node_modules/string_decoder/.travis.yml deleted file mode 100644 index 3347a725465058..00000000000000 --- a/deps/npm/node_modules/stream-iterate/node_modules/string_decoder/.travis.yml +++ /dev/null @@ -1,50 +0,0 @@ -sudo: false -language: node_js -before_install: - - npm install -g npm@2 - - test $NPM_LEGACY && npm install -g npm@latest-3 || npm install npm -g -notifications: - email: false -matrix: - fast_finish: true - include: - - node_js: '0.8' - env: - - TASK=test - - NPM_LEGACY=true - - node_js: '0.10' - env: - - TASK=test - - NPM_LEGACY=true - - node_js: '0.11' - env: - - TASK=test - - NPM_LEGACY=true - - node_js: '0.12' - env: - - TASK=test - - NPM_LEGACY=true - - node_js: 1 - env: - - TASK=test - - NPM_LEGACY=true - - node_js: 2 - env: - - TASK=test - - NPM_LEGACY=true - - node_js: 3 - env: - - TASK=test - - NPM_LEGACY=true - - node_js: 4 - env: TASK=test - - node_js: 5 - env: TASK=test - - node_js: 6 - env: TASK=test - - node_js: 7 - env: TASK=test - - node_js: 8 - env: TASK=test - - node_js: 9 - env: TASK=test diff --git a/deps/npm/node_modules/stream-iterate/node_modules/string_decoder/LICENSE b/deps/npm/node_modules/stream-iterate/node_modules/string_decoder/LICENSE deleted file mode 100644 index 778edb20730ef4..00000000000000 --- a/deps/npm/node_modules/stream-iterate/node_modules/string_decoder/LICENSE +++ /dev/null @@ -1,48 +0,0 @@ -Node.js is licensed for use as follows: - -""" -Copyright Node.js contributors. All rights reserved. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to -deal in the Software without restriction, including without limitation the -rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -sell copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -IN THE SOFTWARE. -""" - -This license applies to parts of Node.js originating from the -https://github.com/joyent/node repository: - -""" -Copyright Joyent, Inc. and other Node contributors. All rights reserved. -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to -deal in the Software without restriction, including without limitation the -rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -sell copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -IN THE SOFTWARE. -""" - diff --git a/deps/npm/node_modules/stream-iterate/node_modules/string_decoder/README.md b/deps/npm/node_modules/stream-iterate/node_modules/string_decoder/README.md deleted file mode 100644 index 5fd58315ed5880..00000000000000 --- a/deps/npm/node_modules/stream-iterate/node_modules/string_decoder/README.md +++ /dev/null @@ -1,47 +0,0 @@ -# string_decoder - -***Node-core v8.9.4 string_decoder for userland*** - - -[![NPM](https://nodei.co/npm/string_decoder.png?downloads=true&downloadRank=true)](https://nodei.co/npm/string_decoder/) -[![NPM](https://nodei.co/npm-dl/string_decoder.png?&months=6&height=3)](https://nodei.co/npm/string_decoder/) - - -```bash -npm install --save string_decoder -``` - -***Node-core string_decoder for userland*** - -This package is a mirror of the string_decoder implementation in Node-core. - -Full documentation may be found on the [Node.js website](https://nodejs.org/dist/v8.9.4/docs/api/). - -As of version 1.0.0 **string_decoder** uses semantic versioning. - -## Previous versions - -Previous version numbers match the versions found in Node core, e.g. 0.10.24 matches Node 0.10.24, likewise 0.11.10 matches Node 0.11.10. - -## Update - -The *build/* directory contains a build script that will scrape the source from the [nodejs/node](https://github.com/nodejs/node) repo given a specific Node version. - -## Streams Working Group - -`string_decoder` is maintained by the Streams Working Group, which -oversees the development and maintenance of the Streams API within -Node.js. The responsibilities of the Streams Working Group include: - -* Addressing stream issues on the Node.js issue tracker. -* Authoring and editing stream documentation within the Node.js project. -* Reviewing changes to stream subclasses within the Node.js project. -* Redirecting changes to streams from the Node.js project to this - project. -* Assisting in the implementation of stream providers within Node.js. -* Recommending versions of `readable-stream` to be included in Node.js. -* Messaging about the future of streams to give the community advance - notice of changes. - -See [readable-stream](https://github.com/nodejs/readable-stream) for -more details. diff --git a/deps/npm/node_modules/stream-iterate/node_modules/string_decoder/lib/string_decoder.js b/deps/npm/node_modules/stream-iterate/node_modules/string_decoder/lib/string_decoder.js deleted file mode 100644 index 2e89e63f7933e4..00000000000000 --- a/deps/npm/node_modules/stream-iterate/node_modules/string_decoder/lib/string_decoder.js +++ /dev/null @@ -1,296 +0,0 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - -'use strict'; - -/**/ - -var Buffer = require('safe-buffer').Buffer; -/**/ - -var isEncoding = Buffer.isEncoding || function (encoding) { - encoding = '' + encoding; - switch (encoding && encoding.toLowerCase()) { - case 'hex':case 'utf8':case 'utf-8':case 'ascii':case 'binary':case 'base64':case 'ucs2':case 'ucs-2':case 'utf16le':case 'utf-16le':case 'raw': - return true; - default: - return false; - } -}; - -function _normalizeEncoding(enc) { - if (!enc) return 'utf8'; - var retried; - while (true) { - switch (enc) { - case 'utf8': - case 'utf-8': - return 'utf8'; - case 'ucs2': - case 'ucs-2': - case 'utf16le': - case 'utf-16le': - return 'utf16le'; - case 'latin1': - case 'binary': - return 'latin1'; - case 'base64': - case 'ascii': - case 'hex': - return enc; - default: - if (retried) return; // undefined - enc = ('' + enc).toLowerCase(); - retried = true; - } - } -}; - -// Do not cache `Buffer.isEncoding` when checking encoding names as some -// modules monkey-patch it to support additional encodings -function normalizeEncoding(enc) { - var nenc = _normalizeEncoding(enc); - if (typeof nenc !== 'string' && (Buffer.isEncoding === isEncoding || !isEncoding(enc))) throw new Error('Unknown encoding: ' + enc); - return nenc || enc; -} - -// StringDecoder provides an interface for efficiently splitting a series of -// buffers into a series of JS strings without breaking apart multi-byte -// characters. -exports.StringDecoder = StringDecoder; -function StringDecoder(encoding) { - this.encoding = normalizeEncoding(encoding); - var nb; - switch (this.encoding) { - case 'utf16le': - this.text = utf16Text; - this.end = utf16End; - nb = 4; - break; - case 'utf8': - this.fillLast = utf8FillLast; - nb = 4; - break; - case 'base64': - this.text = base64Text; - this.end = base64End; - nb = 3; - break; - default: - this.write = simpleWrite; - this.end = simpleEnd; - return; - } - this.lastNeed = 0; - this.lastTotal = 0; - this.lastChar = Buffer.allocUnsafe(nb); -} - -StringDecoder.prototype.write = function (buf) { - if (buf.length === 0) return ''; - var r; - var i; - if (this.lastNeed) { - r = this.fillLast(buf); - if (r === undefined) return ''; - i = this.lastNeed; - this.lastNeed = 0; - } else { - i = 0; - } - if (i < buf.length) return r ? r + this.text(buf, i) : this.text(buf, i); - return r || ''; -}; - -StringDecoder.prototype.end = utf8End; - -// Returns only complete characters in a Buffer -StringDecoder.prototype.text = utf8Text; - -// Attempts to complete a partial non-UTF-8 character using bytes from a Buffer -StringDecoder.prototype.fillLast = function (buf) { - if (this.lastNeed <= buf.length) { - buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, this.lastNeed); - return this.lastChar.toString(this.encoding, 0, this.lastTotal); - } - buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, buf.length); - this.lastNeed -= buf.length; -}; - -// Checks the type of a UTF-8 byte, whether it's ASCII, a leading byte, or a -// continuation byte. If an invalid byte is detected, -2 is returned. -function utf8CheckByte(byte) { - if (byte <= 0x7F) return 0;else if (byte >> 5 === 0x06) return 2;else if (byte >> 4 === 0x0E) return 3;else if (byte >> 3 === 0x1E) return 4; - return byte >> 6 === 0x02 ? -1 : -2; -} - -// Checks at most 3 bytes at the end of a Buffer in order to detect an -// incomplete multi-byte UTF-8 character. The total number of bytes (2, 3, or 4) -// needed to complete the UTF-8 character (if applicable) are returned. -function utf8CheckIncomplete(self, buf, i) { - var j = buf.length - 1; - if (j < i) return 0; - var nb = utf8CheckByte(buf[j]); - if (nb >= 0) { - if (nb > 0) self.lastNeed = nb - 1; - return nb; - } - if (--j < i || nb === -2) return 0; - nb = utf8CheckByte(buf[j]); - if (nb >= 0) { - if (nb > 0) self.lastNeed = nb - 2; - return nb; - } - if (--j < i || nb === -2) return 0; - nb = utf8CheckByte(buf[j]); - if (nb >= 0) { - if (nb > 0) { - if (nb === 2) nb = 0;else self.lastNeed = nb - 3; - } - return nb; - } - return 0; -} - -// Validates as many continuation bytes for a multi-byte UTF-8 character as -// needed or are available. If we see a non-continuation byte where we expect -// one, we "replace" the validated continuation bytes we've seen so far with -// a single UTF-8 replacement character ('\ufffd'), to match v8's UTF-8 decoding -// behavior. The continuation byte check is included three times in the case -// where all of the continuation bytes for a character exist in the same buffer. -// It is also done this way as a slight performance increase instead of using a -// loop. -function utf8CheckExtraBytes(self, buf, p) { - if ((buf[0] & 0xC0) !== 0x80) { - self.lastNeed = 0; - return '\ufffd'; - } - if (self.lastNeed > 1 && buf.length > 1) { - if ((buf[1] & 0xC0) !== 0x80) { - self.lastNeed = 1; - return '\ufffd'; - } - if (self.lastNeed > 2 && buf.length > 2) { - if ((buf[2] & 0xC0) !== 0x80) { - self.lastNeed = 2; - return '\ufffd'; - } - } - } -} - -// Attempts to complete a multi-byte UTF-8 character using bytes from a Buffer. -function utf8FillLast(buf) { - var p = this.lastTotal - this.lastNeed; - var r = utf8CheckExtraBytes(this, buf, p); - if (r !== undefined) return r; - if (this.lastNeed <= buf.length) { - buf.copy(this.lastChar, p, 0, this.lastNeed); - return this.lastChar.toString(this.encoding, 0, this.lastTotal); - } - buf.copy(this.lastChar, p, 0, buf.length); - this.lastNeed -= buf.length; -} - -// Returns all complete UTF-8 characters in a Buffer. If the Buffer ended on a -// partial character, the character's bytes are buffered until the required -// number of bytes are available. -function utf8Text(buf, i) { - var total = utf8CheckIncomplete(this, buf, i); - if (!this.lastNeed) return buf.toString('utf8', i); - this.lastTotal = total; - var end = buf.length - (total - this.lastNeed); - buf.copy(this.lastChar, 0, end); - return buf.toString('utf8', i, end); -} - -// For UTF-8, a replacement character is added when ending on a partial -// character. -function utf8End(buf) { - var r = buf && buf.length ? this.write(buf) : ''; - if (this.lastNeed) return r + '\ufffd'; - return r; -} - -// UTF-16LE typically needs two bytes per character, but even if we have an even -// number of bytes available, we need to check if we end on a leading/high -// surrogate. In that case, we need to wait for the next two bytes in order to -// decode the last character properly. -function utf16Text(buf, i) { - if ((buf.length - i) % 2 === 0) { - var r = buf.toString('utf16le', i); - if (r) { - var c = r.charCodeAt(r.length - 1); - if (c >= 0xD800 && c <= 0xDBFF) { - this.lastNeed = 2; - this.lastTotal = 4; - this.lastChar[0] = buf[buf.length - 2]; - this.lastChar[1] = buf[buf.length - 1]; - return r.slice(0, -1); - } - } - return r; - } - this.lastNeed = 1; - this.lastTotal = 2; - this.lastChar[0] = buf[buf.length - 1]; - return buf.toString('utf16le', i, buf.length - 1); -} - -// For UTF-16LE we do not explicitly append special replacement characters if we -// end on a partial character, we simply let v8 handle that. -function utf16End(buf) { - var r = buf && buf.length ? this.write(buf) : ''; - if (this.lastNeed) { - var end = this.lastTotal - this.lastNeed; - return r + this.lastChar.toString('utf16le', 0, end); - } - return r; -} - -function base64Text(buf, i) { - var n = (buf.length - i) % 3; - if (n === 0) return buf.toString('base64', i); - this.lastNeed = 3 - n; - this.lastTotal = 3; - if (n === 1) { - this.lastChar[0] = buf[buf.length - 1]; - } else { - this.lastChar[0] = buf[buf.length - 2]; - this.lastChar[1] = buf[buf.length - 1]; - } - return buf.toString('base64', i, buf.length - n); -} - -function base64End(buf) { - var r = buf && buf.length ? this.write(buf) : ''; - if (this.lastNeed) return r + this.lastChar.toString('base64', 0, 3 - this.lastNeed); - return r; -} - -// Pass bytes on through for single-byte encodings (e.g. ascii, latin1, hex) -function simpleWrite(buf) { - return buf.toString(this.encoding); -} - -function simpleEnd(buf) { - return buf && buf.length ? this.write(buf) : ''; -} \ No newline at end of file diff --git a/deps/npm/node_modules/stream-iterate/node_modules/string_decoder/package.json b/deps/npm/node_modules/stream-iterate/node_modules/string_decoder/package.json deleted file mode 100644 index e8bac877845579..00000000000000 --- a/deps/npm/node_modules/stream-iterate/node_modules/string_decoder/package.json +++ /dev/null @@ -1,59 +0,0 @@ -{ - "_from": "string_decoder@~1.1.1", - "_id": "string_decoder@1.1.1", - "_inBundle": false, - "_integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "_location": "/stream-iterate/string_decoder", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "string_decoder@~1.1.1", - "name": "string_decoder", - "escapedName": "string_decoder", - "rawSpec": "~1.1.1", - "saveSpec": null, - "fetchSpec": "~1.1.1" - }, - "_requiredBy": [ - "/stream-iterate/readable-stream" - ], - "_resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "_shasum": "9cf1611ba62685d7030ae9e4ba34149c3af03fc8", - "_spec": "string_decoder@~1.1.1", - "_where": "/Users/aeschright/code/cli/node_modules/stream-iterate/node_modules/readable-stream", - "bugs": { - "url": "https://github.com/nodejs/string_decoder/issues" - }, - "bundleDependencies": false, - "dependencies": { - "safe-buffer": "~5.1.0" - }, - "deprecated": false, - "description": "The string_decoder module from Node core", - "devDependencies": { - "babel-polyfill": "^6.23.0", - "core-util-is": "^1.0.2", - "inherits": "^2.0.3", - "tap": "~0.4.8" - }, - "homepage": "https://github.com/nodejs/string_decoder", - "keywords": [ - "string", - "decoder", - "browser", - "browserify" - ], - "license": "MIT", - "main": "lib/string_decoder.js", - "name": "string_decoder", - "repository": { - "type": "git", - "url": "git://github.com/nodejs/string_decoder.git" - }, - "scripts": { - "ci": "tap test/parallel/*.js test/ours/*.js --tap | tee test.tap && node test/verify-dependencies.js", - "test": "tap test/parallel/*.js && node test/verify-dependencies" - }, - "version": "1.1.1" -} diff --git a/deps/npm/node_modules/stream-iterate/package.json b/deps/npm/node_modules/stream-iterate/package.json deleted file mode 100644 index 200f13fc27ff35..00000000000000 --- a/deps/npm/node_modules/stream-iterate/package.json +++ /dev/null @@ -1,56 +0,0 @@ -{ - "_from": "stream-iterate@^1.1.0", - "_id": "stream-iterate@1.2.0", - "_inBundle": false, - "_integrity": "sha1-K9fHcpbBcCpGSIuK1B95hl7s1OE=", - "_location": "/stream-iterate", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "stream-iterate@^1.1.0", - "name": "stream-iterate", - "escapedName": "stream-iterate", - "rawSpec": "^1.1.0", - "saveSpec": null, - "fetchSpec": "^1.1.0" - }, - "_requiredBy": [ - "/sorted-union-stream" - ], - "_resolved": "https://registry.npmjs.org/stream-iterate/-/stream-iterate-1.2.0.tgz", - "_shasum": "2bd7c77296c1702a46488b8ad41f79865eecd4e1", - "_spec": "stream-iterate@^1.1.0", - "_where": "/Users/rebecca/code/npm/node_modules/sorted-union-stream", - "author": { - "name": "Mathias Buus", - "url": "@mafintosh" - }, - "bugs": { - "url": "https://github.com/mafintosh/stream-iterate/issues" - }, - "bundleDependencies": false, - "dependencies": { - "readable-stream": "^2.1.5", - "stream-shift": "^1.0.0" - }, - "deprecated": false, - "description": "Iterate through the values of a stream", - "devDependencies": { - "from2": "^1.3.0", - "standard": "^3.3.2", - "tape": "^4.0.0" - }, - "homepage": "https://github.com/mafintosh/stream-iterate", - "license": "MIT", - "main": "index.js", - "name": "stream-iterate", - "repository": { - "type": "git", - "url": "git+https://github.com/mafintosh/stream-iterate.git" - }, - "scripts": { - "test": "standard && tape test.js" - }, - "version": "1.2.0" -} diff --git a/deps/npm/node_modules/stream-iterate/test.js b/deps/npm/node_modules/stream-iterate/test.js deleted file mode 100644 index 5beb23a5d94ef8..00000000000000 --- a/deps/npm/node_modules/stream-iterate/test.js +++ /dev/null @@ -1,60 +0,0 @@ -var tape = require('tape') -var from = require('from2') -var iterate = require('./') - -tape('merge sort', function (t) { - var a = from.obj(['a', 'b', 'd', 'e', 'g', 'h']) - var b = from.obj(['b', 'c', 'f']) - var output = [] - - var readA = iterate(a) - var readB = iterate(b) - - var loop = function () { - readA(function (err, dataA, nextA) { - if (err) throw err - readB(function (err, dataB, nextB) { - if (err) throw err - - if (!dataA && !dataB) { - t.same(output, ['a', 'b', 'b', 'c', 'd', 'e', 'f', 'g', 'h'], 'sorts list') - t.end() - return - } - - if (!dataB || dataA < dataB) { - output.push(dataA) - nextA() - return loop() - } - - if (!dataA || dataA > dataB) { - output.push(dataB) - nextB() - return loop() - } - - output.push(dataA) - output.push(dataB) - nextA() - nextB() - loop() - }) - }) - } - - loop() -}) - -tape('error handling', function (t) { - var a = from.obj(['a', 'b', 'd', 'e', 'g', 'h']) - var read = iterate(a) - - a.destroy(new Error('oh no')) - - read(function (err) { - t.ok(err, 'had error') - t.same(err.message, 'oh no') - t.end() - }) -}) diff --git a/deps/npm/node_modules/stream-shift/.npmignore b/deps/npm/node_modules/stream-shift/.npmignore deleted file mode 100644 index 3c3629e647f5dd..00000000000000 --- a/deps/npm/node_modules/stream-shift/.npmignore +++ /dev/null @@ -1 +0,0 @@ -node_modules diff --git a/deps/npm/node_modules/stream-shift/.travis.yml b/deps/npm/node_modules/stream-shift/.travis.yml deleted file mode 100644 index ecd4193f6025e0..00000000000000 --- a/deps/npm/node_modules/stream-shift/.travis.yml +++ /dev/null @@ -1,6 +0,0 @@ -language: node_js -node_js: - - "0.10" - - "0.12" - - "4" - - "6" diff --git a/deps/npm/node_modules/stream-shift/LICENSE b/deps/npm/node_modules/stream-shift/LICENSE deleted file mode 100644 index bae9da7bfae2b5..00000000000000 --- a/deps/npm/node_modules/stream-shift/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2016 Mathias Buus - -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/stream-shift/README.md b/deps/npm/node_modules/stream-shift/README.md deleted file mode 100644 index d9cc2d945fa161..00000000000000 --- a/deps/npm/node_modules/stream-shift/README.md +++ /dev/null @@ -1,25 +0,0 @@ -# stream-shift - -Returns the next buffer/object in a stream's readable queue - -``` -npm install stream-shift -``` - -[![build status](http://img.shields.io/travis/mafintosh/stream-shift.svg?style=flat)](http://travis-ci.org/mafintosh/stream-shift) - -## Usage - -``` js -var shift = require('stream-shift') - -console.log(shift(someStream)) // first item in its buffer -``` - -## Credit - -Thanks [@dignifiedquire](https://github.com/dignifiedquire) for making this work on node 6 - -## License - -MIT diff --git a/deps/npm/node_modules/stream-shift/index.js b/deps/npm/node_modules/stream-shift/index.js deleted file mode 100644 index c4b18b9c2a5cf8..00000000000000 --- a/deps/npm/node_modules/stream-shift/index.js +++ /dev/null @@ -1,20 +0,0 @@ -module.exports = shift - -function shift (stream) { - var rs = stream._readableState - if (!rs) return null - return rs.objectMode ? stream.read() : stream.read(getStateLength(rs)) -} - -function getStateLength (state) { - if (state.buffer.length) { - // Since node 6.3.0 state.buffer is a BufferList not an array - if (state.buffer.head) { - return state.buffer.head.data.length - } - - return state.buffer[0].length - } - - return state.length -} diff --git a/deps/npm/node_modules/stream-shift/package.json b/deps/npm/node_modules/stream-shift/package.json deleted file mode 100644 index fc472a51598a52..00000000000000 --- a/deps/npm/node_modules/stream-shift/package.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "_from": "stream-shift@^1.0.0", - "_id": "stream-shift@1.0.0", - "_inBundle": false, - "_integrity": "sha1-1cdSgl5TZ+eG944Y5EXqIjoVWVI=", - "_location": "/stream-shift", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "stream-shift@^1.0.0", - "name": "stream-shift", - "escapedName": "stream-shift", - "rawSpec": "^1.0.0", - "saveSpec": null, - "fetchSpec": "^1.0.0" - }, - "_requiredBy": [ - "/duplexify", - "/stream-each", - "/stream-iterate" - ], - "_resolved": "https://registry.npmjs.org/stream-shift/-/stream-shift-1.0.0.tgz", - "_shasum": "d5c752825e5367e786f78e18e445ea223a155952", - "_spec": "stream-shift@^1.0.0", - "_where": "/Users/rebecca/code/npm/node_modules/duplexify", - "author": { - "name": "Mathias Buus", - "url": "@mafintosh" - }, - "bugs": { - "url": "https://github.com/mafintosh/stream-shift/issues" - }, - "bundleDependencies": false, - "dependencies": {}, - "deprecated": false, - "description": "Returns the next buffer/object in a stream's readable queue", - "devDependencies": { - "standard": "^7.1.2", - "tape": "^4.6.0", - "through2": "^2.0.1" - }, - "homepage": "https://github.com/mafintosh/stream-shift", - "license": "MIT", - "main": "index.js", - "name": "stream-shift", - "repository": { - "type": "git", - "url": "git+https://github.com/mafintosh/stream-shift.git" - }, - "scripts": { - "test": "standard && tape test.js" - }, - "version": "1.0.0" -} diff --git a/deps/npm/node_modules/stream-shift/test.js b/deps/npm/node_modules/stream-shift/test.js deleted file mode 100644 index c0222c37d53fe5..00000000000000 --- a/deps/npm/node_modules/stream-shift/test.js +++ /dev/null @@ -1,48 +0,0 @@ -var tape = require('tape') -var through = require('through2') -var stream = require('stream') -var shift = require('./') - -tape('shifts next', function (t) { - var passthrough = through() - - passthrough.write('hello') - passthrough.write('world') - - t.same(shift(passthrough), Buffer('hello')) - t.same(shift(passthrough), Buffer('world')) - t.end() -}) - -tape('shifts next with core', function (t) { - var passthrough = stream.PassThrough() - - passthrough.write('hello') - passthrough.write('world') - - t.same(shift(passthrough), Buffer('hello')) - t.same(shift(passthrough), Buffer('world')) - t.end() -}) - -tape('shifts next with object mode', function (t) { - var passthrough = through({objectMode: true}) - - passthrough.write({hello: 1}) - passthrough.write({world: 1}) - - t.same(shift(passthrough), {hello: 1}) - t.same(shift(passthrough), {world: 1}) - t.end() -}) - -tape('shifts next with object mode with core', function (t) { - var passthrough = stream.PassThrough({objectMode: true}) - - passthrough.write({hello: 1}) - passthrough.write({world: 1}) - - t.same(shift(passthrough), {hello: 1}) - t.same(shift(passthrough), {world: 1}) - t.end() -}) diff --git a/deps/npm/node_modules/strict-uri-encode/index.js b/deps/npm/node_modules/strict-uri-encode/index.js deleted file mode 100644 index affabef0c826ef..00000000000000 --- a/deps/npm/node_modules/strict-uri-encode/index.js +++ /dev/null @@ -1,2 +0,0 @@ -'use strict'; -module.exports = str => encodeURIComponent(str).replace(/[!'()*]/g, x => `%${x.charCodeAt(0).toString(16).toUpperCase()}`); diff --git a/deps/npm/node_modules/strict-uri-encode/license b/deps/npm/node_modules/strict-uri-encode/license deleted file mode 100644 index 0f8cf79c3c93ad..00000000000000 --- a/deps/npm/node_modules/strict-uri-encode/license +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) Kevin Martensson (github.com/kevva) - -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/strict-uri-encode/package.json b/deps/npm/node_modules/strict-uri-encode/package.json deleted file mode 100644 index ddd02a7a305565..00000000000000 --- a/deps/npm/node_modules/strict-uri-encode/package.json +++ /dev/null @@ -1,63 +0,0 @@ -{ - "_from": "strict-uri-encode@^2.0.0", - "_id": "strict-uri-encode@2.0.0", - "_inBundle": false, - "_integrity": "sha1-ucczDHBChi9rFC3CdLvMWGbONUY=", - "_location": "/strict-uri-encode", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "strict-uri-encode@^2.0.0", - "name": "strict-uri-encode", - "escapedName": "strict-uri-encode", - "rawSpec": "^2.0.0", - "saveSpec": null, - "fetchSpec": "^2.0.0" - }, - "_requiredBy": [ - "/query-string" - ], - "_resolved": "https://registry.npmjs.org/strict-uri-encode/-/strict-uri-encode-2.0.0.tgz", - "_shasum": "b9c7330c7042862f6b142dc274bbcc5866ce3546", - "_spec": "strict-uri-encode@^2.0.0", - "_where": "/Users/rebecca/code/npm/node_modules/query-string", - "author": { - "name": "Kevin Mårtensson", - "email": "kevinmartensson@gmail.com", - "url": "github.com/kevva" - }, - "bugs": { - "url": "https://github.com/kevva/strict-uri-encode/issues" - }, - "bundleDependencies": false, - "deprecated": false, - "description": "A stricter URI encode adhering to RFC 3986", - "devDependencies": { - "ava": "*", - "xo": "*" - }, - "engines": { - "node": ">=4" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/kevva/strict-uri-encode#readme", - "keywords": [ - "component", - "encode", - "RFC3986", - "uri" - ], - "license": "MIT", - "name": "strict-uri-encode", - "repository": { - "type": "git", - "url": "git+https://github.com/kevva/strict-uri-encode.git" - }, - "scripts": { - "test": "xo && ava" - }, - "version": "2.0.0" -} diff --git a/deps/npm/node_modules/strict-uri-encode/readme.md b/deps/npm/node_modules/strict-uri-encode/readme.md deleted file mode 100644 index 05e3fee2510964..00000000000000 --- a/deps/npm/node_modules/strict-uri-encode/readme.md +++ /dev/null @@ -1,39 +0,0 @@ -# strict-uri-encode [![Build Status](https://travis-ci.org/kevva/strict-uri-encode.svg?branch=master)](https://travis-ci.org/kevva/strict-uri-encode) - -> A stricter URI encode adhering to [RFC 3986](http://tools.ietf.org/html/rfc3986) - - -## Install - -``` -$ npm install --save strict-uri-encode -``` - - -## Usage - -```js -const strictUriEncode = require('strict-uri-encode'); - -strictUriEncode('unicorn!foobar'); -//=> 'unicorn%21foobar' - -strictUriEncode('unicorn*foobar'); -//=> 'unicorn%2Afoobar' -``` - - -## API - -### strictUriEncode(string) - -#### string - -Type: `string`, `number` - -String to URI encode. - - -## License - -MIT © [Kevin Mårtensson](http://github.com/kevva) diff --git a/deps/npm/node_modules/string-width/node_modules/ansi-regex/package.json b/deps/npm/node_modules/string-width/node_modules/ansi-regex/package.json index d7910419da18a8..e94852fd70b093 100644 --- a/deps/npm/node_modules/string-width/node_modules/ansi-regex/package.json +++ b/deps/npm/node_modules/string-width/node_modules/ansi-regex/package.json @@ -1,49 +1,24 @@ { - "_from": "ansi-regex@^3.0.0", - "_id": "ansi-regex@3.0.0", - "_inBundle": false, - "_integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", - "_location": "/string-width/ansi-regex", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "ansi-regex@^3.0.0", - "name": "ansi-regex", - "escapedName": "ansi-regex", - "rawSpec": "^3.0.0", - "saveSpec": null, - "fetchSpec": "^3.0.0" - }, - "_requiredBy": [ - "/string-width/strip-ansi" - ], - "_resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", - "_shasum": "ed0317c322064f79466c02966bddb605ab37d998", - "_spec": "ansi-regex@^3.0.0", - "_where": "/Users/rebecca/code/npm/node_modules/string-width/node_modules/strip-ansi", + "name": "ansi-regex", + "version": "3.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" }, - "bugs": { - "url": "https://github.com/chalk/ansi-regex/issues" - }, - "bundleDependencies": false, - "deprecated": false, - "description": "Regular expression for matching ANSI escape codes", - "devDependencies": { - "ava": "*", - "xo": "*" - }, "engines": { "node": ">=4" }, + "scripts": { + "test": "xo && ava", + "view-supported": "node fixtures/view-codes.js" + }, "files": [ "index.js" ], - "homepage": "https://github.com/chalk/ansi-regex#readme", "keywords": [ "ansi", "styles", @@ -71,15 +46,8 @@ "find", "pattern" ], - "license": "MIT", - "name": "ansi-regex", - "repository": { - "type": "git", - "url": "git+https://github.com/chalk/ansi-regex.git" - }, - "scripts": { - "test": "xo && ava", - "view-supported": "node fixtures/view-codes.js" - }, - "version": "3.0.0" + "devDependencies": { + "ava": "*", + "xo": "*" + } } diff --git a/deps/npm/node_modules/string-width/node_modules/is-fullwidth-code-point/index.js b/deps/npm/node_modules/string-width/node_modules/is-fullwidth-code-point/index.js deleted file mode 100644 index d506327c3e5576..00000000000000 --- a/deps/npm/node_modules/string-width/node_modules/is-fullwidth-code-point/index.js +++ /dev/null @@ -1,46 +0,0 @@ -'use strict'; -/* eslint-disable yoda */ -module.exports = x => { - if (Number.isNaN(x)) { - return false; - } - - // code points are derived from: - // http://www.unix.org/Public/UNIDATA/EastAsianWidth.txt - if ( - x >= 0x1100 && ( - x <= 0x115f || // Hangul Jamo - x === 0x2329 || // LEFT-POINTING ANGLE BRACKET - x === 0x232a || // RIGHT-POINTING ANGLE BRACKET - // CJK Radicals Supplement .. Enclosed CJK Letters and Months - (0x2e80 <= x && x <= 0x3247 && x !== 0x303f) || - // Enclosed CJK Letters and Months .. CJK Unified Ideographs Extension A - (0x3250 <= x && x <= 0x4dbf) || - // CJK Unified Ideographs .. Yi Radicals - (0x4e00 <= x && x <= 0xa4c6) || - // Hangul Jamo Extended-A - (0xa960 <= x && x <= 0xa97c) || - // Hangul Syllables - (0xac00 <= x && x <= 0xd7a3) || - // CJK Compatibility Ideographs - (0xf900 <= x && x <= 0xfaff) || - // Vertical Forms - (0xfe10 <= x && x <= 0xfe19) || - // CJK Compatibility Forms .. Small Form Variants - (0xfe30 <= x && x <= 0xfe6b) || - // Halfwidth and Fullwidth Forms - (0xff01 <= x && x <= 0xff60) || - (0xffe0 <= x && x <= 0xffe6) || - // Kana Supplement - (0x1b000 <= x && x <= 0x1b001) || - // Enclosed Ideographic Supplement - (0x1f200 <= x && x <= 0x1f251) || - // CJK Unified Ideographs Extension B .. Tertiary Ideographic Plane - (0x20000 <= x && x <= 0x3fffd) - ) - ) { - return true; - } - - return false; -}; diff --git a/deps/npm/node_modules/string-width/node_modules/is-fullwidth-code-point/license b/deps/npm/node_modules/string-width/node_modules/is-fullwidth-code-point/license deleted file mode 100644 index 654d0bfe943437..00000000000000 --- a/deps/npm/node_modules/string-width/node_modules/is-fullwidth-code-point/license +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -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/deps/npm/node_modules/string-width/node_modules/is-fullwidth-code-point/package.json b/deps/npm/node_modules/string-width/node_modules/is-fullwidth-code-point/package.json deleted file mode 100644 index 7704c72b16a60c..00000000000000 --- a/deps/npm/node_modules/string-width/node_modules/is-fullwidth-code-point/package.json +++ /dev/null @@ -1,77 +0,0 @@ -{ - "_from": "is-fullwidth-code-point@^2.0.0", - "_id": "is-fullwidth-code-point@2.0.0", - "_inBundle": false, - "_integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", - "_location": "/string-width/is-fullwidth-code-point", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "is-fullwidth-code-point@^2.0.0", - "name": "is-fullwidth-code-point", - "escapedName": "is-fullwidth-code-point", - "rawSpec": "^2.0.0", - "saveSpec": null, - "fetchSpec": "^2.0.0" - }, - "_requiredBy": [ - "/string-width" - ], - "_resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", - "_shasum": "a3b30a5c4f199183167aaab93beefae3ddfb654f", - "_spec": "is-fullwidth-code-point@^2.0.0", - "_where": "/Users/rebecca/code/npm/node_modules/string-width", - "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": "*", - "xo": "*" - }, - "engines": { - "node": ">=4" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/sindresorhus/is-fullwidth-code-point#readme", - "keywords": [ - "fullwidth", - "full-width", - "full", - "width", - "unicode", - "character", - "char", - "string", - "str", - "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" - }, - "version": "2.0.0", - "xo": { - "esnext": true - } -} diff --git a/deps/npm/node_modules/string-width/node_modules/is-fullwidth-code-point/readme.md b/deps/npm/node_modules/string-width/node_modules/is-fullwidth-code-point/readme.md deleted file mode 100644 index 093b0281b2c46b..00000000000000 --- a/deps/npm/node_modules/string-width/node_modules/is-fullwidth-code-point/readme.md +++ /dev/null @@ -1,39 +0,0 @@ -# is-fullwidth-code-point [![Build Status](https://travis-ci.org/sindresorhus/is-fullwidth-code-point.svg?branch=master)](https://travis-ci.org/sindresorhus/is-fullwidth-code-point) - -> Check if the character represented by a given [Unicode code point](https://en.wikipedia.org/wiki/Code_point) is [fullwidth](https://en.wikipedia.org/wiki/Halfwidth_and_fullwidth_forms) - - -## Install - -``` -$ npm install --save is-fullwidth-code-point -``` - - -## Usage - -```js -const isFullwidthCodePoint = require('is-fullwidth-code-point'); - -isFullwidthCodePoint('谢'.codePointAt()); -//=> true - -isFullwidthCodePoint('a'.codePointAt()); -//=> false -``` - - -## API - -### isFullwidthCodePoint(input) - -#### input - -Type: `number` - -[Code point](https://en.wikipedia.org/wiki/Code_point) of a character. - - -## License - -MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/deps/npm/node_modules/string-width/node_modules/strip-ansi/package.json b/deps/npm/node_modules/string-width/node_modules/strip-ansi/package.json index f85508529670f1..555f1946165015 100644 --- a/deps/npm/node_modules/string-width/node_modules/strip-ansi/package.json +++ b/deps/npm/node_modules/string-width/node_modules/strip-ansi/package.json @@ -1,52 +1,23 @@ { - "_from": "strip-ansi@^4.0.0", - "_id": "strip-ansi@4.0.0", - "_inBundle": false, - "_integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", - "_location": "/string-width/strip-ansi", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "strip-ansi@^4.0.0", - "name": "strip-ansi", - "escapedName": "strip-ansi", - "rawSpec": "^4.0.0", - "saveSpec": null, - "fetchSpec": "^4.0.0" - }, - "_requiredBy": [ - "/string-width" - ], - "_resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", - "_shasum": "a8479022eb1ac368a871389b635262c505ee368f", - "_spec": "strip-ansi@^4.0.0", - "_where": "/Users/rebecca/code/npm/node_modules/string-width", + "name": "strip-ansi", + "version": "4.0.0", + "description": "Strip ANSI escape codes", + "license": "MIT", + "repository": "chalk/strip-ansi", "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": "^3.0.0" - }, - "deprecated": false, - "description": "Strip ANSI escape codes", - "devDependencies": { - "ava": "*", - "xo": "*" - }, "engines": { "node": ">=4" }, + "scripts": { + "test": "xo && ava" + }, "files": [ "index.js" ], - "homepage": "https://github.com/chalk/strip-ansi#readme", "keywords": [ "strip", "trim", @@ -71,14 +42,11 @@ "command-line", "text" ], - "license": "MIT", - "name": "strip-ansi", - "repository": { - "type": "git", - "url": "git+https://github.com/chalk/strip-ansi.git" - }, - "scripts": { - "test": "xo && ava" + "dependencies": { + "ansi-regex": "^3.0.0" }, - "version": "4.0.0" + "devDependencies": { + "ava": "*", + "xo": "*" + } } diff --git a/deps/npm/node_modules/string-width/package.json b/deps/npm/node_modules/string-width/package.json index f4dbbf47455667..89f0b6a6c6027c 100644 --- a/deps/npm/node_modules/string-width/package.json +++ b/deps/npm/node_modules/string-width/package.json @@ -1,94 +1,55 @@ { - "_from": "string-width@^2.0.0", - "_id": "string-width@2.1.1", - "_inBundle": false, - "_integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", - "_location": "/string-width", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "string-width@^2.0.0", - "name": "string-width", - "escapedName": "string-width", - "rawSpec": "^2.0.0", - "saveSpec": null, - "fetchSpec": "^2.0.0" - }, - "_requiredBy": [ - "/ansi-align", - "/boxen", - "/cli-columns", - "/cliui", - "/inquirer", - "/table", - "/widest-line", - "/yargs" - ], - "_resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", - "_shasum": "ab93f27a8dc13d28cac815c462143a6d9012ae9e", - "_spec": "string-width@^2.0.0", - "_where": "/Users/rebecca/code/npm/node_modules/cli-columns", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "bugs": { - "url": "https://github.com/sindresorhus/string-width/issues" - }, - "bundleDependencies": false, - "dependencies": { - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^4.0.0" - }, - "deprecated": false, - "description": "Get the visual width of a string - the number of columns required to display it", - "devDependencies": { - "ava": "*", - "xo": "*" - }, - "engines": { - "node": ">=4" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/sindresorhus/string-width#readme", - "keywords": [ - "string", - "str", - "character", - "char", - "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" - }, - "version": "2.1.1" + "name": "string-width", + "version": "2.1.1", + "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": ">=4" + }, + "scripts": { + "test": "xo && ava" + }, + "files": [ + "index.js" + ], + "keywords": [ + "string", + "str", + "character", + "char", + "unicode", + "width", + "visual", + "column", + "columns", + "fullwidth", + "full-width", + "full", + "ansi", + "escape", + "codes", + "cli", + "command-line", + "terminal", + "console", + "cjk", + "chinese", + "japanese", + "korean", + "fixed-width" + ], + "dependencies": { + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^4.0.0" + }, + "devDependencies": { + "ava": "*", + "xo": "*" + } } diff --git a/deps/npm/node_modules/are-we-there-yet/node_modules/string_decoder/.travis.yml b/deps/npm/node_modules/string_decoder/.travis.yml similarity index 100% rename from deps/npm/node_modules/are-we-there-yet/node_modules/string_decoder/.travis.yml rename to deps/npm/node_modules/string_decoder/.travis.yml diff --git a/deps/npm/node_modules/string_decoder/node_modules/safe-buffer/LICENSE b/deps/npm/node_modules/string_decoder/node_modules/safe-buffer/LICENSE deleted file mode 100644 index 0c068ceecbd48f..00000000000000 --- a/deps/npm/node_modules/string_decoder/node_modules/safe-buffer/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) Feross Aboukhadijeh - -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/string_decoder/node_modules/safe-buffer/README.md b/deps/npm/node_modules/string_decoder/node_modules/safe-buffer/README.md deleted file mode 100644 index 356e3519302cfa..00000000000000 --- a/deps/npm/node_modules/string_decoder/node_modules/safe-buffer/README.md +++ /dev/null @@ -1,586 +0,0 @@ -# safe-buffer [![travis][travis-image]][travis-url] [![npm][npm-image]][npm-url] [![downloads][downloads-image]][downloads-url] [![javascript style guide][standard-image]][standard-url] - -[travis-image]: https://img.shields.io/travis/feross/safe-buffer/master.svg -[travis-url]: https://travis-ci.org/feross/safe-buffer -[npm-image]: https://img.shields.io/npm/v/safe-buffer.svg -[npm-url]: https://npmjs.org/package/safe-buffer -[downloads-image]: https://img.shields.io/npm/dm/safe-buffer.svg -[downloads-url]: https://npmjs.org/package/safe-buffer -[standard-image]: https://img.shields.io/badge/code_style-standard-brightgreen.svg -[standard-url]: https://standardjs.com - -#### Safer Node.js Buffer API - -**Use the new Node.js Buffer APIs (`Buffer.from`, `Buffer.alloc`, -`Buffer.allocUnsafe`, `Buffer.allocUnsafeSlow`) in all versions of Node.js.** - -**Uses the built-in implementation when available.** - -## install - -``` -npm install safe-buffer -``` - -[Get supported safe-buffer with the Tidelift Subscription](https://tidelift.com/subscription/pkg/npm-safe-buffer?utm_source=npm-safe-buffer&utm_medium=referral&utm_campaign=readme) - -## usage - -The goal of this package is to provide a safe replacement for the node.js `Buffer`. - -It's a drop-in replacement for `Buffer`. You can use it by adding one `require` line to -the top of your node.js modules: - -```js -var Buffer = require('safe-buffer').Buffer - -// Existing buffer code will continue to work without issues: - -new Buffer('hey', 'utf8') -new Buffer([1, 2, 3], 'utf8') -new Buffer(obj) -new Buffer(16) // create an uninitialized buffer (potentially unsafe) - -// But you can use these new explicit APIs to make clear what you want: - -Buffer.from('hey', 'utf8') // convert from many types to a Buffer -Buffer.alloc(16) // create a zero-filled buffer (safe) -Buffer.allocUnsafe(16) // create an uninitialized buffer (potentially unsafe) -``` - -## api - -### Class Method: Buffer.from(array) - - -* `array` {Array} - -Allocates a new `Buffer` using an `array` of octets. - -```js -const buf = Buffer.from([0x62,0x75,0x66,0x66,0x65,0x72]); - // creates a new Buffer containing ASCII bytes - // ['b','u','f','f','e','r'] -``` - -A `TypeError` will be thrown if `array` is not an `Array`. - -### Class Method: Buffer.from(arrayBuffer[, byteOffset[, length]]) - - -* `arrayBuffer` {ArrayBuffer} The `.buffer` property of a `TypedArray` or - a `new ArrayBuffer()` -* `byteOffset` {Number} Default: `0` -* `length` {Number} Default: `arrayBuffer.length - byteOffset` - -When passed a reference to the `.buffer` property of a `TypedArray` instance, -the newly created `Buffer` will share the same allocated memory as the -TypedArray. - -```js -const arr = new Uint16Array(2); -arr[0] = 5000; -arr[1] = 4000; - -const buf = Buffer.from(arr.buffer); // shares the memory with arr; - -console.log(buf); - // Prints: - -// changing the TypedArray changes the Buffer also -arr[1] = 6000; - -console.log(buf); - // Prints: -``` - -The optional `byteOffset` and `length` arguments specify a memory range within -the `arrayBuffer` that will be shared by the `Buffer`. - -```js -const ab = new ArrayBuffer(10); -const buf = Buffer.from(ab, 0, 2); -console.log(buf.length); - // Prints: 2 -``` - -A `TypeError` will be thrown if `arrayBuffer` is not an `ArrayBuffer`. - -### Class Method: Buffer.from(buffer) - - -* `buffer` {Buffer} - -Copies the passed `buffer` data onto a new `Buffer` instance. - -```js -const buf1 = Buffer.from('buffer'); -const buf2 = Buffer.from(buf1); - -buf1[0] = 0x61; -console.log(buf1.toString()); - // 'auffer' -console.log(buf2.toString()); - // 'buffer' (copy is not changed) -``` - -A `TypeError` will be thrown if `buffer` is not a `Buffer`. - -### Class Method: Buffer.from(str[, encoding]) - - -* `str` {String} String to encode. -* `encoding` {String} Encoding to use, Default: `'utf8'` - -Creates a new `Buffer` containing the given JavaScript string `str`. If -provided, the `encoding` parameter identifies the character encoding. -If not provided, `encoding` defaults to `'utf8'`. - -```js -const buf1 = Buffer.from('this is a tést'); -console.log(buf1.toString()); - // prints: this is a tést -console.log(buf1.toString('ascii')); - // prints: this is a tC)st - -const buf2 = Buffer.from('7468697320697320612074c3a97374', 'hex'); -console.log(buf2.toString()); - // prints: this is a tést -``` - -A `TypeError` will be thrown if `str` is not a string. - -### Class Method: Buffer.alloc(size[, fill[, encoding]]) - - -* `size` {Number} -* `fill` {Value} Default: `undefined` -* `encoding` {String} Default: `utf8` - -Allocates a new `Buffer` of `size` bytes. If `fill` is `undefined`, the -`Buffer` will be *zero-filled*. - -```js -const buf = Buffer.alloc(5); -console.log(buf); - // -``` - -The `size` must be less than or equal to the value of -`require('buffer').kMaxLength` (on 64-bit architectures, `kMaxLength` is -`(2^31)-1`). Otherwise, a [`RangeError`][] is thrown. A zero-length Buffer will -be created if a `size` less than or equal to 0 is specified. - -If `fill` is specified, the allocated `Buffer` will be initialized by calling -`buf.fill(fill)`. See [`buf.fill()`][] for more information. - -```js -const buf = Buffer.alloc(5, 'a'); -console.log(buf); - // -``` - -If both `fill` and `encoding` are specified, the allocated `Buffer` will be -initialized by calling `buf.fill(fill, encoding)`. For example: - -```js -const buf = Buffer.alloc(11, 'aGVsbG8gd29ybGQ=', 'base64'); -console.log(buf); - // -``` - -Calling `Buffer.alloc(size)` can be significantly slower than the alternative -`Buffer.allocUnsafe(size)` but ensures that the newly created `Buffer` instance -contents will *never contain sensitive data*. - -A `TypeError` will be thrown if `size` is not a number. - -### Class Method: Buffer.allocUnsafe(size) - - -* `size` {Number} - -Allocates a new *non-zero-filled* `Buffer` of `size` bytes. The `size` must -be less than or equal to the value of `require('buffer').kMaxLength` (on 64-bit -architectures, `kMaxLength` is `(2^31)-1`). Otherwise, a [`RangeError`][] is -thrown. A zero-length Buffer will be created if a `size` less than or equal to -0 is specified. - -The underlying memory for `Buffer` instances created in this way is *not -initialized*. The contents of the newly created `Buffer` are unknown and -*may contain sensitive data*. Use [`buf.fill(0)`][] to initialize such -`Buffer` instances to zeroes. - -```js -const buf = Buffer.allocUnsafe(5); -console.log(buf); - // - // (octets will be different, every time) -buf.fill(0); -console.log(buf); - // -``` - -A `TypeError` will be thrown if `size` is not a number. - -Note that the `Buffer` module pre-allocates an internal `Buffer` instance of -size `Buffer.poolSize` that is used as a pool for the fast allocation of new -`Buffer` instances created using `Buffer.allocUnsafe(size)` (and the deprecated -`new Buffer(size)` constructor) only when `size` is less than or equal to -`Buffer.poolSize >> 1` (floor of `Buffer.poolSize` divided by two). The default -value of `Buffer.poolSize` is `8192` but can be modified. - -Use of this pre-allocated internal memory pool is a key difference between -calling `Buffer.alloc(size, fill)` vs. `Buffer.allocUnsafe(size).fill(fill)`. -Specifically, `Buffer.alloc(size, fill)` will *never* use the internal Buffer -pool, while `Buffer.allocUnsafe(size).fill(fill)` *will* use the internal -Buffer pool if `size` is less than or equal to half `Buffer.poolSize`. The -difference is subtle but can be important when an application requires the -additional performance that `Buffer.allocUnsafe(size)` provides. - -### Class Method: Buffer.allocUnsafeSlow(size) - - -* `size` {Number} - -Allocates a new *non-zero-filled* and non-pooled `Buffer` of `size` bytes. The -`size` must be less than or equal to the value of -`require('buffer').kMaxLength` (on 64-bit architectures, `kMaxLength` is -`(2^31)-1`). Otherwise, a [`RangeError`][] is thrown. A zero-length Buffer will -be created if a `size` less than or equal to 0 is specified. - -The underlying memory for `Buffer` instances created in this way is *not -initialized*. The contents of the newly created `Buffer` are unknown and -*may contain sensitive data*. Use [`buf.fill(0)`][] to initialize such -`Buffer` instances to zeroes. - -When using `Buffer.allocUnsafe()` to allocate new `Buffer` instances, -allocations under 4KB are, by default, sliced from a single pre-allocated -`Buffer`. This allows applications to avoid the garbage collection overhead of -creating many individually allocated Buffers. This approach improves both -performance and memory usage by eliminating the need to track and cleanup as -many `Persistent` objects. - -However, in the case where a developer may need to retain a small chunk of -memory from a pool for an indeterminate amount of time, it may be appropriate -to create an un-pooled Buffer instance using `Buffer.allocUnsafeSlow()` then -copy out the relevant bits. - -```js -// need to keep around a few small chunks of memory -const store = []; - -socket.on('readable', () => { - const data = socket.read(); - // allocate for retained data - const sb = Buffer.allocUnsafeSlow(10); - // copy the data into the new allocation - data.copy(sb, 0, 0, 10); - store.push(sb); -}); -``` - -Use of `Buffer.allocUnsafeSlow()` should be used only as a last resort *after* -a developer has observed undue memory retention in their applications. - -A `TypeError` will be thrown if `size` is not a number. - -### All the Rest - -The rest of the `Buffer` API is exactly the same as in node.js. -[See the docs](https://nodejs.org/api/buffer.html). - - -## Related links - -- [Node.js issue: Buffer(number) is unsafe](https://github.com/nodejs/node/issues/4660) -- [Node.js Enhancement Proposal: Buffer.from/Buffer.alloc/Buffer.zalloc/Buffer() soft-deprecate](https://github.com/nodejs/node-eps/pull/4) - -## Why is `Buffer` unsafe? - -Today, the node.js `Buffer` constructor is overloaded to handle many different argument -types like `String`, `Array`, `Object`, `TypedArrayView` (`Uint8Array`, etc.), -`ArrayBuffer`, and also `Number`. - -The API is optimized for convenience: you can throw any type at it, and it will try to do -what you want. - -Because the Buffer constructor is so powerful, you often see code like this: - -```js -// Convert UTF-8 strings to hex -function toHex (str) { - return new Buffer(str).toString('hex') -} -``` - -***But what happens if `toHex` is called with a `Number` argument?*** - -### Remote Memory Disclosure - -If an attacker can make your program call the `Buffer` constructor with a `Number` -argument, then they can make it allocate uninitialized memory from the node.js process. -This could potentially disclose TLS private keys, user data, or database passwords. - -When the `Buffer` constructor is passed a `Number` argument, it returns an -**UNINITIALIZED** block of memory of the specified `size`. When you create a `Buffer` like -this, you **MUST** overwrite the contents before returning it to the user. - -From the [node.js docs](https://nodejs.org/api/buffer.html#buffer_new_buffer_size): - -> `new Buffer(size)` -> -> - `size` Number -> -> The underlying memory for `Buffer` instances created in this way is not initialized. -> **The contents of a newly created `Buffer` are unknown and could contain sensitive -> data.** Use `buf.fill(0)` to initialize a Buffer to zeroes. - -(Emphasis our own.) - -Whenever the programmer intended to create an uninitialized `Buffer` you often see code -like this: - -```js -var buf = new Buffer(16) - -// Immediately overwrite the uninitialized buffer with data from another buffer -for (var i = 0; i < buf.length; i++) { - buf[i] = otherBuf[i] -} -``` - - -### Would this ever be a problem in real code? - -Yes. It's surprisingly common to forget to check the type of your variables in a -dynamically-typed language like JavaScript. - -Usually the consequences of assuming the wrong type is that your program crashes with an -uncaught exception. But the failure mode for forgetting to check the type of arguments to -the `Buffer` constructor is more catastrophic. - -Here's an example of a vulnerable service that takes a JSON payload and converts it to -hex: - -```js -// Take a JSON payload {str: "some string"} and convert it to hex -var server = http.createServer(function (req, res) { - var data = '' - req.setEncoding('utf8') - req.on('data', function (chunk) { - data += chunk - }) - req.on('end', function () { - var body = JSON.parse(data) - res.end(new Buffer(body.str).toString('hex')) - }) -}) - -server.listen(8080) -``` - -In this example, an http client just has to send: - -```json -{ - "str": 1000 -} -``` - -and it will get back 1,000 bytes of uninitialized memory from the server. - -This is a very serious bug. It's similar in severity to the -[the Heartbleed bug](http://heartbleed.com/) that allowed disclosure of OpenSSL process -memory by remote attackers. - - -### Which real-world packages were vulnerable? - -#### [`bittorrent-dht`](https://www.npmjs.com/package/bittorrent-dht) - -[Mathias Buus](https://github.com/mafintosh) and I -([Feross Aboukhadijeh](http://feross.org/)) found this issue in one of our own packages, -[`bittorrent-dht`](https://www.npmjs.com/package/bittorrent-dht). The bug would allow -anyone on the internet to send a series of messages to a user of `bittorrent-dht` and get -them to reveal 20 bytes at a time of uninitialized memory from the node.js process. - -Here's -[the commit](https://github.com/feross/bittorrent-dht/commit/6c7da04025d5633699800a99ec3fbadf70ad35b8) -that fixed it. We released a new fixed version, created a -[Node Security Project disclosure](https://nodesecurity.io/advisories/68), and deprecated all -vulnerable versions on npm so users will get a warning to upgrade to a newer version. - -#### [`ws`](https://www.npmjs.com/package/ws) - -That got us wondering if there were other vulnerable packages. Sure enough, within a short -period of time, we found the same issue in [`ws`](https://www.npmjs.com/package/ws), the -most popular WebSocket implementation in node.js. - -If certain APIs were called with `Number` parameters instead of `String` or `Buffer` as -expected, then uninitialized server memory would be disclosed to the remote peer. - -These were the vulnerable methods: - -```js -socket.send(number) -socket.ping(number) -socket.pong(number) -``` - -Here's a vulnerable socket server with some echo functionality: - -```js -server.on('connection', function (socket) { - socket.on('message', function (message) { - message = JSON.parse(message) - if (message.type === 'echo') { - socket.send(message.data) // send back the user's message - } - }) -}) -``` - -`socket.send(number)` called on the server, will disclose server memory. - -Here's [the release](https://github.com/websockets/ws/releases/tag/1.0.1) where the issue -was fixed, with a more detailed explanation. Props to -[Arnout Kazemier](https://github.com/3rd-Eden) for the quick fix. Here's the -[Node Security Project disclosure](https://nodesecurity.io/advisories/67). - - -### What's the solution? - -It's important that node.js offers a fast way to get memory otherwise performance-critical -applications would needlessly get a lot slower. - -But we need a better way to *signal our intent* as programmers. **When we want -uninitialized memory, we should request it explicitly.** - -Sensitive functionality should not be packed into a developer-friendly API that loosely -accepts many different types. This type of API encourages the lazy practice of passing -variables in without checking the type very carefully. - -#### A new API: `Buffer.allocUnsafe(number)` - -The functionality of creating buffers with uninitialized memory should be part of another -API. We propose `Buffer.allocUnsafe(number)`. This way, it's not part of an API that -frequently gets user input of all sorts of different types passed into it. - -```js -var buf = Buffer.allocUnsafe(16) // careful, uninitialized memory! - -// Immediately overwrite the uninitialized buffer with data from another buffer -for (var i = 0; i < buf.length; i++) { - buf[i] = otherBuf[i] -} -``` - - -### How do we fix node.js core? - -We sent [a PR to node.js core](https://github.com/nodejs/node/pull/4514) (merged as -`semver-major`) which defends against one case: - -```js -var str = 16 -new Buffer(str, 'utf8') -``` - -In this situation, it's implied that the programmer intended the first argument to be a -string, since they passed an encoding as a second argument. Today, node.js will allocate -uninitialized memory in the case of `new Buffer(number, encoding)`, which is probably not -what the programmer intended. - -But this is only a partial solution, since if the programmer does `new Buffer(variable)` -(without an `encoding` parameter) there's no way to know what they intended. If `variable` -is sometimes a number, then uninitialized memory will sometimes be returned. - -### What's the real long-term fix? - -We could deprecate and remove `new Buffer(number)` and use `Buffer.allocUnsafe(number)` when -we need uninitialized memory. But that would break 1000s of packages. - -~~We believe the best solution is to:~~ - -~~1. Change `new Buffer(number)` to return safe, zeroed-out memory~~ - -~~2. Create a new API for creating uninitialized Buffers. We propose: `Buffer.allocUnsafe(number)`~~ - -#### Update - -We now support adding three new APIs: - -- `Buffer.from(value)` - convert from any type to a buffer -- `Buffer.alloc(size)` - create a zero-filled buffer -- `Buffer.allocUnsafe(size)` - create an uninitialized buffer with given size - -This solves the core problem that affected `ws` and `bittorrent-dht` which is -`Buffer(variable)` getting tricked into taking a number argument. - -This way, existing code continues working and the impact on the npm ecosystem will be -minimal. Over time, npm maintainers can migrate performance-critical code to use -`Buffer.allocUnsafe(number)` instead of `new Buffer(number)`. - - -### Conclusion - -We think there's a serious design issue with the `Buffer` API as it exists today. It -promotes insecure software by putting high-risk functionality into a convenient API -with friendly "developer ergonomics". - -This wasn't merely a theoretical exercise because we found the issue in some of the -most popular npm packages. - -Fortunately, there's an easy fix that can be applied today. Use `safe-buffer` in place of -`buffer`. - -```js -var Buffer = require('safe-buffer').Buffer -``` - -Eventually, we hope that node.js core can switch to this new, safer behavior. We believe -the impact on the ecosystem would be minimal since it's not a breaking change. -Well-maintained, popular packages would be updated to use `Buffer.alloc` quickly, while -older, insecure packages would magically become safe from this attack vector. - - -## links - -- [Node.js PR: buffer: throw if both length and enc are passed](https://github.com/nodejs/node/pull/4514) -- [Node Security Project disclosure for `ws`](https://nodesecurity.io/advisories/67) -- [Node Security Project disclosure for`bittorrent-dht`](https://nodesecurity.io/advisories/68) - - -## credit - -The original issues in `bittorrent-dht` -([disclosure](https://nodesecurity.io/advisories/68)) and -`ws` ([disclosure](https://nodesecurity.io/advisories/67)) were discovered by -[Mathias Buus](https://github.com/mafintosh) and -[Feross Aboukhadijeh](http://feross.org/). - -Thanks to [Adam Baldwin](https://github.com/evilpacket) for helping disclose these issues -and for his work running the [Node Security Project](https://nodesecurity.io/). - -Thanks to [John Hiesey](https://github.com/jhiesey) for proofreading this README and -auditing the code. - - -## license - -MIT. Copyright (C) [Feross Aboukhadijeh](http://feross.org) diff --git a/deps/npm/node_modules/string_decoder/node_modules/safe-buffer/index.d.ts b/deps/npm/node_modules/string_decoder/node_modules/safe-buffer/index.d.ts deleted file mode 100644 index e9fed809a5ab51..00000000000000 --- a/deps/npm/node_modules/string_decoder/node_modules/safe-buffer/index.d.ts +++ /dev/null @@ -1,187 +0,0 @@ -declare module "safe-buffer" { - export class Buffer { - length: number - write(string: string, offset?: number, length?: number, encoding?: string): number; - toString(encoding?: string, start?: number, end?: number): string; - toJSON(): { type: 'Buffer', data: any[] }; - equals(otherBuffer: Buffer): boolean; - compare(otherBuffer: Buffer, targetStart?: number, targetEnd?: number, sourceStart?: number, sourceEnd?: number): number; - copy(targetBuffer: Buffer, targetStart?: number, sourceStart?: number, sourceEnd?: number): number; - slice(start?: number, end?: number): Buffer; - writeUIntLE(value: number, offset: number, byteLength: number, noAssert?: boolean): number; - writeUIntBE(value: number, offset: number, byteLength: number, noAssert?: boolean): number; - writeIntLE(value: number, offset: number, byteLength: number, noAssert?: boolean): number; - writeIntBE(value: number, offset: number, byteLength: number, noAssert?: boolean): number; - readUIntLE(offset: number, byteLength: number, noAssert?: boolean): number; - readUIntBE(offset: number, byteLength: number, noAssert?: boolean): number; - readIntLE(offset: number, byteLength: number, noAssert?: boolean): number; - readIntBE(offset: number, byteLength: number, noAssert?: boolean): number; - readUInt8(offset: number, noAssert?: boolean): number; - readUInt16LE(offset: number, noAssert?: boolean): number; - readUInt16BE(offset: number, noAssert?: boolean): number; - readUInt32LE(offset: number, noAssert?: boolean): number; - readUInt32BE(offset: number, noAssert?: boolean): number; - readInt8(offset: number, noAssert?: boolean): number; - readInt16LE(offset: number, noAssert?: boolean): number; - readInt16BE(offset: number, noAssert?: boolean): number; - readInt32LE(offset: number, noAssert?: boolean): number; - readInt32BE(offset: number, noAssert?: boolean): number; - readFloatLE(offset: number, noAssert?: boolean): number; - readFloatBE(offset: number, noAssert?: boolean): number; - readDoubleLE(offset: number, noAssert?: boolean): number; - readDoubleBE(offset: number, noAssert?: boolean): number; - swap16(): Buffer; - swap32(): Buffer; - swap64(): Buffer; - writeUInt8(value: number, offset: number, noAssert?: boolean): number; - writeUInt16LE(value: number, offset: number, noAssert?: boolean): number; - writeUInt16BE(value: number, offset: number, noAssert?: boolean): number; - writeUInt32LE(value: number, offset: number, noAssert?: boolean): number; - writeUInt32BE(value: number, offset: number, noAssert?: boolean): number; - writeInt8(value: number, offset: number, noAssert?: boolean): number; - writeInt16LE(value: number, offset: number, noAssert?: boolean): number; - writeInt16BE(value: number, offset: number, noAssert?: boolean): number; - writeInt32LE(value: number, offset: number, noAssert?: boolean): number; - writeInt32BE(value: number, offset: number, noAssert?: boolean): number; - writeFloatLE(value: number, offset: number, noAssert?: boolean): number; - writeFloatBE(value: number, offset: number, noAssert?: boolean): number; - writeDoubleLE(value: number, offset: number, noAssert?: boolean): number; - writeDoubleBE(value: number, offset: number, noAssert?: boolean): number; - fill(value: any, offset?: number, end?: number): this; - indexOf(value: string | number | Buffer, byteOffset?: number, encoding?: string): number; - lastIndexOf(value: string | number | Buffer, byteOffset?: number, encoding?: string): number; - includes(value: string | number | Buffer, byteOffset?: number, encoding?: string): boolean; - - /** - * Allocates a new buffer containing the given {str}. - * - * @param str String to store in buffer. - * @param encoding encoding to use, optional. Default is 'utf8' - */ - constructor (str: string, encoding?: string); - /** - * Allocates a new buffer of {size} octets. - * - * @param size count of octets to allocate. - */ - constructor (size: number); - /** - * Allocates a new buffer containing the given {array} of octets. - * - * @param array The octets to store. - */ - constructor (array: Uint8Array); - /** - * Produces a Buffer backed by the same allocated memory as - * the given {ArrayBuffer}. - * - * - * @param arrayBuffer The ArrayBuffer with which to share memory. - */ - constructor (arrayBuffer: ArrayBuffer); - /** - * Allocates a new buffer containing the given {array} of octets. - * - * @param array The octets to store. - */ - constructor (array: any[]); - /** - * Copies the passed {buffer} data onto a new {Buffer} instance. - * - * @param buffer The buffer to copy. - */ - constructor (buffer: Buffer); - prototype: Buffer; - /** - * Allocates a new Buffer using an {array} of octets. - * - * @param array - */ - static from(array: any[]): Buffer; - /** - * When passed a reference to the .buffer property of a TypedArray instance, - * the newly created Buffer will share the same allocated memory as the TypedArray. - * The optional {byteOffset} and {length} arguments specify a memory range - * within the {arrayBuffer} that will be shared by the Buffer. - * - * @param arrayBuffer The .buffer property of a TypedArray or a new ArrayBuffer() - * @param byteOffset - * @param length - */ - static from(arrayBuffer: ArrayBuffer, byteOffset?: number, length?: number): Buffer; - /** - * Copies the passed {buffer} data onto a new Buffer instance. - * - * @param buffer - */ - static from(buffer: Buffer): Buffer; - /** - * Creates a new Buffer containing the given JavaScript string {str}. - * If provided, the {encoding} parameter identifies the character encoding. - * If not provided, {encoding} defaults to 'utf8'. - * - * @param str - */ - static from(str: string, encoding?: string): Buffer; - /** - * Returns true if {obj} is a Buffer - * - * @param obj object to test. - */ - static isBuffer(obj: any): obj is Buffer; - /** - * Returns true if {encoding} is a valid encoding argument. - * Valid string encodings in Node 0.12: 'ascii'|'utf8'|'utf16le'|'ucs2'(alias of 'utf16le')|'base64'|'binary'(deprecated)|'hex' - * - * @param encoding string to test. - */ - static isEncoding(encoding: string): boolean; - /** - * Gives the actual byte length of a string. encoding defaults to 'utf8'. - * This is not the same as String.prototype.length since that returns the number of characters in a string. - * - * @param string string to test. - * @param encoding encoding used to evaluate (defaults to 'utf8') - */ - static byteLength(string: string, encoding?: string): number; - /** - * Returns a buffer which is the result of concatenating all the buffers in the list together. - * - * If the list has no items, or if the totalLength is 0, then it returns a zero-length buffer. - * If the list has exactly one item, then the first item of the list is returned. - * If the list has more than one item, then a new Buffer is created. - * - * @param list An array of Buffer objects to concatenate - * @param totalLength Total length of the buffers when concatenated. - * If totalLength is not provided, it is read from the buffers in the list. However, this adds an additional loop to the function, so it is faster to provide the length explicitly. - */ - static concat(list: Buffer[], totalLength?: number): Buffer; - /** - * The same as buf1.compare(buf2). - */ - static compare(buf1: Buffer, buf2: Buffer): number; - /** - * Allocates a new buffer of {size} octets. - * - * @param size count of octets to allocate. - * @param fill if specified, buffer will be initialized by calling buf.fill(fill). - * If parameter is omitted, buffer will be filled with zeros. - * @param encoding encoding used for call to buf.fill while initalizing - */ - static alloc(size: number, fill?: string | Buffer | number, encoding?: string): Buffer; - /** - * Allocates a new buffer of {size} octets, leaving memory not initialized, so the contents - * of the newly created Buffer are unknown and may contain sensitive data. - * - * @param size count of octets to allocate - */ - static allocUnsafe(size: number): Buffer; - /** - * Allocates a new non-pooled buffer of {size} octets, leaving memory not initialized, so the contents - * of the newly created Buffer are unknown and may contain sensitive data. - * - * @param size count of octets to allocate - */ - static allocUnsafeSlow(size: number): Buffer; - } -} \ No newline at end of file diff --git a/deps/npm/node_modules/string_decoder/node_modules/safe-buffer/index.js b/deps/npm/node_modules/string_decoder/node_modules/safe-buffer/index.js deleted file mode 100644 index 054c8d30ddafb4..00000000000000 --- a/deps/npm/node_modules/string_decoder/node_modules/safe-buffer/index.js +++ /dev/null @@ -1,64 +0,0 @@ -/* eslint-disable node/no-deprecated-api */ -var buffer = require('buffer') -var Buffer = buffer.Buffer - -// alternative to using Object.keys for old browsers -function copyProps (src, dst) { - for (var key in src) { - dst[key] = src[key] - } -} -if (Buffer.from && Buffer.alloc && Buffer.allocUnsafe && Buffer.allocUnsafeSlow) { - module.exports = buffer -} else { - // Copy properties from require('buffer') - copyProps(buffer, exports) - exports.Buffer = SafeBuffer -} - -function SafeBuffer (arg, encodingOrOffset, length) { - return Buffer(arg, encodingOrOffset, length) -} - -SafeBuffer.prototype = Object.create(Buffer.prototype) - -// Copy static methods from Buffer -copyProps(Buffer, SafeBuffer) - -SafeBuffer.from = function (arg, encodingOrOffset, length) { - if (typeof arg === 'number') { - throw new TypeError('Argument must not be a number') - } - return Buffer(arg, encodingOrOffset, length) -} - -SafeBuffer.alloc = function (size, fill, encoding) { - if (typeof size !== 'number') { - throw new TypeError('Argument must be a number') - } - var buf = Buffer(size) - if (fill !== undefined) { - if (typeof encoding === 'string') { - buf.fill(fill, encoding) - } else { - buf.fill(fill) - } - } else { - buf.fill(0) - } - return buf -} - -SafeBuffer.allocUnsafe = function (size) { - if (typeof size !== 'number') { - throw new TypeError('Argument must be a number') - } - return Buffer(size) -} - -SafeBuffer.allocUnsafeSlow = function (size) { - if (typeof size !== 'number') { - throw new TypeError('Argument must be a number') - } - return buffer.SlowBuffer(size) -} diff --git a/deps/npm/node_modules/string_decoder/node_modules/safe-buffer/package.json b/deps/npm/node_modules/string_decoder/node_modules/safe-buffer/package.json deleted file mode 100644 index e7f13cb4b47ac4..00000000000000 --- a/deps/npm/node_modules/string_decoder/node_modules/safe-buffer/package.json +++ /dev/null @@ -1,62 +0,0 @@ -{ - "_from": "safe-buffer@~5.2.0", - "_id": "safe-buffer@5.2.0", - "_inBundle": false, - "_integrity": "sha512-fZEwUGbVl7kouZs1jCdMLdt95hdIv0ZeHg6L7qPeciMZhZ+/gdesW4wgTARkrFWEpspjEATAzUGPG8N2jJiwbg==", - "_location": "/string_decoder/safe-buffer", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "safe-buffer@~5.2.0", - "name": "safe-buffer", - "escapedName": "safe-buffer", - "rawSpec": "~5.2.0", - "saveSpec": null, - "fetchSpec": "~5.2.0" - }, - "_requiredBy": [ - "/string_decoder" - ], - "_resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.0.tgz", - "_shasum": "b74daec49b1148f88c64b68d49b1e815c1f2f519", - "_spec": "safe-buffer@~5.2.0", - "_where": "/Users/darcyclarke/Documents/Repos/npm/cli/node_modules/string_decoder", - "author": { - "name": "Feross Aboukhadijeh", - "email": "feross@feross.org", - "url": "http://feross.org" - }, - "bugs": { - "url": "https://github.com/feross/safe-buffer/issues" - }, - "bundleDependencies": false, - "deprecated": false, - "description": "Safer Node.js Buffer API", - "devDependencies": { - "standard": "*", - "tape": "^4.0.0" - }, - "homepage": "https://github.com/feross/safe-buffer", - "keywords": [ - "buffer", - "buffer allocate", - "node security", - "safe", - "safe-buffer", - "security", - "uninitialized" - ], - "license": "MIT", - "main": "index.js", - "name": "safe-buffer", - "repository": { - "type": "git", - "url": "git://github.com/feross/safe-buffer.git" - }, - "scripts": { - "test": "standard && tape test/*.js" - }, - "types": "index.d.ts", - "version": "5.2.0" -} diff --git a/deps/npm/node_modules/string_decoder/package.json b/deps/npm/node_modules/string_decoder/package.json index cc843b66014507..518c3eb9fb1ffb 100644 --- a/deps/npm/node_modules/string_decoder/package.json +++ b/deps/npm/node_modules/string_decoder/package.json @@ -1,45 +1,25 @@ { - "_from": "string_decoder@^1.1.1", - "_id": "string_decoder@1.3.0", - "_inBundle": false, - "_integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", - "_location": "/string_decoder", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "string_decoder@^1.1.1", - "name": "string_decoder", - "escapedName": "string_decoder", - "rawSpec": "^1.1.1", - "saveSpec": null, - "fetchSpec": "^1.1.1" - }, - "_requiredBy": [ - "/readable-stream" - ], - "_resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", - "_shasum": "42f114594a46cf1a8e30b0a84f56c78c3edac21e", - "_spec": "string_decoder@^1.1.1", - "_where": "/Users/darcyclarke/Documents/Repos/npm/cli/node_modules/readable-stream", - "bugs": { - "url": "https://github.com/nodejs/string_decoder/issues" - }, - "bundleDependencies": false, + "name": "string_decoder", + "version": "1.1.1", + "description": "The string_decoder module from Node core", + "main": "lib/string_decoder.js", "dependencies": { - "safe-buffer": "~5.2.0" + "safe-buffer": "~5.1.0" }, - "deprecated": false, - "description": "The string_decoder module from Node core", "devDependencies": { "babel-polyfill": "^6.23.0", "core-util-is": "^1.0.2", "inherits": "^2.0.3", "tap": "~0.4.8" }, - "files": [ - "lib" - ], + "scripts": { + "test": "tap test/parallel/*.js && node test/verify-dependencies", + "ci": "tap test/parallel/*.js test/ours/*.js --tap | tee test.tap && node test/verify-dependencies.js" + }, + "repository": { + "type": "git", + "url": "git://github.com/nodejs/string_decoder.git" + }, "homepage": "https://github.com/nodejs/string_decoder", "keywords": [ "string", @@ -47,16 +27,5 @@ "browser", "browserify" ], - "license": "MIT", - "main": "lib/string_decoder.js", - "name": "string_decoder", - "repository": { - "type": "git", - "url": "git://github.com/nodejs/string_decoder.git" - }, - "scripts": { - "ci": "tap test/parallel/*.js test/ours/*.js --tap | tee test.tap && node test/verify-dependencies.js", - "test": "tap test/parallel/*.js && node test/verify-dependencies" - }, - "version": "1.3.0" + "license": "MIT" } diff --git a/deps/npm/node_modules/stringify-package/package.json b/deps/npm/node_modules/stringify-package/package.json index a3f011da5d8f04..c0e5622b475628 100644 --- a/deps/npm/node_modules/stringify-package/package.json +++ b/deps/npm/node_modules/stringify-package/package.json @@ -1,68 +1,38 @@ { - "_from": "stringify-package@1.0.1", - "_id": "stringify-package@1.0.1", - "_inBundle": false, - "_integrity": "sha512-sa4DUQsYciMP1xhKWGuFM04fB0LG/9DlluZoSVywUMRNvzid6XucHK0/90xGxRoHrAaROrcHK1aPKaijCtSrhg==", - "_location": "/stringify-package", - "_phantomChildren": {}, - "_requested": { - "type": "version", - "registry": true, - "raw": "stringify-package@1.0.1", - "name": "stringify-package", - "escapedName": "stringify-package", - "rawSpec": "1.0.1", - "saveSpec": null, - "fetchSpec": "1.0.1" - }, - "_requiredBy": [ - "#USER", - "/", - "/libnpm" - ], - "_resolved": "https://registry.npmjs.org/stringify-package/-/stringify-package-1.0.1.tgz", - "_shasum": "e5aa3643e7f74d0f28628b72f3dad5cecfc3ba85", - "_spec": "stringify-package@1.0.1", - "_where": "/Users/isaacs/dev/npm/cli", - "author": { - "name": "Kat Marchán", - "email": "kzm@zkat.tech" - }, - "bugs": { - "url": "https://github.com/npm/stringify-package/issues" - }, - "bundleDependencies": false, - "deprecated": false, + "name": "stringify-package", + "version": "1.0.1", "description": "stringifies npm-written json files", - "devDependencies": { - "standard": "11", - "standard-version": "4", - "tap": "12" - }, + "main": "index.js", "files": [ "index.js" ], - "homepage": "https://github.com/npm/stringify-package", + "repository": { + "type": "git", + "url": "git+https://github.com/npm/stringify-package.git" + }, "keywords": [ "npm", "json", "stringify", "package.json" ], + "author": "Kat Marchán ", "license": "ISC", - "main": "index.js", - "name": "stringify-package", - "repository": { - "type": "git", - "url": "git+https://github.com/npm/stringify-package.git" + "bugs": { + "url": "https://github.com/npm/stringify-package/issues" }, + "homepage": "https://github.com/npm/stringify-package", "scripts": { - "postpublish": "git push --follow-tags", - "postrelease": "npm publish", "prerelease": "npm t", - "pretest": "standard", "release": "standard-version -s", + "postrelease": "npm publish", + "postpublish": "git push --follow-tags", + "pretest": "standard", "test": "tap -J --coverage --100 test/*.js" }, - "version": "1.0.1" + "devDependencies": { + "standard": "11", + "standard-version": "4", + "tap": "12" + } } diff --git a/deps/npm/node_modules/strip-ansi/package.json b/deps/npm/node_modules/strip-ansi/package.json index 659626834d847e..301685ba329f5b 100644 --- a/deps/npm/node_modules/strip-ansi/package.json +++ b/deps/npm/node_modules/strip-ansi/package.json @@ -1,63 +1,28 @@ { - "_from": "strip-ansi@3.0.1", - "_id": "strip-ansi@3.0.1", - "_inBundle": false, - "_integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", - "_location": "/strip-ansi", - "_phantomChildren": {}, - "_requested": { - "type": "version", - "registry": true, - "raw": "strip-ansi@3.0.1", - "name": "strip-ansi", - "escapedName": "strip-ansi", - "rawSpec": "3.0.1", - "saveSpec": null, - "fetchSpec": "3.0.1" - }, - "_requiredBy": [ - "#USER", - "/", - "/babel-code-frame/chalk", - "/cli-columns", - "/cli-table2/string-width", - "/columnify", - "/gauge", - "/gauge/string-width", - "/unicode-length", - "/wide-align/string-width", - "/wrap-ansi", - "/wrap-ansi/string-width" - ], - "_resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", - "_shasum": "6a385fb8853d952d5ff05d0e8aaf94278dc63dcf", - "_spec": "strip-ansi@3.0.1", - "_where": "/Users/rebecca/code/npm", + "name": "strip-ansi", + "version": "3.0.1", + "description": "Strip ANSI escape codes", + "license": "MIT", + "repository": "chalk/strip-ansi", "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": "^2.0.0" - }, - "deprecated": false, - "description": "Strip ANSI escape codes", - "devDependencies": { - "ava": "*", - "xo": "*" - }, + "maintainers": [ + "Sindre Sorhus (sindresorhus.com)", + "Joshua Boy Nicolai Appelman (jbna.nl)", + "JD Ballard (github.com/qix-)" + ], "engines": { "node": ">=0.10.0" }, + "scripts": { + "test": "xo && ava" + }, "files": [ "index.js" ], - "homepage": "https://github.com/chalk/strip-ansi#readme", "keywords": [ "strip", "trim", @@ -82,31 +47,11 @@ "command-line", "text" ], - "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": "JD Ballard", - "email": "i.am.qix@gmail.com", - "url": "github.com/qix-" - } - ], - "name": "strip-ansi", - "repository": { - "type": "git", - "url": "git+https://github.com/chalk/strip-ansi.git" - }, - "scripts": { - "test": "xo && ava" + "dependencies": { + "ansi-regex": "^2.0.0" }, - "version": "3.0.1" + "devDependencies": { + "ava": "*", + "xo": "*" + } } diff --git a/deps/npm/node_modules/strip-eof/index.js b/deps/npm/node_modules/strip-eof/index.js deleted file mode 100644 index a17d0afd33fee8..00000000000000 --- a/deps/npm/node_modules/strip-eof/index.js +++ /dev/null @@ -1,15 +0,0 @@ -'use strict'; -module.exports = function (x) { - var lf = typeof x === 'string' ? '\n' : '\n'.charCodeAt(); - var cr = typeof x === 'string' ? '\r' : '\r'.charCodeAt(); - - if (x[x.length - 1] === lf) { - x = x.slice(0, x.length - 1); - } - - if (x[x.length - 1] === cr) { - x = x.slice(0, x.length - 1); - } - - return x; -}; diff --git a/deps/npm/node_modules/strip-eof/license b/deps/npm/node_modules/strip-eof/license deleted file mode 100644 index 654d0bfe943437..00000000000000 --- a/deps/npm/node_modules/strip-eof/license +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -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/deps/npm/node_modules/strip-eof/package.json b/deps/npm/node_modules/strip-eof/package.json deleted file mode 100644 index db7166bbe09fef..00000000000000 --- a/deps/npm/node_modules/strip-eof/package.json +++ /dev/null @@ -1,71 +0,0 @@ -{ - "_from": "strip-eof@^1.0.0", - "_id": "strip-eof@1.0.0", - "_inBundle": false, - "_integrity": "sha1-u0P/VZim6wXYm1n80SnJgzE2Br8=", - "_location": "/strip-eof", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "strip-eof@^1.0.0", - "name": "strip-eof", - "escapedName": "strip-eof", - "rawSpec": "^1.0.0", - "saveSpec": null, - "fetchSpec": "^1.0.0" - }, - "_requiredBy": [ - "/execa" - ], - "_resolved": "https://registry.npmjs.org/strip-eof/-/strip-eof-1.0.0.tgz", - "_shasum": "bb43ff5598a6eb05d89b59fcd129c983313606bf", - "_spec": "strip-eof@^1.0.0", - "_where": "/Users/rebecca/code/npm/node_modules/execa", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "bugs": { - "url": "https://github.com/sindresorhus/strip-eof/issues" - }, - "bundleDependencies": false, - "deprecated": false, - "description": "Strip the End-Of-File (EOF) character from a string/buffer", - "devDependencies": { - "ava": "*", - "xo": "*" - }, - "engines": { - "node": ">=0.10.0" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/sindresorhus/strip-eof#readme", - "keywords": [ - "strip", - "trim", - "remove", - "delete", - "eof", - "end", - "file", - "newline", - "linebreak", - "character", - "string", - "buffer" - ], - "license": "MIT", - "name": "strip-eof", - "repository": { - "type": "git", - "url": "git+https://github.com/sindresorhus/strip-eof.git" - }, - "scripts": { - "test": "xo && ava" - }, - "version": "1.0.0" -} diff --git a/deps/npm/node_modules/strip-eof/readme.md b/deps/npm/node_modules/strip-eof/readme.md deleted file mode 100644 index 45ffe04362c268..00000000000000 --- a/deps/npm/node_modules/strip-eof/readme.md +++ /dev/null @@ -1,28 +0,0 @@ -# strip-eof [![Build Status](https://travis-ci.org/sindresorhus/strip-eof.svg?branch=master)](https://travis-ci.org/sindresorhus/strip-eof) - -> Strip the [End-Of-File](https://en.wikipedia.org/wiki/End-of-file) (EOF) character from a string/buffer - - -## Install - -``` -$ npm install --save strip-eof -``` - - -## Usage - -```js -const stripEof = require('strip-eof'); - -stripEof('foo\nbar\n\n'); -//=> 'foo\nbar\n' - -stripEof(new Buffer('foo\nbar\n\n')).toString(); -//=> 'foo\nbar\n' -``` - - -## License - -MIT © [Sindre Sorhus](http://sindresorhus.com) diff --git a/deps/npm/node_modules/strip-json-comments/index.js b/deps/npm/node_modules/strip-json-comments/index.js deleted file mode 100644 index 4e6576e6d3c388..00000000000000 --- a/deps/npm/node_modules/strip-json-comments/index.js +++ /dev/null @@ -1,70 +0,0 @@ -'use strict'; -var singleComment = 1; -var multiComment = 2; - -function stripWithoutWhitespace() { - return ''; -} - -function stripWithWhitespace(str, start, end) { - return str.slice(start, end).replace(/\S/g, ' '); -} - -module.exports = function (str, opts) { - opts = opts || {}; - - var currentChar; - var nextChar; - var insideString = false; - var insideComment = false; - var offset = 0; - var ret = ''; - var strip = opts.whitespace === false ? stripWithoutWhitespace : stripWithWhitespace; - - for (var i = 0; i < str.length; i++) { - currentChar = str[i]; - nextChar = str[i + 1]; - - if (!insideComment && currentChar === '"') { - var escaped = str[i - 1] === '\\' && str[i - 2] !== '\\'; - if (!escaped) { - insideString = !insideString; - } - } - - if (insideString) { - continue; - } - - if (!insideComment && currentChar + nextChar === '//') { - ret += str.slice(offset, i); - offset = i; - insideComment = singleComment; - i++; - } else if (insideComment === singleComment && currentChar + nextChar === '\r\n') { - i++; - insideComment = false; - ret += strip(str, offset, i); - offset = i; - continue; - } else if (insideComment === singleComment && currentChar === '\n') { - insideComment = false; - ret += strip(str, offset, i); - offset = i; - } else if (!insideComment && currentChar + nextChar === '/*') { - ret += str.slice(offset, i); - offset = i; - insideComment = multiComment; - i++; - continue; - } else if (insideComment === multiComment && currentChar + nextChar === '*/') { - i++; - insideComment = false; - ret += strip(str, offset, i + 1); - offset = i + 1; - continue; - } - } - - return ret + (insideComment ? strip(str.substr(offset)) : str.substr(offset)); -}; diff --git a/deps/npm/node_modules/strip-json-comments/license b/deps/npm/node_modules/strip-json-comments/license deleted file mode 100644 index 654d0bfe943437..00000000000000 --- a/deps/npm/node_modules/strip-json-comments/license +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -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/deps/npm/node_modules/strip-json-comments/package.json b/deps/npm/node_modules/strip-json-comments/package.json deleted file mode 100644 index f974733358eaeb..00000000000000 --- a/deps/npm/node_modules/strip-json-comments/package.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "_from": "strip-json-comments@~2.0.1", - "_id": "strip-json-comments@2.0.1", - "_inBundle": false, - "_integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=", - "_location": "/strip-json-comments", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "strip-json-comments@~2.0.1", - "name": "strip-json-comments", - "escapedName": "strip-json-comments", - "rawSpec": "~2.0.1", - "saveSpec": null, - "fetchSpec": "~2.0.1" - }, - "_requiredBy": [ - "/eslint", - "/rc" - ], - "_resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", - "_shasum": "3c531942e908c2697c0ec344858c286c7ca0a60a", - "_spec": "strip-json-comments@~2.0.1", - "_where": "/Users/rebecca/code/npm/node_modules/rc", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "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": "*", - "xo": "*" - }, - "engines": { - "node": ">=0.10.0" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/sindresorhus/strip-json-comments#readme", - "keywords": [ - "json", - "strip", - "remove", - "delete", - "trim", - "comments", - "multiline", - "parse", - "config", - "configuration", - "conf", - "settings", - "util", - "env", - "environment" - ], - "license": "MIT", - "name": "strip-json-comments", - "repository": { - "type": "git", - "url": "git+https://github.com/sindresorhus/strip-json-comments.git" - }, - "scripts": { - "test": "xo && ava" - }, - "version": "2.0.1" -} diff --git a/deps/npm/node_modules/strip-json-comments/readme.md b/deps/npm/node_modules/strip-json-comments/readme.md deleted file mode 100644 index 0ee58dfe3a2e9b..00000000000000 --- a/deps/npm/node_modules/strip-json-comments/readme.md +++ /dev/null @@ -1,64 +0,0 @@ -# strip-json-comments [![Build Status](https://travis-ci.org/sindresorhus/strip-json-comments.svg?branch=master)](https://travis-ci.org/sindresorhus/strip-json-comments) - -> Strip comments from JSON. Lets you use comments in your JSON files! - -This is now possible: - -```js -{ - // rainbows - "unicorn": /* ❤ */ "cake" -} -``` - -It will replace single-line comments `//` and multi-line comments `/**/` with whitespace. This allows JSON error positions to remain as close as possible to the original source. - -Also available as a [gulp](https://github.com/sindresorhus/gulp-strip-json-comments)/[grunt](https://github.com/sindresorhus/grunt-strip-json-comments)/[broccoli](https://github.com/sindresorhus/broccoli-strip-json-comments) plugin. - - -## Install - -``` -$ npm install --save strip-json-comments -``` - - -## Usage - -```js -const json = '{/*rainbows*/"unicorn":"cake"}'; - -JSON.parse(stripJsonComments(json)); -//=> {unicorn: 'cake'} -``` - - -## API - -### stripJsonComments(input, [options]) - -#### input - -Type: `string` - -Accepts a string with JSON and returns a string without comments. - -#### options - -##### whitespace - -Type: `boolean` -Default: `true` - -Replace comments with whitespace instead of stripping them entirely. - - -## Related - -- [strip-json-comments-cli](https://github.com/sindresorhus/strip-json-comments-cli) - CLI for this module -- [strip-css-comments](https://github.com/sindresorhus/strip-css-comments) - Strip comments from CSS - - -## License - -MIT © [Sindre Sorhus](http://sindresorhus.com) diff --git a/deps/npm/node_modules/supports-color/index.js b/deps/npm/node_modules/supports-color/index.js index 62d14de41a8d15..6fada390fb88d8 100644 --- a/deps/npm/node_modules/supports-color/index.js +++ b/deps/npm/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; } @@ -104,7 +112,7 @@ function supportsColor(stream) { return 2; } - if (/^screen|^xterm|^vt100|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) { + if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) { 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/deps/npm/node_modules/supports-color/package.json b/deps/npm/node_modules/supports-color/package.json index bd223c7904d433..f7182edcea2baa 100644 --- a/deps/npm/node_modules/supports-color/package.json +++ b/deps/npm/node_modules/supports-color/package.json @@ -1,85 +1,53 @@ { - "_from": "supports-color@^5.3.0", - "_id": "supports-color@5.4.0", - "_inBundle": false, - "_integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==", - "_location": "/supports-color", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "supports-color@^5.3.0", - "name": "supports-color", - "escapedName": "supports-color", - "rawSpec": "^5.3.0", - "saveSpec": null, - "fetchSpec": "^5.3.0" - }, - "_requiredBy": [ - "/chalk" - ], - "_resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.4.0.tgz", - "_shasum": "1c6b337402c2137605efe19f10fec390f6faab54", - "_spec": "supports-color@^5.3.0", - "_where": "/Users/rebecca/code/npm/node_modules/chalk", - "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": "*", - "import-fresh": "^2.0.0", - "xo": "*" - }, - "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.4.0" + "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" } diff --git a/deps/npm/node_modules/supports-color/readme.md b/deps/npm/node_modules/supports-color/readme.md index f6e40195730ae8..36542285863330 100644 --- a/deps/npm/node_modules/supports-color/readme.md +++ b/deps/npm/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/deps/npm/node_modules/tar/CHANGELOG.md b/deps/npm/node_modules/tar/CHANGELOG.md new file mode 100644 index 00000000000000..9373401b3f4648 --- /dev/null +++ b/deps/npm/node_modules/tar/CHANGELOG.md @@ -0,0 +1,68 @@ +# Changelog + +## 6.0 + +- Drop support for node 6 and 8 +- fix symlinks and hardlinks on windows being packed with `\`-style path + targets + +## 5.0 + +- Address unpack race conditions using path reservations +- Change large-numbers errors from TypeError to Error +- Add `TAR_*` error codes +- Raise `TAR_BAD_ARCHIVE` warning/error when there are no valid entries + found in an archive +- do not treat ignored entries as an invalid archive +- drop support for node v4 +- unpack: conditionally use a file mapping to write files on Windows +- Set more portable 'mode' value in portable mode +- Set `portable` gzip option in portable mode + +## 4.4 + +- Add 'mtime' option to tar creation to force mtime +- unpack: only reuse file fs entries if nlink = 1 +- unpack: rename before unlinking files on Windows +- Fix encoding/decoding of base-256 numbers +- Use `stat` instead of `lstat` when checking CWD +- Always provide a callback to fs.close() + +## 4.3 + +- Add 'transform' unpack option + +## 4.2 + +- Fail when zlib fails + +## 4.1 + +- Add noMtime flag for tar creation + +## 4.0 + +- unpack: raise error if cwd is missing or not a dir +- pack: don't drop dots from dotfiles when prefixing + +## 3.1 + +- Support `@file.tar` as an entry argument to copy entries from one tar + file to another. +- Add `noPax` option +- `noResume` option for tar.t +- win32: convert `>| 'w' + : size => size < fMapLimit ? fMapFlag : 'w' diff --git a/deps/npm/node_modules/tar/lib/header.js b/deps/npm/node_modules/tar/lib/header.js index d29c3b9906ff25..5d88f6cf8268f6 100644 --- a/deps/npm/node_modules/tar/lib/header.js +++ b/deps/npm/node_modules/tar/lib/header.js @@ -4,7 +4,6 @@ // the data could not be faithfully encoded in a simple header. // (Also, check header.needPax to see if it needs a pax header.) -const Buffer = require('./buffer.js') const types = require('./types.js') const pathModule = require('path').posix const large = require('./large-numbers.js') diff --git a/deps/npm/node_modules/tar/lib/large-numbers.js b/deps/npm/node_modules/tar/lib/large-numbers.js index 3e5c99255a494a..ad30bc350b3260 100644 --- a/deps/npm/node_modules/tar/lib/large-numbers.js +++ b/deps/npm/node_modules/tar/lib/large-numbers.js @@ -6,7 +6,7 @@ const encode = exports.encode = (num, buf) => { if (!Number.isSafeInteger(num)) // The number is so large that javascript cannot represent it with integer // precision. - throw TypeError('cannot encode number outside of javascript safe integer range') + throw Error('cannot encode number outside of javascript safe integer range') else if (num < 0) encodeNegative(num, buf) else @@ -50,12 +50,12 @@ const parse = exports.parse = (buf) => { else if (pre === 0xff) value = twos(buf) else - throw TypeError('invalid base256 encoding') + throw Error('invalid base256 encoding') if (!Number.isSafeInteger(value)) // The number is so large that javascript cannot represent it with integer // precision. - throw TypeError('parsed number outside of javascript safe integer range') + throw Error('parsed number outside of javascript safe integer range') return value } diff --git a/deps/npm/node_modules/tar/lib/list.js b/deps/npm/node_modules/tar/lib/list.js index 250ebe00175cfb..9da3f812c38cab 100644 --- a/deps/npm/node_modules/tar/lib/list.js +++ b/deps/npm/node_modules/tar/lib/list.js @@ -1,7 +1,5 @@ 'use strict' -const Buffer = require('./buffer.js') - // XXX: This shares a lot in common with extract.js // maybe some DRY opportunity here? diff --git a/deps/npm/node_modules/tar/lib/mkdir.js b/deps/npm/node_modules/tar/lib/mkdir.js index c6a154c24fe600..381d0e1b3df7ff 100644 --- a/deps/npm/node_modules/tar/lib/mkdir.js +++ b/deps/npm/node_modules/tar/lib/mkdir.js @@ -76,7 +76,7 @@ const mkdir = module.exports = (dir, opt, cb) => { }) if (preserve) - return mkdirp(dir, mode, done) + return mkdirp(dir, {mode}).then(made => done(null, made), done) const sub = path.relative(cwd, dir) const parts = sub.split(/\/|\\/) diff --git a/deps/npm/node_modules/tar/lib/mode-fix.js b/deps/npm/node_modules/tar/lib/mode-fix.js index 3363a3b151351a..c3758741c45a9a 100644 --- a/deps/npm/node_modules/tar/lib/mode-fix.js +++ b/deps/npm/node_modules/tar/lib/mode-fix.js @@ -1,6 +1,16 @@ 'use strict' -module.exports = (mode, isDir) => { +module.exports = (mode, isDir, portable) => { mode &= 0o7777 + + // in portable mode, use the minimum reasonable umask + // if this system creates files with 0o664 by default + // (as some linux distros do), then we'll write the + // archive with 0o644 instead. Also, don't ever create + // a file that is not readable/writable by the owner. + if (portable) { + mode = (mode | 0o600) &~0o22 + } + // if dirs are readable, then they should be listable if (isDir) { if (mode & 0o400) diff --git a/deps/npm/node_modules/tar/lib/pack.js b/deps/npm/node_modules/tar/lib/pack.js index 857cea9105a4b6..0fca4ae2573ac5 100644 --- a/deps/npm/node_modules/tar/lib/pack.js +++ b/deps/npm/node_modules/tar/lib/pack.js @@ -1,7 +1,5 @@ 'use strict' -const Buffer = require('./buffer.js') - // A readable tar stream creator // Technically, this is a transform stream that you write paths into, // and tar format comes out of. @@ -62,6 +60,7 @@ const Pack = warner(class Pack extends MiniPass { super(opt) opt = opt || Object.create(null) this.opt = opt + this.file = opt.file || '' this.cwd = opt.cwd || process.cwd() this.maxReadSize = opt.maxReadSize this.preservePaths = !!opt.preservePaths @@ -76,10 +75,13 @@ const Pack = warner(class Pack extends MiniPass { if (typeof opt.onwarn === 'function') this.on('warn', opt.onwarn) + this.portable = !!opt.portable this.zip = null if (opt.gzip) { if (typeof opt.gzip !== 'object') opt.gzip = {} + if (this.portable) + opt.gzip.portable = true this.zip = new zlib.Gzip(opt.gzip) this.zip.on('data', chunk => super.write(chunk)) this.zip.on('end', _ => super.end()) @@ -88,7 +90,6 @@ const Pack = warner(class Pack extends MiniPass { } else this.on('drain', this[ONDRAIN]) - this.portable = !!opt.portable this.noDirRecurse = !!opt.noDirRecurse this.follow = !!opt.follow this.noMtime = !!opt.noMtime @@ -285,9 +286,7 @@ const Pack = warner(class Pack extends MiniPass { [ENTRYOPT] (job) { return { - onwarn: (msg, data) => { - this.warn(msg, data) - }, + onwarn: (code, msg, data) => this.warn(code, msg, data), noPax: this.noPax, cwd: this.cwd, absolute: job.absolute, diff --git a/deps/npm/node_modules/tar/lib/parse.js b/deps/npm/node_modules/tar/lib/parse.js index 43d4383ddaf890..d9a49ad1ff96ed 100644 --- a/deps/npm/node_modules/tar/lib/parse.js +++ b/deps/npm/node_modules/tar/lib/parse.js @@ -29,7 +29,6 @@ const maxMetaEntrySize = 1024 * 1024 const Entry = require('./read-entry.js') const Pax = require('./pax.js') const zlib = require('minizlib') -const Buffer = require('./buffer.js') const gzipHeader = Buffer.from([0x1f, 0x8b]) const STATE = Symbol('state') @@ -58,6 +57,9 @@ const MAYBEEND = Symbol('maybeEnd') const WRITING = Symbol('writing') const ABORTED = Symbol('aborted') const DONE = Symbol('onDone') +const SAW_VALID_ENTRY = Symbol('sawValidEntry') +const SAW_NULL_BLOCK = Symbol('sawNullBlock') +const SAW_EOF = Symbol('sawEOF') const noop = _ => true @@ -66,6 +68,21 @@ module.exports = warner(class Parser extends EE { opt = opt || {} super(opt) + this.file = opt.file || '' + + // set to boolean false when an entry starts. 1024 bytes of \0 + // is technically a valid tarball, albeit a boring one. + this[SAW_VALID_ENTRY] = null + + // these BADARCHIVE errors can't be detected early. listen on DONE. + this.on(DONE, _ => { + if (this[STATE] === 'begin' || this[SAW_VALID_ENTRY] === false) { + // either less than 1 block of data, or all entries were invalid. + // Either way, probably not even a tarball. + this.warn('TAR_BAD_ARCHIVE', 'Unrecognized archive format') + } + }) + if (opt.ondone) this.on(DONE, opt.ondone) else @@ -95,6 +112,8 @@ module.exports = warner(class Parser extends EE { this[ENDED] = false this[UNZIP] = null this[ABORTED] = false + this[SAW_NULL_BLOCK] = false + this[SAW_EOF] = false if (typeof opt.onwarn === 'function') this.on('warn', opt.onwarn) if (typeof opt.onentry === 'function') @@ -102,58 +121,90 @@ module.exports = warner(class Parser extends EE { } [CONSUMEHEADER] (chunk, position) { + if (this[SAW_VALID_ENTRY] === null) + this[SAW_VALID_ENTRY] = false let header try { header = new Header(chunk, position, this[EX], this[GEX]) } catch (er) { - return this.warn('invalid entry', er) + return this.warn('TAR_ENTRY_INVALID', er) } - if (header.nullBlock) - this[EMIT]('nullBlock') - else if (!header.cksumValid) - this.warn('invalid entry', header) - else if (!header.path) - this.warn('invalid: path is required', header) - else { - const type = header.type - if (/^(Symbolic)?Link$/.test(type) && !header.linkpath) - this.warn('invalid: linkpath required', header) - else if (!/^(Symbolic)?Link$/.test(type) && header.linkpath) - this.warn('invalid: linkpath forbidden', header) + if (header.nullBlock) { + if (this[SAW_NULL_BLOCK]) { + this[SAW_EOF] = true + // ending an archive with no entries. pointless, but legal. + if (this[STATE] === 'begin') + this[STATE] = 'header' + this[EMIT]('eof') + } else { + this[SAW_NULL_BLOCK] = true + this[EMIT]('nullBlock') + } + } else { + this[SAW_NULL_BLOCK] = false + if (!header.cksumValid) + this.warn('TAR_ENTRY_INVALID', 'checksum failure', {header}) + else if (!header.path) + this.warn('TAR_ENTRY_INVALID', 'path is required', {header}) else { - const entry = this[WRITEENTRY] = new Entry(header, this[EX], this[GEX]) - - if (entry.meta) { - if (entry.size > this.maxMetaEntrySize) { - entry.ignore = true - this[EMIT]('ignoredEntry', entry) - this[STATE] = 'ignore' - } else if (entry.size > 0) { - this[META] = '' - entry.on('data', c => this[META] += c) - this[STATE] = 'meta' + const type = header.type + if (/^(Symbolic)?Link$/.test(type) && !header.linkpath) + this.warn('TAR_ENTRY_INVALID', 'linkpath required', {header}) + else if (!/^(Symbolic)?Link$/.test(type) && header.linkpath) + this.warn('TAR_ENTRY_INVALID', 'linkpath forbidden', {header}) + else { + const entry = this[WRITEENTRY] = new Entry(header, this[EX], this[GEX]) + + // we do this for meta & ignored entries as well, because they + // are still valid tar, or else we wouldn't know to ignore them + if (!this[SAW_VALID_ENTRY]) { + if (entry.remain) { + // this might be the one! + const onend = () => { + if (!entry.invalid) + this[SAW_VALID_ENTRY] = true + } + entry.on('end', onend) + } else { + this[SAW_VALID_ENTRY] = true + } } - } else { - this[EX] = null - entry.ignore = entry.ignore || !this.filter(entry.path, entry) - if (entry.ignore) { - this[EMIT]('ignoredEntry', entry) - this[STATE] = entry.remain ? 'ignore' : 'begin' + if (entry.meta) { + if (entry.size > this.maxMetaEntrySize) { + entry.ignore = true + this[EMIT]('ignoredEntry', entry) + this[STATE] = 'ignore' + entry.resume() + } else if (entry.size > 0) { + this[META] = '' + entry.on('data', c => this[META] += c) + this[STATE] = 'meta' + } } else { - if (entry.remain) - this[STATE] = 'body' - else { - this[STATE] = 'begin' - entry.end() + this[EX] = null + entry.ignore = entry.ignore || !this.filter(entry.path, entry) + + if (entry.ignore) { + // probably valid, just not something we care about + this[EMIT]('ignoredEntry', entry) + this[STATE] = entry.remain ? 'ignore' : 'header' + entry.resume() + } else { + if (entry.remain) + this[STATE] = 'body' + else { + this[STATE] = 'header' + entry.end() + } + + if (!this[READENTRY]) { + this[QUEUE].push(entry) + this[NEXTENTRY]() + } else + this[QUEUE].push(entry) } - - if (!this[READENTRY]) { - this[QUEUE].push(entry) - this[NEXTENTRY]() - } else - this[QUEUE].push(entry) } } } @@ -211,7 +262,7 @@ module.exports = warner(class Parser extends EE { entry.write(c) if (!entry.blockRemain) { - this[STATE] = 'begin' + this[STATE] = 'header' this[WRITEENTRY] = null entry.end() } @@ -265,11 +316,11 @@ module.exports = warner(class Parser extends EE { } } - abort (msg, error) { + abort (error) { this[ABORTED] = true - this.warn(msg, error) this.emit('abort', error) - this.emit('error', error) + // always throws, even in non-strict mode + this.warn('TAR_ABORT', error, { recoverable: false }) } write (chunk) { @@ -295,8 +346,7 @@ module.exports = warner(class Parser extends EE { this[ENDED] = false this[UNZIP] = new zlib.Unzip() this[UNZIP].on('data', chunk => this[CONSUMECHUNK](chunk)) - this[UNZIP].on('error', er => - this.abort(er.message, er)) + this[UNZIP].on('error', er => this.abort(er)) this[UNZIP].on('end', _ => { this[ENDED] = true this[CONSUMECHUNK]() @@ -341,9 +391,10 @@ module.exports = warner(class Parser extends EE { this[EMITTEDEND] = true const entry = this[WRITEENTRY] if (entry && entry.blockRemain) { + // truncated, likely a damaged file const have = this[BUFFER] ? this[BUFFER].length : 0 - this.warn('Truncated input (needed ' + entry.blockRemain + - ' more bytes, only ' + have + ' available)', entry) + this.warn('TAR_BAD_ARCHIVE', `Truncated input (needed ${ + entry.blockRemain} more bytes, only ${have} available)`, {entry}) if (this[BUFFER]) entry.write(this[BUFFER]) entry.end() @@ -353,11 +404,11 @@ module.exports = warner(class Parser extends EE { } [CONSUMECHUNK] (chunk) { - if (this[CONSUMING]) { + if (this[CONSUMING]) this[BUFFERCONCAT](chunk) - } else if (!chunk && !this[BUFFER]) { + else if (!chunk && !this[BUFFER]) this[MAYBEEND]() - } else { + else { this[CONSUMING] = true if (this[BUFFER]) { this[BUFFERCONCAT](chunk) @@ -368,7 +419,10 @@ module.exports = warner(class Parser extends EE { this[CONSUMECHUNKSUB](chunk) } - while (this[BUFFER] && this[BUFFER].length >= 512 && !this[ABORTED]) { + while (this[BUFFER] && + this[BUFFER].length >= 512 && + !this[ABORTED] && + !this[SAW_EOF]) { const c = this[BUFFER] this[BUFFER] = null this[CONSUMECHUNKSUB](c) @@ -385,9 +439,10 @@ module.exports = warner(class Parser extends EE { // the buffer. Advance the position and put any remainder in the buffer. let position = 0 let length = chunk.length - while (position + 512 <= length && !this[ABORTED]) { + while (position + 512 <= length && !this[ABORTED] && !this[SAW_EOF]) { switch (this[STATE]) { case 'begin': + case 'header': this[CONSUMEHEADER](chunk, position) position += 512 break diff --git a/deps/npm/node_modules/tar/lib/path-reservations.js b/deps/npm/node_modules/tar/lib/path-reservations.js new file mode 100644 index 00000000000000..3cf0c2c121b6ac --- /dev/null +++ b/deps/npm/node_modules/tar/lib/path-reservations.js @@ -0,0 +1,125 @@ +// A path exclusive reservation system +// reserve([list, of, paths], fn) +// When the fn is first in line for all its paths, it +// is called with a cb that clears the reservation. +// +// Used by async unpack to avoid clobbering paths in use, +// while still allowing maximal safe parallelization. + +const assert = require('assert') + +module.exports = () => { + // path => [function or Set] + // A Set object means a directory reservation + // A fn is a direct reservation on that path + const queues = new Map() + + // fn => {paths:[path,...], dirs:[path, ...]} + const reservations = new Map() + + // return a set of parent dirs for a given path + const { join } = require('path') + const getDirs = path => + join(path).split(/[\\\/]/).slice(0, -1).reduce((set, path) => + set.length ? set.concat(join(set[set.length-1], path)) : [path], []) + + // functions currently running + const running = new Set() + + // return the queues for each path the function cares about + // fn => {paths, dirs} + const getQueues = fn => { + const res = reservations.get(fn) + /* istanbul ignore if - unpossible */ + if (!res) + throw new Error('function does not have any path reservations') + return { + paths: res.paths.map(path => queues.get(path)), + dirs: [...res.dirs].map(path => queues.get(path)), + } + } + + // check if fn is first in line for all its paths, and is + // included in the first set for all its dir queues + const check = fn => { + const {paths, dirs} = getQueues(fn) + return paths.every(q => q[0] === fn) && + dirs.every(q => q[0] instanceof Set && q[0].has(fn)) + } + + // run the function if it's first in line and not already running + const run = fn => { + if (running.has(fn) || !check(fn)) + return false + running.add(fn) + fn(() => clear(fn)) + return true + } + + const clear = fn => { + if (!running.has(fn)) + return false + + const { paths, dirs } = reservations.get(fn) + const next = new Set() + + paths.forEach(path => { + const q = queues.get(path) + assert.equal(q[0], fn) + if (q.length === 1) + queues.delete(path) + else { + q.shift() + if (typeof q[0] === 'function') + next.add(q[0]) + else + q[0].forEach(fn => next.add(fn)) + } + }) + + dirs.forEach(dir => { + const q = queues.get(dir) + assert(q[0] instanceof Set) + if (q[0].size === 1 && q.length === 1) { + queues.delete(dir) + } else if (q[0].size === 1) { + q.shift() + + // must be a function or else the Set would've been reused + next.add(q[0]) + } else + q[0].delete(fn) + }) + running.delete(fn) + + next.forEach(fn => run(fn)) + return true + } + + const reserve = (paths, fn) => { + const dirs = new Set( + paths.map(path => getDirs(path)).reduce((a, b) => a.concat(b)) + ) + reservations.set(fn, {dirs, paths}) + paths.forEach(path => { + const q = queues.get(path) + if (!q) + queues.set(path, [fn]) + else + q.push(fn) + }) + dirs.forEach(dir => { + const q = queues.get(dir) + if (!q) + queues.set(dir, [new Set([fn])]) + else if (q[q.length-1] instanceof Set) + q[q.length-1].add(fn) + else + q.push(new Set([fn])) + }) + + return run(fn) + } + + return { check, reserve } +} diff --git a/deps/npm/node_modules/tar/lib/pax.js b/deps/npm/node_modules/tar/lib/pax.js index 9d7e4aba521bf3..214a459f3bdde8 100644 --- a/deps/npm/node_modules/tar/lib/pax.js +++ b/deps/npm/node_modules/tar/lib/pax.js @@ -1,5 +1,4 @@ 'use strict' -const Buffer = require('./buffer.js') const Header = require('./header.js') const path = require('path') diff --git a/deps/npm/node_modules/tar/lib/replace.js b/deps/npm/node_modules/tar/lib/replace.js index 571cee94abdbe2..44126d1f85c480 100644 --- a/deps/npm/node_modules/tar/lib/replace.js +++ b/deps/npm/node_modules/tar/lib/replace.js @@ -1,5 +1,4 @@ 'use strict' -const Buffer = require('./buffer.js') // tar -r const hlo = require('./high-level-opt.js') diff --git a/deps/npm/node_modules/tar/lib/unpack.js b/deps/npm/node_modules/tar/lib/unpack.js index fc765096efd119..af0e0ffa059ff2 100644 --- a/deps/npm/node_modules/tar/lib/unpack.js +++ b/deps/npm/node_modules/tar/lib/unpack.js @@ -1,5 +1,11 @@ 'use strict' +// the PEND/UNPEND stuff tracks whether we're ready to emit end/close yet. +// but the path reservations are required to avoid race conditions where +// parallelized unpack ops may mess with one another, due to dependencies +// (like a Link depending on its target) or destructive operations (like +// clobbering an fs object to create one of a different type.) + const assert = require('assert') const EE = require('events').EventEmitter const Parser = require('./parse.js') @@ -9,9 +15,11 @@ const path = require('path') const mkdir = require('./mkdir.js') const mkdirSync = mkdir.sync const wc = require('./winchars.js') +const pathReservations = require('./path-reservations.js') const ONENTRY = Symbol('onEntry') const CHECKFS = Symbol('checkFs') +const CHECKFS2 = Symbol('checkFs2') const ISREUSABLE = Symbol('isReusable') const MAKEFS = Symbol('makeFs') const FILE = Symbol('file') @@ -34,6 +42,12 @@ const DOCHOWN = Symbol('doChown') const UID = Symbol('uid') const GID = Symbol('gid') const crypto = require('crypto') +const getFlag = require('./get-write-flag.js') + +/* istanbul ignore next */ +const neverCalled = () => { + throw new Error('sync function called cb somehow?!?') +} // Unlinks on Windows are not atomic. // @@ -91,6 +105,8 @@ class Unpack extends Parser { super(opt) + this.reservations = pathReservations() + this.transform = typeof opt.transform === 'function' ? opt.transform : null this.writable = true @@ -163,6 +179,15 @@ class Unpack extends Parser { this.on('entry', entry => this[ONENTRY](entry)) } + // a bad or damaged archive is a warning for Parser, but an error + // when extracting. Mark those errors as unrecoverable, because + // the Unpack contract cannot be met. + warn (code, msg, data = {}) { + if (code === 'TAR_BAD_ARCHIVE' || code === 'TAR_ABORT') + data.recoverable = false + return super.warn(code, msg, data) + } + [MAYBECLOSE] () { if (this[ENDED] && this[PENDING] === 0) { this.emit('prefinish') @@ -189,7 +214,10 @@ class Unpack extends Parser { if (!this.preservePaths) { const p = entry.path if (p.match(/(^|\/|\\)\.\.(\\|\/|$)/)) { - this.warn('path contains \'..\'', p) + this.warn('TAR_ENTRY_ERROR', `path contains '..'`, { + entry, + path: p, + }) return false } @@ -197,8 +225,12 @@ class Unpack extends Parser { // so we only need to test this one to get both if (path.win32.isAbsolute(p)) { const parsed = path.win32.parse(p) - this.warn('stripping ' + parsed.root + ' from absolute path', p) entry.path = p.substr(parsed.root.length) + const r = parsed.root + this.warn('TAR_ENTRY_INFO', `stripping ${r} from absolute path`, { + entry, + path: p, + }) } } @@ -250,7 +282,7 @@ class Unpack extends Parser { if (er.name === 'CwdError') this.emit('error', er) else { - this.warn(er.message, er) + this.warn('TAR_ENTRY_ERROR', er, {entry}) this[UNPEND]() entry.resume() } @@ -291,9 +323,10 @@ class Unpack extends Parser { return uint32(this.gid, entry.gid, this.processGid) } - [FILE] (entry) { + [FILE] (entry, fullyDone) { const mode = entry.mode & 0o7777 || this.fmode const stream = new fsm.WriteStream(entry.absolute, { + flags: getFlag(entry.size), mode: mode, autoClose: false }) @@ -304,8 +337,12 @@ class Unpack extends Parser { if (er) return this[ONERROR](er, entry) - if (--actions === 0) - fs.close(stream.fd, _ => this[UNPEND]()) + if (--actions === 0) { + fs.close(stream.fd, er => { + fullyDone() + er ? this[ONERROR](er, entry) : this[UNPEND]() + }) + } } stream.on('finish', _ => { @@ -344,15 +381,18 @@ class Unpack extends Parser { tx.pipe(stream) } - [DIRECTORY] (entry) { + [DIRECTORY] (entry, fullyDone) { const mode = entry.mode & 0o7777 || this.dmode this[MKDIR](entry.absolute, mode, er => { - if (er) + if (er) { + fullyDone() return this[ONERROR](er, entry) + } let actions = 1 const done = _ => { if (--actions === 0) { + fullyDone() this[UNPEND]() entry.resume() } @@ -373,16 +413,18 @@ class Unpack extends Parser { } [UNSUPPORTED] (entry) { - this.warn('unsupported entry type: ' + entry.type, entry) + entry.unsupported = true + this.warn('TAR_ENTRY_UNSUPPORTED', + `unsupported entry type: ${entry.type}`, {entry}) entry.resume() } - [SYMLINK] (entry) { - this[LINK](entry, entry.linkpath, 'symlink') + [SYMLINK] (entry, done) { + this[LINK](entry, entry.linkpath, 'symlink', done) } - [HARDLINK] (entry) { - this[LINK](entry, path.resolve(this.cwd, entry.linkpath), 'link') + [HARDLINK] (entry, done) { + this[LINK](entry, path.resolve(this.cwd, entry.linkpath), 'link', done) } [PEND] () { @@ -413,29 +455,40 @@ class Unpack extends Parser { // check if a thing is there, and if so, try to clobber it [CHECKFS] (entry) { this[PEND]() + const paths = [entry.path] + if (entry.linkpath) + paths.push(entry.linkpath) + this.reservations.reserve(paths, done => this[CHECKFS2](entry, done)) + } + [CHECKFS2] (entry, done) { this[MKDIR](path.dirname(entry.absolute), this.dmode, er => { - if (er) + if (er) { + done() return this[ONERROR](er, entry) + } fs.lstat(entry.absolute, (er, st) => { - if (st && (this.keep || this.newer && st.mtime > entry.mtime)) + if (st && (this.keep || this.newer && st.mtime > entry.mtime)) { this[SKIP](entry) - else if (er || this[ISREUSABLE](entry, st)) - this[MAKEFS](null, entry) + done() + } else if (er || this[ISREUSABLE](entry, st)) { + this[MAKEFS](null, entry, done) + } else if (st.isDirectory()) { if (entry.type === 'Directory') { if (!entry.mode || (st.mode & 0o7777) === entry.mode) - this[MAKEFS](null, entry) + this[MAKEFS](null, entry, done) else - fs.chmod(entry.absolute, entry.mode, er => this[MAKEFS](er, entry)) + fs.chmod(entry.absolute, entry.mode, + er => this[MAKEFS](er, entry, done)) } else - fs.rmdir(entry.absolute, er => this[MAKEFS](er, entry)) + fs.rmdir(entry.absolute, er => this[MAKEFS](er, entry, done)) } else - unlinkFile(entry.absolute, er => this[MAKEFS](er, entry)) + unlinkFile(entry.absolute, er => this[MAKEFS](er, entry, done)) }) }) } - [MAKEFS] (er, entry) { + [MAKEFS] (er, entry, done) { if (er) return this[ONERROR](er, entry) @@ -443,25 +496,26 @@ class Unpack extends Parser { case 'File': case 'OldFile': case 'ContiguousFile': - return this[FILE](entry) + return this[FILE](entry, done) case 'Link': - return this[HARDLINK](entry) + return this[HARDLINK](entry, done) case 'SymbolicLink': - return this[SYMLINK](entry) + return this[SYMLINK](entry, done) case 'Directory': case 'GNUDumpDir': - return this[DIRECTORY](entry) + return this[DIRECTORY](entry, done) } } - [LINK] (entry, linkpath, link) { + [LINK] (entry, linkpath, link, done) { // XXX: get the type ('file' or 'dir') for windows fs[link](linkpath, entry.absolute, er => { if (er) return this[ONERROR](er, entry) + done() this[UNPEND]() entry.resume() }) @@ -474,7 +528,7 @@ class UnpackSync extends Unpack { } [CHECKFS] (entry) { - const er = this[MKDIR](path.dirname(entry.absolute), this.dmode) + const er = this[MKDIR](path.dirname(entry.absolute), this.dmode, neverCalled) if (er) return this[ONERROR](er, entry) try { @@ -482,7 +536,7 @@ class UnpackSync extends Unpack { if (this.keep || this.newer && st.mtime > entry.mtime) return this[SKIP](entry) else if (this[ISREUSABLE](entry, st)) - return this[MAKEFS](null, entry) + return this[MAKEFS](null, entry, neverCalled) else { try { if (st.isDirectory()) { @@ -493,29 +547,34 @@ class UnpackSync extends Unpack { fs.rmdirSync(entry.absolute) } else unlinkFileSync(entry.absolute) - return this[MAKEFS](null, entry) + return this[MAKEFS](null, entry, neverCalled) } catch (er) { return this[ONERROR](er, entry) } } } catch (er) { - return this[MAKEFS](null, entry) + return this[MAKEFS](null, entry, neverCalled) } } - [FILE] (entry) { + [FILE] (entry, _) { const mode = entry.mode & 0o7777 || this.fmode const oner = er => { - try { fs.closeSync(fd) } catch (_) {} - if (er) - this[ONERROR](er, entry) + let closeError + try { + fs.closeSync(fd) + } catch (e) { + closeError = e + } + if (er || closeError) + this[ONERROR](er || closeError, entry) } let stream let fd try { - fd = fs.openSync(entry.absolute, 'w', mode) + fd = fs.openSync(entry.absolute, getFlag(entry.size), mode) } catch (er) { return oner(er) } @@ -570,7 +629,7 @@ class UnpackSync extends Unpack { }) } - [DIRECTORY] (entry) { + [DIRECTORY] (entry, _) { const mode = entry.mode & 0o7777 || this.dmode const er = this[MKDIR](entry.absolute, mode) if (er) @@ -607,7 +666,7 @@ class UnpackSync extends Unpack { } } - [LINK] (entry, linkpath, link) { + [LINK] (entry, linkpath, link, _) { try { fs[link + 'Sync'](linkpath, entry.absolute) entry.resume() diff --git a/deps/npm/node_modules/tar/lib/warn-mixin.js b/deps/npm/node_modules/tar/lib/warn-mixin.js index 94a4b9b9908726..11eb52cc6474ea 100644 --- a/deps/npm/node_modules/tar/lib/warn-mixin.js +++ b/deps/npm/node_modules/tar/lib/warn-mixin.js @@ -1,14 +1,21 @@ 'use strict' module.exports = Base => class extends Base { - warn (msg, data) { - if (!this.strict) - this.emit('warn', msg, data) - else if (data instanceof Error) - this.emit('error', data) - else { - const er = new Error(msg) - er.data = data - this.emit('error', er) - } + warn (code, message, data = {}) { + if (this.file) + data.file = this.file + if (this.cwd) + data.cwd = this.cwd + data.code = message instanceof Error && message.code || code + data.tarCode = code + if (!this.strict && data.recoverable !== false) { + if (message instanceof Error) { + data = Object.assign(message, data) + message = message.message + } + this.emit('warn', data.tarCode, message, data) + } else if (message instanceof Error) { + this.emit('error', Object.assign(message, data)) + } else + this.emit('error', Object.assign(new Error(`${code}: ${message}`), data)) } } diff --git a/deps/npm/node_modules/tar/lib/write-entry.js b/deps/npm/node_modules/tar/lib/write-entry.js index 0c019006f3b670..0e33cb59d5e67c 100644 --- a/deps/npm/node_modules/tar/lib/write-entry.js +++ b/deps/npm/node_modules/tar/lib/write-entry.js @@ -1,5 +1,4 @@ 'use strict' -const Buffer = require('./buffer.js') const MiniPass = require('minipass') const Pax = require('./pax.js') const Header = require('./header.js') @@ -54,12 +53,13 @@ const WriteEntry = warner(class WriteEntry extends MiniPass { if (typeof opt.onwarn === 'function') this.on('warn', opt.onwarn) + let pathWarn = false if (!this.preservePaths && path.win32.isAbsolute(p)) { // absolutes on posix are also absolutes on win32 // so we only need to test this one to get both const parsed = path.win32.parse(p) - this.warn('stripping ' + parsed.root + ' from absolute path', p) this.path = p.substr(parsed.root.length) + pathWarn = parsed.root } this.win32 = !!opt.win32 || process.platform === 'win32' @@ -73,6 +73,13 @@ const WriteEntry = warner(class WriteEntry extends MiniPass { if (this.path === '') this.path = './' + if (pathWarn) { + this.warn('TAR_ENTRY_INFO', `stripping ${pathWarn} from absolute path`, { + entry: this, + path: pathWarn + this.path, + }) + } + if (this.statCache.has(this.absolute)) this[ONLSTAT](this.statCache.get(this.absolute)) else @@ -108,7 +115,7 @@ const WriteEntry = warner(class WriteEntry extends MiniPass { } [MODE] (mode) { - return modeFix(mode, this.type === 'Directory') + return modeFix(mode, this.type === 'Directory', this.portable) } [HEADER] () { @@ -167,14 +174,14 @@ const WriteEntry = warner(class WriteEntry extends MiniPass { } [ONREADLINK] (linkpath) { - this.linkpath = linkpath + this.linkpath = linkpath.replace(/\\/g, '/') this[HEADER]() this.end() } [HARDLINK] (linkpath) { this.type = 'Link' - this.linkpath = path.relative(this.cwd, linkpath) + this.linkpath = path.relative(this.cwd, linkpath).replace(/\\/g, '/') this.stat.size = 0 this[HEADER]() this.end() @@ -215,8 +222,11 @@ const WriteEntry = warner(class WriteEntry extends MiniPass { [READ] (fd, buf, offset, length, pos, remain, blockRemain) { fs.read(fd, buf, offset, length, pos, (er, bytesRead) => { - if (er) - return this[CLOSE](fd, _ => this.emit('error', er)) + if (er) { + // ignoring the error from close(2) is a bad practice, but at + // this point we already have an error, don't need another one + return this[CLOSE](fd, () => this.emit('error', er)) + } this[ONREAD](fd, buf, offset, length, pos, remain, blockRemain, bytesRead) }) } @@ -231,8 +241,7 @@ const WriteEntry = warner(class WriteEntry extends MiniPass { er.path = this.absolute er.syscall = 'read' er.code = 'EOF' - this[CLOSE](fd, _ => _) - return this.emit('error', er) + return this[CLOSE](fd, () => this.emit('error', er)) } if (bytesRead > remain) { @@ -240,8 +249,7 @@ const WriteEntry = warner(class WriteEntry extends MiniPass { er.path = this.absolute er.syscall = 'read' er.code = 'EOF' - this[CLOSE](fd, _ => _) - return this.emit('error', er) + return this[CLOSE](fd, () => this.emit('error', er)) } // null out the rest of the buffer, if we could fit the block padding @@ -265,9 +273,7 @@ const WriteEntry = warner(class WriteEntry extends MiniPass { if (!remain) { if (blockRemain) this.write(Buffer.alloc(blockRemain)) - this.end() - this[CLOSE](fd, _ => _) - return + return this[CLOSE](fd, er => er ? this.emit('error', er) : this.end()) } if (offset >= length) { @@ -303,13 +309,16 @@ class WriteEntrySync extends WriteEntry { this[ONREAD](fd, buf, offset, length, pos, remain, blockRemain, bytesRead) threw = false } finally { + // ignoring the error from close(2) is a bad practice, but at + // this point we already have an error, don't need another one if (threw) - try { this[CLOSE](fd) } catch (er) {} + try { this[CLOSE](fd, () => {}) } catch (er) {} } } - [CLOSE] (fd) { + [CLOSE] (fd, cb) { fs.closeSync(fd) + cb() } } @@ -343,12 +352,10 @@ const WriteEntryTar = warner(class WriteEntryTar extends MiniPass { if (typeof opt.onwarn === 'function') this.on('warn', opt.onwarn) + let pathWarn = false if (path.isAbsolute(this.path) && !this.preservePaths) { const parsed = path.parse(this.path) - this.warn( - 'stripping ' + parsed.root + ' from absolute path', - this.path - ) + pathWarn = parsed.root this.path = this.path.substr(parsed.root.length) } @@ -371,6 +378,13 @@ const WriteEntryTar = warner(class WriteEntryTar extends MiniPass { ctime: this.portable ? null : this.ctime }) + if (pathWarn) { + this.warn('TAR_ENTRY_INFO', `stripping ${pathWarn} from absolute path`, { + entry: this, + path: pathWarn + this.path, + }) + } + if (this.header.encode() && !this.noPax) super.write(new Pax({ atime: this.portable ? null : this.atime, @@ -392,7 +406,7 @@ const WriteEntryTar = warner(class WriteEntryTar extends MiniPass { } [MODE] (mode) { - return modeFix(mode, this.type === 'Directory') + return modeFix(mode, this.type === 'Directory', this.portable) } write (data) { diff --git a/deps/npm/node_modules/tar/node_modules/minipass/LICENSE b/deps/npm/node_modules/tar/node_modules/minipass/LICENSE deleted file mode 100644 index 20a47625409237..00000000000000 --- a/deps/npm/node_modules/tar/node_modules/minipass/LICENSE +++ /dev/null @@ -1,15 +0,0 @@ -The ISC License - -Copyright (c) npm, Inc. and Contributors - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted, provided that the above -copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR -IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/deps/npm/node_modules/tar/node_modules/minipass/README.md b/deps/npm/node_modules/tar/node_modules/minipass/README.md deleted file mode 100644 index c989beea0e6d97..00000000000000 --- a/deps/npm/node_modules/tar/node_modules/minipass/README.md +++ /dev/null @@ -1,606 +0,0 @@ -# minipass - -A _very_ minimal implementation of a [PassThrough -stream](https://nodejs.org/api/stream.html#stream_class_stream_passthrough) - -[It's very -fast](https://docs.google.com/spreadsheets/d/1oObKSrVwLX_7Ut4Z6g3fZW-AX1j1-k6w-cDsrkaSbHM/edit#gid=0) -for objects, strings, and buffers. - -Supports pipe()ing (including multi-pipe() and backpressure -transmission), buffering data until either a `data` event handler or -`pipe()` is added (so you don't lose the first chunk), and most other -cases where PassThrough is a good idea. - -There is a `read()` method, but it's much more efficient to consume -data from this stream via `'data'` events or by calling `pipe()` into -some other stream. Calling `read()` requires the buffer to be -flattened in some cases, which requires copying memory. - -There is also no `unpipe()` method. Once you start piping, there is -no stopping it! - -If you set `objectMode: true` in the options, then whatever is written -will be emitted. Otherwise, it'll do a minimal amount of Buffer -copying to ensure proper Streams semantics when `read(n)` is called. - -`objectMode` can also be set by doing `stream.objectMode = true`, or by -writing any non-string/non-buffer data. `objectMode` cannot be set to -false once it is set. - -This is not a `through` or `through2` stream. It doesn't transform -the data, it just passes it right through. If you want to transform -the data, extend the class, and override the `write()` method. Once -you're done transforming the data however you want, call -`super.write()` with the transform output. - -For some examples of streams that extend Minipass in various ways, check -out: - -- [minizlib](http://npm.im/minizlib) -- [fs-minipass](http://npm.im/fs-minipass) -- [tar](http://npm.im/tar) -- [minipass-collect](http://npm.im/minipass-collect) -- [minipass-flush](http://npm.im/minipass-flush) -- [minipass-pipeline](http://npm.im/minipass-pipeline) -- [tap](http://npm.im/tap) -- [tap-parser](http://npm.im/tap) -- [treport](http://npm.im/tap) - -## Differences from Node.js Streams - -There are several things that make Minipass streams different from (and in -some ways superior to) Node.js core streams. - -Please read these caveats if you are familiar with noode-core streams and -intend to use Minipass streams in your programs. - -### Timing - -Minipass streams are designed to support synchronous use-cases. Thus, data -is emitted as soon as it is available, always. It is buffered until read, -but no longer. Another way to look at it is that Minipass streams are -exactly as synchronous as the logic that writes into them. - -This can be surprising if your code relies on `PassThrough.write()` always -providing data on the next tick rather than the current one, or being able -to call `resume()` and not have the entire buffer disappear immediately. - -However, without this synchronicity guarantee, there would be no way for -Minipass to achieve the speeds it does, or support the synchronous use -cases that it does. Simply put, waiting takes time. - -This non-deferring approach makes Minipass streams much easier to reason -about, especially in the context of Promises and other flow-control -mechanisms. - -### No High/Low Water Marks - -Node.js core streams will optimistically fill up a buffer, returning `true` -on all writes until the limit is hit, even if the data has nowhere to go. -Then, they will not attempt to draw more data in until the buffer size dips -below a minimum value. - -Minipass streams are much simpler. The `write()` method will return `true` -if the data has somewhere to go (which is to say, given the timing -guarantees, that the data is already there by the time `write()` returns). - -If the data has nowhere to go, then `write()` returns false, and the data -sits in a buffer, to be drained out immediately as soon as anyone consumes -it. - -### Hazards of Buffering (or: Why Minipass Is So Fast) - -Since data written to a Minipass stream is immediately written all the way -through the pipeline, and `write()` always returns true/false based on -whether the data was fully flushed, backpressure is communicated -immediately to the upstream caller. This minimizes buffering. - -Consider this case: - -```js -const {PassThrough} = require('stream') -const p1 = new PassThrough({ highWaterMark: 1024 }) -const p2 = new PassThrough({ highWaterMark: 1024 }) -const p3 = new PassThrough({ highWaterMark: 1024 }) -const p4 = new PassThrough({ highWaterMark: 1024 }) - -p1.pipe(p2).pipe(p3).pipe(p4) -p4.on('data', () => console.log('made it through')) - -// this returns false and buffers, then writes to p2 on next tick (1) -// p2 returns false and buffers, pausing p1, then writes to p3 on next tick (2) -// p3 returns false and buffers, pausing p2, then writes to p4 on next tick (3) -// p4 returns false and buffers, pausing p3, then emits 'data' and 'drain' -// on next tick (4) -// p3 sees p4's 'drain' event, and calls resume(), emitting 'resume' and -// 'drain' on next tick (5) -// p2 sees p3's 'drain', calls resume(), emits 'resume' and 'drain' on next tick (6) -// p1 sees p2's 'drain', calls resume(), emits 'resume' and 'drain' on next -// tick (7) - -p1.write(Buffer.alloc(2048)) // returns false -``` - -Along the way, the data was buffered and deferred at each stage, and -multiple event deferrals happened, for an unblocked pipeline where it was -perfectly safe to write all the way through! - -Furthermore, setting a `highWaterMark` of `1024` might lead someone reading -the code to think an advisory maximum of 1KiB is being set for the -pipeline. However, the actual advisory buffering level is the _sum_ of -`highWaterMark` values, since each one has its own bucket. - -Consider the Minipass case: - -```js -const m1 = new Minipass() -const m2 = new Minipass() -const m3 = new Minipass() -const m4 = new Minipass() - -m1.pipe(m2).pipe(m3).pipe(m4) -m4.on('data', () => console.log('made it through')) - -// m1 is flowing, so it writes the data to m2 immediately -// m2 is flowing, so it writes the data to m3 immediately -// m3 is flowing, so it writes the data to m4 immediately -// m4 is flowing, so it fires the 'data' event immediately, returns true -// m4's write returned true, so m3 is still flowing, returns true -// m3's write returned true, so m2 is still flowing, returns true -// m2's write returned true, so m1 is still flowing, returns true -// No event deferrals or buffering along the way! - -m1.write(Buffer.alloc(2048)) // returns true -``` - -It is extremely unlikely that you _don't_ want to buffer any data written, -or _ever_ buffer data that can be flushed all the way through. Neither -node-core streams nor Minipass ever fail to buffer written data, but -node-core streams do a lot of unnecessary buffering and pausing. - -As always, the faster implementation is the one that does less stuff and -waits less time to do it. - -### Immediately emit `end` for empty streams (when not paused) - -If a stream is not paused, and `end()` is called before writing any data -into it, then it will emit `end` immediately. - -If you have logic that occurs on the `end` event which you don't want to -potentially happen immediately (for example, closing file descriptors, -moving on to the next entry in an archive parse stream, etc.) then be sure -to call `stream.pause()` on creation, and then `stream.resume()` once you -are ready to respond to the `end` event. - -### Emit `end` When Asked - -One hazard of immediately emitting `'end'` is that you may not yet have had -a chance to add a listener. In order to avoid this hazard, Minipass -streams safely re-emit the `'end'` event if a new listener is added after -`'end'` has been emitted. - -Ie, if you do `stream.on('end', someFunction)`, and the stream has already -emitted `end`, then it will call the handler right away. (You can think of -this somewhat like attaching a new `.then(fn)` to a previously-resolved -Promise.) - -To prevent calling handlers multiple times who would not expect multiple -ends to occur, all listeners are removed from the `'end'` event whenever it -is emitted. - -### Impact of "immediate flow" on Tee-streams - -A "tee stream" is a stream piping to multiple destinations: - -```js -const tee = new Minipass() -t.pipe(dest1) -t.pipe(dest2) -t.write('foo') // goes to both destinations -``` - -Since Minipass streams _immediately_ process any pending data through the -pipeline when a new pipe destination is added, this can have surprising -effects, especially when a stream comes in from some other function and may -or may not have data in its buffer. - -```js -// WARNING! WILL LOSE DATA! -const src = new Minipass() -src.write('foo') -src.pipe(dest1) // 'foo' chunk flows to dest1 immediately, and is gone -src.pipe(dest2) // gets nothing! -``` - -The solution is to create a dedicated tee-stream junction that pipes to -both locations, and then pipe to _that_ instead. - -```js -// Safe example: tee to both places -const src = new Minipass() -src.write('foo') -const tee = new Minipass() -tee.pipe(dest1) -tee.pipe(dest2) -stream.pipe(tee) // tee gets 'foo', pipes to both locations -``` - -The same caveat applies to `on('data')` event listeners. The first one -added will _immediately_ receive all of the data, leaving nothing for the -second: - -```js -// WARNING! WILL LOSE DATA! -const src = new Minipass() -src.write('foo') -src.on('data', handler1) // receives 'foo' right away -src.on('data', handler2) // nothing to see here! -``` - -Using a dedicated tee-stream can be used in this case as well: - -```js -// Safe example: tee to both data handlers -const src = new Minipass() -src.write('foo') -const tee = new Minipass() -tee.on('data', handler1) -tee.on('data', handler2) -src.pipe(tee) -``` - -## USAGE - -It's a stream! Use it like a stream and it'll most likely do what you want. - -```js -const Minipass = require('minipass') -const mp = new Minipass(options) // optional: { encoding, objectMode } -mp.write('foo') -mp.pipe(someOtherStream) -mp.end('bar') -``` - -### OPTIONS - -* `encoding` How would you like the data coming _out_ of the stream to be - encoded? Accepts any values that can be passed to `Buffer.toString()`. -* `objectMode` Emit data exactly as it comes in. This will be flipped on - by default if you write() something other than a string or Buffer at any - point. Setting `objectMode: true` will prevent setting any encoding - value. - -### API - -Implements the user-facing portions of Node.js's `Readable` and `Writable` -streams. - -### Methods - -* `write(chunk, [encoding], [callback])` - Put data in. (Note that, in the - base Minipass class, the same data will come out.) Returns `false` if - the stream will buffer the next write, or true if it's still in - "flowing" mode. -* `end([chunk, [encoding]], [callback])` - Signal that you have no more - data to write. This will queue an `end` event to be fired when all the - data has been consumed. -* `setEncoding(encoding)` - Set the encoding for data coming of the - stream. This can only be done once. -* `pause()` - No more data for a while, please. This also prevents `end` - from being emitted for empty streams until the stream is resumed. -* `resume()` - Resume the stream. If there's data in the buffer, it is - all discarded. Any buffered events are immediately emitted. -* `pipe(dest)` - Send all output to the stream provided. There is no way - to unpipe. When data is emitted, it is immediately written to any and - all pipe destinations. -* `on(ev, fn)`, `emit(ev, fn)` - Minipass streams are EventEmitters. - Some events are given special treatment, however. (See below under - "events".) -* `promise()` - Returns a Promise that resolves when the stream emits - `end`, or rejects if the stream emits `error`. -* `collect()` - Return a Promise that resolves on `end` with an array - containing each chunk of data that was emitted, or rejects if the - stream emits `error`. Note that this consumes the stream data. -* `concat()` - Same as `collect()`, but concatenates the data into a - single Buffer object. Will reject the returned promise if the stream is - in objectMode, or if it goes into objectMode by the end of the data. -* `read(n)` - Consume `n` bytes of data out of the buffer. If `n` is not - provided, then consume all of it. If `n` bytes are not available, then - it returns null. **Note** consuming streams in this way is less - efficient, and can lead to unnecessary Buffer copying. -* `destroy([er])` - Destroy the stream. If an error is provided, then an - `'error'` event is emitted. If the stream has a `close()` method, and - has not emitted a `'close'` event yet, then `stream.close()` will be - called. Any Promises returned by `.promise()`, `.collect()` or - `.concat()` will be rejected. After being destroyed, writing to the - stream will emit an error. No more data will be emitted if the stream is - destroyed, even if it was previously buffered. - -### Properties - -* `bufferLength` Read-only. Total number of bytes buffered, or in the case - of objectMode, the total number of objects. -* `encoding` The encoding that has been set. (Setting this is equivalent - to calling `setEncoding(enc)` and has the same prohibition against - setting multiple times.) -* `flowing` Read-only. Boolean indicating whether a chunk written to the - stream will be immediately emitted. -* `emittedEnd` Read-only. Boolean indicating whether the end-ish events - (ie, `end`, `prefinish`, `finish`) have been emitted. Note that - listening on any end-ish event will immediateyl re-emit it if it has - already been emitted. -* `writable` Whether the stream is writable. Default `true`. Set to - `false` when `end()` -* `readable` Whether the stream is readable. Default `true`. -* `buffer` A [yallist](http://npm.im/yallist) linked list of chunks written - to the stream that have not yet been emitted. (It's probably a bad idea - to mess with this.) -* `pipes` A [yallist](http://npm.im/yallist) linked list of streams that - this stream is piping into. (It's probably a bad idea to mess with - this.) -* `destroyed` A getter that indicates whether the stream was destroyed. -* `paused` True if the stream has been explicitly paused, otherwise false. -* `objectMode` Indicates whether the stream is in `objectMode`. Once set - to `true`, it cannot be set to `false`. - -### Events - -* `data` Emitted when there's data to read. Argument is the data to read. - This is never emitted while not flowing. If a listener is attached, that - will resume the stream. -* `end` Emitted when there's no more data to read. This will be emitted - immediately for empty streams when `end()` is called. If a listener is - attached, and `end` was already emitted, then it will be emitted again. - All listeners are removed when `end` is emitted. -* `prefinish` An end-ish event that follows the same logic as `end` and is - emitted in the same conditions where `end` is emitted. Emitted after - `'end'`. -* `finish` An end-ish event that follows the same logic as `end` and is - emitted in the same conditions where `end` is emitted. Emitted after - `'prefinish'`. -* `close` An indication that an underlying resource has been released. - Minipass does not emit this event, but will defer it until after `end` - has been emitted, since it throws off some stream libraries otherwise. -* `drain` Emitted when the internal buffer empties, and it is again - suitable to `write()` into the stream. -* `readable` Emitted when data is buffered and ready to be read by a - consumer. -* `resume` Emitted when stream changes state from buffering to flowing - mode. (Ie, when `resume` is called, `pipe` is called, or a `data` event - listener is added.) - -### Static Methods - -* `Minipass.isStream(stream)` Returns `true` if the argument is a stream, - and false otherwise. To be considered a stream, the object must be - either an instance of Minipass, or an EventEmitter that has either a - `pipe()` method, or both `write()` and `end()` methods. (Pretty much any - stream in node-land will return `true` for this.) - -## EXAMPLES - -Here are some examples of things you can do with Minipass streams. - -### simple "are you done yet" promise - -```js -mp.promise().then(() => { - // stream is finished -}, er => { - // stream emitted an error -}) -``` - -### collecting - -```js -mp.collect().then(all => { - // all is an array of all the data emitted - // encoding is supported in this case, so - // so the result will be a collection of strings if - // an encoding is specified, or buffers/objects if not. - // - // In an async function, you may do - // const data = await stream.collect() -}) -``` - -### collecting into a single blob - -This is a bit slower because it concatenates the data into one chunk for -you, but if you're going to do it yourself anyway, it's convenient this -way: - -```js -mp.concat().then(onebigchunk => { - // onebigchunk is a string if the stream - // had an encoding set, or a buffer otherwise. -}) -``` - -### iteration - -You can iterate over streams synchronously or asynchronously in -platforms that support it. - -Synchronous iteration will end when the currently available data is -consumed, even if the `end` event has not been reached. In string and -buffer mode, the data is concatenated, so unless multiple writes are -occurring in the same tick as the `read()`, sync iteration loops will -generally only have a single iteration. - -To consume chunks in this way exactly as they have been written, with -no flattening, create the stream with the `{ objectMode: true }` -option. - -```js -const mp = new Minipass({ objectMode: true }) -mp.write('a') -mp.write('b') -for (let letter of mp) { - console.log(letter) // a, b -} -mp.write('c') -mp.write('d') -for (let letter of mp) { - console.log(letter) // c, d -} -mp.write('e') -mp.end() -for (let letter of mp) { - console.log(letter) // e -} -for (let letter of mp) { - console.log(letter) // nothing -} -``` - -Asynchronous iteration will continue until the end event is reached, -consuming all of the data. - -```js -const mp = new Minipass({ encoding: 'utf8' }) - -// some source of some data -let i = 5 -const inter = setInterval(() => { - if (i --> 0) - mp.write(Buffer.from('foo\n', 'utf8')) - else { - mp.end() - clearInterval(inter) - } -}, 100) - -// consume the data with asynchronous iteration -async function consume () { - for await (let chunk of mp) { - console.log(chunk) - } - return 'ok' -} - -consume().then(res => console.log(res)) -// logs `foo\n` 5 times, and then `ok` -``` - -### subclass that `console.log()`s everything written into it - -```js -class Logger extends Minipass { - write (chunk, encoding, callback) { - console.log('WRITE', chunk, encoding) - return super.write(chunk, encoding, callback) - } - end (chunk, encoding, callback) { - console.log('END', chunk, encoding) - return super.end(chunk, encoding, callback) - } -} - -someSource.pipe(new Logger()).pipe(someDest) -``` - -### same thing, but using an inline anonymous class - -```js -// js classes are fun -someSource - .pipe(new (class extends Minipass { - emit (ev, ...data) { - // let's also log events, because debugging some weird thing - console.log('EMIT', ev) - return super.emit(ev, ...data) - } - write (chunk, encoding, callback) { - console.log('WRITE', chunk, encoding) - return super.write(chunk, encoding, callback) - } - end (chunk, encoding, callback) { - console.log('END', chunk, encoding) - return super.end(chunk, encoding, callback) - } - })) - .pipe(someDest) -``` - -### subclass that defers 'end' for some reason - -```js -class SlowEnd extends Minipass { - emit (ev, ...args) { - if (ev === 'end') { - console.log('going to end, hold on a sec') - setTimeout(() => { - console.log('ok, ready to end now') - super.emit('end', ...args) - }, 100) - } else { - return super.emit(ev, ...args) - } - } -} -``` - -### transform that creates newline-delimited JSON - -```js -class NDJSONEncode extends Minipass { - write (obj, cb) { - try { - // JSON.stringify can throw, emit an error on that - return super.write(JSON.stringify(obj) + '\n', 'utf8', cb) - } catch (er) { - this.emit('error', er) - } - } - end (obj, cb) { - if (typeof obj === 'function') { - cb = obj - obj = undefined - } - if (obj !== undefined) { - this.write(obj) - } - return super.end(cb) - } -} -``` - -### transform that parses newline-delimited JSON - -```js -class NDJSONDecode extends Minipass { - constructor (options) { - // always be in object mode, as far as Minipass is concerned - super({ objectMode: true }) - this._jsonBuffer = '' - } - write (chunk, encoding, cb) { - if (typeof chunk === 'string' && - typeof encoding === 'string' && - encoding !== 'utf8') { - chunk = Buffer.from(chunk, encoding).toString() - } else if (Buffer.isBuffer(chunk)) - chunk = chunk.toString() - } - if (typeof encoding === 'function') { - cb = encoding - } - const jsonData = (this._jsonBuffer + chunk).split('\n') - this._jsonBuffer = jsonData.pop() - for (let i = 0; i < jsonData.length; i++) { - let parsed - try { - super.write(parsed) - } catch (er) { - this.emit('error', er) - continue - } - } - if (cb) - cb() - } -} -``` diff --git a/deps/npm/node_modules/tar/node_modules/minipass/index.js b/deps/npm/node_modules/tar/node_modules/minipass/index.js deleted file mode 100644 index c072352d448a97..00000000000000 --- a/deps/npm/node_modules/tar/node_modules/minipass/index.js +++ /dev/null @@ -1,537 +0,0 @@ -'use strict' -const EE = require('events') -const Yallist = require('yallist') -const SD = require('string_decoder').StringDecoder - -const EOF = Symbol('EOF') -const MAYBE_EMIT_END = Symbol('maybeEmitEnd') -const EMITTED_END = Symbol('emittedEnd') -const EMITTING_END = Symbol('emittingEnd') -const CLOSED = Symbol('closed') -const READ = Symbol('read') -const FLUSH = Symbol('flush') -const FLUSHCHUNK = Symbol('flushChunk') -const ENCODING = Symbol('encoding') -const DECODER = Symbol('decoder') -const FLOWING = Symbol('flowing') -const PAUSED = Symbol('paused') -const RESUME = Symbol('resume') -const BUFFERLENGTH = Symbol('bufferLength') -const BUFFERPUSH = Symbol('bufferPush') -const BUFFERSHIFT = Symbol('bufferShift') -const OBJECTMODE = Symbol('objectMode') -const DESTROYED = Symbol('destroyed') - -// TODO remove when Node v8 support drops -const doIter = global._MP_NO_ITERATOR_SYMBOLS_ !== '1' -const ASYNCITERATOR = doIter && Symbol.asyncIterator - || Symbol('asyncIterator not implemented') -const ITERATOR = doIter && Symbol.iterator - || Symbol('iterator not implemented') - -// Buffer in node 4.x < 4.5.0 doesn't have working Buffer.from -// or Buffer.alloc, and Buffer in node 10 deprecated the ctor. -// .M, this is fine .\^/M.. -const B = Buffer.alloc ? Buffer - : /* istanbul ignore next */ require('safe-buffer').Buffer - -// events that mean 'the stream is over' -// these are treated specially, and re-emitted -// if they are listened for after emitting. -const isEndish = ev => - ev === 'end' || - ev === 'finish' || - ev === 'prefinish' - -const isArrayBuffer = b => b instanceof ArrayBuffer || - typeof b === 'object' && - b.constructor && - b.constructor.name === 'ArrayBuffer' && - b.byteLength >= 0 - -const isArrayBufferView = b => !B.isBuffer(b) && ArrayBuffer.isView(b) - -module.exports = class Minipass extends EE { - constructor (options) { - super() - this[FLOWING] = false - // whether we're explicitly paused - this[PAUSED] = false - this.pipes = new Yallist() - this.buffer = new Yallist() - this[OBJECTMODE] = options && options.objectMode || false - if (this[OBJECTMODE]) - this[ENCODING] = null - else - this[ENCODING] = options && options.encoding || null - if (this[ENCODING] === 'buffer') - this[ENCODING] = null - this[DECODER] = this[ENCODING] ? new SD(this[ENCODING]) : null - this[EOF] = false - this[EMITTED_END] = false - this[EMITTING_END] = false - this[CLOSED] = false - this.writable = true - this.readable = true - this[BUFFERLENGTH] = 0 - this[DESTROYED] = false - } - - get bufferLength () { return this[BUFFERLENGTH] } - - get encoding () { return this[ENCODING] } - set encoding (enc) { - if (this[OBJECTMODE]) - throw new Error('cannot set encoding in objectMode') - - if (this[ENCODING] && enc !== this[ENCODING] && - (this[DECODER] && this[DECODER].lastNeed || this[BUFFERLENGTH])) - throw new Error('cannot change encoding') - - if (this[ENCODING] !== enc) { - this[DECODER] = enc ? new SD(enc) : null - if (this.buffer.length) - this.buffer = this.buffer.map(chunk => this[DECODER].write(chunk)) - } - - this[ENCODING] = enc - } - - setEncoding (enc) { - this.encoding = enc - } - - get objectMode () { return this[OBJECTMODE] } - set objectMode (ॐ ) { this[OBJECTMODE] = this[OBJECTMODE] || !!ॐ } - - write (chunk, encoding, cb) { - if (this[EOF]) - throw new Error('write after end') - - if (this[DESTROYED]) { - this.emit('error', Object.assign( - new Error('Cannot call write after a stream was destroyed'), - { code: 'ERR_STREAM_DESTROYED' } - )) - return true - } - - if (typeof encoding === 'function') - cb = encoding, encoding = 'utf8' - - if (!encoding) - encoding = 'utf8' - - // convert array buffers and typed array views into buffers - // at some point in the future, we may want to do the opposite! - // leave strings and buffers as-is - // anything else switches us into object mode - if (!this[OBJECTMODE] && !B.isBuffer(chunk)) { - if (isArrayBufferView(chunk)) - chunk = B.from(chunk.buffer, chunk.byteOffset, chunk.byteLength) - else if (isArrayBuffer(chunk)) - chunk = B.from(chunk) - else if (typeof chunk !== 'string') - // use the setter so we throw if we have encoding set - this.objectMode = true - } - - // this ensures at this point that the chunk is a buffer or string - // don't buffer it up or send it to the decoder - if (!this.objectMode && !chunk.length) { - const ret = this.flowing - if (this[BUFFERLENGTH] !== 0) - this.emit('readable') - if (cb) - cb() - return ret - } - - // fast-path writing strings of same encoding to a stream with - // an empty buffer, skipping the buffer/decoder dance - if (typeof chunk === 'string' && !this[OBJECTMODE] && - // unless it is a string already ready for us to use - !(encoding === this[ENCODING] && !this[DECODER].lastNeed)) { - chunk = B.from(chunk, encoding) - } - - if (B.isBuffer(chunk) && this[ENCODING]) - chunk = this[DECODER].write(chunk) - - try { - return this.flowing - ? (this.emit('data', chunk), this.flowing) - : (this[BUFFERPUSH](chunk), false) - } finally { - if (this[BUFFERLENGTH] !== 0) - this.emit('readable') - if (cb) - cb() - } - } - - read (n) { - if (this[DESTROYED]) - return null - - try { - if (this[BUFFERLENGTH] === 0 || n === 0 || n > this[BUFFERLENGTH]) - return null - - if (this[OBJECTMODE]) - n = null - - if (this.buffer.length > 1 && !this[OBJECTMODE]) { - if (this.encoding) - this.buffer = new Yallist([ - Array.from(this.buffer).join('') - ]) - else - this.buffer = new Yallist([ - B.concat(Array.from(this.buffer), this[BUFFERLENGTH]) - ]) - } - - return this[READ](n || null, this.buffer.head.value) - } finally { - this[MAYBE_EMIT_END]() - } - } - - [READ] (n, chunk) { - if (n === chunk.length || n === null) - this[BUFFERSHIFT]() - else { - this.buffer.head.value = chunk.slice(n) - chunk = chunk.slice(0, n) - this[BUFFERLENGTH] -= n - } - - this.emit('data', chunk) - - if (!this.buffer.length && !this[EOF]) - this.emit('drain') - - return chunk - } - - end (chunk, encoding, cb) { - if (typeof chunk === 'function') - cb = chunk, chunk = null - if (typeof encoding === 'function') - cb = encoding, encoding = 'utf8' - if (chunk) - this.write(chunk, encoding) - if (cb) - this.once('end', cb) - this[EOF] = true - this.writable = false - - // if we haven't written anything, then go ahead and emit, - // even if we're not reading. - // we'll re-emit if a new 'end' listener is added anyway. - // This makes MP more suitable to write-only use cases. - if (this.flowing || !this[PAUSED]) - this[MAYBE_EMIT_END]() - return this - } - - // don't let the internal resume be overwritten - [RESUME] () { - if (this[DESTROYED]) - return - - this[PAUSED] = false - this[FLOWING] = true - this.emit('resume') - if (this.buffer.length) - this[FLUSH]() - else if (this[EOF]) - this[MAYBE_EMIT_END]() - else - this.emit('drain') - } - - resume () { - return this[RESUME]() - } - - pause () { - this[FLOWING] = false - this[PAUSED] = true - } - - get destroyed () { - return this[DESTROYED] - } - - get flowing () { - return this[FLOWING] - } - - get paused () { - return this[PAUSED] - } - - [BUFFERPUSH] (chunk) { - if (this[OBJECTMODE]) - this[BUFFERLENGTH] += 1 - else - this[BUFFERLENGTH] += chunk.length - return this.buffer.push(chunk) - } - - [BUFFERSHIFT] () { - if (this.buffer.length) { - if (this[OBJECTMODE]) - this[BUFFERLENGTH] -= 1 - else - this[BUFFERLENGTH] -= this.buffer.head.value.length - } - return this.buffer.shift() - } - - [FLUSH] () { - do {} while (this[FLUSHCHUNK](this[BUFFERSHIFT]())) - - if (!this.buffer.length && !this[EOF]) - this.emit('drain') - } - - [FLUSHCHUNK] (chunk) { - return chunk ? (this.emit('data', chunk), this.flowing) : false - } - - pipe (dest, opts) { - if (this[DESTROYED]) - return - - const ended = this[EMITTED_END] - opts = opts || {} - if (dest === process.stdout || dest === process.stderr) - opts.end = false - else - opts.end = opts.end !== false - - const p = { dest: dest, opts: opts, ondrain: _ => this[RESUME]() } - this.pipes.push(p) - - dest.on('drain', p.ondrain) - this[RESUME]() - // piping an ended stream ends immediately - if (ended && p.opts.end) - p.dest.end() - return dest - } - - addListener (ev, fn) { - return this.on(ev, fn) - } - - on (ev, fn) { - try { - return super.on(ev, fn) - } finally { - if (ev === 'data' && !this.pipes.length && !this.flowing) - this[RESUME]() - else if (isEndish(ev) && this[EMITTED_END]) { - super.emit(ev) - this.removeAllListeners(ev) - } - } - } - - get emittedEnd () { - return this[EMITTED_END] - } - - [MAYBE_EMIT_END] () { - if (!this[EMITTING_END] && - !this[EMITTED_END] && - !this[DESTROYED] && - this.buffer.length === 0 && - this[EOF]) { - this[EMITTING_END] = true - this.emit('end') - this.emit('prefinish') - this.emit('finish') - if (this[CLOSED]) - this.emit('close') - this[EMITTING_END] = false - } - } - - emit (ev, data) { - // error and close are only events allowed after calling destroy() - if (ev !== 'error' && ev !== 'close' && ev !== DESTROYED && this[DESTROYED]) - return - else if (ev === 'data') { - if (!data) - return - - if (this.pipes.length) - this.pipes.forEach(p => - p.dest.write(data) === false && this.pause()) - } else if (ev === 'end') { - // only actual end gets this treatment - if (this[EMITTED_END] === true) - return - - this[EMITTED_END] = true - this.readable = false - - if (this[DECODER]) { - data = this[DECODER].end() - if (data) { - this.pipes.forEach(p => p.dest.write(data)) - super.emit('data', data) - } - } - - this.pipes.forEach(p => { - p.dest.removeListener('drain', p.ondrain) - if (p.opts.end) - p.dest.end() - }) - } else if (ev === 'close') { - this[CLOSED] = true - // don't emit close before 'end' and 'finish' - if (!this[EMITTED_END] && !this[DESTROYED]) - return - } - - // TODO: replace with a spread operator when Node v4 support drops - const args = new Array(arguments.length) - args[0] = ev - args[1] = data - if (arguments.length > 2) { - for (let i = 2; i < arguments.length; i++) { - args[i] = arguments[i] - } - } - - try { - return super.emit.apply(this, args) - } finally { - if (!isEndish(ev)) - this[MAYBE_EMIT_END]() - else - this.removeAllListeners(ev) - } - } - - // const all = await stream.collect() - collect () { - const buf = [] - buf.dataLength = 0 - this.on('data', c => { - buf.push(c) - buf.dataLength += c.length - }) - return this.promise().then(() => buf) - } - - // const data = await stream.concat() - concat () { - return this[OBJECTMODE] - ? Promise.reject(new Error('cannot concat in objectMode')) - : this.collect().then(buf => - this[OBJECTMODE] - ? Promise.reject(new Error('cannot concat in objectMode')) - : this[ENCODING] ? buf.join('') : B.concat(buf, buf.dataLength)) - } - - // stream.promise().then(() => done, er => emitted error) - promise () { - return new Promise((resolve, reject) => { - this.on(DESTROYED, () => reject(new Error('stream destroyed'))) - this.on('end', () => resolve()) - this.on('error', er => reject(er)) - }) - } - - // for await (let chunk of stream) - [ASYNCITERATOR] () { - const next = () => { - const res = this.read() - if (res !== null) - return Promise.resolve({ done: false, value: res }) - - if (this[EOF]) - return Promise.resolve({ done: true }) - - let resolve = null - let reject = null - const onerr = er => { - this.removeListener('data', ondata) - this.removeListener('end', onend) - reject(er) - } - const ondata = value => { - this.removeListener('error', onerr) - this.removeListener('end', onend) - this.pause() - resolve({ value: value, done: !!this[EOF] }) - } - const onend = () => { - this.removeListener('error', onerr) - this.removeListener('data', ondata) - resolve({ done: true }) - } - const ondestroy = () => onerr(new Error('stream destroyed')) - return new Promise((res, rej) => { - reject = rej - resolve = res - this.once(DESTROYED, ondestroy) - this.once('error', onerr) - this.once('end', onend) - this.once('data', ondata) - }) - } - - return { next } - } - - // for (let chunk of stream) - [ITERATOR] () { - const next = () => { - const value = this.read() - const done = value === null - return { value, done } - } - return { next } - } - - destroy (er) { - if (this[DESTROYED]) { - if (er) - this.emit('error', er) - else - this.emit(DESTROYED) - return this - } - - this[DESTROYED] = true - - // throw away all buffered data, it's never coming out - this.buffer = new Yallist() - this[BUFFERLENGTH] = 0 - - if (typeof this.close === 'function' && !this[CLOSED]) - this.close() - - if (er) - this.emit('error', er) - else // if no error to emit, still reject pending promises - this.emit(DESTROYED) - - return this - } - - static isStream (s) { - return !!s && (s instanceof Minipass || s instanceof EE && ( - typeof s.pipe === 'function' || // readable - (typeof s.write === 'function' && typeof s.end === 'function') // writable - )) - } -} diff --git a/deps/npm/node_modules/tar/node_modules/minipass/package.json b/deps/npm/node_modules/tar/node_modules/minipass/package.json deleted file mode 100644 index aeb390253c4ee1..00000000000000 --- a/deps/npm/node_modules/tar/node_modules/minipass/package.json +++ /dev/null @@ -1,70 +0,0 @@ -{ - "_from": "minipass@^2.8.6", - "_id": "minipass@2.9.0", - "_inBundle": false, - "_integrity": "sha512-wxfUjg9WebH+CUDX/CdbRlh5SmfZiy/hpkxaRI16Y9W56Pa75sWgd/rvFilSgrauD9NyFymP/+JFV3KwzIsJeg==", - "_location": "/tar/minipass", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "minipass@^2.8.6", - "name": "minipass", - "escapedName": "minipass", - "rawSpec": "^2.8.6", - "saveSpec": null, - "fetchSpec": "^2.8.6" - }, - "_requiredBy": [ - "/tar" - ], - "_resolved": "https://registry.npmjs.org/minipass/-/minipass-2.9.0.tgz", - "_shasum": "e713762e7d3e32fed803115cf93e04bca9fcc9a6", - "_spec": "minipass@^2.8.6", - "_where": "/Users/mperrotte/npminc/cli/node_modules/tar", - "author": { - "name": "Isaac Z. Schlueter", - "email": "i@izs.me", - "url": "http://blog.izs.me/" - }, - "bugs": { - "url": "https://github.com/isaacs/minipass/issues" - }, - "bundleDependencies": false, - "dependencies": { - "safe-buffer": "^5.1.2", - "yallist": "^3.0.0" - }, - "deprecated": false, - "description": "minimal implementation of a PassThrough stream", - "devDependencies": { - "end-of-stream": "^1.4.0", - "tap": "^14.6.5", - "through2": "^2.0.3" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/isaacs/minipass#readme", - "keywords": [ - "passthrough", - "stream" - ], - "license": "ISC", - "main": "index.js", - "name": "minipass", - "repository": { - "type": "git", - "url": "git+https://github.com/isaacs/minipass.git" - }, - "scripts": { - "postpublish": "git push origin --follow-tags", - "postversion": "npm publish", - "preversion": "npm test", - "test": "tap" - }, - "tap": { - "check-coverage": true - }, - "version": "2.9.0" -} diff --git a/deps/npm/node_modules/tar/package.json b/deps/npm/node_modules/tar/package.json index b12db0f3ef5eca..9c388c57cdd5a4 100644 --- a/deps/npm/node_modules/tar/package.json +++ b/deps/npm/node_modules/tar/package.json @@ -1,88 +1,48 @@ { - "_from": "tar@4.4.13", - "_id": "tar@4.4.13", - "_inBundle": false, - "_integrity": "sha512-w2VwSrBoHa5BsSyH+KxEqeQBAllHhccyMFVHtGtdMpF4W7IRWfZjFiQceJPChOeTsSDVUpER2T8FA93pr0L+QA==", - "_location": "/tar", - "_phantomChildren": { - "safe-buffer": "5.1.2", - "yallist": "3.0.3" - }, - "_requested": { - "type": "version", - "registry": true, - "raw": "tar@4.4.13", - "name": "tar", - "escapedName": "tar", - "rawSpec": "4.4.13", - "saveSpec": null, - "fetchSpec": "4.4.13" - }, - "_requiredBy": [ - "#USER", - "/", - "/node-gyp", - "/pacote" - ], - "_resolved": "https://registry.npmjs.org/tar/-/tar-4.4.13.tgz", - "_shasum": "43b364bc52888d555298637b10d60790254ab525", - "_spec": "tar@4.4.13", - "_where": "/Users/mperrotte/npminc/cli", - "author": { - "name": "Isaac Z. Schlueter", - "email": "i@izs.me", - "url": "http://blog.izs.me/" + "author": "Isaac Z. Schlueter (http://blog.izs.me/)", + "name": "tar", + "description": "tar for node", + "version": "6.0.5", + "repository": { + "type": "git", + "url": "https://github.com/npm/node-tar.git" }, - "bugs": { - "url": "https://github.com/npm/node-tar/issues" + "scripts": { + "test": "tap", + "preversion": "npm test", + "postversion": "npm publish", + "prepublishOnly": "git push origin --follow-tags", + "genparse": "node scripts/generate-parse-fixtures.js", + "bench": "for i in benchmarks/*/*.js; do echo $i; for j in {1..5}; do node $i || break; done; done" }, - "bundleDependencies": false, "dependencies": { - "chownr": "^1.1.1", - "fs-minipass": "^1.2.5", - "minipass": "^2.8.6", - "minizlib": "^1.2.1", - "mkdirp": "^0.5.0", - "safe-buffer": "^5.1.2", - "yallist": "^3.0.3" + "chownr": "^2.0.0", + "fs-minipass": "^2.0.0", + "minipass": "^3.0.0", + "minizlib": "^2.1.1", + "mkdirp": "^1.0.3", + "yallist": "^4.0.0" }, - "deprecated": false, - "description": "tar for node", "devDependencies": { "chmodr": "^1.2.0", - "end-of-stream": "^1.4.1", + "end-of-stream": "^1.4.3", "events-to-array": "^1.1.2", "mutate-fs": "^2.1.1", - "rimraf": "^2.6.3", - "tap": "^14.6.5", + "rimraf": "^2.7.1", + "tap": "^14.9.2", "tar-fs": "^1.16.3", "tar-stream": "^1.6.2" }, + "license": "ISC", "engines": { - "node": ">=4.5" + "node": ">= 10" }, "files": [ "index.js", - "lib/" + "lib/*.js" ], - "homepage": "https://github.com/npm/node-tar#readme", - "license": "ISC", - "name": "tar", - "repository": { - "type": "git", - "url": "git+https://github.com/npm/node-tar.git" - }, - "scripts": { - "bench": "for i in benchmarks/*/*.js; do echo $i; for j in {1..5}; do node $i || break; done; done", - "genparse": "node scripts/generate-parse-fixtures.js", - "postpublish": "git push origin --follow-tags", - "postversion": "npm publish", - "preversion": "npm test", - "test": "tap" - }, "tap": { "coverage-map": "map.js", "check-coverage": true - }, - "version": "4.4.13" + } } diff --git a/deps/npm/node_modules/term-size/index.js b/deps/npm/node_modules/term-size/index.js deleted file mode 100644 index 95e410df26a224..00000000000000 --- a/deps/npm/node_modules/term-size/index.js +++ /dev/null @@ -1,70 +0,0 @@ -'use strict'; -const path = require('path'); -const execa = require('execa'); - -const create = (columns, rows) => ({ - columns: parseInt(columns, 10), - rows: parseInt(rows, 10) -}); - -module.exports = () => { - const env = process.env; - const stdout = process.stdout; - const stderr = process.stderr; - - if (stdout && stdout.columns && stdout.rows) { - return create(stdout.columns, stdout.rows); - } - - if (stderr && stderr.columns && stderr.rows) { - return create(stderr.columns, stderr.rows); - } - - // These values are static, so not the first choice - if (env.COLUMNS && env.LINES) { - return create(env.COLUMNS, env.LINES); - } - - if (process.platform === 'win32') { - try { - // Binary: https://github.com/sindresorhus/win-term-size - const size = execa.sync(path.join(__dirname, 'vendor/windows/term-size.exe')).stdout.split(/\r?\n/); - - if (size.length === 2) { - return create(size[0], size[1]); - } - } catch (err) {} - } else { - if (process.platform === 'darwin') { - try { - // Binary: https://github.com/sindresorhus/macos-term-size - const size = execa.shellSync(path.join(__dirname, 'vendor/macos/term-size')).stdout.split(/\r?\n/); - - if (size.length === 2) { - return create(size[0], size[1]); - } - } catch (err) {} - } - - // `resize` is preferred as it works even when all file descriptors are redirected - // https://linux.die.net/man/1/resize - try { - const size = execa.sync('resize', ['-u']).stdout.match(/\d+/g); - - if (size.length === 2) { - return create(size[0], size[1]); - } - } catch (err) {} - - try { - const columns = execa.sync('tput', ['cols']).stdout; - const rows = execa.sync('tput', ['lines']).stdout; - - if (columns && rows) { - return create(columns, rows); - } - } catch (err) {} - } - - return create(80, 24); -}; diff --git a/deps/npm/node_modules/term-size/license b/deps/npm/node_modules/term-size/license deleted file mode 100644 index 654d0bfe943437..00000000000000 --- a/deps/npm/node_modules/term-size/license +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -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/deps/npm/node_modules/term-size/package.json b/deps/npm/node_modules/term-size/package.json deleted file mode 100644 index 8f2eb54c023888..00000000000000 --- a/deps/npm/node_modules/term-size/package.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "_from": "term-size@^1.2.0", - "_id": "term-size@1.2.0", - "_inBundle": false, - "_integrity": "sha1-RYuDiH8oj8Vtb/+/rSYuJmOO+mk=", - "_location": "/term-size", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "term-size@^1.2.0", - "name": "term-size", - "escapedName": "term-size", - "rawSpec": "^1.2.0", - "saveSpec": null, - "fetchSpec": "^1.2.0" - }, - "_requiredBy": [ - "/boxen" - ], - "_resolved": "https://registry.npmjs.org/term-size/-/term-size-1.2.0.tgz", - "_shasum": "458b83887f288fc56d6fffbfad262e26638efa69", - "_spec": "term-size@^1.2.0", - "_where": "/Users/rebecca/code/npm/node_modules/boxen", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "bugs": { - "url": "https://github.com/sindresorhus/term-size/issues" - }, - "bundleDependencies": false, - "dependencies": { - "execa": "^0.7.0" - }, - "deprecated": false, - "description": "Reliably get the terminal window size (columns & rows)", - "devDependencies": { - "ava": "*", - "xo": "*" - }, - "engines": { - "node": ">=4" - }, - "files": [ - "index.js", - "vendor" - ], - "homepage": "https://github.com/sindresorhus/term-size#readme", - "keywords": [ - "term", - "terminal", - "size", - "console", - "window", - "width", - "height", - "columns", - "rows", - "lines", - "tty", - "redirected" - ], - "license": "MIT", - "name": "term-size", - "repository": { - "type": "git", - "url": "git+https://github.com/sindresorhus/term-size.git" - }, - "scripts": { - "test": "xo && ava" - }, - "version": "1.2.0" -} diff --git a/deps/npm/node_modules/term-size/readme.md b/deps/npm/node_modules/term-size/readme.md deleted file mode 100644 index dd642cadc20597..00000000000000 --- a/deps/npm/node_modules/term-size/readme.md +++ /dev/null @@ -1,41 +0,0 @@ -# term-size [![Build Status: Linux & macOS](https://travis-ci.org/sindresorhus/term-size.svg?branch=master)](https://travis-ci.org/sindresorhus/term-size) [![Build Status: Windows](https://ci.appveyor.com/api/projects/status/c3tydg6uedsk0bob/branch/master?svg=true)](https://ci.appveyor.com/project/sindresorhus/term-size/branch/master) - -> Reliably get the terminal window size - -Because [`process.stdout.columns`](https://nodejs.org/api/tty.html#tty_writestream_columns) doesn't exist when run [non-interactively](http://www.tldp.org/LDP/abs/html/intandnonint.html), for example, in a child process or when piped. This module even works when all the TTY file descriptors are redirected! - -Confirmed working on macOS, Linux, and Windows. - - -## Install - -``` -$ npm install --save term-size -``` - - -## Usage - -```js -const termSize = require('term-size'); - -termSize(); -//=> {columns: 143, rows: 24} -``` - - -## API - -### termSize() - -Returns an `Object` with `columns` and `rows` properties. - - -## Related - -- [term-size-cli](https://github.com/sindresorhus/term-size-cli) - CLI for this module - - -## License - -MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/deps/npm/node_modules/term-size/vendor/macos/term-size b/deps/npm/node_modules/term-size/vendor/macos/term-size deleted file mode 100755 index c32a1fdc1b073bb41e9ddbabbd694a741ed67abc..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 27264 zcmeHNcUV(N*H1!dp-T}d5~@hc4Mn8)CRHgSh#@2qA|){i0ydhWC<>xjKoP~d0v155 z*s!uH_Kt|af+#8$%A$NTA(6nkyYKV;vHO+Glesfz=FFM7zqxbf%$eLCeD_@(g+hy< zP#G8$3MCIBUKE8|iNb>%3N;BtZxBhOAQvx>2#;BTuykxdk0pOfK{<~BBZ(B^5gsy@ zh1(u>EEsq+7z&CXVKs@wp`~(08OO_$mjy2asvq-MAdMYmheU=TNg}a1$uaC7MdRgl z^5p69IQTTbfdo&U7_VSN9x0BNz@)K2*?4)GACRFFu?Nh$OsDv6#npTVWa&c_j+JUHhtKzh84k(!YwoY(2xd3ARQ zaS^Bi^EYN*`SZ(5!S{yZN7#x)N=hKH(-LDC2_z1}qyC9z&e?Sz@DF<_O~{^W4$AN#qCrH-0>nUs`4KE9V2nUsus=ia{!k8F=Yj$D zI~_z=2j2lb*ap-9dUPycJi%#f4lU8l)eMY_9s`&_FaQzCzlI;db1IL9c)_3vBCL1T z0g=B*V1+OU5fCCEL_mmu5CI_qLInPoA`t4G+wL;kB`i3|d!2(du)ONA87LI-eCIvz zLfQSp9G~1v9>lNS>q1-V<2Vw|xmQ8mQBdcSdo}lEX9>(@4-a#^z1NB!0nNSFPM50- zZI!F@Z}DDdWd%wA{}RB}O#&P_fc9I9bj||>YgIdE!(@7A5=a2^MaZQGxT1Mn(4GTa z#1SrNd;zZWAo0uX%YEvddjW{X1Jb1)G(frMe(=t2kcf1d=R%6QG^}q93WxPAxzB0b zCp@)Udl_TcHaPV*gX9z3l74WtEe;DPGu7#<#ugQu#l=P;)Mb9Z6R80N0Q92{6z zJQr02J{yPfqH#EohZ9G` zv+0Xzf8@}o;=m6G2g5|cA;2J*LK_#_z?L9|v5RL9!#uQ|r9n%1Zfg{Zj23}n{-dD5 zI}aN0QiPY<@=|wR8o*2cBcVbjAp$}Kga`-`5F#K%K!|`40U-iH1cV3(5fCCEMBpDq zKtTu3y*gHKCc&#~DviZrqGqxr3V1XlnZraCIK!Je?oBx<23#J4o9zPLC|P)JOVEq~ z3t5JMq$DudG)N$Tn9l^a*PQu~oDN7jgThIGgfk!*z&8T(-XITdx%oo4qR}L9?~frR z#*t{LG)gju2JY0!uxIT=GCc{U4;>yNr~0y8=Ssle2ZWVy4-o2MT$#G9LuSs9&=KTJIs(P$WKmOhU{>BFJ(ueR}8HE9FI)Z#H;E5jLgY9&j@fhw^F(~4O1^mokq-Ydw#L2~>u@X(8 z-wfp)Zf$L0<2Btg993H<_1@v5!az=`XZ?&<1$Wvia0$6-N!7DV7VaB(Wo7Xfg1J@K zpX}9pBatjw!musost3Nfuzn*|F0?`0blw}KH<2Fd$I2_Z zyH%_|h?(8gyskg=+1HJ;(E0Y(ly3_M=XRY-OYyxj7!j1o*jcXH7qfve=~Ng11wv5) zB1|E8N}voRsI4HvGWbovd6yi0K|qa^19uy@9wGpFaYi}bIeiqW7-sZe5HQDc1CG|C zWkBgjfOq~d;MmDA3uqLMSzsua=E@U*5;fQ?1akMMMD-I7OTblbJxn`y^4!hz5urER<5z94U08u{iYkbPAb6XC&cW zk~wh<7M+tuR6&#=pNOK&2;VFQgM)W-K_*X>A(|uR2+`b}Xil_>m?&dzEkGh^L{r3= z+frK3owkUU0CW@!@8gdDvyS)!lKz_k@!v*T@NER&7s*2F2qFTY6v;x%p+GqflZ8g3 zau)@PMHajC?A0~Kl#?E@oz7bwS-S$~B&L_XzsRXOP!Pf0(XrB$A%*Y zTAFW{9G+LUz`^Ta_ynR8evx6KrpA$r0Sa`3wT%y(6tb=d$bAgsG(C~nK|$4^YTxZn1`4_1}*FqL?6*D(=OA> z(TwA8n6?B0g_U4NhToqVg^@^LfzQYc6d|&ZUk>(w1s`<|A}=Pe0uyB z1P$GVrldQUH`e!*tYOl!cBs5olb@Jtdf?_a>C|u^X~T4j9@Jv>nne}IYflHhJfObg z+N3Qrq{3ne7afmRH)Pv>NJ->0nCZ^!Dc&o>i2l6Sd%xJl(-Ey&TAm)u+qQg}B43Bs z0Xz58D?!PZ9rW{~%28cAr{#Iur0gEgLG0!ufE8s(0uSYzC;baud%`e&tM*RLL+%~Znx!jID9hpF;u(u z{Z{Qs*(dWf9yU7E+E#v+lSLIu9o1Gb<2($Ihdj@p-&xr-c%2SIVaA zrXwpo3%wZVzD47fn%Ex~_oy=X>C*n&wV#EC8;vF&n}wDDJ%X(YjpFT06sjm1$?Qdp z#3YQx(4wN^7_`b{s2SKmHKe4Z2&e|GlAw?YNam#<%orr|xLRiQELsAcoJ67F!4}1d zqqFgpAG;O}ACrbBC#B(;WEKbH*zDv)8XHfhP-slfNSpcGdqHqFn1qLYfW0mT?1pSm zOC__YcxW7e21!&rg^@(1!+nsAXUxYZvuP${I$|h{b zc2(rFGo!DlM@kY3kM+BIe~6x5s{F;lAQr#IVnLrw*6rr*a>79Hf=KFlibYDFt++{8 z_ft7-*{7%2lLBj>OiRD8D)h0bWNjo%^axO4TX|-TQexGV`8~fe1fhav%)e+t0PDsafwm1| zVTmAI>&8leL^5|0)eu!NoMfRv?#5mdDjF?~8#VNZu81>O2v`wmn=z&jw4itvmMuPj zL8X~3VB96rT3v>tBBt`KHmNa!)sab1Fiv{HADfRc`oPlrYa^(RINLBy+QZo7 zO4C`=j(+*h0r|tIm#d5y-_$_SD~Y64B2c z9++8Zy!Q3^)2ns5cQj^q#G&X#6*BYX%U18bm8Y+>1l#!S#=N41Mjg+>3MoksA6tDt z)nRQ}L|i#{#j6+opPBVuLq|N0Y8#?lC0Hx6mp&Ayi7UTyZ5ax^?vkdQS3mfo>~{79 zvc)yI)OM3^N7Edw-ZQN~EM@GTe)RC?Ck7=>HMXB9*C>4zXjhKhRLZNO;+%XUo4jco zO}sK^Pp|KwjhLVB@|pQtGz?yyY}L_TrYe2)KISuKgYDh3YNEyS%?IgE6ff{pBSsO} z({hM3)LUFT2ZNx-7&$*Ri=6q235~{Df=v(M(+E08k7w^NC~T&HR)ZvBVG91uK&OIz zGYidCwop|n0YV-`=`pJE`*`&y{l8QFP2)oY6uuD;nz8zRREN^Y{9^|JQGqj}5A8x} z1jm;lA|hb0uCn;HE@dORVhe48XGe7R4e9dgaeJJ22AIkp<|JAhs~{~0PApc)baNYo z8zK-z0R|b^-Jh788SnF*q<@phpq6z<`0Eq>v9fB1=_Ld@idz}Yn$Dpyr` z-slb4mL0#USiQFDWWWluNowy8#vAmNlq-6Y(eqjt4)5}tu_kX&M2m(ZVumHVLs`513G1jA1f-iu&DOJiot=JoU^gA9h4dCBqn%1Dflizs9v|S zYR~CeAQn8EbJF~PFjLULjLMXL$e=sxq@|M$P+et3o8H z+G|ORQUW}DSZ5T2?^lGyon2=2bcNB}M(y`2B8KL#JH*g7&e-x`L+#C5_bMZv^m;K8 zzD`WKtD$7~2A@)-S>NK+aAA%au|iDwlxnlt&X_X0xho6hBi^tVz3WnFF_~FHc;C5Y z19CIW^MH{qW8;%`uY*gsQl2GVXsi3SuN&un>YS_EiqDE#K~j~p?yO>R!R-0lRPKc< z7q&<4{h|?Sb8BhDSGiI<8=PY!YyE%?b!K=bLc2|Gum0=FDo#zF5Zu?Fac0WYnYUr*7_v8Cumksq~Et z#p%h7884bq{TrvNh*o~1z6!Y9lpLLXzFaN4@L<%epy&P0Rp+~P6TkT1Rc#ACId$`G zv-c)n28Ys24{Kd&E$ziD-JzKk^u%tKkBZsu{^Fd{M;v;6%rDt{e*f5c*JIzC;EO8H z-fA9lYCZ8(6?G+j3UO84fXu^*%R^JvS3GcC)Uwg%kYDlM^WtB=8Wg+Tc6hmDFS!fr zwdvMkc{P7E&l#c`sgA1V4jzF!ruE#bwN&VTtx-D7?;2;+&So&5_d&GM#xz|CgsmD6{H z8}tvfPHpbh*a(_%olDTh5(NaSy6`mm0Wsto7Qi^s_^E<~2Spl%{C~t4`?*mi zfmlFeOABj)7$Jsb24#9V{M}-#(~iSmeO%AosJ9^G#k0V~k8>X$D)K&1ay!__W&6=( zW4#T)5*zEI=AMJ)KKI)GT5_SGG*3nM3eINBim8^KKFznH6g?OJe!xaGfAZVL{*u@$ zTOwmB({B~VUa;sitDNta6Qy(L%U$DmQ)#0x?eJ#UY`b)?tLK88qfnxV^FpJ<_X{@mhf z@>$&u|BB0UbtTQ)s~cp$cJ*jinNG<2TJ~$gOBHh3s@+qi&em-vuqHP~D~DyoI@}Bh zYMQ0n$2_mTAU3p7v`BaR$^g?$<-IAF?AL_ct6gELu5$VPq%-%~;-PN~EK6dV1v(gj!y0MN!uC0>GaBEJe4zZmHXB!>|U7m97`w2^C znT(?SS&4w+jSL&>r=_$nHI&Z<*L)JA@b_%KNuK&_`{~vUI#qO=XUkKo2Ab;RD=Os^ z$TenPKIF>eJ$LvjcAJr-?U9@%PMp$KEVy?JLQ?nzYllh z`Lx;L2ITj#EKZv=%!pv&Y=Ss143pAG%l98px*b*>maw<$LqpZT8~l3JtA?Cb3IALJ z*R*+GqhEW3@A`eF&%DAJ{wLqxXV*T(E_pp`XJh%KsEYWl38k%XIi~K8Eo4V=kL8xh z23ws=l1r~4?|jdt(s33+J4WYG0CZY{fQyZ2Xn6~%Z-4(a`%`C_3pYL}JI_+sQ z$f&iAe|V{Vz&!Js`EKu5>&40^wN*FT`MzxVRrc87t#`789{rJP#lKtWLXSSYyAyi! zg&zI?Q67C_7RCu!GIm_=(CUBJTEIyBI8TnAc*`>L5VapCW8fQ-8FK>u8}E?rXiF>+ z+?BuDxjIo^?{fZS5$x35%y8`&cq9<~+d<$oE=|-xzzqQcn9~E=`kLF-y_Y>cAv?cD zp?aHa(HTJ#kLS}kU3T?5{%o+8Ixed6`+=^gq2&buloA!BLrlF%wItF(6?^O!>(u)I zgWvWs)Rf4PSNb0obluHWvb*Hn@px{m*g=ABm)Ep&)j?b9Hx?|6oe~~jY}M(zwIQk9 zBV%cy+wA1sR>w%@MooV8GI{~W&_@QgCV0QY>F2$cJJ~G96uW$~g>ia)#R6(+mC4-Q zS53d-kP?^5$ENS^&)v7jX`fAPOV2{L4<(c%hj$#F7HSlxP$llYN2|$3uWHDyILfy% zKFz!*EqktKu^}SbF%6BeaaZwL=&>Jn!MXL~0-q~(j^WSSWsUF5NtpZGwMgn_QId`L zx%X06v`=KVcdvN1HhmxWA2Y&-5CI_qLIi{e2oVq>AVffjfDi#80zw3Y2nZ1nA|OOS uh=33QAp$}Kga`-`5F#K%K!|`40U-iH1cV3(5fCCEL_mmu5P|=n2>chn&~6a` diff --git a/deps/npm/node_modules/term-size/vendor/windows/term-size.exe b/deps/npm/node_modules/term-size/vendor/windows/term-size.exe deleted file mode 100644 index c7a170c96442547c1465f031f9017f4374110829..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 17408 zcmeHO3v^q>nI6g4iDD~~02@qkn#&%AI*_*;)(f-*0&EJjm8-Ovk_|qj$0nrx_n^ty+eL=UUa_-zByDqxj$ylpl z4*Sue7uROB9bwjjVuSHQ_8DLtfLVZ2fDKRuASAVon%xF8$$nlQ#}l10lY#rin5fYb z1M#5fmDcHpNRt0BW9<}(Ke7lT&~+M~vfCJY{WSP2s#5Z7k-hriqF}@Xpo%_KwcrbyzbfNX(I6cSp3OL2p|96=ctMvEw4^` zhw3PpZ8xS04|Y440r*tm{#wtOuA-!W zi%e5W)1Vl&yYZ;NBk}NU4kp{u|AMh-omd5FQeSm4I$oYN3)}{h)DB6RC%q#|X)P=p zdYbH`y(9kj)QSvRcim9t9s01?ApH$hMr-UAD2+Zf3}%aU`%UO5_fMl!os7L`{c>{h zdSK$4$-0TpI9U2gtQ$>nbgKl0MZ_SdHHHJk@EKsdBhjOa5=r=wYO>qdMqZmrv|1>m zTCkU+8l|yB2^^A}?B?`c=QB2H11dVcXe_=HQnT@1U7dXD9CYQMuU!*g{YZ!WO7!Tq z_rLvkRr*WV@fME9o9q`wk4&Z5L6nq3&?=KwnYGHMRV7+grd8!sMc0TmZz}+sxUy1r>3k=%v*#RiX|g&CaTb=J{+Ak zScl6%$@{USb-0Jv3WbeY5^yvpnhSjFuyyz{B96Yha+pLjuTZ|VS0BifYGIXs5Pjd^ zjehu7)}|jslSb<<8#>}Z+8cXOGDm-AkY+zc`ILD(`YR%vKVaolOX6!)>TZ5-v<#A! zc|2%`rBdsz)h{1+P8fE>KxTFB9mO8X5;VoKb3{(Xg&1u-vh!XU;k%{;eyg%`hcb_H z!Frz$x~f(A6C|3xz7*lR-slo$9sUm3o+eYGdtu17_D@*kKjO9L%C+|NvGcG}+IGmo z6N>q}(R~Jao81KQa;sfPPhjkt$Vg=QJOY!o!>VQ#w-dgju?9W~<-J767t4w95on$g&ck)rg|(3YUFxaZjVo4alr zd(H@g$+cJte72wA4j?aL>Hkz!%+-7hr|%^$${9+A*!wgBwWdLBHc_Q-1V!v{s*s3C zqBZstP~FWlZt?{*t7&0&VAU&E*1{Z0M+b8B zr?87wz_Z|z$FkVcbs$kn9h%*vBD^DO&jW{CZkJcTqrMnDYLZjR>URjgP{VWNsDQkR zsnR(#Aa3NE_P0aRD~TE!NlHtgrG7>?c0k6Y^ND;V$-yqGD>lh{k?eCoPMqqCXo%+{ zQ1>GQ*?E+Y>-m@}B*j!{>e=L0+7`79iX-5E^k`XvTbJZQxm6Phat>CRxnjHK@qsby zkF7AtMzTl-ko+qEv?`2yHu8C%{r=bp$xjs$f~GaIgC-y`48PPPd@ks*T3aoN zMKCNc5wI~bR=468j%Ot62NR=J7{#lQZz+hjjYp`NPraaQu-mTKU@uWitALQ7S4(TC zPN}7>RPW=nLlNDe(Sx=OP+py>{`cxnhCbm+%H*jJCgdy0iW8KL?0)>h=bFC15{6`s zkUu=XD^i7yZU>tqu%zM?;;V&JVH5g1d3mxjxm0jL)HHk_ZN-q{G>slbhx;izrxN6m z>^zoxc_Gk#2O?A2uUV;xAkJ4G(Np>*&RYdA#fX>mn4lpezs{$o{H`Fc$V^&0=<{TL1WP{iP47r` zQd_4p{?#U4MgZSvvNr?TV@W*MNef?n0iHSDz+3{zGaLF%Xjh<3TZB!y1P7 zFFIbU5viJJI&gD1ASCZ_UG{1C;CVB@P(Lt-%~&9JZhQ`E*|v%E~eiYy^_%7Nx~61CD)CP188 zx`n5?8EMo9XDZ_DA4lK%NV+PTc0`XnCsmSz1@nl5L^yO2z?Q&m?d>9Q2{yha3du1; zbi4|C$5{38$?LF@sijLmf#8)l@c9$c58@n<$XP*Yx!i>DG=fV8rZ>|$VS`-&Za;8o zFZ$ZDNxTmE&@@{=rf1*(t*Js9F~Gib8R8Qc960;Y2XUOv)4xD0Qrt8kv{U3#TTGAW^la;WUniF7V(WdYAuB;>?D?@cu!&y1Gl-5-=ST0EenP3%;l&_+hKQ9$ z6F*gb1VnVqJoFJE!!62r%JqVB7oCXXPta3#j$3yUt<5@IM6}bQbvVWwChKq;8Wafl zzomiv$MH$uHuQrYSEftPC}BZ4FFIx_c#tdD&K0aanEoQz6z4&WOy=m&O9`5x>cg?* zotDfKBgn05<`L$Oe~#C#=W`OTp;HqxOer>;Q{IfX9n2*UPPnujPe>c<@UK7}ckYM5 zW^Gc1-DsN>=OOX|25<&FOEPgSPFEoNW7i-#5Eweyj$w)?FGJtDYlz$5h72G2F~hBw zH~JJ|n6){j+%dkG+6yNPDS1l1<6!#RI0{;KIS(prNw3T~b78mM6(ga=By{I2u*!Re z4nUqdcr9e@IZ4na613BK@Sa(jXBDF6(s= z)PlVjRoa8k5&Yv@nSs{7v{)a&uG^hEFV^hyo4Ue_d^K{s1v&pIF&f}3T)>5k!K|5Ph#_dk&$s4fSuWs zSNfY6NC!St)y&Sid1M^F0LWt}U(-VxyHrMp_ZBFGdKyqCCbyyI9mx~R8QQ@x>B5kH zO_DdxgGTpWll7+^=l0rY{9=sjGo+o5%As}|@ls1g>|DycDYWs4LRsvmZXIoBIJs3I z3`zkd_fIe=?^9pFQO_JZE}4`@L9W5;P+4z^9gZB%N$Uh7NO4}!j#isl;uxQnNOnJ? z_Ye7iw;F|xBA9**If4CtOlrWkE9%1J0(9(hBhKVxV?sAk=C)>O8ck{`>BNDYwBkI; zXEAdumoNN%M>gPCC&GLysH&4V7-!>oLLf?YE!Y<>P>f3tMT#;j6w}gIr3!hk(qIDr zd#Cz(f;^?!Bwxo*Mc>E#olKnhH+e!?Ws~K2+hN}D>7G)n>9u$ zo;&f3jpXnT0M9#=jc@YsAf3-q)^X+aP#!xhABw!2DkPt%qzWkxyp?sjT$``VKjz}4 z%a<913-JC|?;j@qFmbWtW1;^^WX@eXY% zD>mRm20meoQGOv8yhBUcZq&y!KRWR~a7_o!VP-m$7p$ta?h4Ja?rJEB9gjB|%cP5{ z4~!`7=B2L<%r0m*Eqy6uj_xr;lNC$fi=;8fH}`6^HGj2+ocyKj0K>_;?znV`$Q_z2;wy9P^mb<3>y24h+5*AYu5h4bD%Lv*ZS z>2IVCC3aIbaLG-C_$)5Jfx z>0!|9*@=A~_PmW~*)RiS58u6M8&1E9LE;)CzP!s*sQ{muG=4g7fd5_Y4?LL#0owU> zP4)4d@(zUAEX^fbbL&Inze?l(xfYLm^5PNiG?ZC)wakhgkW$b+a=hVlqBI+u$NA9= z<^l)1ilzG_lhwz$RPTuVQ{Kqs8~o4dmjv=a(>RVaiY0m5iuWw=+WFuF|Bz1zp2qM1 zXOI>kMCMaMv{M^AS8>=snAnq^k8tJWWqzxlJotUX+BMZG*5u5LD3ZNQnnUrOrX!!G z>=I4hB#(#k)j@<4F2AN9=_owuMvY|O&=_^)*CNH4r;(4*-ykF<%5^vsL}n`ubSy28 z9ltZJ+-`=B^*0ZtIQev!ZXb}iz~id<4t_&>9erIBZ?&64r9+d{j?O_cpymSunT30R zSoZ}S`qc$Tu}G;->-9T&eMGNc*Xu)i{jy$9==DLp-mll=dY#nk@9FiEdi|JQKcd$U z>GfCjdPJ}9)$4oodXU%H9Yzu*ZlopxmG}AO?m~{_{^NXc)8sFY=H6#msA?7N4X99? zH_kr(Y$8ykTiT8}r1{Gg;Ee$4+b|{q=w{^!T%Y{eICs|2-x~qHZ&OcqcUQQ}J#hKr z>PolY&$_xoo*rLV@`U&|#hxx-z#9bC?KvHu3%F%*^;H`0b(_0Z>D-NeS2*kmGq%88 zg#XxAar|*?bg&~AI@s#Kt%2Y`K=gz{!4RzM>T^lG=u|AcT3isOUkfYO(z|K2Jar-N8N=D7g%=qG@GYeani4Gs9tDpeN#Yg?!Rhv7)18 zImXz^&7P3g9~=-vu0W3`%er!nbJeoem1`HW&R+an!4r=7B@sVmkb*%m+~@N9(c(X3 z@bqI4sy%M8V)crqEEm4V4@xe-=nsa&V$dsweLVr6*N0y~bbG{#&eoM39njtG3Q4{* zQnl+;j6Laau$KT+02{6+ngM=58~hnqJaAPF{h&hf^?5|E%jb`TJXaU7dbb;vg~bK^ zVy`PK27;om&(-5u9QJfezF>ff;u>E_in#nYL_DFboDn{FgCTK&Timo&@`Oc~B)W1^ zC~<^Oc^e>Q$+ zGJ2(?!W)n@&A+Tr+4Z9*TTP;g>i=4S24pjli?z>Al!pnCw!h|^nK2e z=Tz0G8!w{9>yW(;+-K=#s?j1EV?`FBx!8Ccs(RdrlDtm9p`@xdq6SUXofd&DLemeh z?NQYm3(%;ym}173xrNK_F4!(a3k$w(EE=odSD&hX9v0LWlbnYDj&W6`pGHECZ58AY z{z*XdY4AjLvLB?E{8$3|V?@C9HstggU&vE?T`{L^1)1r2RsDQE{jFq|<{zO?)*}K( zdKma_rMl75-e;-B^9D;Zp540bG;}g=1#rY$177+*j%sB6|o1!K3G` zxSFT-MnsG8{H;a(IL7}DbuM0R#A_Mi)mZG&TTS%E0L8;kbSYJ(bfZ?=eQEags%*f_JEYeDi5zz=%*S|b>-?uYt*2D#Zh zasziR=|K?zbn(;=Tpen%eLLkuv|#HPrhOk)sT=5Cz`dX$KTjK9r=_Y3y9OLPVPApi zSnegxlhBRD2tCm@=IueWUrzwWp{HHf6E!+5HYB1Rv0E%Ah{DD}zI+TwgZ46_MWNib zA(w<7>GQ^YX(eA;igagMijA$=c4IMQX)f|Ow1T%8yqA(N@J5a8AjQ_WmaF7{kI)aA zPSA7`O^3z28GG4sY4XM}UJ#xpJm8Nc;rDpvMm_^m)Zv=4S;$oGpK91Zw+d zI3J1Ny>c7oB@bucjCUe%rz^*Rx8d@x0^k6w0QdoefCmAO0lo*A0K5e_2C(2h@Uwuc z0jmI;0NVgx1N;+UCtw_K1n^q`6{7?_01RT?zzdK7e+Re+umkWA;1R&T0(JxT z0$u>T40s*z3&3vx(*PstfL%%6uWU>$(}zI*WzXe^01w~FxCwuD=bC{m5x=L|6>$4K z^^7?QN5b_BQN}!k>5y>u8tErH*0R6ln60?s?(4)YYJGT_&+nlY`wES8`nqpz4C00r zKdv*j1P}+8AGeVwyM9SQtH-tZ6f|2{&>D2P^@zZt2MYL=Ydh|pgP}gU5$3`X>mH%Q zBdrefa@*a`E#01ex-*3}h%}Rg4!_6K&+ZaBJ)u5d027uC8k2=ie;B5&arq-2_MmV^ zA#A6h-}{1>?r<4s%)dOQ+c$Gbv3ShrgULn1r@>>&5EE>~Z;r;Dq=AIEfcYpwGP zU0(W&K*nx1aD{NZk8MIbxC!SBLl^FmZ)IU)mu_8iL02Teal-{&1KoXYe}K&wT$_R+ ziCrcjT`|VkRe~mcnc(dY`2v!cwFzEiDRvFPJAlMS>u!Or^@;jRLZ7FvyMHTVUlDY2 z_HBV~@Lf1uJu8Hzklz!)FN&xY=-=1&EkI;u6M3l;cUI)a{dhq)RjQr z|0eW>H+P4mtajQR&z8TW2vnWp$hl*);XAsrnLd42Hv%|Y{(>Vg;$Y=~iEalI2hYy+ zU+_%-9@h-~^D6FU22Uh3FnnaB&upjQ@z*T;K5E^=I8)O-i(aOUHE6A29jpsaCtHP9 z3tP!npx=V$GPJ2YE4=#&Zc4a(>XV+|SJpv~0rDgk!uce?dLYe*bBPC%1I){C)MPcB zrV96GRctAs1~!mItJsC$Z3ImpUfV9vZ-q53^l&IZ>4j7YBVl$m`#k=Ixdt~hdC(4` z?qw0QDp@y|K|Gt-Jjl%2(8MXbxo!QBAoE_R2H#Wc{}*d<;SfFdJM=`7bIn^ hqbO<_h5KZNWJd%-pa>v#e$@H%J4bk&2>z_fe*q!}CAt6r diff --git a/deps/npm/node_modules/text-table/package.json b/deps/npm/node_modules/text-table/package.json index de1ad21bd0f590..b4d17a4ff81316 100644 --- a/deps/npm/node_modules/text-table/package.json +++ b/deps/npm/node_modules/text-table/package.json @@ -1,77 +1,44 @@ { - "_args": [ - [ - "text-table@0.2.0", - "/Users/rebecca/code/npm" - ] - ], - "_from": "text-table@0.2.0", - "_id": "text-table@0.2.0", - "_inBundle": false, - "_integrity": "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=", - "_location": "/text-table", - "_phantomChildren": {}, - "_requested": { - "type": "version", - "registry": true, - "raw": "text-table@0.2.0", "name": "text-table", - "escapedName": "text-table", - "rawSpec": "0.2.0", - "saveSpec": null, - "fetchSpec": "0.2.0" - }, - "_requiredBy": [ - "/", - "/eslint" - ], - "_resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", - "_spec": "0.2.0", - "_where": "/Users/rebecca/code/npm", - "author": { - "name": "James Halliday", - "email": "mail@substack.net", - "url": "http://substack.net" - }, - "bugs": { - "url": "https://github.com/substack/text-table/issues" - }, - "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" + "version": "0.2.0", + "description": "borderless text tables with alignment", + "main": "index.js", + "devDependencies": { + "tap": "~0.4.0", + "tape": "~1.0.2", + "cli-color": "~0.2.3" + }, + "scripts": { + "test": "tap test/*.js" + }, + "testling" : { + "files" : "test/*.js", + "browsers" : [ + "ie/6..latest", + "chrome/20..latest", + "firefox/10..latest", + "safari/latest", + "opera/11.0..latest", + "iphone/6", "ipad/6" + ] + }, + "repository": { + "type": "git", + "url": "git://github.com/substack/text-table.git" + }, + "homepage": "https://github.com/substack/text-table", + "keywords": [ + "text", + "table", + "align", + "ascii", + "rows", + "tabular" + ], + "author": { + "name": "James Halliday", + "email": "mail@substack.net", + "url": "http://substack.net" + }, + "license": "MIT" } diff --git a/deps/npm/node_modules/through/.travis.yml b/deps/npm/node_modules/through/.travis.yml deleted file mode 100644 index c693a939df9809..00000000000000 --- a/deps/npm/node_modules/through/.travis.yml +++ /dev/null @@ -1,5 +0,0 @@ -language: node_js -node_js: - - 0.6 - - 0.8 - - "0.10" diff --git a/deps/npm/node_modules/through/LICENSE.APACHE2 b/deps/npm/node_modules/through/LICENSE.APACHE2 deleted file mode 100644 index 6366c04716fb9e..00000000000000 --- a/deps/npm/node_modules/through/LICENSE.APACHE2 +++ /dev/null @@ -1,15 +0,0 @@ -Apache License, Version 2.0 - -Copyright (c) 2011 Dominic Tarr - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. diff --git a/deps/npm/node_modules/through/LICENSE.MIT b/deps/npm/node_modules/through/LICENSE.MIT deleted file mode 100644 index 6eafbd734a6e06..00000000000000 --- a/deps/npm/node_modules/through/LICENSE.MIT +++ /dev/null @@ -1,24 +0,0 @@ -The MIT License - -Copyright (c) 2011 Dominic Tarr - -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/through/index.js b/deps/npm/node_modules/through/index.js deleted file mode 100644 index ca5fc5901fd875..00000000000000 --- a/deps/npm/node_modules/through/index.js +++ /dev/null @@ -1,108 +0,0 @@ -var Stream = require('stream') - -// through -// -// a stream that does nothing but re-emit the input. -// useful for aggregating a series of changing but not ending streams into one stream) - -exports = module.exports = through -through.through = through - -//create a readable writable stream. - -function through (write, end, opts) { - write = write || function (data) { this.queue(data) } - end = end || function () { this.queue(null) } - - var ended = false, destroyed = false, buffer = [], _ended = false - var stream = new Stream() - stream.readable = stream.writable = true - stream.paused = false - -// stream.autoPause = !(opts && opts.autoPause === false) - stream.autoDestroy = !(opts && opts.autoDestroy === false) - - stream.write = function (data) { - write.call(this, data) - return !stream.paused - } - - function drain() { - while(buffer.length && !stream.paused) { - var data = buffer.shift() - if(null === data) - return stream.emit('end') - else - stream.emit('data', data) - } - } - - stream.queue = stream.push = function (data) { -// console.error(ended) - if(_ended) return stream - if(data === null) _ended = true - buffer.push(data) - drain() - return stream - } - - //this will be registered as the first 'end' listener - //must call destroy next tick, to make sure we're after any - //stream piped from here. - //this is only a problem if end is not emitted synchronously. - //a nicer way to do this is to make sure this is the last listener for 'end' - - stream.on('end', function () { - stream.readable = false - if(!stream.writable && stream.autoDestroy) - process.nextTick(function () { - stream.destroy() - }) - }) - - function _end () { - stream.writable = false - end.call(stream) - if(!stream.readable && stream.autoDestroy) - stream.destroy() - } - - stream.end = function (data) { - if(ended) return - ended = true - if(arguments.length) stream.write(data) - _end() // will emit or queue - return stream - } - - stream.destroy = function () { - if(destroyed) return - destroyed = true - ended = true - buffer.length = 0 - stream.writable = stream.readable = false - stream.emit('close') - return stream - } - - stream.pause = function () { - if(stream.paused) return - stream.paused = true - return stream - } - - stream.resume = function () { - if(stream.paused) { - stream.paused = false - stream.emit('resume') - } - drain() - //may have become paused again, - //as drain emits 'data'. - if(!stream.paused) - stream.emit('drain') - return stream - } - return stream -} - diff --git a/deps/npm/node_modules/through/package.json b/deps/npm/node_modules/through/package.json deleted file mode 100644 index e1e55755a32003..00000000000000 --- a/deps/npm/node_modules/through/package.json +++ /dev/null @@ -1,69 +0,0 @@ -{ - "_from": "through@>=2.2.7 <3", - "_id": "through@2.3.8", - "_inBundle": false, - "_integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=", - "_location": "/through", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "through@>=2.2.7 <3", - "name": "through", - "escapedName": "through", - "rawSpec": ">=2.2.7 <3", - "saveSpec": null, - "fetchSpec": ">=2.2.7 <3" - }, - "_requiredBy": [ - "/JSONStream", - "/inquirer" - ], - "_resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", - "_shasum": "0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5", - "_spec": "through@>=2.2.7 <3", - "_where": "/Users/rebecca/code/npm/node_modules/JSONStream", - "author": { - "name": "Dominic Tarr", - "email": "dominic.tarr@gmail.com", - "url": "dominictarr.com" - }, - "bugs": { - "url": "https://github.com/dominictarr/through/issues" - }, - "bundleDependencies": false, - "deprecated": false, - "description": "simplified stream construction", - "devDependencies": { - "from": "~0.1.3", - "stream-spec": "~0.3.5", - "tape": "~2.3.2" - }, - "homepage": "https://github.com/dominictarr/through", - "keywords": [ - "stream", - "streams", - "user-streams", - "pipe" - ], - "license": "MIT", - "main": "index.js", - "name": "through", - "repository": { - "type": "git", - "url": "git+https://github.com/dominictarr/through.git" - }, - "scripts": { - "test": "set -e; for t in test/*.js; do node $t; done" - }, - "testling": { - "browsers": [ - "ie/8..latest", - "ff/15..latest", - "chrome/20..latest", - "safari/5.1..latest" - ], - "files": "test/*.js" - }, - "version": "2.3.8" -} diff --git a/deps/npm/node_modules/through/readme.markdown b/deps/npm/node_modules/through/readme.markdown deleted file mode 100644 index cb34c8135f53eb..00000000000000 --- a/deps/npm/node_modules/through/readme.markdown +++ /dev/null @@ -1,64 +0,0 @@ -#through - -[![build status](https://secure.travis-ci.org/dominictarr/through.png)](http://travis-ci.org/dominictarr/through) -[![testling badge](https://ci.testling.com/dominictarr/through.png)](https://ci.testling.com/dominictarr/through) - -Easy way to create a `Stream` that is both `readable` and `writable`. - -* Pass in optional `write` and `end` methods. -* `through` takes care of pause/resume logic if you use `this.queue(data)` instead of `this.emit('data', data)`. -* Use `this.pause()` and `this.resume()` to manage flow. -* Check `this.paused` to see current flow state. (`write` always returns `!this.paused`). - -This function is the basis for most of the synchronous streams in -[event-stream](http://github.com/dominictarr/event-stream). - -``` js -var through = require('through') - -through(function write(data) { - this.queue(data) //data *must* not be null - }, - function end () { //optional - this.queue(null) - }) -``` - -Or, can also be used _without_ buffering on pause, use `this.emit('data', data)`, -and this.emit('end') - -``` js -var through = require('through') - -through(function write(data) { - this.emit('data', data) - //this.pause() - }, - function end () { //optional - this.emit('end') - }) -``` - -## Extended Options - -You will probably not need these 99% of the time. - -### autoDestroy=false - -By default, `through` emits close when the writable -and readable side of the stream has ended. -If that is not desired, set `autoDestroy=false`. - -``` js -var through = require('through') - -//like this -var ts = through(write, end, {autoDestroy: false}) -//or like this -var ts = through(write, end) -ts.autoDestroy = false -``` - -## License - -MIT / Apache2 diff --git a/deps/npm/node_modules/through/test/async.js b/deps/npm/node_modules/through/test/async.js deleted file mode 100644 index 46bdbaebcbc09b..00000000000000 --- a/deps/npm/node_modules/through/test/async.js +++ /dev/null @@ -1,28 +0,0 @@ -var from = require('from') -var through = require('../') - -var tape = require('tape') - -tape('simple async example', function (t) { - - var n = 0, expected = [1,2,3,4,5], actual = [] - from(expected) - .pipe(through(function(data) { - this.pause() - n ++ - setTimeout(function(){ - console.log('pushing data', data) - this.push(data) - this.resume() - }.bind(this), 300) - })).pipe(through(function(data) { - console.log('pushing data second time', data); - this.push(data) - })).on('data', function (d) { - actual.push(d) - }).on('end', function() { - t.deepEqual(actual, expected) - t.end() - }) - -}) diff --git a/deps/npm/node_modules/through/test/auto-destroy.js b/deps/npm/node_modules/through/test/auto-destroy.js deleted file mode 100644 index 9a8fd0006f5b80..00000000000000 --- a/deps/npm/node_modules/through/test/auto-destroy.js +++ /dev/null @@ -1,30 +0,0 @@ -var test = require('tape') -var through = require('../') - -// must emit end before close. - -test('end before close', function (assert) { - var ts = through() - ts.autoDestroy = false - var ended = false, closed = false - - ts.on('end', function () { - assert.ok(!closed) - ended = true - }) - ts.on('close', function () { - assert.ok(ended) - closed = true - }) - - ts.write(1) - ts.write(2) - ts.write(3) - ts.end() - assert.ok(ended) - assert.notOk(closed) - ts.destroy() - assert.ok(closed) - assert.end() -}) - diff --git a/deps/npm/node_modules/through/test/buffering.js b/deps/npm/node_modules/through/test/buffering.js deleted file mode 100644 index b0084bfc6ed5ac..00000000000000 --- a/deps/npm/node_modules/through/test/buffering.js +++ /dev/null @@ -1,71 +0,0 @@ -var test = require('tape') -var through = require('../') - -// must emit end before close. - -test('buffering', function(assert) { - var ts = through(function (data) { - this.queue(data) - }, function () { - this.queue(null) - }) - - var ended = false, actual = [] - - ts.on('data', actual.push.bind(actual)) - ts.on('end', function () { - ended = true - }) - - ts.write(1) - ts.write(2) - ts.write(3) - assert.deepEqual(actual, [1, 2, 3]) - ts.pause() - ts.write(4) - ts.write(5) - ts.write(6) - assert.deepEqual(actual, [1, 2, 3]) - ts.resume() - assert.deepEqual(actual, [1, 2, 3, 4, 5, 6]) - ts.pause() - ts.end() - assert.ok(!ended) - ts.resume() - assert.ok(ended) - assert.end() -}) - -test('buffering has data in queue, when ends', function (assert) { - - /* - * If stream ends while paused with data in the queue, - * stream should still emit end after all data is written - * on resume. - */ - - var ts = through(function (data) { - this.queue(data) - }, function () { - this.queue(null) - }) - - var ended = false, actual = [] - - ts.on('data', actual.push.bind(actual)) - ts.on('end', function () { - ended = true - }) - - ts.pause() - ts.write(1) - ts.write(2) - ts.write(3) - ts.end() - assert.deepEqual(actual, [], 'no data written yet, still paused') - assert.ok(!ended, 'end not emitted yet, still paused') - ts.resume() - assert.deepEqual(actual, [1, 2, 3], 'resumed, all data should be delivered') - assert.ok(ended, 'end should be emitted once all data was delivered') - assert.end(); -}) diff --git a/deps/npm/node_modules/through/test/end.js b/deps/npm/node_modules/through/test/end.js deleted file mode 100644 index fa113f58e0360a..00000000000000 --- a/deps/npm/node_modules/through/test/end.js +++ /dev/null @@ -1,45 +0,0 @@ -var test = require('tape') -var through = require('../') - -// must emit end before close. - -test('end before close', function (assert) { - var ts = through() - var ended = false, closed = false - - ts.on('end', function () { - assert.ok(!closed) - ended = true - }) - ts.on('close', function () { - assert.ok(ended) - closed = true - }) - - ts.write(1) - ts.write(2) - ts.write(3) - ts.end() - assert.ok(ended) - assert.ok(closed) - assert.end() -}) - -test('end only once', function (t) { - - var ts = through() - var ended = false, closed = false - - ts.on('end', function () { - t.equal(ended, false) - ended = true - }) - - ts.queue(null) - ts.queue(null) - ts.queue(null) - - ts.resume() - - t.end() -}) diff --git a/deps/npm/node_modules/through/test/index.js b/deps/npm/node_modules/through/test/index.js deleted file mode 100644 index 96da82f97c74cf..00000000000000 --- a/deps/npm/node_modules/through/test/index.js +++ /dev/null @@ -1,133 +0,0 @@ - -var test = require('tape') -var spec = require('stream-spec') -var through = require('../') - -/* - I'm using these two functions, and not streams and pipe - so there is less to break. if this test fails it must be - the implementation of _through_ -*/ - -function write(array, stream) { - array = array.slice() - function next() { - while(array.length) - if(stream.write(array.shift()) === false) - return stream.once('drain', next) - - stream.end() - } - - next() -} - -function read(stream, callback) { - var actual = [] - stream.on('data', function (data) { - actual.push(data) - }) - stream.once('end', function () { - callback(null, actual) - }) - stream.once('error', function (err) { - callback(err) - }) -} - -test('simple defaults', function(assert) { - - var l = 1000 - , expected = [] - - while(l--) expected.push(l * Math.random()) - - var t = through() - var s = spec(t).through().pausable() - - read(t, function (err, actual) { - assert.ifError(err) - assert.deepEqual(actual, expected) - assert.end() - }) - - t.on('close', s.validate) - - write(expected, t) -}); - -test('simple functions', function(assert) { - - var l = 1000 - , expected = [] - - while(l--) expected.push(l * Math.random()) - - var t = through(function (data) { - this.emit('data', data*2) - }) - var s = spec(t).through().pausable() - - - read(t, function (err, actual) { - assert.ifError(err) - assert.deepEqual(actual, expected.map(function (data) { - return data*2 - })) - assert.end() - }) - - t.on('close', s.validate) - - write(expected, t) -}) - -test('pauses', function(assert) { - - var l = 1000 - , expected = [] - - while(l--) expected.push(l) //Math.random()) - - var t = through() - - var s = spec(t) - .through() - .pausable() - - t.on('data', function () { - if(Math.random() > 0.1) return - t.pause() - process.nextTick(function () { - t.resume() - }) - }) - - read(t, function (err, actual) { - assert.ifError(err) - assert.deepEqual(actual, expected) - }) - - t.on('close', function () { - s.validate() - assert.end() - }) - - write(expected, t) -}) - -test('does not soft-end on `undefined`', function(assert) { - var stream = through() - , count = 0 - - stream.on('data', function (data) { - count++ - }) - - stream.write(undefined) - stream.write(undefined) - - assert.equal(count, 2) - - assert.end() -}) diff --git a/deps/npm/node_modules/through2/.npmignore b/deps/npm/node_modules/through2/.npmignore deleted file mode 100644 index 1e1dcab34ccb66..00000000000000 --- a/deps/npm/node_modules/through2/.npmignore +++ /dev/null @@ -1,3 +0,0 @@ -test -.jshintrc -.travis.yml \ No newline at end of file diff --git a/deps/npm/node_modules/through2/LICENSE.html b/deps/npm/node_modules/through2/LICENSE.html deleted file mode 100644 index ac478189ea2271..00000000000000 --- a/deps/npm/node_modules/through2/LICENSE.html +++ /dev/null @@ -1,336 +0,0 @@ - - - - - - - - - - - - - - -
    -

    The MIT License (MIT)

    -

    Copyright (c) 2016 Rod Vagg (the "Original Author") and additional contributors

    -

    Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

    -

    The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

    -

    THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

    -
    -
    - - \ No newline at end of file diff --git a/deps/npm/node_modules/through2/LICENSE.md b/deps/npm/node_modules/through2/LICENSE.md deleted file mode 100644 index 7f0b93daaa4708..00000000000000 --- a/deps/npm/node_modules/through2/LICENSE.md +++ /dev/null @@ -1,9 +0,0 @@ -# The MIT License (MIT) - -**Copyright (c) 2016 Rod Vagg (the "Original Author") and additional contributors** - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/deps/npm/node_modules/through2/README.md b/deps/npm/node_modules/through2/README.md deleted file mode 100644 index a916f15ef5e330..00000000000000 --- a/deps/npm/node_modules/through2/README.md +++ /dev/null @@ -1,136 +0,0 @@ -# through2 - -[![NPM](https://nodei.co/npm/through2.png?downloads&downloadRank)](https://nodei.co/npm/through2/) - -**A tiny wrapper around Node streams.Transform (Streams2) to avoid explicit subclassing noise** - -Inspired by [Dominic Tarr](https://github.com/dominictarr)'s [through](https://github.com/dominictarr/through) in that it's so much easier to make a stream out of a function than it is to set up the prototype chain properly: `through(function (chunk) { ... })`. - -Note: As 2.x.x this module starts using **Streams3** instead of Stream2. To continue using a Streams2 version use `npm install through2@0` to fetch the latest version of 0.x.x. More information about Streams2 vs Streams3 and recommendations see the article **[Why I don't use Node's core 'stream' module](http://r.va.gg/2014/06/why-i-dont-use-nodes-core-stream-module.html)**. - -```js -fs.createReadStream('ex.txt') - .pipe(through2(function (chunk, enc, callback) { - for (var i = 0; i < chunk.length; i++) - if (chunk[i] == 97) - chunk[i] = 122 // swap 'a' for 'z' - - this.push(chunk) - - callback() - })) - .pipe(fs.createWriteStream('out.txt')) - .on('finish', function () { - doSomethingSpecial() - }) -``` - -Or object streams: - -```js -var all = [] - -fs.createReadStream('data.csv') - .pipe(csv2()) - .pipe(through2.obj(function (chunk, enc, callback) { - var data = { - name : chunk[0] - , address : chunk[3] - , phone : chunk[10] - } - this.push(data) - - callback() - })) - .on('data', function (data) { - all.push(data) - }) - .on('end', function () { - doSomethingSpecial(all) - }) -``` - -Note that `through2.obj(fn)` is a convenience wrapper around `through2({ objectMode: true }, fn)`. - -## API - -through2([ options, ] [ transformFunction ] [, flushFunction ]) - -Consult the **[stream.Transform](http://nodejs.org/docs/latest/api/stream.html#stream_class_stream_transform)** documentation for the exact rules of the `transformFunction` (i.e. `this._transform`) and the optional `flushFunction` (i.e. `this._flush`). - -### options - -The options argument is optional and is passed straight through to `stream.Transform`. So you can use `objectMode:true` if you are processing non-binary streams (or just use `through2.obj()`). - -The `options` argument is first, unlike standard convention, because if I'm passing in an anonymous function then I'd prefer for the options argument to not get lost at the end of the call: - -```js -fs.createReadStream('/tmp/important.dat') - .pipe(through2({ objectMode: true, allowHalfOpen: false }, - function (chunk, enc, cb) { - cb(null, 'wut?') // note we can use the second argument on the callback - // to provide data as an alternative to this.push('wut?') - } - ) - .pipe(fs.createWriteStream('/tmp/wut.txt')) -``` - -### transformFunction - -The `transformFunction` must have the following signature: `function (chunk, encoding, callback) {}`. A minimal implementation should call the `callback` function to indicate that the transformation is done, even if that transformation means discarding the chunk. - -To queue a new chunk, call `this.push(chunk)`—this can be called as many times as required before the `callback()` if you have multiple pieces to send on. - -Alternatively, you may use `callback(err, chunk)` as shorthand for emitting a single chunk or an error. - -If you **do not provide a `transformFunction`** then you will get a simple pass-through stream. - -### flushFunction - -The optional `flushFunction` is provided as the last argument (2nd or 3rd, depending on whether you've supplied options) is called just prior to the stream ending. Can be used to finish up any processing that may be in progress. - -```js -fs.createReadStream('/tmp/important.dat') - .pipe(through2( - function (chunk, enc, cb) { cb(null, chunk) }, // transform is a noop - function (cb) { // flush function - this.push('tacking on an extra buffer to the end'); - cb(); - } - )) - .pipe(fs.createWriteStream('/tmp/wut.txt')); -``` - -through2.ctor([ options, ] transformFunction[, flushFunction ]) - -Instead of returning a `stream.Transform` instance, `through2.ctor()` returns a **constructor** for a custom Transform. This is useful when you want to use the same transform logic in multiple instances. - -```js -var FToC = through2.ctor({objectMode: true}, function (record, encoding, callback) { - if (record.temp != null && record.unit == "F") { - record.temp = ( ( record.temp - 32 ) * 5 ) / 9 - record.unit = "C" - } - this.push(record) - callback() -}) - -// Create instances of FToC like so: -var converter = new FToC() -// Or: -var converter = FToC() -// Or specify/override options when you instantiate, if you prefer: -var converter = FToC({objectMode: true}) -``` - -## See Also - - - [through2-map](https://github.com/brycebaril/through2-map) - Array.prototype.map analog for streams. - - [through2-filter](https://github.com/brycebaril/through2-filter) - Array.prototype.filter analog for streams. - - [through2-reduce](https://github.com/brycebaril/through2-reduce) - Array.prototype.reduce analog for streams. - - [through2-spy](https://github.com/brycebaril/through2-spy) - Wrapper for simple stream.PassThrough spies. - - the [mississippi stream utility collection](https://github.com/maxogden/mississippi) includes `through2` as well as many more useful stream modules similar to this one - -## License - -**through2** is Copyright (c) 2013 Rod Vagg [@rvagg](https://twitter.com/rvagg) and licensed under the MIT license. All rights not explicitly granted in the MIT license are reserved. See the included LICENSE file for more details. diff --git a/deps/npm/node_modules/through2/node_modules/readable-stream/.travis.yml b/deps/npm/node_modules/through2/node_modules/readable-stream/.travis.yml deleted file mode 100644 index 40992555bf5cc0..00000000000000 --- a/deps/npm/node_modules/through2/node_modules/readable-stream/.travis.yml +++ /dev/null @@ -1,55 +0,0 @@ -sudo: false -language: node_js -before_install: - - npm install -g npm@2 - - test $NPM_LEGACY && npm install -g npm@latest-3 || npm install npm -g -notifications: - email: false -matrix: - fast_finish: true - include: - - node_js: '0.8' - env: - - TASK=test - - NPM_LEGACY=true - - node_js: '0.10' - env: - - TASK=test - - NPM_LEGACY=true - - node_js: '0.11' - env: - - TASK=test - - NPM_LEGACY=true - - node_js: '0.12' - env: - - TASK=test - - NPM_LEGACY=true - - node_js: 1 - env: - - TASK=test - - NPM_LEGACY=true - - node_js: 2 - env: - - TASK=test - - NPM_LEGACY=true - - node_js: 3 - env: - - TASK=test - - NPM_LEGACY=true - - node_js: 4 - env: TASK=test - - node_js: 5 - env: TASK=test - - node_js: 6 - env: TASK=test - - node_js: 7 - env: TASK=test - - node_js: 8 - env: TASK=test - - node_js: 9 - env: TASK=test -script: "npm run $TASK" -env: - global: - - secure: rE2Vvo7vnjabYNULNyLFxOyt98BoJexDqsiOnfiD6kLYYsiQGfr/sbZkPMOFm9qfQG7pjqx+zZWZjGSswhTt+626C0t/njXqug7Yps4c3dFblzGfreQHp7wNX5TFsvrxd6dAowVasMp61sJcRnB2w8cUzoe3RAYUDHyiHktwqMc= - - secure: g9YINaKAdMatsJ28G9jCGbSaguXCyxSTy+pBO6Ch0Cf57ZLOTka3HqDj8p3nV28LUIHZ3ut5WO43CeYKwt4AUtLpBS3a0dndHdY6D83uY6b2qh5hXlrcbeQTq2cvw2y95F7hm4D1kwrgZ7ViqaKggRcEupAL69YbJnxeUDKWEdI= diff --git a/deps/npm/node_modules/through2/node_modules/readable-stream/GOVERNANCE.md b/deps/npm/node_modules/through2/node_modules/readable-stream/GOVERNANCE.md deleted file mode 100644 index 16ffb93f24bece..00000000000000 --- a/deps/npm/node_modules/through2/node_modules/readable-stream/GOVERNANCE.md +++ /dev/null @@ -1,136 +0,0 @@ -### Streams Working Group - -The Node.js Streams is jointly governed by a Working Group -(WG) -that is responsible for high-level guidance of the project. - -The WG has final authority over this project including: - -* Technical direction -* Project governance and process (including this policy) -* Contribution policy -* GitHub repository hosting -* Conduct guidelines -* Maintaining the list of additional Collaborators - -For the current list of WG members, see the project -[README.md](./README.md#current-project-team-members). - -### Collaborators - -The readable-stream GitHub repository is -maintained by the WG and additional Collaborators who are added by the -WG on an ongoing basis. - -Individuals making significant and valuable contributions are made -Collaborators and given commit-access to the project. These -individuals are identified by the WG and their addition as -Collaborators is discussed during the WG meeting. - -_Note:_ If you make a significant contribution and are not considered -for commit-access log an issue or contact a WG member directly and it -will be brought up in the next WG meeting. - -Modifications of the contents of the readable-stream repository are -made on -a collaborative basis. Anybody with a GitHub account may propose a -modification via pull request and it will be considered by the project -Collaborators. All pull requests must be reviewed and accepted by a -Collaborator with sufficient expertise who is able to take full -responsibility for the change. In the case of pull requests proposed -by an existing Collaborator, an additional Collaborator is required -for sign-off. Consensus should be sought if additional Collaborators -participate and there is disagreement around a particular -modification. See _Consensus Seeking Process_ below for further detail -on the consensus model used for governance. - -Collaborators may opt to elevate significant or controversial -modifications, or modifications that have not found consensus to the -WG for discussion by assigning the ***WG-agenda*** tag to a pull -request or issue. The WG should serve as the final arbiter where -required. - -For the current list of Collaborators, see the project -[README.md](./README.md#members). - -### WG Membership - -WG seats are not time-limited. There is no fixed size of the WG. -However, the expected target is between 6 and 12, to ensure adequate -coverage of important areas of expertise, balanced with the ability to -make decisions efficiently. - -There is no specific set of requirements or qualifications for WG -membership beyond these rules. - -The WG may add additional members to the WG by unanimous consensus. - -A WG member may be removed from the WG by voluntary resignation, or by -unanimous consensus of all other WG members. - -Changes to WG membership should be posted in the agenda, and may be -suggested as any other agenda item (see "WG Meetings" below). - -If an addition or removal is proposed during a meeting, and the full -WG is not in attendance to participate, then the addition or removal -is added to the agenda for the subsequent meeting. This is to ensure -that all members are given the opportunity to participate in all -membership decisions. If a WG member is unable to attend a meeting -where a planned membership decision is being made, then their consent -is assumed. - -No more than 1/3 of the WG members may be affiliated with the same -employer. If removal or resignation of a WG member, or a change of -employment by a WG member, creates a situation where more than 1/3 of -the WG membership shares an employer, then the situation must be -immediately remedied by the resignation or removal of one or more WG -members affiliated with the over-represented employer(s). - -### WG Meetings - -The WG meets occasionally on a Google Hangout On Air. A designated moderator -approved by the WG runs the meeting. Each meeting should be -published to YouTube. - -Items are added to the WG agenda that are considered contentious or -are modifications of governance, contribution policy, WG membership, -or release process. - -The intention of the agenda is not to approve or review all patches; -that should happen continuously on GitHub and be handled by the larger -group of Collaborators. - -Any community member or contributor can ask that something be added to -the next meeting's agenda by logging a GitHub Issue. Any Collaborator, -WG member or the moderator can add the item to the agenda by adding -the ***WG-agenda*** tag to the issue. - -Prior to each WG meeting the moderator will share the Agenda with -members of the WG. WG members can add any items they like to the -agenda at the beginning of each meeting. The moderator and the WG -cannot veto or remove items. - -The WG may invite persons or representatives from certain projects to -participate in a non-voting capacity. - -The moderator is responsible for summarizing the discussion of each -agenda item and sends it as a pull request after the meeting. - -### Consensus Seeking Process - -The WG follows a -[Consensus -Seeking](http://en.wikipedia.org/wiki/Consensus-seeking_decision-making) -decision-making model. - -When an agenda item has appeared to reach a consensus the moderator -will ask "Does anyone object?" as a final call for dissent from the -consensus. - -If an agenda item cannot reach a consensus a WG member can call for -either a closing vote or a vote to table the issue to the next -meeting. The call for a vote must be seconded by a majority of the WG -or else the discussion will continue. Simple majority wins. - -Note that changes to WG membership require a majority consensus. See -"WG Membership" above. diff --git a/deps/npm/node_modules/through2/node_modules/readable-stream/LICENSE b/deps/npm/node_modules/through2/node_modules/readable-stream/LICENSE deleted file mode 100644 index 2873b3b2e59507..00000000000000 --- a/deps/npm/node_modules/through2/node_modules/readable-stream/LICENSE +++ /dev/null @@ -1,47 +0,0 @@ -Node.js is licensed for use as follows: - -""" -Copyright Node.js contributors. All rights reserved. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to -deal in the Software without restriction, including without limitation the -rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -sell copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -IN THE SOFTWARE. -""" - -This license applies to parts of Node.js originating from the -https://github.com/joyent/node repository: - -""" -Copyright Joyent, Inc. and other Node contributors. All rights reserved. -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to -deal in the Software without restriction, including without limitation the -rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -sell copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -IN THE SOFTWARE. -""" diff --git a/deps/npm/node_modules/through2/node_modules/readable-stream/README.md b/deps/npm/node_modules/through2/node_modules/readable-stream/README.md deleted file mode 100644 index 23fe3f3e3009a2..00000000000000 --- a/deps/npm/node_modules/through2/node_modules/readable-stream/README.md +++ /dev/null @@ -1,58 +0,0 @@ -# readable-stream - -***Node-core v8.11.1 streams for userland*** [![Build Status](https://travis-ci.org/nodejs/readable-stream.svg?branch=master)](https://travis-ci.org/nodejs/readable-stream) - - -[![NPM](https://nodei.co/npm/readable-stream.png?downloads=true&downloadRank=true)](https://nodei.co/npm/readable-stream/) -[![NPM](https://nodei.co/npm-dl/readable-stream.png?&months=6&height=3)](https://nodei.co/npm/readable-stream/) - - -[![Sauce Test Status](https://saucelabs.com/browser-matrix/readable-stream.svg)](https://saucelabs.com/u/readable-stream) - -```bash -npm install --save readable-stream -``` - -***Node-core streams for userland*** - -This package is a mirror of the Streams2 and Streams3 implementations in -Node-core. - -Full documentation may be found on the [Node.js website](https://nodejs.org/dist/v8.11.1/docs/api/stream.html). - -If you want to guarantee a stable streams base, regardless of what version of -Node you, or the users of your libraries are using, use **readable-stream** *only* and avoid the *"stream"* module in Node-core, for background see [this blogpost](http://r.va.gg/2014/06/why-i-dont-use-nodes-core-stream-module.html). - -As of version 2.0.0 **readable-stream** uses semantic versioning. - -# Streams Working Group - -`readable-stream` is maintained by the Streams Working Group, which -oversees the development and maintenance of the Streams API within -Node.js. The responsibilities of the Streams Working Group include: - -* Addressing stream issues on the Node.js issue tracker. -* Authoring and editing stream documentation within the Node.js project. -* Reviewing changes to stream subclasses within the Node.js project. -* Redirecting changes to streams from the Node.js project to this - project. -* Assisting in the implementation of stream providers within Node.js. -* Recommending versions of `readable-stream` to be included in Node.js. -* Messaging about the future of streams to give the community advance - notice of changes. - - -## Team Members - -* **Chris Dickinson** ([@chrisdickinson](https://github.com/chrisdickinson)) <christopher.s.dickinson@gmail.com> - - Release GPG key: 9554F04D7259F04124DE6B476D5A82AC7E37093B -* **Calvin Metcalf** ([@calvinmetcalf](https://github.com/calvinmetcalf)) <calvin.metcalf@gmail.com> - - Release GPG key: F3EF5F62A87FC27A22E643F714CE4FF5015AA242 -* **Rod Vagg** ([@rvagg](https://github.com/rvagg)) <rod@vagg.org> - - Release GPG key: DD8F2338BAE7501E3DD5AC78C273792F7D83545D -* **Sam Newman** ([@sonewman](https://github.com/sonewman)) <newmansam@outlook.com> -* **Mathias Buus** ([@mafintosh](https://github.com/mafintosh)) <mathiasbuus@gmail.com> -* **Domenic Denicola** ([@domenic](https://github.com/domenic)) <d@domenic.me> -* **Matteo Collina** ([@mcollina](https://github.com/mcollina)) <matteo.collina@gmail.com> - - Release GPG key: 3ABC01543F22DD2239285CDD818674489FBC127E -* **Irina Shestak** ([@lrlna](https://github.com/lrlna)) <shestak.irina@gmail.com> diff --git a/deps/npm/node_modules/through2/node_modules/readable-stream/doc/wg-meetings/2015-01-30.md b/deps/npm/node_modules/through2/node_modules/readable-stream/doc/wg-meetings/2015-01-30.md deleted file mode 100644 index 83275f192e4077..00000000000000 --- a/deps/npm/node_modules/through2/node_modules/readable-stream/doc/wg-meetings/2015-01-30.md +++ /dev/null @@ -1,60 +0,0 @@ -# streams WG Meeting 2015-01-30 - -## Links - -* **Google Hangouts Video**: http://www.youtube.com/watch?v=I9nDOSGfwZg -* **GitHub Issue**: https://github.com/iojs/readable-stream/issues/106 -* **Original Minutes Google Doc**: https://docs.google.com/document/d/17aTgLnjMXIrfjgNaTUnHQO7m3xgzHR2VXBTmi03Qii4/ - -## Agenda - -Extracted from https://github.com/iojs/readable-stream/labels/wg-agenda prior to meeting. - -* adopt a charter [#105](https://github.com/iojs/readable-stream/issues/105) -* release and versioning strategy [#101](https://github.com/iojs/readable-stream/issues/101) -* simpler stream creation [#102](https://github.com/iojs/readable-stream/issues/102) -* proposal: deprecate implicit flowing of streams [#99](https://github.com/iojs/readable-stream/issues/99) - -## Minutes - -### adopt a charter - -* group: +1's all around - -### What versioning scheme should be adopted? -* group: +1’s 3.0.0 -* domenic+group: pulling in patches from other sources where appropriate -* mikeal: version independently, suggesting versions for io.js -* mikeal+domenic: work with TC to notify in advance of changes -simpler stream creation - -### streamline creation of streams -* sam: streamline creation of streams -* domenic: nice simple solution posted - but, we lose the opportunity to change the model - may not be backwards incompatible (double check keys) - - **action item:** domenic will check - -### remove implicit flowing of streams on(‘data’) -* add isFlowing / isPaused -* mikeal: worrying that we’re documenting polyfill methods – confuses users -* domenic: more reflective API is probably good, with warning labels for users -* new section for mad scientists (reflective stream access) -* calvin: name the “third state” -* mikeal: maybe borrow the name from whatwg? -* domenic: we’re missing the “third state” -* consensus: kind of difficult to name the third state -* mikeal: figure out differences in states / compat -* mathias: always flow on data – eliminates third state - * explore what it breaks - -**action items:** -* ask isaac for ability to list packages by what public io.js APIs they use (esp. Stream) -* ask rod/build for infrastructure -* **chris**: explore the “flow on data” approach -* add isPaused/isFlowing -* add new docs section -* move isPaused to that section - - diff --git a/deps/npm/node_modules/through2/node_modules/readable-stream/duplex-browser.js b/deps/npm/node_modules/through2/node_modules/readable-stream/duplex-browser.js deleted file mode 100644 index f8b2db83dbe733..00000000000000 --- a/deps/npm/node_modules/through2/node_modules/readable-stream/duplex-browser.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./lib/_stream_duplex.js'); diff --git a/deps/npm/node_modules/through2/node_modules/readable-stream/duplex.js b/deps/npm/node_modules/through2/node_modules/readable-stream/duplex.js deleted file mode 100644 index 46924cbfdf5387..00000000000000 --- a/deps/npm/node_modules/through2/node_modules/readable-stream/duplex.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./readable').Duplex diff --git a/deps/npm/node_modules/through2/node_modules/readable-stream/lib/_stream_duplex.js b/deps/npm/node_modules/through2/node_modules/readable-stream/lib/_stream_duplex.js deleted file mode 100644 index a1ca813e5acbd8..00000000000000 --- a/deps/npm/node_modules/through2/node_modules/readable-stream/lib/_stream_duplex.js +++ /dev/null @@ -1,131 +0,0 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - -// a duplex stream is just a stream that is both readable and writable. -// Since JS doesn't have multiple prototypal inheritance, this class -// prototypally inherits from Readable, and then parasitically from -// Writable. - -'use strict'; - -/**/ - -var pna = require('process-nextick-args'); -/**/ - -/**/ -var objectKeys = Object.keys || function (obj) { - var keys = []; - for (var key in obj) { - keys.push(key); - }return keys; -}; -/**/ - -module.exports = Duplex; - -/**/ -var util = require('core-util-is'); -util.inherits = require('inherits'); -/**/ - -var Readable = require('./_stream_readable'); -var Writable = require('./_stream_writable'); - -util.inherits(Duplex, Readable); - -{ - // avoid scope creep, the keys array can then be collected - var keys = objectKeys(Writable.prototype); - for (var v = 0; v < keys.length; v++) { - var method = keys[v]; - if (!Duplex.prototype[method]) Duplex.prototype[method] = Writable.prototype[method]; - } -} - -function Duplex(options) { - if (!(this instanceof Duplex)) return new Duplex(options); - - Readable.call(this, options); - Writable.call(this, options); - - if (options && options.readable === false) this.readable = false; - - if (options && options.writable === false) this.writable = false; - - this.allowHalfOpen = true; - if (options && options.allowHalfOpen === false) this.allowHalfOpen = false; - - this.once('end', onend); -} - -Object.defineProperty(Duplex.prototype, 'writableHighWaterMark', { - // making it explicit this property is not enumerable - // because otherwise some prototype manipulation in - // userland will fail - enumerable: false, - get: function () { - return this._writableState.highWaterMark; - } -}); - -// the no-half-open enforcer -function onend() { - // if we allow half-open state, or if the writable side ended, - // then we're ok. - if (this.allowHalfOpen || this._writableState.ended) return; - - // no more data can be written. - // But allow more writes to happen in this tick. - pna.nextTick(onEndNT, this); -} - -function onEndNT(self) { - self.end(); -} - -Object.defineProperty(Duplex.prototype, 'destroyed', { - get: function () { - if (this._readableState === undefined || this._writableState === undefined) { - return false; - } - return this._readableState.destroyed && this._writableState.destroyed; - }, - set: function (value) { - // we ignore the value if the stream - // has not been initialized yet - if (this._readableState === undefined || this._writableState === undefined) { - return; - } - - // backward compatibility, the user is explicitly - // managing destroyed - this._readableState.destroyed = value; - this._writableState.destroyed = value; - } -}); - -Duplex.prototype._destroy = function (err, cb) { - this.push(null); - this.end(); - - pna.nextTick(cb, err); -}; \ No newline at end of file diff --git a/deps/npm/node_modules/through2/node_modules/readable-stream/lib/_stream_passthrough.js b/deps/npm/node_modules/through2/node_modules/readable-stream/lib/_stream_passthrough.js deleted file mode 100644 index a9c835884828d8..00000000000000 --- a/deps/npm/node_modules/through2/node_modules/readable-stream/lib/_stream_passthrough.js +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - -// a passthrough stream. -// basically just the most minimal sort of Transform stream. -// Every written chunk gets output as-is. - -'use strict'; - -module.exports = PassThrough; - -var Transform = require('./_stream_transform'); - -/**/ -var util = require('core-util-is'); -util.inherits = require('inherits'); -/**/ - -util.inherits(PassThrough, Transform); - -function PassThrough(options) { - if (!(this instanceof PassThrough)) return new PassThrough(options); - - Transform.call(this, options); -} - -PassThrough.prototype._transform = function (chunk, encoding, cb) { - cb(null, chunk); -}; \ No newline at end of file diff --git a/deps/npm/node_modules/through2/node_modules/readable-stream/lib/_stream_readable.js b/deps/npm/node_modules/through2/node_modules/readable-stream/lib/_stream_readable.js deleted file mode 100644 index bf34ac65e1108f..00000000000000 --- a/deps/npm/node_modules/through2/node_modules/readable-stream/lib/_stream_readable.js +++ /dev/null @@ -1,1019 +0,0 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - -'use strict'; - -/**/ - -var pna = require('process-nextick-args'); -/**/ - -module.exports = Readable; - -/**/ -var isArray = require('isarray'); -/**/ - -/**/ -var Duplex; -/**/ - -Readable.ReadableState = ReadableState; - -/**/ -var EE = require('events').EventEmitter; - -var EElistenerCount = function (emitter, type) { - return emitter.listeners(type).length; -}; -/**/ - -/**/ -var Stream = require('./internal/streams/stream'); -/**/ - -/**/ - -var Buffer = require('safe-buffer').Buffer; -var OurUint8Array = global.Uint8Array || function () {}; -function _uint8ArrayToBuffer(chunk) { - return Buffer.from(chunk); -} -function _isUint8Array(obj) { - return Buffer.isBuffer(obj) || obj instanceof OurUint8Array; -} - -/**/ - -/**/ -var util = require('core-util-is'); -util.inherits = require('inherits'); -/**/ - -/**/ -var debugUtil = require('util'); -var debug = void 0; -if (debugUtil && debugUtil.debuglog) { - debug = debugUtil.debuglog('stream'); -} else { - debug = function () {}; -} -/**/ - -var BufferList = require('./internal/streams/BufferList'); -var destroyImpl = require('./internal/streams/destroy'); -var StringDecoder; - -util.inherits(Readable, Stream); - -var kProxyEvents = ['error', 'close', 'destroy', 'pause', 'resume']; - -function prependListener(emitter, event, fn) { - // Sadly this is not cacheable as some libraries bundle their own - // event emitter implementation with them. - if (typeof emitter.prependListener === 'function') return emitter.prependListener(event, fn); - - // This is a hack to make sure that our error handler is attached before any - // userland ones. NEVER DO THIS. This is here only because this code needs - // to continue to work with older versions of Node.js that do not include - // the prependListener() method. The goal is to eventually remove this hack. - if (!emitter._events || !emitter._events[event]) emitter.on(event, fn);else if (isArray(emitter._events[event])) emitter._events[event].unshift(fn);else emitter._events[event] = [fn, emitter._events[event]]; -} - -function ReadableState(options, stream) { - Duplex = Duplex || require('./_stream_duplex'); - - options = options || {}; - - // Duplex streams are both readable and writable, but share - // the same options object. - // However, some cases require setting options to different - // values for the readable and the writable sides of the duplex stream. - // These options can be provided separately as readableXXX and writableXXX. - var isDuplex = stream instanceof Duplex; - - // object stream flag. Used to make read(n) ignore n and to - // make all the buffer merging and length checks go away - this.objectMode = !!options.objectMode; - - if (isDuplex) this.objectMode = this.objectMode || !!options.readableObjectMode; - - // the point at which it stops calling _read() to fill the buffer - // Note: 0 is a valid value, means "don't call _read preemptively ever" - var hwm = options.highWaterMark; - var readableHwm = options.readableHighWaterMark; - var defaultHwm = this.objectMode ? 16 : 16 * 1024; - - if (hwm || hwm === 0) this.highWaterMark = hwm;else if (isDuplex && (readableHwm || readableHwm === 0)) this.highWaterMark = readableHwm;else this.highWaterMark = defaultHwm; - - // cast to ints. - this.highWaterMark = Math.floor(this.highWaterMark); - - // A linked list is used to store data chunks instead of an array because the - // linked list can remove elements from the beginning faster than - // array.shift() - this.buffer = new BufferList(); - this.length = 0; - this.pipes = null; - this.pipesCount = 0; - this.flowing = null; - this.ended = false; - this.endEmitted = false; - this.reading = false; - - // a flag to be able to tell if the event 'readable'/'data' is emitted - // immediately, or on a later tick. We set this to true at first, because - // any actions that shouldn't happen until "later" should generally also - // not happen before the first read call. - this.sync = true; - - // whenever we return null, then we set a flag to say - // that we're awaiting a 'readable' event emission. - this.needReadable = false; - this.emittedReadable = false; - this.readableListening = false; - this.resumeScheduled = false; - - // has it been destroyed - this.destroyed = false; - - // Crypto is kind of old and crusty. Historically, its default string - // encoding is 'binary' so we have to make this configurable. - // Everything else in the universe uses 'utf8', though. - this.defaultEncoding = options.defaultEncoding || 'utf8'; - - // the number of writers that are awaiting a drain event in .pipe()s - this.awaitDrain = 0; - - // if true, a maybeReadMore has been scheduled - this.readingMore = false; - - this.decoder = null; - this.encoding = null; - if (options.encoding) { - if (!StringDecoder) StringDecoder = require('string_decoder/').StringDecoder; - this.decoder = new StringDecoder(options.encoding); - this.encoding = options.encoding; - } -} - -function Readable(options) { - Duplex = Duplex || require('./_stream_duplex'); - - if (!(this instanceof Readable)) return new Readable(options); - - this._readableState = new ReadableState(options, this); - - // legacy - this.readable = true; - - if (options) { - if (typeof options.read === 'function') this._read = options.read; - - if (typeof options.destroy === 'function') this._destroy = options.destroy; - } - - Stream.call(this); -} - -Object.defineProperty(Readable.prototype, 'destroyed', { - get: function () { - if (this._readableState === undefined) { - return false; - } - return this._readableState.destroyed; - }, - set: function (value) { - // we ignore the value if the stream - // has not been initialized yet - if (!this._readableState) { - return; - } - - // backward compatibility, the user is explicitly - // managing destroyed - this._readableState.destroyed = value; - } -}); - -Readable.prototype.destroy = destroyImpl.destroy; -Readable.prototype._undestroy = destroyImpl.undestroy; -Readable.prototype._destroy = function (err, cb) { - this.push(null); - cb(err); -}; - -// Manually shove something into the read() buffer. -// This returns true if the highWaterMark has not been hit yet, -// similar to how Writable.write() returns true if you should -// write() some more. -Readable.prototype.push = function (chunk, encoding) { - var state = this._readableState; - var skipChunkCheck; - - if (!state.objectMode) { - if (typeof chunk === 'string') { - encoding = encoding || state.defaultEncoding; - if (encoding !== state.encoding) { - chunk = Buffer.from(chunk, encoding); - encoding = ''; - } - skipChunkCheck = true; - } - } else { - skipChunkCheck = true; - } - - return readableAddChunk(this, chunk, encoding, false, skipChunkCheck); -}; - -// Unshift should *always* be something directly out of read() -Readable.prototype.unshift = function (chunk) { - return readableAddChunk(this, chunk, null, true, false); -}; - -function readableAddChunk(stream, chunk, encoding, addToFront, skipChunkCheck) { - var state = stream._readableState; - if (chunk === null) { - state.reading = false; - onEofChunk(stream, state); - } else { - var er; - if (!skipChunkCheck) er = chunkInvalid(state, chunk); - if (er) { - stream.emit('error', er); - } else if (state.objectMode || chunk && chunk.length > 0) { - if (typeof chunk !== 'string' && !state.objectMode && Object.getPrototypeOf(chunk) !== Buffer.prototype) { - chunk = _uint8ArrayToBuffer(chunk); - } - - if (addToFront) { - if (state.endEmitted) stream.emit('error', new Error('stream.unshift() after end event'));else addChunk(stream, state, chunk, true); - } else if (state.ended) { - stream.emit('error', new Error('stream.push() after EOF')); - } else { - state.reading = false; - if (state.decoder && !encoding) { - chunk = state.decoder.write(chunk); - if (state.objectMode || chunk.length !== 0) addChunk(stream, state, chunk, false);else maybeReadMore(stream, state); - } else { - addChunk(stream, state, chunk, false); - } - } - } else if (!addToFront) { - state.reading = false; - } - } - - return needMoreData(state); -} - -function addChunk(stream, state, chunk, addToFront) { - if (state.flowing && state.length === 0 && !state.sync) { - stream.emit('data', chunk); - stream.read(0); - } else { - // update the buffer info. - state.length += state.objectMode ? 1 : chunk.length; - if (addToFront) state.buffer.unshift(chunk);else state.buffer.push(chunk); - - if (state.needReadable) emitReadable(stream); - } - maybeReadMore(stream, state); -} - -function chunkInvalid(state, chunk) { - var er; - if (!_isUint8Array(chunk) && typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) { - er = new TypeError('Invalid non-string/buffer chunk'); - } - return er; -} - -// if it's past the high water mark, we can push in some more. -// Also, if we have no data yet, we can stand some -// more bytes. This is to work around cases where hwm=0, -// such as the repl. Also, if the push() triggered a -// readable event, and the user called read(largeNumber) such that -// needReadable was set, then we ought to push more, so that another -// 'readable' event will be triggered. -function needMoreData(state) { - return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0); -} - -Readable.prototype.isPaused = function () { - return this._readableState.flowing === false; -}; - -// backwards compatibility. -Readable.prototype.setEncoding = function (enc) { - if (!StringDecoder) StringDecoder = require('string_decoder/').StringDecoder; - this._readableState.decoder = new StringDecoder(enc); - this._readableState.encoding = enc; - return this; -}; - -// Don't raise the hwm > 8MB -var MAX_HWM = 0x800000; -function computeNewHighWaterMark(n) { - if (n >= MAX_HWM) { - n = MAX_HWM; - } else { - // Get the next highest power of 2 to prevent increasing hwm excessively in - // tiny amounts - n--; - n |= n >>> 1; - n |= n >>> 2; - n |= n >>> 4; - n |= n >>> 8; - n |= n >>> 16; - n++; - } - return n; -} - -// This function is designed to be inlinable, so please take care when making -// changes to the function body. -function howMuchToRead(n, state) { - if (n <= 0 || state.length === 0 && state.ended) return 0; - if (state.objectMode) return 1; - if (n !== n) { - // Only flow one buffer at a time - if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length; - } - // If we're asking for more than the current hwm, then raise the hwm. - if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n); - if (n <= state.length) return n; - // Don't have enough - if (!state.ended) { - state.needReadable = true; - return 0; - } - return state.length; -} - -// you can override either this method, or the async _read(n) below. -Readable.prototype.read = function (n) { - debug('read', n); - n = parseInt(n, 10); - var state = this._readableState; - var nOrig = n; - - if (n !== 0) state.emittedReadable = false; - - // if we're doing read(0) to trigger a readable event, but we - // already have a bunch of data in the buffer, then just trigger - // the 'readable' event and move on. - if (n === 0 && state.needReadable && (state.length >= state.highWaterMark || state.ended)) { - debug('read: emitReadable', state.length, state.ended); - if (state.length === 0 && state.ended) endReadable(this);else emitReadable(this); - return null; - } - - n = howMuchToRead(n, state); - - // if we've ended, and we're now clear, then finish it up. - if (n === 0 && state.ended) { - if (state.length === 0) endReadable(this); - return null; - } - - // All the actual chunk generation logic needs to be - // *below* the call to _read. The reason is that in certain - // synthetic stream cases, such as passthrough streams, _read - // may be a completely synchronous operation which may change - // the state of the read buffer, providing enough data when - // before there was *not* enough. - // - // So, the steps are: - // 1. Figure out what the state of things will be after we do - // a read from the buffer. - // - // 2. If that resulting state will trigger a _read, then call _read. - // Note that this may be asynchronous, or synchronous. Yes, it is - // deeply ugly to write APIs this way, but that still doesn't mean - // that the Readable class should behave improperly, as streams are - // designed to be sync/async agnostic. - // Take note if the _read call is sync or async (ie, if the read call - // has returned yet), so that we know whether or not it's safe to emit - // 'readable' etc. - // - // 3. Actually pull the requested chunks out of the buffer and return. - - // if we need a readable event, then we need to do some reading. - var doRead = state.needReadable; - debug('need readable', doRead); - - // if we currently have less than the highWaterMark, then also read some - if (state.length === 0 || state.length - n < state.highWaterMark) { - doRead = true; - debug('length less than watermark', doRead); - } - - // however, if we've ended, then there's no point, and if we're already - // reading, then it's unnecessary. - if (state.ended || state.reading) { - doRead = false; - debug('reading or ended', doRead); - } else if (doRead) { - debug('do read'); - state.reading = true; - state.sync = true; - // if the length is currently zero, then we *need* a readable event. - if (state.length === 0) state.needReadable = true; - // call internal read method - this._read(state.highWaterMark); - state.sync = false; - // If _read pushed data synchronously, then `reading` will be false, - // and we need to re-evaluate how much data we can return to the user. - if (!state.reading) n = howMuchToRead(nOrig, state); - } - - var ret; - if (n > 0) ret = fromList(n, state);else ret = null; - - if (ret === null) { - state.needReadable = true; - n = 0; - } else { - state.length -= n; - } - - if (state.length === 0) { - // If we have nothing in the buffer, then we want to know - // as soon as we *do* get something into the buffer. - if (!state.ended) state.needReadable = true; - - // If we tried to read() past the EOF, then emit end on the next tick. - if (nOrig !== n && state.ended) endReadable(this); - } - - if (ret !== null) this.emit('data', ret); - - return ret; -}; - -function onEofChunk(stream, state) { - if (state.ended) return; - if (state.decoder) { - var chunk = state.decoder.end(); - if (chunk && chunk.length) { - state.buffer.push(chunk); - state.length += state.objectMode ? 1 : chunk.length; - } - } - state.ended = true; - - // emit 'readable' now to make sure it gets picked up. - emitReadable(stream); -} - -// Don't emit readable right away in sync mode, because this can trigger -// another read() call => stack overflow. This way, it might trigger -// a nextTick recursion warning, but that's not so bad. -function emitReadable(stream) { - var state = stream._readableState; - state.needReadable = false; - if (!state.emittedReadable) { - debug('emitReadable', state.flowing); - state.emittedReadable = true; - if (state.sync) pna.nextTick(emitReadable_, stream);else emitReadable_(stream); - } -} - -function emitReadable_(stream) { - debug('emit readable'); - stream.emit('readable'); - flow(stream); -} - -// at this point, the user has presumably seen the 'readable' event, -// and called read() to consume some data. that may have triggered -// in turn another _read(n) call, in which case reading = true if -// it's in progress. -// However, if we're not ended, or reading, and the length < hwm, -// then go ahead and try to read some more preemptively. -function maybeReadMore(stream, state) { - if (!state.readingMore) { - state.readingMore = true; - pna.nextTick(maybeReadMore_, stream, state); - } -} - -function maybeReadMore_(stream, state) { - var len = state.length; - while (!state.reading && !state.flowing && !state.ended && state.length < state.highWaterMark) { - debug('maybeReadMore read 0'); - stream.read(0); - if (len === state.length) - // didn't get any data, stop spinning. - break;else len = state.length; - } - state.readingMore = false; -} - -// abstract method. to be overridden in specific implementation classes. -// call cb(er, data) where data is <= n in length. -// for virtual (non-string, non-buffer) streams, "length" is somewhat -// arbitrary, and perhaps not very meaningful. -Readable.prototype._read = function (n) { - this.emit('error', new Error('_read() is not implemented')); -}; - -Readable.prototype.pipe = function (dest, pipeOpts) { - var src = this; - var state = this._readableState; - - switch (state.pipesCount) { - case 0: - state.pipes = dest; - break; - case 1: - state.pipes = [state.pipes, dest]; - break; - default: - state.pipes.push(dest); - break; - } - state.pipesCount += 1; - debug('pipe count=%d opts=%j', state.pipesCount, pipeOpts); - - var doEnd = (!pipeOpts || pipeOpts.end !== false) && dest !== process.stdout && dest !== process.stderr; - - var endFn = doEnd ? onend : unpipe; - if (state.endEmitted) pna.nextTick(endFn);else src.once('end', endFn); - - dest.on('unpipe', onunpipe); - function onunpipe(readable, unpipeInfo) { - debug('onunpipe'); - if (readable === src) { - if (unpipeInfo && unpipeInfo.hasUnpiped === false) { - unpipeInfo.hasUnpiped = true; - cleanup(); - } - } - } - - function onend() { - debug('onend'); - dest.end(); - } - - // when the dest drains, it reduces the awaitDrain counter - // on the source. This would be more elegant with a .once() - // handler in flow(), but adding and removing repeatedly is - // too slow. - var ondrain = pipeOnDrain(src); - dest.on('drain', ondrain); - - var cleanedUp = false; - function cleanup() { - debug('cleanup'); - // cleanup event handlers once the pipe is broken - dest.removeListener('close', onclose); - dest.removeListener('finish', onfinish); - dest.removeListener('drain', ondrain); - dest.removeListener('error', onerror); - dest.removeListener('unpipe', onunpipe); - src.removeListener('end', onend); - src.removeListener('end', unpipe); - src.removeListener('data', ondata); - - cleanedUp = true; - - // if the reader is waiting for a drain event from this - // specific writer, then it would cause it to never start - // flowing again. - // So, if this is awaiting a drain, then we just call it now. - // If we don't know, then assume that we are waiting for one. - if (state.awaitDrain && (!dest._writableState || dest._writableState.needDrain)) ondrain(); - } - - // If the user pushes more data while we're writing to dest then we'll end up - // in ondata again. However, we only want to increase awaitDrain once because - // dest will only emit one 'drain' event for the multiple writes. - // => Introduce a guard on increasing awaitDrain. - var increasedAwaitDrain = false; - src.on('data', ondata); - function ondata(chunk) { - debug('ondata'); - increasedAwaitDrain = false; - var ret = dest.write(chunk); - if (false === ret && !increasedAwaitDrain) { - // If the user unpiped during `dest.write()`, it is possible - // to get stuck in a permanently paused state if that write - // also returned false. - // => Check whether `dest` is still a piping destination. - if ((state.pipesCount === 1 && state.pipes === dest || state.pipesCount > 1 && indexOf(state.pipes, dest) !== -1) && !cleanedUp) { - debug('false write response, pause', src._readableState.awaitDrain); - src._readableState.awaitDrain++; - increasedAwaitDrain = true; - } - src.pause(); - } - } - - // if the dest has an error, then stop piping into it. - // however, don't suppress the throwing behavior for this. - function onerror(er) { - debug('onerror', er); - unpipe(); - dest.removeListener('error', onerror); - if (EElistenerCount(dest, 'error') === 0) dest.emit('error', er); - } - - // Make sure our error handler is attached before userland ones. - prependListener(dest, 'error', onerror); - - // Both close and finish should trigger unpipe, but only once. - function onclose() { - dest.removeListener('finish', onfinish); - unpipe(); - } - dest.once('close', onclose); - function onfinish() { - debug('onfinish'); - dest.removeListener('close', onclose); - unpipe(); - } - dest.once('finish', onfinish); - - function unpipe() { - debug('unpipe'); - src.unpipe(dest); - } - - // tell the dest that it's being piped to - dest.emit('pipe', src); - - // start the flow if it hasn't been started already. - if (!state.flowing) { - debug('pipe resume'); - src.resume(); - } - - return dest; -}; - -function pipeOnDrain(src) { - return function () { - var state = src._readableState; - debug('pipeOnDrain', state.awaitDrain); - if (state.awaitDrain) state.awaitDrain--; - if (state.awaitDrain === 0 && EElistenerCount(src, 'data')) { - state.flowing = true; - flow(src); - } - }; -} - -Readable.prototype.unpipe = function (dest) { - var state = this._readableState; - var unpipeInfo = { hasUnpiped: false }; - - // if we're not piping anywhere, then do nothing. - if (state.pipesCount === 0) return this; - - // just one destination. most common case. - if (state.pipesCount === 1) { - // passed in one, but it's not the right one. - if (dest && dest !== state.pipes) return this; - - if (!dest) dest = state.pipes; - - // got a match. - state.pipes = null; - state.pipesCount = 0; - state.flowing = false; - if (dest) dest.emit('unpipe', this, unpipeInfo); - return this; - } - - // slow case. multiple pipe destinations. - - if (!dest) { - // remove all. - var dests = state.pipes; - var len = state.pipesCount; - state.pipes = null; - state.pipesCount = 0; - state.flowing = false; - - for (var i = 0; i < len; i++) { - dests[i].emit('unpipe', this, unpipeInfo); - }return this; - } - - // try to find the right one. - var index = indexOf(state.pipes, dest); - if (index === -1) return this; - - state.pipes.splice(index, 1); - state.pipesCount -= 1; - if (state.pipesCount === 1) state.pipes = state.pipes[0]; - - dest.emit('unpipe', this, unpipeInfo); - - return this; -}; - -// set up data events if they are asked for -// Ensure readable listeners eventually get something -Readable.prototype.on = function (ev, fn) { - var res = Stream.prototype.on.call(this, ev, fn); - - if (ev === 'data') { - // Start flowing on next tick if stream isn't explicitly paused - if (this._readableState.flowing !== false) this.resume(); - } else if (ev === 'readable') { - var state = this._readableState; - if (!state.endEmitted && !state.readableListening) { - state.readableListening = state.needReadable = true; - state.emittedReadable = false; - if (!state.reading) { - pna.nextTick(nReadingNextTick, this); - } else if (state.length) { - emitReadable(this); - } - } - } - - return res; -}; -Readable.prototype.addListener = Readable.prototype.on; - -function nReadingNextTick(self) { - debug('readable nexttick read 0'); - self.read(0); -} - -// pause() and resume() are remnants of the legacy readable stream API -// If the user uses them, then switch into old mode. -Readable.prototype.resume = function () { - var state = this._readableState; - if (!state.flowing) { - debug('resume'); - state.flowing = true; - resume(this, state); - } - return this; -}; - -function resume(stream, state) { - if (!state.resumeScheduled) { - state.resumeScheduled = true; - pna.nextTick(resume_, stream, state); - } -} - -function resume_(stream, state) { - if (!state.reading) { - debug('resume read 0'); - stream.read(0); - } - - state.resumeScheduled = false; - state.awaitDrain = 0; - stream.emit('resume'); - flow(stream); - if (state.flowing && !state.reading) stream.read(0); -} - -Readable.prototype.pause = function () { - debug('call pause flowing=%j', this._readableState.flowing); - if (false !== this._readableState.flowing) { - debug('pause'); - this._readableState.flowing = false; - this.emit('pause'); - } - return this; -}; - -function flow(stream) { - var state = stream._readableState; - debug('flow', state.flowing); - while (state.flowing && stream.read() !== null) {} -} - -// wrap an old-style stream as the async data source. -// This is *not* part of the readable stream interface. -// It is an ugly unfortunate mess of history. -Readable.prototype.wrap = function (stream) { - var _this = this; - - var state = this._readableState; - var paused = false; - - stream.on('end', function () { - debug('wrapped end'); - if (state.decoder && !state.ended) { - var chunk = state.decoder.end(); - if (chunk && chunk.length) _this.push(chunk); - } - - _this.push(null); - }); - - stream.on('data', function (chunk) { - debug('wrapped data'); - if (state.decoder) chunk = state.decoder.write(chunk); - - // don't skip over falsy values in objectMode - if (state.objectMode && (chunk === null || chunk === undefined)) return;else if (!state.objectMode && (!chunk || !chunk.length)) return; - - var ret = _this.push(chunk); - if (!ret) { - paused = true; - stream.pause(); - } - }); - - // proxy all the other methods. - // important when wrapping filters and duplexes. - for (var i in stream) { - if (this[i] === undefined && typeof stream[i] === 'function') { - this[i] = function (method) { - return function () { - return stream[method].apply(stream, arguments); - }; - }(i); - } - } - - // proxy certain important events. - for (var n = 0; n < kProxyEvents.length; n++) { - stream.on(kProxyEvents[n], this.emit.bind(this, kProxyEvents[n])); - } - - // when we try to consume some more bytes, simply unpause the - // underlying stream. - this._read = function (n) { - debug('wrapped _read', n); - if (paused) { - paused = false; - stream.resume(); - } - }; - - return this; -}; - -Object.defineProperty(Readable.prototype, 'readableHighWaterMark', { - // making it explicit this property is not enumerable - // because otherwise some prototype manipulation in - // userland will fail - enumerable: false, - get: function () { - return this._readableState.highWaterMark; - } -}); - -// exposed for testing purposes only. -Readable._fromList = fromList; - -// Pluck off n bytes from an array of buffers. -// Length is the combined lengths of all the buffers in the list. -// This function is designed to be inlinable, so please take care when making -// changes to the function body. -function fromList(n, state) { - // nothing buffered - if (state.length === 0) return null; - - var ret; - if (state.objectMode) ret = state.buffer.shift();else if (!n || n >= state.length) { - // read it all, truncate the list - if (state.decoder) ret = state.buffer.join('');else if (state.buffer.length === 1) ret = state.buffer.head.data;else ret = state.buffer.concat(state.length); - state.buffer.clear(); - } else { - // read part of list - ret = fromListPartial(n, state.buffer, state.decoder); - } - - return ret; -} - -// Extracts only enough buffered data to satisfy the amount requested. -// This function is designed to be inlinable, so please take care when making -// changes to the function body. -function fromListPartial(n, list, hasStrings) { - var ret; - if (n < list.head.data.length) { - // slice is the same for buffers and strings - ret = list.head.data.slice(0, n); - list.head.data = list.head.data.slice(n); - } else if (n === list.head.data.length) { - // first chunk is a perfect match - ret = list.shift(); - } else { - // result spans more than one buffer - ret = hasStrings ? copyFromBufferString(n, list) : copyFromBuffer(n, list); - } - return ret; -} - -// Copies a specified amount of characters from the list of buffered data -// chunks. -// This function is designed to be inlinable, so please take care when making -// changes to the function body. -function copyFromBufferString(n, list) { - var p = list.head; - var c = 1; - var ret = p.data; - n -= ret.length; - while (p = p.next) { - var str = p.data; - var nb = n > str.length ? str.length : n; - if (nb === str.length) ret += str;else ret += str.slice(0, n); - n -= nb; - if (n === 0) { - if (nb === str.length) { - ++c; - if (p.next) list.head = p.next;else list.head = list.tail = null; - } else { - list.head = p; - p.data = str.slice(nb); - } - break; - } - ++c; - } - list.length -= c; - return ret; -} - -// Copies a specified amount of bytes from the list of buffered data chunks. -// This function is designed to be inlinable, so please take care when making -// changes to the function body. -function copyFromBuffer(n, list) { - var ret = Buffer.allocUnsafe(n); - var p = list.head; - var c = 1; - p.data.copy(ret); - n -= p.data.length; - while (p = p.next) { - var buf = p.data; - var nb = n > buf.length ? buf.length : n; - buf.copy(ret, ret.length - n, 0, nb); - n -= nb; - if (n === 0) { - if (nb === buf.length) { - ++c; - if (p.next) list.head = p.next;else list.head = list.tail = null; - } else { - list.head = p; - p.data = buf.slice(nb); - } - break; - } - ++c; - } - list.length -= c; - return ret; -} - -function endReadable(stream) { - var state = stream._readableState; - - // If we get here before consuming all the bytes, then that is a - // bug in node. Should never happen. - if (state.length > 0) throw new Error('"endReadable()" called on non-empty stream'); - - if (!state.endEmitted) { - state.ended = true; - pna.nextTick(endReadableNT, state, stream); - } -} - -function endReadableNT(state, stream) { - // Check that we didn't get one last unshift. - if (!state.endEmitted && state.length === 0) { - state.endEmitted = true; - stream.readable = false; - stream.emit('end'); - } -} - -function indexOf(xs, x) { - for (var i = 0, l = xs.length; i < l; i++) { - if (xs[i] === x) return i; - } - return -1; -} \ No newline at end of file diff --git a/deps/npm/node_modules/through2/node_modules/readable-stream/lib/_stream_transform.js b/deps/npm/node_modules/through2/node_modules/readable-stream/lib/_stream_transform.js deleted file mode 100644 index 5d1f8b876d98c7..00000000000000 --- a/deps/npm/node_modules/through2/node_modules/readable-stream/lib/_stream_transform.js +++ /dev/null @@ -1,214 +0,0 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - -// a transform stream is a readable/writable stream where you do -// something with the data. Sometimes it's called a "filter", -// but that's not a great name for it, since that implies a thing where -// some bits pass through, and others are simply ignored. (That would -// be a valid example of a transform, of course.) -// -// While the output is causally related to the input, it's not a -// necessarily symmetric or synchronous transformation. For example, -// a zlib stream might take multiple plain-text writes(), and then -// emit a single compressed chunk some time in the future. -// -// Here's how this works: -// -// The Transform stream has all the aspects of the readable and writable -// stream classes. When you write(chunk), that calls _write(chunk,cb) -// internally, and returns false if there's a lot of pending writes -// buffered up. When you call read(), that calls _read(n) until -// there's enough pending readable data buffered up. -// -// In a transform stream, the written data is placed in a buffer. When -// _read(n) is called, it transforms the queued up data, calling the -// buffered _write cb's as it consumes chunks. If consuming a single -// written chunk would result in multiple output chunks, then the first -// outputted bit calls the readcb, and subsequent chunks just go into -// the read buffer, and will cause it to emit 'readable' if necessary. -// -// This way, back-pressure is actually determined by the reading side, -// since _read has to be called to start processing a new chunk. However, -// a pathological inflate type of transform can cause excessive buffering -// here. For example, imagine a stream where every byte of input is -// interpreted as an integer from 0-255, and then results in that many -// bytes of output. Writing the 4 bytes {ff,ff,ff,ff} would result in -// 1kb of data being output. In this case, you could write a very small -// amount of input, and end up with a very large amount of output. In -// such a pathological inflating mechanism, there'd be no way to tell -// the system to stop doing the transform. A single 4MB write could -// cause the system to run out of memory. -// -// However, even in such a pathological case, only a single written chunk -// would be consumed, and then the rest would wait (un-transformed) until -// the results of the previous transformed chunk were consumed. - -'use strict'; - -module.exports = Transform; - -var Duplex = require('./_stream_duplex'); - -/**/ -var util = require('core-util-is'); -util.inherits = require('inherits'); -/**/ - -util.inherits(Transform, Duplex); - -function afterTransform(er, data) { - var ts = this._transformState; - ts.transforming = false; - - var cb = ts.writecb; - - if (!cb) { - return this.emit('error', new Error('write callback called multiple times')); - } - - ts.writechunk = null; - ts.writecb = null; - - if (data != null) // single equals check for both `null` and `undefined` - this.push(data); - - cb(er); - - var rs = this._readableState; - rs.reading = false; - if (rs.needReadable || rs.length < rs.highWaterMark) { - this._read(rs.highWaterMark); - } -} - -function Transform(options) { - if (!(this instanceof Transform)) return new Transform(options); - - Duplex.call(this, options); - - this._transformState = { - afterTransform: afterTransform.bind(this), - needTransform: false, - transforming: false, - writecb: null, - writechunk: null, - writeencoding: null - }; - - // start out asking for a readable event once data is transformed. - this._readableState.needReadable = true; - - // we have implemented the _read method, and done the other things - // that Readable wants before the first _read call, so unset the - // sync guard flag. - this._readableState.sync = false; - - if (options) { - if (typeof options.transform === 'function') this._transform = options.transform; - - if (typeof options.flush === 'function') this._flush = options.flush; - } - - // When the writable side finishes, then flush out anything remaining. - this.on('prefinish', prefinish); -} - -function prefinish() { - var _this = this; - - if (typeof this._flush === 'function') { - this._flush(function (er, data) { - done(_this, er, data); - }); - } else { - done(this, null, null); - } -} - -Transform.prototype.push = function (chunk, encoding) { - this._transformState.needTransform = false; - return Duplex.prototype.push.call(this, chunk, encoding); -}; - -// This is the part where you do stuff! -// override this function in implementation classes. -// 'chunk' is an input chunk. -// -// Call `push(newChunk)` to pass along transformed output -// to the readable side. You may call 'push' zero or more times. -// -// Call `cb(err)` when you are done with this chunk. If you pass -// an error, then that'll put the hurt on the whole operation. If you -// never call cb(), then you'll never get another chunk. -Transform.prototype._transform = function (chunk, encoding, cb) { - throw new Error('_transform() is not implemented'); -}; - -Transform.prototype._write = function (chunk, encoding, cb) { - var ts = this._transformState; - ts.writecb = cb; - ts.writechunk = chunk; - ts.writeencoding = encoding; - if (!ts.transforming) { - var rs = this._readableState; - if (ts.needTransform || rs.needReadable || rs.length < rs.highWaterMark) this._read(rs.highWaterMark); - } -}; - -// Doesn't matter what the args are here. -// _transform does all the work. -// That we got here means that the readable side wants more data. -Transform.prototype._read = function (n) { - var ts = this._transformState; - - if (ts.writechunk !== null && ts.writecb && !ts.transforming) { - ts.transforming = true; - this._transform(ts.writechunk, ts.writeencoding, ts.afterTransform); - } else { - // mark that we need a transform, so that any data that comes in - // will get processed, now that we've asked for it. - ts.needTransform = true; - } -}; - -Transform.prototype._destroy = function (err, cb) { - var _this2 = this; - - Duplex.prototype._destroy.call(this, err, function (err2) { - cb(err2); - _this2.emit('close'); - }); -}; - -function done(stream, er, data) { - if (er) return stream.emit('error', er); - - if (data != null) // single equals check for both `null` and `undefined` - stream.push(data); - - // if there's nothing in the write buffer, then that means - // that nothing more will ever be provided - if (stream._writableState.length) throw new Error('Calling transform done when ws.length != 0'); - - if (stream._transformState.transforming) throw new Error('Calling transform done when still transforming'); - - return stream.push(null); -} \ No newline at end of file diff --git a/deps/npm/node_modules/through2/node_modules/readable-stream/lib/_stream_writable.js b/deps/npm/node_modules/through2/node_modules/readable-stream/lib/_stream_writable.js deleted file mode 100644 index b3f4e85a2f6e35..00000000000000 --- a/deps/npm/node_modules/through2/node_modules/readable-stream/lib/_stream_writable.js +++ /dev/null @@ -1,687 +0,0 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - -// A bit simpler than readable streams. -// Implement an async ._write(chunk, encoding, cb), and it'll handle all -// the drain event emission and buffering. - -'use strict'; - -/**/ - -var pna = require('process-nextick-args'); -/**/ - -module.exports = Writable; - -/* */ -function WriteReq(chunk, encoding, cb) { - this.chunk = chunk; - this.encoding = encoding; - this.callback = cb; - this.next = null; -} - -// It seems a linked list but it is not -// there will be only 2 of these for each stream -function CorkedRequest(state) { - var _this = this; - - this.next = null; - this.entry = null; - this.finish = function () { - onCorkedFinish(_this, state); - }; -} -/* */ - -/**/ -var asyncWrite = !process.browser && ['v0.10', 'v0.9.'].indexOf(process.version.slice(0, 5)) > -1 ? setImmediate : pna.nextTick; -/**/ - -/**/ -var Duplex; -/**/ - -Writable.WritableState = WritableState; - -/**/ -var util = require('core-util-is'); -util.inherits = require('inherits'); -/**/ - -/**/ -var internalUtil = { - deprecate: require('util-deprecate') -}; -/**/ - -/**/ -var Stream = require('./internal/streams/stream'); -/**/ - -/**/ - -var Buffer = require('safe-buffer').Buffer; -var OurUint8Array = global.Uint8Array || function () {}; -function _uint8ArrayToBuffer(chunk) { - return Buffer.from(chunk); -} -function _isUint8Array(obj) { - return Buffer.isBuffer(obj) || obj instanceof OurUint8Array; -} - -/**/ - -var destroyImpl = require('./internal/streams/destroy'); - -util.inherits(Writable, Stream); - -function nop() {} - -function WritableState(options, stream) { - Duplex = Duplex || require('./_stream_duplex'); - - options = options || {}; - - // Duplex streams are both readable and writable, but share - // the same options object. - // However, some cases require setting options to different - // values for the readable and the writable sides of the duplex stream. - // These options can be provided separately as readableXXX and writableXXX. - var isDuplex = stream instanceof Duplex; - - // object stream flag to indicate whether or not this stream - // contains buffers or objects. - this.objectMode = !!options.objectMode; - - if (isDuplex) this.objectMode = this.objectMode || !!options.writableObjectMode; - - // the point at which write() starts returning false - // Note: 0 is a valid value, means that we always return false if - // the entire buffer is not flushed immediately on write() - var hwm = options.highWaterMark; - var writableHwm = options.writableHighWaterMark; - var defaultHwm = this.objectMode ? 16 : 16 * 1024; - - if (hwm || hwm === 0) this.highWaterMark = hwm;else if (isDuplex && (writableHwm || writableHwm === 0)) this.highWaterMark = writableHwm;else this.highWaterMark = defaultHwm; - - // cast to ints. - this.highWaterMark = Math.floor(this.highWaterMark); - - // if _final has been called - this.finalCalled = false; - - // drain event flag. - this.needDrain = false; - // at the start of calling end() - this.ending = false; - // when end() has been called, and returned - this.ended = false; - // when 'finish' is emitted - this.finished = false; - - // has it been destroyed - this.destroyed = false; - - // should we decode strings into buffers before passing to _write? - // this is here so that some node-core streams can optimize string - // handling at a lower level. - var noDecode = options.decodeStrings === false; - this.decodeStrings = !noDecode; - - // Crypto is kind of old and crusty. Historically, its default string - // encoding is 'binary' so we have to make this configurable. - // Everything else in the universe uses 'utf8', though. - this.defaultEncoding = options.defaultEncoding || 'utf8'; - - // not an actual buffer we keep track of, but a measurement - // of how much we're waiting to get pushed to some underlying - // socket or file. - this.length = 0; - - // a flag to see when we're in the middle of a write. - this.writing = false; - - // when true all writes will be buffered until .uncork() call - this.corked = 0; - - // a flag to be able to tell if the onwrite cb is called immediately, - // or on a later tick. We set this to true at first, because any - // actions that shouldn't happen until "later" should generally also - // not happen before the first write call. - this.sync = true; - - // a flag to know if we're processing previously buffered items, which - // may call the _write() callback in the same tick, so that we don't - // end up in an overlapped onwrite situation. - this.bufferProcessing = false; - - // the callback that's passed to _write(chunk,cb) - this.onwrite = function (er) { - onwrite(stream, er); - }; - - // the callback that the user supplies to write(chunk,encoding,cb) - this.writecb = null; - - // the amount that is being written when _write is called. - this.writelen = 0; - - this.bufferedRequest = null; - this.lastBufferedRequest = null; - - // number of pending user-supplied write callbacks - // this must be 0 before 'finish' can be emitted - this.pendingcb = 0; - - // emit prefinish if the only thing we're waiting for is _write cbs - // This is relevant for synchronous Transform streams - this.prefinished = false; - - // True if the error was already emitted and should not be thrown again - this.errorEmitted = false; - - // count buffered requests - this.bufferedRequestCount = 0; - - // allocate the first CorkedRequest, there is always - // one allocated and free to use, and we maintain at most two - this.corkedRequestsFree = new CorkedRequest(this); -} - -WritableState.prototype.getBuffer = function getBuffer() { - var current = this.bufferedRequest; - var out = []; - while (current) { - out.push(current); - current = current.next; - } - return out; -}; - -(function () { - try { - Object.defineProperty(WritableState.prototype, 'buffer', { - get: internalUtil.deprecate(function () { - return this.getBuffer(); - }, '_writableState.buffer is deprecated. Use _writableState.getBuffer ' + 'instead.', 'DEP0003') - }); - } catch (_) {} -})(); - -// Test _writableState for inheritance to account for Duplex streams, -// whose prototype chain only points to Readable. -var realHasInstance; -if (typeof Symbol === 'function' && Symbol.hasInstance && typeof Function.prototype[Symbol.hasInstance] === 'function') { - realHasInstance = Function.prototype[Symbol.hasInstance]; - Object.defineProperty(Writable, Symbol.hasInstance, { - value: function (object) { - if (realHasInstance.call(this, object)) return true; - if (this !== Writable) return false; - - return object && object._writableState instanceof WritableState; - } - }); -} else { - realHasInstance = function (object) { - return object instanceof this; - }; -} - -function Writable(options) { - Duplex = Duplex || require('./_stream_duplex'); - - // Writable ctor is applied to Duplexes, too. - // `realHasInstance` is necessary because using plain `instanceof` - // would return false, as no `_writableState` property is attached. - - // Trying to use the custom `instanceof` for Writable here will also break the - // Node.js LazyTransform implementation, which has a non-trivial getter for - // `_writableState` that would lead to infinite recursion. - if (!realHasInstance.call(Writable, this) && !(this instanceof Duplex)) { - return new Writable(options); - } - - this._writableState = new WritableState(options, this); - - // legacy. - this.writable = true; - - if (options) { - if (typeof options.write === 'function') this._write = options.write; - - if (typeof options.writev === 'function') this._writev = options.writev; - - if (typeof options.destroy === 'function') this._destroy = options.destroy; - - if (typeof options.final === 'function') this._final = options.final; - } - - Stream.call(this); -} - -// Otherwise people can pipe Writable streams, which is just wrong. -Writable.prototype.pipe = function () { - this.emit('error', new Error('Cannot pipe, not readable')); -}; - -function writeAfterEnd(stream, cb) { - var er = new Error('write after end'); - // TODO: defer error events consistently everywhere, not just the cb - stream.emit('error', er); - pna.nextTick(cb, er); -} - -// Checks that a user-supplied chunk is valid, especially for the particular -// mode the stream is in. Currently this means that `null` is never accepted -// and undefined/non-string values are only allowed in object mode. -function validChunk(stream, state, chunk, cb) { - var valid = true; - var er = false; - - if (chunk === null) { - er = new TypeError('May not write null values to stream'); - } else if (typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) { - er = new TypeError('Invalid non-string/buffer chunk'); - } - if (er) { - stream.emit('error', er); - pna.nextTick(cb, er); - valid = false; - } - return valid; -} - -Writable.prototype.write = function (chunk, encoding, cb) { - var state = this._writableState; - var ret = false; - var isBuf = !state.objectMode && _isUint8Array(chunk); - - if (isBuf && !Buffer.isBuffer(chunk)) { - chunk = _uint8ArrayToBuffer(chunk); - } - - if (typeof encoding === 'function') { - cb = encoding; - encoding = null; - } - - if (isBuf) encoding = 'buffer';else if (!encoding) encoding = state.defaultEncoding; - - if (typeof cb !== 'function') cb = nop; - - if (state.ended) writeAfterEnd(this, cb);else if (isBuf || validChunk(this, state, chunk, cb)) { - state.pendingcb++; - ret = writeOrBuffer(this, state, isBuf, chunk, encoding, cb); - } - - return ret; -}; - -Writable.prototype.cork = function () { - var state = this._writableState; - - state.corked++; -}; - -Writable.prototype.uncork = function () { - var state = this._writableState; - - if (state.corked) { - state.corked--; - - if (!state.writing && !state.corked && !state.finished && !state.bufferProcessing && state.bufferedRequest) clearBuffer(this, state); - } -}; - -Writable.prototype.setDefaultEncoding = function setDefaultEncoding(encoding) { - // node::ParseEncoding() requires lower case. - if (typeof encoding === 'string') encoding = encoding.toLowerCase(); - if (!(['hex', 'utf8', 'utf-8', 'ascii', 'binary', 'base64', 'ucs2', 'ucs-2', 'utf16le', 'utf-16le', 'raw'].indexOf((encoding + '').toLowerCase()) > -1)) throw new TypeError('Unknown encoding: ' + encoding); - this._writableState.defaultEncoding = encoding; - return this; -}; - -function decodeChunk(state, chunk, encoding) { - if (!state.objectMode && state.decodeStrings !== false && typeof chunk === 'string') { - chunk = Buffer.from(chunk, encoding); - } - return chunk; -} - -Object.defineProperty(Writable.prototype, 'writableHighWaterMark', { - // making it explicit this property is not enumerable - // because otherwise some prototype manipulation in - // userland will fail - enumerable: false, - get: function () { - return this._writableState.highWaterMark; - } -}); - -// if we're already writing something, then just put this -// in the queue, and wait our turn. Otherwise, call _write -// If we return false, then we need a drain event, so set that flag. -function writeOrBuffer(stream, state, isBuf, chunk, encoding, cb) { - if (!isBuf) { - var newChunk = decodeChunk(state, chunk, encoding); - if (chunk !== newChunk) { - isBuf = true; - encoding = 'buffer'; - chunk = newChunk; - } - } - var len = state.objectMode ? 1 : chunk.length; - - state.length += len; - - var ret = state.length < state.highWaterMark; - // we must ensure that previous needDrain will not be reset to false. - if (!ret) state.needDrain = true; - - if (state.writing || state.corked) { - var last = state.lastBufferedRequest; - state.lastBufferedRequest = { - chunk: chunk, - encoding: encoding, - isBuf: isBuf, - callback: cb, - next: null - }; - if (last) { - last.next = state.lastBufferedRequest; - } else { - state.bufferedRequest = state.lastBufferedRequest; - } - state.bufferedRequestCount += 1; - } else { - doWrite(stream, state, false, len, chunk, encoding, cb); - } - - return ret; -} - -function doWrite(stream, state, writev, len, chunk, encoding, cb) { - state.writelen = len; - state.writecb = cb; - state.writing = true; - state.sync = true; - if (writev) stream._writev(chunk, state.onwrite);else stream._write(chunk, encoding, state.onwrite); - state.sync = false; -} - -function onwriteError(stream, state, sync, er, cb) { - --state.pendingcb; - - if (sync) { - // defer the callback if we are being called synchronously - // to avoid piling up things on the stack - pna.nextTick(cb, er); - // this can emit finish, and it will always happen - // after error - pna.nextTick(finishMaybe, stream, state); - stream._writableState.errorEmitted = true; - stream.emit('error', er); - } else { - // the caller expect this to happen before if - // it is async - cb(er); - stream._writableState.errorEmitted = true; - stream.emit('error', er); - // this can emit finish, but finish must - // always follow error - finishMaybe(stream, state); - } -} - -function onwriteStateUpdate(state) { - state.writing = false; - state.writecb = null; - state.length -= state.writelen; - state.writelen = 0; -} - -function onwrite(stream, er) { - var state = stream._writableState; - var sync = state.sync; - var cb = state.writecb; - - onwriteStateUpdate(state); - - if (er) onwriteError(stream, state, sync, er, cb);else { - // Check if we're actually ready to finish, but don't emit yet - var finished = needFinish(state); - - if (!finished && !state.corked && !state.bufferProcessing && state.bufferedRequest) { - clearBuffer(stream, state); - } - - if (sync) { - /**/ - asyncWrite(afterWrite, stream, state, finished, cb); - /**/ - } else { - afterWrite(stream, state, finished, cb); - } - } -} - -function afterWrite(stream, state, finished, cb) { - if (!finished) onwriteDrain(stream, state); - state.pendingcb--; - cb(); - finishMaybe(stream, state); -} - -// Must force callback to be called on nextTick, so that we don't -// emit 'drain' before the write() consumer gets the 'false' return -// value, and has a chance to attach a 'drain' listener. -function onwriteDrain(stream, state) { - if (state.length === 0 && state.needDrain) { - state.needDrain = false; - stream.emit('drain'); - } -} - -// if there's something in the buffer waiting, then process it -function clearBuffer(stream, state) { - state.bufferProcessing = true; - var entry = state.bufferedRequest; - - if (stream._writev && entry && entry.next) { - // Fast case, write everything using _writev() - var l = state.bufferedRequestCount; - var buffer = new Array(l); - var holder = state.corkedRequestsFree; - holder.entry = entry; - - var count = 0; - var allBuffers = true; - while (entry) { - buffer[count] = entry; - if (!entry.isBuf) allBuffers = false; - entry = entry.next; - count += 1; - } - buffer.allBuffers = allBuffers; - - doWrite(stream, state, true, state.length, buffer, '', holder.finish); - - // doWrite is almost always async, defer these to save a bit of time - // as the hot path ends with doWrite - state.pendingcb++; - state.lastBufferedRequest = null; - if (holder.next) { - state.corkedRequestsFree = holder.next; - holder.next = null; - } else { - state.corkedRequestsFree = new CorkedRequest(state); - } - state.bufferedRequestCount = 0; - } else { - // Slow case, write chunks one-by-one - while (entry) { - var chunk = entry.chunk; - var encoding = entry.encoding; - var cb = entry.callback; - var len = state.objectMode ? 1 : chunk.length; - - doWrite(stream, state, false, len, chunk, encoding, cb); - entry = entry.next; - state.bufferedRequestCount--; - // if we didn't call the onwrite immediately, then - // it means that we need to wait until it does. - // also, that means that the chunk and cb are currently - // being processed, so move the buffer counter past them. - if (state.writing) { - break; - } - } - - if (entry === null) state.lastBufferedRequest = null; - } - - state.bufferedRequest = entry; - state.bufferProcessing = false; -} - -Writable.prototype._write = function (chunk, encoding, cb) { - cb(new Error('_write() is not implemented')); -}; - -Writable.prototype._writev = null; - -Writable.prototype.end = function (chunk, encoding, cb) { - var state = this._writableState; - - if (typeof chunk === 'function') { - cb = chunk; - chunk = null; - encoding = null; - } else if (typeof encoding === 'function') { - cb = encoding; - encoding = null; - } - - if (chunk !== null && chunk !== undefined) this.write(chunk, encoding); - - // .end() fully uncorks - if (state.corked) { - state.corked = 1; - this.uncork(); - } - - // ignore unnecessary end() calls. - if (!state.ending && !state.finished) endWritable(this, state, cb); -}; - -function needFinish(state) { - return state.ending && state.length === 0 && state.bufferedRequest === null && !state.finished && !state.writing; -} -function callFinal(stream, state) { - stream._final(function (err) { - state.pendingcb--; - if (err) { - stream.emit('error', err); - } - state.prefinished = true; - stream.emit('prefinish'); - finishMaybe(stream, state); - }); -} -function prefinish(stream, state) { - if (!state.prefinished && !state.finalCalled) { - if (typeof stream._final === 'function') { - state.pendingcb++; - state.finalCalled = true; - pna.nextTick(callFinal, stream, state); - } else { - state.prefinished = true; - stream.emit('prefinish'); - } - } -} - -function finishMaybe(stream, state) { - var need = needFinish(state); - if (need) { - prefinish(stream, state); - if (state.pendingcb === 0) { - state.finished = true; - stream.emit('finish'); - } - } - return need; -} - -function endWritable(stream, state, cb) { - state.ending = true; - finishMaybe(stream, state); - if (cb) { - if (state.finished) pna.nextTick(cb);else stream.once('finish', cb); - } - state.ended = true; - stream.writable = false; -} - -function onCorkedFinish(corkReq, state, err) { - var entry = corkReq.entry; - corkReq.entry = null; - while (entry) { - var cb = entry.callback; - state.pendingcb--; - cb(err); - entry = entry.next; - } - if (state.corkedRequestsFree) { - state.corkedRequestsFree.next = corkReq; - } else { - state.corkedRequestsFree = corkReq; - } -} - -Object.defineProperty(Writable.prototype, 'destroyed', { - get: function () { - if (this._writableState === undefined) { - return false; - } - return this._writableState.destroyed; - }, - set: function (value) { - // we ignore the value if the stream - // has not been initialized yet - if (!this._writableState) { - return; - } - - // backward compatibility, the user is explicitly - // managing destroyed - this._writableState.destroyed = value; - } -}); - -Writable.prototype.destroy = destroyImpl.destroy; -Writable.prototype._undestroy = destroyImpl.undestroy; -Writable.prototype._destroy = function (err, cb) { - this.end(); - cb(err); -}; \ No newline at end of file diff --git a/deps/npm/node_modules/through2/node_modules/readable-stream/lib/internal/streams/BufferList.js b/deps/npm/node_modules/through2/node_modules/readable-stream/lib/internal/streams/BufferList.js deleted file mode 100644 index aefc68bd90b9c2..00000000000000 --- a/deps/npm/node_modules/through2/node_modules/readable-stream/lib/internal/streams/BufferList.js +++ /dev/null @@ -1,79 +0,0 @@ -'use strict'; - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -var Buffer = require('safe-buffer').Buffer; -var util = require('util'); - -function copyBuffer(src, target, offset) { - src.copy(target, offset); -} - -module.exports = function () { - function BufferList() { - _classCallCheck(this, BufferList); - - this.head = null; - this.tail = null; - this.length = 0; - } - - BufferList.prototype.push = function push(v) { - var entry = { data: v, next: null }; - if (this.length > 0) this.tail.next = entry;else this.head = entry; - this.tail = entry; - ++this.length; - }; - - BufferList.prototype.unshift = function unshift(v) { - var entry = { data: v, next: this.head }; - if (this.length === 0) this.tail = entry; - this.head = entry; - ++this.length; - }; - - BufferList.prototype.shift = function shift() { - if (this.length === 0) return; - var ret = this.head.data; - if (this.length === 1) this.head = this.tail = null;else this.head = this.head.next; - --this.length; - return ret; - }; - - BufferList.prototype.clear = function clear() { - this.head = this.tail = null; - this.length = 0; - }; - - BufferList.prototype.join = function join(s) { - if (this.length === 0) return ''; - var p = this.head; - var ret = '' + p.data; - while (p = p.next) { - ret += s + p.data; - }return ret; - }; - - BufferList.prototype.concat = function concat(n) { - if (this.length === 0) return Buffer.alloc(0); - if (this.length === 1) return this.head.data; - var ret = Buffer.allocUnsafe(n >>> 0); - var p = this.head; - var i = 0; - while (p) { - copyBuffer(p.data, ret, i); - i += p.data.length; - p = p.next; - } - return ret; - }; - - return BufferList; -}(); - -if (util && util.inspect && util.inspect.custom) { - module.exports.prototype[util.inspect.custom] = function () { - var obj = util.inspect({ length: this.length }); - return this.constructor.name + ' ' + obj; - }; -} \ No newline at end of file diff --git a/deps/npm/node_modules/through2/node_modules/readable-stream/lib/internal/streams/destroy.js b/deps/npm/node_modules/through2/node_modules/readable-stream/lib/internal/streams/destroy.js deleted file mode 100644 index 5a0a0d88cec6f3..00000000000000 --- a/deps/npm/node_modules/through2/node_modules/readable-stream/lib/internal/streams/destroy.js +++ /dev/null @@ -1,74 +0,0 @@ -'use strict'; - -/**/ - -var pna = require('process-nextick-args'); -/**/ - -// undocumented cb() API, needed for core, not for public API -function destroy(err, cb) { - var _this = this; - - var readableDestroyed = this._readableState && this._readableState.destroyed; - var writableDestroyed = this._writableState && this._writableState.destroyed; - - if (readableDestroyed || writableDestroyed) { - if (cb) { - cb(err); - } else if (err && (!this._writableState || !this._writableState.errorEmitted)) { - pna.nextTick(emitErrorNT, this, err); - } - return this; - } - - // we set destroyed to true before firing error callbacks in order - // to make it re-entrance safe in case destroy() is called within callbacks - - if (this._readableState) { - this._readableState.destroyed = true; - } - - // if this is a duplex stream mark the writable part as destroyed as well - if (this._writableState) { - this._writableState.destroyed = true; - } - - this._destroy(err || null, function (err) { - if (!cb && err) { - pna.nextTick(emitErrorNT, _this, err); - if (_this._writableState) { - _this._writableState.errorEmitted = true; - } - } else if (cb) { - cb(err); - } - }); - - return this; -} - -function undestroy() { - if (this._readableState) { - this._readableState.destroyed = false; - this._readableState.reading = false; - this._readableState.ended = false; - this._readableState.endEmitted = false; - } - - if (this._writableState) { - this._writableState.destroyed = false; - this._writableState.ended = false; - this._writableState.ending = false; - this._writableState.finished = false; - this._writableState.errorEmitted = false; - } -} - -function emitErrorNT(self, err) { - self.emit('error', err); -} - -module.exports = { - destroy: destroy, - undestroy: undestroy -}; \ No newline at end of file diff --git a/deps/npm/node_modules/through2/node_modules/readable-stream/lib/internal/streams/stream-browser.js b/deps/npm/node_modules/through2/node_modules/readable-stream/lib/internal/streams/stream-browser.js deleted file mode 100644 index 9332a3fdae7060..00000000000000 --- a/deps/npm/node_modules/through2/node_modules/readable-stream/lib/internal/streams/stream-browser.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('events').EventEmitter; diff --git a/deps/npm/node_modules/through2/node_modules/readable-stream/lib/internal/streams/stream.js b/deps/npm/node_modules/through2/node_modules/readable-stream/lib/internal/streams/stream.js deleted file mode 100644 index ce2ad5b6ee57f4..00000000000000 --- a/deps/npm/node_modules/through2/node_modules/readable-stream/lib/internal/streams/stream.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('stream'); diff --git a/deps/npm/node_modules/through2/node_modules/readable-stream/package.json b/deps/npm/node_modules/through2/node_modules/readable-stream/package.json deleted file mode 100644 index d97bcfa712aecc..00000000000000 --- a/deps/npm/node_modules/through2/node_modules/readable-stream/package.json +++ /dev/null @@ -1,81 +0,0 @@ -{ - "_from": "readable-stream@^2.1.5", - "_id": "readable-stream@2.3.6", - "_inBundle": false, - "_integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", - "_location": "/through2/readable-stream", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "readable-stream@^2.1.5", - "name": "readable-stream", - "escapedName": "readable-stream", - "rawSpec": "^2.1.5", - "saveSpec": null, - "fetchSpec": "^2.1.5" - }, - "_requiredBy": [ - "/through2" - ], - "_resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", - "_shasum": "b11c27d88b8ff1fbe070643cf94b0c79ae1b0aaf", - "_spec": "readable-stream@^2.1.5", - "_where": "/Users/aeschright/code/cli/node_modules/through2", - "browser": { - "util": false, - "./readable.js": "./readable-browser.js", - "./writable.js": "./writable-browser.js", - "./duplex.js": "./duplex-browser.js", - "./lib/internal/streams/stream.js": "./lib/internal/streams/stream-browser.js" - }, - "bugs": { - "url": "https://github.com/nodejs/readable-stream/issues" - }, - "bundleDependencies": false, - "dependencies": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - }, - "deprecated": false, - "description": "Streams3, a user-land copy of the stream library from Node.js", - "devDependencies": { - "assert": "^1.4.0", - "babel-polyfill": "^6.9.1", - "buffer": "^4.9.0", - "lolex": "^2.3.2", - "nyc": "^6.4.0", - "tap": "^0.7.0", - "tape": "^4.8.0" - }, - "homepage": "https://github.com/nodejs/readable-stream#readme", - "keywords": [ - "readable", - "stream", - "pipe" - ], - "license": "MIT", - "main": "readable.js", - "name": "readable-stream", - "nyc": { - "include": [ - "lib/**.js" - ] - }, - "repository": { - "type": "git", - "url": "git://github.com/nodejs/readable-stream.git" - }, - "scripts": { - "ci": "tap test/parallel/*.js test/ours/*.js --tap | tee test.tap && node test/verify-dependencies.js", - "cover": "nyc npm test", - "report": "nyc report --reporter=lcov", - "test": "tap test/parallel/*.js test/ours/*.js && node test/verify-dependencies.js" - }, - "version": "2.3.6" -} diff --git a/deps/npm/node_modules/through2/node_modules/readable-stream/passthrough.js b/deps/npm/node_modules/through2/node_modules/readable-stream/passthrough.js deleted file mode 100644 index ffd791d7ff275a..00000000000000 --- a/deps/npm/node_modules/through2/node_modules/readable-stream/passthrough.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./readable').PassThrough diff --git a/deps/npm/node_modules/through2/node_modules/readable-stream/readable-browser.js b/deps/npm/node_modules/through2/node_modules/readable-stream/readable-browser.js deleted file mode 100644 index e50372592ee6c6..00000000000000 --- a/deps/npm/node_modules/through2/node_modules/readable-stream/readable-browser.js +++ /dev/null @@ -1,7 +0,0 @@ -exports = module.exports = require('./lib/_stream_readable.js'); -exports.Stream = exports; -exports.Readable = exports; -exports.Writable = require('./lib/_stream_writable.js'); -exports.Duplex = require('./lib/_stream_duplex.js'); -exports.Transform = require('./lib/_stream_transform.js'); -exports.PassThrough = require('./lib/_stream_passthrough.js'); diff --git a/deps/npm/node_modules/through2/node_modules/readable-stream/readable.js b/deps/npm/node_modules/through2/node_modules/readable-stream/readable.js deleted file mode 100644 index ec89ec53306497..00000000000000 --- a/deps/npm/node_modules/through2/node_modules/readable-stream/readable.js +++ /dev/null @@ -1,19 +0,0 @@ -var Stream = require('stream'); -if (process.env.READABLE_STREAM === 'disable' && Stream) { - module.exports = Stream; - exports = module.exports = Stream.Readable; - exports.Readable = Stream.Readable; - exports.Writable = Stream.Writable; - exports.Duplex = Stream.Duplex; - exports.Transform = Stream.Transform; - exports.PassThrough = Stream.PassThrough; - exports.Stream = Stream; -} else { - exports = module.exports = require('./lib/_stream_readable.js'); - exports.Stream = Stream || exports; - exports.Readable = exports; - exports.Writable = require('./lib/_stream_writable.js'); - exports.Duplex = require('./lib/_stream_duplex.js'); - exports.Transform = require('./lib/_stream_transform.js'); - exports.PassThrough = require('./lib/_stream_passthrough.js'); -} diff --git a/deps/npm/node_modules/through2/node_modules/readable-stream/transform.js b/deps/npm/node_modules/through2/node_modules/readable-stream/transform.js deleted file mode 100644 index b1baba26da03dc..00000000000000 --- a/deps/npm/node_modules/through2/node_modules/readable-stream/transform.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./readable').Transform diff --git a/deps/npm/node_modules/through2/node_modules/readable-stream/writable-browser.js b/deps/npm/node_modules/through2/node_modules/readable-stream/writable-browser.js deleted file mode 100644 index ebdde6a85dcb19..00000000000000 --- a/deps/npm/node_modules/through2/node_modules/readable-stream/writable-browser.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./lib/_stream_writable.js'); diff --git a/deps/npm/node_modules/through2/node_modules/readable-stream/writable.js b/deps/npm/node_modules/through2/node_modules/readable-stream/writable.js deleted file mode 100644 index 3211a6f80d1abc..00000000000000 --- a/deps/npm/node_modules/through2/node_modules/readable-stream/writable.js +++ /dev/null @@ -1,8 +0,0 @@ -var Stream = require("stream") -var Writable = require("./lib/_stream_writable.js") - -if (process.env.READABLE_STREAM === 'disable') { - module.exports = Stream && Stream.Writable || Writable -} else { - module.exports = Writable -} diff --git a/deps/npm/node_modules/through2/node_modules/string_decoder/.travis.yml b/deps/npm/node_modules/through2/node_modules/string_decoder/.travis.yml deleted file mode 100644 index 3347a725465058..00000000000000 --- a/deps/npm/node_modules/through2/node_modules/string_decoder/.travis.yml +++ /dev/null @@ -1,50 +0,0 @@ -sudo: false -language: node_js -before_install: - - npm install -g npm@2 - - test $NPM_LEGACY && npm install -g npm@latest-3 || npm install npm -g -notifications: - email: false -matrix: - fast_finish: true - include: - - node_js: '0.8' - env: - - TASK=test - - NPM_LEGACY=true - - node_js: '0.10' - env: - - TASK=test - - NPM_LEGACY=true - - node_js: '0.11' - env: - - TASK=test - - NPM_LEGACY=true - - node_js: '0.12' - env: - - TASK=test - - NPM_LEGACY=true - - node_js: 1 - env: - - TASK=test - - NPM_LEGACY=true - - node_js: 2 - env: - - TASK=test - - NPM_LEGACY=true - - node_js: 3 - env: - - TASK=test - - NPM_LEGACY=true - - node_js: 4 - env: TASK=test - - node_js: 5 - env: TASK=test - - node_js: 6 - env: TASK=test - - node_js: 7 - env: TASK=test - - node_js: 8 - env: TASK=test - - node_js: 9 - env: TASK=test diff --git a/deps/npm/node_modules/through2/node_modules/string_decoder/LICENSE b/deps/npm/node_modules/through2/node_modules/string_decoder/LICENSE deleted file mode 100644 index 778edb20730ef4..00000000000000 --- a/deps/npm/node_modules/through2/node_modules/string_decoder/LICENSE +++ /dev/null @@ -1,48 +0,0 @@ -Node.js is licensed for use as follows: - -""" -Copyright Node.js contributors. All rights reserved. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to -deal in the Software without restriction, including without limitation the -rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -sell copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -IN THE SOFTWARE. -""" - -This license applies to parts of Node.js originating from the -https://github.com/joyent/node repository: - -""" -Copyright Joyent, Inc. and other Node contributors. All rights reserved. -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to -deal in the Software without restriction, including without limitation the -rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -sell copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -IN THE SOFTWARE. -""" - diff --git a/deps/npm/node_modules/through2/node_modules/string_decoder/README.md b/deps/npm/node_modules/through2/node_modules/string_decoder/README.md deleted file mode 100644 index 5fd58315ed5880..00000000000000 --- a/deps/npm/node_modules/through2/node_modules/string_decoder/README.md +++ /dev/null @@ -1,47 +0,0 @@ -# string_decoder - -***Node-core v8.9.4 string_decoder for userland*** - - -[![NPM](https://nodei.co/npm/string_decoder.png?downloads=true&downloadRank=true)](https://nodei.co/npm/string_decoder/) -[![NPM](https://nodei.co/npm-dl/string_decoder.png?&months=6&height=3)](https://nodei.co/npm/string_decoder/) - - -```bash -npm install --save string_decoder -``` - -***Node-core string_decoder for userland*** - -This package is a mirror of the string_decoder implementation in Node-core. - -Full documentation may be found on the [Node.js website](https://nodejs.org/dist/v8.9.4/docs/api/). - -As of version 1.0.0 **string_decoder** uses semantic versioning. - -## Previous versions - -Previous version numbers match the versions found in Node core, e.g. 0.10.24 matches Node 0.10.24, likewise 0.11.10 matches Node 0.11.10. - -## Update - -The *build/* directory contains a build script that will scrape the source from the [nodejs/node](https://github.com/nodejs/node) repo given a specific Node version. - -## Streams Working Group - -`string_decoder` is maintained by the Streams Working Group, which -oversees the development and maintenance of the Streams API within -Node.js. The responsibilities of the Streams Working Group include: - -* Addressing stream issues on the Node.js issue tracker. -* Authoring and editing stream documentation within the Node.js project. -* Reviewing changes to stream subclasses within the Node.js project. -* Redirecting changes to streams from the Node.js project to this - project. -* Assisting in the implementation of stream providers within Node.js. -* Recommending versions of `readable-stream` to be included in Node.js. -* Messaging about the future of streams to give the community advance - notice of changes. - -See [readable-stream](https://github.com/nodejs/readable-stream) for -more details. diff --git a/deps/npm/node_modules/through2/node_modules/string_decoder/lib/string_decoder.js b/deps/npm/node_modules/through2/node_modules/string_decoder/lib/string_decoder.js deleted file mode 100644 index 2e89e63f7933e4..00000000000000 --- a/deps/npm/node_modules/through2/node_modules/string_decoder/lib/string_decoder.js +++ /dev/null @@ -1,296 +0,0 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - -'use strict'; - -/**/ - -var Buffer = require('safe-buffer').Buffer; -/**/ - -var isEncoding = Buffer.isEncoding || function (encoding) { - encoding = '' + encoding; - switch (encoding && encoding.toLowerCase()) { - case 'hex':case 'utf8':case 'utf-8':case 'ascii':case 'binary':case 'base64':case 'ucs2':case 'ucs-2':case 'utf16le':case 'utf-16le':case 'raw': - return true; - default: - return false; - } -}; - -function _normalizeEncoding(enc) { - if (!enc) return 'utf8'; - var retried; - while (true) { - switch (enc) { - case 'utf8': - case 'utf-8': - return 'utf8'; - case 'ucs2': - case 'ucs-2': - case 'utf16le': - case 'utf-16le': - return 'utf16le'; - case 'latin1': - case 'binary': - return 'latin1'; - case 'base64': - case 'ascii': - case 'hex': - return enc; - default: - if (retried) return; // undefined - enc = ('' + enc).toLowerCase(); - retried = true; - } - } -}; - -// Do not cache `Buffer.isEncoding` when checking encoding names as some -// modules monkey-patch it to support additional encodings -function normalizeEncoding(enc) { - var nenc = _normalizeEncoding(enc); - if (typeof nenc !== 'string' && (Buffer.isEncoding === isEncoding || !isEncoding(enc))) throw new Error('Unknown encoding: ' + enc); - return nenc || enc; -} - -// StringDecoder provides an interface for efficiently splitting a series of -// buffers into a series of JS strings without breaking apart multi-byte -// characters. -exports.StringDecoder = StringDecoder; -function StringDecoder(encoding) { - this.encoding = normalizeEncoding(encoding); - var nb; - switch (this.encoding) { - case 'utf16le': - this.text = utf16Text; - this.end = utf16End; - nb = 4; - break; - case 'utf8': - this.fillLast = utf8FillLast; - nb = 4; - break; - case 'base64': - this.text = base64Text; - this.end = base64End; - nb = 3; - break; - default: - this.write = simpleWrite; - this.end = simpleEnd; - return; - } - this.lastNeed = 0; - this.lastTotal = 0; - this.lastChar = Buffer.allocUnsafe(nb); -} - -StringDecoder.prototype.write = function (buf) { - if (buf.length === 0) return ''; - var r; - var i; - if (this.lastNeed) { - r = this.fillLast(buf); - if (r === undefined) return ''; - i = this.lastNeed; - this.lastNeed = 0; - } else { - i = 0; - } - if (i < buf.length) return r ? r + this.text(buf, i) : this.text(buf, i); - return r || ''; -}; - -StringDecoder.prototype.end = utf8End; - -// Returns only complete characters in a Buffer -StringDecoder.prototype.text = utf8Text; - -// Attempts to complete a partial non-UTF-8 character using bytes from a Buffer -StringDecoder.prototype.fillLast = function (buf) { - if (this.lastNeed <= buf.length) { - buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, this.lastNeed); - return this.lastChar.toString(this.encoding, 0, this.lastTotal); - } - buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, buf.length); - this.lastNeed -= buf.length; -}; - -// Checks the type of a UTF-8 byte, whether it's ASCII, a leading byte, or a -// continuation byte. If an invalid byte is detected, -2 is returned. -function utf8CheckByte(byte) { - if (byte <= 0x7F) return 0;else if (byte >> 5 === 0x06) return 2;else if (byte >> 4 === 0x0E) return 3;else if (byte >> 3 === 0x1E) return 4; - return byte >> 6 === 0x02 ? -1 : -2; -} - -// Checks at most 3 bytes at the end of a Buffer in order to detect an -// incomplete multi-byte UTF-8 character. The total number of bytes (2, 3, or 4) -// needed to complete the UTF-8 character (if applicable) are returned. -function utf8CheckIncomplete(self, buf, i) { - var j = buf.length - 1; - if (j < i) return 0; - var nb = utf8CheckByte(buf[j]); - if (nb >= 0) { - if (nb > 0) self.lastNeed = nb - 1; - return nb; - } - if (--j < i || nb === -2) return 0; - nb = utf8CheckByte(buf[j]); - if (nb >= 0) { - if (nb > 0) self.lastNeed = nb - 2; - return nb; - } - if (--j < i || nb === -2) return 0; - nb = utf8CheckByte(buf[j]); - if (nb >= 0) { - if (nb > 0) { - if (nb === 2) nb = 0;else self.lastNeed = nb - 3; - } - return nb; - } - return 0; -} - -// Validates as many continuation bytes for a multi-byte UTF-8 character as -// needed or are available. If we see a non-continuation byte where we expect -// one, we "replace" the validated continuation bytes we've seen so far with -// a single UTF-8 replacement character ('\ufffd'), to match v8's UTF-8 decoding -// behavior. The continuation byte check is included three times in the case -// where all of the continuation bytes for a character exist in the same buffer. -// It is also done this way as a slight performance increase instead of using a -// loop. -function utf8CheckExtraBytes(self, buf, p) { - if ((buf[0] & 0xC0) !== 0x80) { - self.lastNeed = 0; - return '\ufffd'; - } - if (self.lastNeed > 1 && buf.length > 1) { - if ((buf[1] & 0xC0) !== 0x80) { - self.lastNeed = 1; - return '\ufffd'; - } - if (self.lastNeed > 2 && buf.length > 2) { - if ((buf[2] & 0xC0) !== 0x80) { - self.lastNeed = 2; - return '\ufffd'; - } - } - } -} - -// Attempts to complete a multi-byte UTF-8 character using bytes from a Buffer. -function utf8FillLast(buf) { - var p = this.lastTotal - this.lastNeed; - var r = utf8CheckExtraBytes(this, buf, p); - if (r !== undefined) return r; - if (this.lastNeed <= buf.length) { - buf.copy(this.lastChar, p, 0, this.lastNeed); - return this.lastChar.toString(this.encoding, 0, this.lastTotal); - } - buf.copy(this.lastChar, p, 0, buf.length); - this.lastNeed -= buf.length; -} - -// Returns all complete UTF-8 characters in a Buffer. If the Buffer ended on a -// partial character, the character's bytes are buffered until the required -// number of bytes are available. -function utf8Text(buf, i) { - var total = utf8CheckIncomplete(this, buf, i); - if (!this.lastNeed) return buf.toString('utf8', i); - this.lastTotal = total; - var end = buf.length - (total - this.lastNeed); - buf.copy(this.lastChar, 0, end); - return buf.toString('utf8', i, end); -} - -// For UTF-8, a replacement character is added when ending on a partial -// character. -function utf8End(buf) { - var r = buf && buf.length ? this.write(buf) : ''; - if (this.lastNeed) return r + '\ufffd'; - return r; -} - -// UTF-16LE typically needs two bytes per character, but even if we have an even -// number of bytes available, we need to check if we end on a leading/high -// surrogate. In that case, we need to wait for the next two bytes in order to -// decode the last character properly. -function utf16Text(buf, i) { - if ((buf.length - i) % 2 === 0) { - var r = buf.toString('utf16le', i); - if (r) { - var c = r.charCodeAt(r.length - 1); - if (c >= 0xD800 && c <= 0xDBFF) { - this.lastNeed = 2; - this.lastTotal = 4; - this.lastChar[0] = buf[buf.length - 2]; - this.lastChar[1] = buf[buf.length - 1]; - return r.slice(0, -1); - } - } - return r; - } - this.lastNeed = 1; - this.lastTotal = 2; - this.lastChar[0] = buf[buf.length - 1]; - return buf.toString('utf16le', i, buf.length - 1); -} - -// For UTF-16LE we do not explicitly append special replacement characters if we -// end on a partial character, we simply let v8 handle that. -function utf16End(buf) { - var r = buf && buf.length ? this.write(buf) : ''; - if (this.lastNeed) { - var end = this.lastTotal - this.lastNeed; - return r + this.lastChar.toString('utf16le', 0, end); - } - return r; -} - -function base64Text(buf, i) { - var n = (buf.length - i) % 3; - if (n === 0) return buf.toString('base64', i); - this.lastNeed = 3 - n; - this.lastTotal = 3; - if (n === 1) { - this.lastChar[0] = buf[buf.length - 1]; - } else { - this.lastChar[0] = buf[buf.length - 2]; - this.lastChar[1] = buf[buf.length - 1]; - } - return buf.toString('base64', i, buf.length - n); -} - -function base64End(buf) { - var r = buf && buf.length ? this.write(buf) : ''; - if (this.lastNeed) return r + this.lastChar.toString('base64', 0, 3 - this.lastNeed); - return r; -} - -// Pass bytes on through for single-byte encodings (e.g. ascii, latin1, hex) -function simpleWrite(buf) { - return buf.toString(this.encoding); -} - -function simpleEnd(buf) { - return buf && buf.length ? this.write(buf) : ''; -} \ No newline at end of file diff --git a/deps/npm/node_modules/through2/node_modules/string_decoder/package.json b/deps/npm/node_modules/through2/node_modules/string_decoder/package.json deleted file mode 100644 index 617fff7d1226b4..00000000000000 --- a/deps/npm/node_modules/through2/node_modules/string_decoder/package.json +++ /dev/null @@ -1,59 +0,0 @@ -{ - "_from": "string_decoder@~1.1.1", - "_id": "string_decoder@1.1.1", - "_inBundle": false, - "_integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "_location": "/through2/string_decoder", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "string_decoder@~1.1.1", - "name": "string_decoder", - "escapedName": "string_decoder", - "rawSpec": "~1.1.1", - "saveSpec": null, - "fetchSpec": "~1.1.1" - }, - "_requiredBy": [ - "/through2/readable-stream" - ], - "_resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "_shasum": "9cf1611ba62685d7030ae9e4ba34149c3af03fc8", - "_spec": "string_decoder@~1.1.1", - "_where": "/Users/aeschright/code/cli/node_modules/through2/node_modules/readable-stream", - "bugs": { - "url": "https://github.com/nodejs/string_decoder/issues" - }, - "bundleDependencies": false, - "dependencies": { - "safe-buffer": "~5.1.0" - }, - "deprecated": false, - "description": "The string_decoder module from Node core", - "devDependencies": { - "babel-polyfill": "^6.23.0", - "core-util-is": "^1.0.2", - "inherits": "^2.0.3", - "tap": "~0.4.8" - }, - "homepage": "https://github.com/nodejs/string_decoder", - "keywords": [ - "string", - "decoder", - "browser", - "browserify" - ], - "license": "MIT", - "main": "lib/string_decoder.js", - "name": "string_decoder", - "repository": { - "type": "git", - "url": "git://github.com/nodejs/string_decoder.git" - }, - "scripts": { - "ci": "tap test/parallel/*.js test/ours/*.js --tap | tee test.tap && node test/verify-dependencies.js", - "test": "tap test/parallel/*.js && node test/verify-dependencies" - }, - "version": "1.1.1" -} diff --git a/deps/npm/node_modules/through2/package.json b/deps/npm/node_modules/through2/package.json deleted file mode 100644 index e33afc91d7aa94..00000000000000 --- a/deps/npm/node_modules/through2/package.json +++ /dev/null @@ -1,68 +0,0 @@ -{ - "_from": "through2@^2.0.0", - "_id": "through2@2.0.3", - "_inBundle": false, - "_integrity": "sha1-AARWmzfHx0ujnEPzzteNGtlBQL4=", - "_location": "/through2", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "through2@^2.0.0", - "name": "through2", - "escapedName": "through2", - "rawSpec": "^2.0.0", - "saveSpec": null, - "fetchSpec": "^2.0.0" - }, - "_requiredBy": [ - "/mississippi", - "/npm-profile/cacache/mississippi", - "/npm-profile/mississippi", - "/npm-registry-fetch/cacache/mississippi" - ], - "_resolved": "https://registry.npmjs.org/through2/-/through2-2.0.3.tgz", - "_shasum": "0004569b37c7c74ba39c43f3ced78d1ad94140be", - "_spec": "through2@^2.0.0", - "_where": "/Users/rebecca/code/npm/node_modules/mississippi", - "author": { - "name": "Rod Vagg", - "email": "r@va.gg", - "url": "https://github.com/rvagg" - }, - "bugs": { - "url": "https://github.com/rvagg/through2/issues" - }, - "bundleDependencies": false, - "dependencies": { - "readable-stream": "^2.1.5", - "xtend": "~4.0.1" - }, - "deprecated": false, - "description": "A tiny wrapper around Node streams2 Transform to avoid explicit subclassing noise", - "devDependencies": { - "bl": "~1.1.2", - "faucet": "0.0.1", - "stream-spigot": "~3.0.5", - "tape": "~4.6.2" - }, - "homepage": "https://github.com/rvagg/through2#readme", - "keywords": [ - "stream", - "streams2", - "through", - "transform" - ], - "license": "MIT", - "main": "through2.js", - "name": "through2", - "repository": { - "type": "git", - "url": "git+https://github.com/rvagg/through2.git" - }, - "scripts": { - "test": "node test/test.js | faucet", - "test-local": "brtapsauce-local test/basic-test.js" - }, - "version": "2.0.3" -} diff --git a/deps/npm/node_modules/through2/through2.js b/deps/npm/node_modules/through2/through2.js deleted file mode 100644 index 5b7a880e829a41..00000000000000 --- a/deps/npm/node_modules/through2/through2.js +++ /dev/null @@ -1,96 +0,0 @@ -var Transform = require('readable-stream/transform') - , inherits = require('util').inherits - , xtend = require('xtend') - -function DestroyableTransform(opts) { - Transform.call(this, opts) - this._destroyed = false -} - -inherits(DestroyableTransform, Transform) - -DestroyableTransform.prototype.destroy = function(err) { - if (this._destroyed) return - this._destroyed = true - - var self = this - process.nextTick(function() { - if (err) - self.emit('error', err) - self.emit('close') - }) -} - -// a noop _transform function -function noop (chunk, enc, callback) { - callback(null, chunk) -} - - -// create a new export function, used by both the main export and -// the .ctor export, contains common logic for dealing with arguments -function through2 (construct) { - return function (options, transform, flush) { - if (typeof options == 'function') { - flush = transform - transform = options - options = {} - } - - if (typeof transform != 'function') - transform = noop - - if (typeof flush != 'function') - flush = null - - return construct(options, transform, flush) - } -} - - -// main export, just make me a transform stream! -module.exports = through2(function (options, transform, flush) { - var t2 = new DestroyableTransform(options) - - t2._transform = transform - - if (flush) - t2._flush = flush - - return t2 -}) - - -// make me a reusable prototype that I can `new`, or implicitly `new` -// with a constructor call -module.exports.ctor = through2(function (options, transform, flush) { - function Through2 (override) { - if (!(this instanceof Through2)) - return new Through2(override) - - this.options = xtend(options, override) - - DestroyableTransform.call(this, this.options) - } - - inherits(Through2, DestroyableTransform) - - Through2.prototype._transform = transform - - if (flush) - Through2.prototype._flush = flush - - return Through2 -}) - - -module.exports.obj = through2(function (options, transform, flush) { - var t2 = new DestroyableTransform(xtend({ objectMode: true, highWaterMark: 16 }, options)) - - t2._transform = transform - - if (flush) - t2._flush = flush - - return t2 -}) diff --git a/deps/npm/node_modules/timed-out/index.js b/deps/npm/node_modules/timed-out/index.js deleted file mode 100644 index 94007a4aea5fe8..00000000000000 --- a/deps/npm/node_modules/timed-out/index.js +++ /dev/null @@ -1,55 +0,0 @@ -'use strict'; - -module.exports = function (req, time) { - if (req.timeoutTimer) { - return req; - } - - var delays = isNaN(time) ? time : {socket: time, connect: time}; - var host = req._headers ? (' to ' + req._headers.host) : ''; - - if (delays.connect !== undefined) { - req.timeoutTimer = setTimeout(function timeoutHandler() { - req.abort(); - var e = new Error('Connection timed out on request' + host); - e.code = 'ETIMEDOUT'; - req.emit('error', e); - }, delays.connect); - } - - // Clear the connection timeout timer once a socket is assigned to the - // request and is connected. - req.on('socket', function assign(socket) { - // Socket may come from Agent pool and may be already connected. - if (!(socket.connecting || socket._connecting)) { - connect(); - return; - } - - socket.once('connect', connect); - }); - - function clear() { - if (req.timeoutTimer) { - clearTimeout(req.timeoutTimer); - req.timeoutTimer = null; - } - } - - function connect() { - clear(); - - if (delays.socket !== undefined) { - // Abort the request if there is no activity on the socket for more - // than `delays.socket` milliseconds. - req.setTimeout(delays.socket, function socketTimeoutHandler() { - req.abort(); - var e = new Error('Socket timed out on request' + host); - e.code = 'ESOCKETTIMEDOUT'; - req.emit('error', e); - }); - } - } - - return req.on('error', clear); -}; diff --git a/deps/npm/node_modules/timed-out/license b/deps/npm/node_modules/timed-out/license deleted file mode 100644 index faadd5287506df..00000000000000 --- a/deps/npm/node_modules/timed-out/license +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) Vsevolod Strukchinsky - -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/timed-out/package.json b/deps/npm/node_modules/timed-out/package.json deleted file mode 100644 index 8823f1aa32e830..00000000000000 --- a/deps/npm/node_modules/timed-out/package.json +++ /dev/null @@ -1,68 +0,0 @@ -{ - "_from": "timed-out@^4.0.0", - "_id": "timed-out@4.0.1", - "_inBundle": false, - "_integrity": "sha1-8y6srFoXW+ol1/q1Zas+2HQe9W8=", - "_location": "/timed-out", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "timed-out@^4.0.0", - "name": "timed-out", - "escapedName": "timed-out", - "rawSpec": "^4.0.0", - "saveSpec": null, - "fetchSpec": "^4.0.0" - }, - "_requiredBy": [ - "/got" - ], - "_resolved": "https://registry.npmjs.org/timed-out/-/timed-out-4.0.1.tgz", - "_shasum": "f32eacac5a175bea25d7fab565ab3ed8741ef56f", - "_spec": "timed-out@^4.0.0", - "_where": "/Users/rebecca/code/npm/node_modules/got", - "author": { - "name": "Vsevolod Strukchinsky", - "email": "floatdrop@gmail.com" - }, - "bugs": { - "url": "https://github.com/floatdrop/timed-out/issues" - }, - "bundleDependencies": false, - "deprecated": false, - "description": "Emit `ETIMEDOUT` or `ESOCKETTIMEDOUT` when ClientRequest is hanged", - "devDependencies": { - "mocha": "*", - "xo": "^0.16.0" - }, - "engines": { - "node": ">=0.10.0" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/floatdrop/timed-out#readme", - "keywords": [ - "http", - "https", - "get", - "got", - "url", - "uri", - "request", - "util", - "utility", - "simple" - ], - "license": "MIT", - "name": "timed-out", - "repository": { - "type": "git", - "url": "git+https://github.com/floatdrop/timed-out.git" - }, - "scripts": { - "test": "xo && mocha" - }, - "version": "4.0.1" -} diff --git a/deps/npm/node_modules/timed-out/readme.md b/deps/npm/node_modules/timed-out/readme.md deleted file mode 100644 index fa0a0356507cf5..00000000000000 --- a/deps/npm/node_modules/timed-out/readme.md +++ /dev/null @@ -1,42 +0,0 @@ -# timed-out [![Build Status](https://travis-ci.org/floatdrop/timed-out.svg?branch=master)](https://travis-ci.org/floatdrop/timed-out) - -> Timeout HTTP/HTTPS requests - -Emit Error object with `code` property equal `ETIMEDOUT` or `ESOCKETTIMEDOUT` when ClientRequest is hanged. - -## Usage - -```js -var get = require('http').get; -var timeout = require('timed-out'); - -var req = get('http://www.google.ru'); -timeout(req, 2000); // Set 2 seconds limit -``` - -### API - -#### timedout(request, time) - -##### request - -*Required* -Type: [`ClientRequest`](http://nodejs.org/api/http.html#http_class_http_clientrequest) - -The request to watch on. - -##### time - -*Required* -Type: `number` or `object` - -Time in milliseconds to wait for `connect` event on socket and also time to wait on inactive socket. - -Or you can pass Object with following fields: - -- `connect` - time to wait for connection -- `socket` - time to wait for activity on socket - -## License - -MIT © [Vsevolod Strukchinsky](floatdrop@gmail.com) diff --git a/deps/npm/node_modules/tiny-relative-date/package.json b/deps/npm/node_modules/tiny-relative-date/package.json index 69346507080400..26c88147f9e69f 100644 --- a/deps/npm/node_modules/tiny-relative-date/package.json +++ b/deps/npm/node_modules/tiny-relative-date/package.json @@ -1,41 +1,27 @@ { - "_args": [ - [ - "tiny-relative-date@1.3.0", - "/Users/rebecca/code/npm" - ] - ], - "_from": "tiny-relative-date@1.3.0", - "_id": "tiny-relative-date@1.3.0", - "_inBundle": false, - "_integrity": "sha512-MOQHpzllWxDCHHaDno30hhLfbouoYlOI8YlMNtvKe1zXbjEVhbcEovQxvZrPvtiYW630GQDoMMarCnjfyfHA+A==", - "_location": "/tiny-relative-date", - "_phantomChildren": {}, - "_requested": { - "type": "version", - "registry": true, - "raw": "tiny-relative-date@1.3.0", - "name": "tiny-relative-date", - "escapedName": "tiny-relative-date", - "rawSpec": "1.3.0", - "saveSpec": null, - "fetchSpec": "1.3.0" + "name": "tiny-relative-date", + "version": "1.3.0", + "description": "Tiny function that provides relative, human-readable dates.", + "main": "lib/index.js", + "module": "src/index.js", + "scripts": { + "build": "babel src -d lib", + "test": "npm run eslint && npm run jasmine", + "eslint": "eslint --fix src/**/*.js", + "jasmine": "jasmine", + "prepublish": "npm run build" }, - "_requiredBy": [ - "/" + "files": [ + "lib/", + "src/", + "translations/" ], - "_resolved": "https://registry.npmjs.org/tiny-relative-date/-/tiny-relative-date-1.3.0.tgz", - "_spec": "1.3.0", - "_where": "/Users/rebecca/code/npm", - "author": { - "name": "Joseph Wynn", - "email": "joseph@wildlyinaccurate.com", - "url": "https://wildlyinaccurate.com/" - }, - "bugs": { - "url": "https://github.com/wildlyinaccurate/relative-date/issues" + "license": "MIT", + "author": "Joseph Wynn (https://wildlyinaccurate.com/)", + "repository": { + "type": "git", + "url": "https://github.com/wildlyinaccurate/relative-date.git" }, - "description": "Tiny function that provides relative, human-readable dates.", "devDependencies": { "babel-cli": "^6.24.1", "babel-plugin-add-module-exports": "^0.2.1", @@ -49,27 +35,5 @@ "eslint-plugin-standard": "^3.0.1", "jasmine": "^2.6.0", "jasmine-spec-reporter": "^4.1.1" - }, - "files": [ - "lib/", - "src/", - "translations/" - ], - "homepage": "https://github.com/wildlyinaccurate/relative-date#readme", - "license": "MIT", - "main": "lib/index.js", - "module": "src/index.js", - "name": "tiny-relative-date", - "repository": { - "type": "git", - "url": "git+https://github.com/wildlyinaccurate/relative-date.git" - }, - "scripts": { - "build": "babel src -d lib", - "eslint": "eslint --fix src/**/*.js", - "jasmine": "jasmine", - "prepublish": "npm run build", - "test": "npm run eslint && npm run jasmine" - }, - "version": "1.3.0" + } } diff --git a/deps/npm/node_modules/tough-cookie/README.md b/deps/npm/node_modules/tough-cookie/README.md index d28bd460da9734..656a25556c3c50 100644 --- a/deps/npm/node_modules/tough-cookie/README.md +++ b/deps/npm/node_modules/tough-cookie/README.md @@ -198,7 +198,7 @@ compute the TTL relative to `now` (milliseconds). The same precedence rules as The "number" `Infinity` is returned for cookies without an explicit expiry and `0` is returned if the cookie is expired. Otherwise a time-to-live in milliseconds is returned. -### `.canonicalizedDoman()` +### `.canonicalizedDomain()` ### `.cdomain()` @@ -354,6 +354,16 @@ The `store` argument is optional, but must be a _synchronous_ `Store` instance i The _source_ and _destination_ must both be synchronous `Store`s. If one or both stores are asynchronous, use `.clone` instead. Recall that `MemoryCookieStore` supports both synchronous and asynchronous API calls. +### `.removeAllCookies(cb(err))` + +Removes all cookies from the jar. + +This is a new backwards-compatible feature of `tough-cookie` version 2.5, so not all Stores will implement it efficiently. For Stores that do not implement `removeAllCookies`, the fallback is to call `removeCookie` after `getAllCookies`. If `getAllCookies` fails or isn't implemented in the Store, that error is returned. If one or more of the `removeCookie` calls fail, only the first error is returned. + +### `.removeAllCookiesSync()` + +Sync version of `.removeAllCookies()` + ## Store Base class for CookieJar stores. Available as `tough.Store`. @@ -418,19 +428,29 @@ Removes matching cookies from the store. The `path` parameter is optional, and Pass an error ONLY if removing any existing cookies failed. +### `store.removeAllCookies(cb(err))` + +_Optional_. Removes all cookies from the store. + +Pass an error if one or more cookies can't be removed. + +**Note**: New method as of `tough-cookie` version 2.5, so not all Stores will implement this, plus some stores may choose not to implement this. + ### `store.getAllCookies(cb(err, cookies))` -Produces an `Array` of all cookies during `jar.serialize()`. The items in the array can be true `Cookie` objects or generic `Object`s with the [Serialization Format] data structure. +_Optional_. Produces an `Array` of all cookies during `jar.serialize()`. The items in the array can be true `Cookie` objects or generic `Object`s with the [Serialization Format] data structure. Cookies SHOULD be returned in creation order to preserve sorting via `compareCookies()`. For reference, `MemoryCookieStore` will sort by `.creationIndex` since it uses true `Cookie` objects internally. If you don't return the cookies in creation order, they'll still be sorted by creation time, but this only has a precision of 1ms. See `compareCookies` for more detail. Pass an error if retrieval fails. +**Note**: not all Stores can implement this due to technical limitations, so it is optional. + ## MemoryCookieStore Inherits from `Store`. -A just-in-memory CookieJar synchronous store implementation, used by default. Despite being a synchronous implementation, it's usable with both the synchronous and asynchronous forms of the `CookieJar` API. +A just-in-memory CookieJar synchronous store implementation, used by default. Despite being a synchronous implementation, it's usable with both the synchronous and asynchronous forms of the `CookieJar` API. Supports serialization, `getAllCookies`, and `removeAllCookies`. ## Community Cookie Stores @@ -473,7 +493,7 @@ These are some Store implementations authored and maintained by the community. T # Copyright and License -(tl;dr: BSD-3-Clause with some MPL/2.0) +BSD-3-Clause: ```text Copyright (c) 2015, Salesforce.com, Inc. diff --git a/deps/npm/node_modules/tough-cookie/lib/cookie.js b/deps/npm/node_modules/tough-cookie/lib/cookie.js index 039a0e71f38123..32dc0f8dc7eed3 100644 --- a/deps/npm/node_modules/tough-cookie/lib/cookie.js +++ b/deps/npm/node_modules/tough-cookie/lib/cookie.js @@ -36,7 +36,7 @@ var pubsuffix = require('./pubsuffix-psl'); var Store = require('./store').Store; var MemoryCookieStore = require('./memstore').MemoryCookieStore; var pathMatch = require('./pathMatch').pathMatch; -var VERSION = require('../package.json').version; +var VERSION = require('./version'); var punycode; try { @@ -1371,7 +1371,6 @@ CookieJar.deserializeSync = function(strOrObj, store) { }; CookieJar.fromJSON = CookieJar.deserializeSync; -CAN_BE_SYNC.push('clone'); CookieJar.prototype.clone = function(newStore, cb) { if (arguments.length === 1) { cb = newStore; @@ -1382,10 +1381,61 @@ CookieJar.prototype.clone = function(newStore, cb) { if (err) { return cb(err); } - CookieJar.deserialize(newStore, serialized, cb); + CookieJar.deserialize(serialized, newStore, cb); }); }; +CAN_BE_SYNC.push('removeAllCookies'); +CookieJar.prototype.removeAllCookies = function(cb) { + var store = this.store; + + // Check that the store implements its own removeAllCookies(). The default + // implementation in Store will immediately call the callback with a "not + // implemented" Error. + if (store.removeAllCookies instanceof Function && + store.removeAllCookies !== Store.prototype.removeAllCookies) + { + return store.removeAllCookies(cb); + } + + store.getAllCookies(function(err, cookies) { + if (err) { + return cb(err); + } + + if (cookies.length === 0) { + return cb(null); + } + + var completedCount = 0; + var removeErrors = []; + + function removeCookieCb(removeErr) { + if (removeErr) { + removeErrors.push(removeErr); + } + + completedCount++; + + if (completedCount === cookies.length) { + return cb(removeErrors.length ? removeErrors[0] : null); + } + } + + cookies.forEach(function(cookie) { + store.removeCookie(cookie.domain, cookie.path, cookie.key, removeCookieCb); + }); + }); +}; + +CookieJar.prototype._cloneSync = syncWrap('clone'); +CookieJar.prototype.cloneSync = function(newStore) { + if (!newStore.synchronous) { + throw new Error('CookieJar clone destination store is not synchronous; use async API instead.'); + } + return this._cloneSync(newStore); +}; + // Use a closure to provide a true imperative API for synchronous stores. function syncWrap(method) { return function() { @@ -1413,6 +1463,7 @@ CAN_BE_SYNC.forEach(function(method) { CookieJar.prototype[method+'Sync'] = syncWrap(method); }); +exports.version = VERSION; exports.CookieJar = CookieJar; exports.Cookie = Cookie; exports.Store = Store; diff --git a/deps/npm/node_modules/tough-cookie/lib/memstore.js b/deps/npm/node_modules/tough-cookie/lib/memstore.js index bf306ba783b12f..d2b915c9359859 100644 --- a/deps/npm/node_modules/tough-cookie/lib/memstore.js +++ b/deps/npm/node_modules/tough-cookie/lib/memstore.js @@ -149,6 +149,11 @@ MemoryCookieStore.prototype.removeCookies = function(domain, path, cb) { return cb(null); }; +MemoryCookieStore.prototype.removeAllCookies = function(cb) { + this.idx = {}; + return cb(null); +} + MemoryCookieStore.prototype.getAllCookies = function(cb) { var cookies = []; var idx = this.idx; diff --git a/deps/npm/node_modules/tough-cookie/lib/store.js b/deps/npm/node_modules/tough-cookie/lib/store.js index bce52925db1cdd..859208fc952e0e 100644 --- a/deps/npm/node_modules/tough-cookie/lib/store.js +++ b/deps/npm/node_modules/tough-cookie/lib/store.js @@ -66,6 +66,10 @@ Store.prototype.removeCookies = function(domain, path, cb) { throw new Error('removeCookies is not implemented'); }; +Store.prototype.removeAllCookies = function(cb) { + throw new Error('removeAllCookies is not implemented'); +} + Store.prototype.getAllCookies = function(cb) { throw new Error('getAllCookies is not implemented (therefore jar cannot be serialized)'); }; diff --git a/deps/npm/node_modules/tough-cookie/lib/version.js b/deps/npm/node_modules/tough-cookie/lib/version.js new file mode 100644 index 00000000000000..b34c6ae50370fe --- /dev/null +++ b/deps/npm/node_modules/tough-cookie/lib/version.js @@ -0,0 +1,2 @@ +// generated by genversion +module.exports = '2.5.0' diff --git a/deps/npm/node_modules/tough-cookie/package.json b/deps/npm/node_modules/tough-cookie/package.json index 1e3e7c6364731d..8af9909ed5131e 100644 --- a/deps/npm/node_modules/tough-cookie/package.json +++ b/deps/npm/node_modules/tough-cookie/package.json @@ -1,74 +1,38 @@ { - "_from": "tough-cookie@~2.4.3", - "_id": "tough-cookie@2.4.3", - "_inBundle": false, - "_integrity": "sha512-Q5srk/4vDM54WJsJio3XNn6K2sCG+CQ8G5Wz6bZhRZoAe/+TxjWB/GlFAnYEbkYVlON9FMk/fE3h2RLpPXo4lQ==", - "_location": "/tough-cookie", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "tough-cookie@~2.4.3", - "name": "tough-cookie", - "escapedName": "tough-cookie", - "rawSpec": "~2.4.3", - "saveSpec": null, - "fetchSpec": "~2.4.3" - }, - "_requiredBy": [ - "/request" - ], - "_resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.4.3.tgz", - "_shasum": "53f36da3f47783b0925afa06ff9f3b165280f781", - "_spec": "tough-cookie@~2.4.3", - "_where": "/Users/zkat/Documents/code/work/npm/node_modules/request", "author": { "name": "Jeremy Stashewsky", - "email": "jstash@gmail.com" - }, - "bugs": { - "url": "https://github.com/salesforce/tough-cookie/issues" + "email": "jstash@gmail.com", + "website": "https://github.com/stash" }, - "bundleDependencies": false, "contributors": [ { - "name": "Alexander Savin" + "name": "Alexander Savin", + "website": "https://github.com/apsavin" }, { - "name": "Ian Livingstone" + "name": "Ian Livingstone", + "website": "https://github.com/ianlivingstone" }, { - "name": "Ivan Nikulin" + "name": "Ivan Nikulin", + "website": "https://github.com/inikulin" }, { - "name": "Lalit Kapoor" + "name": "Lalit Kapoor", + "website": "https://github.com/lalitkapoor" }, { - "name": "Sam Thompson" + "name": "Sam Thompson", + "website": "https://github.com/sambthompson" }, { - "name": "Sebastian Mayr" + "name": "Sebastian Mayr", + "website": "https://github.com/Sebmaster" } ], - "dependencies": { - "psl": "^1.1.24", - "punycode": "^1.4.1" - }, - "deprecated": false, + "license": "BSD-3-Clause", + "name": "tough-cookie", "description": "RFC6265 Cookies and Cookie Jar for node.js", - "devDependencies": { - "async": "^1.4.2", - "nyc": "^11.6.0", - "string.prototype.repeat": "^0.2.0", - "vows": "^0.8.1" - }, - "engines": { - "node": ">=0.8" - }, - "files": [ - "lib" - ], - "homepage": "https://github.com/salesforce/tough-cookie", "keywords": [ "HTTP", "cookie", @@ -79,16 +43,36 @@ "RFC6265", "RFC2965" ], - "license": "BSD-3-Clause", - "main": "./lib/cookie", - "name": "tough-cookie", + "version": "2.5.0", + "homepage": "https://github.com/salesforce/tough-cookie", "repository": { "type": "git", "url": "git://github.com/salesforce/tough-cookie.git" }, + "bugs": { + "url": "https://github.com/salesforce/tough-cookie/issues" + }, + "main": "./lib/cookie", + "files": [ + "lib" + ], "scripts": { - "cover": "nyc --reporter=lcov --reporter=html vows test/*_test.js", - "test": "vows test/*_test.js" + "version": "genversion lib/version.js && git add lib/version.js", + "test": "vows test/*_test.js", + "cover": "nyc --reporter=lcov --reporter=html vows test/*_test.js" + }, + "engines": { + "node": ">=0.8" + }, + "devDependencies": { + "async": "^1.4.2", + "genversion": "^2.1.0", + "nyc": "^11.6.0", + "string.prototype.repeat": "^0.2.0", + "vows": "^0.8.2" }, - "version": "2.4.3" + "dependencies": { + "psl": "^1.1.28", + "punycode": "^2.1.1" + } } diff --git a/deps/npm/node_modules/pacote/node_modules/minipass/LICENSE b/deps/npm/node_modules/treeverse/LICENSE similarity index 100% rename from deps/npm/node_modules/pacote/node_modules/minipass/LICENSE rename to deps/npm/node_modules/treeverse/LICENSE diff --git a/deps/npm/node_modules/treeverse/README.md b/deps/npm/node_modules/treeverse/README.md new file mode 100644 index 00000000000000..ce08381dae25b3 --- /dev/null +++ b/deps/npm/node_modules/treeverse/README.md @@ -0,0 +1,129 @@ +# treeverse + +Walk any kind of tree structure depth- or breadth-first. Supports promises +and advanced map-reduce operations with a very small API. + +Treeverse does not care what kind of tree it is, it will traverse it for +you just fine. It does the right thing with functions that return +Promises, and returns a non-Promise value if your functions don't return +Promises. + +Rather than imposing a specific structure, like requiring you to have child +nodes stored in a `children` array, it calls the supplied `getChildren()` +function, so the children can be anywhere (or not even exist yet!) This +makes it suitable for _creating_ an optimized tree from a set of dependency +manifests, for example. + +## USAGE + +```js +const {depth, breadth} = require('treeverse') + +// depth-first traversal +// returns a promise if any visit/leave function returns a promise +// otherwise returns the result of leave, or visit if no leave function +// provided. +depth({ + // the root node where we start the traversal + tree: rootNode, + + visit (node) { + // optional + // called upon descent into the node. + // return a promise, or a mapped value, or nothing to just leave it + // as-is + }, + leave (node, children) { + // optional + // called as we ascend back to the root of the tree. + // return a promise, or a reduced value, or nothing to leave it as is + // the children array is a list of the child nodes that have been + // visited (and potentially left) already. If the tree is acyclic, + // then leave() will have been called on all of them. If it has + // cycles, then the children may not have been left yet. + }, + getChildren (node, nodeResult) { + // required + // return an array of child nodes in the tree, if any exist + // returning a promise is totally ok, of course. + // the first argument is the original value of the node. The second + // argument is the result of visit(node). + }, + filter (node) { + // optional + // return true if the node should be visited, false otherwise + // initial tree is always visited, so this only filters children + // note that filtering a node _also_ filters all of its children. + }, +}) + +// breadth first traversal +// returns a promise if any visit function returns a promise +// otherwise returns the result of the top-level node. +// note that only a visit() function is supported here, since a node's +// children are typically traversed much later in the process. +breadth({ + // the root node where we start the traversal + tree: rootNode, + + visit (node) { + // optional, but a no-op if not provided. + // called when this node is encountered in the traversal. + // return a promise, or a mapped value, or nothing to leave as-is. + }, + getChildren (node, nodeResult) { + // required, same as depth() + }, + filter (node) { + // optional, same as depth() + }, +}) +``` + +## API + +Both functions take a single options object as an argument, and return +either the result value, or a Promise to the result value if the +methods in the options argument ever return a Promise. + +* `treeverse.breadth` - Perform a breadth-first traversal. That is, walk + across node siblings before traversing node children. +* `treeverse.depth` - Perform a depth-first traversal. That is, walk + down into child nodes before traversing siblings. + +## OPTIONS + +All function options can return a Promise or actual value. + +The return value is the result of the top level visit function if no leave +function is provided, or leave. If any method along the way returns a +promise, then the top level function will return a promise which resolves +to the result of visiting (and leaving) the top node in the tree. + +* `tree` - The initial node where the traversal begins. +* `visit(node)` - Function to call upon visiting a node. +* `leave(node, children)` - (Depth only) Function to call upon leaving a + node, once all of its children have been visited, and potentially left. + `children` is an array of child node visit results. If the graph is + cyclic, then some children _may_ have been visited but not left. +* `getChildren(node, nodeResult)` - Get an array of child nodes to process. +* `filter` - Filter out child nodes from the traversal. Note that this + filters the entire branch of the tree, not just that one node. That is, + children of filtered nodes are not traversed either. + +## STACK DEPTH WARNING + +When a `leave` method is specified, then recursion is used, because +maintaining state otherwise is challenging. This means that using `leave` +with a synchronous depth first traversal of very deeply nested trees will +result in stack overflow errors. + +To avoid this, either make one or more of the functions async, or do all of +the work in the `visit` method. + +Breadth-first traversal always uses a loop, and is stack-safe. + +It is _possible_ to implement depth first traversal with a leave method +using a loop rather than recursion, but maintaining the `leave(node, +[children])` API surface would be challenging, and is not implemented at +this time. diff --git a/deps/npm/node_modules/treeverse/index.js b/deps/npm/node_modules/treeverse/index.js new file mode 100644 index 00000000000000..ca0229e02c90fe --- /dev/null +++ b/deps/npm/node_modules/treeverse/index.js @@ -0,0 +1,4 @@ +module.exports = { + breadth: require('./lib/breadth.js'), + depth: require('./lib/depth.js'), +} diff --git a/deps/npm/node_modules/treeverse/lib/breadth.js b/deps/npm/node_modules/treeverse/lib/breadth.js new file mode 100644 index 00000000000000..56c02ec627c8ca --- /dev/null +++ b/deps/npm/node_modules/treeverse/lib/breadth.js @@ -0,0 +1,66 @@ +// Perform a breadth-first walk of a tree, either logical or physical +// This one only visits, it doesn't leave. That's because +// in a breadth-first traversal, children may be visited long +// after their parent, so the "exit" pass ends up being just +// another breadth-first walk. +// +// Breadth-first traversals are good for either creating a tree (ie, +// reifying a dep graph based on a package.json without a node_modules +// or package-lock), or mutating it in-place. For a map-reduce type of +// walk, it doesn't make a lot of sense, and is very expensive. +const breadth = ({ + visit, + filter = () => true, + getChildren, + tree, +}) => { + const queue = [] + const seen = new Map() + + const next = () => { + while (queue.length) { + const node = queue.shift() + const res = visitNode(node) + if (isPromise(res)) { + return res.then(() => next()) + } + } + return seen.get(tree) + } + + const visitNode = (tree) => { + if (seen.has(tree)) + return seen.get(tree) + + seen.set(tree, null) + const res = visit ? visit(tree) : tree + if (isPromise(res)) { + const fullResult = res.then(res => { + seen.set(tree, res) + return kidNodes(tree) + }) + seen.set(tree, fullResult) + return fullResult + } else { + seen.set(tree, res) + return kidNodes(tree) + } + } + + const kidNodes = (tree) => { + const kids = getChildren(tree, seen.get(tree)) + return isPromise(kids) ? kids.then(processKids) : processKids(kids) + } + + const processKids = (kids) => { + kids = (kids || []).filter(filter) + queue.push(...kids) + } + + queue.push(tree) + return next() +} + +const isPromise = p => p && typeof p.then === 'function' + +module.exports = breadth diff --git a/deps/npm/node_modules/treeverse/lib/depth-descent.js b/deps/npm/node_modules/treeverse/lib/depth-descent.js new file mode 100644 index 00000000000000..8ac3af014ebf9f --- /dev/null +++ b/deps/npm/node_modules/treeverse/lib/depth-descent.js @@ -0,0 +1,87 @@ +// Perform a depth-first walk of a tree, ONLY doing the descent (visit) +// +// This uses a stack rather than recursion, so that it can handle deeply +// nested trees without call stack overflows. (My kingdom for proper TCO!) +// +// This is only used for cases where leave() is not specified. +// +// a +// +-- b +// | +-- 1 +// | +-- 2 +// +-- c +// +-- 3 +// +-- 4 +// +// Expect: +// visit a +// visit b +// visit 1 +// visit 2 +// visit c +// visit 3 +// visit 4 +// +// stack.push(tree) +// while stack not empty +// pop T from stack +// VISIT(T) +// get children C of T +// push each C onto stack + +const depth = ({ + visit, + filter, + getChildren, + tree, +}) => { + const stack = [] + const seen = new Map() + + const next = () => { + while (stack.length) { + const node = stack.pop() + const res = visitNode(node) + if (isPromise(res)) { + return res.then(() => next()) + } + } + return seen.get(tree) + } + + const visitNode = (tree) => { + if (seen.has(tree)) + return seen.get(tree) + + seen.set(tree, null) + const res = visit ? visit(tree) : tree + if (isPromise(res)) { + const fullResult = res.then(res => { + seen.set(tree, res) + return kidNodes(tree) + }) + seen.set(tree, fullResult) + return fullResult + } else { + seen.set(tree, res) + return kidNodes(tree) + } + } + + const kidNodes = (tree) => { + const kids = getChildren(tree, seen.get(tree)) + return isPromise(kids) ? kids.then(processKids) : processKids(kids) + } + + const processKids = (kids) => { + kids = (kids || []).filter(filter) + stack.push(...kids) + } + + stack.push(tree) + return next() +} + +const isPromise = p => p && typeof p.then === 'function' + +module.exports = depth diff --git a/deps/npm/node_modules/treeverse/lib/depth.js b/deps/npm/node_modules/treeverse/lib/depth.js new file mode 100644 index 00000000000000..dbab1c28a2d151 --- /dev/null +++ b/deps/npm/node_modules/treeverse/lib/depth.js @@ -0,0 +1,74 @@ +// Perform a depth-first walk of a tree. +// +// `visit(node)` is called when the node is first encountered. +// `leave(node, children)` is called when all of the node's children +// have been left or (in the case of cyclic graphs) visited. +// +// Only one of visit or leave is required. (Technically both are optional, +// but if you don't provide at least one, the tree is just walked without +// doing anything, which is a bit pointless.) If visit is provided, and +// leave is not, then this is a root->leaf traversal. If leave is provided, +// and visit is not, then it's leaf->root. Both can be provided for a +// map-reduce operation. +// +// If either visit or leave return a Promise for any node, then the +// walk returns a Promise. + +const depthDescent = require('./depth-descent.js') +const depth = ({ + visit, + leave, + filter = () => true, + seen = new Map(), + getChildren, + tree, +}) => { + if (!leave) + return depthDescent({ visit, filter, getChildren, tree }) + + if (seen.has(tree)) + return seen.get(tree) + + seen.set(tree, null) + + const visitNode = () => { + const res = visit ? visit(tree) : tree + if (isPromise(res)) { + const fullResult = res.then(res => { + seen.set(tree, res) + return kidNodes() + }) + seen.set(tree, fullResult) + return fullResult + } else { + seen.set(tree, res) + return kidNodes() + } + } + + const kidNodes = () => { + const kids = getChildren(tree, seen.get(tree)) + return isPromise(kids) ? kids.then(processKids) : processKids(kids) + } + + const processKids = kidNodes => { + const kids = (kidNodes || []).filter(filter).map(kid => + depth({visit, leave, filter, seen, getChildren, tree: kid})) + return kids.some(isPromise) + ? Promise.all(kids).then(leaveNode) + : leaveNode(kids) + } + + const leaveNode = kids => { + const res = leave(seen.get(tree), kids) + seen.set(tree, res) + // if it's a promise at this point, the caller deals with it + return res + } + + return visitNode() +} + +const isPromise = p => p && typeof p.then === 'function' + +module.exports = depth diff --git a/deps/npm/node_modules/treeverse/package.json b/deps/npm/node_modules/treeverse/package.json new file mode 100644 index 00000000000000..337194cfde9708 --- /dev/null +++ b/deps/npm/node_modules/treeverse/package.json @@ -0,0 +1,37 @@ +{ + "name": "treeverse", + "version": "1.0.4", + "description": "Walk any kind of tree structure depth- or breadth-first. Supports promises and advanced map-reduce operations with a very small API.", + "author": "Isaac Z. Schlueter (https://izs.me)", + "license": "ISC", + "repository": { + "type": "git", + "url": "git+https://github.com/npm/treeverse.git" + }, + "scripts": { + "test": "tap", + "snap": "tap", + "preversion": "npm test", + "postversion": "npm publish", + "postpublish": "git push origin --follow-tags" + }, + "tap": { + "100": true, + "coverage-map": "map.js" + }, + "devDependencies": { + "tap": "^14.10.6", + "tcompare": "^2.3.0" + }, + "files": [ + "index.js", + "lib/" + ], + "main": "index.js", + "keywords": [ + "tree", + "traversal", + "depth first search", + "breadth first search" + ] +} diff --git a/deps/npm/node_modules/tunnel-agent/package.json b/deps/npm/node_modules/tunnel-agent/package.json index 3045d3378e07b4..a271fda91ae5f8 100644 --- a/deps/npm/node_modules/tunnel-agent/package.json +++ b/deps/npm/node_modules/tunnel-agent/package.json @@ -1,55 +1,22 @@ { - "_from": "tunnel-agent@^0.6.0", - "_id": "tunnel-agent@0.6.0", - "_inBundle": false, - "_integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=", - "_location": "/tunnel-agent", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "tunnel-agent@^0.6.0", - "name": "tunnel-agent", - "escapedName": "tunnel-agent", - "rawSpec": "^0.6.0", - "saveSpec": null, - "fetchSpec": "^0.6.0" + "author": "Mikeal Rogers (http://www.futurealoof.com)", + "name": "tunnel-agent", + "license": "Apache-2.0", + "description": "HTTP proxy tunneling agent. Formerly part of mikeal/request, now a standalone module.", + "version": "0.6.0", + "repository": { + "url": "https://github.com/mikeal/tunnel-agent" }, - "_requiredBy": [ - "/request" + "main": "index.js", + "files": [ + "index.js" ], - "_resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", - "_shasum": "27a5dea06b36b04a0a9966774b290868f0fc40fd", - "_spec": "tunnel-agent@^0.6.0", - "_where": "/Users/rebecca/code/npm/node_modules/request", - "author": { - "name": "Mikeal Rogers", - "email": "mikeal.rogers@gmail.com", - "url": "http://www.futurealoof.com" - }, - "bugs": { - "url": "https://github.com/mikeal/tunnel-agent/issues" - }, - "bundleDependencies": false, "dependencies": { "safe-buffer": "^5.0.1" }, - "deprecated": false, - "description": "HTTP proxy tunneling agent. Formerly part of mikeal/request, now a standalone module.", "devDependencies": {}, + "optionalDependencies": {}, "engines": { "node": "*" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/mikeal/tunnel-agent#readme", - "license": "Apache-2.0", - "main": "index.js", - "name": "tunnel-agent", - "optionalDependencies": {}, - "repository": { - "url": "git+https://github.com/mikeal/tunnel-agent.git" - }, - "version": "0.6.0" + } } diff --git a/deps/npm/node_modules/tweetnacl/package.json b/deps/npm/node_modules/tweetnacl/package.json index 9ba581ed075953..702e85b8089798 100644 --- a/deps/npm/node_modules/tweetnacl/package.json +++ b/deps/npm/node_modules/tweetnacl/package.json @@ -1,55 +1,26 @@ { - "_from": "tweetnacl@~0.14.0", - "_id": "tweetnacl@0.14.5", - "_inBundle": false, - "_integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=", - "_location": "/tweetnacl", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "tweetnacl@~0.14.0", - "name": "tweetnacl", - "escapedName": "tweetnacl", - "rawSpec": "~0.14.0", - "saveSpec": null, - "fetchSpec": "~0.14.0" - }, - "_requiredBy": [ - "/bcrypt-pbkdf", - "/sshpk" - ], - "_resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", - "_shasum": "5ae68177f192d4456269d108afa93ff8743f4f64", - "_spec": "tweetnacl@~0.14.0", - "_where": "/Users/rebecca/code/npm/node_modules/sshpk", - "author": { - "name": "TweetNaCl-js contributors" - }, - "browser": { - "buffer": false, - "crypto": false - }, - "bugs": { - "url": "https://github.com/dchest/tweetnacl-js/issues" - }, - "bundleDependencies": false, - "deprecated": false, + "name": "tweetnacl", + "version": "0.14.5", "description": "Port of TweetNaCl cryptographic library to JavaScript", - "devDependencies": { - "browserify": "^13.0.0", - "eslint": "^2.2.0", - "faucet": "^0.0.1", - "tap-browser-color": "^0.1.2", - "tape": "^4.4.0", - "tape-run": "^2.1.3", - "tweetnacl-util": "^0.13.3", - "uglify-js": "^2.6.1" - }, + "main": "nacl-fast.js", + "types": "nacl.d.ts", "directories": { "test": "test" }, - "homepage": "https://tweetnacl.js.org", + "scripts": { + "build": "uglifyjs nacl.js -c -m -o nacl.min.js && uglifyjs nacl-fast.js -c -m -o nacl-fast.min.js", + "test-node": "tape test/*.js | faucet", + "test-node-all": "make -C test/c && tape test/*.js test/c/*.js | faucet", + "test-browser": "NACL_SRC=${NACL_SRC:='nacl.min.js'} && npm run build-test-browser && cat $NACL_SRC test/browser/_bundle.js | tape-run | faucet", + "build-test-browser": "browserify test/browser/init.js test/*.js | uglifyjs -c -m -o test/browser/_bundle.js 2>/dev/null && browserify test/browser/init.js test/*.quick.js | uglifyjs -c -m -o test/browser/_bundle-quick.js 2>/dev/null", + "test": "npm run test-node-all && npm run test-browser", + "bench": "node test/benchmark/bench.js", + "lint": "eslint nacl.js nacl-fast.js test/*.js test/benchmark/*.js" + }, + "repository": { + "type": "git", + "url": "https://github.com/dchest/tweetnacl-js.git" + }, "keywords": [ "crypto", "cryptography", @@ -64,23 +35,24 @@ "salsa20", "signatures" ], + "author": "TweetNaCl-js contributors", "license": "Unlicense", - "main": "nacl-fast.js", - "name": "tweetnacl", - "repository": { - "type": "git", - "url": "git+https://github.com/dchest/tweetnacl-js.git" + "bugs": { + "url": "https://github.com/dchest/tweetnacl-js/issues" }, - "scripts": { - "bench": "node test/benchmark/bench.js", - "build": "uglifyjs nacl.js -c -m -o nacl.min.js && uglifyjs nacl-fast.js -c -m -o nacl-fast.min.js", - "build-test-browser": "browserify test/browser/init.js test/*.js | uglifyjs -c -m -o test/browser/_bundle.js 2>/dev/null && browserify test/browser/init.js test/*.quick.js | uglifyjs -c -m -o test/browser/_bundle-quick.js 2>/dev/null", - "lint": "eslint nacl.js nacl-fast.js test/*.js test/benchmark/*.js", - "test": "npm run test-node-all && npm run test-browser", - "test-browser": "NACL_SRC=${NACL_SRC:='nacl.min.js'} && npm run build-test-browser && cat $NACL_SRC test/browser/_bundle.js | tape-run | faucet", - "test-node": "tape test/*.js | faucet", - "test-node-all": "make -C test/c && tape test/*.js test/c/*.js | faucet" + "homepage": "https://tweetnacl.js.org", + "devDependencies": { + "browserify": "^13.0.0", + "eslint": "^2.2.0", + "faucet": "^0.0.1", + "tap-browser-color": "^0.1.2", + "tape": "^4.4.0", + "tape-run": "^2.1.3", + "tweetnacl-util": "^0.13.3", + "uglify-js": "^2.6.1" }, - "types": "nacl.d.ts", - "version": "0.14.5" + "browser": { + "buffer": false, + "crypto": false + } } diff --git a/deps/npm/node_modules/typedarray-to-buffer/.airtap.yml b/deps/npm/node_modules/typedarray-to-buffer/.airtap.yml new file mode 100644 index 00000000000000..3417780255e8e2 --- /dev/null +++ b/deps/npm/node_modules/typedarray-to-buffer/.airtap.yml @@ -0,0 +1,15 @@ +sauce_connect: true +loopback: airtap.local +browsers: + - name: chrome + version: latest + - name: firefox + version: latest + - name: safari + version: latest + - name: microsoftedge + version: latest + - name: ie + version: latest + - name: iphone + version: latest diff --git a/deps/npm/node_modules/typedarray-to-buffer/.travis.yml b/deps/npm/node_modules/typedarray-to-buffer/.travis.yml new file mode 100644 index 00000000000000..f25afbd2f19c75 --- /dev/null +++ b/deps/npm/node_modules/typedarray-to-buffer/.travis.yml @@ -0,0 +1,11 @@ +language: node_js +node_js: + - lts/* +addons: + sauce_connect: true + hosts: + - airtap.local +env: + global: + - secure: i51rE9rZGHbcZWlL58j3H1qtL23OIV2r0X4TcQKNI3pw2mubdHFJmfPNNO19ItfReu8wwQMxOehKamwaNvqMiKWyHfn/QcThFQysqzgGZ6AgnUbYx9od6XFNDeWd1sVBf7QBAL07y7KWlYGWCwFwWjabSVySzQhEBdisPcskfkI= + - secure: BKq6/5z9LK3KDkTjs7BGeBZ1KsWgz+MsAXZ4P64NSeVGFaBdXU45+ww1mwxXFt5l22/mhyOQZfebQl+kGVqRSZ+DEgQeCymkNZ6CD8c6w6cLuOJXiXwuu/cDM2DD0tfGeu2YZC7yEikP7BqEFwH3D324rRzSGLF2RSAAwkOI7bE= diff --git a/deps/npm/node_modules/npm-registry-fetch/node_modules/safe-buffer/LICENSE b/deps/npm/node_modules/typedarray-to-buffer/LICENSE similarity index 100% rename from deps/npm/node_modules/npm-registry-fetch/node_modules/safe-buffer/LICENSE rename to deps/npm/node_modules/typedarray-to-buffer/LICENSE diff --git a/deps/npm/node_modules/typedarray-to-buffer/README.md b/deps/npm/node_modules/typedarray-to-buffer/README.md new file mode 100644 index 00000000000000..35761fb5f8bbb0 --- /dev/null +++ b/deps/npm/node_modules/typedarray-to-buffer/README.md @@ -0,0 +1,85 @@ +# typedarray-to-buffer [![travis][travis-image]][travis-url] [![npm][npm-image]][npm-url] [![downloads][downloads-image]][downloads-url] [![javascript style guide][standard-image]][standard-url] + +[travis-image]: https://img.shields.io/travis/feross/typedarray-to-buffer/master.svg +[travis-url]: https://travis-ci.org/feross/typedarray-to-buffer +[npm-image]: https://img.shields.io/npm/v/typedarray-to-buffer.svg +[npm-url]: https://npmjs.org/package/typedarray-to-buffer +[downloads-image]: https://img.shields.io/npm/dm/typedarray-to-buffer.svg +[downloads-url]: https://npmjs.org/package/typedarray-to-buffer +[standard-image]: https://img.shields.io/badge/code_style-standard-brightgreen.svg +[standard-url]: https://standardjs.com + +#### Convert a typed array to a [Buffer](https://github.com/feross/buffer) without a copy. + +[![saucelabs][saucelabs-image]][saucelabs-url] + +[saucelabs-image]: https://saucelabs.com/browser-matrix/typedarray-to-buffer.svg +[saucelabs-url]: https://saucelabs.com/u/typedarray-to-buffer + +Say you're using the ['buffer'](https://github.com/feross/buffer) module on npm, or +[browserify](http://browserify.org/) and you're working with lots of binary data. + +Unfortunately, sometimes the browser or someone else's API gives you a typed array like +`Uint8Array` to work with and you need to convert it to a `Buffer`. What do you do? + +Of course: `Buffer.from(uint8array)` + +But, alas, every time you do `Buffer.from(uint8array)` **the entire array gets copied**. +The `Buffer` constructor does a copy; this is +defined by the [node docs](http://nodejs.org/api/buffer.html) and the 'buffer' module +matches the node API exactly. + +So, how can we avoid this expensive copy in +[performance critical applications](https://github.com/feross/buffer/issues/22)? + +***Simply use this module, of course!*** + +If you have an `ArrayBuffer`, you don't need this module, because +`Buffer.from(arrayBuffer)` +[is already efficient](https://nodejs.org/api/buffer.html#buffer_class_method_buffer_from_arraybuffer_byteoffset_length). + +## install + +```bash +npm install typedarray-to-buffer +``` + +## usage + +To convert a typed array to a `Buffer` **without a copy**, do this: + +```js +var toBuffer = require('typedarray-to-buffer') + +var arr = new Uint8Array([1, 2, 3]) +arr = toBuffer(arr) + +// arr is a buffer now! + +arr.toString() // '\u0001\u0002\u0003' +arr.readUInt16BE(0) // 258 +``` + +## how it works + +If the browser supports typed arrays, then `toBuffer` will **augment the typed array** you +pass in with the `Buffer` methods and return it. See [how does Buffer +work?](https://github.com/feross/buffer#how-does-it-work) for more about how augmentation +works. + +This module uses the typed array's underlying `ArrayBuffer` to back the new `Buffer`. This +respects the "view" on the `ArrayBuffer`, i.e. `byteOffset` and `byteLength`. In other +words, if you do `toBuffer(new Uint32Array([1, 2, 3]))`, then the new `Buffer` will +contain `[1, 0, 0, 0, 2, 0, 0, 0, 3, 0, 0, 0]`, **not** `[1, 2, 3]`. And it still doesn't +require a copy. + +If the browser doesn't support typed arrays, then `toBuffer` will create a new `Buffer` +object, copy the data into it, and return it. There's no simple performance optimization +we can do for old browsers. Oh well. + +If this module is used in node, then it will just call `Buffer.from`. This is just for +the convenience of modules that work in both node and the browser. + +## license + +MIT. Copyright (C) [Feross Aboukhadijeh](http://feross.org). diff --git a/deps/npm/node_modules/typedarray-to-buffer/index.js b/deps/npm/node_modules/typedarray-to-buffer/index.js new file mode 100644 index 00000000000000..5fa394dd201d2e --- /dev/null +++ b/deps/npm/node_modules/typedarray-to-buffer/index.js @@ -0,0 +1,25 @@ +/** + * Convert a typed array to a Buffer without a copy + * + * Author: Feross Aboukhadijeh + * License: MIT + * + * `npm install typedarray-to-buffer` + */ + +var isTypedArray = require('is-typedarray').strict + +module.exports = function typedarrayToBuffer (arr) { + if (isTypedArray(arr)) { + // To avoid a copy, use the typed array's underlying ArrayBuffer to back new Buffer + var buf = Buffer.from(arr.buffer) + if (arr.byteLength !== arr.buffer.byteLength) { + // Respect the "view", i.e. byteOffset and byteLength, without doing a copy + buf = buf.slice(arr.byteOffset, arr.byteOffset + arr.byteLength) + } + return buf + } else { + // Pass through all other types to `Buffer.from` + return Buffer.from(arr) + } +} diff --git a/deps/npm/node_modules/typedarray-to-buffer/package.json b/deps/npm/node_modules/typedarray-to-buffer/package.json new file mode 100644 index 00000000000000..5ec5656157991e --- /dev/null +++ b/deps/npm/node_modules/typedarray-to-buffer/package.json @@ -0,0 +1,50 @@ +{ + "name": "typedarray-to-buffer", + "description": "Convert a typed array to a Buffer without a copy", + "version": "3.1.5", + "author": { + "name": "Feross Aboukhadijeh", + "email": "feross@feross.org", + "url": "http://feross.org/" + }, + "bugs": { + "url": "https://github.com/feross/typedarray-to-buffer/issues" + }, + "dependencies": { + "is-typedarray": "^1.0.0" + }, + "devDependencies": { + "airtap": "0.0.4", + "standard": "*", + "tape": "^4.0.0" + }, + "homepage": "http://feross.org", + "keywords": [ + "buffer", + "typed array", + "convert", + "no copy", + "uint8array", + "uint16array", + "uint32array", + "int16array", + "int32array", + "float32array", + "float64array", + "browser", + "arraybuffer", + "dataview" + ], + "license": "MIT", + "main": "index.js", + "repository": { + "type": "git", + "url": "git://github.com/feross/typedarray-to-buffer.git" + }, + "scripts": { + "test": "standard && npm run test-node && npm run test-browser", + "test-browser": "airtap -- test/*.js", + "test-browser-local": "airtap --local -- test/*.js", + "test-node": "tape test/*.js" + } +} diff --git a/deps/npm/node_modules/typedarray-to-buffer/test/basic.js b/deps/npm/node_modules/typedarray-to-buffer/test/basic.js new file mode 100644 index 00000000000000..352109682f5c12 --- /dev/null +++ b/deps/npm/node_modules/typedarray-to-buffer/test/basic.js @@ -0,0 +1,50 @@ +var test = require('tape') +var toBuffer = require('../') + +test('convert to buffer from Uint8Array', function (t) { + if (typeof Uint8Array !== 'undefined') { + var arr = new Uint8Array([1, 2, 3]) + arr = toBuffer(arr) + + t.deepEqual(arr, Buffer.from([1, 2, 3]), 'contents equal') + t.ok(Buffer.isBuffer(arr), 'is buffer') + t.equal(arr.readUInt8(0), 1) + t.equal(arr.readUInt8(1), 2) + t.equal(arr.readUInt8(2), 3) + } else { + t.pass('browser lacks Uint8Array support, skip test') + } + t.end() +}) + +test('convert to buffer from another arrayview type (Uint32Array)', function (t) { + if (typeof Uint32Array !== 'undefined' && Buffer.TYPED_ARRAY_SUPPORT !== false) { + var arr = new Uint32Array([1, 2, 3]) + arr = toBuffer(arr) + + t.deepEqual(arr, Buffer.from([1, 0, 0, 0, 2, 0, 0, 0, 3, 0, 0, 0]), 'contents equal') + t.ok(Buffer.isBuffer(arr), 'is buffer') + t.equal(arr.readUInt32LE(0), 1) + t.equal(arr.readUInt32LE(4), 2) + t.equal(arr.readUInt32LE(8), 3) + t.equal(arr instanceof Uint8Array, true) + } else { + t.pass('browser lacks Uint32Array support, skip test') + } + t.end() +}) + +test('convert to buffer from ArrayBuffer', function (t) { + if (typeof Uint32Array !== 'undefined' && Buffer.TYPED_ARRAY_SUPPORT !== false) { + var arr = new Uint32Array([1, 2, 3]).subarray(1, 2) + arr = toBuffer(arr) + + t.deepEqual(arr, Buffer.from([2, 0, 0, 0]), 'contents equal') + t.ok(Buffer.isBuffer(arr), 'is buffer') + t.equal(arr.readUInt32LE(0), 2) + t.equal(arr instanceof Uint8Array, true) + } else { + t.pass('browser lacks ArrayBuffer support, skip test') + } + t.end() +}) diff --git a/deps/npm/node_modules/typedarray/.travis.yml b/deps/npm/node_modules/typedarray/.travis.yml deleted file mode 100644 index cc4dba29d959a2..00000000000000 --- a/deps/npm/node_modules/typedarray/.travis.yml +++ /dev/null @@ -1,4 +0,0 @@ -language: node_js -node_js: - - "0.8" - - "0.10" diff --git a/deps/npm/node_modules/typedarray/LICENSE b/deps/npm/node_modules/typedarray/LICENSE deleted file mode 100644 index 11adfaec9e7f95..00000000000000 --- a/deps/npm/node_modules/typedarray/LICENSE +++ /dev/null @@ -1,35 +0,0 @@ -/* - Copyright (c) 2010, Linden Research, Inc. - Copyright (c) 2012, Joshua Bell - - 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. - $/LicenseInfo$ - */ - -// Original can be found at: -// https://bitbucket.org/lindenlab/llsd -// Modifications by Joshua Bell inexorabletash@gmail.com -// https://github.com/inexorabletash/polyfill - -// ES3/ES5 implementation of the Krhonos Typed Array Specification -// Ref: http://www.khronos.org/registry/typedarray/specs/latest/ -// Date: 2011-02-01 -// -// Variations: -// * Allows typed_array.get/set() as alias for subscripts (typed_array[]) diff --git a/deps/npm/node_modules/typedarray/example/tarray.js b/deps/npm/node_modules/typedarray/example/tarray.js deleted file mode 100644 index 8423d7c9b1c327..00000000000000 --- a/deps/npm/node_modules/typedarray/example/tarray.js +++ /dev/null @@ -1,4 +0,0 @@ -var Uint8Array = require('../').Uint8Array; -var ua = new Uint8Array(5); -ua[1] = 256 + 55; -console.log(ua[1]); diff --git a/deps/npm/node_modules/typedarray/index.js b/deps/npm/node_modules/typedarray/index.js deleted file mode 100644 index 5e540841f43241..00000000000000 --- a/deps/npm/node_modules/typedarray/index.js +++ /dev/null @@ -1,630 +0,0 @@ -var undefined = (void 0); // Paranoia - -// Beyond this value, index getters/setters (i.e. array[0], array[1]) are so slow to -// create, and consume so much memory, that the browser appears frozen. -var MAX_ARRAY_LENGTH = 1e5; - -// Approximations of internal ECMAScript conversion functions -var ECMAScript = (function() { - // Stash a copy in case other scripts modify these - var opts = Object.prototype.toString, - ophop = Object.prototype.hasOwnProperty; - - return { - // Class returns internal [[Class]] property, used to avoid cross-frame instanceof issues: - Class: function(v) { return opts.call(v).replace(/^\[object *|\]$/g, ''); }, - HasProperty: function(o, p) { return p in o; }, - HasOwnProperty: function(o, p) { return ophop.call(o, p); }, - IsCallable: function(o) { return typeof o === 'function'; }, - ToInt32: function(v) { return v >> 0; }, - ToUint32: function(v) { return v >>> 0; } - }; -}()); - -// Snapshot intrinsics -var LN2 = Math.LN2, - abs = Math.abs, - floor = Math.floor, - log = Math.log, - min = Math.min, - pow = Math.pow, - round = Math.round; - -// ES5: lock down object properties -function configureProperties(obj) { - if (getOwnPropNames && defineProp) { - var props = getOwnPropNames(obj), i; - for (i = 0; i < props.length; i += 1) { - defineProp(obj, props[i], { - value: obj[props[i]], - writable: false, - enumerable: false, - configurable: false - }); - } - } -} - -// emulate ES5 getter/setter API using legacy APIs -// http://blogs.msdn.com/b/ie/archive/2010/09/07/transitioning-existing-code-to-the-es5-getter-setter-apis.aspx -// (second clause tests for Object.defineProperty() in IE<9 that only supports extending DOM prototypes, but -// note that IE<9 does not support __defineGetter__ or __defineSetter__ so it just renders the method harmless) -var defineProp -if (Object.defineProperty && (function() { - try { - Object.defineProperty({}, 'x', {}); - return true; - } catch (e) { - return false; - } - })()) { - defineProp = Object.defineProperty; -} else { - defineProp = function(o, p, desc) { - if (!o === Object(o)) throw new TypeError("Object.defineProperty called on non-object"); - if (ECMAScript.HasProperty(desc, 'get') && Object.prototype.__defineGetter__) { Object.prototype.__defineGetter__.call(o, p, desc.get); } - if (ECMAScript.HasProperty(desc, 'set') && Object.prototype.__defineSetter__) { Object.prototype.__defineSetter__.call(o, p, desc.set); } - if (ECMAScript.HasProperty(desc, 'value')) { o[p] = desc.value; } - return o; - }; -} - -var getOwnPropNames = Object.getOwnPropertyNames || function (o) { - if (o !== Object(o)) throw new TypeError("Object.getOwnPropertyNames called on non-object"); - var props = [], p; - for (p in o) { - if (ECMAScript.HasOwnProperty(o, p)) { - props.push(p); - } - } - return props; -}; - -// ES5: Make obj[index] an alias for obj._getter(index)/obj._setter(index, value) -// for index in 0 ... obj.length -function makeArrayAccessors(obj) { - if (!defineProp) { return; } - - if (obj.length > MAX_ARRAY_LENGTH) throw new RangeError("Array too large for polyfill"); - - function makeArrayAccessor(index) { - defineProp(obj, index, { - 'get': function() { return obj._getter(index); }, - 'set': function(v) { obj._setter(index, v); }, - enumerable: true, - configurable: false - }); - } - - var i; - for (i = 0; i < obj.length; i += 1) { - makeArrayAccessor(i); - } -} - -// Internal conversion functions: -// pack() - take a number (interpreted as Type), output a byte array -// unpack() - take a byte array, output a Type-like number - -function as_signed(value, bits) { var s = 32 - bits; return (value << s) >> s; } -function as_unsigned(value, bits) { var s = 32 - bits; return (value << s) >>> s; } - -function packI8(n) { return [n & 0xff]; } -function unpackI8(bytes) { return as_signed(bytes[0], 8); } - -function packU8(n) { return [n & 0xff]; } -function unpackU8(bytes) { return as_unsigned(bytes[0], 8); } - -function packU8Clamped(n) { n = round(Number(n)); return [n < 0 ? 0 : n > 0xff ? 0xff : n & 0xff]; } - -function packI16(n) { return [(n >> 8) & 0xff, n & 0xff]; } -function unpackI16(bytes) { return as_signed(bytes[0] << 8 | bytes[1], 16); } - -function packU16(n) { return [(n >> 8) & 0xff, n & 0xff]; } -function unpackU16(bytes) { return as_unsigned(bytes[0] << 8 | bytes[1], 16); } - -function packI32(n) { return [(n >> 24) & 0xff, (n >> 16) & 0xff, (n >> 8) & 0xff, n & 0xff]; } -function unpackI32(bytes) { return as_signed(bytes[0] << 24 | bytes[1] << 16 | bytes[2] << 8 | bytes[3], 32); } - -function packU32(n) { return [(n >> 24) & 0xff, (n >> 16) & 0xff, (n >> 8) & 0xff, n & 0xff]; } -function unpackU32(bytes) { return as_unsigned(bytes[0] << 24 | bytes[1] << 16 | bytes[2] << 8 | bytes[3], 32); } - -function packIEEE754(v, ebits, fbits) { - - var bias = (1 << (ebits - 1)) - 1, - s, e, f, ln, - i, bits, str, bytes; - - function roundToEven(n) { - var w = floor(n), f = n - w; - if (f < 0.5) - return w; - if (f > 0.5) - return w + 1; - return w % 2 ? w + 1 : w; - } - - // Compute sign, exponent, fraction - if (v !== v) { - // NaN - // http://dev.w3.org/2006/webapi/WebIDL/#es-type-mapping - e = (1 << ebits) - 1; f = pow(2, fbits - 1); s = 0; - } else if (v === Infinity || v === -Infinity) { - e = (1 << ebits) - 1; f = 0; s = (v < 0) ? 1 : 0; - } else if (v === 0) { - e = 0; f = 0; s = (1 / v === -Infinity) ? 1 : 0; - } else { - s = v < 0; - v = abs(v); - - if (v >= pow(2, 1 - bias)) { - e = min(floor(log(v) / LN2), 1023); - f = roundToEven(v / pow(2, e) * pow(2, fbits)); - if (f / pow(2, fbits) >= 2) { - e = e + 1; - f = 1; - } - if (e > bias) { - // Overflow - e = (1 << ebits) - 1; - f = 0; - } else { - // Normalized - e = e + bias; - f = f - pow(2, fbits); - } - } else { - // Denormalized - e = 0; - f = roundToEven(v / pow(2, 1 - bias - fbits)); - } - } - - // Pack sign, exponent, fraction - bits = []; - for (i = fbits; i; i -= 1) { bits.push(f % 2 ? 1 : 0); f = floor(f / 2); } - for (i = ebits; i; i -= 1) { bits.push(e % 2 ? 1 : 0); e = floor(e / 2); } - bits.push(s ? 1 : 0); - bits.reverse(); - str = bits.join(''); - - // Bits to bytes - bytes = []; - while (str.length) { - bytes.push(parseInt(str.substring(0, 8), 2)); - str = str.substring(8); - } - return bytes; -} - -function unpackIEEE754(bytes, ebits, fbits) { - - // Bytes to bits - var bits = [], i, j, b, str, - bias, s, e, f; - - for (i = bytes.length; i; i -= 1) { - b = bytes[i - 1]; - for (j = 8; j; j -= 1) { - bits.push(b % 2 ? 1 : 0); b = b >> 1; - } - } - bits.reverse(); - str = bits.join(''); - - // Unpack sign, exponent, fraction - bias = (1 << (ebits - 1)) - 1; - s = parseInt(str.substring(0, 1), 2) ? -1 : 1; - e = parseInt(str.substring(1, 1 + ebits), 2); - f = parseInt(str.substring(1 + ebits), 2); - - // Produce number - if (e === (1 << ebits) - 1) { - return f !== 0 ? NaN : s * Infinity; - } else if (e > 0) { - // Normalized - return s * pow(2, e - bias) * (1 + f / pow(2, fbits)); - } else if (f !== 0) { - // Denormalized - return s * pow(2, -(bias - 1)) * (f / pow(2, fbits)); - } else { - return s < 0 ? -0 : 0; - } -} - -function unpackF64(b) { return unpackIEEE754(b, 11, 52); } -function packF64(v) { return packIEEE754(v, 11, 52); } -function unpackF32(b) { return unpackIEEE754(b, 8, 23); } -function packF32(v) { return packIEEE754(v, 8, 23); } - - -// -// 3 The ArrayBuffer Type -// - -(function() { - - /** @constructor */ - var ArrayBuffer = function ArrayBuffer(length) { - length = ECMAScript.ToInt32(length); - if (length < 0) throw new RangeError('ArrayBuffer size is not a small enough positive integer'); - - this.byteLength = length; - this._bytes = []; - this._bytes.length = length; - - var i; - for (i = 0; i < this.byteLength; i += 1) { - this._bytes[i] = 0; - } - - configureProperties(this); - }; - - exports.ArrayBuffer = exports.ArrayBuffer || ArrayBuffer; - - // - // 4 The ArrayBufferView Type - // - - // NOTE: this constructor is not exported - /** @constructor */ - var ArrayBufferView = function ArrayBufferView() { - //this.buffer = null; - //this.byteOffset = 0; - //this.byteLength = 0; - }; - - // - // 5 The Typed Array View Types - // - - function makeConstructor(bytesPerElement, pack, unpack) { - // Each TypedArray type requires a distinct constructor instance with - // identical logic, which this produces. - - var ctor; - ctor = function(buffer, byteOffset, length) { - var array, sequence, i, s; - - if (!arguments.length || typeof arguments[0] === 'number') { - // Constructor(unsigned long length) - this.length = ECMAScript.ToInt32(arguments[0]); - if (length < 0) throw new RangeError('ArrayBufferView size is not a small enough positive integer'); - - this.byteLength = this.length * this.BYTES_PER_ELEMENT; - this.buffer = new ArrayBuffer(this.byteLength); - this.byteOffset = 0; - } else if (typeof arguments[0] === 'object' && arguments[0].constructor === ctor) { - // Constructor(TypedArray array) - array = arguments[0]; - - this.length = array.length; - this.byteLength = this.length * this.BYTES_PER_ELEMENT; - this.buffer = new ArrayBuffer(this.byteLength); - this.byteOffset = 0; - - for (i = 0; i < this.length; i += 1) { - this._setter(i, array._getter(i)); - } - } else if (typeof arguments[0] === 'object' && - !(arguments[0] instanceof ArrayBuffer || ECMAScript.Class(arguments[0]) === 'ArrayBuffer')) { - // Constructor(sequence array) - sequence = arguments[0]; - - this.length = ECMAScript.ToUint32(sequence.length); - this.byteLength = this.length * this.BYTES_PER_ELEMENT; - this.buffer = new ArrayBuffer(this.byteLength); - this.byteOffset = 0; - - for (i = 0; i < this.length; i += 1) { - s = sequence[i]; - this._setter(i, Number(s)); - } - } else if (typeof arguments[0] === 'object' && - (arguments[0] instanceof ArrayBuffer || ECMAScript.Class(arguments[0]) === 'ArrayBuffer')) { - // Constructor(ArrayBuffer buffer, - // optional unsigned long byteOffset, optional unsigned long length) - this.buffer = buffer; - - this.byteOffset = ECMAScript.ToUint32(byteOffset); - if (this.byteOffset > this.buffer.byteLength) { - throw new RangeError("byteOffset out of range"); - } - - if (this.byteOffset % this.BYTES_PER_ELEMENT) { - // The given byteOffset must be a multiple of the element - // size of the specific type, otherwise an exception is raised. - throw new RangeError("ArrayBuffer length minus the byteOffset is not a multiple of the element size."); - } - - if (arguments.length < 3) { - this.byteLength = this.buffer.byteLength - this.byteOffset; - - if (this.byteLength % this.BYTES_PER_ELEMENT) { - throw new RangeError("length of buffer minus byteOffset not a multiple of the element size"); - } - this.length = this.byteLength / this.BYTES_PER_ELEMENT; - } else { - this.length = ECMAScript.ToUint32(length); - this.byteLength = this.length * this.BYTES_PER_ELEMENT; - } - - if ((this.byteOffset + this.byteLength) > this.buffer.byteLength) { - throw new RangeError("byteOffset and length reference an area beyond the end of the buffer"); - } - } else { - throw new TypeError("Unexpected argument type(s)"); - } - - this.constructor = ctor; - - configureProperties(this); - makeArrayAccessors(this); - }; - - ctor.prototype = new ArrayBufferView(); - ctor.prototype.BYTES_PER_ELEMENT = bytesPerElement; - ctor.prototype._pack = pack; - ctor.prototype._unpack = unpack; - ctor.BYTES_PER_ELEMENT = bytesPerElement; - - // getter type (unsigned long index); - ctor.prototype._getter = function(index) { - if (arguments.length < 1) throw new SyntaxError("Not enough arguments"); - - index = ECMAScript.ToUint32(index); - if (index >= this.length) { - return undefined; - } - - var bytes = [], i, o; - for (i = 0, o = this.byteOffset + index * this.BYTES_PER_ELEMENT; - i < this.BYTES_PER_ELEMENT; - i += 1, o += 1) { - bytes.push(this.buffer._bytes[o]); - } - return this._unpack(bytes); - }; - - // NONSTANDARD: convenience alias for getter: type get(unsigned long index); - ctor.prototype.get = ctor.prototype._getter; - - // setter void (unsigned long index, type value); - ctor.prototype._setter = function(index, value) { - if (arguments.length < 2) throw new SyntaxError("Not enough arguments"); - - index = ECMAScript.ToUint32(index); - if (index >= this.length) { - return undefined; - } - - var bytes = this._pack(value), i, o; - for (i = 0, o = this.byteOffset + index * this.BYTES_PER_ELEMENT; - i < this.BYTES_PER_ELEMENT; - i += 1, o += 1) { - this.buffer._bytes[o] = bytes[i]; - } - }; - - // void set(TypedArray array, optional unsigned long offset); - // void set(sequence array, optional unsigned long offset); - ctor.prototype.set = function(index, value) { - if (arguments.length < 1) throw new SyntaxError("Not enough arguments"); - var array, sequence, offset, len, - i, s, d, - byteOffset, byteLength, tmp; - - if (typeof arguments[0] === 'object' && arguments[0].constructor === this.constructor) { - // void set(TypedArray array, optional unsigned long offset); - array = arguments[0]; - offset = ECMAScript.ToUint32(arguments[1]); - - if (offset + array.length > this.length) { - throw new RangeError("Offset plus length of array is out of range"); - } - - byteOffset = this.byteOffset + offset * this.BYTES_PER_ELEMENT; - byteLength = array.length * this.BYTES_PER_ELEMENT; - - if (array.buffer === this.buffer) { - tmp = []; - for (i = 0, s = array.byteOffset; i < byteLength; i += 1, s += 1) { - tmp[i] = array.buffer._bytes[s]; - } - for (i = 0, d = byteOffset; i < byteLength; i += 1, d += 1) { - this.buffer._bytes[d] = tmp[i]; - } - } else { - for (i = 0, s = array.byteOffset, d = byteOffset; - i < byteLength; i += 1, s += 1, d += 1) { - this.buffer._bytes[d] = array.buffer._bytes[s]; - } - } - } else if (typeof arguments[0] === 'object' && typeof arguments[0].length !== 'undefined') { - // void set(sequence array, optional unsigned long offset); - sequence = arguments[0]; - len = ECMAScript.ToUint32(sequence.length); - offset = ECMAScript.ToUint32(arguments[1]); - - if (offset + len > this.length) { - throw new RangeError("Offset plus length of array is out of range"); - } - - for (i = 0; i < len; i += 1) { - s = sequence[i]; - this._setter(offset + i, Number(s)); - } - } else { - throw new TypeError("Unexpected argument type(s)"); - } - }; - - // TypedArray subarray(long begin, optional long end); - ctor.prototype.subarray = function(start, end) { - function clamp(v, min, max) { return v < min ? min : v > max ? max : v; } - - start = ECMAScript.ToInt32(start); - end = ECMAScript.ToInt32(end); - - if (arguments.length < 1) { start = 0; } - if (arguments.length < 2) { end = this.length; } - - if (start < 0) { start = this.length + start; } - if (end < 0) { end = this.length + end; } - - start = clamp(start, 0, this.length); - end = clamp(end, 0, this.length); - - var len = end - start; - if (len < 0) { - len = 0; - } - - return new this.constructor( - this.buffer, this.byteOffset + start * this.BYTES_PER_ELEMENT, len); - }; - - return ctor; - } - - var Int8Array = makeConstructor(1, packI8, unpackI8); - var Uint8Array = makeConstructor(1, packU8, unpackU8); - var Uint8ClampedArray = makeConstructor(1, packU8Clamped, unpackU8); - var Int16Array = makeConstructor(2, packI16, unpackI16); - var Uint16Array = makeConstructor(2, packU16, unpackU16); - var Int32Array = makeConstructor(4, packI32, unpackI32); - var Uint32Array = makeConstructor(4, packU32, unpackU32); - var Float32Array = makeConstructor(4, packF32, unpackF32); - var Float64Array = makeConstructor(8, packF64, unpackF64); - - exports.Int8Array = exports.Int8Array || Int8Array; - exports.Uint8Array = exports.Uint8Array || Uint8Array; - exports.Uint8ClampedArray = exports.Uint8ClampedArray || Uint8ClampedArray; - exports.Int16Array = exports.Int16Array || Int16Array; - exports.Uint16Array = exports.Uint16Array || Uint16Array; - exports.Int32Array = exports.Int32Array || Int32Array; - exports.Uint32Array = exports.Uint32Array || Uint32Array; - exports.Float32Array = exports.Float32Array || Float32Array; - exports.Float64Array = exports.Float64Array || Float64Array; -}()); - -// -// 6 The DataView View Type -// - -(function() { - function r(array, index) { - return ECMAScript.IsCallable(array.get) ? array.get(index) : array[index]; - } - - var IS_BIG_ENDIAN = (function() { - var u16array = new(exports.Uint16Array)([0x1234]), - u8array = new(exports.Uint8Array)(u16array.buffer); - return r(u8array, 0) === 0x12; - }()); - - // Constructor(ArrayBuffer buffer, - // optional unsigned long byteOffset, - // optional unsigned long byteLength) - /** @constructor */ - var DataView = function DataView(buffer, byteOffset, byteLength) { - if (arguments.length === 0) { - buffer = new exports.ArrayBuffer(0); - } else if (!(buffer instanceof exports.ArrayBuffer || ECMAScript.Class(buffer) === 'ArrayBuffer')) { - throw new TypeError("TypeError"); - } - - this.buffer = buffer || new exports.ArrayBuffer(0); - - this.byteOffset = ECMAScript.ToUint32(byteOffset); - if (this.byteOffset > this.buffer.byteLength) { - throw new RangeError("byteOffset out of range"); - } - - if (arguments.length < 3) { - this.byteLength = this.buffer.byteLength - this.byteOffset; - } else { - this.byteLength = ECMAScript.ToUint32(byteLength); - } - - if ((this.byteOffset + this.byteLength) > this.buffer.byteLength) { - throw new RangeError("byteOffset and length reference an area beyond the end of the buffer"); - } - - configureProperties(this); - }; - - function makeGetter(arrayType) { - return function(byteOffset, littleEndian) { - - byteOffset = ECMAScript.ToUint32(byteOffset); - - if (byteOffset + arrayType.BYTES_PER_ELEMENT > this.byteLength) { - throw new RangeError("Array index out of range"); - } - byteOffset += this.byteOffset; - - var uint8Array = new exports.Uint8Array(this.buffer, byteOffset, arrayType.BYTES_PER_ELEMENT), - bytes = [], i; - for (i = 0; i < arrayType.BYTES_PER_ELEMENT; i += 1) { - bytes.push(r(uint8Array, i)); - } - - if (Boolean(littleEndian) === Boolean(IS_BIG_ENDIAN)) { - bytes.reverse(); - } - - return r(new arrayType(new exports.Uint8Array(bytes).buffer), 0); - }; - } - - DataView.prototype.getUint8 = makeGetter(exports.Uint8Array); - DataView.prototype.getInt8 = makeGetter(exports.Int8Array); - DataView.prototype.getUint16 = makeGetter(exports.Uint16Array); - DataView.prototype.getInt16 = makeGetter(exports.Int16Array); - DataView.prototype.getUint32 = makeGetter(exports.Uint32Array); - DataView.prototype.getInt32 = makeGetter(exports.Int32Array); - DataView.prototype.getFloat32 = makeGetter(exports.Float32Array); - DataView.prototype.getFloat64 = makeGetter(exports.Float64Array); - - function makeSetter(arrayType) { - return function(byteOffset, value, littleEndian) { - - byteOffset = ECMAScript.ToUint32(byteOffset); - if (byteOffset + arrayType.BYTES_PER_ELEMENT > this.byteLength) { - throw new RangeError("Array index out of range"); - } - - // Get bytes - var typeArray = new arrayType([value]), - byteArray = new exports.Uint8Array(typeArray.buffer), - bytes = [], i, byteView; - - for (i = 0; i < arrayType.BYTES_PER_ELEMENT; i += 1) { - bytes.push(r(byteArray, i)); - } - - // Flip if necessary - if (Boolean(littleEndian) === Boolean(IS_BIG_ENDIAN)) { - bytes.reverse(); - } - - // Write them - byteView = new exports.Uint8Array(this.buffer, byteOffset, arrayType.BYTES_PER_ELEMENT); - byteView.set(bytes); - }; - } - - DataView.prototype.setUint8 = makeSetter(exports.Uint8Array); - DataView.prototype.setInt8 = makeSetter(exports.Int8Array); - DataView.prototype.setUint16 = makeSetter(exports.Uint16Array); - DataView.prototype.setInt16 = makeSetter(exports.Int16Array); - DataView.prototype.setUint32 = makeSetter(exports.Uint32Array); - DataView.prototype.setInt32 = makeSetter(exports.Int32Array); - DataView.prototype.setFloat32 = makeSetter(exports.Float32Array); - DataView.prototype.setFloat64 = makeSetter(exports.Float64Array); - - exports.DataView = exports.DataView || DataView; - -}()); diff --git a/deps/npm/node_modules/typedarray/package.json b/deps/npm/node_modules/typedarray/package.json deleted file mode 100644 index 535bb63cd4215b..00000000000000 --- a/deps/npm/node_modules/typedarray/package.json +++ /dev/null @@ -1,83 +0,0 @@ -{ - "_from": "typedarray@^0.0.6", - "_id": "typedarray@0.0.6", - "_inBundle": false, - "_integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=", - "_location": "/typedarray", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "typedarray@^0.0.6", - "name": "typedarray", - "escapedName": "typedarray", - "rawSpec": "^0.0.6", - "saveSpec": null, - "fetchSpec": "^0.0.6" - }, - "_requiredBy": [ - "/concat-stream" - ], - "_resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", - "_shasum": "867ac74e3864187b1d3d47d996a78ec5c8830777", - "_spec": "typedarray@^0.0.6", - "_where": "/Users/rebecca/code/npm/node_modules/concat-stream", - "author": { - "name": "James Halliday", - "email": "mail@substack.net", - "url": "http://substack.net" - }, - "bugs": { - "url": "https://github.com/substack/typedarray/issues" - }, - "bundleDependencies": false, - "deprecated": false, - "description": "TypedArray polyfill for old browsers", - "devDependencies": { - "tape": "~2.3.2" - }, - "homepage": "https://github.com/substack/typedarray", - "keywords": [ - "ArrayBuffer", - "DataView", - "Float32Array", - "Float64Array", - "Int8Array", - "Int16Array", - "Int32Array", - "Uint8Array", - "Uint8ClampedArray", - "Uint16Array", - "Uint32Array", - "typed", - "array", - "polyfill" - ], - "license": "MIT", - "main": "index.js", - "name": "typedarray", - "repository": { - "type": "git", - "url": "git://github.com/substack/typedarray.git" - }, - "scripts": { - "test": "tape test/*.js test/server/*.js" - }, - "testling": { - "files": "test/*.js", - "browsers": [ - "ie/6..latest", - "firefox/16..latest", - "firefox/nightly", - "chrome/22..latest", - "chrome/canary", - "opera/12..latest", - "opera/next", - "safari/5.1..latest", - "ipad/6.0..latest", - "iphone/6.0..latest", - "android-browser/4.2..latest" - ] - }, - "version": "0.0.6" -} diff --git a/deps/npm/node_modules/typedarray/readme.markdown b/deps/npm/node_modules/typedarray/readme.markdown deleted file mode 100644 index d18f6f7197e6a5..00000000000000 --- a/deps/npm/node_modules/typedarray/readme.markdown +++ /dev/null @@ -1,61 +0,0 @@ -# typedarray - -TypedArray polyfill ripped from [this -module](https://raw.github.com/inexorabletash/polyfill). - -[![build status](https://secure.travis-ci.org/substack/typedarray.png)](http://travis-ci.org/substack/typedarray) - -[![testling badge](https://ci.testling.com/substack/typedarray.png)](https://ci.testling.com/substack/typedarray) - -# example - -``` js -var Uint8Array = require('typedarray').Uint8Array; -var ua = new Uint8Array(5); -ua[1] = 256 + 55; -console.log(ua[1]); -``` - -output: - -``` -55 -``` - -# methods - -``` js -var TA = require('typedarray') -``` - -The `TA` object has the following constructors: - -* TA.ArrayBuffer -* TA.DataView -* TA.Float32Array -* TA.Float64Array -* TA.Int8Array -* TA.Int16Array -* TA.Int32Array -* TA.Uint8Array -* TA.Uint8ClampedArray -* TA.Uint16Array -* TA.Uint32Array - -# install - -With [npm](https://npmjs.org) do: - -``` -npm install typedarray -``` - -To use this module in the browser, compile with -[browserify](http://browserify.org) -or download a UMD build from browserify CDN: - -http://wzrd.in/standalone/typedarray@latest - -# license - -MIT diff --git a/deps/npm/node_modules/typedarray/test/server/undef_globals.js b/deps/npm/node_modules/typedarray/test/server/undef_globals.js deleted file mode 100644 index 425950f9fc9ed7..00000000000000 --- a/deps/npm/node_modules/typedarray/test/server/undef_globals.js +++ /dev/null @@ -1,19 +0,0 @@ -var test = require('tape'); -var vm = require('vm'); -var fs = require('fs'); -var src = fs.readFileSync(__dirname + '/../../index.js', 'utf8'); - -test('u8a without globals', function (t) { - var c = { - module: { exports: {} }, - }; - c.exports = c.module.exports; - vm.runInNewContext(src, c); - var TA = c.module.exports; - var ua = new(TA.Uint8Array)(5); - - t.equal(ua.length, 5); - ua[1] = 256 + 55; - t.equal(ua[1], 55); - t.end(); -}); diff --git a/deps/npm/node_modules/typedarray/test/tarray.js b/deps/npm/node_modules/typedarray/test/tarray.js deleted file mode 100644 index df596a34f23c0e..00000000000000 --- a/deps/npm/node_modules/typedarray/test/tarray.js +++ /dev/null @@ -1,10 +0,0 @@ -var TA = require('../'); -var test = require('tape'); - -test('tiny u8a test', function (t) { - var ua = new(TA.Uint8Array)(5); - t.equal(ua.length, 5); - ua[1] = 256 + 55; - t.equal(ua[1], 55); - t.end(); -}); diff --git a/deps/npm/node_modules/uid-number/README.md b/deps/npm/node_modules/uid-number/README.md deleted file mode 100644 index 81166753aba556..00000000000000 --- a/deps/npm/node_modules/uid-number/README.md +++ /dev/null @@ -1,17 +0,0 @@ -Use this module to convert a username/groupname to a uid/gid number. - -Usage: - -``` -npm install uid-number -``` - -Then, in your node program: - -```javascript -var uidNumber = require("uid-number") -uidNumber("isaacs", function (er, uid, gid) { - // gid is null because we didn't ask for a group name - // uid === 24561 because that's my number. -}) -``` diff --git a/deps/npm/node_modules/uid-number/get-uid-gid.js b/deps/npm/node_modules/uid-number/get-uid-gid.js deleted file mode 100755 index 0b391748a93273..00000000000000 --- a/deps/npm/node_modules/uid-number/get-uid-gid.js +++ /dev/null @@ -1,24 +0,0 @@ -if (module !== require.main) { - throw new Error("This file should not be loaded with require()") -} - -if (!process.getuid || !process.getgid) { - throw new Error("this file should not be called without uid/gid support") -} - -var argv = process.argv.slice(2) - , user = argv[0] || process.getuid() - , group = argv[1] || process.getgid() - -if (!isNaN(user)) user = +user -if (!isNaN(group)) group = +group - -console.error([user, group]) - -try { - process.setgid(group) - process.setuid(user) - console.log(JSON.stringify({uid:+process.getuid(), gid:+process.getgid()})) -} catch (ex) { - console.log(JSON.stringify({error:ex.message,errno:ex.errno})) -} diff --git a/deps/npm/node_modules/uid-number/package.json b/deps/npm/node_modules/uid-number/package.json deleted file mode 100644 index 6c5b27ea3c7a08..00000000000000 --- a/deps/npm/node_modules/uid-number/package.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "_args": [ - [ - "uid-number@0.0.6", - "/Users/rebecca/code/npm" - ] - ], - "_from": "uid-number@0.0.6", - "_id": "uid-number@0.0.6", - "_inBundle": false, - "_integrity": "sha1-DqEOgDXo61uOREnwbaHHMGY7qoE=", - "_location": "/uid-number", - "_phantomChildren": {}, - "_requested": { - "type": "version", - "registry": true, - "raw": "uid-number@0.0.6", - "name": "uid-number", - "escapedName": "uid-number", - "rawSpec": "0.0.6", - "saveSpec": null, - "fetchSpec": "0.0.6" - }, - "_requiredBy": [ - "/", - "/npm-lifecycle" - ], - "_resolved": "https://registry.npmjs.org/uid-number/-/uid-number-0.0.6.tgz", - "_spec": "0.0.6", - "_where": "/Users/rebecca/code/npm", - "author": { - "name": "Isaac Z. Schlueter", - "email": "i@izs.me", - "url": "http://blog.izs.me/" - }, - "bugs": { - "url": "https://github.com/isaacs/uid-number/issues" - }, - "dependencies": {}, - "description": "Convert a username/group name to a uid/gid number", - "devDependencies": {}, - "engines": { - "node": "*" - }, - "homepage": "https://github.com/isaacs/uid-number#readme", - "license": "ISC", - "main": "uid-number.js", - "name": "uid-number", - "optionalDependencies": {}, - "repository": { - "type": "git", - "url": "git://github.com/isaacs/uid-number.git" - }, - "version": "0.0.6" -} diff --git a/deps/npm/node_modules/uid-number/uid-number.js b/deps/npm/node_modules/uid-number/uid-number.js deleted file mode 100644 index bd62184fda7a94..00000000000000 --- a/deps/npm/node_modules/uid-number/uid-number.js +++ /dev/null @@ -1,59 +0,0 @@ -module.exports = uidNumber - -// This module calls into get-uid-gid.js, which sets the -// uid and gid to the supplied argument, in order to find out their -// numeric value. This can't be done in the main node process, -// because otherwise node would be running as that user from this -// point on. - -var child_process = require("child_process") - , path = require("path") - , uidSupport = process.getuid && process.setuid - , uidCache = {} - , gidCache = {} - -function uidNumber (uid, gid, cb) { - if (!uidSupport) return cb() - if (typeof cb !== "function") cb = gid, gid = null - if (typeof cb !== "function") cb = uid, uid = null - if (gid == null) gid = process.getgid() - if (uid == null) uid = process.getuid() - if (!isNaN(gid)) gid = gidCache[gid] = +gid - if (!isNaN(uid)) uid = uidCache[uid] = +uid - - if (uidCache.hasOwnProperty(uid)) uid = uidCache[uid] - if (gidCache.hasOwnProperty(gid)) gid = gidCache[gid] - - if (typeof gid === "number" && typeof uid === "number") { - return process.nextTick(cb.bind(null, null, uid, gid)) - } - - var getter = require.resolve("./get-uid-gid.js") - - child_process.execFile( process.execPath - , [getter, uid, gid] - , function (code, out, stderr) { - if (code) { - var er = new Error("could not get uid/gid\n" + stderr) - er.code = code - return cb(er) - } - - try { - out = JSON.parse(out+"") - } catch (ex) { - return cb(ex) - } - - if (out.error) { - var er = new Error(out.error) - er.errno = out.errno - return cb(er) - } - - if (isNaN(out.uid) || isNaN(out.gid)) return cb(new Error( - "Could not get uid/gid: "+JSON.stringify(out))) - - cb(null, uidCache[uid] = +out.uid, gidCache[gid] = +out.gid) - }) -} diff --git a/deps/npm/node_modules/umask/.npmignore b/deps/npm/node_modules/umask/.npmignore deleted file mode 100644 index 59d842baa84c8b..00000000000000 --- a/deps/npm/node_modules/umask/.npmignore +++ /dev/null @@ -1,28 +0,0 @@ -# Logs -logs -*.log - -# Runtime data -pids -*.pid -*.seed - -# Directory for instrumented libs generated by jscoverage/JSCover -lib-cov - -# Coverage directory used by tools like istanbul -coverage - -# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) -.grunt - -# Compiled binary addons (http://nodejs.org/api/addons.html) -build/Release - -# Dependency directory -# Commenting this out is preferred by some people, see -# https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git- -node_modules - -# Users Environment Variables -.lock-wscript diff --git a/deps/npm/node_modules/umask/ChangeLog b/deps/npm/node_modules/umask/ChangeLog deleted file mode 100644 index 1254674513b6fd..00000000000000 --- a/deps/npm/node_modules/umask/ChangeLog +++ /dev/null @@ -1,9 +0,0 @@ -2015-01-15 Sam Mikes - - * index.js: (convert_fromString) accept decimal strings provided they - don't begin with '0' - -2015-01-14 Sam Mikes - - * index.js: initial rev - diff --git a/deps/npm/node_modules/umask/LICENSE b/deps/npm/node_modules/umask/LICENSE deleted file mode 100644 index e637724b3bc595..00000000000000 --- a/deps/npm/node_modules/umask/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2015 Sam Mikes - -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/umask/README.md b/deps/npm/node_modules/umask/README.md deleted file mode 100644 index 80009ae709b2c5..00000000000000 --- a/deps/npm/node_modules/umask/README.md +++ /dev/null @@ -1,78 +0,0 @@ -# umask - -Convert umask from string <-> number. - -## Installation & Use - -``` -$ npm install -S umask - -var umask = require('umask'); - -console.log(umask.toString(18)); // 0022 - -console.log(umask.fromString('0777')) // 511 -``` - -## API - -### `toString( val )` - -Converts `val` to a 0-padded octal string. `val` is assumed to be a -Number in the correct range (0..511) - -### `fromString( val, [cb] )` - -Converts `val` to a Number that can be used as a umask. `val` can -be of the following forms: - - * String containing octal number (leading 0) - * String containing decimal number - * Number - -In all cases above, the value obtained is then converted to an integer and -checked against the legal `umask` range 0..511 - -`fromString` can be used as a simple converter, with no error feedback, by -omitting the optional callback argument `cb`: - -``` - var mask = umask.fromString(val); - - // mask is now the umask descibed by val or - // the default, 0022 (18 dec) -``` - -The callback arguments are `(err, val)` where `err` is either `null` or an -Error object and `val` is either the converted umask or the default umask, `0022`. - -``` - umask.fromString(val, function (err, val) { - if (err) { - console.error("invalid umask: " + err.message) - } - - /* do something with val */ - }); -``` - -The callback, if provided, is always called **synchronously**. - -### `validate( data, k, val )` - -This is a validation function of the form expected by `nopt`. If -`val` is a valid umask, the function returns true and sets `data[k]`. -If `val` is not a valid umask, the function returns false. - -The `validate` function is stricter than `fromString`: it only accepts -Number or octal String values, and the String value must begin with `0`. -The `validate` function does **not** accept Strings containing decimal -numbers. - -# Maintainer - -Sam Mikes - -# License - -MIT \ No newline at end of file diff --git a/deps/npm/node_modules/umask/index.js b/deps/npm/node_modules/umask/index.js deleted file mode 100644 index 501c0e0c05cb50..00000000000000 --- a/deps/npm/node_modules/umask/index.js +++ /dev/null @@ -1,77 +0,0 @@ -'use strict'; - -var util = require("util"); - -function toString(val) { - val = val.toString(8); - while (val.length < 4) { - val = "0" + val; - } - return val; -} - -var defaultUmask = 18; // 0022; -var defaultUmaskString = toString(defaultUmask); - -function validate(data, k, val) { - // must be either an integer or an octal string. - if (typeof val === "number" && !isNaN(val)) { - data[k] = val; - return true; - } - - if (typeof val === "string") { - if (val.charAt(0) !== "0") { - return false; - } - data[k] = parseInt(val, 8); - return true; - } - - return false; -} - -function convert_fromString(val, cb) { - if (typeof val === "string") { - // check for octal string first - if (val.charAt(0) === '0' && /^[0-7]+$/.test(val)) { - val = parseInt(val, 8); - } else if (val.charAt(0) !== '0' && /^[0-9]+$/.test(val)) { - // legacy support for decimal strings - val = parseInt(val, 10); - } else { - return cb(new Error(util.format("Expected octal string, got %j, defaulting to %j", - val, defaultUmaskString)), - defaultUmask); - } - } else if (typeof val !== "number") { - return cb(new Error(util.format("Expected number or octal string, got %j, defaulting to %j", - val, defaultUmaskString)), - defaultUmask); - } - - val = Math.floor(val); - - if ((val < 0) || (val > 511)) { - return cb(new Error(util.format("Must be in range 0..511 (0000..0777), got %j", val)), - defaultUmask); - } - - cb(null, val); -} - -function fromString(val, cb) { - - // synchronous callback, no zalgo - convert_fromString(val, cb || function (err, result) { - /*jslint unparam:true*/ - val = result; - }); - - return val; -} - -exports.toString = toString; -exports.fromString = fromString; -exports.validate = validate; - diff --git a/deps/npm/node_modules/umask/package.json b/deps/npm/node_modules/umask/package.json deleted file mode 100644 index 2db4afee16d81e..00000000000000 --- a/deps/npm/node_modules/umask/package.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "_args": [ - [ - "umask@1.1.0", - "/Users/rebecca/code/npm" - ] - ], - "_from": "umask@1.1.0", - "_id": "umask@1.1.0", - "_inBundle": false, - "_integrity": "sha1-8pzr8B31F5ErtY/5xOUP3o4zMg0=", - "_location": "/umask", - "_phantomChildren": {}, - "_requested": { - "type": "version", - "registry": true, - "raw": "umask@1.1.0", - "name": "umask", - "escapedName": "umask", - "rawSpec": "1.1.0", - "saveSpec": null, - "fetchSpec": "1.1.0" - }, - "_requiredBy": [ - "/", - "/npm-lifecycle" - ], - "_resolved": "https://registry.npmjs.org/umask/-/umask-1.1.0.tgz", - "_spec": "1.1.0", - "_where": "/Users/rebecca/code/npm", - "author": { - "name": "Sam Mikes", - "email": "smikes@cubane.com" - }, - "bugs": { - "url": "https://github.com/smikes/umask/issues" - }, - "description": "convert umask from string <-> number", - "devDependencies": { - "code": "^1.2.1", - "jslint": "^0.7.2", - "lab": "^5.2.0" - }, - "homepage": "https://github.com/smikes/umask", - "keywords": [ - "umask" - ], - "license": "MIT", - "main": "index.js", - "name": "umask", - "repository": { - "type": "git", - "url": "git+https://github.com/smikes/umask.git" - }, - "scripts": { - "lint": "jslint --terse --latest *.js test/*.js", - "test": "lab -ct 100" - }, - "version": "1.1.0" -} diff --git a/deps/npm/node_modules/umask/test/simple.js b/deps/npm/node_modules/umask/test/simple.js deleted file mode 100644 index 8f29ae745a47fb..00000000000000 --- a/deps/npm/node_modules/umask/test/simple.js +++ /dev/null @@ -1,166 +0,0 @@ -'use strict'; - -var umask = require('..'); - -var Code = require('code'); -var Lab = require('lab'); -var lab = Lab.script(); -exports.lab = lab; - -var describe = lab.describe; -var it = lab.it; -var expect = Code.expect; - -describe('validates umask', function () { - // signature of validator: validate(obj, key, val) - // store valid value in obj[key] - // return false if invalid - - it('accepts numbers', function (done) { - var o = {}, - result = false; - - result = umask.validate(o, 'umask', 0); - expect(result).to.equal(true); - expect(o.umask).to.equal(0); - - result = umask.validate(o, 'umask', 511); - expect(result).to.equal(true); - expect(o.umask).to.equal(511); - done(); - }); - - it('accepts strings', function (done) { - var o = {}, - result; - - result = umask.validate(o, 'umask', "0"); - expect(result).to.equal(true); - expect(o.umask).to.equal(0); - - result = umask.validate(o, 'umask', "0777"); - expect(result).to.equal(true); - expect(o.umask).to.equal(511); - - done(); - }); - - it('rejects other types', function (done) { - expect(umask.validate(undefined, undefined, false)).to.equal(false); - expect(umask.validate(undefined, undefined, {})).to.equal(false); - - done(); - }); - - it('rejects non-octalish strings', function (done) { - expect(umask.validate(undefined, undefined, "1")).to.equal(false); - - done(); - }); - - it('rejects NaN strings', function (done) { - expect(umask.validate(undefined, undefined, NaN)).to.equal(false); - - done(); - }); -}); - -describe('umask to string', function () { - it("converts umask to string", function (done) { - expect(umask.toString(0)).to.equal("0000"); - expect(umask.toString(1)).to.equal("0001"); - expect(umask.toString(7)).to.equal("0007"); - expect(umask.toString(8)).to.equal("0010"); - expect(umask.toString(511)).to.equal("0777"); - expect(umask.toString(18)).to.equal("0022"); - expect(umask.toString(16)).to.equal("0020"); - done(); - }); -}); - -describe('umask from string', function () { - it('converts valid values', function (done) { - expect(umask.fromString("0000")).to.equal(0); - expect(umask.fromString("0")).to.equal(0); - expect(umask.fromString("0777")).to.equal(511); - expect(umask.fromString("0024")).to.equal(20); - - expect(umask.fromString(0)).to.equal(0); - expect(umask.fromString(20)).to.equal(20); - expect(umask.fromString(21)).to.equal(21); - expect(umask.fromString(511)).to.equal(511); - - done(); - }); - - it('converts valid values', function (done) { - expect(umask.fromString("0000")).to.equal(0); - expect(umask.fromString("0")).to.equal(0); - expect(umask.fromString("010")).to.equal(8); - expect(umask.fromString("0777")).to.equal(511); - expect(umask.fromString("0024")).to.equal(20); - - expect(umask.fromString("8")).to.equal(8); - expect(umask.fromString("9")).to.equal(9); - expect(umask.fromString("18")).to.equal(18); - expect(umask.fromString("16")).to.equal(16); - - expect(umask.fromString(0)).to.equal(0); - expect(umask.fromString(20)).to.equal(20); - expect(umask.fromString(21)).to.equal(21); - expect(umask.fromString(511)).to.equal(511); - - expect(umask.fromString(0.1)).to.equal(0); - expect(umask.fromString(511.1)).to.equal(511); - - done(); - }); - - it('errors on empty string', function (done) { - umask.fromString("", function (err, val) { - expect(err.message).to.equal('Expected octal string, got "", defaulting to "0022"'); - expect(val).to.equal(18); - done(); - }); - }); - - it('errors on invalid octal string', function (done) { - umask.fromString("099", function (err, val) { - expect(err.message).to.equal('Expected octal string, got "099", defaulting to "0022"'); - expect(val).to.equal(18); - done(); - }); - }); - - it('errors when non-string, non-number (boolean)', function (done) { - umask.fromString(false, function (err, val) { - expect(err.message).to.equal('Expected number or octal string, got false, defaulting to "0022"'); - expect(val).to.equal(18); - done(); - }); - }); - - it('errors when non-string, non-number (object)', function (done) { - umask.fromString({}, function (err, val) { - expect(err.message).to.equal('Expected number or octal string, got {}, defaulting to "0022"'); - expect(val).to.equal(18); - done(); - }); - }); - - it('errors when out of range (<0)', function (done) { - umask.fromString(-1, function (err, val) { - expect(err.message).to.equal('Must be in range 0..511 (0000..0777), got -1'); - expect(val).to.equal(18); - done(); - }); - }); - - it('errors when out of range (>511)', function (done) { - umask.fromString(512, function (err, val) { - expect(err.message).to.equal('Must be in range 0..511 (0000..0777), got 512'); - expect(val).to.equal(18); - done(); - }); - }); -}); diff --git a/deps/npm/node_modules/unique-filename/package.json b/deps/npm/node_modules/unique-filename/package.json index 293cc3489c3b2c..bc429aa44b079a 100644 --- a/deps/npm/node_modules/unique-filename/package.json +++ b/deps/npm/node_modules/unique-filename/package.json @@ -1,57 +1,27 @@ { - "_from": "unique-filename@1.1.1", - "_id": "unique-filename@1.1.1", - "_inBundle": false, - "_integrity": "sha512-Vmp0jIp2ln35UTXuryvjzkjGdRyf9b2lTXuSYUiPmzRcl3FDtYqAwOnTJkAngD9SWhnoJzDbTKwaOrZ+STtxNQ==", - "_location": "/unique-filename", - "_phantomChildren": {}, - "_requested": { - "type": "version", - "registry": true, - "raw": "unique-filename@1.1.1", - "name": "unique-filename", - "escapedName": "unique-filename", - "rawSpec": "1.1.1", - "saveSpec": null, - "fetchSpec": "1.1.1" + "name": "unique-filename", + "version": "1.1.1", + "description": "Generate a unique filename for use in temporary directories or caches.", + "main": "index.js", + "scripts": { + "test": "standard && tap test" }, - "_requiredBy": [ - "#USER", - "/" - ], - "_resolved": "https://registry.npmjs.org/unique-filename/-/unique-filename-1.1.1.tgz", - "_shasum": "1d69769369ada0583103a1e6ae87681b56573230", - "_spec": "unique-filename@1.1.1", - "_where": "/Users/aeschright/code/cli", - "author": { - "name": "Rebecca Turner", - "email": "me@re-becca.org", - "url": "http://re-becca.org/" + "repository": { + "type": "git", + "url": "https://github.com/iarna/unique-filename.git" }, + "keywords": [], + "author": "Rebecca Turner (http://re-becca.org/)", + "license": "ISC", "bugs": { "url": "https://github.com/iarna/unique-filename/issues" }, - "bundleDependencies": false, - "dependencies": { - "unique-slug": "^2.0.0" - }, - "deprecated": false, - "description": "Generate a unique filename for use in temporary directories or caches.", + "homepage": "https://github.com/iarna/unique-filename", "devDependencies": { "standard": "^5.4.1", "tap": "^2.3.1" }, - "homepage": "https://github.com/iarna/unique-filename", - "keywords": [], - "license": "ISC", - "main": "index.js", - "name": "unique-filename", - "repository": { - "type": "git", - "url": "git+https://github.com/iarna/unique-filename.git" - }, - "scripts": { - "test": "standard && tap test" - }, - "version": "1.1.1" + "dependencies": { + "unique-slug": "^2.0.0" + } } diff --git a/deps/npm/node_modules/unique-slug/.npmignore b/deps/npm/node_modules/unique-slug/.npmignore deleted file mode 100644 index 2833ae874dea64..00000000000000 --- a/deps/npm/node_modules/unique-slug/.npmignore +++ /dev/null @@ -1,6 +0,0 @@ -*~ -.#* -DEADJOE - -node_modules -.nyc_output/ diff --git a/deps/npm/node_modules/unique-slug/.travis.yml b/deps/npm/node_modules/unique-slug/.travis.yml index 3bc5d90c5666ca..5651fce24d8989 100644 --- a/deps/npm/node_modules/unique-slug/.travis.yml +++ b/deps/npm/node_modules/unique-slug/.travis.yml @@ -3,9 +3,8 @@ sudo: false before_install: - "npm -g install npm" node_js: - - "0.8" - - "0.10" - - "0.12" - - "iojs" - - "4" - - "5" + - "6" + - "8" + - "10" + - "lts/*" + - "node" diff --git a/deps/npm/node_modules/find-npm-prefix/LICENSE b/deps/npm/node_modules/unique-slug/LICENSE similarity index 100% rename from deps/npm/node_modules/find-npm-prefix/LICENSE rename to deps/npm/node_modules/unique-slug/LICENSE diff --git a/deps/npm/node_modules/unique-slug/README.md b/deps/npm/node_modules/unique-slug/README.md index 52de4277db20a0..87f92f1d1b5f5c 100644 --- a/deps/npm/node_modules/unique-slug/README.md +++ b/deps/npm/node_modules/unique-slug/README.md @@ -15,6 +15,5 @@ var fileSlug = uniqueSlug('/etc/passwd') If *str* is passed in then the return value will be its murmur hash in hex. -If *str* is not passed in, it will be 4 bytes coverted into 8 hex -characters, generated by `crypto.pseudoRandomBytes`. - +If *str* is not passed in, it will be 4 randomly generated bytes +converted into 8 hexadecimal characters. diff --git a/deps/npm/node_modules/unique-slug/index.js b/deps/npm/node_modules/unique-slug/index.js index 7c5d6c751c5cd0..fa4761ad2e2589 100644 --- a/deps/npm/node_modules/unique-slug/index.js +++ b/deps/npm/node_modules/unique-slug/index.js @@ -1,5 +1,4 @@ 'use strict' -var crypto = require('crypto') var MurmurHash3 = require('imurmurhash') module.exports = function (uniq) { @@ -7,13 +6,6 @@ module.exports = function (uniq) { var hash = new MurmurHash3(uniq) return ('00000000' + hash.result().toString(16)).substr(-8) } else { - // Called without a callback, because this interface should neither block - // nor error (by contrast with randomBytes which will throw an exception - // without enough entropy). - // - // However, due to a change in Node 0.10.27+, pseudoRandomBytes is now the - // same as randomBytes, and may in fact block in situations where - // insufficent entropy is available. - return crypto.pseudoRandomBytes(4).toString('hex') + return (Math.random().toString(16) + '0000000').substr(2, 8) } } diff --git a/deps/npm/node_modules/unique-slug/package.json b/deps/npm/node_modules/unique-slug/package.json index fb5e08b610bfff..2142e68561f5d8 100644 --- a/deps/npm/node_modules/unique-slug/package.json +++ b/deps/npm/node_modules/unique-slug/package.json @@ -1,56 +1,23 @@ { - "_from": "unique-slug@^2.0.0", - "_id": "unique-slug@2.0.0", - "_inBundle": false, - "_integrity": "sha1-22Z258fMBimHj/GWCXx4hVrp9Ks=", - "_location": "/unique-slug", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "unique-slug@^2.0.0", - "name": "unique-slug", - "escapedName": "unique-slug", - "rawSpec": "^2.0.0", - "saveSpec": null, - "fetchSpec": "^2.0.0" - }, - "_requiredBy": [ - "/unique-filename" - ], - "_resolved": "https://registry.npmjs.org/unique-slug/-/unique-slug-2.0.0.tgz", - "_shasum": "db6676e7c7cc0629878ff196097c78855ae9f4ab", - "_spec": "unique-slug@^2.0.0", - "_where": "/Users/rebecca/code/npm/node_modules/unique-filename", - "author": { - "name": "Rebecca Turner", - "email": "me@re-becca.org", - "url": "http://re-becca.org" - }, - "bugs": { - "url": "https://github.com/iarna/unique-slug/issues" - }, - "bundleDependencies": false, - "dependencies": { - "imurmurhash": "^0.1.4" - }, - "deprecated": false, + "name": "unique-slug", + "version": "2.0.2", "description": "Generate a unique character string suitible for use in files and URLs.", - "devDependencies": { - "standard": "^5.4.1", - "tap": "^2.3.1" + "main": "index.js", + "scripts": { + "test": "standard && tap --coverage test" }, - "homepage": "https://github.com/iarna/unique-slug#readme", "keywords": [], + "author": "Rebecca Turner (http://re-becca.org)", "license": "ISC", - "main": "index.js", - "name": "unique-slug", + "devDependencies": { + "standard": "^12.0.1", + "tap": "^12.7.0" + }, "repository": { "type": "git", "url": "git://github.com/iarna/unique-slug.git" }, - "scripts": { - "test": "standard && tap --coverage test" - }, - "version": "2.0.0" + "dependencies": { + "imurmurhash": "^0.1.4" + } } diff --git a/deps/npm/node_modules/unique-string/index.js b/deps/npm/node_modules/unique-string/index.js deleted file mode 100644 index 5bc7787f4b3db4..00000000000000 --- a/deps/npm/node_modules/unique-string/index.js +++ /dev/null @@ -1,4 +0,0 @@ -'use strict'; -const cryptoRandomString = require('crypto-random-string'); - -module.exports = () => cryptoRandomString(32); diff --git a/deps/npm/node_modules/unique-string/license b/deps/npm/node_modules/unique-string/license deleted file mode 100644 index 654d0bfe943437..00000000000000 --- a/deps/npm/node_modules/unique-string/license +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -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/deps/npm/node_modules/unique-string/package.json b/deps/npm/node_modules/unique-string/package.json deleted file mode 100644 index c25934a4ab1b4b..00000000000000 --- a/deps/npm/node_modules/unique-string/package.json +++ /dev/null @@ -1,76 +0,0 @@ -{ - "_from": "unique-string@^1.0.0", - "_id": "unique-string@1.0.0", - "_inBundle": false, - "_integrity": "sha1-nhBXzKhRq7kzmPizOuGHuZyuwRo=", - "_location": "/unique-string", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "unique-string@^1.0.0", - "name": "unique-string", - "escapedName": "unique-string", - "rawSpec": "^1.0.0", - "saveSpec": null, - "fetchSpec": "^1.0.0" - }, - "_requiredBy": [ - "/configstore" - ], - "_resolved": "https://registry.npmjs.org/unique-string/-/unique-string-1.0.0.tgz", - "_shasum": "9e1057cca851abb93398f8b33ae187b99caec11a", - "_spec": "unique-string@^1.0.0", - "_where": "/Users/rebecca/code/npm/node_modules/configstore", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "bugs": { - "url": "https://github.com/sindresorhus/unique-string/issues" - }, - "bundleDependencies": false, - "dependencies": { - "crypto-random-string": "^1.0.0" - }, - "deprecated": false, - "description": "Generate a unique random string", - "devDependencies": { - "ava": "*", - "xo": "*" - }, - "engines": { - "node": ">=4" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/sindresorhus/unique-string#readme", - "keywords": [ - "unique", - "string", - "random", - "uniq", - "str", - "rand", - "text", - "id", - "identifier", - "slug", - "hex" - ], - "license": "MIT", - "name": "unique-string", - "repository": { - "type": "git", - "url": "git+https://github.com/sindresorhus/unique-string.git" - }, - "scripts": { - "test": "xo && ava" - }, - "version": "1.0.0", - "xo": { - "esnext": true - } -} diff --git a/deps/npm/node_modules/unique-string/readme.md b/deps/npm/node_modules/unique-string/readme.md deleted file mode 100644 index 5d5ac971e4c563..00000000000000 --- a/deps/npm/node_modules/unique-string/readme.md +++ /dev/null @@ -1,32 +0,0 @@ -# unique-string [![Build Status](https://travis-ci.org/sindresorhus/unique-string.svg?branch=master)](https://travis-ci.org/sindresorhus/unique-string) - -> Generate a unique random string - - -## Install - -``` -$ npm install --save unique-string -``` - - -## Usage - -```js -const uniqueString = require('unique-string'); - -uniqueString(); -//=> 'b4de2a49c8ffa3fbee04446f045483b2' -``` - - -## API - -### uniqueString() - -Returns a 32 character unique string. Matches the length of MD5, which is [unique enough](http://stackoverflow.com/a/2444336/64949) for non-crypto purposes. - - -## License - -MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/deps/npm/node_modules/unpipe/HISTORY.md b/deps/npm/node_modules/unpipe/HISTORY.md deleted file mode 100644 index 85e0f8d747dc2a..00000000000000 --- a/deps/npm/node_modules/unpipe/HISTORY.md +++ /dev/null @@ -1,4 +0,0 @@ -1.0.0 / 2015-06-14 -================== - - * Initial release diff --git a/deps/npm/node_modules/unpipe/LICENSE b/deps/npm/node_modules/unpipe/LICENSE deleted file mode 100644 index aed0138278a940..00000000000000 --- a/deps/npm/node_modules/unpipe/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -(The MIT License) - -Copyright (c) 2015 Douglas Christopher Wilson - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -'Software'), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/deps/npm/node_modules/unpipe/README.md b/deps/npm/node_modules/unpipe/README.md deleted file mode 100644 index e536ad2c045bba..00000000000000 --- a/deps/npm/node_modules/unpipe/README.md +++ /dev/null @@ -1,43 +0,0 @@ -# unpipe - -[![NPM Version][npm-image]][npm-url] -[![NPM Downloads][downloads-image]][downloads-url] -[![Node.js Version][node-image]][node-url] -[![Build Status][travis-image]][travis-url] -[![Test Coverage][coveralls-image]][coveralls-url] - -Unpipe a stream from all destinations. - -## Installation - -```sh -$ npm install unpipe -``` - -## API - -```js -var unpipe = require('unpipe') -``` - -### unpipe(stream) - -Unpipes all destinations from a given stream. With stream 2+, this is -equivalent to `stream.unpipe()`. When used with streams 1 style streams -(typically Node.js 0.8 and below), this module attempts to undo the -actions done in `stream.pipe(dest)`. - -## License - -[MIT](LICENSE) - -[npm-image]: https://img.shields.io/npm/v/unpipe.svg -[npm-url]: https://npmjs.org/package/unpipe -[node-image]: https://img.shields.io/node/v/unpipe.svg -[node-url]: http://nodejs.org/download/ -[travis-image]: https://img.shields.io/travis/stream-utils/unpipe.svg -[travis-url]: https://travis-ci.org/stream-utils/unpipe -[coveralls-image]: https://img.shields.io/coveralls/stream-utils/unpipe.svg -[coveralls-url]: https://coveralls.io/r/stream-utils/unpipe?branch=master -[downloads-image]: https://img.shields.io/npm/dm/unpipe.svg -[downloads-url]: https://npmjs.org/package/unpipe diff --git a/deps/npm/node_modules/unpipe/index.js b/deps/npm/node_modules/unpipe/index.js deleted file mode 100644 index 15c3d97a12b484..00000000000000 --- a/deps/npm/node_modules/unpipe/index.js +++ /dev/null @@ -1,69 +0,0 @@ -/*! - * unpipe - * Copyright(c) 2015 Douglas Christopher Wilson - * MIT Licensed - */ - -'use strict' - -/** - * Module exports. - * @public - */ - -module.exports = unpipe - -/** - * Determine if there are Node.js pipe-like data listeners. - * @private - */ - -function hasPipeDataListeners(stream) { - var listeners = stream.listeners('data') - - for (var i = 0; i < listeners.length; i++) { - if (listeners[i].name === 'ondata') { - return true - } - } - - return false -} - -/** - * Unpipe a stream from all destinations. - * - * @param {object} stream - * @public - */ - -function unpipe(stream) { - if (!stream) { - throw new TypeError('argument stream is required') - } - - if (typeof stream.unpipe === 'function') { - // new-style - stream.unpipe() - return - } - - // Node.js 0.8 hack - if (!hasPipeDataListeners(stream)) { - return - } - - var listener - var listeners = stream.listeners('close') - - for (var i = 0; i < listeners.length; i++) { - listener = listeners[i] - - if (listener.name !== 'cleanup' && listener.name !== 'onclose') { - continue - } - - // invoke the listener - listener.call(stream) - } -} diff --git a/deps/npm/node_modules/unpipe/package.json b/deps/npm/node_modules/unpipe/package.json deleted file mode 100644 index d04acd0db75dca..00000000000000 --- a/deps/npm/node_modules/unpipe/package.json +++ /dev/null @@ -1,66 +0,0 @@ -{ - "_args": [ - [ - "unpipe@1.0.0", - "/Users/rebecca/code/npm" - ] - ], - "_from": "unpipe@1.0.0", - "_id": "unpipe@1.0.0", - "_inBundle": false, - "_integrity": "sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw=", - "_location": "/unpipe", - "_phantomChildren": {}, - "_requested": { - "type": "version", - "registry": true, - "raw": "unpipe@1.0.0", - "name": "unpipe", - "escapedName": "unpipe", - "rawSpec": "1.0.0", - "saveSpec": null, - "fetchSpec": "1.0.0" - }, - "_requiredBy": [ - "/", - "/finalhandler" - ], - "_resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", - "_spec": "1.0.0", - "_where": "/Users/rebecca/code/npm", - "author": { - "name": "Douglas Christopher Wilson", - "email": "doug@somethingdoug.com" - }, - "bugs": { - "url": "https://github.com/stream-utils/unpipe/issues" - }, - "description": "Unpipe a stream from all destinations", - "devDependencies": { - "istanbul": "0.3.15", - "mocha": "2.2.5", - "readable-stream": "1.1.13" - }, - "engines": { - "node": ">= 0.8" - }, - "files": [ - "HISTORY.md", - "LICENSE", - "README.md", - "index.js" - ], - "homepage": "https://github.com/stream-utils/unpipe#readme", - "license": "MIT", - "name": "unpipe", - "repository": { - "type": "git", - "url": "git+https://github.com/stream-utils/unpipe.git" - }, - "scripts": { - "test": "mocha --reporter spec --bail --check-leaks test/", - "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --check-leaks test/", - "test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --check-leaks test/" - }, - "version": "1.0.0" -} diff --git a/deps/npm/node_modules/unzip-response/index.js b/deps/npm/node_modules/unzip-response/index.js deleted file mode 100644 index e97b9937ae9a4b..00000000000000 --- a/deps/npm/node_modules/unzip-response/index.js +++ /dev/null @@ -1,36 +0,0 @@ -'use strict'; -const PassThrough = require('stream').PassThrough; -const zlib = require('zlib'); - -module.exports = res => { - // TODO: use Array#includes when targeting Node.js 6 - if (['gzip', 'deflate'].indexOf(res.headers['content-encoding']) === -1) { - return res; - } - - const unzip = zlib.createUnzip(); - const stream = new PassThrough(); - - stream.httpVersion = res.httpVersion; - stream.headers = res.headers; - stream.rawHeaders = res.rawHeaders; - stream.trailers = res.trailers; - stream.rawTrailers = res.rawTrailers; - stream.setTimeout = res.setTimeout.bind(res); - stream.statusCode = res.statusCode; - stream.statusMessage = res.statusMessage; - stream.socket = res.socket; - - unzip.on('error', err => { - if (err.code === 'Z_BUF_ERROR') { - stream.end(); - return; - } - - stream.emit('error', err); - }); - - res.pipe(unzip).pipe(stream); - - return stream; -}; diff --git a/deps/npm/node_modules/unzip-response/license b/deps/npm/node_modules/unzip-response/license deleted file mode 100644 index 32a16ce321fbcf..00000000000000 --- a/deps/npm/node_modules/unzip-response/license +++ /dev/null @@ -1,21 +0,0 @@ -`The MIT License (MIT) - -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/deps/npm/node_modules/unzip-response/package.json b/deps/npm/node_modules/unzip-response/package.json deleted file mode 100644 index 981355c77d07e2..00000000000000 --- a/deps/npm/node_modules/unzip-response/package.json +++ /dev/null @@ -1,81 +0,0 @@ -{ - "_from": "unzip-response@^2.0.1", - "_id": "unzip-response@2.0.1", - "_inBundle": false, - "_integrity": "sha1-0vD3N9FrBhXnKmk17QQhRXLVb5c=", - "_location": "/unzip-response", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "unzip-response@^2.0.1", - "name": "unzip-response", - "escapedName": "unzip-response", - "rawSpec": "^2.0.1", - "saveSpec": null, - "fetchSpec": "^2.0.1" - }, - "_requiredBy": [ - "/got" - ], - "_resolved": "https://registry.npmjs.org/unzip-response/-/unzip-response-2.0.1.tgz", - "_shasum": "d2f0f737d16b0615e72a6935ed04214572d56f97", - "_spec": "unzip-response@^2.0.1", - "_where": "/Users/rebecca/code/npm/node_modules/got", - "bugs": { - "url": "https://github.com/sindresorhus/unzip-response/issues" - }, - "bundleDependencies": false, - "deprecated": false, - "description": "Unzip a HTTP response if needed", - "devDependencies": { - "ava": "*", - "get-stream": "^2.3.0", - "pify": "^2.3.0", - "rfpify": "^1.0.0", - "xo": "*" - }, - "engines": { - "node": ">=4" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/sindresorhus/unzip-response#readme", - "keywords": [ - "http", - "unzip", - "zlib", - "gzip", - "deflate", - "incoming", - "message", - "response", - "stream" - ], - "license": "MIT", - "maintainers": [ - { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - { - "name": "Vsevolod Strukchinsky", - "email": "floatdrop@gmail.com", - "url": "github.com/floatdrop" - } - ], - "name": "unzip-response", - "repository": { - "type": "git", - "url": "git+https://github.com/sindresorhus/unzip-response.git" - }, - "scripts": { - "test": "xo && ava" - }, - "version": "2.0.1", - "xo": { - "esnext": true - } -} diff --git a/deps/npm/node_modules/unzip-response/readme.md b/deps/npm/node_modules/unzip-response/readme.md deleted file mode 100644 index 87a62c4b3dfefe..00000000000000 --- a/deps/npm/node_modules/unzip-response/readme.md +++ /dev/null @@ -1,29 +0,0 @@ -# unzip-response [![Build Status](https://travis-ci.org/sindresorhus/unzip-response.svg?branch=master)](https://travis-ci.org/sindresorhus/unzip-response) - -> Unzip a HTTP response if needed - -Unzips the response from [`http.request`](https://nodejs.org/api/http.html#http_http_request_options_callback) if it's gzipped/deflated, otherwise just passes it through. - - -## Install - -``` -$ npm install --save unzip-response -``` - - -## Usage - -```js -const http = require('http'); -const unzipResponse = require('unzip-response'); - -http.get('http://sindresorhus.com', res => { - res = unzipResponse(res); -}); -``` - - -## License - -MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/deps/npm/node_modules/update-notifier/check.js b/deps/npm/node_modules/update-notifier/check.js deleted file mode 100644 index 521f84af8ace64..00000000000000 --- a/deps/npm/node_modules/update-notifier/check.js +++ /dev/null @@ -1,22 +0,0 @@ -/* eslint-disable unicorn/no-process-exit */ -'use strict'; -let updateNotifier = require('.'); - -const options = JSON.parse(process.argv[2]); - -updateNotifier = new updateNotifier.UpdateNotifier(options); - -updateNotifier.checkNpm().then(update => { - // Only update the last update check time on success - updateNotifier.config.set('lastUpdateCheck', Date.now()); - - if (update.type && update.type !== 'latest') { - updateNotifier.config.set('update', update); - } - - // Call process exit explicitly to terminate the child process - // Otherwise the child process will run forever, according to the Node.js docs - process.exit(); -}).catch(() => { - process.exit(1); -}); diff --git a/deps/npm/node_modules/update-notifier/index.js b/deps/npm/node_modules/update-notifier/index.js deleted file mode 100644 index 38ff01e2954d09..00000000000000 --- a/deps/npm/node_modules/update-notifier/index.js +++ /dev/null @@ -1,155 +0,0 @@ -'use strict'; -const spawn = require('child_process').spawn; -const path = require('path'); -const format = require('util').format; -const importLazy = require('import-lazy')(require); - -const configstore = importLazy('configstore'); -const chalk = importLazy('chalk'); -const semverDiff = importLazy('semver-diff'); -const latestVersion = importLazy('latest-version'); -const isNpm = importLazy('is-npm'); -const isInstalledGlobally = importLazy('is-installed-globally'); -const boxen = importLazy('boxen'); -const xdgBasedir = importLazy('xdg-basedir'); -const isCi = importLazy('is-ci'); -const ONE_DAY = 1000 * 60 * 60 * 24; - -class UpdateNotifier { - constructor(options) { - options = options || {}; - this.options = options; - options.pkg = options.pkg || {}; - - // Reduce pkg to the essential keys. with fallback to deprecated options - // TODO: Remove deprecated options at some point far into the future - options.pkg = { - name: options.pkg.name || options.packageName, - version: options.pkg.version || options.packageVersion - }; - - if (!options.pkg.name || !options.pkg.version) { - throw new Error('pkg.name and pkg.version required'); - } - - this.packageName = options.pkg.name; - this.packageVersion = options.pkg.version; - this.updateCheckInterval = typeof options.updateCheckInterval === 'number' ? options.updateCheckInterval : ONE_DAY; - this.hasCallback = typeof options.callback === 'function'; - this.callback = options.callback || (() => {}); - this.disabled = 'NO_UPDATE_NOTIFIER' in process.env || - process.argv.indexOf('--no-update-notifier') !== -1 || - isCi(); - this.shouldNotifyInNpmScript = options.shouldNotifyInNpmScript; - - if (!this.disabled && !this.hasCallback) { - try { - const ConfigStore = configstore(); - this.config = new ConfigStore(`update-notifier-${this.packageName}`, { - optOut: false, - // Init with the current time so the first check is only - // after the set interval, so not to bother users right away - lastUpdateCheck: Date.now() - }); - } catch (err) { - // Expecting error code EACCES or EPERM - const msg = - chalk().yellow(format(' %s update check failed ', options.pkg.name)) + - format('\n Try running with %s or get access ', chalk().cyan('sudo')) + - '\n to the local update config store via \n' + - chalk().cyan(format(' sudo chown -R $USER:$(id -gn $USER) %s ', xdgBasedir().config)); - - process.on('exit', () => { - console.error('\n' + boxen()(msg, {align: 'center'})); - }); - } - } - } - check() { - if (this.hasCallback) { - this.checkNpm() - .then(update => this.callback(null, update)) - .catch(err => this.callback(err)); - return; - } - - if ( - !this.config || - this.config.get('optOut') || - this.disabled - ) { - return; - } - - this.update = this.config.get('update'); - - if (this.update) { - this.config.delete('update'); - } - - // Only check for updates on a set interval - if (Date.now() - this.config.get('lastUpdateCheck') < this.updateCheckInterval) { - return; - } - - // Spawn a detached process, passing the options as an environment property - spawn(process.execPath, [path.join(__dirname, 'check.js'), JSON.stringify(this.options)], { - detached: true, - stdio: 'ignore' - }).unref(); - } - checkNpm() { - return latestVersion()(this.packageName).then(latestVersion => { - return { - latest: latestVersion, - current: this.packageVersion, - type: semverDiff()(this.packageVersion, latestVersion) || 'latest', - name: this.packageName - }; - }); - } - notify(opts) { - const suppressForNpm = !this.shouldNotifyInNpmScript && isNpm(); - if (!process.stdout.isTTY || suppressForNpm || !this.update) { - return this; - } - - opts = Object.assign({isGlobal: isInstalledGlobally()}, opts); - - opts.message = opts.message || 'Update available ' + chalk().dim(this.update.current) + chalk().reset(' → ') + - chalk().green(this.update.latest) + ' \nRun ' + chalk().cyan('npm i ' + (opts.isGlobal ? '-g ' : '') + this.packageName) + ' to update'; - - opts.boxenOpts = opts.boxenOpts || { - padding: 1, - margin: 1, - align: 'center', - borderColor: 'yellow', - borderStyle: 'round' - }; - - const message = '\n' + boxen()(opts.message, opts.boxenOpts); - - if (opts.defer === false) { - console.error(message); - } else { - process.on('exit', () => { - console.error(message); - }); - - process.on('SIGINT', () => { - console.error(''); - process.exit(); - }); - } - - return this; - } -} - -module.exports = options => { - const updateNotifier = new UpdateNotifier(options); - updateNotifier.check(); - return updateNotifier; -}; - -module.exports.UpdateNotifier = UpdateNotifier; diff --git a/deps/npm/node_modules/update-notifier/license b/deps/npm/node_modules/update-notifier/license deleted file mode 100644 index cea5a35525f347..00000000000000 --- a/deps/npm/node_modules/update-notifier/license +++ /dev/null @@ -1,9 +0,0 @@ -Copyright Google - -Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/deps/npm/node_modules/update-notifier/package.json b/deps/npm/node_modules/update-notifier/package.json deleted file mode 100644 index fd049446e1301a..00000000000000 --- a/deps/npm/node_modules/update-notifier/package.json +++ /dev/null @@ -1,89 +0,0 @@ -{ - "_from": "update-notifier@2.5.0", - "_id": "update-notifier@2.5.0", - "_inBundle": false, - "_integrity": "sha512-gwMdhgJHGuj/+wHJJs9e6PcCszpxR1b236igrOkUofGhqJuG+amlIKwApH1IW1WWl7ovZxsX49lMBWLxSdm5Dw==", - "_location": "/update-notifier", - "_phantomChildren": {}, - "_requested": { - "type": "version", - "registry": true, - "raw": "update-notifier@2.5.0", - "name": "update-notifier", - "escapedName": "update-notifier", - "rawSpec": "2.5.0", - "saveSpec": null, - "fetchSpec": "2.5.0" - }, - "_requiredBy": [ - "#USER", - "/", - "/libnpx" - ], - "_resolved": "https://registry.npmjs.org/update-notifier/-/update-notifier-2.5.0.tgz", - "_shasum": "d0744593e13f161e406acb1d9408b72cad08aff6", - "_spec": "update-notifier@2.5.0", - "_where": "/Users/ruyadorno/Documents/workspace/cli/latest", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "https://sindresorhus.com" - }, - "bugs": { - "url": "https://github.com/yeoman/update-notifier/issues" - }, - "bundleDependencies": false, - "dependencies": { - "boxen": "^1.2.1", - "chalk": "^2.0.1", - "configstore": "^3.0.0", - "import-lazy": "^2.1.0", - "is-ci": "^1.0.10", - "is-installed-globally": "^0.1.0", - "is-npm": "^1.0.0", - "latest-version": "^3.0.0", - "semver-diff": "^2.0.0", - "xdg-basedir": "^3.0.0" - }, - "deprecated": false, - "description": "Update notifications for your CLI app", - "devDependencies": { - "ava": "*", - "clear-module": "^2.1.0", - "fixture-stdout": "^0.2.1", - "mock-require": "^2.0.2", - "strip-ansi": "^4.0.0", - "xo": "^0.18.2" - }, - "engines": { - "node": ">=4" - }, - "files": [ - "index.js", - "check.js" - ], - "homepage": "https://github.com/yeoman/update-notifier#readme", - "keywords": [ - "npm", - "update", - "updater", - "notify", - "notifier", - "check", - "checker", - "cli", - "module", - "package", - "version" - ], - "license": "BSD-2-Clause", - "name": "update-notifier", - "repository": { - "type": "git", - "url": "git+https://github.com/yeoman/update-notifier.git" - }, - "scripts": { - "test": "xo && ava --timeout=20s" - }, - "version": "2.5.0" -} diff --git a/deps/npm/node_modules/update-notifier/readme.md b/deps/npm/node_modules/update-notifier/readme.md deleted file mode 100644 index ef6a1a8b1cd881..00000000000000 --- a/deps/npm/node_modules/update-notifier/readme.md +++ /dev/null @@ -1,193 +0,0 @@ -# update-notifier [![Build Status](https://travis-ci.org/yeoman/update-notifier.svg?branch=master)](https://travis-ci.org/yeoman/update-notifier) - -> Update notifications for your CLI app - -![](screenshot.png) - -Inform users of your package of updates in a non-intrusive way. - -#### Contents - -- [Install](#install) -- [Usage](#usage) -- [How](#how) -- [API](#api) -- [About](#about) -- [Users](#users) - - -## Install - -``` -$ npm install update-notifier -``` - - -## Usage - -### Simple - -```js -const updateNotifier = require('update-notifier'); -const pkg = require('./package.json'); - -updateNotifier({pkg}).notify(); -``` - -### Comprehensive - -```js -const updateNotifier = require('update-notifier'); -const pkg = require('./package.json'); - -// Checks for available update and returns an instance -const notifier = updateNotifier({pkg}); - -// Notify using the built-in convenience method -notifier.notify(); - -// `notifier.update` contains some useful info about the update -console.log(notifier.update); -/* -{ - latest: '1.0.1', - current: '1.0.0', - type: 'patch', // Possible values: latest, major, minor, patch, prerelease, build - name: 'pageres' -} -*/ -``` - -### Options and custom message - -```js -const notifier = updateNotifier({ - pkg, - updateCheckInterval: 1000 * 60 * 60 * 24 * 7 // 1 week -}); - -if (notifier.update) { - console.log(`Update available: ${notifier.update.latest}`); -} -``` - - -## How - -Whenever you initiate the update notifier and it's not within the interval threshold, it will asynchronously check with npm in the background for available updates, then persist the result. The next time the notifier is initiated, the result will be loaded into the `.update` property. This prevents any impact on your package startup performance. -The update check is done in a unref'ed [child process](https://nodejs.org/api/child_process.html#child_process_child_process_spawn_command_args_options). This means that if you call `process.exit`, the check will still be performed in its own process. - -The first time the user runs your app, it will check for an update, and even if an update is available, it will wait the specified `updateCheckInterval` before notifying the user. This is done to not be annoying to the user, but might surprise you as an implementer if you're testing whether it works. Check out [`example.js`](example.js) to quickly test out `update-notifier` and see how you can test that it works in your app. - - -## API - -### notifier = updateNotifier(options) - -Checks if there is an available update. Accepts options defined below. Returns an instance with an `.update` property there is an available update, otherwise `undefined`. - -### options - -#### pkg - -Type: `Object` - -##### name - -*Required*
    -Type: `string` - -##### version - -*Required*
    -Type: `string` - -#### updateCheckInterval - -Type: `number`
    -Default: `1000 * 60 * 60 * 24` *(1 day)* - -How often to check for updates. - -#### callback(error, update) - -Type: `Function` - -Passing a callback here will make it check for an update directly and report right away. Not recommended as you won't get the benefits explained in [`How`](#how). `update` is equal to `notifier.update`. - -### notifier.notify([options]) - -Convenience method to display a notification message. *(See screenshot)* - -Only notifies if there is an update and the process is [TTY](https://nodejs.org/api/process.html#process_tty_terminals_and_process_stdout). - -#### options - -Type: `Object` - -##### defer - -Type: `boolean`
    -Default: `true` - -Defer showing the notification to after the process has exited. - -##### message - -Type: `string`
    -Default: [See above screenshot](https://github.com/yeoman/update-notifier#update-notifier-) - -Message that will be shown when an update is available. - -##### isGlobal - -Type: `boolean`
    -Default: `true` - -Include the `-g` argument in the default message's `npm i` recommendation. You may want to change this if your CLI package can be installed as a dependency of another project, and don't want to recommend a global installation. This option is ignored if you supply your own `message` (see above). - -##### boxenOpts - -Type: `Object`
    -Default: `{padding: 1, margin: 1, align: 'center', borderColor: 'yellow', borderStyle: 'round'}` *(See screenshot)* - -Options object that will be passed to [`boxen`](https://github.com/sindresorhus/boxen). - -##### shouldNotifyInNpmScript - -Type: `boolean`
    -Default: `false` - -Allows notification to be shown when running as an npm script. - -### User settings - -Users of your module have the ability to opt-out of the update notifier by changing the `optOut` property to `true` in `~/.config/configstore/update-notifier-[your-module-name].json`. The path is available in `notifier.config.path`. - -Users can also opt-out by [setting the environment variable](https://github.com/sindresorhus/guides/blob/master/set-environment-variables.md) `NO_UPDATE_NOTIFIER` with any value or by using the `--no-update-notifier` flag on a per run basis. - -The check is also skipped on CI automatically. - - -## About - -The idea for this module came from the desire to apply the browser update strategy to CLI tools, where everyone is always on the latest version. We first tried automatic updating, which we discovered wasn't popular. This is the second iteration of that idea, but limited to just update notifications. - - -## Users - -There are a bunch projects using it: - -- [npm](https://github.com/npm/npm) - Package manager for JavaScript -- [Yeoman](http://yeoman.io) - Modern workflows for modern webapps -- [AVA](https://ava.li) - Simple concurrent test runner -- [XO](https://github.com/xojs/xo) - JavaScript happiness style linter -- [Pageres](https://github.com/sindresorhus/pageres) - Capture website screenshots -- [Node GH](http://nodegh.io) - GitHub command line tool - -[And 1600+ more…](https://www.npmjs.org/browse/depended/update-notifier) - - -## License - -BSD-2-Clause © Google diff --git a/deps/npm/node_modules/uri-js/LICENSE b/deps/npm/node_modules/uri-js/LICENSE new file mode 100755 index 00000000000000..9338bde8eb43b2 --- /dev/null +++ b/deps/npm/node_modules/uri-js/LICENSE @@ -0,0 +1,11 @@ +Copyright 2011 Gary Court. All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY GARY COURT "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GARY COURT OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +The views and conclusions contained in the software and documentation are those of the authors and should not be interpreted as representing official policies, either expressed or implied, of Gary Court. diff --git a/deps/npm/node_modules/uri-js/README.md b/deps/npm/node_modules/uri-js/README.md new file mode 100755 index 00000000000000..3dbe4054f2577a --- /dev/null +++ b/deps/npm/node_modules/uri-js/README.md @@ -0,0 +1,201 @@ +# URI.js + +URI.js is an [RFC 3986](http://www.ietf.org/rfc/rfc3986.txt) compliant, scheme extendable URI parsing/validating/resolving library for all JavaScript environments (browsers, Node.js, etc). +It is also compliant with the IRI ([RFC 3987](http://www.ietf.org/rfc/rfc3987.txt)), IDNA ([RFC 5890](http://www.ietf.org/rfc/rfc5890.txt)), IPv6 Address ([RFC 5952](http://www.ietf.org/rfc/rfc5952.txt)), IPv6 Zone Identifier ([RFC 6874](http://www.ietf.org/rfc/rfc6874.txt)) specifications. + +URI.js has an extensive test suite, and works in all (Node.js, web) environments. It weighs in at 6.4kb (gzipped, 17kb deflated). + +## API + +### Parsing + + URI.parse("uri://user:pass@example.com:123/one/two.three?q1=a1&q2=a2#body"); + //returns: + //{ + // scheme : "uri", + // userinfo : "user:pass", + // host : "example.com", + // port : 123, + // path : "/one/two.three", + // query : "q1=a1&q2=a2", + // fragment : "body" + //} + +### Serializing + + URI.serialize({scheme : "http", host : "example.com", fragment : "footer"}) === "http://example.com/#footer" + +### Resolving + + URI.resolve("uri://a/b/c/d?q", "../../g") === "uri://a/g" + +### Normalizing + + URI.normalize("HTTP://ABC.com:80/%7Esmith/home.html") === "http://abc.com/~smith/home.html" + +### Comparison + + URI.equal("example://a/b/c/%7Bfoo%7D", "eXAMPLE://a/./b/../b/%63/%7bfoo%7d") === true + +### IP Support + + //IPv4 normalization + URI.normalize("//192.068.001.000") === "//192.68.1.0" + + //IPv6 normalization + URI.normalize("//[2001:0:0DB8::0:0001]") === "//[2001:0:db8::1]" + + //IPv6 zone identifier support + URI.parse("//[2001:db8::7%25en1]"); + //returns: + //{ + // host : "2001:db8::7%en1" + //} + +### IRI Support + + //convert IRI to URI + URI.serialize(URI.parse("http://examplé.org/rosé")) === "http://xn--exampl-gva.org/ros%C3%A9" + //convert URI to IRI + URI.serialize(URI.parse("http://xn--exampl-gva.org/ros%C3%A9"), {iri:true}) === "http://examplé.org/rosé" + +### Options + +All of the above functions can accept an additional options argument that is an object that can contain one or more of the following properties: + +* `scheme` (string) + + Indicates the scheme that the URI should be treated as, overriding the URI's normal scheme parsing behavior. + +* `reference` (string) + + If set to `"suffix"`, it indicates that the URI is in the suffix format, and the validator will use the option's `scheme` property to determine the URI's scheme. + +* `tolerant` (boolean, false) + + If set to `true`, the parser will relax URI resolving rules. + +* `absolutePath` (boolean, false) + + If set to `true`, the serializer will not resolve a relative `path` component. + +* `iri` (boolean, false) + + If set to `true`, the serializer will unescape non-ASCII characters as per [RFC 3987](http://www.ietf.org/rfc/rfc3987.txt). + +* `unicodeSupport` (boolean, false) + + If set to `true`, the parser will unescape non-ASCII characters in the parsed output as per [RFC 3987](http://www.ietf.org/rfc/rfc3987.txt). + +* `domainHost` (boolean, false) + + If set to `true`, the library will treat the `host` component as a domain name, and convert IDNs (International Domain Names) as per [RFC 5891](http://www.ietf.org/rfc/rfc5891.txt). + +## Scheme Extendable + +URI.js supports inserting custom [scheme](http://en.wikipedia.org/wiki/URI_scheme) dependent processing rules. Currently, URI.js has built in support for the following schemes: + +* http \[[RFC 2616](http://www.ietf.org/rfc/rfc2616.txt)\] +* https \[[RFC 2818](http://www.ietf.org/rfc/rfc2818.txt)\] +* mailto \[[RFC 6068](http://www.ietf.org/rfc/rfc6068.txt)\] +* urn \[[RFC 2141](http://www.ietf.org/rfc/rfc2141.txt)\] +* urn:uuid \[[RFC 4122](http://www.ietf.org/rfc/rfc4122.txt)\] + +### HTTP/HTTPS Support + + URI.equal("HTTP://ABC.COM:80", "http://abc.com/") === true + URI.equal("https://abc.com", "HTTPS://ABC.COM:443/") === true + +### WS/WSS Support + + URI.parse("wss://example.com/foo?bar=baz"); + //returns: + //{ + // scheme : "wss", + // host: "example.com", + // resourceName: "/foo?bar=baz", + // secure: true, + //} + + URI.equal("WS://ABC.COM:80/chat#one", "ws://abc.com/chat") === true + +### Mailto Support + + URI.parse("mailto:alpha@example.com,bravo@example.com?subject=SUBSCRIBE&body=Sign%20me%20up!"); + //returns: + //{ + // scheme : "mailto", + // to : ["alpha@example.com", "bravo@example.com"], + // subject : "SUBSCRIBE", + // body : "Sign me up!" + //} + + URI.serialize({ + scheme : "mailto", + to : ["alpha@example.com"], + subject : "REMOVE", + body : "Please remove me", + headers : { + cc : "charlie@example.com" + } + }) === "mailto:alpha@example.com?cc=charlie@example.com&subject=REMOVE&body=Please%20remove%20me" + +### URN Support + + URI.parse("urn:example:foo"); + //returns: + //{ + // scheme : "urn", + // nid : "example", + // nss : "foo", + //} + +#### URN UUID Support + + URI.parse("urn:uuid:f81d4fae-7dec-11d0-a765-00a0c91e6bf6"); + //returns: + //{ + // scheme : "urn", + // nid : "example", + // uuid : "f81d4fae-7dec-11d0-a765-00a0c91e6bf6", + //} + +## Usage + +To load in a browser, use the following tag: + + + +To load in a CommonJS/Module environment, first install with npm/yarn by running on the command line: + + npm install uri-js + # OR + yarn add uri-js + +Then, in your code, load it using: + + const URI = require("uri-js"); + +If you are writing your code in ES6+ (ESNEXT) or TypeScript, you would load it using: + + import * as URI from "uri-js"; + +Or you can load just what you need using named exports: + + import { parse, serialize, resolve, resolveComponents, normalize, equal, removeDotSegments, pctEncChar, pctDecChars, escapeComponent, unescapeComponent } from "uri-js"; + +## Breaking changes + +### Breaking changes from 3.x + +URN parsing has been completely changed to better align with the specification. Scheme is now always `urn`, but has two new properties: `nid` which contains the Namspace Identifier, and `nss` which contains the Namespace Specific String. The `nss` property will be removed by higher order scheme handlers, such as the UUID URN scheme handler. + +The UUID of a URN can now be found in the `uuid` property. + +### Breaking changes from 2.x + +URI validation has been removed as it was slow, exposed a vulnerabilty, and was generally not useful. + +### Breaking changes from 1.x + +The `errors` array on parsed components is now an `error` string. diff --git a/deps/npm/node_modules/uri-js/dist/es5/uri.all.d.ts b/deps/npm/node_modules/uri-js/dist/es5/uri.all.d.ts new file mode 100755 index 00000000000000..da51e23527705f --- /dev/null +++ b/deps/npm/node_modules/uri-js/dist/es5/uri.all.d.ts @@ -0,0 +1,59 @@ +export interface URIComponents { + scheme?: string; + userinfo?: string; + host?: string; + port?: number | string; + path?: string; + query?: string; + fragment?: string; + reference?: string; + error?: string; +} +export interface URIOptions { + scheme?: string; + reference?: string; + tolerant?: boolean; + absolutePath?: boolean; + iri?: boolean; + unicodeSupport?: boolean; + domainHost?: boolean; +} +export interface URISchemeHandler { + scheme: string; + parse(components: ParentComponents, options: Options): Components; + serialize(components: Components, options: Options): ParentComponents; + unicodeSupport?: boolean; + domainHost?: boolean; + absolutePath?: boolean; +} +export interface URIRegExps { + NOT_SCHEME: RegExp; + NOT_USERINFO: RegExp; + NOT_HOST: RegExp; + NOT_PATH: RegExp; + NOT_PATH_NOSCHEME: RegExp; + NOT_QUERY: RegExp; + NOT_FRAGMENT: RegExp; + ESCAPE: RegExp; + UNRESERVED: RegExp; + OTHER_CHARS: RegExp; + PCT_ENCODED: RegExp; + IPV4ADDRESS: RegExp; + IPV6ADDRESS: RegExp; +} +export declare const SCHEMES: { + [scheme: string]: URISchemeHandler; +}; +export declare function pctEncChar(chr: string): string; +export declare function pctDecChars(str: string): string; +export declare function parse(uriString: string, options?: URIOptions): URIComponents; +export declare function removeDotSegments(input: string): string; +export declare function serialize(components: URIComponents, options?: URIOptions): string; +export declare function resolveComponents(base: URIComponents, relative: URIComponents, options?: URIOptions, skipNormalization?: boolean): URIComponents; +export declare function resolve(baseURI: string, relativeURI: string, options?: URIOptions): string; +export declare function normalize(uri: string, options?: URIOptions): string; +export declare function normalize(uri: URIComponents, options?: URIOptions): URIComponents; +export declare function equal(uriA: string, uriB: string, options?: URIOptions): boolean; +export declare function equal(uriA: URIComponents, uriB: URIComponents, options?: URIOptions): boolean; +export declare function escapeComponent(str: string, options?: URIOptions): string; +export declare function unescapeComponent(str: string, options?: URIOptions): string; diff --git a/deps/npm/node_modules/uri-js/dist/es5/uri.all.js b/deps/npm/node_modules/uri-js/dist/es5/uri.all.js new file mode 100755 index 00000000000000..47f42f8aa16696 --- /dev/null +++ b/deps/npm/node_modules/uri-js/dist/es5/uri.all.js @@ -0,0 +1,1443 @@ +/** @license URI.js v4.4.0 (c) 2011 Gary Court. License: http://github.com/garycourt/uri-js */ +(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : + typeof define === 'function' && define.amd ? define(['exports'], factory) : + (factory((global.URI = global.URI || {}))); +}(this, (function (exports) { 'use strict'; + +function merge() { + for (var _len = arguments.length, sets = Array(_len), _key = 0; _key < _len; _key++) { + sets[_key] = arguments[_key]; + } + + if (sets.length > 1) { + sets[0] = sets[0].slice(0, -1); + var xl = sets.length - 1; + for (var x = 1; x < xl; ++x) { + sets[x] = sets[x].slice(1, -1); + } + sets[xl] = sets[xl].slice(1); + return sets.join(''); + } else { + return sets[0]; + } +} +function subexp(str) { + return "(?:" + str + ")"; +} +function typeOf(o) { + return o === undefined ? "undefined" : o === null ? "null" : Object.prototype.toString.call(o).split(" ").pop().split("]").shift().toLowerCase(); +} +function toUpperCase(str) { + return str.toUpperCase(); +} +function toArray(obj) { + return obj !== undefined && obj !== null ? obj instanceof Array ? obj : typeof obj.length !== "number" || obj.split || obj.setInterval || obj.call ? [obj] : Array.prototype.slice.call(obj) : []; +} +function assign(target, source) { + var obj = target; + if (source) { + for (var key in source) { + obj[key] = source[key]; + } + } + return obj; +} + +function buildExps(isIRI) { + var ALPHA$$ = "[A-Za-z]", + CR$ = "[\\x0D]", + DIGIT$$ = "[0-9]", + DQUOTE$$ = "[\\x22]", + HEXDIG$$ = merge(DIGIT$$, "[A-Fa-f]"), + //case-insensitive + LF$$ = "[\\x0A]", + SP$$ = "[\\x20]", + PCT_ENCODED$ = subexp(subexp("%[EFef]" + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$) + "|" + subexp("%[89A-Fa-f]" + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$) + "|" + subexp("%" + HEXDIG$$ + HEXDIG$$)), + //expanded + GEN_DELIMS$$ = "[\\:\\/\\?\\#\\[\\]\\@]", + SUB_DELIMS$$ = "[\\!\\$\\&\\'\\(\\)\\*\\+\\,\\;\\=]", + RESERVED$$ = merge(GEN_DELIMS$$, SUB_DELIMS$$), + UCSCHAR$$ = isIRI ? "[\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]" : "[]", + //subset, excludes bidi control characters + IPRIVATE$$ = isIRI ? "[\\uE000-\\uF8FF]" : "[]", + //subset + UNRESERVED$$ = merge(ALPHA$$, DIGIT$$, "[\\-\\.\\_\\~]", UCSCHAR$$), + SCHEME$ = subexp(ALPHA$$ + merge(ALPHA$$, DIGIT$$, "[\\+\\-\\.]") + "*"), + USERINFO$ = subexp(subexp(PCT_ENCODED$ + "|" + merge(UNRESERVED$$, SUB_DELIMS$$, "[\\:]")) + "*"), + DEC_OCTET$ = subexp(subexp("25[0-5]") + "|" + subexp("2[0-4]" + DIGIT$$) + "|" + subexp("1" + DIGIT$$ + DIGIT$$) + "|" + subexp("[1-9]" + DIGIT$$) + "|" + DIGIT$$), + DEC_OCTET_RELAXED$ = subexp(subexp("25[0-5]") + "|" + subexp("2[0-4]" + DIGIT$$) + "|" + subexp("1" + DIGIT$$ + DIGIT$$) + "|" + subexp("0?[1-9]" + DIGIT$$) + "|0?0?" + DIGIT$$), + //relaxed parsing rules + IPV4ADDRESS$ = subexp(DEC_OCTET_RELAXED$ + "\\." + DEC_OCTET_RELAXED$ + "\\." + DEC_OCTET_RELAXED$ + "\\." + DEC_OCTET_RELAXED$), + H16$ = subexp(HEXDIG$$ + "{1,4}"), + LS32$ = subexp(subexp(H16$ + "\\:" + H16$) + "|" + IPV4ADDRESS$), + IPV6ADDRESS1$ = subexp(subexp(H16$ + "\\:") + "{6}" + LS32$), + // 6( h16 ":" ) ls32 + IPV6ADDRESS2$ = subexp("\\:\\:" + subexp(H16$ + "\\:") + "{5}" + LS32$), + // "::" 5( h16 ":" ) ls32 + IPV6ADDRESS3$ = subexp(subexp(H16$) + "?\\:\\:" + subexp(H16$ + "\\:") + "{4}" + LS32$), + //[ h16 ] "::" 4( h16 ":" ) ls32 + IPV6ADDRESS4$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,1}" + H16$) + "?\\:\\:" + subexp(H16$ + "\\:") + "{3}" + LS32$), + //[ *1( h16 ":" ) h16 ] "::" 3( h16 ":" ) ls32 + IPV6ADDRESS5$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,2}" + H16$) + "?\\:\\:" + subexp(H16$ + "\\:") + "{2}" + LS32$), + //[ *2( h16 ":" ) h16 ] "::" 2( h16 ":" ) ls32 + IPV6ADDRESS6$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,3}" + H16$) + "?\\:\\:" + H16$ + "\\:" + LS32$), + //[ *3( h16 ":" ) h16 ] "::" h16 ":" ls32 + IPV6ADDRESS7$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,4}" + H16$) + "?\\:\\:" + LS32$), + //[ *4( h16 ":" ) h16 ] "::" ls32 + IPV6ADDRESS8$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,5}" + H16$) + "?\\:\\:" + H16$), + //[ *5( h16 ":" ) h16 ] "::" h16 + IPV6ADDRESS9$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,6}" + H16$) + "?\\:\\:"), + //[ *6( h16 ":" ) h16 ] "::" + IPV6ADDRESS$ = subexp([IPV6ADDRESS1$, IPV6ADDRESS2$, IPV6ADDRESS3$, IPV6ADDRESS4$, IPV6ADDRESS5$, IPV6ADDRESS6$, IPV6ADDRESS7$, IPV6ADDRESS8$, IPV6ADDRESS9$].join("|")), + ZONEID$ = subexp(subexp(UNRESERVED$$ + "|" + PCT_ENCODED$) + "+"), + //RFC 6874 + IPV6ADDRZ$ = subexp(IPV6ADDRESS$ + "\\%25" + ZONEID$), + //RFC 6874 + IPV6ADDRZ_RELAXED$ = subexp(IPV6ADDRESS$ + subexp("\\%25|\\%(?!" + HEXDIG$$ + "{2})") + ZONEID$), + //RFC 6874, with relaxed parsing rules + IPVFUTURE$ = subexp("[vV]" + HEXDIG$$ + "+\\." + merge(UNRESERVED$$, SUB_DELIMS$$, "[\\:]") + "+"), + IP_LITERAL$ = subexp("\\[" + subexp(IPV6ADDRZ_RELAXED$ + "|" + IPV6ADDRESS$ + "|" + IPVFUTURE$) + "\\]"), + //RFC 6874 + REG_NAME$ = subexp(subexp(PCT_ENCODED$ + "|" + merge(UNRESERVED$$, SUB_DELIMS$$)) + "*"), + HOST$ = subexp(IP_LITERAL$ + "|" + IPV4ADDRESS$ + "(?!" + REG_NAME$ + ")" + "|" + REG_NAME$), + PORT$ = subexp(DIGIT$$ + "*"), + AUTHORITY$ = subexp(subexp(USERINFO$ + "@") + "?" + HOST$ + subexp("\\:" + PORT$) + "?"), + PCHAR$ = subexp(PCT_ENCODED$ + "|" + merge(UNRESERVED$$, SUB_DELIMS$$, "[\\:\\@]")), + SEGMENT$ = subexp(PCHAR$ + "*"), + SEGMENT_NZ$ = subexp(PCHAR$ + "+"), + SEGMENT_NZ_NC$ = subexp(subexp(PCT_ENCODED$ + "|" + merge(UNRESERVED$$, SUB_DELIMS$$, "[\\@]")) + "+"), + PATH_ABEMPTY$ = subexp(subexp("\\/" + SEGMENT$) + "*"), + PATH_ABSOLUTE$ = subexp("\\/" + subexp(SEGMENT_NZ$ + PATH_ABEMPTY$) + "?"), + //simplified + PATH_NOSCHEME$ = subexp(SEGMENT_NZ_NC$ + PATH_ABEMPTY$), + //simplified + PATH_ROOTLESS$ = subexp(SEGMENT_NZ$ + PATH_ABEMPTY$), + //simplified + PATH_EMPTY$ = "(?!" + PCHAR$ + ")", + PATH$ = subexp(PATH_ABEMPTY$ + "|" + PATH_ABSOLUTE$ + "|" + PATH_NOSCHEME$ + "|" + PATH_ROOTLESS$ + "|" + PATH_EMPTY$), + QUERY$ = subexp(subexp(PCHAR$ + "|" + merge("[\\/\\?]", IPRIVATE$$)) + "*"), + FRAGMENT$ = subexp(subexp(PCHAR$ + "|[\\/\\?]") + "*"), + HIER_PART$ = subexp(subexp("\\/\\/" + AUTHORITY$ + PATH_ABEMPTY$) + "|" + PATH_ABSOLUTE$ + "|" + PATH_ROOTLESS$ + "|" + PATH_EMPTY$), + URI$ = subexp(SCHEME$ + "\\:" + HIER_PART$ + subexp("\\?" + QUERY$) + "?" + subexp("\\#" + FRAGMENT$) + "?"), + RELATIVE_PART$ = subexp(subexp("\\/\\/" + AUTHORITY$ + PATH_ABEMPTY$) + "|" + PATH_ABSOLUTE$ + "|" + PATH_NOSCHEME$ + "|" + PATH_EMPTY$), + RELATIVE$ = subexp(RELATIVE_PART$ + subexp("\\?" + QUERY$) + "?" + subexp("\\#" + FRAGMENT$) + "?"), + URI_REFERENCE$ = subexp(URI$ + "|" + RELATIVE$), + ABSOLUTE_URI$ = subexp(SCHEME$ + "\\:" + HIER_PART$ + subexp("\\?" + QUERY$) + "?"), + GENERIC_REF$ = "^(" + SCHEME$ + ")\\:" + subexp(subexp("\\/\\/(" + subexp("(" + USERINFO$ + ")@") + "?(" + HOST$ + ")" + subexp("\\:(" + PORT$ + ")") + "?)") + "?(" + PATH_ABEMPTY$ + "|" + PATH_ABSOLUTE$ + "|" + PATH_ROOTLESS$ + "|" + PATH_EMPTY$ + ")") + subexp("\\?(" + QUERY$ + ")") + "?" + subexp("\\#(" + FRAGMENT$ + ")") + "?$", + RELATIVE_REF$ = "^(){0}" + subexp(subexp("\\/\\/(" + subexp("(" + USERINFO$ + ")@") + "?(" + HOST$ + ")" + subexp("\\:(" + PORT$ + ")") + "?)") + "?(" + PATH_ABEMPTY$ + "|" + PATH_ABSOLUTE$ + "|" + PATH_NOSCHEME$ + "|" + PATH_EMPTY$ + ")") + subexp("\\?(" + QUERY$ + ")") + "?" + subexp("\\#(" + FRAGMENT$ + ")") + "?$", + ABSOLUTE_REF$ = "^(" + SCHEME$ + ")\\:" + subexp(subexp("\\/\\/(" + subexp("(" + USERINFO$ + ")@") + "?(" + HOST$ + ")" + subexp("\\:(" + PORT$ + ")") + "?)") + "?(" + PATH_ABEMPTY$ + "|" + PATH_ABSOLUTE$ + "|" + PATH_ROOTLESS$ + "|" + PATH_EMPTY$ + ")") + subexp("\\?(" + QUERY$ + ")") + "?$", + SAMEDOC_REF$ = "^" + subexp("\\#(" + FRAGMENT$ + ")") + "?$", + AUTHORITY_REF$ = "^" + subexp("(" + USERINFO$ + ")@") + "?(" + HOST$ + ")" + subexp("\\:(" + PORT$ + ")") + "?$"; + return { + NOT_SCHEME: new RegExp(merge("[^]", ALPHA$$, DIGIT$$, "[\\+\\-\\.]"), "g"), + NOT_USERINFO: new RegExp(merge("[^\\%\\:]", UNRESERVED$$, SUB_DELIMS$$), "g"), + NOT_HOST: new RegExp(merge("[^\\%\\[\\]\\:]", UNRESERVED$$, SUB_DELIMS$$), "g"), + NOT_PATH: new RegExp(merge("[^\\%\\/\\:\\@]", UNRESERVED$$, SUB_DELIMS$$), "g"), + NOT_PATH_NOSCHEME: new RegExp(merge("[^\\%\\/\\@]", UNRESERVED$$, SUB_DELIMS$$), "g"), + NOT_QUERY: new RegExp(merge("[^\\%]", UNRESERVED$$, SUB_DELIMS$$, "[\\:\\@\\/\\?]", IPRIVATE$$), "g"), + NOT_FRAGMENT: new RegExp(merge("[^\\%]", UNRESERVED$$, SUB_DELIMS$$, "[\\:\\@\\/\\?]"), "g"), + ESCAPE: new RegExp(merge("[^]", UNRESERVED$$, SUB_DELIMS$$), "g"), + UNRESERVED: new RegExp(UNRESERVED$$, "g"), + OTHER_CHARS: new RegExp(merge("[^\\%]", UNRESERVED$$, RESERVED$$), "g"), + PCT_ENCODED: new RegExp(PCT_ENCODED$, "g"), + IPV4ADDRESS: new RegExp("^(" + IPV4ADDRESS$ + ")$"), + IPV6ADDRESS: new RegExp("^\\[?(" + IPV6ADDRESS$ + ")" + subexp(subexp("\\%25|\\%(?!" + HEXDIG$$ + "{2})") + "(" + ZONEID$ + ")") + "?\\]?$") //RFC 6874, with relaxed parsing rules + }; +} +var URI_PROTOCOL = buildExps(false); + +var IRI_PROTOCOL = buildExps(true); + +var slicedToArray = function () { + function sliceIterator(arr, i) { + var _arr = []; + var _n = true; + var _d = false; + var _e = undefined; + + try { + for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { + _arr.push(_s.value); + + if (i && _arr.length === i) break; + } + } catch (err) { + _d = true; + _e = err; + } finally { + try { + if (!_n && _i["return"]) _i["return"](); + } finally { + if (_d) throw _e; + } + } + + return _arr; + } + + return function (arr, i) { + if (Array.isArray(arr)) { + return arr; + } else if (Symbol.iterator in Object(arr)) { + return sliceIterator(arr, i); + } else { + throw new TypeError("Invalid attempt to destructure non-iterable instance"); + } + }; +}(); + + + + + + + + + + + + + +var toConsumableArray = function (arr) { + if (Array.isArray(arr)) { + for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) arr2[i] = arr[i]; + + return arr2; + } else { + return Array.from(arr); + } +}; + +/** Highest positive signed 32-bit float value */ + +var maxInt = 2147483647; // aka. 0x7FFFFFFF or 2^31-1 + +/** Bootstring parameters */ +var base = 36; +var tMin = 1; +var tMax = 26; +var skew = 38; +var damp = 700; +var initialBias = 72; +var initialN = 128; // 0x80 +var delimiter = '-'; // '\x2D' + +/** Regular expressions */ +var regexPunycode = /^xn--/; +var regexNonASCII = /[^\0-\x7E]/; // non-ASCII chars +var regexSeparators = /[\x2E\u3002\uFF0E\uFF61]/g; // RFC 3490 separators + +/** Error messages */ +var errors = { + 'overflow': 'Overflow: input needs wider integers to process', + 'not-basic': 'Illegal input >= 0x80 (not a basic code point)', + 'invalid-input': 'Invalid input' +}; + +/** Convenience shortcuts */ +var baseMinusTMin = base - tMin; +var floor = Math.floor; +var stringFromCharCode = String.fromCharCode; + +/*--------------------------------------------------------------------------*/ + +/** + * A generic error utility function. + * @private + * @param {String} type The error type. + * @returns {Error} Throws a `RangeError` with the applicable error message. + */ +function error$1(type) { + throw new RangeError(errors[type]); +} + +/** + * A generic `Array#map` utility function. + * @private + * @param {Array} array The array to iterate over. + * @param {Function} callback The function that gets called for every array + * item. + * @returns {Array} A new array of values returned by the callback function. + */ +function map(array, fn) { + var result = []; + var length = array.length; + while (length--) { + result[length] = fn(array[length]); + } + return result; +} + +/** + * A simple `Array#map`-like wrapper to work with domain name strings or email + * addresses. + * @private + * @param {String} domain The domain name or email address. + * @param {Function} callback The function that gets called for every + * character. + * @returns {Array} A new string of characters returned by the callback + * function. + */ +function mapDomain(string, fn) { + var parts = string.split('@'); + var result = ''; + if (parts.length > 1) { + // In email addresses, only the domain name should be punycoded. Leave + // the local part (i.e. everything up to `@`) intact. + result = parts[0] + '@'; + string = parts[1]; + } + // Avoid `split(regex)` for IE8 compatibility. See #17. + string = string.replace(regexSeparators, '\x2E'); + var labels = string.split('.'); + var encoded = map(labels, fn).join('.'); + return result + encoded; +} + +/** + * Creates an array containing the numeric code points of each Unicode + * character in the string. While JavaScript uses UCS-2 internally, + * this function will convert a pair of surrogate halves (each of which + * UCS-2 exposes as separate characters) into a single code point, + * matching UTF-16. + * @see `punycode.ucs2.encode` + * @see + * @memberOf punycode.ucs2 + * @name decode + * @param {String} string The Unicode input string (UCS-2). + * @returns {Array} The new array of code points. + */ +function ucs2decode(string) { + var output = []; + var counter = 0; + var length = string.length; + while (counter < length) { + var value = string.charCodeAt(counter++); + if (value >= 0xD800 && value <= 0xDBFF && counter < length) { + // It's a high surrogate, and there is a next character. + var extra = string.charCodeAt(counter++); + if ((extra & 0xFC00) == 0xDC00) { + // Low surrogate. + output.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000); + } else { + // It's an unmatched surrogate; only append this code unit, in case the + // next code unit is the high surrogate of a surrogate pair. + output.push(value); + counter--; + } + } else { + output.push(value); + } + } + return output; +} + +/** + * Creates a string based on an array of numeric code points. + * @see `punycode.ucs2.decode` + * @memberOf punycode.ucs2 + * @name encode + * @param {Array} codePoints The array of numeric code points. + * @returns {String} The new Unicode string (UCS-2). + */ +var ucs2encode = function ucs2encode(array) { + return String.fromCodePoint.apply(String, toConsumableArray(array)); +}; + +/** + * Converts a basic code point into a digit/integer. + * @see `digitToBasic()` + * @private + * @param {Number} codePoint The basic numeric code point value. + * @returns {Number} The numeric value of a basic code point (for use in + * representing integers) in the range `0` to `base - 1`, or `base` if + * the code point does not represent a value. + */ +var basicToDigit = function basicToDigit(codePoint) { + if (codePoint - 0x30 < 0x0A) { + return codePoint - 0x16; + } + if (codePoint - 0x41 < 0x1A) { + return codePoint - 0x41; + } + if (codePoint - 0x61 < 0x1A) { + return codePoint - 0x61; + } + return base; +}; + +/** + * Converts a digit/integer into a basic code point. + * @see `basicToDigit()` + * @private + * @param {Number} digit The numeric value of a basic code point. + * @returns {Number} The basic code point whose value (when used for + * representing integers) is `digit`, which needs to be in the range + * `0` to `base - 1`. If `flag` is non-zero, the uppercase form is + * used; else, the lowercase form is used. The behavior is undefined + * if `flag` is non-zero and `digit` has no uppercase form. + */ +var digitToBasic = function digitToBasic(digit, flag) { + // 0..25 map to ASCII a..z or A..Z + // 26..35 map to ASCII 0..9 + return digit + 22 + 75 * (digit < 26) - ((flag != 0) << 5); +}; + +/** + * Bias adaptation function as per section 3.4 of RFC 3492. + * https://tools.ietf.org/html/rfc3492#section-3.4 + * @private + */ +var adapt = function adapt(delta, numPoints, firstTime) { + var k = 0; + delta = firstTime ? floor(delta / damp) : delta >> 1; + delta += floor(delta / numPoints); + for (; /* no initialization */delta > baseMinusTMin * tMax >> 1; k += base) { + delta = floor(delta / baseMinusTMin); + } + return floor(k + (baseMinusTMin + 1) * delta / (delta + skew)); +}; + +/** + * Converts a Punycode string of ASCII-only symbols to a string of Unicode + * symbols. + * @memberOf punycode + * @param {String} input The Punycode string of ASCII-only symbols. + * @returns {String} The resulting string of Unicode symbols. + */ +var decode = function decode(input) { + // Don't use UCS-2. + var output = []; + var inputLength = input.length; + var i = 0; + var n = initialN; + var bias = initialBias; + + // Handle the basic code points: let `basic` be the number of input code + // points before the last delimiter, or `0` if there is none, then copy + // the first basic code points to the output. + + var basic = input.lastIndexOf(delimiter); + if (basic < 0) { + basic = 0; + } + + for (var j = 0; j < basic; ++j) { + // if it's not a basic code point + if (input.charCodeAt(j) >= 0x80) { + error$1('not-basic'); + } + output.push(input.charCodeAt(j)); + } + + // Main decoding loop: start just after the last delimiter if any basic code + // points were copied; start at the beginning otherwise. + + for (var index = basic > 0 ? basic + 1 : 0; index < inputLength;) /* no final expression */{ + + // `index` is the index of the next character to be consumed. + // Decode a generalized variable-length integer into `delta`, + // which gets added to `i`. The overflow checking is easier + // if we increase `i` as we go, then subtract off its starting + // value at the end to obtain `delta`. + var oldi = i; + for (var w = 1, k = base;; /* no condition */k += base) { + + if (index >= inputLength) { + error$1('invalid-input'); + } + + var digit = basicToDigit(input.charCodeAt(index++)); + + if (digit >= base || digit > floor((maxInt - i) / w)) { + error$1('overflow'); + } + + i += digit * w; + var t = k <= bias ? tMin : k >= bias + tMax ? tMax : k - bias; + + if (digit < t) { + break; + } + + var baseMinusT = base - t; + if (w > floor(maxInt / baseMinusT)) { + error$1('overflow'); + } + + w *= baseMinusT; + } + + var out = output.length + 1; + bias = adapt(i - oldi, out, oldi == 0); + + // `i` was supposed to wrap around from `out` to `0`, + // incrementing `n` each time, so we'll fix that now: + if (floor(i / out) > maxInt - n) { + error$1('overflow'); + } + + n += floor(i / out); + i %= out; + + // Insert `n` at position `i` of the output. + output.splice(i++, 0, n); + } + + return String.fromCodePoint.apply(String, output); +}; + +/** + * Converts a string of Unicode symbols (e.g. a domain name label) to a + * Punycode string of ASCII-only symbols. + * @memberOf punycode + * @param {String} input The string of Unicode symbols. + * @returns {String} The resulting Punycode string of ASCII-only symbols. + */ +var encode = function encode(input) { + var output = []; + + // Convert the input in UCS-2 to an array of Unicode code points. + input = ucs2decode(input); + + // Cache the length. + var inputLength = input.length; + + // Initialize the state. + var n = initialN; + var delta = 0; + var bias = initialBias; + + // Handle the basic code points. + var _iteratorNormalCompletion = true; + var _didIteratorError = false; + var _iteratorError = undefined; + + try { + for (var _iterator = input[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { + var _currentValue2 = _step.value; + + if (_currentValue2 < 0x80) { + output.push(stringFromCharCode(_currentValue2)); + } + } + } catch (err) { + _didIteratorError = true; + _iteratorError = err; + } finally { + try { + if (!_iteratorNormalCompletion && _iterator.return) { + _iterator.return(); + } + } finally { + if (_didIteratorError) { + throw _iteratorError; + } + } + } + + var basicLength = output.length; + var handledCPCount = basicLength; + + // `handledCPCount` is the number of code points that have been handled; + // `basicLength` is the number of basic code points. + + // Finish the basic string with a delimiter unless it's empty. + if (basicLength) { + output.push(delimiter); + } + + // Main encoding loop: + while (handledCPCount < inputLength) { + + // All non-basic code points < n have been handled already. Find the next + // larger one: + var m = maxInt; + var _iteratorNormalCompletion2 = true; + var _didIteratorError2 = false; + var _iteratorError2 = undefined; + + try { + for (var _iterator2 = input[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) { + var currentValue = _step2.value; + + if (currentValue >= n && currentValue < m) { + m = currentValue; + } + } + + // Increase `delta` enough to advance the decoder's state to , + // but guard against overflow. + } catch (err) { + _didIteratorError2 = true; + _iteratorError2 = err; + } finally { + try { + if (!_iteratorNormalCompletion2 && _iterator2.return) { + _iterator2.return(); + } + } finally { + if (_didIteratorError2) { + throw _iteratorError2; + } + } + } + + var handledCPCountPlusOne = handledCPCount + 1; + if (m - n > floor((maxInt - delta) / handledCPCountPlusOne)) { + error$1('overflow'); + } + + delta += (m - n) * handledCPCountPlusOne; + n = m; + + var _iteratorNormalCompletion3 = true; + var _didIteratorError3 = false; + var _iteratorError3 = undefined; + + try { + for (var _iterator3 = input[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) { + var _currentValue = _step3.value; + + if (_currentValue < n && ++delta > maxInt) { + error$1('overflow'); + } + if (_currentValue == n) { + // Represent delta as a generalized variable-length integer. + var q = delta; + for (var k = base;; /* no condition */k += base) { + var t = k <= bias ? tMin : k >= bias + tMax ? tMax : k - bias; + if (q < t) { + break; + } + var qMinusT = q - t; + var baseMinusT = base - t; + output.push(stringFromCharCode(digitToBasic(t + qMinusT % baseMinusT, 0))); + q = floor(qMinusT / baseMinusT); + } + + output.push(stringFromCharCode(digitToBasic(q, 0))); + bias = adapt(delta, handledCPCountPlusOne, handledCPCount == basicLength); + delta = 0; + ++handledCPCount; + } + } + } catch (err) { + _didIteratorError3 = true; + _iteratorError3 = err; + } finally { + try { + if (!_iteratorNormalCompletion3 && _iterator3.return) { + _iterator3.return(); + } + } finally { + if (_didIteratorError3) { + throw _iteratorError3; + } + } + } + + ++delta; + ++n; + } + return output.join(''); +}; + +/** + * Converts a Punycode string representing a domain name or an email address + * to Unicode. Only the Punycoded parts of the input will be converted, i.e. + * it doesn't matter if you call it on a string that has already been + * converted to Unicode. + * @memberOf punycode + * @param {String} input The Punycoded domain name or email address to + * convert to Unicode. + * @returns {String} The Unicode representation of the given Punycode + * string. + */ +var toUnicode = function toUnicode(input) { + return mapDomain(input, function (string) { + return regexPunycode.test(string) ? decode(string.slice(4).toLowerCase()) : string; + }); +}; + +/** + * Converts a Unicode string representing a domain name or an email address to + * Punycode. Only the non-ASCII parts of the domain name will be converted, + * i.e. it doesn't matter if you call it with a domain that's already in + * ASCII. + * @memberOf punycode + * @param {String} input The domain name or email address to convert, as a + * Unicode string. + * @returns {String} The Punycode representation of the given domain name or + * email address. + */ +var toASCII = function toASCII(input) { + return mapDomain(input, function (string) { + return regexNonASCII.test(string) ? 'xn--' + encode(string) : string; + }); +}; + +/*--------------------------------------------------------------------------*/ + +/** Define the public API */ +var punycode = { + /** + * A string representing the current Punycode.js version number. + * @memberOf punycode + * @type String + */ + 'version': '2.1.0', + /** + * An object of methods to convert from JavaScript's internal character + * representation (UCS-2) to Unicode code points, and back. + * @see + * @memberOf punycode + * @type Object + */ + 'ucs2': { + 'decode': ucs2decode, + 'encode': ucs2encode + }, + 'decode': decode, + 'encode': encode, + 'toASCII': toASCII, + 'toUnicode': toUnicode +}; + +/** + * URI.js + * + * @fileoverview An RFC 3986 compliant, scheme extendable URI parsing/validating/resolving library for JavaScript. + * @author Gary Court + * @see http://github.com/garycourt/uri-js + */ +/** + * Copyright 2011 Gary Court. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY GARY COURT ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GARY COURT OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of Gary Court. + */ +var SCHEMES = {}; +function pctEncChar(chr) { + var c = chr.charCodeAt(0); + var e = void 0; + if (c < 16) e = "%0" + c.toString(16).toUpperCase();else if (c < 128) e = "%" + c.toString(16).toUpperCase();else if (c < 2048) e = "%" + (c >> 6 | 192).toString(16).toUpperCase() + "%" + (c & 63 | 128).toString(16).toUpperCase();else e = "%" + (c >> 12 | 224).toString(16).toUpperCase() + "%" + (c >> 6 & 63 | 128).toString(16).toUpperCase() + "%" + (c & 63 | 128).toString(16).toUpperCase(); + return e; +} +function pctDecChars(str) { + var newStr = ""; + var i = 0; + var il = str.length; + while (i < il) { + var c = parseInt(str.substr(i + 1, 2), 16); + if (c < 128) { + newStr += String.fromCharCode(c); + i += 3; + } else if (c >= 194 && c < 224) { + if (il - i >= 6) { + var c2 = parseInt(str.substr(i + 4, 2), 16); + newStr += String.fromCharCode((c & 31) << 6 | c2 & 63); + } else { + newStr += str.substr(i, 6); + } + i += 6; + } else if (c >= 224) { + if (il - i >= 9) { + var _c = parseInt(str.substr(i + 4, 2), 16); + var c3 = parseInt(str.substr(i + 7, 2), 16); + newStr += String.fromCharCode((c & 15) << 12 | (_c & 63) << 6 | c3 & 63); + } else { + newStr += str.substr(i, 9); + } + i += 9; + } else { + newStr += str.substr(i, 3); + i += 3; + } + } + return newStr; +} +function _normalizeComponentEncoding(components, protocol) { + function decodeUnreserved(str) { + var decStr = pctDecChars(str); + return !decStr.match(protocol.UNRESERVED) ? str : decStr; + } + if (components.scheme) components.scheme = String(components.scheme).replace(protocol.PCT_ENCODED, decodeUnreserved).toLowerCase().replace(protocol.NOT_SCHEME, ""); + if (components.userinfo !== undefined) components.userinfo = String(components.userinfo).replace(protocol.PCT_ENCODED, decodeUnreserved).replace(protocol.NOT_USERINFO, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase); + if (components.host !== undefined) components.host = String(components.host).replace(protocol.PCT_ENCODED, decodeUnreserved).toLowerCase().replace(protocol.NOT_HOST, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase); + if (components.path !== undefined) components.path = String(components.path).replace(protocol.PCT_ENCODED, decodeUnreserved).replace(components.scheme ? protocol.NOT_PATH : protocol.NOT_PATH_NOSCHEME, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase); + if (components.query !== undefined) components.query = String(components.query).replace(protocol.PCT_ENCODED, decodeUnreserved).replace(protocol.NOT_QUERY, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase); + if (components.fragment !== undefined) components.fragment = String(components.fragment).replace(protocol.PCT_ENCODED, decodeUnreserved).replace(protocol.NOT_FRAGMENT, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase); + return components; +} + +function _stripLeadingZeros(str) { + return str.replace(/^0*(.*)/, "$1") || "0"; +} +function _normalizeIPv4(host, protocol) { + var matches = host.match(protocol.IPV4ADDRESS) || []; + + var _matches = slicedToArray(matches, 2), + address = _matches[1]; + + if (address) { + return address.split(".").map(_stripLeadingZeros).join("."); + } else { + return host; + } +} +function _normalizeIPv6(host, protocol) { + var matches = host.match(protocol.IPV6ADDRESS) || []; + + var _matches2 = slicedToArray(matches, 3), + address = _matches2[1], + zone = _matches2[2]; + + if (address) { + var _address$toLowerCase$ = address.toLowerCase().split('::').reverse(), + _address$toLowerCase$2 = slicedToArray(_address$toLowerCase$, 2), + last = _address$toLowerCase$2[0], + first = _address$toLowerCase$2[1]; + + var firstFields = first ? first.split(":").map(_stripLeadingZeros) : []; + var lastFields = last.split(":").map(_stripLeadingZeros); + var isLastFieldIPv4Address = protocol.IPV4ADDRESS.test(lastFields[lastFields.length - 1]); + var fieldCount = isLastFieldIPv4Address ? 7 : 8; + var lastFieldsStart = lastFields.length - fieldCount; + var fields = Array(fieldCount); + for (var x = 0; x < fieldCount; ++x) { + fields[x] = firstFields[x] || lastFields[lastFieldsStart + x] || ''; + } + if (isLastFieldIPv4Address) { + fields[fieldCount - 1] = _normalizeIPv4(fields[fieldCount - 1], protocol); + } + var allZeroFields = fields.reduce(function (acc, field, index) { + if (!field || field === "0") { + var lastLongest = acc[acc.length - 1]; + if (lastLongest && lastLongest.index + lastLongest.length === index) { + lastLongest.length++; + } else { + acc.push({ index: index, length: 1 }); + } + } + return acc; + }, []); + var longestZeroFields = allZeroFields.sort(function (a, b) { + return b.length - a.length; + })[0]; + var newHost = void 0; + if (longestZeroFields && longestZeroFields.length > 1) { + var newFirst = fields.slice(0, longestZeroFields.index); + var newLast = fields.slice(longestZeroFields.index + longestZeroFields.length); + newHost = newFirst.join(":") + "::" + newLast.join(":"); + } else { + newHost = fields.join(":"); + } + if (zone) { + newHost += "%" + zone; + } + return newHost; + } else { + return host; + } +} +var URI_PARSE = /^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i; +var NO_MATCH_IS_UNDEFINED = "".match(/(){0}/)[1] === undefined; +function parse(uriString) { + var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + + var components = {}; + var protocol = options.iri !== false ? IRI_PROTOCOL : URI_PROTOCOL; + if (options.reference === "suffix") uriString = (options.scheme ? options.scheme + ":" : "") + "//" + uriString; + var matches = uriString.match(URI_PARSE); + if (matches) { + if (NO_MATCH_IS_UNDEFINED) { + //store each component + components.scheme = matches[1]; + components.userinfo = matches[3]; + components.host = matches[4]; + components.port = parseInt(matches[5], 10); + components.path = matches[6] || ""; + components.query = matches[7]; + components.fragment = matches[8]; + //fix port number + if (isNaN(components.port)) { + components.port = matches[5]; + } + } else { + //IE FIX for improper RegExp matching + //store each component + components.scheme = matches[1] || undefined; + components.userinfo = uriString.indexOf("@") !== -1 ? matches[3] : undefined; + components.host = uriString.indexOf("//") !== -1 ? matches[4] : undefined; + components.port = parseInt(matches[5], 10); + components.path = matches[6] || ""; + components.query = uriString.indexOf("?") !== -1 ? matches[7] : undefined; + components.fragment = uriString.indexOf("#") !== -1 ? matches[8] : undefined; + //fix port number + if (isNaN(components.port)) { + components.port = uriString.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/) ? matches[4] : undefined; + } + } + if (components.host) { + //normalize IP hosts + components.host = _normalizeIPv6(_normalizeIPv4(components.host, protocol), protocol); + } + //determine reference type + if (components.scheme === undefined && components.userinfo === undefined && components.host === undefined && components.port === undefined && !components.path && components.query === undefined) { + components.reference = "same-document"; + } else if (components.scheme === undefined) { + components.reference = "relative"; + } else if (components.fragment === undefined) { + components.reference = "absolute"; + } else { + components.reference = "uri"; + } + //check for reference errors + if (options.reference && options.reference !== "suffix" && options.reference !== components.reference) { + components.error = components.error || "URI is not a " + options.reference + " reference."; + } + //find scheme handler + var schemeHandler = SCHEMES[(options.scheme || components.scheme || "").toLowerCase()]; + //check if scheme can't handle IRIs + if (!options.unicodeSupport && (!schemeHandler || !schemeHandler.unicodeSupport)) { + //if host component is a domain name + if (components.host && (options.domainHost || schemeHandler && schemeHandler.domainHost)) { + //convert Unicode IDN -> ASCII IDN + try { + components.host = punycode.toASCII(components.host.replace(protocol.PCT_ENCODED, pctDecChars).toLowerCase()); + } catch (e) { + components.error = components.error || "Host's domain name can not be converted to ASCII via punycode: " + e; + } + } + //convert IRI -> URI + _normalizeComponentEncoding(components, URI_PROTOCOL); + } else { + //normalize encodings + _normalizeComponentEncoding(components, protocol); + } + //perform scheme specific parsing + if (schemeHandler && schemeHandler.parse) { + schemeHandler.parse(components, options); + } + } else { + components.error = components.error || "URI can not be parsed."; + } + return components; +} + +function _recomposeAuthority(components, options) { + var protocol = options.iri !== false ? IRI_PROTOCOL : URI_PROTOCOL; + var uriTokens = []; + if (components.userinfo !== undefined) { + uriTokens.push(components.userinfo); + uriTokens.push("@"); + } + if (components.host !== undefined) { + //normalize IP hosts, add brackets and escape zone separator for IPv6 + uriTokens.push(_normalizeIPv6(_normalizeIPv4(String(components.host), protocol), protocol).replace(protocol.IPV6ADDRESS, function (_, $1, $2) { + return "[" + $1 + ($2 ? "%25" + $2 : "") + "]"; + })); + } + if (typeof components.port === "number" || typeof components.port === "string") { + uriTokens.push(":"); + uriTokens.push(String(components.port)); + } + return uriTokens.length ? uriTokens.join("") : undefined; +} + +var RDS1 = /^\.\.?\//; +var RDS2 = /^\/\.(\/|$)/; +var RDS3 = /^\/\.\.(\/|$)/; +var RDS5 = /^\/?(?:.|\n)*?(?=\/|$)/; +function removeDotSegments(input) { + var output = []; + while (input.length) { + if (input.match(RDS1)) { + input = input.replace(RDS1, ""); + } else if (input.match(RDS2)) { + input = input.replace(RDS2, "/"); + } else if (input.match(RDS3)) { + input = input.replace(RDS3, "/"); + output.pop(); + } else if (input === "." || input === "..") { + input = ""; + } else { + var im = input.match(RDS5); + if (im) { + var s = im[0]; + input = input.slice(s.length); + output.push(s); + } else { + throw new Error("Unexpected dot segment condition"); + } + } + } + return output.join(""); +} + +function serialize(components) { + var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + + var protocol = options.iri ? IRI_PROTOCOL : URI_PROTOCOL; + var uriTokens = []; + //find scheme handler + var schemeHandler = SCHEMES[(options.scheme || components.scheme || "").toLowerCase()]; + //perform scheme specific serialization + if (schemeHandler && schemeHandler.serialize) schemeHandler.serialize(components, options); + if (components.host) { + //if host component is an IPv6 address + if (protocol.IPV6ADDRESS.test(components.host)) {} + //TODO: normalize IPv6 address as per RFC 5952 + + //if host component is a domain name + else if (options.domainHost || schemeHandler && schemeHandler.domainHost) { + //convert IDN via punycode + try { + components.host = !options.iri ? punycode.toASCII(components.host.replace(protocol.PCT_ENCODED, pctDecChars).toLowerCase()) : punycode.toUnicode(components.host); + } catch (e) { + components.error = components.error || "Host's domain name can not be converted to " + (!options.iri ? "ASCII" : "Unicode") + " via punycode: " + e; + } + } + } + //normalize encoding + _normalizeComponentEncoding(components, protocol); + if (options.reference !== "suffix" && components.scheme) { + uriTokens.push(components.scheme); + uriTokens.push(":"); + } + var authority = _recomposeAuthority(components, options); + if (authority !== undefined) { + if (options.reference !== "suffix") { + uriTokens.push("//"); + } + uriTokens.push(authority); + if (components.path && components.path.charAt(0) !== "/") { + uriTokens.push("/"); + } + } + if (components.path !== undefined) { + var s = components.path; + if (!options.absolutePath && (!schemeHandler || !schemeHandler.absolutePath)) { + s = removeDotSegments(s); + } + if (authority === undefined) { + s = s.replace(/^\/\//, "/%2F"); //don't allow the path to start with "//" + } + uriTokens.push(s); + } + if (components.query !== undefined) { + uriTokens.push("?"); + uriTokens.push(components.query); + } + if (components.fragment !== undefined) { + uriTokens.push("#"); + uriTokens.push(components.fragment); + } + return uriTokens.join(""); //merge tokens into a string +} + +function resolveComponents(base, relative) { + var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; + var skipNormalization = arguments[3]; + + var target = {}; + if (!skipNormalization) { + base = parse(serialize(base, options), options); //normalize base components + relative = parse(serialize(relative, options), options); //normalize relative components + } + options = options || {}; + if (!options.tolerant && relative.scheme) { + target.scheme = relative.scheme; + //target.authority = relative.authority; + target.userinfo = relative.userinfo; + target.host = relative.host; + target.port = relative.port; + target.path = removeDotSegments(relative.path || ""); + target.query = relative.query; + } else { + if (relative.userinfo !== undefined || relative.host !== undefined || relative.port !== undefined) { + //target.authority = relative.authority; + target.userinfo = relative.userinfo; + target.host = relative.host; + target.port = relative.port; + target.path = removeDotSegments(relative.path || ""); + target.query = relative.query; + } else { + if (!relative.path) { + target.path = base.path; + if (relative.query !== undefined) { + target.query = relative.query; + } else { + target.query = base.query; + } + } else { + if (relative.path.charAt(0) === "/") { + target.path = removeDotSegments(relative.path); + } else { + if ((base.userinfo !== undefined || base.host !== undefined || base.port !== undefined) && !base.path) { + target.path = "/" + relative.path; + } else if (!base.path) { + target.path = relative.path; + } else { + target.path = base.path.slice(0, base.path.lastIndexOf("/") + 1) + relative.path; + } + target.path = removeDotSegments(target.path); + } + target.query = relative.query; + } + //target.authority = base.authority; + target.userinfo = base.userinfo; + target.host = base.host; + target.port = base.port; + } + target.scheme = base.scheme; + } + target.fragment = relative.fragment; + return target; +} + +function resolve(baseURI, relativeURI, options) { + var schemelessOptions = assign({ scheme: 'null' }, options); + return serialize(resolveComponents(parse(baseURI, schemelessOptions), parse(relativeURI, schemelessOptions), schemelessOptions, true), schemelessOptions); +} + +function normalize(uri, options) { + if (typeof uri === "string") { + uri = serialize(parse(uri, options), options); + } else if (typeOf(uri) === "object") { + uri = parse(serialize(uri, options), options); + } + return uri; +} + +function equal(uriA, uriB, options) { + if (typeof uriA === "string") { + uriA = serialize(parse(uriA, options), options); + } else if (typeOf(uriA) === "object") { + uriA = serialize(uriA, options); + } + if (typeof uriB === "string") { + uriB = serialize(parse(uriB, options), options); + } else if (typeOf(uriB) === "object") { + uriB = serialize(uriB, options); + } + return uriA === uriB; +} + +function escapeComponent(str, options) { + return str && str.toString().replace(!options || !options.iri ? URI_PROTOCOL.ESCAPE : IRI_PROTOCOL.ESCAPE, pctEncChar); +} + +function unescapeComponent(str, options) { + return str && str.toString().replace(!options || !options.iri ? URI_PROTOCOL.PCT_ENCODED : IRI_PROTOCOL.PCT_ENCODED, pctDecChars); +} + +var handler = { + scheme: "http", + domainHost: true, + parse: function parse(components, options) { + //report missing host + if (!components.host) { + components.error = components.error || "HTTP URIs must have a host."; + } + return components; + }, + serialize: function serialize(components, options) { + var secure = String(components.scheme).toLowerCase() === "https"; + //normalize the default port + if (components.port === (secure ? 443 : 80) || components.port === "") { + components.port = undefined; + } + //normalize the empty path + if (!components.path) { + components.path = "/"; + } + //NOTE: We do not parse query strings for HTTP URIs + //as WWW Form Url Encoded query strings are part of the HTML4+ spec, + //and not the HTTP spec. + return components; + } +}; + +var handler$1 = { + scheme: "https", + domainHost: handler.domainHost, + parse: handler.parse, + serialize: handler.serialize +}; + +function isSecure(wsComponents) { + return typeof wsComponents.secure === 'boolean' ? wsComponents.secure : String(wsComponents.scheme).toLowerCase() === "wss"; +} +//RFC 6455 +var handler$2 = { + scheme: "ws", + domainHost: true, + parse: function parse(components, options) { + var wsComponents = components; + //indicate if the secure flag is set + wsComponents.secure = isSecure(wsComponents); + //construct resouce name + wsComponents.resourceName = (wsComponents.path || '/') + (wsComponents.query ? '?' + wsComponents.query : ''); + wsComponents.path = undefined; + wsComponents.query = undefined; + return wsComponents; + }, + serialize: function serialize(wsComponents, options) { + //normalize the default port + if (wsComponents.port === (isSecure(wsComponents) ? 443 : 80) || wsComponents.port === "") { + wsComponents.port = undefined; + } + //ensure scheme matches secure flag + if (typeof wsComponents.secure === 'boolean') { + wsComponents.scheme = wsComponents.secure ? 'wss' : 'ws'; + wsComponents.secure = undefined; + } + //reconstruct path from resource name + if (wsComponents.resourceName) { + var _wsComponents$resourc = wsComponents.resourceName.split('?'), + _wsComponents$resourc2 = slicedToArray(_wsComponents$resourc, 2), + path = _wsComponents$resourc2[0], + query = _wsComponents$resourc2[1]; + + wsComponents.path = path && path !== '/' ? path : undefined; + wsComponents.query = query; + wsComponents.resourceName = undefined; + } + //forbid fragment component + wsComponents.fragment = undefined; + return wsComponents; + } +}; + +var handler$3 = { + scheme: "wss", + domainHost: handler$2.domainHost, + parse: handler$2.parse, + serialize: handler$2.serialize +}; + +var O = {}; +var isIRI = true; +//RFC 3986 +var UNRESERVED$$ = "[A-Za-z0-9\\-\\.\\_\\~" + (isIRI ? "\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF" : "") + "]"; +var HEXDIG$$ = "[0-9A-Fa-f]"; //case-insensitive +var PCT_ENCODED$ = subexp(subexp("%[EFef]" + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$) + "|" + subexp("%[89A-Fa-f]" + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$) + "|" + subexp("%" + HEXDIG$$ + HEXDIG$$)); //expanded +//RFC 5322, except these symbols as per RFC 6068: @ : / ? # [ ] & ; = +//const ATEXT$$ = "[A-Za-z0-9\\!\\#\\$\\%\\&\\'\\*\\+\\-\\/\\=\\?\\^\\_\\`\\{\\|\\}\\~]"; +//const WSP$$ = "[\\x20\\x09]"; +//const OBS_QTEXT$$ = "[\\x01-\\x08\\x0B\\x0C\\x0E-\\x1F\\x7F]"; //(%d1-8 / %d11-12 / %d14-31 / %d127) +//const QTEXT$$ = merge("[\\x21\\x23-\\x5B\\x5D-\\x7E]", OBS_QTEXT$$); //%d33 / %d35-91 / %d93-126 / obs-qtext +//const VCHAR$$ = "[\\x21-\\x7E]"; +//const WSP$$ = "[\\x20\\x09]"; +//const OBS_QP$ = subexp("\\\\" + merge("[\\x00\\x0D\\x0A]", OBS_QTEXT$$)); //%d0 / CR / LF / obs-qtext +//const FWS$ = subexp(subexp(WSP$$ + "*" + "\\x0D\\x0A") + "?" + WSP$$ + "+"); +//const QUOTED_PAIR$ = subexp(subexp("\\\\" + subexp(VCHAR$$ + "|" + WSP$$)) + "|" + OBS_QP$); +//const QUOTED_STRING$ = subexp('\\"' + subexp(FWS$ + "?" + QCONTENT$) + "*" + FWS$ + "?" + '\\"'); +var ATEXT$$ = "[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]"; +var QTEXT$$ = "[\\!\\$\\%\\'\\(\\)\\*\\+\\,\\-\\.0-9\\<\\>A-Z\\x5E-\\x7E]"; +var VCHAR$$ = merge(QTEXT$$, "[\\\"\\\\]"); +var SOME_DELIMS$$ = "[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]"; +var UNRESERVED = new RegExp(UNRESERVED$$, "g"); +var PCT_ENCODED = new RegExp(PCT_ENCODED$, "g"); +var NOT_LOCAL_PART = new RegExp(merge("[^]", ATEXT$$, "[\\.]", '[\\"]', VCHAR$$), "g"); +var NOT_HFNAME = new RegExp(merge("[^]", UNRESERVED$$, SOME_DELIMS$$), "g"); +var NOT_HFVALUE = NOT_HFNAME; +function decodeUnreserved(str) { + var decStr = pctDecChars(str); + return !decStr.match(UNRESERVED) ? str : decStr; +} +var handler$4 = { + scheme: "mailto", + parse: function parse$$1(components, options) { + var mailtoComponents = components; + var to = mailtoComponents.to = mailtoComponents.path ? mailtoComponents.path.split(",") : []; + mailtoComponents.path = undefined; + if (mailtoComponents.query) { + var unknownHeaders = false; + var headers = {}; + var hfields = mailtoComponents.query.split("&"); + for (var x = 0, xl = hfields.length; x < xl; ++x) { + var hfield = hfields[x].split("="); + switch (hfield[0]) { + case "to": + var toAddrs = hfield[1].split(","); + for (var _x = 0, _xl = toAddrs.length; _x < _xl; ++_x) { + to.push(toAddrs[_x]); + } + break; + case "subject": + mailtoComponents.subject = unescapeComponent(hfield[1], options); + break; + case "body": + mailtoComponents.body = unescapeComponent(hfield[1], options); + break; + default: + unknownHeaders = true; + headers[unescapeComponent(hfield[0], options)] = unescapeComponent(hfield[1], options); + break; + } + } + if (unknownHeaders) mailtoComponents.headers = headers; + } + mailtoComponents.query = undefined; + for (var _x2 = 0, _xl2 = to.length; _x2 < _xl2; ++_x2) { + var addr = to[_x2].split("@"); + addr[0] = unescapeComponent(addr[0]); + if (!options.unicodeSupport) { + //convert Unicode IDN -> ASCII IDN + try { + addr[1] = punycode.toASCII(unescapeComponent(addr[1], options).toLowerCase()); + } catch (e) { + mailtoComponents.error = mailtoComponents.error || "Email address's domain name can not be converted to ASCII via punycode: " + e; + } + } else { + addr[1] = unescapeComponent(addr[1], options).toLowerCase(); + } + to[_x2] = addr.join("@"); + } + return mailtoComponents; + }, + serialize: function serialize$$1(mailtoComponents, options) { + var components = mailtoComponents; + var to = toArray(mailtoComponents.to); + if (to) { + for (var x = 0, xl = to.length; x < xl; ++x) { + var toAddr = String(to[x]); + var atIdx = toAddr.lastIndexOf("@"); + var localPart = toAddr.slice(0, atIdx).replace(PCT_ENCODED, decodeUnreserved).replace(PCT_ENCODED, toUpperCase).replace(NOT_LOCAL_PART, pctEncChar); + var domain = toAddr.slice(atIdx + 1); + //convert IDN via punycode + try { + domain = !options.iri ? punycode.toASCII(unescapeComponent(domain, options).toLowerCase()) : punycode.toUnicode(domain); + } catch (e) { + components.error = components.error || "Email address's domain name can not be converted to " + (!options.iri ? "ASCII" : "Unicode") + " via punycode: " + e; + } + to[x] = localPart + "@" + domain; + } + components.path = to.join(","); + } + var headers = mailtoComponents.headers = mailtoComponents.headers || {}; + if (mailtoComponents.subject) headers["subject"] = mailtoComponents.subject; + if (mailtoComponents.body) headers["body"] = mailtoComponents.body; + var fields = []; + for (var name in headers) { + if (headers[name] !== O[name]) { + fields.push(name.replace(PCT_ENCODED, decodeUnreserved).replace(PCT_ENCODED, toUpperCase).replace(NOT_HFNAME, pctEncChar) + "=" + headers[name].replace(PCT_ENCODED, decodeUnreserved).replace(PCT_ENCODED, toUpperCase).replace(NOT_HFVALUE, pctEncChar)); + } + } + if (fields.length) { + components.query = fields.join("&"); + } + return components; + } +}; + +var URN_PARSE = /^([^\:]+)\:(.*)/; +//RFC 2141 +var handler$5 = { + scheme: "urn", + parse: function parse$$1(components, options) { + var matches = components.path && components.path.match(URN_PARSE); + var urnComponents = components; + if (matches) { + var scheme = options.scheme || urnComponents.scheme || "urn"; + var nid = matches[1].toLowerCase(); + var nss = matches[2]; + var urnScheme = scheme + ":" + (options.nid || nid); + var schemeHandler = SCHEMES[urnScheme]; + urnComponents.nid = nid; + urnComponents.nss = nss; + urnComponents.path = undefined; + if (schemeHandler) { + urnComponents = schemeHandler.parse(urnComponents, options); + } + } else { + urnComponents.error = urnComponents.error || "URN can not be parsed."; + } + return urnComponents; + }, + serialize: function serialize$$1(urnComponents, options) { + var scheme = options.scheme || urnComponents.scheme || "urn"; + var nid = urnComponents.nid; + var urnScheme = scheme + ":" + (options.nid || nid); + var schemeHandler = SCHEMES[urnScheme]; + if (schemeHandler) { + urnComponents = schemeHandler.serialize(urnComponents, options); + } + var uriComponents = urnComponents; + var nss = urnComponents.nss; + uriComponents.path = (nid || options.nid) + ":" + nss; + return uriComponents; + } +}; + +var UUID = /^[0-9A-Fa-f]{8}(?:\-[0-9A-Fa-f]{4}){3}\-[0-9A-Fa-f]{12}$/; +//RFC 4122 +var handler$6 = { + scheme: "urn:uuid", + parse: function parse(urnComponents, options) { + var uuidComponents = urnComponents; + uuidComponents.uuid = uuidComponents.nss; + uuidComponents.nss = undefined; + if (!options.tolerant && (!uuidComponents.uuid || !uuidComponents.uuid.match(UUID))) { + uuidComponents.error = uuidComponents.error || "UUID is not valid."; + } + return uuidComponents; + }, + serialize: function serialize(uuidComponents, options) { + var urnComponents = uuidComponents; + //normalize UUID + urnComponents.nss = (uuidComponents.uuid || "").toLowerCase(); + return urnComponents; + } +}; + +SCHEMES[handler.scheme] = handler; +SCHEMES[handler$1.scheme] = handler$1; +SCHEMES[handler$2.scheme] = handler$2; +SCHEMES[handler$3.scheme] = handler$3; +SCHEMES[handler$4.scheme] = handler$4; +SCHEMES[handler$5.scheme] = handler$5; +SCHEMES[handler$6.scheme] = handler$6; + +exports.SCHEMES = SCHEMES; +exports.pctEncChar = pctEncChar; +exports.pctDecChars = pctDecChars; +exports.parse = parse; +exports.removeDotSegments = removeDotSegments; +exports.serialize = serialize; +exports.resolveComponents = resolveComponents; +exports.resolve = resolve; +exports.normalize = normalize; +exports.equal = equal; +exports.escapeComponent = escapeComponent; +exports.unescapeComponent = unescapeComponent; + +Object.defineProperty(exports, '__esModule', { value: true }); + +}))); +//# sourceMappingURL=uri.all.js.map diff --git a/deps/npm/node_modules/uri-js/dist/es5/uri.all.js.map b/deps/npm/node_modules/uri-js/dist/es5/uri.all.js.map new file mode 100755 index 00000000000000..5b30c4e2202e13 --- /dev/null +++ b/deps/npm/node_modules/uri-js/dist/es5/uri.all.js.map @@ -0,0 +1 @@ +{"version":3,"file":"uri.all.js","sources":["../../src/index.ts","../../src/schemes/urn-uuid.ts","../../src/schemes/urn.ts","../../src/schemes/mailto.ts","../../src/schemes/wss.ts","../../src/schemes/ws.ts","../../src/schemes/https.ts","../../src/schemes/http.ts","../../src/uri.ts","../../node_modules/punycode/punycode.es6.js","../../src/regexps-iri.ts","../../src/regexps-uri.ts","../../src/util.ts"],"sourcesContent":["import { SCHEMES } from \"./uri\";\n\nimport http from \"./schemes/http\";\nSCHEMES[http.scheme] = http;\n\nimport https from \"./schemes/https\";\nSCHEMES[https.scheme] = https;\n\nimport ws from \"./schemes/ws\";\nSCHEMES[ws.scheme] = ws;\n\nimport wss from \"./schemes/wss\";\nSCHEMES[wss.scheme] = wss;\n\nimport mailto from \"./schemes/mailto\";\nSCHEMES[mailto.scheme] = mailto;\n\nimport urn from \"./schemes/urn\";\nSCHEMES[urn.scheme] = urn;\n\nimport uuid from \"./schemes/urn-uuid\";\nSCHEMES[uuid.scheme] = uuid;\n\nexport * from \"./uri\";\n","import { URISchemeHandler, URIComponents, URIOptions } from \"../uri\";\nimport { URNComponents } from \"./urn\";\nimport { SCHEMES } from \"../uri\";\n\nexport interface UUIDComponents extends URNComponents {\n\tuuid?: string;\n}\n\nconst UUID = /^[0-9A-Fa-f]{8}(?:\\-[0-9A-Fa-f]{4}){3}\\-[0-9A-Fa-f]{12}$/;\nconst UUID_PARSE = /^[0-9A-Fa-f\\-]{36}/;\n\n//RFC 4122\nconst handler:URISchemeHandler = {\n\tscheme : \"urn:uuid\",\n\n\tparse : function (urnComponents:URNComponents, options:URIOptions):UUIDComponents {\n\t\tconst uuidComponents = urnComponents as UUIDComponents;\n\t\tuuidComponents.uuid = uuidComponents.nss;\n\t\tuuidComponents.nss = undefined;\n\n\t\tif (!options.tolerant && (!uuidComponents.uuid || !uuidComponents.uuid.match(UUID))) {\n\t\t\tuuidComponents.error = uuidComponents.error || \"UUID is not valid.\";\n\t\t}\n\n\t\treturn uuidComponents;\n\t},\n\n\tserialize : function (uuidComponents:UUIDComponents, options:URIOptions):URNComponents {\n\t\tconst urnComponents = uuidComponents as URNComponents;\n\t\t//normalize UUID\n\t\turnComponents.nss = (uuidComponents.uuid || \"\").toLowerCase();\n\t\treturn urnComponents;\n\t},\n};\n\nexport default handler;","import { URISchemeHandler, URIComponents, URIOptions } from \"../uri\";\nimport { pctEncChar, SCHEMES } from \"../uri\";\n\nexport interface URNComponents extends URIComponents {\n\tnid?:string;\n\tnss?:string;\n}\n\nexport interface URNOptions extends URIOptions {\n\tnid?:string;\n}\n\nconst NID$ = \"(?:[0-9A-Za-z][0-9A-Za-z\\\\-]{1,31})\";\nconst PCT_ENCODED$ = \"(?:\\\\%[0-9A-Fa-f]{2})\";\nconst TRANS$$ = \"[0-9A-Za-z\\\\(\\\\)\\\\+\\\\,\\\\-\\\\.\\\\:\\\\=\\\\@\\\\;\\\\$\\\\_\\\\!\\\\*\\\\'\\\\/\\\\?\\\\#]\";\nconst NSS$ = \"(?:(?:\" + PCT_ENCODED$ + \"|\" + TRANS$$ + \")+)\";\nconst URN_SCHEME = new RegExp(\"^urn\\\\:(\" + NID$ + \")$\");\nconst URN_PATH = new RegExp(\"^(\" + NID$ + \")\\\\:(\" + NSS$ + \")$\");\nconst URN_PARSE = /^([^\\:]+)\\:(.*)/;\nconst URN_EXCLUDED = /[\\x00-\\x20\\\\\\\"\\&\\<\\>\\[\\]\\^\\`\\{\\|\\}\\~\\x7F-\\xFF]/g;\n\n//RFC 2141\nconst handler:URISchemeHandler = {\n\tscheme : \"urn\",\n\n\tparse : function (components:URIComponents, options:URNOptions):URNComponents {\n\t\tconst matches = components.path && components.path.match(URN_PARSE);\n\t\tlet urnComponents = components as URNComponents;\n\n\t\tif (matches) {\n\t\t\tconst scheme = options.scheme || urnComponents.scheme || \"urn\";\n\t\t\tconst nid = matches[1].toLowerCase();\n\t\t\tconst nss = matches[2];\n\t\t\tconst urnScheme = `${scheme}:${options.nid || nid}`;\n\t\t\tconst schemeHandler = SCHEMES[urnScheme];\n\n\t\t\turnComponents.nid = nid;\n\t\t\turnComponents.nss = nss;\n\t\t\turnComponents.path = undefined;\n\n\t\t\tif (schemeHandler) {\n\t\t\t\turnComponents = schemeHandler.parse(urnComponents, options) as URNComponents;\n\t\t\t}\n\t\t} else {\n\t\t\turnComponents.error = urnComponents.error || \"URN can not be parsed.\";\n\t\t}\n\n\t\treturn urnComponents;\n\t},\n\n\tserialize : function (urnComponents:URNComponents, options:URNOptions):URIComponents {\n\t\tconst scheme = options.scheme || urnComponents.scheme || \"urn\";\n\t\tconst nid = urnComponents.nid;\n\t\tconst urnScheme = `${scheme}:${options.nid || nid}`;\n\t\tconst schemeHandler = SCHEMES[urnScheme];\n\n\t\tif (schemeHandler) {\n\t\t\turnComponents = schemeHandler.serialize(urnComponents, options) as URNComponents;\n\t\t}\n\n\t\tconst uriComponents = urnComponents as URIComponents;\n\t\tconst nss = urnComponents.nss;\n\t\turiComponents.path = `${nid || options.nid}:${nss}`;\n\n\t\treturn uriComponents;\n\t},\n};\n\nexport default handler;","import { URISchemeHandler, URIComponents, URIOptions } from \"../uri\";\nimport { pctEncChar, pctDecChars, unescapeComponent } from \"../uri\";\nimport punycode from \"punycode\";\nimport { merge, subexp, toUpperCase, toArray } from \"../util\";\n\nexport interface MailtoHeaders {\n\t[hfname:string]:string\n}\n\nexport interface MailtoComponents extends URIComponents {\n\tto:Array,\n\theaders?:MailtoHeaders,\n\tsubject?:string,\n\tbody?:string\n}\n\nconst O:MailtoHeaders = {};\nconst isIRI = true;\n\n//RFC 3986\nconst UNRESERVED$$ = \"[A-Za-z0-9\\\\-\\\\.\\\\_\\\\~\" + (isIRI ? \"\\\\xA0-\\\\u200D\\\\u2010-\\\\u2029\\\\u202F-\\\\uD7FF\\\\uF900-\\\\uFDCF\\\\uFDF0-\\\\uFFEF\" : \"\") + \"]\";\nconst HEXDIG$$ = \"[0-9A-Fa-f]\"; //case-insensitive\nconst PCT_ENCODED$ = subexp(subexp(\"%[EFef]\" + HEXDIG$$ + \"%\" + HEXDIG$$ + HEXDIG$$ + \"%\" + HEXDIG$$ + HEXDIG$$) + \"|\" + subexp(\"%[89A-Fa-f]\" + HEXDIG$$ + \"%\" + HEXDIG$$ + HEXDIG$$) + \"|\" + subexp(\"%\" + HEXDIG$$ + HEXDIG$$)); //expanded\n\n//RFC 5322, except these symbols as per RFC 6068: @ : / ? # [ ] & ; =\n//const ATEXT$$ = \"[A-Za-z0-9\\\\!\\\\#\\\\$\\\\%\\\\&\\\\'\\\\*\\\\+\\\\-\\\\/\\\\=\\\\?\\\\^\\\\_\\\\`\\\\{\\\\|\\\\}\\\\~]\";\n//const WSP$$ = \"[\\\\x20\\\\x09]\";\n//const OBS_QTEXT$$ = \"[\\\\x01-\\\\x08\\\\x0B\\\\x0C\\\\x0E-\\\\x1F\\\\x7F]\"; //(%d1-8 / %d11-12 / %d14-31 / %d127)\n//const QTEXT$$ = merge(\"[\\\\x21\\\\x23-\\\\x5B\\\\x5D-\\\\x7E]\", OBS_QTEXT$$); //%d33 / %d35-91 / %d93-126 / obs-qtext\n//const VCHAR$$ = \"[\\\\x21-\\\\x7E]\";\n//const WSP$$ = \"[\\\\x20\\\\x09]\";\n//const OBS_QP$ = subexp(\"\\\\\\\\\" + merge(\"[\\\\x00\\\\x0D\\\\x0A]\", OBS_QTEXT$$)); //%d0 / CR / LF / obs-qtext\n//const FWS$ = subexp(subexp(WSP$$ + \"*\" + \"\\\\x0D\\\\x0A\") + \"?\" + WSP$$ + \"+\");\n//const QUOTED_PAIR$ = subexp(subexp(\"\\\\\\\\\" + subexp(VCHAR$$ + \"|\" + WSP$$)) + \"|\" + OBS_QP$);\n//const QUOTED_STRING$ = subexp('\\\\\"' + subexp(FWS$ + \"?\" + QCONTENT$) + \"*\" + FWS$ + \"?\" + '\\\\\"');\nconst ATEXT$$ = \"[A-Za-z0-9\\\\!\\\\$\\\\%\\\\'\\\\*\\\\+\\\\-\\\\^\\\\_\\\\`\\\\{\\\\|\\\\}\\\\~]\";\nconst QTEXT$$ = \"[\\\\!\\\\$\\\\%\\\\'\\\\(\\\\)\\\\*\\\\+\\\\,\\\\-\\\\.0-9\\\\<\\\\>A-Z\\\\x5E-\\\\x7E]\";\nconst VCHAR$$ = merge(QTEXT$$, \"[\\\\\\\"\\\\\\\\]\");\nconst DOT_ATOM_TEXT$ = subexp(ATEXT$$ + \"+\" + subexp(\"\\\\.\" + ATEXT$$ + \"+\") + \"*\");\nconst QUOTED_PAIR$ = subexp(\"\\\\\\\\\" + VCHAR$$);\nconst QCONTENT$ = subexp(QTEXT$$ + \"|\" + QUOTED_PAIR$);\nconst QUOTED_STRING$ = subexp('\\\\\"' + QCONTENT$ + \"*\" + '\\\\\"');\n\n//RFC 6068\nconst DTEXT_NO_OBS$$ = \"[\\\\x21-\\\\x5A\\\\x5E-\\\\x7E]\"; //%d33-90 / %d94-126\nconst SOME_DELIMS$$ = \"[\\\\!\\\\$\\\\'\\\\(\\\\)\\\\*\\\\+\\\\,\\\\;\\\\:\\\\@]\";\nconst QCHAR$ = subexp(UNRESERVED$$ + \"|\" + PCT_ENCODED$ + \"|\" + SOME_DELIMS$$);\nconst DOMAIN$ = subexp(DOT_ATOM_TEXT$ + \"|\" + \"\\\\[\" + DTEXT_NO_OBS$$ + \"*\" + \"\\\\]\");\nconst LOCAL_PART$ = subexp(DOT_ATOM_TEXT$ + \"|\" + QUOTED_STRING$);\nconst ADDR_SPEC$ = subexp(LOCAL_PART$ + \"\\\\@\" + DOMAIN$);\nconst TO$ = subexp(ADDR_SPEC$ + subexp(\"\\\\,\" + ADDR_SPEC$) + \"*\");\nconst HFNAME$ = subexp(QCHAR$ + \"*\");\nconst HFVALUE$ = HFNAME$;\nconst HFIELD$ = subexp(HFNAME$ + \"\\\\=\" + HFVALUE$);\nconst HFIELDS2$ = subexp(HFIELD$ + subexp(\"\\\\&\" + HFIELD$) + \"*\");\nconst HFIELDS$ = subexp(\"\\\\?\" + HFIELDS2$);\nconst MAILTO_URI = new RegExp(\"^mailto\\\\:\" + TO$ + \"?\" + HFIELDS$ + \"?$\");\n\nconst UNRESERVED = new RegExp(UNRESERVED$$, \"g\");\nconst PCT_ENCODED = new RegExp(PCT_ENCODED$, \"g\");\nconst NOT_LOCAL_PART = new RegExp(merge(\"[^]\", ATEXT$$, \"[\\\\.]\", '[\\\\\"]', VCHAR$$), \"g\");\nconst NOT_DOMAIN = new RegExp(merge(\"[^]\", ATEXT$$, \"[\\\\.]\", \"[\\\\[]\", DTEXT_NO_OBS$$, \"[\\\\]]\"), \"g\");\nconst NOT_HFNAME = new RegExp(merge(\"[^]\", UNRESERVED$$, SOME_DELIMS$$), \"g\");\nconst NOT_HFVALUE = NOT_HFNAME;\nconst TO = new RegExp(\"^\" + TO$ + \"$\");\nconst HFIELDS = new RegExp(\"^\" + HFIELDS2$ + \"$\");\n\nfunction decodeUnreserved(str:string):string {\n\tconst decStr = pctDecChars(str);\n\treturn (!decStr.match(UNRESERVED) ? str : decStr);\n}\n\nconst handler:URISchemeHandler = {\n\tscheme : \"mailto\",\n\n\tparse : function (components:URIComponents, options:URIOptions):MailtoComponents {\n\t\tconst mailtoComponents = components as MailtoComponents;\n\t\tconst to = mailtoComponents.to = (mailtoComponents.path ? mailtoComponents.path.split(\",\") : []);\n\t\tmailtoComponents.path = undefined;\n\n\t\tif (mailtoComponents.query) {\n\t\t\tlet unknownHeaders = false\n\t\t\tconst headers:MailtoHeaders = {};\n\t\t\tconst hfields = mailtoComponents.query.split(\"&\");\n\n\t\t\tfor (let x = 0, xl = hfields.length; x < xl; ++x) {\n\t\t\t\tconst hfield = hfields[x].split(\"=\");\n\n\t\t\t\tswitch (hfield[0]) {\n\t\t\t\t\tcase \"to\":\n\t\t\t\t\t\tconst toAddrs = hfield[1].split(\",\");\n\t\t\t\t\t\tfor (let x = 0, xl = toAddrs.length; x < xl; ++x) {\n\t\t\t\t\t\t\tto.push(toAddrs[x]);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"subject\":\n\t\t\t\t\t\tmailtoComponents.subject = unescapeComponent(hfield[1], options);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"body\":\n\t\t\t\t\t\tmailtoComponents.body = unescapeComponent(hfield[1], options);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tunknownHeaders = true;\n\t\t\t\t\t\theaders[unescapeComponent(hfield[0], options)] = unescapeComponent(hfield[1], options);\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (unknownHeaders) mailtoComponents.headers = headers;\n\t\t}\n\n\t\tmailtoComponents.query = undefined;\n\n\t\tfor (let x = 0, xl = to.length; x < xl; ++x) {\n\t\t\tconst addr = to[x].split(\"@\");\n\n\t\t\taddr[0] = unescapeComponent(addr[0]);\n\n\t\t\tif (!options.unicodeSupport) {\n\t\t\t\t//convert Unicode IDN -> ASCII IDN\n\t\t\t\ttry {\n\t\t\t\t\taddr[1] = punycode.toASCII(unescapeComponent(addr[1], options).toLowerCase());\n\t\t\t\t} catch (e) {\n\t\t\t\t\tmailtoComponents.error = mailtoComponents.error || \"Email address's domain name can not be converted to ASCII via punycode: \" + e;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\taddr[1] = unescapeComponent(addr[1], options).toLowerCase();\n\t\t\t}\n\n\t\t\tto[x] = addr.join(\"@\");\n\t\t}\n\n\t\treturn mailtoComponents;\n\t},\n\n\tserialize : function (mailtoComponents:MailtoComponents, options:URIOptions):URIComponents {\n\t\tconst components = mailtoComponents as URIComponents;\n\t\tconst to = toArray(mailtoComponents.to);\n\t\tif (to) {\n\t\t\tfor (let x = 0, xl = to.length; x < xl; ++x) {\n\t\t\t\tconst toAddr = String(to[x]);\n\t\t\t\tconst atIdx = toAddr.lastIndexOf(\"@\");\n\t\t\t\tconst localPart = (toAddr.slice(0, atIdx)).replace(PCT_ENCODED, decodeUnreserved).replace(PCT_ENCODED, toUpperCase).replace(NOT_LOCAL_PART, pctEncChar);\n\t\t\t\tlet domain = toAddr.slice(atIdx + 1);\n\n\t\t\t\t//convert IDN via punycode\n\t\t\t\ttry {\n\t\t\t\t\tdomain = (!options.iri ? punycode.toASCII(unescapeComponent(domain, options).toLowerCase()) : punycode.toUnicode(domain));\n\t\t\t\t} catch (e) {\n\t\t\t\t\tcomponents.error = components.error || \"Email address's domain name can not be converted to \" + (!options.iri ? \"ASCII\" : \"Unicode\") + \" via punycode: \" + e;\n\t\t\t\t}\n\n\t\t\t\tto[x] = localPart + \"@\" + domain;\n\t\t\t}\n\n\t\t\tcomponents.path = to.join(\",\");\n\t\t}\n\n\t\tconst headers = mailtoComponents.headers = mailtoComponents.headers || {};\n\n\t\tif (mailtoComponents.subject) headers[\"subject\"] = mailtoComponents.subject;\n\t\tif (mailtoComponents.body) headers[\"body\"] = mailtoComponents.body;\n\n\t\tconst fields = [];\n\t\tfor (const name in headers) {\n\t\t\tif (headers[name] !== O[name]) {\n\t\t\t\tfields.push(\n\t\t\t\t\tname.replace(PCT_ENCODED, decodeUnreserved).replace(PCT_ENCODED, toUpperCase).replace(NOT_HFNAME, pctEncChar) +\n\t\t\t\t\t\"=\" +\n\t\t\t\t\theaders[name].replace(PCT_ENCODED, decodeUnreserved).replace(PCT_ENCODED, toUpperCase).replace(NOT_HFVALUE, pctEncChar)\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t\tif (fields.length) {\n\t\t\tcomponents.query = fields.join(\"&\");\n\t\t}\n\n\t\treturn components;\n\t}\n}\n\nexport default handler;","import { URISchemeHandler, URIComponents, URIOptions } from \"../uri\";\nimport ws from \"./ws\";\n\nconst handler:URISchemeHandler = {\n\tscheme : \"wss\",\n\tdomainHost : ws.domainHost,\n\tparse : ws.parse,\n\tserialize : ws.serialize\n}\n\nexport default handler;","import { URISchemeHandler, URIComponents, URIOptions } from \"../uri\";\n\nexport interface WSComponents extends URIComponents {\n\tresourceName?: string;\n\tsecure?: boolean;\n}\n\nfunction isSecure(wsComponents:WSComponents):boolean {\n\treturn typeof wsComponents.secure === 'boolean' ? wsComponents.secure : String(wsComponents.scheme).toLowerCase() === \"wss\";\n}\n\n//RFC 6455\nconst handler:URISchemeHandler = {\n\tscheme : \"ws\",\n\n\tdomainHost : true,\n\n\tparse : function (components:URIComponents, options:URIOptions):WSComponents {\n\t\tconst wsComponents = components as WSComponents;\n\n\t\t//indicate if the secure flag is set\n\t\twsComponents.secure = isSecure(wsComponents);\n\n\t\t//construct resouce name\n\t\twsComponents.resourceName = (wsComponents.path || '/') + (wsComponents.query ? '?' + wsComponents.query : '');\n\t\twsComponents.path = undefined;\n\t\twsComponents.query = undefined;\n\n\t\treturn wsComponents;\n\t},\n\n\tserialize : function (wsComponents:WSComponents, options:URIOptions):URIComponents {\n\t\t//normalize the default port\n\t\tif (wsComponents.port === (isSecure(wsComponents) ? 443 : 80) || wsComponents.port === \"\") {\n\t\t\twsComponents.port = undefined;\n\t\t}\n\n\t\t//ensure scheme matches secure flag\n\t\tif (typeof wsComponents.secure === 'boolean') {\n\t\t\twsComponents.scheme = (wsComponents.secure ? 'wss' : 'ws');\n\t\t\twsComponents.secure = undefined;\n\t\t}\n\n\t\t//reconstruct path from resource name\n\t\tif (wsComponents.resourceName) {\n\t\t\tconst [path, query] = wsComponents.resourceName.split('?');\n\t\t\twsComponents.path = (path && path !== '/' ? path : undefined);\n\t\t\twsComponents.query = query;\n\t\t\twsComponents.resourceName = undefined;\n\t\t}\n\n\t\t//forbid fragment component\n\t\twsComponents.fragment = undefined;\n\n\t\treturn wsComponents;\n\t}\n};\n\nexport default handler;","import { URISchemeHandler, URIComponents, URIOptions } from \"../uri\";\nimport http from \"./http\";\n\nconst handler:URISchemeHandler = {\n\tscheme : \"https\",\n\tdomainHost : http.domainHost,\n\tparse : http.parse,\n\tserialize : http.serialize\n}\n\nexport default handler;","import { URISchemeHandler, URIComponents, URIOptions } from \"../uri\";\n\nconst handler:URISchemeHandler = {\n\tscheme : \"http\",\n\n\tdomainHost : true,\n\n\tparse : function (components:URIComponents, options:URIOptions):URIComponents {\n\t\t//report missing host\n\t\tif (!components.host) {\n\t\t\tcomponents.error = components.error || \"HTTP URIs must have a host.\";\n\t\t}\n\n\t\treturn components;\n\t},\n\n\tserialize : function (components:URIComponents, options:URIOptions):URIComponents {\n\t\tconst secure = String(components.scheme).toLowerCase() === \"https\";\n\n\t\t//normalize the default port\n\t\tif (components.port === (secure ? 443 : 80) || components.port === \"\") {\n\t\t\tcomponents.port = undefined;\n\t\t}\n\t\t\n\t\t//normalize the empty path\n\t\tif (!components.path) {\n\t\t\tcomponents.path = \"/\";\n\t\t}\n\n\t\t//NOTE: We do not parse query strings for HTTP URIs\n\t\t//as WWW Form Url Encoded query strings are part of the HTML4+ spec,\n\t\t//and not the HTTP spec.\n\n\t\treturn components;\n\t}\n};\n\nexport default handler;","/**\n * URI.js\n *\n * @fileoverview An RFC 3986 compliant, scheme extendable URI parsing/validating/resolving library for JavaScript.\n * @author Gary Court\n * @see http://github.com/garycourt/uri-js\n */\n\n/**\n * Copyright 2011 Gary Court. All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without modification, are\n * permitted provided that the following conditions are met:\n *\n * 1. Redistributions of source code must retain the above copyright notice, this list of\n * conditions and the following disclaimer.\n *\n * 2. Redistributions in binary form must reproduce the above copyright notice, this list\n * of conditions and the following disclaimer in the documentation and/or other materials\n * provided with the distribution.\n *\n * THIS SOFTWARE IS PROVIDED BY GARY COURT ``AS IS'' AND ANY EXPRESS OR IMPLIED\n * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GARY COURT OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\n * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON\n * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *\n * The views and conclusions contained in the software and documentation are those of the\n * authors and should not be interpreted as representing official policies, either expressed\n * or implied, of Gary Court.\n */\n\nimport URI_PROTOCOL from \"./regexps-uri\";\nimport IRI_PROTOCOL from \"./regexps-iri\";\nimport punycode from \"punycode\";\nimport { toUpperCase, typeOf, assign } from \"./util\";\n\nexport interface URIComponents {\n\tscheme?:string;\n\tuserinfo?:string;\n\thost?:string;\n\tport?:number|string;\n\tpath?:string;\n\tquery?:string;\n\tfragment?:string;\n\treference?:string;\n\terror?:string;\n}\n\nexport interface URIOptions {\n\tscheme?:string;\n\treference?:string;\n\ttolerant?:boolean;\n\tabsolutePath?:boolean;\n\tiri?:boolean;\n\tunicodeSupport?:boolean;\n\tdomainHost?:boolean;\n}\n\nexport interface URISchemeHandler {\n\tscheme:string;\n\tparse(components:ParentComponents, options:Options):Components;\n\tserialize(components:Components, options:Options):ParentComponents;\n\tunicodeSupport?:boolean;\n\tdomainHost?:boolean;\n\tabsolutePath?:boolean;\n}\n\nexport interface URIRegExps {\n\tNOT_SCHEME : RegExp,\n\tNOT_USERINFO : RegExp,\n\tNOT_HOST : RegExp,\n\tNOT_PATH : RegExp,\n\tNOT_PATH_NOSCHEME : RegExp,\n\tNOT_QUERY : RegExp,\n\tNOT_FRAGMENT : RegExp,\n\tESCAPE : RegExp,\n\tUNRESERVED : RegExp,\n\tOTHER_CHARS : RegExp,\n\tPCT_ENCODED : RegExp,\n\tIPV4ADDRESS : RegExp,\n\tIPV6ADDRESS : RegExp,\n}\n\nexport const SCHEMES:{[scheme:string]:URISchemeHandler} = {};\n\nexport function pctEncChar(chr:string):string {\n\tconst c = chr.charCodeAt(0);\n\tlet e:string;\n\n\tif (c < 16) e = \"%0\" + c.toString(16).toUpperCase();\n\telse if (c < 128) e = \"%\" + c.toString(16).toUpperCase();\n\telse if (c < 2048) e = \"%\" + ((c >> 6) | 192).toString(16).toUpperCase() + \"%\" + ((c & 63) | 128).toString(16).toUpperCase();\n\telse e = \"%\" + ((c >> 12) | 224).toString(16).toUpperCase() + \"%\" + (((c >> 6) & 63) | 128).toString(16).toUpperCase() + \"%\" + ((c & 63) | 128).toString(16).toUpperCase();\n\n\treturn e;\n}\n\nexport function pctDecChars(str:string):string {\n\tlet newStr = \"\";\n\tlet i = 0;\n\tconst il = str.length;\n\n\twhile (i < il) {\n\t\tconst c = parseInt(str.substr(i + 1, 2), 16);\n\n\t\tif (c < 128) {\n\t\t\tnewStr += String.fromCharCode(c);\n\t\t\ti += 3;\n\t\t}\n\t\telse if (c >= 194 && c < 224) {\n\t\t\tif ((il - i) >= 6) {\n\t\t\t\tconst c2 = parseInt(str.substr(i + 4, 2), 16);\n\t\t\t\tnewStr += String.fromCharCode(((c & 31) << 6) | (c2 & 63));\n\t\t\t} else {\n\t\t\t\tnewStr += str.substr(i, 6);\n\t\t\t}\n\t\t\ti += 6;\n\t\t}\n\t\telse if (c >= 224) {\n\t\t\tif ((il - i) >= 9) {\n\t\t\t\tconst c2 = parseInt(str.substr(i + 4, 2), 16);\n\t\t\t\tconst c3 = parseInt(str.substr(i + 7, 2), 16);\n\t\t\t\tnewStr += String.fromCharCode(((c & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63));\n\t\t\t} else {\n\t\t\t\tnewStr += str.substr(i, 9);\n\t\t\t}\n\t\t\ti += 9;\n\t\t}\n\t\telse {\n\t\t\tnewStr += str.substr(i, 3);\n\t\t\ti += 3;\n\t\t}\n\t}\n\n\treturn newStr;\n}\n\nfunction _normalizeComponentEncoding(components:URIComponents, protocol:URIRegExps) {\n\tfunction decodeUnreserved(str:string):string {\n\t\tconst decStr = pctDecChars(str);\n\t\treturn (!decStr.match(protocol.UNRESERVED) ? str : decStr);\n\t}\n\n\tif (components.scheme) components.scheme = String(components.scheme).replace(protocol.PCT_ENCODED, decodeUnreserved).toLowerCase().replace(protocol.NOT_SCHEME, \"\");\n\tif (components.userinfo !== undefined) components.userinfo = String(components.userinfo).replace(protocol.PCT_ENCODED, decodeUnreserved).replace(protocol.NOT_USERINFO, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase);\n\tif (components.host !== undefined) components.host = String(components.host).replace(protocol.PCT_ENCODED, decodeUnreserved).toLowerCase().replace(protocol.NOT_HOST, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase);\n\tif (components.path !== undefined) components.path = String(components.path).replace(protocol.PCT_ENCODED, decodeUnreserved).replace((components.scheme ? protocol.NOT_PATH : protocol.NOT_PATH_NOSCHEME), pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase);\n\tif (components.query !== undefined) components.query = String(components.query).replace(protocol.PCT_ENCODED, decodeUnreserved).replace(protocol.NOT_QUERY, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase);\n\tif (components.fragment !== undefined) components.fragment = String(components.fragment).replace(protocol.PCT_ENCODED, decodeUnreserved).replace(protocol.NOT_FRAGMENT, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase);\n\n\treturn components;\n};\n\nfunction _stripLeadingZeros(str:string):string {\n\treturn str.replace(/^0*(.*)/, \"$1\") || \"0\";\n}\n\nfunction _normalizeIPv4(host:string, protocol:URIRegExps):string {\n\tconst matches = host.match(protocol.IPV4ADDRESS) || [];\n\tconst [, address] = matches;\n\t\n\tif (address) {\n\t\treturn address.split(\".\").map(_stripLeadingZeros).join(\".\");\n\t} else {\n\t\treturn host;\n\t}\n}\n\nfunction _normalizeIPv6(host:string, protocol:URIRegExps):string {\n\tconst matches = host.match(protocol.IPV6ADDRESS) || [];\n\tconst [, address, zone] = matches;\n\n\tif (address) {\n\t\tconst [last, first] = address.toLowerCase().split('::').reverse();\n\t\tconst firstFields = first ? first.split(\":\").map(_stripLeadingZeros) : [];\n\t\tconst lastFields = last.split(\":\").map(_stripLeadingZeros);\n\t\tconst isLastFieldIPv4Address = protocol.IPV4ADDRESS.test(lastFields[lastFields.length - 1]);\n\t\tconst fieldCount = isLastFieldIPv4Address ? 7 : 8;\n\t\tconst lastFieldsStart = lastFields.length - fieldCount;\n\t\tconst fields = Array(fieldCount);\n\n\t\tfor (let x = 0; x < fieldCount; ++x) {\n\t\t\tfields[x] = firstFields[x] || lastFields[lastFieldsStart + x] || '';\n\t\t}\n\n\t\tif (isLastFieldIPv4Address) {\n\t\t\tfields[fieldCount - 1] = _normalizeIPv4(fields[fieldCount - 1], protocol);\n\t\t}\n\n\t\tconst allZeroFields = fields.reduce>((acc, field, index) => {\n\t\t\tif (!field || field === \"0\") {\n\t\t\t\tconst lastLongest = acc[acc.length - 1];\n\t\t\t\tif (lastLongest && lastLongest.index + lastLongest.length === index) {\n\t\t\t\t\tlastLongest.length++;\n\t\t\t\t} else {\n\t\t\t\t\tacc.push({ index, length : 1 });\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn acc;\n\t\t}, []);\n\n\t\tconst longestZeroFields = allZeroFields.sort((a, b) => b.length - a.length)[0];\n\n\t\tlet newHost:string;\n\t\tif (longestZeroFields && longestZeroFields.length > 1) {\n\t\t\tconst newFirst = fields.slice(0, longestZeroFields.index) ;\n\t\t\tconst newLast = fields.slice(longestZeroFields.index + longestZeroFields.length);\n\t\t\tnewHost = newFirst.join(\":\") + \"::\" + newLast.join(\":\");\n\t\t} else {\n\t\t\tnewHost = fields.join(\":\");\n\t\t}\n\n\t\tif (zone) {\n\t\t\tnewHost += \"%\" + zone;\n\t\t}\n\n\t\treturn newHost;\n\t} else {\n\t\treturn host;\n\t}\n}\n\nconst URI_PARSE = /^(?:([^:\\/?#]+):)?(?:\\/\\/((?:([^\\/?#@]*)@)?(\\[[^\\/?#\\]]+\\]|[^\\/?#:]*)(?:\\:(\\d*))?))?([^?#]*)(?:\\?([^#]*))?(?:#((?:.|\\n|\\r)*))?/i;\nconst NO_MATCH_IS_UNDEFINED = ((\"\").match(/(){0}/))[1] === undefined;\n\nexport function parse(uriString:string, options:URIOptions = {}):URIComponents {\n\tconst components:URIComponents = {};\n\tconst protocol = (options.iri !== false ? IRI_PROTOCOL : URI_PROTOCOL);\n\n\tif (options.reference === \"suffix\") uriString = (options.scheme ? options.scheme + \":\" : \"\") + \"//\" + uriString;\n\n\tconst matches = uriString.match(URI_PARSE);\n\n\tif (matches) {\n\t\tif (NO_MATCH_IS_UNDEFINED) {\n\t\t\t//store each component\n\t\t\tcomponents.scheme = matches[1];\n\t\t\tcomponents.userinfo = matches[3];\n\t\t\tcomponents.host = matches[4];\n\t\t\tcomponents.port = parseInt(matches[5], 10);\n\t\t\tcomponents.path = matches[6] || \"\";\n\t\t\tcomponents.query = matches[7];\n\t\t\tcomponents.fragment = matches[8];\n\n\t\t\t//fix port number\n\t\t\tif (isNaN(components.port)) {\n\t\t\t\tcomponents.port = matches[5];\n\t\t\t}\n\t\t} else { //IE FIX for improper RegExp matching\n\t\t\t//store each component\n\t\t\tcomponents.scheme = matches[1] || undefined;\n\t\t\tcomponents.userinfo = (uriString.indexOf(\"@\") !== -1 ? matches[3] : undefined);\n\t\t\tcomponents.host = (uriString.indexOf(\"//\") !== -1 ? matches[4] : undefined);\n\t\t\tcomponents.port = parseInt(matches[5], 10);\n\t\t\tcomponents.path = matches[6] || \"\";\n\t\t\tcomponents.query = (uriString.indexOf(\"?\") !== -1 ? matches[7] : undefined);\n\t\t\tcomponents.fragment = (uriString.indexOf(\"#\") !== -1 ? matches[8] : undefined);\n\n\t\t\t//fix port number\n\t\t\tif (isNaN(components.port)) {\n\t\t\t\tcomponents.port = (uriString.match(/\\/\\/(?:.|\\n)*\\:(?:\\/|\\?|\\#|$)/) ? matches[4] : undefined);\n\t\t\t}\n\t\t}\n\n\t\tif (components.host) {\n\t\t\t//normalize IP hosts\n\t\t\tcomponents.host = _normalizeIPv6(_normalizeIPv4(components.host, protocol), protocol);\n\t\t}\n\n\t\t//determine reference type\n\t\tif (components.scheme === undefined && components.userinfo === undefined && components.host === undefined && components.port === undefined && !components.path && components.query === undefined) {\n\t\t\tcomponents.reference = \"same-document\";\n\t\t} else if (components.scheme === undefined) {\n\t\t\tcomponents.reference = \"relative\";\n\t\t} else if (components.fragment === undefined) {\n\t\t\tcomponents.reference = \"absolute\";\n\t\t} else {\n\t\t\tcomponents.reference = \"uri\";\n\t\t}\n\n\t\t//check for reference errors\n\t\tif (options.reference && options.reference !== \"suffix\" && options.reference !== components.reference) {\n\t\t\tcomponents.error = components.error || \"URI is not a \" + options.reference + \" reference.\";\n\t\t}\n\n\t\t//find scheme handler\n\t\tconst schemeHandler = SCHEMES[(options.scheme || components.scheme || \"\").toLowerCase()];\n\n\t\t//check if scheme can't handle IRIs\n\t\tif (!options.unicodeSupport && (!schemeHandler || !schemeHandler.unicodeSupport)) {\n\t\t\t//if host component is a domain name\n\t\t\tif (components.host && (options.domainHost || (schemeHandler && schemeHandler.domainHost))) {\n\t\t\t\t//convert Unicode IDN -> ASCII IDN\n\t\t\t\ttry {\n\t\t\t\t\tcomponents.host = punycode.toASCII(components.host.replace(protocol.PCT_ENCODED, pctDecChars).toLowerCase());\n\t\t\t\t} catch (e) {\n\t\t\t\t\tcomponents.error = components.error || \"Host's domain name can not be converted to ASCII via punycode: \" + e;\n\t\t\t\t}\n\t\t\t}\n\t\t\t//convert IRI -> URI\n\t\t\t_normalizeComponentEncoding(components, URI_PROTOCOL);\n\t\t} else {\n\t\t\t//normalize encodings\n\t\t\t_normalizeComponentEncoding(components, protocol);\n\t\t}\n\n\t\t//perform scheme specific parsing\n\t\tif (schemeHandler && schemeHandler.parse) {\n\t\t\tschemeHandler.parse(components, options);\n\t\t}\n\t} else {\n\t\tcomponents.error = components.error || \"URI can not be parsed.\";\n\t}\n\n\treturn components;\n};\n\nfunction _recomposeAuthority(components:URIComponents, options:URIOptions):string|undefined {\n\tconst protocol = (options.iri !== false ? IRI_PROTOCOL : URI_PROTOCOL);\n\tconst uriTokens:Array = [];\n\n\tif (components.userinfo !== undefined) {\n\t\turiTokens.push(components.userinfo);\n\t\turiTokens.push(\"@\");\n\t}\n\n\tif (components.host !== undefined) {\n\t\t//normalize IP hosts, add brackets and escape zone separator for IPv6\n\t\turiTokens.push(_normalizeIPv6(_normalizeIPv4(String(components.host), protocol), protocol).replace(protocol.IPV6ADDRESS, (_, $1, $2) => \"[\" + $1 + ($2 ? \"%25\" + $2 : \"\") + \"]\"));\n\t}\n\n\tif (typeof components.port === \"number\" || typeof components.port === \"string\") {\n\t\turiTokens.push(\":\");\n\t\turiTokens.push(String(components.port));\n\t}\n\n\treturn uriTokens.length ? uriTokens.join(\"\") : undefined;\n};\n\nconst RDS1 = /^\\.\\.?\\//;\nconst RDS2 = /^\\/\\.(\\/|$)/;\nconst RDS3 = /^\\/\\.\\.(\\/|$)/;\nconst RDS4 = /^\\.\\.?$/;\nconst RDS5 = /^\\/?(?:.|\\n)*?(?=\\/|$)/;\n\nexport function removeDotSegments(input:string):string {\n\tconst output:Array = [];\n\n\twhile (input.length) {\n\t\tif (input.match(RDS1)) {\n\t\t\tinput = input.replace(RDS1, \"\");\n\t\t} else if (input.match(RDS2)) {\n\t\t\tinput = input.replace(RDS2, \"/\");\n\t\t} else if (input.match(RDS3)) {\n\t\t\tinput = input.replace(RDS3, \"/\");\n\t\t\toutput.pop();\n\t\t} else if (input === \".\" || input === \"..\") {\n\t\t\tinput = \"\";\n\t\t} else {\n\t\t\tconst im = input.match(RDS5);\n\t\t\tif (im) {\n\t\t\t\tconst s = im[0];\n\t\t\t\tinput = input.slice(s.length);\n\t\t\t\toutput.push(s);\n\t\t\t} else {\n\t\t\t\tthrow new Error(\"Unexpected dot segment condition\");\n\t\t\t}\n\t\t}\n\t}\n\n\treturn output.join(\"\");\n};\n\nexport function serialize(components:URIComponents, options:URIOptions = {}):string {\n\tconst protocol = (options.iri ? IRI_PROTOCOL : URI_PROTOCOL);\n\tconst uriTokens:Array = [];\n\n\t//find scheme handler\n\tconst schemeHandler = SCHEMES[(options.scheme || components.scheme || \"\").toLowerCase()];\n\n\t//perform scheme specific serialization\n\tif (schemeHandler && schemeHandler.serialize) schemeHandler.serialize(components, options);\n\n\tif (components.host) {\n\t\t//if host component is an IPv6 address\n\t\tif (protocol.IPV6ADDRESS.test(components.host)) {\n\t\t\t//TODO: normalize IPv6 address as per RFC 5952\n\t\t}\n\n\t\t//if host component is a domain name\n\t\telse if (options.domainHost || (schemeHandler && schemeHandler.domainHost)) {\n\t\t\t//convert IDN via punycode\n\t\t\ttry {\n\t\t\t\tcomponents.host = (!options.iri ? punycode.toASCII(components.host.replace(protocol.PCT_ENCODED, pctDecChars).toLowerCase()) : punycode.toUnicode(components.host));\n\t\t\t} catch (e) {\n\t\t\t\tcomponents.error = components.error || \"Host's domain name can not be converted to \" + (!options.iri ? \"ASCII\" : \"Unicode\") + \" via punycode: \" + e;\n\t\t\t}\n\t\t}\n\t}\n\n\t//normalize encoding\n\t_normalizeComponentEncoding(components, protocol);\n\n\tif (options.reference !== \"suffix\" && components.scheme) {\n\t\turiTokens.push(components.scheme);\n\t\turiTokens.push(\":\");\n\t}\n\n\tconst authority = _recomposeAuthority(components, options);\n\tif (authority !== undefined) {\n\t\tif (options.reference !== \"suffix\") {\n\t\t\turiTokens.push(\"//\");\n\t\t}\n\n\t\turiTokens.push(authority);\n\n\t\tif (components.path && components.path.charAt(0) !== \"/\") {\n\t\t\turiTokens.push(\"/\");\n\t\t}\n\t}\n\n\tif (components.path !== undefined) {\n\t\tlet s = components.path;\n\n\t\tif (!options.absolutePath && (!schemeHandler || !schemeHandler.absolutePath)) {\n\t\t\ts = removeDotSegments(s);\n\t\t}\n\n\t\tif (authority === undefined) {\n\t\t\ts = s.replace(/^\\/\\//, \"/%2F\"); //don't allow the path to start with \"//\"\n\t\t}\n\n\t\turiTokens.push(s);\n\t}\n\n\tif (components.query !== undefined) {\n\t\turiTokens.push(\"?\");\n\t\turiTokens.push(components.query);\n\t}\n\n\tif (components.fragment !== undefined) {\n\t\turiTokens.push(\"#\");\n\t\turiTokens.push(components.fragment);\n\t}\n\n\treturn uriTokens.join(\"\"); //merge tokens into a string\n};\n\nexport function resolveComponents(base:URIComponents, relative:URIComponents, options:URIOptions = {}, skipNormalization?:boolean):URIComponents {\n\tconst target:URIComponents = {};\n\n\tif (!skipNormalization) {\n\t\tbase = parse(serialize(base, options), options); //normalize base components\n\t\trelative = parse(serialize(relative, options), options); //normalize relative components\n\t}\n\toptions = options || {};\n\n\tif (!options.tolerant && relative.scheme) {\n\t\ttarget.scheme = relative.scheme;\n\t\t//target.authority = relative.authority;\n\t\ttarget.userinfo = relative.userinfo;\n\t\ttarget.host = relative.host;\n\t\ttarget.port = relative.port;\n\t\ttarget.path = removeDotSegments(relative.path || \"\");\n\t\ttarget.query = relative.query;\n\t} else {\n\t\tif (relative.userinfo !== undefined || relative.host !== undefined || relative.port !== undefined) {\n\t\t\t//target.authority = relative.authority;\n\t\t\ttarget.userinfo = relative.userinfo;\n\t\t\ttarget.host = relative.host;\n\t\t\ttarget.port = relative.port;\n\t\t\ttarget.path = removeDotSegments(relative.path || \"\");\n\t\t\ttarget.query = relative.query;\n\t\t} else {\n\t\t\tif (!relative.path) {\n\t\t\t\ttarget.path = base.path;\n\t\t\t\tif (relative.query !== undefined) {\n\t\t\t\t\ttarget.query = relative.query;\n\t\t\t\t} else {\n\t\t\t\t\ttarget.query = base.query;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (relative.path.charAt(0) === \"/\") {\n\t\t\t\t\ttarget.path = removeDotSegments(relative.path);\n\t\t\t\t} else {\n\t\t\t\t\tif ((base.userinfo !== undefined || base.host !== undefined || base.port !== undefined) && !base.path) {\n\t\t\t\t\t\ttarget.path = \"/\" + relative.path;\n\t\t\t\t\t} else if (!base.path) {\n\t\t\t\t\t\ttarget.path = relative.path;\n\t\t\t\t\t} else {\n\t\t\t\t\t\ttarget.path = base.path.slice(0, base.path.lastIndexOf(\"/\") + 1) + relative.path;\n\t\t\t\t\t}\n\t\t\t\t\ttarget.path = removeDotSegments(target.path);\n\t\t\t\t}\n\t\t\t\ttarget.query = relative.query;\n\t\t\t}\n\t\t\t//target.authority = base.authority;\n\t\t\ttarget.userinfo = base.userinfo;\n\t\t\ttarget.host = base.host;\n\t\t\ttarget.port = base.port;\n\t\t}\n\t\ttarget.scheme = base.scheme;\n\t}\n\n\ttarget.fragment = relative.fragment;\n\n\treturn target;\n};\n\nexport function resolve(baseURI:string, relativeURI:string, options?:URIOptions):string {\n\tconst schemelessOptions = assign({ scheme : 'null' }, options);\n\treturn serialize(resolveComponents(parse(baseURI, schemelessOptions), parse(relativeURI, schemelessOptions), schemelessOptions, true), schemelessOptions);\n};\n\nexport function normalize(uri:string, options?:URIOptions):string;\nexport function normalize(uri:URIComponents, options?:URIOptions):URIComponents;\nexport function normalize(uri:any, options?:URIOptions):any {\n\tif (typeof uri === \"string\") {\n\t\turi = serialize(parse(uri, options), options);\n\t} else if (typeOf(uri) === \"object\") {\n\t\turi = parse(serialize(uri, options), options);\n\t}\n\n\treturn uri;\n};\n\nexport function equal(uriA:string, uriB:string, options?: URIOptions):boolean;\nexport function equal(uriA:URIComponents, uriB:URIComponents, options?:URIOptions):boolean;\nexport function equal(uriA:any, uriB:any, options?:URIOptions):boolean {\n\tif (typeof uriA === \"string\") {\n\t\turiA = serialize(parse(uriA, options), options);\n\t} else if (typeOf(uriA) === \"object\") {\n\t\turiA = serialize(uriA, options);\n\t}\n\n\tif (typeof uriB === \"string\") {\n\t\turiB = serialize(parse(uriB, options), options);\n\t} else if (typeOf(uriB) === \"object\") {\n\t\turiB = serialize(uriB, options);\n\t}\n\n\treturn uriA === uriB;\n};\n\nexport function escapeComponent(str:string, options?:URIOptions):string {\n\treturn str && str.toString().replace((!options || !options.iri ? URI_PROTOCOL.ESCAPE : IRI_PROTOCOL.ESCAPE), pctEncChar);\n};\n\nexport function unescapeComponent(str:string, options?:URIOptions):string {\n\treturn str && str.toString().replace((!options || !options.iri ? URI_PROTOCOL.PCT_ENCODED : IRI_PROTOCOL.PCT_ENCODED), pctDecChars);\n};\n","'use strict';\n\n/** Highest positive signed 32-bit float value */\nconst maxInt = 2147483647; // aka. 0x7FFFFFFF or 2^31-1\n\n/** Bootstring parameters */\nconst base = 36;\nconst tMin = 1;\nconst tMax = 26;\nconst skew = 38;\nconst damp = 700;\nconst initialBias = 72;\nconst initialN = 128; // 0x80\nconst delimiter = '-'; // '\\x2D'\n\n/** Regular expressions */\nconst regexPunycode = /^xn--/;\nconst regexNonASCII = /[^\\0-\\x7E]/; // non-ASCII chars\nconst regexSeparators = /[\\x2E\\u3002\\uFF0E\\uFF61]/g; // RFC 3490 separators\n\n/** Error messages */\nconst errors = {\n\t'overflow': 'Overflow: input needs wider integers to process',\n\t'not-basic': 'Illegal input >= 0x80 (not a basic code point)',\n\t'invalid-input': 'Invalid input'\n};\n\n/** Convenience shortcuts */\nconst baseMinusTMin = base - tMin;\nconst floor = Math.floor;\nconst stringFromCharCode = String.fromCharCode;\n\n/*--------------------------------------------------------------------------*/\n\n/**\n * A generic error utility function.\n * @private\n * @param {String} type The error type.\n * @returns {Error} Throws a `RangeError` with the applicable error message.\n */\nfunction error(type) {\n\tthrow new RangeError(errors[type]);\n}\n\n/**\n * A generic `Array#map` utility function.\n * @private\n * @param {Array} array The array to iterate over.\n * @param {Function} callback The function that gets called for every array\n * item.\n * @returns {Array} A new array of values returned by the callback function.\n */\nfunction map(array, fn) {\n\tconst result = [];\n\tlet length = array.length;\n\twhile (length--) {\n\t\tresult[length] = fn(array[length]);\n\t}\n\treturn result;\n}\n\n/**\n * A simple `Array#map`-like wrapper to work with domain name strings or email\n * addresses.\n * @private\n * @param {String} domain The domain name or email address.\n * @param {Function} callback The function that gets called for every\n * character.\n * @returns {Array} A new string of characters returned by the callback\n * function.\n */\nfunction mapDomain(string, fn) {\n\tconst parts = string.split('@');\n\tlet result = '';\n\tif (parts.length > 1) {\n\t\t// In email addresses, only the domain name should be punycoded. Leave\n\t\t// the local part (i.e. everything up to `@`) intact.\n\t\tresult = parts[0] + '@';\n\t\tstring = parts[1];\n\t}\n\t// Avoid `split(regex)` for IE8 compatibility. See #17.\n\tstring = string.replace(regexSeparators, '\\x2E');\n\tconst labels = string.split('.');\n\tconst encoded = map(labels, fn).join('.');\n\treturn result + encoded;\n}\n\n/**\n * Creates an array containing the numeric code points of each Unicode\n * character in the string. While JavaScript uses UCS-2 internally,\n * this function will convert a pair of surrogate halves (each of which\n * UCS-2 exposes as separate characters) into a single code point,\n * matching UTF-16.\n * @see `punycode.ucs2.encode`\n * @see \n * @memberOf punycode.ucs2\n * @name decode\n * @param {String} string The Unicode input string (UCS-2).\n * @returns {Array} The new array of code points.\n */\nfunction ucs2decode(string) {\n\tconst output = [];\n\tlet counter = 0;\n\tconst length = string.length;\n\twhile (counter < length) {\n\t\tconst value = string.charCodeAt(counter++);\n\t\tif (value >= 0xD800 && value <= 0xDBFF && counter < length) {\n\t\t\t// It's a high surrogate, and there is a next character.\n\t\t\tconst extra = string.charCodeAt(counter++);\n\t\t\tif ((extra & 0xFC00) == 0xDC00) { // Low surrogate.\n\t\t\t\toutput.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000);\n\t\t\t} else {\n\t\t\t\t// It's an unmatched surrogate; only append this code unit, in case the\n\t\t\t\t// next code unit is the high surrogate of a surrogate pair.\n\t\t\t\toutput.push(value);\n\t\t\t\tcounter--;\n\t\t\t}\n\t\t} else {\n\t\t\toutput.push(value);\n\t\t}\n\t}\n\treturn output;\n}\n\n/**\n * Creates a string based on an array of numeric code points.\n * @see `punycode.ucs2.decode`\n * @memberOf punycode.ucs2\n * @name encode\n * @param {Array} codePoints The array of numeric code points.\n * @returns {String} The new Unicode string (UCS-2).\n */\nconst ucs2encode = array => String.fromCodePoint(...array);\n\n/**\n * Converts a basic code point into a digit/integer.\n * @see `digitToBasic()`\n * @private\n * @param {Number} codePoint The basic numeric code point value.\n * @returns {Number} The numeric value of a basic code point (for use in\n * representing integers) in the range `0` to `base - 1`, or `base` if\n * the code point does not represent a value.\n */\nconst basicToDigit = function(codePoint) {\n\tif (codePoint - 0x30 < 0x0A) {\n\t\treturn codePoint - 0x16;\n\t}\n\tif (codePoint - 0x41 < 0x1A) {\n\t\treturn codePoint - 0x41;\n\t}\n\tif (codePoint - 0x61 < 0x1A) {\n\t\treturn codePoint - 0x61;\n\t}\n\treturn base;\n};\n\n/**\n * Converts a digit/integer into a basic code point.\n * @see `basicToDigit()`\n * @private\n * @param {Number} digit The numeric value of a basic code point.\n * @returns {Number} The basic code point whose value (when used for\n * representing integers) is `digit`, which needs to be in the range\n * `0` to `base - 1`. If `flag` is non-zero, the uppercase form is\n * used; else, the lowercase form is used. The behavior is undefined\n * if `flag` is non-zero and `digit` has no uppercase form.\n */\nconst digitToBasic = function(digit, flag) {\n\t// 0..25 map to ASCII a..z or A..Z\n\t// 26..35 map to ASCII 0..9\n\treturn digit + 22 + 75 * (digit < 26) - ((flag != 0) << 5);\n};\n\n/**\n * Bias adaptation function as per section 3.4 of RFC 3492.\n * https://tools.ietf.org/html/rfc3492#section-3.4\n * @private\n */\nconst adapt = function(delta, numPoints, firstTime) {\n\tlet k = 0;\n\tdelta = firstTime ? floor(delta / damp) : delta >> 1;\n\tdelta += floor(delta / numPoints);\n\tfor (/* no initialization */; delta > baseMinusTMin * tMax >> 1; k += base) {\n\t\tdelta = floor(delta / baseMinusTMin);\n\t}\n\treturn floor(k + (baseMinusTMin + 1) * delta / (delta + skew));\n};\n\n/**\n * Converts a Punycode string of ASCII-only symbols to a string of Unicode\n * symbols.\n * @memberOf punycode\n * @param {String} input The Punycode string of ASCII-only symbols.\n * @returns {String} The resulting string of Unicode symbols.\n */\nconst decode = function(input) {\n\t// Don't use UCS-2.\n\tconst output = [];\n\tconst inputLength = input.length;\n\tlet i = 0;\n\tlet n = initialN;\n\tlet bias = initialBias;\n\n\t// Handle the basic code points: let `basic` be the number of input code\n\t// points before the last delimiter, or `0` if there is none, then copy\n\t// the first basic code points to the output.\n\n\tlet basic = input.lastIndexOf(delimiter);\n\tif (basic < 0) {\n\t\tbasic = 0;\n\t}\n\n\tfor (let j = 0; j < basic; ++j) {\n\t\t// if it's not a basic code point\n\t\tif (input.charCodeAt(j) >= 0x80) {\n\t\t\terror('not-basic');\n\t\t}\n\t\toutput.push(input.charCodeAt(j));\n\t}\n\n\t// Main decoding loop: start just after the last delimiter if any basic code\n\t// points were copied; start at the beginning otherwise.\n\n\tfor (let index = basic > 0 ? basic + 1 : 0; index < inputLength; /* no final expression */) {\n\n\t\t// `index` is the index of the next character to be consumed.\n\t\t// Decode a generalized variable-length integer into `delta`,\n\t\t// which gets added to `i`. The overflow checking is easier\n\t\t// if we increase `i` as we go, then subtract off its starting\n\t\t// value at the end to obtain `delta`.\n\t\tlet oldi = i;\n\t\tfor (let w = 1, k = base; /* no condition */; k += base) {\n\n\t\t\tif (index >= inputLength) {\n\t\t\t\terror('invalid-input');\n\t\t\t}\n\n\t\t\tconst digit = basicToDigit(input.charCodeAt(index++));\n\n\t\t\tif (digit >= base || digit > floor((maxInt - i) / w)) {\n\t\t\t\terror('overflow');\n\t\t\t}\n\n\t\t\ti += digit * w;\n\t\t\tconst t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias);\n\n\t\t\tif (digit < t) {\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tconst baseMinusT = base - t;\n\t\t\tif (w > floor(maxInt / baseMinusT)) {\n\t\t\t\terror('overflow');\n\t\t\t}\n\n\t\t\tw *= baseMinusT;\n\n\t\t}\n\n\t\tconst out = output.length + 1;\n\t\tbias = adapt(i - oldi, out, oldi == 0);\n\n\t\t// `i` was supposed to wrap around from `out` to `0`,\n\t\t// incrementing `n` each time, so we'll fix that now:\n\t\tif (floor(i / out) > maxInt - n) {\n\t\t\terror('overflow');\n\t\t}\n\n\t\tn += floor(i / out);\n\t\ti %= out;\n\n\t\t// Insert `n` at position `i` of the output.\n\t\toutput.splice(i++, 0, n);\n\n\t}\n\n\treturn String.fromCodePoint(...output);\n};\n\n/**\n * Converts a string of Unicode symbols (e.g. a domain name label) to a\n * Punycode string of ASCII-only symbols.\n * @memberOf punycode\n * @param {String} input The string of Unicode symbols.\n * @returns {String} The resulting Punycode string of ASCII-only symbols.\n */\nconst encode = function(input) {\n\tconst output = [];\n\n\t// Convert the input in UCS-2 to an array of Unicode code points.\n\tinput = ucs2decode(input);\n\n\t// Cache the length.\n\tlet inputLength = input.length;\n\n\t// Initialize the state.\n\tlet n = initialN;\n\tlet delta = 0;\n\tlet bias = initialBias;\n\n\t// Handle the basic code points.\n\tfor (const currentValue of input) {\n\t\tif (currentValue < 0x80) {\n\t\t\toutput.push(stringFromCharCode(currentValue));\n\t\t}\n\t}\n\n\tlet basicLength = output.length;\n\tlet handledCPCount = basicLength;\n\n\t// `handledCPCount` is the number of code points that have been handled;\n\t// `basicLength` is the number of basic code points.\n\n\t// Finish the basic string with a delimiter unless it's empty.\n\tif (basicLength) {\n\t\toutput.push(delimiter);\n\t}\n\n\t// Main encoding loop:\n\twhile (handledCPCount < inputLength) {\n\n\t\t// All non-basic code points < n have been handled already. Find the next\n\t\t// larger one:\n\t\tlet m = maxInt;\n\t\tfor (const currentValue of input) {\n\t\t\tif (currentValue >= n && currentValue < m) {\n\t\t\t\tm = currentValue;\n\t\t\t}\n\t\t}\n\n\t\t// Increase `delta` enough to advance the decoder's state to ,\n\t\t// but guard against overflow.\n\t\tconst handledCPCountPlusOne = handledCPCount + 1;\n\t\tif (m - n > floor((maxInt - delta) / handledCPCountPlusOne)) {\n\t\t\terror('overflow');\n\t\t}\n\n\t\tdelta += (m - n) * handledCPCountPlusOne;\n\t\tn = m;\n\n\t\tfor (const currentValue of input) {\n\t\t\tif (currentValue < n && ++delta > maxInt) {\n\t\t\t\terror('overflow');\n\t\t\t}\n\t\t\tif (currentValue == n) {\n\t\t\t\t// Represent delta as a generalized variable-length integer.\n\t\t\t\tlet q = delta;\n\t\t\t\tfor (let k = base; /* no condition */; k += base) {\n\t\t\t\t\tconst t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias);\n\t\t\t\t\tif (q < t) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tconst qMinusT = q - t;\n\t\t\t\t\tconst baseMinusT = base - t;\n\t\t\t\t\toutput.push(\n\t\t\t\t\t\tstringFromCharCode(digitToBasic(t + qMinusT % baseMinusT, 0))\n\t\t\t\t\t);\n\t\t\t\t\tq = floor(qMinusT / baseMinusT);\n\t\t\t\t}\n\n\t\t\t\toutput.push(stringFromCharCode(digitToBasic(q, 0)));\n\t\t\t\tbias = adapt(delta, handledCPCountPlusOne, handledCPCount == basicLength);\n\t\t\t\tdelta = 0;\n\t\t\t\t++handledCPCount;\n\t\t\t}\n\t\t}\n\n\t\t++delta;\n\t\t++n;\n\n\t}\n\treturn output.join('');\n};\n\n/**\n * Converts a Punycode string representing a domain name or an email address\n * to Unicode. Only the Punycoded parts of the input will be converted, i.e.\n * it doesn't matter if you call it on a string that has already been\n * converted to Unicode.\n * @memberOf punycode\n * @param {String} input The Punycoded domain name or email address to\n * convert to Unicode.\n * @returns {String} The Unicode representation of the given Punycode\n * string.\n */\nconst toUnicode = function(input) {\n\treturn mapDomain(input, function(string) {\n\t\treturn regexPunycode.test(string)\n\t\t\t? decode(string.slice(4).toLowerCase())\n\t\t\t: string;\n\t});\n};\n\n/**\n * Converts a Unicode string representing a domain name or an email address to\n * Punycode. Only the non-ASCII parts of the domain name will be converted,\n * i.e. it doesn't matter if you call it with a domain that's already in\n * ASCII.\n * @memberOf punycode\n * @param {String} input The domain name or email address to convert, as a\n * Unicode string.\n * @returns {String} The Punycode representation of the given domain name or\n * email address.\n */\nconst toASCII = function(input) {\n\treturn mapDomain(input, function(string) {\n\t\treturn regexNonASCII.test(string)\n\t\t\t? 'xn--' + encode(string)\n\t\t\t: string;\n\t});\n};\n\n/*--------------------------------------------------------------------------*/\n\n/** Define the public API */\nconst punycode = {\n\t/**\n\t * A string representing the current Punycode.js version number.\n\t * @memberOf punycode\n\t * @type String\n\t */\n\t'version': '2.1.0',\n\t/**\n\t * An object of methods to convert from JavaScript's internal character\n\t * representation (UCS-2) to Unicode code points, and back.\n\t * @see \n\t * @memberOf punycode\n\t * @type Object\n\t */\n\t'ucs2': {\n\t\t'decode': ucs2decode,\n\t\t'encode': ucs2encode\n\t},\n\t'decode': decode,\n\t'encode': encode,\n\t'toASCII': toASCII,\n\t'toUnicode': toUnicode\n};\n\nexport default punycode;\n","import { URIRegExps } from \"./uri\";\nimport { buildExps } from \"./regexps-uri\";\n\nexport default buildExps(true);\n","import { URIRegExps } from \"./uri\";\nimport { merge, subexp } from \"./util\";\n\nexport function buildExps(isIRI:boolean):URIRegExps {\n\tconst\n\t\tALPHA$$ = \"[A-Za-z]\",\n\t\tCR$ = \"[\\\\x0D]\",\n\t\tDIGIT$$ = \"[0-9]\",\n\t\tDQUOTE$$ = \"[\\\\x22]\",\n\t\tHEXDIG$$ = merge(DIGIT$$, \"[A-Fa-f]\"), //case-insensitive\n\t\tLF$$ = \"[\\\\x0A]\",\n\t\tSP$$ = \"[\\\\x20]\",\n\t\tPCT_ENCODED$ = subexp(subexp(\"%[EFef]\" + HEXDIG$$ + \"%\" + HEXDIG$$ + HEXDIG$$ + \"%\" + HEXDIG$$ + HEXDIG$$) + \"|\" + subexp(\"%[89A-Fa-f]\" + HEXDIG$$ + \"%\" + HEXDIG$$ + HEXDIG$$) + \"|\" + subexp(\"%\" + HEXDIG$$ + HEXDIG$$)), //expanded\n\t\tGEN_DELIMS$$ = \"[\\\\:\\\\/\\\\?\\\\#\\\\[\\\\]\\\\@]\",\n\t\tSUB_DELIMS$$ = \"[\\\\!\\\\$\\\\&\\\\'\\\\(\\\\)\\\\*\\\\+\\\\,\\\\;\\\\=]\",\n\t\tRESERVED$$ = merge(GEN_DELIMS$$, SUB_DELIMS$$),\n\t\tUCSCHAR$$ = isIRI ? \"[\\\\xA0-\\\\u200D\\\\u2010-\\\\u2029\\\\u202F-\\\\uD7FF\\\\uF900-\\\\uFDCF\\\\uFDF0-\\\\uFFEF]\" : \"[]\", //subset, excludes bidi control characters\n\t\tIPRIVATE$$ = isIRI ? \"[\\\\uE000-\\\\uF8FF]\" : \"[]\", //subset\n\t\tUNRESERVED$$ = merge(ALPHA$$, DIGIT$$, \"[\\\\-\\\\.\\\\_\\\\~]\", UCSCHAR$$),\n\t\tSCHEME$ = subexp(ALPHA$$ + merge(ALPHA$$, DIGIT$$, \"[\\\\+\\\\-\\\\.]\") + \"*\"),\n\t\tUSERINFO$ = subexp(subexp(PCT_ENCODED$ + \"|\" + merge(UNRESERVED$$, SUB_DELIMS$$, \"[\\\\:]\")) + \"*\"),\n\t\tDEC_OCTET$ = subexp(subexp(\"25[0-5]\") + \"|\" + subexp(\"2[0-4]\" + DIGIT$$) + \"|\" + subexp(\"1\" + DIGIT$$ + DIGIT$$) + \"|\" + subexp(\"[1-9]\" + DIGIT$$) + \"|\" + DIGIT$$),\n\t\tDEC_OCTET_RELAXED$ = subexp(subexp(\"25[0-5]\") + \"|\" + subexp(\"2[0-4]\" + DIGIT$$) + \"|\" + subexp(\"1\" + DIGIT$$ + DIGIT$$) + \"|\" + subexp(\"0?[1-9]\" + DIGIT$$) + \"|0?0?\" + DIGIT$$), //relaxed parsing rules\n\t\tIPV4ADDRESS$ = subexp(DEC_OCTET_RELAXED$ + \"\\\\.\" + DEC_OCTET_RELAXED$ + \"\\\\.\" + DEC_OCTET_RELAXED$ + \"\\\\.\" + DEC_OCTET_RELAXED$),\n\t\tH16$ = subexp(HEXDIG$$ + \"{1,4}\"),\n\t\tLS32$ = subexp(subexp(H16$ + \"\\\\:\" + H16$) + \"|\" + IPV4ADDRESS$),\n\t\tIPV6ADDRESS1$ = subexp( subexp(H16$ + \"\\\\:\") + \"{6}\" + LS32$), // 6( h16 \":\" ) ls32\n\t\tIPV6ADDRESS2$ = subexp( \"\\\\:\\\\:\" + subexp(H16$ + \"\\\\:\") + \"{5}\" + LS32$), // \"::\" 5( h16 \":\" ) ls32\n\t\tIPV6ADDRESS3$ = subexp(subexp( H16$) + \"?\\\\:\\\\:\" + subexp(H16$ + \"\\\\:\") + \"{4}\" + LS32$), //[ h16 ] \"::\" 4( h16 \":\" ) ls32\n\t\tIPV6ADDRESS4$ = subexp(subexp(subexp(H16$ + \"\\\\:\") + \"{0,1}\" + H16$) + \"?\\\\:\\\\:\" + subexp(H16$ + \"\\\\:\") + \"{3}\" + LS32$), //[ *1( h16 \":\" ) h16 ] \"::\" 3( h16 \":\" ) ls32\n\t\tIPV6ADDRESS5$ = subexp(subexp(subexp(H16$ + \"\\\\:\") + \"{0,2}\" + H16$) + \"?\\\\:\\\\:\" + subexp(H16$ + \"\\\\:\") + \"{2}\" + LS32$), //[ *2( h16 \":\" ) h16 ] \"::\" 2( h16 \":\" ) ls32\n\t\tIPV6ADDRESS6$ = subexp(subexp(subexp(H16$ + \"\\\\:\") + \"{0,3}\" + H16$) + \"?\\\\:\\\\:\" + H16$ + \"\\\\:\" + LS32$), //[ *3( h16 \":\" ) h16 ] \"::\" h16 \":\" ls32\n\t\tIPV6ADDRESS7$ = subexp(subexp(subexp(H16$ + \"\\\\:\") + \"{0,4}\" + H16$) + \"?\\\\:\\\\:\" + LS32$), //[ *4( h16 \":\" ) h16 ] \"::\" ls32\n\t\tIPV6ADDRESS8$ = subexp(subexp(subexp(H16$ + \"\\\\:\") + \"{0,5}\" + H16$) + \"?\\\\:\\\\:\" + H16$ ), //[ *5( h16 \":\" ) h16 ] \"::\" h16\n\t\tIPV6ADDRESS9$ = subexp(subexp(subexp(H16$ + \"\\\\:\") + \"{0,6}\" + H16$) + \"?\\\\:\\\\:\" ), //[ *6( h16 \":\" ) h16 ] \"::\"\n\t\tIPV6ADDRESS$ = subexp([IPV6ADDRESS1$, IPV6ADDRESS2$, IPV6ADDRESS3$, IPV6ADDRESS4$, IPV6ADDRESS5$, IPV6ADDRESS6$, IPV6ADDRESS7$, IPV6ADDRESS8$, IPV6ADDRESS9$].join(\"|\")),\n\t\tZONEID$ = subexp(subexp(UNRESERVED$$ + \"|\" + PCT_ENCODED$) + \"+\"), //RFC 6874\n\t\tIPV6ADDRZ$ = subexp(IPV6ADDRESS$ + \"\\\\%25\" + ZONEID$), //RFC 6874\n\t\tIPV6ADDRZ_RELAXED$ = subexp(IPV6ADDRESS$ + subexp(\"\\\\%25|\\\\%(?!\" + HEXDIG$$ + \"{2})\") + ZONEID$), //RFC 6874, with relaxed parsing rules\n\t\tIPVFUTURE$ = subexp(\"[vV]\" + HEXDIG$$ + \"+\\\\.\" + merge(UNRESERVED$$, SUB_DELIMS$$, \"[\\\\:]\") + \"+\"),\n\t\tIP_LITERAL$ = subexp(\"\\\\[\" + subexp(IPV6ADDRZ_RELAXED$ + \"|\" + IPV6ADDRESS$ + \"|\" + IPVFUTURE$) + \"\\\\]\"), //RFC 6874\n\t\tREG_NAME$ = subexp(subexp(PCT_ENCODED$ + \"|\" + merge(UNRESERVED$$, SUB_DELIMS$$)) + \"*\"),\n\t\tHOST$ = subexp(IP_LITERAL$ + \"|\" + IPV4ADDRESS$ + \"(?!\" + REG_NAME$ + \")\" + \"|\" + REG_NAME$),\n\t\tPORT$ = subexp(DIGIT$$ + \"*\"),\n\t\tAUTHORITY$ = subexp(subexp(USERINFO$ + \"@\") + \"?\" + HOST$ + subexp(\"\\\\:\" + PORT$) + \"?\"),\n\t\tPCHAR$ = subexp(PCT_ENCODED$ + \"|\" + merge(UNRESERVED$$, SUB_DELIMS$$, \"[\\\\:\\\\@]\")),\n\t\tSEGMENT$ = subexp(PCHAR$ + \"*\"),\n\t\tSEGMENT_NZ$ = subexp(PCHAR$ + \"+\"),\n\t\tSEGMENT_NZ_NC$ = subexp(subexp(PCT_ENCODED$ + \"|\" + merge(UNRESERVED$$, SUB_DELIMS$$, \"[\\\\@]\")) + \"+\"),\n\t\tPATH_ABEMPTY$ = subexp(subexp(\"\\\\/\" + SEGMENT$) + \"*\"),\n\t\tPATH_ABSOLUTE$ = subexp(\"\\\\/\" + subexp(SEGMENT_NZ$ + PATH_ABEMPTY$) + \"?\"), //simplified\n\t\tPATH_NOSCHEME$ = subexp(SEGMENT_NZ_NC$ + PATH_ABEMPTY$), //simplified\n\t\tPATH_ROOTLESS$ = subexp(SEGMENT_NZ$ + PATH_ABEMPTY$), //simplified\n\t\tPATH_EMPTY$ = \"(?!\" + PCHAR$ + \")\",\n\t\tPATH$ = subexp(PATH_ABEMPTY$ + \"|\" + PATH_ABSOLUTE$ + \"|\" + PATH_NOSCHEME$ + \"|\" + PATH_ROOTLESS$ + \"|\" + PATH_EMPTY$),\n\t\tQUERY$ = subexp(subexp(PCHAR$ + \"|\" + merge(\"[\\\\/\\\\?]\", IPRIVATE$$)) + \"*\"),\n\t\tFRAGMENT$ = subexp(subexp(PCHAR$ + \"|[\\\\/\\\\?]\") + \"*\"),\n\t\tHIER_PART$ = subexp(subexp(\"\\\\/\\\\/\" + AUTHORITY$ + PATH_ABEMPTY$) + \"|\" + PATH_ABSOLUTE$ + \"|\" + PATH_ROOTLESS$ + \"|\" + PATH_EMPTY$),\n\t\tURI$ = subexp(SCHEME$ + \"\\\\:\" + HIER_PART$ + subexp(\"\\\\?\" + QUERY$) + \"?\" + subexp(\"\\\\#\" + FRAGMENT$) + \"?\"),\n\t\tRELATIVE_PART$ = subexp(subexp(\"\\\\/\\\\/\" + AUTHORITY$ + PATH_ABEMPTY$) + \"|\" + PATH_ABSOLUTE$ + \"|\" + PATH_NOSCHEME$ + \"|\" + PATH_EMPTY$),\n\t\tRELATIVE$ = subexp(RELATIVE_PART$ + subexp(\"\\\\?\" + QUERY$) + \"?\" + subexp(\"\\\\#\" + FRAGMENT$) + \"?\"),\n\t\tURI_REFERENCE$ = subexp(URI$ + \"|\" + RELATIVE$),\n\t\tABSOLUTE_URI$ = subexp(SCHEME$ + \"\\\\:\" + HIER_PART$ + subexp(\"\\\\?\" + QUERY$) + \"?\"),\n\n\t\tGENERIC_REF$ = \"^(\" + SCHEME$ + \")\\\\:\" + subexp(subexp(\"\\\\/\\\\/(\" + subexp(\"(\" + USERINFO$ + \")@\") + \"?(\" + HOST$ + \")\" + subexp(\"\\\\:(\" + PORT$ + \")\") + \"?)\") + \"?(\" + PATH_ABEMPTY$ + \"|\" + PATH_ABSOLUTE$ + \"|\" + PATH_ROOTLESS$ + \"|\" + PATH_EMPTY$ + \")\") + subexp(\"\\\\?(\" + QUERY$ + \")\") + \"?\" + subexp(\"\\\\#(\" + FRAGMENT$ + \")\") + \"?$\",\n\t\tRELATIVE_REF$ = \"^(){0}\" + subexp(subexp(\"\\\\/\\\\/(\" + subexp(\"(\" + USERINFO$ + \")@\") + \"?(\" + HOST$ + \")\" + subexp(\"\\\\:(\" + PORT$ + \")\") + \"?)\") + \"?(\" + PATH_ABEMPTY$ + \"|\" + PATH_ABSOLUTE$ + \"|\" + PATH_NOSCHEME$ + \"|\" + PATH_EMPTY$ + \")\") + subexp(\"\\\\?(\" + QUERY$ + \")\") + \"?\" + subexp(\"\\\\#(\" + FRAGMENT$ + \")\") + \"?$\",\n\t\tABSOLUTE_REF$ = \"^(\" + SCHEME$ + \")\\\\:\" + subexp(subexp(\"\\\\/\\\\/(\" + subexp(\"(\" + USERINFO$ + \")@\") + \"?(\" + HOST$ + \")\" + subexp(\"\\\\:(\" + PORT$ + \")\") + \"?)\") + \"?(\" + PATH_ABEMPTY$ + \"|\" + PATH_ABSOLUTE$ + \"|\" + PATH_ROOTLESS$ + \"|\" + PATH_EMPTY$ + \")\") + subexp(\"\\\\?(\" + QUERY$ + \")\") + \"?$\",\n\t\tSAMEDOC_REF$ = \"^\" + subexp(\"\\\\#(\" + FRAGMENT$ + \")\") + \"?$\",\n\t\tAUTHORITY_REF$ = \"^\" + subexp(\"(\" + USERINFO$ + \")@\") + \"?(\" + HOST$ + \")\" + subexp(\"\\\\:(\" + PORT$ + \")\") + \"?$\"\n\t;\n\n\treturn {\n\t\tNOT_SCHEME : new RegExp(merge(\"[^]\", ALPHA$$, DIGIT$$, \"[\\\\+\\\\-\\\\.]\"), \"g\"),\n\t\tNOT_USERINFO : new RegExp(merge(\"[^\\\\%\\\\:]\", UNRESERVED$$, SUB_DELIMS$$), \"g\"),\n\t\tNOT_HOST : new RegExp(merge(\"[^\\\\%\\\\[\\\\]\\\\:]\", UNRESERVED$$, SUB_DELIMS$$), \"g\"),\n\t\tNOT_PATH : new RegExp(merge(\"[^\\\\%\\\\/\\\\:\\\\@]\", UNRESERVED$$, SUB_DELIMS$$), \"g\"),\n\t\tNOT_PATH_NOSCHEME : new RegExp(merge(\"[^\\\\%\\\\/\\\\@]\", UNRESERVED$$, SUB_DELIMS$$), \"g\"),\n\t\tNOT_QUERY : new RegExp(merge(\"[^\\\\%]\", UNRESERVED$$, SUB_DELIMS$$, \"[\\\\:\\\\@\\\\/\\\\?]\", IPRIVATE$$), \"g\"),\n\t\tNOT_FRAGMENT : new RegExp(merge(\"[^\\\\%]\", UNRESERVED$$, SUB_DELIMS$$, \"[\\\\:\\\\@\\\\/\\\\?]\"), \"g\"),\n\t\tESCAPE : new RegExp(merge(\"[^]\", UNRESERVED$$, SUB_DELIMS$$), \"g\"),\n\t\tUNRESERVED : new RegExp(UNRESERVED$$, \"g\"),\n\t\tOTHER_CHARS : new RegExp(merge(\"[^\\\\%]\", UNRESERVED$$, RESERVED$$), \"g\"),\n\t\tPCT_ENCODED : new RegExp(PCT_ENCODED$, \"g\"),\n\t\tIPV4ADDRESS : new RegExp(\"^(\" + IPV4ADDRESS$ + \")$\"),\n\t\tIPV6ADDRESS : new RegExp(\"^\\\\[?(\" + IPV6ADDRESS$ + \")\" + subexp(subexp(\"\\\\%25|\\\\%(?!\" + HEXDIG$$ + \"{2})\") + \"(\" + ZONEID$ + \")\") + \"?\\\\]?$\") //RFC 6874, with relaxed parsing rules\n\t};\n}\n\nexport default buildExps(false);\n","export function merge(...sets:Array):string {\n\tif (sets.length > 1) {\n\t\tsets[0] = sets[0].slice(0, -1);\n\t\tconst xl = sets.length - 1;\n\t\tfor (let x = 1; x < xl; ++x) {\n\t\t\tsets[x] = sets[x].slice(1, -1);\n\t\t}\n\t\tsets[xl] = sets[xl].slice(1);\n\t\treturn sets.join('');\n\t} else {\n\t\treturn sets[0];\n\t}\n}\n\nexport function subexp(str:string):string {\n\treturn \"(?:\" + str + \")\";\n}\n\nexport function typeOf(o:any):string {\n\treturn o === undefined ? \"undefined\" : (o === null ? \"null\" : Object.prototype.toString.call(o).split(\" \").pop().split(\"]\").shift().toLowerCase());\n}\n\nexport function toUpperCase(str:string):string {\n\treturn str.toUpperCase();\n}\n\nexport function toArray(obj:any):Array {\n\treturn obj !== undefined && obj !== null ? (obj instanceof Array ? obj : (typeof obj.length !== \"number\" || obj.split || obj.setInterval || obj.call ? [obj] : Array.prototype.slice.call(obj))) : [];\n}\n\n\nexport function assign(target: object, source: any): any {\n\tconst obj = target as any;\n\tif (source) {\n\t\tfor (const key in source) {\n\t\t\tobj[key] = source[key];\n\t\t}\n\t}\n\treturn obj;\n}"],"names":["SCHEMES","uuid","scheme","urn","mailto","wss","ws","https","http","urnComponents","nss","uuidComponents","toLowerCase","options","error","tolerant","match","UUID","undefined","handler","uriComponents","path","nid","schemeHandler","serialize","urnScheme","parse","matches","components","URN_PARSE","query","fields","join","length","push","name","replace","PCT_ENCODED","decodeUnreserved","toUpperCase","NOT_HFNAME","pctEncChar","headers","NOT_HFVALUE","O","mailtoComponents","body","subject","to","x","localPart","domain","iri","e","punycode","toASCII","unescapeComponent","toUnicode","toAddr","slice","atIdx","NOT_LOCAL_PART","lastIndexOf","String","xl","toArray","addr","unicodeSupport","split","unknownHeaders","hfield","toAddrs","hfields","decStr","UNRESERVED","str","pctDecChars","RegExp","merge","UNRESERVED$$","SOME_DELIMS$$","ATEXT$$","VCHAR$$","PCT_ENCODED$","QTEXT$$","subexp","HEXDIG$$","isIRI","domainHost","wsComponents","fragment","resourceName","secure","port","isSecure","host","toString","URI_PROTOCOL","IRI_PROTOCOL","ESCAPE","escapeComponent","uriA","uriB","typeOf","equal","uri","normalize","resolveComponents","baseURI","schemelessOptions","relativeURI","assign","resolve","target","relative","base","userinfo","removeDotSegments","charAt","skipNormalization","uriTokens","s","authority","absolutePath","reference","_recomposeAuthority","protocol","IPV6ADDRESS","test","output","Error","input","im","RDS5","pop","RDS3","RDS2","RDS1","$1","$2","_normalizeIPv6","_normalizeIPv4","_","uriString","isNaN","indexOf","parseInt","NO_MATCH_IS_UNDEFINED","URI_PARSE","newHost","zone","newFirst","newLast","longestZeroFields","index","b","a","allZeroFields","sort","acc","lastLongest","field","reduce","fieldCount","isLastFieldIPv4Address","firstFields","lastFields","lastFieldsStart","Array","IPV4ADDRESS","last","map","_stripLeadingZeros","first","address","reverse","NOT_FRAGMENT","NOT_QUERY","NOT_PATH","NOT_PATH_NOSCHEME","NOT_HOST","NOT_USERINFO","NOT_SCHEME","_normalizeComponentEncoding","newStr","substr","i","fromCharCode","c","c2","c3","il","chr","charCodeAt","encode","decode","ucs2encode","ucs2decode","regexNonASCII","string","mapDomain","regexPunycode","n","delta","handledCPCount","adapt","handledCPCountPlusOne","basicLength","stringFromCharCode","digitToBasic","q","floor","qMinusT","baseMinusT","t","k","bias","tMin","tMax","currentValue","maxInt","m","inputLength","delimiter","initialBias","initialN","fromCodePoint","splice","out","oldi","w","digit","basicToDigit","basic","j","baseMinusTMin","skew","numPoints","firstTime","damp","flag","codePoint","array","value","extra","counter","result","encoded","labels","fn","regexSeparators","parts","RangeError","errors","type","Math","buildExps","IPV6ADDRESS$","ZONEID$","IPV4ADDRESS$","RESERVED$$","SUB_DELIMS$$","IPRIVATE$$","ALPHA$$","DIGIT$$","AUTHORITY_REF$","USERINFO$","HOST$","PORT$","SAMEDOC_REF$","FRAGMENT$","ABSOLUTE_REF$","SCHEME$","PATH_ABEMPTY$","PATH_ABSOLUTE$","PATH_ROOTLESS$","PATH_EMPTY$","QUERY$","RELATIVE_REF$","PATH_NOSCHEME$","GENERIC_REF$","ABSOLUTE_URI$","HIER_PART$","URI_REFERENCE$","URI$","RELATIVE$","RELATIVE_PART$","AUTHORITY$","PCHAR$","PATH$","SEGMENT_NZ$","SEGMENT_NZ_NC$","SEGMENT$","IP_LITERAL$","REG_NAME$","IPV6ADDRZ_RELAXED$","IPVFUTURE$","IPV6ADDRESS1$","IPV6ADDRESS2$","IPV6ADDRESS3$","IPV6ADDRESS4$","IPV6ADDRESS5$","IPV6ADDRESS6$","IPV6ADDRESS7$","IPV6ADDRESS8$","IPV6ADDRESS9$","H16$","LS32$","DEC_OCTET_RELAXED$","DEC_OCTET$","UCSCHAR$$","GEN_DELIMS$$","SP$$","DQUOTE$$","CR$","obj","key","source","setInterval","call","prototype","o","Object","shift","sets"],"mappings":";;;;;;;AYAA,SAAA8E,KAAA,GAAA;sCAAyBsP,IAAzB;YAAA;;;QACKA,KAAKnS,MAAL,GAAc,CAAlB,EAAqB;aACf,CAAL,IAAUmS,KAAK,CAAL,EAAQzQ,KAAR,CAAc,CAAd,EAAiB,CAAC,CAAlB,CAAV;YACMK,KAAKoQ,KAAKnS,MAAL,GAAc,CAAzB;aACK,IAAIgB,IAAI,CAAb,EAAgBA,IAAIe,EAApB,EAAwB,EAAEf,CAA1B,EAA6B;iBACvBA,CAAL,IAAUmR,KAAKnR,CAAL,EAAQU,KAAR,CAAc,CAAd,EAAiB,CAAC,CAAlB,CAAV;;aAEIK,EAAL,IAAWoQ,KAAKpQ,EAAL,EAASL,KAAT,CAAe,CAAf,CAAX;eACOyQ,KAAKpS,IAAL,CAAU,EAAV,CAAP;KAPD,MAQO;eACCoS,KAAK,CAAL,CAAP;;;AAIF,AAAA,SAAA/O,MAAA,CAAuBV,GAAvB,EAAA;WACQ,QAAQA,GAAR,GAAc,GAArB;;AAGD,AAAA,SAAA4B,MAAA,CAAuB0N,CAAvB,EAAA;WACQA,MAAM/S,SAAN,GAAkB,WAAlB,GAAiC+S,MAAM,IAAN,GAAa,MAAb,GAAsBC,OAAOF,SAAP,CAAiBhO,QAAjB,CAA0B+N,IAA1B,CAA+BE,CAA/B,EAAkC7P,KAAlC,CAAwC,GAAxC,EAA6CkE,GAA7C,GAAmDlE,KAAnD,CAAyD,GAAzD,EAA8D+P,KAA9D,GAAsEvT,WAAtE,EAA9D;;AAGD,AAAA,SAAA2B,WAAA,CAA4BoC,GAA5B,EAAA;WACQA,IAAIpC,WAAJ,EAAP;;AAGD,AAAA,SAAA0B,OAAA,CAAwB0P,GAAxB,EAAA;WACQA,QAAQzS,SAAR,IAAqByS,QAAQ,IAA7B,GAAqCA,eAAenJ,KAAf,GAAuBmJ,GAAvB,GAA8B,OAAOA,IAAI1R,MAAX,KAAsB,QAAtB,IAAkC0R,IAAIvP,KAAtC,IAA+CuP,IAAIG,WAAnD,IAAkEH,IAAII,IAAtE,GAA6E,CAACJ,GAAD,CAA7E,GAAqFnJ,MAAMwJ,SAAN,CAAgBrQ,KAAhB,CAAsBoQ,IAAtB,CAA2BJ,GAA3B,CAAxJ,GAA4L,EAAnM;;AAID,AAAA,SAAA5M,MAAA,CAAuBE,MAAvB,EAAuC4M,MAAvC,EAAA;QACOF,MAAM1M,MAAZ;QACI4M,MAAJ,EAAY;aACN,IAAMD,GAAX,IAAkBC,MAAlB,EAA0B;gBACrBD,GAAJ,IAAWC,OAAOD,GAAP,CAAX;;;WAGKD,GAAP;;;ADnCD,SAAA3D,SAAA,CAA0BzK,KAA1B,EAAA;QAEEgL,UAAU,UADX;QAECmD,MAAM,SAFP;QAGClD,UAAU,OAHX;QAICiD,WAAW,SAJZ;QAKCnO,WAAWR,MAAM0L,OAAN,EAAe,UAAf,CALZ;;WAMQ,SANR;QAOCgD,OAAO,SAPR;QAQCrO,eAAeE,OAAOA,OAAO,YAAYC,QAAZ,GAAuB,GAAvB,GAA6BA,QAA7B,GAAwCA,QAAxC,GAAmD,GAAnD,GAAyDA,QAAzD,GAAoEA,QAA3E,IAAuF,GAAvF,GAA6FD,OAAO,gBAAgBC,QAAhB,GAA2B,GAA3B,GAAiCA,QAAjC,GAA4CA,QAAnD,CAA7F,GAA4J,GAA5J,GAAkKD,OAAO,MAAMC,QAAN,GAAiBA,QAAxB,CAAzK,CARhB;;mBASgB,yBAThB;QAUC+K,eAAe,qCAVhB;QAWCD,aAAatL,MAAMyO,YAAN,EAAoBlD,YAApB,CAXd;QAYCiD,YAAY/N,QAAQ,6EAAR,GAAwF,IAZrG;;iBAacA,QAAQ,mBAAR,GAA8B,IAb5C;;mBAcgBT,MAAMyL,OAAN,EAAeC,OAAf,EAAwB,gBAAxB,EAA0C8C,SAA1C,CAdhB;QAeCtC,UAAU3L,OAAOkL,UAAUzL,MAAMyL,OAAN,EAAeC,OAAf,EAAwB,aAAxB,CAAV,GAAmD,GAA1D,CAfX;QAgBCE,YAAYrL,OAAOA,OAAOF,eAAe,GAAf,GAAqBL,MAAMC,YAAN,EAAoBsL,YAApB,EAAkC,OAAlC,CAA5B,IAA0E,GAAjF,CAhBb;QAiBCgD,aAAahO,OAAOA,OAAO,SAAP,IAAoB,GAApB,GAA0BA,OAAO,WAAWmL,OAAlB,CAA1B,GAAuD,GAAvD,GAA6DnL,OAAO,MAAMmL,OAAN,GAAgBA,OAAvB,CAA7D,GAA+F,GAA/F,GAAqGnL,OAAO,UAAUmL,OAAjB,CAArG,GAAiI,GAAjI,GAAuIA,OAA9I,CAjBd;QAkBC4C,qBAAqB/N,OAAOA,OAAO,SAAP,IAAoB,GAApB,GAA0BA,OAAO,WAAWmL,OAAlB,CAA1B,GAAuD,GAAvD,GAA6DnL,OAAO,MAAMmL,OAAN,GAAgBA,OAAvB,CAA7D,GAA+F,GAA/F,GAAqGnL,OAAO,YAAYmL,OAAnB,CAArG,GAAmI,OAAnI,GAA6IA,OAApJ,CAlBtB;;mBAmBgBnL,OAAO+N,qBAAqB,KAArB,GAA6BA,kBAA7B,GAAkD,KAAlD,GAA0DA,kBAA1D,GAA+E,KAA/E,GAAuFA,kBAA9F,CAnBhB;QAoBCF,OAAO7N,OAAOC,WAAW,OAAlB,CApBR;QAqBC6N,QAAQ9N,OAAOA,OAAO6N,OAAO,KAAP,GAAeA,IAAtB,IAA8B,GAA9B,GAAoC/C,YAA3C,CArBT;QAsBCsC,gBAAgBpN,OAAmEA,OAAO6N,OAAO,KAAd,IAAuB,KAAvB,GAA+BC,KAAlG,CAtBjB;;oBAuBiB9N,OAAwD,WAAWA,OAAO6N,OAAO,KAAd,CAAX,GAAkC,KAAlC,GAA0CC,KAAlG,CAvBjB;;oBAwBiB9N,OAAOA,OAAwC6N,IAAxC,IAAgD,SAAhD,GAA4D7N,OAAO6N,OAAO,KAAd,CAA5D,GAAmF,KAAnF,GAA2FC,KAAlG,CAxBjB;;oBAyBiB9N,OAAOA,OAAOA,OAAO6N,OAAO,KAAd,IAAuB,OAAvB,GAAiCA,IAAxC,IAAgD,SAAhD,GAA4D7N,OAAO6N,OAAO,KAAd,CAA5D,GAAmF,KAAnF,GAA2FC,KAAlG,CAzBjB;;oBA0BiB9N,OAAOA,OAAOA,OAAO6N,OAAO,KAAd,IAAuB,OAAvB,GAAiCA,IAAxC,IAAgD,SAAhD,GAA4D7N,OAAO6N,OAAO,KAAd,CAA5D,GAAmF,KAAnF,GAA2FC,KAAlG,CA1BjB;;oBA2BiB9N,OAAOA,OAAOA,OAAO6N,OAAO,KAAd,IAAuB,OAAvB,GAAiCA,IAAxC,IAAgD,SAAhD,GAAmEA,IAAnE,GAA0E,KAA1E,GAA2FC,KAAlG,CA3BjB;;oBA4BiB9N,OAAOA,OAAOA,OAAO6N,OAAO,KAAd,IAAuB,OAAvB,GAAiCA,IAAxC,IAAgD,SAAhD,GAA2FC,KAAlG,CA5BjB;;oBA6BiB9N,OAAOA,OAAOA,OAAO6N,OAAO,KAAd,IAAuB,OAAvB,GAAiCA,IAAxC,IAAgD,SAAhD,GAA2FA,IAAlG,CA7BjB;;oBA8BiB7N,OAAOA,OAAOA,OAAO6N,OAAO,KAAd,IAAuB,OAAvB,GAAiCA,IAAxC,IAAgD,SAAvD,CA9BjB;;mBA+BgB7N,OAAO,CAACoN,aAAD,EAAgBC,aAAhB,EAA+BC,aAA/B,EAA8CC,aAA9C,EAA6DC,aAA7D,EAA4EC,aAA5E,EAA2FC,aAA3F,EAA0GC,aAA1G,EAAyHC,aAAzH,EAAwIjR,IAAxI,CAA6I,GAA7I,CAAP,CA/BhB;QAgCCkO,UAAU7K,OAAOA,OAAON,eAAe,GAAf,GAAqBI,YAA5B,IAA4C,GAAnD,CAhCX;;iBAiCcE,OAAO4K,eAAe,OAAf,GAAyBC,OAAhC,CAjCd;;yBAkCsB7K,OAAO4K,eAAe5K,OAAO,iBAAiBC,QAAjB,GAA4B,MAAnC,CAAf,GAA4D4K,OAAnE,CAlCtB;;iBAmCc7K,OAAO,SAASC,QAAT,GAAoB,MAApB,GAA6BR,MAAMC,YAAN,EAAoBsL,YAApB,EAAkC,OAAlC,CAA7B,GAA0E,GAAjF,CAnCd;QAoCCgC,cAAchN,OAAO,QAAQA,OAAOkN,qBAAqB,GAArB,GAA2BtC,YAA3B,GAA0C,GAA1C,GAAgDuC,UAAvD,CAAR,GAA6E,KAApF,CApCf;;gBAqCanN,OAAOA,OAAOF,eAAe,GAAf,GAAqBL,MAAMC,YAAN,EAAoBsL,YAApB,CAA5B,IAAiE,GAAxE,CArCb;QAsCCM,QAAQtL,OAAOgN,cAAc,GAAd,GAAoBlC,YAApB,GAAmC,KAAnC,GAA2CmC,SAA3C,GAAuD,GAAvD,GAA6D,GAA7D,GAAmEA,SAA1E,CAtCT;QAuCC1B,QAAQvL,OAAOmL,UAAU,GAAjB,CAvCT;QAwCCuB,aAAa1M,OAAOA,OAAOqL,YAAY,GAAnB,IAA0B,GAA1B,GAAgCC,KAAhC,GAAwCtL,OAAO,QAAQuL,KAAf,CAAxC,GAAgE,GAAvE,CAxCd;QAyCCoB,SAAS3M,OAAOF,eAAe,GAAf,GAAqBL,MAAMC,YAAN,EAAoBsL,YAApB,EAAkC,UAAlC,CAA5B,CAzCV;QA0CC+B,WAAW/M,OAAO2M,SAAS,GAAhB,CA1CZ;QA2CCE,cAAc7M,OAAO2M,SAAS,GAAhB,CA3Cf;QA4CCG,iBAAiB9M,OAAOA,OAAOF,eAAe,GAAf,GAAqBL,MAAMC,YAAN,EAAoBsL,YAApB,EAAkC,OAAlC,CAA5B,IAA0E,GAAjF,CA5ClB;QA6CCY,gBAAgB5L,OAAOA,OAAO,QAAQ+M,QAAf,IAA2B,GAAlC,CA7CjB;QA8CClB,iBAAiB7L,OAAO,QAAQA,OAAO6M,cAAcjB,aAArB,CAAR,GAA8C,GAArD,CA9ClB;;qBA+CkB5L,OAAO8M,iBAAiBlB,aAAxB,CA/ClB;;qBAgDkB5L,OAAO6M,cAAcjB,aAArB,CAhDlB;;kBAiDe,QAAQe,MAAR,GAAiB,GAjDhC;QAkDCC,QAAQ5M,OAAO4L,gBAAgB,GAAhB,GAAsBC,cAAtB,GAAuC,GAAvC,GAA6CK,cAA7C,GAA8D,GAA9D,GAAoEJ,cAApE,GAAqF,GAArF,GAA2FC,WAAlG,CAlDT;QAmDCC,SAAShM,OAAOA,OAAO2M,SAAS,GAAT,GAAelN,MAAM,UAAN,EAAkBwL,UAAlB,CAAtB,IAAuD,GAA9D,CAnDV;QAoDCQ,YAAYzL,OAAOA,OAAO2M,SAAS,WAAhB,IAA+B,GAAtC,CApDb;QAqDCN,aAAarM,OAAOA,OAAO,WAAW0M,UAAX,GAAwBd,aAA/B,IAAgD,GAAhD,GAAsDC,cAAtD,GAAuE,GAAvE,GAA6EC,cAA7E,GAA8F,GAA9F,GAAoGC,WAA3G,CArDd;QAsDCQ,OAAOvM,OAAO2L,UAAU,KAAV,GAAkBU,UAAlB,GAA+BrM,OAAO,QAAQgM,MAAf,CAA/B,GAAwD,GAAxD,GAA8DhM,OAAO,QAAQyL,SAAf,CAA9D,GAA0F,GAAjG,CAtDR;QAuDCgB,iBAAiBzM,OAAOA,OAAO,WAAW0M,UAAX,GAAwBd,aAA/B,IAAgD,GAAhD,GAAsDC,cAAtD,GAAuE,GAAvE,GAA6EK,cAA7E,GAA8F,GAA9F,GAAoGH,WAA3G,CAvDlB;QAwDCS,YAAYxM,OAAOyM,iBAAiBzM,OAAO,QAAQgM,MAAf,CAAjB,GAA0C,GAA1C,GAAgDhM,OAAO,QAAQyL,SAAf,CAAhD,GAA4E,GAAnF,CAxDb;QAyDCa,iBAAiBtM,OAAOuM,OAAO,GAAP,GAAaC,SAApB,CAzDlB;QA0DCJ,gBAAgBpM,OAAO2L,UAAU,KAAV,GAAkBU,UAAlB,GAA+BrM,OAAO,QAAQgM,MAAf,CAA/B,GAAwD,GAA/D,CA1DjB;QA4DCG,eAAe,OAAOR,OAAP,GAAiB,MAAjB,GAA0B3L,OAAOA,OAAO,YAAYA,OAAO,MAAMqL,SAAN,GAAkB,IAAzB,CAAZ,GAA6C,IAA7C,GAAoDC,KAApD,GAA4D,GAA5D,GAAkEtL,OAAO,SAASuL,KAAT,GAAiB,GAAxB,CAAlE,GAAiG,IAAxG,IAAgH,IAAhH,GAAuHK,aAAvH,GAAuI,GAAvI,GAA6IC,cAA7I,GAA8J,GAA9J,GAAoKC,cAApK,GAAqL,GAArL,GAA2LC,WAA3L,GAAyM,GAAhN,CAA1B,GAAiP/L,OAAO,SAASgM,MAAT,GAAkB,GAAzB,CAAjP,GAAiR,GAAjR,GAAuRhM,OAAO,SAASyL,SAAT,GAAqB,GAA5B,CAAvR,GAA0T,IA5D1U;QA6DCQ,gBAAgB,WAAWjM,OAAOA,OAAO,YAAYA,OAAO,MAAMqL,SAAN,GAAkB,IAAzB,CAAZ,GAA6C,IAA7C,GAAoDC,KAApD,GAA4D,GAA5D,GAAkEtL,OAAO,SAASuL,KAAT,GAAiB,GAAxB,CAAlE,GAAiG,IAAxG,IAAgH,IAAhH,GAAuHK,aAAvH,GAAuI,GAAvI,GAA6IC,cAA7I,GAA8J,GAA9J,GAAoKK,cAApK,GAAqL,GAArL,GAA2LH,WAA3L,GAAyM,GAAhN,CAAX,GAAkO/L,OAAO,SAASgM,MAAT,GAAkB,GAAzB,CAAlO,GAAkQ,GAAlQ,GAAwQhM,OAAO,SAASyL,SAAT,GAAqB,GAA5B,CAAxQ,GAA2S,IA7D5T;QA8DCC,gBAAgB,OAAOC,OAAP,GAAiB,MAAjB,GAA0B3L,OAAOA,OAAO,YAAYA,OAAO,MAAMqL,SAAN,GAAkB,IAAzB,CAAZ,GAA6C,IAA7C,GAAoDC,KAApD,GAA4D,GAA5D,GAAkEtL,OAAO,SAASuL,KAAT,GAAiB,GAAxB,CAAlE,GAAiG,IAAxG,IAAgH,IAAhH,GAAuHK,aAAvH,GAAuI,GAAvI,GAA6IC,cAA7I,GAA8J,GAA9J,GAAoKC,cAApK,GAAqL,GAArL,GAA2LC,WAA3L,GAAyM,GAAhN,CAA1B,GAAiP/L,OAAO,SAASgM,MAAT,GAAkB,GAAzB,CAAjP,GAAiR,IA9DlS;QA+DCR,eAAe,MAAMxL,OAAO,SAASyL,SAAT,GAAqB,GAA5B,CAAN,GAAyC,IA/DzD;QAgECL,iBAAiB,MAAMpL,OAAO,MAAMqL,SAAN,GAAkB,IAAzB,CAAN,GAAuC,IAAvC,GAA8CC,KAA9C,GAAsD,GAAtD,GAA4DtL,OAAO,SAASuL,KAAT,GAAiB,GAAxB,CAA5D,GAA2F,IAhE7G;WAmEO;oBACO,IAAI/L,MAAJ,CAAWC,MAAM,KAAN,EAAayL,OAAb,EAAsBC,OAAtB,EAA+B,aAA/B,CAAX,EAA0D,GAA1D,CADP;sBAES,IAAI3L,MAAJ,CAAWC,MAAM,WAAN,EAAmBC,YAAnB,EAAiCsL,YAAjC,CAAX,EAA2D,GAA3D,CAFT;kBAGK,IAAIxL,MAAJ,CAAWC,MAAM,iBAAN,EAAyBC,YAAzB,EAAuCsL,YAAvC,CAAX,EAAiE,GAAjE,CAHL;kBAIK,IAAIxL,MAAJ,CAAWC,MAAM,iBAAN,EAAyBC,YAAzB,EAAuCsL,YAAvC,CAAX,EAAiE,GAAjE,CAJL;2BAKc,IAAIxL,MAAJ,CAAWC,MAAM,cAAN,EAAsBC,YAAtB,EAAoCsL,YAApC,CAAX,EAA8D,GAA9D,CALd;mBAMM,IAAIxL,MAAJ,CAAWC,MAAM,QAAN,EAAgBC,YAAhB,EAA8BsL,YAA9B,EAA4C,gBAA5C,EAA8DC,UAA9D,CAAX,EAAsF,GAAtF,CANN;sBAOS,IAAIzL,MAAJ,CAAWC,MAAM,QAAN,EAAgBC,YAAhB,EAA8BsL,YAA9B,EAA4C,gBAA5C,CAAX,EAA0E,GAA1E,CAPT;gBAQG,IAAIxL,MAAJ,CAAWC,MAAM,KAAN,EAAaC,YAAb,EAA2BsL,YAA3B,CAAX,EAAqD,GAArD,CARH;oBASO,IAAIxL,MAAJ,CAAWE,YAAX,EAAyB,GAAzB,CATP;qBAUQ,IAAIF,MAAJ,CAAWC,MAAM,QAAN,EAAgBC,YAAhB,EAA8BqL,UAA9B,CAAX,EAAsD,GAAtD,CAVR;qBAWQ,IAAIvL,MAAJ,CAAWM,YAAX,EAAyB,GAAzB,CAXR;qBAYQ,IAAIN,MAAJ,CAAW,OAAOsL,YAAP,GAAsB,IAAjC,CAZR;qBAaQ,IAAItL,MAAJ,CAAW,WAAWoL,YAAX,GAA0B,GAA1B,GAAgC5K,OAAOA,OAAO,iBAAiBC,QAAjB,GAA4B,MAAnC,IAA6C,GAA7C,GAAmD4K,OAAnD,GAA6D,GAApE,CAAhC,GAA2G,QAAtH,CAbR;KAAP;;AAiBD,mBAAeF,UAAU,KAAV,CAAf;;ADrFA,mBAAeA,UAAU,IAAV,CAAf;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ADDA;;AACA,IAAMpC,SAAS,UAAf;;;AAGA,IAAMzG,OAAO,EAAb;AACA,IAAMsG,OAAO,CAAb;AACA,IAAMC,OAAO,EAAb;AACA,IAAMkB,OAAO,EAAb;AACA,IAAMG,OAAO,GAAb;AACA,IAAMf,cAAc,EAApB;AACA,IAAMC,WAAW,GAAjB;AACA,IAAMF,YAAY,GAAlB;;;AAGA,IAAMtB,gBAAgB,OAAtB;AACA,IAAMH,gBAAgB,YAAtB;AACA,IAAMoD,kBAAkB,2BAAxB;;;AAGA,IAAMG,SAAS;aACF,iDADE;cAED,gDAFC;kBAGG;CAHlB;;;AAOA,IAAMlB,gBAAgBxH,OAAOsG,IAA7B;AACA,IAAMN,QAAQ4C,KAAK5C,KAAnB;AACA,IAAMH,qBAAqBjJ,OAAO4H,YAAlC;;;;;;;;;;AAUA,SAAS7K,OAAT,CAAegP,IAAf,EAAqB;OACd,IAAIF,UAAJ,CAAeC,OAAOC,IAAP,CAAf,CAAN;;;;;;;;;;;AAWD,SAASnF,GAAT,CAAauE,KAAb,EAAoBO,EAApB,EAAwB;KACjBH,SAAS,EAAf;KACIrN,SAASiN,MAAMjN,MAAnB;QACOA,QAAP,EAAiB;SACTA,MAAP,IAAiBwN,GAAGP,MAAMjN,MAAN,CAAH,CAAjB;;QAEMqN,MAAP;;;;;;;;;;;;;AAaD,SAAS9C,SAAT,CAAmBD,MAAnB,EAA2BkD,EAA3B,EAA+B;KACxBE,QAAQpD,OAAOnI,KAAP,CAAa,GAAb,CAAd;KACIkL,SAAS,EAAb;KACIK,MAAM1N,MAAN,GAAe,CAAnB,EAAsB;;;WAGZ0N,MAAM,CAAN,IAAW,GAApB;WACSA,MAAM,CAAN,CAAT;;;UAGQpD,OAAOnK,OAAP,CAAesN,eAAf,EAAgC,MAAhC,CAAT;KACMF,SAASjD,OAAOnI,KAAP,CAAa,GAAb,CAAf;KACMmL,UAAU5E,IAAI6E,MAAJ,EAAYC,EAAZ,EAAgBzN,IAAhB,CAAqB,GAArB,CAAhB;QACOsN,SAASC,OAAhB;;;;;;;;;;;;;;;;AAgBD,SAASlD,UAAT,CAAoBE,MAApB,EAA4B;KACrBtE,SAAS,EAAf;KACIoH,UAAU,CAAd;KACMpN,SAASsK,OAAOtK,MAAtB;QACOoN,UAAUpN,MAAjB,EAAyB;MAClBkN,QAAQ5C,OAAON,UAAP,CAAkBoD,SAAlB,CAAd;MACIF,SAAS,MAAT,IAAmBA,SAAS,MAA5B,IAAsCE,UAAUpN,MAApD,EAA4D;;OAErDmN,QAAQ7C,OAAON,UAAP,CAAkBoD,SAAlB,CAAd;OACI,CAACD,QAAQ,MAAT,KAAoB,MAAxB,EAAgC;;WACxBlN,IAAP,CAAY,CAAC,CAACiN,QAAQ,KAAT,KAAmB,EAApB,KAA2BC,QAAQ,KAAnC,IAA4C,OAAxD;IADD,MAEO;;;WAGClN,IAAP,CAAYiN,KAAZ;;;GARF,MAWO;UACCjN,IAAP,CAAYiN,KAAZ;;;QAGKlH,MAAP;;;;;;;;;;;AAWD,IAAMmE,aAAa,SAAbA,UAAa;QAASrI,OAAOmK,aAAP,iCAAwBgB,KAAxB,EAAT;CAAnB;;;;;;;;;;;AAWA,IAAMV,eAAe,SAAfA,YAAe,CAASS,SAAT,EAAoB;KACpCA,YAAY,IAAZ,GAAmB,IAAvB,EAA6B;SACrBA,YAAY,IAAnB;;KAEGA,YAAY,IAAZ,GAAmB,IAAvB,EAA6B;SACrBA,YAAY,IAAnB;;KAEGA,YAAY,IAAZ,GAAmB,IAAvB,EAA6B;SACrBA,YAAY,IAAnB;;QAEM9H,IAAP;CAVD;;;;;;;;;;;;;AAwBA,IAAM8F,eAAe,SAAfA,YAAe,CAASsB,KAAT,EAAgBS,IAAhB,EAAsB;;;QAGnCT,QAAQ,EAAR,GAAa,MAAMA,QAAQ,EAAd,CAAb,IAAkC,CAACS,QAAQ,CAAT,KAAe,CAAjD,CAAP;CAHD;;;;;;;AAWA,IAAMnC,QAAQ,SAARA,KAAQ,CAASF,KAAT,EAAgBkC,SAAhB,EAA2BC,SAA3B,EAAsC;KAC/CvB,IAAI,CAAR;SACQuB,YAAY3B,MAAMR,QAAQoC,IAAd,CAAZ,GAAkCpC,SAAS,CAAnD;UACSQ,MAAMR,QAAQkC,SAAd,CAAT;+BAC8BlC,QAAQgC,gBAAgBjB,IAAhB,IAAwB,CAA9D,EAAiEH,KAAKpG,IAAtE,EAA4E;UACnEgG,MAAMR,QAAQgC,aAAd,CAAR;;QAEMxB,MAAMI,IAAI,CAACoB,gBAAgB,CAAjB,IAAsBhC,KAAtB,IAA+BA,QAAQiC,IAAvC,CAAV,CAAP;CAPD;;;;;;;;;AAiBA,IAAMzC,SAAS,SAATA,MAAS,CAAShE,KAAT,EAAgB;;KAExBF,SAAS,EAAf;KACM6F,cAAc3F,MAAMlG,MAA1B;KACIyJ,IAAI,CAAR;KACIgB,IAAIuB,QAAR;KACIT,OAAOQ,WAAX;;;;;;KAMIS,QAAQtG,MAAMrE,WAAN,CAAkBiK,SAAlB,CAAZ;KACIU,QAAQ,CAAZ,EAAe;UACN,CAAR;;;MAGI,IAAIC,IAAI,CAAb,EAAgBA,IAAID,KAApB,EAA2B,EAAEC,CAA7B,EAAgC;;MAE3BvG,MAAM8D,UAAN,CAAiByC,CAAjB,KAAuB,IAA3B,EAAiC;WAC1B,WAAN;;SAEMxM,IAAP,CAAYiG,MAAM8D,UAAN,CAAiByC,CAAjB,CAAZ;;;;;;MAMI,IAAIhF,QAAQ+E,QAAQ,CAAR,GAAYA,QAAQ,CAApB,GAAwB,CAAzC,EAA4C/E,QAAQoE,WAApD,4BAA4F;;;;;;;MAOvFO,OAAO3C,CAAX;OACK,IAAI4C,IAAI,CAAR,EAAWf,IAAIpG,IAApB,qBAA8CoG,KAAKpG,IAAnD,EAAyD;;OAEpDuC,SAASoE,WAAb,EAA0B;YACnB,eAAN;;;OAGKS,QAAQC,aAAarG,MAAM8D,UAAN,CAAiBvC,OAAjB,CAAb,CAAd;;OAEI6E,SAASpH,IAAT,IAAiBoH,QAAQpB,MAAM,CAACS,SAASlC,CAAV,IAAe4C,CAArB,CAA7B,EAAsD;YAC/C,UAAN;;;QAGIC,QAAQD,CAAb;OACMhB,IAAIC,KAAKC,IAAL,GAAYC,IAAZ,GAAoBF,KAAKC,OAAOE,IAAZ,GAAmBA,IAAnB,GAA0BH,IAAIC,IAA5D;;OAEIe,QAAQjB,CAAZ,EAAe;;;;OAITD,aAAalG,OAAOmG,CAA1B;OACIgB,IAAInB,MAAMS,SAASP,UAAf,CAAR,EAAoC;YAC7B,UAAN;;;QAGIA,UAAL;;;MAIKe,MAAMnG,OAAOhG,MAAP,GAAgB,CAA5B;SACO4K,MAAMnB,IAAI2C,IAAV,EAAgBD,GAAhB,EAAqBC,QAAQ,CAA7B,CAAP;;;;MAIIlB,MAAMzB,IAAI0C,GAAV,IAAiBR,SAASlB,CAA9B,EAAiC;WAC1B,UAAN;;;OAGIS,MAAMzB,IAAI0C,GAAV,CAAL;OACKA,GAAL;;;SAGOD,MAAP,CAAczC,GAAd,EAAmB,CAAnB,EAAsBgB,CAAtB;;;QAIM3I,OAAOmK,aAAP,eAAwBjG,MAAxB,CAAP;CAjFD;;;;;;;;;AA2FA,IAAMiE,SAAS,SAATA,MAAS,CAAS/D,KAAT,EAAgB;KACxBF,SAAS,EAAf;;;SAGQoE,WAAWlE,KAAX,CAAR;;;KAGI2F,cAAc3F,MAAMlG,MAAxB;;;KAGIyK,IAAIuB,QAAR;KACItB,QAAQ,CAAZ;KACIa,OAAOQ,WAAX;;;;;;;;uBAG2B7F,KAA3B,8HAAkC;OAAvBwF,cAAuB;;OAC7BA,iBAAe,IAAnB,EAAyB;WACjBzL,IAAP,CAAY8K,mBAAmBW,cAAnB,CAAZ;;;;;;;;;;;;;;;;;;KAIEZ,cAAc9E,OAAOhG,MAAzB;KACI2K,iBAAiBG,WAArB;;;;;;KAMIA,WAAJ,EAAiB;SACT7K,IAAP,CAAY6L,SAAZ;;;;QAIMnB,iBAAiBkB,WAAxB,EAAqC;;;;MAIhCD,IAAID,MAAR;;;;;;yBAC2BzF,KAA3B,mIAAkC;QAAvBwF,YAAuB;;QAC7BA,gBAAgBjB,CAAhB,IAAqBiB,eAAeE,CAAxC,EAA2C;SACtCF,YAAJ;;;;;;;;;;;;;;;;;;;;;MAMIb,wBAAwBF,iBAAiB,CAA/C;MACIiB,IAAInB,CAAJ,GAAQS,MAAM,CAACS,SAASjB,KAAV,IAAmBG,qBAAzB,CAAZ,EAA6D;WACtD,UAAN;;;WAGQ,CAACe,IAAInB,CAAL,IAAUI,qBAAnB;MACIe,CAAJ;;;;;;;yBAE2B1F,KAA3B,mIAAkC;QAAvBwF,aAAuB;;QAC7BA,gBAAejB,CAAf,IAAoB,EAAEC,KAAF,GAAUiB,MAAlC,EAA0C;aACnC,UAAN;;QAEGD,iBAAgBjB,CAApB,EAAuB;;SAElBQ,IAAIP,KAAR;UACK,IAAIY,IAAIpG,IAAb,qBAAuCoG,KAAKpG,IAA5C,EAAkD;UAC3CmG,IAAIC,KAAKC,IAAL,GAAYC,IAAZ,GAAoBF,KAAKC,OAAOE,IAAZ,GAAmBA,IAAnB,GAA0BH,IAAIC,IAA5D;UACIN,IAAII,CAAR,EAAW;;;UAGLF,UAAUF,IAAII,CAApB;UACMD,aAAalG,OAAOmG,CAA1B;aACOpL,IAAP,CACC8K,mBAAmBC,aAAaK,IAAIF,UAAUC,UAA3B,EAAuC,CAAvC,CAAnB,CADD;UAGIF,MAAMC,UAAUC,UAAhB,CAAJ;;;YAGMnL,IAAP,CAAY8K,mBAAmBC,aAAaC,CAAb,EAAgB,CAAhB,CAAnB,CAAZ;YACOL,MAAMF,KAAN,EAAaG,qBAAb,EAAoCF,kBAAkBG,WAAtD,CAAP;aACQ,CAAR;OACEH,cAAF;;;;;;;;;;;;;;;;;;IAIAD,KAAF;IACED,CAAF;;QAGMzE,OAAOjG,IAAP,CAAY,EAAZ,CAAP;CArFD;;;;;;;;;;;;;AAmGA,IAAMyB,YAAY,SAAZA,SAAY,CAAS0E,KAAT,EAAgB;QAC1BqE,UAAUrE,KAAV,EAAiB,UAASoE,MAAT,EAAiB;SACjCE,cAAczE,IAAd,CAAmBuE,MAAnB,IACJJ,OAAOI,OAAO5I,KAAP,CAAa,CAAb,EAAgB/C,WAAhB,EAAP,CADI,GAEJ2L,MAFH;EADM,CAAP;CADD;;;;;;;;;;;;;AAmBA,IAAMhJ,UAAU,SAAVA,OAAU,CAAS4E,KAAT,EAAgB;QACxBqE,UAAUrE,KAAV,EAAiB,UAASoE,MAAT,EAAiB;SACjCD,cAActE,IAAd,CAAmBuE,MAAnB,IACJ,SAASL,OAAOK,MAAP,CADL,GAEJA,MAFH;EADM,CAAP;CADD;;;;;AAWA,IAAMjJ,WAAW;;;;;;YAML,OANK;;;;;;;;SAcR;YACG+I,UADH;YAEGD;EAhBK;WAkBND,MAlBM;WAmBND,MAnBM;YAoBL3I,OApBK;cAqBHE;CArBd,CAwBA;;ADvbA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoCA,AACA,AACA,AACA,AAiDA,AAAO,IAAMzD,UAA6C,EAAnD;AAEP,AAAA,SAAAyC,UAAA,CAA2BuJ,GAA3B,EAAA;QACOJ,IAAII,IAAIC,UAAJ,CAAe,CAAf,CAAV;QACI5I,UAAJ;QAEIuI,IAAI,EAAR,EAAYvI,IAAI,OAAOuI,EAAE5F,QAAF,CAAW,EAAX,EAAezD,WAAf,EAAX,CAAZ,KACK,IAAIqJ,IAAI,GAAR,EAAavI,IAAI,MAAMuI,EAAE5F,QAAF,CAAW,EAAX,EAAezD,WAAf,EAAV,CAAb,KACA,IAAIqJ,IAAI,IAAR,EAAcvI,IAAI,MAAM,CAAEuI,KAAK,CAAN,GAAW,GAAZ,EAAiB5F,QAAjB,CAA0B,EAA1B,EAA8BzD,WAA9B,EAAN,GAAoD,GAApD,GAA0D,CAAEqJ,IAAI,EAAL,GAAW,GAAZ,EAAiB5F,QAAjB,CAA0B,EAA1B,EAA8BzD,WAA9B,EAA9D,CAAd,KACAc,IAAI,MAAM,CAAEuI,KAAK,EAAN,GAAY,GAAb,EAAkB5F,QAAlB,CAA2B,EAA3B,EAA+BzD,WAA/B,EAAN,GAAqD,GAArD,GAA2D,CAAGqJ,KAAK,CAAN,GAAW,EAAZ,GAAkB,GAAnB,EAAwB5F,QAAxB,CAAiC,EAAjC,EAAqCzD,WAArC,EAA3D,GAAgH,GAAhH,GAAsH,CAAEqJ,IAAI,EAAL,GAAW,GAAZ,EAAiB5F,QAAjB,CAA0B,EAA1B,EAA8BzD,WAA9B,EAA1H;WAEEc,CAAP;;AAGD,AAAA,SAAAuB,WAAA,CAA4BD,GAA5B,EAAA;QACK6G,SAAS,EAAb;QACIE,IAAI,CAAR;QACMK,KAAKpH,IAAI1C,MAAf;WAEOyJ,IAAIK,EAAX,EAAe;YACRH,IAAI1C,SAASvE,IAAI8G,MAAJ,CAAWC,IAAI,CAAf,EAAkB,CAAlB,CAAT,EAA+B,EAA/B,CAAV;YAEIE,IAAI,GAAR,EAAa;sBACF7H,OAAO4H,YAAP,CAAoBC,CAApB,CAAV;iBACK,CAAL;SAFD,MAIK,IAAIA,KAAK,GAAL,IAAYA,IAAI,GAApB,EAAyB;gBACxBG,KAAKL,CAAN,IAAY,CAAhB,EAAmB;oBACZG,KAAK3C,SAASvE,IAAI8G,MAAJ,CAAWC,IAAI,CAAf,EAAkB,CAAlB,CAAT,EAA+B,EAA/B,CAAX;0BACU3H,OAAO4H,YAAP,CAAqB,CAACC,IAAI,EAAL,KAAY,CAAb,GAAmBC,KAAK,EAA5C,CAAV;aAFD,MAGO;0BACIlH,IAAI8G,MAAJ,CAAWC,CAAX,EAAc,CAAd,CAAV;;iBAEI,CAAL;SAPI,MASA,IAAIE,KAAK,GAAT,EAAc;gBACbG,KAAKL,CAAN,IAAY,CAAhB,EAAmB;oBACZG,KAAK3C,SAASvE,IAAI8G,MAAJ,CAAWC,IAAI,CAAf,EAAkB,CAAlB,CAAT,EAA+B,EAA/B,CAAX;oBACMI,KAAK5C,SAASvE,IAAI8G,MAAJ,CAAWC,IAAI,CAAf,EAAkB,CAAlB,CAAT,EAA+B,EAA/B,CAAX;0BACU3H,OAAO4H,YAAP,CAAqB,CAACC,IAAI,EAAL,KAAY,EAAb,GAAoB,CAACC,KAAK,EAAN,KAAa,CAAjC,GAAuCC,KAAK,EAAhE,CAAV;aAHD,MAIO;0BACInH,IAAI8G,MAAJ,CAAWC,CAAX,EAAc,CAAd,CAAV;;iBAEI,CAAL;SARI,MAUA;sBACM/G,IAAI8G,MAAJ,CAAWC,CAAX,EAAc,CAAd,CAAV;iBACK,CAAL;;;WAIKF,MAAP;;AAGD,SAAAD,2BAAA,CAAqC3J,UAArC,EAA+DkG,QAA/D,EAAA;aACAxF,gBAAC,CAA0BqC,GAA1B,EAAD;YACQF,SAASG,YAAYD,GAAZ,CAAf;eACQ,CAACF,OAAOzD,KAAP,CAAa8G,SAASpD,UAAtB,CAAD,GAAqCC,GAArC,GAA2CF,MAAnD;;QAGG7C,WAAW1B,MAAf,EAAuB0B,WAAW1B,MAAX,GAAoB6D,OAAOnC,WAAW1B,MAAlB,EAA0BkC,OAA1B,CAAkC0F,SAASzF,WAA3C,EAAwDC,gBAAxD,EAA0E1B,WAA1E,GAAwFwB,OAAxF,CAAgG0F,SAASwD,UAAzG,EAAqH,EAArH,CAApB;QACnB1J,WAAWwF,QAAX,KAAwBlG,SAA5B,EAAuCU,WAAWwF,QAAX,GAAsBrD,OAAOnC,WAAWwF,QAAlB,EAA4BhF,OAA5B,CAAoC0F,SAASzF,WAA7C,EAA0DC,gBAA1D,EAA4EF,OAA5E,CAAoF0F,SAASuD,YAA7F,EAA2G5I,UAA3G,EAAuHL,OAAvH,CAA+H0F,SAASzF,WAAxI,EAAqJE,WAArJ,CAAtB;QACnCX,WAAWmE,IAAX,KAAoB7E,SAAxB,EAAmCU,WAAWmE,IAAX,GAAkBhC,OAAOnC,WAAWmE,IAAlB,EAAwB3D,OAAxB,CAAgC0F,SAASzF,WAAzC,EAAsDC,gBAAtD,EAAwE1B,WAAxE,GAAsFwB,OAAtF,CAA8F0F,SAASsD,QAAvG,EAAiH3I,UAAjH,EAA6HL,OAA7H,CAAqI0F,SAASzF,WAA9I,EAA2JE,WAA3J,CAAlB;QAC/BX,WAAWP,IAAX,KAAoBH,SAAxB,EAAmCU,WAAWP,IAAX,GAAkB0C,OAAOnC,WAAWP,IAAlB,EAAwBe,OAAxB,CAAgC0F,SAASzF,WAAzC,EAAsDC,gBAAtD,EAAwEF,OAAxE,CAAiFR,WAAW1B,MAAX,GAAoB4H,SAASoD,QAA7B,GAAwCpD,SAASqD,iBAAlI,EAAsJ1I,UAAtJ,EAAkKL,OAAlK,CAA0K0F,SAASzF,WAAnL,EAAgME,WAAhM,CAAlB;QAC/BX,WAAWE,KAAX,KAAqBZ,SAAzB,EAAoCU,WAAWE,KAAX,GAAmBiC,OAAOnC,WAAWE,KAAlB,EAAyBM,OAAzB,CAAiC0F,SAASzF,WAA1C,EAAuDC,gBAAvD,EAAyEF,OAAzE,CAAiF0F,SAASmD,SAA1F,EAAqGxI,UAArG,EAAiHL,OAAjH,CAAyH0F,SAASzF,WAAlI,EAA+IE,WAA/I,CAAnB;QAChCX,WAAW8D,QAAX,KAAwBxE,SAA5B,EAAuCU,WAAW8D,QAAX,GAAsB3B,OAAOnC,WAAW8D,QAAlB,EAA4BtD,OAA5B,CAAoC0F,SAASzF,WAA7C,EAA0DC,gBAA1D,EAA4EF,OAA5E,CAAoF0F,SAASkD,YAA7F,EAA2GvI,UAA3G,EAAuHL,OAAvH,CAA+H0F,SAASzF,WAAxI,EAAqJE,WAArJ,CAAtB;WAEhCX,UAAP;;AACA;AAED,SAAAgJ,kBAAA,CAA4BjG,GAA5B,EAAA;WACQA,IAAIvC,OAAJ,CAAY,SAAZ,EAAuB,IAAvB,KAAgC,GAAvC;;AAGD,SAAAyG,cAAA,CAAwB9C,IAAxB,EAAqC+B,QAArC,EAAA;QACOnG,UAAUoE,KAAK/E,KAAL,CAAW8G,SAAS2C,WAApB,KAAoC,EAApD;;iCACoB9I,OAFrB;QAEUmJ,OAFV;;QAIKA,OAAJ,EAAa;eACLA,QAAQ1G,KAAR,CAAc,GAAd,EAAmBuG,GAAnB,CAAuBC,kBAAvB,EAA2C5I,IAA3C,CAAgD,GAAhD,CAAP;KADD,MAEO;eACC+D,IAAP;;;AAIF,SAAA6C,cAAA,CAAwB7C,IAAxB,EAAqC+B,QAArC,EAAA;QACOnG,UAAUoE,KAAK/E,KAAL,CAAW8G,SAASC,WAApB,KAAoC,EAApD;;kCAC0BpG,OAF3B;QAEUmJ,OAFV;QAEmBxB,IAFnB;;QAIKwB,OAAJ,EAAa;oCACUA,QAAQlK,WAAR,GAAsBwD,KAAtB,CAA4B,IAA5B,EAAkC2G,OAAlC,EADV;;YACLL,IADK;YACCG,KADD;;YAENR,cAAcQ,QAAQA,MAAMzG,KAAN,CAAY,GAAZ,EAAiBuG,GAAjB,CAAqBC,kBAArB,CAAR,GAAmD,EAAvE;YACMN,aAAaI,KAAKtG,KAAL,CAAW,GAAX,EAAgBuG,GAAhB,CAAoBC,kBAApB,CAAnB;YACMR,yBAAyBtC,SAAS2C,WAAT,CAAqBzC,IAArB,CAA0BsC,WAAWA,WAAWrI,MAAX,GAAoB,CAA/B,CAA1B,CAA/B;YACMkI,aAAaC,yBAAyB,CAAzB,GAA6B,CAAhD;YACMG,kBAAkBD,WAAWrI,MAAX,GAAoBkI,UAA5C;YACMpI,SAASyI,MAAcL,UAAd,CAAf;aAEK,IAAIlH,IAAI,CAAb,EAAgBA,IAAIkH,UAApB,EAAgC,EAAElH,CAAlC,EAAqC;mBAC7BA,CAAP,IAAYoH,YAAYpH,CAAZ,KAAkBqH,WAAWC,kBAAkBtH,CAA7B,CAAlB,IAAqD,EAAjE;;YAGGmH,sBAAJ,EAA4B;mBACpBD,aAAa,CAApB,IAAyBtB,eAAe9G,OAAOoI,aAAa,CAApB,CAAf,EAAuCrC,QAAvC,CAAzB;;YAGK+B,gBAAgB9H,OAAOmI,MAAP,CAAmD,UAACH,GAAD,EAAME,KAAN,EAAaP,KAAb,EAA3E;gBACO,CAACO,KAAD,IAAUA,UAAU,GAAxB,EAA6B;oBACtBD,cAAcD,IAAIA,IAAI9H,MAAJ,GAAa,CAAjB,CAApB;oBACI+H,eAAeA,YAAYN,KAAZ,GAAoBM,YAAY/H,MAAhC,KAA2CyH,KAA9D,EAAqE;gCACxDzH,MAAZ;iBADD,MAEO;wBACFC,IAAJ,CAAS,EAAEwH,YAAF,EAASzH,QAAS,CAAlB,EAAT;;;mBAGK8H,GAAP;SATqB,EAUnB,EAVmB,CAAtB;YAYMN,oBAAoBI,cAAcC,IAAd,CAAmB,UAACF,CAAD,EAAID,CAAJ;mBAAUA,EAAE1H,MAAF,GAAW2H,EAAE3H,MAAvB;SAAnB,EAAkD,CAAlD,CAA1B;YAEIoH,gBAAJ;YACII,qBAAqBA,kBAAkBxH,MAAlB,GAA2B,CAApD,EAAuD;gBAChDsH,WAAWxH,OAAO4B,KAAP,CAAa,CAAb,EAAgB8F,kBAAkBC,KAAlC,CAAjB;gBACMF,UAAUzH,OAAO4B,KAAP,CAAa8F,kBAAkBC,KAAlB,GAA0BD,kBAAkBxH,MAAzD,CAAhB;sBACUsH,SAASvH,IAAT,CAAc,GAAd,IAAqB,IAArB,GAA4BwH,QAAQxH,IAAR,CAAa,GAAb,CAAtC;SAHD,MAIO;sBACID,OAAOC,IAAP,CAAY,GAAZ,CAAV;;YAGGsH,IAAJ,EAAU;uBACE,MAAMA,IAAjB;;eAGMD,OAAP;KA5CD,MA6CO;eACCtD,IAAP;;;AAIF,IAAMqD,YAAY,iIAAlB;AACA,IAAMD,wBAA4C,EAAD,CAAKnI,KAAL,CAAW,OAAX,EAAqB,CAArB,MAA4BE,SAA7E;AAEA,AAAA,SAAAQ,KAAA,CAAsBqH,SAAtB,EAAA;QAAwClI,OAAxC,uEAA6D,EAA7D;;QACOe,aAA2B,EAAjC;QACMkG,WAAYjH,QAAQuC,GAAR,KAAgB,KAAhB,GAAwB8C,YAAxB,GAAuCD,YAAzD;QAEIpF,QAAQ+G,SAAR,KAAsB,QAA1B,EAAoCmB,YAAY,CAAClI,QAAQX,MAAR,GAAiBW,QAAQX,MAAR,GAAiB,GAAlC,GAAwC,EAAzC,IAA+C,IAA/C,GAAsD6I,SAAlE;QAE9BpH,UAAUoH,UAAU/H,KAAV,CAAgBoI,SAAhB,CAAhB;QAEIzH,OAAJ,EAAa;YACRwH,qBAAJ,EAA2B;;uBAEfjJ,MAAX,GAAoByB,QAAQ,CAAR,CAApB;uBACWyF,QAAX,GAAsBzF,QAAQ,CAAR,CAAtB;uBACWoE,IAAX,GAAkBpE,QAAQ,CAAR,CAAlB;uBACWkE,IAAX,GAAkBqD,SAASvH,QAAQ,CAAR,CAAT,EAAqB,EAArB,CAAlB;uBACWN,IAAX,GAAkBM,QAAQ,CAAR,KAAc,EAAhC;uBACWG,KAAX,GAAmBH,QAAQ,CAAR,CAAnB;uBACW+D,QAAX,GAAsB/D,QAAQ,CAAR,CAAtB;;gBAGIqH,MAAMpH,WAAWiE,IAAjB,CAAJ,EAA4B;2BAChBA,IAAX,GAAkBlE,QAAQ,CAAR,CAAlB;;SAZF,MAcO;;;uBAEKzB,MAAX,GAAoByB,QAAQ,CAAR,KAAcT,SAAlC;uBACWkG,QAAX,GAAuB2B,UAAUE,OAAV,CAAkB,GAAlB,MAA2B,CAAC,CAA5B,GAAgCtH,QAAQ,CAAR,CAAhC,GAA6CT,SAApE;uBACW6E,IAAX,GAAmBgD,UAAUE,OAAV,CAAkB,IAAlB,MAA4B,CAAC,CAA7B,GAAiCtH,QAAQ,CAAR,CAAjC,GAA8CT,SAAjE;uBACW2E,IAAX,GAAkBqD,SAASvH,QAAQ,CAAR,CAAT,EAAqB,EAArB,CAAlB;uBACWN,IAAX,GAAkBM,QAAQ,CAAR,KAAc,EAAhC;uBACWG,KAAX,GAAoBiH,UAAUE,OAAV,CAAkB,GAAlB,MAA2B,CAAC,CAA5B,GAAgCtH,QAAQ,CAAR,CAAhC,GAA6CT,SAAjE;uBACWwE,QAAX,GAAuBqD,UAAUE,OAAV,CAAkB,GAAlB,MAA2B,CAAC,CAA5B,GAAgCtH,QAAQ,CAAR,CAAhC,GAA6CT,SAApE;;gBAGI8H,MAAMpH,WAAWiE,IAAjB,CAAJ,EAA4B;2BAChBA,IAAX,GAAmBkD,UAAU/H,KAAV,CAAgB,+BAAhB,IAAmDW,QAAQ,CAAR,CAAnD,GAAgET,SAAnF;;;YAIEU,WAAWmE,IAAf,EAAqB;;uBAETA,IAAX,GAAkB6C,eAAeC,eAAejH,WAAWmE,IAA1B,EAAgC+B,QAAhC,CAAf,EAA0DA,QAA1D,CAAlB;;;YAIGlG,WAAW1B,MAAX,KAAsBgB,SAAtB,IAAmCU,WAAWwF,QAAX,KAAwBlG,SAA3D,IAAwEU,WAAWmE,IAAX,KAAoB7E,SAA5F,IAAyGU,WAAWiE,IAAX,KAAoB3E,SAA7H,IAA0I,CAACU,WAAWP,IAAtJ,IAA8JO,WAAWE,KAAX,KAAqBZ,SAAvL,EAAkM;uBACtL0G,SAAX,GAAuB,eAAvB;SADD,MAEO,IAAIhG,WAAW1B,MAAX,KAAsBgB,SAA1B,EAAqC;uBAChC0G,SAAX,GAAuB,UAAvB;SADM,MAEA,IAAIhG,WAAW8D,QAAX,KAAwBxE,SAA5B,EAAuC;uBAClC0G,SAAX,GAAuB,UAAvB;SADM,MAEA;uBACKA,SAAX,GAAuB,KAAvB;;;YAIG/G,QAAQ+G,SAAR,IAAqB/G,QAAQ+G,SAAR,KAAsB,QAA3C,IAAuD/G,QAAQ+G,SAAR,KAAsBhG,WAAWgG,SAA5F,EAAuG;uBAC3F9G,KAAX,GAAmBc,WAAWd,KAAX,IAAoB,kBAAkBD,QAAQ+G,SAA1B,GAAsC,aAA7E;;;YAIKrG,gBAAgBvB,QAAQ,CAACa,QAAQX,MAAR,IAAkB0B,WAAW1B,MAA7B,IAAuC,EAAxC,EAA4CU,WAA5C,EAAR,CAAtB;;YAGI,CAACC,QAAQsD,cAAT,KAA4B,CAAC5C,aAAD,IAAkB,CAACA,cAAc4C,cAA7D,CAAJ,EAAkF;;gBAE7EvC,WAAWmE,IAAX,KAAoBlF,QAAQ2E,UAAR,IAAuBjE,iBAAiBA,cAAciE,UAA1E,CAAJ,EAA4F;;oBAEvF;+BACQO,IAAX,GAAkBzC,SAASC,OAAT,CAAiB3B,WAAWmE,IAAX,CAAgB3D,OAAhB,CAAwB0F,SAASzF,WAAjC,EAA8CuC,WAA9C,EAA2DhE,WAA3D,EAAjB,CAAlB;iBADD,CAEE,OAAOyC,CAAP,EAAU;+BACAvC,KAAX,GAAmBc,WAAWd,KAAX,IAAoB,oEAAoEuC,CAA3G;;;;wCAI0BzB,UAA5B,EAAwCqE,YAAxC;SAXD,MAYO;;wCAEsBrE,UAA5B,EAAwCkG,QAAxC;;;YAIGvG,iBAAiBA,cAAcG,KAAnC,EAA0C;0BAC3BA,KAAd,CAAoBE,UAApB,EAAgCf,OAAhC;;KA3EF,MA6EO;mBACKC,KAAX,GAAmBc,WAAWd,KAAX,IAAoB,wBAAvC;;WAGMc,UAAP;;AACA;AAED,SAAAiG,mBAAA,CAA6BjG,UAA7B,EAAuDf,OAAvD,EAAA;QACOiH,WAAYjH,QAAQuC,GAAR,KAAgB,KAAhB,GAAwB8C,YAAxB,GAAuCD,YAAzD;QACMuB,YAA0B,EAAhC;QAEI5F,WAAWwF,QAAX,KAAwBlG,SAA5B,EAAuC;kBAC5BgB,IAAV,CAAeN,WAAWwF,QAA1B;kBACUlF,IAAV,CAAe,GAAf;;QAGGN,WAAWmE,IAAX,KAAoB7E,SAAxB,EAAmC;;kBAExBgB,IAAV,CAAe0G,eAAeC,eAAe9E,OAAOnC,WAAWmE,IAAlB,CAAf,EAAwC+B,QAAxC,CAAf,EAAkEA,QAAlE,EAA4E1F,OAA5E,CAAoF0F,SAASC,WAA7F,EAA0G,UAACe,CAAD,EAAIJ,EAAJ,EAAQC,EAAR;mBAAe,MAAMD,EAAN,IAAYC,KAAK,QAAQA,EAAb,GAAkB,EAA9B,IAAoC,GAAnD;SAA1G,CAAf;;QAGG,OAAO/G,WAAWiE,IAAlB,KAA2B,QAA3B,IAAuC,OAAOjE,WAAWiE,IAAlB,KAA2B,QAAtE,EAAgF;kBACrE3D,IAAV,CAAe,GAAf;kBACUA,IAAV,CAAe6B,OAAOnC,WAAWiE,IAAlB,CAAf;;WAGM2B,UAAUvF,MAAV,GAAmBuF,UAAUxF,IAAV,CAAe,EAAf,CAAnB,GAAwCd,SAA/C;;AACA;AAED,IAAMuH,OAAO,UAAb;AACA,IAAMD,OAAO,aAAb;AACA,IAAMD,OAAO,eAAb;AACA,AACA,IAAMF,OAAO,wBAAb;AAEA,AAAA,SAAAhB,iBAAA,CAAkCc,KAAlC,EAAA;QACOF,SAAuB,EAA7B;WAEOE,MAAMlG,MAAb,EAAqB;YAChBkG,MAAMnH,KAAN,CAAYyH,IAAZ,CAAJ,EAAuB;oBACdN,MAAM/F,OAAN,CAAcqG,IAAd,EAAoB,EAApB,CAAR;SADD,MAEO,IAAIN,MAAMnH,KAAN,CAAYwH,IAAZ,CAAJ,EAAuB;oBACrBL,MAAM/F,OAAN,CAAcoG,IAAd,EAAoB,GAApB,CAAR;SADM,MAEA,IAAIL,MAAMnH,KAAN,CAAYuH,IAAZ,CAAJ,EAAuB;oBACrBJ,MAAM/F,OAAN,CAAcmG,IAAd,EAAoB,GAApB,CAAR;mBACOD,GAAP;SAFM,MAGA,IAAIH,UAAU,GAAV,IAAiBA,UAAU,IAA/B,EAAqC;oBACnC,EAAR;SADM,MAEA;gBACAC,KAAKD,MAAMnH,KAAN,CAAYqH,IAAZ,CAAX;gBACID,EAAJ,EAAQ;oBACDX,IAAIW,GAAG,CAAH,CAAV;wBACQD,MAAMxE,KAAN,CAAY8D,EAAExF,MAAd,CAAR;uBACOC,IAAP,CAAYuF,CAAZ;aAHD,MAIO;sBACA,IAAIS,KAAJ,CAAU,kCAAV,CAAN;;;;WAKID,OAAOjG,IAAP,CAAY,EAAZ,CAAP;;AACA;AAED,AAAA,SAAAR,SAAA,CAA0BI,UAA1B,EAAA;QAAoDf,OAApD,uEAAyE,EAAzE;;QACOiH,WAAYjH,QAAQuC,GAAR,GAAc8C,YAAd,GAA6BD,YAA/C;QACMuB,YAA0B,EAAhC;;QAGMjG,gBAAgBvB,QAAQ,CAACa,QAAQX,MAAR,IAAkB0B,WAAW1B,MAA7B,IAAuC,EAAxC,EAA4CU,WAA5C,EAAR,CAAtB;;QAGIW,iBAAiBA,cAAcC,SAAnC,EAA8CD,cAAcC,SAAd,CAAwBI,UAAxB,EAAoCf,OAApC;QAE1Ce,WAAWmE,IAAf,EAAqB;;YAEhB+B,SAASC,WAAT,CAAqBC,IAArB,CAA0BpG,WAAWmE,IAArC,CAAJ,EAAgD;;;;aAK3C,IAAIlF,QAAQ2E,UAAR,IAAuBjE,iBAAiBA,cAAciE,UAA1D,EAAuE;;oBAEvE;+BACQO,IAAX,GAAmB,CAAClF,QAAQuC,GAAT,GAAeE,SAASC,OAAT,CAAiB3B,WAAWmE,IAAX,CAAgB3D,OAAhB,CAAwB0F,SAASzF,WAAjC,EAA8CuC,WAA9C,EAA2DhE,WAA3D,EAAjB,CAAf,GAA4G0C,SAASG,SAAT,CAAmB7B,WAAWmE,IAA9B,CAA/H;iBADD,CAEE,OAAO1C,CAAP,EAAU;+BACAvC,KAAX,GAAmBc,WAAWd,KAAX,IAAoB,iDAAiD,CAACD,QAAQuC,GAAT,GAAe,OAAf,GAAyB,SAA1E,IAAuF,iBAAvF,GAA2GC,CAAlJ;;;;;gCAMyBzB,UAA5B,EAAwCkG,QAAxC;QAEIjH,QAAQ+G,SAAR,KAAsB,QAAtB,IAAkChG,WAAW1B,MAAjD,EAAyD;kBAC9CgC,IAAV,CAAeN,WAAW1B,MAA1B;kBACUgC,IAAV,CAAe,GAAf;;QAGKwF,YAAYG,oBAAoBjG,UAApB,EAAgCf,OAAhC,CAAlB;QACI6G,cAAcxG,SAAlB,EAA6B;YACxBL,QAAQ+G,SAAR,KAAsB,QAA1B,EAAoC;sBACzB1F,IAAV,CAAe,IAAf;;kBAGSA,IAAV,CAAewF,SAAf;YAEI9F,WAAWP,IAAX,IAAmBO,WAAWP,IAAX,CAAgBiG,MAAhB,CAAuB,CAAvB,MAA8B,GAArD,EAA0D;sBAC/CpF,IAAV,CAAe,GAAf;;;QAIEN,WAAWP,IAAX,KAAoBH,SAAxB,EAAmC;YAC9BuG,IAAI7F,WAAWP,IAAnB;YAEI,CAACR,QAAQ8G,YAAT,KAA0B,CAACpG,aAAD,IAAkB,CAACA,cAAcoG,YAA3D,CAAJ,EAA8E;gBACzEN,kBAAkBI,CAAlB,CAAJ;;YAGGC,cAAcxG,SAAlB,EAA6B;gBACxBuG,EAAErF,OAAF,CAAU,OAAV,EAAmB,MAAnB,CAAJ,CAD4B;;kBAInBF,IAAV,CAAeuF,CAAf;;QAGG7F,WAAWE,KAAX,KAAqBZ,SAAzB,EAAoC;kBACzBgB,IAAV,CAAe,GAAf;kBACUA,IAAV,CAAeN,WAAWE,KAA1B;;QAGGF,WAAW8D,QAAX,KAAwBxE,SAA5B,EAAuC;kBAC5BgB,IAAV,CAAe,GAAf;kBACUA,IAAV,CAAeN,WAAW8D,QAA1B;;WAGM8B,UAAUxF,IAAV,CAAe,EAAf,CAAP,CAxED;;AAyEC;AAED,AAAA,SAAA2E,iBAAA,CAAkCQ,IAAlC,EAAsDD,QAAtD,EAAA;QAA8ErG,OAA9E,uEAAmG,EAAnG;QAAuG0G,iBAAvG;;QACON,SAAuB,EAA7B;QAEI,CAACM,iBAAL,EAAwB;eAChB7F,MAAMF,UAAU2F,IAAV,EAAgBtG,OAAhB,CAAN,EAAgCA,OAAhC,CAAP,CADuB;mBAEZa,MAAMF,UAAU0F,QAAV,EAAoBrG,OAApB,CAAN,EAAoCA,OAApC,CAAX,CAFuB;;cAIdA,WAAW,EAArB;QAEI,CAACA,QAAQE,QAAT,IAAqBmG,SAAShH,MAAlC,EAA0C;eAClCA,MAAP,GAAgBgH,SAAShH,MAAzB;;eAEOkH,QAAP,GAAkBF,SAASE,QAA3B;eACOrB,IAAP,GAAcmB,SAASnB,IAAvB;eACOF,IAAP,GAAcqB,SAASrB,IAAvB;eACOxE,IAAP,GAAcgG,kBAAkBH,SAAS7F,IAAT,IAAiB,EAAnC,CAAd;eACOS,KAAP,GAAeoF,SAASpF,KAAxB;KAPD,MAQO;YACFoF,SAASE,QAAT,KAAsBlG,SAAtB,IAAmCgG,SAASnB,IAAT,KAAkB7E,SAArD,IAAkEgG,SAASrB,IAAT,KAAkB3E,SAAxF,EAAmG;;mBAE3FkG,QAAP,GAAkBF,SAASE,QAA3B;mBACOrB,IAAP,GAAcmB,SAASnB,IAAvB;mBACOF,IAAP,GAAcqB,SAASrB,IAAvB;mBACOxE,IAAP,GAAcgG,kBAAkBH,SAAS7F,IAAT,IAAiB,EAAnC,CAAd;mBACOS,KAAP,GAAeoF,SAASpF,KAAxB;SAND,MAOO;gBACF,CAACoF,SAAS7F,IAAd,EAAoB;uBACZA,IAAP,GAAc8F,KAAK9F,IAAnB;oBACI6F,SAASpF,KAAT,KAAmBZ,SAAvB,EAAkC;2BAC1BY,KAAP,GAAeoF,SAASpF,KAAxB;iBADD,MAEO;2BACCA,KAAP,GAAeqF,KAAKrF,KAApB;;aALF,MAOO;oBACFoF,SAAS7F,IAAT,CAAciG,MAAd,CAAqB,CAArB,MAA4B,GAAhC,EAAqC;2BAC7BjG,IAAP,GAAcgG,kBAAkBH,SAAS7F,IAA3B,CAAd;iBADD,MAEO;wBACF,CAAC8F,KAAKC,QAAL,KAAkBlG,SAAlB,IAA+BiG,KAAKpB,IAAL,KAAc7E,SAA7C,IAA0DiG,KAAKtB,IAAL,KAAc3E,SAAzE,KAAuF,CAACiG,KAAK9F,IAAjG,EAAuG;+BAC/FA,IAAP,GAAc,MAAM6F,SAAS7F,IAA7B;qBADD,MAEO,IAAI,CAAC8F,KAAK9F,IAAV,EAAgB;+BACfA,IAAP,GAAc6F,SAAS7F,IAAvB;qBADM,MAEA;+BACCA,IAAP,GAAc8F,KAAK9F,IAAL,CAAUsC,KAAV,CAAgB,CAAhB,EAAmBwD,KAAK9F,IAAL,CAAUyC,WAAV,CAAsB,GAAtB,IAA6B,CAAhD,IAAqDoD,SAAS7F,IAA5E;;2BAEMA,IAAP,GAAcgG,kBAAkBJ,OAAO5F,IAAzB,CAAd;;uBAEMS,KAAP,GAAeoF,SAASpF,KAAxB;;;mBAGMsF,QAAP,GAAkBD,KAAKC,QAAvB;mBACOrB,IAAP,GAAcoB,KAAKpB,IAAnB;mBACOF,IAAP,GAAcsB,KAAKtB,IAAnB;;eAEM3F,MAAP,GAAgBiH,KAAKjH,MAArB;;WAGMwF,QAAP,GAAkBwB,SAASxB,QAA3B;WAEOuB,MAAP;;AACA;AAED,AAAA,SAAAD,OAAA,CAAwBJ,OAAxB,EAAwCE,WAAxC,EAA4DjG,OAA5D,EAAA;QACOgG,oBAAoBE,OAAO,EAAE7G,QAAS,MAAX,EAAP,EAA4BW,OAA5B,CAA1B;WACOW,UAAUmF,kBAAkBjF,MAAMkF,OAAN,EAAeC,iBAAf,CAAlB,EAAqDnF,MAAMoF,WAAN,EAAmBD,iBAAnB,CAArD,EAA4FA,iBAA5F,EAA+G,IAA/G,CAAV,EAAgIA,iBAAhI,CAAP;;AACA;AAID,AAAA,SAAAH,SAAA,CAA0BD,GAA1B,EAAmC5F,OAAnC,EAAA;QACK,OAAO4F,GAAP,KAAe,QAAnB,EAA6B;cACtBjF,UAAUE,MAAM+E,GAAN,EAAW5F,OAAX,CAAV,EAA+BA,OAA/B,CAAN;KADD,MAEO,IAAI0F,OAAOE,GAAP,MAAgB,QAApB,EAA8B;cAC9B/E,MAAMF,UAAyBiF,GAAzB,EAA8B5F,OAA9B,CAAN,EAA8CA,OAA9C,CAAN;;WAGM4F,GAAP;;AACA;AAID,AAAA,SAAAD,KAAA,CAAsBH,IAAtB,EAAgCC,IAAhC,EAA0CzF,OAA1C,EAAA;QACK,OAAOwF,IAAP,KAAgB,QAApB,EAA8B;eACtB7E,UAAUE,MAAM2E,IAAN,EAAYxF,OAAZ,CAAV,EAAgCA,OAAhC,CAAP;KADD,MAEO,IAAI0F,OAAOF,IAAP,MAAiB,QAArB,EAA+B;eAC9B7E,UAAyB6E,IAAzB,EAA+BxF,OAA/B,CAAP;;QAGG,OAAOyF,IAAP,KAAgB,QAApB,EAA8B;eACtB9E,UAAUE,MAAM4E,IAAN,EAAYzF,OAAZ,CAAV,EAAgCA,OAAhC,CAAP;KADD,MAEO,IAAI0F,OAAOD,IAAP,MAAiB,QAArB,EAA+B;eAC9B9E,UAAyB8E,IAAzB,EAA+BzF,OAA/B,CAAP;;WAGMwF,SAASC,IAAhB;;AACA;AAED,AAAA,SAAAF,eAAA,CAAgCzB,GAAhC,EAA4C9D,OAA5C,EAAA;WACQ8D,OAAOA,IAAIqB,QAAJ,GAAe5D,OAAf,CAAwB,CAACvB,OAAD,IAAY,CAACA,QAAQuC,GAArB,GAA2B6C,aAAaE,MAAxC,GAAiDD,aAAaC,MAAtF,EAA+F1D,UAA/F,CAAd;;AACA;AAED,AAAA,SAAAe,iBAAA,CAAkCmB,GAAlC,EAA8C9D,OAA9C,EAAA;WACQ8D,OAAOA,IAAIqB,QAAJ,GAAe5D,OAAf,CAAwB,CAACvB,OAAD,IAAY,CAACA,QAAQuC,GAArB,GAA2B6C,aAAa5D,WAAxC,GAAsD6D,aAAa7D,WAA3F,EAAyGuC,WAAzG,CAAd;CACA;;ADziBD,IAAMzD,UAA2B;YACvB,MADuB;gBAGnB,IAHmB;WAKxB,eAAUS,UAAV,EAAoCf,OAApC,EAAT;;YAEM,CAACe,WAAWmE,IAAhB,EAAsB;uBACVjF,KAAX,GAAmBc,WAAWd,KAAX,IAAoB,6BAAvC;;eAGMc,UAAP;KAX+B;eAcpB,mBAAUA,UAAV,EAAoCf,OAApC,EAAb;YACQ+E,SAAS7B,OAAOnC,WAAW1B,MAAlB,EAA0BU,WAA1B,OAA4C,OAA3D;;YAGIgB,WAAWiE,IAAX,MAAqBD,SAAS,GAAT,GAAe,EAApC,KAA2ChE,WAAWiE,IAAX,KAAoB,EAAnE,EAAuE;uBAC3DA,IAAX,GAAkB3E,SAAlB;;;YAIG,CAACU,WAAWP,IAAhB,EAAsB;uBACVA,IAAX,GAAkB,GAAlB;;;;;eAOMO,UAAP;;CA/BF,CAmCA;;ADlCA,IAAMT,YAA2B;YACvB,OADuB;gBAEnBX,QAAKgF,UAFc;WAGxBhF,QAAKkB,KAHmB;eAIpBlB,QAAKgB;CAJlB,CAOA;;ADHA,SAAAsE,QAAA,CAAkBL,YAAlB,EAAA;WACQ,OAAOA,aAAaG,MAApB,KAA+B,SAA/B,GAA2CH,aAAaG,MAAxD,GAAiE7B,OAAO0B,aAAavF,MAApB,EAA4BU,WAA5B,OAA8C,KAAtH;;;AAID,IAAMO,YAA2B;YACvB,IADuB;gBAGnB,IAHmB;WAKxB,eAAUS,UAAV,EAAoCf,OAApC,EAAT;YACQ4E,eAAe7D,UAArB;;qBAGagE,MAAb,GAAsBE,SAASL,YAAT,CAAtB;;qBAGaE,YAAb,GAA4B,CAACF,aAAapE,IAAb,IAAqB,GAAtB,KAA8BoE,aAAa3D,KAAb,GAAqB,MAAM2D,aAAa3D,KAAxC,GAAgD,EAA9E,CAA5B;qBACaT,IAAb,GAAoBH,SAApB;qBACaY,KAAb,GAAqBZ,SAArB;eAEOuE,YAAP;KAhB+B;eAmBpB,mBAAUA,YAAV,EAAqC5E,OAArC,EAAb;;YAEM4E,aAAaI,IAAb,MAAuBC,SAASL,YAAT,IAAyB,GAAzB,GAA+B,EAAtD,KAA6DA,aAAaI,IAAb,KAAsB,EAAvF,EAA2F;yBAC7EA,IAAb,GAAoB3E,SAApB;;;YAIG,OAAOuE,aAAaG,MAApB,KAA+B,SAAnC,EAA8C;yBAChC1F,MAAb,GAAuBuF,aAAaG,MAAb,GAAsB,KAAtB,GAA8B,IAArD;yBACaA,MAAb,GAAsB1E,SAAtB;;;YAIGuE,aAAaE,YAAjB,EAA+B;wCACRF,aAAaE,YAAb,CAA0BvB,KAA1B,CAAgC,GAAhC,CADQ;;gBACvB/C,IADuB;gBACjBS,KADiB;;yBAEjBT,IAAb,GAAqBA,QAAQA,SAAS,GAAjB,GAAuBA,IAAvB,GAA8BH,SAAnD;yBACaY,KAAb,GAAqBA,KAArB;yBACa6D,YAAb,GAA4BzE,SAA5B;;;qBAIYwE,QAAb,GAAwBxE,SAAxB;eAEOuE,YAAP;;CA1CF,CA8CA;;ADvDA,IAAMtE,YAA2B;YACvB,KADuB;gBAEnBb,UAAGkF,UAFgB;WAGxBlF,UAAGoB,KAHqB;eAIpBpB,UAAGkB;CAJhB,CAOA;;ADMA,IAAMoB,IAAkB,EAAxB;AACA,IAAM2C,QAAQ,IAAd;;AAGA,IAAMR,eAAe,4BAA4BQ,QAAQ,2EAAR,GAAsF,EAAlH,IAAwH,GAA7I;AACA,IAAMD,WAAW,aAAjB;AACA,IAAMH,eAAeE,OAAOA,OAAO,YAAYC,QAAZ,GAAuB,GAAvB,GAA6BA,QAA7B,GAAwCA,QAAxC,GAAmD,GAAnD,GAAyDA,QAAzD,GAAoEA,QAA3E,IAAuF,GAAvF,GAA6FD,OAAO,gBAAgBC,QAAhB,GAA2B,GAA3B,GAAiCA,QAAjC,GAA4CA,QAAnD,CAA7F,GAA4J,GAA5J,GAAkKD,OAAO,MAAMC,QAAN,GAAiBA,QAAxB,CAAzK,CAArB;;;;;;;;;;;;AAaA,IAAML,UAAU,uDAAhB;AACA,IAAMG,UAAU,4DAAhB;AACA,IAAMF,UAAUJ,MAAMM,OAAN,EAAe,YAAf,CAAhB;AACA,AACA,AACA,AACA,AAEA,AAEA,IAAMJ,gBAAgB,qCAAtB;AACA,AACA,AACA,AACA,AACA,AACA,AACA,AACA,AACA,AACA,AACA,AAEA,IAAMN,aAAa,IAAIG,MAAJ,CAAWE,YAAX,EAAyB,GAAzB,CAAnB;AACA,IAAM1C,cAAc,IAAIwC,MAAJ,CAAWM,YAAX,EAAyB,GAAzB,CAApB;AACA,IAAMtB,iBAAiB,IAAIgB,MAAJ,CAAWC,MAAM,KAAN,EAAaG,OAAb,EAAsB,OAAtB,EAA+B,OAA/B,EAAwCC,OAAxC,CAAX,EAA6D,GAA7D,CAAvB;AACA,AACA,IAAM1C,aAAa,IAAIqC,MAAJ,CAAWC,MAAM,KAAN,EAAaC,YAAb,EAA2BC,aAA3B,CAAX,EAAsD,GAAtD,CAAnB;AACA,IAAMrC,cAAcH,UAApB;AACA,AACA,AAEA,SAAAF,gBAAA,CAA0BqC,GAA1B,EAAA;QACOF,SAASG,YAAYD,GAAZ,CAAf;WACQ,CAACF,OAAOzD,KAAP,CAAa0D,UAAb,CAAD,GAA4BC,GAA5B,GAAkCF,MAA1C;;AAGD,IAAMtD,YAA8C;YAC1C,QAD0C;WAG3C,kBAAUS,UAAV,EAAoCf,OAApC,EAAT;YACQgC,mBAAmBjB,UAAzB;YACMoB,KAAKH,iBAAiBG,EAAjB,GAAuBH,iBAAiBxB,IAAjB,GAAwBwB,iBAAiBxB,IAAjB,CAAsB+C,KAAtB,CAA4B,GAA5B,CAAxB,GAA2D,EAA7F;yBACiB/C,IAAjB,GAAwBH,SAAxB;YAEI2B,iBAAiBf,KAArB,EAA4B;gBACvBuC,iBAAiB,KAArB;gBACM3B,UAAwB,EAA9B;gBACM8B,UAAU3B,iBAAiBf,KAAjB,CAAuBsC,KAAvB,CAA6B,GAA7B,CAAhB;iBAEK,IAAInB,IAAI,CAAR,EAAWe,KAAKQ,QAAQvC,MAA7B,EAAqCgB,IAAIe,EAAzC,EAA6C,EAAEf,CAA/C,EAAkD;oBAC3CqB,SAASE,QAAQvB,CAAR,EAAWmB,KAAX,CAAiB,GAAjB,CAAf;wBAEQE,OAAO,CAAP,CAAR;yBACM,IAAL;4BACOC,UAAUD,OAAO,CAAP,EAAUF,KAAV,CAAgB,GAAhB,CAAhB;6BACK,IAAInB,KAAI,CAAR,EAAWe,MAAKO,QAAQtC,MAA7B,EAAqCgB,KAAIe,GAAzC,EAA6C,EAAEf,EAA/C,EAAkD;+BAC9Cf,IAAH,CAAQqC,QAAQtB,EAAR,CAAR;;;yBAGG,SAAL;yCACkBF,OAAjB,GAA2BS,kBAAkBc,OAAO,CAAP,CAAlB,EAA6BzD,OAA7B,CAA3B;;yBAEI,MAAL;yCACkBiC,IAAjB,GAAwBU,kBAAkBc,OAAO,CAAP,CAAlB,EAA6BzD,OAA7B,CAAxB;;;yCAGiB,IAAjB;gCACQ2C,kBAAkBc,OAAO,CAAP,CAAlB,EAA6BzD,OAA7B,CAAR,IAAiD2C,kBAAkBc,OAAO,CAAP,CAAlB,EAA6BzD,OAA7B,CAAjD;;;;gBAKCwD,cAAJ,EAAoBxB,iBAAiBH,OAAjB,GAA2BA,OAA3B;;yBAGJZ,KAAjB,GAAyBZ,SAAzB;aAEK,IAAI+B,MAAI,CAAR,EAAWe,OAAKhB,GAAGf,MAAxB,EAAgCgB,MAAIe,IAApC,EAAwC,EAAEf,GAA1C,EAA6C;gBACtCiB,OAAOlB,GAAGC,GAAH,EAAMmB,KAAN,CAAY,GAAZ,CAAb;iBAEK,CAAL,IAAUZ,kBAAkBU,KAAK,CAAL,CAAlB,CAAV;gBAEI,CAACrD,QAAQsD,cAAb,EAA6B;;oBAExB;yBACE,CAAL,IAAUb,SAASC,OAAT,CAAiBC,kBAAkBU,KAAK,CAAL,CAAlB,EAA2BrD,OAA3B,EAAoCD,WAApC,EAAjB,CAAV;iBADD,CAEE,OAAOyC,CAAP,EAAU;qCACMvC,KAAjB,GAAyB+B,iBAAiB/B,KAAjB,IAA0B,6EAA6EuC,CAAhI;;aALF,MAOO;qBACD,CAAL,IAAUG,kBAAkBU,KAAK,CAAL,CAAlB,EAA2BrD,OAA3B,EAAoCD,WAApC,EAAV;;eAGEqC,GAAH,IAAQiB,KAAKlC,IAAL,CAAU,GAAV,CAAR;;eAGMa,gBAAP;KA5DkD;eA+DvC,sBAAUA,gBAAV,EAA6ChC,OAA7C,EAAb;YACQe,aAAaiB,gBAAnB;YACMG,KAAKiB,QAAQpB,iBAAiBG,EAAzB,CAAX;YACIA,EAAJ,EAAQ;iBACF,IAAIC,IAAI,CAAR,EAAWe,KAAKhB,GAAGf,MAAxB,EAAgCgB,IAAIe,EAApC,EAAwC,EAAEf,CAA1C,EAA6C;oBACtCS,SAASK,OAAOf,GAAGC,CAAH,CAAP,CAAf;oBACMW,QAAQF,OAAOI,WAAP,CAAmB,GAAnB,CAAd;oBACMZ,YAAaQ,OAAOC,KAAP,CAAa,CAAb,EAAgBC,KAAhB,CAAD,CAAyBxB,OAAzB,CAAiCC,WAAjC,EAA8CC,gBAA9C,EAAgEF,OAAhE,CAAwEC,WAAxE,EAAqFE,WAArF,EAAkGH,OAAlG,CAA0GyB,cAA1G,EAA0HpB,UAA1H,CAAlB;oBACIU,SAASO,OAAOC,KAAP,CAAaC,QAAQ,CAArB,CAAb;;oBAGI;6BACO,CAAC/C,QAAQuC,GAAT,GAAeE,SAASC,OAAT,CAAiBC,kBAAkBL,MAAlB,EAA0BtC,OAA1B,EAAmCD,WAAnC,EAAjB,CAAf,GAAoF0C,SAASG,SAAT,CAAmBN,MAAnB,CAA9F;iBADD,CAEE,OAAOE,CAAP,EAAU;+BACAvC,KAAX,GAAmBc,WAAWd,KAAX,IAAoB,0DAA0D,CAACD,QAAQuC,GAAT,GAAe,OAAf,GAAyB,SAAnF,IAAgG,iBAAhG,GAAoHC,CAA3J;;mBAGEJ,CAAH,IAAQC,YAAY,GAAZ,GAAkBC,MAA1B;;uBAGU9B,IAAX,GAAkB2B,GAAGhB,IAAH,CAAQ,GAAR,CAAlB;;YAGKU,UAAUG,iBAAiBH,OAAjB,GAA2BG,iBAAiBH,OAAjB,IAA4B,EAAvE;YAEIG,iBAAiBE,OAArB,EAA8BL,QAAQ,SAAR,IAAqBG,iBAAiBE,OAAtC;YAC1BF,iBAAiBC,IAArB,EAA2BJ,QAAQ,MAAR,IAAkBG,iBAAiBC,IAAnC;YAErBf,SAAS,EAAf;aACK,IAAMI,IAAX,IAAmBO,OAAnB,EAA4B;gBACvBA,QAAQP,IAAR,MAAkBS,EAAET,IAAF,CAAtB,EAA+B;uBACvBD,IAAP,CACCC,KAAKC,OAAL,CAAaC,WAAb,EAA0BC,gBAA1B,EAA4CF,OAA5C,CAAoDC,WAApD,EAAiEE,WAAjE,EAA8EH,OAA9E,CAAsFI,UAAtF,EAAkGC,UAAlG,IACA,GADA,GAEAC,QAAQP,IAAR,EAAcC,OAAd,CAAsBC,WAAtB,EAAmCC,gBAAnC,EAAqDF,OAArD,CAA6DC,WAA7D,EAA0EE,WAA1E,EAAuFH,OAAvF,CAA+FO,WAA/F,EAA4GF,UAA5G,CAHD;;;YAOEV,OAAOE,MAAX,EAAmB;uBACPH,KAAX,GAAmBC,OAAOC,IAAP,CAAY,GAAZ,CAAnB;;eAGMJ,UAAP;;CAzGF,CA6GA;;ADnKA,IAAMC,YAAY,iBAAlB;AACA,AAEA;AACA,IAAMV,YAAqD;YACjD,KADiD;WAGlD,kBAAUS,UAAV,EAAoCf,OAApC,EAAT;YACQc,UAAUC,WAAWP,IAAX,IAAmBO,WAAWP,IAAX,CAAgBL,KAAhB,CAAsBa,SAAtB,CAAnC;YACIpB,gBAAgBmB,UAApB;YAEID,OAAJ,EAAa;gBACNzB,SAASW,QAAQX,MAAR,IAAkBO,cAAcP,MAAhC,IAA0C,KAAzD;gBACMoB,MAAMK,QAAQ,CAAR,EAAWf,WAAX,EAAZ;gBACMF,MAAMiB,QAAQ,CAAR,CAAZ;gBACMF,YAAevB,MAAf,UAAyBW,QAAQS,GAAR,IAAeA,GAAxC,CAAN;gBACMC,gBAAgBvB,QAAQyB,SAAR,CAAtB;0BAEcH,GAAd,GAAoBA,GAApB;0BACcZ,GAAd,GAAoBA,GAApB;0BACcW,IAAd,GAAqBH,SAArB;gBAEIK,aAAJ,EAAmB;gCACFA,cAAcG,KAAd,CAAoBjB,aAApB,EAAmCI,OAAnC,CAAhB;;SAZF,MAcO;0BACQC,KAAd,GAAsBL,cAAcK,KAAd,IAAuB,wBAA7C;;eAGML,aAAP;KAzByD;eA4B9C,sBAAUA,aAAV,EAAuCI,OAAvC,EAAb;YACQX,SAASW,QAAQX,MAAR,IAAkBO,cAAcP,MAAhC,IAA0C,KAAzD;YACMoB,MAAMb,cAAca,GAA1B;YACMG,YAAevB,MAAf,UAAyBW,QAAQS,GAAR,IAAeA,GAAxC,CAAN;YACMC,gBAAgBvB,QAAQyB,SAAR,CAAtB;YAEIF,aAAJ,EAAmB;4BACFA,cAAcC,SAAd,CAAwBf,aAAxB,EAAuCI,OAAvC,CAAhB;;YAGKO,gBAAgBX,aAAtB;YACMC,MAAMD,cAAcC,GAA1B;sBACcW,IAAd,IAAwBC,OAAOT,QAAQS,GAAvC,UAA8CZ,GAA9C;eAEOU,aAAP;;CA1CF,CA8CA;;AD5DA,IAAMH,OAAO,0DAAb;AACA,AAEA;AACA,IAAME,YAAsE;YAClE,UADkE;WAGnE,eAAUV,aAAV,EAAuCI,OAAvC,EAAT;YACQF,iBAAiBF,aAAvB;uBACeR,IAAf,GAAsBU,eAAeD,GAArC;uBACeA,GAAf,GAAqBQ,SAArB;YAEI,CAACL,QAAQE,QAAT,KAAsB,CAACJ,eAAeV,IAAhB,IAAwB,CAACU,eAAeV,IAAf,CAAoBe,KAApB,CAA0BC,IAA1B,CAA/C,CAAJ,EAAqF;2BACrEH,KAAf,GAAuBH,eAAeG,KAAf,IAAwB,oBAA/C;;eAGMH,cAAP;KAZ0E;eAe/D,mBAAUA,cAAV,EAAyCE,OAAzC,EAAb;YACQJ,gBAAgBE,cAAtB;;sBAEcD,GAAd,GAAoB,CAACC,eAAeV,IAAf,IAAuB,EAAxB,EAA4BW,WAA5B,EAApB;eACOH,aAAP;;CAnBF,CAuBA;;ADhCAT,QAAQQ,QAAKN,MAAb,IAAuBM,OAAvB;AAEA,AACAR,QAAQO,UAAML,MAAd,IAAwBK,SAAxB;AAEA,AACAP,QAAQM,UAAGJ,MAAX,IAAqBI,SAArB;AAEA,AACAN,QAAQK,UAAIH,MAAZ,IAAsBG,SAAtB;AAEA,AACAL,QAAQI,UAAOF,MAAf,IAAyBE,SAAzB;AAEA,AACAJ,QAAQG,UAAID,MAAZ,IAAsBC,SAAtB;AAEA,AACAH,QAAQC,UAAKC,MAAb,IAAuBD,SAAvB,CAEA;;;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/deps/npm/node_modules/uri-js/dist/es5/uri.all.min.d.ts b/deps/npm/node_modules/uri-js/dist/es5/uri.all.min.d.ts new file mode 100755 index 00000000000000..da51e23527705f --- /dev/null +++ b/deps/npm/node_modules/uri-js/dist/es5/uri.all.min.d.ts @@ -0,0 +1,59 @@ +export interface URIComponents { + scheme?: string; + userinfo?: string; + host?: string; + port?: number | string; + path?: string; + query?: string; + fragment?: string; + reference?: string; + error?: string; +} +export interface URIOptions { + scheme?: string; + reference?: string; + tolerant?: boolean; + absolutePath?: boolean; + iri?: boolean; + unicodeSupport?: boolean; + domainHost?: boolean; +} +export interface URISchemeHandler { + scheme: string; + parse(components: ParentComponents, options: Options): Components; + serialize(components: Components, options: Options): ParentComponents; + unicodeSupport?: boolean; + domainHost?: boolean; + absolutePath?: boolean; +} +export interface URIRegExps { + NOT_SCHEME: RegExp; + NOT_USERINFO: RegExp; + NOT_HOST: RegExp; + NOT_PATH: RegExp; + NOT_PATH_NOSCHEME: RegExp; + NOT_QUERY: RegExp; + NOT_FRAGMENT: RegExp; + ESCAPE: RegExp; + UNRESERVED: RegExp; + OTHER_CHARS: RegExp; + PCT_ENCODED: RegExp; + IPV4ADDRESS: RegExp; + IPV6ADDRESS: RegExp; +} +export declare const SCHEMES: { + [scheme: string]: URISchemeHandler; +}; +export declare function pctEncChar(chr: string): string; +export declare function pctDecChars(str: string): string; +export declare function parse(uriString: string, options?: URIOptions): URIComponents; +export declare function removeDotSegments(input: string): string; +export declare function serialize(components: URIComponents, options?: URIOptions): string; +export declare function resolveComponents(base: URIComponents, relative: URIComponents, options?: URIOptions, skipNormalization?: boolean): URIComponents; +export declare function resolve(baseURI: string, relativeURI: string, options?: URIOptions): string; +export declare function normalize(uri: string, options?: URIOptions): string; +export declare function normalize(uri: URIComponents, options?: URIOptions): URIComponents; +export declare function equal(uriA: string, uriB: string, options?: URIOptions): boolean; +export declare function equal(uriA: URIComponents, uriB: URIComponents, options?: URIOptions): boolean; +export declare function escapeComponent(str: string, options?: URIOptions): string; +export declare function unescapeComponent(str: string, options?: URIOptions): string; diff --git a/deps/npm/node_modules/uri-js/dist/es5/uri.all.min.js b/deps/npm/node_modules/uri-js/dist/es5/uri.all.min.js new file mode 100755 index 00000000000000..09edffb7ccbb63 --- /dev/null +++ b/deps/npm/node_modules/uri-js/dist/es5/uri.all.min.js @@ -0,0 +1,3 @@ +/** @license URI.js v4.4.0 (c) 2011 Gary Court. License: http://github.com/garycourt/uri-js */ +!function(e,r){"object"==typeof exports&&"undefined"!=typeof module?r(exports):"function"==typeof define&&define.amd?define(["exports"],r):r(e.URI=e.URI||{})}(this,function(e){"use strict";function r(){for(var e=arguments.length,r=Array(e),n=0;n1){r[0]=r[0].slice(0,-1);for(var t=r.length-1,o=1;o1&&(t=n[0]+"@",e=n[1]),e=e.replace(j,"."),t+f(e.split("."),r).join(".")}function p(e){for(var r=[],n=0,t=e.length;n=55296&&o<=56319&&n>6|192).toString(16).toUpperCase()+"%"+(63&r|128).toString(16).toUpperCase():"%"+(r>>12|224).toString(16).toUpperCase()+"%"+(r>>6&63|128).toString(16).toUpperCase()+"%"+(63&r|128).toString(16).toUpperCase()}function d(e){for(var r="",n=0,t=e.length;n=194&&o<224){if(t-n>=6){var a=parseInt(e.substr(n+4,2),16);r+=String.fromCharCode((31&o)<<6|63&a)}else r+=e.substr(n,6);n+=6}else if(o>=224){if(t-n>=9){var i=parseInt(e.substr(n+4,2),16),u=parseInt(e.substr(n+7,2),16);r+=String.fromCharCode((15&o)<<12|(63&i)<<6|63&u)}else r+=e.substr(n,9);n+=9}else r+=e.substr(n,3),n+=3}return r}function l(e,r){function n(e){var n=d(e);return n.match(r.UNRESERVED)?n:e}return e.scheme&&(e.scheme=String(e.scheme).replace(r.PCT_ENCODED,n).toLowerCase().replace(r.NOT_SCHEME,"")),e.userinfo!==undefined&&(e.userinfo=String(e.userinfo).replace(r.PCT_ENCODED,n).replace(r.NOT_USERINFO,h).replace(r.PCT_ENCODED,o)),e.host!==undefined&&(e.host=String(e.host).replace(r.PCT_ENCODED,n).toLowerCase().replace(r.NOT_HOST,h).replace(r.PCT_ENCODED,o)),e.path!==undefined&&(e.path=String(e.path).replace(r.PCT_ENCODED,n).replace(e.scheme?r.NOT_PATH:r.NOT_PATH_NOSCHEME,h).replace(r.PCT_ENCODED,o)),e.query!==undefined&&(e.query=String(e.query).replace(r.PCT_ENCODED,n).replace(r.NOT_QUERY,h).replace(r.PCT_ENCODED,o)),e.fragment!==undefined&&(e.fragment=String(e.fragment).replace(r.PCT_ENCODED,n).replace(r.NOT_FRAGMENT,h).replace(r.PCT_ENCODED,o)),e}function m(e){return e.replace(/^0*(.*)/,"$1")||"0"}function g(e,r){var n=e.match(r.IPV4ADDRESS)||[],t=T(n,2),o=t[1];return o?o.split(".").map(m).join("."):e}function v(e,r){var n=e.match(r.IPV6ADDRESS)||[],t=T(n,3),o=t[1],a=t[2];if(o){for(var i=o.toLowerCase().split("::").reverse(),u=T(i,2),s=u[0],f=u[1],c=f?f.split(":").map(m):[],p=s.split(":").map(m),h=r.IPV4ADDRESS.test(p[p.length-1]),d=h?7:8,l=p.length-d,v=Array(d),E=0;E1){var A=v.slice(0,y.index),D=v.slice(y.index+y.length);S=A.join(":")+"::"+D.join(":")}else S=v.join(":");return a&&(S+="%"+a),S}return e}function E(e){var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},n={},t=!1!==r.iri?R:F;"suffix"===r.reference&&(e=(r.scheme?r.scheme+":":"")+"//"+e);var o=e.match(K);if(o){W?(n.scheme=o[1],n.userinfo=o[3],n.host=o[4],n.port=parseInt(o[5],10),n.path=o[6]||"",n.query=o[7],n.fragment=o[8],isNaN(n.port)&&(n.port=o[5])):(n.scheme=o[1]||undefined,n.userinfo=-1!==e.indexOf("@")?o[3]:undefined,n.host=-1!==e.indexOf("//")?o[4]:undefined,n.port=parseInt(o[5],10),n.path=o[6]||"",n.query=-1!==e.indexOf("?")?o[7]:undefined,n.fragment=-1!==e.indexOf("#")?o[8]:undefined,isNaN(n.port)&&(n.port=e.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/)?o[4]:undefined)),n.host&&(n.host=v(g(n.host,t),t)),n.scheme!==undefined||n.userinfo!==undefined||n.host!==undefined||n.port!==undefined||n.path||n.query!==undefined?n.scheme===undefined?n.reference="relative":n.fragment===undefined?n.reference="absolute":n.reference="uri":n.reference="same-document",r.reference&&"suffix"!==r.reference&&r.reference!==n.reference&&(n.error=n.error||"URI is not a "+r.reference+" reference.");var a=J[(r.scheme||n.scheme||"").toLowerCase()];if(r.unicodeSupport||a&&a.unicodeSupport)l(n,t);else{if(n.host&&(r.domainHost||a&&a.domainHost))try{n.host=B.toASCII(n.host.replace(t.PCT_ENCODED,d).toLowerCase())}catch(i){n.error=n.error||"Host's domain name can not be converted to ASCII via punycode: "+i}l(n,F)}a&&a.parse&&a.parse(n,r)}else n.error=n.error||"URI can not be parsed.";return n}function C(e,r){var n=!1!==r.iri?R:F,t=[];return e.userinfo!==undefined&&(t.push(e.userinfo),t.push("@")),e.host!==undefined&&t.push(v(g(String(e.host),n),n).replace(n.IPV6ADDRESS,function(e,r,n){return"["+r+(n?"%25"+n:"")+"]"})),"number"!=typeof e.port&&"string"!=typeof e.port||(t.push(":"),t.push(String(e.port))),t.length?t.join(""):undefined}function y(e){for(var r=[];e.length;)if(e.match(X))e=e.replace(X,"");else if(e.match(ee))e=e.replace(ee,"/");else if(e.match(re))e=e.replace(re,"/"),r.pop();else if("."===e||".."===e)e="";else{var n=e.match(ne);if(!n)throw new Error("Unexpected dot segment condition");var t=n[0];e=e.slice(t.length),r.push(t)}return r.join("")}function S(e){var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},n=r.iri?R:F,t=[],o=J[(r.scheme||e.scheme||"").toLowerCase()];if(o&&o.serialize&&o.serialize(e,r),e.host)if(n.IPV6ADDRESS.test(e.host));else if(r.domainHost||o&&o.domainHost)try{e.host=r.iri?B.toUnicode(e.host):B.toASCII(e.host.replace(n.PCT_ENCODED,d).toLowerCase())}catch(u){e.error=e.error||"Host's domain name can not be converted to "+(r.iri?"Unicode":"ASCII")+" via punycode: "+u}l(e,n),"suffix"!==r.reference&&e.scheme&&(t.push(e.scheme),t.push(":"));var a=C(e,r);if(a!==undefined&&("suffix"!==r.reference&&t.push("//"),t.push(a),e.path&&"/"!==e.path.charAt(0)&&t.push("/")),e.path!==undefined){var i=e.path;r.absolutePath||o&&o.absolutePath||(i=y(i)),a===undefined&&(i=i.replace(/^\/\//,"/%2F")),t.push(i)}return e.query!==undefined&&(t.push("?"),t.push(e.query)),e.fragment!==undefined&&(t.push("#"),t.push(e.fragment)),t.join("")}function A(e,r){var n=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{},t=arguments[3],o={};return t||(e=E(S(e,n),n),r=E(S(r,n),n)),n=n||{},!n.tolerant&&r.scheme?(o.scheme=r.scheme,o.userinfo=r.userinfo,o.host=r.host,o.port=r.port,o.path=y(r.path||""),o.query=r.query):(r.userinfo!==undefined||r.host!==undefined||r.port!==undefined?(o.userinfo=r.userinfo,o.host=r.host,o.port=r.port,o.path=y(r.path||""),o.query=r.query):(r.path?("/"===r.path.charAt(0)?o.path=y(r.path):(e.userinfo===undefined&&e.host===undefined&&e.port===undefined||e.path?e.path?o.path=e.path.slice(0,e.path.lastIndexOf("/")+1)+r.path:o.path=r.path:o.path="/"+r.path,o.path=y(o.path)),o.query=r.query):(o.path=e.path,r.query!==undefined?o.query=r.query:o.query=e.query),o.userinfo=e.userinfo,o.host=e.host,o.port=e.port),o.scheme=e.scheme),o.fragment=r.fragment,o}function D(e,r,n){var t=i({scheme:"null"},n);return S(A(E(e,t),E(r,t),t,!0),t)}function w(e,r){return"string"==typeof e?e=S(E(e,r),r):"object"===t(e)&&(e=E(S(e,r),r)),e}function b(e,r,n){return"string"==typeof e?e=S(E(e,n),n):"object"===t(e)&&(e=S(e,n)),"string"==typeof r?r=S(E(r,n),n):"object"===t(r)&&(r=S(r,n)),e===r}function x(e,r){return e&&e.toString().replace(r&&r.iri?R.ESCAPE:F.ESCAPE,h)}function O(e,r){return e&&e.toString().replace(r&&r.iri?R.PCT_ENCODED:F.PCT_ENCODED,d)}function N(e){return"boolean"==typeof e.secure?e.secure:"wss"===String(e.scheme).toLowerCase()}function I(e){var r=d(e);return r.match(he)?r:e}var F=u(!1),R=u(!0),T=function(){function e(e,r){var n=[],t=!0,o=!1,a=undefined;try{for(var i,u=e[Symbol.iterator]();!(t=(i=u.next()).done)&&(n.push(i.value),!r||n.length!==r);t=!0);}catch(s){o=!0,a=s}finally{try{!t&&u["return"]&&u["return"]()}finally{if(o)throw a}}return n}return function(r,n){if(Array.isArray(r))return r;if(Symbol.iterator in Object(r))return e(r,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),_=function(e){if(Array.isArray(e)){for(var r=0,n=Array(e.length);r= 0x80 (not a basic code point)","invalid-input":"Invalid input"},z=Math.floor,L=String.fromCharCode,$=function(e){return String.fromCodePoint.apply(String,_(e))},M=function(e){return e-48<10?e-22:e-65<26?e-65:e-97<26?e-97:36},V=function(e,r){return e+22+75*(e<26)-((0!=r)<<5)},k=function(e,r,n){var t=0;for(e=n?z(e/700):e>>1,e+=z(e/r);e>455;t+=36)e=z(e/35);return z(t+36*e/(e+38))},Z=function(e){var r=[],n=e.length,t=0,o=128,a=72,i=e.lastIndexOf("-");i<0&&(i=0);for(var u=0;u=128&&s("not-basic"),r.push(e.charCodeAt(u));for(var f=i>0?i+1:0;f=n&&s("invalid-input");var d=M(e.charCodeAt(f++));(d>=36||d>z((P-t)/p))&&s("overflow"),t+=d*p;var l=h<=a?1:h>=a+26?26:h-a;if(dz(P/m)&&s("overflow"),p*=m}var g=r.length+1;a=k(t-c,g,0==c),z(t/g)>P-o&&s("overflow"),o+=z(t/g),t%=g,r.splice(t++,0,o)}return String.fromCodePoint.apply(String,r)},G=function(e){var r=[];e=p(e);var n=e.length,t=128,o=0,a=72,i=!0,u=!1,f=undefined;try{for(var c,h=e[Symbol.iterator]();!(i=(c=h.next()).done);i=!0){var d=c.value;d<128&&r.push(L(d))}}catch(U){u=!0,f=U}finally{try{!i&&h["return"]&&h["return"]()}finally{if(u)throw f}}var l=r.length,m=l;for(l&&r.push("-");m=t&&Az((P-o)/D)&&s("overflow"),o+=(g-t)*D,t=g;var w=!0,b=!1,x=undefined;try{for(var O,N=e[Symbol.iterator]();!(w=(O=N.next()).done);w=!0){var I=O.value;if(IP&&s("overflow"),I==t){for(var F=o,R=36;;R+=36){var T=R<=a?1:R>=a+26?26:R-a;if(FA-Z\\x5E-\\x7E]",'[\\"\\\\]'),he=new RegExp(se,"g"),de=new RegExp(ce,"g"),le=new RegExp(r("[^]","[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]","[\\.]",'[\\"]',pe),"g"),me=new RegExp(r("[^]",se,"[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]"),"g"),ge=me,ve={scheme:"mailto",parse:function(e,r){var n=e,t=n.to=n.path?n.path.split(","):[];if(n.path=undefined,n.query){for(var o=!1,a={},i=n.query.split("&"),u=0,s=i.length;u):string {\n\tif (sets.length > 1) {\n\t\tsets[0] = sets[0].slice(0, -1);\n\t\tconst xl = sets.length - 1;\n\t\tfor (let x = 1; x < xl; ++x) {\n\t\t\tsets[x] = sets[x].slice(1, -1);\n\t\t}\n\t\tsets[xl] = sets[xl].slice(1);\n\t\treturn sets.join('');\n\t} else {\n\t\treturn sets[0];\n\t}\n}\n\nexport function subexp(str:string):string {\n\treturn \"(?:\" + str + \")\";\n}\n\nexport function typeOf(o:any):string {\n\treturn o === undefined ? \"undefined\" : (o === null ? \"null\" : Object.prototype.toString.call(o).split(\" \").pop().split(\"]\").shift().toLowerCase());\n}\n\nexport function toUpperCase(str:string):string {\n\treturn str.toUpperCase();\n}\n\nexport function toArray(obj:any):Array {\n\treturn obj !== undefined && obj !== null ? (obj instanceof Array ? obj : (typeof obj.length !== \"number\" || obj.split || obj.setInterval || obj.call ? [obj] : Array.prototype.slice.call(obj))) : [];\n}\n\n\nexport function assign(target: object, source: any): any {\n\tconst obj = target as any;\n\tif (source) {\n\t\tfor (const key in source) {\n\t\t\tobj[key] = source[key];\n\t\t}\n\t}\n\treturn obj;\n}","import { URIRegExps } from \"./uri\";\nimport { merge, subexp } from \"./util\";\n\nexport function buildExps(isIRI:boolean):URIRegExps {\n\tconst\n\t\tALPHA$$ = \"[A-Za-z]\",\n\t\tCR$ = \"[\\\\x0D]\",\n\t\tDIGIT$$ = \"[0-9]\",\n\t\tDQUOTE$$ = \"[\\\\x22]\",\n\t\tHEXDIG$$ = merge(DIGIT$$, \"[A-Fa-f]\"), //case-insensitive\n\t\tLF$$ = \"[\\\\x0A]\",\n\t\tSP$$ = \"[\\\\x20]\",\n\t\tPCT_ENCODED$ = subexp(subexp(\"%[EFef]\" + HEXDIG$$ + \"%\" + HEXDIG$$ + HEXDIG$$ + \"%\" + HEXDIG$$ + HEXDIG$$) + \"|\" + subexp(\"%[89A-Fa-f]\" + HEXDIG$$ + \"%\" + HEXDIG$$ + HEXDIG$$) + \"|\" + subexp(\"%\" + HEXDIG$$ + HEXDIG$$)), //expanded\n\t\tGEN_DELIMS$$ = \"[\\\\:\\\\/\\\\?\\\\#\\\\[\\\\]\\\\@]\",\n\t\tSUB_DELIMS$$ = \"[\\\\!\\\\$\\\\&\\\\'\\\\(\\\\)\\\\*\\\\+\\\\,\\\\;\\\\=]\",\n\t\tRESERVED$$ = merge(GEN_DELIMS$$, SUB_DELIMS$$),\n\t\tUCSCHAR$$ = isIRI ? \"[\\\\xA0-\\\\u200D\\\\u2010-\\\\u2029\\\\u202F-\\\\uD7FF\\\\uF900-\\\\uFDCF\\\\uFDF0-\\\\uFFEF]\" : \"[]\", //subset, excludes bidi control characters\n\t\tIPRIVATE$$ = isIRI ? \"[\\\\uE000-\\\\uF8FF]\" : \"[]\", //subset\n\t\tUNRESERVED$$ = merge(ALPHA$$, DIGIT$$, \"[\\\\-\\\\.\\\\_\\\\~]\", UCSCHAR$$),\n\t\tSCHEME$ = subexp(ALPHA$$ + merge(ALPHA$$, DIGIT$$, \"[\\\\+\\\\-\\\\.]\") + \"*\"),\n\t\tUSERINFO$ = subexp(subexp(PCT_ENCODED$ + \"|\" + merge(UNRESERVED$$, SUB_DELIMS$$, \"[\\\\:]\")) + \"*\"),\n\t\tDEC_OCTET$ = subexp(subexp(\"25[0-5]\") + \"|\" + subexp(\"2[0-4]\" + DIGIT$$) + \"|\" + subexp(\"1\" + DIGIT$$ + DIGIT$$) + \"|\" + subexp(\"[1-9]\" + DIGIT$$) + \"|\" + DIGIT$$),\n\t\tDEC_OCTET_RELAXED$ = subexp(subexp(\"25[0-5]\") + \"|\" + subexp(\"2[0-4]\" + DIGIT$$) + \"|\" + subexp(\"1\" + DIGIT$$ + DIGIT$$) + \"|\" + subexp(\"0?[1-9]\" + DIGIT$$) + \"|0?0?\" + DIGIT$$), //relaxed parsing rules\n\t\tIPV4ADDRESS$ = subexp(DEC_OCTET_RELAXED$ + \"\\\\.\" + DEC_OCTET_RELAXED$ + \"\\\\.\" + DEC_OCTET_RELAXED$ + \"\\\\.\" + DEC_OCTET_RELAXED$),\n\t\tH16$ = subexp(HEXDIG$$ + \"{1,4}\"),\n\t\tLS32$ = subexp(subexp(H16$ + \"\\\\:\" + H16$) + \"|\" + IPV4ADDRESS$),\n\t\tIPV6ADDRESS1$ = subexp( subexp(H16$ + \"\\\\:\") + \"{6}\" + LS32$), // 6( h16 \":\" ) ls32\n\t\tIPV6ADDRESS2$ = subexp( \"\\\\:\\\\:\" + subexp(H16$ + \"\\\\:\") + \"{5}\" + LS32$), // \"::\" 5( h16 \":\" ) ls32\n\t\tIPV6ADDRESS3$ = subexp(subexp( H16$) + \"?\\\\:\\\\:\" + subexp(H16$ + \"\\\\:\") + \"{4}\" + LS32$), //[ h16 ] \"::\" 4( h16 \":\" ) ls32\n\t\tIPV6ADDRESS4$ = subexp(subexp(subexp(H16$ + \"\\\\:\") + \"{0,1}\" + H16$) + \"?\\\\:\\\\:\" + subexp(H16$ + \"\\\\:\") + \"{3}\" + LS32$), //[ *1( h16 \":\" ) h16 ] \"::\" 3( h16 \":\" ) ls32\n\t\tIPV6ADDRESS5$ = subexp(subexp(subexp(H16$ + \"\\\\:\") + \"{0,2}\" + H16$) + \"?\\\\:\\\\:\" + subexp(H16$ + \"\\\\:\") + \"{2}\" + LS32$), //[ *2( h16 \":\" ) h16 ] \"::\" 2( h16 \":\" ) ls32\n\t\tIPV6ADDRESS6$ = subexp(subexp(subexp(H16$ + \"\\\\:\") + \"{0,3}\" + H16$) + \"?\\\\:\\\\:\" + H16$ + \"\\\\:\" + LS32$), //[ *3( h16 \":\" ) h16 ] \"::\" h16 \":\" ls32\n\t\tIPV6ADDRESS7$ = subexp(subexp(subexp(H16$ + \"\\\\:\") + \"{0,4}\" + H16$) + \"?\\\\:\\\\:\" + LS32$), //[ *4( h16 \":\" ) h16 ] \"::\" ls32\n\t\tIPV6ADDRESS8$ = subexp(subexp(subexp(H16$ + \"\\\\:\") + \"{0,5}\" + H16$) + \"?\\\\:\\\\:\" + H16$ ), //[ *5( h16 \":\" ) h16 ] \"::\" h16\n\t\tIPV6ADDRESS9$ = subexp(subexp(subexp(H16$ + \"\\\\:\") + \"{0,6}\" + H16$) + \"?\\\\:\\\\:\" ), //[ *6( h16 \":\" ) h16 ] \"::\"\n\t\tIPV6ADDRESS$ = subexp([IPV6ADDRESS1$, IPV6ADDRESS2$, IPV6ADDRESS3$, IPV6ADDRESS4$, IPV6ADDRESS5$, IPV6ADDRESS6$, IPV6ADDRESS7$, IPV6ADDRESS8$, IPV6ADDRESS9$].join(\"|\")),\n\t\tZONEID$ = subexp(subexp(UNRESERVED$$ + \"|\" + PCT_ENCODED$) + \"+\"), //RFC 6874\n\t\tIPV6ADDRZ$ = subexp(IPV6ADDRESS$ + \"\\\\%25\" + ZONEID$), //RFC 6874\n\t\tIPV6ADDRZ_RELAXED$ = subexp(IPV6ADDRESS$ + subexp(\"\\\\%25|\\\\%(?!\" + HEXDIG$$ + \"{2})\") + ZONEID$), //RFC 6874, with relaxed parsing rules\n\t\tIPVFUTURE$ = subexp(\"[vV]\" + HEXDIG$$ + \"+\\\\.\" + merge(UNRESERVED$$, SUB_DELIMS$$, \"[\\\\:]\") + \"+\"),\n\t\tIP_LITERAL$ = subexp(\"\\\\[\" + subexp(IPV6ADDRZ_RELAXED$ + \"|\" + IPV6ADDRESS$ + \"|\" + IPVFUTURE$) + \"\\\\]\"), //RFC 6874\n\t\tREG_NAME$ = subexp(subexp(PCT_ENCODED$ + \"|\" + merge(UNRESERVED$$, SUB_DELIMS$$)) + \"*\"),\n\t\tHOST$ = subexp(IP_LITERAL$ + \"|\" + IPV4ADDRESS$ + \"(?!\" + REG_NAME$ + \")\" + \"|\" + REG_NAME$),\n\t\tPORT$ = subexp(DIGIT$$ + \"*\"),\n\t\tAUTHORITY$ = subexp(subexp(USERINFO$ + \"@\") + \"?\" + HOST$ + subexp(\"\\\\:\" + PORT$) + \"?\"),\n\t\tPCHAR$ = subexp(PCT_ENCODED$ + \"|\" + merge(UNRESERVED$$, SUB_DELIMS$$, \"[\\\\:\\\\@]\")),\n\t\tSEGMENT$ = subexp(PCHAR$ + \"*\"),\n\t\tSEGMENT_NZ$ = subexp(PCHAR$ + \"+\"),\n\t\tSEGMENT_NZ_NC$ = subexp(subexp(PCT_ENCODED$ + \"|\" + merge(UNRESERVED$$, SUB_DELIMS$$, \"[\\\\@]\")) + \"+\"),\n\t\tPATH_ABEMPTY$ = subexp(subexp(\"\\\\/\" + SEGMENT$) + \"*\"),\n\t\tPATH_ABSOLUTE$ = subexp(\"\\\\/\" + subexp(SEGMENT_NZ$ + PATH_ABEMPTY$) + \"?\"), //simplified\n\t\tPATH_NOSCHEME$ = subexp(SEGMENT_NZ_NC$ + PATH_ABEMPTY$), //simplified\n\t\tPATH_ROOTLESS$ = subexp(SEGMENT_NZ$ + PATH_ABEMPTY$), //simplified\n\t\tPATH_EMPTY$ = \"(?!\" + PCHAR$ + \")\",\n\t\tPATH$ = subexp(PATH_ABEMPTY$ + \"|\" + PATH_ABSOLUTE$ + \"|\" + PATH_NOSCHEME$ + \"|\" + PATH_ROOTLESS$ + \"|\" + PATH_EMPTY$),\n\t\tQUERY$ = subexp(subexp(PCHAR$ + \"|\" + merge(\"[\\\\/\\\\?]\", IPRIVATE$$)) + \"*\"),\n\t\tFRAGMENT$ = subexp(subexp(PCHAR$ + \"|[\\\\/\\\\?]\") + \"*\"),\n\t\tHIER_PART$ = subexp(subexp(\"\\\\/\\\\/\" + AUTHORITY$ + PATH_ABEMPTY$) + \"|\" + PATH_ABSOLUTE$ + \"|\" + PATH_ROOTLESS$ + \"|\" + PATH_EMPTY$),\n\t\tURI$ = subexp(SCHEME$ + \"\\\\:\" + HIER_PART$ + subexp(\"\\\\?\" + QUERY$) + \"?\" + subexp(\"\\\\#\" + FRAGMENT$) + \"?\"),\n\t\tRELATIVE_PART$ = subexp(subexp(\"\\\\/\\\\/\" + AUTHORITY$ + PATH_ABEMPTY$) + \"|\" + PATH_ABSOLUTE$ + \"|\" + PATH_NOSCHEME$ + \"|\" + PATH_EMPTY$),\n\t\tRELATIVE$ = subexp(RELATIVE_PART$ + subexp(\"\\\\?\" + QUERY$) + \"?\" + subexp(\"\\\\#\" + FRAGMENT$) + \"?\"),\n\t\tURI_REFERENCE$ = subexp(URI$ + \"|\" + RELATIVE$),\n\t\tABSOLUTE_URI$ = subexp(SCHEME$ + \"\\\\:\" + HIER_PART$ + subexp(\"\\\\?\" + QUERY$) + \"?\"),\n\n\t\tGENERIC_REF$ = \"^(\" + SCHEME$ + \")\\\\:\" + subexp(subexp(\"\\\\/\\\\/(\" + subexp(\"(\" + USERINFO$ + \")@\") + \"?(\" + HOST$ + \")\" + subexp(\"\\\\:(\" + PORT$ + \")\") + \"?)\") + \"?(\" + PATH_ABEMPTY$ + \"|\" + PATH_ABSOLUTE$ + \"|\" + PATH_ROOTLESS$ + \"|\" + PATH_EMPTY$ + \")\") + subexp(\"\\\\?(\" + QUERY$ + \")\") + \"?\" + subexp(\"\\\\#(\" + FRAGMENT$ + \")\") + \"?$\",\n\t\tRELATIVE_REF$ = \"^(){0}\" + subexp(subexp(\"\\\\/\\\\/(\" + subexp(\"(\" + USERINFO$ + \")@\") + \"?(\" + HOST$ + \")\" + subexp(\"\\\\:(\" + PORT$ + \")\") + \"?)\") + \"?(\" + PATH_ABEMPTY$ + \"|\" + PATH_ABSOLUTE$ + \"|\" + PATH_NOSCHEME$ + \"|\" + PATH_EMPTY$ + \")\") + subexp(\"\\\\?(\" + QUERY$ + \")\") + \"?\" + subexp(\"\\\\#(\" + FRAGMENT$ + \")\") + \"?$\",\n\t\tABSOLUTE_REF$ = \"^(\" + SCHEME$ + \")\\\\:\" + subexp(subexp(\"\\\\/\\\\/(\" + subexp(\"(\" + USERINFO$ + \")@\") + \"?(\" + HOST$ + \")\" + subexp(\"\\\\:(\" + PORT$ + \")\") + \"?)\") + \"?(\" + PATH_ABEMPTY$ + \"|\" + PATH_ABSOLUTE$ + \"|\" + PATH_ROOTLESS$ + \"|\" + PATH_EMPTY$ + \")\") + subexp(\"\\\\?(\" + QUERY$ + \")\") + \"?$\",\n\t\tSAMEDOC_REF$ = \"^\" + subexp(\"\\\\#(\" + FRAGMENT$ + \")\") + \"?$\",\n\t\tAUTHORITY_REF$ = \"^\" + subexp(\"(\" + USERINFO$ + \")@\") + \"?(\" + HOST$ + \")\" + subexp(\"\\\\:(\" + PORT$ + \")\") + \"?$\"\n\t;\n\n\treturn {\n\t\tNOT_SCHEME : new RegExp(merge(\"[^]\", ALPHA$$, DIGIT$$, \"[\\\\+\\\\-\\\\.]\"), \"g\"),\n\t\tNOT_USERINFO : new RegExp(merge(\"[^\\\\%\\\\:]\", UNRESERVED$$, SUB_DELIMS$$), \"g\"),\n\t\tNOT_HOST : new RegExp(merge(\"[^\\\\%\\\\[\\\\]\\\\:]\", UNRESERVED$$, SUB_DELIMS$$), \"g\"),\n\t\tNOT_PATH : new RegExp(merge(\"[^\\\\%\\\\/\\\\:\\\\@]\", UNRESERVED$$, SUB_DELIMS$$), \"g\"),\n\t\tNOT_PATH_NOSCHEME : new RegExp(merge(\"[^\\\\%\\\\/\\\\@]\", UNRESERVED$$, SUB_DELIMS$$), \"g\"),\n\t\tNOT_QUERY : new RegExp(merge(\"[^\\\\%]\", UNRESERVED$$, SUB_DELIMS$$, \"[\\\\:\\\\@\\\\/\\\\?]\", IPRIVATE$$), \"g\"),\n\t\tNOT_FRAGMENT : new RegExp(merge(\"[^\\\\%]\", UNRESERVED$$, SUB_DELIMS$$, \"[\\\\:\\\\@\\\\/\\\\?]\"), \"g\"),\n\t\tESCAPE : new RegExp(merge(\"[^]\", UNRESERVED$$, SUB_DELIMS$$), \"g\"),\n\t\tUNRESERVED : new RegExp(UNRESERVED$$, \"g\"),\n\t\tOTHER_CHARS : new RegExp(merge(\"[^\\\\%]\", UNRESERVED$$, RESERVED$$), \"g\"),\n\t\tPCT_ENCODED : new RegExp(PCT_ENCODED$, \"g\"),\n\t\tIPV4ADDRESS : new RegExp(\"^(\" + IPV4ADDRESS$ + \")$\"),\n\t\tIPV6ADDRESS : new RegExp(\"^\\\\[?(\" + IPV6ADDRESS$ + \")\" + subexp(subexp(\"\\\\%25|\\\\%(?!\" + HEXDIG$$ + \"{2})\") + \"(\" + ZONEID$ + \")\") + \"?\\\\]?$\") //RFC 6874, with relaxed parsing rules\n\t};\n}\n\nexport default buildExps(false);\n","'use strict';\n\n/** Highest positive signed 32-bit float value */\nconst maxInt = 2147483647; // aka. 0x7FFFFFFF or 2^31-1\n\n/** Bootstring parameters */\nconst base = 36;\nconst tMin = 1;\nconst tMax = 26;\nconst skew = 38;\nconst damp = 700;\nconst initialBias = 72;\nconst initialN = 128; // 0x80\nconst delimiter = '-'; // '\\x2D'\n\n/** Regular expressions */\nconst regexPunycode = /^xn--/;\nconst regexNonASCII = /[^\\0-\\x7E]/; // non-ASCII chars\nconst regexSeparators = /[\\x2E\\u3002\\uFF0E\\uFF61]/g; // RFC 3490 separators\n\n/** Error messages */\nconst errors = {\n\t'overflow': 'Overflow: input needs wider integers to process',\n\t'not-basic': 'Illegal input >= 0x80 (not a basic code point)',\n\t'invalid-input': 'Invalid input'\n};\n\n/** Convenience shortcuts */\nconst baseMinusTMin = base - tMin;\nconst floor = Math.floor;\nconst stringFromCharCode = String.fromCharCode;\n\n/*--------------------------------------------------------------------------*/\n\n/**\n * A generic error utility function.\n * @private\n * @param {String} type The error type.\n * @returns {Error} Throws a `RangeError` with the applicable error message.\n */\nfunction error(type) {\n\tthrow new RangeError(errors[type]);\n}\n\n/**\n * A generic `Array#map` utility function.\n * @private\n * @param {Array} array The array to iterate over.\n * @param {Function} callback The function that gets called for every array\n * item.\n * @returns {Array} A new array of values returned by the callback function.\n */\nfunction map(array, fn) {\n\tconst result = [];\n\tlet length = array.length;\n\twhile (length--) {\n\t\tresult[length] = fn(array[length]);\n\t}\n\treturn result;\n}\n\n/**\n * A simple `Array#map`-like wrapper to work with domain name strings or email\n * addresses.\n * @private\n * @param {String} domain The domain name or email address.\n * @param {Function} callback The function that gets called for every\n * character.\n * @returns {Array} A new string of characters returned by the callback\n * function.\n */\nfunction mapDomain(string, fn) {\n\tconst parts = string.split('@');\n\tlet result = '';\n\tif (parts.length > 1) {\n\t\t// In email addresses, only the domain name should be punycoded. Leave\n\t\t// the local part (i.e. everything up to `@`) intact.\n\t\tresult = parts[0] + '@';\n\t\tstring = parts[1];\n\t}\n\t// Avoid `split(regex)` for IE8 compatibility. See #17.\n\tstring = string.replace(regexSeparators, '\\x2E');\n\tconst labels = string.split('.');\n\tconst encoded = map(labels, fn).join('.');\n\treturn result + encoded;\n}\n\n/**\n * Creates an array containing the numeric code points of each Unicode\n * character in the string. While JavaScript uses UCS-2 internally,\n * this function will convert a pair of surrogate halves (each of which\n * UCS-2 exposes as separate characters) into a single code point,\n * matching UTF-16.\n * @see `punycode.ucs2.encode`\n * @see \n * @memberOf punycode.ucs2\n * @name decode\n * @param {String} string The Unicode input string (UCS-2).\n * @returns {Array} The new array of code points.\n */\nfunction ucs2decode(string) {\n\tconst output = [];\n\tlet counter = 0;\n\tconst length = string.length;\n\twhile (counter < length) {\n\t\tconst value = string.charCodeAt(counter++);\n\t\tif (value >= 0xD800 && value <= 0xDBFF && counter < length) {\n\t\t\t// It's a high surrogate, and there is a next character.\n\t\t\tconst extra = string.charCodeAt(counter++);\n\t\t\tif ((extra & 0xFC00) == 0xDC00) { // Low surrogate.\n\t\t\t\toutput.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000);\n\t\t\t} else {\n\t\t\t\t// It's an unmatched surrogate; only append this code unit, in case the\n\t\t\t\t// next code unit is the high surrogate of a surrogate pair.\n\t\t\t\toutput.push(value);\n\t\t\t\tcounter--;\n\t\t\t}\n\t\t} else {\n\t\t\toutput.push(value);\n\t\t}\n\t}\n\treturn output;\n}\n\n/**\n * Creates a string based on an array of numeric code points.\n * @see `punycode.ucs2.decode`\n * @memberOf punycode.ucs2\n * @name encode\n * @param {Array} codePoints The array of numeric code points.\n * @returns {String} The new Unicode string (UCS-2).\n */\nconst ucs2encode = array => String.fromCodePoint(...array);\n\n/**\n * Converts a basic code point into a digit/integer.\n * @see `digitToBasic()`\n * @private\n * @param {Number} codePoint The basic numeric code point value.\n * @returns {Number} The numeric value of a basic code point (for use in\n * representing integers) in the range `0` to `base - 1`, or `base` if\n * the code point does not represent a value.\n */\nconst basicToDigit = function(codePoint) {\n\tif (codePoint - 0x30 < 0x0A) {\n\t\treturn codePoint - 0x16;\n\t}\n\tif (codePoint - 0x41 < 0x1A) {\n\t\treturn codePoint - 0x41;\n\t}\n\tif (codePoint - 0x61 < 0x1A) {\n\t\treturn codePoint - 0x61;\n\t}\n\treturn base;\n};\n\n/**\n * Converts a digit/integer into a basic code point.\n * @see `basicToDigit()`\n * @private\n * @param {Number} digit The numeric value of a basic code point.\n * @returns {Number} The basic code point whose value (when used for\n * representing integers) is `digit`, which needs to be in the range\n * `0` to `base - 1`. If `flag` is non-zero, the uppercase form is\n * used; else, the lowercase form is used. The behavior is undefined\n * if `flag` is non-zero and `digit` has no uppercase form.\n */\nconst digitToBasic = function(digit, flag) {\n\t// 0..25 map to ASCII a..z or A..Z\n\t// 26..35 map to ASCII 0..9\n\treturn digit + 22 + 75 * (digit < 26) - ((flag != 0) << 5);\n};\n\n/**\n * Bias adaptation function as per section 3.4 of RFC 3492.\n * https://tools.ietf.org/html/rfc3492#section-3.4\n * @private\n */\nconst adapt = function(delta, numPoints, firstTime) {\n\tlet k = 0;\n\tdelta = firstTime ? floor(delta / damp) : delta >> 1;\n\tdelta += floor(delta / numPoints);\n\tfor (/* no initialization */; delta > baseMinusTMin * tMax >> 1; k += base) {\n\t\tdelta = floor(delta / baseMinusTMin);\n\t}\n\treturn floor(k + (baseMinusTMin + 1) * delta / (delta + skew));\n};\n\n/**\n * Converts a Punycode string of ASCII-only symbols to a string of Unicode\n * symbols.\n * @memberOf punycode\n * @param {String} input The Punycode string of ASCII-only symbols.\n * @returns {String} The resulting string of Unicode symbols.\n */\nconst decode = function(input) {\n\t// Don't use UCS-2.\n\tconst output = [];\n\tconst inputLength = input.length;\n\tlet i = 0;\n\tlet n = initialN;\n\tlet bias = initialBias;\n\n\t// Handle the basic code points: let `basic` be the number of input code\n\t// points before the last delimiter, or `0` if there is none, then copy\n\t// the first basic code points to the output.\n\n\tlet basic = input.lastIndexOf(delimiter);\n\tif (basic < 0) {\n\t\tbasic = 0;\n\t}\n\n\tfor (let j = 0; j < basic; ++j) {\n\t\t// if it's not a basic code point\n\t\tif (input.charCodeAt(j) >= 0x80) {\n\t\t\terror('not-basic');\n\t\t}\n\t\toutput.push(input.charCodeAt(j));\n\t}\n\n\t// Main decoding loop: start just after the last delimiter if any basic code\n\t// points were copied; start at the beginning otherwise.\n\n\tfor (let index = basic > 0 ? basic + 1 : 0; index < inputLength; /* no final expression */) {\n\n\t\t// `index` is the index of the next character to be consumed.\n\t\t// Decode a generalized variable-length integer into `delta`,\n\t\t// which gets added to `i`. The overflow checking is easier\n\t\t// if we increase `i` as we go, then subtract off its starting\n\t\t// value at the end to obtain `delta`.\n\t\tlet oldi = i;\n\t\tfor (let w = 1, k = base; /* no condition */; k += base) {\n\n\t\t\tif (index >= inputLength) {\n\t\t\t\terror('invalid-input');\n\t\t\t}\n\n\t\t\tconst digit = basicToDigit(input.charCodeAt(index++));\n\n\t\t\tif (digit >= base || digit > floor((maxInt - i) / w)) {\n\t\t\t\terror('overflow');\n\t\t\t}\n\n\t\t\ti += digit * w;\n\t\t\tconst t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias);\n\n\t\t\tif (digit < t) {\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tconst baseMinusT = base - t;\n\t\t\tif (w > floor(maxInt / baseMinusT)) {\n\t\t\t\terror('overflow');\n\t\t\t}\n\n\t\t\tw *= baseMinusT;\n\n\t\t}\n\n\t\tconst out = output.length + 1;\n\t\tbias = adapt(i - oldi, out, oldi == 0);\n\n\t\t// `i` was supposed to wrap around from `out` to `0`,\n\t\t// incrementing `n` each time, so we'll fix that now:\n\t\tif (floor(i / out) > maxInt - n) {\n\t\t\terror('overflow');\n\t\t}\n\n\t\tn += floor(i / out);\n\t\ti %= out;\n\n\t\t// Insert `n` at position `i` of the output.\n\t\toutput.splice(i++, 0, n);\n\n\t}\n\n\treturn String.fromCodePoint(...output);\n};\n\n/**\n * Converts a string of Unicode symbols (e.g. a domain name label) to a\n * Punycode string of ASCII-only symbols.\n * @memberOf punycode\n * @param {String} input The string of Unicode symbols.\n * @returns {String} The resulting Punycode string of ASCII-only symbols.\n */\nconst encode = function(input) {\n\tconst output = [];\n\n\t// Convert the input in UCS-2 to an array of Unicode code points.\n\tinput = ucs2decode(input);\n\n\t// Cache the length.\n\tlet inputLength = input.length;\n\n\t// Initialize the state.\n\tlet n = initialN;\n\tlet delta = 0;\n\tlet bias = initialBias;\n\n\t// Handle the basic code points.\n\tfor (const currentValue of input) {\n\t\tif (currentValue < 0x80) {\n\t\t\toutput.push(stringFromCharCode(currentValue));\n\t\t}\n\t}\n\n\tlet basicLength = output.length;\n\tlet handledCPCount = basicLength;\n\n\t// `handledCPCount` is the number of code points that have been handled;\n\t// `basicLength` is the number of basic code points.\n\n\t// Finish the basic string with a delimiter unless it's empty.\n\tif (basicLength) {\n\t\toutput.push(delimiter);\n\t}\n\n\t// Main encoding loop:\n\twhile (handledCPCount < inputLength) {\n\n\t\t// All non-basic code points < n have been handled already. Find the next\n\t\t// larger one:\n\t\tlet m = maxInt;\n\t\tfor (const currentValue of input) {\n\t\t\tif (currentValue >= n && currentValue < m) {\n\t\t\t\tm = currentValue;\n\t\t\t}\n\t\t}\n\n\t\t// Increase `delta` enough to advance the decoder's state to ,\n\t\t// but guard against overflow.\n\t\tconst handledCPCountPlusOne = handledCPCount + 1;\n\t\tif (m - n > floor((maxInt - delta) / handledCPCountPlusOne)) {\n\t\t\terror('overflow');\n\t\t}\n\n\t\tdelta += (m - n) * handledCPCountPlusOne;\n\t\tn = m;\n\n\t\tfor (const currentValue of input) {\n\t\t\tif (currentValue < n && ++delta > maxInt) {\n\t\t\t\terror('overflow');\n\t\t\t}\n\t\t\tif (currentValue == n) {\n\t\t\t\t// Represent delta as a generalized variable-length integer.\n\t\t\t\tlet q = delta;\n\t\t\t\tfor (let k = base; /* no condition */; k += base) {\n\t\t\t\t\tconst t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias);\n\t\t\t\t\tif (q < t) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tconst qMinusT = q - t;\n\t\t\t\t\tconst baseMinusT = base - t;\n\t\t\t\t\toutput.push(\n\t\t\t\t\t\tstringFromCharCode(digitToBasic(t + qMinusT % baseMinusT, 0))\n\t\t\t\t\t);\n\t\t\t\t\tq = floor(qMinusT / baseMinusT);\n\t\t\t\t}\n\n\t\t\t\toutput.push(stringFromCharCode(digitToBasic(q, 0)));\n\t\t\t\tbias = adapt(delta, handledCPCountPlusOne, handledCPCount == basicLength);\n\t\t\t\tdelta = 0;\n\t\t\t\t++handledCPCount;\n\t\t\t}\n\t\t}\n\n\t\t++delta;\n\t\t++n;\n\n\t}\n\treturn output.join('');\n};\n\n/**\n * Converts a Punycode string representing a domain name or an email address\n * to Unicode. Only the Punycoded parts of the input will be converted, i.e.\n * it doesn't matter if you call it on a string that has already been\n * converted to Unicode.\n * @memberOf punycode\n * @param {String} input The Punycoded domain name or email address to\n * convert to Unicode.\n * @returns {String} The Unicode representation of the given Punycode\n * string.\n */\nconst toUnicode = function(input) {\n\treturn mapDomain(input, function(string) {\n\t\treturn regexPunycode.test(string)\n\t\t\t? decode(string.slice(4).toLowerCase())\n\t\t\t: string;\n\t});\n};\n\n/**\n * Converts a Unicode string representing a domain name or an email address to\n * Punycode. Only the non-ASCII parts of the domain name will be converted,\n * i.e. it doesn't matter if you call it with a domain that's already in\n * ASCII.\n * @memberOf punycode\n * @param {String} input The domain name or email address to convert, as a\n * Unicode string.\n * @returns {String} The Punycode representation of the given domain name or\n * email address.\n */\nconst toASCII = function(input) {\n\treturn mapDomain(input, function(string) {\n\t\treturn regexNonASCII.test(string)\n\t\t\t? 'xn--' + encode(string)\n\t\t\t: string;\n\t});\n};\n\n/*--------------------------------------------------------------------------*/\n\n/** Define the public API */\nconst punycode = {\n\t/**\n\t * A string representing the current Punycode.js version number.\n\t * @memberOf punycode\n\t * @type String\n\t */\n\t'version': '2.1.0',\n\t/**\n\t * An object of methods to convert from JavaScript's internal character\n\t * representation (UCS-2) to Unicode code points, and back.\n\t * @see \n\t * @memberOf punycode\n\t * @type Object\n\t */\n\t'ucs2': {\n\t\t'decode': ucs2decode,\n\t\t'encode': ucs2encode\n\t},\n\t'decode': decode,\n\t'encode': encode,\n\t'toASCII': toASCII,\n\t'toUnicode': toUnicode\n};\n\nexport default punycode;\n","/**\n * URI.js\n *\n * @fileoverview An RFC 3986 compliant, scheme extendable URI parsing/validating/resolving library for JavaScript.\n * @author Gary Court\n * @see http://github.com/garycourt/uri-js\n */\n\n/**\n * Copyright 2011 Gary Court. All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without modification, are\n * permitted provided that the following conditions are met:\n *\n * 1. Redistributions of source code must retain the above copyright notice, this list of\n * conditions and the following disclaimer.\n *\n * 2. Redistributions in binary form must reproduce the above copyright notice, this list\n * of conditions and the following disclaimer in the documentation and/or other materials\n * provided with the distribution.\n *\n * THIS SOFTWARE IS PROVIDED BY GARY COURT ``AS IS'' AND ANY EXPRESS OR IMPLIED\n * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GARY COURT OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\n * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON\n * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *\n * The views and conclusions contained in the software and documentation are those of the\n * authors and should not be interpreted as representing official policies, either expressed\n * or implied, of Gary Court.\n */\n\nimport URI_PROTOCOL from \"./regexps-uri\";\nimport IRI_PROTOCOL from \"./regexps-iri\";\nimport punycode from \"punycode\";\nimport { toUpperCase, typeOf, assign } from \"./util\";\n\nexport interface URIComponents {\n\tscheme?:string;\n\tuserinfo?:string;\n\thost?:string;\n\tport?:number|string;\n\tpath?:string;\n\tquery?:string;\n\tfragment?:string;\n\treference?:string;\n\terror?:string;\n}\n\nexport interface URIOptions {\n\tscheme?:string;\n\treference?:string;\n\ttolerant?:boolean;\n\tabsolutePath?:boolean;\n\tiri?:boolean;\n\tunicodeSupport?:boolean;\n\tdomainHost?:boolean;\n}\n\nexport interface URISchemeHandler {\n\tscheme:string;\n\tparse(components:ParentComponents, options:Options):Components;\n\tserialize(components:Components, options:Options):ParentComponents;\n\tunicodeSupport?:boolean;\n\tdomainHost?:boolean;\n\tabsolutePath?:boolean;\n}\n\nexport interface URIRegExps {\n\tNOT_SCHEME : RegExp,\n\tNOT_USERINFO : RegExp,\n\tNOT_HOST : RegExp,\n\tNOT_PATH : RegExp,\n\tNOT_PATH_NOSCHEME : RegExp,\n\tNOT_QUERY : RegExp,\n\tNOT_FRAGMENT : RegExp,\n\tESCAPE : RegExp,\n\tUNRESERVED : RegExp,\n\tOTHER_CHARS : RegExp,\n\tPCT_ENCODED : RegExp,\n\tIPV4ADDRESS : RegExp,\n\tIPV6ADDRESS : RegExp,\n}\n\nexport const SCHEMES:{[scheme:string]:URISchemeHandler} = {};\n\nexport function pctEncChar(chr:string):string {\n\tconst c = chr.charCodeAt(0);\n\tlet e:string;\n\n\tif (c < 16) e = \"%0\" + c.toString(16).toUpperCase();\n\telse if (c < 128) e = \"%\" + c.toString(16).toUpperCase();\n\telse if (c < 2048) e = \"%\" + ((c >> 6) | 192).toString(16).toUpperCase() + \"%\" + ((c & 63) | 128).toString(16).toUpperCase();\n\telse e = \"%\" + ((c >> 12) | 224).toString(16).toUpperCase() + \"%\" + (((c >> 6) & 63) | 128).toString(16).toUpperCase() + \"%\" + ((c & 63) | 128).toString(16).toUpperCase();\n\n\treturn e;\n}\n\nexport function pctDecChars(str:string):string {\n\tlet newStr = \"\";\n\tlet i = 0;\n\tconst il = str.length;\n\n\twhile (i < il) {\n\t\tconst c = parseInt(str.substr(i + 1, 2), 16);\n\n\t\tif (c < 128) {\n\t\t\tnewStr += String.fromCharCode(c);\n\t\t\ti += 3;\n\t\t}\n\t\telse if (c >= 194 && c < 224) {\n\t\t\tif ((il - i) >= 6) {\n\t\t\t\tconst c2 = parseInt(str.substr(i + 4, 2), 16);\n\t\t\t\tnewStr += String.fromCharCode(((c & 31) << 6) | (c2 & 63));\n\t\t\t} else {\n\t\t\t\tnewStr += str.substr(i, 6);\n\t\t\t}\n\t\t\ti += 6;\n\t\t}\n\t\telse if (c >= 224) {\n\t\t\tif ((il - i) >= 9) {\n\t\t\t\tconst c2 = parseInt(str.substr(i + 4, 2), 16);\n\t\t\t\tconst c3 = parseInt(str.substr(i + 7, 2), 16);\n\t\t\t\tnewStr += String.fromCharCode(((c & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63));\n\t\t\t} else {\n\t\t\t\tnewStr += str.substr(i, 9);\n\t\t\t}\n\t\t\ti += 9;\n\t\t}\n\t\telse {\n\t\t\tnewStr += str.substr(i, 3);\n\t\t\ti += 3;\n\t\t}\n\t}\n\n\treturn newStr;\n}\n\nfunction _normalizeComponentEncoding(components:URIComponents, protocol:URIRegExps) {\n\tfunction decodeUnreserved(str:string):string {\n\t\tconst decStr = pctDecChars(str);\n\t\treturn (!decStr.match(protocol.UNRESERVED) ? str : decStr);\n\t}\n\n\tif (components.scheme) components.scheme = String(components.scheme).replace(protocol.PCT_ENCODED, decodeUnreserved).toLowerCase().replace(protocol.NOT_SCHEME, \"\");\n\tif (components.userinfo !== undefined) components.userinfo = String(components.userinfo).replace(protocol.PCT_ENCODED, decodeUnreserved).replace(protocol.NOT_USERINFO, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase);\n\tif (components.host !== undefined) components.host = String(components.host).replace(protocol.PCT_ENCODED, decodeUnreserved).toLowerCase().replace(protocol.NOT_HOST, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase);\n\tif (components.path !== undefined) components.path = String(components.path).replace(protocol.PCT_ENCODED, decodeUnreserved).replace((components.scheme ? protocol.NOT_PATH : protocol.NOT_PATH_NOSCHEME), pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase);\n\tif (components.query !== undefined) components.query = String(components.query).replace(protocol.PCT_ENCODED, decodeUnreserved).replace(protocol.NOT_QUERY, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase);\n\tif (components.fragment !== undefined) components.fragment = String(components.fragment).replace(protocol.PCT_ENCODED, decodeUnreserved).replace(protocol.NOT_FRAGMENT, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase);\n\n\treturn components;\n};\n\nfunction _stripLeadingZeros(str:string):string {\n\treturn str.replace(/^0*(.*)/, \"$1\") || \"0\";\n}\n\nfunction _normalizeIPv4(host:string, protocol:URIRegExps):string {\n\tconst matches = host.match(protocol.IPV4ADDRESS) || [];\n\tconst [, address] = matches;\n\t\n\tif (address) {\n\t\treturn address.split(\".\").map(_stripLeadingZeros).join(\".\");\n\t} else {\n\t\treturn host;\n\t}\n}\n\nfunction _normalizeIPv6(host:string, protocol:URIRegExps):string {\n\tconst matches = host.match(protocol.IPV6ADDRESS) || [];\n\tconst [, address, zone] = matches;\n\n\tif (address) {\n\t\tconst [last, first] = address.toLowerCase().split('::').reverse();\n\t\tconst firstFields = first ? first.split(\":\").map(_stripLeadingZeros) : [];\n\t\tconst lastFields = last.split(\":\").map(_stripLeadingZeros);\n\t\tconst isLastFieldIPv4Address = protocol.IPV4ADDRESS.test(lastFields[lastFields.length - 1]);\n\t\tconst fieldCount = isLastFieldIPv4Address ? 7 : 8;\n\t\tconst lastFieldsStart = lastFields.length - fieldCount;\n\t\tconst fields = Array(fieldCount);\n\n\t\tfor (let x = 0; x < fieldCount; ++x) {\n\t\t\tfields[x] = firstFields[x] || lastFields[lastFieldsStart + x] || '';\n\t\t}\n\n\t\tif (isLastFieldIPv4Address) {\n\t\t\tfields[fieldCount - 1] = _normalizeIPv4(fields[fieldCount - 1], protocol);\n\t\t}\n\n\t\tconst allZeroFields = fields.reduce>((acc, field, index) => {\n\t\t\tif (!field || field === \"0\") {\n\t\t\t\tconst lastLongest = acc[acc.length - 1];\n\t\t\t\tif (lastLongest && lastLongest.index + lastLongest.length === index) {\n\t\t\t\t\tlastLongest.length++;\n\t\t\t\t} else {\n\t\t\t\t\tacc.push({ index, length : 1 });\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn acc;\n\t\t}, []);\n\n\t\tconst longestZeroFields = allZeroFields.sort((a, b) => b.length - a.length)[0];\n\n\t\tlet newHost:string;\n\t\tif (longestZeroFields && longestZeroFields.length > 1) {\n\t\t\tconst newFirst = fields.slice(0, longestZeroFields.index) ;\n\t\t\tconst newLast = fields.slice(longestZeroFields.index + longestZeroFields.length);\n\t\t\tnewHost = newFirst.join(\":\") + \"::\" + newLast.join(\":\");\n\t\t} else {\n\t\t\tnewHost = fields.join(\":\");\n\t\t}\n\n\t\tif (zone) {\n\t\t\tnewHost += \"%\" + zone;\n\t\t}\n\n\t\treturn newHost;\n\t} else {\n\t\treturn host;\n\t}\n}\n\nconst URI_PARSE = /^(?:([^:\\/?#]+):)?(?:\\/\\/((?:([^\\/?#@]*)@)?(\\[[^\\/?#\\]]+\\]|[^\\/?#:]*)(?:\\:(\\d*))?))?([^?#]*)(?:\\?([^#]*))?(?:#((?:.|\\n|\\r)*))?/i;\nconst NO_MATCH_IS_UNDEFINED = ((\"\").match(/(){0}/))[1] === undefined;\n\nexport function parse(uriString:string, options:URIOptions = {}):URIComponents {\n\tconst components:URIComponents = {};\n\tconst protocol = (options.iri !== false ? IRI_PROTOCOL : URI_PROTOCOL);\n\n\tif (options.reference === \"suffix\") uriString = (options.scheme ? options.scheme + \":\" : \"\") + \"//\" + uriString;\n\n\tconst matches = uriString.match(URI_PARSE);\n\n\tif (matches) {\n\t\tif (NO_MATCH_IS_UNDEFINED) {\n\t\t\t//store each component\n\t\t\tcomponents.scheme = matches[1];\n\t\t\tcomponents.userinfo = matches[3];\n\t\t\tcomponents.host = matches[4];\n\t\t\tcomponents.port = parseInt(matches[5], 10);\n\t\t\tcomponents.path = matches[6] || \"\";\n\t\t\tcomponents.query = matches[7];\n\t\t\tcomponents.fragment = matches[8];\n\n\t\t\t//fix port number\n\t\t\tif (isNaN(components.port)) {\n\t\t\t\tcomponents.port = matches[5];\n\t\t\t}\n\t\t} else { //IE FIX for improper RegExp matching\n\t\t\t//store each component\n\t\t\tcomponents.scheme = matches[1] || undefined;\n\t\t\tcomponents.userinfo = (uriString.indexOf(\"@\") !== -1 ? matches[3] : undefined);\n\t\t\tcomponents.host = (uriString.indexOf(\"//\") !== -1 ? matches[4] : undefined);\n\t\t\tcomponents.port = parseInt(matches[5], 10);\n\t\t\tcomponents.path = matches[6] || \"\";\n\t\t\tcomponents.query = (uriString.indexOf(\"?\") !== -1 ? matches[7] : undefined);\n\t\t\tcomponents.fragment = (uriString.indexOf(\"#\") !== -1 ? matches[8] : undefined);\n\n\t\t\t//fix port number\n\t\t\tif (isNaN(components.port)) {\n\t\t\t\tcomponents.port = (uriString.match(/\\/\\/(?:.|\\n)*\\:(?:\\/|\\?|\\#|$)/) ? matches[4] : undefined);\n\t\t\t}\n\t\t}\n\n\t\tif (components.host) {\n\t\t\t//normalize IP hosts\n\t\t\tcomponents.host = _normalizeIPv6(_normalizeIPv4(components.host, protocol), protocol);\n\t\t}\n\n\t\t//determine reference type\n\t\tif (components.scheme === undefined && components.userinfo === undefined && components.host === undefined && components.port === undefined && !components.path && components.query === undefined) {\n\t\t\tcomponents.reference = \"same-document\";\n\t\t} else if (components.scheme === undefined) {\n\t\t\tcomponents.reference = \"relative\";\n\t\t} else if (components.fragment === undefined) {\n\t\t\tcomponents.reference = \"absolute\";\n\t\t} else {\n\t\t\tcomponents.reference = \"uri\";\n\t\t}\n\n\t\t//check for reference errors\n\t\tif (options.reference && options.reference !== \"suffix\" && options.reference !== components.reference) {\n\t\t\tcomponents.error = components.error || \"URI is not a \" + options.reference + \" reference.\";\n\t\t}\n\n\t\t//find scheme handler\n\t\tconst schemeHandler = SCHEMES[(options.scheme || components.scheme || \"\").toLowerCase()];\n\n\t\t//check if scheme can't handle IRIs\n\t\tif (!options.unicodeSupport && (!schemeHandler || !schemeHandler.unicodeSupport)) {\n\t\t\t//if host component is a domain name\n\t\t\tif (components.host && (options.domainHost || (schemeHandler && schemeHandler.domainHost))) {\n\t\t\t\t//convert Unicode IDN -> ASCII IDN\n\t\t\t\ttry {\n\t\t\t\t\tcomponents.host = punycode.toASCII(components.host.replace(protocol.PCT_ENCODED, pctDecChars).toLowerCase());\n\t\t\t\t} catch (e) {\n\t\t\t\t\tcomponents.error = components.error || \"Host's domain name can not be converted to ASCII via punycode: \" + e;\n\t\t\t\t}\n\t\t\t}\n\t\t\t//convert IRI -> URI\n\t\t\t_normalizeComponentEncoding(components, URI_PROTOCOL);\n\t\t} else {\n\t\t\t//normalize encodings\n\t\t\t_normalizeComponentEncoding(components, protocol);\n\t\t}\n\n\t\t//perform scheme specific parsing\n\t\tif (schemeHandler && schemeHandler.parse) {\n\t\t\tschemeHandler.parse(components, options);\n\t\t}\n\t} else {\n\t\tcomponents.error = components.error || \"URI can not be parsed.\";\n\t}\n\n\treturn components;\n};\n\nfunction _recomposeAuthority(components:URIComponents, options:URIOptions):string|undefined {\n\tconst protocol = (options.iri !== false ? IRI_PROTOCOL : URI_PROTOCOL);\n\tconst uriTokens:Array = [];\n\n\tif (components.userinfo !== undefined) {\n\t\turiTokens.push(components.userinfo);\n\t\turiTokens.push(\"@\");\n\t}\n\n\tif (components.host !== undefined) {\n\t\t//normalize IP hosts, add brackets and escape zone separator for IPv6\n\t\turiTokens.push(_normalizeIPv6(_normalizeIPv4(String(components.host), protocol), protocol).replace(protocol.IPV6ADDRESS, (_, $1, $2) => \"[\" + $1 + ($2 ? \"%25\" + $2 : \"\") + \"]\"));\n\t}\n\n\tif (typeof components.port === \"number\" || typeof components.port === \"string\") {\n\t\turiTokens.push(\":\");\n\t\turiTokens.push(String(components.port));\n\t}\n\n\treturn uriTokens.length ? uriTokens.join(\"\") : undefined;\n};\n\nconst RDS1 = /^\\.\\.?\\//;\nconst RDS2 = /^\\/\\.(\\/|$)/;\nconst RDS3 = /^\\/\\.\\.(\\/|$)/;\nconst RDS4 = /^\\.\\.?$/;\nconst RDS5 = /^\\/?(?:.|\\n)*?(?=\\/|$)/;\n\nexport function removeDotSegments(input:string):string {\n\tconst output:Array = [];\n\n\twhile (input.length) {\n\t\tif (input.match(RDS1)) {\n\t\t\tinput = input.replace(RDS1, \"\");\n\t\t} else if (input.match(RDS2)) {\n\t\t\tinput = input.replace(RDS2, \"/\");\n\t\t} else if (input.match(RDS3)) {\n\t\t\tinput = input.replace(RDS3, \"/\");\n\t\t\toutput.pop();\n\t\t} else if (input === \".\" || input === \"..\") {\n\t\t\tinput = \"\";\n\t\t} else {\n\t\t\tconst im = input.match(RDS5);\n\t\t\tif (im) {\n\t\t\t\tconst s = im[0];\n\t\t\t\tinput = input.slice(s.length);\n\t\t\t\toutput.push(s);\n\t\t\t} else {\n\t\t\t\tthrow new Error(\"Unexpected dot segment condition\");\n\t\t\t}\n\t\t}\n\t}\n\n\treturn output.join(\"\");\n};\n\nexport function serialize(components:URIComponents, options:URIOptions = {}):string {\n\tconst protocol = (options.iri ? IRI_PROTOCOL : URI_PROTOCOL);\n\tconst uriTokens:Array = [];\n\n\t//find scheme handler\n\tconst schemeHandler = SCHEMES[(options.scheme || components.scheme || \"\").toLowerCase()];\n\n\t//perform scheme specific serialization\n\tif (schemeHandler && schemeHandler.serialize) schemeHandler.serialize(components, options);\n\n\tif (components.host) {\n\t\t//if host component is an IPv6 address\n\t\tif (protocol.IPV6ADDRESS.test(components.host)) {\n\t\t\t//TODO: normalize IPv6 address as per RFC 5952\n\t\t}\n\n\t\t//if host component is a domain name\n\t\telse if (options.domainHost || (schemeHandler && schemeHandler.domainHost)) {\n\t\t\t//convert IDN via punycode\n\t\t\ttry {\n\t\t\t\tcomponents.host = (!options.iri ? punycode.toASCII(components.host.replace(protocol.PCT_ENCODED, pctDecChars).toLowerCase()) : punycode.toUnicode(components.host));\n\t\t\t} catch (e) {\n\t\t\t\tcomponents.error = components.error || \"Host's domain name can not be converted to \" + (!options.iri ? \"ASCII\" : \"Unicode\") + \" via punycode: \" + e;\n\t\t\t}\n\t\t}\n\t}\n\n\t//normalize encoding\n\t_normalizeComponentEncoding(components, protocol);\n\n\tif (options.reference !== \"suffix\" && components.scheme) {\n\t\turiTokens.push(components.scheme);\n\t\turiTokens.push(\":\");\n\t}\n\n\tconst authority = _recomposeAuthority(components, options);\n\tif (authority !== undefined) {\n\t\tif (options.reference !== \"suffix\") {\n\t\t\turiTokens.push(\"//\");\n\t\t}\n\n\t\turiTokens.push(authority);\n\n\t\tif (components.path && components.path.charAt(0) !== \"/\") {\n\t\t\turiTokens.push(\"/\");\n\t\t}\n\t}\n\n\tif (components.path !== undefined) {\n\t\tlet s = components.path;\n\n\t\tif (!options.absolutePath && (!schemeHandler || !schemeHandler.absolutePath)) {\n\t\t\ts = removeDotSegments(s);\n\t\t}\n\n\t\tif (authority === undefined) {\n\t\t\ts = s.replace(/^\\/\\//, \"/%2F\"); //don't allow the path to start with \"//\"\n\t\t}\n\n\t\turiTokens.push(s);\n\t}\n\n\tif (components.query !== undefined) {\n\t\turiTokens.push(\"?\");\n\t\turiTokens.push(components.query);\n\t}\n\n\tif (components.fragment !== undefined) {\n\t\turiTokens.push(\"#\");\n\t\turiTokens.push(components.fragment);\n\t}\n\n\treturn uriTokens.join(\"\"); //merge tokens into a string\n};\n\nexport function resolveComponents(base:URIComponents, relative:URIComponents, options:URIOptions = {}, skipNormalization?:boolean):URIComponents {\n\tconst target:URIComponents = {};\n\n\tif (!skipNormalization) {\n\t\tbase = parse(serialize(base, options), options); //normalize base components\n\t\trelative = parse(serialize(relative, options), options); //normalize relative components\n\t}\n\toptions = options || {};\n\n\tif (!options.tolerant && relative.scheme) {\n\t\ttarget.scheme = relative.scheme;\n\t\t//target.authority = relative.authority;\n\t\ttarget.userinfo = relative.userinfo;\n\t\ttarget.host = relative.host;\n\t\ttarget.port = relative.port;\n\t\ttarget.path = removeDotSegments(relative.path || \"\");\n\t\ttarget.query = relative.query;\n\t} else {\n\t\tif (relative.userinfo !== undefined || relative.host !== undefined || relative.port !== undefined) {\n\t\t\t//target.authority = relative.authority;\n\t\t\ttarget.userinfo = relative.userinfo;\n\t\t\ttarget.host = relative.host;\n\t\t\ttarget.port = relative.port;\n\t\t\ttarget.path = removeDotSegments(relative.path || \"\");\n\t\t\ttarget.query = relative.query;\n\t\t} else {\n\t\t\tif (!relative.path) {\n\t\t\t\ttarget.path = base.path;\n\t\t\t\tif (relative.query !== undefined) {\n\t\t\t\t\ttarget.query = relative.query;\n\t\t\t\t} else {\n\t\t\t\t\ttarget.query = base.query;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (relative.path.charAt(0) === \"/\") {\n\t\t\t\t\ttarget.path = removeDotSegments(relative.path);\n\t\t\t\t} else {\n\t\t\t\t\tif ((base.userinfo !== undefined || base.host !== undefined || base.port !== undefined) && !base.path) {\n\t\t\t\t\t\ttarget.path = \"/\" + relative.path;\n\t\t\t\t\t} else if (!base.path) {\n\t\t\t\t\t\ttarget.path = relative.path;\n\t\t\t\t\t} else {\n\t\t\t\t\t\ttarget.path = base.path.slice(0, base.path.lastIndexOf(\"/\") + 1) + relative.path;\n\t\t\t\t\t}\n\t\t\t\t\ttarget.path = removeDotSegments(target.path);\n\t\t\t\t}\n\t\t\t\ttarget.query = relative.query;\n\t\t\t}\n\t\t\t//target.authority = base.authority;\n\t\t\ttarget.userinfo = base.userinfo;\n\t\t\ttarget.host = base.host;\n\t\t\ttarget.port = base.port;\n\t\t}\n\t\ttarget.scheme = base.scheme;\n\t}\n\n\ttarget.fragment = relative.fragment;\n\n\treturn target;\n};\n\nexport function resolve(baseURI:string, relativeURI:string, options?:URIOptions):string {\n\tconst schemelessOptions = assign({ scheme : 'null' }, options);\n\treturn serialize(resolveComponents(parse(baseURI, schemelessOptions), parse(relativeURI, schemelessOptions), schemelessOptions, true), schemelessOptions);\n};\n\nexport function normalize(uri:string, options?:URIOptions):string;\nexport function normalize(uri:URIComponents, options?:URIOptions):URIComponents;\nexport function normalize(uri:any, options?:URIOptions):any {\n\tif (typeof uri === \"string\") {\n\t\turi = serialize(parse(uri, options), options);\n\t} else if (typeOf(uri) === \"object\") {\n\t\turi = parse(serialize(uri, options), options);\n\t}\n\n\treturn uri;\n};\n\nexport function equal(uriA:string, uriB:string, options?: URIOptions):boolean;\nexport function equal(uriA:URIComponents, uriB:URIComponents, options?:URIOptions):boolean;\nexport function equal(uriA:any, uriB:any, options?:URIOptions):boolean {\n\tif (typeof uriA === \"string\") {\n\t\turiA = serialize(parse(uriA, options), options);\n\t} else if (typeOf(uriA) === \"object\") {\n\t\turiA = serialize(uriA, options);\n\t}\n\n\tif (typeof uriB === \"string\") {\n\t\turiB = serialize(parse(uriB, options), options);\n\t} else if (typeOf(uriB) === \"object\") {\n\t\turiB = serialize(uriB, options);\n\t}\n\n\treturn uriA === uriB;\n};\n\nexport function escapeComponent(str:string, options?:URIOptions):string {\n\treturn str && str.toString().replace((!options || !options.iri ? URI_PROTOCOL.ESCAPE : IRI_PROTOCOL.ESCAPE), pctEncChar);\n};\n\nexport function unescapeComponent(str:string, options?:URIOptions):string {\n\treturn str && str.toString().replace((!options || !options.iri ? URI_PROTOCOL.PCT_ENCODED : IRI_PROTOCOL.PCT_ENCODED), pctDecChars);\n};\n","import { URISchemeHandler, URIComponents, URIOptions } from \"../uri\";\n\nexport interface WSComponents extends URIComponents {\n\tresourceName?: string;\n\tsecure?: boolean;\n}\n\nfunction isSecure(wsComponents:WSComponents):boolean {\n\treturn typeof wsComponents.secure === 'boolean' ? wsComponents.secure : String(wsComponents.scheme).toLowerCase() === \"wss\";\n}\n\n//RFC 6455\nconst handler:URISchemeHandler = {\n\tscheme : \"ws\",\n\n\tdomainHost : true,\n\n\tparse : function (components:URIComponents, options:URIOptions):WSComponents {\n\t\tconst wsComponents = components as WSComponents;\n\n\t\t//indicate if the secure flag is set\n\t\twsComponents.secure = isSecure(wsComponents);\n\n\t\t//construct resouce name\n\t\twsComponents.resourceName = (wsComponents.path || '/') + (wsComponents.query ? '?' + wsComponents.query : '');\n\t\twsComponents.path = undefined;\n\t\twsComponents.query = undefined;\n\n\t\treturn wsComponents;\n\t},\n\n\tserialize : function (wsComponents:WSComponents, options:URIOptions):URIComponents {\n\t\t//normalize the default port\n\t\tif (wsComponents.port === (isSecure(wsComponents) ? 443 : 80) || wsComponents.port === \"\") {\n\t\t\twsComponents.port = undefined;\n\t\t}\n\n\t\t//ensure scheme matches secure flag\n\t\tif (typeof wsComponents.secure === 'boolean') {\n\t\t\twsComponents.scheme = (wsComponents.secure ? 'wss' : 'ws');\n\t\t\twsComponents.secure = undefined;\n\t\t}\n\n\t\t//reconstruct path from resource name\n\t\tif (wsComponents.resourceName) {\n\t\t\tconst [path, query] = wsComponents.resourceName.split('?');\n\t\t\twsComponents.path = (path && path !== '/' ? path : undefined);\n\t\t\twsComponents.query = query;\n\t\t\twsComponents.resourceName = undefined;\n\t\t}\n\n\t\t//forbid fragment component\n\t\twsComponents.fragment = undefined;\n\n\t\treturn wsComponents;\n\t}\n};\n\nexport default handler;","import { URISchemeHandler, URIComponents, URIOptions } from \"../uri\";\nimport { pctEncChar, pctDecChars, unescapeComponent } from \"../uri\";\nimport punycode from \"punycode\";\nimport { merge, subexp, toUpperCase, toArray } from \"../util\";\n\nexport interface MailtoHeaders {\n\t[hfname:string]:string\n}\n\nexport interface MailtoComponents extends URIComponents {\n\tto:Array,\n\theaders?:MailtoHeaders,\n\tsubject?:string,\n\tbody?:string\n}\n\nconst O:MailtoHeaders = {};\nconst isIRI = true;\n\n//RFC 3986\nconst UNRESERVED$$ = \"[A-Za-z0-9\\\\-\\\\.\\\\_\\\\~\" + (isIRI ? \"\\\\xA0-\\\\u200D\\\\u2010-\\\\u2029\\\\u202F-\\\\uD7FF\\\\uF900-\\\\uFDCF\\\\uFDF0-\\\\uFFEF\" : \"\") + \"]\";\nconst HEXDIG$$ = \"[0-9A-Fa-f]\"; //case-insensitive\nconst PCT_ENCODED$ = subexp(subexp(\"%[EFef]\" + HEXDIG$$ + \"%\" + HEXDIG$$ + HEXDIG$$ + \"%\" + HEXDIG$$ + HEXDIG$$) + \"|\" + subexp(\"%[89A-Fa-f]\" + HEXDIG$$ + \"%\" + HEXDIG$$ + HEXDIG$$) + \"|\" + subexp(\"%\" + HEXDIG$$ + HEXDIG$$)); //expanded\n\n//RFC 5322, except these symbols as per RFC 6068: @ : / ? # [ ] & ; =\n//const ATEXT$$ = \"[A-Za-z0-9\\\\!\\\\#\\\\$\\\\%\\\\&\\\\'\\\\*\\\\+\\\\-\\\\/\\\\=\\\\?\\\\^\\\\_\\\\`\\\\{\\\\|\\\\}\\\\~]\";\n//const WSP$$ = \"[\\\\x20\\\\x09]\";\n//const OBS_QTEXT$$ = \"[\\\\x01-\\\\x08\\\\x0B\\\\x0C\\\\x0E-\\\\x1F\\\\x7F]\"; //(%d1-8 / %d11-12 / %d14-31 / %d127)\n//const QTEXT$$ = merge(\"[\\\\x21\\\\x23-\\\\x5B\\\\x5D-\\\\x7E]\", OBS_QTEXT$$); //%d33 / %d35-91 / %d93-126 / obs-qtext\n//const VCHAR$$ = \"[\\\\x21-\\\\x7E]\";\n//const WSP$$ = \"[\\\\x20\\\\x09]\";\n//const OBS_QP$ = subexp(\"\\\\\\\\\" + merge(\"[\\\\x00\\\\x0D\\\\x0A]\", OBS_QTEXT$$)); //%d0 / CR / LF / obs-qtext\n//const FWS$ = subexp(subexp(WSP$$ + \"*\" + \"\\\\x0D\\\\x0A\") + \"?\" + WSP$$ + \"+\");\n//const QUOTED_PAIR$ = subexp(subexp(\"\\\\\\\\\" + subexp(VCHAR$$ + \"|\" + WSP$$)) + \"|\" + OBS_QP$);\n//const QUOTED_STRING$ = subexp('\\\\\"' + subexp(FWS$ + \"?\" + QCONTENT$) + \"*\" + FWS$ + \"?\" + '\\\\\"');\nconst ATEXT$$ = \"[A-Za-z0-9\\\\!\\\\$\\\\%\\\\'\\\\*\\\\+\\\\-\\\\^\\\\_\\\\`\\\\{\\\\|\\\\}\\\\~]\";\nconst QTEXT$$ = \"[\\\\!\\\\$\\\\%\\\\'\\\\(\\\\)\\\\*\\\\+\\\\,\\\\-\\\\.0-9\\\\<\\\\>A-Z\\\\x5E-\\\\x7E]\";\nconst VCHAR$$ = merge(QTEXT$$, \"[\\\\\\\"\\\\\\\\]\");\nconst DOT_ATOM_TEXT$ = subexp(ATEXT$$ + \"+\" + subexp(\"\\\\.\" + ATEXT$$ + \"+\") + \"*\");\nconst QUOTED_PAIR$ = subexp(\"\\\\\\\\\" + VCHAR$$);\nconst QCONTENT$ = subexp(QTEXT$$ + \"|\" + QUOTED_PAIR$);\nconst QUOTED_STRING$ = subexp('\\\\\"' + QCONTENT$ + \"*\" + '\\\\\"');\n\n//RFC 6068\nconst DTEXT_NO_OBS$$ = \"[\\\\x21-\\\\x5A\\\\x5E-\\\\x7E]\"; //%d33-90 / %d94-126\nconst SOME_DELIMS$$ = \"[\\\\!\\\\$\\\\'\\\\(\\\\)\\\\*\\\\+\\\\,\\\\;\\\\:\\\\@]\";\nconst QCHAR$ = subexp(UNRESERVED$$ + \"|\" + PCT_ENCODED$ + \"|\" + SOME_DELIMS$$);\nconst DOMAIN$ = subexp(DOT_ATOM_TEXT$ + \"|\" + \"\\\\[\" + DTEXT_NO_OBS$$ + \"*\" + \"\\\\]\");\nconst LOCAL_PART$ = subexp(DOT_ATOM_TEXT$ + \"|\" + QUOTED_STRING$);\nconst ADDR_SPEC$ = subexp(LOCAL_PART$ + \"\\\\@\" + DOMAIN$);\nconst TO$ = subexp(ADDR_SPEC$ + subexp(\"\\\\,\" + ADDR_SPEC$) + \"*\");\nconst HFNAME$ = subexp(QCHAR$ + \"*\");\nconst HFVALUE$ = HFNAME$;\nconst HFIELD$ = subexp(HFNAME$ + \"\\\\=\" + HFVALUE$);\nconst HFIELDS2$ = subexp(HFIELD$ + subexp(\"\\\\&\" + HFIELD$) + \"*\");\nconst HFIELDS$ = subexp(\"\\\\?\" + HFIELDS2$);\nconst MAILTO_URI = new RegExp(\"^mailto\\\\:\" + TO$ + \"?\" + HFIELDS$ + \"?$\");\n\nconst UNRESERVED = new RegExp(UNRESERVED$$, \"g\");\nconst PCT_ENCODED = new RegExp(PCT_ENCODED$, \"g\");\nconst NOT_LOCAL_PART = new RegExp(merge(\"[^]\", ATEXT$$, \"[\\\\.]\", '[\\\\\"]', VCHAR$$), \"g\");\nconst NOT_DOMAIN = new RegExp(merge(\"[^]\", ATEXT$$, \"[\\\\.]\", \"[\\\\[]\", DTEXT_NO_OBS$$, \"[\\\\]]\"), \"g\");\nconst NOT_HFNAME = new RegExp(merge(\"[^]\", UNRESERVED$$, SOME_DELIMS$$), \"g\");\nconst NOT_HFVALUE = NOT_HFNAME;\nconst TO = new RegExp(\"^\" + TO$ + \"$\");\nconst HFIELDS = new RegExp(\"^\" + HFIELDS2$ + \"$\");\n\nfunction decodeUnreserved(str:string):string {\n\tconst decStr = pctDecChars(str);\n\treturn (!decStr.match(UNRESERVED) ? str : decStr);\n}\n\nconst handler:URISchemeHandler = {\n\tscheme : \"mailto\",\n\n\tparse : function (components:URIComponents, options:URIOptions):MailtoComponents {\n\t\tconst mailtoComponents = components as MailtoComponents;\n\t\tconst to = mailtoComponents.to = (mailtoComponents.path ? mailtoComponents.path.split(\",\") : []);\n\t\tmailtoComponents.path = undefined;\n\n\t\tif (mailtoComponents.query) {\n\t\t\tlet unknownHeaders = false\n\t\t\tconst headers:MailtoHeaders = {};\n\t\t\tconst hfields = mailtoComponents.query.split(\"&\");\n\n\t\t\tfor (let x = 0, xl = hfields.length; x < xl; ++x) {\n\t\t\t\tconst hfield = hfields[x].split(\"=\");\n\n\t\t\t\tswitch (hfield[0]) {\n\t\t\t\t\tcase \"to\":\n\t\t\t\t\t\tconst toAddrs = hfield[1].split(\",\");\n\t\t\t\t\t\tfor (let x = 0, xl = toAddrs.length; x < xl; ++x) {\n\t\t\t\t\t\t\tto.push(toAddrs[x]);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"subject\":\n\t\t\t\t\t\tmailtoComponents.subject = unescapeComponent(hfield[1], options);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"body\":\n\t\t\t\t\t\tmailtoComponents.body = unescapeComponent(hfield[1], options);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tunknownHeaders = true;\n\t\t\t\t\t\theaders[unescapeComponent(hfield[0], options)] = unescapeComponent(hfield[1], options);\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (unknownHeaders) mailtoComponents.headers = headers;\n\t\t}\n\n\t\tmailtoComponents.query = undefined;\n\n\t\tfor (let x = 0, xl = to.length; x < xl; ++x) {\n\t\t\tconst addr = to[x].split(\"@\");\n\n\t\t\taddr[0] = unescapeComponent(addr[0]);\n\n\t\t\tif (!options.unicodeSupport) {\n\t\t\t\t//convert Unicode IDN -> ASCII IDN\n\t\t\t\ttry {\n\t\t\t\t\taddr[1] = punycode.toASCII(unescapeComponent(addr[1], options).toLowerCase());\n\t\t\t\t} catch (e) {\n\t\t\t\t\tmailtoComponents.error = mailtoComponents.error || \"Email address's domain name can not be converted to ASCII via punycode: \" + e;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\taddr[1] = unescapeComponent(addr[1], options).toLowerCase();\n\t\t\t}\n\n\t\t\tto[x] = addr.join(\"@\");\n\t\t}\n\n\t\treturn mailtoComponents;\n\t},\n\n\tserialize : function (mailtoComponents:MailtoComponents, options:URIOptions):URIComponents {\n\t\tconst components = mailtoComponents as URIComponents;\n\t\tconst to = toArray(mailtoComponents.to);\n\t\tif (to) {\n\t\t\tfor (let x = 0, xl = to.length; x < xl; ++x) {\n\t\t\t\tconst toAddr = String(to[x]);\n\t\t\t\tconst atIdx = toAddr.lastIndexOf(\"@\");\n\t\t\t\tconst localPart = (toAddr.slice(0, atIdx)).replace(PCT_ENCODED, decodeUnreserved).replace(PCT_ENCODED, toUpperCase).replace(NOT_LOCAL_PART, pctEncChar);\n\t\t\t\tlet domain = toAddr.slice(atIdx + 1);\n\n\t\t\t\t//convert IDN via punycode\n\t\t\t\ttry {\n\t\t\t\t\tdomain = (!options.iri ? punycode.toASCII(unescapeComponent(domain, options).toLowerCase()) : punycode.toUnicode(domain));\n\t\t\t\t} catch (e) {\n\t\t\t\t\tcomponents.error = components.error || \"Email address's domain name can not be converted to \" + (!options.iri ? \"ASCII\" : \"Unicode\") + \" via punycode: \" + e;\n\t\t\t\t}\n\n\t\t\t\tto[x] = localPart + \"@\" + domain;\n\t\t\t}\n\n\t\t\tcomponents.path = to.join(\",\");\n\t\t}\n\n\t\tconst headers = mailtoComponents.headers = mailtoComponents.headers || {};\n\n\t\tif (mailtoComponents.subject) headers[\"subject\"] = mailtoComponents.subject;\n\t\tif (mailtoComponents.body) headers[\"body\"] = mailtoComponents.body;\n\n\t\tconst fields = [];\n\t\tfor (const name in headers) {\n\t\t\tif (headers[name] !== O[name]) {\n\t\t\t\tfields.push(\n\t\t\t\t\tname.replace(PCT_ENCODED, decodeUnreserved).replace(PCT_ENCODED, toUpperCase).replace(NOT_HFNAME, pctEncChar) +\n\t\t\t\t\t\"=\" +\n\t\t\t\t\theaders[name].replace(PCT_ENCODED, decodeUnreserved).replace(PCT_ENCODED, toUpperCase).replace(NOT_HFVALUE, pctEncChar)\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t\tif (fields.length) {\n\t\t\tcomponents.query = fields.join(\"&\");\n\t\t}\n\n\t\treturn components;\n\t}\n}\n\nexport default handler;","import { URIRegExps } from \"./uri\";\nimport { buildExps } from \"./regexps-uri\";\n\nexport default buildExps(true);\n","import { URISchemeHandler, URIComponents, URIOptions } from \"../uri\";\n\nconst handler:URISchemeHandler = {\n\tscheme : \"http\",\n\n\tdomainHost : true,\n\n\tparse : function (components:URIComponents, options:URIOptions):URIComponents {\n\t\t//report missing host\n\t\tif (!components.host) {\n\t\t\tcomponents.error = components.error || \"HTTP URIs must have a host.\";\n\t\t}\n\n\t\treturn components;\n\t},\n\n\tserialize : function (components:URIComponents, options:URIOptions):URIComponents {\n\t\tconst secure = String(components.scheme).toLowerCase() === \"https\";\n\n\t\t//normalize the default port\n\t\tif (components.port === (secure ? 443 : 80) || components.port === \"\") {\n\t\t\tcomponents.port = undefined;\n\t\t}\n\t\t\n\t\t//normalize the empty path\n\t\tif (!components.path) {\n\t\t\tcomponents.path = \"/\";\n\t\t}\n\n\t\t//NOTE: We do not parse query strings for HTTP URIs\n\t\t//as WWW Form Url Encoded query strings are part of the HTML4+ spec,\n\t\t//and not the HTTP spec.\n\n\t\treturn components;\n\t}\n};\n\nexport default handler;","import { URISchemeHandler, URIComponents, URIOptions } from \"../uri\";\nimport http from \"./http\";\n\nconst handler:URISchemeHandler = {\n\tscheme : \"https\",\n\tdomainHost : http.domainHost,\n\tparse : http.parse,\n\tserialize : http.serialize\n}\n\nexport default handler;","import { URISchemeHandler, URIComponents, URIOptions } from \"../uri\";\nimport ws from \"./ws\";\n\nconst handler:URISchemeHandler = {\n\tscheme : \"wss\",\n\tdomainHost : ws.domainHost,\n\tparse : ws.parse,\n\tserialize : ws.serialize\n}\n\nexport default handler;","import { URISchemeHandler, URIComponents, URIOptions } from \"../uri\";\nimport { pctEncChar, SCHEMES } from \"../uri\";\n\nexport interface URNComponents extends URIComponents {\n\tnid?:string;\n\tnss?:string;\n}\n\nexport interface URNOptions extends URIOptions {\n\tnid?:string;\n}\n\nconst NID$ = \"(?:[0-9A-Za-z][0-9A-Za-z\\\\-]{1,31})\";\nconst PCT_ENCODED$ = \"(?:\\\\%[0-9A-Fa-f]{2})\";\nconst TRANS$$ = \"[0-9A-Za-z\\\\(\\\\)\\\\+\\\\,\\\\-\\\\.\\\\:\\\\=\\\\@\\\\;\\\\$\\\\_\\\\!\\\\*\\\\'\\\\/\\\\?\\\\#]\";\nconst NSS$ = \"(?:(?:\" + PCT_ENCODED$ + \"|\" + TRANS$$ + \")+)\";\nconst URN_SCHEME = new RegExp(\"^urn\\\\:(\" + NID$ + \")$\");\nconst URN_PATH = new RegExp(\"^(\" + NID$ + \")\\\\:(\" + NSS$ + \")$\");\nconst URN_PARSE = /^([^\\:]+)\\:(.*)/;\nconst URN_EXCLUDED = /[\\x00-\\x20\\\\\\\"\\&\\<\\>\\[\\]\\^\\`\\{\\|\\}\\~\\x7F-\\xFF]/g;\n\n//RFC 2141\nconst handler:URISchemeHandler = {\n\tscheme : \"urn\",\n\n\tparse : function (components:URIComponents, options:URNOptions):URNComponents {\n\t\tconst matches = components.path && components.path.match(URN_PARSE);\n\t\tlet urnComponents = components as URNComponents;\n\n\t\tif (matches) {\n\t\t\tconst scheme = options.scheme || urnComponents.scheme || \"urn\";\n\t\t\tconst nid = matches[1].toLowerCase();\n\t\t\tconst nss = matches[2];\n\t\t\tconst urnScheme = `${scheme}:${options.nid || nid}`;\n\t\t\tconst schemeHandler = SCHEMES[urnScheme];\n\n\t\t\turnComponents.nid = nid;\n\t\t\turnComponents.nss = nss;\n\t\t\turnComponents.path = undefined;\n\n\t\t\tif (schemeHandler) {\n\t\t\t\turnComponents = schemeHandler.parse(urnComponents, options) as URNComponents;\n\t\t\t}\n\t\t} else {\n\t\t\turnComponents.error = urnComponents.error || \"URN can not be parsed.\";\n\t\t}\n\n\t\treturn urnComponents;\n\t},\n\n\tserialize : function (urnComponents:URNComponents, options:URNOptions):URIComponents {\n\t\tconst scheme = options.scheme || urnComponents.scheme || \"urn\";\n\t\tconst nid = urnComponents.nid;\n\t\tconst urnScheme = `${scheme}:${options.nid || nid}`;\n\t\tconst schemeHandler = SCHEMES[urnScheme];\n\n\t\tif (schemeHandler) {\n\t\t\turnComponents = schemeHandler.serialize(urnComponents, options) as URNComponents;\n\t\t}\n\n\t\tconst uriComponents = urnComponents as URIComponents;\n\t\tconst nss = urnComponents.nss;\n\t\turiComponents.path = `${nid || options.nid}:${nss}`;\n\n\t\treturn uriComponents;\n\t},\n};\n\nexport default handler;","import { URISchemeHandler, URIComponents, URIOptions } from \"../uri\";\nimport { URNComponents } from \"./urn\";\nimport { SCHEMES } from \"../uri\";\n\nexport interface UUIDComponents extends URNComponents {\n\tuuid?: string;\n}\n\nconst UUID = /^[0-9A-Fa-f]{8}(?:\\-[0-9A-Fa-f]{4}){3}\\-[0-9A-Fa-f]{12}$/;\nconst UUID_PARSE = /^[0-9A-Fa-f\\-]{36}/;\n\n//RFC 4122\nconst handler:URISchemeHandler = {\n\tscheme : \"urn:uuid\",\n\n\tparse : function (urnComponents:URNComponents, options:URIOptions):UUIDComponents {\n\t\tconst uuidComponents = urnComponents as UUIDComponents;\n\t\tuuidComponents.uuid = uuidComponents.nss;\n\t\tuuidComponents.nss = undefined;\n\n\t\tif (!options.tolerant && (!uuidComponents.uuid || !uuidComponents.uuid.match(UUID))) {\n\t\t\tuuidComponents.error = uuidComponents.error || \"UUID is not valid.\";\n\t\t}\n\n\t\treturn uuidComponents;\n\t},\n\n\tserialize : function (uuidComponents:UUIDComponents, options:URIOptions):URNComponents {\n\t\tconst urnComponents = uuidComponents as URNComponents;\n\t\t//normalize UUID\n\t\turnComponents.nss = (uuidComponents.uuid || \"\").toLowerCase();\n\t\treturn urnComponents;\n\t},\n};\n\nexport default handler;","import { SCHEMES } from \"./uri\";\n\nimport http from \"./schemes/http\";\nSCHEMES[http.scheme] = http;\n\nimport https from \"./schemes/https\";\nSCHEMES[https.scheme] = https;\n\nimport ws from \"./schemes/ws\";\nSCHEMES[ws.scheme] = ws;\n\nimport wss from \"./schemes/wss\";\nSCHEMES[wss.scheme] = wss;\n\nimport mailto from \"./schemes/mailto\";\nSCHEMES[mailto.scheme] = mailto;\n\nimport urn from \"./schemes/urn\";\nSCHEMES[urn.scheme] = urn;\n\nimport uuid from \"./schemes/urn-uuid\";\nSCHEMES[uuid.scheme] = uuid;\n\nexport * from \"./uri\";\n"]} \ No newline at end of file diff --git a/deps/npm/node_modules/uri-js/dist/esnext/index.d.ts b/deps/npm/node_modules/uri-js/dist/esnext/index.d.ts new file mode 100755 index 00000000000000..f6be760343fbdf --- /dev/null +++ b/deps/npm/node_modules/uri-js/dist/esnext/index.d.ts @@ -0,0 +1 @@ +export * from "./uri"; diff --git a/deps/npm/node_modules/uri-js/dist/esnext/index.js b/deps/npm/node_modules/uri-js/dist/esnext/index.js new file mode 100755 index 00000000000000..e3531b5b61bb28 --- /dev/null +++ b/deps/npm/node_modules/uri-js/dist/esnext/index.js @@ -0,0 +1,17 @@ +import { SCHEMES } from "./uri"; +import http from "./schemes/http"; +SCHEMES[http.scheme] = http; +import https from "./schemes/https"; +SCHEMES[https.scheme] = https; +import ws from "./schemes/ws"; +SCHEMES[ws.scheme] = ws; +import wss from "./schemes/wss"; +SCHEMES[wss.scheme] = wss; +import mailto from "./schemes/mailto"; +SCHEMES[mailto.scheme] = mailto; +import urn from "./schemes/urn"; +SCHEMES[urn.scheme] = urn; +import uuid from "./schemes/urn-uuid"; +SCHEMES[uuid.scheme] = uuid; +export * from "./uri"; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/deps/npm/node_modules/uri-js/dist/esnext/index.js.map b/deps/npm/node_modules/uri-js/dist/esnext/index.js.map new file mode 100755 index 00000000000000..0971f6ebcadb79 --- /dev/null +++ b/deps/npm/node_modules/uri-js/dist/esnext/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAEhC,OAAO,IAAI,MAAM,gBAAgB,CAAC;AAClC,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC;AAE5B,OAAO,KAAK,MAAM,iBAAiB,CAAC;AACpC,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,GAAG,KAAK,CAAC;AAE9B,OAAO,EAAE,MAAM,cAAc,CAAC;AAC9B,OAAO,CAAC,EAAE,CAAC,MAAM,CAAC,GAAG,EAAE,CAAC;AAExB,OAAO,GAAG,MAAM,eAAe,CAAC;AAChC,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,GAAG,GAAG,CAAC;AAE1B,OAAO,MAAM,MAAM,kBAAkB,CAAC;AACtC,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,GAAG,MAAM,CAAC;AAEhC,OAAO,GAAG,MAAM,eAAe,CAAC;AAChC,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,GAAG,GAAG,CAAC;AAE1B,OAAO,IAAI,MAAM,oBAAoB,CAAC;AACtC,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC;AAE5B,cAAc,OAAO,CAAC"} \ No newline at end of file diff --git a/deps/npm/node_modules/uri-js/dist/esnext/regexps-iri.d.ts b/deps/npm/node_modules/uri-js/dist/esnext/regexps-iri.d.ts new file mode 100755 index 00000000000000..c91cdacbce6f74 --- /dev/null +++ b/deps/npm/node_modules/uri-js/dist/esnext/regexps-iri.d.ts @@ -0,0 +1,3 @@ +import { URIRegExps } from "./uri"; +declare const _default: URIRegExps; +export default _default; diff --git a/deps/npm/node_modules/uri-js/dist/esnext/regexps-iri.js b/deps/npm/node_modules/uri-js/dist/esnext/regexps-iri.js new file mode 100755 index 00000000000000..34e7de989e3b47 --- /dev/null +++ b/deps/npm/node_modules/uri-js/dist/esnext/regexps-iri.js @@ -0,0 +1,3 @@ +import { buildExps } from "./regexps-uri"; +export default buildExps(true); +//# sourceMappingURL=regexps-iri.js.map \ No newline at end of file diff --git a/deps/npm/node_modules/uri-js/dist/esnext/regexps-iri.js.map b/deps/npm/node_modules/uri-js/dist/esnext/regexps-iri.js.map new file mode 100755 index 00000000000000..2269c580c7449d --- /dev/null +++ b/deps/npm/node_modules/uri-js/dist/esnext/regexps-iri.js.map @@ -0,0 +1 @@ +{"version":3,"file":"regexps-iri.js","sourceRoot":"","sources":["../../src/regexps-iri.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAE1C,eAAe,SAAS,CAAC,IAAI,CAAC,CAAC"} \ No newline at end of file diff --git a/deps/npm/node_modules/uri-js/dist/esnext/regexps-uri.d.ts b/deps/npm/node_modules/uri-js/dist/esnext/regexps-uri.d.ts new file mode 100755 index 00000000000000..6096bda5cd515b --- /dev/null +++ b/deps/npm/node_modules/uri-js/dist/esnext/regexps-uri.d.ts @@ -0,0 +1,4 @@ +import { URIRegExps } from "./uri"; +export declare function buildExps(isIRI: boolean): URIRegExps; +declare const _default: URIRegExps; +export default _default; diff --git a/deps/npm/node_modules/uri-js/dist/esnext/regexps-uri.js b/deps/npm/node_modules/uri-js/dist/esnext/regexps-uri.js new file mode 100755 index 00000000000000..1cc659f133da37 --- /dev/null +++ b/deps/npm/node_modules/uri-js/dist/esnext/regexps-uri.js @@ -0,0 +1,42 @@ +import { merge, subexp } from "./util"; +export function buildExps(isIRI) { + const ALPHA$$ = "[A-Za-z]", CR$ = "[\\x0D]", DIGIT$$ = "[0-9]", DQUOTE$$ = "[\\x22]", HEXDIG$$ = merge(DIGIT$$, "[A-Fa-f]"), //case-insensitive + LF$$ = "[\\x0A]", SP$$ = "[\\x20]", PCT_ENCODED$ = subexp(subexp("%[EFef]" + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$) + "|" + subexp("%[89A-Fa-f]" + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$) + "|" + subexp("%" + HEXDIG$$ + HEXDIG$$)), //expanded + GEN_DELIMS$$ = "[\\:\\/\\?\\#\\[\\]\\@]", SUB_DELIMS$$ = "[\\!\\$\\&\\'\\(\\)\\*\\+\\,\\;\\=]", RESERVED$$ = merge(GEN_DELIMS$$, SUB_DELIMS$$), UCSCHAR$$ = isIRI ? "[\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]" : "[]", //subset, excludes bidi control characters + IPRIVATE$$ = isIRI ? "[\\uE000-\\uF8FF]" : "[]", //subset + UNRESERVED$$ = merge(ALPHA$$, DIGIT$$, "[\\-\\.\\_\\~]", UCSCHAR$$), SCHEME$ = subexp(ALPHA$$ + merge(ALPHA$$, DIGIT$$, "[\\+\\-\\.]") + "*"), USERINFO$ = subexp(subexp(PCT_ENCODED$ + "|" + merge(UNRESERVED$$, SUB_DELIMS$$, "[\\:]")) + "*"), DEC_OCTET$ = subexp(subexp("25[0-5]") + "|" + subexp("2[0-4]" + DIGIT$$) + "|" + subexp("1" + DIGIT$$ + DIGIT$$) + "|" + subexp("[1-9]" + DIGIT$$) + "|" + DIGIT$$), DEC_OCTET_RELAXED$ = subexp(subexp("25[0-5]") + "|" + subexp("2[0-4]" + DIGIT$$) + "|" + subexp("1" + DIGIT$$ + DIGIT$$) + "|" + subexp("0?[1-9]" + DIGIT$$) + "|0?0?" + DIGIT$$), //relaxed parsing rules + IPV4ADDRESS$ = subexp(DEC_OCTET_RELAXED$ + "\\." + DEC_OCTET_RELAXED$ + "\\." + DEC_OCTET_RELAXED$ + "\\." + DEC_OCTET_RELAXED$), H16$ = subexp(HEXDIG$$ + "{1,4}"), LS32$ = subexp(subexp(H16$ + "\\:" + H16$) + "|" + IPV4ADDRESS$), IPV6ADDRESS1$ = subexp(subexp(H16$ + "\\:") + "{6}" + LS32$), // 6( h16 ":" ) ls32 + IPV6ADDRESS2$ = subexp("\\:\\:" + subexp(H16$ + "\\:") + "{5}" + LS32$), // "::" 5( h16 ":" ) ls32 + IPV6ADDRESS3$ = subexp(subexp(H16$) + "?\\:\\:" + subexp(H16$ + "\\:") + "{4}" + LS32$), //[ h16 ] "::" 4( h16 ":" ) ls32 + IPV6ADDRESS4$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,1}" + H16$) + "?\\:\\:" + subexp(H16$ + "\\:") + "{3}" + LS32$), //[ *1( h16 ":" ) h16 ] "::" 3( h16 ":" ) ls32 + IPV6ADDRESS5$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,2}" + H16$) + "?\\:\\:" + subexp(H16$ + "\\:") + "{2}" + LS32$), //[ *2( h16 ":" ) h16 ] "::" 2( h16 ":" ) ls32 + IPV6ADDRESS6$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,3}" + H16$) + "?\\:\\:" + H16$ + "\\:" + LS32$), //[ *3( h16 ":" ) h16 ] "::" h16 ":" ls32 + IPV6ADDRESS7$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,4}" + H16$) + "?\\:\\:" + LS32$), //[ *4( h16 ":" ) h16 ] "::" ls32 + IPV6ADDRESS8$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,5}" + H16$) + "?\\:\\:" + H16$), //[ *5( h16 ":" ) h16 ] "::" h16 + IPV6ADDRESS9$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,6}" + H16$) + "?\\:\\:"), //[ *6( h16 ":" ) h16 ] "::" + IPV6ADDRESS$ = subexp([IPV6ADDRESS1$, IPV6ADDRESS2$, IPV6ADDRESS3$, IPV6ADDRESS4$, IPV6ADDRESS5$, IPV6ADDRESS6$, IPV6ADDRESS7$, IPV6ADDRESS8$, IPV6ADDRESS9$].join("|")), ZONEID$ = subexp(subexp(UNRESERVED$$ + "|" + PCT_ENCODED$) + "+"), //RFC 6874 + IPV6ADDRZ$ = subexp(IPV6ADDRESS$ + "\\%25" + ZONEID$), //RFC 6874 + IPV6ADDRZ_RELAXED$ = subexp(IPV6ADDRESS$ + subexp("\\%25|\\%(?!" + HEXDIG$$ + "{2})") + ZONEID$), //RFC 6874, with relaxed parsing rules + IPVFUTURE$ = subexp("[vV]" + HEXDIG$$ + "+\\." + merge(UNRESERVED$$, SUB_DELIMS$$, "[\\:]") + "+"), IP_LITERAL$ = subexp("\\[" + subexp(IPV6ADDRZ_RELAXED$ + "|" + IPV6ADDRESS$ + "|" + IPVFUTURE$) + "\\]"), //RFC 6874 + REG_NAME$ = subexp(subexp(PCT_ENCODED$ + "|" + merge(UNRESERVED$$, SUB_DELIMS$$)) + "*"), HOST$ = subexp(IP_LITERAL$ + "|" + IPV4ADDRESS$ + "(?!" + REG_NAME$ + ")" + "|" + REG_NAME$), PORT$ = subexp(DIGIT$$ + "*"), AUTHORITY$ = subexp(subexp(USERINFO$ + "@") + "?" + HOST$ + subexp("\\:" + PORT$) + "?"), PCHAR$ = subexp(PCT_ENCODED$ + "|" + merge(UNRESERVED$$, SUB_DELIMS$$, "[\\:\\@]")), SEGMENT$ = subexp(PCHAR$ + "*"), SEGMENT_NZ$ = subexp(PCHAR$ + "+"), SEGMENT_NZ_NC$ = subexp(subexp(PCT_ENCODED$ + "|" + merge(UNRESERVED$$, SUB_DELIMS$$, "[\\@]")) + "+"), PATH_ABEMPTY$ = subexp(subexp("\\/" + SEGMENT$) + "*"), PATH_ABSOLUTE$ = subexp("\\/" + subexp(SEGMENT_NZ$ + PATH_ABEMPTY$) + "?"), //simplified + PATH_NOSCHEME$ = subexp(SEGMENT_NZ_NC$ + PATH_ABEMPTY$), //simplified + PATH_ROOTLESS$ = subexp(SEGMENT_NZ$ + PATH_ABEMPTY$), //simplified + PATH_EMPTY$ = "(?!" + PCHAR$ + ")", PATH$ = subexp(PATH_ABEMPTY$ + "|" + PATH_ABSOLUTE$ + "|" + PATH_NOSCHEME$ + "|" + PATH_ROOTLESS$ + "|" + PATH_EMPTY$), QUERY$ = subexp(subexp(PCHAR$ + "|" + merge("[\\/\\?]", IPRIVATE$$)) + "*"), FRAGMENT$ = subexp(subexp(PCHAR$ + "|[\\/\\?]") + "*"), HIER_PART$ = subexp(subexp("\\/\\/" + AUTHORITY$ + PATH_ABEMPTY$) + "|" + PATH_ABSOLUTE$ + "|" + PATH_ROOTLESS$ + "|" + PATH_EMPTY$), URI$ = subexp(SCHEME$ + "\\:" + HIER_PART$ + subexp("\\?" + QUERY$) + "?" + subexp("\\#" + FRAGMENT$) + "?"), RELATIVE_PART$ = subexp(subexp("\\/\\/" + AUTHORITY$ + PATH_ABEMPTY$) + "|" + PATH_ABSOLUTE$ + "|" + PATH_NOSCHEME$ + "|" + PATH_EMPTY$), RELATIVE$ = subexp(RELATIVE_PART$ + subexp("\\?" + QUERY$) + "?" + subexp("\\#" + FRAGMENT$) + "?"), URI_REFERENCE$ = subexp(URI$ + "|" + RELATIVE$), ABSOLUTE_URI$ = subexp(SCHEME$ + "\\:" + HIER_PART$ + subexp("\\?" + QUERY$) + "?"), GENERIC_REF$ = "^(" + SCHEME$ + ")\\:" + subexp(subexp("\\/\\/(" + subexp("(" + USERINFO$ + ")@") + "?(" + HOST$ + ")" + subexp("\\:(" + PORT$ + ")") + "?)") + "?(" + PATH_ABEMPTY$ + "|" + PATH_ABSOLUTE$ + "|" + PATH_ROOTLESS$ + "|" + PATH_EMPTY$ + ")") + subexp("\\?(" + QUERY$ + ")") + "?" + subexp("\\#(" + FRAGMENT$ + ")") + "?$", RELATIVE_REF$ = "^(){0}" + subexp(subexp("\\/\\/(" + subexp("(" + USERINFO$ + ")@") + "?(" + HOST$ + ")" + subexp("\\:(" + PORT$ + ")") + "?)") + "?(" + PATH_ABEMPTY$ + "|" + PATH_ABSOLUTE$ + "|" + PATH_NOSCHEME$ + "|" + PATH_EMPTY$ + ")") + subexp("\\?(" + QUERY$ + ")") + "?" + subexp("\\#(" + FRAGMENT$ + ")") + "?$", ABSOLUTE_REF$ = "^(" + SCHEME$ + ")\\:" + subexp(subexp("\\/\\/(" + subexp("(" + USERINFO$ + ")@") + "?(" + HOST$ + ")" + subexp("\\:(" + PORT$ + ")") + "?)") + "?(" + PATH_ABEMPTY$ + "|" + PATH_ABSOLUTE$ + "|" + PATH_ROOTLESS$ + "|" + PATH_EMPTY$ + ")") + subexp("\\?(" + QUERY$ + ")") + "?$", SAMEDOC_REF$ = "^" + subexp("\\#(" + FRAGMENT$ + ")") + "?$", AUTHORITY_REF$ = "^" + subexp("(" + USERINFO$ + ")@") + "?(" + HOST$ + ")" + subexp("\\:(" + PORT$ + ")") + "?$"; + return { + NOT_SCHEME: new RegExp(merge("[^]", ALPHA$$, DIGIT$$, "[\\+\\-\\.]"), "g"), + NOT_USERINFO: new RegExp(merge("[^\\%\\:]", UNRESERVED$$, SUB_DELIMS$$), "g"), + NOT_HOST: new RegExp(merge("[^\\%\\[\\]\\:]", UNRESERVED$$, SUB_DELIMS$$), "g"), + NOT_PATH: new RegExp(merge("[^\\%\\/\\:\\@]", UNRESERVED$$, SUB_DELIMS$$), "g"), + NOT_PATH_NOSCHEME: new RegExp(merge("[^\\%\\/\\@]", UNRESERVED$$, SUB_DELIMS$$), "g"), + NOT_QUERY: new RegExp(merge("[^\\%]", UNRESERVED$$, SUB_DELIMS$$, "[\\:\\@\\/\\?]", IPRIVATE$$), "g"), + NOT_FRAGMENT: new RegExp(merge("[^\\%]", UNRESERVED$$, SUB_DELIMS$$, "[\\:\\@\\/\\?]"), "g"), + ESCAPE: new RegExp(merge("[^]", UNRESERVED$$, SUB_DELIMS$$), "g"), + UNRESERVED: new RegExp(UNRESERVED$$, "g"), + OTHER_CHARS: new RegExp(merge("[^\\%]", UNRESERVED$$, RESERVED$$), "g"), + PCT_ENCODED: new RegExp(PCT_ENCODED$, "g"), + IPV4ADDRESS: new RegExp("^(" + IPV4ADDRESS$ + ")$"), + IPV6ADDRESS: new RegExp("^\\[?(" + IPV6ADDRESS$ + ")" + subexp(subexp("\\%25|\\%(?!" + HEXDIG$$ + "{2})") + "(" + ZONEID$ + ")") + "?\\]?$") //RFC 6874, with relaxed parsing rules + }; +} +export default buildExps(false); +//# sourceMappingURL=regexps-uri.js.map \ No newline at end of file diff --git a/deps/npm/node_modules/uri-js/dist/esnext/regexps-uri.js.map b/deps/npm/node_modules/uri-js/dist/esnext/regexps-uri.js.map new file mode 100755 index 00000000000000..cb028b804e3d5e --- /dev/null +++ b/deps/npm/node_modules/uri-js/dist/esnext/regexps-uri.js.map @@ -0,0 +1 @@ +{"version":3,"file":"regexps-uri.js","sourceRoot":"","sources":["../../src/regexps-uri.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEvC,MAAM,oBAAoB,KAAa;IACtC,MACC,OAAO,GAAG,UAAU,EACpB,GAAG,GAAG,SAAS,EACf,OAAO,GAAG,OAAO,EACjB,QAAQ,GAAG,SAAS,EACpB,QAAQ,GAAG,KAAK,CAAC,OAAO,EAAE,UAAU,CAAC,EAAG,kBAAkB;IAC1D,IAAI,GAAG,SAAS,EAChB,IAAI,GAAG,SAAS,EAChB,YAAY,GAAG,MAAM,CAAC,MAAM,CAAC,SAAS,GAAG,QAAQ,GAAG,GAAG,GAAG,QAAQ,GAAG,QAAQ,GAAG,GAAG,GAAG,QAAQ,GAAG,QAAQ,CAAC,GAAG,GAAG,GAAG,MAAM,CAAC,aAAa,GAAG,QAAQ,GAAG,GAAG,GAAG,QAAQ,GAAG,QAAQ,CAAC,GAAG,GAAG,GAAG,MAAM,CAAC,GAAG,GAAG,QAAQ,GAAG,QAAQ,CAAC,CAAC,EAAG,UAAU;IACvO,YAAY,GAAG,yBAAyB,EACxC,YAAY,GAAG,qCAAqC,EACpD,UAAU,GAAG,KAAK,CAAC,YAAY,EAAE,YAAY,CAAC,EAC9C,SAAS,GAAG,KAAK,CAAC,CAAC,CAAC,6EAA6E,CAAC,CAAC,CAAC,IAAI,EAAG,0CAA0C;IACrJ,UAAU,GAAG,KAAK,CAAC,CAAC,CAAC,mBAAmB,CAAC,CAAC,CAAC,IAAI,EAAG,QAAQ;IAC1D,YAAY,GAAG,KAAK,CAAC,OAAO,EAAE,OAAO,EAAE,gBAAgB,EAAE,SAAS,CAAC,EACnE,OAAO,GAAG,MAAM,CAAC,OAAO,GAAG,KAAK,CAAC,OAAO,EAAE,OAAO,EAAE,aAAa,CAAC,GAAG,GAAG,CAAC,EACxE,SAAS,GAAG,MAAM,CAAC,MAAM,CAAC,YAAY,GAAG,GAAG,GAAG,KAAK,CAAC,YAAY,EAAE,YAAY,EAAE,OAAO,CAAC,CAAC,GAAG,GAAG,CAAC,EACjG,UAAU,GAAG,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,GAAG,GAAG,GAAG,MAAM,CAAC,QAAQ,GAAG,OAAO,CAAC,GAAG,GAAG,GAAG,MAAM,CAAC,GAAG,GAAG,OAAO,GAAG,OAAO,CAAC,GAAG,GAAG,GAAG,MAAM,CAAC,OAAO,GAAG,OAAO,CAAC,GAAG,GAAG,GAAG,OAAO,CAAC,EACnK,kBAAkB,GAAG,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,GAAG,GAAG,GAAG,MAAM,CAAC,QAAQ,GAAG,OAAO,CAAC,GAAG,GAAG,GAAG,MAAM,CAAC,GAAG,GAAG,OAAO,GAAG,OAAO,CAAC,GAAG,GAAG,GAAG,MAAM,CAAC,SAAS,GAAG,OAAO,CAAC,GAAG,OAAO,GAAG,OAAO,CAAC,EAAG,uBAAuB;IAC3M,YAAY,GAAG,MAAM,CAAC,kBAAkB,GAAG,KAAK,GAAG,kBAAkB,GAAG,KAAK,GAAG,kBAAkB,GAAG,KAAK,GAAG,kBAAkB,CAAC,EAChI,IAAI,GAAG,MAAM,CAAC,QAAQ,GAAG,OAAO,CAAC,EACjC,KAAK,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,GAAG,KAAK,GAAG,IAAI,CAAC,GAAG,GAAG,GAAG,YAAY,CAAC,EAChE,aAAa,GAAG,MAAM,CAA6D,MAAM,CAAC,IAAI,GAAG,KAAK,CAAC,GAAG,KAAK,GAAG,KAAK,CAAC,EAAE,8CAA8C;IACxK,aAAa,GAAG,MAAM,CAAkD,QAAQ,GAAG,MAAM,CAAC,IAAI,GAAG,KAAK,CAAC,GAAG,KAAK,GAAG,KAAK,CAAC,EAAE,8CAA8C;IACxK,aAAa,GAAG,MAAM,CAAC,MAAM,CAAkC,IAAI,CAAC,GAAG,SAAS,GAAG,MAAM,CAAC,IAAI,GAAG,KAAK,CAAC,GAAG,KAAK,GAAG,KAAK,CAAC,EAAE,8CAA8C;IACxK,aAAa,GAAG,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,GAAG,KAAK,CAAC,GAAG,OAAO,GAAG,IAAI,CAAC,GAAG,SAAS,GAAG,MAAM,CAAC,IAAI,GAAG,KAAK,CAAC,GAAG,KAAK,GAAG,KAAK,CAAC,EAAE,8CAA8C;IACxK,aAAa,GAAG,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,GAAG,KAAK,CAAC,GAAG,OAAO,GAAG,IAAI,CAAC,GAAG,SAAS,GAAG,MAAM,CAAC,IAAI,GAAG,KAAK,CAAC,GAAG,KAAK,GAAG,KAAK,CAAC,EAAE,8CAA8C;IACxK,aAAa,GAAG,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,GAAG,KAAK,CAAC,GAAG,OAAO,GAAG,IAAI,CAAC,GAAG,SAAS,GAAU,IAAI,GAAG,KAAK,GAAY,KAAK,CAAC,EAAE,8CAA8C;IACxK,aAAa,GAAG,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,GAAG,KAAK,CAAC,GAAG,OAAO,GAAG,IAAI,CAAC,GAAG,SAAS,GAAkC,KAAK,CAAC,EAAE,8CAA8C;IACxK,aAAa,GAAG,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,GAAG,KAAK,CAAC,GAAG,OAAO,GAAG,IAAI,CAAC,GAAG,SAAS,GAAkC,IAAI,CAAE,EAAE,6CAA6C;IACvK,aAAa,GAAG,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,GAAG,KAAK,CAAC,GAAG,OAAO,GAAG,IAAI,CAAC,GAAG,SAAS,CAAwC,EAAE,4BAA4B;IACtJ,YAAY,GAAG,MAAM,CAAC,CAAC,aAAa,EAAE,aAAa,EAAE,aAAa,EAAE,aAAa,EAAE,aAAa,EAAE,aAAa,EAAE,aAAa,EAAE,aAAa,EAAE,aAAa,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EACxK,OAAO,GAAG,MAAM,CAAC,MAAM,CAAC,YAAY,GAAG,GAAG,GAAG,YAAY,CAAC,GAAG,GAAG,CAAC,EAAG,UAAU;IAC9E,UAAU,GAAG,MAAM,CAAC,YAAY,GAAG,OAAO,GAAG,OAAO,CAAC,EAAG,UAAU;IAClE,kBAAkB,GAAG,MAAM,CAAC,YAAY,GAAG,MAAM,CAAC,cAAc,GAAG,QAAQ,GAAG,MAAM,CAAC,GAAG,OAAO,CAAC,EAAG,sCAAsC;IACzI,UAAU,GAAG,MAAM,CAAC,MAAM,GAAG,QAAQ,GAAG,MAAM,GAAG,KAAK,CAAC,YAAY,EAAE,YAAY,EAAE,OAAO,CAAC,GAAG,GAAG,CAAC,EAClG,WAAW,GAAG,MAAM,CAAC,KAAK,GAAG,MAAM,CAAC,kBAAkB,GAAG,GAAG,GAAG,YAAY,GAAG,GAAG,GAAG,UAAU,CAAC,GAAG,KAAK,CAAC,EAAG,UAAU;IACrH,SAAS,GAAG,MAAM,CAAC,MAAM,CAAC,YAAY,GAAG,GAAG,GAAG,KAAK,CAAC,YAAY,EAAE,YAAY,CAAC,CAAC,GAAG,GAAG,CAAC,EACxF,KAAK,GAAG,MAAM,CAAC,WAAW,GAAG,GAAG,GAAG,YAAY,GAAG,KAAK,GAAG,SAAS,GAAG,GAAG,GAAG,GAAG,GAAG,SAAS,CAAC,EAC5F,KAAK,GAAG,MAAM,CAAC,OAAO,GAAG,GAAG,CAAC,EAC7B,UAAU,GAAG,MAAM,CAAC,MAAM,CAAC,SAAS,GAAG,GAAG,CAAC,GAAG,GAAG,GAAG,KAAK,GAAG,MAAM,CAAC,KAAK,GAAG,KAAK,CAAC,GAAG,GAAG,CAAC,EACxF,MAAM,GAAG,MAAM,CAAC,YAAY,GAAG,GAAG,GAAG,KAAK,CAAC,YAAY,EAAE,YAAY,EAAE,UAAU,CAAC,CAAC,EACnF,QAAQ,GAAG,MAAM,CAAC,MAAM,GAAG,GAAG,CAAC,EAC/B,WAAW,GAAG,MAAM,CAAC,MAAM,GAAG,GAAG,CAAC,EAClC,cAAc,GAAG,MAAM,CAAC,MAAM,CAAC,YAAY,GAAG,GAAG,GAAG,KAAK,CAAC,YAAY,EAAE,YAAY,EAAE,OAAO,CAAC,CAAC,GAAG,GAAG,CAAC,EACtG,aAAa,GAAG,MAAM,CAAC,MAAM,CAAC,KAAK,GAAG,QAAQ,CAAC,GAAG,GAAG,CAAC,EACtD,cAAc,GAAG,MAAM,CAAC,KAAK,GAAG,MAAM,CAAC,WAAW,GAAG,aAAa,CAAC,GAAG,GAAG,CAAC,EAAG,YAAY;IACzF,cAAc,GAAG,MAAM,CAAC,cAAc,GAAG,aAAa,CAAC,EAAG,YAAY;IACtE,cAAc,GAAG,MAAM,CAAC,WAAW,GAAG,aAAa,CAAC,EAAG,YAAY;IACnE,WAAW,GAAG,KAAK,GAAG,MAAM,GAAG,GAAG,EAClC,KAAK,GAAG,MAAM,CAAC,aAAa,GAAG,GAAG,GAAG,cAAc,GAAG,GAAG,GAAG,cAAc,GAAG,GAAG,GAAG,cAAc,GAAG,GAAG,GAAG,WAAW,CAAC,EACtH,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,MAAM,GAAG,GAAG,GAAG,KAAK,CAAC,UAAU,EAAE,UAAU,CAAC,CAAC,GAAG,GAAG,CAAC,EAC3E,SAAS,GAAG,MAAM,CAAC,MAAM,CAAC,MAAM,GAAG,WAAW,CAAC,GAAG,GAAG,CAAC,EACtD,UAAU,GAAG,MAAM,CAAC,MAAM,CAAC,QAAQ,GAAG,UAAU,GAAG,aAAa,CAAC,GAAG,GAAG,GAAG,cAAc,GAAG,GAAG,GAAG,cAAc,GAAG,GAAG,GAAG,WAAW,CAAC,EACpI,IAAI,GAAG,MAAM,CAAC,OAAO,GAAG,KAAK,GAAG,UAAU,GAAG,MAAM,CAAC,KAAK,GAAG,MAAM,CAAC,GAAG,GAAG,GAAG,MAAM,CAAC,KAAK,GAAG,SAAS,CAAC,GAAG,GAAG,CAAC,EAC5G,cAAc,GAAG,MAAM,CAAC,MAAM,CAAC,QAAQ,GAAG,UAAU,GAAG,aAAa,CAAC,GAAG,GAAG,GAAG,cAAc,GAAG,GAAG,GAAG,cAAc,GAAG,GAAG,GAAG,WAAW,CAAC,EACxI,SAAS,GAAG,MAAM,CAAC,cAAc,GAAG,MAAM,CAAC,KAAK,GAAG,MAAM,CAAC,GAAG,GAAG,GAAG,MAAM,CAAC,KAAK,GAAG,SAAS,CAAC,GAAG,GAAG,CAAC,EACnG,cAAc,GAAG,MAAM,CAAC,IAAI,GAAG,GAAG,GAAG,SAAS,CAAC,EAC/C,aAAa,GAAG,MAAM,CAAC,OAAO,GAAG,KAAK,GAAG,UAAU,GAAG,MAAM,CAAC,KAAK,GAAG,MAAM,CAAC,GAAG,GAAG,CAAC,EAEnF,YAAY,GAAG,IAAI,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,SAAS,GAAG,MAAM,CAAC,GAAG,GAAG,SAAS,GAAG,IAAI,CAAC,GAAG,IAAI,GAAG,KAAK,GAAG,GAAG,GAAG,MAAM,CAAC,MAAM,GAAG,KAAK,GAAG,GAAG,CAAC,GAAG,IAAI,CAAC,GAAG,IAAI,GAAG,aAAa,GAAG,GAAG,GAAG,cAAc,GAAG,GAAG,GAAG,cAAc,GAAG,GAAG,GAAG,WAAW,GAAG,GAAG,CAAC,GAAG,MAAM,CAAC,MAAM,GAAG,MAAM,GAAG,GAAG,CAAC,GAAG,GAAG,GAAG,MAAM,CAAC,MAAM,GAAG,SAAS,GAAG,GAAG,CAAC,GAAG,IAAI,EAC7U,aAAa,GAAG,QAAQ,GAAG,MAAM,CAAC,MAAM,CAAC,SAAS,GAAG,MAAM,CAAC,GAAG,GAAG,SAAS,GAAG,IAAI,CAAC,GAAG,IAAI,GAAG,KAAK,GAAG,GAAG,GAAG,MAAM,CAAC,MAAM,GAAG,KAAK,GAAG,GAAG,CAAC,GAAG,IAAI,CAAC,GAAG,IAAI,GAAG,aAAa,GAAG,GAAG,GAAG,cAAc,GAAG,GAAG,GAAG,cAAc,GAAG,GAAG,GAAG,WAAW,GAAG,GAAG,CAAC,GAAG,MAAM,CAAC,MAAM,GAAG,MAAM,GAAG,GAAG,CAAC,GAAG,GAAG,GAAG,MAAM,CAAC,MAAM,GAAG,SAAS,GAAG,GAAG,CAAC,GAAG,IAAI,EAC/T,aAAa,GAAG,IAAI,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,SAAS,GAAG,MAAM,CAAC,GAAG,GAAG,SAAS,GAAG,IAAI,CAAC,GAAG,IAAI,GAAG,KAAK,GAAG,GAAG,GAAG,MAAM,CAAC,MAAM,GAAG,KAAK,GAAG,GAAG,CAAC,GAAG,IAAI,CAAC,GAAG,IAAI,GAAG,aAAa,GAAG,GAAG,GAAG,cAAc,GAAG,GAAG,GAAG,cAAc,GAAG,GAAG,GAAG,WAAW,GAAG,GAAG,CAAC,GAAG,MAAM,CAAC,MAAM,GAAG,MAAM,GAAG,GAAG,CAAC,GAAG,IAAI,EACrS,YAAY,GAAG,GAAG,GAAG,MAAM,CAAC,MAAM,GAAG,SAAS,GAAG,GAAG,CAAC,GAAG,IAAI,EAC5D,cAAc,GAAG,GAAG,GAAG,MAAM,CAAC,GAAG,GAAG,SAAS,GAAG,IAAI,CAAC,GAAG,IAAI,GAAG,KAAK,GAAG,GAAG,GAAG,MAAM,CAAC,MAAM,GAAG,KAAK,GAAG,GAAG,CAAC,GAAG,IAAI,CAChH;IAED,OAAO;QACN,UAAU,EAAG,IAAI,MAAM,CAAC,KAAK,CAAC,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,aAAa,CAAC,EAAE,GAAG,CAAC;QAC3E,YAAY,EAAG,IAAI,MAAM,CAAC,KAAK,CAAC,WAAW,EAAE,YAAY,EAAE,YAAY,CAAC,EAAE,GAAG,CAAC;QAC9E,QAAQ,EAAG,IAAI,MAAM,CAAC,KAAK,CAAC,iBAAiB,EAAE,YAAY,EAAE,YAAY,CAAC,EAAE,GAAG,CAAC;QAChF,QAAQ,EAAG,IAAI,MAAM,CAAC,KAAK,CAAC,iBAAiB,EAAE,YAAY,EAAE,YAAY,CAAC,EAAE,GAAG,CAAC;QAChF,iBAAiB,EAAG,IAAI,MAAM,CAAC,KAAK,CAAC,cAAc,EAAE,YAAY,EAAE,YAAY,CAAC,EAAE,GAAG,CAAC;QACtF,SAAS,EAAG,IAAI,MAAM,CAAC,KAAK,CAAC,QAAQ,EAAE,YAAY,EAAE,YAAY,EAAE,gBAAgB,EAAE,UAAU,CAAC,EAAE,GAAG,CAAC;QACtG,YAAY,EAAG,IAAI,MAAM,CAAC,KAAK,CAAC,QAAQ,EAAE,YAAY,EAAE,YAAY,EAAE,gBAAgB,CAAC,EAAE,GAAG,CAAC;QAC7F,MAAM,EAAG,IAAI,MAAM,CAAC,KAAK,CAAC,KAAK,EAAE,YAAY,EAAE,YAAY,CAAC,EAAE,GAAG,CAAC;QAClE,UAAU,EAAG,IAAI,MAAM,CAAC,YAAY,EAAE,GAAG,CAAC;QAC1C,WAAW,EAAG,IAAI,MAAM,CAAC,KAAK,CAAC,QAAQ,EAAE,YAAY,EAAE,UAAU,CAAC,EAAE,GAAG,CAAC;QACxE,WAAW,EAAG,IAAI,MAAM,CAAC,YAAY,EAAE,GAAG,CAAC;QAC3C,WAAW,EAAG,IAAI,MAAM,CAAC,IAAI,GAAG,YAAY,GAAG,IAAI,CAAC;QACpD,WAAW,EAAG,IAAI,MAAM,CAAC,QAAQ,GAAG,YAAY,GAAG,GAAG,GAAG,MAAM,CAAC,MAAM,CAAC,cAAc,GAAG,QAAQ,GAAG,MAAM,CAAC,GAAG,GAAG,GAAG,OAAO,GAAG,GAAG,CAAC,GAAG,QAAQ,CAAC,CAAE,sCAAsC;KACrL,CAAC;AACH,CAAC;AAED,eAAe,SAAS,CAAC,KAAK,CAAC,CAAC"} \ No newline at end of file diff --git a/deps/npm/node_modules/uri-js/dist/esnext/schemes/http.d.ts b/deps/npm/node_modules/uri-js/dist/esnext/schemes/http.d.ts new file mode 100755 index 00000000000000..fe5b2f354241bb --- /dev/null +++ b/deps/npm/node_modules/uri-js/dist/esnext/schemes/http.d.ts @@ -0,0 +1,3 @@ +import { URISchemeHandler } from "../uri"; +declare const handler: URISchemeHandler; +export default handler; diff --git a/deps/npm/node_modules/uri-js/dist/esnext/schemes/http.js b/deps/npm/node_modules/uri-js/dist/esnext/schemes/http.js new file mode 100755 index 00000000000000..6abf0fe6e3f1f8 --- /dev/null +++ b/deps/npm/node_modules/uri-js/dist/esnext/schemes/http.js @@ -0,0 +1,28 @@ +const handler = { + scheme: "http", + domainHost: true, + parse: function (components, options) { + //report missing host + if (!components.host) { + components.error = components.error || "HTTP URIs must have a host."; + } + return components; + }, + serialize: function (components, options) { + const secure = String(components.scheme).toLowerCase() === "https"; + //normalize the default port + if (components.port === (secure ? 443 : 80) || components.port === "") { + components.port = undefined; + } + //normalize the empty path + if (!components.path) { + components.path = "/"; + } + //NOTE: We do not parse query strings for HTTP URIs + //as WWW Form Url Encoded query strings are part of the HTML4+ spec, + //and not the HTTP spec. + return components; + } +}; +export default handler; +//# sourceMappingURL=http.js.map \ No newline at end of file diff --git a/deps/npm/node_modules/uri-js/dist/esnext/schemes/http.js.map b/deps/npm/node_modules/uri-js/dist/esnext/schemes/http.js.map new file mode 100755 index 00000000000000..82118970c54de6 --- /dev/null +++ b/deps/npm/node_modules/uri-js/dist/esnext/schemes/http.js.map @@ -0,0 +1 @@ +{"version":3,"file":"http.js","sourceRoot":"","sources":["../../../src/schemes/http.ts"],"names":[],"mappings":"AAEA,MAAM,OAAO,GAAoB;IAChC,MAAM,EAAG,MAAM;IAEf,UAAU,EAAG,IAAI;IAEjB,KAAK,EAAG,UAAU,UAAwB,EAAE,OAAkB;QAC7D,qBAAqB;QACrB,IAAI,CAAC,UAAU,CAAC,IAAI,EAAE;YACrB,UAAU,CAAC,KAAK,GAAG,UAAU,CAAC,KAAK,IAAI,6BAA6B,CAAC;SACrE;QAED,OAAO,UAAU,CAAC;IACnB,CAAC;IAED,SAAS,EAAG,UAAU,UAAwB,EAAE,OAAkB;QACjE,MAAM,MAAM,GAAG,MAAM,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,WAAW,EAAE,KAAK,OAAO,CAAC;QAEnE,4BAA4B;QAC5B,IAAI,UAAU,CAAC,IAAI,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,UAAU,CAAC,IAAI,KAAK,EAAE,EAAE;YACtE,UAAU,CAAC,IAAI,GAAG,SAAS,CAAC;SAC5B;QAED,0BAA0B;QAC1B,IAAI,CAAC,UAAU,CAAC,IAAI,EAAE;YACrB,UAAU,CAAC,IAAI,GAAG,GAAG,CAAC;SACtB;QAED,mDAAmD;QACnD,oEAAoE;QACpE,wBAAwB;QAExB,OAAO,UAAU,CAAC;IACnB,CAAC;CACD,CAAC;AAEF,eAAe,OAAO,CAAC"} \ No newline at end of file diff --git a/deps/npm/node_modules/uri-js/dist/esnext/schemes/https.d.ts b/deps/npm/node_modules/uri-js/dist/esnext/schemes/https.d.ts new file mode 100755 index 00000000000000..fe5b2f354241bb --- /dev/null +++ b/deps/npm/node_modules/uri-js/dist/esnext/schemes/https.d.ts @@ -0,0 +1,3 @@ +import { URISchemeHandler } from "../uri"; +declare const handler: URISchemeHandler; +export default handler; diff --git a/deps/npm/node_modules/uri-js/dist/esnext/schemes/https.js b/deps/npm/node_modules/uri-js/dist/esnext/schemes/https.js new file mode 100755 index 00000000000000..ec4b6e76de671b --- /dev/null +++ b/deps/npm/node_modules/uri-js/dist/esnext/schemes/https.js @@ -0,0 +1,9 @@ +import http from "./http"; +const handler = { + scheme: "https", + domainHost: http.domainHost, + parse: http.parse, + serialize: http.serialize +}; +export default handler; +//# sourceMappingURL=https.js.map \ No newline at end of file diff --git a/deps/npm/node_modules/uri-js/dist/esnext/schemes/https.js.map b/deps/npm/node_modules/uri-js/dist/esnext/schemes/https.js.map new file mode 100755 index 00000000000000..385b8efeaa0366 --- /dev/null +++ b/deps/npm/node_modules/uri-js/dist/esnext/schemes/https.js.map @@ -0,0 +1 @@ +{"version":3,"file":"https.js","sourceRoot":"","sources":["../../../src/schemes/https.ts"],"names":[],"mappings":"AACA,OAAO,IAAI,MAAM,QAAQ,CAAC;AAE1B,MAAM,OAAO,GAAoB;IAChC,MAAM,EAAG,OAAO;IAChB,UAAU,EAAG,IAAI,CAAC,UAAU;IAC5B,KAAK,EAAG,IAAI,CAAC,KAAK;IAClB,SAAS,EAAG,IAAI,CAAC,SAAS;CAC1B,CAAA;AAED,eAAe,OAAO,CAAC"} \ No newline at end of file diff --git a/deps/npm/node_modules/uri-js/dist/esnext/schemes/mailto.d.ts b/deps/npm/node_modules/uri-js/dist/esnext/schemes/mailto.d.ts new file mode 100755 index 00000000000000..e2aefc2afd1637 --- /dev/null +++ b/deps/npm/node_modules/uri-js/dist/esnext/schemes/mailto.d.ts @@ -0,0 +1,12 @@ +import { URISchemeHandler, URIComponents } from "../uri"; +export interface MailtoHeaders { + [hfname: string]: string; +} +export interface MailtoComponents extends URIComponents { + to: Array; + headers?: MailtoHeaders; + subject?: string; + body?: string; +} +declare const handler: URISchemeHandler; +export default handler; diff --git a/deps/npm/node_modules/uri-js/dist/esnext/schemes/mailto.js b/deps/npm/node_modules/uri-js/dist/esnext/schemes/mailto.js new file mode 100755 index 00000000000000..2553713cde8c8b --- /dev/null +++ b/deps/npm/node_modules/uri-js/dist/esnext/schemes/mailto.js @@ -0,0 +1,148 @@ +import { pctEncChar, pctDecChars, unescapeComponent } from "../uri"; +import punycode from "punycode"; +import { merge, subexp, toUpperCase, toArray } from "../util"; +const O = {}; +const isIRI = true; +//RFC 3986 +const UNRESERVED$$ = "[A-Za-z0-9\\-\\.\\_\\~" + (isIRI ? "\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF" : "") + "]"; +const HEXDIG$$ = "[0-9A-Fa-f]"; //case-insensitive +const PCT_ENCODED$ = subexp(subexp("%[EFef]" + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$) + "|" + subexp("%[89A-Fa-f]" + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$) + "|" + subexp("%" + HEXDIG$$ + HEXDIG$$)); //expanded +//RFC 5322, except these symbols as per RFC 6068: @ : / ? # [ ] & ; = +//const ATEXT$$ = "[A-Za-z0-9\\!\\#\\$\\%\\&\\'\\*\\+\\-\\/\\=\\?\\^\\_\\`\\{\\|\\}\\~]"; +//const WSP$$ = "[\\x20\\x09]"; +//const OBS_QTEXT$$ = "[\\x01-\\x08\\x0B\\x0C\\x0E-\\x1F\\x7F]"; //(%d1-8 / %d11-12 / %d14-31 / %d127) +//const QTEXT$$ = merge("[\\x21\\x23-\\x5B\\x5D-\\x7E]", OBS_QTEXT$$); //%d33 / %d35-91 / %d93-126 / obs-qtext +//const VCHAR$$ = "[\\x21-\\x7E]"; +//const WSP$$ = "[\\x20\\x09]"; +//const OBS_QP$ = subexp("\\\\" + merge("[\\x00\\x0D\\x0A]", OBS_QTEXT$$)); //%d0 / CR / LF / obs-qtext +//const FWS$ = subexp(subexp(WSP$$ + "*" + "\\x0D\\x0A") + "?" + WSP$$ + "+"); +//const QUOTED_PAIR$ = subexp(subexp("\\\\" + subexp(VCHAR$$ + "|" + WSP$$)) + "|" + OBS_QP$); +//const QUOTED_STRING$ = subexp('\\"' + subexp(FWS$ + "?" + QCONTENT$) + "*" + FWS$ + "?" + '\\"'); +const ATEXT$$ = "[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]"; +const QTEXT$$ = "[\\!\\$\\%\\'\\(\\)\\*\\+\\,\\-\\.0-9\\<\\>A-Z\\x5E-\\x7E]"; +const VCHAR$$ = merge(QTEXT$$, "[\\\"\\\\]"); +const DOT_ATOM_TEXT$ = subexp(ATEXT$$ + "+" + subexp("\\." + ATEXT$$ + "+") + "*"); +const QUOTED_PAIR$ = subexp("\\\\" + VCHAR$$); +const QCONTENT$ = subexp(QTEXT$$ + "|" + QUOTED_PAIR$); +const QUOTED_STRING$ = subexp('\\"' + QCONTENT$ + "*" + '\\"'); +//RFC 6068 +const DTEXT_NO_OBS$$ = "[\\x21-\\x5A\\x5E-\\x7E]"; //%d33-90 / %d94-126 +const SOME_DELIMS$$ = "[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]"; +const QCHAR$ = subexp(UNRESERVED$$ + "|" + PCT_ENCODED$ + "|" + SOME_DELIMS$$); +const DOMAIN$ = subexp(DOT_ATOM_TEXT$ + "|" + "\\[" + DTEXT_NO_OBS$$ + "*" + "\\]"); +const LOCAL_PART$ = subexp(DOT_ATOM_TEXT$ + "|" + QUOTED_STRING$); +const ADDR_SPEC$ = subexp(LOCAL_PART$ + "\\@" + DOMAIN$); +const TO$ = subexp(ADDR_SPEC$ + subexp("\\," + ADDR_SPEC$) + "*"); +const HFNAME$ = subexp(QCHAR$ + "*"); +const HFVALUE$ = HFNAME$; +const HFIELD$ = subexp(HFNAME$ + "\\=" + HFVALUE$); +const HFIELDS2$ = subexp(HFIELD$ + subexp("\\&" + HFIELD$) + "*"); +const HFIELDS$ = subexp("\\?" + HFIELDS2$); +const MAILTO_URI = new RegExp("^mailto\\:" + TO$ + "?" + HFIELDS$ + "?$"); +const UNRESERVED = new RegExp(UNRESERVED$$, "g"); +const PCT_ENCODED = new RegExp(PCT_ENCODED$, "g"); +const NOT_LOCAL_PART = new RegExp(merge("[^]", ATEXT$$, "[\\.]", '[\\"]', VCHAR$$), "g"); +const NOT_DOMAIN = new RegExp(merge("[^]", ATEXT$$, "[\\.]", "[\\[]", DTEXT_NO_OBS$$, "[\\]]"), "g"); +const NOT_HFNAME = new RegExp(merge("[^]", UNRESERVED$$, SOME_DELIMS$$), "g"); +const NOT_HFVALUE = NOT_HFNAME; +const TO = new RegExp("^" + TO$ + "$"); +const HFIELDS = new RegExp("^" + HFIELDS2$ + "$"); +function decodeUnreserved(str) { + const decStr = pctDecChars(str); + return (!decStr.match(UNRESERVED) ? str : decStr); +} +const handler = { + scheme: "mailto", + parse: function (components, options) { + const mailtoComponents = components; + const to = mailtoComponents.to = (mailtoComponents.path ? mailtoComponents.path.split(",") : []); + mailtoComponents.path = undefined; + if (mailtoComponents.query) { + let unknownHeaders = false; + const headers = {}; + const hfields = mailtoComponents.query.split("&"); + for (let x = 0, xl = hfields.length; x < xl; ++x) { + const hfield = hfields[x].split("="); + switch (hfield[0]) { + case "to": + const toAddrs = hfield[1].split(","); + for (let x = 0, xl = toAddrs.length; x < xl; ++x) { + to.push(toAddrs[x]); + } + break; + case "subject": + mailtoComponents.subject = unescapeComponent(hfield[1], options); + break; + case "body": + mailtoComponents.body = unescapeComponent(hfield[1], options); + break; + default: + unknownHeaders = true; + headers[unescapeComponent(hfield[0], options)] = unescapeComponent(hfield[1], options); + break; + } + } + if (unknownHeaders) + mailtoComponents.headers = headers; + } + mailtoComponents.query = undefined; + for (let x = 0, xl = to.length; x < xl; ++x) { + const addr = to[x].split("@"); + addr[0] = unescapeComponent(addr[0]); + if (!options.unicodeSupport) { + //convert Unicode IDN -> ASCII IDN + try { + addr[1] = punycode.toASCII(unescapeComponent(addr[1], options).toLowerCase()); + } + catch (e) { + mailtoComponents.error = mailtoComponents.error || "Email address's domain name can not be converted to ASCII via punycode: " + e; + } + } + else { + addr[1] = unescapeComponent(addr[1], options).toLowerCase(); + } + to[x] = addr.join("@"); + } + return mailtoComponents; + }, + serialize: function (mailtoComponents, options) { + const components = mailtoComponents; + const to = toArray(mailtoComponents.to); + if (to) { + for (let x = 0, xl = to.length; x < xl; ++x) { + const toAddr = String(to[x]); + const atIdx = toAddr.lastIndexOf("@"); + const localPart = (toAddr.slice(0, atIdx)).replace(PCT_ENCODED, decodeUnreserved).replace(PCT_ENCODED, toUpperCase).replace(NOT_LOCAL_PART, pctEncChar); + let domain = toAddr.slice(atIdx + 1); + //convert IDN via punycode + try { + domain = (!options.iri ? punycode.toASCII(unescapeComponent(domain, options).toLowerCase()) : punycode.toUnicode(domain)); + } + catch (e) { + components.error = components.error || "Email address's domain name can not be converted to " + (!options.iri ? "ASCII" : "Unicode") + " via punycode: " + e; + } + to[x] = localPart + "@" + domain; + } + components.path = to.join(","); + } + const headers = mailtoComponents.headers = mailtoComponents.headers || {}; + if (mailtoComponents.subject) + headers["subject"] = mailtoComponents.subject; + if (mailtoComponents.body) + headers["body"] = mailtoComponents.body; + const fields = []; + for (const name in headers) { + if (headers[name] !== O[name]) { + fields.push(name.replace(PCT_ENCODED, decodeUnreserved).replace(PCT_ENCODED, toUpperCase).replace(NOT_HFNAME, pctEncChar) + + "=" + + headers[name].replace(PCT_ENCODED, decodeUnreserved).replace(PCT_ENCODED, toUpperCase).replace(NOT_HFVALUE, pctEncChar)); + } + } + if (fields.length) { + components.query = fields.join("&"); + } + return components; + } +}; +export default handler; +//# sourceMappingURL=mailto.js.map \ No newline at end of file diff --git a/deps/npm/node_modules/uri-js/dist/esnext/schemes/mailto.js.map b/deps/npm/node_modules/uri-js/dist/esnext/schemes/mailto.js.map new file mode 100755 index 00000000000000..82dba9a1612b09 --- /dev/null +++ b/deps/npm/node_modules/uri-js/dist/esnext/schemes/mailto.js.map @@ -0,0 +1 @@ +{"version":3,"file":"mailto.js","sourceRoot":"","sources":["../../../src/schemes/mailto.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,QAAQ,CAAC;AACpE,OAAO,QAAQ,MAAM,UAAU,CAAC;AAChC,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAa9D,MAAM,CAAC,GAAiB,EAAE,CAAC;AAC3B,MAAM,KAAK,GAAG,IAAI,CAAC;AAEnB,UAAU;AACV,MAAM,YAAY,GAAG,wBAAwB,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,2EAA2E,CAAC,CAAC,CAAC,EAAE,CAAC,GAAG,GAAG,CAAC;AACjJ,MAAM,QAAQ,GAAG,aAAa,CAAC,CAAE,kBAAkB;AACnD,MAAM,YAAY,GAAG,MAAM,CAAC,MAAM,CAAC,SAAS,GAAG,QAAQ,GAAG,GAAG,GAAG,QAAQ,GAAG,QAAQ,GAAG,GAAG,GAAG,QAAQ,GAAG,QAAQ,CAAC,GAAG,GAAG,GAAG,MAAM,CAAC,aAAa,GAAG,QAAQ,GAAG,GAAG,GAAG,QAAQ,GAAG,QAAQ,CAAC,GAAG,GAAG,GAAG,MAAM,CAAC,GAAG,GAAG,QAAQ,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAE,UAAU;AAE7O,qEAAqE;AACrE,yFAAyF;AACzF,+BAA+B;AAC/B,uGAAuG;AACvG,+GAA+G;AAC/G,kCAAkC;AAClC,+BAA+B;AAC/B,wGAAwG;AACxG,8EAA8E;AAC9E,8FAA8F;AAC9F,mGAAmG;AACnG,MAAM,OAAO,GAAG,uDAAuD,CAAC;AACxE,MAAM,OAAO,GAAG,4DAA4D,CAAC;AAC7E,MAAM,OAAO,GAAG,KAAK,CAAC,OAAO,EAAE,YAAY,CAAC,CAAC;AAC7C,MAAM,cAAc,GAAG,MAAM,CAAC,OAAO,GAAG,GAAG,GAAG,MAAM,CAAC,KAAK,GAAG,OAAO,GAAG,GAAG,CAAC,GAAG,GAAG,CAAC,CAAC;AACnF,MAAM,YAAY,GAAG,MAAM,CAAC,MAAM,GAAG,OAAO,CAAC,CAAC;AAC9C,MAAM,SAAS,GAAG,MAAM,CAAC,OAAO,GAAG,GAAG,GAAG,YAAY,CAAC,CAAC;AACvD,MAAM,cAAc,GAAG,MAAM,CAAC,KAAK,GAAG,SAAS,GAAG,GAAG,GAAG,KAAK,CAAC,CAAC;AAE/D,UAAU;AACV,MAAM,cAAc,GAAG,0BAA0B,CAAC,CAAE,oBAAoB;AACxE,MAAM,aAAa,GAAG,qCAAqC,CAAC;AAC5D,MAAM,MAAM,GAAG,MAAM,CAAC,YAAY,GAAG,GAAG,GAAG,YAAY,GAAG,GAAG,GAAG,aAAa,CAAC,CAAC;AAC/E,MAAM,OAAO,GAAG,MAAM,CAAC,cAAc,GAAG,GAAG,GAAG,KAAK,GAAG,cAAc,GAAG,GAAG,GAAG,KAAK,CAAC,CAAC;AACpF,MAAM,WAAW,GAAG,MAAM,CAAC,cAAc,GAAG,GAAG,GAAG,cAAc,CAAC,CAAC;AAClE,MAAM,UAAU,GAAG,MAAM,CAAC,WAAW,GAAG,KAAK,GAAG,OAAO,CAAC,CAAC;AACzD,MAAM,GAAG,GAAG,MAAM,CAAC,UAAU,GAAG,MAAM,CAAC,KAAK,GAAG,UAAU,CAAC,GAAG,GAAG,CAAC,CAAC;AAClE,MAAM,OAAO,GAAG,MAAM,CAAC,MAAM,GAAG,GAAG,CAAC,CAAC;AACrC,MAAM,QAAQ,GAAG,OAAO,CAAC;AACzB,MAAM,OAAO,GAAG,MAAM,CAAC,OAAO,GAAG,KAAK,GAAG,QAAQ,CAAC,CAAC;AACnD,MAAM,SAAS,GAAG,MAAM,CAAC,OAAO,GAAG,MAAM,CAAC,KAAK,GAAG,OAAO,CAAC,GAAG,GAAG,CAAC,CAAC;AAClE,MAAM,QAAQ,GAAG,MAAM,CAAC,KAAK,GAAG,SAAS,CAAC,CAAC;AAC3C,MAAM,UAAU,GAAG,IAAI,MAAM,CAAC,YAAY,GAAG,GAAG,GAAG,GAAG,GAAG,QAAQ,GAAG,IAAI,CAAC,CAAC;AAE1E,MAAM,UAAU,GAAG,IAAI,MAAM,CAAC,YAAY,EAAE,GAAG,CAAC,CAAC;AACjD,MAAM,WAAW,GAAG,IAAI,MAAM,CAAC,YAAY,EAAE,GAAG,CAAC,CAAC;AAClD,MAAM,cAAc,GAAG,IAAI,MAAM,CAAC,KAAK,CAAC,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,CAAC,EAAE,GAAG,CAAC,CAAC;AACzF,MAAM,UAAU,GAAG,IAAI,MAAM,CAAC,KAAK,CAAC,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,OAAO,CAAC,EAAE,GAAG,CAAC,CAAC;AACrG,MAAM,UAAU,GAAG,IAAI,MAAM,CAAC,KAAK,CAAC,KAAK,EAAE,YAAY,EAAE,aAAa,CAAC,EAAE,GAAG,CAAC,CAAC;AAC9E,MAAM,WAAW,GAAG,UAAU,CAAC;AAC/B,MAAM,EAAE,GAAG,IAAI,MAAM,CAAC,GAAG,GAAG,GAAG,GAAG,GAAG,CAAC,CAAC;AACvC,MAAM,OAAO,GAAG,IAAI,MAAM,CAAC,GAAG,GAAG,SAAS,GAAG,GAAG,CAAC,CAAC;AAElD,0BAA0B,GAAU;IACnC,MAAM,MAAM,GAAG,WAAW,CAAC,GAAG,CAAC,CAAC;IAChC,OAAO,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC;AACnD,CAAC;AAED,MAAM,OAAO,GAAuC;IACnD,MAAM,EAAG,QAAQ;IAEjB,KAAK,EAAG,UAAU,UAAwB,EAAE,OAAkB;QAC7D,MAAM,gBAAgB,GAAG,UAA8B,CAAC;QACxD,MAAM,EAAE,GAAG,gBAAgB,CAAC,EAAE,GAAG,CAAC,gBAAgB,CAAC,IAAI,CAAC,CAAC,CAAC,gBAAgB,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;QACjG,gBAAgB,CAAC,IAAI,GAAG,SAAS,CAAC;QAElC,IAAI,gBAAgB,CAAC,KAAK,EAAE;YAC3B,IAAI,cAAc,GAAG,KAAK,CAAA;YAC1B,MAAM,OAAO,GAAiB,EAAE,CAAC;YACjC,MAAM,OAAO,GAAG,gBAAgB,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;YAElD,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,EAAE,EAAE,CAAC,EAAE;gBACjD,MAAM,MAAM,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;gBAErC,QAAQ,MAAM,CAAC,CAAC,CAAC,EAAE;oBAClB,KAAK,IAAI;wBACR,MAAM,OAAO,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;wBACrC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,EAAE,EAAE,CAAC,EAAE;4BACjD,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC;yBACpB;wBACD,MAAM;oBACP,KAAK,SAAS;wBACb,gBAAgB,CAAC,OAAO,GAAG,iBAAiB,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC;wBACjE,MAAM;oBACP,KAAK,MAAM;wBACV,gBAAgB,CAAC,IAAI,GAAG,iBAAiB,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC;wBAC9D,MAAM;oBACP;wBACC,cAAc,GAAG,IAAI,CAAC;wBACtB,OAAO,CAAC,iBAAiB,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC,GAAG,iBAAiB,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC;wBACvF,MAAM;iBACP;aACD;YAED,IAAI,cAAc;gBAAE,gBAAgB,CAAC,OAAO,GAAG,OAAO,CAAC;SACvD;QAED,gBAAgB,CAAC,KAAK,GAAG,SAAS,CAAC;QAEnC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,GAAG,EAAE,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,EAAE,EAAE,CAAC,EAAE;YAC5C,MAAM,IAAI,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;YAE9B,IAAI,CAAC,CAAC,CAAC,GAAG,iBAAiB,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;YAErC,IAAI,CAAC,OAAO,CAAC,cAAc,EAAE;gBAC5B,kCAAkC;gBAClC,IAAI;oBACH,IAAI,CAAC,CAAC,CAAC,GAAG,QAAQ,CAAC,OAAO,CAAC,iBAAiB,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC;iBAC9E;gBAAC,OAAO,CAAC,EAAE;oBACX,gBAAgB,CAAC,KAAK,GAAG,gBAAgB,CAAC,KAAK,IAAI,0EAA0E,GAAG,CAAC,CAAC;iBAClI;aACD;iBAAM;gBACN,IAAI,CAAC,CAAC,CAAC,GAAG,iBAAiB,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC,WAAW,EAAE,CAAC;aAC5D;YAED,EAAE,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;SACvB;QAED,OAAO,gBAAgB,CAAC;IACzB,CAAC;IAED,SAAS,EAAG,UAAU,gBAAiC,EAAE,OAAkB;QAC1E,MAAM,UAAU,GAAG,gBAAiC,CAAC;QACrD,MAAM,EAAE,GAAG,OAAO,CAAC,gBAAgB,CAAC,EAAE,CAAC,CAAC;QACxC,IAAI,EAAE,EAAE;YACP,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,GAAG,EAAE,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,EAAE,EAAE,CAAC,EAAE;gBAC5C,MAAM,MAAM,GAAG,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;gBAC7B,MAAM,KAAK,GAAG,MAAM,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;gBACtC,MAAM,SAAS,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,WAAW,EAAE,gBAAgB,CAAC,CAAC,OAAO,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC,OAAO,CAAC,cAAc,EAAE,UAAU,CAAC,CAAC;gBACxJ,IAAI,MAAM,GAAG,MAAM,CAAC,KAAK,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC;gBAErC,0BAA0B;gBAC1B,IAAI;oBACH,MAAM,GAAG,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,iBAAiB,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC;iBAC1H;gBAAC,OAAO,CAAC,EAAE;oBACX,UAAU,CAAC,KAAK,GAAG,UAAU,CAAC,KAAK,IAAI,sDAAsD,GAAG,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,GAAG,iBAAiB,GAAG,CAAC,CAAC;iBAC7J;gBAED,EAAE,CAAC,CAAC,CAAC,GAAG,SAAS,GAAG,GAAG,GAAG,MAAM,CAAC;aACjC;YAED,UAAU,CAAC,IAAI,GAAG,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;SAC/B;QAED,MAAM,OAAO,GAAG,gBAAgB,CAAC,OAAO,GAAG,gBAAgB,CAAC,OAAO,IAAI,EAAE,CAAC;QAE1E,IAAI,gBAAgB,CAAC,OAAO;YAAE,OAAO,CAAC,SAAS,CAAC,GAAG,gBAAgB,CAAC,OAAO,CAAC;QAC5E,IAAI,gBAAgB,CAAC,IAAI;YAAE,OAAO,CAAC,MAAM,CAAC,GAAG,gBAAgB,CAAC,IAAI,CAAC;QAEnE,MAAM,MAAM,GAAG,EAAE,CAAC;QAClB,KAAK,MAAM,IAAI,IAAI,OAAO,EAAE;YAC3B,IAAI,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,EAAE;gBAC9B,MAAM,CAAC,IAAI,CACV,IAAI,CAAC,OAAO,CAAC,WAAW,EAAE,gBAAgB,CAAC,CAAC,OAAO,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC,OAAO,CAAC,UAAU,EAAE,UAAU,CAAC;oBAC7G,GAAG;oBACH,OAAO,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,WAAW,EAAE,gBAAgB,CAAC,CAAC,OAAO,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC,OAAO,CAAC,WAAW,EAAE,UAAU,CAAC,CACvH,CAAC;aACF;SACD;QACD,IAAI,MAAM,CAAC,MAAM,EAAE;YAClB,UAAU,CAAC,KAAK,GAAG,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;SACpC;QAED,OAAO,UAAU,CAAC;IACnB,CAAC;CACD,CAAA;AAED,eAAe,OAAO,CAAC"} \ No newline at end of file diff --git a/deps/npm/node_modules/uri-js/dist/esnext/schemes/urn-uuid.d.ts b/deps/npm/node_modules/uri-js/dist/esnext/schemes/urn-uuid.d.ts new file mode 100755 index 00000000000000..e75f2e793f929a --- /dev/null +++ b/deps/npm/node_modules/uri-js/dist/esnext/schemes/urn-uuid.d.ts @@ -0,0 +1,7 @@ +import { URISchemeHandler, URIOptions } from "../uri"; +import { URNComponents } from "./urn"; +export interface UUIDComponents extends URNComponents { + uuid?: string; +} +declare const handler: URISchemeHandler; +export default handler; diff --git a/deps/npm/node_modules/uri-js/dist/esnext/schemes/urn-uuid.js b/deps/npm/node_modules/uri-js/dist/esnext/schemes/urn-uuid.js new file mode 100755 index 00000000000000..d1fce495554812 --- /dev/null +++ b/deps/npm/node_modules/uri-js/dist/esnext/schemes/urn-uuid.js @@ -0,0 +1,23 @@ +const UUID = /^[0-9A-Fa-f]{8}(?:\-[0-9A-Fa-f]{4}){3}\-[0-9A-Fa-f]{12}$/; +const UUID_PARSE = /^[0-9A-Fa-f\-]{36}/; +//RFC 4122 +const handler = { + scheme: "urn:uuid", + parse: function (urnComponents, options) { + const uuidComponents = urnComponents; + uuidComponents.uuid = uuidComponents.nss; + uuidComponents.nss = undefined; + if (!options.tolerant && (!uuidComponents.uuid || !uuidComponents.uuid.match(UUID))) { + uuidComponents.error = uuidComponents.error || "UUID is not valid."; + } + return uuidComponents; + }, + serialize: function (uuidComponents, options) { + const urnComponents = uuidComponents; + //normalize UUID + urnComponents.nss = (uuidComponents.uuid || "").toLowerCase(); + return urnComponents; + }, +}; +export default handler; +//# sourceMappingURL=urn-uuid.js.map \ No newline at end of file diff --git a/deps/npm/node_modules/uri-js/dist/esnext/schemes/urn-uuid.js.map b/deps/npm/node_modules/uri-js/dist/esnext/schemes/urn-uuid.js.map new file mode 100755 index 00000000000000..3b7a8b3ae607c8 --- /dev/null +++ b/deps/npm/node_modules/uri-js/dist/esnext/schemes/urn-uuid.js.map @@ -0,0 +1 @@ +{"version":3,"file":"urn-uuid.js","sourceRoot":"","sources":["../../../src/schemes/urn-uuid.ts"],"names":[],"mappings":"AAQA,MAAM,IAAI,GAAG,0DAA0D,CAAC;AACxE,MAAM,UAAU,GAAG,oBAAoB,CAAC;AAExC,UAAU;AACV,MAAM,OAAO,GAA+D;IAC3E,MAAM,EAAG,UAAU;IAEnB,KAAK,EAAG,UAAU,aAA2B,EAAE,OAAkB;QAChE,MAAM,cAAc,GAAG,aAA+B,CAAC;QACvD,cAAc,CAAC,IAAI,GAAG,cAAc,CAAC,GAAG,CAAC;QACzC,cAAc,CAAC,GAAG,GAAG,SAAS,CAAC;QAE/B,IAAI,CAAC,OAAO,CAAC,QAAQ,IAAI,CAAC,CAAC,cAAc,CAAC,IAAI,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,EAAE;YACpF,cAAc,CAAC,KAAK,GAAG,cAAc,CAAC,KAAK,IAAI,oBAAoB,CAAC;SACpE;QAED,OAAO,cAAc,CAAC;IACvB,CAAC;IAED,SAAS,EAAG,UAAU,cAA6B,EAAE,OAAkB;QACtE,MAAM,aAAa,GAAG,cAA+B,CAAC;QACtD,gBAAgB;QAChB,aAAa,CAAC,GAAG,GAAG,CAAC,cAAc,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,WAAW,EAAE,CAAC;QAC9D,OAAO,aAAa,CAAC;IACtB,CAAC;CACD,CAAC;AAEF,eAAe,OAAO,CAAC"} \ No newline at end of file diff --git a/deps/npm/node_modules/uri-js/dist/esnext/schemes/urn.d.ts b/deps/npm/node_modules/uri-js/dist/esnext/schemes/urn.d.ts new file mode 100755 index 00000000000000..7e0c2fba6c6282 --- /dev/null +++ b/deps/npm/node_modules/uri-js/dist/esnext/schemes/urn.d.ts @@ -0,0 +1,10 @@ +import { URISchemeHandler, URIComponents, URIOptions } from "../uri"; +export interface URNComponents extends URIComponents { + nid?: string; + nss?: string; +} +export interface URNOptions extends URIOptions { + nid?: string; +} +declare const handler: URISchemeHandler; +export default handler; diff --git a/deps/npm/node_modules/uri-js/dist/esnext/schemes/urn.js b/deps/npm/node_modules/uri-js/dist/esnext/schemes/urn.js new file mode 100755 index 00000000000000..5d3f10aa0f8b13 --- /dev/null +++ b/deps/npm/node_modules/uri-js/dist/esnext/schemes/urn.js @@ -0,0 +1,49 @@ +import { SCHEMES } from "../uri"; +const NID$ = "(?:[0-9A-Za-z][0-9A-Za-z\\-]{1,31})"; +const PCT_ENCODED$ = "(?:\\%[0-9A-Fa-f]{2})"; +const TRANS$$ = "[0-9A-Za-z\\(\\)\\+\\,\\-\\.\\:\\=\\@\\;\\$\\_\\!\\*\\'\\/\\?\\#]"; +const NSS$ = "(?:(?:" + PCT_ENCODED$ + "|" + TRANS$$ + ")+)"; +const URN_SCHEME = new RegExp("^urn\\:(" + NID$ + ")$"); +const URN_PATH = new RegExp("^(" + NID$ + ")\\:(" + NSS$ + ")$"); +const URN_PARSE = /^([^\:]+)\:(.*)/; +const URN_EXCLUDED = /[\x00-\x20\\\"\&\<\>\[\]\^\`\{\|\}\~\x7F-\xFF]/g; +//RFC 2141 +const handler = { + scheme: "urn", + parse: function (components, options) { + const matches = components.path && components.path.match(URN_PARSE); + let urnComponents = components; + if (matches) { + const scheme = options.scheme || urnComponents.scheme || "urn"; + const nid = matches[1].toLowerCase(); + const nss = matches[2]; + const urnScheme = `${scheme}:${options.nid || nid}`; + const schemeHandler = SCHEMES[urnScheme]; + urnComponents.nid = nid; + urnComponents.nss = nss; + urnComponents.path = undefined; + if (schemeHandler) { + urnComponents = schemeHandler.parse(urnComponents, options); + } + } + else { + urnComponents.error = urnComponents.error || "URN can not be parsed."; + } + return urnComponents; + }, + serialize: function (urnComponents, options) { + const scheme = options.scheme || urnComponents.scheme || "urn"; + const nid = urnComponents.nid; + const urnScheme = `${scheme}:${options.nid || nid}`; + const schemeHandler = SCHEMES[urnScheme]; + if (schemeHandler) { + urnComponents = schemeHandler.serialize(urnComponents, options); + } + const uriComponents = urnComponents; + const nss = urnComponents.nss; + uriComponents.path = `${nid || options.nid}:${nss}`; + return uriComponents; + }, +}; +export default handler; +//# sourceMappingURL=urn.js.map \ No newline at end of file diff --git a/deps/npm/node_modules/uri-js/dist/esnext/schemes/urn.js.map b/deps/npm/node_modules/uri-js/dist/esnext/schemes/urn.js.map new file mode 100755 index 00000000000000..ea43b0bebc3a0b --- /dev/null +++ b/deps/npm/node_modules/uri-js/dist/esnext/schemes/urn.js.map @@ -0,0 +1 @@ +{"version":3,"file":"urn.js","sourceRoot":"","sources":["../../../src/schemes/urn.ts"],"names":[],"mappings":"AACA,OAAO,EAAc,OAAO,EAAE,MAAM,QAAQ,CAAC;AAW7C,MAAM,IAAI,GAAG,qCAAqC,CAAC;AACnD,MAAM,YAAY,GAAG,uBAAuB,CAAC;AAC7C,MAAM,OAAO,GAAG,mEAAmE,CAAC;AACpF,MAAM,IAAI,GAAG,QAAQ,GAAG,YAAY,GAAG,GAAG,GAAG,OAAO,GAAG,KAAK,CAAC;AAC7D,MAAM,UAAU,GAAG,IAAI,MAAM,CAAC,UAAU,GAAG,IAAI,GAAG,IAAI,CAAC,CAAC;AACxD,MAAM,QAAQ,GAAG,IAAI,MAAM,CAAC,IAAI,GAAG,IAAI,GAAG,OAAO,GAAG,IAAI,GAAG,IAAI,CAAC,CAAC;AACjE,MAAM,SAAS,GAAG,iBAAiB,CAAC;AACpC,MAAM,YAAY,GAAG,iDAAiD,CAAC;AAEvE,UAAU;AACV,MAAM,OAAO,GAA8C;IAC1D,MAAM,EAAG,KAAK;IAEd,KAAK,EAAG,UAAU,UAAwB,EAAE,OAAkB;QAC7D,MAAM,OAAO,GAAG,UAAU,CAAC,IAAI,IAAI,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;QACpE,IAAI,aAAa,GAAG,UAA2B,CAAC;QAEhD,IAAI,OAAO,EAAE;YACZ,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,IAAI,aAAa,CAAC,MAAM,IAAI,KAAK,CAAC;YAC/D,MAAM,GAAG,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC;YACrC,MAAM,GAAG,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;YACvB,MAAM,SAAS,GAAG,GAAG,MAAM,IAAI,OAAO,CAAC,GAAG,IAAI,GAAG,EAAE,CAAC;YACpD,MAAM,aAAa,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC;YAEzC,aAAa,CAAC,GAAG,GAAG,GAAG,CAAC;YACxB,aAAa,CAAC,GAAG,GAAG,GAAG,CAAC;YACxB,aAAa,CAAC,IAAI,GAAG,SAAS,CAAC;YAE/B,IAAI,aAAa,EAAE;gBAClB,aAAa,GAAG,aAAa,CAAC,KAAK,CAAC,aAAa,EAAE,OAAO,CAAkB,CAAC;aAC7E;SACD;aAAM;YACN,aAAa,CAAC,KAAK,GAAG,aAAa,CAAC,KAAK,IAAI,wBAAwB,CAAC;SACtE;QAED,OAAO,aAAa,CAAC;IACtB,CAAC;IAED,SAAS,EAAG,UAAU,aAA2B,EAAE,OAAkB;QACpE,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,IAAI,aAAa,CAAC,MAAM,IAAI,KAAK,CAAC;QAC/D,MAAM,GAAG,GAAG,aAAa,CAAC,GAAG,CAAC;QAC9B,MAAM,SAAS,GAAG,GAAG,MAAM,IAAI,OAAO,CAAC,GAAG,IAAI,GAAG,EAAE,CAAC;QACpD,MAAM,aAAa,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC;QAEzC,IAAI,aAAa,EAAE;YAClB,aAAa,GAAG,aAAa,CAAC,SAAS,CAAC,aAAa,EAAE,OAAO,CAAkB,CAAC;SACjF;QAED,MAAM,aAAa,GAAG,aAA8B,CAAC;QACrD,MAAM,GAAG,GAAG,aAAa,CAAC,GAAG,CAAC;QAC9B,aAAa,CAAC,IAAI,GAAG,GAAG,GAAG,IAAI,OAAO,CAAC,GAAG,IAAI,GAAG,EAAE,CAAC;QAEpD,OAAO,aAAa,CAAC;IACtB,CAAC;CACD,CAAC;AAEF,eAAe,OAAO,CAAC"} \ No newline at end of file diff --git a/deps/npm/node_modules/uri-js/dist/esnext/schemes/ws.d.ts b/deps/npm/node_modules/uri-js/dist/esnext/schemes/ws.d.ts new file mode 100755 index 00000000000000..47f4835b24a961 --- /dev/null +++ b/deps/npm/node_modules/uri-js/dist/esnext/schemes/ws.d.ts @@ -0,0 +1,7 @@ +import { URISchemeHandler, URIComponents } from "../uri"; +export interface WSComponents extends URIComponents { + resourceName?: string; + secure?: boolean; +} +declare const handler: URISchemeHandler; +export default handler; diff --git a/deps/npm/node_modules/uri-js/dist/esnext/schemes/ws.js b/deps/npm/node_modules/uri-js/dist/esnext/schemes/ws.js new file mode 100755 index 00000000000000..9277f035a0bddd --- /dev/null +++ b/deps/npm/node_modules/uri-js/dist/esnext/schemes/ws.js @@ -0,0 +1,41 @@ +function isSecure(wsComponents) { + return typeof wsComponents.secure === 'boolean' ? wsComponents.secure : String(wsComponents.scheme).toLowerCase() === "wss"; +} +//RFC 6455 +const handler = { + scheme: "ws", + domainHost: true, + parse: function (components, options) { + const wsComponents = components; + //indicate if the secure flag is set + wsComponents.secure = isSecure(wsComponents); + //construct resouce name + wsComponents.resourceName = (wsComponents.path || '/') + (wsComponents.query ? '?' + wsComponents.query : ''); + wsComponents.path = undefined; + wsComponents.query = undefined; + return wsComponents; + }, + serialize: function (wsComponents, options) { + //normalize the default port + if (wsComponents.port === (isSecure(wsComponents) ? 443 : 80) || wsComponents.port === "") { + wsComponents.port = undefined; + } + //ensure scheme matches secure flag + if (typeof wsComponents.secure === 'boolean') { + wsComponents.scheme = (wsComponents.secure ? 'wss' : 'ws'); + wsComponents.secure = undefined; + } + //reconstruct path from resource name + if (wsComponents.resourceName) { + const [path, query] = wsComponents.resourceName.split('?'); + wsComponents.path = (path && path !== '/' ? path : undefined); + wsComponents.query = query; + wsComponents.resourceName = undefined; + } + //forbid fragment component + wsComponents.fragment = undefined; + return wsComponents; + } +}; +export default handler; +//# sourceMappingURL=ws.js.map \ No newline at end of file diff --git a/deps/npm/node_modules/uri-js/dist/esnext/schemes/ws.js.map b/deps/npm/node_modules/uri-js/dist/esnext/schemes/ws.js.map new file mode 100755 index 00000000000000..186818ccd65df1 --- /dev/null +++ b/deps/npm/node_modules/uri-js/dist/esnext/schemes/ws.js.map @@ -0,0 +1 @@ +{"version":3,"file":"ws.js","sourceRoot":"","sources":["../../../src/schemes/ws.ts"],"names":[],"mappings":"AAOA,kBAAkB,YAAyB;IAC1C,OAAO,OAAO,YAAY,CAAC,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC,WAAW,EAAE,KAAK,KAAK,CAAC;AAC7H,CAAC;AAED,UAAU;AACV,MAAM,OAAO,GAAoB;IAChC,MAAM,EAAG,IAAI;IAEb,UAAU,EAAG,IAAI;IAEjB,KAAK,EAAG,UAAU,UAAwB,EAAE,OAAkB;QAC7D,MAAM,YAAY,GAAG,UAA0B,CAAC;QAEhD,oCAAoC;QACpC,YAAY,CAAC,MAAM,GAAG,QAAQ,CAAC,YAAY,CAAC,CAAC;QAE7C,wBAAwB;QACxB,YAAY,CAAC,YAAY,GAAG,CAAC,YAAY,CAAC,IAAI,IAAI,GAAG,CAAC,GAAG,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,GAAG,YAAY,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;QAC9G,YAAY,CAAC,IAAI,GAAG,SAAS,CAAC;QAC9B,YAAY,CAAC,KAAK,GAAG,SAAS,CAAC;QAE/B,OAAO,YAAY,CAAC;IACrB,CAAC;IAED,SAAS,EAAG,UAAU,YAAyB,EAAE,OAAkB;QAClE,4BAA4B;QAC5B,IAAI,YAAY,CAAC,IAAI,KAAK,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,YAAY,CAAC,IAAI,KAAK,EAAE,EAAE;YAC1F,YAAY,CAAC,IAAI,GAAG,SAAS,CAAC;SAC9B;QAED,mCAAmC;QACnC,IAAI,OAAO,YAAY,CAAC,MAAM,KAAK,SAAS,EAAE;YAC7C,YAAY,CAAC,MAAM,GAAG,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;YAC3D,YAAY,CAAC,MAAM,GAAG,SAAS,CAAC;SAChC;QAED,qCAAqC;QACrC,IAAI,YAAY,CAAC,YAAY,EAAE;YAC9B,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,GAAG,YAAY,CAAC,YAAY,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;YAC3D,YAAY,CAAC,IAAI,GAAG,CAAC,IAAI,IAAI,IAAI,KAAK,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;YAC9D,YAAY,CAAC,KAAK,GAAG,KAAK,CAAC;YAC3B,YAAY,CAAC,YAAY,GAAG,SAAS,CAAC;SACtC;QAED,2BAA2B;QAC3B,YAAY,CAAC,QAAQ,GAAG,SAAS,CAAC;QAElC,OAAO,YAAY,CAAC;IACrB,CAAC;CACD,CAAC;AAEF,eAAe,OAAO,CAAC"} \ No newline at end of file diff --git a/deps/npm/node_modules/uri-js/dist/esnext/schemes/wss.d.ts b/deps/npm/node_modules/uri-js/dist/esnext/schemes/wss.d.ts new file mode 100755 index 00000000000000..fe5b2f354241bb --- /dev/null +++ b/deps/npm/node_modules/uri-js/dist/esnext/schemes/wss.d.ts @@ -0,0 +1,3 @@ +import { URISchemeHandler } from "../uri"; +declare const handler: URISchemeHandler; +export default handler; diff --git a/deps/npm/node_modules/uri-js/dist/esnext/schemes/wss.js b/deps/npm/node_modules/uri-js/dist/esnext/schemes/wss.js new file mode 100755 index 00000000000000..d1e22ccd6e0cc5 --- /dev/null +++ b/deps/npm/node_modules/uri-js/dist/esnext/schemes/wss.js @@ -0,0 +1,9 @@ +import ws from "./ws"; +const handler = { + scheme: "wss", + domainHost: ws.domainHost, + parse: ws.parse, + serialize: ws.serialize +}; +export default handler; +//# sourceMappingURL=wss.js.map \ No newline at end of file diff --git a/deps/npm/node_modules/uri-js/dist/esnext/schemes/wss.js.map b/deps/npm/node_modules/uri-js/dist/esnext/schemes/wss.js.map new file mode 100755 index 00000000000000..e19006d947b35e --- /dev/null +++ b/deps/npm/node_modules/uri-js/dist/esnext/schemes/wss.js.map @@ -0,0 +1 @@ +{"version":3,"file":"wss.js","sourceRoot":"","sources":["../../../src/schemes/wss.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,MAAM,CAAC;AAEtB,MAAM,OAAO,GAAoB;IAChC,MAAM,EAAG,KAAK;IACd,UAAU,EAAG,EAAE,CAAC,UAAU;IAC1B,KAAK,EAAG,EAAE,CAAC,KAAK;IAChB,SAAS,EAAG,EAAE,CAAC,SAAS;CACxB,CAAA;AAED,eAAe,OAAO,CAAC"} \ No newline at end of file diff --git a/deps/npm/node_modules/uri-js/dist/esnext/uri.d.ts b/deps/npm/node_modules/uri-js/dist/esnext/uri.d.ts new file mode 100755 index 00000000000000..da51e23527705f --- /dev/null +++ b/deps/npm/node_modules/uri-js/dist/esnext/uri.d.ts @@ -0,0 +1,59 @@ +export interface URIComponents { + scheme?: string; + userinfo?: string; + host?: string; + port?: number | string; + path?: string; + query?: string; + fragment?: string; + reference?: string; + error?: string; +} +export interface URIOptions { + scheme?: string; + reference?: string; + tolerant?: boolean; + absolutePath?: boolean; + iri?: boolean; + unicodeSupport?: boolean; + domainHost?: boolean; +} +export interface URISchemeHandler { + scheme: string; + parse(components: ParentComponents, options: Options): Components; + serialize(components: Components, options: Options): ParentComponents; + unicodeSupport?: boolean; + domainHost?: boolean; + absolutePath?: boolean; +} +export interface URIRegExps { + NOT_SCHEME: RegExp; + NOT_USERINFO: RegExp; + NOT_HOST: RegExp; + NOT_PATH: RegExp; + NOT_PATH_NOSCHEME: RegExp; + NOT_QUERY: RegExp; + NOT_FRAGMENT: RegExp; + ESCAPE: RegExp; + UNRESERVED: RegExp; + OTHER_CHARS: RegExp; + PCT_ENCODED: RegExp; + IPV4ADDRESS: RegExp; + IPV6ADDRESS: RegExp; +} +export declare const SCHEMES: { + [scheme: string]: URISchemeHandler; +}; +export declare function pctEncChar(chr: string): string; +export declare function pctDecChars(str: string): string; +export declare function parse(uriString: string, options?: URIOptions): URIComponents; +export declare function removeDotSegments(input: string): string; +export declare function serialize(components: URIComponents, options?: URIOptions): string; +export declare function resolveComponents(base: URIComponents, relative: URIComponents, options?: URIOptions, skipNormalization?: boolean): URIComponents; +export declare function resolve(baseURI: string, relativeURI: string, options?: URIOptions): string; +export declare function normalize(uri: string, options?: URIOptions): string; +export declare function normalize(uri: URIComponents, options?: URIOptions): URIComponents; +export declare function equal(uriA: string, uriB: string, options?: URIOptions): boolean; +export declare function equal(uriA: URIComponents, uriB: URIComponents, options?: URIOptions): boolean; +export declare function escapeComponent(str: string, options?: URIOptions): string; +export declare function unescapeComponent(str: string, options?: URIOptions): string; diff --git a/deps/npm/node_modules/uri-js/dist/esnext/uri.js b/deps/npm/node_modules/uri-js/dist/esnext/uri.js new file mode 100755 index 00000000000000..659ce2651cea1d --- /dev/null +++ b/deps/npm/node_modules/uri-js/dist/esnext/uri.js @@ -0,0 +1,480 @@ +/** + * URI.js + * + * @fileoverview An RFC 3986 compliant, scheme extendable URI parsing/validating/resolving library for JavaScript. + * @author Gary Court + * @see http://github.com/garycourt/uri-js + */ +/** + * Copyright 2011 Gary Court. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY GARY COURT ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GARY COURT OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of Gary Court. + */ +import URI_PROTOCOL from "./regexps-uri"; +import IRI_PROTOCOL from "./regexps-iri"; +import punycode from "punycode"; +import { toUpperCase, typeOf, assign } from "./util"; +export const SCHEMES = {}; +export function pctEncChar(chr) { + const c = chr.charCodeAt(0); + let e; + if (c < 16) + e = "%0" + c.toString(16).toUpperCase(); + else if (c < 128) + e = "%" + c.toString(16).toUpperCase(); + else if (c < 2048) + e = "%" + ((c >> 6) | 192).toString(16).toUpperCase() + "%" + ((c & 63) | 128).toString(16).toUpperCase(); + else + e = "%" + ((c >> 12) | 224).toString(16).toUpperCase() + "%" + (((c >> 6) & 63) | 128).toString(16).toUpperCase() + "%" + ((c & 63) | 128).toString(16).toUpperCase(); + return e; +} +export function pctDecChars(str) { + let newStr = ""; + let i = 0; + const il = str.length; + while (i < il) { + const c = parseInt(str.substr(i + 1, 2), 16); + if (c < 128) { + newStr += String.fromCharCode(c); + i += 3; + } + else if (c >= 194 && c < 224) { + if ((il - i) >= 6) { + const c2 = parseInt(str.substr(i + 4, 2), 16); + newStr += String.fromCharCode(((c & 31) << 6) | (c2 & 63)); + } + else { + newStr += str.substr(i, 6); + } + i += 6; + } + else if (c >= 224) { + if ((il - i) >= 9) { + const c2 = parseInt(str.substr(i + 4, 2), 16); + const c3 = parseInt(str.substr(i + 7, 2), 16); + newStr += String.fromCharCode(((c & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63)); + } + else { + newStr += str.substr(i, 9); + } + i += 9; + } + else { + newStr += str.substr(i, 3); + i += 3; + } + } + return newStr; +} +function _normalizeComponentEncoding(components, protocol) { + function decodeUnreserved(str) { + const decStr = pctDecChars(str); + return (!decStr.match(protocol.UNRESERVED) ? str : decStr); + } + if (components.scheme) + components.scheme = String(components.scheme).replace(protocol.PCT_ENCODED, decodeUnreserved).toLowerCase().replace(protocol.NOT_SCHEME, ""); + if (components.userinfo !== undefined) + components.userinfo = String(components.userinfo).replace(protocol.PCT_ENCODED, decodeUnreserved).replace(protocol.NOT_USERINFO, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase); + if (components.host !== undefined) + components.host = String(components.host).replace(protocol.PCT_ENCODED, decodeUnreserved).toLowerCase().replace(protocol.NOT_HOST, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase); + if (components.path !== undefined) + components.path = String(components.path).replace(protocol.PCT_ENCODED, decodeUnreserved).replace((components.scheme ? protocol.NOT_PATH : protocol.NOT_PATH_NOSCHEME), pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase); + if (components.query !== undefined) + components.query = String(components.query).replace(protocol.PCT_ENCODED, decodeUnreserved).replace(protocol.NOT_QUERY, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase); + if (components.fragment !== undefined) + components.fragment = String(components.fragment).replace(protocol.PCT_ENCODED, decodeUnreserved).replace(protocol.NOT_FRAGMENT, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase); + return components; +} +; +function _stripLeadingZeros(str) { + return str.replace(/^0*(.*)/, "$1") || "0"; +} +function _normalizeIPv4(host, protocol) { + const matches = host.match(protocol.IPV4ADDRESS) || []; + const [, address] = matches; + if (address) { + return address.split(".").map(_stripLeadingZeros).join("."); + } + else { + return host; + } +} +function _normalizeIPv6(host, protocol) { + const matches = host.match(protocol.IPV6ADDRESS) || []; + const [, address, zone] = matches; + if (address) { + const [last, first] = address.toLowerCase().split('::').reverse(); + const firstFields = first ? first.split(":").map(_stripLeadingZeros) : []; + const lastFields = last.split(":").map(_stripLeadingZeros); + const isLastFieldIPv4Address = protocol.IPV4ADDRESS.test(lastFields[lastFields.length - 1]); + const fieldCount = isLastFieldIPv4Address ? 7 : 8; + const lastFieldsStart = lastFields.length - fieldCount; + const fields = Array(fieldCount); + for (let x = 0; x < fieldCount; ++x) { + fields[x] = firstFields[x] || lastFields[lastFieldsStart + x] || ''; + } + if (isLastFieldIPv4Address) { + fields[fieldCount - 1] = _normalizeIPv4(fields[fieldCount - 1], protocol); + } + const allZeroFields = fields.reduce((acc, field, index) => { + if (!field || field === "0") { + const lastLongest = acc[acc.length - 1]; + if (lastLongest && lastLongest.index + lastLongest.length === index) { + lastLongest.length++; + } + else { + acc.push({ index, length: 1 }); + } + } + return acc; + }, []); + const longestZeroFields = allZeroFields.sort((a, b) => b.length - a.length)[0]; + let newHost; + if (longestZeroFields && longestZeroFields.length > 1) { + const newFirst = fields.slice(0, longestZeroFields.index); + const newLast = fields.slice(longestZeroFields.index + longestZeroFields.length); + newHost = newFirst.join(":") + "::" + newLast.join(":"); + } + else { + newHost = fields.join(":"); + } + if (zone) { + newHost += "%" + zone; + } + return newHost; + } + else { + return host; + } +} +const URI_PARSE = /^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i; +const NO_MATCH_IS_UNDEFINED = ("").match(/(){0}/)[1] === undefined; +export function parse(uriString, options = {}) { + const components = {}; + const protocol = (options.iri !== false ? IRI_PROTOCOL : URI_PROTOCOL); + if (options.reference === "suffix") + uriString = (options.scheme ? options.scheme + ":" : "") + "//" + uriString; + const matches = uriString.match(URI_PARSE); + if (matches) { + if (NO_MATCH_IS_UNDEFINED) { + //store each component + components.scheme = matches[1]; + components.userinfo = matches[3]; + components.host = matches[4]; + components.port = parseInt(matches[5], 10); + components.path = matches[6] || ""; + components.query = matches[7]; + components.fragment = matches[8]; + //fix port number + if (isNaN(components.port)) { + components.port = matches[5]; + } + } + else { //IE FIX for improper RegExp matching + //store each component + components.scheme = matches[1] || undefined; + components.userinfo = (uriString.indexOf("@") !== -1 ? matches[3] : undefined); + components.host = (uriString.indexOf("//") !== -1 ? matches[4] : undefined); + components.port = parseInt(matches[5], 10); + components.path = matches[6] || ""; + components.query = (uriString.indexOf("?") !== -1 ? matches[7] : undefined); + components.fragment = (uriString.indexOf("#") !== -1 ? matches[8] : undefined); + //fix port number + if (isNaN(components.port)) { + components.port = (uriString.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/) ? matches[4] : undefined); + } + } + if (components.host) { + //normalize IP hosts + components.host = _normalizeIPv6(_normalizeIPv4(components.host, protocol), protocol); + } + //determine reference type + if (components.scheme === undefined && components.userinfo === undefined && components.host === undefined && components.port === undefined && !components.path && components.query === undefined) { + components.reference = "same-document"; + } + else if (components.scheme === undefined) { + components.reference = "relative"; + } + else if (components.fragment === undefined) { + components.reference = "absolute"; + } + else { + components.reference = "uri"; + } + //check for reference errors + if (options.reference && options.reference !== "suffix" && options.reference !== components.reference) { + components.error = components.error || "URI is not a " + options.reference + " reference."; + } + //find scheme handler + const schemeHandler = SCHEMES[(options.scheme || components.scheme || "").toLowerCase()]; + //check if scheme can't handle IRIs + if (!options.unicodeSupport && (!schemeHandler || !schemeHandler.unicodeSupport)) { + //if host component is a domain name + if (components.host && (options.domainHost || (schemeHandler && schemeHandler.domainHost))) { + //convert Unicode IDN -> ASCII IDN + try { + components.host = punycode.toASCII(components.host.replace(protocol.PCT_ENCODED, pctDecChars).toLowerCase()); + } + catch (e) { + components.error = components.error || "Host's domain name can not be converted to ASCII via punycode: " + e; + } + } + //convert IRI -> URI + _normalizeComponentEncoding(components, URI_PROTOCOL); + } + else { + //normalize encodings + _normalizeComponentEncoding(components, protocol); + } + //perform scheme specific parsing + if (schemeHandler && schemeHandler.parse) { + schemeHandler.parse(components, options); + } + } + else { + components.error = components.error || "URI can not be parsed."; + } + return components; +} +; +function _recomposeAuthority(components, options) { + const protocol = (options.iri !== false ? IRI_PROTOCOL : URI_PROTOCOL); + const uriTokens = []; + if (components.userinfo !== undefined) { + uriTokens.push(components.userinfo); + uriTokens.push("@"); + } + if (components.host !== undefined) { + //normalize IP hosts, add brackets and escape zone separator for IPv6 + uriTokens.push(_normalizeIPv6(_normalizeIPv4(String(components.host), protocol), protocol).replace(protocol.IPV6ADDRESS, (_, $1, $2) => "[" + $1 + ($2 ? "%25" + $2 : "") + "]")); + } + if (typeof components.port === "number" || typeof components.port === "string") { + uriTokens.push(":"); + uriTokens.push(String(components.port)); + } + return uriTokens.length ? uriTokens.join("") : undefined; +} +; +const RDS1 = /^\.\.?\//; +const RDS2 = /^\/\.(\/|$)/; +const RDS3 = /^\/\.\.(\/|$)/; +const RDS4 = /^\.\.?$/; +const RDS5 = /^\/?(?:.|\n)*?(?=\/|$)/; +export function removeDotSegments(input) { + const output = []; + while (input.length) { + if (input.match(RDS1)) { + input = input.replace(RDS1, ""); + } + else if (input.match(RDS2)) { + input = input.replace(RDS2, "/"); + } + else if (input.match(RDS3)) { + input = input.replace(RDS3, "/"); + output.pop(); + } + else if (input === "." || input === "..") { + input = ""; + } + else { + const im = input.match(RDS5); + if (im) { + const s = im[0]; + input = input.slice(s.length); + output.push(s); + } + else { + throw new Error("Unexpected dot segment condition"); + } + } + } + return output.join(""); +} +; +export function serialize(components, options = {}) { + const protocol = (options.iri ? IRI_PROTOCOL : URI_PROTOCOL); + const uriTokens = []; + //find scheme handler + const schemeHandler = SCHEMES[(options.scheme || components.scheme || "").toLowerCase()]; + //perform scheme specific serialization + if (schemeHandler && schemeHandler.serialize) + schemeHandler.serialize(components, options); + if (components.host) { + //if host component is an IPv6 address + if (protocol.IPV6ADDRESS.test(components.host)) { + //TODO: normalize IPv6 address as per RFC 5952 + } + //if host component is a domain name + else if (options.domainHost || (schemeHandler && schemeHandler.domainHost)) { + //convert IDN via punycode + try { + components.host = (!options.iri ? punycode.toASCII(components.host.replace(protocol.PCT_ENCODED, pctDecChars).toLowerCase()) : punycode.toUnicode(components.host)); + } + catch (e) { + components.error = components.error || "Host's domain name can not be converted to " + (!options.iri ? "ASCII" : "Unicode") + " via punycode: " + e; + } + } + } + //normalize encoding + _normalizeComponentEncoding(components, protocol); + if (options.reference !== "suffix" && components.scheme) { + uriTokens.push(components.scheme); + uriTokens.push(":"); + } + const authority = _recomposeAuthority(components, options); + if (authority !== undefined) { + if (options.reference !== "suffix") { + uriTokens.push("//"); + } + uriTokens.push(authority); + if (components.path && components.path.charAt(0) !== "/") { + uriTokens.push("/"); + } + } + if (components.path !== undefined) { + let s = components.path; + if (!options.absolutePath && (!schemeHandler || !schemeHandler.absolutePath)) { + s = removeDotSegments(s); + } + if (authority === undefined) { + s = s.replace(/^\/\//, "/%2F"); //don't allow the path to start with "//" + } + uriTokens.push(s); + } + if (components.query !== undefined) { + uriTokens.push("?"); + uriTokens.push(components.query); + } + if (components.fragment !== undefined) { + uriTokens.push("#"); + uriTokens.push(components.fragment); + } + return uriTokens.join(""); //merge tokens into a string +} +; +export function resolveComponents(base, relative, options = {}, skipNormalization) { + const target = {}; + if (!skipNormalization) { + base = parse(serialize(base, options), options); //normalize base components + relative = parse(serialize(relative, options), options); //normalize relative components + } + options = options || {}; + if (!options.tolerant && relative.scheme) { + target.scheme = relative.scheme; + //target.authority = relative.authority; + target.userinfo = relative.userinfo; + target.host = relative.host; + target.port = relative.port; + target.path = removeDotSegments(relative.path || ""); + target.query = relative.query; + } + else { + if (relative.userinfo !== undefined || relative.host !== undefined || relative.port !== undefined) { + //target.authority = relative.authority; + target.userinfo = relative.userinfo; + target.host = relative.host; + target.port = relative.port; + target.path = removeDotSegments(relative.path || ""); + target.query = relative.query; + } + else { + if (!relative.path) { + target.path = base.path; + if (relative.query !== undefined) { + target.query = relative.query; + } + else { + target.query = base.query; + } + } + else { + if (relative.path.charAt(0) === "/") { + target.path = removeDotSegments(relative.path); + } + else { + if ((base.userinfo !== undefined || base.host !== undefined || base.port !== undefined) && !base.path) { + target.path = "/" + relative.path; + } + else if (!base.path) { + target.path = relative.path; + } + else { + target.path = base.path.slice(0, base.path.lastIndexOf("/") + 1) + relative.path; + } + target.path = removeDotSegments(target.path); + } + target.query = relative.query; + } + //target.authority = base.authority; + target.userinfo = base.userinfo; + target.host = base.host; + target.port = base.port; + } + target.scheme = base.scheme; + } + target.fragment = relative.fragment; + return target; +} +; +export function resolve(baseURI, relativeURI, options) { + const schemelessOptions = assign({ scheme: 'null' }, options); + return serialize(resolveComponents(parse(baseURI, schemelessOptions), parse(relativeURI, schemelessOptions), schemelessOptions, true), schemelessOptions); +} +; +export function normalize(uri, options) { + if (typeof uri === "string") { + uri = serialize(parse(uri, options), options); + } + else if (typeOf(uri) === "object") { + uri = parse(serialize(uri, options), options); + } + return uri; +} +; +export function equal(uriA, uriB, options) { + if (typeof uriA === "string") { + uriA = serialize(parse(uriA, options), options); + } + else if (typeOf(uriA) === "object") { + uriA = serialize(uriA, options); + } + if (typeof uriB === "string") { + uriB = serialize(parse(uriB, options), options); + } + else if (typeOf(uriB) === "object") { + uriB = serialize(uriB, options); + } + return uriA === uriB; +} +; +export function escapeComponent(str, options) { + return str && str.toString().replace((!options || !options.iri ? URI_PROTOCOL.ESCAPE : IRI_PROTOCOL.ESCAPE), pctEncChar); +} +; +export function unescapeComponent(str, options) { + return str && str.toString().replace((!options || !options.iri ? URI_PROTOCOL.PCT_ENCODED : IRI_PROTOCOL.PCT_ENCODED), pctDecChars); +} +; +//# sourceMappingURL=uri.js.map \ No newline at end of file diff --git a/deps/npm/node_modules/uri-js/dist/esnext/uri.js.map b/deps/npm/node_modules/uri-js/dist/esnext/uri.js.map new file mode 100755 index 00000000000000..2e72ab18d1192a --- /dev/null +++ b/deps/npm/node_modules/uri-js/dist/esnext/uri.js.map @@ -0,0 +1 @@ +{"version":3,"file":"uri.js","sourceRoot":"","sources":["../../src/uri.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,OAAO,YAAY,MAAM,eAAe,CAAC;AACzC,OAAO,YAAY,MAAM,eAAe,CAAC;AACzC,OAAO,QAAQ,MAAM,UAAU,CAAC;AAChC,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAiDrD,MAAM,CAAC,MAAM,OAAO,GAAsC,EAAE,CAAC;AAE7D,MAAM,qBAAqB,GAAU;IACpC,MAAM,CAAC,GAAG,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;IAC5B,IAAI,CAAQ,CAAC;IAEb,IAAI,CAAC,GAAG,EAAE;QAAE,CAAC,GAAG,IAAI,GAAG,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,WAAW,EAAE,CAAC;SAC/C,IAAI,CAAC,GAAG,GAAG;QAAE,CAAC,GAAG,GAAG,GAAG,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,WAAW,EAAE,CAAC;SACpD,IAAI,CAAC,GAAG,IAAI;QAAE,CAAC,GAAG,GAAG,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,GAAG,GAAG,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,WAAW,EAAE,GAAG,GAAG,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,GAAG,GAAG,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,WAAW,EAAE,CAAC;;QACxH,CAAC,GAAG,GAAG,GAAG,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,GAAG,GAAG,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,WAAW,EAAE,GAAG,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,CAAC,GAAG,GAAG,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,WAAW,EAAE,GAAG,GAAG,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,GAAG,GAAG,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,WAAW,EAAE,CAAC;IAE3K,OAAO,CAAC,CAAC;AACV,CAAC;AAED,MAAM,sBAAsB,GAAU;IACrC,IAAI,MAAM,GAAG,EAAE,CAAC;IAChB,IAAI,CAAC,GAAG,CAAC,CAAC;IACV,MAAM,EAAE,GAAG,GAAG,CAAC,MAAM,CAAC;IAEtB,OAAO,CAAC,GAAG,EAAE,EAAE;QACd,MAAM,CAAC,GAAG,QAAQ,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;QAE7C,IAAI,CAAC,GAAG,GAAG,EAAE;YACZ,MAAM,IAAI,MAAM,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;YACjC,CAAC,IAAI,CAAC,CAAC;SACP;aACI,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,GAAG,GAAG,EAAE;YAC7B,IAAI,CAAC,EAAE,GAAG,CAAC,CAAC,IAAI,CAAC,EAAE;gBAClB,MAAM,EAAE,GAAG,QAAQ,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;gBAC9C,MAAM,IAAI,MAAM,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC;aAC3D;iBAAM;gBACN,MAAM,IAAI,GAAG,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;aAC3B;YACD,CAAC,IAAI,CAAC,CAAC;SACP;aACI,IAAI,CAAC,IAAI,GAAG,EAAE;YAClB,IAAI,CAAC,EAAE,GAAG,CAAC,CAAC,IAAI,CAAC,EAAE;gBAClB,MAAM,EAAE,GAAG,QAAQ,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;gBAC9C,MAAM,EAAE,GAAG,QAAQ,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;gBAC9C,MAAM,IAAI,MAAM,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,IAAI,EAAE,CAAC,GAAG,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC;aAC/E;iBAAM;gBACN,MAAM,IAAI,GAAG,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;aAC3B;YACD,CAAC,IAAI,CAAC,CAAC;SACP;aACI;YACJ,MAAM,IAAI,GAAG,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;YAC3B,CAAC,IAAI,CAAC,CAAC;SACP;KACD;IAED,OAAO,MAAM,CAAC;AACf,CAAC;AAED,qCAAqC,UAAwB,EAAE,QAAmB;IACjF,0BAA0B,GAAU;QACnC,MAAM,MAAM,GAAG,WAAW,CAAC,GAAG,CAAC,CAAC;QAChC,OAAO,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC;IAC5D,CAAC;IAED,IAAI,UAAU,CAAC,MAAM;QAAE,UAAU,CAAC,MAAM,GAAG,MAAM,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,WAAW,EAAE,gBAAgB,CAAC,CAAC,WAAW,EAAE,CAAC,OAAO,CAAC,QAAQ,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC;IACpK,IAAI,UAAU,CAAC,QAAQ,KAAK,SAAS;QAAE,UAAU,CAAC,QAAQ,GAAG,MAAM,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,WAAW,EAAE,gBAAgB,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,YAAY,EAAE,UAAU,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC;IAC/N,IAAI,UAAU,CAAC,IAAI,KAAK,SAAS;QAAE,UAAU,CAAC,IAAI,GAAG,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,WAAW,EAAE,gBAAgB,CAAC,CAAC,WAAW,EAAE,CAAC,OAAO,CAAC,QAAQ,CAAC,QAAQ,EAAE,UAAU,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC;IAC7N,IAAI,UAAU,CAAC,IAAI,KAAK,SAAS;QAAE,UAAU,CAAC,IAAI,GAAG,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,WAAW,EAAE,gBAAgB,CAAC,CAAC,OAAO,CAAC,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,iBAAiB,CAAC,EAAE,UAAU,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC;IAClQ,IAAI,UAAU,CAAC,KAAK,KAAK,SAAS;QAAE,UAAU,CAAC,KAAK,GAAG,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,WAAW,EAAE,gBAAgB,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC;IACnN,IAAI,UAAU,CAAC,QAAQ,KAAK,SAAS;QAAE,UAAU,CAAC,QAAQ,GAAG,MAAM,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,WAAW,EAAE,gBAAgB,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,YAAY,EAAE,UAAU,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC;IAE/N,OAAO,UAAU,CAAC;AACnB,CAAC;AAAA,CAAC;AAEF,4BAA4B,GAAU;IACrC,OAAO,GAAG,CAAC,OAAO,CAAC,SAAS,EAAE,IAAI,CAAC,IAAI,GAAG,CAAC;AAC5C,CAAC;AAED,wBAAwB,IAAW,EAAE,QAAmB;IACvD,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,WAAW,CAAC,IAAI,EAAE,CAAC;IACvD,MAAM,CAAC,EAAE,OAAO,CAAC,GAAG,OAAO,CAAC;IAE5B,IAAI,OAAO,EAAE;QACZ,OAAO,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,kBAAkB,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;KAC5D;SAAM;QACN,OAAO,IAAI,CAAC;KACZ;AACF,CAAC;AAED,wBAAwB,IAAW,EAAE,QAAmB;IACvD,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,WAAW,CAAC,IAAI,EAAE,CAAC;IACvD,MAAM,CAAC,EAAE,OAAO,EAAE,IAAI,CAAC,GAAG,OAAO,CAAC;IAElC,IAAI,OAAO,EAAE;QACZ,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,CAAC;QAClE,MAAM,WAAW,GAAG,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,kBAAkB,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;QAC1E,MAAM,UAAU,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,kBAAkB,CAAC,CAAC;QAC3D,MAAM,sBAAsB,GAAG,QAAQ,CAAC,WAAW,CAAC,IAAI,CAAC,UAAU,CAAC,UAAU,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC;QAC5F,MAAM,UAAU,GAAG,sBAAsB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAClD,MAAM,eAAe,GAAG,UAAU,CAAC,MAAM,GAAG,UAAU,CAAC;QACvD,MAAM,MAAM,GAAG,KAAK,CAAS,UAAU,CAAC,CAAC;QAEzC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,UAAU,EAAE,EAAE,CAAC,EAAE;YACpC,MAAM,CAAC,CAAC,CAAC,GAAG,WAAW,CAAC,CAAC,CAAC,IAAI,UAAU,CAAC,eAAe,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC;SACpE;QAED,IAAI,sBAAsB,EAAE;YAC3B,MAAM,CAAC,UAAU,GAAG,CAAC,CAAC,GAAG,cAAc,CAAC,MAAM,CAAC,UAAU,GAAG,CAAC,CAAC,EAAE,QAAQ,CAAC,CAAC;SAC1E;QAED,MAAM,aAAa,GAAG,MAAM,CAAC,MAAM,CAAsC,CAAC,GAAG,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE;YAC9F,IAAI,CAAC,KAAK,IAAI,KAAK,KAAK,GAAG,EAAE;gBAC5B,MAAM,WAAW,GAAG,GAAG,CAAC,GAAG,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;gBACxC,IAAI,WAAW,IAAI,WAAW,CAAC,KAAK,GAAG,WAAW,CAAC,MAAM,KAAK,KAAK,EAAE;oBACpE,WAAW,CAAC,MAAM,EAAE,CAAC;iBACrB;qBAAM;oBACN,GAAG,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,MAAM,EAAG,CAAC,EAAE,CAAC,CAAC;iBAChC;aACD;YACD,OAAO,GAAG,CAAC;QACZ,CAAC,EAAE,EAAE,CAAC,CAAC;QAEP,MAAM,iBAAiB,GAAG,aAAa,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;QAE/E,IAAI,OAAc,CAAC;QACnB,IAAI,iBAAiB,IAAI,iBAAiB,CAAC,MAAM,GAAG,CAAC,EAAE;YACtD,MAAM,QAAQ,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,iBAAiB,CAAC,KAAK,CAAC,CAAE;YAC3D,MAAM,OAAO,GAAG,MAAM,CAAC,KAAK,CAAC,iBAAiB,CAAC,KAAK,GAAG,iBAAiB,CAAC,MAAM,CAAC,CAAC;YACjF,OAAO,GAAG,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;SACxD;aAAM;YACN,OAAO,GAAG,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;SAC3B;QAED,IAAI,IAAI,EAAE;YACT,OAAO,IAAI,GAAG,GAAG,IAAI,CAAC;SACtB;QAED,OAAO,OAAO,CAAC;KACf;SAAM;QACN,OAAO,IAAI,CAAC;KACZ;AACF,CAAC;AAED,MAAM,SAAS,GAAG,iIAAiI,CAAC;AACpJ,MAAM,qBAAqB,GAAsB,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,CAAE,CAAC,CAAC,CAAC,KAAK,SAAS,CAAC;AAEvF,MAAM,gBAAgB,SAAgB,EAAE,UAAqB,EAAE;IAC9D,MAAM,UAAU,GAAiB,EAAE,CAAC;IACpC,MAAM,QAAQ,GAAG,CAAC,OAAO,CAAC,GAAG,KAAK,KAAK,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC;IAEvE,IAAI,OAAO,CAAC,SAAS,KAAK,QAAQ;QAAE,SAAS,GAAG,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,GAAG,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,GAAG,IAAI,GAAG,SAAS,CAAC;IAEhH,MAAM,OAAO,GAAG,SAAS,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;IAE3C,IAAI,OAAO,EAAE;QACZ,IAAI,qBAAqB,EAAE;YAC1B,sBAAsB;YACtB,UAAU,CAAC,MAAM,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;YAC/B,UAAU,CAAC,QAAQ,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;YACjC,UAAU,CAAC,IAAI,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;YAC7B,UAAU,CAAC,IAAI,GAAG,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;YAC3C,UAAU,CAAC,IAAI,GAAG,OAAO,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;YACnC,UAAU,CAAC,KAAK,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;YAC9B,UAAU,CAAC,QAAQ,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;YAEjC,iBAAiB;YACjB,IAAI,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE;gBAC3B,UAAU,CAAC,IAAI,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;aAC7B;SACD;aAAM,EAAG,qCAAqC;YAC9C,sBAAsB;YACtB,UAAU,CAAC,MAAM,GAAG,OAAO,CAAC,CAAC,CAAC,IAAI,SAAS,CAAC;YAC5C,UAAU,CAAC,QAAQ,GAAG,CAAC,SAAS,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;YAC/E,UAAU,CAAC,IAAI,GAAG,CAAC,SAAS,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;YAC5E,UAAU,CAAC,IAAI,GAAG,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;YAC3C,UAAU,CAAC,IAAI,GAAG,OAAO,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;YACnC,UAAU,CAAC,KAAK,GAAG,CAAC,SAAS,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;YAC5E,UAAU,CAAC,QAAQ,GAAG,CAAC,SAAS,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;YAE/E,iBAAiB;YACjB,IAAI,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE;gBAC3B,UAAU,CAAC,IAAI,GAAG,CAAC,SAAS,CAAC,KAAK,CAAC,+BAA+B,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;aAC9F;SACD;QAED,IAAI,UAAU,CAAC,IAAI,EAAE;YACpB,oBAAoB;YACpB,UAAU,CAAC,IAAI,GAAG,cAAc,CAAC,cAAc,CAAC,UAAU,CAAC,IAAI,EAAE,QAAQ,CAAC,EAAE,QAAQ,CAAC,CAAC;SACtF;QAED,0BAA0B;QAC1B,IAAI,UAAU,CAAC,MAAM,KAAK,SAAS,IAAI,UAAU,CAAC,QAAQ,KAAK,SAAS,IAAI,UAAU,CAAC,IAAI,KAAK,SAAS,IAAI,UAAU,CAAC,IAAI,KAAK,SAAS,IAAI,CAAC,UAAU,CAAC,IAAI,IAAI,UAAU,CAAC,KAAK,KAAK,SAAS,EAAE;YACjM,UAAU,CAAC,SAAS,GAAG,eAAe,CAAC;SACvC;aAAM,IAAI,UAAU,CAAC,MAAM,KAAK,SAAS,EAAE;YAC3C,UAAU,CAAC,SAAS,GAAG,UAAU,CAAC;SAClC;aAAM,IAAI,UAAU,CAAC,QAAQ,KAAK,SAAS,EAAE;YAC7C,UAAU,CAAC,SAAS,GAAG,UAAU,CAAC;SAClC;aAAM;YACN,UAAU,CAAC,SAAS,GAAG,KAAK,CAAC;SAC7B;QAED,4BAA4B;QAC5B,IAAI,OAAO,CAAC,SAAS,IAAI,OAAO,CAAC,SAAS,KAAK,QAAQ,IAAI,OAAO,CAAC,SAAS,KAAK,UAAU,CAAC,SAAS,EAAE;YACtG,UAAU,CAAC,KAAK,GAAG,UAAU,CAAC,KAAK,IAAI,eAAe,GAAG,OAAO,CAAC,SAAS,GAAG,aAAa,CAAC;SAC3F;QAED,qBAAqB;QACrB,MAAM,aAAa,GAAG,OAAO,CAAC,CAAC,OAAO,CAAC,MAAM,IAAI,UAAU,CAAC,MAAM,IAAI,EAAE,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC;QAEzF,mCAAmC;QACnC,IAAI,CAAC,OAAO,CAAC,cAAc,IAAI,CAAC,CAAC,aAAa,IAAI,CAAC,aAAa,CAAC,cAAc,CAAC,EAAE;YACjF,oCAAoC;YACpC,IAAI,UAAU,CAAC,IAAI,IAAI,CAAC,OAAO,CAAC,UAAU,IAAI,CAAC,aAAa,IAAI,aAAa,CAAC,UAAU,CAAC,CAAC,EAAE;gBAC3F,kCAAkC;gBAClC,IAAI;oBACH,UAAU,CAAC,IAAI,GAAG,QAAQ,CAAC,OAAO,CAAC,UAAU,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC;iBAC7G;gBAAC,OAAO,CAAC,EAAE;oBACX,UAAU,CAAC,KAAK,GAAG,UAAU,CAAC,KAAK,IAAI,iEAAiE,GAAG,CAAC,CAAC;iBAC7G;aACD;YACD,oBAAoB;YACpB,2BAA2B,CAAC,UAAU,EAAE,YAAY,CAAC,CAAC;SACtD;aAAM;YACN,qBAAqB;YACrB,2BAA2B,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC;SAClD;QAED,iCAAiC;QACjC,IAAI,aAAa,IAAI,aAAa,CAAC,KAAK,EAAE;YACzC,aAAa,CAAC,KAAK,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;SACzC;KACD;SAAM;QACN,UAAU,CAAC,KAAK,GAAG,UAAU,CAAC,KAAK,IAAI,wBAAwB,CAAC;KAChE;IAED,OAAO,UAAU,CAAC;AACnB,CAAC;AAAA,CAAC;AAEF,6BAA6B,UAAwB,EAAE,OAAkB;IACxE,MAAM,QAAQ,GAAG,CAAC,OAAO,CAAC,GAAG,KAAK,KAAK,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC;IACvE,MAAM,SAAS,GAAiB,EAAE,CAAC;IAEnC,IAAI,UAAU,CAAC,QAAQ,KAAK,SAAS,EAAE;QACtC,SAAS,CAAC,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC;QACpC,SAAS,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;KACpB;IAED,IAAI,UAAU,CAAC,IAAI,KAAK,SAAS,EAAE;QAClC,qEAAqE;QACrE,SAAS,CAAC,IAAI,CAAC,cAAc,CAAC,cAAc,CAAC,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,QAAQ,CAAC,EAAE,QAAQ,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,WAAW,EAAE,CAAC,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,GAAG,GAAG,EAAE,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,GAAG,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC;KAClL;IAED,IAAI,OAAO,UAAU,CAAC,IAAI,KAAK,QAAQ,IAAI,OAAO,UAAU,CAAC,IAAI,KAAK,QAAQ,EAAE;QAC/E,SAAS,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QACpB,SAAS,CAAC,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC;KACxC;IAED,OAAO,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;AAC1D,CAAC;AAAA,CAAC;AAEF,MAAM,IAAI,GAAG,UAAU,CAAC;AACxB,MAAM,IAAI,GAAG,aAAa,CAAC;AAC3B,MAAM,IAAI,GAAG,eAAe,CAAC;AAC7B,MAAM,IAAI,GAAG,SAAS,CAAC;AACvB,MAAM,IAAI,GAAG,wBAAwB,CAAC;AAEtC,MAAM,4BAA4B,KAAY;IAC7C,MAAM,MAAM,GAAiB,EAAE,CAAC;IAEhC,OAAO,KAAK,CAAC,MAAM,EAAE;QACpB,IAAI,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE;YACtB,KAAK,GAAG,KAAK,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;SAChC;aAAM,IAAI,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE;YAC7B,KAAK,GAAG,KAAK,CAAC,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;SACjC;aAAM,IAAI,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE;YAC7B,KAAK,GAAG,KAAK,CAAC,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;YACjC,MAAM,CAAC,GAAG,EAAE,CAAC;SACb;aAAM,IAAI,KAAK,KAAK,GAAG,IAAI,KAAK,KAAK,IAAI,EAAE;YAC3C,KAAK,GAAG,EAAE,CAAC;SACX;aAAM;YACN,MAAM,EAAE,GAAG,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;YAC7B,IAAI,EAAE,EAAE;gBACP,MAAM,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC;gBAChB,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC;gBAC9B,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;aACf;iBAAM;gBACN,MAAM,IAAI,KAAK,CAAC,kCAAkC,CAAC,CAAC;aACpD;SACD;KACD;IAED,OAAO,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AACxB,CAAC;AAAA,CAAC;AAEF,MAAM,oBAAoB,UAAwB,EAAE,UAAqB,EAAE;IAC1E,MAAM,QAAQ,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC;IAC7D,MAAM,SAAS,GAAiB,EAAE,CAAC;IAEnC,qBAAqB;IACrB,MAAM,aAAa,GAAG,OAAO,CAAC,CAAC,OAAO,CAAC,MAAM,IAAI,UAAU,CAAC,MAAM,IAAI,EAAE,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC;IAEzF,uCAAuC;IACvC,IAAI,aAAa,IAAI,aAAa,CAAC,SAAS;QAAE,aAAa,CAAC,SAAS,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;IAE3F,IAAI,UAAU,CAAC,IAAI,EAAE;QACpB,sCAAsC;QACtC,IAAI,QAAQ,CAAC,WAAW,CAAC,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE;YAC/C,8CAA8C;SAC9C;QAED,oCAAoC;aAC/B,IAAI,OAAO,CAAC,UAAU,IAAI,CAAC,aAAa,IAAI,aAAa,CAAC,UAAU,CAAC,EAAE;YAC3E,0BAA0B;YAC1B,IAAI;gBACH,UAAU,CAAC,IAAI,GAAG,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,UAAU,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,SAAS,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC;aACpK;YAAC,OAAO,CAAC,EAAE;gBACX,UAAU,CAAC,KAAK,GAAG,UAAU,CAAC,KAAK,IAAI,6CAA6C,GAAG,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,GAAG,iBAAiB,GAAG,CAAC,CAAC;aACpJ;SACD;KACD;IAED,oBAAoB;IACpB,2BAA2B,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC;IAElD,IAAI,OAAO,CAAC,SAAS,KAAK,QAAQ,IAAI,UAAU,CAAC,MAAM,EAAE;QACxD,SAAS,CAAC,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;QAClC,SAAS,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;KACpB;IAED,MAAM,SAAS,GAAG,mBAAmB,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;IAC3D,IAAI,SAAS,KAAK,SAAS,EAAE;QAC5B,IAAI,OAAO,CAAC,SAAS,KAAK,QAAQ,EAAE;YACnC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;SACrB;QAED,SAAS,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QAE1B,IAAI,UAAU,CAAC,IAAI,IAAI,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,GAAG,EAAE;YACzD,SAAS,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;SACpB;KACD;IAED,IAAI,UAAU,CAAC,IAAI,KAAK,SAAS,EAAE;QAClC,IAAI,CAAC,GAAG,UAAU,CAAC,IAAI,CAAC;QAExB,IAAI,CAAC,OAAO,CAAC,YAAY,IAAI,CAAC,CAAC,aAAa,IAAI,CAAC,aAAa,CAAC,YAAY,CAAC,EAAE;YAC7E,CAAC,GAAG,iBAAiB,CAAC,CAAC,CAAC,CAAC;SACzB;QAED,IAAI,SAAS,KAAK,SAAS,EAAE;YAC5B,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC,CAAE,yCAAyC;SAC1E;QAED,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;KAClB;IAED,IAAI,UAAU,CAAC,KAAK,KAAK,SAAS,EAAE;QACnC,SAAS,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QACpB,SAAS,CAAC,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;KACjC;IAED,IAAI,UAAU,CAAC,QAAQ,KAAK,SAAS,EAAE;QACtC,SAAS,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QACpB,SAAS,CAAC,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC;KACpC;IAED,OAAO,SAAS,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAE,4BAA4B;AACzD,CAAC;AAAA,CAAC;AAEF,MAAM,4BAA4B,IAAkB,EAAE,QAAsB,EAAE,UAAqB,EAAE,EAAE,iBAA0B;IAChI,MAAM,MAAM,GAAiB,EAAE,CAAC;IAEhC,IAAI,CAAC,iBAAiB,EAAE;QACvB,IAAI,GAAG,KAAK,CAAC,SAAS,CAAC,IAAI,EAAE,OAAO,CAAC,EAAE,OAAO,CAAC,CAAC,CAAE,2BAA2B;QAC7E,QAAQ,GAAG,KAAK,CAAC,SAAS,CAAC,QAAQ,EAAE,OAAO,CAAC,EAAE,OAAO,CAAC,CAAC,CAAE,+BAA+B;KACzF;IACD,OAAO,GAAG,OAAO,IAAI,EAAE,CAAC;IAExB,IAAI,CAAC,OAAO,CAAC,QAAQ,IAAI,QAAQ,CAAC,MAAM,EAAE;QACzC,MAAM,CAAC,MAAM,GAAG,QAAQ,CAAC,MAAM,CAAC;QAChC,wCAAwC;QACxC,MAAM,CAAC,QAAQ,GAAG,QAAQ,CAAC,QAAQ,CAAC;QACpC,MAAM,CAAC,IAAI,GAAG,QAAQ,CAAC,IAAI,CAAC;QAC5B,MAAM,CAAC,IAAI,GAAG,QAAQ,CAAC,IAAI,CAAC;QAC5B,MAAM,CAAC,IAAI,GAAG,iBAAiB,CAAC,QAAQ,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC;QACrD,MAAM,CAAC,KAAK,GAAG,QAAQ,CAAC,KAAK,CAAC;KAC9B;SAAM;QACN,IAAI,QAAQ,CAAC,QAAQ,KAAK,SAAS,IAAI,QAAQ,CAAC,IAAI,KAAK,SAAS,IAAI,QAAQ,CAAC,IAAI,KAAK,SAAS,EAAE;YAClG,wCAAwC;YACxC,MAAM,CAAC,QAAQ,GAAG,QAAQ,CAAC,QAAQ,CAAC;YACpC,MAAM,CAAC,IAAI,GAAG,QAAQ,CAAC,IAAI,CAAC;YAC5B,MAAM,CAAC,IAAI,GAAG,QAAQ,CAAC,IAAI,CAAC;YAC5B,MAAM,CAAC,IAAI,GAAG,iBAAiB,CAAC,QAAQ,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC;YACrD,MAAM,CAAC,KAAK,GAAG,QAAQ,CAAC,KAAK,CAAC;SAC9B;aAAM;YACN,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE;gBACnB,MAAM,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC;gBACxB,IAAI,QAAQ,CAAC,KAAK,KAAK,SAAS,EAAE;oBACjC,MAAM,CAAC,KAAK,GAAG,QAAQ,CAAC,KAAK,CAAC;iBAC9B;qBAAM;oBACN,MAAM,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC;iBAC1B;aACD;iBAAM;gBACN,IAAI,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,GAAG,EAAE;oBACpC,MAAM,CAAC,IAAI,GAAG,iBAAiB,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;iBAC/C;qBAAM;oBACN,IAAI,CAAC,IAAI,CAAC,QAAQ,KAAK,SAAS,IAAI,IAAI,CAAC,IAAI,KAAK,SAAS,IAAI,IAAI,CAAC,IAAI,KAAK,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE;wBACtG,MAAM,CAAC,IAAI,GAAG,GAAG,GAAG,QAAQ,CAAC,IAAI,CAAC;qBAClC;yBAAM,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE;wBACtB,MAAM,CAAC,IAAI,GAAG,QAAQ,CAAC,IAAI,CAAC;qBAC5B;yBAAM;wBACN,MAAM,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,GAAG,QAAQ,CAAC,IAAI,CAAC;qBACjF;oBACD,MAAM,CAAC,IAAI,GAAG,iBAAiB,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;iBAC7C;gBACD,MAAM,CAAC,KAAK,GAAG,QAAQ,CAAC,KAAK,CAAC;aAC9B;YACD,oCAAoC;YACpC,MAAM,CAAC,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC;YAChC,MAAM,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC;YACxB,MAAM,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC;SACxB;QACD,MAAM,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;KAC5B;IAED,MAAM,CAAC,QAAQ,GAAG,QAAQ,CAAC,QAAQ,CAAC;IAEpC,OAAO,MAAM,CAAC;AACf,CAAC;AAAA,CAAC;AAEF,MAAM,kBAAkB,OAAc,EAAE,WAAkB,EAAE,OAAmB;IAC9E,MAAM,iBAAiB,GAAG,MAAM,CAAC,EAAE,MAAM,EAAG,MAAM,EAAE,EAAE,OAAO,CAAC,CAAC;IAC/D,OAAO,SAAS,CAAC,iBAAiB,CAAC,KAAK,CAAC,OAAO,EAAE,iBAAiB,CAAC,EAAE,KAAK,CAAC,WAAW,EAAE,iBAAiB,CAAC,EAAE,iBAAiB,EAAE,IAAI,CAAC,EAAE,iBAAiB,CAAC,CAAC;AAC3J,CAAC;AAAA,CAAC;AAIF,MAAM,oBAAoB,GAAO,EAAE,OAAmB;IACrD,IAAI,OAAO,GAAG,KAAK,QAAQ,EAAE;QAC5B,GAAG,GAAG,SAAS,CAAC,KAAK,CAAC,GAAG,EAAE,OAAO,CAAC,EAAE,OAAO,CAAC,CAAC;KAC9C;SAAM,IAAI,MAAM,CAAC,GAAG,CAAC,KAAK,QAAQ,EAAE;QACpC,GAAG,GAAG,KAAK,CAAC,SAAS,CAAgB,GAAG,EAAE,OAAO,CAAC,EAAE,OAAO,CAAC,CAAC;KAC7D;IAED,OAAO,GAAG,CAAC;AACZ,CAAC;AAAA,CAAC;AAIF,MAAM,gBAAgB,IAAQ,EAAE,IAAQ,EAAE,OAAmB;IAC5D,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE;QAC7B,IAAI,GAAG,SAAS,CAAC,KAAK,CAAC,IAAI,EAAE,OAAO,CAAC,EAAE,OAAO,CAAC,CAAC;KAChD;SAAM,IAAI,MAAM,CAAC,IAAI,CAAC,KAAK,QAAQ,EAAE;QACrC,IAAI,GAAG,SAAS,CAAgB,IAAI,EAAE,OAAO,CAAC,CAAC;KAC/C;IAED,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE;QAC7B,IAAI,GAAG,SAAS,CAAC,KAAK,CAAC,IAAI,EAAE,OAAO,CAAC,EAAE,OAAO,CAAC,CAAC;KAChD;SAAM,IAAI,MAAM,CAAC,IAAI,CAAC,KAAK,QAAQ,EAAE;QACrC,IAAI,GAAG,SAAS,CAAgB,IAAI,EAAE,OAAO,CAAC,CAAC;KAC/C;IAED,OAAO,IAAI,KAAK,IAAI,CAAC;AACtB,CAAC;AAAA,CAAC;AAEF,MAAM,0BAA0B,GAAU,EAAE,OAAmB;IAC9D,OAAO,GAAG,IAAI,GAAG,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC,CAAC,YAAY,CAAC,MAAM,CAAC,EAAE,UAAU,CAAC,CAAC;AAC1H,CAAC;AAAA,CAAC;AAEF,MAAM,4BAA4B,GAAU,EAAE,OAAmB;IAChE,OAAO,GAAG,IAAI,GAAG,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,YAAY,CAAC,WAAW,CAAC,CAAC,CAAC,YAAY,CAAC,WAAW,CAAC,EAAE,WAAW,CAAC,CAAC;AACrI,CAAC;AAAA,CAAC"} \ No newline at end of file diff --git a/deps/npm/node_modules/uri-js/dist/esnext/util.d.ts b/deps/npm/node_modules/uri-js/dist/esnext/util.d.ts new file mode 100755 index 00000000000000..7c12857543a6b0 --- /dev/null +++ b/deps/npm/node_modules/uri-js/dist/esnext/util.d.ts @@ -0,0 +1,6 @@ +export declare function merge(...sets: Array): string; +export declare function subexp(str: string): string; +export declare function typeOf(o: any): string; +export declare function toUpperCase(str: string): string; +export declare function toArray(obj: any): Array; +export declare function assign(target: object, source: any): any; diff --git a/deps/npm/node_modules/uri-js/dist/esnext/util.js b/deps/npm/node_modules/uri-js/dist/esnext/util.js new file mode 100755 index 00000000000000..072711efdbfe37 --- /dev/null +++ b/deps/npm/node_modules/uri-js/dist/esnext/util.js @@ -0,0 +1,36 @@ +export function merge(...sets) { + if (sets.length > 1) { + sets[0] = sets[0].slice(0, -1); + const xl = sets.length - 1; + for (let x = 1; x < xl; ++x) { + sets[x] = sets[x].slice(1, -1); + } + sets[xl] = sets[xl].slice(1); + return sets.join(''); + } + else { + return sets[0]; + } +} +export function subexp(str) { + return "(?:" + str + ")"; +} +export function typeOf(o) { + return o === undefined ? "undefined" : (o === null ? "null" : Object.prototype.toString.call(o).split(" ").pop().split("]").shift().toLowerCase()); +} +export function toUpperCase(str) { + return str.toUpperCase(); +} +export function toArray(obj) { + return obj !== undefined && obj !== null ? (obj instanceof Array ? obj : (typeof obj.length !== "number" || obj.split || obj.setInterval || obj.call ? [obj] : Array.prototype.slice.call(obj))) : []; +} +export function assign(target, source) { + const obj = target; + if (source) { + for (const key in source) { + obj[key] = source[key]; + } + } + return obj; +} +//# sourceMappingURL=util.js.map \ No newline at end of file diff --git a/deps/npm/node_modules/uri-js/dist/esnext/util.js.map b/deps/npm/node_modules/uri-js/dist/esnext/util.js.map new file mode 100755 index 00000000000000..05d9df021f9d4b --- /dev/null +++ b/deps/npm/node_modules/uri-js/dist/esnext/util.js.map @@ -0,0 +1 @@ +{"version":3,"file":"util.js","sourceRoot":"","sources":["../../src/util.ts"],"names":[],"mappings":"AAAA,MAAM,gBAAgB,GAAG,IAAkB;IAC1C,IAAI,IAAI,CAAC,MAAM,GAAG,CAAC,EAAE;QACpB,IAAI,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;QAC/B,MAAM,EAAE,GAAG,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC;QAC3B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,EAAE,EAAE,EAAE,CAAC,EAAE;YAC5B,IAAI,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;SAC/B;QACD,IAAI,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QAC7B,OAAO,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;KACrB;SAAM;QACN,OAAO,IAAI,CAAC,CAAC,CAAC,CAAC;KACf;AACF,CAAC;AAED,MAAM,iBAAiB,GAAU;IAChC,OAAO,KAAK,GAAG,GAAG,GAAG,GAAG,CAAC;AAC1B,CAAC;AAED,MAAM,iBAAiB,CAAK;IAC3B,OAAO,CAAC,KAAK,SAAS,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,CAAC,WAAW,EAAE,CAAC,CAAC;AACpJ,CAAC;AAED,MAAM,sBAAsB,GAAU;IACrC,OAAO,GAAG,CAAC,WAAW,EAAE,CAAC;AAC1B,CAAC;AAED,MAAM,kBAAkB,GAAO;IAC9B,OAAO,GAAG,KAAK,SAAS,IAAI,GAAG,KAAK,IAAI,CAAC,CAAC,CAAC,CAAC,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,GAAG,CAAC,MAAM,KAAK,QAAQ,IAAI,GAAG,CAAC,KAAK,IAAI,GAAG,CAAC,WAAW,IAAI,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,SAAS,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;AACvM,CAAC;AAGD,MAAM,iBAAiB,MAAc,EAAE,MAAW;IACjD,MAAM,GAAG,GAAG,MAAa,CAAC;IAC1B,IAAI,MAAM,EAAE;QACX,KAAK,MAAM,GAAG,IAAI,MAAM,EAAE;YACzB,GAAG,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC;SACvB;KACD;IACD,OAAO,GAAG,CAAC;AACZ,CAAC"} \ No newline at end of file diff --git a/deps/npm/node_modules/uri-js/package.json b/deps/npm/node_modules/uri-js/package.json new file mode 100755 index 00000000000000..4120c110552ec3 --- /dev/null +++ b/deps/npm/node_modules/uri-js/package.json @@ -0,0 +1,77 @@ +{ + "name": "uri-js", + "version": "4.4.0", + "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", + "directories": { + "test": "tests" + }, + "files": [ + "dist", + "package.json", + "yarn.lock", + "README.md", + "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" + }, + "keywords": [ + "URI", + "IRI", + "IDN", + "URN", + "UUID", + "HTTP", + "HTTPS", + "WS", + "WSS", + "MAILTO", + "RFC3986", + "RFC3987", + "RFC5891", + "RFC2616", + "RFC2818", + "RFC2141", + "RFC4122", + "RFC4291", + "RFC5952", + "RFC6068", + "RFC6455", + "RFC6874" + ], + "author": "Gary Court ", + "license": "BSD-2-Clause", + "bugs": { + "url": "https://github.com/garycourt/uri-js/issues" + }, + "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": "^3.2.0", + "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" + }, + "dependencies": { + "punycode": "^2.1.0" + } +} diff --git a/deps/npm/node_modules/uri-js/yarn.lock b/deps/npm/node_modules/uri-js/yarn.lock new file mode 100755 index 00000000000000..19613ae746a447 --- /dev/null +++ b/deps/npm/node_modules/uri-js/yarn.lock @@ -0,0 +1,1923 @@ +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. +# yarn lockfile v1 + + +abbrev@1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/abbrev/-/abbrev-1.1.1.tgz#f8f2c887ad10bf67f634f005b6987fed3179aac8" + +ajv@^4.9.1: + version "4.11.8" + resolved "https://registry.yarnpkg.com/ajv/-/ajv-4.11.8.tgz#82ffb02b29e662ae53bdc20af15947706739c536" + dependencies: + co "^4.6.0" + json-stable-stringify "^1.0.1" + +align-text@^0.1.1, align-text@^0.1.3: + version "0.1.4" + resolved "https://registry.yarnpkg.com/align-text/-/align-text-0.1.4.tgz#0cd90a561093f35d0a99256c22b7069433fad117" + dependencies: + kind-of "^3.0.2" + longest "^1.0.1" + repeat-string "^1.5.2" + +ansi-regex@^2.0.0: + version "2.1.1" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df" + +ansi-styles@^2.2.1: + version "2.2.1" + resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-2.2.1.tgz#b432dd3358b634cf75e1e4664368240533c1ddbe" + +anymatch@^1.3.0: + version "1.3.2" + resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-1.3.2.tgz#553dcb8f91e3c889845dfdba34c77721b90b9d7a" + dependencies: + micromatch "^2.1.5" + normalize-path "^2.0.0" + +aproba@^1.0.3: + version "1.2.0" + resolved "https://registry.yarnpkg.com/aproba/-/aproba-1.2.0.tgz#6802e6264efd18c790a1b0d517f0f2627bf2c94a" + +are-we-there-yet@~1.1.2: + version "1.1.4" + resolved "https://registry.yarnpkg.com/are-we-there-yet/-/are-we-there-yet-1.1.4.tgz#bb5dca382bb94f05e15194373d16fd3ba1ca110d" + dependencies: + delegates "^1.0.0" + readable-stream "^2.0.6" + +arr-diff@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/arr-diff/-/arr-diff-2.0.0.tgz#8f3b827f955a8bd669697e4a4256ac3ceae356cf" + dependencies: + arr-flatten "^1.0.1" + +arr-flatten@^1.0.1: + version "1.1.0" + resolved "https://registry.yarnpkg.com/arr-flatten/-/arr-flatten-1.1.0.tgz#36048bbff4e7b47e136644316c99669ea5ae91f1" + +array-unique@^0.2.1: + version "0.2.1" + resolved "https://registry.yarnpkg.com/array-unique/-/array-unique-0.2.1.tgz#a1d97ccafcbc2625cc70fadceb36a50c58b01a53" + +asn1@~0.2.3: + version "0.2.3" + resolved "https://registry.yarnpkg.com/asn1/-/asn1-0.2.3.tgz#dac8787713c9966849fc8180777ebe9c1ddf3b86" + +assert-plus@1.0.0, assert-plus@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/assert-plus/-/assert-plus-1.0.0.tgz#f12e0f3c5d77b0b1cdd9146942e4e96c1e4dd525" + +assert-plus@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/assert-plus/-/assert-plus-0.2.0.tgz#d74e1b87e7affc0db8aadb7021f3fe48101ab234" + +async-each@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/async-each/-/async-each-1.0.1.tgz#19d386a1d9edc6e7c1c85d388aedbcc56d33602d" + +asynckit@^0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" + +aws-sign2@~0.6.0: + version "0.6.0" + resolved "https://registry.yarnpkg.com/aws-sign2/-/aws-sign2-0.6.0.tgz#14342dd38dbcc94d0e5b87d763cd63612c0e794f" + +aws4@^1.2.1: + version "1.6.0" + resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.6.0.tgz#83ef5ca860b2b32e4a0deedee8c771b9db57471e" + +babel-cli@^6.26.0: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-cli/-/babel-cli-6.26.0.tgz#502ab54874d7db88ad00b887a06383ce03d002f1" + dependencies: + babel-core "^6.26.0" + babel-polyfill "^6.26.0" + babel-register "^6.26.0" + babel-runtime "^6.26.0" + commander "^2.11.0" + convert-source-map "^1.5.0" + fs-readdir-recursive "^1.0.0" + glob "^7.1.2" + lodash "^4.17.4" + output-file-sync "^1.1.2" + path-is-absolute "^1.0.1" + slash "^1.0.0" + source-map "^0.5.6" + v8flags "^2.1.1" + optionalDependencies: + chokidar "^1.6.1" + +babel-code-frame@^6.26.0: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-code-frame/-/babel-code-frame-6.26.0.tgz#63fd43f7dc1e3bb7ce35947db8fe369a3f58c74b" + dependencies: + chalk "^1.1.3" + esutils "^2.0.2" + js-tokens "^3.0.2" + +babel-core@6, babel-core@^6.26.0: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-core/-/babel-core-6.26.0.tgz#af32f78b31a6fcef119c87b0fd8d9753f03a0bb8" + dependencies: + babel-code-frame "^6.26.0" + babel-generator "^6.26.0" + babel-helpers "^6.24.1" + babel-messages "^6.23.0" + babel-register "^6.26.0" + babel-runtime "^6.26.0" + babel-template "^6.26.0" + babel-traverse "^6.26.0" + babel-types "^6.26.0" + babylon "^6.18.0" + convert-source-map "^1.5.0" + debug "^2.6.8" + json5 "^0.5.1" + lodash "^4.17.4" + minimatch "^3.0.4" + path-is-absolute "^1.0.1" + private "^0.1.7" + slash "^1.0.0" + source-map "^0.5.6" + +babel-generator@^6.26.0: + version "6.26.1" + resolved "https://registry.yarnpkg.com/babel-generator/-/babel-generator-6.26.1.tgz#1844408d3b8f0d35a404ea7ac180f087a601bd90" + dependencies: + babel-messages "^6.23.0" + babel-runtime "^6.26.0" + babel-types "^6.26.0" + detect-indent "^4.0.0" + jsesc "^1.3.0" + lodash "^4.17.4" + source-map "^0.5.7" + trim-right "^1.0.1" + +babel-helper-builder-binary-assignment-operator-visitor@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-helper-builder-binary-assignment-operator-visitor/-/babel-helper-builder-binary-assignment-operator-visitor-6.24.1.tgz#cce4517ada356f4220bcae8a02c2b346f9a56664" + dependencies: + babel-helper-explode-assignable-expression "^6.24.1" + babel-runtime "^6.22.0" + babel-types "^6.24.1" + +babel-helper-call-delegate@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-helper-call-delegate/-/babel-helper-call-delegate-6.24.1.tgz#ece6aacddc76e41c3461f88bfc575bd0daa2df8d" + dependencies: + babel-helper-hoist-variables "^6.24.1" + babel-runtime "^6.22.0" + babel-traverse "^6.24.1" + babel-types "^6.24.1" + +babel-helper-define-map@^6.24.1: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-helper-define-map/-/babel-helper-define-map-6.26.0.tgz#a5f56dab41a25f97ecb498c7ebaca9819f95be5f" + dependencies: + babel-helper-function-name "^6.24.1" + babel-runtime "^6.26.0" + babel-types "^6.26.0" + lodash "^4.17.4" + +babel-helper-explode-assignable-expression@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-helper-explode-assignable-expression/-/babel-helper-explode-assignable-expression-6.24.1.tgz#f25b82cf7dc10433c55f70592d5746400ac22caa" + dependencies: + babel-runtime "^6.22.0" + babel-traverse "^6.24.1" + babel-types "^6.24.1" + +babel-helper-function-name@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-helper-function-name/-/babel-helper-function-name-6.24.1.tgz#d3475b8c03ed98242a25b48351ab18399d3580a9" + dependencies: + babel-helper-get-function-arity "^6.24.1" + babel-runtime "^6.22.0" + babel-template "^6.24.1" + babel-traverse "^6.24.1" + babel-types "^6.24.1" + +babel-helper-get-function-arity@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-helper-get-function-arity/-/babel-helper-get-function-arity-6.24.1.tgz#8f7782aa93407c41d3aa50908f89b031b1b6853d" + dependencies: + babel-runtime "^6.22.0" + babel-types "^6.24.1" + +babel-helper-hoist-variables@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-helper-hoist-variables/-/babel-helper-hoist-variables-6.24.1.tgz#1ecb27689c9d25513eadbc9914a73f5408be7a76" + dependencies: + babel-runtime "^6.22.0" + babel-types "^6.24.1" + +babel-helper-optimise-call-expression@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-helper-optimise-call-expression/-/babel-helper-optimise-call-expression-6.24.1.tgz#f7a13427ba9f73f8f4fa993c54a97882d1244257" + dependencies: + babel-runtime "^6.22.0" + babel-types "^6.24.1" + +babel-helper-regex@^6.24.1: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-helper-regex/-/babel-helper-regex-6.26.0.tgz#325c59f902f82f24b74faceed0363954f6495e72" + dependencies: + babel-runtime "^6.26.0" + babel-types "^6.26.0" + lodash "^4.17.4" + +babel-helper-remap-async-to-generator@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-helper-remap-async-to-generator/-/babel-helper-remap-async-to-generator-6.24.1.tgz#5ec581827ad723fecdd381f1c928390676e4551b" + dependencies: + babel-helper-function-name "^6.24.1" + babel-runtime "^6.22.0" + babel-template "^6.24.1" + babel-traverse "^6.24.1" + babel-types "^6.24.1" + +babel-helper-replace-supers@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-helper-replace-supers/-/babel-helper-replace-supers-6.24.1.tgz#bf6dbfe43938d17369a213ca8a8bf74b6a90ab1a" + dependencies: + babel-helper-optimise-call-expression "^6.24.1" + babel-messages "^6.23.0" + babel-runtime "^6.22.0" + babel-template "^6.24.1" + babel-traverse "^6.24.1" + babel-types "^6.24.1" + +babel-helpers@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-helpers/-/babel-helpers-6.24.1.tgz#3471de9caec388e5c850e597e58a26ddf37602b2" + dependencies: + babel-runtime "^6.22.0" + babel-template "^6.24.1" + +babel-messages@^6.23.0: + version "6.23.0" + resolved "https://registry.yarnpkg.com/babel-messages/-/babel-messages-6.23.0.tgz#f3cdf4703858035b2a2951c6ec5edf6c62f2630e" + dependencies: + babel-runtime "^6.22.0" + +babel-plugin-check-es2015-constants@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-plugin-check-es2015-constants/-/babel-plugin-check-es2015-constants-6.22.0.tgz#35157b101426fd2ffd3da3f75c7d1e91835bbf8a" + dependencies: + babel-runtime "^6.22.0" + +babel-plugin-external-helpers@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-plugin-external-helpers/-/babel-plugin-external-helpers-6.22.0.tgz#2285f48b02bd5dede85175caf8c62e86adccefa1" + dependencies: + babel-runtime "^6.22.0" + +babel-plugin-syntax-async-functions@^6.8.0: + version "6.13.0" + resolved "https://registry.yarnpkg.com/babel-plugin-syntax-async-functions/-/babel-plugin-syntax-async-functions-6.13.0.tgz#cad9cad1191b5ad634bf30ae0872391e0647be95" + +babel-plugin-syntax-exponentiation-operator@^6.8.0: + version "6.13.0" + resolved "https://registry.yarnpkg.com/babel-plugin-syntax-exponentiation-operator/-/babel-plugin-syntax-exponentiation-operator-6.13.0.tgz#9ee7e8337290da95288201a6a57f4170317830de" + +babel-plugin-syntax-trailing-function-commas@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-plugin-syntax-trailing-function-commas/-/babel-plugin-syntax-trailing-function-commas-6.22.0.tgz#ba0360937f8d06e40180a43fe0d5616fff532cf3" + +babel-plugin-transform-async-to-generator@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-async-to-generator/-/babel-plugin-transform-async-to-generator-6.24.1.tgz#6536e378aff6cb1d5517ac0e40eb3e9fc8d08761" + dependencies: + babel-helper-remap-async-to-generator "^6.24.1" + babel-plugin-syntax-async-functions "^6.8.0" + babel-runtime "^6.22.0" + +babel-plugin-transform-es2015-arrow-functions@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-arrow-functions/-/babel-plugin-transform-es2015-arrow-functions-6.22.0.tgz#452692cb711d5f79dc7f85e440ce41b9f244d221" + dependencies: + babel-runtime "^6.22.0" + +babel-plugin-transform-es2015-block-scoped-functions@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-block-scoped-functions/-/babel-plugin-transform-es2015-block-scoped-functions-6.22.0.tgz#bbc51b49f964d70cb8d8e0b94e820246ce3a6141" + dependencies: + babel-runtime "^6.22.0" + +babel-plugin-transform-es2015-block-scoping@^6.24.1: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-block-scoping/-/babel-plugin-transform-es2015-block-scoping-6.26.0.tgz#d70f5299c1308d05c12f463813b0a09e73b1895f" + dependencies: + babel-runtime "^6.26.0" + babel-template "^6.26.0" + babel-traverse "^6.26.0" + babel-types "^6.26.0" + lodash "^4.17.4" + +babel-plugin-transform-es2015-classes@^6.24.1, babel-plugin-transform-es2015-classes@^6.9.0: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-classes/-/babel-plugin-transform-es2015-classes-6.24.1.tgz#5a4c58a50c9c9461e564b4b2a3bfabc97a2584db" + dependencies: + babel-helper-define-map "^6.24.1" + babel-helper-function-name "^6.24.1" + babel-helper-optimise-call-expression "^6.24.1" + babel-helper-replace-supers "^6.24.1" + babel-messages "^6.23.0" + babel-runtime "^6.22.0" + babel-template "^6.24.1" + babel-traverse "^6.24.1" + babel-types "^6.24.1" + +babel-plugin-transform-es2015-computed-properties@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-computed-properties/-/babel-plugin-transform-es2015-computed-properties-6.24.1.tgz#6fe2a8d16895d5634f4cd999b6d3480a308159b3" + dependencies: + babel-runtime "^6.22.0" + babel-template "^6.24.1" + +babel-plugin-transform-es2015-destructuring@^6.22.0: + version "6.23.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-destructuring/-/babel-plugin-transform-es2015-destructuring-6.23.0.tgz#997bb1f1ab967f682d2b0876fe358d60e765c56d" + dependencies: + babel-runtime "^6.22.0" + +babel-plugin-transform-es2015-duplicate-keys@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-duplicate-keys/-/babel-plugin-transform-es2015-duplicate-keys-6.24.1.tgz#73eb3d310ca969e3ef9ec91c53741a6f1576423e" + dependencies: + babel-runtime "^6.22.0" + babel-types "^6.24.1" + +babel-plugin-transform-es2015-for-of@^6.22.0: + version "6.23.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-for-of/-/babel-plugin-transform-es2015-for-of-6.23.0.tgz#f47c95b2b613df1d3ecc2fdb7573623c75248691" + dependencies: + babel-runtime "^6.22.0" + +babel-plugin-transform-es2015-function-name@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-function-name/-/babel-plugin-transform-es2015-function-name-6.24.1.tgz#834c89853bc36b1af0f3a4c5dbaa94fd8eacaa8b" + dependencies: + babel-helper-function-name "^6.24.1" + babel-runtime "^6.22.0" + babel-types "^6.24.1" + +babel-plugin-transform-es2015-literals@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-literals/-/babel-plugin-transform-es2015-literals-6.22.0.tgz#4f54a02d6cd66cf915280019a31d31925377ca2e" + dependencies: + babel-runtime "^6.22.0" + +babel-plugin-transform-es2015-modules-amd@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-amd/-/babel-plugin-transform-es2015-modules-amd-6.24.1.tgz#3b3e54017239842d6d19c3011c4bd2f00a00d154" + dependencies: + babel-plugin-transform-es2015-modules-commonjs "^6.24.1" + babel-runtime "^6.22.0" + babel-template "^6.24.1" + +babel-plugin-transform-es2015-modules-commonjs@^6.24.1: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-commonjs/-/babel-plugin-transform-es2015-modules-commonjs-6.26.0.tgz#0d8394029b7dc6abe1a97ef181e00758dd2e5d8a" + dependencies: + babel-plugin-transform-strict-mode "^6.24.1" + babel-runtime "^6.26.0" + babel-template "^6.26.0" + babel-types "^6.26.0" + +babel-plugin-transform-es2015-modules-systemjs@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-systemjs/-/babel-plugin-transform-es2015-modules-systemjs-6.24.1.tgz#ff89a142b9119a906195f5f106ecf305d9407d23" + dependencies: + babel-helper-hoist-variables "^6.24.1" + babel-runtime "^6.22.0" + babel-template "^6.24.1" + +babel-plugin-transform-es2015-modules-umd@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-umd/-/babel-plugin-transform-es2015-modules-umd-6.24.1.tgz#ac997e6285cd18ed6176adb607d602344ad38468" + dependencies: + babel-plugin-transform-es2015-modules-amd "^6.24.1" + babel-runtime "^6.22.0" + babel-template "^6.24.1" + +babel-plugin-transform-es2015-object-super@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-object-super/-/babel-plugin-transform-es2015-object-super-6.24.1.tgz#24cef69ae21cb83a7f8603dad021f572eb278f8d" + dependencies: + babel-helper-replace-supers "^6.24.1" + babel-runtime "^6.22.0" + +babel-plugin-transform-es2015-parameters@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-parameters/-/babel-plugin-transform-es2015-parameters-6.24.1.tgz#57ac351ab49caf14a97cd13b09f66fdf0a625f2b" + dependencies: + babel-helper-call-delegate "^6.24.1" + babel-helper-get-function-arity "^6.24.1" + babel-runtime "^6.22.0" + babel-template "^6.24.1" + babel-traverse "^6.24.1" + babel-types "^6.24.1" + +babel-plugin-transform-es2015-shorthand-properties@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-shorthand-properties/-/babel-plugin-transform-es2015-shorthand-properties-6.24.1.tgz#24f875d6721c87661bbd99a4622e51f14de38aa0" + dependencies: + babel-runtime "^6.22.0" + babel-types "^6.24.1" + +babel-plugin-transform-es2015-spread@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-spread/-/babel-plugin-transform-es2015-spread-6.22.0.tgz#d6d68a99f89aedc4536c81a542e8dd9f1746f8d1" + dependencies: + babel-runtime "^6.22.0" + +babel-plugin-transform-es2015-sticky-regex@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-sticky-regex/-/babel-plugin-transform-es2015-sticky-regex-6.24.1.tgz#00c1cdb1aca71112cdf0cf6126c2ed6b457ccdbc" + dependencies: + babel-helper-regex "^6.24.1" + babel-runtime "^6.22.0" + babel-types "^6.24.1" + +babel-plugin-transform-es2015-template-literals@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-template-literals/-/babel-plugin-transform-es2015-template-literals-6.22.0.tgz#a84b3450f7e9f8f1f6839d6d687da84bb1236d8d" + dependencies: + babel-runtime "^6.22.0" + +babel-plugin-transform-es2015-typeof-symbol@^6.22.0: + version "6.23.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-typeof-symbol/-/babel-plugin-transform-es2015-typeof-symbol-6.23.0.tgz#dec09f1cddff94b52ac73d505c84df59dcceb372" + dependencies: + babel-runtime "^6.22.0" + +babel-plugin-transform-es2015-unicode-regex@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-unicode-regex/-/babel-plugin-transform-es2015-unicode-regex-6.24.1.tgz#d38b12f42ea7323f729387f18a7c5ae1faeb35e9" + dependencies: + babel-helper-regex "^6.24.1" + babel-runtime "^6.22.0" + regexpu-core "^2.0.0" + +babel-plugin-transform-exponentiation-operator@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-exponentiation-operator/-/babel-plugin-transform-exponentiation-operator-6.24.1.tgz#2ab0c9c7f3098fa48907772bb813fe41e8de3a0e" + dependencies: + babel-helper-builder-binary-assignment-operator-visitor "^6.24.1" + babel-plugin-syntax-exponentiation-operator "^6.8.0" + babel-runtime "^6.22.0" + +babel-plugin-transform-regenerator@^6.24.1: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-regenerator/-/babel-plugin-transform-regenerator-6.26.0.tgz#e0703696fbde27f0a3efcacf8b4dca2f7b3a8f2f" + dependencies: + regenerator-transform "^0.10.0" + +babel-plugin-transform-strict-mode@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-strict-mode/-/babel-plugin-transform-strict-mode-6.24.1.tgz#d5faf7aa578a65bbe591cf5edae04a0c67020758" + dependencies: + babel-runtime "^6.22.0" + babel-types "^6.24.1" + +babel-polyfill@^6.26.0: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-polyfill/-/babel-polyfill-6.26.0.tgz#379937abc67d7895970adc621f284cd966cf2153" + dependencies: + babel-runtime "^6.26.0" + core-js "^2.5.0" + regenerator-runtime "^0.10.5" + +babel-preset-es2015@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-preset-es2015/-/babel-preset-es2015-6.24.1.tgz#d44050d6bc2c9feea702aaf38d727a0210538939" + dependencies: + babel-plugin-check-es2015-constants "^6.22.0" + babel-plugin-transform-es2015-arrow-functions "^6.22.0" + babel-plugin-transform-es2015-block-scoped-functions "^6.22.0" + babel-plugin-transform-es2015-block-scoping "^6.24.1" + babel-plugin-transform-es2015-classes "^6.24.1" + babel-plugin-transform-es2015-computed-properties "^6.24.1" + babel-plugin-transform-es2015-destructuring "^6.22.0" + babel-plugin-transform-es2015-duplicate-keys "^6.24.1" + babel-plugin-transform-es2015-for-of "^6.22.0" + babel-plugin-transform-es2015-function-name "^6.24.1" + babel-plugin-transform-es2015-literals "^6.22.0" + babel-plugin-transform-es2015-modules-amd "^6.24.1" + babel-plugin-transform-es2015-modules-commonjs "^6.24.1" + babel-plugin-transform-es2015-modules-systemjs "^6.24.1" + babel-plugin-transform-es2015-modules-umd "^6.24.1" + babel-plugin-transform-es2015-object-super "^6.24.1" + babel-plugin-transform-es2015-parameters "^6.24.1" + babel-plugin-transform-es2015-shorthand-properties "^6.24.1" + babel-plugin-transform-es2015-spread "^6.22.0" + babel-plugin-transform-es2015-sticky-regex "^6.24.1" + babel-plugin-transform-es2015-template-literals "^6.22.0" + babel-plugin-transform-es2015-typeof-symbol "^6.22.0" + babel-plugin-transform-es2015-unicode-regex "^6.24.1" + babel-plugin-transform-regenerator "^6.24.1" + +babel-preset-es2016@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-preset-es2016/-/babel-preset-es2016-6.24.1.tgz#f900bf93e2ebc0d276df9b8ab59724ebfd959f8b" + dependencies: + babel-plugin-transform-exponentiation-operator "^6.24.1" + +babel-preset-es2017@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-preset-es2017/-/babel-preset-es2017-6.24.1.tgz#597beadfb9f7f208bcfd8a12e9b2b29b8b2f14d1" + dependencies: + babel-plugin-syntax-trailing-function-commas "^6.22.0" + babel-plugin-transform-async-to-generator "^6.24.1" + +babel-preset-latest@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-preset-latest/-/babel-preset-latest-6.24.1.tgz#677de069154a7485c2d25c577c02f624b85b85e8" + dependencies: + babel-preset-es2015 "^6.24.1" + babel-preset-es2016 "^6.24.1" + babel-preset-es2017 "^6.24.1" + +babel-register@^6.26.0: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-register/-/babel-register-6.26.0.tgz#6ed021173e2fcb486d7acb45c6009a856f647071" + dependencies: + babel-core "^6.26.0" + babel-runtime "^6.26.0" + core-js "^2.5.0" + home-or-tmp "^2.0.0" + lodash "^4.17.4" + mkdirp "^0.5.1" + source-map-support "^0.4.15" + +babel-runtime@^6.18.0, babel-runtime@^6.22.0, babel-runtime@^6.26.0: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-runtime/-/babel-runtime-6.26.0.tgz#965c7058668e82b55d7bfe04ff2337bc8b5647fe" + dependencies: + core-js "^2.4.0" + regenerator-runtime "^0.11.0" + +babel-template@^6.24.1, babel-template@^6.26.0: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-template/-/babel-template-6.26.0.tgz#de03e2d16396b069f46dd9fff8521fb1a0e35e02" + dependencies: + babel-runtime "^6.26.0" + babel-traverse "^6.26.0" + babel-types "^6.26.0" + babylon "^6.18.0" + lodash "^4.17.4" + +babel-traverse@^6.24.1, babel-traverse@^6.26.0: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-traverse/-/babel-traverse-6.26.0.tgz#46a9cbd7edcc62c8e5c064e2d2d8d0f4035766ee" + dependencies: + babel-code-frame "^6.26.0" + babel-messages "^6.23.0" + babel-runtime "^6.26.0" + babel-types "^6.26.0" + babylon "^6.18.0" + debug "^2.6.8" + globals "^9.18.0" + invariant "^2.2.2" + lodash "^4.17.4" + +babel-types@^6.19.0, babel-types@^6.24.1, babel-types@^6.26.0: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-types/-/babel-types-6.26.0.tgz#a3b073f94ab49eb6fa55cd65227a334380632497" + dependencies: + babel-runtime "^6.26.0" + esutils "^2.0.2" + lodash "^4.17.4" + to-fast-properties "^1.0.3" + +babylon@^6.18.0: + version "6.18.0" + resolved "https://registry.yarnpkg.com/babylon/-/babylon-6.18.0.tgz#af2f3b88fa6f5c1e4c634d1a0f8eac4f55b395e3" + +balanced-match@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767" + +bcrypt-pbkdf@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.1.tgz#63bc5dcb61331b92bc05fd528953c33462a06f8d" + dependencies: + tweetnacl "^0.14.3" + +binary-extensions@^1.0.0: + version "1.11.0" + resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-1.11.0.tgz#46aa1751fb6a2f93ee5e689bb1087d4b14c6c205" + +block-stream@*: + version "0.0.9" + resolved "https://registry.yarnpkg.com/block-stream/-/block-stream-0.0.9.tgz#13ebfe778a03205cfe03751481ebb4b3300c126a" + dependencies: + inherits "~2.0.0" + +boom@2.x.x: + version "2.10.1" + resolved "https://registry.yarnpkg.com/boom/-/boom-2.10.1.tgz#39c8918ceff5799f83f9492a848f625add0c766f" + dependencies: + hoek "2.x.x" + +brace-expansion@^1.1.7: + version "1.1.11" + resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" + dependencies: + balanced-match "^1.0.0" + concat-map "0.0.1" + +braces@^1.8.2: + version "1.8.5" + resolved "https://registry.yarnpkg.com/braces/-/braces-1.8.5.tgz#ba77962e12dff969d6b76711e914b737857bf6a7" + dependencies: + expand-range "^1.8.1" + preserve "^0.2.0" + repeat-element "^1.1.2" + +browser-resolve@^1.11.0: + version "1.11.2" + resolved "https://registry.yarnpkg.com/browser-resolve/-/browser-resolve-1.11.2.tgz#8ff09b0a2c421718a1051c260b32e48f442938ce" + dependencies: + resolve "1.1.7" + +browser-stdout@1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/browser-stdout/-/browser-stdout-1.3.0.tgz#f351d32969d32fa5d7a5567154263d928ae3bd1f" + +buffer-crc32@^0.2.5: + version "0.2.13" + resolved "https://registry.yarnpkg.com/buffer-crc32/-/buffer-crc32-0.2.13.tgz#0d333e3f00eac50aa1454abd30ef8c2a5d9a7242" + +builtin-modules@^1.1.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/builtin-modules/-/builtin-modules-1.1.1.tgz#270f076c5a72c02f5b65a47df94c5fe3a278892f" + +camelcase@^1.0.2: + version "1.2.1" + resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-1.2.1.tgz#9bb5304d2e0b56698b2c758b08a3eaa9daa58a39" + +caseless@~0.12.0: + version "0.12.0" + resolved "https://registry.yarnpkg.com/caseless/-/caseless-0.12.0.tgz#1b681c21ff84033c826543090689420d187151dc" + +center-align@^0.1.1: + version "0.1.3" + resolved "https://registry.yarnpkg.com/center-align/-/center-align-0.1.3.tgz#aa0d32629b6ee972200411cbd4461c907bc2b7ad" + dependencies: + align-text "^0.1.3" + lazy-cache "^1.0.3" + +chalk@^1.1.3: + version "1.1.3" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-1.1.3.tgz#a8115c55e4a702fe4d150abd3872822a7e09fc98" + dependencies: + ansi-styles "^2.2.1" + escape-string-regexp "^1.0.2" + has-ansi "^2.0.0" + strip-ansi "^3.0.0" + supports-color "^2.0.0" + +chokidar@^1.6.1: + version "1.7.0" + resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-1.7.0.tgz#798e689778151c8076b4b360e5edd28cda2bb468" + dependencies: + anymatch "^1.3.0" + async-each "^1.0.0" + glob-parent "^2.0.0" + inherits "^2.0.1" + is-binary-path "^1.0.0" + is-glob "^2.0.0" + path-is-absolute "^1.0.0" + readdirp "^2.0.0" + optionalDependencies: + fsevents "^1.0.0" + +cliui@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/cliui/-/cliui-2.1.0.tgz#4b475760ff80264c762c3a1719032e91c7fea0d1" + dependencies: + center-align "^0.1.1" + right-align "^0.1.1" + wordwrap "0.0.2" + +co@^4.6.0: + version "4.6.0" + resolved "https://registry.yarnpkg.com/co/-/co-4.6.0.tgz#6ea6bdf3d853ae54ccb8e47bfa0bf3f9031fb184" + +code-point-at@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/code-point-at/-/code-point-at-1.1.0.tgz#0d070b4d043a5bea33a2f1a40e2edb3d9a4ccf77" + +combined-stream@^1.0.5, combined-stream@~1.0.5: + version "1.0.6" + resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.6.tgz#723e7df6e801ac5613113a7e445a9b69cb632818" + dependencies: + delayed-stream "~1.0.0" + +commander@2.9.0: + version "2.9.0" + resolved "https://registry.yarnpkg.com/commander/-/commander-2.9.0.tgz#9c99094176e12240cb22d6c5146098400fe0f7d4" + dependencies: + graceful-readlink ">= 1.0.0" + +commander@^2.11.0: + version "2.15.1" + resolved "https://registry.yarnpkg.com/commander/-/commander-2.15.1.tgz#df46e867d0fc2aec66a34662b406a9ccafff5b0f" + +concat-map@0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" + +console-control-strings@^1.0.0, console-control-strings@~1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/console-control-strings/-/console-control-strings-1.1.0.tgz#3d7cf4464db6446ea644bf4b39507f9851008e8e" + +convert-source-map@^1.5.0: + version "1.5.1" + resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.5.1.tgz#b8278097b9bc229365de5c62cf5fcaed8b5599e5" + +core-js@^2.4.0, core-js@^2.5.0: + version "2.5.4" + resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.5.4.tgz#f2c8bf181f2a80b92f360121429ce63a2f0aeae0" + +core-util-is@1.0.2, core-util-is@~1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7" + +cryptiles@2.x.x: + version "2.0.5" + resolved "https://registry.yarnpkg.com/cryptiles/-/cryptiles-2.0.5.tgz#3bdfecdc608147c1c67202fa291e7dca59eaa3b8" + dependencies: + boom "2.x.x" + +dashdash@^1.12.0: + version "1.14.1" + resolved "https://registry.yarnpkg.com/dashdash/-/dashdash-1.14.1.tgz#853cfa0f7cbe2fed5de20326b8dd581035f6e2f0" + dependencies: + assert-plus "^1.0.0" + +debug@2.6.8: + version "2.6.8" + resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.8.tgz#e731531ca2ede27d188222427da17821d68ff4fc" + dependencies: + ms "2.0.0" + +debug@^2.2.0, debug@^2.6.8: + version "2.6.9" + resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f" + dependencies: + ms "2.0.0" + +decamelize@^1.0.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290" + +deep-extend@~0.4.0: + version "0.4.2" + resolved "https://registry.yarnpkg.com/deep-extend/-/deep-extend-0.4.2.tgz#48b699c27e334bf89f10892be432f6e4c7d34a7f" + +delayed-stream@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619" + +delegates@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/delegates/-/delegates-1.0.0.tgz#84c6e159b81904fdca59a0ef44cd870d31250f9a" + +detect-indent@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/detect-indent/-/detect-indent-4.0.0.tgz#f76d064352cdf43a1cb6ce619c4ee3a9475de208" + dependencies: + repeating "^2.0.0" + +detect-libc@^1.0.2: + version "1.0.3" + resolved "https://registry.yarnpkg.com/detect-libc/-/detect-libc-1.0.3.tgz#fa137c4bd698edf55cd5cd02ac559f91a4c4ba9b" + +diff@3.2.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/diff/-/diff-3.2.0.tgz#c9ce393a4b7cbd0b058a725c93df299027868ff9" + +ecc-jsbn@~0.1.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/ecc-jsbn/-/ecc-jsbn-0.1.1.tgz#0fc73a9ed5f0d53c38193398523ef7e543777505" + dependencies: + jsbn "~0.1.0" + +es6-promise@^3.1.2: + version "3.3.1" + resolved "https://registry.yarnpkg.com/es6-promise/-/es6-promise-3.3.1.tgz#a08cdde84ccdbf34d027a1451bc91d4bcd28a613" + +escape-string-regexp@1.0.5, escape-string-regexp@^1.0.2: + version "1.0.5" + resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" + +estree-walker@^0.2.1: + version "0.2.1" + resolved "https://registry.yarnpkg.com/estree-walker/-/estree-walker-0.2.1.tgz#bdafe8095383d8414d5dc2ecf4c9173b6db9412e" + +esutils@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.2.tgz#0abf4f1caa5bcb1f7a9d8acc6dea4faaa04bac9b" + +expand-brackets@^0.1.4: + version "0.1.5" + resolved "https://registry.yarnpkg.com/expand-brackets/-/expand-brackets-0.1.5.tgz#df07284e342a807cd733ac5af72411e581d1177b" + dependencies: + is-posix-bracket "^0.1.0" + +expand-range@^1.8.1: + version "1.8.2" + resolved "https://registry.yarnpkg.com/expand-range/-/expand-range-1.8.2.tgz#a299effd335fe2721ebae8e257ec79644fc85337" + dependencies: + fill-range "^2.1.0" + +extend@~3.0.0: + version "3.0.2" + resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.2.tgz#f8b1136b4071fbd8eb140aff858b1019ec2915fa" + +extglob@^0.3.1: + version "0.3.2" + resolved "https://registry.yarnpkg.com/extglob/-/extglob-0.3.2.tgz#2e18ff3d2f49ab2765cec9023f011daa8d8349a1" + dependencies: + is-extglob "^1.0.0" + +extsprintf@1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.3.0.tgz#96918440e3041a7a414f8c52e3c574eb3c3e1e05" + +extsprintf@^1.2.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.4.0.tgz#e2689f8f356fad62cca65a3a91c5df5f9551692f" + +filename-regex@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/filename-regex/-/filename-regex-2.0.1.tgz#c1c4b9bee3e09725ddb106b75c1e301fe2f18b26" + +fill-range@^2.1.0: + version "2.2.3" + resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-2.2.3.tgz#50b77dfd7e469bc7492470963699fe7a8485a723" + dependencies: + is-number "^2.1.0" + isobject "^2.0.0" + randomatic "^1.1.3" + repeat-element "^1.1.2" + repeat-string "^1.5.2" + +for-in@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/for-in/-/for-in-1.0.2.tgz#81068d295a8142ec0ac726c6e2200c30fb6d5e80" + +for-own@^0.1.4: + version "0.1.5" + resolved "https://registry.yarnpkg.com/for-own/-/for-own-0.1.5.tgz#5265c681a4f294dabbf17c9509b6763aa84510ce" + dependencies: + for-in "^1.0.1" + +forever-agent@~0.6.1: + version "0.6.1" + resolved "https://registry.yarnpkg.com/forever-agent/-/forever-agent-0.6.1.tgz#fbc71f0c41adeb37f96c577ad1ed42d8fdacca91" + +form-data@~2.1.1: + version "2.1.4" + resolved "https://registry.yarnpkg.com/form-data/-/form-data-2.1.4.tgz#33c183acf193276ecaa98143a69e94bfee1750d1" + dependencies: + asynckit "^0.4.0" + combined-stream "^1.0.5" + mime-types "^2.1.12" + +fs-readdir-recursive@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/fs-readdir-recursive/-/fs-readdir-recursive-1.1.0.tgz#e32fc030a2ccee44a6b5371308da54be0b397d27" + +fs.realpath@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" + +fsevents@^1.0.0: + version "1.1.3" + resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-1.1.3.tgz#11f82318f5fe7bb2cd22965a108e9306208216d8" + dependencies: + nan "^2.3.0" + node-pre-gyp "^0.6.39" + +fstream-ignore@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/fstream-ignore/-/fstream-ignore-1.0.5.tgz#9c31dae34767018fe1d249b24dada67d092da105" + dependencies: + fstream "^1.0.0" + inherits "2" + minimatch "^3.0.0" + +fstream@^1.0.0, fstream@^1.0.10, fstream@^1.0.12: + version "1.0.12" + resolved "https://registry.yarnpkg.com/fstream/-/fstream-1.0.12.tgz#4e8ba8ee2d48be4f7d0de505455548eae5932045" + dependencies: + graceful-fs "^4.1.2" + inherits "~2.0.0" + mkdirp ">=0.5 0" + rimraf "2" + +gauge@~2.7.3: + version "2.7.4" + resolved "https://registry.yarnpkg.com/gauge/-/gauge-2.7.4.tgz#2c03405c7538c39d7eb37b317022e325fb018bf7" + dependencies: + aproba "^1.0.3" + console-control-strings "^1.0.0" + has-unicode "^2.0.0" + object-assign "^4.1.0" + signal-exit "^3.0.0" + string-width "^1.0.1" + strip-ansi "^3.0.1" + wide-align "^1.1.0" + +getpass@^0.1.1: + version "0.1.7" + resolved "https://registry.yarnpkg.com/getpass/-/getpass-0.1.7.tgz#5eff8e3e684d569ae4cb2b1282604e8ba62149fa" + dependencies: + assert-plus "^1.0.0" + +glob-base@^0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/glob-base/-/glob-base-0.3.0.tgz#dbb164f6221b1c0b1ccf82aea328b497df0ea3c4" + dependencies: + glob-parent "^2.0.0" + is-glob "^2.0.0" + +glob-parent@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-2.0.0.tgz#81383d72db054fcccf5336daa902f182f6edbb28" + dependencies: + is-glob "^2.0.0" + +glob@7.1.1: + version "7.1.1" + resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.1.tgz#805211df04faaf1c63a3600306cdf5ade50b2ec8" + dependencies: + fs.realpath "^1.0.0" + inflight "^1.0.4" + inherits "2" + minimatch "^3.0.2" + once "^1.3.0" + path-is-absolute "^1.0.0" + +glob@^7.1.2: + version "7.1.2" + resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.2.tgz#c19c9df9a028702d678612384a6552404c636d15" + dependencies: + fs.realpath "^1.0.0" + inflight "^1.0.4" + inherits "2" + minimatch "^3.0.4" + once "^1.3.0" + path-is-absolute "^1.0.0" + +glob@^7.1.3: + version "7.1.5" + resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.5.tgz#6714c69bee20f3c3e64c4dd905553e532b40cdc0" + dependencies: + fs.realpath "^1.0.0" + inflight "^1.0.4" + inherits "2" + minimatch "^3.0.4" + once "^1.3.0" + path-is-absolute "^1.0.0" + +globals@^9.18.0: + version "9.18.0" + resolved "https://registry.yarnpkg.com/globals/-/globals-9.18.0.tgz#aa3896b3e69b487f17e31ed2143d69a8e30c2d8a" + +graceful-fs@^4.1.2: + version "4.2.3" + resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.3.tgz#4a12ff1b60376ef09862c2093edd908328be8423" + +graceful-fs@^4.1.3, graceful-fs@^4.1.4: + version "4.2.3" + resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.3.tgz#4a12ff1b60376ef09862c2093edd908328be8423" + +"graceful-readlink@>= 1.0.0": + version "1.0.1" + resolved "https://registry.yarnpkg.com/graceful-readlink/-/graceful-readlink-1.0.1.tgz#4cafad76bc62f02fa039b2f94e9a3dd3a391a725" + +growl@1.9.2: + version "1.9.2" + resolved "https://registry.yarnpkg.com/growl/-/growl-1.9.2.tgz#0ea7743715db8d8de2c5ede1775e1b45ac85c02f" + +har-schema@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/har-schema/-/har-schema-1.0.5.tgz#d263135f43307c02c602afc8fe95970c0151369e" + +har-validator@~4.2.1: + version "4.2.1" + resolved "https://registry.yarnpkg.com/har-validator/-/har-validator-4.2.1.tgz#33481d0f1bbff600dd203d75812a6a5fba002e2a" + dependencies: + ajv "^4.9.1" + har-schema "^1.0.5" + +has-ansi@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/has-ansi/-/has-ansi-2.0.0.tgz#34f5049ce1ecdf2b0649af3ef24e45ed35416d91" + dependencies: + ansi-regex "^2.0.0" + +has-flag@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-1.0.0.tgz#9d9e793165ce017a00f00418c43f942a7b1d11fa" + +has-unicode@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/has-unicode/-/has-unicode-2.0.1.tgz#e0e6fe6a28cf51138855e086d1691e771de2a8b9" + +hawk@3.1.3, hawk@~3.1.3: + version "3.1.3" + resolved "https://registry.yarnpkg.com/hawk/-/hawk-3.1.3.tgz#078444bd7c1640b0fe540d2c9b73d59678e8e1c4" + dependencies: + boom "2.x.x" + cryptiles "2.x.x" + hoek "2.x.x" + sntp "1.x.x" + +he@1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/he/-/he-1.1.1.tgz#93410fd21b009735151f8868c2f271f3427e23fd" + +hoek@2.x.x: + version "2.16.3" + resolved "https://registry.yarnpkg.com/hoek/-/hoek-2.16.3.tgz#20bb7403d3cea398e91dc4710a8ff1b8274a25ed" + +home-or-tmp@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/home-or-tmp/-/home-or-tmp-2.0.0.tgz#e36c3f2d2cae7d746a857e38d18d5f32a7882db8" + dependencies: + os-homedir "^1.0.0" + os-tmpdir "^1.0.1" + +http-signature@~1.1.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/http-signature/-/http-signature-1.1.1.tgz#df72e267066cd0ac67fb76adf8e134a8fbcf91bf" + dependencies: + assert-plus "^0.2.0" + jsprim "^1.2.2" + sshpk "^1.7.0" + +inflight@^1.0.4: + version "1.0.6" + resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" + dependencies: + once "^1.3.0" + wrappy "1" + +inherits@2, inherits@^2.0.1, inherits@~2.0.0, inherits@~2.0.3: + version "2.0.4" + resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" + +ini@~1.3.0: + version "1.3.5" + resolved "https://registry.yarnpkg.com/ini/-/ini-1.3.5.tgz#eee25f56db1c9ec6085e0c22778083f596abf927" + +invariant@^2.2.2: + version "2.2.4" + resolved "https://registry.yarnpkg.com/invariant/-/invariant-2.2.4.tgz#610f3c92c9359ce1db616e538008d23ff35158e6" + dependencies: + loose-envify "^1.0.0" + +is-binary-path@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/is-binary-path/-/is-binary-path-1.0.1.tgz#75f16642b480f187a711c814161fd3a4a7655898" + dependencies: + binary-extensions "^1.0.0" + +is-buffer@^1.1.5: + version "1.1.6" + resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.6.tgz#efaa2ea9daa0d7ab2ea13a97b2b8ad51fefbe8be" + +is-dotfile@^1.0.0: + version "1.0.3" + resolved "https://registry.yarnpkg.com/is-dotfile/-/is-dotfile-1.0.3.tgz#a6a2f32ffd2dfb04f5ca25ecd0f6b83cf798a1e1" + +is-equal-shallow@^0.1.3: + version "0.1.3" + resolved "https://registry.yarnpkg.com/is-equal-shallow/-/is-equal-shallow-0.1.3.tgz#2238098fc221de0bcfa5d9eac4c45d638aa1c534" + dependencies: + is-primitive "^2.0.0" + +is-extendable@^0.1.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/is-extendable/-/is-extendable-0.1.1.tgz#62b110e289a471418e3ec36a617d472e301dfc89" + +is-extglob@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-1.0.0.tgz#ac468177c4943405a092fc8f29760c6ffc6206c0" + +is-finite@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/is-finite/-/is-finite-1.0.2.tgz#cc6677695602be550ef11e8b4aa6305342b6d0aa" + dependencies: + number-is-nan "^1.0.0" + +is-fullwidth-code-point@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz#ef9e31386f031a7f0d643af82fde50c457ef00cb" + dependencies: + number-is-nan "^1.0.0" + +is-glob@^2.0.0, is-glob@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-2.0.1.tgz#d096f926a3ded5600f3fdfd91198cb0888c2d863" + dependencies: + is-extglob "^1.0.0" + +is-number@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/is-number/-/is-number-2.1.0.tgz#01fcbbb393463a548f2f466cce16dece49db908f" + dependencies: + kind-of "^3.0.2" + +is-number@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/is-number/-/is-number-3.0.0.tgz#24fd6201a4782cf50561c810276afc7d12d71195" + dependencies: + kind-of "^3.0.2" + +is-posix-bracket@^0.1.0: + version "0.1.1" + resolved "https://registry.yarnpkg.com/is-posix-bracket/-/is-posix-bracket-0.1.1.tgz#3334dc79774368e92f016e6fbc0a88f5cd6e6bc4" + +is-primitive@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/is-primitive/-/is-primitive-2.0.0.tgz#207bab91638499c07b2adf240a41a87210034575" + +is-typedarray@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-typedarray/-/is-typedarray-1.0.0.tgz#e479c80858df0c1b11ddda6940f96011fcda4a9a" + +isarray@1.0.0, isarray@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" + +isobject@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/isobject/-/isobject-2.1.0.tgz#f065561096a3f1da2ef46272f815c840d87e0c89" + dependencies: + isarray "1.0.0" + +isstream@~0.1.2: + version "0.1.2" + resolved "https://registry.yarnpkg.com/isstream/-/isstream-0.1.2.tgz#47e63f7af55afa6f92e1500e690eb8b8529c099a" + +js-tokens@^3.0.0, js-tokens@^3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-3.0.2.tgz#9866df395102130e38f7f996bceb65443209c25b" + +jsbn@~0.1.0: + version "0.1.1" + resolved "https://registry.yarnpkg.com/jsbn/-/jsbn-0.1.1.tgz#a5e654c2e5a2deb5f201d96cefbca80c0ef2f513" + +jsesc@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-1.3.0.tgz#46c3fec8c1892b12b0833db9bc7622176dbab34b" + +jsesc@~0.5.0: + version "0.5.0" + resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-0.5.0.tgz#e7dee66e35d6fc16f710fe91d5cf69f70f08911d" + +json-schema@0.2.3: + version "0.2.3" + resolved "https://registry.yarnpkg.com/json-schema/-/json-schema-0.2.3.tgz#b480c892e59a2f05954ce727bd3f2a4e882f9e13" + +json-stable-stringify@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/json-stable-stringify/-/json-stable-stringify-1.0.1.tgz#9a759d39c5f2ff503fd5300646ed445f88c4f9af" + dependencies: + jsonify "~0.0.0" + +json-stringify-safe@~5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz#1296a2d58fd45f19a0f6ce01d65701e2c735b6eb" + +json3@3.3.2: + version "3.3.2" + resolved "https://registry.yarnpkg.com/json3/-/json3-3.3.2.tgz#3c0434743df93e2f5c42aee7b19bcb483575f4e1" + +json5@^0.5.1: + version "0.5.1" + resolved "https://registry.yarnpkg.com/json5/-/json5-0.5.1.tgz#1eade7acc012034ad84e2396767ead9fa5495821" + +jsonify@~0.0.0: + version "0.0.0" + resolved "https://registry.yarnpkg.com/jsonify/-/jsonify-0.0.0.tgz#2c74b6ee41d93ca51b7b5aaee8f503631d252a73" + +jsprim@^1.2.2: + version "1.4.1" + resolved "https://registry.yarnpkg.com/jsprim/-/jsprim-1.4.1.tgz#313e66bc1e5cc06e438bc1b7499c2e5c56acb6a2" + dependencies: + assert-plus "1.0.0" + extsprintf "1.3.0" + json-schema "0.2.3" + verror "1.10.0" + +kind-of@^3.0.2: + version "3.2.2" + resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-3.2.2.tgz#31ea21a734bab9bbb0f32466d893aea51e4a3c64" + dependencies: + is-buffer "^1.1.5" + +kind-of@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-4.0.0.tgz#20813df3d712928b207378691a45066fae72dd57" + dependencies: + is-buffer "^1.1.5" + +lazy-cache@^1.0.3: + version "1.0.4" + resolved "https://registry.yarnpkg.com/lazy-cache/-/lazy-cache-1.0.4.tgz#a1d78fc3a50474cb80845d3b3b6e1da49a446e8e" + +lodash._baseassign@^3.0.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/lodash._baseassign/-/lodash._baseassign-3.2.0.tgz#8c38a099500f215ad09e59f1722fd0c52bfe0a4e" + dependencies: + lodash._basecopy "^3.0.0" + lodash.keys "^3.0.0" + +lodash._basecopy@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/lodash._basecopy/-/lodash._basecopy-3.0.1.tgz#8da0e6a876cf344c0ad8a54882111dd3c5c7ca36" + +lodash._basecreate@^3.0.0: + version "3.0.3" + resolved "https://registry.yarnpkg.com/lodash._basecreate/-/lodash._basecreate-3.0.3.tgz#1bc661614daa7fc311b7d03bf16806a0213cf821" + +lodash._getnative@^3.0.0: + version "3.9.1" + resolved "https://registry.yarnpkg.com/lodash._getnative/-/lodash._getnative-3.9.1.tgz#570bc7dede46d61cdcde687d65d3eecbaa3aaff5" + +lodash._isiterateecall@^3.0.0: + version "3.0.9" + resolved "https://registry.yarnpkg.com/lodash._isiterateecall/-/lodash._isiterateecall-3.0.9.tgz#5203ad7ba425fae842460e696db9cf3e6aac057c" + +lodash.create@3.1.1: + version "3.1.1" + resolved "https://registry.yarnpkg.com/lodash.create/-/lodash.create-3.1.1.tgz#d7f2849f0dbda7e04682bb8cd72ab022461debe7" + dependencies: + lodash._baseassign "^3.0.0" + lodash._basecreate "^3.0.0" + lodash._isiterateecall "^3.0.0" + +lodash.isarguments@^3.0.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/lodash.isarguments/-/lodash.isarguments-3.1.0.tgz#2f573d85c6a24289ff00663b491c1d338ff3458a" + +lodash.isarray@^3.0.0: + version "3.0.4" + resolved "https://registry.yarnpkg.com/lodash.isarray/-/lodash.isarray-3.0.4.tgz#79e4eb88c36a8122af86f844aa9bcd851b5fbb55" + +lodash.keys@^3.0.0: + version "3.1.2" + resolved "https://registry.yarnpkg.com/lodash.keys/-/lodash.keys-3.1.2.tgz#4dbc0472b156be50a0b286855d1bd0b0c656098a" + dependencies: + lodash._getnative "^3.0.0" + lodash.isarguments "^3.0.0" + lodash.isarray "^3.0.0" + +lodash@^4.17.4: + version "4.17.19" + resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.19.tgz#e48ddedbe30b3321783c5b4301fbd353bc1e4a4b" + +longest@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/longest/-/longest-1.0.1.tgz#30a0b2da38f73770e8294a0d22e6625ed77d0097" + +loose-envify@^1.0.0: + version "1.3.1" + resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.3.1.tgz#d1a8ad33fa9ce0e713d65fdd0ac8b748d478c848" + dependencies: + js-tokens "^3.0.0" + +micromatch@^2.1.5: + version "2.3.11" + resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-2.3.11.tgz#86677c97d1720b363431d04d0d15293bd38c1565" + dependencies: + arr-diff "^2.0.0" + array-unique "^0.2.1" + braces "^1.8.2" + expand-brackets "^0.1.4" + extglob "^0.3.1" + filename-regex "^2.0.0" + is-extglob "^1.0.0" + is-glob "^2.0.1" + kind-of "^3.0.2" + normalize-path "^2.0.1" + object.omit "^2.0.0" + parse-glob "^3.0.4" + regex-cache "^0.4.2" + +mime-db@~1.33.0: + version "1.33.0" + resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.33.0.tgz#a3492050a5cb9b63450541e39d9788d2272783db" + +mime-types@^2.1.12, mime-types@~2.1.7: + version "2.1.18" + resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.18.tgz#6f323f60a83d11146f831ff11fd66e2fe5503bb8" + dependencies: + mime-db "~1.33.0" + +minimatch@^3.0.0, minimatch@^3.0.2, minimatch@^3.0.4: + version "3.0.4" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" + dependencies: + brace-expansion "^1.1.7" + +minimist@0.0.8: + version "0.0.8" + resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d" + +minimist@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.0.tgz#a35008b20f41383eec1fb914f4cd5df79a264284" + +mkdirp@0.5.1, "mkdirp@>=0.5 0", mkdirp@^0.5.1: + version "0.5.1" + resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.1.tgz#30057438eac6cf7f8c4767f38648d6697d75c903" + dependencies: + minimist "0.0.8" + +mocha-qunit-ui@^0.1.3: + version "0.1.3" + resolved "https://registry.yarnpkg.com/mocha-qunit-ui/-/mocha-qunit-ui-0.1.3.tgz#e3e1ff1dac33222b10cef681efd7f82664141ea9" + +mocha@^3.2.0: + version "3.5.3" + resolved "https://registry.yarnpkg.com/mocha/-/mocha-3.5.3.tgz#1e0480fe36d2da5858d1eb6acc38418b26eaa20d" + dependencies: + browser-stdout "1.3.0" + commander "2.9.0" + debug "2.6.8" + diff "3.2.0" + escape-string-regexp "1.0.5" + glob "7.1.1" + growl "1.9.2" + he "1.1.1" + json3 "3.3.2" + lodash.create "3.1.1" + mkdirp "0.5.1" + supports-color "3.1.2" + +ms@2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8" + +nan@^2.3.0: + version "2.10.0" + resolved "https://registry.yarnpkg.com/nan/-/nan-2.10.0.tgz#96d0cd610ebd58d4b4de9cc0c6828cda99c7548f" + +node-pre-gyp@^0.6.39: + version "0.6.39" + resolved "https://registry.yarnpkg.com/node-pre-gyp/-/node-pre-gyp-0.6.39.tgz#c00e96860b23c0e1420ac7befc5044e1d78d8649" + dependencies: + detect-libc "^1.0.2" + hawk "3.1.3" + mkdirp "^0.5.1" + nopt "^4.0.1" + npmlog "^4.0.2" + rc "^1.1.7" + request "2.81.0" + rimraf "^2.6.1" + semver "^5.3.0" + tar "^2.2.1" + tar-pack "^3.4.0" + +nopt@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/nopt/-/nopt-4.0.1.tgz#d0d4685afd5415193c8c7505602d0d17cd64474d" + dependencies: + abbrev "1" + osenv "^0.1.4" + +normalize-path@^2.0.0, normalize-path@^2.0.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-2.1.1.tgz#1ab28b556e198363a8c1a6f7e6fa20137fe6aed9" + dependencies: + remove-trailing-separator "^1.0.1" + +npmlog@^4.0.2: + version "4.1.2" + resolved "https://registry.yarnpkg.com/npmlog/-/npmlog-4.1.2.tgz#08a7f2a8bf734604779a9efa4ad5cc717abb954b" + dependencies: + are-we-there-yet "~1.1.2" + console-control-strings "~1.1.0" + gauge "~2.7.3" + set-blocking "~2.0.0" + +number-is-nan@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/number-is-nan/-/number-is-nan-1.0.1.tgz#097b602b53422a522c1afb8790318336941a011d" + +oauth-sign@~0.8.1: + version "0.8.2" + resolved "https://registry.yarnpkg.com/oauth-sign/-/oauth-sign-0.8.2.tgz#46a6ab7f0aead8deae9ec0565780b7d4efeb9d43" + +object-assign@^4.1.0: + version "4.1.1" + resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" + +object.omit@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/object.omit/-/object.omit-2.0.1.tgz#1a9c744829f39dbb858c76ca3579ae2a54ebd1fa" + dependencies: + for-own "^0.1.4" + is-extendable "^0.1.1" + +once@^1.3.0, once@^1.3.3: + version "1.4.0" + resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" + dependencies: + wrappy "1" + +os-homedir@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/os-homedir/-/os-homedir-1.0.2.tgz#ffbc4988336e0e833de0c168c7ef152121aa7fb3" + +os-tmpdir@^1.0.0, os-tmpdir@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274" + +osenv@^0.1.4: + version "0.1.5" + resolved "https://registry.yarnpkg.com/osenv/-/osenv-0.1.5.tgz#85cdfafaeb28e8677f416e287592b5f3f49ea410" + dependencies: + os-homedir "^1.0.0" + os-tmpdir "^1.0.0" + +output-file-sync@^1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/output-file-sync/-/output-file-sync-1.1.2.tgz#d0a33eefe61a205facb90092e826598d5245ce76" + dependencies: + graceful-fs "^4.1.4" + mkdirp "^0.5.1" + object-assign "^4.1.0" + +parse-glob@^3.0.4: + version "3.0.4" + resolved "https://registry.yarnpkg.com/parse-glob/-/parse-glob-3.0.4.tgz#b2c376cfb11f35513badd173ef0bb6e3a388391c" + dependencies: + glob-base "^0.3.0" + is-dotfile "^1.0.0" + is-extglob "^1.0.0" + is-glob "^2.0.0" + +path-is-absolute@^1.0.0, path-is-absolute@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" + +path-parse@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.5.tgz#3c1adf871ea9cd6c9431b6ea2bd74a0ff055c4c1" + +performance-now@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/performance-now/-/performance-now-0.2.0.tgz#33ef30c5c77d4ea21c5a53869d91b56d8f2555e5" + +preserve@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/preserve/-/preserve-0.2.0.tgz#815ed1f6ebc65926f865b310c0713bcb3315ce4b" + +private@^0.1.6, private@^0.1.7: + version "0.1.8" + resolved "https://registry.yarnpkg.com/private/-/private-0.1.8.tgz#2381edb3689f7a53d653190060fcf822d2f368ff" + +process-nextick-args@~2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-2.0.0.tgz#a37d732f4271b4ab1ad070d35508e8290788ffaa" + +punycode@^1.4.1: + version "1.4.1" + resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.4.1.tgz#c0d5a63b2718800ad8e1eb0fa5269c84dd41845e" + +punycode@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.0.tgz#5f863edc89b96db09074bad7947bf09056ca4e7d" + +qs@~6.4.0: + version "6.4.0" + resolved "https://registry.yarnpkg.com/qs/-/qs-6.4.0.tgz#13e26d28ad6b0ffaa91312cd3bf708ed351e7233" + +randomatic@^1.1.3: + version "1.1.7" + resolved "https://registry.yarnpkg.com/randomatic/-/randomatic-1.1.7.tgz#c7abe9cc8b87c0baa876b19fde83fd464797e38c" + dependencies: + is-number "^3.0.0" + kind-of "^4.0.0" + +rc@^1.1.7: + version "1.2.6" + resolved "https://registry.yarnpkg.com/rc/-/rc-1.2.6.tgz#eb18989c6d4f4f162c399f79ddd29f3835568092" + dependencies: + deep-extend "~0.4.0" + ini "~1.3.0" + minimist "^1.2.0" + strip-json-comments "~2.0.1" + +readable-stream@^2.0.2, readable-stream@^2.0.6, readable-stream@^2.1.4: + version "2.3.5" + resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.5.tgz#b4f85003a938cbb6ecbce2a124fb1012bd1a838d" + dependencies: + core-util-is "~1.0.0" + inherits "~2.0.3" + isarray "~1.0.0" + process-nextick-args "~2.0.0" + safe-buffer "~5.1.1" + string_decoder "~1.0.3" + util-deprecate "~1.0.1" + +readdirp@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-2.1.0.tgz#4ed0ad060df3073300c48440373f72d1cc642d78" + dependencies: + graceful-fs "^4.1.2" + minimatch "^3.0.2" + readable-stream "^2.0.2" + set-immediate-shim "^1.0.1" + +regenerate@^1.2.1: + version "1.3.3" + resolved "https://registry.yarnpkg.com/regenerate/-/regenerate-1.3.3.tgz#0c336d3980553d755c39b586ae3b20aa49c82b7f" + +regenerator-runtime@^0.10.5: + version "0.10.5" + resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.10.5.tgz#336c3efc1220adcedda2c9fab67b5a7955a33658" + +regenerator-runtime@^0.11.0: + version "0.11.1" + resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz#be05ad7f9bf7d22e056f9726cee5017fbf19e2e9" + +regenerator-transform@^0.10.0: + version "0.10.1" + resolved "https://registry.yarnpkg.com/regenerator-transform/-/regenerator-transform-0.10.1.tgz#1e4996837231da8b7f3cf4114d71b5691a0680dd" + dependencies: + babel-runtime "^6.18.0" + babel-types "^6.19.0" + private "^0.1.6" + +regex-cache@^0.4.2: + version "0.4.4" + resolved "https://registry.yarnpkg.com/regex-cache/-/regex-cache-0.4.4.tgz#75bdc58a2a1496cec48a12835bc54c8d562336dd" + dependencies: + is-equal-shallow "^0.1.3" + +regexpu-core@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/regexpu-core/-/regexpu-core-2.0.0.tgz#49d038837b8dcf8bfa5b9a42139938e6ea2ae240" + dependencies: + regenerate "^1.2.1" + regjsgen "^0.2.0" + regjsparser "^0.1.4" + +regjsgen@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/regjsgen/-/regjsgen-0.2.0.tgz#6c016adeac554f75823fe37ac05b92d5a4edb1f7" + +regjsparser@^0.1.4: + version "0.1.5" + resolved "https://registry.yarnpkg.com/regjsparser/-/regjsparser-0.1.5.tgz#7ee8f84dc6fa792d3fd0ae228d24bd949ead205c" + dependencies: + jsesc "~0.5.0" + +remove-trailing-separator@^1.0.1: + version "1.1.0" + resolved "https://registry.yarnpkg.com/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz#c24bce2a283adad5bc3f58e0d48249b92379d8ef" + +repeat-element@^1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/repeat-element/-/repeat-element-1.1.2.tgz#ef089a178d1483baae4d93eb98b4f9e4e11d990a" + +repeat-string@^1.5.2: + version "1.6.1" + resolved "https://registry.yarnpkg.com/repeat-string/-/repeat-string-1.6.1.tgz#8dcae470e1c88abc2d600fff4a776286da75e637" + +repeating@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/repeating/-/repeating-2.0.1.tgz#5214c53a926d3552707527fbab415dbc08d06dda" + dependencies: + is-finite "^1.0.0" + +request@2.81.0: + version "2.81.0" + resolved "https://registry.yarnpkg.com/request/-/request-2.81.0.tgz#c6928946a0e06c5f8d6f8a9333469ffda46298a0" + dependencies: + aws-sign2 "~0.6.0" + aws4 "^1.2.1" + caseless "~0.12.0" + combined-stream "~1.0.5" + extend "~3.0.0" + forever-agent "~0.6.1" + form-data "~2.1.1" + har-validator "~4.2.1" + hawk "~3.1.3" + http-signature "~1.1.0" + is-typedarray "~1.0.0" + isstream "~0.1.2" + json-stringify-safe "~5.0.1" + mime-types "~2.1.7" + oauth-sign "~0.8.1" + performance-now "^0.2.0" + qs "~6.4.0" + safe-buffer "^5.0.1" + stringstream "~0.0.4" + tough-cookie "~2.3.0" + tunnel-agent "^0.6.0" + uuid "^3.0.0" + +resolve@1.1.7: + version "1.1.7" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.1.7.tgz#203114d82ad2c5ed9e8e0411b3932875e889e97b" + +resolve@^1.1.6: + version "1.6.0" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.6.0.tgz#0fbd21278b27b4004481c395349e7aba60a9ff5c" + dependencies: + path-parse "^1.0.5" + +right-align@^0.1.1: + version "0.1.3" + resolved "https://registry.yarnpkg.com/right-align/-/right-align-0.1.3.tgz#61339b722fe6a3515689210d24e14c96148613ef" + dependencies: + align-text "^0.1.1" + +rimraf@2: + version "2.7.1" + resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.7.1.tgz#35797f13a7fdadc566142c29d4f07ccad483e3ec" + dependencies: + glob "^7.1.3" + +rimraf@^2.5.1, rimraf@^2.5.2, rimraf@^2.6.1: + version "2.7.1" + resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.7.1.tgz#35797f13a7fdadc566142c29d4f07ccad483e3ec" + dependencies: + glob "^7.1.3" + +rollup-plugin-babel@^2.7.1: + version "2.7.1" + resolved "https://registry.yarnpkg.com/rollup-plugin-babel/-/rollup-plugin-babel-2.7.1.tgz#16528197b0f938a1536f44683c7a93d573182f57" + dependencies: + babel-core "6" + babel-plugin-transform-es2015-classes "^6.9.0" + object-assign "^4.1.0" + rollup-pluginutils "^1.5.0" + +rollup-plugin-node-resolve@^2.0.0: + version "2.1.1" + resolved "https://registry.yarnpkg.com/rollup-plugin-node-resolve/-/rollup-plugin-node-resolve-2.1.1.tgz#cbb783b0d15b02794d58915350b2f0d902b8ddc8" + dependencies: + browser-resolve "^1.11.0" + builtin-modules "^1.1.0" + resolve "^1.1.6" + +rollup-pluginutils@^1.5.0: + version "1.5.2" + resolved "https://registry.yarnpkg.com/rollup-pluginutils/-/rollup-pluginutils-1.5.2.tgz#1e156e778f94b7255bfa1b3d0178be8f5c552408" + dependencies: + estree-walker "^0.2.1" + minimatch "^3.0.2" + +rollup@^0.41.6: + version "0.41.6" + resolved "https://registry.yarnpkg.com/rollup/-/rollup-0.41.6.tgz#e0d05497877a398c104d816d2733a718a7a94e2a" + dependencies: + source-map-support "^0.4.0" + +safe-buffer@^5.0.1, safe-buffer@~5.1.0, safe-buffer@~5.1.1: + version "5.1.1" + resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.1.tgz#893312af69b2123def71f57889001671eeb2c853" + +sander@^0.5.0: + version "0.5.1" + resolved "https://registry.yarnpkg.com/sander/-/sander-0.5.1.tgz#741e245e231f07cafb6fdf0f133adfa216a502ad" + dependencies: + es6-promise "^3.1.2" + graceful-fs "^4.1.3" + mkdirp "^0.5.1" + rimraf "^2.5.2" + +semver@^5.3.0: + version "5.5.0" + resolved "https://registry.yarnpkg.com/semver/-/semver-5.5.0.tgz#dc4bbc7a6ca9d916dee5d43516f0092b58f7b8ab" + +set-blocking@~2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/set-blocking/-/set-blocking-2.0.0.tgz#045f9782d011ae9a6803ddd382b24392b3d890f7" + +set-immediate-shim@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/set-immediate-shim/-/set-immediate-shim-1.0.1.tgz#4b2b1b27eb808a9f8dcc481a58e5e56f599f3f61" + +signal-exit@^3.0.0: + version "3.0.2" + resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.2.tgz#b5fdc08f1287ea1178628e415e25132b73646c6d" + +slash@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/slash/-/slash-1.0.0.tgz#c41f2f6c39fc16d1cd17ad4b5d896114ae470d55" + +sntp@1.x.x: + version "1.0.9" + resolved "https://registry.yarnpkg.com/sntp/-/sntp-1.0.9.tgz#6541184cc90aeea6c6e7b35e2659082443c66198" + dependencies: + hoek "2.x.x" + +sorcery@^0.10.0: + version "0.10.0" + resolved "https://registry.yarnpkg.com/sorcery/-/sorcery-0.10.0.tgz#8ae90ad7d7cb05fc59f1ab0c637845d5c15a52b7" + dependencies: + buffer-crc32 "^0.2.5" + minimist "^1.2.0" + sander "^0.5.0" + sourcemap-codec "^1.3.0" + +source-map-support@^0.4.0, source-map-support@^0.4.15: + version "0.4.18" + resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.4.18.tgz#0286a6de8be42641338594e97ccea75f0a2c585f" + dependencies: + source-map "^0.5.6" + +source-map@^0.5.6, source-map@^0.5.7, source-map@~0.5.1: + version "0.5.7" + resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.7.tgz#8a039d2d1021d22d1ea14c80d8ea468ba2ef3fcc" + +sourcemap-codec@^1.3.0: + version "1.4.1" + resolved "https://registry.yarnpkg.com/sourcemap-codec/-/sourcemap-codec-1.4.1.tgz#c8fd92d91889e902a07aee392bdd2c5863958ba2" + +sshpk@^1.7.0: + version "1.14.1" + resolved "https://registry.yarnpkg.com/sshpk/-/sshpk-1.14.1.tgz#130f5975eddad963f1d56f92b9ac6c51fa9f83eb" + dependencies: + asn1 "~0.2.3" + assert-plus "^1.0.0" + dashdash "^1.12.0" + getpass "^0.1.1" + optionalDependencies: + bcrypt-pbkdf "^1.0.0" + ecc-jsbn "~0.1.1" + jsbn "~0.1.0" + tweetnacl "~0.14.0" + +string-width@^1.0.1, string-width@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-1.0.2.tgz#118bdf5b8cdc51a2a7e70d211e07e2b0b9b107d3" + dependencies: + code-point-at "^1.0.0" + is-fullwidth-code-point "^1.0.0" + strip-ansi "^3.0.0" + +string_decoder@~1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.0.3.tgz#0fc67d7c141825de94282dd536bec6b9bce860ab" + dependencies: + safe-buffer "~5.1.0" + +stringstream@~0.0.4: + version "0.0.6" + resolved "https://registry.yarnpkg.com/stringstream/-/stringstream-0.0.6.tgz#7880225b0d4ad10e30927d167a1d6f2fd3b33a72" + +strip-ansi@^3.0.0, strip-ansi@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-3.0.1.tgz#6a385fb8853d952d5ff05d0e8aaf94278dc63dcf" + dependencies: + ansi-regex "^2.0.0" + +strip-json-comments@~2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a" + +supports-color@3.1.2: + version "3.1.2" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-3.1.2.tgz#72a262894d9d408b956ca05ff37b2ed8a6e2a2d5" + dependencies: + has-flag "^1.0.0" + +supports-color@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-2.0.0.tgz#535d045ce6b6363fa40117084629995e9df324c7" + +tar-pack@^3.4.0: + version "3.4.1" + resolved "https://registry.yarnpkg.com/tar-pack/-/tar-pack-3.4.1.tgz#e1dbc03a9b9d3ba07e896ad027317eb679a10a1f" + dependencies: + debug "^2.2.0" + fstream "^1.0.10" + fstream-ignore "^1.0.5" + once "^1.3.3" + readable-stream "^2.1.4" + rimraf "^2.5.1" + tar "^2.2.1" + uid-number "^0.0.6" + +tar@^2.2.1: + version "2.2.2" + resolved "https://registry.yarnpkg.com/tar/-/tar-2.2.2.tgz#0ca8848562c7299b8b446ff6a4d60cdbb23edc40" + dependencies: + block-stream "*" + fstream "^1.0.12" + inherits "2" + +to-fast-properties@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/to-fast-properties/-/to-fast-properties-1.0.3.tgz#b83571fa4d8c25b82e231b06e3a3055de4ca1a47" + +tough-cookie@~2.3.0: + version "2.3.4" + resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-2.3.4.tgz#ec60cee38ac675063ffc97a5c18970578ee83655" + dependencies: + punycode "^1.4.1" + +trim-right@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/trim-right/-/trim-right-1.0.1.tgz#cb2e1203067e0c8de1f614094b9fe45704ea6003" + +tunnel-agent@^0.6.0: + version "0.6.0" + resolved "https://registry.yarnpkg.com/tunnel-agent/-/tunnel-agent-0.6.0.tgz#27a5dea06b36b04a0a9966774b290868f0fc40fd" + dependencies: + safe-buffer "^5.0.1" + +tweetnacl@^0.14.3, tweetnacl@~0.14.0: + version "0.14.5" + resolved "https://registry.yarnpkg.com/tweetnacl/-/tweetnacl-0.14.5.tgz#5ae68177f192d4456269d108afa93ff8743f4f64" + +typescript@^2.8.1: + version "2.8.1" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-2.8.1.tgz#6160e4f8f195d5ba81d4876f9c0cc1fbc0820624" + +uglify-js@^2.8.14: + version "2.8.29" + resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-2.8.29.tgz#29c5733148057bb4e1f75df35b7a9cb72e6a59dd" + dependencies: + source-map "~0.5.1" + yargs "~3.10.0" + optionalDependencies: + uglify-to-browserify "~1.0.0" + +uglify-to-browserify@~1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/uglify-to-browserify/-/uglify-to-browserify-1.0.2.tgz#6e0924d6bda6b5afe349e39a6d632850a0f882b7" + +uid-number@^0.0.6: + version "0.0.6" + resolved "https://registry.yarnpkg.com/uid-number/-/uid-number-0.0.6.tgz#0ea10e8035e8eb5b8e4449f06da1c730663baa81" + +user-home@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/user-home/-/user-home-1.1.1.tgz#2b5be23a32b63a7c9deb8d0f28d485724a3df190" + +util-deprecate@~1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" + +uuid@^3.0.0: + version "3.2.1" + resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.2.1.tgz#12c528bb9d58d0b9265d9a2f6f0fe8be17ff1f14" + +v8flags@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/v8flags/-/v8flags-2.1.1.tgz#aab1a1fa30d45f88dd321148875ac02c0b55e5b4" + dependencies: + user-home "^1.1.1" + +verror@1.10.0: + version "1.10.0" + resolved "https://registry.yarnpkg.com/verror/-/verror-1.10.0.tgz#3a105ca17053af55d6e270c1f8288682e18da400" + dependencies: + assert-plus "^1.0.0" + core-util-is "1.0.2" + extsprintf "^1.2.0" + +wide-align@^1.1.0: + version "1.1.2" + resolved "https://registry.yarnpkg.com/wide-align/-/wide-align-1.1.2.tgz#571e0f1b0604636ebc0dfc21b0339bbe31341710" + dependencies: + string-width "^1.0.2" + +window-size@0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/window-size/-/window-size-0.1.0.tgz#5438cd2ea93b202efa3a19fe8887aee7c94f9c9d" + +wordwrap@0.0.2: + version "0.0.2" + resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-0.0.2.tgz#b79669bb42ecb409f83d583cad52ca17eaa1643f" + +wrappy@1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" + +yargs@~3.10.0: + version "3.10.0" + resolved "https://registry.yarnpkg.com/yargs/-/yargs-3.10.0.tgz#f7ee7bd857dd7c1d2d38c0e74efbd681d1431fd1" + dependencies: + camelcase "^1.0.2" + cliui "^2.1.0" + decamelize "^1.0.0" + window-size "0.1.0" diff --git a/deps/npm/node_modules/url-parse-lax/index.js b/deps/npm/node_modules/url-parse-lax/index.js deleted file mode 100644 index f9c0c65afdbbd5..00000000000000 --- a/deps/npm/node_modules/url-parse-lax/index.js +++ /dev/null @@ -1,14 +0,0 @@ -'use strict'; -var url = require('url'); -var prependHttp = require('prepend-http'); - -module.exports = function (x) { - var withProtocol = prependHttp(x); - var parsed = url.parse(withProtocol); - - if (withProtocol !== x) { - parsed.protocol = null; - } - - return parsed; -}; diff --git a/deps/npm/node_modules/url-parse-lax/license b/deps/npm/node_modules/url-parse-lax/license deleted file mode 100644 index 654d0bfe943437..00000000000000 --- a/deps/npm/node_modules/url-parse-lax/license +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -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/deps/npm/node_modules/url-parse-lax/package.json b/deps/npm/node_modules/url-parse-lax/package.json deleted file mode 100644 index cf4a70a0b3c16a..00000000000000 --- a/deps/npm/node_modules/url-parse-lax/package.json +++ /dev/null @@ -1,73 +0,0 @@ -{ - "_from": "url-parse-lax@^1.0.0", - "_id": "url-parse-lax@1.0.0", - "_inBundle": false, - "_integrity": "sha1-evjzA2Rem9eaJy56FKxovAYJ2nM=", - "_location": "/url-parse-lax", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "url-parse-lax@^1.0.0", - "name": "url-parse-lax", - "escapedName": "url-parse-lax", - "rawSpec": "^1.0.0", - "saveSpec": null, - "fetchSpec": "^1.0.0" - }, - "_requiredBy": [ - "/got" - ], - "_resolved": "https://registry.npmjs.org/url-parse-lax/-/url-parse-lax-1.0.0.tgz", - "_shasum": "7af8f303645e9bd79a272e7a14ac68bc0609da73", - "_spec": "url-parse-lax@^1.0.0", - "_where": "/Users/rebecca/code/npm/node_modules/got", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "bugs": { - "url": "https://github.com/sindresorhus/url-parse-lax/issues" - }, - "bundleDependencies": false, - "dependencies": { - "prepend-http": "^1.0.1" - }, - "deprecated": false, - "description": "url.parse() with support for protocol-less URLs & IPs", - "devDependencies": { - "ava": "0.0.4" - }, - "engines": { - "node": ">=0.10.0" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/sindresorhus/url-parse-lax#readme", - "keywords": [ - "url", - "uri", - "parse", - "parser", - "loose", - "lax", - "protocol", - "less", - "protocol-less", - "ip", - "ipv4", - "ipv6" - ], - "license": "MIT", - "name": "url-parse-lax", - "repository": { - "type": "git", - "url": "git+https://github.com/sindresorhus/url-parse-lax.git" - }, - "scripts": { - "test": "node test.js" - }, - "version": "1.0.0" -} diff --git a/deps/npm/node_modules/url-parse-lax/readme.md b/deps/npm/node_modules/url-parse-lax/readme.md deleted file mode 100644 index f2639446e5290f..00000000000000 --- a/deps/npm/node_modules/url-parse-lax/readme.md +++ /dev/null @@ -1,100 +0,0 @@ -# url-parse-lax [![Build Status](https://travis-ci.org/sindresorhus/url-parse-lax.svg?branch=master)](https://travis-ci.org/sindresorhus/url-parse-lax) - -> [`url.parse()`](https://nodejs.org/docs/latest/api/url.html#url_url_parse_urlstr_parsequerystring_slashesdenotehost) with support for protocol-less URLs & IPs - - -## Install - -``` -$ npm install --save url-parse-lax -``` - - -## Usage - -```js -var urlParseLax = require('url-parse-lax'); - -urlParseLax('sindresorhus.com'); -/* -{ - protocol: null, - slashes: true, - auth: null, - host: 'sindresorhus.com', - port: null, - hostname: 'sindresorhus.com', - hash: null, - search: null, - query: null, - pathname: '/', - path: '/', - href: 'http://sindresorhus.com/' -} -*/ - -urlParseLax('[2001:db8::]:8000'); -/* -{ - protocol: null, - slashes: true, - auth: null, - host: '[2001:db8::]:8000', - port: '8000', - hostname: '2001:db8::', - hash: null, - search: null, - query: null, - pathname: '/', - path: '/', - href: 'http://[2001:db8::]:8000/' -} -*/ -``` - -And with the built-in `url.parse()`: - -```js -var url = require('url'); - -url.parse('sindresorhus.com'); -/* -{ - protocol: null, - slashes: null, - auth: null, - host: null, - port: null, - hostname: null, - hash: null, - search: null, - query: null, - pathname: 'sindresorhus', - path: 'sindresorhus', - href: 'sindresorhus' -} -*/ - -url.parse('[2001:db8::]:8000'); -/* -{ - protocol: null, - slashes: null, - auth: null, - host: null, - port: null, - hostname: null, - hash: null, - search: null, - query: null, - pathname: '[2001:db8::]:8000', - path: '[2001:db8::]:8000', - href: '[2001:db8::]:8000' -} -*/ -``` - - -## License - -MIT © [Sindre Sorhus](http://sindresorhus.com) diff --git a/deps/npm/node_modules/util-deprecate/package.json b/deps/npm/node_modules/util-deprecate/package.json index 58a6abf9fdb2ab..2e79f89a90f583 100644 --- a/deps/npm/node_modules/util-deprecate/package.json +++ b/deps/npm/node_modules/util-deprecate/package.json @@ -1,40 +1,16 @@ { - "_from": "util-deprecate@~1.0.1", - "_id": "util-deprecate@1.0.2", - "_inBundle": false, - "_integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", - "_location": "/util-deprecate", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "util-deprecate@~1.0.1", - "name": "util-deprecate", - "escapedName": "util-deprecate", - "rawSpec": "~1.0.1", - "saveSpec": null, - "fetchSpec": "~1.0.1" - }, - "_requiredBy": [ - "/readable-stream" - ], - "_resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", - "_shasum": "450d4dc9fa70de732762fbd2d4a28981419a0ccf", - "_spec": "util-deprecate@~1.0.1", - "_where": "/Users/rebecca/code/npm/node_modules/readable-stream", - "author": { - "name": "Nathan Rajlich", - "email": "nathan@tootallnate.net", - "url": "http://n8.io/" - }, + "name": "util-deprecate", + "version": "1.0.2", + "description": "The Node.js `util.deprecate()` function with browser support", + "main": "node.js", "browser": "browser.js", - "bugs": { - "url": "https://github.com/TooTallNate/util-deprecate/issues" + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "repository": { + "type": "git", + "url": "git://github.com/TooTallNate/util-deprecate.git" }, - "bundleDependencies": false, - "deprecated": false, - "description": "The Node.js `util.deprecate()` function with browser support", - "homepage": "https://github.com/TooTallNate/util-deprecate", "keywords": [ "util", "deprecate", @@ -42,15 +18,10 @@ "browser", "node" ], + "author": "Nathan Rajlich (http://n8.io/)", "license": "MIT", - "main": "node.js", - "name": "util-deprecate", - "repository": { - "type": "git", - "url": "git://github.com/TooTallNate/util-deprecate.git" - }, - "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" + "bugs": { + "url": "https://github.com/TooTallNate/util-deprecate/issues" }, - "version": "1.0.2" + "homepage": "https://github.com/TooTallNate/util-deprecate" } diff --git a/deps/npm/node_modules/util-extend/LICENSE b/deps/npm/node_modules/util-extend/LICENSE deleted file mode 100644 index e3d4e695a4cff2..00000000000000 --- a/deps/npm/node_modules/util-extend/LICENSE +++ /dev/null @@ -1,18 +0,0 @@ -Copyright Joyent, Inc. and other Node contributors. All rights reserved. -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to -deal in the Software without restriction, including without limitation the -rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -sell copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -IN THE SOFTWARE. diff --git a/deps/npm/node_modules/util-extend/README.md b/deps/npm/node_modules/util-extend/README.md deleted file mode 100644 index be03922ab02613..00000000000000 --- a/deps/npm/node_modules/util-extend/README.md +++ /dev/null @@ -1,13 +0,0 @@ -# util-extend - -The Node object extending function that Node uses for Node! - -## Usage - -```js -var extend = require('util-extend'); -function functionThatTakesOptions(options) { - var options = extend(defaults, options); - // now any unset options are set to the defaults. -} -``` diff --git a/deps/npm/node_modules/util-extend/extend.js b/deps/npm/node_modules/util-extend/extend.js deleted file mode 100644 index de9fcf471abd92..00000000000000 --- a/deps/npm/node_modules/util-extend/extend.js +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - -module.exports = extend; -function extend(origin, add) { - // Don't do anything if add isn't an object - if (!add || typeof add !== 'object') return origin; - - var keys = Object.keys(add); - var i = keys.length; - while (i--) { - origin[keys[i]] = add[keys[i]]; - } - return origin; -} diff --git a/deps/npm/node_modules/util-extend/package.json b/deps/npm/node_modules/util-extend/package.json deleted file mode 100644 index fa05e6bb1286bc..00000000000000 --- a/deps/npm/node_modules/util-extend/package.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "_from": "util-extend@^1.0.1", - "_id": "util-extend@1.0.3", - "_inBundle": false, - "_integrity": "sha1-p8IW0mdUUWljeztu3GypEZ4v+T8=", - "_location": "/util-extend", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "util-extend@^1.0.1", - "name": "util-extend", - "escapedName": "util-extend", - "rawSpec": "^1.0.1", - "saveSpec": null, - "fetchSpec": "^1.0.1" - }, - "_requiredBy": [ - "/npm-registry-mock", - "/read-installed" - ], - "_resolved": "https://registry.npmjs.org/util-extend/-/util-extend-1.0.3.tgz", - "_shasum": "a7c216d267545169637b3b6edc6ca9119e2ff93f", - "_spec": "util-extend@^1.0.1", - "_where": "/Users/rebecca/code/npm/node_modules/read-installed", - "author": "", - "bugs": { - "url": "https://github.com/isaacs/util-extend/issues" - }, - "bundleDependencies": false, - "deprecated": false, - "description": "Node's internal object extension function", - "homepage": "https://github.com/isaacs/util-extend#readme", - "license": "MIT", - "main": "extend.js", - "name": "util-extend", - "repository": { - "type": "git", - "url": "git://github.com/isaacs/util-extend.git" - }, - "scripts": { - "test": "node test.js" - }, - "version": "1.0.3" -} diff --git a/deps/npm/node_modules/util-extend/test.js b/deps/npm/node_modules/util-extend/test.js deleted file mode 100644 index fbee2b1e1bd74e..00000000000000 --- a/deps/npm/node_modules/util-extend/test.js +++ /dev/null @@ -1,10 +0,0 @@ -var assert = require('assert'); -var extend = require('./'); -assert.deepEqual(extend({a:1}), {a:1}); -assert.deepEqual(extend({a:1}, []), {a:1}); -assert.deepEqual(extend({a:1}, null), {a:1}); -assert.deepEqual(extend({a:1}, true), {a:1}); -assert.deepEqual(extend({a:1}, false), {a:1}); -assert.deepEqual(extend({a:1}, {b:2}), {a:1, b:2}); -assert.deepEqual(extend({a:1, b:2}, {b:3}), {a:1, b:3}); -console.log('ok'); diff --git a/deps/npm/node_modules/util-promisify/.npmignore b/deps/npm/node_modules/util-promisify/.npmignore deleted file mode 100644 index 3c3629e647f5dd..00000000000000 --- a/deps/npm/node_modules/util-promisify/.npmignore +++ /dev/null @@ -1 +0,0 @@ -node_modules diff --git a/deps/npm/node_modules/util-promisify/.travis.yml b/deps/npm/node_modules/util-promisify/.travis.yml deleted file mode 100644 index 58e15d6302e26e..00000000000000 --- a/deps/npm/node_modules/util-promisify/.travis.yml +++ /dev/null @@ -1,8 +0,0 @@ -sudo: false -language: node_js -node_js: - - 4 - - 5 - - 6 - - 7 - - 8 diff --git a/deps/npm/node_modules/util-promisify/LICENSE b/deps/npm/node_modules/util-promisify/LICENSE deleted file mode 100644 index d17113b221c0c3..00000000000000 --- a/deps/npm/node_modules/util-promisify/LICENSE +++ /dev/null @@ -1,1072 +0,0 @@ -Node.js is licensed for use as follows: - -""" -Copyright Node.js contributors. All rights reserved. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to -deal in the Software without restriction, including without limitation the -rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -sell copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -IN THE SOFTWARE. -""" - -This license applies to parts of Node.js originating from the -https://github.com/joyent/node repository: - -""" -Copyright Joyent, Inc. and other Node contributors. All rights reserved. -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to -deal in the Software without restriction, including without limitation the -rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -sell copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -IN THE SOFTWARE. -""" - -The Node.js license applies to all parts of Node.js that are not externally -maintained libraries. - -The externally maintained libraries used by Node.js are: - -- c-ares, located at deps/cares, is licensed as follows: - """ - Copyright 1998 by the Massachusetts Institute of Technology. - Copyright (C) 2007-2013 by Daniel Stenberg - - Permission to use, copy, modify, and distribute this - software and its documentation for any purpose and without - fee is hereby granted, provided that the above copyright - notice appear in all copies and that both that copyright - notice and this permission notice appear in supporting - documentation, and that the name of M.I.T. not be used in - advertising or publicity pertaining to distribution of the - software without specific, written prior permission. - M.I.T. makes no representations about the suitability of - this software for any purpose. It is provided "as is" - without express or implied warranty. - """ - -- HTTP Parser, located at deps/http_parser, is licensed as follows: - """ - http_parser.c is based on src/http/ngx_http_parse.c from NGINX copyright - Igor Sysoev. - - Additional changes are licensed under the same terms as NGINX and - copyright Joyent, Inc. and other Node contributors. All rights reserved. - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to - deal in the Software without restriction, including without limitation the - rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - sell copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS - IN THE SOFTWARE. - """ - -- ICU, located at deps/icu-small, is licensed as follows: - """ - COPYRIGHT AND PERMISSION NOTICE (ICU 58 and later) - - Copyright © 1991-2016 Unicode, Inc. All rights reserved. - Distributed under the Terms of Use in http://www.unicode.org/copyright.html - - Permission is hereby granted, free of charge, to any person obtaining - a copy of the Unicode data files and any associated documentation - (the "Data Files") or Unicode software and any associated documentation - (the "Software") to deal in the Data Files or Software - without restriction, including without limitation the rights to use, - copy, modify, merge, publish, distribute, and/or sell copies of - the Data Files or Software, and to permit persons to whom the Data Files - or Software are furnished to do so, provided that either - (a) this copyright and permission notice appear with all copies - of the Data Files or Software, or - (b) this copyright and permission notice appear in associated - Documentation. - - THE DATA FILES AND SOFTWARE ARE 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 OF THIRD PARTY RIGHTS. - IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS - NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL 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 THE DATA FILES OR SOFTWARE. - - Except as contained in this notice, the name of a copyright holder - shall not be used in advertising or otherwise to promote the sale, - use or other dealings in these Data Files or Software without prior - written authorization of the copyright holder. - - --------------------- - - Third-Party Software Licenses - - This section contains third-party software notices and/or additional - terms for licensed third-party software components included within ICU - libraries. - - 1. ICU License - ICU 1.8.1 to ICU 57.1 - - COPYRIGHT AND PERMISSION NOTICE - - Copyright (c) 1995-2016 International Business Machines Corporation and others - All rights reserved. - - Permission is hereby granted, free of charge, to any person obtaining - a copy of this software and associated documentation files (the - "Software"), to deal in the Software without restriction, including - without limitation the rights to use, copy, modify, merge, publish, - distribute, and/or sell copies of the Software, and to permit persons - to whom the Software is furnished to do so, provided that the above - copyright notice(s) and this permission notice appear in all copies of - the Software and that both the above copyright notice(s) and this - permission notice appear in supporting documentation. - - 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 - OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR - HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY - SPECIAL 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. - - Except as contained in this notice, the name of a copyright holder - shall not be used in advertising or otherwise to promote the sale, use - or other dealings in this Software without prior written authorization - of the copyright holder. - - All trademarks and registered trademarks mentioned herein are the - property of their respective owners. - - 2. Chinese/Japanese Word Break Dictionary Data (cjdict.txt) - - # The Google Chrome software developed by Google is licensed under - # the BSD license. Other software included in this distribution is - # provided under other licenses, as set forth below. - # - # The BSD License - # http://opensource.org/licenses/bsd-license.php - # Copyright (C) 2006-2008, Google Inc. - # - # All rights reserved. - # - # Redistribution and use in source and binary forms, with or without - # modification, are permitted provided that the following conditions are met: - # - # Redistributions of source code must retain the above copyright notice, - # this list of conditions and the following disclaimer. - # Redistributions in binary form must reproduce the above - # copyright notice, this list of conditions and the following - # disclaimer in the documentation and/or other materials provided with - # the distribution. - # Neither the name of Google Inc. nor the names of its - # contributors may be used to endorse or promote products derived from - # this software without specific prior written permission. - # - # - # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND - # CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, - # INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - # DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE - # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - # BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - # NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - # - # - # The word list in cjdict.txt are generated by combining three word lists - # listed below with further processing for compound word breaking. The - # frequency is generated with an iterative training against Google web - # corpora. - # - # * Libtabe (Chinese) - # - https://sourceforge.net/project/?group_id=1519 - # - Its license terms and conditions are shown below. - # - # * IPADIC (Japanese) - # - http://chasen.aist-nara.ac.jp/chasen/distribution.html - # - Its license terms and conditions are shown below. - # - # ---------COPYING.libtabe ---- BEGIN-------------------- - # - # /* - # * Copyrighy (c) 1999 TaBE Project. - # * Copyright (c) 1999 Pai-Hsiang Hsiao. - # * All rights reserved. - # * - # * Redistribution and use in source and binary forms, with or without - # * modification, are permitted provided that the following conditions - # * are met: - # * - # * . Redistributions of source code must retain the above copyright - # * notice, this list of conditions and the following disclaimer. - # * . Redistributions in binary form must reproduce the above copyright - # * notice, this list of conditions and the following disclaimer in - # * the documentation and/or other materials provided with the - # * distribution. - # * . Neither the name of the TaBE Project nor the names of its - # * contributors may be used to endorse or promote products derived - # * from this software without specific prior written permission. - # * - # * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - # * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - # * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - # * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - # * REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, - # * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - # * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - # * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - # * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - # * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - # * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - # * OF THE POSSIBILITY OF SUCH DAMAGE. - # */ - # - # /* - # * Copyright (c) 1999 Computer Systems and Communication Lab, - # * Institute of Information Science, Academia - # * Sinica. All rights reserved. - # * - # * Redistribution and use in source and binary forms, with or without - # * modification, are permitted provided that the following conditions - # * are met: - # * - # * . Redistributions of source code must retain the above copyright - # * notice, this list of conditions and the following disclaimer. - # * . Redistributions in binary form must reproduce the above copyright - # * notice, this list of conditions and the following disclaimer in - # * the documentation and/or other materials provided with the - # * distribution. - # * . Neither the name of the Computer Systems and Communication Lab - # * nor the names of its contributors may be used to endorse or - # * promote products derived from this software without specific - # * prior written permission. - # * - # * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - # * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - # * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - # * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - # * REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, - # * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - # * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - # * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - # * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - # * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - # * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - # * OF THE POSSIBILITY OF SUCH DAMAGE. - # */ - # - # Copyright 1996 Chih-Hao Tsai @ Beckman Institute, - # University of Illinois - # c-tsai4@uiuc.edu http://casper.beckman.uiuc.edu/~c-tsai4 - # - # ---------------COPYING.libtabe-----END-------------------------------- - # - # - # ---------------COPYING.ipadic-----BEGIN------------------------------- - # - # Copyright 2000, 2001, 2002, 2003 Nara Institute of Science - # and Technology. All Rights Reserved. - # - # Use, reproduction, and distribution of this software is permitted. - # Any copy of this software, whether in its original form or modified, - # must include both the above copyright notice and the following - # paragraphs. - # - # Nara Institute of Science and Technology (NAIST), - # the copyright holders, disclaims all warranties with regard to this - # software, including all implied warranties of merchantability and - # fitness, in no event shall NAIST be liable for - # any special, 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 tortuous action, arising out - # of or in connection with the use or performance of this software. - # - # A large portion of the dictionary entries - # originate from ICOT Free Software. The following conditions for ICOT - # Free Software applies to the current dictionary as well. - # - # Each User may also freely distribute the Program, whether in its - # original form or modified, to any third party or parties, PROVIDED - # that the provisions of Section 3 ("NO WARRANTY") will ALWAYS appear - # on, or be attached to, the Program, which is distributed substantially - # in the same form as set out herein and that such intended - # distribution, if actually made, will neither violate or otherwise - # contravene any of the laws and regulations of the countries having - # jurisdiction over the User or the intended distribution itself. - # - # NO WARRANTY - # - # The program was produced on an experimental basis in the course of the - # research and development conducted during the project and is provided - # to users as so produced on an experimental basis. Accordingly, the - # program is provided without any warranty whatsoever, whether express, - # implied, statutory or otherwise. The term "warranty" used herein - # includes, but is not limited to, any warranty of the quality, - # performance, merchantability and fitness for a particular purpose of - # the program and the nonexistence of any infringement or violation of - # any right of any third party. - # - # Each user of the program will agree and understand, and be deemed to - # have agreed and understood, that there is no warranty whatsoever for - # the program and, accordingly, the entire risk arising from or - # otherwise connected with the program is assumed by the user. - # - # Therefore, neither ICOT, the copyright holder, or any other - # organization that participated in or was otherwise related to the - # development of the program and their respective officials, directors, - # officers and other employees shall be held liable for any and all - # damages, including, without limitation, general, special, incidental - # and consequential damages, arising out of or otherwise in connection - # with the use or inability to use the program or any product, material - # or result produced or otherwise obtained by using the program, - # regardless of whether they have been advised of, or otherwise had - # knowledge of, the possibility of such damages at any time during the - # project or thereafter. Each user will be deemed to have agreed to the - # foregoing by his or her commencement of use of the program. The term - # "use" as used herein includes, but is not limited to, the use, - # modification, copying and distribution of the program and the - # production of secondary products from the program. - # - # In the case where the program, whether in its original form or - # modified, was distributed or delivered to or received by a user from - # any person, organization or entity other than ICOT, unless it makes or - # grants independently of ICOT any specific warranty to the user in - # writing, such person, organization or entity, will also be exempted - # from and not be held liable to the user for any such damages as noted - # above as far as the program is concerned. - # - # ---------------COPYING.ipadic-----END---------------------------------- - - 3. Lao Word Break Dictionary Data (laodict.txt) - - # Copyright (c) 2013 International Business Machines Corporation - # and others. All Rights Reserved. - # - # Project: http://code.google.com/p/lao-dictionary/ - # Dictionary: http://lao-dictionary.googlecode.com/git/Lao-Dictionary.txt - # License: http://lao-dictionary.googlecode.com/git/Lao-Dictionary-LICENSE.txt - # (copied below) - # - # This file is derived from the above dictionary, with slight - # modifications. - # ---------------------------------------------------------------------- - # Copyright (C) 2013 Brian Eugene Wilson, Robert Martin Campbell. - # All rights reserved. - # - # Redistribution and use in source and binary forms, with or without - # modification, - # are permitted provided that the following conditions are met: - # - # - # Redistributions of source code must retain the above copyright notice, this - # list of conditions and the following disclaimer. Redistributions in - # binary form must reproduce the above copyright notice, this list of - # conditions and the following disclaimer in the documentation and/or - # other materials provided with the distribution. - # - # - # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - # FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - # COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - # INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - # (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - # SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - # HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - # STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - # OF THE POSSIBILITY OF SUCH DAMAGE. - # -------------------------------------------------------------------------- - - 4. Burmese Word Break Dictionary Data (burmesedict.txt) - - # Copyright (c) 2014 International Business Machines Corporation - # and others. All Rights Reserved. - # - # This list is part of a project hosted at: - # github.com/kanyawtech/myanmar-karen-word-lists - # - # -------------------------------------------------------------------------- - # Copyright (c) 2013, LeRoy Benjamin Sharon - # All rights reserved. - # - # Redistribution and use in source and binary forms, with or without - # modification, are permitted provided that the following conditions - # are met: Redistributions of source code must retain the above - # copyright notice, this list of conditions and the following - # disclaimer. Redistributions in binary form must reproduce the - # above copyright notice, this list of conditions and the following - # disclaimer in the documentation and/or other materials provided - # with the distribution. - # - # Neither the name Myanmar Karen Word Lists, nor the names of its - # contributors may be used to endorse or promote products derived - # from this software without specific prior written permission. - # - # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND - # CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, - # INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - # DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS - # BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - # EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED - # TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - # ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR - # TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF - # THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - # SUCH DAMAGE. - # -------------------------------------------------------------------------- - - 5. Time Zone Database - - ICU uses the public domain data and code derived from Time Zone - Database for its time zone support. The ownership of the TZ database - is explained in BCP 175: Procedure for Maintaining the Time Zone - Database section 7. - - # 7. Database Ownership - # - # The TZ database itself is not an IETF Contribution or an IETF - # document. Rather it is a pre-existing and regularly updated work - # that is in the public domain, and is intended to remain in the - # public domain. Therefore, BCPs 78 [RFC5378] and 79 [RFC3979] do - # not apply to the TZ Database or contributions that individuals make - # to it. Should any claims be made and substantiated against the TZ - # Database, the organization that is providing the IANA - # Considerations defined in this RFC, under the memorandum of - # understanding with the IETF, currently ICANN, may act in accordance - # with all competent court orders. No ownership claims will be made - # by ICANN or the IETF Trust on the database or the code. Any person - # making a contribution to the database or code waives all rights to - # future claims in that contribution or in the TZ Database. - """ - -- libuv, located at deps/uv, is licensed as follows: - """ - libuv is part of the Node project: http://nodejs.org/ - libuv may be distributed alone under Node's license: - - ==== - - Copyright Joyent, Inc. and other Node contributors. All rights reserved. - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to - deal in the Software without restriction, including without limitation the - rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - sell copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS - IN THE SOFTWARE. - - ==== - - This license applies to all parts of libuv that are not externally - maintained libraries. - - The externally maintained libraries used by libuv are: - - - tree.h (from FreeBSD), copyright Niels Provos. Two clause BSD license. - - - inet_pton and inet_ntop implementations, contained in src/inet.c, are - copyright the Internet Systems Consortium, Inc., and licensed under the ISC - license. - - - stdint-msvc2008.h (from msinttypes), copyright Alexander Chemeris. Three - clause BSD license. - - - pthread-fixes.h, pthread-fixes.c, copyright Google Inc. and Sony Mobile - Communications AB. Three clause BSD license. - - - android-ifaddrs.h, android-ifaddrs.c, copyright Berkeley Software Design - Inc, Kenneth MacKay and Emergya (Cloud4all, FP7/2007-2013, grant agreement - n° 289016). Three clause BSD license. - """ - -- OpenSSL, located at deps/openssl, is licensed as follows: - """ - Copyright (c) 1998-2016 The OpenSSL Project. All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - 1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - - 3. All advertising materials mentioning features or use of this - software must display the following acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit. (http://www.openssl.org/)" - - 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - endorse or promote products derived from this software without - prior written permission. For written permission, please contact - openssl-core@openssl.org. - - 5. Products derived from this software may not be called "OpenSSL" - nor may "OpenSSL" appear in their names without prior written - permission of the OpenSSL Project. - - 6. Redistributions of any form whatsoever must retain the following - acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit (http://www.openssl.org/)" - - THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY - EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR - ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - OF THE POSSIBILITY OF SUCH DAMAGE. - ==================================================================== - - This product includes cryptographic software written by Eric Young - (eay@cryptsoft.com). This product includes software written by Tim - Hudson (tjh@cryptsoft.com). - """ - -- Punycode.js, located at lib/punycode.js, is licensed as follows: - """ - Copyright Mathias Bynens - - Permission is hereby granted, free of charge, to any person obtaining - a copy of this software and associated documentation files (the - "Software"), to deal in the Software without restriction, including - without limitation the rights to use, copy, modify, merge, publish, - distribute, sublicense, and/or sell copies of the Software, and to - permit persons to whom the Software is furnished to do so, subject to - the following conditions: - - The above copyright notice and this permission notice shall be - included in all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE - LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION - OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - """ - -- V8, located at deps/v8, is licensed as follows: - """ - This license applies to all parts of V8 that are not externally - maintained libraries. The externally maintained libraries used by V8 - are: - - - PCRE test suite, located in - test/mjsunit/third_party/regexp-pcre/regexp-pcre.js. This is based on the - test suite from PCRE-7.3, which is copyrighted by the University - of Cambridge and Google, Inc. The copyright notice and license - are embedded in regexp-pcre.js. - - - Layout tests, located in test/mjsunit/third_party/object-keys. These are - based on layout tests from webkit.org which are copyrighted by - Apple Computer, Inc. and released under a 3-clause BSD license. - - - Strongtalk assembler, the basis of the files assembler-arm-inl.h, - assembler-arm.cc, assembler-arm.h, assembler-ia32-inl.h, - assembler-ia32.cc, assembler-ia32.h, assembler-x64-inl.h, - assembler-x64.cc, assembler-x64.h, assembler-mips-inl.h, - assembler-mips.cc, assembler-mips.h, assembler.cc and assembler.h. - This code is copyrighted by Sun Microsystems Inc. and released - under a 3-clause BSD license. - - - Valgrind client API header, located at third_party/valgrind/valgrind.h - This is release under the BSD license. - - These libraries have their own licenses; we recommend you read them, - as their terms may differ from the terms below. - - Further license information can be found in LICENSE files located in - sub-directories. - - Copyright 2014, the V8 project authors. All rights reserved. - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are - met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials provided - with the distribution. - * Neither the name of Google Inc. nor the names of its - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - """ - -- zlib, located at deps/zlib, is licensed as follows: - """ - zlib.h -- interface of the 'zlib' general purpose compression library - version 1.2.8, April 28th, 2013 - - Copyright (C) 1995-2013 Jean-loup Gailly and Mark Adler - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. - - Jean-loup Gailly Mark Adler - jloup@gzip.org madler@alumni.caltech.edu - """ - -- npm, located at deps/npm, is licensed as follows: - """ - The npm application - Copyright (c) npm, Inc. and Contributors - Licensed on the terms of The Artistic License 2.0 - - Node package dependencies of the npm application - Copyright (c) their respective copyright owners - Licensed on their respective license terms - - The npm public registry at https://registry.npmjs.org - and the npm website at https://www.npmjs.com - Operated by npm, Inc. - Use governed by terms published on https://www.npmjs.com - - "Node.js" - Trademark Joyent, Inc., https://joyent.com - Neither npm nor npm, Inc. are affiliated with Joyent, Inc. - - The Node.js application - Project of Node Foundation, https://nodejs.org - - The npm Logo - Copyright (c) Mathias Pettersson and Brian Hammond - - "Gubblebum Blocky" typeface - Copyright (c) Tjarda Koster, https://jelloween.deviantart.com - Used with permission - - -------- - - The Artistic License 2.0 - - Copyright (c) 2000-2006, The Perl Foundation. - - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - This license establishes the terms under which a given free software - Package may be copied, modified, distributed, and/or redistributed. - The intent is that the Copyright Holder maintains some artistic - control over the development of that Package while still keeping the - Package available as open source and free software. - - You are always permitted to make arrangements wholly outside of this - license directly with the Copyright Holder of a given Package. If the - terms of this license do not permit the full use that you propose to - make of the Package, you should contact the Copyright Holder and seek - a different licensing arrangement. - - Definitions - - "Copyright Holder" means the individual(s) or organization(s) - named in the copyright notice for the entire Package. - - "Contributor" means any party that has contributed code or other - material to the Package, in accordance with the Copyright Holder's - procedures. - - "You" and "your" means any person who would like to copy, - distribute, or modify the Package. - - "Package" means the collection of files distributed by the - Copyright Holder, and derivatives of that collection and/or of - those files. A given Package may consist of either the Standard - Version, or a Modified Version. - - "Distribute" means providing a copy of the Package or making it - accessible to anyone else, or in the case of a company or - organization, to others outside of your company or organization. - - "Distributor Fee" means any fee that you charge for Distributing - this Package or providing support for this Package to another - party. It does not mean licensing fees. - - "Standard Version" refers to the Package if it has not been - modified, or has been modified only in ways explicitly requested - by the Copyright Holder. - - "Modified Version" means the Package, if it has been changed, and - such changes were not explicitly requested by the Copyright - Holder. - - "Original License" means this Artistic License as Distributed with - the Standard Version of the Package, in its current version or as - it may be modified by The Perl Foundation in the future. - - "Source" form means the source code, documentation source, and - configuration files for the Package. - - "Compiled" form means the compiled bytecode, object code, binary, - or any other form resulting from mechanical transformation or - translation of the Source form. - - Permission for Use and Modification Without Distribution - - (1) You are permitted to use the Standard Version and create and use - Modified Versions for any purpose without restriction, provided that - you do not Distribute the Modified Version. - - Permissions for Redistribution of the Standard Version - - (2) You may Distribute verbatim copies of the Source form of the - Standard Version of this Package in any medium without restriction, - either gratis or for a Distributor Fee, provided that you duplicate - all of the original copyright notices and associated disclaimers. At - your discretion, such verbatim copies may or may not include a - Compiled form of the Package. - - (3) You may apply any bug fixes, portability changes, and other - modifications made available from the Copyright Holder. The resulting - Package will still be considered the Standard Version, and as such - will be subject to the Original License. - - Distribution of Modified Versions of the Package as Source - - (4) You may Distribute your Modified Version as Source (either gratis - or for a Distributor Fee, and with or without a Compiled form of the - Modified Version) provided that you clearly document how it differs - from the Standard Version, including, but not limited to, documenting - any non-standard features, executables, or modules, and provided that - you do at least ONE of the following: - - (a) make the Modified Version available to the Copyright Holder - of the Standard Version, under the Original License, so that the - Copyright Holder may include your modifications in the Standard - Version. - - (b) ensure that installation of your Modified Version does not - prevent the user installing or running the Standard Version. In - addition, the Modified Version must bear a name that is different - from the name of the Standard Version. - - (c) allow anyone who receives a copy of the Modified Version to - make the Source form of the Modified Version available to others - under - - (i) the Original License or - - (ii) a license that permits the licensee to freely copy, - modify and redistribute the Modified Version using the same - licensing terms that apply to the copy that the licensee - received, and requires that the Source form of the Modified - Version, and of any works derived from it, be made freely - available in that license fees are prohibited but Distributor - Fees are allowed. - - Distribution of Compiled Forms of the Standard Version - or Modified Versions without the Source - - (5) You may Distribute Compiled forms of the Standard Version without - the Source, provided that you include complete instructions on how to - get the Source of the Standard Version. Such instructions must be - valid at the time of your distribution. If these instructions, at any - time while you are carrying out such distribution, become invalid, you - must provide new instructions on demand or cease further distribution. - If you provide valid instructions or cease distribution within thirty - days after you become aware that the instructions are invalid, then - you do not forfeit any of your rights under this license. - - (6) You may Distribute a Modified Version in Compiled form without - the Source, provided that you comply with Section 4 with respect to - the Source of the Modified Version. - - Aggregating or Linking the Package - - (7) You may aggregate the Package (either the Standard Version or - Modified Version) with other packages and Distribute the resulting - aggregation provided that you do not charge a licensing fee for the - Package. Distributor Fees are permitted, and licensing fees for other - components in the aggregation are permitted. The terms of this license - apply to the use and Distribution of the Standard or Modified Versions - as included in the aggregation. - - (8) You are permitted to link Modified and Standard Versions with - other works, to embed the Package in a larger work of your own, or to - build stand-alone binary or bytecode versions of applications that - include the Package, and Distribute the result without restriction, - provided the result does not expose a direct interface to the Package. - - Items That are Not Considered Part of a Modified Version - - (9) Works (including, but not limited to, modules and scripts) that - merely extend or make use of the Package, do not, by themselves, cause - the Package to be a Modified Version. In addition, such works are not - considered parts of the Package itself, and are not subject to the - terms of this license. - - General Provisions - - (10) Any use, modification, and distribution of the Standard or - Modified Versions is governed by this Artistic License. By using, - modifying or distributing the Package, you accept this license. Do not - use, modify, or distribute the Package, if you do not accept this - license. - - (11) If your Modified Version has been derived from a Modified - Version made by someone other than you, you are nevertheless required - to ensure that your Modified Version complies with the requirements of - this license. - - (12) This license does not grant you the right to use any trademark, - service mark, tradename, or logo of the Copyright Holder. - - (13) This license includes the non-exclusive, worldwide, - free-of-charge patent license to make, have made, use, offer to sell, - sell, import and otherwise transfer the Package with respect to any - patent claims licensable by the Copyright Holder that are necessarily - infringed by the Package. If you institute patent litigation - (including a cross-claim or counterclaim) against any party alleging - that the Package constitutes direct or contributory patent - infringement, then this Artistic License to you shall terminate on the - date that such litigation is filed. - - (14) Disclaimer of Warranty: - THE PACKAGE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS - IS' AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES. THE IMPLIED - WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR - NON-INFRINGEMENT ARE DISCLAIMED TO THE EXTENT PERMITTED BY YOUR LOCAL - LAW. UNLESS REQUIRED BY LAW, NO COPYRIGHT HOLDER OR CONTRIBUTOR WILL - BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL - DAMAGES ARISING IN ANY WAY OUT OF THE USE OF THE PACKAGE, EVEN IF - ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - - -------- - """ - -- GYP, located at tools/gyp, is licensed as follows: - """ - Copyright (c) 2009 Google Inc. All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are - met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following disclaimer - in the documentation and/or other materials provided with the - distribution. - * Neither the name of Google Inc. nor the names of its - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - """ - -- marked, located at tools/doc/node_modules/marked, is licensed as follows: - """ - Copyright (c) 2011-2014, Christopher Jeffrey (https://github.com/chjj/) - - 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. - """ - -- cpplint.py, located at tools/cpplint.py, is licensed as follows: - """ - Copyright (c) 2009 Google Inc. All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are - met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following disclaimer - in the documentation and/or other materials provided with the - distribution. - * Neither the name of Google Inc. nor the names of its - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - """ - -- ESLint, located at tools/eslint, is licensed as follows: - """ - ESLint - Copyright jQuery Foundation and other contributors, https://jquery.org/ - - 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. - """ - -- gtest, located at deps/gtest, is licensed as follows: - """ - Copyright 2008, Google Inc. - All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are - met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following disclaimer - in the documentation and/or other materials provided with the - distribution. - * Neither the name of Google Inc. nor the names of its - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - """ diff --git a/deps/npm/node_modules/util-promisify/README.md b/deps/npm/node_modules/util-promisify/README.md deleted file mode 100644 index 18c84207beacbc..00000000000000 --- a/deps/npm/node_modules/util-promisify/README.md +++ /dev/null @@ -1,42 +0,0 @@ - -# util-promisify - -Node 8's [`require('util').promisify`](https://nodejs.org/api/util.html#util_util_promisify_original) as a node module, so you can use it right now! - -Supports [all major node versions](https://github.com/nodejs/LTS#lts-schedule1). - -[![build status](https://travis-ci.org/juliangruber/util-promisify.svg?branch=master)](http://travis-ci.org/juliangruber/util-promisify) -[![downloads](https://img.shields.io/npm/dm/util-promisify.svg)](https://www.npmjs.org/package/util-promisify) -[![Greenkeeper badge](https://badges.greenkeeper.io/juliangruber/util-promisify.svg)](https://greenkeeper.io/) - -## Usage - -```js -const promisify = require('util-promisify'); -const fs = require('fs'); - -const stat = promisify(fs.stat); - -stat('/tmp/').then(s => { - // ... -}); -``` - -## Installation - -```bash -$ npm install util-promisify -``` - -## API - -See `util.promisify`'s [API docs](https://nodejs.org/api/util.html#util_util_promisify_original). - -### promisify(original) -### (Symbol) promisify.custom - -If available, the Symbol is reexported from node core's `util` module. - -## License - -MIT diff --git a/deps/npm/node_modules/util-promisify/index.js b/deps/npm/node_modules/util-promisify/index.js deleted file mode 100644 index 2d2719ed1f794d..00000000000000 --- a/deps/npm/node_modules/util-promisify/index.js +++ /dev/null @@ -1,91 +0,0 @@ -'use strict'; - -const ObjectGetOwnPropertyDescriptors = require('object.getownpropertydescriptors'); -const util = require('util'); -const timers = require('timers'); - -const kCustomPromisifiedSymbol = util.promisify && util.promisify.custom || Symbol('util.promisify.custom'); -//const kCustomPromisifyArgsSymbol = Symbol('customPromisifyArgs'); - -function promisify(orig) { - if (typeof orig !== 'function') { - //const errors = require('internal/errors'); - //throw new errors.TypeError('ERR_INVALID_ARG_TYPE', 'original', 'function'); - var err = TypeError(`The "original" argument must be of type function`); - err.code = 'ERR_INVALID_ARG_TYPE'; - err.name = `TypeError [${err.code}]`; - throw err - } - - if (orig === timers.setTimeout || orig === timers.setImmediate) { - const _orig = orig - orig = function () { - var args = []; - for (var i = 0; i < arguments.length; i ++) args.push(arguments[i]); - const _cb = args.pop() - const cb = function () { - var args = []; - for (var i = 0; i < arguments.length; i ++) args.push(arguments[i]); - _cb.apply(null, [null].concat(args)) - } - _orig.apply(timers, [cb].concat(args)) - } - } - - if (orig[kCustomPromisifiedSymbol]) { - const fn = orig[kCustomPromisifiedSymbol]; - if (typeof fn !== 'function') { - throw new TypeError('The [util.promisify.custom] property must be ' + - 'a function'); - } - Object.defineProperty(fn, kCustomPromisifiedSymbol, { - value: fn, enumerable: false, writable: false, configurable: true - }); - return fn; - } - - // Names to create an object from in case the callback receives multiple - // arguments, e.g. ['stdout', 'stderr'] for child_process.exec. - //const argumentNames = orig[kCustomPromisifyArgsSymbol]; - - function fn() { - var args = []; - for (var i = 0; i < arguments.length; i ++) args.push(arguments[i]); - - let resolve, reject; - const promise = new Promise(function (_resolve, _reject) { - resolve = _resolve; - reject = _reject; - }); - try { - orig.apply(this, args.concat(function (err) { - var values = []; - for (var i = 1; i < arguments.length; i++) values.push(arguments[i]); - if (err) { - reject(err); - //} else if (argumentNames !== undefined && values.length > 1) { - // const obj = {}; - // for (var i = 0; i < argumentNames.length; i++) - // obj[argumentNames[i]] = values[i]; - // resolve(obj); - } else { - resolve(values[0]); - } - })); - } catch (err) { - reject(err); - } - return promise; - } - - Object.setPrototypeOf(fn, Object.getPrototypeOf(orig)); - - Object.defineProperty(fn, kCustomPromisifiedSymbol, { - value: fn, enumerable: false, writable: false, configurable: true - }); - return Object.defineProperties(fn, ObjectGetOwnPropertyDescriptors(orig)); -} - -promisify.custom = kCustomPromisifiedSymbol; - -module.exports = promisify; diff --git a/deps/npm/node_modules/util-promisify/package.json b/deps/npm/node_modules/util-promisify/package.json deleted file mode 100644 index 404bd92be6ebaa..00000000000000 --- a/deps/npm/node_modules/util-promisify/package.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "_from": "util-promisify@^2.1.0", - "_id": "util-promisify@2.1.0", - "_inBundle": false, - "_integrity": "sha1-PCI2R2xNMsX/PEcAKt18E7moKlM=", - "_location": "/util-promisify", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "util-promisify@^2.1.0", - "name": "util-promisify", - "escapedName": "util-promisify", - "rawSpec": "^2.1.0", - "saveSpec": null, - "fetchSpec": "^2.1.0" - }, - "_requiredBy": [ - "/read-package-tree" - ], - "_resolved": "https://registry.npmjs.org/util-promisify/-/util-promisify-2.1.0.tgz", - "_shasum": "3c2236476c4d32c5ff3c47002add7c13b9a82a53", - "_spec": "util-promisify@^2.1.0", - "_where": "/Users/isaacs/dev/npm/cli/node_modules/read-package-tree", - "bugs": { - "url": "https://github.com/juliangruber/util-promisify/issues" - }, - "bundleDependencies": false, - "dependencies": { - "object.getownpropertydescriptors": "^2.0.3" - }, - "deprecated": false, - "description": "Node 8's util.promisify, as a node module", - "homepage": "https://github.com/juliangruber/util-promisify#readme", - "license": "MIT", - "name": "util-promisify", - "repository": { - "type": "git", - "url": "git+https://github.com/juliangruber/util-promisify.git" - }, - "scripts": { - "test": "node test" - }, - "version": "2.1.0" -} diff --git a/deps/npm/node_modules/util-promisify/test/common.js b/deps/npm/node_modules/util-promisify/test/common.js deleted file mode 100644 index 72262b7feb36aa..00000000000000 --- a/deps/npm/node_modules/util-promisify/test/common.js +++ /dev/null @@ -1,56 +0,0 @@ -const mustCallChecks = []; - -function runCallChecks(exitCode) { - if (exitCode !== 0) return; - - const failed = mustCallChecks.filter(function(context) { - return context.actual !== context.expected; - }); - - failed.forEach(function(context) { - console.log('Mismatched %s function calls. Expected %d, actual %d.', - context.name, - context.expected, - context.actual); - console.log(context.stack.split('\n').slice(2).join('\n')); - }); - - if (failed.length) process.exit(1); -} - -exports.mustCall = function(fn, expected) { - if (typeof fn === 'number') { - expected = fn; - fn = noop; - } else if (fn === undefined) { - fn = noop; - } - - if (expected === undefined) - expected = 1; - else if (typeof expected !== 'number') - throw new TypeError(`Invalid expected value: ${expected}`); - - const context = { - expected: expected, - actual: 0, - stack: (new Error()).stack, - name: fn.name || '' - }; - - // add the exit listener only once to avoid listener leak warnings - if (mustCallChecks.length === 0) process.on('exit', runCallChecks); - - mustCallChecks.push(context); - - return function() { - context.actual++; - return fn.apply(this, arguments); - }; -}; - -// Crash the process on unhandled rejections. -exports.crashOnUnhandledRejection = function() { - process.on('unhandledRejection', - (err) => process.nextTick(() => { throw err; })); -}; diff --git a/deps/npm/node_modules/util-promisify/test/index.js b/deps/npm/node_modules/util-promisify/test/index.js deleted file mode 100644 index a8e8491628baa5..00000000000000 --- a/deps/npm/node_modules/util-promisify/test/index.js +++ /dev/null @@ -1,194 +0,0 @@ -'use strict'; - -const common = require('./common'); -const assert = require('assert'); -const fs = require('fs'); -const vm = require('vm'); -const promisify = require('..'); -//const customPromisifyArgs = require('..').customPromisifyArgs; - -const stat = promisify(fs.stat); - -{ - const promise = stat(__filename); - assert(promise instanceof Promise); - promise.then(common.mustCall((value) => { - assert.deepStrictEqual(value, fs.statSync(__filename)); - })); -} - -{ - const promise = stat('/dontexist'); - promise.catch(common.mustCall((error) => { - assert(error.message.includes('ENOENT: no such file or directory, stat')); - })); -} - -{ - function fn() {} - function promisifedFn() {} - fn[promisify.custom] = promisifedFn; - assert.strictEqual(promisify(fn), promisifedFn); - assert.strictEqual(promisify(promisify(fn)), promisifedFn); -} - -{ - function fn() {} - fn[promisify.custom] = 42; - assert.throws( - () => promisify(fn), - (err) => err instanceof TypeError && - err.message === 'The [util.promisify.custom] property must ' + - 'be a function'); -} - -/*{ - const firstValue = 5; - const secondValue = 17; - - function fn(callback) { - callback(null, firstValue, secondValue); - } - - fn[customPromisifyArgs] = ['first', 'second']; - - promisify(fn)().then(common.mustCall((obj) => { - assert.deepStrictEqual(obj, {first: firstValue, second: secondValue}); - })); -}*/ - -{ - const fn = vm.runInNewContext('(function() {})'); - assert.notStrictEqual(Object.getPrototypeOf(promisify(fn)), - Function.prototype); -} - -{ - function fn(callback) { - callback(null, 'foo', 'bar'); - } - promisify(fn)().then(common.mustCall((value) => { - assert.deepStrictEqual(value, 'foo'); - })); -} - -{ - function fn(callback) { - callback(null); - } - promisify(fn)().then(common.mustCall((value) => { - assert.strictEqual(value, undefined); - })); -} - -{ - function fn(callback) { - callback(); - } - promisify(fn)().then(common.mustCall((value) => { - assert.strictEqual(value, undefined); - })); -} - -{ - function fn(err, val, callback) { - callback(err, val); - } - promisify(fn)(null, 42).then(common.mustCall((value) => { - assert.strictEqual(value, 42); - })); -} - -{ - function fn(err, val, callback) { - callback(err, val); - } - promisify(fn)(new Error('oops'), null).catch(common.mustCall((err) => { - assert.strictEqual(err.message, 'oops'); - })); -} - -if (Number(process.version[1]) >= 7) eval` -{ - - function fn(err, val, callback) { - callback(err, val); - } - - (async () => { - const value = await promisify(fn)(null, 42); - assert.strictEqual(value, 42); - })(); -}` - -{ - const o = {}; - const fn = promisify(function(cb) { - - cb(null, this === o); - }); - - o.fn = fn; - - o.fn().then(common.mustCall(function(val) { - assert(val); - })); -} - -if (Number(process.version[1]) >= 7) eval` -{ - const err = new Error('Should not have called the callback with the error.'); - const stack = err.stack; - - const fn = promisify(function(cb) { - cb(null); - cb(err); - }); - - (async () => { - await fn(); - await Promise.resolve(); - return assert.strictEqual(stack, err.stack); - })(); -}` - -{ - function c() { } - const a = promisify(function() { }); - const b = promisify(a); - assert.notStrictEqual(c, a); - assert.strictEqual(a, b); -} - -{ - let errToThrow; - const thrower = promisify(function(a, b, c, cb) { - errToThrow = new Error(); - throw errToThrow; - }); - thrower(1, 2, 3) - .then(assert.fail) - .then(assert.fail, (e) => assert.strictEqual(e, errToThrow)); -} - -{ - const err = new Error(); - - const a = promisify((cb) => cb(err))(); - const b = promisify(() => { throw err; })(); - - Promise.all([ - a.then(assert.fail, function(e) { - assert.strictEqual(err, e); - }), - b.then(assert.fail, function(e) { - assert.strictEqual(err, e); - }) - ]); -} - -if (Number(process.version[1]) >= 8) -{ - const coreUtil = require('util'); - assert.strictEqual(coreUtil.promisify.custom, promisify.custom); -} diff --git a/deps/npm/node_modules/util-promisify/test/timers.js b/deps/npm/node_modules/util-promisify/test/timers.js deleted file mode 100644 index de12be034d3043..00000000000000 --- a/deps/npm/node_modules/util-promisify/test/timers.js +++ /dev/null @@ -1,38 +0,0 @@ -'use strict'; -const common = require('./common'); -const assert = require('assert'); -const timers = require('timers'); -const promisify = require('..'); - -common.crashOnUnhandledRejection(); - -const setTimeout = promisify(timers.setTimeout); -const setImmediate = promisify(timers.setImmediate); - -{ - const promise = setTimeout(1); - promise.then(common.mustCall((value) => { - assert.strictEqual(value, undefined); - })); -} - -{ - const promise = setTimeout(1, 'foobar'); - promise.then(common.mustCall((value) => { - assert.strictEqual(value, 'foobar'); - })); -} - -{ - const promise = setImmediate(); - promise.then(common.mustCall((value) => { - assert.strictEqual(value, undefined); - })); -} - -{ - const promise = setImmediate('foobar'); - promise.then(common.mustCall((value) => { - assert.strictEqual(value, 'foobar'); - })); -} diff --git a/deps/npm/node_modules/uuid/CHANGELOG.md b/deps/npm/node_modules/uuid/CHANGELOG.md index 1ff6978076ec86..bcefac2f20b941 100644 --- a/deps/npm/node_modules/uuid/CHANGELOG.md +++ b/deps/npm/node_modules/uuid/CHANGELOG.md @@ -2,111 +2,222 @@ 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.3.3](https://github.com/kelektiv/node-uuid/compare/v3.3.2...v3.3.3) (2019-08-19) +### [8.3.1](https://github.com/uuidjs/uuid/compare/v8.3.0...v8.3.1) (2020-10-04) - -## [3.3.2](https://github.com/kelektiv/node-uuid/compare/v3.3.1...v3.3.2) (2018-06-28) +### Bug Fixes + +- support expo>=39.0.0 ([#515](https://github.com/uuidjs/uuid/issues/515)) ([c65a0f3](https://github.com/uuidjs/uuid/commit/c65a0f3fa73b901959d638d1e3591dfacdbed867)), closes [#375](https://github.com/uuidjs/uuid/issues/375) + +## [8.3.0](https://github.com/uuidjs/uuid/compare/v8.2.0...v8.3.0) (2020-07-27) + +### Features + +- add parse/stringify/validate/version/NIL APIs ([#479](https://github.com/uuidjs/uuid/issues/479)) ([0e6c10b](https://github.com/uuidjs/uuid/commit/0e6c10ba1bf9517796ff23c052fc0468eedfd5f4)), closes [#475](https://github.com/uuidjs/uuid/issues/475) [#478](https://github.com/uuidjs/uuid/issues/478) [#480](https://github.com/uuidjs/uuid/issues/480) [#481](https://github.com/uuidjs/uuid/issues/481) [#180](https://github.com/uuidjs/uuid/issues/180) +## [8.2.0](https://github.com/uuidjs/uuid/compare/v8.1.0...v8.2.0) (2020-06-23) + +### Features + +- improve performance of v1 string representation ([#453](https://github.com/uuidjs/uuid/issues/453)) ([0ee0b67](https://github.com/uuidjs/uuid/commit/0ee0b67c37846529c66089880414d29f3ae132d5)) +- remove deprecated v4 string parameter ([#454](https://github.com/uuidjs/uuid/issues/454)) ([88ce3ca](https://github.com/uuidjs/uuid/commit/88ce3ca0ba046f60856de62c7ce03f7ba98ba46c)), closes [#437](https://github.com/uuidjs/uuid/issues/437) +- support jspm ([#473](https://github.com/uuidjs/uuid/issues/473)) ([e9f2587](https://github.com/uuidjs/uuid/commit/e9f2587a92575cac31bc1d4ae944e17c09756659)) ### Bug Fixes -* typo ([305d877](https://github.com/kelektiv/node-uuid/commit/305d877)) +- prepare package exports for webpack 5 ([#468](https://github.com/uuidjs/uuid/issues/468)) ([8d6e6a5](https://github.com/uuidjs/uuid/commit/8d6e6a5f8965ca9575eb4d92e99a43435f4a58a8)) + +## [8.1.0](https://github.com/uuidjs/uuid/compare/v8.0.0...v8.1.0) (2020-05-20) + +### Features + +- improve v4 performance by reusing random number array ([#435](https://github.com/uuidjs/uuid/issues/435)) ([bf4af0d](https://github.com/uuidjs/uuid/commit/bf4af0d711b4d2ed03d1f74fd12ad0baa87dc79d)) +- optimize V8 performance of bytesToUuid ([#434](https://github.com/uuidjs/uuid/issues/434)) ([e156415](https://github.com/uuidjs/uuid/commit/e156415448ec1af2351fa0b6660cfb22581971f2)) + +### Bug Fixes +- export package.json required by react-native and bundlers ([#449](https://github.com/uuidjs/uuid/issues/449)) ([be1c8fe](https://github.com/uuidjs/uuid/commit/be1c8fe9a3206c358e0059b52fafd7213aa48a52)), closes [ai/nanoevents#44](https://github.com/ai/nanoevents/issues/44#issuecomment-602010343) [#444](https://github.com/uuidjs/uuid/issues/444) +## [8.0.0](https://github.com/uuidjs/uuid/compare/v7.0.3...v8.0.0) (2020-04-29) - -## [3.3.1](https://github.com/kelektiv/node-uuid/compare/v3.3.0...v3.3.1) (2018-06-28) +### ⚠ BREAKING CHANGES +- For native ECMAScript Module (ESM) usage in Node.js only named exports are exposed, there is no more default export. + + ```diff + -import uuid from 'uuid'; + -console.log(uuid.v4()); // -> 'cd6c3b08-0adc-4f4b-a6ef-36087a1c9869' + +import { v4 as uuidv4 } from 'uuid'; + +uuidv4(); // ⇨ '9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d' + ``` + +- Deep requiring specific algorithms of this library like `require('uuid/v4')`, which has been deprecated in `uuid@7`, is no longer supported. + + Instead use the named exports that this module exports. + + For ECMAScript Modules (ESM): + + ```diff + -import uuidv4 from 'uuid/v4'; + +import { v4 as uuidv4 } from 'uuid'; + uuidv4(); + ``` + + For CommonJS: + + ```diff + -const uuidv4 = require('uuid/v4'); + +const { v4: uuidv4 } = require('uuid'); + uuidv4(); + ``` + +### Features + +- native Node.js ES Modules (wrapper approach) ([#423](https://github.com/uuidjs/uuid/issues/423)) ([2d9f590](https://github.com/uuidjs/uuid/commit/2d9f590ad9701d692625c07ed62f0a0f91227991)), closes [#245](https://github.com/uuidjs/uuid/issues/245) [#419](https://github.com/uuidjs/uuid/issues/419) [#342](https://github.com/uuidjs/uuid/issues/342) +- remove deep requires ([#426](https://github.com/uuidjs/uuid/issues/426)) ([daf72b8](https://github.com/uuidjs/uuid/commit/daf72b84ceb20272a81bb5fbddb05dd95922cbba)) ### Bug Fixes -* fix [#284](https://github.com/kelektiv/node-uuid/issues/284) by setting function name in try-catch ([f2a60f2](https://github.com/kelektiv/node-uuid/commit/f2a60f2)) +- add CommonJS syntax example to README quickstart section ([#417](https://github.com/uuidjs/uuid/issues/417)) ([e0ec840](https://github.com/uuidjs/uuid/commit/e0ec8402c7ad44b7ef0453036c612f5db513fda0)) +### [7.0.3](https://github.com/uuidjs/uuid/compare/v7.0.2...v7.0.3) (2020-03-31) +### Bug Fixes - -# [3.3.0](https://github.com/kelektiv/node-uuid/compare/v3.2.1...v3.3.0) (2018-06-22) +- make deep require deprecation warning work in browsers ([#409](https://github.com/uuidjs/uuid/issues/409)) ([4b71107](https://github.com/uuidjs/uuid/commit/4b71107d8c0d2ef56861ede6403fc9dc35a1e6bf)), closes [#408](https://github.com/uuidjs/uuid/issues/408) +### [7.0.2](https://github.com/uuidjs/uuid/compare/v7.0.1...v7.0.2) (2020-03-04) ### Bug Fixes -* assignment to readonly property to allow running in strict mode ([#270](https://github.com/kelektiv/node-uuid/issues/270)) ([d062fdc](https://github.com/kelektiv/node-uuid/commit/d062fdc)) -* fix [#229](https://github.com/kelektiv/node-uuid/issues/229) ([c9684d4](https://github.com/kelektiv/node-uuid/commit/c9684d4)) -* Get correct version of IE11 crypto ([#274](https://github.com/kelektiv/node-uuid/issues/274)) ([153d331](https://github.com/kelektiv/node-uuid/commit/153d331)) -* mem issue when generating uuid ([#267](https://github.com/kelektiv/node-uuid/issues/267)) ([c47702c](https://github.com/kelektiv/node-uuid/commit/c47702c)) +- make access to msCrypto consistent ([#393](https://github.com/uuidjs/uuid/issues/393)) ([8bf2a20](https://github.com/uuidjs/uuid/commit/8bf2a20f3565df743da7215eebdbada9d2df118c)) +- simplify link in deprecation warning ([#391](https://github.com/uuidjs/uuid/issues/391)) ([bb2c8e4](https://github.com/uuidjs/uuid/commit/bb2c8e4e9f4c5f9c1eaaf3ea59710c633cd90cb7)) +- update links to match content in readme ([#386](https://github.com/uuidjs/uuid/issues/386)) ([44f2f86](https://github.com/uuidjs/uuid/commit/44f2f86e9d2bbf14ee5f0f00f72a3db1292666d4)) + +### [7.0.1](https://github.com/uuidjs/uuid/compare/v7.0.0...v7.0.1) (2020-02-25) + +### Bug Fixes + +- clean up esm builds for node and browser ([#383](https://github.com/uuidjs/uuid/issues/383)) ([59e6a49](https://github.com/uuidjs/uuid/commit/59e6a49e7ce7b3e8fb0f3ee52b9daae72af467dc)) +- provide browser versions independent from module system ([#380](https://github.com/uuidjs/uuid/issues/380)) ([4344a22](https://github.com/uuidjs/uuid/commit/4344a22e7aed33be8627eeaaf05360f256a21753)), closes [#378](https://github.com/uuidjs/uuid/issues/378) + +## [7.0.0](https://github.com/uuidjs/uuid/compare/v3.4.0...v7.0.0) (2020-02-24) + +### ⚠ BREAKING CHANGES + +- The default export, which used to be the v4() method but which was already discouraged in v3.x of this library, has been removed. +- Explicitly note that deep imports of the different uuid version functions are deprecated and no longer encouraged and that ECMAScript module named imports should be used instead. Emit a deprecation warning for people who deep-require the different algorithm variants. +- Remove builtin support for insecure random number generators in the browser. Users who want that will have to supply their own random number generator function. +- Remove support for generating v3 and v5 UUIDs in Node.js<4.x +- Convert code base to ECMAScript Modules (ESM) and release CommonJS build for node and ESM build for browser bundlers. ### Features -* enforce Conventional Commit style commit messages ([#282](https://github.com/kelektiv/node-uuid/issues/282)) ([cc9a182](https://github.com/kelektiv/node-uuid/commit/cc9a182)) +- add UMD build to npm package ([#357](https://github.com/uuidjs/uuid/issues/357)) ([4e75adf](https://github.com/uuidjs/uuid/commit/4e75adf435196f28e3fbbe0185d654b5ded7ca2c)), closes [#345](https://github.com/uuidjs/uuid/issues/345) +- add various es module and CommonJS examples ([b238510](https://github.com/uuidjs/uuid/commit/b238510bf352463521f74bab175a3af9b7a42555)) +- ensure that docs are up-to-date in CI ([ee5e77d](https://github.com/uuidjs/uuid/commit/ee5e77db547474f5a8f23d6c857a6d399209986b)) +- hybrid CommonJS & ECMAScript modules build ([a3f078f](https://github.com/uuidjs/uuid/commit/a3f078faa0baff69ab41aed08e041f8f9c8993d0)) +- remove insecure fallback random number generator ([3a5842b](https://github.com/uuidjs/uuid/commit/3a5842b141a6e5de0ae338f391661e6b84b167c9)), closes [#173](https://github.com/uuidjs/uuid/issues/173) +- remove support for pre Node.js v4 Buffer API ([#356](https://github.com/uuidjs/uuid/issues/356)) ([b59b5c5](https://github.com/uuidjs/uuid/commit/b59b5c5ecad271c5453f1a156f011671f6d35627)) +- rename repository to github:uuidjs/uuid ([#351](https://github.com/uuidjs/uuid/issues/351)) ([c37a518](https://github.com/uuidjs/uuid/commit/c37a518e367ac4b6d0aa62dba1bc6ce9e85020f7)), closes [#338](https://github.com/uuidjs/uuid/issues/338) + +### Bug Fixes + +- add deep-require proxies for local testing and adjust tests ([#365](https://github.com/uuidjs/uuid/issues/365)) ([7fedc79](https://github.com/uuidjs/uuid/commit/7fedc79ac8fda4bfd1c566c7f05ef4ac13b2db48)) +- add note about removal of default export ([#372](https://github.com/uuidjs/uuid/issues/372)) ([12749b7](https://github.com/uuidjs/uuid/commit/12749b700eb49db8a9759fd306d8be05dbfbd58c)), closes [#370](https://github.com/uuidjs/uuid/issues/370) +- deprecated deep requiring of the different algorithm versions ([#361](https://github.com/uuidjs/uuid/issues/361)) ([c0bdf15](https://github.com/uuidjs/uuid/commit/c0bdf15e417639b1aeb0b247b2fb11f7a0a26b23)) +## [3.4.0](https://github.com/uuidjs/uuid/compare/v3.3.3...v3.4.0) (2020-01-16) - -## [3.2.1](https://github.com/kelektiv/node-uuid/compare/v3.2.0...v3.2.1) (2018-01-16) +### Features + +- rename repository to github:uuidjs/uuid ([#351](https://github.com/uuidjs/uuid/issues/351)) ([e2d7314](https://github.com/uuidjs/uuid/commit/e2d7314)), closes [#338](https://github.com/uuidjs/uuid/issues/338) +## [3.3.3](https://github.com/uuidjs/uuid/compare/v3.3.2...v3.3.3) (2019-08-19) ### Bug Fixes -* use msCrypto if available. Fixes [#241](https://github.com/kelektiv/node-uuid/issues/241) ([#247](https://github.com/kelektiv/node-uuid/issues/247)) ([1fef18b](https://github.com/kelektiv/node-uuid/commit/1fef18b)) +- no longer run ci tests on node v4 +- upgrade dependencies +## [3.3.2](https://github.com/uuidjs/uuid/compare/v3.3.1...v3.3.2) (2018-06-28) +### Bug Fixes - -# [3.2.0](https://github.com/kelektiv/node-uuid/compare/v3.1.0...v3.2.0) (2018-01-16) +- typo ([305d877](https://github.com/uuidjs/uuid/commit/305d877)) +## [3.3.1](https://github.com/uuidjs/uuid/compare/v3.3.0...v3.3.1) (2018-06-28) ### Bug Fixes -* remove mistakenly added typescript dependency, rollback version (standard-version will auto-increment) ([09fa824](https://github.com/kelektiv/node-uuid/commit/09fa824)) -* use msCrypto if available. Fixes [#241](https://github.com/kelektiv/node-uuid/issues/241) ([#247](https://github.com/kelektiv/node-uuid/issues/247)) ([1fef18b](https://github.com/kelektiv/node-uuid/commit/1fef18b)) +- fix [#284](https://github.com/uuidjs/uuid/issues/284) by setting function name in try-catch ([f2a60f2](https://github.com/uuidjs/uuid/commit/f2a60f2)) +# [3.3.0](https://github.com/uuidjs/uuid/compare/v3.2.1...v3.3.0) (2018-06-22) + +### Bug Fixes + +- assignment to readonly property to allow running in strict mode ([#270](https://github.com/uuidjs/uuid/issues/270)) ([d062fdc](https://github.com/uuidjs/uuid/commit/d062fdc)) +- fix [#229](https://github.com/uuidjs/uuid/issues/229) ([c9684d4](https://github.com/uuidjs/uuid/commit/c9684d4)) +- Get correct version of IE11 crypto ([#274](https://github.com/uuidjs/uuid/issues/274)) ([153d331](https://github.com/uuidjs/uuid/commit/153d331)) +- mem issue when generating uuid ([#267](https://github.com/uuidjs/uuid/issues/267)) ([c47702c](https://github.com/uuidjs/uuid/commit/c47702c)) ### Features -* Add v3 Support ([#217](https://github.com/kelektiv/node-uuid/issues/217)) ([d94f726](https://github.com/kelektiv/node-uuid/commit/d94f726)) +- enforce Conventional Commit style commit messages ([#282](https://github.com/uuidjs/uuid/issues/282)) ([cc9a182](https://github.com/uuidjs/uuid/commit/cc9a182)) + +## [3.2.1](https://github.com/uuidjs/uuid/compare/v3.2.0...v3.2.1) (2018-01-16) +### Bug Fixes + +- use msCrypto if available. Fixes [#241](https://github.com/uuidjs/uuid/issues/241) ([#247](https://github.com/uuidjs/uuid/issues/247)) ([1fef18b](https://github.com/uuidjs/uuid/commit/1fef18b)) -# [3.1.0](https://github.com/kelektiv/node-uuid/compare/v3.1.0...v3.0.1) (2017-06-17) +# [3.2.0](https://github.com/uuidjs/uuid/compare/v3.1.0...v3.2.0) (2018-01-16) ### Bug Fixes -* (fix) Add .npmignore file to exclude test/ and other non-essential files from packing. (#183) -* Fix typo (#178) -* Simple typo fix (#165) +- remove mistakenly added typescript dependency, rollback version (standard-version will auto-increment) ([09fa824](https://github.com/uuidjs/uuid/commit/09fa824)) +- use msCrypto if available. Fixes [#241](https://github.com/uuidjs/uuid/issues/241) ([#247](https://github.com/uuidjs/uuid/issues/247)) ([1fef18b](https://github.com/uuidjs/uuid/commit/1fef18b)) ### Features -* v5 support in CLI (#197) -* V5 support (#188) +- Add v3 Support ([#217](https://github.com/uuidjs/uuid/issues/217)) ([d94f726](https://github.com/uuidjs/uuid/commit/d94f726)) -# 3.0.1 (2016-11-28) +# [3.1.0](https://github.com/uuidjs/uuid/compare/v3.1.0...v3.0.1) (2017-06-17) -* split uuid versions into separate files +### Bug Fixes +- (fix) Add .npmignore file to exclude test/ and other non-essential files from packing. (#183) +- Fix typo (#178) +- Simple typo fix (#165) -# 3.0.0 (2016-11-17) +### Features + +- v5 support in CLI (#197) +- V5 support (#188) -* remove .parse and .unparse +# 3.0.1 (2016-11-28) +- split uuid versions into separate files -# 2.0.0 +# 3.0.0 (2016-11-17) -* Removed uuid.BufferClass +- remove .parse and .unparse +# 2.0.0 -# 1.4.0 +- Removed uuid.BufferClass -* Improved module context detection -* Removed public RNG functions +# 1.4.0 +- Improved module context detection +- Removed public RNG functions # 1.3.2 -* Improve tests and handling of v1() options (Issue #24) -* Expose RNG option to allow for perf testing with different generators - +- Improve tests and handling of v1() options (Issue #24) +- Expose RNG option to allow for perf testing with different generators # 1.3.0 -* Support for version 1 ids, thanks to [@ctavan](https://github.com/ctavan)! -* Support for node.js crypto API -* De-emphasizing performance in favor of a) cryptographic quality PRNGs where available and b) more manageable code +- Support for version 1 ids, thanks to [@ctavan](https://github.com/ctavan)! +- Support for node.js crypto API +- De-emphasizing performance in favor of a) cryptographic quality PRNGs where available and b) more manageable code diff --git a/deps/npm/node_modules/uuid/CONTRIBUTING.md b/deps/npm/node_modules/uuid/CONTRIBUTING.md new file mode 100644 index 00000000000000..4a4503d02ca583 --- /dev/null +++ b/deps/npm/node_modules/uuid/CONTRIBUTING.md @@ -0,0 +1,18 @@ +# Contributing + +Please feel free to file GitHub Issues or propose Pull Requests. We're always happy to discuss improvements to this library! + +## Testing + +```shell +npm test +``` + +## Releasing + +Releases are supposed to be done from master, version bumping is automated through [`standard-version`](https://github.com/conventional-changelog/standard-version): + +```shell +npm run release -- --dry-run # verify output manually +npm run release # follow the instructions from the output of this command +``` diff --git a/deps/npm/node_modules/uuid/LICENSE.md b/deps/npm/node_modules/uuid/LICENSE.md index 8c84e398668b79..39341683640632 100644 --- a/deps/npm/node_modules/uuid/LICENSE.md +++ b/deps/npm/node_modules/uuid/LICENSE.md @@ -1,21 +1,9 @@ The MIT License (MIT) -Copyright (c) 2010-2016 Robert Kieffer and other contributors +Copyright (c) 2010-2020 Robert Kieffer and other contributors -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: +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 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. +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/uuid/README.md b/deps/npm/node_modules/uuid/README.md index 6fc3708b4b5303..4579a2892d5adf 100644 --- a/deps/npm/node_modules/uuid/README.md +++ b/deps/npm/node_modules/uuid/README.md @@ -2,292 +2,487 @@ -- This file is auto-generated from README_js.md. Changes should be made there. --> -# uuid [![Build Status](https://secure.travis-ci.org/kelektiv/node-uuid.svg?branch=master)](http://travis-ci.org/kelektiv/node-uuid) # +# uuid [![CI](https://github.com/uuidjs/uuid/workflows/CI/badge.svg)](https://github.com/uuidjs/uuid/actions?query=workflow%3ACI) [![Browser](https://github.com/uuidjs/uuid/workflows/Browser/badge.svg)](https://github.com/uuidjs/uuid/actions?query=workflow%3ABrowser) -Simple, fast generation of [RFC4122](http://www.ietf.org/rfc/rfc4122.txt) UUIDS. +For the creation of [RFC4122](http://www.ietf.org/rfc/rfc4122.txt) UUIDs -Features: +- **Complete** - Support for RFC4122 version 1, 3, 4, and 5 UUIDs +- **Cross-platform** - Support for ... + - CommonJS, [ECMAScript Modules](#ecmascript-modules) and [CDN builds](#cdn-builds) + - Node 8, 10, 12, 14 + - Chrome, Safari, Firefox, Edge, IE 11 browsers + - Webpack and rollup.js module bundlers + - [React Native / Expo](#react-native-expo) +- **Secure** - Cryptographically-strong random values +- **Small** - Zero-dependency, small footprint, plays nice with "tree shaking" packagers +- **CLI** - Includes the [`uuid` command line](#command-line) utility -* Support for version 1, 3, 4 and 5 UUIDs -* Cross-platform -* Uses cryptographically-strong random number APIs (when available) -* Zero-dependency, small footprint (... but not [this small](https://gist.github.com/982883)) +**Upgrading from `uuid@3.x`?** Your code is probably okay, but check out [Upgrading From `uuid@3.x`](#upgrading-from-uuid3x) for details. -[**Deprecation warning**: The use of `require('uuid')` is deprecated and will not be -supported after version 3.x of this module. Instead, use `require('uuid/[v1|v3|v4|v5]')` as shown in the examples below.] +## Quickstart -## Quickstart - CommonJS (Recommended) +To create a random UUID... + +**1. Install** ```shell npm install uuid ``` -Then generate your uuid version of choice ... - -Version 1 (timestamp): +**2. Create a UUID** (ES6 module syntax) ```javascript -const uuidv1 = require('uuid/v1'); -uuidv1(); // ⇨ '2c5ea4c0-4067-11e9-8bad-9b1deb4d3b7d' - +import { v4 as uuidv4 } from 'uuid'; +uuidv4(); // ⇨ '9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d' ``` -Version 3 (namespace): +... or using CommonJS syntax: ```javascript -const uuidv3 = require('uuid/v3'); +const { v4: uuidv4 } = require('uuid'); +uuidv4(); // ⇨ '1b9d6bcd-bbfd-4b2d-9b5d-ab8dfbbd4bed' +``` -// ... using predefined DNS namespace (for domain names) -uuidv3('hello.example.com', uuidv3.DNS); // ⇨ '9125a8dc-52ee-365b-a5aa-81b0b3681cf6' +For timestamp UUIDs, namespace UUIDs, and other options read on ... -// ... using predefined URL namespace (for, well, URLs) -uuidv3('http://example.com/hello', uuidv3.URL); // ⇨ 'c6235813-3ba4-3801-ae84-e0a6ebb7d138' +## API Summary -// ... using a custom namespace -// -// Note: Custom namespaces should be a UUID string specific to your application! -// E.g. the one here was generated using this modules `uuid` CLI. -const MY_NAMESPACE = '1b671a64-40d5-491e-99b0-da01ff1f3341'; -uuidv3('Hello, World!', MY_NAMESPACE); // ⇨ 'e8b5a51d-11c8-3310-a6ab-367563f20686' +| | | | +| --- | --- | --- | +| [`uuid.NIL`](#uuidnil) | The nil UUID string (all zeros) | New in `uuid@8.3` | +| [`uuid.parse()`](#uuidparsestr) | Convert UUID string to array of bytes | New in `uuid@8.3` | +| [`uuid.stringify()`](#uuidstringifyarr-offset) | Convert array of bytes to UUID string | New in `uuid@8.3` | +| [`uuid.v1()`](#uuidv1options-buffer-offset) | Create a version 1 (timestamp) UUID | | +| [`uuid.v3()`](#uuidv3name-namespace-buffer-offset) | Create a version 3 (namespace w/ MD5) UUID | | +| [`uuid.v4()`](#uuidv4options-buffer-offset) | Create a version 4 (random) UUID | | +| [`uuid.v5()`](#uuidv5name-namespace-buffer-offset) | Create a version 5 (namespace w/ SHA-1) UUID | | +| [`uuid.validate()`](#uuidvalidatestr) | Test a string to see if it is a valid UUID | New in `uuid@8.3` | +| [`uuid.version()`](#uuidversionstr) | Detect RFC version of a UUID | New in `uuid@8.3` | -``` +## API + +### uuid.NIL -Version 4 (random): +The nil UUID string (all zeros). + +Example: ```javascript -const uuidv4 = require('uuid/v4'); -uuidv4(); // ⇨ '1b9d6bcd-bbfd-4b2d-9b5d-ab8dfbbd4bed' +import { NIL as NIL_UUID } from 'uuid'; +NIL_UUID; // ⇨ '00000000-0000-0000-0000-000000000000' ``` -Version 5 (namespace): +### uuid.parse(str) -```javascript -const uuidv5 = require('uuid/v5'); +Convert UUID string to array of bytes -// ... using predefined DNS namespace (for domain names) -uuidv5('hello.example.com', uuidv5.DNS); // ⇨ 'fdda765f-fc57-5604-a269-52a7df8164ec' +| | | +| --------- | ---------------------------------------- | +| `str` | A valid UUID `String` | +| _returns_ | `Uint8Array[16]` | +| _throws_ | `TypeError` if `str` is not a valid UUID | -// ... using predefined URL namespace (for, well, URLs) -uuidv5('http://example.com/hello', uuidv5.URL); // ⇨ '3bbcee75-cecc-5b56-8031-b6641c1ed1f1' +Note: Ordering of values in the byte arrays used by `parse()` and `stringify()` follows the left ↠ right order of hex-pairs in UUID strings. As shown in the example below. -// ... using a custom namespace -// -// Note: Custom namespaces should be a UUID string specific to your application! -// E.g. the one here was generated using this modules `uuid` CLI. -const MY_NAMESPACE = '1b671a64-40d5-491e-99b0-da01ff1f3341'; -uuidv5('Hello, World!', MY_NAMESPACE); // ⇨ '630eb68f-e0fa-5ecc-887a-7c7a62614681' +Example: +```javascript +import { parse as uuidParse } from 'uuid'; + +// Parse a UUID +const bytes = uuidParse('6ec0bd7f-11c0-43da-975e-2a8ad9ebae0b'); + +// Convert to hex strings to show byte order (for documentation purposes) +[...bytes].map((v) => v.toString(16).padStart(2, '0')); // ⇨ + // [ + // '6e', 'c0', 'bd', '7f', + // '11', 'c0', '43', 'da', + // '97', '5e', '2a', '8a', + // 'd9', 'eb', 'ae', '0b' + // ] ``` -## Quickstart - Browser-ready Versions +### uuid.stringify(arr[, offset]) -Browser-ready versions of this module are available via [wzrd.in](https://github.com/jfhbrook/wzrd.in). +Convert array of bytes to UUID string -For version 1 uuids: +| | | +| -------------- | ---------------------------------------------------------------------------- | +| `arr` | `Array`-like collection of 16 values (starting from `offset`) between 0-255. | +| [`offset` = 0] | `Number` Starting index in the Array | +| _returns_ | `String` | +| _throws_ | `TypeError` if a valid UUID string cannot be generated | -```html - - -``` +Note: Ordering of values in the byte arrays used by `parse()` and `stringify()` follows the left ↠ right order of hex-pairs in UUID strings. As shown in the example below. -For version 3 uuids: +Example: -```html - - +```javascript +import { stringify as uuidStringify } from 'uuid'; + +const uuidBytes = [ + 0x6e, + 0xc0, + 0xbd, + 0x7f, + 0x11, + 0xc0, + 0x43, + 0xda, + 0x97, + 0x5e, + 0x2a, + 0x8a, + 0xd9, + 0xeb, + 0xae, + 0x0b, +]; + +uuidStringify(uuidBytes); // ⇨ '6ec0bd7f-11c0-43da-975e-2a8ad9ebae0b' ``` -For version 4 uuids: +### uuid.v1([options[, buffer[, offset]]]) -```html - - -``` +Create an RFC version 1 (timestamp) UUID -For version 5 uuids: +| | | +| --- | --- | +| [`options`] | `Object` with one or more of the following properties: | +| [`options.node` ] | RFC "node" field as an `Array[6]` of byte values (per 4.1.6) | +| [`options.clockseq`] | RFC "clock sequence" as a `Number` between 0 - 0x3fff | +| [`options.msecs`] | RFC "timestamp" field (`Number` of milliseconds, unix epoch) | +| [`options.nsecs`] | RFC "timestamp" field (`Number` of nanseconds to add to `msecs`, should be 0-10,000) | +| [`options.random`] | `Array` of 16 random bytes (0-255) | +| [`options.rng`] | Alternative to `options.random`, a `Function` that returns an `Array` of 16 random bytes (0-255) | +| [`buffer`] | `Array \| Buffer` If specified, uuid will be written here in byte-form, starting at `offset` | +| [`offset` = 0] | `Number` Index to start writing UUID bytes in `buffer` | +| _returns_ | UUID `String` if no `buffer` is specified, otherwise returns `buffer` | +| _throws_ | `Error` if more than 10M UUIDs/sec are requested | -```html - - -``` +Note: The default [node id](https://tools.ietf.org/html/rfc4122#section-4.1.6) (the last 12 digits in the UUID) is generated once, randomly, on process startup, and then remains unchanged for the duration of the process. -## API +Note: `options.random` and `options.rng` are only meaningful on the very first call to `v1()`, where they may be passed to initialize the internal `node` and `clockseq` fields. -### Version 1 +Example: ```javascript -const uuidv1 = require('uuid/v1'); +import { v1 as uuidv1 } from 'uuid'; -// Incantations -uuidv1(); -uuidv1(options); -uuidv1(options, buffer, offset); +uuidv1(); // ⇨ '2c5ea4c0-4067-11e9-8bad-9b1deb4d3b7d' ``` -Generate and return a RFC4122 v1 (timestamp-based) UUID. - -* `options` - (Object) Optional uuid state to apply. Properties may include: - - * `node` - (Array) Node id as Array of 6 bytes (per 4.1.6). Default: Randomly generated ID. See note 1. - * `clockseq` - (Number between 0 - 0x3fff) RFC clock sequence. Default: An internally maintained clockseq is used. - * `msecs` - (Number) Time in milliseconds since unix Epoch. Default: The current time is used. - * `nsecs` - (Number between 0-9999) additional time, in 100-nanosecond units. Ignored if `msecs` is unspecified. Default: internal uuid counter is used, as per 4.2.1.2. - -* `buffer` - (Array | Buffer) Array or buffer where UUID bytes are to be written. -* `offset` - (Number) Starting index in `buffer` at which to begin writing. - -Returns `buffer`, if specified, otherwise the string form of the UUID - -Note: The default [node id](https://tools.ietf.org/html/rfc4122#section-4.1.6) (the last 12 digits in the UUID) is generated once, randomly, on process startup, and then remains unchanged for the duration of the process. - -Example: Generate string UUID with fully-specified options +Example using `options`: ```javascript +import { v1 as uuidv1 } from 'uuid'; + const v1options = { node: [0x01, 0x23, 0x45, 0x67, 0x89, 0xab], clockseq: 0x1234, msecs: new Date('2011-11-01').getTime(), - nsecs: 5678 + nsecs: 5678, }; uuidv1(v1options); // ⇨ '710b962e-041c-11e1-9234-0123456789ab' - ``` -Example: In-place generation of two binary IDs - -```javascript -// Generate two ids in an array -const arr = new Array(); -uuidv1(null, arr, 0); // ⇨ [ 44, 94, 164, 192, 64, 103, 17, 233, 146, 52, 155, 29, 235, 77, 59, 125 ] -uuidv1(null, arr, 16); // ⇨ [ 44, 94, 164, 192, 64, 103, 17, 233, 146, 52, 155, 29, 235, 77, 59, 125, 44, 94, 164, 193, 64, 103, 17, 233, 146, 52, 155, 29, 235, 77, 59, 125 ] - -``` +### uuid.v3(name, namespace[, buffer[, offset]]) -### Version 3 +Create an RFC version 3 (namespace w/ MD5) UUID -```javascript -const uuidv3 = require('uuid/v3'); +API is identical to `v5()`, but uses "v3" instead. -// Incantations -uuidv3(name, namespace); -uuidv3(name, namespace, buffer); -uuidv3(name, namespace, buffer, offset); -``` +⚠️ Note: Per the RFC, "_If backward compatibility is not an issue, SHA-1 [Version 5] is preferred_." -Generate and return a RFC4122 v3 UUID. +### uuid.v4([options[, buffer[, offset]]]) -* `name` - (String | Array[]) "name" to create UUID with -* `namespace` - (String | Array[]) "namespace" UUID either as a String or Array[16] of byte values -* `buffer` - (Array | Buffer) Array or buffer where UUID bytes are to be written. -* `offset` - (Number) Starting index in `buffer` at which to begin writing. Default = 0 +Create an RFC version 4 (random) UUID -Returns `buffer`, if specified, otherwise the string form of the UUID +| | | +| --- | --- | +| [`options`] | `Object` with one or more of the following properties: | +| [`options.random`] | `Array` of 16 random bytes (0-255) | +| [`options.rng`] | Alternative to `options.random`, a `Function` that returns an `Array` of 16 random bytes (0-255) | +| [`buffer`] | `Array \| Buffer` If specified, uuid will be written here in byte-form, starting at `offset` | +| [`offset` = 0] | `Number` Index to start writing UUID bytes in `buffer` | +| _returns_ | UUID `String` if no `buffer` is specified, otherwise returns `buffer` | Example: ```javascript -uuidv3('hello world', MY_NAMESPACE); // ⇨ '042ffd34-d989-321c-ad06-f60826172424' +import { v4 as uuidv4 } from 'uuid'; +uuidv4(); // ⇨ '1b9d6bcd-bbfd-4b2d-9b5d-ab8dfbbd4bed' ``` -### Version 4 +Example using predefined `random` values: ```javascript -const uuidv4 = require('uuid/v4') +import { v4 as uuidv4 } from 'uuid'; -// Incantations -uuidv4(); -uuidv4(options); -uuidv4(options, buffer, offset); +const v4options = { + random: [ + 0x10, + 0x91, + 0x56, + 0xbe, + 0xc4, + 0xfb, + 0xc1, + 0xea, + 0x71, + 0xb4, + 0xef, + 0xe1, + 0x67, + 0x1c, + 0x58, + 0x36, + ], +}; +uuidv4(v4options); // ⇨ '109156be-c4fb-41ea-b1b4-efe1671c5836' ``` -Generate and return a RFC4122 v4 UUID. +### uuid.v5(name, namespace[, buffer[, offset]]) -* `options` - (Object) Optional uuid state to apply. Properties may include: - * `random` - (Number[16]) Array of 16 numbers (0-255) to use in place of randomly generated values - * `rng` - (Function) Random # generator function that returns an Array[16] of byte values (0-255) -* `buffer` - (Array | Buffer) Array or buffer where UUID bytes are to be written. -* `offset` - (Number) Starting index in `buffer` at which to begin writing. +Createa an RFC version 5 (namespace w/ SHA-1) UUID -Returns `buffer`, if specified, otherwise the string form of the UUID +| | | +| --- | --- | +| `name` | `String \| Array` | +| `namespace` | `String \| Array[16]` Namespace UUID | +| [`buffer`] | `Array \| Buffer` If specified, uuid will be written here in byte-form, starting at `offset` | +| [`offset` = 0] | `Number` Index to start writing UUID bytes in `buffer` | +| _returns_ | UUID `String` if no `buffer` is specified, otherwise returns `buffer` | -Example: Generate string UUID with predefined `random` values +Note: The RFC `DNS` and `URL` namespaces are available as `v5.DNS` and `v5.URL`. + +Example with custom namespace: ```javascript -const v4options = { - random: [ - 0x10, 0x91, 0x56, 0xbe, 0xc4, 0xfb, 0xc1, 0xea, - 0x71, 0xb4, 0xef, 0xe1, 0x67, 0x1c, 0x58, 0x36 - ] -}; -uuidv4(v4options); // ⇨ '109156be-c4fb-41ea-b1b4-efe1671c5836' +import { v5 as uuidv5 } from 'uuid'; +// Define a custom namespace. Readers, create your own using something like +// https://www.uuidgenerator.net/ +const MY_NAMESPACE = '1b671a64-40d5-491e-99b0-da01ff1f3341'; + +uuidv5('Hello, World!', MY_NAMESPACE); // ⇨ '630eb68f-e0fa-5ecc-887a-7c7a62614681' ``` -Example: Generate two IDs in a single buffer +Example with RFC `URL` namespace: ```javascript -const buffer = new Array(); -uuidv4(null, buffer, 0); // ⇨ [ 155, 29, 235, 77, 59, 125, 75, 173, 155, 221, 43, 13, 123, 61, 203, 109 ] -uuidv4(null, buffer, 16); // ⇨ [ 155, 29, 235, 77, 59, 125, 75, 173, 155, 221, 43, 13, 123, 61, 203, 109, 27, 157, 107, 205, 187, 253, 75, 45, 155, 93, 171, 141, 251, 189, 75, 237 ] +import { v5 as uuidv5 } from 'uuid'; +uuidv5('https://www.w3.org/', uuidv5.URL); // ⇨ 'c106a26a-21bb-5538-8bf2-57095d1976c1' ``` -### Version 5 +### uuid.validate(str) + +Test a string to see if it is a valid UUID + +| | | +| --------- | --------------------------------------------------- | +| `str` | `String` to validate | +| _returns_ | `true` if string is a valid UUID, `false` otherwise | + +Example: ```javascript -const uuidv5 = require('uuid/v5'); +import { validate as uuidValidate } from 'uuid'; -// Incantations -uuidv5(name, namespace); -uuidv5(name, namespace, buffer); -uuidv5(name, namespace, buffer, offset); +uuidValidate('not a UUID'); // ⇨ false +uuidValidate('6ec0bd7f-11c0-43da-975e-2a8ad9ebae0b'); // ⇨ true ``` -Generate and return a RFC4122 v5 UUID. +### uuid.version(str) -* `name` - (String | Array[]) "name" to create UUID with -* `namespace` - (String | Array[]) "namespace" UUID either as a String or Array[16] of byte values -* `buffer` - (Array | Buffer) Array or buffer where UUID bytes are to be written. -* `offset` - (Number) Starting index in `buffer` at which to begin writing. Default = 0 +Detect RFC version of a UUID -Returns `buffer`, if specified, otherwise the string form of the UUID +| | | +| --------- | ---------------------------------------- | +| `str` | A valid UUID `String` | +| _returns_ | `Number` The RFC version of the UUID | +| _throws_ | `TypeError` if `str` is not a valid UUID | Example: ```javascript -uuidv5('hello world', MY_NAMESPACE); // ⇨ '9f282611-e0fd-5650-8953-89c8e342da0b' +import { version as uuidVersion } from 'uuid'; +uuidVersion('45637ec4-c85f-11ea-87d0-0242ac130003'); // ⇨ 1 +uuidVersion('6ec0bd7f-11c0-43da-975e-2a8ad9ebae0b'); // ⇨ 4 ``` ## Command Line -UUIDs can be generated from the command line with the `uuid` command. +UUIDs can be generated from the command line using `uuid`. ```shell $ uuid ddeb27fb-d9a0-4624-be4d-4615062daed4 +``` -$ uuid v1 -02d37060-d446-11e7-a9fa-7bdae751ebe1 +The default is to generate version 4 UUIDS, however the other versions are supported. Type `uuid --help` for details: + +```shell +$ uuid --help + +Usage: + uuid + uuid v1 + uuid v3 + uuid v4 + uuid v5 + uuid --help + +Note: may be "URL" or "DNS" to use the corresponding UUIDs +defined by RFC4122 ``` -Type `uuid --help` for usage details +## ECMAScript Modules -## Testing +This library comes with [ECMAScript Modules](https://www.ecma-international.org/ecma-262/6.0/#sec-modules) (ESM) support for Node.js versions that support it ([example](./examples/node-esmodules/)) as well as bundlers like [rollup.js](https://rollupjs.org/guide/en/#tree-shaking) ([example](./examples/browser-rollup/)) and [webpack](https://webpack.js.org/guides/tree-shaking/) ([example](./examples/browser-webpack/)) (targeting both, Node.js and browser environments). + +```javascript +import { v4 as uuidv4 } from 'uuid'; +uuidv4(); // ⇨ '1b9d6bcd-bbfd-4b2d-9b5d-ab8dfbbd4bed' +``` + +To run the examples you must first create a dist build of this library in the module root: ```shell -npm test +npm run build +``` + +## CDN Builds + +### ECMAScript Modules + +To load this module directly into modern browsers that [support loading ECMAScript Modules](https://caniuse.com/#feat=es6-module) you can make use of [jspm](https://jspm.org/): + +```html + +``` + +### UMD + +To load this module directly into older browsers you can use the [UMD (Universal Module Definition)](https://github.com/umdjs/umd) builds from any of the following CDNs: + +**Using [UNPKG](https://unpkg.com/uuid@latest/dist/umd/)**: + +```html + +``` + +**Using [jsDelivr](https://cdn.jsdelivr.net/npm/uuid@latest/dist/umd/)**: + +```html + +``` + +**Using [cdnjs](https://cdnjs.com/libraries/uuid)**: + +```html + +``` + +These CDNs all provide the same [`uuidv4()`](#uuidv4options-buffer-offset) method: + +```html + +``` + +Methods for the other algorithms ([`uuidv1()`](#uuidv1options-buffer-offset), [`uuidv3()`](#uuidv3name-namespace-buffer-offset) and [`uuidv5()`](#uuidv5name-namespace-buffer-offset)) are available from the files `uuidv1.min.js`, `uuidv3.min.js` and `uuidv5.min.js` respectively. + +## "getRandomValues() not supported" + +This error occurs in environments where the standard [`crypto.getRandomValues()`](https://developer.mozilla.org/en-US/docs/Web/API/Crypto/getRandomValues) API is not supported. This issue can be resolved by adding an appropriate polyfill: + +### React Native / Expo + +1. Install [`react-native-get-random-values`](https://github.com/LinusU/react-native-get-random-values#readme) +1. Import it _before_ `uuid`. Since `uuid` might also appear as a transitive dependency of some other imports it's safest to just import `react-native-get-random-values` as the very first thing in your entry point: + +```javascript +import 'react-native-get-random-values'; +import { v4 as uuidv4 } from 'uuid'; +``` + +Note: If you are using Expo, you must be using at least `react-native-get-random-values@1.5.0` and `expo@39.0.0`. + +### Web Workers / Service Workers (Edge <= 18) + +[In Edge <= 18, Web Crypto is not supported in Web Workers or Service Workers](https://caniuse.com/#feat=cryptography) and we are not aware of a polyfill (let us know if you find one, please). + +## Upgrading From `uuid@7.x` + +### Only Named Exports Supported When Using with Node.js ESM + +`uuid@7.x` did not come with native ECMAScript Module (ESM) support for Node.js. Importing it in Node.js ESM consequently imported the CommonJS source with a default export. This library now comes with true Node.js ESM support and only provides named exports. + +Instead of doing: + +```javascript +import uuid from 'uuid'; +uuid.v4(); +``` + +you will now have to use the named exports: + +```javascript +import { v4 as uuidv4 } from 'uuid'; +uuidv4(); ``` +### Deep Requires No Longer Supported + +Deep requires like `require('uuid/v4')` [which have been deprecated in `uuid@7.x`](#deep-requires-now-deprecated) are no longer supported. + +## Upgrading From `uuid@3.x` + +"_Wait... what happened to `uuid@4.x` - `uuid@6.x`?!?_" + +In order to avoid confusion with RFC [version 4](#uuidv4options-buffer-offset) and [version 5](#uuidv5name-namespace-buffer-offset) UUIDs, and a possible [version 6](http://gh.peabody.io/uuidv6/), releases 4 thru 6 of this module have been skipped. + +### Deep Requires Now Deprecated + +`uuid@3.x` encouraged the use of deep requires to minimize the bundle size of browser builds: + +```javascript +const uuidv4 = require('uuid/v4'); // <== NOW DEPRECATED! +uuidv4(); +``` + +As of `uuid@7.x` this library now provides ECMAScript modules builds, which allow packagers like Webpack and Rollup to do "tree-shaking" to remove dead code. Instead, use the `import` syntax: + +```javascript +import { v4 as uuidv4 } from 'uuid'; +uuidv4(); +``` + +... or for CommonJS: + +```javascript +const { v4: uuidv4 } = require('uuid'); +uuidv4(); +``` + +### Default Export Removed + +`uuid@3.x` was exporting the Version 4 UUID method as a default export: + +```javascript +const uuid = require('uuid'); // <== REMOVED! +``` + +This usage pattern was already discouraged in `uuid@3.x` and has been removed in `uuid@7.x`. + ---- Markdown generated from [README_js.md](README_js.md) by [![RunMD Logo](http://i.imgur.com/h0FVyzU.png)](https://github.com/broofa/runmd) \ No newline at end of file diff --git a/deps/npm/node_modules/uuid/dist/bin/uuid b/deps/npm/node_modules/uuid/dist/bin/uuid new file mode 100755 index 00000000000000..f38d2ee19e7d35 --- /dev/null +++ b/deps/npm/node_modules/uuid/dist/bin/uuid @@ -0,0 +1,2 @@ +#!/usr/bin/env node +require('../uuid-bin'); diff --git a/deps/npm/node_modules/uuid/dist/esm-browser/index.js b/deps/npm/node_modules/uuid/dist/esm-browser/index.js new file mode 100644 index 00000000000000..1db6f6d25b2b6a --- /dev/null +++ b/deps/npm/node_modules/uuid/dist/esm-browser/index.js @@ -0,0 +1,9 @@ +export { default as v1 } from './v1.js'; +export { default as v3 } from './v3.js'; +export { default as v4 } from './v4.js'; +export { default as v5 } from './v5.js'; +export { default as NIL } from './nil.js'; +export { default as version } from './version.js'; +export { default as validate } from './validate.js'; +export { default as stringify } from './stringify.js'; +export { default as parse } from './parse.js'; \ No newline at end of file diff --git a/deps/npm/node_modules/uuid/dist/esm-browser/md5.js b/deps/npm/node_modules/uuid/dist/esm-browser/md5.js new file mode 100644 index 00000000000000..8b5d46a7e4c5c2 --- /dev/null +++ b/deps/npm/node_modules/uuid/dist/esm-browser/md5.js @@ -0,0 +1,215 @@ +/* + * Browser-compatible JavaScript MD5 + * + * Modification of JavaScript MD5 + * https://github.com/blueimp/JavaScript-MD5 + * + * Copyright 2011, Sebastian Tschan + * https://blueimp.net + * + * Licensed under the MIT license: + * https://opensource.org/licenses/MIT + * + * Based on + * A JavaScript implementation of the RSA Data Security, Inc. MD5 Message + * Digest Algorithm, as defined in RFC 1321. + * Version 2.2 Copyright (C) Paul Johnston 1999 - 2009 + * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet + * Distributed under the BSD License + * See http://pajhome.org.uk/crypt/md5 for more info. + */ +function md5(bytes) { + if (typeof bytes === 'string') { + var msg = unescape(encodeURIComponent(bytes)); // UTF8 escape + + bytes = new Uint8Array(msg.length); + + for (var i = 0; i < msg.length; ++i) { + bytes[i] = msg.charCodeAt(i); + } + } + + return md5ToHexEncodedArray(wordsToMd5(bytesToWords(bytes), bytes.length * 8)); +} +/* + * Convert an array of little-endian words to an array of bytes + */ + + +function md5ToHexEncodedArray(input) { + var output = []; + var length32 = input.length * 32; + var hexTab = '0123456789abcdef'; + + for (var i = 0; i < length32; i += 8) { + var x = input[i >> 5] >>> i % 32 & 0xff; + var hex = parseInt(hexTab.charAt(x >>> 4 & 0x0f) + hexTab.charAt(x & 0x0f), 16); + output.push(hex); + } + + return output; +} +/** + * Calculate output length with padding and bit length + */ + + +function getOutputLength(inputLength8) { + return (inputLength8 + 64 >>> 9 << 4) + 14 + 1; +} +/* + * Calculate the MD5 of an array of little-endian words, and a bit length. + */ + + +function wordsToMd5(x, len) { + /* append padding */ + x[len >> 5] |= 0x80 << len % 32; + x[getOutputLength(len) - 1] = len; + var a = 1732584193; + var b = -271733879; + var c = -1732584194; + var d = 271733878; + + for (var i = 0; i < x.length; i += 16) { + var olda = a; + var oldb = b; + var oldc = c; + var oldd = d; + a = md5ff(a, b, c, d, x[i], 7, -680876936); + d = md5ff(d, a, b, c, x[i + 1], 12, -389564586); + c = md5ff(c, d, a, b, x[i + 2], 17, 606105819); + b = md5ff(b, c, d, a, x[i + 3], 22, -1044525330); + a = md5ff(a, b, c, d, x[i + 4], 7, -176418897); + d = md5ff(d, a, b, c, x[i + 5], 12, 1200080426); + c = md5ff(c, d, a, b, x[i + 6], 17, -1473231341); + b = md5ff(b, c, d, a, x[i + 7], 22, -45705983); + a = md5ff(a, b, c, d, x[i + 8], 7, 1770035416); + d = md5ff(d, a, b, c, x[i + 9], 12, -1958414417); + c = md5ff(c, d, a, b, x[i + 10], 17, -42063); + b = md5ff(b, c, d, a, x[i + 11], 22, -1990404162); + a = md5ff(a, b, c, d, x[i + 12], 7, 1804603682); + d = md5ff(d, a, b, c, x[i + 13], 12, -40341101); + c = md5ff(c, d, a, b, x[i + 14], 17, -1502002290); + b = md5ff(b, c, d, a, x[i + 15], 22, 1236535329); + a = md5gg(a, b, c, d, x[i + 1], 5, -165796510); + d = md5gg(d, a, b, c, x[i + 6], 9, -1069501632); + c = md5gg(c, d, a, b, x[i + 11], 14, 643717713); + b = md5gg(b, c, d, a, x[i], 20, -373897302); + a = md5gg(a, b, c, d, x[i + 5], 5, -701558691); + d = md5gg(d, a, b, c, x[i + 10], 9, 38016083); + c = md5gg(c, d, a, b, x[i + 15], 14, -660478335); + b = md5gg(b, c, d, a, x[i + 4], 20, -405537848); + a = md5gg(a, b, c, d, x[i + 9], 5, 568446438); + d = md5gg(d, a, b, c, x[i + 14], 9, -1019803690); + c = md5gg(c, d, a, b, x[i + 3], 14, -187363961); + b = md5gg(b, c, d, a, x[i + 8], 20, 1163531501); + a = md5gg(a, b, c, d, x[i + 13], 5, -1444681467); + d = md5gg(d, a, b, c, x[i + 2], 9, -51403784); + c = md5gg(c, d, a, b, x[i + 7], 14, 1735328473); + b = md5gg(b, c, d, a, x[i + 12], 20, -1926607734); + a = md5hh(a, b, c, d, x[i + 5], 4, -378558); + d = md5hh(d, a, b, c, x[i + 8], 11, -2022574463); + c = md5hh(c, d, a, b, x[i + 11], 16, 1839030562); + b = md5hh(b, c, d, a, x[i + 14], 23, -35309556); + a = md5hh(a, b, c, d, x[i + 1], 4, -1530992060); + d = md5hh(d, a, b, c, x[i + 4], 11, 1272893353); + c = md5hh(c, d, a, b, x[i + 7], 16, -155497632); + b = md5hh(b, c, d, a, x[i + 10], 23, -1094730640); + a = md5hh(a, b, c, d, x[i + 13], 4, 681279174); + d = md5hh(d, a, b, c, x[i], 11, -358537222); + c = md5hh(c, d, a, b, x[i + 3], 16, -722521979); + b = md5hh(b, c, d, a, x[i + 6], 23, 76029189); + a = md5hh(a, b, c, d, x[i + 9], 4, -640364487); + d = md5hh(d, a, b, c, x[i + 12], 11, -421815835); + c = md5hh(c, d, a, b, x[i + 15], 16, 530742520); + b = md5hh(b, c, d, a, x[i + 2], 23, -995338651); + a = md5ii(a, b, c, d, x[i], 6, -198630844); + d = md5ii(d, a, b, c, x[i + 7], 10, 1126891415); + c = md5ii(c, d, a, b, x[i + 14], 15, -1416354905); + b = md5ii(b, c, d, a, x[i + 5], 21, -57434055); + a = md5ii(a, b, c, d, x[i + 12], 6, 1700485571); + d = md5ii(d, a, b, c, x[i + 3], 10, -1894986606); + c = md5ii(c, d, a, b, x[i + 10], 15, -1051523); + b = md5ii(b, c, d, a, x[i + 1], 21, -2054922799); + a = md5ii(a, b, c, d, x[i + 8], 6, 1873313359); + d = md5ii(d, a, b, c, x[i + 15], 10, -30611744); + c = md5ii(c, d, a, b, x[i + 6], 15, -1560198380); + b = md5ii(b, c, d, a, x[i + 13], 21, 1309151649); + a = md5ii(a, b, c, d, x[i + 4], 6, -145523070); + d = md5ii(d, a, b, c, x[i + 11], 10, -1120210379); + c = md5ii(c, d, a, b, x[i + 2], 15, 718787259); + b = md5ii(b, c, d, a, x[i + 9], 21, -343485551); + a = safeAdd(a, olda); + b = safeAdd(b, oldb); + c = safeAdd(c, oldc); + d = safeAdd(d, oldd); + } + + return [a, b, c, d]; +} +/* + * Convert an array bytes to an array of little-endian words + * Characters >255 have their high-byte silently ignored. + */ + + +function bytesToWords(input) { + if (input.length === 0) { + return []; + } + + var length8 = input.length * 8; + var output = new Uint32Array(getOutputLength(length8)); + + for (var i = 0; i < length8; i += 8) { + output[i >> 5] |= (input[i / 8] & 0xff) << i % 32; + } + + return output; +} +/* + * Add integers, wrapping at 2^32. This uses 16-bit operations internally + * to work around bugs in some JS interpreters. + */ + + +function safeAdd(x, y) { + var lsw = (x & 0xffff) + (y & 0xffff); + var msw = (x >> 16) + (y >> 16) + (lsw >> 16); + return msw << 16 | lsw & 0xffff; +} +/* + * Bitwise rotate a 32-bit number to the left. + */ + + +function bitRotateLeft(num, cnt) { + return num << cnt | num >>> 32 - cnt; +} +/* + * These functions implement the four basic operations the algorithm uses. + */ + + +function md5cmn(q, a, b, x, s, t) { + return safeAdd(bitRotateLeft(safeAdd(safeAdd(a, q), safeAdd(x, t)), s), b); +} + +function md5ff(a, b, c, d, x, s, t) { + return md5cmn(b & c | ~b & d, a, b, x, s, t); +} + +function md5gg(a, b, c, d, x, s, t) { + return md5cmn(b & d | c & ~d, a, b, x, s, t); +} + +function md5hh(a, b, c, d, x, s, t) { + return md5cmn(b ^ c ^ d, a, b, x, s, t); +} + +function md5ii(a, b, c, d, x, s, t) { + return md5cmn(c ^ (b | ~d), a, b, x, s, t); +} + +export default md5; \ No newline at end of file diff --git a/deps/npm/node_modules/uuid/dist/esm-browser/nil.js b/deps/npm/node_modules/uuid/dist/esm-browser/nil.js new file mode 100644 index 00000000000000..b36324c2aa3faa --- /dev/null +++ b/deps/npm/node_modules/uuid/dist/esm-browser/nil.js @@ -0,0 +1 @@ +export default '00000000-0000-0000-0000-000000000000'; \ No newline at end of file diff --git a/deps/npm/node_modules/uuid/dist/esm-browser/parse.js b/deps/npm/node_modules/uuid/dist/esm-browser/parse.js new file mode 100644 index 00000000000000..7c5b1d5a6b0210 --- /dev/null +++ b/deps/npm/node_modules/uuid/dist/esm-browser/parse.js @@ -0,0 +1,35 @@ +import validate from './validate.js'; + +function parse(uuid) { + if (!validate(uuid)) { + throw TypeError('Invalid UUID'); + } + + var v; + var arr = new Uint8Array(16); // Parse ########-....-....-....-............ + + arr[0] = (v = parseInt(uuid.slice(0, 8), 16)) >>> 24; + arr[1] = v >>> 16 & 0xff; + arr[2] = v >>> 8 & 0xff; + arr[3] = v & 0xff; // Parse ........-####-....-....-............ + + arr[4] = (v = parseInt(uuid.slice(9, 13), 16)) >>> 8; + arr[5] = v & 0xff; // Parse ........-....-####-....-............ + + arr[6] = (v = parseInt(uuid.slice(14, 18), 16)) >>> 8; + arr[7] = v & 0xff; // Parse ........-....-....-####-............ + + arr[8] = (v = parseInt(uuid.slice(19, 23), 16)) >>> 8; + arr[9] = v & 0xff; // Parse ........-....-....-....-############ + // (Use "/" to avoid 32-bit truncation when bit-shifting high-order bytes) + + arr[10] = (v = parseInt(uuid.slice(24, 36), 16)) / 0x10000000000 & 0xff; + arr[11] = v / 0x100000000 & 0xff; + arr[12] = v >>> 24 & 0xff; + arr[13] = v >>> 16 & 0xff; + arr[14] = v >>> 8 & 0xff; + arr[15] = v & 0xff; + return arr; +} + +export default parse; \ No newline at end of file diff --git a/deps/npm/node_modules/uuid/dist/esm-browser/regex.js b/deps/npm/node_modules/uuid/dist/esm-browser/regex.js new file mode 100644 index 00000000000000..3da8673a5cdf3c --- /dev/null +++ b/deps/npm/node_modules/uuid/dist/esm-browser/regex.js @@ -0,0 +1 @@ +export default /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i; \ No newline at end of file diff --git a/deps/npm/node_modules/uuid/dist/esm-browser/rng.js b/deps/npm/node_modules/uuid/dist/esm-browser/rng.js new file mode 100644 index 00000000000000..a12aefaa7f466b --- /dev/null +++ b/deps/npm/node_modules/uuid/dist/esm-browser/rng.js @@ -0,0 +1,14 @@ +// Unique ID creation requires a high quality random # generator. In the browser we therefore +// require the crypto API and do not support built-in fallback to lower quality random number +// generators (like Math.random()). +// getRandomValues needs to be invoked in a context where "this" is a Crypto implementation. Also, +// find the complete implementation of crypto (msCrypto) on IE11. +var getRandomValues = typeof crypto !== 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto) || typeof msCrypto !== 'undefined' && typeof msCrypto.getRandomValues === 'function' && msCrypto.getRandomValues.bind(msCrypto); +var rnds8 = new Uint8Array(16); +export default function rng() { + if (!getRandomValues) { + throw new Error('crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported'); + } + + return getRandomValues(rnds8); +} \ No newline at end of file diff --git a/deps/npm/node_modules/uuid/dist/esm-browser/sha1.js b/deps/npm/node_modules/uuid/dist/esm-browser/sha1.js new file mode 100644 index 00000000000000..940548baa840ab --- /dev/null +++ b/deps/npm/node_modules/uuid/dist/esm-browser/sha1.js @@ -0,0 +1,96 @@ +// Adapted from Chris Veness' SHA1 code at +// http://www.movable-type.co.uk/scripts/sha1.html +function f(s, x, y, z) { + switch (s) { + case 0: + return x & y ^ ~x & z; + + case 1: + return x ^ y ^ z; + + case 2: + return x & y ^ x & z ^ y & z; + + case 3: + return x ^ y ^ z; + } +} + +function ROTL(x, n) { + return x << n | x >>> 32 - n; +} + +function sha1(bytes) { + var K = [0x5a827999, 0x6ed9eba1, 0x8f1bbcdc, 0xca62c1d6]; + var H = [0x67452301, 0xefcdab89, 0x98badcfe, 0x10325476, 0xc3d2e1f0]; + + if (typeof bytes === 'string') { + var msg = unescape(encodeURIComponent(bytes)); // UTF8 escape + + bytes = []; + + for (var i = 0; i < msg.length; ++i) { + bytes.push(msg.charCodeAt(i)); + } + } else if (!Array.isArray(bytes)) { + // Convert Array-like to Array + bytes = Array.prototype.slice.call(bytes); + } + + bytes.push(0x80); + var l = bytes.length / 4 + 2; + var N = Math.ceil(l / 16); + var M = new Array(N); + + for (var _i = 0; _i < N; ++_i) { + var arr = new Uint32Array(16); + + for (var j = 0; j < 16; ++j) { + arr[j] = bytes[_i * 64 + j * 4] << 24 | bytes[_i * 64 + j * 4 + 1] << 16 | bytes[_i * 64 + j * 4 + 2] << 8 | bytes[_i * 64 + j * 4 + 3]; + } + + M[_i] = arr; + } + + M[N - 1][14] = (bytes.length - 1) * 8 / Math.pow(2, 32); + M[N - 1][14] = Math.floor(M[N - 1][14]); + M[N - 1][15] = (bytes.length - 1) * 8 & 0xffffffff; + + for (var _i2 = 0; _i2 < N; ++_i2) { + var W = new Uint32Array(80); + + for (var t = 0; t < 16; ++t) { + W[t] = M[_i2][t]; + } + + for (var _t = 16; _t < 80; ++_t) { + W[_t] = ROTL(W[_t - 3] ^ W[_t - 8] ^ W[_t - 14] ^ W[_t - 16], 1); + } + + var a = H[0]; + var b = H[1]; + var c = H[2]; + var d = H[3]; + var e = H[4]; + + for (var _t2 = 0; _t2 < 80; ++_t2) { + var s = Math.floor(_t2 / 20); + var T = ROTL(a, 5) + f(s, b, c, d) + e + K[s] + W[_t2] >>> 0; + e = d; + d = c; + c = ROTL(b, 30) >>> 0; + b = a; + a = T; + } + + H[0] = H[0] + a >>> 0; + H[1] = H[1] + b >>> 0; + H[2] = H[2] + c >>> 0; + H[3] = H[3] + d >>> 0; + H[4] = H[4] + e >>> 0; + } + + return [H[0] >> 24 & 0xff, H[0] >> 16 & 0xff, H[0] >> 8 & 0xff, H[0] & 0xff, H[1] >> 24 & 0xff, H[1] >> 16 & 0xff, H[1] >> 8 & 0xff, H[1] & 0xff, H[2] >> 24 & 0xff, H[2] >> 16 & 0xff, H[2] >> 8 & 0xff, H[2] & 0xff, H[3] >> 24 & 0xff, H[3] >> 16 & 0xff, H[3] >> 8 & 0xff, H[3] & 0xff, H[4] >> 24 & 0xff, H[4] >> 16 & 0xff, H[4] >> 8 & 0xff, H[4] & 0xff]; +} + +export default sha1; \ No newline at end of file diff --git a/deps/npm/node_modules/uuid/dist/esm-browser/stringify.js b/deps/npm/node_modules/uuid/dist/esm-browser/stringify.js new file mode 100644 index 00000000000000..310211158db7ae --- /dev/null +++ b/deps/npm/node_modules/uuid/dist/esm-browser/stringify.js @@ -0,0 +1,30 @@ +import validate from './validate.js'; +/** + * Convert array of 16 byte values to UUID string format of the form: + * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX + */ + +var byteToHex = []; + +for (var i = 0; i < 256; ++i) { + byteToHex.push((i + 0x100).toString(16).substr(1)); +} + +function stringify(arr) { + var offset = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; + // Note: Be careful editing this code! It's been tuned for performance + // and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434 + var uuid = (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + '-' + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + '-' + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + '-' + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + '-' + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase(); // Consistency check for valid UUID. If this throws, it's likely due to one + // of the following: + // - One or more input array values don't map to a hex octet (leading to + // "undefined" in the uuid) + // - Invalid input values for the RFC `version` or `variant` fields + + if (!validate(uuid)) { + throw TypeError('Stringified UUID is invalid'); + } + + return uuid; +} + +export default stringify; \ No newline at end of file diff --git a/deps/npm/node_modules/uuid/dist/esm-browser/v1.js b/deps/npm/node_modules/uuid/dist/esm-browser/v1.js new file mode 100644 index 00000000000000..1a22591ef1eb8f --- /dev/null +++ b/deps/npm/node_modules/uuid/dist/esm-browser/v1.js @@ -0,0 +1,95 @@ +import rng from './rng.js'; +import stringify from './stringify.js'; // **`v1()` - Generate time-based UUID** +// +// Inspired by https://github.com/LiosK/UUID.js +// and http://docs.python.org/library/uuid.html + +var _nodeId; + +var _clockseq; // Previous uuid creation time + + +var _lastMSecs = 0; +var _lastNSecs = 0; // See https://github.com/uuidjs/uuid for API details + +function v1(options, buf, offset) { + var i = buf && offset || 0; + var b = buf || new Array(16); + options = options || {}; + var node = options.node || _nodeId; + var clockseq = options.clockseq !== undefined ? options.clockseq : _clockseq; // node and clockseq need to be initialized to random values if they're not + // specified. We do this lazily to minimize issues related to insufficient + // system entropy. See #189 + + if (node == null || clockseq == null) { + var seedBytes = options.random || (options.rng || rng)(); + + if (node == null) { + // Per 4.5, create and 48-bit node id, (47 random bits + multicast bit = 1) + node = _nodeId = [seedBytes[0] | 0x01, seedBytes[1], seedBytes[2], seedBytes[3], seedBytes[4], seedBytes[5]]; + } + + if (clockseq == null) { + // Per 4.2.2, randomize (14 bit) clockseq + clockseq = _clockseq = (seedBytes[6] << 8 | seedBytes[7]) & 0x3fff; + } + } // UUID timestamps are 100 nano-second units since the Gregorian epoch, + // (1582-10-15 00:00). JSNumbers aren't precise enough for this, so + // time is handled internally as 'msecs' (integer milliseconds) and 'nsecs' + // (100-nanoseconds offset from msecs) since unix epoch, 1970-01-01 00:00. + + + var msecs = options.msecs !== undefined ? options.msecs : Date.now(); // Per 4.2.1.2, use count of uuid's generated during the current clock + // cycle to simulate higher resolution clock + + var nsecs = options.nsecs !== undefined ? options.nsecs : _lastNSecs + 1; // Time since last uuid creation (in msecs) + + var dt = msecs - _lastMSecs + (nsecs - _lastNSecs) / 10000; // Per 4.2.1.2, Bump clockseq on clock regression + + if (dt < 0 && options.clockseq === undefined) { + clockseq = clockseq + 1 & 0x3fff; + } // Reset nsecs if clock regresses (new clockseq) or we've moved onto a new + // time interval + + + if ((dt < 0 || msecs > _lastMSecs) && options.nsecs === undefined) { + nsecs = 0; + } // Per 4.2.1.2 Throw error if too many uuids are requested + + + if (nsecs >= 10000) { + throw new Error("uuid.v1(): Can't create more than 10M uuids/sec"); + } + + _lastMSecs = msecs; + _lastNSecs = nsecs; + _clockseq = clockseq; // Per 4.1.4 - Convert from unix epoch to Gregorian epoch + + msecs += 12219292800000; // `time_low` + + var tl = ((msecs & 0xfffffff) * 10000 + nsecs) % 0x100000000; + b[i++] = tl >>> 24 & 0xff; + b[i++] = tl >>> 16 & 0xff; + b[i++] = tl >>> 8 & 0xff; + b[i++] = tl & 0xff; // `time_mid` + + var tmh = msecs / 0x100000000 * 10000 & 0xfffffff; + b[i++] = tmh >>> 8 & 0xff; + b[i++] = tmh & 0xff; // `time_high_and_version` + + b[i++] = tmh >>> 24 & 0xf | 0x10; // include version + + b[i++] = tmh >>> 16 & 0xff; // `clock_seq_hi_and_reserved` (Per 4.2.2 - include variant) + + b[i++] = clockseq >>> 8 | 0x80; // `clock_seq_low` + + b[i++] = clockseq & 0xff; // `node` + + for (var n = 0; n < 6; ++n) { + b[i + n] = node[n]; + } + + return buf || stringify(b); +} + +export default v1; \ No newline at end of file diff --git a/deps/npm/node_modules/uuid/dist/esm-browser/v3.js b/deps/npm/node_modules/uuid/dist/esm-browser/v3.js new file mode 100644 index 00000000000000..c9ab9a4cd78d32 --- /dev/null +++ b/deps/npm/node_modules/uuid/dist/esm-browser/v3.js @@ -0,0 +1,4 @@ +import v35 from './v35.js'; +import md5 from './md5.js'; +var v3 = v35('v3', 0x30, md5); +export default v3; \ No newline at end of file diff --git a/deps/npm/node_modules/uuid/dist/esm-browser/v35.js b/deps/npm/node_modules/uuid/dist/esm-browser/v35.js new file mode 100644 index 00000000000000..31dd8a1c89b167 --- /dev/null +++ b/deps/npm/node_modules/uuid/dist/esm-browser/v35.js @@ -0,0 +1,64 @@ +import stringify from './stringify.js'; +import parse from './parse.js'; + +function stringToBytes(str) { + str = unescape(encodeURIComponent(str)); // UTF8 escape + + var bytes = []; + + for (var i = 0; i < str.length; ++i) { + bytes.push(str.charCodeAt(i)); + } + + return bytes; +} + +export var DNS = '6ba7b810-9dad-11d1-80b4-00c04fd430c8'; +export var URL = '6ba7b811-9dad-11d1-80b4-00c04fd430c8'; +export default function (name, version, hashfunc) { + function generateUUID(value, namespace, buf, offset) { + if (typeof value === 'string') { + value = stringToBytes(value); + } + + if (typeof namespace === 'string') { + namespace = parse(namespace); + } + + if (namespace.length !== 16) { + throw TypeError('Namespace must be array-like (16 iterable integer values, 0-255)'); + } // Compute hash of namespace and value, Per 4.3 + // Future: Use spread syntax when supported on all platforms, e.g. `bytes = + // hashfunc([...namespace, ... value])` + + + var bytes = new Uint8Array(16 + value.length); + bytes.set(namespace); + bytes.set(value, namespace.length); + bytes = hashfunc(bytes); + bytes[6] = bytes[6] & 0x0f | version; + bytes[8] = bytes[8] & 0x3f | 0x80; + + if (buf) { + offset = offset || 0; + + for (var i = 0; i < 16; ++i) { + buf[offset + i] = bytes[i]; + } + + return buf; + } + + return stringify(bytes); + } // Function#name is not settable on some platforms (#270) + + + try { + generateUUID.name = name; // eslint-disable-next-line no-empty + } catch (err) {} // For CommonJS default export support + + + generateUUID.DNS = DNS; + generateUUID.URL = URL; + return generateUUID; +} \ No newline at end of file diff --git a/deps/npm/node_modules/uuid/dist/esm-browser/v4.js b/deps/npm/node_modules/uuid/dist/esm-browser/v4.js new file mode 100644 index 00000000000000..404810a488de0a --- /dev/null +++ b/deps/npm/node_modules/uuid/dist/esm-browser/v4.js @@ -0,0 +1,24 @@ +import rng from './rng.js'; +import stringify from './stringify.js'; + +function v4(options, buf, offset) { + options = options || {}; + var rnds = options.random || (options.rng || rng)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved` + + rnds[6] = rnds[6] & 0x0f | 0x40; + rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided + + if (buf) { + offset = offset || 0; + + for (var i = 0; i < 16; ++i) { + buf[offset + i] = rnds[i]; + } + + return buf; + } + + return stringify(rnds); +} + +export default v4; \ No newline at end of file diff --git a/deps/npm/node_modules/uuid/dist/esm-browser/v5.js b/deps/npm/node_modules/uuid/dist/esm-browser/v5.js new file mode 100644 index 00000000000000..c08d96ba0bd928 --- /dev/null +++ b/deps/npm/node_modules/uuid/dist/esm-browser/v5.js @@ -0,0 +1,4 @@ +import v35 from './v35.js'; +import sha1 from './sha1.js'; +var v5 = v35('v5', 0x50, sha1); +export default v5; \ No newline at end of file diff --git a/deps/npm/node_modules/uuid/dist/esm-browser/validate.js b/deps/npm/node_modules/uuid/dist/esm-browser/validate.js new file mode 100644 index 00000000000000..f1cdc7af49bcfc --- /dev/null +++ b/deps/npm/node_modules/uuid/dist/esm-browser/validate.js @@ -0,0 +1,7 @@ +import REGEX from './regex.js'; + +function validate(uuid) { + return typeof uuid === 'string' && REGEX.test(uuid); +} + +export default validate; \ No newline at end of file diff --git a/deps/npm/node_modules/uuid/dist/esm-browser/version.js b/deps/npm/node_modules/uuid/dist/esm-browser/version.js new file mode 100644 index 00000000000000..77530e9cb0e355 --- /dev/null +++ b/deps/npm/node_modules/uuid/dist/esm-browser/version.js @@ -0,0 +1,11 @@ +import validate from './validate.js'; + +function version(uuid) { + if (!validate(uuid)) { + throw TypeError('Invalid UUID'); + } + + return parseInt(uuid.substr(14, 1), 16); +} + +export default version; \ No newline at end of file diff --git a/deps/npm/node_modules/uuid/dist/esm-node/index.js b/deps/npm/node_modules/uuid/dist/esm-node/index.js new file mode 100644 index 00000000000000..1db6f6d25b2b6a --- /dev/null +++ b/deps/npm/node_modules/uuid/dist/esm-node/index.js @@ -0,0 +1,9 @@ +export { default as v1 } from './v1.js'; +export { default as v3 } from './v3.js'; +export { default as v4 } from './v4.js'; +export { default as v5 } from './v5.js'; +export { default as NIL } from './nil.js'; +export { default as version } from './version.js'; +export { default as validate } from './validate.js'; +export { default as stringify } from './stringify.js'; +export { default as parse } from './parse.js'; \ No newline at end of file diff --git a/deps/npm/node_modules/uuid/dist/esm-node/md5.js b/deps/npm/node_modules/uuid/dist/esm-node/md5.js new file mode 100644 index 00000000000000..4d68b040f6c192 --- /dev/null +++ b/deps/npm/node_modules/uuid/dist/esm-node/md5.js @@ -0,0 +1,13 @@ +import crypto from 'crypto'; + +function md5(bytes) { + if (Array.isArray(bytes)) { + bytes = Buffer.from(bytes); + } else if (typeof bytes === 'string') { + bytes = Buffer.from(bytes, 'utf8'); + } + + return crypto.createHash('md5').update(bytes).digest(); +} + +export default md5; \ No newline at end of file diff --git a/deps/npm/node_modules/uuid/dist/esm-node/nil.js b/deps/npm/node_modules/uuid/dist/esm-node/nil.js new file mode 100644 index 00000000000000..b36324c2aa3faa --- /dev/null +++ b/deps/npm/node_modules/uuid/dist/esm-node/nil.js @@ -0,0 +1 @@ +export default '00000000-0000-0000-0000-000000000000'; \ No newline at end of file diff --git a/deps/npm/node_modules/uuid/dist/esm-node/parse.js b/deps/npm/node_modules/uuid/dist/esm-node/parse.js new file mode 100644 index 00000000000000..6421c5d5a08e42 --- /dev/null +++ b/deps/npm/node_modules/uuid/dist/esm-node/parse.js @@ -0,0 +1,35 @@ +import validate from './validate.js'; + +function parse(uuid) { + if (!validate(uuid)) { + throw TypeError('Invalid UUID'); + } + + let v; + const arr = new Uint8Array(16); // Parse ########-....-....-....-............ + + arr[0] = (v = parseInt(uuid.slice(0, 8), 16)) >>> 24; + arr[1] = v >>> 16 & 0xff; + arr[2] = v >>> 8 & 0xff; + arr[3] = v & 0xff; // Parse ........-####-....-....-............ + + arr[4] = (v = parseInt(uuid.slice(9, 13), 16)) >>> 8; + arr[5] = v & 0xff; // Parse ........-....-####-....-............ + + arr[6] = (v = parseInt(uuid.slice(14, 18), 16)) >>> 8; + arr[7] = v & 0xff; // Parse ........-....-....-####-............ + + arr[8] = (v = parseInt(uuid.slice(19, 23), 16)) >>> 8; + arr[9] = v & 0xff; // Parse ........-....-....-....-############ + // (Use "/" to avoid 32-bit truncation when bit-shifting high-order bytes) + + arr[10] = (v = parseInt(uuid.slice(24, 36), 16)) / 0x10000000000 & 0xff; + arr[11] = v / 0x100000000 & 0xff; + arr[12] = v >>> 24 & 0xff; + arr[13] = v >>> 16 & 0xff; + arr[14] = v >>> 8 & 0xff; + arr[15] = v & 0xff; + return arr; +} + +export default parse; \ No newline at end of file diff --git a/deps/npm/node_modules/uuid/dist/esm-node/regex.js b/deps/npm/node_modules/uuid/dist/esm-node/regex.js new file mode 100644 index 00000000000000..3da8673a5cdf3c --- /dev/null +++ b/deps/npm/node_modules/uuid/dist/esm-node/regex.js @@ -0,0 +1 @@ +export default /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i; \ No newline at end of file diff --git a/deps/npm/node_modules/uuid/dist/esm-node/rng.js b/deps/npm/node_modules/uuid/dist/esm-node/rng.js new file mode 100644 index 00000000000000..80062449a297eb --- /dev/null +++ b/deps/npm/node_modules/uuid/dist/esm-node/rng.js @@ -0,0 +1,12 @@ +import crypto from 'crypto'; +const rnds8Pool = new Uint8Array(256); // # of random values to pre-allocate + +let poolPtr = rnds8Pool.length; +export default function rng() { + if (poolPtr > rnds8Pool.length - 16) { + crypto.randomFillSync(rnds8Pool); + poolPtr = 0; + } + + return rnds8Pool.slice(poolPtr, poolPtr += 16); +} \ No newline at end of file diff --git a/deps/npm/node_modules/uuid/dist/esm-node/sha1.js b/deps/npm/node_modules/uuid/dist/esm-node/sha1.js new file mode 100644 index 00000000000000..e23850b441a0c0 --- /dev/null +++ b/deps/npm/node_modules/uuid/dist/esm-node/sha1.js @@ -0,0 +1,13 @@ +import crypto from 'crypto'; + +function sha1(bytes) { + if (Array.isArray(bytes)) { + bytes = Buffer.from(bytes); + } else if (typeof bytes === 'string') { + bytes = Buffer.from(bytes, 'utf8'); + } + + return crypto.createHash('sha1').update(bytes).digest(); +} + +export default sha1; \ No newline at end of file diff --git a/deps/npm/node_modules/uuid/dist/esm-node/stringify.js b/deps/npm/node_modules/uuid/dist/esm-node/stringify.js new file mode 100644 index 00000000000000..f9bca12026e21f --- /dev/null +++ b/deps/npm/node_modules/uuid/dist/esm-node/stringify.js @@ -0,0 +1,29 @@ +import validate from './validate.js'; +/** + * Convert array of 16 byte values to UUID string format of the form: + * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX + */ + +const byteToHex = []; + +for (let i = 0; i < 256; ++i) { + byteToHex.push((i + 0x100).toString(16).substr(1)); +} + +function stringify(arr, offset = 0) { + // Note: Be careful editing this code! It's been tuned for performance + // and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434 + const uuid = (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + '-' + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + '-' + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + '-' + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + '-' + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase(); // Consistency check for valid UUID. If this throws, it's likely due to one + // of the following: + // - One or more input array values don't map to a hex octet (leading to + // "undefined" in the uuid) + // - Invalid input values for the RFC `version` or `variant` fields + + if (!validate(uuid)) { + throw TypeError('Stringified UUID is invalid'); + } + + return uuid; +} + +export default stringify; \ No newline at end of file diff --git a/deps/npm/node_modules/uuid/dist/esm-node/v1.js b/deps/npm/node_modules/uuid/dist/esm-node/v1.js new file mode 100644 index 00000000000000..ebf81acb7d3a87 --- /dev/null +++ b/deps/npm/node_modules/uuid/dist/esm-node/v1.js @@ -0,0 +1,95 @@ +import rng from './rng.js'; +import stringify from './stringify.js'; // **`v1()` - Generate time-based UUID** +// +// Inspired by https://github.com/LiosK/UUID.js +// and http://docs.python.org/library/uuid.html + +let _nodeId; + +let _clockseq; // Previous uuid creation time + + +let _lastMSecs = 0; +let _lastNSecs = 0; // See https://github.com/uuidjs/uuid for API details + +function v1(options, buf, offset) { + let i = buf && offset || 0; + const b = buf || new Array(16); + options = options || {}; + let node = options.node || _nodeId; + let clockseq = options.clockseq !== undefined ? options.clockseq : _clockseq; // node and clockseq need to be initialized to random values if they're not + // specified. We do this lazily to minimize issues related to insufficient + // system entropy. See #189 + + if (node == null || clockseq == null) { + const seedBytes = options.random || (options.rng || rng)(); + + if (node == null) { + // Per 4.5, create and 48-bit node id, (47 random bits + multicast bit = 1) + node = _nodeId = [seedBytes[0] | 0x01, seedBytes[1], seedBytes[2], seedBytes[3], seedBytes[4], seedBytes[5]]; + } + + if (clockseq == null) { + // Per 4.2.2, randomize (14 bit) clockseq + clockseq = _clockseq = (seedBytes[6] << 8 | seedBytes[7]) & 0x3fff; + } + } // UUID timestamps are 100 nano-second units since the Gregorian epoch, + // (1582-10-15 00:00). JSNumbers aren't precise enough for this, so + // time is handled internally as 'msecs' (integer milliseconds) and 'nsecs' + // (100-nanoseconds offset from msecs) since unix epoch, 1970-01-01 00:00. + + + let msecs = options.msecs !== undefined ? options.msecs : Date.now(); // Per 4.2.1.2, use count of uuid's generated during the current clock + // cycle to simulate higher resolution clock + + let nsecs = options.nsecs !== undefined ? options.nsecs : _lastNSecs + 1; // Time since last uuid creation (in msecs) + + const dt = msecs - _lastMSecs + (nsecs - _lastNSecs) / 10000; // Per 4.2.1.2, Bump clockseq on clock regression + + if (dt < 0 && options.clockseq === undefined) { + clockseq = clockseq + 1 & 0x3fff; + } // Reset nsecs if clock regresses (new clockseq) or we've moved onto a new + // time interval + + + if ((dt < 0 || msecs > _lastMSecs) && options.nsecs === undefined) { + nsecs = 0; + } // Per 4.2.1.2 Throw error if too many uuids are requested + + + if (nsecs >= 10000) { + throw new Error("uuid.v1(): Can't create more than 10M uuids/sec"); + } + + _lastMSecs = msecs; + _lastNSecs = nsecs; + _clockseq = clockseq; // Per 4.1.4 - Convert from unix epoch to Gregorian epoch + + msecs += 12219292800000; // `time_low` + + const tl = ((msecs & 0xfffffff) * 10000 + nsecs) % 0x100000000; + b[i++] = tl >>> 24 & 0xff; + b[i++] = tl >>> 16 & 0xff; + b[i++] = tl >>> 8 & 0xff; + b[i++] = tl & 0xff; // `time_mid` + + const tmh = msecs / 0x100000000 * 10000 & 0xfffffff; + b[i++] = tmh >>> 8 & 0xff; + b[i++] = tmh & 0xff; // `time_high_and_version` + + b[i++] = tmh >>> 24 & 0xf | 0x10; // include version + + b[i++] = tmh >>> 16 & 0xff; // `clock_seq_hi_and_reserved` (Per 4.2.2 - include variant) + + b[i++] = clockseq >>> 8 | 0x80; // `clock_seq_low` + + b[i++] = clockseq & 0xff; // `node` + + for (let n = 0; n < 6; ++n) { + b[i + n] = node[n]; + } + + return buf || stringify(b); +} + +export default v1; \ No newline at end of file diff --git a/deps/npm/node_modules/uuid/dist/esm-node/v3.js b/deps/npm/node_modules/uuid/dist/esm-node/v3.js new file mode 100644 index 00000000000000..09063b860499e6 --- /dev/null +++ b/deps/npm/node_modules/uuid/dist/esm-node/v3.js @@ -0,0 +1,4 @@ +import v35 from './v35.js'; +import md5 from './md5.js'; +const v3 = v35('v3', 0x30, md5); +export default v3; \ No newline at end of file diff --git a/deps/npm/node_modules/uuid/dist/esm-node/v35.js b/deps/npm/node_modules/uuid/dist/esm-node/v35.js new file mode 100644 index 00000000000000..22f6a196037f91 --- /dev/null +++ b/deps/npm/node_modules/uuid/dist/esm-node/v35.js @@ -0,0 +1,64 @@ +import stringify from './stringify.js'; +import parse from './parse.js'; + +function stringToBytes(str) { + str = unescape(encodeURIComponent(str)); // UTF8 escape + + const bytes = []; + + for (let i = 0; i < str.length; ++i) { + bytes.push(str.charCodeAt(i)); + } + + return bytes; +} + +export const DNS = '6ba7b810-9dad-11d1-80b4-00c04fd430c8'; +export const URL = '6ba7b811-9dad-11d1-80b4-00c04fd430c8'; +export default function (name, version, hashfunc) { + function generateUUID(value, namespace, buf, offset) { + if (typeof value === 'string') { + value = stringToBytes(value); + } + + if (typeof namespace === 'string') { + namespace = parse(namespace); + } + + if (namespace.length !== 16) { + throw TypeError('Namespace must be array-like (16 iterable integer values, 0-255)'); + } // Compute hash of namespace and value, Per 4.3 + // Future: Use spread syntax when supported on all platforms, e.g. `bytes = + // hashfunc([...namespace, ... value])` + + + let bytes = new Uint8Array(16 + value.length); + bytes.set(namespace); + bytes.set(value, namespace.length); + bytes = hashfunc(bytes); + bytes[6] = bytes[6] & 0x0f | version; + bytes[8] = bytes[8] & 0x3f | 0x80; + + if (buf) { + offset = offset || 0; + + for (let i = 0; i < 16; ++i) { + buf[offset + i] = bytes[i]; + } + + return buf; + } + + return stringify(bytes); + } // Function#name is not settable on some platforms (#270) + + + try { + generateUUID.name = name; // eslint-disable-next-line no-empty + } catch (err) {} // For CommonJS default export support + + + generateUUID.DNS = DNS; + generateUUID.URL = URL; + return generateUUID; +} \ No newline at end of file diff --git a/deps/npm/node_modules/uuid/dist/esm-node/v4.js b/deps/npm/node_modules/uuid/dist/esm-node/v4.js new file mode 100644 index 00000000000000..efad926f68deed --- /dev/null +++ b/deps/npm/node_modules/uuid/dist/esm-node/v4.js @@ -0,0 +1,24 @@ +import rng from './rng.js'; +import stringify from './stringify.js'; + +function v4(options, buf, offset) { + options = options || {}; + const rnds = options.random || (options.rng || rng)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved` + + rnds[6] = rnds[6] & 0x0f | 0x40; + rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided + + if (buf) { + offset = offset || 0; + + for (let i = 0; i < 16; ++i) { + buf[offset + i] = rnds[i]; + } + + return buf; + } + + return stringify(rnds); +} + +export default v4; \ No newline at end of file diff --git a/deps/npm/node_modules/uuid/dist/esm-node/v5.js b/deps/npm/node_modules/uuid/dist/esm-node/v5.js new file mode 100644 index 00000000000000..e87fe317d70a00 --- /dev/null +++ b/deps/npm/node_modules/uuid/dist/esm-node/v5.js @@ -0,0 +1,4 @@ +import v35 from './v35.js'; +import sha1 from './sha1.js'; +const v5 = v35('v5', 0x50, sha1); +export default v5; \ No newline at end of file diff --git a/deps/npm/node_modules/uuid/dist/esm-node/validate.js b/deps/npm/node_modules/uuid/dist/esm-node/validate.js new file mode 100644 index 00000000000000..f1cdc7af49bcfc --- /dev/null +++ b/deps/npm/node_modules/uuid/dist/esm-node/validate.js @@ -0,0 +1,7 @@ +import REGEX from './regex.js'; + +function validate(uuid) { + return typeof uuid === 'string' && REGEX.test(uuid); +} + +export default validate; \ No newline at end of file diff --git a/deps/npm/node_modules/uuid/dist/esm-node/version.js b/deps/npm/node_modules/uuid/dist/esm-node/version.js new file mode 100644 index 00000000000000..77530e9cb0e355 --- /dev/null +++ b/deps/npm/node_modules/uuid/dist/esm-node/version.js @@ -0,0 +1,11 @@ +import validate from './validate.js'; + +function version(uuid) { + if (!validate(uuid)) { + throw TypeError('Invalid UUID'); + } + + return parseInt(uuid.substr(14, 1), 16); +} + +export default version; \ No newline at end of file diff --git a/deps/npm/node_modules/uuid/dist/index.js b/deps/npm/node_modules/uuid/dist/index.js new file mode 100644 index 00000000000000..bf13b103c651d6 --- /dev/null +++ b/deps/npm/node_modules/uuid/dist/index.js @@ -0,0 +1,79 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +Object.defineProperty(exports, "v1", { + enumerable: true, + get: function () { + return _v.default; + } +}); +Object.defineProperty(exports, "v3", { + enumerable: true, + get: function () { + return _v2.default; + } +}); +Object.defineProperty(exports, "v4", { + enumerable: true, + get: function () { + return _v3.default; + } +}); +Object.defineProperty(exports, "v5", { + enumerable: true, + get: function () { + return _v4.default; + } +}); +Object.defineProperty(exports, "NIL", { + enumerable: true, + get: function () { + return _nil.default; + } +}); +Object.defineProperty(exports, "version", { + enumerable: true, + get: function () { + return _version.default; + } +}); +Object.defineProperty(exports, "validate", { + enumerable: true, + get: function () { + return _validate.default; + } +}); +Object.defineProperty(exports, "stringify", { + enumerable: true, + get: function () { + return _stringify.default; + } +}); +Object.defineProperty(exports, "parse", { + enumerable: true, + get: function () { + return _parse.default; + } +}); + +var _v = _interopRequireDefault(require("./v1.js")); + +var _v2 = _interopRequireDefault(require("./v3.js")); + +var _v3 = _interopRequireDefault(require("./v4.js")); + +var _v4 = _interopRequireDefault(require("./v5.js")); + +var _nil = _interopRequireDefault(require("./nil.js")); + +var _version = _interopRequireDefault(require("./version.js")); + +var _validate = _interopRequireDefault(require("./validate.js")); + +var _stringify = _interopRequireDefault(require("./stringify.js")); + +var _parse = _interopRequireDefault(require("./parse.js")); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } \ No newline at end of file diff --git a/deps/npm/node_modules/uuid/dist/md5-browser.js b/deps/npm/node_modules/uuid/dist/md5-browser.js new file mode 100644 index 00000000000000..7a4582ace68689 --- /dev/null +++ b/deps/npm/node_modules/uuid/dist/md5-browser.js @@ -0,0 +1,223 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +/* + * Browser-compatible JavaScript MD5 + * + * Modification of JavaScript MD5 + * https://github.com/blueimp/JavaScript-MD5 + * + * Copyright 2011, Sebastian Tschan + * https://blueimp.net + * + * Licensed under the MIT license: + * https://opensource.org/licenses/MIT + * + * Based on + * A JavaScript implementation of the RSA Data Security, Inc. MD5 Message + * Digest Algorithm, as defined in RFC 1321. + * Version 2.2 Copyright (C) Paul Johnston 1999 - 2009 + * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet + * Distributed under the BSD License + * See http://pajhome.org.uk/crypt/md5 for more info. + */ +function md5(bytes) { + if (typeof bytes === 'string') { + const msg = unescape(encodeURIComponent(bytes)); // UTF8 escape + + bytes = new Uint8Array(msg.length); + + for (let i = 0; i < msg.length; ++i) { + bytes[i] = msg.charCodeAt(i); + } + } + + return md5ToHexEncodedArray(wordsToMd5(bytesToWords(bytes), bytes.length * 8)); +} +/* + * Convert an array of little-endian words to an array of bytes + */ + + +function md5ToHexEncodedArray(input) { + const output = []; + const length32 = input.length * 32; + const hexTab = '0123456789abcdef'; + + for (let i = 0; i < length32; i += 8) { + const x = input[i >> 5] >>> i % 32 & 0xff; + const hex = parseInt(hexTab.charAt(x >>> 4 & 0x0f) + hexTab.charAt(x & 0x0f), 16); + output.push(hex); + } + + return output; +} +/** + * Calculate output length with padding and bit length + */ + + +function getOutputLength(inputLength8) { + return (inputLength8 + 64 >>> 9 << 4) + 14 + 1; +} +/* + * Calculate the MD5 of an array of little-endian words, and a bit length. + */ + + +function wordsToMd5(x, len) { + /* append padding */ + x[len >> 5] |= 0x80 << len % 32; + x[getOutputLength(len) - 1] = len; + let a = 1732584193; + let b = -271733879; + let c = -1732584194; + let d = 271733878; + + for (let i = 0; i < x.length; i += 16) { + const olda = a; + const oldb = b; + const oldc = c; + const oldd = d; + a = md5ff(a, b, c, d, x[i], 7, -680876936); + d = md5ff(d, a, b, c, x[i + 1], 12, -389564586); + c = md5ff(c, d, a, b, x[i + 2], 17, 606105819); + b = md5ff(b, c, d, a, x[i + 3], 22, -1044525330); + a = md5ff(a, b, c, d, x[i + 4], 7, -176418897); + d = md5ff(d, a, b, c, x[i + 5], 12, 1200080426); + c = md5ff(c, d, a, b, x[i + 6], 17, -1473231341); + b = md5ff(b, c, d, a, x[i + 7], 22, -45705983); + a = md5ff(a, b, c, d, x[i + 8], 7, 1770035416); + d = md5ff(d, a, b, c, x[i + 9], 12, -1958414417); + c = md5ff(c, d, a, b, x[i + 10], 17, -42063); + b = md5ff(b, c, d, a, x[i + 11], 22, -1990404162); + a = md5ff(a, b, c, d, x[i + 12], 7, 1804603682); + d = md5ff(d, a, b, c, x[i + 13], 12, -40341101); + c = md5ff(c, d, a, b, x[i + 14], 17, -1502002290); + b = md5ff(b, c, d, a, x[i + 15], 22, 1236535329); + a = md5gg(a, b, c, d, x[i + 1], 5, -165796510); + d = md5gg(d, a, b, c, x[i + 6], 9, -1069501632); + c = md5gg(c, d, a, b, x[i + 11], 14, 643717713); + b = md5gg(b, c, d, a, x[i], 20, -373897302); + a = md5gg(a, b, c, d, x[i + 5], 5, -701558691); + d = md5gg(d, a, b, c, x[i + 10], 9, 38016083); + c = md5gg(c, d, a, b, x[i + 15], 14, -660478335); + b = md5gg(b, c, d, a, x[i + 4], 20, -405537848); + a = md5gg(a, b, c, d, x[i + 9], 5, 568446438); + d = md5gg(d, a, b, c, x[i + 14], 9, -1019803690); + c = md5gg(c, d, a, b, x[i + 3], 14, -187363961); + b = md5gg(b, c, d, a, x[i + 8], 20, 1163531501); + a = md5gg(a, b, c, d, x[i + 13], 5, -1444681467); + d = md5gg(d, a, b, c, x[i + 2], 9, -51403784); + c = md5gg(c, d, a, b, x[i + 7], 14, 1735328473); + b = md5gg(b, c, d, a, x[i + 12], 20, -1926607734); + a = md5hh(a, b, c, d, x[i + 5], 4, -378558); + d = md5hh(d, a, b, c, x[i + 8], 11, -2022574463); + c = md5hh(c, d, a, b, x[i + 11], 16, 1839030562); + b = md5hh(b, c, d, a, x[i + 14], 23, -35309556); + a = md5hh(a, b, c, d, x[i + 1], 4, -1530992060); + d = md5hh(d, a, b, c, x[i + 4], 11, 1272893353); + c = md5hh(c, d, a, b, x[i + 7], 16, -155497632); + b = md5hh(b, c, d, a, x[i + 10], 23, -1094730640); + a = md5hh(a, b, c, d, x[i + 13], 4, 681279174); + d = md5hh(d, a, b, c, x[i], 11, -358537222); + c = md5hh(c, d, a, b, x[i + 3], 16, -722521979); + b = md5hh(b, c, d, a, x[i + 6], 23, 76029189); + a = md5hh(a, b, c, d, x[i + 9], 4, -640364487); + d = md5hh(d, a, b, c, x[i + 12], 11, -421815835); + c = md5hh(c, d, a, b, x[i + 15], 16, 530742520); + b = md5hh(b, c, d, a, x[i + 2], 23, -995338651); + a = md5ii(a, b, c, d, x[i], 6, -198630844); + d = md5ii(d, a, b, c, x[i + 7], 10, 1126891415); + c = md5ii(c, d, a, b, x[i + 14], 15, -1416354905); + b = md5ii(b, c, d, a, x[i + 5], 21, -57434055); + a = md5ii(a, b, c, d, x[i + 12], 6, 1700485571); + d = md5ii(d, a, b, c, x[i + 3], 10, -1894986606); + c = md5ii(c, d, a, b, x[i + 10], 15, -1051523); + b = md5ii(b, c, d, a, x[i + 1], 21, -2054922799); + a = md5ii(a, b, c, d, x[i + 8], 6, 1873313359); + d = md5ii(d, a, b, c, x[i + 15], 10, -30611744); + c = md5ii(c, d, a, b, x[i + 6], 15, -1560198380); + b = md5ii(b, c, d, a, x[i + 13], 21, 1309151649); + a = md5ii(a, b, c, d, x[i + 4], 6, -145523070); + d = md5ii(d, a, b, c, x[i + 11], 10, -1120210379); + c = md5ii(c, d, a, b, x[i + 2], 15, 718787259); + b = md5ii(b, c, d, a, x[i + 9], 21, -343485551); + a = safeAdd(a, olda); + b = safeAdd(b, oldb); + c = safeAdd(c, oldc); + d = safeAdd(d, oldd); + } + + return [a, b, c, d]; +} +/* + * Convert an array bytes to an array of little-endian words + * Characters >255 have their high-byte silently ignored. + */ + + +function bytesToWords(input) { + if (input.length === 0) { + return []; + } + + const length8 = input.length * 8; + const output = new Uint32Array(getOutputLength(length8)); + + for (let i = 0; i < length8; i += 8) { + output[i >> 5] |= (input[i / 8] & 0xff) << i % 32; + } + + return output; +} +/* + * Add integers, wrapping at 2^32. This uses 16-bit operations internally + * to work around bugs in some JS interpreters. + */ + + +function safeAdd(x, y) { + const lsw = (x & 0xffff) + (y & 0xffff); + const msw = (x >> 16) + (y >> 16) + (lsw >> 16); + return msw << 16 | lsw & 0xffff; +} +/* + * Bitwise rotate a 32-bit number to the left. + */ + + +function bitRotateLeft(num, cnt) { + return num << cnt | num >>> 32 - cnt; +} +/* + * These functions implement the four basic operations the algorithm uses. + */ + + +function md5cmn(q, a, b, x, s, t) { + return safeAdd(bitRotateLeft(safeAdd(safeAdd(a, q), safeAdd(x, t)), s), b); +} + +function md5ff(a, b, c, d, x, s, t) { + return md5cmn(b & c | ~b & d, a, b, x, s, t); +} + +function md5gg(a, b, c, d, x, s, t) { + return md5cmn(b & d | c & ~d, a, b, x, s, t); +} + +function md5hh(a, b, c, d, x, s, t) { + return md5cmn(b ^ c ^ d, a, b, x, s, t); +} + +function md5ii(a, b, c, d, x, s, t) { + return md5cmn(c ^ (b | ~d), a, b, x, s, t); +} + +var _default = md5; +exports.default = _default; \ No newline at end of file diff --git a/deps/npm/node_modules/uuid/dist/md5.js b/deps/npm/node_modules/uuid/dist/md5.js new file mode 100644 index 00000000000000..824d48167a980e --- /dev/null +++ b/deps/npm/node_modules/uuid/dist/md5.js @@ -0,0 +1,23 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +var _crypto = _interopRequireDefault(require("crypto")); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function md5(bytes) { + if (Array.isArray(bytes)) { + bytes = Buffer.from(bytes); + } else if (typeof bytes === 'string') { + bytes = Buffer.from(bytes, 'utf8'); + } + + return _crypto.default.createHash('md5').update(bytes).digest(); +} + +var _default = md5; +exports.default = _default; \ No newline at end of file diff --git a/deps/npm/node_modules/uuid/dist/nil.js b/deps/npm/node_modules/uuid/dist/nil.js new file mode 100644 index 00000000000000..7ade577b256b25 --- /dev/null +++ b/deps/npm/node_modules/uuid/dist/nil.js @@ -0,0 +1,8 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var _default = '00000000-0000-0000-0000-000000000000'; +exports.default = _default; \ No newline at end of file diff --git a/deps/npm/node_modules/uuid/dist/parse.js b/deps/npm/node_modules/uuid/dist/parse.js new file mode 100644 index 00000000000000..4c69fc39e74c2e --- /dev/null +++ b/deps/npm/node_modules/uuid/dist/parse.js @@ -0,0 +1,45 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +var _validate = _interopRequireDefault(require("./validate.js")); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function parse(uuid) { + if (!(0, _validate.default)(uuid)) { + throw TypeError('Invalid UUID'); + } + + let v; + const arr = new Uint8Array(16); // Parse ########-....-....-....-............ + + arr[0] = (v = parseInt(uuid.slice(0, 8), 16)) >>> 24; + arr[1] = v >>> 16 & 0xff; + arr[2] = v >>> 8 & 0xff; + arr[3] = v & 0xff; // Parse ........-####-....-....-............ + + arr[4] = (v = parseInt(uuid.slice(9, 13), 16)) >>> 8; + arr[5] = v & 0xff; // Parse ........-....-####-....-............ + + arr[6] = (v = parseInt(uuid.slice(14, 18), 16)) >>> 8; + arr[7] = v & 0xff; // Parse ........-....-....-####-............ + + arr[8] = (v = parseInt(uuid.slice(19, 23), 16)) >>> 8; + arr[9] = v & 0xff; // Parse ........-....-....-....-############ + // (Use "/" to avoid 32-bit truncation when bit-shifting high-order bytes) + + arr[10] = (v = parseInt(uuid.slice(24, 36), 16)) / 0x10000000000 & 0xff; + arr[11] = v / 0x100000000 & 0xff; + arr[12] = v >>> 24 & 0xff; + arr[13] = v >>> 16 & 0xff; + arr[14] = v >>> 8 & 0xff; + arr[15] = v & 0xff; + return arr; +} + +var _default = parse; +exports.default = _default; \ No newline at end of file diff --git a/deps/npm/node_modules/uuid/dist/regex.js b/deps/npm/node_modules/uuid/dist/regex.js new file mode 100644 index 00000000000000..1ef91d64c80e22 --- /dev/null +++ b/deps/npm/node_modules/uuid/dist/regex.js @@ -0,0 +1,8 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var _default = /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i; +exports.default = _default; \ No newline at end of file diff --git a/deps/npm/node_modules/uuid/dist/rng-browser.js b/deps/npm/node_modules/uuid/dist/rng-browser.js new file mode 100644 index 00000000000000..d3cc3085c732bb --- /dev/null +++ b/deps/npm/node_modules/uuid/dist/rng-browser.js @@ -0,0 +1,21 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = rng; +// Unique ID creation requires a high quality random # generator. In the browser we therefore +// require the crypto API and do not support built-in fallback to lower quality random number +// generators (like Math.random()). +// getRandomValues needs to be invoked in a context where "this" is a Crypto implementation. Also, +// find the complete implementation of crypto (msCrypto) on IE11. +const getRandomValues = typeof crypto !== 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto) || typeof msCrypto !== 'undefined' && typeof msCrypto.getRandomValues === 'function' && msCrypto.getRandomValues.bind(msCrypto); +const rnds8 = new Uint8Array(16); + +function rng() { + if (!getRandomValues) { + throw new Error('crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported'); + } + + return getRandomValues(rnds8); +} \ No newline at end of file diff --git a/deps/npm/node_modules/uuid/dist/rng.js b/deps/npm/node_modules/uuid/dist/rng.js new file mode 100644 index 00000000000000..3507f93772a910 --- /dev/null +++ b/deps/npm/node_modules/uuid/dist/rng.js @@ -0,0 +1,24 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = rng; + +var _crypto = _interopRequireDefault(require("crypto")); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +const rnds8Pool = new Uint8Array(256); // # of random values to pre-allocate + +let poolPtr = rnds8Pool.length; + +function rng() { + if (poolPtr > rnds8Pool.length - 16) { + _crypto.default.randomFillSync(rnds8Pool); + + poolPtr = 0; + } + + return rnds8Pool.slice(poolPtr, poolPtr += 16); +} \ No newline at end of file diff --git a/deps/npm/node_modules/uuid/dist/sha1-browser.js b/deps/npm/node_modules/uuid/dist/sha1-browser.js new file mode 100644 index 00000000000000..24cbcedca58c8a --- /dev/null +++ b/deps/npm/node_modules/uuid/dist/sha1-browser.js @@ -0,0 +1,104 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +// Adapted from Chris Veness' SHA1 code at +// http://www.movable-type.co.uk/scripts/sha1.html +function f(s, x, y, z) { + switch (s) { + case 0: + return x & y ^ ~x & z; + + case 1: + return x ^ y ^ z; + + case 2: + return x & y ^ x & z ^ y & z; + + case 3: + return x ^ y ^ z; + } +} + +function ROTL(x, n) { + return x << n | x >>> 32 - n; +} + +function sha1(bytes) { + const K = [0x5a827999, 0x6ed9eba1, 0x8f1bbcdc, 0xca62c1d6]; + const H = [0x67452301, 0xefcdab89, 0x98badcfe, 0x10325476, 0xc3d2e1f0]; + + if (typeof bytes === 'string') { + const msg = unescape(encodeURIComponent(bytes)); // UTF8 escape + + bytes = []; + + for (let i = 0; i < msg.length; ++i) { + bytes.push(msg.charCodeAt(i)); + } + } else if (!Array.isArray(bytes)) { + // Convert Array-like to Array + bytes = Array.prototype.slice.call(bytes); + } + + bytes.push(0x80); + const l = bytes.length / 4 + 2; + const N = Math.ceil(l / 16); + const M = new Array(N); + + for (let i = 0; i < N; ++i) { + const arr = new Uint32Array(16); + + for (let j = 0; j < 16; ++j) { + arr[j] = bytes[i * 64 + j * 4] << 24 | bytes[i * 64 + j * 4 + 1] << 16 | bytes[i * 64 + j * 4 + 2] << 8 | bytes[i * 64 + j * 4 + 3]; + } + + M[i] = arr; + } + + M[N - 1][14] = (bytes.length - 1) * 8 / Math.pow(2, 32); + M[N - 1][14] = Math.floor(M[N - 1][14]); + M[N - 1][15] = (bytes.length - 1) * 8 & 0xffffffff; + + for (let i = 0; i < N; ++i) { + const W = new Uint32Array(80); + + for (let t = 0; t < 16; ++t) { + W[t] = M[i][t]; + } + + for (let t = 16; t < 80; ++t) { + W[t] = ROTL(W[t - 3] ^ W[t - 8] ^ W[t - 14] ^ W[t - 16], 1); + } + + let a = H[0]; + let b = H[1]; + let c = H[2]; + let d = H[3]; + let e = H[4]; + + for (let t = 0; t < 80; ++t) { + const s = Math.floor(t / 20); + const T = ROTL(a, 5) + f(s, b, c, d) + e + K[s] + W[t] >>> 0; + e = d; + d = c; + c = ROTL(b, 30) >>> 0; + b = a; + a = T; + } + + H[0] = H[0] + a >>> 0; + H[1] = H[1] + b >>> 0; + H[2] = H[2] + c >>> 0; + H[3] = H[3] + d >>> 0; + H[4] = H[4] + e >>> 0; + } + + return [H[0] >> 24 & 0xff, H[0] >> 16 & 0xff, H[0] >> 8 & 0xff, H[0] & 0xff, H[1] >> 24 & 0xff, H[1] >> 16 & 0xff, H[1] >> 8 & 0xff, H[1] & 0xff, H[2] >> 24 & 0xff, H[2] >> 16 & 0xff, H[2] >> 8 & 0xff, H[2] & 0xff, H[3] >> 24 & 0xff, H[3] >> 16 & 0xff, H[3] >> 8 & 0xff, H[3] & 0xff, H[4] >> 24 & 0xff, H[4] >> 16 & 0xff, H[4] >> 8 & 0xff, H[4] & 0xff]; +} + +var _default = sha1; +exports.default = _default; \ No newline at end of file diff --git a/deps/npm/node_modules/uuid/dist/sha1.js b/deps/npm/node_modules/uuid/dist/sha1.js new file mode 100644 index 00000000000000..03bdd63cedadaf --- /dev/null +++ b/deps/npm/node_modules/uuid/dist/sha1.js @@ -0,0 +1,23 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +var _crypto = _interopRequireDefault(require("crypto")); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function sha1(bytes) { + if (Array.isArray(bytes)) { + bytes = Buffer.from(bytes); + } else if (typeof bytes === 'string') { + bytes = Buffer.from(bytes, 'utf8'); + } + + return _crypto.default.createHash('sha1').update(bytes).digest(); +} + +var _default = sha1; +exports.default = _default; \ No newline at end of file diff --git a/deps/npm/node_modules/uuid/dist/stringify.js b/deps/npm/node_modules/uuid/dist/stringify.js new file mode 100644 index 00000000000000..b8e7519403eedc --- /dev/null +++ b/deps/npm/node_modules/uuid/dist/stringify.js @@ -0,0 +1,39 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +var _validate = _interopRequireDefault(require("./validate.js")); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * Convert array of 16 byte values to UUID string format of the form: + * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX + */ +const byteToHex = []; + +for (let i = 0; i < 256; ++i) { + byteToHex.push((i + 0x100).toString(16).substr(1)); +} + +function stringify(arr, offset = 0) { + // Note: Be careful editing this code! It's been tuned for performance + // and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434 + const uuid = (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + '-' + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + '-' + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + '-' + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + '-' + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase(); // Consistency check for valid UUID. If this throws, it's likely due to one + // of the following: + // - One or more input array values don't map to a hex octet (leading to + // "undefined" in the uuid) + // - Invalid input values for the RFC `version` or `variant` fields + + if (!(0, _validate.default)(uuid)) { + throw TypeError('Stringified UUID is invalid'); + } + + return uuid; +} + +var _default = stringify; +exports.default = _default; \ No newline at end of file diff --git a/deps/npm/node_modules/uuid/dist/umd/uuid.min.js b/deps/npm/node_modules/uuid/dist/umd/uuid.min.js new file mode 100644 index 00000000000000..92745958e7de43 --- /dev/null +++ b/deps/npm/node_modules/uuid/dist/umd/uuid.min.js @@ -0,0 +1 @@ +!function(r,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((r="undefined"!=typeof globalThis?globalThis:r||self).uuid={})}(this,(function(r){"use strict";var e="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto),n=new Uint8Array(16);function t(){if(!e)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return e(n)}var o=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function a(r){return"string"==typeof r&&o.test(r)}for(var i,u,f=[],s=0;s<256;++s)f.push((s+256).toString(16).substr(1));function c(r){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=(f[r[e+0]]+f[r[e+1]]+f[r[e+2]]+f[r[e+3]]+"-"+f[r[e+4]]+f[r[e+5]]+"-"+f[r[e+6]]+f[r[e+7]]+"-"+f[r[e+8]]+f[r[e+9]]+"-"+f[r[e+10]]+f[r[e+11]]+f[r[e+12]]+f[r[e+13]]+f[r[e+14]]+f[r[e+15]]).toLowerCase();if(!a(n))throw TypeError("Stringified UUID is invalid");return n}var l=0,d=0;function v(r){if(!a(r))throw TypeError("Invalid UUID");var e,n=new Uint8Array(16);return n[0]=(e=parseInt(r.slice(0,8),16))>>>24,n[1]=e>>>16&255,n[2]=e>>>8&255,n[3]=255&e,n[4]=(e=parseInt(r.slice(9,13),16))>>>8,n[5]=255&e,n[6]=(e=parseInt(r.slice(14,18),16))>>>8,n[7]=255&e,n[8]=(e=parseInt(r.slice(19,23),16))>>>8,n[9]=255&e,n[10]=(e=parseInt(r.slice(24,36),16))/1099511627776&255,n[11]=e/4294967296&255,n[12]=e>>>24&255,n[13]=e>>>16&255,n[14]=e>>>8&255,n[15]=255&e,n}function p(r,e,n){function t(r,t,o,a){if("string"==typeof r&&(r=function(r){r=unescape(encodeURIComponent(r));for(var e=[],n=0;n>>9<<4)+1}function y(r,e){var n=(65535&r)+(65535&e);return(r>>16)+(e>>16)+(n>>16)<<16|65535&n}function g(r,e,n,t,o,a){return y((i=y(y(e,r),y(t,a)))<<(u=o)|i>>>32-u,n);var i,u}function m(r,e,n,t,o,a,i){return g(e&n|~e&t,r,e,o,a,i)}function w(r,e,n,t,o,a,i){return g(e&t|n&~t,r,e,o,a,i)}function b(r,e,n,t,o,a,i){return g(e^n^t,r,e,o,a,i)}function A(r,e,n,t,o,a,i){return g(n^(e|~t),r,e,o,a,i)}var U=p("v3",48,(function(r){if("string"==typeof r){var e=unescape(encodeURIComponent(r));r=new Uint8Array(e.length);for(var n=0;n>5]>>>o%32&255,i=parseInt(t.charAt(a>>>4&15)+t.charAt(15&a),16);e.push(i)}return e}(function(r,e){r[e>>5]|=128<>5]|=(255&r[t/8])<>>32-e}var R=p("v5",80,(function(r){var e=[1518500249,1859775393,2400959708,3395469782],n=[1732584193,4023233417,2562383102,271733878,3285377520];if("string"==typeof r){var t=unescape(encodeURIComponent(r));r=[];for(var o=0;o>>0;w=m,m=g,g=C(y,30)>>>0,y=h,h=U}n[0]=n[0]+h>>>0,n[1]=n[1]+y>>>0,n[2]=n[2]+g>>>0,n[3]=n[3]+m>>>0,n[4]=n[4]+w>>>0}return[n[0]>>24&255,n[0]>>16&255,n[0]>>8&255,255&n[0],n[1]>>24&255,n[1]>>16&255,n[1]>>8&255,255&n[1],n[2]>>24&255,n[2]>>16&255,n[2]>>8&255,255&n[2],n[3]>>24&255,n[3]>>16&255,n[3]>>8&255,255&n[3],n[4]>>24&255,n[4]>>16&255,n[4]>>8&255,255&n[4]]}));r.NIL="00000000-0000-0000-0000-000000000000",r.parse=v,r.stringify=c,r.v1=function(r,e,n){var o=e&&n||0,a=e||new Array(16),f=(r=r||{}).node||i,s=void 0!==r.clockseq?r.clockseq:u;if(null==f||null==s){var v=r.random||(r.rng||t)();null==f&&(f=i=[1|v[0],v[1],v[2],v[3],v[4],v[5]]),null==s&&(s=u=16383&(v[6]<<8|v[7]))}var p=void 0!==r.msecs?r.msecs:Date.now(),h=void 0!==r.nsecs?r.nsecs:d+1,y=p-l+(h-d)/1e4;if(y<0&&void 0===r.clockseq&&(s=s+1&16383),(y<0||p>l)&&void 0===r.nsecs&&(h=0),h>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");l=p,d=h,u=s;var g=(1e4*(268435455&(p+=122192928e5))+h)%4294967296;a[o++]=g>>>24&255,a[o++]=g>>>16&255,a[o++]=g>>>8&255,a[o++]=255&g;var m=p/4294967296*1e4&268435455;a[o++]=m>>>8&255,a[o++]=255&m,a[o++]=m>>>24&15|16,a[o++]=m>>>16&255,a[o++]=s>>>8|128,a[o++]=255&s;for(var w=0;w<6;++w)a[o+w]=f[w];return e||c(a)},r.v3=U,r.v4=function(r,e,n){var o=(r=r||{}).random||(r.rng||t)();if(o[6]=15&o[6]|64,o[8]=63&o[8]|128,e){n=n||0;for(var a=0;a<16;++a)e[n+a]=o[a];return e}return c(o)},r.v5=R,r.validate=a,r.version=function(r){if(!a(r))throw TypeError("Invalid UUID");return parseInt(r.substr(14,1),16)},Object.defineProperty(r,"__esModule",{value:!0})})); \ No newline at end of file diff --git a/deps/npm/node_modules/uuid/dist/umd/uuidNIL.min.js b/deps/npm/node_modules/uuid/dist/umd/uuidNIL.min.js new file mode 100644 index 00000000000000..30b28a7e0faf01 --- /dev/null +++ b/deps/npm/node_modules/uuid/dist/umd/uuidNIL.min.js @@ -0,0 +1 @@ +!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n():"function"==typeof define&&define.amd?define(n):(e="undefined"!=typeof globalThis?globalThis:e||self).uuidNIL=n()}(this,(function(){"use strict";return"00000000-0000-0000-0000-000000000000"})); \ No newline at end of file diff --git a/deps/npm/node_modules/uuid/dist/umd/uuidParse.min.js b/deps/npm/node_modules/uuid/dist/umd/uuidParse.min.js new file mode 100644 index 00000000000000..d48ea6af50a42a --- /dev/null +++ b/deps/npm/node_modules/uuid/dist/umd/uuidParse.min.js @@ -0,0 +1 @@ +!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n():"function"==typeof define&&define.amd?define(n):(e="undefined"!=typeof globalThis?globalThis:e||self).uuidParse=n()}(this,(function(){"use strict";var e=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;return function(n){if(!function(n){return"string"==typeof n&&e.test(n)}(n))throw TypeError("Invalid UUID");var t,i=new Uint8Array(16);return i[0]=(t=parseInt(n.slice(0,8),16))>>>24,i[1]=t>>>16&255,i[2]=t>>>8&255,i[3]=255&t,i[4]=(t=parseInt(n.slice(9,13),16))>>>8,i[5]=255&t,i[6]=(t=parseInt(n.slice(14,18),16))>>>8,i[7]=255&t,i[8]=(t=parseInt(n.slice(19,23),16))>>>8,i[9]=255&t,i[10]=(t=parseInt(n.slice(24,36),16))/1099511627776&255,i[11]=t/4294967296&255,i[12]=t>>>24&255,i[13]=t>>>16&255,i[14]=t>>>8&255,i[15]=255&t,i}})); \ No newline at end of file diff --git a/deps/npm/node_modules/uuid/dist/umd/uuidStringify.min.js b/deps/npm/node_modules/uuid/dist/umd/uuidStringify.min.js new file mode 100644 index 00000000000000..fd39adc330cf2b --- /dev/null +++ b/deps/npm/node_modules/uuid/dist/umd/uuidStringify.min.js @@ -0,0 +1 @@ +!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).uuidStringify=t()}(this,(function(){"use strict";var e=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function t(t){return"string"==typeof t&&e.test(t)}for(var i=[],n=0;n<256;++n)i.push((n+256).toString(16).substr(1));return function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,f=(i[e[n+0]]+i[e[n+1]]+i[e[n+2]]+i[e[n+3]]+"-"+i[e[n+4]]+i[e[n+5]]+"-"+i[e[n+6]]+i[e[n+7]]+"-"+i[e[n+8]]+i[e[n+9]]+"-"+i[e[n+10]]+i[e[n+11]]+i[e[n+12]]+i[e[n+13]]+i[e[n+14]]+i[e[n+15]]).toLowerCase();if(!t(f))throw TypeError("Stringified UUID is invalid");return f}})); \ No newline at end of file diff --git a/deps/npm/node_modules/uuid/dist/umd/uuidValidate.min.js b/deps/npm/node_modules/uuid/dist/umd/uuidValidate.min.js new file mode 100644 index 00000000000000..378e5b902131fd --- /dev/null +++ b/deps/npm/node_modules/uuid/dist/umd/uuidValidate.min.js @@ -0,0 +1 @@ +!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).uuidValidate=t()}(this,(function(){"use strict";var e=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;return function(t){return"string"==typeof t&&e.test(t)}})); \ No newline at end of file diff --git a/deps/npm/node_modules/uuid/dist/umd/uuidVersion.min.js b/deps/npm/node_modules/uuid/dist/umd/uuidVersion.min.js new file mode 100644 index 00000000000000..274bb090db76ec --- /dev/null +++ b/deps/npm/node_modules/uuid/dist/umd/uuidVersion.min.js @@ -0,0 +1 @@ +!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).uuidVersion=t()}(this,(function(){"use strict";var e=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;return function(t){if(!function(t){return"string"==typeof t&&e.test(t)}(t))throw TypeError("Invalid UUID");return parseInt(t.substr(14,1),16)}})); \ No newline at end of file diff --git a/deps/npm/node_modules/uuid/dist/umd/uuidv1.min.js b/deps/npm/node_modules/uuid/dist/umd/uuidv1.min.js new file mode 100644 index 00000000000000..b185d7ccb8d408 --- /dev/null +++ b/deps/npm/node_modules/uuid/dist/umd/uuidv1.min.js @@ -0,0 +1 @@ +!function(e,o){"object"==typeof exports&&"undefined"!=typeof module?module.exports=o():"function"==typeof define&&define.amd?define(o):(e="undefined"!=typeof globalThis?globalThis:e||self).uuidv1=o()}(this,(function(){"use strict";var e="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto),o=new Uint8Array(16);function t(){if(!e)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return e(o)}var n=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function r(e){return"string"==typeof e&&n.test(e)}for(var i,u,s=[],a=0;a<256;++a)s.push((a+256).toString(16).substr(1));var d=0,f=0;return function(e,o,n){var a=o&&n||0,c=o||new Array(16),l=(e=e||{}).node||i,p=void 0!==e.clockseq?e.clockseq:u;if(null==l||null==p){var v=e.random||(e.rng||t)();null==l&&(l=i=[1|v[0],v[1],v[2],v[3],v[4],v[5]]),null==p&&(p=u=16383&(v[6]<<8|v[7]))}var y=void 0!==e.msecs?e.msecs:Date.now(),m=void 0!==e.nsecs?e.nsecs:f+1,g=y-d+(m-f)/1e4;if(g<0&&void 0===e.clockseq&&(p=p+1&16383),(g<0||y>d)&&void 0===e.nsecs&&(m=0),m>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");d=y,f=m,u=p;var h=(1e4*(268435455&(y+=122192928e5))+m)%4294967296;c[a++]=h>>>24&255,c[a++]=h>>>16&255,c[a++]=h>>>8&255,c[a++]=255&h;var w=y/4294967296*1e4&268435455;c[a++]=w>>>8&255,c[a++]=255&w,c[a++]=w>>>24&15|16,c[a++]=w>>>16&255,c[a++]=p>>>8|128,c[a++]=255&p;for(var b=0;b<6;++b)c[a+b]=l[b];return o||function(e){var o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,t=(s[e[o+0]]+s[e[o+1]]+s[e[o+2]]+s[e[o+3]]+"-"+s[e[o+4]]+s[e[o+5]]+"-"+s[e[o+6]]+s[e[o+7]]+"-"+s[e[o+8]]+s[e[o+9]]+"-"+s[e[o+10]]+s[e[o+11]]+s[e[o+12]]+s[e[o+13]]+s[e[o+14]]+s[e[o+15]]).toLowerCase();if(!r(t))throw TypeError("Stringified UUID is invalid");return t}(c)}})); \ No newline at end of file diff --git a/deps/npm/node_modules/uuid/dist/umd/uuidv3.min.js b/deps/npm/node_modules/uuid/dist/umd/uuidv3.min.js new file mode 100644 index 00000000000000..8d37b62d708701 --- /dev/null +++ b/deps/npm/node_modules/uuid/dist/umd/uuidv3.min.js @@ -0,0 +1 @@ +!function(n,r){"object"==typeof exports&&"undefined"!=typeof module?module.exports=r():"function"==typeof define&&define.amd?define(r):(n="undefined"!=typeof globalThis?globalThis:n||self).uuidv3=r()}(this,(function(){"use strict";var n=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function r(r){return"string"==typeof r&&n.test(r)}for(var e=[],t=0;t<256;++t)e.push((t+256).toString(16).substr(1));function i(n){return 14+(n+64>>>9<<4)+1}function o(n,r){var e=(65535&n)+(65535&r);return(n>>16)+(r>>16)+(e>>16)<<16|65535&e}function a(n,r,e,t,i,a){return o((f=o(o(r,n),o(t,a)))<<(u=i)|f>>>32-u,e);var f,u}function f(n,r,e,t,i,o,f){return a(r&e|~r&t,n,r,i,o,f)}function u(n,r,e,t,i,o,f){return a(r&t|e&~t,n,r,i,o,f)}function c(n,r,e,t,i,o,f){return a(r^e^t,n,r,i,o,f)}function s(n,r,e,t,i,o,f){return a(e^(r|~t),n,r,i,o,f)}return function(n,t,i){function o(n,o,a,f){if("string"==typeof n&&(n=function(n){n=unescape(encodeURIComponent(n));for(var r=[],e=0;e>>24,t[1]=e>>>16&255,t[2]=e>>>8&255,t[3]=255&e,t[4]=(e=parseInt(n.slice(9,13),16))>>>8,t[5]=255&e,t[6]=(e=parseInt(n.slice(14,18),16))>>>8,t[7]=255&e,t[8]=(e=parseInt(n.slice(19,23),16))>>>8,t[9]=255&e,t[10]=(e=parseInt(n.slice(24,36),16))/1099511627776&255,t[11]=e/4294967296&255,t[12]=e>>>24&255,t[13]=e>>>16&255,t[14]=e>>>8&255,t[15]=255&e,t}(o)),16!==o.length)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");var u=new Uint8Array(16+n.length);if(u.set(o),u.set(n,o.length),(u=i(u))[6]=15&u[6]|t,u[8]=63&u[8]|128,a){f=f||0;for(var c=0;c<16;++c)a[f+c]=u[c];return a}return function(n){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=(e[n[t+0]]+e[n[t+1]]+e[n[t+2]]+e[n[t+3]]+"-"+e[n[t+4]]+e[n[t+5]]+"-"+e[n[t+6]]+e[n[t+7]]+"-"+e[n[t+8]]+e[n[t+9]]+"-"+e[n[t+10]]+e[n[t+11]]+e[n[t+12]]+e[n[t+13]]+e[n[t+14]]+e[n[t+15]]).toLowerCase();if(!r(i))throw TypeError("Stringified UUID is invalid");return i}(u)}try{o.name=n}catch(n){}return o.DNS="6ba7b810-9dad-11d1-80b4-00c04fd430c8",o.URL="6ba7b811-9dad-11d1-80b4-00c04fd430c8",o}("v3",48,(function(n){if("string"==typeof n){var r=unescape(encodeURIComponent(n));n=new Uint8Array(r.length);for(var e=0;e>5]>>>i%32&255,a=parseInt(t.charAt(o>>>4&15)+t.charAt(15&o),16);r.push(a)}return r}(function(n,r){n[r>>5]|=128<>5]|=(255&n[t/8])<1&&void 0!==arguments[1]?arguments[1]:0,o=(i[t[e+0]]+i[t[e+1]]+i[t[e+2]]+i[t[e+3]]+"-"+i[t[e+4]]+i[t[e+5]]+"-"+i[t[e+6]]+i[t[e+7]]+"-"+i[t[e+8]]+i[t[e+9]]+"-"+i[t[e+10]]+i[t[e+11]]+i[t[e+12]]+i[t[e+13]]+i[t[e+14]]+i[t[e+15]]).toLowerCase();if(!r(o))throw TypeError("Stringified UUID is invalid");return o}(u)}})); \ No newline at end of file diff --git a/deps/npm/node_modules/uuid/dist/umd/uuidv5.min.js b/deps/npm/node_modules/uuid/dist/umd/uuidv5.min.js new file mode 100644 index 00000000000000..ba6fc63da76e4e --- /dev/null +++ b/deps/npm/node_modules/uuid/dist/umd/uuidv5.min.js @@ -0,0 +1 @@ +!function(r,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(r="undefined"!=typeof globalThis?globalThis:r||self).uuidv5=e()}(this,(function(){"use strict";var r=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function e(e){return"string"==typeof e&&r.test(e)}for(var t=[],n=0;n<256;++n)t.push((n+256).toString(16).substr(1));function a(r,e,t,n){switch(r){case 0:return e&t^~e&n;case 1:return e^t^n;case 2:return e&t^e&n^t&n;case 3:return e^t^n}}function o(r,e){return r<>>32-e}return function(r,n,a){function o(r,o,i,f){if("string"==typeof r&&(r=function(r){r=unescape(encodeURIComponent(r));for(var e=[],t=0;t>>24,n[1]=t>>>16&255,n[2]=t>>>8&255,n[3]=255&t,n[4]=(t=parseInt(r.slice(9,13),16))>>>8,n[5]=255&t,n[6]=(t=parseInt(r.slice(14,18),16))>>>8,n[7]=255&t,n[8]=(t=parseInt(r.slice(19,23),16))>>>8,n[9]=255&t,n[10]=(t=parseInt(r.slice(24,36),16))/1099511627776&255,n[11]=t/4294967296&255,n[12]=t>>>24&255,n[13]=t>>>16&255,n[14]=t>>>8&255,n[15]=255&t,n}(o)),16!==o.length)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");var s=new Uint8Array(16+r.length);if(s.set(o),s.set(r,o.length),(s=a(s))[6]=15&s[6]|n,s[8]=63&s[8]|128,i){f=f||0;for(var u=0;u<16;++u)i[f+u]=s[u];return i}return function(r){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,a=(t[r[n+0]]+t[r[n+1]]+t[r[n+2]]+t[r[n+3]]+"-"+t[r[n+4]]+t[r[n+5]]+"-"+t[r[n+6]]+t[r[n+7]]+"-"+t[r[n+8]]+t[r[n+9]]+"-"+t[r[n+10]]+t[r[n+11]]+t[r[n+12]]+t[r[n+13]]+t[r[n+14]]+t[r[n+15]]).toLowerCase();if(!e(a))throw TypeError("Stringified UUID is invalid");return a}(s)}try{o.name=r}catch(r){}return o.DNS="6ba7b810-9dad-11d1-80b4-00c04fd430c8",o.URL="6ba7b811-9dad-11d1-80b4-00c04fd430c8",o}("v5",80,(function(r){var e=[1518500249,1859775393,2400959708,3395469782],t=[1732584193,4023233417,2562383102,271733878,3285377520];if("string"==typeof r){var n=unescape(encodeURIComponent(r));r=[];for(var i=0;i>>0;A=U,U=w,w=o(b,30)>>>0,b=g,g=C}t[0]=t[0]+g>>>0,t[1]=t[1]+b>>>0,t[2]=t[2]+w>>>0,t[3]=t[3]+U>>>0,t[4]=t[4]+A>>>0}return[t[0]>>24&255,t[0]>>16&255,t[0]>>8&255,255&t[0],t[1]>>24&255,t[1]>>16&255,t[1]>>8&255,255&t[1],t[2]>>24&255,t[2]>>16&255,t[2]>>8&255,255&t[2],t[3]>>24&255,t[3]>>16&255,t[3]>>8&255,255&t[3],t[4]>>24&255,t[4]>>16&255,t[4]>>8&255,255&t[4]]}))})); \ No newline at end of file diff --git a/deps/npm/node_modules/uuid/dist/uuid-bin.js b/deps/npm/node_modules/uuid/dist/uuid-bin.js new file mode 100644 index 00000000000000..50a7a9f17a065c --- /dev/null +++ b/deps/npm/node_modules/uuid/dist/uuid-bin.js @@ -0,0 +1,85 @@ +"use strict"; + +var _assert = _interopRequireDefault(require("assert")); + +var _v = _interopRequireDefault(require("./v1.js")); + +var _v2 = _interopRequireDefault(require("./v3.js")); + +var _v3 = _interopRequireDefault(require("./v4.js")); + +var _v4 = _interopRequireDefault(require("./v5.js")); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function usage() { + console.log('Usage:'); + console.log(' uuid'); + console.log(' uuid v1'); + console.log(' uuid v3 '); + console.log(' uuid v4'); + console.log(' uuid v5 '); + console.log(' uuid --help'); + console.log('\nNote: may be "URL" or "DNS" to use the corresponding UUIDs defined by RFC4122'); +} + +const args = process.argv.slice(2); + +if (args.indexOf('--help') >= 0) { + usage(); + process.exit(0); +} + +const version = args.shift() || 'v4'; + +switch (version) { + case 'v1': + console.log((0, _v.default)()); + break; + + case 'v3': + { + const name = args.shift(); + let namespace = args.shift(); + (0, _assert.default)(name != null, 'v3 name not specified'); + (0, _assert.default)(namespace != null, 'v3 namespace not specified'); + + if (namespace === 'URL') { + namespace = _v2.default.URL; + } + + if (namespace === 'DNS') { + namespace = _v2.default.DNS; + } + + console.log((0, _v2.default)(name, namespace)); + break; + } + + case 'v4': + console.log((0, _v3.default)()); + break; + + case 'v5': + { + const name = args.shift(); + let namespace = args.shift(); + (0, _assert.default)(name != null, 'v5 name not specified'); + (0, _assert.default)(namespace != null, 'v5 namespace not specified'); + + if (namespace === 'URL') { + namespace = _v4.default.URL; + } + + if (namespace === 'DNS') { + namespace = _v4.default.DNS; + } + + console.log((0, _v4.default)(name, namespace)); + break; + } + + default: + usage(); + process.exit(1); +} \ No newline at end of file diff --git a/deps/npm/node_modules/uuid/dist/v1.js b/deps/npm/node_modules/uuid/dist/v1.js new file mode 100644 index 00000000000000..abb9b3d1672a32 --- /dev/null +++ b/deps/npm/node_modules/uuid/dist/v1.js @@ -0,0 +1,107 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +var _rng = _interopRequireDefault(require("./rng.js")); + +var _stringify = _interopRequireDefault(require("./stringify.js")); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +// **`v1()` - Generate time-based UUID** +// +// Inspired by https://github.com/LiosK/UUID.js +// and http://docs.python.org/library/uuid.html +let _nodeId; + +let _clockseq; // Previous uuid creation time + + +let _lastMSecs = 0; +let _lastNSecs = 0; // See https://github.com/uuidjs/uuid for API details + +function v1(options, buf, offset) { + let i = buf && offset || 0; + const b = buf || new Array(16); + options = options || {}; + let node = options.node || _nodeId; + let clockseq = options.clockseq !== undefined ? options.clockseq : _clockseq; // node and clockseq need to be initialized to random values if they're not + // specified. We do this lazily to minimize issues related to insufficient + // system entropy. See #189 + + if (node == null || clockseq == null) { + const seedBytes = options.random || (options.rng || _rng.default)(); + + if (node == null) { + // Per 4.5, create and 48-bit node id, (47 random bits + multicast bit = 1) + node = _nodeId = [seedBytes[0] | 0x01, seedBytes[1], seedBytes[2], seedBytes[3], seedBytes[4], seedBytes[5]]; + } + + if (clockseq == null) { + // Per 4.2.2, randomize (14 bit) clockseq + clockseq = _clockseq = (seedBytes[6] << 8 | seedBytes[7]) & 0x3fff; + } + } // UUID timestamps are 100 nano-second units since the Gregorian epoch, + // (1582-10-15 00:00). JSNumbers aren't precise enough for this, so + // time is handled internally as 'msecs' (integer milliseconds) and 'nsecs' + // (100-nanoseconds offset from msecs) since unix epoch, 1970-01-01 00:00. + + + let msecs = options.msecs !== undefined ? options.msecs : Date.now(); // Per 4.2.1.2, use count of uuid's generated during the current clock + // cycle to simulate higher resolution clock + + let nsecs = options.nsecs !== undefined ? options.nsecs : _lastNSecs + 1; // Time since last uuid creation (in msecs) + + const dt = msecs - _lastMSecs + (nsecs - _lastNSecs) / 10000; // Per 4.2.1.2, Bump clockseq on clock regression + + if (dt < 0 && options.clockseq === undefined) { + clockseq = clockseq + 1 & 0x3fff; + } // Reset nsecs if clock regresses (new clockseq) or we've moved onto a new + // time interval + + + if ((dt < 0 || msecs > _lastMSecs) && options.nsecs === undefined) { + nsecs = 0; + } // Per 4.2.1.2 Throw error if too many uuids are requested + + + if (nsecs >= 10000) { + throw new Error("uuid.v1(): Can't create more than 10M uuids/sec"); + } + + _lastMSecs = msecs; + _lastNSecs = nsecs; + _clockseq = clockseq; // Per 4.1.4 - Convert from unix epoch to Gregorian epoch + + msecs += 12219292800000; // `time_low` + + const tl = ((msecs & 0xfffffff) * 10000 + nsecs) % 0x100000000; + b[i++] = tl >>> 24 & 0xff; + b[i++] = tl >>> 16 & 0xff; + b[i++] = tl >>> 8 & 0xff; + b[i++] = tl & 0xff; // `time_mid` + + const tmh = msecs / 0x100000000 * 10000 & 0xfffffff; + b[i++] = tmh >>> 8 & 0xff; + b[i++] = tmh & 0xff; // `time_high_and_version` + + b[i++] = tmh >>> 24 & 0xf | 0x10; // include version + + b[i++] = tmh >>> 16 & 0xff; // `clock_seq_hi_and_reserved` (Per 4.2.2 - include variant) + + b[i++] = clockseq >>> 8 | 0x80; // `clock_seq_low` + + b[i++] = clockseq & 0xff; // `node` + + for (let n = 0; n < 6; ++n) { + b[i + n] = node[n]; + } + + return buf || (0, _stringify.default)(b); +} + +var _default = v1; +exports.default = _default; \ No newline at end of file diff --git a/deps/npm/node_modules/uuid/dist/v3.js b/deps/npm/node_modules/uuid/dist/v3.js new file mode 100644 index 00000000000000..6b47ff517535a6 --- /dev/null +++ b/deps/npm/node_modules/uuid/dist/v3.js @@ -0,0 +1,16 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +var _v = _interopRequireDefault(require("./v35.js")); + +var _md = _interopRequireDefault(require("./md5.js")); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +const v3 = (0, _v.default)('v3', 0x30, _md.default); +var _default = v3; +exports.default = _default; \ No newline at end of file diff --git a/deps/npm/node_modules/uuid/dist/v35.js b/deps/npm/node_modules/uuid/dist/v35.js new file mode 100644 index 00000000000000..f784c6337fa0e2 --- /dev/null +++ b/deps/npm/node_modules/uuid/dist/v35.js @@ -0,0 +1,78 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = _default; +exports.URL = exports.DNS = void 0; + +var _stringify = _interopRequireDefault(require("./stringify.js")); + +var _parse = _interopRequireDefault(require("./parse.js")); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function stringToBytes(str) { + str = unescape(encodeURIComponent(str)); // UTF8 escape + + const bytes = []; + + for (let i = 0; i < str.length; ++i) { + bytes.push(str.charCodeAt(i)); + } + + return bytes; +} + +const DNS = '6ba7b810-9dad-11d1-80b4-00c04fd430c8'; +exports.DNS = DNS; +const URL = '6ba7b811-9dad-11d1-80b4-00c04fd430c8'; +exports.URL = URL; + +function _default(name, version, hashfunc) { + function generateUUID(value, namespace, buf, offset) { + if (typeof value === 'string') { + value = stringToBytes(value); + } + + if (typeof namespace === 'string') { + namespace = (0, _parse.default)(namespace); + } + + if (namespace.length !== 16) { + throw TypeError('Namespace must be array-like (16 iterable integer values, 0-255)'); + } // Compute hash of namespace and value, Per 4.3 + // Future: Use spread syntax when supported on all platforms, e.g. `bytes = + // hashfunc([...namespace, ... value])` + + + let bytes = new Uint8Array(16 + value.length); + bytes.set(namespace); + bytes.set(value, namespace.length); + bytes = hashfunc(bytes); + bytes[6] = bytes[6] & 0x0f | version; + bytes[8] = bytes[8] & 0x3f | 0x80; + + if (buf) { + offset = offset || 0; + + for (let i = 0; i < 16; ++i) { + buf[offset + i] = bytes[i]; + } + + return buf; + } + + return (0, _stringify.default)(bytes); + } // Function#name is not settable on some platforms (#270) + + + try { + generateUUID.name = name; // eslint-disable-next-line no-empty + } catch (err) {} // For CommonJS default export support + + + generateUUID.DNS = DNS; + generateUUID.URL = URL; + return generateUUID; +} \ No newline at end of file diff --git a/deps/npm/node_modules/uuid/dist/v4.js b/deps/npm/node_modules/uuid/dist/v4.js new file mode 100644 index 00000000000000..838ce0b28d7436 --- /dev/null +++ b/deps/npm/node_modules/uuid/dist/v4.js @@ -0,0 +1,37 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +var _rng = _interopRequireDefault(require("./rng.js")); + +var _stringify = _interopRequireDefault(require("./stringify.js")); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function v4(options, buf, offset) { + options = options || {}; + + const rnds = options.random || (options.rng || _rng.default)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved` + + + rnds[6] = rnds[6] & 0x0f | 0x40; + rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided + + if (buf) { + offset = offset || 0; + + for (let i = 0; i < 16; ++i) { + buf[offset + i] = rnds[i]; + } + + return buf; + } + + return (0, _stringify.default)(rnds); +} + +var _default = v4; +exports.default = _default; \ No newline at end of file diff --git a/deps/npm/node_modules/uuid/dist/v5.js b/deps/npm/node_modules/uuid/dist/v5.js new file mode 100644 index 00000000000000..99d615e096c5e1 --- /dev/null +++ b/deps/npm/node_modules/uuid/dist/v5.js @@ -0,0 +1,16 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +var _v = _interopRequireDefault(require("./v35.js")); + +var _sha = _interopRequireDefault(require("./sha1.js")); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +const v5 = (0, _v.default)('v5', 0x50, _sha.default); +var _default = v5; +exports.default = _default; \ No newline at end of file diff --git a/deps/npm/node_modules/uuid/dist/validate.js b/deps/npm/node_modules/uuid/dist/validate.js new file mode 100644 index 00000000000000..fd052157d4400d --- /dev/null +++ b/deps/npm/node_modules/uuid/dist/validate.js @@ -0,0 +1,17 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +var _regex = _interopRequireDefault(require("./regex.js")); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function validate(uuid) { + return typeof uuid === 'string' && _regex.default.test(uuid); +} + +var _default = validate; +exports.default = _default; \ No newline at end of file diff --git a/deps/npm/node_modules/uuid/dist/version.js b/deps/npm/node_modules/uuid/dist/version.js new file mode 100644 index 00000000000000..b72949cdb96e7e --- /dev/null +++ b/deps/npm/node_modules/uuid/dist/version.js @@ -0,0 +1,21 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +var _validate = _interopRequireDefault(require("./validate.js")); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function version(uuid) { + if (!(0, _validate.default)(uuid)) { + throw TypeError('Invalid UUID'); + } + + return parseInt(uuid.substr(14, 1), 16); +} + +var _default = version; +exports.default = _default; \ No newline at end of file diff --git a/deps/npm/node_modules/uuid/lib/bytesToUuid.js b/deps/npm/node_modules/uuid/lib/bytesToUuid.js deleted file mode 100644 index 847c482843c820..00000000000000 --- a/deps/npm/node_modules/uuid/lib/bytesToUuid.js +++ /dev/null @@ -1,24 +0,0 @@ -/** - * Convert array of 16 byte values to UUID string format of the form: - * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX - */ -var byteToHex = []; -for (var i = 0; i < 256; ++i) { - byteToHex[i] = (i + 0x100).toString(16).substr(1); -} - -function bytesToUuid(buf, offset) { - var i = offset || 0; - var bth = byteToHex; - // join used to fix memory issue caused by concatenation: https://bugs.chromium.org/p/v8/issues/detail?id=3175#c4 - return ([bth[buf[i++]], bth[buf[i++]], - bth[buf[i++]], bth[buf[i++]], '-', - bth[buf[i++]], bth[buf[i++]], '-', - bth[buf[i++]], bth[buf[i++]], '-', - bth[buf[i++]], bth[buf[i++]], '-', - bth[buf[i++]], bth[buf[i++]], - bth[buf[i++]], bth[buf[i++]], - bth[buf[i++]], bth[buf[i++]]]).join(''); -} - -module.exports = bytesToUuid; diff --git a/deps/npm/node_modules/uuid/package.json b/deps/npm/node_modules/uuid/package.json index 2ffe04e3d7ea5e..5c5ab2a496f1c0 100644 --- a/deps/npm/node_modules/uuid/package.json +++ b/deps/npm/node_modules/uuid/package.json @@ -1,98 +1,135 @@ { - "_from": "uuid@3.3.3", - "_id": "uuid@3.3.3", - "_inBundle": false, - "_integrity": "sha512-pW0No1RGHgzlpHJO1nsVrHKpOEIxkGg1xB+v0ZmdNH5OAeAwzAVrCnI2/6Mtx+Uys6iaylxa+D3g4j63IKKjSQ==", - "_location": "/uuid", - "_phantomChildren": {}, - "_requested": { - "type": "version", - "registry": true, - "raw": "uuid@3.3.3", - "name": "uuid", - "escapedName": "uuid", - "rawSpec": "3.3.3", - "saveSpec": null, - "fetchSpec": "3.3.3" - }, - "_requiredBy": [ - "#USER", - "/", - "/nyc", - "/request" - ], - "_resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.3.tgz", - "_shasum": "4568f0216e78760ee1dbf3a4d2cf53e224112866", - "_spec": "uuid@3.3.3", - "_where": "/Users/mperrotte/npminc/cli", - "bin": { - "uuid": "./bin/uuid" - }, - "browser": { - "./lib/rng.js": "./lib/rng-browser.js", - "./lib/sha1.js": "./lib/sha1-browser.js", - "./lib/md5.js": "./lib/md5-browser.js" - }, - "bugs": { - "url": "https://github.com/kelektiv/node-uuid/issues" - }, - "bundleDependencies": false, + "name": "uuid", + "version": "8.3.1", + "description": "RFC4122 (v1, v4, and v5) UUIDs", "commitlint": { "extends": [ "@commitlint/config-conventional" ] }, - "contributors": [ - { - "name": "Robert Kieffer", - "email": "robert@broofa.com" - }, - { - "name": "Christoph Tavan", - "email": "dev@tavan.de" - }, - { - "name": "AJ ONeal", - "email": "coolaj86@gmail.com" - }, - { - "name": "Vincent Voyer", - "email": "vincent@zeroload.net" - }, - { - "name": "Roman Shtylman", - "email": "shtylman@gmail.com" - } - ], - "deprecated": false, - "description": "RFC4122 (v1, v4, and v5) UUIDs", - "devDependencies": { - "@commitlint/cli": "8.1.0", - "@commitlint/config-conventional": "8.1.0", - "eslint": "6.2.0", - "husky": "3.0.4", - "mocha": "6.2.0", - "runmd": "1.2.1", - "standard-version": "7.0.0" - }, - "homepage": "https://github.com/kelektiv/node-uuid#readme", "keywords": [ "uuid", "guid", "rfc4122" ], "license": "MIT", - "name": "uuid", - "repository": { - "type": "git", - "url": "git+https://github.com/kelektiv/node-uuid.git" + "bin": { + "uuid": "./dist/bin/uuid" + }, + "sideEffects": false, + "main": "./dist/index.js", + "exports": { + ".": { + "node": { + "module": "./dist/esm-node/index.js", + "require": "./dist/index.js", + "import": "./wrapper.mjs" + }, + "default": "./dist/esm-browser/index.js" + }, + "./package.json": "./package.json" + }, + "module": "./dist/esm-node/index.js", + "browser": { + "./dist/md5.js": "./dist/md5-browser.js", + "./dist/rng.js": "./dist/rng-browser.js", + "./dist/sha1.js": "./dist/sha1-browser.js", + "./dist/esm-node/index.js": "./dist/esm-browser/index.js" + }, + "files": [ + "CHANGELOG.md", + "CONTRIBUTING.md", + "LICENSE.md", + "README.md", + "dist", + "wrapper.mjs" + ], + "devDependencies": { + "@babel/cli": "7.11.6", + "@babel/core": "7.11.6", + "@babel/preset-env": "7.11.5", + "@commitlint/cli": "11.0.0", + "@commitlint/config-conventional": "11.0.0", + "@rollup/plugin-node-resolve": "9.0.0", + "babel-eslint": "10.1.0", + "bundlewatch": "0.3.1", + "eslint": "7.10.0", + "eslint-config-prettier": "6.12.0", + "eslint-config-standard": "14.1.1", + "eslint-plugin-import": "2.22.1", + "eslint-plugin-node": "11.1.0", + "eslint-plugin-prettier": "3.1.4", + "eslint-plugin-promise": "4.2.1", + "eslint-plugin-standard": "4.0.1", + "husky": "4.3.0", + "jest": "25.5.4", + "lint-staged": "10.4.0", + "npm-run-all": "4.1.5", + "optional-dev-dependency": "2.0.1", + "prettier": "2.1.2", + "random-seed": "0.3.0", + "rollup": "2.28.2", + "rollup-plugin-terser": "7.0.2", + "runmd": "1.3.2", + "standard-version": "9.0.0" + }, + "optionalDevDependencies": { + "@wdio/browserstack-service": "6.4.0", + "@wdio/cli": "6.4.0", + "@wdio/jasmine-framework": "6.4.0", + "@wdio/local-runner": "6.4.0", + "@wdio/spec-reporter": "6.4.0", + "@wdio/static-server-service": "6.4.0", + "@wdio/sync": "6.4.0" }, "scripts": { - "commitmsg": "commitlint -E HUSKY_GIT_PARAMS", + "examples:browser:webpack:build": "cd examples/browser-webpack && npm install && npm run build", + "examples:browser:rollup:build": "cd examples/browser-rollup && npm install && npm run build", + "examples:node:commonjs:test": "cd examples/node-commonjs && npm install && npm test", + "examples:node:esmodules:test": "cd examples/node-esmodules && npm install && npm test", + "lint": "npm run eslint:check && npm run prettier:check", + "eslint:check": "eslint src/ test/ examples/ *.js", + "eslint:fix": "eslint --fix src/ test/ examples/ *.js", + "pretest": "[ -n $CI ] || npm run build", + "test": "BABEL_ENV=commonjs node --throw-deprecation node_modules/.bin/jest test/unit/", + "pretest:browser": "optional-dev-dependency && npm run build && npm-run-all --parallel examples:browser:**", + "test:browser": "wdio run ./wdio.conf.js", + "pretest:node": "npm run build", + "test:node": "npm-run-all --parallel examples:node:**", + "test:pack": "./scripts/testpack.sh", + "pretest:benchmark": "npm run build", + "test:benchmark": "cd examples/benchmark && npm install && npm test", + "prettier:check": "prettier --ignore-path .prettierignore --check '**/*.{js,jsx,json,md}'", + "prettier:fix": "prettier --ignore-path .prettierignore --write '**/*.{js,jsx,json,md}'", + "bundlewatch": "npm run pretest:browser && bundlewatch --config bundlewatch.config.json", "md": "runmd --watch --output=README.md README_js.md", - "prepare": "runmd --output=README.md README_js.md", - "release": "standard-version", - "test": "mocha test/test.js" + "docs": "( node --version | grep -q 'v12' ) && ( npm run build && runmd --output=README.md README_js.md )", + "docs:diff": "npm run docs && git diff --quiet README.md", + "build": "./scripts/build.sh", + "prepack": "npm run build", + "release": "standard-version --no-verify" }, - "version": "3.3.3" + "repository": { + "type": "git", + "url": "https://github.com/uuidjs/uuid.git" + }, + "husky": { + "hooks": { + "commit-msg": "commitlint -E HUSKY_GIT_PARAMS", + "pre-commit": "lint-staged" + } + }, + "lint-staged": { + "*.{js,jsx,json,md}": [ + "prettier --write" + ], + "*.{js,jsx}": [ + "eslint --fix" + ] + }, + "standard-version": { + "scripts": { + "postchangelog": "prettier --write CHANGELOG.md" + } + } } diff --git a/deps/npm/node_modules/uuid/v1.js b/deps/npm/node_modules/uuid/v1.js deleted file mode 100644 index d84c0f4523d945..00000000000000 --- a/deps/npm/node_modules/uuid/v1.js +++ /dev/null @@ -1,109 +0,0 @@ -var rng = require('./lib/rng'); -var bytesToUuid = require('./lib/bytesToUuid'); - -// **`v1()` - Generate time-based UUID** -// -// Inspired by https://github.com/LiosK/UUID.js -// and http://docs.python.org/library/uuid.html - -var _nodeId; -var _clockseq; - -// Previous uuid creation time -var _lastMSecs = 0; -var _lastNSecs = 0; - -// See https://github.com/broofa/node-uuid for API details -function v1(options, buf, offset) { - var i = buf && offset || 0; - var b = buf || []; - - options = options || {}; - var node = options.node || _nodeId; - var clockseq = options.clockseq !== undefined ? options.clockseq : _clockseq; - - // node and clockseq need to be initialized to random values if they're not - // specified. We do this lazily to minimize issues related to insufficient - // system entropy. See #189 - if (node == null || clockseq == null) { - var seedBytes = rng(); - if (node == null) { - // Per 4.5, create and 48-bit node id, (47 random bits + multicast bit = 1) - node = _nodeId = [ - seedBytes[0] | 0x01, - seedBytes[1], seedBytes[2], seedBytes[3], seedBytes[4], seedBytes[5] - ]; - } - if (clockseq == null) { - // Per 4.2.2, randomize (14 bit) clockseq - clockseq = _clockseq = (seedBytes[6] << 8 | seedBytes[7]) & 0x3fff; - } - } - - // UUID timestamps are 100 nano-second units since the Gregorian epoch, - // (1582-10-15 00:00). JSNumbers aren't precise enough for this, so - // time is handled internally as 'msecs' (integer milliseconds) and 'nsecs' - // (100-nanoseconds offset from msecs) since unix epoch, 1970-01-01 00:00. - var msecs = options.msecs !== undefined ? options.msecs : new Date().getTime(); - - // Per 4.2.1.2, use count of uuid's generated during the current clock - // cycle to simulate higher resolution clock - var nsecs = options.nsecs !== undefined ? options.nsecs : _lastNSecs + 1; - - // Time since last uuid creation (in msecs) - var dt = (msecs - _lastMSecs) + (nsecs - _lastNSecs)/10000; - - // Per 4.2.1.2, Bump clockseq on clock regression - if (dt < 0 && options.clockseq === undefined) { - clockseq = clockseq + 1 & 0x3fff; - } - - // Reset nsecs if clock regresses (new clockseq) or we've moved onto a new - // time interval - if ((dt < 0 || msecs > _lastMSecs) && options.nsecs === undefined) { - nsecs = 0; - } - - // Per 4.2.1.2 Throw error if too many uuids are requested - if (nsecs >= 10000) { - throw new Error('uuid.v1(): Can\'t create more than 10M uuids/sec'); - } - - _lastMSecs = msecs; - _lastNSecs = nsecs; - _clockseq = clockseq; - - // Per 4.1.4 - Convert from unix epoch to Gregorian epoch - msecs += 12219292800000; - - // `time_low` - var tl = ((msecs & 0xfffffff) * 10000 + nsecs) % 0x100000000; - b[i++] = tl >>> 24 & 0xff; - b[i++] = tl >>> 16 & 0xff; - b[i++] = tl >>> 8 & 0xff; - b[i++] = tl & 0xff; - - // `time_mid` - var tmh = (msecs / 0x100000000 * 10000) & 0xfffffff; - b[i++] = tmh >>> 8 & 0xff; - b[i++] = tmh & 0xff; - - // `time_high_and_version` - b[i++] = tmh >>> 24 & 0xf | 0x10; // include version - b[i++] = tmh >>> 16 & 0xff; - - // `clock_seq_hi_and_reserved` (Per 4.2.2 - include variant) - b[i++] = clockseq >>> 8 | 0x80; - - // `clock_seq_low` - b[i++] = clockseq & 0xff; - - // `node` - for (var n = 0; n < 6; ++n) { - b[i + n] = node[n]; - } - - return buf ? buf : bytesToUuid(b); -} - -module.exports = v1; diff --git a/deps/npm/node_modules/uuid/wrapper.mjs b/deps/npm/node_modules/uuid/wrapper.mjs new file mode 100644 index 00000000000000..c31e9cef45e2b9 --- /dev/null +++ b/deps/npm/node_modules/uuid/wrapper.mjs @@ -0,0 +1,10 @@ +import uuid from './dist/index.js'; +export const v1 = uuid.v1; +export const v3 = uuid.v3; +export const v4 = uuid.v4; +export const v5 = uuid.v5; +export const NIL = uuid.NIL; +export const version = uuid.version; +export const validate = uuid.validate; +export const stringify = uuid.stringify; +export const parse = uuid.parse; diff --git a/deps/npm/node_modules/validate-npm-package-license/package.json b/deps/npm/node_modules/validate-npm-package-license/package.json index b0adef58a96f13..9e92af4f44656c 100644 --- a/deps/npm/node_modules/validate-npm-package-license/package.json +++ b/deps/npm/node_modules/validate-npm-package-license/package.json @@ -1,56 +1,19 @@ { - "_from": "validate-npm-package-license@3.0.4", - "_id": "validate-npm-package-license@3.0.4", - "_inBundle": false, - "_integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==", - "_location": "/validate-npm-package-license", - "_phantomChildren": {}, - "_requested": { - "type": "version", - "registry": true, - "raw": "validate-npm-package-license@3.0.4", - "name": "validate-npm-package-license", - "escapedName": "validate-npm-package-license", - "rawSpec": "3.0.4", - "saveSpec": null, - "fetchSpec": "3.0.4" - }, - "_requiredBy": [ - "#USER", - "/", - "/init-package-json", - "/normalize-package-data" - ], - "_resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", - "_shasum": "fc91f6b9c7ba15c857f4cb2c5defeec39d4f410a", - "_spec": "validate-npm-package-license@3.0.4", - "_where": "/Users/zkat/Documents/code/work/npm", - "author": { - "name": "Kyle E. Mitchell", - "email": "kyle@kemitchell.com", - "url": "https://kemitchell.com" - }, - "bugs": { - "url": "https://github.com/kemitchell/validate-npm-package-license.js/issues" - }, - "bundleDependencies": false, + "name": "validate-npm-package-license", + "description": "Give me a string and I'll tell you if it's a valid npm package license string", + "version": "3.0.4", + "author": "Kyle E. Mitchell (https://kemitchell.com)", "contributors": [ - { - "name": "Mark Stacey", - "email": "markjstacey@gmail.com" - } + "Mark Stacey " ], "dependencies": { "spdx-correct": "^3.0.0", "spdx-expression-parse": "^3.0.0" }, - "deprecated": false, - "description": "Give me a string and I'll tell you if it's a valid npm package license string", "devDependencies": { "defence-cli": "^2.0.1", "replace-require-self": "^1.0.0" }, - "homepage": "https://github.com/kemitchell/validate-npm-package-license.js#readme", "keywords": [ "license", "npm", @@ -58,13 +21,8 @@ "validation" ], "license": "Apache-2.0", - "name": "validate-npm-package-license", - "repository": { - "type": "git", - "url": "git+https://github.com/kemitchell/validate-npm-package-license.js.git" - }, + "repository": "kemitchell/validate-npm-package-license.js", "scripts": { "test": "defence README.md | replace-require-self | node" - }, - "version": "3.0.4" + } } diff --git a/deps/npm/node_modules/validate-npm-package-name/package.json b/deps/npm/node_modules/validate-npm-package-name/package.json index 197e156c2e8ae5..b72e9ef03b08c7 100644 --- a/deps/npm/node_modules/validate-npm-package-name/package.json +++ b/deps/npm/node_modules/validate-npm-package-name/package.json @@ -1,70 +1,38 @@ { - "_args": [ - [ - "validate-npm-package-name@3.0.0", - "/Users/rebecca/code/npm" - ] - ], - "_from": "validate-npm-package-name@3.0.0", - "_id": "validate-npm-package-name@3.0.0", - "_inBundle": false, - "_integrity": "sha1-X6kS2B630MdK/BQN5zF/DKffQ34=", - "_location": "/validate-npm-package-name", - "_phantomChildren": {}, - "_requested": { - "type": "version", - "registry": true, - "raw": "validate-npm-package-name@3.0.0", - "name": "validate-npm-package-name", - "escapedName": "validate-npm-package-name", - "rawSpec": "3.0.0", - "saveSpec": null, - "fetchSpec": "3.0.0" - }, - "_requiredBy": [ - "/", - "/init-package-json", - "/npm-package-arg" - ], - "_resolved": "https://registry.npmjs.org/validate-npm-package-name/-/validate-npm-package-name-3.0.0.tgz", - "_spec": "3.0.0", - "_where": "/Users/rebecca/code/npm", - "author": { - "name": "zeke" - }, - "bugs": { - "url": "https://github.com/npm/validate-npm-package-name/issues" + "name": "validate-npm-package-name", + "version": "3.0.0", + "description": "Give me a string and I'll tell you if it's a valid npm package name", + "main": "index.js", + "directories": { + "test": "test" }, "dependencies": { "builtins": "^1.0.3" }, - "description": "Give me a string and I'll tell you if it's a valid npm package name", "devDependencies": { "standard": "^8.6.0", "tap": "^10.0.0" }, - "directories": { - "test": "test" + "scripts": { + "cov:test": "TAP_FLAGS='--cov' npm run test:code", + "test:code": "tap ${TAP_FLAGS:-'--'} test/*.js", + "test:style": "standard", + "test": "npm run test:code && npm run test:style" + }, + "repository": { + "type": "git", + "url": "https://github.com/npm/validate-npm-package-name" }, - "homepage": "https://github.com/npm/validate-npm-package-name", "keywords": [ "npm", "package", "names", "validation" ], + "author": "zeke", "license": "ISC", - "main": "index.js", - "name": "validate-npm-package-name", - "repository": { - "type": "git", - "url": "git+https://github.com/npm/validate-npm-package-name.git" - }, - "scripts": { - "cov:test": "TAP_FLAGS='--cov' npm run test:code", - "test": "npm run test:code && npm run test:style", - "test:code": "tap ${TAP_FLAGS:-'--'} test/*.js", - "test:style": "standard" + "bugs": { + "url": "https://github.com/npm/validate-npm-package-name/issues" }, - "version": "3.0.0" + "homepage": "https://github.com/npm/validate-npm-package-name" } diff --git a/deps/npm/node_modules/verror/CONTRIBUTING.md b/deps/npm/node_modules/verror/CONTRIBUTING.md new file mode 100644 index 00000000000000..750cef8dfd54a6 --- /dev/null +++ b/deps/npm/node_modules/verror/CONTRIBUTING.md @@ -0,0 +1,19 @@ +# Contributing + +This repository uses [cr.joyent.us](https://cr.joyent.us) (Gerrit) for new +changes. Anyone can submit changes. To get started, see the [cr.joyent.us user +guide](https://github.com/joyent/joyent-gerrit/blob/master/docs/user/README.md). +This repo does not use GitHub pull requests. + +See the [Joyent Engineering +Guidelines](https://github.com/joyent/eng/blob/master/docs/index.md) for general +best practices expected in this repository. + +Contributions should be "make prepush" clean. The "prepush" target runs the +"check" target, which requires these separate tools: + +* https://github.com/davepacheco/jsstyle +* https://github.com/davepacheco/javascriptlint + +If you're changing something non-trivial or user-facing, you may want to submit +an issue first. diff --git a/deps/npm/node_modules/verror/package.json b/deps/npm/node_modules/verror/package.json index 35cc37851cce96..79295c57a80b89 100644 --- a/deps/npm/node_modules/verror/package.json +++ b/deps/npm/node_modules/verror/package.json @@ -1,51 +1,22 @@ { - "_from": "verror@1.10.0", - "_id": "verror@1.10.0", - "_inBundle": false, - "_integrity": "sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=", - "_location": "/verror", - "_phantomChildren": {}, - "_requested": { - "type": "version", - "registry": true, - "raw": "verror@1.10.0", - "name": "verror", - "escapedName": "verror", - "rawSpec": "1.10.0", - "saveSpec": null, - "fetchSpec": "1.10.0" - }, - "_requiredBy": [ - "/jsprim" - ], - "_resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", - "_shasum": "3a105ca17053af55d6e270c1f8288682e18da400", - "_spec": "verror@1.10.0", - "_where": "/Users/rebecca/code/npm/node_modules/jsprim", - "bugs": { - "url": "https://github.com/davepacheco/node-verror/issues" - }, - "bundleDependencies": false, - "dependencies": { - "assert-plus": "^1.0.0", - "core-util-is": "1.0.2", - "extsprintf": "^1.2.0" - }, - "deprecated": false, - "description": "richer JavaScript errors", - "engines": [ - "node >=0.6.0" - ], - "homepage": "https://github.com/davepacheco/node-verror#readme", - "license": "MIT", - "main": "./lib/verror.js", - "name": "verror", - "repository": { - "type": "git", - "url": "git://github.com/davepacheco/node-verror.git" - }, - "scripts": { - "test": "make test" - }, - "version": "1.10.0" + "name": "verror", + "version": "1.10.0", + "description": "richer JavaScript errors", + "main": "./lib/verror.js", + "repository": { + "type": "git", + "url": "git://github.com/davepacheco/node-verror.git" + }, + "dependencies": { + "assert-plus": "^1.0.0", + "core-util-is": "1.0.2", + "extsprintf": "^1.2.0" + }, + "engines": [ + "node >=0.6.0" + ], + "scripts": { + "test": "make test" + }, + "license": "MIT" } diff --git a/deps/npm/node_modules/walk-up-path/LICENSE b/deps/npm/node_modules/walk-up-path/LICENSE new file mode 100644 index 00000000000000..05eeeb88c2ef4c --- /dev/null +++ b/deps/npm/node_modules/walk-up-path/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/deps/npm/node_modules/walk-up-path/README.md b/deps/npm/node_modules/walk-up-path/README.md new file mode 100644 index 00000000000000..6729745f8a6c74 --- /dev/null +++ b/deps/npm/node_modules/walk-up-path/README.md @@ -0,0 +1,46 @@ +# walk-up-path + +Given a path string, return a generator that walks up the path, emitting +each dirname. + +So, to get a platform-portable walk up, instead of doing something like +this: + +```js +for (let p = dirname(path); p;) { + + // ... do stuff ... + + const pp = dirname(p) + if (p === pp) + p = null + else + p = pp +} +``` + +Or this: + +```js +for (let p = dirname(path); !isRoot(p); p = dirname(p)) { + // ... do stuff ... +} +``` + +You can do this: + +```js +const walkUpPath = require('walk-up-path') +for (const p of walkUpPath(path)) { + // ... do stuff .. +} +``` + +## API + +```js +const walkUpPath = require('walk-up-path') +``` + +Give the fn a string, it'll yield all the directories walking up to the +root. diff --git a/deps/npm/node_modules/walk-up-path/index.js b/deps/npm/node_modules/walk-up-path/index.js new file mode 100644 index 00000000000000..05524a6c055ebd --- /dev/null +++ b/deps/npm/node_modules/walk-up-path/index.js @@ -0,0 +1,11 @@ +const {dirname, resolve} = require('path') +module.exports = function* (path) { + for (path = resolve(path); path;) { + yield path + const pp = dirname(path) + if (pp === path) + path = null + else + path = pp + } +} diff --git a/deps/npm/node_modules/walk-up-path/package.json b/deps/npm/node_modules/walk-up-path/package.json new file mode 100644 index 00000000000000..df69d9238514ca --- /dev/null +++ b/deps/npm/node_modules/walk-up-path/package.json @@ -0,0 +1,28 @@ +{ + "name": "walk-up-path", + "version": "1.0.0", + "files": [ + "index.js" + ], + "description": "Given a path string, return a generator that walks up the path, emitting each dirname.", + "repository": { + "type": "git", + "url": "git+https://github.com/isaacs/walk-up-path" + }, + "author": "Isaac Z. Schlueter (https://izs.me)", + "license": "ISC", + "scripts": { + "test": "tap", + "snap": "tap", + "preversion": "npm test", + "postversion": "npm publish", + "prepublishOnly": "git push origin --follow-tags" + }, + "tap": { + "check-coverage": true + }, + "devDependencies": { + "tap": "^14.10.7", + "require-inject": "^1.4.4" + } +} diff --git a/deps/npm/node_modules/wcwidth/package.json b/deps/npm/node_modules/wcwidth/package.json index bd34c94b8d55e0..eb2df9d0076d20 100644 --- a/deps/npm/node_modules/wcwidth/package.json +++ b/deps/npm/node_modules/wcwidth/package.json @@ -1,54 +1,19 @@ { - "_from": "wcwidth@^1.0.0", - "_id": "wcwidth@1.0.1", - "_inBundle": false, - "_integrity": "sha1-8LDc+RW8X/FSivrbLA4XtTLaL+g=", - "_location": "/wcwidth", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "wcwidth@^1.0.0", - "name": "wcwidth", - "escapedName": "wcwidth", - "rawSpec": "^1.0.0", - "saveSpec": null, - "fetchSpec": "^1.0.0" - }, - "_requiredBy": [ - "/columnify" - ], - "_resolved": "https://registry.npmjs.org/wcwidth/-/wcwidth-1.0.1.tgz", - "_shasum": "f0b0dcf915bc5ff1528afadb2c0e17b532da2fe8", - "_spec": "wcwidth@^1.0.0", - "_where": "/Users/rebecca/code/npm/node_modules/columnify", - "author": { - "name": "Tim Oxley" - }, - "bugs": { - "url": "https://github.com/timoxley/wcwidth/issues" - }, - "bundleDependencies": false, + "name": "wcwidth", + "version": "1.0.1", + "description": "Port of C's wcwidth() and wcswidth()", + "author": "Tim Oxley", "contributors": [ - { - "name": "Woong Jun", - "email": "woong.jun@gmail.com", - "url": "http://code.woong.org/" - } + "Woong Jun (http://code.woong.org/)" ], + "main": "index.js", "dependencies": { "defaults": "^1.0.3" }, - "deprecated": false, - "description": "Port of C's wcwidth() and wcswidth()", "devDependencies": { "tape": "^4.5.1" }, - "directories": { - "doc": "docs", - "test": "test" - }, - "homepage": "https://github.com/timoxley/wcwidth#readme", + "license": "MIT", "keywords": [ "wide character", "wc", @@ -59,15 +24,19 @@ "wcwidth", "wcswidth" ], - "license": "MIT", - "main": "index.js", - "name": "wcwidth", + "directories": { + "doc": "docs", + "test": "test" + }, + "scripts": { + "test": "tape test/*.js" + }, "repository": { "type": "git", "url": "git+https://github.com/timoxley/wcwidth.git" }, - "scripts": { - "test": "tape test/*.js" + "bugs": { + "url": "https://github.com/timoxley/wcwidth/issues" }, - "version": "1.0.1" + "homepage": "https://github.com/timoxley/wcwidth#readme" } diff --git a/deps/npm/node_modules/which-module/CHANGELOG.md b/deps/npm/node_modules/which-module/CHANGELOG.md deleted file mode 100644 index 863d4698ec4213..00000000000000 --- a/deps/npm/node_modules/which-module/CHANGELOG.md +++ /dev/null @@ -1,26 +0,0 @@ -# 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. - - -# [2.0.0](https://github.com/nexdrew/which-module/compare/v1.0.0...v2.0.0) (2017-05-01) - - -### Features - -* remove Node < 4 from official testing/support ([#22](https://github.com/nexdrew/which-module/issues/22)) ([ee7aff4](https://github.com/nexdrew/which-module/commit/ee7aff4)) - - -### BREAKING CHANGES - -* Node 0.10 or 0.12 no longer supported, please update to Node 4+ or use which-module@1.0.0 - - - - -# 1.0.0 (2016-06-06) - - -### Features - -* initial code ([08074cd](https://github.com/nexdrew/which-module/commit/08074cd)) diff --git a/deps/npm/node_modules/which-module/LICENSE b/deps/npm/node_modules/which-module/LICENSE deleted file mode 100644 index ab601b657ea8c6..00000000000000 --- a/deps/npm/node_modules/which-module/LICENSE +++ /dev/null @@ -1,13 +0,0 @@ -Copyright (c) 2016, Contributors - -Permission to use, copy, modify, and/or distribute this software for any purpose -with or without fee is hereby granted, provided that the above copyright notice -and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND -FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS -OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER -TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF -THIS SOFTWARE. diff --git a/deps/npm/node_modules/which-module/README.md b/deps/npm/node_modules/which-module/README.md deleted file mode 100644 index a8c4bf8d702f26..00000000000000 --- a/deps/npm/node_modules/which-module/README.md +++ /dev/null @@ -1,55 +0,0 @@ -# which-module - -> Find the module object for something that was require()d - -[![Build Status](https://travis-ci.org/nexdrew/which-module.svg?branch=master)](https://travis-ci.org/nexdrew/which-module) -[![Coverage Status](https://coveralls.io/repos/github/nexdrew/which-module/badge.svg?branch=master)](https://coveralls.io/github/nexdrew/which-module?branch=master) -[![Standard Version](https://img.shields.io/badge/release-standard%20version-brightgreen.svg)](https://github.com/conventional-changelog/standard-version) - -Find the `module` object in `require.cache` for something that was `require()`d -or `import`ed - essentially a reverse `require()` lookup. - -Useful for libs that want to e.g. lookup a filename for a module or submodule -that it did not `require()` itself. - -## Install and Usage - -``` -npm install --save which-module -``` - -```js -const whichModule = require('which-module') - -console.log(whichModule(require('something'))) -// Module { -// id: '/path/to/project/node_modules/something/index.js', -// exports: [Function], -// parent: ..., -// filename: '/path/to/project/node_modules/something/index.js', -// loaded: true, -// children: [], -// paths: [ '/path/to/project/node_modules/something/node_modules', -// '/path/to/project/node_modules', -// '/path/to/node_modules', -// '/path/node_modules', -// '/node_modules' ] } -``` - -## API - -### `whichModule(exported)` - -Return the [`module` object](https://nodejs.org/api/modules.html#modules_the_module_object), -if any, that represents the given argument in the `require.cache`. - -`exported` can be anything that was previously `require()`d or `import`ed as a -module, submodule, or dependency - which means `exported` is identical to the -`module.exports` returned by this method. - -If `exported` did not come from the `exports` of a `module` in `require.cache`, -then this method returns `null`. - -## License - -ISC © Contributors diff --git a/deps/npm/node_modules/which-module/index.js b/deps/npm/node_modules/which-module/index.js deleted file mode 100644 index 45559b781813bd..00000000000000 --- a/deps/npm/node_modules/which-module/index.js +++ /dev/null @@ -1,9 +0,0 @@ -'use strict' - -module.exports = function whichModule (exported) { - for (var i = 0, files = Object.keys(require.cache), mod; i < files.length; i++) { - mod = require.cache[files[i]] - if (mod.exports === exported) return mod - } - return null -} diff --git a/deps/npm/node_modules/which-module/package.json b/deps/npm/node_modules/which-module/package.json deleted file mode 100644 index fb7067d36562c6..00000000000000 --- a/deps/npm/node_modules/which-module/package.json +++ /dev/null @@ -1,68 +0,0 @@ -{ - "_from": "which-module@^2.0.0", - "_id": "which-module@2.0.0", - "_inBundle": false, - "_integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=", - "_location": "/which-module", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "which-module@^2.0.0", - "name": "which-module", - "escapedName": "which-module", - "rawSpec": "^2.0.0", - "saveSpec": null, - "fetchSpec": "^2.0.0" - }, - "_requiredBy": [ - "/yargs" - ], - "_resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz", - "_shasum": "d9ef07dce77b9902b8a3a8fa4b31c3e3f7e6e87a", - "_spec": "which-module@^2.0.0", - "_where": "/Users/rebecca/code/npm/node_modules/yargs", - "author": { - "name": "nexdrew" - }, - "bugs": { - "url": "https://github.com/nexdrew/which-module/issues" - }, - "bundleDependencies": false, - "deprecated": false, - "description": "Find the module object for something that was require()d", - "devDependencies": { - "ava": "^0.19.1", - "coveralls": "^2.13.1", - "nyc": "^10.3.0", - "standard": "^10.0.2", - "standard-version": "^4.0.0" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/nexdrew/which-module#readme", - "keywords": [ - "which", - "module", - "exports", - "filename", - "require", - "reverse", - "lookup" - ], - "license": "ISC", - "main": "index.js", - "name": "which-module", - "repository": { - "type": "git", - "url": "git+https://github.com/nexdrew/which-module.git" - }, - "scripts": { - "coverage": "nyc report --reporter=text-lcov | coveralls", - "pretest": "standard", - "release": "standard-version", - "test": "nyc ava" - }, - "version": "2.0.0" -} diff --git a/deps/npm/node_modules/which/CHANGELOG.md b/deps/npm/node_modules/which/CHANGELOG.md index 3d83d26948be30..7fb1f2033c8dcf 100644 --- a/deps/npm/node_modules/which/CHANGELOG.md +++ b/deps/npm/node_modules/which/CHANGELOG.md @@ -1,6 +1,20 @@ # Changes +## 2.0.2 + +* Rename bin to `node-which` + +## 2.0.1 + +* generate changelog and publish on version bump +* enforce 100% test coverage +* Promise interface + +## 2.0.0 + +* Parallel tests, modern JavaScript, and drop support for node < 8 + ## 1.3.1 * update deps diff --git a/deps/npm/node_modules/which/README.md b/deps/npm/node_modules/which/README.md index 8c0b0cbf7214f7..cd833509f3bcc9 100644 --- a/deps/npm/node_modules/which/README.md +++ b/deps/npm/node_modules/which/README.md @@ -17,6 +17,9 @@ which('node', function (er, resolvedPath) { // if it is found, then the absolute path to the exec is returned }) +// or promise +which('node').then(resolvedPath => { ... }).catch(er => { ... not found ... }) + // sync usage // throws if not found var resolved = which.sync('node') diff --git a/deps/npm/node_modules/which/bin/which b/deps/npm/node_modules/which/bin/node-which similarity index 100% rename from deps/npm/node_modules/which/bin/which rename to deps/npm/node_modules/which/bin/node-which diff --git a/deps/npm/node_modules/which/package.json b/deps/npm/node_modules/which/package.json index 9a8a8b765a16c7..97ad7fbabc52b5 100644 --- a/deps/npm/node_modules/which/package.json +++ b/deps/npm/node_modules/which/package.json @@ -1,72 +1,43 @@ { - "_from": "which@1.3.1", - "_id": "which@1.3.1", - "_inBundle": false, - "_integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", - "_location": "/which", - "_phantomChildren": {}, - "_requested": { - "type": "version", - "registry": true, - "raw": "which@1.3.1", - "name": "which", - "escapedName": "which", - "rawSpec": "1.3.1", - "saveSpec": null, - "fetchSpec": "1.3.1" - }, - "_requiredBy": [ - "#USER", - "/", - "/cross-spawn", - "/foreground-child/cross-spawn", - "/libnpx", - "/node-gyp", - "/npm-lifecycle", - "/pacote" - ], - "_resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", - "_shasum": "a45043d54f5805316da8d62f9f50918d3da70b0a", - "_spec": "which@1.3.1", - "_where": "/Users/rebecca/code/npm", - "author": { - "name": "Isaac Z. Schlueter", - "email": "i@izs.me", - "url": "http://blog.izs.me" + "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" }, + "main": "which.js", "bin": { - "which": "./bin/which" - }, - "bugs": { - "url": "https://github.com/isaacs/node-which/issues" + "node-which": "./bin/node-which" }, - "bundleDependencies": false, + "license": "ISC", "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": "^12.0.1" + "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" }, "files": [ "which.js", - "bin/which" + "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": "bash gen-changelog.sh", - "postversion": "npm run changelog && git add CHANGELOG.md && git commit -m 'update changelog - '${npm_package_version}", - "test": "tap test/*.js --cov" + "tap": { + "check-coverage": true }, - "version": "1.3.1" + "engines": { + "node": ">= 8" + } } diff --git a/deps/npm/node_modules/which/which.js b/deps/npm/node_modules/which/which.js index 4347f91a1c3878..82afffd2143749 100644 --- a/deps/npm/node_modules/which/which.js +++ b/deps/npm/node_modules/which/which.js @@ -1,120 +1,107 @@ -module.exports = which -which.sync = whichSync - -var isWindows = process.platform === 'win32' || +const isWindows = process.platform === 'win32' || process.env.OSTYPE === 'cygwin' || process.env.OSTYPE === 'msys' -var path = require('path') -var COLON = isWindows ? ';' : ':' -var isexe = require('isexe') +const path = require('path') +const COLON = isWindows ? ';' : ':' +const isexe = require('isexe') -function getNotFoundError (cmd) { - var er = new Error('not found: ' + cmd) - er.code = 'ENOENT' +const getNotFoundError = (cmd) => + Object.assign(new Error(`not found: ${cmd}`), { code: 'ENOENT' }) - return er -} +const getPathInfo = (cmd, opt) => { + const colon = opt.colon || COLON -function getPathInfo (cmd, opt) { - var colon = opt.colon || COLON - var pathEnv = opt.path || process.env.PATH || '' - var pathExt = [''] - - pathEnv = pathEnv.split(colon) + // If it has a slash, then we don't bother searching the pathenv. + // just check the file itself, and that's it. + const pathEnv = cmd.match(/\//) || isWindows && cmd.match(/\\/) ? [''] + : ( + [ + // windows always checks the cwd first + ...(isWindows ? [process.cwd()] : []), + ...(opt.path || process.env.PATH || + /* istanbul ignore next: very unusual */ '').split(colon), + ] + ) + const pathExtExe = isWindows + ? opt.pathExt || process.env.PATHEXT || '.EXE;.CMD;.BAT;.COM' + : '' + const pathExt = isWindows ? pathExtExe.split(colon) : [''] - var pathExtExe = '' if (isWindows) { - pathEnv.unshift(process.cwd()) - pathExtExe = (opt.pathExt || process.env.PATHEXT || '.EXE;.CMD;.BAT;.COM') - pathExt = pathExtExe.split(colon) - - - // Always test the cmd itself first. isexe will check to make sure - // it's found in the pathExt set. if (cmd.indexOf('.') !== -1 && pathExt[0] !== '') pathExt.unshift('') } - // If it has a slash, then we don't bother searching the pathenv. - // just check the file itself, and that's it. - if (cmd.match(/\//) || isWindows && cmd.match(/\\/)) - pathEnv = [''] - return { - env: pathEnv, - ext: pathExt, - extExe: pathExtExe + pathEnv, + pathExt, + pathExtExe, } } -function which (cmd, opt, cb) { +const which = (cmd, opt, cb) => { if (typeof opt === 'function') { cb = opt opt = {} } + if (!opt) + opt = {} - var info = getPathInfo(cmd, opt) - var pathEnv = info.env - var pathExt = info.ext - var pathExtExe = info.extExe - var found = [] - - ;(function F (i, l) { - if (i === l) { - if (opt.all && found.length) - return cb(null, found) - else - return cb(getNotFoundError(cmd)) - } - - var pathPart = pathEnv[i] - if (pathPart.charAt(0) === '"' && pathPart.slice(-1) === '"') - pathPart = pathPart.slice(1, -1) - - var p = path.join(pathPart, cmd) - if (!pathPart && (/^\.[\\\/]/).test(cmd)) { - p = cmd.slice(0, 2) + p - } - ;(function E (ii, ll) { - if (ii === ll) return F(i + 1, l) - var ext = pathExt[ii] - isexe(p + ext, { pathExt: pathExtExe }, function (er, is) { - if (!er && is) { - if (opt.all) - found.push(p + ext) - else - return cb(null, p + ext) - } - return E(ii + 1, ll) - }) - })(0, pathExt.length) - })(0, pathEnv.length) + const { pathEnv, pathExt, pathExtExe } = getPathInfo(cmd, opt) + const found = [] + + const step = i => new Promise((resolve, reject) => { + if (i === pathEnv.length) + return opt.all && found.length ? resolve(found) + : reject(getNotFoundError(cmd)) + + const ppRaw = pathEnv[i] + const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw + + const pCmd = path.join(pathPart, cmd) + const p = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd + : pCmd + + resolve(subStep(p, i, 0)) + }) + + const subStep = (p, i, ii) => new Promise((resolve, reject) => { + if (ii === pathExt.length) + return resolve(step(i + 1)) + const ext = pathExt[ii] + isexe(p + ext, { pathExt: pathExtExe }, (er, is) => { + if (!er && is) { + if (opt.all) + found.push(p + ext) + else + return resolve(p + ext) + } + return resolve(subStep(p, i, ii + 1)) + }) + }) + + return cb ? step(0).then(res => cb(null, res), cb) : step(0) } -function whichSync (cmd, opt) { +const whichSync = (cmd, opt) => { opt = opt || {} - var info = getPathInfo(cmd, opt) - var pathEnv = info.env - var pathExt = info.ext - var pathExtExe = info.extExe - var found = [] + const { pathEnv, pathExt, pathExtExe } = getPathInfo(cmd, opt) + const found = [] - for (var i = 0, l = pathEnv.length; i < l; i ++) { - var pathPart = pathEnv[i] - if (pathPart.charAt(0) === '"' && pathPart.slice(-1) === '"') - pathPart = pathPart.slice(1, -1) + for (let i = 0; i < pathEnv.length; i ++) { + const ppRaw = pathEnv[i] + const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw - var p = path.join(pathPart, cmd) - if (!pathPart && /^\.[\\\/]/.test(cmd)) { - p = cmd.slice(0, 2) + p - } - for (var j = 0, ll = pathExt.length; j < ll; j ++) { - var cur = p + pathExt[j] - var is + const pCmd = path.join(pathPart, cmd) + const p = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd + : pCmd + + for (let j = 0; j < pathExt.length; j ++) { + const cur = p + pathExt[j] try { - is = isexe.sync(cur, { pathExt: pathExtExe }) + const is = isexe.sync(cur, { pathExt: pathExtExe }) if (is) { if (opt.all) found.push(cur) @@ -133,3 +120,6 @@ function whichSync (cmd, opt) { throw getNotFoundError(cmd) } + +module.exports = which +which.sync = whichSync diff --git a/deps/npm/node_modules/wide-align/node_modules/string-width/index.js b/deps/npm/node_modules/wide-align/node_modules/string-width/index.js deleted file mode 100644 index b9bec62440a468..00000000000000 --- a/deps/npm/node_modules/wide-align/node_modules/string-width/index.js +++ /dev/null @@ -1,37 +0,0 @@ -'use strict'; -var stripAnsi = require('strip-ansi'); -var codePointAt = require('code-point-at'); -var isFullwidthCodePoint = require('is-fullwidth-code-point'); - -// https://github.com/nodejs/io.js/blob/cff7300a578be1b10001f2d967aaedc88aee6402/lib/readline.js#L1345 -module.exports = function (str) { - if (typeof str !== 'string' || str.length === 0) { - return 0; - } - - var width = 0; - - str = stripAnsi(str); - - for (var i = 0; i < str.length; i++) { - var code = codePointAt(str, i); - - // ignore control characters - if (code <= 0x1f || (code >= 0x7f && code <= 0x9f)) { - continue; - } - - // surrogates - if (code >= 0x10000) { - i++; - } - - if (isFullwidthCodePoint(code)) { - width += 2; - } else { - width++; - } - } - - return width; -}; diff --git a/deps/npm/node_modules/wide-align/node_modules/string-width/license b/deps/npm/node_modules/wide-align/node_modules/string-width/license deleted file mode 100644 index 654d0bfe943437..00000000000000 --- a/deps/npm/node_modules/wide-align/node_modules/string-width/license +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -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/deps/npm/node_modules/wide-align/node_modules/string-width/package.json b/deps/npm/node_modules/wide-align/node_modules/string-width/package.json deleted file mode 100644 index 0ddda22db11995..00000000000000 --- a/deps/npm/node_modules/wide-align/node_modules/string-width/package.json +++ /dev/null @@ -1,88 +0,0 @@ -{ - "_from": "string-width@^1.0.2", - "_id": "string-width@1.0.2", - "_inBundle": false, - "_integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", - "_location": "/wide-align/string-width", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "string-width@^1.0.2", - "name": "string-width", - "escapedName": "string-width", - "rawSpec": "^1.0.2", - "saveSpec": null, - "fetchSpec": "^1.0.2" - }, - "_requiredBy": [ - "/wide-align" - ], - "_resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", - "_shasum": "118bdf5b8cdc51a2a7e70d211e07e2b0b9b107d3", - "_spec": "string-width@^1.0.2", - "_where": "/Users/rebecca/code/npm/node_modules/wide-align", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "bugs": { - "url": "https://github.com/sindresorhus/string-width/issues" - }, - "bundleDependencies": false, - "dependencies": { - "code-point-at": "^1.0.0", - "is-fullwidth-code-point": "^1.0.0", - "strip-ansi": "^3.0.0" - }, - "deprecated": false, - "description": "Get the visual width of a string - the number of columns required to display it", - "devDependencies": { - "ava": "*", - "xo": "*" - }, - "engines": { - "node": ">=0.10.0" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/sindresorhus/string-width#readme", - "keywords": [ - "string", - "str", - "character", - "char", - "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" - }, - "version": "1.0.2" -} diff --git a/deps/npm/node_modules/wide-align/node_modules/string-width/readme.md b/deps/npm/node_modules/wide-align/node_modules/string-width/readme.md deleted file mode 100644 index 1ab42c93580ecb..00000000000000 --- a/deps/npm/node_modules/wide-align/node_modules/string-width/readme.md +++ /dev/null @@ -1,42 +0,0 @@ -# string-width [![Build Status](https://travis-ci.org/sindresorhus/string-width.svg?branch=master)](https://travis-ci.org/sindresorhus/string-width) - -> Get the visual width of a string - the number of columns required to display it - -Some Unicode characters are [fullwidth](https://en.wikipedia.org/wiki/Halfwidth_and_fullwidth_forms) and use double the normal width. [ANSI escape codes](http://en.wikipedia.org/wiki/ANSI_escape_code) are stripped and doesn't affect the width. - -Useful to be able to measure the actual width of command-line output. - - -## Install - -``` -$ npm install --save string-width -``` - - -## Usage - -```js -const stringWidth = require('string-width'); - -stringWidth('古'); -//=> 2 - -stringWidth('\u001b[1m古\u001b[22m'); -//=> 2 - -stringWidth('a'); -//=> 1 -``` - - -## Related - -- [string-width-cli](https://github.com/sindresorhus/string-width-cli) - CLI for this module -- [string-length](https://github.com/sindresorhus/string-length) - Get the real length of a string -- [widest-line](https://github.com/sindresorhus/widest-line) - Get the visual width of the widest line in a string - - -## License - -MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/deps/npm/node_modules/wide-align/package.json b/deps/npm/node_modules/wide-align/package.json index 2e86207a30662c..1c31f9984e8f7b 100644 --- a/deps/npm/node_modules/wide-align/package.json +++ b/deps/npm/node_modules/wide-align/package.json @@ -1,51 +1,12 @@ { - "_from": "wide-align@^1.1.0", - "_id": "wide-align@1.1.2", - "_inBundle": false, - "_integrity": "sha512-ijDLlyQ7s6x1JgCLur53osjm/UXUYD9+0PbYKrBsYisYXzCxN+HC3mYDNy/dWdmf3AwqwU3CXwDCvsNgGK1S0w==", - "_location": "/wide-align", - "_phantomChildren": { - "code-point-at": "1.1.0", - "number-is-nan": "1.0.1" - }, - "_requested": { - "type": "range", - "registry": true, - "raw": "wide-align@^1.1.0", - "name": "wide-align", - "escapedName": "wide-align", - "rawSpec": "^1.1.0", - "saveSpec": null, - "fetchSpec": "^1.1.0" - }, - "_requiredBy": [ - "/gauge" - ], - "_resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.2.tgz", - "_shasum": "571e0f1b0604636ebc0dfc21b0339bbe31341710", - "_spec": "wide-align@^1.1.0", - "_where": "/Users/rebecca/code/npm/node_modules/gauge", - "author": { - "name": "Rebecca Turner", - "email": "me@re-becca.org", - "url": "http://re-becca.org/" - }, - "bugs": { - "url": "https://github.com/iarna/wide-align/issues" - }, - "bundleDependencies": false, - "dependencies": { - "string-width": "^1.0.2" - }, - "deprecated": false, + "name": "wide-align", + "version": "1.1.3", "description": "A wide-character aware text alignment function for use on the console or with fixed width fonts.", - "devDependencies": { - "tap": "^10.3.2" + "main": "align.js", + "scripts": { + "test": "tap --coverage test/*.js", + "version": "perl -pi -e 's/^( \"version\": $ENV{npm_config_node_version}\").*?\",/$1abc\",/' package-lock.json ; git add package-lock.json" }, - "files": [ - "align.js" - ], - "homepage": "https://github.com/iarna/wide-align#readme", "keywords": [ "wide", "double", @@ -54,16 +15,19 @@ "pad", "align" ], + "author": "Rebecca Turner (http://re-becca.org/)", "license": "ISC", - "main": "align.js", - "name": "wide-align", "repository": { "type": "git", - "url": "git+https://github.com/iarna/wide-align.git" + "url": "https://github.com/iarna/wide-align" }, - "scripts": { - "test": "tap --coverage test/*.js", - "version": "perl -pi -e 's/^( \"version\": $ENV{npm_config_node_version}\").*?\",/$1abc\",/' package-lock.json ; git add package-lock.json" + "dependencies": { + "string-width": "^1.0.2 || 2" + }, + "devDependencies": { + "tap": "10 || 11 || 12" }, - "version": "1.1.2" + "files": [ + "align.js" + ] } diff --git a/deps/npm/node_modules/widest-line/index.js b/deps/npm/node_modules/widest-line/index.js deleted file mode 100644 index a9865d00abd914..00000000000000 --- a/deps/npm/node_modules/widest-line/index.js +++ /dev/null @@ -1,8 +0,0 @@ -'use strict'; -const stringWidth = require('string-width'); - -module.exports = input => { - let max = 0; - for (const s of input.split('\n')) max = Math.max(max, stringWidth(s)); - return max; -}; diff --git a/deps/npm/node_modules/widest-line/license b/deps/npm/node_modules/widest-line/license deleted file mode 100644 index e7af2f77107d73..00000000000000 --- a/deps/npm/node_modules/widest-line/license +++ /dev/null @@ -1,9 +0,0 @@ -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/deps/npm/node_modules/widest-line/package.json b/deps/npm/node_modules/widest-line/package.json deleted file mode 100644 index fc4bcfcbeb83c5..00000000000000 --- a/deps/npm/node_modules/widest-line/package.json +++ /dev/null @@ -1,86 +0,0 @@ -{ - "_from": "widest-line@^2.0.0", - "_id": "widest-line@2.0.1", - "_inBundle": false, - "_integrity": "sha512-Ba5m9/Fa4Xt9eb2ELXt77JxVDV8w7qQrH0zS/TWSJdLyAwQjWoOzpzj5lwVftDz6n/EOu3tNACS84v509qwnJA==", - "_location": "/widest-line", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "widest-line@^2.0.0", - "name": "widest-line", - "escapedName": "widest-line", - "rawSpec": "^2.0.0", - "saveSpec": null, - "fetchSpec": "^2.0.0" - }, - "_requiredBy": [ - "/boxen" - ], - "_resolved": "https://registry.npmjs.org/widest-line/-/widest-line-2.0.1.tgz", - "_shasum": "7438764730ec7ef4381ce4df82fb98a53142a3fc", - "_spec": "widest-line@^2.0.0", - "_where": "/Users/ruyadorno/Documents/workspace/cli/node_modules/boxen", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "bugs": { - "url": "https://github.com/sindresorhus/widest-line/issues" - }, - "bundleDependencies": false, - "dependencies": { - "string-width": "^2.1.1" - }, - "deprecated": false, - "description": "Get the visual width of the widest line in a string - the number of columns required to display it", - "devDependencies": { - "ava": "*", - "xo": "*" - }, - "engines": { - "node": ">=4" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/sindresorhus/widest-line#readme", - "keywords": [ - "string", - "str", - "character", - "char", - "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": "widest-line", - "repository": { - "type": "git", - "url": "git+https://github.com/sindresorhus/widest-line.git" - }, - "scripts": { - "test": "xo && ava" - }, - "version": "2.0.1" -} diff --git a/deps/npm/node_modules/widest-line/readme.md b/deps/npm/node_modules/widest-line/readme.md deleted file mode 100644 index 20e02d574620c2..00000000000000 --- a/deps/npm/node_modules/widest-line/readme.md +++ /dev/null @@ -1,34 +0,0 @@ -# widest-line [![Build Status](https://travis-ci.org/sindresorhus/widest-line.svg?branch=master)](https://travis-ci.org/sindresorhus/widest-line) - -> Get the visual width of the widest line in a string - the number of columns required to display it - -Some Unicode characters are [fullwidth](https://en.wikipedia.org/wiki/Halfwidth_and_fullwidth_forms) and use double the normal width. [ANSI escape codes](http://en.wikipedia.org/wiki/ANSI_escape_code) are stripped and doesn't affect the width. - -Useful to be able to know the maximum width a string will take up in the terminal. - - -## Install - -``` -$ npm install widest-line -``` - - -## Usage - -```js -const widestLine = require('widest-line'); - -widestLine('古\n\u001B[1m@\u001B[22m'); -//=> 2 -``` - - -## Related - -- [string-width](https://github.com/sindresorhus/string-width) - Get the visual width of a string - - -## License - -MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/deps/npm/node_modules/worker-farm/.editorconfig b/deps/npm/node_modules/worker-farm/.editorconfig deleted file mode 100644 index feaebc231506b6..00000000000000 --- a/deps/npm/node_modules/worker-farm/.editorconfig +++ /dev/null @@ -1,16 +0,0 @@ -# This file is for unifying the coding style for different editors and IDEs -# editorconfig.org - -root = true - -[*] -end_of_line = lf -charset = utf-8 -insert_final_newline = true -trim_trailing_whitespace = true -indent_style = space -indent_size = 2 - -[*.js] -max_line_length = 80 -View diff --git a/deps/npm/node_modules/worker-farm/.travis.yml b/deps/npm/node_modules/worker-farm/.travis.yml deleted file mode 100644 index 7af56429c010b3..00000000000000 --- a/deps/npm/node_modules/worker-farm/.travis.yml +++ /dev/null @@ -1,12 +0,0 @@ -language: node_js -node_js: - - 6 - - 8 - - 10 - - 12 -branches: - only: - - master -notifications: - email: - - rod@vagg.org diff --git a/deps/npm/node_modules/worker-farm/LICENSE.md b/deps/npm/node_modules/worker-farm/LICENSE.md deleted file mode 100644 index 274c9b46079443..00000000000000 --- a/deps/npm/node_modules/worker-farm/LICENSE.md +++ /dev/null @@ -1,13 +0,0 @@ -The MIT License (MIT) -===================== - -Copyright (c) 2014 LevelUP contributors ---------------------------------------- - -*LevelUP contributors listed at * - -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/worker-farm/README.md b/deps/npm/node_modules/worker-farm/README.md deleted file mode 100644 index c52689ed9fc580..00000000000000 --- a/deps/npm/node_modules/worker-farm/README.md +++ /dev/null @@ -1,150 +0,0 @@ -# Worker Farm [![Build Status](https://secure.travis-ci.org/rvagg/node-worker-farm.svg)](http://travis-ci.org/rvagg/node-worker-farm) - -[![NPM](https://nodei.co/npm/worker-farm.png?downloads=true&downloadRank=true&stars=true)](https://nodei.co/npm/worker-farm/) [![NPM](https://nodei.co/npm-dl/worker-farm.png?months=6&height=3)](https://nodei.co/npm/worker-farm/) - - -Distribute processing tasks to child processes with an über-simple API and baked-in durability & custom concurrency options. *Available in npm as worker-farm*. - -## Example - -Given a file, *child.js*: - -```js -module.exports = function (inp, callback) { - callback(null, inp + ' BAR (' + process.pid + ')') -} -``` - -And a main file: - -```js -var workerFarm = require('worker-farm') - , workers = workerFarm(require.resolve('./child')) - , ret = 0 - -for (var i = 0; i < 10; i++) { - workers('#' + i + ' FOO', function (err, outp) { - console.log(outp) - if (++ret == 10) - workerFarm.end(workers) - }) -} -``` - -We'll get an output something like the following: - -``` -#1 FOO BAR (8546) -#0 FOO BAR (8545) -#8 FOO BAR (8545) -#9 FOO BAR (8546) -#2 FOO BAR (8548) -#4 FOO BAR (8551) -#3 FOO BAR (8549) -#6 FOO BAR (8555) -#5 FOO BAR (8553) -#7 FOO BAR (8557) -``` - -This example is contained in the *[examples/basic](https://github.com/rvagg/node-worker-farm/tree/master/examples/basic/)* directory. - -### Example #1: Estimating π using child workers - -You will also find a more complex example in *[examples/pi](https://github.com/rvagg/node-worker-farm/tree/master/examples/pi/)* that estimates the value of **π** by using a Monte Carlo *area-under-the-curve* method and compares the speed of doing it all in-process vs using child workers to complete separate portions. - -Running `node examples/pi` will give you something like: - -``` -Doing it the slow (single-process) way... -π ≈ 3.1416269360000006 (0.0000342824102075312 away from actual!) -took 8341 milliseconds -Doing it the fast (multi-process) way... -π ≈ 3.1416233600000036 (0.00003070641021052367 away from actual!) -took 1985 milliseconds -``` - -## Durability - -An important feature of Worker Farm is **call durability**. If a child process dies for any reason during the execution of call(s), those calls will be re-queued and taken care of by other child processes. In this way, when you ask for something to be done, unless there is something *seriously* wrong with what you're doing, you should get a result on your callback function. - -## My use-case - -There are other libraries for managing worker processes available but my use-case was fairly specific: I need to make heavy use of the [node-java](https://github.com/nearinfinity/node-java) library to interact with JVM code. Unfortunately, because the JVM garbage collector is so difficult to interact with, it's prone to killing your Node process when the GC kicks under heavy load. For safety I needed a durable way to make calls so that (1) it wouldn't kill my main process and (2) any calls that weren't successful would be resubmitted for processing. - -Worker Farm allows me to spin up multiple JVMs to be controlled by Node, and have a single, uncomplicated API that acts the same way as an in-process API and the calls will be taken care of by a child process even if an error kills a child process while it is working as the call will simply be passed to a new child process. - -**But**, don't think that Worker Farm is specific to that use-case, it's designed to be very generic and simple to adapt to anything requiring the use of child Node processes. - -## API - -Worker Farm exports a main function and an `end()` method. The main function sets up a "farm" of coordinated child-process workers and it can be used to instantiate multiple farms, all operating independently. - -### workerFarm([options, ]pathToModule[, exportedMethods]) - -In its most basic form, you call `workerFarm()` with the path to a module file to be invoked by the child process. You should use an **absolute path** to the module file, the best way to obtain the path is with `require.resolve('./path/to/module')`, this function can be used in exactly the same way as `require('./path/to/module')` but it returns an absolute path. - -#### `exportedMethods` - -If your module exports a single function on `module.exports` then you should omit the final parameter. However, if you are exporting multiple functions on `module.exports` then you should list them in an Array of Strings: - -```js -var workers = workerFarm(require.resolve('./mod'), [ 'doSomething', 'doSomethingElse' ]) -workers.doSomething(function () {}) -workers.doSomethingElse(function () {}) -``` - -Listing the available methods will instruct Worker Farm what API to provide you with on the returned object. If you don't list a `exportedMethods` Array then you'll get a single callable function to use; but if you list the available methods then you'll get an object with callable functions by those names. - -**It is assumed that each function you call on your child module will take a `callback` function as the last argument.** - -#### `options` - -If you don't provide an `options` object then the following defaults will be used: - -```js -{ - workerOptions : {} - , maxCallsPerWorker : Infinity - , maxConcurrentWorkers : require('os').cpus().length - , maxConcurrentCallsPerWorker : 10 - , maxConcurrentCalls : Infinity - , maxCallTime : Infinity - , maxRetries : Infinity - , autoStart : false - , onChild : function() {} -} -``` - - * **workerOptions** allows you to customize all the parameters passed to child nodes. This object supports [all possible options of `child_process.fork`](https://nodejs.org/api/child_process.html#child_process_child_process_fork_modulepath_args_options). The default options passed are the parent `execArgv`, `cwd` and `env`. Any (or all) of them can be overridden, and others can be added as well. - - * **maxCallsPerWorker** allows you to control the lifespan of your child processes. A positive number will indicate that you only want each child to accept that many calls before it is terminated. This may be useful if you need to control memory leaks or similar in child processes. - - * **maxConcurrentWorkers** will set the number of child processes to maintain concurrently. By default it is set to the number of CPUs available on the current system, but it can be any reasonable number, including `1`. - - * **maxConcurrentCallsPerWorker** allows you to control the *concurrency* of individual child processes. Calls are placed into a queue and farmed out to child processes according to the number of calls they are allowed to handle concurrently. It is arbitrarily set to 10 by default so that calls are shared relatively evenly across workers, however if your calls predictably take a similar amount of time then you could set it to `Infinity` and Worker Farm won't queue any calls but spread them evenly across child processes and let them go at it. If your calls aren't I/O bound then it won't matter what value you use here as the individual workers won't be able to execute more than a single call at a time. - - * **maxConcurrentCalls** allows you to control the maximum number of calls in the queue—either actively being processed or waiting for a worker to be processed. `Infinity` indicates no limit but if you have conditions that may endlessly queue jobs and you need to set a limit then provide a `>0` value and any calls that push the limit will return on their callback with a `MaxConcurrentCallsError` error (check `err.type == 'MaxConcurrentCallsError'`). - - * **maxCallTime** *(use with caution, understand what this does before you use it!)* when `!== Infinity`, will cap a time, in milliseconds, that *any single call* can take to execute in a worker. If this time limit is exceeded by just a single call then the worker running that call will be killed and any calls running on that worker will have their callbacks returned with a `TimeoutError` (check `err.type == 'TimeoutError'`). If you are running with `maxConcurrentCallsPerWorker` value greater than `1` then **all calls currently executing** will fail and will be automatically resubmitted uless you've changed the `maxRetries` option. Use this if you have jobs that may potentially end in infinite loops that you can't programatically end with your child code. Preferably run this with a `maxConcurrentCallsPerWorker` so you don't interrupt other calls when you have a timeout. This timeout operates on a per-call basis but will interrupt a whole worker. - - * **maxRetries** allows you to control the max number of call requeues after worker termination (unexpected or timeout). By default this option is set to `Infinity` which means that each call of each terminated worker will always be auto requeued. When the number of retries exceeds `maxRetries` value, the job callback will be executed with a `ProcessTerminatedError`. Note that if you are running with finite `maxCallTime` and `maxConcurrentCallsPerWorkers` greater than `1` then any `TimeoutError` will increase the retries counter *for each* concurrent call of the terminated worker. - - * **autoStart** when set to `true` will start the workers as early as possible. Use this when your workers have to do expensive initialization. That way they'll be ready when the first request comes through. - - * **onChild** when new child process starts this callback will be called with subprocess object as an argument. Use this when you need to add some custom communication with child processes. - -### workerFarm.end(farm) - -Child processes stay alive waiting for jobs indefinitely and your farm manager will stay alive managing its workers, so if you need it to stop then you have to do so explicitly. If you send your farm API to `workerFarm.end()` then it'll cleanly end your worker processes. Note though that it's a *soft* ending so it'll wait for child processes to finish what they are working on before asking them to die. - -Any calls that are queued and not yet being handled by a child process will be discarded. `end()` only waits for those currently in progress. - -Once you end a farm, it won't handle any more calls, so don't even try! - -## Related - -* [farm-cli](https://github.com/Kikobeats/farm-cli) – Launch a farm of workers from CLI. - -## License - -Worker Farm is Copyright (c) 2014 Rod Vagg [@rvagg](https://twitter.com/rvagg) and licensed under the MIT license. All rights not explicitly granted in the MIT license are reserved. See the included LICENSE.md file for more details. diff --git a/deps/npm/node_modules/worker-farm/examples/basic/child.js b/deps/npm/node_modules/worker-farm/examples/basic/child.js deleted file mode 100644 index 0f0900b5e26cd1..00000000000000 --- a/deps/npm/node_modules/worker-farm/examples/basic/child.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict' - -module.exports = function (inp, callback) { - callback(null, inp + ' BAR (' + process.pid + ')') -} diff --git a/deps/npm/node_modules/worker-farm/examples/basic/index.js b/deps/npm/node_modules/worker-farm/examples/basic/index.js deleted file mode 100644 index 452e7b16303801..00000000000000 --- a/deps/npm/node_modules/worker-farm/examples/basic/index.js +++ /dev/null @@ -1,13 +0,0 @@ -'use strict' - -let workerFarm = require('../../') - , workers = workerFarm(require.resolve('./child')) - , ret = 0 - -for (let i = 0; i < 10; i++) { - workers('#' + i + ' FOO', function (err, outp) { - console.log(outp) - if (++ret == 10) - workerFarm.end(workers) - }) -} diff --git a/deps/npm/node_modules/worker-farm/examples/pi/calc.js b/deps/npm/node_modules/worker-farm/examples/pi/calc.js deleted file mode 100644 index df9e5bae138346..00000000000000 --- a/deps/npm/node_modules/worker-farm/examples/pi/calc.js +++ /dev/null @@ -1,22 +0,0 @@ -'use strict' - -/* A simple π estimation function using a Monte Carlo method - * For 0 to `points`, take 2 random numbers < 1, square and add them to - * find the area under that point in a 1x1 square. If that area is <= 1 - * then it's *within* a quarter-circle, otherwise it's outside. - * Take the number of points <= 1 and multiply it by 4 and you have an - * estimate! - * Do this across multiple processes and average the results to - * increase accuracy. - */ - -module.exports = function (points, callback) { - let inside = 0 - , i = points - - while (i--) - if (Math.pow(Math.random(), 2) + Math.pow(Math.random(), 2) <= 1) - inside++ - - callback(null, (inside / points) * 4) -} diff --git a/deps/npm/node_modules/worker-farm/examples/pi/index.js b/deps/npm/node_modules/worker-farm/examples/pi/index.js deleted file mode 100644 index b7b26839ed1fcb..00000000000000 --- a/deps/npm/node_modules/worker-farm/examples/pi/index.js +++ /dev/null @@ -1,41 +0,0 @@ -'use strict' - -const CHILDREN = 500 - , POINTS_PER_CHILD = 1000000 - , FARM_OPTIONS = { - maxConcurrentWorkers : require('os').cpus().length - , maxCallsPerWorker : Infinity - , maxConcurrentCallsPerWorker : 1 - } - -let workerFarm = require('../../') - , calcDirect = require('./calc') - , calcWorker = workerFarm(FARM_OPTIONS, require.resolve('./calc')) - - , ret - , start - - , tally = function (finish, err, avg) { - ret.push(avg) - if (ret.length == CHILDREN) { - let pi = ret.reduce(function (a, b) { return a + b }) / ret.length - , end = +new Date() - console.log('π ≈', pi, '\t(' + Math.abs(pi - Math.PI), 'away from actual!)') - console.log('took', end - start, 'milliseconds') - if (finish) - finish() - } - } - - , calc = function (method, callback) { - ret = [] - start = +new Date() - for (let i = 0; i < CHILDREN; i++) - method(POINTS_PER_CHILD, tally.bind(null, callback)) - } - -console.log('Doing it the slow (single-process) way...') -calc(calcDirect, function () { - console.log('Doing it the fast (multi-process) way...') - calc(calcWorker, process.exit) -}) diff --git a/deps/npm/node_modules/worker-farm/index.d.ts b/deps/npm/node_modules/worker-farm/index.d.ts deleted file mode 100644 index 310e91503fda49..00000000000000 --- a/deps/npm/node_modules/worker-farm/index.d.ts +++ /dev/null @@ -1,55 +0,0 @@ -import { ForkOptions } from "child_process"; - -export = Farm; - -declare function Farm(name: string): Farm.Workers; -declare function Farm(name: string, exportedMethods: string[]): Farm.Workers; -declare function Farm(options: Farm.FarmOptions, name: string): Farm.Workers; -declare function Farm( - options: Farm.FarmOptions, - name: string, - exportedMethods: string[], -): Farm.Workers; - -type WorkerCallback0 = () => void; -type WorkerCallback1 = (arg1: any) => void; -type WorkerCallback2 = (arg1: any, arg2: any) => void; -type WorkerCallback3 = (arg1: any, arg2: any, arg3: any) => void; -type WorkerCallback4 = (arg1: any, arg2: any, arg3: any, arg4: any) => void; - -declare namespace Farm { - export function end(workers: Workers, callback?: Function): void; - - export interface Workers { - [x: string]: Workers, - (callback: WorkerCallback): void; - (arg1: any, callback: WorkerCallback): void; - (arg1: any, arg2: any, callback: WorkerCallback): void; - (arg1: any, arg2: any, arg3: any, callback: WorkerCallback): void; - ( - arg1: any, - arg2: any, - arg3: any, - arg4: any, - callback: WorkerCallback, - ): void; - } - - export interface FarmOptions { - maxCallsPerWorker?: number; - maxConcurrentWorkers?: number; - maxConcurrentCallsPerWorker?: number; - maxConcurrentCalls?: number; - maxCallTime?: number; - maxRetries?: number; - autoStart?: boolean; - workerOptions?: ForkOptions; - } - - export type WorkerCallback = - | WorkerCallback0 - | WorkerCallback1 - | WorkerCallback2 - | WorkerCallback3 - | WorkerCallback4; -} diff --git a/deps/npm/node_modules/worker-farm/lib/child/index.js b/deps/npm/node_modules/worker-farm/lib/child/index.js deleted file mode 100644 index 78f63371392afc..00000000000000 --- a/deps/npm/node_modules/worker-farm/lib/child/index.js +++ /dev/null @@ -1,56 +0,0 @@ -'use strict' - -let $module - -/* - let contextProto = this.context; - while (contextProto = Object.getPrototypeOf(contextProto)) { - completionGroups.push(Object.getOwnPropertyNames(contextProto)); - } -*/ - - -function handle (data) { - let idx = data.idx - , child = data.child - , method = data.method - , args = data.args - , callback = function () { - let _args = Array.prototype.slice.call(arguments) - if (_args[0] instanceof Error) { - let e = _args[0] - _args[0] = { - '$error' : '$error' - , 'type' : e.constructor.name - , 'message' : e.message - , 'stack' : e.stack - } - Object.keys(e).forEach(function(key) { - _args[0][key] = e[key] - }) - } - process.send({ owner: 'farm', idx: idx, child: child, args: _args }) - } - , exec - - if (method == null && typeof $module == 'function') - exec = $module - else if (typeof $module[method] == 'function') - exec = $module[method] - - if (!exec) - return console.error('NO SUCH METHOD:', method) - - exec.apply(null, args.concat([ callback ])) -} - - -process.on('message', function (data) { - if (data.owner !== 'farm') { - return; - } - - if (!$module) return $module = require(data.module) - if (data.event == 'die') return process.exit(0) - handle(data) -}) diff --git a/deps/npm/node_modules/worker-farm/lib/farm.js b/deps/npm/node_modules/worker-farm/lib/farm.js deleted file mode 100644 index 60720dc561f6cc..00000000000000 --- a/deps/npm/node_modules/worker-farm/lib/farm.js +++ /dev/null @@ -1,348 +0,0 @@ -'use strict' - -const DEFAULT_OPTIONS = { - workerOptions : {} - , maxCallsPerWorker : Infinity - , maxConcurrentWorkers : (require('os').cpus() || { length: 1 }).length - , maxConcurrentCallsPerWorker : 10 - , maxConcurrentCalls : Infinity - , maxCallTime : Infinity // exceed this and the whole worker is terminated - , maxRetries : Infinity - , forcedKillTime : 100 - , autoStart : false - , onChild : function() {} - } - -const fork = require('./fork') - , TimeoutError = require('errno').create('TimeoutError') - , ProcessTerminatedError = require('errno').create('ProcessTerminatedError') - , MaxConcurrentCallsError = require('errno').create('MaxConcurrentCallsError') - - -function Farm (options, path) { - this.options = Object.assign({}, DEFAULT_OPTIONS, options) - this.path = path - this.activeCalls = 0 -} - - -// make a handle to pass back in the form of an external API -Farm.prototype.mkhandle = function (method) { - return function () { - let args = Array.prototype.slice.call(arguments) - if (this.activeCalls + this.callQueue.length >= this.options.maxConcurrentCalls) { - let err = new MaxConcurrentCallsError('Too many concurrent calls (active: ' + this.activeCalls + ', queued: ' + this.callQueue.length + ')') - if (typeof args[args.length - 1] == 'function') - return process.nextTick(args[args.length - 1].bind(null, err)) - throw err - } - this.addCall({ - method : method - , callback : args.pop() - , args : args - , retries : 0 - }) - }.bind(this) -} - - -// a constructor of sorts -Farm.prototype.setup = function (methods) { - let iface - if (!methods) { // single-function export - iface = this.mkhandle() - } else { // multiple functions on the export - iface = {} - methods.forEach(function (m) { - iface[m] = this.mkhandle(m) - }.bind(this)) - } - - this.searchStart = -1 - this.childId = -1 - this.children = {} - this.activeChildren = 0 - this.callQueue = [] - - if (this.options.autoStart) { - while (this.activeChildren < this.options.maxConcurrentWorkers) - this.startChild() - } - - return iface -} - - -// when a child exits, check if there are any outstanding jobs and requeue them -Farm.prototype.onExit = function (childId) { - // delay this to give any sends a chance to finish - setTimeout(function () { - let doQueue = false - if (this.children[childId] && this.children[childId].activeCalls) { - this.children[childId].calls.forEach(function (call, i) { - if (!call) return - else if (call.retries >= this.options.maxRetries) { - this.receive({ - idx : i - , child : childId - , args : [ new ProcessTerminatedError('cancel after ' + call.retries + ' retries!') ] - }) - } else { - call.retries++ - this.callQueue.unshift(call) - doQueue = true - } - }.bind(this)) - } - this.stopChild(childId) - doQueue && this.processQueue() - }.bind(this), 10) -} - - -// start a new worker -Farm.prototype.startChild = function () { - this.childId++ - - let forked = fork(this.path, this.options.workerOptions) - , id = this.childId - , c = { - send : forked.send - , child : forked.child - , calls : [] - , activeCalls : 0 - , exitCode : null - } - - this.options.onChild(forked.child); - - forked.child.on('message', function(data) { - if (data.owner !== 'farm') { - return; - } - this.receive(data); - }.bind(this)) - forked.child.once('exit', function (code) { - c.exitCode = code - this.onExit(id) - }.bind(this)) - - this.activeChildren++ - this.children[id] = c -} - - -// stop a worker, identified by id -Farm.prototype.stopChild = function (childId) { - let child = this.children[childId] - if (child) { - child.send({owner: 'farm', event: 'die'}) - setTimeout(function () { - if (child.exitCode === null) - child.child.kill('SIGKILL') - }, this.options.forcedKillTime).unref() - ;delete this.children[childId] - this.activeChildren-- - } -} - - -// called from a child process, the data contains information needed to -// look up the child and the original call so we can invoke the callback -Farm.prototype.receive = function (data) { - let idx = data.idx - , childId = data.child - , args = data.args - , child = this.children[childId] - , call - - if (!child) { - return console.error( - 'Worker Farm: Received message for unknown child. ' - + 'This is likely as a result of premature child death, ' - + 'the operation will have been re-queued.' - ) - } - - call = child.calls[idx] - if (!call) { - return console.error( - 'Worker Farm: Received message for unknown index for existing child. ' - + 'This should not happen!' - ) - } - - if (this.options.maxCallTime !== Infinity) - clearTimeout(call.timer) - - if (args[0] && args[0].$error == '$error') { - let e = args[0] - switch (e.type) { - case 'TypeError': args[0] = new TypeError(e.message); break - case 'RangeError': args[0] = new RangeError(e.message); break - case 'EvalError': args[0] = new EvalError(e.message); break - case 'ReferenceError': args[0] = new ReferenceError(e.message); break - case 'SyntaxError': args[0] = new SyntaxError(e.message); break - case 'URIError': args[0] = new URIError(e.message); break - default: args[0] = new Error(e.message) - } - args[0].type = e.type - args[0].stack = e.stack - - // Copy any custom properties to pass it on. - Object.keys(e).forEach(function(key) { - args[0][key] = e[key]; - }); - } - - process.nextTick(function () { - call.callback.apply(null, args) - }) - - ;delete child.calls[idx] - child.activeCalls-- - this.activeCalls-- - - if (child.calls.length >= this.options.maxCallsPerWorker - && !Object.keys(child.calls).length) { - // this child has finished its run, kill it - this.stopChild(childId) - } - - // allow any outstanding calls to be processed - this.processQueue() -} - - -Farm.prototype.childTimeout = function (childId) { - let child = this.children[childId] - , i - - if (!child) - return - - for (i in child.calls) { - this.receive({ - idx : i - , child : childId - , args : [ new TimeoutError('worker call timed out!') ] - }) - } - this.stopChild(childId) -} - - -// send a call to a worker, identified by id -Farm.prototype.send = function (childId, call) { - let child = this.children[childId] - , idx = child.calls.length - - child.calls.push(call) - child.activeCalls++ - this.activeCalls++ - - child.send({ - owner : 'farm' - , idx : idx - , child : childId - , method : call.method - , args : call.args - }) - - if (this.options.maxCallTime !== Infinity) { - call.timer = - setTimeout(this.childTimeout.bind(this, childId), this.options.maxCallTime) - } -} - - -// a list of active worker ids, in order, but the starting offset is -// shifted each time this method is called, so we work our way through -// all workers when handing out jobs -Farm.prototype.childKeys = function () { - let cka = Object.keys(this.children) - , cks - - if (this.searchStart >= cka.length - 1) - this.searchStart = 0 - else - this.searchStart++ - - cks = cka.splice(0, this.searchStart) - - return cka.concat(cks) -} - - -// Calls are added to a queue, this processes the queue and is called -// whenever there might be a chance to send more calls to the workers. -// The various options all impact on when we're able to send calls, -// they may need to be kept in a queue until a worker is ready. -Farm.prototype.processQueue = function () { - let cka, i = 0, childId - - if (!this.callQueue.length) - return this.ending && this.end() - - if (this.activeChildren < this.options.maxConcurrentWorkers) - this.startChild() - - for (cka = this.childKeys(); i < cka.length; i++) { - childId = +cka[i] - if (this.children[childId].activeCalls < this.options.maxConcurrentCallsPerWorker - && this.children[childId].calls.length < this.options.maxCallsPerWorker) { - - this.send(childId, this.callQueue.shift()) - if (!this.callQueue.length) - return this.ending && this.end() - } /*else { - console.log( - , this.children[childId].activeCalls < this.options.maxConcurrentCallsPerWorker - , this.children[childId].calls.length < this.options.maxCallsPerWorker - , this.children[childId].calls.length , this.options.maxCallsPerWorker) - }*/ - } - - if (this.ending) - this.end() -} - - -// add a new call to the call queue, then trigger a process of the queue -Farm.prototype.addCall = function (call) { - if (this.ending) - return this.end() // don't add anything new to the queue - this.callQueue.push(call) - this.processQueue() -} - - -// kills child workers when they're all done -Farm.prototype.end = function (callback) { - let complete = true - if (this.ending === false) - return - if (callback) - this.ending = callback - else if (this.ending == null) - this.ending = true - Object.keys(this.children).forEach(function (child) { - if (!this.children[child]) - return - if (!this.children[child].activeCalls) - this.stopChild(child) - else - complete = false - }.bind(this)) - - if (complete && typeof this.ending == 'function') { - process.nextTick(function () { - this.ending() - this.ending = false - }.bind(this)) - } -} - - -module.exports = Farm -module.exports.TimeoutError = TimeoutError diff --git a/deps/npm/node_modules/worker-farm/lib/fork.js b/deps/npm/node_modules/worker-farm/lib/fork.js deleted file mode 100644 index 5a035d9749e885..00000000000000 --- a/deps/npm/node_modules/worker-farm/lib/fork.js +++ /dev/null @@ -1,33 +0,0 @@ -'use strict' - -const childProcess = require('child_process') - , childModule = require.resolve('./child/index') - - -function fork (forkModule, workerOptions) { - // suppress --debug / --inspect flags while preserving others (like --harmony) - let filteredArgs = process.execArgv.filter(function (v) { - return !(/^--(debug|inspect)/).test(v) - }) - , options = Object.assign({ - execArgv : filteredArgs - , env : process.env - , cwd : process.cwd() - }, workerOptions) - , child = childProcess.fork(childModule, process.argv, options) - - child.on('error', function() { - // this *should* be picked up by onExit and the operation requeued - }) - - child.send({ owner: 'farm', module: forkModule }) - - // return a send() function for this child - return { - send : child.send.bind(child) - , child : child - } -} - - -module.exports = fork diff --git a/deps/npm/node_modules/worker-farm/lib/index.js b/deps/npm/node_modules/worker-farm/lib/index.js deleted file mode 100644 index 8c142227355a7d..00000000000000 --- a/deps/npm/node_modules/worker-farm/lib/index.js +++ /dev/null @@ -1,34 +0,0 @@ -'use strict' - -const Farm = require('./farm') - -let farms = [] // keep record of farms so we can end() them if required - - -function farm (options, path, methods) { - if (typeof options == 'string') { - methods = path - path = options - options = {} - } - - let f = new Farm(options, path) - , api = f.setup(methods) - - farms.push({ farm: f, api: api }) - - // return the public API - return api -} - - -function end (api, callback) { - for (let i = 0; i < farms.length; i++) - if (farms[i] && farms[i].api === api) - return farms[i].farm.end(callback) - process.nextTick(callback.bind(null, new Error('Worker farm not found!'))) -} - - -module.exports = farm -module.exports.end = end diff --git a/deps/npm/node_modules/worker-farm/package.json b/deps/npm/node_modules/worker-farm/package.json deleted file mode 100644 index 3d6181ae95783f..00000000000000 --- a/deps/npm/node_modules/worker-farm/package.json +++ /dev/null @@ -1,61 +0,0 @@ -{ - "_from": "worker-farm@1.7.0", - "_id": "worker-farm@1.7.0", - "_inBundle": false, - "_integrity": "sha512-rvw3QTZc8lAxyVrqcSGVm5yP/IJ2UcB3U0graE3LCFoZ0Yn2x4EoVSqJKdB/T5M+FLcRPjz4TDacRf3OCfNUzw==", - "_location": "/worker-farm", - "_phantomChildren": {}, - "_requested": { - "type": "version", - "registry": true, - "raw": "worker-farm@1.7.0", - "name": "worker-farm", - "escapedName": "worker-farm", - "rawSpec": "1.7.0", - "saveSpec": null, - "fetchSpec": "1.7.0" - }, - "_requiredBy": [ - "#USER", - "/", - "/libcipm" - ], - "_resolved": "https://registry.npmjs.org/worker-farm/-/worker-farm-1.7.0.tgz", - "_shasum": "26a94c5391bbca926152002f69b84a4bf772e5a8", - "_spec": "worker-farm@1.7.0", - "_where": "/Users/isaacs/dev/npm/cli", - "authors": [ - "Rod Vagg @rvagg (https://github.com/rvagg)" - ], - "bugs": { - "url": "https://github.com/rvagg/node-worker-farm/issues" - }, - "bundleDependencies": false, - "dependencies": { - "errno": "~0.1.7" - }, - "deprecated": false, - "description": "Distribute processing tasks to child processes with an über-simple API and baked-in durability & custom concurrency options.", - "devDependencies": { - "tape": "~4.10.1" - }, - "homepage": "https://github.com/rvagg/node-worker-farm", - "keywords": [ - "worker", - "child", - "processing", - "farm" - ], - "license": "MIT", - "main": "./lib/index.js", - "name": "worker-farm", - "repository": { - "type": "git", - "url": "git+https://github.com/rvagg/node-worker-farm.git" - }, - "scripts": { - "test": "node ./tests/" - }, - "types": "./index.d.ts", - "version": "1.7.0" -} diff --git a/deps/npm/node_modules/worker-farm/tests/child.js b/deps/npm/node_modules/worker-farm/tests/child.js deleted file mode 100644 index 71cb728f77b858..00000000000000 --- a/deps/npm/node_modules/worker-farm/tests/child.js +++ /dev/null @@ -1,87 +0,0 @@ -'use strict' - -const fs = require('fs') -const started = Date.now() - - -module.exports = function (timeout, callback) { - callback = callback.bind(null, null, process.pid, Math.random(), timeout) - if (timeout) - return setTimeout(callback, timeout) - callback() -} - - -module.exports.args = function (callback) { - callback(null, { - argv : process.argv - , cwd : process.cwd() - , execArgv : process.execArgv - }) -} - - -module.exports.run0 = function (callback) { - module.exports(0, callback) -} - - -module.exports.killable = function (id, callback) { - if (Math.random() < 0.5) - return process.exit(-1) - callback(null, id, process.pid) -} - - -module.exports.err = function (type, message, data, callback) { - if (typeof data == 'function') { - callback = data - data = null - } else { - let err = new Error(message) - Object.keys(data).forEach(function(key) { - err[key] = data[key] - }) - callback(err) - return - } - - if (type == 'TypeError') - return callback(new TypeError(message)) - callback(new Error(message)) -} - - -module.exports.block = function () { - while (true); -} - - -// use provided file path to save retries count among terminated workers -module.exports.stubborn = function (path, callback) { - function isOutdated(path) { - return ((new Date).getTime() - fs.statSync(path).mtime.getTime()) > 2000 - } - - // file may not be properly deleted, check if modified no earler than two seconds ago - if (!fs.existsSync(path) || isOutdated(path)) { - fs.writeFileSync(path, '1') - process.exit(-1) - } - - let retry = parseInt(fs.readFileSync(path, 'utf8')) - if (Number.isNaN(retry)) - return callback(new Error('file contents is not a number')) - - if (retry > 4) { - callback(null, 12) - } else { - fs.writeFileSync(path, String(retry + 1)) - process.exit(-1) - } -} - - -module.exports.uptime = function (callback) { - callback(null, Date.now() - started) -} diff --git a/deps/npm/node_modules/worker-farm/tests/debug.js b/deps/npm/node_modules/worker-farm/tests/debug.js deleted file mode 100644 index 4d2b803216c9bb..00000000000000 --- a/deps/npm/node_modules/worker-farm/tests/debug.js +++ /dev/null @@ -1,12 +0,0 @@ -'use strict' - -const workerFarm = require('../') - , workers = workerFarm(require.resolve('./child'), ['args']) - - -workers.args(function(err, result) { - console.log(result); - workerFarm.end(workers) - console.log('FINISHED') - process.exit(0) -}) diff --git a/deps/npm/node_modules/worker-farm/tests/index.js b/deps/npm/node_modules/worker-farm/tests/index.js deleted file mode 100644 index e6be7bb7aabd69..00000000000000 --- a/deps/npm/node_modules/worker-farm/tests/index.js +++ /dev/null @@ -1,616 +0,0 @@ -'use strict' - -const tape = require('tape') - , child_process = require('child_process') - , workerFarm = require('../') - , childPath = require.resolve('./child') - , fs = require('fs') - , os = require('os') - -function uniq (ar) { - let a = [], i, j - o: for (i = 0; i < ar.length; ++i) { - for (j = 0; j < a.length; ++j) if (a[j] == ar[i]) continue o - a[a.length] = ar[i] - } - return a -} - - -// a child where module.exports = function ... -tape('simple, exports=function test', function (t) { - t.plan(4) - - let child = workerFarm(childPath) - child(0, function (err, pid, rnd) { - t.ok(pid > process.pid, 'pid makes sense') - t.ok(pid < process.pid + 750, 'pid makes sense') - t.ok(rnd >= 0 && rnd < 1, 'rnd result makes sense') - }) - - workerFarm.end(child, function () { - t.ok(true, 'workerFarm ended') - }) -}) - - -// a child where we have module.exports.fn = function ... -tape('simple, exports.fn test', function (t) { - t.plan(4) - - let child = workerFarm(childPath, [ 'run0' ]) - child.run0(function (err, pid, rnd) { - t.ok(pid > process.pid, 'pid makes sense') - t.ok(pid < process.pid + 750, 'pid makes sense') - t.ok(rnd >= 0 && rnd < 1, 'rnd result makes sense') - }) - - workerFarm.end(child, function () { - t.ok(true, 'workerFarm ended') - }) -}) - - -tape('on child', function (t) { - t.plan(2) - - let child = workerFarm({ onChild: function(subprocess) { childPid = subprocess.pid } }, childPath) - , childPid = null; - - child(0, function(err, pid) { - t.equal(childPid, pid) - }) - - workerFarm.end(child, function () { - t.ok(true, 'workerFarm ended') - }) -}) - - -// use the returned pids to check that we're using a single child process -// when maxConcurrentWorkers = 1 -tape('single worker', function (t) { - t.plan(2) - - let child = workerFarm({ maxConcurrentWorkers: 1 }, childPath) - , pids = [] - , i = 10 - - while (i--) { - child(0, function (err, pid) { - pids.push(pid) - if (pids.length == 10) { - t.equal(1, uniq(pids).length, 'only a single process (by pid)') - } else if (pids.length > 10) - t.fail('too many callbacks!') - }) - } - - workerFarm.end(child, function () { - t.ok(true, 'workerFarm ended') - }) -}) - - -// use the returned pids to check that we're using two child processes -// when maxConcurrentWorkers = 2 -tape('two workers', function (t) { - t.plan(2) - - let child = workerFarm({ maxConcurrentWorkers: 2 }, childPath) - , pids = [] - , i = 10 - - while (i--) { - child(0, function (err, pid) { - pids.push(pid) - if (pids.length == 10) { - t.equal(2, uniq(pids).length, 'only two child processes (by pid)') - } else if (pids.length > 10) - t.fail('too many callbacks!') - }) - } - - workerFarm.end(child, function () { - t.ok(true, 'workerFarm ended') - }) -}) - - -// use the returned pids to check that we're using a child process per -// call when maxConcurrentWorkers = 10 -tape('many workers', function (t) { - t.plan(2) - - let child = workerFarm({ maxConcurrentWorkers: 10 }, childPath) - , pids = [] - , i = 10 - - while (i--) { - child(1, function (err, pid) { - pids.push(pid) - if (pids.length == 10) { - t.equal(10, uniq(pids).length, 'pids are all the same (by pid)') - } else if (pids.length > 10) - t.fail('too many callbacks!') - }) - } - - workerFarm.end(child, function () { - t.ok(true, 'workerFarm ended') - }) -}) - - -tape('auto start workers', function (t) { - let child = workerFarm({ maxConcurrentWorkers: 3, autoStart: true }, childPath, ['uptime']) - , pids = [] - , count = 5 - , i = count - , delay = 250 - - t.plan(count + 1) - - setTimeout(function() { - while (i--) - child.uptime(function (err, uptime) { - t.ok(uptime > 10, 'child has been up before the request (' + uptime + 'ms)') - }) - - workerFarm.end(child, function () { - t.ok(true, 'workerFarm ended') - }) - }, delay) -}) - - -// use the returned pids to check that we're using a child process per -// call when we set maxCallsPerWorker = 1 even when we have maxConcurrentWorkers = 1 -tape('single call per worker', function (t) { - t.plan(2) - - let child = workerFarm({ - maxConcurrentWorkers: 1 - , maxConcurrentCallsPerWorker: Infinity - , maxCallsPerWorker: 1 - , autoStart: true - }, childPath) - , pids = [] - , count = 25 - , i = count - - while (i--) { - child(0, function (err, pid) { - pids.push(pid) - if (pids.length == count) { - t.equal(count, uniq(pids).length, 'one process for each call (by pid)') - workerFarm.end(child, function () { - t.ok(true, 'workerFarm ended') - }) - } else if (pids.length > count) - t.fail('too many callbacks!') - }) - } -}) - - -// use the returned pids to check that we're using a child process per -// two-calls when we set maxCallsPerWorker = 2 even when we have maxConcurrentWorkers = 1 -tape('two calls per worker', function (t) { - t.plan(2) - - let child = workerFarm({ - maxConcurrentWorkers: 1 - , maxConcurrentCallsPerWorker: Infinity - , maxCallsPerWorker: 2 - , autoStart: true - }, childPath) - , pids = [] - , count = 20 - , i = count - - while (i--) { - child(0, function (err, pid) { - pids.push(pid) - if (pids.length == count) { - t.equal(count / 2, uniq(pids).length, 'one process for each call (by pid)') - workerFarm.end(child, function () { - t.ok(true, 'workerFarm ended') - }) - } else if (pids.length > count) - t.fail('too many callbacks!') - }) - } -}) - - -// use timing to confirm that one worker will process calls sequentially -tape('many concurrent calls', function (t) { - t.plan(2) - - let child = workerFarm({ - maxConcurrentWorkers: 1 - , maxConcurrentCallsPerWorker: Infinity - , maxCallsPerWorker: Infinity - , autoStart: true - }, childPath) - , defer = 200 - , count = 200 - , i = count - , cbc = 0 - - setTimeout(function () { - let start = Date.now() - - while (i--) { - child(defer, function () { - if (++cbc == count) { - let time = Date.now() - start - // upper-limit not tied to `count` at all - t.ok(time > defer && time < (defer * 2.5), 'processed tasks concurrently (' + time + 'ms)') - workerFarm.end(child, function () { - t.ok(true, 'workerFarm ended') - }) - } else if (cbc > count) - t.fail('too many callbacks!') - }) - } - }, 250) -}) - - -// use timing to confirm that one child processes calls sequentially with -// maxConcurrentCallsPerWorker = 1 -tape('single concurrent call', function (t) { - t.plan(2) - - let child = workerFarm({ - maxConcurrentWorkers: 1 - , maxConcurrentCallsPerWorker: 1 - , maxCallsPerWorker: Infinity - , autoStart: true - }, childPath) - , defer = 20 - , count = 100 - , i = count - , cbc = 0 - - setTimeout(function () { - let start = Date.now() - - while (i--) { - child(defer, function () { - if (++cbc == count) { - let time = Date.now() - start - // upper-limit tied closely to `count`, 1.3 is generous but accounts for all the timers - // coming back at the same time and the IPC overhead - t.ok(time > (defer * count) && time < (defer * count * 1.3), 'processed tasks sequentially (' + time + ')') - workerFarm.end(child, function () { - t.ok(true, 'workerFarm ended') - }) - } else if (cbc > count) - t.fail('too many callbacks!') - }) - } - }, 250) -}) - - -// use timing to confirm that one child processes *only* 5 calls concurrently -tape('multiple concurrent calls', function (t) { - t.plan(2) - - let callsPerWorker = 5 - , child = workerFarm({ - maxConcurrentWorkers: 1 - , maxConcurrentCallsPerWorker: callsPerWorker - , maxCallsPerWorker: Infinity - , autoStart: true - }, childPath) - , defer = 100 - , count = 100 - , i = count - , cbc = 0 - - setTimeout(function () { - let start = Date.now() - - while (i--) { - child(defer, function () { - if (++cbc == count) { - let time = Date.now() - start - let min = defer * 1.5 - // (defer * (count / callsPerWorker + 2)) - if precise it'd be count/callsPerWorker - // but accounting for IPC and other overhead, we need to give it a bit of extra time, - // hence the +2 - let max = defer * (count / callsPerWorker + 2) - t.ok(time > min && time < max, 'processed tasks concurrently (' + time + ' > ' + min + ' && ' + time + ' < ' + max + ')') - workerFarm.end(child, function () { - t.ok(true, 'workerFarm ended') - }) - } else if (cbc > count) - t.fail('too many callbacks!') - }) - } - }, 250) -}) - - -// call a method that will die with a probability of 0.5 but expect that -// we'll get results for each of our calls anyway -tape('durability', function (t) { - t.plan(3) - - let child = workerFarm({ maxConcurrentWorkers: 2 }, childPath, [ 'killable' ]) - , ids = [] - , pids = [] - , count = 20 - , i = count - - while (i--) { - child.killable(i, function (err, id, pid) { - ids.push(id) - pids.push(pid) - if (ids.length == count) { - t.ok(uniq(pids).length > 2, 'processed by many (' + uniq(pids).length + ') workers, but got there in the end!') - t.ok(uniq(ids).length == count, 'received a single result for each unique call') - workerFarm.end(child, function () { - t.ok(true, 'workerFarm ended') - }) - } else if (ids.length > count) - t.fail('too many callbacks!') - }) - } -}) - - -// a callback provided to .end() can and will be called (uses "simple, exports=function test" to create a child) -tape('simple, end callback', function (t) { - t.plan(4) - - let child = workerFarm(childPath) - child(0, function (err, pid, rnd) { - t.ok(pid > process.pid, 'pid makes sense ' + pid + ' vs ' + process.pid) - t.ok(pid < process.pid + 750, 'pid makes sense ' + pid + ' vs ' + process.pid) - t.ok(rnd >= 0 && rnd < 1, 'rnd result makes sense') - }) - - workerFarm.end(child, function() { - t.pass('an .end() callback was successfully called') - }) -}) - - -tape('call timeout test', function (t) { - t.plan(3 + 3 + 4 + 4 + 4 + 3 + 1) - - let child = workerFarm({ maxCallTime: 250, maxConcurrentWorkers: 1 }, childPath) - - // should come back ok - child(50, function (err, pid, rnd) { - t.ok(pid > process.pid, 'pid makes sense ' + pid + ' vs ' + process.pid) - t.ok(pid < process.pid + 750, 'pid makes sense ' + pid + ' vs ' + process.pid) - t.ok(rnd > 0 && rnd < 1, 'rnd result makes sense ' + rnd) - }) - - // should come back ok - child(50, function (err, pid, rnd) { - t.ok(pid > process.pid, 'pid makes sense ' + pid + ' vs ' + process.pid) - t.ok(pid < process.pid + 750, 'pid makes sense ' + pid + ' vs ' + process.pid) - t.ok(rnd > 0 && rnd < 1, 'rnd result makes sense ' + rnd) - }) - - // should die - child(500, function (err, pid, rnd) { - t.ok(err, 'got an error') - t.equal(err.type, 'TimeoutError', 'correct error type') - t.ok(pid === undefined, 'no pid') - t.ok(rnd === undefined, 'no rnd') - }) - - // should die - child(1000, function (err, pid, rnd) { - t.ok(err, 'got an error') - t.equal(err.type, 'TimeoutError', 'correct error type') - t.ok(pid === undefined, 'no pid') - t.ok(rnd === undefined, 'no rnd') - }) - - // should die even though it is only a 100ms task, it'll get caught up - // in a dying worker - setTimeout(function () { - child(100, function (err, pid, rnd) { - t.ok(err, 'got an error') - t.equal(err.type, 'TimeoutError', 'correct error type') - t.ok(pid === undefined, 'no pid') - t.ok(rnd === undefined, 'no rnd') - }) - }, 200) - - // should be ok, new worker - setTimeout(function () { - child(50, function (err, pid, rnd) { - t.ok(pid > process.pid, 'pid makes sense ' + pid + ' vs ' + process.pid) - t.ok(pid < process.pid + 750, 'pid makes sense ' + pid + ' vs ' + process.pid) - t.ok(rnd > 0 && rnd < 1, 'rnd result makes sense ' + rnd) - }) - workerFarm.end(child, function () { - t.ok(true, 'workerFarm ended') - }) - }, 400) -}) - - -tape('test error passing', function (t) { - t.plan(10) - - let child = workerFarm(childPath, [ 'err' ]) - child.err('Error', 'this is an Error', function (err) { - t.ok(err instanceof Error, 'is an Error object') - t.equal('Error', err.type, 'correct type') - t.equal('this is an Error', err.message, 'correct message') - }) - child.err('TypeError', 'this is a TypeError', function (err) { - t.ok(err instanceof Error, 'is a TypeError object') - t.equal('TypeError', err.type, 'correct type') - t.equal('this is a TypeError', err.message, 'correct message') - }) - child.err('Error', 'this is an Error with custom props', {foo: 'bar', 'baz': 1}, function (err) { - t.ok(err instanceof Error, 'is an Error object') - t.equal(err.foo, 'bar', 'passes data') - t.equal(err.baz, 1, 'passes data') - }) - - workerFarm.end(child, function () { - t.ok(true, 'workerFarm ended') - }) -}) - - -tape('test maxConcurrentCalls', function (t) { - t.plan(10) - - let child = workerFarm({ maxConcurrentCalls: 5 }, childPath) - - child(50, function (err) { t.notOk(err, 'no error') }) - child(50, function (err) { t.notOk(err, 'no error') }) - child(50, function (err) { t.notOk(err, 'no error') }) - child(50, function (err) { t.notOk(err, 'no error') }) - child(50, function (err) { t.notOk(err, 'no error') }) - child(50, function (err) { - t.ok(err) - t.equal(err.type, 'MaxConcurrentCallsError', 'correct error type') - }) - child(50, function (err) { - t.ok(err) - t.equal(err.type, 'MaxConcurrentCallsError', 'correct error type') - }) - - workerFarm.end(child, function () { - t.ok(true, 'workerFarm ended') - }) -}) - - -tape('test maxConcurrentCalls + queue', function (t) { - t.plan(13) - - let child = workerFarm({ maxConcurrentCalls: 4, maxConcurrentWorkers: 2, maxConcurrentCallsPerWorker: 1 }, childPath) - - child(20, function (err) { console.log('ended short1'); t.notOk(err, 'no error, short call 1') }) - child(20, function (err) { console.log('ended short2'); t.notOk(err, 'no error, short call 2') }) - child(300, function (err) { t.notOk(err, 'no error, long call 1') }) - child(300, function (err) { t.notOk(err, 'no error, long call 2') }) - child(20, function (err) { - t.ok(err, 'short call 3 should error') - t.equal(err.type, 'MaxConcurrentCallsError', 'correct error type') - }) - child(20, function (err) { - t.ok(err, 'short call 4 should error') - t.equal(err.type, 'MaxConcurrentCallsError', 'correct error type') - }) - - // cross fingers and hope the two short jobs have ended - setTimeout(function () { - child(20, function (err) { t.notOk(err, 'no error, delayed short call 1') }) - child(20, function (err) { t.notOk(err, 'no error, delayed short call 2') }) - child(20, function (err) { - t.ok(err, 'delayed short call 3 should error') - t.equal(err.type, 'MaxConcurrentCallsError', 'correct error type') - }) - - workerFarm.end(child, function () { - t.ok(true, 'workerFarm ended') - }) - }, 250) -}) - - -// this test should not keep the process running! if the test process -// doesn't die then the problem is here -tape('test timeout kill', function (t) { - t.plan(3) - - let child = workerFarm({ maxCallTime: 250, maxConcurrentWorkers: 1 }, childPath, [ 'block' ]) - child.block(function (err) { - t.ok(err, 'got an error') - t.equal(err.type, 'TimeoutError', 'correct error type') - }) - - workerFarm.end(child, function () { - t.ok(true, 'workerFarm ended') - }) -}) - - -tape('test max retries after process terminate', function (t) { - t.plan(7) - - // temporary file is used to store the number of retries among terminating workers - let filepath1 = '.retries1' - let child1 = workerFarm({ maxConcurrentWorkers: 1, maxRetries: 5}, childPath, [ 'stubborn' ]) - child1.stubborn(filepath1, function (err, result) { - t.notOk(err, 'no error') - t.equal(result, 12, 'correct result') - }) - - workerFarm.end(child1, function () { - fs.unlinkSync(filepath1) - t.ok(true, 'workerFarm ended') - }) - - let filepath2 = '.retries2' - let child2 = workerFarm({ maxConcurrentWorkers: 1, maxRetries: 3}, childPath, [ 'stubborn' ]) - child2.stubborn(filepath2, function (err, result) { - t.ok(err, 'got an error') - t.equal(err.type, 'ProcessTerminatedError', 'correct error type') - t.equal(err.message, 'cancel after 3 retries!', 'correct message and number of retries') - }) - - workerFarm.end(child2, function () { - fs.unlinkSync(filepath2) - t.ok(true, 'workerFarm ended') - }) -}) - - -tape('custom arguments can be passed to "fork"', function (t) { - t.plan(3) - - // allocate a real, valid path, in any OS - let cwd = fs.realpathSync(os.tmpdir()) - , workerOptions = { - cwd : cwd - , execArgv : ['--expose-gc'] - } - , child = workerFarm({ maxConcurrentWorkers: 1, maxRetries: 5, workerOptions: workerOptions}, childPath, ['args']) - - child.args(function (err, result) { - t.equal(result.execArgv[0], '--expose-gc', 'flags passed (overridden default)') - t.equal(result.cwd, cwd, 'correct cwd folder') - }) - - workerFarm.end(child, function () { - t.ok(true, 'workerFarm ended') - }) -}) - - -tape('ensure --debug/--inspect not propagated to children', function (t) { - t.plan(3) - - let script = __dirname + '/debug.js' - , debugArg = process.version.replace(/^v(\d+)\..*$/, '$1') >= 8 ? '--inspect' : '--debug=8881' - , child = child_process.spawn(process.execPath, [ debugArg, script ]) - , stdout = '' - - child.stdout.on('data', function (data) { - stdout += data.toString() - }) - - child.on('close', function (code) { - t.equal(code, 0, 'exited without error (' + code + ')') - t.ok(stdout.indexOf('FINISHED') > -1, 'process finished') - t.ok(stdout.indexOf('--debug') === -1, 'child does not receive debug flag') - }) -}) diff --git a/deps/npm/node_modules/wrap-ansi/index.js b/deps/npm/node_modules/wrap-ansi/index.js deleted file mode 100755 index 5038bb0c534aee..00000000000000 --- a/deps/npm/node_modules/wrap-ansi/index.js +++ /dev/null @@ -1,188 +0,0 @@ -'use strict'; -const stringWidth = require('string-width'); -const stripAnsi = require('strip-ansi'); -const ansiStyles = require('ansi-styles'); - -const ESCAPES = new Set([ - '\u001B', - '\u009B' -]); - -const END_CODE = 39; - -const wrapAnsi = code => `${ESCAPES.values().next().value}[${code}m`; - -// Calculate the length of words split on ' ', ignoring -// the extra characters added by ansi escape codes -const wordLengths = string => string.split(' ').map(character => stringWidth(character)); - -// Wrap a long word across multiple rows -// Ansi escape codes do not count towards length -const wrapWord = (rows, word, columns) => { - const characters = [...word]; - - let insideEscape = false; - let visible = stringWidth(stripAnsi(rows[rows.length - 1])); - - for (const [index, character] of characters.entries()) { - const characterLength = stringWidth(character); - - if (visible + characterLength <= columns) { - rows[rows.length - 1] += character; - } else { - rows.push(character); - visible = 0; - } - - if (ESCAPES.has(character)) { - insideEscape = true; - } else if (insideEscape && character === 'm') { - insideEscape = false; - continue; - } - - if (insideEscape) { - continue; - } - - visible += characterLength; - - if (visible === columns && index < characters.length - 1) { - rows.push(''); - visible = 0; - } - } - - // It's possible that the last row we copy over is only - // ansi escape characters, handle this edge-case - if (!visible && rows[rows.length - 1].length > 0 && rows.length > 1) { - rows[rows.length - 2] += rows.pop(); - } -}; - -// Trims spaces from a string ignoring invisible sequences -const stringVisibleTrimSpacesRight = str => { - const words = str.split(' '); - let last = words.length; - - while (last > 0) { - if (stringWidth(words[last - 1]) > 0) { - break; - } - - last--; - } - - if (last === words.length) { - return str; - } - - return words.slice(0, last).join(' ') + words.slice(last).join(''); -}; - -// The wrap-ansi module can be invoked -// in either 'hard' or 'soft' wrap mode -// -// 'hard' will never allow a string to take up more -// than columns characters -// -// 'soft' allows long words to expand past the column length -const exec = (string, columns, options = {}) => { - if (options.trim !== false && string.trim() === '') { - return ''; - } - - let pre = ''; - let ret = ''; - let escapeCode; - - const lengths = wordLengths(string); - let rows = ['']; - - for (const [index, word] of string.split(' ').entries()) { - if (options.trim !== false) { - rows[rows.length - 1] = rows[rows.length - 1].trimLeft(); - } - - let rowLength = stringWidth(rows[rows.length - 1]); - - if (index !== 0) { - if (rowLength >= columns && (options.wordWrap === false || options.trim === false)) { - // If we start with a new word but the current row length equals the length of the columns, add a new row - rows.push(''); - rowLength = 0; - } - - if (rowLength > 0 || options.trim === false) { - rows[rows.length - 1] += ' '; - rowLength++; - } - } - - // In 'hard' wrap mode, the length of a line is - // never allowed to extend past 'columns' - if (options.hard && lengths[index] > columns) { - const remainingColumns = (columns - rowLength); - const breaksStartingThisLine = 1 + Math.floor((lengths[index] - remainingColumns - 1) / columns); - const breaksStartingNextLine = Math.floor((lengths[index] - 1) / columns); - if (breaksStartingNextLine < breaksStartingThisLine) { - rows.push(''); - } - - wrapWord(rows, word, columns); - continue; - } - - if (rowLength + lengths[index] > columns && rowLength > 0 && lengths[index] > 0) { - if (options.wordWrap === false && rowLength < columns) { - wrapWord(rows, word, columns); - continue; - } - - rows.push(''); - } - - if (rowLength + lengths[index] > columns && options.wordWrap === false) { - wrapWord(rows, word, columns); - continue; - } - - rows[rows.length - 1] += word; - } - - if (options.trim !== false) { - rows = rows.map(stringVisibleTrimSpacesRight); - } - - pre = rows.join('\n'); - - for (const [index, character] of [...pre].entries()) { - ret += character; - - if (ESCAPES.has(character)) { - const code = parseFloat(/\d[^m]*/.exec(pre.slice(index, index + 4))); - escapeCode = code === END_CODE ? null : code; - } - - const code = ansiStyles.codes.get(Number(escapeCode)); - - if (escapeCode && code) { - if (pre[index + 1] === '\n') { - ret += wrapAnsi(code); - } else if (character === '\n') { - ret += wrapAnsi(escapeCode); - } - } - } - - return ret; -}; - -// For each newline, invoke the method separately -module.exports = (string, columns, options) => { - return String(string) - .normalize() - .split('\n') - .map(line => exec(line, columns, options)) - .join('\n'); -}; diff --git a/deps/npm/node_modules/wrap-ansi/license b/deps/npm/node_modules/wrap-ansi/license deleted file mode 100644 index e7af2f77107d73..00000000000000 --- a/deps/npm/node_modules/wrap-ansi/license +++ /dev/null @@ -1,9 +0,0 @@ -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/deps/npm/node_modules/wrap-ansi/node_modules/ansi-regex/index.js b/deps/npm/node_modules/wrap-ansi/node_modules/ansi-regex/index.js deleted file mode 100644 index c25448009f304d..00000000000000 --- a/deps/npm/node_modules/wrap-ansi/node_modules/ansi-regex/index.js +++ /dev/null @@ -1,14 +0,0 @@ -'use strict'; - -module.exports = options => { - options = Object.assign({ - onlyFirst: false - }, options); - - const pattern = [ - '[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:[a-zA-Z\\d]*(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)', - '(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))' - ].join('|'); - - return new RegExp(pattern, options.onlyFirst ? undefined : 'g'); -}; diff --git a/deps/npm/node_modules/wrap-ansi/node_modules/ansi-regex/license b/deps/npm/node_modules/wrap-ansi/node_modules/ansi-regex/license deleted file mode 100644 index e7af2f77107d73..00000000000000 --- a/deps/npm/node_modules/wrap-ansi/node_modules/ansi-regex/license +++ /dev/null @@ -1,9 +0,0 @@ -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/deps/npm/node_modules/wrap-ansi/node_modules/ansi-regex/package.json b/deps/npm/node_modules/wrap-ansi/node_modules/ansi-regex/package.json deleted file mode 100644 index d12a58a622317f..00000000000000 --- a/deps/npm/node_modules/wrap-ansi/node_modules/ansi-regex/package.json +++ /dev/null @@ -1,85 +0,0 @@ -{ - "_from": "ansi-regex@^4.1.0", - "_id": "ansi-regex@4.1.0", - "_inBundle": false, - "_integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", - "_location": "/wrap-ansi/ansi-regex", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "ansi-regex@^4.1.0", - "name": "ansi-regex", - "escapedName": "ansi-regex", - "rawSpec": "^4.1.0", - "saveSpec": null, - "fetchSpec": "^4.1.0" - }, - "_requiredBy": [ - "/wrap-ansi/strip-ansi" - ], - "_resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", - "_shasum": "8b9f8f08cf1acb843756a839ca8c7e3168c51997", - "_spec": "ansi-regex@^4.1.0", - "_where": "/Users/claudiahdz/npm/cli/node_modules/wrap-ansi/node_modules/strip-ansi", - "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": "^0.25.0", - "xo": "^0.23.0" - }, - "engines": { - "node": ">=6" - }, - "files": [ - "index.js" - ], - "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", - "view-supported": "node fixtures/view-codes.js" - }, - "version": "4.1.0" -} diff --git a/deps/npm/node_modules/wrap-ansi/node_modules/ansi-regex/readme.md b/deps/npm/node_modules/wrap-ansi/node_modules/ansi-regex/readme.md deleted file mode 100644 index d19c44667e704b..00000000000000 --- a/deps/npm/node_modules/wrap-ansi/node_modules/ansi-regex/readme.md +++ /dev/null @@ -1,87 +0,0 @@ -# ansi-regex [![Build Status](https://travis-ci.org/chalk/ansi-regex.svg?branch=master)](https://travis-ci.org/chalk/ansi-regex) - -> Regular expression for matching [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code) - ---- - -
    - - 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 - -``` -$ npm install ansi-regex -``` - - -## Usage - -```js -const ansiRegex = require('ansi-regex'); - -ansiRegex().test('\u001B[4mcake\u001B[0m'); -//=> true - -ansiRegex().test('cake'); -//=> false - -'\u001B[4mcake\u001B[0m'.match(ansiRegex()); -//=> ['\u001B[4m', '\u001B[0m'] - -'\u001B[4mcake\u001B[0m'.match(ansiRegex({onlyFirst: true})); -//=> ['\u001B[4m'] - -'\u001B]8;;https://github.com\u0007click\u001B]8;;\u0007'.match(ansiRegex()); -//=> ['\u001B]8;;https://github.com\u0007', '\u001B]8;;\u0007'] -``` - - -## API - -### ansiRegex([options]) - -Returns a regex for matching ANSI escape codes. - -#### options - -##### onlyFirst - -Type: `boolean`
    -Default: `false` *(Matches any ANSI escape codes in a string)* - -Match only the first ANSI escape. - - -## FAQ - -### Why do you test for codes not in the ECMA 48 standard? - -Some of the codes we run as a test are codes that we acquired finding various lists of non-standard or manufacturer specific codes. We test for both standard and non-standard codes, as most of them follow the same or similar format and can be safely matched in strings without the risk of removing actual string content. There are a few non-standard control codes that do not follow the traditional format (i.e. they end in numbers) thus forcing us to exclude them from the test because we cannot reliably match them. - -On the historical side, those ECMA standards were established in the early 90's whereas the VT100, for example, was designed in the mid/late 70's. At that point in time, control codes were still pretty ungoverned and engineers used them for a multitude of things, namely to activate hardware ports that may have been proprietary. Somewhere else you see a similar 'anarchy' of codes is in the x86 architecture for processors; there are a ton of "interrupts" that can mean different things on certain brands of processors, most of which have been phased out. - - -## Security - -To report a security vulnerability, please use the [Tidelift security contact](https://tidelift.com/security). Tidelift will coordinate the fix and disclosure. - - -## Maintainers - -- [Sindre Sorhus](https://github.com/sindresorhus) -- [Josh Junon](https://github.com/qix-) - - -## License - -MIT diff --git a/deps/npm/node_modules/wrap-ansi/node_modules/is-fullwidth-code-point/index.js b/deps/npm/node_modules/wrap-ansi/node_modules/is-fullwidth-code-point/index.js deleted file mode 100644 index d506327c3e5576..00000000000000 --- a/deps/npm/node_modules/wrap-ansi/node_modules/is-fullwidth-code-point/index.js +++ /dev/null @@ -1,46 +0,0 @@ -'use strict'; -/* eslint-disable yoda */ -module.exports = x => { - if (Number.isNaN(x)) { - return false; - } - - // code points are derived from: - // http://www.unix.org/Public/UNIDATA/EastAsianWidth.txt - if ( - x >= 0x1100 && ( - x <= 0x115f || // Hangul Jamo - x === 0x2329 || // LEFT-POINTING ANGLE BRACKET - x === 0x232a || // RIGHT-POINTING ANGLE BRACKET - // CJK Radicals Supplement .. Enclosed CJK Letters and Months - (0x2e80 <= x && x <= 0x3247 && x !== 0x303f) || - // Enclosed CJK Letters and Months .. CJK Unified Ideographs Extension A - (0x3250 <= x && x <= 0x4dbf) || - // CJK Unified Ideographs .. Yi Radicals - (0x4e00 <= x && x <= 0xa4c6) || - // Hangul Jamo Extended-A - (0xa960 <= x && x <= 0xa97c) || - // Hangul Syllables - (0xac00 <= x && x <= 0xd7a3) || - // CJK Compatibility Ideographs - (0xf900 <= x && x <= 0xfaff) || - // Vertical Forms - (0xfe10 <= x && x <= 0xfe19) || - // CJK Compatibility Forms .. Small Form Variants - (0xfe30 <= x && x <= 0xfe6b) || - // Halfwidth and Fullwidth Forms - (0xff01 <= x && x <= 0xff60) || - (0xffe0 <= x && x <= 0xffe6) || - // Kana Supplement - (0x1b000 <= x && x <= 0x1b001) || - // Enclosed Ideographic Supplement - (0x1f200 <= x && x <= 0x1f251) || - // CJK Unified Ideographs Extension B .. Tertiary Ideographic Plane - (0x20000 <= x && x <= 0x3fffd) - ) - ) { - return true; - } - - return false; -}; diff --git a/deps/npm/node_modules/wrap-ansi/node_modules/is-fullwidth-code-point/license b/deps/npm/node_modules/wrap-ansi/node_modules/is-fullwidth-code-point/license deleted file mode 100644 index 654d0bfe943437..00000000000000 --- a/deps/npm/node_modules/wrap-ansi/node_modules/is-fullwidth-code-point/license +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -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/deps/npm/node_modules/wrap-ansi/node_modules/is-fullwidth-code-point/package.json b/deps/npm/node_modules/wrap-ansi/node_modules/is-fullwidth-code-point/package.json deleted file mode 100644 index f28d7996ce3a72..00000000000000 --- a/deps/npm/node_modules/wrap-ansi/node_modules/is-fullwidth-code-point/package.json +++ /dev/null @@ -1,77 +0,0 @@ -{ - "_from": "is-fullwidth-code-point@^2.0.0", - "_id": "is-fullwidth-code-point@2.0.0", - "_inBundle": false, - "_integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", - "_location": "/wrap-ansi/is-fullwidth-code-point", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "is-fullwidth-code-point@^2.0.0", - "name": "is-fullwidth-code-point", - "escapedName": "is-fullwidth-code-point", - "rawSpec": "^2.0.0", - "saveSpec": null, - "fetchSpec": "^2.0.0" - }, - "_requiredBy": [ - "/wrap-ansi/string-width" - ], - "_resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", - "_shasum": "a3b30a5c4f199183167aaab93beefae3ddfb654f", - "_spec": "is-fullwidth-code-point@^2.0.0", - "_where": "/Users/claudiahdz/npm/cli/node_modules/wrap-ansi/node_modules/string-width", - "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": "*", - "xo": "*" - }, - "engines": { - "node": ">=4" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/sindresorhus/is-fullwidth-code-point#readme", - "keywords": [ - "fullwidth", - "full-width", - "full", - "width", - "unicode", - "character", - "char", - "string", - "str", - "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" - }, - "version": "2.0.0", - "xo": { - "esnext": true - } -} diff --git a/deps/npm/node_modules/wrap-ansi/node_modules/is-fullwidth-code-point/readme.md b/deps/npm/node_modules/wrap-ansi/node_modules/is-fullwidth-code-point/readme.md deleted file mode 100644 index 093b0281b2c46b..00000000000000 --- a/deps/npm/node_modules/wrap-ansi/node_modules/is-fullwidth-code-point/readme.md +++ /dev/null @@ -1,39 +0,0 @@ -# is-fullwidth-code-point [![Build Status](https://travis-ci.org/sindresorhus/is-fullwidth-code-point.svg?branch=master)](https://travis-ci.org/sindresorhus/is-fullwidth-code-point) - -> Check if the character represented by a given [Unicode code point](https://en.wikipedia.org/wiki/Code_point) is [fullwidth](https://en.wikipedia.org/wiki/Halfwidth_and_fullwidth_forms) - - -## Install - -``` -$ npm install --save is-fullwidth-code-point -``` - - -## Usage - -```js -const isFullwidthCodePoint = require('is-fullwidth-code-point'); - -isFullwidthCodePoint('谢'.codePointAt()); -//=> true - -isFullwidthCodePoint('a'.codePointAt()); -//=> false -``` - - -## API - -### isFullwidthCodePoint(input) - -#### input - -Type: `number` - -[Code point](https://en.wikipedia.org/wiki/Code_point) of a character. - - -## License - -MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/deps/npm/node_modules/wrap-ansi/node_modules/string-width/index.js b/deps/npm/node_modules/wrap-ansi/node_modules/string-width/index.js deleted file mode 100644 index 33c9d6c06f7a59..00000000000000 --- a/deps/npm/node_modules/wrap-ansi/node_modules/string-width/index.js +++ /dev/null @@ -1,39 +0,0 @@ -'use strict'; -const stripAnsi = require('strip-ansi'); -const isFullwidthCodePoint = require('is-fullwidth-code-point'); -const emojiRegex = require('emoji-regex')(); - -module.exports = input => { - input = input.replace(emojiRegex, ' '); - - if (typeof input !== 'string' || input.length === 0) { - return 0; - } - - input = stripAnsi(input); - - let width = 0; - - for (let i = 0; i < input.length; i++) { - const code = input.codePointAt(i); - - // Ignore control characters - if (code <= 0x1F || (code >= 0x7F && code <= 0x9F)) { - continue; - } - - // Ignore combining characters - if (code >= 0x300 && code <= 0x36F) { - continue; - } - - // Surrogates - if (code > 0xFFFF) { - i++; - } - - width += isFullwidthCodePoint(code) ? 2 : 1; - } - - return width; -}; diff --git a/deps/npm/node_modules/wrap-ansi/node_modules/string-width/license b/deps/npm/node_modules/wrap-ansi/node_modules/string-width/license deleted file mode 100644 index e7af2f77107d73..00000000000000 --- a/deps/npm/node_modules/wrap-ansi/node_modules/string-width/license +++ /dev/null @@ -1,9 +0,0 @@ -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/deps/npm/node_modules/wrap-ansi/node_modules/string-width/package.json b/deps/npm/node_modules/wrap-ansi/node_modules/string-width/package.json deleted file mode 100644 index d68196008b7678..00000000000000 --- a/deps/npm/node_modules/wrap-ansi/node_modules/string-width/package.json +++ /dev/null @@ -1,88 +0,0 @@ -{ - "_from": "string-width@^3.0.0", - "_id": "string-width@3.1.0", - "_inBundle": false, - "_integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", - "_location": "/wrap-ansi/string-width", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "string-width@^3.0.0", - "name": "string-width", - "escapedName": "string-width", - "rawSpec": "^3.0.0", - "saveSpec": null, - "fetchSpec": "^3.0.0" - }, - "_requiredBy": [ - "/wrap-ansi" - ], - "_resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", - "_shasum": "22767be21b62af1081574306f69ac51b62203961", - "_spec": "string-width@^3.0.0", - "_where": "/Users/claudiahdz/npm/cli/node_modules/wrap-ansi", - "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": "^7.0.1", - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^5.1.0" - }, - "deprecated": false, - "description": "Get the visual width of a string - the number of columns required to display it", - "devDependencies": { - "ava": "^1.0.1", - "xo": "^0.23.0" - }, - "engines": { - "node": ">=6" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/sindresorhus/string-width#readme", - "keywords": [ - "string", - "str", - "character", - "char", - "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" - }, - "version": "3.1.0" -} diff --git a/deps/npm/node_modules/wrap-ansi/node_modules/string-width/readme.md b/deps/npm/node_modules/wrap-ansi/node_modules/string-width/readme.md deleted file mode 100644 index d39d95f56cf3f8..00000000000000 --- a/deps/npm/node_modules/wrap-ansi/node_modules/string-width/readme.md +++ /dev/null @@ -1,45 +0,0 @@ -# string-width [![Build Status](https://travis-ci.org/sindresorhus/string-width.svg?branch=master)](https://travis-ci.org/sindresorhus/string-width) - -> Get the visual width of a string - the number of columns required to display it - -Some Unicode characters are [fullwidth](https://en.wikipedia.org/wiki/Halfwidth_and_fullwidth_forms) and use double the normal width. [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code) are stripped and doesn't affect the width. - -Useful to be able to measure the actual width of command-line output. - - -## Install - -``` -$ npm install string-width -``` - - -## Usage - -```js -const stringWidth = require('string-width'); - -stringWidth('古'); -//=> 2 - -stringWidth('\u001b[1m古\u001b[22m'); -//=> 2 - -stringWidth('a'); -//=> 1 - -stringWidth('\u001B]8;;https://github.com\u0007Click\u001B]8;;\u0007'); -// => 5 -``` - - -## Related - -- [string-width-cli](https://github.com/sindresorhus/string-width-cli) - CLI for this module -- [string-length](https://github.com/sindresorhus/string-length) - Get the real length of a string -- [widest-line](https://github.com/sindresorhus/widest-line) - Get the visual width of the widest line in a string - - -## License - -MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/deps/npm/node_modules/wrap-ansi/node_modules/strip-ansi/index.d.ts b/deps/npm/node_modules/wrap-ansi/node_modules/strip-ansi/index.d.ts deleted file mode 100644 index 44e954d0c724d8..00000000000000 --- a/deps/npm/node_modules/wrap-ansi/node_modules/strip-ansi/index.d.ts +++ /dev/null @@ -1,15 +0,0 @@ -/** -Strip [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code) from a string. - -@example -``` -import stripAnsi from 'strip-ansi'; - -stripAnsi('\u001B[4mUnicorn\u001B[0m'); -//=> 'Unicorn' - -stripAnsi('\u001B]8;;https://github.com\u0007Click\u001B]8;;\u0007'); -//=> 'Click' -``` -*/ -export default function stripAnsi(string: string): string; diff --git a/deps/npm/node_modules/wrap-ansi/node_modules/strip-ansi/index.js b/deps/npm/node_modules/wrap-ansi/node_modules/strip-ansi/index.js deleted file mode 100644 index 9788c96dfa3b0c..00000000000000 --- a/deps/npm/node_modules/wrap-ansi/node_modules/strip-ansi/index.js +++ /dev/null @@ -1,7 +0,0 @@ -'use strict'; -const ansiRegex = require('ansi-regex'); - -const stripAnsi = string => typeof string === 'string' ? string.replace(ansiRegex(), '') : string; - -module.exports = stripAnsi; -module.exports.default = stripAnsi; diff --git a/deps/npm/node_modules/wrap-ansi/node_modules/strip-ansi/license b/deps/npm/node_modules/wrap-ansi/node_modules/strip-ansi/license deleted file mode 100644 index e7af2f77107d73..00000000000000 --- a/deps/npm/node_modules/wrap-ansi/node_modules/strip-ansi/license +++ /dev/null @@ -1,9 +0,0 @@ -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/deps/npm/node_modules/wrap-ansi/node_modules/strip-ansi/package.json b/deps/npm/node_modules/wrap-ansi/node_modules/strip-ansi/package.json deleted file mode 100644 index c217180370483d..00000000000000 --- a/deps/npm/node_modules/wrap-ansi/node_modules/strip-ansi/package.json +++ /dev/null @@ -1,87 +0,0 @@ -{ - "_from": "strip-ansi@^5.0.0", - "_id": "strip-ansi@5.2.0", - "_inBundle": false, - "_integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", - "_location": "/wrap-ansi/strip-ansi", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "strip-ansi@^5.0.0", - "name": "strip-ansi", - "escapedName": "strip-ansi", - "rawSpec": "^5.0.0", - "saveSpec": null, - "fetchSpec": "^5.0.0" - }, - "_requiredBy": [ - "/wrap-ansi", - "/wrap-ansi/string-width" - ], - "_resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", - "_shasum": "8c9a536feb6afc962bdfa5b104a5091c1ad9c0ae", - "_spec": "strip-ansi@^5.0.0", - "_where": "/Users/claudiahdz/npm/cli/node_modules/wrap-ansi", - "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": "^4.1.0" - }, - "deprecated": false, - "description": "Strip ANSI escape codes from a string", - "devDependencies": { - "ava": "^1.3.1", - "tsd-check": "^0.5.0", - "xo": "^0.24.0" - }, - "engines": { - "node": ">=6" - }, - "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-check" - }, - "version": "5.2.0" -} diff --git a/deps/npm/node_modules/wrap-ansi/node_modules/strip-ansi/readme.md b/deps/npm/node_modules/wrap-ansi/node_modules/strip-ansi/readme.md deleted file mode 100644 index 8681fe8af44242..00000000000000 --- a/deps/npm/node_modules/wrap-ansi/node_modules/strip-ansi/readme.md +++ /dev/null @@ -1,61 +0,0 @@ -# strip-ansi [![Build Status](https://travis-ci.org/chalk/strip-ansi.svg?branch=master)](https://travis-ci.org/chalk/strip-ansi) - -> Strip [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code) from a string - ---- - -
    - - Get professional support for 'strip-ansi' 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 - -``` -$ npm install strip-ansi -``` - - -## Usage - -```js -const stripAnsi = require('strip-ansi'); - -stripAnsi('\u001B[4mUnicorn\u001B[0m'); -//=> 'Unicorn' - -stripAnsi('\u001B]8;;https://github.com\u0007Click\u001B]8;;\u0007'); -//=> 'Click' -``` - - -## Security - -To report a security vulnerability, please use the [Tidelift security contact](https://tidelift.com/security). Tidelift will coordinate the fix and disclosure. - - -## Related - -- [strip-ansi-cli](https://github.com/chalk/strip-ansi-cli) - CLI for this module -- [strip-ansi-stream](https://github.com/chalk/strip-ansi-stream) - Streaming version of this module -- [has-ansi](https://github.com/chalk/has-ansi) - Check if a string has ANSI escape codes -- [ansi-regex](https://github.com/chalk/ansi-regex) - Regular expression for matching ANSI escape codes -- [chalk](https://github.com/chalk/chalk) - Terminal string styling done right - - -## Maintainers - -- [Sindre Sorhus](https://github.com/sindresorhus) -- [Josh Junon](https://github.com/qix-) - - -## License - -MIT diff --git a/deps/npm/node_modules/wrap-ansi/package.json b/deps/npm/node_modules/wrap-ansi/package.json deleted file mode 100644 index f4e7ba490720d3..00000000000000 --- a/deps/npm/node_modules/wrap-ansi/package.json +++ /dev/null @@ -1,95 +0,0 @@ -{ - "_from": "wrap-ansi@^5.1.0", - "_id": "wrap-ansi@5.1.0", - "_inBundle": false, - "_integrity": "sha512-QC1/iN/2/RPVJ5jYK8BGttj5z83LmSKmvbvrXPNCLZSEb32KKVDJDl/MOt2N01qU2H/FkzEa9PKto1BqDjtd7Q==", - "_location": "/wrap-ansi", - "_phantomChildren": { - "emoji-regex": "7.0.3" - }, - "_requested": { - "type": "range", - "registry": true, - "raw": "wrap-ansi@^5.1.0", - "name": "wrap-ansi", - "escapedName": "wrap-ansi", - "rawSpec": "^5.1.0", - "saveSpec": null, - "fetchSpec": "^5.1.0" - }, - "_requiredBy": [ - "/cliui" - ], - "_resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-5.1.0.tgz", - "_shasum": "1fd1f67235d5b6d0fee781056001bfb694c03b09", - "_spec": "wrap-ansi@^5.1.0", - "_where": "/Users/claudiahdz/npm/cli/node_modules/cliui", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "bugs": { - "url": "https://github.com/chalk/wrap-ansi/issues" - }, - "bundleDependencies": false, - "dependencies": { - "ansi-styles": "^3.2.0", - "string-width": "^3.0.0", - "strip-ansi": "^5.0.0" - }, - "deprecated": false, - "description": "Wordwrap a string with ANSI escape codes", - "devDependencies": { - "ava": "^1.2.1", - "chalk": "^2.4.2", - "coveralls": "^3.0.3", - "has-ansi": "^3.0.0", - "nyc": "^13.3.0", - "xo": "^0.24.0" - }, - "engines": { - "node": ">=6" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/chalk/wrap-ansi#readme", - "keywords": [ - "wrap", - "break", - "wordwrap", - "wordbreak", - "linewrap", - "ansi", - "styles", - "color", - "colour", - "colors", - "terminal", - "console", - "cli", - "string", - "tty", - "escape", - "formatting", - "rgb", - "256", - "shell", - "xterm", - "log", - "logging", - "command-line", - "text" - ], - "license": "MIT", - "name": "wrap-ansi", - "repository": { - "type": "git", - "url": "git+https://github.com/chalk/wrap-ansi.git" - }, - "scripts": { - "test": "xo && nyc ava" - }, - "version": "5.1.0" -} diff --git a/deps/npm/node_modules/wrap-ansi/readme.md b/deps/npm/node_modules/wrap-ansi/readme.md deleted file mode 100644 index 73b87de22f52fb..00000000000000 --- a/deps/npm/node_modules/wrap-ansi/readme.md +++ /dev/null @@ -1,108 +0,0 @@ -# wrap-ansi [![Build Status](https://travis-ci.org/chalk/wrap-ansi.svg?branch=master)](https://travis-ci.org/chalk/wrap-ansi) [![Coverage Status](https://coveralls.io/repos/github/chalk/wrap-ansi/badge.svg?branch=master)](https://coveralls.io/github/chalk/wrap-ansi?branch=master) - -> Wordwrap a string with [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code#Colors_and_Styles) - - -## Install - -``` -$ npm install wrap-ansi -``` - - -## Usage - -```js -const chalk = require('chalk'); -const wrapAnsi = require('wrap-ansi'); - -const input = 'The quick brown ' + chalk.red('fox jumped over ') + - 'the lazy ' + chalk.green('dog and then ran away with the unicorn.'); - -console.log(wrapAnsi(input, 20)); -``` - - - ---- - -
    - - 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. -
    -
    - ---- - - -## API - -### wrapAnsi(input, columns, [options]) - -Wrap words to the specified column width. - -#### input - -Type: `string` - -String with ANSI escape codes. Like one styled by [`chalk`](https://github.com/chalk/chalk). - -#### columns - -Type: `number` - -Number of columns to wrap the text to. - -#### options - -Type: `Object` - -##### hard - -Type: `boolean`
    -Default: `false` - -By default the wrap is soft, meaning long words may extend past the column width. Setting this to `true` will make it hard wrap at the column width. - -##### wordWrap - -Type: `boolean`
    -Default: `true` - -By default, an attempt is made to split words at spaces, ensuring that they don't extend past the configured columns. If wordWrap is `false`, each column will instead be completely filled splitting words as necessary. - -##### trim - -Type: `boolean`
    -Default: `true` - -Whitespace on all lines is removed by default. Set this option to `false` if you don't want to trim. - - -## Related - -- [slice-ansi](https://github.com/chalk/slice-ansi) - Slice a string with ANSI escape codes -- [cli-truncate](https://github.com/sindresorhus/cli-truncate) - Truncate a string to a specific width in the terminal -- [chalk](https://github.com/chalk/chalk) - Terminal string styling done right -- [jsesc](https://github.com/mathiasbynens/jsesc) - Generate ASCII-only output from Unicode strings. Useful for creating test fixtures. - - -## Maintainers - -- [Sindre Sorhus](https://github.com/sindresorhus) -- [Josh Junon](https://github.com/qix-) -- [Benjamin Coe](https://github.com/bcoe) - - -## 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 diff --git a/deps/npm/node_modules/wrappy/package.json b/deps/npm/node_modules/wrappy/package.json index ae9c38ea80ef51..130752046714d6 100644 --- a/deps/npm/node_modules/wrappy/package.json +++ b/deps/npm/node_modules/wrappy/package.json @@ -1,64 +1,29 @@ { - "_args": [ - [ - "wrappy@1.0.2", - "/Users/rebecca/code/npm" - ] - ], - "_from": "wrappy@1.0.2", - "_id": "wrappy@1.0.2", - "_inBundle": false, - "_integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", - "_location": "/wrappy", - "_phantomChildren": {}, - "_requested": { - "type": "version", - "registry": true, - "raw": "wrappy@1.0.2", - "name": "wrappy", - "escapedName": "wrappy", - "rawSpec": "1.0.2", - "saveSpec": null, - "fetchSpec": "1.0.2" - }, - "_requiredBy": [ - "/", - "/dezalgo", - "/inflight", - "/once" + "name": "wrappy", + "version": "1.0.2", + "description": "Callback wrapping utility", + "main": "wrappy.js", + "files": [ + "wrappy.js" ], - "_resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "_spec": "1.0.2", - "_where": "/Users/rebecca/code/npm", - "author": { - "name": "Isaac Z. Schlueter", - "email": "i@izs.me", - "url": "http://blog.izs.me/" - }, - "bugs": { - "url": "https://github.com/npm/wrappy/issues" + "directories": { + "test": "test" }, "dependencies": {}, - "description": "Callback wrapping utility", "devDependencies": { "tap": "^2.3.1" }, - "directories": { - "test": "test" + "scripts": { + "test": "tap --coverage test/*.js" }, - "files": [ - "wrappy.js" - ], - "homepage": "https://github.com/npm/wrappy", - "license": "ISC", - "main": "wrappy.js", - "name": "wrappy", "repository": { "type": "git", - "url": "git+https://github.com/npm/wrappy.git" + "url": "https://github.com/npm/wrappy" }, - "scripts": { - "test": "tap --coverage test/*.js" + "author": "Isaac Z. Schlueter (http://blog.izs.me/)", + "license": "ISC", + "bugs": { + "url": "https://github.com/npm/wrappy/issues" }, - "version": "1.0.2" + "homepage": "https://github.com/npm/wrappy" } diff --git a/deps/npm/node_modules/write-file-atomic/CHANGELOG.md b/deps/npm/node_modules/write-file-atomic/CHANGELOG.md index 920ae2cb4d1fdb..d1a6c1b862baa6 100644 --- a/deps/npm/node_modules/write-file-atomic/CHANGELOG.md +++ b/deps/npm/node_modules/write-file-atomic/CHANGELOG.md @@ -1,3 +1,10 @@ +# 3.0.0 + +* Implement options.tmpfileCreated callback. +* Drop Node.js 6, modernize code, return Promise from async function. +* Support write TypedArray's like in node fs.writeFile. +* Remove graceful-fs dependency. + # 2.4.3 * Ignore errors raised by `fs.closeSync` when cleaning up after a write diff --git a/deps/npm/node_modules/write-file-atomic/README.md b/deps/npm/node_modules/write-file-atomic/README.md index ca28e99a2b08e2..caea79956f8581 100644 --- a/deps/npm/node_modules/write-file-atomic/README.md +++ b/deps/npm/node_modules/write-file-atomic/README.md @@ -4,7 +4,7 @@ write-file-atomic This is an extension for node's `fs.writeFile` that makes its operation atomic and allows you set ownership (uid/gid of the file). -### var writeFileAtomic = require('write-file-atomic')
    writeFileAtomic(filename, data, [options], callback) +### var writeFileAtomic = require('write-file-atomic')
    writeFileAtomic(filename, data, [options], [callback]) * filename **String** * data **String** | **Buffer** @@ -15,7 +15,7 @@ atomic and allows you set ownership (uid/gid of the file). * encoding **String** | **Null** default = 'utf8' * fsync **Boolean** default = true * mode **Number** default, from existing file, if any - * Promise **Object** default = native Promise object + * tmpfileCreated **Function** called when the tmpfile is created * callback **Function** Atomically and asynchronously writes data to a file, replacing the file if it already @@ -27,7 +27,7 @@ If writeFile completes successfully then, if passed the **chown** option it will the ownership of the file. Finally it renames the file back to the filename you specified. If it encounters errors at any of these steps it will attempt to unlink the temporary file and then pass the error back to the caller. -If multiple writes are concurrently issued to the same file, the write operations are put into a queue and serialized in the order they were called, using Promises. Native promises are used by default, but you can inject your own promise-like object with the **Promise** option. Writes to different files are still executed in parallel. +If multiple writes are concurrently issued to the same file, the write operations are put into a queue and serialized in the order they were called, using Promises. Writes to different files are still executed in parallel. If provided, the **chown** option requires both **uid** and **gid** properties or else you'll get an error. If **chown** is not specified it will default to using @@ -42,6 +42,8 @@ If options is a String, it's assumed to be the **encoding** option. The **encodi If the **fsync** option is **false**, writeFile will skip the final fsync call. +If the **tmpfileCreated** option is specified it will be called with the name of the tmpfile when created. + Example: ```javascript @@ -51,6 +53,20 @@ writeFileAtomic('message.txt', 'Hello Node', {chown:{uid:100,gid:50}}, function }); ``` +This function also supports async/await: + +```javascript +(async () => { + try { + await writeFileAtomic('message.txt', 'Hello Node', {chown:{uid:100,gid:50}}); + console.log('It\'s saved!'); + } catch (err) { + console.error(err); + process.exit(1); + } +})(); +``` + ### var writeFileAtomicSync = require('write-file-atomic').sync
    writeFileAtomicSync(filename, data, [options]) The synchronous version of **writeFileAtomic**. diff --git a/deps/npm/node_modules/write-file-atomic/index.js b/deps/npm/node_modules/write-file-atomic/index.js index 64ae987c011a9f..df5b72a14f74a4 100644 --- a/deps/npm/node_modules/write-file-atomic/index.js +++ b/deps/npm/node_modules/write-file-atomic/index.js @@ -4,17 +4,20 @@ module.exports.sync = writeFileSync module.exports._getTmpname = getTmpname // for testing module.exports._cleanupOnExit = cleanupOnExit -var fs = require('graceful-fs') -var MurmurHash3 = require('imurmurhash') -var onExit = require('signal-exit') -var path = require('path') -var activeFiles = {} +const fs = require('fs') +const MurmurHash3 = require('imurmurhash') +const onExit = require('signal-exit') +const path = require('path') +const isTypedArray = require('is-typedarray') +const typedArrayToBuffer = require('typedarray-to-buffer') +const { promisify } = require('util') +const activeFiles = {} // if we run inside of a worker_thread, `process.pid` is not unique /* istanbul ignore next */ -var threadId = (function getId () { +const threadId = (function getId () { try { - var workerThreads = require('worker_threads') + const workerThreads = require('worker_threads') /// if we are in main thread, this is set to `0` return workerThreads.threadId @@ -24,7 +27,7 @@ var threadId = (function getId () { } })() -var invocations = 0 +let invocations = 0 function getTmpname (filename) { return filename + '.' + MurmurHash3(__filename) @@ -35,146 +38,135 @@ function getTmpname (filename) { } function cleanupOnExit (tmpfile) { - return function () { + return () => { try { fs.unlinkSync(typeof tmpfile === 'function' ? tmpfile() : tmpfile) } catch (_) {} } } -function writeFile (filename, data, options, callback) { - if (options) { - if (options instanceof Function) { - callback = options - options = {} - } else if (typeof options === 'string') { - options = { encoding: options } - } - } else { - options = {} - } - - var Promise = options.Promise || global.Promise - var truename - var fd - var tmpfile - /* istanbul ignore next -- The closure only gets called when onExit triggers */ - var removeOnExitHandler = onExit(cleanupOnExit(() => tmpfile)) - var absoluteName = path.resolve(filename) - - new Promise(function serializeSameFile (resolve) { +function serializeActiveFile (absoluteName) { + return new Promise(resolve => { // make a queue if it doesn't already exist if (!activeFiles[absoluteName]) activeFiles[absoluteName] = [] activeFiles[absoluteName].push(resolve) // add this job to the queue if (activeFiles[absoluteName].length === 1) resolve() // kick off the first one - }).then(function getRealPath () { - return new Promise(function (resolve) { - fs.realpath(filename, function (_, realname) { - truename = realname || filename - tmpfile = getTmpname(truename) - resolve() - }) - }) - }).then(function stat () { - return new Promise(function stat (resolve) { - if (options.mode && options.chown) resolve() - else { - // Either mode or chown is not explicitly set - // Default behavior is to copy it from original file - fs.stat(truename, function (err, stats) { - if (err || !stats) resolve() - else { - options = Object.assign({}, options) - - if (options.mode == null) { - options.mode = stats.mode - } - if (options.chown == null && process.getuid) { - options.chown = { uid: stats.uid, gid: stats.gid } - } - resolve() - } - }) - } - }) - }).then(function thenWriteFile () { - return new Promise(function (resolve, reject) { - fs.open(tmpfile, 'w', options.mode, function (err, _fd) { - fd = _fd - if (err) reject(err) - else resolve() - }) - }) - }).then(function write () { - return new Promise(function (resolve, reject) { - if (Buffer.isBuffer(data)) { - fs.write(fd, data, 0, data.length, 0, function (err) { - if (err) reject(err) - else resolve() - }) - } else if (data != null) { - fs.write(fd, String(data), 0, String(options.encoding || 'utf8'), function (err) { - if (err) reject(err) - else resolve() - }) - } else resolve() - }) - }).then(function syncAndClose () { - return new Promise(function (resolve, reject) { - if (options.fsync !== false) { - fs.fsync(fd, function (err) { - if (err) fs.close(fd, () => reject(err)) - else fs.close(fd, resolve) - }) - } else { - fs.close(fd, resolve) + }) +} + +// https://github.com/isaacs/node-graceful-fs/blob/master/polyfills.js#L315-L342 +function isChownErrOk (err) { + if (err.code === 'ENOSYS') { + return true + } + + const nonroot = !process.getuid || process.getuid() !== 0 + if (nonroot) { + if (err.code === 'EINVAL' || err.code === 'EPERM') { + return true + } + } + + return false +} + +async function writeFileAsync (filename, data, options = {}) { + if (typeof options === 'string') { + options = { encoding: options } + } + + let fd + let tmpfile + /* istanbul ignore next -- The closure only gets called when onExit triggers */ + const removeOnExitHandler = onExit(cleanupOnExit(() => tmpfile)) + const absoluteName = path.resolve(filename) + + try { + await serializeActiveFile(absoluteName) + const truename = await promisify(fs.realpath)(filename).catch(() => filename) + tmpfile = getTmpname(truename) + + if (!options.mode || !options.chown) { + // Either mode or chown is not explicitly set + // Default behavior is to copy it from original file + const stats = await promisify(fs.stat)(truename).catch(() => {}) + if (stats) { + if (options.mode == null) { + options.mode = stats.mode + } + + if (options.chown == null && process.getuid) { + options.chown = { uid: stats.uid, gid: stats.gid } + } } - }) - }).then(function chown () { + } + + fd = await promisify(fs.open)(tmpfile, 'w', options.mode) + if (options.tmpfileCreated) { + await options.tmpfileCreated(tmpfile) + } + if (isTypedArray(data)) { + data = typedArrayToBuffer(data) + } + if (Buffer.isBuffer(data)) { + await promisify(fs.write)(fd, data, 0, data.length, 0) + } else if (data != null) { + await promisify(fs.write)(fd, String(data), 0, String(options.encoding || 'utf8')) + } + + if (options.fsync !== false) { + await promisify(fs.fsync)(fd) + } + + await promisify(fs.close)(fd) fd = null + if (options.chown) { - return new Promise(function (resolve, reject) { - fs.chown(tmpfile, options.chown.uid, options.chown.gid, function (err) { - if (err) reject(err) - else resolve() - }) + await promisify(fs.chown)(tmpfile, options.chown.uid, options.chown.gid).catch(err => { + if (!isChownErrOk(err)) { + throw err + } }) } - }).then(function chmod () { + if (options.mode) { - return new Promise(function (resolve, reject) { - fs.chmod(tmpfile, options.mode, function (err) { - if (err) reject(err) - else resolve() - }) + await promisify(fs.chmod)(tmpfile, options.mode).catch(err => { + if (!isChownErrOk(err)) { + throw err + } }) } - }).then(function rename () { - return new Promise(function (resolve, reject) { - fs.rename(tmpfile, truename, function (err) { - if (err) reject(err) - else resolve() - }) - }) - }).then(function success () { + + await promisify(fs.rename)(tmpfile, truename) + } finally { + if (fd) { + await promisify(fs.close)(fd).catch( + /* istanbul ignore next */ + () => {} + ) + } removeOnExitHandler() - callback() - }, function fail (err) { - return new Promise(resolve => { - return fd ? fs.close(fd, resolve) : resolve() - }).then(() => { - removeOnExitHandler() - fs.unlink(tmpfile, function () { - callback(err) - }) - }) - }).then(function checkQueue () { + await promisify(fs.unlink)(tmpfile).catch(() => {}) activeFiles[absoluteName].shift() // remove the element added by serializeSameFile if (activeFiles[absoluteName].length > 0) { activeFiles[absoluteName][0]() // start next job if one is pending } else delete activeFiles[absoluteName] - }) + } +} + +function writeFile (filename, data, options, callback) { + if (options instanceof Function) { + callback = options + options = {} + } + + const promise = writeFileAsync(filename, data, options) + if (callback) { + promise.then(callback, callback) + } + + return promise } function writeFileSync (filename, data, options) { @@ -185,13 +177,13 @@ function writeFileSync (filename, data, options) { } catch (ex) { // it's ok, it'll happen on a not yet existing file } - var tmpfile = getTmpname(filename) + const tmpfile = getTmpname(filename) if (!options.mode || !options.chown) { // Either mode or chown is not explicitly set // Default behavior is to copy it from original file try { - var stats = fs.statSync(filename) + const stats = fs.statSync(filename) options = Object.assign({}, options) if (!options.mode) { options.mode = stats.mode @@ -204,12 +196,19 @@ function writeFileSync (filename, data, options) { } } - var fd - var cleanup = cleanupOnExit(tmpfile) - var removeOnExitHandler = onExit(cleanup) + let fd + const cleanup = cleanupOnExit(tmpfile) + const removeOnExitHandler = onExit(cleanup) + let threw = true try { - fd = fs.openSync(tmpfile, 'w', options.mode) + fd = fs.openSync(tmpfile, 'w', options.mode || 0o666) + if (options.tmpfileCreated) { + options.tmpfileCreated(tmpfile) + } + if (isTypedArray(data)) { + data = typedArrayToBuffer(data) + } if (Buffer.isBuffer(data)) { fs.writeSync(fd, data, 0, data.length, 0) } else if (data != null) { @@ -218,12 +217,33 @@ function writeFileSync (filename, data, options) { if (options.fsync !== false) { fs.fsyncSync(fd) } + fs.closeSync(fd) - if (options.chown) fs.chownSync(tmpfile, options.chown.uid, options.chown.gid) - if (options.mode) fs.chmodSync(tmpfile, options.mode) + fd = null + + if (options.chown) { + try { + fs.chownSync(tmpfile, options.chown.uid, options.chown.gid) + } catch (err) { + if (!isChownErrOk(err)) { + throw err + } + } + } + + if (options.mode) { + try { + fs.chmodSync(tmpfile, options.mode) + } catch (err) { + if (!isChownErrOk(err)) { + throw err + } + } + } + fs.renameSync(tmpfile, filename) - removeOnExitHandler() - } catch (err) { + threw = false + } finally { if (fd) { try { fs.closeSync(fd) @@ -232,7 +252,8 @@ function writeFileSync (filename, data, options) { } } removeOnExitHandler() - cleanup() - throw err + if (threw) { + cleanup() + } } } diff --git a/deps/npm/node_modules/write-file-atomic/package.json b/deps/npm/node_modules/write-file-atomic/package.json index bffa0bbbb3472f..98a29a053453a6 100644 --- a/deps/npm/node_modules/write-file-atomic/package.json +++ b/deps/npm/node_modules/write-file-atomic/package.json @@ -1,75 +1,48 @@ { - "_from": "write-file-atomic@^2.4.2", - "_id": "write-file-atomic@2.4.3", - "_inBundle": false, - "_integrity": "sha512-GaETH5wwsX+GcnzhPgKcKjJ6M2Cq3/iZp1WyY/X1CSqrW+jVNM9Y7D8EC2sM4ZG/V8wZlSniJnCKWPmBYAucRQ==", - "_location": "/write-file-atomic", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "write-file-atomic@^2.4.2", - "name": "write-file-atomic", - "escapedName": "write-file-atomic", - "rawSpec": "^2.4.2", - "saveSpec": null, - "fetchSpec": "^2.4.2" + "name": "write-file-atomic", + "version": "3.0.3", + "description": "Write files in an atomic fashion w/configurable ownership", + "main": "index.js", + "scripts": { + "test": "tap", + "posttest": "npm run lint", + "lint": "standard", + "postlint": "rimraf chowncopy good nochmod nochown nofsync nofsyncopt noopen norename \"norename nounlink\" nowrite", + "preversion": "npm test", + "postversion": "npm publish", + "prepublishOnly": "git push origin --follow-tags" }, - "_requiredBy": [ - "#USER", - "/", - "/bin-links", - "/caching-transform", - "/configstore", - "/tap" - ], - "_resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-2.4.3.tgz", - "_shasum": "1fd2e9ae1df3e75b8d8c367443c692d4ca81f481", - "_spec": "write-file-atomic@^2.4.2", - "_where": "/Users/isaacs/dev/npm/cli", - "author": { - "name": "Rebecca Turner", - "email": "me@re-becca.org", - "url": "http://re-becca.org" + "repository": { + "type": "git", + "url": "git://github.com/npm/write-file-atomic.git" }, + "keywords": [ + "writeFile", + "atomic" + ], + "author": "Rebecca Turner (http://re-becca.org)", + "license": "ISC", "bugs": { - "url": "https://github.com/iarna/write-file-atomic/issues" + "url": "https://github.com/npm/write-file-atomic/issues" }, - "bundleDependencies": false, + "homepage": "https://github.com/npm/write-file-atomic", "dependencies": { - "graceful-fs": "^4.1.11", "imurmurhash": "^0.1.4", - "signal-exit": "^3.0.2" + "is-typedarray": "^1.0.0", + "signal-exit": "^3.0.2", + "typedarray-to-buffer": "^3.1.5" }, - "deprecated": false, - "description": "Write files in an atomic fashion w/configurable ownership", "devDependencies": { "mkdirp": "^0.5.1", - "require-inject": "^1.4.0", - "rimraf": "^2.5.4", - "standard": "^12.0.1", - "tap": "^12.1.3" + "require-inject": "^1.4.4", + "rimraf": "^2.6.3", + "standard": "^14.3.1", + "tap": "^14.10.6" }, "files": [ "index.js" ], - "homepage": "https://github.com/iarna/write-file-atomic", - "keywords": [ - "writeFile", - "atomic" - ], - "license": "ISC", - "main": "index.js", - "name": "write-file-atomic", - "repository": { - "type": "git", - "url": "git+ssh://git@github.com/iarna/write-file-atomic.git" - }, - "scripts": { - "postpublish": "git push origin --follow-tags", - "postversion": "npm publish", - "preversion": "npm test", - "test": "standard && tap --100 test/*.js" - }, - "version": "2.4.3" + "tap": { + "100": true + } } diff --git a/deps/npm/node_modules/xdg-basedir/index.js b/deps/npm/node_modules/xdg-basedir/index.js deleted file mode 100644 index f5aa1769523f89..00000000000000 --- a/deps/npm/node_modules/xdg-basedir/index.js +++ /dev/null @@ -1,28 +0,0 @@ -'use strict'; -const os = require('os'); -const path = require('path'); - -const home = os.homedir(); -const env = process.env; - -exports.data = env.XDG_DATA_HOME || - (home ? path.join(home, '.local', 'share') : null); - -exports.config = env.XDG_CONFIG_HOME || - (home ? path.join(home, '.config') : null); - -exports.cache = env.XDG_CACHE_HOME || (home ? path.join(home, '.cache') : null); - -exports.runtime = env.XDG_RUNTIME_DIR || null; - -exports.dataDirs = (env.XDG_DATA_DIRS || '/usr/local/share/:/usr/share/').split(':'); - -if (exports.data) { - exports.dataDirs.unshift(exports.data); -} - -exports.configDirs = (env.XDG_CONFIG_DIRS || '/etc/xdg').split(':'); - -if (exports.config) { - exports.configDirs.unshift(exports.config); -} diff --git a/deps/npm/node_modules/xdg-basedir/license b/deps/npm/node_modules/xdg-basedir/license deleted file mode 100644 index 654d0bfe943437..00000000000000 --- a/deps/npm/node_modules/xdg-basedir/license +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -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/deps/npm/node_modules/xdg-basedir/package.json b/deps/npm/node_modules/xdg-basedir/package.json deleted file mode 100644 index 939ac842ac507a..00000000000000 --- a/deps/npm/node_modules/xdg-basedir/package.json +++ /dev/null @@ -1,73 +0,0 @@ -{ - "_from": "xdg-basedir@^3.0.0", - "_id": "xdg-basedir@3.0.0", - "_inBundle": false, - "_integrity": "sha1-SWsswQnsqNus/i3HK2A8F8WHCtQ=", - "_location": "/xdg-basedir", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "xdg-basedir@^3.0.0", - "name": "xdg-basedir", - "escapedName": "xdg-basedir", - "rawSpec": "^3.0.0", - "saveSpec": null, - "fetchSpec": "^3.0.0" - }, - "_requiredBy": [ - "/configstore", - "/update-notifier" - ], - "_resolved": "https://registry.npmjs.org/xdg-basedir/-/xdg-basedir-3.0.0.tgz", - "_shasum": "496b2cc109eca8dbacfe2dc72b603c17c5870ad4", - "_spec": "xdg-basedir@^3.0.0", - "_where": "/Users/rebecca/code/npm/node_modules/update-notifier", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "bugs": { - "url": "https://github.com/sindresorhus/xdg-basedir/issues" - }, - "bundleDependencies": false, - "deprecated": false, - "description": "Get XDG Base Directory paths", - "devDependencies": { - "ava": "*", - "require-uncached": "^1.0.2", - "xo": "*" - }, - "engines": { - "node": ">=4" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/sindresorhus/xdg-basedir#readme", - "keywords": [ - "xdg", - "base", - "directory", - "dir", - "basedir", - "path", - "data", - "config", - "cache", - "linux", - "unix", - "spec" - ], - "license": "MIT", - "name": "xdg-basedir", - "repository": { - "type": "git", - "url": "git+https://github.com/sindresorhus/xdg-basedir.git" - }, - "scripts": { - "test": "xo && ava" - }, - "version": "3.0.0" -} diff --git a/deps/npm/node_modules/xdg-basedir/readme.md b/deps/npm/node_modules/xdg-basedir/readme.md deleted file mode 100644 index 61f8c16bedc00f..00000000000000 --- a/deps/npm/node_modules/xdg-basedir/readme.md +++ /dev/null @@ -1,60 +0,0 @@ -# xdg-basedir [![Build Status](https://travis-ci.org/sindresorhus/xdg-basedir.svg?branch=master)](https://travis-ci.org/sindresorhus/xdg-basedir) - -> Get [XDG Base Directory](https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html) paths - - -## Install - -``` -$ npm install --save xdg-basedir -``` - - -## Usage - -```js -const xdgBasedir = require('xdg-basedir'); - -xdgBasedir.data; -//=> '/home/sindresorhus/.local/share' - -xdgBasedir.config; -//=> '/home/sindresorhus/.config' - -xdgBasedir.dataDirs -//=> ['/home/sindresorhus/.local/share', '/usr/local/share/', '/usr/share/'] -``` - - -## API - -The properties `.data`, `.config`, `.cache`, `.runtime` will return `null` in the uncommon case that both the XDG environment variable is not set and the users home directory can't be found. You need to handle this case. A common solution is to [fall back to a temp directory](https://github.com/yeoman/configstore/blob/b82690fc401318ad18dcd7d151a0003a4898a314/index.js#L15). - -### .data - -Directory for user specific data files. - -### .config - -Directory for user specific configuration files. - -### .cache - -Directory for user specific non-essential data files. - -### .runtime - -Directory for user-specific non-essential runtime files and other file objects (such as sockets, named pipes, etc). - -### .dataDirs - -Preference-ordered array of base directories to search for data files in addition to `.data`. - -### .configDirs - -Preference-ordered array of base directories to search for configuration files in addition to `.config`. - - -## License - -MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/deps/npm/node_modules/xtend/.npmignore b/deps/npm/node_modules/xtend/.npmignore deleted file mode 100644 index 3c3629e647f5dd..00000000000000 --- a/deps/npm/node_modules/xtend/.npmignore +++ /dev/null @@ -1 +0,0 @@ -node_modules diff --git a/deps/npm/node_modules/xtend/LICENCE b/deps/npm/node_modules/xtend/LICENCE deleted file mode 100644 index 1a14b437e87a8f..00000000000000 --- a/deps/npm/node_modules/xtend/LICENCE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2012-2014 Raynos. - -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/xtend/Makefile b/deps/npm/node_modules/xtend/Makefile deleted file mode 100644 index d583fcf49dc1a3..00000000000000 --- a/deps/npm/node_modules/xtend/Makefile +++ /dev/null @@ -1,4 +0,0 @@ -browser: - node ./support/compile - -.PHONY: browser \ No newline at end of file diff --git a/deps/npm/node_modules/xtend/README.md b/deps/npm/node_modules/xtend/README.md deleted file mode 100644 index 093cb2978e4af0..00000000000000 --- a/deps/npm/node_modules/xtend/README.md +++ /dev/null @@ -1,32 +0,0 @@ -# xtend - -[![browser support][3]][4] - -[![locked](http://badges.github.io/stability-badges/dist/locked.svg)](http://github.com/badges/stability-badges) - -Extend like a boss - -xtend is a basic utility library which allows you to extend an object by appending all of the properties from each object in a list. When there are identical properties, the right-most property takes precedence. - -## Examples - -```js -var extend = require("xtend") - -// extend returns a new object. Does not mutate arguments -var combination = extend({ - a: "a", - b: 'c' -}, { - b: "b" -}) -// { a: "a", b: "b" } -``` - -## Stability status: Locked - -## MIT Licenced - - - [3]: http://ci.testling.com/Raynos/xtend.png - [4]: http://ci.testling.com/Raynos/xtend diff --git a/deps/npm/node_modules/xtend/immutable.js b/deps/npm/node_modules/xtend/immutable.js deleted file mode 100644 index 94889c9de11a18..00000000000000 --- a/deps/npm/node_modules/xtend/immutable.js +++ /dev/null @@ -1,19 +0,0 @@ -module.exports = extend - -var hasOwnProperty = Object.prototype.hasOwnProperty; - -function extend() { - var target = {} - - for (var i = 0; i < arguments.length; i++) { - var source = arguments[i] - - for (var key in source) { - if (hasOwnProperty.call(source, key)) { - target[key] = source[key] - } - } - } - - return target -} diff --git a/deps/npm/node_modules/xtend/mutable.js b/deps/npm/node_modules/xtend/mutable.js deleted file mode 100644 index 72debede6ca585..00000000000000 --- a/deps/npm/node_modules/xtend/mutable.js +++ /dev/null @@ -1,17 +0,0 @@ -module.exports = extend - -var hasOwnProperty = Object.prototype.hasOwnProperty; - -function extend(target) { - for (var i = 1; i < arguments.length; i++) { - var source = arguments[i] - - for (var key in source) { - if (hasOwnProperty.call(source, key)) { - target[key] = source[key] - } - } - } - - return target -} diff --git a/deps/npm/node_modules/xtend/package.json b/deps/npm/node_modules/xtend/package.json deleted file mode 100644 index bce44d650e6c99..00000000000000 --- a/deps/npm/node_modules/xtend/package.json +++ /dev/null @@ -1,87 +0,0 @@ -{ - "_from": "xtend@~4.0.1", - "_id": "xtend@4.0.1", - "_inBundle": false, - "_integrity": "sha1-pcbVMr5lbiPbgg77lDofBJmNY68=", - "_location": "/xtend", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "xtend@~4.0.1", - "name": "xtend", - "escapedName": "xtend", - "rawSpec": "~4.0.1", - "saveSpec": null, - "fetchSpec": "~4.0.1" - }, - "_requiredBy": [ - "/pkg-config", - "/through2" - ], - "_resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz", - "_shasum": "a5c6d532be656e23db820efb943a1f04998d63af", - "_spec": "xtend@~4.0.1", - "_where": "/Users/rebecca/code/npm/node_modules/through2", - "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", - "options", - "opts", - "object", - "array" - ], - "license": "MIT", - "main": "immutable", - "name": "xtend", - "repository": { - "type": "git", - "url": "git://github.com/Raynos/xtend.git" - }, - "scripts": { - "test": "node test" - }, - "testling": { - "files": "test.js", - "browsers": [ - "ie/7..latest", - "firefox/16..latest", - "firefox/nightly", - "chrome/22..latest", - "chrome/canary", - "opera/12..latest", - "opera/next", - "safari/5.1..latest", - "ipad/6.0..latest", - "iphone/6.0..latest" - ] - }, - "version": "4.0.1" -} diff --git a/deps/npm/node_modules/xtend/test.js b/deps/npm/node_modules/xtend/test.js deleted file mode 100644 index 093a2b061e81ae..00000000000000 --- a/deps/npm/node_modules/xtend/test.js +++ /dev/null @@ -1,83 +0,0 @@ -var test = require("tape") -var extend = require("./") -var mutableExtend = require("./mutable") - -test("merge", function(assert) { - var a = { a: "foo" } - var b = { b: "bar" } - - assert.deepEqual(extend(a, b), { a: "foo", b: "bar" }) - assert.end() -}) - -test("replace", function(assert) { - var a = { a: "foo" } - var b = { a: "bar" } - - assert.deepEqual(extend(a, b), { a: "bar" }) - assert.end() -}) - -test("undefined", function(assert) { - var a = { a: undefined } - var b = { b: "foo" } - - assert.deepEqual(extend(a, b), { a: undefined, b: "foo" }) - assert.deepEqual(extend(b, a), { a: undefined, b: "foo" }) - assert.end() -}) - -test("handle 0", function(assert) { - var a = { a: "default" } - var b = { a: 0 } - - assert.deepEqual(extend(a, b), { a: 0 }) - assert.deepEqual(extend(b, a), { a: "default" }) - assert.end() -}) - -test("is immutable", function (assert) { - var record = {} - - extend(record, { foo: "bar" }) - assert.equal(record.foo, undefined) - assert.end() -}) - -test("null as argument", function (assert) { - var a = { foo: "bar" } - var b = null - var c = void 0 - - assert.deepEqual(extend(b, a, c), { foo: "bar" }) - assert.end() -}) - -test("mutable", function (assert) { - var a = { foo: "bar" } - - mutableExtend(a, { bar: "baz" }) - - assert.equal(a.bar, "baz") - assert.end() -}) - -test("null prototype", function(assert) { - var a = { a: "foo" } - var b = Object.create(null) - b.b = "bar"; - - assert.deepEqual(extend(a, b), { a: "foo", b: "bar" }) - assert.end() -}) - -test("null prototype mutable", function (assert) { - var a = { foo: "bar" } - var b = Object.create(null) - b.bar = "baz"; - - mutableExtend(a, b) - - assert.equal(a.bar, "baz") - assert.end() -}) diff --git a/deps/npm/node_modules/y18n/CHANGELOG.md b/deps/npm/node_modules/y18n/CHANGELOG.md deleted file mode 100644 index c259076ad6da2c..00000000000000 --- a/deps/npm/node_modules/y18n/CHANGELOG.md +++ /dev/null @@ -1,21 +0,0 @@ -# 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. - - -# [4.0.0](https://github.com/yargs/y18n/compare/v3.2.1...v4.0.0) (2017-10-10) - - -### Bug Fixes - -* allow support for falsy values like 0 in tagged literal ([#45](https://github.com/yargs/y18n/issues/45)) ([c926123](https://github.com/yargs/y18n/commit/c926123)) - - -### Features - -* **__:** added tagged template literal support ([#44](https://github.com/yargs/y18n/issues/44)) ([0598daf](https://github.com/yargs/y18n/commit/0598daf)) - - -### BREAKING CHANGES - -* **__:** dropping Node 0.10/Node 0.12 support diff --git a/deps/npm/node_modules/y18n/LICENSE b/deps/npm/node_modules/y18n/LICENSE deleted file mode 100644 index 3c157f0b9d9bed..00000000000000 --- a/deps/npm/node_modules/y18n/LICENSE +++ /dev/null @@ -1,13 +0,0 @@ -Copyright (c) 2015, Contributors - -Permission to use, copy, modify, and/or distribute this software for any purpose -with or without fee is hereby granted, provided that the above copyright notice -and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND -FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS -OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER -TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF -THIS SOFTWARE. diff --git a/deps/npm/node_modules/y18n/README.md b/deps/npm/node_modules/y18n/README.md deleted file mode 100644 index 826474f209b6df..00000000000000 --- a/deps/npm/node_modules/y18n/README.md +++ /dev/null @@ -1,109 +0,0 @@ -# y18n - -[![Build Status][travis-image]][travis-url] -[![Coverage Status][coveralls-image]][coveralls-url] -[![NPM version][npm-image]][npm-url] -[![js-standard-style][standard-image]][standard-url] -[![Conventional Commits](https://img.shields.io/badge/Conventional%20Commits-1.0.0-yellow.svg)](https://conventionalcommits.org) - -The bare-bones internationalization library used by yargs. - -Inspired by [i18n](https://www.npmjs.com/package/i18n). - -## Examples - -_simple string translation:_ - -```js -var __ = require('y18n').__ - -console.log(__('my awesome string %s', 'foo')) -``` - -output: - -`my awesome string foo` - -_using tagged template literals_ - -```js -var __ = require('y18n').__ -var str = 'foo' - -console.log(__`my awesome string ${str}`) -``` - -output: - -`my awesome string foo` - -_pluralization support:_ - -```js -var __n = require('y18n').__n - -console.log(__n('one fish %s', '%d fishes %s', 2, 'foo')) -``` - -output: - -`2 fishes foo` - -## JSON Language Files - -The JSON language files should be stored in a `./locales` folder. -File names correspond to locales, e.g., `en.json`, `pirate.json`. - -When strings are observed for the first time they will be -added to the JSON file corresponding to the current locale. - -## Methods - -### require('y18n')(config) - -Create an instance of y18n with the config provided, options include: - -* `directory`: the locale directory, default `./locales`. -* `updateFiles`: should newly observed strings be updated in file, default `true`. -* `locale`: what locale should be used. -* `fallbackToLanguage`: should fallback to a language-only file (e.g. `en.json`) - be allowed if a file matching the locale does not exist (e.g. `en_US.json`), - default `true`. - -### y18n.\_\_(str, arg, arg, arg) - -Print a localized string, `%s` will be replaced with `arg`s. - -This function can also be used as a tag for a template literal. You can use it -like this: __`hello ${'world'}`. This will be equivalent to -`__('hello %s', 'world')`. - -### y18n.\_\_n(singularString, pluralString, count, arg, arg, arg) - -Print a localized string with appropriate pluralization. If `%d` is provided -in the string, the `count` will replace this placeholder. - -### y18n.setLocale(str) - -Set the current locale being used. - -### y18n.getLocale() - -What locale is currently being used? - -### y18n.updateLocale(obj) - -Update the current locale with the key value pairs in `obj`. - -## License - -ISC - -[travis-url]: https://travis-ci.org/yargs/y18n -[travis-image]: https://img.shields.io/travis/yargs/y18n.svg -[coveralls-url]: https://coveralls.io/github/yargs/y18n -[coveralls-image]: https://img.shields.io/coveralls/yargs/y18n.svg -[npm-url]: https://npmjs.org/package/y18n -[npm-image]: https://img.shields.io/npm/v/y18n.svg -[standard-image]: https://img.shields.io/badge/code%20style-standard-brightgreen.svg -[standard-url]: https://github.com/feross/standard diff --git a/deps/npm/node_modules/y18n/index.js b/deps/npm/node_modules/y18n/index.js deleted file mode 100644 index d72068162876a4..00000000000000 --- a/deps/npm/node_modules/y18n/index.js +++ /dev/null @@ -1,188 +0,0 @@ -var fs = require('fs') -var path = require('path') -var util = require('util') - -function Y18N (opts) { - // configurable options. - opts = opts || {} - this.directory = opts.directory || './locales' - this.updateFiles = typeof opts.updateFiles === 'boolean' ? opts.updateFiles : true - this.locale = opts.locale || 'en' - this.fallbackToLanguage = typeof opts.fallbackToLanguage === 'boolean' ? opts.fallbackToLanguage : true - - // internal stuff. - this.cache = {} - this.writeQueue = [] -} - -Y18N.prototype.__ = function () { - if (typeof arguments[0] !== 'string') { - return this._taggedLiteral.apply(this, arguments) - } - var args = Array.prototype.slice.call(arguments) - var str = args.shift() - var cb = function () {} // start with noop. - - if (typeof args[args.length - 1] === 'function') cb = args.pop() - cb = cb || function () {} // noop. - - if (!this.cache[this.locale]) this._readLocaleFile() - - // we've observed a new string, update the language file. - if (!this.cache[this.locale][str] && this.updateFiles) { - this.cache[this.locale][str] = str - - // include the current directory and locale, - // since these values could change before the - // write is performed. - this._enqueueWrite([this.directory, this.locale, cb]) - } else { - cb() - } - - return util.format.apply(util, [this.cache[this.locale][str] || str].concat(args)) -} - -Y18N.prototype._taggedLiteral = function (parts) { - var args = arguments - var str = '' - parts.forEach(function (part, i) { - var arg = args[i + 1] - str += part - if (typeof arg !== 'undefined') { - str += '%s' - } - }) - return this.__.apply(null, [str].concat([].slice.call(arguments, 1))) -} - -Y18N.prototype._enqueueWrite = function (work) { - this.writeQueue.push(work) - if (this.writeQueue.length === 1) this._processWriteQueue() -} - -Y18N.prototype._processWriteQueue = function () { - var _this = this - var work = this.writeQueue[0] - - // destructure the enqueued work. - var directory = work[0] - var locale = work[1] - var cb = work[2] - - var languageFile = this._resolveLocaleFile(directory, locale) - var serializedLocale = JSON.stringify(this.cache[locale], null, 2) - - fs.writeFile(languageFile, serializedLocale, 'utf-8', function (err) { - _this.writeQueue.shift() - if (_this.writeQueue.length > 0) _this._processWriteQueue() - cb(err) - }) -} - -Y18N.prototype._readLocaleFile = function () { - var localeLookup = {} - var languageFile = this._resolveLocaleFile(this.directory, this.locale) - - try { - localeLookup = JSON.parse(fs.readFileSync(languageFile, 'utf-8')) - } catch (err) { - if (err instanceof SyntaxError) { - err.message = 'syntax error in ' + languageFile - } - - if (err.code === 'ENOENT') localeLookup = {} - else throw err - } - - this.cache[this.locale] = localeLookup -} - -Y18N.prototype._resolveLocaleFile = function (directory, locale) { - var file = path.resolve(directory, './', locale + '.json') - if (this.fallbackToLanguage && !this._fileExistsSync(file) && ~locale.lastIndexOf('_')) { - // attempt fallback to language only - var languageFile = path.resolve(directory, './', locale.split('_')[0] + '.json') - if (this._fileExistsSync(languageFile)) file = languageFile - } - return file -} - -// this only exists because fs.existsSync() "will be deprecated" -// see https://nodejs.org/api/fs.html#fs_fs_existssync_path -Y18N.prototype._fileExistsSync = function (file) { - try { - return fs.statSync(file).isFile() - } catch (err) { - return false - } -} - -Y18N.prototype.__n = function () { - var args = Array.prototype.slice.call(arguments) - var singular = args.shift() - var plural = args.shift() - var quantity = args.shift() - - var cb = function () {} // start with noop. - if (typeof args[args.length - 1] === 'function') cb = args.pop() - - if (!this.cache[this.locale]) this._readLocaleFile() - - var str = quantity === 1 ? singular : plural - if (this.cache[this.locale][singular]) { - str = this.cache[this.locale][singular][quantity === 1 ? 'one' : 'other'] - } - - // we've observed a new string, update the language file. - if (!this.cache[this.locale][singular] && this.updateFiles) { - this.cache[this.locale][singular] = { - one: singular, - other: plural - } - - // include the current directory and locale, - // since these values could change before the - // write is performed. - this._enqueueWrite([this.directory, this.locale, cb]) - } else { - cb() - } - - // if a %d placeholder is provided, add quantity - // to the arguments expanded by util.format. - var values = [str] - if (~str.indexOf('%d')) values.push(quantity) - - return util.format.apply(util, values.concat(args)) -} - -Y18N.prototype.setLocale = function (locale) { - this.locale = locale -} - -Y18N.prototype.getLocale = function () { - return this.locale -} - -Y18N.prototype.updateLocale = function (obj) { - if (!this.cache[this.locale]) this._readLocaleFile() - - for (var key in obj) { - this.cache[this.locale][key] = obj[key] - } -} - -module.exports = function (opts) { - var y18n = new Y18N(opts) - - // bind all functions to y18n, so that - // they can be used in isolation. - for (var key in y18n) { - if (typeof y18n[key] === 'function') { - y18n[key] = y18n[key].bind(y18n) - } - } - - return y18n -} diff --git a/deps/npm/node_modules/y18n/package.json b/deps/npm/node_modules/y18n/package.json deleted file mode 100644 index 24016e224a737b..00000000000000 --- a/deps/npm/node_modules/y18n/package.json +++ /dev/null @@ -1,70 +0,0 @@ -{ - "_from": "y18n@^4.0.0", - "_id": "y18n@4.0.0", - "_inBundle": false, - "_integrity": "sha512-r9S/ZyXu/Xu9q1tYlpsLIsa3EeLXXk0VwlxqTcFRfg9EhMW+17kbt9G0NrgCmhGb5vT2hyhJZLfDGx+7+5Uj/w==", - "_location": "/y18n", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "y18n@^4.0.0", - "name": "y18n", - "escapedName": "y18n", - "rawSpec": "^4.0.0", - "saveSpec": null, - "fetchSpec": "^4.0.0" - }, - "_requiredBy": [ - "/cacache", - "/libnpx", - "/npm-profile/cacache", - "/npm-registry-fetch/cacache" - ], - "_resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.0.tgz", - "_shasum": "95ef94f85ecc81d007c264e190a120f0a3c8566b", - "_spec": "y18n@^4.0.0", - "_where": "/Users/rebecca/code/npm/node_modules/cacache", - "author": { - "name": "Ben Coe", - "email": "ben@npmjs.com" - }, - "bugs": { - "url": "https://github.com/yargs/y18n/issues" - }, - "bundleDependencies": false, - "deprecated": false, - "description": "the bare-bones internationalization library used by yargs", - "devDependencies": { - "chai": "^4.0.1", - "coveralls": "^3.0.0", - "mocha": "^4.0.1", - "nyc": "^11.0.1", - "rimraf": "^2.5.0", - "standard": "^10.0.0-beta.0", - "standard-version": "^4.2.0" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/yargs/y18n", - "keywords": [ - "i18n", - "internationalization", - "yargs" - ], - "license": "ISC", - "main": "index.js", - "name": "y18n", - "repository": { - "type": "git", - "url": "git+ssh://git@github.com/yargs/y18n.git" - }, - "scripts": { - "coverage": "nyc report --reporter=text-lcov | coveralls", - "pretest": "standard", - "release": "standard-version", - "test": "nyc mocha" - }, - "version": "4.0.0" -} diff --git a/deps/npm/node_modules/yallist/package.json b/deps/npm/node_modules/yallist/package.json index a478663faf0701..8a083867d72e00 100644 --- a/deps/npm/node_modules/yallist/package.json +++ b/deps/npm/node_modules/yallist/package.json @@ -1,42 +1,8 @@ { - "_from": "yallist@^3.0.2", - "_id": "yallist@3.0.3", - "_inBundle": false, - "_integrity": "sha512-S+Zk8DEWE6oKpV+vI3qWkaK+jSbIK86pCwe2IF/xwIpQ8jEuxpw9NyaGjmp9+BoJv5FV2piqCDcoCtStppiq2A==", - "_location": "/yallist", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "yallist@^3.0.2", - "name": "yallist", - "escapedName": "yallist", - "rawSpec": "^3.0.2", - "saveSpec": null, - "fetchSpec": "^3.0.2" - }, - "_requiredBy": [ - "/lru-cache" - ], - "_resolved": "https://registry.npmjs.org/yallist/-/yallist-3.0.3.tgz", - "_shasum": "b4b049e314be545e3ce802236d6cd22cd91c3de9", - "_spec": "yallist@^3.0.2", - "_where": "/Users/isaacs/dev/npm/cli/node_modules/lru-cache", - "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, + "name": "yallist", + "version": "4.0.0", "description": "Yet Another Linked List", - "devDependencies": { - "tap": "^12.1.0" - }, + "main": "yallist.js", "directories": { "test": "test" }, @@ -44,19 +10,20 @@ "yallist.js", "iterator.js" ], - "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" + "dependencies": {}, + "devDependencies": { + "tap": "^12.1.0" }, "scripts": { - "postpublish": "git push origin --all; git push origin --tags", - "postversion": "npm publish", + "test": "tap test/*.js --100", "preversion": "npm test", - "test": "tap test/*.js --100" + "postversion": "npm publish", + "postpublish": "git push origin --all; git push origin --tags" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/isaacs/yallist.git" }, - "version": "3.0.3" + "author": "Isaac Z. Schlueter (http://blog.izs.me/)", + "license": "ISC" } diff --git a/deps/npm/node_modules/yallist/yallist.js b/deps/npm/node_modules/yallist/yallist.js index b0ab36cf31b7a6..4e83ab1c542a51 100644 --- a/deps/npm/node_modules/yallist/yallist.js +++ b/deps/npm/node_modules/yallist/yallist.js @@ -54,6 +54,8 @@ Yallist.prototype.removeNode = function (node) { node.next = null node.prev = null node.list = null + + return next } Yallist.prototype.unshiftNode = function (node) { @@ -318,6 +320,37 @@ Yallist.prototype.sliceReverse = function (from, to) { return ret } +Yallist.prototype.splice = function (start, deleteCount, ...nodes) { + if (start > this.length) { + start = this.length - 1 + } + if (start < 0) { + start = this.length + start; + } + + for (var i = 0, walker = this.head; walker !== null && i < start; i++) { + walker = walker.next + } + + var ret = [] + for (var i = 0; walker && i < deleteCount; i++) { + ret.push(walker.value) + walker = this.removeNode(walker) + } + if (walker === null) { + walker = this.tail + } + + if (walker !== this.head && walker !== this.tail) { + walker = walker.prev + } + + for (var i = 0; i < nodes.length; i++) { + walker = insert(this, walker, nodes[i]) + } + return ret; +} + Yallist.prototype.reverse = function () { var head = this.head var tail = this.tail @@ -331,6 +364,23 @@ Yallist.prototype.reverse = function () { return this } +function insert (self, node, value) { + var inserted = node === self.head ? + new Node(value, null, node, self) : + new Node(value, node, node.next, self) + + if (inserted.next === null) { + self.tail = inserted + } + if (inserted.prev === null) { + self.head = inserted + } + + self.length++ + + return inserted +} + function push (self, item) { self.tail = new Node(item, self.tail, null, self) if (!self.head) { diff --git a/deps/npm/node_modules/yargs-parser/CHANGELOG.md b/deps/npm/node_modules/yargs-parser/CHANGELOG.md deleted file mode 100644 index 18ed4b34cbccaa..00000000000000 --- a/deps/npm/node_modules/yargs-parser/CHANGELOG.md +++ /dev/null @@ -1,507 +0,0 @@ -# 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. - -## [15.0.0](https://github.com/yargs/yargs-parser/compare/v14.0.0...v15.0.0) (2019-10-07) - - -### Features - -* rework `collect-unknown-options` into `unknown-options-as-args`, providing more comprehensive functionality ([ef771ca](https://github.com/yargs/yargs-parser/commit/ef771ca)) - - -### BREAKING CHANGES - -* rework `collect-unknown-options` into `unknown-options-as-args`, providing more comprehensive functionality - - - -## [14.0.0](https://github.com/yargs/yargs-parser/compare/v13.1.1...v14.0.0) (2019-09-06) - - -### Bug Fixes - -* boolean arrays with default values ([#185](https://github.com/yargs/yargs-parser/issues/185)) ([7d42572](https://github.com/yargs/yargs-parser/commit/7d42572)) -* boolean now behaves the same as other array types ([#184](https://github.com/yargs/yargs-parser/issues/184)) ([17ca3bd](https://github.com/yargs/yargs-parser/commit/17ca3bd)) -* eatNargs() for 'opt.narg === 0' and boolean typed options ([#188](https://github.com/yargs/yargs-parser/issues/188)) ([c5a1db0](https://github.com/yargs/yargs-parser/commit/c5a1db0)) -* maybeCoerceNumber now takes precedence over coerce return value ([#182](https://github.com/yargs/yargs-parser/issues/182)) ([2f26436](https://github.com/yargs/yargs-parser/commit/2f26436)) -* take into account aliases when appending arrays from config object ([#199](https://github.com/yargs/yargs-parser/issues/199)) ([f8a2d3f](https://github.com/yargs/yargs-parser/commit/f8a2d3f)) - - -### Features - -* add configuration option to "collect-unknown-options" ([#181](https://github.com/yargs/yargs-parser/issues/181)) ([7909cc4](https://github.com/yargs/yargs-parser/commit/7909cc4)) -* maybeCoerceNumber() now takes into account arrays ([#187](https://github.com/yargs/yargs-parser/issues/187)) ([31c204b](https://github.com/yargs/yargs-parser/commit/31c204b)) - - -### BREAKING CHANGES - -* unless "parse-numbers" is set to "false", arrays of numeric strings are now parsed as numbers, rather than strings. -* we have dropped the broken "defaulted" functionality; we would like to revisit adding this in the future. -* maybeCoerceNumber now takes precedence over coerce return value (#182) - - - -### [13.1.1](https://www.github.com/yargs/yargs-parser/compare/v13.1.0...v13.1.1) (2019-06-10) - - -### Bug Fixes - -* convert values to strings when tokenizing ([#167](https://www.github.com/yargs/yargs-parser/issues/167)) ([57b7883](https://www.github.com/yargs/yargs-parser/commit/57b7883)) -* nargs should allow duplicates when duplicate-arguments-array=false ([#164](https://www.github.com/yargs/yargs-parser/issues/164)) ([47ccb0b](https://www.github.com/yargs/yargs-parser/commit/47ccb0b)) -* should populate "_" when given config with "short-option-groups" false ([#179](https://www.github.com/yargs/yargs-parser/issues/179)) ([6055974](https://www.github.com/yargs/yargs-parser/commit/6055974)) - -## [13.1.0](https://github.com/yargs/yargs-parser/compare/v13.0.0...v13.1.0) (2019-05-05) - - -### Features - -* add `strip-aliased` and `strip-dashed` configuration options. ([#172](https://github.com/yargs/yargs-parser/issues/172)) ([a3936aa](https://github.com/yargs/yargs-parser/commit/a3936aa)) -* support boolean which do not consume next argument. ([#171](https://github.com/yargs/yargs-parser/issues/171)) ([0ae7fcb](https://github.com/yargs/yargs-parser/commit/0ae7fcb)) - - - - -# [13.0.0](https://github.com/yargs/yargs-parser/compare/v12.0.0...v13.0.0) (2019-02-02) - - -### Features - -* don't coerce number from string with leading '0' or '+' ([#158](https://github.com/yargs/yargs-parser/issues/158)) ([18d0fd5](https://github.com/yargs/yargs-parser/commit/18d0fd5)) - - -### BREAKING CHANGES - -* options with leading '+' or '0' now parse as strings - - - - -# [12.0.0](https://github.com/yargs/yargs-parser/compare/v11.1.1...v12.0.0) (2019-01-29) - - -### Bug Fixes - -* better handling of quoted strings ([#153](https://github.com/yargs/yargs-parser/issues/153)) ([2fb71b2](https://github.com/yargs/yargs-parser/commit/2fb71b2)) - - -### Features - -* default value is now used if no right-hand value provided for numbers/strings ([#156](https://github.com/yargs/yargs-parser/issues/156)) ([5a7c46a](https://github.com/yargs/yargs-parser/commit/5a7c46a)) - - -### BREAKING CHANGES - -* a flag with no right-hand value no longer populates defaulted options with `undefined`. -* quotes at beginning and endings of strings are not removed during parsing. - - - - -## [11.1.1](https://github.com/yargs/yargs-parser/compare/v11.1.0...v11.1.1) (2018-11-19) - - -### Bug Fixes - -* ensure empty string is added into argv._ ([#140](https://github.com/yargs/yargs-parser/issues/140)) ([79cda98](https://github.com/yargs/yargs-parser/commit/79cda98)) - - -### Reverts - -* make requiresArg work in conjunction with arrays ([#136](https://github.com/yargs/yargs-parser/issues/136)) ([f4a3063](https://github.com/yargs/yargs-parser/commit/f4a3063)) - - - - -# [11.1.0](https://github.com/yargs/yargs-parser/compare/v11.0.0...v11.1.0) (2018-11-10) - - -### Bug Fixes - -* handling of one char alias ([#139](https://github.com/yargs/yargs-parser/issues/139)) ([ee56e31](https://github.com/yargs/yargs-parser/commit/ee56e31)) - - -### Features - -* add halt-at-non-option configuration option ([#130](https://github.com/yargs/yargs-parser/issues/130)) ([a849fce](https://github.com/yargs/yargs-parser/commit/a849fce)) - - - - -# [11.0.0](https://github.com/yargs/yargs-parser/compare/v10.1.0...v11.0.0) (2018-10-06) - - -### Bug Fixes - -* flatten-duplicate-arrays:false for more than 2 arrays ([#128](https://github.com/yargs/yargs-parser/issues/128)) ([2bc395f](https://github.com/yargs/yargs-parser/commit/2bc395f)) -* hyphenated flags combined with dot notation broke parsing ([#131](https://github.com/yargs/yargs-parser/issues/131)) ([dc788da](https://github.com/yargs/yargs-parser/commit/dc788da)) -* make requiresArg work in conjunction with arrays ([#136](https://github.com/yargs/yargs-parser/issues/136)) ([77ae1d4](https://github.com/yargs/yargs-parser/commit/77ae1d4)) - - -### Chores - -* update dependencies ([6dc42a1](https://github.com/yargs/yargs-parser/commit/6dc42a1)) - - -### Features - -* also add camelCase array options ([#125](https://github.com/yargs/yargs-parser/issues/125)) ([08c0117](https://github.com/yargs/yargs-parser/commit/08c0117)) -* array.type can now be provided, supporting coercion ([#132](https://github.com/yargs/yargs-parser/issues/132)) ([4b8cfce](https://github.com/yargs/yargs-parser/commit/4b8cfce)) - - -### BREAKING CHANGES - -* drops Node 4 support -* the argv object is now populated differently (correctly) when hyphens and dot notation are used in conjunction. - - - - -# [10.1.0](https://github.com/yargs/yargs-parser/compare/v10.0.0...v10.1.0) (2018-06-29) - - -### Features - -* add `set-placeholder-key` configuration ([#123](https://github.com/yargs/yargs-parser/issues/123)) ([19386ee](https://github.com/yargs/yargs-parser/commit/19386ee)) - - - - -# [10.0.0](https://github.com/yargs/yargs-parser/compare/v9.0.2...v10.0.0) (2018-04-04) - - -### Bug Fixes - -* do not set boolean flags if not defined in `argv` ([#119](https://github.com/yargs/yargs-parser/issues/119)) ([f6e6599](https://github.com/yargs/yargs-parser/commit/f6e6599)) - - -### BREAKING CHANGES - -* `boolean` flags defined without a `default` value will now behave like other option type and won't be set in the parsed results when the user doesn't set the corresponding CLI arg. - -Previous behavior: -```js -var parse = require('yargs-parser'); - -parse('--flag', {boolean: ['flag']}); -// => { _: [], flag: true } - -parse('--no-flag', {boolean: ['flag']}); -// => { _: [], flag: false } - -parse('', {boolean: ['flag']}); -// => { _: [], flag: false } -``` - -New behavior: -```js -var parse = require('yargs-parser'); - -parse('--flag', {boolean: ['flag']}); -// => { _: [], flag: true } - -parse('--no-flag', {boolean: ['flag']}); -// => { _: [], flag: false } - -parse('', {boolean: ['flag']}); -// => { _: [] } => flag not set similarly to other option type -``` - - - - -## [9.0.2](https://github.com/yargs/yargs-parser/compare/v9.0.1...v9.0.2) (2018-01-20) - - -### Bug Fixes - -* nargs was still aggressively consuming too many arguments ([9b28aad](https://github.com/yargs/yargs-parser/commit/9b28aad)) - - - - -## [9.0.1](https://github.com/yargs/yargs-parser/compare/v9.0.0...v9.0.1) (2018-01-20) - - -### Bug Fixes - -* nargs was consuming too many arguments ([4fef206](https://github.com/yargs/yargs-parser/commit/4fef206)) - - - - -# [9.0.0](https://github.com/yargs/yargs-parser/compare/v8.1.0...v9.0.0) (2018-01-20) - - -### Features - -* narg arguments no longer consume flag arguments ([#114](https://github.com/yargs/yargs-parser/issues/114)) ([60bb9b3](https://github.com/yargs/yargs-parser/commit/60bb9b3)) - - -### BREAKING CHANGES - -* arguments of form --foo, -abc, will no longer be consumed by nargs - - - - -# [8.1.0](https://github.com/yargs/yargs-parser/compare/v8.0.0...v8.1.0) (2017-12-20) - - -### Bug Fixes - -* allow null config values ([#108](https://github.com/yargs/yargs-parser/issues/108)) ([d8b14f9](https://github.com/yargs/yargs-parser/commit/d8b14f9)) -* ensure consistent parsing of dot-notation arguments ([#102](https://github.com/yargs/yargs-parser/issues/102)) ([c9bd79c](https://github.com/yargs/yargs-parser/commit/c9bd79c)) -* implement [@antoniom](https://github.com/antoniom)'s fix for camel-case expansion ([3087e1d](https://github.com/yargs/yargs-parser/commit/3087e1d)) -* only run coercion functions once, despite aliases. ([#76](https://github.com/yargs/yargs-parser/issues/76)) ([#103](https://github.com/yargs/yargs-parser/issues/103)) ([507aaef](https://github.com/yargs/yargs-parser/commit/507aaef)) -* scientific notation circumvented bounds check ([#110](https://github.com/yargs/yargs-parser/issues/110)) ([3571f57](https://github.com/yargs/yargs-parser/commit/3571f57)) -* tokenizer should ignore spaces at the beginning of the argString ([#106](https://github.com/yargs/yargs-parser/issues/106)) ([f34ead9](https://github.com/yargs/yargs-parser/commit/f34ead9)) - - -### Features - -* make combining arrays a configurable option ([#111](https://github.com/yargs/yargs-parser/issues/111)) ([c8bf536](https://github.com/yargs/yargs-parser/commit/c8bf536)) -* merge array from arguments with array from config ([#83](https://github.com/yargs/yargs-parser/issues/83)) ([806ddd6](https://github.com/yargs/yargs-parser/commit/806ddd6)) - - - - -# [8.0.0](https://github.com/yargs/yargs-parser/compare/v7.0.0...v8.0.0) (2017-10-05) - - -### Bug Fixes - -* Ignore multiple spaces between arguments. ([#100](https://github.com/yargs/yargs-parser/issues/100)) ([d137227](https://github.com/yargs/yargs-parser/commit/d137227)) - - -### Features - -* allow configuration of prefix for boolean negation ([#94](https://github.com/yargs/yargs-parser/issues/94)) ([00bde7d](https://github.com/yargs/yargs-parser/commit/00bde7d)) -* reworking how numbers are parsed ([#104](https://github.com/yargs/yargs-parser/issues/104)) ([fba00eb](https://github.com/yargs/yargs-parser/commit/fba00eb)) - - -### BREAKING CHANGES - -* strings that fail `Number.isSafeInteger()` are no longer coerced into numbers. - - - - -# [7.0.0](https://github.com/yargs/yargs-parser/compare/v6.0.1...v7.0.0) (2017-05-02) - - -### Chores - -* revert populate-- logic ([#91](https://github.com/yargs/yargs-parser/issues/91)) ([6003e6d](https://github.com/yargs/yargs-parser/commit/6003e6d)) - - -### BREAKING CHANGES - -* populate-- now defaults to false. - - - - -## [6.0.1](https://github.com/yargs/yargs-parser/compare/v6.0.0...v6.0.1) (2017-05-01) - - -### Bug Fixes - -* default '--' to undefined when not provided; this is closer to the array API ([#90](https://github.com/yargs/yargs-parser/issues/90)) ([4e739cc](https://github.com/yargs/yargs-parser/commit/4e739cc)) - - - - -# [6.0.0](https://github.com/yargs/yargs-parser/compare/v4.2.1...v6.0.0) (2017-05-01) - - -### Bug Fixes - -* environment variables should take precedence over config file ([#81](https://github.com/yargs/yargs-parser/issues/81)) ([76cee1f](https://github.com/yargs/yargs-parser/commit/76cee1f)) -* parsing hints should apply for dot notation keys ([#86](https://github.com/yargs/yargs-parser/issues/86)) ([3e47d62](https://github.com/yargs/yargs-parser/commit/3e47d62)) - - -### Chores - -* upgrade to newest version of camelcase ([#87](https://github.com/yargs/yargs-parser/issues/87)) ([f1903aa](https://github.com/yargs/yargs-parser/commit/f1903aa)) - - -### Features - -* add -- option which allows arguments after the -- flag to be returned separated from positional arguments ([#84](https://github.com/yargs/yargs-parser/issues/84)) ([2572ca8](https://github.com/yargs/yargs-parser/commit/2572ca8)) -* when parsing stops, we now populate "--" by default ([#88](https://github.com/yargs/yargs-parser/issues/88)) ([cd666db](https://github.com/yargs/yargs-parser/commit/cd666db)) - - -### BREAKING CHANGES - -* rather than placing arguments in "_", when parsing is stopped via "--"; we now populate an array called "--" by default. -* camelcase now requires Node 4+. -* environment variables will now override config files (args, env, config-file, config-object) - - - - -# [5.0.0](https://github.com/yargs/yargs-parser/compare/v4.2.1...v5.0.0) (2017-02-18) - - -### Bug Fixes - -* environment variables should take precedence over config file ([#81](https://github.com/yargs/yargs-parser/issues/81)) ([76cee1f](https://github.com/yargs/yargs-parser/commit/76cee1f)) - - -### BREAKING CHANGES - -* environment variables will now override config files (args, env, config-file, config-object) - - - - -## [4.2.1](https://github.com/yargs/yargs-parser/compare/v4.2.0...v4.2.1) (2017-01-02) - - -### Bug Fixes - -* flatten/duplicate regression ([#75](https://github.com/yargs/yargs-parser/issues/75)) ([68d68a0](https://github.com/yargs/yargs-parser/commit/68d68a0)) - - - - -# [4.2.0](https://github.com/yargs/yargs-parser/compare/v4.1.0...v4.2.0) (2016-12-01) - - -### Bug Fixes - -* inner objects in configs had their keys appended to top-level key when dot-notation was disabled ([#72](https://github.com/yargs/yargs-parser/issues/72)) ([0b1b5f9](https://github.com/yargs/yargs-parser/commit/0b1b5f9)) - - -### Features - -* allow multiple arrays to be provided, rather than always combining ([#71](https://github.com/yargs/yargs-parser/issues/71)) ([0f0fb2d](https://github.com/yargs/yargs-parser/commit/0f0fb2d)) - - - - -# [4.1.0](https://github.com/yargs/yargs-parser/compare/v4.0.2...v4.1.0) (2016-11-07) - - -### Features - -* apply coercions to default options ([#65](https://github.com/yargs/yargs-parser/issues/65)) ([c79052b](https://github.com/yargs/yargs-parser/commit/c79052b)) -* handle dot notation boolean options ([#63](https://github.com/yargs/yargs-parser/issues/63)) ([02c3545](https://github.com/yargs/yargs-parser/commit/02c3545)) - - - - -## [4.0.2](https://github.com/yargs/yargs-parser/compare/v4.0.1...v4.0.2) (2016-09-30) - - -### Bug Fixes - -* whoops, let's make the assign not change the Object key order ([29d069a](https://github.com/yargs/yargs-parser/commit/29d069a)) - - - - -## [4.0.1](https://github.com/yargs/yargs-parser/compare/v4.0.0...v4.0.1) (2016-09-30) - - -### Bug Fixes - -* lodash.assign was deprecated ([#59](https://github.com/yargs/yargs-parser/issues/59)) ([5e7eb11](https://github.com/yargs/yargs-parser/commit/5e7eb11)) - - - - -# [4.0.0](https://github.com/yargs/yargs-parser/compare/v3.2.0...v4.0.0) (2016-09-26) - - -### Bug Fixes - -* coerce should be applied to the final objects and arrays created ([#57](https://github.com/yargs/yargs-parser/issues/57)) ([4ca69da](https://github.com/yargs/yargs-parser/commit/4ca69da)) - - -### BREAKING CHANGES - -* coerce is no longer applied to individual arguments in an implicit array. - - - - -# [3.2.0](https://github.com/yargs/yargs-parser/compare/v3.1.0...v3.2.0) (2016-08-13) - - -### Features - -* coerce full array instead of each element ([#51](https://github.com/yargs/yargs-parser/issues/51)) ([cc4dc56](https://github.com/yargs/yargs-parser/commit/cc4dc56)) - - - - -# [3.1.0](https://github.com/yargs/yargs-parser/compare/v3.0.0...v3.1.0) (2016-08-09) - - -### Bug Fixes - -* address pkgConf parsing bug outlined in [#37](https://github.com/yargs/yargs-parser/issues/37) ([#45](https://github.com/yargs/yargs-parser/issues/45)) ([be76ee6](https://github.com/yargs/yargs-parser/commit/be76ee6)) -* better parsing of negative values ([#44](https://github.com/yargs/yargs-parser/issues/44)) ([2e43692](https://github.com/yargs/yargs-parser/commit/2e43692)) -* check aliases when guessing defaults for arguments fixes [#41](https://github.com/yargs/yargs-parser/issues/41) ([#43](https://github.com/yargs/yargs-parser/issues/43)) ([f3e4616](https://github.com/yargs/yargs-parser/commit/f3e4616)) - - -### Features - -* added coerce option, for providing specialized argument parsing ([#42](https://github.com/yargs/yargs-parser/issues/42)) ([7b49cd2](https://github.com/yargs/yargs-parser/commit/7b49cd2)) - - - - -# [3.0.0](https://github.com/yargs/yargs-parser/compare/v2.4.1...v3.0.0) (2016-08-07) - - -### Bug Fixes - -* parsing issue with numeric character in group of options ([#19](https://github.com/yargs/yargs-parser/issues/19)) ([f743236](https://github.com/yargs/yargs-parser/commit/f743236)) -* upgraded lodash.assign ([5d7fdf4](https://github.com/yargs/yargs-parser/commit/5d7fdf4)) - -### BREAKING CHANGES - -* subtle change to how values are parsed in a group of single-character arguments. -* _first released in 3.1.0, better handling of negative values should be considered a breaking change._ - - - - -## [2.4.1](https://github.com/yargs/yargs-parser/compare/v2.4.0...v2.4.1) (2016-07-16) - - -### Bug Fixes - -* **count:** do not increment a default value ([#39](https://github.com/yargs/yargs-parser/issues/39)) ([b04a189](https://github.com/yargs/yargs-parser/commit/b04a189)) - - - - -# [2.4.0](https://github.com/yargs/yargs-parser/compare/v2.3.0...v2.4.0) (2016-04-11) - - -### Features - -* **environment:** Support nested options in environment variables ([#26](https://github.com/yargs/yargs-parser/issues/26)) thanks [@elas7](https://github.com/elas7) \o/ ([020778b](https://github.com/yargs/yargs-parser/commit/020778b)) - - - - -# [2.3.0](https://github.com/yargs/yargs-parser/compare/v2.2.0...v2.3.0) (2016-04-09) - - -### Bug Fixes - -* **boolean:** fix for boolean options with non boolean defaults (#20) ([2dbe86b](https://github.com/yargs/yargs-parser/commit/2dbe86b)), closes [(#20](https://github.com/(/issues/20) -* **package:** remove tests from tarball ([0353c0d](https://github.com/yargs/yargs-parser/commit/0353c0d)) -* **parsing:** handle calling short option with an empty string as the next value. ([a867165](https://github.com/yargs/yargs-parser/commit/a867165)) -* boolean flag when next value contains the strings 'true' or 'false'. ([69941a6](https://github.com/yargs/yargs-parser/commit/69941a6)) -* update dependencies; add standard-version bin for next release (#24) ([822d9d5](https://github.com/yargs/yargs-parser/commit/822d9d5)) - -### Features - -* **configuration:** Allow to pass configuration objects to yargs-parser ([0780900](https://github.com/yargs/yargs-parser/commit/0780900)) -* **normalize:** allow normalize to work with arrays ([e0eaa1a](https://github.com/yargs/yargs-parser/commit/e0eaa1a)) diff --git a/deps/npm/node_modules/yargs-parser/LICENSE.txt b/deps/npm/node_modules/yargs-parser/LICENSE.txt deleted file mode 100644 index 836440bef7cf14..00000000000000 --- a/deps/npm/node_modules/yargs-parser/LICENSE.txt +++ /dev/null @@ -1,14 +0,0 @@ -Copyright (c) 2016, Contributors - -Permission to use, copy, modify, and/or distribute this software -for any purpose with or without fee is hereby granted, provided -that the above copyright notice and this permission notice -appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES -OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE -LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES -OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/deps/npm/node_modules/yargs-parser/README.md b/deps/npm/node_modules/yargs-parser/README.md deleted file mode 100644 index 5f1ccb987db443..00000000000000 --- a/deps/npm/node_modules/yargs-parser/README.md +++ /dev/null @@ -1,418 +0,0 @@ -# yargs-parser - -[![Build Status](https://travis-ci.org/yargs/yargs-parser.svg)](https://travis-ci.org/yargs/yargs-parser) -[![Coverage Status](https://coveralls.io/repos/yargs/yargs-parser/badge.svg?branch=)](https://coveralls.io/r/yargs/yargs-parser?branch=master) -[![NPM version](https://img.shields.io/npm/v/yargs-parser.svg)](https://www.npmjs.com/package/yargs-parser) -[![Standard Version](https://img.shields.io/badge/release-standard%20version-brightgreen.svg)](https://github.com/conventional-changelog/standard-version) - - -The mighty option parser used by [yargs](https://github.com/yargs/yargs). - -visit the [yargs website](http://yargs.js.org/) for more examples, and thorough usage instructions. - - - -## Example - -```sh -npm i yargs-parser --save -``` - -```js -var argv = require('yargs-parser')(process.argv.slice(2)) -console.log(argv) -``` - -```sh -node example.js --foo=33 --bar hello -{ _: [], foo: 33, bar: 'hello' } -``` - -_or parse a string!_ - -```js -var argv = require('yargs-parser')('--foo=99 --bar=33') -console.log(argv) -``` - -```sh -{ _: [], foo: 99, bar: 33 } -``` - -Convert an array of mixed types before passing to `yargs-parser`: - -```js -var parse = require('yargs-parser') -parse(['-f', 11, '--zoom', 55].join(' ')) // <-- array to string -parse(['-f', 11, '--zoom', 55].map(String)) // <-- array of strings -``` - -## API - -### require('yargs-parser')(args, opts={}) - -Parses command line arguments returning a simple mapping of keys and values. - -**expects:** - -* `args`: a string or array of strings representing the options to parse. -* `opts`: provide a set of hints indicating how `args` should be parsed: - * `opts.alias`: an object representing the set of aliases for a key: `{alias: {foo: ['f']}}`. - * `opts.array`: indicate that keys should be parsed as an array: `{array: ['foo', 'bar']}`.
    - Indicate that keys should be parsed as an array and coerced to booleans / numbers:
    - `{array: [{ key: 'foo', boolean: true }, {key: 'bar', number: true}]}`. - * `opts.boolean`: arguments should be parsed as booleans: `{boolean: ['x', 'y']}`. - * `opts.coerce`: provide a custom synchronous function that returns a coerced value from the argument provided - (or throws an error). For arrays the function is called only once for the entire array:
    - `{coerce: {foo: function (arg) {return modifiedArg}}}`. - * `opts.config`: indicate a key that represents a path to a configuration file (this file will be loaded and parsed). - * `opts.configObjects`: configuration objects to parse, their properties will be set as arguments:
    - `{configObjects: [{'x': 5, 'y': 33}, {'z': 44}]}`. - * `opts.configuration`: provide configuration options to the yargs-parser (see: [configuration](#configuration)). - * `opts.count`: indicate a key that should be used as a counter, e.g., `-vvv` = `{v: 3}`. - * `opts.default`: provide default values for keys: `{default: {x: 33, y: 'hello world!'}}`. - * `opts.envPrefix`: environment variables (`process.env`) with the prefix provided should be parsed. - * `opts.narg`: specify that a key requires `n` arguments: `{narg: {x: 2}}`. - * `opts.normalize`: `path.normalize()` will be applied to values set to this key. - * `opts.number`: keys should be treated as numbers. - * `opts.string`: keys should be treated as strings (even if they resemble a number `-x 33`). - -**returns:** - -* `obj`: an object representing the parsed value of `args` - * `key/value`: key value pairs for each argument and their aliases. - * `_`: an array representing the positional arguments. - * [optional] `--`: an array with arguments after the end-of-options flag `--`. - -### require('yargs-parser').detailed(args, opts={}) - -Parses a command line string, returning detailed information required by the -yargs engine. - -**expects:** - -* `args`: a string or array of strings representing options to parse. -* `opts`: provide a set of hints indicating how `args`, inputs are identical to `require('yargs-parser')(args, opts={})`. - -**returns:** - -* `argv`: an object representing the parsed value of `args` - * `key/value`: key value pairs for each argument and their aliases. - * `_`: an array representing the positional arguments. -* `error`: populated with an error object if an exception occurred during parsing. -* `aliases`: the inferred list of aliases built by combining lists in `opts.alias`. -* `newAliases`: any new aliases added via camel-case expansion. -* `configuration`: the configuration loaded from the `yargs` stanza in package.json. - - - -### Configuration - -The yargs-parser applies several automated transformations on the keys provided -in `args`. These features can be turned on and off using the `configuration` field -of `opts`. - -```js -var parsed = parser(['--no-dice'], { - configuration: { - 'boolean-negation': false - } -}) -``` - -### short option groups - -* default: `true`. -* key: `short-option-groups`. - -Should a group of short-options be treated as boolean flags? - -```sh -node example.js -abc -{ _: [], a: true, b: true, c: true } -``` - -_if disabled:_ - -```sh -node example.js -abc -{ _: [], abc: true } -``` - -### camel-case expansion - -* default: `true`. -* key: `camel-case-expansion`. - -Should hyphenated arguments be expanded into camel-case aliases? - -```sh -node example.js --foo-bar -{ _: [], 'foo-bar': true, fooBar: true } -``` - -_if disabled:_ - -```sh -node example.js --foo-bar -{ _: [], 'foo-bar': true } -``` - -### dot-notation - -* default: `true` -* key: `dot-notation` - -Should keys that contain `.` be treated as objects? - -```sh -node example.js --foo.bar -{ _: [], foo: { bar: true } } -``` - -_if disabled:_ - -```sh -node example.js --foo.bar -{ _: [], "foo.bar": true } -``` - -### parse numbers - -* default: `true` -* key: `parse-numbers` - -Should keys that look like numbers be treated as such? - -```sh -node example.js --foo=99.3 -{ _: [], foo: 99.3 } -``` - -_if disabled:_ - -```sh -node example.js --foo=99.3 -{ _: [], foo: "99.3" } -``` - -### boolean negation - -* default: `true` -* key: `boolean-negation` - -Should variables prefixed with `--no` be treated as negations? - -```sh -node example.js --no-foo -{ _: [], foo: false } -``` - -_if disabled:_ - -```sh -node example.js --no-foo -{ _: [], "no-foo": true } -``` - -### combine arrays - -* default: `false` -* key: `combine-arrays` - -Should arrays be combined when provided by both command line arguments and -a configuration file. - -### duplicate arguments array - -* default: `true` -* key: `duplicate-arguments-array` - -Should arguments be coerced into an array when duplicated: - -```sh -node example.js -x 1 -x 2 -{ _: [], x: [1, 2] } -``` - -_if disabled:_ - -```sh -node example.js -x 1 -x 2 -{ _: [], x: 2 } -``` - -### flatten duplicate arrays - -* default: `true` -* key: `flatten-duplicate-arrays` - -Should array arguments be coerced into a single array when duplicated: - -```sh -node example.js -x 1 2 -x 3 4 -{ _: [], x: [1, 2, 3, 4] } -``` - -_if disabled:_ - -```sh -node example.js -x 1 2 -x 3 4 -{ _: [], x: [[1, 2], [3, 4]] } -``` - -### negation prefix - -* default: `no-` -* key: `negation-prefix` - -The prefix to use for negated boolean variables. - -```sh -node example.js --no-foo -{ _: [], foo: false } -``` - -_if set to `quux`:_ - -```sh -node example.js --quuxfoo -{ _: [], foo: false } -``` - -### populate -- - -* default: `false`. -* key: `populate--` - -Should unparsed flags be stored in `--` or `_`. - -_If disabled:_ - -```sh -node example.js a -b -- x y -{ _: [ 'a', 'x', 'y' ], b: true } -``` - -_If enabled:_ - -```sh -node example.js a -b -- x y -{ _: [ 'a' ], '--': [ 'x', 'y' ], b: true } -``` - -### set placeholder key - -* default: `false`. -* key: `set-placeholder-key`. - -Should a placeholder be added for keys not set via the corresponding CLI argument? - -_If disabled:_ - -```sh -node example.js -a 1 -c 2 -{ _: [], a: 1, c: 2 } -``` - -_If enabled:_ - -```sh -node example.js -a 1 -c 2 -{ _: [], a: 1, b: undefined, c: 2 } -``` - -### halt at non-option - -* default: `false`. -* key: `halt-at-non-option`. - -Should parsing stop at the first positional argument? This is similar to how e.g. `ssh` parses its command line. - -_If disabled:_ - -```sh -node example.js -a run b -x y -{ _: [ 'b' ], a: 'run', x: 'y' } -``` - -_If enabled:_ - -```sh -node example.js -a run b -x y -{ _: [ 'b', '-x', 'y' ], a: 'run' } -``` - -### strip aliased - -* default: `false` -* key: `strip-aliased` - -Should aliases be removed before returning results? - -_If disabled:_ - -```sh -node example.js --test-field 1 -{ _: [], 'test-field': 1, testField: 1, 'test-alias': 1, testAlias: 1 } -``` - -_If enabled:_ - -```sh -node example.js --test-field 1 -{ _: [], 'test-field': 1, testField: 1 } -``` - -### strip dashed - -* default: `false` -* key: `strip-dashed` - -Should dashed keys be removed before returning results? This option has no effect if -`camel-case-expansion` is disabled. - -_If disabled:_ - -```sh -node example.js --test-field 1 -{ _: [], 'test-field': 1, testField: 1 } -``` - -_If enabled:_ - -```sh -node example.js --test-field 1 -{ _: [], testField: 1 } -``` - -### unknown options as args - -* default: `false` -* key: `unknown-options-as-args` - -Should unknown options be treated like regular arguments? An unknown option is one that is not -configured in `opts`. - -_If disabled_ - -```sh -node example.js --unknown-option --known-option 2 --string-option --unknown-option2 -{ _: [], unknownOption: true, knownOption: 2, stringOption: '', unknownOption2: true } -``` - -_If enabled_ - -```sh -node example.js --unknown-option --known-option 2 --string-option --unknown-option2 -{ _: ['--unknown-option'], knownOption: 2, stringOption: '--unknown-option2' } -``` - -## Special Thanks - -The yargs project evolves from optimist and minimist. It owes its -existence to a lot of James Halliday's hard work. Thanks [substack](https://github.com/substack) **beep** **boop** \o/ - -## License - -ISC diff --git a/deps/npm/node_modules/yargs-parser/index.js b/deps/npm/node_modules/yargs-parser/index.js deleted file mode 100644 index 72685532119949..00000000000000 --- a/deps/npm/node_modules/yargs-parser/index.js +++ /dev/null @@ -1,968 +0,0 @@ -var camelCase = require('camelcase') -var decamelize = require('decamelize') -var path = require('path') -var tokenizeArgString = require('./lib/tokenize-arg-string') -var util = require('util') - -function parse (args, opts) { - if (!opts) opts = {} - // allow a string argument to be passed in rather - // than an argv array. - args = tokenizeArgString(args) - - // aliases might have transitive relationships, normalize this. - var aliases = combineAliases(opts.alias || {}) - var configuration = Object.assign({ - 'short-option-groups': true, - 'camel-case-expansion': true, - 'dot-notation': true, - 'parse-numbers': true, - 'boolean-negation': true, - 'negation-prefix': 'no-', - 'duplicate-arguments-array': true, - 'flatten-duplicate-arrays': true, - 'populate--': false, - 'combine-arrays': false, - 'set-placeholder-key': false, - 'halt-at-non-option': false, - 'strip-aliased': false, - 'strip-dashed': false, - 'unknown-options-as-args': false - }, opts.configuration) - var defaults = opts.default || {} - var configObjects = opts.configObjects || [] - var envPrefix = opts.envPrefix - var notFlagsOption = configuration['populate--'] - var notFlagsArgv = notFlagsOption ? '--' : '_' - var newAliases = {} - // allow a i18n handler to be passed in, default to a fake one (util.format). - var __ = opts.__ || util.format - var error = null - var flags = { - aliases: {}, - arrays: {}, - bools: {}, - strings: {}, - numbers: {}, - counts: {}, - normalize: {}, - configs: {}, - nargs: {}, - coercions: {}, - keys: [] - } - var negative = /^-[0-9]+(\.[0-9]+)?/ - var negatedBoolean = new RegExp('^--' + configuration['negation-prefix'] + '(.+)') - - ;[].concat(opts.array).filter(Boolean).forEach(function (opt) { - var key = opt.key || opt - - // assign to flags[bools|strings|numbers] - const assignment = Object.keys(opt).map(function (key) { - return ({ - boolean: 'bools', - string: 'strings', - number: 'numbers' - })[key] - }).filter(Boolean).pop() - - // assign key to be coerced - if (assignment) { - flags[assignment][key] = true - } - - flags.arrays[key] = true - flags.keys.push(key) - }) - - ;[].concat(opts.boolean).filter(Boolean).forEach(function (key) { - flags.bools[key] = true - flags.keys.push(key) - }) - - ;[].concat(opts.string).filter(Boolean).forEach(function (key) { - flags.strings[key] = true - flags.keys.push(key) - }) - - ;[].concat(opts.number).filter(Boolean).forEach(function (key) { - flags.numbers[key] = true - flags.keys.push(key) - }) - - ;[].concat(opts.count).filter(Boolean).forEach(function (key) { - flags.counts[key] = true - flags.keys.push(key) - }) - - ;[].concat(opts.normalize).filter(Boolean).forEach(function (key) { - flags.normalize[key] = true - flags.keys.push(key) - }) - - Object.keys(opts.narg || {}).forEach(function (k) { - flags.nargs[k] = opts.narg[k] - flags.keys.push(k) - }) - - Object.keys(opts.coerce || {}).forEach(function (k) { - flags.coercions[k] = opts.coerce[k] - flags.keys.push(k) - }) - - if (Array.isArray(opts.config) || typeof opts.config === 'string') { - ;[].concat(opts.config).filter(Boolean).forEach(function (key) { - flags.configs[key] = true - }) - } else { - Object.keys(opts.config || {}).forEach(function (k) { - flags.configs[k] = opts.config[k] - }) - } - - // create a lookup table that takes into account all - // combinations of aliases: {f: ['foo'], foo: ['f']} - extendAliases(opts.key, aliases, opts.default, flags.arrays) - - // apply default values to all aliases. - Object.keys(defaults).forEach(function (key) { - (flags.aliases[key] || []).forEach(function (alias) { - defaults[alias] = defaults[key] - }) - }) - - var argv = { _: [] } - var notFlags = [] - - for (var i = 0; i < args.length; i++) { - var arg = args[i] - var broken - var key - var letters - var m - var next - var value - - if (isUnknownOptionAsArg(arg)) { - argv._.push(arg) - // -- separated by = - } else if (arg.match(/^--.+=/) || ( - !configuration['short-option-groups'] && arg.match(/^-.+=/) - )) { - // Using [\s\S] instead of . because js doesn't support the - // 'dotall' regex modifier. See: - // http://stackoverflow.com/a/1068308/13216 - m = arg.match(/^--?([^=]+)=([\s\S]*)$/) - - // nargs format = '--f=monkey washing cat' - if (checkAllAliases(m[1], flags.nargs)) { - args.splice(i + 1, 0, m[2]) - i = eatNargs(i, m[1], args) - // arrays format = '--f=a b c' - } else if (checkAllAliases(m[1], flags.arrays)) { - args.splice(i + 1, 0, m[2]) - i = eatArray(i, m[1], args) - } else { - setArg(m[1], m[2]) - } - } else if (arg.match(negatedBoolean) && configuration['boolean-negation']) { - key = arg.match(negatedBoolean)[1] - setArg(key, checkAllAliases(key, flags.arrays) ? [false] : false) - - // -- separated by space. - } else if (arg.match(/^--.+/) || ( - !configuration['short-option-groups'] && arg.match(/^-[^-]+/) - )) { - key = arg.match(/^--?(.+)/)[1] - - // nargs format = '--foo a b c' - // should be truthy even if: flags.nargs[key] === 0 - if (checkAllAliases(key, flags.nargs) !== false) { - i = eatNargs(i, key, args) - // array format = '--foo a b c' - } else if (checkAllAliases(key, flags.arrays)) { - i = eatArray(i, key, args) - } else { - next = args[i + 1] - - if (next !== undefined && (!next.match(/^-/) || - next.match(negative)) && - !checkAllAliases(key, flags.bools) && - !checkAllAliases(key, flags.counts)) { - setArg(key, next) - i++ - } else if (/^(true|false)$/.test(next)) { - setArg(key, next) - i++ - } else { - setArg(key, defaultValue(key)) - } - } - - // dot-notation flag separated by '='. - } else if (arg.match(/^-.\..+=/)) { - m = arg.match(/^-([^=]+)=([\s\S]*)$/) - setArg(m[1], m[2]) - - // dot-notation flag separated by space. - } else if (arg.match(/^-.\..+/)) { - next = args[i + 1] - key = arg.match(/^-(.\..+)/)[1] - - if (next !== undefined && !next.match(/^-/) && - !checkAllAliases(key, flags.bools) && - !checkAllAliases(key, flags.counts)) { - setArg(key, next) - i++ - } else { - setArg(key, defaultValue(key)) - } - } else if (arg.match(/^-[^-]+/) && !arg.match(negative)) { - letters = arg.slice(1, -1).split('') - broken = false - - for (var j = 0; j < letters.length; j++) { - next = arg.slice(j + 2) - - if (letters[j + 1] && letters[j + 1] === '=') { - value = arg.slice(j + 3) - key = letters[j] - - // nargs format = '-f=monkey washing cat' - if (checkAllAliases(key, flags.nargs)) { - args.splice(i + 1, 0, value) - i = eatNargs(i, key, args) - // array format = '-f=a b c' - } else if (checkAllAliases(key, flags.arrays)) { - args.splice(i + 1, 0, value) - i = eatArray(i, key, args) - } else { - setArg(key, value) - } - - broken = true - break - } - - if (next === '-') { - setArg(letters[j], next) - continue - } - - // current letter is an alphabetic character and next value is a number - if (/[A-Za-z]/.test(letters[j]) && - /^-?\d+(\.\d*)?(e-?\d+)?$/.test(next)) { - setArg(letters[j], next) - broken = true - break - } - - if (letters[j + 1] && letters[j + 1].match(/\W/)) { - setArg(letters[j], next) - broken = true - break - } else { - setArg(letters[j], defaultValue(letters[j])) - } - } - - key = arg.slice(-1)[0] - - if (!broken && key !== '-') { - // nargs format = '-f a b c' - // should be truthy even if: flags.nargs[key] === 0 - if (checkAllAliases(key, flags.nargs) !== false) { - i = eatNargs(i, key, args) - // array format = '-f a b c' - } else if (checkAllAliases(key, flags.arrays)) { - i = eatArray(i, key, args) - } else { - next = args[i + 1] - - if (next !== undefined && (!/^(-|--)[^-]/.test(next) || - next.match(negative)) && - !checkAllAliases(key, flags.bools) && - !checkAllAliases(key, flags.counts)) { - setArg(key, next) - i++ - } else if (/^(true|false)$/.test(next)) { - setArg(key, next) - i++ - } else { - setArg(key, defaultValue(key)) - } - } - } - } else if (arg === '--') { - notFlags = args.slice(i + 1) - break - } else if (configuration['halt-at-non-option']) { - notFlags = args.slice(i) - break - } else { - argv._.push(maybeCoerceNumber('_', arg)) - } - } - - // order of precedence: - // 1. command line arg - // 2. value from env var - // 3. value from config file - // 4. value from config objects - // 5. configured default value - applyEnvVars(argv, true) // special case: check env vars that point to config file - applyEnvVars(argv, false) - setConfig(argv) - setConfigObjects() - applyDefaultsAndAliases(argv, flags.aliases, defaults) - applyCoercions(argv) - if (configuration['set-placeholder-key']) setPlaceholderKeys(argv) - - // for any counts either not in args or without an explicit default, set to 0 - Object.keys(flags.counts).forEach(function (key) { - if (!hasKey(argv, key.split('.'))) setArg(key, 0) - }) - - // '--' defaults to undefined. - if (notFlagsOption && notFlags.length) argv[notFlagsArgv] = [] - notFlags.forEach(function (key) { - argv[notFlagsArgv].push(key) - }) - - if (configuration['camel-case-expansion'] && configuration['strip-dashed']) { - Object.keys(argv).filter(key => key !== '--' && key.includes('-')).forEach(key => { - delete argv[key] - }) - } - - if (configuration['strip-aliased']) { - // XXX Switch to [].concat(...Object.values(aliases)) once node.js 6 is dropped - ;[].concat(...Object.keys(aliases).map(k => aliases[k])).forEach(alias => { - if (configuration['camel-case-expansion']) { - delete argv[alias.split('.').map(prop => camelCase(prop)).join('.')] - } - - delete argv[alias] - }) - } - - // how many arguments should we consume, based - // on the nargs option? - function eatNargs (i, key, args) { - var ii - const toEat = checkAllAliases(key, flags.nargs) - - if (toEat === 0) { - setArg(key, defaultValue(key)) - return i - } - - // nargs will not consume flag arguments, e.g., -abc, --foo, - // and terminates when one is observed. - var available = 0 - for (ii = i + 1; ii < args.length; ii++) { - if (!args[ii].match(/^-[^0-9]/) || isUnknownOptionAsArg(args[ii])) available++ - else break - } - - if (available < toEat) error = Error(__('Not enough arguments following: %s', key)) - - const consumed = Math.min(available, toEat) - for (ii = i + 1; ii < (consumed + i + 1); ii++) { - setArg(key, args[ii]) - } - - return (i + consumed) - } - - // if an option is an array, eat all non-hyphenated arguments - // following it... YUM! - // e.g., --foo apple banana cat becomes ["apple", "banana", "cat"] - function eatArray (i, key, args) { - let argsToSet = [] - let next = args[i + 1] - - if (checkAllAliases(key, flags.bools) && !(/^(true|false)$/.test(next))) { - argsToSet.push(true) - } else if (isUndefined(next) || (/^-/.test(next) && !negative.test(next) && !isUnknownOptionAsArg(next))) { - // for keys without value ==> argsToSet remains an empty [] - // set user default value, if available - if (defaults.hasOwnProperty(key)) { - argsToSet.push(defaults[key]) - } - } else { - for (var ii = i + 1; ii < args.length; ii++) { - next = args[ii] - if (/^-/.test(next) && !negative.test(next) && !isUnknownOptionAsArg(next)) break - i = ii - argsToSet.push(processValue(key, next)) - } - } - - setArg(key, argsToSet) - return i - } - - function setArg (key, val) { - if (/-/.test(key) && configuration['camel-case-expansion']) { - var alias = key.split('.').map(function (prop) { - return camelCase(prop) - }).join('.') - addNewAlias(key, alias) - } - - var value = processValue(key, val) - - var splitKey = key.split('.') - setKey(argv, splitKey, value) - - // handle populating aliases of the full key - if (flags.aliases[key] && flags.aliases[key].forEach) { - flags.aliases[key].forEach(function (x) { - x = x.split('.') - setKey(argv, x, value) - }) - } - - // handle populating aliases of the first element of the dot-notation key - if (splitKey.length > 1 && configuration['dot-notation']) { - ;(flags.aliases[splitKey[0]] || []).forEach(function (x) { - x = x.split('.') - - // expand alias with nested objects in key - var a = [].concat(splitKey) - a.shift() // nuke the old key. - x = x.concat(a) - - setKey(argv, x, value) - }) - } - - // Set normalize getter and setter when key is in 'normalize' but isn't an array - if (checkAllAliases(key, flags.normalize) && !checkAllAliases(key, flags.arrays)) { - var keys = [key].concat(flags.aliases[key] || []) - keys.forEach(function (key) { - argv.__defineSetter__(key, function (v) { - val = path.normalize(v) - }) - - argv.__defineGetter__(key, function () { - return typeof val === 'string' ? path.normalize(val) : val - }) - }) - } - } - - function addNewAlias (key, alias) { - if (!(flags.aliases[key] && flags.aliases[key].length)) { - flags.aliases[key] = [alias] - newAliases[alias] = true - } - if (!(flags.aliases[alias] && flags.aliases[alias].length)) { - addNewAlias(alias, key) - } - } - - function processValue (key, val) { - // strings may be quoted, clean this up as we assign values. - if (typeof val === 'string' && - (val[0] === "'" || val[0] === '"') && - val[val.length - 1] === val[0] - ) { - val = val.substring(1, val.length - 1) - } - - // handle parsing boolean arguments --foo=true --bar false. - if (checkAllAliases(key, flags.bools) || checkAllAliases(key, flags.counts)) { - if (typeof val === 'string') val = val === 'true' - } - - var value = Array.isArray(val) - ? val.map(function (v) { return maybeCoerceNumber(key, v) }) - : maybeCoerceNumber(key, val) - - // increment a count given as arg (either no value or value parsed as boolean) - if (checkAllAliases(key, flags.counts) && (isUndefined(value) || typeof value === 'boolean')) { - value = increment - } - - // Set normalized value when key is in 'normalize' and in 'arrays' - if (checkAllAliases(key, flags.normalize) && checkAllAliases(key, flags.arrays)) { - if (Array.isArray(val)) value = val.map(path.normalize) - else value = path.normalize(val) - } - return value - } - - function maybeCoerceNumber (key, value) { - if (!checkAllAliases(key, flags.strings) && !checkAllAliases(key, flags.bools) && !Array.isArray(value)) { - const shouldCoerceNumber = isNumber(value) && configuration['parse-numbers'] && ( - Number.isSafeInteger(Math.floor(value)) - ) - if (shouldCoerceNumber || (!isUndefined(value) && checkAllAliases(key, flags.numbers))) value = Number(value) - } - return value - } - - // set args from config.json file, this should be - // applied last so that defaults can be applied. - function setConfig (argv) { - var configLookup = {} - - // expand defaults/aliases, in-case any happen to reference - // the config.json file. - applyDefaultsAndAliases(configLookup, flags.aliases, defaults) - - Object.keys(flags.configs).forEach(function (configKey) { - var configPath = argv[configKey] || configLookup[configKey] - if (configPath) { - try { - var config = null - var resolvedConfigPath = path.resolve(process.cwd(), configPath) - - if (typeof flags.configs[configKey] === 'function') { - try { - config = flags.configs[configKey](resolvedConfigPath) - } catch (e) { - config = e - } - if (config instanceof Error) { - error = config - return - } - } else { - config = require(resolvedConfigPath) - } - - setConfigObject(config) - } catch (ex) { - if (argv[configKey]) error = Error(__('Invalid JSON config file: %s', configPath)) - } - } - }) - } - - // set args from config object. - // it recursively checks nested objects. - function setConfigObject (config, prev) { - Object.keys(config).forEach(function (key) { - var value = config[key] - var fullKey = prev ? prev + '.' + key : key - - // if the value is an inner object and we have dot-notation - // enabled, treat inner objects in config the same as - // heavily nested dot notations (foo.bar.apple). - if (typeof value === 'object' && value !== null && !Array.isArray(value) && configuration['dot-notation']) { - // if the value is an object but not an array, check nested object - setConfigObject(value, fullKey) - } else { - // setting arguments via CLI takes precedence over - // values within the config file. - if (!hasKey(argv, fullKey.split('.')) || (checkAllAliases(fullKey, flags.arrays) && configuration['combine-arrays'])) { - setArg(fullKey, value) - } - } - }) - } - - // set all config objects passed in opts - function setConfigObjects () { - if (typeof configObjects === 'undefined') return - configObjects.forEach(function (configObject) { - setConfigObject(configObject) - }) - } - - function applyEnvVars (argv, configOnly) { - if (typeof envPrefix === 'undefined') return - - var prefix = typeof envPrefix === 'string' ? envPrefix : '' - Object.keys(process.env).forEach(function (envVar) { - if (prefix === '' || envVar.lastIndexOf(prefix, 0) === 0) { - // get array of nested keys and convert them to camel case - var keys = envVar.split('__').map(function (key, i) { - if (i === 0) { - key = key.substring(prefix.length) - } - return camelCase(key) - }) - - if (((configOnly && flags.configs[keys.join('.')]) || !configOnly) && !hasKey(argv, keys)) { - setArg(keys.join('.'), process.env[envVar]) - } - } - }) - } - - function applyCoercions (argv) { - var coerce - var applied = {} - Object.keys(argv).forEach(function (key) { - if (!applied.hasOwnProperty(key)) { // If we haven't already coerced this option via one of its aliases - coerce = checkAllAliases(key, flags.coercions) - if (typeof coerce === 'function') { - try { - var value = maybeCoerceNumber(key, coerce(argv[key])) - ;([].concat(flags.aliases[key] || [], key)).forEach(ali => { - applied[ali] = argv[ali] = value - }) - } catch (err) { - error = err - } - } - } - }) - } - - function setPlaceholderKeys (argv) { - flags.keys.forEach((key) => { - // don't set placeholder keys for dot notation options 'foo.bar'. - if (~key.indexOf('.')) return - if (typeof argv[key] === 'undefined') argv[key] = undefined - }) - return argv - } - - function applyDefaultsAndAliases (obj, aliases, defaults) { - Object.keys(defaults).forEach(function (key) { - if (!hasKey(obj, key.split('.'))) { - setKey(obj, key.split('.'), defaults[key]) - - ;(aliases[key] || []).forEach(function (x) { - if (hasKey(obj, x.split('.'))) return - setKey(obj, x.split('.'), defaults[key]) - }) - } - }) - } - - function hasKey (obj, keys) { - var o = obj - - if (!configuration['dot-notation']) keys = [keys.join('.')] - - keys.slice(0, -1).forEach(function (key) { - o = (o[key] || {}) - }) - - var key = keys[keys.length - 1] - - if (typeof o !== 'object') return false - else return key in o - } - - function setKey (obj, keys, value) { - var o = obj - - if (!configuration['dot-notation']) keys = [keys.join('.')] - - keys.slice(0, -1).forEach(function (key, index) { - // TODO(bcoe): in the next major version of yargs, switch to - // Object.create(null) for dot notation: - key = sanitizeKey(key) - - if (typeof o === 'object' && o[key] === undefined) { - o[key] = {} - } - - if (typeof o[key] !== 'object' || Array.isArray(o[key])) { - // ensure that o[key] is an array, and that the last item is an empty object. - if (Array.isArray(o[key])) { - o[key].push({}) - } else { - o[key] = [o[key], {}] - } - - // we want to update the empty object at the end of the o[key] array, so set o to that object - o = o[key][o[key].length - 1] - } else { - o = o[key] - } - }) - - // TODO(bcoe): in the next major version of yargs, switch to - // Object.create(null) for dot notation: - const key = sanitizeKey(keys[keys.length - 1]) - - const isTypeArray = checkAllAliases(keys.join('.'), flags.arrays) - const isValueArray = Array.isArray(value) - let duplicate = configuration['duplicate-arguments-array'] - - // nargs has higher priority than duplicate - if (!duplicate && checkAllAliases(key, flags.nargs)) { - duplicate = true - if ((!isUndefined(o[key]) && flags.nargs[key] === 1) || (Array.isArray(o[key]) && o[key].length === flags.nargs[key])) { - o[key] = undefined - } - } - - if (value === increment) { - o[key] = increment(o[key]) - } else if (Array.isArray(o[key])) { - if (duplicate && isTypeArray && isValueArray) { - o[key] = configuration['flatten-duplicate-arrays'] ? o[key].concat(value) : (Array.isArray(o[key][0]) ? o[key] : [o[key]]).concat([value]) - } else if (!duplicate && Boolean(isTypeArray) === Boolean(isValueArray)) { - o[key] = value - } else { - o[key] = o[key].concat([value]) - } - } else if (o[key] === undefined && isTypeArray) { - o[key] = isValueArray ? value : [value] - } else if (duplicate && !(o[key] === undefined || checkAllAliases(key, flags.counts))) { - o[key] = [ o[key], value ] - } else { - o[key] = value - } - } - - // extend the aliases list with inferred aliases. - function extendAliases (...args) { - args.forEach(function (obj) { - Object.keys(obj || {}).forEach(function (key) { - // short-circuit if we've already added a key - // to the aliases array, for example it might - // exist in both 'opts.default' and 'opts.key'. - if (flags.aliases[key]) return - - flags.aliases[key] = [].concat(aliases[key] || []) - // For "--option-name", also set argv.optionName - flags.aliases[key].concat(key).forEach(function (x) { - if (/-/.test(x) && configuration['camel-case-expansion']) { - var c = camelCase(x) - if (c !== key && flags.aliases[key].indexOf(c) === -1) { - flags.aliases[key].push(c) - newAliases[c] = true - } - } - }) - // For "--optionName", also set argv['option-name'] - flags.aliases[key].concat(key).forEach(function (x) { - if (x.length > 1 && /[A-Z]/.test(x) && configuration['camel-case-expansion']) { - var c = decamelize(x, '-') - if (c !== key && flags.aliases[key].indexOf(c) === -1) { - flags.aliases[key].push(c) - newAliases[c] = true - } - } - }) - flags.aliases[key].forEach(function (x) { - flags.aliases[x] = [key].concat(flags.aliases[key].filter(function (y) { - return x !== y - })) - }) - }) - }) - } - - // check if a flag is set for any of a key's aliases. - function checkAllAliases (key, flag) { - var isSet = false - var toCheck = [].concat(flags.aliases[key] || [], key) - - toCheck.forEach(function (key) { - if (flag.hasOwnProperty(key)) isSet = flag[key] - }) - - return isSet - } - - function hasAnyFlag (key) { - // XXX Switch to [].concat(...Object.values(flags)) once node.js 6 is dropped - var toCheck = [].concat(...Object.keys(flags).map(k => flags[k])) - - return toCheck.some(function (flag) { - return flag[key] - }) - } - - function hasFlagsMatching (arg, ...patterns) { - var toCheck = [].concat(...patterns) - return toCheck.some(function (pattern) { - var match = arg.match(pattern) - return match && hasAnyFlag(match[1]) - }) - } - - // based on a simplified version of the short flag group parsing logic - function hasAllShortFlags (arg) { - // if this is a negative number, or doesn't start with a single hyphen, it's not a short flag group - if (arg.match(negative) || !arg.match(/^-[^-]+/)) { return false } - var hasAllFlags = true - var letters = arg.slice(1).split('') - var next - for (var j = 0; j < letters.length; j++) { - next = arg.slice(j + 2) - - if (!hasAnyFlag(letters[j])) { - hasAllFlags = false - break - } - - if ((letters[j + 1] && letters[j + 1] === '=') || - next === '-' || - (/[A-Za-z]/.test(letters[j]) && /^-?\d+(\.\d*)?(e-?\d+)?$/.test(next)) || - (letters[j + 1] && letters[j + 1].match(/\W/))) { - break - } - } - return hasAllFlags - } - - function isUnknownOptionAsArg (arg) { - return configuration['unknown-options-as-args'] && isUnknownOption(arg) - } - - function isUnknownOption (arg) { - // ignore negative numbers - if (arg.match(negative)) { return false } - // if this is a short option group and all of them are configured, it isn't unknown - if (hasAllShortFlags(arg)) { return false } - // e.g. '--count=2' - const flagWithEquals = /^-+([^=]+?)=[\s\S]*$/ - // e.g. '-a' or '--arg' - const normalFlag = /^-+([^=]+?)$/ - // e.g. '-a-' - const flagEndingInHyphen = /^-+([^=]+?)-$/ - // e.g. '-abc123' - const flagEndingInDigits = /^-+([^=]+?)\d+$/ - // e.g. '-a/usr/local' - const flagEndingInNonWordCharacters = /^-+([^=]+?)\W+.*$/ - // check the different types of flag styles, including negatedBoolean, a pattern defined near the start of the parse method - return !hasFlagsMatching(arg, flagWithEquals, negatedBoolean, normalFlag, flagEndingInHyphen, flagEndingInDigits, flagEndingInNonWordCharacters) - } - - // make a best effor to pick a default value - // for an option based on name and type. - function defaultValue (key) { - if (!checkAllAliases(key, flags.bools) && - !checkAllAliases(key, flags.counts) && - `${key}` in defaults) { - return defaults[key] - } else { - return defaultForType(guessType(key)) - } - } - - // return a default value, given the type of a flag., - // e.g., key of type 'string' will default to '', rather than 'true'. - function defaultForType (type) { - var def = { - boolean: true, - string: '', - number: undefined, - array: [] - } - - return def[type] - } - - // given a flag, enforce a default type. - function guessType (key) { - var type = 'boolean' - - if (checkAllAliases(key, flags.strings)) type = 'string' - else if (checkAllAliases(key, flags.numbers)) type = 'number' - else if (checkAllAliases(key, flags.bools)) type = 'boolean' - else if (checkAllAliases(key, flags.arrays)) type = 'array' - - return type - } - - function isNumber (x) { - if (x === null || x === undefined) return false - // if loaded from config, may already be a number. - if (typeof x === 'number') return true - // hexadecimal. - if (/^0x[0-9a-f]+$/i.test(x)) return true - // don't treat 0123 as a number; as it drops the leading '0'. - if (x.length > 1 && x[0] === '0') return false - return /^[-]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(x) - } - - function isUndefined (num) { - return num === undefined - } - - return { - argv: argv, - error: error, - aliases: flags.aliases, - newAliases: newAliases, - configuration: configuration - } -} - -// if any aliases reference each other, we should -// merge them together. -function combineAliases (aliases) { - var aliasArrays = [] - var change = true - var combined = {} - - // turn alias lookup hash {key: ['alias1', 'alias2']} into - // a simple array ['key', 'alias1', 'alias2'] - Object.keys(aliases).forEach(function (key) { - aliasArrays.push( - [].concat(aliases[key], key) - ) - }) - - // combine arrays until zero changes are - // made in an iteration. - while (change) { - change = false - for (var i = 0; i < aliasArrays.length; i++) { - for (var ii = i + 1; ii < aliasArrays.length; ii++) { - var intersect = aliasArrays[i].filter(function (v) { - return aliasArrays[ii].indexOf(v) !== -1 - }) - - if (intersect.length) { - aliasArrays[i] = aliasArrays[i].concat(aliasArrays[ii]) - aliasArrays.splice(ii, 1) - change = true - break - } - } - } - } - - // map arrays back to the hash-lookup (de-dupe while - // we're at it). - aliasArrays.forEach(function (aliasArray) { - aliasArray = aliasArray.filter(function (v, i, self) { - return self.indexOf(v) === i - }) - combined[aliasArray.pop()] = aliasArray - }) - - return combined -} - -// this function should only be called when a count is given as an arg -// it is NOT called to set a default value -// thus we can start the count at 1 instead of 0 -function increment (orig) { - return orig !== undefined ? orig + 1 : 1 -} - -function Parser (args, opts) { - var result = parse(args.slice(), opts) - - return result.argv -} - -// parse arguments and return detailed -// meta information, aliases, etc. -Parser.detailed = function (args, opts) { - return parse(args.slice(), opts) -} - -// TODO(bcoe): in the next major version of yargs, switch to -// Object.create(null) for dot notation: -function sanitizeKey (key) { - if (key === '__proto__') return '___proto___' - return key -} - -module.exports = Parser diff --git a/deps/npm/node_modules/yargs-parser/lib/tokenize-arg-string.js b/deps/npm/node_modules/yargs-parser/lib/tokenize-arg-string.js deleted file mode 100644 index fe05e27fdda7ca..00000000000000 --- a/deps/npm/node_modules/yargs-parser/lib/tokenize-arg-string.js +++ /dev/null @@ -1,40 +0,0 @@ -// take an un-split argv string and tokenize it. -module.exports = function (argString) { - if (Array.isArray(argString)) { - return argString.map(e => typeof e !== 'string' ? e + '' : e) - } - - argString = argString.trim() - - var i = 0 - var prevC = null - var c = null - var opening = null - var args = [] - - for (var ii = 0; ii < argString.length; ii++) { - prevC = c - c = argString.charAt(ii) - - // split on spaces unless we're in quotes. - if (c === ' ' && !opening) { - if (!(prevC === ' ')) { - i++ - } - continue - } - - // don't split the string if we're in matching - // opening or closing single and double quotes. - if (c === opening) { - opening = null - } else if ((c === "'" || c === '"') && !opening) { - opening = c - } - - if (!args[i]) args[i] = '' - args[i] += c - } - - return args -} diff --git a/deps/npm/node_modules/yargs-parser/node_modules/camelcase/index.d.ts b/deps/npm/node_modules/yargs-parser/node_modules/camelcase/index.d.ts deleted file mode 100644 index 58f2069adc52b8..00000000000000 --- a/deps/npm/node_modules/yargs-parser/node_modules/camelcase/index.d.ts +++ /dev/null @@ -1,63 +0,0 @@ -declare namespace camelcase { - interface Options { - /** - Uppercase the first character: `foo-bar` → `FooBar`. - - @default false - */ - readonly pascalCase?: boolean; - } -} - -declare const camelcase: { - /** - Convert a dash/dot/underscore/space separated string to camelCase or PascalCase: `foo-bar` → `fooBar`. - - @param input - String to convert to camel case. - - @example - ``` - import camelCase = require('camelcase'); - - camelCase('foo-bar'); - //=> 'fooBar' - - camelCase('foo_bar'); - //=> 'fooBar' - - camelCase('Foo-Bar'); - //=> 'fooBar' - - camelCase('Foo-Bar', {pascalCase: true}); - //=> 'FooBar' - - camelCase('--foo.bar', {pascalCase: false}); - //=> 'fooBar' - - camelCase('foo bar'); - //=> 'fooBar' - - console.log(process.argv[3]); - //=> '--foo-bar' - camelCase(process.argv[3]); - //=> 'fooBar' - - camelCase(['foo', 'bar']); - //=> 'fooBar' - - camelCase(['__foo__', '--bar'], {pascalCase: true}); - //=> 'FooBar' - ``` - */ - (input: string | ReadonlyArray, options?: camelcase.Options): string; - - // TODO: Remove this for the next major release, refactor the whole definition to: - // declare function camelcase( - // input: string | ReadonlyArray, - // options?: camelcase.Options - // ): string; - // export = camelcase; - default: typeof camelcase; -}; - -export = camelcase; diff --git a/deps/npm/node_modules/yargs-parser/node_modules/camelcase/index.js b/deps/npm/node_modules/yargs-parser/node_modules/camelcase/index.js deleted file mode 100644 index 579f99b47f772a..00000000000000 --- a/deps/npm/node_modules/yargs-parser/node_modules/camelcase/index.js +++ /dev/null @@ -1,76 +0,0 @@ -'use strict'; - -const preserveCamelCase = string => { - let isLastCharLower = false; - let isLastCharUpper = false; - let isLastLastCharUpper = false; - - for (let i = 0; i < string.length; i++) { - const character = string[i]; - - if (isLastCharLower && /[a-zA-Z]/.test(character) && character.toUpperCase() === character) { - string = string.slice(0, i) + '-' + string.slice(i); - isLastCharLower = false; - isLastLastCharUpper = isLastCharUpper; - isLastCharUpper = true; - i++; - } else if (isLastCharUpper && isLastLastCharUpper && /[a-zA-Z]/.test(character) && character.toLowerCase() === character) { - string = string.slice(0, i - 1) + '-' + string.slice(i - 1); - isLastLastCharUpper = isLastCharUpper; - isLastCharUpper = false; - isLastCharLower = true; - } else { - isLastCharLower = character.toLowerCase() === character && character.toUpperCase() !== character; - isLastLastCharUpper = isLastCharUpper; - isLastCharUpper = character.toUpperCase() === character && character.toLowerCase() !== character; - } - } - - return string; -}; - -const camelCase = (input, options) => { - if (!(typeof input === 'string' || Array.isArray(input))) { - throw new TypeError('Expected the input to be `string | string[]`'); - } - - options = Object.assign({ - pascalCase: false - }, options); - - const postProcess = x => options.pascalCase ? x.charAt(0).toUpperCase() + x.slice(1) : x; - - if (Array.isArray(input)) { - input = input.map(x => x.trim()) - .filter(x => x.length) - .join('-'); - } else { - input = input.trim(); - } - - if (input.length === 0) { - return ''; - } - - if (input.length === 1) { - return options.pascalCase ? input.toUpperCase() : input.toLowerCase(); - } - - const hasUpperCase = input !== input.toLowerCase(); - - if (hasUpperCase) { - input = preserveCamelCase(input); - } - - input = input - .replace(/^[_.\- ]+/, '') - .toLowerCase() - .replace(/[_.\- ]+(\w|$)/g, (_, p1) => p1.toUpperCase()) - .replace(/\d+(\w|$)/g, m => m.toUpperCase()); - - return postProcess(input); -}; - -module.exports = camelCase; -// TODO: Remove this for the next major release -module.exports.default = camelCase; diff --git a/deps/npm/node_modules/yargs-parser/node_modules/camelcase/license b/deps/npm/node_modules/yargs-parser/node_modules/camelcase/license deleted file mode 100644 index e7af2f77107d73..00000000000000 --- a/deps/npm/node_modules/yargs-parser/node_modules/camelcase/license +++ /dev/null @@ -1,9 +0,0 @@ -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/deps/npm/node_modules/yargs-parser/node_modules/camelcase/package.json b/deps/npm/node_modules/yargs-parser/node_modules/camelcase/package.json deleted file mode 100644 index 560c2e1d7356fe..00000000000000 --- a/deps/npm/node_modules/yargs-parser/node_modules/camelcase/package.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "_from": "camelcase@^5.0.0", - "_id": "camelcase@5.3.1", - "_inBundle": false, - "_integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", - "_location": "/yargs-parser/camelcase", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "camelcase@^5.0.0", - "name": "camelcase", - "escapedName": "camelcase", - "rawSpec": "^5.0.0", - "saveSpec": null, - "fetchSpec": "^5.0.0" - }, - "_requiredBy": [ - "/yargs-parser" - ], - "_resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", - "_shasum": "e3c9b31569e106811df242f715725a1f4c494320", - "_spec": "camelcase@^5.0.0", - "_where": "/Users/claudiahdz/npm/cli/node_modules/yargs-parser", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "bugs": { - "url": "https://github.com/sindresorhus/camelcase/issues" - }, - "bundleDependencies": false, - "deprecated": false, - "description": "Convert a dash/dot/underscore/space separated string to camelCase or PascalCase: `foo-bar` → `fooBar`", - "devDependencies": { - "ava": "^1.4.1", - "tsd": "^0.7.1", - "xo": "^0.24.0" - }, - "engines": { - "node": ">=6" - }, - "files": [ - "index.js", - "index.d.ts" - ], - "homepage": "https://github.com/sindresorhus/camelcase#readme", - "keywords": [ - "camelcase", - "camel-case", - "camel", - "case", - "dash", - "hyphen", - "dot", - "underscore", - "separator", - "string", - "text", - "convert", - "pascalcase", - "pascal-case" - ], - "license": "MIT", - "name": "camelcase", - "repository": { - "type": "git", - "url": "git+https://github.com/sindresorhus/camelcase.git" - }, - "scripts": { - "test": "xo && ava && tsd" - }, - "version": "5.3.1" -} diff --git a/deps/npm/node_modules/yargs-parser/node_modules/camelcase/readme.md b/deps/npm/node_modules/yargs-parser/node_modules/camelcase/readme.md deleted file mode 100644 index fde27261b2a823..00000000000000 --- a/deps/npm/node_modules/yargs-parser/node_modules/camelcase/readme.md +++ /dev/null @@ -1,99 +0,0 @@ -# camelcase [![Build Status](https://travis-ci.org/sindresorhus/camelcase.svg?branch=master)](https://travis-ci.org/sindresorhus/camelcase) - -> Convert a dash/dot/underscore/space separated string to camelCase or PascalCase: `foo-bar` → `fooBar` - ---- - -
    - - Get professional support for 'camelcase' 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 - -``` -$ npm install camelcase -``` - - -## Usage - -```js -const camelCase = require('camelcase'); - -camelCase('foo-bar'); -//=> 'fooBar' - -camelCase('foo_bar'); -//=> 'fooBar' - -camelCase('Foo-Bar'); -//=> 'fooBar' - -camelCase('Foo-Bar', {pascalCase: true}); -//=> 'FooBar' - -camelCase('--foo.bar', {pascalCase: false}); -//=> 'fooBar' - -camelCase('foo bar'); -//=> 'fooBar' - -console.log(process.argv[3]); -//=> '--foo-bar' -camelCase(process.argv[3]); -//=> 'fooBar' - -camelCase(['foo', 'bar']); -//=> 'fooBar' - -camelCase(['__foo__', '--bar'], {pascalCase: true}); -//=> 'FooBar' -``` - - -## API - -### camelCase(input, [options]) - -#### input - -Type: `string` `string[]` - -String to convert to camel case. - -#### options - -Type: `Object` - -##### pascalCase - -Type: `boolean`
    -Default: `false` - -Uppercase the first character: `foo-bar` → `FooBar` - - -## Security - -To report a security vulnerability, please use the [Tidelift security contact](https://tidelift.com/security). Tidelift will coordinate the fix and disclosure. - - -## Related - -- [decamelize](https://github.com/sindresorhus/decamelize) - The inverse of this module -- [uppercamelcase](https://github.com/SamVerschueren/uppercamelcase) - Like this module, but to PascalCase instead of camelCase -- [titleize](https://github.com/sindresorhus/titleize) - Capitalize every word in string -- [humanize-string](https://github.com/sindresorhus/humanize-string) - Convert a camelized/dasherized/underscored string into a humanized one - - -## License - -MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/deps/npm/node_modules/yargs-parser/package.json b/deps/npm/node_modules/yargs-parser/package.json deleted file mode 100644 index 467593e5d9f894..00000000000000 --- a/deps/npm/node_modules/yargs-parser/package.json +++ /dev/null @@ -1,79 +0,0 @@ -{ - "_from": "yargs-parser@^15.0.1", - "_id": "yargs-parser@15.0.1", - "_inBundle": false, - "_integrity": "sha512-0OAMV2mAZQrs3FkNpDQcBk1x5HXb8X4twADss4S0Iuk+2dGnLOE/fRHrsYm542GduMveyA77OF4wrNJuanRCWw==", - "_location": "/yargs-parser", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "yargs-parser@^15.0.1", - "name": "yargs-parser", - "escapedName": "yargs-parser", - "rawSpec": "^15.0.1", - "saveSpec": null, - "fetchSpec": "^15.0.1" - }, - "_requiredBy": [ - "/yargs" - ], - "_resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-15.0.1.tgz", - "_shasum": "54786af40b820dcb2fb8025b11b4d659d76323b3", - "_spec": "yargs-parser@^15.0.1", - "_where": "/Users/claudiahdz/npm/cli/node_modules/yargs", - "author": { - "name": "Ben Coe", - "email": "ben@npmjs.com" - }, - "bugs": { - "url": "https://github.com/yargs/yargs-parser/issues" - }, - "bundleDependencies": false, - "dependencies": { - "camelcase": "^5.0.0", - "decamelize": "^1.2.0" - }, - "deprecated": false, - "description": "the mighty option parser used by yargs", - "devDependencies": { - "chai": "^4.2.0", - "coveralls": "^3.0.2", - "mocha": "^5.2.0", - "nyc": "^14.1.0", - "standard": "^12.0.1", - "standard-version": "^6.0.0" - }, - "engine": { - "node": ">=6" - }, - "files": [ - "lib", - "index.js" - ], - "homepage": "https://github.com/yargs/yargs-parser#readme", - "keywords": [ - "argument", - "parser", - "yargs", - "command", - "cli", - "parsing", - "option", - "args", - "argument" - ], - "license": "ISC", - "main": "index.js", - "name": "yargs-parser", - "repository": { - "url": "git+ssh://git@github.com/yargs/yargs-parser.git" - }, - "scripts": { - "coverage": "nyc report --reporter=text-lcov | coveralls", - "posttest": "standard", - "release": "standard-version", - "test": "nyc mocha test/*.js" - }, - "version": "15.0.1" -} diff --git a/deps/npm/node_modules/yargs/CHANGELOG.md b/deps/npm/node_modules/yargs/CHANGELOG.md deleted file mode 100644 index 343ffc9ab0718d..00000000000000 --- a/deps/npm/node_modules/yargs/CHANGELOG.md +++ /dev/null @@ -1,1406 +0,0 @@ -# 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. - -### 14.2.2 - -### Bug Fixes - -* temporary fix for libraries that call Object.freeze() ([#1483](https://www.github.com/yargs/yargs/issues/1483)) ([99c2dc8](https://www.github.com/yargs/yargs/commit/99c2dc850e67c606644f8b0c0bca1a59c87dcbcd)) - -### [14.2.1](https://github.com/yargs/yargs/compare/v14.2.0...v14.2.1) (2019-10-30) - - -### Bug Fixes - -* stop-parse was not being respected by commands ([#1459](https://github.com/yargs/yargs/issues/1459)) ([e78e76e](https://github.com/yargs/yargs/commit/e78e76e3ac0551d4f30c71a05ddb21582960fcef)) - -## [14.2.0](https://github.com/yargs/yargs/compare/v14.1.0...v14.2.0) (2019-10-07) - - -### Bug Fixes - -* async middleware was called twice ([#1422](https://github.com/yargs/yargs/issues/1422)) ([9a42b63](https://github.com/yargs/yargs/commit/9a42b63)) -* fix promise check to accept any spec conform object ([#1424](https://github.com/yargs/yargs/issues/1424)) ([0be43d2](https://github.com/yargs/yargs/commit/0be43d2)) -* groups were not being maintained for nested commands ([#1430](https://github.com/yargs/yargs/issues/1430)) ([d38650e](https://github.com/yargs/yargs/commit/d38650e)) -* **docs:** broken markdown link ([#1426](https://github.com/yargs/yargs/issues/1426)) ([236e24e](https://github.com/yargs/yargs/commit/236e24e)) -* support merging deeply nested configuration ([#1423](https://github.com/yargs/yargs/issues/1423)) ([bae66fe](https://github.com/yargs/yargs/commit/bae66fe)) - - -### Features - -* **deps:** introduce yargs-parser with support for unknown-options-as-args ([#1440](https://github.com/yargs/yargs/issues/1440)) ([4d21520](https://github.com/yargs/yargs/commit/4d21520)) - -## [14.1.0](https://github.com/yargs/yargs/compare/v14.0.0...v14.1.0) (2019-09-06) - - -### Bug Fixes - -* **docs:** fix incorrect parserConfiguration documentation ([2a99124](https://github.com/yargs/yargs/commit/2a99124)) -* detect zsh when zsh isnt run as a login prompt ([#1395](https://github.com/yargs/yargs/issues/1395)) ([8792d13](https://github.com/yargs/yargs/commit/8792d13)) -* populate correct value on yargs.parsed and stop warning on access ([#1412](https://github.com/yargs/yargs/issues/1412)) ([bb0eb52](https://github.com/yargs/yargs/commit/bb0eb52)) -* showCompletionScript was logging script twice ([#1388](https://github.com/yargs/yargs/issues/1388)) ([07c8537](https://github.com/yargs/yargs/commit/07c8537)) -* strict() should not ignore hyphenated arguments ([#1414](https://github.com/yargs/yargs/issues/1414)) ([b774b5e](https://github.com/yargs/yargs/commit/b774b5e)) -* **docs:** formalize existing callback argument to showHelp ([#1386](https://github.com/yargs/yargs/issues/1386)) ([d217764](https://github.com/yargs/yargs/commit/d217764)) - - -### Features - -* make it possible to merge configurations when extending other config. ([#1411](https://github.com/yargs/yargs/issues/1411)) ([5d7ad98](https://github.com/yargs/yargs/commit/5d7ad98)) - -## [14.0.0](https://github.com/yargs/yargs/compare/v13.3.0...v14.0.0) (2019-07-30) - - -### ⚠ BREAKING CHANGES - -* we now only officially support yargs.$0 parameter and discourage direct access to yargs.parsed -* previously to this fix methods like `yargs.getOptions()` contained the state of the last command to execute. -* do not allow additional positionals in strict mode - -### Bug Fixes - -* calling parse multiple times now appropriately maintains state ([#1137](https://github.com/yargs/yargs/issues/1137)) ([#1369](https://github.com/yargs/yargs/issues/1369)) ([026b151](https://github.com/yargs/yargs/commit/026b151)) -* prefer user supplied script name in usage ([#1383](https://github.com/yargs/yargs/issues/1383)) ([28c74b9](https://github.com/yargs/yargs/commit/28c74b9)) -* **deps:** use decamelize from npm instead of vendored copy ([#1377](https://github.com/yargs/yargs/issues/1377)) ([015eeb9](https://github.com/yargs/yargs/commit/015eeb9)) -* **examples:** fix usage-options.js to reflect current API ([#1375](https://github.com/yargs/yargs/issues/1375)) ([6e5b76b](https://github.com/yargs/yargs/commit/6e5b76b)) -* do not allow additional positionals in strict mode ([35d777c](https://github.com/yargs/yargs/commit/35d777c)) -* properties accessed on singleton now reflect current state of instance ([#1366](https://github.com/yargs/yargs/issues/1366)) ([409d35b](https://github.com/yargs/yargs/commit/409d35b)) -* tolerate null prototype for config objects with `extends` ([#1376](https://github.com/yargs/yargs/issues/1376)) ([3d26d11](https://github.com/yargs/yargs/commit/3d26d11)), closes [#1372](https://github.com/yargs/yargs/issues/1372) -* yargs.parsed now populated before returning, when yargs.parse() called with no args (#1382) ([e3981fd](https://github.com/yargs/yargs/commit/e3981fd)), closes [#1382](https://github.com/yargs/yargs/issues/1382) - -### Features - -* adds support for multiple epilog messages ([#1384](https://github.com/yargs/yargs/issues/1384)) ([07a5554](https://github.com/yargs/yargs/commit/07a5554)) -* allow completionCommand to be set via showCompletionScript ([#1385](https://github.com/yargs/yargs/issues/1385)) ([5562853](https://github.com/yargs/yargs/commit/5562853)) - -## [13.3.0](https://www.github.com/yargs/yargs/compare/v13.2.4...v13.3.0) (2019-06-10) - - -### Bug Fixes - -* **deps:** yargs-parser update addressing several parsing bugs ([#1357](https://www.github.com/yargs/yargs/issues/1357)) ([e230d5b](https://www.github.com/yargs/yargs/commit/e230d5b)) - - -### Features - -* **i18n:** swap out os-locale dependency for simple inline implementation ([#1356](https://www.github.com/yargs/yargs/issues/1356)) ([4dfa19b](https://www.github.com/yargs/yargs/commit/4dfa19b)) -* support defaultDescription for positional arguments ([812048c](https://www.github.com/yargs/yargs/commit/812048c)) - -### [13.2.4](https://github.com/yargs/yargs/compare/v13.2.3...v13.2.4) (2019-05-13) - - -### Bug Fixes - -* **i18n:** rename unclear 'implication failed' to 'missing dependent arguments' ([#1317](https://github.com/yargs/yargs/issues/1317)) ([bf46813](https://github.com/yargs/yargs/commit/bf46813)) - - - -### [13.2.3](https://github.com/yargs/yargs/compare/v13.2.2...v13.2.3) (2019-05-05) - - -### Bug Fixes - -* **deps:** upgrade cliui for compatibility with latest chalk. ([#1330](https://github.com/yargs/yargs/issues/1330)) ([b20db65](https://github.com/yargs/yargs/commit/b20db65)) -* address issues with dutch translation ([#1316](https://github.com/yargs/yargs/issues/1316)) ([0295132](https://github.com/yargs/yargs/commit/0295132)) - - -### Tests - -* accept differently formatted output ([#1327](https://github.com/yargs/yargs/issues/1327)) ([c294d1b](https://github.com/yargs/yargs/commit/c294d1b)) - - - -## [13.2.2](https://github.com/yargs/yargs/compare/v13.2.1...v13.2.2) (2019-03-06) - - - -## [13.2.1](https://github.com/yargs/yargs/compare/v13.2.0...v13.2.1) (2019-02-18) - - -### Bug Fixes - -* add zsh script to files array ([3180224](https://github.com/yargs/yargs/commit/3180224)) -* support options/sub-commands in zsh completion ([0a96394](https://github.com/yargs/yargs/commit/0a96394)) - - -# [13.2.0](https://github.com/yargs/yargs/compare/v13.1.0...v13.2.0) (2019-02-15) - - -### Features - -* zsh auto completion ([#1292](https://github.com/yargs/yargs/issues/1292)) ([16c5d25](https://github.com/yargs/yargs/commit/16c5d25)), closes [#1156](https://github.com/yargs/yargs/issues/1156) - - - -# [13.1.0](https://github.com/yargs/yargs/compare/v13.0.0...v13.1.0) (2019-02-12) - - -### Features - -* add applyBeforeValidation, for applying sync middleware before validation ([5be206a](https://github.com/yargs/yargs/commit/5be206a)) - - - - -# [13.0.0](https://github.com/yargs/yargs/compare/v12.0.5...v13.0.0) (2019-02-02) - - -### Bug Fixes - -* **deps:** Update os-locale to avoid security vulnerability ([#1270](https://github.com/yargs/yargs/issues/1270)) ([27bf739](https://github.com/yargs/yargs/commit/27bf739)) -* **validation:** Use the error as a message when none exists otherwise ([#1268](https://github.com/yargs/yargs/issues/1268)) ([0510fe6](https://github.com/yargs/yargs/commit/0510fe6)) -* better bash path completion ([#1272](https://github.com/yargs/yargs/issues/1272)) ([da75ea2](https://github.com/yargs/yargs/commit/da75ea2)) -* middleware added multiple times due to reference bug ([#1282](https://github.com/yargs/yargs/issues/1282)) ([64af518](https://github.com/yargs/yargs/commit/64af518)) - - -### Chores - -* ~drop Node 6 from testing matrix ([#1287](https://github.com/yargs/yargs/issues/1287)) ([ef16792](https://github.com/yargs/yargs/commit/ef16792))~ - * _opting to not drop Node 6 support until April, [see](https://github.com/nodejs/Release)._ -* update dependencies ([#1284](https://github.com/yargs/yargs/issues/1284)) ([f25de4f](https://github.com/yargs/yargs/commit/f25de4f)) - - -### Features - -* Add `.parserConfiguration()` method, deprecating package.json config ([#1262](https://github.com/yargs/yargs/issues/1262)) ([3c6869a](https://github.com/yargs/yargs/commit/3c6869a)) -* adds config option for sorting command output ([#1256](https://github.com/yargs/yargs/issues/1256)) ([6916ce9](https://github.com/yargs/yargs/commit/6916ce9)) -* options/positionals with leading '+' and '0' no longer parse as numbers ([#1286](https://github.com/yargs/yargs/issues/1286)) ([e9dc3aa](https://github.com/yargs/yargs/commit/e9dc3aa)) -* support promises in middleware ([f3a4e4f](https://github.com/yargs/yargs/commit/f3a4e4f)) - - -### BREAKING CHANGES - -* options with leading '+' or '0' now parse as strings -* dropping Node 6 which hits end of life in April 2019 -* see [yargs-parser@12.0.0 CHANGELOG](https://github.com/yargs/yargs-parser/blob/master/CHANGELOG.md#breaking-changes) -* we now warn if the yargs stanza package.json is used. - - - - -## [12.0.5](https://github.com/yargs/yargs/compare/v12.0.4...v12.0.5) (2018-11-19) - - -### Bug Fixes - -* allows camel-case, variadic arguments, and strict mode to be combined ([#1247](https://github.com/yargs/yargs/issues/1247)) ([eacc035](https://github.com/yargs/yargs/commit/eacc035)) - - - - -## [12.0.4](https://github.com/yargs/yargs/compare/v12.0.3...v12.0.4) (2018-11-10) - - -### Bug Fixes - -* don't load config when processing positionals ([5d0dc92](https://github.com/yargs/yargs/commit/5d0dc92)) - - - - -## [12.0.3](https://github.com/yargs/yargs/compare/v12.0.2...v12.0.3) (2018-10-06) - - -### Bug Fixes - -* $0 contains first arg in bundled electron apps ([#1206](https://github.com/yargs/yargs/issues/1206)) ([567820b](https://github.com/yargs/yargs/commit/567820b)) -* accept single function for middleware ([66fd6f7](https://github.com/yargs/yargs/commit/66fd6f7)), closes [#1214](https://github.com/yargs/yargs/issues/1214) [#1214](https://github.com/yargs/yargs/issues/1214) -* hide `hidden` options from help output even if they are in a group ([#1221](https://github.com/yargs/yargs/issues/1221)) ([da54028](https://github.com/yargs/yargs/commit/da54028)) -* improve Norwegian Bokmål translations ([#1208](https://github.com/yargs/yargs/issues/1208)) ([a458fa4](https://github.com/yargs/yargs/commit/a458fa4)) -* improve Norwegian Nynorsk translations ([#1207](https://github.com/yargs/yargs/issues/1207)) ([d422eb5](https://github.com/yargs/yargs/commit/d422eb5)) - - - - -## [12.0.2](https://github.com/yargs/yargs/compare/v12.0.1...v12.0.2) (2018-09-04) - - -### Bug Fixes - -* middleware should work regardless of when method is called ([664b265](https://github.com/yargs/yargs/commit/664b265)), closes [#1178](https://github.com/yargs/yargs/issues/1178) -* translation not working when using __ with a single parameter ([#1183](https://github.com/yargs/yargs/issues/1183)) ([f449aea](https://github.com/yargs/yargs/commit/f449aea)) -* upgrade os-locale to version that addresses license issue ([#1195](https://github.com/yargs/yargs/issues/1195)) ([efc0970](https://github.com/yargs/yargs/commit/efc0970)) - - - - -## [12.0.1](https://github.com/yargs/yargs/compare/v12.0.0...v12.0.1) (2018-06-29) - - - - -# [12.0.0](https://github.com/yargs/yargs/compare/v11.1.0...v12.0.0) (2018-06-26) - - -### Bug Fixes - -* .argv and .parse() now invoke identical code path ([#1126](https://github.com/yargs/yargs/issues/1126)) ([f13ebf4](https://github.com/yargs/yargs/commit/f13ebf4)) -* remove the trailing white spaces from the help output ([#1090](https://github.com/yargs/yargs/issues/1090)) ([3f0746c](https://github.com/yargs/yargs/commit/3f0746c)) -* **completion:** Avoid default command and recommendations during completion ([#1123](https://github.com/yargs/yargs/issues/1123)) ([036e7c5](https://github.com/yargs/yargs/commit/036e7c5)) - - -### Chores - -* test Node.js 6, 8 and 10 ([#1160](https://github.com/yargs/yargs/issues/1160)) ([84f9d2b](https://github.com/yargs/yargs/commit/84f9d2b)) -* upgrade to version of yargs-parser that does not populate value for unset boolean ([#1104](https://github.com/yargs/yargs/issues/1104)) ([d4705f4](https://github.com/yargs/yargs/commit/d4705f4)) - - -### Features - -* add support for global middleware, useful for shared tasks like metrics ([#1119](https://github.com/yargs/yargs/issues/1119)) ([9d71ac7](https://github.com/yargs/yargs/commit/9d71ac7)) -* allow setting scriptName $0 ([#1143](https://github.com/yargs/yargs/issues/1143)) ([a2f2eae](https://github.com/yargs/yargs/commit/a2f2eae)) -* remove `setPlaceholderKeys` ([#1105](https://github.com/yargs/yargs/issues/1105)) ([6ee2c82](https://github.com/yargs/yargs/commit/6ee2c82)) - - -### BREAKING CHANGES - -* Options absent from `argv` (not set via CLI argument) are now absent from the parsed result object rather than being set with `undefined` -* drop Node 4 from testing matrix, such that we'll gradually start drifting away from supporting Node 4. -* yargs-parser does not populate 'false' when boolean flag is not passed -* tests that assert against help output will need to be updated - - - - -# [11.1.0](https://github.com/yargs/yargs/compare/v11.0.0...v11.1.0) (2018-03-04) - - -### Bug Fixes - -* choose correct config directory when require.main does not exist ([#1056](https://github.com/yargs/yargs/issues/1056)) ([a04678c](https://github.com/yargs/yargs/commit/a04678c)) - - -### Features - -* allow hidden options to be displayed with --show-hidden ([#1061](https://github.com/yargs/yargs/issues/1061)) ([ea862ae](https://github.com/yargs/yargs/commit/ea862ae)) -* extend *.rc files in addition to json ([#1080](https://github.com/yargs/yargs/issues/1080)) ([11691a6](https://github.com/yargs/yargs/commit/11691a6)) - - - - -# [11.0.0](https://github.com/yargs/yargs/compare/v10.1.2...v11.0.0) (2018-01-22) - - -### Bug Fixes - -* Set implicit nargs=1 when type=number requiresArg=true ([#1050](https://github.com/yargs/yargs/issues/1050)) ([2b56812](https://github.com/yargs/yargs/commit/2b56812)) - - -### Features - -* requiresArg is now simply an alias for nargs(1) ([#1054](https://github.com/yargs/yargs/issues/1054)) ([a3ddacc](https://github.com/yargs/yargs/commit/a3ddacc)) - - -### BREAKING CHANGES - -* requiresArg now has significantly different error output, matching nargs. - - - - -## [10.1.2](https://github.com/yargs/yargs/compare/v10.1.1...v10.1.2) (2018-01-17) - - -### Bug Fixes - -* requiresArg should only be enforced if argument exists ([#1043](https://github.com/yargs/yargs/issues/1043)) ([fbf41ae](https://github.com/yargs/yargs/commit/fbf41ae)) - - - - -## [10.1.1](https://github.com/yargs/yargs/compare/v10.1.0...v10.1.1) (2018-01-09) - - -### Bug Fixes - -* Add `dirname` sanity check on `findUp` ([#1036](https://github.com/yargs/yargs/issues/1036)) ([331d103](https://github.com/yargs/yargs/commit/331d103)) - - - - -# [10.1.0](https://github.com/yargs/yargs/compare/v10.0.3...v10.1.0) (2018-01-01) - - -### Bug Fixes - -* 'undefined' should be taken to mean no argument was provided ([#1015](https://github.com/yargs/yargs/issues/1015)) ([c679e90](https://github.com/yargs/yargs/commit/c679e90)) - - -### Features - -* add missing simple chinese locale strings ([#1004](https://github.com/yargs/yargs/issues/1004)) ([3cc24ec](https://github.com/yargs/yargs/commit/3cc24ec)) -* add Norwegian Nynorsk translations ([#1028](https://github.com/yargs/yargs/issues/1028)) ([a5ac213](https://github.com/yargs/yargs/commit/a5ac213)) -* async command handlers ([#1001](https://github.com/yargs/yargs/issues/1001)) ([241124b](https://github.com/yargs/yargs/commit/241124b)) -* middleware ([#881](https://github.com/yargs/yargs/issues/881)) ([77b8dbc](https://github.com/yargs/yargs/commit/77b8dbc)) - - - - -## [10.0.3](https://github.com/yargs/yargs/compare/v10.0.2...v10.0.3) (2017-10-21) - - -### Bug Fixes - -* parse array rather than string, so that quotes are safe ([#993](https://github.com/yargs/yargs/issues/993)) ([c351685](https://github.com/yargs/yargs/commit/c351685)) - - - - -## [10.0.2](https://github.com/yargs/yargs/compare/v10.0.1...v10.0.2) (2017-10-21) - - -### Bug Fixes - -* fix tiny spacing issue with usage ([#992](https://github.com/yargs/yargs/issues/992)) ([7871327](https://github.com/yargs/yargs/commit/7871327)) - - - - -## [10.0.1](https://github.com/yargs/yargs/compare/v10.0.0...v10.0.1) (2017-10-19) - - -### Bug Fixes - -* help strings for nested commands were missing parent commands ([#990](https://github.com/yargs/yargs/issues/990)) ([cd1ca15](https://github.com/yargs/yargs/commit/cd1ca15)) -* use correct completion command in generated completion script ([#988](https://github.com/yargs/yargs/issues/988)) ([3c8ac1d](https://github.com/yargs/yargs/commit/3c8ac1d)) - - - - -# [10.0.0](https://github.com/yargs/yargs/compare/v9.1.0...v10.0.0) (2017-10-18) - - -### Bug Fixes - -* config and normalize can be disabled with false ([#952](https://github.com/yargs/yargs/issues/952)) ([3bb8771](https://github.com/yargs/yargs/commit/3bb8771)) -* less eager help command execution ([#972](https://github.com/yargs/yargs/issues/972)) ([8c1d7bf](https://github.com/yargs/yargs/commit/8c1d7bf)) -* the positional argument parse was clobbering global flag arguments ([#984](https://github.com/yargs/yargs/issues/984)) ([7e58453](https://github.com/yargs/yargs/commit/7e58453)) - - -### Features - -* .usage() can now be used to configure a default command ([#975](https://github.com/yargs/yargs/issues/975)) ([7269531](https://github.com/yargs/yargs/commit/7269531)) -* hidden options are now explicitly indicated using "hidden" flag ([#962](https://github.com/yargs/yargs/issues/962)) ([280d0d6](https://github.com/yargs/yargs/commit/280d0d6)) -* introduce .positional() for configuring positional arguments ([#967](https://github.com/yargs/yargs/issues/967)) ([cb16460](https://github.com/yargs/yargs/commit/cb16460)) -* replace $0 with file basename ([#983](https://github.com/yargs/yargs/issues/983)) ([20bb99b](https://github.com/yargs/yargs/commit/20bb99b)) - - -### BREAKING CHANGES - -* .usage() no longer accepts an options object as the second argument. It can instead be used as an alias for configuring a default command. -* previously hidden options were simply implied using a falsy description -* help command now only executes if it's the last positional in argv._ - - - - -# [9.1.0](https://github.com/yargs/yargs/compare/v9.0.1...v9.1.0) (2017-09-25) - - -### Bug Fixes - -* **command:** Run default cmd even if the only cmd ([#950](https://github.com/yargs/yargs/issues/950)) ([7b22203](https://github.com/yargs/yargs/commit/7b22203)) - - -### Features - -* multiple usage calls are now collected, not replaced ([#958](https://github.com/yargs/yargs/issues/958)) ([74a38b2](https://github.com/yargs/yargs/commit/74a38b2)) - - - - -## [9.0.1](https://github.com/yargs/yargs/compare/v9.0.0...v9.0.1) (2017-09-17) - - -### Bug Fixes - -* implications fails only displayed once ([#954](https://github.com/yargs/yargs/issues/954)) ([ac8088b](https://github.com/yargs/yargs/commit/ac8088b)) - - - - -# [9.0.0](https://github.com/yargs/yargs/compare/v8.0.2...v9.0.0) (2017-09-03) - - -### Bug Fixes - -* 'undefined' default value for choices resulted in validation failing ([782b896](https://github.com/yargs/yargs/commit/782b896)) -* address bug with handling of arrays of implications ([c240661](https://github.com/yargs/yargs/commit/c240661)) -* defaulting keys to 'undefined' interfered with conflicting key logic ([a8e0cff](https://github.com/yargs/yargs/commit/a8e0cff)) -* don't bother calling JSON.stringify() on string default values ([#891](https://github.com/yargs/yargs/issues/891)) ([628be21](https://github.com/yargs/yargs/commit/628be21)) -* exclude positional arguments from completion output ([#927](https://github.com/yargs/yargs/issues/927)) ([71c7ec7](https://github.com/yargs/yargs/commit/71c7ec7)) -* strict mode should not fail for hidden options ([#949](https://github.com/yargs/yargs/issues/949)) ([0e0c58d](https://github.com/yargs/yargs/commit/0e0c58d)) - - -### Features - -* allow implies and conflicts to accept array values ([#922](https://github.com/yargs/yargs/issues/922)) ([abdc7da](https://github.com/yargs/yargs/commit/abdc7da)) -* allow parse with no arguments as alias for yargs.argv ([#944](https://github.com/yargs/yargs/issues/944)) ([a9f03e7](https://github.com/yargs/yargs/commit/a9f03e7)) -* enable .help() and .version() by default ([#912](https://github.com/yargs/yargs/issues/912)) ([1ef44e0](https://github.com/yargs/yargs/commit/1ef44e0)) -* to allow both undefined and nulls, for benefit of TypeScript ([#945](https://github.com/yargs/yargs/issues/945)) ([792564d](https://github.com/yargs/yargs/commit/792564d)) - - -### BREAKING CHANGES - -* version() and help() are now enabled by default, and show up in help output; the implicit help command can no longer be enabled/disabled independently from the help command itself (which can now be disabled). -* parse() now behaves as an alias for .argv, unless a parseCallback is provided. - - - - -## [8.0.2](https://github.com/yargs/yargs/compare/v8.0.1...v8.0.2) (2017-06-12) - - - - -## [8.0.1](https://github.com/yargs/yargs/compare/v8.0.0...v8.0.1) (2017-05-02) - - - - -# [8.0.0](https://github.com/yargs/yargs/compare/v7.1.0...v8.0.0) (2017-05-01) - - -### Bug Fixes - -* commands are now applied in order, from left to right ([#857](https://github.com/yargs/yargs/issues/857)) ([baba863](https://github.com/yargs/yargs/commit/baba863)) -* help now takes precedence over command recommendation ([#866](https://github.com/yargs/yargs/issues/866)) ([17e3567](https://github.com/yargs/yargs/commit/17e3567)) -* positional arguments now work if no handler is provided to inner command ([#864](https://github.com/yargs/yargs/issues/864)) ([e28ded3](https://github.com/yargs/yargs/commit/e28ded3)) - - -### Chores - -* upgrade yargs-parser ([#867](https://github.com/yargs/yargs/issues/867)) ([8f9c6c6](https://github.com/yargs/yargs/commit/8f9c6c6)) - - -### Features - -* allow extends to inherit from a module ([#865](https://github.com/yargs/yargs/issues/865)) ([89456d9](https://github.com/yargs/yargs/commit/89456d9)) -* allow strict mode to be disabled ([#840](https://github.com/yargs/yargs/issues/840)) ([6f78c05](https://github.com/yargs/yargs/commit/6f78c05)) - - -### BREAKING CHANGES - -* extends functionality now always loads the JSON provided, rather than reading from a specific key -* Node 4+ is now required; this will allow us to start updating our dependencies. -* the first argument to strict() is now used to enable/disable its functionality, rather than controlling whether or not it is global. - - - - -# [7.1.0](https://github.com/yargs/yargs/compare/v7.0.2...v7.1.0) (2017-04-13) - - -### Bug Fixes - -* fix demandOption no longer treats 'false' as truthy ([#829](https://github.com/yargs/yargs/issues/829)) ([c748dd2](https://github.com/yargs/yargs/commit/c748dd2)) -* get terminalWidth in non interactive mode no longer causes a validation exception ([#837](https://github.com/yargs/yargs/issues/837)) ([360e301](https://github.com/yargs/yargs/commit/360e301)) -* we shouldn't output help if we've printed a prior help-like message ([#847](https://github.com/yargs/yargs/issues/847)) ([17e89bd](https://github.com/yargs/yargs/commit/17e89bd)) - - -### Features - -* add support for numeric commands ([#825](https://github.com/yargs/yargs/issues/825)) ([fde0564](https://github.com/yargs/yargs/commit/fde0564)) - - - - -## [7.0.2](https://github.com/yargs/yargs/compare/v7.0.1...v7.0.2) (2017-03-10) - - -### Bug Fixes - -* populating placeholder arguments broke validation ([b3eb2fe](https://github.com/yargs/yargs/commit/b3eb2fe)) - - - - -## [7.0.1](https://github.com/yargs/yargs/compare/v7.0.0...v7.0.1) (2017-03-03) - - -### Bug Fixes - -* --help with default command should print top-level help ([#810](https://github.com/yargs/yargs/issues/810)) ([9c03fa4](https://github.com/yargs/yargs/commit/9c03fa4)) - - - - -# [7.0.0](https://github.com/yargs/yargs/compare/v6.6.0...v7.0.0) (2017-02-26) - - -### Bug Fixes - -* address min/max validation message regression ([#750](https://github.com/yargs/yargs/issues/750)) ([2e5ce0f](https://github.com/yargs/yargs/commit/2e5ce0f)) -* address positional argument strict() bug introduced in [#766](https://github.com/yargs/yargs/issues/766) ([#784](https://github.com/yargs/yargs/issues/784)) ([a8528e6](https://github.com/yargs/yargs/commit/a8528e6)) -* console.warn() rather than throwing errors when api signatures are incorrect ([#804](https://github.com/yargs/yargs/issues/804)) ([a607061](https://github.com/yargs/yargs/commit/a607061)) -* context should override parsed argv ([#786](https://github.com/yargs/yargs/issues/786)) ([0997288](https://github.com/yargs/yargs/commit/0997288)) -* context variables are now recognized in strict() mode ([#796](https://github.com/yargs/yargs/issues/796)) ([48575cd](https://github.com/yargs/yargs/commit/48575cd)) -* errors were not bubbling appropriately from sub-commands to top-level ([#802](https://github.com/yargs/yargs/issues/802)) ([8a992f5](https://github.com/yargs/yargs/commit/8a992f5)) -* positional arguments of sub-commands threw strict() exception ([#805](https://github.com/yargs/yargs/issues/805)) ([f3f074b](https://github.com/yargs/yargs/commit/f3f074b)) -* pull in yargs-parser with modified env precedence ([#787](https://github.com/yargs/yargs/issues/787)) ([e0fbbe5](https://github.com/yargs/yargs/commit/e0fbbe5)) -* running parse() multiple times on the same yargs instance caused exception if help() enabled ([#790](https://github.com/yargs/yargs/issues/790)) ([07e39b7](https://github.com/yargs/yargs/commit/07e39b7)) -* use path.resolve() to support node 0.10 ([#797](https://github.com/yargs/yargs/issues/797)) ([49a93fc](https://github.com/yargs/yargs/commit/49a93fc)) - - -### Features - -* add conflicts and implies shorthands. ([#753](https://github.com/yargs/yargs/issues/753)) ([bd1472b](https://github.com/yargs/yargs/commit/bd1472b)) -* add traditional Chinese translation ([#780](https://github.com/yargs/yargs/issues/780)) ([6ab6a95](https://github.com/yargs/yargs/commit/6ab6a95)) -* allow provided config object to extend other configs ([#779](https://github.com/yargs/yargs/issues/779)) ([3280dd0](https://github.com/yargs/yargs/commit/3280dd0)) -* function argument validation ([#773](https://github.com/yargs/yargs/issues/773)) ([22ed9bb](https://github.com/yargs/yargs/commit/22ed9bb)) -* if only one column is provided for examples, allow it to take up the entire line ([#749](https://github.com/yargs/yargs/issues/749)) ([7931652](https://github.com/yargs/yargs/commit/7931652)) -* introduce custom yargs error object ([#765](https://github.com/yargs/yargs/issues/765)) ([8308efa](https://github.com/yargs/yargs/commit/8308efa)) -* introduces support for default commands, using the '*' identifier ([#785](https://github.com/yargs/yargs/issues/785)) ([d78a0f5](https://github.com/yargs/yargs/commit/d78a0f5)) -* rethink how options are inherited by commands ([#766](https://github.com/yargs/yargs/issues/766)) ([ab1fa4b](https://github.com/yargs/yargs/commit/ab1fa4b)) - - -### BREAKING CHANGES - -* `extends` key in config file is now used for extending other config files -* environment variables now take precedence over config files. -* context now takes precedence over argv and defaults -* the arguments passed to functions are now validated, there's a good chance this will throw exceptions for a few folks who are using the API in an unexpected way. -* by default options, and many of yargs' parsing helpers will now default to being applied globally; such that they are no-longer reset before being passed into commands. -* yargs will no longer aggressively suppress errors, allowing errors that are not generated internally to bubble. - - - - -# [6.6.0](https://github.com/yargs/yargs/compare/v6.5.0...v6.6.0) (2016-12-29) - - -### Bug Fixes - -* [object Object] was accidentally being populated on options object ([#736](https://github.com/yargs/yargs/issues/736)) ([f755e27](https://github.com/yargs/yargs/commit/f755e27)) -* do not use cwd when resolving package.json for yargs parsing config ([#726](https://github.com/yargs/yargs/issues/726)) ([9bdaab7](https://github.com/yargs/yargs/commit/9bdaab7)) - - -### Features - -* implement conflicts() for defining mutually exclusive arguments; thanks [@madcampos](https://github.com/madcampos)! ([#741](https://github.com/yargs/yargs/issues/741)) ([5883779](https://github.com/yargs/yargs/commit/5883779)) -* split demand() into demandCommand()/demandOption() ([#740](https://github.com/yargs/yargs/issues/740)) ([66573c8](https://github.com/yargs/yargs/commit/66573c8)) -* support for positional argument aliases ([#727](https://github.com/yargs/yargs/issues/727)) ([27e1a57](https://github.com/yargs/yargs/commit/27e1a57)) - - - - -# [6.5.0](https://github.com/yargs/yargs/compare/v6.4.0...v6.5.0) (2016-12-01) - - -### Bug Fixes - -* still freeze/unfreeze if parse() is called in isolation ([#717](https://github.com/yargs/yargs/issues/717)) ([30a9492](https://github.com/yargs/yargs/commit/30a9492)) - - -### Features - -* pull in yargs-parser introducing additional settings ([#688](https://github.com/yargs/yargs/issues/688)), and fixing [#716](https://github.com/yargs/yargs/issues/716) ([#722](https://github.com/yargs/yargs/issues/722)) ([702995a](https://github.com/yargs/yargs/commit/702995a)) - - - - -# [6.4.0](https://github.com/yargs/yargs/compare/v6.3.0...v6.4.0) (2016-11-13) - - -### Bug Fixes - -* **locales:** correct some Russian translations ([#691](https://github.com/yargs/yargs/issues/691)) ([a980671](https://github.com/yargs/yargs/commit/a980671)) - - -### Features - -* **locales:** Added Belarusian translation ([#690](https://github.com/yargs/yargs/issues/690)) ([68dac1f](https://github.com/yargs/yargs/commit/68dac1f)) -* **locales:** Create nl.json ([#687](https://github.com/yargs/yargs/issues/687)) ([46ce1bb](https://github.com/yargs/yargs/commit/46ce1bb)) -* update to yargs-parser that addresses [#598](https://github.com/yargs/yargs/issues/598), [#617](https://github.com/yargs/yargs/issues/617) ([#700](https://github.com/yargs/yargs/issues/700)) ([54cb31d](https://github.com/yargs/yargs/commit/54cb31d)) -* yargs is now passed as the third-argument to fail handler ([#613](https://github.com/yargs/yargs/issues/613)) ([21b74f9](https://github.com/yargs/yargs/commit/21b74f9)) - - -### Performance Improvements - -* normalizing package data is an expensive operation ([#705](https://github.com/yargs/yargs/issues/705)) ([49cf533](https://github.com/yargs/yargs/commit/49cf533)) - - - - -# [6.3.0](https://github.com/yargs/yargs/compare/v6.2.0...v6.3.0) (2016-10-19) - - -### Bug Fixes - -* **command:** subcommands via commandDir() now supported for parse(msg, cb) ([#678](https://github.com/yargs/yargs/issues/678)) ([6b85cc6](https://github.com/yargs/yargs/commit/6b85cc6)) - - -### Features - -* **locales:** Add Thai locale file ([#679](https://github.com/yargs/yargs/issues/679)) ([c05e36b](https://github.com/yargs/yargs/commit/c05e36b)) - - - - -# [6.2.0](https://github.com/yargs/yargs/compare/v6.1.1...v6.2.0) (2016-10-16) - - -### Bug Fixes - -* stop applying parser to context object ([#675](https://github.com/yargs/yargs/issues/675)) ([3fe9b8f](https://github.com/yargs/yargs/commit/3fe9b8f)) - - -### Features - -* add new pt_BR translations ([#674](https://github.com/yargs/yargs/issues/674)) ([5615a82](https://github.com/yargs/yargs/commit/5615a82)) -* Italian translations for 'did you mean' and 'aliases' ([#673](https://github.com/yargs/yargs/issues/673)) ([81984e6](https://github.com/yargs/yargs/commit/81984e6)) - - - - -## [6.1.1](https://github.com/yargs/yargs/compare/v6.1.0...v6.1.1) (2016-10-15) - - -### Bug Fixes - -* freeze was not resetting configObjects to initial state; addressed performance issue raised by [@nexdrew](https://github.com/nexdrew). ([#670](https://github.com/yargs/yargs/issues/670)) ([ae4bcd4](https://github.com/yargs/yargs/commit/ae4bcd4)) - - - - -# [6.1.0](https://github.com/yargs/yargs/compare/v6.0.0...v6.1.0) (2016-10-15) - - -### Bug Fixes - -* **locales:** change some translations ([#667](https://github.com/yargs/yargs/issues/667)) ([aa966c5](https://github.com/yargs/yargs/commit/aa966c5)) -* **locales:** conform hi locale to y18n.__n expectations ([#666](https://github.com/yargs/yargs/issues/666)) ([22adb18](https://github.com/yargs/yargs/commit/22adb18)) - - -### Features - -* initial support for command aliases ([#647](https://github.com/yargs/yargs/issues/647)) ([127a040](https://github.com/yargs/yargs/commit/127a040)) -* **command:** add camelcase commands to argv ([#658](https://github.com/yargs/yargs/issues/658)) ([b1cabae](https://github.com/yargs/yargs/commit/b1cabae)) -* **locales:** add Hindi translations ([9290912](https://github.com/yargs/yargs/commit/9290912)) -* **locales:** add Hungarian translations ([be92327](https://github.com/yargs/yargs/commit/be92327)) -* **locales:** Japanese translations for 'did you mean' and 'aliases' ([#651](https://github.com/yargs/yargs/issues/651)) ([5eb78fc](https://github.com/yargs/yargs/commit/5eb78fc)) -* **locales:** Polish translations for 'did you mean' and 'aliases' ([#650](https://github.com/yargs/yargs/issues/650)) ([c951c0e](https://github.com/yargs/yargs/commit/c951c0e)) -* reworking yargs API to make it easier to run in headless environments, e.g., Slack ([#646](https://github.com/yargs/yargs/issues/646)) ([f284c29](https://github.com/yargs/yargs/commit/f284c29)) -* Turkish translations for 'did you mean' and 'aliases' ([#660](https://github.com/yargs/yargs/issues/660)) ([072fd45](https://github.com/yargs/yargs/commit/072fd45)) - - - - -# [6.0.0](https://github.com/yargs/yargs/compare/v5.0.0...v6.0.0) (2016-09-30) - - -### Bug Fixes - -* changed parsing of the command string to ignore extra spaces ([#600](https://github.com/yargs/yargs/issues/600)) ([e8e5a72](https://github.com/yargs/yargs/commit/e8e5a72)) -* drop lodash.assign ([#641](https://github.com/yargs/yargs/issues/641)) ([ad3146f](https://github.com/yargs/yargs/commit/ad3146f)) -* for args that have skipValidation set to `true`, check if the parsed arg is `true` ([#619](https://github.com/yargs/yargs/issues/619)) ([658a34c](https://github.com/yargs/yargs/commit/658a34c)) -* upgrade standard, and fix appveyor config so that it works with newest standard ([#607](https://github.com/yargs/yargs/issues/607)) ([c301f42](https://github.com/yargs/yargs/commit/c301f42)) - - -### Chores - -* upgrade yargs-parser ([#633](https://github.com/yargs/yargs/issues/633)) ([cc1224e](https://github.com/yargs/yargs/commit/cc1224e)) - - -### Features - -* make opts object optional for .option() ([#624](https://github.com/yargs/yargs/issues/624)) ([4f29de6](https://github.com/yargs/yargs/commit/4f29de6)) - - -### Performance Improvements - -* defer windowWidth() to improve perf for non-help usage ([#610](https://github.com/yargs/yargs/issues/610)) ([cbc3636](https://github.com/yargs/yargs/commit/cbc3636)) - - -### BREAKING CHANGES - -* coerce is now applied as a final step after other parsing is complete - - - - -# [5.0.0](https://github.com/yargs/yargs/compare/v4.8.1...v5.0.0) (2016-08-14) - - -### Bug Fixes - -* **default:** Remove undocumented alias of default() ([#469](https://github.com/yargs/yargs/issues/469)) ([b8591b2](https://github.com/yargs/yargs/commit/b8591b2)) -* remove deprecated zh.json ([#578](https://github.com/yargs/yargs/issues/578)) ([317c62c](https://github.com/yargs/yargs/commit/317c62c)) - - -### Features - -* .help() API can now enable implicit help command ([#574](https://github.com/yargs/yargs/issues/574)) ([7645019](https://github.com/yargs/yargs/commit/7645019)) -* **command:** builder function no longer needs to return the yargs instance ([#549](https://github.com/yargs/yargs/issues/549)) ([eaa2873](https://github.com/yargs/yargs/commit/eaa2873)) -* add coerce api ([#586](https://github.com/yargs/yargs/issues/586)) ([1d53ccb](https://github.com/yargs/yargs/commit/1d53ccb)) -* adds recommendCommands() for command suggestions ([#580](https://github.com/yargs/yargs/issues/580)) ([59474dc](https://github.com/yargs/yargs/commit/59474dc)) -* apply .env() globally ([#553](https://github.com/yargs/yargs/issues/553)) ([be65728](https://github.com/yargs/yargs/commit/be65728)) -* apply default builder to command() and apply fail() handlers globally ([#583](https://github.com/yargs/yargs/issues/583)) ([0aaa68b](https://github.com/yargs/yargs/commit/0aaa68b)) -* update yargs-parser to version 3.1.0 ([#581](https://github.com/yargs/yargs/issues/581)) ([882a127](https://github.com/yargs/yargs/commit/882a127)) - - -### Performance Improvements - -* defer requiring most external libs until needed ([#584](https://github.com/yargs/yargs/issues/584)) ([f9b0ed4](https://github.com/yargs/yargs/commit/f9b0ed4)) - - -### BREAKING CHANGES - -* fail is now applied globally. -* we now default to an empty builder function when command is executed with no builder. -* yargs-parser now better handles negative integer values, at the cost of handling numeric option names, e.g., -1 hello -* default: removed undocumented `defaults` alias for `default`. -* introduces a default `help` command which outputs help, as an alternative to a help flag. -* interpret demand() numbers as relative to executing command ([#582](https://github.com/yargs/yargs/issues/582)) ([927810c](https://github.com/yargs/yargs/commit/927810c)) - - - - -## [4.8.1](https://github.com/yargs/yargs/compare/v4.8.0...v4.8.1) (2016-07-16) - - -### Bug Fixes - -* **commandDir:** make dir relative to caller instead of require.main.filename ([#548](https://github.com/yargs/yargs/issues/548)) ([3c2e479](https://github.com/yargs/yargs/commit/3c2e479)) -* add config lookup for .implies() ([#556](https://github.com/yargs/yargs/issues/556)) ([8d7585c](https://github.com/yargs/yargs/commit/8d7585c)) -* cache pkg lookups by path to avoid returning the wrong one ([#552](https://github.com/yargs/yargs/issues/552)) ([fea7e0b](https://github.com/yargs/yargs/commit/fea7e0b)) -* positional arguments were not being handled appropriately by parse() ([#559](https://github.com/yargs/yargs/issues/559)) ([063a866](https://github.com/yargs/yargs/commit/063a866)) -* pull in [@nexdrew](https://github.com/nexdrew)'s fixes to yargs-parser ([#560](https://github.com/yargs/yargs/issues/560)) ([c77c080](https://github.com/yargs/yargs/commit/c77c080)), closes [#560](https://github.com/yargs/yargs/issues/560) - - - - -# [4.8.0](https://github.com/yargs/yargs/compare/v4.7.1...v4.8.0) (2016-07-09) - - -### Bug Fixes - -* drop unused camelcase dependency fixes [#516](https://github.com/yargs/yargs/issues/516) ([#525](https://github.com/yargs/yargs/issues/525)) ([365fb9a](https://github.com/yargs/yargs/commit/365fb9a)), closes [#516](https://github.com/yargs/yargs/issues/516) [#525](https://github.com/yargs/yargs/issues/525) -* fake a tty in tests, so that we can use the new set-blocking ([#512](https://github.com/yargs/yargs/issues/512)) ([a54c742](https://github.com/yargs/yargs/commit/a54c742)) -* ignore invalid package.json during read-pkg-up ([#546](https://github.com/yargs/yargs/issues/546)) ([e058c87](https://github.com/yargs/yargs/commit/e058c87)) -* keep both zh and zh_CN until yargs[@5](https://github.com/5).x ([0f8faa7](https://github.com/yargs/yargs/commit/0f8faa7)) -* lazy-load package.json and cache. get rid of pkg-conf dependency. ([#544](https://github.com/yargs/yargs/issues/544)) ([2609b2e](https://github.com/yargs/yargs/commit/2609b2e)) -* we now respect the order of _ when applying commands ([#537](https://github.com/yargs/yargs/issues/537)) ([ed86b78](https://github.com/yargs/yargs/commit/ed86b78)) - - -### Features - -* add .commandDir(dir) to API to apply all command modules from a relative directory ([#494](https://github.com/yargs/yargs/issues/494)) ([b299dff](https://github.com/yargs/yargs/commit/b299dff)) -* **command:** derive missing command string from module filename ([#527](https://github.com/yargs/yargs/issues/527)) ([20d4b8a](https://github.com/yargs/yargs/commit/20d4b8a)) -* builder is now optional for a command module ([#545](https://github.com/yargs/yargs/issues/545)) ([8d6ad6e](https://github.com/yargs/yargs/commit/8d6ad6e)) - - - - -## [4.7.1](https://github.com/yargs/yargs/compare/v4.7.0...v4.7.1) (2016-05-15) - - -### Bug Fixes - -* switch to using `const` rather than `var` ([#499](https://github.com/yargs/yargs/pull/499)) -* make stdout flush on newer versions of Node.js ([#501](https://github.com/yargs/yargs/issues/501)) ([9f8c6f4](https://github.com/yargs/yargs/commit/9f8c6f4)) - - - - -# [4.7.0](https://github.com/yargs/yargs/compare/v4.6.0...v4.7.0) (2016-05-02) - - -### Bug Fixes - -* **pkgConf:** fix aliases issues in .pkgConf() ([#478](https://github.com/yargs/yargs/issues/478))([b900502](https://github.com/yargs/yargs/commit/b900502)) - - -### Features - -* **completion:** allow to get completions for any string, not just process.argv ([#470](https://github.com/yargs/yargs/issues/470))([74fcfbc](https://github.com/yargs/yargs/commit/74fcfbc)) -* **configuration:** Allow to directly pass a configuration object to .config() ([#480](https://github.com/yargs/yargs/issues/480))([e0a7e05](https://github.com/yargs/yargs/commit/e0a7e05)) -* **validation:** Add .skipValidation() method ([#471](https://github.com/yargs/yargs/issues/471))([d72badb](https://github.com/yargs/yargs/commit/d72badb)) - - - - -# [4.6.0](https://github.com/yargs/yargs/compare/v4.5.0...v4.6.0) (2016-04-11) - - -### Bug Fixes - -* **my brand!:** I agree with [@osher](https://github.com/osher) lightweight isn't a huge selling point of ours any longer, see [#468](https://github.com/yargs/yargs/issues/468) ([c46d7e1](https://github.com/yargs/yargs/commit/c46d7e1)) - -### Features - -* switch to standard-version for release management ([f70f801](https://github.com/yargs/yargs/commit/f70f801)) -* upgrade to version of yargs-parser that introduces some slick new features, great work [@elas7](https://github.com/elas7). update cliui, replace win-spawn, replace badge. ([#475](https://github.com/yargs/yargs/issues/475)) ([f915dd4](https://github.com/yargs/yargs/commit/f915dd4)) - - - - -# [4.5.0](https://github.com/yargs/yargs/compare/v4.4.0...v4.5.0) (2016-04-05) - - -### Bug Fixes - -* **windows:** handle $0 better on Windows platforms ([eb6e03f](https://github.com/yargs/yargs/commit/eb6e03f)) - -### Features - -* **commands:** implemented variadic positional arguments ([51d926e](https://github.com/yargs/yargs/commit/51d926e)) -* **completion:** completion now better handles aliases, and avoids duplicating keys. ([86416c8](https://github.com/yargs/yargs/commit/86416c8)) -* **config:** If invoking .config() without parameters, set a default option ([0413dd1](https://github.com/yargs/yargs/commit/0413dd1)) -* **conventional-changelog:** switching to using conventional-changelog for generating the changelog ([a2b5a2a](https://github.com/yargs/yargs/commit/a2b5a2a)) - - - -### v4.4.0 (2016/04/03 21:10 +07:00) - -- [#454](https://github.com/yargs/yargs/pull/454) fix demand() when second argument is an array (@elas7) -- [#452](https://github.com/yargs/yargs/pull/452) fix code example for `.help()` docs (@maxrimue) -- [#450](https://github.com/yargs/yargs/pull/450) fix for bash completion trailing space edge-case (@elas7) -- [#448](https://github.com/yargs/yargs/pull/448) allow a method to be passed to `showHelp`, rather than a log-level (@osher) -- [#446](https://github.com/yargs/yargs/pull/446) update yargs-parser, y18n, nyc, cliui, pkg-conf (@bcoe) -- [#436](https://github.com/yargs/yargs/pull/436) the rebase method is only used by tests, do not export it in two places (@elas7) -- [#428](https://github.com/yargs/yargs/pull/428) initial support for subcommands (@nexdrew) - -### v4.3.2 (2016/3/20 15:07 +07:00) - -- [#445](https://github.com/yargs/yargs/pull/445) strict mode was failing if no commands were registered (@nexdrew) -- [#443](https://github.com/yargs/yargs/pull/443) adds Italian translation \o/ (@madrisan) -- [#441](https://github.com/yargs/yargs/pull/441) remove duplicate keys from array options configuration (@elas7) -- [#437](https://github.com/yargs/yargs/pull/437) standardize tests for .command() (@lrlna) - -### v4.3.0 (2016/3/12 14:19 +07:00) - -- [#432](https://github.com/yargs/yargs/pull/432) non-singleton version of yargs (@bcoe) -- [#422, #425, #420] translations for number (@zkat, @rilut, @maxrimue, @watilde) -- [#414](https://github.com/yargs/yargs/pull/414) all command options can be defined in module now (@nexdrew) - -### v4.2.0 (2016/2/22 11:02 +07:00) - -- [#395](https://github.com/yargs/yargs/pull/395) do not reset groups if they contain - global keys (@novemberborn) -- [#393](https://github.com/yargs/yargs/pull/393) use sane default for usage strings (@nexdrew) -- [#392](https://github.com/yargs/yargs/pull/392) resetting wrap() was causing layout issues - with commands (@nexdrew) -- [#391](https://github.com/yargs/yargs/pull/391) commands were being added multiple times (@nexdrew) - -### v4.0.0 (2016/2/14 1:27 +07:00) - -- [#384](https://github.com/bcoe/yargs/pull/384) add new number type to yargs (@lrlna, @maxrimue) -- [#382](https://github.com/bcoe/yargs/pull/382) pass error as extra parameter to fail (@gajus) -- [#378](https://github.com/bcoe/yargs/pull/378) introduces the pkgConf feature, which tells - yargs to load default argument values from a key on a project's package.json (@bcoe) -- [#376](https://github.com/bcoe/yargs/pull/376) **breaking change**, make help() method signature - more consistent with other commands (@maxrimue) -- [#368](https://github.com/bcoe/yargs/pull/368) **breaking change**, overhaul to command handling API: - introducing named positional arguments, commands as modules, introduces the concept of global options (options that don't reset). (@nexdrew, @bcoe). -- [#364](https://github.com/bcoe/yargs/pull/364) add the slick new yargs website to the package.json (@iarna). -- [#357](https://github.com/bcoe/yargs/pull/357) .strict() now requires that a valid command is provided (@lrlna) -- [#356](https://github.com/bcoe/yargs/pull/356) pull the parsing bits of yargs into the separate module yargs-parser. Various parsing options can now be turned on and off using configuration (@bcoe). -- [#330](https://github.com/bcoe/yargs/pull/330) **breaking change**, fix inconsistencies with `.version()` API. (@maxrimue). - -### v3.32.0 (2016/1/14 10:13 +07:00) - -- [#344](https://github.com/bcoe/yargs/pull/344) yargs now has a code of conduct and contributor guidelines (@bcoe) -- [#341](https://github.com/bcoe/yargs/issues/341) Fix edge-case with camel-case arguments (@davibe) -- [#331](https://github.com/bcoe/yargs/pull/331) Handle parsing a raw argument string (@kellyselden) -- [#325](https://github.com/bcoe/yargs/pull/325) Tweaks to make tests pass again on Windows (@isaacs) -- [#321](https://github.com/bcoe/yargs/pull/321) Custom config parsing function (@bcoe) - -### v3.31.0 (2015/12/03 10:15 +07:00) - -- [#239](https://github.com/bcoe/yargs/pull/239) Pass argv to commands (@bcoe) -- [#308](https://github.com/bcoe/yargs/pull/308) Yargs now handles environment variables (@nexdrew) -- [#302](https://github.com/bcoe/yargs/pull/302) Add Indonesian translation (@rilut) -- [#300](https://github.com/bcoe/yargs/pull/300) Add Turkish translation (@feyzo) -- [#298](https://github.com/bcoe/yargs/pull/298) Add Norwegian Bokmål translation (@sindresorhus) -- [#297](https://github.com/bcoe/yargs/pull/297) Fix for layout of cjk characters (@disjukr) -- [#296](https://github.com/bcoe/yargs/pull/296) Add Korean translation (@disjukr) - -### v3.30.0 (2015/11/13 16:29 +07:00) - -- [#293](https://github.com/bcoe/yargs/pull/293) Polish language support (@kamilogorek) -- [#291](https://github.com/bcoe/yargs/pull/291) fix edge-cases with `.alias()` (@bcoe) -- [#289](https://github.com/bcoe/yargs/pull/289) group options in custom groups (@bcoe) - -### v3.29.0 (2015/10/16 21:51 +07:00) - -- [#282](https://github.com/bcoe/yargs/pull/282) completions now accept promises (@LinusU) -- [#281](https://github.com/bcoe/yargs/pull/281) fix parsing issues with dot notation (@bcoe) - -### v3.28.0 (2015/10/16 1:55 +07:00) - -- [#277](https://github.com/bcoe/yargs/pull/277) adds support for ansi escape codes (@bcoe) - -### v3.27.0 (2015/10/08 1:55 +00:00) - -- [#271](https://github.com/bcoe/yargs/pull/273) skips validation for help or version flags with exitProcess(false) (@tepez) -- [#273](https://github.com/bcoe/yargs/pull/273) implements single output for errors with exitProcess(false) (@nexdrew) -- [#269](https://github.com/bcoe/yargs/pull/269) verifies single output for errors with exitProcess(false) (@tepez) -- [#268](https://github.com/bcoe/yargs/pull/268) adds Chinese translation (@qiu8310) -- [#266](https://github.com/bcoe/yargs/pull/266) adds case for -- after -- in parser test (@geophree) - -### v3.26.0 (2015/09/25 2:14 +00:00) - -- [#263](https://github.com/bcoe/yargs/pull/263) document count() and option() object keys (@nexdrew) -- [#259](https://github.com/bcoe/yargs/pull/259) remove util in readme (@38elements) -- [#258](https://github.com/bcoe/yargs/pull/258) node v4 builds, update deps (@nexdrew) -- [#257](https://github.com/bcoe/yargs/pull/257) fix spelling errors (@dkoleary88) - -### v3.25.0 (2015/09/13 7:38 -07:00) - -- [#254](https://github.com/bcoe/yargs/pull/254) adds Japanese translation (@oti) -- [#253](https://github.com/bcoe/yargs/pull/253) fixes for tests on Windows (@bcoe) - -### v3.24.0 (2015/09/04 12:02 +00:00) - -- [#248](https://github.com/bcoe/yargs/pull/248) reinstate os-locale, no spawning (@nexdrew) -- [#249](https://github.com/bcoe/yargs/pull/249) use travis container-based infrastructure (@nexdrew) -- [#247](https://github.com/bcoe/yargs/pull/247) upgrade standard (@nexdrew) - -### v3.23.0 (2015/08/30 23:00 +00:00) - -- [#246](https://github.com/bcoe/yargs/pull/246) detect locale based only on environment variables (@bcoe) -- [#244](https://github.com/bcoe/yargs/pull/244) adds Windows CI testing (@bcoe) -- [#245](https://github.com/bcoe/yargs/pull/245) adds OSX CI testing (@bcoe, @nexdrew) - -### v3.22.0 (2015/08/28 22:26 +00:00) -- [#242](https://github.com/bcoe/yargs/pull/242) adds detectLocale config option (@bcoe) - -### v3.21.1 (2015/08/28 20:58 +00:00) -- [#240](https://github.com/bcoe/yargs/pull/240) hot-fix for Atom on Windows (@bcoe) - -### v3.21.0 (2015/08/21 21:20 +00:00) -- [#238](https://github.com/bcoe/yargs/pull/238) upgrade camelcase, window-size, chai, mocha (@nexdrew) -- [#237](https://github.com/bcoe/yargs/pull/237) adds defaultDescription to option() (@nexdrew) - -### v3.20.0 (2015/08/20 01:29 +00:00) -- [#231](https://github.com/bcoe/yargs/pull/231) Merge pull request #231 from bcoe/detect-locale (@sindresorhus) -- [#235](https://github.com/bcoe/yargs/pull/235) adds german translation to yargs (@maxrimue) - -### v3.19.0 (2015/08/14 05:12 +00:00) -- [#224](https://github.com/bcoe/yargs/pull/224) added Portuguese translation (@codemonkey3045) - -### v3.18.1 (2015/08/12 05:53 +00:00) - -- [#228](https://github.com/bcoe/yargs/pull/228) notes about embedding yargs in Electron (@etiktin) -- [#223](https://github.com/bcoe/yargs/pull/223) make booleans work in config files (@sgentle) - -### v3.18.0 (2015/08/06 20:05 +00:00) -- [#222](https://github.com/bcoe/yargs/pull/222) updates fr locale (@nexdrew) -- [#221](https://github.com/bcoe/yargs/pull/221) adds missing locale strings (@nexdrew) -- [#220](https://github.com/bcoe/yargs/pull/220) adds es locale (@zkat) - -### v3.17.1 (2015/08/02 19:35 +00:00) -- [#218](https://github.com/bcoe/yargs/pull/218) upgrades nyc (@bcoe) - -### v3.17.0 (2015/08/02 18:39 +00:00) -- [#217](https://github.com/bcoe/yargs/pull/217) sort methods in README.md (@nexdrew) -- [#215](https://github.com/bcoe/yargs/pull/215) adds fr locale (@LoicMahieu) - -### v3.16.0 (2015/07/30 04:35 +00:00) -- [#210](https://github.com/bcoe/yargs/pull/210) adds i18n support to yargs (@bcoe) -- [#209](https://github.com/bcoe/yargs/pull/209) adds choices type to yargs (@nexdrew) -- [#207](https://github.com/bcoe/yargs/pull/207) pretty new shields from shields.io (@SimenB) -- [#208](https://github.com/bcoe/yargs/pull/208) improvements to README.md (@nexdrew) -- [#205](https://github.com/bcoe/yargs/pull/205) faster build times on Travis (@ChristianMurphy) - -### v3.15.0 (2015/07/06 06:01 +00:00) -- [#197](https://github.com/bcoe/yargs/pull/197) tweaks to how errors bubble up from parser.js (@bcoe) -- [#193](https://github.com/bcoe/yargs/pull/193) upgraded nyc, reporting now happens by default (@bcoe) - -### v3.14.0 (2015/06/28 02:12 +00:00) - -- [#192](https://github.com/bcoe/yargs/pull/192) standard style nits (@bcoe) -- [#190](https://github.com/bcoe/yargs/pull/190) allow for hidden commands, e.g., - .completion('completion', false) (@tschaub) - -### v3.13.0 (2015/06/24 04:12 +00:00) - -- [#187](https://github.com/bcoe/yargs/pull/187) completion now behaves differently - if it is being run in the context of a command (@tschaub) -- [#186](https://github.com/bcoe/yargs/pull/186) if no matches are found for a completion - default to filename completion (@tschaub) - -### v3.12.0 (2015/06/19 03:23 +00:00) -- [#183](https://github.com/bcoe/yargs/pull/183) don't complete commands if they've already been completed (@tschaub) -- [#181](https://github.com/bcoe/yargs/pull/181) various fixes for completion. (@bcoe, @tschaub) -- [#182](https://github.com/bcoe/yargs/pull/182) you can now set a maximum # of of required arguments (@bcoe) - -### v3.11.0 (2015/06/15 05:15 +00:00) - -- [#173](https://github.com/bcoe/yargs/pull/173) update standard, window-size, chai (@bcoe) -- [#171](https://github.com/bcoe/yargs/pull/171) a description can now be set - when providing a config option. (@5c077yP) - -### v3.10.0 (2015/05/29 04:25 +00:00) - -- [#165](https://github.com/bcoe/yargs/pull/165) expose yargs.terminalWidth() thanks @ensonic (@bcoe) -- [#164](https://github.com/bcoe/yargs/pull/164) better array handling thanks @getify (@bcoe) - -### v3.9.1 (2015/05/20 05:14 +00:00) -- [b6662b6](https://github.com/bcoe/yargs/commit/b6662b6774cfeab4876f41ec5e2f67b7698f4e2f) clarify .config() docs (@linclark) -- [0291360](https://github.com/bcoe/yargs/commit/02913606285ce31ce81d7f12c48d8a3029776ec7) fixed tests, switched to nyc for coverage, fixed security issue, added Lin as collaborator (@bcoe) - -### v3.9.0 (2015/05/10 18:32 +00:00) -- [#157](https://github.com/bcoe/yargs/pull/157) Merge pull request #157 from bcoe/command-yargs. allows handling of command specific arguments. Thanks for the suggestion @ohjames (@bcoe) -- [#158](https://github.com/bcoe/yargs/pull/158) Merge pull request #158 from kemitchell/spdx-license. Update license format (@kemitchell) - -### v3.8.0 (2015/04/24 23:10 +00:00) -- [#154](https://github.com/bcoe/yargs/pull/154) showHelp's method signature was misleading fixes #153 (@bcoe) -- [#151](https://github.com/bcoe/yargs/pull/151) refactor yargs' table layout logic to use new helper library (@bcoe) -- [#150](https://github.com/bcoe/yargs/pull/150) Fix README example in argument requirements (@annonymouse) - -### v3.7.2 (2015/04/13 11:52 -07:00) - -* [679fbbf](https://github.com/bcoe/yargs/commit/679fbbf55904030ccee8a2635e8e5f46551ab2f0) updated yargs to use the [standard](https://github.com/feross/standard) style guide (agokjr) -* [22382ee](https://github.com/bcoe/yargs/commit/22382ee9f5b495bc2586c1758cd1091cec3647f9 various bug fixes for $0 (@nylen) - -### v3.7.1 (2015/04/10 11:06 -07:00) - -* [89e1992](https://github.com/bcoe/yargs/commit/89e1992a004ba73609b5f9ee6890c4060857aba4) detect iojs bin along with node bin. (@bcoe) -* [755509e](https://github.com/bcoe/yargs/commit/755509ea90041e5f7833bba3b8c5deffe56f0aab) improvements to example documentation in README.md (@rstacruz) -* [0d2dfc8](https://github.com/bcoe/yargs/commit/0d2dfc822a43418242908ad97ddd5291a1b35dc6) showHelp() no longer requires that .argv has been called (@bcoe) - -### v3.7.0 (2015/04/04 02:29 -07:00) - -* [56cbe2d](https://github.com/bcoe/yargs/commit/56cbe2ddd33dc176dcbf97ba40559864a9f114e4) make .requiresArg() work with type hints. (@bcoe). -* [2f5d562](https://github.com/bcoe/yargs/commit/2f5d5624f736741deeedf6a664d57bc4d857bdd0) serialize arrays and objects in usage strings. (@bcoe). -* [5126304](https://github.com/bcoe/yargs/commit/5126304dd18351fc28f10530616fdd9361e0af98) be more lenient about alias/primary key ordering in chaining API. (@bcoe) - -### v3.6.0 (2015/03/21 01:00 +00:00) -- [4e24e22](https://github.com/bcoe/yargs/commit/4e24e22e6a195e55ab943ede704a0231ac33b99c) support for .js configuration files. (@pirxpilot) - -### v3.5.4 (2015/03/12 05:56 +00:00) -- [c16cc08](https://github.com/bcoe/yargs/commit/c16cc085501155cf7fd853ccdf8584b05ab92b78) message for non-option arguments is now optional, thanks to (@raine) - -### v3.5.3 (2015/03/09 06:14 +00:00) -- [870b428](https://github.com/bcoe/yargs/commit/870b428cf515d560926ca392555b7ad57dba9e3d) completion script was missing in package.json (@bcoe) - -### v3.5.2 (2015/03/09 06:11 +00:00) -- [58a4b24](https://github.com/bcoe/yargs/commit/58a4b2473ebbb326713d522be53e32d3aabb08d2) parse was being called multiple times, resulting in strange behavior (@bcoe) - -### v3.5.1 (2015/03/09 04:55 +00:00) -- [4e588e0](https://github.com/bcoe/yargs/commit/4e588e055afbeb9336533095f051496e3977f515) accidentally left testing logic in (@bcoe) - -### v3.5.0 (2015/03/09 04:49 +00:00) -- [718bacd](https://github.com/bcoe/yargs/commit/718bacd81b9b44f786af76b2afe491fe06274f19) added support for bash completions see #4 (@bcoe) -- [a192882](https://github.com/bcoe/yargs/commit/a19288270fc431396c42af01125eeb4443664528) downgrade to mocha 2.1.0 until https://github.com/mochajs/mocha/issues/1585 can be sorted out (@bcoe) - -### v3.4.7 (2015/03/09 04:09 +00:00) -- [9845e5c](https://github.com/bcoe/yargs/commit/9845e5c1a9c684ba0be3f0bfb40e7b62ab49d9c8) the Argv singleton was not being updated when manually parsing arguments, fixes #114 (@bcoe) - -### v3.4.6 (2015/03/09 04:01 +00:00) -- [45b4c80](https://github.com/bcoe/yargs/commit/45b4c80b890d02770b0a94f326695a8a566e8fe9) set placeholders for all keys fixes #115 (@bcoe) - -### v3.4.5 (2015/03/01 20:31 +00:00) -- [a758e0b](https://github.com/bcoe/yargs/commit/a758e0b2556184f067cf3d9c4ef886d39817ebd2) fix for count consuming too many arguments (@bcoe) - -### v3.4.4 (2015/02/28 04:52 +00:00) -- [0476af7](https://github.com/bcoe/yargs/commit/0476af757966acf980d998b45108221d4888cfcb) added nargs feature, allowing you to specify the number of arguments after an option (@bcoe) -- [092477d](https://github.com/bcoe/yargs/commit/092477d7ab3efbf0ba11cede57f7d8cfc70b024f) updated README with full example of v3.0 API (@bcoe) - -### v3.3.3 (2015/02/28 04:23 +00:00) -- [0c4b769](https://github.com/bcoe/yargs/commit/0c4b769516cd8d93a7c4e5e675628ae0049aa9a8) remove string dependency, which conflicted with other libraries see #106 (@bcoe) - -### v3.3.2 (2015/02/28 04:11 +00:00) -- [2a98906](https://github.com/bcoe/yargs/commit/2a9890675821c0e7a12f146ce008b0562cb8ec9a) add $0 to epilog (@schnittstabil) - -### v3.3.1 (2015/02/24 03:28 +00:00) -- [ad485ce](https://github.com/bcoe/yargs/commit/ad485ce748ebdfce25b88ef9d6e83d97a2f68987) fix for applying defaults to camel-case args (@bcoe) - -### v3.3.0 (2015/02/24 00:49 +00:00) -- [8bfe36d](https://github.com/bcoe/yargs/commit/8bfe36d7fb0f93a799ea3f4c756a7467c320f8c0) fix and document restart() command, as a tool for building nested CLIs (@bcoe) - -### v3.2.1 (2015/02/22 05:45 +00:00) -- [49a6d18](https://github.com/bcoe/yargs/commit/49a6d1822a4ef9b1ea6f90cc366be60912628885) you can now provide a function that generates a default value (@bcoe) - -### v3.2.0 (2015/02/22 05:24 +00:00) -- [7a55886](https://github.com/bcoe/yargs/commit/7a55886c9343cf71a20744ca5cdd56d2ea7412d5) improvements to yargs two-column text layout (@bcoe) -- [b6ab513](https://github.com/bcoe/yargs/commit/b6ab5136a4c3fa6aa496f6b6360382e403183989) Tweak NPM version badge (@nylen) - -### v3.1.0 (2015/02/19 19:37 +00:00) -- [9bd2379](https://github.com/bcoe/yargs/commit/9bd237921cf1b61fd9f32c0e6d23f572fc225861) version now accepts a function, making it easy to load version #s from a package.json (@bcoe) - -### v3.0.4 (2015/02/14 01:40 +00:00) -- [0b7c19b](https://github.com/bcoe/yargs/commit/0b7c19beaecb747267ca4cc10e5cb2a8550bc4b7) various fixes for dot-notation handling (@bcoe) - -### v3.0.3 (2015/02/14 00:59 +00:00) -- [c3f35e9](https://github.com/bcoe/yargs/commit/c3f35e99bd5a0d278073fcadd95e2d778616cc17) make sure dot-notation is applied to aliases (@bcoe) - -### 3.0.2 (2015/02/13 16:50 +00:00) -- [74c8967](https://github.com/bcoe/yargs/commit/74c8967c340c204a0a7edf8a702b6f46c2705435) document epilog shorthand of epilogue. (@bcoe) -- [670110f](https://github.com/bcoe/yargs/commit/670110fc01bedc4831b6fec6afac54517d5a71bc) any non-truthy value now causes check to fail see #76 (@bcoe) -- [0d8f791](https://github.com/bcoe/yargs/commit/0d8f791a33c11ced4cd431ea8d3d3a337d456b56) finished implementing my wish-list of fetures for yargs 3.0. see #88 (@bcoe) -- [5768447](https://github.com/bcoe/yargs/commit/5768447447c4c8e8304f178846206ce86540f063) fix coverage. (@bcoe) -- [82e793f](https://github.com/bcoe/yargs/commit/82e793f3f61c41259eaacb67f0796aea2cf2aaa0) detect console width and perform word-wrapping. (@bcoe) -- [67476b3](https://github.com/bcoe/yargs/commit/67476b37eea07fee55f23f35b9e0c7d76682b86d) refactor two-column table layout so that we can use it for examples and usage (@bcoe) -- [4724cdf](https://github.com/bcoe/yargs/commit/4724cdfcc8e37ae1ca3dcce9d762f476e9ef4bb4) major refactor of index.js, in prep for 3.x release. (@bcoe) - -### v2.3.0 (2015/02/08 20:41 +00:00) -- [d824620](https://github.com/bcoe/yargs/commit/d824620493df4e63664af1fe320764dd1a9244e6) allow for undefined boolean defaults (@ashi009) - -### v2.2.0 (2015/02/08 20:07 +00:00) -- [d6edd98](https://github.com/bcoe/yargs/commit/d6edd9848826e7389ed1393858c45d03961365fd) in-prep for further refactoring, and a 3.x release I've shuffled some things around and gotten test-coverage to 100%. (@bcoe) - -### v2.1.2 (2015/02/08 06:05 +00:00) -- [d640745](https://github.com/bcoe/yargs/commit/d640745a7b9f8d476e0223879d056d18d9c265c4) switch to path.relative (@bcoe) -- [3bfd41f](https://github.com/bcoe/yargs/commit/3bfd41ff262a041f29d828b88936a79c63cad594) remove mocha.opts. (@bcoe) -- [47a2f35](https://github.com/bcoe/yargs/commit/47a2f357091db70903a402d6765501c1d63f15fe) document using .string('_') for string ids. see #56 (@bcoe) -- [#57](https://github.com/bcoe/yargs/pull/57) Merge pull request #57 from eush77/option-readme (@eush77) - -### v2.1.1 (2015/02/06 08:08 +00:00) -- [01c6c61](https://github.com/bcoe/yargs/commit/01c6c61d67b4ebf88f41f0b32a345ec67f0ac17d) fix for #71, 'newAliases' of undefined (@bcoe) - -### v2.1.0 (2015/02/06 07:59 +00:00) -- [6a1a3fa](https://github.com/bcoe/yargs/commit/6a1a3fa731958e26ccd56885f183dd8985cc828f) try to guess argument types, and apply sensible defaults see #73 (@bcoe) - -### v2.0.1 (2015/02/06 07:54 +00:00) -- [96a06b2](https://github.com/bcoe/yargs/commit/96a06b2650ff1d085a52b7328d8bba614c20cc12) Fix for strange behavior with --sort option, see #51 (@bcoe) - -### v2.0.0 (2015/02/06 07:45 +00:00) -- [0250517](https://github.com/bcoe/yargs/commit/0250517c9643e53f431b824e8ccfa54937414011) - [108fb84](https://github.com/bcoe/yargs/commit/108fb8409a3a63dcaf99d917fe4dfcfaa1de236d) fixed bug with boolean parsing, when bools separated by = see #66 (@bcoe) -- [a465a59](https://github.com/bcoe/yargs/commit/a465a5915f912715738de890982e4f8395958b10) Add `files` field to the package.json (@shinnn) -- [31043de](https://github.com/bcoe/yargs/commit/31043de7a38a17c4c97711f1099f5fb164334db3) fix for yargs.argv having the same keys added multiple times see #63 (@bcoe) -- [2d68c5b](https://github.com/bcoe/yargs/commit/2d68c5b91c976431001c4863ce47c9297850f1ad) Disable process.exit calls using .exitProcess(false) (@cianclarke) -- [45da9ec](https://github.com/bcoe/yargs/commit/45da9ec4c55a7bd394721bc6a1db0dabad7bc52a) Mention .option in README (@eush77) - -### v1.3.2 (2014/10/06 21:56 +00:00) -- [b8d3472](https://github.com/bcoe/yargs/commit/b8d34725482e5821a3cc809c0df71378f282f526) 1.3.2 (@chevex) - -### list (2014/08/30 18:41 +00:00) -- [fbc777f](https://github.com/bcoe/yargs/commit/fbc777f416eeefd37c84e44d27d7dfc7c1925721) Now that yargs is the successor to optimist, I'm changing the README language to be more universal. Pirate speak isn't very accessible to non-native speakers. (@chevex) -- [a54d068](https://github.com/bcoe/yargs/commit/a54d0682ae2efc2394d407ab171cc8a8bbd135ea) version output will not print extra newline (@boneskull) -- [1cef5d6](https://github.com/bcoe/yargs/commit/1cef5d62a9d6d61a3948a49574892e01932cc6ae) Added contributors section to package.json (@chrisn) -- [cc295c0](https://github.com/bcoe/yargs/commit/cc295c0a80a2de267e0155b60d315fc4b6f7c709) Added 'require' and 'required' as synonyms for 'demand' (@chrisn) -- [d0bf951](https://github.com/bcoe/yargs/commit/d0bf951d949066b6280101ed606593d079ee15c8) Updating minimist. (@chevex) -- [c15f8e7](https://github.com/bcoe/yargs/commit/c15f8e7f245b261e542cf205ce4f4313630cbdb4) Fix #31 (bad interaction between camelCase options and strict mode) (@nylen) -- [d991b9b](https://github.com/bcoe/yargs/commit/d991b9be687a68812dee1e3b185ba64b7778b82d) Added .help() and .version() methods (@chrisn) -- [e8c8aa4](https://github.com/bcoe/yargs/commit/e8c8aa46268379357cb11e9fc34b8c403037724b) Added .showHelpOnFail() method (@chrisn) -- [e855af4](https://github.com/bcoe/yargs/commit/e855af4a933ea966b5bbdd3c4c6397a4bac1a053) Allow boolean flag with .demand() (@chrisn) -- [14dbec2](https://github.com/bcoe/yargs/commit/14dbec24fb7380683198e2b20c4deb8423e64bea) Fixes issue #22. Arguments are no longer printed to the console when using .config. (@chevex) -- [bef74fc](https://github.com/bcoe/yargs/commit/bef74fcddc1544598a804f80d0a3728459f196bf) Informing users that Yargs is the official optimist successor. (@chevex) -- [#24](https://github.com/bcoe/yargs/pull/24) Merge pull request #24 from chrisn/strict (@chrisn) -- [889a2b2](https://github.com/bcoe/yargs/commit/889a2b28eb9768801b05163360a470d0fd6c8b79) Added requiresArg option, for options that require values (@chrisn) -- [eb16369](https://github.com/bcoe/yargs/commit/eb163692262be1fe80b992fd8803d5923c5a9b18) Added .strict() method, to report error if unknown arguments are given (@chrisn) -- [0471c3f](https://github.com/bcoe/yargs/commit/0471c3fd999e1ad4e6cded88b8aa02013b66d14f) Changed optimist to yargs in usage-options.js example (@chrisn) -- [5c88f74](https://github.com/bcoe/yargs/commit/5c88f74e3cf031b17c54b4b6606c83e485ff520e) Change optimist to yargs in examples (@chrisn) -- [66f12c8](https://github.com/bcoe/yargs/commit/66f12c82ba3c943e4de8ca862980e835da8ecb3a) Fix a couple of bad interactions between aliases and defaults (@nylen) -- [8fa1d80](https://github.com/bcoe/yargs/commit/8fa1d80f14b03eb1f2898863a61f1d1615bceb50) Document second argument of usage(message, opts) (@Gobie) -- [56e6528](https://github.com/bcoe/yargs/commit/56e6528cf674ff70d63083fb044ff240f608448e) For "--some-option", also set argv.someOption (@nylen) -- [ed5f6d3](https://github.com/bcoe/yargs/commit/ed5f6d33f57ad1086b11c91b51100f7c6c7fa8ee) Finished porting unit tests to Mocha. (@chevex) - -### v1.0.15 (2014/02/05 23:18 +00:00) -- [e2b1fc0](https://github.com/bcoe/yargs/commit/e2b1fc0c4a59cf532ae9b01b275e1ef57eeb64d2) 1.0.15 update to badges (@chevex) - -### v1.0.14 (2014/02/05 23:17 +00:00) -- [f33bbb0](https://github.com/bcoe/yargs/commit/f33bbb0f00fe18960f849cc8e15a7428a4cd59b8) Revert "Fixed issue which caused .demand function not to work correctly." (@chevex) - -### v1.0.13 (2014/02/05 22:13 +00:00) -- [6509e5e](https://github.com/bcoe/yargs/commit/6509e5e7dee6ef1a1f60eea104be0faa1a045075) Fixed issue which caused .demand function not to work correctly. (@chevex) - -### v1.0.12 (2013/12/13 00:09 +00:00) -- [05eb267](https://github.com/bcoe/yargs/commit/05eb26741c9ce446b33ff006e5d33221f53eaceb) 1.0.12 (@chevex) - -### v1.0.11 (2013/12/13 00:07 +00:00) -- [c1bde46](https://github.com/bcoe/yargs/commit/c1bde46e37318a68b87d17a50c130c861d6ce4a9) 1.0.11 (@chevex) - -### v1.0.10 (2013/12/12 23:57 +00:00) -- [dfebf81](https://github.com/bcoe/yargs/commit/dfebf8164c25c650701528ee581ca483a99dc21c) Fixed formatting in README (@chevex) - -### v1.0.9 (2013/12/12 23:47 +00:00) -- [0b4e34a](https://github.com/bcoe/yargs/commit/0b4e34af5e6d84a9dbb3bb6d02cd87588031c182) Update README.md (@chevex) - -### v1.0.8 (2013/12/06 16:36 +00:00) -- [#1](https://github.com/bcoe/yargs/pull/1) fix error caused by check() see #1 (@martinheidegger) - -### v1.0.7 (2013/11/24 18:01 +00:00) -- [a247d88](https://github.com/bcoe/yargs/commit/a247d88d6e46644cbb7303c18b1bb678fc132d72) Modified Pirate Joe image. (@chevex) - -### v1.0.6 (2013/11/23 19:21 +00:00) -- [d7f69e1](https://github.com/bcoe/yargs/commit/d7f69e1d34bc929736a8bdccdc724583e21b7eab) Updated Pirate Joe image. (@chevex) - -### v1.0.5 (2013/11/23 19:09 +00:00) -- [ece809c](https://github.com/bcoe/yargs/commit/ece809cf317cc659175e1d66d87f3ca68c2760be) Updated readme notice again. (@chevex) - -### v1.0.4 (2013/11/23 19:05 +00:00) -- [9e81e81](https://github.com/bcoe/yargs/commit/9e81e81654028f83ba86ffc3ac772a0476084e5e) Updated README with a notice about yargs being a fork of optimist and what that implies. (@chevex) - -### v1.0.3 (2013/11/23 17:43 +00:00) -- [65e7a78](https://github.com/bcoe/yargs/commit/65e7a782c86764944d63d084416aba9ee6019c5f) Changed some small wording in README.md. (@chevex) -- [459e20e](https://github.com/bcoe/yargs/commit/459e20e539b366b85128dd281ccd42221e96c7da) Fix a bug in the options function, when string and boolean options weren't applied to aliases. (@shockone) - -### v1.0.2 (2013/11/23 09:46 +00:00) -- [3d80ebe](https://github.com/bcoe/yargs/commit/3d80ebed866d3799224b6f7d596247186a3898a9) 1.0.2 (@chevex) - -### v1.0.1 (2013/11/23 09:39 +00:00) -- [f80ff36](https://github.com/bcoe/yargs/commit/f80ff3642d580d4b68bf9f5a94277481bd027142) Updated image. (@chevex) - -### v1.0.0 (2013/11/23 09:33 +00:00) -- [54e31d5](https://github.com/bcoe/yargs/commit/54e31d505f820b80af13644e460894b320bf25a3) Rebranded from optimist to yargs in the spirit of the fork :D (@chevex) -- [4ebb6c5](https://github.com/bcoe/yargs/commit/4ebb6c59f44787db7c24c5b8fe2680f01a23f498) Added documentation for demandCount(). (@chevex) -- [4561ce6](https://github.com/bcoe/yargs/commit/4561ce66dcffa95f49e8b4449b25b94cd68acb25) Simplified the error messages returned by .check(). (@chevex) -- [661c678](https://github.com/bcoe/yargs/commit/661c67886f479b16254a830b7e1db3be29e6b7a6) Fixed an issue with demand not accepting a zero value. (@chevex) -- [731dd3c](https://github.com/bcoe/yargs/commit/731dd3c37624790490bd6df4d5f1da8f4348279e) Add .fail(fn) so death isn't the only option. Should fix issue #39. (@chevex) -- [fa15417](https://github.com/bcoe/yargs/commit/fa15417ff9e70dace0d726627a5818654824c1d8) Added a few missing 'return self' (@chevex) -- [e655e4d](https://github.com/bcoe/yargs/commit/e655e4d99d1ae1d3695ef755d51c2de08d669761) Fix showing help in certain JS environments. (@chevex) -- [a746a31](https://github.com/bcoe/yargs/commit/a746a31cd47c87327028e6ea33762d6187ec5c87) Better string representation of default values. (@chevex) -- [6134619](https://github.com/bcoe/yargs/commit/6134619a7e90b911d5443230b644c5d447c1a68c) Implies: conditional demands (@chevex) -- [046b93b](https://github.com/bcoe/yargs/commit/046b93b5d40a27367af4cb29726e4d781d934639) Added support for JSON config files. (@chevex) -- [a677ec0](https://github.com/bcoe/yargs/commit/a677ec0a0ecccd99c75e571d03323f950688da03) Add .example(cmd, desc) feature. (@chevex) -- [1bd4375](https://github.com/bcoe/yargs/commit/1bd4375e11327ba1687d4bb6e5e9f3c30c1be2af) Added 'defaults' as alias to 'default' so as to avoid usage of a reserved keyword. (@chevex) -- [6b753c1](https://github.com/bcoe/yargs/commit/6b753c16ca09e723060e70b773b430323b29c45c) add .normalize(args..) support for normalizing paths (@chevex) -- [33d7d59](https://github.com/bcoe/yargs/commit/33d7d59341d364f03d3a25f0a55cb99004dbbe4b) Customize error messages with demand(key, msg) (@chevex) -- [647d37f](https://github.com/bcoe/yargs/commit/647d37f164c20f4bafbf67dd9db6cd6e2cd3b49f) Merge branch 'rewrite-duplicate-test' of github.com:isbadawi/node-optimist (@chevex) -- [9059d1a](https://github.com/bcoe/yargs/commit/9059d1ad5e8aea686c2a01c89a23efdf929fff2e) Pass aliases object to check functions for greater versatility. (@chevex) -- [623dc26](https://github.com/bcoe/yargs/commit/623dc26c7331abff2465ef8532e3418996d42fe6) Added ability to count boolean options and rolled minimist library back into project. (@chevex) -- [49f0dce](https://github.com/bcoe/yargs/commit/49f0dcef35de4db544c3966350d36eb5838703f6) Fixed small typo. (@chevex) -- [79ec980](https://github.com/bcoe/yargs/commit/79ec9806d9ca6eb0014cfa4b6d1849f4f004baf2) Removed dependency on wordwrap module. (@chevex) -- [ea14630](https://github.com/bcoe/yargs/commit/ea14630feddd69d1de99dd8c0e08948f4c91f00a) Merge branch 'master' of github.com:chbrown/node-optimist (@chevex) -- [2b75da2](https://github.com/bcoe/yargs/commit/2b75da2624061e0f4f3107d20303c06ec9054906) Merge branch 'master' of github.com:seanzhou1023/node-optimist (@chevex) -- [d9bda11](https://github.com/bcoe/yargs/commit/d9bda1116e26f3b40e833ca9ca19263afea53565) Merge branch 'patch-1' of github.com:thefourtheye/node-optimist (@chevex) -- [d6cc606](https://github.com/bcoe/yargs/commit/d6cc6064a4f1bea38a16a4430b8a1334832fbeff) Renamed README. (@chevex) -- [9498d3f](https://github.com/bcoe/yargs/commit/9498d3f59acfb5e102826503e681623c3a64b178) Renamed readme and added .gitignore. (@chevex) -- [bbd1fe3](https://github.com/bcoe/yargs/commit/bbd1fe37fefa366dde0fb3dc44d91fe8b28f57f5) Included examples for ```help``` and ```showHelp``` functions and fixed few formatting issues (@thefourtheye) -- [37fea04](https://github.com/bcoe/yargs/commit/37fea0470a5796a0294c1dcfff68d8041650e622) .alias({}) behaves differently based on mapping direction when generating descriptions (@chbrown) -- [855b20d](https://github.com/bcoe/yargs/commit/855b20d0be567ca121d06b30bea64001b74f3d6d) Documented function signatures are useful for dynamically typed languages. (@chbrown) - -### 0.6.0 (2013/06/25 08:48 +00:00) -- [d37bfe0](https://github.com/bcoe/yargs/commit/d37bfe05ae6d295a0ab481efe4881222412791f4) all tests passing using minimist (@substack) -- [76f1352](https://github.com/bcoe/yargs/commit/76f135270399d01f2bbc621e524a5966e5c422fd) all parse tests now passing (@substack) -- [a7b6754](https://github.com/bcoe/yargs/commit/a7b6754276c38d1565479a5685c3781aeb947816) using minimist, some tests passing (@substack) -- [6655688](https://github.com/bcoe/yargs/commit/66556882aa731cbbbe16cc4d42c85740a2e98099) Give credit where its due (@DeadAlready) -- [602a2a9](https://github.com/bcoe/yargs/commit/602a2a92a459f93704794ad51b115bbb08b535ce) v0.5.3 - Remove wordwrap as dependency (@DeadAlready) - -### 0.5.2 (2013/05/31 03:46 +00:00) -- [4497ca5](https://github.com/bcoe/yargs/commit/4497ca55e332760a37b866ec119ded347ca27a87) fixed the whitespace bug without breaking anything else (@substack) -- [5a3dd1a](https://github.com/bcoe/yargs/commit/5a3dd1a4e0211a38613c6e02f61328e1031953fa) failing test for whitespace arg (@substack) - -### 0.5.1 (2013/05/30 07:17 +00:00) -- [a20228f](https://github.com/bcoe/yargs/commit/a20228f62a454755dd07f628a7c5759113918327) fix parse() to work with functions before it (@substack) -- [b13bd4c](https://github.com/bcoe/yargs/commit/b13bd4cac856a9821d42fa173bdb58f089365a7d) failing test for parse() with modifiers (@substack) - -### 0.5.0 (2013/05/18 21:59 +00:00) -- [c474a64](https://github.com/bcoe/yargs/commit/c474a649231527915c222156e3b40806d365a87c) fixes for dash (@substack) - -### 0.4.0 (2013/04/13 19:03 +00:00) -- [dafe3e1](https://github.com/bcoe/yargs/commit/dafe3e18d7c6e7c2d68e06559df0e5cbea3adb14) failing short test (@substack) - -### 0.3.7 (2013/04/04 04:07 +00:00) -- [6c7a0ec](https://github.com/bcoe/yargs/commit/6c7a0ec94ce4199a505f0518b4d6635d4e47cc81) Fix for windows. On windows there is no _ in environment. (@hdf) - -### 0.3.6 (2013/04/04 04:04 +00:00) -- [e72346a](https://github.com/bcoe/yargs/commit/e72346a727b7267af5aa008b418db89970873f05) Add support for newlines in -a="" arguments (@danielbeardsley) -- [71e1fb5](https://github.com/bcoe/yargs/commit/71e1fb55ea9987110a669ac6ec12338cfff3821c) drop 0.4, add 0.8 to travis (@substack) - -### 0.3.5 (2012/10/10 11:09 +00:00) -- [ee692b3](https://github.com/bcoe/yargs/commit/ee692b37554c70a0bb16389a50a26b66745cbbea) Fix parsing booleans (@vojtajina) -- [5045122](https://github.com/bcoe/yargs/commit/5045122664c3f5b4805addf1be2148d5856f7ce8) set $0 properly in the tests (@substack) - -### 0.3.4 (2012/04/30 06:54 +00:00) -- [f28c0e6](https://github.com/bcoe/yargs/commit/f28c0e62ca94f6e0bb2e6d82fc3d91a55e69b903) bump for string "true" params (@substack) -- [8f44aeb](https://github.com/bcoe/yargs/commit/8f44aeb74121ddd689580e2bf74ef86a605e9bf2) Fix failing test for aliased booleans. (@coderarity) -- [b9f7b61](https://github.com/bcoe/yargs/commit/b9f7b613b1e68e11e6c23fbda9e555a517dcc976) Add failing test for short aliased booleans. (@coderarity) - -### 0.3.3 (2012/04/30 06:45 +00:00) -- [541bac8](https://github.com/bcoe/yargs/commit/541bac8dd787a5f1a5d28f6d8deb1627871705e7) Fixes #37. - -### 0.3.2 (2012/04/12 20:28 +00:00) -- [3a0f014](https://github.com/bcoe/yargs/commit/3a0f014c1451280ac1c9caa1f639d31675586eec) travis badge (@substack) -- [4fb60bf](https://github.com/bcoe/yargs/commit/4fb60bf17845f4ce3293f8ca49c9a1a7c736cfce) Fix boolean aliases. (@coderarity) -- [f14dda5](https://github.com/bcoe/yargs/commit/f14dda546efc4fe06ace04d36919bfbb7634f79b) Adjusted package.json to use tap (@jfhbrook) -- [88e5d32](https://github.com/bcoe/yargs/commit/88e5d32295be6e544c8d355ff84e355af38a1c74) test/usage.js no longer hangs (@jfhbrook) -- [e1e740c](https://github.com/bcoe/yargs/commit/e1e740c27082f3ce84deca2093d9db2ef735d0e5) two tests for combined boolean/alias opts parsing (@jfhbrook) - -### 0.3.1 (2011/12/31 08:44 +00:00) -- [d09b719](https://github.com/bcoe/yargs/commit/d09b71980ef711b6cf3918cd19beec8257e40e82) If "default" is set to false it was not passed on, fixed. (@wolframkriesing) - -### 0.3.0 (2011/12/09 06:03 +00:00) -- [6e74aa7](https://github.com/bcoe/yargs/commit/6e74aa7b46a65773e20c0cb68d2d336d4a0d553d) bump and documented dot notation (@substack) - -### 0.2.7 (2011/10/20 02:25 +00:00) -- [94adee2](https://github.com/bcoe/yargs/commit/94adee20e17b58d0836f80e8b9cdbe9813800916) argv._ can be told 'Hey! argv._! Don't be messing with my args.', and it WILL obey (@colinta) -- [c46fdd5](https://github.com/bcoe/yargs/commit/c46fdd56a05410ae4a1e724a4820c82e77ff5469) optimistic critter image (@substack) -- [5c95c73](https://github.com/bcoe/yargs/commit/5c95c73aedf4c7482bd423e10c545e86d7c8a125) alias options() to option() (@substack) -- [f7692ea](https://github.com/bcoe/yargs/commit/f7692ea8da342850af819367833abb685fde41d8) [fix] Fix for parsing boolean edge case (@indexzero) -- [d1f92d1](https://github.com/bcoe/yargs/commit/d1f92d1425bd7f356055e78621b30cdf9741a3c2) -- [b01bda8](https://github.com/bcoe/yargs/commit/b01bda8d86e455bbf74ce497864cb8ab5b9fb847) [fix test] Update to ensure optimist is aware of default booleans. Associated tests included (@indexzero) -- [aa753e7](https://github.com/bcoe/yargs/commit/aa753e7c54fb3a12f513769a0ff6d54aa0f63943) [dist test] Update devDependencies in package.json. Update test pathing to be more npm and require.paths future-proof (@indexzero) -- [7bfce2f](https://github.com/bcoe/yargs/commit/7bfce2f3b3c98e6539e7549d35fbabced7e9341e) s/sys/util/ (@substack) -- [d420a7a](https://github.com/bcoe/yargs/commit/d420a7a9c890d2cdb11acfaf3ea3f43bc3e39f41) update usage output (@substack) -- [cf86eed](https://github.com/bcoe/yargs/commit/cf86eede2e5fc7495b6ec15e6d137d9ac814f075) some sage readme protips about parsing rules (@substack) -- [5da9f7a](https://github.com/bcoe/yargs/commit/5da9f7a5c0e1758ec7c5801fb3e94d3f6e970513) documented all the methods finally (@substack) -- [8ca6879](https://github.com/bcoe/yargs/commit/8ca6879311224b25933642987300f6a29de5c21b) fenced syntax highlighting (@substack) -- [b72bacf](https://github.com/bcoe/yargs/commit/b72bacf1d02594778c1935405bc8137eb61761dc) right-alignment of wrapped extra params (@substack) -- [2b980bf](https://github.com/bcoe/yargs/commit/2b980bf2656b4ee8fc5134dc5f56a48855c35198) now with .wrap() (@substack) -- [d614f63](https://github.com/bcoe/yargs/commit/d614f639654057d1b7e35e3f5a306e88ec2ad1e4) don't show 'Options:' when there aren't any (@substack) -- [691eda3](https://github.com/bcoe/yargs/commit/691eda354df97b5a86168317abcbcaabdc08a0fb) failing test for multi-aliasing (@substack) -- [0826c9f](https://github.com/bcoe/yargs/commit/0826c9f462109feab2bc7a99346d22e72bf774b7) "Options:" > "options:" (@substack) -- [72f7490](https://github.com/bcoe/yargs/commit/72f749025d01b7f295738ed370a669d885fbada0) [minor] Update formatting for `.showHelp()` (@indexzero) -- [75aecce](https://github.com/bcoe/yargs/commit/75aeccea74329094072f95800e02c275e7d999aa) options works again, too lazy to write a proper test right now (@substack) -- [f742e54](https://github.com/bcoe/yargs/commit/f742e5439817c662dc3bd8734ddd6467e6018cfd) line_count_options example, which breaks (@substack) -- [4ca06b8](https://github.com/bcoe/yargs/commit/4ca06b8b4ea99b5d5714b315a2a8576bee6e5537) line count example (@substack) -- [eeb8423](https://github.com/bcoe/yargs/commit/eeb8423e0a5ecc9dc3eb1e6df9f3f8c1c88f920b) remove self.argv setting in boolean (@substack) -- [6903412](https://github.com/bcoe/yargs/commit/69034126804660af9cc20ea7f4457b50338ee3d7) removed camel case for now (@substack) -- [5a0d88b](https://github.com/bcoe/yargs/commit/5a0d88bf23e9fa79635dd034e2a1aa992acc83cd) remove dead longest checking code (@substack) -- [d782170](https://github.com/bcoe/yargs/commit/d782170babf7284b1aa34f5350df0dd49c373fa8) .help() too (@substack) -- [622ec17](https://github.com/bcoe/yargs/commit/622ec17379bb5374fdbb190404c82bc600975791) rm old help generator (@substack) -- [7c8baac](https://github.com/bcoe/yargs/commit/7c8baac4d66195e9f5158503ea9ebfb61153dab7) nub keys (@substack) -- [8197785](https://github.com/bcoe/yargs/commit/8197785ad4762465084485b041abd722f69bf344) generate help message based on the previous calls, todo: nub (@substack) -- [3ffbdc3](https://github.com/bcoe/yargs/commit/3ffbdc33c8f5e83d4ea2ac60575ce119570c7ede) stub out new showHelp, better checks (@substack) -- [d4e21f5](https://github.com/bcoe/yargs/commit/d4e21f56a4830f7de841900d3c79756fb9886184) let .options() take single options too (@substack) -- [3c4cf29](https://github.com/bcoe/yargs/commit/3c4cf2901a29bac119cca8e983028d8669230ec6) .options() is now heaps simpler (@substack) -- [89f0d04](https://github.com/bcoe/yargs/commit/89f0d043cbccd302f10ab30c2069e05d2bf817c9) defaults work again, all tests pass (@substack) -- [dd87333](https://github.com/bcoe/yargs/commit/dd8733365423006a6e4156372ebb55f98323af58) update test error messages, down to 2 failing tests (@substack) -- [53f7bc6](https://github.com/bcoe/yargs/commit/53f7bc626b9875f2abdfc5dd7a80bde7f14143a3) fix for bools doubling up, passes the parse test again, others fail (@substack) -- [2213e2d](https://github.com/bcoe/yargs/commit/2213e2ddc7263226fba717fb041dc3fde9bc2ee4) refactored for an argv getter, failing several tests (@substack) -- [d1e7379](https://github.com/bcoe/yargs/commit/d1e737970f15c6c006bebdd8917706827ff2f0f2) just rescan for now, alias test passes (@substack) -- [b2f8c99](https://github.com/bcoe/yargs/commit/b2f8c99cc477a8eb0fdf4cf178e1785b63185cfd) failing alias test (@substack) -- [d0c0174](https://github.com/bcoe/yargs/commit/d0c0174daa144bfb6dc7290fdc448c393c475e15) .alias() (@substack) -- [d85f431](https://github.com/bcoe/yargs/commit/d85f431ad7d07b058af3f2a57daa51495576c164) [api] Remove `.describe()` in favor of building upon the existing `.usage()` API (@indexzero) -- [edbd527](https://github.com/bcoe/yargs/commit/edbd5272a8e213e71acd802782135c7f9699913a) [doc api] Add `.describe()`, `.options()`, and `.showHelp()` methods along with example. (@indexzero) -- [be4902f](https://github.com/bcoe/yargs/commit/be4902ff0961ae8feb9093f2c0a4066463ded2cf) updates for coffee since it now does argv the node way (@substack) -- [e24cb23](https://github.com/bcoe/yargs/commit/e24cb23798ee64e53b60815e7fda78b87f42390c) more general coffeescript detection (@substack) -- [78ac753](https://github.com/bcoe/yargs/commit/78ac753e5d0ec32a96d39d893272afe989e42a4d) Don't trigger the CoffeeScript hack when running under node_g. (@papandreou) -- [bcfe973](https://github.com/bcoe/yargs/commit/bcfe9731d7f90d4632281b8a52e8d76eb0195ae6) .string() but failing test (@substack) -- [1987aca](https://github.com/bcoe/yargs/commit/1987aca28c7ba4e8796c07bbc547cb984804c826) test hex strings (@substack) -- [ef36db3](https://github.com/bcoe/yargs/commit/ef36db32259b0b0d62448dc907c760e5554fb7e7) more keywords (@substack) -- [cc53c56](https://github.com/bcoe/yargs/commit/cc53c56329960bed6ab077a79798e991711ba01d) Added camelCase function that converts --multi-word-option to camel case (so it becomes argv.multiWordOption). (@papandreou) -- [60b57da](https://github.com/bcoe/yargs/commit/60b57da36797716e5783a633c6d5c79099016d45) fixed boolean bug by rescanning (@substack) -- [dff6d07](https://github.com/bcoe/yargs/commit/dff6d078d97f8ac503c7d18dcc7b7a8c364c2883) boolean examples (@substack) -- [0e380b9](https://github.com/bcoe/yargs/commit/0e380b92c4ef4e3c8dac1da18b5c31d85b1d02c9) boolean() with passing test (@substack) -- [62644d4](https://github.com/bcoe/yargs/commit/62644d4bffbb8d1bbf0c2baf58a1d14a6359ef07) coffee compatibility with node regex for versions too (@substack) -- [430fafc](https://github.com/bcoe/yargs/commit/430fafcf1683d23774772826581acff84b456827) argv._ fixed by fixing the coffee detection (@substack) -- [343b8af](https://github.com/bcoe/yargs/commit/343b8afefd98af274ebe21b5a16b3a949ec5429f) whichNodeArgs test fails too (@substack) -- [63df2f3](https://github.com/bcoe/yargs/commit/63df2f371f31e63d7f1dec2cbf0022a5f08da9d2) replicated mnot's bug in whichNodeEmpty test (@substack) -- [35473a4](https://github.com/bcoe/yargs/commit/35473a4d93a45e5e7e512af8bb54ebb532997ae1) test for ./bin usage (@substack) -- [13df151](https://github.com/bcoe/yargs/commit/13df151e44228eed10e5441c7cd163e086c458a4) don't coerce booleans to numbers (@substack) -- [85f8007](https://github.com/bcoe/yargs/commit/85f8007e93b8be7124feea64b1f1916d8ba1894a) package bump for automatic number conversion (@substack) -- [8f17014](https://github.com/bcoe/yargs/commit/8f170141cded4ccc0c6d67a849c5bf996aa29643) updated readme and examples with new auto-numberification goodness (@substack) -- [73dc901](https://github.com/bcoe/yargs/commit/73dc9011ac968e39b55e19e916084a839391b506) auto number conversion works yay (@substack) -- [bcec56b](https://github.com/bcoe/yargs/commit/bcec56b3d031e018064cbb691539ccc4f28c14ad) failing test for not-implemented auto numification (@substack) -- [ebd2844](https://github.com/bcoe/yargs/commit/ebd2844d683feeac583df79af0e5124a7a7db04e) odd that eql doesn't check types careflly (@substack) -- [fd854b0](https://github.com/bcoe/yargs/commit/fd854b02e512ce854b76386d395672a7969c1bc4) package author + keywords (@substack) -- [656a1d5](https://github.com/bcoe/yargs/commit/656a1d5a1b7c0e49d72e80cb13f20671d56f76c6) updated readme with .default() stuff (@substack) -- [cd7f8c5](https://github.com/bcoe/yargs/commit/cd7f8c55f0b82b79b690d14c5f806851236998a1) passing tests for new .default() behavior (@substack) -- [932725e](https://github.com/bcoe/yargs/commit/932725e39ce65bc91a0385a5fab659a5fa976ac2) new default() thing for setting default key/values (@substack) -- [4e6c7ab](https://github.com/bcoe/yargs/commit/4e6c7aba6374ac9ebc6259ecf91f13af7bce40e3) test for coffee usage (@substack) -- [d54ffcc](https://github.com/bcoe/yargs/commit/d54ffccf2a5a905f51ed5108f7c647f35d64ae23) new --key value style with passing tests. NOTE: changes existing behavior (@substack) -- [ed2a2d5](https://github.com/bcoe/yargs/commit/ed2a2d5d828100ebeef6385c0fb88d146a5cfe9b) package bump for summatix's coffee script fix (@substack) -- [75a975e](https://github.com/bcoe/yargs/commit/75a975eed8430d28e2a79dc9e6d819ad545f4587) Added support for CoffeeScript (@summatix) -- [56b2b1d](https://github.com/bcoe/yargs/commit/56b2b1de8d11f8a2b91979d8ae2d6db02d8fe64d) test coverage for the falsy check() usage (@substack) -- [a4843a9](https://github.com/bcoe/yargs/commit/a4843a9f0e69ffb4afdf6a671d89eb6f218be35d) check bug fixed plus a handy string (@substack) -- [857bd2d](https://github.com/bcoe/yargs/commit/857bd2db933a5aaa9cfecba0ced2dc9b415f8111) tests for demandCount, back up to 100% coverage (@substack) -- [073b776](https://github.com/bcoe/yargs/commit/073b7768ebd781668ef05c13f9003aceca2f5c35) call demandCount from demand (@substack) -- [4bd4b7a](https://github.com/bcoe/yargs/commit/4bd4b7a085c8b6ce1d885a0f486cc9865cee2db1) add demandCount to check for the number of arguments in the _ list (@marshall) -- [b8689ac](https://github.com/bcoe/yargs/commit/b8689ac68dacf248119d242bba39a41cb0adfa07) Rebase checks. That will be its own module eventually. (@substack) -- [e688370](https://github.com/bcoe/yargs/commit/e688370b576f0aa733c3f46183df69e1b561668e) a $0 like in perl (@substack) -- [2e5e196](https://github.com/bcoe/yargs/commit/2e5e1960fc19afb21fb3293752316eaa8bcd3609) usage test hacking around process and console (@substack) -- [fcc3521](https://github.com/bcoe/yargs/commit/fcc352163fbec6a1dfe8caf47a0df39de24fe016) description pun (@substack) -- [87a1fe2](https://github.com/bcoe/yargs/commit/87a1fe29037ca2ca5fefda85141aaeb13e8ce761) mit/x11 license (@substack) -- [8d089d2](https://github.com/bcoe/yargs/commit/8d089d24cd687c0bde3640a96c09b78f884900dd) bool example is more consistent and also shows off short option grouping (@substack) -- [448d747](https://github.com/bcoe/yargs/commit/448d7473ac68e8e03d8befc9457b0d9e21725be0) start of the readme and examples (@substack) -- [da74dea](https://github.com/bcoe/yargs/commit/da74dea799a9b59dbf022cbb8001bfdb0d52eec9) more tests for long and short captures (@substack) -- [ab6387e](https://github.com/bcoe/yargs/commit/ab6387e6769ca4af82ca94c4c67c7319f0d9fcfa) silly bug in the tests with s/not/no/, all tests pass now (@substack) -- [102496a](https://github.com/bcoe/yargs/commit/102496a319e8e06f6550d828fc2f72992c7d9ecc) hack an instance for process.argv onto Argv so the export can be called to create an instance or used for argv, which is the most common case (@substack) -- [a01caeb](https://github.com/bcoe/yargs/commit/a01caeb532546d19f68f2b2b87f7036cfe1aaedd) divide example (@substack) -- [443da55](https://github.com/bcoe/yargs/commit/443da55736acbaf8ff8b04d1b9ce19ab016ddda2) start of the lib with a package.json (@substack) diff --git a/deps/npm/node_modules/yargs/LICENSE b/deps/npm/node_modules/yargs/LICENSE deleted file mode 100644 index 747ab114c9535e..00000000000000 --- a/deps/npm/node_modules/yargs/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -Copyright 2010 James Halliday (mail@substack.net) -Modified work Copyright 2014 Contributors (ben@npmjs.com) - -This project is free software released under the MIT/X11 license: - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/deps/npm/node_modules/yargs/README.md b/deps/npm/node_modules/yargs/README.md deleted file mode 100644 index 679a3eeea9e6bb..00000000000000 --- a/deps/npm/node_modules/yargs/README.md +++ /dev/null @@ -1,136 +0,0 @@ -

    - -

    -

    Yargs

    -

    - Yargs be a node.js library fer hearties tryin' ter parse optstrings -

    - -
    - -[![Build Status][travis-image]][travis-url] -[![Coverage Status][coveralls-image]][coveralls-url] -[![NPM version][npm-image]][npm-url] -[![js-standard-style][standard-image]][standard-url] -[![Conventional Commits][conventional-commits-image]][conventional-commits-url] -[![Slack][slack-image]][slack-url] - -## Description : -Yargs helps you build interactive command line tools, by parsing arguments and generating an elegant user interface. - -It gives you: - -* commands and (grouped) options (`my-program.js serve --port=5000`). -* a dynamically generated help menu based on your arguments. - -> - -* bash-completion shortcuts for commands and options. -* and [tons more](/docs/api.md). - -## Installation - -Stable version: -```bash -npm i yargs -``` - -Bleeding edge version with the most recent features: -```bash -npm i yargs@next -``` - -## Usage : - -### Simple Example - -````javascript -#!/usr/bin/env node -const argv = require('yargs').argv - -if (argv.ships > 3 && argv.distance < 53.5) { - console.log('Plunder more riffiwobbles!') -} else { - console.log('Retreat from the xupptumblers!') -} -```` - -```bash -$ ./plunder.js --ships=4 --distance=22 -Plunder more riffiwobbles! - -$ ./plunder.js --ships 12 --distance 98.7 -Retreat from the xupptumblers! -``` - -### Complex Example - -```javascript -#!/usr/bin/env node -require('yargs') // eslint-disable-line - .command('serve [port]', 'start the server', (yargs) => { - yargs - .positional('port', { - describe: 'port to bind on', - default: 5000 - }) - }, (argv) => { - if (argv.verbose) console.info(`start server on :${argv.port}`) - serve(argv.port) - }) - .option('verbose', { - alias: 'v', - type: 'boolean', - description: 'Run with verbose logging' - }) - .argv -``` - -Run the example above with `--help` to see the help for the application. - -## TypeScript - -yargs has type definitions at [@types/yargs][type-definitions]. - -``` -npm i @types/yargs --save-dev -``` - -See usage examples in [docs](/docs/typescript.md). - -## Community : - -Having problems? want to contribute? join our [community slack](http://devtoolscommunity.herokuapp.com). - -## Documentation : - -### Table of Contents - -* [Yargs' API](/docs/api.md) -* [Examples](/docs/examples.md) -* [Parsing Tricks](/docs/tricks.md) - * [Stop the Parser](/docs/tricks.md#stop) - * [Negating Boolean Arguments](/docs/tricks.md#negate) - * [Numbers](/docs/tricks.md#numbers) - * [Arrays](/docs/tricks.md#arrays) - * [Objects](/docs/tricks.md#objects) - * [Quotes](/docs/tricks.md#quotes) -* [Advanced Topics](/docs/advanced.md) - * [Composing Your App Using Commands](/docs/advanced.md#commands) - * [Building Configurable CLI Apps](/docs/advanced.md#configuration) - * [Customizing Yargs' Parser](/docs/advanced.md#customizing) -* [Contributing](/contributing.md) - -[travis-url]: https://travis-ci.org/yargs/yargs -[travis-image]: https://img.shields.io/travis/yargs/yargs/master.svg -[coveralls-url]: https://coveralls.io/github/yargs/yargs -[coveralls-image]: https://img.shields.io/coveralls/yargs/yargs.svg -[npm-url]: https://www.npmjs.com/package/yargs -[npm-image]: https://img.shields.io/npm/v/yargs.svg -[standard-image]: https://img.shields.io/badge/code%20style-standard-brightgreen.svg -[standard-url]: http://standardjs.com/ -[conventional-commits-image]: https://img.shields.io/badge/Conventional%20Commits-1.0.0-yellow.svg -[conventional-commits-url]: https://conventionalcommits.org/ -[slack-image]: http://devtoolscommunity.herokuapp.com/badge.svg -[slack-url]: http://devtoolscommunity.herokuapp.com -[type-definitions]: https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/yargs diff --git a/deps/npm/node_modules/yargs/index.js b/deps/npm/node_modules/yargs/index.js deleted file mode 100644 index 2db543ed3a698e..00000000000000 --- a/deps/npm/node_modules/yargs/index.js +++ /dev/null @@ -1,39 +0,0 @@ -'use strict' -// classic singleton yargs API, to use yargs -// without running as a singleton do: -// require('yargs/yargs')(process.argv.slice(2)) -const yargs = require('./yargs') - -Argv(process.argv.slice(2)) - -module.exports = Argv - -function Argv (processArgs, cwd) { - const argv = yargs(processArgs, cwd, require) - singletonify(argv) - return argv -} - -/* Hack an instance of Argv with process.argv into Argv - so people can do - require('yargs')(['--beeble=1','-z','zizzle']).argv - to parse a list of args and - require('yargs').argv - to get a parsed version of process.argv. -*/ -function singletonify (inst) { - Object.keys(inst).forEach((key) => { - if (key === 'argv') { - Argv.__defineGetter__(key, inst.__lookupGetter__(key)) - } else if (typeof inst[key] === 'function') { - Argv[key] = inst[key].bind(inst) - } else { - Argv.__defineGetter__('$0', () => { - return inst.$0 - }) - Argv.__defineGetter__('parsed', () => { - return inst.parsed - }) - } - }) -} diff --git a/deps/npm/node_modules/yargs/lib/apply-extends.js b/deps/npm/node_modules/yargs/lib/apply-extends.js deleted file mode 100644 index 643c91335a0906..00000000000000 --- a/deps/npm/node_modules/yargs/lib/apply-extends.js +++ /dev/null @@ -1,67 +0,0 @@ - -'use strict' -const fs = require('fs') -const path = require('path') -const YError = require('./yerror') - -let previouslyVisitedConfigs = [] - -function checkForCircularExtends (cfgPath) { - if (previouslyVisitedConfigs.indexOf(cfgPath) > -1) { - throw new YError(`Circular extended configurations: '${cfgPath}'.`) - } -} - -function getPathToDefaultConfig (cwd, pathToExtend) { - return path.resolve(cwd, pathToExtend) -} - -function mergeDeep (config1, config2) { - const target = {} - const isObject = obj => obj && typeof obj === 'object' && !Array.isArray(obj) - Object.assign(target, config1) - for (let key of Object.keys(config2)) { - if (isObject(config2[key]) && isObject(target[key])) { - target[key] = mergeDeep(config1[key], config2[key]) - } else { - target[key] = config2[key] - } - } - return target -} - -function applyExtends (config, cwd, mergeExtends) { - let defaultConfig = {} - - if (Object.prototype.hasOwnProperty.call(config, 'extends')) { - if (typeof config.extends !== 'string') return defaultConfig - const isPath = /\.json|\..*rc$/.test(config.extends) - let pathToDefault = null - if (!isPath) { - try { - pathToDefault = require.resolve(config.extends) - } catch (err) { - // most likely this simply isn't a module. - } - } else { - pathToDefault = getPathToDefaultConfig(cwd, config.extends) - } - // maybe the module uses key for some other reason, - // err on side of caution. - if (!pathToDefault && !isPath) return config - - checkForCircularExtends(pathToDefault) - - previouslyVisitedConfigs.push(pathToDefault) - - defaultConfig = isPath ? JSON.parse(fs.readFileSync(pathToDefault, 'utf8')) : require(config.extends) - delete config.extends - defaultConfig = applyExtends(defaultConfig, path.dirname(pathToDefault), mergeExtends) - } - - previouslyVisitedConfigs = [] - - return mergeExtends ? mergeDeep(defaultConfig, config) : Object.assign({}, defaultConfig, config) -} - -module.exports = applyExtends diff --git a/deps/npm/node_modules/yargs/lib/argsert.js b/deps/npm/node_modules/yargs/lib/argsert.js deleted file mode 100644 index f310b4e7479a68..00000000000000 --- a/deps/npm/node_modules/yargs/lib/argsert.js +++ /dev/null @@ -1,68 +0,0 @@ -'use strict' - -// hoisted due to circular dependency on command. -module.exports = argsert -const command = require('./command')() -const YError = require('./yerror') - -const positionName = ['first', 'second', 'third', 'fourth', 'fifth', 'sixth'] -function argsert (expected, callerArguments, length) { - // TODO: should this eventually raise an exception. - try { - // preface the argument description with "cmd", so - // that we can run it through yargs' command parser. - let position = 0 - let parsed = { demanded: [], optional: [] } - if (typeof expected === 'object') { - length = callerArguments - callerArguments = expected - } else { - parsed = command.parseCommand(`cmd ${expected}`) - } - const args = [].slice.call(callerArguments) - - while (args.length && args[args.length - 1] === undefined) args.pop() - length = length || args.length - - if (length < parsed.demanded.length) { - throw new YError(`Not enough arguments provided. Expected ${parsed.demanded.length} but received ${args.length}.`) - } - - const totalCommands = parsed.demanded.length + parsed.optional.length - if (length > totalCommands) { - throw new YError(`Too many arguments provided. Expected max ${totalCommands} but received ${length}.`) - } - - parsed.demanded.forEach((demanded) => { - const arg = args.shift() - const observedType = guessType(arg) - const matchingTypes = demanded.cmd.filter(type => type === observedType || type === '*') - if (matchingTypes.length === 0) argumentTypeError(observedType, demanded.cmd, position, false) - position += 1 - }) - - parsed.optional.forEach((optional) => { - if (args.length === 0) return - const arg = args.shift() - const observedType = guessType(arg) - const matchingTypes = optional.cmd.filter(type => type === observedType || type === '*') - if (matchingTypes.length === 0) argumentTypeError(observedType, optional.cmd, position, true) - position += 1 - }) - } catch (err) { - console.warn(err.stack) - } -} - -function guessType (arg) { - if (Array.isArray(arg)) { - return 'array' - } else if (arg === null) { - return 'null' - } - return typeof arg -} - -function argumentTypeError (observedType, allowedTypes, position, optional) { - throw new YError(`Invalid ${positionName[position] || 'manyith'} argument. Expected ${allowedTypes.join(' or ')} but received ${observedType}.`) -} diff --git a/deps/npm/node_modules/yargs/lib/command.js b/deps/npm/node_modules/yargs/lib/command.js deleted file mode 100644 index d2a6e4d49355b5..00000000000000 --- a/deps/npm/node_modules/yargs/lib/command.js +++ /dev/null @@ -1,447 +0,0 @@ -'use strict' - -const inspect = require('util').inspect -const isPromise = require('./is-promise') -const { applyMiddleware, commandMiddlewareFactory } = require('./middleware') -const path = require('path') -const Parser = require('yargs-parser') - -const DEFAULT_MARKER = /(^\*)|(^\$0)/ - -// handles parsing positional arguments, -// and populating argv with said positional -// arguments. -module.exports = function command (yargs, usage, validation, globalMiddleware) { - const self = {} - let handlers = {} - let aliasMap = {} - let defaultCommand - globalMiddleware = globalMiddleware || [] - - self.addHandler = function addHandler (cmd, description, builder, handler, commandMiddleware) { - let aliases = [] - const middlewares = commandMiddlewareFactory(commandMiddleware) - handler = handler || (() => {}) - - if (Array.isArray(cmd)) { - aliases = cmd.slice(1) - cmd = cmd[0] - } else if (typeof cmd === 'object') { - let command = (Array.isArray(cmd.command) || typeof cmd.command === 'string') ? cmd.command : moduleName(cmd) - if (cmd.aliases) command = [].concat(command).concat(cmd.aliases) - self.addHandler(command, extractDesc(cmd), cmd.builder, cmd.handler, cmd.middlewares) - return - } - - // allow a module to be provided instead of separate builder and handler - if (typeof builder === 'object' && builder.builder && typeof builder.handler === 'function') { - self.addHandler([cmd].concat(aliases), description, builder.builder, builder.handler, builder.middlewares) - return - } - - // parse positionals out of cmd string - const parsedCommand = self.parseCommand(cmd) - - // remove positional args from aliases only - aliases = aliases.map(alias => self.parseCommand(alias).cmd) - - // check for default and filter out '*'' - let isDefault = false - const parsedAliases = [parsedCommand.cmd].concat(aliases).filter((c) => { - if (DEFAULT_MARKER.test(c)) { - isDefault = true - return false - } - return true - }) - - // standardize on $0 for default command. - if (parsedAliases.length === 0 && isDefault) parsedAliases.push('$0') - - // shift cmd and aliases after filtering out '*' - if (isDefault) { - parsedCommand.cmd = parsedAliases[0] - aliases = parsedAliases.slice(1) - cmd = cmd.replace(DEFAULT_MARKER, parsedCommand.cmd) - } - - // populate aliasMap - aliases.forEach((alias) => { - aliasMap[alias] = parsedCommand.cmd - }) - - if (description !== false) { - usage.command(cmd, description, isDefault, aliases) - } - - handlers[parsedCommand.cmd] = { - original: cmd, - description: description, - handler, - builder: builder || {}, - middlewares: middlewares || [], - demanded: parsedCommand.demanded, - optional: parsedCommand.optional - } - - if (isDefault) defaultCommand = handlers[parsedCommand.cmd] - } - - self.addDirectory = function addDirectory (dir, context, req, callerFile, opts) { - opts = opts || {} - // disable recursion to support nested directories of subcommands - if (typeof opts.recurse !== 'boolean') opts.recurse = false - // exclude 'json', 'coffee' from require-directory defaults - if (!Array.isArray(opts.extensions)) opts.extensions = ['js'] - // allow consumer to define their own visitor function - const parentVisit = typeof opts.visit === 'function' ? opts.visit : o => o - // call addHandler via visitor function - opts.visit = function visit (obj, joined, filename) { - const visited = parentVisit(obj, joined, filename) - // allow consumer to skip modules with their own visitor - if (visited) { - // check for cyclic reference - // each command file path should only be seen once per execution - if (~context.files.indexOf(joined)) return visited - // keep track of visited files in context.files - context.files.push(joined) - self.addHandler(visited) - } - return visited - } - require('require-directory')({ require: req, filename: callerFile }, dir, opts) - } - - // lookup module object from require()d command and derive name - // if module was not require()d and no name given, throw error - function moduleName (obj) { - const mod = require('which-module')(obj) - if (!mod) throw new Error(`No command name given for module: ${inspect(obj)}`) - return commandFromFilename(mod.filename) - } - - // derive command name from filename - function commandFromFilename (filename) { - return path.basename(filename, path.extname(filename)) - } - - function extractDesc (obj) { - for (let keys = ['describe', 'description', 'desc'], i = 0, l = keys.length, test; i < l; i++) { - test = obj[keys[i]] - if (typeof test === 'string' || typeof test === 'boolean') return test - } - return false - } - - self.parseCommand = function parseCommand (cmd) { - const extraSpacesStrippedCommand = cmd.replace(/\s{2,}/g, ' ') - const splitCommand = extraSpacesStrippedCommand.split(/\s+(?![^[]*]|[^<]*>)/) - const bregex = /\.*[\][<>]/g - const parsedCommand = { - cmd: (splitCommand.shift()).replace(bregex, ''), - demanded: [], - optional: [] - } - splitCommand.forEach((cmd, i) => { - let variadic = false - cmd = cmd.replace(/\s/g, '') - if (/\.+[\]>]/.test(cmd) && i === splitCommand.length - 1) variadic = true - if (/^\[/.test(cmd)) { - parsedCommand.optional.push({ - cmd: cmd.replace(bregex, '').split('|'), - variadic - }) - } else { - parsedCommand.demanded.push({ - cmd: cmd.replace(bregex, '').split('|'), - variadic - }) - } - }) - return parsedCommand - } - - self.getCommands = () => Object.keys(handlers).concat(Object.keys(aliasMap)) - - self.getCommandHandlers = () => handlers - - self.hasDefaultCommand = () => !!defaultCommand - - self.runCommand = function runCommand (command, yargs, parsed, commandIndex) { - let aliases = parsed.aliases - const commandHandler = handlers[command] || handlers[aliasMap[command]] || defaultCommand - const currentContext = yargs.getContext() - let numFiles = currentContext.files.length - const parentCommands = currentContext.commands.slice() - - // what does yargs look like after the builder is run? - let innerArgv = parsed.argv - let innerYargs = null - let positionalMap = {} - if (command) { - currentContext.commands.push(command) - currentContext.fullCommands.push(commandHandler.original) - } - if (typeof commandHandler.builder === 'function') { - // a function can be provided, which builds - // up a yargs chain and possibly returns it. - innerYargs = commandHandler.builder(yargs.reset(parsed.aliases)) - if (!innerYargs || (typeof innerYargs._parseArgs !== 'function')) { - innerYargs = yargs - } - if (shouldUpdateUsage(innerYargs)) { - innerYargs.getUsageInstance().usage( - usageFromParentCommandsCommandHandler(parentCommands, commandHandler), - commandHandler.description - ) - } - innerArgv = innerYargs._parseArgs(null, null, true, commandIndex) - aliases = innerYargs.parsed.aliases - } else if (typeof commandHandler.builder === 'object') { - // as a short hand, an object can instead be provided, specifying - // the options that a command takes. - innerYargs = yargs.reset(parsed.aliases) - if (shouldUpdateUsage(innerYargs)) { - innerYargs.getUsageInstance().usage( - usageFromParentCommandsCommandHandler(parentCommands, commandHandler), - commandHandler.description - ) - } - Object.keys(commandHandler.builder).forEach((key) => { - innerYargs.option(key, commandHandler.builder[key]) - }) - innerArgv = innerYargs._parseArgs(null, null, true, commandIndex) - aliases = innerYargs.parsed.aliases - } - - if (!yargs._hasOutput()) { - positionalMap = populatePositionals(commandHandler, innerArgv, currentContext, yargs) - } - - const middlewares = globalMiddleware.slice(0).concat(commandHandler.middlewares || []) - applyMiddleware(innerArgv, yargs, middlewares, true) - - // we apply validation post-hoc, so that custom - // checks get passed populated positional arguments. - if (!yargs._hasOutput()) yargs._runValidation(innerArgv, aliases, positionalMap, yargs.parsed.error) - - if (commandHandler.handler && !yargs._hasOutput()) { - yargs._setHasOutput() - // to simplify the parsing of positionals in commands, - // we temporarily populate '--' rather than _, with arguments - const populateDoubleDash = !!yargs.getOptions().configuration['populate--'] - if (!populateDoubleDash) yargs._copyDoubleDash(innerArgv) - - innerArgv = applyMiddleware(innerArgv, yargs, middlewares, false) - let handlerResult - if (isPromise(innerArgv)) { - handlerResult = innerArgv.then(argv => commandHandler.handler(argv)) - } else { - handlerResult = commandHandler.handler(innerArgv) - } - - if (isPromise(handlerResult)) { - yargs.getUsageInstance().cacheHelpMessage() - handlerResult.catch(error => { - try { - yargs.getUsageInstance().fail(null, error) - } catch (err) { - // fail's throwing would cause an unhandled rejection. - } - }) - } - } - - if (command) { - currentContext.commands.pop() - currentContext.fullCommands.pop() - } - numFiles = currentContext.files.length - numFiles - if (numFiles > 0) currentContext.files.splice(numFiles * -1, numFiles) - - return innerArgv - } - - function shouldUpdateUsage (yargs) { - return !yargs.getUsageInstance().getUsageDisabled() && - yargs.getUsageInstance().getUsage().length === 0 - } - - function usageFromParentCommandsCommandHandler (parentCommands, commandHandler) { - const c = DEFAULT_MARKER.test(commandHandler.original) ? commandHandler.original.replace(DEFAULT_MARKER, '').trim() : commandHandler.original - const pc = parentCommands.filter((c) => { return !DEFAULT_MARKER.test(c) }) - pc.push(c) - return `$0 ${pc.join(' ')}` - } - - self.runDefaultBuilderOn = function (yargs) { - if (shouldUpdateUsage(yargs)) { - // build the root-level command string from the default string. - const commandString = DEFAULT_MARKER.test(defaultCommand.original) - ? defaultCommand.original : defaultCommand.original.replace(/^[^[\]<>]*/, '$0 ') - yargs.getUsageInstance().usage( - commandString, - defaultCommand.description - ) - } - const builder = defaultCommand.builder - if (typeof builder === 'function') { - builder(yargs) - } else { - Object.keys(builder).forEach((key) => { - yargs.option(key, builder[key]) - }) - } - } - - // transcribe all positional arguments "command [apple]" - // onto argv. - function populatePositionals (commandHandler, argv, context, yargs) { - argv._ = argv._.slice(context.commands.length) // nuke the current commands - const demanded = commandHandler.demanded.slice(0) - const optional = commandHandler.optional.slice(0) - const positionalMap = {} - - validation.positionalCount(demanded.length, argv._.length) - - while (demanded.length) { - const demand = demanded.shift() - populatePositional(demand, argv, positionalMap) - } - - while (optional.length) { - const maybe = optional.shift() - populatePositional(maybe, argv, positionalMap) - } - - argv._ = context.commands.concat(argv._) - - postProcessPositionals(argv, positionalMap, self.cmdToParseOptions(commandHandler.original)) - - return positionalMap - } - - function populatePositional (positional, argv, positionalMap, parseOptions) { - const cmd = positional.cmd[0] - if (positional.variadic) { - positionalMap[cmd] = argv._.splice(0).map(String) - } else { - if (argv._.length) positionalMap[cmd] = [String(argv._.shift())] - } - } - - // we run yargs-parser against the positional arguments - // applying the same parsing logic used for flags. - function postProcessPositionals (argv, positionalMap, parseOptions) { - // combine the parsing hints we've inferred from the command - // string with explicitly configured parsing hints. - const options = Object.assign({}, yargs.getOptions()) - options.default = Object.assign(parseOptions.default, options.default) - options.alias = Object.assign(parseOptions.alias, options.alias) - options.array = options.array.concat(parseOptions.array) - delete options.config // don't load config when processing positionals. - - const unparsed = [] - Object.keys(positionalMap).forEach((key) => { - positionalMap[key].map((value) => { - unparsed.push(`--${key}`) - unparsed.push(value) - }) - }) - - // short-circuit parse. - if (!unparsed.length) return - - const config = Object.assign({}, options.configuration, { - 'populate--': true - }) - const parsed = Parser.detailed(unparsed, Object.assign({}, options, { - configuration: config - })) - - if (parsed.error) { - yargs.getUsageInstance().fail(parsed.error.message, parsed.error) - } else { - // only copy over positional keys (don't overwrite - // flag arguments that were already parsed). - const positionalKeys = Object.keys(positionalMap) - Object.keys(positionalMap).forEach((key) => { - [].push.apply(positionalKeys, parsed.aliases[key]) - }) - - Object.keys(parsed.argv).forEach((key) => { - if (positionalKeys.indexOf(key) !== -1) { - // any new aliases need to be placed in positionalMap, which - // is used for validation. - if (!positionalMap[key]) positionalMap[key] = parsed.argv[key] - argv[key] = parsed.argv[key] - } - }) - } - } - - self.cmdToParseOptions = function (cmdString) { - const parseOptions = { - array: [], - default: {}, - alias: {}, - demand: {} - } - - const parsed = self.parseCommand(cmdString) - parsed.demanded.forEach((d) => { - const cmds = d.cmd.slice(0) - const cmd = cmds.shift() - if (d.variadic) { - parseOptions.array.push(cmd) - parseOptions.default[cmd] = [] - } - cmds.forEach((c) => { - parseOptions.alias[cmd] = c - }) - parseOptions.demand[cmd] = true - }) - - parsed.optional.forEach((o) => { - const cmds = o.cmd.slice(0) - const cmd = cmds.shift() - if (o.variadic) { - parseOptions.array.push(cmd) - parseOptions.default[cmd] = [] - } - cmds.forEach((c) => { - parseOptions.alias[cmd] = c - }) - }) - - return parseOptions - } - - self.reset = () => { - handlers = {} - aliasMap = {} - defaultCommand = undefined - return self - } - - // used by yargs.parse() to freeze - // the state of commands such that - // we can apply .parse() multiple times - // with the same yargs instance. - let frozens = [] - self.freeze = () => { - let frozen = {} - frozens.push(frozen) - frozen.handlers = handlers - frozen.aliasMap = aliasMap - frozen.defaultCommand = defaultCommand - } - self.unfreeze = () => { - let frozen = frozens.pop() - handlers = frozen.handlers - aliasMap = frozen.aliasMap - defaultCommand = frozen.defaultCommand - } - - return self -} diff --git a/deps/npm/node_modules/yargs/lib/completion-templates.js b/deps/npm/node_modules/yargs/lib/completion-templates.js deleted file mode 100644 index 43714fb6ed96a3..00000000000000 --- a/deps/npm/node_modules/yargs/lib/completion-templates.js +++ /dev/null @@ -1,49 +0,0 @@ -exports.completionShTemplate = -`###-begin-{{app_name}}-completions-### -# -# yargs command completion script -# -# Installation: {{app_path}} {{completion_command}} >> ~/.bashrc -# or {{app_path}} {{completion_command}} >> ~/.bash_profile on OSX. -# -_yargs_completions() -{ - local cur_word args type_list - - cur_word="\${COMP_WORDS[COMP_CWORD]}" - args=("\${COMP_WORDS[@]}") - - # ask yargs to generate completions. - type_list=$({{app_path}} --get-yargs-completions "\${args[@]}") - - COMPREPLY=( $(compgen -W "\${type_list}" -- \${cur_word}) ) - - # if no match was found, fall back to filename completion - if [ \${#COMPREPLY[@]} -eq 0 ]; then - COMPREPLY=() - fi - - return 0 -} -complete -o default -F _yargs_completions {{app_name}} -###-end-{{app_name}}-completions-### -` - -exports.completionZshTemplate = `###-begin-{{app_name}}-completions-### -# -# yargs command completion script -# -# Installation: {{app_path}} {{completion_command}} >> ~/.zshrc -# or {{app_path}} {{completion_command}} >> ~/.zsh_profile on OSX. -# -_{{app_name}}_yargs_completions() -{ - local reply - local si=$IFS - IFS=$'\n' reply=($(COMP_CWORD="$((CURRENT-1))" COMP_LINE="$BUFFER" COMP_POINT="$CURSOR" {{app_path}} --get-yargs-completions "\${words[@]}")) - IFS=$si - _describe 'values' reply -} -compdef _{{app_name}}_yargs_completions {{app_name}} -###-end-{{app_name}}-completions-### -` diff --git a/deps/npm/node_modules/yargs/lib/completion.js b/deps/npm/node_modules/yargs/lib/completion.js deleted file mode 100644 index 3f3bf16e1c9384..00000000000000 --- a/deps/npm/node_modules/yargs/lib/completion.js +++ /dev/null @@ -1,116 +0,0 @@ -'use strict' -const path = require('path') - -// add bash completions to your -// yargs-powered applications. -module.exports = function completion (yargs, usage, command) { - const self = { - completionKey: 'get-yargs-completions' - } - - const zshShell = (process.env.SHELL && process.env.SHELL.indexOf('zsh') !== -1) || - (process.env.ZSH_NAME && process.env.ZSH_NAME.indexOf('zsh') !== -1) - // get a list of completion commands. - // 'args' is the array of strings from the line to be completed - self.getCompletion = function getCompletion (args, done) { - const completions = [] - const current = args.length ? args[args.length - 1] : '' - const argv = yargs.parse(args, true) - const aliases = yargs.parsed.aliases - const parentCommands = yargs.getContext().commands - - // a custom completion function can be provided - // to completion(). - if (completionFunction) { - if (completionFunction.length < 3) { - const result = completionFunction(current, argv) - - // promise based completion function. - if (typeof result.then === 'function') { - return result.then((list) => { - process.nextTick(() => { done(list) }) - }).catch((err) => { - process.nextTick(() => { throw err }) - }) - } - - // synchronous completion function. - return done(result) - } else { - // asynchronous completion function - return completionFunction(current, argv, (completions) => { - done(completions) - }) - } - } - - const handlers = command.getCommandHandlers() - for (let i = 0, ii = args.length; i < ii; ++i) { - if (handlers[args[i]] && handlers[args[i]].builder) { - const builder = handlers[args[i]].builder - if (typeof builder === 'function') { - const y = yargs.reset() - builder(y) - return y.argv - } - } - } - - if (!current.match(/^-/) && parentCommands[parentCommands.length - 1] !== current) { - usage.getCommands().forEach((usageCommand) => { - const commandName = command.parseCommand(usageCommand[0]).cmd - if (args.indexOf(commandName) === -1) { - if (!zshShell) { - completions.push(commandName) - } else { - const desc = usageCommand[1] || '' - completions.push(commandName.replace(/:/g, '\\:') + ':' + desc) - } - } - }) - } - - if (current.match(/^-/) || (current === '' && completions.length === 0)) { - const descs = usage.getDescriptions() - Object.keys(yargs.getOptions().key).forEach((key) => { - // If the key and its aliases aren't in 'args', add the key to 'completions' - const keyAndAliases = [key].concat(aliases[key] || []) - const notInArgs = keyAndAliases.every(val => args.indexOf(`--${val}`) === -1) - if (notInArgs) { - if (!zshShell) { - completions.push(`--${key}`) - } else { - const desc = descs[key] || '' - completions.push(`--${key.replace(/:/g, '\\:')}:${desc.replace('__yargsString__:', '')}`) - } - } - }) - } - - done(completions) - } - - // generate the completion script to add to your .bashrc. - self.generateCompletionScript = function generateCompletionScript ($0, cmd) { - const templates = require('./completion-templates') - let script = zshShell ? templates.completionZshTemplate : templates.completionShTemplate - const name = path.basename($0) - - // add ./to applications not yet installed as bin. - if ($0.match(/\.js$/)) $0 = `./${$0}` - - script = script.replace(/{{app_name}}/g, name) - script = script.replace(/{{completion_command}}/g, cmd) - return script.replace(/{{app_path}}/g, $0) - } - - // register a function to perform your own custom - // completions., this function can be either - // synchrnous or asynchronous. - let completionFunction = null - self.registerFunction = (fn) => { - completionFunction = fn - } - - return self -} diff --git a/deps/npm/node_modules/yargs/lib/is-promise.js b/deps/npm/node_modules/yargs/lib/is-promise.js deleted file mode 100644 index 271d93b2d121a2..00000000000000 --- a/deps/npm/node_modules/yargs/lib/is-promise.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = function isPromise (maybePromise) { - return !!maybePromise && !!maybePromise.then && (typeof maybePromise.then === 'function') -} diff --git a/deps/npm/node_modules/yargs/lib/levenshtein.js b/deps/npm/node_modules/yargs/lib/levenshtein.js deleted file mode 100644 index c66c1babbc3d92..00000000000000 --- a/deps/npm/node_modules/yargs/lib/levenshtein.js +++ /dev/null @@ -1,58 +0,0 @@ -/* -Copyright (c) 2011 Andrei Mackenzie - -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. -*/ - -// levenshtein distance algorithm, pulled from Andrei Mackenzie's MIT licensed. -// gist, which can be found here: https://gist.github.com/andrei-m/982927 -'use strict' -// Compute the edit distance between the two given strings -module.exports = function levenshtein (a, b) { - if (a.length === 0) return b.length - if (b.length === 0) return a.length - - const matrix = [] - - // increment along the first column of each row - let i - for (i = 0; i <= b.length; i++) { - matrix[i] = [i] - } - - // increment each column in the first row - let j - for (j = 0; j <= a.length; j++) { - matrix[0][j] = j - } - - // Fill in the rest of the matrix - for (i = 1; i <= b.length; i++) { - for (j = 1; j <= a.length; j++) { - if (b.charAt(i - 1) === a.charAt(j - 1)) { - matrix[i][j] = matrix[i - 1][j - 1] - } else { - matrix[i][j] = Math.min(matrix[i - 1][j - 1] + 1, // substitution - Math.min(matrix[i][j - 1] + 1, // insertion - matrix[i - 1][j] + 1)) // deletion - } - } - } - - return matrix[b.length][a.length] -} diff --git a/deps/npm/node_modules/yargs/lib/middleware.js b/deps/npm/node_modules/yargs/lib/middleware.js deleted file mode 100644 index 56dab75277b470..00000000000000 --- a/deps/npm/node_modules/yargs/lib/middleware.js +++ /dev/null @@ -1,64 +0,0 @@ -'use strict' - -// hoisted due to circular dependency on command. -module.exports = { - applyMiddleware, - commandMiddlewareFactory, - globalMiddlewareFactory -} -const isPromise = require('./is-promise') -const argsert = require('./argsert') - -function globalMiddlewareFactory (globalMiddleware, context) { - return function (callback, applyBeforeValidation = false) { - argsert(' [boolean]', [callback, applyBeforeValidation], arguments.length) - if (Array.isArray(callback)) { - for (let i = 0; i < callback.length; i++) { - if (typeof callback[i] !== 'function') { - throw Error('middleware must be a function') - } - callback[i].applyBeforeValidation = applyBeforeValidation - } - Array.prototype.push.apply(globalMiddleware, callback) - } else if (typeof callback === 'function') { - callback.applyBeforeValidation = applyBeforeValidation - globalMiddleware.push(callback) - } - return context - } -} - -function commandMiddlewareFactory (commandMiddleware) { - if (!commandMiddleware) return [] - return commandMiddleware.map(middleware => { - middleware.applyBeforeValidation = false - return middleware - }) -} - -function applyMiddleware (argv, yargs, middlewares, beforeValidation) { - const beforeValidationError = new Error('middleware cannot return a promise when applyBeforeValidation is true') - return middlewares - .reduce((accumulation, middleware) => { - if (middleware.applyBeforeValidation !== beforeValidation) { - return accumulation - } - - if (isPromise(accumulation)) { - return accumulation - .then(initialObj => - Promise.all([initialObj, middleware(initialObj, yargs)]) - ) - .then(([initialObj, middlewareObj]) => - Object.assign(initialObj, middlewareObj) - ) - } else { - const result = middleware(argv, yargs) - if (beforeValidation && isPromise(result)) throw beforeValidationError - - return isPromise(result) - ? result.then(middlewareObj => Object.assign(accumulation, middlewareObj)) - : Object.assign(accumulation, result) - } - }, argv) -} diff --git a/deps/npm/node_modules/yargs/lib/obj-filter.js b/deps/npm/node_modules/yargs/lib/obj-filter.js deleted file mode 100644 index c344ac58cacadb..00000000000000 --- a/deps/npm/node_modules/yargs/lib/obj-filter.js +++ /dev/null @@ -1,11 +0,0 @@ -'use strict' -module.exports = function objFilter (original, filter) { - const obj = {} - filter = filter || ((k, v) => true) - Object.keys(original || {}).forEach((key) => { - if (filter(key, original[key])) { - obj[key] = original[key] - } - }) - return obj -} diff --git a/deps/npm/node_modules/yargs/lib/usage.js b/deps/npm/node_modules/yargs/lib/usage.js deleted file mode 100644 index 92bf378620c5c9..00000000000000 --- a/deps/npm/node_modules/yargs/lib/usage.js +++ /dev/null @@ -1,549 +0,0 @@ -'use strict' -// this file handles outputting usage instructions, -// failures, etc. keeps logging in one place. -const decamelize = require('decamelize') -const stringWidth = require('string-width') -const objFilter = require('./obj-filter') -const path = require('path') -const setBlocking = require('set-blocking') -const YError = require('./yerror') - -module.exports = function usage (yargs, y18n) { - const __ = y18n.__ - const self = {} - - // methods for ouputting/building failure message. - const fails = [] - self.failFn = function failFn (f) { - fails.push(f) - } - - let failMessage = null - let showHelpOnFail = true - self.showHelpOnFail = function showHelpOnFailFn (enabled, message) { - if (typeof enabled === 'string') { - message = enabled - enabled = true - } else if (typeof enabled === 'undefined') { - enabled = true - } - failMessage = message - showHelpOnFail = enabled - return self - } - - let failureOutput = false - self.fail = function fail (msg, err) { - const logger = yargs._getLoggerInstance() - - if (fails.length) { - for (let i = fails.length - 1; i >= 0; --i) { - fails[i](msg, err, self) - } - } else { - if (yargs.getExitProcess()) setBlocking(true) - - // don't output failure message more than once - if (!failureOutput) { - failureOutput = true - if (showHelpOnFail) { - yargs.showHelp('error') - logger.error() - } - if (msg || err) logger.error(msg || err) - if (failMessage) { - if (msg || err) logger.error('') - logger.error(failMessage) - } - } - - err = err || new YError(msg) - if (yargs.getExitProcess()) { - return yargs.exit(1) - } else if (yargs._hasParseCallback()) { - return yargs.exit(1, err) - } else { - throw err - } - } - } - - // methods for ouputting/building help (usage) message. - let usages = [] - let usageDisabled = false - self.usage = (msg, description) => { - if (msg === null) { - usageDisabled = true - usages = [] - return - } - usageDisabled = false - usages.push([msg, description || '']) - return self - } - self.getUsage = () => { - return usages - } - self.getUsageDisabled = () => { - return usageDisabled - } - - self.getPositionalGroupName = () => { - return __('Positionals:') - } - - let examples = [] - self.example = (cmd, description) => { - examples.push([cmd, description || '']) - } - - let commands = [] - self.command = function command (cmd, description, isDefault, aliases) { - // the last default wins, so cancel out any previously set default - if (isDefault) { - commands = commands.map((cmdArray) => { - cmdArray[2] = false - return cmdArray - }) - } - commands.push([cmd, description || '', isDefault, aliases]) - } - self.getCommands = () => commands - - let descriptions = {} - self.describe = function describe (key, desc) { - if (typeof key === 'object') { - Object.keys(key).forEach((k) => { - self.describe(k, key[k]) - }) - } else { - descriptions[key] = desc - } - } - self.getDescriptions = () => descriptions - - let epilogs = [] - self.epilog = (msg) => { - epilogs.push(msg) - } - - let wrapSet = false - let wrap - self.wrap = (cols) => { - wrapSet = true - wrap = cols - } - - function getWrap () { - if (!wrapSet) { - wrap = windowWidth() - wrapSet = true - } - - return wrap - } - - const deferY18nLookupPrefix = '__yargsString__:' - self.deferY18nLookup = str => deferY18nLookupPrefix + str - - const defaultGroup = 'Options:' - self.help = function help () { - if (cachedHelpMessage) return cachedHelpMessage - normalizeAliases() - - // handle old demanded API - const base$0 = yargs.customScriptName ? yargs.$0 : path.basename(yargs.$0) - const demandedOptions = yargs.getDemandedOptions() - const demandedCommands = yargs.getDemandedCommands() - const groups = yargs.getGroups() - const options = yargs.getOptions() - - let keys = [] - keys = keys.concat(Object.keys(descriptions)) - keys = keys.concat(Object.keys(demandedOptions)) - keys = keys.concat(Object.keys(demandedCommands)) - keys = keys.concat(Object.keys(options.default)) - keys = keys.filter(filterHiddenOptions) - keys = Object.keys(keys.reduce((acc, key) => { - if (key !== '_') acc[key] = true - return acc - }, {})) - - const theWrap = getWrap() - const ui = require('cliui')({ - width: theWrap, - wrap: !!theWrap - }) - - // the usage string. - if (!usageDisabled) { - if (usages.length) { - // user-defined usage. - usages.forEach((usage) => { - ui.div(`${usage[0].replace(/\$0/g, base$0)}`) - if (usage[1]) { - ui.div({ text: `${usage[1]}`, padding: [1, 0, 0, 0] }) - } - }) - ui.div() - } else if (commands.length) { - let u = null - // demonstrate how commands are used. - if (demandedCommands._) { - u = `${base$0} <${__('command')}>\n` - } else { - u = `${base$0} [${__('command')}]\n` - } - ui.div(`${u}`) - } - } - - // your application's commands, i.e., non-option - // arguments populated in '_'. - if (commands.length) { - ui.div(__('Commands:')) - - const context = yargs.getContext() - const parentCommands = context.commands.length ? `${context.commands.join(' ')} ` : '' - - if (yargs.getParserConfiguration()['sort-commands'] === true) { - commands = commands.sort((a, b) => a[0].localeCompare(b[0])) - } - - commands.forEach((command) => { - const commandString = `${base$0} ${parentCommands}${command[0].replace(/^\$0 ?/, '')}` // drop $0 from default commands. - ui.span( - { - text: commandString, - padding: [0, 2, 0, 2], - width: maxWidth(commands, theWrap, `${base$0}${parentCommands}`) + 4 - }, - { text: command[1] } - ) - const hints = [] - if (command[2]) hints.push(`[${__('default:').slice(0, -1)}]`) // TODO hacking around i18n here - if (command[3] && command[3].length) { - hints.push(`[${__('aliases:')} ${command[3].join(', ')}]`) - } - if (hints.length) { - ui.div({ text: hints.join(' '), padding: [0, 0, 0, 2], align: 'right' }) - } else { - ui.div() - } - }) - - ui.div() - } - - // perform some cleanup on the keys array, making it - // only include top-level keys not their aliases. - const aliasKeys = (Object.keys(options.alias) || []) - .concat(Object.keys(yargs.parsed.newAliases) || []) - - keys = keys.filter(key => !yargs.parsed.newAliases[key] && aliasKeys.every(alias => (options.alias[alias] || []).indexOf(key) === -1)) - - // populate 'Options:' group with any keys that have not - // explicitly had a group set. - if (!groups[defaultGroup]) groups[defaultGroup] = [] - addUngroupedKeys(keys, options.alias, groups) - - // display 'Options:' table along with any custom tables: - Object.keys(groups).forEach((groupName) => { - if (!groups[groupName].length) return - - // if we've grouped the key 'f', but 'f' aliases 'foobar', - // normalizedKeys should contain only 'foobar'. - const normalizedKeys = groups[groupName].filter(filterHiddenOptions).map((key) => { - if (~aliasKeys.indexOf(key)) return key - for (let i = 0, aliasKey; (aliasKey = aliasKeys[i]) !== undefined; i++) { - if (~(options.alias[aliasKey] || []).indexOf(key)) return aliasKey - } - return key - }) - - if (normalizedKeys.length < 1) return - - ui.div(__(groupName)) - - // actually generate the switches string --foo, -f, --bar. - const switches = normalizedKeys.reduce((acc, key) => { - acc[key] = [ key ].concat(options.alias[key] || []) - .map(sw => { - // for the special positional group don't - // add '--' or '-' prefix. - if (groupName === self.getPositionalGroupName()) return sw - else return (sw.length > 1 ? '--' : '-') + sw - }) - .join(', ') - - return acc - }, {}) - - normalizedKeys.forEach((key) => { - const kswitch = switches[key] - let desc = descriptions[key] || '' - let type = null - - if (~desc.lastIndexOf(deferY18nLookupPrefix)) desc = __(desc.substring(deferY18nLookupPrefix.length)) - - if (~options.boolean.indexOf(key)) type = `[${__('boolean')}]` - if (~options.count.indexOf(key)) type = `[${__('count')}]` - if (~options.string.indexOf(key)) type = `[${__('string')}]` - if (~options.normalize.indexOf(key)) type = `[${__('string')}]` - if (~options.array.indexOf(key)) type = `[${__('array')}]` - if (~options.number.indexOf(key)) type = `[${__('number')}]` - - const extra = [ - type, - (key in demandedOptions) ? `[${__('required')}]` : null, - options.choices && options.choices[key] ? `[${__('choices:')} ${ - self.stringifiedValues(options.choices[key])}]` : null, - defaultString(options.default[key], options.defaultDescription[key]) - ].filter(Boolean).join(' ') - - ui.span( - { text: kswitch, padding: [0, 2, 0, 2], width: maxWidth(switches, theWrap) + 4 }, - desc - ) - - if (extra) ui.div({ text: extra, padding: [0, 0, 0, 2], align: 'right' }) - else ui.div() - }) - - ui.div() - }) - - // describe some common use-cases for your application. - if (examples.length) { - ui.div(__('Examples:')) - - examples.forEach((example) => { - example[0] = example[0].replace(/\$0/g, base$0) - }) - - examples.forEach((example) => { - if (example[1] === '') { - ui.div( - { - text: example[0], - padding: [0, 2, 0, 2] - } - ) - } else { - ui.div( - { - text: example[0], - padding: [0, 2, 0, 2], - width: maxWidth(examples, theWrap) + 4 - }, { - text: example[1] - } - ) - } - }) - - ui.div() - } - - // the usage string. - if (epilogs.length > 0) { - const e = epilogs.map(epilog => epilog.replace(/\$0/g, base$0)).join('\n') - ui.div(`${e}\n`) - } - - // Remove the trailing white spaces - return ui.toString().replace(/\s*$/, '') - } - - // return the maximum width of a string - // in the left-hand column of a table. - function maxWidth (table, theWrap, modifier) { - let width = 0 - - // table might be of the form [leftColumn], - // or {key: leftColumn} - if (!Array.isArray(table)) { - table = Object.keys(table).map(key => [table[key]]) - } - - table.forEach((v) => { - width = Math.max( - stringWidth(modifier ? `${modifier} ${v[0]}` : v[0]), - width - ) - }) - - // if we've enabled 'wrap' we should limit - // the max-width of the left-column. - if (theWrap) width = Math.min(width, parseInt(theWrap * 0.5, 10)) - - return width - } - - // make sure any options set for aliases, - // are copied to the keys being aliased. - function normalizeAliases () { - // handle old demanded API - const demandedOptions = yargs.getDemandedOptions() - const options = yargs.getOptions() - - ;(Object.keys(options.alias) || []).forEach((key) => { - options.alias[key].forEach((alias) => { - // copy descriptions. - if (descriptions[alias]) self.describe(key, descriptions[alias]) - // copy demanded. - if (alias in demandedOptions) yargs.demandOption(key, demandedOptions[alias]) - // type messages. - if (~options.boolean.indexOf(alias)) yargs.boolean(key) - if (~options.count.indexOf(alias)) yargs.count(key) - if (~options.string.indexOf(alias)) yargs.string(key) - if (~options.normalize.indexOf(alias)) yargs.normalize(key) - if (~options.array.indexOf(alias)) yargs.array(key) - if (~options.number.indexOf(alias)) yargs.number(key) - }) - }) - } - - // if yargs is executing an async handler, we take a snapshot of the - // help message to display on failure: - let cachedHelpMessage - self.cacheHelpMessage = function () { - cachedHelpMessage = this.help() - } - - // given a set of keys, place any keys that are - // ungrouped under the 'Options:' grouping. - function addUngroupedKeys (keys, aliases, groups) { - let groupedKeys = [] - let toCheck = null - Object.keys(groups).forEach((group) => { - groupedKeys = groupedKeys.concat(groups[group]) - }) - - keys.forEach((key) => { - toCheck = [key].concat(aliases[key]) - if (!toCheck.some(k => groupedKeys.indexOf(k) !== -1)) { - groups[defaultGroup].push(key) - } - }) - return groupedKeys - } - - function filterHiddenOptions (key) { - return yargs.getOptions().hiddenOptions.indexOf(key) < 0 || yargs.parsed.argv[yargs.getOptions().showHiddenOpt] - } - - self.showHelp = (level) => { - const logger = yargs._getLoggerInstance() - if (!level) level = 'error' - const emit = typeof level === 'function' ? level : logger[level] - emit(self.help()) - } - - self.functionDescription = (fn) => { - const description = fn.name ? decamelize(fn.name, '-') : __('generated-value') - return ['(', description, ')'].join('') - } - - self.stringifiedValues = function stringifiedValues (values, separator) { - let string = '' - const sep = separator || ', ' - const array = [].concat(values) - - if (!values || !array.length) return string - - array.forEach((value) => { - if (string.length) string += sep - string += JSON.stringify(value) - }) - - return string - } - - // format the default-value-string displayed in - // the right-hand column. - function defaultString (value, defaultDescription) { - let string = `[${__('default:')} ` - - if (value === undefined && !defaultDescription) return null - - if (defaultDescription) { - string += defaultDescription - } else { - switch (typeof value) { - case 'string': - string += `"${value}"` - break - case 'object': - string += JSON.stringify(value) - break - default: - string += value - } - } - - return `${string}]` - } - - // guess the width of the console window, max-width 80. - function windowWidth () { - const maxWidth = 80 - if (typeof process === 'object' && process.stdout && process.stdout.columns) { - return Math.min(maxWidth, process.stdout.columns) - } else { - return maxWidth - } - } - - // logic for displaying application version. - let version = null - self.version = (ver) => { - version = ver - } - - self.showVersion = () => { - const logger = yargs._getLoggerInstance() - logger.log(version) - } - - self.reset = function reset (localLookup) { - // do not reset wrap here - // do not reset fails here - failMessage = null - failureOutput = false - usages = [] - usageDisabled = false - epilogs = [] - examples = [] - commands = [] - descriptions = objFilter(descriptions, (k, v) => !localLookup[k]) - return self - } - - let frozens = [] - self.freeze = function freeze () { - let frozen = {} - frozens.push(frozen) - frozen.failMessage = failMessage - frozen.failureOutput = failureOutput - frozen.usages = usages - frozen.usageDisabled = usageDisabled - frozen.epilogs = epilogs - frozen.examples = examples - frozen.commands = commands - frozen.descriptions = descriptions - } - self.unfreeze = function unfreeze () { - let frozen = frozens.pop() - failMessage = frozen.failMessage - failureOutput = frozen.failureOutput - usages = frozen.usages - usageDisabled = frozen.usageDisabled - epilogs = frozen.epilogs - examples = frozen.examples - commands = frozen.commands - descriptions = frozen.descriptions - } - - return self -} diff --git a/deps/npm/node_modules/yargs/lib/validation.js b/deps/npm/node_modules/yargs/lib/validation.js deleted file mode 100644 index 35659a356b8101..00000000000000 --- a/deps/npm/node_modules/yargs/lib/validation.js +++ /dev/null @@ -1,350 +0,0 @@ -'use strict' -const argsert = require('./argsert') -const objFilter = require('./obj-filter') -const specialKeys = ['$0', '--', '_'] - -// validation-type-stuff, missing params, -// bad implications, custom checks. -module.exports = function validation (yargs, usage, y18n) { - const __ = y18n.__ - const __n = y18n.__n - const self = {} - - // validate appropriate # of non-option - // arguments were provided, i.e., '_'. - self.nonOptionCount = function nonOptionCount (argv) { - const demandedCommands = yargs.getDemandedCommands() - // don't count currently executing commands - const _s = argv._.length - yargs.getContext().commands.length - - if (demandedCommands._ && (_s < demandedCommands._.min || _s > demandedCommands._.max)) { - if (_s < demandedCommands._.min) { - if (demandedCommands._.minMsg !== undefined) { - usage.fail( - // replace $0 with observed, $1 with expected. - demandedCommands._.minMsg ? demandedCommands._.minMsg.replace(/\$0/g, _s).replace(/\$1/, demandedCommands._.min) : null - ) - } else { - usage.fail( - __('Not enough non-option arguments: got %s, need at least %s', _s, demandedCommands._.min) - ) - } - } else if (_s > demandedCommands._.max) { - if (demandedCommands._.maxMsg !== undefined) { - usage.fail( - // replace $0 with observed, $1 with expected. - demandedCommands._.maxMsg ? demandedCommands._.maxMsg.replace(/\$0/g, _s).replace(/\$1/, demandedCommands._.max) : null - ) - } else { - usage.fail( - __('Too many non-option arguments: got %s, maximum of %s', _s, demandedCommands._.max) - ) - } - } - } - } - - // validate the appropriate # of - // positional arguments were provided: - self.positionalCount = function positionalCount (required, observed) { - if (observed < required) { - usage.fail( - __('Not enough non-option arguments: got %s, need at least %s', observed, required) - ) - } - } - - // make sure all the required arguments are present. - self.requiredArguments = function requiredArguments (argv) { - const demandedOptions = yargs.getDemandedOptions() - let missing = null - - Object.keys(demandedOptions).forEach((key) => { - if (!argv.hasOwnProperty(key) || typeof argv[key] === 'undefined') { - missing = missing || {} - missing[key] = demandedOptions[key] - } - }) - - if (missing) { - const customMsgs = [] - Object.keys(missing).forEach((key) => { - const msg = missing[key] - if (msg && customMsgs.indexOf(msg) < 0) { - customMsgs.push(msg) - } - }) - - const customMsg = customMsgs.length ? `\n${customMsgs.join('\n')}` : '' - - usage.fail(__n( - 'Missing required argument: %s', - 'Missing required arguments: %s', - Object.keys(missing).length, - Object.keys(missing).join(', ') + customMsg - )) - } - } - - // check for unknown arguments (strict-mode). - self.unknownArguments = function unknownArguments (argv, aliases, positionalMap) { - const commandKeys = yargs.getCommandInstance().getCommands() - const unknown = [] - const currentContext = yargs.getContext() - - Object.keys(argv).forEach((key) => { - if (specialKeys.indexOf(key) === -1 && - !positionalMap.hasOwnProperty(key) && - !yargs._getParseContext().hasOwnProperty(key) && - !self.isValidAndSomeAliasIsNotNew(key, aliases) - ) { - unknown.push(key) - } - }) - - if ((currentContext.commands.length > 0) || (commandKeys.length > 0)) { - argv._.slice(currentContext.commands.length).forEach((key) => { - if (commandKeys.indexOf(key) === -1) { - unknown.push(key) - } - }) - } - - if (unknown.length > 0) { - usage.fail(__n( - 'Unknown argument: %s', - 'Unknown arguments: %s', - unknown.length, - unknown.join(', ') - )) - } - } - - // check for a key that is not an alias, or for which every alias is new, - // implying that it was invented by the parser, e.g., during camelization - self.isValidAndSomeAliasIsNotNew = function isValidAndSomeAliasIsNotNew (key, aliases) { - if (!aliases.hasOwnProperty(key)) { - return false - } - const newAliases = yargs.parsed.newAliases - for (let a of [key, ...aliases[key]]) { - if (!newAliases.hasOwnProperty(a) || !newAliases[key]) { - return true - } - } - return false - } - - // validate arguments limited to enumerated choices - self.limitedChoices = function limitedChoices (argv) { - const options = yargs.getOptions() - const invalid = {} - - if (!Object.keys(options.choices).length) return - - Object.keys(argv).forEach((key) => { - if (specialKeys.indexOf(key) === -1 && - options.choices.hasOwnProperty(key)) { - [].concat(argv[key]).forEach((value) => { - // TODO case-insensitive configurability - if (options.choices[key].indexOf(value) === -1 && - value !== undefined) { - invalid[key] = (invalid[key] || []).concat(value) - } - }) - } - }) - - const invalidKeys = Object.keys(invalid) - - if (!invalidKeys.length) return - - let msg = __('Invalid values:') - invalidKeys.forEach((key) => { - msg += `\n ${__( - 'Argument: %s, Given: %s, Choices: %s', - key, - usage.stringifiedValues(invalid[key]), - usage.stringifiedValues(options.choices[key]) - )}` - }) - usage.fail(msg) - } - - // custom checks, added using the `check` option on yargs. - let checks = [] - self.check = function check (f, global) { - checks.push({ - func: f, - global - }) - } - - self.customChecks = function customChecks (argv, aliases) { - for (let i = 0, f; (f = checks[i]) !== undefined; i++) { - const func = f.func - let result = null - try { - result = func(argv, aliases) - } catch (err) { - usage.fail(err.message ? err.message : err, err) - continue - } - - if (!result) { - usage.fail(__('Argument check failed: %s', func.toString())) - } else if (typeof result === 'string' || result instanceof Error) { - usage.fail(result.toString(), result) - } - } - } - - // check implications, argument foo implies => argument bar. - let implied = {} - self.implies = function implies (key, value) { - argsert(' [array|number|string]', [key, value], arguments.length) - - if (typeof key === 'object') { - Object.keys(key).forEach((k) => { - self.implies(k, key[k]) - }) - } else { - yargs.global(key) - if (!implied[key]) { - implied[key] = [] - } - if (Array.isArray(value)) { - value.forEach((i) => self.implies(key, i)) - } else { - implied[key].push(value) - } - } - } - self.getImplied = function getImplied () { - return implied - } - - function keyExists (argv, val) { - // convert string '1' to number 1 - let num = Number(val) - val = isNaN(num) ? val : num - - if (typeof val === 'number') { - // check length of argv._ - val = argv._.length >= val - } else if (val.match(/^--no-.+/)) { - // check if key/value doesn't exist - val = val.match(/^--no-(.+)/)[1] - val = !argv[val] - } else { - // check if key/value exists - val = argv[val] - } - return val - } - - self.implications = function implications (argv) { - const implyFail = [] - - Object.keys(implied).forEach((key) => { - const origKey = key - ;(implied[key] || []).forEach((value) => { - let key = origKey - const origValue = value - key = keyExists(argv, key) - value = keyExists(argv, value) - - if (key && !value) { - implyFail.push(` ${origKey} -> ${origValue}`) - } - }) - }) - - if (implyFail.length) { - let msg = `${__('Implications failed:')}\n` - - implyFail.forEach((value) => { - msg += (value) - }) - - usage.fail(msg) - } - } - - let conflicting = {} - self.conflicts = function conflicts (key, value) { - argsert(' [array|string]', [key, value], arguments.length) - - if (typeof key === 'object') { - Object.keys(key).forEach((k) => { - self.conflicts(k, key[k]) - }) - } else { - yargs.global(key) - if (!conflicting[key]) { - conflicting[key] = [] - } - if (Array.isArray(value)) { - value.forEach((i) => self.conflicts(key, i)) - } else { - conflicting[key].push(value) - } - } - } - self.getConflicting = () => conflicting - - self.conflicting = function conflictingFn (argv) { - Object.keys(argv).forEach((key) => { - if (conflicting[key]) { - conflicting[key].forEach((value) => { - // we default keys to 'undefined' that have been configured, we should not - // apply conflicting check unless they are a value other than 'undefined'. - if (value && argv[key] !== undefined && argv[value] !== undefined) { - usage.fail(__('Arguments %s and %s are mutually exclusive', key, value)) - } - }) - } - }) - } - - self.recommendCommands = function recommendCommands (cmd, potentialCommands) { - const distance = require('./levenshtein') - const threshold = 3 // if it takes more than three edits, let's move on. - potentialCommands = potentialCommands.sort((a, b) => b.length - a.length) - - let recommended = null - let bestDistance = Infinity - for (let i = 0, candidate; (candidate = potentialCommands[i]) !== undefined; i++) { - const d = distance(cmd, candidate) - if (d <= threshold && d < bestDistance) { - bestDistance = d - recommended = candidate - } - } - if (recommended) usage.fail(__('Did you mean %s?', recommended)) - } - - self.reset = function reset (localLookup) { - implied = objFilter(implied, (k, v) => !localLookup[k]) - conflicting = objFilter(conflicting, (k, v) => !localLookup[k]) - checks = checks.filter(c => c.global) - return self - } - - let frozens = [] - self.freeze = function freeze () { - let frozen = {} - frozens.push(frozen) - frozen.implied = implied - frozen.checks = checks - frozen.conflicting = conflicting - } - self.unfreeze = function unfreeze () { - let frozen = frozens.pop() - implied = frozen.implied - checks = frozen.checks - conflicting = frozen.conflicting - } - - return self -} diff --git a/deps/npm/node_modules/yargs/lib/yerror.js b/deps/npm/node_modules/yargs/lib/yerror.js deleted file mode 100644 index 53375a0f7569b9..00000000000000 --- a/deps/npm/node_modules/yargs/lib/yerror.js +++ /dev/null @@ -1,11 +0,0 @@ -'use strict' -function YError (msg) { - this.name = 'YError' - this.message = msg || 'yargs error' - Error.captureStackTrace(this, YError) -} - -YError.prototype = Object.create(Error.prototype) -YError.prototype.constructor = YError - -module.exports = YError diff --git a/deps/npm/node_modules/yargs/locales/be.json b/deps/npm/node_modules/yargs/locales/be.json deleted file mode 100644 index 141ebe1e17e907..00000000000000 --- a/deps/npm/node_modules/yargs/locales/be.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "Commands:": "Каманды:", - "Options:": "Опцыі:", - "Examples:": "Прыклады:", - "boolean": "булевы тып", - "count": "падлік", - "string": "радковы тып", - "number": "лік", - "array": "масіў", - "required": "неабходна", - "default:": "па змаўчанні:", - "choices:": "магчымасці:", - "aliases:": "аліасы:", - "generated-value": "згенераванае значэнне", - "Not enough non-option arguments: got %s, need at least %s": "Недастаткова неапцыйных аргументаў: ёсць %s, трэба як мінімум %s", - "Too many non-option arguments: got %s, maximum of %s": "Занадта шмат неапцыйных аргументаў: ёсць %s, максімум дапушчальна %s", - "Missing argument value: %s": { - "one": "Не хапае значэння аргументу: %s", - "other": "Не хапае значэнняў аргументаў: %s" - }, - "Missing required argument: %s": { - "one": "Не хапае неабходнага аргументу: %s", - "other": "Не хапае неабходных аргументаў: %s" - }, - "Unknown argument: %s": { - "one": "Невядомы аргумент: %s", - "other": "Невядомыя аргументы: %s" - }, - "Invalid values:": "Несапраўдныя значэння:", - "Argument: %s, Given: %s, Choices: %s": "Аргумент: %s, Дадзенае значэнне: %s, Магчымасці: %s", - "Argument check failed: %s": "Праверка аргументаў не ўдалася: %s", - "Implications failed:": "Дадзены аргумент патрабуе наступны дадатковы аргумент:", - "Not enough arguments following: %s": "Недастаткова наступных аргументаў: %s", - "Invalid JSON config file: %s": "Несапраўдны файл канфігурацыі JSON: %s", - "Path to JSON config file": "Шлях да файла канфігурацыі JSON", - "Show help": "Паказаць дапамогу", - "Show version number": "Паказаць нумар версіі", - "Did you mean %s?": "Вы мелі на ўвазе %s?" -} diff --git a/deps/npm/node_modules/yargs/locales/de.json b/deps/npm/node_modules/yargs/locales/de.json deleted file mode 100644 index 05d983737140fd..00000000000000 --- a/deps/npm/node_modules/yargs/locales/de.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "Commands:": "Kommandos:", - "Options:": "Optionen:", - "Examples:": "Beispiele:", - "boolean": "boolean", - "count": "Zähler", - "string": "string", - "number": "Zahl", - "array": "array", - "required": "erforderlich", - "default:": "Standard:", - "choices:": "Möglichkeiten:", - "aliases:": "Aliase:", - "generated-value": "Generierter-Wert", - "Not enough non-option arguments: got %s, need at least %s": "Nicht genügend Argumente ohne Optionen: %s vorhanden, mindestens %s benötigt", - "Too many non-option arguments: got %s, maximum of %s": "Zu viele Argumente ohne Optionen: %s vorhanden, maximal %s erlaubt", - "Missing argument value: %s": { - "one": "Fehlender Argumentwert: %s", - "other": "Fehlende Argumentwerte: %s" - }, - "Missing required argument: %s": { - "one": "Fehlendes Argument: %s", - "other": "Fehlende Argumente: %s" - }, - "Unknown argument: %s": { - "one": "Unbekanntes Argument: %s", - "other": "Unbekannte Argumente: %s" - }, - "Invalid values:": "Unzulässige Werte:", - "Argument: %s, Given: %s, Choices: %s": "Argument: %s, Gegeben: %s, Möglichkeiten: %s", - "Argument check failed: %s": "Argumente-Check fehlgeschlagen: %s", - "Implications failed:": "Fehlende abhängige Argumente:", - "Not enough arguments following: %s": "Nicht genügend Argumente nach: %s", - "Invalid JSON config file: %s": "Fehlerhafte JSON-Config Datei: %s", - "Path to JSON config file": "Pfad zur JSON-Config Datei", - "Show help": "Hilfe anzeigen", - "Show version number": "Version anzeigen", - "Did you mean %s?": "Meintest du %s?" -} diff --git a/deps/npm/node_modules/yargs/locales/en.json b/deps/npm/node_modules/yargs/locales/en.json deleted file mode 100644 index b32a63f27adba3..00000000000000 --- a/deps/npm/node_modules/yargs/locales/en.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "Commands:": "Commands:", - "Options:": "Options:", - "Examples:": "Examples:", - "boolean": "boolean", - "count": "count", - "string": "string", - "number": "number", - "array": "array", - "required": "required", - "default:": "default:", - "choices:": "choices:", - "aliases:": "aliases:", - "generated-value": "generated-value", - "Not enough non-option arguments: got %s, need at least %s": "Not enough non-option arguments: got %s, need at least %s", - "Too many non-option arguments: got %s, maximum of %s": "Too many non-option arguments: got %s, maximum of %s", - "Missing argument value: %s": { - "one": "Missing argument value: %s", - "other": "Missing argument values: %s" - }, - "Missing required argument: %s": { - "one": "Missing required argument: %s", - "other": "Missing required arguments: %s" - }, - "Unknown argument: %s": { - "one": "Unknown argument: %s", - "other": "Unknown arguments: %s" - }, - "Invalid values:": "Invalid values:", - "Argument: %s, Given: %s, Choices: %s": "Argument: %s, Given: %s, Choices: %s", - "Argument check failed: %s": "Argument check failed: %s", - "Implications failed:": "Missing dependent arguments:", - "Not enough arguments following: %s": "Not enough arguments following: %s", - "Invalid JSON config file: %s": "Invalid JSON config file: %s", - "Path to JSON config file": "Path to JSON config file", - "Show help": "Show help", - "Show version number": "Show version number", - "Did you mean %s?": "Did you mean %s?", - "Arguments %s and %s are mutually exclusive" : "Arguments %s and %s are mutually exclusive", - "Positionals:": "Positionals:", - "command": "command" -} diff --git a/deps/npm/node_modules/yargs/locales/es.json b/deps/npm/node_modules/yargs/locales/es.json deleted file mode 100644 index d7c8af9f84a966..00000000000000 --- a/deps/npm/node_modules/yargs/locales/es.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "Commands:": "Comandos:", - "Options:": "Opciones:", - "Examples:": "Ejemplos:", - "boolean": "booleano", - "count": "cuenta", - "string": "cadena de caracteres", - "number": "número", - "array": "tabla", - "required": "requerido", - "default:": "defecto:", - "choices:": "selección:", - "aliases:": "alias:", - "generated-value": "valor-generado", - "Not enough non-option arguments: got %s, need at least %s": "Hacen falta argumentos no-opcionales: Número recibido %s, necesita por lo menos %s", - "Too many non-option arguments: got %s, maximum of %s": "Demasiados argumentos no-opcionales: Número recibido %s, máximo es %s", - "Missing argument value: %s": { - "one": "Falta argumento: %s", - "other": "Faltan argumentos: %s" - }, - "Missing required argument: %s": { - "one": "Falta argumento requerido: %s", - "other": "Faltan argumentos requeridos: %s" - }, - "Unknown argument: %s": { - "one": "Argumento desconocido: %s", - "other": "Argumentos desconocidos: %s" - }, - "Invalid values:": "Valores inválidos:", - "Argument: %s, Given: %s, Choices: %s": "Argumento: %s, Recibido: %s, Seleccionados: %s", - "Argument check failed: %s": "Verificación de argumento ha fallado: %s", - "Implications failed:": "Implicaciones fallidas:", - "Not enough arguments following: %s": "No hay suficientes argumentos después de: %s", - "Invalid JSON config file: %s": "Archivo de configuración JSON inválido: %s", - "Path to JSON config file": "Ruta al archivo de configuración JSON", - "Show help": "Muestra ayuda", - "Show version number": "Muestra número de versión", - "Did you mean %s?": "Quisiste decir %s?" -} diff --git a/deps/npm/node_modules/yargs/locales/fr.json b/deps/npm/node_modules/yargs/locales/fr.json deleted file mode 100644 index cf9c74bf5b7504..00000000000000 --- a/deps/npm/node_modules/yargs/locales/fr.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "Commands:": "Commandes:", - "Options:": "Options:", - "Examples:": "Exemples:", - "boolean": "booléen", - "count": "comptage", - "string": "chaine de caractère", - "number": "nombre", - "array": "tableau", - "required": "requis", - "default:": "défaut:", - "choices:": "choix:", - "generated-value": "valeur générée", - "Not enough non-option arguments: got %s, need at least %s": "Pas assez d'arguments non-option: reçu %s, besoin d'au moins %s", - "Too many non-option arguments: got %s, maximum of %s": "Trop d'arguments non-option: reçu %s, maximum %s", - "Missing argument value: %s": { - "one": "Argument manquant: %s", - "other": "Arguments manquants: %s" - }, - "Missing required argument: %s": { - "one": "Argument requis manquant: %s", - "other": "Arguments requis manquants: %s" - }, - "Unknown argument: %s": { - "one": "Argument inconnu: %s", - "other": "Arguments inconnus: %s" - }, - "Invalid values:": "Valeurs invalides:", - "Argument: %s, Given: %s, Choices: %s": "Argument: %s, Donné: %s, Choix: %s", - "Argument check failed: %s": "Echec de la vérification de l'argument: %s", - "Implications failed:": "Arguments dépendants manquants:", - "Not enough arguments following: %s": "Pas assez d'arguments suivant: %s", - "Invalid JSON config file: %s": "Fichier de configuration JSON invalide: %s", - "Path to JSON config file": "Chemin du fichier de configuration JSON", - "Show help": "Affiche de l'aide", - "Show version number": "Affiche le numéro de version" -} diff --git a/deps/npm/node_modules/yargs/locales/hi.json b/deps/npm/node_modules/yargs/locales/hi.json deleted file mode 100644 index 2cd677acb4a8b0..00000000000000 --- a/deps/npm/node_modules/yargs/locales/hi.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "Commands:": "आदेश:", - "Options:": "विकल्प:", - "Examples:": "उदाहरण:", - "boolean": "सत्यता", - "count": "संख्या", - "string": "वर्णों का तार ", - "number": "अंक", - "array": "सरणी", - "required": "आवश्यक", - "default:": "डिफॉल्ट:", - "choices:": "विकल्प:", - "aliases:": "उपनाम:", - "generated-value": "उत्पन्न-मूल्य", - "Not enough non-option arguments: got %s, need at least %s": "पर्याप्त गैर-विकल्प तर्क प्राप्त नहीं: %s प्राप्त, कम से कम %s की आवश्यकता है", - "Too many non-option arguments: got %s, maximum of %s": "बहुत सारे गैर-विकल्प तर्क: %s प्राप्त, अधिकतम %s मान्य", - "Missing argument value: %s": { - "one": "कुछ तर्को के मूल्य गुम हैं: %s", - "other": "कुछ तर्को के मूल्य गुम हैं: %s" - }, - "Missing required argument: %s": { - "one": "आवश्यक तर्क गुम हैं: %s", - "other": "आवश्यक तर्क गुम हैं: %s" - }, - "Unknown argument: %s": { - "one": "अज्ञात तर्क प्राप्त: %s", - "other": "अज्ञात तर्क प्राप्त: %s" - }, - "Invalid values:": "अमान्य मूल्य:", - "Argument: %s, Given: %s, Choices: %s": "तर्क: %s, प्राप्त: %s, विकल्प: %s", - "Argument check failed: %s": "तर्क जांच विफल: %s", - "Implications failed:": "दिए गए तर्क के लिए अतिरिक्त तर्क की अपेक्षा है:", - "Not enough arguments following: %s": "निम्नलिखित के बाद पर्याप्त तर्क नहीं प्राप्त: %s", - "Invalid JSON config file: %s": "अमान्य JSON config फाइल: %s", - "Path to JSON config file": "JSON config फाइल का पथ", - "Show help": "सहायता दिखाएँ", - "Show version number": "Version संख्या दिखाएँ", - "Did you mean %s?": "क्या आपका मतलब है %s?", - "Arguments %s and %s are mutually exclusive" : "तर्क %s और %s परस्पर अनन्य हैं", - "Positionals:": "स्थानीय:", - "command": "आदेश" -} diff --git a/deps/npm/node_modules/yargs/locales/hu.json b/deps/npm/node_modules/yargs/locales/hu.json deleted file mode 100644 index 7b7d16606b8f69..00000000000000 --- a/deps/npm/node_modules/yargs/locales/hu.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "Commands:": "Parancsok:", - "Options:": "Opciók:", - "Examples:": "Példák:", - "boolean": "boolean", - "count": "számláló", - "string": "szöveg", - "number": "szám", - "array": "tömb", - "required": "kötelező", - "default:": "alapértelmezett:", - "choices:": "lehetőségek:", - "aliases:": "aliaszok:", - "generated-value": "generált-érték", - "Not enough non-option arguments: got %s, need at least %s": "Nincs elég nem opcionális argumentum: %s van, legalább %s kell", - "Too many non-option arguments: got %s, maximum of %s": "Túl sok nem opciánlis argumentum van: %s van, maximum %s lehet", - "Missing argument value: %s": { - "one": "Hiányzó argumentum érték: %s", - "other": "Hiányzó argumentum értékek: %s" - }, - "Missing required argument: %s": { - "one": "Hiányzó kötelező argumentum: %s", - "other": "Hiányzó kötelező argumentumok: %s" - }, - "Unknown argument: %s": { - "one": "Ismeretlen argumentum: %s", - "other": "Ismeretlen argumentumok: %s" - }, - "Invalid values:": "Érvénytelen érték:", - "Argument: %s, Given: %s, Choices: %s": "Argumentum: %s, Megadott: %s, Lehetőségek: %s", - "Argument check failed: %s": "Argumentum ellenőrzés sikertelen: %s", - "Implications failed:": "Implikációk sikertelenek:", - "Not enough arguments following: %s": "Nem elég argumentum követi: %s", - "Invalid JSON config file: %s": "Érvénytelen JSON konfigurációs file: %s", - "Path to JSON config file": "JSON konfigurációs file helye", - "Show help": "Súgo megjelenítése", - "Show version number": "Verziószám megjelenítése", - "Did you mean %s?": "Erre gondoltál %s?" -} diff --git a/deps/npm/node_modules/yargs/locales/id.json b/deps/npm/node_modules/yargs/locales/id.json deleted file mode 100644 index 87e441cd8032a5..00000000000000 --- a/deps/npm/node_modules/yargs/locales/id.json +++ /dev/null @@ -1,43 +0,0 @@ - -{ - "Commands:": "Perintah:", - "Options:": "Pilihan:", - "Examples:": "Contoh:", - "boolean": "boolean", - "count": "jumlah", - "number": "nomor", - "string": "string", - "array": "larik", - "required": "diperlukan", - "default:": "bawaan:", - "aliases:": "istilah lain:", - "choices:": "pilihan:", - "generated-value": "nilai-yang-dihasilkan", - "Not enough non-option arguments: got %s, need at least %s": "Argumen wajib kurang: hanya %s, minimal %s", - "Too many non-option arguments: got %s, maximum of %s": "Terlalu banyak argumen wajib: ada %s, maksimal %s", - "Missing argument value: %s": { - "one": "Kurang argumen: %s", - "other": "Kurang argumen: %s" - }, - "Missing required argument: %s": { - "one": "Kurang argumen wajib: %s", - "other": "Kurang argumen wajib: %s" - }, - "Unknown argument: %s": { - "one": "Argumen tak diketahui: %s", - "other": "Argumen tak diketahui: %s" - }, - "Invalid values:": "Nilai-nilai tidak valid:", - "Argument: %s, Given: %s, Choices: %s": "Argumen: %s, Diberikan: %s, Pilihan: %s", - "Argument check failed: %s": "Pemeriksaan argument gagal: %s", - "Implications failed:": "Implikasi gagal:", - "Not enough arguments following: %s": "Kurang argumen untuk: %s", - "Invalid JSON config file: %s": "Berkas konfigurasi JSON tidak valid: %s", - "Path to JSON config file": "Alamat berkas konfigurasi JSON", - "Show help": "Lihat bantuan", - "Show version number": "Lihat nomor versi", - "Did you mean %s?": "Maksud Anda: %s?", - "Arguments %s and %s are mutually exclusive" : "Argumen %s dan %s saling eksklusif", - "Positionals:": "Posisional-posisional:", - "command": "perintah" -} diff --git a/deps/npm/node_modules/yargs/locales/it.json b/deps/npm/node_modules/yargs/locales/it.json deleted file mode 100644 index 9ee900d34aca99..00000000000000 --- a/deps/npm/node_modules/yargs/locales/it.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "Commands:": "Comandi:", - "Options:": "Opzioni:", - "Examples:": "Esempi:", - "boolean": "booleano", - "count": "contatore", - "string": "stringa", - "number": "numero", - "array": "vettore", - "required": "richiesto", - "default:": "predefinito:", - "choices:": "scelte:", - "aliases:": "alias:", - "generated-value": "valore generato", - "Not enough non-option arguments: got %s, need at least %s": "Numero insufficiente di argomenti non opzione: inseriti %s, richiesti almeno %s", - "Too many non-option arguments: got %s, maximum of %s": "Troppi argomenti non opzione: inseriti %s, massimo possibile %s", - "Missing argument value: %s": { - "one": "Argomento mancante: %s", - "other": "Argomenti mancanti: %s" - }, - "Missing required argument: %s": { - "one": "Argomento richiesto mancante: %s", - "other": "Argomenti richiesti mancanti: %s" - }, - "Unknown argument: %s": { - "one": "Argomento sconosciuto: %s", - "other": "Argomenti sconosciuti: %s" - }, - "Invalid values:": "Valori non validi:", - "Argument: %s, Given: %s, Choices: %s": "Argomento: %s, Richiesto: %s, Scelte: %s", - "Argument check failed: %s": "Controllo dell'argomento fallito: %s", - "Implications failed:": "Argomenti dipendenti mancanti:", - "Not enough arguments following: %s": "Argomenti insufficienti dopo: %s", - "Invalid JSON config file: %s": "File di configurazione JSON non valido: %s", - "Path to JSON config file": "Percorso del file di configurazione JSON", - "Show help": "Mostra la schermata di aiuto", - "Show version number": "Mostra il numero di versione", - "Did you mean %s?": "Intendi forse %s?" -} diff --git a/deps/npm/node_modules/yargs/locales/ja.json b/deps/npm/node_modules/yargs/locales/ja.json deleted file mode 100644 index 64ee6d3fb933eb..00000000000000 --- a/deps/npm/node_modules/yargs/locales/ja.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "Commands:": "コマンド:", - "Options:": "オプション:", - "Examples:": "例:", - "boolean": "真偽", - "count": "カウント", - "string": "文字列", - "number": "数値", - "array": "配列", - "required": "必須", - "default:": "デフォルト:", - "choices:": "選択してください:", - "aliases:": "エイリアス:", - "generated-value": "生成された値", - "Not enough non-option arguments: got %s, need at least %s": "オプションではない引数が %s 個では不足しています。少なくとも %s 個の引数が必要です:", - "Too many non-option arguments: got %s, maximum of %s": "オプションではない引数が %s 個では多すぎます。最大で %s 個までです:", - "Missing argument value: %s": { - "one": "引数が見つかりません: %s", - "other": "引数が見つかりません: %s" - }, - "Missing required argument: %s": { - "one": "必須の引数が見つかりません: %s", - "other": "必須の引数が見つかりません: %s" - }, - "Unknown argument: %s": { - "one": "未知の引数です: %s", - "other": "未知の引数です: %s" - }, - "Invalid values:": "不正な値です:", - "Argument: %s, Given: %s, Choices: %s": "引数は %s です。指定できるのは %s つです。選択してください: %s", - "Argument check failed: %s": "引数のチェックに失敗しました: %s", - "Implications failed:": "オプションの組み合わせで不正が生じました:", - "Not enough arguments following: %s": "次の引数が不足しています。: %s", - "Invalid JSON config file: %s": "JSONの設定ファイルが不正です: %s", - "Path to JSON config file": "JSONの設定ファイルまでのpath", - "Show help": "ヘルプを表示", - "Show version number": "バージョンを表示", - "Did you mean %s?": "もしかして %s?", - "Arguments %s and %s are mutually exclusive" : "引数 %s と %s は同時に指定できません", - "Positionals:": "位置:", - "command": "コマンド" -} diff --git a/deps/npm/node_modules/yargs/locales/ko.json b/deps/npm/node_modules/yargs/locales/ko.json deleted file mode 100644 index 0eaeab2f81a79e..00000000000000 --- a/deps/npm/node_modules/yargs/locales/ko.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "Commands:": "명령:", - "Options:": "옵션:", - "Examples:": "예시:", - "boolean": "여부", - "count": "개수", - "string": "문자열", - "number": "숫자", - "array": "배열", - "required": "필수", - "default:": "기본:", - "choices:": "선택:", - "aliases:": "별칭:", - "generated-value": "생성된 값", - "Not enough non-option arguments: got %s, need at least %s": "옵션이 아닌 인자가 충분치 않습니다: %s개를 받았지만, 적어도 %s개는 필요합니다", - "Too many non-option arguments: got %s, maximum of %s": "옵션이 아닌 인자가 너무 많습니다: %s개를 받았지만, %s개 이하여야 합니다", - "Missing argument value: %s": { - "one": "인자값을 받지 못했습니다: %s", - "other": "인자값들을 받지 못했습니다: %s" - }, - "Missing required argument: %s": { - "one": "필수 인자를 받지 못했습니다: %s", - "other": "필수 인자들을 받지 못했습니다: %s" - }, - "Unknown argument: %s": { - "one": "알 수 없는 인자입니다: %s", - "other": "알 수 없는 인자들입니다: %s" - }, - "Invalid values:": "잘못된 값입니다:", - "Argument: %s, Given: %s, Choices: %s": "인자: %s, 입력받은 값: %s, 선택지: %s", - "Argument check failed: %s": "유효하지 않은 인자입니다: %s", - "Implications failed:": "옵션의 조합이 잘못되었습니다:", - "Not enough arguments following: %s": "인자가 충분하게 주어지지 않았습니다: %s", - "Invalid JSON config file: %s": "유효하지 않은 JSON 설정파일입니다: %s", - "Path to JSON config file": "JSON 설정파일 경로", - "Show help": "도움말을 보여줍니다", - "Show version number": "버전 넘버를 보여줍니다", - "Did you mean %s?": "찾고계신게 %s입니까?", - "Arguments %s and %s are mutually exclusive" : "%s와 %s 인자는 같이 사용될 수 없습니다", - "Positionals:": "위치:", - "command": "명령" -} diff --git a/deps/npm/node_modules/yargs/locales/nb.json b/deps/npm/node_modules/yargs/locales/nb.json deleted file mode 100644 index 55be1fbedeb699..00000000000000 --- a/deps/npm/node_modules/yargs/locales/nb.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "Commands:": "Kommandoer:", - "Options:": "Alternativer:", - "Examples:": "Eksempler:", - "boolean": "boolsk", - "count": "antall", - "string": "streng", - "number": "nummer", - "array": "matrise", - "required": "obligatorisk", - "default:": "standard:", - "choices:": "valg:", - "generated-value": "generert-verdi", - "Not enough non-option arguments: got %s, need at least %s": "Ikke nok ikke-alternativ argumenter: fikk %s, trenger minst %s", - "Too many non-option arguments: got %s, maximum of %s": "For mange ikke-alternativ argumenter: fikk %s, maksimum %s", - "Missing argument value: %s": { - "one": "Mangler argument verdi: %s", - "other": "Mangler argument verdier: %s" - }, - "Missing required argument: %s": { - "one": "Mangler obligatorisk argument: %s", - "other": "Mangler obligatoriske argumenter: %s" - }, - "Unknown argument: %s": { - "one": "Ukjent argument: %s", - "other": "Ukjente argumenter: %s" - }, - "Invalid values:": "Ugyldige verdier:", - "Argument: %s, Given: %s, Choices: %s": "Argument: %s, Gitt: %s, Valg: %s", - "Argument check failed: %s": "Argumentsjekk mislyktes: %s", - "Implications failed:": "Konsekvensene mislyktes:", - "Not enough arguments following: %s": "Ikke nok følgende argumenter: %s", - "Invalid JSON config file: %s": "Ugyldig JSON konfigurasjonsfil: %s", - "Path to JSON config file": "Bane til JSON konfigurasjonsfil", - "Show help": "Vis hjelp", - "Show version number": "Vis versjonsnummer" -} diff --git a/deps/npm/node_modules/yargs/locales/nl.json b/deps/npm/node_modules/yargs/locales/nl.json deleted file mode 100644 index 5d62e0fc3b6114..00000000000000 --- a/deps/npm/node_modules/yargs/locales/nl.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "Commands:": "Commando's:", - "Options:": "Opties:", - "Examples:": "Voorbeelden:", - "boolean": "booleaans", - "count": "aantal", - "string": "string", - "number": "getal", - "array": "lijst", - "required": "verplicht", - "default:": "standaard:", - "choices:": "keuzes:", - "aliases:": "aliassen:", - "generated-value": "gegenereerde waarde", - "Not enough non-option arguments: got %s, need at least %s": "Niet genoeg niet-optie-argumenten: %s gekregen, minstens %s nodig", - "Too many non-option arguments: got %s, maximum of %s": "Te veel niet-optie-argumenten: %s gekregen, maximum is %s", - "Missing argument value: %s": { - "one": "Missende argumentwaarde: %s", - "other": "Missende argumentwaarden: %s" - }, - "Missing required argument: %s": { - "one": "Missend verplicht argument: %s", - "other": "Missende verplichte argumenten: %s" - }, - "Unknown argument: %s": { - "one": "Onbekend argument: %s", - "other": "Onbekende argumenten: %s" - }, - "Invalid values:": "Ongeldige waarden:", - "Argument: %s, Given: %s, Choices: %s": "Argument: %s, Gegeven: %s, Keuzes: %s", - "Argument check failed: %s": "Argumentcontrole mislukt: %s", - "Implications failed:": "Ontbrekende afhankelijke argumenten:", - "Not enough arguments following: %s": "Niet genoeg argumenten na: %s", - "Invalid JSON config file: %s": "Ongeldig JSON-config-bestand: %s", - "Path to JSON config file": "Pad naar JSON-config-bestand", - "Show help": "Toon help", - "Show version number": "Toon versienummer", - "Did you mean %s?": "Bedoelde u misschien %s?", - "Arguments %s and %s are mutually exclusive": "Argumenten %s en %s kunnen niet tegelijk gebruikt worden", - "Positionals:": "Positie-afhankelijke argumenten", - "command": "commando" -} diff --git a/deps/npm/node_modules/yargs/locales/nn.json b/deps/npm/node_modules/yargs/locales/nn.json deleted file mode 100644 index 5a3c9514dc5b07..00000000000000 --- a/deps/npm/node_modules/yargs/locales/nn.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "Commands:": "Kommandoar:", - "Options:": "Alternativ:", - "Examples:": "Døme:", - "boolean": "boolsk", - "count": "mengd", - "string": "streng", - "number": "nummer", - "array": "matrise", - "required": "obligatorisk", - "default:": "standard:", - "choices:": "val:", - "generated-value": "generert-verdi", - "Not enough non-option arguments: got %s, need at least %s": - "Ikkje nok ikkje-alternativ argument: fekk %s, treng minst %s", - "Too many non-option arguments: got %s, maximum of %s": - "For mange ikkje-alternativ argument: fekk %s, maksimum %s", - "Missing argument value: %s": { - "one": "Manglar argumentverdi: %s", - "other": "Manglar argumentverdiar: %s" - }, - "Missing required argument: %s": { - "one": "Manglar obligatorisk argument: %s", - "other": "Manglar obligatoriske argument: %s" - }, - "Unknown argument: %s": { - "one": "Ukjent argument: %s", - "other": "Ukjende argument: %s" - }, - "Invalid values:": "Ugyldige verdiar:", - "Argument: %s, Given: %s, Choices: %s": "Argument: %s, Gjeve: %s, Val: %s", - "Argument check failed: %s": "Argumentsjekk mislukkast: %s", - "Implications failed:": "Konsekvensane mislukkast:", - "Not enough arguments following: %s": "Ikkje nok fylgjande argument: %s", - "Invalid JSON config file: %s": "Ugyldig JSON konfigurasjonsfil: %s", - "Path to JSON config file": "Bane til JSON konfigurasjonsfil", - "Show help": "Vis hjelp", - "Show version number": "Vis versjonsnummer" -} diff --git a/deps/npm/node_modules/yargs/locales/pirate.json b/deps/npm/node_modules/yargs/locales/pirate.json deleted file mode 100644 index dcb5cb75377d70..00000000000000 --- a/deps/npm/node_modules/yargs/locales/pirate.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "Commands:": "Choose yer command:", - "Options:": "Options for me hearties!", - "Examples:": "Ex. marks the spot:", - "required": "requi-yar-ed", - "Missing required argument: %s": { - "one": "Ye be havin' to set the followin' argument land lubber: %s", - "other": "Ye be havin' to set the followin' arguments land lubber: %s" - }, - "Show help": "Parlay this here code of conduct", - "Show version number": "'Tis the version ye be askin' fer", - "Arguments %s and %s are mutually exclusive" : "Yon scurvy dogs %s and %s be as bad as rum and a prudish wench" -} diff --git a/deps/npm/node_modules/yargs/locales/pl.json b/deps/npm/node_modules/yargs/locales/pl.json deleted file mode 100644 index 6926a454806f09..00000000000000 --- a/deps/npm/node_modules/yargs/locales/pl.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "Commands:": "Polecenia:", - "Options:": "Opcje:", - "Examples:": "Przykłady:", - "boolean": "boolean", - "count": "ilość", - "string": "ciąg znaków", - "number": "liczba", - "array": "tablica", - "required": "wymagany", - "default:": "domyślny:", - "choices:": "dostępne:", - "aliases:": "aliasy:", - "generated-value": "wygenerowana-wartość", - "Not enough non-option arguments: got %s, need at least %s": "Niewystarczająca ilość argumentów: otrzymano %s, wymagane co najmniej %s", - "Too many non-option arguments: got %s, maximum of %s": "Zbyt duża ilość argumentów: otrzymano %s, wymagane co najwyżej %s", - "Missing argument value: %s": { - "one": "Brak wartości dla argumentu: %s", - "other": "Brak wartości dla argumentów: %s" - }, - "Missing required argument: %s": { - "one": "Brak wymaganego argumentu: %s", - "other": "Brak wymaganych argumentów: %s" - }, - "Unknown argument: %s": { - "one": "Nieznany argument: %s", - "other": "Nieznane argumenty: %s" - }, - "Invalid values:": "Nieprawidłowe wartości:", - "Argument: %s, Given: %s, Choices: %s": "Argument: %s, Otrzymano: %s, Dostępne: %s", - "Argument check failed: %s": "Weryfikacja argumentów nie powiodła się: %s", - "Implications failed:": "Założenia nie zostały spełnione:", - "Not enough arguments following: %s": "Niewystarczająca ilość argumentów następujących po: %s", - "Invalid JSON config file: %s": "Nieprawidłowy plik konfiguracyjny JSON: %s", - "Path to JSON config file": "Ścieżka do pliku konfiguracyjnego JSON", - "Show help": "Pokaż pomoc", - "Show version number": "Pokaż numer wersji", - "Did you mean %s?": "Czy chodziło Ci o %s?", - "Arguments %s and %s are mutually exclusive": "Argumenty %s i %s wzajemnie się wykluczają", - "Positionals:": "Pozycyjne:", - "command": "polecenie" -} diff --git a/deps/npm/node_modules/yargs/locales/pt.json b/deps/npm/node_modules/yargs/locales/pt.json deleted file mode 100644 index 75c3921c802947..00000000000000 --- a/deps/npm/node_modules/yargs/locales/pt.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "Commands:": "Comandos:", - "Options:": "Opções:", - "Examples:": "Exemplos:", - "boolean": "boolean", - "count": "contagem", - "string": "cadeia de caracteres", - "number": "número", - "array": "arranjo", - "required": "requerido", - "default:": "padrão:", - "choices:": "escolhas:", - "generated-value": "valor-gerado", - "Not enough non-option arguments: got %s, need at least %s": "Argumentos insuficientes não opcionais: Argumento %s, necessário pelo menos %s", - "Too many non-option arguments: got %s, maximum of %s": "Excesso de argumentos não opcionais: recebido %s, máximo de %s", - "Missing argument value: %s": { - "one": "Falta valor de argumento: %s", - "other": "Falta valores de argumento: %s" - }, - "Missing required argument: %s": { - "one": "Falta argumento obrigatório: %s", - "other": "Faltando argumentos obrigatórios: %s" - }, - "Unknown argument: %s": { - "one": "Argumento desconhecido: %s", - "other": "Argumentos desconhecidos: %s" - }, - "Invalid values:": "Valores inválidos:", - "Argument: %s, Given: %s, Choices: %s": "Argumento: %s, Dado: %s, Escolhas: %s", - "Argument check failed: %s": "Verificação de argumento falhou: %s", - "Implications failed:": "Implicações falharam:", - "Not enough arguments following: %s": "Insuficientes argumentos a seguir: %s", - "Invalid JSON config file: %s": "Arquivo de configuração em JSON esta inválido: %s", - "Path to JSON config file": "Caminho para o arquivo de configuração em JSON", - "Show help": "Mostra ajuda", - "Show version number": "Mostra número de versão", - "Arguments %s and %s are mutually exclusive" : "Argumentos %s e %s são mutualmente exclusivos" -} diff --git a/deps/npm/node_modules/yargs/locales/pt_BR.json b/deps/npm/node_modules/yargs/locales/pt_BR.json deleted file mode 100644 index 904cb66eb40361..00000000000000 --- a/deps/npm/node_modules/yargs/locales/pt_BR.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "Commands:": "Comandos:", - "Options:": "Opções:", - "Examples:": "Exemplos:", - "boolean": "booleano", - "count": "contagem", - "string": "string", - "number": "número", - "array": "array", - "required": "obrigatório", - "default:": "padrão:", - "choices:": "opções:", - "aliases:": "sinônimos:", - "generated-value": "valor-gerado", - "Not enough non-option arguments: got %s, need at least %s": "Argumentos insuficientes: Argumento %s, necessário pelo menos %s", - "Too many non-option arguments: got %s, maximum of %s": "Excesso de argumentos: recebido %s, máximo de %s", - "Missing argument value: %s": { - "one": "Falta valor de argumento: %s", - "other": "Falta valores de argumento: %s" - }, - "Missing required argument: %s": { - "one": "Falta argumento obrigatório: %s", - "other": "Faltando argumentos obrigatórios: %s" - }, - "Unknown argument: %s": { - "one": "Argumento desconhecido: %s", - "other": "Argumentos desconhecidos: %s" - }, - "Invalid values:": "Valores inválidos:", - "Argument: %s, Given: %s, Choices: %s": "Argumento: %s, Dado: %s, Opções: %s", - "Argument check failed: %s": "Verificação de argumento falhou: %s", - "Implications failed:": "Implicações falharam:", - "Not enough arguments following: %s": "Argumentos insuficientes a seguir: %s", - "Invalid JSON config file: %s": "Arquivo JSON de configuração inválido: %s", - "Path to JSON config file": "Caminho para o arquivo JSON de configuração", - "Show help": "Exibe ajuda", - "Show version number": "Exibe a versão", - "Did you mean %s?": "Você quis dizer %s?", - "Arguments %s and %s are mutually exclusive" : "Argumentos %s e %s são mutualmente exclusivos", - "Positionals:": "Posicionais:", - "command": "comando" -} diff --git a/deps/npm/node_modules/yargs/locales/ru.json b/deps/npm/node_modules/yargs/locales/ru.json deleted file mode 100644 index cb7b88b4953c36..00000000000000 --- a/deps/npm/node_modules/yargs/locales/ru.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "Commands:": "Команды:", - "Options:": "Опции:", - "Examples:": "Примеры:", - "boolean": "булевый тип", - "count": "подсчет", - "string": "строковой тип", - "number": "число", - "array": "массив", - "required": "необходимо", - "default:": "по умолчанию:", - "choices:": "возможности:", - "aliases:": "алиасы:", - "generated-value": "генерированное значение", - "Not enough non-option arguments: got %s, need at least %s": "Недостаточно неопционных аргументов: есть %s, нужно как минимум %s", - "Too many non-option arguments: got %s, maximum of %s": "Слишком много неопционных аргументов: есть %s, максимум допустимо %s", - "Missing argument value: %s": { - "one": "Не хватает значения аргумента: %s", - "other": "Не хватает значений аргументов: %s" - }, - "Missing required argument: %s": { - "one": "Не хватает необходимого аргумента: %s", - "other": "Не хватает необходимых аргументов: %s" - }, - "Unknown argument: %s": { - "one": "Неизвестный аргумент: %s", - "other": "Неизвестные аргументы: %s" - }, - "Invalid values:": "Недействительные значения:", - "Argument: %s, Given: %s, Choices: %s": "Аргумент: %s, Данное значение: %s, Возможности: %s", - "Argument check failed: %s": "Проверка аргументов не удалась: %s", - "Implications failed:": "Данный аргумент требует следующий дополнительный аргумент:", - "Not enough arguments following: %s": "Недостаточно следующих аргументов: %s", - "Invalid JSON config file: %s": "Недействительный файл конфигурации JSON: %s", - "Path to JSON config file": "Путь к файлу конфигурации JSON", - "Show help": "Показать помощь", - "Show version number": "Показать номер версии", - "Did you mean %s?": "Вы имели в виду %s?" -} diff --git a/deps/npm/node_modules/yargs/locales/th.json b/deps/npm/node_modules/yargs/locales/th.json deleted file mode 100644 index 3f08dcd238d442..00000000000000 --- a/deps/npm/node_modules/yargs/locales/th.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "Commands:": "คอมมาน", - "Options:": "ออฟชั่น", - "Examples:": "ตัวอย่าง", - "boolean": "บูลีน", - "count": "นับ", - "string": "สตริง", - "number": "ตัวเลข", - "array": "อาเรย์", - "required": "จำเป็น", - "default:": "ค่าเริ่มต้น", - "choices:": "ตัวเลือก", - "aliases:": "เอเลียส", - "generated-value": "ค่าที่ถูกสร้างขึ้น", - "Not enough non-option arguments: got %s, need at least %s": "ใส่อาร์กิวเมนต์ไม่ครบตามจำนวนที่กำหนด: ใส่ค่ามาจำนวน %s ค่า, แต่ต้องการอย่างน้อย %s ค่า", - "Too many non-option arguments: got %s, maximum of %s": "ใส่อาร์กิวเมนต์เกินจำนวนที่กำหนด: ใส่ค่ามาจำนวน %s ค่า, แต่ต้องการมากที่สุด %s ค่า", - "Missing argument value: %s": { - "one": "ค่าอาร์กิวเมนต์ที่ขาดไป: %s", - "other": "ค่าอาร์กิวเมนต์ที่ขาดไป: %s" - }, - "Missing required argument: %s": { - "one": "อาร์กิวเมนต์จำเป็นที่ขาดไป: %s", - "other": "อาร์กิวเมนต์จำเป็นที่ขาดไป: %s" - }, - "Unknown argument: %s": { - "one": "อาร์กิวเมนต์ที่ไม่รู้จัก: %s", - "other": "อาร์กิวเมนต์ที่ไม่รู้จัก: %s" - }, - "Invalid values:": "ค่าไม่ถูกต้อง:", - "Argument: %s, Given: %s, Choices: %s": "อาร์กิวเมนต์: %s, ได้รับ: %s, ตัวเลือก: %s", - "Argument check failed: %s": "ตรวจสอบพบอาร์กิวเมนต์ที่ไม่ถูกต้อง: %s", - "Implications failed:": "Implications ไม่สำเร็จ:", - "Not enough arguments following: %s": "ใส่อาร์กิวเมนต์ไม่ครบ: %s", - "Invalid JSON config file: %s": "ไฟล์คอนฟิค JSON ไม่ถูกต้อง: %s", - "Path to JSON config file": "พาทไฟล์คอนฟิค JSON", - "Show help": "ขอความช่วยเหลือ", - "Show version number": "แสดงตัวเลขเวอร์ชั่น", - "Did you mean %s?": "คุณหมายถึง %s?" -} diff --git a/deps/npm/node_modules/yargs/locales/tr.json b/deps/npm/node_modules/yargs/locales/tr.json deleted file mode 100644 index 9b06c52a8dfece..00000000000000 --- a/deps/npm/node_modules/yargs/locales/tr.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "Commands:": "Komutlar:", - "Options:": "Seçenekler:", - "Examples:": "Örnekler:", - "boolean": "boolean", - "count": "sayı", - "string": "string", - "number": "numara", - "array": "array", - "required": "zorunlu", - "default:": "varsayılan:", - "choices:": "seçimler:", - "aliases:": "takma adlar:", - "generated-value": "oluşturulan-değer", - "Not enough non-option arguments: got %s, need at least %s": "Seçenek dışı argümanlar yetersiz: %s bulundu, %s gerekli", - "Too many non-option arguments: got %s, maximum of %s": "Seçenek dışı argümanlar gereğinden fazla: %s bulundu, azami %s", - "Missing argument value: %s": { - "one": "Eksik argüman değeri: %s", - "other": "Eksik argüman değerleri: %s" - }, - "Missing required argument: %s": { - "one": "Eksik zorunlu argüman: %s", - "other": "Eksik zorunlu argümanlar: %s" - }, - "Unknown argument: %s": { - "one": "Bilinmeyen argüman: %s", - "other": "Bilinmeyen argümanlar: %s" - }, - "Invalid values:": "Geçersiz değerler:", - "Argument: %s, Given: %s, Choices: %s": "Argüman: %s, Verilen: %s, Seçimler: %s", - "Argument check failed: %s": "Argüman kontrolü başarısız oldu: %s", - "Implications failed:": "Sonuçlar başarısız oldu:", - "Not enough arguments following: %s": "%s için yeterli argüman bulunamadı", - "Invalid JSON config file: %s": "Geçersiz JSON yapılandırma dosyası: %s", - "Path to JSON config file": "JSON yapılandırma dosya konumu", - "Show help": "Yardım detaylarını göster", - "Show version number": "Versiyon detaylarını göster", - "Did you mean %s?": "Bunu mu demek istediniz: %s?", - "Positionals:": "Sıralılar:", - "command": "komut" -} diff --git a/deps/npm/node_modules/yargs/locales/zh_CN.json b/deps/npm/node_modules/yargs/locales/zh_CN.json deleted file mode 100644 index 03a3d94f0cf265..00000000000000 --- a/deps/npm/node_modules/yargs/locales/zh_CN.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "Commands:": "命令:", - "Options:": "选项:", - "Examples:": "示例:", - "boolean": "布尔", - "count": "计数", - "string": "字符串", - "number": "数字", - "array": "数组", - "required": "必需", - "default:": "默认值:", - "choices:": "可选值:", - "generated-value": "生成的值", - "Not enough non-option arguments: got %s, need at least %s": "缺少 non-option 参数:传入了 %s 个, 至少需要 %s 个", - "Too many non-option arguments: got %s, maximum of %s": "non-option 参数过多:传入了 %s 个, 最大允许 %s 个", - "Missing argument value: %s": { - "one": "没有给此选项指定值:%s", - "other": "没有给这些选项指定值:%s" - }, - "Missing required argument: %s": { - "one": "缺少必须的选项:%s", - "other": "缺少这些必须的选项:%s" - }, - "Unknown argument: %s": { - "one": "无法识别的选项:%s", - "other": "无法识别这些选项:%s" - }, - "Invalid values:": "无效的选项值:", - "Argument: %s, Given: %s, Choices: %s": "选项名称: %s, 传入的值: %s, 可选的值:%s", - "Argument check failed: %s": "选项值验证失败:%s", - "Implications failed:": "缺少依赖的选项:", - "Not enough arguments following: %s": "没有提供足够的值给此选项:%s", - "Invalid JSON config file: %s": "无效的 JSON 配置文件:%s", - "Path to JSON config file": "JSON 配置文件的路径", - "Show help": "显示帮助信息", - "Show version number": "显示版本号", - "Did you mean %s?": "是指 %s?", - "Arguments %s and %s are mutually exclusive" : "选项 %s 和 %s 是互斥的", - "Positionals:": "位置:", - "command": "命令" -} diff --git a/deps/npm/node_modules/yargs/locales/zh_TW.json b/deps/npm/node_modules/yargs/locales/zh_TW.json deleted file mode 100644 index 12498888aaf2c8..00000000000000 --- a/deps/npm/node_modules/yargs/locales/zh_TW.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "Commands:": "命令:", - "Options:": "選項:", - "Examples:": "例:", - "boolean": "布林", - "count": "次數", - "string": "字串", - "number": "數字", - "array": "陣列", - "required": "必須", - "default:": "預設值:", - "choices:": "可選值:", - "aliases:": "別名:", - "generated-value": "生成的值", - "Not enough non-option arguments: got %s, need at least %s": "non-option 引數不足:只傳入了 %s 個, 至少要 %s 個", - "Too many non-option arguments: got %s, maximum of %s": "non-option 引數過多:傳入了 %s 個, 但最多 %s 個", - "Missing argument value: %s": { - "one": "此引數無指定值:%s", - "other": "這些引數無指定值:%s" - }, - "Missing required argument: %s": { - "one": "缺少必須的引數:%s", - "other": "缺少這些必須的引數:%s" - }, - "Unknown argument: %s": { - "one": "未知的引數:%s", - "other": "未知的這些引數:%s" - }, - "Invalid values:": "無效的選項值:", - "Argument: %s, Given: %s, Choices: %s": "引數名稱: %s, 傳入的值: %s, 可選的值:%s", - "Argument check failed: %s": "引數驗證失敗:%s", - "Implications failed:": "缺少依賴的選項:", - "Not enough arguments following: %s": "沒有提供足夠的值給此引數:%s", - "Invalid JSON config file: %s": "無效的 JSON 設置文件:%s", - "Path to JSON config file": "JSON 設置文件的路徑", - "Show help": "顯示說明", - "Show version number": "顯示版本", - "Did you mean %s?": "是指 %s?", - "Arguments %s and %s are mutually exclusive" : "引數 %s 和 %s 是互斥的" -} diff --git a/deps/npm/node_modules/yargs/node_modules/ansi-regex/index.js b/deps/npm/node_modules/yargs/node_modules/ansi-regex/index.js deleted file mode 100644 index c25448009f304d..00000000000000 --- a/deps/npm/node_modules/yargs/node_modules/ansi-regex/index.js +++ /dev/null @@ -1,14 +0,0 @@ -'use strict'; - -module.exports = options => { - options = Object.assign({ - onlyFirst: false - }, options); - - const pattern = [ - '[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:[a-zA-Z\\d]*(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)', - '(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))' - ].join('|'); - - return new RegExp(pattern, options.onlyFirst ? undefined : 'g'); -}; diff --git a/deps/npm/node_modules/yargs/node_modules/ansi-regex/license b/deps/npm/node_modules/yargs/node_modules/ansi-regex/license deleted file mode 100644 index e7af2f77107d73..00000000000000 --- a/deps/npm/node_modules/yargs/node_modules/ansi-regex/license +++ /dev/null @@ -1,9 +0,0 @@ -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/deps/npm/node_modules/yargs/node_modules/ansi-regex/package.json b/deps/npm/node_modules/yargs/node_modules/ansi-regex/package.json deleted file mode 100644 index 32d176534fee2a..00000000000000 --- a/deps/npm/node_modules/yargs/node_modules/ansi-regex/package.json +++ /dev/null @@ -1,85 +0,0 @@ -{ - "_from": "ansi-regex@^4.1.0", - "_id": "ansi-regex@4.1.0", - "_inBundle": false, - "_integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", - "_location": "/yargs/ansi-regex", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "ansi-regex@^4.1.0", - "name": "ansi-regex", - "escapedName": "ansi-regex", - "rawSpec": "^4.1.0", - "saveSpec": null, - "fetchSpec": "^4.1.0" - }, - "_requiredBy": [ - "/yargs/strip-ansi" - ], - "_resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", - "_shasum": "8b9f8f08cf1acb843756a839ca8c7e3168c51997", - "_spec": "ansi-regex@^4.1.0", - "_where": "/Users/claudiahdz/npm/cli/node_modules/yargs/node_modules/strip-ansi", - "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": "^0.25.0", - "xo": "^0.23.0" - }, - "engines": { - "node": ">=6" - }, - "files": [ - "index.js" - ], - "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", - "view-supported": "node fixtures/view-codes.js" - }, - "version": "4.1.0" -} diff --git a/deps/npm/node_modules/yargs/node_modules/ansi-regex/readme.md b/deps/npm/node_modules/yargs/node_modules/ansi-regex/readme.md deleted file mode 100644 index d19c44667e704b..00000000000000 --- a/deps/npm/node_modules/yargs/node_modules/ansi-regex/readme.md +++ /dev/null @@ -1,87 +0,0 @@ -# ansi-regex [![Build Status](https://travis-ci.org/chalk/ansi-regex.svg?branch=master)](https://travis-ci.org/chalk/ansi-regex) - -> Regular expression for matching [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code) - ---- - -
    - - 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 - -``` -$ npm install ansi-regex -``` - - -## Usage - -```js -const ansiRegex = require('ansi-regex'); - -ansiRegex().test('\u001B[4mcake\u001B[0m'); -//=> true - -ansiRegex().test('cake'); -//=> false - -'\u001B[4mcake\u001B[0m'.match(ansiRegex()); -//=> ['\u001B[4m', '\u001B[0m'] - -'\u001B[4mcake\u001B[0m'.match(ansiRegex({onlyFirst: true})); -//=> ['\u001B[4m'] - -'\u001B]8;;https://github.com\u0007click\u001B]8;;\u0007'.match(ansiRegex()); -//=> ['\u001B]8;;https://github.com\u0007', '\u001B]8;;\u0007'] -``` - - -## API - -### ansiRegex([options]) - -Returns a regex for matching ANSI escape codes. - -#### options - -##### onlyFirst - -Type: `boolean`
    -Default: `false` *(Matches any ANSI escape codes in a string)* - -Match only the first ANSI escape. - - -## FAQ - -### Why do you test for codes not in the ECMA 48 standard? - -Some of the codes we run as a test are codes that we acquired finding various lists of non-standard or manufacturer specific codes. We test for both standard and non-standard codes, as most of them follow the same or similar format and can be safely matched in strings without the risk of removing actual string content. There are a few non-standard control codes that do not follow the traditional format (i.e. they end in numbers) thus forcing us to exclude them from the test because we cannot reliably match them. - -On the historical side, those ECMA standards were established in the early 90's whereas the VT100, for example, was designed in the mid/late 70's. At that point in time, control codes were still pretty ungoverned and engineers used them for a multitude of things, namely to activate hardware ports that may have been proprietary. Somewhere else you see a similar 'anarchy' of codes is in the x86 architecture for processors; there are a ton of "interrupts" that can mean different things on certain brands of processors, most of which have been phased out. - - -## Security - -To report a security vulnerability, please use the [Tidelift security contact](https://tidelift.com/security). Tidelift will coordinate the fix and disclosure. - - -## Maintainers - -- [Sindre Sorhus](https://github.com/sindresorhus) -- [Josh Junon](https://github.com/qix-) - - -## License - -MIT diff --git a/deps/npm/node_modules/yargs/node_modules/find-up/index.js b/deps/npm/node_modules/yargs/node_modules/find-up/index.js deleted file mode 100644 index 8e83819cea5a95..00000000000000 --- a/deps/npm/node_modules/yargs/node_modules/find-up/index.js +++ /dev/null @@ -1,46 +0,0 @@ -'use strict'; -const path = require('path'); -const locatePath = require('locate-path'); - -module.exports = (filename, opts = {}) => { - const startDir = path.resolve(opts.cwd || ''); - const {root} = path.parse(startDir); - - const filenames = [].concat(filename); - - return new Promise(resolve => { - (function find(dir) { - locatePath(filenames, {cwd: dir}).then(file => { - if (file) { - resolve(path.join(dir, file)); - } else if (dir === root) { - resolve(null); - } else { - find(path.dirname(dir)); - } - }); - })(startDir); - }); -}; - -module.exports.sync = (filename, opts = {}) => { - let dir = path.resolve(opts.cwd || ''); - const {root} = path.parse(dir); - - const filenames = [].concat(filename); - - // eslint-disable-next-line no-constant-condition - while (true) { - const file = locatePath.sync(filenames, {cwd: dir}); - - if (file) { - return path.join(dir, file); - } - - if (dir === root) { - return null; - } - - dir = path.dirname(dir); - } -}; diff --git a/deps/npm/node_modules/yargs/node_modules/find-up/license b/deps/npm/node_modules/yargs/node_modules/find-up/license deleted file mode 100644 index e7af2f77107d73..00000000000000 --- a/deps/npm/node_modules/yargs/node_modules/find-up/license +++ /dev/null @@ -1,9 +0,0 @@ -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/deps/npm/node_modules/yargs/node_modules/find-up/package.json b/deps/npm/node_modules/yargs/node_modules/find-up/package.json deleted file mode 100644 index 4ea5014dd40c68..00000000000000 --- a/deps/npm/node_modules/yargs/node_modules/find-up/package.json +++ /dev/null @@ -1,82 +0,0 @@ -{ - "_from": "find-up@^3.0.0", - "_id": "find-up@3.0.0", - "_inBundle": false, - "_integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", - "_location": "/yargs/find-up", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "find-up@^3.0.0", - "name": "find-up", - "escapedName": "find-up", - "rawSpec": "^3.0.0", - "saveSpec": null, - "fetchSpec": "^3.0.0" - }, - "_requiredBy": [ - "/yargs" - ], - "_resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", - "_shasum": "49169f1d7993430646da61ecc5ae355c21c97b73", - "_spec": "find-up@^3.0.0", - "_where": "/Users/claudiahdz/npm/cli/node_modules/yargs", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "bugs": { - "url": "https://github.com/sindresorhus/find-up/issues" - }, - "bundleDependencies": false, - "dependencies": { - "locate-path": "^3.0.0" - }, - "deprecated": false, - "description": "Find a file or directory by walking up parent directories", - "devDependencies": { - "ava": "*", - "tempy": "^0.2.1", - "xo": "*" - }, - "engines": { - "node": ">=6" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/sindresorhus/find-up#readme", - "keywords": [ - "find", - "up", - "find-up", - "findup", - "look-up", - "look", - "file", - "search", - "match", - "package", - "resolve", - "parent", - "parents", - "folder", - "directory", - "dir", - "walk", - "walking", - "path" - ], - "license": "MIT", - "name": "find-up", - "repository": { - "type": "git", - "url": "git+https://github.com/sindresorhus/find-up.git" - }, - "scripts": { - "test": "xo && ava" - }, - "version": "3.0.0" -} diff --git a/deps/npm/node_modules/yargs/node_modules/find-up/readme.md b/deps/npm/node_modules/yargs/node_modules/find-up/readme.md deleted file mode 100644 index 810ad7ceb52766..00000000000000 --- a/deps/npm/node_modules/yargs/node_modules/find-up/readme.md +++ /dev/null @@ -1,87 +0,0 @@ -# find-up [![Build Status: Linux and macOS](https://travis-ci.org/sindresorhus/find-up.svg?branch=master)](https://travis-ci.org/sindresorhus/find-up) [![Build Status: Windows](https://ci.appveyor.com/api/projects/status/l0cyjmvh5lq72vq2/branch/master?svg=true)](https://ci.appveyor.com/project/sindresorhus/find-up/branch/master) - -> Find a file or directory by walking up parent directories - - -## Install - -``` -$ npm install find-up -``` - - -## Usage - -``` -/ -└── Users - └── sindresorhus - ├── unicorn.png - └── foo - └── bar - ├── baz - └── example.js -``` - -`example.js` - -```js -const findUp = require('find-up'); - -(async () => { - console.log(await findUp('unicorn.png')); - //=> '/Users/sindresorhus/unicorn.png' - - console.log(await findUp(['rainbow.png', 'unicorn.png'])); - //=> '/Users/sindresorhus/unicorn.png' -})(); -``` - - -## API - -### findUp(filename, [options]) - -Returns a `Promise` for either the filepath or `null` if it couldn't be found. - -### findUp([filenameA, filenameB], [options]) - -Returns a `Promise` for either the first filepath found (by respecting the order) or `null` if none could be found. - -### findUp.sync(filename, [options]) - -Returns a filepath or `null`. - -### findUp.sync([filenameA, filenameB], [options]) - -Returns the first filepath found (by respecting the order) or `null`. - -#### filename - -Type: `string` - -Filename of the file to find. - -#### options - -Type: `Object` - -##### cwd - -Type: `string`
    -Default: `process.cwd()` - -Directory to start from. - - -## Related - -- [find-up-cli](https://github.com/sindresorhus/find-up-cli) - CLI for this module -- [pkg-up](https://github.com/sindresorhus/pkg-up) - Find the closest package.json file -- [pkg-dir](https://github.com/sindresorhus/pkg-dir) - Find the root directory of an npm package -- [resolve-from](https://github.com/sindresorhus/resolve-from) - Resolve the path of a module like `require.resolve()` but from a given path - - -## License - -MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/deps/npm/node_modules/yargs/node_modules/is-fullwidth-code-point/index.js b/deps/npm/node_modules/yargs/node_modules/is-fullwidth-code-point/index.js deleted file mode 100644 index d506327c3e5576..00000000000000 --- a/deps/npm/node_modules/yargs/node_modules/is-fullwidth-code-point/index.js +++ /dev/null @@ -1,46 +0,0 @@ -'use strict'; -/* eslint-disable yoda */ -module.exports = x => { - if (Number.isNaN(x)) { - return false; - } - - // code points are derived from: - // http://www.unix.org/Public/UNIDATA/EastAsianWidth.txt - if ( - x >= 0x1100 && ( - x <= 0x115f || // Hangul Jamo - x === 0x2329 || // LEFT-POINTING ANGLE BRACKET - x === 0x232a || // RIGHT-POINTING ANGLE BRACKET - // CJK Radicals Supplement .. Enclosed CJK Letters and Months - (0x2e80 <= x && x <= 0x3247 && x !== 0x303f) || - // Enclosed CJK Letters and Months .. CJK Unified Ideographs Extension A - (0x3250 <= x && x <= 0x4dbf) || - // CJK Unified Ideographs .. Yi Radicals - (0x4e00 <= x && x <= 0xa4c6) || - // Hangul Jamo Extended-A - (0xa960 <= x && x <= 0xa97c) || - // Hangul Syllables - (0xac00 <= x && x <= 0xd7a3) || - // CJK Compatibility Ideographs - (0xf900 <= x && x <= 0xfaff) || - // Vertical Forms - (0xfe10 <= x && x <= 0xfe19) || - // CJK Compatibility Forms .. Small Form Variants - (0xfe30 <= x && x <= 0xfe6b) || - // Halfwidth and Fullwidth Forms - (0xff01 <= x && x <= 0xff60) || - (0xffe0 <= x && x <= 0xffe6) || - // Kana Supplement - (0x1b000 <= x && x <= 0x1b001) || - // Enclosed Ideographic Supplement - (0x1f200 <= x && x <= 0x1f251) || - // CJK Unified Ideographs Extension B .. Tertiary Ideographic Plane - (0x20000 <= x && x <= 0x3fffd) - ) - ) { - return true; - } - - return false; -}; diff --git a/deps/npm/node_modules/yargs/node_modules/is-fullwidth-code-point/license b/deps/npm/node_modules/yargs/node_modules/is-fullwidth-code-point/license deleted file mode 100644 index 654d0bfe943437..00000000000000 --- a/deps/npm/node_modules/yargs/node_modules/is-fullwidth-code-point/license +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -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/deps/npm/node_modules/yargs/node_modules/is-fullwidth-code-point/package.json b/deps/npm/node_modules/yargs/node_modules/is-fullwidth-code-point/package.json deleted file mode 100644 index 88ca7956f19705..00000000000000 --- a/deps/npm/node_modules/yargs/node_modules/is-fullwidth-code-point/package.json +++ /dev/null @@ -1,77 +0,0 @@ -{ - "_from": "is-fullwidth-code-point@^2.0.0", - "_id": "is-fullwidth-code-point@2.0.0", - "_inBundle": false, - "_integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", - "_location": "/yargs/is-fullwidth-code-point", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "is-fullwidth-code-point@^2.0.0", - "name": "is-fullwidth-code-point", - "escapedName": "is-fullwidth-code-point", - "rawSpec": "^2.0.0", - "saveSpec": null, - "fetchSpec": "^2.0.0" - }, - "_requiredBy": [ - "/yargs/string-width" - ], - "_resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", - "_shasum": "a3b30a5c4f199183167aaab93beefae3ddfb654f", - "_spec": "is-fullwidth-code-point@^2.0.0", - "_where": "/Users/claudiahdz/npm/cli/node_modules/yargs/node_modules/string-width", - "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": "*", - "xo": "*" - }, - "engines": { - "node": ">=4" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/sindresorhus/is-fullwidth-code-point#readme", - "keywords": [ - "fullwidth", - "full-width", - "full", - "width", - "unicode", - "character", - "char", - "string", - "str", - "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" - }, - "version": "2.0.0", - "xo": { - "esnext": true - } -} diff --git a/deps/npm/node_modules/yargs/node_modules/is-fullwidth-code-point/readme.md b/deps/npm/node_modules/yargs/node_modules/is-fullwidth-code-point/readme.md deleted file mode 100644 index 093b0281b2c46b..00000000000000 --- a/deps/npm/node_modules/yargs/node_modules/is-fullwidth-code-point/readme.md +++ /dev/null @@ -1,39 +0,0 @@ -# is-fullwidth-code-point [![Build Status](https://travis-ci.org/sindresorhus/is-fullwidth-code-point.svg?branch=master)](https://travis-ci.org/sindresorhus/is-fullwidth-code-point) - -> Check if the character represented by a given [Unicode code point](https://en.wikipedia.org/wiki/Code_point) is [fullwidth](https://en.wikipedia.org/wiki/Halfwidth_and_fullwidth_forms) - - -## Install - -``` -$ npm install --save is-fullwidth-code-point -``` - - -## Usage - -```js -const isFullwidthCodePoint = require('is-fullwidth-code-point'); - -isFullwidthCodePoint('谢'.codePointAt()); -//=> true - -isFullwidthCodePoint('a'.codePointAt()); -//=> false -``` - - -## API - -### isFullwidthCodePoint(input) - -#### input - -Type: `number` - -[Code point](https://en.wikipedia.org/wiki/Code_point) of a character. - - -## License - -MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/deps/npm/node_modules/yargs/node_modules/locate-path/index.js b/deps/npm/node_modules/yargs/node_modules/locate-path/index.js deleted file mode 100644 index 5aae6ee4ad0277..00000000000000 --- a/deps/npm/node_modules/yargs/node_modules/locate-path/index.js +++ /dev/null @@ -1,24 +0,0 @@ -'use strict'; -const path = require('path'); -const pathExists = require('path-exists'); -const pLocate = require('p-locate'); - -module.exports = (iterable, options) => { - options = Object.assign({ - cwd: process.cwd() - }, options); - - return pLocate(iterable, el => pathExists(path.resolve(options.cwd, el)), options); -}; - -module.exports.sync = (iterable, options) => { - options = Object.assign({ - cwd: process.cwd() - }, options); - - for (const el of iterable) { - if (pathExists.sync(path.resolve(options.cwd, el))) { - return el; - } - } -}; diff --git a/deps/npm/node_modules/yargs/node_modules/locate-path/license b/deps/npm/node_modules/yargs/node_modules/locate-path/license deleted file mode 100644 index e7af2f77107d73..00000000000000 --- a/deps/npm/node_modules/yargs/node_modules/locate-path/license +++ /dev/null @@ -1,9 +0,0 @@ -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/deps/npm/node_modules/yargs/node_modules/locate-path/package.json b/deps/npm/node_modules/yargs/node_modules/locate-path/package.json deleted file mode 100644 index 4800b6856bf929..00000000000000 --- a/deps/npm/node_modules/yargs/node_modules/locate-path/package.json +++ /dev/null @@ -1,76 +0,0 @@ -{ - "_from": "locate-path@^3.0.0", - "_id": "locate-path@3.0.0", - "_inBundle": false, - "_integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", - "_location": "/yargs/locate-path", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "locate-path@^3.0.0", - "name": "locate-path", - "escapedName": "locate-path", - "rawSpec": "^3.0.0", - "saveSpec": null, - "fetchSpec": "^3.0.0" - }, - "_requiredBy": [ - "/yargs/find-up" - ], - "_resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", - "_shasum": "dbec3b3ab759758071b58fe59fc41871af21400e", - "_spec": "locate-path@^3.0.0", - "_where": "/Users/claudiahdz/npm/cli/node_modules/yargs/node_modules/find-up", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "bugs": { - "url": "https://github.com/sindresorhus/locate-path/issues" - }, - "bundleDependencies": false, - "dependencies": { - "p-locate": "^3.0.0", - "path-exists": "^3.0.0" - }, - "deprecated": false, - "description": "Get the first path that exists on disk of multiple paths", - "devDependencies": { - "ava": "*", - "xo": "*" - }, - "engines": { - "node": ">=6" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/sindresorhus/locate-path#readme", - "keywords": [ - "locate", - "path", - "paths", - "file", - "files", - "exists", - "find", - "finder", - "search", - "searcher", - "array", - "iterable", - "iterator" - ], - "license": "MIT", - "name": "locate-path", - "repository": { - "type": "git", - "url": "git+https://github.com/sindresorhus/locate-path.git" - }, - "scripts": { - "test": "xo && ava" - }, - "version": "3.0.0" -} diff --git a/deps/npm/node_modules/yargs/node_modules/locate-path/readme.md b/deps/npm/node_modules/yargs/node_modules/locate-path/readme.md deleted file mode 100644 index a1d2e628328c2b..00000000000000 --- a/deps/npm/node_modules/yargs/node_modules/locate-path/readme.md +++ /dev/null @@ -1,99 +0,0 @@ -# locate-path [![Build Status](https://travis-ci.org/sindresorhus/locate-path.svg?branch=master)](https://travis-ci.org/sindresorhus/locate-path) - -> Get the first path that exists on disk of multiple paths - - -## Install - -``` -$ npm install locate-path -``` - - -## Usage - -Here we find the first file that exists on disk, in array order. - -```js -const locatePath = require('locate-path'); - -const files = [ - 'unicorn.png', - 'rainbow.png', // Only this one actually exists on disk - 'pony.png' -]; - -(async () => { - console(await locatePath(files)); - //=> 'rainbow' -})(); -``` - - -## API - -### locatePath(input, [options]) - -Returns a `Promise` for the first path that exists or `undefined` if none exists. - -#### input - -Type: `Iterable` - -Paths to check. - -#### options - -Type: `Object` - -##### concurrency - -Type: `number`
    -Default: `Infinity`
    -Minimum: `1` - -Number of concurrently pending promises. - -##### preserveOrder - -Type: `boolean`
    -Default: `true` - -Preserve `input` order when searching. - -Disable this to improve performance if you don't care about the order. - -##### cwd - -Type: `string`
    -Default: `process.cwd()` - -Current working directory. - -### locatePath.sync(input, [options]) - -Returns the first path that exists or `undefined` if none exists. - -#### input - -Type: `Iterable` - -Paths to check. - -#### options - -Type: `Object` - -##### cwd - -Same as above. - - -## Related - -- [path-exists](https://github.com/sindresorhus/path-exists) - Check if a path exists - - -## License - -MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/deps/npm/node_modules/yargs/node_modules/p-limit/index.d.ts b/deps/npm/node_modules/yargs/node_modules/p-limit/index.d.ts deleted file mode 100644 index 6bbfad4ac77665..00000000000000 --- a/deps/npm/node_modules/yargs/node_modules/p-limit/index.d.ts +++ /dev/null @@ -1,38 +0,0 @@ -export interface Limit { - /** - @param fn - Promise-returning/async function. - @param arguments - Any arguments to pass through to `fn`. Support for passing arguments on to the `fn` is provided in order to be able to avoid creating unnecessary closures. You probably don't need this optimization unless you're pushing a lot of functions. - @returns The promise returned by calling `fn(...arguments)`. - */ - ( - fn: (...arguments: Arguments) => PromiseLike | ReturnType, - ...arguments: Arguments - ): Promise; - - /** - The number of promises that are currently running. - */ - readonly activeCount: number; - - /** - The number of promises that are waiting to run (i.e. their internal `fn` was not called yet). - */ - readonly pendingCount: number; - - /** - Discard pending promises that are waiting to run. - - This might be useful if you want to teardown the queue at the end of your program's lifecycle or discard any function calls referencing an intermediary state of your app. - - Note: This does not cancel promises that are already running. - */ - clearQueue(): void; -} - -/** -Run multiple promise-returning & async functions with limited concurrency. - -@param concurrency - Concurrency limit. Minimum: `1`. -@returns A `limit` function. -*/ -export default function pLimit(concurrency: number): Limit; diff --git a/deps/npm/node_modules/yargs/node_modules/p-limit/index.js b/deps/npm/node_modules/yargs/node_modules/p-limit/index.js deleted file mode 100644 index 6a72a4c4fc3c72..00000000000000 --- a/deps/npm/node_modules/yargs/node_modules/p-limit/index.js +++ /dev/null @@ -1,57 +0,0 @@ -'use strict'; -const pTry = require('p-try'); - -const pLimit = concurrency => { - if (!((Number.isInteger(concurrency) || concurrency === Infinity) && concurrency > 0)) { - return Promise.reject(new TypeError('Expected `concurrency` to be a number from 1 and up')); - } - - const queue = []; - let activeCount = 0; - - const next = () => { - activeCount--; - - if (queue.length > 0) { - queue.shift()(); - } - }; - - const run = (fn, resolve, ...args) => { - activeCount++; - - const result = pTry(fn, ...args); - - resolve(result); - - result.then(next, next); - }; - - const enqueue = (fn, resolve, ...args) => { - if (activeCount < concurrency) { - run(fn, resolve, ...args); - } else { - queue.push(run.bind(null, fn, resolve, ...args)); - } - }; - - const generator = (fn, ...args) => new Promise(resolve => enqueue(fn, resolve, ...args)); - Object.defineProperties(generator, { - activeCount: { - get: () => activeCount - }, - pendingCount: { - get: () => queue.length - }, - clearQueue: { - value: () => { - queue.length = 0; - } - } - }); - - return generator; -}; - -module.exports = pLimit; -module.exports.default = pLimit; diff --git a/deps/npm/node_modules/yargs/node_modules/p-limit/license b/deps/npm/node_modules/yargs/node_modules/p-limit/license deleted file mode 100644 index e7af2f77107d73..00000000000000 --- a/deps/npm/node_modules/yargs/node_modules/p-limit/license +++ /dev/null @@ -1,9 +0,0 @@ -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/deps/npm/node_modules/yargs/node_modules/p-limit/package.json b/deps/npm/node_modules/yargs/node_modules/p-limit/package.json deleted file mode 100644 index 1aef677a317514..00000000000000 --- a/deps/npm/node_modules/yargs/node_modules/p-limit/package.json +++ /dev/null @@ -1,84 +0,0 @@ -{ - "_from": "p-limit@^2.0.0", - "_id": "p-limit@2.3.0", - "_inBundle": false, - "_integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", - "_location": "/yargs/p-limit", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "p-limit@^2.0.0", - "name": "p-limit", - "escapedName": "p-limit", - "rawSpec": "^2.0.0", - "saveSpec": null, - "fetchSpec": "^2.0.0" - }, - "_requiredBy": [ - "/yargs/p-locate" - ], - "_resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", - "_shasum": "3dd33c647a214fdfffd835933eb086da0dc21db1", - "_spec": "p-limit@^2.0.0", - "_where": "/Users/claudiahdz/npm/cli/node_modules/yargs/node_modules/p-locate", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "bugs": { - "url": "https://github.com/sindresorhus/p-limit/issues" - }, - "bundleDependencies": false, - "dependencies": { - "p-try": "^2.0.0" - }, - "deprecated": false, - "description": "Run multiple promise-returning & async functions with limited concurrency", - "devDependencies": { - "ava": "^1.2.1", - "delay": "^4.1.0", - "in-range": "^1.0.0", - "random-int": "^1.0.0", - "time-span": "^2.0.0", - "tsd-check": "^0.3.0", - "xo": "^0.24.0" - }, - "engines": { - "node": ">=6" - }, - "files": [ - "index.js", - "index.d.ts" - ], - "funding": "https://github.com/sponsors/sindresorhus", - "homepage": "https://github.com/sindresorhus/p-limit#readme", - "keywords": [ - "promise", - "limit", - "limited", - "concurrency", - "throttle", - "throat", - "rate", - "batch", - "ratelimit", - "task", - "queue", - "async", - "await", - "promises", - "bluebird" - ], - "license": "MIT", - "name": "p-limit", - "repository": { - "type": "git", - "url": "git+https://github.com/sindresorhus/p-limit.git" - }, - "scripts": { - "test": "xo && ava && tsd-check" - }, - "version": "2.3.0" -} diff --git a/deps/npm/node_modules/yargs/node_modules/p-limit/readme.md b/deps/npm/node_modules/yargs/node_modules/p-limit/readme.md deleted file mode 100644 index 64aa476e2370c1..00000000000000 --- a/deps/npm/node_modules/yargs/node_modules/p-limit/readme.md +++ /dev/null @@ -1,101 +0,0 @@ -# p-limit [![Build Status](https://travis-ci.org/sindresorhus/p-limit.svg?branch=master)](https://travis-ci.org/sindresorhus/p-limit) - -> Run multiple promise-returning & async functions with limited concurrency - -## Install - -``` -$ npm install p-limit -``` - -## Usage - -```js -const pLimit = require('p-limit'); - -const limit = pLimit(1); - -const input = [ - limit(() => fetchSomething('foo')), - limit(() => fetchSomething('bar')), - limit(() => doSomething()) -]; - -(async () => { - // Only one promise is run at once - const result = await Promise.all(input); - console.log(result); -})(); -``` - -## API - -### pLimit(concurrency) - -Returns a `limit` function. - -#### concurrency - -Type: `number`\ -Minimum: `1`\ -Default: `Infinity` - -Concurrency limit. - -### limit(fn, ...args) - -Returns the promise returned by calling `fn(...args)`. - -#### fn - -Type: `Function` - -Promise-returning/async function. - -#### args - -Any arguments to pass through to `fn`. - -Support for passing arguments on to the `fn` is provided in order to be able to avoid creating unnecessary closures. You probably don't need this optimization unless you're pushing a *lot* of functions. - -### limit.activeCount - -The number of promises that are currently running. - -### limit.pendingCount - -The number of promises that are waiting to run (i.e. their internal `fn` was not called yet). - -### limit.clearQueue() - -Discard pending promises that are waiting to run. - -This might be useful if you want to teardown the queue at the end of your program's lifecycle or discard any function calls referencing an intermediary state of your app. - -Note: This does not cancel promises that are already running. - -## FAQ - -### How is this different from the [`p-queue`](https://github.com/sindresorhus/p-queue) package? - -This package is only about limiting the number of concurrent executions, while `p-queue` is a fully featured queue implementation with lots of different options, introspection, and ability to pause the queue. - -## Related - -- [p-queue](https://github.com/sindresorhus/p-queue) - Promise queue with concurrency control -- [p-throttle](https://github.com/sindresorhus/p-throttle) - Throttle promise-returning & async functions -- [p-debounce](https://github.com/sindresorhus/p-debounce) - Debounce promise-returning & async functions -- [p-all](https://github.com/sindresorhus/p-all) - Run promise-returning & async functions concurrently with optional limited concurrency -- [More…](https://github.com/sindresorhus/promise-fun) - ---- - -
    - - 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/deps/npm/node_modules/yargs/node_modules/p-locate/index.js b/deps/npm/node_modules/yargs/node_modules/p-locate/index.js deleted file mode 100644 index 4bd08aad193128..00000000000000 --- a/deps/npm/node_modules/yargs/node_modules/p-locate/index.js +++ /dev/null @@ -1,34 +0,0 @@ -'use strict'; -const pLimit = require('p-limit'); - -class EndError extends Error { - constructor(value) { - super(); - this.value = value; - } -} - -// The input can also be a promise, so we `Promise.resolve()` it -const testElement = (el, tester) => Promise.resolve(el).then(tester); - -// The input can also be a promise, so we `Promise.all()` them both -const finder = el => Promise.all(el).then(val => val[1] === true && Promise.reject(new EndError(val[0]))); - -module.exports = (iterable, tester, opts) => { - opts = Object.assign({ - concurrency: Infinity, - preserveOrder: true - }, opts); - - const limit = pLimit(opts.concurrency); - - // Start all the promises concurrently with optional limit - const items = [...iterable].map(el => [el, limit(testElement, el, tester)]); - - // Check the promises either serially or concurrently - const checkLimit = pLimit(opts.preserveOrder ? 1 : Infinity); - - return Promise.all(items.map(el => checkLimit(finder, el))) - .then(() => {}) - .catch(err => err instanceof EndError ? err.value : Promise.reject(err)); -}; diff --git a/deps/npm/node_modules/yargs/node_modules/p-locate/license b/deps/npm/node_modules/yargs/node_modules/p-locate/license deleted file mode 100644 index e7af2f77107d73..00000000000000 --- a/deps/npm/node_modules/yargs/node_modules/p-locate/license +++ /dev/null @@ -1,9 +0,0 @@ -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/deps/npm/node_modules/yargs/node_modules/p-locate/package.json b/deps/npm/node_modules/yargs/node_modules/p-locate/package.json deleted file mode 100644 index b6cefbf4248c53..00000000000000 --- a/deps/npm/node_modules/yargs/node_modules/p-locate/package.json +++ /dev/null @@ -1,83 +0,0 @@ -{ - "_from": "p-locate@^3.0.0", - "_id": "p-locate@3.0.0", - "_inBundle": false, - "_integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", - "_location": "/yargs/p-locate", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "p-locate@^3.0.0", - "name": "p-locate", - "escapedName": "p-locate", - "rawSpec": "^3.0.0", - "saveSpec": null, - "fetchSpec": "^3.0.0" - }, - "_requiredBy": [ - "/yargs/locate-path" - ], - "_resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz", - "_shasum": "322d69a05c0264b25997d9f40cd8a891ab0064a4", - "_spec": "p-locate@^3.0.0", - "_where": "/Users/claudiahdz/npm/cli/node_modules/yargs/node_modules/locate-path", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "bugs": { - "url": "https://github.com/sindresorhus/p-locate/issues" - }, - "bundleDependencies": false, - "dependencies": { - "p-limit": "^2.0.0" - }, - "deprecated": false, - "description": "Get the first fulfilled promise that satisfies the provided testing function", - "devDependencies": { - "ava": "*", - "delay": "^3.0.0", - "in-range": "^1.0.0", - "time-span": "^2.0.0", - "xo": "*" - }, - "engines": { - "node": ">=6" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/sindresorhus/p-locate#readme", - "keywords": [ - "promise", - "locate", - "find", - "finder", - "search", - "searcher", - "test", - "array", - "collection", - "iterable", - "iterator", - "race", - "fulfilled", - "fastest", - "async", - "await", - "promises", - "bluebird" - ], - "license": "MIT", - "name": "p-locate", - "repository": { - "type": "git", - "url": "git+https://github.com/sindresorhus/p-locate.git" - }, - "scripts": { - "test": "xo && ava" - }, - "version": "3.0.0" -} diff --git a/deps/npm/node_modules/yargs/node_modules/p-locate/readme.md b/deps/npm/node_modules/yargs/node_modules/p-locate/readme.md deleted file mode 100644 index 3b0173bc4ea784..00000000000000 --- a/deps/npm/node_modules/yargs/node_modules/p-locate/readme.md +++ /dev/null @@ -1,88 +0,0 @@ -# p-locate [![Build Status](https://travis-ci.org/sindresorhus/p-locate.svg?branch=master)](https://travis-ci.org/sindresorhus/p-locate) - -> Get the first fulfilled promise that satisfies the provided testing function - -Think of it like an async version of [`Array#find`](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Array/find). - - -## Install - -``` -$ npm install p-locate -``` - - -## Usage - -Here we find the first file that exists on disk, in array order. - -```js -const pathExists = require('path-exists'); -const pLocate = require('p-locate'); - -const files = [ - 'unicorn.png', - 'rainbow.png', // Only this one actually exists on disk - 'pony.png' -]; - -(async () => { - const foundPath = await pLocate(files, file => pathExists(file)); - - console.log(foundPath); - //=> 'rainbow' -})(); -``` - -*The above is just an example. Use [`locate-path`](https://github.com/sindresorhus/locate-path) if you need this.* - - -## API - -### pLocate(input, tester, [options]) - -Returns a `Promise` that is fulfilled when `tester` resolves to `true` or the iterable is done, or rejects if any of the promises reject. The fulfilled value is the current iterable value or `undefined` if `tester` never resolved to `true`. - -#### input - -Type: `Iterable` - -#### tester(element) - -Type: `Function` - -Expected to return a `Promise` or boolean. - -#### options - -Type: `Object` - -##### concurrency - -Type: `number`
    -Default: `Infinity`
    -Minimum: `1` - -Number of concurrently pending promises returned by `tester`. - -##### preserveOrder - -Type: `boolean`
    -Default: `true` - -Preserve `input` order when searching. - -Disable this to improve performance if you don't care about the order. - - -## Related - -- [p-map](https://github.com/sindresorhus/p-map) - Map over promises concurrently -- [p-filter](https://github.com/sindresorhus/p-filter) - Filter promises concurrently -- [p-any](https://github.com/sindresorhus/p-any) - Wait for any promise to be fulfilled -- [More…](https://github.com/sindresorhus/promise-fun) - - -## License - -MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/deps/npm/node_modules/yargs/node_modules/p-try/index.d.ts b/deps/npm/node_modules/yargs/node_modules/p-try/index.d.ts deleted file mode 100644 index 2a7319ec2a5568..00000000000000 --- a/deps/npm/node_modules/yargs/node_modules/p-try/index.d.ts +++ /dev/null @@ -1,39 +0,0 @@ -declare const pTry: { - /** - Start a promise chain. - - @param fn - The function to run to start the promise chain. - @param arguments - Arguments to pass to `fn`. - @returns The value of calling `fn(...arguments)`. If the function throws an error, the returned `Promise` will be rejected with that error. - - @example - ``` - import pTry = require('p-try'); - - (async () => { - try { - const value = await pTry(() => { - return synchronousFunctionThatMightThrow(); - }); - console.log(value); - } catch (error) { - console.error(error); - } - })(); - ``` - */ - ( - fn: (...arguments: ArgumentsType) => PromiseLike | ValueType, - ...arguments: ArgumentsType - ): Promise; - - // TODO: remove this in the next major version, refactor the whole definition to: - // declare function pTry( - // fn: (...arguments: ArgumentsType) => PromiseLike | ValueType, - // ...arguments: ArgumentsType - // ): Promise; - // export = pTry; - default: typeof pTry; -}; - -export = pTry; diff --git a/deps/npm/node_modules/yargs/node_modules/p-try/index.js b/deps/npm/node_modules/yargs/node_modules/p-try/index.js deleted file mode 100644 index db858da29252b8..00000000000000 --- a/deps/npm/node_modules/yargs/node_modules/p-try/index.js +++ /dev/null @@ -1,9 +0,0 @@ -'use strict'; - -const pTry = (fn, ...arguments_) => new Promise(resolve => { - resolve(fn(...arguments_)); -}); - -module.exports = pTry; -// TODO: remove this in the next major version -module.exports.default = pTry; diff --git a/deps/npm/node_modules/yargs/node_modules/p-try/license b/deps/npm/node_modules/yargs/node_modules/p-try/license deleted file mode 100644 index e7af2f77107d73..00000000000000 --- a/deps/npm/node_modules/yargs/node_modules/p-try/license +++ /dev/null @@ -1,9 +0,0 @@ -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/deps/npm/node_modules/yargs/node_modules/p-try/package.json b/deps/npm/node_modules/yargs/node_modules/p-try/package.json deleted file mode 100644 index 7ed46850f64d4c..00000000000000 --- a/deps/npm/node_modules/yargs/node_modules/p-try/package.json +++ /dev/null @@ -1,74 +0,0 @@ -{ - "_from": "p-try@^2.0.0", - "_id": "p-try@2.2.0", - "_inBundle": false, - "_integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", - "_location": "/yargs/p-try", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "p-try@^2.0.0", - "name": "p-try", - "escapedName": "p-try", - "rawSpec": "^2.0.0", - "saveSpec": null, - "fetchSpec": "^2.0.0" - }, - "_requiredBy": [ - "/yargs/p-limit" - ], - "_resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", - "_shasum": "cb2868540e313d61de58fafbe35ce9004d5540e6", - "_spec": "p-try@^2.0.0", - "_where": "/Users/claudiahdz/npm/cli/node_modules/yargs/node_modules/p-limit", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "bugs": { - "url": "https://github.com/sindresorhus/p-try/issues" - }, - "bundleDependencies": false, - "deprecated": false, - "description": "`Start a promise chain", - "devDependencies": { - "ava": "^1.4.1", - "tsd": "^0.7.1", - "xo": "^0.24.0" - }, - "engines": { - "node": ">=6" - }, - "files": [ - "index.js", - "index.d.ts" - ], - "homepage": "https://github.com/sindresorhus/p-try#readme", - "keywords": [ - "promise", - "try", - "resolve", - "function", - "catch", - "async", - "await", - "promises", - "settled", - "ponyfill", - "polyfill", - "shim", - "bluebird" - ], - "license": "MIT", - "name": "p-try", - "repository": { - "type": "git", - "url": "git+https://github.com/sindresorhus/p-try.git" - }, - "scripts": { - "test": "xo && ava && tsd" - }, - "version": "2.2.0" -} diff --git a/deps/npm/node_modules/yargs/node_modules/p-try/readme.md b/deps/npm/node_modules/yargs/node_modules/p-try/readme.md deleted file mode 100644 index 4d7bd64dfcb8ba..00000000000000 --- a/deps/npm/node_modules/yargs/node_modules/p-try/readme.md +++ /dev/null @@ -1,58 +0,0 @@ -# p-try [![Build Status](https://travis-ci.org/sindresorhus/p-try.svg?branch=master)](https://travis-ci.org/sindresorhus/p-try) - -> Start a promise chain - -[How is it useful?](http://cryto.net/~joepie91/blog/2016/05/11/what-is-promise-try-and-why-does-it-matter/) - - -## Install - -``` -$ npm install p-try -``` - - -## Usage - -```js -const pTry = require('p-try'); - -(async () => { - try { - const value = await pTry(() => { - return synchronousFunctionThatMightThrow(); - }); - console.log(value); - } catch (error) { - console.error(error); - } -})(); -``` - - -## API - -### pTry(fn, ...arguments) - -Returns a `Promise` resolved with the value of calling `fn(...arguments)`. If the function throws an error, the returned `Promise` will be rejected with that error. - -Support for passing arguments on to the `fn` is provided in order to be able to avoid creating unnecessary closures. You probably don't need this optimization unless you're pushing a *lot* of functions. - -#### fn - -The function to run to start the promise chain. - -#### arguments - -Arguments to pass to `fn`. - - -## Related - -- [p-finally](https://github.com/sindresorhus/p-finally) - `Promise#finally()` ponyfill - Invoked when the promise is settled regardless of outcome -- [More…](https://github.com/sindresorhus/promise-fun) - - -## License - -MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/deps/npm/node_modules/yargs/node_modules/string-width/index.js b/deps/npm/node_modules/yargs/node_modules/string-width/index.js deleted file mode 100644 index 33c9d6c06f7a59..00000000000000 --- a/deps/npm/node_modules/yargs/node_modules/string-width/index.js +++ /dev/null @@ -1,39 +0,0 @@ -'use strict'; -const stripAnsi = require('strip-ansi'); -const isFullwidthCodePoint = require('is-fullwidth-code-point'); -const emojiRegex = require('emoji-regex')(); - -module.exports = input => { - input = input.replace(emojiRegex, ' '); - - if (typeof input !== 'string' || input.length === 0) { - return 0; - } - - input = stripAnsi(input); - - let width = 0; - - for (let i = 0; i < input.length; i++) { - const code = input.codePointAt(i); - - // Ignore control characters - if (code <= 0x1F || (code >= 0x7F && code <= 0x9F)) { - continue; - } - - // Ignore combining characters - if (code >= 0x300 && code <= 0x36F) { - continue; - } - - // Surrogates - if (code > 0xFFFF) { - i++; - } - - width += isFullwidthCodePoint(code) ? 2 : 1; - } - - return width; -}; diff --git a/deps/npm/node_modules/yargs/node_modules/string-width/license b/deps/npm/node_modules/yargs/node_modules/string-width/license deleted file mode 100644 index e7af2f77107d73..00000000000000 --- a/deps/npm/node_modules/yargs/node_modules/string-width/license +++ /dev/null @@ -1,9 +0,0 @@ -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/deps/npm/node_modules/yargs/node_modules/string-width/package.json b/deps/npm/node_modules/yargs/node_modules/string-width/package.json deleted file mode 100644 index 328f386cdc922e..00000000000000 --- a/deps/npm/node_modules/yargs/node_modules/string-width/package.json +++ /dev/null @@ -1,88 +0,0 @@ -{ - "_from": "string-width@^3.0.0", - "_id": "string-width@3.1.0", - "_inBundle": false, - "_integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", - "_location": "/yargs/string-width", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "string-width@^3.0.0", - "name": "string-width", - "escapedName": "string-width", - "rawSpec": "^3.0.0", - "saveSpec": null, - "fetchSpec": "^3.0.0" - }, - "_requiredBy": [ - "/yargs" - ], - "_resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", - "_shasum": "22767be21b62af1081574306f69ac51b62203961", - "_spec": "string-width@^3.0.0", - "_where": "/Users/claudiahdz/npm/cli/node_modules/yargs", - "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": "^7.0.1", - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^5.1.0" - }, - "deprecated": false, - "description": "Get the visual width of a string - the number of columns required to display it", - "devDependencies": { - "ava": "^1.0.1", - "xo": "^0.23.0" - }, - "engines": { - "node": ">=6" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/sindresorhus/string-width#readme", - "keywords": [ - "string", - "str", - "character", - "char", - "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" - }, - "version": "3.1.0" -} diff --git a/deps/npm/node_modules/yargs/node_modules/string-width/readme.md b/deps/npm/node_modules/yargs/node_modules/string-width/readme.md deleted file mode 100644 index d39d95f56cf3f8..00000000000000 --- a/deps/npm/node_modules/yargs/node_modules/string-width/readme.md +++ /dev/null @@ -1,45 +0,0 @@ -# string-width [![Build Status](https://travis-ci.org/sindresorhus/string-width.svg?branch=master)](https://travis-ci.org/sindresorhus/string-width) - -> Get the visual width of a string - the number of columns required to display it - -Some Unicode characters are [fullwidth](https://en.wikipedia.org/wiki/Halfwidth_and_fullwidth_forms) and use double the normal width. [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code) are stripped and doesn't affect the width. - -Useful to be able to measure the actual width of command-line output. - - -## Install - -``` -$ npm install string-width -``` - - -## Usage - -```js -const stringWidth = require('string-width'); - -stringWidth('古'); -//=> 2 - -stringWidth('\u001b[1m古\u001b[22m'); -//=> 2 - -stringWidth('a'); -//=> 1 - -stringWidth('\u001B]8;;https://github.com\u0007Click\u001B]8;;\u0007'); -// => 5 -``` - - -## Related - -- [string-width-cli](https://github.com/sindresorhus/string-width-cli) - CLI for this module -- [string-length](https://github.com/sindresorhus/string-length) - Get the real length of a string -- [widest-line](https://github.com/sindresorhus/widest-line) - Get the visual width of the widest line in a string - - -## License - -MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/deps/npm/node_modules/yargs/node_modules/strip-ansi/index.d.ts b/deps/npm/node_modules/yargs/node_modules/strip-ansi/index.d.ts deleted file mode 100644 index 44e954d0c724d8..00000000000000 --- a/deps/npm/node_modules/yargs/node_modules/strip-ansi/index.d.ts +++ /dev/null @@ -1,15 +0,0 @@ -/** -Strip [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code) from a string. - -@example -``` -import stripAnsi from 'strip-ansi'; - -stripAnsi('\u001B[4mUnicorn\u001B[0m'); -//=> 'Unicorn' - -stripAnsi('\u001B]8;;https://github.com\u0007Click\u001B]8;;\u0007'); -//=> 'Click' -``` -*/ -export default function stripAnsi(string: string): string; diff --git a/deps/npm/node_modules/yargs/node_modules/strip-ansi/index.js b/deps/npm/node_modules/yargs/node_modules/strip-ansi/index.js deleted file mode 100644 index 9788c96dfa3b0c..00000000000000 --- a/deps/npm/node_modules/yargs/node_modules/strip-ansi/index.js +++ /dev/null @@ -1,7 +0,0 @@ -'use strict'; -const ansiRegex = require('ansi-regex'); - -const stripAnsi = string => typeof string === 'string' ? string.replace(ansiRegex(), '') : string; - -module.exports = stripAnsi; -module.exports.default = stripAnsi; diff --git a/deps/npm/node_modules/yargs/node_modules/strip-ansi/license b/deps/npm/node_modules/yargs/node_modules/strip-ansi/license deleted file mode 100644 index e7af2f77107d73..00000000000000 --- a/deps/npm/node_modules/yargs/node_modules/strip-ansi/license +++ /dev/null @@ -1,9 +0,0 @@ -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/deps/npm/node_modules/yargs/node_modules/strip-ansi/package.json b/deps/npm/node_modules/yargs/node_modules/strip-ansi/package.json deleted file mode 100644 index 127cf08941ca8c..00000000000000 --- a/deps/npm/node_modules/yargs/node_modules/strip-ansi/package.json +++ /dev/null @@ -1,86 +0,0 @@ -{ - "_from": "strip-ansi@^5.1.0", - "_id": "strip-ansi@5.2.0", - "_inBundle": false, - "_integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", - "_location": "/yargs/strip-ansi", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "strip-ansi@^5.1.0", - "name": "strip-ansi", - "escapedName": "strip-ansi", - "rawSpec": "^5.1.0", - "saveSpec": null, - "fetchSpec": "^5.1.0" - }, - "_requiredBy": [ - "/yargs/string-width" - ], - "_resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", - "_shasum": "8c9a536feb6afc962bdfa5b104a5091c1ad9c0ae", - "_spec": "strip-ansi@^5.1.0", - "_where": "/Users/claudiahdz/npm/cli/node_modules/yargs/node_modules/string-width", - "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": "^4.1.0" - }, - "deprecated": false, - "description": "Strip ANSI escape codes from a string", - "devDependencies": { - "ava": "^1.3.1", - "tsd-check": "^0.5.0", - "xo": "^0.24.0" - }, - "engines": { - "node": ">=6" - }, - "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-check" - }, - "version": "5.2.0" -} diff --git a/deps/npm/node_modules/yargs/node_modules/strip-ansi/readme.md b/deps/npm/node_modules/yargs/node_modules/strip-ansi/readme.md deleted file mode 100644 index 8681fe8af44242..00000000000000 --- a/deps/npm/node_modules/yargs/node_modules/strip-ansi/readme.md +++ /dev/null @@ -1,61 +0,0 @@ -# strip-ansi [![Build Status](https://travis-ci.org/chalk/strip-ansi.svg?branch=master)](https://travis-ci.org/chalk/strip-ansi) - -> Strip [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code) from a string - ---- - -
    - - Get professional support for 'strip-ansi' 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 - -``` -$ npm install strip-ansi -``` - - -## Usage - -```js -const stripAnsi = require('strip-ansi'); - -stripAnsi('\u001B[4mUnicorn\u001B[0m'); -//=> 'Unicorn' - -stripAnsi('\u001B]8;;https://github.com\u0007Click\u001B]8;;\u0007'); -//=> 'Click' -``` - - -## Security - -To report a security vulnerability, please use the [Tidelift security contact](https://tidelift.com/security). Tidelift will coordinate the fix and disclosure. - - -## Related - -- [strip-ansi-cli](https://github.com/chalk/strip-ansi-cli) - CLI for this module -- [strip-ansi-stream](https://github.com/chalk/strip-ansi-stream) - Streaming version of this module -- [has-ansi](https://github.com/chalk/has-ansi) - Check if a string has ANSI escape codes -- [ansi-regex](https://github.com/chalk/ansi-regex) - Regular expression for matching ANSI escape codes -- [chalk](https://github.com/chalk/chalk) - Terminal string styling done right - - -## Maintainers - -- [Sindre Sorhus](https://github.com/sindresorhus) -- [Josh Junon](https://github.com/qix-) - - -## License - -MIT diff --git a/deps/npm/node_modules/yargs/package.json b/deps/npm/node_modules/yargs/package.json deleted file mode 100644 index 3facc8afe3446a..00000000000000 --- a/deps/npm/node_modules/yargs/package.json +++ /dev/null @@ -1,110 +0,0 @@ -{ - "_from": "yargs@^14.2.3", - "_id": "yargs@14.2.3", - "_inBundle": false, - "_integrity": "sha512-ZbotRWhF+lkjijC/VhmOT9wSgyBQ7+zr13+YLkhfsSiTriYsMzkTUFP18pFhWwBeMa5gUc1MzbhrO6/VB7c9Xg==", - "_location": "/yargs", - "_phantomChildren": { - "emoji-regex": "7.0.3", - "path-exists": "3.0.0" - }, - "_requested": { - "type": "range", - "registry": true, - "raw": "yargs@^14.2.3", - "name": "yargs", - "escapedName": "yargs", - "rawSpec": "^14.2.3", - "saveSpec": null, - "fetchSpec": "^14.2.3" - }, - "_requiredBy": [ - "/libnpx" - ], - "_resolved": "https://registry.npmjs.org/yargs/-/yargs-14.2.3.tgz", - "_shasum": "1a1c3edced1afb2a2fea33604bc6d1d8d688a414", - "_spec": "yargs@^14.2.3", - "_where": "/Users/claudiahdz/npm/cli/node_modules/libnpx", - "bugs": { - "url": "https://github.com/yargs/yargs/issues" - }, - "bundleDependencies": false, - "contributors": [ - { - "name": "Yargs Contributors", - "url": "https://github.com/yargs/yargs/graphs/contributors" - } - ], - "dependencies": { - "cliui": "^5.0.0", - "decamelize": "^1.2.0", - "find-up": "^3.0.0", - "get-caller-file": "^2.0.1", - "require-directory": "^2.1.1", - "require-main-filename": "^2.0.0", - "set-blocking": "^2.0.0", - "string-width": "^3.0.0", - "which-module": "^2.0.0", - "y18n": "^4.0.0", - "yargs-parser": "^15.0.1" - }, - "deprecated": false, - "description": "yargs the modern, pirate-themed, successor to optimist.", - "devDependencies": { - "chai": "^4.2.0", - "chalk": "^2.4.2", - "coveralls": "^3.0.3", - "cpr": "^3.0.1", - "cross-spawn": "^6.0.4", - "es6-promise": "^4.2.5", - "hashish": "0.0.4", - "mocha": "^5.2.0", - "nyc": "^14.1.0", - "rimraf": "^2.6.3", - "standard": "^12.0.1", - "standard-version": "^7.0.0", - "which": "^1.3.1", - "yargs-test-extends": "^1.0.1" - }, - "engine": { - "node": ">=6" - }, - "files": [ - "index.js", - "yargs.js", - "lib", - "locales", - "completion.sh.hbs", - "completion.zsh.hbs", - "LICENSE" - ], - "homepage": "https://yargs.js.org/", - "keywords": [ - "argument", - "args", - "option", - "parser", - "parsing", - "cli", - "command" - ], - "license": "MIT", - "main": "./index.js", - "name": "yargs", - "repository": { - "type": "git", - "url": "git+https://github.com/yargs/yargs.git" - }, - "scripts": { - "coverage": "nyc report --reporter=text-lcov | coveralls", - "pretest": "standard", - "release": "standard-version", - "test": "nyc --cache mocha --require ./test/before.js --timeout=12000 --check-leaks" - }, - "standard": { - "ignore": [ - "**/example/**" - ] - }, - "version": "14.2.3" -} diff --git a/deps/npm/node_modules/yargs/yargs.js b/deps/npm/node_modules/yargs/yargs.js deleted file mode 100644 index fdc8a095a97dc7..00000000000000 --- a/deps/npm/node_modules/yargs/yargs.js +++ /dev/null @@ -1,1252 +0,0 @@ -'use strict' -const argsert = require('./lib/argsert') -const fs = require('fs') -const Command = require('./lib/command') -const Completion = require('./lib/completion') -const Parser = require('yargs-parser') -const path = require('path') -const Usage = require('./lib/usage') -const Validation = require('./lib/validation') -const Y18n = require('y18n') -const objFilter = require('./lib/obj-filter') -const setBlocking = require('set-blocking') -const applyExtends = require('./lib/apply-extends') -const { globalMiddlewareFactory } = require('./lib/middleware') -const YError = require('./lib/yerror') - -exports = module.exports = Yargs -function Yargs (processArgs, cwd, parentRequire) { - processArgs = processArgs || [] // handle calling yargs(). - - const self = {} - let command = null - let completion = null - let groups = {} - let globalMiddleware = [] - let output = '' - let preservedGroups = {} - let usage = null - let validation = null - - const y18n = Y18n({ - directory: path.resolve(__dirname, './locales'), - updateFiles: false - }) - - self.middleware = globalMiddlewareFactory(globalMiddleware, self) - - if (!cwd) cwd = process.cwd() - - self.scriptName = function (scriptName) { - self.customScriptName = true - self.$0 = scriptName - return self - } - - // ignore the node bin, specify this in your - // bin file with #!/usr/bin/env node - if (/\b(node|iojs|electron)(\.exe)?$/.test(process.argv[0])) { - self.$0 = process.argv.slice(1, 2) - } else { - self.$0 = process.argv.slice(0, 1) - } - - self.$0 = self.$0 - .map((x, i) => { - const b = rebase(cwd, x) - return x.match(/^(\/|([a-zA-Z]:)?\\)/) && b.length < x.length ? b : x - }) - .join(' ').trim() - - if (process.env._ !== undefined && process.argv[1] === process.env._) { - self.$0 = process.env._.replace( - `${path.dirname(process.execPath)}/`, '' - ) - } - - // use context object to keep track of resets, subcommand execution, etc - // submodules should modify and check the state of context as necessary - const context = { resets: -1, commands: [], fullCommands: [], files: [] } - self.getContext = () => context - - // puts yargs back into an initial state. any keys - // that have been set to "global" will not be reset - // by this action. - let options - self.resetOptions = self.reset = function resetOptions (aliases) { - context.resets++ - aliases = aliases || {} - options = options || {} - // put yargs back into an initial state, this - // logic is used to build a nested command - // hierarchy. - const tmpOptions = {} - tmpOptions.local = options.local ? options.local : [] - tmpOptions.configObjects = options.configObjects ? options.configObjects : [] - - // if a key has been explicitly set as local, - // we should reset it before passing options to command. - const localLookup = {} - tmpOptions.local.forEach((l) => { - localLookup[l] = true - ;(aliases[l] || []).forEach((a) => { - localLookup[a] = true - }) - }) - - // add all groups not set to local to preserved groups - Object.assign( - preservedGroups, - Object.keys(groups).reduce((acc, groupName) => { - const keys = groups[groupName].filter(key => !(key in localLookup)) - if (keys.length > 0) { - acc[groupName] = keys - } - return acc - }, {}) - ) - // groups can now be reset - groups = {} - - const arrayOptions = [ - 'array', 'boolean', 'string', 'skipValidation', - 'count', 'normalize', 'number', - 'hiddenOptions' - ] - - const objectOptions = [ - 'narg', 'key', 'alias', 'default', 'defaultDescription', - 'config', 'choices', 'demandedOptions', 'demandedCommands', 'coerce' - ] - - arrayOptions.forEach((k) => { - tmpOptions[k] = (options[k] || []).filter(k => !localLookup[k]) - }) - - objectOptions.forEach((k) => { - tmpOptions[k] = objFilter(options[k], (k, v) => !localLookup[k]) - }) - - tmpOptions.envPrefix = options.envPrefix - options = tmpOptions - - // if this is the first time being executed, create - // instances of all our helpers -- otherwise just reset. - usage = usage ? usage.reset(localLookup) : Usage(self, y18n) - validation = validation ? validation.reset(localLookup) : Validation(self, usage, y18n) - command = command ? command.reset() : Command(self, usage, validation, globalMiddleware) - if (!completion) completion = Completion(self, usage, command) - - completionCommand = null - output = '' - exitError = null - hasOutput = false - self.parsed = false - - return self - } - self.resetOptions() - - // temporary hack: allow "freezing" of reset-able state for parse(msg, cb) - let frozens = [] - function freeze () { - let frozen = {} - frozens.push(frozen) - frozen.options = options - frozen.configObjects = options.configObjects.slice(0) - frozen.exitProcess = exitProcess - frozen.groups = groups - usage.freeze() - validation.freeze() - command.freeze() - frozen.strict = strict - frozen.completionCommand = completionCommand - frozen.output = output - frozen.exitError = exitError - frozen.hasOutput = hasOutput - frozen.parsed = self.parsed - frozen.parseFn = parseFn - frozen.parseContext = parseContext - } - function unfreeze () { - let frozen = frozens.pop() - options = frozen.options - options.configObjects = frozen.configObjects - exitProcess = frozen.exitProcess - groups = frozen.groups - output = frozen.output - exitError = frozen.exitError - hasOutput = frozen.hasOutput - self.parsed = frozen.parsed - usage.unfreeze() - validation.unfreeze() - command.unfreeze() - strict = frozen.strict - completionCommand = frozen.completionCommand - parseFn = frozen.parseFn - parseContext = frozen.parseContext - } - - self.boolean = function (keys) { - argsert('', [keys], arguments.length) - populateParserHintArray('boolean', keys) - return self - } - - self.array = function (keys) { - argsert('', [keys], arguments.length) - populateParserHintArray('array', keys) - return self - } - - self.number = function (keys) { - argsert('', [keys], arguments.length) - populateParserHintArray('number', keys) - return self - } - - self.normalize = function (keys) { - argsert('', [keys], arguments.length) - populateParserHintArray('normalize', keys) - return self - } - - self.count = function (keys) { - argsert('', [keys], arguments.length) - populateParserHintArray('count', keys) - return self - } - - self.string = function (keys) { - argsert('', [keys], arguments.length) - populateParserHintArray('string', keys) - return self - } - - self.requiresArg = function (keys) { - argsert('', [keys], arguments.length) - populateParserHintObject(self.nargs, false, 'narg', keys, 1) - return self - } - - self.skipValidation = function (keys) { - argsert('', [keys], arguments.length) - populateParserHintArray('skipValidation', keys) - return self - } - - function populateParserHintArray (type, keys, value) { - keys = [].concat(keys) - keys.forEach((key) => { - key = sanitizeKey(key) - options[type].push(key) - }) - } - - self.nargs = function (key, value) { - argsert(' [number]', [key, value], arguments.length) - populateParserHintObject(self.nargs, false, 'narg', key, value) - return self - } - - self.choices = function (key, value) { - argsert(' [string|array]', [key, value], arguments.length) - populateParserHintObject(self.choices, true, 'choices', key, value) - return self - } - - self.alias = function (key, value) { - argsert(' [string|array]', [key, value], arguments.length) - populateParserHintObject(self.alias, true, 'alias', key, value) - return self - } - - // TODO: actually deprecate self.defaults. - self.default = self.defaults = function (key, value, defaultDescription) { - argsert(' [*] [string]', [key, value, defaultDescription], arguments.length) - if (defaultDescription) options.defaultDescription[key] = defaultDescription - if (typeof value === 'function') { - if (!options.defaultDescription[key]) options.defaultDescription[key] = usage.functionDescription(value) - value = value.call() - } - populateParserHintObject(self.default, false, 'default', key, value) - return self - } - - self.describe = function (key, desc) { - argsert(' [string]', [key, desc], arguments.length) - populateParserHintObject(self.describe, false, 'key', key, true) - usage.describe(key, desc) - return self - } - - self.demandOption = function (keys, msg) { - argsert(' [string]', [keys, msg], arguments.length) - populateParserHintObject(self.demandOption, false, 'demandedOptions', keys, msg) - return self - } - - self.coerce = function (keys, value) { - argsert(' [function]', [keys, value], arguments.length) - populateParserHintObject(self.coerce, false, 'coerce', keys, value) - return self - } - - function populateParserHintObject (builder, isArray, type, key, value) { - if (Array.isArray(key)) { - const temp = Object.create(null) - // an array of keys with one value ['x', 'y', 'z'], function parse () {} - key.forEach((k) => { - temp[k] = value - }) - builder(temp) - } else if (typeof key === 'object') { - // an object of key value pairs: {'x': parse () {}, 'y': parse() {}} - Object.keys(key).forEach((k) => { - builder(k, key[k]) - }) - } else { - key = sanitizeKey(key) - // a single key value pair 'x', parse() {} - if (isArray) { - options[type][key] = (options[type][key] || []).concat(value) - } else { - options[type][key] = value - } - } - } - - // TODO(bcoe): in future major versions move more objects towards - // Object.create(null): - function sanitizeKey (key) { - if (key === '__proto__') return '___proto___' - return key - } - - function deleteFromParserHintObject (optionKey) { - // delete from all parsing hints: - // boolean, array, key, alias, etc. - Object.keys(options).forEach((hintKey) => { - const hint = options[hintKey] - if (Array.isArray(hint)) { - if (~hint.indexOf(optionKey)) hint.splice(hint.indexOf(optionKey), 1) - } else if (typeof hint === 'object') { - delete hint[optionKey] - } - }) - // now delete the description from usage.js. - delete usage.getDescriptions()[optionKey] - } - - self.config = function config (key, msg, parseFn) { - argsert('[object|string] [string|function] [function]', [key, msg, parseFn], arguments.length) - // allow a config object to be provided directly. - if (typeof key === 'object') { - key = applyExtends(key, cwd, self.getParserConfiguration()['deep-merge-config']) - options.configObjects = (options.configObjects || []).concat(key) - return self - } - - // allow for a custom parsing function. - if (typeof msg === 'function') { - parseFn = msg - msg = null - } - - key = key || 'config' - self.describe(key, msg || usage.deferY18nLookup('Path to JSON config file')) - ;(Array.isArray(key) ? key : [key]).forEach((k) => { - options.config[k] = parseFn || true - }) - - return self - } - - self.example = function (cmd, description) { - argsert(' [string]', [cmd, description], arguments.length) - usage.example(cmd, description) - return self - } - - self.command = function (cmd, description, builder, handler, middlewares) { - argsert(' [string|boolean] [function|object] [function] [array]', [cmd, description, builder, handler, middlewares], arguments.length) - command.addHandler(cmd, description, builder, handler, middlewares) - return self - } - - self.commandDir = function (dir, opts) { - argsert(' [object]', [dir, opts], arguments.length) - const req = parentRequire || require - command.addDirectory(dir, self.getContext(), req, require('get-caller-file')(), opts) - return self - } - - // TODO: deprecate self.demand in favor of - // .demandCommand() .demandOption(). - self.demand = self.required = self.require = function demand (keys, max, msg) { - // you can optionally provide a 'max' key, - // which will raise an exception if too many '_' - // options are provided. - if (Array.isArray(max)) { - max.forEach((key) => { - self.demandOption(key, msg) - }) - max = Infinity - } else if (typeof max !== 'number') { - msg = max - max = Infinity - } - - if (typeof keys === 'number') { - self.demandCommand(keys, max, msg, msg) - } else if (Array.isArray(keys)) { - keys.forEach((key) => { - self.demandOption(key, msg) - }) - } else { - if (typeof msg === 'string') { - self.demandOption(keys, msg) - } else if (msg === true || typeof msg === 'undefined') { - self.demandOption(keys) - } - } - - return self - } - - self.demandCommand = function demandCommand (min, max, minMsg, maxMsg) { - argsert('[number] [number|string] [string|null|undefined] [string|null|undefined]', [min, max, minMsg, maxMsg], arguments.length) - - if (typeof min === 'undefined') min = 1 - - if (typeof max !== 'number') { - minMsg = max - max = Infinity - } - - self.global('_', false) - - options.demandedCommands._ = { - min, - max, - minMsg, - maxMsg - } - - return self - } - - self.getDemandedOptions = () => { - argsert([], 0) - return options.demandedOptions - } - - self.getDemandedCommands = () => { - argsert([], 0) - return options.demandedCommands - } - - self.implies = function (key, value) { - argsert(' [number|string|array]', [key, value], arguments.length) - validation.implies(key, value) - return self - } - - self.conflicts = function (key1, key2) { - argsert(' [string|array]', [key1, key2], arguments.length) - validation.conflicts(key1, key2) - return self - } - - self.usage = function (msg, description, builder, handler) { - argsert(' [string|boolean] [function|object] [function]', [msg, description, builder, handler], arguments.length) - - if (description !== undefined) { - // .usage() can be used as an alias for defining - // a default command. - if ((msg || '').match(/^\$0( |$)/)) { - return self.command(msg, description, builder, handler) - } else { - throw new YError('.usage() description must start with $0 if being used as alias for .command()') - } - } else { - usage.usage(msg) - return self - } - } - - self.epilogue = self.epilog = function (msg) { - argsert('', [msg], arguments.length) - usage.epilog(msg) - return self - } - - self.fail = function (f) { - argsert('', [f], arguments.length) - usage.failFn(f) - return self - } - - self.check = function (f, _global) { - argsert(' [boolean]', [f, _global], arguments.length) - validation.check(f, _global !== false) - return self - } - - self.global = function global (globals, global) { - argsert(' [boolean]', [globals, global], arguments.length) - globals = [].concat(globals) - if (global !== false) { - options.local = options.local.filter(l => globals.indexOf(l) === -1) - } else { - globals.forEach((g) => { - if (options.local.indexOf(g) === -1) options.local.push(g) - }) - } - return self - } - - self.pkgConf = function pkgConf (key, rootPath) { - argsert(' [string]', [key, rootPath], arguments.length) - let conf = null - // prefer cwd to require-main-filename in this method - // since we're looking for e.g. "nyc" config in nyc consumer - // rather than "yargs" config in nyc (where nyc is the main filename) - const obj = pkgUp(rootPath || cwd) - - // If an object exists in the key, add it to options.configObjects - if (obj[key] && typeof obj[key] === 'object') { - conf = applyExtends(obj[key], rootPath || cwd, self.getParserConfiguration()['deep-merge-config']) - options.configObjects = (options.configObjects || []).concat(conf) - } - - return self - } - - const pkgs = {} - function pkgUp (rootPath) { - const npath = rootPath || '*' - if (pkgs[npath]) return pkgs[npath] - const findUp = require('find-up') - - let obj = {} - try { - let startDir = rootPath || require('require-main-filename')(parentRequire || require) - - // When called in an environment that lacks require.main.filename, such as a jest test runner, - // startDir is already process.cwd(), and should not be shortened. - // Whether or not it is _actually_ a directory (e.g., extensionless bin) is irrelevant, find-up handles it. - if (!rootPath && path.extname(startDir)) { - startDir = path.dirname(startDir) - } - - const pkgJsonPath = findUp.sync('package.json', { - cwd: startDir - }) - obj = JSON.parse(fs.readFileSync(pkgJsonPath)) - } catch (noop) {} - - pkgs[npath] = obj || {} - return pkgs[npath] - } - - let parseFn = null - let parseContext = null - self.parse = function parse (args, shortCircuit, _parseFn) { - argsert('[string|array] [function|boolean|object] [function]', [args, shortCircuit, _parseFn], arguments.length) - freeze() - if (typeof args === 'undefined') { - const argv = self._parseArgs(processArgs) - const tmpParsed = self.parsed - unfreeze() - // TODO: remove this compatibility hack when we release yargs@15.x: - self.parsed = tmpParsed - return argv - } - - // a context object can optionally be provided, this allows - // additional information to be passed to a command handler. - if (typeof shortCircuit === 'object') { - parseContext = shortCircuit - shortCircuit = _parseFn - } - - // by providing a function as a second argument to - // parse you can capture output that would otherwise - // default to printing to stdout/stderr. - if (typeof shortCircuit === 'function') { - parseFn = shortCircuit - shortCircuit = null - } - // completion short-circuits the parsing process, - // skipping validation, etc. - if (!shortCircuit) processArgs = args - - if (parseFn) exitProcess = false - - const parsed = self._parseArgs(args, shortCircuit) - if (parseFn) parseFn(exitError, parsed, output) - unfreeze() - - return parsed - } - - self._getParseContext = () => parseContext || {} - - self._hasParseCallback = () => !!parseFn - - self.option = self.options = function option (key, opt) { - argsert(' [object]', [key, opt], arguments.length) - if (typeof key === 'object') { - Object.keys(key).forEach((k) => { - self.options(k, key[k]) - }) - } else { - if (typeof opt !== 'object') { - opt = {} - } - - options.key[key] = true // track manually set keys. - - if (opt.alias) self.alias(key, opt.alias) - - const demand = opt.demand || opt.required || opt.require - - // deprecated, use 'demandOption' instead - if (demand) { - self.demand(key, demand) - } - - if (opt.demandOption) { - self.demandOption(key, typeof opt.demandOption === 'string' ? opt.demandOption : undefined) - } - - if ('conflicts' in opt) { - self.conflicts(key, opt.conflicts) - } - - if ('default' in opt) { - self.default(key, opt.default) - } - - if ('implies' in opt) { - self.implies(key, opt.implies) - } - - if ('nargs' in opt) { - self.nargs(key, opt.nargs) - } - - if (opt.config) { - self.config(key, opt.configParser) - } - - if (opt.normalize) { - self.normalize(key) - } - - if ('choices' in opt) { - self.choices(key, opt.choices) - } - - if ('coerce' in opt) { - self.coerce(key, opt.coerce) - } - - if ('group' in opt) { - self.group(key, opt.group) - } - - if (opt.boolean || opt.type === 'boolean') { - self.boolean(key) - if (opt.alias) self.boolean(opt.alias) - } - - if (opt.array || opt.type === 'array') { - self.array(key) - if (opt.alias) self.array(opt.alias) - } - - if (opt.number || opt.type === 'number') { - self.number(key) - if (opt.alias) self.number(opt.alias) - } - - if (opt.string || opt.type === 'string') { - self.string(key) - if (opt.alias) self.string(opt.alias) - } - - if (opt.count || opt.type === 'count') { - self.count(key) - } - - if (typeof opt.global === 'boolean') { - self.global(key, opt.global) - } - - if (opt.defaultDescription) { - options.defaultDescription[key] = opt.defaultDescription - } - - if (opt.skipValidation) { - self.skipValidation(key) - } - - const desc = opt.describe || opt.description || opt.desc - self.describe(key, desc) - if (opt.hidden) { - self.hide(key) - } - - if (opt.requiresArg) { - self.requiresArg(key) - } - } - - return self - } - self.getOptions = () => options - - self.positional = function (key, opts) { - argsert(' ', [key, opts], arguments.length) - if (context.resets === 0) { - throw new YError(".positional() can only be called in a command's builder function") - } - - // .positional() only supports a subset of the configuration - // options available to .option(). - const supportedOpts = ['default', 'defaultDescription', 'implies', 'normalize', - 'choices', 'conflicts', 'coerce', 'type', 'describe', - 'desc', 'description', 'alias'] - opts = objFilter(opts, (k, v) => { - let accept = supportedOpts.indexOf(k) !== -1 - // type can be one of string|number|boolean. - if (k === 'type' && ['string', 'number', 'boolean'].indexOf(v) === -1) accept = false - return accept - }) - - // copy over any settings that can be inferred from the command string. - const fullCommand = context.fullCommands[context.fullCommands.length - 1] - const parseOptions = fullCommand ? command.cmdToParseOptions(fullCommand) : { - array: [], - alias: {}, - default: {}, - demand: {} - } - Object.keys(parseOptions).forEach((pk) => { - if (Array.isArray(parseOptions[pk])) { - if (parseOptions[pk].indexOf(key) !== -1) opts[pk] = true - } else { - if (parseOptions[pk][key] && !(pk in opts)) opts[pk] = parseOptions[pk][key] - } - }) - self.group(key, usage.getPositionalGroupName()) - return self.option(key, opts) - } - - self.group = function group (opts, groupName) { - argsert(' ', [opts, groupName], arguments.length) - const existing = preservedGroups[groupName] || groups[groupName] - if (preservedGroups[groupName]) { - // we now only need to track this group name in groups. - delete preservedGroups[groupName] - } - - const seen = {} - groups[groupName] = (existing || []).concat(opts).filter((key) => { - if (seen[key]) return false - return (seen[key] = true) - }) - return self - } - // combine explicit and preserved groups. explicit groups should be first - self.getGroups = () => Object.assign({}, groups, preservedGroups) - - // as long as options.envPrefix is not undefined, - // parser will apply env vars matching prefix to argv - self.env = function (prefix) { - argsert('[string|boolean]', [prefix], arguments.length) - if (prefix === false) options.envPrefix = undefined - else options.envPrefix = prefix || '' - return self - } - - self.wrap = function (cols) { - argsert('', [cols], arguments.length) - usage.wrap(cols) - return self - } - - let strict = false - self.strict = function (enabled) { - argsert('[boolean]', [enabled], arguments.length) - strict = enabled !== false - return self - } - self.getStrict = () => strict - - let parserConfig = {} - self.parserConfiguration = function parserConfiguration (config) { - argsert('', [config], arguments.length) - parserConfig = config - return self - } - self.getParserConfiguration = () => parserConfig - - self.showHelp = function (level) { - argsert('[string|function]', [level], arguments.length) - if (!self.parsed) self._parseArgs(processArgs) // run parser, if it has not already been executed. - if (command.hasDefaultCommand()) { - context.resets++ // override the restriction on top-level positoinals. - command.runDefaultBuilderOn(self, true) - } - usage.showHelp(level) - return self - } - - let versionOpt = null - self.version = function version (opt, msg, ver) { - const defaultVersionOpt = 'version' - argsert('[boolean|string] [string] [string]', [opt, msg, ver], arguments.length) - - // nuke the key previously configured - // to return version #. - if (versionOpt) { - deleteFromParserHintObject(versionOpt) - usage.version(undefined) - versionOpt = null - } - - if (arguments.length === 0) { - ver = guessVersion() - opt = defaultVersionOpt - } else if (arguments.length === 1) { - if (opt === false) { // disable default 'version' key. - return self - } - ver = opt - opt = defaultVersionOpt - } else if (arguments.length === 2) { - ver = msg - msg = null - } - - versionOpt = typeof opt === 'string' ? opt : defaultVersionOpt - msg = msg || usage.deferY18nLookup('Show version number') - - usage.version(ver || undefined) - self.boolean(versionOpt) - self.describe(versionOpt, msg) - return self - } - - function guessVersion () { - const obj = pkgUp() - - return obj.version || 'unknown' - } - - let helpOpt = null - self.addHelpOpt = self.help = function addHelpOpt (opt, msg) { - const defaultHelpOpt = 'help' - argsert('[string|boolean] [string]', [opt, msg], arguments.length) - - // nuke the key previously configured - // to return help. - if (helpOpt) { - deleteFromParserHintObject(helpOpt) - helpOpt = null - } - - if (arguments.length === 1) { - if (opt === false) return self - } - - // use arguments, fallback to defaults for opt and msg - helpOpt = typeof opt === 'string' ? opt : defaultHelpOpt - self.boolean(helpOpt) - self.describe(helpOpt, msg || usage.deferY18nLookup('Show help')) - return self - } - - const defaultShowHiddenOpt = 'show-hidden' - options.showHiddenOpt = defaultShowHiddenOpt - self.addShowHiddenOpt = self.showHidden = function addShowHiddenOpt (opt, msg) { - argsert('[string|boolean] [string]', [opt, msg], arguments.length) - - if (arguments.length === 1) { - if (opt === false) return self - } - - const showHiddenOpt = typeof opt === 'string' ? opt : defaultShowHiddenOpt - self.boolean(showHiddenOpt) - self.describe(showHiddenOpt, msg || usage.deferY18nLookup('Show hidden options')) - options.showHiddenOpt = showHiddenOpt - return self - } - - self.hide = function hide (key) { - argsert('', [key], arguments.length) - options.hiddenOptions.push(key) - return self - } - - self.showHelpOnFail = function showHelpOnFail (enabled, message) { - argsert('[boolean|string] [string]', [enabled, message], arguments.length) - usage.showHelpOnFail(enabled, message) - return self - } - - var exitProcess = true - self.exitProcess = function (enabled) { - argsert('[boolean]', [enabled], arguments.length) - if (typeof enabled !== 'boolean') { - enabled = true - } - exitProcess = enabled - return self - } - self.getExitProcess = () => exitProcess - - var completionCommand = null - self.completion = function (cmd, desc, fn) { - argsert('[string] [string|boolean|function] [function]', [cmd, desc, fn], arguments.length) - - // a function to execute when generating - // completions can be provided as the second - // or third argument to completion. - if (typeof desc === 'function') { - fn = desc - desc = null - } - - // register the completion command. - completionCommand = cmd || completionCommand || 'completion' - if (!desc && desc !== false) { - desc = 'generate completion script' - } - self.command(completionCommand, desc) - - // a function can be provided - if (fn) completion.registerFunction(fn) - - return self - } - - self.showCompletionScript = function ($0, cmd) { - argsert('[string] [string]', [$0, cmd], arguments.length) - $0 = $0 || self.$0 - _logger.log(completion.generateCompletionScript($0, cmd || completionCommand || 'completion')) - return self - } - - self.getCompletion = function (args, done) { - argsert(' ', [args, done], arguments.length) - completion.getCompletion(args, done) - } - - self.locale = function (locale) { - argsert('[string]', [locale], arguments.length) - if (arguments.length === 0) { - guessLocale() - return y18n.getLocale() - } - detectLocale = false - y18n.setLocale(locale) - return self - } - - self.updateStrings = self.updateLocale = function (obj) { - argsert('', [obj], arguments.length) - detectLocale = false - y18n.updateLocale(obj) - return self - } - - let detectLocale = true - self.detectLocale = function (detect) { - argsert('', [detect], arguments.length) - detectLocale = detect - return self - } - self.getDetectLocale = () => detectLocale - - var hasOutput = false - var exitError = null - // maybe exit, always capture - // context about why we wanted to exit. - self.exit = (code, err) => { - hasOutput = true - exitError = err - if (exitProcess) process.exit(code) - } - - // we use a custom logger that buffers output, - // so that we can print to non-CLIs, e.g., chat-bots. - const _logger = { - log () { - const args = [] - for (let i = 0; i < arguments.length; i++) args.push(arguments[i]) - if (!self._hasParseCallback()) console.log.apply(console, args) - hasOutput = true - if (output.length) output += '\n' - output += args.join(' ') - }, - error () { - const args = [] - for (let i = 0; i < arguments.length; i++) args.push(arguments[i]) - if (!self._hasParseCallback()) console.error.apply(console, args) - hasOutput = true - if (output.length) output += '\n' - output += args.join(' ') - } - } - self._getLoggerInstance = () => _logger - // has yargs output an error our help - // message in the current execution context. - self._hasOutput = () => hasOutput - - self._setHasOutput = () => { - hasOutput = true - } - - let recommendCommands - self.recommendCommands = function (recommend) { - argsert('[boolean]', [recommend], arguments.length) - recommendCommands = typeof recommend === 'boolean' ? recommend : true - return self - } - - self.getUsageInstance = () => usage - - self.getValidationInstance = () => validation - - self.getCommandInstance = () => command - - self.terminalWidth = () => { - argsert([], 0) - return typeof process.stdout.columns !== 'undefined' ? process.stdout.columns : null - } - - Object.defineProperty(self, 'argv', { - get: () => self._parseArgs(processArgs), - enumerable: true - }) - - self._parseArgs = function parseArgs (args, shortCircuit, _calledFromCommand, commandIndex) { - let skipValidation = !!_calledFromCommand - args = args || processArgs - - options.__ = y18n.__ - options.configuration = self.getParserConfiguration() - // Deprecated - let pkgConfig = pkgUp()['yargs'] - if (pkgConfig) { - console.warn('Configuring yargs through package.json is deprecated and will be removed in a future major release, please use the JS API instead.') - options.configuration = Object.assign({}, pkgConfig, options.configuration) - } - - const populateDoubleDash = !!options.configuration['populate--'] - const config = Object.assign({}, options.configuration, { - 'populate--': true - }) - const parsed = Parser.detailed(args, Object.assign({}, options, { - configuration: config - })) - - let argv = parsed.argv - if (parseContext) argv = Object.assign({}, argv, parseContext) - const aliases = parsed.aliases - - argv.$0 = self.$0 - self.parsed = parsed - - try { - guessLocale() // guess locale lazily, so that it can be turned off in chain. - - // while building up the argv object, there - // are two passes through the parser. If completion - // is being performed short-circuit on the first pass. - if (shortCircuit) { - return (populateDoubleDash || _calledFromCommand) ? argv : self._copyDoubleDash(argv) - } - - // if there's a handler associated with a - // command defer processing to it. - if (helpOpt) { - // consider any multi-char helpOpt alias as a valid help command - // unless all helpOpt aliases are single-char - // note that parsed.aliases is a normalized bidirectional map :) - const helpCmds = [helpOpt] - .concat(aliases[helpOpt] || []) - .filter(k => k.length > 1) - // check if help should trigger and strip it from _. - if (~helpCmds.indexOf(argv._[argv._.length - 1])) { - argv._.pop() - argv[helpOpt] = true - } - } - - const handlerKeys = command.getCommands() - const requestCompletions = completion.completionKey in argv - const skipRecommendation = argv[helpOpt] || requestCompletions - const skipDefaultCommand = skipRecommendation && (handlerKeys.length > 1 || handlerKeys[0] !== '$0') - - if (argv._.length) { - if (handlerKeys.length) { - let firstUnknownCommand - for (let i = (commandIndex || 0), cmd; argv._[i] !== undefined; i++) { - cmd = String(argv._[i]) - if (~handlerKeys.indexOf(cmd) && cmd !== completionCommand) { - // commands are executed using a recursive algorithm that executes - // the deepest command first; we keep track of the position in the - // argv._ array that is currently being executed. - const innerArgv = command.runCommand(cmd, self, parsed, i + 1) - return populateDoubleDash ? innerArgv : self._copyDoubleDash(innerArgv) - } else if (!firstUnknownCommand && cmd !== completionCommand) { - firstUnknownCommand = cmd - break - } - } - - // run the default command, if defined - if (command.hasDefaultCommand() && !skipDefaultCommand) { - const innerArgv = command.runCommand(null, self, parsed) - return populateDoubleDash ? innerArgv : self._copyDoubleDash(innerArgv) - } - - // recommend a command if recommendCommands() has - // been enabled, and no commands were found to execute - if (recommendCommands && firstUnknownCommand && !skipRecommendation) { - validation.recommendCommands(firstUnknownCommand, handlerKeys) - } - } - - // generate a completion script for adding to ~/.bashrc. - if (completionCommand && ~argv._.indexOf(completionCommand) && !requestCompletions) { - if (exitProcess) setBlocking(true) - self.showCompletionScript() - self.exit(0) - } - } else if (command.hasDefaultCommand() && !skipDefaultCommand) { - const innerArgv = command.runCommand(null, self, parsed) - return populateDoubleDash ? innerArgv : self._copyDoubleDash(innerArgv) - } - - // we must run completions first, a user might - // want to complete the --help or --version option. - if (requestCompletions) { - if (exitProcess) setBlocking(true) - - // we allow for asynchronous completions, - // e.g., loading in a list of commands from an API. - const completionArgs = args.slice(args.indexOf(`--${completion.completionKey}`) + 1) - completion.getCompletion(completionArgs, (completions) => { - ;(completions || []).forEach((completion) => { - _logger.log(completion) - }) - - self.exit(0) - }) - return (populateDoubleDash || _calledFromCommand) ? argv : self._copyDoubleDash(argv) - } - - // Handle 'help' and 'version' options - // if we haven't already output help! - if (!hasOutput) { - Object.keys(argv).forEach((key) => { - if (key === helpOpt && argv[key]) { - if (exitProcess) setBlocking(true) - - skipValidation = true - self.showHelp('log') - self.exit(0) - } else if (key === versionOpt && argv[key]) { - if (exitProcess) setBlocking(true) - - skipValidation = true - usage.showVersion() - self.exit(0) - } - }) - } - - // Check if any of the options to skip validation were provided - if (!skipValidation && options.skipValidation.length > 0) { - skipValidation = Object.keys(argv).some(key => options.skipValidation.indexOf(key) >= 0 && argv[key] === true) - } - - // If the help or version options where used and exitProcess is false, - // or if explicitly skipped, we won't run validations. - if (!skipValidation) { - if (parsed.error) throw new YError(parsed.error.message) - - // if we're executed via bash completion, don't - // bother with validation. - if (!requestCompletions) { - self._runValidation(argv, aliases, {}, parsed.error) - } - } - } catch (err) { - if (err instanceof YError) usage.fail(err.message, err) - else throw err - } - - return (populateDoubleDash || _calledFromCommand) ? argv : self._copyDoubleDash(argv) - } - - // to simplify the parsing of positionals in commands, - // we temporarily populate '--' rather than _, with arguments - // after the '--' directive. After the parse, we copy these back. - self._copyDoubleDash = function (argv) { - if (!argv._ || !argv['--']) return argv - argv._.push.apply(argv._, argv['--']) - - // TODO(bcoe): refactor command parsing such that this delete is not - // necessary: https://github.com/yargs/yargs/issues/1482 - try { - delete argv['--'] - } catch (_err) {} - - return argv - } - - self._runValidation = function runValidation (argv, aliases, positionalMap, parseErrors) { - if (parseErrors) throw new YError(parseErrors.message || parseErrors) - validation.nonOptionCount(argv) - validation.requiredArguments(argv) - if (strict) validation.unknownArguments(argv, aliases, positionalMap) - validation.customChecks(argv, aliases) - validation.limitedChoices(argv) - validation.implications(argv) - validation.conflicting(argv) - } - - function guessLocale () { - if (!detectLocale) return - - try { - const { env } = process - const locale = env.LC_ALL || env.LC_MESSAGES || env.LANG || env.LANGUAGE || 'en_US' - self.locale(locale.replace(/[.:].*/, '')) - } catch (err) { - // if we explode looking up locale just noop - // we'll keep using the default language 'en'. - } - } - - // an app should almost always have --version and --help, - // if you *really* want to disable this use .help(false)/.version(false). - self.help() - self.version() - - return self -} - -// rebase an absolute path to a relative one with respect to a base directory -// exported for tests -exports.rebase = rebase -function rebase (base, dir) { - return path.relative(base, dir) -} diff --git a/deps/npm/package.json b/deps/npm/package.json index c9df68e3314dae..e58880013d02c8 100644 --- a/deps/npm/package.json +++ b/deps/npm/package.json @@ -1,5 +1,5 @@ { - "version": "6.14.8", + "version": "7.0.0-rc.3", "name": "npm", "description": "a package manager for JavaScript", "keywords": [ @@ -19,7 +19,7 @@ "url": "https://github.com/npm/cli" }, "bugs": { - "url": "https://npm.community/c/bugs" + "url": "https://github.com/npm/cli/issues" }, "directories": { "bin": "./bin", @@ -29,285 +29,193 @@ }, "main": "./lib/npm.js", "bin": { - "npm": "./bin/npm-cli.js", - "npx": "./bin/npx-cli.js" + "npm": "bin/npm-cli.js", + "npx": "bin/npx-cli.js" + }, + "exports": { + ".": [ + { + "default": "./lib/npm.js" + }, + "./lib/npm.js" + ], + "./package.json": "./package.json" }, "dependencies": { - "JSONStream": "^1.3.5", + "@npmcli/arborist": "^0.0.32", + "@npmcli/ci-detect": "^1.2.0", + "@npmcli/config": "^1.1.8", + "@npmcli/run-script": "^1.7.0", "abbrev": "~1.1.1", "ansicolors": "~0.3.2", "ansistyles": "~0.1.3", "aproba": "^2.0.0", "archy": "~1.0.0", - "bin-links": "^1.1.8", - "bluebird": "^3.5.5", - "byte-size": "^5.0.1", - "cacache": "^12.0.3", - "call-limit": "^1.1.1", - "chownr": "^1.1.4", - "ci-info": "^2.0.0", + "bin-links": "^2.2.1", + "byte-size": "^7.0.0", + "cacache": "^15.0.5", + "chalk": "^4.1.0", + "chownr": "^2.0.0", "cli-columns": "^3.1.2", - "cli-table3": "^0.5.1", - "cmd-shim": "^3.0.3", + "cli-table3": "^0.6.0", "columnify": "~1.5.4", - "config-chain": "^1.1.12", - "detect-indent": "~5.0.0", - "detect-newline": "^2.1.0", - "dezalgo": "~1.0.3", "editor": "~1.0.0", - "figgy-pudding": "^3.5.1", - "find-npm-prefix": "^1.0.2", - "fs-vacuum": "~1.2.10", - "fs-write-stream-atomic": "~1.0.10", - "gentle-fs": "^2.3.1", - "glob": "^7.1.6", - "graceful-fs": "^4.2.4", - "has-unicode": "~2.0.1", - "hosted-git-info": "^2.8.8", - "iferr": "^1.0.2", - "infer-owner": "^1.0.4", - "inflight": "~1.0.6", + "glob": "^7.1.4", + "graceful-fs": "^4.2.3", + "hosted-git-info": "^3.0.5", "inherits": "^2.0.4", "ini": "^1.3.5", "init-package-json": "^1.10.3", - "is-cidr": "^3.0.0", - "json-parse-better-errors": "^1.0.2", - "lazy-property": "~1.0.0", - "libcipm": "^4.0.8", - "libnpm": "^3.0.1", - "libnpmaccess": "^3.0.2", - "libnpmhook": "^5.0.3", - "libnpmorg": "^1.0.1", - "libnpmsearch": "^2.0.2", - "libnpmteam": "^1.0.2", - "libnpx": "^10.2.4", - "lock-verify": "^2.1.0", - "lockfile": "^1.0.4", - "lodash._baseuniq": "~4.6.0", - "lodash.clonedeep": "~4.5.0", - "lodash.union": "~4.6.0", - "lodash.uniq": "~4.5.0", - "lodash.without": "~4.4.0", - "lru-cache": "^5.1.1", - "meant": "^1.0.2", - "mississippi": "^3.0.0", - "mkdirp": "^0.5.5", - "move-concurrently": "^1.0.1", - "node-gyp": "^5.1.0", - "nopt": "^4.0.3", - "normalize-package-data": "^2.5.0", - "npm-audit-report": "^1.3.3", - "npm-cache-filename": "~1.0.2", - "npm-install-checks": "^3.0.2", - "npm-lifecycle": "^3.1.5", - "npm-package-arg": "^6.1.1", - "npm-packlist": "^1.4.8", - "npm-pick-manifest": "^3.0.2", - "npm-profile": "^4.0.4", - "npm-registry-fetch": "^4.0.7", + "is-cidr": "^4.0.2", + "leven": "^3.1.0", + "libnpmaccess": "^4.0.0", + "libnpmfund": "0.0.0", + "libnpmhook": "^6.0.0", + "libnpmorg": "^2.0.0", + "libnpmpack": "^2.0.0", + "libnpmpublish": "^3.0.1", + "libnpmsearch": "^3.0.0", + "libnpmteam": "^2.0.1", + "libnpmversion": "^1.0.5", + "make-fetch-happen": "^8.0.9", + "mkdirp": "^1.0.4", + "mkdirp-infer-owner": "^2.0.0", + "ms": "^2.1.2", + "nopt": "^5.0.0", + "npm-audit-report": "^2.1.4", + "npm-package-arg": "^8.0.1", + "npm-pick-manifest": "^6.1.0", + "npm-profile": "^5.0.1", + "npm-registry-fetch": "^8.1.4", "npm-user-validate": "~1.0.0", "npmlog": "~4.1.2", - "once": "~1.4.0", - "opener": "^1.5.1", - "osenv": "^0.1.5", - "pacote": "^9.5.12", - "path-is-inside": "~1.0.2", - "promise-inflight": "~1.0.1", + "opener": "^1.5.2", + "pacote": "^11.1.10", + "parse-conflict-json": "^1.1.1", "qrcode-terminal": "^0.12.0", - "query-string": "^6.8.2", - "qw": "~1.0.1", "read": "~1.0.7", - "read-cmd-shim": "^1.0.5", - "read-installed": "~4.0.3", - "read-package-json": "^2.1.1", - "read-package-tree": "^5.3.1", - "readable-stream": "^3.6.0", - "readdir-scoped-modules": "^1.1.0", - "request": "^2.88.0", - "retry": "^0.12.0", - "rimraf": "^2.7.1", - "safe-buffer": "^5.1.2", - "semver": "^5.7.1", - "sha": "^3.0.0", - "slide": "~1.1.6", + "read-package-json": "^2.1.2", + "read-package-json-fast": "^1.2.1", + "rimraf": "^3.0.2", + "semver": "^7.3.2", "sorted-object": "~2.0.1", - "sorted-union-stream": "~2.1.3", - "ssri": "^6.0.1", - "stringify-package": "^1.0.1", - "tar": "^4.4.13", + "ssri": "^8.0.0", + "tar": "^6.0.5", "text-table": "~0.2.0", "tiny-relative-date": "^1.3.0", - "uid-number": "0.0.6", - "umask": "~1.1.0", - "unique-filename": "^1.1.1", - "unpipe": "~1.0.0", - "update-notifier": "^2.5.0", - "uuid": "^3.3.3", - "validate-npm-package-license": "^3.0.4", + "uuid": "^8.3.1", "validate-npm-package-name": "~3.0.0", - "which": "^1.3.1", - "worker-farm": "^1.7.0", - "write-file-atomic": "^2.4.3" + "which": "^2.0.2", + "write-file-atomic": "^3.0.3" }, "bundleDependencies": [ + "@npmcli/arborist", + "@npmcli/ci-detect", + "@npmcli/config", + "@npmcli/run-script", "abbrev", "ansicolors", "ansistyles", "aproba", "archy", "bin-links", - "bluebird", "byte-size", "cacache", - "call-limit", + "chalk", "chownr", - "ci-info", "cli-columns", "cli-table3", - "cmd-shim", "columnify", - "config-chain", - "debuglog", - "detect-indent", - "detect-newline", - "dezalgo", "editor", - "figgy-pudding", - "find-npm-prefix", - "fs-vacuum", - "fs-write-stream-atomic", - "gentle-fs", "glob", "graceful-fs", - "has-unicode", "hosted-git-info", - "iferr", - "imurmurhash", - "infer-owner", - "inflight", "inherits", "ini", "init-package-json", "is-cidr", - "json-parse-better-errors", - "JSONStream", - "lazy-property", - "libcipm", - "libnpm", + "leven", "libnpmaccess", + "libnpmfund", "libnpmhook", "libnpmorg", + "libnpmpack", + "libnpmpublish", "libnpmsearch", "libnpmteam", - "libnpx", - "lock-verify", - "lockfile", - "lodash._baseindexof", - "lodash._baseuniq", - "lodash._bindcallback", - "lodash._cacheindexof", - "lodash._createcache", - "lodash._getnative", - "lodash.clonedeep", - "lodash.restparam", - "lodash.union", - "lodash.uniq", - "lodash.without", - "lru-cache", - "meant", - "mississippi", + "libnpmversion", + "make-fetch-happen", "mkdirp", - "move-concurrently", - "node-gyp", + "mkdirp-infer-owner", + "ms", "nopt", - "normalize-package-data", "npm-audit-report", - "npm-cache-filename", - "npm-install-checks", - "npm-lifecycle", "npm-package-arg", - "npm-packlist", "npm-pick-manifest", "npm-profile", "npm-registry-fetch", "npm-user-validate", "npmlog", - "once", "opener", - "osenv", "pacote", - "path-is-inside", - "promise-inflight", + "parse-conflict-json", "qrcode-terminal", - "query-string", - "qw", - "read-cmd-shim", - "read-installed", - "read-package-json", - "read-package-tree", "read", - "readable-stream", - "readdir-scoped-modules", - "request", - "retry", + "read-package-json", + "read-package-json-fast", "rimraf", - "safe-buffer", "semver", - "sha", - "slide", "sorted-object", - "sorted-union-stream", "ssri", - "stringify-package", "tar", "text-table", "tiny-relative-date", - "uid-number", - "umask", - "unique-filename", - "unpipe", - "update-notifier", "uuid", - "validate-npm-package-license", "validate-npm-package-name", "which", - "worker-farm", "write-file-atomic" ], "devDependencies": { - "deep-equal": "^1.0.1", - "get-stream": "^4.1.0", - "licensee": "^7.0.3", - "marked": "^0.7.0", + "eslint": "^7.10.0", + "eslint-plugin-import": "^2.22.1", + "eslint-plugin-node": "^11.1.0", + "eslint-plugin-promise": "^4.2.1", + "eslint-plugin-standard": "^4.0.1", "marked-man": "^0.7.0", - "npm-registry-mock": "^1.3.1", "require-inject": "^1.4.4", - "sprintf-js": "^1.1.2", - "standard": "^11.0.1", - "tacks": "^1.3.0", - "tap": "^12.7.0", - "tar-stream": "^2.1.0" + "tap": "^14.10.8" }, "scripts": { "dumpconf": "env | grep npm | sort | uniq", "prepare": "node bin/npm-cli.js rebuild && node bin/npm-cli.js --no-audit --no-timing prune --prefix=. --no-global && rimraf test/*/*/node_modules && make -j4 mandocs", "preversion": "bash scripts/update-authors.sh && git add AUTHORS && git commit -m \"update AUTHORS\" || true", "licenses": "licensee --production --errors-only", - "tap": "tap -J --timeout 300 --no-esm", - "tap-cover": "tap -J --nyc-arg=--cache --coverage --timeout 600 --no-esm", - "lint": "standard", - "pretest": "npm run lint", - "test": "npm run test-tap --", + "test": "tap", + "check-coverage": "tap", + "snap": "tap", "test:nocleanup": "NO_TEST_CLEANUP=1 npm run test --", - "sudotest": "sudo npm run tap -- \"test/tap/*.js\"", - "sudotest:nocleanup": "sudo NO_TEST_CLEANUP=1 npm run tap -- \"test/tap/*.js\"", - "posttest": "rimraf test/npm_cache*", - "test-coverage": "npm run tap-cover -- \"test/tap/*.js\" \"test/network/*.js\"", - "test-tap": "npm run tap -- \"test/tap/*.js\" \"test/network/*.js\"", - "test-node": "tap --timeout 240 \"test/tap/*.js\" \"test/network/*.js\"" + "sudotest": "sudo npm run test --", + "sudotest:nocleanup": "sudo NO_TEST_CLEANUP=1 npm run test --", + "posttest": "npm run lint", + "eslint": "eslint", + "lint": "npm run eslint -- \"lib/**/*.js\"", + "lintfix": "npm run lint -- --fix", + "prelint": "rimraf test/npm_cache*", + "resetdeps": "bash scripts/resetdeps.sh" + }, + "//": [ + "XXX temporarily only run unit tests while v7 beta is in progress", + "Remove the 'files' below once we're done porting old tests over" + ], + "tap": { + "files": "test/{lib,bin}", + "coverage-map": "test/coverage-map.js", + "check-coverage": true, + "esm": false, + "timeout": 600 }, "license": "Artistic-2.0", "engines": { - "node": "6 >=6.2.0 || 8 || >=9.3.0" + "node": ">=10" } } diff --git a/deps/npm/scripts/bundle-and-gitignore-deps.js b/deps/npm/scripts/bundle-and-gitignore-deps.js new file mode 100644 index 00000000000000..0aedec7811ec6f --- /dev/null +++ b/deps/npm/scripts/bundle-and-gitignore-deps.js @@ -0,0 +1,33 @@ +const Arborist = require('@npmcli/arborist') +const { resolve } = require('path') +const ignore = resolve(__dirname, '../node_modules/.gitignore') +const { writeFileSync } = require('fs') +const pj = resolve(__dirname, '../package.json') +const pkg = require(pj) +const bundle = [] +const arb = new Arborist({ path: resolve(__dirname, '..') }) +const shouldIgnore = [] + +arb.loadVirtual().then(tree => { + for (const [name, node] of tree.children.entries()) { + if (node.dev) { + console.error('ignore', node.name) + shouldIgnore.push(node.name) + } else if (tree.edgesOut.has(node.name)) { + console.error('BUNDLE', node.name) + bundle.push(node.name) + } + } + pkg.bundleDependencies = bundle.sort((a, b) => a.localeCompare(b)) + + const ignores = shouldIgnore.sort((a, b) => a.localeCompare(b)) + .map(i => `/${i}`) + .join('\n') + const ignoreData = `# Automatically generated to ignore dev deps +/.package-lock.json +package-lock.json +${ignores} +` + writeFileSync(ignore, ignoreData) + writeFileSync(pj, JSON.stringify(pkg, 0, 2) + '\n') +}) diff --git a/deps/npm/scripts/check-deps.js b/deps/npm/scripts/check-deps.js new file mode 100644 index 00000000000000..f4fd3bf52b12e6 --- /dev/null +++ b/deps/npm/scripts/check-deps.js @@ -0,0 +1,9 @@ +const { bundleDependencies } = require('./package.json') +const { spawnSync } = require('child_process') +for (const dep of bundleDependencies) { + const lib = spawnSync('git', ['grep', dep, 'lib']) + const bin = spawnSync('git', ['grep', dep, 'bin']) + if (!lib.stdout.length && !bin.stdout.length) { + console.log(dep) + } +} diff --git a/deps/npm/scripts/publish-tag.js b/deps/npm/scripts/publish-tag.js index d0c04556e1b322..fb8a48233b9c0e 100644 --- a/deps/npm/scripts/publish-tag.js +++ b/deps/npm/scripts/publish-tag.js @@ -1,3 +1,3 @@ var semver = require('semver') var version = semver.parse(require('../package.json').version) -console.log('v%s.%s-next', version.major, version.minor) +console.log('next-%s', version.major) diff --git a/deps/npm/scripts/resetdeps.sh b/deps/npm/scripts/resetdeps.sh new file mode 100755 index 00000000000000..957987731d4227 --- /dev/null +++ b/deps/npm/scripts/resetdeps.sh @@ -0,0 +1,8 @@ +#!/bin/bash +set -e +set -x +rm -rf node_modules +git checkout node_modules +node . i --ignore-scripts --no-audit +node . rebuild --ignore-scripts --no-audit +node scripts/bundle-and-gitignore-deps.js 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 new file mode 100644 index 00000000000000..472f7f1cfe5750 --- /dev/null +++ b/deps/npm/tap-snapshots/test-lib-dist-tag.js-TAP.test.js @@ -0,0 +1,109 @@ +/* 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/dist-tag.js TAP add missing args > should exit usage error message 1`] = ` +npm dist-tag add @ [] +npm dist-tag rm +npm dist-tag ls [] + +alias: dist-tags +` + +exports[`test/lib/dist-tag.js TAP add missing pkg name > should exit usage error message 1`] = ` +npm dist-tag add @ [] +npm dist-tag rm +npm dist-tag ls [] + +alias: dist-tags +` + +exports[`test/lib/dist-tag.js TAP add new tag > should return success msg 1`] = ` ++c: @scoped/another@7.7.7 +` + +exports[`test/lib/dist-tag.js TAP add using valid semver range as name > should return success msg 1`] = ` +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 add @ [] +npm dist-tag rm +npm dist-tag ls [] + +alias: dist-tags +` + +exports[`test/lib/dist-tag.js TAP ls in current package > should list available tags for current package 1`] = ` +a: 0.0.1 +b: 0.5.0 +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 add @ [] +npm dist-tag rm +npm dist-tag ls [] + +alias: dist-tags +` + +exports[`test/lib/dist-tag.js TAP ls on missing package > should log no dist-tag found msg 1`] = ` +dist-tag ls Couldn't get dist-tag data for foo@latest + +` + +exports[`test/lib/dist-tag.js TAP ls on missing package > should throw error message 1`] = ` +Error: No dist-tags found for foo +` + +exports[`test/lib/dist-tag.js TAP ls on named package > should list tags for the specified package 1`] = ` +a: 0.0.2 +b: 0.6.0 +latest: 2.0.0 +` + +exports[`test/lib/dist-tag.js TAP no args in current package > should default to listing available tags for current package 1`] = ` +a: 0.0.1 +b: 0.5.0 +latest: 1.0.0 +` + +exports[`test/lib/dist-tag.js TAP only named package arg > should default to listing tags for the specified package 1`] = ` +a: 0.0.2 +b: 0.6.0 +latest: 2.0.0 +` + +exports[`test/lib/dist-tag.js TAP remove existing tag > should log remove info 1`] = ` +dist-tag del c from @scoped/another + +` + +exports[`test/lib/dist-tag.js TAP remove existing tag > should return success msg 1`] = ` +-c: @scoped/another@7.7.7 +` + +exports[`test/lib/dist-tag.js TAP remove missing pkg name > should exit usage error message 1`] = ` +npm dist-tag add @ [] +npm dist-tag rm +npm dist-tag ls [] + +alias: dist-tags +` + +exports[`test/lib/dist-tag.js TAP remove non-existing tag > should log error msg 1`] = ` +dist-tag del nonexistent from @scoped/another +dist-tag del nonexistent is not a dist-tag on @scoped/another + +` + +exports[`test/lib/dist-tag.js TAP set existing version > should log warn msg 1`] = ` +dist-tag add b to @scoped/another@0.6.0 +dist-tag add b is already set to version 0.6.0 + +` diff --git a/deps/npm/tap-snapshots/test-lib-fund.js-TAP.test.js b/deps/npm/tap-snapshots/test-lib-fund.js-TAP.test.js new file mode 100644 index 00000000000000..7ad86ebeea7e93 --- /dev/null +++ b/deps/npm/tap-snapshots/test-lib-fund.js-TAP.test.js @@ -0,0 +1,94 @@ +/* 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/fund.js TAP fund a package with type and multiple sources > should print prompt select message 1`] = ` +1: Foo funding available at the following URL: http://example.com/foo +2: Lorem funding available at the following URL: http://example.com/foo-lorem +Run \`npm fund [<@scope>/] --which=1\`, for example, to open the first funding URL listed in that package + +` + +exports[`test/lib/fund.js TAP fund colors > should print output with color info 1`] = ` +test-fund-colors@1.0.0 ++-- http://example.com/a +| \`-- a@1.0.0 +\`-- http://example.com/b + | \`-- b@1.0.0, c@1.0.0 + +-- http://example.com/d + | \`-- d@1.0.0 + \`-- http://example.com/e + \`-- e@1.0.0 + + +` + +exports[`test/lib/fund.js TAP fund containing multi-level nested deps with no funding > should omit dependencies with no funding declared 1`] = ` +nested-no-funding-packages@1.0.0 ++-- https://example.com/lorem +| \`-- lorem@1.0.0 +\`-- http://example.com/donate + \`-- bar@1.0.0 + + +` + +exports[`test/lib/fund.js TAP fund in which same maintainer owns all its deps > should print stack packages together 1`] = ` +http://example.com/donate + \`-- maintainer-owns-all-deps@1.0.0, dep-foo@1.0.0, dep-sub-foo@1.0.0, dep-bar@1.0.0 + + +` + +exports[`test/lib/fund.js TAP fund pkg missing version number > should print name only 1`] = ` +http://example.com/foo + \`-- foo + + +` + +exports[`test/lib/fund.js TAP fund using nested packages with multiple sources > should prompt with all available URLs 1`] = ` +1: Funding available at the following URL: https://one.example.com +2: Funding available at the following URL: https://two.example.com +Run \`npm fund [<@scope>/] --which=1\`, for example, to open the first funding URL listed in that package + +` + +exports[`test/lib/fund.js TAP fund using nested packages with multiple sources, with a source number > should open the numbered URL 1`] = ` +Funding available at the following URL: + https://one.example.com +` + +exports[`test/lib/fund.js TAP fund using package argument > should open funding url 1`] = ` +individual funding available at the following URL: + http://example.com/donate +` + +exports[`test/lib/fund.js TAP fund using pkg name while having conflicting versions > should open greatest version 1`] = ` +Funding available at the following URL: + http://example.com/2 +` + +exports[`test/lib/fund.js TAP fund using string shorthand > should open string-only url 1`] = ` +Funding available at the following URL: + https://example.com/sponsor +` + +exports[`test/lib/fund.js TAP fund with no package containing funding > should print empty funding info 1`] = ` +no-funding-package@0.0.0 + + +` + +exports[`test/lib/fund.js TAP sub dep with fund info and a parent with no funding info > should nest sub dep as child of root 1`] = ` +test-multiple-funding-sources@1.0.0 ++-- http://example.com/b +| \`-- b@1.0.0 +\`-- http://example.com/c + \`-- c@1.0.0 + + +` diff --git a/deps/npm/tap-snapshots/test-lib-link.js-TAP.test.js b/deps/npm/tap-snapshots/test-lib-link.js-TAP.test.js new file mode 100644 index 00000000000000..de7f483b60de85 --- /dev/null +++ b/deps/npm/tap-snapshots/test-lib-link.js-TAP.test.js @@ -0,0 +1,25 @@ +/* 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/link.js TAP link global linked pkg to local nm when using args > should create a local symlink to global pkg 1`] = ` +{CWD}/test/lib/link-link-global-linked-pkg-to-local-nm-when-using-args/my-project/node_modules/@myscope/bar -> {CWD}/test/lib/link-link-global-linked-pkg-to-local-nm-when-using-args/global-prefix/lib/node_modules/@myscope/bar +{CWD}/test/lib/link-link-global-linked-pkg-to-local-nm-when-using-args/my-project/node_modules/@myscope/linked -> {CWD}/test/lib/link-link-global-linked-pkg-to-local-nm-when-using-args/scoped-linked +{CWD}/test/lib/link-link-global-linked-pkg-to-local-nm-when-using-args/my-project/node_modules/a -> {CWD}/test/lib/link-link-global-linked-pkg-to-local-nm-when-using-args/global-prefix/lib/node_modules/a +{CWD}/test/lib/link-link-global-linked-pkg-to-local-nm-when-using-args/my-project/node_modules/link-me-too -> {CWD}/test/lib/link-link-global-linked-pkg-to-local-nm-when-using-args/link-me-too +{CWD}/test/lib/link-link-global-linked-pkg-to-local-nm-when-using-args/my-project/node_modules/test-pkg-link -> {CWD}/test/lib/link-link-global-linked-pkg-to-local-nm-when-using-args/test-pkg-link + +` + +exports[`test/lib/link.js TAP link pkg already in global space > should create a local symlink to global pkg 1`] = ` +{CWD}/test/lib/link-link-pkg-already-in-global-space/my-project/node_modules/@myscope/linked -> {CWD}/test/lib/link-link-pkg-already-in-global-space/scoped-linked + +` + +exports[`test/lib/link.js TAP link to globalDir when in current working dir of pkg and no args > should create a global link to current pkg 1`] = ` +{CWD}/test/lib/link-link-to-globalDir-when-in-current-working-dir-of-pkg-and-no-args/global-prefix/lib/node_modules/test-pkg-link -> {CWD}/test/lib/link-link-to-globalDir-when-in-current-working-dir-of-pkg-and-no-args/test-pkg-link + +` diff --git a/deps/npm/tap-snapshots/test-lib-ls.js-TAP.test.js b/deps/npm/tap-snapshots/test-lib-ls.js-TAP.test.js new file mode 100644 index 00000000000000..795c7e508ba97d --- /dev/null +++ b/deps/npm/tap-snapshots/test-lib-ls.js-TAP.test.js @@ -0,0 +1,602 @@ +/* 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/ls.js TAP ls --depth=0 > should output tree containing only top-level dependencies 1`] = ` +test-npm-ls@1.0.0 {CWD}/ls-ls--depth-0 ++-- foo@1.0.0 +\`-- lorem@1.0.0 + +` + +exports[`test/lib/ls.js TAP ls --depth=1 > should output tree containing top-level deps and their deps only 1`] = ` +test-npm-ls@1.0.0 {CWD}/ls-ls--depth-1 ++-- a@1.0.0 +| \`-- b@1.0.0 +\`-- e@1.0.0 + +` + +exports[`test/lib/ls.js TAP ls --dev > should output tree containing dev deps 1`] = ` +test-npm-ls@1.0.0 {CWD}/ls-ls--dev +\`-- dev-dep@1.0.0 + \`-- foo@1.0.0 + \`-- bar@1.0.0 + +` + +exports[`test/lib/ls.js TAP ls --link > should output tree containing linked deps 1`] = ` +test-npm-ls@1.0.0 {CWD}/ls-ls--link +\`-- linked-dep@1.0.0 -> {CWD}/ls-ls--link/linked-dep + +` + +exports[`test/lib/ls.js TAP ls --long --depth=0 > should output tree containing top-level deps with descriptions 1`] = ` +test-npm-ls@1.0.0 +| {CWD}/ls-ls--long-depth-0 +| ++-- dev-dep@1.0.0 +| A DEV dep kind of dep ++-- lorem@1.0.0 +| ++-- optional-dep@1.0.0 +| Maybe a dep? ++-- peer-dep@1.0.0 +| Peer-dep description here +\`-- prod-dep@1.0.0 + A PROD dep kind of dep + +` + +exports[`test/lib/ls.js TAP ls --long > should output tree info with descriptions 1`] = ` +test-npm-ls@1.0.0 +| {CWD}/ls-ls--long +| ++-- dev-dep@1.0.0 +| | A DEV dep kind of dep +| \`-- foo@1.0.0 +| | +| \`-- bar@1.0.0 +| ++-- lorem@1.0.0 +| ++-- optional-dep@1.0.0 +| Maybe a dep? ++-- peer-dep@1.0.0 +| Peer-dep description here +\`-- prod-dep@1.0.0 + | A PROD dep kind of dep + \`-- bar@2.0.0 + A dep that bars + +` + +exports[`test/lib/ls.js TAP ls --only=development > should output tree containing only development deps 1`] = ` +test-npm-ls@1.0.0 {CWD}/ls-ls--only-development +\`-- dev-dep@1.0.0 + \`-- foo@1.0.0 + \`-- bar@1.0.0 + +` + +exports[`test/lib/ls.js TAP ls --only=prod > should output tree containing only prod deps 1`] = ` +test-npm-ls@1.0.0 {CWD}/ls-ls--only-prod ++-- lorem@1.0.0 ++-- optional-dep@1.0.0 +\`-- prod-dep@1.0.0 + \`-- bar@2.0.0 + +` + +exports[`test/lib/ls.js TAP ls --parseable --depth=0 > should output tree containing only top-level dependencies 1`] = ` +{CWD}/ls-ls-parseable--depth-0 +{CWD}/ls-ls-parseable--depth-0/node_modules/foo +{CWD}/ls-ls-parseable--depth-0/node_modules/lorem +` + +exports[`test/lib/ls.js TAP ls --parseable --depth=1 > should output parseable containing top-level deps and their deps only 1`] = ` +{CWD}/ls-ls-parseable--depth-1 +{CWD}/ls-ls-parseable--depth-1/node_modules/foo +{CWD}/ls-ls-parseable--depth-1/node_modules/lorem +{CWD}/ls-ls-parseable--depth-1/node_modules/bar +` + +exports[`test/lib/ls.js TAP ls --parseable --dev > should output tree containing dev deps 1`] = ` +{CWD}/ls-ls-parseable--dev +{CWD}/ls-ls-parseable--dev/node_modules/dev-dep +{CWD}/ls-ls-parseable--dev/node_modules/foo +{CWD}/ls-ls-parseable--dev/node_modules/bar +` + +exports[`test/lib/ls.js TAP ls --parseable --link > should output tree containing linked deps 1`] = ` +{CWD}/ls-ls-parseable--link +{CWD}/ls-ls-parseable--link/node_modules/linked-dep +` + +exports[`test/lib/ls.js TAP ls --parseable --long --depth=0 > should output tree containing top-level deps with descriptions 1`] = ` +{CWD}/ls-ls-parseable--long-depth-0:test-npm-ls@1.0.0 +{CWD}/ls-ls-parseable--long-depth-0/node_modules/dev-dep:dev-dep@1.0.0 +{CWD}/ls-ls-parseable--long-depth-0/node_modules/lorem:lorem@1.0.0 +{CWD}/ls-ls-parseable--long-depth-0/node_modules/optional-dep:optional-dep@1.0.0 +{CWD}/ls-ls-parseable--long-depth-0/node_modules/peer-dep:peer-dep@1.0.0 +{CWD}/ls-ls-parseable--long-depth-0/node_modules/prod-dep:prod-dep@1.0.0 +` + +exports[`test/lib/ls.js TAP ls --parseable --long > should output tree info with descriptions 1`] = ` +{CWD}/ls-ls-parseable--long:test-npm-ls@1.0.0 +{CWD}/ls-ls-parseable--long/node_modules/dev-dep:dev-dep@1.0.0 +{CWD}/ls-ls-parseable--long/node_modules/lorem:lorem@1.0.0 +{CWD}/ls-ls-parseable--long/node_modules/optional-dep:optional-dep@1.0.0 +{CWD}/ls-ls-parseable--long/node_modules/peer-dep:peer-dep@1.0.0 +{CWD}/ls-ls-parseable--long/node_modules/prod-dep:prod-dep@1.0.0 +{CWD}/ls-ls-parseable--long/node_modules/foo:foo@1.0.0 +{CWD}/ls-ls-parseable--long/node_modules/prod-dep/node_modules/bar:bar@2.0.0 +{CWD}/ls-ls-parseable--long/node_modules/bar:bar@1.0.0 +` + +exports[`test/lib/ls.js TAP ls --parseable --long missing/invalid/extraneous > should output parseable result containing EXTRANEOUS/INVALID labels 1`] = ` +{CWD}/ls-ls-parseable--long-missing-invalid-extraneous:test-npm-ls@1.0.0 +{CWD}/ls-ls-parseable--long-missing-invalid-extraneous/node_modules/foo:foo@1.0.0:INVALID +{CWD}/ls-ls-parseable--long-missing-invalid-extraneous/node_modules/lorem:lorem@1.0.0:EXTRANEOUS +{CWD}/ls-ls-parseable--long-missing-invalid-extraneous/node_modules/bar:bar@1.0.0 +` + +exports[`test/lib/ls.js TAP ls --parseable --long print symlink target location > should output parseable results with symlink targets 1`] = ` +{CWD}/ls-ls-parseable--long-print-symlink-target-location:test-npm-ls@1.0.0 +{CWD}/ls-ls-parseable--long-print-symlink-target-location/node_modules/dev-dep:dev-dep@1.0.0 +{CWD}/ls-ls-parseable--long-print-symlink-target-location/node_modules/linked-dep:linked-dep@1.0.0:{CWD}/ls-ls-parseable--long-print-symlink-target-location/linked-dep +{CWD}/ls-ls-parseable--long-print-symlink-target-location/node_modules/lorem:lorem@1.0.0 +{CWD}/ls-ls-parseable--long-print-symlink-target-location/node_modules/optional-dep:optional-dep@1.0.0 +{CWD}/ls-ls-parseable--long-print-symlink-target-location/node_modules/peer-dep:peer-dep@1.0.0 +{CWD}/ls-ls-parseable--long-print-symlink-target-location/node_modules/prod-dep:prod-dep@1.0.0 +{CWD}/ls-ls-parseable--long-print-symlink-target-location/node_modules/foo:foo@1.0.0 +{CWD}/ls-ls-parseable--long-print-symlink-target-location/node_modules/prod-dep/node_modules/bar:bar@2.0.0 +{CWD}/ls-ls-parseable--long-print-symlink-target-location/node_modules/bar:bar@1.0.0 +` + +exports[`test/lib/ls.js TAP ls --parseable --long with extraneous deps > should output long parseable output with extraneous info 1`] = ` +{CWD}/ls-ls-parseable--long-with-extraneous-deps:test-npm-ls@1.0.0 +{CWD}/ls-ls-parseable--long-with-extraneous-deps/node_modules/foo:foo@1.0.0 +{CWD}/ls-ls-parseable--long-with-extraneous-deps/node_modules/lorem:lorem@1.0.0:EXTRANEOUS +{CWD}/ls-ls-parseable--long-with-extraneous-deps/node_modules/bar:bar@1.0.0 +` + +exports[`test/lib/ls.js TAP ls --parseable --only=development > should output tree containing only development deps 1`] = ` +{CWD}/ls-ls-parseable--only-development +{CWD}/ls-ls-parseable--only-development/node_modules/dev-dep +{CWD}/ls-ls-parseable--only-development/node_modules/foo +{CWD}/ls-ls-parseable--only-development/node_modules/bar +` + +exports[`test/lib/ls.js TAP ls --parseable --only=prod > should output tree containing only prod deps 1`] = ` +{CWD}/ls-ls-parseable--only-prod +{CWD}/ls-ls-parseable--only-prod/node_modules/lorem +{CWD}/ls-ls-parseable--only-prod/node_modules/optional-dep +{CWD}/ls-ls-parseable--only-prod/node_modules/prod-dep +{CWD}/ls-ls-parseable--only-prod/node_modules/prod-dep/node_modules/bar +` + +exports[`test/lib/ls.js TAP ls --parseable --production > should output tree containing production deps 1`] = ` +{CWD}/ls-ls-parseable--production +{CWD}/ls-ls-parseable--production/node_modules/lorem +{CWD}/ls-ls-parseable--production/node_modules/optional-dep +{CWD}/ls-ls-parseable--production/node_modules/prod-dep +{CWD}/ls-ls-parseable--production/node_modules/prod-dep/node_modules/bar +` + +exports[`test/lib/ls.js TAP ls --parseable cycle deps > should print tree output ommiting deduped ref 1`] = ` +{CWD}/ls-ls-parseable-cycle-deps +{CWD}/ls-ls-parseable-cycle-deps/node_modules/a +{CWD}/ls-ls-parseable-cycle-deps/node_modules/b +` + +exports[`test/lib/ls.js TAP ls --parseable default --depth value should be 0 > should output parseable output containing only top-level dependencies 1`] = ` +{CWD}/ls-ls-parseable-default-depth-value-should-be-0 +{CWD}/ls-ls-parseable-default-depth-value-should-be-0/node_modules/foo +{CWD}/ls-ls-parseable-default-depth-value-should-be-0/node_modules/lorem +` + +exports[`test/lib/ls.js TAP ls --parseable empty location > should print empty result 1`] = ` +{CWD}/ls-ls-parseable-empty-location +` + +exports[`test/lib/ls.js TAP ls --parseable extraneous deps > should output containing problems info 1`] = ` +{CWD}/ls-ls-parseable-extraneous-deps +{CWD}/ls-ls-parseable-extraneous-deps/node_modules/foo +{CWD}/ls-ls-parseable-extraneous-deps/node_modules/lorem +{CWD}/ls-ls-parseable-extraneous-deps/node_modules/bar +` + +exports[`test/lib/ls.js TAP ls --parseable from and resolved properties > should not be printed in tree output 1`] = ` +{CWD}/ls-ls-parseable-from-and-resolved-properties +{CWD}/ls-ls-parseable-from-and-resolved-properties/node_modules/simple-output +` + +exports[`test/lib/ls.js TAP ls --parseable global > should print parseable output for global deps 1`] = ` +{CWD}/ls-ls-parseable-global +{CWD}/ls-ls-parseable-global/node_modules/a +{CWD}/ls-ls-parseable-global/node_modules/b +{CWD}/ls-ls-parseable-global/node_modules/b/node_modules/c +` + +exports[`test/lib/ls.js TAP ls --parseable json read problems > should print empty result 1`] = ` +{CWD}/ls-ls-parseable-json-read-problems +` + +exports[`test/lib/ls.js TAP ls --parseable missing package.json > should log all extraneous deps on error msg 1`] = ` +extraneous: bar@1.0.0 {CWD}/ls-ls-parseable-missing-package-json/node_modules/bar +extraneous: foo@1.0.0 {CWD}/ls-ls-parseable-missing-package-json/node_modules/foo +extraneous: lorem@1.0.0 {CWD}/ls-ls-parseable-missing-package-json/node_modules/lorem +` + +exports[`test/lib/ls.js TAP ls --parseable missing package.json > should output parseable missing name/version of top-level package 1`] = ` +{CWD}/ls-ls-parseable-missing-package-json +{CWD}/ls-ls-parseable-missing-package-json/node_modules/bar +{CWD}/ls-ls-parseable-missing-package-json/node_modules/foo +{CWD}/ls-ls-parseable-missing-package-json/node_modules/lorem +` + +exports[`test/lib/ls.js TAP ls --parseable missing/invalid/extraneous > should output parseable containing top-level deps and their deps only 1`] = ` +{CWD}/ls-ls-parseable-missing-invalid-extraneous +{CWD}/ls-ls-parseable-missing-invalid-extraneous/node_modules/foo +{CWD}/ls-ls-parseable-missing-invalid-extraneous/node_modules/lorem +{CWD}/ls-ls-parseable-missing-invalid-extraneous/node_modules/bar +` + +exports[`test/lib/ls.js TAP ls --parseable no args > should output parseable representation of dependencies structure 1`] = ` +{CWD}/ls-ls-parseable-no-args +{CWD}/ls-ls-parseable-no-args/node_modules/foo +{CWD}/ls-ls-parseable-no-args/node_modules/lorem +{CWD}/ls-ls-parseable-no-args/node_modules/bar +` + +exports[`test/lib/ls.js TAP ls --parseable resolved points to git ref > should output tree containing git refs 1`] = ` +{CWD}/ls-ls-parseable-resolved-points-to-git-ref +{CWD}/ls-ls-parseable-resolved-points-to-git-ref/node_modules/abbrev +` + +exports[`test/lib/ls.js TAP ls --parseable unmet optional dep > should output parseable with empty entry for missing optional deps 1`] = ` +{CWD}/ls-ls-parseable-unmet-optional-dep +{CWD}/ls-ls-parseable-unmet-optional-dep/node_modules/dev-dep +{CWD}/ls-ls-parseable-unmet-optional-dep/node_modules/lorem +{CWD}/ls-ls-parseable-unmet-optional-dep/node_modules/optional-dep +{CWD}/ls-ls-parseable-unmet-optional-dep/node_modules/peer-dep +{CWD}/ls-ls-parseable-unmet-optional-dep/node_modules/prod-dep +{CWD}/ls-ls-parseable-unmet-optional-dep/node_modules/foo +{CWD}/ls-ls-parseable-unmet-optional-dep/node_modules/prod-dep/node_modules/bar +{CWD}/ls-ls-parseable-unmet-optional-dep/node_modules/bar +` + +exports[`test/lib/ls.js TAP ls --parseable unmet peer dep > should output parseable signaling missing peer dep in problems 1`] = ` +{CWD}/ls-ls-parseable-unmet-peer-dep +{CWD}/ls-ls-parseable-unmet-peer-dep/node_modules/dev-dep +{CWD}/ls-ls-parseable-unmet-peer-dep/node_modules/lorem +{CWD}/ls-ls-parseable-unmet-peer-dep/node_modules/optional-dep +{CWD}/ls-ls-parseable-unmet-peer-dep/node_modules/peer-dep +{CWD}/ls-ls-parseable-unmet-peer-dep/node_modules/prod-dep +{CWD}/ls-ls-parseable-unmet-peer-dep/node_modules/foo +{CWD}/ls-ls-parseable-unmet-peer-dep/node_modules/prod-dep/node_modules/bar +{CWD}/ls-ls-parseable-unmet-peer-dep/node_modules/bar +` + +exports[`test/lib/ls.js TAP ls --parseable using aliases > should output tree containing aliases 1`] = ` +{CWD}/ls-ls-parseable-using-aliases +{CWD}/ls-ls-parseable-using-aliases/node_modules/a +` + +exports[`test/lib/ls.js TAP ls --parseable with filter arg > should output parseable contaning only occurences of filtered by package 1`] = ` +{CWD}/ls-ls-parseable-with-filter-arg/node_modules/lorem +` + +exports[`test/lib/ls.js TAP ls --parseable with filter arg nested dep > should output parseable contaning only occurences of filtered package 1`] = ` +{CWD}/ls-ls-parseable-with-filter-arg-nested-dep/node_modules/bar +` + +exports[`test/lib/ls.js TAP ls --parseable with missing filter arg > should output parseable output containing no dependencies info 1`] = ` + +` + +exports[`test/lib/ls.js TAP ls --parseable with multiple filter args > should output parseable contaning only occurences of multiple filtered packages and their ancestors 1`] = ` +{CWD}/ls-ls-parseable-with-multiple-filter-args/node_modules/lorem +{CWD}/ls-ls-parseable-with-multiple-filter-args/node_modules/bar +` + +exports[`test/lib/ls.js TAP ls --production > should output tree containing production deps 1`] = ` +test-npm-ls@1.0.0 {CWD}/ls-ls--production ++-- lorem@1.0.0 ++-- optional-dep@1.0.0 +\`-- prod-dep@1.0.0 + \`-- bar@2.0.0 + +` + +exports[`test/lib/ls.js TAP ls broken resolved field > should NOT print git refs in output tree 1`] = ` +npm-broken-resolved-field-test@1.0.0 {CWD}/ls-ls-broken-resolved-field +\`-- a@1.0.1 + +` + +exports[`test/lib/ls.js TAP ls coloured output > should output tree containing color info 1`] = ` +test-npm-ls@1.0.0 {CWD}/ls-ls-coloured-output ++-- foo@1.0.0 invalid +| \`-- bar@1.0.0 ++-- UNMET DEPENDENCY ipsum@^1.0.0 +\`-- lorem@1.0.0 extraneous + +` + +exports[`test/lib/ls.js TAP ls cycle deps > should print tree output containing deduped ref 1`] = ` +test-npm-ls@1.0.0 {CWD}/ls-ls-cycle-deps +\`-- a@1.0.0 + \`-- b@1.0.0 + \`-- a@1.0.0 deduped + +` + +exports[`test/lib/ls.js TAP ls cycle deps with filter args > should print tree output containing deduped ref 1`] = ` +test-npm-ls@1.0.0 {CWD}/ls-ls-cycle-deps-with-filter-args +\`-- a@1.0.0 + \`-- b@1.0.0 + \`-- a@1.0.0 deduped + +` + +exports[`test/lib/ls.js TAP ls deduped missing dep > should output parseable signaling missing peer dep in problems 1`] = ` +test-npm-ls@1.0.0 {CWD}/ls-ls-deduped-missing-dep ++-- a@1.0.0 +| \`-- UNMET DEPENDENCY b@^1.0.0 deduped +\`-- UNMET DEPENDENCY b@^1.0.0 + +` + +exports[`test/lib/ls.js TAP ls default --depth value should be 0 > should output tree containing only top-level dependencies 1`] = ` +test-npm-ls@1.0.0 {CWD}/ls-ls-default-depth-value-should-be-0 ++-- foo@1.0.0 +\`-- lorem@1.0.0 + +` + +exports[`test/lib/ls.js TAP ls empty location > should print empty result 1`] = ` +{CWD}/ls-ls-empty-location +\`-- (empty) + +` + +exports[`test/lib/ls.js TAP ls extraneous deps > should output containing problems info 1`] = ` +test-npm-ls@1.0.0 {CWD}/ls-ls-extraneous-deps ++-- foo@1.0.0 +| \`-- bar@1.0.0 +\`-- lorem@1.0.0 extraneous + +` + +exports[`test/lib/ls.js TAP ls filter pkg arg using depth option > should list a in top-level only 1`] = ` +test-pkg-arg-filter-with-depth-opt@1.0.0 {CWD}/ls-ls-filter-pkg-arg-using-depth-option +\`-- a@1.0.0 + +` + +exports[`test/lib/ls.js TAP ls filter pkg arg using depth option > should print empty results msg 1`] = ` +test-pkg-arg-filter-with-depth-opt@1.0.0 {CWD}/ls-ls-filter-pkg-arg-using-depth-option +\`-- (empty) + +` + +exports[`test/lib/ls.js TAP ls filter pkg arg using depth option > should print expected result 1`] = ` +test-pkg-arg-filter-with-depth-opt@1.0.0 {CWD}/ls-ls-filter-pkg-arg-using-depth-option +\`-- b@1.0.0 + \`-- c@1.0.0 + \`-- d@1.0.0 + +` + +exports[`test/lib/ls.js TAP ls filtering by child of missing dep > should print tree and not duplicate child of missing items 1`] = ` +filter-by-child-of-missing-dep@1.0.0 {CWD}/ls-ls-filtering-by-child-of-missing-dep ++-- b@1.0.0 extraneous +| \`-- c@1.0.0 deduped ++-- c@1.0.0 extraneous +\`-- d@1.0.0 extraneous + \`-- c@2.0.0 extraneous + +` + +exports[`test/lib/ls.js TAP ls from and resolved properties > should not be printed in tree output 1`] = ` +test-npm-ls@1.0.0 {CWD}/ls-ls-from-and-resolved-properties +\`-- simple-output@2.1.1 + +` + +exports[`test/lib/ls.js TAP ls global > should print tree and not mark top-level items extraneous 1`] = ` +{CWD}/ls-ls-global ++-- a@1.0.0 +\`-- b@1.0.0 + \`-- c@1.0.0 + +` + +exports[`test/lib/ls.js TAP ls invalid deduped dep > should output tree signaling mismatching peer dep in problems 1`] = ` +invalid-deduped-dep@1.0.0 {CWD}/ls-ls-invalid-deduped-dep ++-- a@1.0.0 +| \`-- b@1.0.0 deduped invalid +\`-- b@1.0.0 invalid + +` + +exports[`test/lib/ls.js TAP ls invalid peer dep > should output tree signaling mismatching peer dep in problems 1`] = ` +test-npm-ls@1.0.0 {CWD}/ls-ls-invalid-peer-dep ++-- dev-dep@1.0.0 +| \`-- foo@1.0.0 +| \`-- bar@1.0.0 ++-- lorem@1.0.0 ++-- optional-dep@1.0.0 ++-- peer-dep@1.0.0 invalid +\`-- prod-dep@1.0.0 + \`-- bar@2.0.0 + +` + +exports[`test/lib/ls.js TAP ls json read problems > should print empty result 1`] = ` +{CWD}/ls-ls-json-read-problems +\`-- (empty) + +` + +exports[`test/lib/ls.js TAP ls loading a tree containing workspaces > should filter single workspace 1`] = ` +filter-by-child-of-missing-dep@1.0.0 {CWD}/ls-ls-loading-a-tree-containing-workspaces +\`-- a@1.0.0 -> {CWD}/ls-ls-loading-a-tree-containing-workspaces/a + +` + +exports[`test/lib/ls.js TAP ls loading a tree containing workspaces > should list workspaces properly 1`] = ` +filter-by-child-of-missing-dep@1.0.0 {CWD}/ls-ls-loading-a-tree-containing-workspaces ++-- a@1.0.0 -> {CWD}/ls-ls-loading-a-tree-containing-workspaces/a +| \`-- c@1.0.0 +\`-- b@1.0.0 -> {CWD}/ls-ls-loading-a-tree-containing-workspaces/b + +` + +exports[`test/lib/ls.js TAP ls missing package.json > should log all extraneous deps on error msg 1`] = ` +extraneous: bar@1.0.0 {CWD}/ls-ls-missing-package-json/node_modules/bar +extraneous: foo@1.0.0 {CWD}/ls-ls-missing-package-json/node_modules/foo +extraneous: lorem@1.0.0 {CWD}/ls-ls-missing-package-json/node_modules/lorem +` + +exports[`test/lib/ls.js TAP ls missing package.json > should output tree missing name/version of top-level package 1`] = ` +{CWD}/ls-ls-missing-package-json ++-- bar@1.0.0 extraneous ++-- foo@1.0.0 extraneous +| \`-- bar@1.0.0 deduped +\`-- lorem@1.0.0 extraneous + +` + +exports[`test/lib/ls.js TAP ls missing/invalid/extraneous > should output tree containing missing, invalid, extraneous labels 1`] = ` +test-npm-ls@1.0.0 {CWD}/ls-ls-missing-invalid-extraneous ++-- foo@1.0.0 invalid +| \`-- bar@1.0.0 ++-- UNMET DEPENDENCY ipsum@^1.0.0 +\`-- lorem@1.0.0 extraneous + +` + +exports[`test/lib/ls.js TAP ls no args > should output tree representation of dependencies structure 1`] = ` +test-npm-ls@1.0.0 {CWD}/ls-ls-no-args ++-- foo@1.0.0 +| \`-- bar@1.0.0 +\`-- lorem@1.0.0 + +` + +exports[`test/lib/ls.js TAP ls print deduped symlinks > should output tree containing linked deps 1`] = ` +print-deduped-symlinks@1.0.0 {CWD}/ls-ls-print-deduped-symlinks ++-- a@1.0.0 +| \`-- b@1.0.0 deduped -> {CWD}/ls-ls-print-deduped-symlinks/b +\`-- b@1.0.0 -> {CWD}/ls-ls-print-deduped-symlinks/b + +` + +exports[`test/lib/ls.js TAP ls resolved points to git ref > should output tree containing git refs 1`] = ` +test-npm-ls@1.0.0 {CWD}/ls-ls-resolved-points-to-git-ref +\`-- abbrev@1.1.1 (git+ssh://git@github.com/isaacs/abbrev-js.git#b8f3a2fc0c3bb8ffd8b0d0072cc6b5a3667e963c) + +` + +exports[`test/lib/ls.js TAP ls unmet optional dep > should output tree with empty entry for missing optional deps 1`] = ` +test-npm-ls@1.0.0 {CWD}/ls-ls-unmet-optional-dep ++-- dev-dep@1.0.0 +| \`-- foo@1.0.0 +| \`-- bar@1.0.0 ++-- lorem@1.0.0 ++-- UNMET OPTIONAL DEPENDENCY missing-optional-dep@^1.0.0 ++-- optional-dep@1.0.0 invalid ++-- peer-dep@1.0.0 +\`-- prod-dep@1.0.0 + \`-- bar@2.0.0 + +` + +exports[`test/lib/ls.js TAP ls unmet peer dep > should output tree signaling missing peer dep in problems 1`] = ` +test-npm-ls@1.0.0 {CWD}/ls-ls-unmet-peer-dep +\`-- UNMET DEPENDENCY peer-dep@* + +` + +exports[`test/lib/ls.js TAP ls using aliases > should output tree containing aliases 1`] = ` +test-npm-ls@1.0.0 {CWD}/ls-ls-using-aliases +\`-- a@npm:b@1.0.0 + +` + +exports[`test/lib/ls.js TAP ls with args and dedupe entries > should print tree output containing deduped ref 1`] = ` +dedupe-entries@1.0.0 {CWD}/ls-ls-with-args-and-dedupe-entries ++-- @npmcli/a@1.0.0 +| \`-- @npmcli/b@1.1.2 deduped ++-- @npmcli/b@1.1.2 +\`-- @npmcli/c@1.0.0 + \`-- @npmcli/b@1.1.2 deduped + +` + +exports[`test/lib/ls.js TAP ls with args and different order of items > should print tree output containing deduped ref 1`] = ` +dedupe-entries@1.0.0 {CWD}/ls-ls-with-args-and-different-order-of-items ++-- @npmcli/a@1.0.0 +| \`-- @npmcli/c@1.0.0 deduped ++-- @npmcli/b@1.1.2 +| \`-- @npmcli/c@1.0.0 deduped +\`-- @npmcli/c@1.0.0 + +` + +exports[`test/lib/ls.js TAP ls with dot filter arg > should output tree contaning only occurences of filtered by package and coloured output 1`] = ` +test-npm-ls@1.0.0 {CWD}/ls-ls-with-dot-filter-arg +\`-- (empty) + +` + +exports[`test/lib/ls.js TAP ls with filter arg > should output tree contaning only occurences of filtered by package and coloured output 1`] = ` +test-npm-ls@1.0.0 {CWD}/ls-ls-with-filter-arg +\`-- lorem@1.0.0 + +` + +exports[`test/lib/ls.js TAP ls with filter arg nested dep > should output tree contaning only occurences of filtered package and its ancestors 1`] = ` +test-npm-ls@1.0.0 {CWD}/ls-ls-with-filter-arg-nested-dep +\`-- foo@1.0.0 + \`-- bar@1.0.0 + +` + +exports[`test/lib/ls.js TAP ls with missing filter arg > should output tree containing no dependencies info 1`] = ` +test-npm-ls@1.0.0 {CWD}/ls-ls-with-missing-filter-arg +\`-- (empty) + +` + +exports[`test/lib/ls.js TAP ls with multiple filter args > should output tree contaning only occurences of multiple filtered packages and their ancestors 1`] = ` +test-npm-ls@1.0.0 {CWD}/ls-ls-with-multiple-filter-args ++-- foo@1.0.0 +| \`-- bar@1.0.0 +\`-- lorem@1.0.0 + +` + +exports[`test/lib/ls.js TAP ls with no args dedupe entries > should print tree output containing deduped ref 1`] = ` +dedupe-entries@1.0.0 {CWD}/ls-ls-with-no-args-dedupe-entries ++-- @npmcli/a@1.0.0 +| \`-- @npmcli/b@1.1.2 deduped ++-- @npmcli/b@1.1.2 +\`-- @npmcli/c@1.0.0 + \`-- @npmcli/b@1.1.2 deduped + +` + +exports[`test/lib/ls.js TAP ls with no args dedupe entries and not displaying all > should print tree output containing deduped ref 1`] = ` +dedupe-entries@1.0.0 {CWD}/ls-ls-with-no-args-dedupe-entries-and-not-displaying-all ++-- @npmcli/a@1.0.0 ++-- @npmcli/b@1.1.2 +\`-- @npmcli/c@1.0.0 + +` diff --git a/deps/npm/tap-snapshots/test-lib-outdated.js-TAP.test.js b/deps/npm/tap-snapshots/test-lib-outdated.js-TAP.test.js new file mode 100644 index 00000000000000..7f245b09ed9200 --- /dev/null +++ b/deps/npm/tap-snapshots/test-lib-outdated.js-TAP.test.js @@ -0,0 +1,154 @@ +/* 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/outdated.js TAP should display outdated deps outdated --all > must match snapshot 1`] = ` + +Package Current Wanted Latest Location Depended by +alpha 1.0.0 1.0.1 1.0.1 node_modules/alpha outdated-should-display-outdated-deps +beta 1.0.0 1.0.1 1.0.1 node_modules/beta outdated-should-display-outdated-deps +gamma 1.0.1 1.0.1 2.0.0 node_modules/gamma outdated-should-display-outdated-deps +theta MISSING 1.0.1 1.0.1 - outdated-should-display-outdated-deps +` + +exports[`test/lib/outdated.js TAP should display outdated deps outdated --json --long > must match snapshot 1`] = ` + +{ + "alpha": { + "current": "1.0.0", + "wanted": "1.0.1", + "latest": "1.0.1", + "dependent": "outdated-should-display-outdated-deps", + "location": "{CWD}/test/lib/outdated-should-display-outdated-deps/node_modules/alpha", + "type": "dependencies" + }, + "beta": { + "current": "1.0.0", + "wanted": "1.0.1", + "latest": "1.0.1", + "dependent": "outdated-should-display-outdated-deps", + "location": "{CWD}/test/lib/outdated-should-display-outdated-deps/node_modules/beta", + "type": "peerDependencies" + }, + "gamma": { + "current": "1.0.1", + "wanted": "1.0.1", + "latest": "2.0.0", + "dependent": "outdated-should-display-outdated-deps", + "location": "{CWD}/test/lib/outdated-should-display-outdated-deps/node_modules/gamma", + "type": "dependencies" + }, + "theta": { + "wanted": "1.0.1", + "latest": "1.0.1", + "dependent": "outdated-should-display-outdated-deps", + "type": "dependencies" + } +} +` + +exports[`test/lib/outdated.js TAP should display outdated deps outdated --json > must match snapshot 1`] = ` + +{ + "alpha": { + "current": "1.0.0", + "wanted": "1.0.1", + "latest": "1.0.1", + "dependent": "outdated-should-display-outdated-deps", + "location": "{CWD}/test/lib/outdated-should-display-outdated-deps/node_modules/alpha" + }, + "beta": { + "current": "1.0.0", + "wanted": "1.0.1", + "latest": "1.0.1", + "dependent": "outdated-should-display-outdated-deps", + "location": "{CWD}/test/lib/outdated-should-display-outdated-deps/node_modules/beta" + }, + "gamma": { + "current": "1.0.1", + "wanted": "1.0.1", + "latest": "2.0.0", + "dependent": "outdated-should-display-outdated-deps", + "location": "{CWD}/test/lib/outdated-should-display-outdated-deps/node_modules/gamma" + }, + "theta": { + "wanted": "1.0.1", + "latest": "1.0.1", + "dependent": "outdated-should-display-outdated-deps" + } +} +` + +exports[`test/lib/outdated.js TAP should display outdated deps outdated --long > must match snapshot 1`] = ` + +Package Current Wanted Latest Location Depended by Package Type Homepage +alpha 1.0.0 1.0.1 1.0.1 node_modules/alpha outdated-should-display-outdated-deps dependencies +beta 1.0.0 1.0.1 1.0.1 node_modules/beta outdated-should-display-outdated-deps peerDependencies +gamma 1.0.1 1.0.1 2.0.0 node_modules/gamma outdated-should-display-outdated-deps dependencies +theta MISSING 1.0.1 1.0.1 - outdated-should-display-outdated-deps dependencies +` + +exports[`test/lib/outdated.js TAP should display outdated deps outdated --omit=dev --omit=peer > must match snapshot 1`] = ` + +Package Current Wanted Latest Location Depended by +alpha 1.0.0 1.0.1 1.0.1 node_modules/alpha outdated-should-display-outdated-deps +gamma 1.0.1 1.0.1 2.0.0 node_modules/gamma outdated-should-display-outdated-deps +theta MISSING 1.0.1 1.0.1 - outdated-should-display-outdated-deps +` + +exports[`test/lib/outdated.js TAP should display outdated deps outdated --omit=dev > must match snapshot 1`] = ` + +Package Current Wanted Latest Location Depended by +alpha 1.0.0 1.0.1 1.0.1 node_modules/alpha outdated-should-display-outdated-deps +beta 1.0.0 1.0.1 1.0.1 node_modules/beta outdated-should-display-outdated-deps +gamma 1.0.1 1.0.1 2.0.0 node_modules/gamma outdated-should-display-outdated-deps +theta MISSING 1.0.1 1.0.1 - outdated-should-display-outdated-deps +` + +exports[`test/lib/outdated.js TAP should display outdated deps outdated --omit=prod > must match snapshot 1`] = ` + +Package Current Wanted Latest Location Depended by +alpha 1.0.0 1.0.1 1.0.1 node_modules/alpha outdated-should-display-outdated-deps +beta 1.0.0 1.0.1 1.0.1 node_modules/beta outdated-should-display-outdated-deps +gamma 1.0.1 1.0.1 2.0.0 node_modules/gamma outdated-should-display-outdated-deps +` + +exports[`test/lib/outdated.js TAP should display outdated deps outdated --parseable --long > must match snapshot 1`] = ` + +{CWD}/test/lib/outdated-should-display-outdated-deps/node_modules/alpha:alpha@1.0.1:alpha@1.0.0:alpha@1.0.1:outdated-should-display-outdated-deps:dependencies: +{CWD}/test/lib/outdated-should-display-outdated-deps/node_modules/beta:beta@1.0.1:beta@1.0.0:beta@1.0.1:outdated-should-display-outdated-deps:peerDependencies: +{CWD}/test/lib/outdated-should-display-outdated-deps/node_modules/gamma:gamma@1.0.1:gamma@1.0.1:gamma@2.0.0:outdated-should-display-outdated-deps:dependencies: +:theta@1.0.1:MISSING:theta@1.0.1:outdated-should-display-outdated-deps:dependencies: +` + +exports[`test/lib/outdated.js TAP should display outdated deps outdated --parseable > must match snapshot 1`] = ` + +{CWD}/test/lib/outdated-should-display-outdated-deps/node_modules/alpha:alpha@1.0.1:alpha@1.0.0:alpha@1.0.1:outdated-should-display-outdated-deps +{CWD}/test/lib/outdated-should-display-outdated-deps/node_modules/beta:beta@1.0.1:beta@1.0.0:beta@1.0.1:outdated-should-display-outdated-deps +{CWD}/test/lib/outdated-should-display-outdated-deps/node_modules/gamma:gamma@1.0.1:gamma@1.0.1:gamma@2.0.0:outdated-should-display-outdated-deps +:theta@1.0.1:MISSING:theta@1.0.1:outdated-should-display-outdated-deps +` + +exports[`test/lib/outdated.js TAP should display outdated deps outdated > must match snapshot 1`] = ` + +Package Current Wanted Latest Location Depended by +alpha 1.0.0 1.0.1 1.0.1 node_modules/alpha outdated-should-display-outdated-deps +beta 1.0.0 1.0.1 1.0.1 node_modules/beta outdated-should-display-outdated-deps +gamma 1.0.1 1.0.1 2.0.0 node_modules/gamma outdated-should-display-outdated-deps +theta MISSING 1.0.1 1.0.1 - outdated-should-display-outdated-deps +` + +exports[`test/lib/outdated.js TAP should display outdated deps outdated global > must match snapshot 1`] = ` + +Package Current Wanted Latest Location Depended by +alpha 1.0.0 1.0.1 1.0.1 node_modules/alpha global +` + +exports[`test/lib/outdated.js TAP should display outdated deps outdated specific dep > must match snapshot 1`] = ` + +Package Current Wanted Latest Location Depended by +alpha 1.0.0 1.0.1 1.0.1 node_modules/alpha outdated-should-display-outdated-deps +` 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 new file mode 100644 index 00000000000000..6af6c13f56b9f7 --- /dev/null +++ b/deps/npm/tap-snapshots/test-lib-publish.js-TAP.test.js @@ -0,0 +1,13 @@ +/* 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/publish.js TAP shows usage with wrong set of arguments > should print usage 1`] = ` +npm publish [] [--tag ] [--access ] [--dry-run] + +Publishes '.' if no argument supplied +Sets tag \`latest\` if no --tag specified +` diff --git a/deps/npm/tap-snapshots/test-lib-utils-cmd-list.js-TAP.test.js b/deps/npm/tap-snapshots/test-lib-utils-cmd-list.js-TAP.test.js new file mode 100644 index 00000000000000..c77da6b18317dc --- /dev/null +++ b/deps/npm/tap-snapshots/test-lib-utils-cmd-list.js-TAP.test.js @@ -0,0 +1,199 @@ +/* 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/cmd-list.js TAP > must match snapshot 1`] = ` +Object { + "affordances": Object { + "add": "install", + "add-user": "adduser", + "author": "owner", + "dist-tags": "dist-tag", + "find": "search", + "hlep": "help", + "home": "docs", + "ic": "ci", + "in": "install", + "info": "view", + "innit": "init", + "ins": "install", + "inst": "install", + "insta": "install", + "instal": "install", + "install-clean": "ci", + "isnt": "install", + "isnta": "install", + "isntal": "install", + "isntall-clean": "ci", + "issues": "bugs", + "la": "ll", + "login": "adduser", + "ogr": "org", + "r": "uninstall", + "remove": "uninstall", + "rm": "uninstall", + "rum": "run-script", + "show": "view", + "sit": "cit", + "udpate": "update", + "unlink": "uninstall", + "upgrade": "update", + "urn": "run-script", + "verison": "version", + }, + "aliases": Object { + "add": "install", + "add-user": "adduser", + "author": "owner", + "c": "config", + "cit": "install-ci-test", + "clean-install": "ci", + "clean-install-test": "cit", + "create": "init", + "ddp": "dedupe", + "dist-tags": "dist-tag", + "find": "search", + "hlep": "help", + "home": "docs", + "i": "install", + "ic": "ci", + "in": "install", + "info": "view", + "innit": "init", + "ins": "install", + "inst": "install", + "insta": "install", + "instal": "install", + "install-clean": "ci", + "isnt": "install", + "isnta": "install", + "isntal": "install", + "isntall-clean": "ci", + "issues": "bugs", + "it": "install-test", + "la": "ll", + "list": "ls", + "ln": "link", + "login": "adduser", + "ogr": "org", + "r": "uninstall", + "rb": "rebuild", + "remove": "uninstall", + "rm": "uninstall", + "rum": "run-script", + "run": "run-script", + "s": "search", + "se": "search", + "show": "view", + "sit": "cit", + "t": "test", + "tst": "test", + "udpate": "update", + "un": "uninstall", + "unlink": "uninstall", + "unstar": "star", + "up": "update", + "upgrade": "update", + "urn": "run-script", + "v": "view", + "verison": "version", + "why": "explain", + "x": "exec", + }, + "cmdList": Array [ + "ci", + "install-ci-test", + "install", + "install-test", + "uninstall", + "cache", + "config", + "set", + "get", + "update", + "outdated", + "prune", + "pack", + "find-dupes", + "dedupe", + "hook", + "rebuild", + "link", + "publish", + "star", + "stars", + "adduser", + "login", + "logout", + "unpublish", + "owner", + "access", + "team", + "deprecate", + "shrinkwrap", + "token", + "profile", + "audit", + "fund", + "org", + "help", + "ls", + "ll", + "search", + "view", + "init", + "version", + "edit", + "explore", + "docs", + "repo", + "bugs", + "root", + "prefix", + "bin", + "whoami", + "dist-tag", + "ping", + "test", + "stop", + "start", + "restart", + "run-script", + "completion", + "doctor", + "exec", + "explain", + ], + "plumbing": Array [ + "birthday", + "help-search", + ], + "shorthands": Object { + "c": "config", + "cit": "install-ci-test", + "clean-install": "ci", + "clean-install-test": "cit", + "create": "init", + "ddp": "dedupe", + "i": "install", + "it": "install-test", + "list": "ls", + "ln": "link", + "rb": "rebuild", + "run": "run-script", + "s": "search", + "se": "search", + "t": "test", + "tst": "test", + "un": "uninstall", + "unstar": "star", + "up": "update", + "v": "view", + "why": "explain", + "x": "exec", + }, +} +` 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 new file mode 100644 index 00000000000000..a6f66273669efa --- /dev/null +++ b/deps/npm/tap-snapshots/test-lib-utils-config.js-TAP.test.js @@ -0,0 +1,1550 @@ +/* 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 process.umask() method > must match snapshot 1`] = ` +Object { + "defaults": Object { + "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, + "cidr": null, + "color": true, + "commit-hooks": true, + "depth": null, + "description": true, + "dev": false, + "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, + "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", + "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", + "metrics-registry": null, + "node-options": null, + "node-version": "v14.8.0", + "noproxy": null, + "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, + "send-metrics": false, + "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": 18, + "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", + ], + "N": Array [ + "--no-registry", + ], + "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 { + "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}", + ], + "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}", + "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}", + "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}", + "group": Array [ + "{Number TYPE}", + "{String TYPE}", + ], + "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}", + "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}", + "metrics-registry": Array [ + null, + "{String TYPE}", + ], + "node-options": Array [ + null, + "{String TYPE}", + ], + "node-version": Array [ + null, + "{SEMVER MODULE}", + ], + "noproxy": Array [ + null, + "{String TYPE}", + "{Array TYPE}", + ], + "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}", + "send-metrics": "{Boolean 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 no working network interfaces, on windows > must match snapshot 1`] = ` +Object { + "defaults": Object { + "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, + "cidr": null, + "color": true, + "commit-hooks": true, + "depth": null, + "description": true, + "dev": false, + "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, + "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", + "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", + "metrics-registry": null, + "node-options": null, + "node-version": "v14.8.0", + "noproxy": null, + "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, + "send-metrics": false, + "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": 22, + "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", + ], + "N": Array [ + "--no-registry", + ], + "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 { + "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}", + ], + "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}", + "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}", + "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}", + "group": Array [ + "{Number TYPE}", + "{String TYPE}", + ], + "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}", + "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}", + "metrics-registry": Array [ + null, + "{String TYPE}", + ], + "node-options": Array [ + null, + "{String TYPE}", + ], + "node-version": Array [ + null, + "{SEMVER MODULE}", + ], + "noproxy": Array [ + null, + "{String TYPE}", + "{Array TYPE}", + ], + "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}", + "send-metrics": "{Boolean 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 { + "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, + "cidr": null, + "color": true, + "commit-hooks": true, + "depth": null, + "description": true, + "dev": false, + "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, + "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", + "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", + "metrics-registry": null, + "node-options": null, + "node-version": "v14.8.0", + "noproxy": null, + "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, + "send-metrics": false, + "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": 22, + "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", + ], + "N": Array [ + "--no-registry", + ], + "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 { + "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}", + ], + "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}", + "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}", + "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}", + "group": Array [ + "{Number TYPE}", + "{String TYPE}", + ], + "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}", + "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}", + "metrics-registry": Array [ + null, + "{String TYPE}", + ], + "node-options": Array [ + null, + "{String TYPE}", + ], + "node-version": Array [ + null, + "{SEMVER MODULE}", + ], + "noproxy": Array [ + null, + "{String TYPE}", + "{Array TYPE}", + ], + "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}", + "send-metrics": "{Boolean 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-error-handler.js-TAP.test.js b/deps/npm/tap-snapshots/test-lib-utils-error-handler.js-TAP.test.js new file mode 100644 index 00000000000000..909051cdab5061 --- /dev/null +++ b/deps/npm/tap-snapshots/test-lib-utils-error-handler.js-TAP.test.js @@ -0,0 +1,23 @@ +/* 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/error-handler.js TAP handles unknown error > should have expected log contents for unknown error 1`] = ` +0 verbose code 1 +1 error foo A complete log of this run can be found in: +1 error foo {CWD}/cachefolder/_logs/expecteddate-debug.log +2 verbose stack Error: ERROR +3 verbose cwd {CWD} +4 verbose Foo 1.0.0 +5 verbose argv "/node" "{CWD}/test/lib/utils/error-handler.js" +6 verbose node v1.0.0 +7 verbose npm v1.0.0 +8 error foo code ERROR +9 error foo ERR ERROR +10 error foo ERR ERROR +11 verbose exit 1 + +` diff --git a/deps/npm/tap-snapshots/test-lib-utils-error-message.js-TAP.test.js b/deps/npm/tap-snapshots/test-lib-utils-error-message.js-TAP.test.js new file mode 100644 index 00000000000000..21fff0b87be099 --- /dev/null +++ b/deps/npm/tap-snapshots/test-lib-utils-error-message.js-TAP.test.js @@ -0,0 +1,1256 @@ +/* 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/error-message.js TAP 404 name with error > must match snapshot 1`] = ` +Object { + "detail": Array [ + Array [ + "404", + "", + ], + Array [ + "404", + "", + "'node_modules' is not in the npm registry.", + ], + Array [ + "404", + "This package name is not valid, because", + "", + ], + Array [ + "404", + " 1. node_modules is a blacklisted name", + ], + Array [ + "404", + "\\nNote that you can also install from a", + ], + Array [ + "404", + "tarball, folder, http url, or git url.", + ], + ], + "summary": Array [ + Array [ + "404", + "not found", + ], + ], +} +` + +exports[`test/lib/utils/error-message.js TAP 404 name with warning > must match snapshot 1`] = ` +Object { + "detail": Array [ + Array [ + "404", + "", + ], + Array [ + "404", + "", + "'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' is not in the npm registry.", + ], + Array [ + "404", + "This package name is not valid, because", + "", + ], + Array [ + "404", + " 1. name can no longer contain more than 214 characters", + ], + Array [ + "404", + "\\nNote that you can also install from a", + ], + Array [ + "404", + "tarball, folder, http url, or git url.", + ], + ], + "summary": Array [ + Array [ + "404", + "not found", + ], + ], +} +` + +exports[`test/lib/utils/error-message.js TAP 404 no package id > must match snapshot 1`] = ` +Object { + "detail": Array [], + "summary": Array [ + Array [ + "404", + "not found", + ], + ], +} +` + +exports[`test/lib/utils/error-message.js TAP 404 you should publish it > must match snapshot 1`] = ` +Object { + "detail": Array [ + Array [ + "404", + "", + ], + Array [ + "404", + "", + "'yolo' is not in the npm registry.", + ], + Array [ + "404", + "You should bug the author to publish it (or use the name yourself!)", + ], + Array [ + "404", + "\\nNote that you can also install from a", + ], + Array [ + "404", + "tarball, folder, http url, or git url.", + ], + ], + "summary": Array [ + Array [ + "404", + "not found", + ], + ], +} +` + +exports[`test/lib/utils/error-message.js TAP bad engine with config loaded > must match snapshot 1`] = ` +Object { + "detail": Array [ + Array [ + "notsup", + "Not compatible with your version of node/npm: some@package\\nRequired: undefined\\nActual: {\\"npm\\":\\"123.69.420-npm\\",\\"node\\":\\"99.99.99\\"}", + ], + ], + "summary": Array [ + Array [ + "engine", + "foo", + ], + Array [ + "engine", + "Not compatible with your version of node/npm: some@package", + ], + ], +} +` + +exports[`test/lib/utils/error-message.js TAP bad platform array os/arch > must match snapshot 1`] = ` +Object { + "detail": Array [ + Array [ + "notsup", + "Valid OS: !yours,mine\\nValid Arch: x420,x69\\nActual OS: posix\\nActual Arch: x64", + ], + ], + "summary": Array [ + Array [ + "notsup", + "Unsupported platform for lodash@1.0.0: wanted {\\"os\\":\\"!yours,mine\\",\\"arch\\":\\"x420,x69\\"} (current: {\\"os\\":\\"posix\\",\\"arch\\":\\"x64\\"})", + ], + ], +} +` + +exports[`test/lib/utils/error-message.js TAP bad platform string os/arch > must match snapshot 1`] = ` +Object { + "detail": Array [ + Array [ + "notsup", + "Valid OS: !yours\\nValid Arch: x420\\nActual OS: posix\\nActual Arch: x64", + ], + ], + "summary": Array [ + Array [ + "notsup", + "Unsupported platform for lodash@1.0.0: wanted {\\"os\\":\\"!yours\\",\\"arch\\":\\"x420\\"} (current: {\\"os\\":\\"posix\\",\\"arch\\":\\"x64\\"})", + ], + ], +} +` + +exports[`test/lib/utils/error-message.js TAP default message > must match snapshot 1`] = ` +Object { + "detail": Array [], + "summary": Array [ + Array [ + "", + "error object", + ], + ], +} +` + +exports[`test/lib/utils/error-message.js TAP default message > must match snapshot 2`] = ` +Object { + "detail": Array [], + "summary": Array [ + Array [ + "", + "error string", + ], + ], +} +` + +exports[`test/lib/utils/error-message.js TAP default message > must match snapshot 3`] = ` +Object { + "detail": Array [ + Array [ + "signal", + "SIGYOLO", + ], + Array [ + "command", + "some command", + "a", + "r", + "g", + "s", + ], + Array [ + "", + "stdout", + ], + Array [ + "", + "stderr", + ], + ], + "summary": Array [ + Array [ + "", + "cmd err", + ], + ], +} +` + +exports[`test/lib/utils/error-message.js TAP eacces/eperm {"windows":false,"loaded":false,"cachePath":false,"cacheDest":false} > must match snapshot 1`] = ` +Object { + "detail": Array [ + Array [ + "", + "\\nThe operation was rejected by your operating system.\\nIt is likely you do not have the permissions to access this file as the current user\\n\\nIf you believe this might be a permissions issue, please double-check the\\npermissions of the file and its containing directories, or try running\\nthe command again as root/Administrator.", + ], + ], + "summary": Array [ + Array [ + "", + Error: whoopsie { + "code": "EACCES", + "dest": "/not/cache/dir/dest", + "path": "/not/cache/dir/path", + }, + ], + ], +} +` + +exports[`test/lib/utils/error-message.js TAP eacces/eperm {"windows":false,"loaded":false,"cachePath":false,"cacheDest":false} > must match snapshot 2`] = ` +Array [] +` + +exports[`test/lib/utils/error-message.js TAP eacces/eperm {"windows":false,"loaded":false,"cachePath":false,"cacheDest":true} > must match snapshot 1`] = ` +Object { + "detail": Array [ + Array [ + "", + "\\nThe operation was rejected by your operating system.\\nIt is likely you do not have the permissions to access this file as the current user\\n\\nIf you believe this might be a permissions issue, please double-check the\\npermissions of the file and its containing directories, or try running\\nthe command again as root/Administrator.", + ], + ], + "summary": Array [ + Array [ + "", + Error: whoopsie { + "code": "EACCES", + "dest": "/some/cache/dir/dest", + "path": "/not/cache/dir/path", + }, + ], + ], +} +` + +exports[`test/lib/utils/error-message.js TAP eacces/eperm {"windows":false,"loaded":false,"cachePath":false,"cacheDest":true} > must match snapshot 2`] = ` +Array [] +` + +exports[`test/lib/utils/error-message.js TAP eacces/eperm {"windows":false,"loaded":false,"cachePath":true,"cacheDest":false} > must match snapshot 1`] = ` +Object { + "detail": Array [ + Array [ + "", + "\\nThe operation was rejected by your operating system.\\nIt is likely you do not have the permissions to access this file as the current user\\n\\nIf you believe this might be a permissions issue, please double-check the\\npermissions of the file and its containing directories, or try running\\nthe command again as root/Administrator.", + ], + ], + "summary": Array [ + Array [ + "", + Error: whoopsie { + "code": "EACCES", + "dest": "/not/cache/dir/dest", + "path": "/some/cache/dir/path", + }, + ], + ], +} +` + +exports[`test/lib/utils/error-message.js TAP eacces/eperm {"windows":false,"loaded":false,"cachePath":true,"cacheDest":false} > must match snapshot 2`] = ` +Array [] +` + +exports[`test/lib/utils/error-message.js TAP eacces/eperm {"windows":false,"loaded":false,"cachePath":true,"cacheDest":true} > must match snapshot 1`] = ` +Object { + "detail": Array [ + Array [ + "", + "\\nThe operation was rejected by your operating system.\\nIt is likely you do not have the permissions to access this file as the current user\\n\\nIf you believe this might be a permissions issue, please double-check the\\npermissions of the file and its containing directories, or try running\\nthe command again as root/Administrator.", + ], + ], + "summary": Array [ + Array [ + "", + Error: whoopsie { + "code": "EACCES", + "dest": "/some/cache/dir/dest", + "path": "/some/cache/dir/path", + }, + ], + ], +} +` + +exports[`test/lib/utils/error-message.js TAP eacces/eperm {"windows":false,"loaded":false,"cachePath":true,"cacheDest":true} > must match snapshot 2`] = ` +Array [] +` + +exports[`test/lib/utils/error-message.js TAP eacces/eperm {"windows":false,"loaded":true,"cachePath":false,"cacheDest":false} > must match snapshot 1`] = ` +Object { + "detail": Array [ + Array [ + "", + "\\nThe operation was rejected by your operating system.\\nIt is likely you do not have the permissions to access this file as the current user\\n\\nIf you believe this might be a permissions issue, please double-check the\\npermissions of the file and its containing directories, or try running\\nthe command again as root/Administrator.", + ], + ], + "summary": Array [ + Array [ + "", + Error: whoopsie { + "code": "EACCES", + "dest": "/not/cache/dir/dest", + "path": "/not/cache/dir/path", + }, + ], + ], +} +` + +exports[`test/lib/utils/error-message.js TAP eacces/eperm {"windows":false,"loaded":true,"cachePath":false,"cacheDest":false} > must match snapshot 2`] = ` +Array [] +` + +exports[`test/lib/utils/error-message.js TAP eacces/eperm {"windows":false,"loaded":true,"cachePath":false,"cacheDest":true} > must match snapshot 1`] = ` +Object { + "detail": Array [], + "summary": Array [ + Array [ + "", + "\\nYour cache folder contains root-owned files, due to a bug in\\nprevious versions of npm which has since been addressed.\\n\\nTo permanently fix this problem, please run:\\n sudo chown -R 69:420 \\"/some/cache/dir\\"", + ], + ], +} +` + +exports[`test/lib/utils/error-message.js TAP eacces/eperm {"windows":false,"loaded":true,"cachePath":false,"cacheDest":true} > must match snapshot 2`] = ` +Array [ + Array [ + "dummy stack trace", + ], +] +` + +exports[`test/lib/utils/error-message.js TAP eacces/eperm {"windows":false,"loaded":true,"cachePath":true,"cacheDest":false} > must match snapshot 1`] = ` +Object { + "detail": Array [], + "summary": Array [ + Array [ + "", + "\\nYour cache folder contains root-owned files, due to a bug in\\nprevious versions of npm which has since been addressed.\\n\\nTo permanently fix this problem, please run:\\n sudo chown -R 69:420 \\"/some/cache/dir\\"", + ], + ], +} +` + +exports[`test/lib/utils/error-message.js TAP eacces/eperm {"windows":false,"loaded":true,"cachePath":true,"cacheDest":false} > must match snapshot 2`] = ` +Array [ + Array [ + "dummy stack trace", + ], +] +` + +exports[`test/lib/utils/error-message.js TAP eacces/eperm {"windows":false,"loaded":true,"cachePath":true,"cacheDest":true} > must match snapshot 1`] = ` +Object { + "detail": Array [], + "summary": Array [ + Array [ + "", + "\\nYour cache folder contains root-owned files, due to a bug in\\nprevious versions of npm which has since been addressed.\\n\\nTo permanently fix this problem, please run:\\n sudo chown -R 69:420 \\"/some/cache/dir\\"", + ], + ], +} +` + +exports[`test/lib/utils/error-message.js TAP eacces/eperm {"windows":false,"loaded":true,"cachePath":true,"cacheDest":true} > must match snapshot 2`] = ` +Array [ + Array [ + "dummy stack trace", + ], +] +` + +exports[`test/lib/utils/error-message.js TAP eacces/eperm {"windows":true,"loaded":false,"cachePath":false,"cacheDest":false} > must match snapshot 1`] = ` +Object { + "detail": Array [ + Array [ + "", + "\\nThe operation was rejected by your operating system.\\nIt's possible that the file was already in use (by a text editor or antivirus),\\nor that you lack permissions to access it.\\n\\nIf you believe this might be a permissions issue, please double-check the\\npermissions of the file and its containing directories, or try running\\nthe command again as root/Administrator.", + ], + ], + "summary": Array [ + Array [ + "", + Error: whoopsie { + "code": "EACCES", + "dest": "/not/cache/dir/dest", + "path": "/not/cache/dir/path", + }, + ], + ], +} +` + +exports[`test/lib/utils/error-message.js TAP eacces/eperm {"windows":true,"loaded":false,"cachePath":false,"cacheDest":false} > must match snapshot 2`] = ` +Array [] +` + +exports[`test/lib/utils/error-message.js TAP eacces/eperm {"windows":true,"loaded":false,"cachePath":false,"cacheDest":true} > must match snapshot 1`] = ` +Object { + "detail": Array [ + Array [ + "", + "\\nThe operation was rejected by your operating system.\\nIt's possible that the file was already in use (by a text editor or antivirus),\\nor that you lack permissions to access it.\\n\\nIf you believe this might be a permissions issue, please double-check the\\npermissions of the file and its containing directories, or try running\\nthe command again as root/Administrator.", + ], + ], + "summary": Array [ + Array [ + "", + Error: whoopsie { + "code": "EACCES", + "dest": "/some/cache/dir/dest", + "path": "/not/cache/dir/path", + }, + ], + ], +} +` + +exports[`test/lib/utils/error-message.js TAP eacces/eperm {"windows":true,"loaded":false,"cachePath":false,"cacheDest":true} > must match snapshot 2`] = ` +Array [] +` + +exports[`test/lib/utils/error-message.js TAP eacces/eperm {"windows":true,"loaded":false,"cachePath":true,"cacheDest":false} > must match snapshot 1`] = ` +Object { + "detail": Array [ + Array [ + "", + "\\nThe operation was rejected by your operating system.\\nIt's possible that the file was already in use (by a text editor or antivirus),\\nor that you lack permissions to access it.\\n\\nIf you believe this might be a permissions issue, please double-check the\\npermissions of the file and its containing directories, or try running\\nthe command again as root/Administrator.", + ], + ], + "summary": Array [ + Array [ + "", + Error: whoopsie { + "code": "EACCES", + "dest": "/not/cache/dir/dest", + "path": "/some/cache/dir/path", + }, + ], + ], +} +` + +exports[`test/lib/utils/error-message.js TAP eacces/eperm {"windows":true,"loaded":false,"cachePath":true,"cacheDest":false} > must match snapshot 2`] = ` +Array [] +` + +exports[`test/lib/utils/error-message.js TAP eacces/eperm {"windows":true,"loaded":false,"cachePath":true,"cacheDest":true} > must match snapshot 1`] = ` +Object { + "detail": Array [ + Array [ + "", + "\\nThe operation was rejected by your operating system.\\nIt's possible that the file was already in use (by a text editor or antivirus),\\nor that you lack permissions to access it.\\n\\nIf you believe this might be a permissions issue, please double-check the\\npermissions of the file and its containing directories, or try running\\nthe command again as root/Administrator.", + ], + ], + "summary": Array [ + Array [ + "", + Error: whoopsie { + "code": "EACCES", + "dest": "/some/cache/dir/dest", + "path": "/some/cache/dir/path", + }, + ], + ], +} +` + +exports[`test/lib/utils/error-message.js TAP eacces/eperm {"windows":true,"loaded":false,"cachePath":true,"cacheDest":true} > must match snapshot 2`] = ` +Array [] +` + +exports[`test/lib/utils/error-message.js TAP eacces/eperm {"windows":true,"loaded":true,"cachePath":false,"cacheDest":false} > must match snapshot 1`] = ` +Object { + "detail": Array [ + Array [ + "", + "\\nThe operation was rejected by your operating system.\\nIt's possible that the file was already in use (by a text editor or antivirus),\\nor that you lack permissions to access it.\\n\\nIf you believe this might be a permissions issue, please double-check the\\npermissions of the file and its containing directories, or try running\\nthe command again as root/Administrator.", + ], + ], + "summary": Array [ + Array [ + "", + Error: whoopsie { + "code": "EACCES", + "dest": "/not/cache/dir/dest", + "path": "/not/cache/dir/path", + }, + ], + ], +} +` + +exports[`test/lib/utils/error-message.js TAP eacces/eperm {"windows":true,"loaded":true,"cachePath":false,"cacheDest":false} > must match snapshot 2`] = ` +Array [] +` + +exports[`test/lib/utils/error-message.js TAP eacces/eperm {"windows":true,"loaded":true,"cachePath":false,"cacheDest":true} > must match snapshot 1`] = ` +Object { + "detail": Array [ + Array [ + "", + "\\nThe operation was rejected by your operating system.\\nIt's possible that the file was already in use (by a text editor or antivirus),\\nor that you lack permissions to access it.\\n\\nIf you believe this might be a permissions issue, please double-check the\\npermissions of the file and its containing directories, or try running\\nthe command again as root/Administrator.", + ], + ], + "summary": Array [ + Array [ + "", + Error: whoopsie { + "code": "EACCES", + "dest": "/some/cache/dir/dest", + "path": "/not/cache/dir/path", + }, + ], + ], +} +` + +exports[`test/lib/utils/error-message.js TAP eacces/eperm {"windows":true,"loaded":true,"cachePath":false,"cacheDest":true} > must match snapshot 2`] = ` +Array [] +` + +exports[`test/lib/utils/error-message.js TAP eacces/eperm {"windows":true,"loaded":true,"cachePath":true,"cacheDest":false} > must match snapshot 1`] = ` +Object { + "detail": Array [ + Array [ + "", + "\\nThe operation was rejected by your operating system.\\nIt's possible that the file was already in use (by a text editor or antivirus),\\nor that you lack permissions to access it.\\n\\nIf you believe this might be a permissions issue, please double-check the\\npermissions of the file and its containing directories, or try running\\nthe command again as root/Administrator.", + ], + ], + "summary": Array [ + Array [ + "", + Error: whoopsie { + "code": "EACCES", + "dest": "/not/cache/dir/dest", + "path": "/some/cache/dir/path", + }, + ], + ], +} +` + +exports[`test/lib/utils/error-message.js TAP eacces/eperm {"windows":true,"loaded":true,"cachePath":true,"cacheDest":false} > must match snapshot 2`] = ` +Array [] +` + +exports[`test/lib/utils/error-message.js TAP eacces/eperm {"windows":true,"loaded":true,"cachePath":true,"cacheDest":true} > must match snapshot 1`] = ` +Object { + "detail": Array [ + Array [ + "", + "\\nThe operation was rejected by your operating system.\\nIt's possible that the file was already in use (by a text editor or antivirus),\\nor that you lack permissions to access it.\\n\\nIf you believe this might be a permissions issue, please double-check the\\npermissions of the file and its containing directories, or try running\\nthe command again as root/Administrator.", + ], + ], + "summary": Array [ + Array [ + "", + Error: whoopsie { + "code": "EACCES", + "dest": "/some/cache/dir/dest", + "path": "/some/cache/dir/path", + }, + ], + ], +} +` + +exports[`test/lib/utils/error-message.js TAP eacces/eperm {"windows":true,"loaded":true,"cachePath":true,"cacheDest":true} > must match snapshot 2`] = ` +Array [] +` + +exports[`test/lib/utils/error-message.js TAP enoent without a file > must match snapshot 1`] = ` +Object { + "detail": Array [ + Array [ + "enoent", + "This is related to npm not being able to find a file.\\n", + ], + ], + "summary": Array [ + Array [ + "enoent", + "foo", + ], + ], +} +` + +exports[`test/lib/utils/error-message.js TAP enolock without a command > must match snapshot 1`] = ` +Object { + "detail": Array [ + Array [ + "", + "Try creating one first with: npm i --package-lock-only", + ], + Array [ + "", + "Original error: foo", + ], + ], + "summary": Array [ + Array [ + "", + "This command requires an existing lockfile.", + ], + ], +} +` + +exports[`test/lib/utils/error-message.js TAP eotp/e401 401, no auth headers > must match snapshot 1`] = ` +Object { + "detail": Array [], + "summary": Array [ + Array [ + "", + "nope", + ], + ], +} +` + +exports[`test/lib/utils/error-message.js TAP eotp/e401 401, no message > must match snapshot 1`] = ` +Object { + "detail": Array [], + "summary": Array [ + Array [ + "", + Object { + "code": "E401", + }, + ], + ], +} +` + +exports[`test/lib/utils/error-message.js TAP eotp/e401 one-time pass challenge code > must match snapshot 1`] = ` +Object { + "detail": Array [ + Array [ + "", + "You can provide a one-time password by passing --otp= to the command you ran.\\nIf you already provided a one-time password then it is likely that you either typoed\\nit, or it timed out. Please try again.", + ], + ], + "summary": Array [ + Array [ + "", + "This operation requires a one-time password from your authenticator.", + ], + ], +} +` + +exports[`test/lib/utils/error-message.js TAP eotp/e401 one-time pass challenge message > must match snapshot 1`] = ` +Object { + "detail": Array [ + Array [ + "", + "You can provide a one-time password by passing --otp= to the command you ran.\\nIf you already provided a one-time password then it is likely that you either typoed\\nit, or it timed out. Please try again.", + ], + ], + "summary": Array [ + Array [ + "", + "This operation requires a one-time password from your authenticator.", + ], + ], +} +` + +exports[`test/lib/utils/error-message.js TAP eotp/e401 www-authenticate challenges Basic realm=by, charset="UTF-8", challenge="your friends" > must match snapshot 1`] = ` +Object { + "detail": Array [ + Array [ + "", + "If you were trying to login, change your password, create an\\nauthentication token or enable two-factor authentication then\\nthat means you likely typed your password in incorrectly.\\nPlease try again, or recover your password at:\\n https://www.npmjs.com/forgot\\n\\nIf you were doing some other operation then your saved credentials are\\nprobably out of date. To correct this please try logging in again with:\\n npm login", + ], + ], + "summary": Array [ + Array [ + "", + "Incorrect or missing password.", + ], + ], +} +` + +exports[`test/lib/utils/error-message.js TAP eotp/e401 www-authenticate challenges Bearer realm=do, charset="UTF-8", challenge="yourself" > must match snapshot 1`] = ` +Object { + "detail": Array [ + Array [ + "", + "To correct this please trying logging in again with:\\n npm login", + ], + ], + "summary": Array [ + Array [ + "", + "Unable to authenticate, your authentication token seems to be invalid.", + ], + ], +} +` + +exports[`test/lib/utils/error-message.js TAP eotp/e401 www-authenticate challenges PickACardAnyCard realm=friday, charset="UTF-8" > must match snapshot 1`] = ` +Object { + "detail": Array [], + "summary": Array [ + Array [ + "", + "challenge!", + ], + ], +} +` + +exports[`test/lib/utils/error-message.js TAP eotp/e401 www-authenticate challenges WashYourHands, charset="UTF-8" > must match snapshot 1`] = ` +Object { + "detail": Array [], + "summary": Array [ + Array [ + "", + "challenge!", + ], + ], +} +` + +exports[`test/lib/utils/error-message.js TAP explain ERESOLVE errors > must match snapshot 1`] = ` +Object { + "detail": Array [ + Array [ + "", + "", + ], + Array [ + "", + "explanation", + ], + ], + "summary": Array [ + Array [ + "ERESOLVE", + "could not resolve", + ], + ], +} +` + +exports[`test/lib/utils/error-message.js TAP just simple messages > must match snapshot 1`] = ` +Object { + "detail": Array [], + "summary": Array [ + Array [ + "audit", + "foo", + ], + ], +} +` + +exports[`test/lib/utils/error-message.js TAP just simple messages > must match snapshot 10`] = ` +Object { + "detail": Array [ + Array [ + "network", + "This is a problem related to network connectivity.\\nIn most cases you are behind a proxy or have bad network settings.\\n\\nIf you are behind a proxy, please make sure that the\\n'proxy' config is set properly. See: 'npm help config'", + ], + ], + "summary": Array [ + Array [ + "network", + "foo", + ], + ], +} +` + +exports[`test/lib/utils/error-message.js TAP just simple messages > must match snapshot 11`] = ` +Object { + "detail": Array [ + Array [ + "network", + "This is a problem related to network connectivity.\\nIn most cases you are behind a proxy or have bad network settings.\\n\\nIf you are behind a proxy, please make sure that the\\n'proxy' config is set properly. See: 'npm help config'", + ], + ], + "summary": Array [ + Array [ + "network", + "foo", + ], + ], +} +` + +exports[`test/lib/utils/error-message.js TAP just simple messages > must match snapshot 12`] = ` +Object { + "detail": Array [ + Array [ + "network", + "This is a problem related to network connectivity.\\nIn most cases you are behind a proxy or have bad network settings.\\n\\nIf you are behind a proxy, please make sure that the\\n'proxy' config is set properly. See: 'npm help config'", + ], + ], + "summary": Array [ + Array [ + "network", + "foo", + ], + ], +} +` + +exports[`test/lib/utils/error-message.js TAP just simple messages > must match snapshot 13`] = ` +Object { + "detail": Array [ + Array [ + "notsup", + "Not compatible with your version of node/npm: some@package\\nRequired: undefined\\nActual: {\\"npm\\":\\"123.69.420-npm\\",\\"node\\":\\"123.69.420-node\\"}", + ], + ], + "summary": Array [ + Array [ + "engine", + "foo", + ], + Array [ + "engine", + "Not compatible with your version of node/npm: some@package", + ], + ], +} +` + +exports[`test/lib/utils/error-message.js TAP just simple messages > must match snapshot 14`] = ` +Object { + "detail": Array [ + Array [ + "nospc", + "There appears to be insufficient space on your system to finish.\\nClear up some disk space and try again.", + ], + ], + "summary": Array [ + Array [ + "nospc", + "foo", + ], + ], +} +` + +exports[`test/lib/utils/error-message.js TAP just simple messages > must match snapshot 15`] = ` +Object { + "detail": Array [ + Array [ + "rofs", + "Often virtualized file systems, or other file systems\\nthat don't support symlinks, give this error.", + ], + ], + "summary": Array [ + Array [ + "rofs", + "foo", + ], + ], +} +` + +exports[`test/lib/utils/error-message.js TAP just simple messages > must match snapshot 16`] = ` +Object { + "detail": Array [ + Array [ + "enoent", + "This is related to npm not being able to find a file.\\n\\nCheck if the file '/some/file' is present.", + ], + ], + "summary": Array [ + Array [ + "enoent", + "foo", + ], + ], +} +` + +exports[`test/lib/utils/error-message.js TAP just simple messages > must match snapshot 17`] = ` +Object { + "detail": Array [ + Array [ + "typeerror", + "This is an error with npm itself. Please report this error at:\\n https://github.com/npm/cli/issues", + ], + ], + "summary": Array [ + Array [ + "typeerror", + "dummy stack trace", + ], + ], +} +` + +exports[`test/lib/utils/error-message.js TAP just simple messages > must match snapshot 18`] = ` +Object { + "detail": Array [ + Array [ + "typeerror", + "This is an error with npm itself. Please report this error at:\\n https://github.com/npm/cli/issues", + ], + ], + "summary": Array [ + Array [ + "typeerror", + "dummy stack trace", + ], + ], +} +` + +exports[`test/lib/utils/error-message.js TAP just simple messages > must match snapshot 19`] = ` +Object { + "detail": Array [ + Array [ + "typeerror", + "This is an error with npm itself. Please report this error at:\\n https://github.com/npm/cli/issues", + ], + ], + "summary": Array [ + Array [ + "typeerror", + "dummy stack trace", + ], + ], +} +` + +exports[`test/lib/utils/error-message.js TAP just simple messages > must match snapshot 2`] = ` +Object { + "detail": Array [ + Array [ + "audit", + "Try creating one first with: npm i --package-lock-only", + ], + Array [ + "audit", + "Original error: foo", + ], + ], + "summary": Array [ + Array [ + "audit", + "This command requires an existing lockfile.", + ], + ], +} +` + +exports[`test/lib/utils/error-message.js TAP just simple messages > must match snapshot 20`] = ` +Object { + "detail": Array [ + Array [ + "typeerror", + "This is an error with npm itself. Please report this error at:\\n https://github.com/npm/cli/issues", + ], + ], + "summary": Array [ + Array [ + "typeerror", + "dummy stack trace", + ], + ], +} +` + +exports[`test/lib/utils/error-message.js TAP just simple messages > must match snapshot 21`] = ` +Object { + "detail": Array [ + Array [ + "notarget", + "In most cases you or one of your dependencies are requesting\\na package version that doesn't exist.", + ], + ], + "summary": Array [ + Array [ + "notarget", + "foo", + ], + ], +} +` + +exports[`test/lib/utils/error-message.js TAP just simple messages > must match snapshot 22`] = ` +Object { + "detail": Array [ + Array [ + "403", + "In most cases, you or one of your dependencies are requesting\\na package version that is forbidden by your security policy, or\\non a server you do not have access to.", + ], + ], + "summary": Array [ + Array [ + "403", + "foo", + ], + ], +} +` + +exports[`test/lib/utils/error-message.js TAP just simple messages > must match snapshot 3`] = ` +Object { + "detail": Array [ + Array [ + "", + "\\nIf you are behind a proxy, please make sure that the\\n'proxy' config is set properly. See: 'npm help config'", + ], + ], + "summary": Array [ + Array [ + "", + Error: foo { + "code": "ECONNREFUSED", + "file": "/some/file", + "path": "/some/path", + "pkgid": "some@package", + }, + ], + ], +} +` + +exports[`test/lib/utils/error-message.js TAP just simple messages > must match snapshot 4`] = ` +Object { + "detail": Array [ + Array [ + "", + "\\nFailed using git.\\nPlease check if you have git installed and in your PATH.", + ], + ], + "summary": Array [ + Array [ + "", + "foo", + ], + ], +} +` + +exports[`test/lib/utils/error-message.js TAP just simple messages > must match snapshot 5`] = ` +Object { + "detail": Array [ + Array [ + "publish fail", + "Update the 'version' field in package.json and try again.", + ], + Array [ + "publish fail", + "", + ], + Array [ + "publish fail", + "To automatically increment version numbers, see:", + ], + Array [ + "publish fail", + " npm help version", + ], + ], + "summary": Array [ + Array [ + "publish fail", + "Cannot publish over existing version.", + ], + ], +} +` + +exports[`test/lib/utils/error-message.js TAP just simple messages > must match snapshot 6`] = ` +Object { + "detail": Array [ + Array [ + "git", + "Refusing to remove it. Update manually,\\nor move it out of the way first.", + ], + ], + "summary": Array [ + Array [ + "git", + "foo", + ], + Array [ + "git", + " /some/path", + ], + ], +} +` + +exports[`test/lib/utils/error-message.js TAP just simple messages > must match snapshot 7`] = ` +Object { + "detail": Array [ + Array [ + "", + "Remove the existing file and try again, or run npm", + ], + Array [ + "", + "with --force to overwrite files recklessly.", + ], + ], + "summary": Array [ + Array [ + "", + "foo", + ], + Array [ + "", + "File exists: /some/path", + ], + ], +} +` + +exports[`test/lib/utils/error-message.js TAP just simple messages > must match snapshot 8`] = ` +Object { + "detail": Array [ + Array [ + "need auth", + "You need to authorize this machine using \`npm adduser\`", + ], + ], + "summary": Array [ + Array [ + "need auth", + "foo", + ], + ], +} +` + +exports[`test/lib/utils/error-message.js TAP just simple messages > must match snapshot 9`] = ` +Object { + "detail": Array [ + Array [ + "network", + "This is a problem related to network connectivity.\\nIn most cases you are behind a proxy or have bad network settings.\\n\\nIf you are behind a proxy, please make sure that the\\n'proxy' config is set properly. See: 'npm help config'", + ], + ], + "summary": Array [ + Array [ + "network", + "foo", + ], + ], +} +` + +exports[`v TAP json parse json somewhere else > must match snapshot 1`] = ` +Object { + "detail": Array [ + Array [ + "JSON.parse", + "Failed to parse JSON data.\\nNote: package.json must be actual JSON, not just JavaScript.", + ], + ], + "summary": Array [ + Array [ + "JSON.parse", + "not json", + ], + ], +} +` + +exports[`v TAP json parse just regular bad json in package.json > must match snapshot 1`] = ` +Object { + "detail": Array [ + Array [ + "JSON.parse", + "Failed to parse JSON data.\\nNote: package.json must be actual JSON, not just JavaScript.", + ], + ], + "summary": Array [ + Array [ + "JSON.parse", + "not json", + ], + ], +} +` + +exports[`v TAP json parse merge conflict in package.json > must match snapshot 1`] = ` +Object { + "detail": Array [ + Array [ + "", + "Merge conflict detected in your package.json.\\n\\nPlease resolve the package.json conflict and retry the command:\\n\\n$ arg v", + ], + ], + "summary": Array [], +} +` diff --git a/deps/npm/tap-snapshots/test-lib-utils-explain-dep.js-TAP.test.js b/deps/npm/tap-snapshots/test-lib-utils-explain-dep.js-TAP.test.js new file mode 100644 index 00000000000000..658cecb1ca68c9 --- /dev/null +++ b/deps/npm/tap-snapshots/test-lib-utils-explain-dep.js-TAP.test.js @@ -0,0 +1,178 @@ +/* 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/explain-dep.js TAP > ellipses test one 1`] = ` +manydep@1.0.0 + manydep@"1.0.0" from prod-dep@1.2.3 + node_modules/prod-dep + prod-dep@"1.x" from the root project + 6 more (optdep, extra-neos, deep-dev, peer, ...) +` + +exports[`test/lib/utils/explain-dep.js TAP > ellipses test two 1`] = ` +manydep@1.0.0 + manydep@"1.0.0" from prod-dep@1.2.3 + node_modules/prod-dep + prod-dep@"1.x" from the root project + 5 more (optdep, extra-neos, deep-dev, peer, a package with a pretty long name) +` + +exports[`test/lib/utils/explain-dep.js TAP deepDev > explain color deep 1`] = ` +deep-dev@2.3.4 dev +node_modules/deep-dev + deep-dev@"2.x" from metadev@3.4.5 + node_modules/dev/node_modules/metadev + metadev@"3.x" from topdev@4.5.6 + node_modules/topdev + dev topdev@"4.x" from the root project +` + +exports[`test/lib/utils/explain-dep.js TAP deepDev > explain nocolor shallow 1`] = ` +deep-dev@2.3.4 dev +node_modules/deep-dev + deep-dev@"2.x" from metadev@3.4.5 + node_modules/dev/node_modules/metadev + metadev@"3.x" from topdev@4.5.6 + node_modules/topdev +` + +exports[`test/lib/utils/explain-dep.js TAP deepDev > print color 1`] = ` +deep-dev@2.3.4 dev +node_modules/deep-dev +` + +exports[`test/lib/utils/explain-dep.js TAP deepDev > print nocolor 1`] = ` +deep-dev@2.3.4 dev +node_modules/deep-dev +` + +exports[`test/lib/utils/explain-dep.js TAP extraneous > explain color deep 1`] = ` +extra-neos@1337.420.69-lol extraneous +node_modules/extra-neos +` + +exports[`test/lib/utils/explain-dep.js TAP extraneous > explain nocolor shallow 1`] = ` +extra-neos@1337.420.69-lol extraneous +node_modules/extra-neos +` + +exports[`test/lib/utils/explain-dep.js TAP extraneous > print color 1`] = ` +extra-neos@1337.420.69-lol extraneous +node_modules/extra-neos +` + +exports[`test/lib/utils/explain-dep.js TAP extraneous > print nocolor 1`] = ` +extra-neos@1337.420.69-lol extraneous +node_modules/extra-neos +` + +exports[`test/lib/utils/explain-dep.js TAP manyDeps > explain color deep 1`] = ` +manydep@1.0.0 + manydep@"1.0.0" from prod-dep@1.2.3 + node_modules/prod-dep + prod-dep@"1.x" from the root project + optional manydep@"1.x" from optdep@1.0.0 optional + node_modules/optdep + optdep optdep@"1.0.0" from the root project + manydep@"1.0.x" from extra-neos@1337.420.69-lol extraneous + node_modules/extra-neos + dev manydep@"*" from deep-dev@2.3.4 dev + node_modules/deep-dev + deep-dev@"2.x" from metadev@3.4.5 + node_modules/dev/node_modules/metadev + metadev@"3.x" from topdev@4.5.6 + node_modules/topdev + dev topdev@"4.x" from the root project + peer manydep@">1.0.0-beta <1.0.1" from peer@1.0.0 peer + node_modules/peer + peer peer@"1.0.0" from the root project + manydep@"1" from a package with a pretty long name@1.2.3 + manydep@"1" from another package with a pretty long name@1.2.3 + manydep@"1" from yet another a package with a pretty long name@1.2.3 +` + +exports[`test/lib/utils/explain-dep.js TAP manyDeps > explain nocolor shallow 1`] = ` +manydep@1.0.0 + manydep@"1.0.0" from prod-dep@1.2.3 + node_modules/prod-dep + prod-dep@"1.x" from the root project + 7 more (optdep, extra-neos, deep-dev, peer, ...) +` + +exports[`test/lib/utils/explain-dep.js TAP manyDeps > print color 1`] = ` +manydep@1.0.0 +` + +exports[`test/lib/utils/explain-dep.js TAP manyDeps > print nocolor 1`] = ` +manydep@1.0.0 +` + +exports[`test/lib/utils/explain-dep.js TAP optional > explain color deep 1`] = ` +optdep@1.0.0 optional +node_modules/optdep + optdep optdep@"1.0.0" from the root project +` + +exports[`test/lib/utils/explain-dep.js TAP optional > explain nocolor shallow 1`] = ` +optdep@1.0.0 optional +node_modules/optdep + optdep optdep@"1.0.0" from the root project +` + +exports[`test/lib/utils/explain-dep.js TAP optional > print color 1`] = ` +optdep@1.0.0 optional +node_modules/optdep +` + +exports[`test/lib/utils/explain-dep.js TAP optional > print nocolor 1`] = ` +optdep@1.0.0 optional +node_modules/optdep +` + +exports[`test/lib/utils/explain-dep.js TAP peer > explain color deep 1`] = ` +peer@1.0.0 peer +node_modules/peer + peer peer@"1.0.0" from the root project +` + +exports[`test/lib/utils/explain-dep.js TAP peer > explain nocolor shallow 1`] = ` +peer@1.0.0 peer +node_modules/peer + peer peer@"1.0.0" from the root project +` + +exports[`test/lib/utils/explain-dep.js TAP peer > print color 1`] = ` +peer@1.0.0 peer +node_modules/peer +` + +exports[`test/lib/utils/explain-dep.js TAP peer > print nocolor 1`] = ` +peer@1.0.0 peer +node_modules/peer +` + +exports[`test/lib/utils/explain-dep.js TAP prodDep > explain color deep 1`] = ` +prod-dep@1.2.3 +node_modules/prod-dep + prod-dep@"1.x" from the root project +` + +exports[`test/lib/utils/explain-dep.js TAP prodDep > explain nocolor shallow 1`] = ` +prod-dep@1.2.3 +node_modules/prod-dep + prod-dep@"1.x" from the root project +` + +exports[`test/lib/utils/explain-dep.js TAP prodDep > print color 1`] = ` +prod-dep@1.2.3 +node_modules/prod-dep +` + +exports[`test/lib/utils/explain-dep.js TAP prodDep > print nocolor 1`] = ` +prod-dep@1.2.3 +node_modules/prod-dep +` diff --git a/deps/npm/tap-snapshots/test-lib-utils-explain-eresolve.js-TAP.test.js b/deps/npm/tap-snapshots/test-lib-utils-explain-eresolve.js-TAP.test.js new file mode 100644 index 00000000000000..716d82ced382ba --- /dev/null +++ b/deps/npm/tap-snapshots/test-lib-utils-explain-eresolve.js-TAP.test.js @@ -0,0 +1,938 @@ +/* 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/explain-eresolve.js TAP cycleNested > explain with color 1`] = ` +While resolving: @isaacs/peer-dep-cycle-a@1.0.0 +Found: @isaacs/peer-dep-cycle-c@2.0.0 +node_modules/@isaacs/peer-dep-cycle-c + @isaacs/peer-dep-cycle-c@"2.x" from the root project + +Could not add conflicting dependency: @isaacs/peer-dep-cycle-b@1.0.0 +node_modules/@isaacs/peer-dep-cycle-b + peer @isaacs/peer-dep-cycle-b@"1" from @isaacs/peer-dep-cycle-a@1.0.0 + node_modules/@isaacs/peer-dep-cycle-a + @isaacs/peer-dep-cycle-a@"1.x" from the root project + +Conflicting peer dependency: @isaacs/peer-dep-cycle-c@1.0.0 +node_modules/@isaacs/peer-dep-cycle-c + peer @isaacs/peer-dep-cycle-c@"1" from @isaacs/peer-dep-cycle-b@1.0.0 + node_modules/@isaacs/peer-dep-cycle-b + peer @isaacs/peer-dep-cycle-b@"1" from @isaacs/peer-dep-cycle-a@1.0.0 + node_modules/@isaacs/peer-dep-cycle-a +` + +exports[`test/lib/utils/explain-eresolve.js TAP cycleNested > explain with no color, depth of 6 1`] = ` +While resolving: @isaacs/peer-dep-cycle-a@1.0.0 +Found: @isaacs/peer-dep-cycle-c@2.0.0 +node_modules/@isaacs/peer-dep-cycle-c + @isaacs/peer-dep-cycle-c@"2.x" from the root project + +Could not add conflicting dependency: @isaacs/peer-dep-cycle-b@1.0.0 +node_modules/@isaacs/peer-dep-cycle-b + peer @isaacs/peer-dep-cycle-b@"1" from @isaacs/peer-dep-cycle-a@1.0.0 + node_modules/@isaacs/peer-dep-cycle-a + @isaacs/peer-dep-cycle-a@"1.x" from the root project + +Conflicting peer dependency: @isaacs/peer-dep-cycle-c@1.0.0 +node_modules/@isaacs/peer-dep-cycle-c + peer @isaacs/peer-dep-cycle-c@"1" from @isaacs/peer-dep-cycle-b@1.0.0 + node_modules/@isaacs/peer-dep-cycle-b + peer @isaacs/peer-dep-cycle-b@"1" from @isaacs/peer-dep-cycle-a@1.0.0 + node_modules/@isaacs/peer-dep-cycle-a + @isaacs/peer-dep-cycle-a@"1.x" from the root project +` + +exports[`test/lib/utils/explain-eresolve.js TAP cycleNested > report 1`] = ` +# npm resolution error report + +\${TIME} + +While resolving: @isaacs/peer-dep-cycle-a@1.0.0 +Found: @isaacs/peer-dep-cycle-c@2.0.0 +node_modules/@isaacs/peer-dep-cycle-c + @isaacs/peer-dep-cycle-c@"2.x" from the root project + +Could not add conflicting dependency: @isaacs/peer-dep-cycle-b@1.0.0 +node_modules/@isaacs/peer-dep-cycle-b + peer @isaacs/peer-dep-cycle-b@"1" from @isaacs/peer-dep-cycle-a@1.0.0 + node_modules/@isaacs/peer-dep-cycle-a + @isaacs/peer-dep-cycle-a@"1.x" from the root project + +Conflicting peer dependency: @isaacs/peer-dep-cycle-c@1.0.0 +node_modules/@isaacs/peer-dep-cycle-c + peer @isaacs/peer-dep-cycle-c@"1" from @isaacs/peer-dep-cycle-b@1.0.0 + node_modules/@isaacs/peer-dep-cycle-b + peer @isaacs/peer-dep-cycle-b@"1" from @isaacs/peer-dep-cycle-a@1.0.0 + node_modules/@isaacs/peer-dep-cycle-a + @isaacs/peer-dep-cycle-a@"1.x" from the root project + +Fix the upstream dependency conflict, or retry +this command with --legacy-peer-deps +to accept an incorrect (and potentially broken) dependency resolution. + +Raw JSON explanation object: + +{ + "name": "cycleNested", + "json": true +} + +` + +exports[`test/lib/utils/explain-eresolve.js TAP cycleNested > report with color 1`] = ` +While resolving: @isaacs/peer-dep-cycle-a@1.0.0 +Found: @isaacs/peer-dep-cycle-c@2.0.0 +node_modules/@isaacs/peer-dep-cycle-c + @isaacs/peer-dep-cycle-c@"2.x" from the root project + +Could not add conflicting dependency: @isaacs/peer-dep-cycle-b@1.0.0 +node_modules/@isaacs/peer-dep-cycle-b + peer @isaacs/peer-dep-cycle-b@"1" from @isaacs/peer-dep-cycle-a@1.0.0 + node_modules/@isaacs/peer-dep-cycle-a + @isaacs/peer-dep-cycle-a@"1.x" from the root project + +Conflicting peer dependency: @isaacs/peer-dep-cycle-c@1.0.0 +node_modules/@isaacs/peer-dep-cycle-c + peer @isaacs/peer-dep-cycle-c@"1" from @isaacs/peer-dep-cycle-b@1.0.0 + node_modules/@isaacs/peer-dep-cycle-b + peer @isaacs/peer-dep-cycle-b@"1" from @isaacs/peer-dep-cycle-a@1.0.0 + node_modules/@isaacs/peer-dep-cycle-a + @isaacs/peer-dep-cycle-a@"1.x" from the root project + +Fix the upstream dependency conflict, or retry +this command with --legacy-peer-deps +to accept an incorrect (and potentially broken) dependency resolution. + +See \${REPORT} for a full report. +` + +exports[`test/lib/utils/explain-eresolve.js TAP cycleNested > report with color, depth only 2 1`] = ` +While resolving: @isaacs/peer-dep-cycle-a@1.0.0 +Found: @isaacs/peer-dep-cycle-c@2.0.0 +node_modules/@isaacs/peer-dep-cycle-c + @isaacs/peer-dep-cycle-c@"2.x" from the root project + +Could not add conflicting dependency: @isaacs/peer-dep-cycle-b@1.0.0 +node_modules/@isaacs/peer-dep-cycle-b + peer @isaacs/peer-dep-cycle-b@"1" from @isaacs/peer-dep-cycle-a@1.0.0 + node_modules/@isaacs/peer-dep-cycle-a + @isaacs/peer-dep-cycle-a@"1.x" from the root project + +Conflicting peer dependency: @isaacs/peer-dep-cycle-c@1.0.0 +node_modules/@isaacs/peer-dep-cycle-c + peer @isaacs/peer-dep-cycle-c@"1" from @isaacs/peer-dep-cycle-b@1.0.0 + node_modules/@isaacs/peer-dep-cycle-b + peer @isaacs/peer-dep-cycle-b@"1" from @isaacs/peer-dep-cycle-a@1.0.0 + node_modules/@isaacs/peer-dep-cycle-a + +Fix the upstream dependency conflict, or retry +this command with --legacy-peer-deps +to accept an incorrect (and potentially broken) dependency resolution. + +See \${REPORT} for a full report. +` + +exports[`test/lib/utils/explain-eresolve.js TAP cycleNested > report with no color, depth of 6 1`] = ` +While resolving: @isaacs/peer-dep-cycle-a@1.0.0 +Found: @isaacs/peer-dep-cycle-c@2.0.0 +node_modules/@isaacs/peer-dep-cycle-c + @isaacs/peer-dep-cycle-c@"2.x" from the root project + +Could not add conflicting dependency: @isaacs/peer-dep-cycle-b@1.0.0 +node_modules/@isaacs/peer-dep-cycle-b + peer @isaacs/peer-dep-cycle-b@"1" from @isaacs/peer-dep-cycle-a@1.0.0 + node_modules/@isaacs/peer-dep-cycle-a + @isaacs/peer-dep-cycle-a@"1.x" from the root project + +Conflicting peer dependency: @isaacs/peer-dep-cycle-c@1.0.0 +node_modules/@isaacs/peer-dep-cycle-c + peer @isaacs/peer-dep-cycle-c@"1" from @isaacs/peer-dep-cycle-b@1.0.0 + node_modules/@isaacs/peer-dep-cycle-b + peer @isaacs/peer-dep-cycle-b@"1" from @isaacs/peer-dep-cycle-a@1.0.0 + node_modules/@isaacs/peer-dep-cycle-a + @isaacs/peer-dep-cycle-a@"1.x" from the root project + +Fix the upstream dependency conflict, or retry +this command with --legacy-peer-deps +to accept an incorrect (and potentially broken) dependency resolution. + +See \${REPORT} for a full report. +` + +exports[`test/lib/utils/explain-eresolve.js TAP gatsby > explain with color 1`] = ` +While resolving: gatsby-interface@0.0.166 +Found: react@16.13.1 +node_modules/react + peer react@"^16.4.2" from gatsby@2.24.53 + node_modules/gatsby + gatsby@"" from the root project + 26 more (react-dom, @reach/router, gatsby-cli, gatsby-link, ...) + +Could not add conflicting dependency: react@16.8.1 +node_modules/react + peer react@"16.8.1" from gatsby-interface@0.0.166 + node_modules/gatsby-recipes/node_modules/gatsby-interface + gatsby-interface@"^0.0.166" from gatsby-recipes@0.2.20 + node_modules/gatsby-recipes +` + +exports[`test/lib/utils/explain-eresolve.js TAP gatsby > explain with no color, depth of 6 1`] = ` +While resolving: gatsby-interface@0.0.166 +Found: react@16.13.1 +node_modules/react + peer react@"^16.4.2" from gatsby@2.24.53 + node_modules/gatsby + gatsby@"" from the root project + peer react@"^16.13.1" from react-dom@16.13.1 + node_modules/react-dom + peer react-dom@"^16.4.2" from gatsby@2.24.53 + node_modules/gatsby + gatsby@"" from the root project + peer react-dom@"15.x || 16.x || 16.4.0-alpha.0911da3" from @reach/router@1.3.4 + node_modules/@reach/router + @reach/router@"^1.3.4" from gatsby@2.24.53 + node_modules/gatsby + gatsby@"" from the root project + peer @reach/router@"^1.3.3" from gatsby-link@2.4.13 + node_modules/gatsby-link + gatsby-link@"^2.4.13" from gatsby@2.24.53 + node_modules/gatsby + gatsby@"" from the root project + 1 more (gatsby-react-router-scroll) + peer react-dom@"^16.4.2" from gatsby-link@2.4.13 + node_modules/gatsby-link + gatsby-link@"^2.4.13" from gatsby@2.24.53 + node_modules/gatsby + gatsby@"" from the root project + 2 more (gatsby-react-router-scroll, react-hot-loader) + peer react@"15.x || 16.x || 16.4.0-alpha.0911da3" from @reach/router@1.3.4 + node_modules/@reach/router + @reach/router@"^1.3.4" from gatsby@2.24.53 + node_modules/gatsby + gatsby@"" from the root project + peer @reach/router@"^1.3.3" from gatsby-link@2.4.13 + node_modules/gatsby-link + gatsby-link@"^2.4.13" from gatsby@2.24.53 + node_modules/gatsby + gatsby@"" from the root project + peer @reach/router@"^1.0.0" from gatsby-react-router-scroll@3.0.12 + node_modules/gatsby-react-router-scroll + gatsby-react-router-scroll@"^3.0.12" from gatsby@2.24.53 + node_modules/gatsby + gatsby@"" from the root project + 24 more (gatsby-cli, gatsby-link, gatsby-react-router-scroll, ...) + +Could not add conflicting dependency: react@16.8.1 +node_modules/react + peer react@"16.8.1" from gatsby-interface@0.0.166 + node_modules/gatsby-recipes/node_modules/gatsby-interface + gatsby-interface@"^0.0.166" from gatsby-recipes@0.2.20 + node_modules/gatsby-recipes + gatsby-recipes@"^0.2.20" from gatsby-cli@2.12.91 + node_modules/gatsby-cli + gatsby-cli@"^2.12.91" from gatsby@2.24.53 + node_modules/gatsby + gatsby@"" from the root project +` + +exports[`test/lib/utils/explain-eresolve.js TAP gatsby > report 1`] = ` +# npm resolution error report + +\${TIME} + +While resolving: gatsby-interface@0.0.166 +Found: react@16.13.1 +node_modules/react + peer react@"^16.4.2" from gatsby@2.24.53 + node_modules/gatsby + gatsby@"" from the root project + peer react@"^16.13.1" from react-dom@16.13.1 + node_modules/react-dom + peer react-dom@"^16.4.2" from gatsby@2.24.53 + node_modules/gatsby + gatsby@"" from the root project + peer react-dom@"15.x || 16.x || 16.4.0-alpha.0911da3" from @reach/router@1.3.4 + node_modules/@reach/router + @reach/router@"^1.3.4" from gatsby@2.24.53 + node_modules/gatsby + gatsby@"" from the root project + peer @reach/router@"^1.3.3" from gatsby-link@2.4.13 + node_modules/gatsby-link + gatsby-link@"^2.4.13" from gatsby@2.24.53 + node_modules/gatsby + gatsby@"" from the root project + peer @reach/router@"^1.0.0" from gatsby-react-router-scroll@3.0.12 + node_modules/gatsby-react-router-scroll + gatsby-react-router-scroll@"^3.0.12" from gatsby@2.24.53 + node_modules/gatsby + gatsby@"" from the root project + peer react-dom@"^16.4.2" from gatsby-link@2.4.13 + node_modules/gatsby-link + gatsby-link@"^2.4.13" from gatsby@2.24.53 + node_modules/gatsby + gatsby@"" from the root project + peer react-dom@"^16.4.2" from gatsby-react-router-scroll@3.0.12 + node_modules/gatsby-react-router-scroll + gatsby-react-router-scroll@"^3.0.12" from gatsby@2.24.53 + node_modules/gatsby + gatsby@"" from the root project + peer react-dom@"^15.0.0 || ^16.0.0" from react-hot-loader@4.12.21 + node_modules/react-hot-loader + react-hot-loader@"^4.12.21" from gatsby@2.24.53 + node_modules/gatsby + gatsby@"" from the root project + peer react@"15.x || 16.x || 16.4.0-alpha.0911da3" from @reach/router@1.3.4 + node_modules/@reach/router + @reach/router@"^1.3.4" from gatsby@2.24.53 + node_modules/gatsby + gatsby@"" from the root project + peer @reach/router@"^1.3.3" from gatsby-link@2.4.13 + node_modules/gatsby-link + gatsby-link@"^2.4.13" from gatsby@2.24.53 + node_modules/gatsby + gatsby@"" from the root project + peer @reach/router@"^1.0.0" from gatsby-react-router-scroll@3.0.12 + node_modules/gatsby-react-router-scroll + gatsby-react-router-scroll@"^3.0.12" from gatsby@2.24.53 + node_modules/gatsby + gatsby@"" from the root project + react@"^16.8.0" from gatsby-cli@2.12.91 + node_modules/gatsby-cli + gatsby-cli@"^2.12.91" from gatsby@2.24.53 + node_modules/gatsby + gatsby@"" from the root project + peer react@"^16.4.2" from gatsby-link@2.4.13 + node_modules/gatsby-link + gatsby-link@"^2.4.13" from gatsby@2.24.53 + node_modules/gatsby + gatsby@"" from the root project + peer react@"^16.4.2" from gatsby-react-router-scroll@3.0.12 + node_modules/gatsby-react-router-scroll + gatsby-react-router-scroll@"^3.0.12" from gatsby@2.24.53 + node_modules/gatsby + gatsby@"" from the root project + peer react@"^15.0.0 || ^16.0.0" from react-hot-loader@4.12.21 + node_modules/react-hot-loader + react-hot-loader@"^4.12.21" from gatsby@2.24.53 + node_modules/gatsby + gatsby@"" from the root project + peer react@"^0.14.0 || ^15.0.0 || ^16.0.0" from create-react-context@0.3.0 + node_modules/create-react-context + create-react-context@"0.3.0" from @reach/router@1.3.4 + node_modules/@reach/router + @reach/router@"^1.3.4" from gatsby@2.24.53 + node_modules/gatsby + gatsby@"" from the root project + peer @reach/router@"^1.3.3" from gatsby-link@2.4.13 + node_modules/gatsby-link + gatsby-link@"^2.4.13" from gatsby@2.24.53 + node_modules/gatsby + gatsby@"" from the root project + peer @reach/router@"^1.0.0" from gatsby-react-router-scroll@3.0.12 + node_modules/gatsby-react-router-scroll + gatsby-react-router-scroll@"^3.0.12" from gatsby@2.24.53 + node_modules/gatsby + gatsby@"" from the root project + peer react@"^16.12.0" from gatsby-recipes@0.2.20 + node_modules/gatsby-recipes + gatsby-recipes@"^0.2.20" from gatsby-cli@2.12.91 + node_modules/gatsby-cli + gatsby-cli@"^2.12.91" from gatsby@2.24.53 + node_modules/gatsby + gatsby@"" from the root project + peer react@">=16.8.0" from ink@2.7.1 + node_modules/ink + ink@"^2.7.1" from gatsby-cli@2.12.91 + node_modules/gatsby-cli + gatsby-cli@"^2.12.91" from gatsby@2.24.53 + node_modules/gatsby + gatsby@"" from the root project + peer ink@"^2.0.0" from ink-spinner@3.1.0 + node_modules/ink-spinner + ink-spinner@"^3.1.0" from gatsby-cli@2.12.91 + node_modules/gatsby-cli + gatsby-cli@"^2.12.91" from gatsby@2.24.53 + node_modules/gatsby + gatsby@"" from the root project + peer ink@">=2.0.0" from ink-box@1.0.0 + node_modules/ink-box + ink-box@"^1.0.0" from gatsby-recipes@0.2.20 + node_modules/gatsby-recipes + gatsby-recipes@"^0.2.20" from gatsby-cli@2.12.91 + node_modules/gatsby-cli + gatsby-cli@"^2.12.91" from gatsby@2.24.53 + node_modules/gatsby + gatsby@"" from the root project + peer react@"^16.8.2" from ink-spinner@3.1.0 + node_modules/ink-spinner + ink-spinner@"^3.1.0" from gatsby-cli@2.12.91 + node_modules/gatsby-cli + gatsby-cli@"^2.12.91" from gatsby@2.24.53 + node_modules/gatsby + gatsby@"" from the root project + peer react@">=16.3.0" from @emotion/core@10.0.35 + node_modules/@emotion/core + @emotion/core@"^10.0.14" from gatsby-recipes@0.2.20 + node_modules/gatsby-recipes + gatsby-recipes@"^0.2.20" from gatsby-cli@2.12.91 + node_modules/gatsby-cli + gatsby-cli@"^2.12.91" from gatsby@2.24.53 + node_modules/gatsby + gatsby@"" from the root project + peer @emotion/core@"^10.0.27" from @emotion/styled@10.0.27 + node_modules/@emotion/styled + @emotion/styled@"^10.0.14" from gatsby-recipes@0.2.20 + node_modules/gatsby-recipes + gatsby-recipes@"^0.2.20" from gatsby-cli@2.12.91 + node_modules/gatsby-cli + gatsby-cli@"^2.12.91" from gatsby@2.24.53 + node_modules/gatsby + gatsby@"" from the root project + peer @emotion/styled@"^10.0.14" from gatsby-interface@0.0.166 + node_modules/gatsby-recipes/node_modules/gatsby-interface + gatsby-interface@"^0.0.166" from gatsby-recipes@0.2.20 + node_modules/gatsby-recipes + gatsby-recipes@"^0.2.20" from gatsby-cli@2.12.91 + node_modules/gatsby-cli + gatsby-cli@"^2.12.91" from gatsby@2.24.53 + node_modules/gatsby + gatsby@"" from the root project + peer @emotion/core@"^10.0.14" from gatsby-interface@0.0.166 + node_modules/gatsby-recipes/node_modules/gatsby-interface + gatsby-interface@"^0.0.166" from gatsby-recipes@0.2.20 + node_modules/gatsby-recipes + gatsby-recipes@"^0.2.20" from gatsby-cli@2.12.91 + node_modules/gatsby-cli + gatsby-cli@"^2.12.91" from gatsby@2.24.53 + node_modules/gatsby + gatsby@"" from the root project + peer @emotion/core@"^10.0.28" from @emotion/styled-base@10.0.31 + node_modules/@emotion/styled-base + @emotion/styled-base@"^10.0.27" from @emotion/styled@10.0.27 + node_modules/@emotion/styled + @emotion/styled@"^10.0.14" from gatsby-recipes@0.2.20 + node_modules/gatsby-recipes + gatsby-recipes@"^0.2.20" from gatsby-cli@2.12.91 + node_modules/gatsby-cli + gatsby-cli@"^2.12.91" from gatsby@2.24.53 + node_modules/gatsby + gatsby@"" from the root project + peer @emotion/styled@"^10.0.14" from gatsby-interface@0.0.166 + node_modules/gatsby-recipes/node_modules/gatsby-interface + gatsby-interface@"^0.0.166" from gatsby-recipes@0.2.20 + node_modules/gatsby-recipes + gatsby-recipes@"^0.2.20" from gatsby-cli@2.12.91 + node_modules/gatsby-cli + gatsby-cli@"^2.12.91" from gatsby@2.24.53 + node_modules/gatsby + gatsby@"" from the root project + peer react@">=16.3.0" from @emotion/styled@10.0.27 + node_modules/@emotion/styled + @emotion/styled@"^10.0.14" from gatsby-recipes@0.2.20 + node_modules/gatsby-recipes + gatsby-recipes@"^0.2.20" from gatsby-cli@2.12.91 + node_modules/gatsby-cli + gatsby-cli@"^2.12.91" from gatsby@2.24.53 + node_modules/gatsby + gatsby@"" from the root project + peer @emotion/styled@"^10.0.14" from gatsby-interface@0.0.166 + node_modules/gatsby-recipes/node_modules/gatsby-interface + gatsby-interface@"^0.0.166" from gatsby-recipes@0.2.20 + node_modules/gatsby-recipes + gatsby-recipes@"^0.2.20" from gatsby-cli@2.12.91 + node_modules/gatsby-cli + gatsby-cli@"^2.12.91" from gatsby@2.24.53 + node_modules/gatsby + gatsby@"" from the root project + peer react@"^16.13.1" from @mdx-js/react@2.0.0-next.7 + node_modules/@mdx-js/react + @mdx-js/react@"^2.0.0-next.4" from gatsby-recipes@0.2.20 + node_modules/gatsby-recipes + gatsby-recipes@"^0.2.20" from gatsby-cli@2.12.91 + node_modules/gatsby-cli + gatsby-cli@"^2.12.91" from gatsby@2.24.53 + node_modules/gatsby + gatsby@"" from the root project + @mdx-js/react@"^2.0.0-next.7" from @mdx-js/runtime@2.0.0-next.7 + node_modules/@mdx-js/runtime + @mdx-js/runtime@"^2.0.0-next.4" from gatsby-recipes@0.2.20 + node_modules/gatsby-recipes + gatsby-recipes@"^0.2.20" from gatsby-cli@2.12.91 + node_modules/gatsby-cli + gatsby-cli@"^2.12.91" from gatsby@2.24.53 + node_modules/gatsby + gatsby@"" from the root project + peer react@"^16.13.1" from @mdx-js/runtime@2.0.0-next.7 + node_modules/@mdx-js/runtime + @mdx-js/runtime@"^2.0.0-next.4" from gatsby-recipes@0.2.20 + node_modules/gatsby-recipes + gatsby-recipes@"^0.2.20" from gatsby-cli@2.12.91 + node_modules/gatsby-cli + gatsby-cli@"^2.12.91" from gatsby@2.24.53 + node_modules/gatsby + gatsby@"" from the root project + peer react@">=16.8.0" from formik@2.1.5 + node_modules/formik + formik@"^2.0.8" from gatsby-recipes@0.2.20 + node_modules/gatsby-recipes + gatsby-recipes@"^0.2.20" from gatsby-cli@2.12.91 + node_modules/gatsby-cli + gatsby-cli@"^2.12.91" from gatsby@2.24.53 + node_modules/gatsby + gatsby@"" from the root project + peer formik@"^2.0.8" from gatsby-interface@0.0.166 + node_modules/gatsby-recipes/node_modules/gatsby-interface + gatsby-interface@"^0.0.166" from gatsby-recipes@0.2.20 + node_modules/gatsby-recipes + gatsby-recipes@"^0.2.20" from gatsby-cli@2.12.91 + node_modules/gatsby-cli + gatsby-cli@"^2.12.91" from gatsby@2.24.53 + node_modules/gatsby + gatsby@"" from the root project + peer react@"^16.4.2" from gatsby@2.6.0 + node_modules/gatsby-recipes/node_modules/gatsby + peer gatsby@"2.6.0" from gatsby-interface@0.0.166 + node_modules/gatsby-recipes/node_modules/gatsby-interface + gatsby-interface@"^0.0.166" from gatsby-recipes@0.2.20 + node_modules/gatsby-recipes + gatsby-recipes@"^0.2.20" from gatsby-cli@2.12.91 + node_modules/gatsby-cli + gatsby-cli@"^2.12.91" from gatsby@2.24.53 + node_modules/gatsby + gatsby@"" from the root project + peer react@"^16.0.0" from react-dom@16.8.1 + node_modules/gatsby-recipes/node_modules/react-dom + peer react-dom@"16.8.1" from gatsby-interface@0.0.166 + node_modules/gatsby-recipes/node_modules/gatsby-interface + gatsby-interface@"^0.0.166" from gatsby-recipes@0.2.20 + node_modules/gatsby-recipes + gatsby-recipes@"^0.2.20" from gatsby-cli@2.12.91 + node_modules/gatsby-cli + gatsby-cli@"^2.12.91" from gatsby@2.24.53 + node_modules/gatsby + gatsby@"" from the root project + peer react-dom@"^16.4.2" from gatsby@2.6.0 + node_modules/gatsby-recipes/node_modules/gatsby + peer gatsby@"2.6.0" from gatsby-interface@0.0.166 + node_modules/gatsby-recipes/node_modules/gatsby-interface + gatsby-interface@"^0.0.166" from gatsby-recipes@0.2.20 + node_modules/gatsby-recipes + gatsby-recipes@"^0.2.20" from gatsby-cli@2.12.91 + node_modules/gatsby-cli + gatsby-cli@"^2.12.91" from gatsby@2.24.53 + node_modules/gatsby + gatsby@"" from the root project + peer react-dom@"^0.14.0 || ^15.0.0 || ^16.0.0" from gatsby-react-router-scroll@2.3.1 + node_modules/gatsby-recipes/node_modules/gatsby-react-router-scroll + gatsby-react-router-scroll@"^2.0.7" from gatsby@2.6.0 + node_modules/gatsby-recipes/node_modules/gatsby + peer gatsby@"2.6.0" from gatsby-interface@0.0.166 + node_modules/gatsby-recipes/node_modules/gatsby-interface + gatsby-interface@"^0.0.166" from gatsby-recipes@0.2.20 + node_modules/gatsby-recipes + gatsby-recipes@"^0.2.20" from gatsby-cli@2.12.91 + node_modules/gatsby-cli + gatsby-cli@"^2.12.91" from gatsby@2.24.53 + node_modules/gatsby + gatsby@"" from the root project + peer react@"*" from react-icons@3.11.0 + node_modules/react-icons + react-icons@"^3.0.1" from gatsby-recipes@0.2.20 + node_modules/gatsby-recipes + gatsby-recipes@"^0.2.20" from gatsby-cli@2.12.91 + node_modules/gatsby-cli + gatsby-cli@"^2.12.91" from gatsby@2.24.53 + node_modules/gatsby + gatsby@"" from the root project + peer react-icons@"^3.2.1" from gatsby-interface@0.0.166 + node_modules/gatsby-recipes/node_modules/gatsby-interface + gatsby-interface@"^0.0.166" from gatsby-recipes@0.2.20 + node_modules/gatsby-recipes + gatsby-recipes@"^0.2.20" from gatsby-cli@2.12.91 + node_modules/gatsby-cli + gatsby-cli@"^2.12.91" from gatsby@2.24.53 + node_modules/gatsby + gatsby@"" from the root project + peer react@">=16.8.0" from ink-box@1.0.0 + node_modules/ink-box + ink-box@"^1.0.0" from gatsby-recipes@0.2.20 + node_modules/gatsby-recipes + gatsby-recipes@"^0.2.20" from gatsby-cli@2.12.91 + node_modules/gatsby-cli + gatsby-cli@"^2.12.91" from gatsby@2.24.53 + node_modules/gatsby + gatsby@"" from the root project + peer react@"^0.14.0 || ^15.0.0 || ^16.0.0" from react-circular-progressbar@2.0.3 + node_modules/react-circular-progressbar + react-circular-progressbar@"^2.0.0" from gatsby-recipes@0.2.20 + node_modules/gatsby-recipes + gatsby-recipes@"^0.2.20" from gatsby-cli@2.12.91 + node_modules/gatsby-cli + gatsby-cli@"^2.12.91" from gatsby@2.24.53 + node_modules/gatsby + gatsby@"" from the root project + peer react@"^16.13.1" from react-reconciler@0.25.1 + node_modules/react-reconciler + react-reconciler@"^0.25.1" from gatsby-recipes@0.2.20 + node_modules/gatsby-recipes + gatsby-recipes@"^0.2.20" from gatsby-cli@2.12.91 + node_modules/gatsby-cli + gatsby-cli@"^2.12.91" from gatsby@2.24.53 + node_modules/gatsby + gatsby@"" from the root project + peer react@">= 16.8.0" from urql@1.10.0 + node_modules/urql + urql@"^1.9.7" from gatsby-recipes@0.2.20 + node_modules/gatsby-recipes + gatsby-recipes@"^0.2.20" from gatsby-cli@2.12.91 + node_modules/gatsby-cli + gatsby-cli@"^2.12.91" from gatsby@2.24.53 + node_modules/gatsby + gatsby@"" from the root project + peer react@">=16.3.0" from @emotion/styled-base@10.0.31 + node_modules/@emotion/styled-base + @emotion/styled-base@"^10.0.27" from @emotion/styled@10.0.27 + node_modules/@emotion/styled + @emotion/styled@"^10.0.14" from gatsby-recipes@0.2.20 + node_modules/gatsby-recipes + gatsby-recipes@"^0.2.20" from gatsby-cli@2.12.91 + node_modules/gatsby-cli + gatsby-cli@"^2.12.91" from gatsby@2.24.53 + node_modules/gatsby + gatsby@"" from the root project + peer @emotion/styled@"^10.0.14" from gatsby-interface@0.0.166 + node_modules/gatsby-recipes/node_modules/gatsby-interface + gatsby-interface@"^0.0.166" from gatsby-recipes@0.2.20 + node_modules/gatsby-recipes + gatsby-recipes@"^0.2.20" from gatsby-cli@2.12.91 + node_modules/gatsby-cli + gatsby-cli@"^2.12.91" from gatsby@2.24.53 + node_modules/gatsby + gatsby@"" from the root project + peer react@"^16.0.0" from react-reconciler@0.24.0 + node_modules/ink/node_modules/react-reconciler + react-reconciler@"^0.24.0" from ink@2.7.1 + node_modules/ink + ink@"^2.7.1" from gatsby-cli@2.12.91 + node_modules/gatsby-cli + gatsby-cli@"^2.12.91" from gatsby@2.24.53 + node_modules/gatsby + gatsby@"" from the root project + peer ink@"^2.0.0" from ink-spinner@3.1.0 + node_modules/ink-spinner + ink-spinner@"^3.1.0" from gatsby-cli@2.12.91 + node_modules/gatsby-cli + gatsby-cli@"^2.12.91" from gatsby@2.24.53 + node_modules/gatsby + gatsby@"" from the root project + peer ink@">=2.0.0" from ink-box@1.0.0 + node_modules/ink-box + ink-box@"^1.0.0" from gatsby-recipes@0.2.20 + node_modules/gatsby-recipes + gatsby-recipes@"^0.2.20" from gatsby-cli@2.12.91 + node_modules/gatsby-cli + gatsby-cli@"^2.12.91" from gatsby@2.24.53 + node_modules/gatsby + gatsby@"" from the root project + peer react@"^0.14.0 || ^15.0.0 || ^16.0.0" from gatsby-react-router-scroll@2.3.1 + node_modules/gatsby-recipes/node_modules/gatsby-react-router-scroll + gatsby-react-router-scroll@"^2.0.7" from gatsby@2.6.0 + node_modules/gatsby-recipes/node_modules/gatsby + peer gatsby@"2.6.0" from gatsby-interface@0.0.166 + node_modules/gatsby-recipes/node_modules/gatsby-interface + gatsby-interface@"^0.0.166" from gatsby-recipes@0.2.20 + node_modules/gatsby-recipes + gatsby-recipes@"^0.2.20" from gatsby-cli@2.12.91 + node_modules/gatsby-cli + gatsby-cli@"^2.12.91" from gatsby@2.24.53 + node_modules/gatsby + gatsby@"" from the root project + peer react@"^16.13.1" from @mdx-js/react@1.6.16 + node_modules/gatsby-recipes/node_modules/gatsby-interface/node_modules/@mdx-js/react + @mdx-js/react@"^1.5.2" from gatsby-interface@0.0.166 + node_modules/gatsby-recipes/node_modules/gatsby-interface + gatsby-interface@"^0.0.166" from gatsby-recipes@0.2.20 + node_modules/gatsby-recipes + gatsby-recipes@"^0.2.20" from gatsby-cli@2.12.91 + node_modules/gatsby-cli + gatsby-cli@"^2.12.91" from gatsby@2.24.53 + node_modules/gatsby + gatsby@"" from the root project + +Could not add conflicting dependency: react@16.8.1 +node_modules/react + peer react@"16.8.1" from gatsby-interface@0.0.166 + node_modules/gatsby-recipes/node_modules/gatsby-interface + gatsby-interface@"^0.0.166" from gatsby-recipes@0.2.20 + node_modules/gatsby-recipes + gatsby-recipes@"^0.2.20" from gatsby-cli@2.12.91 + node_modules/gatsby-cli + gatsby-cli@"^2.12.91" from gatsby@2.24.53 + node_modules/gatsby + gatsby@"" from the root project + +Fix the upstream dependency conflict, or retry +this command with --legacy-peer-deps or --force +to accept an incorrect (and potentially broken) dependency resolution. + +Raw JSON explanation object: + +{ + "name": "gatsby", + "json": true +} + +` + +exports[`test/lib/utils/explain-eresolve.js TAP gatsby > report with color 1`] = ` +While resolving: gatsby-interface@0.0.166 +Found: react@16.13.1 +node_modules/react + peer react@"^16.4.2" from gatsby@2.24.53 + node_modules/gatsby + gatsby@"" from the root project + peer react@"^16.13.1" from react-dom@16.13.1 + node_modules/react-dom + peer react-dom@"^16.4.2" from gatsby@2.24.53 + node_modules/gatsby + gatsby@"" from the root project + peer react-dom@"15.x || 16.x || 16.4.0-alpha.0911da3" from @reach/router@1.3.4 + node_modules/@reach/router + @reach/router@"^1.3.4" from gatsby@2.24.53 + node_modules/gatsby + gatsby@"" from the root project + 2 more (gatsby-link, gatsby-react-router-scroll) + 3 more (gatsby-link, gatsby-react-router-scroll, react-hot-loader) + 25 more (@reach/router, gatsby-cli, gatsby-link, ...) + +Could not add conflicting dependency: react@16.8.1 +node_modules/react + peer react@"16.8.1" from gatsby-interface@0.0.166 + node_modules/gatsby-recipes/node_modules/gatsby-interface + gatsby-interface@"^0.0.166" from gatsby-recipes@0.2.20 + node_modules/gatsby-recipes + gatsby-recipes@"^0.2.20" from gatsby-cli@2.12.91 + node_modules/gatsby-cli + gatsby-cli@"^2.12.91" from gatsby@2.24.53 + node_modules/gatsby + +Fix the upstream dependency conflict, or retry +this command with --legacy-peer-deps or --force +to accept an incorrect (and potentially broken) dependency resolution. + +See \${REPORT} for a full report. +` + +exports[`test/lib/utils/explain-eresolve.js TAP gatsby > report with color, depth only 2 1`] = ` +While resolving: gatsby-interface@0.0.166 +Found: react@16.13.1 +node_modules/react + peer react@"^16.4.2" from gatsby@2.24.53 + node_modules/gatsby + gatsby@"" from the root project + 26 more (react-dom, @reach/router, gatsby-cli, gatsby-link, ...) + +Could not add conflicting dependency: react@16.8.1 +node_modules/react + peer react@"16.8.1" from gatsby-interface@0.0.166 + node_modules/gatsby-recipes/node_modules/gatsby-interface + gatsby-interface@"^0.0.166" from gatsby-recipes@0.2.20 + node_modules/gatsby-recipes + +Fix the upstream dependency conflict, or retry +this command with --legacy-peer-deps or --force +to accept an incorrect (and potentially broken) dependency resolution. + +See \${REPORT} for a full report. +` + +exports[`test/lib/utils/explain-eresolve.js TAP gatsby > report with no color, depth of 6 1`] = ` +While resolving: gatsby-interface@0.0.166 +Found: react@16.13.1 +node_modules/react + peer react@"^16.4.2" from gatsby@2.24.53 + node_modules/gatsby + gatsby@"" from the root project + peer react@"^16.13.1" from react-dom@16.13.1 + node_modules/react-dom + peer react-dom@"^16.4.2" from gatsby@2.24.53 + node_modules/gatsby + gatsby@"" from the root project + peer react-dom@"15.x || 16.x || 16.4.0-alpha.0911da3" from @reach/router@1.3.4 + node_modules/@reach/router + @reach/router@"^1.3.4" from gatsby@2.24.53 + node_modules/gatsby + gatsby@"" from the root project + peer @reach/router@"^1.3.3" from gatsby-link@2.4.13 + node_modules/gatsby-link + gatsby-link@"^2.4.13" from gatsby@2.24.53 + node_modules/gatsby + gatsby@"" from the root project + 1 more (gatsby-react-router-scroll) + peer react-dom@"^16.4.2" from gatsby-link@2.4.13 + node_modules/gatsby-link + gatsby-link@"^2.4.13" from gatsby@2.24.53 + node_modules/gatsby + gatsby@"" from the root project + 2 more (gatsby-react-router-scroll, react-hot-loader) + peer react@"15.x || 16.x || 16.4.0-alpha.0911da3" from @reach/router@1.3.4 + node_modules/@reach/router + @reach/router@"^1.3.4" from gatsby@2.24.53 + node_modules/gatsby + gatsby@"" from the root project + peer @reach/router@"^1.3.3" from gatsby-link@2.4.13 + node_modules/gatsby-link + gatsby-link@"^2.4.13" from gatsby@2.24.53 + node_modules/gatsby + gatsby@"" from the root project + peer @reach/router@"^1.0.0" from gatsby-react-router-scroll@3.0.12 + node_modules/gatsby-react-router-scroll + gatsby-react-router-scroll@"^3.0.12" from gatsby@2.24.53 + node_modules/gatsby + gatsby@"" from the root project + 24 more (gatsby-cli, gatsby-link, gatsby-react-router-scroll, ...) + +Could not add conflicting dependency: react@16.8.1 +node_modules/react + peer react@"16.8.1" from gatsby-interface@0.0.166 + node_modules/gatsby-recipes/node_modules/gatsby-interface + gatsby-interface@"^0.0.166" from gatsby-recipes@0.2.20 + node_modules/gatsby-recipes + gatsby-recipes@"^0.2.20" from gatsby-cli@2.12.91 + node_modules/gatsby-cli + gatsby-cli@"^2.12.91" from gatsby@2.24.53 + node_modules/gatsby + gatsby@"" from the root project + +Fix the upstream dependency conflict, or retry +this command with --legacy-peer-deps or --force +to accept an incorrect (and potentially broken) dependency resolution. + +See \${REPORT} for a full report. +` + +exports[`test/lib/utils/explain-eresolve.js TAP withShrinkwrap > explain with color 1`] = ` +While resolving: @isaacs/peer-dep-cycle-b@1.0.0 +Found: @isaacs/peer-dep-cycle-c@2.0.0 +node_modules/@isaacs/peer-dep-cycle-c + @isaacs/peer-dep-cycle-c@"2.x" from the root project + +Could not add conflicting dependency: @isaacs/peer-dep-cycle-c@1.0.0 +node_modules/@isaacs/peer-dep-cycle-c + peer @isaacs/peer-dep-cycle-c@"1" from @isaacs/peer-dep-cycle-b@1.0.0 + node_modules/@isaacs/peer-dep-cycle-b + peer @isaacs/peer-dep-cycle-b@"1" from @isaacs/peer-dep-cycle-a@1.0.0 + node_modules/@isaacs/peer-dep-cycle-a +` + +exports[`test/lib/utils/explain-eresolve.js TAP withShrinkwrap > explain with no color, depth of 6 1`] = ` +While resolving: @isaacs/peer-dep-cycle-b@1.0.0 +Found: @isaacs/peer-dep-cycle-c@2.0.0 +node_modules/@isaacs/peer-dep-cycle-c + @isaacs/peer-dep-cycle-c@"2.x" from the root project + +Could not add conflicting dependency: @isaacs/peer-dep-cycle-c@1.0.0 +node_modules/@isaacs/peer-dep-cycle-c + peer @isaacs/peer-dep-cycle-c@"1" from @isaacs/peer-dep-cycle-b@1.0.0 + node_modules/@isaacs/peer-dep-cycle-b + peer @isaacs/peer-dep-cycle-b@"1" from @isaacs/peer-dep-cycle-a@1.0.0 + node_modules/@isaacs/peer-dep-cycle-a + @isaacs/peer-dep-cycle-a@"1.x" from the root project +` + +exports[`test/lib/utils/explain-eresolve.js TAP withShrinkwrap > report 1`] = ` +# npm resolution error report + +\${TIME} + +While resolving: @isaacs/peer-dep-cycle-b@1.0.0 +Found: @isaacs/peer-dep-cycle-c@2.0.0 +node_modules/@isaacs/peer-dep-cycle-c + @isaacs/peer-dep-cycle-c@"2.x" from the root project + +Could not add conflicting dependency: @isaacs/peer-dep-cycle-c@1.0.0 +node_modules/@isaacs/peer-dep-cycle-c + peer @isaacs/peer-dep-cycle-c@"1" from @isaacs/peer-dep-cycle-b@1.0.0 + node_modules/@isaacs/peer-dep-cycle-b + peer @isaacs/peer-dep-cycle-b@"1" from @isaacs/peer-dep-cycle-a@1.0.0 + node_modules/@isaacs/peer-dep-cycle-a + @isaacs/peer-dep-cycle-a@"1.x" from the root project + +Fix the upstream dependency conflict, or retry +this command with --legacy-peer-deps or --force +to accept an incorrect (and potentially broken) dependency resolution. + +Raw JSON explanation object: + +{ + "name": "withShrinkwrap", + "json": true +} + +` + +exports[`test/lib/utils/explain-eresolve.js TAP withShrinkwrap > report with color 1`] = ` +While resolving: @isaacs/peer-dep-cycle-b@1.0.0 +Found: @isaacs/peer-dep-cycle-c@2.0.0 +node_modules/@isaacs/peer-dep-cycle-c + @isaacs/peer-dep-cycle-c@"2.x" from the root project + +Could not add conflicting dependency: @isaacs/peer-dep-cycle-c@1.0.0 +node_modules/@isaacs/peer-dep-cycle-c + peer @isaacs/peer-dep-cycle-c@"1" from @isaacs/peer-dep-cycle-b@1.0.0 + node_modules/@isaacs/peer-dep-cycle-b + peer @isaacs/peer-dep-cycle-b@"1" from @isaacs/peer-dep-cycle-a@1.0.0 + node_modules/@isaacs/peer-dep-cycle-a + @isaacs/peer-dep-cycle-a@"1.x" from the root project + +Fix the upstream dependency conflict, or retry +this command with --legacy-peer-deps or --force +to accept an incorrect (and potentially broken) dependency resolution. + +See \${REPORT} for a full report. +` + +exports[`test/lib/utils/explain-eresolve.js TAP withShrinkwrap > report with color, depth only 2 1`] = ` +While resolving: @isaacs/peer-dep-cycle-b@1.0.0 +Found: @isaacs/peer-dep-cycle-c@2.0.0 +node_modules/@isaacs/peer-dep-cycle-c + @isaacs/peer-dep-cycle-c@"2.x" from the root project + +Could not add conflicting dependency: @isaacs/peer-dep-cycle-c@1.0.0 +node_modules/@isaacs/peer-dep-cycle-c + peer @isaacs/peer-dep-cycle-c@"1" from @isaacs/peer-dep-cycle-b@1.0.0 + node_modules/@isaacs/peer-dep-cycle-b + peer @isaacs/peer-dep-cycle-b@"1" from @isaacs/peer-dep-cycle-a@1.0.0 + node_modules/@isaacs/peer-dep-cycle-a + +Fix the upstream dependency conflict, or retry +this command with --legacy-peer-deps or --force +to accept an incorrect (and potentially broken) dependency resolution. + +See \${REPORT} for a full report. +` + +exports[`test/lib/utils/explain-eresolve.js TAP withShrinkwrap > report with no color, depth of 6 1`] = ` +While resolving: @isaacs/peer-dep-cycle-b@1.0.0 +Found: @isaacs/peer-dep-cycle-c@2.0.0 +node_modules/@isaacs/peer-dep-cycle-c + @isaacs/peer-dep-cycle-c@"2.x" from the root project + +Could not add conflicting dependency: @isaacs/peer-dep-cycle-c@1.0.0 +node_modules/@isaacs/peer-dep-cycle-c + peer @isaacs/peer-dep-cycle-c@"1" from @isaacs/peer-dep-cycle-b@1.0.0 + node_modules/@isaacs/peer-dep-cycle-b + peer @isaacs/peer-dep-cycle-b@"1" from @isaacs/peer-dep-cycle-a@1.0.0 + node_modules/@isaacs/peer-dep-cycle-a + @isaacs/peer-dep-cycle-a@"1.x" from the root project + +Fix the upstream dependency conflict, or retry +this command with --legacy-peer-deps or --force +to accept an incorrect (and potentially broken) dependency resolution. + +See \${REPORT} for a full report. +` 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 new file mode 100644 index 00000000000000..cd41d33cbb26c4 --- /dev/null +++ b/deps/npm/tap-snapshots/test-lib-utils-flat-options.js-TAP.test.js @@ -0,0 +1,129 @@ +/* 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 { + "@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", + "cacheLockRetries": "cache-lock-retries", + "cacheLockStale": "cache-lock-stale", + "cacheLockWait": "cache-lock-wait", + "cacheMax": "cache-max", + "cacheMin": "cache-min", + "cafile": "cafile", + "call": "call", + "cert": "cert", + "cidr": "cidr", + "color": true, + "commitHooks": "commit-hooks", + "defaultTag": "tag", + "depth": "depth", + "dmode": 511, + "dryRun": "dry-run", + "editor": "editor", + "engineStrict": "engine-strict", + "fmode": 438, + "force": "force", + "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", + "lockFile": Object { + "retries": "cache-lock-retries", + "stale": "cache-lock-stale", + "wait": "cache-lock-wait", + }, + "log": Object {}, + "long": undefined, + "message": "message", + "metricsRegistry": "metrics-registry", + "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": "package-lock", + "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": "searchopts", + "staleness": "searchstaleness", + }, + "sendMetrics": "send-metrics", + "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-reify-output.js-TAP.test.js b/deps/npm/tap-snapshots/test-lib-utils-reify-output.js-TAP.test.js new file mode 100644 index 00000000000000..755b2364253047 --- /dev/null +++ b/deps/npm/tap-snapshots/test-lib-utils-reify-output.js-TAP.test.js @@ -0,0 +1,1634 @@ +/* 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/reify-output.js TAP added packages should be looked up within returned tree has added pkg in inventory > must match snapshot 1`] = ` + +added 1 package in {TIME} +` + +exports[`test/lib/utils/reify-output.js TAP added packages should be looked up within returned tree missing added pkg in inventory > must match snapshot 1`] = ` + +up to date in {TIME} +` + +exports[`test/lib/utils/reify-output.js TAP packages changed message > {"added":0,"removed":0,"changed":0,"audited":0,"json":false} 1`] = ` + +up to date in {TIME} +` + +exports[`test/lib/utils/reify-output.js TAP packages changed message > {"added":0,"removed":0,"changed":0,"audited":0,"json":true} 1`] = ` +{ + "added": 0, + "removed": 0, + "changed": 0, + "audited": 0, + "funding": 0 +} +` + +exports[`test/lib/utils/reify-output.js TAP packages changed message > {"added":0,"removed":0,"changed":0,"audited":1,"json":false} 1`] = ` + +up to date, audited 1 package in {TIME} + +found 0 vulnerabilities +` + +exports[`test/lib/utils/reify-output.js TAP packages changed message > {"added":0,"removed":0,"changed":0,"audited":1,"json":true} 1`] = ` +{ + "added": 0, + "removed": 0, + "changed": 0, + "audited": 1, + "funding": 0, + "audit": { + "vulnerabilities": { + "total": 0 + } + } +} +` + +exports[`test/lib/utils/reify-output.js TAP packages changed message > {"added":0,"removed":0,"changed":0,"audited":2,"json":false} 1`] = ` + +up to date, audited 2 packages in {TIME} + +found 0 vulnerabilities +` + +exports[`test/lib/utils/reify-output.js TAP packages changed message > {"added":0,"removed":0,"changed":0,"audited":2,"json":false} 2`] = ` + +up to date, audited 2 packages in {TIME} + +found 0 vulnerabilities +` + +exports[`test/lib/utils/reify-output.js TAP packages changed message > {"added":0,"removed":0,"changed":0,"audited":2,"json":true} 1`] = ` +{ + "added": 0, + "removed": 0, + "changed": 0, + "audited": 2, + "funding": 0, + "audit": { + "vulnerabilities": { + "total": 0 + } + } +} +` + +exports[`test/lib/utils/reify-output.js TAP packages changed message > {"added":0,"removed":0,"changed":0,"audited":2,"json":true} 2`] = ` +{ + "added": 0, + "removed": 0, + "changed": 0, + "audited": 2, + "funding": 0, + "audit": { + "vulnerabilities": {}, + "metadata": { + "vulnerabilities": { + "total": 0 + } + } + } +} +` + +exports[`test/lib/utils/reify-output.js TAP packages changed message > {"added":0,"removed":0,"changed":1,"audited":0,"json":false} 1`] = ` + +changed 1 package in {TIME} +` + +exports[`test/lib/utils/reify-output.js TAP packages changed message > {"added":0,"removed":0,"changed":1,"audited":0,"json":true} 1`] = ` +{ + "added": 0, + "removed": 0, + "changed": 1, + "audited": 0, + "funding": 0 +} +` + +exports[`test/lib/utils/reify-output.js TAP packages changed message > {"added":0,"removed":0,"changed":1,"audited":1,"json":false} 1`] = ` + +changed 1 package, and audited 1 package in {TIME} + +found 0 vulnerabilities +` + +exports[`test/lib/utils/reify-output.js TAP packages changed message > {"added":0,"removed":0,"changed":1,"audited":1,"json":true} 1`] = ` +{ + "added": 0, + "removed": 0, + "changed": 1, + "audited": 1, + "funding": 0, + "audit": { + "vulnerabilities": { + "total": 0 + } + } +} +` + +exports[`test/lib/utils/reify-output.js TAP packages changed message > {"added":0,"removed":0,"changed":1,"audited":2,"json":false} 1`] = ` + +changed 1 package, and audited 2 packages in {TIME} + +found 0 vulnerabilities +` + +exports[`test/lib/utils/reify-output.js TAP packages changed message > {"added":0,"removed":0,"changed":1,"audited":2,"json":true} 1`] = ` +{ + "added": 0, + "removed": 0, + "changed": 1, + "audited": 2, + "funding": 0, + "audit": { + "vulnerabilities": { + "total": 0 + } + } +} +` + +exports[`test/lib/utils/reify-output.js TAP packages changed message > {"added":0,"removed":0,"changed":2,"audited":0,"json":false} 1`] = ` + +changed 2 packages in {TIME} +` + +exports[`test/lib/utils/reify-output.js TAP packages changed message > {"added":0,"removed":0,"changed":2,"audited":0,"json":true} 1`] = ` +{ + "added": 0, + "removed": 0, + "changed": 2, + "audited": 0, + "funding": 0 +} +` + +exports[`test/lib/utils/reify-output.js TAP packages changed message > {"added":0,"removed":0,"changed":2,"audited":1,"json":false} 1`] = ` + +changed 2 packages, and audited 1 package in {TIME} + +found 0 vulnerabilities +` + +exports[`test/lib/utils/reify-output.js TAP packages changed message > {"added":0,"removed":0,"changed":2,"audited":1,"json":true} 1`] = ` +{ + "added": 0, + "removed": 0, + "changed": 2, + "audited": 1, + "funding": 0, + "audit": { + "vulnerabilities": { + "total": 0 + } + } +} +` + +exports[`test/lib/utils/reify-output.js TAP packages changed message > {"added":0,"removed":0,"changed":2,"audited":2,"json":false} 1`] = ` + +changed 2 packages, and audited 2 packages in {TIME} + +found 0 vulnerabilities +` + +exports[`test/lib/utils/reify-output.js TAP packages changed message > {"added":0,"removed":0,"changed":2,"audited":2,"json":true} 1`] = ` +{ + "added": 0, + "removed": 0, + "changed": 2, + "audited": 2, + "funding": 0, + "audit": { + "vulnerabilities": { + "total": 0 + } + } +} +` + +exports[`test/lib/utils/reify-output.js TAP packages changed message > {"added":0,"removed":1,"changed":0,"audited":0,"json":false} 1`] = ` + +removed 1 package in {TIME} +` + +exports[`test/lib/utils/reify-output.js TAP packages changed message > {"added":0,"removed":1,"changed":0,"audited":0,"json":true} 1`] = ` +{ + "added": 0, + "removed": 1, + "changed": 0, + "audited": 0, + "funding": 0 +} +` + +exports[`test/lib/utils/reify-output.js TAP packages changed message > {"added":0,"removed":1,"changed":0,"audited":1,"json":false} 1`] = ` + +removed 1 package, and audited 1 package in {TIME} + +found 0 vulnerabilities +` + +exports[`test/lib/utils/reify-output.js TAP packages changed message > {"added":0,"removed":1,"changed":0,"audited":1,"json":true} 1`] = ` +{ + "added": 0, + "removed": 1, + "changed": 0, + "audited": 1, + "funding": 0, + "audit": { + "vulnerabilities": { + "total": 0 + } + } +} +` + +exports[`test/lib/utils/reify-output.js TAP packages changed message > {"added":0,"removed":1,"changed":0,"audited":2,"json":false} 1`] = ` + +removed 1 package, and audited 2 packages in {TIME} + +found 0 vulnerabilities +` + +exports[`test/lib/utils/reify-output.js TAP packages changed message > {"added":0,"removed":1,"changed":0,"audited":2,"json":true} 1`] = ` +{ + "added": 0, + "removed": 1, + "changed": 0, + "audited": 2, + "funding": 0, + "audit": { + "vulnerabilities": { + "total": 0 + } + } +} +` + +exports[`test/lib/utils/reify-output.js TAP packages changed message > {"added":0,"removed":1,"changed":1,"audited":0,"json":false} 1`] = ` + +removed 1 package, and changed 1 package in {TIME} +` + +exports[`test/lib/utils/reify-output.js TAP packages changed message > {"added":0,"removed":1,"changed":1,"audited":0,"json":true} 1`] = ` +{ + "added": 0, + "removed": 1, + "changed": 1, + "audited": 0, + "funding": 0 +} +` + +exports[`test/lib/utils/reify-output.js TAP packages changed message > {"added":0,"removed":1,"changed":1,"audited":1,"json":false} 1`] = ` + +removed 1 package, changed 1 package, and audited 1 package in {TIME} + +found 0 vulnerabilities +` + +exports[`test/lib/utils/reify-output.js TAP packages changed message > {"added":0,"removed":1,"changed":1,"audited":1,"json":true} 1`] = ` +{ + "added": 0, + "removed": 1, + "changed": 1, + "audited": 1, + "funding": 0, + "audit": { + "vulnerabilities": { + "total": 0 + } + } +} +` + +exports[`test/lib/utils/reify-output.js TAP packages changed message > {"added":0,"removed":1,"changed":1,"audited":2,"json":false} 1`] = ` + +removed 1 package, changed 1 package, and audited 2 packages in {TIME} + +found 0 vulnerabilities +` + +exports[`test/lib/utils/reify-output.js TAP packages changed message > {"added":0,"removed":1,"changed":1,"audited":2,"json":true} 1`] = ` +{ + "added": 0, + "removed": 1, + "changed": 1, + "audited": 2, + "funding": 0, + "audit": { + "vulnerabilities": { + "total": 0 + } + } +} +` + +exports[`test/lib/utils/reify-output.js TAP packages changed message > {"added":0,"removed":1,"changed":2,"audited":0,"json":false} 1`] = ` + +removed 1 package, and changed 2 packages in {TIME} +` + +exports[`test/lib/utils/reify-output.js TAP packages changed message > {"added":0,"removed":1,"changed":2,"audited":0,"json":true} 1`] = ` +{ + "added": 0, + "removed": 1, + "changed": 2, + "audited": 0, + "funding": 0 +} +` + +exports[`test/lib/utils/reify-output.js TAP packages changed message > {"added":0,"removed":1,"changed":2,"audited":1,"json":false} 1`] = ` + +removed 1 package, changed 2 packages, and audited 1 package in {TIME} + +found 0 vulnerabilities +` + +exports[`test/lib/utils/reify-output.js TAP packages changed message > {"added":0,"removed":1,"changed":2,"audited":1,"json":true} 1`] = ` +{ + "added": 0, + "removed": 1, + "changed": 2, + "audited": 1, + "funding": 0, + "audit": { + "vulnerabilities": { + "total": 0 + } + } +} +` + +exports[`test/lib/utils/reify-output.js TAP packages changed message > {"added":0,"removed":1,"changed":2,"audited":2,"json":false} 1`] = ` + +removed 1 package, changed 2 packages, and audited 2 packages in {TIME} + +found 0 vulnerabilities +` + +exports[`test/lib/utils/reify-output.js TAP packages changed message > {"added":0,"removed":1,"changed":2,"audited":2,"json":true} 1`] = ` +{ + "added": 0, + "removed": 1, + "changed": 2, + "audited": 2, + "funding": 0, + "audit": { + "vulnerabilities": { + "total": 0 + } + } +} +` + +exports[`test/lib/utils/reify-output.js TAP packages changed message > {"added":0,"removed":2,"changed":0,"audited":0,"json":false} 1`] = ` + +removed 2 packages in {TIME} +` + +exports[`test/lib/utils/reify-output.js TAP packages changed message > {"added":0,"removed":2,"changed":0,"audited":0,"json":true} 1`] = ` +{ + "added": 0, + "removed": 2, + "changed": 0, + "audited": 0, + "funding": 0 +} +` + +exports[`test/lib/utils/reify-output.js TAP packages changed message > {"added":0,"removed":2,"changed":0,"audited":1,"json":false} 1`] = ` + +removed 2 packages, and audited 1 package in {TIME} + +found 0 vulnerabilities +` + +exports[`test/lib/utils/reify-output.js TAP packages changed message > {"added":0,"removed":2,"changed":0,"audited":1,"json":true} 1`] = ` +{ + "added": 0, + "removed": 2, + "changed": 0, + "audited": 1, + "funding": 0, + "audit": { + "vulnerabilities": { + "total": 0 + } + } +} +` + +exports[`test/lib/utils/reify-output.js TAP packages changed message > {"added":0,"removed":2,"changed":0,"audited":2,"json":false} 1`] = ` + +removed 2 packages, and audited 2 packages in {TIME} + +found 0 vulnerabilities +` + +exports[`test/lib/utils/reify-output.js TAP packages changed message > {"added":0,"removed":2,"changed":0,"audited":2,"json":true} 1`] = ` +{ + "added": 0, + "removed": 2, + "changed": 0, + "audited": 2, + "funding": 0, + "audit": { + "vulnerabilities": { + "total": 0 + } + } +} +` + +exports[`test/lib/utils/reify-output.js TAP packages changed message > {"added":0,"removed":2,"changed":1,"audited":0,"json":false} 1`] = ` + +removed 2 packages, and changed 1 package in {TIME} +` + +exports[`test/lib/utils/reify-output.js TAP packages changed message > {"added":0,"removed":2,"changed":1,"audited":0,"json":true} 1`] = ` +{ + "added": 0, + "removed": 2, + "changed": 1, + "audited": 0, + "funding": 0 +} +` + +exports[`test/lib/utils/reify-output.js TAP packages changed message > {"added":0,"removed":2,"changed":1,"audited":1,"json":false} 1`] = ` + +removed 2 packages, changed 1 package, and audited 1 package in {TIME} + +found 0 vulnerabilities +` + +exports[`test/lib/utils/reify-output.js TAP packages changed message > {"added":0,"removed":2,"changed":1,"audited":1,"json":true} 1`] = ` +{ + "added": 0, + "removed": 2, + "changed": 1, + "audited": 1, + "funding": 0, + "audit": { + "vulnerabilities": { + "total": 0 + } + } +} +` + +exports[`test/lib/utils/reify-output.js TAP packages changed message > {"added":0,"removed":2,"changed":1,"audited":2,"json":false} 1`] = ` + +removed 2 packages, changed 1 package, and audited 2 packages in {TIME} + +found 0 vulnerabilities +` + +exports[`test/lib/utils/reify-output.js TAP packages changed message > {"added":0,"removed":2,"changed":1,"audited":2,"json":true} 1`] = ` +{ + "added": 0, + "removed": 2, + "changed": 1, + "audited": 2, + "funding": 0, + "audit": { + "vulnerabilities": { + "total": 0 + } + } +} +` + +exports[`test/lib/utils/reify-output.js TAP packages changed message > {"added":0,"removed":2,"changed":2,"audited":0,"json":false} 1`] = ` + +removed 2 packages, and changed 2 packages in {TIME} +` + +exports[`test/lib/utils/reify-output.js TAP packages changed message > {"added":0,"removed":2,"changed":2,"audited":0,"json":true} 1`] = ` +{ + "added": 0, + "removed": 2, + "changed": 2, + "audited": 0, + "funding": 0 +} +` + +exports[`test/lib/utils/reify-output.js TAP packages changed message > {"added":0,"removed":2,"changed":2,"audited":1,"json":false} 1`] = ` + +removed 2 packages, changed 2 packages, and audited 1 package in {TIME} + +found 0 vulnerabilities +` + +exports[`test/lib/utils/reify-output.js TAP packages changed message > {"added":0,"removed":2,"changed":2,"audited":1,"json":true} 1`] = ` +{ + "added": 0, + "removed": 2, + "changed": 2, + "audited": 1, + "funding": 0, + "audit": { + "vulnerabilities": { + "total": 0 + } + } +} +` + +exports[`test/lib/utils/reify-output.js TAP packages changed message > {"added":0,"removed":2,"changed":2,"audited":2,"json":false} 1`] = ` + +removed 2 packages, changed 2 packages, and audited 2 packages in {TIME} + +found 0 vulnerabilities +` + +exports[`test/lib/utils/reify-output.js TAP packages changed message > {"added":0,"removed":2,"changed":2,"audited":2,"json":true} 1`] = ` +{ + "added": 0, + "removed": 2, + "changed": 2, + "audited": 2, + "funding": 0, + "audit": { + "vulnerabilities": { + "total": 0 + } + } +} +` + +exports[`test/lib/utils/reify-output.js TAP packages changed message > {"added":1,"removed":0,"changed":0,"audited":0,"json":false} 1`] = ` + +added 1 package in {TIME} +` + +exports[`test/lib/utils/reify-output.js TAP packages changed message > {"added":1,"removed":0,"changed":0,"audited":0,"json":true} 1`] = ` +{ + "added": 1, + "removed": 0, + "changed": 0, + "audited": 0, + "funding": 0 +} +` + +exports[`test/lib/utils/reify-output.js TAP packages changed message > {"added":1,"removed":0,"changed":0,"audited":1,"json":false} 1`] = ` + +added 1 package, and audited 1 package in {TIME} + +found 0 vulnerabilities +` + +exports[`test/lib/utils/reify-output.js TAP packages changed message > {"added":1,"removed":0,"changed":0,"audited":1,"json":true} 1`] = ` +{ + "added": 1, + "removed": 0, + "changed": 0, + "audited": 1, + "funding": 0, + "audit": { + "vulnerabilities": { + "total": 0 + } + } +} +` + +exports[`test/lib/utils/reify-output.js TAP packages changed message > {"added":1,"removed":0,"changed":0,"audited":2,"json":false} 1`] = ` + +added 1 package, and audited 2 packages in {TIME} + +found 0 vulnerabilities +` + +exports[`test/lib/utils/reify-output.js TAP packages changed message > {"added":1,"removed":0,"changed":0,"audited":2,"json":true} 1`] = ` +{ + "added": 1, + "removed": 0, + "changed": 0, + "audited": 2, + "funding": 0, + "audit": { + "vulnerabilities": { + "total": 0 + } + } +} +` + +exports[`test/lib/utils/reify-output.js TAP packages changed message > {"added":1,"removed":0,"changed":1,"audited":0,"json":false} 1`] = ` + +added 1 package, and changed 1 package in {TIME} +` + +exports[`test/lib/utils/reify-output.js TAP packages changed message > {"added":1,"removed":0,"changed":1,"audited":0,"json":true} 1`] = ` +{ + "added": 1, + "removed": 0, + "changed": 1, + "audited": 0, + "funding": 0 +} +` + +exports[`test/lib/utils/reify-output.js TAP packages changed message > {"added":1,"removed":0,"changed":1,"audited":1,"json":false} 1`] = ` + +added 1 package, changed 1 package, and audited 1 package in {TIME} + +found 0 vulnerabilities +` + +exports[`test/lib/utils/reify-output.js TAP packages changed message > {"added":1,"removed":0,"changed":1,"audited":1,"json":true} 1`] = ` +{ + "added": 1, + "removed": 0, + "changed": 1, + "audited": 1, + "funding": 0, + "audit": { + "vulnerabilities": { + "total": 0 + } + } +} +` + +exports[`test/lib/utils/reify-output.js TAP packages changed message > {"added":1,"removed":0,"changed":1,"audited":2,"json":false} 1`] = ` + +added 1 package, changed 1 package, and audited 2 packages in {TIME} + +found 0 vulnerabilities +` + +exports[`test/lib/utils/reify-output.js TAP packages changed message > {"added":1,"removed":0,"changed":1,"audited":2,"json":true} 1`] = ` +{ + "added": 1, + "removed": 0, + "changed": 1, + "audited": 2, + "funding": 0, + "audit": { + "vulnerabilities": { + "total": 0 + } + } +} +` + +exports[`test/lib/utils/reify-output.js TAP packages changed message > {"added":1,"removed":0,"changed":2,"audited":0,"json":false} 1`] = ` + +added 1 package, and changed 2 packages in {TIME} +` + +exports[`test/lib/utils/reify-output.js TAP packages changed message > {"added":1,"removed":0,"changed":2,"audited":0,"json":true} 1`] = ` +{ + "added": 1, + "removed": 0, + "changed": 2, + "audited": 0, + "funding": 0 +} +` + +exports[`test/lib/utils/reify-output.js TAP packages changed message > {"added":1,"removed":0,"changed":2,"audited":1,"json":false} 1`] = ` + +added 1 package, changed 2 packages, and audited 1 package in {TIME} + +found 0 vulnerabilities +` + +exports[`test/lib/utils/reify-output.js TAP packages changed message > {"added":1,"removed":0,"changed":2,"audited":1,"json":true} 1`] = ` +{ + "added": 1, + "removed": 0, + "changed": 2, + "audited": 1, + "funding": 0, + "audit": { + "vulnerabilities": { + "total": 0 + } + } +} +` + +exports[`test/lib/utils/reify-output.js TAP packages changed message > {"added":1,"removed":0,"changed":2,"audited":2,"json":false} 1`] = ` + +added 1 package, changed 2 packages, and audited 2 packages in {TIME} + +found 0 vulnerabilities +` + +exports[`test/lib/utils/reify-output.js TAP packages changed message > {"added":1,"removed":0,"changed":2,"audited":2,"json":true} 1`] = ` +{ + "added": 1, + "removed": 0, + "changed": 2, + "audited": 2, + "funding": 0, + "audit": { + "vulnerabilities": { + "total": 0 + } + } +} +` + +exports[`test/lib/utils/reify-output.js TAP packages changed message > {"added":1,"removed":1,"changed":0,"audited":0,"json":false} 1`] = ` + +added 1 package, and removed 1 package in {TIME} +` + +exports[`test/lib/utils/reify-output.js TAP packages changed message > {"added":1,"removed":1,"changed":0,"audited":0,"json":true} 1`] = ` +{ + "added": 1, + "removed": 1, + "changed": 0, + "audited": 0, + "funding": 0 +} +` + +exports[`test/lib/utils/reify-output.js TAP packages changed message > {"added":1,"removed":1,"changed":0,"audited":1,"json":false} 1`] = ` + +added 1 package, removed 1 package, and audited 1 package in {TIME} + +found 0 vulnerabilities +` + +exports[`test/lib/utils/reify-output.js TAP packages changed message > {"added":1,"removed":1,"changed":0,"audited":1,"json":true} 1`] = ` +{ + "added": 1, + "removed": 1, + "changed": 0, + "audited": 1, + "funding": 0, + "audit": { + "vulnerabilities": { + "total": 0 + } + } +} +` + +exports[`test/lib/utils/reify-output.js TAP packages changed message > {"added":1,"removed":1,"changed":0,"audited":2,"json":false} 1`] = ` + +added 1 package, removed 1 package, and audited 2 packages in {TIME} + +found 0 vulnerabilities +` + +exports[`test/lib/utils/reify-output.js TAP packages changed message > {"added":1,"removed":1,"changed":0,"audited":2,"json":true} 1`] = ` +{ + "added": 1, + "removed": 1, + "changed": 0, + "audited": 2, + "funding": 0, + "audit": { + "vulnerabilities": { + "total": 0 + } + } +} +` + +exports[`test/lib/utils/reify-output.js TAP packages changed message > {"added":1,"removed":1,"changed":1,"audited":0,"json":false} 1`] = ` + +added 1 package, removed 1 package, and changed 1 package in {TIME} +` + +exports[`test/lib/utils/reify-output.js TAP packages changed message > {"added":1,"removed":1,"changed":1,"audited":0,"json":true} 1`] = ` +{ + "added": 1, + "removed": 1, + "changed": 1, + "audited": 0, + "funding": 0 +} +` + +exports[`test/lib/utils/reify-output.js TAP packages changed message > {"added":1,"removed":1,"changed":1,"audited":1,"json":false} 1`] = ` + +added 1 package, removed 1 package, changed 1 package, and audited 1 package in {TIME} + +found 0 vulnerabilities +` + +exports[`test/lib/utils/reify-output.js TAP packages changed message > {"added":1,"removed":1,"changed":1,"audited":1,"json":true} 1`] = ` +{ + "added": 1, + "removed": 1, + "changed": 1, + "audited": 1, + "funding": 0, + "audit": { + "vulnerabilities": { + "total": 0 + } + } +} +` + +exports[`test/lib/utils/reify-output.js TAP packages changed message > {"added":1,"removed":1,"changed":1,"audited":2,"json":false} 1`] = ` + +added 1 package, removed 1 package, changed 1 package, and audited 2 packages in {TIME} + +found 0 vulnerabilities +` + +exports[`test/lib/utils/reify-output.js TAP packages changed message > {"added":1,"removed":1,"changed":1,"audited":2,"json":true} 1`] = ` +{ + "added": 1, + "removed": 1, + "changed": 1, + "audited": 2, + "funding": 0, + "audit": { + "vulnerabilities": { + "total": 0 + } + } +} +` + +exports[`test/lib/utils/reify-output.js TAP packages changed message > {"added":1,"removed":1,"changed":2,"audited":0,"json":false} 1`] = ` + +added 1 package, removed 1 package, and changed 2 packages in {TIME} +` + +exports[`test/lib/utils/reify-output.js TAP packages changed message > {"added":1,"removed":1,"changed":2,"audited":0,"json":true} 1`] = ` +{ + "added": 1, + "removed": 1, + "changed": 2, + "audited": 0, + "funding": 0 +} +` + +exports[`test/lib/utils/reify-output.js TAP packages changed message > {"added":1,"removed":1,"changed":2,"audited":1,"json":false} 1`] = ` + +added 1 package, removed 1 package, changed 2 packages, and audited 1 package in {TIME} + +found 0 vulnerabilities +` + +exports[`test/lib/utils/reify-output.js TAP packages changed message > {"added":1,"removed":1,"changed":2,"audited":1,"json":true} 1`] = ` +{ + "added": 1, + "removed": 1, + "changed": 2, + "audited": 1, + "funding": 0, + "audit": { + "vulnerabilities": { + "total": 0 + } + } +} +` + +exports[`test/lib/utils/reify-output.js TAP packages changed message > {"added":1,"removed":1,"changed":2,"audited":2,"json":false} 1`] = ` + +added 1 package, removed 1 package, changed 2 packages, and audited 2 packages in {TIME} + +found 0 vulnerabilities +` + +exports[`test/lib/utils/reify-output.js TAP packages changed message > {"added":1,"removed":1,"changed":2,"audited":2,"json":true} 1`] = ` +{ + "added": 1, + "removed": 1, + "changed": 2, + "audited": 2, + "funding": 0, + "audit": { + "vulnerabilities": { + "total": 0 + } + } +} +` + +exports[`test/lib/utils/reify-output.js TAP packages changed message > {"added":1,"removed":2,"changed":0,"audited":0,"json":false} 1`] = ` + +added 1 package, and removed 2 packages in {TIME} +` + +exports[`test/lib/utils/reify-output.js TAP packages changed message > {"added":1,"removed":2,"changed":0,"audited":0,"json":true} 1`] = ` +{ + "added": 1, + "removed": 2, + "changed": 0, + "audited": 0, + "funding": 0 +} +` + +exports[`test/lib/utils/reify-output.js TAP packages changed message > {"added":1,"removed":2,"changed":0,"audited":1,"json":false} 1`] = ` + +added 1 package, removed 2 packages, and audited 1 package in {TIME} + +found 0 vulnerabilities +` + +exports[`test/lib/utils/reify-output.js TAP packages changed message > {"added":1,"removed":2,"changed":0,"audited":1,"json":true} 1`] = ` +{ + "added": 1, + "removed": 2, + "changed": 0, + "audited": 1, + "funding": 0, + "audit": { + "vulnerabilities": { + "total": 0 + } + } +} +` + +exports[`test/lib/utils/reify-output.js TAP packages changed message > {"added":1,"removed":2,"changed":0,"audited":2,"json":false} 1`] = ` + +added 1 package, removed 2 packages, and audited 2 packages in {TIME} + +found 0 vulnerabilities +` + +exports[`test/lib/utils/reify-output.js TAP packages changed message > {"added":1,"removed":2,"changed":0,"audited":2,"json":true} 1`] = ` +{ + "added": 1, + "removed": 2, + "changed": 0, + "audited": 2, + "funding": 0, + "audit": { + "vulnerabilities": { + "total": 0 + } + } +} +` + +exports[`test/lib/utils/reify-output.js TAP packages changed message > {"added":1,"removed":2,"changed":1,"audited":0,"json":false} 1`] = ` + +added 1 package, removed 2 packages, and changed 1 package in {TIME} +` + +exports[`test/lib/utils/reify-output.js TAP packages changed message > {"added":1,"removed":2,"changed":1,"audited":0,"json":true} 1`] = ` +{ + "added": 1, + "removed": 2, + "changed": 1, + "audited": 0, + "funding": 0 +} +` + +exports[`test/lib/utils/reify-output.js TAP packages changed message > {"added":1,"removed":2,"changed":1,"audited":1,"json":false} 1`] = ` + +added 1 package, removed 2 packages, changed 1 package, and audited 1 package in {TIME} + +found 0 vulnerabilities +` + +exports[`test/lib/utils/reify-output.js TAP packages changed message > {"added":1,"removed":2,"changed":1,"audited":1,"json":true} 1`] = ` +{ + "added": 1, + "removed": 2, + "changed": 1, + "audited": 1, + "funding": 0, + "audit": { + "vulnerabilities": { + "total": 0 + } + } +} +` + +exports[`test/lib/utils/reify-output.js TAP packages changed message > {"added":1,"removed":2,"changed":1,"audited":2,"json":false} 1`] = ` + +added 1 package, removed 2 packages, changed 1 package, and audited 2 packages in {TIME} + +found 0 vulnerabilities +` + +exports[`test/lib/utils/reify-output.js TAP packages changed message > {"added":1,"removed":2,"changed":1,"audited":2,"json":true} 1`] = ` +{ + "added": 1, + "removed": 2, + "changed": 1, + "audited": 2, + "funding": 0, + "audit": { + "vulnerabilities": { + "total": 0 + } + } +} +` + +exports[`test/lib/utils/reify-output.js TAP packages changed message > {"added":1,"removed":2,"changed":2,"audited":0,"json":false} 1`] = ` + +added 1 package, removed 2 packages, and changed 2 packages in {TIME} +` + +exports[`test/lib/utils/reify-output.js TAP packages changed message > {"added":1,"removed":2,"changed":2,"audited":0,"json":true} 1`] = ` +{ + "added": 1, + "removed": 2, + "changed": 2, + "audited": 0, + "funding": 0 +} +` + +exports[`test/lib/utils/reify-output.js TAP packages changed message > {"added":1,"removed":2,"changed":2,"audited":1,"json":false} 1`] = ` + +added 1 package, removed 2 packages, changed 2 packages, and audited 1 package in {TIME} + +found 0 vulnerabilities +` + +exports[`test/lib/utils/reify-output.js TAP packages changed message > {"added":1,"removed":2,"changed":2,"audited":1,"json":true} 1`] = ` +{ + "added": 1, + "removed": 2, + "changed": 2, + "audited": 1, + "funding": 0, + "audit": { + "vulnerabilities": { + "total": 0 + } + } +} +` + +exports[`test/lib/utils/reify-output.js TAP packages changed message > {"added":1,"removed":2,"changed":2,"audited":2,"json":false} 1`] = ` + +added 1 package, removed 2 packages, changed 2 packages, and audited 2 packages in {TIME} + +found 0 vulnerabilities +` + +exports[`test/lib/utils/reify-output.js TAP packages changed message > {"added":1,"removed":2,"changed":2,"audited":2,"json":true} 1`] = ` +{ + "added": 1, + "removed": 2, + "changed": 2, + "audited": 2, + "funding": 0, + "audit": { + "vulnerabilities": { + "total": 0 + } + } +} +` + +exports[`test/lib/utils/reify-output.js TAP packages changed message > {"added":2,"removed":0,"changed":0,"audited":0,"json":false} 1`] = ` + +added 2 packages in {TIME} +` + +exports[`test/lib/utils/reify-output.js TAP packages changed message > {"added":2,"removed":0,"changed":0,"audited":0,"json":true} 1`] = ` +{ + "added": 2, + "removed": 0, + "changed": 0, + "audited": 0, + "funding": 0 +} +` + +exports[`test/lib/utils/reify-output.js TAP packages changed message > {"added":2,"removed":0,"changed":0,"audited":1,"json":false} 1`] = ` + +added 2 packages, and audited 1 package in {TIME} + +found 0 vulnerabilities +` + +exports[`test/lib/utils/reify-output.js TAP packages changed message > {"added":2,"removed":0,"changed":0,"audited":1,"json":true} 1`] = ` +{ + "added": 2, + "removed": 0, + "changed": 0, + "audited": 1, + "funding": 0, + "audit": { + "vulnerabilities": { + "total": 0 + } + } +} +` + +exports[`test/lib/utils/reify-output.js TAP packages changed message > {"added":2,"removed":0,"changed":0,"audited":2,"json":false} 1`] = ` + +added 2 packages, and audited 2 packages in {TIME} + +found 0 vulnerabilities +` + +exports[`test/lib/utils/reify-output.js TAP packages changed message > {"added":2,"removed":0,"changed":0,"audited":2,"json":true} 1`] = ` +{ + "added": 2, + "removed": 0, + "changed": 0, + "audited": 2, + "funding": 0, + "audit": { + "vulnerabilities": { + "total": 0 + } + } +} +` + +exports[`test/lib/utils/reify-output.js TAP packages changed message > {"added":2,"removed":0,"changed":1,"audited":0,"json":false} 1`] = ` + +added 2 packages, and changed 1 package in {TIME} +` + +exports[`test/lib/utils/reify-output.js TAP packages changed message > {"added":2,"removed":0,"changed":1,"audited":0,"json":true} 1`] = ` +{ + "added": 2, + "removed": 0, + "changed": 1, + "audited": 0, + "funding": 0 +} +` + +exports[`test/lib/utils/reify-output.js TAP packages changed message > {"added":2,"removed":0,"changed":1,"audited":1,"json":false} 1`] = ` + +added 2 packages, changed 1 package, and audited 1 package in {TIME} + +found 0 vulnerabilities +` + +exports[`test/lib/utils/reify-output.js TAP packages changed message > {"added":2,"removed":0,"changed":1,"audited":1,"json":true} 1`] = ` +{ + "added": 2, + "removed": 0, + "changed": 1, + "audited": 1, + "funding": 0, + "audit": { + "vulnerabilities": { + "total": 0 + } + } +} +` + +exports[`test/lib/utils/reify-output.js TAP packages changed message > {"added":2,"removed":0,"changed":1,"audited":2,"json":false} 1`] = ` + +added 2 packages, changed 1 package, and audited 2 packages in {TIME} + +found 0 vulnerabilities +` + +exports[`test/lib/utils/reify-output.js TAP packages changed message > {"added":2,"removed":0,"changed":1,"audited":2,"json":true} 1`] = ` +{ + "added": 2, + "removed": 0, + "changed": 1, + "audited": 2, + "funding": 0, + "audit": { + "vulnerabilities": { + "total": 0 + } + } +} +` + +exports[`test/lib/utils/reify-output.js TAP packages changed message > {"added":2,"removed":0,"changed":2,"audited":0,"json":false} 1`] = ` + +added 2 packages, and changed 2 packages in {TIME} +` + +exports[`test/lib/utils/reify-output.js TAP packages changed message > {"added":2,"removed":0,"changed":2,"audited":0,"json":true} 1`] = ` +{ + "added": 2, + "removed": 0, + "changed": 2, + "audited": 0, + "funding": 0 +} +` + +exports[`test/lib/utils/reify-output.js TAP packages changed message > {"added":2,"removed":0,"changed":2,"audited":1,"json":false} 1`] = ` + +added 2 packages, changed 2 packages, and audited 1 package in {TIME} + +found 0 vulnerabilities +` + +exports[`test/lib/utils/reify-output.js TAP packages changed message > {"added":2,"removed":0,"changed":2,"audited":1,"json":true} 1`] = ` +{ + "added": 2, + "removed": 0, + "changed": 2, + "audited": 1, + "funding": 0, + "audit": { + "vulnerabilities": { + "total": 0 + } + } +} +` + +exports[`test/lib/utils/reify-output.js TAP packages changed message > {"added":2,"removed":0,"changed":2,"audited":2,"json":false} 1`] = ` + +added 2 packages, changed 2 packages, and audited 2 packages in {TIME} + +found 0 vulnerabilities +` + +exports[`test/lib/utils/reify-output.js TAP packages changed message > {"added":2,"removed":0,"changed":2,"audited":2,"json":true} 1`] = ` +{ + "added": 2, + "removed": 0, + "changed": 2, + "audited": 2, + "funding": 0, + "audit": { + "vulnerabilities": { + "total": 0 + } + } +} +` + +exports[`test/lib/utils/reify-output.js TAP packages changed message > {"added":2,"removed":1,"changed":0,"audited":0,"json":false} 1`] = ` + +added 2 packages, and removed 1 package in {TIME} +` + +exports[`test/lib/utils/reify-output.js TAP packages changed message > {"added":2,"removed":1,"changed":0,"audited":0,"json":true} 1`] = ` +{ + "added": 2, + "removed": 1, + "changed": 0, + "audited": 0, + "funding": 0 +} +` + +exports[`test/lib/utils/reify-output.js TAP packages changed message > {"added":2,"removed":1,"changed":0,"audited":1,"json":false} 1`] = ` + +added 2 packages, removed 1 package, and audited 1 package in {TIME} + +found 0 vulnerabilities +` + +exports[`test/lib/utils/reify-output.js TAP packages changed message > {"added":2,"removed":1,"changed":0,"audited":1,"json":true} 1`] = ` +{ + "added": 2, + "removed": 1, + "changed": 0, + "audited": 1, + "funding": 0, + "audit": { + "vulnerabilities": { + "total": 0 + } + } +} +` + +exports[`test/lib/utils/reify-output.js TAP packages changed message > {"added":2,"removed":1,"changed":0,"audited":2,"json":false} 1`] = ` + +added 2 packages, removed 1 package, and audited 2 packages in {TIME} + +found 0 vulnerabilities +` + +exports[`test/lib/utils/reify-output.js TAP packages changed message > {"added":2,"removed":1,"changed":0,"audited":2,"json":true} 1`] = ` +{ + "added": 2, + "removed": 1, + "changed": 0, + "audited": 2, + "funding": 0, + "audit": { + "vulnerabilities": { + "total": 0 + } + } +} +` + +exports[`test/lib/utils/reify-output.js TAP packages changed message > {"added":2,"removed":1,"changed":1,"audited":0,"json":false} 1`] = ` + +added 2 packages, removed 1 package, and changed 1 package in {TIME} +` + +exports[`test/lib/utils/reify-output.js TAP packages changed message > {"added":2,"removed":1,"changed":1,"audited":0,"json":true} 1`] = ` +{ + "added": 2, + "removed": 1, + "changed": 1, + "audited": 0, + "funding": 0 +} +` + +exports[`test/lib/utils/reify-output.js TAP packages changed message > {"added":2,"removed":1,"changed":1,"audited":1,"json":false} 1`] = ` + +added 2 packages, removed 1 package, changed 1 package, and audited 1 package in {TIME} + +found 0 vulnerabilities +` + +exports[`test/lib/utils/reify-output.js TAP packages changed message > {"added":2,"removed":1,"changed":1,"audited":1,"json":true} 1`] = ` +{ + "added": 2, + "removed": 1, + "changed": 1, + "audited": 1, + "funding": 0, + "audit": { + "vulnerabilities": { + "total": 0 + } + } +} +` + +exports[`test/lib/utils/reify-output.js TAP packages changed message > {"added":2,"removed":1,"changed":1,"audited":2,"json":false} 1`] = ` + +added 2 packages, removed 1 package, changed 1 package, and audited 2 packages in {TIME} + +found 0 vulnerabilities +` + +exports[`test/lib/utils/reify-output.js TAP packages changed message > {"added":2,"removed":1,"changed":1,"audited":2,"json":true} 1`] = ` +{ + "added": 2, + "removed": 1, + "changed": 1, + "audited": 2, + "funding": 0, + "audit": { + "vulnerabilities": { + "total": 0 + } + } +} +` + +exports[`test/lib/utils/reify-output.js TAP packages changed message > {"added":2,"removed":1,"changed":2,"audited":0,"json":false} 1`] = ` + +added 2 packages, removed 1 package, and changed 2 packages in {TIME} +` + +exports[`test/lib/utils/reify-output.js TAP packages changed message > {"added":2,"removed":1,"changed":2,"audited":0,"json":true} 1`] = ` +{ + "added": 2, + "removed": 1, + "changed": 2, + "audited": 0, + "funding": 0 +} +` + +exports[`test/lib/utils/reify-output.js TAP packages changed message > {"added":2,"removed":1,"changed":2,"audited":1,"json":false} 1`] = ` + +added 2 packages, removed 1 package, changed 2 packages, and audited 1 package in {TIME} + +found 0 vulnerabilities +` + +exports[`test/lib/utils/reify-output.js TAP packages changed message > {"added":2,"removed":1,"changed":2,"audited":1,"json":true} 1`] = ` +{ + "added": 2, + "removed": 1, + "changed": 2, + "audited": 1, + "funding": 0, + "audit": { + "vulnerabilities": { + "total": 0 + } + } +} +` + +exports[`test/lib/utils/reify-output.js TAP packages changed message > {"added":2,"removed":1,"changed":2,"audited":2,"json":false} 1`] = ` + +added 2 packages, removed 1 package, changed 2 packages, and audited 2 packages in {TIME} + +found 0 vulnerabilities +` + +exports[`test/lib/utils/reify-output.js TAP packages changed message > {"added":2,"removed":1,"changed":2,"audited":2,"json":true} 1`] = ` +{ + "added": 2, + "removed": 1, + "changed": 2, + "audited": 2, + "funding": 0, + "audit": { + "vulnerabilities": { + "total": 0 + } + } +} +` + +exports[`test/lib/utils/reify-output.js TAP packages changed message > {"added":2,"removed":2,"changed":0,"audited":0,"json":false} 1`] = ` + +added 2 packages, and removed 2 packages in {TIME} +` + +exports[`test/lib/utils/reify-output.js TAP packages changed message > {"added":2,"removed":2,"changed":0,"audited":0,"json":true} 1`] = ` +{ + "added": 2, + "removed": 2, + "changed": 0, + "audited": 0, + "funding": 0 +} +` + +exports[`test/lib/utils/reify-output.js TAP packages changed message > {"added":2,"removed":2,"changed":0,"audited":1,"json":false} 1`] = ` + +added 2 packages, removed 2 packages, and audited 1 package in {TIME} + +found 0 vulnerabilities +` + +exports[`test/lib/utils/reify-output.js TAP packages changed message > {"added":2,"removed":2,"changed":0,"audited":1,"json":true} 1`] = ` +{ + "added": 2, + "removed": 2, + "changed": 0, + "audited": 1, + "funding": 0, + "audit": { + "vulnerabilities": { + "total": 0 + } + } +} +` + +exports[`test/lib/utils/reify-output.js TAP packages changed message > {"added":2,"removed":2,"changed":0,"audited":2,"json":false} 1`] = ` + +added 2 packages, removed 2 packages, and audited 2 packages in {TIME} + +found 0 vulnerabilities +` + +exports[`test/lib/utils/reify-output.js TAP packages changed message > {"added":2,"removed":2,"changed":0,"audited":2,"json":true} 1`] = ` +{ + "added": 2, + "removed": 2, + "changed": 0, + "audited": 2, + "funding": 0, + "audit": { + "vulnerabilities": { + "total": 0 + } + } +} +` + +exports[`test/lib/utils/reify-output.js TAP packages changed message > {"added":2,"removed":2,"changed":1,"audited":0,"json":false} 1`] = ` + +added 2 packages, removed 2 packages, and changed 1 package in {TIME} +` + +exports[`test/lib/utils/reify-output.js TAP packages changed message > {"added":2,"removed":2,"changed":1,"audited":0,"json":true} 1`] = ` +{ + "added": 2, + "removed": 2, + "changed": 1, + "audited": 0, + "funding": 0 +} +` + +exports[`test/lib/utils/reify-output.js TAP packages changed message > {"added":2,"removed":2,"changed":1,"audited":1,"json":false} 1`] = ` + +added 2 packages, removed 2 packages, changed 1 package, and audited 1 package in {TIME} + +found 0 vulnerabilities +` + +exports[`test/lib/utils/reify-output.js TAP packages changed message > {"added":2,"removed":2,"changed":1,"audited":1,"json":true} 1`] = ` +{ + "added": 2, + "removed": 2, + "changed": 1, + "audited": 1, + "funding": 0, + "audit": { + "vulnerabilities": { + "total": 0 + } + } +} +` + +exports[`test/lib/utils/reify-output.js TAP packages changed message > {"added":2,"removed":2,"changed":1,"audited":2,"json":false} 1`] = ` + +added 2 packages, removed 2 packages, changed 1 package, and audited 2 packages in {TIME} + +found 0 vulnerabilities +` + +exports[`test/lib/utils/reify-output.js TAP packages changed message > {"added":2,"removed":2,"changed":1,"audited":2,"json":true} 1`] = ` +{ + "added": 2, + "removed": 2, + "changed": 1, + "audited": 2, + "funding": 0, + "audit": { + "vulnerabilities": { + "total": 0 + } + } +} +` + +exports[`test/lib/utils/reify-output.js TAP packages changed message > {"added":2,"removed":2,"changed":2,"audited":0,"json":false} 1`] = ` + +added 2 packages, removed 2 packages, and changed 2 packages in {TIME} +` + +exports[`test/lib/utils/reify-output.js TAP packages changed message > {"added":2,"removed":2,"changed":2,"audited":0,"json":true} 1`] = ` +{ + "added": 2, + "removed": 2, + "changed": 2, + "audited": 0, + "funding": 0 +} +` + +exports[`test/lib/utils/reify-output.js TAP packages changed message > {"added":2,"removed":2,"changed":2,"audited":1,"json":false} 1`] = ` + +added 2 packages, removed 2 packages, changed 2 packages, and audited 1 package in {TIME} + +found 0 vulnerabilities +` + +exports[`test/lib/utils/reify-output.js TAP packages changed message > {"added":2,"removed":2,"changed":2,"audited":1,"json":true} 1`] = ` +{ + "added": 2, + "removed": 2, + "changed": 2, + "audited": 1, + "funding": 0, + "audit": { + "vulnerabilities": { + "total": 0 + } + } +} +` + +exports[`test/lib/utils/reify-output.js TAP packages changed message > {"added":2,"removed":2,"changed":2,"audited":2,"json":false} 1`] = ` + +added 2 packages, removed 2 packages, changed 2 packages, and audited 2 packages in {TIME} + +found 0 vulnerabilities +` + +exports[`test/lib/utils/reify-output.js TAP packages changed message > {"added":2,"removed":2,"changed":2,"audited":2,"json":true} 1`] = ` +{ + "added": 2, + "removed": 2, + "changed": 2, + "audited": 2, + "funding": 0, + "audit": { + "vulnerabilities": { + "total": 0 + } + } +} +` diff --git a/deps/npm/tap-snapshots/test-lib-utils-tar.js-TAP.test.js b/deps/npm/tap-snapshots/test-lib-utils-tar.js-TAP.test.js new file mode 100644 index 00000000000000..a24848fda3f7eb --- /dev/null +++ b/deps/npm/tap-snapshots/test-lib-utils-tar.js-TAP.test.js @@ -0,0 +1,34 @@ +/* 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/tar.js TAP should log tarball contents > must match snapshot 1`] = ` + + +package: my-cool-pkg@1.0.0 +=== Tarball Contents === + +4B node_modules/bundle-dep +97B package.json +=== Bundled Dependencies === + +bundle-dep +=== Tarball Details === + +name: my-cool-pkg +version: 1.0.0 +filename: my-cool-pkg-1.0.0.tgz +package size: 222 B +unpacked size: 101 B +shasum: fe3a2f6064ade3bc21640874530586343f2d832f +integrity: sha512-ehndP8xBQL4yo[...]kWinZ4k1SCqUA== +bundled deps: 1 +bundled files: 0 +own files: 2 +total files: 2 + + +` diff --git a/deps/npm/tap-snapshots/test-lib-utils-update-notifier.js-TAP.test.js b/deps/npm/tap-snapshots/test-lib-utils-update-notifier.js-TAP.test.js new file mode 100644 index 00000000000000..91228650d47de7 --- /dev/null +++ b/deps/npm/tap-snapshots/test-lib-utils-update-notifier.js-TAP.test.js @@ -0,0 +1,102 @@ +/* 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/update-notifier.js TAP notification situations major to current > color 1`] = ` + +New major version of npm available! 122.420.69 -> 123.420.69 +Changelog: https://github.com/npm/cli/releases/tag/v123.420.69 +Run npm install -g npm@123.420.69 to update! + +` + +exports[`test/lib/utils/update-notifier.js TAP notification situations major to current > no color 1`] = ` + +New major version of npm available! 122.420.69 -> 123.420.69 +Changelog: +Run \`npm install -g npm@123.420.69\` to update! + +` + +exports[`test/lib/utils/update-notifier.js TAP notification situations minor to current > color 1`] = ` + +New minor version of npm available! 123.419.69 -> 123.420.69 +Changelog: https://github.com/npm/cli/releases/tag/v123.420.69 +Run npm install -g npm@123.420.69 to update! + +` + +exports[`test/lib/utils/update-notifier.js TAP notification situations minor to current > no color 1`] = ` + +New minor version of npm available! 123.419.69 -> 123.420.69 +Changelog: +Run \`npm install -g npm@123.420.69\` to update! + +` + +exports[`test/lib/utils/update-notifier.js TAP notification situations minor to next version > color 1`] = ` + +New minor version of npm available! 123.420.70 -> 123.421.70 +Changelog: https://github.com/npm/cli/releases/tag/v123.421.70 +Run npm install -g npm@123.421.70 to update! + +` + +exports[`test/lib/utils/update-notifier.js TAP notification situations minor to next version > no color 1`] = ` + +New minor version of npm available! 123.420.70 -> 123.421.70 +Changelog: +Run \`npm install -g npm@123.421.70\` to update! + +` + +exports[`test/lib/utils/update-notifier.js TAP notification situations new beta available > color 1`] = ` + +New prerelease version of npm available! 124.0.0-beta.0 -> 124.0.0-beta.99999 +Changelog: https://github.com/npm/cli/releases/tag/v124.0.0-beta.99999 +Run npm install -g npm@124.0.0-beta.99999 to update! + +` + +exports[`test/lib/utils/update-notifier.js TAP notification situations new beta available > no color 1`] = ` + +New prerelease version of npm available! 124.0.0-beta.0 -> 124.0.0-beta.99999 +Changelog: +Run \`npm install -g npm@124.0.0-beta.99999\` to update! + +` + +exports[`test/lib/utils/update-notifier.js TAP notification situations patch to current > color 1`] = ` + +New patch version of npm available! 123.420.68 -> 123.420.69 +Changelog: https://github.com/npm/cli/releases/tag/v123.420.69 +Run npm install -g npm@123.420.69 to update! + +` + +exports[`test/lib/utils/update-notifier.js TAP notification situations patch to current > no color 1`] = ` + +New patch version of npm available! 123.420.68 -> 123.420.69 +Changelog: +Run \`npm install -g npm@123.420.69\` to update! + +` + +exports[`test/lib/utils/update-notifier.js TAP notification situations patch to next version > color 1`] = ` + +New patch version of npm available! 123.421.69 -> 123.421.70 +Changelog: https://github.com/npm/cli/releases/tag/v123.421.70 +Run npm install -g npm@123.421.70 to update! + +` + +exports[`test/lib/utils/update-notifier.js TAP notification situations patch to next version > no color 1`] = ` + +New patch version of npm available! 123.421.69 -> 123.421.70 +Changelog: +Run \`npm install -g npm@123.421.70\` to update! + +` diff --git a/deps/npm/tap-snapshots/test-lib-view.js-TAP.test.js b/deps/npm/tap-snapshots/test-lib-view.js-TAP.test.js new file mode 100644 index 00000000000000..f8a9fe464df2a0 --- /dev/null +++ b/deps/npm/tap-snapshots/test-lib-view.js-TAP.test.js @@ -0,0 +1,272 @@ +/* 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/view.js TAP should log info by field name array field - 1 element > must match snapshot 1`] = ` + +claudia +` + +exports[`test/lib/view.js TAP should log info by field name array field - 2 elements > must match snapshot 1`] = ` + +maintainers[0].name = 'claudia' +maintainers[1].name = 'isaacs' +` + +exports[`test/lib/view.js TAP should log info by field name maintainers with email > must match snapshot 1`] = ` + +{ + "maintainers": [ + { + "name": "claudia", + "email": "c@yellow.com", + "twitter": "cyellow" + }, + { + "name": "isaacs", + "email": "i@yellow.com", + "twitter": "iyellow" + } + ], + "name": "yellow" +} +` + +exports[`test/lib/view.js TAP should log info by field name maintainers with url > must match snapshot 1`] = ` + +[ + "claudia (http://c.pink.com)", + "isaacs (http://i.pink.com)" +] +` + +exports[`test/lib/view.js TAP should log info by field name nested field with brackets > must match snapshot 1`] = ` + +"123" +` + +exports[`test/lib/view.js TAP should log info by field name readme > must match snapshot 1`] = ` + +a very useful readme +` + +exports[`test/lib/view.js TAP should log info by field name several fields > must match snapshot 1`] = ` + +{ + "name": "yellow", + "version": "1.0.0" +} +` + +exports[`test/lib/view.js TAP should log info by field name several fields with several versions > must match snapshot 1`] = ` + +yellow@1.0.0 'claudia' +yellow@1.0.1 'claudia' +yellow@1.0.2 'claudia' +` + +exports[`test/lib/view.js TAP should log info of package in current working dir non-specific version > must match snapshot 1`] = ` + + +blue@1.0.0 | Proprietary | deps: none | versions: 2 + +dist +.tarball:http://hm.blue.com/1.0.0.tgz +.shasum:123 +.integrity:--- +.unpackedSize:1 B + +dist-tags: + + +published a year ago +` + +exports[`test/lib/view.js TAP should log info of package in current working dir specific version > must match snapshot 1`] = ` + + +blue@1.0.0 | Proprietary | deps: none | versions: 2 + +dist +.tarball:http://hm.blue.com/1.0.0.tgz +.shasum:123 +.integrity:--- +.unpackedSize:1 B + +dist-tags: + + +published a year ago +` + +exports[`test/lib/view.js TAP should log package info package with --json and semver range > must match snapshot 1`] = ` + +[ + { + "_npmUser": "claudia ", + "name": "cyan", + "dist-tags": {}, + "versions": [ + "1.0.0", + "1.0.1" + ], + "version": "1.0.0", + "dist": { + "shasum": "123", + "tarball": "http://hm.cyan.com/1.0.0.tgz", + "integrity": "---", + "fileCount": 1, + "unpackedSize": 1 + } + }, + { + "_npmUser": "claudia ", + "name": "cyan", + "dist-tags": {}, + "versions": [ + "1.0.0", + "1.0.1" + ] + } +] +` + +exports[`test/lib/view.js TAP should log package info package with homepage > must match snapshot 1`] = ` + + +orange@1.0.0 | Proprietary | deps: none | versions: 2 +http://hm.orange.com + +dist +.tarball:http://hm.orange.com/1.0.0.tgz +.shasum:123 +.integrity:--- +.unpackedSize:1 B + +dist-tags: +latest: 1.0.0 +` + +exports[`test/lib/view.js TAP should log package info package with license, bugs, repository and other fields > must match snapshot 1`] = ` + + +green@1.0.0 | ACME | deps: 2 | versions: 2 +green is a very important color + +DEPRECATED!! - true + +keywords:colors, green, crayola + +bin:green + +dist +.tarball:http://hm.green.com/1.0.0.tgz +.shasum:123 +.integrity:--- +.unpackedSize:1 B + +dependencies: +red: 1.0.0 +yellow: 1.0.0 + +maintainers: +-claudia <c@yellow.com> +-isaacs <i@yellow.com> + +dist-tags: +latest: 1.0.0 +` + +exports[`test/lib/view.js TAP should log package info package with maintainers info as object > must match snapshot 1`] = ` + + +pink@1.0.0 | Proprietary | deps: none | versions: 2 + +dist +.tarball:http://hm.pink.com/1.0.0.tgz +.shasum:123 +.integrity:--- +.unpackedSize:1 B + +dist-tags: +latest: 1.0.0 +` + +exports[`test/lib/view.js TAP should log package info package with more than 25 deps > must match snapshot 1`] = ` + + +black@1.0.0 | Proprietary | deps: 25 | versions: 2 + +dist +.tarball:http://hm.black.com/1.0.0.tgz +.shasum:123 +.integrity:--- +.unpackedSize:1 B + +dependencies: +0: 1.0.0 +10: 1.0.0 +11: 1.0.0 +12: 1.0.0 +13: 1.0.0 +14: 1.0.0 +15: 1.0.0 +16: 1.0.0 +17: 1.0.0 +18: 1.0.0 +19: 1.0.0 +1: 1.0.0 +20: 1.0.0 +21: 1.0.0 +22: 1.0.0 +23: 1.0.0 +2: 1.0.0 +3: 1.0.0 +4: 1.0.0 +5: 1.0.0 +6: 1.0.0 +7: 1.0.0 +8: 1.0.0 +9: 1.0.0 +(...and 1 more.) + +dist-tags: +latest: 1.0.0 +` + +exports[`test/lib/view.js TAP should log package info package with no modified time > must match snapshot 1`] = ` + + +cyan@1.0.0 | Proprietary | deps: none | versions: 2 + +dist +.tarball:http://hm.cyan.com/1.0.0.tgz +.shasum:123 +.integrity:--- +.unpackedSize:1 B + +dist-tags: + + +published by claudia <claudia@cyan.com> +` + +exports[`test/lib/view.js TAP should log package info package with no repo or homepage > must match snapshot 1`] = ` + + +blue@1.0.0 | Proprietary | deps: none | versions: 2 + +dist +.tarball:http://hm.blue.com/1.0.0.tgz +.shasum:123 +.integrity:--- +.unpackedSize:1 B + +dist-tags: + + +published a year ago +` diff --git a/deps/npm/tap-snapshots/test-tap-fund.js-TAP.test.js b/deps/npm/tap-snapshots/test-tap-fund.js-TAP.test.js deleted file mode 100644 index 963c59f3e12861..00000000000000 --- a/deps/npm/tap-snapshots/test-tap-fund.js-TAP.test.js +++ /dev/null @@ -1,74 +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/tap/fund.js TAP fund containing multi-level nested deps with no funding > should omit dependencies with no funding declared 1`] = ` -nested-no-funding-packages@1.0.0 -+-- https://example.com/lorem -| \`-- lorem@1.0.0 -+-- http://example.com/donate -| \`-- bar@1.0.0 -\`-- https://example.com/sponsor - \`-- sub-bar@1.0.0 - - -` - -exports[`test/tap/fund.js TAP fund does not support global > should throw EFUNDGLOBAL error 1`] = ` - -` - -exports[`test/tap/fund.js TAP fund does not support global > should write error msgs to stderr 1`] = ` -npm ERR! code EFUNDGLOBAL -npm ERR! \`npm fund\` does not support global packages -` - -exports[`test/tap/fund.js TAP fund does not support global, using --json option > should write error msgs to stderr 1`] = ` -npm ERR! code EFUNDGLOBAL -npm ERR! \`npm fund\` does not support global packages -` - -exports[`test/tap/fund.js TAP fund in which same maintainer owns all its deps > should print stack packages together 1`] = ` -maintainer-owns-all-deps@1.0.0 -\`-- http://example.com/donate - \`-- dep-bar@1.0.0, dep-foo@1.0.0, dep-sub-foo@1.0.0 - - -` - -exports[`test/tap/fund.js TAP fund using nested packages with multiple sources > should prompt with all available URLs 1`] = ` -1: Funding available at the following URL: https://one.example.com -2: Funding available at the following URL: https://two.example.com -Run \`npm fund [<@scope>/] --which=1\`, for example, to open the first funding URL listed in that package - -` - -exports[`test/tap/fund.js TAP fund using nested packages with multiple sources, with a source number > should open the numbered URL 1`] = ` -Funding available at the following URL: - -https://one.example.com - -` - -exports[`test/tap/fund.js TAP fund using package argument with no browser > should open funding url 1`] = ` -individual funding available at the following URL: - -http://example.com/donate - -` - -exports[`test/tap/fund.js TAP fund using string shorthand > should open string-only url 1`] = ` -Funding available at the following URL: - -https://example.com/sponsor - -` - -exports[`test/tap/fund.js TAP fund with no package containing funding > should print empty funding info 1`] = ` -no-funding-package@0.0.0 - - -` diff --git a/deps/npm/test/bin/npm-cli.js b/deps/npm/test/bin/npm-cli.js new file mode 100644 index 00000000000000..b68d29185873ae --- /dev/null +++ b/deps/npm/test/bin/npm-cli.js @@ -0,0 +1,10 @@ +const t = require('tap') +const requireInject = require('require-inject') +t.test('loading the bin calls the implementation', t => { + requireInject('../../bin/npm-cli.js', { + '../../lib/cli.js': proc => { + t.equal(proc, process, 'called implementation with process object') + t.end() + } + }) +}) diff --git a/deps/npm/test/bin/npx-cli.js b/deps/npm/test/bin/npx-cli.js new file mode 100644 index 00000000000000..fc85f636683822 --- /dev/null +++ b/deps/npm/test/bin/npx-cli.js @@ -0,0 +1,95 @@ +const t = require('tap') +const requireInject = require('require-inject') +const npx = require.resolve('../../bin/npx-cli.js') +const cli = require.resolve('../../lib/cli.js') +const npm = require.resolve('../../bin/npm-cli.js') + +const logs = [] +console.error = (...msg) => logs.push(msg) + +t.afterEach(cb => { + logs.length = 0 + cb() +}) + +t.test('npx foo -> npm exec -- foo', t => { + process.argv = ['node', npx, 'foo'] + requireInject(npx, { [cli]: () => {} }) + t.strictSame(process.argv, ['node', npm, 'exec', '--', 'foo']) + t.end() +}) + +t.test('npx -- foo -> npm exec -- foo', t => { + process.argv = ['node', npx, '--', 'foo'] + requireInject(npx, { [cli]: () => {} }) + t.strictSame(process.argv, ['node', npm, 'exec', '--', 'foo']) + t.end() +}) + +t.test('npx -x y foo -z -> npm exec -x y -- foo -z', t => { + process.argv = ['node', npx, '-x', 'y', 'foo', '-z'] + requireInject(npx, { [cli]: () => {} }) + t.strictSame(process.argv, ['node', npm, 'exec', '-x', 'y', '--', 'foo', '-z']) + t.end() +}) + +t.test('npx --x=y --no-install foo -z -> npm exec --x=y -- foo -z', t => { + process.argv = ['node', npx, '--x=y', '--no-install', 'foo', '-z'] + requireInject(npx, { [cli]: () => {} }) + t.strictSame(process.argv, ['node', npm, 'exec', '--x=y', '--yes=false', '--', 'foo', '-z']) + t.end() +}) + +t.test('transform renamed options into proper values', t => { + process.argv = ['node', npx, '-y', '--shell=bash', '-p', 'foo', '-c', 'asdf'] + requireInject(npx, { [cli]: () => {} }) + t.strictSame(process.argv, ['node', npm, 'exec', '--yes', '--script-shell=bash', '--package', 'foo', '--call', 'asdf']) + t.end() +}) + +// warn if deprecated switches/options are used +t.test('use a bunch of deprecated switches and options', t => { + process.argv = [ + 'node', + npx, + '--npm', + '/some/npm/bin', + '--node-arg=--harmony', + '-n', + '--require=foobar', + '--reg=http://localhost:12345/', + '-p', + 'foo', + '--always-spawn', + '--shell-auto-fallback', + '--ignore-existing', + '-q', + 'foobar' + ] + + const expect = [ + 'node', + npm, + 'exec', + '--registry', + 'http://localhost:12345/', + '--package', + 'foo', + '--loglevel', + 'warn', + '--', + 'foobar' + ] + requireInject(npx, { [cli]: () => {} }) + t.strictSame(process.argv, expect) + t.strictSame(logs, [ + [ 'npx: the --npm argument has been removed.' ], + [ 'npx: the --node-arg argument has been removed.' ], + [ 'npx: the --n argument has been removed.' ], + [ 'npx: the --always-spawn argument has been removed.' ], + [ 'npx: the --shell-auto-fallback argument has been removed.' ], + [ 'npx: the --ignore-existing argument has been removed.' ], + [ 'See `npm help exec` for more information' ] + ]) + t.end() +}) diff --git a/deps/npm/test/common-config.js b/deps/npm/test/common-config.js deleted file mode 100644 index 003150335483a3..00000000000000 --- a/deps/npm/test/common-config.js +++ /dev/null @@ -1,90 +0,0 @@ -if (module === require.main) { - console.log('1..1') - console.log('ok 1 setup done') - process.exit(0) -} - -var fs = require('graceful-fs') -var path = require('path') -var userconfigSrc = path.resolve(__dirname, 'fixtures', 'config', 'userconfig') -exports.userconfig = userconfigSrc + '-with-gc' -exports.globalconfig = path.resolve(__dirname, 'fixtures', 'config', 'globalconfig') - -// if this hasn't been written yet, then do it now. -try { - fs.statSync(exports.userconfig) -} catch (er) { - var uc = fs.readFileSync(userconfigSrc) - var gcini = 'globalconfig = ' + exports.globalconfig + '\n' - // atomic! - fs.writeFileSync(exports.userconfig + '.' + process.pid, gcini + uc) - fs.renameSync(exports.userconfig + '.' + process.pid, exports.userconfig) -} - -exports.builtin = path.resolve(__dirname, 'fixtures', 'config', 'builtin') -exports.malformed = path.resolve(__dirname, 'fixtures', 'config', 'malformed') -exports.ucData = - { globalconfig: exports.globalconfig, - email: 'i@izs.me', - 'env-thing': 'asdf', - 'init.author.name': 'Isaac Z. Schlueter', - 'init.author.email': 'i@izs.me', - 'init.author.url': 'http://blog.izs.me/', - 'init.version': '1.2.3', - 'npm:publishtest': true, - '_npmjs.org:couch': 'https://admin:password@localhost:5984/registry', - 'npm-www:nocache': '1', - nodedir: '/Users/isaacs/dev/js/node-v0.8', - 'sign-git-tag': true, - message: 'v%s', - 'strict-ssl': false, - 'tmp': path.normalize(process.env.HOME + '/.tmp'), - _auth: 'dXNlcm5hbWU6cGFzc3dvcmQ=', - _token: - { AuthSession: 'yabba-dabba-doodle', - version: '1', - expires: '1345001053415', - path: '/', - httponly: true } } - -// set the userconfig in the env -// unset anything else that npm might be trying to foist on us -Object.keys(process.env).forEach(function (k) { - if (k.match(/^npm_config_/i)) { - delete process.env[k] - } -}) -process.env.npm_config_userconfig = exports.userconfig -process.env.npm_config_other_env_thing = '1000' -process.env.random_env_var = 'asdf' -process.env.npm_config__underbar_env_thing = 'underful' -process.env.NPM_CONFIG_UPPERCASE_ENV_THING = '42' - -exports.envData = { - userconfig: exports.userconfig, - '_underbar-env-thing': 'underful', - 'uppercase-env-thing': '42', - 'other-env-thing': '1000' -} -exports.envDataFix = { - userconfig: exports.userconfig, - '_underbar-env-thing': 'underful', - 'uppercase-env-thing': 42, - 'other-env-thing': 1000 -} - -var projectConf = path.resolve(__dirname, '..', '.npmrc') -try { - fs.statSync(projectConf) -} catch (er) { - // project conf not found, probably working with packed npm - fs.writeFileSync(projectConf, '') -} - -var projectRc = path.join(__dirname, 'fixtures', 'config', '.npmrc') -try { - fs.statSync(projectRc) -} catch (er) { - // project conf not found, probably working with packed npm - fs.writeFileSync(projectRc, 'just = testing') -} diff --git a/deps/npm/test/common-tap.js b/deps/npm/test/common-tap.js deleted file mode 100644 index 4ba92973ccfb2a..00000000000000 --- a/deps/npm/test/common-tap.js +++ /dev/null @@ -1,290 +0,0 @@ -'use strict' -/* eslint-disable camelcase */ - -const configCommon = require('./common-config.js') -var fs = require('graceful-fs') -var readCmdShim = require('read-cmd-shim') -var isWindows = require('../lib/utils/is-windows.js') -var Bluebird = require('bluebird') - -if (isWindows) { - var PATH = process.env.PATH ? 'PATH' : 'Path' - process.env[PATH] += ';C:\\Program Files\\Git\\mingw64\\libexec\\git-core' -} - -// remove any git envs so that we don't mess with the main repo -// when running git subprocesses in tests -Object.keys(process.env).filter(k => /^GIT/.test(k)).forEach( - k => delete process.env[k] -) - -// cheesy hackaround for test deps (read: nock) that rely on setImmediate -if (!global.setImmediate || !require('timers').setImmediate) { - require('timers').setImmediate = global.setImmediate = function () { - var args = [arguments[0], 0].concat([].slice.call(arguments, 1)) - setTimeout.apply(this, args) - } -} - -var spawn = require('child_process').spawn -const spawnSync = require('child_process').spawnSync -var path = require('path') - -// space these out to help prevent collisions -const testId = 3 * (+process.env.TAP_CHILD_ID || 0) - -// provide a working dir unique to each test -const main = require.main.filename -const testName = path.basename(main, '.js') -exports.pkg = path.resolve(path.dirname(main), testName) -var commonCache = path.resolve(__dirname, 'npm_cache_' + testName) -exports.cache = commonCache - -const mkdirp = require('mkdirp') -const rimraf = require('rimraf') -rimraf.sync(exports.pkg) -rimraf.sync(commonCache) -mkdirp.sync(exports.pkg) -mkdirp.sync(commonCache) -// if we're in sudo mode, make sure that the cache is not root-owned -const isRoot = process.getuid && process.getuid() === 0 -const isSudo = isRoot && process.env.SUDO_UID && process.env.SUDO_GID -if (isSudo) { - const sudoUid = +process.env.SUDO_UID - const sudoGid = +process.env.SUDO_GID - fs.chownSync(commonCache, sudoUid, sudoGid) -} - -const returnCwd = path.dirname(__dirname) -const find = require('which').sync('find') -require('tap').teardown(() => { - // work around windows folder locking - process.chdir(returnCwd) - process.on('exit', () => { - try { - if (isSudo) { - // running tests as sudo. ensure we didn't leave any root-owned - // files in the cache by mistake. - const args = [ commonCache, '-uid', '0' ] - const found = spawnSync(find, args) - const output = found && found.stdout && found.stdout.toString() - if (output.length) { - const er = new Error('Root-owned files left in cache!') - er.testName = main - er.files = output.trim().split('\n') - throw er - } - } - if (!process.env.NO_TEST_CLEANUP) { - rimraf.sync(exports.pkg) - rimraf.sync(commonCache) - } - } catch (e) { - if (process.platform !== 'win32') { - throw e - } - } - }) -}) - -var port = exports.port = 15443 + testId -exports.registry = 'http://localhost:' + port - -exports.altPort = 7331 + testId - -exports.gitPort = 4321 + testId - -var fakeRegistry = require('./fake-registry.js') -exports.fakeRegistry = fakeRegistry - -const ourenv = {} -ourenv.npm_config_loglevel = 'error' -ourenv.npm_config_progress = 'false' -ourenv.npm_config_metrics = 'false' -ourenv.npm_config_audit = 'false' - -ourenv.npm_config_unsafe_perm = 'true' -ourenv.npm_config_cache = commonCache -ourenv.npm_config_userconfig = exports.npm_config_userconfig = configCommon.userconfig -ourenv.npm_config_globalconfig = exports.npm_config_globalconfig = configCommon.globalconfig -ourenv.npm_config_global_style = 'false' -ourenv.npm_config_legacy_bundling = 'false' -ourenv.npm_config_fetch_retries = '0' -ourenv.npm_config_update_notifier = 'false' -ourenv.random_env_var = 'foo' -// suppress warnings about using a prerelease version of node -ourenv.npm_config_node_version = process.version.replace(/-.*$/, '') -for (let key of Object.keys(ourenv)) process.env[key] = ourenv[key] - -var bin = exports.bin = require.resolve('../bin/npm-cli.js') - -var chain = require('slide').chain -var once = require('once') - -var nodeBin = exports.nodeBin = process.env.npm_node_execpath || process.env.NODE || process.execPath - -exports.npm = function (cmd, opts, cb) { - if (!cb) { - var prom = new Bluebird((resolve, reject) => { - cb = function (err, code, stdout, stderr) { - if (err) return reject(err) - return resolve([code, stdout, stderr]) - } - }) - } - cb = once(cb) - cmd = [bin].concat(cmd) - opts = Object.assign({}, opts || {}) - - opts.env = opts.env || process.env - if (opts.env._storage) opts.env = Object.assign({}, opts.env._storage) - if (!opts.env.npm_config_cache) { - opts.env.npm_config_cache = commonCache - } - if (!opts.env.npm_config_unsafe_perm) { - opts.env.npm_config_unsafe_perm = 'true' - } - if (!opts.env.npm_config_send_metrics) { - opts.env.npm_config_send_metrics = 'false' - } - if (!opts.env.npm_config_audit) { - opts.env.npm_config_audit = 'false' - } - - nodeBin = opts.nodeExecPath || nodeBin - - var stdout = '' - var stderr = '' - var child = spawn(nodeBin, cmd, opts) - - if (child.stderr) { - child.stderr.on('data', function (chunk) { - stderr += chunk - }) - } - - if (child.stdout) { - child.stdout.on('data', function (chunk) { - stdout += chunk - }) - } - - child.on('error', cb) - - child.on('close', function (code) { - cb(null, code, stdout, stderr) - }) - return prom || child -} - -exports.makeGitRepo = function (params, cb) { - // git must be called after npm.load because it uses config - var git = require('../lib/utils/git.js') - - var root = params.path || process.cwd() - var user = params.user || 'PhantomFaker' - var email = params.email || 'nope@not.real' - var added = params.added || ['package.json'] - var message = params.message || 'stub repo' - - var opts = { cwd: root, env: { PATH: process.env.PATH || process.env.Path } } - var commands = [ - git.chainableExec(['init'], opts), - git.chainableExec(['config', 'user.name', user], opts), - git.chainableExec(['config', 'user.email', email], opts), - // don't time out tests waiting for a gpg passphrase or 2fa - git.chainableExec(['config', 'commit.gpgSign', 'false'], opts), - git.chainableExec(['config', 'tag.gpgSign', 'false'], opts), - git.chainableExec(['config', 'tag.forceSignAnnotated', 'false'], opts), - git.chainableExec(['add'].concat(added), opts), - git.chainableExec(['commit', '-m', message], opts) - ] - - if (Array.isArray(params.commands)) { - commands = commands.concat(params.commands) - } - - chain(commands, cb) -} - -exports.readBinLink = function (path) { - if (isWindows) { - return readCmdShim.sync(path) - } else { - return fs.readlinkSync(path) - } -} - -exports.skipIfWindows = function (why) { - if (!isWindows) return - if (!why) why = 'this test not available on windows' - require('tap').plan(0, why) - process.exit(0) -} - -exports.pendIfWindows = function (why) { - if (!isWindows) return - if (!why) why = 'this test is pending further changes on windows' - require('tap').fail(' ', { todo: why, diagnostic: false }) - process.exit(0) -} - -exports.withServer = cb => { - return fakeRegistry.compat().tap(cb).then(server => server.close()) -} - -exports.newEnv = function () { - return new Environment(process.env) -} - -exports.emptyEnv = function () { - const filtered = {} - for (let key of Object.keys(process.env)) { - if (!/^npm_/.test(key)) filtered[key] = process.env[key] - } - for (let key of Object.keys(ourenv)) { - filtered[key] = ourenv[key] - } - return new Environment(filtered) -} - -function Environment (env) { - if (env instanceof Environment) return env.clone() - - Object.defineProperty(this, '_storage', { - value: Object.assign({}, env) - }) -} -Environment.prototype = {} - -Environment.prototype.delete = function (key) { - var args = Array.isArray(key) ? key : arguments - var ii - for (ii = 0; ii < args.length; ++ii) { - delete this._storage[args[ii]] - } - return this -} - -Environment.prototype.clone = function () { - return new Environment(this._storage) -} - -Environment.prototype.extend = function (env) { - var self = this.clone() - var args = Array.isArray(env) ? env : arguments - var ii - for (ii = 0; ii < args.length; ++ii) { - var arg = args[ii] - if (!arg) continue - Object.keys(arg).forEach(function (name) { - self._storage[name] = arg[name] - }) - } - return self -} - -var reEscape = /[\\[\](){}*?+.^$|]/g -exports.escapeForRe = function (string) { - return string.replace(reEscape, '\\$&') -} diff --git a/deps/npm/test/coverage-map.js b/deps/npm/test/coverage-map.js new file mode 100644 index 00000000000000..cb2670129e9c09 --- /dev/null +++ b/deps/npm/test/coverage-map.js @@ -0,0 +1,18 @@ +'use strict' + +const full = process.env.npm_lifecycle_event === 'check-coverage' +const coverageMap = (filename) => { + if (full && /load-all.js$/.test(filename)) { + const glob = require('glob') + const { resolve, relative } = require('path') + const dir = resolve(__dirname, '../lib') + return glob.sync(`${dir}/**/*.js`) + .map(f => relative(process.cwd(), f)) + } + if (/^test\/(lib|bin)\//.test(filename)) { + return filename.replace(/^test\//, '') + } + return [] +} + +module.exports = coverageMap diff --git a/deps/npm/test/fake-registry.js b/deps/npm/test/fake-registry.js deleted file mode 100644 index e09e154c76514e..00000000000000 --- a/deps/npm/test/fake-registry.js +++ /dev/null @@ -1,156 +0,0 @@ -'use strict' -const common = require('./common-tap.js') -const Bluebird = require('bluebird') -const silentLogger = { - http: () => {}, - silly: () => {} -} - -const log = process.env.TAP_CHILD_ID - ? silentLogger - : require('npmlog') - -const http = require('http') -const EventEmitter = require('events') -// See fake-registry.md for details - -class FakeRegistry extends EventEmitter { - constructor (opts) { - if (!opts) opts = {} - super(opts) - this.mocks = {} - this.port = opts.port || common.port - this.registry = 'http://localhost:' + this.port - this.server = http.createServer() - if (!opts.keepNodeAlive) this.server.unref() - this.server.on('request', (req, res) => { - if (this.mocks[req.method] && this.mocks[req.method][req.url]) { - this.mocks[req.method][req.url](req, res) - } else { - res.statusCode = 404 - res.end(JSON.stringify({error: 'not found'})) - } - log.http('fake-registry', res.statusCode || 'unknown', '→', req.method, req.url) - }) - this._error = err => { - log.silly('fake-registry', err) - this.emit('error', err) - } - this._addErrorHandler() - } - reset () { - this.mocks = {} - return this - } - close () { - this.reset() - this._removeErrorHandler() - return new Promise((resolve, reject) => { - this.server.once('error', reject) - this.server.once('close', () => { - this.removeListener('error', reject) - resolve(this) - }) - this.server.close() - }) - } - _addErrorHandler () { - this.server.on('error', this._error) - } - _removeErrorHandler () { - if (!this._error) return - this.server.removeListener('error', this._error) - } - listen (cb) { - this._removeErrorHandler() - return this._findPort(this.port).then(port => { - this._addErrorHandler() - this.port = port - this.registry = 'http://localhost:' + port - common.port = this.port - common.registry = this.registry - return this - }).asCallback(cb) - } - _findPort (port) { - return new Bluebird((resolve, reject) => { - let onListening - const onError = err => { - this.server.removeListener('listening', onListening) - if (err.code === 'EADDRINUSE') { - return resolve(this._findPort(++port)) - } else { - return reject(err) - } - } - onListening = () => { - this.server.removeListener('error', onError) - resolve(port) - } - this.server.once('error', onError) - this.server.once('listening', onListening) - this.server.listen(port) - }) - } - - mock (method, url, respondWith) { - log.http('fake-registry', 'mock', method, url, respondWith) - if (!this.mocks[method]) this.mocks[method] = {} - if (typeof respondWith === 'function') { - this.mocks[method][url] = respondWith - } else if (Array.isArray(respondWith)) { - const [status, body] = respondWith - this.mocks[method][url] = (req, res) => { - res.statusCode = status - if (typeof body === 'object') { - res.end(JSON.stringify(body)) - } else { - res.end(String(body)) - } - } - } else { - throw new Error('Invalid args, expected: mr.mock(method, url, [status, body])') - } - return this - } - - // compat - done () { - this.reset() - } - filteringRequestBody () { - return this - } - post (url, matchBody) { - return this._createReply('POST', url) - } - get (url) { - return this._createReply('GET', url) - } - put (url, matchBody) { - return this._createReply('PUT', url) - } - delete (url) { - return this._createReply('DELETE', url) - } - _createReply (method, url) { - const mr = this - return { - twice: function () { return this }, - reply: function (status, responseBody) { - mr.mock(method, url, [status, responseBody]) - return mr - } - } - } -} - -module.exports = new FakeRegistry() -module.exports.FakeRegistry = FakeRegistry -module.exports.compat = function (opts, cb) { - if (arguments.length === 1 && typeof opts === 'function') { - cb = opts - opts = {} - } - return new FakeRegistry(Object.assign({keepNodeAlive: true}, opts || {})).listen(cb) -} diff --git a/deps/npm/test/fake-registry.md b/deps/npm/test/fake-registry.md deleted file mode 100644 index 604fda41670bec..00000000000000 --- a/deps/npm/test/fake-registry.md +++ /dev/null @@ -1,198 +0,0 @@ -# FakeRegistry - -This is a replacement for npm-registry-mock in times where its fixtures are -not used. (Adding support for its standard fixtures is TODO, but should be -straightforward—tacks-ify them and call `mr.mock…` - -# Usage - -The intent is for this to be a drop in replacement for npm-registry-mock -(and by extension hock). New scripts will be better served using its native -interface, however. - -# Main Interface - -## Logging - -All requests the mock registry receives are logged at the `http` level. You can -see these by running your tests with: - -``` -npm --loglevel=http run tap test/tap/name-of-test.js -``` - -Or directly with: - -``` -npm_config_loglevel=http node test/tap/name-of-test.js -``` - -## Construction - -Ordinarily there's no reason to construct more than one FakeRegistyr object -at a time, as it can be entirely reset between tests, so best practice -would be to use its singleton. - -``` -const common = require('../common-tap.js') -const mr = common.fakeRegistry -``` - -If you have need of multiple registries at the same time, you can construct -them by hand: - -``` -const common = require('../common-tap.js') -const FakeRegistry = common.fakeRegistry.FakeRegistry -const mr = new FakeRegistry(opts) -``` - -## new FakeRegistry(opts) - -Valid options are: - -* `opts.port` is the first port to try when looking for an available port. If it - is unavialable it will be incremented until one available is found. - - The default value of `port` is taken from `common.npm`. - -* `opts.keepNodeAlive` will instruct FakeRegistry to not unref the - underlying server. - -## mr.reset() → this - -Reset all mocks to their default values. Further requests - -## mr.listen() → Promise(mr) - -Start listening for connections. The promise resolves when the server is -online and ready to accept connections. - -`mr.port` and `mr.registry` contain the port that was actually selected. - -To ease compatibility, `common` will also have its `port` and `registry` -values updated at this time. Note that this means `common.port` refers -to the port of the most recent listening server. Each server will maintain -its own `mr.port`. - -Any errors emitted by the server while it was coming online will result in a -promise rejection. - -## mr.mock(method, url, respondWith) → this - -Adds a new route that matches `method` (should be all caps) and `url`. - -`respondWith` can be: - -* A function, that takes `(request, response)` as arguments and calls - [`response` methods](https://nodejs.org/api/http.html#http_class_http_serverresponse) - to do what it wants. Does not have a return value. This function may be - async (the response isn't complete till its stream completes), typically - either because you piped something into it or called `response.end()`. -* An array of `[statusCode, responseBody]`. `responseBody` may be a string or - an object. Objects are serialized with `JSON.stringify`. - -## mr.close() → Promise(mr) - -Calls `mr.reset()` to clear the mocks. - -Calls `.close()` on the http server. The promise resolves when the http -server completes closing. Any errors while the http server was closing will -result in a rejection. If running with `keepNodeAlive` set this call -is required for node to exit the event loop. - -# Events - -## mr.on('error', err => { … }) - -Error events from the http server are forwarded to the associated fake -registry instance. - -The exception to this is while the `mr.listen()` and `mr.close()` promises -are waiting to complete. Those promises capture any errors during their duration -and turn them into rejections. (Errors during those phases are very rare.) - -# Compat Interface - -## Differences - -### Ports - -You aren't guaranteed to get the port you ask for. If the port you asked -for is in use, it will be incremented until an available port is found. - -`server.port` and `server.registry` contain the port that was actually selected. - -For compatibility reasons: - -`common.port` and `common.registry` will contain the port of the most recent -instance of FakeRegistry. Usually these there is only one instance and so -this has the same value as the per-server attributes. - -This means that if your fixtures make use of the port or server address they -need to be configured _after_ you construct - -### Request Bodies - -Request bodies are NOT matched against. Two routes for the same URL but different -request bodies will overwrite one another. - -### Call Count Assertions - -That is, things like `twice()` that assert that the end point will be hit -two times are not supported. This library does not provide any assertions, -just a barebones http server. - -### Default Route Behavior - -If no route can be found then a `404` response will be provided. - -## Construction - -const common = require('../common-tap.js') -const mr = common.fakeRegistry.compat - -### mr(options[, callback]) → Promise(server) - -Construct a new mock server. Hybrid, callback/promise constructor. Options -are `port` and `keepNodeAlive`. `keepNodeAlive` defaults to `true` for -compatibility mode and the default value of port comes from `common.port`. - -### done() - -Resets all of the configured mocks. - -### close() - -Calls `this.reset()` and `this.server.close()`. To reopen this instance use -`this.listen()`. - -### filteringRequestBody() - -Does nothing. Bodies are never matched when routing anyway so this is unnecessary. - -### get(url) → MockReply -### delete(url) → MockReply -### post(url, body) → MockReply -### put(url, body) → MockReply - -Begins to add a route for an HTTP method and URL combo. Does not actually -add it till `reply()` is called on the returned object. - -Note that the body argument for post and put is always ignored. - -## MockReply methods - -### twice() → this - -Does nothing. Call count assertions are not supported. - -### reply(status, responseBody) - -Actually adds the route, set to reply with the associated status and -responseBody. - -Currently no mime-types are set. - -If `responseBody` is `typeof === 'object'` then `JSON.stringify()` will be -called on it to serialize it, otherwise `String()` will be used. diff --git a/deps/npm/test/fixtures/config/.npmrc b/deps/npm/test/fixtures/config/.npmrc deleted file mode 100644 index 7d59bd8be1b82d..00000000000000 --- a/deps/npm/test/fixtures/config/.npmrc +++ /dev/null @@ -1 +0,0 @@ -just = testing diff --git a/deps/npm/test/fixtures/config/builtin b/deps/npm/test/fixtures/config/builtin deleted file mode 100644 index dcd542c0ceacf4..00000000000000 --- a/deps/npm/test/fixtures/config/builtin +++ /dev/null @@ -1 +0,0 @@ -builtin-config = true diff --git a/deps/npm/test/fixtures/config/globalconfig b/deps/npm/test/fixtures/config/globalconfig deleted file mode 100644 index 41c0b70c80f053..00000000000000 --- a/deps/npm/test/fixtures/config/globalconfig +++ /dev/null @@ -1 +0,0 @@ -package-config:foo = boo diff --git a/deps/npm/test/fixtures/config/malformed b/deps/npm/test/fixtures/config/malformed deleted file mode 100644 index 182c4d2c71ce2d..00000000000000 --- a/deps/npm/test/fixtures/config/malformed +++ /dev/null @@ -1 +0,0 @@ -email = """ \ No newline at end of file diff --git a/deps/npm/test/fixtures/config/multi-ca b/deps/npm/test/fixtures/config/multi-ca deleted file mode 100644 index 0bc922b25c59ad..00000000000000 --- a/deps/npm/test/fixtures/config/multi-ca +++ /dev/null @@ -1,32 +0,0 @@ ------BEGIN CERTIFICATE----- -MIICjTCCAfigAwIBAgIEMaYgRzALBgkqhkiG9w0BAQQwRTELMAkGA1UEBhMCVVMx -NjA0BgNVBAoTLU5hdGlvbmFsIEFlcm9uYXV0aWNzIGFuZCBTcGFjZSBBZG1pbmlz -dHJhdGlvbjAmFxE5NjA1MjgxMzQ5MDUrMDgwMBcROTgwNTI4MTM0OTA1KzA4MDAw -ZzELMAkGA1UEBhMCVVMxNjA0BgNVBAoTLU5hdGlvbmFsIEFlcm9uYXV0aWNzIGFu -ZCBTcGFjZSBBZG1pbmlzdHJhdGlvbjEgMAkGA1UEBRMCMTYwEwYDVQQDEwxTdGV2 -ZSBTY2hvY2gwWDALBgkqhkiG9w0BAQEDSQAwRgJBALrAwyYdgxmzNP/ts0Uyf6Bp -miJYktU/w4NG67ULaN4B5CnEz7k57s9o3YY3LecETgQ5iQHmkwlYDTL2fTgVfw0C -AQOjgaswgagwZAYDVR0ZAQH/BFowWDBWMFQxCzAJBgNVBAYTAlVTMTYwNAYDVQQK -Ey1OYXRpAAAAACBBZXJvbmF1dGljcyBhbmQgU3BhY2UgQWRtaW5pc3RyYXRpb24x -DTALBgNVBAMTBENSTDEwFwYDVR0BAQH/BA0wC4AJODMyOTcwODEwMBgGA1UdAgQR -MA8ECTgzMjk3MDgyM4ACBSAwDQYDVR0KBAYwBAMCBkAwCwYJKoZIhvcNAQEEA4GB -AH2y1VCEw/A4zaXzSYZJTTUi3uawbbFiS2yxHvgf28+8Js0OHXk1H1w2d6qOHH21 -X82tZXd/0JtG0g1T9usFFBDvYK8O0ebgz/P5ELJnBL2+atObEuJy1ZZ0pBDWINR3 -WkDNLCGiTkCKp0F5EWIrVDwh54NNevkCQRZita+z4IBO ------END CERTIFICATE----- ------BEGIN CERTIFICATE----- -AAAAAACCAfigAwIBAgIEMaYgRzALBgkqhkiG9w0BAQQwRTELMAkGA1UEBhMCVVMx -NjA0BgNVBAoTLU5hdGlvbmFsIEFlcm9uYXV0aWNzIGFuZCBTcGFjZSBBZG1pbmlz -dHJhdGlvbjAmFxE5NjA1MjgxMzQ5MDUrMDgwMBcROTgwNTI4MTM0OTA1KzA4MDAw -ZzELMAkGA1UEBhMCVVMxNjA0BgNVBAoTLU5hdGlvbmFsIEFlcm9uYXV0aWNzIGFu -ZCBTcGFjZSBBZG1pbmlzdHJhdGlvbjEgMAkGA1UEBRMCMTYwEwYDVQQDEwxTdGV2 -ZSBTY2hvY2gwWDALBgkqhkiG9w0BAQEDSQAwRgJBALrAwyYdgxmzNP/ts0Uyf6Bp -miJYktU/w4NG67ULaN4B5CnEz7k57s9o3YY3LecETgQ5iQHmkwlYDTL2fTgVfw0C -AQOjgaswgagwZAYDVR0ZAQH/BFowWDBWMFQxCzAJBgNVBAYTAlVTMTYwNAYDVQQK -Ey1OYXRpb25hbCBBZXJvbmF1dGljcyBhbmQgU3BhY2UgQWRtaW5pc3RyYXRpb24x -DTALBgNVBAMTBENSTDEwFwYDVR0BAQH/BA0wC4AJODMyOTcwODEwMBgGA1UdAgQR -MA8ECTgzMjk3MDgyM4ACBSAwDQYDVR0KBAYwBAMCBkAwCwYJKoZIhvcNAQEEA4GB -AH2y1VCEw/A4zaXzSYZJTTUi3uawbbFiS2yxHvgf28+8Js0OHXk1H1w2d6qOHH21 -X82tZXd/0JtG0g1T9usFFBDvYK8O0ebgz/P5ELJnBL2+atObEuJy1ZZ0pBDWINR3 -WkDNLCGiTkCKp0F5EWIrVDwh54NNevkCQRZita+z4IBO ------END CERTIFICATE----- diff --git a/deps/npm/test/fixtures/config/userconfig b/deps/npm/test/fixtures/config/userconfig deleted file mode 100644 index ecc2f043f7fbfd..00000000000000 --- a/deps/npm/test/fixtures/config/userconfig +++ /dev/null @@ -1,22 +0,0 @@ -email = i@izs.me -env-thing = ${random_env_var} -init.author.name = Isaac Z. Schlueter -init.author.email = i@izs.me -init.author.url = http://blog.izs.me/ -init.version = 1.2.3 -npm:publishtest = true -_npmjs.org:couch = https://admin:password@localhost:5984/registry -npm-www:nocache = 1 -nodedir = /Users/isaacs/dev/js/node-v0.8 -sign-git-tag = true -message = v%s -strict-ssl = false -tmp = ~/.tmp -_auth = dXNlcm5hbWU6cGFzc3dvcmQ= - -[_token] -AuthSession = yabba-dabba-doodle -version = 1 -expires = 1345001053415 -path = / -httponly = true diff --git a/deps/npm/test/fixtures/config/userconfig-with-gc b/deps/npm/test/fixtures/config/userconfig-with-gc deleted file mode 100644 index e2237dffc74347..00000000000000 --- a/deps/npm/test/fixtures/config/userconfig-with-gc +++ /dev/null @@ -1,23 +0,0 @@ -globalconfig = /Users/ruyadorno/Documents/workspace/cli/latest/test/fixtures/config/globalconfig -email = i@izs.me -env-thing = ${random_env_var} -init.author.name = Isaac Z. Schlueter -init.author.email = i@izs.me -init.author.url = http://blog.izs.me/ -init.version = 1.2.3 -npm:publishtest = true -_npmjs.org:couch = https://admin:password@localhost:5984/registry -npm-www:nocache = 1 -nodedir = /Users/isaacs/dev/js/node-v0.8 -sign-git-tag = true -message = v%s -strict-ssl = false -tmp = ~/.tmp -_auth = dXNlcm5hbWU6cGFzc3dvcmQ= - -[_token] -AuthSession = yabba-dabba-doodle -version = 1 -expires = 1345001053415 -path = / -httponly = true diff --git a/deps/npm/test/fixtures/eresolve-explanations.js b/deps/npm/test/fixtures/eresolve-explanations.js new file mode 100644 index 00000000000000..3b1cd41a25ebe3 --- /dev/null +++ b/deps/npm/test/fixtures/eresolve-explanations.js @@ -0,0 +1,2576 @@ +// some real-world examples of ERESOLVE error explaination objects, +// copied from arborist or generated there. +module.exports = { + cycleNested: { + code: 'ERESOLVE', + dep: { + name: '@isaacs/peer-dep-cycle-b', + version: '1.0.0', + whileInstalling: { name: '@isaacs/peer-dep-cycle-a', version: '1.0.0' }, + location: 'node_modules/@isaacs/peer-dep-cycle-b', + dependents: [ + { + type: 'peer', + spec: '1', + from: { + name: '@isaacs/peer-dep-cycle-a', + version: '1.0.0', + location: 'node_modules/@isaacs/peer-dep-cycle-a', + dependents: [ + { + type: 'prod', + spec: '1.x', + from: { location: '/some/project' } + } + ] + } + } + ] + }, + current: { + name: '@isaacs/peer-dep-cycle-c', + version: '2.0.0', + location: 'node_modules/@isaacs/peer-dep-cycle-c', + dependents: [ + { + type: 'prod', + spec: '2.x', + from: { location: '/some/project' } + } + ] + }, + peerConflict: { + name: '@isaacs/peer-dep-cycle-c', + version: '1.0.0', + whileInstalling: { name: '@isaacs/peer-dep-cycle-a', version: '1.0.0' }, + location: 'node_modules/@isaacs/peer-dep-cycle-c', + dependents: [ + { + type: 'peer', + spec: '1', + from: { + name: '@isaacs/peer-dep-cycle-b', + version: '1.0.0', + whileInstalling: { name: '@isaacs/peer-dep-cycle-a', version: '1.0.0' }, + location: 'node_modules/@isaacs/peer-dep-cycle-b', + dependents: [ + { + type: 'peer', + spec: '1', + from: { + name: '@isaacs/peer-dep-cycle-a', + version: '1.0.0', + location: 'node_modules/@isaacs/peer-dep-cycle-a', + dependents: [ + { + type: 'prod', + spec: '1.x', + from: { location: '/some/project' } + } + ] + } + } + ] + } + } + ] + }, + fixWithForce: false, + type: 'peer', + isPeer: true + }, + + withShrinkwrap: { + code: 'ERESOLVE', + dep: { + name: '@isaacs/peer-dep-cycle-c', + version: '1.0.0', + whileInstalling: { name: '@isaacs/peer-dep-cycle-b', version: '1.0.0' }, + location: 'node_modules/@isaacs/peer-dep-cycle-c', + dependents: [ + { + type: 'peer', + spec: '1', + error: 'INVALID', + from: { + name: '@isaacs/peer-dep-cycle-b', + version: '1.0.0', + location: 'node_modules/@isaacs/peer-dep-cycle-b', + dependents: [ + { + type: 'peer', + spec: '1', + from: { + name: '@isaacs/peer-dep-cycle-a', + version: '1.0.0', + location: 'node_modules/@isaacs/peer-dep-cycle-a', + dependents: [ + { + type: 'prod', + spec: '1.x', + from: { location: '/some/project' } + } + ] + } + } + ] + } + } + ] + }, + current: { + name: '@isaacs/peer-dep-cycle-c', + version: '2.0.0', + location: 'node_modules/@isaacs/peer-dep-cycle-c', + dependents: [ + { + type: 'prod', + spec: '2.x', + from: { location: '/some/project' } + } + ] + }, + fixWithForce: true, + type: 'peer' + }, + + gatsby: { + code: 'ERESOLVE', + dep: { + name: 'react', + version: '16.8.1', + whileInstalling: { + name: 'gatsby-interface', + version: '0.0.166' + }, + location: 'node_modules/react', + dependents: [ + { + type: 'peer', + spec: '16.8.1', + error: 'INVALID', + from: { + name: 'gatsby-interface', + version: '0.0.166', + location: 'node_modules/gatsby-recipes/node_modules/gatsby-interface', + dependents: [ + { + type: 'prod', + spec: '^0.0.166', + from: { + name: 'gatsby-recipes', + version: '0.2.20', + location: 'node_modules/gatsby-recipes', + dependents: [ + { + type: 'prod', + spec: '^0.2.20', + from: { + name: 'gatsby-cli', + version: '2.12.91', + location: 'node_modules/gatsby-cli', + dependents: [ + { + type: 'prod', + spec: '^2.12.91', + from: { + name: 'gatsby', + version: '2.24.53', + location: 'node_modules/gatsby', + dependents: [ + { + type: 'prod', + spec: '', + from: { + location: '/path/to/gatsby-user' + } + } + ] + } + } + ] + } + } + ] + } + } + ] + } + } + ] + }, + current: { + name: 'react', + version: '16.13.1', + location: 'node_modules/react', + dependents: [ + { + type: 'peer', + spec: '^16.4.2', + from: { + name: 'gatsby', + version: '2.24.53', + location: 'node_modules/gatsby', + dependents: [ + { + type: 'prod', + spec: '', + from: { + location: '/path/to/gatsby-user' + } + } + ] + } + }, + { + type: 'peer', + spec: '^16.13.1', + from: { + name: 'react-dom', + version: '16.13.1', + location: 'node_modules/react-dom', + dependents: [ + { + type: 'peer', + spec: '^16.4.2', + from: { + name: 'gatsby', + version: '2.24.53', + location: 'node_modules/gatsby', + dependents: [ + { + type: 'prod', + spec: '', + from: { + location: '/path/to/gatsby-user' + } + } + ] + } + }, + { + type: 'peer', + spec: '15.x || 16.x || 16.4.0-alpha.0911da3', + from: { + name: '@reach/router', + version: '1.3.4', + location: 'node_modules/@reach/router', + dependents: [ + { + type: 'prod', + spec: '^1.3.4', + from: { + name: 'gatsby', + version: '2.24.53', + location: 'node_modules/gatsby', + dependents: [ + { + type: 'prod', + spec: '', + from: { + location: '/path/to/gatsby-user' + } + } + ] + } + }, + { + type: 'peer', + spec: '^1.3.3', + from: { + name: 'gatsby-link', + version: '2.4.13', + location: 'node_modules/gatsby-link', + dependents: [ + { + type: 'prod', + spec: '^2.4.13', + from: { + name: 'gatsby', + version: '2.24.53', + location: 'node_modules/gatsby', + dependents: [ + { + type: 'prod', + spec: '', + from: { + location: '/path/to/gatsby-user' + } + } + ] + } + } + ] + } + }, + { + type: 'peer', + spec: '^1.0.0', + from: { + name: 'gatsby-react-router-scroll', + version: '3.0.12', + location: 'node_modules/gatsby-react-router-scroll', + dependents: [ + { + type: 'prod', + spec: '^3.0.12', + from: { + name: 'gatsby', + version: '2.24.53', + location: 'node_modules/gatsby', + dependents: [ + { + type: 'prod', + spec: '', + from: { + location: '/path/to/gatsby-user' + } + } + ] + } + } + ] + } + } + ] + } + }, + { + type: 'peer', + spec: '^16.4.2', + from: { + name: 'gatsby-link', + version: '2.4.13', + location: 'node_modules/gatsby-link', + dependents: [ + { + type: 'prod', + spec: '^2.4.13', + from: { + name: 'gatsby', + version: '2.24.53', + location: 'node_modules/gatsby', + dependents: [ + { + type: 'prod', + spec: '', + from: { + location: '/path/to/gatsby-user' + } + } + ] + } + } + ] + } + }, + { + type: 'peer', + spec: '^16.4.2', + from: { + name: 'gatsby-react-router-scroll', + version: '3.0.12', + location: 'node_modules/gatsby-react-router-scroll', + dependents: [ + { + type: 'prod', + spec: '^3.0.12', + from: { + name: 'gatsby', + version: '2.24.53', + location: 'node_modules/gatsby', + dependents: [ + { + type: 'prod', + spec: '', + from: { + location: '/path/to/gatsby-user' + } + } + ] + } + } + ] + } + }, + { + type: 'peer', + spec: '^15.0.0 || ^16.0.0', + from: { + name: 'react-hot-loader', + version: '4.12.21', + location: 'node_modules/react-hot-loader', + dependents: [ + { + type: 'prod', + spec: '^4.12.21', + from: { + name: 'gatsby', + version: '2.24.53', + location: 'node_modules/gatsby', + dependents: [ + { + type: 'prod', + spec: '', + from: { + location: '/path/to/gatsby-user' + } + } + ] + } + } + ] + } + } + ] + } + }, + { + type: 'peer', + spec: '15.x || 16.x || 16.4.0-alpha.0911da3', + from: { + name: '@reach/router', + version: '1.3.4', + location: 'node_modules/@reach/router', + dependents: [ + { + type: 'prod', + spec: '^1.3.4', + from: { + name: 'gatsby', + version: '2.24.53', + location: 'node_modules/gatsby', + dependents: [ + { + type: 'prod', + spec: '', + from: { + location: '/path/to/gatsby-user' + } + } + ] + } + }, + { + type: 'peer', + spec: '^1.3.3', + from: { + name: 'gatsby-link', + version: '2.4.13', + location: 'node_modules/gatsby-link', + dependents: [ + { + type: 'prod', + spec: '^2.4.13', + from: { + name: 'gatsby', + version: '2.24.53', + location: 'node_modules/gatsby', + dependents: [ + { + type: 'prod', + spec: '', + from: { + location: '/path/to/gatsby-user' + } + } + ] + } + } + ] + } + }, + { + type: 'peer', + spec: '^1.0.0', + from: { + name: 'gatsby-react-router-scroll', + version: '3.0.12', + location: 'node_modules/gatsby-react-router-scroll', + dependents: [ + { + type: 'prod', + spec: '^3.0.12', + from: { + name: 'gatsby', + version: '2.24.53', + location: 'node_modules/gatsby', + dependents: [ + { + type: 'prod', + spec: '', + from: { + location: '/path/to/gatsby-user' + } + } + ] + } + } + ] + } + } + ] + } + }, + { + type: 'prod', + spec: '^16.8.0', + from: { + name: 'gatsby-cli', + version: '2.12.91', + location: 'node_modules/gatsby-cli', + dependents: [ + { + type: 'prod', + spec: '^2.12.91', + from: { + name: 'gatsby', + version: '2.24.53', + location: 'node_modules/gatsby', + dependents: [ + { + type: 'prod', + spec: '', + from: { + location: '/path/to/gatsby-user' + } + } + ] + } + } + ] + } + }, + { + type: 'peer', + spec: '^16.4.2', + from: { + name: 'gatsby-link', + version: '2.4.13', + location: 'node_modules/gatsby-link', + dependents: [ + { + type: 'prod', + spec: '^2.4.13', + from: { + name: 'gatsby', + version: '2.24.53', + location: 'node_modules/gatsby', + dependents: [ + { + type: 'prod', + spec: '', + from: { + location: '/path/to/gatsby-user' + } + } + ] + } + } + ] + } + }, + { + type: 'peer', + spec: '^16.4.2', + from: { + name: 'gatsby-react-router-scroll', + version: '3.0.12', + location: 'node_modules/gatsby-react-router-scroll', + dependents: [ + { + type: 'prod', + spec: '^3.0.12', + from: { + name: 'gatsby', + version: '2.24.53', + location: 'node_modules/gatsby', + dependents: [ + { + type: 'prod', + spec: '', + from: { + location: '/path/to/gatsby-user' + } + } + ] + } + } + ] + } + }, + { + type: 'peer', + spec: '^15.0.0 || ^16.0.0', + from: { + name: 'react-hot-loader', + version: '4.12.21', + location: 'node_modules/react-hot-loader', + dependents: [ + { + type: 'prod', + spec: '^4.12.21', + from: { + name: 'gatsby', + version: '2.24.53', + location: 'node_modules/gatsby', + dependents: [ + { + type: 'prod', + spec: '', + from: { + location: '/path/to/gatsby-user' + } + } + ] + } + } + ] + } + }, + { + type: 'peer', + spec: '^0.14.0 || ^15.0.0 || ^16.0.0', + from: { + name: 'create-react-context', + version: '0.3.0', + location: 'node_modules/create-react-context', + dependents: [ + { + type: 'prod', + spec: '0.3.0', + from: { + name: '@reach/router', + version: '1.3.4', + location: 'node_modules/@reach/router', + dependents: [ + { + type: 'prod', + spec: '^1.3.4', + from: { + name: 'gatsby', + version: '2.24.53', + location: 'node_modules/gatsby', + dependents: [ + { + type: 'prod', + spec: '', + from: { + location: '/path/to/gatsby-user' + } + } + ] + } + }, + { + type: 'peer', + spec: '^1.3.3', + from: { + name: 'gatsby-link', + version: '2.4.13', + location: 'node_modules/gatsby-link', + dependents: [ + { + type: 'prod', + spec: '^2.4.13', + from: { + name: 'gatsby', + version: '2.24.53', + location: 'node_modules/gatsby', + dependents: [ + { + type: 'prod', + spec: '', + from: { + location: '/path/to/gatsby-user' + } + } + ] + } + } + ] + } + }, + { + type: 'peer', + spec: '^1.0.0', + from: { + name: 'gatsby-react-router-scroll', + version: '3.0.12', + location: 'node_modules/gatsby-react-router-scroll', + dependents: [ + { + type: 'prod', + spec: '^3.0.12', + from: { + name: 'gatsby', + version: '2.24.53', + location: 'node_modules/gatsby', + dependents: [ + { + type: 'prod', + spec: '', + from: { + location: '/path/to/gatsby-user' + } + } + ] + } + } + ] + } + } + ] + } + } + ] + } + }, + { + type: 'peer', + spec: '^16.12.0', + from: { + name: 'gatsby-recipes', + version: '0.2.20', + location: 'node_modules/gatsby-recipes', + dependents: [ + { + type: 'prod', + spec: '^0.2.20', + from: { + name: 'gatsby-cli', + version: '2.12.91', + location: 'node_modules/gatsby-cli', + dependents: [ + { + type: 'prod', + spec: '^2.12.91', + from: { + name: 'gatsby', + version: '2.24.53', + location: 'node_modules/gatsby', + dependents: [ + { + type: 'prod', + spec: '', + from: { + location: '/path/to/gatsby-user' + } + } + ] + } + } + ] + } + } + ] + } + }, + { + type: 'peer', + spec: '>=16.8.0', + from: { + name: 'ink', + version: '2.7.1', + location: 'node_modules/ink', + dependents: [ + { + type: 'prod', + spec: '^2.7.1', + from: { + name: 'gatsby-cli', + version: '2.12.91', + location: 'node_modules/gatsby-cli', + dependents: [ + { + type: 'prod', + spec: '^2.12.91', + from: { + name: 'gatsby', + version: '2.24.53', + location: 'node_modules/gatsby', + dependents: [ + { + type: 'prod', + spec: '', + from: { + location: '/path/to/gatsby-user' + } + } + ] + } + } + ] + } + }, + { + type: 'peer', + spec: '^2.0.0', + from: { + name: 'ink-spinner', + version: '3.1.0', + location: 'node_modules/ink-spinner', + dependents: [ + { + type: 'prod', + spec: '^3.1.0', + from: { + name: 'gatsby-cli', + version: '2.12.91', + location: 'node_modules/gatsby-cli', + dependents: [ + { + type: 'prod', + spec: '^2.12.91', + from: { + name: 'gatsby', + version: '2.24.53', + location: 'node_modules/gatsby', + dependents: [ + { + type: 'prod', + spec: '', + from: { + location: '/path/to/gatsby-user' + } + } + ] + } + } + ] + } + } + ] + } + }, + { + type: 'peer', + spec: '>=2.0.0', + from: { + name: 'ink-box', + version: '1.0.0', + location: 'node_modules/ink-box', + dependents: [ + { + type: 'prod', + spec: '^1.0.0', + from: { + name: 'gatsby-recipes', + version: '0.2.20', + location: 'node_modules/gatsby-recipes', + dependents: [ + { + type: 'prod', + spec: '^0.2.20', + from: { + name: 'gatsby-cli', + version: '2.12.91', + location: 'node_modules/gatsby-cli', + dependents: [ + { + type: 'prod', + spec: '^2.12.91', + from: { + name: 'gatsby', + version: '2.24.53', + location: 'node_modules/gatsby', + dependents: [ + { + type: 'prod', + spec: '', + from: { + location: '/path/to/gatsby-user' + } + } + ] + } + } + ] + } + } + ] + } + } + ] + } + } + ] + } + }, + { + type: 'peer', + spec: '^16.8.2', + from: { + name: 'ink-spinner', + version: '3.1.0', + location: 'node_modules/ink-spinner', + dependents: [ + { + type: 'prod', + spec: '^3.1.0', + from: { + name: 'gatsby-cli', + version: '2.12.91', + location: 'node_modules/gatsby-cli', + dependents: [ + { + type: 'prod', + spec: '^2.12.91', + from: { + name: 'gatsby', + version: '2.24.53', + location: 'node_modules/gatsby', + dependents: [ + { + type: 'prod', + spec: '', + from: { + location: '/path/to/gatsby-user' + } + } + ] + } + } + ] + } + } + ] + } + }, + { + type: 'peer', + spec: '>=16.3.0', + from: { + name: '@emotion/core', + version: '10.0.35', + location: 'node_modules/@emotion/core', + dependents: [ + { + type: 'prod', + spec: '^10.0.14', + from: { + name: 'gatsby-recipes', + version: '0.2.20', + location: 'node_modules/gatsby-recipes', + dependents: [ + { + type: 'prod', + spec: '^0.2.20', + from: { + name: 'gatsby-cli', + version: '2.12.91', + location: 'node_modules/gatsby-cli', + dependents: [ + { + type: 'prod', + spec: '^2.12.91', + from: { + name: 'gatsby', + version: '2.24.53', + location: 'node_modules/gatsby', + dependents: [ + { + type: 'prod', + spec: '', + from: { + location: '/path/to/gatsby-user' + } + } + ] + } + } + ] + } + } + ] + } + }, + { + type: 'peer', + spec: '^10.0.27', + from: { + name: '@emotion/styled', + version: '10.0.27', + location: 'node_modules/@emotion/styled', + dependents: [ + { + type: 'prod', + spec: '^10.0.14', + from: { + name: 'gatsby-recipes', + version: '0.2.20', + location: 'node_modules/gatsby-recipes', + dependents: [ + { + type: 'prod', + spec: '^0.2.20', + from: { + name: 'gatsby-cli', + version: '2.12.91', + location: 'node_modules/gatsby-cli', + dependents: [ + { + type: 'prod', + spec: '^2.12.91', + from: { + name: 'gatsby', + version: '2.24.53', + location: 'node_modules/gatsby', + dependents: [ + { + type: 'prod', + spec: '', + from: { + location: '/path/to/gatsby-user' + } + } + ] + } + } + ] + } + } + ] + } + }, + { + type: 'peer', + spec: '^10.0.14', + from: { + name: 'gatsby-interface', + version: '0.0.166', + location: 'node_modules/gatsby-recipes/node_modules/gatsby-interface', + dependents: [ + { + type: 'prod', + spec: '^0.0.166', + from: { + name: 'gatsby-recipes', + version: '0.2.20', + location: 'node_modules/gatsby-recipes', + dependents: [ + { + type: 'prod', + spec: '^0.2.20', + from: { + name: 'gatsby-cli', + version: '2.12.91', + location: 'node_modules/gatsby-cli', + dependents: [ + { + type: 'prod', + spec: '^2.12.91', + from: { + name: 'gatsby', + version: '2.24.53', + location: 'node_modules/gatsby', + dependents: [ + { + type: 'prod', + spec: '', + from: { + location: '/path/to/gatsby-user' + } + } + ] + } + } + ] + } + } + ] + } + } + ] + } + } + ] + } + }, + { + type: 'peer', + spec: '^10.0.14', + from: { + name: 'gatsby-interface', + version: '0.0.166', + location: 'node_modules/gatsby-recipes/node_modules/gatsby-interface', + dependents: [ + { + type: 'prod', + spec: '^0.0.166', + from: { + name: 'gatsby-recipes', + version: '0.2.20', + location: 'node_modules/gatsby-recipes', + dependents: [ + { + type: 'prod', + spec: '^0.2.20', + from: { + name: 'gatsby-cli', + version: '2.12.91', + location: 'node_modules/gatsby-cli', + dependents: [ + { + type: 'prod', + spec: '^2.12.91', + from: { + name: 'gatsby', + version: '2.24.53', + location: 'node_modules/gatsby', + dependents: [ + { + type: 'prod', + spec: '', + from: { + location: '/path/to/gatsby-user' + } + } + ] + } + } + ] + } + } + ] + } + } + ] + } + }, + { + type: 'peer', + spec: '^10.0.28', + from: { + name: '@emotion/styled-base', + version: '10.0.31', + location: 'node_modules/@emotion/styled-base', + dependents: [ + { + type: 'prod', + spec: '^10.0.27', + from: { + name: '@emotion/styled', + version: '10.0.27', + location: 'node_modules/@emotion/styled', + dependents: [ + { + type: 'prod', + spec: '^10.0.14', + from: { + name: 'gatsby-recipes', + version: '0.2.20', + location: 'node_modules/gatsby-recipes', + dependents: [ + { + type: 'prod', + spec: '^0.2.20', + from: { + name: 'gatsby-cli', + version: '2.12.91', + location: 'node_modules/gatsby-cli', + dependents: [ + { + type: 'prod', + spec: '^2.12.91', + from: { + name: 'gatsby', + version: '2.24.53', + location: 'node_modules/gatsby', + dependents: [ + { + type: 'prod', + spec: '', + from: { + location: '/path/to/gatsby-user' + } + } + ] + } + } + ] + } + } + ] + } + }, + { + type: 'peer', + spec: '^10.0.14', + from: { + name: 'gatsby-interface', + version: '0.0.166', + location: 'node_modules/gatsby-recipes/node_modules/gatsby-interface', + dependents: [ + { + type: 'prod', + spec: '^0.0.166', + from: { + name: 'gatsby-recipes', + version: '0.2.20', + location: 'node_modules/gatsby-recipes', + dependents: [ + { + type: 'prod', + spec: '^0.2.20', + from: { + name: 'gatsby-cli', + version: '2.12.91', + location: 'node_modules/gatsby-cli', + dependents: [ + { + type: 'prod', + spec: '^2.12.91', + from: { + name: 'gatsby', + version: '2.24.53', + location: 'node_modules/gatsby', + dependents: [ + { + type: 'prod', + spec: '', + from: { + location: '/path/to/gatsby-user' + } + } + ] + } + } + ] + } + } + ] + } + } + ] + } + } + ] + } + } + ] + } + } + ] + } + }, + { + type: 'peer', + spec: '>=16.3.0', + from: { + name: '@emotion/styled', + version: '10.0.27', + location: 'node_modules/@emotion/styled', + dependents: [ + { + type: 'prod', + spec: '^10.0.14', + from: { + name: 'gatsby-recipes', + version: '0.2.20', + location: 'node_modules/gatsby-recipes', + dependents: [ + { + type: 'prod', + spec: '^0.2.20', + from: { + name: 'gatsby-cli', + version: '2.12.91', + location: 'node_modules/gatsby-cli', + dependents: [ + { + type: 'prod', + spec: '^2.12.91', + from: { + name: 'gatsby', + version: '2.24.53', + location: 'node_modules/gatsby', + dependents: [ + { + type: 'prod', + spec: '', + from: { + location: '/path/to/gatsby-user' + } + } + ] + } + } + ] + } + } + ] + } + }, + { + type: 'peer', + spec: '^10.0.14', + from: { + name: 'gatsby-interface', + version: '0.0.166', + location: 'node_modules/gatsby-recipes/node_modules/gatsby-interface', + dependents: [ + { + type: 'prod', + spec: '^0.0.166', + from: { + name: 'gatsby-recipes', + version: '0.2.20', + location: 'node_modules/gatsby-recipes', + dependents: [ + { + type: 'prod', + spec: '^0.2.20', + from: { + name: 'gatsby-cli', + version: '2.12.91', + location: 'node_modules/gatsby-cli', + dependents: [ + { + type: 'prod', + spec: '^2.12.91', + from: { + name: 'gatsby', + version: '2.24.53', + location: 'node_modules/gatsby', + dependents: [ + { + type: 'prod', + spec: '', + from: { + location: '/path/to/gatsby-user' + } + } + ] + } + } + ] + } + } + ] + } + } + ] + } + } + ] + } + }, + { + type: 'peer', + spec: '^16.13.1', + from: { + name: '@mdx-js/react', + version: '2.0.0-next.7', + location: 'node_modules/@mdx-js/react', + dependents: [ + { + type: 'prod', + spec: '^2.0.0-next.4', + from: { + name: 'gatsby-recipes', + version: '0.2.20', + location: 'node_modules/gatsby-recipes', + dependents: [ + { + type: 'prod', + spec: '^0.2.20', + from: { + name: 'gatsby-cli', + version: '2.12.91', + location: 'node_modules/gatsby-cli', + dependents: [ + { + type: 'prod', + spec: '^2.12.91', + from: { + name: 'gatsby', + version: '2.24.53', + location: 'node_modules/gatsby', + dependents: [ + { + type: 'prod', + spec: '', + from: { + location: '/path/to/gatsby-user' + } + } + ] + } + } + ] + } + } + ] + } + }, + { + type: 'prod', + spec: '^2.0.0-next.7', + from: { + name: '@mdx-js/runtime', + version: '2.0.0-next.7', + location: 'node_modules/@mdx-js/runtime', + dependents: [ + { + type: 'prod', + spec: '^2.0.0-next.4', + from: { + name: 'gatsby-recipes', + version: '0.2.20', + location: 'node_modules/gatsby-recipes', + dependents: [ + { + type: 'prod', + spec: '^0.2.20', + from: { + name: 'gatsby-cli', + version: '2.12.91', + location: 'node_modules/gatsby-cli', + dependents: [ + { + type: 'prod', + spec: '^2.12.91', + from: { + name: 'gatsby', + version: '2.24.53', + location: 'node_modules/gatsby', + dependents: [ + { + type: 'prod', + spec: '', + from: { + location: '/path/to/gatsby-user' + } + } + ] + } + } + ] + } + } + ] + } + } + ] + } + } + ] + } + }, + { + type: 'peer', + spec: '^16.13.1', + from: { + name: '@mdx-js/runtime', + version: '2.0.0-next.7', + location: 'node_modules/@mdx-js/runtime', + dependents: [ + { + type: 'prod', + spec: '^2.0.0-next.4', + from: { + name: 'gatsby-recipes', + version: '0.2.20', + location: 'node_modules/gatsby-recipes', + dependents: [ + { + type: 'prod', + spec: '^0.2.20', + from: { + name: 'gatsby-cli', + version: '2.12.91', + location: 'node_modules/gatsby-cli', + dependents: [ + { + type: 'prod', + spec: '^2.12.91', + from: { + name: 'gatsby', + version: '2.24.53', + location: 'node_modules/gatsby', + dependents: [ + { + type: 'prod', + spec: '', + from: { + location: '/path/to/gatsby-user' + } + } + ] + } + } + ] + } + } + ] + } + } + ] + } + }, + { + type: 'peer', + spec: '>=16.8.0', + from: { + name: 'formik', + version: '2.1.5', + location: 'node_modules/formik', + dependents: [ + { + type: 'prod', + spec: '^2.0.8', + from: { + name: 'gatsby-recipes', + version: '0.2.20', + location: 'node_modules/gatsby-recipes', + dependents: [ + { + type: 'prod', + spec: '^0.2.20', + from: { + name: 'gatsby-cli', + version: '2.12.91', + location: 'node_modules/gatsby-cli', + dependents: [ + { + type: 'prod', + spec: '^2.12.91', + from: { + name: 'gatsby', + version: '2.24.53', + location: 'node_modules/gatsby', + dependents: [ + { + type: 'prod', + spec: '', + from: { + location: '/path/to/gatsby-user' + } + } + ] + } + } + ] + } + } + ] + } + }, + { + type: 'peer', + spec: '^2.0.8', + from: { + name: 'gatsby-interface', + version: '0.0.166', + location: 'node_modules/gatsby-recipes/node_modules/gatsby-interface', + dependents: [ + { + type: 'prod', + spec: '^0.0.166', + from: { + name: 'gatsby-recipes', + version: '0.2.20', + location: 'node_modules/gatsby-recipes', + dependents: [ + { + type: 'prod', + spec: '^0.2.20', + from: { + name: 'gatsby-cli', + version: '2.12.91', + location: 'node_modules/gatsby-cli', + dependents: [ + { + type: 'prod', + spec: '^2.12.91', + from: { + name: 'gatsby', + version: '2.24.53', + location: 'node_modules/gatsby', + dependents: [ + { + type: 'prod', + spec: '', + from: { + location: '/path/to/gatsby-user' + } + } + ] + } + } + ] + } + } + ] + } + } + ] + } + } + ] + } + }, + { + type: 'peer', + spec: '^16.4.2', + from: { + name: 'gatsby', + version: '2.6.0', + location: 'node_modules/gatsby-recipes/node_modules/gatsby', + dependents: [ + { + type: 'peer', + spec: '2.6.0', + from: { + name: 'gatsby-interface', + version: '0.0.166', + location: 'node_modules/gatsby-recipes/node_modules/gatsby-interface', + dependents: [ + { + type: 'prod', + spec: '^0.0.166', + from: { + name: 'gatsby-recipes', + version: '0.2.20', + location: 'node_modules/gatsby-recipes', + dependents: [ + { + type: 'prod', + spec: '^0.2.20', + from: { + name: 'gatsby-cli', + version: '2.12.91', + location: 'node_modules/gatsby-cli', + dependents: [ + { + type: 'prod', + spec: '^2.12.91', + from: { + name: 'gatsby', + version: '2.24.53', + location: 'node_modules/gatsby', + dependents: [ + { + type: 'prod', + spec: '', + from: { + location: '/path/to/gatsby-user' + } + } + ] + } + } + ] + } + } + ] + } + } + ] + } + } + ] + } + }, + { + type: 'peer', + spec: '^16.0.0', + from: { + name: 'react-dom', + version: '16.8.1', + location: 'node_modules/gatsby-recipes/node_modules/react-dom', + dependents: [ + { + type: 'peer', + spec: '16.8.1', + from: { + name: 'gatsby-interface', + version: '0.0.166', + location: 'node_modules/gatsby-recipes/node_modules/gatsby-interface', + dependents: [ + { + type: 'prod', + spec: '^0.0.166', + from: { + name: 'gatsby-recipes', + version: '0.2.20', + location: 'node_modules/gatsby-recipes', + dependents: [ + { + type: 'prod', + spec: '^0.2.20', + from: { + name: 'gatsby-cli', + version: '2.12.91', + location: 'node_modules/gatsby-cli', + dependents: [ + { + type: 'prod', + spec: '^2.12.91', + from: { + name: 'gatsby', + version: '2.24.53', + location: 'node_modules/gatsby', + dependents: [ + { + type: 'prod', + spec: '', + from: { + location: '/path/to/gatsby-user' + } + } + ] + } + } + ] + } + } + ] + } + } + ] + } + }, + { + type: 'peer', + spec: '^16.4.2', + from: { + name: 'gatsby', + version: '2.6.0', + location: 'node_modules/gatsby-recipes/node_modules/gatsby', + dependents: [ + { + type: 'peer', + spec: '2.6.0', + from: { + name: 'gatsby-interface', + version: '0.0.166', + location: 'node_modules/gatsby-recipes/node_modules/gatsby-interface', + dependents: [ + { + type: 'prod', + spec: '^0.0.166', + from: { + name: 'gatsby-recipes', + version: '0.2.20', + location: 'node_modules/gatsby-recipes', + dependents: [ + { + type: 'prod', + spec: '^0.2.20', + from: { + name: 'gatsby-cli', + version: '2.12.91', + location: 'node_modules/gatsby-cli', + dependents: [ + { + type: 'prod', + spec: '^2.12.91', + from: { + name: 'gatsby', + version: '2.24.53', + location: 'node_modules/gatsby', + dependents: [ + { + type: 'prod', + spec: '', + from: { + location: '/path/to/gatsby-user' + } + } + ] + } + } + ] + } + } + ] + } + } + ] + } + } + ] + } + }, + { + type: 'peer', + spec: '^0.14.0 || ^15.0.0 || ^16.0.0', + from: { + name: 'gatsby-react-router-scroll', + version: '2.3.1', + location: 'node_modules/gatsby-recipes/node_modules/gatsby-react-router-scroll', + dependents: [ + { + type: 'prod', + spec: '^2.0.7', + from: { + name: 'gatsby', + version: '2.6.0', + location: 'node_modules/gatsby-recipes/node_modules/gatsby', + dependents: [ + { + type: 'peer', + spec: '2.6.0', + from: { + name: 'gatsby-interface', + version: '0.0.166', + location: 'node_modules/gatsby-recipes/node_modules/gatsby-interface', + dependents: [ + { + type: 'prod', + spec: '^0.0.166', + from: { + name: 'gatsby-recipes', + version: '0.2.20', + location: 'node_modules/gatsby-recipes', + dependents: [ + { + type: 'prod', + spec: '^0.2.20', + from: { + name: 'gatsby-cli', + version: '2.12.91', + location: 'node_modules/gatsby-cli', + dependents: [ + { + type: 'prod', + spec: '^2.12.91', + from: { + name: 'gatsby', + version: '2.24.53', + location: 'node_modules/gatsby', + dependents: [ + { + type: 'prod', + spec: '', + from: { + location: '/path/to/gatsby-user' + } + } + ] + } + } + ] + } + } + ] + } + } + ] + } + } + ] + } + } + ] + } + } + ] + } + }, + { + type: 'peer', + spec: '*', + from: { + name: 'react-icons', + version: '3.11.0', + location: 'node_modules/react-icons', + dependents: [ + { + type: 'prod', + spec: '^3.0.1', + from: { + name: 'gatsby-recipes', + version: '0.2.20', + location: 'node_modules/gatsby-recipes', + dependents: [ + { + type: 'prod', + spec: '^0.2.20', + from: { + name: 'gatsby-cli', + version: '2.12.91', + location: 'node_modules/gatsby-cli', + dependents: [ + { + type: 'prod', + spec: '^2.12.91', + from: { + name: 'gatsby', + version: '2.24.53', + location: 'node_modules/gatsby', + dependents: [ + { + type: 'prod', + spec: '', + from: { + location: '/path/to/gatsby-user' + } + } + ] + } + } + ] + } + } + ] + } + }, + { + type: 'peer', + spec: '^3.2.1', + from: { + name: 'gatsby-interface', + version: '0.0.166', + location: 'node_modules/gatsby-recipes/node_modules/gatsby-interface', + dependents: [ + { + type: 'prod', + spec: '^0.0.166', + from: { + name: 'gatsby-recipes', + version: '0.2.20', + location: 'node_modules/gatsby-recipes', + dependents: [ + { + type: 'prod', + spec: '^0.2.20', + from: { + name: 'gatsby-cli', + version: '2.12.91', + location: 'node_modules/gatsby-cli', + dependents: [ + { + type: 'prod', + spec: '^2.12.91', + from: { + name: 'gatsby', + version: '2.24.53', + location: 'node_modules/gatsby', + dependents: [ + { + type: 'prod', + spec: '', + from: { + location: '/path/to/gatsby-user' + } + } + ] + } + } + ] + } + } + ] + } + } + ] + } + } + ] + } + }, + { + type: 'peer', + spec: '>=16.8.0', + from: { + name: 'ink-box', + version: '1.0.0', + location: 'node_modules/ink-box', + dependents: [ + { + type: 'prod', + spec: '^1.0.0', + from: { + name: 'gatsby-recipes', + version: '0.2.20', + location: 'node_modules/gatsby-recipes', + dependents: [ + { + type: 'prod', + spec: '^0.2.20', + from: { + name: 'gatsby-cli', + version: '2.12.91', + location: 'node_modules/gatsby-cli', + dependents: [ + { + type: 'prod', + spec: '^2.12.91', + from: { + name: 'gatsby', + version: '2.24.53', + location: 'node_modules/gatsby', + dependents: [ + { + type: 'prod', + spec: '', + from: { + location: '/path/to/gatsby-user' + } + } + ] + } + } + ] + } + } + ] + } + } + ] + } + }, + { + type: 'peer', + spec: '^0.14.0 || ^15.0.0 || ^16.0.0', + from: { + name: 'react-circular-progressbar', + version: '2.0.3', + location: 'node_modules/react-circular-progressbar', + dependents: [ + { + type: 'prod', + spec: '^2.0.0', + from: { + name: 'gatsby-recipes', + version: '0.2.20', + location: 'node_modules/gatsby-recipes', + dependents: [ + { + type: 'prod', + spec: '^0.2.20', + from: { + name: 'gatsby-cli', + version: '2.12.91', + location: 'node_modules/gatsby-cli', + dependents: [ + { + type: 'prod', + spec: '^2.12.91', + from: { + name: 'gatsby', + version: '2.24.53', + location: 'node_modules/gatsby', + dependents: [ + { + type: 'prod', + spec: '', + from: { + location: '/path/to/gatsby-user' + } + } + ] + } + } + ] + } + } + ] + } + } + ] + } + }, + { + type: 'peer', + spec: '^16.13.1', + from: { + name: 'react-reconciler', + version: '0.25.1', + location: 'node_modules/react-reconciler', + dependents: [ + { + type: 'prod', + spec: '^0.25.1', + from: { + name: 'gatsby-recipes', + version: '0.2.20', + location: 'node_modules/gatsby-recipes', + dependents: [ + { + type: 'prod', + spec: '^0.2.20', + from: { + name: 'gatsby-cli', + version: '2.12.91', + location: 'node_modules/gatsby-cli', + dependents: [ + { + type: 'prod', + spec: '^2.12.91', + from: { + name: 'gatsby', + version: '2.24.53', + location: 'node_modules/gatsby', + dependents: [ + { + type: 'prod', + spec: '', + from: { + location: '/path/to/gatsby-user' + } + } + ] + } + } + ] + } + } + ] + } + } + ] + } + }, + { + type: 'peer', + spec: '>= 16.8.0', + from: { + name: 'urql', + version: '1.10.0', + location: 'node_modules/urql', + dependents: [ + { + type: 'prod', + spec: '^1.9.7', + from: { + name: 'gatsby-recipes', + version: '0.2.20', + location: 'node_modules/gatsby-recipes', + dependents: [ + { + type: 'prod', + spec: '^0.2.20', + from: { + name: 'gatsby-cli', + version: '2.12.91', + location: 'node_modules/gatsby-cli', + dependents: [ + { + type: 'prod', + spec: '^2.12.91', + from: { + name: 'gatsby', + version: '2.24.53', + location: 'node_modules/gatsby', + dependents: [ + { + type: 'prod', + spec: '', + from: { + location: '/path/to/gatsby-user' + } + } + ] + } + } + ] + } + } + ] + } + } + ] + } + }, + { + type: 'peer', + spec: '>=16.3.0', + from: { + name: '@emotion/styled-base', + version: '10.0.31', + location: 'node_modules/@emotion/styled-base', + dependents: [ + { + type: 'prod', + spec: '^10.0.27', + from: { + name: '@emotion/styled', + version: '10.0.27', + location: 'node_modules/@emotion/styled', + dependents: [ + { + type: 'prod', + spec: '^10.0.14', + from: { + name: 'gatsby-recipes', + version: '0.2.20', + location: 'node_modules/gatsby-recipes', + dependents: [ + { + type: 'prod', + spec: '^0.2.20', + from: { + name: 'gatsby-cli', + version: '2.12.91', + location: 'node_modules/gatsby-cli', + dependents: [ + { + type: 'prod', + spec: '^2.12.91', + from: { + name: 'gatsby', + version: '2.24.53', + location: 'node_modules/gatsby', + dependents: [ + { + type: 'prod', + spec: '', + from: { + location: '/path/to/gatsby-user' + } + } + ] + } + } + ] + } + } + ] + } + }, + { + type: 'peer', + spec: '^10.0.14', + from: { + name: 'gatsby-interface', + version: '0.0.166', + location: 'node_modules/gatsby-recipes/node_modules/gatsby-interface', + dependents: [ + { + type: 'prod', + spec: '^0.0.166', + from: { + name: 'gatsby-recipes', + version: '0.2.20', + location: 'node_modules/gatsby-recipes', + dependents: [ + { + type: 'prod', + spec: '^0.2.20', + from: { + name: 'gatsby-cli', + version: '2.12.91', + location: 'node_modules/gatsby-cli', + dependents: [ + { + type: 'prod', + spec: '^2.12.91', + from: { + name: 'gatsby', + version: '2.24.53', + location: 'node_modules/gatsby', + dependents: [ + { + type: 'prod', + spec: '', + from: { + location: '/path/to/gatsby-user' + } + } + ] + } + } + ] + } + } + ] + } + } + ] + } + } + ] + } + } + ] + } + }, + { + type: 'peer', + spec: '^16.0.0', + from: { + name: 'react-reconciler', + version: '0.24.0', + location: 'node_modules/ink/node_modules/react-reconciler', + dependents: [ + { + type: 'prod', + spec: '^0.24.0', + from: { + name: 'ink', + version: '2.7.1', + location: 'node_modules/ink', + dependents: [ + { + type: 'prod', + spec: '^2.7.1', + from: { + name: 'gatsby-cli', + version: '2.12.91', + location: 'node_modules/gatsby-cli', + dependents: [ + { + type: 'prod', + spec: '^2.12.91', + from: { + name: 'gatsby', + version: '2.24.53', + location: 'node_modules/gatsby', + dependents: [ + { + type: 'prod', + spec: '', + from: { + location: '/path/to/gatsby-user' + } + } + ] + } + } + ] + } + }, + { + type: 'peer', + spec: '^2.0.0', + from: { + name: 'ink-spinner', + version: '3.1.0', + location: 'node_modules/ink-spinner', + dependents: [ + { + type: 'prod', + spec: '^3.1.0', + from: { + name: 'gatsby-cli', + version: '2.12.91', + location: 'node_modules/gatsby-cli', + dependents: [ + { + type: 'prod', + spec: '^2.12.91', + from: { + name: 'gatsby', + version: '2.24.53', + location: 'node_modules/gatsby', + dependents: [ + { + type: 'prod', + spec: '', + from: { + location: '/path/to/gatsby-user' + } + } + ] + } + } + ] + } + } + ] + } + }, + { + type: 'peer', + spec: '>=2.0.0', + from: { + name: 'ink-box', + version: '1.0.0', + location: 'node_modules/ink-box', + dependents: [ + { + type: 'prod', + spec: '^1.0.0', + from: { + name: 'gatsby-recipes', + version: '0.2.20', + location: 'node_modules/gatsby-recipes', + dependents: [ + { + type: 'prod', + spec: '^0.2.20', + from: { + name: 'gatsby-cli', + version: '2.12.91', + location: 'node_modules/gatsby-cli', + dependents: [ + { + type: 'prod', + spec: '^2.12.91', + from: { + name: 'gatsby', + version: '2.24.53', + location: 'node_modules/gatsby', + dependents: [ + { + type: 'prod', + spec: '', + from: { + location: '/path/to/gatsby-user' + } + } + ] + } + } + ] + } + } + ] + } + } + ] + } + } + ] + } + } + ] + } + }, + { + type: 'peer', + spec: '^0.14.0 || ^15.0.0 || ^16.0.0', + from: { + name: 'gatsby-react-router-scroll', + version: '2.3.1', + location: 'node_modules/gatsby-recipes/node_modules/gatsby-react-router-scroll', + dependents: [ + { + type: 'prod', + spec: '^2.0.7', + from: { + name: 'gatsby', + version: '2.6.0', + location: 'node_modules/gatsby-recipes/node_modules/gatsby', + dependents: [ + { + type: 'peer', + spec: '2.6.0', + from: { + name: 'gatsby-interface', + version: '0.0.166', + location: 'node_modules/gatsby-recipes/node_modules/gatsby-interface', + dependents: [ + { + type: 'prod', + spec: '^0.0.166', + from: { + name: 'gatsby-recipes', + version: '0.2.20', + location: 'node_modules/gatsby-recipes', + dependents: [ + { + type: 'prod', + spec: '^0.2.20', + from: { + name: 'gatsby-cli', + version: '2.12.91', + location: 'node_modules/gatsby-cli', + dependents: [ + { + type: 'prod', + spec: '^2.12.91', + from: { + name: 'gatsby', + version: '2.24.53', + location: 'node_modules/gatsby', + dependents: [ + { + type: 'prod', + spec: '', + from: { + location: '/path/to/gatsby-user' + } + } + ] + } + } + ] + } + } + ] + } + } + ] + } + } + ] + } + } + ] + } + }, + { + type: 'peer', + spec: '^16.13.1', + from: { + name: '@mdx-js/react', + version: '1.6.16', + location: 'node_modules/gatsby-recipes/node_modules/gatsby-interface/node_modules/@mdx-js/react', + dependents: [ + { + type: 'prod', + spec: '^1.5.2', + from: { + name: 'gatsby-interface', + version: '0.0.166', + location: 'node_modules/gatsby-recipes/node_modules/gatsby-interface', + dependents: [ + { + type: 'prod', + spec: '^0.0.166', + from: { + name: 'gatsby-recipes', + version: '0.2.20', + location: 'node_modules/gatsby-recipes', + dependents: [ + { + type: 'prod', + spec: '^0.2.20', + from: { + name: 'gatsby-cli', + version: '2.12.91', + location: 'node_modules/gatsby-cli', + dependents: [ + { + type: 'prod', + spec: '^2.12.91', + from: { + name: 'gatsby', + version: '2.24.53', + location: 'node_modules/gatsby', + dependents: [ + { + type: 'prod', + spec: '', + from: { + location: '/path/to/gatsby-user' + } + } + ] + } + } + ] + } + } + ] + } + } + ] + } + } + ] + } + } + ] + }, + peerConflict: null, + fixWithForce: true, + type: 'peer', + isPeer: true + } +} diff --git a/deps/npm/test/fixtures/forked-underscore-1.5.1.tgz b/deps/npm/test/fixtures/forked-underscore-1.5.1.tgz deleted file mode 100644 index 5aca6247ac395de449e8dd6bc758591aff21a0b5..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 583 zcmV-N0=WGjiwFS5j@nZI1MQYeZ`&{o$8*l75OmoFbbh3^gLQ9UmlfD)y$w4k4r42k zC4-XF1x3I6B-?plK)Xw`VHkf1ESsW8%74>NE6RN1RvUzBH-~V}Dq}2a^g1aeWT#E)cJ8;E#=RXH% zOM}2Kg2xhUiL!OlXg+vci>>(D+n!mr>U0_Agkmk43PsaMU9lQe3&@mQpuk-;gsM#g zt$)<`AzAHQdlkpWoNF5ytOoZD>~0M%?ZN#U@0?Wpg7IV4aOK6@0*13vNzg8wEzsP0 zJOAE?5}m6J@{?^|146T7A8ow>Ei8Mp?hPN7rtBIYqg19_hFabY#UQlCN@sA#hX{Av z?ONbIR3-b29jful@5mqPZV{EHiPvJxak9-Qthw(4H$v)%6!1McWcS;%qX45*8s$;C zS7`eQTJWoMDZ%<8g0z03t%Y``SqGC}@G44Prrb{ri3eFv+#OgKJP*rQu*6#**U8CM>Qz^3$%D#2j!7+i7C1?vLMSuBx!>9N3T_Fg9AP9mW2!bF8f*=Tj VAP9mW2!eQ0egb=Ui0l9;005~gBh>%^ diff --git a/deps/npm/test/fixtures/github-com-BryanDonovan-dummy-npm-bar.git.tar.gz b/deps/npm/test/fixtures/github-com-BryanDonovan-dummy-npm-bar.git.tar.gz deleted file mode 100644 index fb27e17f4812fa2bc5bb5630e195df0fcc1c9d58..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 12585 zcmV+^G1kr>iwFQ8PC-=w1MNKtcoWsufFd*?6a@to7}7!)nq+2@nIwg_l$L#m0tzkd zWR^BG$%IToTM7z35L7@^7D3>bO%N0m5oJ?BksY22MNmOO7C}%zL_zVt_s(SL0&Vj& zeLi#iu*u{u=brtXdvB6!b?1338dkJxy10rMN4n?`$1n~J=ds(1G!Ca-V_{s{T&r7G zD`>!R+(=Ov`b*1yand0FRRAMMiUbd7BTiyCNl-Xl3!{Rcvg+WG+>8sL;^Hkl%QClZ z2bu}O9mY}C;rshHf!r$dpA{W~H8+?!06l1f;r9F|X}S#mN${r@hX2`%tqA_%{2#%J zEYR*xa{u2aIM*sCj0~OZ)P{0s}gR%1*=GXs@7|&VV zm^;rZVNmh0m;lblU~UnEJ;3LDKqqZjCI6mKb^Y(rH8nlBIV#hCoHUm8|Ad|h>whS~ z#S4i*j|EAW$1|Lyvon&L4?Ea@3{+kJ^F%RU3Mvb%e*Q<&Q2)dE-(L?^=fBk6cQR}~&uL(+P|Z0ii~o#x+4xUS zli~O;BoKu`z9Oz-1wa-OF(=R4Ktd>ZY_=ke@^)ye>q=BIr z%BW`<1FttQjGhb(B{_Z!Zxfv=%1BvEG)>YVsb@KcrdXT;e@L9+36?hSCPr`Ic-~k+ z7;5B9Jk9ZXlb$gVW|A-vte&KB0Zhl@xPh`zl-WS(3AwAA$(3}Z7T4mckp_|{O-2eg z^I%d+Pa91XPO}1UG*g@a{^MwYpg9Yp5_mm@6Gjf;fYZ33H`8E!qzPmote!AY;1xyD z0!s%>p_ivH11jh(f&n*@G)42Qz!7>{Pw^JUVkAwpU}kB8wwQPo&w&wnxO6}XJ!3F% zgwX^SL@^f5j1wk~;Apcka1{o5imH+>_;|hQ`j3zcYL1}%KNYtBp@3@gU)IiQ&Jl$F zr^4}nXrP+>N5-kTa|FSE1FjGAKNL{?_#bCNp#O$&{2v;qKL1H$2>1^IwlM!g0YUJe z4Tb(2!uCHTP<{UEL!$piJk0-4K=t`=AVXsR4PpL=0)pUwXzYJD{|^aNpZ`>7>^~Xi ze<&ab{+mO>|FHcJ2~?l|G#%Fe3g92Ze`9Fue^~!R0zvRUH1;=i!{4+#Xp|4`I_DKeb@hXkt6e<39CfB61KXrTK1ul_yo>hmAosSEQz6i|Ks z!~3FtJ^!h2{1*}k%KlgF#;k7+Ko7$mzyA+6l;*!4CrLbf|2q^=Si9Zy5vmWdrs+2? z#(&xQ^o>me>o1>mY3a(1PtIxIYi5@**=g?y2X-#7GG{*B)%&S7y`~pW8NSn&Ga&D| zL5r4kv&TJYik)&aW>)i7Z*CZN^3{aBo8K&HHGIN^rTf=k-nn7Q?3BI3A4}R<_;r5b z<<_HqfBxKOBT|N{roD6EY6nxTkNfR!(_(vvlA5N$KN*6G|EqSL-8V<&`cIbCf10Ah z`X35_`aclpe?ut4_sblAA-#;ddzru(}#^rUmtJ(=r?aVwtVnb z!s#Q@w2tpxnOLyqT8Fg%JAUI$qDNu7yK);&?bT|2N)*}QyPBrJKO2Io|5!+Z#|eh! z37ixRdWO^U7Tj!R%ruJ|SR-SiEf&h+o1;?w*Bi^~zmd>~^*Y{rj&=XnfJNa7IZJ^#HE@<|*}aHf(BTzp-=Dwnm9~nIF#*tHhM@hbRGI$k%YOf-9;fK= z_y2|jfc`(bzt=~dBPS)DjXSd;hV6f5ZM_GYTt2VwaoxQ$s|U$E{NT9asFU{>#=o~D zc2%#eBl*SyA8$UMaqoa1kMC^QW#ITeZ5Mz1n)cnundwvGChu~5{_1xn_mYF=eUO(O_>1yNmcI%Qqc~6%(XH#;^3o9bVH99)~CflIll;Vdk+<5lsZ-#uaxus+M z>}SkW)~w{8woS*k@6LQ@N z_5W@H=>NgN-)@N6*)L{cn@7?=T73{(xa^d6U!NzN1O4xQclHN^FE{JjZ1xwMMouA* zeKlRXWXs%~D6@T$kn*z)o#)9T)>QbnG9DrM(#&$Tb#FC471=f9J7 z@Vj~^_UMu?zo#S5Zb*)|H<^gt_iAzdTAzK>dgqhBEwzlDeM=kfIew+{IEeQtT5n-Eo-l)KpEQ_FtbsHLILFc^ zPSEo-N&A(hGX2NP{{9Du{|$z){)YkzYj=q2)prQKAqO`AOH2&>ckhD6dcBD;@f?er z7~uU4gqh|@3(K;+nK2lv?*9!`x%$7+5dQt2kU(MWg#$bG{}7K94y=7++M&Ahn_iCG zGpVrQzSpuAd^^ASj^w?$!}<>VqvM#&!c&U#;+YXd+nIW8?7kEWbLg3rx#zm@tCT`Ym0uo_hh^E zjP2vZT}T6&V-KR)R7D;I6E=jJ`|{H`g*eSS^M$Vu;be!=NQxl_J>uut*+wKdJFzXF0f z|8K%M!D!+r(xT@G-o!I3BTyXA8CVbq;Chw0-Ny5JzJkhs?-oaCx2@f~vCWhhE_6Ea5?%8BvGz+QZjrRnu}wdk zd@ib256jkTtzT_wc{=%xAsy`N4AZC0TCuzK6Q6%HZP&J(w#}nP&z~t7&PhXmvc0qE zyQ@FH(lz`1pzQIDf7_A&>o-r8Tx*-Q=IX#_4>Wh~Ui!(+OZOZ;(fZi8jVG_WtKrMZ zoqp`Oq^7C!zYjs(|KdrGpas3rz>tEOVi?+B!U=*k8wowd3pj1jlP0q2^?$;sFYEu& z_kV@;|E~vc{BJNYRZIY0UPWFVG^oQ*>z-~g>gK9>@5GGXLZ$q0`KA~nISRV3TG{z< z)9CiOF|VwsGvxGHVrBornJH$+T21dyP98ZE^L|%NVamk^YTd{oBWrr;VW<`4{oks6 z@4au1O6z|_x%{6B=l`JrSpQ4yRhNiN&pH^l?q-Lbi@tMzTDwV;cNV24e%JbsDJd_s z?Y8ZUj_O67M-AMvBzEPXBiBA{RpyUNnsuokS z=G(ve^{6o8?%kc5ZI7IX&Dvp6XEm}u^2*DP-n!AEh5M=347rDPf4*#2mr>`R>EEz< z`^ePh-!A>Xe5wD%-t_g%cWxB@GXB=KVZZO_e)Rh4>C4wNc3ipIFuBQFo9o`we8x|v zl8bHb|L~c&jnc;5Ll0a!^!=zSjsny6`YXP9=*GP4i8W2lzaIqk{SPLF6@dPma9(e= zSWG4hO`13c_;JQ!7EBfvm;s9Q@7-3a|9ZS!{14CnhxPxjhjR7*Oa0oXyfJm^u>VU< zTsUJhu5WSj-LHZECr?~)vcoD>uVd>n3)oLiT+BMWY+1&?hduQ0;J)|2RnR1|UETFB z4E^!wpkXWN&8ElSsOaFbf({H{$ zbja}?+^Ua>;ho?nv?4pfcy*6#mzt?`VZz3~i=$^#R&9Bj8d*#?&d-6YA zzW%xOd!IQKO>Azr_^H&7UY>Sk(dXTg4%hDa?Jny1j9FVxH~QD^wj)}Fh5 z^2z2GPi^-6a;{+2k4Hz{OuF*$qQdFAE&tx|)u&t5Uul#XF|p;=EBN9xu6yyrt-fn> zf1mxPQxRit96j=0iEe6f-1S!-yz1tu+E>0i+U7c+(Wa&e_dfzbeg9k4ew52MN2U6Y zm&^Z2JbeB)Bp{#v-wyQu_XF{l?rCTw`bRby-RAk7eFxg^?-jYJc<`Qa`xZPq?>nZ> z;*VbaxbgBvy`FauT^h6eh4-3YFwD=`HFn|N0d&_FAHM6th^QW(MJE4QC z|3(Y0w-{+sAUMV>&^)i_1%YPGG|O2`7RpQ-NP};VO6z|Hs$BeU2*>{+fx_Co_w4RJ z2shx&uKoSv_V+y8`}Npey7;)EZwy&^W>Bps)*V`Ma^G*AI!s>w>6UNr!+NLPAAi^L znqHbX&7QjkO#Hr#kG)a%soh7P`tH@SkM8)j==}V#11^^2yftd$sMj~vy83oh zgPLAs7;XzeegCh((PlFz&lxLSk`2Qzo;qDdIP67;R3HGtFixI!Tui|*8h+| zVeN%8li>dUlk={2NQm-GY@b@cE#GCFd;p;3L+Aj&^Z|c#ytVQeiGPr@d(-tx<1cM} z?BhjAoi+^1ZpMCD|K2U^xQ4@Z`Ruh#56(Ez-db-))A`GeAF+Qm=X`yGiT{0ITvtuT zrNP3a@xS+6KD=dI%jgXEPo0yGZo{6l|MHS_E>W1-ZsK#3Q|-;BJ#=7bhkJ@oA8qyQ z3sbfnsQ(h?N8^u z)$)S@XSO`PW!CUEuROEs4~Bj^_M^=Uuk<{WvtyR|@negIO*#LNihE-~O>^h3hoHXy zod+pDMH70xkz**6z?uj~j|(Q2$7#+&aux$^Fq^A>{=b6#Kgtk3{~HqctM~sF=%3FV zIPTrmKQ!9;{PG!}X)l_ux_UOLb?ZkmT%!ALfS`W=!(?DACXyx%1~Y9m(IiC?CKIn0 z7!dw51~bVE1c6t5|F5F`e=@B9A%VYI|9_eE@V?~lkF;x6z^~oaW#KjI`q=ln*Q#~( z5K+6PmmY>%LH_;|XEKl$hA|mflSP1nLzs+u3r&!EJx7orB%n+LUG@4uRlfeOr^5ID zLIQ=g`wr^+Y}2-p*Y>Sl$!XU-cj<*s3WvP4`{U1AZf)6e)#m(qvCDE|uKu7I>%La! z(9Ys5!`?_A`Sn**uCML)<7^`_Izepz)im=q_TcpUx;XdG>%z=(e>NoY!*jp%X*T}U z*vYdy445;tc>9-l=Ve`UKAd)Vx^v_97YZLMaenygH(#t6Z8*kJ=9M!hm0(+(V>Z@) zNNU=yQ`Ahu+_|myXRoTgb!~ixC_ZxkJ)hp}oN)*%-ulka8_pTGwtI`ezA0@pV8s#jj^|ypDnpI_>YrWDer6@-*4-| zl%L2{({?UnNmuxYmjE*`n;{ihBryzVMlp&j;3!A7Y; zf^*P`X)z-|t7&Tf{UE5{f29m8L0eco)OCWPc+Ozq2m?cqEF&0MjyJJ_k@DwvmDm5u z-v1>CDy;t@f%5gg{S#)AZIka2O0+YizL`6c_nys=>wi6(H_v&4`>ObQa)H>uK3oOhc`Xhf*Y8_rLOwd6OMyNg%7`et<&nF7q=|) zB)$>({q&4C)@A;jjCK2AkHsqS#bbk(I2L`Cu&+bQP7#BDZ{8v8$m)N_dw4g_tjB<9DU`DE{|`*7Z^4YgX;aD;m^z-_WSk*m%AOWbKeVX{@wM31;i55S z(qyD?GY|YfrKgQ13a43tH<~F<0RO>_0GhK@f$=`qW%gMvZ*WZ4;_1Nsketi4Z$tdxQAu-?W{g-D_ z{aKbiKR{|gPk^M3>3 z{lE0z55&1@w>#?iv}t+(<-Y%yAj04O6B+>V|MVoX8%xN}+6#`KW=&{#zUhpi_4@Z*6Ww#(;jT;jbbGpFV9D^!;r*^?TRM ziO6BgyD_i{8kZ1)5?QoEOYASM~V6{P`c;7(V|O z8YrLt*NzCE|AFU!>czd$uco>4*F*L7A7^wFP-ohVa}0?6X(MGc@wA!OQ+kRrF&xKO z7$Zen^u9SN)Bg(g{|!`F|3dd3_kM30TbEIeqPD~cQ@@or2MzzE8$ zn3Hk4d6z@NVm%IJ1~`NrvkF*|=)npY_&~%w5|5t8C4$cJ+7Tj?1z$X-s%d)vw?WnQ zKTj0%B^~2*+KK=d*gTD0%GFAY-D#`L9N?Aw{*$q6{!h|IBN5jBP(V~$oyF?VNqMR$ zpdhIZplOJu7-Tmlu`a6v-wC{q1r){A?9LsUXqwxplM7#@4zfYUV9;=2 z3>Z;kXRJ1FV=bB}BhNcS9#VO}(5l!Ehv?9Zf;> z6sv?rNx)p-kzIKLo5G>grL{w?RjIVlzG|dA4KQUMr^?MsZcI~%siV91%*amfIY?0} zd2ZARYu{cK!58xE9UDa#6CKpioz>%2iT{yJtFHe0aj2T^L#Ram3A)_xztIE{{{63z zz@MT2(8Z?#jRN{)DZWtA2kz@fWxJl~2@GmL90VqX?LbluBBH_8TnEo-L_yF1 zGTT7(1wVrg1Ne|G!bPK5K!C;g7l2t94zqGR1E1&e4&KGs5-^KLp33Rsogiw{_z?nQ zdHdQ$5YGW>x@7_Y;-F;??%yRTIu>$!4CBI}sY)G^(WC#M?4Ide`(CzX#4-t;GbRoUmkUt9G@~UTXY=6~iEC~z~i)M@&Sq7mPWnxtXCW#=b z9fx@w*3p=T^{$A=Vss-%U=dmI1pL2_i-|*c76Y>lQB7`7V(E9rBLc}Up&DP~@o07J zzY_%S8jq6$ORKU2s4V^?jZ|6tuMgY*&_Gq~zhWR@8pp8tKn=iqQL?&4R}skHTqxlZ z$M7yN2oN0$=5{d-$qDpFs;*58kT7TzQ6vP7jQj}1Q7$lz2IitQt~~z(P;LDOPQoAM z{yF&{UH1GJ%>TmszafFD>Oasqt5Ad$z$gud6Bf~fo?EQ%K!8PMV8P1!u8*fz@MrAmF0mB(U%5F<#Rez z<*lj>xQzt>WBkcBKv@9Le_&tWid_5{4Tyw5xTDc1MCs8rH62UVar_va!(+2yWO92# z1*UbVBA8sp>X6(?u!)MdNxUi|3hU{xx~+^&!735stb%|kEs?pjJKaSfg5p6)g*ILN z;}|R^lHyp}K(ZE^x0o56#(BzM5lkFyCQT;6!t(|*ZcqtUm?QNpT@^=JETV1d;Iy7S z(MsXEB~)lfiwCKkRVEHdEnOa9tWhV>hmlyTRY~|*(IHrK0R=3gXhS5Fw58g`!Py6a zRM`b9{y6`|b` zhNWYGIHCFhZy#=Bi{37BMcut+4)+D3a|gs&g~R2aB8 zEDtCem;ekTfc3!I0c^_g5=d(qSP(#{fs7XULs>eIJZm&815$F3FKZyLG@`>+1YX0> z;9e6TUQ#Ni8H+`G1s^8dSf8}))INQZ(%_;s92PSI(>#`yiN}E4yMP5bcpM}nt|%AC zudz;@GQ0Ngrt0c)iLOK}6__ErY_Q~-Nok=$btj<8sC2*rO=B5Ibs%tn-*&0&CQ^au z%9k1ILmQuH$40n`zhRQL`O zpF`yv_zt4SdB;Hbq6(Y`uq-!GrNXcPJ*+?hk@Bh_X}q-tpGANx;L&Uac~-zSB+@)2 zpp+nsKSEU$1R&WE9Uti=B<})<<+T313~|)z;P^twbA+Ui_de!oG~s0JzY>Cp|C}DF zikY7bmBfD}Rc`-}3g7!!G0rd-(Q5an?StiX5qaa9sf zCHljVGeEe@UcA(i1Q6>1%LkSqC8BQ81Tbb;zkm%4WgXCAI@rTOqi*KM1mMe9*_ZB!E3+g zZD2gaQ}wW(1Jqb7^5_6p;PG=^pkW;F#WDg(Xj{SKvVj+*TBRCmz?1MQf=UHQ2m?l* z;V`t)Y_K-v6@*ZKz{nMFNf`osAiqe;@n&5%D-0wY7*s%I z>jt!k+cjt^b&i)Hpp81(n|THj!nZx6?uKG(|8!6&qJ6AOfQG}XeQMNGj-e3F@E_7r z6?%&Qts|RY{6BD&j8ygQpGy2cK~M&wZ2bqP!{7fM5-45&NfVt#E^BU{8;b?07K!6@ z0{p)T>*aA+MJx@NB0J*{eFa>#UmVmvU+VHWuu*`lUT?0J6OfYf2)TT(TLfd2ar$M-%RxAIl#M$jH?Ze++1Y{U2ROe1 z;0D2pVEh76()wIF+N?*`P;sI1YB?+x*fhDC1DupYek||LgVlLlF1S*;W1O~X&d)76 zt*p|=d-@XX%h{m!fhVx+yen6(e8f2TLU)W8GepH)-t7)R5JX+PoC7mnlAy>tRp}erq0M}gY*^TvL2_~ zk2J@-<#ZHP;h@)H0d@ctG=my+Q3W87lA?=`Q$=*_sDgj)JcWE%R*PEm62rnEx*yEx z<@}oC8Jky7VIe1gcclddbQ58b#R=mYJ0pSdVWca;u(^M4xrP86g7+yZbjpL556Z|x z0-o4xMY3m3Q6Yi>u|dSrjP|dy%ozoBKcF%mh>DDn(k$R`0t_7`We&jur|=7xjAe=n z5G32`$d=!hb=Ddnwr+P(67ZJjyvj(qnGdBLpIm6hf`_HXQY#|j$5-wIHM(MCIs&4? zs{uFL$uw49i~GutPRchB!W2jP&v+x>!-6@$jgL=yK--bSH1q-47LX_iJ4M z9`fmzfRVkFR>&WqcfQ&DNXpaZpwP7(=e!c61Y8xd&TBzDPK{gCpr8_|hnMLQK{3o5 zsVWf}4AJB#3Sw}fl?rD70sR6Rp%a~M9SRMRr*!fz8>J;^bPfp2XfIL}2S(nhgSrnL zfoFA8p4+8dNb7iS3zPvXS&Nqrez8K6d+kGFrbDd^6WcCe5piHZJL80k91)=#89M^k zm>G?b)gcbk!S)fcz=tIzV?-Q$Hy)Ef0_Tp^Wjb^T3VK8q`Ur;G5J!+y*s)mOkY&b< z)yBs~%L7M@kVlRt(fTSJo6L%flg9zl5!)6SBngWSz`qzxs7VG?8m}}(Z6U3^?<3?Q zn0EpqOCcd@2L8qPEulIPC3Shr6Ie4?0J9iW&*o9FT7X)@NRkJZ2NWfN zwc>cJzk}t=dLS6eNb-PcW#I|FS4h2}-BSU}qR1#9Gd%q#Z&hKjycN~LZ??Lpv86Yvd&mMR$w0dzSAlnRux?k z3)r7$TsAAT-arzWd|pa`tOf^Y>05Sl@d>$mQU?nbZ0EJ0bC>S!?h5`GDoKE0c zk+p@}JF+myz1cjN`=Z@Wv?MsASBes3vMLv35NTz3mm4U8BiGRqyxV5J5?}(5KNrV} zoDynyr&VYMYfvh=0w|9v+h&u<%i! zK)H})W%UoHB1rutx5sJaeBu*;g^PjWk2ep0IX z@a`B1vq68sD4X<(h9<)D8R#QwG@45PDMF8W=#+@j`?uU{*a|*iKu`G3f~8j2NLS`r z1#JSJ!hb9n&G!%MQof}w;GZ8d%QXyaXF({Ym1?Q9(_wcWQirHs6$1JR>5URps?-Fq z1gPO@DBmk>L}XK*iu46ufe@^P@`k&7Mn&>!4zL@3n}qswL45?P!|L7haNkDjl)hf4 z4N+07F6g3cZLsQI`vAS|Bo~DfFDc3?!id0?)u5ABT zPnG%p2NE<7fB$1hpt|S(gS!D%(VeeSH@9NK`dY(^(6U`5G3RIZ_@GaYJ7i{;$*5TB3fIjX1#88?7q`}SBglEDrg zu%sjm4?qjU;^VM@;&@Ho8LVkj`(Fvw_5anp`iGzr|8KqQvmNRN5S1BJt(+vzrZUte0i)VT37+wQ!4JyHa@2FBDOd60sgr|QrB1kgO z3kP3NO%Lk3E+}te!+H{Up+TTrWLD0{1}p&CK4j71DRx-Fk$Cwy5lZvRE!BIl%6k{w z>-5k#fhWwdE=3?(5g5363O+9a2^92W78E80;3B6)VC+gTLG94Cam8r-M@ZO3VCjo0 zM}mQ~qnZnt8+Ael!_eVAR6GT7nKocjG#pHH@3eL~Rj%stePyvfj|3d=D3VLRRYFBR z%LGf;XvG!b1V*$fvZWk~yFE&BFrlmh3a>1*K!W9i4=_McDLNu=qXQiQxv6|c4XBCy zTCetY9Lxy3yGTA|DPKcCyK_pVRgGnJ!~!-|)#->H@VrLgiArxh%6I+(qM=p8jXZBh zEH>b%yj;JNH|o%d!6HnV5KRWhFWni7#^Jd?c=}IX4|pLjCOOXA(!c-WUxq>nHKq~e z2Xb%!dwGy@%k;p=F7XbtmY>wi2V_ag8ji{?!2~poQ8s&^z=l+qBf& zKzXY+F=(iC^jU_=I{F%-TR*JtG@nBZOxje+y&m`ojOhI;1!8ne!1c(0_UbrqL>dq)Z0Xa0JLPJu_>Nd24TdO|-T4@walph(W2vJd{ezQTcD)|QIzDpjTiVlB~De!ILSxvp~FoC_7CoQJCH+y zbvcjkTs}PQ=TkaZAcZYTn{ydEA97_pT{mUF>3`u^dlf0i2ePIKy};s&&rY@R;Mrr(8KF?AD#cS*O$b97v*wyBFLY8wJpH^ zIRB@zvcgwdvJ^fdtD+_=4T7wM8LgIAR8f|QVuG|}31Wy3%N!5yG$qPgvVx2fe1jgqQnoOV`@HwB*$&t~>-zKy}|IZy(QkK#jt?55WC;NZe<)t(FpAJxX zp%C;~P@OeA!>P_NqiVd8(dPdZXovpS$nq>Tl`OFR`JanK`k%@FetBpI|3yiVQz`?l}h-yE&Qe;)WSDgPrq zR3`pQ2V@h7t(d7q9mql<5#jj|B!ogV6l$;=Z!8qadnvD=OttEy9i)S_RMC{z=kkz# zLEt%;$M0s?pr0h&G)(AY-3%BQ!7cDUzeRA-tRMtEK|kkpxp`lJXBpP#b_M;c&%;w7 zn>_6iT!~Y-^eNi9u3vR9-46Z71W09$l>EOpWB=0u?d89&p6#0>1^@5M#Q*7m_VOPa zz;@1&0{^{e|0l!$UmjA3|0(j9*MBdSiT~3Asqmjm1OI&){Z9*|z<-)bhyG{$e_9|F z{-;I%JsJL|15)6>%asoO&+tDjkOKeR{xtBPc4hdV4oHFjokGW$R2ffV?U4vhce{3kQ#f71e~+5Z5| zyJ(N#BUuj5BIU|f4IC!_dn3}zs&vrv_O65 z8yYv4KS}mjc*l=@eEH=)i^$WiT=qksS2l{=_xCv2kKBc}-j_f3Fgvo_!d`p!J^W+s z-YcfQJ}4v)%J0N)D%o`0t0UO`o1((Lrw?7QZ@}k^suqPee12f;X4}lhmm8FKp0};q zvF!6_57)2lUjB-bH+o3Wensd0xA{LAe%a z@1v_m4k_DmSM`!{tM}$U@@8*RDaOsIIbm-!Hs7y6qlw#7GpBZWVaTaJdagQNTJzrPxBRpyvVG6=S6_Q^-O3;DI56znO1b7QS>rxCW7+ts zM?0F9zePx`{?oQAbLJea=|4?2*MBne{U2$8`p*5Y9&34$=yB=8hx=6BOusk&-Bk>Fk#y>rO3RQ0O&{on5h9DMrUYn}^o zm+$)S&Yi@bstd|5SYFrruA-~D96#b84NDut-Pg@qzUhZKZ@zo+dhOlfSH9z4U0pGF z*Xd`TsvWePJ!DbEp%WKW6hu3k2LH>DTK%65Fs@+0&rn<-;0XjM7XSneYEg3xNM$JkrvI>T`VMhkYJgu&r;er3)4)2r*dp5M53*q6Z@KAij7mW?0TtG9h}UFeF(%W^y2a$EVzdqxxxZ!!m|UMH=a zG^OgH7i-qn%*(g-??In_V4in}`uc?1-kCOgVbyc@y)|>^>ch*2-E^RQI(y_bXVuHy z8#mnDIPj^$zV6el_xyX&oRiKT@`s|uhkqC`^vkZj*L2^${oH#xnmGRhklOxlfMk7? zz`NW57ZVV?pw+aW<9z-A&u}!)Q}AKX-RAh8cGJ!D-|NZfe>wo^{{+huWRJ2RKeH*F zd7t$19~LdD@4j35*PrhhX`ArH;mLElK6aUpY}`SQWurGn&OgPqdg~h-KK$d7MKAgL z%ZSr**N+8(j8Yd+chDcC0}Su;c^J;m(!ATxdRzg@oTD}U zCn;aD{!?^D|I-5XokwqdZhSd8qf@7>dpdv7(dc9#&5+vpKTnWy`#FJOgaA#sD7VMw z=iRK|74Xt54bOankEZlE44cMS5MC{68%K{=aeCsIF9xg~i(|-oHQhnQ?U& zGCg~)A9RWKx3lXQf!^}K+k4OGdDFiuzKl-tOuTziX7?Ml@{}uv zcTvZ5nvvJ%t9xI6|JfD(v)(#3cy%@}U>hip4=aqGLopxkJ-Q(Z( zv0u+KH(YYo%4dfTiR>A0ZntH2>)0Q5J2&0&;o+wqo^!|C&3`Cf-FMzOkA1V{nR~ac zJaBl;#*(fl{b$0y(oWYs9qo4DVB;w}*KMquaL1Q7IzN7eJNf^XoVb#?Z0SRvZC-2j zU2uS!f86pac1lN+^)~~lo&P3Xe9+@{1sRT~0uThy?tq_l({6#}ST7g`7w@ILZO;Em zueX{1_htNlTA;r3Ikr(_Cz1EhAl+yuX2MIOw--D&X8ZHbQT(Du-q|?o((y-D9KZO} zT~}7SQHs@$f|0$O%+5fxT8ULRaF!ldmZPovq*IIfly|4Gqimx|ZdFaro11FxfqVjv` zg-t*0s$8xPyn6G)hsW8vcIrKd__CvymVq`vYWF{B(nEp1d)=V=!GPcka=gdQyIigy z=VF5b>nG`e&}RSN{QM6^dNSvK(gMxT|8)CZpZ~eGN8@=NP4iz9q;~&5=<>KpKF9=U zp7D}C!RzsQSWciw+T-Qf057m!hK#9itMz}f+5R7u+5b-ufc{@yX&KtD$MCteC*OB* z@Q3H-Ub<*e)s)K$r#$g$=X-D7m%H(j8wdF#FP`$?E_#SV^354FaSGTi2t?)}r@ z2dr0){P4YVe|q5EH@D_pc**p#d7ZyIv2b-q6XAatQv3cFuP+$zK)NrWXy4=YdxPk^ zwrSE!d4gn+AziG8rrUo0$JMO<=XSd?`kxL!`+t>a|8L>^7i~)C=WCblKe4Rrk;_9H zruGR{4DIvC=AMmj@BCsL`Q-Z>3Xa^qH+iy}n9&bL^?t&0jS1Dl6N4Y4pk)Kb^dG&}+WCzAN8#@Z&k> zPJiTJ_wgIU-A_|4SUhLrBC>Pgx+6V0O|1KV$AF8*y@9|O1>i=XW{!a_kcOF|l zwy{sY9$&w(ehufi`%1-*ZpzJbm-&r>}i@)`@wy&B#6UxqXiIb(dG3nfu83 z_mow=z3=iP>&Ja@t&f^rAP?AgRp4=U`_;XMMz;NZD6>r4IjP5!|M_Oj$@AZvbLq9` zoVR@P+$Y{3huk)7#*S zpraXYKx*IrNPFBAE92XGw$rd9k*SZf7#+bCkVS7`xjklh66L z>-g8#esJje1NB-#pVznhF23*iuTQj`_8__Hre48rk3aXQ_^0Zt!u#$O&;IewPkT=t zB<}s;>}jhP$bVbRa5t52U3^91#=n&~*I&MB)9eRMJM63}wf6kr@}dnTt1s{N-PDUF zRjwO<&9jZ;I-2CaDoE}7e|_lo9~*G9K1lNe0w)MQ#^t9dfn@wXiu1E9?PA&-|5LtZ z`cG!=|D^}a`o9}Rac$fHpbwRopYzp*D^I&|+kE%jolnhr@y&hLAJ}@Ubmp9wdk^fn z_I82_6j8+|ugM?W_|5}EXNdlAh=vXh86gLoA)zJAc(Zw<>zQ$fb#^sE*}>#=SV^SY4rUs8U6p|;TPBc&u@EX z?OP4220U=-__aTt`SPao?t18Ls#CvHs82e2=^5yh>hFKF?YH&JIa-bXspR@U>GNdj ze`x`9{%b5E47SoM#U&y|#Y@ihNzw~1$3ZU1-bhr7P6`03rs z!T;Jkf86HngTI+_(U;dWzL!5*+pPyG^iAbwk&BNX_wgCG-cwcA(Zu`>LTbPN)V5#cH0Nl2|F7BkAD=I?|Cbg(_kT;! z{oi2^AMT@GywyK5I$@OU!4VT&mn|PKYROQkZ|UTpetPPn^_ONXo3NtSV=GTz@=zeW zxN=l^GUMde+S7f%3G@Q7Nw;r~58aLR_-*Z2MS=hrTp z*iGIu=#|@^UN`N9TRyt;hdajm_v|?Ph3KcRa+?oK``0^XjH_TPJDRS)6=;Y4)BA0i=nhYywzIgjBmAhIo~*+hwhWSI`TC({@3T!^O=6 zz>-aj5hduM)i4@?XsF@ek0)}oa|uS_36Q8TFKMa+S`L>Lf*~S`j2s9NmQ^j(K!_4i zS^(X7LXbltxlWX-i8?tN;)oy*t*d33BUD}^WC2DnW+ftwrtylT5_wU{m;ntDCPaZ~ zkfTH$gC594RORt=TOoALcTAO;O7!BwU-fUXcLcOU|7&Dz zgd?F=%mLZT_doiQzyF8!(R9ZDrvv20b2(V zpHWoN5Xj>29BRsQqL#QYb3|ki4P>E_!~{dgq=+gWrGQZ2QP_BbnxdhsO_jsyuvi?( zzS`9qJD9R)#G>)4M%e2KYtD#~6Q`GrEH|`DpBr}~1`M!d@%21=%tkqLsdKD3L#*>H zh5waJYq$Q#k!X|dBWOkcDQ~myfAzZDR7U^P0Y8WSBNtx^8U^|kY#^*CpwJsxb(NMS zaOg^P6nSgi<73s41>O6D^1uK%j;LYO7F01&dyi@_V2GnwjP}?I7^NkP@k`l@1dRq; zkxfiW3~C?_f=N+3hT|Y2st~Isp0mq>U3D3j5m@hlKvG4TZuL53ql zj%U#GYF^?MCR9KKqxw`4g^xhgW{)ETW0`%!GQ@L0O-&~N5C<=_V*JqJoIJ$sT1Fv| zsVbQ?@!av{(?^yK8#j@d2hkfx*d-!YbyiKwbL0=2W^?4{IGZe^keEg}Be^yht{PAv z?6XzET9pGsTfzKMR$|^ff@f=hRQj_)gYaVub|HY8DXlEBxe$$V(MU*S5u=+^3qn!d z{#va>F$|N3XUwfiLMYdm*pfx4GDNlWh^QpaChV-aBA&=~R!t?cD)TAyzmvHu1c|7f2l+5USn_CGz)R{L)l z2$aS#>?}|NcrUA>CMyk)zbQE3l52Sd1_99t5}LwDY6SF0ZLdvC5HMsEaU_I{jQ$AX zC8i+a+rJ-;lC`a-0 zpcw~2Z~y~TdT$G1yp8sX) zziEM=Q~z7b10^|@2CB_-I$Y&#s|`4c1%NSrW*cBE0Q4X13tExF*V-Wxf^f%fH;8iX zu#z%jkdxzUol-OuBIrQ_C<{z0S+baFMwC>o7&Wo*A(gjeWfLPMQ4^VvfmI>FiGn~F zEwQ-_N3;frpm+$W@SbaY9Cy%9dpOqXrrDsE4+a?0OY$CfQ1El!0PXh+L7sO9NVi20 zQI0gSX;mC&v6!|c6{RCb;+3LxtGLjP7Z0hNs1pZLOC<`%8h3&|jLM3lk?^syB#6~O zfuJmhFbP#hlXf;VdpV@a3aa>ntVDEiQ8kWN6o($wQIIL2cBP7}szfBjXb?$;&3yvk zATQyBlc|+Ot|hdKP*_?E;)Lr5d{}olK_1Hp$LZ-R;(t6?br9$CAZL+~Y-I5Q!)ki* zK~MidrX&qh03uirD!jD;0;soEA^HVzs$mr91`^2thJdB2ORXk`IG`9v%2Y7pBVn_7>c1tO@R_!`Zq$WaO9{hDH+0_*{8so@pAfXEZITonz1 z)(`8O9R*Tz1vnN*VK);LLn4wQnW&IMz*Lo>$Xu0hMpXrCyr$R+2vw9=ERuL_v!f`& zHxK|71{X)vfTFxQQ{P(@VyTDK15ewsS=8RKk8?48a&Q|W zBWWlXjq1&nKTs|Tz3Lh#-#%mG>v5t)j{BZ-(fX* z6RA#CX6cNL@G`QAvP9tRv6!r)lEOr61a+E28&S89T&<{@dK5D*W|7EZ=;bU4)DfFh z^bQf9!{ruKJ>oe=GRFHDbM5v_vi7Tll;Xcg zRBc=4r$a08AMI(j|K}xLnfxy;5Rd;-4gZiZKAO*eJ>RICUcUt~jnn z0%}Bm1a<}(cioFOIg$Xe9#}qDf?9~XAEiy+4`=jjP8ZoGhWx zB8Ns@CzX$By{&Gk(I-0kS`8vNHvVXtFgq8Uw?A0A$_SMCFHCaO#}yK zur3x9s|F_6^@cp5_#C81Fqols}*Qy17EBoP>i<~qDlx}&{m6Oj+-nd+Xxm5kProoJi`%q zrPE<;#w%Eu!72REcnMD}oNUQ5Ld959v@?+da}$*iQQ;s5g0pjh)FBjfg+LDBNg?=j zoJyG8n5q z;Hj)LOoBigYmS+DCK4jHJ!2h?W9#^INGNh*tSdlCLUW0_%;8bQ74x%4$es$mmVMQo@K`1$5 zE*)>yV{2%*P<^!=kq0(SujYW0lJv*={yeNMswilsdPke1ZO%`VBO+_`F;8FOeYp_w zKIjBim{+Rx%15rm*K4^ZW|)fAyrv}}2vHZW=fI3f5*)ed=P2Q1G}U-%vy=Lc2GSfVKyY-gK;9F%D7fzY+)hU2=Z~cLltLK_L`15 zOsA5F6Qf0y$)B9Lh6>F`M@?i!n~~6+K1%mEw9q}SbqRRrr(Y6AHYsh8KSA$ev&E6r zr=5XA*JhkECCCW4T4J4PL81}6CfjjPiPghodR9sdGb2?aB10jX{=`5GEwokPOdw!f zK(m~3M04WM5PQl9uY^1f%8Snd!HnSsLvc{#T~a<`@>H_2$ao%Bs}Zg9%@#NVHnJ9z z4so%o=7{K0%n zv({F^oPeq{NQj%kzudSbv?iitZEkrIYo>-sS+f62Fv`wqVts`X`06NR(Q1o+y@sjf z_3}sD-6rgCD105tVsJg1$Hi&^X$hmMQB)o@2VTDZQ)1Lhb6N|elZD6>AwyfORD0u4}c0YbdQ8Dhww zsr7QYp86WqA7pVQUe}pmR0Q)7_no4CSXEXK7N|eZC?OG9Z;(W07Oxhd@(Ewp3?mk_ zQPZneh%PwR!2@6~D@M#>kBJ=KzeI;Daghl^PesH;ka!jqAe07ds*Dwc(ah)t4~_wl z0TgHPkif!96f=M#R1pb=PPX&GeqyJSxK?a!(e{om40><22IanZw-YZ3&1gzdflgNA zf($0DF7J8+LvZvuT7kK37ApZ3fcz;OD|1GuVNPq%4Ar14dIeA)RkzJLzknLGXonNK z=2>`CMBl22DtJQ!KD5M+L>QYGVIHkTR3WamoUe!KFp??O1^Uhm_6Fwu4B9>c@y?@c zgu~%LyEjRahU_gSBT}LSORFOcEW7{|s2Y(hS^rQfg4Iveq7jjciBAF+3WLNScVlOyAiFi{?a3pGqcjVGTfsvINb zu>tQO!!i;xwE2wXP&YMkQd-9FTCPfjkiTGzO?pE^3sLzD`p9;>z14q)(BmFXBVsiF zHhYa)p$81~ME`OQW5W zIQEcEO!c-9FiuD_O0ZZ;3SbFH!%K0#*VKsUro05}3%UX!i1qr0yM9JRH8lt9M%*Uh zK0|RIL6k&u&qF(k)){?Gr;SiCtT9>_dW#A&SVeSOZF*8XPbnT1S%75Qh(ry7Ze)u2 zB&(~(;-$uTu|fhQo2ZUZQed2kfWTd0s(H)MW)n|D4muo(f;|A!jfA+x#HLE8Caxy5 z+`<6dLeEEl>c}o=s4N{1xf2!$aSLi5UtS_IbaP~kT->4iR$~&~?c=(RX#|dL3Ol;M z*9xRk|4q6n(rO*Jwf$e0r`h+vkYwijpV9*DJ^!ED4X~E(d^Nf86}xw3j#yw+Y4s6} zGe;O3w25g9V{8>=o1MTTe!a!@2wxsF*cYD0-&=lN84R4 zFt$R?9VEOhu4u9S<@TI2Oj0TRHdw+AwS=#~BT}JLfd-GvLzIH3s9Nm8Jz?zc!T{D% z2(3eqn5czTRO?2U>0upuR?y^3BrbA8AkHOD#hVBBP(YG!unV8(GIrSQ;0Lqy*frrM zT0xTy0Gv1BswD1XHHOvw8orKe;EtGW)T7aCGOtRxXkihfMg+k~7@Y}(BnZDpC)SXM zj7d*I@gGR6a4~6SI8JTL6}kdlDp`EWT-D62bWYT>Pc!9HfL&nkjc+MHx9S|RqB32O zOkodZGdeGQ)L46Y&)sx_b9fNU^**G7YumEiPuti6w*ii*X<@Mu4IL&Xi zRP$h!c^BMtdU%|~6XwLw28dP!25p|g=M9iRAwL$xVNwDvdP)Riw}J_7hqsMeM&rLi zA}oWYZ)hC}2F;FZE-*Llgb#+{!+p4T3UQeuVNyICN_3C4c0E;Y>+)k|v7e6w94|HK zrQbH8qMv0#rE9$6mT-a*MMJiXLvcq(Ne?EBRUqNjg%%`OKlp$G6pNuF`ZhY~2;`>v z88uK7{k6+#cC26oUTe@#S?bpi@a~*ZX|)oSMMT1;s3E z+Q>6I5_t(n<@NfVzEOuy3^owPgm^MEe$&oG4vEhFq0@i*dfCgp5A@#g_xd2smKjBnUEwiiZ9b{V2W&}_4M%I2U=o_zEX}07wcd$sZI)yKJx1^3 zrcLGsmLC2BgWZ5|z1Fj8HP%%D52}#3*1ooVYfE zs91B7EiZ0x4E~jx(F2pP1O4Bz(8Rt4NlRWtGcVH~dHcEW)g!57dTZ$JVLYsAxkF3J z)U4mnvDTzf|Eopk>-d(KH(QXUhA2ukZ{sCCA8fNUF;4o?d*pBn!TzCLZwWgjRF{j! z&gG-ielev(1ya4qEoO}~d@?HR~G1~QO=3}oOK@c#ksBw7&w@Bjey CYO7cP diff --git a/deps/npm/test/fixtures/github-com-BryanDonovan-dummy-npm-foo.git.tar.gz b/deps/npm/test/fixtures/github-com-BryanDonovan-dummy-npm-foo.git.tar.gz deleted file mode 100644 index 8e1abc6d05e704f29f8699e6e44e63e4e6a6f2dd..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 12712 zcmb8TWmjEI(>2P*-QC?SxFom)2oAwLXmIz<#)Ae61b24{?g4_kdvJG$z202Ueg44t zvc~8h)pJ#is_r?fsG^Z!xKt#yVc^a_pm^iWFR)|PftJ+?!)Q3%m3er7{-jT?PpNnM zp&Y8g*wC1#z-X1oX&)6F%uF4OjM_qt988V+rS{4O!jciA?-5 z=JNPyo)(dOh=VUSuRG?Nh>2yd29;QHhTi*+E;4z)LNH^Q9WljIG67QesYNFYL5(Sq zP+X_2=+q~Cr+0B}aa)_+D7#u|K;|wXg>b?c=&)C9Zv07==MxGvi4eCYd>edgJ{k-b z0_2?&b^go@cq7Eqi~1)ve@yP+Tu9~ewv5;voZ&Vkq7%ssR{D!@IdO1@)#-}e=F8o%c>SlAB zu;@=B49;avK0j0*fpr2rEGD<*pI{R-as zp*cU_eTAB6Q4@yv%Nh=#_88m5`@r|2z)DSDxD%4h35xWMBzB~j>Sj|5h1cl|XKvYB z4N3)zquUa)7}o0A-#hCh5?v#d>`o^LteF2=wlU<(APH}FfhC4%P9z**)pZ$!O^drh zS4rIt*LNYav=Gj0;!XajnQ0oaEEQF&Mm~hosJG>eO3lb>6ks1`PaE5Uvlv^y)tF^% zlSu90*&c*OJB-&duCkL!J;SH4qDN`%{bMfSz0)r}P!!+zH^KxQpE#>=c2zf6Wj%X* zN5sRGs%_1*6qZUp1wE36^}bb{;NYHU!Ug-i%1Y$a&=6JIisj-RlsGHmbUGI~Qy7ve zKCZ;iBbdghh4YS0$oQ5791FE9%$8A6iJY$B&cE03-=l5fKAwt?0XEOTWQ5|iNy3EU z1PO(6~#Xw zj_CyO*{e7!HV7z40;aFQ>X3g0K}zwocn-+@cUo%#K>5$$ALeSP&E;nP6Y!r&4nxy( z{C`+rKfYt}@&BSpIq3dC3Kdtjef~ddH}wRt;ti1hZ(p1$pN2K{m9(j-Ri4N3Xyo%nyq-PfCN>ON4-(9ZzDe;#fJT#07^EwZ9OG^$J? zz>;lh&+f$FEtM;rh~rEaqDgPr!25pSFD(l)Ap~^-bSSxg{6aN`u9pc|tp$JG1c(Tj zE4!TctsXo(9OaH@%?MG9b zC|Eg-2NZ+uh!%Zq&QiH55C3igmHkc5-X~8HEz5r0IoCd-0P;iihYdHl3o29c9Q);3 z@C2)v$7tr`wuv&8r>k7^!Smed`pxj<$$VA7-fANmhsF$KIp(qkVUPK}{u%Q=;e(k#6D+-@lLwG>quQs`RBv zp~L1?Ol%J@abwc%kG0mQ%@b(An+}>7@X%^<++7B?J06ffe|im5Wy*Y=JaUniQxVL{ z66-ga#|OSj%0RngiMAH)zQ6C~P5xPLa8?*gz)nbd2p@;f%qE}VAmbc&y-UT!UbIWK z0N7pw2hwJDV(p%oe}2pBR1h{4KR=br$%imY%REu7u`k&U+FScTYC#Mz?A{`JqyI6T6yq{@hnrJ5vzP?6%&uPD!oz~NZ%zE!WGv&1Nb}c)q z&Rh*4&fB+L&k8)mdfjFuIWA6;TZ%$uD>*u|p9YGn7mqnN18i>^`ybrFwnGbn1{*n- zcXgz^ixa~e55ucN<5g%SH5o#$$44GjNhNEo4cR3xW1$pW#x=ruE;EN4Z(eSv+U)L>yh!8n9RnYWT5UyQ;V}{z>oqq_%XXj5xlHDUDap^>8gGDwZo(Fv zurjp+zD`h@4^PVp|CNugOk2Krvzj3EyY;y-(0?K0HQphNpH<$TsI>F9IS#h1xaZS< znuhL^3BLNxzVw9}d5C`nmgO&Y3$s)M9{h8xRVwc}F1o#MUso?k3?^@&b8D~TRYpwN znXe9=bHlNI=j+a$_j_K3Sya40SE(luQIT#4xM8cmVNIaDw`k(=L~Pcz8+QN;J~T@I|&=(%T3vDVlNZ>Qe@Bg;H|AsWF2)3Ucy9SCS2nR6x953!v$KH}%1iBP8rR6z!=X)Nf zbB;Qmc0rGt2%H3m#jMj4{=chrmxHgolRV$2R+v>%m5B%k&`<{CiOI*$ zIS%<1toQ;wIE48QFv%ab{jyDTq3c#qiDju6@;YCrnx#0hedq?47I%(jz_~hQY_&O! zZ$ptTOd_jZAF@lvxH3OIAMW{moA&xuKL29402ynyI&CbbZ*o68uI%b6e6}VsKX;*e z-+5=3RI)-PRM&m7cvl>-?0?PMa5GWu%UrefB*-f!+V%3#41U}{RlH9)9mXpM-WR_8 z{a@Xd14FXmG$`qL@Q8wVF|kOL;zL)T7Ah7i|2rQ_)qy4&149SBq_SoXoJU)q= zu^a(-^ws~doCGunw%T9-6UJCq(s*R-Q&-3R)xL#eWm-2)U>{-ItSXV?$E*7G+@UBP zQ7Sv!MNX!`qk2+ll}y?|p?BM@ZznlxzBc1~4$6%72F|Ky@4ES_Jf9@r7nSQ&gF++E zfzPL2T>suPG61h=0EK+HBY>im^WEP+R(SVruTb0~pedbz&(;Rs9%B%NSsqG!k_m zoElV}|5 z47Ie!zpk`hEzSz+9)pLOvae%)9&)w)dNTEWvlRd3Z>4-+qpdvNO(k>thDGqAp1noB zHw5e_UQeo}15^Y-2jBqr)vLC30Tbn0WxIDBt9KLcY78CkdRJNjFH`w;>-M$=Dg%~4 z3!qq`ME<(VuDwD2xzM-&EXO}}b!#JJ)_7&3XqoQK%S)87JrJ1vwiCW_P7EDKa+@%n zy~rHS>~ttT(RYndCHhpza523r8@6bVMJeL{-1T#IA#;QH#bt2-wkwii=>E0tL?Z zJ0IY1A8tkFthM`wiVJ_|eGTvMG^R%Y8Eg<#x$SlaOm)n z@3j1<@LtLj$*4gl$%|5zt!Q_er|;9!HkBclNQ3EVk6VO%x3JYtnl@R5kv@?@NjXtj zukt_Nz!giXCkO|TJwWsK^tX6aW+<2=zjwD%Q@LwNBvrJ@-mm}>gGy-Cf4C&a_#<0K zGW2&p8T+&B1xBmjj@sETL4nv6cX_ynCCQWUmzP<7_rccNL6&`=4+mmA71KK`So{IQ z_xDHr;l|RO=bdbOV=JqgJK6pMKAJCh6J{?or9c-5Hhb6Iy91>ieoksQ&>BMPGz zckthF&)55fZpXScp+}YNj2FjBaP7ut&5{b}$%$25x8IVKSo__`(PrU8Q*m4c-pvMH zSNkMX1ME5ttx#Ij-1I*npK`jZ&Kb;(0^c(ODt9P3U)n3u)4}4AhcDu?5YUWM$r-E} z9FO!=jKs7+0;5dyJo^&Lh#k()e{GjSiU?pami{V_ptuVRKS5rB)8C@qhCEDp&W5fl z{WWLp@7@Z;pt4jP>)q4=GT~eY_sgqw^6{NR6C!E8FGK6;CFz^cVuu2`nswo00=r45 zTvD}tK*P@`-;9YWrg{CQymR)8va9&zM8@jT;kLie^9{htoAn??0&wGSsv5==`m{MN z%o_+q_&&TfbN%#beD19{Cwh4kxSSWvb`DrPVcJR2uikkJz1GQ-EX1CE5J!8jf-DgJ zyDHS?K!N%mo^1wSdZuIEe87Pa^N$n5DfsA_inna7Sq6I*bfsWPhjB&&6jVtAe3{p>@5=ZCE89i(B`_|*Fjjn1>g^NE#svFp(% zwKvs**OgkRwPGyhC@}W|77r9D$Sr4qE(S+-0XfYYJ)_oD_|{F)ms^pw`eUBq)ZrKC^ zfxW}D`M`e13W}24kje8f_kvf^U~l}O1Ie%A)zShJaZd*i;Kq&PHyn#bdreNQ!_NJO z<eXygywI zd|Ra(rOfTxwOy^?WuzMX<$W#q*@;Eac9q7Hkl)F;;=?jqxsy>ApKjv$SN~NASr!u2 z??H!k?#7)BrLni@$LPuE<(DI)Ns^84pAAb0Zy%4J4kqs$z0I9ASB6%K_|_Xb7OJ6W zg8a3C8uDUKY8UI!gL>l*G576x>o^Yb4JcekQm29c_PL0MirB5}{e_A9QhiJ=mbTk~ z4&d@Bo(M7Cf9Em*F{!3;-lycvzvM#DXw<3gY?x<4DbuS}e(+G`Dpq9g%=c|*()c}2 zs&AFv$fcLbx%=;C&bNaAQDc7&zlP@XfQtJGk;QyZsS^xBmY&E5Eb{OtH3ui zQ4Ep&)Kg)iyNfR(D*BW)4S>BiuW?vpAP`m{%w|S3-tn`sXSK^J*y_xa4bvYKMeV&H z#oa>ud>`(5Ca(AVs+t5G!dwDK{xdHoG9jZB^*JK-hv#$i(Z|Jy@f3+xcjC?yEux%n z-$c3{9K7>XB8sKc4Udk1hvUj^RYH4)#H1&`YXPc^x2N3drzaxEuU!oH-<-r$y~W(r zJKxa>Hc`iOm5TYze3t_jo0j`ipT`tzwI0r_NH}Ut?4FhiTn2S2b~3UBRf~7Hh&`+| zFyp^2rh#oYfA77`2&5%WbX<=u{Rra~F%ozUr0#l)VN%8DTG&Ym8*f-zm#*P2{dGG) zvevgrhHKEd$JKzjX zZcgv7n-K|6ky{DR)gRs5PHfCi%nQiwjRx>BWBo&wSES~s#IPnF!GsN*kaELURp+y8 zSS4XosmFJuX^F}KQfYw02QdE=aI-!61Got*xTYljWi=+~#G^KEq} z0Smw**7NE_cM+i<3CeT{{=@e#HrgFaIK>wKMy`4&&s|YmVHo? z@y!tqb6PFD$vM~r&My0jTK#?rj)}d=^hU8wHc?Q=nk*N(oOKk$H@A7&?I<-_Ofp>5 z*pa>_(ZD`6|Fnr-wkmL$wzneQ7zDXA|NT58rH8;aq08)z64c9<0MIEe0KJs|NCVCk zT7y*yTorM=JPv7lmE1>(zfH}R(cPPwJfuI({yOj!IIKJSI2sNYSMA*d{oWhbVBw%T z7pQiRA?#>8eefi(esF8t^<|6n&7u8HwNu{Rh;3{VaGCuOFO~^?EFCK@DCzVCIw+#u ziAeb=*T!Nwpl{}bAK(6@c)8Cv9r;@4EQ)t=)zNJVez;%1@M?tG6aX{5UTEVlhCb0> zq3(a{yfCeS>#Nvr5dvKvma73>zWknAqCN*_1qPXQ``}F$+asfc!gorX80&u5TPXy9 zPiIeC=Xw1s$L3N>Q+4^bC&5tU-5j2G^lU2}=#ZV5tiL{#%`4t2g)HrVusdvuZ6OS7 z7QlGX31CwN6=a1u0Y4wwVPmxAJ?Gqly0x8_E=vT^QX4B%q*YXy$%$6&R==ZFA#S!$ zKMpU5)sXwH=bLQ!uSfU$W%6Kce%Sd|A??6_4Xru*D)v$xt9fD5%35J8zLSMj^}D0l z2-?LKD74YiK3Zrz>nc`S_qdoh>9J($^Jczp-QCE1{IhfK=R)**d3|*zf%SkspUW3{ zw`TtojJs<>tKmtKX=z*4*8*9+;ry`0)~-Na^G^ie!`q)*)`{U{Sw zR_yeT{okz;`VgWAK3`n`+!;#ifFPbelYRreZqmy%BRI}o zP0cD`Kht}41l)cs@7gJ}97?28Jr1y%E!FzELp6k1Zs~J8YQ1x!;_Ii-2NhAigCiaN z;5N=KyFhiYu`5m`Xm{Ui!Z+?C+@L<;T?Y(NjWMp=+nlyOo8qk2Uu9#Vy@+pI9maX~ zckl6Jn`BPeB|nV&E^dxd-ux-6aN`IYmACJ-J{?}zN!on#nP@_Jx%hB1dKOhjPB_*@HcGgD-hl1KCbkxuP|=HY17;t`|BVn) zE4VV}Q38QQq#G`V;@{6qO%)zaWO*mxba7Gt1`jUf_hQ>W18TUuZOtKWdKao2755)k z8^i+xc236s`o&kaXcEZ`R4KxemSYzBuc2%!>a&+?&sy{?glvg3_-NqgU5; z1Nq$mM~G>{Z>dx43>@4LYL4z;knpxEo2(q~JW@8yENoom8ghMAU2j5?zcKn;=_>?& zA-Z=c(D7RGe}zO(>JQqVJpW*DTTRB3)md3Lays}S+5O@9_;@if(7^rF{yBF8sitGu zRZ)GAuIw~wpq`uQWV0k&@FF8QVfpx^FT7y0P3(C?wvOt4-E*jsYe)g}CBIL)m?O+d zS*2>-d$sAp`r@|gVg@b8;-##~cB(wBhPMl#P@S-GJ^ej=Woxm}aXWmIW%yF;Ms)sY z`MR>BJ)Zk-7W5swB7<@%3U-eB?LZsRKu9PA!gr{P?qJqe$gE$L4X$hfoEVh?049s+ zYd{@j12ltPOdiy2fW;y3?Lx`x+k?mI)r#2I)mpL0z8l=67`p<=&R6uqBY-TZsuSWPP|c zrRpcx|GSPiNf!8Fq2*5gY&S*FSj@R)Io-D((L_|=fyHGKDFd3MVt@AGytg2LgA7;*TM@1Lr_L3o+4ZKZCUE1)Y``- z@0dGO;w5#?-m|3GTuZOv=(@BaHc7PLR{G@w_C9h)_74c|MBM7GB1NzfqDXAtUsWg@ z&~iQE=&#b)AGsCa=}H^SDHjg#Ivh!qF5Blxwy-(JXv}33sn|@n;ZSZyVSTfgDBV?f z;=V7jKbq%Pmmj_9ghY*ktLgWK85ee32tl0At%#|a7Rh?4LweaFJ)=)=f=a_T;xobj z2HVq+B>~3veuqRik2(p7wiZYs%@6bM>uF;?6qNL8hSfcLG`3;pNZR4aA+7LwR&GIs zbw0sl4MY$esTa7AC^(DWNJOF&XGBu6X_*i=INn{_1R_+5a;USCW4~@Mn`GACn^9sm zSjZ50{b>Yhum_u)H$(hl?{g?MsswZ!S>n|)vidaXz1b3J-Bb)F2_}d?uBX2k_Tn;( zi=CTRE0VQ7HzA`*G*8jxk4-ZE7#d~k98)a|xuS`o$gNz~1oB;lq&c(Ljv0U$XRC5uZ zxOkiIbVD4Mhzj@^L1QXg0lkx^{oG>iNn82T>^;5a(r7)W?D4|hkg!QN_~tFkES9wO znooOIsFYhxBvQzbI@kas+{*(P{s2@EjLQ@c62@UVVJb{()}-&d((*QRk~KF8E6*B7 zk~bua9mvC=1)?A!SB6~dCvHX$@}D-JqId}mn@ygezsw$xmFbC^f50|F41OhO7PvF8Z&N5&;9U70Rr3F-=!iKxBry~7^ z=}7$&p?XaSc^r?1fAnM<*#cV!R3Q=|s)+BU)SEtL>+<#!2#rpZ|-3Com+6r!& zQtFTn{Cj3li`L;3KOd%Lb0Xj5JN)5gl3qs(7epe{?V=QG`@(tF6$D8AcCw0l4{@2! zRi#jrIgUd+y5hw=S`~h^f!sIGMsMs9Vf?>AQ!^(>BcvX%0lGikgyw?clh*R-kkooO z6;x!TmUSzQXfr?Hg^n1fT_O1m6xb6j51|>?s9zl;W3%*n9vLhAco&~^2U49O5MqKM z$6sUK`f|g7WJ0)7HpMZHw2HEa1)pl}dU-0?DZV6?93%wN?`B7Hf3RJUpR2S4l*|_iGgA5 zCYHR_CBt@;iaM@i|3YkD2TfE(R;luyqP2RE0!SwgQ(hg3A6`0GS%W@E=({4+d=F+2 z^1tFChp(opya0()^XCNnyBvBpct*^Eyb?k&5;KF!c;vROc&x5Rjp?t%oXk-fMc2qz z5^Wr?9`hnzUsf8|ZXzvk#h&vinoS%+6q~;Xj+(fro9GEV30; z=)ztovg91J$=SL~qXF3+*Cal{p)bW_5DbqS3icx?#z&-MD4im2bYXr@nDqJs5=LcB zl}P+pGGduc7D=a3c1b}m7C$3+Ng)%D6$81HB@q%g)l>1y!tC$ctwjgP^i_luqU@3e zlY*)xBpL{IMPOE^eh^ZF_V6uV=(HHr;YG>v@#wQ+?%R?5g)NvlrO7>7eDbib$!SP- z1HQK+h7eZ1G0@-wlRK$w#7``0ae(~H|4or!pxuWOe}L$@w~%(wW1ud|B38P_YP2;O{-9^8BwGo~;|1j423S~sIV zT*=lGc~l^9OV!xbb};3>U}7FbWUqlJA~pq>F3Kr?QxsRfIgU7(5%d!(&!D_&IMNtH zq>|eRyj~XqlhD+)sisIevqhSp0i#Y8Hg=ESg1fkgaLHM~EuXkWsWJt15~UB=T%D_W z7)-N9H2hlg>dXT$O?$K!5VFkm2H<}NhC-z1BNI-MaBAT?5bd2==P46aJP7@J@N12y z#xRUT=edGrnZNYaVyd915ty=gqIdjo(}V3$$I%f(IfZ>xkK~H-gd|9UzGy(wgG0Nr zrMM(su%T1gy+{3%g#_IgF%jP7R105oDU~D$DYj7A1LKJJKEeOem88a?V0-LTxeT5= zakpT3k5NN?=pGb0WrnXyDa|&H_*K&c5>}Qeg*BhLRTh`({;s@&*dA4t@o&$XF5zYA z_awN?hU}m@l|y&oUNLyp6}XHzsc#YwQ@Pu3aBvc;n#@6gSsA0slDL?Yak-);iP!>C zfrk1*tXpLw7{q4CBVGA7HBu3$AuolyL5|!CByi#1c}b(=F+bo6d5XA_<{qH76k>wJ z)Qk&bF=dQYklg9li18)v4iOt8hWKq*-wt6UCCCB{sjtzQWG=nsHYuJK@{YEOBhl(P z5m@7bZjaPe2O^||`oSL+Jq}r*&G+`SbwH0+z3V_cc%%-1mrSh$m`J4B0Wu2aY(OFP zy{xgkN;Q@eOdjF4olmH*n^AZ7?G(5_Ftrk*J(POktHl~AZY2$l@7n9$1yzE+R_nm) z+7^b-GEYb@lai3pEo-Wof~2#960wMx@tu20DPxZ1^h=O`z6R;RTO@NoGt7+Q5PRXr z`hB6AI^Y~w0$m^xcf*<@_D1CbuO53ej(Jl=R6XeG@8mC^`mo`R zQ*(d!*ay-7ann5JhJ@XUCfK3VR;$3d7f_U195TX$svFCeXyz34>UlVOTbd8l!wytt zb`A|lk;#_Ryw_Jrr#v)VPDYdap*;1>Y9;@KUIuRcW0{(XIRT^0JXRDtI2f-(XF#rm zfZRVtV(Wn26|B2(aTWG`A0Y=fE}xyeQG~n)GdI|3DulC*8(zeNhk@bPTtn02aC^MoCDf zRO6U{-KEIHJZ(vrgc^xD8j_Hdg7wW3y;^RMIzr%AB9g~r@EwBAYxG@3 z*snzeg6WnJh7@}YB7$Wfs2TEbUe+SEG`9MF? zKN@cy)}HSww?*W}oYRz{^-GrpqL2wo*rvRixe{e^gckCg+3dFc_-km2REDXeSBYkW z-95CGg#M>Y<}Z$^?C&(hBmDkyfHy}7^D`7@5S(3F%pVyk&T%g z=!vzE;H}&V%7WoOTyXyU5FXdlpfP{IDU38D!ZHOb+haF}n=5T&kT(qXocH#z*_eVc z&tZucw>OA$0S-Z!agdMI4BoM}4)GnEFb;3;{X3MN@FI`jkur~tu#6!v6RD=8M*>Bq zhd6qNbcc@8{J8aujNB1;iwVlJm6~$XPMw=LbumUoJxw(LSW*vd!zqBQR3eYvJZw zZJGFg#5?X+pGjSKzb&lkp>$*pD5=d(xOxYM5rmP8N9OPGocVHQa4{dne{aPQ-M&Oc z;Es}fvIj9#$TBljvcH)5N)X_tv8nVSwg~4HA_P~*RHB#a5M|@~hy6x7{y;IseoTq* zC43${qE7IGT1bu4Ptz%ew|spmB9R>-At=aBI2zi=sD{o~k5Vw`u!4R#$i;&Gr%5HHEHpz6(|@kBO` z1nQ8MlF1Jj6v4-h2ebTR7NFxj(^Yu|PTJ=pk}=7nWb|B~^85^fK#<*TKc32$^qZ-? zNLQ`xhkQ7U%REk9+&oJ27Wfvz2=rIGb?yOeBszp&9#O75A(fI_{)m)0L1$SK^yYE} zIN2M?OSWp8v^-KYsI!fzeL-RU5STrQ#FS)l;wb8?q=3Nq5G=aUkWwjSr2GkLW&}|RSCtPx zrI@r$ZH+*@^vnUM^1-C^G2d-qA{B#jB?@3r;1B@3<>fN8bEzR(s z7R>Lz1$j~TX~6M%KgQhW<=aUW&fO9G(~kS0_rcm&N7^V3ShLo-@n5)!N8U;tedqcM zePbZqMaKP~FF|O&ePGW@rJu2%7_w8Q8BbYWhal6zKy7uAL3$rF%=AlH`1aW;^1!V* z$Gj)w>4J1R_B@+Z4>k>)aj?oF0|Glp(OV?yA&L!0HpNTw8n#9vGEQo*$EZv_0WJ~l zR_-HHo|ut3)%3O}{KR{I!32>eryd(=EiDK1MTE`1P;^`zSsf&HmUJeHSX6!qg>~d+ zQs=fjRzgJ^qX8mSogp+vT!~tg8)PGmxpd^M7Qbb3$;GC*-ywMrPoGx_Dwuf;L6@J9 zaptge<_tAYGy*j=21<}tgl{j>>++jU65bYw+y5A9E1yI!>WhaR2@|-(``LYcNAA=ec zVRTPi8)oTrH2$mHs5VlChtLuEbV%OKbF&OQgs{XcecoQv!O? z9@2cf&=99e;1*X%lqbFTsTk^P8eUVLO$&GdxCV z2QBsL4tQa-fBT_v3Ij8s%*^)f`EcHhpgp{Lr@Tels^ZB;D1-jbxpxb9d^#QML?qe* zd@wa~X9U65DJeuRRo!cuCmorMa=Dq(%Sp=T+Yc8qREH6*w;Rw_Mk4E z?jo3ta$dxwkuQpwBzwu)lVS`wt;B-Lbiy&70$98-T3fQhn(S7v*(J7G?1W#V_$86% z_*nnQ;W-b#yA;wco7Jc(FDmZ)r-3OKx+JXy8E`0iQUwc;7;DW5$jW!sZt2#2$0B39 zY;jD!9~F4iy+d_`8S*@<6>3CEN~&w*L&uUv>rce3tKIe1-XN*8(|$<}9a#Ysjo+lz z;@+CK_7m@O1T^*Ez*@Qa_nVmb3fVDF>y>0Jvx+j~`=v+HrEL({VU~W3OVrG*KSb!4 z3%SSW@JcBw{kfoJY27!A?-Ji3#w}sNiuzMq9+G?5Wcx`yXmGH1v<>=HWWQhvU%tyl zXrFS2(4i>`L|ZP|!kwCqT0q-wE+~z;X8c)VNV1aoF)Eo=X^#|EBukUG%9ovu08LbD-b?y6 z=#F%oAO+&DRSSj9H=FAZ>5!0Tr>WF39^Pa@@+dX0Mb>1JN$S0d_8R=_towje0VLlA z5sjFOFe2)QPnbxJsK>>pV#2rt*(N4N6?7y8Bam|NJ{ho?-zk8t^W=g8XeD*t2*btTQO((}9*wOCpUbz-*&PHDYFJ>u^= zuoA?d88T<^+v^rw~x%4*9HO#M=R6fYLQt#>U8(kz;YfS}7 zzOb`Vo>_eH?B_!4t%$J4ybY1I2qTK@`=Ax$i0X&mR<0E@D{cZtO4IW;!@O)RV}R781RDN*yx}T{-_;CI3rZc@}E!AH8*f z$gzr3xrU!v=1m43T8{DIS+KcHH#TswW$fh5}cisB#iNQ{(J>!I>We_3;B*&dF z@r&eAw&Kj>89y86Rk$}K)z0-l)V&><;<~9=6>q^(NO*;{vMwIgrbIH;p+zUv*@ACe d$xUB#A&8_l|NlO{0R5|YmG0d&j06bg{{f#JN)`YB diff --git a/deps/npm/test/fixtures/github-com-BryanDonovan-npm-git-test.git.tar.gz b/deps/npm/test/fixtures/github-com-BryanDonovan-npm-git-test.git.tar.gz deleted file mode 100644 index 7a4b9e813173126fa20aa514672041140f7b3174..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 9521 zcmb7KWmB9@ltqHS1a}MW?gSWIf&>W(?hxEvGPrw!ySuwikl;3WumpE^nRzx_`wR9< zf9Sr|_tcf{bE=yr79HVPOBQ0Ndu~7X_gv!z5S4 zFOB(|hvp}*O zzEvn`ZIimjm2zwR-Qti2#(mHXqXBb%@pm9^_A3lzYq+!WZ5o;lN0YfS2XGYnp@3Tu zQ|YmEqIMTVXIpL~f6GI5j?xj{CY65&(a~AEgC6`bX=DqHvzXMdVHT%%4g%(D8xuX~*mQ4APdGBPT#ACiXm* zknZ&UhPynjyQukoSvGyz_wpx|b3&KfiHUJ+TR?$$p8w9mV?Q>yQWxmWoacr;bya`s z+Z438zrSgMh7 zAZxA>CqIBE*&msbLzt*2%1awoq9hX)@x6b5viAu5j+A=|uo;2^O;RI&zqf<r8$9&Y8$>CNv8NnHK6 zzUFef_x^45zS3)t>(%s5N;HDkD~Sh2SNT&WmoFRbv`OzxVTF+=v3X*a&xu0k?Phb* z2axJN0hh`riCy=X_RO%S;EOtH|7D8oybkN38Hz-a{l-p;{LHzIyZGCRG>%T6L+nIV zU~t|29`wHN`4scY>d6YQKU=mUp%JZx)z;?WEVHJQZl5m9dK>#&9>5Ih`kd`emqW|r z|CCU^3^l0aJ8X)(t&}y_cOR@z0V398PgH2WpVhuu!1Ev$ec97$O@O0GyNDmFa{P(<3e z1yQ@51F0xK0TVHD7!dj;;M036U6?k-XBv67nMd{Gim7PDw;STFPgzv0)#^|A$(+JD zf$pZ$y(*GMPyG^#&f@kr2M2)pyd*OdMP2Vzd~W?8&xdV`Z_m~K%+B>I-gQf_bE{LU z8{ZY+qF$?w*=^2!zUMawhWwtRh{2%!du$^f4@e@7&+YH{%oS&+jWTbiOgGCrJPR%l zP{7~h!Sm;tFZISe`^VbTmEyMfYt(*Dd$t$Ur!iDF-S3g|Rd1iZA77Y=L>su=5)_~J zaU}P=a|tvZ9NOCP-nE8jK;X|U0XGef!VpUJrHN+er{gc*H_2h45w2<@o_@yg>DcAI zZ<+@&R-g|O@X4}y$h!A*jxf7dtwgWqY1s_-s;Aq_q%TPogtYs9BY3}GN(MX)l;E3- z&_!suvQoy$4>ho0j%m;hmA*;-IE-v4vmHvCeSMz=jF@k{LI{9#G!B5qo_7OyXvw*1 zUvExS-zTmmlYpfzw@b9`EmeC>!M8I3Vf{aCGj}g<>A)h7N5R9Z!M!LjQGk_+jy7)x zACI=b{2f8m8-gny8mx!`GhWi|qG%gBQUXl(+kbvSe?8M+iv9sU6CaX_`>yV)yahRp zPLBvV5(c)zZ($R8#~HpO^bqj#iva|HQ3$sOwp$Mt9Vbd&atV5!-%QF*v`zLoo`!re zkp$+|wBcQ1)P|>;k&pn*Ye}<_s=;AP8i@IS-kn#sleBA_aEG~BqIzx#=esEFrAd7+ zKqZ(!IL@Hu-`VlS>Y@{9N=TitYCn6Pj}_)fc-4$!5;hJvcehk&gXQ&)97fWBW%f#w zTkRty`Ywn24TKk`G#2OKJMY1duR~-rNmd3Id4k8$iRK`E?r$Ajt(TRD_a;8hU!2#8 zI^70TPL_IwuV#hwGHy4PBm5&I;U}>6kDbSxw9$$*1C z$29-N?T>u+7Wevz=$!X7Fi>wSVm5)@f7l$#w;1{d6gaTRzrO)rkCmO?@a<7~x%#R| z3b;_+jIWFwyeuu%!F&cfj%t>71&Ojy)1(aX!g1jqyM%6hea9YD@| zh6G#pVEoH6cbJ8iKq|gWzYX0FOvMyjw6MV~U4gWu5U9qdzjC}ptdmfCI1L8L38)u1 zI0Qg6VyGtGuEi(tpGmGaf5cw%_+`I1Bt5uxo7jH9u9w(Oq~NMQ(iJM&I?eXtco~zm zKk-KY2!X8#wll0zQ+WWj%pmXC$5X`ovs&&zO}9si;95tp&b0O7TmM51o_kIwzD?T^S-^$`xjY$u7F#x_`&lYsM^Hm zU>nQWliSaF-~l!F+eqxk+Na}^_;!;Yzh_^Ay$|5dXBpdMHu! zO1K6K{%)zIR8&|;#?Nq>XiFAc+?_)FYrs@|K@E_degLJRT;D;Is+=*T<~5F{PJ|}? z49LkPw@C8azq!Fa=9#p6y5Bx65*Vuo^b~dtN?5qj*SFrNoTz7Zx~;U`C3071xvv~h zo&2%a(|bBXp{W(~-KaS%xY`LI!MPo$k~*A${V5o|YLw%{BN>v4OAMz)`df^V{1JmU z3PVea6bYd)3(LygvhP zw#?*R%uYMM95-JKrE)KEzkdwY$q($fYQNaLba67V9rbMgSozxTnXZ=o349s`0SVmB z>+JwS*H{nsXaOCy@TTCh{&uqG8yHT%4@b(jHk5}url4xeMkGrqOuL6L`V9ddEm@3Q zhb6`xNCRdLixe36M|lzAfscPsuYmmnyZGjN10pW?oW!ir$t0~#>J z)nKGhZTG>33H8-((+&5_Sm4P4*~fr@ho{DACZ{8Mduwh3mj|Qvb$YLAIl3;t_bFYCh zb>9WF+Qi1Vgu1(J3!W+~>{wIX{azR%akJZ)uS)#_?Lt=G$s)U9OAt9ctQ?80ly{bB zD!jkmef+vNam?)iX)>EC^oBi#H(z|)-lRR+ZzgyF-4kZE{pp}G>BBd;8W@kiaLBqd zUt4Q6>1%tgh8VZq#ziu-0K#AGPJ#g{%BGvy!0A``OSC@?mBj010r=p~{XDmEf1KWX zN{gTQW3O$2@?CrwJOD7@VMM?3k%>ajsC3t&qec%ME>D40WZu*5qB$LDea$DMW{6EpDjNmUAQTlp7a~amf-@vhcim03m*DLbnKj#(OD|7Vd({)u~jj0>Hig# znZ9xVoU-?y>>Oe4!Y-jZDkYulF5%H9cT0>&oKGq9N8F#R>`n^ZbDitPr$$KFbDinA zL-4^s_=NR*?$0-ci`h_v0I~G3GJip|VB>S}aO??~R^y*uF(IxHpPreBF>&_P2?-Hk zE3o}h{^m(-<)W`p2BS7*R-u(>@vU0KstjLBojYfNtzmWvZXbaH3p%>=ptJ}nG<$2e zWpPE3ISXnxHTyxw_&7=JrLZE#yRxLxMmsJ?y@QZNJlRts5;a77g)%E^(Q-QJnk5Ln zgI)j^E2^fjTZ*VnB((nFNr}Xnz+kR@vwVJy)vO>FYD0$=Pnhsgk4&>Hv&?

    ;tbQR)bhg@U;EyPKI&A*KoZIwA z9>*|f!gxi1+(Di((-z0>-P;i5Mk?kQTs*aO148B7s>&ZEqd5_WSfIfOA;~x$SEvUu zdPBzm68cQE95LhD{C1_75?5QCEq8~i8YU}RyBlKMkj9!mGNNtKg0g;egrUNT97#`A zSsiS*?%a9wtg7Kme)TLdN3)w1S8eO0J>1^tq3R^N4T!06e7(~`kG_dfDrAE1c&w)Y zWMG6f*ouHT)UC^Wj-tcULNRGFtCq&ioHC19Vm_k~UzBLH5RPD%)`Dr{PD@VY{=0?a zU2(TImW-w~c*AK9VQ^uVteS+7_LHOfY1O+fOwBX56z$z#L+rZjDN3#2enTx@2v-#F z5WCn)IAdknhPS9WC~J9|cU4hvP2o{Xdg;?5_mUsJvXMOz)6mrSK4^0rqS5pC0I`rB zfv2NA+W~6G!M2nzTAnp$Kn7k04O4MU7a*0JwDK{x$tn6O4ZhWKEK(bqWtme#kN?mA zjq4B8c^_U9Dwn+{RH@2m9LXZw-Sg5{oR(gHIEmN)s<ku1M-72DExNl?Zm`gAhY;o2-ZUUQ^w$B12XH@z zSOxc10=;{|FfV5ZslalciSJv zGUx@pYh&g)(&pM+{j}Zrjacgp%EP_7e3bSq6)2TBTPaEHS23Ply53D#4=`7J_~3+y zd0CZJ#;_1*w7R%`I{!{*sbL$ZDaC5Lh@z;(R+4xTg;smOOD(JFgduzXzbFR&B}qgV z4K162vDWIQ6@pcIUJgez*P=UQ)X~QC?ID8Qq`+%MIt{wiuzOzv#cN?kM&BPE|w=ji&DK7asG z!>j>TLPUto6lA8=KwU#+s;xOkTf5irPD(R0F6~*CiRx2cuW@kb56WvR?(6Ytwj*_) z`1~zn0^It-WS{gDHkC`>EvD~T#6s#>3$tOd_c0}YTvv5DAZ`up&If!%w@ZBni=Usk zM(f8gm?tTOJ$vkP$}06GY~S$zFhh-9RPDmVu6-ZOHa{1Pkj3Pp@f-TG`anFiK1(Ux5&r%>#h_5-(yt~H0?}sqg=j2hVW2RrdO7Dbxlp2n|hE!D#7el;`{iwkk!(h3u26Jr4YZXc=N>Uqx zL-|EjWm@lkN2%v|h^0Od4!QNo7%Pafu@@}_iY<@4S`31S>EElBp1!%7_kOyx5)^9UN65#gzD)z*Ucft_m}PScmph%zd?F zbB#|WKA-0{{xgG!AiP60!)S75t?D=&MkE3GjE>PEU|`oAG9ANj>0-)saxLBHWG-U_ z`W1wS!8_-kgg9|YzLI2JF7YXyjDz$qrU-TxE9q*cE28?~sN5)qEm1`b2pu%;SKIC; z?PEbVE!kLt0Ajlg&m@`rFYVp;vbutRg`&iFaKlQI$O3Hl_7!Ce=%J9yUJhV<=lvcbFEni(5quSq0!yjyq z5GPQ|NV?1_Qypn1a!zF?@-+pQ0xDA1pMWVYSRRaLJ$KB$0URfJBJY*>NTDztnf*j^ zlQda|^3wG;X4}jLC9}JXQ6fp2a+4G5>3z{3mXe{Z2-;u5ZW%cv7fba|mdCZ(scYi< z_@4H9jsN^gpp8p4QbsfNYc3jgWNDz&>i1t7gkN73TNmW>QQ@`p+20<)mp^ih2kt*| z!$G8R3LzWEpskD@U;@$T1f*uyrv2SOA6pB#@-qu=lq{L#e(xZ8@?Yr}Mcr<|KLMk-(I@O{)TPd38@D6LH41uEM69hQQX(8fpcdip8T6 zu0L+EJPOJ4+-%$rgPrpZ;?)$UGyIdkrEig^oiRG3b@7I|qf)pp=8mi-S|iG^tg4BW zu~!5>Pa!gwHjFrcsXwRB3mCGV=$@Qp-|#QgaAXA5%%^*paK&$;eKfUVs14VVtRku$ ztZ3sY{^XGS-(bW$IV1duV9{6x0XK^So_^W=xdnlJJmGT0wb4+~VID->GEbuPiGZb` z<}Mc>A>NxB(~RGn{yL1$6-k)`^Lqjv{rku8&!l<}#Sd0ak%01k#TE`9Xt+72 zBc5L0`lJK0CBwV8O8(Z>q&^w0>R|moC#bO4X*zj)ix6eYTsOfBQJQ#sT;{%QMbBT_0lT;vv4>Hjz9~p>qPT^Hn`E=} zvSC8kNm~x{u}QrGDnZYW9~CnaYMZo}Fm%25#llUaAY|&epeY#y6hXJMknB*s#xC_* z@$JtF{IVQ{2rr=mcu*bvYTot+4I!V(ciy_L!%fRFrwu&1ayjCh#JaDQ`qovmnBsOt zcEfZA53^2PBn6S@D7DR7{pyevg*Fz)ls{$OProshnrum+v#k^d92k7ab$Pm9^^y#i z>?@4PKWW`HWEexaBlME1$db*XhVwF_wq*Q?)F}|Lko32{G)Lq|L@a1qGjdYhp;+8f z;!b892@s*tUkuw4SWjV3(%4GQ9C9k1h*hIZ1x?lbDw371IowSPtjI6#m@>0VXy+^< zMxAug`?MQ_34~;IB08tslKNP7wE3lhZugeVVni)lp>h>oW*yj%Dbx!8=-pyw#veBZ)O!jb?TG21eOYsHMrTo)|w}VQ*J

    &*by1Sy#~t{0NHmJ6yhSSQor<&R9IENcq1f1uv#B6_GbeLP2E*7I zS;MoeDH%`FF?@TRwamiJpR4)(X9TzxS*Dy8wEuDBAY(3s zFt9IyROKt4j}*ArV|}k0%?e#v;4RHbX$65?_EzFdl|gwNjfL_`-CE5`h=kdMwj^uD z$04X`*HR8rZ8bFm9B6aXNk2kL=np1yS-Z4RR49-qH8fvH6|aeh6qLjeip=o{IWTQ_ z;tdQ13nesD@moYNCr(hQd{C{$pK>{>eum{$=fyD~nT=5Kqj(H!6Ust2C0K+Q^zQ{j zEIs#oD>{*ev8(Wjp@OVaWZ}7{ZTPycXDS9@ffm+d3xvkzmsZy z+Oj8&0jPnW>X+9}K-!14I1n;keQq$Pw zG7eT6qjDI`&DDf*P9b({HYm5ukghT_vNyFJn4Kz|O!lSCD|}M5k2@J?*G(#98*pgd zQ$7+`^Z3+)@T(0^9y`QI;FnhNqE(~McTwZMB!n@hB|LJ8{Y-T9b-_A$xA-HWtN%P^ zGacTZB4#)dZc`Ivqr_#kWX-x`5!hg*B_b?Bxkz=>xWd-kP-NCarm!ZO=?RV#;xc1j zGMojO&7AU=JUQqa{Ix}9QTmJvZl9f@63LPa!TxIiHVGI|VWD>Y1{8{G96tf@4TO`U z=`ZONCQtrfmZGSeKTIeH%us4NxDd=!4zIISwTK1hFZ7?H-&0sDlD^pJt<$I8QJ*^# z`85xU?xQvIT2uB^6RCr-|)$#Ug~cO;rdEvn@oY^3YAQ?q*@;g8uDt0 z%{$=pUg`ad#;$j2*B!lo)PyK?!=#^D61cwKFj)^h>0mk^b!euJZ>~(K`?NFAWF3zl zlKfvDMi@g>-w1*IA??ka1v?x$T9B7}Du?Abuv6y1OpA3^d%w%fu{4%%LbCS9M`W+y zUSUWng7f0jwftUEIh(5exV7a)Whw2j(}Yq};=yVZiAH~{8~np|Bb&%${PVV%B%5s7 zBOk9-O?InlOgj)01|z?-v4zqrBt`uD+3>G7jW`>LM$oRO|4L=Af|XgIK)T;uqRc;j zM2$}J0@(1J=K%kn%@=_iQ>9gp6m1cd0oyc9cTVdkTs2|Rq%`UQ1T}nyPNVDXT4{dL zQ5v19k&@tNS#j8o4((V0H=(U^G_?TOD9O>>LIT6shc$yFbLytC4Mk&3ky9+sd;~Lr zt8qt8VCtgn(}`)SC&{{-p9kd&hC5#wK~XAUWOn(bFEfM2;fN18({C3uR=l_kET$H! z4WV>h*2D-AS$*-M4RW1nQj#E*UGB=IZDy;mK*XbT8=fJ zZb+gcX5uM)KPzfkyl0y^_I4;v$Rj;v*bnpIqlDOh)gt=o4)%FYtVJ_!_!U>xs!x1x zf;qv%y2WIiDq-4-b@BV%Mq1|JXx%rQX0QB(ZRA#lUlGOaDm-mvt#wXwn+DGQYx-Xr zgU$=RUFW&nL$B{0&24PFCJiDs#r7%Y3_vn)f&8M???UOm^=LHxQA=M~-;jJ+t5aNE z?Y6ItT3t#;T{_Q<@kCmhHeib{{+@HeFzHsn8P<4z7j0i!0TmwwGDW#P1HFj+dU< zslRFXwK%7pE&6Nim-K*aFVXd%@U;Faee1re8jiTeA{V<>-7j5+$xXz1W)>`Ep1+#? zlyuVdB$g5kN&ZO17WnF!y|yKa6I5u#hsn^OEkz*PULRY26HK)@_Bta8y*#E}4heQK z<9I>T{87l|VR35a!T&2nb5cE~2Y&Yb=mJlrsz1t{*W^rhKehK!!2o)u zq*6A@qUFKgbSTbc!O2m)daRZEXUPl=JwU?6flt2p4f*Xjo7Z!7bzHWzbRJULAgc|1 zR7`i(%Jm$o|6h~uL=rA-REPB=GFUIv47EOZ8$GJ5*KO^WR>_}ud$D``bJoxLk;=ioII-U> zp64fzT^HlpRP}h7*ZI=A(%eLLUHH#IKLcYdIY$GSl@!g4ssD#181PLfQ&bTpFdbmR zrBs0HCw#Y;O;zg>QtL(?-}NW)hr<{hH@FN$qRZiBWD>IYj|za+f9oHvM8BDUG`jT< za`~x$#smxc@0W#kZ!P?1&b4FDT|I|?MFaom*83E@7XH_I@urt1daay2#nnOV5&k)E z^v^j_3^PUG{TD>Y!2iL5_PFsrL}+AnVMbG!|2zhx>)rm=lvVER4niXwVZT}$oqD@j z96!fX^yE-HyMK6`p;XrzWo~2BE03M$X?uXXZw}|xi>@}s4#>ebPDGa6N=_3)5|wd1 zAxsKN7Zc9XR3~DQ$-Vc|RBp93O^hsGndw(IJJvQG!?}Dz8$qwPH_1xZMCw8gKSFQR P<6R4`LIpwvE~^5cBD1?? diff --git a/deps/npm/test/fixtures/gitignore-and-npmignore.tar b/deps/npm/test/fixtures/gitignore-and-npmignore.tar deleted file mode 100644 index 8b638b114a5e0881218f55aa7fa07addb49c2bc1..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 10240 zcmeH~QE!4U5XX7;Qy88nYfDRI$v%szSea8O0k$kz_T6{Qh8i#`ijIZr%R#Tbw!iDY zluUih;*FWB&Fn?1h0dMs3xN^@fnzO{x&kiMyXlGvZrOsvL&Q zjVYVnUCk-~&)Rm2+x6`AlVIb>B#BPTXE7CQK_VJby40Z*OsNI)L#m||(bA_xMPwfO z(^0P%gp+GUAXCv=#rm;TrU6asTtF5BG(e&1f(1!1Z6{AMOErP`Z7*DF4F8 z{CAs%gVCz||61?0FzLaDS5%(Nzohm5KQ1}u{|e-1cl{iV$8M?;?LL9cl1ZtHal;@yj;= diff --git a/deps/npm/test/fixtures/gitignore-and-npmignore.tgz b/deps/npm/test/fixtures/gitignore-and-npmignore.tgz deleted file mode 100644 index 4be4364104f570e282888cc7b321d212a29d0002..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 360 zcmV-u0hj(CiwFo=pX*Zs17~S;X=iS4a%C-HZe%TPaBXR4Zf|mBE_7jX0PWY^PJ=K2 z1>j!u6bsi5`nwJjpJnM-hv;ZYL1SWkcROReU~%3^gXVlUC6t7a!zraVFT3XC_vW;_ zx8`62`F%9nY&IWbG#%rlB#aBqHPednc%DhcDQQRoPs3BNSiN zzU!Z4%P)O25oZAReV=uQ1-8e7hJk8>a5JM?}3 z;CV0|1b7`f(eQKC(J+Y1D2J)639Pc{-0y zG9*sM+KxsvErrr|Z!Dz?rFK)LE$7=@F@Yf0d$cppr|Rmhxt{KvIlG?xJQ^vb-fJ|i zaZwP)3(YmtijDV~kerf=Y~XPSrjJMV-iM`q->pv{?vIc>Eq&9tHr$@AvfK*GE|xMW zN@4Ut7-{ovcp`>)w7 z|FuB>xA2mrY1W#?Wye^%W*6KLcAq~3+0D5AKG^bheijM{W0000000000 R006-6^ahDOx=;Wp0079{r6vFX diff --git a/deps/npm/test/fixtures/npmignore.tgz b/deps/npm/test/fixtures/npmignore.tgz deleted file mode 100644 index 765593decb0a7be1b2c9965e4f542d539d1979ba..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 320 zcmV-G0l)qqiwFq6pX*Zs18#6_X=iS4a%C=bVR8WN*3C|YFc1guo_Pww*=76P#l&aX zRJP#iLJ3r3VtjXtdV+`-A!`1=kPKm(G|eyroqaym7k_In$2(_Ft|vc_Mq2Cl7)@hL zO2W7>+%TgJkI$J@f|8nS;Bg4Hk6ZTMhoyDj<)?@HBNR_d-!!fbH_T9R5(g@kiWe&i zYAb3LS4HUx#mu3sq|=Ng1pbZAmJhae`!)9%`@tCXb^pivN&j=H4N>U-&FY`GU30Em z-@CQuzg(#QeEv%v^QiyoD(^ARG5`1RJy>=AFZcg!{tKoB`hUavf5!ZN@a^XHH*7Zl zjY9pm@RFoy*4oBp*D-d@F1R7=>T~$`8OW~2{FCd4vv0>GJf}I$l2?2*0000000000 S00000ey2D5RPjmxC;$Mm)}o*Q diff --git a/deps/npm/test/fixtures/onload.js b/deps/npm/test/fixtures/onload.js deleted file mode 100644 index 90c1a3aa55e77a..00000000000000 --- a/deps/npm/test/fixtures/onload.js +++ /dev/null @@ -1 +0,0 @@ -console.error('called onload') diff --git a/deps/npm/test/fixtures/scoped-underscore-1.3.1.tgz b/deps/npm/test/fixtures/scoped-underscore-1.3.1.tgz deleted file mode 100644 index d98a345996b5b4eb6aaa9f82233f0b1f9ef503eb..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 55415 zcmV(%K;pk2iwFRW#G6zA1MI!~e%nT}FnIpfQ^3rQMaCpW%9fpxO!+9boG9blTF&Im zPw}UK1W3XH0R{jqF}5CPUtnM0d$Fxs-$3vp*_kEb#--hU8nxw!XJe@ z|M4gObvm6#dwU*zKIG5N?gRdmKd-y{;K9R34|cnqhhC?|M2$y%t5KYSzh=V z3?&@}E9*hE;c&%snTP)TAM!Vq^=~KBNi<5*Ed2U?06ZQ(c(7vq;YYXosPpLl!`(-F zU0DAI_aAlt!|Qzgp)CIWAHM!Ym=`-+Z~cpK7{%dMkPh-cl@|Q_@4wfd+W%1!gjelx zF^Ru^A1n9&ZukD)qetca|De13@BRPJ_!lY;w^J!S~K9Qzwp$vEvvd;nx;1*Sh>AEo{29Ul$Gt(8ZAg!^9i!Sw1tisL8=TjMYqjf;J6ch@}V!#)^g=`0EMy>EsO z@PFPci|a%XqX}%0e8<#jPm@tYy*fzaG=sNb*$?dAhyEmr=lkA|Vf-;HqJi(d3TI){ z{BC+jS>(qD{0_Z(P5-td07W+R2cbJ3)ne_%Y!C&$_e16bTxv~SaOx+y_j3{rQYtR@ z)bw(w(8|Ls8hUr4$u!LhKPe8Zu7l{~H+d99?R(=W2*N~n z?*~DYj9`KHrdM9ayAQ3=KYC5m46vq^@oIPBX`aSW;C<8Y_f4IvRzCKF^b*Dg|J%hz zz8MS#2VUzk>|aDhYgLs=`p1gr7F_*ykq*uYZ=3dy{f`jaJnwU=z235cZkR3p>Mohnq&V zty%cdN+Skda{|ckv^$GwaCtZ=>?Z97yGu5+y~`N@`yS&(#~_}d zOiNJHZYqZ!kd_c#!_k>JJA2RBdM;$0vB!}Gk-;p>as8$#?Q8=PHBubqeH?8W&Wo-3 zR=X7|W)FNB=Ge_wbg+OHo1q4^D|8IVNE->d56?|YvhVlyI*V)dphJs=kG$Q79T#h{ zxl2DwVC{5c)mYA}#ruJfMQCh^RzG^w(d3%Dn3fve=Y3qJS=QKPW5ae{*u<)v2M-=N zb@zRM@<*fqB^WQ9A^gI)+w{h}@ZWv-?*aU`2md|PZz*&p80>b+JAJ%cy(xDs@N?aM z8_#=dJob)zxMauOFLjtt{iN;3k)N+Sg}E4a+rAeS@XDY>x_EzK@nYB76 zy9?`s2ok{5ry0(_C@-s`O)t~LAEZt1X_~-E=jVno;1c8sCTWtwN)4=SYp>F-Jua8P zez!o%WeKY&If1=!Xo!Inp3`C&!_wf#M=Z}%&Mcx-50*UmZpjVS~ z8Te^HfV@}JtR%40)ZAlVJ<@zY%^PRouvh!0b|^hM{5Ejeu(j1&a^BYt>)rPKcDDh; zf~WlA;~k&BY~IsJQe-0Dm&~DFGGA9ON(S)^t}}=7WqtjR=>=8C&vmt@ z@oaEWJEV{Gt9^y5eYLh;1h@tNtg8nsVevfxfj`&PM)Ekt>hfii*2CZg*^QjQI`2IF8Q*yeITRIIQ;9@e7rM@H`w?-_F?usb@^r6eHdkVfqMZy z)*~0(c>Nf$i@vO@52Jvl@!$2EET=8DzUBahCb%Ev%i7Hz`$ZAL{N>BK`j=5LPG``* zd|6k2mJoF5V?F$U-slCff315nh=#*33lk)x=KBU?`<;gN`?{KcL_o^npY=0V8Drb$NI4rAN*v5CkB4pYNHHiN$Griu1daWyY%Ul>2Gk#V4Wj84dlyOx*1MV zA`bFpElPwj(jEF(Uw4QH9(}B(XyXhxaU_B2+xph~z`GJ^%C~iIq*OcIpr${hqnbX} zZruzS68v`)B9i7I6A}1wD-=un$PgF=d(FSU2)!;sr0)3dx+#40<5>uG`ExB5G}}Rc zUH49S1>_Qtoj*4~F@F{#IMlbbix8&?E&+b5MM_-RV*SF7eHZ}zvzCtK$G^|$B;zj| z)Spa?In~E68`O`(NthJ$27g`uj<6E)Ws~}&8Md7BJMv@wdx{j|YwG*@w@!-;u6pM zjN_Q+yPn`jIo>nj!V(7fivDpcVl*qFI6?$fS6Ke7i4lI@h9D*B(=-{z5prDS``W1m zfQU34^=<72k0waX=wtm2Sum7_l9Za{p5f2PX}2vExcmv7v3~W zKf6C_vh)%yG&ydQlb=fD)Iap@P69t4D*>*bdzWDxJb{>jp^gp&b_$BV6;;OA}l_s1%1IAjvtdoLcPC1oNgB4N>Hs z!;Wj>%aar!2;<1o%N&LVD-C0x<)MWPiI0jbFM{z9Yv(gq0j&TIu<4FTdMa?SL8e5Y z@KbG?zLrBuo$w=}i~@2xVVDxi^v%V)f4Ce8jy$~B#9uvzZMR`-Uq>mmFD$i&2-!)^hPW}zQ= zc%7V$7}fNsh@x7gl*i^LNeVy>aWQAvAS6Ww4r}?8-;D|3KM+OAzlg|=(;T}7T>K#_ zew_79$2_fppTLZG@61LytxOQ*gIS(?!_Y5gfK2$d!I#^NBg%8S;PIz7^;r_4@CMp{ zo`qq88lEU&pccj9H%@zxcc93_Gc^fg{buF?uETmDlyfVK3Z!sR=GwrJxll2X$TQUBWEGbwwj`+mF=EgZ4qU8s1O#HkVD!8ZdxF0uGH zF?j%{X9}DMpt%(6d&=krht+|tI7vUk4mo=H%&Wge1G_Bz>9nEFx3=LDJ)>YQL2!0wCVrZt5wP^-meKk8aIZ%qW{^4UJafjz^{9Q+_ zJDf|f2mK<=n%)_i2VNELp%1EO8nl&@WPVUPJi?Ft(otk9DtRQCVo&k!g!)3dg@zeE zzKnyQlLvNZ$mbj!mh&i#iI2j866Kk}VF^S8hJnYEj2U0ljjOY^O;oy63kd^C4FhbX z;O8=3?wz1Zr!)`?L)%gLjN72?9rH*&rUP0{Ifl!9418Ec*)(tzg`wvwiOIf&(8Xb0 zCJSBSS=%HVhz5~T;3|d=XppEaa*xe&|J!EJx>M#W`b@U#bnj|<7vbFP@0rcQAat1Z zu$IwYWWz-Pv?Ansp{cyBH=ZHQKtm3<1l!KKO>ej9-GATI@7IC3ZhV5nJIo6De&Ag< z4z_xCN3heWG-m`zNU)>upxth(MnBPTayi-In64 ze6Ps-Bp;$h3Sogphk6Mi8-&RQpDaGrn}l#>3UuR)LkJv=u`@h zjT>%><;aW+xg3|XkSG=W@V@o#+Zc9szv(?}dVhT{ZQKHNH)y;PRh4PP3T!o328FO( zvVgOwH@X$(hK##W!nA9c#zDLR1|K13e~|#Ig*Q9hfPGofO_eS`K=7kD_X2v?#ti$+ zk)04Fc(`~uY=t=F!ZucY3DZ>whlngXX<+w&T2)+BJ=|J> zL1Hem7LCM`ri@Ee{PhrOU#)$%0U9AoKt}2RYF?^3%Bg$)41g~y?(>fc;%x-GB8N> zeuEI}?7bmT*fb+2ARKmEjcRORwF1Z3_{ty`{{Cu5YY-Njovbg?^di@1qI-G@f2qh! zQ=o&#EIuMD7-BO~Lgq4>IUTPvzAi#B3Ofvq5H58G-yh< zAWyTMBu_}gJlQVrKu1Il9ZW}+3f!o17AtWHu9*p;2`z*oKuwR=`{Bwn@-N=5*XyBO zu{q0jm*EB5)2+k|CE_x;fhAuJJB%#y&%q8{D#fC~MZ#jeLUmBFbRCAb7EzXxFvE-) zfC)d=+>E7H%bv@+6Og}r<&g?Kz!#StLTn?s^88WEfjN4xPWS|hWNm1`wipZ9h;C7-WQ$$9k>tz3;X2y&s-G~chV7+rdOZ^>ei3F?ZK zAnR1K4Dj=-?LsZOUb6|+(mjq2VHHA@5FvWQP!z*v7PPb}d50B?as;!Idhad0KFgje zN!yJcV8tZ^!F7g%ZsG+YnZhmuMu)b3p_Vbv&O)7z)2wKrbIB|!Sfrj8=`>ddpgN(kb;F)w&2Z}Ku5jta+Az3AGWd&R6 zg0$lK?H66vS1bhh;w9j!JUnN)vR|M+qQhRVM{VJPAhlKMySDc;vRAHh%OmsH1h(6p zc4n2_gH;M7h+VN@3U<~7?EXe8#g_Cd7fNY7%{pO;EEA*JD}MsC;_O>3LJ%vd# zi4$Z^pb5N&l9Wa_%J<}CH4oF)tscRi1wxVemb`@}sH6gN^tVb5GfcBfKMPnHR^nA; zY)0<7atR15XJ>mvH6J12x=*XoeGlKa(LjIOoNu^Nds0m;+LFUgJQ!9ik~lY*HKGDp zqG^^+!>pJiJl8D?DpeC;ts+Et>vnmG3|y5`E}RNt(hDpX*0z?b27RF$J~fPAsFm816(c{AmD1TOS2}xjvtw^L zlL$>k6X2<;WT{GwS=Jix4zZ4ik`&b4e`p{QCZtKB9tRn=M^+7Uz>{b&cD9fVB=<5u zxd?-Q=^7)P^$Kf#luHat%D>z2s?CrtZ~9;f4n)an96)MyPXb`(N3qs%NWrm0;{dNwkrp$73-jUv&>R($(LW+e2<;7fJjc~a-p*B-2@8~ zspSK)+afnogdqY|w+H+O+L~hv*(^y)`Vw``-&Aa?=ePMK?WJFg+c`ts(OcnJ_kd*o z_vz5vT|y7FXWNQ(&`xh=A*86Z66?T!I*p0F_Kbp?1?+iW6-Z@Q`LExViTG(n=hU0kO0fr=%(J8s8eGAhRASp9S#8mXa+ z1e~Z)y9Sl^u!vr%L95=v-76E$gNPoZm7ey!r+RH7#b@A>L)1uP|v}Mi&uKpvWha zFZ{LhJj%ym_Lt+`zkJvE%U|#R126UGdZzreMWvqQw7Uw@GTlWY@2Et&ig@oWC*Ioq zcLl(;XRrad6m10Xr+DeeihKdp>wYpX#w-|teS}ttxINgACm=(fMpM+M)_Lj2a%0Ag zidrqS>m<8@$*fRf7U;(}{zTdeXDLwYnpzrCX{M>0YP9n>8ie%@5ze~6-w|xmWp4>~ zlY8VU)F!t{3$Nk#4Un3}L~LSW>z|k1sjE;6dt7NhuzU-P>6vozCeRs!vyyR{Lm*$J zMY!)Bp@}uUWDLEDT9FCvWtv@xQR>pw)z*}rWlw3TdB{_IrIshl9T7hj)M-#~f+RN; zQewL|kXIQEo)QP9ilF;y2e!R8&=;aPlqOo(VeJo%3EY&frWFW6#r!p5C!V`-flAn+ zSATDr&`CV(S4y44`Q8>gQPE0BSHq0N-%LgNqA5W)ZB#L4b9buVu^8^hbEObZ6Wt)! zQ-UQyC<3+tAyA_5iiB~dqXqct7Kd3nvDna+;w7H`GGJTfOGpbxDp&z@4q{*+j=ygK zZUf(&VyIxI1Mg}8Zi=8Zg=HY?E>rZaffI*tu$6okoQUVUDG>k;ZWC)H8^UDoVGM~J z^&j3T6NS-)p2G4ePS`*=wW)!e1~zOJhNAe7xY;y8Y3T}(6Ev1$sa04FeI5H^#RBNC z7-kKmh?ik={;tH#SA+z0_PLkTBeET6lqEDkfC1*`N+zTj{a7w z(O3I?n;F;GNNmgC&_jP*{F#MjFe_lMpg@K-qOl=pZ*L>Zu_+Uxm=kN zy%q8?j5)nrOE{kMdu%33ZYj=E)QM$b?S% z`4S1E4&$<7nRJ8~vrJN?m+4zZ?i+};*6$h=eE7-05EFIp%^mWi_LHqSi*mkq63dQM z&31rWu_|g>0=zD%E?F#vq7K{ki$gnUK?) z3QT+nZ$;*~%vpb;^ukz?y}a=jG|4TAtw;r$Os#!#j?|h}F`cx6BEMo-iP(drXK|6|&%@UgOTftsI)V6Lyz_IYgG%glV%faTc zgNCD_6v?8iK^FPljTXR}=1tdO3GD4)ODiC6$6+#XH>HY*e4E0AvbDfJjV4j-XQGU? zXj79o^K8-DiP#T^#yD1sxL9bvx~QY40kNGn!FUCHt?9Vp5(Md<=pNpeO_Np-kKfnP zj^9h9<9EY8=BFehd%s#5xssb?`fxMzgE3Qc78o`R%Lxr_o2uJ_Wvzkd1M;*2FzXUALo4OU3^v*j*nf2O zibrV%$TqPUHy+WY4@hGqoDOOA`o3ts%04GeF@a1hz`F8O?G3h)tp08tR_dgxWFV?B zjRKmjKs1VVX7CJtZb~FyhS`X$ibf%BqtfMIDGgJOXC=*F?#VI_(hTikqUula}4^lYwqJ+eON=*Z+G@$D~^Luo0F$xm3_}lO{ zN{k{E>A=Sqv*-%vCX6W0jXXO5d~JU^jpq&rgZwBV2Zq=Z4Lr3$rt-PaJHW&7YHYy8 zITK~K)@+NenRrE8NG`T{!rqtcvd)yP0=|M3@da(SfNk&#Sjt8W*s3aBdQ?k%yOpQ3 zHf%BnG!-f8rqwKp$lXMwP*SEiR$6i^AhS5@3@|jykfscYNUN(1zO-t(`V_Gw7Nqj2 z_D-}-y0mfpEQ!M$4dJ(QZxRvxYA?q;-5e~`NG>XDC9esmrj~-$u&rVYIxtt{QtmxP zAw&|s7(r77wFJ6{p5MMAla4lPB|pNeYOx}_>x3#!ki<1IsFOuRvWgvKx;X*~-6FA4 zI)Dv82ft|NExW%jMWO|SA?dn1JF_~LODhnP9P_2Dk!qck7J>Ee<<)qwM8w6RCs)b1 zI4Y$jLZCL}gX0~uriEhaX1NmIL2G7PoOvmA* zu~gYa@AlVufAve=U--Lj3_6r+{7o!jzlSC`7=da>;S39HxlKl#N$4k98H(%@sx};P zxuGN~8bH%v4j8c|BvmGJ;zR3J8sAR+V`7yzPB&8$NK}Z8GD#KG>25 ztR=L}2aylE2L5Xtp{)u&tZT%B!hH`bRFhU65_b(29l0JVQdBn>WQ?FU!yyu%YQ-+U zom<*a8;?lIMKMfVzhA3Q5t^ptB|J;ifhaa`e2n_a^IhX2)-f$2f6ivnK^p_D%nd6BN@P>GFUH9y~mI%hpD3KQZQtLgVnS1As)UJsSJ7qDYg!N8u&lC+4V# z{eBoj6+lcA%VrxlRGK`+C_bJEEmqetCblWSPZ(IZPYsc4EWP_9#X)i39dH_vcASpt z+mykEqR}iiv2~56mrAK)Cw$H)gcwTw%Mx+l|Mz-L&S~mbvJC_6yzyIf5P5 zA%ey;YFa~K=+cEz-!K6m*$}DSUSgW7!cec+qdG#hWunVP7QH_k!^KXWC~J4=OMV|W z>L^0D)iTY5qkrHJ#>zlNgc5;L4$D2+;pt%~hqRAoQ!mFPYRZa{U*@1~gxcZYcsy?U@LdveXcaMu#t8WC$Kck!H3hjFEpfjTpsMpUb%c?~NiHj2l2lxUW?s^ghgh z1Dh!>n@t&1`>J_aGZPrlCMH+`X0ZC8iTapxXAse0QAUA!(x5G>ycsi+9l^ z)G}J8srdrlQsi=y=t6(a#byEs1OyqVN|0+Yp!ROmh*)MSh-aBA^s^DZ?5eXc77`*w z1xNMcqi5Cf0-ZBlfJOY8iV`-E%rRW47_HDzM3at2cxQpDOlIs^-C}QN$2*!%;X0iQ zh)@f|&{#s5B#8aWH6OZ8=2W29eBJs!!`cEG%Mi{1;Vda4)^+gpxFAjvgO0#a1G^B0 z1aq?Gv$>J$&y-n*i#+NaCP?D(*>P<1;H*UHs!c*L@@hhnOKehxcW=yN3Of!D7dEo? z2IE+cReAvjvewB;4*&q$VjB(XtnP){pvT1e z42P+xl<0Njrt&4rZ}JkXzyOo7z%sU!veMpPs|=&NIJ=_iU=A3oiLCjk#h|PUkaNUz zWD$M8Xvzi@?kfwY*h7HV2cvfP2gQs`tOiP{wr~oVR)HxbPczJB7=|Vs}r0|<00#X7nC`lYc0+cIWU=&t3T@krfk`esT~GaNAho)x%ACRVB>@iY)f{5Av7A1 z#euKmBN48S;Z_=2=m<9kNz{RgFA^&PaU!ya0-h-=4Wf@E?tKm|hF3oJv~N)?OWX?! z{Si5RR4{ul{p^C`MGZLMB?jk!Ei#yKL|}@&Ge-i)kiy;>i%fg=IQk*J1Z)^GKz7{V zl?S5#$NUBNf@rLfM~x%ohba1S@tFImoA;L?a=H$Q(-H!wHu7$awq@jWu#$GRG69mP zi4+nC(5G#n`BummRnaW#Bn|lTteZ5K5V$~w!y#Sabzl{TD`r8AJ|;Bb!ya7xWP{J> z4>!!6WAUN9i?DCGGsCfqjwzg203p7GI`kx+p?M)HN8v(a))-DxU>2jJHKh(Q$P^Bf zp4v`j@SCqk_^nN2#3;k{PZE}H-|hw&DQ`=-DZ6)c8=WPDElmMD&YC(CO|eflnbkIO z*_uF^oJz^Ej)UL!Ntq%2U+Z)DOQyWywMD(dQo~k_0^9OR+I3Whi}nstp{}X!?H2FI zr2m5(e_qvOky?B-p0XTXTrs0a5zHA<9xO7b0P2A5*UqKg65?WnL1{U{FaSvqDM|54 z#2SY%Xj^iNGFK~xTa7C0do>IY2#*d>SgT%=<)NPzqTv_k9$w>lHmMa7-;z!oFW@yn zq8i`4sVPgit6r2*z*|y(iMUs1*;;{OIsun!t_(%>Z#7xJi6)cZjDfeim zA7rtyAOXP}F05-V(i(!C))OpJ!C^}1)<&b}iBC~>Q)AMy0~cX}K;MMb{hJ_Iaef zi;eS`e`k zgcx+EreD7dW0*Fdk!nq)$tI5pP)jP+Nv*J;N4T?qS)$0&xz{-M_G--)CskX4gq&~9 zU?Bb$ZNmnrmql=C(x(kV(6;O~s)g;`l6NpP_0WFBrpFMn<9wrZp9};?;M~ zL5LSJj41sHF0LO_R8H0g<8+Wx`nhWs#S73>?WSG%qn|*hehpRJS(IGFFj**$Q&=8r zeXClpd}RsK$5}mBv3#8H(_;9rV8bJZZ>1D{fH?ftAf2MPf!e4%XWA6`Ol($DD@QB- z!9>}NRjc!)z5X278?k(ElI@zd0$=6e$5U~)QT5hY78$i&qIih<12YF@O3#t-TqhVPqEOmY)^R9X3~XrCLg8~X5ZrCvZ|-(F?;B7-#mjX< zzj#aIvEmyDe@it+WfSX`T+zh0^e?|oG{;=A&`AXcV|j!==wN84YFwdgw<~ak65$$L zfu9;zFm1s)byzCbA7Lycf+Q8Ojvg9$;+;^)(}5r3VwtvzLa+n7eSMj{5$agyp5Zb3 zwahqLOzsauv*Q*{PpIxT!zPVJ7J-T`jIl>1#r@EcN>`*648o774jYXNN^-T^>F(}y zx;x$Pc6>O9Y22+SZ^6EA`7Kng@6-lIEzHB zU)v-IrOH#hVwH6YW6QRji}Y%f_0PKXe#09rS7s0svJId_d&H+@QBEp5%p1m7fSkBc z)TR^R$B1EvtgSX#6>zfv?9ix{d|+0ddO#>WyndFL4h%;)eYjqhN75x>tjkO`M zRR8)i)u@05)%bM185C45?A35kX|f$iaN*a41qC5{_WGrY39uRx(!a9X>ZiecyK&ap zDAun^=)H2<3&DY;=xa}TU7+0R5I$-!CWH?~?y0~CuE!_prqI#p%hy22GJmn5B*lLQ zq)LHIZVogxwi4jVA&&???i*zgt_UG+r*dBjLfbaXKv0!__1&c!Ub(e&?_~P15yq$# z^egA8veVl$<+86nPi}VQETw0bv2QX*KAzUhkt?}#(e%G(?d+QQODz`wQuvi25Jq%^x2v&_la6Mx5(H{c80}=UE&Ytr z$*-LLGs-h>&mBv?{vipCuACh8ie@kLrLoZhzYRynSF7*1s**cJF8k_}>16g2!><=qAn%d6tk^q=$alEl&^Cx@?JKfsQR# z4o!s_86u?s$Rf&a!~=37`K%@#01x=j1veM#Mix)e>c=a$+pF0cj})#_rnTB1<(A9k zIv!Q5oeGb%hQPu&9MWPyfsbwoi=S2XH30e9ETat-U0heoetTS2Em#oQ9C^$@*aE99 z!r;HFVXfN4qGFsC5e8_e9sbN;R_hp(^l6$5<7iEEE>q2hoGGoZ1K1C2^qUk}s`V1J z^P1UbeKbTSN1EKI0Mg3@c%Fp>hA8k?I<%Pbi-|84 zi?~!*5`qEE2d%v5zP%nw7oh@Xtd)-R7Np87#pqedh)`(ZV0^XU84a;ki=Ly2s~o0+ zda`-=aV2&(B1HA30icN%NtR(tw|V`3Lk3{q!A6*$qdm&}r1&Mu$91+sUy_92YHb>V zt8yX&DArQfZc$(qv^n}_N(-00$XrTuA6yaF`7)WbwoYSsZ z8cH-T5{JQ*wM*22u{Sa81wp7YZd;>L5<}P)mm!|-yjZVazftC1s}k@Mc+l2p;7_B1 zO(gei;}N_Iu{Dxs%tz=BH5mKZQBm)}qNYD%KTrJ}SW54ns*un6{H@-_Ixo^oRR?w5 z*JQDDUat-Pew5Z4Z8HKRtf)Pwhs$FV&BBw_N1v)>BZVrfpFyj`s4Bo^iH5865WY8x z(>@B3TPnB?$95aUm}I6!c5xGEDkk3!OJ-&H=p!*pLblOWLHBte>gZI_%gG`;(3&nX z-WDua;dW_FaGS)4gW}w>)KNv<&V%i0wS5jtvHC*8RUEZFl_-Q+1J7fsY^4@p6JZP! zuk#zAUkqAhPGf(7RUGPm*Pl!eL?=PN1tNC@%rmfkpccpqfH-v|c~rfEnZvMLPYT zPG7&$&DjBy+TJ@ElQkL|ND3sHG>uczgKI7;mq1^o=_=g$OV7KDMv@UM%U>+)v52a& z5A`z`Xok8{3q%OhCLIuqO;@$7y$3Jh$fNCSjoDYBg%C6GOwesc1%es@)MDfdniTX# z_tmQEjGd3MH?>F@1FQ@{3AhuL@_P&7Sd1kvJGy3Ah8k`#EIFlAAKPf75!!LIWKo2TPjA>*pr2_&uY==Nk>a`Lfbjfe5JCSeh(_?G7R#yBxypN8o) z4x5YC$%BF2(=XJu zdNSqoa^(|h&3Yo!*DK<}7%TSm1Y2^OFf;5cfa_O2aTS0#R>*00W2NoV__ofHKy9XV?biE3rNBPT%dVl}j` z-EP~&Xc2oiMPkMc8h3sBN3v_j;0oasMX-fN83(21;l5Yn++>z1Q;nODoMkJ(2V~>; z?f0#`n8)Z{PtK62A@*T2Zx_r%4`x%kZ->62Byg@LBb$A;qFrbl%EJOFQLaLYsfe0| zm(M5tlwGILGYN>4O}GPI9^K$Gl4$5?<+>ibC4{5!igVr+gE9IC1O3d+v1;`1hBDb* zeGId{U!Y+&w{JMIO`F#3+9`V2kAj_l=pfeT40%~_S8|F}bf()}F(1t-Xbsi2)R@#lPZqAe^{CfTC_09-`maL+FyqP|IV!D2PeaEGAa_KHD-SzV*;p<8JdaWpZs_0xx!A2URai$)MmRi?RwxBOH~$2jf= zJ9!XCa+$&znXu(8IS=`k8(E|+qAt<05DjC}8Or92Gm50>YcDLKzDoO3JBFYYQ^VMj zdEa`w>|}p#*=m%`&#LM#r-VOiAC)rn82@}ns6h*6BB6?ndz%v2I=O%0SfILm8d20( zmL>!`ND^L32R_AI#9;oj0{!@uRiJp7>IP*-ZX3DcuiKhM-L|~_tgtb@>rti-Oo?!a zL*(2K?AgICW{5EyImi1kL`sh+CYztIKv32k017M=zYG>-N21*CWFb29sIVc1b%grt zw+tm7c}UvX?ATVHo^kxtw4{07vK*D?Su~(Lkx=0iVk)~%;M-)ud$K)2Y$PoFfD&V* z$5@zN`12aYKvJ*m+OK(ejP_vUWEhRc1;5A1g|ILvzkT0&`$vLWxz{n4E_VCCd6E0g zOC2+;E^^cL7UvUS>rRHkqDdz9VA*8i&o=ed&M`e=ecR*U75JjcOh7+);Y>rcMmY~u zNwv7_42#~w0@R(~pFevY6lrx2YzY`wIoLvj`|F0W2~}pp7QkpZaJB>>h6I!m3wFJN z!NIuFfdpA_3@hyuDu*K~!2Aw)4{J}-KhRv9@~{EY8n$ugts;v%Kalw9oSm@p9Wnue zL8L`m%u(jUIjnTSwz2?rk2VP*b`@D+inR@I7*vTTfz4G+SPu77`;rOUH^aS>%T^|` zPyFyKm(ZBR7cf`H_Qr@zcomEiO5my+BX9P(rvu9_(rYbcp_W$Ly)y;0?A{4WVM?24 zmvAYbrnGKIyC`?5s!YtHOv?x;$C@b7LQ!AbI6JYM40w0%x>@Z!vfEvrxp?|e`sIFf$&B# z4Gwnq4^i1uiBycf0!~XD9@fFC)Lj@9c{mu`dmtC<&Y#OgC72~PM?i|zTsz_en_~e>;xA$w zEr4w_rD#EEvhV7Dpu)t`=TLC!{1+IjRj4fJ?INvWR`iHP#OKY)YHoQVod`GxjI_z^~F6R!sOMbnJ(*cQhMjAqp=mP=*xfm|LbDr90nD z_>CP@gtb1vas3RwsAaV16Di8ELB2r?Tb{nkEPIDz_da|a9scAeZD3T_!&p`PtQ9dlMED!0)ZgMv9gn! zuRP^4lq@NM@)GB`w%yl`+u4%7xntRzl0|^z92Cxg^JGvJl~bVYo#IS^2wqUc=`8$^ zMuYH1UB5*_SxEHVI8Z`$a)Sqg&K)YpejJiqYABd7hRi}QeWyk8zsD#VOl!2+pw756 zvV21~8sqn~(J&&pG{%o(DK_rWJmwQuR4Ycns^}Sy-Y5%KuFK;cgCT1U)=C8JtU}Ok z_lptqEoUV3j$S_V>Tko}XHgdZblT7~jI>PF;jPrM0SC=xbah%Rn?vbFjgBQw{Xk+p z`CfuqreZIbl%mKqx+|Y~Q_@oKv8%$P3B~!VDt7DU?%oQ|vj;;n@w}S=M|3-bEOpwnaMd1X{KI*dxA?>86 zar$AFg(~?jb0)+b`@*}Tb-A4d3IFU|G+0agn>6G1rxLK;_WdQB=2%^-1LBfX5@jDHsj5~?R}k*1Fq8Oa$s%Wx=gb)PP?_CZ0VbZlLhJK8~A&?uyZ>~RbeL-Ql)QE`YZ-+Fn0uIKQy8A zohHL8ln6w4USkuMB|p9{dX@USF>6*56j1u;ZGJhP%Ms!Diphmh6^Z0g_K-|IFMG;V}< z!s?0X0ZtnbAx?oC%skY^(SnT52gEya~NZAuzAW#A@O2xu0MQO5|F zz+6x?$56~j;TZ6w4e zd%2<~X!W;mSqNS?Y;!#`hlhXtl68?FvhX&#m^8gk!(zuN2VWMAMiMqtRkQ8iT&g+o zDGI%Wv-M!RM`5O}G#n7$4*z=e=EPo(hY!tEygzO8FT3%*M%Byimv8=4y!rq?8%>a+ zBTehiM!+&$h4y93CIspv7yFmQ4sVTr0dA0j(6k zFDyBSvgJj#BK29Tuxk+NM)=e}{E+o$z=-SE6j{`#Y%Y#qPdGsW1>QMWaz!@+yluMs zoYQX=X)=#z7k=)4^f^Z#zdfA}!dN^_-bDcFXf|n=rmUxRf3NAmzu(_CVmxkAm z;u(KG7vsil6((%EVQ$#Co>?)N6;3`s{L{gZh;=qiIfcQ%FQqt8%Ya9SNh-jG7eItL4~hbE_fZFcyld~{n+*MBYGNX) zU2^sgIMnyb;yxT)Hjnvq5*`|SCY zL+6Q>{}vq$^;`@O$)UESlroiHN)$awAR@6Y%Nv5<#z;e2M5WtAr#mVA^DZgNq%3qO z?0xZ>@Xo?$ive`d&gBRAK9IB9HHB+Z$;GX>O?guU@4PYSt~1A+VIE@=+!ad{6>WW) zAN?C}NKgGqKZ}CV%{EZgWuIoCE-}U^l(W^?@-vl8ePQ{<{Mt1;_JCU`{Hqn*K$S#m z4wU*`m?YucIfewC#;9PiyxVI^Cyg_+U7Wq~r*~*|@>#N3}#?^M)kCurhXK=iC@2{m`wyr>U z8)u97qY+-AICq4l=p(BudV%InGGV~EiFKmbO#`B(Ntwbc?qw z3(t_Cp_dqikf8)Zat;X$41m{+h(&6QR+c~#2b^0{7;DVJMWqtQOCh*P3q;2(Wm*m* z(OHX?=3^U_2bP|aC!HdKTTi3D9?e<5kMb*rLS)ndG*(J^m`Ne`D`($O@FVz2w% zjZjIlmRN{nlK|h6O=|HjCSzb91KlFaTb*Z%JvT~PwG9nID$!_f2^zhG`wivE-UNxXSlz^G zc9o~Nn~}YqgxQGaBKFxooi2n0&O+HjSW(4f;FD^BTIr5cMU_gOPW)sx#I$Z%MNVHn zV|9~+)^sD#4x*UFYZOcRrIia7z=1eYyoVLV2a!jNFZPtw&$_p98VqgdQ|^P4Bj|G* zZi|;}`%WhzVaH68nBuKL5;E`^N2g|FM8Wn*EH|3yinb{VKZr>!cWiZnps6Ipw?VuW zN;=Hvz6S3c^-CO~Wd#o(E_&NJOI@^KE=@rxiEw@#-p5hK5r-kN@REv%m3><0oriEd zxw?fRC1^8(U?t@>sbd$l1xq+FN{nUSyM~gFnwc2mT?H*k?g3U!sK6?tnU4WDLXIsU zB3RuTN^mK&LEAg}m`1wgS*}$kZ6e*)8BcyE`d(y?THR>D_izz}kh86<1Dewe3JRm} zCAhLeH|4Qvy|W5e67+?iqzS6Fty_^20rxF6B;gQBr1#4DPBBZY3Q61N6J~!0{GAi2$>cV z7u_ml-O*_V*|10fmn_&b>XuJGIDK{osMlv1CMtwP=Ir>hi{z7Y05Cw$zp#mr~qK2A;cISDdJQD{#FFG+zVwQRZrF_LtX)h_7m@sZv+c^mKc4cO_%B zxlNuas#BUBtA4(OHjt8VAq~ZqWl`nWjtX}RwX>{q0ooM5Z{HVQDyd%-geH|)^?5-^eU`{?0j_C-=M3NTDU)oNID0y1Q6IAR9 z7Wk>#K&?{&wRdCf7nw&RVDZpV(h^9R?TkS+C=@=M)CG%v)oOQZ?ohYbw9yQ!p$+bi zZST8iLnUzpkdp%{gxSdR7T~53l{l1fv@6M(ISI|q<@+0LTA%_Z)1Jo`Pi(k>ycJLb zUFUP*Jc2d!b6?gqE9E=n6 z(2nQwCY__!zL48)ka7q==mDr?P7E?)vSp9)3r#0w-JJ(L*;4l}f!(rGCAaus9T=St z2F!_!axi7uf#ZIS%!fh|hhOqbQO?PM8rZd1G{#>t_$qoYRpYm;> zXe30^M&3}tW*LN)=G+qY)!cSeliMcChKyimtrJoOy6m;TTgq+Qfq1H2jFgzb%JjOS z3;c1i^X&D@omar(y#TJgcBsBF8o?BA*&?bypX#yJ4&C3br#y-n$!n}>)U%uHfDe;m z21u6YwZorgn1#@L$G?|)&#YaAM-{7ZB>SdxuQwN!(upOOhX$wpoQy=IvPyD*HMytt zll~9}`CvSWfJQ-z-nKk*F)^h+gv)%x?Z#8ZEUWRDLxyGF z7;)3M*;pa-Ou)}ovXZuU8ixBzA&$O{m%!Y$FjzPN{+F;Hr=y)|3fp^Uuk+V#=exF_ zPp@i+Z==Blrv328F(w*=S{~NA{jyYXd9UD(;_e~s^WaigE_r5fj0;S*m!j;J>h3Bj zQrQ*?JAkQ4q{2ejg{|kqnLu9sL}IgadE6@ma6e1ap)Z^AZ3;suyuU@5`7*PChoVw_ z?+j8UE$5Ttn@R$lBhtYifL6_EYV1jWR9PTQ#$uAy-AdyN}29uj;5I|Dtz5)FNI=|#(w~d ze36Rt?eRwpc0Ko=sdDG2STtuTM3>N9+QWiVajV<@t9C4w(;NLSzj@i|bh>}-)(&$Z zduWF!Ub-H21bZctAQzrM+_$}oLw*y!eLk{J=APScf&Gzz{>!W$I+oR!i8}f_;W9p}+|% z!tB^ns~A3|F6-yEfj!0s11{f@-0AcV{Sa<$k*%<>uK^Bycl>G{k&Cu>K&N}$r2LjP zCbSwi%TSB*nnmQSd+<1$B^Ts*$@^GC%tWbQPU@^(F@n<$t*ijI|K?}0_rna~mMjR% z$nP_}6@_?E&CF^LR-CX(pkyDHuari&sa?rpK4v|p2qO%Yz2SNIRSfOn> zRpL#S%^1weDEU&ZM4v`$E`n&Is)Q}PyZ4v732E7O|BG|c8c{gIOEbcNi~(Jm0Yq+uaU#9f zSu~;;gzVpZ^V8*G9>bE&E@rTgq6|sONe-ku{dn7B;z8w&!t5Gt8p$3Q;$BAn0VT1c zTmw-kZ|Utw_KOFE)=g2M1L(iB^Grulr|_e=#OWAg<`p1{XF%F#MUf^zY+k?*@05Na zgtqfCh0#a{-RE$+m+m%hx9Nylh zVb-)tOJ9P`s<(HLEeejH{g?4#nzPy%l6 z$ijr=mmKeWjG)yg#Q*^c=w^L4;p@oY$Xqcb^fR(SVy1{@CsvF{B^hOXkZZ*v<1<5} z2>)WZ!r}cXE>RQ&9P72DEshjg=}r=7ljs!B_JPCz(7r>yp^sm*@2gn%BbOSvIWENd zNOY}i3sV{U*AP>>rRC|qgo`MJ9&WeW4V9LnbZSXhsFg?7#2>(-CFvaQ1AL`<>1Tr$ z-fRB%{{wqXp1CrEUrKQ-MH8y-jw-0A5-aKV9+S=auMFEg&wxMFhJ(Vo}I>lCJtjHjID>vmA76llc8-zV1|b>e6s z6f9NS(bA1@oRSEQN2AOjvSLM=j<(3bqKByZ=^G;|QcM<#yG2Xg((OD~R}$N>1A$c+ zV==h9G_A2Utm7;Qk*l+ERD@PQ$ZzmQ!Em>37q?|>?^hF1cexk2$6yi_+5CI7d`&;* z7ZD)BGb-||GG-+m$)$-9=LnFRWT;MSw-I}vMfpW~Ns;RQ2H(BE;SZN{W&59tuu4$5 zu!W+FsLjsB673I5b`-BuJ5=9RYrmkS#Lq6reyn2#zT)3_D}^^cA`%)horEP` ze5q~XhR~@txiiqQGm%oqN-#uX9fKh?#U{&{iYDwMI#dmOSp04BFx_gnRf~Bd#-w5g zfM=%@7WJl4Ea7%fRBaHavw-o@11cSdz1orYOddYPho}U{Y1f$f>DADr4V~ALU_VKd z@W2Y(jCZ%m$jh^VQA7Iq_yQ0sZ|C>h{>1+yP5jH8#k>;?gS+FOJA*l&a)0eo5G^PYV43J1B~|1=%dr= zJbduL!_P+#_vo{;%fI<=Z`bQ~A9Wtxf4KW-uj_TX4>}Jz|KWB1jKP%uFeOU{LrF)$ z%6d?3I9&0ZXX5G4{~>=83ztKU(cH0U}jJX&8)g%4)-=FcP_Wz5Mr^l~OkN=cD z*6jb?&clbL{eS;K=h46S|3BmJX*!)}ltiUIXn4Dw&R<&?nA7_y%)-gsJCZ}Z>7K+} zTW>Iu0_7tky*AYD&pk>yjW>VHPAMsYfP-iMH8fiWa*`%nX}?hVM;#1;Jf8A&SX@&0 ze7slZc{+&5R$K82bT8N%Qa;r>acQUWMy(+c9x&zupWEt@5{+%4lpG!5NEgDEp*RL5 zIV1BWUj$R3M?g_2>zZ2}NtLsq$i<}TO=tZ$%EwJFh;mUzpr!{32XLX`grhrX?-0iE zmUtwKVnmHjtWYU)8m3)i5V4uwI3;=DmYxY^S|IsbQa2ouq3E^LBDJ z?ES5+cVy`bmr{Z`uX&OdFjO&w#XQMoRpn7W_9<8LmYCAAfQ-Tq^K>vk07ca%HkATa ziLs77%{KJ^EZQx8BLiH!n_(pEbRcS5II3{Osh_58n6i z-mBN|ycZ`gPu@YJ?_PV@p)_@Je7XgVy*z&V^hfx4^!>?;lXw4Ude2YZy}~x1L!(FD zo1?eyPM-e!;^?jS=I6I>UY{OA_s_Ooy?%A_>iJvf<@n|Ct9Nk4e+6B6$A5<(-sz7= zFJ4erM?b^p-_rP=zJBwMwpilZhA*= zPflT|ThHIVhUO8R@WyLu1m1gf%&j1(J!eIr3jY526u)lqSe_jpy@0k(@nySm`(I79 z{{8p0{?z#|pKt?6lds*!I{yFB?w;4(eemGnqX)a)&O_w?A3ogs_xb$%@=(fo;g2X>dfdiOK@Kha#F&ri;H$t1+fdeg^ z0+wMTmGX$nG%`E<@ph-F=}$uFVS|^;MaR< z+@ApxkkRB^#>ad7feQX}L2z=&!^*;Gnny*N&EaiMfLEi`Z_pM@NA)<%Vks%fOzmdv zR5181yh<4XYZJ_@2Cut<1$rcoPWY5kG}N}PZ*o;r`#;Ld!_uusYpYi8a|DB&N zd9eO(tGamSSMS$bx9JRLOBZqRIe+|mu6m%~=kjsxR64hxnPzwJWnFtqjhDu}vkmos zgU37D@Qgptf5T@`{ns6@d5-Vy;Jd%lhj~U7sRM2bUZvX90T$4hcdY+B{)D&r*A9&A zyy;Ps@NGxck!Mtq=OM3hZ3Yp&!Y!Sv|KPcNp8rZ^^o~@bDOm5QG6K)J?g1XlBLBK` zP6L3?9r+L1_vjNJV3}QsTDIP?%68N+`SB7g`jS62H5-e*at}KeY`)sxmYWAJvb5-} zei#=^5>T-&OXVT+wruxB4mLEyNJmyS@EJylLnj1OAUC~d+K6Whlf*wu2YJ(bp#&rE&}2|YF=*i_L~*m05@;@LD=bj-rHVM1fwOyz@j7D8DTM~ZxKe2b*EbC8hS|2Xt9BEcD5X8r?k0ZB#O9}ToOo};JQ~5nm(d_gTkqIU zl6+sF1teCKOr6bb=q*S7ypOdur%YQW#d715Hah#g?l%X`pz$dh*8N_uH)yCRpLcq_ z&gakF9VqSY3=a4?hRXZ=dB9(EReX;sw9m=Tui^LLtJsI)gMoT5=nb3)zA{?Ad$->< z-jb%gp*zv$&4UIvS^ef<;Z0pq_ZtTovn}k!6x9xYLrdWu^?RV-p-3kOIUF#9aXoB& z8lcHT?M&=1*kb#AZQlTZi*RgiRkq@`s^00{^Pddh-@!h-)_I};jKA&;N^he(3B2nT zO6&;T=Dn&n*<;A+x6MH!dcCcIe7$?uZ;vQzJS?Al!!jMr35)d)d=iZkK%}S85k4}% zt^taO`Djmhr&r@4)INWfvVkdc;R_r<9T#NS3)-CG;$YZn9WUoPX^wjI02i^>({m@A=l3?10>{+Hw3Dzq z$Bnyp>%)8Znm9-<98e(+aEt>S^8k5-2#gVIaA=R(8kn{Q%`JTI4$NBWj(T^7*Vh2o zbXsp5$bd%IIFPJ|ikRjPy{vuSOnRTLn-@KfETN6bn`uuRQB6_QyJ+V~OPfE!w^@>p zqhZmEdudxa3^z~Uhnpm`c?osJ%Bpz<-;v{+!>2HPf9S7d8QVO<>cj^&zlX16!qt3= zJ*ShfIfXA0TC@2KzFT%?Fk&Y&C${XsLG$pwuvM5{&IVT(>xg;gby-OUnoF_{5}8yDLd!hr0(byDgj^P!As_ zOe2}&?4<2pZ?0z!bq3H0qB_hoY&4p~C#oW?{J#0M0EB)s0($c#P?HZ~U|hOi4|-6Q zh_t}s&agr8K56q{vu~F)5DXX? z7~bY=EWNEtygxXuKwsje9IVxIg~h|AyKXqR$&?rR;v6qG-eN~YWVn%D@5t;jE?d6Q zO2Y(r*;~(Vl*XBbi(6*h@HXi7^XJvw(rE$?+t9IXgO$z zhY5RIp{9>|F;yFhGfo`IF|Hw;m^j#EzHl@E|3V0<{3jIi%nZwt@ju1!Q=`4!(}u-- zPMDA^5)U4Ih+yp*+D;ED#(w7x0a=Vdh|qIHgB8_7x70W){?D$r3?*>>H%(KMbQE4lBV4c<4} zaCM4-dH^W7?`b?6T)6vP4{>=99yZ1eO#G`VuHepqFII|LDbT(2i!r_<1Hqq7zDKDy z$ivRO(K<;e%D`OE=Mx9K41<0Bx=ja zb04W{X1bCOY2Sg-sBwMWppNSH`#jG9uvO}{CZ3DxhZ^PJaqt9o_uw#i(%tV|H<~r! zEpYUbN~dx|!$k#fEY(vJhU=nmck?ZXe`KN{+ed+l;L?6yeP7<*V- z1l9l>a47W(UYrLo>V@})hlkyR0B(_^_l?H^&LixN?sfNvz0tLOq6y1VaRs{LKRJ63 zypGg(qQBLVLoqw*i6VolSg2w75vQu4D-}#R`Xj8mb~!v0PmI};EJqFy9a(w~Mp=k= zN0_}kf$q22fpq}l+Ii2UoH)&84OlNJptkCLB^N_n>NjZcc+C=^}Qw}n=}*=gXw zbV2t$vo+8%+~`m$xOSMOq2c=!qRZinEXWEAR&`|Dx#RPJF^v792$SBDBS-jB2kS$k zvj!tVORNV6_`nAi`AN91+r|n9X6EmEq1p`obrW_84nveb)$=gPsi60TGq}rZgwfP{ zeF?k1K&yDW2Tv4{LZ-e+jH8}oVCEQTKCIL0jfr#W5u^8naiJanJ2Be7qgfYx0~nm( zEYOo2H66zCZ2aDk0GzcU^fLO?S_EtIIH9_MrI|O~!-Qio`L}x3&xHeHu*ku5Ee=NT zMf&s`Rjfu|Gp|EKGR;HHZ^7Am*y~&iUt?CVVoYXoRcpI2yh?O7D}g<8r+-9K8={Je z`U^m4G;t8PUDa9UH*36dH8>sv7Bj&-0b@Eqb_XN^3C=<|HO&jPd!b9^6({Q8;+B@q zTP$p=%RB~hBZ1mXLC-lTXk#{gJfMM9eF6+u7ps?fUQ5ERSzkIp0ysQEb9e-g!-D{3 zfjx>GN42d7aG*w~XyD1>jQZ8nfwE^fGW)Gw@0l5$^`PE2M_gcyPzjIS;q|MBM}aLC zC}>$k@VM6n=BwZHKYs?A-|ILXtGZ{qaE5mQSelB{mq8fC^?JYMH+F&sQ1d3stQ8GB z7y?8aqqE_?d$8S`{=J?Wpf|cc*up-Z+vtdcM(IEmU()1j4nObp^1F9)HS1j887emm zva_!4rBNlKIS5zXWdeJgbQvWxeoS0|$(S&Jq($<1JcDMai2uU&f^j`JGFVt){r!O1 zSRC7PfTe1zzq&E$nuWdf5sC~)Pe#B$E0`WRxAj%DZ=j`l9g*0WIB@_vVE9}@hisq{ z>)`jM&D;5OE#Z^`E?;N(&4a~@xDpH*m@~6C5NMF--T=T5L=>Z<{OAdiqJ5%Ae)T&9 znIMcEzE82QEAO>=SiFlSA)L+i#nZ{RFR)GKNCM2?x8xkh0q7+@^PAoG%a$3DnVM7S zm8!Q%bBHH(Ga^|T=UcLeIqr>EYH$tjRKPhPwFqnm-7h2L!4MW{*sGrVkVxIZ7|9#Y z1=rvpsyDEg#=+>xn0ST#t@85&)^N#U@NlcvV<|?^s#=221B{QJsWAqPgJ8*+10J&) z5WtPs3rCVxoysC@X;zH|nLk5>`z!&|q+=BZqOQ0!;p(Xdy)%C~Zggy}!0IjFUL-z2 zuhgb*!ELcubq@4Rt)@AQ;6w|6oxwAy0k>{EitLX24b9x)ts6!GEIsAVte&m^81LtB zt#YB-YWa`5jjEZI;E4LI-cO%D+pEU9AJKp~K5K31-p-(?f4Xk+MZ8$pf_+rN+ntJqMK$jJPP~;|+eB#ADHB4v7Mwrh&!Oy>&lo}0Ft`()V+?*w1F?`Uv=I_++0GoS9L9)iFA8T@D)ca}E zfvNfm4!ok9zO9UG_+7T6+4NmybtCWkuPT8Lv`>&%Olp=b5#rA0&-jf{>htHSKDAj6 zH;JY@n+})Fd}RIEa%a<5m7R}*Qi+YVCV_N=YyGSY50+KMRG?l5D+3}_@97gQVIt%( zA#5CpMEkt=gWiB}DpCJJ+$%dLa)Y^27Vc%1L=*1QKHaDLN*)|C38%!1746pHrcL_R zY3u`y+qt_lYS!-hlj%XtDt%0)ap4pmQsKxgtWhCmLU4+=srZ|#-A7LGuRE&z`2ow9 zDfvw4FmSICO{35O*7a|w_`_=isen*afsl9skWkXAlc0hhdvWicCely*d;NV9&8u__ zr(uD%hI#K(h-WgC?C(7OOa1KE{MXa>_ntKVf>SqX{OD<~^q3)zPg?F19%0ejY5%XC z=B#q5EdaqEg6P*@9kBgM@Z4sQsZm$Tt1J-I{QS9SR_&(RcJo}S)NA*)W^nf3 zt2LV2wQIW#Yb{nZRJ+Hom)};4y!_S10l#aea`tQXYw~OH9%tm$pwR;h64&-xWjyK3 zS-^w~6Q{7?!UCIvE|sDI8~%_+Nqrl~(G2;5uf~bygSBSuywd#;Arl5> zgw?HuEKn;MPgEq()4FV}iBk=m(N?Q`WEj!Jq$Ha7SS=SHJh6M(_ph6OD^;`_f}4z` z(N%Ym1-Zt-kBSI8Bh(Q3SRd%CGmsRn#CEvXnhe#+qM$ZSr%hbgrWmC(*>Df}<7Pf3 zgFZ3ltF`fWQHS+##l1{)E@1EnrMWCz)tvDj^!26Jnj6!4Z5N92!W#EaCvlAjRRgvj zO$|DC?_$dJBJ={dO&I_LrCH-#&uV;2gb5(V!3VLvwf8rljqb<3dg+N-(^(jX)n*wn z6~b}xmVH;|Gt_>Uu2U65at4BmQoSMmn?_Jt^#Az!LBLk}e{?$!_8ye|fA_lGfBS#_ zQ~q|?9d3ya2>#v555#Tr7QP_(_Z9p>@bAlgLhx@hzYzSpfp3WI9O8Y#D233*_kJFt z=|2Zp=dzabCl!w=)n=4)PO>abmD63*`wbI$rI){{U`P`1po#GMjeQP&^CZ#{2TH&| zl4O96&Gd+n9Y{Z?nA5~bw?gDk#rXN{{5Ku>QnjLLTFcg>rrYNSm7|w?75OZV!XlU0 z`H~BiLYYfCP~VHwbZUhhmoBLitaH!%bnT41KQAN|JcTe%qG1Hh)-lCZ0&^Yx5z+Cj z)4NN1BugM{f+ou*_^8rQ&lZgF3B%M=g>4qUB7=LHVJ2el_ZcQs%R*7RnjoU&smZCb z{J{WobYU_m1f^~&SCgls)OH%}S>qSa0P#x|equ>gKJ>=WmW1cx){rg)Ax8ZNh+#xB0S*n1TYb(} z^%e70ZV*=Gm;Q7KkkC)UswhU(6&1yiVxcaXCs)>GPYZjTE|--?>b+rz5-!YGSNm2GzryLFcFIjw6q5v$(c!g=l@p>`j! zYJCqwvTEslNNT{+zVj)OnYHmGeA+^G2ik{#WnMpw(@VAE&Y^uxyrCk{Ztkl_}gze-z2|h(#fl2@)AW|oVn9D@P1RFI~%`wM{iCj zm)K>vO{XQd;+zD25D@96sO)?ssDXTpd;|~gd=?x5%_LNVRw&~~oaQrV`6-MhiUB`s ze((`h&Or@bZD{L7L$BnX-`mN2c{|KxI9v2I#!uvCz5G^?P z^czjdvcZf`=3m;WHlV3zz#)w&!!&G$GGzwtNNBTekMhxf1b)aq`*Gw5#kT$;)k{03 zsiXBbRWdspA)tl_SU}b)va=5KLzkQbc0g^@4ZdbqFvwz6t1tF0=;DdL6^%h|!qn(J z^V>9u+kr%+5zMdC^kVoh^$wu;u@}R~y?f>zo*;ke2nZ;TsaE*#y9SbL5qI$^5#uWgR0#4^i}d*0dmgH`ye zYL@XBISs*K8i>YUc%a{vr%TZmfx?5;LzkoybWS%Z_lj9v8OoV_D!nmGV##_}G$#9{ z;Y@nzhH-mxcL~$r1t4hz`Sx38oPa+>s>UhzbV5abgYSR7&N0I(Z=sp&$oHEZVR#E7 z7r)=y8)FXhXI03_uuF|p zBN#t6Sb;CYL#*j{1&tZPPF84hB!J z8aia)OENx1m0ZH9UtY2sc=eX<2~Fj!y|m16R!LhO=RCEY5Cur{Wj4R1jsv zVBuh}2Nl(a((qj*n4%QeK-v=7Z#Sf<*1cu<=HLsD+9BD0lWoDHa`uJ{w6sB}^v~TT z?6JCPtGG3s{lcdZX%GS$hjP`xQ`vHO-71Y9=Wft)^O-EnL#=aNjbg=;?ysuda1hzz z3pi6U3!XTKB4u{M%L{B{1|GUp1YsSZ%CRpKTvJr zC5PGq`LYaas%edLj8=hDC0`Q`N<=CMP8XOryc3W(Vvz)poX0E*doSxnA>jrt3zz?s z87~p8sQZJA##|q$z~R8ewc#rE&YuK8v zw@kNU0{#WSe1^I6CMdAK9EX$#%F5ENK|7)Rk6*CANQAd`dqLN-x2QgCEga4*7R+Ig zRpom^&D;KCAAz-1~t%-IEZ zkwoKx&O^w8wuz*r`vSB;aqW7nNanvO@eGDZB!Y_)U_uWn*ik~C2 zKz4@BK7XEZxekCKh>l}(q(9e20Gaa@bse6bdPo(0<+QKRF9d;>v^ah^;%u#J`Frvxz3wC_I(#tv+ob4go>J_=b`k zUfoQtt$7s0{&Q`Ak2f`q?p4t~NWyxsycrIP;WT4nfGm<^9V7#m+KLEr8)8Wg0jf1a zBLS;6CzlH0)RjiJcc_kV9h3tnY$)<42Va|>H7)h^x>32mrCHr=B}M>PY>cSGwANw- z?E60nBix`Ux4?)E5#qlwK0N-Xqr)i&bwRBhowdBm66$493#=h4H3GW#G(C*va{Egn zKESiJV~Yq>4`-dyt))VoiQPk`Wf5k)Z&fGvJakW9?1P?SKe`0peP2~l#8+iyX5bf+L64h*OAmzuf|to? z%{K-?B(3`Y*!vE^xQe6UC%NEm8B7c9VFI>6<=v^f$dV;Duxw$u0JgE7?w+K>r@PA) z+cLiq1VWN8UvSEokc6TDp#_NP1QH@rz9e5l;v}>HAxZ+K7#m@1$zAu)Y?$;TM16IYi$KkwX$%5*3gyKh`f%Nnj?0MX8N#CM56{;NTr20 zSRIs`e9h?SfzEg6cZIyCdO{8G5l5sY81s8+T8+dvQ^UhB@M2|^UAgWfLkp-#uNKb7 z3_&V<0lc&zqN!m|i_vJ=AsXh|BU+dAcBXmafs9A}!S!^Fz6F{9Sx7*2ZeD_1-{J$E zJ_RGrAhE2K)apYWN`fz9!4(yjGx(a>PW7gaB=S zj4Ja)9*@ftpK6b6k6>PiFw7l2%c&M*)A&b^VMphCF3m}#Mb|YxJN?QM>|_fD$nHk6 zK*uNbaD>O30TW^0#$+~uo}p!N#*jWePg+H({fD^L)uN`=5q;d!WEd+%+oFJ6cwyke z3+44bzh7TM&=D8W)R?|DPb^qhRPd0mhJ3QVc;SW3F*WRkBt0z}4AWG+bToqZrsLJ6 z!SGs|BpD$$knU8U^T!;qg<@(B?L3exlca5Yn-ahgKb>2^Wh)W~T9ajfOcHg zkb>oW#$D&MIT=E{wt-(vtCO@SLynvL1uYymR!%cywIfT-%2Ljgr$Bw^b3LGZd3B&d z3rw}y2AY|{{TEWog%mQHIeV;}Aql5v3u+oi@k=lO6FFxbFlXf-ZWHlU$=TObe#?Gt-7(*~ekv9xA!wVzqYo&G*Fa&2x+j!Bb zqmpGf$&Lq1pfaKJ;Ag8*s*=rjoqH}Fd?lIeqShX6+=E(XXS#tXm?!Kk)UhZIJS6u+ z2iGT%$&Vwnk!f<9u?}zzJAel2GZu)!&zE7DQA3;zuXNHl8aKrdZ6(2VT-HnQoxz(n zWpdb`6Squ^F=UpAt2YSsiQ7on>^a?0gDr^cG9g(`iLjX=esNaXN;aRP$oT9y4eYWh z+B!NU28z8g+^DHWwLEecyHf#(gSb(g7IXyngW2e9@=9AC#` zhJeGA7q?<{ab?LS2&@JmpH*NLR0Tdd>|mtQ1%)saXBO*Qrcf^)=r}YSIG(F7xajFl zwfKBENv-BLrdZf`k4;q>acEcJ(VvKeLeQdD650Ye;&P3{v6?bHSF=Bqn-*t4m*763MlHG? z<(wI2G?fHW4M5dz}bO8Ql?h}p{F9+SlWz&QshVkQzY z;JzVgDOGO&dt{^SQ|_}l8awB%@P)vnX{L@OvLm~-KUQ<*FIdJPJM+f?!3P0rAK^SlAMAKcXW zQeh2xJY;7Pb@^49t*oyb2l#jpxRU3>9*1p$Xhk0YG&mgn0Q%`X!bz2CmrET88&D}XjM6uX!MK3+jxaQ!yEUC={&Ww3L^}YAY*+*45gDb- z?r*?d0*EB#%6`*4l`RdKNZK0f(Y;2dcBft5$C6&2RKzSuV49xcCOxAB9|u}B>Af5* z@urxFAZ^36zsNFiY1v_e^tm5s(|mfy=ll)X+}#8tWleVtf|Sa+<;F zDaJ7dk^B&eksk~<7qH8Q3-n{N@>`;<{_{vCY?woy&9#k3Y(S3}i3UUXt%a<0Zu91! zF%vpjy^SIgc1M^5THCtiK_R*+LYp5ZZr&lV(oGghT!hkpW_UBs8})mM&QlvMh%p+EmAV zOcbL(zH5!#m(XsEa#vpak>&)!m>?o7U`LztMRd$xpEPnZWQ~a;6lCLU4n~LhunroH zICN zD!~KY;!O(hTr8(W>|JM*cs zFPa0;!q!@PbUc<@+YkaySxzizY{OoQ9-cr>vZ4D62shZF^JZ?)HrS#@OoMQ;*i1Jd za`yxpflN5DM~78zQ=720CBw&nVw(@GmhB@v)94mAhttU_;&?fW&QTGMgK6><wH|@ zl0)qi8NXijMKc`#Cg?8bGu$0C6U~ac&Eg~+$<)S;CM|5{2B>A|XuL5$l_P9Y;TSYE zJgl6$y|9xhkVdo`pihFzqN$PN=8b|kX<>W86X%>wXa29rl~+=djf4M_b`nl==GKCs z2FazJA$5QD=F(}JAkOYIYH~E}YX-v?=hvcgYmn@j@GukAOSKR;9q7SUWGoGwXI>5L z>Vfo?Yw00!NfJA=NcFWkvT6CSF}Y;^ST!Jqg`0-cr-48Ykb5 z$N0RPLB`b}Xxi1i-MkH}` zGRtxx$a+b$Jku3SUBQuvjT&jPDD0#yL&`Yvh(G|+$-+Pv(&QFd)E{rrR1VV%JgcHi zdIzfz<{o(=Oka<>QD(j^gNvJ9rNfWMy;+hyyzCNqvr@OhW-xU|(&Z9zkW@fVg&(IylH51bBv(60?^zk7fuQ|Ff3GL1YU}LI-@Es51a%d{_h%Q@4n51#A z#z1<-G+m-H)ow+xob23A&1k!%`k1pTxidwdP&SS`(aqmnV)g2*io{yEH<4xc6Q7N? zWYQEQeiepKLNKB^HFLAsZc`8$@i9TESZ4n%W`3UR!YR%Qx+s8iZ-%BZ*9tBSByu>} zk|+i;*RX!63U09&`hw_ii|SrP6bEA>4L7lngwfH6<@_@Q4lTGt{EJN-f;CPId0PJE|XCD zYSo5mW;y1f!Xukl6ZydIR!Wdde&^E1Uu4$wd9h6=01ciK`jj?zLCYi8J$a`ZepZ$S z%lc109XBRZRAf%oqNS|aoBc3Mdji?9LG0ov;sj@09i{IHv~5}@&I1~hK7yAf$=DuEPSVfSot()s zF~$Xff%inMK4d2M7C=JT`Zh_8jrXnQ9NidV6i?@|0WwVqCaK~D z7#U5+Fm&u;GNDIz#P}k?fW@BF^`eG1Y{`webn=DgifIvD>(LKXjgYg6HN2`TUv5yy ztZtstkjuSv@vtuq9T9vSF`p+@uhCv%z8Y=~2HNBX=s^7qq!|Pws(%_kZG63NtuJ5m zw5k!(p^~LKZ*XlaKhzSM<@3&Lq4?7fJztkVm7dsWER2$lQz1)cash52n@JuTr*nF$ z$bKzP)XW@oNYLj&7eUUbm(%-K z55gCzHqiN~IIQ}65E!ERvLNrt}N-@C)B~Ryc;lYb$AXPn$ z^ad~5NT^uRO`XKX$>&o7cxb?6+bw02r|IgSIRE)teP|&@xJvWktVS4=NhnBH4S5$v z2V{D?^g&k8@}>h$45(_DR6Ge6?97Q9u~3CIpe4z!%7e&L8}jwICK={28ubC8wG`~W zG;1ju7O9IG?37Ve5eNqI!djDG+W>{km#YF?9atM9)35p@lAbj6uY)?!pb0ZW(}8fP z@{3gHWg5v-BhK@a(kR5&-K-YK9#K5!Gg%4A6>EC=tYQ4-Hf!;#gQ&Bqd|1T;*v?50 z@tWp^AQ>e}5D@`$>ZYkQC@*s*qEriC$o_db{GuaXofrK zBaPi^>LnZ6Jl*Ep3+>c7{w#~CB)rG)evMNp7 z=;S)u>T!{r9uq{4R`j<~TOmy6%lNFEzP4s0$2{=^T7>M~HMnCMYY_rh>LXj|XLY`t zCf9Z5d%b3dM|Q&pn-(PNRcK0vRd#NrrAw!*Afq?cG%jb`E0tVh#ofr5v>#@?ku9>c zGt_M`;#$Iei|zd!9yo8kMs%`;+q`R~{$7*?L??Nzr!{#sEtJeS;;dw)P%Tw$I`NT) zW8<(!Fixd14}8ePik_*)W(mQZCBrJxyiks@^Dy+MdDKS#n5bdi)=4%xBo2`C{_zwa za@xr{Tce6V))CFZUxQ}Tacrb$KGr?*mqs*r(3)O}kk!!H@ds*IgT+A((K412Y-fpE zSB&(TET+1-19;Tz=M+hyp^@gvrnr+S#i(xV&_+~9YQEWl>RhZi6TnF|CDxin`V*%; zROe&cRi{JSiL}N7)HNRc6Fk_WjpcNw+NVN!(M8j(=~zf4n>|`JOeRGQQ^FdVzW}dT zdQyBN`^~Ic&4Nd|6RRNt_4q-B5aAV@Z_X#CAm$#0jgqs@ixfs_r z%V4Of)*zeivnWTl4Kic(7!29whfSM#_>LGh*iO_;c$*OMWJBlj^+AWRDj96^F^SoG zH`ibn%UB-^+xO5di0Jc2d@CEhHOO>i9XarN7L5-^?IiL(iHG9Gv_MeSi1MNnkn00^ z_K7EU+);|@7TYWewA(eteb@H+7xO9hN`EJT6WhD3lXT(^U6oPgn#HwzN5?E)GPbWO zx&Jd8SiqJ;HApCl9XoDr5G zWsu$-k=~f zw~DjmGaI+G<&K(c;@VSvaEgMduBh> zb!|;;yHnemnp4~6)HbGedrxiKx@+6EZTs!-eV#wz`I2Pqm9tKg>wL)B*UnCl$;1)r ztf}l9Ru(fsJ2I`Yz{O1Q z84)1Lg90eKrqDX#)?HJ^j<Db1^yM)l-BA^X%s-RA)bMwt&;v4shEFJqO zgUL6$EE`3KFS00`bOM`5Rt$$z!lPA@*k$qWPYPgk@AtgUT2BTXWYINa+?n1oH2~Q& zxeLP)S)WFZSvh)$Mf9l3U^J80POHMW+i$xW3Tt;On7$*X*Mqsv|90OC8{tj&P~A65 z!}Rd&HxAJ`JUDNSBPkU+!yvJjYV{RC9$x+@x>@f8Q zAW1%Wo={Z%8{Qpo@xCPBhg`Jw6%=H35$!E4O<^}~_v*5&#Kz((aukKG)5g{5VbJf7 z)A5*)ejj+y*MX;;noM7eu5|ZiiLxICH)RhAkflqYe$Y_sLXN(JQGHTg87&NzV3+8DS+|YfhH=U!H3{z4i?0DEx`7aC$ z4aGCr_wJH5vPw&=VYy%=u>$el$R%?We^6_Lf8+N@)};!k>IbY1|6U^N}f( zh?pnMF61U5D(uZ3v9gp)=XDn2(Gnyed9swvb5*btI;}jM5U1Qca}AoH+a^kxS9cm{ zqwL&}c4-2donbVyBa$3tt6xuFRhuTn@|x@`Vc^bbbkPgsiwD#`q!Wv*a)HxQ@;!u` zxxFy{BMmRugs*m()GI7?nQYtuw-M!QCK!eoSt!N?D!GYFz7e+e){#`0dLA4mib)8Q zq^_zvsI-^)lkiqNml{V^cU1#bXZBKB50+f(HofK(*q<60W{vo+Rr{)-n1qt3gr+;c zou0*lujSS^V2@jAkKz4KAPSiw@K?GY^-r^Yw0v^npz46@FN4SmAT)rc`dIz|dlW(i zXgLMd2P>t=w@qs$E+-jCl-`o>ny`#C0D@zH;cqp7iAsl{Ft1QFRUwqQ7Ux+}Q7PH< zxm_hQedfI(2OVSlAR{IJ&ah6Rfi~ztbNu>>ReXC{%4}$!RBqsAJ4*KiN{fOrFBT0(9~p&la=T&p2V(v zF%mB}M=ZEPrm6G~3g@CC10OC_u`*X{P~Y`8sQ{{8++Tx#pLx)IV(w@DHF!Vyk6 z9UtRV4quISoV`^?~^6!Z}W^-?7*ja>$M*O7?wUo`Y7CI`duaqor@}Hw-OA9iZ=cX{;hmuN*elldktnVIEKhryMT#sM&DX4zn^$Nr))OYb4FG8VH zB2Ix=K0=zwpMGi{k*^$Oa$AZyR4U<>Eoyn+afUX&Mn|T2a#TGec~MQ2VY3_eH6T`! zD2kQ=a~FuhWY?IS5>630tmd|HdLR=`P$}A64-04!;uy;-6U%>RqaU>2ZFmqC7AP_> zj5Gdp1++vunl|SpVNe%BhDc|X+oUP+RSpmQ#Yv>Cd6|UqN-v@>O&wziZca^X!TNZ8 zcsYX)zXO&7fj}V#td$3sSyJ+-RQl{M5f!R>n-2-vdwZuo;wD z#GPdY>q|*OebT_RQ51!&@-7roz(M=FJU85wXy9(ibX=WdT5Sz_fNlvJx_|mg+N$=j zof0WI76s>>=d>uMY%D&lUtka} z{t<9g0WOeXjy1BnY6-tAB@1sw3levA=TSUS$&d*T2b837p`$QmP}eNAwp+=_t5b5b zl#yp}kAD7B_NJK?J`8&VOmaIXFK{zYj!3y_tdf!6eue6NzJH-6{$=(QF zDO)6s+U+mWo}yz<_6k*YaKIc5A5{{B0G6USQ3zaE$r;qhXI=i7uiHpNUY_xoFPUYV z(S9ZMb{PI2odu1T-&M>OtV1n5-mBmFnr13%MNHGyD6GyU7d5nGj8NFkIGJPbaPt+* zeR^y$)A=3y5vEJ3OGj2B`s4b4BZ$oS?~YYtRN+9vGI_m^Dek^Aqe3}?_(3wfo0S|I z@SYx&{$^ANu!5k6f6l|O3pD~?tHu109g3@8j|rNwo1o+7K;u2St(*l9KC9zq`NJDT zO)W`Vr=)ubatefzZrlX`*vF);S{G5r@g8-G+_vq)gE>xK7d2RWqnstyiVpavuz^hlm|S{ed@?&_ZfJ>?C*eCkc1-pSE=A zL`?gt!_}uF{0HlSl>!*2{)6Dq4_t>~q~Rpf%fheaIYtgWb13Z0D`;t{`Inp8?TP@u z1}8Hr9pM<6bc-6|EvlN_wtl}RM||IoLOj5LTTG2rD?Q?dQ(8xQix`(zXB6VyKH|pw z0`-HM9s;!Iise=}X3G@r#WmiZ^M!$YOKiXWpEsHgN*<~DkKkRmA1_65O1HY9TL*Tx za=S@beQu@gQQm+(&M?#Xa$v*^*&`+`w3V_S zczhVxa+I>4a+q?Eas+0rQ>6poT~hsbMmq}mJ5;i2RwvGjvp-}JBpP&8ikS^3&fNl^ z_-^h~JwjEx9Ek2eCW9y~tBu)j`g~;beW5yMiUQEa$Ax)7)|?2u(~6Id4`C z@7@X{gcUBMnJE?Ej3K`7bPiLeE9G$6H=BR|2J?S#++r8 z%TEN}-CSNv&{7SOJKJbj-qm%$`*||Z?;Mb!>i`OiXP#lfe5U1EHlT6KgD#*R_cZtL zR4-N5KJq3R0}!jBoI_&~KcTXU(+RzgJ9<$PRz?ec-tpoR&5Psh`~oM~rQA~Q=KPDE zc*O@UGP^F3C7OWl_KtVU07dk|)C;fGWMfJ0F-B=$OwOwhVKg12BW{l4hn^*|-3QxD zi82iHk@3UdRDBj%rZ6~o!#sG8C`%1V5W?Pr3-uZre1cB}z9iaRguk>zsKSM#RcRC5 z7y_jH+SiU%&1cwH-c+TWu?8Dr49nJddJa})!yv?{L#qBGKe81TXr8K1S><*?<1=KCH9ij8HDhz&93^y!g1XEst&4}4^oVXoQ z{3NNZ$!6YEVONv1EzqnN3N8OUR%%=U!#kP*QCLIKMd>k4|2-O}wr3!-A5Y(NJxJSC zo$6%8NB{1PBz{?k*2DbDLyzwg)|nAhIU~Wzk$7Q4c_^O)Q-5>E0OBVh9z($sP{<5`d6b`rJc<@ZVxB{2Q`#fhkJR17WaK~A>b@+9_+9&|^}{+^y)O5^US1L@3rATaIlju6%r&|C(}uR z;pJH;_Ya!qgM=<$jpvs^zrS72m8Y+X{PB6ZN5~Rj@+~>f>VDv)mplu+=9*F}Z?W#RxhX?@P& z0GXq)Yoqov_i0yY=J0s=%>FXfSAPirm;%1HM-DQ6tsLR0mu36?ygH=Q|GF++?CQeY z{Oq1Yq~rB-d7g<0`g+)JkDqh{`*Af{Zx-Ep*|^Gy$!4#0v#$F@q=(IQHl<$eb4!HG z|FSztrOW&E{3c=V@l?C<;?{Yw*;#bOtAFt}qHXW?VAE+o5Lqn9@lh~Cm3j9v;pWjv z)bhHJjurDUAXhG<=6zS&iG_6Od42t&JoVZa-Nm<47z3Tf|L}QSxYc^lrH9=7`5CLb z<^8Gi0E2s^7Wx+Wws`tC;_<90fj^;B!EK5b=w zozGV8DF8nXvv~akzQ3HWw}iiL0;*iE1A#dgv*9)1G~YWjDX1A-oZ z?toZN&Q%(o6Dh~gOW${Q%#C-)3Z8oH-()}PJTHe?TLH4~odHdc*3Gt^O=q+64{6HH zPd+bpQxz}TdFAgt&{-X~LDf}{TfCp0%3Cp=ju-Y{?tMksrX8J^56e%lpWi7bdRkPz zhO=5!ylscTYX_b-IIao+&491_`$RyL@Al0CK+v&o;VJ8OHSPO;@DqObiEN}_RGaU6 zeQtah7oOWIsU2B>&!br5rz2e-?X%GA&y&xqHv5$y9>?2x+zNn>mXpn@#pQsGi@PU2 zE~@8QZsg}7^slq{bih~nQ{~@m-`A+KO?S_)Y>_F!rmwX2z1di#2XEWE*Rd?GtLPbR zPlnI!T7p{kbp7{DQ|r!~_p&qf&8Olm!TZE4xz9(5PyP>qr$j)t-_!-Pl6BV0IwK*s z_rV+^zvtVB{^L9OeWDj(y7N`()TiCWDs<%Aqrk>P2UgbuAPCEL-RotMo^|ryBJewf zFU3Pp#1$X=Me0z~`{xT0qTsY!geHMP$26y^ ze)X^8${{$o%WTEBqpd^!kCr2CU4_m@+e0}o*MY)=FYnHe*`@X``?)&6tGty?-EAty zcLqM4A07{4OXXXhavslT^?n|g8y&Syr|DiufQ+xDuD@9;UMF67(zKuNAFTt$_%H&W zukD*%U0H_W2B< zGOf%HPh_EgEx5(wGy_;Xe|s?&jOv_wAB0~5dLQqK(Ge~eJZ{`fUnub3k7s{+Tzv?7 z-4F@B-E4hb`&yr`0+M%PV-xEH-A-Tld!RWNIJ)kSu5?=YG}hYo)Vr*GK4+Ff-(UT( zvXpMu%=P_FgTU3dyhnOu3Ty$J8ab|d?pJB26>FY^);#X3U2Z^M1CO`UJ5Pp}yMQbG zt`Dqu37$oUP42xchKqio9Ook(z*bxSL#|x2V9xhB|M%v;kov6l!xStvzWSoWZi206 z(VYNp(+#gGzOzxfskf&l!4A}a?G~>)sswLUp7%Y)dQmcac2%Eu)mdKE!1sG~y%(*6 z$5hoPpzoWtAJI#(Adus+y_oMYb_nU+Xj8^(%U5~LX@-n|Uw{23Xio39AJ0W>r<{U~ zr`6Hq7O?hXOCj28do*Zg(j)SUpXo(ttC_(r_RCb^^1|&2;*p(R-}jcW^J|GpztZov z*p~I{WwgM0(|t+#A+Ox$=&|K~X7#AAe$)4$@txDt?engxnXW18{+?*^#ATrH!J*Xc z!Sri&@#SdXZ;GIc)y0+<^i3bQ>rg@Ck6*tY|qf_;^&` zn?=K0ytmV?|GJCR@3Pf#x{7XnLn2nKUSI!w+9J4&kf|1bC{W9Mng9HXl=*r{d~f{w z$$ZwFUbd<6)mLGTJT->n`=D&jcio$~@x;e;8J<b7gRY zwdve1$L*j#QlB?}zhbF+<&@|CV~odZXs}Q_@NbvTN%mOPn$r#NXd~G^`)Sm2>8rfa z?d-FX-+E7JvoEtFu?auxcEC?yhV|}H+ummL?oqJ)%Fg3(b)%h7yZK^5lP^H#)pw<} z9m9R!%V@pnL7Q;%UUBJQiI3~lbB&+wbi?)C6z98s^jrG^Qp`6&&Ai|s)M)=?Fo;2&x9w>Q)Tw*9Pj5%efC9a z*V{m}ZFBPy!)3W{?MKEKhbN)p*4n(c+Xtr}c2igX$8Esj6XDBiN20=3>*a;|<51z% z2T+$$>TOHrO^esdn(^Jy{VpvO-0R5RUjK9aRV<)B3o&NuYvIkK%g@zbcPU}%%j0-a z+f0v1=FZ;p;8vp98~beSeF}Oj%J$`E7A;$UdCB2qPv2Izc0XEB9r%8ERn_@$M406{ zwzcM#-F)W-ZLYhpQUCameeryFzm%=D)OhjUhMdyTwU_Z+J|8Fm&ElOkUwutkPoc&_)9nj>X zIdfvNEA-$r%ghzjPi7Ap07c^;6BA$H5=Sy`9bsMl*m|yu)%e8zlDK|}WIIJ!K1+0Z zwjVXlBIi@GO505*celd(A~qR4bQ8&TKC);)O)K@2;MEPRGd=$0oUkzSo$}q` zS@ARO9KaVD`y4i9{%HI7Mk8j-PIa!w7Rl4b&Y{J!V5QA5LNe?n~w>p?Js4+h=s-=Lh{)2g< zzahM7+rv-}{$H;`LkQyxkf!D=zuRt3rHSSavhv#rTr95rlQjtqAjXEOgu$G5`rt1n zrzxc4&(k{ErDq$d;?be{X`#x7`^Y|+hYJX*iSNfjk)AH}bW+3i>}1QSLCJ&`N|dvwTofTum7x|Ftf01a0D91&Sc&qX zg!Ts?kY^beYy|e#OVZ09OxE;|tdv76ZYRlNXmWcNW!3qQ|Y2dbv?KUrbs_G zUf%t^NXIbuT_C*h*A4BpwI_&FsTv|Z!Yuf)hvx4v4{Z6ybQ9P2K>s14J0q)o3$Lt? za0K5FOehR2yGI;2r{_Qry_3jrrarrS5q+U_wC+O`X7-GkhE0aOG30`1oronu5#w3y z^sGw=$9*F%mST2v+w#Tt&#-WLLM|fo!$AY$vR6%FtG1h;C;%dFLYe7*of@~kgfm=izgESor{UaZohE>^qSp$;%En2SP;UttjVtU z#k3?Q?{LTd4O;r$OJ%QesTm^MAR4$8Paf>CxJ_*BXeo2ntM^Hg)y`BN_%paPS_=IP zZxUVc1=Sl=(J4`ao7-oJiKG69T{|s?TWuI)U5FC z6qQ@2YHRwbXjg5%*d^RFD^9 z6^U%{cgXYsAHf-BZA(U|=d?A%!Z|Tm69BrVfVsD9#!6!hm5t5v!n4x4jnIPp+fW zkH>i4zOuq}UO7O?sqtSZ+CO#!O$yk|Y`Q(hFgEEK5NfUt-&pP4i~afU3|=B{xp4*w z*>YcaU!?vQ(|rJvL#8)jqp!YxoniJxARq9BKd=zm+ zBtiSLqWWtO^Jkb2{yn5h&AAC+b3RHO}O_jAN>rbAiC7VoHnZrA1>URr51LoFVdF3YqclcFp}x)boH4u3-MvA z7NFu<5^-4)#3GJfRjt|QfG}LS?giyFfsCBAzs(sC;829b3IDk`Nd2y@%FtE;rYXVW zB^wPhB82%w8dXLcn5>{@;9A~zsFFqEW}kx2Z5#z4`7b4ju6Ev-o9)6>=ZuV*T#H=5pno4tv()LF*)Ss zgjv*NFDiP0P;9aH=|*u`Mg5P43VQn~>ta`PccXXO{TT-_dX$(NsZ|_%vwPD%kxG z=FdnAr`m{ID^@aJ&nhA(Acj`eeR3nedL3>NCcR~sVhWl z(9>u0*_nTVD+FknR{UDzMySnTKeYlQZ4)wndfcS+<0%QdFtsceuO!ZL>QQm5K)f>X z3=_=6!wRI5rPA&(ii^b1{KzB>V}tCgB$pc~uu!9l+&5}%QxbFJjV~%k`!sNoWhaO0 zx(0tBBJmO#|2!B6ZPJTOXftsPcmsq1Ja#$WWXQA8{hMpMw?PX8lf619y1@1prslzA5^C!OP(3kFa@#*b64EcG}AQG z^(E03YNh6nD`Qd<9(W$ei~^F=lX#QbliHKLlHZc`>FjCOlH8JzlL!mdTg6&c(<#L!G_X%N#6#v6Zc(uEfHcNqdhZ0JpBoE9^=g0}0qm#J&`l}0sDq?&G$ zA7q;jzH~3Ijh|rm=g<1)c1>%KgLTl{V5rF&ZUzT?Qj`$^{MPKY8Hlkcco3J3c@8hB zO*+o3o$0Uvndqx6LQFa~eiIXyjlrMI&g}*dl7&Uc4%QqIOBnGkF**n8!GSP@KAl0< z#@=Ve5lfguJ`g8D-;*FlUAu&6U_w;;c|OAtGr+b#*#u}B)g*h>RGYFVNq53EW|?%r zH|U6M$m~%UQ=Je~b#6@eH$K@`r*O^v&`@DFY}8U+W|zxKF`ObMD`QB$C_eEAtKo7I zlZ8dH3sDNJ+pK~2>D zxuXPvC!;skOmgx*bDJ_{^YLQ1kVgL{*RtuFyYQTkcxzqSb9QF=G!hJrNf#^12{x#R++N2{ zT*AT8|b&_>%!= z=rPu+WYdUK9TmPEjHi}6<}*_4JFl2$Vq!4yis4d&kQU@6i*#c;B)j~k&+YEI|L`Bx zE|ABX-eL|Xst(z9R?0XiWG3|+`>vzZcx@bp(H6#7ue1mVtsgnh3IYapsp8APCX&^0 zhuPyT{7LPv)zeTb_116?{y3RMe`;vN3eNa529khK_2Lu7e(WA??1a}os1eRL2ggDG zV!&)1t@AZF6k!R^jn^cSR&>uCp9~vsD*8=O6?w~6^HzIj?!k4++&62i4)vAnZyOj* zaRCbDLx@HXQDxbUJyDu z>mZC{nNWf8m`&WfF(tKP`Ux|^JbepcDyqn@UCknLz8(L0%a9l9MX{5bx{7XbTLQH= z(!fDWd^6%>73tTL<5zuGbE?vuew0808esgIUVUygwsd`YjeG(EI0j`d>jrC{ajf@pe`KrIJNh8({DN3z zUH0O*jN#BkF?RnXVMpbr)XDg$C$p3C-nD7UPzat-^Ev!+#5QXE_;nAMGY*SPI8Wg3 zQN*LO^r^wsc9L|gBOYGse!Cq_dw#mIM6fhaB8nU^@{C}e9DNTtbJOiXz)S1M5!<~`U69U8_5}- z-G>`o(>1lo6frm~3EXrnwocV6XLV51p4Fca$+Ftt0~6@@R+rGMsYES10|utnG0kSZ z=L_9c4?LDw{xJ;53F2$g_(UoF{K#S00fc(*R8*6{D`^f;y)hyR+q~K5T^J-A(L~?J z@G}%NAD*e5*m^ri-#36K%Fb#}&Q@{AXQtSZ#!)7m%Kh@RuZ!LnL7+1}nb>J_moCS& zTLda|Lkk4tw`ut$C0!ZgE-YYQ`^KJ*Lra*mm9h4G2Xlku^9UrY8N`WxJ^NG9m5;!o z=eG$*oeD7K%Ga!6DHo_2;q4{k=~-Ig%JJ{COwYrMYqB*aT{6zyz-AAQtWSpRtfusR zfH3>0Z57VKi0*ZSX|B4E5{1g5nm|`cb)A%S5q5{i1|{yQPqxD; zz0}u*N3s|_t1fj+KZ|)n0n@IjMI4H)l6<@cV0}sP=VnVw*)b9ZD~KzyjCl1S61F zR%hbwa>-pD2cJMuU`o~rrY_fYmgr578r+@+>)Uy*TkG=Msj@m6bw4FX%g*@_;_I6@ z&cT5EHzc~+BDZ!@R$D)|gq1ewP1&6Z!iZv!&o*b{$W~y7PbXJ$m9K^QtYr=)Qr-ol z%-x!ggh)xK$M%tQOTEOOD@}vKBN~ zj7gz))m#Z8h@grHf(tO{_~QmJ<&gq;9#xSnEw;d5G&64rvD1e3-ZVC9w$C3Yv`Ly7 zAX!e1!Ohr*p$m7olP|RQZYKGa)Fu!6KoDr43w9J$H*VZ@tJ(5EecO4_rFcM+>s#^4 zNcz!+&T9(Ny$VS#Zrn@S6K3b=q!8o0)g`$h^54;DMYV~;@#!A^=J2?smDvCNb)bmF z(wh6Xh|y&(j*z&RpcJGPuMNldjLFW6phjX74u*hb5pRs$T4vJFk|+g|`XYx$c;=Mn z#)UDr{+3-Y+y%sDi;*B9^pLG#t&EqDNP76QTXvse7)En?+M2?lne8X^zvbk5eO#^Z zB)i1W5lP1b4w2;fKZ>Uz#2_KmrxNIdtLBuJL?~dtaUZ3;F8cdPQW^$C#{Vix|5WSK zqhlr#rq#WMe?Veeu+49pkuFuXACT^h$4HUR+L;|K~ z61H+C84PjLv>b*Vp^6Mys|>m_Pe4w?X_L?A9;wz6rGk)bNx{StXY9&SgTosKnij0~ zz`#nt3*)FxiUVR>Y@*UBM|UiD3qG+&W-0ks-jlP04;pSYllu4^JYM8gur5I;LfwNH z67fO^9D)NV6)9vQ5z@+#`VjVma#VLHo%|A01WbAilmU^ufU=U_n9i~% zMrFEf*_hIp_c4bX8m+`%MQDdCu?Z-{GLU9LwE&Dn`JVc3b9?FOp>z5|Np52f(Hly$S*qPZvSUxg>ODvK}6Z3d#j85H$Z15B}JoZqAY}Zy8~^3-yd14-HrL09w;jBMtHayik&eZ@|ssrbnXCd zV|)%tf?;5WK(V)_7=DfEy6}8qVdgp6$KoRAO#fxyJ`$=NSS198B$8zVcRz@5LkEP` zQ+z7AK{|O*1p??9PdvJouJ(D7Gi6y#2L$dbGTXXcpfKCtpx0FygnkBW3XPKE#85h2 z7zJ`8WVzRzXqfX{)Uce4H)QsEfAK1bc(-5_19fPM0zeu+2MWO={MInRs)}qX7Q;eVTCBeKG#<4618Z9wfe<|@`f+|yUzL;LPu04k&adPWu zN5v0g+Dunc5zkuLUy5ts|KjJc1WTT(OT=J*H0R%>F=nS0vPP_dd+Ln6D*z+7h(g;>-ev8V!;iL zAbVthEM-&wuy5kLFfR$1bqJcUY5h_vTo|^e{^+I18nkGM$FyZ}ZXyD|4Vz+*w=xyj zkF5d(;$I-YM|~G#QCek1z?&`!)=`RRogpxh@v28aka3C{ETckAH$^UF4~X%sekX{S zU{4DTf>*GL)~Y;GDhA~7qC*QM^TOsP^WYSS5cjiD_Nr+#Psu|ikJ-+zu1|gYDe5FC z^GTz+2bEN`T_{llL$E2?4SZ&jcuPa(=rjGtlX+Z3+D^Lb$qfHV+I-mp6G4^nIPaeq?KfQQ>>D7uob3A({BBN`#lBxXA;B5G`t4nl zC>f}m>`jiy^M?^dD(vh)+>**tJeV9?Vcx}c{|_0sGjAroKUEs)@ooh^TRG3Mq#@Ox z!FCPh#ItsOuGzdP;6IEO>T_}*JJG`(aDQo0RQ(f zjzPm$Q0b%gq`mR(W#mDv4Z@5X5@msDBElkAPAWR@u%>rE}M zU?@a3!9-Yz{ZnR(MF(wpY9fCn%GAg?)-IdqSpk~cdCEiXl3zL>ofu3Mm~&Y)=j1hW z_!>6z%S^9ZwnqvG?i?Xe3`0*s-F=wR#|5CYzg&gp(3GIal+4Y<&ds9|aJD`=gv!8a zoV@|HjKBChW49JqpJt$b6<2r0)8>_%(8RW%v%d@608P058(f5Z>@6`#B92CLVJ1Hp zmk}Dn&>drM3vifEpjQt?YBpD;{UYO6F!K@pyIPMcbX&ha8g$`M5`OUv(=F`*KiSLv z=M1D57bGgVQK1d#bECK4kI|z&`QA5Ot~$qCq)44u^{~46w;6Cqk5|LGbl=~r;QX;t z`?VW_D$(KU)S%QyP@cHcxL=v4>GAg=5V1SfJoAVrfty13o$zfdwscXU*Uw7i>%8v8Dp>r> z2)yjgf)|`TBA@5G=|!7WAgpSuDl0zS^KOEJeobC1ouT&AYa=;LsZ)51&2Z<-;xi7d z$es?I5+9ZxdoqDYDoY091 z=BnLe>SHRuZRs(ghe zZ}m3swr};)|J2pQc>{)MjWfIVl5ga98o)Ebl)X;$ZtcAf>G5-+;9a{t5>;!`ANMbpgoU`0y4WfX*jt9?3L}Dz_zN^ zFCjWbTl-+W0geE)XS)MCs_Tx?4*Bi3>XrL61 zu9h;P(uCLl+x4e{oT6oHPNRur@M4n6QOZL1?EM1vy}}mW)Sv+E?pfVg-R~7?dgh?I zuHiDRkf|+lEOss?dpA5Wq~da3j38U5$Kvk6kcy{XFS;|QQz>k-SuGMTbqJnPJ>=;< zqPrv5!J>a}-%SpH88aU*%t76}76X;Xi`)re}dLS_xi@)svUFPoZL*Xb4ANbu(L60N7bV3s?OV6?IL&%^A*`X1*=Dm zQS~R-FZWL-+52iQXU2A9K}>t*HgV{ z>G3jvp1PW^%*~1)R9uXtm&$@&Ij_=VUWA~glo%>*Tei(y8Z=ahG$}>E_Zztgnnb&m zg~jxEJSn$aIV8_8mGr(sC0AOyY#K)H2M>qo@pDoxno?+1MgrcR(ym!?KS3fYCtYpe z#(=m=Gk4+C1KA}`>X2AE@b`I%H=I&$QV zpj6AW>)okjRT^%tPafqIf3JdL0sYpwitQKNSa5kF)L#O`(2suw6cYDi7M=ZLd>R{ zh-^_4i=|~qQ%cG|+p-ij3v0^{;x_M`uqKX0BH1T@W@sJGrluL9@q&){NH>WJtw{VC z87P0d#9LAc8b;jUBrHT}jYuep3bE9h`OJ)BvDE8%(5=CFBZ(r+;wF??rXsG==(tg5 z<{D+IuZCrs1wXBGgoiFNJC=uR&Cx-4b4DDCRcm5ex5a|CI2FBmb0yx59z_#3&z%AY6X~{K#=XOFAqObYBF!p<441G1* zT*?t~Y+-85IDrEzz9aW8k~nw@QW;{384rtF|HL1Y%dqs5;dLDDzT8IETZ1z0x$oLB zlz!sdl5!Zu7nY)SxI8-w#e7VScRbx@qnMvuCmgLd3dPgF@c#|nqGxrW$dzMIeBXxa z>9(IQTye%l$Ks<2v0%yuYbL<;--Bb&Bzp(o$v3ycBknIbCP42T7Ciw)97dv=C;+m? zH~sUQPWc}?KF-0QVUISF1%?KCAG8jY37YK4UjSPe`W{r8#{fxjK7Ix~$>kS8P7T>< zcezE*ZcIr~oZBx!FtBVBP3D(2Bk_bI+>HI!Sts!!H=}4ee(Q|u3!sA@mdgs3_*)^u zxpjJKWTcNvUAC%`e%85p^70bZo9L5JvT*OJNtYsY83HOM=35AlqG_DbZ|1~CH1!CV z0pFilEg4HNxI9+i4pU#Nhjnm0B zI{&yB6Qy_2Qs7xdn&E+Wj=9!MXCeN4igrkLr8Dd;jp9PzDR8k6HMS$67_P;@v7Yk+ z;Js(MAq5PXo3nYoOE&|aO%LWJQ~ikx!0;NtxE!BardIZ%j&b;r$WIY*sIzKyD%4nC z<06~H{<~y!U4_~QmhDJupt~4(o@UIcYk4|2>k&DxV8Ogm#5`j3enuqvl-7Jb2cb&5 zOQ@#s9)o5Y^axwH6oXnhVH;)15V|IsFk3jIbP=t#0gjNVR}M&4 z$2wPrM;a!ZS_KlsqUB=g}rG2ReaM9|+5XUAHW?YI3I z9`Q^fXdm&yKA?=cgl}noeAA-eeNZLQ-Vk4dXuj#?uka5jq~mY8sKlr%VAtz9k3rWtI>P6+ZnKj#ngN6jTFSFy57b5uchyP!%OOC z27C_T?7SW%LMgf)A#UEDI9QuENXNar0?H~o1dPDFZ`=1| zHg8gMzq>%p2D^FtF$wl<-h7;W1-k*k+pc4#&>s@F3G8#=uH1JB1Ql&|2(pFJzLi^q zV6WUacsD7vf*xYrzS}Z2*D>GfrGG-)-l^t!H`igk$1iUz>*X6GGB7=uF2N+`ga!Dg zl(-QJ=v}2_1MZjqUsGQh6~_{^%?%JVgy2rl;7)K0un?SJ!9BRcg~i?7orPUkB)AjY zmJn>wBtT$+#YrHzzso)E_nz<1bWc@1b*g)Mp3^g@rbY?=UOH$yf+#yv8f&jnCr;J> zP|c1v`7<<-sw=W4FgkWn?}7M;qXaM!Ro{J_)oy9GE5{m$M2$ZX`80mx)9=^gPf> zCf^K5KMOwH&b&PmEg=(|gHL)O#Y?h})nW$keTy|yiuOLXJ^nu3YsAu9rfe^M2$*>S z@SHh_Ga=+l7|M=IHP;kr1nF;t-tiRf3M!Cjob5&3QHaB#ue=b7yxqGQr39l1T7K|1 zwv&x#Wtz|zk<>vUd{NXrfixX(Xa*3Wv_?NM-9Ufu;WZv89!H*hc0X{3FELB61ea^Rvn0)Hgfgjb2;`>kU@}2!Q_`lxK?jTS)4J9qX znf%Yin+mS~g`%PGZeUf>X}egq!kszaSA)P`(cFbQg8d{@r~W?&fxT z=}M?T(SVZrQ>Ukpx9n`KD%B)ej33lQ=kVYDL-Z}kFQw=<(6KfDXF&0$ILOv2TntpcW$D0w&Af?# zpA~7!d9q$~q8kA!I*H9#v-To$;>3POipc&mHiqpx_)W{@a?S1+@xu^c= ziwLChAbB`JCuc*@*WbdH6`U*{P7IXuk5kAWP6lPnu3&hNSCJ2@S1>_m1U>KF<{T3= zy%8gY5n;f4w~rOcez!mAjnn6kFmM~1YCtCpKL2F+D)<~7K%Z#IaktNIq(X=LqzxIq z-&Y@tXk3nxk%o~yTn*C8aR0T)&p+O@`#zW=^P=K-^NE~f9#G^&AA%yM;5!sKrO2Sj z3C4SOg_5DjDfkXWPBITDa-t7;BB$UxO0kUscocmft?AW?UHr}a6oo+_k)~U{SKrv}w%=~5&(9;$?2}ygG^2NCF@LR`Z=arolT96k=NOol zYVKmZo1kF$?~Mj#lum`b2@av}GYH>5A2QL{H9|9)WmV1@NlZ5I6vCaX&yD7ZSghVq zn4i^>CX8j{x>U#6C4`@A3)76OSD~Jl)@`SA?2TfjrVP+0du0U!nwvBl$J4z=eLmpX z&_-!SN=89cndwuB!t7QK_{~3*H*BfD%k{2najeedM5@j~_GY;pT3gERCI#_L1%0|<8sJU&yRZvb|Wz(N~5r0*oX|d3{$X1AnR{sK0l_~ ze8$?$y6oTSzq2$mrgZ^q;7tB;Q5GdJ?K}#4B6=$NS2<648k@^%&KUmFIlK)5#CxNG zM7jIoL~6DFrC~%?jY(nkGK3Ha@IcnXYS)QN$L2iVO!UVeOhG!{0iM5Rf|cV3CUWF* z%-z@*nAf<$TkIdt9db>?Hgjwo;)FEwUm){qs^A|#f+gm+pQCH91cvvW_a@1HroK52 z?{st?Is~n8ic~$s0@lbC^!lcU7&>xXN-O-++~Dr`ukT(Yg@#`bG`KNAs%{RXs?C`q zD#DRQqWh;GWmSi&?YIZRPm-zNcm02E$jo&zS#?&+-bGfDnGq#cYn$`Q4&+|57>V|? z*XzsMM9@l~>R#P$l=}?Crfe{B4)vmPwOD8ph1+w{v*irv0Fp}U8x<9?qxMF-PM`20 z$mfQ~k-`evLoR^Vn>xa&AeY!t-H>-$S@gJMT41AhV^)1R^PN+{HqUG<6tK~25NUl& z^#)AbceYi$`%2kVBp5>B(jpYD!dkD<3C&BC-V9~>%a$+VPp>WEZ)vBKI8zR2@u{gC z)-QyD>7=$<9A%Nyx)x_3md4Sy4-=eKqvRD31P@D>aQbnsO)E25<=@+UbY zIt4g5h&uv&3#l8cgD=f-&HIOP^iyf6hNa1v*h-zldwNK zvhX(+eMGNB+aWH9#i~69MjTK^r(JBgS1P_>4&_b$XQu$fo!S(k-PLmQ*S0i&{YEzH zk^`GbQ6Jl{bdkh#!^t(yNS@H7b@9zk+9w63-Fos{N6@`xi{ii!OLbExUC5d_?HSe( zL~DjZsFk$USgxmDcx!22mmXqfG5ql-*}Hqa29tAGY?DVGfGysE5n~RwZXsFYXY)N( zr8i9XeJU9%yusb;o?}TVlkpi}R&X6JzIefC|K-R*i@Pbs`?+PzGM3P|buESgSVBZE zT1a$$N}HCC{sFp&$*$A6BC;%y%miJ1u3CmI(e0Uux*;N;_!vVwtn4OP>xzYNaz`)D z6}5O2qJqqldf(nE`^pyUO?%E5cSt-d;T5!t3H>&SrZ!R^&BZaqm=cHk&kwru7W-er zueT7M=EGRrJYknO#}D46EeAE|_iHrz^4v<$+vYa;Lw+sEhG=(t@>ow7jOTHbXk^hW zk`RBPHko;}8L6@s0$Iy+>2cd5QPXSJo;BvluydEw<#*gvO?izvA(wU7(LIn79){<* zFJwoaEzk@9lHE}f(&XAVhLsV%>SDxRwX($7D*?vKX1_c?157%7!xw!fCgfnrz0NRR z7ivSGC_igSXbiCVm1VB{$(qbjo2~wpbHTUVofw-WE%E~8@{FpPT=Yp$6GMT1pg5^Q~a(xEOf6{6yEOLI0OUtSs{lG(x5g6>35GDq4oEdkF zFu2|~)^ch}By@lOc|pnd@9eG@Xs-p%0}&=kl#TEHrbm4M9w2C z#?K~LzOl;THf9^VeA>;J>XI-dZ7<|+EpJ4IwLfqFZI(sr8x^z0O}!*5scQJa&PbU* zXLudcA{C#!vJ;-_;?C+gY zRo6hp_&{gRt@M^LrVJ*|y;P*0PKGr(bkcw9btn@Os2HimX!l5Y0#B9TlyWh&U{Y<{kud(B)%AW%`FkfpbQ~ zwS#i4WM%z<)*=P-3GzlDRtj_%C99K78Qki7kmun)cIxHWx*pWWbE4r={i0;@({sqe z9mD&{)3e~My?-Zk{9nH>o}EsX6~jxBD^{H9mXe@!n^sHT*-1wNjjW1CV6UgsnTD7D z+5k0FCz{VFTC$p~U&|w5uQiwWwH4kA!QqqhhNQGewIUxle4(?Bd3<*_TPW_Wcvqfy z4H!J}%epkh1on=hGdT+2`3A16)N1VY)QHS6Q|;}3%2!}wnLJZguK&`vt=*)Skv-3@ zW0&OZ?Lz8Hl;o|O6>WYc95I>9_vb;@DeZM`%>Cw^4TiHH*7u4Mp;D5&^Ha#1({($&gw zV>&~vEeA-%oFHJ6*{2@MQ+P#WwCqXq^wwp&*0ai^DwrjK(B`aGx%zEr0xlsSzEurZ z*$h<<;Df^7)N^U|@tnGFk;03`9m|~IXWkx6WPBw(xb-*wp)OO4-RYv|I?awBKbZ-0 zwS1-`6R)G{k}<7`uG1W-EwYsiWrODZe-q^jQnL=AD2%^B5j4$KHqBDkYuuiTFx$C3Y0+5oSmEF z-*4A-Wu7BJ!(Y@7EVe6s3RwHo4n-1F-QV`l`gX03*t)_)SWki5LB);NJ9F?VBx#(h zy0=rAG4X2t?xOV2YW{)FVr`s;y0>GQ4slWb?!5F+(NC!B=WU`V1BG_hE@60WQ1lmJ ze*OQ{3Q$&YVR%)X#u4#Pl(+c*&znN~#opfHFbU-UaB;3jb91%#j~B@-!^w;v3lxZD zVzJ~fUnYn|9sXVpa+4u{$sfnlfk8ybzeU)rX=);(s!v=`Cy7nhx2*YT{35Cij3 zPKyxy9A23ViX9K9$1j*H5IOx>_n;P15n#s3dec;8c%!ZvQe9JBQ&WxCR**EFLQcws8FzFO?acs@>_f=D20Znto15>lE|6%f^=&=sf~GqCoubj>+@Jd` zR2^4Y^3~$#%lR*{zlm1zx((h00xOaF1~KI0nnIVxoj>y6u5~SRD|}n`!!#OG4(pGd zCSSp13(gPJzZPR0B}Mp!w%tF5!bX$e4>uTek;e4{_7F8G?1BZJ); zCyMhdCY38~oO{rIumroJMnKDFAb z=Qc9+wZ33u`CkpSzRs4GJ3IGp-LYqRSL(m5j%IqlO&K0EjauoZ6X;ZcwjOCSAw!wG z)gVYSsdx%v?6tGF8W5?#AeE3wU)%l8H5U}H$NNCd>M9|FsZ?K~5Kie#}gB^yOJ^nBBUeD0WJJt2=E>AAxI>vBk@7v|B{L6?Jgf zv<1P%fD~CG^}4?wRdI})@jP4U}0@` zzSSs`yyG@cgIG&{(|;%^he+2i*zgJ&TXMr)?d&^$(N zW~PezrzQJPgE$VH1P4EjZ=AJc`j^8Q@@gepcsvOfR!P13L)^1eN0b@71vpUfY~BsN zvK~~Je_tL?NW;HE#ng0mqeov*HA}V^_1PSq9Oy&a6vo)>2Gy%G-5%jxW)+gHAs;XY zlB8$M>kaxYv$nQVP4-dqa0M;#%aRfLMgv`*NG*};m(#(Nj&dzs*!>JsKZ#kIcc%T8 zX9eOGisM>WzxpIfdE|vcVA(3qClS}5kU{pTIi4yZId@Jv;L9HNfZ8gAG0|kp` z=`5M5-*EiQ{=TpKlW0#gk_yD#;;EBbj9EHTb(n$MVe$&xGaV^8_BOgqsO_1~g`%9K zq`4Lu?~fAy0Pu-3a%Rw*=9Br!+EQowze;#+lFtqXo;xv@-!xPS_yUNSHHmF+1mFNC za%xn8k1`s%x(*4+es|7DQ5go1GX48(-fdfD^pc{T+>6?iOOPO3rG1lCGq65u5vx(4 z%+`jvzO5-4{;j_?3LC?hMoi!qlM!p>M_QbN&d6!!X0n4=H-=lwa>tL@RlGl1FVJQ1 zU*#KaiBdD4ARFZ79*a{Qd>`2}z~v@VrSVBTr$*ThOm=RTot^myO3v6zB)Q1b5mUx+ zoNIi;iqSt8($<5d!hpEP z;@z}ZRz-k3L45O2*%+H5AVHXfGHEPl5+gqGgN+bIHY1pX^2H>-B7j}MXa$Gz-jj9t za2hO%O~8=^T@k>U0bSx$1b~?nmdZ&fG5vQ-W9a_hVJAKC;hzuB_Q%n*Fwy=8;@P4% diff --git a/deps/npm/test/fixtures/third-party.md b/deps/npm/test/fixtures/third-party.md deleted file mode 100644 index d5f33cc1e83155..00000000000000 --- a/deps/npm/test/fixtures/third-party.md +++ /dev/null @@ -1,25 +0,0 @@ -"scoped-underscore-1.3.1.tgz" includes content from the Underscore package, -including code adapted from ES 5.1 section 15.12.3, abstract operation -`JO`, used under the following license: - -Copyright (c) Ecma International 2010 - -DISCLAIMER This document may be copied and furnished to others, and -derivative works that comment on or otherwise explain it or assist in its -implementation may be prepared, copied, published, and distributed, in -whole or in part, without restriction of any kind, provided that the above -copyright notice and this section are included on all such copies and -derivative works. However, this document itself may not be modified in any -way, including by removing the copyright notice or references to Ecma -International, except as needed for the purpose of developing any document -or deliverable produced by Ecma International. - -The limited permissions are granted through the standardization phase and -will not be revoked by Ecma International or its successors or assigns -during this time. - -This document and the information contained herein is provided on an "AS -IS" basis and ECMA INTERNATIONAL DISCLAIMS ALL WARRANTIES, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE -INFORMATION HEREIN WILL NOT INFRINGE ANY OWNERSHIP RIGHTS OR ANY IMPLIED -WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. diff --git a/deps/npm/test/lib/access.js b/deps/npm/test/lib/access.js new file mode 100644 index 00000000000000..5d5a910f94e2fc --- /dev/null +++ b/deps/npm/test/lib/access.js @@ -0,0 +1,576 @@ +const { test } = require('tap') +const requireInject = require('require-inject') + +const emptyMock = requireInject('../../lib/access.js', { + '../../lib/npm.js': { + flatOptions: {} + } +}) + +test('completion', t => { + const { completion } = emptyMock + + const testComp = (argv, expect) => { + completion({conf: {argv: {remain: argv}}}, (er, res) => { + if (er) + throw er + t.strictSame(res, expect, argv.join(' ')) + }) + } + + testComp(['npm', 'access'], [ + 'public', + 'restricted', + 'grant', + 'revoke', + 'ls-packages', + 'ls-collaborators', + 'edit', + '2fa-required', + '2fa-not-required' + ]) + + testComp(['npm', 'access', 'grant'], ['read-only', 'read-write']) + testComp(['npm', 'access', 'grant', 'read-only'], []) + testComp(['npm', 'access', 'public'], []) + testComp(['npm', 'access', 'restricted'], []) + testComp(['npm', 'access', 'revoke'], []) + testComp(['npm', 'access', 'ls-packages'], []) + testComp(['npm', 'access', 'ls-collaborators'], []) + testComp(['npm', 'access', 'edit'], []) + testComp(['npm', 'access', '2fa-required'], []) + testComp(['npm', 'access', '2fa-not-required'], []) + testComp(['npm', 'access', 'revoke'], []) + + completion({conf: {argv: {remain: ['npm', 'access', 'foobar']}}}, (er) => { + t.match(er, { message: 'foobar not recognized' }) + }) + + t.end() +}) + +test('subcommand required', t => { + const access = emptyMock + access([], (err) => { + t.equal(err, '\nUsage: Subcommand is required.\n\n' + access.usage) + t.end() + }) +}) + +test('unrecognized subcommand', (t) => { + const access = emptyMock + + access(['blerg'], (err) => { + t.match( + err, + /Usage: blerg is not a recognized subcommand/, + 'should throw EUSAGE on missing subcommand' + ) + t.end() + }) +}) + +test('edit', (t) => { + const access = emptyMock + + access([ + 'edit', + '@scoped/another' + ], (err) => { + t.match( + err, + /edit subcommand is not implemented yet/, + 'should throw not implemented yet error' + ) + t.end() + }) +}) + +test('access public on unscoped package', (t) => { + const prefix = t.testdir({ + 'package.json': JSON.stringify({ + name: 'npm-access-public-pkg' + }) + }) + const access = requireInject('../../lib/access.js', { + '../../lib/npm.js': { prefix } + }) + access([ + 'public' + ], (err) => { + t.match( + err, + /Usage: This command is only available for scoped packages/, + 'should throw scoped-restricted error' + ) + t.end() + }) +}) + +test('access public on scoped package', (t) => { + t.plan(4) + const name = '@scoped/npm-access-public-pkg' + const prefix = t.testdir({ + 'package.json': JSON.stringify({ name }) + }) + const access = requireInject('../../lib/access.js', { + 'libnpmaccess': { + public: (pkg, { registry }) => { + t.equal(pkg, name, 'should use pkg name ref') + t.equal( + registry, + 'https://registry.npmjs.org', + 'should forward correct options' + ) + return true + } + }, + '../../lib/npm.js': { + flatOptions: { + registry: 'https://registry.npmjs.org' + }, + prefix + } + }) + access([ + 'public' + ], (err) => { + t.ifError(err, 'npm access') + t.ok('should successfully access public on scoped package') + }) +}) + +test('access public on missing package.json', (t) => { + const prefix = t.testdir({ + 'node_modules': {} + }) + const access = requireInject('../../lib/access.js', { + '../../lib/npm.js': { prefix } + }) + access([ + 'public' + ], (err) => { + t.match( + err, + /no package name passed to command and no package.json found/, + 'should throw no package.json found error' + ) + t.end() + }) +}) + +test('access public on invalid package.json', (t) => { + const prefix = t.testdir({ + 'package.json': '{\n', + 'node_modules': {} + }) + const access = requireInject('../../lib/access.js', { + '../../lib/npm.js': { prefix } + }) + access([ + 'public' + ], (err) => { + t.match( + err, + /JSONParseError/, + 'should throw failed to parse package.json' + ) + t.end() + }) +}) + +test('access restricted on unscoped package', (t) => { + const prefix = t.testdir({ + 'package.json': JSON.stringify({ + name: 'npm-access-restricted-pkg' + }) + }) + const access = requireInject('../../lib/access.js', { + '../../lib/npm.js': { prefix } + }) + access([ + 'restricted' + ], (err) => { + t.match( + err, + /Usage: This command is only available for scoped packages/, + 'should throw scoped-restricted error' + ) + t.end() + }) +}) + +test('access restricted on scoped package', (t) => { + t.plan(4) + const name = '@scoped/npm-access-restricted-pkg' + const prefix = t.testdir({ + 'package.json': JSON.stringify({ name }) + }) + const access = requireInject('../../lib/access.js', { + 'libnpmaccess': { + restricted: (pkg, { registry }) => { + t.equal(pkg, name, 'should use pkg name ref') + t.equal( + registry, + 'https://registry.npmjs.org', + 'should forward correct options' + ) + return true + } + }, + '../../lib/npm.js': { + flatOptions: { + registry: 'https://registry.npmjs.org' + }, + prefix + } + }) + access([ + 'restricted' + ], (err) => { + t.ifError(err, 'npm access') + t.ok('should successfully access restricted on scoped package') + }) +}) + +test('access restricted on missing package.json', (t) => { + const prefix = t.testdir({ + 'node_modules': {} + }) + const access = requireInject('../../lib/access.js', { + '../../lib/npm.js': { prefix } + }) + access([ + 'restricted' + ], (err) => { + t.match( + err, + /no package name passed to command and no package.json found/, + 'should throw no package.json found error' + ) + t.end() + }) +}) + +test('access restricted on invalid package.json', (t) => { + const prefix = t.testdir({ + 'package.json': '{\n', + 'node_modules': {} + }) + const access = requireInject('../../lib/access.js', { + '../../lib/npm.js': { prefix } + }) + access([ + 'restricted' + ], (err) => { + t.match( + err, + /JSONParseError/, + 'should throw failed to parse package.json' + ) + t.end() + }) +}) + +test('access grant read-only', (t) => { + t.plan(5) + const access = requireInject('../../lib/access.js', { + 'libnpmaccess': { + grant: (spec, team, permissions) => { + t.equal(spec, '@scoped/another', 'should use expected spec') + t.equal(team, 'myorg:myteam', 'should use expected team') + t.equal(permissions, 'read-only', 'should forward permissions') + return true + } + }, + '../../lib/npm.js': {} + }) + access([ + 'grant', + 'read-only', + 'myorg:myteam', + '@scoped/another' + ], (err) => { + t.ifError(err, 'npm access') + t.ok('should successfully access grant read-only') + }) +}) + +test('access grant read-write', (t) => { + t.plan(5) + const access = requireInject('../../lib/access.js', { + 'libnpmaccess': { + grant: (spec, team, permissions) => { + t.equal(spec, '@scoped/another', 'should use expected spec') + t.equal(team, 'myorg:myteam', 'should use expected team') + t.equal(permissions, 'read-write', 'should forward permissions') + return true + } + }, + '../../lib/npm.js': {} + }) + access([ + 'grant', + 'read-write', + 'myorg:myteam', + '@scoped/another' + ], (err) => { + t.ifError(err, 'npm access') + t.ok('should successfully access grant read-write') + }) +}) + +test('access grant current cwd', (t) => { + t.plan(5) + const prefix = t.testdir({ + 'package.json': JSON.stringify({ + name: 'yargs' + }) + }) + const access = requireInject('../../lib/access.js', { + 'libnpmaccess': { + grant: (spec, team, permissions) => { + t.equal(spec, 'yargs', 'should use expected spec') + t.equal(team, 'myorg:myteam', 'should use expected team') + t.equal(permissions, 'read-write', 'should forward permissions') + return true + } + }, + '../../lib/npm.js': { prefix } + }) + access([ + 'grant', + 'read-write', + 'myorg:myteam' + ], (err) => { + t.ifError(err, 'npm access') + t.ok('should successfully access grant current cwd') + }) +}) + +test('access grant others', (t) => { + const access = emptyMock + + access([ + 'grant', + 'rerere', + 'myorg:myteam', + '@scoped/another' + ], (err) => { + t.match( + err, + /Usage: First argument must be either `read-only` or `read-write`./, + 'should throw unrecognized argument error' + ) + t.end() + }) +}) + +test('access grant missing team args', (t) => { + const access = emptyMock + + access([ + 'grant', + 'read-only', + undefined, + '@scoped/another' + ], (err) => { + t.match( + err, + /Usage: `` argument is required./, + 'should throw missing argument error' + ) + t.end() + }) +}) + +test('access grant malformed team arg', (t) => { + const access = emptyMock + + access([ + 'grant', + 'read-only', + 'foo', + '@scoped/another' + ], (err) => { + t.match( + err, + /Usage: Second argument used incorrect format.\n/, + 'should throw malformed arg error' + ) + t.end() + }) +}) + +test('access 2fa-required/2fa-not-required', t => { + let pkg + + t.plan(2) + const access = requireInject('../../lib/access.js', { + 'libnpmaccess': { + tfaRequired: (spec) => { + t.equal(spec, '@scope/pkg', 'should use expected spec') + return true + }, + tfaNotRequired: (spec) => { + t.equal(spec, 'unscoped-pkg', 'should use expected spec') + return true + } + }, + '../../lib/npm.js': {} + }) + + access(['2fa-required', '@scope/pkg'], er => { + if (er) + throw er + }) + + access(['2fa-not-required', 'unscoped-pkg'], er => { + if (er) + throw er + }) +}) + +test('access revoke', (t) => { + t.plan(4) + const access = requireInject('../../lib/access.js', { + 'libnpmaccess': { + revoke: (spec, team) => { + t.equal(spec, '@scoped/another', 'should use expected spec') + t.equal(team, 'myorg:myteam', 'should use expected team') + return true + } + }, + '../../lib/npm.js': {} + }) + access([ + 'revoke', + 'myorg:myteam', + '@scoped/another' + ], (err) => { + t.ifError(err, 'npm access') + t.ok('should successfully access revoke') + }) +}) + +test('access revoke missing team args', (t) => { + const access = emptyMock + + access([ + 'revoke', + undefined, + '@scoped/another' + ], (err) => { + t.match( + err, + /Usage: `` argument is required./, + 'should throw missing argument error' + ) + t.end() + }) +}) + +test('access revoke malformed team arg', (t) => { + const access = emptyMock + + access([ + 'revoke', + 'foo', + '@scoped/another' + ], (err) => { + t.match( + err, + /Usage: First argument used incorrect format.\n/, + 'should throw malformed arg error' + ) + t.end() + }) +}) + +test('npm access ls-packages with no team', (t) => { + t.plan(3) + const access = requireInject('../../lib/access.js', { + 'libnpmaccess': { + lsPackages: (entity) => { + t.equal(entity, 'foo', 'should use expected entity') + return {} + } + }, + '../../lib/utils/get-identity.js': () => Promise.resolve('foo'), + '../../lib/utils/output.js': () => null, + '../../lib/npm.js': {} + }) + access([ + 'ls-packages' + ], (err) => { + t.ifError(err, 'npm access') + t.ok('should successfully access ls-packages with no team') + }) +}) + +test('access ls-packages on team', (t) => { + t.plan(3) + const access = requireInject('../../lib/access.js', { + 'libnpmaccess': { + lsPackages: (entity) => { + t.equal(entity, 'myorg:myteam', 'should use expected entity') + return {} + } + }, + '../../lib/utils/output.js': () => null, + '../../lib/npm.js': {} + }) + access([ + 'ls-packages', + 'myorg:myteam' + ], (err) => { + t.ifError(err, 'npm access') + t.ok('should successfully access ls-packages on team') + }) +}) + +test('access ls-collaborators on current', (t) => { + t.plan(3) + const prefix = t.testdir({ + 'package.json': JSON.stringify({ + name: 'yargs' + }) + }) + const access = requireInject('../../lib/access.js', { + 'libnpmaccess': { + lsCollaborators: (spec) => { + t.equal(spec, 'yargs', 'should use expected spec') + return {} + } + }, + '../../lib/utils/output.js': () => null, + '../../lib/npm.js': { prefix } + }) + access([ + 'ls-collaborators' + ], (err) => { + t.ifError(err, 'npm access') + t.ok('should successfully access ls-collaborators on current') + }) +}) + +test('access ls-collaborators on spec', (t) => { + t.plan(3) + const access = requireInject('../../lib/access.js', { + 'libnpmaccess': { + lsCollaborators: (spec) => { + t.equal(spec, 'yargs', 'should use expected spec') + return {} + } + }, + '../../lib/utils/output.js': () => null, + '../../lib/npm.js': {} + }) + access([ + 'ls-collaborators', + 'yargs' + ], (err) => { + t.ifError(err, 'npm access') + t.ok('should successfully access ls-packages with no team') + }) +}) diff --git a/deps/npm/test/lib/adduser.js b/deps/npm/test/lib/adduser.js new file mode 100644 index 00000000000000..4d2233b18ce6c0 --- /dev/null +++ b/deps/npm/test/lib/adduser.js @@ -0,0 +1,188 @@ +const requireInject = require('require-inject') +const { test } = require('tap') +const { getCredentialsByURI, setCredentialsByURI } = + require('@npmcli/config').prototype + +let result = '' + +const _flatOptions = { + authType: 'legacy', + registry: 'https://registry.npmjs.org/', + scope: '' +} + +let failSave = false +let deletedConfig = {} +let setConfig = {} +const authDummy = () => Promise.resolve({ + message: 'success', + newCreds: { + username: 'u', + password: 'p', + email: 'u@npmjs.org', + alwaysAuth: false + } +}) + +const deleteMock = (key, where) => { + deletedConfig = { + ...deletedConfig, + [key]: where + } +} +const adduser = requireInject('../../lib/adduser.js', { + npmlog: { + disableProgress: () => null + }, + '../../lib/npm.js': { + flatOptions: _flatOptions, + config: { + delete: deleteMock, + get (key, where) { + if (!where || where === 'user') { + return _flatOptions[key] + } + }, + getCredentialsByURI, + async save () { + if (failSave) { + throw new Error('error saving user config') + } + }, + set (key, value, where) { + setConfig = { + ...setConfig, + [key]: { + value, + where + } + } + }, + setCredentialsByURI + } + }, + '../../lib/utils/output.js': msg => { result = msg }, + '../../lib/auth/legacy.js': authDummy +}) + +test('simple login', (t) => { + adduser([], (err) => { + t.ifError(err, 'npm adduser') + + t.deepEqual( + deletedConfig, + { + _token: 'user', + _password: 'user', + username: 'user', + email: 'user', + _auth: 'user', + _authtoken: 'user', + _authToken: 'user', + '//registry.npmjs.org/:-authtoken': undefined, + '//registry.npmjs.org/:_authToken': 'user' + }, + 'should delete token in user config' + ) + + t.deepEqual( + setConfig, + { + '//registry.npmjs.org/:_password': { value: 'cA==', where: 'user' }, + '//registry.npmjs.org/:username': { value: 'u', where: 'user' }, + '//registry.npmjs.org/:email': { value: 'u@npmjs.org', where: 'user' }, + '//registry.npmjs.org/:always-auth': { value: false, where: 'user' } + }, + 'should set expected user configs' + ) + + t.equal( + result, + 'success', + 'should output auth success msg' + ) + + deletedConfig = {} + setConfig = {} + result = '' + t.end() + }) +}) + +test('bad auth type', (t) => { + _flatOptions.authType = 'foo' + + adduser([], (err) => { + t.match( + err, + /Error: no such auth module/, + 'should throw bad auth type error' + ) + + _flatOptions.authType = 'legacy' + deletedConfig = {} + setConfig = {} + result = '' + t.end() + }) +}) + +test('scoped login', (t) => { + _flatOptions.scope = '@myscope' + + adduser([], (err) => { + t.ifError(err, 'npm adduser') + + t.deepEqual( + setConfig['@myscope:registry'], + { value: 'https://registry.npmjs.org/', where: 'user' }, + 'should set scoped registry config' + ) + + _flatOptions.scope = '' + deletedConfig = {} + setConfig = {} + result = '' + t.end() + }) +}) + +test('scoped login with valid scoped registry config', (t) => { + _flatOptions['@myscope:registry'] = 'https://diff-registry.npmjs.com/' + _flatOptions.scope = '@myscope' + + adduser([], (err) => { + t.ifError(err, 'npm adduser') + + t.deepEqual( + setConfig['@myscope:registry'], + { value: 'https://diff-registry.npmjs.com/', where: 'user' }, + 'should keep scoped registry config' + ) + + delete _flatOptions['@myscope:registry'] + _flatOptions.scope = '' + deletedConfig = {} + setConfig = {} + result = '' + t.end() + }) +}) + +test('save config failure', (t) => { + failSave = true + + adduser([], (err) => { + t.match( + err, + /error saving user config/, + 'should throw config.save error' + ) + + failSave = false + deletedConfig = {} + setConfig = {} + result = '' + t.end() + }) +}) diff --git a/deps/npm/test/lib/audit.js b/deps/npm/test/lib/audit.js new file mode 100644 index 00000000000000..cbbbcf56fc99d0 --- /dev/null +++ b/deps/npm/test/lib/audit.js @@ -0,0 +1,120 @@ +const { test } = require('tap') +const requireInject = require('require-inject') +const audit = require('../../lib/audit.js') + +test('should audit using Arborist', t => { + let ARB_ARGS = null + let AUDIT_CALLED = false + let REIFY_OUTPUT_CALLED = false + let AUDIT_REPORT_CALLED = false + let OUTPUT_CALLED = false + let ARB_OBJ = null + + const audit = requireInject('../../lib/audit.js', { + '../../lib/npm.js': { + prefix: 'foo', + flatOptions: { + json: false + }, + }, + 'npm-audit-report': () => { + AUDIT_REPORT_CALLED = true + return { + report: 'there are vulnerabilities', + exitCode: 0 + } + }, + '@npmcli/arborist': function (args) { + ARB_ARGS = args + ARB_OBJ = this + this.audit = () => { + AUDIT_CALLED = true + } + }, + '../../lib/utils/reify-output.js': arb => { + if (arb !== ARB_OBJ) { + throw new Error('got wrong object passed to reify-output') + } + REIFY_OUTPUT_CALLED = true + }, + '../../lib/utils/output.js': () => { + OUTPUT_CALLED = true + } + }) + + t.test('audit', t => { + audit([], () => { + t.match(ARB_ARGS, { audit: true, path: 'foo' }) + t.equal(AUDIT_CALLED, true, 'called audit') + t.equal(AUDIT_REPORT_CALLED, true, 'called audit report') + t.equal(OUTPUT_CALLED, true, 'called audit report') + t.end() + }) + }) + + t.test('audit fix', t => { + audit(['fix'], () => { + t.equal(REIFY_OUTPUT_CALLED, true, 'called reify output') + t.end() + }) + }) + + t.end() +}) + +test('should audit - json', t => { + const audit = requireInject('../../lib/audit.js', { + '../../lib/npm.js': { + prefix: 'foo', + flatOptions: { + json: true + }, + }, + 'npm-audit-report': () => ({ + report: 'there are vulnerabilities', + exitCode: 0 + }), + '@npmcli/arborist': function () { + this.audit = () => {} + }, + '../../lib/utils/reify-output.js': () => {}, + '../../lib/utils/output.js': () => {} + }) + + audit([], (err) => { + t.notOk(err, 'no errors') + t.end() + }) +}) + +test('completion', t => { + t.test('fix', t => { + audit.completion({ + conf: { argv: { remain: ['npm', 'audit'] } } + }, (err, res) => { + const subcmd = res.pop() + t.equals('fix', subcmd, 'completes to fix') + t.end() + }) + }) + + t.test('subcommand fix', t => { + audit.completion({ + conf: { argv: { remain: ['npm', 'audit', 'fix'] } } + }, (err) => { + t.notOk(err, 'no errors') + t.end() + }) + }) + + t.test('subcommand not recognized', t => { + audit.completion({ + conf: { argv: { remain: ['npm', 'audit', 'repare'] } } + }, (err) => { + t.ok(err, 'not recognized') + t.end() + }) + }) + + t.end() +}) \ No newline at end of file diff --git a/deps/npm/test/lib/auth/legacy.js b/deps/npm/test/lib/auth/legacy.js new file mode 100644 index 00000000000000..1607641d8390eb --- /dev/null +++ b/deps/npm/test/lib/auth/legacy.js @@ -0,0 +1,427 @@ +const requireInject = require('require-inject') +const { test } = require('tap') + +let log = '' + +const token = '24528a24f240' +const profile = {} +const read = {} +const legacy = requireInject('../../../lib/auth/legacy.js', { + npmlog: { + info: (...msgs) => { + log += msgs.join(' ') + } + }, + 'npm-profile': profile, + '../../../lib/utils/open-url.js': (url, msg, cb) => { + if (url) { + cb() + } else { + cb(Object.assign( + new Error('failed open url'), + { code: 'ERROR' } + )) + } + }, + '../../../lib/utils/read-user-info.js': read +}) + +test('login using username/password with token result', async (t) => { + profile.login = () => { + return { token } + } + + const { + message, + newCreds + } = await legacy({ + creds: { + username: 'u', + password: 'p', + email: 'u@npmjs.org', + alwaysAuth: false + }, + registry: 'https://registry.npmjs.org/', + scope: '' + }) + + t.equal( + message, + 'Logged in as u on https://registry.npmjs.org/.', + 'should have correct message result' + ) + + t.equal( + log, + 'login Authorized user u', + 'should have correct message result' + ) + + t.deepEqual( + newCreds, + { token }, + 'should return expected obj from profile.login' + ) + + log = '' + delete profile.login +}) + +test('login using username/password with user info result', async (t) => { + profile.login = () => { + return null + } + + const { + message, + newCreds + } = await legacy({ + creds: { + username: 'u', + password: 'p', + email: 'u@npmjs.org', + alwaysAuth: false + }, + registry: 'https://registry.npmjs.org/', + scope: '' + }) + + t.equal( + message, + 'Logged in as u on https://registry.npmjs.org/.', + 'should have correct message result' + ) + + t.deepEqual( + newCreds, + { + username: 'u', + password: 'p', + email: 'u@npmjs.org', + alwaysAuth: false + }, + 'should return used credentials' + ) + + log = '' + delete profile.login +}) + +test('login otp requested', async (t) => { + t.plan(5) + + profile.login = () => Promise.reject(Object.assign( + new Error('needs otp'), + { code: 'EOTP' } + )) + profile.loginCouch = (username, password, { otp }) => { + t.equal(username, 'u', 'should use provided username to loginCouch') + t.equal(password, 'p', 'should use provided password to loginCouch') + t.equal(otp, '1234', 'should use provided otp code to loginCouch') + + return { token } + } + read.otp = () => Promise.resolve('1234') + + const { + message, + newCreds + } = await legacy({ + creds: { + username: 'u', + password: 'p', + email: 'u@npmjs.org', + alwaysAuth: false + }, + registry: 'https://registry.npmjs.org/', + scope: '' + }) + + t.equal( + message, + 'Logged in as u on https://registry.npmjs.org/.', + 'should have correct message result' + ) + + t.deepEqual( + newCreds, + { token }, + 'should return token from loginCouch result' + ) + + log = '' + delete profile.login + delete profile.loginCouch + delete read.otp +}) + +test('login missing basic credential info', async (t) => { + profile.login = () => Promise.reject(Object.assign( + new Error('missing info'), + { code: 'ERROR' } + )) + + await t.rejects( + legacy({ + creds: { + username: 'u', + password: 'p' + }, + registry: 'https://registry.npmjs.org/', + scope: '' + }), + { code: 'ERROR' }, + 'should throw server response error' + ) + + log = '' + delete profile.login +}) + +test('create new user when user not found', async (t) => { + t.plan(6) + + profile.login = () => Promise.reject(Object.assign( + new Error('User does not exist'), + { code: 'ERROR' } + )) + profile.adduserCouch = (username, email, password) => { + t.equal(username, 'u', 'should use provided username to adduserCouch') + t.equal(email, 'u@npmjs.org', 'should use provided email to adduserCouch') + t.equal(password, 'p', 'should use provided password to adduserCouch') + + return { token } + } + + const { + message, + newCreds + } = await legacy({ + creds: { + username: 'u', + password: 'p', + email: 'u@npmjs.org', + alwaysAuth: false + }, + registry: 'https://registry.npmjs.org/', + scope: '' + }) + + t.equal( + message, + 'Logged in as u on https://registry.npmjs.org/.', + 'should have correct message result' + ) + + t.equal( + log, + 'login Authorized user u', + 'should have correct message result' + ) + + t.deepEqual( + newCreds, + { token }, + 'should return expected obj from profile.login' + ) + + log = '' + delete profile.adduserCouch + delete profile.login +}) + +test('prompts for user info if required', async (t) => { + t.plan(4) + + profile.login = async (opener, prompt, opts) => { + t.equal(opts.creds.alwaysAuth, true, 'should have refs to creds if any') + await opener('https://registry.npmjs.org/-/v1/login') + const creds = await prompt(opts.creds) + return creds + } + read.username = () => Promise.resolve('foo') + read.password = () => Promise.resolve('pass') + read.email = () => Promise.resolve('foo@npmjs.org') + + const { + message, + newCreds + } = await legacy({ + creds: { + alwaysAuth: true + }, + registry: 'https://registry.npmjs.org/', + scope: '' + }) + + t.equal( + message, + 'Logged in as foo on https://registry.npmjs.org/.', + 'should have correct message result' + ) + + t.equal( + log, + 'login Authorized user foo', + 'should have correct message result' + ) + + t.deepEqual( + newCreds, + { + username: 'foo', + password: 'pass', + email: 'foo@npmjs.org', + alwaysAuth: true + }, + 'should return result from profile.login containing prompt info' + ) + + log = '' + delete profile.login + delete read.username + delete read.password + delete read.email +}) + +test('request otp when creating new user', async (t) => { + t.plan(3) + + profile.login = () => Promise.reject(Object.assign( + new Error('User does not exist'), + { code: 'ERROR' } + )) + profile.adduserCouch = () => Promise.reject(Object.assign( + new Error('needs otp'), + { code: 'EOTP' } + )) + profile.loginCouch = (username, password, { otp }) => { + t.equal(username, 'u', 'should use provided username to loginCouch') + t.equal(password, 'p', 'should use provided password to loginCouch') + t.equal(otp, '1234', 'should now use provided otp code to loginCouch') + + return { token } + } + read.otp = () => Promise.resolve('1234') + + await legacy({ + creds: { + username: 'u', + password: 'p', + email: 'u@npmjs.org', + alwaysAuth: false + }, + registry: 'https://registry.npmjs.org/', + scope: '' + }) + + log = '' + delete profile.adduserCouch + delete profile.login + delete profile.loginCouch + delete read.otp +}) + +test('unknown error during user creation', async (t) => { + profile.login = () => Promise.reject(Object.assign( + new Error('missing info'), + { code: 'ERROR' } + )) + profile.adduserCouch = () => Promise.reject(Object.assign( + new Error('unkown error'), + { code: 'ERROR' } + )) + + await t.rejects( + legacy({ + creds: { + username: 'u', + password: 'p', + email: 'u@npmjs.org', + alwaysAuth: false + }, + registry: 'https://registry.npmjs.org/', + scope: '' + }), + { code: 'ERROR' }, + 'should throw unknown error' + ) + + log = '' + delete profile.adduserCouch + delete profile.login +}) + +test('open url error', async (t) => { + profile.login = async (opener, prompt, opts) => { await opener() } + + await t.rejects( + legacy({ + creds: { + username: 'u', + password: 'p' + }, + registry: 'https://registry.npmjs.org/', + scope: '' + }), + { message: 'failed open url', code: 'ERROR' }, + 'should throw unknown error' + ) + + log = '' + delete profile.login +}) + +test('login no credentials provided', async (t) => { + profile.login = () => ({ token }) + + await legacy({ + creds: { + username: undefined, + password: undefined, + email: undefined, + alwaysAuth: undefined + }, + registry: 'https://registry.npmjs.org/', + scope: '' + }) + + t.equal( + log, + 'login Authorized', + 'should have correct message result' + ) + + log = '' + delete profile.login +}) + +test('scoped login', async (t) => { + profile.login = () => ({ token }) + + const { message } = await legacy({ + creds: { + username: 'u', + password: 'p', + email: 'u@npmjs.org', + alwaysAuth: false + }, + registry: 'https://diff-registry.npmjs.org/', + scope: 'myscope' + }) + + t.equal( + message, + 'Logged in as u to scope myscope on https://diff-registry.npmjs.org/.', + 'should have correct message result' + ) + + t.equal( + log, + 'login Authorized user u', + 'should have correct message result' + ) + + log = '' + delete profile.login +}) diff --git a/deps/npm/test/lib/auth/oauth.js b/deps/npm/test/lib/auth/oauth.js new file mode 100644 index 00000000000000..a8461d235e5e59 --- /dev/null +++ b/deps/npm/test/lib/auth/oauth.js @@ -0,0 +1,29 @@ +const requireInject = require('require-inject') +const { test } = require('tap') + +test('oauth login', (t) => { + t.plan(3) + const oauthOpts = { + creds: {}, + registry: 'https://diff-registry.npmjs.org/', + scope: 'myscope' + } + + const oauth = requireInject('../../../lib/auth/oauth.js', { + '../../../lib/auth/sso.js': (opts) => { + t.equal(opts, oauthOpts, 'should forward opts') + }, + '../../../lib/npm.js': { + config: { + set: (key, value) => { + t.equal(key, 'sso-type', 'should define sso-type') + t.equal(value, 'oauth', 'should set sso-type to oauth') + } + } + } + }) + + oauth(oauthOpts) + + t.end() +}) diff --git a/deps/npm/test/lib/auth/saml.js b/deps/npm/test/lib/auth/saml.js new file mode 100644 index 00000000000000..3e0015bf39be38 --- /dev/null +++ b/deps/npm/test/lib/auth/saml.js @@ -0,0 +1,29 @@ +const requireInject = require('require-inject') +const { test } = require('tap') + +test('saml login', (t) => { + t.plan(3) + const samlOpts = { + creds: {}, + registry: 'https://diff-registry.npmjs.org/', + scope: 'myscope' + } + + const saml = requireInject('../../../lib/auth/saml.js', { + '../../../lib/auth/sso.js': (opts) => { + t.equal(opts, samlOpts, 'should forward opts') + }, + '../../../lib/npm.js': { + config: { + set: (key, value) => { + t.equal(key, 'sso-type', 'should define sso-type') + t.equal(value, 'saml', 'should set sso-type to saml') + } + } + } + }) + + saml(samlOpts) + + t.end() +}) diff --git a/deps/npm/test/lib/auth/sso.js b/deps/npm/test/lib/auth/sso.js new file mode 100644 index 00000000000000..0e04309c82bf79 --- /dev/null +++ b/deps/npm/test/lib/auth/sso.js @@ -0,0 +1,266 @@ +const requireInject = require('require-inject') +const { test } = require('tap') + +let log = '' +let warn = '' + +const _flatOptions = { + ssoType: 'oauth' +} +const token = '24528a24f240' +const SSO_URL = 'https://registry.npmjs.org/{SSO_URL}' +const profile = {} +const npmFetch = {} +const sso = requireInject('../../../lib/auth/sso.js', { + npmlog: { + info: (...msgs) => { + log += msgs.join(' ') + '\n' + }, + warn: (...msgs) => { + warn += msgs.join(' ') + } + }, + 'npm-profile': profile, + 'npm-registry-fetch': npmFetch, + '../../../lib/npm.js': { + flatOptions: _flatOptions + }, + '../../../lib/utils/open-url.js': (url, msg, cb) => { + if (url) { + cb() + } else { + cb(Object.assign( + new Error('failed open url'), + { code: 'ERROR' } + )) + } + }, + '../../../lib/utils/otplease.js': (opts, fn) => { + if (opts) { + return fn({ ...opts, otp: '1234' }) + } else { + throw Object.assign( + new Error('failed retrieving otp'), + { code: 'ERROR' } + ) + } + } +}) + +test('empty login', async (t) => { + _flatOptions.ssoType = false + + await t.rejects( + sso({}), + { message: 'Missing option: sso-type' }, + 'should throw if no sso-type defined in flatOptions' + ) + + t.equal( + warn, + 'deprecated SSO --auth-type is deprecated', + 'should print deprecation warning' + ) + + _flatOptions.ssoType = 'oauth' + log = '' + warn = '' +}) + +test('simple login', async (t) => { + t.plan(6) + + profile.loginCouch = (username, password, opts) => { + t.equal(username, 'npm_oauth_auth_dummy_user', 'should use dummy user') + t.equal(password, 'placeholder', 'should use dummy password') + t.deepEqual( + opts, + { + creds: {}, + otp: '1234', + registry: 'https://registry.npmjs.org/', + scope: '', + ssoType: 'oauth' + }, + 'should use dummy password' + ) + + return { token, sso: SSO_URL } + } + npmFetch.json = () => Promise.resolve({ username: 'foo' }) + + const { + message, + newCreds + } = await sso({ + creds: {}, + registry: 'https://registry.npmjs.org/', + scope: '' + }) + + t.equal( + message, + 'Logged in as foo on https://registry.npmjs.org/.', + 'should have correct message result' + ) + + t.equal( + log, + 'adduser Polling for validated SSO session\nadduser Authorized user foo\n', + 'should have correct logged info msg' + ) + + t.deepEqual( + newCreds, + { token }, + 'should return expected resulting credentials' + ) + + log = '' + warn = '' + delete profile.loginCouch + delete npmFetch.json +}) + +test('polling retry', async (t) => { + t.plan(3) + + profile.loginCouch = () => ({ token, sso: SSO_URL }) + npmFetch.json = () => { + // assert expected values during retry + npmFetch.json = (url, { registry, forceAuth: { token: expected } }) => { + t.equal( + url, + '/-/whoami', + 'should reach for expected endpoint' + ) + + t.equal( + registry, + 'https://registry.npmjs.org/', + 'should use expected registry value' + ) + + t.equal( + expected, + token, + 'should use expected token retrieved from initial loginCouch' + ) + + return Promise.resolve({ username: 'foo' }) + } + + // initial fetch returns retry code + return Promise.reject(Object.assign( + new Error('nothing yet'), + { code: 'E401' } + )) + } + + await sso({ + creds: {}, + registry: 'https://registry.npmjs.org/', + scope: '' + }) + + log = '' + warn = '' + delete profile.loginCouch + delete npmFetch.json +}) + +test('polling error', async (t) => { + profile.loginCouch = () => ({ token, sso: SSO_URL }) + npmFetch.json = () => Promise.reject(Object.assign( + new Error('unknown error'), + { code: 'ERROR' } + )) + + await t.rejects( + sso({ + creds: {}, + registry: 'https://registry.npmjs.org/', + scope: '' + }), + { message: 'unknown error', code: 'ERROR' }, + 'should throw unknown error' + ) + + log = '' + warn = '' + delete profile.loginCouch + delete npmFetch.json +}) + +test('no token retrieved from loginCouch', async (t) => { + profile.loginCouch = () => ({}) + + await t.rejects( + sso({ + creds: {}, + registry: 'https://registry.npmjs.org/', + scope: '' + }), + { message: 'no SSO token returned' }, + 'should throw no SSO token returned error' + ) + + log = '' + warn = '' + delete profile.loginCouch +}) + +test('no sso url retrieved from loginCouch', async (t) => { + profile.loginCouch = () => Promise.resolve({ token }) + + await t.rejects( + sso({ + creds: {}, + registry: 'https://registry.npmjs.org/', + scope: '' + }), + { message: 'no SSO URL returned by services' }, + 'should throw no SSO url returned error' + ) + + log = '' + warn = '' + delete profile.loginCouch +}) + +test('scoped login', async (t) => { + profile.loginCouch = () => ({ token, sso: SSO_URL }) + npmFetch.json = () => Promise.resolve({ username: 'foo' }) + + const { + message, + newCreds + } = await sso({ + creds: {}, + registry: 'https://diff-registry.npmjs.org/', + scope: 'myscope' + }) + + t.equal( + message, + 'Logged in as foo to scope myscope on https://diff-registry.npmjs.org/.', + 'should have correct message result' + ) + + t.equal( + log, + 'adduser Polling for validated SSO session\nadduser Authorized user foo\n', + 'should have correct logged info msg' + ) + + t.deepEqual( + newCreds, + { token }, + 'should return expected resulting credentials' + ) + + log = '' + warn = '' + delete profile.loginCouch + delete npmFetch.json +}) diff --git a/deps/npm/test/lib/bin.js b/deps/npm/test/lib/bin.js new file mode 100644 index 00000000000000..05fc1e21e05d4c --- /dev/null +++ b/deps/npm/test/lib/bin.js @@ -0,0 +1,71 @@ +const { test } = require('tap') +const requireInject = require('require-inject') + +test('bin', (t) => { + t.plan(3) + const dir = '/bin/dir' + + const bin = requireInject('../../lib/bin.js', { + '../../lib/npm.js': { bin: dir, flatOptions: { global: false } }, + '../../lib/utils/output.js': (output) => { + t.equal(output, dir, 'prints the correct directory') + } + }) + + bin([], (err) => { + t.ifError(err, 'npm bin') + t.ok('should have printed directory') + }) +}) + +test('bin -g', (t) => { + t.plan(3) + const consoleError = console.error + t.tearDown(() => { + console.error = consoleError + }) + + console.error = (output) => { + t.fail('should not have printed to console.error') + } + const dir = '/bin/dir' + + const bin = requireInject('../../lib/bin.js', { + '../../lib/npm.js': { bin: dir, flatOptions: { global: true } }, + '../../lib/utils/path.js': [dir], + '../../lib/utils/output.js': (output) => { + t.equal(output, dir, 'prints the correct directory') + } + }) + + bin([], (err) => { + t.ifError(err, 'npm bin') + t.ok('should have printed directory') + }) +}) + +test('bin -g (not in path)', (t) => { + t.plan(4) + const consoleError = console.error + t.tearDown(() => { + console.error = consoleError + }) + + console.error = (output) => { + t.equal(output, '(not in PATH env variable)', 'prints env warning') + } + const dir = '/bin/dir' + + const bin = requireInject('../../lib/bin.js', { + '../../lib/npm.js': { bin: dir, flatOptions: { global: true } }, + '../../lib/utils/path.js': ['/not/my/dir'], + '../../lib/utils/output.js': (output) => { + t.equal(output, dir, 'prints the correct directory') + } + }) + + bin([], (err) => { + t.ifError(err, 'npm bin') + t.ok('should have printed directory') + }) +}) diff --git a/deps/npm/test/lib/birthday.js b/deps/npm/test/lib/birthday.js new file mode 100644 index 00000000000000..35255f97aa34bb --- /dev/null +++ b/deps/npm/test/lib/birthday.js @@ -0,0 +1,84 @@ +const { test } = require('tap') +const requireInject = require('require-inject') + +test('birthday (nope)', (t) => { + t.plan(1) + const B = global[Buffer.from([66, 117, 102, 102, 101, 114])] + const f = B.from([102, 114, 111, 109]) + const D = global[B[f]([68, 97, 116, 101])] + const _6 = B[f]([98, 97, 115, 101, 54, 52]) + '' + const l = B[f]('dG9TdHJpbmc=', _6) + class FD extends D { + [B[f]('Z2V0VVRDTW9udGg=', _6)[l]()] () { + return 7 + } + } + global[B[f]([68, 97, 116, 101])] = FD + const consoleLog = console.log + console.log = () => undefined + t.tearDown(() => { + global[B[f]([68, 97, 116, 101])] = D + console.log = consoleLog + }) + const birthday = requireInject('../../lib/birthday', {}) + birthday([], (err) => { + t.match(err, 'try again', 'not telling you the secret that easily are we?') + }) +}) + +test('birthday (nope again)', (t) => { + t.plan(1) + const B = global[Buffer.from([66, 117, 102, 102, 101, 114])] + const f = B.from([102, 114, 111, 109]) + const D = global[B[f]([68, 97, 116, 101])] + const _6 = B[f]([98, 97, 115, 101, 54, 52]) + '' + const l = B[f]('dG9TdHJpbmc=', _6) + class FD extends D { + [B[f]('Z2V0RnVsbFllYXI=', _6)[l]()] () { + const d = new D() + return d[B[f]('Z2V0RnVsbFllYXI=', _6)[l]()]() + 1 + } + [B[f]('Z2V0VVRDTW9udGg=', _6)[l]()] () { + return 9 + } + } + global[B[f]([68, 97, 116, 101])] = FD + const consoleLog = console.log + console.log = () => undefined + t.tearDown(() => { + global[B[f]([68, 97, 116, 101])] = D + console.log = consoleLog + }) + const birthday = requireInject('../../lib/birthday', {}) + birthday([], (err) => { + t.match(err, 'try again', 'not telling you the secret that easily are we?') + }) +}) + +test('birthday (yup)', (t) => { + t.plan(1) + const B = global[Buffer.from([66, 117, 102, 102, 101, 114])] + const f = B.from([102, 114, 111, 109]) + const D = global[B[f]([68, 97, 116, 101])] + const _6 = B[f]([98, 97, 115, 101, 54, 52]) + '' + const l = B[f]('dG9TdHJpbmc=', _6) + class FD extends D { + [B[f]('Z2V0VVRDTW9udGg=', _6)[l]()] () { + return 8 + } + [B[f]('Z2V0VVRDRGF0ZQ==', _6)[l]()] () { + return 29 + } + } + global[B[f]([68, 97, 116, 101])] = FD + const consoleLog = console.log + console.log = () => undefined + t.tearDown(() => { + global[B[f]([68, 97, 116, 101])] = D + console.log = consoleLog + }) + const birthday = requireInject('../../lib/birthday', {}) + birthday([], (err) => { + t.ifError(err, 'npm birthday') + }) +}) diff --git a/deps/npm/test/lib/bugs.js b/deps/npm/test/lib/bugs.js new file mode 100644 index 00000000000000..79d5089724a50b --- /dev/null +++ b/deps/npm/test/lib/bugs.js @@ -0,0 +1,96 @@ +const t = require('tap') + +const requireInject = require('require-inject') +const pacote = { + manifest: async (spec, options) => { + return spec === 'nobugs' ? { + name: 'nobugs', + version: '1.2.3' + } + : spec === 'bugsurl' ? { + name: 'bugsurl', + version: '1.2.3', + bugs: 'https://bugzilla.localhost/bugsurl' + } + : spec === 'bugsobj' ? { + name: 'bugsobj', + version: '1.2.3', + bugs: { url: 'https://bugzilla.localhost/bugsobj' } + } + : spec === 'bugsobj-nourl' ? { + name: 'bugsobj-nourl', + version: '1.2.3', + bugs: { no: 'url here' } + } + : spec === 'repourl' ? { + name: 'repourl', + version: '1.2.3', + repository: 'https://github.com/foo/repourl' + } + : spec === 'repoobj' ? { + name: 'repoobj', + version: '1.2.3', + repository: { url: 'https://github.com/foo/repoobj' } + } + : spec === '.' ? { + name: 'thispkg', + version: '1.2.3', + bugs: 'https://example.com' + } + : null + } +} + +// keep a tally of which urls got opened +const opened = {} +const openUrl = (url, errMsg, cb) => { + opened[url] = opened[url] || 0 + opened[url]++ + process.nextTick(cb) +} + +const bugs = requireInject('../../lib/bugs.js', { + pacote, + '../../lib/utils/open-url.js': openUrl +}) + +t.test('completion', t => { + bugs.completion({}, (er, res) => { + t.equal(er, null) + t.same(res, []) + t.end() + }) +}) + +t.test('open bugs urls', t => { + const expect = { + nobugs: 'https://www.npmjs.com/package/nobugs', + 'bugsobj-nourl': 'https://www.npmjs.com/package/bugsobj-nourl', + bugsurl: 'https://bugzilla.localhost/bugsurl', + bugsobj: 'https://bugzilla.localhost/bugsobj', + repourl: 'https://github.com/foo/repourl/issues', + repoobj: 'https://github.com/foo/repoobj/issues', + '.': 'https://example.com' + } + const keys = Object.keys(expect) + t.plan(keys.length) + keys.forEach(pkg => { + t.test(pkg, t => { + bugs([pkg], (er) => { + if (er) + throw er + t.equal(opened[expect[pkg]], 1, 'opened expected url', {opened}) + t.end() + }) + }) + }) +}) + +t.test('open default package if none specified', t => { + bugs([], (er) => { + if (er) + throw er + t.equal(opened['https://example.com'], 2, 'opened expected url', {opened}) + t.end() + }) +}) diff --git a/deps/npm/test/lib/ci.js b/deps/npm/test/lib/ci.js new file mode 100644 index 00000000000000..3c642ba930135c --- /dev/null +++ b/deps/npm/test/lib/ci.js @@ -0,0 +1,114 @@ +const fs = require('fs') +const util = require('util') +const readdir = util.promisify(fs.readdir) + +const { test } = require('tap') +const { resolve } = require('path') + +const requireInject = require('require-inject') + +test('should use Arborist', (t) => { + const ci = requireInject('../../lib/ci.js', { + '../../lib/npm.js': { + prefix: 'foo', + flatOptions: { + global: false + } + }, + '@npmcli/arborist': function (args) { + t.ok(args, 'gets options object') + this.loadVirtual = () => { + t.ok(true, 'loadVirtual is called') + return Promise.resolve(true) + } + this.reify = () => { + t.ok(true, 'reify is called') + } + }, + 'util': { + 'inherits': () => {}, + 'promisify': (fn) => fn + }, + 'rimraf': (path) => { + t.ok(path, 'rimraf called with path') + return Promise.resolve(true) + }, + '../../lib/utils/reify-output.js': function (arb) { + t.ok(arb, 'gets arborist tree') + } + }) + ci(null, () => { + t.end() + }) +}) + +test('should throw if package-lock.json or npm-shrinkwrap missing', (t) => { + const testDir = t.testdir({ + 'index.js': 'some contents', + 'package.json': 'some info' + }) + + const ci = requireInject('../../lib/ci.js', { + '../../lib/npm.js': { + prefix: testDir, + flatOptions: { + global: false + } + }, + 'npmlog': { + verbose: () => { + t.ok(true, 'log fn called') + } + }, + }) + ci(null, (err, res) => { + t.ok(err, 'throws error when there is no package-lock') + t.notOk(res) + t.end() + }) +}) + +test('should throw ECIGLOBAL', (t) => { + const ci = requireInject('../../lib/ci.js', { + '../../lib/npm.js': { + prefix: 'foo', + flatOptions: { + global: true + } + } + }) + ci(null, (err, res) => { + t.equals(err.code, 'ECIGLOBAL', 'throws error with global packages') + t.notOk(res) + t.end() + }) +}) + +test('should remove existing node_modules before installing', (t) => { + const testDir = t.testdir({ + 'node_modules': { + 'some-file': 'some contents' + } + }) + + const ci = requireInject('../../lib/ci.js', { + '../../lib/npm.js': { + prefix: testDir, + flatOptions: { + global: false + } + }, + '@npmcli/arborist': function () { + this.loadVirtual = () => Promise.resolve(true) + this.reify = async (options) => { + t.equal(options.save, false, 'npm ci should never save') + // check if node_modules was removed before reifying + const contents = await readdir(testDir) + t.equals(contents.indexOf('node_modules'), -1, 'node_modules does not exist') + t.end() + } + } + }) + + ci(null, () => {}) +}) diff --git a/deps/npm/test/lib/cli.js b/deps/npm/test/lib/cli.js new file mode 100644 index 00000000000000..e90ca69c42c27e --- /dev/null +++ b/deps/npm/test/lib/cli.js @@ -0,0 +1,179 @@ +const t = require('tap') + +let LOAD_ERROR = null +const npmock = { + version: '99.99.99', + load: cb => cb(LOAD_ERROR), + argv: [], + config: { + settings: {}, + get: (k) => npmock.config.settings[k], + set: (k, v) => { npmock.config.settings[k] = v }, + }, + commands: {} +} + +const unsupportedMock = { + checkForBrokenNode: () => {}, + checkForUnsupportedNode: () => {} +} + +let errorHandlerCalled = null +const errorHandlerMock = (...args) => { + errorHandlerCalled = args +} +let errorHandlerExitCalled = null +errorHandlerMock.exit = code => { + errorHandlerExitCalled = code +} + +const logs = [] +const npmlogMock = { + pause: () => logs.push('pause'), + verbose: (...msg) => logs.push(['verbose', ...msg]), + info: (...msg) => logs.push(['info', ...msg]) +} + +const requireInject = require('require-inject') +const cli = requireInject.installGlobally('../../lib/cli.js', { + '../../lib/npm.js': npmock, + '../../lib/utils/unsupported.js': unsupportedMock, + '../../lib/utils/error-handler.js': errorHandlerMock, + npmlog: npmlogMock +}) + +t.test('print the version, and treat npm_g to npm -g', t => { + const { log } = console + const consoleLogs = [] + console.log = (...msg) => consoleLogs.push(msg) + const { argv } = process + const proc = { + argv: ['node', 'npm_g', '-v'], + version: '420.69.lol', + on: () => {} + } + process.argv = proc.argv + npmock.config.settings.version = true + + cli(proc) + + t.strictSame(npmock.argv, []) + t.strictSame(proc.argv, [ 'node', 'npm', '-g', '-v' ]) + t.strictSame(logs, [ + 'pause', + [ 'verbose', 'cli', [ 'node', 'npm', '-g', '-v' ] ], + [ 'info', 'using', 'npm@%s', '99.99.99' ], + [ 'info', 'using', 'node@%s', '420.69.lol' ] + ]) + t.strictSame(consoleLogs, [ [ '99.99.99' ] ]) + t.strictSame(errorHandlerExitCalled, 0) + + delete npmock.config.settings.version + process.argv = argv + console.log = log + npmock.argv.length = 0 + proc.argv.length = 0 + logs.length = 0 + consoleLogs.length = 0 + errorHandlerExitCalled = null + + t.end() +}) + +t.test('calling with --versions calls npm version with no args', t => { + const { log } = console + const consoleLogs = [] + console.log = (...msg) => consoleLogs.push(msg) + const processArgv = process.argv + const proc = { + argv: ['node', 'npm', 'install', 'or', 'whatever', '--versions'], + on: () => {} + } + process.argv = proc.argv + npmock.config.set('versions', true) + + t.teardown(() => { + delete npmock.config.settings.versions + process.argv = processArgv + console.log = log + npmock.argv.length = 0 + proc.argv.length = 0 + logs.length = 0 + consoleLogs.length = 0 + errorHandlerExitCalled = null + delete npmock.commands.version + }) + + npmock.commands.version = (args, cb) => { + t.equal(proc.title, 'npm') + t.strictSame(npmock.argv, []) + t.strictSame(proc.argv, [ 'node', 'npm', 'install', 'or', 'whatever', '--versions' ]) + t.strictSame(logs, [ + 'pause', + [ 'verbose', 'cli', [ 'node', 'npm', 'install', 'or', 'whatever', '--versions' ] ], + [ 'info', 'using', 'npm@%s', '99.99.99' ], + [ 'info', 'using', 'node@%s', undefined ] + ]) + + t.strictSame(consoleLogs, []) + t.strictSame(errorHandlerExitCalled, null) + + t.strictSame(args, []) + t.end() + } + + cli(proc) +}) + +t.test('print usage if -h provided', t => { + const { log } = console + const consoleLogs = [] + console.log = (...msg) => consoleLogs.push(msg) + const proc = { + argv: ['node', 'npm', 'asdf'], + on: () => {} + } + npmock.argv = ['asdf'] + + t.teardown(() => { + console.log = log + npmock.argv.length = 0 + proc.argv.length = 0 + logs.length = 0 + consoleLogs.length = 0 + errorHandlerExitCalled = null + delete npmock.commands.help + }) + + npmock.commands.help = (args, cb) => { + delete npmock.commands.help + t.equal(proc.title, 'npm') + t.strictSame(args, ['asdf']) + t.strictSame(npmock.argv, ['asdf']) + t.strictSame(proc.argv, [ 'node', 'npm', 'asdf' ]) + t.strictSame(logs, [ + 'pause', + [ 'verbose', 'cli', [ 'node', 'npm', 'asdf' ] ], + [ 'info', 'using', 'npm@%s', '99.99.99' ], + [ 'info', 'using', 'node@%s', undefined ] + ]) + t.strictSame(consoleLogs, []) + t.strictSame(errorHandlerExitCalled, null) + t.end() + } + + cli(proc) +}) + +t.test('load error calls error handler', t => { + const er = new Error('poop') + LOAD_ERROR = er + const proc = { + argv: ['node', 'npm', 'asdf'], + on: () => {} + } + cli(proc) + t.strictSame(errorHandlerCalled, [er]) + LOAD_ERROR = null + t.end() +}) diff --git a/deps/npm/test/lib/dedupe.js b/deps/npm/test/lib/dedupe.js new file mode 100644 index 00000000000000..7f55c0e30ead7a --- /dev/null +++ b/deps/npm/test/lib/dedupe.js @@ -0,0 +1,48 @@ +const { test } = require('tap') +const dedupe = require('../../lib/dedupe.js') +const requireInject = require('require-inject') + +test('should remove dupes using Arborist', (t) => { + const dedupe = requireInject('../../lib/dedupe.js', { + '../../lib/npm.js': { + prefix: 'foo', + flatOptions: { + 'dryRun': 'false' + } + }, + '@npmcli/arborist': function (args) { + t.ok(args, 'gets options object') + t.ok(args.path, 'gets path option') + t.ok(args.dryRun, 'gets dryRun from user') + this.dedupe = () => { + t.ok(true, 'dedupe is called') + } + }, + '../../lib/utils/reify-output.js': (arb) => { + t.ok(arb, 'gets arborist tree') + } + }) + dedupe({ dryRun: true }, () => { + t.ok(true, 'callback is called') + t.end() + }) +}) + +test('should remove dupes using Arborist - no arguments', (t) => { + const dedupe = requireInject('../../lib/dedupe.js', { + '../../lib/npm.js': { + prefix: 'foo', + flatOptions: { + 'dryRun': 'true' + } + }, + '@npmcli/arborist': function (args) { + t.ok(args.dryRun, 'gets dryRun from flatOptions') + this.dedupe = () => {} + }, + '../../lib/utils/reify-output.js': () => {} + }) + dedupe(null, () => { + t.end() + }) +}) diff --git a/deps/npm/test/lib/dist-tag.js b/deps/npm/test/lib/dist-tag.js new file mode 100644 index 00000000000000..ad08c2be13f635 --- /dev/null +++ b/deps/npm/test/lib/dist-tag.js @@ -0,0 +1,323 @@ +const requireInject = require('require-inject') +const { test } = require('tap') + +let prefix +let result = '' +let log = '' + +// these declared opts are used in ./utils/read-local-package.js +const _flatOptions = { + global: false, + get prefix () { return prefix } +} + +const routeMap = { + '/-/package/@scoped%2fpkg/dist-tags': { + latest: '1.0.0', + a: '0.0.1', + b: '0.5.0' + }, + '/-/package/@scoped%2fanother/dist-tags': { + latest: '2.0.0', + a: '0.0.2', + b: '0.6.0' + }, + '/-/package/@scoped%2fanother/dist-tags/c': { + latest: '7.7.7', + a: '0.0.2', + b: '0.6.0', + c: '7.7.7' + } +} + +let npmRegistryFetchMock = (url, opts) => { + if (url === '/-/package/foo/dist-tags') { + throw new Error('no package found') + } + + return routeMap[url] +} + +npmRegistryFetchMock.json = async (url, opts) => routeMap[url] + +const logger = (...msgs) => { + for (const msg of [...msgs]) { + log += msg + ' ' + } + log += '\n' +} + +const distTag = requireInject('../../lib/dist-tag.js', { + npmlog: { + error: logger, + info: logger, + verbose: logger, + warn: logger + }, + get 'npm-registry-fetch' () { return npmRegistryFetchMock }, + '../../lib/npm.js': { + flatOptions: _flatOptions, + config: { + get (key) { + return _flatOptions[key] + } + } + }, + '../../lib/utils/output.js': msg => { result = msg } +}) + +test('ls in current package', (t) => { + prefix = t.testdir({ + 'package.json': JSON.stringify({ + name: '@scoped/pkg' + }) + }) + distTag(['ls'], (err) => { + t.ifError(err, 'npm dist-tags ls') + t.matchSnapshot( + result, + 'should list available tags for current package' + ) + result = '' + log = '' + t.end() + }) +}) + +test('no args in current package', (t) => { + prefix = t.testdir({ + 'package.json': JSON.stringify({ + name: '@scoped/pkg' + }) + }) + distTag([], (err) => { + t.ifError(err, 'npm dist-tags ls') + t.matchSnapshot( + result, + 'should default to listing available tags for current package' + ) + result = '' + log = '' + t.end() + }) +}) + +test('borked cmd usage', (t) => { + prefix = t.testdir({}) + distTag(['borked', '@scoped/pkg'], (err) => { + t.matchSnapshot(err, 'should show usage error') + result = '' + log = '' + t.end() + }) +}) + +test('ls on named package', (t) => { + prefix = t.testdir({}) + distTag(['ls', '@scoped/another'], (err) => { + t.ifError(err, 'npm dist-tags ls') + t.matchSnapshot( + result, + 'should list tags for the specified package' + ) + result = '' + log = '' + t.end() + }) +}) + +test('ls on missing package', (t) => { + prefix = t.testdir({}) + distTag(['ls', 'foo'], (err) => { + t.matchSnapshot( + log, + 'should log no dist-tag found msg' + ) + t.matchSnapshot( + err, + 'should throw error message' + ) + result = '' + log = '' + t.end() + }) +}) + +test('ls on missing name in current package', (t) => { + prefix = t.testdir({ + 'package.json': JSON.stringify({ + version: '1.0.0' + }) + }) + distTag(['ls'], (err) => { + t.matchSnapshot( + err, + 'should throw usage error message' + ) + result = '' + log = '' + t.end() + }) +}) + +test('only named package arg', (t) => { + prefix = t.testdir({}) + distTag(['@scoped/another'], (err) => { + t.ifError(err, 'npm dist-tags ls') + t.matchSnapshot( + result, + 'should default to listing tags for the specified package' + ) + result = '' + log = '' + t.end() + }) +}) + +test('add new tag', (t) => { + const _nrf = npmRegistryFetchMock + npmRegistryFetchMock = async (url, opts) => { + t.equal(opts.method, 'PUT', 'should trigger request to add new tag') + t.equal(opts.body, '7.7.7', 'should point to expected version') + } + prefix = t.testdir({}) + distTag(['add', '@scoped/another@7.7.7', 'c'], (err) => { + t.ifError(err, 'npm dist-tags add') + t.matchSnapshot( + result, + 'should return success msg' + ) + result = '' + log = '' + npmRegistryFetchMock = _nrf + t.end() + }) +}) + +test('add using valid semver range as name', (t) => { + prefix = t.testdir({}) + distTag(['add', '@scoped/another@7.7.7', '1.0.0'], (err) => { + t.match( + err, + /Error: Tag name must not be a valid SemVer range: 1.0.0/, + 'should exit with semver range error' + ) + t.matchSnapshot( + log, + 'should return success msg' + ) + result = '' + log = '' + t.end() + }) +}) + +test('add missing args', (t) => { + prefix = t.testdir({}) + distTag(['add', '@scoped/another@7.7.7'], (err) => { + t.matchSnapshot(err, 'should exit usage error message') + result = '' + log = '' + t.end() + }) +}) + +test('add missing pkg name', (t) => { + prefix = t.testdir({}) + distTag(['add', null], (err) => { + t.matchSnapshot(err, 'should exit usage error message') + result = '' + log = '' + t.end() + }) +}) + +test('set existing version', (t) => { + prefix = t.testdir({}) + distTag(['set', '@scoped/another@0.6.0', 'b'], (err) => { + t.ifError(err, 'npm dist-tags set') + t.matchSnapshot( + log, + 'should log warn msg' + ) + log = '' + t.end() + }) +}) + +test('remove existing tag', (t) => { + const _nrf = npmRegistryFetchMock + npmRegistryFetchMock = async (url, opts) => { + t.equal(opts.method, 'DELETE', 'should trigger request to remove tag') + } + prefix = t.testdir({}) + distTag(['rm', '@scoped/another', 'c'], (err) => { + t.ifError(err, 'npm dist-tags rm') + t.matchSnapshot(log, 'should log remove info') + t.matchSnapshot(result, 'should return success msg') + result = '' + log = '' + npmRegistryFetchMock = _nrf + t.end() + }) +}) + +test('remove non-existing tag', (t) => { + prefix = t.testdir({}) + distTag(['rm', '@scoped/another', 'nonexistent'], (err) => { + t.match( + err, + /Error: nonexistent is not a dist-tag on @scoped\/another/, + 'should exit with error' + ) + t.matchSnapshot(log, 'should log error msg') + result = '' + log = '' + t.end() + }) +}) + +test('remove missing pkg name', (t) => { + prefix = t.testdir({}) + distTag(['rm', null], (err) => { + t.matchSnapshot(err, 'should exit usage error message') + result = '' + log = '' + t.end() + }) +}) + +test('completion', t => { + const { completion } = distTag + t.plan(3) + + completion({ + conf: { + argv: { + remain: ['npm', 'dist-tag'] + } + } + }, (err, res) => { + t.ifError(err, 'npm dist-tags completion') + + t.strictSame( + res, + [ + 'add', + 'rm', + 'ls' + ], + 'should list npm dist-tag commands for completion' + ) + }) + + completion({ + conf: { + argv: { + remain: ['npm', 'dist-tag', 'foobar'] + } + } + }, (err) => { + t.notOk(err, 'should ignore any unkown name') + }) +}) diff --git a/deps/npm/test/lib/docs.js b/deps/npm/test/lib/docs.js new file mode 100644 index 00000000000000..48ba9a3b57f442 --- /dev/null +++ b/deps/npm/test/lib/docs.js @@ -0,0 +1,85 @@ +const t = require('tap') + +const requireInject = require('require-inject') +const pacote = { + manifest: async (spec, options) => { + return spec === 'nodocs' ? { + name: 'nodocs', + version: '1.2.3' + } + : spec === 'docsurl' ? { + name: 'docsurl', + version: '1.2.3', + homepage: 'https://bugzilla.localhost/docsurl' + } + : spec === 'repourl' ? { + name: 'repourl', + version: '1.2.3', + repository: 'https://github.com/foo/repourl' + } + : spec === 'repoobj' ? { + name: 'repoobj', + version: '1.2.3', + repository: { url: 'https://github.com/foo/repoobj' } + } + : spec === '.' ? { + name: 'thispkg', + version: '1.2.3', + homepage: 'https://example.com' + } + : null + } +} + +// keep a tally of which urls got opened +const opened = {} +const openUrl = (url, errMsg, cb) => { + opened[url] = opened[url] || 0 + opened[url]++ + process.nextTick(cb) +} + +const docs = requireInject('../../lib/docs.js', { + pacote, + '../../lib/utils/open-url.js': openUrl +}) + +t.test('completion', t => { + docs.completion({}, (er, res) => { + t.equal(er, null) + t.same(res, []) + t.end() + }) +}) + +t.test('open docs urls', t => { + const expect = { + nodocs: 'https://www.npmjs.com/package/nodocs', + docsurl: 'https://bugzilla.localhost/docsurl', + repourl: 'https://github.com/foo/repourl#readme', + repoobj: 'https://github.com/foo/repoobj#readme', + '.': 'https://example.com' + } + const keys = Object.keys(expect) + t.plan(keys.length) + keys.forEach(pkg => { + t.test(pkg, t => { + docs([pkg], (er) => { + if (er) + throw er + const url = expect[pkg] + t.equal(opened[url], 1, url, {opened}) + t.end() + }) + }) + }) +}) + +t.test('open default package if none specified', t => { + docs([], (er) => { + if (er) + throw er + t.equal(opened['https://example.com'], 2, 'opened expected url', {opened}) + t.end() + }) +}) diff --git a/deps/npm/test/lib/exec.js b/deps/npm/test/lib/exec.js new file mode 100644 index 00000000000000..c93517315ce891 --- /dev/null +++ b/deps/npm/test/lib/exec.js @@ -0,0 +1,688 @@ +const t = require('tap') +const requireInject = require('require-inject') +const { resolve, delimiter } = require('path') + +const ARB_CTOR = [] +const ARB_ACTUAL_TREE = {} +const ARB_REIFY = [] +class Arborist { + constructor (options) { + ARB_CTOR.push(options) + this.path = options.path + } + async loadActual () { + return ARB_ACTUAL_TREE[this.path] + } + async reify (options) { + ARB_REIFY.push(options) + } +} + +let PROGRESS_ENABLED = true +const npm = { + flatOptions: { + yes: true, + call: '', + package: [], + legacyPeerDeps: false + }, + localPrefix: 'local-prefix', + config: { + get: k => { + if (k !== 'cache') { + throw new Error('unexpected config get') + } + return 'cache-dir' + } + }, + log: { + disableProgress: () => { + PROGRESS_ENABLED = false + }, + enableProgress: () => { + PROGRESS_ENABLED = true + } + } +} + +const RUN_SCRIPTS = [] +const runScript = async opt => { + RUN_SCRIPTS.push(opt) + if (PROGRESS_ENABLED) { + throw new Error('progress not disabled during run script!') + } +} + +const MANIFESTS = {} +const pacote = { + manifest: async (spec, options) => { + return MANIFESTS[spec] + } +} + +const MKDIRPS = [] +const mkdirp = async path => MKDIRPS.push(path) + +let READ_RESULT = '' +let READ_ERROR = null +const READ = [] +const read = (options, cb) => { + READ.push(options) + process.nextTick(() => cb(READ_ERROR, READ_RESULT)) +} + +const exec = requireInject('../../lib/exec.js', { + '@npmcli/arborist': Arborist, + '@npmcli/run-script': runScript, + '../../lib/npm.js': npm, + pacote, + read, + 'mkdirp-infer-owner': mkdirp +}) + +t.afterEach(cb => { + MKDIRPS.length = 0 + ARB_CTOR.length = 0 + ARB_REIFY.length = 0 + RUN_SCRIPTS.length = 0 + READ.length = 0 + READ_RESULT = '' + READ_ERROR = null + npm.flatOptions.legacyPeerDeps = false + npm.flatOptions.package = [] + npm.flatOptions.call = '' + cb() +}) + +t.test('npm exec foo, already present locally', async t => { + const path = t.testdir() + npm.localPrefix = path + ARB_ACTUAL_TREE[path] = { + children: new Map([['foo', { name: 'foo', version: '1.2.3' }]]) + } + MANIFESTS.foo = { + name: 'foo', + version: '1.2.3', + bin: { + foo: 'foo' + }, + _from: 'foo@' + } + await exec(['foo'], er => { + if (er) { + throw er + } + }) + t.strictSame(MKDIRPS, [], 'no need to make any dirs') + t.match(ARB_CTOR, [ { package: ['foo'], path } ]) + t.strictSame(ARB_REIFY, [], 'no need to reify anything') + t.equal(PROGRESS_ENABLED, true, 'progress re-enabled') + t.match(RUN_SCRIPTS, [{ + pkg: { scripts: { npx: 'foo' } }, + banner: false, + path: process.cwd(), + stdioString: true, + event: 'npx', + env: { PATH: process.env.PATH }, + stdio: 'inherit' + }]) +}) + +t.test('npm exec foo, not present locally or in central loc', async t => { + const path = t.testdir() + const installDir = resolve('cache-dir/_npx/f7fbba6e0636f890') + npm.localPrefix = path + ARB_ACTUAL_TREE[path] = { + children: new Map() + } + ARB_ACTUAL_TREE[installDir] = { + children: new Map() + } + MANIFESTS.foo = { + name: 'foo', + version: '1.2.3', + bin: { + foo: 'foo' + }, + _from: 'foo@' + } + await exec(['foo'], er => { + if (er) { + throw er + } + }) + t.strictSame(MKDIRPS, [installDir], 'need to make install dir') + t.match(ARB_CTOR, [ { package: ['foo'], path } ]) + t.match(ARB_REIFY, [{add: ['foo@'], legacyPeerDeps: false}], 'need to install foo@') + t.equal(PROGRESS_ENABLED, true, 'progress re-enabled') + const PATH = `${resolve(installDir, 'node_modules', '.bin')}${delimiter}${process.env.PATH}` + t.match(RUN_SCRIPTS, [{ + pkg: { scripts: { npx: 'foo' } }, + banner: false, + path: process.cwd(), + stdioString: true, + event: 'npx', + env: { PATH }, + stdio: 'inherit' + }]) +}) + +t.test('npm exec foo, not present locally but in central loc', async t => { + const path = t.testdir() + const installDir = resolve('cache-dir/_npx/f7fbba6e0636f890') + npm.localPrefix = path + ARB_ACTUAL_TREE[path] = { + children: new Map() + } + ARB_ACTUAL_TREE[installDir] = { + children: new Map([['foo', { name: 'foo', version: '1.2.3' }]]) + } + MANIFESTS.foo = { + name: 'foo', + version: '1.2.3', + bin: { + foo: 'foo' + }, + _from: 'foo@' + } + await exec(['foo'], er => { + if (er) { + throw er + } + }) + t.strictSame(MKDIRPS, [installDir], 'need to make install dir') + t.match(ARB_CTOR, [ { package: ['foo'], path } ]) + t.match(ARB_REIFY, [], 'no need to install again, already there') + t.equal(PROGRESS_ENABLED, true, 'progress re-enabled') + const PATH = `${resolve(installDir, 'node_modules', '.bin')}${delimiter}${process.env.PATH}` + t.match(RUN_SCRIPTS, [{ + pkg: { scripts: { npx: 'foo' } }, + banner: false, + path: process.cwd(), + stdioString: true, + event: 'npx', + env: { PATH }, + stdio: 'inherit' + }]) +}) + +t.test('npm exec foo, present locally but wrong version', async t => { + const path = t.testdir() + const installDir = resolve('cache-dir/_npx/2badf4630f1cfaad') + npm.localPrefix = path + ARB_ACTUAL_TREE[path] = { + children: new Map() + } + ARB_ACTUAL_TREE[installDir] = { + children: new Map([['foo', { name: 'foo', version: '1.2.3' }]]) + } + MANIFESTS['foo@2.x'] = { + name: 'foo', + version: '2.3.4', + bin: { + foo: 'foo' + }, + _from: 'foo@2.x' + } + await exec(['foo@2.x'], er => { + if (er) { + throw er + } + }) + t.strictSame(MKDIRPS, [installDir], 'need to make install dir') + t.match(ARB_CTOR, [ { package: ['foo'], path } ]) + t.match(ARB_REIFY, [{ add: ['foo@2.x'], legacyPeerDeps: false }], 'need to add foo@2.x') + t.equal(PROGRESS_ENABLED, true, 'progress re-enabled') + const PATH = `${resolve(installDir, 'node_modules', '.bin')}${delimiter}${process.env.PATH}` + t.match(RUN_SCRIPTS, [{ + pkg: { scripts: { npx: 'foo' } }, + banner: false, + path: process.cwd(), + stdioString: true, + event: 'npx', + env: { PATH }, + stdio: 'inherit' + }]) +}) + +t.test('npm exec --package=foo bar', async t => { + const path = t.testdir() + npm.localPrefix = path + ARB_ACTUAL_TREE[path] = { + children: new Map([['foo', { name: 'foo', version: '1.2.3' }]]) + } + MANIFESTS.foo = { + name: 'foo', + version: '1.2.3', + bin: { + foo: 'foo' + }, + _from: 'foo@' + } + npm.flatOptions.package = ['foo'] + await exec(['bar'], er => { + if (er) { + throw er + } + }) + t.strictSame(MKDIRPS, [], 'no need to make any dirs') + t.match(ARB_CTOR, [ { package: ['foo'], path } ]) + t.strictSame(ARB_REIFY, [], 'no need to reify anything') + t.equal(PROGRESS_ENABLED, true, 'progress re-enabled') + t.match(RUN_SCRIPTS, [{ + pkg: { scripts: { npx: 'bar' } }, + banner: false, + path: process.cwd(), + stdioString: true, + event: 'npx', + env: { PATH: process.env.PATH }, + stdio: 'inherit' + }]) +}) + +t.test('npm exec @foo/bar -- --some=arg, locally installed', async t => { + const foobarManifest = { + name: '@foo/bar', + version: '1.2.3', + bin: { + foo: 'foo', + bar: 'bar' + } + } + const path = t.testdir({ + node_modules: { + '@foo/bar': { + 'package.json': JSON.stringify(foobarManifest) + } + } + }) + npm.localPrefix = path + ARB_ACTUAL_TREE[path] = { + children: new Map([['@foo/bar', { name: '@foo/bar', version: '1.2.3' }]]) + } + MANIFESTS['@foo/bar'] = foobarManifest + await exec(['@foo/bar', '--some=arg'], er => { + if (er) { + throw er + } + }) + t.strictSame(MKDIRPS, [], 'no need to make any dirs') + t.match(ARB_CTOR, [ { package: ['@foo/bar'], path } ]) + t.strictSame(ARB_REIFY, [], 'no need to reify anything') + t.equal(PROGRESS_ENABLED, true, 'progress re-enabled') + t.match(RUN_SCRIPTS, [{ + pkg: { scripts: { npx: 'bar' } }, + banner: false, + path: process.cwd(), + stdioString: true, + event: 'npx', + env: { PATH: process.env.PATH }, + stdio: 'inherit' + }]) +}) + +t.test('run command with 2 packages, need install, verify sort', t => { + // test both directions, should use same install dir both times + // also test the read() call here, verify that the prompts match + const cases = [['foo', 'bar'], ['bar', 'foo']] + t.plan(cases.length) + for (const packages of cases) { + t.test(packages.join(', '), async t => { + npm.flatOptions.package = packages + const add = packages.map(p => `${p}@`).sort((a, b) => a.localeCompare(b)) + const path = t.testdir() + const installDir = resolve('cache-dir/_npx/07de77790e5f40f2') + npm.localPrefix = path + ARB_ACTUAL_TREE[path] = { + children: new Map() + } + ARB_ACTUAL_TREE[installDir] = { + children: new Map() + } + MANIFESTS.foo = { + name: 'foo', + version: '1.2.3', + bin: { + foo: 'foo' + }, + _from: 'foo@' + } + MANIFESTS.bar = { + name: 'bar', + version: '1.2.3', + bin: { + bar: 'bar' + }, + _from: 'bar@' + } + await exec(['foobar'], er => { + if (er) { + throw er + } + }) + t.strictSame(MKDIRPS, [installDir], 'need to make install dir') + t.match(ARB_CTOR, [ { package: packages, path } ]) + t.match(ARB_REIFY, [{add, legacyPeerDeps: false}], 'need to install both packages') + t.equal(PROGRESS_ENABLED, true, 'progress re-enabled') + const PATH = `${resolve(installDir, 'node_modules', '.bin')}${delimiter}${process.env.PATH}` + t.match(RUN_SCRIPTS, [{ + pkg: { scripts: { npx: 'foobar' } }, + banner: false, + path: process.cwd(), + stdioString: true, + event: 'npx', + env: { PATH }, + stdio: 'inherit' + }]) + }) + } +}) + +t.test('npm exec foo, no bin in package', t => { + const path = t.testdir() + npm.localPrefix = path + ARB_ACTUAL_TREE[path] = { + children: new Map([['foo', { name: 'foo', version: '1.2.3' }]]) + } + MANIFESTS.foo = { + name: 'foo', + version: '1.2.3', + _from: 'foo@', + _id: 'foo@1.2.3' + } + return t.rejects(exec(['foo'], er => { + if (er) { + throw er + } + }), { + message: 'could not determine executable to run', + pkgid: 'foo@1.2.3' + }) +}) + +t.test('npm exec foo, many bins in package, none named foo', t => { + const path = t.testdir() + npm.localPrefix = path + ARB_ACTUAL_TREE[path] = { + children: new Map([['foo', { name: 'foo', version: '1.2.3' }]]) + } + MANIFESTS.foo = { + name: 'foo', + version: '1.2.3', + bin: { + bar: 'bar', + baz: 'baz' + }, + _from: 'foo@', + _id: 'foo@1.2.3' + } + return t.rejects(exec(['foo'], er => { + if (er) { + throw er + } + }), { + message: 'could not determine executable to run', + pkgid: 'foo@1.2.3' + }) +}) + +t.test('npm exec -p foo -c "ls -laF"', async t => { + const path = t.testdir() + npm.localPrefix = path + npm.flatOptions.package = ['foo'] + npm.flatOptions.call = 'ls -laF' + ARB_ACTUAL_TREE[path] = { + children: new Map([['foo', { name: 'foo', version: '1.2.3' }]]) + } + MANIFESTS.foo = { + name: 'foo', + version: '1.2.3', + _from: 'foo@' + } + await exec([], er => { + if (er) { + throw er + } + }) + t.strictSame(MKDIRPS, [], 'no need to make any dirs') + t.match(ARB_CTOR, [ { package: ['foo'], path } ]) + t.strictSame(ARB_REIFY, [], 'no need to reify anything') + t.equal(PROGRESS_ENABLED, true, 'progress re-enabled') + t.match(RUN_SCRIPTS, [{ + pkg: { scripts: { npx: 'ls -laF' } }, + banner: false, + path: process.cwd(), + stdioString: true, + event: 'npx', + env: { PATH: process.env.PATH }, + stdio: 'inherit' + }]) +}) + +t.test('positional args and --call together is an error', t => { + npm.flatOptions.call = 'true' + return exec(['foo'], er => t.equal(er, exec.usage)) +}) + +t.test('prompt when installs are needed if not already present', async t => { + const packages = ['foo', 'bar'] + READ_RESULT = 'yolo' + + npm.flatOptions.package = packages + npm.flatOptions.yes = undefined + + const add = packages.map(p => `${p}@`).sort((a, b) => a.localeCompare(b)) + const path = t.testdir() + const installDir = resolve('cache-dir/_npx/07de77790e5f40f2') + npm.localPrefix = path + ARB_ACTUAL_TREE[path] = { + children: new Map() + } + ARB_ACTUAL_TREE[installDir] = { + children: new Map() + } + MANIFESTS.foo = { + name: 'foo', + version: '1.2.3', + bin: { + foo: 'foo' + }, + _from: 'foo@' + } + MANIFESTS.bar = { + name: 'bar', + version: '1.2.3', + bin: { + bar: 'bar' + }, + _from: 'bar@' + } + await exec(['foobar'], er => { + if (er) { + throw er + } + }) + t.strictSame(MKDIRPS, [installDir], 'need to make install dir') + t.match(ARB_CTOR, [ { package: packages, path } ]) + t.match(ARB_REIFY, [{add, legacyPeerDeps: false}], 'need to install both packages') + t.equal(PROGRESS_ENABLED, true, 'progress re-enabled') + const PATH = `${resolve(installDir, 'node_modules', '.bin')}${delimiter}${process.env.PATH}` + t.match(RUN_SCRIPTS, [{ + pkg: { scripts: { npx: 'foobar' } }, + banner: false, + path: process.cwd(), + stdioString: true, + event: 'npx', + env: { PATH }, + stdio: 'inherit' + }]) + t.strictSame(READ, [{ + prompt: 'Need to install the following packages:\n bar\n foo\nOk to proceed? ', + default: 'y' + }]) +}) + +t.test('abort if prompt rejected', async t => { + const packages = ['foo', 'bar'] + READ_RESULT = 'no, why would I want such a thing??' + + npm.flatOptions.package = packages + npm.flatOptions.yes = undefined + + const add = packages.map(p => `${p}@`).sort((a, b) => a.localeCompare(b)) + const path = t.testdir() + const installDir = resolve('cache-dir/_npx/07de77790e5f40f2') + npm.localPrefix = path + ARB_ACTUAL_TREE[path] = { + children: new Map() + } + ARB_ACTUAL_TREE[installDir] = { + children: new Map() + } + MANIFESTS.foo = { + name: 'foo', + version: '1.2.3', + bin: { + foo: 'foo' + }, + _from: 'foo@' + } + MANIFESTS.bar = { + name: 'bar', + version: '1.2.3', + bin: { + bar: 'bar' + }, + _from: 'bar@' + } + await exec(['foobar'], er => { + t.equal(er, 'canceled', 'should be canceled') + }) + t.strictSame(MKDIRPS, [installDir], 'need to make install dir') + t.match(ARB_CTOR, [ { package: packages, path } ]) + t.strictSame(ARB_REIFY, [], 'no install performed') + t.equal(PROGRESS_ENABLED, true, 'progress re-enabled') + t.strictSame(RUN_SCRIPTS, []) + t.strictSame(READ, [{ + prompt: 'Need to install the following packages:\n bar\n foo\nOk to proceed? ', + default: 'y' + }]) +}) + +t.test('abort if prompt false', async t => { + const packages = ['foo', 'bar'] + READ_ERROR = 'canceled' + + npm.flatOptions.package = packages + npm.flatOptions.yes = undefined + + const add = packages.map(p => `${p}@`).sort((a, b) => a.localeCompare(b)) + const path = t.testdir() + const installDir = resolve('cache-dir/_npx/07de77790e5f40f2') + npm.localPrefix = path + ARB_ACTUAL_TREE[path] = { + children: new Map() + } + ARB_ACTUAL_TREE[installDir] = { + children: new Map() + } + MANIFESTS.foo = { + name: 'foo', + version: '1.2.3', + bin: { + foo: 'foo' + }, + _from: 'foo@' + } + MANIFESTS.bar = { + name: 'bar', + version: '1.2.3', + bin: { + bar: 'bar' + }, + _from: 'bar@' + } + await exec(['foobar'], er => { + t.equal(er, 'canceled', 'should be canceled') + }) + t.strictSame(MKDIRPS, [installDir], 'need to make install dir') + t.match(ARB_CTOR, [ { package: packages, path } ]) + t.strictSame(ARB_REIFY, [], 'no install performed') + t.equal(PROGRESS_ENABLED, true, 'progress re-enabled') + t.strictSame(RUN_SCRIPTS, []) + t.strictSame(READ, [{ + prompt: 'Need to install the following packages:\n bar\n foo\nOk to proceed? ', + default: 'y' + }]) +}) + +t.test('abort if -n provided', async t => { + const packages = ['foo', 'bar'] + + npm.flatOptions.package = packages + npm.flatOptions.yes = false + + const add = packages.map(p => `${p}@`).sort((a, b) => a.localeCompare(b)) + const path = t.testdir() + const installDir = resolve('cache-dir/_npx/07de77790e5f40f2') + npm.localPrefix = path + ARB_ACTUAL_TREE[path] = { + children: new Map() + } + ARB_ACTUAL_TREE[installDir] = { + children: new Map() + } + MANIFESTS.foo = { + name: 'foo', + version: '1.2.3', + bin: { + foo: 'foo' + }, + _from: 'foo@' + } + MANIFESTS.bar = { + name: 'bar', + version: '1.2.3', + bin: { + bar: 'bar' + }, + _from: 'bar@' + } + await exec(['foobar'], er => { + t.equal(er, 'canceled', 'should be canceled') + }) + t.strictSame(MKDIRPS, [installDir], 'need to make install dir') + t.match(ARB_CTOR, [ { package: packages, path } ]) + t.strictSame(ARB_REIFY, [], 'no install performed') + t.equal(PROGRESS_ENABLED, true, 'progress re-enabled') + t.strictSame(RUN_SCRIPTS, []) + t.strictSame(READ, []) +}) + +t.test('forward legacyPeerDeps opt', async t => { + const path = t.testdir() + const installDir = resolve('cache-dir/_npx/f7fbba6e0636f890') + npm.localPrefix = path + ARB_ACTUAL_TREE[path] = { + children: new Map() + } + ARB_ACTUAL_TREE[installDir] = { + children: new Map() + } + MANIFESTS.foo = { + name: 'foo', + version: '1.2.3', + bin: { + foo: 'foo' + }, + _from: 'foo@' + } + npm.flatOptions.yes = true + npm.flatOptions.legacyPeerDeps = true + await exec(['foo'], er => { + if (er) { + throw er + } + }) + t.match(ARB_REIFY, [{add: ['foo@'], legacyPeerDeps: true}], 'need to install foo@ using legacyPeerDeps opt') +}) diff --git a/deps/npm/test/lib/explain.js b/deps/npm/test/lib/explain.js new file mode 100644 index 00000000000000..e3a67b6513c4a5 --- /dev/null +++ b/deps/npm/test/lib/explain.js @@ -0,0 +1,176 @@ +const t = require('tap') +const requireInject = require('require-inject') +const npm = { + prefix: null, + color: true, + flatOptions: {} +} +const { resolve } = require('path') + +const OUTPUT = [] + +const explain = requireInject('../../lib/explain.js', { + '../../lib/npm.js': npm, + + '../../lib/utils/output.js': (...args) => { + OUTPUT.push(args) + }, + + // keep the snapshots pared down a bit, since this has its own tests. + '../../lib/utils/explain-dep.js': { + explainNode: (expl, depth, color) => { + return `${expl.name}@${expl.version} depth=${depth} color=${color}` + } + } +}) + +t.test('no args throws usage', async t => { + t.plan(1) + try { + await explain([], er => { + throw er + }) + } catch (er) { + t.equal(er, explain.usage) + } +}) + +t.test('no match throws not found', async t => { + npm.prefix = t.testdir() + t.plan(1) + try { + await explain(['foo@1.2.3', 'node_modules/baz'], er => { + throw er + }) + } catch (er) { + t.equal(er, 'No dependencies found matching foo@1.2.3, node_modules/baz') + } +}) + +t.test('invalid package name throws not found', async t => { + npm.prefix = t.testdir() + t.plan(1) + const badName = ' not a valid package name ' + try { + await explain([`${badName}@1.2.3`], er => { + throw er + }) + } catch (er) { + t.equal(er, `No dependencies found matching ${badName}@1.2.3`) + } +}) + +t.test('explain some nodes', async t => { + npm.prefix = t.testdir({ + node_modules: { + foo: { + 'package.json': JSON.stringify({ + name: 'foo', + version: '1.2.3', + dependencies: { + bar: '*' + } + }) + }, + bar: { + 'package.json': JSON.stringify({ + name: 'bar', + version: '1.2.3' + }) + }, + baz: { + 'package.json': JSON.stringify({ + name: 'baz', + version: '1.2.3', + dependencies: { + foo: '*', + bar: '2' + } + }), + node_modules: { + bar: { + 'package.json': JSON.stringify({ + name: 'bar', + version: '2.3.4' + }) + }, + extra: { + 'package.json': JSON.stringify({ + name: 'extra', + version: '99.9999.999999', + description: 'extraneous package' + }) + } + } + } + }, + 'package.json': JSON.stringify({ + dependencies: { + baz: '1' + } + }) + }) + + // works with either a full actual path or the location + const p = 'node_modules/foo' + for (const path of [p, resolve(npm.prefix, p)]) { + await explain([path], er => { + if (er) { + throw er + } + }) + t.strictSame(OUTPUT, [['foo@1.2.3 depth=Infinity color=true']]) + OUTPUT.length = 0 + } + + // finds all nodes by name + await explain(['bar'], er => { + if (er) { + throw er + } + }) + t.strictSame(OUTPUT, [[ + 'bar@1.2.3 depth=Infinity color=true\n\n' + + 'bar@2.3.4 depth=Infinity color=true' + ]]) + OUTPUT.length = 0 + + // finds only nodes that match the spec + await explain(['bar@1'], er => { + if (er) { + throw er + } + }) + t.strictSame(OUTPUT, [['bar@1.2.3 depth=Infinity color=true']]) + OUTPUT.length = 0 + + // finds extraneous nodes + await explain(['extra'], er => { + if (er) { + throw er + } + }) + t.strictSame(OUTPUT, [['extra@99.9999.999999 depth=Infinity color=true']]) + OUTPUT.length = 0 + + npm.flatOptions.json = true + await explain(['node_modules/foo'], er => { + if (er) { + throw er + } + }) + t.match(JSON.parse(OUTPUT[0][0]), [{ + name: 'foo', + version: '1.2.3', + dependents: Array + }]) + OUTPUT.length = 0 + npm.flatOptions.json = false + + t.test('report if no nodes found', async t => { + t.plan(1) + await explain(['asdf/foo/bar', 'quux@1.x'], er => { + t.equal(er, 'No dependencies found matching asdf/foo/bar, quux@1.x') + }) + }) +}) diff --git a/deps/npm/test/lib/explore.js b/deps/npm/test/lib/explore.js new file mode 100644 index 00000000000000..03ad230489d17d --- /dev/null +++ b/deps/npm/test/lib/explore.js @@ -0,0 +1,282 @@ +const t = require('tap') +const requireInject = require('require-inject') + +let STAT_ERROR = null +let STAT_CALLED = '' +const mockStat = (path, cb) => { + STAT_CALLED = path + cb(STAT_ERROR, {}) +} + +let SPAWN_ERROR = null +let SPAWN_EXIT_CODE = 0 +let SPAWN_SHELL_EXEC = null +let SPAWN_SHELL_ARGS = null +const mockSpawn = (sh, shellArgs, opts) => { + if (sh !== 'shell-command') { + throw new Error('got wrong shell command') + } + if (SPAWN_ERROR) { + return Promise.reject(SPAWN_ERROR) + } + SPAWN_SHELL_EXEC = sh + SPAWN_SHELL_ARGS = shellArgs + return Promise.resolve({ code: SPAWN_EXIT_CODE }) +} + +const output = [] +let ERROR_HANDLER_CALLED = null +const getExplore = windows => requireInject('../../lib/explore.js', { + '../../lib/utils/is-windows.js': windows, + '../../lib/utils/escape-arg.js': requireInject('../../lib/utils/escape-arg.js', { + '../../lib/utils/is-windows.js': windows + }), + path: require('path')[windows ? 'win32' : 'posix'], + '../../lib/utils/escape-exec-path.js': requireInject('../../lib/utils/escape-arg.js', { + '../../lib/utils/is-windows.js': windows + }), + '../../lib/utils/error-handler.js': er => { + ERROR_HANDLER_CALLED = er + }, + fs: { + stat: mockStat + }, + '../../lib/npm.js': { + dir: windows ? 'c:\\npm\\dir' : '/npm/dir', + flatOptions: { + shell: 'shell-command' + } + }, + '@npmcli/promise-spawn': mockSpawn, + '../../lib/utils/output.js': out => { + output.push(out) + } +}) + +const windowsExplore = getExplore(true) +const posixExplore = getExplore(false) + +t.test('basic interactive', t => { + t.afterEach((cb) => { + output.length = 0 + cb() + }) + + t.test('windows', t => windowsExplore(['pkg'], er => { + if (er) { + throw er + } + t.strictSame({ + ERROR_HANDLER_CALLED, + STAT_CALLED, + SPAWN_SHELL_EXEC, + SPAWN_SHELL_ARGS + }, { + ERROR_HANDLER_CALLED: null, + STAT_CALLED: 'c:\\npm\\dir\\pkg', + SPAWN_SHELL_EXEC: 'shell-command', + SPAWN_SHELL_ARGS: [] + }) + t.strictSame(output, [ + "\nExploring c:\\npm\\dir\\pkg\nType 'exit' or ^D when finished\n" + ]) + })) + + t.test('posix', t => posixExplore(['pkg'], er => { + if (er) { + throw er + } + t.strictSame({ + ERROR_HANDLER_CALLED, + STAT_CALLED, + SPAWN_SHELL_EXEC, + SPAWN_SHELL_ARGS + }, { + ERROR_HANDLER_CALLED: null, + STAT_CALLED: '/npm/dir/pkg', + SPAWN_SHELL_EXEC: 'shell-command', + SPAWN_SHELL_ARGS: [] + }) + t.strictSame(output, [ + "\nExploring /npm/dir/pkg\nType 'exit' or ^D when finished\n" + ]) + })) + + t.end() +}) + +t.test('interactive tracks exit code', t => { + const { exitCode } = process + t.beforeEach((cb) => { + process.exitCode = exitCode + SPAWN_EXIT_CODE = 99 + cb() + }) + t.afterEach((cb) => { + SPAWN_EXIT_CODE = 0 + output.length = 0 + process.exitCode = exitCode + cb() + }) + + t.test('windows', t => windowsExplore(['pkg'], er => { + if (er) { + throw er + } + t.strictSame({ + ERROR_HANDLER_CALLED, + STAT_CALLED, + SPAWN_SHELL_EXEC, + SPAWN_SHELL_ARGS + }, { + ERROR_HANDLER_CALLED: null, + STAT_CALLED: 'c:\\npm\\dir\\pkg', + SPAWN_SHELL_EXEC: 'shell-command', + SPAWN_SHELL_ARGS: [] + }) + t.strictSame(output, [ + "\nExploring c:\\npm\\dir\\pkg\nType 'exit' or ^D when finished\n" + ]) + t.equal(process.exitCode, 99) + })) + + t.test('posix', t => posixExplore(['pkg'], er => { + if (er) { + throw er + } + t.strictSame({ + ERROR_HANDLER_CALLED, + STAT_CALLED, + SPAWN_SHELL_EXEC, + SPAWN_SHELL_ARGS + }, { + ERROR_HANDLER_CALLED: null, + STAT_CALLED: '/npm/dir/pkg', + SPAWN_SHELL_EXEC: 'shell-command', + SPAWN_SHELL_ARGS: [] + }) + t.strictSame(output, [ + "\nExploring /npm/dir/pkg\nType 'exit' or ^D when finished\n" + ]) + t.equal(process.exitCode, 99) + })) + + t.test('posix spawn fail', t => { + t.teardown(() => { + SPAWN_ERROR = null + }) + SPAWN_ERROR = Object.assign(new Error('glorb'), { + code: 33 + }) + return posixExplore(['pkg'], er => { + if (er) { + throw er + } + t.strictSame(output, [ + "\nExploring /npm/dir/pkg\nType 'exit' or ^D when finished\n" + ]) + t.equal(process.exitCode, 33) + }) + }) + + t.end() +}) + +t.test('basic non-interactive', t => { + t.afterEach((cb) => { + output.length = 0 + cb() + }) + + t.test('windows', t => windowsExplore(['pkg', 'ls'], er => { + if (er) { + throw er + } + t.strictSame({ + ERROR_HANDLER_CALLED, + STAT_CALLED, + SPAWN_SHELL_EXEC, + SPAWN_SHELL_ARGS + }, { + ERROR_HANDLER_CALLED: null, + STAT_CALLED: 'c:\\npm\\dir\\pkg', + SPAWN_SHELL_EXEC: 'shell-command', + SPAWN_SHELL_ARGS: [ + '/d', + '/s', + '/c', + '"ls"', + ] + }) + t.strictSame(output, []) + })) + + t.test('posix', t => posixExplore(['pkg', 'ls'], er => { + if (er) { + throw er + } + t.strictSame({ + ERROR_HANDLER_CALLED, + STAT_CALLED, + SPAWN_SHELL_EXEC, + SPAWN_SHELL_ARGS + }, { + ERROR_HANDLER_CALLED: null, + STAT_CALLED: '/npm/dir/pkg', + SPAWN_SHELL_EXEC: 'shell-command', + SPAWN_SHELL_ARGS: ['-c', 'ls'] + }) + t.strictSame(output, []) + })) + + t.end() +}) + +t.test('usage if no pkg provided', t => { + t.teardown(() => { + output.length = 0 + ERROR_HANDLER_CALLED = null + }) + t.plan(1) + posixExplore([], er => { + if (er) { + throw er + } + t.strictSame({ + ERROR_HANDLER_CALLED: null, + STAT_CALLED, + SPAWN_SHELL_EXEC, + SPAWN_SHELL_ARGS + }, { + ERROR_HANDLER_CALLED: null, + STAT_CALLED: '/npm/dir/pkg', + SPAWN_SHELL_EXEC: 'shell-command', + SPAWN_SHELL_ARGS: ['-c', 'ls'] + }) + }).catch(er => t.equal(er, 'npm explore [ -- ]')) +}) + +t.test('pkg not installed', t => { + STAT_ERROR = new Error('plurple') + t.plan(1) + + posixExplore(['pkg', 'ls'], er => { + if (er) { + throw er + } + t.strictSame({ + ERROR_HANDLER_CALLED, + STAT_CALLED, + SPAWN_SHELL_EXEC, + SPAWN_SHELL_ARGS + }, { + ERROR_HANDLER_CALLED: null, + STAT_CALLED: '/npm/dir/pkg', + SPAWN_SHELL_EXEC: 'shell-command', + SPAWN_SHELL_ARGS: ['-c', 'ls'] + }) + t.strictSame(output, []) + }).catch(er => { + t.match(er, { message: `It doesn't look like pkg is installed.` }) + }) +}) diff --git a/deps/npm/test/lib/find-dupes.js b/deps/npm/test/lib/find-dupes.js new file mode 100644 index 00000000000000..cb320559fc6fc8 --- /dev/null +++ b/deps/npm/test/lib/find-dupes.js @@ -0,0 +1,16 @@ +const { test } = require('tap') +const findDupes = require('../../lib/find-dupes.js') +const requireInject = require('require-inject') + +test('should run dedupe in dryRun mode', (t) => { + const findDupes = requireInject('../../lib/find-dupes.js', { + '../../lib/dedupe.js': function (args, cb) { + t.ok(args.dryRun, 'dryRun is true') + cb() + } + }) + findDupes(null, () => { + t.ok(true, 'callback is called') + t.end() + }) +}) diff --git a/deps/npm/test/lib/fund.js b/deps/npm/test/lib/fund.js new file mode 100644 index 00000000000000..fc6a63aa17752a --- /dev/null +++ b/deps/npm/test/lib/fund.js @@ -0,0 +1,845 @@ +'use strict' + +const { test } = require('tap') +const requireInject = require('require-inject') + +const version = '1.0.0' +const funding = { + type: 'individual', + url: 'http://example.com/donate' +} + +const maintainerOwnsAllDeps = { + 'package.json': JSON.stringify({ + name: 'maintainer-owns-all-deps', + version, + funding, + dependencies: { + 'dep-foo': '*', + 'dep-bar': '*' + } + }), + node_modules: { + 'dep-foo': { + 'package.json': JSON.stringify({ + name: 'dep-foo', + version, + funding, + dependencies: { + 'dep-sub-foo': '*' + } + }), + node_modules: { + 'dep-sub-foo': { + 'package.json': JSON.stringify({ + name: 'dep-sub-foo', + version, + funding + }) + } + } + }, + 'dep-bar': { + 'package.json': JSON.stringify({ + name: 'dep-bar', + version, + funding + }) + } + } +} + +const nestedNoFundingPackages = { + 'package.json': JSON.stringify({ + name: 'nested-no-funding-packages', + version, + dependencies: { + foo: '*' + }, + devDependencies: { + lorem: '*' + } + }), + node_modules: { + foo: { + 'package.json': JSON.stringify({ + name: 'foo', + version, + dependencies: { + bar: '*' + } + }), + node_modules: { + bar: { + 'package.json': JSON.stringify({ + name: 'bar', + version, + funding + }), + node_modules: { + 'sub-bar': { + 'package.json': JSON.stringify({ + name: 'sub-bar', + version, + funding: 'https://example.com/sponsor' + }) + } + } + } + } + }, + lorem: { + 'package.json': JSON.stringify({ + name: 'lorem', + version, + funding: { + url: 'https://example.com/lorem' + } + }) + } + } +} + +const nestedMultipleFundingPackages = { + 'package.json': JSON.stringify({ + name: 'nested-multiple-funding-packages', + version, + funding: [ + 'https://one.example.com', + 'https://two.example.com' + ], + dependencies: { + foo: '*' + }, + devDependencies: { + bar: '*' + } + }), + node_modules: { + foo: { + 'package.json': JSON.stringify({ + name: 'foo', + version, + funding: [ + 'http://example.com', + { url: 'http://sponsors.example.com/me' }, + 'http://collective.example.com' + ] + }) + }, + bar: { + 'package.json': JSON.stringify({ + name: 'bar', + version, + funding: [ + 'http://collective.example.com', + { url: 'http://sponsors.example.com/you' } + ] + }) + } + } +} + +const conflictingFundingPackages = { + 'package.json': JSON.stringify({ + name: 'conflicting-funding-packages', + version, + dependencies: { + foo: '1.0.0' + }, + devDependencies: { + bar: '1.0.0' + } + }), + node_modules: { + foo: { + 'package.json': JSON.stringify({ + name: 'foo', + version: '1.0.0', + funding: 'http://example.com/1' + }) + }, + bar: { + node_modules: { + foo: { + 'package.json': JSON.stringify({ + name: 'foo', + version: '2.0.0', + funding: 'http://example.com/2' + }) + } + }, + 'package.json': JSON.stringify({ + name: 'bar', + version: '1.0.0', + dependencies: { + foo: '2.0.0' + } + }) + } + } +} + +let result = '' +let printUrl = '' +const _flatOptions = { + color: false, + json: false, + global: false, + prefix: undefined, + unicode: false, + which: undefined +} +const openUrl = (url, msg, cb) => { + if (url === 'http://npmjs.org') { + cb(new Error('ERROR')) + return + } + if (_flatOptions.json) { + printUrl = JSON.stringify({ + title: msg, + url: url + }) + } else { + printUrl = `${msg}:\n ${url}` + } + cb() +} +const fund = requireInject('../../lib/fund.js', { + '../../lib/npm.js': { + flatOptions: _flatOptions, + get prefix () { return _flatOptions.prefix } + }, + '../../lib/utils/open-url.js': openUrl, + '../../lib/utils/output.js': msg => { result += msg + '\n' }, + pacote: { + manifest: (arg) => arg.name === 'ntl' + ? Promise.resolve({ + funding: 'http://example.com/pacote' + }) + : Promise.reject(new Error('ERROR')) + } +}) + +test('fund with no package containing funding', t => { + _flatOptions.prefix = t.testdir({ + 'package.json': JSON.stringify({ + name: 'no-funding-package', + version: '0.0.0' + }) + }) + + fund([], (err) => { + t.ifError(err, 'should not error out') + t.matchSnapshot(result, 'should print empty funding info') + result = '' + t.end() + }) +}) + +test('fund in which same maintainer owns all its deps', t => { + _flatOptions.prefix = t.testdir(maintainerOwnsAllDeps) + + fund([], (err) => { + t.ifError(err, 'should not error out') + t.matchSnapshot(result, 'should print stack packages together') + result = '' + t.end() + }) +}) + +test('fund in which same maintainer owns all its deps, using --json option', t => { + _flatOptions.json = true + _flatOptions.prefix = t.testdir(maintainerOwnsAllDeps) + + fund([], (err) => { + t.ifError(err, 'should not error out') + t.deepEqual( + JSON.parse(result), + { + length: 3, + name: 'maintainer-owns-all-deps', + version: '1.0.0', + funding: { type: 'individual', url: 'http://example.com/donate' }, + dependencies: { + 'dep-bar': { + version: '1.0.0', + funding: { type: 'individual', url: 'http://example.com/donate' } + }, + 'dep-foo': { + version: '1.0.0', + funding: { type: 'individual', url: 'http://example.com/donate' }, + dependencies: { + 'dep-sub-foo': { + version: '1.0.0', + funding: { type: 'individual', url: 'http://example.com/donate' } + } + } + } + } + }, + 'should print stack packages together' + ) + + result = '' + _flatOptions.json = false + t.end() + }) +}) + +test('fund containing multi-level nested deps with no funding', t => { + _flatOptions.prefix = t.testdir(nestedNoFundingPackages) + + fund([], (err) => { + t.ifError(err, 'should not error out') + t.matchSnapshot( + result, + 'should omit dependencies with no funding declared' + ) + + result = '' + t.end() + }) +}) + +test('fund containing multi-level nested deps with no funding, using --json option', t => { + _flatOptions.prefix = t.testdir(nestedNoFundingPackages) + _flatOptions.json = true + + fund([], (err) => { + t.ifError(err, 'should not error out') + t.deepEqual( + JSON.parse(result), + { + length: 2, + name: 'nested-no-funding-packages', + version: '1.0.0', + dependencies: { + lorem: { + version: '1.0.0', + funding: { url: 'https://example.com/lorem' } + }, + bar: { + version: '1.0.0', + funding: { type: 'individual', url: 'http://example.com/donate' } + } + } + }, + 'should omit dependencies with no funding declared in json output' + ) + + result = '' + _flatOptions.json = false + t.end() + }) +}) + +test('fund containing multi-level nested deps with no funding, using --json option', t => { + _flatOptions.prefix = t.testdir(nestedMultipleFundingPackages) + _flatOptions.json = true + + fund([], (err) => { + t.ifError(err, 'should not error out') + t.deepEqual( + JSON.parse(result), + { + length: 2, + name: 'nested-multiple-funding-packages', + version: '1.0.0', + funding: [ + { + url: 'https://one.example.com' + }, + { + url: 'https://two.example.com' + } + ], + dependencies: { + bar: { + version: '1.0.0', + funding: [ + { + url: 'http://collective.example.com' + }, + { + url: 'http://sponsors.example.com/you' + } + ] + }, + foo: { + version: '1.0.0', + funding: [ + { + url: 'http://example.com' + }, + { + url: 'http://sponsors.example.com/me' + }, + { + url: 'http://collective.example.com' + } + ] + } + } + }, + 'should list multiple funding entries in json output' + ) + + result = '' + _flatOptions.json = false + t.end() + }) +}) + +test('fund does not support global', t => { + _flatOptions.prefix = t.testdir({}) + _flatOptions.global = true + + fund([], (err) => { + t.match(err.code, 'EFUNDGLOBAL', 'should throw EFUNDGLOBAL error') + + result = '' + _flatOptions.global = false + t.end() + }) +}) + +test('fund using package argument', t => { + _flatOptions.prefix = t.testdir(maintainerOwnsAllDeps) + + fund(['.'], (err) => { + t.ifError(err, 'should not error out') + t.matchSnapshot(printUrl, 'should open funding url') + + printUrl = '' + t.end() + }) +}) + +test('fund does not support global, using --json option', t => { + _flatOptions.prefix = t.testdir({}) + _flatOptions.global = true + _flatOptions.json = true + + fund([], (err) => { + t.equal(err.code, 'EFUNDGLOBAL', 'should use EFUNDGLOBAL error code') + t.equal( + err.message, + '`npm fund` does not support global packages', + 'should use expected error msg' + ) + + _flatOptions.global = false + _flatOptions.json = false + t.end() + }) +}) + +test('fund using string shorthand', t => { + _flatOptions.prefix = t.testdir({ + 'package.json': JSON.stringify({ + name: 'funding-string-shorthand', + version: '0.0.0', + funding: 'https://example.com/sponsor' + }) + }) + + fund(['.'], (err) => { + t.ifError(err, 'should not error out') + t.matchSnapshot(printUrl, 'should open string-only url') + + printUrl = '' + t.end() + }) +}) + +test('fund using nested packages with multiple sources', t => { + _flatOptions.prefix = t.testdir(nestedMultipleFundingPackages) + + fund(['.'], (err) => { + t.ifError(err, 'should not error out') + t.matchSnapshot(result, 'should prompt with all available URLs') + + result = '' + t.end() + }) +}) + +test('fund using symlink ref', t => { + _flatOptions.prefix = t.testdir({ + 'package.json': JSON.stringify({ + name: 'using-symlink-ref', + version: '1.0.0' + }), + a: { + 'package.json': JSON.stringify({ + name: 'a', + version: '1.0.0', + funding: 'http://example.com/a' + }) + }, + node_modules: { + a: t.fixture('symlink', '../a') + } + }) + + // using symlinked ref + fund(['./node_modules/a'], (err) => { + t.ifError(err, 'should not error out') + t.match( + printUrl, + 'http://example.com/a', + 'should retrieve funding url from symlink' + ) + + printUrl = '' + + // using target ref + fund(['./a'], (err) => { + t.ifError(err, 'should not error out') + + t.match( + printUrl, + 'http://example.com/a', + 'should retrieve funding url from symlink target' + ) + + printUrl = '' + result = '' + t.end() + }) + }) +}) + +test('fund using data from actual tree', t => { + _flatOptions.prefix = t.testdir({ + 'package.json': JSON.stringify({ + name: 'using-actual-tree', + version: '1.0.0' + }), + node_modules: { + a: { + 'package.json': JSON.stringify({ + name: 'a', + version: '1.0.0', + funding: 'http://example.com/a' + }) + }, + b: { + 'package.json': JSON.stringify({ + name: 'a', + version: '1.0.0', + funding: 'http://example.com/b' + }), + node_modules: { + a: { + 'package.json': JSON.stringify({ + name: 'a', + version: '1.0.1', + funding: 'http://example.com/_AAA' + }) + } + } + } + } + }) + + // using symlinked ref + fund(['a'], (err) => { + t.ifError(err, 'should not error out') + t.match( + printUrl, + 'http://example.com/_AAA', + 'should retrieve fund info from actual tree, using greatest version found' + ) + + printUrl = '' + t.end() + }) +}) + +test('fund using nested packages with multiple sources, with a source number', t => { + _flatOptions.prefix = t.testdir(nestedMultipleFundingPackages) + _flatOptions.which = '1' + + fund(['.'], (err) => { + t.ifError(err, 'should not error out') + t.matchSnapshot(printUrl, 'should open the numbered URL') + + _flatOptions.which = undefined + printUrl = '' + t.end() + }) +}) + +test('fund using pkg name while having conflicting versions', t => { + _flatOptions.prefix = t.testdir(conflictingFundingPackages) + _flatOptions.which = '1' + + fund(['foo'], (err) => { + t.ifError(err, 'should not error out') + t.matchSnapshot(printUrl, 'should open greatest version') + + printUrl = '' + t.end() + }) +}) + +test('fund using package argument with no browser, using --json option', t => { + _flatOptions.prefix = t.testdir(maintainerOwnsAllDeps) + _flatOptions.json = true + + fund(['.'], (err) => { + t.ifError(err, 'should not error out') + t.deepEqual( + JSON.parse(printUrl), + { + title: 'individual funding available at the following URL', + url: 'http://example.com/donate' + }, + 'should open funding url using json output' + ) + + _flatOptions.json = false + printUrl = '' + t.end() + }) +}) + +test('fund using package info fetch from registry', t => { + _flatOptions.prefix = t.testdir({}) + + fund(['ntl'], (err) => { + t.ifError(err, 'should not error out') + t.match( + printUrl, + /http:\/\/example.com\/pacote/, + 'should open funding url that was loaded from registry manifest' + ) + + printUrl = '' + t.end() + }) +}) + +test('fund tries to use package info fetch from registry but registry has nothing', t => { + _flatOptions.prefix = t.testdir({}) + + fund(['foo'], (err) => { + t.equal(err.code, 'ENOFUND', 'should have ENOFUND error code') + t.equal( + err.message, + 'No valid funding method available for: foo', + 'should have no valid funding message' + ) + + printUrl = '' + t.end() + }) +}) + +test('fund but target module has no funding info', t => { + _flatOptions.prefix = t.testdir(nestedNoFundingPackages) + + fund(['foo'], (err) => { + t.equal(err.code, 'ENOFUND', 'should have ENOFUND error code') + t.equal( + err.message, + 'No valid funding method available for: foo', + 'should have no valid funding message' + ) + + result = '' + t.end() + }) +}) + +test('fund using bad which value', t => { + _flatOptions.prefix = t.testdir(nestedMultipleFundingPackages) + _flatOptions.which = 3 + + fund(['bar'], (err) => { + t.equal(err.code, 'EFUNDNUMBER', 'should have EFUNDNUMBER error code') + t.equal( + err.message, + '`npm fund [<@scope>/] [--which=fundingSourceNumber]` must be given a positive integer', + 'should have bad which option error message' + ) + + _flatOptions.which = undefined + result = '' + t.end() + }) +}) + +test('fund pkg missing version number', t => { + _flatOptions.prefix = t.testdir({ + 'package.json': JSON.stringify({ + name: 'foo', + funding: 'http://example.com/foo' + }) + }) + + fund([], (err) => { + t.ifError(err, 'should not error out') + t.matchSnapshot(result, 'should print name only') + result = '' + t.end() + }) +}) + +test('fund a package throws on openUrl', t => { + _flatOptions.prefix = t.testdir({ + 'package.json': JSON.stringify({ + name: 'foo', + version: '1.0.0', + funding: 'http://npmjs.org' + }) + }) + + fund(['.'], (err) => { + t.equal(err.message, 'ERROR', 'should throw unknown error') + result = '' + t.end() + }) +}) + +test('fund a package with type and multiple sources', t => { + _flatOptions.prefix = t.testdir({ + 'package.json': JSON.stringify({ + name: 'foo', + funding: [ + { + type: 'Foo', + url: 'http://example.com/foo' + }, + { + type: 'Lorem', + url: 'http://example.com/foo-lorem' + } + ] + }) + }) + + fund(['.'], (err) => { + t.ifError(err, 'should not error out') + t.matchSnapshot(result, 'should print prompt select message') + + result = '' + t.end() + }) +}) + +test('fund colors', t => { + _flatOptions.prefix = t.testdir({ + 'package.json': JSON.stringify({ + name: 'test-fund-colors', + version: '1.0.0', + dependencies: { + a: '^1.0.0', + b: '^1.0.0', + c: '^1.0.0' + } + }), + node_modules: { + a: { + 'package.json': JSON.stringify({ + name: 'a', + version: '1.0.0', + funding: 'http://example.com/a' + }) + }, + b: { + 'package.json': JSON.stringify({ + name: 'b', + version: '1.0.0', + funding: 'http://example.com/b', + dependencies: { + d: '^1.0.0', + e: '^1.0.0' + } + }) + }, + c: { + 'package.json': JSON.stringify({ + name: 'c', + version: '1.0.0', + funding: 'http://example.com/b' + }) + }, + d: { + 'package.json': JSON.stringify({ + name: 'd', + version: '1.0.0', + funding: 'http://example.com/d' + }) + }, + e: { + 'package.json': JSON.stringify({ + name: 'e', + version: '1.0.0', + funding: 'http://example.com/e' + }) + } + } + }) + _flatOptions.color = true + + fund([], (err) => { + t.ifError(err, 'should not error out') + t.matchSnapshot(result, 'should print output with color info') + + result = '' + _flatOptions.color = false + t.end() + }) +}) + +test('sub dep with fund info and a parent with no funding info', t => { + _flatOptions.prefix = t.testdir({ + 'package.json': JSON.stringify({ + name: 'test-multiple-funding-sources', + version: '1.0.0', + dependencies: { + a: '^1.0.0', + b: '^1.0.0' + } + }), + node_modules: { + a: { + 'package.json': JSON.stringify({ + name: 'a', + version: '1.0.0', + dependencies: { + c: '^1.0.0' + } + }) + }, + b: { + 'package.json': JSON.stringify({ + name: 'b', + version: '1.0.0', + funding: 'http://example.com/b' + }) + }, + c: { + 'package.json': JSON.stringify({ + name: 'c', + version: '1.0.0', + funding: [ + 'http://example.com/c', + 'http://example.com/c-other' + ] + }) + } + } + }) + + fund([], (err) => { + t.ifError(err, 'should not error out') + t.matchSnapshot(result, 'should nest sub dep as child of root') + + result = '' + t.end() + }) +}) diff --git a/deps/npm/test/lib/get.js b/deps/npm/test/lib/get.js new file mode 100644 index 00000000000000..5f2f29bd922ae1 --- /dev/null +++ b/deps/npm/test/lib/get.js @@ -0,0 +1,18 @@ +const { test } = require('tap') +const requireInject = require('require-inject') + +test('should retrieve values from npm.commands.config', (t) => { + const get = requireInject('../../lib/get.js', { + '../../lib/npm.js': { + commands: { + config: ([action, arg]) => { + t.equal(action, 'get', 'should use config get action') + t.equal(arg, 'foo', 'should use expected key') + t.end() + } + } + } + }) + + get(['foo']) +}) diff --git a/deps/npm/test/lib/install.js b/deps/npm/test/lib/install.js new file mode 100644 index 00000000000000..1650dcb8c0a32e --- /dev/null +++ b/deps/npm/test/lib/install.js @@ -0,0 +1,200 @@ +const { test } = require('tap') + +const install = require('../../lib/install.js') +const requireInject = require('require-inject') + +test('should install using Arborist', (t) => { + const SCRIPTS = [] + let ARB_ARGS = null + let REIFY_CALLED = false + let ARB_OBJ = null + + const install = requireInject('../../lib/install.js', { + '../../lib/npm.js': { + globalDir: 'path/to/node_modules/', + prefix: 'foo', + flatOptions: { + global: false + }, + config: { + get: () => true + } + }, + '@npmcli/run-script': ({ event }) => { + SCRIPTS.push(event) + }, + 'npmlog': { + warn: () => {} + }, + '@npmcli/arborist': function (args) { + ARB_ARGS = args + ARB_OBJ = this + this.reify = () => { + REIFY_CALLED = true + } + }, + '../../lib/utils/reify-output.js': arb => { + if (arb !== ARB_OBJ) { + throw new Error('got wrong object passed to reify-output') + } + } + }) + + t.test('with args', t => { + install(['fizzbuzz'], () => { + t.match(ARB_ARGS, { global: false, path: 'foo' }) + t.equal(REIFY_CALLED, true, 'called reify') + t.strictSame(SCRIPTS, [], 'no scripts when adding dep') + t.end() + }) + }) + + t.test('just a local npm install', t => { + install([], () => { + t.match(ARB_ARGS, { global: false, path: 'foo' }) + t.equal(REIFY_CALLED, true, 'called reify') + t.strictSame(SCRIPTS, [ + 'preinstall', + 'install', + 'postinstall', + 'prepublish', + 'preprepare', + 'prepare', + 'postprepare' + ], 'exec scripts when doing local build') + t.end() + }) + }) + + t.end() +}) + +test('should install globally using Arborist', (t) => { + const install = requireInject('../../lib/install.js', { + '../../lib/npm.js': { + globalDir: 'path/to/node_modules/', + prefix: 'foo', + flatOptions: { + 'global': 'true', + }, + config: { + get: () => false + } + }, + '@npmcli/arborist': function () { + this.reify = () => {} + }, + }) + install([], () => { + t.end() + }) +}) + +test('completion to folder', (t) => { + const install = requireInject('../../lib/install.js', { + 'util': { + 'promisify': (fn) => fn + }, + 'fs': { + 'readdir': (path) => { + if (path === '/') { + return ['arborist'] + } else { + return ['package.json'] + } + } + } + }) + install.completion({ + partialWord: '/ar' + }, (er, res) => { + t.equal(er, null) + const expect = process.platform === 'win32' ? '\\arborist' : '/arborist' + t.strictSame(res, [expect], 'package dir match') + t.end() + }) +}) + +test('completion to folder - invalid dir', (t) => { + const install = requireInject('../../lib/install.js', { + 'util': { + 'promisify': (fn) => fn + }, + 'fs': { + 'readdir': () => { + throw new Error('EONT') + } + } + }) + install.completion({ + partialWord: 'path/to/folder' + }, (er, res) => { + t.equal(er, null) + t.strictSame(res, [], 'invalid dir: no matching') + t.end() + }) +}) + +test('completion to folder - no matches', (t) => { + const install = requireInject('../../lib/install.js', { + 'util': { + 'promisify': (fn) => fn + }, + 'fs': { + 'readdir': (path) => { + return ['foobar'] + } + } + }) + install.completion({ + partialWord: '/pa' + }, (er, res) => { + t.equal(er, null) + t.strictSame(res, [], 'no name match') + t.end() + }) +}) + +test('completion to folder - match is not a package', (t) => { + const install = requireInject('../../lib/install.js', { + 'util': { + 'promisify': (fn) => fn + }, + 'fs': { + 'readdir': (path) => { + if (path === '/') { + return ['arborist'] + } else { + throw new Error('EONT') + } + } + } + }) + install.completion({ + partialWord: '/ar' + }, (er, res) => { + t.equal(er, null) + t.strictSame(res, [], 'no name match') + t.end() + }) +}) + +test('completion to url', (t) => { + install.completion({ + partialWord: 'http://path/to/url' + }, (er, res) => { + t.equal(er, null) + t.strictSame(res, []) + t.end() + }) +}) + +test('completion', (t) => { + install.completion({ + partialWord: 'toto' + }, (er, res) => { + t.notOk(er) + t.notOk(res) + t.end() + }) +}) diff --git a/deps/npm/test/lib/link.js b/deps/npm/test/lib/link.js new file mode 100644 index 00000000000000..aafdb8188e85cf --- /dev/null +++ b/deps/npm/test/lib/link.js @@ -0,0 +1,291 @@ +const { resolve } = require('path') + +const Arborist = require('@npmcli/arborist') +const t = require('tap') +const requireInject = require('require-inject') + +const redactCwd = (path) => { + const normalizePath = p => p + .replace(/\\+/g, '/') + .replace(/\r\n/g, '\n') + return normalizePath(path) + .replace(new RegExp(normalizePath(process.cwd()), 'g'), '{CWD}') +} + +t.cleanSnapshot = (str) => redactCwd(str) + +let reifyOutput +const npm = { + globalDir: null, + prefix: null, + flatOptions: {}, + config: { + get () { return false } + } +} +const printLinks = async (opts) => { + let res = '' + const arb = new Arborist(opts) + const tree = await arb.loadActual() + const linkedItems = [...tree.inventory.values()] + .sort((a, b) => a.pkgid.localeCompare(b.pkgid)) + for (const item of linkedItems) { + if (item.target) { + res += `${item.path} -> ${item.target.path}\n` + } + } + return res +} + +const mocks = { + '../../lib/npm.js': npm, + '../../lib/utils/reify-output.js': () => reifyOutput() +} + +const link = requireInject('../../lib/link.js', mocks) + +t.test('link to globalDir when in current working dir of pkg and no args', (t) => { + t.plan(2) + + const testdir = t.testdir({ + 'global-prefix': { + lib: { + node_modules: { + a: { + 'package.json': JSON.stringify({ + name: 'a', + version: '1.0.0' + }) + } + } + } + }, + 'test-pkg-link': { + 'package.json': JSON.stringify({ + name: 'test-pkg-link', + version: '1.0.0' + }) + } + }) + npm.globalDir = resolve(testdir, 'global-prefix', 'lib', 'node_modules') + npm.prefix = resolve(testdir, 'test-pkg-link') + + reifyOutput = async () => { + reifyOutput = undefined + + const links = await printLinks({ + path: resolve(npm.globalDir, '..'), + global: true + }) + + t.matchSnapshot(links, 'should create a global link to current pkg') + } + + link([], (err) => { + t.ifError(err, 'should not error out') + }) +}) + +t.test('link global linked pkg to local nm when using args', (t) => { + t.plan(2) + + const testdir = t.testdir({ + 'global-prefix': { + lib: { + node_modules: { + '@myscope': { + foo: { + 'package.json': JSON.stringify({ + name: '@myscope/foo', + version: '1.0.0' + }) + }, + bar: { + 'package.json': JSON.stringify({ + name: '@myscope/bar', + version: '1.0.0' + }) + }, + linked: t.fixture('symlink', '../../../../scoped-linked') + }, + a: { + 'package.json': JSON.stringify({ + name: 'a', + version: '1.0.0' + }) + }, + b: { + 'package.json': JSON.stringify({ + name: 'b', + version: '1.0.0' + }) + }, + 'test-pkg-link': t.fixture('symlink', '../../../test-pkg-link') + } + } + }, + 'test-pkg-link': { + 'package.json': JSON.stringify({ + name: 'test-pkg-link', + version: '1.0.0' + }) + }, + 'link-me-too': { + 'package.json': JSON.stringify({ + name: 'link-me-too', + version: '1.0.0' + }) + }, + 'scoped-linked': { + 'package.json': JSON.stringify({ + name: '@myscope/linked', + version: '1.0.0' + }) + }, + 'my-project': { + 'package.json': JSON.stringify({ + name: 'my-project', + version: '1.0.0', + dependencies: { + foo: '^1.0.0' + } + }), + node_modules: { + foo: { + 'package.json': JSON.stringify({ + name: 'foo', + version: '1.0.0' + }) + } + } + } + }) + npm.globalDir = resolve(testdir, 'global-prefix', 'lib', 'node_modules') + npm.prefix = resolve(testdir, 'my-project') + + const _cwd = process.cwd() + process.chdir(npm.prefix) + + reifyOutput = async () => { + reifyOutput = undefined + process.chdir(_cwd) + + const links = await printLinks({ + path: npm.prefix + }) + + t.matchSnapshot(links, 'should create a local symlink to global pkg') + } + + // installs examples for: + // - test-pkg-link: pkg linked to globalDir from local fs + // - @myscope/linked: scoped pkg linked to globalDir from local fs + // - @myscope/bar: prev installed scoped package available in globalDir + // - a: prev installed package available in globalDir + // - file:./link-me-too: pkg that needs to be reified in globalDir first + link([ + 'test-pkg-link', + '@myscope/linked', + '@myscope/bar', + 'a', + 'file:../link-me-too' + ], (err) => { + t.ifError(err, 'should not error out') + }) +}) + +t.test('link pkg already in global space', (t) => { + t.plan(2) + + const testdir = t.testdir({ + 'global-prefix': { + lib: { + node_modules: { + '@myscope': { + linked: t.fixture('symlink', '../../../../scoped-linked') + } + } + } + }, + 'scoped-linked': { + 'package.json': JSON.stringify({ + name: '@myscope/linked', + version: '1.0.0' + }) + }, + 'my-project': { + 'package.json': JSON.stringify({ + name: 'my-project', + version: '1.0.0' + }) + } + }) + npm.globalDir = resolve(testdir, 'global-prefix', 'lib', 'node_modules') + npm.prefix = resolve(testdir, 'my-project') + + const _cwd = process.cwd() + process.chdir(npm.prefix) + + reifyOutput = async () => { + reifyOutput = undefined + process.chdir(_cwd) + + const links = await printLinks({ + path: npm.prefix + }) + + t.matchSnapshot(links, 'should create a local symlink to global pkg') + } + + // installs examples for: + // - test-pkg-link: pkg linked to globalDir from local fs + // - @myscope/linked: scoped pkg linked to globalDir from local fs + // - @myscope/bar: prev installed scoped package available in globalDir + // - a: prev installed package available in globalDir + // - file:./link-me-too: pkg that needs to be reified in globalDir first + link(['@myscope/linked'], (err) => { + t.ifError(err, 'should not error out') + }) +}) + +t.test('completion', (t) => { + const testdir = t.testdir({ + 'global-prefix': { + lib: { + node_modules: { + foo: {}, + bar: {}, + lorem: {}, + ipsum: {} + } + } + } + }) + npm.globalDir = resolve(testdir, 'global-prefix', 'lib', 'node_modules') + + link.completion({}, (err, words) => { + t.ifError(err, 'should not error out') + t.deepEqual( + words, + ['bar', 'foo', 'ipsum', 'lorem'], + 'should list all package names available in globalDir' + ) + t.end() + }) +}) + +t.test('--global option', (t) => { + const _config = npm.config + npm.config = { get () { return true } } + link([], (err) => { + npm.config = _config + + t.match( + err.message, + /link should never be --global/, + 'should throw an useful error' + ) + + t.end() + }) +}) diff --git a/deps/npm/test/lib/ll.js b/deps/npm/test/lib/ll.js new file mode 100644 index 00000000000000..989800944f6cb3 --- /dev/null +++ b/deps/npm/test/lib/ll.js @@ -0,0 +1,31 @@ +const t = require('tap') +const requireInject = require('require-inject') +const configs = {} +let lsCalled = false +const ll = requireInject('../../lib/ll.js', { + '../../lib/npm.js': { + config: { + set: (k, v) => { + configs[k] = v + } + }, + commands: { + ls: (args, cb) => { + lsCalled = true + cb() + } + } + } +}) + +const ls = require('../../lib/ls.js') +const { usage, completion } = ls +t.equal(ll.usage, usage) +t.equal(ll.completion.toString(), completion.toString()) +t.test('the ll command', t => { + ll([], () => { + t.equal(lsCalled, true) + t.strictSame(configs, { long: true }) + t.end() + }) +}) diff --git a/deps/npm/test/lib/load-all-commands.js b/deps/npm/test/lib/load-all-commands.js new file mode 100644 index 00000000000000..1669f435e9b097 --- /dev/null +++ b/deps/npm/test/lib/load-all-commands.js @@ -0,0 +1,23 @@ +// just for gathering coverage info +const npm = require('../../lib/npm.js') +const t = require('tap') +const { cmdList } = require('../../lib/utils/cmd-list.js') + +t.test('load npm', t => npm.load(er => { + if (er) { + throw er + } +})) + +t.test('load each command', t => { + t.plan(cmdList.length) + for (const cmd of cmdList.sort((a, b) => a.localeCompare(b))) { + t.test(cmd, t => { + t.plan(3) + const impl = npm.commands[cmd] + t.isa(impl, 'function', 'implementation is a function') + t.isa(impl.usage, 'string', 'usage is a string') + t.isa(impl.completion, 'function', 'completion is a function') + }) + } +}) diff --git a/deps/npm/test/lib/load-all.js b/deps/npm/test/lib/load-all.js new file mode 100644 index 00000000000000..72879c2c4448aa --- /dev/null +++ b/deps/npm/test/lib/load-all.js @@ -0,0 +1,30 @@ +const t = require('tap') +const glob = require('glob') +const { resolve } = require('path') + +const full = process.env.npm_lifecycle_event === 'check-coverage' + +if (!full) { + t.pass('nothing to do here, not checking for full coverage') +} else { + // some files do config.get() on load, so have to load npm first + const npm = require('../../lib/npm.js') + t.test('load npm first', t => npm.load(t.end)) + + t.test('load all the files', t => { + // just load all the files so we measure coverage for the missing tests + const dir = resolve(__dirname, '../../lib') + for (const f of glob.sync(`${dir}/**/*.js`)) { + require(f) + t.pass('loaded ' + f) + } + t.pass('loaded all files') + t.end() + }) + + t.test('call the error handle so we dont freak out', t => { + const errorHandler = require('../../lib/utils/error-handler.js') + errorHandler() + t.end() + }) +} diff --git a/deps/npm/test/lib/logout.js b/deps/npm/test/lib/logout.js new file mode 100644 index 00000000000000..0d00422dc83366 --- /dev/null +++ b/deps/npm/test/lib/logout.js @@ -0,0 +1,261 @@ +const requireInject = require('require-inject') +const { test } = require('tap') + +const _flatOptions = { + registry: 'https://registry.npmjs.org/', + scope: '' +} + +const config = {} +const npmlog = {} + +let result = null +const npmFetch = (url, opts) => { + result = { url, opts } +} + +const mocks = { + npmlog, + 'npm-registry-fetch': npmFetch, + '../../lib/npm.js': { + flatOptions: _flatOptions, + config + } +} + +const logout = requireInject('../../lib/logout.js', mocks) + +test('token logout', async (t) => { + t.plan(6) + + _flatOptions.token = '@foo/' + + npmlog.verbose = (title, msg) => { + t.equal(title, 'logout', 'should have correcct log prefix') + t.equal( + msg, + 'clearing token for https://registry.npmjs.org/', + 'should log message with correct registry' + ) + } + + config.clearCredentialsByURI = (registry) => { + t.equal( + registry, + 'https://registry.npmjs.org/', + 'should clear credentials from the expected registry' + ) + } + + config.save = (type) => { + t.equal(type, 'user', 'should save to user config') + } + + await new Promise((res, rej) => { + logout([], (err) => { + t.ifError(err, 'should not error out') + + t.deepEqual( + result, + { + url: '/-/user/token/%40foo%2F', + opts: { + registry: 'https://registry.npmjs.org/', + scope: '', + token: '@foo/', + method: 'DELETE', + ignoreBody: true + } + }, + 'should call npm-registry-fetch with expected values' + ) + + delete _flatOptions.token + result = null + mocks['npm-registry-fetch'] = null + config.clearCredentialsByURI = null + config.delete = null + config.save = null + npmlog.verbose = null + + res() + }) + }) +}) + +test('token scoped logout', async (t) => { + t.plan(8) + + _flatOptions.token = '@foo/' + _flatOptions.scope = '@myscope' + _flatOptions['@myscope:registry'] = 'https://diff-registry.npmjs.com/' + + npmlog.verbose = (title, msg) => { + t.equal(title, 'logout', 'should have correcct log prefix') + t.equal( + msg, + 'clearing token for https://diff-registry.npmjs.com/', + 'should log message with correct registry' + ) + } + + config.clearCredentialsByURI = (registry) => { + t.equal( + registry, + 'https://diff-registry.npmjs.com/', + 'should clear credentials from the expected registry' + ) + } + + config.delete = (ref, type) => { + t.equal( + ref, + '@myscope:registry', + 'should delete scoped registyr from config' + ) + t.equal(type, 'user', 'should delete from user config') + } + + config.save = (type) => { + t.equal(type, 'user', 'should save to user config') + } + + await new Promise((res, rej) => { + logout([], (err) => { + t.ifError(err, 'should not error out') + + t.deepEqual( + result, + { + url: '/-/user/token/%40foo%2F', + opts: { + registry: 'https://registry.npmjs.org/', + '@myscope:registry': 'https://diff-registry.npmjs.com/', + scope: '@myscope', + token: '@foo/', + method: 'DELETE', + ignoreBody: true + } + }, + 'should call npm-registry-fetch with expected values' + ) + + _flatOptions.scope = '' + delete _flatOptions['@myscope:registry'] + delete _flatOptions.token + result = null + mocks['npm-registry-fetch'] = null + config.clearCredentialsByURI = null + config.delete = null + config.save = null + npmlog.verbose = null + + res() + }) + }) +}) + +test('user/pass logout', async (t) => { + t.plan(3) + + _flatOptions.username = 'foo' + _flatOptions.password = 'bar' + + npmlog.verbose = (title, msg) => { + t.equal(title, 'logout', 'should have correcct log prefix') + t.equal( + msg, + 'clearing user credentials for https://registry.npmjs.org/', + 'should log message with correct registry' + ) + } + + config.clearCredentialsByURI = () => null + config.save = () => null + + await new Promise((res, rej) => { + logout([], (err) => { + t.ifError(err, 'should not error out') + + delete _flatOptions.username + delete _flatOptions.password + config.clearCredentialsByURI = null + config.save = null + npmlog.verbose = null + + res() + }) + }) +}) + +test('missing credentials', (t) => { + logout([], (err) => { + t.match( + err.message, + /not logged in to https:\/\/registry.npmjs.org\/, so can't log out!/, + 'should throw with expected message' + ) + t.equal(err.code, 'ENEEDAUTH', 'should throw with expected error code') + t.end() + }) +}) + +test('ignore invalid scoped registry config', async (t) => { + t.plan(5) + + _flatOptions.token = '@foo/' + _flatOptions.scope = '@myscope' + _flatOptions['@myscope:registry'] = '' + + npmlog.verbose = (title, msg) => { + t.equal(title, 'logout', 'should have correcct log prefix') + t.equal( + msg, + 'clearing token for https://registry.npmjs.org/', + 'should log message with correct registry' + ) + } + + config.clearCredentialsByURI = (registry) => { + t.equal( + registry, + 'https://registry.npmjs.org/', + 'should clear credentials from the expected registry' + ) + } + + config.delete = () => null + config.save = () => null + + await new Promise((res, rej) => { + logout([], (err) => { + t.ifError(err, 'should not error out') + + t.deepEqual( + result, + { + url: '/-/user/token/%40foo%2F', + opts: { + registry: 'https://registry.npmjs.org/', + scope: '@myscope', + '@myscope:registry': '', + token: '@foo/', + method: 'DELETE', + ignoreBody: true + } + }, + 'should call npm-registry-fetch with expected values' + ) + + delete _flatOptions.token + result = null + mocks['npm-registry-fetch'] = null + config.clearCredentialsByURI = null + config.delete = null + config.save = null + npmlog.verbose = null + + res() + }) + }) +}) diff --git a/deps/npm/test/lib/ls.js b/deps/npm/test/lib/ls.js new file mode 100644 index 00000000000000..db4ba81eecc17f --- /dev/null +++ b/deps/npm/test/lib/ls.js @@ -0,0 +1,3808 @@ +const { resolve } = require('path') + +const t = require('tap') +const requireInject = require('require-inject') + +t.cleanSnapshot = str => str.split(/\r\n/).join('\n') + +const simpleNmFixture = { + node_modules: { + 'foo': { + 'package.json': JSON.stringify({ + name: 'foo', + version: '1.0.0', + dependencies: { + 'bar': '^1.0.0' + } + }) + }, + 'bar': { + 'package.json': JSON.stringify({ + name: 'bar', + version: '1.0.0' + }) + }, + 'lorem': { + 'package.json': JSON.stringify({ + name: 'lorem', + version: '1.0.0' + }) + } + } +} + +const diffDepTypesNmFixture = { + node_modules: { + 'dev-dep': { + 'package.json': JSON.stringify({ + name: 'dev-dep', + description: 'A DEV dep kind of dep', + version: '1.0.0', + dependencies: { + 'foo': '^1.0.0' + } + }) + }, + 'prod-dep': { + 'package.json': JSON.stringify({ + name: 'prod-dep', + description: 'A PROD dep kind of dep', + version: '1.0.0', + dependencies: { + 'bar': '^2.0.0' + } + }), + node_modules: { + bar: { + 'package.json': JSON.stringify({ + name: 'bar', + description: 'A dep that bars', + version: '2.0.0' + }) + } + } + }, + 'optional-dep': { + 'package.json': JSON.stringify({ + name: 'optional-dep', + description: 'Maybe a dep?', + version: '1.0.0' + }) + }, + 'peer-dep': { + 'package.json': JSON.stringify({ + name: 'peer-dep', + description: 'Peer-dep description here', + version: '1.0.0' + }) + }, + ...simpleNmFixture.node_modules + } +} + +let prefix +let globalDir = 'MISSING_GLOBAL_DIR' +let result = '' +// note this _flatOptions representations is for tests-only and does not +// represent exactly the properties found in the actual flatOptions obj +const _flatOptions = { + all: true, + color: false, + dev: false, + depth: Infinity, + global: false, + json: false, + link: false, + only: null, + parseable: false, + get prefix () { return prefix }, + production: false +} +const ls = requireInject('../../lib/ls.js', { + '../../lib/npm.js': { + flatOptions: _flatOptions, + limit: { + fetch: 3 + }, + get prefix () { return _flatOptions.prefix }, + get globalDir () { return globalDir }, + config: { + get (key) { + return _flatOptions[key] + } + } + }, + '../../lib/utils/output.js': msg => { result = msg } +}) + +const redactCwd = res => + res && res.replace(/\\+/g, '/').replace(new RegExp(__dirname.replace(/\\+/g, '/'), 'gi'), '{CWD}') + +const jsonParse = res => JSON.parse(redactCwd(res)) + +const cleanUpResult = (done, t) => { + result = '' + done() +} + +t.test('ls', (t) => { + t.beforeEach(cleanUpResult) + _flatOptions.json = false + _flatOptions.unicode = false + t.test('no args', (t) => { + prefix = t.testdir({ + 'package.json': JSON.stringify({ + name: 'test-npm-ls', + version: '1.0.0', + dependencies: { + foo: '^1.0.0', + lorem: '^1.0.0' + } + }), + ...simpleNmFixture + }) + ls([], (err) => { + t.ifError(err, 'npm ls') + t.matchSnapshot(redactCwd(result), 'should output tree representation of dependencies structure') + t.end() + }) + }) + + t.test('missing package.json', (t) => { + prefix = t.testdir({ + ...simpleNmFixture + }) + ls([], (err) => { + t.match(err.code, 'ELSPROBLEMS', 'should have ELSPROBLEMS error code') + t.matchSnapshot( + redactCwd(err.message), + 'should log all extraneous deps on error msg' + ) + t.matchSnapshot(redactCwd(result), 'should output tree missing name/version of top-level package') + t.end() + }) + }) + + t.test('extraneous deps', (t) => { + prefix = t.testdir({ + 'package.json': JSON.stringify({ + name: 'test-npm-ls', + version: '1.0.0', + dependencies: { + foo: '^1.0.0' + } + }), + ...simpleNmFixture + }) + ls([], (err) => { + t.equal(err.code, 'ELSPROBLEMS', 'should have error code') + t.equal( + redactCwd(err.message), + 'extraneous: lorem@1.0.0 {CWD}/ls-ls-extraneous-deps/node_modules/lorem', + 'should log extraneous dep as error' + ) + t.matchSnapshot(redactCwd(result), 'should output containing problems info') + t.end() + }) + }) + + t.test('with filter arg', (t) => { + _flatOptions.color = true + prefix = t.testdir({ + 'package.json': JSON.stringify({ + name: 'test-npm-ls', + version: '1.0.0', + dependencies: { + foo: '^1.0.0', + lorem: '^1.0.0' + } + }), + ...simpleNmFixture + }) + ls(['lorem'], (err) => { + t.ifError(err, 'npm ls') + t.matchSnapshot(redactCwd(result), 'should output tree contaning only occurences of filtered by package and coloured output') + _flatOptions.color = false + t.end() + }) + }) + + t.test('with dot filter arg', (t) => { + _flatOptions.all = false + _flatOptions.depth = 0 + prefix = t.testdir({ + 'package.json': JSON.stringify({ + name: 'test-npm-ls', + version: '1.0.0', + dependencies: { + foo: '^1.0.0', + ipsum: '^1.0.0' + } + }), + ...simpleNmFixture + }) + ls(['.'], (err) => { + t.ifError(err, 'should not throw on missing dep above current level') + t.matchSnapshot(redactCwd(result), 'should output tree contaning only occurences of filtered by package and coloured output') + _flatOptions.all = true + _flatOptions.depth = Infinity + t.end() + }) + }) + + t.test('with filter arg nested dep', (t) => { + prefix = t.testdir({ + 'package.json': JSON.stringify({ + name: 'test-npm-ls', + version: '1.0.0', + dependencies: { + foo: '^1.0.0', + lorem: '^1.0.0' + } + }), + ...simpleNmFixture + }) + ls(['bar'], (err) => { + t.ifError(err, 'npm ls') + t.matchSnapshot(redactCwd(result), 'should output tree contaning only occurences of filtered package and its ancestors') + t.end() + }) + }) + + t.test('with multiple filter args', (t) => { + prefix = t.testdir({ + 'package.json': JSON.stringify({ + name: 'test-npm-ls', + version: '1.0.0', + dependencies: { + foo: '^1.0.0', + lorem: '^1.0.0', + ipsum: '^1.0.0' + } + }), + node_modules: { + ...simpleNmFixture.node_modules, + ipsum: { + 'package.json': JSON.stringify({ + name: 'ipsum', + version: '1.0.0' + }) + } + } + }) + ls(['bar@*', 'lorem@1.0.0'], (err) => { + t.ifError(err, 'npm ls') + t.matchSnapshot(redactCwd(result), 'should output tree contaning only occurences of multiple filtered packages and their ancestors') + t.end() + }) + }) + + t.test('with missing filter arg', (t) => { + prefix = t.testdir({ + 'package.json': JSON.stringify({ + name: 'test-npm-ls', + version: '1.0.0', + dependencies: { + foo: '^1.0.0', + lorem: '^1.0.0' + } + }), + ...simpleNmFixture + }) + ls(['notadep'], (err) => { + t.ifError(err, 'npm ls') + t.matchSnapshot(redactCwd(result), 'should output tree containing no dependencies info') + t.equal( + process.exitCode, + 1, + 'should exit with error code 1' + ) + process.exitCode = 0 + t.end() + }) + }) + + t.test('default --depth value should be 0', (t) => { + _flatOptions.all = false + _flatOptions.depth = undefined + prefix = t.testdir({ + 'package.json': JSON.stringify({ + name: 'test-npm-ls', + version: '1.0.0', + dependencies: { + foo: '^1.0.0', + lorem: '^1.0.0' + } + }), + ...simpleNmFixture + }) + ls([], (err) => { + t.ifError(err, 'npm ls') + t.matchSnapshot(redactCwd(result), 'should output tree containing only top-level dependencies') + _flatOptions.all = true + _flatOptions.depth = Infinity + t.end() + }) + }) + + t.test('--depth=0', (t) => { + _flatOptions.all = false + _flatOptions.depth = 0 + prefix = t.testdir({ + 'package.json': JSON.stringify({ + name: 'test-npm-ls', + version: '1.0.0', + dependencies: { + foo: '^1.0.0', + lorem: '^1.0.0' + } + }), + ...simpleNmFixture + }) + ls([], (err) => { + t.ifError(err, 'npm ls') + t.matchSnapshot(redactCwd(result), 'should output tree containing only top-level dependencies') + _flatOptions.all = true + _flatOptions.depth = Infinity + t.end() + }) + }) + + t.test('--depth=1', (t) => { + _flatOptions.all = false + _flatOptions.depth = 1 + prefix = t.testdir({ + 'package.json': JSON.stringify({ + name: 'test-npm-ls', + version: '1.0.0', + dependencies: { + a: '^1.0.0', + e: '^1.0.0' + } + }), + node_modules: { + a: { + 'package.json': JSON.stringify({ + name: 'a', + version: '1.0.0', + dependencies: { + b: '^1.0.0' + } + }) + }, + b: { + 'package.json': JSON.stringify({ + name: 'b', + version: '1.0.0', + dependencies: { + c: '^1.0.0', + d: '*' + } + }) + }, + c: { + 'package.json': JSON.stringify({ + name: 'c', + version: '1.0.0' + }) + }, + d: { + 'package.json': JSON.stringify({ + name: 'd', + version: '1.0.0' + }) + }, + e: { + 'package.json': JSON.stringify({ + name: 'e', + version: '1.0.0' + }) + } + } + }) + ls([], (err) => { + t.ifError(err, 'npm ls') + t.matchSnapshot(redactCwd(result), 'should output tree containing top-level deps and their deps only') + _flatOptions.all = true + _flatOptions.depth = Infinity + t.end() + }) + }) + + t.test('missing/invalid/extraneous', (t) => { + prefix = t.testdir({ + 'package.json': JSON.stringify({ + name: 'test-npm-ls', + version: '1.0.0', + dependencies: { + foo: '^2.0.0', + ipsum: '^1.0.0' + } + }), + ...simpleNmFixture + }) + ls([], (err) => { + t.equal(err.code, 'ELSPROBLEMS', 'should have error code') + t.equal( + redactCwd(err.message).replace(/\r\n/g, '\n'), + 'invalid: foo@1.0.0 {CWD}/ls-ls-missing-invalid-extraneous/node_modules/foo\n' + + 'missing: ipsum@^1.0.0, required by test-npm-ls@1.0.0\n' + + 'extraneous: lorem@1.0.0 {CWD}/ls-ls-missing-invalid-extraneous/node_modules/lorem', + 'should log missing/invalid/extraneous errors' + ) + t.matchSnapshot(redactCwd(result), 'should output tree containing missing, invalid, extraneous labels') + t.end() + }) + }) + + t.test('coloured output', (t) => { + _flatOptions.color = true + prefix = t.testdir({ + 'package.json': JSON.stringify({ + name: 'test-npm-ls', + version: '1.0.0', + dependencies: { + foo: '^2.0.0', + ipsum: '^1.0.0' + } + }), + ...simpleNmFixture + }) + ls([], (err) => { + t.equal(err.code, 'ELSPROBLEMS', 'should have error code') + t.matchSnapshot(redactCwd(result), 'should output tree containing color info') + _flatOptions.color = false + t.end() + }) + }) + + t.test('--dev', (t) => { + _flatOptions.dev = true + prefix = t.testdir({ + 'package.json': JSON.stringify({ + name: 'test-npm-ls', + version: '1.0.0', + dependencies: { + 'prod-dep': '^1.0.0', + 'lorem': '^1.0.0' + }, + devDependencies: { + 'dev-dep': '^1.0.0' + }, + optionalDependencies: { + 'optional-dep': '^1.0.0' + }, + peerDependencies: { + 'peer-dep': '^1.0.0' + } + }), + ...diffDepTypesNmFixture + }) + ls([], () => { + t.matchSnapshot(redactCwd(result), 'should output tree containing dev deps') + _flatOptions.dev = false + t.end() + }) + }) + + t.test('--only=development', (t) => { + _flatOptions.only = 'development' + prefix = t.testdir({ + 'package.json': JSON.stringify({ + name: 'test-npm-ls', + version: '1.0.0', + dependencies: { + 'prod-dep': '^1.0.0', + 'lorem': '^1.0.0' + }, + devDependencies: { + 'dev-dep': '^1.0.0' + }, + optionalDependencies: { + 'optional-dep': '^1.0.0' + }, + peerDependencies: { + 'peer-dep': '^1.0.0' + } + }), + ...diffDepTypesNmFixture + }) + ls([], () => { + t.matchSnapshot(redactCwd(result), 'should output tree containing only development deps') + _flatOptions.only = null + t.end() + }) + }) + + t.test('--link', (t) => { + _flatOptions.link = true + prefix = t.testdir({ + 'package.json': JSON.stringify({ + name: 'test-npm-ls', + version: '1.0.0', + dependencies: { + 'prod-dep': '^1.0.0', + 'lorem': '^1.0.0', + 'linked-dep': '^1.0.0' + }, + devDependencies: { + 'dev-dep': '^1.0.0' + }, + optionalDependencies: { + 'optional-dep': '^1.0.0' + }, + peerDependencies: { + 'peer-dep': '^1.0.0' + } + }), + 'linked-dep': { + 'package.json': JSON.stringify({ + name: 'linked-dep', + version: '1.0.0' + }) + }, + node_modules: { + 'linked-dep': t.fixture('symlink', '../linked-dep'), + ...diffDepTypesNmFixture.node_modules + } + }) + ls([], () => { + t.matchSnapshot(redactCwd(result), 'should output tree containing linked deps') + _flatOptions.link = false + t.end() + }) + }) + + t.test('print deduped symlinks', (t) => { + prefix = t.testdir({ + 'package.json': JSON.stringify({ + name: 'print-deduped-symlinks', + version: '1.0.0', + dependencies: { + 'a': '^1.0.0', + 'b': '^1.0.0' + } + }), + 'b': { + 'package.json': JSON.stringify({ + name: 'b', + version: '1.0.0' + }) + }, + node_modules: { + a: { + 'package.json': JSON.stringify({ + name: 'a', + version: '1.0.0', + dependencies: { + b: '^1.0.0' + } + }) + }, + 'b': t.fixture('symlink', '../b') + } + }) + ls([], () => { + t.matchSnapshot(redactCwd(result), 'should output tree containing linked deps') + _flatOptions.link = false + t.end() + }) + }) + + t.test('--production', (t) => { + _flatOptions.production = true + prefix = t.testdir({ + 'package.json': JSON.stringify({ + name: 'test-npm-ls', + version: '1.0.0', + dependencies: { + 'prod-dep': '^1.0.0', + 'lorem': '^1.0.0' + }, + devDependencies: { + 'dev-dep': '^1.0.0' + }, + optionalDependencies: { + 'optional-dep': '^1.0.0' + }, + peerDependencies: { + 'peer-dep': '^1.0.0' + } + }), + ...diffDepTypesNmFixture + }) + ls([], () => { + t.matchSnapshot(redactCwd(result), 'should output tree containing production deps') + _flatOptions.production = false + t.end() + }) + }) + + t.test('--only=prod', (t) => { + _flatOptions.only = 'prod' + prefix = t.testdir({ + 'package.json': JSON.stringify({ + name: 'test-npm-ls', + version: '1.0.0', + dependencies: { + 'prod-dep': '^1.0.0', + 'lorem': '^1.0.0' + }, + devDependencies: { + 'dev-dep': '^1.0.0' + }, + optionalDependencies: { + 'optional-dep': '^1.0.0' + }, + peerDependencies: { + 'peer-dep': '^1.0.0' + } + }), + ...diffDepTypesNmFixture + }) + ls([], () => { + t.matchSnapshot(redactCwd(result), 'should output tree containing only prod deps') + _flatOptions.only = null + t.end() + }) + }) + + t.test('--long', (t) => { + _flatOptions.long = true + prefix = t.testdir({ + 'package.json': JSON.stringify({ + name: 'test-npm-ls', + version: '1.0.0', + dependencies: { + 'prod-dep': '^1.0.0', + 'lorem': '^1.0.0' + }, + devDependencies: { + 'dev-dep': '^1.0.0' + }, + optionalDependencies: { + 'optional-dep': '^1.0.0' + }, + peerDependencies: { + 'peer-dep': '^1.0.0' + } + }), + ...diffDepTypesNmFixture + }) + ls([], () => { + t.matchSnapshot(redactCwd(result), 'should output tree info with descriptions') + _flatOptions.long = true + t.end() + }) + }) + + t.test('--long --depth=0', (t) => { + _flatOptions.all = false + _flatOptions.depth = 0 + _flatOptions.long = true + prefix = t.testdir({ + 'package.json': JSON.stringify({ + name: 'test-npm-ls', + version: '1.0.0', + dependencies: { + 'prod-dep': '^1.0.0', + 'lorem': '^1.0.0' + }, + devDependencies: { + 'dev-dep': '^1.0.0' + }, + optionalDependencies: { + 'optional-dep': '^1.0.0' + }, + peerDependencies: { + 'peer-dep': '^1.0.0' + } + }), + ...diffDepTypesNmFixture + }) + ls([], () => { + t.matchSnapshot(redactCwd(result), 'should output tree containing top-level deps with descriptions') + _flatOptions.all = true + _flatOptions.depth = Infinity + _flatOptions.long = false + t.end() + }) + }) + + t.test('json read problems', (t) => { + prefix = t.testdir({ + 'package.json': '{broken json' + }) + ls([], (err) => { + t.match(err, { code: 'EJSONPARSE' }, 'should throw EJSONPARSE error') + t.matchSnapshot(redactCwd(result), 'should print empty result') + t.end() + }) + }) + + t.test('empty location', (t) => { + prefix = t.testdir({}) + ls([], (err) => { + t.ifError(err, 'should not error out on empty locations') + t.matchSnapshot(redactCwd(result), 'should print empty result') + t.end() + }) + }) + + t.test('invalid peer dep', (t) => { + prefix = t.testdir({ + 'package.json': JSON.stringify({ + name: 'test-npm-ls', + version: '1.0.0', + dependencies: { + 'prod-dep': '^1.0.0', + 'lorem': '^1.0.0' + }, + devDependencies: { + 'dev-dep': '^1.0.0' + }, + optionalDependencies: { + 'optional-dep': '^1.0.0' + }, + peerDependencies: { + 'peer-dep': '^2.0.0' // mismatching version # + } + }), + ...diffDepTypesNmFixture + }) + ls([], () => { + t.matchSnapshot(redactCwd(result), 'should output tree signaling mismatching peer dep in problems') + t.end() + }) + }) + + t.test('invalid deduped dep', (t) => { + _flatOptions.color = true + prefix = t.testdir({ + 'package.json': JSON.stringify({ + name: 'invalid-deduped-dep', + version: '1.0.0', + dependencies: { + 'a': '^1.0.0', + 'b': '^2.0.0' + } + }), + node_modules: { + a: { + 'package.json': JSON.stringify({ + name: 'a', + version: '1.0.0', + dependencies: { + b: '^2.0.0' + } + }) + }, + b: { + 'package.json': JSON.stringify({ + name: 'b', + version: '1.0.0' + }) + } + } + }) + ls([], () => { + t.matchSnapshot(redactCwd(result), 'should output tree signaling mismatching peer dep in problems') + _flatOptions.color = false + t.end() + }) + }) + + t.test('deduped missing dep', (t) => { + prefix = t.testdir({ + 'package.json': JSON.stringify({ + name: 'test-npm-ls', + version: '1.0.0', + dependencies: { + 'a': '^1.0.0', + 'b': '^1.0.0' + } + }), + node_modules: { + a: { + 'package.json': JSON.stringify({ + name: 'a', + version: '1.0.0', + dependencies: { + b: '^1.0.0' + } + }) + } + } + }) + ls([], (err) => { + t.match(err.code, 'ELSPROBLEMS', 'should have ELSPROBLEMS error code') + t.match(err.message, /missing: b@\^1.0.0/, 'should list missing dep problem') + t.matchSnapshot(redactCwd(result), 'should output parseable signaling missing peer dep in problems') + t.end() + }) + }) + + t.test('unmet peer dep', (t) => { + prefix = t.testdir({ + 'package.json': JSON.stringify({ + name: 'test-npm-ls', + version: '1.0.0', + peerDependencies: { + 'peer-dep': '*' + } + }) + }) + ls([], (err) => { + t.match(err.code, 'ELSPROBLEMS', 'should have ELSPROBLEMS error code') + t.match(err.message, 'missing: peer-dep@*, required by test-npm-ls@1.0.0', 'should have missing peer-dep error msg') + t.matchSnapshot(redactCwd(result), 'should output tree signaling missing peer dep in problems') + t.end() + }) + }) + + t.test('unmet optional dep', (t) => { + _flatOptions.color = true + prefix = t.testdir({ + 'package.json': JSON.stringify({ + name: 'test-npm-ls', + version: '1.0.0', + dependencies: { + 'prod-dep': '^1.0.0', + 'lorem': '^1.0.0' + }, + devDependencies: { + 'dev-dep': '^1.0.0' + }, + optionalDependencies: { + 'missing-optional-dep': '^1.0.0', + 'optional-dep': '^2.0.0' // mismatching version # + }, + peerDependencies: { + 'peer-dep': '^1.0.0' + } + }), + ...diffDepTypesNmFixture + }) + ls([], (err) => { + t.match(err.code, 'ELSPROBLEMS', 'should have ELSPROBLEMS error code') + t.match(err.message, /invalid: optional-dep@1.0.0/, 'should have invalid dep error msg') + t.matchSnapshot(redactCwd(result), 'should output tree with empty entry for missing optional deps') + _flatOptions.color = false + t.end() + }) + }) + + t.test('cycle deps', (t) => { + prefix = t.testdir({ + 'package.json': JSON.stringify({ + name: 'test-npm-ls', + version: '1.0.0', + dependencies: { + 'a': '^1.0.0' + } + }), + node_modules: { + 'a': { + 'package.json': JSON.stringify({ + name: 'a', + version: '1.0.0', + dependencies: { + b: '^1.0.0' + } + }) + }, + 'b': { + 'package.json': JSON.stringify({ + name: 'b', + version: '1.0.0', + dependencies: { + a: '^1.0.0' + } + }) + } + } + }) + ls([], (err) => { + t.ifError(err, 'npm ls') + t.matchSnapshot(redactCwd(result), 'should print tree output containing deduped ref') + t.end() + }) + }) + + t.test('cycle deps with filter args', (t) => { + _flatOptions.color = true + prefix = t.testdir({ + 'package.json': JSON.stringify({ + name: 'test-npm-ls', + version: '1.0.0', + dependencies: { + 'a': '^1.0.0' + } + }), + node_modules: { + 'a': { + 'package.json': JSON.stringify({ + name: 'a', + version: '1.0.0', + dependencies: { + b: '^1.0.0' + } + }) + }, + 'b': { + 'package.json': JSON.stringify({ + name: 'b', + version: '1.0.0', + dependencies: { + a: '^1.0.0' + } + }) + } + } + }) + ls(['a'], (err) => { + t.ifError(err, 'npm ls') + t.matchSnapshot(redactCwd(result), 'should print tree output containing deduped ref') + _flatOptions.color = false + t.end() + }) + }) + + t.test('with no args dedupe entries', (t) => { + prefix = t.testdir({ + 'package.json': JSON.stringify({ + name: 'dedupe-entries', + version: '1.0.0', + dependencies: { + '@npmcli/a': '^1.0.0', + '@npmcli/b': '^1.0.0', + '@npmcli/c': '^1.0.0' + } + }), + node_modules: { + '@npmcli': { + 'a': { + 'package.json': JSON.stringify({ + name: '@npmcli/a', + version: '1.0.0', + dependencies: { + '@npmcli/b': '^1.0.0' + } + }) + }, + 'b': { + 'package.json': JSON.stringify({ + name: '@npmcli/b', + version: '1.1.2' + }) + }, + 'c': { + 'package.json': JSON.stringify({ + name: '@npmcli/c', + version: '1.0.0', + dependencies: { + '@npmcli/b': '^1.0.0' + } + }) + } + } + } + }) + ls([], (err) => { + t.ifError(err, 'npm ls') + t.matchSnapshot(redactCwd(result), 'should print tree output containing deduped ref') + t.end() + }) + }) + + t.test('with no args dedupe entries and not displaying all', (t) => { + _flatOptions.all = false + _flatOptions.depth = 0 + prefix = t.testdir({ + 'package.json': JSON.stringify({ + name: 'dedupe-entries', + version: '1.0.0', + dependencies: { + '@npmcli/a': '^1.0.0', + '@npmcli/b': '^1.0.0', + '@npmcli/c': '^1.0.0' + } + }), + node_modules: { + '@npmcli': { + 'a': { + 'package.json': JSON.stringify({ + name: '@npmcli/a', + version: '1.0.0', + dependencies: { + '@npmcli/b': '^1.0.0' + } + }) + }, + 'b': { + 'package.json': JSON.stringify({ + name: '@npmcli/b', + version: '1.1.2' + }) + }, + 'c': { + 'package.json': JSON.stringify({ + name: '@npmcli/c', + version: '1.0.0', + dependencies: { + '@npmcli/b': '^1.0.0' + } + }) + } + } + } + }) + ls([], (err) => { + t.ifError(err, 'npm ls') + t.matchSnapshot(redactCwd(result), 'should print tree output containing deduped ref') + _flatOptions.all = true + _flatOptions.depth = Infinity + t.end() + }) + }) + + t.test('with args and dedupe entries', (t) => { + _flatOptions.color = true + prefix = t.testdir({ + 'package.json': JSON.stringify({ + name: 'dedupe-entries', + version: '1.0.0', + dependencies: { + '@npmcli/a': '^1.0.0', + '@npmcli/b': '^1.0.0', + '@npmcli/c': '^1.0.0' + } + }), + node_modules: { + '@npmcli': { + 'a': { + 'package.json': JSON.stringify({ + name: '@npmcli/a', + version: '1.0.0', + dependencies: { + '@npmcli/b': '^1.0.0' + } + }) + }, + 'b': { + 'package.json': JSON.stringify({ + name: '@npmcli/b', + version: '1.1.2' + }) + }, + 'c': { + 'package.json': JSON.stringify({ + name: '@npmcli/c', + version: '1.0.0', + dependencies: { + '@npmcli/b': '^1.0.0' + } + }) + } + } + } + }) + ls(['@npmcli/b'], (err) => { + t.ifError(err, 'npm ls') + t.matchSnapshot(redactCwd(result), 'should print tree output containing deduped ref') + _flatOptions.color = false + t.end() + }) + }) + + t.test('with args and different order of items', (t) => { + prefix = t.testdir({ + 'package.json': JSON.stringify({ + name: 'dedupe-entries', + version: '1.0.0', + dependencies: { + '@npmcli/a': '^1.0.0', + '@npmcli/b': '^1.0.0', + '@npmcli/c': '^1.0.0' + } + }), + node_modules: { + '@npmcli': { + 'a': { + 'package.json': JSON.stringify({ + name: '@npmcli/a', + version: '1.0.0', + dependencies: { + '@npmcli/c': '^1.0.0' + } + }) + }, + 'b': { + 'package.json': JSON.stringify({ + name: '@npmcli/b', + version: '1.1.2', + dependencies: { + '@npmcli/c': '^1.0.0' + } + }) + }, + 'c': { + 'package.json': JSON.stringify({ + name: '@npmcli/c', + version: '1.0.0' + }) + } + } + } + }) + ls(['@npmcli/c'], (err) => { + t.ifError(err, 'npm ls') + t.matchSnapshot(redactCwd(result), 'should print tree output containing deduped ref') + t.end() + }) + }) + + t.test('using aliases', (t) => { + prefix = t.testdir({ + 'package.json': JSON.stringify({ + name: 'test-npm-ls', + version: '1.0.0', + dependencies: { + a: 'npm:b@1.0.0' + } + }), + node_modules: { + 'a': { + 'package.json': JSON.stringify({ + name: 'b', + version: '1.0.0', + _from: 'a@npm:b', + _resolved: 'https://localhost:8080/abbrev/-/abbrev-1.1.1.tgz', + _requested: { + type: 'alias' + } + }) + } + } + }) + ls([], () => { + t.matchSnapshot(redactCwd(result), 'should output tree containing aliases') + t.end() + }) + }) + + t.test('resolved points to git ref', (t) => { + prefix = t.testdir({ + 'package.json': JSON.stringify({ + name: 'test-npm-ls', + version: '1.0.0', + dependencies: { + 'abbrev': 'git+https://github.com/isaacs/abbrev-js.git' + } + }), + node_modules: { + 'abbrev': { + 'package.json': JSON.stringify({ + name: 'abbrev', + version: '1.1.1', + _id: 'abbrev@1.1.1', + _from: 'git+https://github.com/isaacs/abbrev-js.git', + _resolved: 'git+https://github.com/isaacs/abbrev-js.git#b8f3a2fc0c3bb8ffd8b0d0072cc6b5a3667e963c', + _requested: { + type: 'git', + raw: 'git+https:github.com/isaacs/abbrev-js.git', + rawSpec: 'git+https:github.com/isaacs/abbrev-js.git', + saveSpec: 'git+https://github.com/isaacs/abbrev-js.git', + fetchSpec: 'https://github.com/isaacs/abbrev-js.git', + gitCommittish: null + } + }) + } + } + }) + ls([], (err) => { + t.ifError(err, 'npm ls') + t.matchSnapshot(redactCwd(result), 'should output tree containing git refs') + t.end() + }) + }) + + t.test('broken resolved field', (t) => { + prefix = t.testdir({ + node_modules: { + a: { + 'package.json': JSON.stringify({ + name: 'a', + version: '1.0.1' + }) + } + }, + 'package-lock.json': JSON.stringify({ + 'name': 'npm-broken-resolved-field-test', + 'version': '1.0.0', + 'lockfileVersion': 2, + 'requires': true, + 'packages': { + '': { + 'name': 'a', + 'version': '1.0.1' + } + }, + 'dependencies': { + a: { + 'version': '1.0.1', + 'resolved': 'foo@bar://b8f3a2fc0c3bb8ffd8b0d0072cc6b5a3667e963c', + 'integrity': 'sha512-8AN9lNCcBt5Xeje7fMEEpp5K3rgcAzIpTtAjYb/YMUYu8SbIVF6wz0WqACDVKvpQOUcSfNHZQNLNmue0QSwXOQ==' + } + } + }), + 'package.json': JSON.stringify({ + 'name': 'npm-broken-resolved-field-test', + 'version': '1.0.0', + 'dependencies': { + 'a': '^1.0.1' + } + }) + }) + ls([], (err) => { + t.ifError(err, 'npm ls') + t.matchSnapshot(redactCwd(result), 'should NOT print git refs in output tree') + t.end() + }) + }) + + t.test('from and resolved properties', (t) => { + prefix = t.testdir({ + 'package.json': JSON.stringify({ + name: 'test-npm-ls', + version: '1.0.0', + dependencies: { + 'simple-output': '^2.0.0' + } + }), + node_modules: { + 'simple-output': { + 'package.json': JSON.stringify({ + name: 'simple-output', + version: '2.1.1', + _from: 'simple-output', + _id: 'simple-output@2.1.1', + _resolved: 'https://registry.npmjs.org/simple-output/-/simple-output-2.1.1.tgz', + _requested: { + type: 'tag', + registry: true, + raw: 'simple-output', + name: 'simple-output', + escapedName: 'simple-output', + rawSpec: '', + saveSpec: null, + fetchSpec: 'latest' + }, + _requiredBy: [ + '#USER', + '/' + ], + _shasum: '3c07708ec9ef3e3c985cf0ddd67df09ab8ec2abc', + _spec: 'simple-output' + }) + } + } + }) + ls([], () => { + t.matchSnapshot(redactCwd(result), 'should not be printed in tree output') + t.end() + }) + }) + + t.test('global', (t) => { + _flatOptions.global = true + const fixtures = t.testdir({ + node_modules: { + a: { + 'package.json': JSON.stringify({ + name: 'a', + version: '1.0.0' + }) + }, + b: { + 'package.json': JSON.stringify({ + name: 'b', + version: '1.0.0' + }), + node_modules: { + c: { + 'package.json': JSON.stringify({ + name: 'c', + version: '1.0.0' + }) + } + } + } + } + }) + + // mimics lib/npm.js globalDir getter but pointing to fixtures + globalDir = resolve(fixtures, 'node_modules') + + ls([], () => { + t.matchSnapshot(redactCwd(result), 'should print tree and not mark top-level items extraneous') + globalDir = 'MISSING_GLOBAL_DIR' + _flatOptions.global = false + t.end() + }) + }) + + t.test('filtering by child of missing dep', (t) => { + prefix = t.testdir({ + 'package.json': JSON.stringify({ + name: 'filter-by-child-of-missing-dep', + version: '1.0.0', + dependencies: { + 'a': '^1.0.0' + } + }), + node_modules: { + b: { + 'package.json': JSON.stringify({ + name: 'b', + version: '1.0.0', + dependencies: { + c: '^1.0.0' + } + }) + }, + c: { + 'package.json': JSON.stringify({ + name: 'c', + version: '1.0.0' + }) + }, + d: { + 'package.json': JSON.stringify({ + name: 'd', + version: '1.0.0', + dependencies: { + c: '^2.0.0' + } + }), + node_modules: { + c: { + 'package.json': JSON.stringify({ + name: 'c', + version: '2.0.0' + }) + } + } + } + } + }) + + ls(['c'], (err) => { + t.match(err.code, 'ELSPROBLEMS', 'should have ELSPROBLEMS error code') + t.matchSnapshot(redactCwd(result), 'should print tree and not duplicate child of missing items') + t.end() + }) + }) + + t.test('loading a tree containing workspaces', (t) => { + prefix = t.testdir({ + 'package.json': JSON.stringify({ + name: 'filter-by-child-of-missing-dep', + version: '1.0.0', + workspaces: [ + './a', + './b' + ] + }), + node_modules: { + a: t.fixture('symlink', '../a'), + b: t.fixture('symlink', '../b'), + c: { + 'package.json': JSON.stringify({ + name: 'c', + version: '1.0.0' + }) + } + }, + a: { + 'package.json': JSON.stringify({ + name: 'a', + version: '1.0.0', + dependencies: { + c: '^1.0.0' + } + }) + }, + b: { + 'package.json': JSON.stringify({ + name: 'b', + version: '1.0.0' + }) + } + }) + + ls([], (err) => { + t.ifError(err, 'should NOT have ELSPROBLEMS error code') + t.matchSnapshot(redactCwd(result), 'should list workspaces properly') + + // should also be able to filter out one of the workspaces + ls(['a'], (err) => { + t.ifError(err, 'should NOT have ELSPROBLEMS error code when filter') + t.matchSnapshot(redactCwd(result), 'should filter single workspace') + + t.end() + }) + }) + }) + + t.test('filter pkg arg using depth option', (t) => { + _flatOptions.depth = 0 + prefix = t.testdir({ + 'package.json': JSON.stringify({ + name: 'test-pkg-arg-filter-with-depth-opt', + version: '1.0.0', + dependencies: { + a: '^1.0.0', + b: '^1.0.0' + } + }), + node_modules: { + a: { + 'package.json': JSON.stringify({ + name: 'a', + version: '1.0.0' + }) + }, + b: { + 'package.json': JSON.stringify({ + name: 'b', + version: '1.0.0', + dependencies: { + c: '^1.0.0' + } + }) + }, + c: { + 'package.json': JSON.stringify({ + name: 'c', + version: '1.0.0', + dependencies: { + d: '^1.0.0' + } + }) + }, + d: { + 'package.json': JSON.stringify({ + name: 'd', + version: '1.0.0', + dependencies: { + a: '^1.0.0' + } + }) + } + } + }) + + t.plan(6) + ls(['a'], (err) => { + t.ifError(err, 'should NOT have ELSPROBLEMS error code') + t.matchSnapshot(redactCwd(result), 'should list a in top-level only') + + ls(['d'], (err) => { + t.ifError(err, 'should NOT have ELSPROBLEMS error code when filter') + t.matchSnapshot(redactCwd(result), 'should print empty results msg') + + // if no --depth config is defined, should print path to dep + _flatOptions.depth = null // default config value + ls(['d'], (err) => { + t.ifError(err, 'should NOT have ELSPROBLEMS error code when filter') + t.matchSnapshot(redactCwd(result), 'should print expected result') + }) + }) + }) + }) + + t.teardown(() => { + _flatOptions.depth = Infinity + }) + + t.end() +}) + +t.test('ls --parseable', (t) => { + t.beforeEach(cleanUpResult) + _flatOptions.json = false + _flatOptions.unicode = false + _flatOptions.parseable = true + t.test('no args', (t) => { + prefix = t.testdir({ + 'package.json': JSON.stringify({ + name: 'test-npm-ls', + version: '1.0.0', + dependencies: { + foo: '^1.0.0', + lorem: '^1.0.0' + } + }), + ...simpleNmFixture + }) + ls([], (err) => { + t.ifError(err, 'npm ls') + t.matchSnapshot(redactCwd(result), 'should output parseable representation of dependencies structure') + t.end() + }) + }) + + t.test('missing package.json', (t) => { + prefix = t.testdir({ + ...simpleNmFixture + }) + ls([], (err) => { + t.match(err.code, 'ELSPROBLEMS', 'should have ELSPROBLEMS error code') + t.matchSnapshot( + redactCwd(err.message), + 'should log all extraneous deps on error msg' + ) + t.matchSnapshot(redactCwd(result), 'should output parseable missing name/version of top-level package') + t.end() + }) + }) + + t.test('extraneous deps', (t) => { + prefix = t.testdir({ + 'package.json': JSON.stringify({ + name: 'test-npm-ls', + version: '1.0.0', + dependencies: { + foo: '^1.0.0' + } + }), + ...simpleNmFixture + }) + ls([], (err) => { + t.equal(err.code, 'ELSPROBLEMS', 'should have error code') + t.matchSnapshot(redactCwd(result), 'should output containing problems info') + t.end() + }) + }) + + t.test('with filter arg', (t) => { + prefix = t.testdir({ + 'package.json': JSON.stringify({ + name: 'test-npm-ls', + version: '1.0.0', + dependencies: { + foo: '^1.0.0', + lorem: '^1.0.0' + } + }), + ...simpleNmFixture + }) + ls(['lorem'], (err) => { + t.ifError(err, 'npm ls') + t.matchSnapshot(redactCwd(result), 'should output parseable contaning only occurences of filtered by package') + t.end() + }) + }) + + t.test('with filter arg nested dep', (t) => { + prefix = t.testdir({ + 'package.json': JSON.stringify({ + name: 'test-npm-ls', + version: '1.0.0', + dependencies: { + foo: '^1.0.0', + lorem: '^1.0.0' + } + }), + ...simpleNmFixture + }) + ls(['bar'], (err) => { + t.ifError(err, 'npm ls') + t.matchSnapshot(redactCwd(result), 'should output parseable contaning only occurences of filtered package') + t.end() + }) + }) + + t.test('with multiple filter args', (t) => { + prefix = t.testdir({ + 'package.json': JSON.stringify({ + name: 'test-npm-ls', + version: '1.0.0', + dependencies: { + foo: '^1.0.0', + lorem: '^1.0.0', + ipsum: '^1.0.0' + } + }), + node_modules: { + ...simpleNmFixture.node_modules, + ipsum: { + 'package.json': JSON.stringify({ + name: 'ipsum', + version: '1.0.0' + }) + } + } + }) + ls(['bar@*', 'lorem@1.0.0'], (err) => { + t.ifError(err, 'npm ls') + t.matchSnapshot(redactCwd(result), 'should output parseable contaning only occurences of multiple filtered packages and their ancestors') + t.end() + }) + }) + + t.test('with missing filter arg', (t) => { + prefix = t.testdir({ + 'package.json': JSON.stringify({ + name: 'test-npm-ls', + version: '1.0.0', + dependencies: { + foo: '^1.0.0', + lorem: '^1.0.0' + } + }), + ...simpleNmFixture + }) + ls(['notadep'], (err) => { + t.ifError(err, 'npm ls') + t.matchSnapshot(redactCwd(result), 'should output parseable output containing no dependencies info') + t.equal( + process.exitCode, + 1, + 'should exit with error code 1' + ) + process.exitCode = 0 + t.end() + }) + }) + + t.test('default --depth value should be 0', (t) => { + _flatOptions.all = false + _flatOptions.depth = undefined + prefix = t.testdir({ + 'package.json': JSON.stringify({ + name: 'test-npm-ls', + version: '1.0.0', + dependencies: { + foo: '^1.0.0', + lorem: '^1.0.0' + } + }), + ...simpleNmFixture + }) + ls([], (err) => { + t.ifError(err, 'npm ls') + t.matchSnapshot(redactCwd(result), 'should output parseable output containing only top-level dependencies') + _flatOptions.all = true + _flatOptions.depth = Infinity + t.end() + }) + }) + + t.test('--depth=0', (t) => { + _flatOptions.all = false + _flatOptions.depth = 0 + prefix = t.testdir({ + 'package.json': JSON.stringify({ + name: 'test-npm-ls', + version: '1.0.0', + dependencies: { + foo: '^1.0.0', + lorem: '^1.0.0' + } + }), + ...simpleNmFixture + }) + ls([], (err) => { + t.ifError(err, 'npm ls') + t.matchSnapshot(redactCwd(result), 'should output tree containing only top-level dependencies') + _flatOptions.all = true + _flatOptions.depth = Infinity + t.end() + }) + }) + + t.test('--depth=1', (t) => { + _flatOptions.all = false + _flatOptions.depth = 1 + prefix = t.testdir({ + 'package.json': JSON.stringify({ + name: 'test-npm-ls', + version: '1.0.0', + dependencies: { + foo: '^1.0.0', + lorem: '^1.0.0' + } + }), + ...simpleNmFixture + }) + ls([], (err) => { + t.ifError(err, 'npm ls') + t.matchSnapshot(redactCwd(result), 'should output parseable containing top-level deps and their deps only') + _flatOptions.all = true + _flatOptions.depth = Infinity + t.end() + }) + }) + + t.test('missing/invalid/extraneous', (t) => { + prefix = t.testdir({ + 'package.json': JSON.stringify({ + name: 'test-npm-ls', + version: '1.0.0', + dependencies: { + foo: '^2.0.0', + ipsum: '^1.0.0' + } + }), + ...simpleNmFixture + }) + ls([], (err) => { + t.match(err, { code: 'ELSPROBLEMS' }, 'should list dep problems') + t.matchSnapshot(redactCwd(result), 'should output parseable containing top-level deps and their deps only') + t.end() + }) + }) + + t.test('--dev', (t) => { + _flatOptions.dev = true + prefix = t.testdir({ + 'package.json': JSON.stringify({ + name: 'test-npm-ls', + version: '1.0.0', + dependencies: { + 'prod-dep': '^1.0.0', + 'lorem': '^1.0.0' + }, + devDependencies: { + 'dev-dep': '^1.0.0' + }, + optionalDependencies: { + 'optional-dep': '^1.0.0' + }, + peerDependencies: { + 'peer-dep': '^1.0.0' + } + }), + ...diffDepTypesNmFixture + }) + ls([], () => { + t.matchSnapshot(redactCwd(result), 'should output tree containing dev deps') + _flatOptions.dev = false + t.end() + }) + }) + + t.test('--only=development', (t) => { + _flatOptions.only = 'development' + prefix = t.testdir({ + 'package.json': JSON.stringify({ + name: 'test-npm-ls', + version: '1.0.0', + dependencies: { + 'prod-dep': '^1.0.0', + 'lorem': '^1.0.0' + }, + devDependencies: { + 'dev-dep': '^1.0.0' + }, + optionalDependencies: { + 'optional-dep': '^1.0.0' + }, + peerDependencies: { + 'peer-dep': '^1.0.0' + } + }), + ...diffDepTypesNmFixture + }) + ls([], () => { + t.matchSnapshot(redactCwd(result), 'should output tree containing only development deps') + _flatOptions.only = null + t.end() + }) + }) + + t.test('--link', (t) => { + _flatOptions.link = true + prefix = t.testdir({ + 'package.json': JSON.stringify({ + name: 'test-npm-ls', + version: '1.0.0', + dependencies: { + 'prod-dep': '^1.0.0', + 'lorem': '^1.0.0', + 'linked-dep': '^1.0.0' + }, + devDependencies: { + 'dev-dep': '^1.0.0' + }, + optionalDependencies: { + 'optional-dep': '^1.0.0' + }, + peerDependencies: { + 'peer-dep': '^1.0.0' + } + }), + 'linked-dep': { + 'package.json': JSON.stringify({ + name: 'linked-dep', + version: '1.0.0' + }) + }, + node_modules: { + 'linked-dep': t.fixture('symlink', '../linked-dep'), + ...diffDepTypesNmFixture.node_modules + } + }) + ls([], () => { + t.matchSnapshot(redactCwd(result), 'should output tree containing linked deps') + _flatOptions.link = false + t.end() + }) + }) + + t.test('--production', (t) => { + _flatOptions.production = true + prefix = t.testdir({ + 'package.json': JSON.stringify({ + name: 'test-npm-ls', + version: '1.0.0', + dependencies: { + 'prod-dep': '^1.0.0', + 'lorem': '^1.0.0' + }, + devDependencies: { + 'dev-dep': '^1.0.0' + }, + optionalDependencies: { + 'optional-dep': '^1.0.0' + }, + peerDependencies: { + 'peer-dep': '^1.0.0' + } + }), + ...diffDepTypesNmFixture + }) + ls([], () => { + t.matchSnapshot(redactCwd(result), 'should output tree containing production deps') + _flatOptions.production = false + t.end() + }) + }) + + t.test('--only=prod', (t) => { + _flatOptions.only = 'prod' + prefix = t.testdir({ + 'package.json': JSON.stringify({ + name: 'test-npm-ls', + version: '1.0.0', + dependencies: { + 'prod-dep': '^1.0.0', + 'lorem': '^1.0.0' + }, + devDependencies: { + 'dev-dep': '^1.0.0' + }, + optionalDependencies: { + 'optional-dep': '^1.0.0' + }, + peerDependencies: { + 'peer-dep': '^1.0.0' + } + }), + ...diffDepTypesNmFixture + }) + ls([], () => { + t.matchSnapshot(redactCwd(result), 'should output tree containing only prod deps') + _flatOptions.only = null + t.end() + }) + }) + + t.test('--long', (t) => { + _flatOptions.long = true + prefix = t.testdir({ + 'package.json': JSON.stringify({ + name: 'test-npm-ls', + version: '1.0.0', + dependencies: { + 'prod-dep': '^1.0.0', + 'lorem': '^1.0.0' + }, + devDependencies: { + 'dev-dep': '^1.0.0' + }, + optionalDependencies: { + 'optional-dep': '^1.0.0' + }, + peerDependencies: { + 'peer-dep': '^1.0.0' + } + }), + ...diffDepTypesNmFixture + }) + ls([], () => { + t.matchSnapshot(redactCwd(result), 'should output tree info with descriptions') + _flatOptions.long = true + t.end() + }) + }) + + t.test('--long with extraneous deps', (t) => { + prefix = t.testdir({ + 'package.json': JSON.stringify({ + name: 'test-npm-ls', + version: '1.0.0', + dependencies: { + foo: '^1.0.0' + } + }), + ...simpleNmFixture + }) + ls([], (err) => { + t.equal(err.code, 'ELSPROBLEMS', 'should have error code') + t.match(redactCwd(err.message), 'extraneous: lorem@1.0.0 {CWD}/ls-ls-parseable--long-with-extraneous-deps/node_modules/lorem', 'should have error code') + t.matchSnapshot(redactCwd(result), 'should output long parseable output with extraneous info') + t.end() + }) + }) + + t.test('--long missing/invalid/extraneous', (t) => { + _flatOptions.long = true + prefix = t.testdir({ + 'package.json': JSON.stringify({ + name: 'test-npm-ls', + version: '1.0.0', + dependencies: { + foo: '^2.0.0', + ipsum: '^1.0.0' + } + }), + ...simpleNmFixture + }) + ls([], (err) => { + t.match(err, { code: 'ELSPROBLEMS' }, 'should list dep problems') + t.matchSnapshot(redactCwd(result), 'should output parseable result containing EXTRANEOUS/INVALID labels') + _flatOptions.long = false + t.end() + }) + }) + + t.test('--long print symlink target location', (t) => { + _flatOptions.long = true + prefix = t.testdir({ + 'package.json': JSON.stringify({ + name: 'test-npm-ls', + version: '1.0.0', + dependencies: { + 'prod-dep': '^1.0.0', + 'lorem': '^1.0.0', + 'linked-dep': '^1.0.0' + }, + devDependencies: { + 'dev-dep': '^1.0.0' + }, + optionalDependencies: { + 'optional-dep': '^1.0.0' + }, + peerDependencies: { + 'peer-dep': '^1.0.0' + } + }), + 'linked-dep': { + 'package.json': JSON.stringify({ + name: 'linked-dep', + version: '1.0.0' + }) + }, + node_modules: { + 'linked-dep': t.fixture('symlink', '../linked-dep'), + ...diffDepTypesNmFixture.node_modules + } + }) + ls([], (err) => { + t.ifError(err, 'npm ls') + t.matchSnapshot(redactCwd(result), 'should output parseable results with symlink targets') + _flatOptions.long = false + t.end() + }) + }) + + t.test('--long --depth=0', (t) => { + _flatOptions.all = false + _flatOptions.depth = 0 + _flatOptions.long = true + prefix = t.testdir({ + 'package.json': JSON.stringify({ + name: 'test-npm-ls', + version: '1.0.0', + dependencies: { + 'prod-dep': '^1.0.0', + 'lorem': '^1.0.0' + }, + devDependencies: { + 'dev-dep': '^1.0.0' + }, + optionalDependencies: { + 'optional-dep': '^1.0.0' + }, + peerDependencies: { + 'peer-dep': '^1.0.0' + } + }), + ...diffDepTypesNmFixture + }) + ls([], () => { + t.matchSnapshot(redactCwd(result), 'should output tree containing top-level deps with descriptions') + _flatOptions.all = true + _flatOptions.depth = Infinity + _flatOptions.long = false + t.end() + }) + }) + + t.test('json read problems', (t) => { + prefix = t.testdir({ + 'package.json': '{broken json' + }) + ls([], (err) => { + t.match(err, { code: 'EJSONPARSE' }, 'should throw EJSONPARSE error') + t.matchSnapshot(redactCwd(result), 'should print empty result') + t.end() + }) + }) + + t.test('empty location', (t) => { + prefix = t.testdir({}) + ls([], (err) => { + t.ifError(err, 'should not error out on empty locations') + t.matchSnapshot(redactCwd(result), 'should print empty result') + t.end() + }) + }) + + t.test('unmet peer dep', (t) => { + prefix = t.testdir({ + 'package.json': JSON.stringify({ + name: 'test-npm-ls', + version: '1.0.0', + dependencies: { + 'prod-dep': '^1.0.0', + 'lorem': '^1.0.0' + }, + devDependencies: { + 'dev-dep': '^1.0.0' + }, + optionalDependencies: { + 'optional-dep': '^1.0.0' + }, + peerDependencies: { + 'peer-dep': '^2.0.0' // mismatching version # + } + }), + ...diffDepTypesNmFixture + }) + ls([], () => { + t.matchSnapshot(redactCwd(result), 'should output parseable signaling missing peer dep in problems') + t.end() + }) + }) + + t.test('unmet optional dep', (t) => { + prefix = t.testdir({ + 'package.json': JSON.stringify({ + name: 'test-npm-ls', + version: '1.0.0', + dependencies: { + 'prod-dep': '^1.0.0', + 'lorem': '^1.0.0' + }, + devDependencies: { + 'dev-dep': '^1.0.0' + }, + optionalDependencies: { + 'missing-optional-dep': '^1.0.0', + 'optional-dep': '^2.0.0' // mismatching version # + }, + peerDependencies: { + 'peer-dep': '^1.0.0' + } + }), + ...diffDepTypesNmFixture + }) + ls([], (err) => { + t.match(err.code, 'ELSPROBLEMS', 'should have ELSPROBLEMS error code') + t.match(err.message, /invalid: optional-dep@1.0.0/, 'should have invalid dep error msg') + t.matchSnapshot(redactCwd(result), 'should output parseable with empty entry for missing optional deps') + t.end() + }) + }) + + t.test('cycle deps', (t) => { + prefix = t.testdir({ + 'package.json': JSON.stringify({ + name: 'test-npm-ls', + version: '1.0.0', + dependencies: { + 'a': '^1.0.0' + } + }), + node_modules: { + 'a': { + 'package.json': JSON.stringify({ + name: 'a', + version: '1.0.0', + dependencies: { + b: '^1.0.0' + } + }) + }, + 'b': { + 'package.json': JSON.stringify({ + name: 'b', + version: '1.0.0', + dependencies: { + a: '^1.0.0' + } + }) + } + } + }) + ls([], () => { + t.matchSnapshot(redactCwd(result), 'should print tree output ommiting deduped ref') + t.end() + }) + }) + + t.test('using aliases', (t) => { + prefix = t.testdir({ + 'package.json': JSON.stringify({ + name: 'test-npm-ls', + version: '1.0.0', + dependencies: { + a: 'npm:b@1.0.0' + } + }), + node_modules: { + 'a': { + 'package.json': JSON.stringify({ + name: 'b', + version: '1.0.0', + _from: 'a@npm:b', + _resolved: 'https://localhost:8080/abbrev/-/abbrev-1.1.1.tgz', + _requested: { + type: 'alias' + } + }) + } + } + }) + ls([], () => { + t.matchSnapshot(redactCwd(result), 'should output tree containing aliases') + t.end() + }) + }) + + t.test('resolved points to git ref', (t) => { + prefix = t.testdir({ + 'package.json': JSON.stringify({ + name: 'test-npm-ls', + version: '1.0.0', + dependencies: { + 'abbrev': 'git+https://github.com/isaacs/abbrev-js.git' + } + }), + node_modules: { + 'abbrev': { + 'package.json': JSON.stringify({ + name: 'abbrev', + version: '1.1.1', + _id: 'abbrev@1.1.1', + _from: 'git+https://github.com/isaacs/abbrev-js.git', + _resolved: 'git+https://github.com/isaacs/abbrev-js.git#b8f3a2fc0c3bb8ffd8b0d0072cc6b5a3667e963c', + _requested: { + type: 'git', + raw: 'git+https:github.com/isaacs/abbrev-js.git', + rawSpec: 'git+https:github.com/isaacs/abbrev-js.git', + saveSpec: 'git+https://github.com/isaacs/abbrev-js.git', + fetchSpec: 'https://github.com/isaacs/abbrev-js.git', + gitCommittish: null + } + }) + } + } + }) + ls([], () => { + t.matchSnapshot(redactCwd(result), 'should output tree containing git refs') + t.end() + }) + }) + + t.test('from and resolved properties', (t) => { + prefix = t.testdir({ + 'package.json': JSON.stringify({ + name: 'test-npm-ls', + version: '1.0.0', + dependencies: { + 'simple-output': '^2.0.0' + } + }), + node_modules: { + 'simple-output': { + 'package.json': JSON.stringify({ + name: 'simple-output', + version: '2.1.1', + _from: 'simple-output', + _id: 'simple-output@2.1.1', + _resolved: 'https://registry.npmjs.org/simple-output/-/simple-output-2.1.1.tgz', + _requested: { + type: 'tag', + registry: true, + raw: 'simple-output', + name: 'simple-output', + escapedName: 'simple-output', + rawSpec: '', + saveSpec: null, + fetchSpec: 'latest' + }, + _requiredBy: [ + '#USER', + '/' + ], + _shasum: '3c07708ec9ef3e3c985cf0ddd67df09ab8ec2abc', + _spec: 'simple-output' + }) + } + } + }) + ls([], () => { + t.matchSnapshot(redactCwd(result), 'should not be printed in tree output') + t.end() + }) + }) + + t.test('global', (t) => { + _flatOptions.global = true + const fixtures = t.testdir({ + node_modules: { + a: { + 'package.json': JSON.stringify({ + name: 'a', + version: '1.0.0' + }) + }, + b: { + 'package.json': JSON.stringify({ + name: 'b', + version: '1.0.0' + }), + node_modules: { + c: { + 'package.json': JSON.stringify({ + name: 'c', + version: '1.0.0' + }) + } + } + } + } + }) + + // mimics lib/npm.js globalDir getter but pointing to fixtures + globalDir = resolve(fixtures, 'node_modules') + + ls([], () => { + t.matchSnapshot(redactCwd(result), 'should print parseable output for global deps') + globalDir = 'MISSING_GLOBAL_DIR' + _flatOptions.global = false + t.end() + }) + }) + + t.end() +}) + +t.test('ls --json', (t) => { + t.beforeEach(cleanUpResult) + _flatOptions.json = true + _flatOptions.parseable = false + t.test('no args', (t) => { + prefix = t.testdir({ + 'package.json': JSON.stringify({ + name: 'test-npm-ls', + version: '1.0.0', + dependencies: { + foo: '^1.0.0', + lorem: '^1.0.0' + } + }), + ...simpleNmFixture + }) + ls([], (err) => { + t.ifError(err, 'npm ls') + t.deepEqual( + jsonParse(result), + { + name: 'test-npm-ls', + version: '1.0.0', + 'dependencies': { + 'foo': { + 'version': '1.0.0', + 'dependencies': { + 'bar': { + 'version': '1.0.0' + } + } + }, + 'lorem': { + 'version': '1.0.0' + } + } + }, + 'should output json representation of dependencies structure' + ) + t.end() + }) + }) + + t.test('missing package.json', (t) => { + prefix = t.testdir({ + ...simpleNmFixture + }) + ls([], (err) => { + t.match(err, { code: 'ELSPROBLEMS' }, 'should list dep problems') + t.deepEqual( + jsonParse(result), + { + 'problems': [ + 'extraneous: bar@1.0.0 {CWD}/ls-ls-json-missing-package-json/node_modules/bar', + 'extraneous: foo@1.0.0 {CWD}/ls-ls-json-missing-package-json/node_modules/foo', + 'extraneous: lorem@1.0.0 {CWD}/ls-ls-json-missing-package-json/node_modules/lorem' + ], + 'dependencies': { + 'bar': { + 'version': '1.0.0', + 'extraneous': true, + 'problems': [ + 'extraneous: bar@1.0.0 {CWD}/ls-ls-json-missing-package-json/node_modules/bar' + ] + }, + 'foo': { + 'version': '1.0.0', + 'extraneous': true, + 'problems': [ + 'extraneous: foo@1.0.0 {CWD}/ls-ls-json-missing-package-json/node_modules/foo' + ], + 'dependencies': { + 'bar': { + 'version': '1.0.0' + } + } + }, + 'lorem': { + 'version': '1.0.0', + 'extraneous': true, + 'problems': [ + 'extraneous: lorem@1.0.0 {CWD}/ls-ls-json-missing-package-json/node_modules/lorem' + ] + } + } + }, + 'should output json missing name/version of top-level package' + ) + t.end() + }) + }) + + t.test('extraneous deps', (t) => { + prefix = t.testdir({ + 'package.json': JSON.stringify({ + name: 'test-npm-ls', + version: '1.0.0', + dependencies: { + foo: '^1.0.0' + } + }), + ...simpleNmFixture + }) + ls([], (err) => { + t.equal( + redactCwd(err.message), + 'extraneous: lorem@1.0.0 {CWD}/ls-ls-json-extraneous-deps/node_modules/lorem', + 'should log extraneous dep as error' + ) + t.equal( + err.code, + 'ELSPROBLEMS', + 'should have ELSPROBLEMS error code' + ) + t.deepEqual( + jsonParse(result), + { + name: 'test-npm-ls', + version: '1.0.0', + 'problems': [ + 'extraneous: lorem@1.0.0 {CWD}/ls-ls-json-extraneous-deps/node_modules/lorem' + ], + 'dependencies': { + 'foo': { + 'version': '1.0.0', + 'dependencies': { + 'bar': { + 'version': '1.0.0' + } + } + }, + 'lorem': { + 'version': '1.0.0', + 'extraneous': true, + 'problems': [ + 'extraneous: lorem@1.0.0 {CWD}/ls-ls-json-extraneous-deps/node_modules/lorem' + ] + } + } + }, + 'should output json containing problems info' + ) + t.end() + }) + }) + + t.test('with filter arg', (t) => { + prefix = t.testdir({ + 'package.json': JSON.stringify({ + name: 'test-npm-ls', + version: '1.0.0', + dependencies: { + foo: '^1.0.0', + lorem: '^1.0.0' + } + }), + ...simpleNmFixture + }) + ls(['lorem'], (err) => { + t.ifError(err, 'npm ls') + t.deepEqual( + jsonParse(result), + { + name: 'test-npm-ls', + version: '1.0.0', + 'dependencies': { + 'lorem': { + 'version': '1.0.0' + } + } + }, + 'should output json contaning only occurences of filtered by package' + ) + t.end() + }) + }) + + t.test('with filter arg nested dep', (t) => { + prefix = t.testdir({ + 'package.json': JSON.stringify({ + name: 'test-npm-ls', + version: '1.0.0', + dependencies: { + foo: '^1.0.0', + lorem: '^1.0.0' + } + }), + ...simpleNmFixture + }) + ls(['bar'], (err) => { + t.ifError(err, 'npm ls') + t.deepEqual( + jsonParse(result), + { + name: 'test-npm-ls', + version: '1.0.0', + dependencies: { + foo: { + version: '1.0.0', + dependencies: { + bar: { + version: '1.0.0' + } + } + } + } + }, + 'should output json contaning only occurences of filtered by package' + ) + t.end() + }) + }) + + t.test('with multiple filter args', (t) => { + prefix = t.testdir({ + 'package.json': JSON.stringify({ + name: 'test-npm-ls', + version: '1.0.0', + dependencies: { + foo: '^1.0.0', + lorem: '^1.0.0', + ipsum: '^1.0.0' + } + }), + node_modules: { + ...simpleNmFixture.node_modules, + ipsum: { + 'package.json': JSON.stringify({ + name: 'ipsum', + version: '1.0.0' + }) + } + } + }) + ls(['bar@*', 'lorem@1.0.0'], (err) => { + t.ifError(err, 'npm ls') + t.deepEqual( + jsonParse(result), + { + 'version': '1.0.0', + 'name': 'test-npm-ls', + 'dependencies': { + 'foo': { + 'version': '1.0.0', + 'dependencies': { + 'bar': { + 'version': '1.0.0' + } + } + }, + 'lorem': { + 'version': '1.0.0' + } + } + }, + 'should output json contaning only occurences of multiple filtered packages and their ancestors' + ) + t.end() + }) + }) + + t.test('with missing filter arg', (t) => { + prefix = t.testdir({ + 'package.json': JSON.stringify({ + name: 'test-npm-ls', + version: '1.0.0', + dependencies: { + foo: '^1.0.0', + lorem: '^1.0.0' + } + }), + ...simpleNmFixture + }) + ls(['notadep'], (err) => { + t.ifError(err, 'npm ls') + t.deepEqual( + jsonParse(result), + { + name: 'test-npm-ls', + version: '1.0.0' + }, + 'should output json containing no dependencies info' + ) + t.equal( + process.exitCode, + 1, + 'should exit with error code 1' + ) + process.exitCode = 0 + t.end() + }) + }) + + t.test('default --depth value should now be 0', (t) => { + _flatOptions.all = false + _flatOptions.depth = undefined + prefix = t.testdir({ + 'package.json': JSON.stringify({ + name: 'test-npm-ls', + version: '1.0.0', + dependencies: { + foo: '^1.0.0', + lorem: '^1.0.0' + } + }), + ...simpleNmFixture + }) + ls([], (err) => { + t.ifError(err, 'npm ls') + t.deepEqual( + jsonParse(result), + { + name: 'test-npm-ls', + version: '1.0.0', + 'dependencies': { + 'foo': { + 'version': '1.0.0' + }, + 'lorem': { + 'version': '1.0.0' + } + } + }, + 'should output json containing only top-level dependencies' + ) + _flatOptions.all = true + _flatOptions.depth = Infinity + t.end() + }) + }) + + t.test('--depth=0', (t) => { + _flatOptions.all = false + _flatOptions.depth = 0 + prefix = t.testdir({ + 'package.json': JSON.stringify({ + name: 'test-npm-ls', + version: '1.0.0', + dependencies: { + foo: '^1.0.0', + lorem: '^1.0.0' + } + }), + ...simpleNmFixture + }) + ls([], (err) => { + t.ifError(err, 'npm ls') + t.deepEqual( + jsonParse(result), + { + name: 'test-npm-ls', + version: '1.0.0', + 'dependencies': { + 'foo': { + 'version': '1.0.0' + }, + 'lorem': { + 'version': '1.0.0' + } + } + }, + 'should output json containing only top-level dependencies' + ) + _flatOptions.all = true + _flatOptions.depth = Infinity + t.end() + }) + }) + + t.test('--depth=1', (t) => { + _flatOptions.all = false + _flatOptions.depth = 1 + prefix = t.testdir({ + 'package.json': JSON.stringify({ + name: 'test-npm-ls', + version: '1.0.0', + dependencies: { + foo: '^1.0.0', + lorem: '^1.0.0' + } + }), + ...simpleNmFixture + }) + ls([], (err) => { + t.ifError(err, 'npm ls') + t.deepEqual( + jsonParse(result), + { + name: 'test-npm-ls', + version: '1.0.0', + 'dependencies': { + 'foo': { + 'version': '1.0.0', + 'dependencies': { + 'bar': { + 'version': '1.0.0' + } + } + }, + 'lorem': { + 'version': '1.0.0' + } + } + }, + 'should output json containing top-level deps and their deps only' + ) + _flatOptions.all = true + _flatOptions.depth = Infinity + t.end() + }) + }) + + t.test('missing/invalid/extraneous', (t) => { + prefix = t.testdir({ + 'package.json': JSON.stringify({ + name: 'test-npm-ls', + version: '1.0.0', + dependencies: { + foo: '^2.0.0', + ipsum: '^1.0.0' + } + }), + ...simpleNmFixture + }) + ls([], (err) => { + t.match(err, { code: 'ELSPROBLEMS' }, 'should list dep problems') + t.deepEqual( + jsonParse(result), + { + 'name': 'test-npm-ls', + 'version': '1.0.0', + 'problems': [ + 'invalid: foo@1.0.0 {CWD}/ls-ls-json-missing-invalid-extraneous/node_modules/foo', + 'missing: ipsum@^1.0.0, required by test-npm-ls@1.0.0', + 'extraneous: lorem@1.0.0 {CWD}/ls-ls-json-missing-invalid-extraneous/node_modules/lorem' + ], + 'dependencies': { + 'foo': { + 'version': '1.0.0', + 'invalid': true, + 'problems': [ + 'invalid: foo@1.0.0 {CWD}/ls-ls-json-missing-invalid-extraneous/node_modules/foo' + ], + 'dependencies': { + 'bar': { + 'version': '1.0.0' + } + } + }, + 'lorem': { + 'version': '1.0.0', + 'extraneous': true, + 'problems': [ + 'extraneous: lorem@1.0.0 {CWD}/ls-ls-json-missing-invalid-extraneous/node_modules/lorem' + ] + }, + 'ipsum': { + 'required': '^1.0.0', + 'missing': true, + 'problems': [ + 'missing: ipsum@^1.0.0, required by test-npm-ls@1.0.0' + ] + } + } + }, + 'should output json containing top-level deps and their deps only' + ) + t.end() + }) + }) + + t.test('--dev', (t) => { + _flatOptions.dev = true + prefix = t.testdir({ + 'package.json': JSON.stringify({ + name: 'test-npm-ls', + version: '1.0.0', + dependencies: { + 'prod-dep': '^1.0.0', + 'lorem': '^1.0.0' + }, + devDependencies: { + 'dev-dep': '^1.0.0' + }, + optionalDependencies: { + 'optional-dep': '^1.0.0' + }, + peerDependencies: { + 'peer-dep': '^1.0.0' + } + }), + ...diffDepTypesNmFixture + }) + ls([], () => { + t.deepEqual( + jsonParse(result), + { + name: 'test-npm-ls', + version: '1.0.0', + dependencies: { + 'dev-dep': { + version: '1.0.0', + dependencies: { + foo: { + version: '1.0.0', + dependencies: { bar: { version: '1.0.0' } } + } + } + } + } + }, + 'should output json containing dev deps' + ) + _flatOptions.dev = false + t.end() + }) + }) + + t.test('--only=development', (t) => { + _flatOptions.only = 'development' + prefix = t.testdir({ + 'package.json': JSON.stringify({ + name: 'test-npm-ls', + version: '1.0.0', + dependencies: { + 'prod-dep': '^1.0.0', + 'lorem': '^1.0.0' + }, + devDependencies: { + 'dev-dep': '^1.0.0' + }, + optionalDependencies: { + 'optional-dep': '^1.0.0' + }, + peerDependencies: { + 'peer-dep': '^1.0.0' + } + }), + ...diffDepTypesNmFixture + }) + ls([], () => { + t.deepEqual( + jsonParse(result), + { + name: 'test-npm-ls', + version: '1.0.0', + dependencies: { + 'dev-dep': { + version: '1.0.0', + dependencies: { + foo: { + version: '1.0.0', + dependencies: { bar: { version: '1.0.0' } } + } + } + } + } + }, + 'should output json containing only development deps' + ) + _flatOptions.only = null + t.end() + }) + }) + + t.test('--link', (t) => { + _flatOptions.link = true + prefix = t.testdir({ + 'package.json': JSON.stringify({ + name: 'test-npm-ls', + version: '1.0.0', + dependencies: { + 'prod-dep': '^1.0.0', + 'lorem': '^1.0.0', + 'linked-dep': '^1.0.0' + }, + devDependencies: { + 'dev-dep': '^1.0.0' + }, + optionalDependencies: { + 'optional-dep': '^1.0.0' + }, + peerDependencies: { + 'peer-dep': '^1.0.0' + } + }), + 'linked-dep': { + 'package.json': JSON.stringify({ + name: 'linked-dep', + version: '1.0.0' + }) + }, + node_modules: { + 'linked-dep': t.fixture('symlink', '../linked-dep'), + ...diffDepTypesNmFixture.node_modules + } + }) + ls([], () => { + t.deepEqual( + jsonParse(result), + { + name: 'test-npm-ls', + version: '1.0.0', + dependencies: { + 'linked-dep': { + version: '1.0.0', + resolved: 'file:../linked-dep' + } + } + }, + 'should output json containing linked deps' + ) + _flatOptions.link = false + t.end() + }) + }) + + t.test('--production', (t) => { + _flatOptions.production = true + prefix = t.testdir({ + 'package.json': JSON.stringify({ + name: 'test-npm-ls', + version: '1.0.0', + dependencies: { + 'prod-dep': '^1.0.0', + 'lorem': '^1.0.0' + }, + devDependencies: { + 'dev-dep': '^1.0.0' + }, + optionalDependencies: { + 'optional-dep': '^1.0.0' + }, + peerDependencies: { + 'peer-dep': '^1.0.0' + } + }), + ...diffDepTypesNmFixture + }) + ls([], () => { + t.deepEqual( + jsonParse(result), + { + name: 'test-npm-ls', + version: '1.0.0', + dependencies: { + lorem: { version: '1.0.0' }, + 'optional-dep': { version: '1.0.0' }, + 'prod-dep': { version: '1.0.0', dependencies: { bar: { version: '2.0.0' } } } + } + }, + 'should output json containing production deps' + ) + _flatOptions.production = false + t.end() + }) + }) + + t.test('--only=prod', (t) => { + _flatOptions.only = 'prod' + prefix = t.testdir({ + 'package.json': JSON.stringify({ + name: 'test-npm-ls', + version: '1.0.0', + dependencies: { + 'prod-dep': '^1.0.0', + 'lorem': '^1.0.0' + }, + devDependencies: { + 'dev-dep': '^1.0.0' + }, + optionalDependencies: { + 'optional-dep': '^1.0.0' + }, + peerDependencies: { + 'peer-dep': '^1.0.0' + } + }), + ...diffDepTypesNmFixture + }) + ls([], () => { + t.deepEqual( + jsonParse(result), + { + name: 'test-npm-ls', + version: '1.0.0', + dependencies: { + lorem: { version: '1.0.0' }, + 'optional-dep': { version: '1.0.0' }, + 'prod-dep': { version: '1.0.0', dependencies: { bar: { version: '2.0.0' } } } + } + }, + 'should output json containing only prod deps' + ) + _flatOptions.only = null + t.end() + }) + }) + + t.test('from lockfile', (t) => { + prefix = t.testdir({ + node_modules: { + '@isaacs': { + 'dedupe-tests-a': { + 'package.json': JSON.stringify({ + name: '@isaacs/dedupe-tests-a', + version: '1.0.1' + }), + node_modules: { + '@isaacs': { + 'dedupe-tests-b': { + name: '@isaacs/dedupe-tests-b', + version: '1.0.0' + } + } + } + }, + 'dedupe-tests-b': { + 'package.json': JSON.stringify({ + name: '@isaacs/dedupe-tests-b', + version: '2.0.0' + }) + } + } + }, + 'package-lock.json': JSON.stringify({ + 'name': 'dedupe-lockfile', + 'version': '1.0.0', + 'lockfileVersion': 2, + 'requires': true, + 'packages': { + '': { + 'name': 'dedupe-lockfile', + 'version': '1.0.0', + 'dependencies': { + '@isaacs/dedupe-tests-a': '1.0.1', + '@isaacs/dedupe-tests-b': '1||2' + } + }, + 'node_modules/@isaacs/dedupe-tests-a': { + 'name': '@isaacs/dedupe-tests-a', + 'version': '1.0.1', + 'resolved': 'https://registry.npmjs.org/@isaacs/dedupe-tests-a/-/dedupe-tests-a-1.0.1.tgz', + 'integrity': 'sha512-8AN9lNCcBt5Xeje7fMEEpp5K3rgcAzIpTtAjYb/YMUYu8SbIVF6wz0WqACDVKvpQOUcSfNHZQNLNmue0QSwXOQ==', + 'dependencies': { + '@isaacs/dedupe-tests-b': '1' + } + }, + 'node_modules/@isaacs/dedupe-tests-a/node_modules/@isaacs/dedupe-tests-b': { + 'name': '@isaacs/dedupe-tests-b', + 'version': '1.0.0', + 'resolved': 'https://registry.npmjs.org/@isaacs/dedupe-tests-b/-/dedupe-tests-b-1.0.0.tgz', + 'integrity': 'sha512-3nmvzIb8QL8OXODzipwoV3U8h9OQD9g9RwOPuSBQqjqSg9JZR1CCFOWNsDUtOfmwY8HFUJV9EAZ124uhqVxq+w==' + }, + 'node_modules/@isaacs/dedupe-tests-b': { + 'name': '@isaacs/dedupe-tests-b', + 'version': '2.0.0', + 'resolved': 'https://registry.npmjs.org/@isaacs/dedupe-tests-b/-/dedupe-tests-b-2.0.0.tgz', + 'integrity': 'sha512-KTYkpRv9EzlmCg4Gsm/jpclWmRYFCXow8GZKJXjK08sIZBlElTZEa5Bw/UQxIvEfcKmWXczSqItD49Kr8Ax4UA==' + } + }, + 'dependencies': { + '@isaacs/dedupe-tests-a': { + 'version': '1.0.1', + 'resolved': 'https://registry.npmjs.org/@isaacs/dedupe-tests-a/-/dedupe-tests-a-1.0.1.tgz', + 'integrity': 'sha512-8AN9lNCcBt5Xeje7fMEEpp5K3rgcAzIpTtAjYb/YMUYu8SbIVF6wz0WqACDVKvpQOUcSfNHZQNLNmue0QSwXOQ==', + 'requires': { + '@isaacs/dedupe-tests-b': '1' + }, + 'dependencies': { + '@isaacs/dedupe-tests-b': { + 'version': '1.0.0', + 'resolved': 'https://registry.npmjs.org/@isaacs/dedupe-tests-b/-/dedupe-tests-b-1.0.0.tgz', + 'integrity': 'sha512-3nmvzIb8QL8OXODzipwoV3U8h9OQD9g9RwOPuSBQqjqSg9JZR1CCFOWNsDUtOfmwY8HFUJV9EAZ124uhqVxq+w==' + } + } + }, + '@isaacs/dedupe-tests-b': { + 'version': '2.0.0', + 'resolved': 'https://registry.npmjs.org/@isaacs/dedupe-tests-b/-/dedupe-tests-b-2.0.0.tgz', + 'integrity': 'sha512-KTYkpRv9EzlmCg4Gsm/jpclWmRYFCXow8GZKJXjK08sIZBlElTZEa5Bw/UQxIvEfcKmWXczSqItD49Kr8Ax4UA==' + } + } + }), + 'package.json': JSON.stringify({ + 'name': 'dedupe-lockfile', + 'version': '1.0.0', + 'dependencies': { + '@isaacs/dedupe-tests-a': '1.0.1', + '@isaacs/dedupe-tests-b': '1||2' + } + }) + }) + ls([], () => { + t.deepEqual( + jsonParse(result), + { + 'version': '1.0.0', + 'name': 'dedupe-lockfile', + 'dependencies': { + '@isaacs/dedupe-tests-a': { + 'version': '1.0.1', + 'resolved': 'https://registry.npmjs.org/@isaacs/dedupe-tests-a/-/dedupe-tests-a-1.0.1.tgz', + 'dependencies': { + '@isaacs/dedupe-tests-b': { + 'resolved': 'https://registry.npmjs.org/@isaacs/dedupe-tests-b/-/dedupe-tests-b-1.0.0.tgz', + 'extraneous': true, + 'problems': [ + 'extraneous: @isaacs/dedupe-tests-b@ {CWD}/ls-ls-json-from-lockfile/node_modules/@isaacs/dedupe-tests-a/node_modules/@isaacs/dedupe-tests-b' + ] + } + } + }, + '@isaacs/dedupe-tests-b': { + 'version': '2.0.0', + 'resolved': 'https://registry.npmjs.org/@isaacs/dedupe-tests-b/-/dedupe-tests-b-2.0.0.tgz' + } + }, + 'problems': [ + 'extraneous: @isaacs/dedupe-tests-b@ {CWD}/ls-ls-json-from-lockfile/node_modules/@isaacs/dedupe-tests-a/node_modules/@isaacs/dedupe-tests-b' + ] + }, + 'should output json containing only prod deps' + ) + t.end() + }) + }) + + t.test('--long', (t) => { + _flatOptions.long = true + prefix = t.testdir({ + 'package.json': JSON.stringify({ + name: 'test-npm-ls', + version: '1.0.0', + dependencies: { + 'prod-dep': '^1.0.0', + 'lorem': '^1.0.0' + }, + devDependencies: { + 'dev-dep': '^1.0.0' + }, + optionalDependencies: { + 'optional-dep': '^1.0.0' + }, + peerDependencies: { + 'peer-dep': '^1.0.0' + } + }), + ...diffDepTypesNmFixture + }) + ls([], () => { + t.deepEqual( + jsonParse(result), + { + name: 'test-npm-ls', + version: '1.0.0', + dependencies: { + 'peer-dep': { + name: 'peer-dep', + description: 'Peer-dep description here', + version: '1.0.0', + _id: 'peer-dep@1.0.0', + devDependencies: {}, + peerDependencies: {}, + _dependencies: {}, + path: '{CWD}/ls-ls-json--long/node_modules/peer-dep', + extraneous: false + }, + 'dev-dep': { + name: 'dev-dep', + description: 'A DEV dep kind of dep', + version: '1.0.0', + dependencies: { + foo: { + name: 'foo', + version: '1.0.0', + dependencies: { + bar: { + name: 'bar', + version: '1.0.0', + _id: 'bar@1.0.0', + devDependencies: {}, + peerDependencies: {}, + _dependencies: {}, + path: '{CWD}/ls-ls-json--long/node_modules/bar', + extraneous: false + } + }, + _id: 'foo@1.0.0', + devDependencies: {}, + peerDependencies: {}, + _dependencies: { bar: '^1.0.0' }, + path: '{CWD}/ls-ls-json--long/node_modules/foo', + extraneous: false + } + }, + _id: 'dev-dep@1.0.0', + devDependencies: {}, + peerDependencies: {}, + _dependencies: { foo: '^1.0.0' }, + path: '{CWD}/ls-ls-json--long/node_modules/dev-dep', + extraneous: false + }, + lorem: { + name: 'lorem', + version: '1.0.0', + _id: 'lorem@1.0.0', + devDependencies: {}, + peerDependencies: {}, + _dependencies: {}, + path: '{CWD}/ls-ls-json--long/node_modules/lorem', + extraneous: false + }, + 'optional-dep': { + name: 'optional-dep', + description: 'Maybe a dep?', + version: '1.0.0', + _id: 'optional-dep@1.0.0', + devDependencies: {}, + peerDependencies: {}, + _dependencies: {}, + path: '{CWD}/ls-ls-json--long/node_modules/optional-dep', + extraneous: false + }, + 'prod-dep': { + name: 'prod-dep', + description: 'A PROD dep kind of dep', + version: '1.0.0', + dependencies: { + bar: { + name: 'bar', + description: 'A dep that bars', + version: '2.0.0', + _id: 'bar@2.0.0', + devDependencies: {}, + peerDependencies: {}, + _dependencies: {}, + path: '{CWD}/ls-ls-json--long/node_modules/prod-dep/node_modules/bar', + extraneous: false + } + }, + _id: 'prod-dep@1.0.0', + devDependencies: {}, + peerDependencies: {}, + _dependencies: { bar: '^2.0.0' }, + path: '{CWD}/ls-ls-json--long/node_modules/prod-dep', + extraneous: false + } + }, + devDependencies: { 'dev-dep': '^1.0.0' }, + optionalDependencies: { 'optional-dep': '^1.0.0' }, + peerDependencies: { 'peer-dep': '^1.0.0' }, + _id: 'test-npm-ls@1.0.0', + _dependencies: { 'prod-dep': '^1.0.0', lorem: '^1.0.0', 'optional-dep': '^1.0.0' }, + path: '{CWD}/ls-ls-json--long', + extraneous: false + }, + 'should output long json info' + ) + _flatOptions.long = true + t.end() + }) + }) + + t.test('--long --depth=0', (t) => { + _flatOptions.all = false + _flatOptions.depth = 0 + _flatOptions.long = true + prefix = t.testdir({ + 'package.json': JSON.stringify({ + name: 'test-npm-ls', + version: '1.0.0', + dependencies: { + 'prod-dep': '^1.0.0', + 'lorem': '^1.0.0' + }, + devDependencies: { + 'dev-dep': '^1.0.0' + }, + optionalDependencies: { + 'optional-dep': '^1.0.0' + }, + peerDependencies: { + 'peer-dep': '^1.0.0' + } + }), + ...diffDepTypesNmFixture + }) + ls([], () => { + t.deepEqual( + jsonParse(result), + { + name: 'test-npm-ls', + version: '1.0.0', + dependencies: { + 'peer-dep': { + name: 'peer-dep', + description: 'Peer-dep description here', + version: '1.0.0', + _id: 'peer-dep@1.0.0', + devDependencies: {}, + peerDependencies: {}, + _dependencies: {}, + path: '{CWD}/ls-ls-json--long-depth-0/node_modules/peer-dep', + extraneous: false + }, + 'dev-dep': { + name: 'dev-dep', + description: 'A DEV dep kind of dep', + version: '1.0.0', + _id: 'dev-dep@1.0.0', + devDependencies: {}, + peerDependencies: {}, + _dependencies: { foo: '^1.0.0' }, + path: '{CWD}/ls-ls-json--long-depth-0/node_modules/dev-dep', + extraneous: false + }, + lorem: { + name: 'lorem', + version: '1.0.0', + _id: 'lorem@1.0.0', + devDependencies: {}, + peerDependencies: {}, + _dependencies: {}, + path: '{CWD}/ls-ls-json--long-depth-0/node_modules/lorem', + extraneous: false + }, + 'optional-dep': { + name: 'optional-dep', + description: 'Maybe a dep?', + version: '1.0.0', + _id: 'optional-dep@1.0.0', + devDependencies: {}, + peerDependencies: {}, + _dependencies: {}, + path: '{CWD}/ls-ls-json--long-depth-0/node_modules/optional-dep', + extraneous: false + }, + 'prod-dep': { + name: 'prod-dep', + description: 'A PROD dep kind of dep', + version: '1.0.0', + _id: 'prod-dep@1.0.0', + devDependencies: {}, + peerDependencies: {}, + _dependencies: { bar: '^2.0.0' }, + path: '{CWD}/ls-ls-json--long-depth-0/node_modules/prod-dep', + extraneous: false + } + }, + devDependencies: { 'dev-dep': '^1.0.0' }, + optionalDependencies: { 'optional-dep': '^1.0.0' }, + peerDependencies: { 'peer-dep': '^1.0.0' }, + _id: 'test-npm-ls@1.0.0', + _dependencies: { 'prod-dep': '^1.0.0', lorem: '^1.0.0', 'optional-dep': '^1.0.0' }, + path: '{CWD}/ls-ls-json--long-depth-0', + extraneous: false + }, + 'should output json containing top-level deps in long format' + ) + _flatOptions.all = true + _flatOptions.depth = Infinity + _flatOptions.long = false + t.end() + }) + }) + + t.test('json read problems', (t) => { + prefix = t.testdir({ + 'package.json': '{broken json' + }) + ls([], (err) => { + t.match(err.message, 'Failed to parse root package.json', 'should have missin root package.json msg') + t.match(err.code, 'EJSONPARSE', 'should have EJSONPARSE error code') + t.deepEqual( + jsonParse(result), + { + invalid: true, + problems: [ + 'error in {CWD}/ls-ls-json-json-read-problems: Failed to parse root package.json' + ] + }, + 'should print empty json result' + ) + t.end() + }) + }) + + t.test('empty location', (t) => { + prefix = t.testdir({}) + ls([], (err) => { + t.ifError(err, 'should not error out on empty locations') + t.deepEqual( + jsonParse(result), + {}, + 'should print empty json result' + ) + t.end() + }) + }) + + t.test('unmet peer dep', (t) => { + prefix = t.testdir({ + 'package.json': JSON.stringify({ + name: 'test-npm-ls', + version: '1.0.0', + dependencies: { + 'prod-dep': '^1.0.0', + 'lorem': '^1.0.0' + }, + devDependencies: { + 'dev-dep': '^1.0.0' + }, + optionalDependencies: { + 'optional-dep': '^1.0.0' + }, + peerDependencies: { + 'peer-dep': '^2.0.0' // mismatching version # + } + }), + ...diffDepTypesNmFixture + }) + ls([], (err) => { + t.match(err.code, 'ELSPROBLEMS', 'Should have ELSPROBLEMS error code') + t.deepEqual( + jsonParse(result), + { + name: 'test-npm-ls', + version: '1.0.0', + problems: [ + 'invalid: peer-dep@1.0.0 {CWD}/ls-ls-json-unmet-peer-dep/node_modules/peer-dep' + ], + dependencies: { + 'peer-dep': { + version: '1.0.0', + invalid: true, + problems: [ + 'invalid: peer-dep@1.0.0 {CWD}/ls-ls-json-unmet-peer-dep/node_modules/peer-dep' + ] + }, + 'dev-dep': { + version: '1.0.0', + dependencies: { + foo: { + version: '1.0.0', + dependencies: { bar: { version: '1.0.0' } } + } + } + }, + lorem: { version: '1.0.0' }, + 'optional-dep': { version: '1.0.0' }, + 'prod-dep': { version: '1.0.0', dependencies: { bar: { version: '2.0.0' } } } + } + }, + 'should output json signaling missing peer dep in problems' + ) + t.end() + }) + }) + + t.test('unmet optional dep', (t) => { + prefix = t.testdir({ + 'package.json': JSON.stringify({ + name: 'test-npm-ls', + version: '1.0.0', + dependencies: { + 'prod-dep': '^1.0.0', + 'lorem': '^1.0.0' + }, + devDependencies: { + 'dev-dep': '^1.0.0' + }, + optionalDependencies: { + 'missing-optional-dep': '^1.0.0', + 'optional-dep': '^2.0.0' // mismatching version # + }, + peerDependencies: { + 'peer-dep': '^1.0.0' + } + }), + ...diffDepTypesNmFixture + }) + ls([], (err) => { + t.match(err.code, 'ELSPROBLEMS', 'should have ELSPROBLEMS error code') + t.match(err.message, /invalid: optional-dep@1.0.0/, 'should have invalid dep error msg') + t.deepEqual( + jsonParse(result), + { + name: 'test-npm-ls', + version: '1.0.0', + problems: [ + 'invalid: optional-dep@1.0.0 {CWD}/ls-ls-json-unmet-optional-dep/node_modules/optional-dep' // mismatching optional deps get flagged in problems + ], + dependencies: { + 'optional-dep': { + version: '1.0.0', + invalid: true, + problems: [ + 'invalid: optional-dep@1.0.0 {CWD}/ls-ls-json-unmet-optional-dep/node_modules/optional-dep' + ] + }, + 'peer-dep': { + version: '1.0.0' + }, + 'dev-dep': { + version: '1.0.0', + dependencies: { + foo: { + version: '1.0.0', + dependencies: { bar: { version: '1.0.0' } } + } + } + }, + lorem: { version: '1.0.0' }, + 'prod-dep': { version: '1.0.0', dependencies: { bar: { version: '2.0.0' } } }, + 'missing-optional-dep': {} // missing optional dep has an empty entry in json output + } + }, + 'should output json with empty entry for missing optional deps' + ) + t.end() + }) + }) + + t.test('cycle deps', (t) => { + prefix = t.testdir({ + 'package.json': JSON.stringify({ + name: 'test-npm-ls', + version: '1.0.0', + dependencies: { + 'a': '^1.0.0' + } + }), + node_modules: { + 'a': { + 'package.json': JSON.stringify({ + name: 'a', + version: '1.0.0', + dependencies: { + b: '^1.0.0' + } + }) + }, + 'b': { + 'package.json': JSON.stringify({ + name: 'b', + version: '1.0.0', + dependencies: { + a: '^1.0.0' + } + }) + } + } + }) + ls([], () => { + t.deepEqual( + jsonParse(result), + { + name: 'test-npm-ls', + version: '1.0.0', + dependencies: { + a: { + version: '1.0.0', + dependencies: { + b: { + version: '1.0.0', + dependencies: { + a: { version: '1.0.0' } + } + } + } + } + } + }, + 'should print json output containing deduped ref' + ) + t.end() + }) + }) + + t.test('using aliases', (t) => { + prefix = t.testdir({ + 'package.json': JSON.stringify({ + name: 'test-npm-ls', + version: '1.0.0', + dependencies: { + a: 'npm:b@1.0.0' + } + }), + node_modules: { + 'a': { + 'package.json': JSON.stringify({ + name: 'b', + version: '1.0.0', + _from: 'a@npm:b', + _resolved: 'https://localhost:8080/abbrev/-/abbrev-1.1.1.tgz', + _requested: { + type: 'alias' + } + }) + } + } + }) + ls([], () => { + t.deepEqual( + jsonParse(result), + { + name: 'test-npm-ls', + version: '1.0.0', + dependencies: { + a: { + version: '1.0.0', + resolved: 'https://localhost:8080/abbrev/-/abbrev-1.1.1.tgz' + } + } + }, + 'should output json containing aliases' + ) + t.end() + }) + }) + + t.test('resolved points to git ref', (t) => { + prefix = t.testdir({ + 'package.json': JSON.stringify({ + name: 'test-npm-ls', + version: '1.0.0', + dependencies: { + 'abbrev': 'git+https://github.com/isaacs/abbrev-js.git' + } + }), + node_modules: { + 'abbrev': { + 'package.json': JSON.stringify({ + name: 'abbrev', + version: '1.1.1', + _id: 'abbrev@1.1.1', + _from: 'git+https://github.com/isaacs/abbrev-js.git', + _resolved: 'git+https://github.com/isaacs/abbrev-js.git#b8f3a2fc0c3bb8ffd8b0d0072cc6b5a3667e963c', + _requested: { + type: 'git', + raw: 'git+https:github.com/isaacs/abbrev-js.git', + rawSpec: 'git+https:github.com/isaacs/abbrev-js.git', + saveSpec: 'git+https://github.com/isaacs/abbrev-js.git', + fetchSpec: 'https://github.com/isaacs/abbrev-js.git', + gitCommittish: null + } + }) + } + } + }) + ls([], () => { + t.deepEqual( + jsonParse(result), + { + name: 'test-npm-ls', + version: '1.0.0', + dependencies: { + abbrev: { + version: '1.1.1', + resolved: 'git+ssh://git@github.com/isaacs/abbrev-js.git#b8f3a2fc0c3bb8ffd8b0d0072cc6b5a3667e963c' + } + } + }, + 'should output json containing git refs' + ) + t.end() + }) + }) + + t.test('from and resolved properties', (t) => { + prefix = t.testdir({ + 'package.json': JSON.stringify({ + name: 'test-npm-ls', + version: '1.0.0', + dependencies: { + 'simple-output': '^2.0.0' + } + }), + node_modules: { + 'simple-output': { + 'package.json': JSON.stringify({ + name: 'simple-output', + version: '2.1.1', + _from: 'simple-output', + _id: 'simple-output@2.1.1', + _resolved: 'https://registry.npmjs.org/simple-output/-/simple-output-2.1.1.tgz', + _requested: { + type: 'tag', + registry: true, + raw: 'simple-output', + name: 'simple-output', + escapedName: 'simple-output', + rawSpec: '', + saveSpec: null, + fetchSpec: 'latest' + }, + _requiredBy: [ + '#USER', + '/' + ], + _shasum: '3c07708ec9ef3e3c985cf0ddd67df09ab8ec2abc', + _spec: 'simple-output' + }) + } + } + }) + ls([], () => { + t.deepEqual( + jsonParse(result), + { + name: 'test-npm-ls', + version: '1.0.0', + dependencies: { + 'simple-output': { + version: '2.1.1', + resolved: 'https://registry.npmjs.org/simple-output/-/simple-output-2.1.1.tgz' + } + } + }, + 'should be printed in json output' + ) + t.end() + }) + }) + + t.test('node.name fallback if missing root package name', (t) => { + prefix = t.testdir({ + 'package.json': JSON.stringify({ + version: '1.0.0' + }) + }) + ls([], () => { + t.deepEqual( + jsonParse(result), + { + 'version': '1.0.0', + 'name': 'ls-ls-json-node-name-fallback-if-missing-root-package-name' + }, + 'should use node.name as key in json result obj' + ) + t.end() + }) + }) + + t.test('global', (t) => { + _flatOptions.global = true + const fixtures = t.testdir({ + node_modules: { + a: { + 'package.json': JSON.stringify({ + name: 'a', + version: '1.0.0' + }) + }, + b: { + 'package.json': JSON.stringify({ + name: 'b', + version: '1.0.0' + }), + node_modules: { + c: { + 'package.json': JSON.stringify({ + name: 'c', + version: '1.0.0' + }) + } + } + } + } + }) + + // mimics lib/npm.js globalDir getter but pointing to fixtures + globalDir = resolve(fixtures, 'node_modules') + + ls([], () => { + t.deepEqual( + jsonParse(result), + { + 'dependencies': { + 'a': { + 'version': '1.0.0' + }, + 'b': { + 'version': '1.0.0', + 'dependencies': { + 'c': { + 'version': '1.0.0' + } + } + } + } + }, + 'should print json output for global deps' + ) + globalDir = 'MISSING_GLOBAL_DIR' + _flatOptions.global = false + t.end() + }) + }) + + t.end() +}) diff --git a/deps/npm/test/lib/npm.js b/deps/npm/test/lib/npm.js new file mode 100644 index 00000000000000..2968178495907d --- /dev/null +++ b/deps/npm/test/lib/npm.js @@ -0,0 +1,346 @@ +'use strict' +const t = require('tap') +const fs = require('fs') + +// delete this so that we don't have configs from the fact that it +// is being run by 'npm test' +for (const env of Object.keys(process.env).filter(e => /^npm_/.test(e))) { + delete process.env[env] +} + +const { resolve } = require('path') + +const actualPlatform = process.platform + +const beWindows = () => { + Object.defineProperty(process, 'platform', { + value: 'win32', + configurable: true + }) +} + +const bePosix = () => { + Object.defineProperty(process, 'platform', { + value: 'posix', + configurable: true + }) +} + +const npmlog = require('npmlog') + +const npmPath = resolve(__dirname, '..', '..') +const Config = require('@npmcli/config') +const { types, defaults, shorthands } = require('../../lib/utils/config.js') +const freshConfig = (opts = {}) => { + for (const env of Object.keys(process.env).filter(e => /^npm_/.test(e))) { + delete process.env[env] + } + process.env.npm_config_cache = CACHE + + npm.config = new Config({ + types, + defaults, + shorthands, + npmPath, + log: npmlog, + ...opts + }) +} + +const logs = [] +for (const level of ['silly', 'verbose', 'timing', 'notice', 'warn', 'error']) { + npmlog[level] = (...msg) => logs.push([level, ...msg]) +} + +const npm = require('../../lib/npm.js') + +const CACHE = t.testdir() +process.env.npm_config_cache = CACHE + +t.test('not yet loaded', t => { + t.match(npm, { + started: Number, + command: null, + config: { + loaded: false, + get: Function, + set: Function + }, + version: String, + }) + t.throws(() => npm.config.set('foo', 'bar')) + t.throws(() => npm.config.get('foo')) + const list = npm.commands.list + t.throws(() => npm.commands.list()) + t.equal(npm.commands.ls, list) + t.equal(npm.commands.list, list) + t.equal(npm.commands.asdfasdf, undefined) + t.equal(npm.deref('list'), 'ls') + t.same(logs, []) + logs.length = 0 + t.end() +}) + +t.test('npm.load', t => { + t.test('must be called with proper args', t => { + const er = new TypeError('must call as: npm.load(callback)') + t.throws(() => npm.load(), er) + t.throws(() => npm.load({}), er) + t.same(logs, []) + logs.length = 0 + t.end() + }) + + t.test('load error', t => { + const { load } = npm.config + const loadError = new Error('load error') + npm.config.load = async () => { throw loadError } + npm.load(er => { + t.equal(er, loadError) + t.equal(npm.loadErr, loadError) + npm.config.load = load + // loading again just returns the same error + npm.load(er => { + t.equal(er, loadError) + t.equal(npm.loadErr, loadError) + npm.loadErr = null + t.end() + }) + }) + }) + + t.test('basic loading', t => { + const dir = t.testdir({ + node_modules: {} + }) + let firstCalled = false + const first = (er) => { + if (er) { + throw er + } + firstCalled = true + t.equal(npm.loaded, true) + t.equal(npm.config.loaded, true) + t.equal(npm.config.get('force'), false) + } + + let secondCalled = false + const second = () => { secondCalled = true } + + t.equal(npm.loading, false, 'not loading yet') + const p = npm.load(first).then(() => { + npm.config.set('prefix', dir) + t.match(npm, { + loaded: true, + loading: false, + flatOptions: {} + }) + t.equal(firstCalled, true, 'first callback got called') + t.equal(secondCalled, true, 'second callback got called') + let thirdCalled = false + const third = () => { thirdCalled = true } + npm.load(third) + t.equal(thirdCalled, true, 'third callbback got called') + t.match(logs, [ + ['timing', 'npm:load', /Completed in [0-9]+ms/] + ]) + logs.length = 0 + + bePosix() + t.equal(resolve(npm.cache), resolve(CACHE), 'cache is cache') + const newCache = t.testdir() + npm.cache = newCache + t.equal(npm.config.get('cache'), newCache, 'cache setter sets config') + t.equal(npm.cache, newCache, 'cache getter gets new config') + t.equal(npm.log, npmlog, 'npmlog getter') + t.equal(npm.lockfileVersion, 2, 'lockfileVersion getter') + t.equal(npm.prefix, npm.localPrefix, 'prefix is local prefix') + t.notEqual(npm.prefix, npm.globalPrefix, 'prefix is not global prefix') + npm.globalPrefix = npm.prefix + t.equal(npm.prefix, npm.globalPrefix, 'globalPrefix setter') + npm.localPrefix = dir + '/extra/prefix' + t.equal(npm.prefix, npm.localPrefix, 'prefix is local prefix after localPrefix setter') + t.notEqual(npm.prefix, npm.globalPrefix, 'prefix is not global prefix after localPrefix setter') + + npm.prefix = dir + '/some/prefix' + t.equal(npm.prefix, npm.localPrefix, 'prefix is local prefix after prefix setter') + t.notEqual(npm.prefix, npm.globalPrefix, 'prefix is not global prefix after prefix setter') + t.equal(npm.bin, npm.localBin, 'bin is local bin after prefix setter') + t.notEqual(npm.bin, npm.globalBin, 'bin is not global bin after prefix setter') + t.equal(npm.dir, npm.localDir, 'dir is local dir after prefix setter') + t.notEqual(npm.dir, npm.globalDir, 'dir is not global dir after prefix setter') + + npm.config.set('global', true) + t.equal(npm.prefix, npm.globalPrefix, 'prefix is global prefix after setting global') + t.notEqual(npm.prefix, npm.localPrefix, 'prefix is not local prefix after setting global') + t.equal(npm.bin, npm.globalBin, 'bin is global bin after setting global') + t.notEqual(npm.bin, npm.localBin, 'bin is not local bin after setting global') + t.equal(npm.dir, npm.globalDir, 'dir is global dir after setting global') + t.notEqual(npm.dir, npm.localDir, 'dir is not local dir after setting global') + + npm.prefix = dir + '/new/global/prefix' + t.equal(npm.prefix, npm.globalPrefix, 'prefix is global prefix after prefix setter') + t.notEqual(npm.prefix, npm.localPrefix, 'prefix is not local prefix after prefix setter') + t.equal(npm.bin, npm.globalBin, 'bin is global bin after prefix setter') + t.notEqual(npm.bin, npm.localBin, 'bin is not local bin after prefix setter') + + t.equal(npm.config.get('metrics-registry'), npm.config.get('registry')) + + beWindows() + t.equal(npm.bin, npm.globalBin, 'bin is global bin in windows mode') + t.equal(npm.dir, npm.globalDir, 'dir is global dir in windows mode') + bePosix() + + const tmp = npm.tmp + t.match(tmp, String, 'npm.tmp is a string') + t.equal(tmp, npm.tmp, 'getter only generates it once') + }) + + t.equal(npm.loaded, false, 'not loaded yet') + t.equal(npm.loading, true, 'working on it tho') + t.isa(p, Promise, 'npm.load() returned a Promise first time') + t.equal(npm.load(second), undefined, + 'npm.load() returns nothing second time') + + return p + }) + + t.test('forceful loading', t => { + // also, don't get thrown off if argv[0] isn't found for some reason + const [ argv0 ] = process.argv + t.teardown(() => { + process.argv[0] = argv0 + }) + freshConfig({ argv: [...process.argv, '--force', '--color', 'always'] }) + process.argv[0] = 'this exe does not exist or else this test will fail' + return npm.load(er => { + if (er) { + throw er + } + t.match(logs.filter(l => l[0] !== 'timing'), [ + [ + 'warn', + 'using --force', + 'Recommended protections disabled.' + ] + ]) + logs.length = 0 + }) + }) + + t.test('node is a symlink', async t => { + const node = actualPlatform === 'win32' ? 'node.exe' : 'node' + const dir = t.testdir({ + '.npmrc': 'foo = bar' + }) + + // create manually to set the 'file' option in windows + fs.symlinkSync(process.execPath, resolve(dir, node), 'file') + + const PATH = process.env.PATH || process.env.Path + process.env.PATH = dir + const { execPath, argv: processArgv } = process + process.argv = [ + node, + process.argv[1], + '--metrics-registry', 'http://example.com', + '--prefix', dir, + '--userconfig', `${dir}/.npmrc`, + '--usage', + '--scope=foo' + ] + + freshConfig() + const { log } = console + const consoleLogs = [] + console.log = (...msg) => consoleLogs.push(msg) + + t.teardown(() => { + console.log = log + process.env.PATH = PATH + process.argv = processArgv + freshConfig() + logs.length = 0 + process.execPath = execPath + }) + + logs.length = 0 + + await npm.load(er => { + if (er) { + throw er + } + t.equal(npm.config.get('scope'), '@foo', 'added the @ sign to scope') + t.equal(npm.config.get('metrics-registry'), 'http://example.com') + t.match(logs.filter(l => l[0] !== 'timing' || !/^config:/.test(l[1])), [ + [ + 'verbose', + 'node symlink', + resolve(dir, node) + ], + [ + 'timing', + 'npm:load', + /Completed in [0-9]+ms/, + ], + ]) + logs.length = 0 + t.equal(process.execPath, resolve(dir, node)) + }) + + await npm.commands.ll([], (er) => { + if (er) { + throw er + } + t.same(consoleLogs, [[require('../../lib/ls.js').usage]], 'print usage') + consoleLogs.length = 0 + npm.config.set('usage', false) + t.equal(npm.commands.ll, npm.commands.la, 'same command, different name') + logs.length = 0 + }) + + await npm.commands.get(['scope', '\u2010not-a-dash'], (er) => { + if (er) { + throw er + } + t.match(logs, [ + [ + 'error', + 'arg', + 'Argument starts with non-ascii dash, this is probably invalid:', + '\u2010not-a-dash', + ], + [ + 'timing', + 'command:config', + /Completed in [0-9]+ms/, + ], + [ + 'timing', + 'command:get', + /Completed in [0-9]+ms/, + ], + ]) + t.same(consoleLogs, [['@foo']]) + }) + + // need this here or node 10 will improperly end the promise ahead of time + await new Promise((res) => setTimeout(res)) + }) + + t.end() +}) + +t.test('loading as main will load the cli', t => { + const { spawn } = require('child_process') + const npm = require.resolve('../../lib/npm.js') + const p = spawn(process.execPath, [npm, 'ls', '-h']) + const out = [] + p.stdout.on('data', c => out.push(c)) + p.on('close', (code, signal) => { + t.equal(code, 0) + t.equal(signal, null) + t.equal(Buffer.concat(out).toString().trim(), require('../../lib/ls.js').usage) + t.end() + }) +}) diff --git a/deps/npm/test/lib/outdated.js b/deps/npm/test/lib/outdated.js new file mode 100644 index 00000000000000..0cba04d5471304 --- /dev/null +++ b/deps/npm/test/lib/outdated.js @@ -0,0 +1,425 @@ +const t = require('tap') +const requireInject = require('require-inject') + +const packument = spec => { + const mocks = { + alpha: { + name: 'alpha', + 'dist-tags': { + latest: '1.0.1' + }, + versions: { + '1.0.1': { + version: '1.0.1', + dependencies: { + gamma: '2.0.0' + } + } + } + }, + beta: { + name: 'beta', + 'dist-tags': { + latest: '1.0.1' + }, + versions: { + '1.0.1': { + version: '1.0.1' + } + } + }, + gamma: { + name: 'gamma', + 'dist-tags': { + latest: '2.0.0' + }, + versions: { + '1.0.1': { + version: '1.0.1' + }, + '2.0.0': { + version: '2.0.0' + } + } + }, + theta: { + name: 'theta', + 'dist-tags': { + latest: '1.0.1' + }, + versions: { + '1.0.1': { + version: '1.0.1' + } + } + } + } + + if (spec.name === 'eta') { + throw new Error('There is an error with this package.') + } + + if (!mocks[spec.name]) { + const err = new Error() + err.code = 'E404' + throw err + } + + return mocks[spec.name] +} + +let logs +const cleanLogs = (done) => { + logs = '' + const fn = (...args) => { + logs += '\n' + args.map(el => { + logs += el + return logs + }) + } + console.log = fn + done() +} + +const globalDir = t.testdir({ + node_modules: { + alpha: { + 'package.json': JSON.stringify({ + name: 'alpha', + version: '1.0.0' + }, null, 2) + } + } +}) + +const outdated = (dir, opts) => requireInject( + '../../lib/outdated.js', + { + '../../lib/npm.js': { + prefix: dir, + globalDir: `${globalDir}/node_modules`, + flatOptions: opts + }, + pacote: { + packument + } + } +) + +t.beforeEach(cleanLogs) + +const redactCwd = (path) => { + const normalizePath = p => p + .replace(/\\+/g, '/') + .replace(/\r\n/g, '\n') + return normalizePath(path) + .replace(new RegExp(normalizePath(process.cwd()), 'g'), '{CWD}') +} + +t.cleanSnapshot = (str) => redactCwd(str) + +t.test('should display outdated deps', t => { + const testDir = t.testdir({ + 'package.json': JSON.stringify({ + name: 'delta', + version: '1.0.0', + dependencies: { + alpha: '^1.0.0', + gamma: '^1.0.0', + theta: '^1.0.0' + }, + devDependencies: { + zeta: '^1.0.0' + }, + peerDependencies: { + beta: '^1.0.0' + } + }, null, 2), + node_modules: { + alpha: { + 'package.json': JSON.stringify({ + name: 'alpha', + version: '1.0.0', + dependencies: { + gamma: '2.0.0' + } + }, null, 2), + node_modules: { + gamma: { + 'package.json': JSON.stringify({ + name: 'gamma', + version: '2.0.0' + }, null, 2) + } + } + }, + beta: { + 'package.json': JSON.stringify({ + name: 'beta', + version: '1.0.0' + }, null, 2) + }, + gamma: { + 'package.json': JSON.stringify({ + name: 'gamma', + version: '1.0.1' + }, null, 2) + }, + zeta: { + 'package.json': JSON.stringify({ + name: 'zeta', + version: '1.0.0' + }, null, 2) + } + } + }) + + t.test('outdated global', t => { + outdated(null, { + global: true + })([], () => { + t.matchSnapshot(logs) + t.end() + }) + }) + + t.test('outdated', t => { + outdated(testDir, { + global: false, + color: true + })([], () => { + t.matchSnapshot(logs) + t.end() + }) + }) + + t.test('outdated --omit=dev', t => { + outdated(testDir, { + global: false, + color: true, + omit: ['dev'] + })([], () => { + t.matchSnapshot(logs) + t.end() + }) + }) + + t.test('outdated --omit=dev --omit=peer', t => { + outdated(testDir, { + global: false, + color: true, + omit: ['dev', 'peer'] + })([], () => { + t.matchSnapshot(logs) + t.end() + }) + }) + + t.test('outdated --omit=prod', t => { + outdated(testDir, { + global: false, + color: true, + omit: ['prod'] + })([], () => { + t.matchSnapshot(logs) + t.end() + }) + }) + + t.test('outdated --long', t => { + outdated(testDir, { + global: false, + long: true + })([], () => { + t.matchSnapshot(logs) + t.end() + }) + }) + + t.test('outdated --json', t => { + outdated(testDir, { + global: false, + json: true + })([], () => { + t.matchSnapshot(logs) + t.end() + }) + }) + + t.test('outdated --json --long', t => { + outdated(testDir, { + global: false, + json: true, + long: true + })([], () => { + t.matchSnapshot(logs) + t.end() + }) + }) + + t.test('outdated --parseable', t => { + outdated(testDir, { + global: false, + parseable: true + })([], () => { + t.matchSnapshot(logs) + t.end() + }) + }) + + t.test('outdated --parseable --long', t => { + outdated(testDir, { + global: false, + parseable: true, + long: true + })([], () => { + t.matchSnapshot(logs) + t.end() + }) + }) + + t.test('outdated --all', t => { + outdated(testDir, { + all: true + })([], () => { + t.matchSnapshot(logs) + t.end() + }) + }) + + t.test('outdated specific dep', t => { + outdated(testDir, { + global: false + })(['alpha'], () => { + t.matchSnapshot(logs) + t.end() + }) + }) + + t.end() +}) + +t.test('should return if no outdated deps', t => { + const testDir = t.testdir({ + 'package.json': JSON.stringify({ + name: 'delta', + version: '1.0.0', + dependencies: { + alpha: '^1.0.0' + } + }, null, 2), + node_modules: { + alpha: { + 'package.json': JSON.stringify({ + name: 'alpha', + version: '1.0.1' + }, null, 2) + } + } + }) + + outdated(testDir, { + global: false + })([], () => { + t.equals(logs.length, 0, 'no logs') + t.end() + }) +}) + +t.test('throws if error with a dep', t => { + const testDir = t.testdir({ + 'package.json': JSON.stringify({ + name: 'delta', + version: '1.0.0', + dependencies: { + eta: '^1.0.0' + } + }, null, 2), + node_modules: { + eta: { + 'package.json': JSON.stringify({ + name: 'eta', + version: '1.0.1' + }, null, 2) + } + } + }) + + outdated(testDir, { + global: false + })([], (err) => { + t.equals(err.message, 'There is an error with this package.') + t.end() + }) +}) + +t.test('should skip missing non-prod deps', t => { + const testDir = t.testdir({ + 'package.json': JSON.stringify({ + name: 'delta', + version: '1.0.0', + devDependencies: { + beta: '^1.0.0' + } + }, null, 2), + node_modules: {} + }) + + outdated(testDir, { + global: false + })([], () => { + t.equals(logs.length, 0, 'no logs') + t.end() + }) +}) + +t.test('should skip invalid pkg ranges', t => { + const testDir = t.testdir({ + 'package.json': JSON.stringify({ + name: 'delta', + version: '1.0.0', + dependencies: { + alpha: '>=^2' + } + }, null, 2), + node_modules: { + alpha: { + 'package.json': JSON.stringify({ + name: 'alpha', + version: '1.0.0' + }, null, 2) + } + } + }) + + outdated(testDir, {})([], () => { + t.equals(logs.length, 0, 'no logs') + t.end() + }) +}) + +t.test('should skip git specs', t => { + const testDir = t.testdir({ + 'package.json': JSON.stringify({ + name: 'delta', + version: '1.0.0', + dependencies: { + alpha: 'github:username/foo' + } + }, null, 2), + node_modules: { + alpha: { + 'package.json': JSON.stringify({ + name: 'alpha', + version: '1.0.0' + }, null, 2) + } + } + }) + + outdated(testDir, {})([], () => { + t.equals(logs.length, 0, 'no logs') + t.end() + }) +}) diff --git a/deps/npm/test/lib/pack.js b/deps/npm/test/lib/pack.js new file mode 100644 index 00000000000000..5a268882f9e26d --- /dev/null +++ b/deps/npm/test/lib/pack.js @@ -0,0 +1,146 @@ +const t = require('tap') +const requireInject = require('require-inject') + +const OUTPUT = [] +const output = (...msg) => OUTPUT.push(msg) + +const libnpmpackActual = require('libnpmpack') +const libnpmpack = async (spec, opts) => { + if (!opts) { + throw new Error('expected options object') + } + return '' +} + +t.afterEach(cb => { + OUTPUT.length = 0 + cb() +}) + +t.test('should pack current directory with no arguments', (t) => { + const pack = requireInject('../../lib/pack.js', { + '../../lib/utils/output.js': output, + '../../lib/npm.js': { + flatOptions: { + unicode: false, + json: false, + dryRun: false + } + }, + libnpmpack, + npmlog: { + notice: () => {}, + showProgress: () => {}, + clearProgress: () => {} + } + }) + + return pack([], er => { + if (er) { + throw er + } + const filename = `npm-${require('../../package.json').version}.tgz` + t.strictSame(OUTPUT, [[filename]]) + }) +}) + +t.test('should pack given directory', (t) => { + const testDir = t.testdir({ + 'package.json': JSON.stringify({ + name: 'my-cool-pkg', + version: '1.0.0' + }, null, 2) + }) + + const pack = requireInject('../../lib/pack.js', { + '../../lib/utils/output.js': output, + '../../lib/npm.js': { + flatOptions: { + unicode: true, + json: true, + dryRun: true + } + }, + libnpmpack, + npmlog: { + notice: () => {}, + 'showProgress': () => {}, + 'clearProgress': () => {} + } + }) + + return pack([testDir], er => { + if (er) { + throw er + } + const filename = 'my-cool-pkg-1.0.0.tgz' + t.strictSame(OUTPUT, [[filename]]) + }) +}) + +t.test('should pack given directory for scoped package', (t) => { + const testDir = t.testdir({ + 'package.json': JSON.stringify({ + name: '@cool/my-pkg', + version: '1.0.0' + }, null, 2) + }) + + const pack = requireInject('../../lib/pack.js', { + '../../lib/utils/output.js': output, + '../../lib/npm.js': { + flatOptions: { + unicode: true, + json: true, + dryRun: true + } + }, + libnpmpack, + npmlog: { + notice: () => {}, + 'showProgress': () => {}, + 'clearProgress': () => {} + } + }) + + return pack([testDir], er => { + if (er) { + throw er + } + const filename = 'cool-my-pkg-1.0.0.tgz' + t.strictSame(OUTPUT, [[filename]]) + }) +}) + +t.test('should log pack contents', (t) => { + const pack = requireInject('../../lib/pack.js', { + '../../lib/utils/output.js': output, + '../../lib/utils/tar.js': { + ...require('../../lib/utils/tar.js'), + logTar: () => { + t.ok(true, 'logTar is called') + } + }, + '../../lib/npm.js': { + flatOptions: { + unicode: false, + json: false, + dryRun: false + } + }, + libnpmpack, + npmlog: { + notice: () => {}, + 'showProgress': () => {}, + 'clearProgress': () => {} + } + }) + + return pack([], er => { + if (er) { + throw er + } + const filename = `npm-${require('../../package.json').version}.tgz` + t.strictSame(OUTPUT, [[filename]]) + }) +}) diff --git a/deps/npm/test/lib/ping.js b/deps/npm/test/lib/ping.js new file mode 100644 index 00000000000000..d27bf4d603cf11 --- /dev/null +++ b/deps/npm/test/lib/ping.js @@ -0,0 +1,110 @@ +const { test } = require('tap') +const requireInject = require('require-inject') + +test('pings', (t) => { + t.plan(8) + + const flatOptions = { registry: 'https://registry.npmjs.org' } + let noticeCalls = 0 + const ping = requireInject('../../lib/ping.js', { + '../../lib/npm.js': { flatOptions }, + '../../lib/utils/ping.js': function (spec) { + t.equal(spec, flatOptions, 'passes flatOptions') + return {} + }, + npmlog: { + notice: (type, spec) => { + ++noticeCalls + if (noticeCalls === 1) { + t.equal(type, 'PING', 'should log a PING') + t.equal(spec, flatOptions.registry, 'should log the registry url') + } else { + t.equal(type, 'PONG', 'should log a PONG') + t.match(spec, /\d+ms/, 'should log the elapsed milliseconds') + } + } + } + }) + + ping([], (err) => { + t.equal(noticeCalls, 2, 'should have logged 2 lines') + t.ifError(err, 'npm ping') + t.ok('should be able to ping') + }) +}) + +test('pings and logs details', (t) => { + t.plan(10) + + const flatOptions = { registry: 'https://registry.npmjs.org' } + const details = { extra: 'data' } + let noticeCalls = 0 + const ping = requireInject('../../lib/ping.js', { + '../../lib/npm.js': { flatOptions }, + '../../lib/utils/ping.js': function (spec) { + t.equal(spec, flatOptions, 'passes flatOptions') + return details + }, + npmlog: { + notice: (type, spec) => { + ++noticeCalls + if (noticeCalls === 1) { + t.equal(type, 'PING', 'should log a PING') + t.equal(spec, flatOptions.registry, 'should log the registry url') + } else if (noticeCalls == 2) { + t.equal(type, 'PONG', 'should log a PONG') + t.match(spec, /\d+ms/, 'should log the elapsed milliseconds') + } else { + t.equal(type, 'PONG', 'should log a PONG') + const parsed = JSON.parse(spec) + t.match(parsed, details, 'should log JSON stringified details') + } + } + } + }) + + ping([], (err) => { + t.equal(noticeCalls, 3, 'should have logged 3 lines') + t.ifError(err, 'npm ping') + t.ok('should be able to ping') + }) +}) + +test('pings and returns json', (t) => { + t.plan(11) + + const flatOptions = { registry: 'https://registry.npmjs.org', json: true } + const details = { extra: 'data' } + let noticeCalls = 0 + const ping = requireInject('../../lib/ping.js', { + '../../lib/npm.js': { flatOptions }, + '../../lib/utils/ping.js': function (spec) { + t.equal(spec, flatOptions, 'passes flatOptions') + return details + }, + '../../lib/utils/output.js': function (spec) { + const parsed = JSON.parse(spec) + t.equal(parsed.registry, flatOptions.registry, 'returns the correct registry url') + t.match(parsed.details, details, 'prints returned details') + t.type(parsed.time, 'number', 'returns time as a number') + }, + npmlog: { + notice: (type, spec) => { + ++noticeCalls + if (noticeCalls === 1) { + t.equal(type, 'PING', 'should log a PING') + t.equal(spec, flatOptions.registry, 'should log the registry url') + } else { + t.equal(type, 'PONG', 'should log a PONG') + t.match(spec, /\d+ms/, 'should log the elapsed milliseconds') + } + } + } + }) + + ping([], (err) => { + t.equal(noticeCalls, 2, 'should have logged 2 lines') + t.ifError(err, 'npm ping') + t.ok('should be able to ping') + }) +}) diff --git a/deps/npm/test/lib/prefix.js b/deps/npm/test/lib/prefix.js new file mode 100644 index 00000000000000..a6e4d731ab1871 --- /dev/null +++ b/deps/npm/test/lib/prefix.js @@ -0,0 +1,19 @@ +const { test } = require('tap') +const requireInject = require('require-inject') + +test('prefix', (t) => { + t.plan(3) + const dir = '/prefix/dir' + + const prefix = requireInject('../../lib/prefix.js', { + '../../lib/npm.js': { prefix: dir }, + '../../lib/utils/output.js': (output) => { + t.equal(output, dir, 'prints the correct directory') + } + }) + + prefix([], (err) => { + t.ifError(err, 'npm prefix') + t.ok('should have printed directory') + }) +}) diff --git a/deps/npm/test/lib/prune.js b/deps/npm/test/lib/prune.js new file mode 100644 index 00000000000000..9c5024499da50b --- /dev/null +++ b/deps/npm/test/lib/prune.js @@ -0,0 +1,28 @@ +const { test } = require('tap') +const prune = require('../../lib/prune.js') +const requireInject = require('require-inject') + +test('should prune using Arborist', (t) => { + const prune = requireInject('../../lib/prune.js', { + '../../lib/npm.js': { + prefix: 'foo', + flatOptions: { + 'foo': 'bar' + } + }, + '@npmcli/arborist': function (args) { + t.ok(args, 'gets options object') + t.ok(args.path, 'gets path option') + this.prune = () => { + t.ok(true, 'prune is called') + } + }, + '../../lib/utils/reify-output.js': (arb) => { + t.ok(arb, 'gets arborist tree') + } + }) + prune(null, () => { + t.ok(true, 'callback is called') + t.end() + }) +}) diff --git a/deps/npm/test/lib/publish.js b/deps/npm/test/lib/publish.js new file mode 100644 index 00000000000000..5c5780de8fbefe --- /dev/null +++ b/deps/npm/test/lib/publish.js @@ -0,0 +1,154 @@ +const { test, cleanSnapshot } = require('tap') +const requireInject = require('require-inject') + +test('should publish with libnpmpublish', (t) => { + const testDir = t.testdir({ + 'package.json': JSON.stringify({ + name: 'my-cool-pkg', + version: '1.0.0' + }, null, 2) + }) + + const publish = requireInject('../../lib/publish.js', { + '../../lib/npm.js': { + flatOptions: { + json: true, + defaultTag: 'latest', + } + }, + '../../lib/utils/tar.js': { + 'getContents': () => ({ + id: 'someid' + }), + 'logTar': () => {} + }, + '../../lib/utils/output.js': () => {}, + '../../lib/utils/otplease.js': (opts, fn) => { + return Promise.resolve().then(() => fn(opts)) + }, + 'libnpmpack': () => '', + 'libnpmpublish': { + publish: (arg, manifest, opts) => { + t.ok(arg, 'gets path') + t.ok(manifest, 'gets manifest') + t.ok(opts, 'gets opts object') + t.ok(true, 'libnpmpublish is called') + } + }, + }) + + publish([testDir], () => { + t.end() + }) +}) + +test('should not log if silent', (t) => { + const testDir = t.testdir({ + 'package.json': JSON.stringify({ + name: 'my-cool-pkg', + version: '1.0.0' + }, null, 2) + }) + + const publish = requireInject('../../lib/publish.js', { + '../../lib/npm.js': { + flatOptions: { + json: false, + defaultTag: 'latest', + dryRun: true + } + }, + '../../lib/utils/tar.js': { + 'getContents': () => ({}), + 'logTar': () => {} + }, + '../../lib/utils/otplease.js': (opts, fn) => { + return Promise.resolve().then(() => fn(opts)) + }, + 'npmlog': { + 'verbose': () => {}, + 'level': 'silent' + }, + 'libnpmpack': () => '', + 'libnpmpublish': { + publish: () => {} + }, + }) + + publish([testDir], () => { + t.end() + }) +}) + +test('should log tarball contents', (t) => { + const testDir = t.testdir({ + 'package.json': JSON.stringify({ + name: 'my-cool-pkg', + version: '1.0.0' + }, null, 2) + }) + + const publish = requireInject('../../lib/publish.js', { + '../../lib/npm.js': { + flatOptions: { + json: false, + defaultTag: 'latest', + dryRun: true + } + }, + '../../lib/utils/tar.js': { + 'getContents': () => ({ + id: 'someid' + }), + 'logTar': () => { + t.ok(true, 'logTar is called') + } + }, + '../../lib/utils/output.js': () => { + t.ok(true, 'output fn is called') + }, + '../../lib/utils/otplease.js': (opts, fn) => { + return Promise.resolve().then(() => fn(opts)) + }, + 'libnpmpack': () => '', + 'libnpmpublish': { + publish: () => {} + }, + }) + + publish([testDir], () => { + t.end() + }) +}) + +test('shows usage with wrong set of arguments', (t) => { + const publish = requireInject('../../lib/publish.js', { + '../../lib/npm.js': { + flatOptions: { + json: false, + defaultTag: '0.0.13' + } + } + }) + + publish(['a', 'b', 'c'], (result) => { + t.matchSnapshot(result, 'should print usage') + t.end() + }) +}) + +test('throws when invalid tag', (t) => { + const publish = requireInject('../../lib/publish.js', { + '../../lib/npm.js': { + flatOptions: { + json: false, + defaultTag: '0.0.13' + } + } + }) + + publish([], (err) => { + t.ok(err, 'throws when tag name is a valid SemVer range') + t.end() + }) +}) diff --git a/deps/npm/test/lib/repo.js b/deps/npm/test/lib/repo.js new file mode 100644 index 00000000000000..fcc95f343890eb --- /dev/null +++ b/deps/npm/test/lib/repo.js @@ -0,0 +1,199 @@ +const t = require('tap') + +const requireInject = require('require-inject') +const pacote = { + manifest: async (spec, options) => { + return spec === 'norepo' ? { + name: 'norepo', + version: '1.2.3' + } + + : spec === 'repoobbj-nourl' ? { + name: 'repoobj-nourl', + repository: { no: 'url' } + } + + : spec === 'hostedgit' ? { + repository: 'git://github.com/foo/hostedgit' + } + : spec === 'hostedgitat' ? { + repository: 'git@github.com:foo/hostedgitat' + } + : spec === 'hostedssh' ? { + repository: 'ssh://git@github.com/foo/hostedssh' + } + : spec === 'hostedgitssh' ? { + repository: 'git+ssh://git@github.com/foo/hostedgitssh' + } + : spec === 'hostedgithttp' ? { + repository: 'git+http://github.com/foo/hostedgithttp' + } + : spec === 'hostedgithttps' ? { + repository: 'git+https://github.com/foo/hostedgithttps' + } + + : spec === 'hostedgitobj' ? { + repository: { url: 'git://github.com/foo/hostedgitobj' } + } + : spec === 'hostedgitatobj' ? { + repository: { url: 'git@github.com:foo/hostedgitatobj' } + } + : spec === 'hostedsshobj' ? { + repository: { url: 'ssh://git@github.com/foo/hostedsshobj' } + } + : spec === 'hostedgitsshobj' ? { + repository: { url: 'git+ssh://git@github.com/foo/hostedgitsshobj' } + } + : spec === 'hostedgithttpobj' ? { + repository: { url: 'git+http://github.com/foo/hostedgithttpobj' } + } + : spec === 'hostedgithttpsobj' ? { + repository: { url: 'git+https://github.com/foo/hostedgithttpsobj' } + } + + : spec === 'unhostedgit' ? { + repository: 'git://gothib.com/foo/unhostedgit' + } + : spec === 'unhostedgitat' ? { + repository: 'git@gothib.com:foo/unhostedgitat' + } + : spec === 'unhostedssh' ? { + repository: 'ssh://git@gothib.com/foo/unhostedssh' + } + : spec === 'unhostedgitssh' ? { + repository: 'git+ssh://git@gothib.com/foo/unhostedgitssh' + } + : spec === 'unhostedgithttp' ? { + repository: 'git+http://gothib.com/foo/unhostedgithttp' + } + : spec === 'unhostedgithttps' ? { + repository: 'git+https://gothib.com/foo/unhostedgithttps' + } + + : spec === 'unhostedgitobj' ? { + repository: { url: 'git://gothib.com/foo/unhostedgitobj' } + } + : spec === 'unhostedgitatobj' ? { + repository: { url: 'git@gothib.com:foo/unhostedgitatobj' } + } + : spec === 'unhostedsshobj' ? { + repository: { url: 'ssh://git@gothib.com/foo/unhostedsshobj' } + } + : spec === 'unhostedgitsshobj' ? { + repository: { url: 'git+ssh://git@gothib.com/foo/unhostedgitsshobj' } + } + : spec === 'unhostedgithttpobj' ? { + repository: { url: 'git+http://gothib.com/foo/unhostedgithttpobj' } + } + : spec === 'unhostedgithttpsobj' ? { + repository: { url: 'git+https://gothib.com/foo/unhostedgithttpsobj' } + } + + : spec === 'directory' ? { + repository: { + type: 'git', + url: 'git+https://github.com/foo/test-repo-with-directory.git', + directory: 'some/directory' + } + } + + : spec === '.' ? { + name: 'thispkg', + version: '1.2.3', + repository: 'https://example.com/thispkg.git' + } + : null + } +} + +// keep a tally of which urls got opened +const opened = {} +const openUrl = (url, errMsg, cb) => { + opened[url] = opened[url] || 0 + opened[url]++ + process.nextTick(cb) +} + +const repo = requireInject('../../lib/repo.js', { + pacote, + '../../lib/utils/open-url.js': openUrl +}) + +t.test('completion', t => { + repo.completion({}, (er, res) => { + t.equal(er, null) + t.same(res, []) + t.end() + }) +}) + +t.test('open repo urls', t => { + const expect = { + hostedgit: 'https://github.com/foo/hostedgit', + hostedgitat: 'https://github.com/foo/hostedgitat', + hostedssh: 'https://github.com/foo/hostedssh', + hostedgitssh: 'https://github.com/foo/hostedgitssh', + hostedgithttp: 'https://github.com/foo/hostedgithttp', + hostedgithttps: 'https://github.com/foo/hostedgithttps', + hostedgitobj: 'https://github.com/foo/hostedgitobj', + hostedgitatobj: 'https://github.com/foo/hostedgitatobj', + hostedsshobj: 'https://github.com/foo/hostedsshobj', + hostedgitsshobj: 'https://github.com/foo/hostedgitsshobj', + hostedgithttpobj: 'https://github.com/foo/hostedgithttpobj', + hostedgithttpsobj: 'https://github.com/foo/hostedgithttpsobj', + unhostedgit: 'https://gothib.com/foo/unhostedgit', + unhostedssh: 'https://gothib.com/foo/unhostedssh', + unhostedgitssh: 'https://gothib.com/foo/unhostedgitssh', + unhostedgithttp: 'http://gothib.com/foo/unhostedgithttp', + unhostedgithttps: 'https://gothib.com/foo/unhostedgithttps', + unhostedgitobj: 'https://gothib.com/foo/unhostedgitobj', + unhostedsshobj: 'https://gothib.com/foo/unhostedsshobj', + unhostedgitsshobj: 'https://gothib.com/foo/unhostedgitsshobj', + unhostedgithttpobj: 'http://gothib.com/foo/unhostedgithttpobj', + unhostedgithttpsobj: 'https://gothib.com/foo/unhostedgithttpsobj', + directory: 'https://github.com/foo/test-repo-with-directory/tree/master/some/directory', + '.': 'https://example.com/thispkg' + } + const keys = Object.keys(expect) + t.plan(keys.length) + keys.forEach(pkg => { + t.test(pkg, t => { + repo([pkg], (er) => { + if (er) + throw er + const url = expect[pkg] + t.equal(opened[url], 1, url, {opened}) + t.end() + }) + }) + }) +}) + +t.test('fail if cannot figure out repo url', t => { + const cases = [ + 'norepo', + 'repoobbj-nourl', + 'unhostedgitat', + 'unhostedgitatobj' + ] + + t.plan(cases.length) + + cases.forEach(pkg => { + t.test(pkg, t => { + repo([pkg], er => { + t.match(er, { pkgid: pkg }) + t.end() + }) + }) + }) +}) + +t.test('open default package if none specified', t => { + repo([], (er) => { + if (er) + throw er + t.equal(opened['https://example.com/thispkg'], 2, 'opened expected url', {opened}) + t.end() + }) +}) diff --git a/deps/npm/test/lib/restart.js b/deps/npm/test/lib/restart.js new file mode 100644 index 00000000000000..fde798888810f8 --- /dev/null +++ b/deps/npm/test/lib/restart.js @@ -0,0 +1,5 @@ +const t = require('tap') +const restart = require('../../lib/restart.js') +t.isa(restart, Function) +t.equal(restart.completion, require('../../lib/utils/completion/none.js'), 'empty completion') +t.equal(restart.usage, 'npm restart [-- ]') diff --git a/deps/npm/test/lib/root.js b/deps/npm/test/lib/root.js new file mode 100644 index 00000000000000..210e9b029121c8 --- /dev/null +++ b/deps/npm/test/lib/root.js @@ -0,0 +1,19 @@ +const { test } = require('tap') +const requireInject = require('require-inject') + +test('root', (t) => { + t.plan(3) + const dir = '/root/dir' + + const root = requireInject('../../lib/root.js', { + '../../lib/npm.js': { dir }, + '../../lib/utils/output.js': (output) => { + t.equal(output, dir, 'prints the correct directory') + } + }) + + root([], (err) => { + t.ifError(err, 'npm root') + t.ok('should have printed directory') + }) +}) diff --git a/deps/npm/test/lib/run-script.js b/deps/npm/test/lib/run-script.js new file mode 100644 index 00000000000000..0bb0c056b006b8 --- /dev/null +++ b/deps/npm/test/lib/run-script.js @@ -0,0 +1,434 @@ +const t = require('tap') +const requireInject = require('require-inject') + +let RUN_FAIL = null +const RUN_SCRIPTS = [] +const npm = { + localPrefix: __dirname, + flatOptions: { + scriptShell: undefined, + json: false, + parseable: false + }, + config: { + settings: { + 'if-present': false + }, + get: k => npm.config.settings[k], + set: (k, v) => { + npm.config.settings[k] = v + } + } +} + +const output = [] + +const npmlog = { level: 'warn' } +const getRS = windows => requireInject('../../lib/run-script.js', { + '@npmcli/run-script': async opts => { + RUN_SCRIPTS.push(opts) + }, + npmlog, + '../../lib/npm.js': npm, + '../../lib/utils/is-windows-shell.js': windows, + '../../lib/utils/output.js': (...msg) => output.push(msg) +}) + +const runScript = getRS(false) +const runScriptWin = getRS(true) + +const { writeFileSync } = require('fs') +t.test('completion', t => { + const dir = t.testdir() + npm.localPrefix = dir + t.test('already have a script name', t => { + runScript.completion({conf:{argv:{remain: ['npm','run','x']}}}, (er, results) => { + if (er) { + throw er + } + t.equal(results, undefined) + t.end() + }) + }) + t.test('no package.json', t => { + runScript.completion({conf:{argv:{remain: ['npm','run']}}}, (er, results) => { + if (er) { + throw er + } + t.strictSame(results, []) + t.end() + }) + }) + t.test('has package.json, no scripts', t => { + writeFileSync(`${dir}/package.json`, JSON.stringify({})) + runScript.completion({conf:{argv:{remain: ['npm', 'run']}}}, (er, results) => { + if (er) { + throw er + } + t.strictSame(results, []) + t.end() + }) + }) + t.test('has package.json, with scripts', t => { + writeFileSync(`${dir}/package.json`, JSON.stringify({ + scripts: { hello: 'echo hello', world: 'echo world' } + })) + runScript.completion({conf:{argv:{remain: ['npm', 'run']}}}, (er, results) => { + if (er) { + throw er + } + t.strictSame(results, ['hello', 'world']) + t.end() + }) + }) + t.end() +}) + +t.test('fail if no package.json', async t => { + npm.localPrefix = t.testdir() + await runScript([], er => t.match(er, { code: 'ENOENT' })) + await runScript(['test'], er => t.match(er, { code: 'ENOENT' })) +}) + +t.test('default env and restart scripts', async t => { + npm.localPrefix = t.testdir({ + 'package.json': JSON.stringify({ name: 'x', version: '1.2.3' }) + }) + + await runScript(['env'], er => { + if (er) { + throw er + } + t.match(RUN_SCRIPTS, [ + { + path: npm.localPrefix, + args: [], + scriptShell: undefined, + stdio: 'inherit', + stdioString: true, + pkg: { name: 'x', version: '1.2.3', _id: 'x@1.2.3', scripts: { + env: 'env' + } }, + event: 'env' + } + ]) + }) + RUN_SCRIPTS.length = 0 + + await runScriptWin(['env'], er => { + if (er) { + throw er + } + t.match(RUN_SCRIPTS, [ + { + path: npm.localPrefix, + args: [], + scriptShell: undefined, + stdio: 'inherit', + stdioString: true, + pkg: { name: 'x', version: '1.2.3', _id: 'x@1.2.3', scripts: { + env: 'SET' + } }, + event: 'env' + } + ]) + }) + RUN_SCRIPTS.length = 0 + + await runScript(['restart'], er => { + if (er) { + throw er + } + t.match(RUN_SCRIPTS, [ + { + path: npm.localPrefix, + args: [], + scriptShell: undefined, + stdio: 'inherit', + stdioString: true, + pkg: { name: 'x', version: '1.2.3', _id: 'x@1.2.3', scripts: { + restart: 'npm stop --if-present && npm start' + } }, + event: 'restart' + } + ]) + }) + RUN_SCRIPTS.length = 0 +}) + +t.test('try to run missing script', t => { + npm.localPrefix = t.testdir({ + 'package.json': JSON.stringify({ + scripts: { hello: 'world' } + }) + }) + t.test('no suggestions', async t => { + await runScript(['notevenclose'], er => { + t.match(er, { + message: 'missing script: notevenclose' + }) + }) + }) + t.test('suggestions', async t => { + await runScript(['helo'], er => { + t.match(er, { + message: 'missing script: helo\n\nDid you mean this?\n hello' + }) + }) + }) + t.test('with --if-present', async t => { + npm.config.set('if-present', true) + await runScript(['goodbye'], er => { + if (er) { + throw er + } + t.strictSame(RUN_SCRIPTS, [], 'did not try to run anything') + }) + }) + t.end() +}) + +t.test('run pre/post hooks', async t => { + npm.localPrefix = t.testdir({ + 'package.json': JSON.stringify({ + name: 'x', + version: '1.2.3', + scripts: { + preenv: 'echo before the env', + postenv: 'echo after the env' + } + }) + }) + + await runScript(['env'], er => { + if (er) { + throw er + } + t.match(RUN_SCRIPTS, [ + { event: 'preenv' }, + { + path: npm.localPrefix, + args: [], + scriptShell: undefined, + stdio: 'inherit', + stdioString: true, + pkg: { name: 'x', version: '1.2.3', _id: 'x@1.2.3', scripts: { + env: 'env' + } }, + event: 'env' + }, + { event: 'postenv' } + ]) + }) + RUN_SCRIPTS.length = 0 +}) + +t.test('skip pre/post hooks when using ignoreScripts', async t => { + npm.flatOptions.ignoreScripts = true + + npm.localPrefix = t.testdir({ + 'package.json': JSON.stringify({ + name: 'x', + version: '1.2.3', + scripts: { + preenv: 'echo before the env', + postenv: 'echo after the env' + } + }) + }) + + await runScript(['env'], er => { + if (er) { + throw er + } + t.deepEqual(RUN_SCRIPTS, [ + { + path: npm.localPrefix, + args: [], + scriptShell: undefined, + stdio: 'inherit', + stdioString: true, + pkg: { name: 'x', version: '1.2.3', _id: 'x@1.2.3', scripts: { + preenv: 'echo before the env', + postenv: 'echo after the env', + env: 'env' + } }, + event: 'env' + } + ]) + + delete npm.flatOptions.ignoreScripts + }) + RUN_SCRIPTS.length = 0 +}) + +t.test('run silent', async t => { + npmlog.level = 'silent' + t.teardown(() => { npmlog.level = 'warn' }) + + npm.localPrefix = t.testdir({ + 'package.json': JSON.stringify({ + name: 'x', + version: '1.2.3', + scripts: { + preenv: 'echo before the env', + postenv: 'echo after the env' + } + }) + }) + + await runScript(['env'], er => { + if (er) { + throw er + } + t.match(RUN_SCRIPTS, [ + { + event: 'preenv', + stdio: 'pipe' + }, + { + path: npm.localPrefix, + args: [], + scriptShell: undefined, + stdio: 'pipe', + stdioString: true, + pkg: { name: 'x', version: '1.2.3', _id: 'x@1.2.3', scripts: { + env: 'env' + } }, + event: 'env' + }, + { + event: 'postenv', + stdio: 'pipe' + } + ]) + }) + RUN_SCRIPTS.length = 0 +}) + +t.test('list scripts', async t => { + const scripts = { + test: 'exit 2', + start: 'node server.js', + stop: 'node kill-server.js', + preenv: 'echo before the env', + postenv: 'echo after the env' + } + npm.localPrefix = t.testdir({ + 'package.json': JSON.stringify({ + name: 'x', + version: '1.2.3', + scripts + }) + }) + + await runScript([], er => { + if (er) { + throw er + } + }) + t.strictSame(output, [ + [ 'Lifecycle scripts included in x:' ], + [ ' test\n exit 2' ], + [ ' start\n node server.js' ], + [ ' stop\n node kill-server.js' ], + [ '\navailable via `npm run-script`:' ], + [ ' preenv\n echo before the env' ], + [ ' postenv\n echo after the env' ] + ], 'basic report') + output.length = 0 + + npmlog.level = 'silent' + await runScript([], er => { + if (er) { + throw er + } + }) + t.strictSame(output, []) + npmlog.level = 'warn' + + npm.flatOptions.json = true + await runScript([], er => { + if (er) { + throw er + } + }) + t.strictSame(output, [[JSON.stringify(scripts, 0, 2)]], 'json report') + output.length = 0 + npm.flatOptions.json = false + + npm.flatOptions.parseable = true + await runScript([], er => { + if (er) { + throw er + } + }) + t.strictSame(output, [ + [ 'test:exit 2' ], + [ 'start:node server.js' ], + [ 'stop:node kill-server.js' ], + [ 'preenv:echo before the env' ], + [ 'postenv:echo after the env' ] + ]) + output.length = 0 + npm.flatOptions.parseable = false +}) + +t.test('list scripts when no scripts', async t => { + npm.localPrefix = t.testdir({ + 'package.json': JSON.stringify({ + name: 'x', + version: '1.2.3' + }) + }) + + await runScript([], er => { + if (er) { + throw er + } + }) + t.strictSame(output, [], 'nothing to report') + output.length = 0 +}) + +t.test('list scripts, only commands', async t => { + npm.localPrefix = t.testdir({ + 'package.json': JSON.stringify({ + name: 'x', + version: '1.2.3', + scripts: { preversion: 'echo doing the version dance' } + }) + }) + + await runScript([], er => { + if (er) { + throw er + } + }) + t.strictSame(output, [ + ["Lifecycle scripts included in x:"], + [" preversion\n echo doing the version dance"], + ]) + output.length = 0 +}) + +t.test('list scripts, only non-commands', async t => { + npm.localPrefix = t.testdir({ + 'package.json': JSON.stringify({ + name: 'x', + version: '1.2.3', + scripts: { glorp: 'echo doing the glerp glop' } + }) + }) + + await runScript([], er => { + if (er) { + throw er + } + }) + t.strictSame(output, [ + ["Scripts available in x via `npm run-script`:"], + [" glorp\n echo doing the glerp glop"] + ]) + output.length = 0 +}) diff --git a/deps/npm/test/lib/start.js b/deps/npm/test/lib/start.js new file mode 100644 index 00000000000000..1277412758f0ef --- /dev/null +++ b/deps/npm/test/lib/start.js @@ -0,0 +1,5 @@ +const t = require('tap') +const start = require('../../lib/start.js') +t.isa(start, Function) +t.equal(start.completion, require('../../lib/utils/completion/none.js'), 'empty completion') +t.equal(start.usage, 'npm start [-- ]') diff --git a/deps/npm/test/lib/stop.js b/deps/npm/test/lib/stop.js new file mode 100644 index 00000000000000..d015161d2f5de1 --- /dev/null +++ b/deps/npm/test/lib/stop.js @@ -0,0 +1,5 @@ +const t = require('tap') +const stop = require('../../lib/stop.js') +t.isa(stop, Function) +t.equal(stop.completion, require('../../lib/utils/completion/none.js'), 'empty completion') +t.equal(stop.usage, 'npm stop [-- ]') diff --git a/deps/npm/test/lib/test.js b/deps/npm/test/lib/test.js new file mode 100644 index 00000000000000..8b6d0662659cfe --- /dev/null +++ b/deps/npm/test/lib/test.js @@ -0,0 +1,40 @@ +const t = require('tap') +const requireInject = require('require-inject') +let RUN_ARGS = null +const npmock = { + commands: { + run: (args, cb) => { + RUN_ARGS = args + cb() + } + } +} +const test = requireInject('../../lib/test.js', { + '../../lib/npm.js': npmock +}) + +t.test('run a test', t => { + test([], (er) => { + t.strictSame(RUN_ARGS, ['test'], 'added "test" to the args') + }) + test(['hello', 'world'], (er) => { + t.strictSame(RUN_ARGS, ['test', 'hello', 'world'], 'added positional args') + }) + + const lcErr = Object.assign(new Error('should not see this'), { + code: 'ELIFECYCLE' + }) + const otherErr = new Error('should see this') + + npmock.commands.run = (args, cb) => cb(lcErr) + test([], (er) => { + t.equal(er, 'Test failed. See above for more details.') + }) + + npmock.commands.run = (args, cb) => cb(otherErr) + test([], (er) => { + t.match(er, { message: 'should see this' }) + }) + + t.end() +}) diff --git a/deps/npm/test/lib/token.js b/deps/npm/test/lib/token.js new file mode 100644 index 00000000000000..dc5a8ad05e4448 --- /dev/null +++ b/deps/npm/test/lib/token.js @@ -0,0 +1,912 @@ +const { test } = require('tap') +const requireInject = require('require-inject') + +const mocks = { + npm: {}, + profile: {}, + output: () => {}, + log: {}, + readUserInfo: {} +} + +const tokenMock = requireInject('../../lib/token.js', { + '../../lib/npm.js': mocks.npm, + '../../lib/utils/output.js': (...args) => mocks.output(...args), + '../../lib/utils/otplease.js': (opts, fn) => { + return Promise.resolve().then(() => fn(opts)) + }, + '../../lib/utils/read-user-info.js': mocks.readUserInfo, + 'npm-profile': mocks.profile, + 'npmlog': mocks.log +}) + +const tokenWithMocks = (mockRequests) => { + for (const mod in mockRequests) { + if (typeof mockRequests[mod] === 'function') { + mocks[mod] = mockRequests[mod] + } else { + for (const key in mockRequests[mod]) { + mocks[mod][key] = mockRequests[mod][key] + } + } + } + + const reset = () => { + for (const mod in mockRequests) { + if (typeof mockRequests[mod] === 'function') { + mocks[mod] = () => {} + } else { + for (const key in mockRequests[mod]) { + delete mocks[mod][key] + } + } + } + } + + return [tokenMock, reset] +} + +test('completion', (t) => { + t.plan(5) + + const testComp = (argv, expect) => { + tokenMock.completion({ conf: { argv: { remain: argv } } }, (err, res) => { + if (err) { + throw err + } + + t.strictSame(res, expect, argv.join(' ')) + }) + } + + testComp(['npm', 'token'], [ + 'list', + 'revoke', + 'create' + ]) + + testComp(['npm', 'token', 'list'], []) + testComp(['npm', 'token', 'revoke'], []) + testComp(['npm', 'token', 'create'], []) + + tokenMock.completion({ conf: { argv: { remain: ['npm', 'token', 'foobar' ] } } }, (err) => { + t.match(err, { message: 'foobar not recognized' }) + }) +}) + +test('token foobar', (t) => { + t.plan(2) + + const [token, reset] = tokenWithMocks({ + log: { + gauge: { + show: (name) => { + t.equal(name, 'token', 'shows a gauge') + } + } + } + }) + + t.tearDown(reset) + + tokenMock(['foobar'], (err) => { + t.match(err.message, 'foobar is not a recognized subcommand') + }) +}) + +test('token list', (t) => { + t.plan(15) + + const now = new Date().toISOString() + const tokens = [{ + key: 'abcd1234abcd1234', + token: 'efgh5678efgh5678', + cidr_whitelist: null, + readonly: false, + created: now, + updated: now + }, { + key: 'abcd1256', + token: 'hgfe8765', + cidr_whitelist: ['192.168.1.1/32'], + readonly: true, + created: now, + updated: now + }] + + const [token, reset] = tokenWithMocks({ + npm: { + flatOptions: { registry: 'https://registry.npmjs.org', otp: '123456' }, + config: { + getCredentialsByURI: (uri) => { + t.equal(uri, 'https://registry.npmjs.org', 'requests correct registry') + return { token: 'thisisnotarealtoken' } + } + } + }, + profile: { + listTokens: (conf) => { + t.same(conf.auth, { token: 'thisisnotarealtoken', otp: '123456' }) + return tokens + } + }, + log: { + gauge: { + show: (name) => { + t.equal(name, 'token') + } + }, + info: (type, msg) => { + t.equal(type, 'token') + t.equal(msg, 'getting list') + } + }, + output: (spec) => { + const lines = spec.split(/\r?\n/) + t.match(lines[3], ' abcd123 ', 'includes the trimmed key') + t.match(lines[3], ' efgh56… ', 'includes the trimmed token') + t.match(lines[3], ` ${now.slice(0, 10)} `, 'includes the trimmed creation timestamp') + t.match(lines[3], ' no ', 'includes the "no" string for readonly state') + t.match(lines[5], ' abcd125 ', 'includes the trimmed key') + t.match(lines[5], ' hgfe87… ', 'includes the trimmed token') + t.match(lines[5], ` ${now.slice(0, 10)} `, 'includes the trimmed creation timestamp') + t.match(lines[5], ' yes ', 'includes the "no" string for readonly state') + t.match(lines[5], ` ${tokens[1].cidr_whitelist.join(',')} `, 'includes the cidr whitelist') + } + }) + + t.tearDown(reset) + + token([], (err) => { + t.ifError(err, 'npm token list') + }) +}) + +test('token list json output', (t) => { + t.plan(8) + + const now = new Date().toISOString() + const tokens = [{ + key: 'abcd1234abcd1234', + token: 'efgh5678efgh5678', + cidr_whitelist: null, + readonly: false, + created: now, + updated: now + }] + + const [token, reset] = tokenWithMocks({ + npm: { + flatOptions: { registry: 'https://registry.npmjs.org', json: true }, + config: { + getCredentialsByURI: (uri) => { + t.equal(uri, 'https://registry.npmjs.org', 'requests correct registry') + return { username: 'foo', password: 'bar' } + } + } + }, + profile: { + listTokens: (conf) => { + t.same(conf.auth, { basic: { username: 'foo', password: 'bar' } }, 'passes the correct auth') + return tokens + } + }, + log: { + gauge: { + show: (name) => { + t.equal(name, 'token') + } + }, + info: (type, msg) => { + t.equal(type, 'token') + t.equal(msg, 'getting list') + } + }, + output: (spec) => { + t.type(spec, 'string', 'is called with a string') + const parsed = JSON.parse(spec) + t.match(parsed, tokens, 'prints the json parsed tokens') + } + }) + + t.tearDown(reset) + + token(['list'], (err) => { + t.ifError(err, 'npm token list') + }) +}) + +test('token list parseable output', (t) => { + t.plan(12) + + const now = new Date().toISOString() + const tokens = [{ + key: 'abcd1234abcd1234', + token: 'efgh5678efgh5678', + cidr_whitelist: null, + readonly: false, + created: now, + updated: now + }, { + key: 'efgh5678ijkl9101', + token: 'hgfe8765', + cidr_whitelist: ['192.168.1.1/32'], + readonly: true, + created: now, + updated: now + }] + + let callCount = 0 + + const [token, reset] = tokenWithMocks({ + npm: { + flatOptions: { registry: 'https://registry.npmjs.org', parseable: true }, + config: { + getCredentialsByURI: (uri) => { + t.equal(uri, 'https://registry.npmjs.org', 'requests correct registry') + return { auth: Buffer.from('foo:bar').toString('base64') } + } + } + }, + profile: { + listTokens: (conf) => { + t.same(conf.auth, { basic: { username: 'foo', password: 'bar' } }, 'passes the correct auth') + return tokens + } + }, + log: { + gauge: { + show: (name) => { + t.equal(name, 'token') + } + }, + info: (type, msg) => { + t.equal(type, 'token') + t.equal(msg, 'getting list') + } + }, + output: (spec) => { + ++callCount + t.type(spec, 'string', 'is called with a string') + if (callCount === 1) { + t.equal(spec, ['key', 'token', 'created', 'readonly', 'CIDR whitelist'].join('\t'), 'prints header') + } else if (callCount === 2) { + t.equal(spec, [tokens[0].key, tokens[0].token, tokens[0].created, tokens[0].readonly, ''].join('\t'), 'prints token info') + } else { + t.equal(spec, [tokens[1].key, tokens[1].token, tokens[1].created, tokens[1].readonly, tokens[1].cidr_whitelist.join(',')].join('\t'), 'prints token info') + } + } + }) + + t.tearDown(reset) + + token(['list'], (err) => { + t.ifError(err, 'npm token list') + }) +}) + +test('token revoke', (t) => { + t.plan(10) + + const [token, reset] = tokenWithMocks({ + npm: { + flatOptions: { registry: 'https://registry.npmjs.org' }, + config: { + getCredentialsByURI: (uri) => { + t.equal(uri, 'https://registry.npmjs.org', 'requests correct registry') + return {} + } + } + }, + log: { + gauge: { + show: (name) => { + t.equal(name, 'token', 'starts a gauge') + } + }, + newItem: (action, len) => { + t.equal(action, 'removing tokens') + t.equal(len, 0) + return { + info: (name, progress) => { + t.equal(name, 'token') + t.equal(progress, 'getting existing list') + } + } + } + }, + profile: { + listTokens: (conf) => { + t.same(conf.auth, {}, 'passes the correct empty auth') + return Promise.resolve([ + { key: 'abcd1234' } + ]) + }, + removeToken: (key) => { + t.equal(key, 'abcd1234', 'deletes the correct token') + } + }, + output: (spec) => { + t.equal(spec, 'Removed 1 token') + } + }) + + t.tearDown(reset) + + token(['rm', 'abcd'], (err) => { + t.ifError(err, 'npm token rm') + }) +}) + +test('token revoke multiple tokens', (t) => { + t.plan(10) + + const [token, reset] = tokenWithMocks({ + npm: { + flatOptions: { registry: 'https://registry.npmjs.org' }, + config: { + getCredentialsByURI: (uri) => { + t.equal(uri, 'https://registry.npmjs.org', 'requests correct registry') + return { token: 'thisisnotarealtoken' } + } + } + }, + log: { + gauge: { + show: (name) => { + t.equal(name, 'token', 'starts a gauge') + } + }, + newItem: (action, len) => { + t.equal(action, 'removing tokens') + t.equal(len, 0) + return { + info: (name, progress) => { + t.equal(name, 'token') + t.equal(progress, 'getting existing list') + } + } + } + }, + profile: { + listTokens: () => Promise.resolve([ + { key: 'abcd1234' }, + { key: 'efgh5678' } + ]), + removeToken: (key) => { + // this will run twice + t.ok(['abcd1234', 'efgh5678'].includes(key), 'deletes the correct token') + } + }, + output: (spec) => { + t.equal(spec, 'Removed 2 tokens') + } + }) + + t.tearDown(reset) + + token(['revoke', 'abcd', 'efgh'], (err) => { + t.ifError(err, 'npm token rm') + }) +}) + +test('token revoke json output', (t) => { + t.plan(10) + + const [token, reset] = tokenWithMocks({ + npm: { + flatOptions: { registry: 'https://registry.npmjs.org', json: true }, + config: { + getCredentialsByURI: (uri) => { + t.equal(uri, 'https://registry.npmjs.org', 'requests correct registry') + return { token: 'thisisnotarealtoken' } + } + } + }, + log: { + gauge: { + show: (name) => { + t.equal(name, 'token', 'starts a gauge') + } + }, + newItem: (action, len) => { + t.equal(action, 'removing tokens') + t.equal(len, 0) + return { + info: (name, progress) => { + t.equal(name, 'token') + t.equal(progress, 'getting existing list') + } + } + } + }, + profile: { + listTokens: () => Promise.resolve([ + { key: 'abcd1234' } + ]), + removeToken: (key) => { + t.equal(key, 'abcd1234', 'deletes the correct token') + } + }, + output: (spec) => { + t.type(spec, 'string', 'is given a string') + const parsed = JSON.parse(spec) + t.same(parsed, ['abcd1234'], 'logs the token as json') + } + }) + + t.tearDown(reset) + + token(['delete', 'abcd'], (err) => { + t.ifError(err, 'npm token rm') + }) +}) + +test('token revoke parseable output', (t) => { + t.plan(9) + + const [token, reset] = tokenWithMocks({ + npm: { + flatOptions: { registry: 'https://registry.npmjs.org', parseable: true }, + config: { + getCredentialsByURI: (uri) => { + t.equal(uri, 'https://registry.npmjs.org', 'requests correct registry') + return { token: 'thisisnotarealtoken' } + } + } + }, + log: { + gauge: { + show: (name) => { + t.equal(name, 'token', 'starts a gauge') + } + }, + newItem: (action, len) => { + t.equal(action, 'removing tokens') + t.equal(len, 0) + return { + info: (name, progress) => { + t.equal(name, 'token') + t.equal(progress, 'getting existing list') + } + } + } + }, + profile: { + listTokens: () => Promise.resolve([ + { key: 'abcd1234' } + ]), + removeToken: (key) => { + t.equal(key, 'abcd1234', 'deletes the correct token') + } + }, + output: (spec) => { + t.equal(spec, 'abcd1234', 'logs the token as a string') + } + }) + + t.tearDown(reset) + + token(['remove', 'abcd'], (err) => { + t.ifError(err, 'npm token rm') + }) +}) + +test('token revoke by token', (t) => { + t.plan(9) + + const [token, reset] = tokenWithMocks({ + npm: { + flatOptions: { registry: 'https://registry.npmjs.org' }, + config: { + getCredentialsByURI: (uri) => { + t.equal(uri, 'https://registry.npmjs.org', 'requests correct registry') + return { token: 'thisisnotarealtoken' } + } + } + }, + log: { + gauge: { + show: (name) => { + t.equal(name, 'token', 'starts a gauge') + } + }, + newItem: (action, len) => { + t.equal(action, 'removing tokens') + t.equal(len, 0) + return { + info: (name, progress) => { + t.equal(name, 'token') + t.equal(progress, 'getting existing list') + } + } + } + }, + profile: { + listTokens: () => Promise.resolve([ + { key: 'abcd1234', token: 'efgh5678' } + ]), + removeToken: (key) => { + t.equal(key, 'efgh5678', 'passes through user input') + } + }, + output: (spec) => { + t.equal(spec, 'Removed 1 token') + } + }) + + t.tearDown(reset) + + token(['rm', 'efgh5678'], (err) => { + t.ifError(err, 'npm token rm') + }) +}) + +test('token revoke requires an id', (t) => { + t.plan(2) + + const [token, reset] = tokenWithMocks({ + log: { + gauge: { + show: (name) => { + t.equal(name, 'token') + } + } + } + }) + + t.tearDown(reset) + + token(['rm'], (err) => { + t.match(err.message, '`` argument is required') + }) +}) + +test('token revoke ambiguous id errors', (t) => { + t.plan(7) + + const [token, reset] = tokenWithMocks({ + npm: { + flatOptions: { registry: 'https://registry.npmjs.org' }, + config: { + getCredentialsByURI: (uri) => { + t.equal(uri, 'https://registry.npmjs.org', 'requests correct registry') + return { token: 'thisisnotarealtoken' } + } + } + }, + log: { + gauge: { + show: (name) => { + t.equal(name, 'token', 'starts a gauge') + } + }, + newItem: (action, len) => { + t.equal(action, 'removing tokens') + t.equal(len, 0) + return { + info: (name, progress) => { + t.equal(name, 'token') + t.equal(progress, 'getting existing list') + } + } + } + }, + profile: { + listTokens: () => Promise.resolve([ + { key: 'abcd1234' }, + { key: 'abcd5678' } + ]) + } + }) + + t.tearDown(reset) + + token(['rm', 'abcd'], (err) => { + t.match(err.message, 'Token ID "abcd" was ambiguous') + }) +}) + +test('token revoke unknown id errors', (t) => { + t.plan(7) + + const [token, reset] = tokenWithMocks({ + npm: { + flatOptions: { registry: 'https://registry.npmjs.org' }, + config: { + getCredentialsByURI: (uri) => { + t.equal(uri, 'https://registry.npmjs.org', 'requests correct registry') + return { token: 'thisisnotarealtoken' } + } + } + }, + log: { + gauge: { + show: (name) => { + t.equal(name, 'token', 'starts a gauge') + } + }, + newItem: (action, len) => { + t.equal(action, 'removing tokens') + t.equal(len, 0) + return { + info: (name, progress) => { + t.equal(name, 'token') + t.equal(progress, 'getting existing list') + } + } + } + }, + profile: { + listTokens: () => Promise.resolve([ + { key: 'abcd1234' } + ]) + } + }) + + t.tearDown(reset) + + token(['rm', 'efgh'], (err) => { + t.match(err.message, 'Unknown token id or value "efgh".') + }) +}) + +test('token create', (t) => { + t.plan(15) + + const now = new Date().toISOString() + const password = 'thisisnotreallyapassword' + + const [token, reset] = tokenWithMocks({ + npm: { + flatOptions: { registry: 'https://registry.npmjs.org', cidr: ['10.0.0.0/8', '192.168.1.0/24'] }, + config: { + getCredentialsByURI: (uri) => { + t.equal(uri, 'https://registry.npmjs.org', 'requests correct registry') + return { token: 'thisisnotarealtoken' } + } + } + }, + log: { + gauge: { + show: (name) => { + t.equal(name, 'token', 'starts a gauge') + } + }, + info: (name, message) => { + t.equal(name, 'token') + t.equal(message, 'creating') + } + }, + readUserInfo: { + password: () => Promise.resolve(password) + }, + profile: { + createToken: (pw, readonly, cidr) => { + t.equal(pw, password) + t.equal(readonly, undefined) + t.same(cidr, ['10.0.0.0/8', '192.168.1.0/24'], 'defaults to empty array') + return { + key: 'abcd1234', + token: 'efgh5678', + created: now, + updated: now, + readonly: false, + cidr_whitelist: [] + } + } + }, + output: (spec) => { + const lines = spec.split(/\r?\n/) + t.match(lines[1], 'token') + t.match(lines[1], 'efgh5678', 'prints the whole token') + t.match(lines[3], 'created') + t.match(lines[3], now, 'prints the correct timestamp') + t.match(lines[5], 'readonly') + t.match(lines[5], 'false', 'prints the readonly flag') + t.match(lines[7], 'cidr_whitelist') + } + }) + + t.tearDown(reset) + + token(['create'], (err) => { + t.ifError(err, 'npm token create') + }) +}) + +test('token create json output', (t) => { + t.plan(10) + + const now = new Date().toISOString() + const password = 'thisisnotreallyapassword' + + const [token, reset] = tokenWithMocks({ + npm: { + flatOptions: { registry: 'https://registry.npmjs.org', json: true }, + config: { + getCredentialsByURI: (uri) => { + t.equal(uri, 'https://registry.npmjs.org', 'requests correct registry') + return { token: 'thisisnotarealtoken' } + } + } + }, + log: { + gauge: { + show: (name) => { + t.equal(name, 'token', 'starts a gauge') + } + }, + info: (name, message) => { + t.equal(name, 'token') + t.equal(message, 'creating') + } + }, + readUserInfo: { + password: () => Promise.resolve(password) + }, + profile: { + createToken: (pw, readonly, cidr) => { + t.equal(pw, password) + t.equal(readonly, undefined) + t.same(cidr, [], 'defaults to empty array') + return { + key: 'abcd1234', + token: 'efgh5678', + created: now, + updated: now, + readonly: false, + cidr_whitelist: [] + } + } + }, + output: (spec) => { + t.type(spec, 'string', 'outputs a string') + const parsed = JSON.parse(spec) + t.same(parsed, { token: 'efgh5678', created: now, readonly: false, cidr_whitelist: [] }, 'outputs the correct object') + } + }) + + t.tearDown(reset) + + token(['create'], (err) => { + t.ifError(err, 'npm token create') + }) +}) + +test('token create parseable output', (t) => { + t.plan(12) + + const now = new Date().toISOString() + const password = 'thisisnotreallyapassword' + + let callCount = 0 + const [token, reset] = tokenWithMocks({ + npm: { + flatOptions: { registry: 'https://registry.npmjs.org', parseable: true }, + config: { + getCredentialsByURI: (uri) => { + t.equal(uri, 'https://registry.npmjs.org', 'requests correct registry') + return { token: 'thisisnotarealtoken' } + } + } + }, + log: { + gauge: { + show: (name) => { + t.equal(name, 'token', 'starts a gauge') + } + }, + info: (name, message) => { + t.equal(name, 'token') + t.equal(message, 'creating') + } + }, + readUserInfo: { + password: () => Promise.resolve(password) + }, + profile: { + createToken: (pw, readonly, cidr) => { + t.equal(pw, password) + t.equal(readonly, undefined) + t.same(cidr, [], 'defaults to empty array') + return { + key: 'abcd1234', + token: 'efgh5678', + created: now, + updated: now, + readonly: false, + cidr_whitelist: [] + } + } + }, + output: (spec) => { + ++callCount + if (callCount === 1) { + t.match(spec, 'token\tefgh5678', 'prints the token') + } else if (callCount === 2) { + t.match(spec, `created\t${now}`, 'prints the created timestamp') + } else if (callCount === 3) { + t.match(spec, 'readonly\tfalse', 'prints the readonly flag') + } else { + t.match(spec, 'cidr_whitelist\t', 'prints the cidr whitelist') + } + } + }) + + t.tearDown(reset) + + token(['create'], (err) => { + t.ifError(err, 'npm token create') + }) +}) + +test('token create ipv6 cidr', (t) => { + t.plan(4) + + const now = new Date().toISOString() + const password = 'thisisnotreallyapassword' + + const [token, reset] = tokenWithMocks({ + npm: { + flatOptions: { registry: 'https://registry.npmjs.org', cidr: '::1/128' }, config: { + getCredentialsByURI: (uri) => { + t.equal(uri, 'https://registry.npmjs.org', 'requests correct registry') + return { token: 'thisisnotarealtoken' } + } + } + }, + log: { + gauge: { + show: (name) => { + t.equal(name, 'token', 'starts a gauge') + } + } + }, + readUserInfo: { + password: () => Promise.resolve(password) + } + }) + + t.tearDown(reset) + + token(['create'], (err) => { + t.equal(err.message, 'CIDR whitelist can only contain IPv4 addresses, ::1/128 is IPv6', 'returns correct error') + t.equal(err.code, 'EINVALIDCIDR') + }) +}) + +test('token create invalid cidr', (t) => { + t.plan(4) + + const now = new Date().toISOString() + const password = 'thisisnotreallyapassword' + + const [token, reset] = tokenWithMocks({ + npm: { + flatOptions: { registry: 'https://registry.npmjs.org', cidr: 'apple/cider' }, config: { + getCredentialsByURI: (uri) => { + t.equal(uri, 'https://registry.npmjs.org', 'requests correct registry') + return { token: 'thisisnotarealtoken' } + } + } + }, + log: { + gauge: { + show: (name) => { + t.equal(name, 'token', 'starts a gauge') + } + } + }, + readUserInfo: { + password: () => Promise.resolve(password) + } + }) + + t.tearDown(reset) + + token(['create'], (err) => { + t.equal(err.message, 'CIDR whitelist contains invalid CIDR entry: apple/cider', 'returns correct error') + t.equal(err.code, 'EINVALIDCIDR') + }) +}) diff --git a/deps/npm/test/lib/utils/cleanup-log-files.js b/deps/npm/test/lib/utils/cleanup-log-files.js new file mode 100644 index 00000000000000..ee2c11e62ab7ae --- /dev/null +++ b/deps/npm/test/lib/utils/cleanup-log-files.js @@ -0,0 +1,80 @@ +const t = require('tap') + +const requireInject = require('require-inject') +const glob = require('glob') +const rimraf = require('rimraf') +const mocks = { glob, rimraf } +const cleanup = requireInject('../../../lib/utils/cleanup-log-files.js', { + glob: (...args) => mocks.glob(...args), + rimraf: (...args) => mocks.rimraf(...args) +}) +const { basename } = require('path') + +const fs = require('fs') + +t.test('clean up those files', t => { + const cache = t.testdir({ + _logs: { + '1-debug.log': 'hello', + '2-debug.log': 'hello', + '3-debug.log': 'hello', + '4-debug.log': 'hello', + '5-debug.log': 'hello' + } + }) + const warn = (...warning) => t.fail('failed cleanup', { warning }) + return cleanup(cache, 3, warn).then(() => { + t.strictSame(fs.readdirSync(cache + '/_logs').sort(), [ + '3-debug.log', + '4-debug.log', + '5-debug.log' + ]) + }) +}) + +t.test('nothing to clean up', t => { + const cache = t.testdir({ + _logs: { + '4-debug.log': 'hello', + '5-debug.log': 'hello' + } + }) + const warn = (...warning) => t.fail('failed cleanup', { warning }) + return cleanup(cache, 3, warn).then(() => { + t.strictSame(fs.readdirSync(cache + '/_logs').sort(), [ + '4-debug.log', + '5-debug.log' + ]) + }) +}) + +t.test('glob fail', t => { + mocks.glob = (pattern, cb) => cb(new Error('no globbity')) + t.teardown(() => mocks.glob = glob) + const cache = t.testdir({}) + const warn = (...warning) => t.fail('failed cleanup', { warning }) + return cleanup(cache, 3, warn) +}) + +t.test('rimraf fail', t => { + mocks.rimraf = (file, cb) => cb(new Error('youll never rimraf me!')) + t.teardown(() => mocks.rimraf = rimraf) + + const cache = t.testdir({ + _logs: { + '1-debug.log': 'hello', + '2-debug.log': 'hello', + '3-debug.log': 'hello', + '4-debug.log': 'hello', + '5-debug.log': 'hello' + } + }) + const warnings = [] + const warn = (...warning) => warnings.push(basename(warning[2])) + return cleanup(cache, 3, warn).then(() => { + t.strictSame(warnings.sort((a, b) => a.localeCompare(b)), [ + '1-debug.log', + '2-debug.log' + ]) + }) +}) diff --git a/deps/npm/test/lib/utils/cmd-list.js b/deps/npm/test/lib/utils/cmd-list.js new file mode 100644 index 00000000000000..8e936946b9938e --- /dev/null +++ b/deps/npm/test/lib/utils/cmd-list.js @@ -0,0 +1,4 @@ +const t = require('tap') +const cmdList = require('../../../lib/utils/cmd-list.js') +// just snapshot it so we are made aware if it changes unexpectedly +t.matchSnapshot(cmdList) diff --git a/deps/npm/test/lib/utils/completion/installed-deep.js b/deps/npm/test/lib/utils/completion/installed-deep.js new file mode 100644 index 00000000000000..74c15e8f77c9f8 --- /dev/null +++ b/deps/npm/test/lib/utils/completion/installed-deep.js @@ -0,0 +1,251 @@ +const { resolve } = require('path') +const { test } = require('tap') +const requireInject = require('require-inject') + +let prefix +let globalDir = 'MISSING_GLOBAL_DIR' +const _flatOptions = { + depth: Infinity, + global: false, + get prefix () { return prefix } +} +const installedDeep = requireInject('../../../../lib/utils/completion/installed-deep.js', { + '../../../../lib/npm.js': { + flatOptions: _flatOptions, + get prefix () { return _flatOptions.prefix }, + get globalDir () { return globalDir }, + config: { + get (key) { + return _flatOptions[key] + } + } + } +}) + +const fixture = { + 'package.json': JSON.stringify({ + name: 'test-installed-deep', + version: '1.0.0', + dependencies: { + a: '^1.0.0', + b: '^1.0.0', + c: '^1.0.0' + }, + devDependencies: { + d: '^1.0.0' + }, + peerDependencies: { + e: '^1.0.0' + } + }), + node_modules: { + a: { + 'package.json': JSON.stringify({ + name: 'a', + version: '1.0.0', + dependencies: { + f: '^1.0.0' + } + }) + }, + b: { + 'package.json': JSON.stringify({ + name: 'b', + version: '1.0.0' + }) + }, + c: { + 'package.json': JSON.stringify({ + name: 'c', + version: '1.0.0' + }) + }, + d: { + 'package.json': JSON.stringify({ + name: 'd', + version: '1.0.0' + }) + }, + e: { + 'package.json': JSON.stringify({ + name: 'e', + version: '1.0.0' + }) + }, + f: { + 'package.json': JSON.stringify({ + name: 'f', + version: '1.0.0', + dependencies: { + g: '^1.0.0', + e: '^2.0.0' + } + }), + node_modules: { + e: { + 'package.json': JSON.stringify({ + name: 'e', + version: '2.0.0', + dependencies: { + bb: '^1.0.0' + } + }), + node_modules: { + bb: { + 'package.json': JSON.stringify({ + name: 'bb', + version: '1.0.0' + }) + } + } + } + } + }, + g: { + 'package.json': JSON.stringify({ + name: 'g', + version: '1.0.0' + }) + } + } +} + +const globalFixture = { + node_modules: { + foo: { + 'package.json': JSON.stringify({ + name: 'foo', + version: '1.0.0' + }) + }, + bar: { + 'package.json': JSON.stringify({ + name: 'bar', + version: '1.0.0', + dependencies: { + 'a-bar': '^1.0.0' + } + }), + node_modules: { + 'a-bar': { + 'package.json': JSON.stringify({ + name: 'a-bar', + version: '1.0.0' + }) + } + } + } + } +} + +test('get list of package names', (t) => { + const fix = t.testdir({ + local: fixture, + global: globalFixture + }) + + prefix = resolve(fix, 'local') + globalDir = resolve(fix, 'global/node_modules') + + installedDeep(null, (err, res) => { + t.ifError(err, 'should not error out') + t.deepEqual( + res, + [ + [ 'bar', '-g' ], + [ 'foo', '-g' ], + [ 'a-bar', '-g' ], + 'a', 'b', 'c', + 'd', 'e', 'f', + 'g', 'bb' + ], + 'should return list of package names and global flag' + ) + t.end() + }) +}) + +test('get list of package names as global', (t) => { + const fix = t.testdir({ + local: fixture, + global: globalFixture + }) + + prefix = resolve(fix, 'local') + globalDir = resolve(fix, 'global/node_modules') + + _flatOptions.global = true + + installedDeep(null, (err, res) => { + t.ifError(err, 'should not error out') + t.deepEqual( + res, + [ + 'bar', + 'foo', + 'a-bar' + ], + 'should return list of global packages with no extra flags' + ) + _flatOptions.global = false + t.end() + }) +}) + +test('limit depth', (t) => { + const fix = t.testdir({ + local: fixture, + global: globalFixture + }) + + prefix = resolve(fix, 'local') + globalDir = resolve(fix, 'global/node_modules') + + _flatOptions.depth = 0 + + installedDeep(null, (err, res) => { + t.ifError(err, 'should not error out') + t.deepEqual( + res, + [ + [ 'bar', '-g' ], + [ 'foo', '-g' ], + 'a', 'b', + 'c', 'd', + 'e', 'f', + 'g' + ], + 'should print only packages up to the specified depth' + ) + _flatOptions.depth = 0 + t.end() + }) +}) + +test('limit depth as global', (t) => { + const fix = t.testdir({ + local: fixture, + global: globalFixture + }) + + prefix = resolve(fix, 'local') + globalDir = resolve(fix, 'global/node_modules') + + _flatOptions.global = true + _flatOptions.depth = 0 + + installedDeep(null, (err, res) => { + t.ifError(err, 'should not error out') + t.deepEqual( + res, + [ + 'bar', + 'foo' + ], + 'should reorder so that packages above that level depth goes last' + ) + _flatOptions.global = false + _flatOptions.depth = 0 + t.end() + }) +}) diff --git a/deps/npm/test/lib/utils/completion/installed-shallow.js b/deps/npm/test/lib/utils/completion/installed-shallow.js new file mode 100644 index 00000000000000..eb628a8ce81e31 --- /dev/null +++ b/deps/npm/test/lib/utils/completion/installed-shallow.js @@ -0,0 +1,111 @@ +const requireInject = require('require-inject') +const flatOptions = { global: false } +const npm = { flatOptions } +const t = require('tap') +const { resolve } = require('path') + +const p = '../../../../lib/utils/completion/installed-shallow.js' +const installed = requireInject(p, { + '../../../../lib/npm.js': npm +}) + +t.test('global not set, include globals with -g', t => { + const dir = t.testdir({ + global: { + node_modules: { + x: {}, + '@scope': { + y: {} + } + } + }, + local: { + node_modules: { + a: {}, + '@scope': { + b: {} + } + } + } + }) + npm.globalDir = resolve(dir, 'global/node_modules') + npm.localDir = resolve(dir, 'local/node_modules') + flatOptions.global = false + const opt = { conf: { argv: { remain: [] } } } + installed(opt, (er, res) => { + if (er) { + throw er + } + t.strictSame(res.sort(), [ + '@scope/y -g', + 'x -g', + 'a', + '@scope/b' + ].sort()) + t.end() + }) +}) + +t.test('global set, include globals and not locals', t => { + const dir = t.testdir({ + global: { + node_modules: { + x: {}, + '@scope': { + y: {} + } + } + }, + local: { + node_modules: { + a: {}, + '@scope': { + b: {} + } + } + } + }) + npm.globalDir = resolve(dir, 'global/node_modules') + npm.localDir = resolve(dir, 'local/node_modules') + flatOptions.global = true + const opt = { conf: { argv: { remain: [] } } } + installed(opt, (er, res) => { + t.strictSame(res.sort(), [ + '@scope/y', + 'x' + ].sort()) + t.end() + }) +}) + +t.test('more than 3 items in argv, skip it', t => { + const dir = t.testdir({ + global: { + node_modules: { + x: {}, + '@scope': { + y: {} + } + } + }, + local: { + node_modules: { + a: {}, + '@scope': { + b: {} + } + } + } + }) + npm.globalDir = resolve(dir, 'global/node_modules') + npm.localDir = resolve(dir, 'local/node_modules') + flatOptions.global = false + const opt = { conf: { argv: { remain: [1, 2, 3, 4, 5, 6] } } } + installed(opt, (er, res) => { + if (er) { + throw er + } + t.strictSame(res, null) + t.end() + }) +}) diff --git a/deps/npm/test/lib/utils/completion/none.js b/deps/npm/test/lib/utils/completion/none.js new file mode 100644 index 00000000000000..27f713b81e16b8 --- /dev/null +++ b/deps/npm/test/lib/utils/completion/none.js @@ -0,0 +1,6 @@ +const t = require('tap') +const none = require('../../../../lib/utils/completion/none.js') +none({any:'thing'}, (er, res) => { + t.equal(er, null) + t.strictSame(res, []) +}) diff --git a/deps/npm/test/lib/utils/config.js b/deps/npm/test/lib/utils/config.js new file mode 100644 index 00000000000000..90789a8db0bc22 --- /dev/null +++ b/deps/npm/test/lib/utils/config.js @@ -0,0 +1,172 @@ +const t = require('tap') +const requireInject = require('require-inject') +Object.defineProperty(process, 'umask', { + value: () => 0o26, + writable: true, + configurable: true, + enumerable: true +}) + +// have to fake the node version, or else it'll only pass on this one +Object.defineProperty(process, 'version', { + value: 'v14.8.0' +}) + +t.formatSnapshot = obj => { + if (typeof obj !== 'object' || !obj || !obj.types) { + return obj + } + return { + ...obj, + defaults: { + ...obj.defaults, + cache: '{CACHE DIR} ' + path.basename(obj.defaults.cache) + }, + types: formatTypes(obj.types) + } +} + +const path = require('path') +const url = require('url') +const semver = require('semver') + +const formatTypes = (types) => Object.entries(types).map(([key, value]) => { + return [key, formatTypeValue(value)] +}).reduce((set, [key, value]) => { + set[key] = value + return set +}, {}) + +const formatTypeValue = (value) => { + if (Array.isArray(value)) { + return value.map(formatTypeValue) + } else if (value === url) { + return '{URL MODULE}' + } else if (value === path) { + return '{PATH MODULE}' + } else if (value === semver) { + return '{SEMVER MODULE}' + } else if (typeof value === 'function') { + return `{${value.name} TYPE}` + } else { + return value + } +} + +process.env.ComSpec = 'cmd.exe' +process.env.SHELL = '/usr/local/bin/bash' +process.env.LANG = 'UTF-8' +delete process.env.LC_ALL +delete process.env.LC_CTYPE +process.env.EDITOR = 'vim' +process.env.VISUAL = 'mate' + +const networkInterfacesThrow = () => { + throw new Error('no network interfaces for some reason') +} +const networkInterfaces = () => ({ + 'eth420': [{ address: '127.0.0.1' }], + 'eth69': [{ address: 'no place like home' }] +}) +const tmpdir = () => '/tmp' +const os = { networkInterfaces, tmpdir } + +t.test('working network interfaces, not windows', t => { + const config = requireInject('../../../lib/utils/config.js', { + os, + '@npmcli/ci-detect': () => false, + '../../../lib/utils/is-windows.js': false + }) + t.matchSnapshot(config) + t.end() +}) + +t.test('no working network interfaces, on windows', t => { + const config = requireInject('../../../lib/utils/config.js', { + os: { tmpdir, networkInterfaces: networkInterfacesThrow }, + '@npmcli/ci-detect': () => false, + '../../../lib/utils/is-windows.js': true + }) + t.matchSnapshot(config) + t.end() +}) + +t.test('no process.umask() method', t => { + Object.defineProperty(process, 'umask', { + value: null, + writable: true, + configurable: true, + enumerable: true + }) + t.teardown(() => { + Object.defineProperty(process, 'umask', { + value: () => 0o26, + writable: true, + configurable: true, + enumerable: true + }) + }) + const config = requireInject('../../../lib/utils/config.js', { + os: { tmpdir, networkInterfaces: networkInterfacesThrow }, + '@npmcli/ci-detect': () => false, + '../../../lib/utils/is-windows.js': true + }) + t.equal(config.defaults.umask, 0o22) + t.matchSnapshot(config) + t.end() +}) + +t.test('no comspec on windows', t => { + delete process.env.ComSpec + const config = requireInject('../../../lib/utils/config.js', { + os: { tmpdir, networkInterfaces: networkInterfacesThrow }, + '@npmcli/ci-detect': () => false, + '../../../lib/utils/is-windows.js': true + }) + t.equal(config.defaults.shell, 'cmd') + t.end() +}) + +t.test('no shell on posix', t => { + delete process.env.SHELL + const config = requireInject('../../../lib/utils/config.js', { + os, + '@npmcli/ci-detect': () => false, + '../../../lib/utils/is-windows.js': false + }) + t.equal(config.defaults.shell, 'bash') + t.end() +}) + +t.test('no EDITOR env, use VISUAL', t => { + delete process.env.EDITOR + const config = requireInject('../../../lib/utils/config.js', { + os, + '@npmcli/ci-detect': () => false, + '../../../lib/utils/is-windows.js': false + }) + t.equal(config.defaults.editor, 'mate') + t.end() +}) + +t.test('no VISUAL, use system default, not windows', t => { + delete process.env.VISUAL + const config = requireInject('../../../lib/utils/config.js', { + os, + '@npmcli/ci-detect': () => false, + '../../../lib/utils/is-windows.js': false + }) + t.equal(config.defaults.editor, 'vi') + t.end() +}) + +t.test('no VISUAL, use system default, not windows', t => { + delete process.env.VISUAL + const config = requireInject('../../../lib/utils/config.js', { + os, + '@npmcli/ci-detect': () => false, + '../../../lib/utils/is-windows.js': true + }) + t.equal(config.defaults.editor, 'notepad.exe') + t.end() +}) diff --git a/deps/npm/test/lib/utils/deref-command.js b/deps/npm/test/lib/utils/deref-command.js new file mode 100644 index 00000000000000..474488c58c254e --- /dev/null +++ b/deps/npm/test/lib/utils/deref-command.js @@ -0,0 +1,9 @@ +const t = require('tap') +const deref = require('../../../lib/utils/deref-command.js') + +t.equal(deref(null), '') +t.equal(deref(8), '') +t.equal(deref('it'), 'install-test') +t.equal(deref('installTe'), 'install-test') +t.equal(deref('birthday'), 'birthday') +t.equal(deref('birt'), '') diff --git a/deps/npm/test/lib/utils/did-you-mean.js b/deps/npm/test/lib/utils/did-you-mean.js new file mode 100644 index 00000000000000..0c9c95c7f9e60f --- /dev/null +++ b/deps/npm/test/lib/utils/did-you-mean.js @@ -0,0 +1,7 @@ +const t = require('tap') +const dym = require('../../../lib/utils/did-you-mean.js') +t.equal(dym('asdfa', ['asdf', 'asfd', 'adfs', 'safd', 'foobarbaz', 'foobar']), + '\nDid you mean this?\n asdf') +t.equal(dym('asdfa', ['asdf', 'sdfa', 'foo', 'bar', 'fdsa']), + '\nDid you mean one of these?\n asdf\n sdfa') +t.equal(dym('asdfa', ['install', 'list', 'test']), '') diff --git a/deps/npm/test/lib/utils/error-handler.js b/deps/npm/test/lib/utils/error-handler.js new file mode 100644 index 00000000000000..840b3a35650313 --- /dev/null +++ b/deps/npm/test/lib/utils/error-handler.js @@ -0,0 +1,522 @@ +/* eslint-disable no-extend-native */ +/* eslint-disable no-global-assign */ +const EventEmitter = require('events') +const requireInject = require('require-inject') +const t = require('tap') + +// NOTE: Although these unit tests may look like the rest on the surface, +// they are in fact very special due to the amount of things hooking directly +// to global process and variables defined in the module scope. That makes +// for tests that are very interdependent and their order are important. + +// generic error to be used in tests +const err = Object.assign(new Error('ERROR'), { code: 'ERROR' }) +err.stack = 'Error: ERROR' + +const redactCwd = (path) => { + const normalizePath = p => p + .replace(/\\+/g, '/') + .replace(/\r\n/g, '\n') + return normalizePath(path) + .replace(new RegExp(normalizePath(process.cwd()), 'g'), '{CWD}') +} + +t.cleanSnapshot = (str) => redactCwd(str) + +// internal modules mocks +const cacheFile = { + append: () => null, + write: () => null +} +const config = { + values: { + cache: 'cachefolder', + timing: true + }, + loaded: true, + updateNotification: null, + get (key) { + return this.values[key] + } +} + +const npm = { + version: '1.0.0', + config +} + +const npmlog = { + disableProgress: () => null, + log (level, ...args) { + this.record.push({ + id: this.record.length, + level, + message: args.reduce((res, i) => `${res} ${i.message ? i.message : i}`, ''), + prefix: level !== 'verbose' ? 'foo' : '' + }) + }, + error (...args) { this.log('error', ...args) }, + info (...args) { this.log('info', ...args) }, + level: 'silly', + levels: { + silly: 0, + verbose: 1, + info: 2, + error: 3, + silent: 4 + }, + notice (...args) { this.log('notice', ...args) }, + record: [], + verbose (...args) { this.log('verbose', ...args) } +} + +const metrics = { + stop: () => null +} + +// overrides OS type/release for cross platform snapshots +const os = require('os') +os.type = () => 'Foo' +os.release = () => '1.0.0' + +// bootstrap tap before cutting off process ref +t.test('ok', (t) => { + t.ok('ok') + t.end() +}) +// cut off process from script so that it won't quit the test runner +// while trying to run through the myriad of cases +const _process = process +process = Object.assign( + new EventEmitter(), + { + argv: ['/node', ..._process.argv.slice(1)], + cwd: _process.cwd, + env: _process.env, + exit () {}, + exitCode: 0, + version: 'v1.0.0', + stdout: { write (_, cb) { cb() } }, + stderr: { write () {} } + } +) +// needs to put process back in its place +// in order for tap to exit properly +t.teardown(() => { + process = _process +}) + +const mocks = { + npmlog, + '../../../lib/npm.js': npm, + '../../../lib/utils/error-message.js': (err) => ({ + ...err, + summary: [['ERR', err.message]], + detail: [['ERR', err.message]] + }), + '../../../lib/utils/metrics.js': metrics, + '../../../lib/utils/cache-file.js': cacheFile +} + +requireInject.installGlobally('../../../lib/utils/error-handler.js', mocks) +let errorHandler = require('../../../lib/utils/error-handler.js') + +t.test('default exit code', (t) => { + t.plan(1) + + // manually simulate timing handlers + process.emit('timing', 'foo', 1) + process.emit('timing', 'foo', 2) + + // generates logfile name with mocked date + const _toISOString = Date.prototype.toISOString + Date.prototype.toISOString = () => 'expecteddate' + + npmlog.level = 'silent' + const _exit = process.exit + process.exit = (code) => { + t.equal(code, 1, 'should default to error code 1') + } + + // skip console.error logs + const _error = console.error + console.error = () => null + + process.emit('exit', 1) + + t.teardown(() => { + npmlog.level = 'silly' + process.exit = _exit + console.error = _error + Date.prototype.toISOString = _toISOString + }) +}) + +t.test('handles unknown error', (t) => { + t.plan(2) + + cacheFile.write = (filename, content) => { + t.equal( + redactCwd(filename), + '{CWD}/cachefolder/_logs/expecteddate-debug.log', + 'should use expected log filename' + ) + t.matchSnapshot( + content, + 'should have expected log contents for unknown error' + ) + } + + errorHandler(err) + + t.teardown(() => { + cacheFile.write = () => null + }) + t.end() +}) + +t.test('npm.config not ready', (t) => { + t.plan(1) + + config.loaded = false + + const _error = console.error + console.error = (msg) => { + t.match( + msg, + /Error: Exit prior to config file resolving./, + 'should exit with config error msg' + ) + } + + errorHandler() + + t.teardown(() => { + console.error = _error + config.loaded = true + }) +}) + +t.test('fail to write logfile', (t) => { + t.plan(1) + + cacheFile.write = () => { + throw err + } + t.teardown(() => { + cacheFile.write = () => null + }) + + t.doesNotThrow( + () => errorHandler(err), + 'should not throw on cache write failure' + ) +}) + +t.test('console.log output using --json', (t) => { + t.plan(1) + + config.values.json = true + + const _log = console.log + console.log = (jsonOutput) => { + t.deepEqual( + JSON.parse(jsonOutput), + { + error: { + code: 'EBADTHING', // should default error code to E[A-Z]+ + summary: 'Error: EBADTHING Something happened', + detail: 'Error: EBADTHING Something happened' + } + }, + 'should output expected json output' + ) + } + + errorHandler(new Error('Error: EBADTHING Something happened')) + + t.teardown(() => { + console.log = _log + delete config.values.json + }) +}) + +t.test('throw a non-error obj', (t) => { + t.plan(3) + + const weirdError = { + code: 'ESOMETHING', + message: 'foo bar' + } + + const _logError = npmlog.error + npmlog.error = (title, err) => { + t.equal(title, 'weird error', 'should name it a weird error') + t.deepEqual(err, weirdError, 'should log given weird error') + } + + const _exit = process.exit + process.exit = (code) => { + t.equal(code, 1, 'should exit with code 1') + } + + errorHandler(weirdError) + + t.teardown(() => { + process.exit = _exit + npmlog.error = _logError + }) +}) + +t.test('throw a string error', (t) => { + t.plan(3) + + const error = 'foo bar' + + const _logError = npmlog.error + npmlog.error = (title, err) => { + t.equal(title, '', 'should have an empty name ref') + t.deepEqual(err, 'foo bar', 'should log string error') + } + + const _exit = process.exit + process.exit = (code) => { + t.equal(code, 1, 'should exit with code 1') + } + + errorHandler(error) + + t.teardown(() => { + process.exit = _exit + npmlog.error = _logError + }) +}) + +t.test('update notification', (t) => { + t.plan(2) + + const updateMsg = 'you should update npm!' + npm.updateNotification = updateMsg + + const _notice = npmlog.notice + npmlog.notice = (prefix, msg) => { + t.equal(prefix, '', 'should have no prefix') + t.equal(msg, updateMsg, 'should show update message') + } + + errorHandler(err) + + t.teardown(() => { + npmlog.notice = _notice + delete npm.updateNotification + }) +}) + +t.test('on exit handler', (t) => { + t.plan(2) + + const _exit = process.exit + process.exit = (code) => { + t.equal(code, 1, 'should default to error code 1') + } + + process.once('timeEnd', (msg) => { + t.equal(msg, 'npm', 'should trigger timeEnd for npm') + }) + + // skip console.error logs + const _error = console.error + console.error = () => null + + process.emit('exit', 1) + + t.teardown(() => { + console.error = _error + process.exit = _exit + }) +}) + +t.test('it worked', (t) => { + t.plan(2) + + config.values.timing = false + + const _exit = process.exit + process.exit = (code) => { + process.exit = _exit + t.equal(code, 0, 'should exit with code 0') + + const _info = npmlog.info + npmlog.info = (msg) => { + npmlog.info = _info + t.equal(msg, 'ok', 'should log ok if "it worked"') + } + + process.emit('exit', 0) + } + + t.teardown(() => { + process.exit = _exit + config.values.timing = true + }) + + errorHandler.exit(0) +}) + +t.test('uses code from errno', (t) => { + t.plan(1) + + // RESET MODULE INTERNAL VARS AND GLOBAL REFS + requireInject.installGlobally.andClearCache('../../../lib/utils/error-handler.js', mocks) + errorHandler = require('../../../lib/utils/error-handler.js') + + npmlog.level = 'silent' + const _exit = process.exit + process.exit = (code) => { + t.equal(code, 127, 'should use set errno') + } + + errorHandler(Object.assign( + new Error('Error with errno'), + { + errno: 127 + } + )) + + t.teardown(() => { + npmlog.level = 'silly' + process.exit = _exit + }) +}) + +t.test('uses exitCode as code if using a number', (t) => { + t.plan(1) + + // RESET MODULE INTERNAL VARS AND GLOBAL REFS + requireInject.installGlobally.andClearCache( + '../../../lib/utils/error-handler.js', + mocks + ) + errorHandler = require('../../../lib/utils/error-handler.js') + + npmlog.level = 'silent' + const _exit = process.exit + process.exit = (code) => { + t.equal(code, 404, 'should use code if a number') + } + + errorHandler(Object.assign( + new Error('Error with code type number'), + { + code: 404 + } + )) + + t.teardown(() => { + npmlog.level = 'silly' + process.exit = _exit + }) +}) + +t.test('call errorHandler with no error', (t) => { + t.plan(1) + + // RESET MODULE INTERNAL VARS AND GLOBAL REFS + requireInject.installGlobally.andClearCache( + '../../../lib/utils/error-handler.js', + mocks + ) + errorHandler = require('../../../lib/utils/error-handler.js') + + const _exit = process.exit + process.exit = (code) => { + t.equal(code, 0, 'should exit with code 0') + } + + t.teardown(() => { + process.exit = _exit + }) + + errorHandler() +}) + +t.test('callback called twice', (t) => { + t.plan(2) + + const _verbose = npmlog.verbose + npmlog.verbose = (key, value) => { + t.equal(key, 'stack', 'should log stack in verbose level') + t.match( + value, + /Error: Callback called more than once./, + 'should have expected error msg' + ) + npmlog.verbose = _verbose + } + + errorHandler() +}) + +t.test('defaults to log error msg if stack is missing', (t) => { + t.plan(1) + + const noStackErr = Object.assign( + new Error('Error with no stack'), + { + code: 'ENOSTACK', + errno: 127 + } + ) + delete noStackErr.stack + + npm.config.loaded = false + + const _error = console.error + console.error = (msg) => { + console.error = _error + npm.config.loaded = true + t.equal(msg, 'Error with no stack', 'should use error msg') + } + + errorHandler(noStackErr) +}) + +t.test('set it worked', (t) => { + t.plan(1) + + // RESET MODULE INTERNAL VARS AND GLOBAL REFS + requireInject.installGlobally.andClearCache( + '../../../lib/utils/error-handler.js', + mocks + ) + errorHandler = require('../../../lib/utils/error-handler.js') + + const _exit = process.exit + process.exit = () => { + t.ok('ok') + } + + t.teardown(() => { + process.exit = _exit + }) + + errorHandler.exit(0, true) +}) + +t.test('use exitCode when emitting exit event', (t) => { + t.plan(1) + + npmlog.level = 'silent' + const _exit = process.exit + process.exit = (code) => { + process.exit = _exit + t.equal(code, 1, 'should exit with code 1') + } + + t.teardown(() => { + process.exit = _exit + npmlog.level = 'silly' + }) + + process.emit('exit') +}) diff --git a/deps/npm/test/lib/utils/error-message.js b/deps/npm/test/lib/utils/error-message.js new file mode 100644 index 00000000000000..46df017f4847a7 --- /dev/null +++ b/deps/npm/test/lib/utils/error-message.js @@ -0,0 +1,450 @@ +const t = require('tap') + +// make a bunch of stuff consistent for snapshots + +process.getuid = () => 69 +process.getgid = () => 420 + +Object.defineProperty(process, 'arch', { + value: 'x64', + configurable: true +}) + +const beWindows = () => { + Object.defineProperty(process, 'platform', { + value: 'win32', + configurable: true + }) + delete require.cache[require.resolve('../../../lib/utils/is-windows.js')] +} + +const bePosix = () => { + Object.defineProperty(process, 'platform', { + value: 'posix', + configurable: true + }) + delete require.cache[require.resolve('../../../lib/utils/is-windows.js')] +} + +const { resolve } = require('path') +const npm = require('../../../lib/npm.js') +const CACHE = '/some/cache/dir' +npm.config = { + loaded: false, + localPrefix: '/some/prefix/dir', + get: key => { + if (key === 'cache') { + return CACHE + } else if (key === 'node-version') { + return '99.99.99' + } else if (key === 'global') { + return false + } else { + throw new Error('unexpected config lookup: ' + key) + } + } +} + +npm.version = '123.69.420-npm' +Object.defineProperty(process, 'version', { + value: '123.69.420-node', + configurable: true +}) + +const npmlog = require('npmlog') +const verboseLogs = [] +npmlog.verbose = (...message) => { + verboseLogs.push(message) +} + +const requireInject = require('require-inject') +const EXPLAIN_CALLED = [] +const errorMessage = requireInject('../../../lib/utils/error-message.js', { + '../../../lib/utils/explain-eresolve.js': { + report: (...args) => { + EXPLAIN_CALLED.push(args) + return 'explanation' + } + } +}) + +t.test('just simple messages', t => { + npm.command = 'audit' + const codes = [ + 'ENOAUDIT', + 'ENOLOCK', + 'ECONNREFUSED', + 'ENOGIT', + 'EPUBLISHCONFLICT', + 'EISGIT', + 'EEXIST', + 'ENEEDAUTH', + 'ECONNRESET', + 'ENOTFOUND', + 'ETIMEDOUT', + 'EAI_FAIL', + 'EBADENGINE', + 'ENOSPC', + 'EROFS', + 'ENOENT', + 'EMISSINGARG', + 'EUNKNOWNTYPE', + 'EINVALIDTYPE', + 'ETOOMANYARGS', + 'ETARGET', + 'E403' + ] + t.plan(codes.length) + codes.forEach(code => { + const path = '/some/path' + const pkgid = 'some@package' + const file = '/some/file' + const stack = 'dummy stack trace' + const required = { node: '1.2.3', npm: '4.2.0' } + const er = Object.assign(new Error('foo'), { + code, + path, + pkgid, + file, + stack + }) + t.matchSnapshot(errorMessage(er)) + }) +}) + +t.test('bad engine with config loaded', t => { + npm.config.loaded = true + t.teardown(() => { npm.config.loaded = false }) + const path = '/some/path' + const pkgid = 'some@package' + const file = '/some/file' + const stack = 'dummy stack trace' + const required = { node: '1.2.3', npm: '4.2.0' } + const er = Object.assign(new Error('foo'), { + code: 'EBADENGINE', + path, + pkgid, + file, + stack + }) + t.matchSnapshot(errorMessage(er)) + t.end() +}) + +t.test('enoent without a file', t => { + const path = '/some/path' + const pkgid = 'some@package' + const file = '/some/file' + const stack = 'dummy stack trace' + const required = { node: '1.2.3', npm: '4.2.0' } + const er = Object.assign(new Error('foo'), { + code: 'ENOENT', + path, + pkgid, + stack + }) + t.matchSnapshot(errorMessage(er)) + t.end() +}) + +t.test('enolock without a command', t => { + npm.command = null + const path = '/some/path' + const pkgid = 'some@package' + const file = '/some/file' + const stack = 'dummy stack trace' + const required = { node: '1.2.3', npm: '4.2.0' } + const er = Object.assign(new Error('foo'), { + code: 'ENOLOCK', + path, + pkgid, + file, + stack + }) + t.matchSnapshot(errorMessage(er)) + t.end() +}) + +t.test('default message', t => { + t.matchSnapshot(errorMessage(new Error('error object'))) + t.matchSnapshot(errorMessage('error string')) + t.matchSnapshot(errorMessage(Object.assign(new Error('cmd err'), { + cmd: 'some command', + signal: 'SIGYOLO', + args: ['a', 'r', 'g', 's'], + stdout: 'stdout', + stderr: 'stderr' + }))) + t.end() +}) + +t.test('eacces/eperm', t => { + const runTest = (windows, loaded, cachePath, cacheDest) => t => { + if (windows) { + beWindows() + } else { + bePosix() + } + npm.config.loaded = loaded + const path = `${cachePath ? CACHE : '/not/cache/dir'}/path` + const dest = `${cacheDest ? CACHE : '/not/cache/dir'}/dest` + const er = Object.assign(new Error('whoopsie'), { + code: 'EACCES', + path, + dest, + stack: 'dummy stack trace' + }) + verboseLogs.length = 0 + t.matchSnapshot(errorMessage(er)) + t.matchSnapshot(verboseLogs) + t.end() + verboseLogs.length = 0 + } + + for (const windows of [true, false]) { + for (const loaded of [true, false]) { + for (const cachePath of [true, false]) { + for (const cacheDest of [true, false]) { + const m = JSON.stringify({windows, loaded, cachePath, cacheDest}) + t.test(m, runTest(windows, loaded, cachePath, cacheDest)) + } + } + } + } + t.end() +}) + +t.test('json parse', t => { + t.test('merge conflict in package.json', t => { + const dir = t.testdir({ + 'package.json': ` +{ + "array": [ +<<<<<<< HEAD + 100, + { + "foo": "baz" + }, +||||||| merged common ancestors + 1, +======= + 111, + 1, + 2, + 3, + { + "foo": "bar" + }, +>>>>>>> a + 1 + ], + "a": { + "b": { +<<<<<<< HEAD + "c": { + "x": "bbbb" + } +||||||| merged common ancestors + "c": { + "x": "aaaa" + } +======= + "c": "xxxx" +>>>>>>> a + } + } +} +` + }) + const { prefix } = npm + const { argv } = process + t.teardown(() => { + Object.defineProperty(npm, 'prefix', { + value: prefix, + configurable: true + }) + process.argv = argv + }) + Object.defineProperty(npm, 'prefix', { value: dir, configurable: true }) + process.argv = ['arg', 'v'] + const ok = t.matchSnapshot(errorMessage(Object.assign(new Error('conflicted'), { + code: 'EJSONPARSE', + file: resolve(dir, 'package.json') + }))) + t.end() + }) + + t.test('just regular bad json in package.json', t => { + const dir = t.testdir({ + 'package.json': 'not even slightly json' + }) + const { prefix } = npm + const { argv } = process + t.teardown(() => { + Object.defineProperty(npm, 'prefix', { + value: prefix, + configurable: true + }) + process.argv = argv + }) + Object.defineProperty(npm, 'prefix', { value: dir, configurable: true }) + process.argv = ['arg', 'v'] + t.matchSnapshot(errorMessage(Object.assign(new Error('not json'), { + code: 'EJSONPARSE', + file: resolve(dir, 'package.json') + }))) + t.end() + }) + + t.test('json somewhere else', t => { + const dir = t.testdir({ + 'blerg.json': 'not even slightly json' + }) + const { argv } = process + t.teardown(() => { + process.argv = argv + }) + process.argv = ['arg', 'v'] + t.matchSnapshot(errorMessage(Object.assign(new Error('not json'), { + code: 'EJSONPARSE', + file: `${dir}/blerg.json` + }))) + t.end() + }) + + t.end() +}) + +t.test('eotp/e401', t => { + t.test('401, no auth headers', t => { + t.matchSnapshot(errorMessage(Object.assign(new Error('nope'), { + code: 'E401' + }))) + t.end() + }) + + t.test('401, no message', t => { + t.matchSnapshot(errorMessage({ + code: 'E401', + })) + t.end() + }) + + t.test('one-time pass challenge code', t => { + t.matchSnapshot(errorMessage(Object.assign(new Error('nope'), { + code: 'EOTP' + }))) + t.end() + }) + + t.test('one-time pass challenge message', t => { + const message = 'one-time pass' + t.matchSnapshot(errorMessage(Object.assign(new Error(message), { + code: 'E401' + }))) + t.end() + }) + + t.test('www-authenticate challenges', t => { + const auths = [ + 'Bearer realm=do, charset="UTF-8", challenge="yourself"', + 'Basic realm=by, charset="UTF-8", challenge="your friends"', + 'PickACardAnyCard realm=friday, charset="UTF-8"', + 'WashYourHands, charset="UTF-8"' + ] + t.plan(auths.length) + for (const auth of auths) { + t.test(auth, t => { + const er = Object.assign(new Error('challenge!'), { + headers: { + 'www-authenticate': [ auth ] + }, + code: 'E401' + }) + t.matchSnapshot(errorMessage(er)) + t.end() + }) + } + }) + + t.end() +}) + +t.test('404', t => { + t.test('no package id', t => { + const er = Object.assign(new Error('404 not found'), { code: 'E404' }) + t.matchSnapshot(errorMessage(er)) + t.end() + }) + t.test('you should publish it', t => { + const er = Object.assign(new Error('404 not found'), { + pkgid: 'yolo', + code: 'E404' + }) + t.matchSnapshot(errorMessage(er)) + t.end() + }) + t.test('name with warning', t => { + const er = Object.assign(new Error('404 not found'), { + pkgid: new Array(215).fill('x').join(''), + code: 'E404' + }) + t.matchSnapshot(errorMessage(er)) + t.end() + }) + t.test('name with error', t => { + const er = Object.assign(new Error('404 not found'), { + pkgid: 'node_modules', + code: 'E404' + }) + t.matchSnapshot(errorMessage(er)) + t.end() + }) + t.end() +}) + +t.test('bad platform', t => { + t.test('string os/arch', t => { + const er = Object.assign(new Error('a bad plat'), { + pkgid: 'lodash@1.0.0', + current: { + os: 'posix', + cpu: 'x64' + }, + required: { + os: '!yours', + cpu: 'x420' + }, + code: 'EBADPLATFORM' + }) + t.matchSnapshot(errorMessage(er)) + t.end() + }) + t.test('array os/arch', t => { + const er = Object.assign(new Error('a bad plat'), { + pkgid: 'lodash@1.0.0', + current: { + os: 'posix', + cpu: 'x64' + }, + required: { + os: ['!yours', 'mine'], + cpu: ['x420', 'x69'] + }, + code: 'EBADPLATFORM' + }) + t.matchSnapshot(errorMessage(er)) + t.end() + }) + + t.end() +}) + +t.test('explain ERESOLVE errors', t => { + const er = Object.assign(new Error('could not resolve'), { + code: 'ERESOLVE' + }) + t.matchSnapshot(errorMessage(er)) + t.strictSame(EXPLAIN_CALLED, [[er]]) + t.end() +}) diff --git a/deps/npm/test/lib/utils/escape-arg.js b/deps/npm/test/lib/utils/escape-arg.js new file mode 100644 index 00000000000000..413fa47838bac6 --- /dev/null +++ b/deps/npm/test/lib/utils/escape-arg.js @@ -0,0 +1,15 @@ +const requireInject = require('require-inject') +const t = require('tap') +const getEscape = win => requireInject('../../../lib/utils/escape-arg.js', { + '../../../lib/utils/is-windows.js': win, + path: require('path')[win ? 'win32' : 'posix'] +}) + +const winEscape = getEscape(true) +const nixEscape = getEscape(false) + +t.equal(winEscape('hello/to the/world'), '"hello\\to the\\world"') +t.equal(nixEscape(`hello/to-the/world`), `hello/to-the/world`) +t.equal(nixEscape(`hello/to the/world`), `'hello/to the/world'`) +t.equal(nixEscape(`hello/to%the/world`), `'hello/to%the/world'`) +t.equal(nixEscape(`hello/to'the/world`), `'hello/to'"'"'the/world'`) diff --git a/deps/npm/test/lib/utils/escape-exec-path.js b/deps/npm/test/lib/utils/escape-exec-path.js new file mode 100644 index 00000000000000..28fe75c2a98f4f --- /dev/null +++ b/deps/npm/test/lib/utils/escape-exec-path.js @@ -0,0 +1,15 @@ +const requireInject = require('require-inject') +const t = require('tap') +const getEscape = win => requireInject('../../../lib/utils/escape-exec-path.js', { + '../../../lib/utils/is-windows.js': win, + path: require('path')[win ? 'win32' : 'posix'] +}) + +const winEscape = getEscape(true) +const nixEscape = getEscape(false) + +t.equal(winEscape('hello/to the/world'), 'hello\\"to the"\\world') +t.equal(nixEscape(`hello/to-the/world`), `hello/to-the/world`) +t.equal(nixEscape(`hello/to the/world`), `'hello/to the/world'`) +t.equal(nixEscape(`hello/to%the/world`), `'hello/to%the/world'`) +t.equal(nixEscape(`hello/to'the/world`), `'hello/to'"'"'the/world'`) diff --git a/deps/npm/test/lib/utils/explain-dep.js b/deps/npm/test/lib/utils/explain-dep.js new file mode 100644 index 00000000000000..5e54658009e73b --- /dev/null +++ b/deps/npm/test/lib/utils/explain-dep.js @@ -0,0 +1,185 @@ +const t = require('tap') +const requireInject = require('require-inject') +const npm = {} +const { explainNode, printNode } = requireInject('../../../lib/utils/explain-dep.js', { + '../../../lib/npm.js': npm +}) + +const cases = { + prodDep: { + name: 'prod-dep', + version: '1.2.3', + location: 'node_modules/prod-dep', + dependents: [ + { + type: 'prod', + spec: '1.x', + from: { + location: '/path/to/project' + } + } + ] + }, + + deepDev: { + name: 'deep-dev', + version: '2.3.4', + location: 'node_modules/deep-dev', + dev: true, + dependents: [ + { + type: 'prod', + spec: '2.x', + from: { + name: 'metadev', + version: '3.4.5', + location: 'node_modules/dev/node_modules/metadev', + dependents: [ + { + type: 'prod', + spec: '3.x', + from: { + name: 'topdev', + version: '4.5.6', + location: 'node_modules/topdev', + dependents: [ + { + type: 'dev', + spec: '4.x', + from: { + location: '/path/to/project' + } + } + ] + } + } + ] + } + } + ] + }, + + optional: { + name: 'optdep', + version: '1.0.0', + location: 'node_modules/optdep', + optional: true, + dependents: [ + { + type: 'optdep', + spec: '1.0.0', + from: { + location: '/path/to/project' + } + } + ] + }, + + peer: { + name: 'peer', + version: '1.0.0', + location: 'node_modules/peer', + peer: true, + dependents: [ + { + type: 'peer', + spec: '1.0.0', + from: { + location: '/path/to/project' + } + } + ] + }, + + extraneous: { + name: 'extra-neos', + version: '1337.420.69-lol', + location: 'node_modules/extra-neos', + dependents: [], + extraneous: true + } +} + +cases.manyDeps = { + name: 'manydep', + version: '1.0.0', + dependents: [ + { + type: 'prod', + spec: '1.0.0', + from: cases.prodDep + }, + { + type: 'optional', + spec: '1.x', + from: cases.optional + }, + { + type: 'prod', + spec: '1.0.x', + from: cases.extraneous + }, + { + type: 'dev', + spec: '*', + from: cases.deepDev + }, + { + type: 'peer', + spec: '>1.0.0-beta <1.0.1', + from: cases.peer + }, + { + type: 'prod', + spec: '1', + from: { + name: 'a package with a pretty long name', + version: '1.2.3', + dependents: { + location: '/path/to/project' + } + } + }, + { + type: 'prod', + spec: '1', + from: { + name: 'another package with a pretty long name', + version: '1.2.3', + dependents: { + location: '/path/to/project' + } + } + }, + { + type: 'prod', + spec: '1', + from: { + name: 'yet another a package with a pretty long name', + version: '1.2.3', + dependents: { + location: '/path/to/project' + } + } + }, + ] +} + + +for (const [name, expl] of Object.entries(cases)) { + t.test(name, t => { + npm.color = true + t.matchSnapshot(printNode(expl, true), 'print color') + t.matchSnapshot(printNode(expl, false), 'print nocolor') + t.matchSnapshot(explainNode(expl, Infinity, true), 'explain color deep') + t.matchSnapshot(explainNode(expl, 2, false), 'explain nocolor shallow') + t.end() + }) +} + +// make sure that we show the last one if it's the only one that would +// hit the ... +cases.manyDeps.dependents.pop() +t.matchSnapshot(explainNode(cases.manyDeps, 2, false), 'ellipses test one') +cases.manyDeps.dependents.pop() +t.matchSnapshot(explainNode(cases.manyDeps, 2, false), 'ellipses test two') diff --git a/deps/npm/test/lib/utils/explain-eresolve.js b/deps/npm/test/lib/utils/explain-eresolve.js new file mode 100644 index 00000000000000..def13153d242dd --- /dev/null +++ b/deps/npm/test/lib/utils/explain-eresolve.js @@ -0,0 +1,50 @@ +const t = require('tap') +const requireInject = require('require-inject') +const npm = {} +const { explain, report } = requireInject('../../../lib/utils/explain-eresolve.js', { + '../../../lib/npm.js': npm +}) +const { statSync, readFileSync, unlinkSync } = require('fs') +// strip out timestamps from reports +const read = f => readFileSync(f, 'utf8') + .replace(/\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}.\d{3}Z/g, '${TIME}') + +const { resolve } = require('path') + +const cases = require('../../fixtures/eresolve-explanations.js') + +for (const [name, expl] of Object.entries(cases)) { + // no sense storing the whole contents of each object in the snapshot + // we can trust that JSON.stringify still works just fine. + expl.toJSON = () => { + return { name, json: true } + } + + t.test(name, t => { + npm.cache = t.testdir() + const reportFile = resolve(npm.cache, 'eresolve-report.txt') + t.cleanSnapshot = str => str.split(reportFile).join('${REPORT}') + + npm.color = true + t.matchSnapshot(report(expl), 'report with color') + const reportData = read(reportFile) + t.matchSnapshot(reportData, 'report') + unlinkSync(reportFile) + t.matchSnapshot(report(expl, 2), 'report with color, depth only 2') + t.equal(read(reportFile), reportData, 'same report written for object') + unlinkSync(reportFile) + npm.color = false + t.matchSnapshot(report(expl, 6), 'report with no color, depth of 6') + t.equal(read(reportFile), reportData, 'same report written for object') + + unlinkSync(reportFile) + npm.color = true + t.matchSnapshot(explain(expl), 'explain with color') + t.throws(() => statSync(reportFile), { code: 'ENOENT' }, 'no report') + npm.color = false + t.matchSnapshot(explain(expl, 6), 'explain with no color, depth of 6') + t.throws(() => statSync(reportFile), { code: 'ENOENT' }, 'no report') + + t.end() + }) +} diff --git a/deps/npm/test/lib/utils/flat-options.js b/deps/npm/test/lib/utils/flat-options.js new file mode 100644 index 00000000000000..f18ce828c3e1d8 --- /dev/null +++ b/deps/npm/test/lib/utils/flat-options.js @@ -0,0 +1,328 @@ +const t = require('tap') + +process.env.NODE = '/path/to/some/node' + +const logs = [] +const log = require('npmlog') +log.warn = (...args) => logs.push(['warn', ...args]) +log.verbose = (...args) => logs.push(['verbose', ...args]) + +class Mocknpm { + constructor (opts = {}) { + this.modes = { + exec: 0o777, + file: 0o666, + umask: 0o22 + } + this.color = true + this.projectScope = '@npmcli' + this.tmp = '/tmp' + this.command = null + this.globalPrefix = '/usr/local' + this.localPrefix = '/path/to/npm/cli' + this.prefix = this.localPrefix + this.version = '7.6.5' + this.config = new MockConfig(opts) + this.flatOptions = null + } +} + +class MockConfig { + constructor (opts = {}) { + this.list = [{ + cache: 'cache', + 'node-version': '1.2.3', + global: 'global', + 'metrics-registry': 'metrics-registry', + 'send-metrics': 'send-metrics', + registry: 'registry', + access: 'access', + 'always-auth': 'always-auth', + audit: 'audit', + 'audit-level': 'audit-level', + 'auth-type': 'auth-type', + before: 'before', + browser: 'browser', + ca: 'ca', + cafile: 'cafile', + call: 'call', + cert: 'cert', + key: 'key', + 'cache-lock-retries': 'cache-lock-retries', + 'cache-lock-stale': 'cache-lock-stale', + 'cache-lock-wait': 'cache-lock-wait', + cidr: 'cidr', + 'read-only': 'read-only', + preid: 'preid', + 'tag-version-prefix': 'tag-version-prefix', + 'allow-same-version': 'allow-same-version', + message: 'message', + 'commit-hooks': 'commit-hooks', + 'git-tag-version': 'git-tag-version', + 'sign-git-commit': 'sign-git-commit', + 'sign-git-tag': 'sign-git-tag', + depth: 'depth', + description: 'description', + searchexclude: 'searchexclude', + searchlimit: 'searchlimit', + searchopts: 'searchopts', + searchstaleness: 'searchstaleness', + 'dry-run': 'dry-run', + 'engine-strict': 'engine-strict', + 'fetch-retries': 'fetch-retries', + 'fetch-retry-factor': 'fetch-retry-factor', + 'fetch-retry-mintimeout': 'fetch-retry-mintimeout', + 'fetch-retry-maxtimeout': 'fetch-retry-maxtimeout', + 'fetch-timeout': 'fetch-timeout', + force: 'force', + 'format-package-lock': 'format-package-lock', + fund: 'fund', + git: 'git', + viewer: 'viewer', + editor: 'editor', + 'bin-links': 'bin-links', + 'rebuild-bundle': 'rebuild-bundle', + package: 'package', + 'package-lock': 'package-lock', + 'package-lock-only': 'package-lock-only', + 'global-style': 'global-style', + 'legacy-bundling': 'legacy-bundling', + 'script-shell': 'script-shell', + omit: [], + include: [], + save: 'save', + 'save-bundle': 'save-bundle', + 'save-dev': 'save-dev', + 'save-optional': 'save-optional', + 'save-peer': 'save-peer', + 'save-prod': 'save-prod', + 'save-exact': 'save-exact', + 'save-prefix': 'save-prefix', + otp: 'otp', + offline: 'offline', + 'prefer-online': 'prefer-online', + 'prefer-offline': 'prefer-offline', + 'cache-max': 'cache-max', + 'cache-min': 'cache-min', + 'strict-ssl': 'strict-ssl', + scope: '', + tag: 'tag', + 'user-agent': 'user-agent', + '@scope:registry': '@scope:registry', + '//nerf.dart:_authToken': '//nerf.dart:_authToken', + 'proxy': 'proxy', + 'noproxy': 'noproxy', + ...opts + }] + } + get (key) { + return this.list[0][key] + } + set (key, val) { + this.list[0][key] = val + } +} + +const flatOptions = require('../../../lib/utils/flat-options.js') +t.match(logs, [[ + 'verbose', + 'npm-session', + /^[0-9a-f]{16}$/ +]], 'logged npm session verbosely') +logs.length = 0 + +t.test('basic', t => { + const npm = new Mocknpm() + const generatedFlat = flatOptions(npm) + const clean = { + ...generatedFlat, + npmBin: '/path/to/npm/bin.js', + log: {}, + npmSession: '12345', + cache: generatedFlat.cache.replace(/\\/g, '/') + } + t.matchSnapshot(clean, 'flat options') + t.equal(generatedFlat.npmCommand, null, 'command not set yet') + npm.command = 'view' + t.equal(generatedFlat.npmCommand, 'view', 'command updated via getter') + t.equal(generatedFlat.npmBin, require.main.filename) + // test the object is frozen + generatedFlat.newField = 'asdf' + t.equal(generatedFlat.newField, undefined, 'object is frozen') + const preExistingOpts = { flat: 'options' } + npm.flatOptions = preExistingOpts + t.equal(flatOptions(npm), preExistingOpts, 'use pre-existing npm.flatOptions') + t.end() +}) + +t.test('get preferOffline from cache-min', t => { + const npm = new Mocknpm({ + 'cache-min': 9999999, + 'prefer-offline': undefined + }) + const opts = flatOptions(npm) + t.equal(opts.preferOffline, true, 'got preferOffline from cache min') + logs.length = 0 + t.equal(opts.cacheMin, 9999999, 'opts.cacheMin is set') + t.match(logs, []) + logs.length = 0 + t.end() +}) + +t.test('get preferOnline from cache-max', t => { + const npm = new Mocknpm({ + 'cache-max': -1, + 'prefer-online': undefined + }) + const opts = flatOptions(npm) + t.equal(opts.preferOnline, true, 'got preferOnline from cache min') + logs.length = 0 + t.equal(opts.cacheMax, -1, 'opts.cacheMax is set') + t.match(logs, []) + logs.length = 0 + t.end() +}) + +t.test('tag emits warning', t => { + const npm = new Mocknpm({ tag: 'foobar' }) + t.equal(flatOptions(npm).tag, 'foobar', 'tag is foobar') + t.match(logs, []) + logs.length = 0 + t.end() +}) + +t.test('omit/include options', t => { + t.test('omit explicitly', t => { + const npm = new Mocknpm({ + omit: ['dev', 'optional', 'peer'] + }) + t.strictSame(flatOptions(npm).omit, ['dev', 'optional', 'peer']) + t.end() + }) + + t.test('omit and include some', t => { + const npm = new Mocknpm({ + omit: ['dev', 'optional', 'peer'], + include: ['peer'] + }) + t.strictSame(flatOptions(npm).omit, ['dev', 'optional']) + t.end() + }) + + t.test('dev flag', t => { + const npm = new Mocknpm({ + omit: ['dev', 'optional', 'peer'], + include: [], + dev: true + }) + t.strictSame(flatOptions(npm).omit, ['optional', 'peer']) + t.end() + }) + + t.test('production flag', t => { + const npm = new Mocknpm({ + omit: [], + include: [], + production: true + }) + t.strictSame(flatOptions(npm).omit, ['dev']) + t.end() + }) + + t.test('only', t => { + const cases = ['prod', 'production'] + t.plan(cases.length) + cases.forEach(c => t.test(c, t => { + const npm = new Mocknpm({ + omit: [], + include: [], + only: c + }) + t.strictSame(flatOptions(npm).omit, ['dev']) + t.end() + })) + }) + + t.test('also dev', t => { + const npm = new Mocknpm({ + omit: ['dev', 'optional', 'peer'], + also: 'dev' + }) + t.strictSame(flatOptions(npm).omit, ['optional', 'peer']) + t.end() + }) + + t.test('no-optional', t => { + const npm = new Mocknpm({ + optional: false, + omit: null, + include: null + }) + t.strictSame(flatOptions(npm).omit, ['optional']) + t.end() + }) + + t.end() +}) + +t.test('get the node without the environ', t => { + delete process.env.NODE + t.equal(flatOptions(new Mocknpm()).nodeBin, process.execPath) + t.end() +}) + +t.test('various default values and falsey fallbacks', t => { + const npm = new Mocknpm({ + 'script-shell': false, + registry: 'http://example.com', + 'metrics-registry': null, + 'searchlimit': 0, + 'save-exact': false, + 'save-prefix': '>=' + }) + const opts = flatOptions(npm) + t.equal(opts.scriptShell, undefined, 'scriptShell is undefined if falsey') + t.equal(opts.metricsRegistry, 'http://example.com', + 'metricsRegistry defaults to registry') + t.equal(opts.search.limit, 20, 'searchLimit defaults to 20') + t.equal(opts.savePrefix, '>=', 'save-prefix respected if no save-exact') + t.equal(opts.scope, '', 'scope defaults to empty string') + logs.length = 0 + t.end() +}) + +t.test('save-type', t => { + const base = { + 'save-optional': false, + 'save-peer': false, + 'save-dev': false, + 'save-prod': false + } + const cases = [ + ['peerOptional', { + 'save-optional': true, + 'save-peer': true, + }], + ['optional', { + 'save-optional': true + }], + ['dev', { + 'save-dev': true + }], + ['peer', { + 'save-peer': true + }], + ['prod', { + 'save-prod': true + }], + [null, {}] + ] + for (const [expect, options] of cases) { + const opts = flatOptions(new Mocknpm({ + ...base, + ...options + })) + t.equal(opts.saveType, expect, JSON.stringify(options)) + } + t.end() +}) diff --git a/deps/npm/test/lib/utils/get-identity.js b/deps/npm/test/lib/utils/get-identity.js new file mode 100644 index 00000000000000..c72f48b2e8f62a --- /dev/null +++ b/deps/npm/test/lib/utils/get-identity.js @@ -0,0 +1,107 @@ +const { test } = require('tap') +const requireInject = require('require-inject') + +test('throws ENOREGISTRY when no registry option is provided', async (t) => { + t.plan(2) + const getIdentity = requireInject('../../../lib/utils/get-identity.js', { + '../../../lib/npm.js': {} + }) + + try { + await getIdentity() + } catch (err) { + t.equal(err.code, 'ENOREGISTRY', 'assigns the appropriate error code') + t.equal(err.message, 'No registry specified.', 'returns the correct error message') + } +}) + +test('returns username from uri when provided', async (t) => { + t.plan(1) + + const getIdentity = requireInject('../../../lib/utils/get-identity.js', { + '../../../lib/npm.js': { + config: { + getCredentialsByURI: () => { + return { username: 'foo' } + } + } + } + }) + + const identity = await getIdentity({ registry: 'https://registry.npmjs.org' }) + t.equal(identity, 'foo', 'returns username from uri') +}) + +test('calls registry whoami when token is provided', async (t) => { + t.plan(3) + + const options = { + registry: 'https://registry.npmjs.org', + token: 'thisisnotreallyatoken' + } + + const getIdentity = requireInject('../../../lib/utils/get-identity.js', { + '../../../lib/npm.js': { + config: { + getCredentialsByURI: () => options + } + }, + 'npm-registry-fetch': { + json: (path, opts) => { + t.equal(path, '/-/whoami', 'calls whoami') + t.same(opts, options, 'passes through provided options') + return { username: 'foo' } + } + } + }) + + const identity = await getIdentity(options) + t.equal(identity, 'foo', 'fetched username from registry') +}) + +test('throws ENEEDAUTH when response does not include a username', async (t) => { + t.plan(3) + + const options = { + registry: 'https://registry.npmjs.org', + token: 'thisisnotreallyatoken' + } + + const getIdentity = requireInject('../../../lib/utils/get-identity.js', { + '../../../lib/npm.js': { + config: { + getCredentialsByURI: () => options + } + }, + 'npm-registry-fetch': { + json: (path, opts) => { + t.equal(path, '/-/whoami', 'calls whoami') + t.same(opts, options, 'passes through provided options') + return {} + } + } + }) + + try { + await getIdentity(options) + } catch (err) { + t.equal(err.code, 'ENEEDAUTH', 'throws correct error code') + } +}) + +test('throws ENEEDAUTH when neither username nor token is configured', async (t) => { + t.plan(1) + const getIdentity = requireInject('../../../lib/utils/get-identity.js', { + '../../../lib/npm.js': { + config: { + getCredentialsByURI: () => ({}) + } + } + }) + + try { + await getIdentity({ registry: 'https://registry.npmjs.org' }) + } catch (err) { + t.equal(err.code, 'ENEEDAUTH', 'throws correct error code') + } +}) diff --git a/deps/npm/test/lib/utils/get-project-scope.js b/deps/npm/test/lib/utils/get-project-scope.js new file mode 100644 index 00000000000000..15ab2bdeff1054 --- /dev/null +++ b/deps/npm/test/lib/utils/get-project-scope.js @@ -0,0 +1,48 @@ +const getProjectScope = require('../../../lib/utils/get-project-scope.js') +const t = require('tap') + +t.test('package.json with scope', t => { + const dir = t.testdir({ + 'package.json': JSON.stringify({ name: '@foo/bar' }) + }) + t.equal(getProjectScope(dir), '@foo') + t.end() +}) + +t.test('package.json with slash, but no @', t => { + const dir = t.testdir({ + 'package.json': JSON.stringify({ name: 'foo/bar' }) + }) + t.equal(getProjectScope(dir), '') + t.end() +}) + +t.test('package.json without scope', t => { + const dir = t.testdir({ + 'package.json': JSON.stringify({ name: 'foo' }) + }) + t.equal(getProjectScope(dir), '') + t.end() +}) + +t.test('package.json without name', t => { + const dir = t.testdir({ + 'package.json': JSON.stringify({}) + }) + t.equal(getProjectScope(dir), '') + t.end() +}) + +t.test('package.json not JSON', t => { + const dir = t.testdir({ + 'package.json': 'hello' + }) + t.equal(getProjectScope(dir), '') + t.end() +}) + +t.test('no package.json', t => { + const dir = t.testdir({}) + t.equal(getProjectScope(dir), '') + t.end() +}) diff --git a/deps/npm/test/lib/utils/hosted-git-info-from-manifest.js b/deps/npm/test/lib/utils/hosted-git-info-from-manifest.js new file mode 100644 index 00000000000000..f87cb84eed8232 --- /dev/null +++ b/deps/npm/test/lib/utils/hosted-git-info-from-manifest.js @@ -0,0 +1,21 @@ +const t = require('tap') +const hostedFromMani = require('../../../lib/utils/hosted-git-info-from-manifest.js') +const hostedGitInfo = require('hosted-git-info') + +t.equal(hostedFromMani({}), null) +t.equal(hostedFromMani({ repository: { no: 'url' } }), null) +t.equal(hostedFromMani({ repository: 123 }), null) +t.equal(hostedFromMani({ repository: 'not hosted anywhere' }), null) +t.equal(hostedFromMani({ repository: { url: 'not hosted anywhere' } }), null) + +t.match(hostedFromMani({ + repository: 'git+https://github.com/isaacs/abbrev-js' +}), hostedGitInfo.fromUrl('git+https://github.com/isaacs/abbrev-js')) + +t.match(hostedFromMani({ + repository: { url: 'git+https://github.com/isaacs/abbrev-js' } +}), hostedGitInfo.fromUrl('https://github.com/isaacs/abbrev-js')) + +t.match(hostedFromMani({ + repository: { url: 'git+ssh://git@github.com/isaacs/abbrev-js' } +}), hostedGitInfo.fromUrl('ssh://git@github.com/isaacs/abbrev-js')) diff --git a/deps/npm/test/lib/utils/is-windows-bash.js b/deps/npm/test/lib/utils/is-windows-bash.js new file mode 100644 index 00000000000000..730dfe301bc764 --- /dev/null +++ b/deps/npm/test/lib/utils/is-windows-bash.js @@ -0,0 +1,28 @@ +const t = require('tap') + +const isWindowsBash = () => { + delete require.cache[require.resolve('../../../lib/utils/is-windows-bash.js')] + delete require.cache[require.resolve('../../../lib/utils/is-windows.js')] + return require('../../../lib/utils/is-windows-bash.js') +} + +Object.defineProperty(process, 'platform', { + value: 'posix', + configurable: true +}) +t.equal(isWindowsBash(), false, 'false when not windows') + +Object.defineProperty(process, 'platform', { + value: 'win32', + configurable: true +}) +process.env.MSYSTEM = 'not ming' +process.env.TERM = 'dumb' +t.equal(isWindowsBash(), false, 'false when not mingw or cygwin') + +process.env.TERM = 'cygwin' +t.equal(isWindowsBash(), true, 'true when cygwin') + +process.env.MSYSTEM = 'MINGW64' +process.env.TERM = 'dumb' +t.equal(isWindowsBash(), true, 'true when mingw') diff --git a/deps/npm/test/lib/utils/is-windows-shell.js b/deps/npm/test/lib/utils/is-windows-shell.js new file mode 100644 index 00000000000000..e2164c222be67d --- /dev/null +++ b/deps/npm/test/lib/utils/is-windows-shell.js @@ -0,0 +1,8 @@ +const t = require('tap') +Object.defineProperty(process, 'platform', { + value: 'win32' +}) +const isWindows = require('../../../lib/utils/is-windows.js') +const isWindowsBash = require('../../../lib/utils/is-windows-bash.js') +const isWindowsShell = require('../../../lib/utils/is-windows-shell.js') +t.equal(isWindowsShell, isWindows && !isWindowsBash) diff --git a/deps/npm/test/lib/utils/is-windows.js b/deps/npm/test/lib/utils/is-windows.js new file mode 100644 index 00000000000000..9100071699e771 --- /dev/null +++ b/deps/npm/test/lib/utils/is-windows.js @@ -0,0 +1,8 @@ +const t = require('tap') +const actuallyWindows = process.platform === 'win32' +t.equal(actuallyWindows, require('../../../lib/utils/is-windows.js')) +Object.defineProperty(process, 'platform', { + value: actuallyWindows ? 'posix' : 'win32' +}) +delete require.cache[require.resolve('../../../lib/utils/is-windows.js')] +t.equal(!actuallyWindows, require('../../../lib/utils/is-windows.js')) diff --git a/deps/npm/test/lib/utils/lifecycle-cmd.js b/deps/npm/test/lib/utils/lifecycle-cmd.js new file mode 100644 index 00000000000000..7338229546cf52 --- /dev/null +++ b/deps/npm/test/lib/utils/lifecycle-cmd.js @@ -0,0 +1,18 @@ +const t = require('tap') +const requireInject = require('require-inject') +const lifecycleCmd = requireInject('../../../lib/utils/lifecycle-cmd.js', { + '../../../lib/npm.js': { + commands: { + run: (args, cb) => cb(null, 'called npm.commands.run') + } + } +}) + +t.test('create a lifecycle command', t => { + const cmd = lifecycleCmd('asdf') + t.equal(cmd.completion, require('../../../lib/utils/completion/none.js'), 'empty completion') + cmd(['some', 'args'], (er, result) => { + t.strictSame(result, 'called npm.commands.run') + t.end() + }) +}) diff --git a/deps/npm/test/lib/utils/output.js b/deps/npm/test/lib/utils/output.js new file mode 100644 index 00000000000000..72871187d889ac --- /dev/null +++ b/deps/npm/test/lib/utils/output.js @@ -0,0 +1,8 @@ +const t = require('tap') +const logs = [] +console.log = (...msg) => logs.push(msg) +const output = require('../../../lib/utils/output.js') +output('hello', 'world') +output('hello') +output('world') +t.strictSame(logs, [['hello', 'world'], ['hello'], ['world']]) diff --git a/deps/npm/test/lib/utils/path.js b/deps/npm/test/lib/utils/path.js new file mode 100644 index 00000000000000..facee06459d4c0 --- /dev/null +++ b/deps/npm/test/lib/utils/path.js @@ -0,0 +1,13 @@ +const t = require('tap') +const requireInject = require('require-inject') +const mod = '../../../lib/utils/path.js' +const delim = require('../../../lib/utils/is-windows.js') ? ';' : ':' +Object.defineProperty(process, 'env', { + value: {} +}) +process.env.path = ['foo', 'bar', 'baz'].join(delim) +t.strictSame(requireInject(mod), ['foo', 'bar', 'baz']) +process.env.Path = ['a', 'b', 'c'].join(delim) +t.strictSame(requireInject(mod), ['a', 'b', 'c']) +process.env.PATH = ['x', 'y', 'z'].join(delim) +t.strictSame(requireInject(mod), ['x', 'y', 'z']) diff --git a/deps/npm/test/lib/utils/perf.js b/deps/npm/test/lib/utils/perf.js new file mode 100644 index 00000000000000..9b38a3da8198c7 --- /dev/null +++ b/deps/npm/test/lib/utils/perf.js @@ -0,0 +1,38 @@ +const t = require('tap') +const logs = [] +const npmlog = require('npmlog') +npmlog.silly = (...msg) => logs.push(['silly', ...msg]) +npmlog.timing = (...msg) => logs.push(['timing', ...msg]) + +t.test('time some stuff', t => { + const timings = {} + process.on('timing', (name, value) => { + timings[name] = (timings[name] || 0) + value + }) + require('../../../lib/utils/perf.js') + process.emit('time', 'foo') + process.emit('time', 'bar') + setTimeout(() => { + process.emit('timeEnd', 'foo') + process.emit('timeEnd', 'bar') + process.emit('time', 'foo') + setTimeout(() => { + process.emit('timeEnd', 'foo') + process.emit('timeEnd', 'baz') + t.match(logs, [ + [ 'timing', 'foo', /Completed in [0-9]+ms/ ], + [ 'timing', 'bar', /Completed in [0-9]+ms/ ], + [ 'timing', 'foo', /Completed in [0-9]+ms/ ], + [ + 'silly', + 'timing', + "Tried to end timer that doesn't exist:", + 'baz' + ] + ]) + t.match(timings, { foo: Number, bar: Number }) + t.equal(timings.foo > timings.bar, true, 'foo should be > bar') + t.end() + }, 100) + }, 100) +}) diff --git a/deps/npm/test/lib/utils/ping.js b/deps/npm/test/lib/utils/ping.js new file mode 100644 index 00000000000000..d2b269556e6058 --- /dev/null +++ b/deps/npm/test/lib/utils/ping.js @@ -0,0 +1,36 @@ +const { test } = require('tap') +const requireInject = require('require-inject') + +test('pings', async (t) => { + t.plan(3) + + const options = { fake: 'options' } + const response = { some: 'details' } + const ping = requireInject('../../../lib/utils/ping.js', { + 'npm-registry-fetch': (url, opts) => { + t.equal(url, '/-/ping?write=true', 'calls the correct url') + t.equal(opts, options, 'passes through options') + return { json: () => Promise.resolve(response) } + } + }) + + const res = await ping(options) + t.match(res, response, 'returns json response') +}) + +test('catches errors and returns empty json', async (t) => { + t.plan(3) + + const options = { fake: 'options' } + const response = { some: 'details' } + const ping = requireInject('../../../lib/utils/ping.js', { + 'npm-registry-fetch': (url, opts) => { + t.equal(url, '/-/ping?write=true', 'calls the correct url') + t.equal(opts, options, 'passes through options') + return { json: () => Promise.reject(response) } + } + }) + + const res = await ping(options) + t.match(res, {}, 'returns empty json response') +}) diff --git a/deps/npm/test/lib/utils/proc-log-listener.js b/deps/npm/test/lib/utils/proc-log-listener.js new file mode 100644 index 00000000000000..0a6119d1a1c0ed --- /dev/null +++ b/deps/npm/test/lib/utils/proc-log-listener.js @@ -0,0 +1,38 @@ +const t = require('tap') +const requireInject = require('require-inject') +const { inspect } = require('util') + +const logs = [] +const npmlog = { + warn: (...args) => logs.push(['warn', ...args]), + verbose: (...args) => logs.push(['verbose', ...args]) +} + +requireInject('../../../lib/utils/proc-log-listener.js', { + npmlog +})() + +process.emit('log', 'warn', 'hello', 'i am a warning') +t.strictSame(logs, [['warn', 'hello', 'i am a warning']]) +logs.length = 0 + +const nopeError = new Error('nope') +npmlog.warn = () => { throw nopeError } + +process.emit('log', 'warn', 'fail') +t.strictSame(logs, [[ + 'verbose', + `attempt to log ${inspect(['warn', 'fail'])} crashed`, + nopeError +]]) +logs.length = 0 + +npmlog.verbose = () => { throw nopeError } +const consoleErrors = [] +console.error = (...args) => consoleErrors.push(args) +process.emit('log', 'warn', 'fail2') +t.strictSame(logs, []) +t.strictSame(consoleErrors, [[ + `attempt to log ${inspect(['warn', 'fail2'])} crashed`, + nopeError +]]) diff --git a/deps/npm/test/lib/utils/read-local-package.js b/deps/npm/test/lib/utils/read-local-package.js new file mode 100644 index 00000000000000..8854cf4e5f2179 --- /dev/null +++ b/deps/npm/test/lib/utils/read-local-package.js @@ -0,0 +1,57 @@ +const requireInject = require('require-inject') +const { test } = require('tap') + +let prefix +const _flatOptions = { + json: false, + global: false, + get prefix () { return prefix } +} + +const readLocalPackageName = requireInject('../../../lib/utils/read-local-package.js', { + '../../../lib/npm.js': { + flatOptions: _flatOptions + } +}) + +test('read local package.json', async (t) => { + prefix = t.testdir({ + 'package.json': JSON.stringify({ + name: 'my-local-package', + version: '1.0.0' + }) + }) + const packageName = await readLocalPackageName() + t.equal( + packageName, + 'my-local-package', + 'should retrieve current package name' + ) +}) + +test('read local scoped-package.json', async (t) => { + prefix = t.testdir({ + 'package.json': JSON.stringify({ + name: '@my-scope/my-local-package', + version: '1.0.0' + }) + }) + const packageName = await readLocalPackageName() + t.equal( + packageName, + '@my-scope/my-local-package', + 'should retrieve scoped package name' + ) +}) + +test('read using --global', async (t) => { + prefix = t.testdir({}) + _flatOptions.global = true + const packageName = await readLocalPackageName() + t.equal( + packageName, + undefined, + 'should not retrieve a package name' + ) + _flatOptions.global = false +}) diff --git a/deps/npm/test/lib/utils/reify-output.js b/deps/npm/test/lib/utils/reify-output.js new file mode 100644 index 00000000000000..92a53707f7116c --- /dev/null +++ b/deps/npm/test/lib/utils/reify-output.js @@ -0,0 +1,347 @@ +'use strict' + +const t = require('tap') +const requireInject = require('require-inject') + +const log = require('npmlog') +log.level = 'warn' + +t.cleanSnapshot = str => str.replace(/in [0-9]+m?s/g, 'in {TIME}') + +const settings = { + fund: true +} +const npmock = { + started: Date.now(), + flatOptions: settings +} +const getReifyOutput = tester => + requireInject( + '../../../lib/utils/reify-output.js', + { + '../../../lib/npm.js': npmock, + '../../../lib/utils/output.js': tester + } + ) + +t.test('missing info', (t) => { + t.plan(1) + const reifyOutput = getReifyOutput( + out => t.doesNotHave( + out, + 'looking for funding', + 'should not print fund message if missing info' + ) + ) + + reifyOutput({ + actualTree: { + children: [] + }, + diff: { + children: [] + } + }) +}) + +t.test('even more missing info', t => { + t.plan(1) + const reifyOutput = getReifyOutput( + out => t.doesNotHave( + out, + 'looking for funding', + 'should not print fund message if missing info' + ) + ) + + reifyOutput({ + actualTree: { + children: [] + } + }) +}) + + +t.test('single package', (t) => { + t.plan(1) + const reifyOutput = getReifyOutput( + out => { + if (out.endsWith('looking for funding')) { + t.match( + out, + '1 package is looking for funding', + 'should print single package message' + ) + } + } + ) + + reifyOutput({ + actualTree: { + name: 'foo', + package: { + name: 'foo', + version: '1.0.0' + }, + edgesOut: new Map([ + ['bar', { + to: { + name: 'bar', + package: { + name: 'bar', + version: '1.0.0', + funding: { type: 'foo', url: 'http://example.com' } + } + } + }] + ]) + }, + diff: { + children: [] + } + }) +}) + +t.test('no message when funding config is false', (t) => { + t.teardown(() => { settings.fund = true }) + settings.fund = false + const reifyOutput = getReifyOutput( + out => { + if (out.endsWith('looking for funding')) { + t.fail('should not print funding info', { actual: out }) + } + } + ) + + reifyOutput({ + actualTree: { + name: 'foo', + package: { + name: 'foo', + version: '1.0.0' + }, + edgesOut: new Map([ + ['bar', { + to: { + name: 'bar', + package: { + name: 'bar', + version: '1.0.0', + funding: { type: 'foo', url: 'http://example.com' } + } + } + }] + ]) + }, + diff: { + children: [] + } + }) + + t.end() +}) + +t.test('print appropriate message for many packages', (t) => { + t.plan(1) + const reifyOutput = getReifyOutput( + out => { + if (out.endsWith('looking for funding')) { + t.match( + out, + '3 packages are looking for funding', + 'should print single package message' + ) + } + } + ) + + reifyOutput({ + actualTree: { + name: 'foo', + package: { + name: 'foo', + version: '1.0.0' + }, + edgesOut: new Map([ + ['bar', { + to: { + name: 'bar', + package: { + name: 'bar', + version: '1.0.0', + funding: { type: 'foo', url: 'http://example.com' } + } + } + }], + ['lorem', { + to: { + name: 'lorem', + package: { + name: 'lorem', + version: '1.0.0', + funding: { type: 'foo', url: 'http://example.com' } + } + } + }], + ['ipsum', { + to: { + name: 'ipsum', + package: { + name: 'ipsum', + version: '1.0.0', + funding: { type: 'foo', url: 'http://example.com' } + } + } + }] + ]) + }, + diff: { + children: [] + } + }) +}) + +t.test('no output when silent', t => { + const reifyOutput = getReifyOutput(out => { + t.fail('should not get output when silent', { actual: out }) + }) + t.teardown(() => log.level = 'warn') + log.level = 'silent' + reifyOutput({ + actualTree: { inventory: { size: 999 }, children: [] }, + auditReport: { + toJSON: () => mock.auditReport, + vulnerabilities: {}, + metadata: { + vulnerabilities: { + total: 99 + } + } + }, + diff: { + children: [ + { action: 'ADD', ideal: { location: 'loc' } } + ] + } + }) + t.end() +}) + +t.test('packages changed message', t => { + const output = [] + const reifyOutput = getReifyOutput(out => { + output.push(out) + }) + + // return a test function that builds up the mock and snapshots output + const testCase = (t, added, removed, changed, audited, json, command) => { + settings.json = json + npmock.command = command + const mock = { + actualTree: { inventory: { size: audited, has: () => true }, children: [] }, + auditReport: audited ? { + toJSON: () => mock.auditReport, + vulnerabilities: {}, + metadata: { + vulnerabilities: { + total: 0 + } + } + } : null, + diff: { + children: [ + { action: 'some random unexpected junk' } + ] + } + } + for (let i = 0; i < added; i++) { + mock.diff.children.push({ action: 'ADD', ideal: { location: 'loc' } }) + } + for (let i = 0; i < removed; i++) { + mock.diff.children.push({ action: 'REMOVE', actual: { location: 'loc' } }) + } + for (let i = 0; i < changed; i++) { + const actual = { location: 'loc' } + const ideal = { location: 'loc' } + mock.diff.children.push({ action: 'CHANGE', actual, ideal }) + } + output.length = 0 + reifyOutput(mock) + t.matchSnapshot(output.join('\n'), JSON.stringify({ + added, + removed, + changed, + audited, + json + })) + } + + const cases = [] + for (const added of [0, 1, 2]) { + for (const removed of [0, 1, 2]) { + for (const changed of [0, 1, 2]) { + for (const audited of [0, 1, 2]) { + for (const json of [true, false]) { + cases.push([added, removed, changed, audited, json, 'install']) + } + } + } + } + } + + // add case for when audit is the command + cases.push([0, 0, 0, 2, true, 'audit']) + cases.push([0, 0, 0, 2, false, 'audit']) + + t.plan(cases.length) + for (const [added, removed, changed, audited, json, command] of cases) { + testCase(t, added, removed, changed, audited, json, command) + } + + t.end() +}) + +t.test('added packages should be looked up within returned tree', t => { + t.test('has added pkg in inventory', t => { + t.plan(1) + const reifyOutput = getReifyOutput( + out => t.matchSnapshot(out) + ) + + reifyOutput({ + actualTree: { + name: 'foo', + inventory: { + has: () => true + } + }, + diff: { + children: [ + { action: 'ADD', ideal: { name: 'baz' } } + ] + } + }) + }) + + t.test('missing added pkg in inventory', t => { + t.plan(1) + const reifyOutput = getReifyOutput( + out => t.matchSnapshot(out) + ) + + reifyOutput({ + actualTree: { + name: 'foo', + inventory: { + has: () => false + } + }, + diff: { + children: [ + { action: 'ADD', ideal: { name: 'baz' } } + ] + } + }) + }) + t.end() +}) diff --git a/deps/npm/test/lib/utils/set-user-agent.js b/deps/npm/test/lib/utils/set-user-agent.js new file mode 100644 index 00000000000000..854c698179ce66 --- /dev/null +++ b/deps/npm/test/lib/utils/set-user-agent.js @@ -0,0 +1,54 @@ +const t = require('tap') +const requireInject = require('require-inject') + +let ci = null +const ciDetect = () => ci + +const setUserAgent = requireInject('../../../lib/utils/set-user-agent.js', { + '@npmcli/ci-detect': ciDetect +}) + +const defaultUA = 'npm/{npm-version} node/{node-version} {platform} {arch} {ci}' + +const config = { + settings: { + 'node-version': '123.420.69', + 'user-agent': defaultUA + }, + set: (k, v) => { + if (k !== 'user-agent') { + throw new Error('setting the wrong thing') + } + config.settings['user-agent'] = v + }, + get: (k) => { + if (k !== 'user-agent' && k !== 'node-version') { + throw new Error('setting the wrong thing') + } + return config.settings[k] + } +} + +t.test('not in CI, set user agent', t => { + setUserAgent(config) + t.equal(config.get('user-agent'), `npm/${require('../../../package.json').version} node/123.420.69 ${process.platform} ${process.arch}`) + config.set('user-agent', defaultUA) + t.end() +}) + +t.test('in CI, set user agent', t => { + ci = 'something' + setUserAgent(config) + t.equal(config.get('user-agent'), `npm/${require('../../../package.json').version} node/123.420.69 ${process.platform} ${process.arch} ci/something`) + config.set('user-agent', defaultUA) + t.end() +}) + +t.test('no UA set, leave it blank', t => { + ci = 'something' + config.set('user-agent', null) + setUserAgent(config) + t.equal(config.get('user-agent'), '') + config.set('user-agent', defaultUA) + t.end() +}) diff --git a/deps/npm/test/lib/utils/setup-log.js b/deps/npm/test/lib/utils/setup-log.js new file mode 100644 index 00000000000000..2d5d794f1377a5 --- /dev/null +++ b/deps/npm/test/lib/utils/setup-log.js @@ -0,0 +1,273 @@ +const t = require('tap') +const requireInject = require('require-inject') + +const settings = {} +t.afterEach(cb => { + Object.keys(settings).forEach(k => { delete settings[k] }) + cb() +}) + +const WARN_CALLED = [] +const npmlog = { + level: 'warn', + warn: (...args) => { + WARN_CALLED.push(args) + }, + levels: { + silly: -Infinity, + verbose: 1000, + info: 2000, + timing: 2500, + http: 3000, + notice: 3500, + warn: 4000, + error: 5000, + silent: Infinity + }, + settings, + enableColor: () => { settings.color = true }, + disableColor: () => { settings.color = false }, + enableUnicode: () => { settings.unicode = true }, + disableUnicode: () => { settings.unicode = false }, + enableProgress: () => { settings.progress = true }, + disableProgress: () => { settings.progress = false }, + set heading (h) { settings.heading = h }, + set level (l) { settings.level = l } +} + +const EXPLAIN_CALLED = [] +const setupLog = requireInject('../../../lib/utils/setup-log.js', { + '../../../lib/utils/explain-eresolve.js': { + explain: (...args) => { + EXPLAIN_CALLED.push(args) + return 'explanation' + } + }, + npmlog +}) + +const config = obj => ({ + get (k) { + return obj[k] + }, + set (k, v) { + obj[k] = v + } +}) + +t.test('setup with color=always and unicode', t => { + npmlog.warn('ERESOLVE', 'hello', { some: 'object' }) + t.strictSame(EXPLAIN_CALLED, [], 'log.warn() not patched yet') + t.strictSame(WARN_CALLED, [['ERESOLVE', 'hello', { some: 'object' }]]) + WARN_CALLED.length = 0 + + t.equal(setupLog(config({ + loglevel: 'warn', + color: 'always', + unicode: true, + progress: false + })), true) + + npmlog.warn('ERESOLVE', 'hello', { some: { other: 'object' } }) + t.strictSame(EXPLAIN_CALLED, [[{ some: { other: 'object' } }]], + 'log.warn(ERESOLVE) patched to call explainEresolve()') + t.strictSame(WARN_CALLED, [ + ['ERESOLVE', 'hello'], + ['', 'explanation'] + ], 'warn the explanation') + EXPLAIN_CALLED.length = 0 + WARN_CALLED.length = 0 + npmlog.warn('some', 'other', 'thing') + t.strictSame(EXPLAIN_CALLED, [], 'do not try to explain other things') + t.strictSame(WARN_CALLED, [['some', 'other', 'thing']], 'warnings passed through') + + t.strictSame(settings, { + level: 'warn', + color: true, + unicode: true, + progress: false, + heading: 'npm' + }) + + t.end() +}) + +t.test('setup with color=true, no unicode, and non-TTY terminal', t => { + const { isTTY: stderrIsTTY } = process.stderr + const { isTTY: stdoutIsTTY } = process.stdout + t.teardown(() => { + process.stderr.isTTY = stderrIsTTY + process.stdout.isTTY = stdoutIsTTY + }) + process.stderr.isTTY = false + process.stdout.isTTY = false + + t.equal(setupLog(config({ + loglevel: 'warn', + color: false, + progress: false, + heading: 'asdf' + })), false) + + t.strictSame(settings, { + level: 'warn', + color: false, + unicode: false, + progress: false, + heading: 'asdf' + }) + + t.end() +}) + +t.test('setup with color=true, no unicode, and dumb TTY terminal', t => { + const { isTTY: stderrIsTTY } = process.stderr + const { isTTY: stdoutIsTTY } = process.stdout + const { TERM } = process.env + t.teardown(() => { + process.stderr.isTTY = stderrIsTTY + process.stdout.isTTY = stdoutIsTTY + process.env.TERM = TERM + }) + process.stderr.isTTY = true + process.stdout.isTTY = true + process.env.TERM = 'dumb' + + t.equal(setupLog(config({ + loglevel: 'warn', + color: true, + progress: false, + heading: 'asdf' + })), true) + + t.strictSame(settings, { + level: 'warn', + color: true, + unicode: false, + progress: false, + heading: 'asdf' + }) + + t.end() +}) + +t.test('setup with color=true, no unicode, and non-dumb TTY terminal', t => { + const { isTTY: stderrIsTTY } = process.stderr + const { isTTY: stdoutIsTTY } = process.stdout + const { TERM } = process.env + t.teardown(() => { + process.stderr.isTTY = stderrIsTTY + process.stdout.isTTY = stdoutIsTTY + process.env.TERM = TERM + }) + process.stderr.isTTY = true + process.stdout.isTTY = true + process.env.TERM = 'totes not dum' + + t.equal(setupLog(config({ + loglevel: 'warn', + color: true, + progress: true, + heading: 'asdf' + })), true) + + t.strictSame(settings, { + level: 'warn', + color: true, + unicode: false, + progress: true, + heading: 'asdf' + }) + + t.end() +}) + +t.test('setup with non-TTY stdout, TTY stderr', t => { + const { isTTY: stderrIsTTY } = process.stderr + const { isTTY: stdoutIsTTY } = process.stdout + const { TERM } = process.env + t.teardown(() => { + process.stderr.isTTY = stderrIsTTY + process.stdout.isTTY = stdoutIsTTY + process.env.TERM = TERM + }) + process.stderr.isTTY = true + process.stdout.isTTY = false + process.env.TERM = 'definitely not a dummy' + + t.equal(setupLog(config({ + loglevel: 'warn', + color: true, + progress: true, + heading: 'asdf' + })), false) + + t.strictSame(settings, { + level: 'warn', + color: true, + unicode: false, + progress: true, + heading: 'asdf' + }) + + t.end() +}) + +t.test('setup with TTY stdout, non-TTY stderr', t => { + const { isTTY: stderrIsTTY } = process.stderr + const { isTTY: stdoutIsTTY } = process.stdout + const { TERM } = process.env + t.teardown(() => { + process.stderr.isTTY = stderrIsTTY + process.stdout.isTTY = stdoutIsTTY + process.env.TERM = TERM + }) + process.stderr.isTTY = false + process.stdout.isTTY = true + + t.equal(setupLog(config({ + loglevel: 'warn', + color: true, + progress: true, + heading: 'asdf' + })), true) + + t.strictSame(settings, { + level: 'warn', + color: false, + unicode: false, + progress: false, + heading: 'asdf' + }) + + t.end() +}) + +t.test('set loglevel to timing', t => { + setupLog(config({ + timing: true, + loglevel: 'notice' + })) + t.equal(settings.level, 'timing') + t.end() +}) + +t.test('silent has no logging', t => { + const { isTTY: stderrIsTTY } = process.stderr + const { isTTY: stdoutIsTTY } = process.stdout + const { TERM } = process.env + t.teardown(() => { + process.stderr.isTTY = stderrIsTTY + process.stdout.isTTY = stdoutIsTTY + process.env.TERM = TERM + }) + process.stderr.isTTY = true + process.stdout.isTTY = true + process.env.TERM = 'totes not dum' + + setupLog(config({ + loglevel: 'silent' + })) + t.equal(settings.progress, false, 'progress disabled when silent') + t.end() +}) diff --git a/deps/npm/test/lib/utils/tar.js b/deps/npm/test/lib/utils/tar.js new file mode 100644 index 00000000000000..cfb195f08d4a90 --- /dev/null +++ b/deps/npm/test/lib/utils/tar.js @@ -0,0 +1,115 @@ +const { test } = require('tap') +const pack = require('libnpmpack') +const ssri = require('ssri') +const requireInject = require('require-inject') + +const { logTar, getContents } = require('../../../lib/utils/tar.js') + +const printLogs = (tarball, unicode) => { + const logs = [] + logTar(tarball, { + log: { + notice: (...args) => { + args.map(el => logs.push(el)) + } + }, + unicode + }) + return logs.join('\n') +} + +test('should log tarball contents', async (t) => { + const testDir = t.testdir({ + 'package.json': JSON.stringify({ + name: 'my-cool-pkg', + version: '1.0.0', + bundleDependencies: [ + 'bundle-dep' + ] + }, null, 2), + 'node_modules': { + 'bundle-dep': 'toto' + } + }) + + const tarball = await pack(testDir) + const tarballContents = await getContents({ + _id: '1', + name: 'my-cool-pkg', + version: '1.0.0' + }, tarball) + + t.matchSnapshot(printLogs(tarballContents, false)) +}) + +test('should log tarball contents with unicode', async (t) => { + const { logTar } = requireInject('../../../lib/utils/tar.js', { + 'npmlog': { + 'notice': (str) => { + t.ok(true, 'defaults to npmlog') + return str + } + } + }) + + logTar({ + files: [], + bundled: [], + integrity: '' + }, { unicode: true }) + t.end() +}) + +test('should default to npmlog', async (t) => { + const { logTar } = requireInject('../../../lib/utils/tar.js', { + 'npmlog': { + 'notice': (str) => { + t.ok(true, 'defaults to npmlog') + return str + } + } + }) + + logTar({ + files: [], + bundled: [], + integrity: '' + }) + t.end() +}) + +test('should getContents of a tarball', async (t) => { + const testDir = t.testdir({ + 'package.json': JSON.stringify({ + name: 'my-cool-pkg', + version: '1.0.0' + }, null, 2) + }) + + const tarball = await pack(testDir) + + const tarballContents = await getContents({ + name: 'my-cool-pkg', + version: '1.0.0' + }, tarball) + + const integrity = await ssri.fromData(tarball, { + algorithms: ['sha1', 'sha512'] + }) + + t.strictSame(tarballContents, { + id: 'my-cool-pkg@1.0.0', + name: 'my-cool-pkg', + version: '1.0.0', + size: 149, + unpackedSize: 49, + shasum: 'c0bfd67a5142104e429afda09119eedd6a30d2fc', + integrity: ssri.parse(integrity.sha512[0]), + filename: 'my-cool-pkg-1.0.0.tgz', + files: [ { path: 'package.json', size: 49, mode: 420 } ], + entryCount: 1, + bundled: [] + }, 'contents are correct') + t.end() + +}) diff --git a/deps/npm/test/lib/utils/unsupported.js b/deps/npm/test/lib/utils/unsupported.js new file mode 100644 index 00000000000000..89ee6af2321d7d --- /dev/null +++ b/deps/npm/test/lib/utils/unsupported.js @@ -0,0 +1,107 @@ +const test = require('tap').test +const unsupported = require('../../../lib/utils/unsupported.js') + +const versions = [ + // broken unsupported + ['v0.1.103', true, true], + ['v0.2.0', true, true], + ['v0.3.5', true, true], + ['v0.4.7', true, true], + ['v0.5.3', true, true], + ['v0.6.17', true, true], + ['v0.7.8', true, true], + ['v0.8.28', true, true], + ['v0.9.6', true, true], + ['v0.10.48', true, true], + ['v0.11.16', true, true], + ['v0.12.9', true, true], + ['v1.0.1', true, true], + ['v1.6.0', true, true], + ['v2.3.1', true, true], + ['v3.0.0', true, true], + ['v4.5.0', true, true], + ['v4.8.4', true, true], + ['v5.7.1', true, true], + ['v6.8.1', false, true], + ['v7.0.0-beta23', false, true], + ['v7.2.3', false, true], + ['v8.4.0', false, true], + ['v9.3.0', false, true], + ['v10.0.0-0', false, false], + ['v11.0.0-0', false, false], + ['v12.0.0-0', false, false], + ['v13.0.0-0', false, false] +] + +test('versions', function (t) { + t.plan(versions.length * 2) + versions.forEach(function (verinfo) { + const version = verinfo[0] + const broken = verinfo[1] + const unsupp = verinfo[2] + const nodejs = unsupported.checkVersion(version) + t.is(nodejs.broken, broken, version + ' ' + (broken ? '' : 'not ') + 'broken') + t.is(nodejs.unsupported, unsupp, version + ' ' + (unsupp ? 'unsupported' : 'supported')) + }) + t.done() +}) + +test('checkForBrokenNode', t => { + // run it once to not fail + unsupported.checkForBrokenNode() + + const { exit } = process + const { error } = console + const versionPropDesc = Object.getOwnPropertyDescriptor(process, 'version') + + t.teardown(() => { + process.exit = exit + Object.defineProperty(process, 'version', versionPropDesc) + console.error = error + }) + + // then make it a thing that fails + process.exit = code => { + t.equal(code, 1) + t.strictSame(logs, expectLogs) + t.end() + } + Object.defineProperty(process, 'version', { value: '1.2.3', configurable: true }) + const logs = [] + const expectLogs = [ + 'ERROR: npm is known not to run on Node.js 1.2.3', + "You'll need to upgrade to a newer Node.js version in order to use this", + 'version of npm. You can find the latest version at https://nodejs.org/' + ] + console.error = msg => logs.push(msg) + unsupported.checkForBrokenNode() +}) + +test('checkForUnsupportedNode', t => { + const npmlog = require('npmlog') + const { warn } = npmlog + const versionPropDesc = Object.getOwnPropertyDescriptor(process, 'version') + + t.teardown(() => { + Object.defineProperty(process, 'version', versionPropDesc) + npmlog.warn = warn + }) + + const logs = [] + const expectLogs = [ + 'npm does not support Node.js 8.0.0', + 'You should probably upgrade to a newer version of node as we', + "can't make any promises that npm will work with this version.", + 'You can find the latest version at https://nodejs.org/' + ] + npmlog.warn = (section, msg) => logs.push(msg) + + // run it once to not fail or warn + unsupported.checkForUnsupportedNode() + + // then make it a thing that fails + Object.defineProperty(process, 'version', { value: '8.0.0' }) + unsupported.checkForUnsupportedNode() + t.strictSame(logs, expectLogs) + t.end() +}) diff --git a/deps/npm/test/lib/utils/update-notifier.js b/deps/npm/test/lib/utils/update-notifier.js new file mode 100644 index 00000000000000..903e888a5e0f7d --- /dev/null +++ b/deps/npm/test/lib/utils/update-notifier.js @@ -0,0 +1,210 @@ +const t = require('tap') +const requireInject = require('require-inject') +let ciMock = null +const flatOptions = { global: false, cache: t.testdir() + '/_cacache' } + +const MANIFEST_REQUEST = [] +const CURRENT_VERSION = '123.420.69' +const CURRENT_MAJOR = '122.420.69' +const CURRENT_MINOR = '123.419.69' +const CURRENT_PATCH = '123.420.68' +const NEXT_VERSION = '123.421.70' +const NEXT_MINOR = '123.420.70' +const NEXT_PATCH = '123.421.69' +const CURRENT_BETA = '124.0.0-beta.99999' +const HAVE_BETA = '124.0.0-beta.0' + +let PACOTE_ERROR = null +const pacote = { + manifest: async (spec, opts) => { + if (!spec.match(/^npm@/)) { + console.error(new Error('should only fetch manifest for npm')) + process.exit(1) + } + MANIFEST_REQUEST.push(spec) + if (PACOTE_ERROR) { + throw PACOTE_ERROR + } + return { + version: spec === 'npm@latest' ? CURRENT_VERSION + : /-/.test(spec) ? CURRENT_BETA + : NEXT_VERSION + } + } +} + +const npm = { + flatOptions, + log: { useColor: () => true }, + version: CURRENT_VERSION, + config: { get: (k) => k !== 'global' }, + flatOptions, + command: 'view', + argv: ['npm'] +} +const npmNoColor = { + ...npm, + log: { useColor: () => false } +} + +const { basename } = require('path') + +let STAT_ERROR = null +let STAT_MTIME = null +let WRITE_ERROR = null +const fs = { + stat: (path, cb) => { + if (basename(path) !== '_update-notifier-last-checked') { + console.error(new Error('should only write to notifier last checked file')) + process.exit(1) + } + process.nextTick(() => cb(STAT_ERROR, { mtime: new Date(STAT_MTIME) })) + }, + writeFile: (path, content, cb) => { + if (content !== '') { + console.error(new Error('should not be writing content')) + process.exit(1) + } + if (basename(path) !== '_update-notifier-last-checked') { + console.error(new Error('should only write to notifier last checked file')) + process.exit(1) + } + process.nextTick(() => cb(WRITE_ERROR)) + } +} + +const updateNotifier = requireInject('../../../lib/utils/update-notifier.js', { + '@npmcli/ci-detect': () => ciMock, + pacote, + fs +}) + +const semver = require('semver') + +t.afterEach(cb => { + MANIFEST_REQUEST.length = 0 + STAT_ERROR = null + PACOTE_ERROR = null + STAT_MTIME = null + WRITE_ERROR = null + cb() +}) + +t.test('situations in which we do not notify', t => { + t.test('nothing to do if notifier disabled', async t => { + t.equal(await updateNotifier({ + ...npm, + config: { get: (k) => k === 'update-notifier' ? false : true } + }), null) + t.strictSame(MANIFEST_REQUEST, [], 'no requests for manifests') + }) + + t.test('do not suggest update if already updating', async t => { + t.equal(await updateNotifier({ + ...npm, + flatOptions: { ...flatOptions, global: true }, + command: 'install', + argv: ['npm'] + }), null) + t.strictSame(MANIFEST_REQUEST, [], 'no requests for manifests') + }) + + t.test('do not update if same as latest', async t => { + t.equal(await updateNotifier(npm), null) + t.strictSame(MANIFEST_REQUEST, ['npm@latest'], 'requested latest version') + }) + t.test('check if stat errors (here for coverage)', async t => { + STAT_ERROR = new Error('blorg') + t.equal(await updateNotifier(npm), null) + t.strictSame(MANIFEST_REQUEST, ['npm@latest'], 'requested latest version') + }) + t.test('ok if write errors (here for coverage)', async t => { + WRITE_ERROR = new Error('grolb') + t.equal(await updateNotifier(npm), null) + t.strictSame(MANIFEST_REQUEST, ['npm@latest'], 'requested latest version') + }) + t.test('ignore pacote failures (here for coverage)', async t => { + PACOTE_ERROR = new Error('pah-KO-tchay') + t.equal(await updateNotifier(npm), null) + t.strictSame(MANIFEST_REQUEST, ['npm@latest'], 'requested latest version') + }) + t.test('do not update if newer than latest, but same as next', async t => { + t.equal(await updateNotifier({ ...npm, version: NEXT_VERSION }), null) + const reqs = ['npm@latest', `npm@^${NEXT_VERSION}`] + t.strictSame(MANIFEST_REQUEST, reqs, 'requested latest and next versions') + }) + t.test('do not update if on the latest beta', async t => { + t.equal(await updateNotifier({ ...npm, version: CURRENT_BETA }), null) + const reqs = [`npm@^${CURRENT_BETA}`] + t.strictSame(MANIFEST_REQUEST, reqs, 'requested latest and next versions') + }) + + t.test('do not update in CI', async t => { + t.teardown(() => { ciMock = null }) + ciMock = 'something' + t.equal(await updateNotifier(npm), null) + t.strictSame(MANIFEST_REQUEST, [], 'no requests for manifests') + }) + + t.test('only check weekly for GA releases', async t => { + // the 10 is fuzz factor for test environment + STAT_MTIME = Date.now() - (1000*60*60*24*7) + 10 + t.equal(await updateNotifier(npm), null) + t.strictSame(MANIFEST_REQUEST, [], 'no requests for manifests') + }) + + t.test('only check daily for betas', async t => { + // the 10 is fuzz factor for test environment + STAT_MTIME = Date.now() - (1000*60*60*24) + 10 + t.equal(await updateNotifier({ ...npm, version: HAVE_BETA }), null) + t.strictSame(MANIFEST_REQUEST, [], 'no requests for manifests') + }) + + t.end() +}) + +t.test('notification situations', t => { + t.test('new beta available', async t => { + const version = HAVE_BETA + t.matchSnapshot(await updateNotifier({ ...npm, version }), 'color') + t.matchSnapshot(await updateNotifier({ ...npmNoColor, version }), 'no color') + t.strictSame(MANIFEST_REQUEST, [`npm@^${version}`, `npm@^${version}`]) + }) + + t.test('patch to next version', async t => { + const version = NEXT_PATCH + t.matchSnapshot(await updateNotifier({ ...npm, version }), 'color') + t.matchSnapshot(await updateNotifier({ ...npmNoColor, version }), 'no color') + t.strictSame(MANIFEST_REQUEST, ['npm@latest', `npm@^${version}`, 'npm@latest', `npm@^${version}`]) + }) + + t.test('minor to next version', async t => { + const version = NEXT_MINOR + t.matchSnapshot(await updateNotifier({ ...npm, version }), 'color') + t.matchSnapshot(await updateNotifier({ ...npmNoColor, version }), 'no color') + t.strictSame(MANIFEST_REQUEST, ['npm@latest', `npm@^${version}`, 'npm@latest', `npm@^${version}`]) + }) + + t.test('patch to current', async t => { + const version = CURRENT_PATCH + t.matchSnapshot(await updateNotifier({ ...npm, version }), 'color') + t.matchSnapshot(await updateNotifier({ ...npmNoColor, version }), 'no color') + t.strictSame(MANIFEST_REQUEST, ['npm@latest', 'npm@latest']) + }) + + t.test('minor to current', async t => { + const version = CURRENT_MINOR + t.matchSnapshot(await updateNotifier({ ...npm, version }), 'color') + t.matchSnapshot(await updateNotifier({ ...npmNoColor, version }), 'no color') + t.strictSame(MANIFEST_REQUEST, ['npm@latest', 'npm@latest']) + }) + + t.test('major to current', async t => { + const version = CURRENT_MAJOR + t.matchSnapshot(await updateNotifier({ ...npm, version }), 'color') + t.matchSnapshot(await updateNotifier({ ...npmNoColor, version }), 'no color') + t.strictSame(MANIFEST_REQUEST, ['npm@latest', 'npm@latest']) + }) + + t.end() +}) diff --git a/deps/npm/test/lib/view.js b/deps/npm/test/lib/view.js new file mode 100644 index 00000000000000..6f349259b345f2 --- /dev/null +++ b/deps/npm/test/lib/view.js @@ -0,0 +1,556 @@ +const t = require('tap') +const requireInject = require('require-inject') + +let logs +const cleanLogs = (done) => { + logs = '' + const fn = (...args) => { + logs += '\n' + args.map(el => logs += el) + } + console.log = fn + done() +} + +const packument = (nv, opts) => { + if (!opts.fullMetadata) { + throw new Error('must fetch fullMetadata') + } + + if (!opts.preferOnline) { + throw new Error('must fetch with preferOnline') + } + + const mocks = { + 'red': { + 'name' : 'red', + 'dist-tags': { + '1.0.1': {} + }, + 'time': { + 'unpublished': new Date() + } + }, + 'blue': { + 'name': 'blue', + 'dist-tags': {}, + 'time': { + '1.0.0': '2019-08-06T16:21:09.842Z' + }, + 'versions': { + '1.0.0': { + 'name': 'blue', + 'version': '1.0.0', + 'dist': { + 'shasum': '123', + 'tarball': 'http://hm.blue.com/1.0.0.tgz', + 'integrity': '---', + 'fileCount': 1, + 'unpackedSize': 1 + } + }, + '1.0.1': {} + } + }, + 'cyan': { + '_npmUser': { + 'name': 'claudia', + 'email': 'claudia@cyan.com' + } , + 'name': 'cyan', + 'dist-tags': {}, + 'versions': { + '1.0.0': { + 'version': '1.0.0', + 'name': 'cyan', + 'dist': { + 'shasum': '123', + 'tarball': 'http://hm.cyan.com/1.0.0.tgz', + 'integrity': '---', + 'fileCount': 1, + 'unpackedSize': 1 + } + }, + '1.0.1': {} + } + }, + 'brown': { + 'name': 'brown' + }, + 'yellow': { + '_id': 'yellow', + 'name': 'yellow', + 'author': { + 'name': 'foo', + 'email': 'foo@yellow.com', + 'twitter': 'foo' + }, + 'readme': 'a very useful readme', + 'versions': { + '1.0.0': { + 'version': '1.0.0', + 'author': 'claudia', + 'readme': 'a very useful readme', + 'maintainers': [ + { 'name': 'claudia', 'email': 'c@yellow.com', 'twitter': 'cyellow' }, + { 'name': 'isaacs', 'email': 'i@yellow.com', 'twitter': 'iyellow' } + ] + }, + '1.0.1': { + 'version': '1.0.1', + 'author': 'claudia' + }, + '1.0.2': { + 'version': '1.0.2', + 'author': 'claudia' + } + } + }, + 'purple': { + 'name': 'purple', + 'versions': { + '1.0.0': { + 'foo': 1, + 'maintainers': [ + { 'name': 'claudia' } + ] + }, + '1.0.1': {} + } + }, + 'green': { + '_id': 'green', + 'name': 'green', + 'dist-tags': { + 'latest': '1.0.0' + }, + 'maintainers': [ + { 'name': 'claudia', 'email': 'c@yellow.com', 'twitter': 'cyellow' }, + { 'name': 'isaacs', 'email': 'i@yellow.com', 'twitter': 'iyellow' } + ], + 'keywords': ['colors', 'green', 'crayola'], + 'versions': { + '1.0.0': { + '_id': 'green', + 'version': '1.0.0', + 'description': 'green is a very important color', + 'bugs': { + 'url': 'http://bugs.green.com' + }, + 'deprecated': true, + 'repository': { + 'url': 'http://repository.green.com' + }, + 'license': { type: 'ACME' }, + 'bin': { + 'green': 'bin/green.js' + }, + 'dependencies': { + 'red': '1.0.0', + 'yellow': '1.0.0' + }, + 'dist': { + 'shasum': '123', + 'tarball': 'http://hm.green.com/1.0.0.tgz', + 'integrity': '---', + 'fileCount': 1, + 'unpackedSize': 1 + } + }, + '1.0.1': {} + } + }, + 'black': { + 'name': 'black', + 'dist-tags': { + 'latest': '1.0.0' + }, + 'versions': { + '1.0.0': { + 'version': '1.0.0', + 'bugs': 'http://bugs.black.com', + 'license': {}, + 'dependencies': (() => { + const deps = {} + for (i = 0; i < 25; i++) { + deps[i] = '1.0.0' + } + return deps + })(), + 'dist': { + 'shasum': '123', + 'tarball': 'http://hm.black.com/1.0.0.tgz', + 'integrity': '---', + 'fileCount': 1, + 'unpackedSize': 1 + } + }, + '1.0.1': {} + } + }, + 'pink': { + 'name': 'pink', + 'dist-tags': { + 'latest': '1.0.0' + }, + 'versions': { + '1.0.0': { + 'version': '1.0.0', + 'maintainers': [ + { 'name': 'claudia', 'url': 'http://c.pink.com' }, + { 'name': 'isaacs', 'url': 'http://i.pink.com' } + ], + 'repository': 'http://repository.pink.com', + 'license': {}, + 'dist': { + 'shasum': '123', + 'tarball': 'http://hm.pink.com/1.0.0.tgz', + 'integrity': '---', + 'fileCount': 1, + 'unpackedSize': 1 + } + }, + '1.0.1': {} + } + }, + 'orange': { + 'name': 'orange', + 'dist-tags': { + 'latest': '1.0.0' + }, + 'versions': { + '1.0.0': { + 'version': '1.0.0', + 'homepage': 'http://hm.orange.com', + 'license': {}, + 'dist': { + 'shasum': '123', + 'tarball': 'http://hm.orange.com/1.0.0.tgz', + 'integrity': '---', + 'fileCount': 1, + 'unpackedSize': 1 + } + }, + '1.0.1': {} + } + } + } + return mocks[nv.name] +} + +t.beforeEach(cleanLogs) +t.test('should log package info', t => { + const view = requireInject('../../lib/view.js', { + '../../lib/npm.js': { + flatOptions: { + global: false, + } + }, + 'pacote': { + packument + } + }) + + const viewJson = requireInject('../../lib/view.js', { + '../../lib/npm.js': { + flatOptions: { + json: true + } + }, + 'pacote': { + packument + } + }) + + const viewUnicode = requireInject('../../lib/view.js', { + '../../lib/npm.js': { + flatOptions: { + global: false, + unicode: true + } + }, + 'pacote': { + packument + } + }) + + t.test('package with license, bugs, repository and other fields', t => { + view(['green@1.0.0'], () => { + t.matchSnapshot(logs) + t.end() + }) + }) + + t.test('package with more than 25 deps', t => { + view(['black@1.0.0'], () => { + t.matchSnapshot(logs) + t.end() + }) + }) + + t.test('package with maintainers info as object', t => { + view(['pink@1.0.0'], () => { + t.matchSnapshot(logs) + t.end() + }) + }) + + t.test('package with homepage', t => { + view(['orange@1.0.0'], () => { + t.matchSnapshot(logs) + t.end() + }) + }) + + t.test('package with no versions', t => { + view(['brown'], () => { + t.equals(logs, '', 'no info to display') + t.end() + }) + }) + + t.test('package with no repo or homepage', t => { + view(['blue@1.0.0'], () => { + t.matchSnapshot(logs) + t.end() + }) + }) + + t.test('package with no modified time', t => { + viewUnicode(['cyan@1.0.0'], () => { + t.matchSnapshot(logs) + t.end() + }) + }) + + t.test('package with --json and semver range', t => { + viewJson(['cyan@^1.0.0'], () => { + t.matchSnapshot(logs) + t.end() + }) + }) + + t.test('package with --json and no versions', t => { + viewJson(['brown'], () => { + t.equals(logs, '', 'no info to display') + t.end() + }) + }) + + t.end() +}) + +t.test('should log info of package in current working dir', t => { + const testDir = t.testdir({ + 'package.json': JSON.stringify({ + name: 'blue', + version: '1.0.0' + }, null, 2) + }) + + const view = requireInject('../../lib/view.js', { + '../../lib/npm.js': { + prefix: testDir, + flatOptions: { + defaultTag: '1.0.0', + global: false + } + }, + 'pacote': { + packument + } + }) + + t.test('specific version', t => { + view(['.@1.0.0'], () => { + t.matchSnapshot(logs) + t.end() + }) + }) + + t.test('non-specific version', t => { + view(['.'], () => { + t.matchSnapshot(logs) + t.end() + }) + }) + + t.end() +}) + +t.test('should log info by field name', t => { + const viewJson = requireInject('../../lib/view.js', { + '../../lib/npm.js': { + flatOptions: { + json: true, + global: false + } + }, + 'pacote': { + packument + } + }) + + const view = requireInject('../../lib/view.js', { + '../../lib/npm.js': { + flatOptions: { + global: false + } + }, + 'pacote': { + packument + } + }) + + t.test('readme', t => { + view(['yellow@1.0.0', 'readme'], () => { + t.matchSnapshot(logs) + t.end() + }) + }) + + t.test('several fields', t => { + viewJson(['yellow@1.0.0', 'name', 'version', 'foo[bar]'], () => { + t.matchSnapshot(logs) + t.end() + }) + }) + + t.test('several fields with several versions', t => { + view(['yellow@1.x.x', 'author'], () => { + t.matchSnapshot(logs) + t.end() + }) + }) + + t.test('nested field with brackets', t => { + viewJson(['orange@1.0.0', 'dist[shasum]'], () => { + t.matchSnapshot(logs) + t.end() + }) + }) + + t.test('maintainers with email', t => { + viewJson(['yellow@1.0.0', 'maintainers', 'name'], () => { + t.matchSnapshot(logs) + t.end() + }) + }) + + t.test('maintainers with url', t => { + viewJson(['pink@1.0.0', 'maintainers'], () => { + t.matchSnapshot(logs) + t.end() + }) + }) + + t.test('unknown nested field ', t => { + view(['yellow@1.0.0', 'dist.foobar'], () => { + t.equals(logs, '', 'no info to display') + t.end() + }) + }) + + t.test('array field - 1 element', t => { + view(['purple@1.0.0', 'maintainers.name'], () => { + t.matchSnapshot(logs) + t.end() + }) + }) + + t.test('array field - 2 elements', t => { + view(['yellow@1.x.x', 'maintainers.name'], () => { + t.matchSnapshot(logs) + t.end() + }) + }) + + t.end() +}) + +t.test('throw error if global mode', (t) => { + const view = requireInject('../../lib/view.js', { + '../../lib/npm.js': { + flatOptions: { + global: true + } + } + }) + view([], (err) => { + t.equals(err.message, 'Cannot use view command in global mode.') + t.end() + }) +}) + +t.test('throw error if invalid package.json', (t) => { + const testDir = t.testdir({ + 'package.json': '{}' + }) + + const view = requireInject('../../lib/view.js', { + '../../lib/npm.js': { + prefix: testDir, + flatOptions: { + global: false + } + } + }) + view([], (err) => { + t.equals(err.message, 'Invalid package.json') + t.end() + }) +}) + +t.test('throws when unpublished', (t) => { + const view = requireInject('../../lib/view.js', { + '../../lib/npm.js': { + flatOptions: { + defaultTag: '1.0.1', + global: false + } + }, + 'pacote': { + packument + } + }) + view(['red'], (err) => { + t.equals(err.code, 'E404') + t.end() + }) +}) + +t.test('completion', (t) => { + const view = requireInject('../../lib/view.js', { + '../../lib/npm.js': { + flatOptions: { + defaultTag: '1.0.1', + global: false + } + }, + 'pacote': { + packument + } + }) + view.completion({ + conf: { argv: { remain: ['npm', 'view', 'green@1.0.0'] } } + }, (err, res) => { + t.ok(res, 'returns back fields') + t.end() + }) +}) + +t.test('no registry completion', (t) => { + const view = requireInject('../../lib/view.js', { + '../../lib/npm.js': { + flatOptions: { + defaultTag: '1.0.1', + } + } + }) + view.completion({ + conf: { argv: { remain: ['npm', 'view'] } } + }, (err) => { + t.notOk(err, 'there is no package completion') + t.end() + }) +}) diff --git a/deps/npm/test/lib/whoami.js b/deps/npm/test/lib/whoami.js new file mode 100644 index 00000000000000..dc9dbdfd570ff2 --- /dev/null +++ b/deps/npm/test/lib/whoami.js @@ -0,0 +1,34 @@ +const { test } = require('tap') +const requireInject = require('require-inject') + +test('whoami', (t) => { + t.plan(3) + const whoami = requireInject('../../lib/whoami.js', { + '../../lib/utils/get-identity.js': () => Promise.resolve('foo'), + '../../lib/npm.js': { flatOptions: {} }, + '../../lib/utils/output.js': (output) => { + t.equal(output, 'foo', 'should output the username') + } + }) + + whoami([], (err) => { + t.ifError(err, 'npm whoami') + t.ok('should successfully print username') + }) +}) + +test('whoami json', (t) => { + t.plan(3) + const whoami = requireInject('../../lib/whoami.js', { + '../../lib/utils/get-identity.js': () => Promise.resolve('foo'), + '../../lib/npm.js': { flatOptions: { json: true } }, + '../../lib/utils/output.js': (output) => { + t.equal(output, '"foo"', 'should output the username as json') + } + }) + + whoami([], (err) => { + t.ifError(err, 'npm whoami') + t.ok('should successfully print username as json') + }) +}) diff --git a/deps/npm/test/need-npm5-update/belongs-in-pacote/add-remote-git-get-resolved.js b/deps/npm/test/need-npm5-update/belongs-in-pacote/add-remote-git-get-resolved.js deleted file mode 100644 index fadfc330fb851d..00000000000000 --- a/deps/npm/test/need-npm5-update/belongs-in-pacote/add-remote-git-get-resolved.js +++ /dev/null @@ -1,129 +0,0 @@ -'use strict' -var test = require('tap').test - -var npm = require('../../lib/npm.js') -var common = require('../common-tap.js') -var npa = require('npm-package-arg') - -var getResolved = null - -/** - * Note: This is here because `normalizeGitUrl` is usually called - * before getResolved is, and receives *that* URL. - */ -function tryGetResolved (uri, treeish) { - return getResolved(npa(uri), uri, treeish) -} - -test('setup', function (t) { - var opts = { - registry: common.registry, - loglevel: 'silent' - } - npm.load(opts, function (er) { - t.ifError(er, 'npm loaded without error') - getResolved = require('../../lib/cache/add-remote-git.js').getResolved - t.end() - }) -}) - -test('add-remote-git#get-resolved git: passthru', function (t) { - verify('git:github.com/foo/repo') - verify('git:github.com/foo/repo.git') - verify('git://github.com/foo/repo#decadacefadabade') - verify('git://github.com/foo/repo.git#decadacefadabade') - - function verify (uri) { - t.equal( - tryGetResolved(uri, 'decadacefadabade'), - 'git://github.com/foo/repo.git#decadacefadabade', - uri + ' normalized to canonical form git://github.com/foo/repo.git#decadacefadabade' - ) - } - t.end() -}) - -test('add-remote-git#get-resolved SSH', function (t) { - t.comment('tests for https://github.com/npm/npm/issues/7961') - verify('git+ssh://git@github.com:foo/repo') - verify('git+ssh://git@github.com:foo/repo#master') - verify('git+ssh://git@github.com/foo/repo#master') - verify('git+ssh://git@github.com/foo/repo#decadacefadabade') - - function verify (uri) { - t.equal( - tryGetResolved(uri, 'decadacefadabade'), - 'git+ssh://git@github.com/foo/repo.git#decadacefadabade', - uri + ' normalized to canonical form git+ssh://git@github.com/foo/repo.git#decadacefadabade' - ) - } - t.end() -}) - -test('add-remote-git#get-resolved HTTPS', function (t) { - verify('https://github.com/foo/repo') - verify('https://github.com/foo/repo#master') - verify('git+https://github.com/foo/repo.git#master') - verify('git+https://github.com/foo/repo#decadacefadabade') - // DEPRECATED - // this is an invalid URL but we normalize it - // anyway. Users shouldn't use this in the future. See note - // below for how this affected non-hosted URLs. - // See https://github.com/npm/npm/issues/8881 - verify('git+https://github.com:foo/repo.git#master') - - function verify (uri) { - t.equal( - tryGetResolved(uri, 'decadacefadabade'), - 'git+https://github.com/foo/repo.git#decadacefadabade', - uri + ' normalized to canonical form git+https://github.com/foo/repo.git#decadacefadabade' - ) - } - t.end() -}) - -test('add-remote-git#get-resolved edge cases', function (t) { - t.equal( - tryGetResolved('git+ssh://user@bananaboat.com:galbi/blah.git', 'decadacefadabade'), - 'git+ssh://user@bananaboat.com:galbi/blah.git#decadacefadabade', - 'don\'t break non-hosted scp-style locations' - ) - /* - t.equal( - tryGetResolved('git+ssh://bananaboat:galbi/blah', 'decadacefadabade'), - 'git+ssh://bananaboat:galbi/blah#decadacefadabade', - 'don\'t break non-hosted scp-style locations' - ) - - // DEPRECATED - // When we were normalizing all git URIs, git+https: was being - // automatically converted to ssh:. Some users were relying - // on this funky behavior, so after removing the aggressive - // normalization from non-hosted URIs, we brought this back. - // See https://github.com/npm/npm/issues/8881 - t.equal( - tryGetResolved('git+https://bananaboat:galbi/blah', 'decadacefadabade'), - 'git+https://bananaboat/galbi/blah#decadacefadabade', - 'don\'t break non-hosted scp-style locations' - ) - - t.equal( - tryGetResolved('git+ssh://git.bananaboat.net/foo', 'decadacefadabade'), - 'git+ssh://git.bananaboat.net/foo#decadacefadabade', - 'don\'t break non-hosted SSH URLs' - ) - - t.equal( - tryGetResolved('git+ssh://git.bananaboat.net:/foo', 'decadacefadabade'), - 'git+ssh://git.bananaboat.net:/foo#decadacefadabade', - 'don\'t break non-hosted SSH URLs' - ) - - t.equal( - tryGetResolved('git://gitbub.com/foo/bar.git', 'decadacefadabade'), - 'git://gitbub.com/foo/bar.git#decadacefadabade', - 'don\'t break non-hosted git: URLs' - ) -*/ - t.end() -}) diff --git a/deps/npm/test/need-npm5-update/belongs-in-pacote/git-races.js b/deps/npm/test/need-npm5-update/belongs-in-pacote/git-races.js deleted file mode 100644 index 60136125d40948..00000000000000 --- a/deps/npm/test/need-npm5-update/belongs-in-pacote/git-races.js +++ /dev/null @@ -1,219 +0,0 @@ -/* eslint-disable camelcase */ -var execFile = require('child_process').execFile -var path = require('path') -var zlib = require('zlib') - -var asyncMap = require('slide').asyncMap -var deepEqual = require('deep-equal') -var fs = require('graceful-fs') -var mkdirp = require('mkdirp') -var once = require('once') -var requireInject = require('require-inject') -var rimraf = require('rimraf') -var tar = require('tar') -var test = require('tap').test -var tmpdir = require('osenv').tmpdir -var which = require('which') - -var wd = path.resolve(tmpdir(), 'git-races') -var fixtures = path.resolve(__dirname, '../fixtures') -var testcase = 'github-com-BryanDonovan-npm-git-test' -var testcase_git = path.resolve(wd, testcase + '.git') -var testcase_path = path.resolve(wd, testcase) -var testcase_tgz = path.resolve(fixtures, testcase + '.git.tar.gz') - -var testtarballs = [] -var testrepos = {} -var testurls = {} - -/* -This test is specifically for #7202, where the bug was if you tried installing multiple git urls that -pointed at the same repo but had different comittishes, you'd sometimes get the wrong version. -The test cases, provided by @BryanDonovan, have a dependency tree like this: - - top - bar#4.0.0 - buzz#3.0.0 - foo#3.0.0 - buzz#3.0.0 - foo#4.0.0 - buzz#2.0.0 - -But what would happen is that buzz#2.0.0 would end up installed under bar#4.0.0. - -bar#4.0.0 shouldn't have gotten its own copy if buzz, and if it did, it shouldn've been buzz#3.0.0 -*/ - -;['bar', 'foo', 'buzz'].forEach(function (name) { - var mockurl = 'ssh://git@github.com/BryanDonovan/dummy-npm-' + name + '.git' - var realrepo = path.resolve(wd, 'github-com-BryanDonovan-dummy-npm-' + name + '.git') - var tgz = path.resolve(fixtures, 'github-com-BryanDonovan-dummy-npm-' + name + '.git.tar.gz') - - testrepos[mockurl] = realrepo - testtarballs.push(tgz) -}) - -function cleanup () { - process.chdir(tmpdir()) - rimraf.sync(wd) -} - -var npm = requireInject.installGlobally('../../lib/npm.js', { - 'child_process': { - 'execFile': function (cmd, args, options, cb) { - // on win 32, the following prefix is added in utils/git.js - // $ git -c core.longpaths=true clone - var i = process.platform === 'win32' ? 2 : 0 - // If it's a clone we swap any requests for any of the urls we're mocking - // with the path to the bare repo - if (args[i] === 'clone') { - var m2 = args.length - 2 - var m1 = args.length - 1 - if (testrepos[args[m2]]) { - testurls[args[m1]] = args[m2] - args[m2] = testrepos[args[m2]] - } - execFile(cmd, args, options, cb) - // here, we intercept npm validating the remote origin url on one of the - // clones we've done previously and return the original url that was requested - } else if (args[i] === 'config' && args[i + 1] === '--get' && args[i + 2] === 'remote.origin.url') { - process.nextTick(function () { - cb(null, testurls[options.cwd], '') - }) - } else { - execFile(cmd, args, options, cb) - } - } - } -}) - -function extract (tarball, target, cb) { - cb = once(cb) - fs.createReadStream(tarball).on('error', function (er) { cb(er) }) - .pipe(zlib.createGunzip()).on('error', function (er) { cb(er) }) - .pipe(tar.Extract({path: target})).on('error', function (er) { cb(er) }) - .on('end', function () { - cb() - }) -} - -// Copied from lib/utils/git, because we need to use -// it before calling npm.load and lib/utils/git uses npm.js -// which doesn't allow that. =( =( - -function prefixGitArgs () { - return process.platform === 'win32' ? ['-c', 'core.longpaths=true'] : [] -} - -var gitcmd - -function execGit (args, options, cb) { - var fullArgs = prefixGitArgs().concat(args || []) - return execFile(gitcmd, fullArgs, options, cb) -} - -function gitWhichAndExec (args, options, cb) { - if (gitcmd) return execGit(args, options, cb) - - which('git', function (err, pathtogit) { - if (err) { - err.code = 'ENOGIT' - return cb(err) - } - gitcmd = pathtogit - - execGit(args, options, cb) - }) -} - -function andClone (gitdir, repodir, cb) { - return function (er) { - if (er) return cb(er) - gitWhichAndExec(['clone', gitdir, repodir], {}, cb) - } -} - -function setup (cb) { - cleanup() - mkdirp.sync(wd) - - extract(testcase_tgz, wd, andClone(testcase_git, testcase_path, andExtractPackages)) - - function andExtractPackages (er) { - if (er) return cb(er) - asyncMap(testtarballs, function (tgz, done) { - extract(tgz, wd, done) - }, andChdir) - } - function andChdir (er) { - if (er) return cb(er) - process.chdir(testcase_path) - andLoadNpm() - } - function andLoadNpm () { - var opts = { - cache: path.resolve(wd, 'cache') - } - npm.load(opts, cb) - } -} - -// there are two (sic) valid trees that can result we don't care which one we -// get in npm@2 -var oneTree = [ - 'npm-git-test@1.0.0', [ - ['dummy-npm-bar@4.0.0', [ - ['dummy-npm-foo@3.0.0', []], - ['dummy-npm-buzz@3.0.0', []] - ]], - ['dummy-npm-buzz@3.0.0', []], - ['dummy-npm-foo@4.0.0', [ - ['dummy-npm-buzz@2.0.0', []] - ]] - ] -] -var otherTree = [ - 'npm-git-test@1.0.0', [ - ['dummy-npm-bar@4.0.0', [ - ['dummy-npm-buzz@3.0.0', []], - ['dummy-npm-foo@3.0.0', []] - ]], - ['dummy-npm-buzz@3.0.0', []], - ['dummy-npm-foo@4.0.0', [ - ['dummy-npm-buzz@2.0.0', []] - ]] - ] -] - -function toSimple (tree) { - var deps = [] - Object.keys(tree.dependencies || {}).forEach(function (dep) { - deps.push(toSimple(tree.dependencies[dep])) - }) - return [ tree['name'] + '@' + tree['version'], deps ] -} - -test('setup', function (t) { - setup(function (er) { - t.ifError(er, 'setup ran OK') - t.end() - }) -}) - -test('correct versions are installed for git dependency', function (t) { - t.comment('test for https://github.com/npm/npm/issues/7202') - npm.commands.install([], function (er) { - t.ifError(er, 'installed OK') - npm.commands.ls([], true, function (er, result) { - t.ifError(er, 'ls OK') - var simplified = toSimple(result) - if (deepEqual(simplified, oneTree) || deepEqual(simplified, otherTree)) { - t.pass('install tree is correct') - } else { - t.isDeeply(simplified, oneTree, 'oneTree matches') - t.isDeeply(simplified, otherTree, 'otherTree matches') - } - t.done() - }) - }) -}) diff --git a/deps/npm/test/need-npm5-update/ignore-shrinkwrap.js b/deps/npm/test/need-npm5-update/ignore-shrinkwrap.js deleted file mode 100644 index 4980b659fd23f4..00000000000000 --- a/deps/npm/test/need-npm5-update/ignore-shrinkwrap.js +++ /dev/null @@ -1,135 +0,0 @@ -var fs = require('graceful-fs') -var path = require('path') - -var mkdirp = require('mkdirp') -var mr = require('npm-registry-mock') -var rimraf = require('rimraf') -var test = require('tap').test - -var common = require('../common-tap.js') - -var pkg = require('path').join(__dirname, 'ignore-shrinkwrap') - -var EXEC_OPTS = { cwd: pkg } - -var customMocks = { - 'get': { - '/package.js': [200, { ente: true }], - '/shrinkwrap.js': [200, { ente: true }] - } -} - -var json = { - author: 'Rocko Artischocko', - name: 'ignore-shrinkwrap', - version: '0.0.0', - dependencies: { - 'npm-test-ignore-shrinkwrap-file': 'http://localhost:' + common.port + '/package.js' - } -} - -var shrinkwrap = { - name: 'ignore-shrinkwrap', - version: '0.0.0', - dependencies: { - 'npm-test-ignore-shrinkwrap-file': { - version: '1.2.3', - from: 'http://localhost:' + common.port + '/shrinkwrap.js', - resolved: 'http://localhost:' + common.port + '/shrinkwrap.js', - dependencies: { - opener: { - version: '1.3.0', - from: 'opener@1.3.0' - } - } - } - } -} - -test('setup', function (t) { - setup() - t.end() -}) - -test('npm install --no-shrinkwrap', function (t) { - mr({ port: common.port, mocks: customMocks }, function (err, s) { - t.ifError(err, 'mock registry bootstrapped without issue') - s._server.on('request', function (req) { - switch (req.url) { - case '/shrinkwrap.js': - t.fail('npm-shrinkwrap.json used instead of package.json') - break - case '/package.js': - t.pass('package.json used') - } - }) - - common.npm( - [ - '--registry', common.registry, - '--loglevel', 'silent', - 'install', '--no-shrinkwrap' - ], - EXEC_OPTS, - function (err, code) { - t.ifError(err, 'npm ran without issue') - t.ok(code, "install isn't going to succeed") - s.close() - t.end() - } - ) - }) -}) - -test('npm install (with shrinkwrap)', function (t) { - mr({ port: common.port, mocks: customMocks }, function (err, s) { - t.ifError(err, 'mock registry bootstrapped without issue') - s._server.on('request', function (req) { - switch (req.url) { - case '/shrinkwrap.js': - t.pass('shrinkwrap used') - break - case '/package.js': - t.fail('shrinkwrap ignored') - } - }) - - common.npm( - [ - '--registry', common.registry, - '--loglevel', 'silent', - 'install' - ], - EXEC_OPTS, - function (err, code) { - t.ifError(err, 'npm ran without issue') - t.ok(code, "install isn't going to succeed") - s.close() - t.end() - } - ) - }) -}) - -test('cleanup', function (t) { - cleanup() - t.end() -}) - -function cleanup () { - rimraf.sync(pkg) -} - -function setup () { - cleanup() - mkdirp.sync(pkg) - fs.writeFileSync( - path.join(pkg, 'package.json'), - JSON.stringify(json, null, 2) - ) - fs.writeFileSync( - path.join(pkg, 'npm-shrinkwrap.json'), - JSON.stringify(shrinkwrap, null, 2) - ) - process.chdir(pkg) -} diff --git a/deps/npm/test/need-npm5-update/legacy-array-bin.js b/deps/npm/test/need-npm5-update/legacy-array-bin.js deleted file mode 100644 index 3e421ee23e3ff0..00000000000000 --- a/deps/npm/test/need-npm5-update/legacy-array-bin.js +++ /dev/null @@ -1,80 +0,0 @@ -'use strict' -var test = require('tap').test -var common = require('../common-tap.js') -var path = require('path') -var rimraf = require('rimraf') -var mkdirp = require('mkdirp') -var basepath = path.resolve(__dirname, path.basename(__filename, '.js')) -var fixturepath = path.resolve(basepath, 'npm-test-array-bin') -var modulepath = path.resolve(basepath, 'node_modules') -var installedpath = path.resolve(modulepath, 'npm-test-array-bin') -var Tacks = require('tacks') -var File = Tacks.File -var Dir = Tacks.Dir -var fixture = new Tacks( - Dir({ - bin: Dir({ - 'array-bin': File( - '#!/usr/bin/env node\n' + - "console.log('test ran ok')\n" - ) - }), - 'package.json': File({ - name: 'npm-test-array-bin', - version: '1.2.5', - bin: [ - 'bin/array-bin' - ], - scripts: { - test: 'node test.js' - } - }), - 'test.js': File( - "require('child_process').exec('array-bin', { env: process.env },\n" + - ' function (err, stdout, stderr) {\n' + - " if (err && err.code) throw new Error('exited badly with code = ' + err.code)\n" + - ' console.log(stdout)\n' + - ' console.error(stderr)\n' + - ' }\n' + - ')\n' - ) - }) -) -test('setup', function (t) { - setup() - t.done() -}) -test('array-bin', function (t) { - common.npm(['install', fixturepath], {cwd: basepath}, installCheckAndTest) - function installCheckAndTest (err, code, stdout, stderr) { - if (err) throw err - t.is(code, 0, 'install went ok') - t.equal(stderr, '', 'no error output') - common.npm(['test'], {cwd: installedpath}, testCheckAndRemove) - } - function testCheckAndRemove (err, code, stdout, stderr) { - t.ifError(err, 'npm test on array bin') - t.equal(code, 0, 'exited OK') - t.equal(stderr.trim(), '', 'no error output') - t.match(stdout, /test ran ok/, 'child script ran properly') - common.npm(['rm', fixturepath], {cwd: basepath}, removeCheckAndDone) - } - function removeCheckAndDone (err, code, stdout, stderr) { - if (err) throw err - t.is(code, 0, 'remove went ok') - t.done() - } -}) -test('cleanup', function (t) { - cleanup() - t.done() -}) -function setup () { - cleanup() - fixture.create(fixturepath) - mkdirp.sync(modulepath) -} -function cleanup () { - fixture.remove(fixturepath) - rimraf.sync(basepath) -} diff --git a/deps/npm/test/need-npm5-update/legacy-dir-bin.js b/deps/npm/test/need-npm5-update/legacy-dir-bin.js deleted file mode 100644 index e9e6bdfe1320f6..00000000000000 --- a/deps/npm/test/need-npm5-update/legacy-dir-bin.js +++ /dev/null @@ -1,79 +0,0 @@ -'use strict' -var test = require('tap').test -var common = require('../common-tap.js') -var path = require('path') -var rimraf = require('rimraf') -var mkdirp = require('mkdirp') -var basepath = path.resolve(__dirname, path.basename(__filename, '.js')) -var fixturepath = path.resolve(basepath, 'npm-test-dir-bin') -var modulepath = path.resolve(basepath, 'node_modules') -var installedpath = path.resolve(modulepath, 'npm-test-dir-bin') -var Tacks = require('tacks') -var File = Tacks.File -var Dir = Tacks.Dir -var fixture = new Tacks( - Dir({ - bin: Dir({ - 'dir-bin': File( - '#!/usr/bin/env node\n' + - "console.log('test ran ok')\n" - ) - }), - 'package.json': File({ - name: 'npm-test-dir-bin', - version: '1.2.5', - directories: { - bin: './bin' - }, - scripts: { - test: 'node test.js' - } - }), - 'test.js': File( - "require('child_process').exec('dir-bin', { env: process.env },\n" + - ' function (err, stdout, stderr) {\n' + - " if (err && err.code) throw new Error('exited badly with code = ' + err.code)\n" + - ' console.log(stdout)\n' + - ' console.error(stderr)\n' + - ' }\n' + - ')\n' - ) - }) -) -test('setup', function (t) { - setup() - t.done() -}) -test('dir-bin', function (t) { - common.npm(['install', fixturepath], {cwd: basepath}, installCheckAndTest) - function installCheckAndTest (err, code, stdout, stderr) { - if (err) throw err - t.is(code, 0, 'install went ok') - common.npm(['test'], {cwd: installedpath}, testCheckAndRemove) - } - function testCheckAndRemove (err, code, stdout, stderr) { - t.ifError(err, 'npm test on array bin') - t.equal(code, 0, 'exited OK') - t.equal(stderr.trim(), '', 'no error output') - t.match(stdout, /test ran ok/, 'child script ran properly') - common.npm(['rm', fixturepath], {cwd: basepath}, removeCheckAndDone) - } - function removeCheckAndDone (err, code, stdout, stderr) { - if (err) throw err - t.is(code, 0, 'remove went ok') - t.done() - } -}) -test('cleanup', function (t) { - cleanup() - t.done() -}) -function setup () { - cleanup() - fixture.create(fixturepath) - mkdirp.sync(modulepath) -} -function cleanup () { - fixture.remove(fixturepath) - rimraf.sync(basepath) -} diff --git a/deps/npm/test/need-npm5-update/legacy-npm-self-install.js b/deps/npm/test/need-npm5-update/legacy-npm-self-install.js deleted file mode 100644 index 6bcd8073621d0b..00000000000000 --- a/deps/npm/test/need-npm5-update/legacy-npm-self-install.js +++ /dev/null @@ -1,106 +0,0 @@ -'use strict' -var test = require('tap').test -var fs = require('graceful-fs') -var common = require('../common-tap.js') -var path = require('path') -var rimraf = require('rimraf') -var mkdirp = require('mkdirp') -var osenv = require('osenv') -var npmpath = path.resolve(__dirname, '../..') -var basepath = path.resolve(osenv.tmpdir(), path.basename(__filename, '.js')) -var globalpath = path.resolve(basepath, 'global') -var isWin32 = process.platform === 'win32' - -test('setup', function (t) { - setup() - t.done() -}) - -var tarball - -test('build-tarball', function (t) { - common.npm(['pack'], {cwd: npmpath, stdio: ['ignore', 'pipe', process.stderr]}, function (err, code, stdout) { - if (err) throw err - t.is(code, 0, 'pack went ok') - tarball = path.resolve(npmpath, stdout.trim().replace(/^(?:.|\n)*(?:^|\n)(.*?[.]tgz)$/, '$1')) - t.match(tarball, /[.]tgz$/, 'got a tarball') - t.done() - }) -}) - -function exists () { - try { - fs.statSync(path.resolve.apply(null, arguments)) - return true - } catch (ex) { - return false - } -} - -test('npm-self-install', function (t) { - if (!tarball) return t.done() - - var env = Object.assign({}, process.env) - var pathsep = isWin32 ? ';' : ':' - env.npm_config_prefix = globalpath - env.npm_config_global = 'true' - env.NODE_PATH = null - env.npm_config_user_agent = null - env.npm_config_color = 'always' - env.npm_config_progress = 'always' - env.npm_config_shrinkwrap = 'false' - var PATH = env.PATH ? env.PATH.split(pathsep) : [] - var binpath = isWin32 ? globalpath : path.join(globalpath, 'bin') - var cmdname = isWin32 ? 'npm.cmd' : 'npm' - PATH.unshift(binpath) - env.PATH = PATH.join(pathsep) - - var opts = {cwd: basepath, env: env, stdio: ['ignore', 'ignore', process.stderr]} - - common.npm(['install', '--ignore-scripts', tarball], opts, installCheckAndTest) - function installCheckAndTest (err, code) { - if (err) throw err - t.is(code, 0, 'install went ok') - t.is(exists(binpath, cmdname), true, 'binary was installed') - t.is(exists(globalpath, isWin32 ? '' : 'lib', 'node_modules', 'npm'), true, 'module path exists') - common.npm(['ls', '--json', '--depth=0'], {cwd: basepath, env: env}, lsCheckAndRemove) - } - function lsCheckAndRemove (err, code, stdout, stderr) { - t.ifError(err, 'npm test on array bin') - t.equal(code, 0, 'exited OK') - t.equal(stderr.trim(), '', 'no error output') - var installed = JSON.parse(stdout.trim()) - t.is(Object.keys(installed.dependencies).length, 1, 'one thing installed') - t.is(path.resolve(globalpath, installed.dependencies.npm.from), tarball, 'and it was our npm tarball') - common.npm(['rm', 'npm'], {cwd: basepath, env: env}, removeCheck) - } - function removeCheck (err, code) { - if (err) throw err - t.is(code, 0, 'remove went ok') - common.npm(['ls', '--json', '--depth=0'], {cwd: basepath, env: env}, andDone) - } - function andDone (err, code, stdout, stderr) { - if (err) throw err - t.is(code, 0, 'remove went ok') - t.equal(stderr.trim(), '', 'no error output') - var installed = JSON.parse(stdout.trim()) - t.ok(!installed.dependencies || installed.dependencies.length === 0, 'nothing left') - t.is(exists(binpath, cmdname), false, 'binary was removed') - t.is(exists(globalpath, 'lib', 'node_modules', 'npm'), false, 'module was entirely removed') - t.done() - } -}) - -test('cleanup', function (t) { - cleanup() - t.done() -}) - -function setup () { - cleanup() - mkdirp.sync(globalpath) -} - -function cleanup () { - rimraf.sync(basepath) -} diff --git a/deps/npm/test/need-npm5-update/legacy-optional-deps.js b/deps/npm/test/need-npm5-update/legacy-optional-deps.js deleted file mode 100644 index 08ac98522de8c9..00000000000000 --- a/deps/npm/test/need-npm5-update/legacy-optional-deps.js +++ /dev/null @@ -1,80 +0,0 @@ -'use strict' -var path = require('path') -var fs = require('fs') -var test = require('tap').test -var common = require('../common-tap.js') -var rimraf = require('rimraf') -var mkdirp = require('mkdirp') -var mr = require('npm-registry-mock') -var basepath = path.resolve(__dirname, path.basename(__filename, '.js')) -var fixturepath = path.resolve(basepath, 'npm-test-optional-deps') -var modulepath = path.resolve(basepath, 'node_modules') -var Tacks = require('tacks') -var File = Tacks.File -var Dir = Tacks.Dir - -var fixture = new Tacks( - Dir({ - README: File( - 'just an npm test\n' - ), - 'package.json': File({ - name: 'npm-test-optional-deps', - version: '1.2.5', - optionalDependencies: { - 'npm-test-foobarzaaakakaka': common.registry + '/not-a-package', - async: '10.999.14234', - mkdirp: '0.3.5', - optimist: 'some invalid version 99 #! $$ x y z', - 'npm-test-failer': '*' - } - }) - }) -) - -var server - -test('setup', function (t) { - setup() - mr({port: common.port}, function (err, s) { - if (err) throw err - server = s - t.done() - }) -}) - -test('optional-deps', function (t) { - server.get('/npm-test-failer').reply(404, {error: 'nope'}) - server.get('/not-a-package').reply(200, 'HI THERE') - - var opts = ['--registry=' + common.registry, '--timeout=100'] - common.npm(opts.concat(['install', fixturepath]), {cwd: basepath}, installCheckAndTest) - - function installCheckAndTest (err, code, stdout, stderr) { - if (err) throw err - if (stderr) console.error(stderr) - server.done() - t.is(code, 0, 'install went ok') - var dir = fs.readdirSync(modulepath).sort() - t.isDeeply(dir, ['mkdirp', 'npm-test-optional-deps'], 'only one optional dep should be there') - t.is(require(path.resolve(modulepath, 'mkdirp', 'package.json')).version, '0.3.5', 'mkdirp version right') - t.done() - } -}) - -test('cleanup', function (t) { - cleanup() - server.close() - t.done() -}) - -function setup () { - cleanup() - fixture.create(fixturepath) - mkdirp.sync(modulepath) -} - -function cleanup () { - fixture.remove(fixturepath) - rimraf.sync(basepath) -} diff --git a/deps/npm/test/need-npm5-update/legacy-shrinkwrap.js b/deps/npm/test/need-npm5-update/legacy-shrinkwrap.js deleted file mode 100644 index 6f5303037707a0..00000000000000 --- a/deps/npm/test/need-npm5-update/legacy-shrinkwrap.js +++ /dev/null @@ -1,132 +0,0 @@ -'use strict' -var test = require('tap').test -var common = require('../common-tap.js') -var path = require('path') -var basepath = path.resolve(__dirname, path.basename(__filename, '.js')) -var Tacks = require('tacks') -var File = Tacks.File -var Dir = Tacks.Dir - -var fixture = new Tacks( - Dir({ - README: File( - 'just an npm test\n' - ), - 'npm-shrinkwrap.json': File({ - name: 'npm-test-shrinkwrap', - version: '0.0.0', - dependencies: { - glob: { - version: '3.1.5', - from: 'git://github.com/isaacs/node-glob.git#npm-test', - resolved: 'git://github.com/isaacs/node-glob.git#67bda227fd7a559cca5620307c7d30a6732a792f', - dependencies: { - 'graceful-fs': { - version: '1.1.5', - resolved: 'https://registry.npmjs.org/graceful-fs/-/graceful-fs-1.1.5.tgz', - dependencies: { - 'fast-list': { - version: '1.0.2', - resolved: 'https://registry.npmjs.org/fast-list/-/fast-list-1.0.2.tgz' - } - } - }, - inherits: { - version: '1.0.0', - resolved: 'https://registry.npmjs.org/inherits/-/inherits-1.0.0.tgz' - }, - minimatch: { - version: '0.2.1', - dependencies: { - 'lru-cache': { - version: '1.0.5' - } - } - } - } - }, - minimatch: { - version: '0.1.5', - resolved: 'https://registry.npmjs.org/minimatch/-/minimatch-0.1.5.tgz', - dependencies: { - 'lru-cache': { - version: '1.0.5', - resolved: 'https://registry.npmjs.org/lru-cache/-/lru-cache-1.0.5.tgz' - } - } - }, - 'npm-test-single-file': { - version: '1.2.3', - resolved: 'https://gist.github.com/isaacs/1837112/raw/9ef57a59fc22aeb1d1ca346b68826dcb638b8416/index.js' - } - } - }), - 'package.json': File({ - author: 'Isaac Z. Schlueter (http://blog.izs.me/)', - name: 'npm-test-shrinkwrap', - version: '0.0.0', - dependencies: { - 'npm-test-single-file': 'https://gist.github.com/isaacs/1837112/raw/9ef57a59fc22aeb1d1ca346b68826dcb638b8416/index.js', - glob: 'git://github.com/isaacs/node-glob.git#npm-test', - minimatch: '~0.1.0' - }, - scripts: { - test: 'node test.js' - } - }) - }) -) - -test('setup', function (t) { - setup() - t.done() -}) - -test('shrinkwrap', function (t) { - common.npm(['install'], {cwd: basepath}, installCheckAndTest) - - function installCheckAndTest (err, code, stdout, stderr) { - if (err) throw err - console.error(stderr) - t.is(code, 0, 'install went ok') - - common.npm(['ls', '--json'], {cwd: basepath}, verifyLsMatchesShrinkwrap) - } - - function verifyLsMatchesShrinkwrap (err, code, stdout, stderr) { - if (err) throw err - console.error(stderr) - t.is(code, 0, 'ls went ok') - var actual = JSON.parse(stdout) - var expected = require(path.resolve(basepath, 'npm-shrinkwrap.json')) - // from is expected to vary - t.isDeeply(rmFrom(actual), rmFrom(expected)) - t.done() - } - - function rmFrom (obj) { - for (var i in obj) { - if (i === 'from') { - delete obj[i] - } else if (i === 'dependencies') { - for (var j in obj[i]) { - rmFrom(obj[i][j]) - } - } - } - } -}) - -test('cleanup', function (t) { - cleanup() - t.done() -}) - -function setup () { - cleanup() - fixture.create(basepath) -} - -function cleanup () { - fixture.remove(basepath) -} diff --git a/deps/npm/test/need-npm5-update/lifecycle-signal.js b/deps/npm/test/need-npm5-update/lifecycle-signal.js deleted file mode 100644 index 5f9f4c43cfeb0c..00000000000000 --- a/deps/npm/test/need-npm5-update/lifecycle-signal.js +++ /dev/null @@ -1,140 +0,0 @@ -var fs = require('graceful-fs') -var path = require('path') -var spawn = require('child_process').spawn - -var mkdirp = require('mkdirp') -var osenv = require('osenv') -var rimraf = require('rimraf') -var test = require('tap').test - -var node = process.execPath -var npm = require.resolve('../../bin/npm-cli.js') - -var pkg = path.resolve(__dirname, 'lifecycle-signal') - -var asyncScript = 'console.error(process.pid);process.on(\'SIGINT\',function (){' -asyncScript += 'setTimeout(function(){console.error(process.pid);process.exit()},10)' -asyncScript += '});setInterval(function(){},10);' - -var zombieScript = 'console.error(process.pid);process.on(\'SIGINT\',function (){' -zombieScript += '});setInterval(function(){console.error(process.pid)},10);' - -var SIGSEGV = require('constants').SIGSEGV // eslint-disable-line node/no-deprecated-api - -var json = { - name: 'lifecycle-signal', - version: '1.2.5', - scripts: { - preinstall: 'node -e "process.kill(process.pid,\'SIGSEGV\')"', - forever: 'node -e "console.error(process.pid);setInterval(function(){},1000)"', - async: 'node -e "' + asyncScript + '"', - zombie: 'node -e "' + zombieScript + '"' - } -} - -test('setup', function (t) { - cleanup() - mkdirp.sync(pkg) - fs.writeFileSync( - path.join(pkg, 'package.json'), - JSON.stringify(json, null, 2) - ) - - process.chdir(pkg) - t.end() -}) - -test('lifecycle signal abort', { - skip: process.platform === 'win32' && 'windows does not use lifecycle signals' -}, function (t) { - var child = spawn(node, [npm, 'install'], { - cwd: pkg - }) - child.on('close', function (code, signal) { - // The error may be forwarded by the shell as an exit code rather than - // the signal itself. - t.ok((code === 128 + SIGSEGV) || signal === 'SIGSEGV') - t.end() - }) -}) - -test('lifecycle propagate signal term to child', { - /* This feature is broken. npm runs its lifecycle processes in a shell, and at - * least `bash` doesn’t forward SIGTERM to its children. */ - skip: process.platform !== 'darwin' && 'broken' -}, function (t) { - var innerChildPid - var child = spawn(npm, ['run', 'forever'], { - cwd: pkg - }) - child.stderr.on('data', function (data) { - innerChildPid = parseInt(data.toString(), 10) - t.doesNotThrow(function () { - process.kill(innerChildPid, 0) // inner child should be running - }) - child.kill() // send SIGTERM to npm - }) - child.on('exit', function (code, signal) { - t.equal(code, null) - t.equal(signal, 'SIGTERM') - t.throws(function () { - process.kill(innerChildPid, 0) // SIGTERM should have reached inner child - }) - t.end() - }) -}) - -test('lifecycle wait for async child process exit', { - skip: process.platform !== 'darwin' && 'broken' -}, function (t) { - var innerChildPid - var interrupted - var child = spawn(npm, ['run', 'async'], { - cwd: pkg - }) - child.stderr.on('data', function (data) { - if (!interrupted) { - interrupted = true - child.kill('SIGINT') - } else { - innerChildPid = parseInt(data.toString(), 10) - } - }) - child.on('exit', function (code, signal) { - t.ok(innerChildPid) - t.end() - }) -}) - -test('lifecycle force kill using multiple SIGINT signals', { - skip: process.platform !== 'darwin' && 'broken' -}, function (t) { - var innerChildPid - var interrupted - var child = spawn(npm, ['run', 'zombie'], { - cwd: pkg - }) - child.stderr.on('data', function (data) { - if (!interrupted) { - interrupted = true - child.kill('SIGINT') - } else { - innerChildPid = parseInt(data.toString(), 10) - child.kill('SIGINT') - } - }) - child.on('exit', function (code, signal) { - t.ok(innerChildPid) - t.end() - }) -}) - -test('cleanup', function (t) { - cleanup() - t.end() -}) - -function cleanup () { - process.chdir(osenv.tmpdir()) - rimraf.sync(pkg) -} diff --git a/deps/npm/test/need-npm5-update/move-no-clobber-dest-node-modules.js b/deps/npm/test/need-npm5-update/move-no-clobber-dest-node-modules.js deleted file mode 100644 index a00c720243ed7c..00000000000000 --- a/deps/npm/test/need-npm5-update/move-no-clobber-dest-node-modules.js +++ /dev/null @@ -1,139 +0,0 @@ -'use strict' -var path = require('path') -var test = require('tap').test -var fs = require('graceful-fs') -var mkdirp = require('mkdirp') -var rimraf = require('rimraf') -var base = path.join(__dirname, path.basename(__filename, '.js')) -var common = require('../common-tap.js') - -function fixturepath () { - return path.join(base, path.join.apply(path, arguments)) -} - -function File (contents) { - return { - type: 'file', - contents: typeof contents === 'object' - ? JSON.stringify(contents) - : contents - } -} - -function Dir (contents) { - return { - type: 'dir', - contents: contents || {} - } -} - -function createFixtures (filename, fixture) { - if (fixture.type === 'dir') { - mkdirp.sync(filename) - Object.keys(fixture.contents).forEach(function (content) { - createFixtures(path.resolve(filename, content), fixture.contents[content]) - }) - } else if (fixture.type === 'file') { - fs.writeFileSync(filename, fixture.contents) - } else { - throw new Error('Unknown fixture type: ' + fixture.type) - } -} - -var fixtures = Dir({ -// The fixture modules - 'moda@1.0.1': Dir({ - 'package.json': File({ - name: 'moda', - version: '1.0.1' - }) - }), - 'modb@1.0.0': Dir({ - 'package.json': File({ - name: 'modb', - version: '1.0.0', - bundleDependencies: ['modc'], - dependencies: { - modc: fixturepath('modc@1.0.0') - } - }) - }), - 'modc@1.0.0': Dir({ - 'package.json': File({ - name: 'modc', - version: '1.0.0' - }) - }), - // The local config - 'package.json': File({ - dependencies: { - moda: fixturepath('moda@1.0.1'), - modb: fixturepath('modb@1.0.0') - } - }), - 'node_modules': Dir({ - 'moda': Dir({ - 'package.json': File({ - name: 'moda', - version: '1.0.0', - _requested: { rawSpec: fixturepath('moda@1.0.0') }, - dependencies: { - modb: fixturepath('modb@1.0.0') - }, - bundleDependencies: [ 'modb' ] - }) - }) - }) -}) - -function setup () { - cleanup() - createFixtures(base, fixtures) -} - -function cleanup () { - rimraf.sync(base) -} - -function exists (t, filepath, msg) { - try { - fs.statSync(filepath) - t.pass(msg) - return true - } catch (ex) { - t.fail(msg, {found: null, wanted: 'exists', compare: 'fs.stat(' + filepath + ')'}) - return false - } -} - -test('setup', function (t) { - setup() - common.npm('install', {cwd: fixturepath('modb@1.0.0')}, function (err, code, stdout, stderr) { - if (err) throw err - t.is(code, 0, 'modb') - common.npm('install', { - cwd: fixturepath('node_modules', 'moda') - }, function (err, code, stdout, stderr) { - if (err) throw err - t.is(code, 0, 'installed moda') - t.done() - }) - }) -}) - -test('no-clobber', function (t) { - common.npm('install', {cwd: base}, function (err, code, stdout, stderr) { - if (err) throw err - t.is(code, 0, 'installed ok') - exists(t, fixturepath('node_modules', 'moda'), 'moda') - exists(t, fixturepath('node_modules', 'modb'), 'modb') - exists(t, fixturepath('node_modules', 'modb', 'node_modules', 'modc'), 'modc') - t.done() - }) -}) - -test('cleanup', function (t) { - cleanup() - t.pass() - t.done() -}) diff --git a/deps/npm/test/need-npm5-update/need-only-update-save-optional/update-save.js b/deps/npm/test/need-npm5-update/need-only-update-save-optional/update-save.js deleted file mode 100644 index f01fa0f5421cf8..00000000000000 --- a/deps/npm/test/need-npm5-update/need-only-update-save-optional/update-save.js +++ /dev/null @@ -1,219 +0,0 @@ -var fs = require('graceful-fs') -var path = require('path') - -var mkdirp = require('mkdirp') -var mr = require('npm-registry-mock') -var osenv = require('osenv') -var rimraf = require('rimraf') -var test = require('tap').test - -var common = require('../common-tap.js') -var server - -var pkg = path.resolve(__dirname, 'update-save') -var cache = path.resolve(pkg, 'cache') - -var EXEC_OPTS = { - cwd: pkg, - stdio: 'ignore', - env: { - npm_config_registry: common.registry, - npm_config_loglevel: 'verbose', - npm_config_save_prefix: '^' - } -} - -var json = { - name: 'update-save-example', - version: '1.2.3', - dependencies: { - mkdirp: '~0.3.0' - }, - devDependencies: { - underscore: '~1.3.1' - } -} - -function clone (a) { - return extend({}, a) -} - -function extend (a, b) { - for (var key in b) { a[key] = b[key] } - return a -} - -test('setup', function (t) { - setup() - - mr({ port: common.port }, function (er, s) { - t.ifError(er) - server = s - t.end() - }) -}) - -test('update regular dependencies only', function (t) { - setup() - - common.npm(['update', '--save'], EXEC_OPTS, function (err, code) { - t.ifError(err) - t.notOk(code, 'npm update exited with code 0') - - var pkgdata = JSON.parse(fs.readFileSync(path.join(pkg, 'package.json'), 'utf8')) - t.deepEqual( - pkgdata.dependencies, - { mkdirp: '^0.3.5' }, - 'only dependencies updated' - ) - t.deepEqual( - pkgdata.devDependencies, - json.devDependencies, - 'dev dependencies should be untouched' - ) - t.deepEqual( - pkgdata.optionalDependencies, - json.optionalDependencies, - 'optional dependencies should be untouched' - ) - - t.end() - }) -}) - -test('update devDependencies only', function (t) { - setup() - - common.npm(['update', '--save-dev'], EXEC_OPTS, function (err, code) { - t.ifError(err) - t.notOk(code, 'npm update exited with code 0') - - var pkgdata = JSON.parse(fs.readFileSync(path.join(pkg, 'package.json'), 'utf8')) - t.deepEqual( - pkgdata.dependencies, - json.dependencies, - 'dependencies should be untouched' - ) - t.deepEqual( - pkgdata.devDependencies, - { underscore: '^1.3.3' }, - 'dev dependencies should be updated' - ) - t.deepEqual( - pkgdata.optionalDependencies, - json.optionalDependencies, - 'optional dependencies should be untouched' - ) - - t.end() - }) -}) - -test('update optionalDependencies only', function (t) { - setup({ optionalDependencies: { underscore: '~1.3.1' } }) - - common.npm(['update', '--save-optional'], EXEC_OPTS, function (err, code) { - t.ifError(err) - t.notOk(code, 'npm update exited with code 0') - - var pkgdata = JSON.parse(fs.readFileSync(path.join(pkg, 'package.json'), 'utf8')) - t.deepEqual( - pkgdata.dependencies, - json.dependencies, - 'dependencies should be untouched' - ) - t.deepEqual( - pkgdata.devDependencies, - json.devDependencies, - 'dev dependencies should be untouched' - ) - t.deepEqual( - pkgdata.optionalDependencies, - { underscore: '^1.3.3' }, - 'optional dependencies should be updated' - ) - - t.end() - }) -}) - -test('optionalDependencies are merged into dependencies during --save', function (t) { - var cloned = setup({ optionalDependencies: { underscore: '~1.3.1' } }) - - common.npm(['update', '--save'], EXEC_OPTS, function (err, code) { - t.ifError(err) - t.notOk(code, 'npm update exited with code 0') - - var pkgdata = JSON.parse(fs.readFileSync(path.join(pkg, 'package.json'), 'utf8')) - t.deepEqual( - pkgdata.dependencies, - { mkdirp: '^0.3.5' }, - 'dependencies should not include optional dependencies' - ) - t.deepEqual( - pkgdata.devDependencies, - cloned.devDependencies, - 'dev dependencies should be untouched' - ) - t.deepEqual( - pkgdata.optionalDependencies, - cloned.optionalDependencies, - 'optional dependencies should be untouched' - ) - - t.end() - }) -}) - -test('semver prefix is replaced with configured save-prefix', function (t) { - setup() - - common.npm(['update', '--save', '--save-prefix', '~'], EXEC_OPTS, function (err, code) { - t.ifError(err) - t.notOk(code, 'npm update exited with code 0') - - var pkgdata = JSON.parse(fs.readFileSync(path.join(pkg, 'package.json'), 'utf8')) - t.deepEqual( - pkgdata.dependencies, - { mkdirp: '~0.3.5' }, - 'dependencies should be updated' - ) - t.deepEqual( - pkgdata.devDependencies, - json.devDependencies, - 'dev dependencies should be untouched' - ) - t.deepEqual( - pkgdata.optionalDependencies, - json.optionalDependencies, - 'optional dependencies should be updated' - ) - - t.end() - }) -}) - -test('cleanup', function (t) { - server.close() - cleanup() - t.end() -}) - -function cleanup () { - process.chdir(osenv.tmpdir()) - rimraf.sync(pkg) -} - -function setup (extendWith) { - cleanup() - mkdirp.sync(cache) - process.chdir(pkg) - - var template = clone(json) - extend(template, extendWith) - fs.writeFileSync( - path.join(pkg, 'package.json'), - JSON.stringify(template, null, 2) - ) - return template -} diff --git a/deps/npm/test/need-npm5-update/need-outdated/update-symlink.js b/deps/npm/test/need-npm5-update/need-outdated/update-symlink.js deleted file mode 100644 index 7de80b110d33d7..00000000000000 --- a/deps/npm/test/need-npm5-update/need-outdated/update-symlink.js +++ /dev/null @@ -1,127 +0,0 @@ -var fs = require('graceful-fs') -var path = require('path') -var mkdirp = require('mkdirp') -var mr = require('npm-registry-mock') -var rimraf = require('rimraf') -var test = require('tap').test - -var common = require('../common-tap.js') - -var testdir = path.join(__dirname, path.basename(__filename, '.js')) -var pkg = path.resolve(testdir, 'update-symlink') -var cachedir = path.join(testdir, 'cache') -var globaldir = path.join(testdir, 'global') -var OPTS = { - env: { - 'npm_config_cache': cachedir, - 'npm_config_prefix': globaldir, - 'npm_config_registry': common.registry - }, - cwd: pkg -} - -var jsonLocal = { - name: 'my-local-package', - description: 'fixture', - version: '1.0.0', - dependencies: { - 'async': '*', - 'underscore': '*' - } -} - -var server -test('setup', function (t) { - cleanup() - mkdirp.sync(cachedir) - mkdirp.sync(pkg) - fs.writeFileSync( - path.join(pkg, 'package.json'), - JSON.stringify(jsonLocal, null, 2) - ) - - mr({ port: common.port }, thenInstallUnderscore) - - function thenInstallUnderscore (er, s) { - server = s - common.npm(['install', '-g', 'underscore@1.3.1'], OPTS, thenLink) - } - - function thenLink (err, c, out) { - t.ifError(err, 'global install did not error') - common.npm(['link', 'underscore'], OPTS, thenInstallAsync) - } - - function thenInstallAsync (err, c, out) { - t.ifError(err, 'link did not error') - common.npm(['install', 'async@0.2.9'], OPTS, thenVerify) - } - - function thenVerify (err, c, out) { - t.ifError(err, 'local install did not error') - common.npm(['ls'], OPTS, function (err, c, out, stderr) { - t.ifError(err) - t.equal(c, 0) - t.equal(stderr, '', 'got expected stderr') - t.has(out, /async@0.2.9/, 'installed ok') - t.has(out, /underscore@1.3.1/, 'creates local link ok') - t.end() - }) - } -}) - -test('when update is called linked packages should be excluded', function (t) { - common.npm(['update', '--parseable'], OPTS, function (err, c, out, stderr) { - if (err) throw err - t.equal(c, 0) - t.has(out, /^update\tasync\t0.2.10\t/m, 'updated ok') - t.doesNotHave(stderr, /ERR!/, 'no errors in stderr') - t.end() - }) -}) - -test('when install is called and the package already exists as a link, outputs a warning if the requested version is not the same as the linked one', function (t) { - common.npm(['install', 'underscore', '--parseable'], OPTS, function (err, c, out, stderr) { - if (err) throw err - t.equal(c, 0) - - t.comment(out.trim()) - t.comment(stderr.trim()) - t.has(out, /^update-linked\tunderscore\t/m) - t.has(stderr, /underscore/, 'warning output relating to linked package') - t.doesNotHave(stderr, /ERR!/, 'no errors in stderr') - t.end() - }) -}) - -test('when install is called and the package already exists as a link, does not warn if the requested version is same as the linked one', function (t) { - common.npm(['install', 'underscore@1.3.1', '--parseable'], OPTS, function (err, c, out, stderr) { - if (err) throw err - t.equal(c, 0) - t.comment(out.trim()) - t.comment(stderr.trim()) - t.has(out, /^update-linked\tunderscore\t/m) - t.doesNotHave(stderr, /underscore/, 'no warning or error relating to linked package') - t.doesNotHave(stderr, /ERR!/, 'no errors in stderr') - t.end() - }) -}) - -test('cleanup', function (t) { - server.close() - common.npm(['rm', 'underscore', 'async'], OPTS, function (err, code) { - if (err) throw err - t.equal(code, 0, 'cleanup in local ok') - common.npm(['rm', '-g', 'underscore'], OPTS, function (err, code) { - if (err) throw err - t.equal(code, 0, 'cleanup in global ok') - - cleanup() - t.end() - }) - }) -}) - -function cleanup () { - rimraf.sync(testdir) -} diff --git a/deps/npm/test/need-npm5-update/outdated-depth-deep.js b/deps/npm/test/need-npm5-update/outdated-depth-deep.js deleted file mode 100644 index 14d4f1faf8474e..00000000000000 --- a/deps/npm/test/need-npm5-update/outdated-depth-deep.js +++ /dev/null @@ -1,92 +0,0 @@ -var common = require('../common-tap') -var path = require('path') -var test = require('tap').test -var rimraf = require('rimraf') -var mr = require('npm-registry-mock') -var pkg = path.resolve(__dirname, 'outdated-depth-deep') -var cache = path.resolve(pkg, 'cache') - -var osenv = require('osenv') -var mkdirp = require('mkdirp') -var fs = require('fs') - -var pj = JSON.stringify({ - 'name': 'whatever', - 'description': 'yeah idk', - 'version': '1.2.3', - 'main': 'index.js', - 'dependencies': { - 'underscore': '1.3.1', - 'npm-test-peer-deps': '0.0.0' - }, - 'repository': 'git://github.com/luk-/whatever' -}, null, 2) - -function cleanup () { - process.chdir(osenv.tmpdir()) - rimraf.sync(pkg) -} - -function setup () { - mkdirp.sync(pkg) - process.chdir(pkg) - fs.writeFileSync(path.resolve(pkg, 'package.json'), pj) -} - -test('setup', function (t) { - cleanup() - setup() - t.end() -}) - -test('outdated depth deep (9999)', function (t) { - var conf = [ - '--registry', common.registry, - '--cache', cache - ] - - var server - mr({ port: common.port }, thenTopLevelInstall) - - function thenTopLevelInstall (err, s) { - if (err) throw err - server = s - common.npm(conf.concat(['install', '.']), {cwd: pkg}, thenDeepInstall) - } - - function thenDeepInstall (err, code, stdout, stderr) { - if (err) throw err - t.is(code, 0, 'install completed successfully') - t.is('', stderr, 'no error output') - var depPath = path.join(pkg, 'node_modules', 'npm-test-peer-deps') - common.npm(conf.concat(['install', 'underscore']), {cwd: depPath}, thenRunOutdated) - } - - function thenRunOutdated (err, code, stdout, stderr) { - if (err) throw err - t.is(code, 0, 'deep install completed successfully') - t.is('', stderr, 'no error output') - common.npm(conf.concat(['outdated', '--depth', 9999]), {cwd: pkg}, thenValidateOutput) - } - - function thenValidateOutput (err, code, stdout, stderr) { - if (err) throw err - t.ifError(err) - t.is(code, 1, 'npm outdated exited with code 1') - t.match( - stdout, - /underscore.*1\.3\.1.*1\.3\.1.*1\.5\.1.*whatever\n/g, - 'child package listed') - t.match( - stdout, - /underscore.*1\.3\.1.*1\.3\.1.*1\.5\.1.*whatever > npm-test-peer-deps/g, - 'child package listed') - server.close() - t.end() - } -}) - -test('cleanup', function (t) { - cleanup() - t.end() -}) diff --git a/deps/npm/test/need-npm5-update/outdated-depth-integer.js b/deps/npm/test/need-npm5-update/outdated-depth-integer.js deleted file mode 100644 index 98c08fa192fcae..00000000000000 --- a/deps/npm/test/need-npm5-update/outdated-depth-integer.js +++ /dev/null @@ -1,80 +0,0 @@ -var common = require('../common-tap') -var test = require('tap').test -var rimraf = require('rimraf') -var npm = require('../../') -var mr = require('npm-registry-mock') -var path = require('path') -var pkg = path.resolve('outdated-depth-integer') - -var osenv = require('osenv') -var mkdirp = require('mkdirp') -var fs = require('fs') - -var pj = JSON.stringify({ - 'name': 'whatever', - 'description': 'yeah idk', - 'version': '1.2.3', - 'main': 'index.js', - 'dependencies': { - 'underscore': '1.3.1' - }, - 'repository': 'git://github.com/luk-/whatever' -}, null, 2) - -function cleanup () { - process.chdir(osenv.tmpdir()) - rimraf.sync(pkg) -} - -function setup () { - mkdirp.sync(pkg) - process.chdir(pkg) - fs.writeFileSync('package.json', pj) -} - -test('setup', function (t) { - cleanup() - setup() - t.end() -}) - -test('outdated depth integer', function (t) { - // todo: update with test-package-with-one-dep once the new - // npm-registry-mock is published - var expected = [[ - pkg, - 'underscore', - undefined, // no version installed - '1.3.1', // wanted - '1.5.1', // latest - '1.3.1', - null - ]] - - mr({ port: common.port }, function (er, s) { - npm.load({ - cache: pkg + '/cache', - loglevel: 'silent', - registry: common.registry, - depth: 5 - } - , function () { - npm.install('request@0.9.0', function (er) { - if (er) throw new Error(er) - npm.outdated(function (err, d) { - t.ifError(err, 'outdated did not error') - t.is(process.exitCode, 1, 'exitCode set to 1') - process.exitCode = 0 - t.deepEqual(d, expected) - s.close() - t.end() - }) - }) - }) - }) -}) - -test('cleanup', function (t) { - cleanup() - t.end() -}) diff --git a/deps/npm/test/need-npm5-update/outdated-include-devdependencies.js b/deps/npm/test/need-npm5-update/outdated-include-devdependencies.js deleted file mode 100644 index 331d0b3b33ada5..00000000000000 --- a/deps/npm/test/need-npm5-update/outdated-include-devdependencies.js +++ /dev/null @@ -1,58 +0,0 @@ -var fs = require('graceful-fs') -var path = require('path') - -var mkdirp = require('mkdirp') -var mr = require('npm-registry-mock') -var rimraf = require('rimraf') -var test = require('tap').test - -var npm = require('../../') -var common = require('../common-tap.js') - -// config -var pkg = path.resolve(__dirname, 'outdated-include-devdependencies') -var cache = path.resolve(pkg, 'cache') - -var json = { - author: 'Rocko Artischocko', - name: 'ignore-shrinkwrap', - version: '0.0.0', - devDependencies: { - underscore: '>=1.3.1' - } -} - -test('setup', function (t) { - cleanup() - mkdirp.sync(cache) - fs.writeFileSync( - path.join(pkg, 'package.json'), - JSON.stringify(json, null, 2) - ) - t.end() -}) - -test('includes devDependencies in outdated', function (t) { - process.chdir(pkg) - mr({ port: common.port }, function (er, s) { - npm.load({ cache: cache, registry: common.registry }, function () { - npm.outdated(function (er, d) { - t.ifError(er, 'npm outdated completed successfully') - t.is(process.exitCode, 1, 'exitCode set to 1') - process.exitCode = 0 - t.equal('1.5.1', d[0][3]) - s.close() - t.end() - }) - }) - }) -}) - -test('cleanup', function (t) { - cleanup() - t.end() -}) - -function cleanup () { - rimraf.sync(pkg) -} diff --git a/deps/npm/test/need-npm5-update/outdated-local.js b/deps/npm/test/need-npm5-update/outdated-local.js deleted file mode 100644 index c253331d07e575..00000000000000 --- a/deps/npm/test/need-npm5-update/outdated-local.js +++ /dev/null @@ -1,195 +0,0 @@ -var common = require('../common-tap.js') -var test = require('tap').test -var npm = require('../../') -var rimraf = require('rimraf') -var path = require('path') -var mr = require('npm-registry-mock') -var osenv = require('osenv') -var mkdirp = require('mkdirp') -var fs = require('graceful-fs') - -var pkg = path.resolve(__dirname, 'outdated-local') -var pkgLocal = path.resolve(pkg, 'local-module') -var pkgScopedLocal = path.resolve(pkg, 'another-local-module') -var pkgLocalUnderscore = path.resolve(pkg, 'underscore') -var pkgLocalOptimist = path.resolve(pkg, 'optimist') - -var pjParent = JSON.stringify({ - name: 'outdated-local', - version: '1.0.0', - dependencies: { - 'local-module': 'file:local-module', // updated locally, not on repo - '@scoped/another-local-module': 'file:another-local-module', // updated locally, scoped, not on repo - 'underscore': 'file:underscore', // updated locally, updated but lesser version on repo - 'optimist': 'file:optimist' // updated locally, updated and greater version on repo - } -}, null, 2) + '\n' - -var pjLocal = JSON.stringify({ - name: 'local-module', - version: '1.0.0' -}, null, 2) + '\n' - -var pjLocalBumped = JSON.stringify({ - name: 'local-module', - version: '1.1.0' -}, null, 2) + '\n' - -var pjScopedLocal = JSON.stringify({ - name: '@scoped/another-local-module', - version: '1.0.0' -}, null, 2) + '\n' - -var pjScopedLocalBumped = JSON.stringify({ - name: '@scoped/another-local-module', - version: '1.2.0' -}, null, 2) + '\n' - -var pjLocalUnderscore = JSON.stringify({ - name: 'underscore', - version: '1.3.1' -}, null, 2) + '\n' - -var pjLocalUnderscoreBumped = JSON.stringify({ - name: 'underscore', - version: '1.6.1' -}, null, 2) + '\n' - -var pjLocalOptimist = JSON.stringify({ - name: 'optimist', - version: '0.4.0' -}, null, 2) + '\n' - -var pjLocalOptimistBumped = JSON.stringify({ - name: 'optimist', - version: '0.5.0' -}, null, 2) + '\n' - -function mocks (server) { - server.get('/local-module') - .reply(404) - server.get('/@scoped%2fanother-local-module') - .reply(404) -} - -test('setup', function (t) { - bootstrap() - t.end() -}) - -test('outdated support local modules', function (t) { - t.plan(5) - process.chdir(pkg) - mr({ port: common.port, plugin: mocks }, function (err, s) { - t.ifError(err, 'mock registry started without problems') - - function verify (actual, expected) { - for (var i = 0; i < expected.length; i++) { - var current = expected[i] - - var found = false - for (var j = 0; j < actual.length; j++) { - var target = actual[j] - - var k - for (k = 0; k < current.length; k++) { - if (current[k] !== target[k]) break - } - if (k === current.length) found = true - } - - if (!found) return false - } - - return true - } - - npm.load( - { - loglevel: 'silent', - parseable: true, - registry: common.registry - }, - function () { - npm.install('.', function (err) { - t.ifError(err, 'install success') - bumpLocalModules() - npm.outdated(function (er, d) { - t.ifError(err, 'npm outdated ran without error') - t.is(process.exitCode, 1, 'errorCode set to 1') - process.exitCode = 0 - t.ok(verify(d, [ - [ - path.resolve(__dirname, 'outdated-local'), - 'local-module', - '1.0.0', - '1.1.0', - '1.1.0', - 'file:local-module' - ], - [ - path.resolve(__dirname, 'outdated-local'), - '@scoped/another-local-module', - '1.0.0', - '1.2.0', - '1.2.0', - 'file:another-local-module' - ], - [ - path.resolve(__dirname, 'outdated-local'), - 'underscore', - '1.3.1', - '1.6.1', - '1.5.1', - 'file:underscore' - ], - [ - path.resolve(__dirname, 'outdated-local'), - 'optimist', - '0.4.0', - '0.6.0', - '0.6.0', - 'optimist@0.6.0' - ] - ]), 'got expected outdated output') - s.close() - }) - }) - } - ) - }) -}) - -test('cleanup', function (t) { - cleanup() - t.end() -}) - -function bootstrap () { - mkdirp.sync(pkg) - fs.writeFileSync(path.resolve(pkg, 'package.json'), pjParent) - - mkdirp.sync(pkgLocal) - fs.writeFileSync(path.resolve(pkgLocal, 'package.json'), pjLocal) - - mkdirp.sync(pkgScopedLocal) - fs.writeFileSync(path.resolve(pkgScopedLocal, 'package.json'), pjScopedLocal) - - mkdirp.sync(pkgLocalUnderscore) - fs.writeFileSync(path.resolve(pkgLocalUnderscore, 'package.json'), pjLocalUnderscore) - - mkdirp.sync(pkgLocalOptimist) - fs.writeFileSync(path.resolve(pkgLocalOptimist, 'package.json'), pjLocalOptimist) -} - -function bumpLocalModules () { - fs.writeFileSync(path.resolve(pkgLocal, 'package.json'), pjLocalBumped) - fs.writeFileSync(path.resolve(pkgScopedLocal, 'package.json'), pjScopedLocalBumped) - fs.writeFileSync(path.resolve(pkgLocalUnderscore, 'package.json'), pjLocalUnderscoreBumped) - fs.writeFileSync(path.resolve(pkgLocalOptimist, 'package.json'), pjLocalOptimistBumped) -} - -function cleanup () { - process.chdir(osenv.tmpdir()) - rimraf.sync(pkg) -} diff --git a/deps/npm/test/need-npm5-update/outdated-new-versions.js b/deps/npm/test/need-npm5-update/outdated-new-versions.js deleted file mode 100644 index bfd63e18c355e7..00000000000000 --- a/deps/npm/test/need-npm5-update/outdated-new-versions.js +++ /dev/null @@ -1,65 +0,0 @@ -var fs = require('graceful-fs') -var path = require('path') - -var mkdirp = require('mkdirp') -var mr = require('npm-registry-mock') -var rimraf = require('rimraf') -var test = require('tap').test - -var common = require('../common-tap.js') -var npm = require('../../') - -var pkg = path.resolve(__dirname, 'outdated-new-versions') -var cache = path.resolve(pkg, 'cache') - -var json = { - name: 'new-versions-with-outdated', - author: 'Rockbert', - version: '0.0.0', - dependencies: { - underscore: '~1.3.1' - }, - devDependencies: { - request: '~0.9.0' - } -} - -test('setup', function (t) { - cleanup() - mkdirp.sync(cache) - fs.writeFileSync( - path.join(pkg, 'package.json'), - JSON.stringify(json, null, 2) - ) - t.end() -}) - -test('dicovers new versions in outdated', function (t) { - process.chdir(pkg) - t.plan(4) - - mr({ port: common.port }, function (er, s) { - npm.load({ cache: cache, registry: common.registry }, function () { - npm.outdated(function (er, d) { - t.ifError(er, 'npm outdated completed successfully') - t.is(process.exitCode, 1, 'exitCode set to 1') - process.exitCode = 0 - for (var i = 0; i < d.length; i++) { - if (d[i][1] === 'underscore') t.equal('1.5.1', d[i][4]) - if (d[i][1] === 'request') t.equal('2.27.0', d[i][4]) - } - s.close() - t.end() - }) - }) - }) -}) - -test('cleanup', function (t) { - cleanup() - t.end() -}) - -function cleanup () { - rimraf.sync(pkg) -} diff --git a/deps/npm/test/need-npm5-update/outdated-notarget.js b/deps/npm/test/need-npm5-update/outdated-notarget.js deleted file mode 100644 index 14388a80bc2922..00000000000000 --- a/deps/npm/test/need-npm5-update/outdated-notarget.js +++ /dev/null @@ -1,47 +0,0 @@ -// Fixes Issue #1770 -var common = require('../common-tap.js') -var test = require('tap').test -var npm = require('../../') -var osenv = require('osenv') -var path = require('path') -var fs = require('fs') -var rimraf = require('rimraf') -var mkdirp = require('mkdirp') -var pkg = path.resolve(__dirname, 'outdated-notarget') -var cache = path.resolve(pkg, 'cache') -var mr = require('npm-registry-mock') - -test('outdated-target: if no viable version is found, show error', function (t) { - t.plan(1) - setup() - mr({ port: common.port }, function (er, s) { - npm.load({ cache: cache, registry: common.registry }, function () { - npm.commands.update(function (er) { - t.equal(er.code, 'ETARGET') - s.close() - t.end() - }) - }) - }) -}) - -test('cleanup', function (t) { - process.chdir(osenv.tmpdir()) - rimraf.sync(pkg) - t.end() -}) - -function setup () { - mkdirp.sync(pkg) - mkdirp.sync(cache) - fs.writeFileSync(path.resolve(pkg, 'package.json'), JSON.stringify({ - author: 'Evan Lucas', - name: 'outdated-notarget', - version: '0.0.0', - description: 'Test for outdated-target', - dependencies: { - underscore: '~199.7.1' - } - }), 'utf8') - process.chdir(pkg) -} diff --git a/deps/npm/test/need-npm5-update/outdated-private.js b/deps/npm/test/need-npm5-update/outdated-private.js deleted file mode 100644 index 39bd6f1ac990fb..00000000000000 --- a/deps/npm/test/need-npm5-update/outdated-private.js +++ /dev/null @@ -1,115 +0,0 @@ -var common = require('../common-tap.js') -var test = require('tap').test -var npm = require('../../') -var rimraf = require('rimraf') -var path = require('path') -var mr = require('npm-registry-mock') -var osenv = require('osenv') -var mkdirp = require('mkdirp') -var fs = require('graceful-fs') - -var pkg = path.resolve(__dirname, 'outdated-private') -var pkgLocalPrivate = path.resolve(pkg, 'local-private') -var pkgScopedLocalPrivate = path.resolve(pkg, 'another-local-private') -var pkgLocalUnderscore = path.resolve(pkg, 'underscore') - -var pjParent = JSON.stringify({ - name: 'outdated-private', - version: '1.0.0', - dependencies: { - 'local-private': 'file:local-private', - '@scoped/another-local-private': 'file:another-local-private', - 'underscore': 'file:underscore' - } -}, null, 2) + '\n' - -var pjLocalPrivate = JSON.stringify({ - name: 'local-private', - version: '1.0.0', - 'private': true -}, null, 2) + '\n' - -var pjLocalPrivateBumped = JSON.stringify({ - name: 'local-private', - version: '1.1.0', - 'private': true -}, null, 2) + '\n' - -var pjScopedLocalPrivate = JSON.stringify({ - name: '@scoped/another-local-private', - version: '1.0.0', - 'private': true -}, null, 2) + '\n' - -var pjLocalUnderscore = JSON.stringify({ - name: 'underscore', - version: '1.3.1' -}, null, 2) + '\n' - -test('setup', function (t) { - bootstrap() - t.end() -}) - -test('outdated ignores private modules', function (t) { - t.plan(4) - process.chdir(pkg) - mr({ port: common.port }, function (er, s) { - npm.load( - { - loglevel: 'silent', - parseable: true, - registry: common.registry - }, - function () { - npm.install('.', function (err) { - t.ifError(err, 'install success') - bumpLocalPrivate() - npm.outdated(function (er, d) { - t.ifError(err, 'npm outdated ran without error') - t.is(process.exitCode, 1, 'exitCode set to 1') - process.exitCode = 0 - t.deepEqual(d, [[ - path.resolve(__dirname, 'outdated-private'), - 'underscore', - '1.3.1', - '1.5.1', - '1.5.1', - 'underscore@1.5.1', - null - ]]) - s.close() - }) - }) - } - ) - }) -}) - -test('cleanup', function (t) { - cleanup() - t.end() -}) - -function bootstrap () { - mkdirp.sync(pkg) - fs.writeFileSync(path.resolve(pkg, 'package.json'), pjParent) - - mkdirp.sync(pkgLocalPrivate) - fs.writeFileSync(path.resolve(pkgLocalPrivate, 'package.json'), pjLocalPrivate) - - mkdirp.sync(pkgScopedLocalPrivate) - fs.writeFileSync(path.resolve(pkgScopedLocalPrivate, 'package.json'), pjScopedLocalPrivate) - - mkdirp.sync(pkgLocalUnderscore) - fs.writeFileSync(path.resolve(pkgLocalUnderscore, 'package.json'), pjLocalUnderscore) -} - -function bumpLocalPrivate () { - fs.writeFileSync(path.resolve(pkgLocalPrivate, 'package.json'), pjLocalPrivateBumped) -} - -function cleanup () { - process.chdir(osenv.tmpdir()) - rimraf.sync(pkg) -} diff --git a/deps/npm/test/need-npm5-update/outdated-symlink.js b/deps/npm/test/need-npm5-update/outdated-symlink.js deleted file mode 100644 index 2f74e0551a85bb..00000000000000 --- a/deps/npm/test/need-npm5-update/outdated-symlink.js +++ /dev/null @@ -1,103 +0,0 @@ -var fs = require('graceful-fs') -var path = require('path') -var osenv = require('osenv') -var mkdirp = require('mkdirp') -var mr = require('npm-registry-mock') -var rimraf = require('rimraf') -var test = require('tap').test - -var common = require('../common-tap.js') - -var pkg = path.resolve(__dirname, 'outdated-symlink') -var cache = path.resolve(pkg, 'cache') - -var fakeRoot = path.join(pkg, 'fakeRoot') -var OPTS = { - env: Object.assign({}, process.env, { - 'npm_config_prefix': fakeRoot, - 'registry': common.registry - }) -} - -var json = { - name: 'my-local-package', - description: 'fixture', - version: '1.0.0' -} - -test('setup', function (t) { - cleanup() - mkdirp.sync(cache) - fs.writeFileSync( - path.join(pkg, 'package.json'), - JSON.stringify(json, null, 2) - ) - process.chdir(pkg) - common.npm(['install', '-g', 'async@0.2.9', 'underscore@1.3.1'], OPTS, function (err, code, stdout, stderr) { - if (err) throw err - t.comment(stdout) - t.comment(stderr) - common.npm(['link'], OPTS, function (err, code, stdout, stderr) { - if (err) throw err - t.comment(stdout) - t.comment(stderr) - t.is(code, 0) - common.npm(['ls', '-g'], OPTS, function (err, code, stdout, stderr) { - if (err) throw err - t.is(code, 0) - t.is(stderr, '', 'got expected stderr') - t.match(stdout, /my-local-package@1.0.0/, 'creates global link ok') - t.end() - }) - }) - }) -}) - -test('when outdated is called linked packages should be displayed as such', function (t) { - var regOutLinked = /my-local-package\s*1.0.0\s*linked\s*linked\n/ - var regOutInstallOne = /async\s*0.2.9\s*0.2.9\s*0.2.10\n/ - var regOutInstallTwo = /underscore\s*1.3.1\s*1.3.1\s*1.5.1\n/ - - mr({ port: common.port }, function (er, s) { - common.npm( - [ - '--registry', common.registry, - 'outdated', '-g' - ], - OPTS, - function (err, c, out, stderr) { - if (err) throw err - t.is(stderr, '') - t.match(out, regOutLinked, 'Global Link format as expected') - t.match(out, regOutInstallOne, 'Global Install format as expected') - t.match(out, regOutInstallTwo, 'Global Install format as expected') - s.close() - t.end() - } - ) - }) -}) - -test('cleanup', function (t) { - process.chdir(osenv.tmpdir()) - common.npm(['rm', 'outdated'], OPTS, function (err, code, stdout, stderr) { - if (err) throw err - t.comment(stdout) - t.comment(stderr) - t.is(code, 0, 'cleanup outdated in local ok') - common.npm(['rm', '-g', 'outdated', 'async', 'underscore'], OPTS, function (err, code) { - if (err) throw err - t.comment(stdout) - t.comment(stderr) - t.is(code, 0, 'cleanup outdated in global ok') - - cleanup() - t.end() - }) - }) -}) - -function cleanup () { - rimraf.sync(pkg) - rimraf.sync(fakeRoot) -} diff --git a/deps/npm/test/need-npm5-update/peer-deps-invalid.js b/deps/npm/test/need-npm5-update/peer-deps-invalid.js deleted file mode 100644 index 15fda253ecc48c..00000000000000 --- a/deps/npm/test/need-npm5-update/peer-deps-invalid.js +++ /dev/null @@ -1,100 +0,0 @@ -var fs = require('graceful-fs') -var path = require('path') - -var mkdirp = require('mkdirp') -var mr = require('npm-registry-mock') -var osenv = require('osenv') -var rimraf = require('rimraf') -var test = require('tap').test - -var npm = require('../../') -var common = require('../common-tap') - -var pkg = path.resolve(__dirname, 'peer-deps-invalid') -var cache = path.resolve(pkg, 'cache') - -var json = { - author: 'Domenic Denicola (http://domenicdenicola.com/)', - name: 'peer-deps-invalid', - version: '0.0.0', - dependencies: { - 'npm-test-peer-deps-file': 'http://localhost:' + common.port + '/ok.js', - 'npm-test-peer-deps-file-invalid': 'http://localhost:' + common.port + '/invalid.js' - } -} - -var fileFail = function () { -/**package -* { "name": "npm-test-peer-deps-file-invalid" -* , "main": "index.js" -* , "version": "1.2.3" -* , "description":"This one should conflict with the other one" -* , "peerDependencies": { "underscore": "1.3.3" } -* } -**/ - module.exports = 'I\'m just a lonely index, naked as the day I was born.' -}.toString().split('\n').slice(1, -1).join('\n') - -var fileOK = function () { -/**package -* { "name": "npm-test-peer-deps-file" -* , "main": "index.js" -* , "version": "1.2.3" -* , "description":"No package.json in sight!" -* , "peerDependencies": { "underscore": "1.3.1" } -* , "dependencies": { "mkdirp": "0.3.5" } -* } -**/ - module.exports = 'I\'m just a lonely index, naked as the day I was born.' -}.toString().split('\n').slice(1, -1).join('\n') - -test('setup', function (t) { - cleanup() - mkdirp.sync(cache) - fs.writeFileSync( - path.join(pkg, 'package.json'), - JSON.stringify(json, null, 2) - ) - fs.writeFileSync(path.join(pkg, 'file-ok.js'), fileOK) - fs.writeFileSync(path.join(pkg, 'file-fail.js'), fileFail) - - process.chdir(pkg) - t.end() -}) - -test('installing dependencies that have conflicting peerDependencies', function (t) { - var customMocks = { - 'get': { - '/ok.js': [200, path.join(pkg, 'file-ok.js')], - '/invalid.js': [200, path.join(pkg, 'file-fail.js')] - } - } - mr({port: common.port, mocks: customMocks}, function (err, s) { - t.ifError(err, 'mock registry started') - npm.load( - { - cache: cache, - registry: common.registry - }, - function () { - npm.commands.install([], function (err, additions, tree) { - t.error(err) - var invalid = tree.warnings.filter(function (warning) { return warning.code === 'EPEERINVALID' }) - t.is(invalid.length, 2) - s.close() - t.end() - }) - } - ) - }) -}) - -test('cleanup', function (t) { - cleanup() - t.end() -}) - -function cleanup () { - process.chdir(osenv.tmpdir()) - rimraf.sync(pkg) -} diff --git a/deps/npm/test/need-npm5-update/peer-deps-toplevel.js b/deps/npm/test/need-npm5-update/peer-deps-toplevel.js deleted file mode 100644 index 137375a2324283..00000000000000 --- a/deps/npm/test/need-npm5-update/peer-deps-toplevel.js +++ /dev/null @@ -1,132 +0,0 @@ -'use strict' -var path = require('path') -var test = require('tap').test -var mr = require('npm-registry-mock') -var Tacks = require('tacks') -var File = Tacks.File -var Dir = Tacks.Dir -var common = require('../common-tap.js') - -var basedir = path.join(__dirname, path.basename(__filename, '.js')) -var testdir = path.join(basedir, 'testdir') -var cachedir = path.join(basedir, 'cache') -var globaldir = path.join(basedir, 'global') -var tmpdir = path.join(basedir, 'tmp') - -var conf = { - cwd: testdir, - env: Object.assign({}, process.env, { - npm_config_cache: cachedir, - npm_config_tmp: tmpdir, - npm_config_prefix: globaldir, - npm_config_registry: common.registry, - npm_config_loglevel: 'warn' - }) -} - -var expected = { - name: 'npm-test-peer-deps-toplevel', - version: '0.0.0', - problems: [ - 'peer dep missing: mkdirp@*, required by npm-test-peer-deps-toplevel@0.0.0', - 'peer dep missing: request@0.9.x, required by npm-test-peer-deps@0.0.0' - ], - dependencies: { - 'npm-test-peer-deps': { - version: '0.0.0', - resolved: common.registry + '/npm-test-peer-deps/-/npm-test-peer-deps-0.0.0.tgz', - dependencies: { - underscore: { - version: '1.3.1', - resolved: common.registry + '/underscore/-/underscore-1.3.1.tgz' - } - } - }, - mkdirp: { - peerMissing: true, - required: { - _id: 'mkdirp@*', - name: 'mkdirp', - version: '*', - peerMissing: [ - {requiredBy: 'npm-test-peer-deps-toplevel@0.0.0', requires: 'mkdirp@*'} - ], - dependencies: {} - } - }, - request: { - peerMissing: true, - required: { - _id: 'request@0.9.x', - dependencies: {}, - name: 'request', - peerMissing: [ - {requiredBy: 'npm-test-peer-deps@0.0.0', requires: 'request@0.9.x'} - ], - version: '0.9.x' - } - } - } -} - -var server -var fixture = new Tacks(Dir({ - cache: Dir(), - global: Dir(), - tmp: Dir(), - testdir: Dir({ - 'package.json': File({ - name: 'npm-test-peer-deps-toplevel', - version: '0.0.0', - dependencies: { - 'npm-test-peer-deps': '*' - }, - peerDependencies: { - mkdirp: '*' - } - }) - }) -})) - -function setup () { - cleanup() - fixture.create(basedir) -} - -function cleanup () { - fixture.remove(basedir) -} - -test('setup', function (t) { - setup() - mr({port: common.port, throwOnUnmatched: true}, function (err, s) { - if (err) throw err - server = s - t.done() - }) -}) - -test('installs the peer dependency directory structure', function (t) { - common.npm(['install'], conf, function (err, code, stdout, stderr) { - if (err) throw err - t.is(code, 0, 'install ran ok even w/ missing peeer deps') - t.comment(stdout.trim()) - t.comment(stderr.trim()) - - common.npm(['ls', '--json'], conf, function (err, code, stdout, stderr) { - if (err) throw err - t.is(code, 1, 'missing peer deps _are_ an ls error though') - t.comment(stderr.trim()) - var results = JSON.parse(stdout) - - t.deepEqual(results, expected, 'got expected output from ls') - t.done() - }) - }) -}) - -test('cleanup', function (t) { - server.close() - cleanup() - t.done() -}) diff --git a/deps/npm/test/need-npm5-update/peer-deps-without-package-json.js b/deps/npm/test/need-npm5-update/peer-deps-without-package-json.js deleted file mode 100644 index ad863e9f974f31..00000000000000 --- a/deps/npm/test/need-npm5-update/peer-deps-without-package-json.js +++ /dev/null @@ -1,79 +0,0 @@ -var fs = require('fs') -var path = require('path') - -var mkdirp = require('mkdirp') -var mr = require('npm-registry-mock') -var osenv = require('osenv') -var rimraf = require('rimraf') -var test = require('tap').test - -var npm = require('../../') -var common = require('../common-tap.js') - -var pkg = path.resolve(__dirname, 'peer-deps-without-package-json') -var cache = path.resolve(pkg, 'cache') -var nodeModules = path.resolve(pkg, 'node_modules') - -var fileJS = function () { -/**package -* { "name": "npm-test-peer-deps-file" -* , "main": "index.js" -* , "version": "1.2.3" -* , "description":"No package.json in sight!" -* , "peerDependencies": { "underscore": "1.3.1" } -* , "dependencies": { "mkdirp": "0.3.5" } -* } -**/ - - module.exports = 'I\'m just a lonely index, naked as the day I was born.' -}.toString().split('\n').slice(1, -1).join('\n') - -test('setup', function (t) { - t.comment('test for https://github.com/npm/npm/issues/3049') - cleanup() - mkdirp.sync(cache) - mkdirp.sync(nodeModules) - fs.writeFileSync(path.join(pkg, 'file-js.js'), fileJS) - process.chdir(pkg) - - t.end() -}) - -test('installing a peerDeps-using package without package.json', function (t) { - var customMocks = { - 'get': { - '/ok.js': [200, path.join(pkg, 'file-js.js')] - } - } - mr({port: common.port, mocks: customMocks}, function (err, s) { - t.ifError(err, 'mock registry booted') - npm.load({ - registry: common.registry, - cache: cache - }, function () { - npm.install(common.registry + '/ok.js', function (err, additions, result) { - t.ifError(err, 'installed ok.js') - - t.ok( - fs.existsSync(path.join(nodeModules, 'npm-test-peer-deps-file')), - 'passive peer dep installed' - ) - var invalid = result.warnings.filter(function (warning) { return warning.code === 'EPEERINVALID' }) - t.is(invalid.length, 1, 'got a warning for a missing/invalid peer dep') - - t.end() - s.close() // shutdown mock registry. - }) - }) - }) -}) - -test('cleanup', function (t) { - cleanup() - t.end() -}) - -function cleanup () { - process.chdir(osenv.tmpdir()) - rimraf.sync(pkg) -} diff --git a/deps/npm/test/need-npm5-update/rm-linked.js b/deps/npm/test/need-npm5-update/rm-linked.js deleted file mode 100644 index 9123b8760ecb4b..00000000000000 --- a/deps/npm/test/need-npm5-update/rm-linked.js +++ /dev/null @@ -1,148 +0,0 @@ -var mkdirp = require('mkdirp') -var osenv = require('osenv') -var path = require('path') -var rimraf = require('rimraf') -var test = require('tap').test -var writeFileSync = require('fs').writeFileSync - -var common = require('../common-tap.js') - -var link = path.join(__dirname, 'rmlinked') -var linkDep = path.join(link, 'node_modules', 'baz') -var linkInstall = path.join(__dirname, 'rmlinked-install') -var linkRoot = path.join(__dirname, 'rmlinked-root') - -var config = 'prefix = ' + linkRoot -var configPath = path.join(link, '_npmrc') - -var OPTS = { - env: { - 'npm_config_userconfig': configPath - } -} - -var linkedJSON = { - name: 'foo', - version: '1.0.0', - description: '', - main: 'index.js', - scripts: { - test: 'echo "Error: no test specified" && exit 1' - }, - dependencies: { - 'baz': '1.0.0' - }, - author: '', - license: 'ISC' -} - -var linkedDepJSON = { - name: 'baz', - version: '1.0.0', - description: '', - main: 'index.js', - scripts: { - test: 'echo "Error: no test specified" && exit 1' - }, - author: '', - license: 'ISC' -} - -var installJSON = { - name: 'bar', - version: '1.0.0', - description: '', - main: 'index.js', - scripts: { - test: 'echo "Error: no test specified" && exit 1' - }, - dependencies: { - 'foo': '1.0.0' - }, - author: '', - license: 'ISC' -} - -test('setup', function (t) { - setup() - common.npm(['ls', '-g', '--depth=0'], OPTS, function (err, code, stdout, stderr) { - if (err) throw err - t.comment(stdout) - t.comment(stderr) - t.is(code, 0, 'ls -g') - t.notMatch(stdout, /UNMET DEPENDENCY foo@/, "foo isn't in global") - t.end() - }) -}) - -test('creates global link', function (t) { - process.chdir(link) - common.npm(['link'], OPTS, function (err, code, stdout, stderr) { - if (err) throw err - t.is(code, 0, 'link') - t.comment(stdout) - t.comment(stderr) - common.npm(['ls', '-g'], OPTS, function (err, code, stdout, stderr) { - if (err) throw err - t.comment(stdout) - t.comment(stderr) - t.is(code, 0, 'ls -g') - t.equal(stderr, '', 'got expected stderr') - t.match(stdout, /foo@1.0.0/, 'creates global link ok') - t.end() - }) - }) -}) - -test('uninstall the global linked package', function (t) { - process.chdir(osenv.tmpdir()) - common.npm(['uninstall', '-g', 'foo'], OPTS, function (err, code, stdout, stderr) { - if (err) throw err - t.is(code, 0, 'uninstall -g foo') - t.comment(stdout) - t.comment(stderr) - process.chdir(link) - common.npm(['ls'], OPTS, function (err, code, stdout) { - if (err) throw err - t.is(code, 0, 'ls') - t.comment(stdout) - t.comment(stderr) - t.match(stdout, /baz@1.0.0/, "uninstall didn't remove dep") - t.end() - }) - }) -}) - -test('cleanup', function (t) { - cleanup() - t.end() -}) - -function cleanup () { - process.chdir(osenv.tmpdir()) - try { rimraf.sync(linkRoot) } catch (e) { } - try { rimraf.sync(linkDep) } catch (e) { } - try { rimraf.sync(link) } catch (e) { } - try { rimraf.sync(linkInstall) } catch (e) { } -} - -function setup () { - cleanup() - mkdirp.sync(linkRoot) - mkdirp.sync(link) - writeFileSync( - path.join(link, 'package.json'), - JSON.stringify(linkedJSON, null, 2) - ) - mkdirp.sync(linkDep) - writeFileSync( - path.join(linkDep, 'package.json'), - JSON.stringify(linkedDepJSON, null, 2) - ) - mkdirp.sync(linkInstall) - writeFileSync( - path.join(linkInstall, 'package.json'), - JSON.stringify(installJSON, null, 2) - ) - writeFileSync(configPath, config) -} diff --git a/deps/npm/test/need-npm5-update/shrinkwrap-complete-except-dev.js b/deps/npm/test/need-npm5-update/shrinkwrap-complete-except-dev.js deleted file mode 100644 index abafde0afefcbc..00000000000000 --- a/deps/npm/test/need-npm5-update/shrinkwrap-complete-except-dev.js +++ /dev/null @@ -1,158 +0,0 @@ -'use strict' -var fs = require('graceful-fs') -var path = require('path') -var test = require('tap').test -var mr = require('npm-registry-mock') -var Tacks = require('tacks') -var File = Tacks.File -var Dir = Tacks.Dir -var common = require('../common-tap.js') - -var basedir = path.join(__dirname, path.basename(__filename, '.js')) -var testdir = path.join(basedir, 'testdir') -var cachedir = path.join(basedir, 'cache') -var globaldir = path.join(basedir, 'global') -var tmpdir = path.join(basedir, 'tmp') -var appdir = path.join(testdir, 'app') -var installedModuleA = path.join(appdir, 'node_modules', 'module-a') -var installedModuleB = path.join(installedModuleA, 'node_modules', 'module-b') -var installedModuleC = path.join(appdir, 'node_modules', 'module-c') -var installedModuleD = path.join(appdir, 'node_modules', 'module-d') - -var conf = { - cwd: appdir, - env: Object.assign({}, process.env, { - npm_config_cache: cachedir, - npm_config_tmp: tmpdir, - npm_config_prefix: globaldir, - npm_config_registry: common.registry, - npm_config_loglevel: 'warn' - }) -} - -var server -var fixture = new Tacks(Dir({ - cache: Dir(), - global: Dir(), - tmp: Dir(), - testdir: Dir({ - app: Dir({ - 'npm-shrinkwrap.json': File({ - name: 'app', - version: '1.0.0', - dependencies: { - 'module-a': { - version: '1.0.0', - from: '../module-a', - resolved: 'file:../module-a', - dependencies: { - 'module-b': { - version: '1.0.0', - from: '../module-b', - resolved: 'file:../module-b' - } - } - } - } - }), - 'package.json': File({ - name: 'app', - version: '1.0.0', - dependencies: { - 'module-a': '../module-a' - }, - devDependencies: { - 'module-d': '../module-d' - } - }) - }), - 'module-a': Dir({ - 'package.json': File({ - name: 'module-a', - version: '1.0.0', - dependencies: { - 'module-b': 'file:' + path.join(testdir, 'module-b'), - 'module-c': 'file:' + path.join(testdir, 'module-c') - } - }) - }), - 'module-b': Dir({ - 'package.json': File({ - name: 'module-b', - version: '1.0.0' - }) - }), - 'module-c': Dir({ - 'package.json': File({ - name: 'module-c', - version: '1.0.0' - }) - }), - 'module-d': Dir({ - 'package.json': File({ - name: 'module-d', - version: '1.0.0' - }) - }) - }) -})) - -function exists (t, filepath, msg) { - try { - fs.statSync(filepath) - t.pass(msg) - return true - } catch (ex) { - t.fail(msg, {found: ex, wanted: 'exists', compare: 'fs.stat(' + filepath + ')'}) - return false - } -} - -function notExists (t, filepath, msg) { - try { - fs.statSync(filepath) - t.fail(msg, {found: true, wanted: 'does not exist', compare: 'fs.stat(' + filepath + ')'}) - return true - } catch (ex) { - t.pass(msg) - return false - } -} - -function setup () { - cleanup() - fixture.create(basedir) -} - -function cleanup () { - fixture.remove(basedir) -} - -test('setup', function (t) { - setup() - mr({port: common.port, throwOnUnmatched: true}, function (err, s) { - if (err) throw err - server = s - t.done() - }) -}) - -test('example', function (t) { - common.npm(['install'], conf, function (err, code, stdout, stderr) { - if (err) throw err - t.is(code, 0, 'command ran ok') - t.comment('1> ' + stdout.trim()) - t.comment('2> ' + stderr.trim()) - exists(t, installedModuleA, 'module-a: dep in shrinkwrap installed') - exists(t, installedModuleB, 'module-b: nested dep from shrinkwrap nested') - notExists(t, installedModuleC, 'module-c: dependency not installed because not in shrinkwrap') - exists(t, installedModuleD, 'module-d: dev dependency installed despite not being in shrinkwrap') - t.done() - }) -}) - -test('cleanup', function (t) { - server.close() - cleanup() - t.done() -}) diff --git a/deps/npm/test/need-npm5-update/shrinkwrap-dev-dep-cycle.js b/deps/npm/test/need-npm5-update/shrinkwrap-dev-dep-cycle.js deleted file mode 100644 index 8e4155d8ac274b..00000000000000 --- a/deps/npm/test/need-npm5-update/shrinkwrap-dev-dep-cycle.js +++ /dev/null @@ -1,102 +0,0 @@ -'use strict' -var fs = require('fs') -var path = require('path') -var test = require('tap').test -var Tacks = require('tacks') -var File = Tacks.File -var Dir = Tacks.Dir -var common = require('../common-tap.js') -var testdir = path.join(__dirname, path.basename(__filename, '.js')) - -var fixture = new Tacks( - Dir({ - node_modules: Dir({ - 'a': Dir({ - 'package.json': File({ - _requested: { - rawSpec: 'file:///mods/a' - }, - dependencies: { - 'b': 'file:///mods/b' - }, - name: 'a', - version: '1.0.0' - }) - }), - 'b': Dir({ - 'package.json': File({ - _requested: { - rawSpec: 'file:///mods/b' - }, - dependencies: { - 'a': 'file:///mods/a' - }, - name: 'b', - version: '1.0.0' - }) - }) - }), - 'package.json': File({ - name: 'test', - version: '1.0.0', - devDependencies: { - 'a': 'file:///mods/a' - } - }) - }) -) - -var expectedShrinkwrap = { - name: 'test', - version: '1.0.0', - dependencies: { - a: { - version: '1.0.0', - dev: true - }, - b: { - version: '1.0.0', - dev: true - } - } -} - -function setup () { - cleanup() - fixture.create(testdir) -} - -function cleanup () { - fixture.remove(testdir) -} - -function readJson (file) { - try { - var contents = fs.readFileSync(file) - return JSON.parse(contents) - } catch (ex) { - return ex - } -} - -test('setup', function (t) { - setup() - t.end() -}) - -test('shrinkwrap cycle in dev deps', function (t) { - common.npm(['shrinkwrap', '--only=prod'], {cwd: testdir}, function (err, code, stdout, stderr) { - if (err) throw err - t.is(code, 0, 'result code = ok') - t.comment(stdout.trim()) - t.comment(stderr.trim()) - var actualShrinkwrap = readJson(path.join(testdir, 'npm-shrinkwrap.json')) - t.isDeeply(actualShrinkwrap, expectedShrinkwrap, 'shrinkwrap is right') - t.end() - }) -}) - -test('cleanup', function (t) { - cleanup() - t.end() -}) diff --git a/deps/npm/test/network/git-cache-locking.js b/deps/npm/test/network/git-cache-locking.js deleted file mode 100644 index 9c3e903bea52c7..00000000000000 --- a/deps/npm/test/network/git-cache-locking.js +++ /dev/null @@ -1,44 +0,0 @@ -var test = require('tap').test -var common = require('../common-tap') -var path = require('path') -var rimraf = require('rimraf') -var mkdirp = require('mkdirp') -var pkg = path.resolve(__dirname, 'git-cache-locking') -var tmp = path.join(pkg, 'tmp') -var cache = path.join(pkg, 'cache') - -test('setup', function (t) { - rimraf.sync(pkg) - mkdirp.sync(path.resolve(pkg, 'node_modules')) - t.end() -}) - -test('git-cache-locking: install a git dependency', function (t) { - // disable git integration tests on Travis. - if (process.env.TRAVIS) return t.end() - - var gitEnv = Object.assign({}, process.env) - gitEnv.npm_config_cache = cache - gitEnv.npm_config_tmp = tmp - gitEnv.npm_config_prefix = pkg - gitEnv.npm_config_global = 'false' - - // package c depends on a.git#master and b.git#master - // package b depends on a.git#master - common.npm([ - 'install', - 'git://github.com/nigelzor/npm-4503-c.git' - ], { - cwd: pkg, - env: gitEnv - }, function (err, code, stdout, stderr) { - if (err) throw err - t.equal(0, code, 'npm install should succeed') - t.end() - }) -}) - -test('cleanup', function (t) { - rimraf.sync(pkg) - t.end() -}) diff --git a/deps/npm/test/network/git-cache-no-hooks.js b/deps/npm/test/network/git-cache-no-hooks.js deleted file mode 100644 index 0021064ceaac76..00000000000000 --- a/deps/npm/test/network/git-cache-no-hooks.js +++ /dev/null @@ -1,50 +0,0 @@ -var test = require('tap').test -var fs = require('fs') -var path = require('path') -var common = require('../common-tap.js') -var rimraf = require('rimraf') -var mkdirp = require('mkdirp') -var pkg = path.resolve(__dirname, 'git-cache-no-hooks') -var osenv = require('osenv') -var tmp = path.join(pkg, 'tmp') -var cache = path.join(pkg, 'cache') - -test('setup', function (t) { - rimraf.sync(pkg) - mkdirp.sync(pkg) - mkdirp.sync(cache) - mkdirp.sync(tmp) - mkdirp.sync(path.resolve(pkg, 'node_modules')) - t.end() -}) - -test('git-cache-no-hooks: install a git dependency', function (t) { - // disable git integration tests on Travis. - if (process.env.TRAVIS) return t.end() - - common.npm([ - 'install', 'git://github.com/nigelzor/npm-4503-a.git', - '--cache', cache, - '--tmp', tmp - ], { - cwd: pkg - }, function (err, code, stdout, stderr) { - t.ifErr(err, 'npm completed') - t.equal(stderr, '', 'no error output') - t.equal(code, 0, 'npm install should succeed') - - // verify permissions on git hooks - var repoDir = 'git-github-com-nigelzor-npm-4503-a-git-40c5cb24' - var hooksPath = path.join(cache, '_git-remotes', repoDir, 'hooks') - fs.readdir(hooksPath, function (err) { - t.equal(err && err.code, 'ENOENT', 'hooks are not brought along with repo') - t.end() - }) - }) -}) - -test('cleanup', function (t) { - process.chdir(osenv.tmpdir()) - rimraf.sync(pkg) - t.end() -}) diff --git a/deps/npm/test/network/legacy-bundled-git.js b/deps/npm/test/network/legacy-bundled-git.js deleted file mode 100644 index 15fbac84eaeb8e..00000000000000 --- a/deps/npm/test/network/legacy-bundled-git.js +++ /dev/null @@ -1,99 +0,0 @@ -'use strict' -var test = require('tap').test -var common = require('../common-tap.js') -var path = require('path') -var rimraf = require('rimraf') -var mkdirp = require('mkdirp') -var basepath = path.resolve(__dirname, path.basename(__filename, '.js')) -var fixturepath = path.resolve(basepath, 'npm-test-bundled-git') -var modulepath = path.resolve(basepath, 'node_modules') -var installedpath = path.resolve(modulepath, 'npm-test-bundled-git') -var Tacks = require('tacks') -var File = Tacks.File -var Dir = Tacks.Dir - -var minimatchExpected = { - name: 'minimatch', - description: 'a glob matcher in javascript', - version: '0.2.1', - repository: { - type: 'git', - url: 'git://github.com/isaacs/minimatch.git' - }, - main: 'minimatch.js', - scripts: { - test: 'tap test' - }, - engines: { - node: '*' - }, - dependencies: { - 'lru-cache': '~1.0.5' - }, - devDependencies: { - tap: '~0.1.3' - }, - licenses: [ - { - type: 'MIT', - url: 'http://github.com/isaacs/minimatch/raw/master/LICENSE' - } - ] -} - -var fixture = new Tacks( - Dir({ - README: File( - 'just an npm test\n' - ), - 'package.json': File({ - name: 'npm-test-bundled-git', - scripts: { - test: 'node test.js' - }, - version: '1.2.5', - dependencies: { - glob: 'git://github.com/isaacs/node-glob.git#npm-test' - }, - bundledDependencies: [ - 'glob' - ] - }) - }) -) -test('setup', function (t) { - setup() - t.done() -}) -test('bundled-git', function (t) { - common.npm(['install', '--global-style', fixturepath], {cwd: basepath}, installCheckAndTest) - function installCheckAndTest (err, code, stdout, stderr) { - if (err) throw err - t.is(code, 0, 'install went ok') - - var actual = require(path.resolve(installedpath, 'node_modules/glob/node_modules/minimatch/package.json')) - Object.keys(minimatchExpected).forEach(function (key) { - t.isDeeply(actual[key], minimatchExpected[key], key + ' set to the right value') - }) - - common.npm(['rm', fixturepath], {cwd: basepath}, removeCheckAndDone) - } - function removeCheckAndDone (err, code, stdout, stderr) { - if (err) throw err - t.is(code, 0, 'remove went ok') - t.done() - } -}) -test('cleanup', function (t) { - cleanup() - t.done() -}) -function setup () { - cleanup() - fixture.create(fixturepath) - mkdirp.sync(modulepath) -} -function cleanup () { - fixture.remove(fixturepath) - rimraf.sync(basepath) -} diff --git a/deps/npm/test/network/legacy-url-dep.js b/deps/npm/test/network/legacy-url-dep.js deleted file mode 100644 index 46378cd3ef8e54..00000000000000 --- a/deps/npm/test/network/legacy-url-dep.js +++ /dev/null @@ -1,59 +0,0 @@ -'use strict' -var test = require('tap').test -var common = require('../common-tap.js') -var path = require('path') -var rimraf = require('rimraf') -var mkdirp = require('mkdirp') -var basepath = path.resolve(__dirname, path.basename(__filename, '.js')) -var fixturepath = path.resolve(basepath, 'npm-test-url-dep') -var modulepath = path.resolve(basepath, 'node_modules') -var Tacks = require('tacks') -var File = Tacks.File -var Dir = Tacks.Dir - -var fixture = new Tacks( - Dir({ - README: File( - 'just an npm test\n' - ), - 'package.json': File({ - name: 'npm-test-url-dep', - version: '1.2.3', - dependencies: { - jsonify: 'https://github.com/substack/jsonify/tarball/master', - sax: 'isaacs/sax-js', - 'canonical-host': 'git://github.com/isaacs/canonical-host' - } - }) - }) -) - -test('setup', function (t) { - setup() - t.done() -}) - -test('url-dep', function (t) { - common.npm(['install', fixturepath], {cwd: basepath}, installCheckAndTest) - function installCheckAndTest (err, code, stdout, stderr) { - if (err) throw err - t.is(code, 0, 'install went ok') - t.done() - } -}) - -test('cleanup', function (t) { - cleanup() - t.done() -}) - -function setup () { - cleanup() - fixture.create(fixturepath) - mkdirp.sync(modulepath) -} - -function cleanup () { - fixture.remove(fixturepath) - rimraf.sync(basepath) -} diff --git a/deps/npm/test/network/registry.js b/deps/npm/test/network/registry.js deleted file mode 100644 index d7e11c6007111f..00000000000000 --- a/deps/npm/test/network/registry.js +++ /dev/null @@ -1,68 +0,0 @@ -// Run all the tests in the `npm-registry-couchapp` suite -// This verifies that the server-side stuff still works. - -var common = require('../common-tap') -var t = require('tap') - -var npmExec = require.resolve('../../bin/npm-cli.js') -var path = require('path') -var ca = path.resolve(__dirname, '../../node_modules/npm-registry-couchapp') - -var which = require('which') - -var v = process.versions.node.split('.').map(function (n) { return parseInt(n, 10) }) -if (v[0] === 0 && v[1] < 10) { - console.error( - 'WARNING: need a recent Node for npm-registry-couchapp tests to run, have', - process.versions.node - ) -} else { - try { - which.sync('couchdb') - t.test(runTests) - } catch (er) { - console.error('WARNING: need couch to run test: ' + er.message) - } -} - -function runTests (t) { - var env = Object.assign({ TAP: 1 }, process.env) - env.npm = npmExec - // TODO: fix tap and / or nyc to handle nested invocations properly - env.COVERALLS_REPO_TOKEN = '' - - var opts = { - cwd: ca, - stdio: 'inherit' - } - common.npm(['install'], opts, function (err, code) { - if (err) { throw err } - if (code) { - t.fail('install failed with: ' + code) - return t.end() - } else { - opts = { - cwd: ca, - env: env, - stdio: 'inherit' - } - common.npm(['test', '--', '-Rtap', '--no-coverage'], opts, function (err, code) { - if (err) { throw err } - if (code) { - t.fail('test failed with: ' + code) - return t.end() - } - opts = { - cwd: ca, - env: env, - stdio: 'inherit' - } - common.npm(['prune', '--production'], opts, function (err, code) { - t.ifError(err) - t.equal(code, 0) - return t.end() - }) - }) - } - }) -} diff --git a/deps/npm/test/tap/00-check-mock-dep.js b/deps/npm/test/tap/00-check-mock-dep.js deleted file mode 100644 index cdc7af852b344c..00000000000000 --- a/deps/npm/test/tap/00-check-mock-dep.js +++ /dev/null @@ -1,17 +0,0 @@ -console.log('TAP Version 13') - -process.on('uncaughtException', function (er) { - if (er) { throw er } - console.log('not ok - Failed checking mock registry dep. Expect much fail!') - console.log('1..1') - process.exit(1) -}) - -var assert = require('assert') -var semver = require('semver') -var mock = require('npm-registry-mock/package.json').version -var req = require('../../package.json').devDependencies['npm-registry-mock'] - -assert(semver.satisfies(mock, req)) -console.log('ok') -console.log('1..1') diff --git a/deps/npm/test/tap/00-config-setup.js b/deps/npm/test/tap/00-config-setup.js deleted file mode 100644 index 448453eded4fd9..00000000000000 --- a/deps/npm/test/tap/00-config-setup.js +++ /dev/null @@ -1,85 +0,0 @@ -var fs = require('graceful-fs') -var path = require('path') -var userconfigSrc = path.resolve(__dirname, '..', 'fixtures', 'config', 'userconfig') -exports.userconfig = userconfigSrc + '-with-gc' -exports.globalconfig = path.resolve(__dirname, '..', 'fixtures', 'config', 'globalconfig') -exports.builtin = path.resolve(__dirname, '..', 'fixtures', 'config', 'builtin') -exports.malformed = path.resolve(__dirname, '..', 'fixtures', 'config', 'malformed') -exports.ucData = - { globalconfig: exports.globalconfig, - email: 'i@izs.me', - 'env-thing': 'asdf', - 'init.author.name': 'Isaac Z. Schlueter', - 'init.author.email': 'i@izs.me', - 'init.author.url': 'http://blog.izs.me/', - 'init.version': '1.2.3', - 'npm:publishtest': true, - '_npmjs.org:couch': 'https://admin:password@localhost:5984/registry', - 'npm-www:nocache': '1', - nodedir: '/Users/isaacs/dev/js/node-v0.8', - 'sign-git-tag': true, - message: 'v%s', - 'strict-ssl': false, - 'tmp': path.normalize(process.env.HOME + '/.tmp'), - _auth: 'dXNlcm5hbWU6cGFzc3dvcmQ=', - _token: - { AuthSession: 'yabba-dabba-doodle', - version: '1', - expires: '1345001053415', - path: '/', - httponly: true } } - -// set the userconfig in the env -// unset anything else that npm might be trying to foist on us -Object.keys(process.env).forEach(function (k) { - if (k.match(/^npm_config_/i)) { - delete process.env[k] - } -}) -process.env.npm_config_userconfig = exports.userconfig -process.env.npm_config_other_env_thing = '1000' -process.env.random_env_var = 'asdf' -process.env.npm_config__underbar_env_thing = 'underful' -process.env.NPM_CONFIG_UPPERCASE_ENV_THING = '42' - -exports.envData = { - userconfig: exports.userconfig, - '_underbar-env-thing': 'underful', - 'uppercase-env-thing': '42', - 'other-env-thing': '1000' -} -exports.envDataFix = { - userconfig: exports.userconfig, - '_underbar-env-thing': 'underful', - 'uppercase-env-thing': 42, - 'other-env-thing': 1000 -} - -var projectConf = path.resolve(__dirname, '..', '..', '.npmrc') -try { - fs.statSync(projectConf) -} catch (er) { - // project conf not found, probably working with packed npm - fs.writeFileSync(projectConf, function () { /* -save-prefix = ~ -legacy-bundling = true - */ }.toString().split('\n').slice(1, -1).join('\n')) -} - -var projectRc = path.join(__dirname, '..', 'fixtures', 'config', '.npmrc') -try { - fs.statSync(projectRc) -} catch (er) { - // project conf not found, probably working with packed npm - fs.writeFileSync(projectRc, 'just = testing') -} - -if (module === require.main) { - // set the globalconfig in the userconfig - var uc = fs.readFileSync(userconfigSrc) - var gcini = 'globalconfig = ' + exports.globalconfig + '\n' - fs.writeFileSync(exports.userconfig, gcini + uc) - - console.log('1..1') - console.log('ok 1 setup done') -} diff --git a/deps/npm/test/tap/00-verify-bundle-deps.js b/deps/npm/test/tap/00-verify-bundle-deps.js deleted file mode 100644 index 75ea81c593e76f..00000000000000 --- a/deps/npm/test/tap/00-verify-bundle-deps.js +++ /dev/null @@ -1,16 +0,0 @@ -var test = require('tap').test - -var manifest = require('../../package.json') -var deps = Object.keys(manifest.dependencies) -var bundled = manifest.bundleDependencies - -test('all deps are bundled deps or dev deps', function (t) { - deps.forEach(function (name) { - t.assert( - bundled.indexOf(name) !== -1, - name + ' is in bundledDependencies' - ) - }) - - t.end() -}) diff --git a/deps/npm/test/tap/00-verify-ls-ok.js b/deps/npm/test/tap/00-verify-ls-ok.js deleted file mode 100644 index edff251d76a136..00000000000000 --- a/deps/npm/test/tap/00-verify-ls-ok.js +++ /dev/null @@ -1,27 +0,0 @@ -var common = require('../common-tap') -var test = require('tap').test -var path = require('path') -var cwd = path.resolve(__dirname, '..', '..') -var fs = require('fs') - -test('npm ls in npm', function (t) { - t.ok(fs.existsSync(cwd), 'ensure that the path we are calling ls within exists') - var files = fs.readdirSync(cwd) - t.notEqual(files.length, 0, 'ensure there are files in the directory we are to ls') - - var opt = { cwd: cwd, stdio: [ 'ignore', 'pipe', 2 ] } - common.npm(['ls', '--json'], opt, function (err, code, stdout) { - t.ifError(err, 'error should not exist') - t.equal(code, 0, 'npm ls exited with code') - const tree = JSON.parse(stdout).dependencies - // We need to have a toplevel `node-gyp` available, but we also need to - // make sure npm-lifecycle's version is updated in concert. - // See https://github.com/npm/npm/issues/20163 - t.deepEqual( - tree['npm-lifecycle'].dependencies['node-gyp'].version, - tree['node-gyp'].version, - 'npm-lifecycle and npm using same version of node-gyp' - ) - t.end() - }) -}) diff --git a/deps/npm/test/tap/00-verify-no-scoped.js b/deps/npm/test/tap/00-verify-no-scoped.js deleted file mode 100644 index 4f14dea041740d..00000000000000 --- a/deps/npm/test/tap/00-verify-no-scoped.js +++ /dev/null @@ -1,30 +0,0 @@ -'use strict' -var common = require('../common-tap') -var test = require('tap').test -var path = require('path') -var cwd = path.resolve(__dirname, '..', '..') -var fs = require('fs') - -/* -We can't include any scoped modules in bundled dependencies due to a bug in -npm@<4.4.3 that made any module that bundled scoped dependencies -uninstallable. While this is fixed, we can't have them in ourselves without -making it impossible to upgrade, thus this test. -*/ - -test('no scoped transitive deps', function (t) { - t.ok(fs.existsSync(cwd), 'ensure that the path we are calling ls within exists') - - var opt = { cwd: cwd, stdio: [ 'ignore', 'pipe', 2 ] } - common.npm(['ls', '--parseable', '--production'], opt, function (err, code, stdout) { - t.ifError(err, 'error should not exist') - t.equal(code, 0, 'npm ls exited with code') - var matchScoped = new RegExp(path.join(cwd, 'node_modules', '.*@').replace(/\\/g, '\\\\')) - stdout.split(/\n/).forEach(function (line) { - if (matchScoped.test(line)) { - t.notLike(line, matchScoped, 'prod deps do not contain scoped modules') - } - }) - t.end() - }) -}) diff --git a/deps/npm/test/tap/404-parent.js b/deps/npm/test/tap/404-parent.js deleted file mode 100644 index ee9623c545505f..00000000000000 --- a/deps/npm/test/tap/404-parent.js +++ /dev/null @@ -1,54 +0,0 @@ -var common = require('../common-tap.js') -var test = require('tap').test -var npm = require('../../') -var path = require('path') -var fs = require('fs') -var rimraf = require('rimraf') -const pkg = common.pkg -var mr = require('npm-registry-mock') - -test('404-parent: if parent exists, specify parent in error message', function (t) { - setup() - rimraf(path.resolve(pkg, 'node_modules'), () => { - performInstall(function (err) { - t.ok(err instanceof Error, 'error was returned') - t.equal(err.parent, '404-parent', "error's parent set") - t.end() - }) - }) -}) - -function setup () { - fs.writeFileSync(path.resolve(pkg, 'package.json'), JSON.stringify({ - author: 'Evan Lucas', - name: '404-parent-test', - version: '0.0.0', - description: 'Test for 404-parent', - dependencies: { - 'test-npm-404-parent-test': '*' - } - }), 'utf8') - process.chdir(pkg) -} - -function performInstall (cb) { - mr({port: common.port}, function (er, s) { // create mock registry. - if (er) { - return cb(er) - } - s.get('/test-npm-404-parent-test') - .many().reply(404, {'error': 'version not found'}) - npm.load({ - registry: common.registry - }, function () { - npm.config.set('fetch-retries', 0) - var pwd = process.cwd() - process.chdir(pkg) - npm.commands.install([], function (err) { - process.chdir(pwd) - cb(err) - s.close() // shutdown mock npm server. - }) - }) - }) -} diff --git a/deps/npm/test/tap/404-private-registry-scoped.js b/deps/npm/test/tap/404-private-registry-scoped.js deleted file mode 100644 index 0aa262f54628ca..00000000000000 --- a/deps/npm/test/tap/404-private-registry-scoped.js +++ /dev/null @@ -1,36 +0,0 @@ -var test = require('tap').test -var common = require('../common-tap.js') -var mr = common.fakeRegistry.compat -var server - -test('setup', function (t) { - mr({port: common.port, throwOnUnmatched: true}, function (err, s) { - t.ifError(err, 'registry mocked successfully') - server = s - t.end() - }) -}) - -test('scoped package names not mangled on error with non-root registry', function (t) { - server.get('/@scope%2ffoo').reply(404, {}) - common.npm( - [ - '--registry=' + common.registry, - '--cache=' + common.cache, - 'cache', - 'add', - '@scope/foo@*', - '--force' - ], - {}, - function (er, code, stdout, stderr) { - t.ifError(er, 'correctly handled 404') - t.equal(code, 1, 'exited with error') - t.match(stderr, /E404/, 'should notify the sort of error as a 404') - t.match(stderr, /@scope(?:%2f|\/)foo/, 'should have package name in error') - server.done() - server.close() - t.end() - } - ) -}) diff --git a/deps/npm/test/tap/404-private-registry.js b/deps/npm/test/tap/404-private-registry.js deleted file mode 100644 index 0ca05105dc9f30..00000000000000 --- a/deps/npm/test/tap/404-private-registry.js +++ /dev/null @@ -1,37 +0,0 @@ -var test = require('tap').test -var path = require('path') -var common = require('../common-tap.js') -var mr = common.fakeRegistry.compat -var server - -var packageName = path.basename(__filename, '.js') - -test('setup', function (t) { - mr({port: common.port, throwOnUnmatched: true}, function (err, s) { - t.ifError(err, 'registry mocked successfully') - server = s - t.end() - }) -}) - -test('package names not mangled on error with non-root registry', function (t) { - server.get('/' + packageName).reply(404, {}) - common.npm( - [ - '--registry=' + common.registry, - '--cache=' + common.cache, - 'cache', - 'add', - packageName + '@*' - ], - {}, - function (er, code, stdout, stderr) { - t.ifError(er, 'correctly handled 404') - t.equal(code, 1, 'exited with error') - t.match(stderr, packageName, 'should have package name in error') - server.done() - server.close() - t.end() - } - ) -}) diff --git a/deps/npm/test/tap/404.js b/deps/npm/test/tap/404.js deleted file mode 100644 index af146371c7933c..00000000000000 --- a/deps/npm/test/tap/404.js +++ /dev/null @@ -1,72 +0,0 @@ -'use strict' -const path = require('path') -const test = require('tap').test -const Tacks = require('tacks') -const File = Tacks.File -const Dir = Tacks.Dir -const common = require('../common-tap.js') - -const e404 = /test-npm-404@latest' is not in the npm registry/ -const invalidPackage = /Your package name is not valid, because[\s\S]+1\. name can only contain URL-friendly characters/ - -const basedir = common.pkg -const testdir = path.join(basedir, 'testdir') -const cachedir = common.cache -const globaldir = path.join(basedir, 'global') -const tmpdir = path.join(basedir, 'tmp') - -const env = common.newEnv().extend({ - npm_config_cache: cachedir, - npm_config_tmp: tmpdir, - npm_config_prefix: globaldir, - npm_config_registry: common.registry, - npm_config_loglevel: 'error' -}) - -const fixture = new Tacks(Dir({ - cache: Dir(), - global: Dir(), - tmp: Dir(), - testdir: Dir({ - 'package.json': File({ - name: 'test', - version: '1.0.0' - }) - }) -})) - -function setup () { - cleanup() - fixture.create(basedir) -} - -function cleanup () { - fixture.remove(basedir) -} - -test('setup', function (t) { - setup() - return common.fakeRegistry.listen() -}) - -test('404 message for basic package', function (t) { - return common.npm(['install', 'test-npm-404'], {cwd: testdir, env}).then(([code, stdout, stderr]) => { - t.is(code, 1, 'error code') - t.match(stderr, e404, 'error output') - t.notMatch(stderr, invalidPackage, 'no invalidity error') - }) -}) - -test('404 message for scoped package', function (t) { - return common.npm(['install', '@npm/test-npm-404'], {cwd: testdir, env}).then(([code, stdout, stderr]) => { - t.is(code, 1, 'error code') - t.match(stderr, e404, 'error output') - t.notMatch(stderr, invalidPackage, 'no invalidity error') - }) -}) - -test('cleanup', function (t) { - common.fakeRegistry.close() - cleanup() - t.done() -}) diff --git a/deps/npm/test/tap/access.js b/deps/npm/test/tap/access.js deleted file mode 100644 index f537db2586409a..00000000000000 --- a/deps/npm/test/tap/access.js +++ /dev/null @@ -1,587 +0,0 @@ -'use strict' - -const fs = require('fs') -const path = require('path') -const mkdirp = require('mkdirp') -const rimraf = require('rimraf') -const mr = require('npm-registry-mock') - -const test = require('tap').test -const common = require('../common-tap.js') - -const pkg = common.pkg - -let server - -const scoped = { - name: '@scoped/pkg', - version: '1.1.1' -} - -test('setup', function (t) { - mr({port: common.port}, function (err, s) { - t.ifError(err, 'registry mocked successfully') - server = s - - fs.writeFile( - path.join(pkg, 'package.json'), - JSON.stringify(scoped), - function (er) { - t.ifError(er, 'wrote package.json') - t.end() - } - ) - }) -}) - -test('npm access public on current package', function (t) { - server.post('/-/package/%40scoped%2Fpkg/access', JSON.stringify({ - access: 'public' - })).reply(200, { - accessChanged: true - }) - common.npm( - [ - 'access', - 'public', - '--registry', common.registry, - '--loglevel', 'silent' - ], { - cwd: pkg - }, - function (er, code, stdout, stderr) { - t.ifError(er, 'npm access') - t.equal(code, 0, 'exited OK') - t.equal(stderr, '', 'no error output') - t.end() - } - ) -}) - -test('npm access public when no package passed and no package.json', function (t) { - // need to simulate a missing package.json - var missing = path.join(pkg, 'access-public-missing-guard') - mkdirp.sync(path.join(missing, 'node_modules')) - - common.npm([ - 'access', - 'public', - '--registry', common.registry - ], { - cwd: missing - }, - function (er, code, stdout, stderr) { - t.ifError(er, 'npm access') - t.match(stderr, /no package name passed to command and no package.json found/) - rimraf(missing, t.end) - }) -}) - -test('npm access public when no package passed and invalid package.json', function (t) { - // need to simulate a missing package.json - var invalid = path.join(pkg, 'access-public-invalid-package') - mkdirp.sync(path.join(invalid, 'node_modules')) - // it's hard to force `read-package-json` to break w/o ENOENT, but this will do it - fs.writeFileSync(path.join(invalid, 'package.json'), '{\n') - - common.npm([ - 'access', - 'public', - '--registry', common.registry - ], { - cwd: invalid - }, - function (er, code, stdout, stderr) { - t.ifError(er, 'npm access') - t.match(stderr, /Failed to parse json/) - rimraf(invalid, t.end) - }) -}) - -test('npm access restricted on current package', function (t) { - server.post('/-/package/%40scoped%2Fpkg/access', JSON.stringify({ - access: 'restricted' - })).reply(200, { - accessChanged: true - }) - common.npm( - [ - 'access', - 'restricted', - '--registry', common.registry, - '--loglevel', 'silent' - ], { - cwd: pkg - }, - function (er, code, stdout, stderr) { - t.ifError(er, 'npm access') - t.equal(code, 0, 'exited OK') - t.equal(stderr, '', 'no error output') - t.end() - } - ) -}) - -test('npm access on named package', function (t) { - server.post('/-/package/%40scoped%2Fanother/access', { - access: 'public' - }).reply(200, { - accessChaged: true - }) - common.npm( - [ - 'access', - 'public', '@scoped/another', - '--registry', common.registry, - '--loglevel', 'silent' - ], - { cwd: pkg }, - function (er, code, stdout, stderr) { - t.ifError(er, 'npm access') - t.equal(code, 0, 'exited OK') - t.equal(stderr, '', 'no error output') - - t.end() - } - ) -}) - -test('npm change access on unscoped package', function (t) { - common.npm( - [ - 'access', - 'restricted', 'yargs', - '--registry', common.registry - ], - { cwd: pkg }, - function (er, code, stdout, stderr) { - t.ok(code, 'exited with Error') - t.matches( - stderr, /only available for scoped packages/) - t.end() - } - ) -}) - -test('npm access grant read-only', function (t) { - server.filteringRequestBody((body) => { - const data = JSON.parse(body) - t.deepEqual(data, { - permissions: 'read-only', - package: '@scoped/another' - }, 'got the right body') - return true - }) - server.put('/-/team/myorg/myteam/package', true).reply(201) - common.npm( - [ - 'access', - 'grant', 'read-only', - 'myorg:myteam', - '@scoped/another', - '--registry', common.registry - ], - { cwd: pkg }, - function (er, code, stdout, stderr) { - t.ifError(er, 'npm access grant') - t.equal(code, 0, 'exited with Error') - t.end() - } - ) -}) - -test('npm access grant read-write', function (t) { - server.filteringRequestBody((body) => { - const data = JSON.parse(body) - t.deepEqual(data, { - permissions: 'read-write', - package: '@scoped/another' - }, 'got the right body') - return true - }) - server.put('/-/team/myorg/myteam/package', true).reply(201) - common.npm( - [ - 'access', - 'grant', 'read-write', - 'myorg:myteam', - '@scoped/another', - '--registry', common.registry - ], - { cwd: pkg }, - function (er, code, stdout, stderr) { - t.ifError(er, 'npm access grant') - t.equal(code, 0, 'exited with Error') - t.end() - } - ) -}) - -test('npm access grant read-write on unscoped package', function (t) { - server.filteringRequestBody((body) => { - const data = JSON.parse(body) - t.deepEqual(data, { - permissions: 'read-write', - package: 'another' - }, 'got the right body') - return true - }) - server.put('/-/team/myorg/myteam/package', true).reply(201) - common.npm( - [ - 'access', - 'grant', 'read-write', - 'myorg:myteam', - 'another', - '--registry', common.registry - ], - { cwd: pkg }, - function (er, code, stdout, stderr) { - t.ifError(er, 'npm access grant') - t.equal(code, 0, 'exited with Error') - t.end() - } - ) -}) - -test('npm access grant others', function (t) { - common.npm( - [ - 'access', - 'grant', 'rerere', - 'myorg:myteam', - '@scoped/another', - '--registry', common.registry - ], - { cwd: pkg }, - function (er, code, stdout, stderr) { - t.ok(code, 'exited with Error') - t.matches(stderr, /read-only/) - t.matches(stderr, /read-write/) - t.end() - } - ) -}) - -test('npm access revoke', function (t) { - server.delete('/-/team/myorg/myteam/package', { - package: '@scoped/another' - }).reply(200, { - accessChaged: true - }) - common.npm( - [ - 'access', - 'revoke', - 'myorg:myteam', - '@scoped/another', - '--registry', common.registry - ], - { cwd: pkg }, - function (er, code, stdout, stderr) { - t.ifError(er, 'npm access grant') - t.equal(code, 0, 'exited with Error') - t.end() - } - ) -}) - -test('npm access ls-packages with no team', function (t) { - var serverPackages = { - '@foo/bar': 'write', - '@foo/util': 'read' - } - var clientPackages = { - '@foo/bar': 'read-write', - '@foo/util': 'read-only' - } - server.get( - '/-/org/username/package?format=cli' - ).reply(200, serverPackages) - common.npm( - [ - 'access', - 'ls-packages', - '--registry', common.registry - ], - { cwd: pkg }, - function (er, code, stdout, stderr) { - t.ifError(er, 'npm access ls-packages') - t.same(JSON.parse(stdout), clientPackages) - t.end() - } - ) -}) - -test('npm access ls-packages on team', function (t) { - var serverPackages = { - '@foo/bar': 'write', - '@foo/util': 'read' - } - var clientPackages = { - '@foo/bar': 'read-write', - '@foo/util': 'read-only' - } - server.get( - '/-/team/myorg/myteam/package?format=cli' - ).reply(200, serverPackages) - common.npm( - [ - 'access', - 'ls-packages', - 'myorg:myteam', - '--registry', common.registry - ], - { cwd: pkg }, - function (er, code, stdout, stderr) { - t.ifError(er, 'npm access ls-packages') - t.same(JSON.parse(stdout), clientPackages) - t.end() - } - ) -}) - -test('npm access ls-packages on org', function (t) { - var serverPackages = { - '@foo/bar': 'write', - '@foo/util': 'read' - } - var clientPackages = { - '@foo/bar': 'read-write', - '@foo/util': 'read-only' - } - server.get( - '/-/org/myorg/package?format=cli' - ).reply(200, serverPackages) - common.npm( - [ - 'access', - 'ls-packages', - 'myorg', - '--registry', common.registry - ], - { cwd: pkg }, - function (er, code, stdout, stderr) { - t.ifError(er, 'npm access ls-packages') - t.same(JSON.parse(stdout), clientPackages) - t.end() - } - ) -}) - -test('npm access ls-packages on user', function (t) { - var serverPackages = { - '@foo/bar': 'write', - '@foo/util': 'read' - } - var clientPackages = { - '@foo/bar': 'read-write', - '@foo/util': 'read-only' - } - server.get( - '/-/org/myorg/package?format=cli' - ).reply(404, {error: 'nope'}) - server.get( - '/-/user/myorg/package?format=cli' - ).reply(200, serverPackages) - common.npm( - [ - 'access', - 'ls-packages', - 'myorg', - '--registry', common.registry - ], - { cwd: pkg }, - function (er, code, stdout, stderr) { - t.ifError(er, 'npm access ls-packages') - t.same(JSON.parse(stdout), clientPackages) - t.end() - } - ) -}) - -test('npm access ls-packages with no package specified or package.json', function (t) { - // need to simulate a missing package.json - var missing = path.join(pkg, 'access-missing-guard') - mkdirp.sync(path.join(missing, 'node_modules')) - - var serverPackages = { - '@foo/bar': 'write', - '@foo/util': 'read' - } - var clientPackages = { - '@foo/bar': 'read-write', - '@foo/util': 'read-only' - } - server.get( - '/-/org/myorg/package?format=cli' - ).reply(404, {error: 'nope'}) - server.get( - '/-/user/myorg/package?format=cli' - ).reply(200, serverPackages) - common.npm( - [ - 'access', - 'ls-packages', - 'myorg', - '--registry', common.registry - ], - { cwd: missing }, - function (er, code, stdout, stderr) { - t.ifError(er, 'npm access ls-packages') - t.same(JSON.parse(stdout), clientPackages) - rimraf(missing, t.end) - } - ) -}) - -test('npm access ls-collaborators on current', function (t) { - var serverCollaborators = { - 'myorg:myteam': 'write', - 'myorg:anotherteam': 'read' - } - var clientCollaborators = { - 'myorg:myteam': 'read-write', - 'myorg:anotherteam': 'read-only' - } - server.get( - '/-/package/%40scoped%2Fpkg/collaborators?format=cli' - ).reply(200, serverCollaborators) - common.npm( - [ - 'access', - 'ls-collaborators', - '--registry', common.registry - ], - { cwd: pkg }, - function (er, code, stdout, stderr) { - t.ifError(er, 'npm access ls-collaborators') - t.same(JSON.parse(stdout), clientCollaborators) - t.end() - } - ) -}) - -test('npm access ls-collaborators on package', function (t) { - var serverCollaborators = { - 'myorg:myteam': 'write', - 'myorg:anotherteam': 'read' - } - var clientCollaborators = { - 'myorg:myteam': 'read-write', - 'myorg:anotherteam': 'read-only' - } - server.get( - '/-/package/%40scoped%2Fanother/collaborators?format=cli' - ).reply(200, serverCollaborators) - common.npm( - [ - 'access', - 'ls-collaborators', - '@scoped/another', - '--registry', common.registry - ], - { cwd: pkg }, - function (er, code, stdout, stderr) { - t.ifError(er, 'npm access ls-collaborators') - t.same(JSON.parse(stdout), clientCollaborators) - t.end() - } - ) -}) - -test('npm access ls-collaborators on unscoped', function (t) { - var serverCollaborators = { - 'myorg:myteam': 'write', - 'myorg:anotherteam': 'read' - } - var clientCollaborators = { - 'myorg:myteam': 'read-write', - 'myorg:anotherteam': 'read-only' - } - server.get( - '/-/package/pkg/collaborators?format=cli' - ).reply(200, serverCollaborators) - common.npm( - [ - 'access', - 'ls-collaborators', - 'pkg', - '--registry', common.registry - ], - { cwd: pkg }, - function (er, code, stdout, stderr) { - t.ifError(er, 'npm access ls-collaborators') - t.same(JSON.parse(stdout), clientCollaborators) - t.end() - } - ) -}) - -test('npm access ls-collaborators on current w/user filter', function (t) { - var serverCollaborators = { - 'myorg:myteam': 'write', - 'myorg:anotherteam': 'read' - } - var clientCollaborators = { - 'myorg:myteam': 'read-write', - 'myorg:anotherteam': 'read-only' - } - server.get( - '/-/package/%40scoped%2Fanother/collaborators?format=cli&user=zkat' - ).reply(200, serverCollaborators) - common.npm( - [ - 'access', - 'ls-collaborators', - '@scoped/another', - 'zkat', - '--registry', common.registry - ], - { cwd: pkg }, - function (er, code, stdout, stderr) { - t.ifError(er, 'npm access ls-collaborators') - t.same(JSON.parse(stdout), clientCollaborators) - t.end() - } - ) -}) - -test('npm access edit', function (t) { - common.npm( - [ - 'access', - 'edit', '@scoped/another', - '--registry', common.registry - ], - { cwd: pkg }, - function (er, code, stdout, stderr) { - t.ok(code, 'exited with Error') - t.match(stderr, /edit subcommand is not implemented yet/) - t.end() - } - ) -}) - -test('npm access blerg', function (t) { - common.npm( - [ - 'access', - 'blerg', '@scoped/another', - '--registry', common.registry - ], - { cwd: pkg }, - function (er, code, stdout, stderr) { - t.ok(code, 'exited with Error') - t.matches(stderr, /Usage:/) - t.end() - } - ) -}) - -test('cleanup', function (t) { - t.pass('cleaned up') - server.done() - server.close() - t.end() -}) diff --git a/deps/npm/test/tap/add-named-update-protocol-port.js b/deps/npm/test/tap/add-named-update-protocol-port.js deleted file mode 100644 index 2876b6cdbc4803..00000000000000 --- a/deps/npm/test/tap/add-named-update-protocol-port.js +++ /dev/null @@ -1,113 +0,0 @@ -'use strict' -var path = require('path') -var test = require('tap').test -var common = require('../common-tap') -var mr = require('npm-registry-mock') -var server1 -var server2 - -var packageName = path.basename(__filename, '.js') - -var fooPkg = { - name: packageName, - versions: { - '0.0.0': { - name: packageName, - version: '0.0.0', - dist: { - tarball: 'https://localhost:' + common.altPort + '/registry/' + packageName + '/-/' + packageName + '-0.0.0.tgz', - shasum: '356a192b7913b04c54574d18c28d46e6395428ab' - } - } - } -} - -var iPackageName = packageName + 'i' -var fooiPkg = { - name: iPackageName, - versions: { - '0.0.0': { - name: iPackageName, - version: '0.0.0', - dist: { - tarball: 'http://127.0.0.1:' + common.altPort + '/registry/' + iPackageName + '/-/' + iPackageName + '-0.0.0.tgz', - shasum: '356a192b7913b04c54574d18c28d46e6395428ab' - } - } - } -} - -test('setup', function (t) { - mr({ - port: common.port, - throwOnUnmatched: true - }, function (err, s) { - t.ifError(err, 'registry mocked successfully') - server1 = s - mr({ - port: common.altPort, - throwOnUnmatched: true - }, function (err, s) { - t.ifError(err, 'registry mocked successfully') - server2 = s - t.end() - }) - }) -}) - -test('tarball paths should update port if updating protocol', function (t) { - server1.get('/registry/' + packageName).reply(200, fooPkg) - server1.get( - '/registry/' + packageName + '/-/' + packageName + '-0.0.0.tgz' - ).reply(200, '1') - - common.npm( - [ - 'cache', - 'add', - packageName + '@0.0.0', - '--registry', - 'http://localhost:' + common.port + '/registry' - ], - {}, - function (er, code, stdout, stderr) { - if (er) { throw er } - t.equal(stderr, '', 'no error output') - t.equal(code, 0, 'addNamed worked') - server1.done() - t.end() - } - ) -}) - -test('tarball paths should NOT update if different hostname', function (t) { - server1.get('/registry/' + iPackageName).reply(200, fooiPkg) - server2.get( - '/registry/' + iPackageName + '/-/' + iPackageName + '-0.0.0.tgz' - ).reply(200, '1') - - common.npm( - [ - 'cache', - 'add', - iPackageName + '@0.0.0', - '--registry', - 'http://localhost:' + common.port + '/registry' - ], - {}, - function (er, code, stdout, stderr) { - if (er) { throw er } - t.equal(code, 0, 'addNamed worked') - server1.done() - server2.done() - t.end() - } - ) -}) - -test('cleanup', function (t) { - t.pass('cleaned up') - server1.close() - server2.close() - t.end() -}) diff --git a/deps/npm/test/tap/add-remote-git-file.js b/deps/npm/test/tap/add-remote-git-file.js deleted file mode 100644 index 483c6368c6490a..00000000000000 --- a/deps/npm/test/tap/add-remote-git-file.js +++ /dev/null @@ -1,85 +0,0 @@ -'use strict' - -var fs = require('fs') -var resolve = require('path').resolve -var url = require('url') - -var mkdirp = require('mkdirp') -var test = require('tap').test - -var npm = require('../../lib/npm.js') -var fetchPackageMetadata = require('../../lib/fetch-package-metadata.js') -var common = require('../common-tap.js') - -var pkg = resolve(common.pkg, 'package') -var repo = resolve(common.pkg, 'repo') -mkdirp.sync(pkg) - -var git -var cloneURL = 'git+file://' + resolve(pkg, 'child.git') - -var pjChild = JSON.stringify({ - name: 'child', - version: '1.0.3' -}, null, 2) + '\n' - -test('setup', function (t) { - setup(function (er, r) { - t.ifError(er, 'git started up successfully') - - t.end() - }) -}) - -test('cache from repo', function (t) { - process.chdir(pkg) - fetchPackageMetadata(cloneURL, process.cwd(), {}, (err, manifest) => { - if (err) t.fail(err.message) - t.equal( - url.parse(manifest._resolved).protocol, - 'git+file:', - 'npm didn\'t go crazy adding git+git+git+git' - ) - t.equal(manifest._requested.type, 'git', 'cached git') - t.end() - }) -}) - -test('save install', function (t) { - process.chdir(pkg) - fs.writeFileSync('package.json', JSON.stringify({ - name: 'parent', - version: '5.4.3' - }, null, 2) + '\n') - var prev = npm.config.get('save') - npm.config.set('save', true) - npm.commands.install('.', [cloneURL], function (er) { - npm.config.set('save', prev) - t.ifError(er, 'npm installed via git') - var pj = JSON.parse(fs.readFileSync('package.json', 'utf-8')) - var dep = pj.dependencies.child - t.equal( - url.parse(dep).protocol, - 'git+file:', - 'npm didn\'t strip the git+ from git+file://' - ) - - t.end() - }) -}) - -function setup (cb) { - mkdirp.sync(repo) - fs.writeFileSync(resolve(repo, 'package.json'), pjChild) - npm.load({ registry: common.registry, loglevel: 'silent' }, function () { - git = require('../../lib/utils/git.js') - - common.makeGitRepo({ - path: repo, - commands: [git.chainableExec( - ['clone', '--bare', repo, 'child.git'], - { cwd: pkg, env: process.env } - )] - }, cb) - }) -} diff --git a/deps/npm/test/tap/add-remote-git-shrinkwrap.js b/deps/npm/test/tap/add-remote-git-shrinkwrap.js deleted file mode 100644 index 01a033e89451ff..00000000000000 --- a/deps/npm/test/tap/add-remote-git-shrinkwrap.js +++ /dev/null @@ -1,137 +0,0 @@ -var fs = require('fs') -var resolve = require('path').resolve - -var mkdirp = require('mkdirp') -var test = require('tap').test - -var npm = require('../../lib/npm.js') -var common = require('../common-tap.js') - -var pkg = resolve(common.pkg, 'package') -var repo = resolve(common.pkg, 'repo') - -var daemon -var daemonPID -var git - -var pjParent = JSON.stringify({ - name: 'parent', - version: '1.2.3', - dependencies: { - 'child': 'git://localhost:' + common.gitPort + '/child.git#master' - } -}, null, 2) + '\n' - -var pjChild = JSON.stringify({ - name: 'child', - version: '1.0.3' -}, null, 2) + '\n' - -test('setup', function (t) { - mkdirp.sync(pkg) - fs.writeFileSync(resolve(pkg, 'package.json'), pjParent) - setup(function (er, r) { - t.ifError(er, 'git started up successfully') - - if (!er) { - daemon = r[r.length - 2] - daemonPID = r[r.length - 1] - } - - t.end() - }) -}) - -test('install from repo', function (t) { - process.chdir(pkg) - common.npm(['install'], {cwd: pkg, stdio: [0, 1, 2]}, function (er, code) { - if (er) throw er - t.is(code, 0, 'npm installed via git') - - t.end() - }) -}) - -test('shrinkwrap gets correct _from and _resolved (#7121)', function (t) { - common.npm( - [ - 'shrinkwrap', - '--loglevel', 'error' - ], - { cwd: pkg, stdio: [0, 'pipe', 2] }, - function (er, code, stdout) { - if (er) throw er - t.is(code, 0, '`npm shrinkwrap` exited ok') - - var shrinkwrap = require(resolve(pkg, 'npm-shrinkwrap.json')) - git.whichAndExec( - ['rev-list', '-n1', 'master'], - { cwd: repo, env: process.env }, - function (er, stdout, stderr) { - t.ifErr(er, 'git rev-list ran without error') - t.notOk(stderr, 'no error output') - var treeish = stdout.trim() - - t.like(shrinkwrap, {dependencies: {child: {version: 'git://localhost:' + common.gitPort + '/child.git#' + treeish}}}, - 'npm shrinkwrapped resolved correctly' - ) - - t.end() - } - ) - } - ) -}) - -test('clean', function (t) { - daemon.on('close', t.end) - process.kill(daemonPID) -}) - -function setup (cb) { - mkdirp.sync(repo) - fs.writeFileSync(resolve(repo, 'package.json'), pjChild) - npm.load({ prefix: pkg, registry: common.registry, loglevel: 'silent' }, function () { - git = require('../../lib/utils/git.js') - - function startDaemon (cb) { - // start git server - var d = git.spawn( - [ - 'daemon', - '--verbose', - '--listen=localhost', - '--export-all', - '--base-path=.', - '--reuseaddr', - '--port=' + common.gitPort - ], - { - cwd: pkg, - env: process.env, - stdio: ['pipe', 'pipe', 'pipe'] - } - ) - d.stderr.on('data', childFinder) - - function childFinder (c) { - var cpid = c.toString().match(/^\[(\d+)\]/) - if (cpid[1]) { - this.removeListener('data', childFinder) - cb(null, [d, cpid[1]]) - } - } - } - - common.makeGitRepo({ - path: repo, - commands: [ - git.chainableExec( - ['clone', '--bare', repo, 'child.git'], - { cwd: pkg, env: process.env } - ), - startDaemon - ] - }, cb) - }) -} diff --git a/deps/npm/test/tap/add-remote-git-submodule.js b/deps/npm/test/tap/add-remote-git-submodule.js deleted file mode 100644 index 54f2819fb330e3..00000000000000 --- a/deps/npm/test/tap/add-remote-git-submodule.js +++ /dev/null @@ -1,142 +0,0 @@ -var fs = require('fs') -var resolve = require('path').resolve - -var cwd = process.cwd() -var mkdirp = require('mkdirp') -var rimraf = require('rimraf') -var test = require('tap').test - -var npm = require('../../lib/npm.js') -var common = require('../common-tap.js') - -var pkg = resolve(common.pkg, 'package') -var repos = resolve(common.pkg, 'repos') -var subwt = resolve(repos, 'subwt') -var topwt = resolve(repos, 'topwt') -var suburl = 'git://localhost:' + common.gitPort + '/sub.git' -var topurl = 'git://localhost:' + common.gitPort + '/top.git' - -var daemon -var daemonPID -var git - -var pjParent = JSON.stringify({ - name: 'parent', - version: '1.2.3', - dependencies: { - child: topurl - } -}, null, 2) + '\n' - -var pjChild = JSON.stringify({ - name: 'child', - version: '1.0.3' -}, null, 2) + '\n' - -test('setup', function (t) { - setup(function (er, r) { - t.ifError(er, 'git started up successfully') - t.end() - }) -}) - -test('install from repo', function (t) { - bootstrap(t) - npm.commands.install('.', [], function (er) { - t.ifError(er, 'npm installed via git') - t.end() - }) -}) - -test('has file in submodule', function (t) { - bootstrap(t) - npm.commands.install('.', [], function (er) { - t.ifError(er, 'npm installed via git') - var fooPath = resolve('node_modules', 'child', 'subpath', 'foo.txt') - fs.stat(fooPath, function (er) { - t.ifError(er, 'file in submodule exists') - t.end() - }) - }) -}) - -test('clean', function (t) { - daemon.on('close', function () { - t.end() - }) - process.kill(daemonPID) -}) - -function bootstrap (t) { - process.chdir(cwd) - rimraf.sync(pkg) - mkdirp.sync(pkg) - process.chdir(pkg) - fs.writeFileSync('package.json', pjParent) -} - -function setup (cb) { - rimraf.sync(pkg) - rimraf.sync(repos) - - mkdirp.sync(topwt) - fs.writeFileSync(resolve(topwt, 'package.json'), pjChild) - mkdirp.sync(subwt) - fs.writeFileSync(resolve(subwt, 'foo.txt'), 'This is provided by submodule') - npm.load({ registry: common.registry, loglevel: 'silent' }, function () { - git = require('../../lib/utils/git.js') - - function startDaemon (cb) { - // start git server - var d = git.spawn( - [ - 'daemon', - '--verbose', - '--listen=localhost', - '--export-all', - '--base-path=.', - '--reuseaddr', - '--port=' + common.gitPort - ], - { - cwd: repos, - env: process.env, - stdio: ['pipe', 'pipe', 'pipe'] - } - ) - d.stderr.on('data', childFinder) - - function childFinder (c) { - var cpid = c.toString().match(/^\[(\d+)\]/) - if (cpid[1]) { - this.removeListener('data', childFinder) - daemon = d - daemonPID = cpid[1] - cb(null) - } - } - } - - var env = { PATH: process.env.PATH } - var topopt = { cwd: topwt, env: env } - var reposopt = { cwd: repos, env: env } - common.makeGitRepo({ - path: subwt, - message: 'subwt repo: ' + subwt, - added: ['foo.txt'], - commands: [ - git.chainableExec(['clone', '--bare', subwt, 'sub.git'], reposopt), - startDaemon, - [common.makeGitRepo, { - path: topwt, - message: 'topwt repo: ' + topwt, - commands: [ - git.chainableExec(['submodule', 'add', suburl, 'subpath'], topopt), - git.chainableExec(['commit', '-m', 'added submodule'], topopt), - git.chainableExec(['clone', '--bare', topwt, 'top.git'], reposopt) - ] - }] - ] - }, cb) - }) -} diff --git a/deps/npm/test/tap/add-remote-git.js b/deps/npm/test/tap/add-remote-git.js deleted file mode 100644 index 2a619634391110..00000000000000 --- a/deps/npm/test/tap/add-remote-git.js +++ /dev/null @@ -1,104 +0,0 @@ -var fs = require('fs') -var resolve = require('path').resolve - -var mkdirp = require('mkdirp') -var test = require('tap').test - -var npm = require('../../lib/npm.js') -var common = require('../common-tap.js') - -var pkg = resolve(common.pkg, 'package') -var repo = resolve(pkg, 'repo') - -var daemon -var daemonPID -var git - -var pjParent = JSON.stringify({ - name: 'parent', - version: '1.2.3', - dependencies: { - child: 'git://localhost:' + common.gitPort + '/child.git' - } -}, null, 2) + '\n' - -var pjChild = JSON.stringify({ - name: 'child', - version: '1.0.3' -}, null, 2) + '\n' - -test('setup', function (t) { - mkdirp.sync(pkg) - fs.writeFileSync(resolve(pkg, 'package.json'), pjParent) - setup(function (er, r) { - t.ifError(er, 'git started up successfully') - - if (!er) { - daemon = r[r.length - 2] - daemonPID = r[r.length - 1] - } - - t.end() - }) -}) - -test('install from repo', function (t) { - process.chdir(pkg) - npm.commands.install('.', [], function (er) { - t.ifError(er, 'npm installed via git') - t.end() - }) -}) - -test('clean', function (t) { - daemon.on('close', t.end) - process.kill(daemonPID) -}) - -function setup (cb) { - mkdirp.sync(repo) - fs.writeFileSync(resolve(repo, 'package.json'), pjChild) - npm.load({ registry: common.registry, loglevel: 'silent' }, function () { - git = require('../../lib/utils/git.js') - - function startDaemon (cb) { - // start git server - var d = git.spawn( - [ - 'daemon', - '--verbose', - '--listen=localhost', - '--export-all', - '--base-path=.', - '--reuseaddr', - '--port=' + common.gitPort - ], - { - cwd: pkg, - env: process.env, - stdio: ['pipe', 1, 'pipe'] - } - ) - d.stderr.on('data', childFinder) - - function childFinder (c) { - var cpid = c.toString().match(/^\[(\d+)\]/) - if (cpid[1]) { - this.removeListener('data', childFinder) - cb(null, [d, cpid[1]]) - } - } - } - - common.makeGitRepo({ - path: repo, - commands: [ - git.chainableExec( - ['clone', '--bare', repo, 'child.git'], - { cwd: pkg, env: process.env } - ), - startDaemon - ] - }, cb) - }) -} diff --git a/deps/npm/test/tap/adduser-always-auth.js b/deps/npm/test/tap/adduser-always-auth.js deleted file mode 100644 index 26541eebbc7b64..00000000000000 --- a/deps/npm/test/tap/adduser-always-auth.js +++ /dev/null @@ -1,266 +0,0 @@ -var fs = require('fs') -var path = require('path') -var rimraf = require('rimraf') -var mr = require('npm-registry-mock') - -var test = require('tap').test -var common = require('../common-tap.js') - -var opts = { cwd: common.pkg } -var outfile = path.resolve(common.pkg, '_npmrc') -var responses = { - 'Username': 'u\n', - 'Password': 'p\n', - 'Email': 'u@p.me\n' -} - -function verifyStdout (runner, successMessage, t) { - var remaining = Object.keys(responses).length - return function (chunk) { - if (remaining > 0) { - remaining-- - - var label = chunk.toString('utf8').split(':')[0] - runner.stdin.write(responses[label]) - - if (remaining === 0) runner.stdin.end() - } else { - var message = chunk.toString('utf8').trim() - t.equal(message, successMessage) - } - } -} - -function mocks (server) { - server.filteringRequestBody(function (r) { - if (r.match(/"_id":"org\.couchdb\.user:u"/)) { - return 'auth' - } else { - return 'invalid' - } - }) - server.post('/-/v1/login', 'invalid').reply(404, 'not found') - server.put('/-/user/org.couchdb.user:u', 'auth') - .reply(201, { username: 'u', password: 'p', email: 'u@p.me' }) -} - -test('npm login', function (t) { - mr({ port: common.port, plugin: mocks }, function (er, s) { - var runner = common.npm( - [ - 'login', - '--registry', common.registry, - '--loglevel', 'silent', - '--userconfig', outfile - ], - opts, - function (err, code) { - t.notOk(code, 'exited OK') - t.notOk(err, 'no error output') - var config = fs.readFileSync(outfile, 'utf8') - t.like(config, /:always-auth=false/, 'always-auth is scoped and false (by default)') - s.close() - rimraf(outfile, function (err) { - t.ifError(err, 'removed config file OK') - t.end() - }) - }) - - var message = 'Logged in as u on ' + common.registry + '/.' - runner.stdout.on('data', verifyStdout(runner, message, t)) - }) -}) - -test('npm login --scope uses :registry as its URI', function (t) { - var port = common.port + 1 - var uri = 'http://localhost:' + port + '/' - var scope = '@myco' - common.npm( - [ - 'config', - '--userconfig', outfile, - 'set', - scope + ':registry', - uri - ], - opts, - function (err, code) { - t.notOk(code, 'exited OK') - t.notOk(err, 'no error output') - - mr({ port: port, plugin: mocks }, function (er, s) { - var runner = common.npm( - [ - 'login', - '--loglevel', 'silent', - '--userconfig', outfile, - '--scope', scope - ], - opts, - function (err, code) { - t.equal(code, 0, 'exited OK') - t.notOk(err, 'no error output') - var config = fs.readFileSync(outfile, 'utf8') - t.like(config, new RegExp(scope + ':registry=' + uri), 'scope:registry is set') - s.close() - rimraf(outfile, function (err) { - t.ifError(err, 'removed config file OK') - t.end() - }) - }) - - var message = 'Logged in as u to scope ' + scope + ' on ' + uri + '.' - runner.stdout.on('data', verifyStdout(runner, message, t)) - }) - }) -}) - -test('npm login --scope makes sure is prefixed by an @', function (t) { - var port = common.port + 1 - var uri = 'http://localhost:' + port + '/' - var scope = 'myco' - var prefixedScope = '@' + scope - common.npm( - [ - '--userconfig', outfile, - 'config', - 'set', - prefixedScope + ':registry', - uri - ], - opts, - function (err, code) { - t.notOk(code, 'exited OK') - t.notOk(err, 'no error output') - - mr({ port: port, plugin: mocks }, function (er, s) { - var runner = common.npm( - [ - 'login', - '--loglevel', 'silent', - '--userconfig', outfile, - '--scope', scope - ], - opts, - function (err, code) { - t.notOk(code, 'exited OK') - t.notOk(err, 'no error output') - var config = fs.readFileSync(outfile, 'utf8') - t.like(config, new RegExp(prefixedScope + ':registry=' + uri), 'scope:registry is set') - s.close() - rimraf(outfile, function (err) { - t.ifError(err, 'removed config file OK') - t.end() - }) - }) - - var message = 'Logged in as u to scope ' + prefixedScope + ' on ' + uri + '.' - runner.stdout.on('data', verifyStdout(runner, message, t)) - }) - }) -}) - -test('npm login --scope --registry uses as its URI', function (t) { - var scope = '@myco' - common.npm( - [ - '--userconfig', outfile, - 'config', - 'set', - scope + ':registry', - 'invalidurl' - ], - opts, - function (err, code) { - t.notOk(code, 'exited OK') - t.notOk(err, 'no error output') - - mr({ port: common.port, plugin: mocks }, function (er, s) { - var runner = common.npm( - [ - 'login', - '--registry', common.registry, - '--loglevel', 'silent', - '--userconfig', outfile, - '--scope', scope - ], - opts, - function (err, code) { - t.notOk(code, 'exited OK') - t.notOk(err, 'no error output') - var config = fs.readFileSync(outfile, 'utf8') - t.like(config, new RegExp(scope + ':registry=' + common.registry), 'scope:registry is set') - s.close() - rimraf(outfile, function (err) { - t.ifError(err, 'removed config file OK') - t.end() - }) - }) - - var message = 'Logged in as u to scope ' + scope + ' on ' + common.registry + '/.' - runner.stdout.on('data', verifyStdout(runner, message, t)) - }) - }) -}) - -test('npm login --always-auth', function (t) { - mr({ port: common.port, plugin: mocks }, function (er, s) { - var runner = common.npm( - [ - 'login', - '--registry', common.registry, - '--loglevel', 'silent', - '--userconfig', outfile, - '--always-auth' - ], - opts, - function (err, code) { - t.notOk(code, 'exited OK') - t.notOk(err, 'no error output') - var config = fs.readFileSync(outfile, 'utf8') - t.like(config, /:always-auth=true/, 'always-auth is scoped and true') - s.close() - rimraf(outfile, function (err) { - t.ifError(err, 'removed config file OK') - t.end() - }) - }) - - var message = 'Logged in as u on ' + common.registry + '/.' - runner.stdout.on('data', verifyStdout(runner, message, t)) - }) -}) - -test('npm login --no-always-auth', function (t) { - mr({ port: common.port, plugin: mocks }, function (er, s) { - var runner = common.npm( - [ - 'login', - '--registry', common.registry, - '--loglevel', 'silent', - '--userconfig', outfile, - '--no-always-auth' - ], - opts, - function (err, code) { - t.notOk(code, 'exited OK') - t.notOk(err, 'no error output') - var config = fs.readFileSync(outfile, 'utf8') - t.like(config, /:always-auth=false/, 'always-auth is scoped and false') - s.close() - rimraf(outfile, function (err) { - t.ifError(err, 'removed config file OK') - t.end() - }) - }) - - var message = 'Logged in as u on ' + common.registry + '/.' - runner.stdout.on('data', verifyStdout(runner, message, t)) - }) -}) - -test('cleanup', function (t) { - rimraf.sync(outfile) - t.pass('cleaned up') - t.end() -}) diff --git a/deps/npm/test/tap/adduser-legacy-auth.js b/deps/npm/test/tap/adduser-legacy-auth.js deleted file mode 100644 index e46901c2b95fe5..00000000000000 --- a/deps/npm/test/tap/adduser-legacy-auth.js +++ /dev/null @@ -1,102 +0,0 @@ -var fs = require('fs') -var path = require('path') -var mkdirp = require('mkdirp') -var rimraf = require('rimraf') -var mr = require('npm-registry-mock') - -var test = require('tap').test -var common = require('../common-tap.js') - -var opts = { cwd: common.pkg } -var pkg = common.pkg -var outfile = path.resolve(pkg, '_npmrc') - -var contents = '_auth=' + Buffer.from('u:x').toString('base64') + '\n' + - 'registry=https://nonexistent.lvh.me/registry\n' + - 'email=u@p.me\n' - -var responses = { - 'Username': 'u\n', - 'Password': 'p\n', - 'Email': 'u@p.me\n' -} - -function mocks (server) { - server.filteringRequestBody(function (r) { - if (r.match(/"_id":"org\.couchdb\.user:u"/)) { - return 'auth' - } else { - return 'invalid' - } - }) - server.post('/-/v1/login', 'invalid').reply(404, 'not found') - server.put('/-/user/org.couchdb.user:u', 'auth') - .reply(409, { error: 'user exists' }) - server.get('/-/user/org.couchdb.user:u?write=true') - .reply(200, { _rev: '3-deadcafebabebeef' }) - server.put( - '/-/user/org.couchdb.user:u/-rev/3-deadcafebabebeef', - 'auth', - { authorization: 'Basic dTpw' } - ).reply(201, { username: 'u', password: 'p', email: 'u@p.me' }) -} - -test('setup', function (t) { - rimraf.sync(pkg) - mkdirp(pkg, function (er) { - t.ifError(er, pkg + ' made successfully') - - fs.writeFile(outfile, contents, function (er) { - t.ifError(er, 'wrote legacy config') - - t.end() - }) - }) -}) - -test('npm login', function (t) { - mr({ port: common.port, plugin: mocks }, function (er, s) { - var runner = common.npm( - [ - 'login', - '--registry', common.registry, - '--loglevel', 'error', - '--userconfig', outfile - ], - opts, - function (err, code, stdout, stderr) { - if (err) throw err - t.is(stderr, '', 'no error output') - t.is(code, 0, 'exited OK') - var config = fs.readFileSync(outfile, 'utf8') - t.like(config, /:always-auth=false/, 'always-auth is scoped and false (by default)') - s.close() - rimraf(outfile, function (err) { - t.ifError(err, 'removed config file OK') - t.end() - }) - } - ) - - var remaining = Object.keys(responses).length - runner.stdout.on('data', function (chunk) { - if (remaining > 0) { - remaining-- - - var label = chunk.toString('utf8').split(':')[0] - if (responses[label]) runner.stdin.write(responses[label]) - - if (remaining === 0) runner.stdin.end() - } else { - var message = chunk.toString('utf8').trim() - t.equal(message, 'Logged in as u on ' + common.registry + '/.') - } - }) - }) -}) - -test('cleanup', function (t) { - rimraf.sync(pkg) - t.pass('cleaned up') - t.end() -}) diff --git a/deps/npm/test/tap/adduser-oauth.js b/deps/npm/test/tap/adduser-oauth.js deleted file mode 100644 index 241fef2a2ed7fa..00000000000000 --- a/deps/npm/test/tap/adduser-oauth.js +++ /dev/null @@ -1,82 +0,0 @@ -var fs = require('fs') -var path = require('path') -var mkdirp = require('mkdirp') -var rimraf = require('rimraf') -var mr = require('npm-registry-mock') - -var test = require('tap').test -var common = require('../common-tap.js') - -var opts = { cwd: common.pkg } -var pkg = common.pkg -var fakeBrowser = path.resolve(pkg, '_script.sh') -var configfile = path.resolve(pkg, '_npmrc') -var outfile = path.resolve(pkg, '_outfile') -var ssoUri = common.registry + '/-/oauth/foo' - -common.pendIfWindows('This is trickier to convert without opening new shells') - -function mocks (server) { - server.filteringRequestBody(function (r) { - if (r.match(/"_id":"org\.couchdb\.user:npm_oauth_auth_dummy_user"/)) { - return 'auth' - } else { - return 'invalid' - } - }) - server.post('/-/v1/login', 'invalid').reply(404, 'not found') - server.put('/-/user/org.couchdb.user:npm_oauth_auth_dummy_user', 'auth') - .reply(201, { token: 'foo', sso: ssoUri }) -} - -test('setup', function (t) { - mkdirp.sync(pkg) - fs.writeFileSync(configfile, '') - var s = '#!/usr/bin/env bash\n' + - 'echo "$@" > ' + outfile + '\n' - fs.writeFileSync(fakeBrowser, s, 'ascii') - fs.chmodSync(fakeBrowser, '0755') - t.pass('made script') - t.end() -}) - -test('npm login', function (t) { - mr({ port: common.port, plugin: mocks }, function (er, s) { - s.get( - '/-/whoami', { authorization: 'Bearer foo' } - ).max(1).reply(401, {}) - common.npm( - [ - 'login', - '--registry', common.registry, - '--auth-type=oauth', - '--loglevel', 'silent', - '--userconfig', configfile, - '--browser', fakeBrowser - ], - opts, - function (err, code, stdout, stderr) { - t.ifError(err, 'npm ran without issue') - t.equal(code, 0, 'exited OK') - t.notOk(stderr, 'no error output') - stderr && t.comment('stderr - ', stderr) - t.matches(stdout, /Logged in as igotauthed/, - 'successfully authenticated and output the given username') - s.close() - rimraf.sync(configfile) - rimraf.sync(outfile) - t.end() - } - ) - - s.get( - '/-/whoami', { authorization: 'Bearer foo' } - ).reply(200, { username: 'igotauthed' }) - }) -}) - -test('cleanup', function (t) { - rimraf.sync(pkg) - t.pass('cleaned up') - t.end() -}) diff --git a/deps/npm/test/tap/adduser-saml.js b/deps/npm/test/tap/adduser-saml.js deleted file mode 100644 index 17a1a9f7b3de6b..00000000000000 --- a/deps/npm/test/tap/adduser-saml.js +++ /dev/null @@ -1,82 +0,0 @@ -var fs = require('fs') -var path = require('path') -var mkdirp = require('mkdirp') -var rimraf = require('rimraf') -var mr = require('npm-registry-mock') - -var test = require('tap').test -var common = require('../common-tap.js') - -var opts = { cwd: common.pkg } -var pkg = common.pkg -var fakeBrowser = path.resolve(pkg, '_script.sh') -var configfile = path.resolve(pkg, '_npmrc') -var outfile = path.resolve(pkg, '_outfile') -var ssoUri = common.registry + '/-/saml/foo' - -common.pendIfWindows('This is trickier to convert without opening new shells') - -function mocks (server) { - server.filteringRequestBody(function (r) { - if (r.match(/"_id":"org\.couchdb\.user:npm_saml_auth_dummy_user"/)) { - return 'auth' - } else { - return 'invalid' - } - }) - server.post('/-/v1/login', 'invalid').reply(404, 'not found') - server.put('/-/user/org.couchdb.user:npm_saml_auth_dummy_user', 'auth') - .reply(201, { token: 'foo', sso: ssoUri }) -} - -test('setup', function (t) { - mkdirp.sync(pkg) - fs.writeFileSync(configfile, '') - var s = '#!/usr/bin/env bash\n' + - 'echo "$@" > ' + outfile + '\n' - fs.writeFileSync(fakeBrowser, s, 'ascii') - fs.chmodSync(fakeBrowser, '0755') - t.pass('made script') - t.end() -}) - -test('npm login', function (t) { - mr({ port: common.port, plugin: mocks }, function (er, s) { - s.get( - '/-/whoami', { authorization: 'Bearer foo' } - ).max(1).reply(401, {}) - common.npm( - [ - 'login', - '--registry', common.registry, - '--auth-type=saml', - '--loglevel', 'silent', - '--userconfig', configfile, - '--browser', fakeBrowser - ], - opts, - function (err, code, stdout, stderr) { - t.ifError(err, 'npm ran without issue') - t.equal(code, 0, 'exited OK') - t.notOk(stderr, 'no error output') - stderr && t.comment('stderr - ', stderr) - t.matches(stdout, /Logged in as igotauthed/, - 'successfully authenticated and output the given username') - s.close() - rimraf.sync(configfile) - rimraf.sync(outfile) - t.end() - } - ) - - s.get( - '/-/whoami', { authorization: 'Bearer foo' } - ).reply(200, { username: 'igotauthed' }) - }) -}) - -test('cleanup', function (t) { - rimraf.sync(pkg) - t.pass('cleaned up') - t.end() -}) diff --git a/deps/npm/test/tap/aliases.js b/deps/npm/test/tap/aliases.js deleted file mode 100644 index 21a68ac50f7a58..00000000000000 --- a/deps/npm/test/tap/aliases.js +++ /dev/null @@ -1,268 +0,0 @@ -'use strict' - -const BB = require('bluebird') - -const common = require('../common-tap.js') -const fs = require('graceful-fs') -const mockTar = require('../util/mock-tarball.js') -const mr = common.fakeRegistry.compat -const path = require('path') -const rimraf = BB.promisify(require('rimraf')) -const Tacks = require('tacks') -const { test } = require('tap') - -const { Dir, File } = Tacks -const readdirAsync = BB.promisify(fs.readdir) -const readFileAsync = BB.promisify(fs.readFile) - -const testDir = common.pkg - -let server -test('setup', t => { - mr({}, (err, s) => { - t.ifError(err, 'registry mocked successfully') - server = s - t.end() - }) -}) - -test('installs an npm: protocol alias package', t => { - const fixture = new Tacks(Dir({ - 'package.json': File({}) - })) - fixture.create(testDir) - const packument = { - name: 'foo', - 'dist-tags': { latest: '1.2.4' }, - versions: { - '1.2.3': { - name: 'foo', - version: '1.2.3', - dist: { - tarball: `${server.registry}/foo/-/foo-1.2.3.tgz` - } - }, - '1.2.4': { - name: 'foo', - version: '1.2.4', - dist: { - tarball: `${server.registry}/foo/-/foo-1.2.4.tgz` - } - } - } - } - server.get('/foo').reply(200, packument) - return mockTar({ - 'package.json': JSON.stringify({ - name: 'foo', - version: '1.2.3' - }) - }).then(tarball => { - server.get('/foo/-/foo-1.2.3.tgz').reply(200, tarball) - server.get('/foo/-/foo-1.2.4.tgz').reply(200, tarball) - return common.npm([ - 'install', 'foo@1.2.3', - '--cache', path.join(testDir, 'npmcache'), - '--registry', server.registry - ], { cwd: testDir }) - }).then(([code, stdout, stderr]) => { - t.equal(code, 0) - t.comment(stdout) - t.comment(stderr) - return common.npm([ - 'install', 'bar@npm:foo@1.2.3', - '--cache', path.join(testDir, 'npmcache'), - '--registry', server.registry - ], { cwd: testDir }) - }).then(([code, stdout, stderr]) => { - t.equal(code, 0) - t.comment(stdout) - t.comment(stderr) - t.match(stdout, /\+ foo@1\.2\.3 \(as bar\)/, 'useful message') - return readFileAsync( - path.join(testDir, 'node_modules', 'bar', 'package.json'), - 'utf8' - ) - }).then(JSON.parse).then(pkg => { - t.similar(pkg, { - name: 'foo', - version: '1.2.3' - }, 'successfully installed foo as bar in node_modules') - return common.npm(['ls', '--json'], { cwd: testDir }) - }).then(([code, stdout, stderr]) => { - t.comment(stdout) - t.comment(stderr) - t.equal(code, 0, 'ls is clean') - t.deepEqual(JSON.parse(stdout), { - dependencies: { - bar: { - version: '1.2.3', - from: 'bar@npm:foo@1.2.3', - resolved: 'http://localhost:' + common.port + '/foo/-/foo-1.2.3.tgz' - }, - foo: { - version: '1.2.3', - from: 'foo@1.2.3', - resolved: 'http://localhost:' + common.port + '/foo/-/foo-1.2.3.tgz' - } - } - }, 'both dependencies listed correctly') - return common.npm([ - 'outdated', '--json', - '--registry', server.registry - ], { cwd: testDir }) - }).then(([code, stdout, stderr]) => { - t.equal(code, 1, 'non-zero because some packages outdated') - t.comment(stdout) - t.comment(stderr) - const parsed = JSON.parse(stdout) - t.match(parsed, { - foo: { - current: '1.2.3', - wanted: '1.2.4', - latest: '1.2.4', - location: /node_modules[/\\]foo/ - }, - bar: { - current: 'npm:foo@1.2.3', - wanted: 'npm:foo@1.2.4', - latest: 'npm:foo@1.2.4', - location: /node_modules[/\\]bar/ - } - }, 'both regular and aliased dependency reported') - return common.npm([ - 'update', - '--registry', server.registry - ], { cwd: testDir }) - }).then(([code, stdout, stderr]) => { - t.equal(code, 0, 'update succeeded') - t.comment(stdout) - t.comment(stderr) - return common.npm(['ls', '--json'], { cwd: testDir }) - }).then(([code, stdout, stderr]) => { - t.equal(code, 0, 'ls succeeded') - t.comment(stdout) - t.comment(stderr) - const parsed = JSON.parse(stdout) - t.deepEqual(parsed, { - dependencies: { - bar: { - version: '1.2.4', - from: 'bar@npm:foo@1.2.4', - resolved: 'http://localhost:' + common.port + '/foo/-/foo-1.2.4.tgz' - }, - foo: { - version: '1.2.4', - from: 'foo@1.2.4', - resolved: 'http://localhost:' + common.port + '/foo/-/foo-1.2.4.tgz' - } - } - }, 'ls shows updated packages') - return common.npm([ - 'rm', 'bar', - '--registry', server.registry - ], { cwd: testDir }) - }).then(([code, stdout, stderr]) => { - t.equal(code, 0, 'rm succeeded') - t.comment(stdout) - t.comment(stderr) - t.match(stdout, 'removed 1 package', 'notified of removed package') - return readdirAsync(path.join(testDir, 'node_modules')) - }).then(dir => { - t.deepEqual(dir, ['foo'], 'regular foo left in place') - }).then(() => rimraf(testDir)) -}) - -test('installs a tarball dep as a different name than package.json', t => { - return mockTar({ - 'package.json': JSON.stringify({ - name: 'foo', - version: '1.2.3' - }) - }).then(tarball => { - const fixture = new Tacks(Dir({ - 'package.json': File({}), - 'foo.tgz': File(tarball) - })) - fixture.create(testDir) - return common.npm([ - 'install', 'file:foo.tgz', - '--cache', path.join(testDir, 'npmcache'), - '--registry', server.registry - ], { cwd: testDir }) - }).then(([code, stdout, stderr]) => { - return common.npm([ - 'install', 'bar@file:foo.tgz', - '--cache', path.join(testDir, 'npmcache'), - '--registry', server.registry - ], { cwd: testDir }) - }).then(([code, stdout, stderr]) => { - t.comment(stdout) - t.comment(stderr) - t.match(stdout, /^\+ foo@1\.2\.3 \(as bar\)/, 'useful message') - return readFileAsync( - path.join(testDir, 'node_modules', 'bar', 'package.json'), - 'utf8' - ) - }).then(JSON.parse).then(pkg => { - t.similar(pkg, { - name: 'foo', - version: '1.2.3' - }, 'successfully installed foo as bar in node_modules') - return common.npm(['ls', '--json'], { cwd: testDir }) - }).then(([code, stdout, stderr]) => { - t.comment(stdout) - t.comment(stderr) - t.similar(JSON.parse(stdout), { - dependencies: { - bar: { - version: '1.2.3', - from: 'file:foo.tgz' - }, - foo: { - version: '1.2.3', - from: 'file:foo.tgz' - } - } - }, 'both dependencies present') - }).then(() => rimraf(testDir)) -}) - -test('installs a symlink dep as a different name than package.json', t => { - const fixture = new Tacks(Dir({ - 'package.json': File({}), - 'foo': Dir({ - 'package.json': File({ - name: 'foo', - version: '1.2.3' - }) - }) - })) - fixture.create(testDir) - return common.npm([ - 'install', 'bar@file:foo', - '--cache', path.join(testDir, 'npmcache'), - '--registry', server.registry - ], { cwd: testDir }).then(([code, stdout, stderr]) => { - t.comment(stdout) - t.comment(stderr) - t.match(stdout, /^\+ foo@1\.2\.3 \(as bar\)/, 'useful message') - return readFileAsync( - path.join(testDir, 'node_modules', 'bar', 'package.json'), - 'utf8' - ) - }).then(JSON.parse).then(pkg => { - t.similar(pkg, { - name: 'foo', - version: '1.2.3' - }, 'successfully installed foo as bar in node_modules') - }).then(() => rimraf(testDir)) -}) - -test('cleanup', t => { - server.close() - return rimraf(testDir) -}) - -test('npm audit supports aliases') -test('npm audit fix supports aliases') diff --git a/deps/npm/test/tap/all-package-metadata-cache-stream-unit.js b/deps/npm/test/tap/all-package-metadata-cache-stream-unit.js deleted file mode 100644 index 66b24c5e0c710c..00000000000000 --- a/deps/npm/test/tap/all-package-metadata-cache-stream-unit.js +++ /dev/null @@ -1,112 +0,0 @@ -'use strict' - -const common = require('../common-tap.js') - -const getStream = require('get-stream') -const mkdirp = require('mkdirp') -const path = require('path') -const Tacks = require('tacks') -const {test} = require('tap') - -const {File} = Tacks - -const _createCacheEntryStream = require('../../lib/search/all-package-metadata.js')._createCacheEntryStream - -// this test uses a fresh cache for each test block -// create them all in common.cache so that we can verify -// them for root-owned files in sudotest -let CACHE_DIR -let cacheCounter = 1 -const chownr = require('chownr') -function setup () { - CACHE_DIR = common.cache + '/' + cacheCounter++ - mkdirp.sync(CACHE_DIR) - fixOwner(CACHE_DIR) -} - -const fixOwner = ( - process.getuid && process.getuid() === 0 && - process.env.SUDO_UID && process.env.SUDO_GID -) ? (path) => chownr.sync(path, +process.env.SUDO_UID, +process.env.SUDO_GID) - : () => {} - -test('createCacheEntryStream basic', t => { - setup() - const cachePath = path.join(CACHE_DIR, '.cache.json') - const fixture = new Tacks(File({ - '_updated': 1234, - bar: { - name: 'bar', - version: '1.0.0' - }, - foo: { - name: 'foo', - version: '1.0.0' - } - })) - fixture.create(cachePath) - fixOwner(cachePath) - return _createCacheEntryStream(cachePath, {}).then(({ - updateStream: stream, - updatedLatest: latest - }) => { - t.equals(latest, 1234, '`latest` correctly extracted') - t.ok(stream, 'returned a stream') - return getStream.array(stream).then(results => { - t.deepEquals(results, [{ - name: 'bar', - version: '1.0.0' - }, { - name: 'foo', - version: '1.0.0' - }]) - }) - }) -}) - -test('createCacheEntryStream empty cache', t => { - setup() - const cachePath = path.join(CACHE_DIR, '.cache.json') - const fixture = new Tacks(File({})) - fixture.create(cachePath) - fixOwner(cachePath) - return _createCacheEntryStream(cachePath, {}).then( - () => { throw new Error('should not succeed') }, - err => { - t.ok(err, 'returned an error because there was no _updated') - t.match(err.message, /Empty or invalid stream/, 'useful error message') - } - ) -}) - -test('createCacheEntryStream no entry cache', t => { - setup() - const cachePath = path.join(CACHE_DIR, '.cache.json') - const fixture = new Tacks(File({ - '_updated': 1234 - })) - fixture.create(cachePath) - fixOwner(cachePath) - return _createCacheEntryStream(cachePath, {}).then(({ - updateStream: stream, - updatedLatest: latest - }) => { - t.equals(latest, 1234, '`latest` correctly extracted') - t.ok(stream, 'returned a stream') - return getStream.array(stream).then(results => { - t.deepEquals(results, [], 'no results') - }) - }) -}) - -test('createCacheEntryStream missing cache', t => { - setup() - const cachePath = path.join(CACHE_DIR, '.cache.json') - return _createCacheEntryStream(cachePath, {}).then( - () => { throw new Error('should not succeed') }, - err => { - t.ok(err, 'returned an error because there was no cache') - t.equals(err.code, 'ENOENT', 'useful error message') - } - ) -}) diff --git a/deps/npm/test/tap/all-package-metadata-entry-stream-unit.js b/deps/npm/test/tap/all-package-metadata-entry-stream-unit.js deleted file mode 100644 index 164a34f4c50c8b..00000000000000 --- a/deps/npm/test/tap/all-package-metadata-entry-stream-unit.js +++ /dev/null @@ -1,190 +0,0 @@ -'use strict' - -const common = require('../common-tap.js') -const getStream = require('get-stream') -const mkdirp = require('mkdirp') -const mr = require('npm-registry-mock') -const npm = require('../../') -const path = require('path') -const Tacks = require('tacks') -const test = require('tap').test - -const {File} = Tacks - -const _createEntryStream = require('../../lib/search/all-package-metadata.js')._createEntryStream - -let server - -// this test uses a fresh cache for each test block -// create them all in common.cache so that we can verify -// them for root-owned files in sudotest -let CACHE_DIR -let cacheCounter = 1 -function setup () { - CACHE_DIR = common.cache + '/' + cacheCounter++ - mkdirp.sync(CACHE_DIR) - fixOwner(CACHE_DIR) -} - -const chownr = require('chownr') -const fixOwner = ( - process.getuid && process.getuid() === 0 && - process.env.SUDO_UID && process.env.SUDO_GID -) ? (path) => chownr.sync(path, +process.env.SUDO_UID, +process.env.SUDO_GID) - : () => {} - -test('setup', t => { - mr({port: common.port, throwOnUnmatched: true}, (err, s) => { - t.ifError(err, 'registry mocked successfully') - npm.load({ cache: CACHE_DIR, registry: common.registry }, err => { - t.ifError(err, 'npm loaded successfully') - server = s - t.pass('all set up') - t.done() - }) - }) -}) - -test('createEntryStream full request', t => { - setup() - const cachePath = path.join(CACHE_DIR, '.cache.json') - const dataTime = +(new Date()) - server.get('/-/all').once().reply(200, { - '_updated': dataTime, - 'bar': { name: 'bar', version: '1.0.0' }, - 'foo': { name: 'foo', version: '1.0.0' } - }, { - date: 1234 // should never be used. - }) - return _createEntryStream(cachePath, 600, { - registry: common.registry - }).then(({ - entryStream: stream, - latest, - newEntries - }) => { - t.equals(latest, dataTime, '`latest` correctly extracted') - t.ok(newEntries, 'new entries need to be written to cache') - t.ok(stream, 'returned a stream') - return getStream.array(stream) - }).then(results => { - t.deepEquals(results, [{ - name: 'bar', - version: '1.0.0' - }, { - name: 'foo', - version: '1.0.0' - }]) - server.done() - }) -}) - -test('createEntryStream cache only', function (t) { - setup() - const now = Date.now() - const cacheTime = now - 100000 - const cachePath = path.join(CACHE_DIR, '.cache.json') - const fixture = new Tacks(File({ - '_updated': cacheTime, - bar: { name: 'bar', version: '1.0.0' }, - cool: { name: 'cool', version: '1.0.0' }, - foo: { name: 'foo', version: '2.0.0' }, - other: { name: 'other', version: '1.0.0' } - })) - fixture.create(cachePath) - fixOwner(cachePath) - return _createEntryStream(cachePath, 600, { - registry: common.registry - }).then(({ - entryStream: stream, - latest, - newEntries - }) => { - t.equals(latest, cacheTime, '`latest` is cache time') - t.ok(stream, 'returned a stream') - t.notOk(newEntries, 'cache only means no need to write to cache') - return getStream.array(stream) - }).then(results => { - t.deepEquals( - results.map(function (pkg) { return pkg.name }), - ['bar', 'cool', 'foo', 'other'], - 'packages deduped and sorted' - ) - server.done() - }) -}) - -test('createEntryStream merged stream', function (t) { - setup() - const now = Date.now() - const cacheTime = now - 6000000 - server.get('/-/all/since?stale=update_after&startkey=' + cacheTime).once().reply(200, { - 'bar': { name: 'bar', version: '2.0.0' }, - 'car': { name: 'car', version: '1.0.0' }, - 'foo': { name: 'foo', version: '1.0.0' } - }, { - date: (new Date(now)).toISOString() - }) - const cachePath = path.join(CACHE_DIR, '.cache.json') - const fixture = new Tacks(File({ - '_updated': cacheTime, - bar: { name: 'bar', version: '1.0.0' }, - cool: { name: 'cool', version: '1.0.0' }, - foo: { name: 'foo', version: '2.0.0' }, - other: { name: 'other', version: '1.0.0' } - })) - fixture.create(cachePath) - fixOwner(cachePath) - return _createEntryStream(cachePath, 600, { - registry: common.registry - }).then(({ - entryStream: stream, - latest, - newEntries - }) => { - t.equals(latest, now, '`latest` correctly extracted from header') - t.ok(stream, 'returned a stream') - t.ok(newEntries, 'cache update means entries should be written') - return getStream.array(stream) - }).then(results => { - t.deepEquals( - results.map(function (pkg) { return pkg.name }), - ['bar', 'car', 'cool', 'foo', 'other'], - 'packages deduped and sorted' - ) - t.deepEquals(results[0], { - name: 'bar', - version: '2.0.0' - }, 'update stream version wins on dedupe') - t.deepEquals(results[3], { - name: 'foo', - version: '1.0.0' - }, 'update stream version wins on dedupe even when the newer one has a lower semver.') - server.done() - }) -}) - -test('createEntryStream no sources', function (t) { - setup() - const cachePath = path.join(CACHE_DIR, '.cache.json') - server.get('/-/all').once().reply(404, {}) - return _createEntryStream(cachePath, 600, { - registry: common.registry - }).then(({ - entryStream: stream, - latest, - newEntries - }) => { - throw new Error('should not succeed') - }, err => { - t.ok(err, 'no sources, got an error') - t.match(err.message, /No search sources available/, 'useful error message') - }).then(() => { - server.done() - }) -}) - -test('cleanup', function (t) { - server.close() - t.done() -}) diff --git a/deps/npm/test/tap/all-package-metadata-update-stream-unit.js b/deps/npm/test/tap/all-package-metadata-update-stream-unit.js deleted file mode 100644 index 126fe9d3985934..00000000000000 --- a/deps/npm/test/tap/all-package-metadata-update-stream-unit.js +++ /dev/null @@ -1,176 +0,0 @@ -'use strict' - -const common = require('../common-tap.js') -const getStream = require('get-stream') -const npm = require('../../') -const test = require('tap').test -const mkdirp = require('mkdirp') -const mr = require('npm-registry-mock') - -var _createEntryUpdateStream = require('../../lib/search/all-package-metadata.js')._createEntryUpdateStream - -var server - -// this test uses a fresh cache for each test block -// create them all in common.cache so that we can verify -// them for root-owned files in sudotest -let CACHE_DIR -let cacheCounter = 1 -function setup () { - CACHE_DIR = common.cache + '/' + cacheCounter++ - mkdirp.sync(CACHE_DIR) - fixOwner(CACHE_DIR) -} - -const chownr = require('chownr') - -const fixOwner = ( - process.getuid && process.getuid() === 0 && - process.env.SUDO_UID && process.env.SUDO_GID -) ? (path) => chownr.sync(path, +process.env.SUDO_UID, +process.env.SUDO_GID) - : () => {} - -test('setup', function (t) { - mr({port: common.port, throwOnUnmatched: true}, function (err, s) { - t.ifError(err, 'registry mocked successfully') - npm.load({ cache: CACHE_DIR, registry: common.registry }, function (err) { - t.ifError(err, 'npm loaded successfully') - server = s - t.pass('all set up') - t.done() - }) - }) -}) - -test('createEntryUpdateStream full request', function (t) { - setup() - server.get('/-/all').once().reply(200, { - '_updated': 1234, - 'bar': { name: 'bar', version: '1.0.0' }, - 'foo': { name: 'foo', version: '1.0.0' } - }, { - date: Date.now() // should never be used. - }) - return _createEntryUpdateStream(600, 0, { - registry: common.registry - }).then(({ - updateStream: stream, - updatedLatest: latest - }) => { - t.equals(latest, 1234, '`latest` correctly extracted') - t.ok(stream, 'returned a stream') - return getStream.array(stream) - }).then(results => { - t.deepEquals(results, [{ - name: 'bar', - version: '1.0.0' - }, { - name: 'foo', - version: '1.0.0' - }]) - server.done() - }) -}) - -test('createEntryUpdateStream partial update', function (t) { - setup() - var now = Date.now() - server.get('/-/all/since?stale=update_after&startkey=1234').once().reply(200, { - 'bar': { name: 'bar', version: '1.0.0' }, - 'foo': { name: 'foo', version: '1.0.0' } - }, { - date: (new Date(now)).toISOString() - }) - return _createEntryUpdateStream(600, 1234, { - registry: common.registry - }).then(({ - updateStream: stream, - updatedLatest: latest - }) => { - t.equals(latest, now, '`latest` correctly extracted from header') - t.ok(stream, 'returned a stream') - return getStream.array(stream) - }).then(results => { - t.deepEquals(results, [{ - name: 'bar', - version: '1.0.0' - }, { - name: 'foo', - version: '1.0.0' - }]) - server.done() - }) -}) - -test('createEntryUpdateStream authed request', function (t) { - setup() - var token = 'thisisanauthtoken' - server.get('/-/all', { authorization: 'Bearer ' + token }).once().reply(200, { - '_updated': 1234, - 'bar': { name: 'bar', version: '1.0.0' }, - 'foo': { name: 'foo', version: '1.0.0' } - }, { - date: Date.now() // should never be used. - }) - return _createEntryUpdateStream(600, 0, { - registry: common.registry, - token - }).then(({ - updateStream: stream, - updatedLatest: latest - }) => { - t.equals(latest, 1234, '`latest` correctly extracted') - t.ok(stream, 'returned a stream') - return getStream.array(stream) - }).then(results => { - t.deepEquals(results, [{ - name: 'bar', - version: '1.0.0' - }, { - name: 'foo', - version: '1.0.0' - }]) - server.done() - }) -}) - -test('createEntryUpdateStream bad auth', function (t) { - setup() - var token = 'thisisanauthtoken' - server.get('/-/all', { authorization: 'Bearer ' + token }).once().reply(401, { - error: 'unauthorized search request' - }) - return _createEntryUpdateStream(600, 0, { - registry: common.registry, - token - }).then(() => { - throw new Error('should not succeed') - }, err => { - t.ok(err, 'got an error from auth failure') - t.match(err, /unauthorized/, 'failure message from request used') - }).then(() => { - server.done() - }) -}) - -test('createEntryUpdateStream not stale', function (t) { - setup() - var now = Date.now() - var staleness = 600 - return _createEntryUpdateStream(staleness, now, { - registry: common.registry - }).then(({ - updateStream: stream, - updatedLatest: latest - }) => { - t.notOk(stream, 'no stream returned') - t.notOk(latest, 'no latest returned') - server.done() - t.end() - }) -}) - -test('cleanup', function (t) { - server.close() - t.done() -}) diff --git a/deps/npm/test/tap/all-package-metadata-write-stream-unit.js b/deps/npm/test/tap/all-package-metadata-write-stream-unit.js deleted file mode 100644 index 8cdfe96da05e2b..00000000000000 --- a/deps/npm/test/tap/all-package-metadata-write-stream-unit.js +++ /dev/null @@ -1,125 +0,0 @@ -'use strict' - -const common = require('../common-tap.js') -const getStream = require('get-stream') -const npm = require('../../') -const test = require('tap').test -const mkdirp = require('mkdirp') -const path = require('path') -const fs = require('fs') -const ms = require('mississippi') - -const _createCacheWriteStream = require('../../lib/search/all-package-metadata.js')._createCacheWriteStream - -// this test uses a fresh cache for each test block -// create them all in common.cache so that we can verify -// them for root-owned files in sudotest -let CACHE_DIR -let cacheCounter = 1 -function setup () { - CACHE_DIR = common.cache + '/' + cacheCounter++ - mkdirp.sync(CACHE_DIR) - fixOwner(CACHE_DIR) -} - -const chownr = require('chownr') -const fixOwner = ( - process.getuid && process.getuid() === 0 && - process.env.SUDO_UID && process.env.SUDO_GID -) ? (path) => chownr.sync(path, +process.env.SUDO_UID, +process.env.SUDO_GID) - : () => {} - -function fromArray (array) { - var idx = 0 - return ms.from.obj(function (size, next) { - next(null, array[idx++] || null) - }) -} - -test('setup', function (t) { - // This is pretty much only used for `getCacheStat` in the implementation - npm.load({ cache: CACHE_DIR, registry: common.registry }, function (err) { - t.ifError(err, 'npm successfully loaded') - t.done() - }) -}) - -test('createCacheEntryStream basic', function (t) { - setup() - var cachePath = path.join(CACHE_DIR, '.cache.json') - var latest = 12345 - var src = [ - { name: 'bar', version: '1.0.0' }, - { name: 'foo', version: '1.0.0' } - ] - var srcStream = fromArray(src) - return _createCacheWriteStream(cachePath, latest, { - cache: CACHE_DIR - }).then(stream => { - t.ok(stream, 'returned a stream') - stream = ms.pipeline.obj(srcStream, stream) - return getStream.array(stream) - }).then(results => { - t.deepEquals(results, [{ - name: 'bar', - version: '1.0.0' - }, { - name: 'foo', - version: '1.0.0' - }]) - var fileData = JSON.parse(fs.readFileSync(cachePath)) - t.ok(fileData, 'cache contents written to the right file') - t.deepEquals(fileData, { - '_updated': latest, - bar: { - name: 'bar', - version: '1.0.0' - }, - foo: { - name: 'foo', - version: '1.0.0' - } - }, 'cache contents based on what was written') - }) -}) - -test('createCacheEntryStream no entries', function (t) { - setup() - const cachePath = path.join(CACHE_DIR, '.cache.json') - var latest = 12345 - const src = [] - const srcStream = fromArray(src) - return _createCacheWriteStream(cachePath, latest, { - cache: CACHE_DIR - }).then(stream => { - t.ok(stream, 'returned a stream') - stream = ms.pipeline.obj(srcStream, stream) - stream.resume() - return getStream(stream) - }).then(() => { - const fileData = JSON.parse(fs.readFileSync(cachePath)) - t.ok(fileData, 'cache file exists and has stuff in it') - }) -}) - -test('createCacheEntryStream missing cache dir', function (t) { - setup() - var cachePath = path.join(CACHE_DIR, '.cache.json') - var latest = 12345 - var src = [] - var srcStream = fromArray(src) - return _createCacheWriteStream(cachePath, latest, { - cache: CACHE_DIR - }).then(stream => { - t.ok(stream, 'returned a stream') - stream = ms.pipeline.obj(srcStream, stream) - return getStream.array(stream) - }).then(res => { - t.deepEqual(res, [], 'no data returned') - var fileData = JSON.parse(fs.readFileSync(cachePath)) - t.ok(fileData, 'cache contents written to the right file') - t.deepEquals(fileData, { - '_updated': latest - }, 'cache still contains `_updated`') - }) -}) diff --git a/deps/npm/test/tap/all-package-metadata.js b/deps/npm/test/tap/all-package-metadata.js deleted file mode 100644 index 75afa9bad2c0c7..00000000000000 --- a/deps/npm/test/tap/all-package-metadata.js +++ /dev/null @@ -1,212 +0,0 @@ -'use strict' - -const common = require('../common-tap.js') -const npm = require('../../') -const test = require('tap').test -const mkdirp = require('mkdirp') -const rimraf = require('rimraf') -const path = require('path') -const fs = require('fs') -const cacheFile = require('npm-cache-filename') -const mr = require('npm-registry-mock') -const ms = require('mississippi') -const Tacks = require('tacks') -const File = Tacks.File - -const allPackageMetadata = require('../../lib/search/all-package-metadata.js') - -const PKG_DIR = path.resolve(common.cache, 'update-index') -const CACHE_DIR = path.resolve(PKG_DIR, 'cache', '_cacache') -let cacheBase -let cachePath - -let server - -function setup () { - mkdirp.sync(cacheBase) -} - -function cleanup (cb) { - rimraf(PKG_DIR, cb) -} - -test('setup', function (t) { - mr({port: common.port, throwOnUnmatched: true}, function (err, s) { - t.ifError(err, 'registry mocked successfully') - npm.load({ cache: path.dirname(CACHE_DIR), registry: common.registry }, function (err) { - t.ifError(err, 'npm loaded successfully') - npm.config.set('cache', path.dirname(CACHE_DIR)) - cacheBase = cacheFile(npm.config.get('cache'))(common.registry + '/-/all') - cachePath = path.join(cacheBase, '.cache.json') - server = s - t.pass('all set up') - t.done() - }) - }) -}) - -test('allPackageMetadata full request', function (t) { - setup() - var updated = Date.now() - server.get('/-/all').once().reply(200, { - '_updated': 1234, - 'bar': { name: 'bar', version: '1.0.0' }, - 'foo': { name: 'foo', version: '1.0.0' } - }, { - date: updated - }) - var stream = allPackageMetadata({ - cache: CACHE_DIR, - registry: common.registry, - staleness: 600 - }) - t.ok(stream, 'returned a stream') - var results = [] - stream.on('data', function (pkg) { - results.push(pkg) - }) - ms.finished(stream, function (err) { - if (err) throw err - t.deepEquals(results, [{ - name: 'bar', - version: '1.0.0' - }, { - name: 'foo', - version: '1.0.0' - }]) - var fileData = JSON.parse(fs.readFileSync(cachePath)) - t.ok(fileData, 'cache contents written to the right file') - t.deepEquals(fileData, { - '_updated': 1234, - bar: { - name: 'bar', - version: '1.0.0' - }, - foo: { - name: 'foo', - version: '1.0.0' - } - }, 'cache contents based on what was written') - server.done() - cleanup(t.end) - }) -}) - -test('allPackageMetadata cache only', function (t) { - setup() - var now = Date.now() - var cacheContents = { - '_updated': now, - bar: { name: 'bar', version: '1.0.0' }, - cool: { name: 'cool', version: '1.0.0' }, - foo: { name: 'foo', version: '2.0.0' }, - other: { name: 'other', version: '1.0.0' } - } - var fixture = new Tacks(File(cacheContents)) - fixture.create(cachePath) - var stream = allPackageMetadata({ - cache: CACHE_DIR, - registry: common.registry, - staleness: 10000000 - }) - t.ok(stream, 'returned a stream') - var results = [] - stream.on('data', function (pkg) { - results.push(pkg) - }) - ms.finished(stream, function (err) { - t.ifError(err, 'stream finished without error') - t.deepEquals( - results.map(function (pkg) { return pkg.name }), - ['bar', 'cool', 'foo', 'other'], - 'packages deduped and sorted, without _updated' - ) - var fileData = JSON.parse(fs.readFileSync(cachePath)) - t.ok(fileData, 'cache contents written to the right file') - t.deepEquals(fileData, cacheContents, 'cacheContents written directly') - server.done() - cleanup(t.end) - }) -}) - -test('createEntryStream merged stream', function (t) { - setup() - var now = Date.now() - var cacheTime = now - 601000 - var reqTime = (new Date(now)).toISOString() - server.get('/-/all/since?stale=update_after&startkey=' + cacheTime).once().reply(200, { - 'bar': { name: 'bar', version: '2.0.0' }, - 'car': { name: 'car', version: '1.0.0' }, - 'foo': { name: 'foo', version: '1.0.0' } - }, { - date: reqTime - }) - var fixture = new Tacks(File({ - '_updated': cacheTime, - bar: { name: 'bar', version: '1.0.0' }, - cool: { name: 'cool', version: '1.0.0' }, - foo: { name: 'foo', version: '2.0.0' }, - other: { name: 'other', version: '1.0.0' } - })) - fixture.create(cachePath) - var stream = allPackageMetadata({ - cache: CACHE_DIR, - registry: common.registry, - staleness: 600 - }) - t.ok(stream, 'returned a stream') - var results = [] - stream.on('data', function (pkg) { - results.push(pkg) - }) - ms.finished(stream, function (err) { - t.ifError(err, 'stream finished without error') - t.deepEquals( - results.map(function (pkg) { return pkg.name }), - ['bar', 'car', 'cool', 'foo', 'other'], - 'packages deduped and sorted' - ) - t.deepEquals(results[0], { - name: 'bar', - version: '2.0.0' - }, 'update stream version wins on dedupe') - t.deepEquals(results[3], { - name: 'foo', - version: '1.0.0' - }, 'update stream version wins on dedupe even when the newer one has a lower semver.') - var cacheContents = { - '_updated': Date.parse(reqTime), - bar: { name: 'bar', version: '2.0.0' }, - car: { name: 'car', version: '1.0.0' }, - cool: { name: 'cool', version: '1.0.0' }, - foo: { name: 'foo', version: '1.0.0' }, - other: { name: 'other', version: '1.0.0' } - } - var fileData = JSON.parse(fs.readFileSync(cachePath)) - t.ok(fileData, 'cache contents written to the right file') - t.deepEquals(fileData, cacheContents, 'cache updated correctly') - server.done() - cleanup(t.end) - }) -}) - -test('allPackageMetadata no sources', function (t) { - setup() - server.get('/-/all').once().reply(404, {}) - var stream = allPackageMetadata({ - cache: CACHE_DIR, - registry: common.registry, - staleness: 600 - }) - ms.finished(stream, function (err) { - t.ok(err, 'no sources, got an error') - t.match(err.message, /No search sources available/, 'useful error message') - server.done() - cleanup(t.end) - }) -}) - -test('cleanup', function (t) { - server.close() - cleanup(t.end) -}) diff --git a/deps/npm/test/tap/anon-cli-metrics.js b/deps/npm/test/tap/anon-cli-metrics.js deleted file mode 100644 index 729d9e607a4a02..00000000000000 --- a/deps/npm/test/tap/anon-cli-metrics.js +++ /dev/null @@ -1,151 +0,0 @@ -'use strict' -var path = require('path') -var fs = require('graceful-fs') -var rimraf = require('rimraf') -var test = require('tap').test -var mr = require('npm-registry-mock') -var Tacks = require('tacks') -var File = Tacks.File -var Dir = Tacks.Dir -var common = require('../common-tap.js') - -var basedir = common.pkg -var testdir = path.join(basedir, 'testdir') -var cachedir = common.cache -var globaldir = path.join(basedir, 'global') -var tmpdir = path.join(basedir, 'tmp') -var metricsFile = path.join(cachedir, 'anonymous-cli-metrics.json') - -var conf = { - cwd: testdir, - env: Object.assign({}, process.env, { - npm_config_cache: cachedir, - npm_config_tmp: tmpdir, - npm_config_prefix: globaldir, - npm_config_registry: common.registry, - npm_config_metrics_registry: null, - npm_config_loglevel: 'warn' - }) -} - -var server -var fixture = new Tacks(Dir({ - cache: Dir(), - global: Dir(), - tmp: Dir(), - testdir: Dir({ - failure: Dir({ - 'package.json': File({ - name: 'failure', - version: '1.0.0', - scripts: { - preinstall: 'false' - } - }) - }), - success: Dir({ - 'package.json': File({ - name: 'success', - version: '1.0.0' - }) - }), - slow: Dir({ - 'package.json': File({ - name: 'slow', - version: '1.0.0', - scripts: { - preinstall: 'node -e "setTimeout(function(){}, 500)"' - } - }) - }), - 'package.json': File({ - name: 'anon-cli-metrics-test', - version: '1.0.0' - }) - }) -})) - -function setup () { - cleanup() - fixture.create(basedir) -} - -function cleanup () { - fixture.remove(basedir) -} - -function reset () { - rimraf.sync(testdir + '/' + 'node_modules') -} - -test('setup', function (t) { - setup() - mr({port: common.port, throwOnUnmatched: true}, function (err, s) { - if (err) throw err - server = s - server.filteringPathRegEx(/([/]-[/]npm[/]anon-metrics[/]v1[/]).*/, '$1:id') - server.filteringRequestBody(function (body) { - var metrics = typeof body === 'string' ? JSON.parse(body) : body - delete metrics.from - delete metrics.to - return JSON.stringify(metrics) - }) - t.done() - }) -}) - -test('record success', function (t) { - common.npm(['install', '--no-save', '--no-send-metrics', 'file:success'], conf, function (err, code, stdout, stderr) { - if (err) throw err - t.is(code, 0, 'always succeeding install succeeded') - t.comment(stdout.trim()) - t.comment(stderr.trim()) - var data = JSON.parse(fs.readFileSync(metricsFile)) - t.is(data.metrics.successfulInstalls, 1, 'successes') - t.is(data.metrics.failedInstalls, 0, 'failures') - t.done() - }) -}) - -test('record failure', function (t) { - reset() - server.put('/-/npm/anon-metrics/v1/:id', { - successfulInstalls: 1, - failedInstalls: 0 - }).reply(500, {ok: false}) - common.npm(['install', '--no-save', '--send-metrics', 'file:failure'], conf, function (err, code, stdout, stderr) { - if (err) throw err - t.notEqual(code, 0, 'always failing install fails') - t.comment(stdout.trim()) - t.comment(stderr.trim()) - var data = JSON.parse(fs.readFileSync(metricsFile)) - t.is(data.metrics.successfulInstalls, 1, 'successes') - t.is(data.metrics.failedInstalls, 1, 'failures') - t.done() - }) -}) - -test('report', function (t) { - reset() - server.put('/-/npm/anon-metrics/v1/:id', { - successfulInstalls: 1, - failedInstalls: 1 - }).reply(200, {ok: true}) - common.npm(['install', '--no-save', '--send-metrics', 'file:slow'], conf, function (err, code, stdout, stderr) { - if (err) throw err - t.is(code, 0, 'command ran ok') - t.comment(stdout.trim()) - t.comment(stderr.trim()) - // todo check mock registry for post - var data = JSON.parse(fs.readFileSync(metricsFile)) - t.is(data.metrics.successfulInstalls, 1, 'successes') - t.is(data.metrics.failedInstalls, 0, 'failures') - t.done() - }) -}) - -test('cleanup', function (t) { - server.close() - cleanup() - t.done() -}) diff --git a/deps/npm/test/tap/audit-fix.js b/deps/npm/test/tap/audit-fix.js deleted file mode 100644 index a832078ae9369e..00000000000000 --- a/deps/npm/test/tap/audit-fix.js +++ /dev/null @@ -1,829 +0,0 @@ -'use strict' - -const BB = require('bluebird') - -const common = BB.promisifyAll(require('../common-tap.js')) -const fs = require('fs') -const mr = common.fakeRegistry.compat -const path = require('path') -const rimraf = BB.promisify(require('rimraf')) -const Tacks = require('tacks') -const tap = require('tap') -const test = tap.test - -const Dir = Tacks.Dir -const File = Tacks.File -const testDir = common.pkg - -const EXEC_OPTS = { cwd: testDir } - -tap.tearDown(function () { - process.chdir(__dirname) - try { - rimraf.sync(testDir) - } catch (e) { - if (process.platform !== 'win32') { - throw e - } - } -}) - -function tmock (t) { - return mr({port: common.port}).then(s => { - t.tearDown(function () { - s.done() - s.close() - rimraf.sync(testDir) - }) - return s - }) -} - -test('fixes shallow vulnerabilities', t => { - const fixture = new Tacks(new Dir({ - 'package.json': new File({ - name: 'foo', - version: '1.0.0', - dependencies: { - baddep: '1.0.0' - } - }) - })) - fixture.create(testDir) - return tmock(t).then(srv => { - srv.filteringRequestBody(req => 'ok') - srv.post('/-/npm/v1/security/audits/quick', 'ok').reply(200, 'yeah') - srv.get('/baddep').twice().reply(200, { - name: 'baddep', - 'dist-tags': { - 'latest': '1.2.3' - }, - versions: { - '1.0.0': { - name: 'baddep', - version: '1.0.0', - _hasShrinkwrap: false, - dist: { - shasum: 'deadbeef', - tarball: common.registry + '/idk/-/idk-1.0.0.tgz' - } - }, - '1.2.3': { - name: 'baddep', - version: '1.2.3', - _hasShrinkwrap: false, - dist: { - shasum: 'deadbeef', - tarball: common.registry + '/idk/-/idk-1.2.3.tgz' - } - } - } - }) - return common.npm([ - 'install', - '--audit', - '--json', - '--package-lock-only', - '--registry', common.registry, - '--cache', path.join(testDir, 'npm-cache') - ], EXEC_OPTS).then(([code, stdout, stderr]) => { - t.equal(code, 0, 'exited OK') - t.comment(stderr) - t.similar(JSON.parse(stdout), { - added: [{ - action: 'add', - name: 'baddep', - version: '1.0.0' - }] - }, 'installed bad version') - srv.filteringRequestBody(req => 'ok') - srv.post('/-/npm/v1/security/audits', 'ok').reply(200, { - actions: [{ - action: 'update', - module: 'baddep', - target: '1.2.3', - resolves: [{path: 'baddep'}] - }], - metadata: { - vulnerabilities: { - critical: 1 - } - } - }) - return common.npm([ - 'audit', 'fix', - '--package-lock-only', - '--json', - '--registry', common.registry, - '--cache', path.join(testDir, 'npm-cache') - ], EXEC_OPTS).then(([code, stdout, stderr]) => { - t.equal(code, 0, 'exited OK') - t.comment(stderr) - t.similar(JSON.parse(stdout), { - added: [{ - action: 'add', - name: 'baddep', - version: '1.2.3' - }] - }, 'reported dependency update') - t.similar(JSON.parse(fs.readFileSync(path.join(testDir, 'package-lock.json'), 'utf8')), { - dependencies: { - baddep: { - version: '1.2.3', - resolved: common.registry + '/idk/-/idk-1.2.3.tgz', - integrity: 'sha1-3q2+7w==' - } - } - }, 'pkglock updated correctly') - }) - }) - }) -}) - -test('fixes nested dep vulnerabilities', t => { - const fixture = new Tacks(new Dir({ - 'package.json': new File({ - name: 'foo', - version: '1.0.0', - dependencies: { - gooddep: '^1.0.0' - } - }) - })) - fixture.create(testDir) - return tmock(t).then(srv => { - srv.filteringRequestBody(req => 'ok') - srv.post('/-/npm/v1/security/audits/quick', 'ok').reply(200, 'yeah') - srv.get('/baddep').reply(200, { - name: 'baddep', - 'dist-tags': { - 'latest': '1.0.0' - }, - versions: { - '1.0.0': { - name: 'baddep', - version: '1.0.0', - _hasShrinkwrap: false, - dist: { - shasum: 'c0ffee', - integrity: 'sha1-c0ffee', - tarball: common.registry + '/baddep/-/baddep-1.0.0.tgz' - } - }, - '1.2.3': { - name: 'baddep', - version: '1.2.3', - _hasShrinkwrap: false, - dist: { - shasum: 'bada55', - integrity: 'sha1-bada55', - tarball: common.registry + '/baddep/-/baddep-1.2.3.tgz' - } - } - } - }) - - srv.get('/gooddep').reply(200, { - name: 'gooddep', - 'dist-tags': { - 'latest': '1.0.0' - }, - versions: { - '1.0.0': { - name: 'gooddep', - version: '1.0.0', - dependencies: { - baddep: '^1.0.0' - }, - _hasShrinkwrap: false, - dist: { - shasum: '1234', - tarball: common.registry + '/gooddep/-/gooddep-1.0.0.tgz' - } - }, - '1.2.3': { - name: 'gooddep', - version: '1.2.3', - _hasShrinkwrap: false, - dependencies: { - baddep: '^1.0.0' - }, - dist: { - shasum: '123456', - tarball: common.registry + '/gooddep/-/gooddep-1.2.3.tgz' - } - } - } - }) - - return common.npm([ - 'install', - '--audit', - '--json', - '--global-style', - '--package-lock-only', - '--registry', common.registry, - '--cache', path.join(testDir, 'npm-cache') - ], EXEC_OPTS).then(([code, stdout, stderr]) => { - t.equal(code, 0, 'exited OK') - t.comment(stderr) - t.similar(JSON.parse(stdout), { - added: [{ - action: 'add', - name: 'baddep', - version: '1.0.0' - }, { - action: 'add', - name: 'gooddep', - version: '1.0.0' - }] - }, 'installed bad version') - srv.filteringRequestBody(req => 'ok') - srv.post('/-/npm/v1/security/audits', 'ok').reply(200, { - actions: [{ - action: 'update', - module: 'baddep', - target: '1.2.3', - resolves: [{path: 'gooddep>baddep'}] - }], - metadata: { - vulnerabilities: { - critical: 1 - } - } - }) - return common.npm([ - 'audit', 'fix', - '--package-lock-only', - '--offline', - '--json', - '--global-style', - '--registry', common.registry, - '--cache', path.join(testDir, 'npm-cache') - ], EXEC_OPTS).then(([code, stdout, stderr]) => { - t.equal(code, 0, 'exited OK') - t.comment(stderr) - t.similar(JSON.parse(stdout), { - added: [{ - action: 'add', - name: 'baddep', - version: '1.2.3' - }, { - action: 'add', - name: 'gooddep', - version: '1.0.0' - }] - }, 'reported dependency update') - t.similar(JSON.parse(fs.readFileSync(path.join(testDir, 'package-lock.json'), 'utf8')), { - dependencies: { - gooddep: { - version: '1.0.0', - resolved: common.registry + '/gooddep/-/gooddep-1.0.0.tgz', - integrity: 'sha1-EjQ=', - requires: { - baddep: '^1.0.0' - }, - dependencies: { - baddep: { - version: '1.2.3', - resolved: common.registry + '/baddep/-/baddep-1.2.3.tgz', - integrity: 'sha1-bada55' - } - } - } - } - }, 'pkglock updated correctly') - }) - }) - }) -}) - -test('no semver-major without --force', t => { - const fixture = new Tacks(new Dir({ - 'package.json': new File({ - name: 'foo', - version: '1.0.0', - dependencies: { - baddep: '1.0.0' - } - }) - })) - fixture.create(testDir) - return tmock(t).then(srv => { - srv.filteringRequestBody(req => 'ok') - srv.post('/-/npm/v1/security/audits/quick', 'ok').reply(200, 'yeah') - srv.get('/baddep').twice().reply(200, { - name: 'baddep', - 'dist-tags': { - 'latest': '2.0.0' - }, - versions: { - '1.0.0': { - name: 'baddep', - version: '1.0.0', - _hasShrinkwrap: false, - dist: { - shasum: 'deadbeef', - tarball: common.registry + '/idk/-/idk-1.0.0.tgz' - } - }, - '2.0.0': { - name: 'baddep', - version: '2.0.0', - _hasShrinkwrap: false, - dist: { - shasum: 'deadbeef', - tarball: common.registry + '/idk/-/idk-2.0.0.tgz' - } - } - } - }) - return common.npm([ - 'install', - '--audit', - '--json', - '--package-lock-only', - '--registry', common.registry, - '--cache', path.join(testDir, 'npm-cache') - ], EXEC_OPTS).then(([code, stdout, stderr]) => { - t.equal(code, 0, 'exited OK') - t.comment(stderr) - t.similar(JSON.parse(stdout), { - added: [{ - action: 'add', - name: 'baddep', - version: '1.0.0' - }] - }, 'installed bad version') - srv.filteringRequestBody(req => 'ok') - srv.post('/-/npm/v1/security/audits', 'ok').reply(200, { - actions: [{ - action: 'install', - module: 'baddep', - target: '2.0.0', - isMajor: true, - resolves: [{path: 'baddep'}] - }], - metadata: { - vulnerabilities: { - critical: 1 - } - } - }) - return common.npm([ - 'audit', 'fix', - '--package-lock-only', - '--registry', common.registry, - '--loglevel=warn', - '--cache', path.join(testDir, 'npm-cache') - ], EXEC_OPTS).then(([code, stdout, stderr]) => { - t.equal(code, 0, 'exited OK') - t.comment(stderr) - t.match(stdout, /breaking changes/, 'informs about semver-major') - t.match(stdout, /npm audit fix --force/, 'recommends --force') - t.similar(JSON.parse(fs.readFileSync(path.join(testDir, 'package-lock.json'), 'utf8')), { - dependencies: { - baddep: { - version: '1.0.0' - } - } - }, 'pkglock not updated') - }) - }) - }) -}) - -test('semver-major when --force', t => { - const fixture = new Tacks(new Dir({ - 'package.json': new File({ - name: 'foo', - version: '1.0.0', - dependencies: { - baddep: '1.0.0' - } - }) - })) - fixture.create(testDir) - return tmock(t).then(srv => { - srv.filteringRequestBody(req => 'ok') - srv.post('/-/npm/v1/security/audits/quick', 'ok').reply(200, 'yeah') - srv.get('/baddep').twice().reply(200, { - name: 'baddep', - 'dist-tags': { - 'latest': '2.0.0' - }, - versions: { - '1.0.0': { - name: 'baddep', - version: '1.0.0', - _hasShrinkwrap: false, - dist: { - shasum: 'deadbeef', - tarball: common.registry + '/idk/-/idk-1.0.0.tgz' - } - }, - '2.0.0': { - name: 'baddep', - version: '2.0.0', - _hasShrinkwrap: false, - dist: { - shasum: 'deadbeef', - tarball: common.registry + '/idk/-/idk-2.0.0.tgz' - } - } - } - }) - return common.npm([ - 'install', - '--audit', - '--json', - '--package-lock-only', - '--registry', common.registry, - '--cache', path.join(testDir, 'npm-cache') - ], EXEC_OPTS).then(([code, stdout, stderr]) => { - t.equal(code, 0, 'exited OK') - t.comment(stderr) - t.similar(JSON.parse(stdout), { - added: [{ - action: 'add', - name: 'baddep', - version: '1.0.0' - }] - }, 'installed bad version') - srv.filteringRequestBody(req => 'ok') - srv.post('/-/npm/v1/security/audits', 'ok').reply(200, { - actions: [{ - action: 'install', - module: 'baddep', - target: '2.0.0', - isMajor: true, - resolves: [{path: 'baddep'}] - }], - metadata: { - vulnerabilities: { - critical: 1 - } - } - }) - return common.npm([ - 'audit', 'fix', - '--package-lock-only', - '--registry', common.registry, - '--force', - '--cache', path.join(testDir, 'npm-cache') - ], EXEC_OPTS).then(([code, stdout, stderr]) => { - t.equal(code, 0, 'exited OK') - t.comment(stderr) - t.match(stdout, /breaking changes/, 'informs about semver-major') - t.similar(JSON.parse(fs.readFileSync(path.join(testDir, 'package-lock.json'), 'utf8')), { - dependencies: { - baddep: { - version: '2.0.0' - } - } - }, 'pkglock not updated') - }) - }) - }) -}) - -test('no installs for review-requires', t => { - const fixture = new Tacks(new Dir({ - 'package.json': new File({ - name: 'foo', - version: '1.0.0', - dependencies: { - baddep: '1.0.0' - } - }) - })) - fixture.create(testDir) - return tmock(t).then(srv => { - srv.filteringRequestBody(req => 'k') - srv.post('/-/npm/v1/security/audits/quick', 'k').reply(200, 'yeah') - srv.get('/baddep').twice().reply(200, { - name: 'baddep', - 'dist-tags': { - 'latest': '1.2.3' - }, - versions: { - '1.0.0': { - name: 'baddep', - version: '1.0.0', - _hasShrinkwrap: false, - dist: { - shasum: 'deadbeef', - tarball: common.registry + '/idk/-/idk-1.0.0.tgz' - } - }, - '1.2.3': { - name: 'baddep', - version: '1.2.3', - _hasShrinkwrap: false, - dist: { - shasum: 'deadbeef', - tarball: common.registry + '/idk/-/idk-1.2.3.tgz' - } - } - } - }) - return common.npm([ - 'install', - '--audit', - '--json', - '--package-lock-only', - '--registry', common.registry, - '--cache', path.join(testDir, 'npm-cache') - ], EXEC_OPTS).then(([code, stdout, stderr]) => { - t.equal(code, 0, 'exited OK') - t.comment(stderr) - t.similar(JSON.parse(stdout), { - added: [{ - action: 'add', - name: 'baddep', - version: '1.0.0' - }] - }, 'installed bad version') - srv.filteringRequestBody(req => 'ok') - srv.post('/-/npm/v1/security/audits', 'ok').reply(200, { - actions: [{ - action: 'review', - module: 'baddep', - target: '1.2.3', - resolves: [{path: 'baddep'}] - }], - metadata: { - vulnerabilities: { - critical: 1 - } - } - }) - return common.npm([ - 'audit', 'fix', - '--package-lock-only', - '--json', - '--registry', common.registry, - '--cache', path.join(testDir, 'npm-cache') - ], EXEC_OPTS).then(([code, stdout, stderr]) => { - t.equal(code, 0, 'exited OK') - t.comment(stderr) - t.similar(JSON.parse(stdout), { - added: [{ - action: 'add', - name: 'baddep', - version: '1.0.0' - }] - }, 'no update for dependency') - }) - }) - }) -}) - -test('nothing to fix', t => { - const fixture = new Tacks(new Dir({ - 'package.json': new File({ - name: 'foo', - version: '1.0.0', - dependencies: { - gooddep: '1.0.0' - } - }) - })) - fixture.create(testDir) - return tmock(t).then(srv => { - srv.filteringRequestBody(req => 'ok') - srv.post('/-/npm/v1/security/audits/quick', 'ok').reply(200, 'yeah') - srv.get('/gooddep').twice().reply(200, { - name: 'gooddep', - 'dist-tags': { - 'latest': '1.2.3' - }, - versions: { - '1.0.0': { - name: 'gooddep', - version: '1.0.0', - _hasShrinkwrap: false, - dist: { - shasum: 'deadbeef', - tarball: common.registry + '/idk/-/idk-1.0.0.tgz' - } - }, - '1.2.3': { - name: 'gooddep', - version: '1.2.3', - _hasShrinkwrap: false, - dist: { - shasum: 'deadbeef', - tarball: common.registry + '/idk/-/idk-1.2.3.tgz' - } - } - } - }) - return common.npm([ - 'install', - '--audit', - '--json', - '--package-lock-only', - '--registry', common.registry, - '--cache', path.join(testDir, 'npm-cache') - ], EXEC_OPTS).then(([code, stdout, stderr]) => { - t.equal(code, 0, 'exited OK') - t.comment(stderr) - t.similar(JSON.parse(stdout), { - added: [{ - action: 'add', - name: 'gooddep', - version: '1.0.0' - }] - }, 'installed good version') - srv.filteringRequestBody(req => 'ok') - srv.post('/-/npm/v1/security/audits', 'ok').reply(200, { - actions: [], - metadata: { - vulnerabilities: { } - } - }) - return common.npm([ - 'audit', 'fix', - '--package-lock-only', - '--json', - '--registry', common.registry, - '--cache', path.join(testDir, 'npm-cache') - ], EXEC_OPTS).then(([code, stdout, stderr]) => { - t.equal(code, 0, 'exited OK') - t.comment(stderr) - t.similar(JSON.parse(stdout), { - added: [{ - action: 'add', - name: 'gooddep', - version: '1.0.0' - }] - }, 'nothing to update') - }) - }) - }) -}) - -test('preserves deep deps dev: true', t => { - const fixture = new Tacks(new Dir({ - 'package.json': new File({ - name: 'foo', - version: '1.0.0', - devDependencies: { - gooddep: '^1.0.0' - } - }) - })) - fixture.create(testDir) - return tmock(t).then(srv => { - srv.filteringRequestBody(req => 'ok') - srv.post('/-/npm/v1/security/audits/quick', 'ok').reply(200, 'yeah') - srv.get('/baddep').reply(200, { - name: 'baddep', - 'dist-tags': { - 'latest': '1.0.0' - }, - versions: { - '1.0.0': { - name: 'baddep', - version: '1.0.0', - _hasShrinkwrap: false, - dist: { - shasum: 'c0ffee', - integrity: 'sha1-c0ffee', - tarball: common.registry + '/baddep/-/baddep-1.0.0.tgz' - } - }, - '1.2.3': { - name: 'baddep', - version: '1.2.3', - _hasShrinkwrap: false, - dist: { - shasum: 'bada55', - integrity: 'sha1-bada55', - tarball: common.registry + '/baddep/-/baddep-1.2.3.tgz' - } - } - } - }) - - srv.get('/gooddep').reply(200, { - name: 'gooddep', - 'dist-tags': { - 'latest': '1.0.0' - }, - versions: { - '1.0.0': { - name: 'gooddep', - version: '1.0.0', - dependencies: { - baddep: '^1.0.0' - }, - _hasShrinkwrap: false, - dist: { - shasum: '1234', - tarball: common.registry + '/gooddep/-/gooddep-1.0.0.tgz' - } - }, - '1.2.3': { - name: 'gooddep', - version: '1.2.3', - _hasShrinkwrap: false, - dependencies: { - baddep: '^1.0.0' - }, - dist: { - shasum: '123456', - tarball: common.registry + '/gooddep/-/gooddep-1.2.3.tgz' - } - } - } - }) - - return common.npm([ - 'install', - '--audit', - '--json', - '--global-style', - '--package-lock-only', - '--registry', common.registry, - '--cache', path.join(testDir, 'npm-cache') - ], EXEC_OPTS).then(([code, stdout, stderr]) => { - t.equal(code, 0, 'exited OK') - t.comment(stderr) - t.similar(JSON.parse(stdout), { - added: [{ - action: 'add', - name: 'baddep', - version: '1.0.0' - }, { - action: 'add', - name: 'gooddep', - version: '1.0.0' - }] - }, 'installed bad version') - srv.filteringRequestBody(req => 'ok') - srv.post('/-/npm/v1/security/audits', 'ok').reply(200, { - actions: [{ - action: 'update', - module: 'baddep', - target: '1.2.3', - resolves: [{path: 'gooddep>baddep'}] - }], - metadata: { - vulnerabilities: { - critical: 1 - } - } - }) - return common.npm([ - 'audit', 'fix', - '--package-lock-only', - '--offline', - '--json', - '--global-style', - '--registry', common.registry, - '--cache', path.join(testDir, 'npm-cache') - ], EXEC_OPTS).then(([code, stdout, stderr]) => { - t.equal(code, 0, 'exited OK') - t.comment(stderr) - t.similar(JSON.parse(stdout), { - added: [{ - action: 'add', - name: 'baddep', - version: '1.2.3' - }, { - action: 'add', - name: 'gooddep', - version: '1.0.0' - }] - }, 'reported dependency update') - t.similar(JSON.parse(fs.readFileSync(path.join(testDir, 'package-lock.json'), 'utf8')), { - dependencies: { - gooddep: { - dev: true, - version: '1.0.0', - resolved: common.registry + '/gooddep/-/gooddep-1.0.0.tgz', - integrity: 'sha1-EjQ=', - requires: { - baddep: '^1.0.0' - }, - dependencies: { - baddep: { - dev: true, - version: '1.2.3', - resolved: common.registry + '/baddep/-/baddep-1.2.3.tgz', - integrity: 'sha1-bada55' - } - } - } - } - }, 'pkglock updated correctly') - }) - }) - }) -}) - -test('cleanup', t => { - return rimraf(testDir) -}) diff --git a/deps/npm/test/tap/audit.js b/deps/npm/test/tap/audit.js deleted file mode 100644 index ca3da87a3af62b..00000000000000 --- a/deps/npm/test/tap/audit.js +++ /dev/null @@ -1,578 +0,0 @@ -'use strict' - -const BB = require('bluebird') - -const common = BB.promisifyAll(require('../common-tap.js')) -const mr = BB.promisify(require('npm-registry-mock')) -const path = require('path') -const rimraf = BB.promisify(require('rimraf')) -const Tacks = require('tacks') -const tap = require('tap') -const test = tap.test - -const Dir = Tacks.Dir -const File = Tacks.File -const testDir = common.pkg - -const EXEC_OPTS = { cwd: testDir } - -function tmock (t) { - return mr({port: common.port}).then(s => { - t.tearDown(function () { - s.done() - s.close() - rimraf.sync(testDir) - }) - return s - }) -} - -const quickAuditResult = { - actions: [], - advisories: { - '1316': { - findings: [ - { - version: '1.0.0', - paths: [ - 'baddep' - ] - } - ], - 'id': 1316, - 'created': '2019-11-14T15:29:41.991Z', - 'updated': '2019-11-14T19:35:30.677Z', - 'deleted': null, - 'title': 'Arbitrary Code Execution', - 'found_by': { - 'link': '', - 'name': 'François Lajeunesse-Robert', - 'email': '' - }, - 'reported_by': { - 'link': '', - 'name': 'François Lajeunesse-Robert', - 'email': '' - }, - 'module_name': 'baddep', - 'cves': [], - 'vulnerable_versions': '<4.5.2', - 'patched_versions': '>=4.5.2', - 'overview': 'a nice overview of the advisory', - 'recommendation': 'how you should fix it', - 'references': '', - 'access': 'public', - 'severity': 'high', - 'cwe': 'CWE-79', - 'metadata': { - 'module_type': '', - 'exploitability': 6, - 'affected_components': '' - }, - 'url': 'https://npmjs.com/advisories/1234542069' - } - }, - 'muted': [], - 'metadata': { - 'vulnerabilities': { - 'info': 0, - 'low': 0, - 'moderate': 0, - 'high': 1, - 'critical': 0 - }, - 'dependencies': 1, - 'devDependencies': 0, - 'totalDependencies': 1 - } -} - -test('exits with zero exit code for vulnerabilities below the `audit-level` flag', t => { - const fixture = new Tacks(new Dir({ - 'package.json': new File({ - name: 'foo', - version: '1.0.0', - dependencies: { - baddep: '1.0.0' - } - }) - })) - fixture.create(testDir) - return tmock(t).then(srv => { - srv.filteringRequestBody(req => 'ok') - srv.post('/-/npm/v1/security/audits/quick', 'ok').reply(200, quickAuditResult) - srv.get('/baddep').twice().reply(200, { - name: 'baddep', - 'dist-tags': { - 'latest': '1.2.3' - }, - versions: { - '1.0.0': { - name: 'baddep', - version: '1.0.0', - _hasShrinkwrap: false, - dist: { - shasum: 'deadbeef', - tarball: common.registry + '/idk/-/idk-1.0.0.tgz' - } - }, - '1.2.3': { - name: 'baddep', - version: '1.2.3', - _hasShrinkwrap: false, - dist: { - shasum: 'deadbeef', - tarball: common.registry + '/idk/-/idk-1.2.3.tgz' - } - } - } - }) - return common.npm([ - 'install', - '--audit', - '--json', - '--package-lock-only', - '--registry', common.registry, - '--cache', path.join(testDir, 'npm-cache') - ], EXEC_OPTS).then(([code, stdout, stderr]) => { - const result = JSON.parse(stdout) - t.same(result.audit, quickAuditResult, 'printed quick audit result') - srv.filteringRequestBody(req => 'ok') - srv.post('/-/npm/v1/security/audits', 'ok').reply(200, { - actions: [{ - action: 'update', - module: 'baddep', - target: '1.2.3', - resolves: [{path: 'baddep'}] - }], - metadata: { - vulnerabilities: { - low: 1 - } - } - }) - return common.npm([ - 'audit', - '--audit-level', 'high', - '--json', - '--registry', common.registry, - '--cache', path.join(testDir, 'npm-cache') - ], EXEC_OPTS).then(([code, stdout, stderr]) => { - t.equal(code, 0, 'exited OK') - }) - }) - }) -}) - -test('shows quick audit results summary for human', t => { - const fixture = new Tacks(new Dir({ - 'package.json': new File({ - name: 'foo', - version: '1.0.0', - dependencies: { - baddep: '1.0.0' - } - }) - })) - fixture.create(testDir) - return tmock(t).then(srv => { - srv.filteringRequestBody(req => 'ok') - srv.post('/-/npm/v1/security/audits/quick', 'ok').reply(200, quickAuditResult) - srv.get('/baddep').twice().reply(200, { - name: 'baddep', - 'dist-tags': { - 'latest': '1.2.3' - }, - versions: { - '1.0.0': { - name: 'baddep', - version: '1.0.0', - _hasShrinkwrap: false, - dist: { - shasum: 'deadbeef', - tarball: common.registry + '/idk/-/idk-1.0.0.tgz' - } - }, - '1.2.3': { - name: 'baddep', - version: '1.2.3', - _hasShrinkwrap: false, - dist: { - shasum: 'deadbeef', - tarball: common.registry + '/idk/-/idk-1.2.3.tgz' - } - } - } - }) - return common.npm([ - 'install', - '--audit', - '--no-json', - '--package-lock-only', - '--registry', common.registry, - '--cache', path.join(testDir, 'npm-cache') - ], EXEC_OPTS).then(([code, stdout, stderr]) => { - t.match(stdout, new RegExp('added 1 package and audited 1 package in .*\\n' + - 'found 1 high severity vulnerability\\n' + - ' run `npm audit fix` to fix them, or `npm audit` for details\\n'), - 'shows quick audit result') - }) - }) -}) - -test('exits with non-zero exit code for vulnerabilities at the `audit-level` flag', t => { - const fixture = new Tacks(new Dir({ - 'package.json': new File({ - name: 'foo', - version: '1.0.0', - dependencies: { - baddep: '1.0.0' - } - }) - })) - fixture.create(testDir) - return tmock(t).then(srv => { - srv.filteringRequestBody(req => 'ok') - srv.post('/-/npm/v1/security/audits/quick', 'ok').reply(200, 'yeah') - srv.get('/baddep').twice().reply(200, { - name: 'baddep', - 'dist-tags': { - 'latest': '1.2.3' - }, - versions: { - '1.0.0': { - name: 'baddep', - version: '1.0.0', - _hasShrinkwrap: false, - dist: { - shasum: 'deadbeef', - tarball: common.registry + '/idk/-/idk-1.0.0.tgz' - } - }, - '1.2.3': { - name: 'baddep', - version: '1.2.3', - _hasShrinkwrap: false, - dist: { - shasum: 'deadbeef', - tarball: common.registry + '/idk/-/idk-1.2.3.tgz' - } - } - } - }) - return common.npm([ - 'install', - '--audit', - '--json', - '--package-lock-only', - '--registry', common.registry, - '--cache', path.join(testDir, 'npm-cache') - ], EXEC_OPTS).then(([code, stdout, stderr]) => { - srv.filteringRequestBody(req => 'ok') - srv.post('/-/npm/v1/security/audits', 'ok').reply(200, { - actions: [{ - action: 'update', - module: 'baddep', - target: '1.2.3', - resolves: [{path: 'baddep'}] - }], - metadata: { - vulnerabilities: { - high: 1 - } - } - }) - return common.npm([ - 'audit', - '--audit-level', 'high', - '--json', - '--registry', common.registry, - '--cache', path.join(testDir, 'npm-cache') - ], EXEC_OPTS).then(([code, stdout, stderr]) => { - t.equal(code, 1, 'exited OK') - }) - }) - }) -}) - -test('exits with non-zero exit code for vulnerabilities at the `audit-level` flag', t => { - const fixture = new Tacks(new Dir({ - 'package.json': new File({ - name: 'foo', - version: '1.0.0', - dependencies: { - baddep: '1.0.0' - } - }) - })) - fixture.create(testDir) - return tmock(t).then(srv => { - srv.filteringRequestBody(req => 'ok') - srv.post('/-/npm/v1/security/audits/quick', 'ok').reply(200, 'yeah') - srv.get('/baddep').twice().reply(200, { - name: 'baddep', - 'dist-tags': { - 'latest': '1.2.3' - }, - versions: { - '1.0.0': { - name: 'baddep', - version: '1.0.0', - _hasShrinkwrap: false, - dist: { - shasum: 'deadbeef', - tarball: common.registry + '/idk/-/idk-1.0.0.tgz' - } - }, - '1.2.3': { - name: 'baddep', - version: '1.2.3', - _hasShrinkwrap: false, - dist: { - shasum: 'deadbeef', - tarball: common.registry + '/idk/-/idk-1.2.3.tgz' - } - } - } - }) - return common.npm([ - 'install', - '--audit', - '--json', - '--package-lock-only', - '--registry', common.registry, - '--cache', path.join(testDir, 'npm-cache') - ], EXEC_OPTS).then(([code, stdout, stderr]) => { - srv.filteringRequestBody(req => 'ok') - srv.post('/-/npm/v1/security/audits', 'ok').reply(200, { - actions: [{ - action: 'update', - module: 'baddep', - target: '1.2.3', - resolves: [{path: 'baddep'}] - }], - metadata: { - vulnerabilities: { - high: 1 - } - } - }) - return common.npm([ - 'audit', - '--audit-level', 'moderate', - '--json', - '--registry', common.registry, - '--cache', path.join(testDir, 'npm-cache') - ], EXEC_OPTS).then(([code, stdout, stderr]) => { - t.equal(code, 1, 'exited OK') - }) - }) - }) -}) - -test('exits with zero exit code for vulnerabilities in devDependencies when running with production flag', t => { - const fixture = new Tacks(new Dir({ - 'package.json': new File({ - name: 'foo', - version: '1.0.0', - dependencies: { - gooddep: '1.0.0' - }, - devDependencies: { - baddep: '1.0.0' - } - }) - })) - fixture.create(testDir) - return tmock(t).then(srv => { - srv.filteringRequestBody(req => 'ok') - srv.post('/-/npm/v1/security/audits/quick', 'ok').reply(200, 'yeah') - srv.get('/gooddep').twice().reply(200, { - name: 'gooddep', - 'dist-tags': { - 'latest': '1.2.3' - }, - versions: { - '1.0.0': { - name: 'gooddep', - version: '1.0.0', - _hasShrinkwrap: false, - dist: { - shasum: 'deadbeef', - tarball: common.registry + '/idk/-/idk-1.0.0.tgz' - } - }, - '1.2.3': { - name: 'gooddep', - version: '1.2.3', - _hasShrinkwrap: false, - dist: { - shasum: 'deadbeef', - tarball: common.registry + '/idk/-/idk-1.2.3.tgz' - } - } - } - }) - srv.get('/baddep').twice().reply(200, { - name: 'baddep', - 'dist-tags': { - 'latest': '1.2.3' - }, - versions: { - '1.0.0': { - name: 'baddep', - version: '1.0.0', - _hasShrinkwrap: false, - dist: { - shasum: 'deadbeef', - tarball: common.registry + '/idk/-/idk-1.0.0.tgz' - } - }, - '1.2.3': { - name: 'baddep', - version: '1.2.3', - _hasShrinkwrap: false, - dist: { - shasum: 'deadbeef', - tarball: common.registry + '/idk/-/idk-1.2.3.tgz' - } - } - } - }) - return common.npm([ - 'install', - '--audit', - '--json', - '--production', - '--package-lock-only', - '--registry', common.registry, - '--cache', path.join(testDir, 'npm-cache') - ], EXEC_OPTS).then(([code, stdout, stderr]) => { - srv.filteringRequestBody(req => 'ok') - srv.post('/-/npm/v1/security/audits', 'ok').reply(200, { - actions: [], - metadata: { - vulnerabilities: {} - } - }) - return common.npm([ - 'audit', - '--json', - '--production', - '--registry', common.registry, - '--cache', path.join(testDir, 'npm-cache') - ], EXEC_OPTS).then(([code, stdout, stderr]) => { - t.equal(code, 0, 'exited OK') - }) - }) - }) -}) - -test('exits with non-zero exit code for vulnerabilities in dependencies when running with production flag', t => { - const fixture = new Tacks(new Dir({ - 'package.json': new File({ - name: 'foo', - version: '1.0.0', - dependencies: { - baddep: '1.0.0' - }, - devDependencies: { - gooddep: '1.0.0' - } - }) - })) - fixture.create(testDir) - return tmock(t).then(srv => { - srv.filteringRequestBody(req => 'ok') - srv.post('/-/npm/v1/security/audits/quick', 'ok').reply(200, 'yeah') - srv.get('/baddep').twice().reply(200, { - name: 'baddep', - 'dist-tags': { - 'latest': '1.2.3' - }, - versions: { - '1.0.0': { - name: 'baddep', - version: '1.0.0', - _hasShrinkwrap: false, - dist: { - shasum: 'deadbeef', - tarball: common.registry + '/idk/-/idk-1.0.0.tgz' - } - }, - '1.2.3': { - name: 'baddep', - version: '1.2.3', - _hasShrinkwrap: false, - dist: { - shasum: 'deadbeef', - tarball: common.registry + '/idk/-/idk-1.2.3.tgz' - } - } - } - }) - srv.get('/gooddep').twice().reply(200, { - name: 'gooddep', - 'dist-tags': { - 'latest': '1.2.3' - }, - versions: { - '1.0.0': { - name: 'gooddep', - version: '1.0.0', - _hasShrinkwrap: false, - dist: { - shasum: 'deadbeef', - tarball: common.registry + '/idk/-/idk-1.0.0.tgz' - } - }, - '1.2.3': { - name: 'gooddep', - version: '1.2.3', - _hasShrinkwrap: false, - dist: { - shasum: 'deadbeef', - tarball: common.registry + '/idk/-/idk-1.2.3.tgz' - } - } - } - }) - return common.npm([ - 'install', - '--audit', - '--json', - '--production', - '--package-lock-only', - '--registry', common.registry, - '--cache', path.join(testDir, 'npm-cache') - ], EXEC_OPTS).then(([code, stdout, stderr]) => { - srv.filteringRequestBody(req => 'ok') - srv.post('/-/npm/v1/security/audits', 'ok').reply(200, { - actions: [{ - action: 'update', - module: 'baddep', - target: '1.2.3', - resolves: [{path: 'baddep'}] - }], - metadata: { - vulnerabilities: { - low: 1 - } - } - }) - return common.npm([ - 'audit', - '--json', - '--production', - '--registry', common.registry, - '--cache', path.join(testDir, 'npm-cache') - ], EXEC_OPTS).then(([code, stdout, stderr]) => { - t.equal(code, 1, 'exited OK') - }) - }) - }) -}) - -test('cleanup', t => { - return rimraf(testDir) -}) diff --git a/deps/npm/test/tap/auto-prune.js b/deps/npm/test/tap/auto-prune.js deleted file mode 100644 index aab3692a3b242d..00000000000000 --- a/deps/npm/test/tap/auto-prune.js +++ /dev/null @@ -1,147 +0,0 @@ -'use strict' -const path = require('path') -const test = require('tap').test -const mr = require('npm-registry-mock') -const Tacks = require('tacks') -const File = Tacks.File -const Dir = Tacks.Dir -const common = require('../common-tap.js') - -const basedir = common.pkg -const testdir = path.join(basedir, 'testdir') -const cachedir = common.cache -const globaldir = path.join(basedir, 'global') -const tmpdir = path.join(basedir, 'tmp') - -const conf = { - cwd: testdir, - env: Object.assign({}, process.env, { - npm_config_cache: cachedir, - npm_config_tmp: tmpdir, - npm_config_prefix: globaldir, - npm_config_registry: common.registry, - npm_config_loglevel: 'warn' - }) -} - -let server -const fixture = new Tacks(Dir({ - cache: Dir(), - global: Dir(), - tmp: Dir(), - testdir: Dir({ - node_modules: Dir({ - minimist: Dir({ - 'package.json': File({ - _integrity: 'sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=', - _resolved: 'https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz', - name: 'minimist', - version: '0.0.8' - }) - }), - mkdirp: Dir({ - 'package.json': File({ - _integrity: 'sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=', - _resolved: 'https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz', - dependencies: { - minimist: '0.0.8' - }, - name: 'mkdirp', - version: '0.5.1' - }) - }), - null: Dir({ - 'package.json': File({ - _integrity: 'sha1-WoIdUnAxMlyG06AasQFzKgkfoew=', - _resolved: 'https://registry.npmjs.org/null/-/null-1.0.1.tgz', - _spec: 'null', - name: 'null', - version: '1.0.1' - }) - }) - }), - 'package-lock.json': File({ - name: 'with-lock', - version: '1.0.0', - lockfileVersion: 1, - requires: true, - dependencies: { - minimist: { - version: '0.0.8', - resolved: 'https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz', - integrity: 'sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=' - }, - mkdirp: { - version: '0.5.1', - resolved: 'https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz', - integrity: 'sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=', - requires: { - minimist: '0.0.8' - } - } - } - }), - 'package.json': File({ - name: 'with-lock', - version: '1.0.0', - dependencies: { - mkdirp: '^0.5.1' - } - }) - }) -})) - -function setup () { - cleanup() - fixture.create(basedir) -} - -function cleanup () { - fixture.remove(basedir) -} - -test('setup', function (t) { - setup() - mr({port: common.port, throwOnUnmatched: true}, function (err, s) { - if (err) throw err - server = s - t.done() - }) -}) - -test('auto-prune w/ package-lock', function (t) { - common.npm(['install', '--dry-run', '--json'], conf, function (err, code, stdout, stderr) { - if (err) throw err - t.is(code, 0, 'command ran ok') - t.comment(stderr.trim()) - const result = JSON.parse(stdout) - t.is(result.added.length, 0, 'nothing added') - t.is(result.updated.length, 0, 'nothing updated') - t.is(result.moved.length, 0, 'nothing moved') - t.is(result.failed.length, 0, 'nothing failed') - t.is(result.removed.length, 1, 'pruned 1') - t.like(result, {'removed': [{'name': 'null'}]}, 'pruned the right one') - t.done() - }) -}) - -test('auto-prune w/ --no-package-lock', function (t) { - common.npm(['install', '--dry-run', '--json', '--no-package-lock'], conf, function (err, code, stdout, stderr) { - if (err) throw err - t.is(code, 0, 'command ran ok') - t.comment(stderr.trim()) - const result = JSON.parse(stdout) - t.is(result.added.length, 0, 'nothing added') - t.is(result.updated.length, 0, 'nothing updated') - t.is(result.moved.length, 0, 'nothing moved') - t.is(result.failed.length, 0, 'nothing failed') - t.is(result.removed.length, 0, 'nothing pruned') - t.done() - }) -}) - -test('cleanup', function (t) { - server.close() - cleanup() - t.done() -}) diff --git a/deps/npm/test/tap/bearer-token-check.js b/deps/npm/test/tap/bearer-token-check.js deleted file mode 100644 index 86602b303c9f0d..00000000000000 --- a/deps/npm/test/tap/bearer-token-check.js +++ /dev/null @@ -1,109 +0,0 @@ -var resolve = require('path').resolve -var writeFileSync = require('graceful-fs').writeFileSync - -var fs = require('fs') -var mkdirp = require('mkdirp') -var http = require('http') -const t = require('tap') - -var common = require('../common-tap.js') -var toNerfDart = require('../../lib/config/nerf-dart.js') - -var pkg = common.pkg -var outfile = resolve(pkg, '_npmrc') -var modules = resolve(pkg, 'node_modules') -var tarballPath = '/scoped-underscore/-/scoped-underscore-1.3.1.tgz' -// needs to be a different hostname to verify tokens (not) being sent correctly -var tarballURL = 'http://127.0.0.1:' + common.port + tarballPath -var tarball = resolve(__dirname, '../fixtures/scoped-underscore-1.3.1.tgz') - -var EXEC_OPTS = { cwd: pkg, stdio: [0, 'pipe', 2] } - -var auth = 'Bearer 0xabad1dea' -var server = http.createServer() -server.on('request', (req, res) => { - if (req.method === 'GET' && req.url === tarballPath) { - if (req.headers.authorization === auth) { - res.writeHead(403, 'this token should not be sent') - res.end() - } else { - res.writeHead(200, 'ok') - res.end(fs.readFileSync(tarball)) - } - } else { - res.writeHead(500) - res.end() - } -}) - -var contents = '@scoped:registry=' + common.registry + '\n' + - toNerfDart(common.registry) + ':_authToken=0xabad1dea\n' - -var json = { - name: 'test-package-install', - version: '1.0.0', - dependencies: { - '@scoped/underscore': '1.3.1' - } -} - -var shrinkwrap = { - name: 'test-package-install', - version: '1.0.0', - dependencies: { - '@scoped/underscore': { - resolved: tarballURL, - version: '1.3.1' - } - } -} - -t.teardown(() => server.close()) - -t.test('setup', function (t) { - mkdirp.sync(modules) - writeFileSync(resolve(pkg, 'package.json'), JSON.stringify(json, null, 2) + '\n') - writeFileSync(outfile, contents) - writeFileSync( - resolve(pkg, 'npm-shrinkwrap.json'), - JSON.stringify(shrinkwrap, null, 2) + '\n' - ) - server.listen(common.port, t.end) -}) - -t.test('authed npm install with tarball not on registry', function (t) { - common.npm( - [ - 'install', - '--json', - '--fetch-retries', 0, - '--registry', common.registry, - '--userconfig', outfile - ], - EXEC_OPTS, - function (err, code, stdout, stderr) { - if (err) throw err - t.equal(code, 0, 'npm install exited OK') - t.comment(stdout.trim()) - t.comment(stderr.trim()) - t.notOk(stderr, 'no output on stderr') - try { - var results = JSON.parse(stdout) - } catch (ex) { - t.ifError(ex, 'stdout was valid JSON') - } - - if (results) { - var installedversion = [ - { - 'name': '@scoped/underscore', - 'version': '1.3.1' - } - ] - t.match(results.added, installedversion, '@scoped/underscore installed') - } - - t.end() - } - ) -}) diff --git a/deps/npm/test/tap/bin-overwriting.js b/deps/npm/test/tap/bin-overwriting.js deleted file mode 100644 index faaa78745a7423..00000000000000 --- a/deps/npm/test/tap/bin-overwriting.js +++ /dev/null @@ -1,108 +0,0 @@ -const t = require('tap') -const common = require('../common-tap.js') -const pkg = common.pkg - -const { writeFileSync, readFileSync, readlink } = require('fs') -const readCmdShim = require('read-cmd-shim') -const path = require('path') -const readBinCb = process.platform === 'win32' ? readCmdShim : readlink -const readBin = bin => new Promise((resolve, reject) => { - readBinCb(bin, (er, target) => { - if (er) { - reject(er) - } else { - resolve(path.resolve(path.dirname(bin), target)) - } - }) -}) - -// verify that we can't overwrite bins that we shouldn't be able to - -const mkdirp = require('mkdirp').sync - -process.env.npm_config_prefix = pkg + '/global' -process.env.npm_config_global = true - -const globalBin = process.platform === 'win32' - ? path.resolve(pkg, 'global') - : path.resolve(pkg, 'global/bin') - -const globalDir = process.platform === 'win32' - ? path.resolve(pkg, 'global/node_modules') - : path.resolve(pkg, 'global/lib/node_modules') - -const beep = path.resolve(globalBin, 'beep') -const firstBin = path.resolve(globalDir, 'first/first.js') -const secondBin = path.resolve(globalDir, 'second/second.js') - -t.test('setup', { bail: true }, t => { - // set up non-link bin in place - mkdirp(globalBin) - writeFileSync(beep, 'beep boop') - - // create first package - mkdirp(pkg + '/first') - writeFileSync(pkg + '/first/package.json', JSON.stringify({ - name: 'first', - version: '1.0.0', - bin: { beep: 'first.js' } - })) - writeFileSync(pkg + '/first/first.js', `#!/usr/bin/env node - console.log('first')`) - - // create second package - mkdirp(pkg + '/second') - writeFileSync(pkg + '/second/package.json', JSON.stringify({ - name: 'second', - version: '1.0.0', - bin: { beep: 'second.js' } - })) - writeFileSync(pkg + '/second/second.js', `#!/usr/bin/env node - console.log('second')`) - - // pack both to install globally - return common.npm(['pack'], { cwd: pkg + '/first' }) - .then(() => common.npm(['pack'], { cwd: pkg + '/second' })) -}) - -t.test('installing first fails, because pre-existing bin in place', t => { - return common.npm([ - 'install', - pkg + '/first/first-1.0.0.tgz' - ]).then(([code, stdout, stderr]) => { - t.notEqual(code, 0) - t.match(stderr, 'EEXIST') - t.equal(readFileSync(beep, 'utf8'), 'beep boop') - }) -}) - -t.test('installing first with --force succeeds', t => { - return common.npm([ - 'install', - pkg + '/first/first-1.0.0.tgz', - '--force' - ]).then(() => { - return t.resolveMatch(readBin(beep), firstBin, 'bin written to first.js') - }) -}) - -t.test('installing second fails, because bin links to other package', t => { - return common.npm([ - 'install', - pkg + '/second/second-1.0.0.tgz' - ]).then(([code, stdout, stderr]) => { - t.notEqual(code, 0) - t.match(stderr, 'EEXIST') - return t.resolveMatch(readBin(beep), firstBin, 'bin still linked to first') - }) -}) - -t.test('installing second with --force succeeds', t => { - return common.npm([ - 'install', - pkg + '/second/second-1.0.0.tgz', - '--force' - ]).then(() => { - return t.resolveMatch(readBin(beep), secondBin, 'bin written to second.js') - }) -}) diff --git a/deps/npm/test/tap/bin.js b/deps/npm/test/tap/bin.js deleted file mode 100644 index bf2397777ce402..00000000000000 --- a/deps/npm/test/tap/bin.js +++ /dev/null @@ -1,23 +0,0 @@ -var path = require('path') -var test = require('tap').test -var rimraf = require('rimraf') -var common = require('../common-tap.js') -var opts = { cwd: common.pkg } -var binDir = '../../../node_modules/.bin' -var fixture = path.resolve(common.pkg, binDir) - -test('setup', function (t) { - rimraf.sync(path.join(common.pkg, 'node_modules')) - t.end() -}) - -test('npm bin', function (t) { - common.npm(['bin'], opts, function (err, code, stdout, stderr) { - t.ifError(err, 'bin ran without issue') - t.notOk(stderr, 'should have no stderr') - t.equal(code, 0, 'exit ok') - var res = path.resolve(stdout) - t.equal(res, fixture + '\n') - t.end() - }) -}) diff --git a/deps/npm/test/tap/bitbucket-https-url-with-creds-package.js b/deps/npm/test/tap/bitbucket-https-url-with-creds-package.js deleted file mode 100644 index f0f14dcb344755..00000000000000 --- a/deps/npm/test/tap/bitbucket-https-url-with-creds-package.js +++ /dev/null @@ -1,70 +0,0 @@ -'use strict' - -const BB = require('bluebird') - -var fs = require('graceful-fs') -var path = require('path') - -var requireInject = require('require-inject') -var test = require('tap').test - -var common = require('../common-tap.js') - -var pkg = common.pkg - -var json = { - name: 'bitbucket-https-url-with-creds-package', - version: '0.0.0', - dependencies: { - 'private': 'git+https://user:pass@bitbucket.org/foo/private.git' - } -} - -test('setup', function (t) { - setup() - t.end() -}) - -test('bitbucket-https-url-with-creds-package', function (t) { - var cloneUrls = [ - ['https://user:pass@bitbucket.org/foo/private.git', 'Bitbucket URLs with passwords try only that.'] - ] - - var npm = requireInject.installGlobally('../../lib/npm.js', { - 'pacote/lib/util/git': { - 'revs': (repo, opts) => { - return BB.resolve().then(() => { - var cloneUrl = cloneUrls.shift() - if (cloneUrl) { - t.is(repo, cloneUrl[0], cloneUrl[1]) - } else { - t.fail('too many attempts to clone') - } - throw new Error('git.revs mock fails on purpose') - }) - } - } - }) - - var opts = { - cache: common.cache, - prefix: pkg, - registry: common.registry, - loglevel: 'silent' - } - npm.load(opts, function (er) { - t.ifError(er, 'npm loaded without error') - npm.commands.install([], function (err) { - t.match(err.message, /mock fails on purpose/, 'mocked install failed as expected') - t.end() - }) - }) -}) - -function setup () { - fs.writeFileSync( - path.join(pkg, 'package.json'), - JSON.stringify(json, null, 2) - ) - process.chdir(pkg) -} diff --git a/deps/npm/test/tap/bitbucket-https-url-with-creds.js b/deps/npm/test/tap/bitbucket-https-url-with-creds.js deleted file mode 100644 index 703d0d9a6ab60a..00000000000000 --- a/deps/npm/test/tap/bitbucket-https-url-with-creds.js +++ /dev/null @@ -1,69 +0,0 @@ -'use strict' - -const BB = require('bluebird') - -var fs = require('graceful-fs') -var path = require('path') - -var mkdirp = require('mkdirp') -var requireInject = require('require-inject') -var test = require('tap').test - -var common = require('../common-tap.js') - -var pkg = common.pkg - -var json = { - name: 'bitbucket-https-url-with-creds', - version: '0.0.0' -} - -test('setup', function (t) { - setup() - t.end() -}) - -test('bitbucket-https-url-with-creds', function (t) { - var cloneUrls = [ - ['https://user:pass@bitbucket.org/foo/private.git', 'Bitbucket URLs with passwords try only that.'] - ] - - var npm = requireInject.installGlobally('../../lib/npm.js', { - 'pacote/lib/util/git': { - 'revs': (repo, opts) => { - return BB.resolve().then(() => { - var cloneUrl = cloneUrls.shift() - if (cloneUrl) { - t.is(repo, cloneUrl[0], cloneUrl[1]) - } else { - t.fail('too many attempts to clone') - } - throw new Error('git.revs mock fails on purpose') - }) - } - } - }) - - var opts = { - cache: common.cache, - prefix: pkg, - registry: common.registry, - loglevel: 'silent' - } - npm.load(opts, function (er) { - t.ifError(er, 'npm loaded without error') - npm.commands.install(['git+https://user:pass@bitbucket.org/foo/private.git'], function (err) { - t.match(err, /mock fails on purpose/, 'mocked install failed as expected') - t.end() - }) - }) -}) - -function setup () { - mkdirp.sync(pkg) - fs.writeFileSync( - path.join(pkg, 'package.json'), - JSON.stringify(json, null, 2) - ) - process.chdir(pkg) -} diff --git a/deps/npm/test/tap/bitbucket-shortcut-package.js b/deps/npm/test/tap/bitbucket-shortcut-package.js deleted file mode 100644 index a148c598c68705..00000000000000 --- a/deps/npm/test/tap/bitbucket-shortcut-package.js +++ /dev/null @@ -1,73 +0,0 @@ -'use strict' - -const BB = require('bluebird') - -var fs = require('graceful-fs') -var path = require('path') - -var mkdirp = require('mkdirp') -var requireInject = require('require-inject') -var test = require('tap').test - -var common = require('../common-tap.js') - -var pkg = common.pkg - -var json = { - name: 'bitbucket-shortcut-package', - version: '0.0.0', - dependencies: { - 'private': 'bitbucket:foo/private' - } -} - -test('setup', function (t) { - setup() - t.end() -}) - -test('bitbucket-shortcut', function (t) { - var cloneUrls = [ - ['https://bitbucket.org/foo/private.git', 'Bitbucket shortcuts try HTTPS URLs first'], - ['ssh://git@bitbucket.org/foo/private.git', 'Bitbucket shortcuts try SSH second'] - ] - - var npm = requireInject.installGlobally('../../lib/npm.js', { - 'pacote/lib/util/git': { - 'revs': (repo, opts) => { - return BB.resolve().then(() => { - var cloneUrl = cloneUrls.shift() - if (cloneUrl) { - t.is(repo, cloneUrl[0], cloneUrl[1]) - } else { - t.fail('too many attempts to clone') - } - throw new Error('git.revs mock fails on purpose') - }) - } - } - }) - - var opts = { - cache: common.cache, - prefix: pkg, - registry: common.registry, - loglevel: 'silent' - } - npm.load(opts, function (er) { - t.ifError(er, 'npm loaded without error') - npm.commands.install([], function (err) { - t.match(err.message, /fails on purpose/, 'mocked install failed as expected') - t.end() - }) - }) -}) - -function setup () { - mkdirp.sync(pkg) - fs.writeFileSync( - path.join(pkg, 'package.json'), - JSON.stringify(json, null, 2) - ) - process.chdir(pkg) -} diff --git a/deps/npm/test/tap/bitbucket-shortcut.js b/deps/npm/test/tap/bitbucket-shortcut.js deleted file mode 100644 index 6d750f869a306c..00000000000000 --- a/deps/npm/test/tap/bitbucket-shortcut.js +++ /dev/null @@ -1,70 +0,0 @@ -'use strict' - -const BB = require('bluebird') - -var fs = require('graceful-fs') -var path = require('path') - -var mkdirp = require('mkdirp') -var requireInject = require('require-inject') -var test = require('tap').test - -var common = require('../common-tap.js') - -var pkg = common.pkg - -var json = { - name: 'bitbucket-shortcut', - version: '0.0.0' -} - -test('setup', function (t) { - setup() - t.end() -}) - -test('bitbucket-shortcut', function (t) { - var cloneUrls = [ - ['https://bitbucket.org/foo/private.git', 'Bitbucket shortcuts try HTTPS URLs first'], - ['ssh://git@bitbucket.org/foo/private.git', 'Bitbucket shortcuts try SSH second'] - ] - - var npm = requireInject.installGlobally('../../lib/npm.js', { - 'pacote/lib/util/git': { - 'revs': (repo, opts) => { - return BB.resolve().then(() => { - var cloneUrl = cloneUrls.shift() - if (cloneUrl) { - t.is(repo, cloneUrl[0], cloneUrl[1]) - } else { - t.fail('too many attempts to clone') - } - throw new Error('git.revs mock fails on purpose') - }) - } - } - }) - - var opts = { - cache: common.cache, - prefix: pkg, - registry: common.registry, - loglevel: 'silent' - } - npm.load(opts, function (er) { - t.ifError(er, 'npm loaded without error') - npm.commands.install(['bitbucket:foo/private'], function (err) { - t.match(err.message, /mock fails on purpose/, 'mocked install failed as expected') - t.end() - }) - }) -}) - -function setup () { - mkdirp.sync(pkg) - fs.writeFileSync( - path.join(pkg, 'package.json'), - JSON.stringify(json, null, 2) - ) - process.chdir(pkg) -} diff --git a/deps/npm/test/tap/bugs.js b/deps/npm/test/tap/bugs.js deleted file mode 100644 index 8e2685220dd936..00000000000000 --- a/deps/npm/test/tap/bugs.js +++ /dev/null @@ -1,172 +0,0 @@ -var common = require('../common-tap.js') -common.pendIfWindows('not working because Windows and shebangs') - -var mr = require('npm-registry-mock') - -var test = require('tap').test -var rimraf = require('rimraf') -var fs = require('fs') -var path = require('path') -var join = path.join -var outFile = path.join(common.pkg, '/_output') - -var opts = { cwd: common.pkg } - -test('setup', function (t) { - var s = '#!/usr/bin/env bash\n' + - 'echo "$@" > ' + JSON.stringify(common.pkg) + '/_output\n' - fs.writeFileSync(join(common.pkg, '/_script.sh'), s, 'ascii') - fs.chmodSync(join(common.pkg, '/_script.sh'), '0755') - t.pass('made script') - t.end() -}) - -test('npm bugs underscore', function (t) { - mr({ port: common.port }, function (er, s) { - common.npm( - [ - 'bugs', 'underscore', - '--registry=' + common.registry, - '--loglevel=silent', - '--browser=' + join(common.pkg, '/_script.sh') - ], - opts, - function (err, code, stdout, stderr) { - t.ifError(err, 'bugs ran without issue') - t.notOk(stderr, 'should have no stderr') - t.equal(code, 0, 'exit ok') - var res = fs.readFileSync(outFile, 'ascii') - s.close() - t.equal(res, 'https://github.com/jashkenas/underscore/issues\n') - rimraf.sync(outFile) - t.end() - } - ) - }) -}) - -test('npm bugs optimist - github (https://)', function (t) { - mr({ port: common.port }, function (er, s) { - common.npm( - [ - 'bugs', 'optimist', - '--registry=' + common.registry, - '--loglevel=silent', - '--browser=' + join(common.pkg, '/_script.sh') - ], - opts, - function (err, code, stdout, stderr) { - t.ifError(err, 'bugs ran without issue') - t.notOk(stderr, 'should have no stderr') - t.equal(code, 0, 'exit ok') - var res = fs.readFileSync(outFile, 'ascii') - s.close() - t.equal(res, 'https://github.com/substack/node-optimist/issues\n') - rimraf.sync(outFile) - t.end() - } - ) - }) -}) - -test('npm bugs npm-test-peer-deps - no repo', function (t) { - mr({ port: common.port }, function (er, s) { - common.npm( - [ - 'bugs', 'npm-test-peer-deps', - '--registry=' + common.registry, - '--loglevel=silent', - '--browser=' + join(common.pkg, '/_script.sh') - ], - opts, - function (err, code, stdout, stderr) { - t.ifError(err, 'bugs ran without issue') - t.notOk(stderr, 'should have no stderr') - t.equal(code, 0, 'exit ok') - var res = fs.readFileSync(outFile, 'ascii') - s.close() - t.equal(res, 'https://www.npmjs.org/package/npm-test-peer-deps\n') - rimraf.sync(outFile) - t.end() - } - ) - }) -}) - -test('npm bugs test-repo-url-http - non-github (http://)', function (t) { - mr({ port: common.port }, function (er, s) { - common.npm( - [ - 'bugs', 'test-repo-url-http', - '--registry=' + common.registry, - '--loglevel=silent', - '--browser=' + join(common.pkg, '/_script.sh') - ], - opts, - function (err, code, stdout, stderr) { - t.ifError(err, 'bugs ran without issue') - t.notOk(stderr, 'should have no stderr') - t.equal(code, 0, 'exit ok') - var res = fs.readFileSync(outFile, 'ascii') - s.close() - t.equal(res, 'https://www.npmjs.org/package/test-repo-url-http\n') - rimraf.sync(outFile) - t.end() - } - ) - }) -}) - -test('npm bugs test-repo-url-https - gitlab (https://)', function (t) { - mr({ port: common.port }, function (er, s) { - common.npm( - [ - 'bugs', 'test-repo-url-https', - '--registry=' + common.registry, - '--loglevel=silent', - '--browser=' + join(common.pkg, '/_script.sh') - ], - opts, - function (err, code, stdout, stderr) { - t.ifError(err, 'bugs ran without issue') - t.notOk(stderr, 'should have no stderr') - t.equal(code, 0, 'exit ok') - var res = fs.readFileSync(outFile, 'ascii') - s.close() - t.equal(res, 'https://gitlab.com/evanlucas/test-repo-url-https/issues\n') - rimraf.sync(outFile) - t.end() - } - ) - }) -}) - -test('npm bugs test-repo-url-ssh - gitlab (ssh://)', function (t) { - mr({ port: common.port }, function (er, s) { - common.npm( - [ - 'bugs', 'test-repo-url-ssh', - '--registry=' + common.registry, - '--loglevel=silent', - '--browser=' + join(common.pkg, '/_script.sh') - ], - opts, - function (err, code, stdout, stderr) { - t.ifError(err, 'bugs ran without issue') - t.notOk(stderr, 'should have no stderr') - t.equal(code, 0, 'exit ok') - var res = fs.readFileSync(outFile, 'ascii') - s.close() - t.equal(res, 'https://gitlab.com/evanlucas/test-repo-url-ssh/issues\n') - rimraf.sync(outFile) - t.end() - } - ) - }) -}) - -test('cleanup', function (t) { - rimraf.sync(common.pkg) - t.pass('cleaned up') - t.end() -}) diff --git a/deps/npm/test/tap/build-already-built.js b/deps/npm/test/tap/build-already-built.js deleted file mode 100644 index 3410432ab22448..00000000000000 --- a/deps/npm/test/tap/build-already-built.js +++ /dev/null @@ -1,60 +0,0 @@ -// if "npm rebuild" is run with bundled dependencies, -// message "already built" should not be error -var test = require('tap').test -var path = require('path') -var npmlog = require('npmlog') -var mkdirp = require('mkdirp') -var requireInject = require('require-inject') - -var npm = require('../../lib/npm.js') - -const common = require('../common-tap.js') -var PKG_DIR = common.pkg -var fakePkg = path.resolve(PKG_DIR, 'foo') - -test("issue #6735 build 'already built' message", function (t) { - npm.load({ loglevel: 'warn' }, function () { - // capture log messages with level - var log = '' - npmlog.on('log', function (chunk) { - log += chunk.level + ' ' + chunk.message + '\n' - }) - - mkdirp.sync(fakePkg) - var folder = path.resolve(fakePkg) - - var global = npm.config.get('global') - - var build = requireInject('../../lib/build', { - }) - - t.test('pin previous behavior', function (t) { - build([fakePkg], global, false, false, function (err) { - t.ok(err, 'build failed as expected') - t.similar(err.message, /package.json/, 'missing package.json as expected') - t.notSimilar(log, /already built/, 'no already built message written') - - t.end() - }) - }) - - t.test('simulate rebuild of bundledDependency', function (t) { - log = '' - - build._didBuild[folder] = true - - build([fakePkg], global, false, false, function (err) { - t.ok(err, 'build failed as expected') - t.similar(err.message, /package.json/, 'missing package.json as expected') - - t.similar(log, /already built/, 'already built message written') - t.notSimilar(log, /ERR! already built/, 'already built message written is not error') - t.similar(log, /info already built/, 'already built message written is info') - - t.end() - }) - }) - - t.end() - }) -}) diff --git a/deps/npm/test/tap/builtin-config.js b/deps/npm/test/tap/builtin-config.js deleted file mode 100644 index dddd40565101a8..00000000000000 --- a/deps/npm/test/tap/builtin-config.js +++ /dev/null @@ -1,136 +0,0 @@ -var fs = require('fs') - -if (process.argv[2] === 'write-builtin') { - var pid = process.argv[3] - fs.writeFileSync('npmrc', 'foo=bar\npid=' + pid + '\n') - process.exit(0) -} - -var common = require('../common-tap.js') -var path = require('path') -var rimraf = require('rimraf') -var mkdirp = require('mkdirp') -var folder = common.pkg -var test = require('tap').test -var npm = path.resolve(__dirname, '../..') -var spawn = require('child_process').spawn -var node = common.nodeBin - -test('setup', function (t) { - t.plan(1) - rimraf.sync(folder) - mkdirp.sync(folder + '/first') - mkdirp.sync(folder + '/second') - mkdirp.sync(folder + '/cache') - mkdirp.sync(folder + '/tmp') - - t.pass('finished setup') - t.end() -}) - -test('install npm into first folder', function (t) { - t.plan(1) - var args = ['install', npm, '-g', - '--prefix=' + folder + '/first', - '--ignore-scripts', - '--cache=' + folder + '/cache', - '--tmp=' + folder + '/tmp', - '--loglevel=warn', - '--progress'] - common.npm(args, {}, function (er, code) { - if (er) throw er - t.equal(code, 0) - t.end() - }) -}) - -test('write npmrc file', function (t) { - t.plan(1) - common.npm(['explore', 'npm', '-g', - '--prefix=' + folder + '/first', - '--cache=' + folder + '/cache', - '--tmp=' + folder + '/tmp', - '--', node, __filename, 'write-builtin', process.pid - ], - {'stdio': 'inherit'}, - function (er, code) { - if (er) throw er - t.equal(code, 0) - t.end() - }) -}) - -test('use first npm to install second npm', function (t) { - t.plan(3) - // get the root location - common.npm( - [ - 'root', '-g', - '--prefix=' + folder + '/first', - '--cache=' + folder + '/cache', - '--tmp=' + folder + '/tmp' - ], - {}, - function (er, code, so) { - if (er) throw er - t.equal(code, 0, 'got npm root') - var root = so.trim() - t.ok(fs.statSync(root).isDirectory(), 'npm root is dir') - - var bin = path.resolve(root, 'npm/bin/npm-cli.js') - spawn( - node, - [ - bin, - 'install', npm, - '-g', - '--ignore-scripts', - '--prefix=' + folder + '/second', - '--cache=' + folder + '/cache', - '--tmp=' + folder + '/tmp' - ], - {} - ) - .on('error', function (er) { throw er }) - .on('close', function (code) { - t.equal(code, 0, 'second npm install') - t.end() - }) - } - ) -}) - -test('verify that the builtin config matches', function (t) { - t.plan(3) - common.npm([ 'root', '-g', - '--prefix=' + folder + '/first', - '--cache=' + folder + '/cache', - '--tmp=' + folder + '/tmp' - ], {}, - function (er, code, so) { - if (er) throw er - t.equal(code, 0) - var firstRoot = so.trim() - common.npm([ 'root', '-g', - '--prefix=' + folder + '/second', - '--cache=' + folder + '/cache', - '--tmp=' + folder + '/tmp' - ], {}, - function (er, code, so) { - if (er) throw er - t.equal(code, 0) - var secondRoot = so.trim() - var firstRc = path.resolve(firstRoot, 'npm', 'npmrc') - var secondRc = path.resolve(secondRoot, 'npm', 'npmrc') - var firstData = fs.readFileSync(firstRc, 'utf8').split(/\r?\n/) - var secondData = fs.readFileSync(secondRc, 'utf8').split(/\r?\n/) - t.isDeeply(firstData, secondData) - t.end() - }) - }) -}) - -test('clean', function (t) { - rimraf.sync(folder) - t.end() -}) diff --git a/deps/npm/test/tap/bundled-dependencies-nonarray.js b/deps/npm/test/tap/bundled-dependencies-nonarray.js deleted file mode 100644 index fdc32c2883af14..00000000000000 --- a/deps/npm/test/tap/bundled-dependencies-nonarray.js +++ /dev/null @@ -1,71 +0,0 @@ -'use strict' -var Bluebird = require('bluebird') -var fs = require('graceful-fs') -var path = require('path') - -var mkdirp = require('mkdirp') -var rimraf = require('rimraf') -var test = require('tap').test - -var common = require('../common-tap.js') - -var dir = common.pkg -var pkg = path.resolve(dir, 'pkg-with-bundled') -var dep = path.resolve(dir, 'a-bundled-dep') - -var pj = JSON.stringify({ - name: 'pkg-with-bundled', - version: '1.0.0', - dependencies: { - 'a-bundled-dep': 'file:../a-bundled-dep-2.0.0.tgz' - }, - bundledDependencies: { - 'a-bundled-dep': 'file:../a-bundled-dep-2.0.0.tgz' - } -}, null, 2) + '\n' - -var pjDep = JSON.stringify({ - name: 'a-bundled-dep', - version: '2.0.0' -}, null, 2) + '\n' - -test('setup', function (t) { - bootstrap() - t.end() -}) - -test('handles non-array bundleddependencies', function (t) { - return Bluebird.try(() => { - return common.npm(['pack', 'a-bundled-dep/'], {cwd: dir, stdio: [0, 1, 2]}) - }).spread((code) => { - t.is(code, 0, 'built a-bundled-dep') - return common.npm(['install'], {cwd: pkg, stdio: [0, 1, 2]}) - }).spread((code) => { - t.is(code, 0, 'prepared pkg-with-bundled') - return common.npm(['pack', 'pkg-with-bundled/'], {cwd: dir, stdio: [0, 1, 'pipe']}) - }).spread((code, _, stderr) => { - t.equal(code, 0, 'exited with a error code') - t.equal(stderr, '') - }) -}) - -test('cleanup', function (t) { - cleanup() - t.end() -}) - -function bootstrap () { - cleanup() - mkdirp.sync(dir) - mkdirp.sync(path.join(dir, 'node_modules')) - - mkdirp.sync(pkg) - fs.writeFileSync(path.resolve(pkg, 'package.json'), pj) - - mkdirp.sync(dep) - fs.writeFileSync(path.resolve(dep, 'package.json'), pjDep) -} - -function cleanup () { - rimraf.sync(dir) -} diff --git a/deps/npm/test/tap/bundled-dependencies.js b/deps/npm/test/tap/bundled-dependencies.js deleted file mode 100644 index 6dbfa8cb08d74f..00000000000000 --- a/deps/npm/test/tap/bundled-dependencies.js +++ /dev/null @@ -1,109 +0,0 @@ -'use strict' -var test = require('tap').test -var common = require('../common-tap.js') -var path = require('path') -var rimraf = require('rimraf') -var mkdirp = require('mkdirp') -var fs = require('graceful-fs') -var tar = require('tar') -var basepath = common.pkg -var fixturepath = path.resolve(basepath, 'npm-test-bundled-deps') -var targetpath = path.resolve(basepath, 'target') -var Tacks = require('tacks') -var File = Tacks.File -var Dir = Tacks.Dir - -test('basic bundling', function (t) { - var fixture = new Tacks( - Dir({ - 'package.json': File({ - name: 'npm-test-files', - version: '1.2.5', - bundledDependencies: [ - 'addme' - ] - }), - node_modules: Dir({ - addme: Dir({ - 'index.js': File('') - }), - iggyme: Dir({ - 'index.js': File('') - }) - }) - }) - ) - withFixture(t, fixture, function (done) { - t.ok(fileExists('node_modules/addme'), 'bundled dep included') - t.notOk(fileExists('node_modules/iggyme'), 'unspecified dep not included') - done() - }) -}) - -test('scoped dep bundling', function (t) { - var fixture = new Tacks( - Dir({ - 'package.json': File({ - name: 'npm-test-files', - version: '1.2.5', - bundledDependencies: [ - '@foo/addme' - ] - }), - node_modules: Dir({ - '@foo': Dir({ - addme: Dir({ - 'index.js': File('') - }), - iggyme: Dir({ - 'index.js': File('') - }) - }) - }) - }) - ) - withFixture(t, fixture, function (done) { - t.ok(fileExists('node_modules/@foo/addme'), 'bundled dep included') - t.notOk( - fileExists('node_modules/@foo/iggyme'), - 'unspecified dep not included') - done() - }) -}) - -function fileExists (file) { - try { - return !!fs.statSync(path.resolve(targetpath, 'package', file)) - } catch (_) { - return false - } -} - -function withFixture (t, fixture, tester) { - fixture.create(fixturepath) - mkdirp.sync(targetpath) - common.npm(['pack', fixturepath], {cwd: basepath}, extractAndCheck) - function extractAndCheck (err, code) { - if (err) throw err - t.is(code, 0, 'pack went ok') - extractTarball(checkTests) - } - function checkTests (err) { - if (err) throw err - tester(removeAndDone) - } - function removeAndDone (err) { - if (err) throw err - fixture.remove(fixturepath) - rimraf.sync(basepath) - t.done() - } -} - -function extractTarball (cb) { - // Unpack to disk so case-insensitive filesystems are consistent - tar.extract({ - file: path.join(basepath, 'npm-test-files-1.2.5.tgz'), - cwd: targetpath - }).then(cb, cb) -} diff --git a/deps/npm/test/tap/bundled-no-add-to-move.js b/deps/npm/test/tap/bundled-no-add-to-move.js deleted file mode 100644 index f9146c0e012017..00000000000000 --- a/deps/npm/test/tap/bundled-no-add-to-move.js +++ /dev/null @@ -1,50 +0,0 @@ -'use strict' -var test = require('tap').test -var Node = require('../../lib/install/node.js').create -var npm = require('../../lib/npm.js') - -var oldTree = Node({ - path: '/', - location: '/', - children: [ - Node({ - package: {name: 'one', version: '1.0.0'}, - path: '/node_modules/one', - location: '/one' - }) - ] -}) -oldTree.children[0].requiredBy.push(oldTree) - -var newTree = Node({ - path: '/', - location: '/', - children: [ - Node({ - package: {name: 'abc', version: '1.0.0'}, - path: '/node_modules/abc', - location: '/abc', - children: [ - Node({ - package: {name: 'one', version: '1.0.0'}, - fromBundle: true, - path: '/node_modules/abc/node_modules/one', - location: '/abc/one' - }) - ] - }) - ] -}) -newTree.children[0].requiredBy.push(newTree) -newTree.children[0].children[0].requiredBy.push(newTree.children[0]) - -test('test', function (t) { - npm.load({}, (err) => { - if (err) throw err - var diffTrees = require('../../lib/install/diff-trees.js')._diffTrees - var sortActions = require('../../lib/install/diff-trees.js').sortActions - var differences = sortActions(diffTrees(oldTree, newTree)).map(function (diff) { return diff[0] + diff[1].location }) - t.isDeeply(differences, ['add/abc/one', 'remove/one', 'add/abc'], 'bundled add/remove stays add/remove') - t.end() - }) -}) diff --git a/deps/npm/test/tap/bundled-transitive-deps.js b/deps/npm/test/tap/bundled-transitive-deps.js deleted file mode 100644 index d3f296ab1612f5..00000000000000 --- a/deps/npm/test/tap/bundled-transitive-deps.js +++ /dev/null @@ -1,108 +0,0 @@ -'use strict' -var fs = require('fs') -var path = require('path') -var test = require('tap').test -var Tacks = require('tacks') -var File = Tacks.File -var Dir = Tacks.Dir -var common = require('../common-tap.js') -var npm = require('../../lib/npm.js') -var tar = require('tar') -var mkdirp = require('mkdirp') -var testdir = common.pkg -var packed = path.join(testdir, 'packed') - -var fixture = new Tacks( - Dir({ - 'package.json': File({ - name: 'bundled-transitive-deps', - version: '1.0.0', - dependencies: { - 'a': '1.0.0', - '@c/d': '1.0.0' - }, - bundleDependencies: [ - 'a', - '@c/d' - ] - }), - node_modules: Dir({ - 'a': Dir({ - 'package.json': File({ - name: 'a', - version: '1.0.0', - dependencies: { - 'b': '1.0.0' - } - }) - }), - 'b': Dir({ - 'package.json': File({ - name: 'b', - version: '1.0.0' - }) - }), - '@c/d': Dir({ - 'package.json': File({ - name: '@c/d', - version: '1.0.0' - }), - 'node_modules': Dir({ - 'e': Dir({ - 'package.json': File({ - name: 'e', - version: '1.0.0' - }) - }) - }) - }) - }) - }) -) - -function setup () { - cleanup() - fixture.create(testdir) -} - -function cleanup () { - fixture.remove(testdir) -} - -test('setup', function (t) { - setup() - npm.load({}, t.end) -}) - -function exists (t, filename) { - t.doesNotThrow(filename + ' exists', function () { - fs.statSync(filename) - }) -} - -test('bundled-transitive-deps', function (t) { - common.npm(['pack'], {cwd: testdir}, thenCheckPack) - function thenCheckPack (err, code, stdout, stderr) { - if (err) throw err - var tarball = stdout.trim() - t.comment(stderr.trim()) - t.is(code, 0, 'pack successful') - mkdirp.sync(packed) - tar.extract({ - file: path.join(testdir, tarball), - cwd: packed, - strip: 1, - sync: true - }) - var transitivePackedDep = path.join(packed, 'node_modules', 'b') - exists(t, transitivePackedDep) - var nestedScopedDep = path.join(packed, 'node_modules', '@c', 'd', 'node_modules', 'e') - exists(t, nestedScopedDep) - t.end() - } -}) - -test('cleanup', function (t) { - cleanup() - t.end() -}) diff --git a/deps/npm/test/tap/cache-add-unpublished.js b/deps/npm/test/tap/cache-add-unpublished.js deleted file mode 100644 index 08592a50deebb3..00000000000000 --- a/deps/npm/test/tap/cache-add-unpublished.js +++ /dev/null @@ -1,37 +0,0 @@ -var common = require('../common-tap.js') -var test = require('tap').test - -test('cache add', function (t) { - setup(function (er, s) { - if (er) { - throw er - } - common.npm( - [ - 'cache', - 'add', - 'superfoo', - '--registry=http://localhost:' + common.port + '/' - ], - {}, - function (er, c, so, se) { - if (er) throw er - t.ok(c, 'got non-zero exit code') - t.equal(so, '', 'nothing printed to stdout') - t.similar(se, /404 Not Found.*superfoo/, 'got expected error') - s.close() - t.end() - } - ) - }) -}) - -function setup (cb) { - var s = require('http').createServer(function (req, res) { - res.statusCode = 404 - res.end('{"error":"not_found"}\n') - }) - s.listen(common.port, function () { - cb(null, s) - }) -} diff --git a/deps/npm/test/tap/cache-eacces-error-message.js b/deps/npm/test/tap/cache-eacces-error-message.js deleted file mode 100644 index fe76875c3e0247..00000000000000 --- a/deps/npm/test/tap/cache-eacces-error-message.js +++ /dev/null @@ -1,35 +0,0 @@ -const npm = require('../../lib/npm.js') -const t = require('tap') - -const common = require('../common-tap.js') - -common.skipIfWindows('this is a unix-only thing') - -const errorMessage = require('../../lib/utils/error-message.js') - -t.plan(1) - -npm.load({ cache: common.cache }, () => { - npm.config.set('cache', common.cache) - const er = new Error('access is e, i am afraid') - er.code = 'EACCES' - er.errno = -13 - er.path = common.cache + '/src' - er.dest = common.cache + '/to' - - t.match(errorMessage(er), { - summary: [ - [ - '', - new RegExp('\n' + - 'Your cache folder contains root-owned files, due to a bug in\n' + - 'previous versions of npm which has since been addressed.\n' + - '\n' + - 'To permanently fix this problem, please run:\n' + - ' sudo chown -R [0-9]+:[0-9]+ ".*npm_cache_cache-eacces-error-message"' - ) - ] - ], - detail: [] - }, 'get the helpful error message') -}) diff --git a/deps/npm/test/tap/cache-shasum-fork.js b/deps/npm/test/tap/cache-shasum-fork.js deleted file mode 100644 index fade5ffb646c59..00000000000000 --- a/deps/npm/test/tap/cache-shasum-fork.js +++ /dev/null @@ -1,92 +0,0 @@ -var fs = require('graceful-fs') -var path = require('path') - -var mkdirp = require('mkdirp') -var mr = require('npm-registry-mock') -var test = require('tap').test - -var common = require('../common-tap.js') - -// Install from a tarball that thinks it is underscore@1.5.1 -// (but is actually a fork) -var forkPath = path.resolve( - __dirname, '..', 'fixtures', 'forked-underscore-1.5.1.tgz' -) -var pkg = common.pkg -var cache = common.cache -var server - -test('setup', function (t) { - mkdirp.sync(path.join(pkg, 'node_modules')) - process.chdir(pkg) - t.comment('test for https://github.com/npm/npm/issues/3265') - mr({ port: common.port }, function (er, s) { - server = s - t.end() - }) -}) - -test('npm cache - install from fork', function (t) { - common.npm( - [ - '--loglevel', 'silent', - '--json', - '--registry', common.registry, - 'install', forkPath - ], - { - cwd: pkg, - env: { npm_config_cache: cache } - }, - function (err, code, stdout, stderr) { - t.ifErr(err, 'install finished without error') - t.equal(stderr, '', 'Should not get data on stderr') - t.equal(code, 0, 'install finished successfully') - - var deps = {} - JSON.parse(stdout).added.forEach(function (dep) { deps[dep.name] = dep }) - t.equal(deps.underscore && deps.underscore.version, '1.5.1') - var index = fs.readFileSync( - path.join(pkg, 'node_modules', 'underscore', 'index.js'), - 'utf8' - ) - t.equal(index, 'console.log("This is the fork");\n\n') - t.end() - } - ) -}) - -// Now install the real 1.5.1. -test('npm cache - install from origin', function (t) { - common.npm( - [ - '--loglevel', 'silent', - '--json', - '--registry', common.registry, - 'install', 'underscore' - ], - { - cwd: pkg, - env: { npm_config_cache: cache } - }, - function (err, code, stdout, stderr) { - t.ifErr(err, 'install finished without error') - t.equal(code, 0, 'install finished successfully') - t.notOk(stderr, 'Should not get data on stderr: ' + stderr) - var deps = {} - JSON.parse(stdout).updated.forEach(function (dep) { deps[dep.name] = dep }) - t.equal(deps.underscore && deps.underscore.version, '1.5.1') - var index = fs.readFileSync( - path.join(pkg, 'node_modules', 'underscore', 'index.js'), - 'utf8' - ) - t.equal(index, 'module.exports = require(\'./underscore\');\n') - t.end() - } - ) -}) - -test('cleanup', function (t) { - server.close() - t.end() -}) diff --git a/deps/npm/test/tap/check-cpu-reqs.js b/deps/npm/test/tap/check-cpu-reqs.js deleted file mode 100644 index d70660b05887fc..00000000000000 --- a/deps/npm/test/tap/check-cpu-reqs.js +++ /dev/null @@ -1,50 +0,0 @@ -'use strict' -var path = require('path') -var fs = require('fs') -var test = require('tap').test -var mkdirp = require('mkdirp') -var common = require('../common-tap.js') - -var base = common.pkg -var installFrom = path.join(base, 'from') -var installIn = path.join(base, 'in') - -var json = { - name: 'check-cpu-reqs', - version: '0.0.1', - description: 'fixture', - cpu: ['fake-cpu'] -} - -test('setup', function (t) { - setup() - t.end() -}) - -var INSTALL_OPTS = ['--loglevel', 'silly'] -var EXEC_OPTS = {cwd: installIn} - -test('install bad cpu', function (t) { - common.npm(['install', installFrom].concat(INSTALL_OPTS), EXEC_OPTS, function (err, code) { - t.ifError(err, 'npm ran without issue') - t.is(code, 1, 'npm install refused to install a package in itself') - t.end() - }) -}) -test('force install bad cpu', function (t) { - common.npm(['install', '--force', installFrom].concat(INSTALL_OPTS), EXEC_OPTS, function (err, code) { - t.ifError(err, 'npm ran without issue') - t.is(code, 0, 'npm install happily installed a package in itself with --force') - t.end() - }) -}) - -function setup () { - mkdirp.sync(path.resolve(installFrom, 'node_modules')) - fs.writeFileSync( - path.join(installFrom, 'package.json'), - JSON.stringify(json, null, 2) - ) - mkdirp.sync(path.resolve(installIn, 'node_modules')) - process.chdir(base) -} diff --git a/deps/npm/test/tap/check-engine-reqs.js b/deps/npm/test/tap/check-engine-reqs.js deleted file mode 100644 index eec07562885c91..00000000000000 --- a/deps/npm/test/tap/check-engine-reqs.js +++ /dev/null @@ -1,63 +0,0 @@ -'use strict' -var path = require('path') -var fs = require('fs') -var test = require('tap').test -var mkdirp = require('mkdirp') -var common = require('../common-tap.js') - -var base = common.pkg -var installFrom = path.join(base, 'from') -var installIn = path.join(base, 'in') - -var json = { - name: 'check-engine-reqs', - version: '0.0.1', - description: 'fixture', - engines: { - node: '1.0.0-not-a-real-version' - } -} - -test('setup', function (t) { - setup() - t.end() -}) - -var INSTALL_OPTS = ['--loglevel', 'silly'] -var EXEC_OPTS = {cwd: installIn} -test('install bad engine', function (t) { - common.npm(['install', '--engine-strict', installFrom].concat(INSTALL_OPTS), EXEC_OPTS, function (err, code) { - t.ifError(err, 'npm ran without issue') - t.is(code, 1, 'npm install refused to install a package in itself') - t.end() - }) -}) -test('force install bad engine', function (t) { - common.npm(['install', '--engine-strict', '--force', installFrom].concat(INSTALL_OPTS), EXEC_OPTS, function (err, code) { - t.ifError(err, 'npm ran without issue') - t.is(code, 0, 'npm install happily installed a package in itself with --force') - t.end() - }) -}) - -test('warns on bad engine not strict', function (t) { - common.npm(['install', '--json', installFrom], EXEC_OPTS, function (err, code, stdout, stderr) { - t.ifError(err, 'npm ran without issue') - t.is(code, 0, 'result code') - var result = JSON.parse(stdout) - t.match(result.warnings[0], /Unsupported engine/, 'reason for optional failure in JSON') - t.match(result.warnings[0], /1.0.0-not-a-real-version/, 'should print mismatch version info') - t.match(result.warnings[0], /Not compatible with your version of node/, 'incompatibility message') - t.done() - }) -}) - -function setup () { - mkdirp.sync(path.resolve(installFrom, 'node_modules')) - fs.writeFileSync( - path.join(installFrom, 'package.json'), - JSON.stringify(json, null, 2) - ) - mkdirp.sync(path.resolve(installIn, 'node_modules')) - process.chdir(base) -} diff --git a/deps/npm/test/tap/check-install-self.js b/deps/npm/test/tap/check-install-self.js deleted file mode 100644 index 63901a12df6718..00000000000000 --- a/deps/npm/test/tap/check-install-self.js +++ /dev/null @@ -1,56 +0,0 @@ -'use strict' -var path = require('path') -var fs = require('fs') -var test = require('tap').test -var mkdirp = require('mkdirp') -var common = require('../common-tap.js') - -var base = common.pkg -var installFrom = path.join(base, 'from') -var installIn = path.join(base, 'in') - -var json = { - name: 'check-install-self', - version: '0.0.1', - description: 'fixture' -} - -test('setup', function (t) { - setup() - t.end() -}) - -var EXEC_OPTS = {cwd: installIn} - -test('install self', function (t) { - common.npm(['install', installFrom], EXEC_OPTS, function (err, code, stdout, stderr) { - if (err) throw err - t.comment(stdout.trim()) - t.comment(stderr.trim()) - t.is(code, 1, 'npm install refused to install a package in itself') - t.end() - }) -}) -test('force install self', function (t) { - common.npm(['install', '--force', installFrom], EXEC_OPTS, function (err, code, stdout, stderr) { - if (err) throw err - t.comment(stdout.trim()) - t.comment(stderr.trim()) - t.is(code, 0, 'npm install happily installed a package in itself with --force') - t.end() - }) -}) - -function setup () { - mkdirp.sync(path.resolve(installFrom, 'node_modules')) - fs.writeFileSync( - path.join(installFrom, 'package.json'), - JSON.stringify(json, null, 2) - ) - mkdirp.sync(path.resolve(installIn, 'node_modules')) - fs.writeFileSync( - path.join(installIn, 'package.json'), - JSON.stringify(json, null, 2) - ) - process.chdir(base) -} diff --git a/deps/npm/test/tap/check-os-reqs.js b/deps/npm/test/tap/check-os-reqs.js deleted file mode 100644 index 66dcbd5328e06c..00000000000000 --- a/deps/npm/test/tap/check-os-reqs.js +++ /dev/null @@ -1,50 +0,0 @@ -'use strict' -var path = require('path') -var fs = require('fs') -var test = require('tap').test -var mkdirp = require('mkdirp') -var common = require('../common-tap.js') - -var base = common.pkg -var installFrom = path.join(base, 'from') -var installIn = path.join(base, 'in') - -var json = { - name: 'check-os-reqs', - version: '0.0.1', - description: 'fixture', - os: ['fake-os'] -} - -test('setup', function (t) { - setup() - t.end() -}) - -var INSTALL_OPTS = ['--loglevel', 'silly'] -var EXEC_OPTS = {cwd: installIn} - -test('install bad os', function (t) { - common.npm(['install', installFrom].concat(INSTALL_OPTS), EXEC_OPTS, function (err, code) { - t.ifError(err, 'npm ran without issue') - t.is(code, 1, 'npm install refused to install a package in itself') - t.end() - }) -}) -test('force install bad os', function (t) { - common.npm(['install', '--force', installFrom].concat(INSTALL_OPTS), EXEC_OPTS, function (err, code) { - t.ifError(err, 'npm ran without issue') - t.is(code, 0, 'npm install happily installed a package in itself with --force') - t.end() - }) -}) - -function setup () { - mkdirp.sync(path.resolve(installFrom, 'node_modules')) - fs.writeFileSync( - path.join(installFrom, 'package.json'), - JSON.stringify(json, null, 2) - ) - mkdirp.sync(path.resolve(installIn, 'node_modules')) - process.chdir(base) -} diff --git a/deps/npm/test/tap/check-permissions.js b/deps/npm/test/tap/check-permissions.js deleted file mode 100644 index b8238891d90759..00000000000000 --- a/deps/npm/test/tap/check-permissions.js +++ /dev/null @@ -1,95 +0,0 @@ -'use strict' -var fs = require('fs') -var path = require('path') -var test = require('tap').test -var rimraf = require('rimraf') -var writable = require('../../lib/install/writable.js').fsAccessImplementation -var writableFallback = require('../../lib/install/writable.js').fsOpenImplementation -var exists = require('../../lib/install/exists.js').fsAccessImplementation -var existsFallback = require('../../lib/install/exists.js').fsStatImplementation - -const common = require('../common-tap.js') -var testBase = common.pkg -var existingDir = path.resolve(testBase, 'exists') -var nonExistingDir = path.resolve(testBase, 'does-not-exist') -var writableDir = path.resolve(testBase, 'writable') -var nonWritableDir = path.resolve(testBase, 'non-writable') - -test('setup', function (t) { - cleanup() - setup() - t.end() -}) - -test('exists', function (t) { - t.plan(2) - // fs.access first introduced in node 0.12 / io.js - if (fs.access) { - existsTests(t, exists) - } else { - t.pass('# skip fs.access not available in this version') - t.pass('# skip fs.access not available in this version') - } -}) - -test('exists-fallback', function (t) { - t.plan(2) - existsTests(t, existsFallback) -}) - -test('writable', function (t) { - t.plan(2) - // fs.access first introduced in node 0.12 / io.js - if (fs.access) { - writableTests(t, writable) - } else { - t.pass('# skip fs.access not available in this version') - t.pass('# skip fs.access not available in this version') - } -}) - -test('writable-fallback', function (t) { - t.plan(2) - writableTests(t, writableFallback) -}) - -test('cleanup', function (t) { - cleanup() - t.end() -}) - -function setup () { - fs.mkdirSync(testBase) - fs.mkdirSync(existingDir) - fs.mkdirSync(writableDir) - fs.mkdirSync(nonWritableDir) - fs.chmodSync(nonWritableDir, '555') -} - -function existsTests (t, exists) { - exists(existingDir, function (er) { - t.error(er, 'exists dir is exists') - }) - exists(nonExistingDir, function (er) { - t.ok(er, 'non-existing dir resulted in an error') - }) -} - -function writableTests (t, writable) { - writable(writableDir, function (er) { - t.error(er, 'writable dir is writable') - }) - if (process.platform === 'win32') { - t.pass('windows folders cannot be read-only') - } else if (process.getuid && process.getuid() === 0) { - t.pass('root is not blocked by read-only dirs') - } else { - writable(nonWritableDir, function (er) { - t.ok(er, 'non-writable dir resulted in an error') - }) - } -} - -function cleanup () { - rimraf.sync(testBase) -} diff --git a/deps/npm/test/tap/ci-header.js b/deps/npm/test/tap/ci-header.js deleted file mode 100644 index fc791c6e6710d2..00000000000000 --- a/deps/npm/test/tap/ci-header.js +++ /dev/null @@ -1,139 +0,0 @@ -'use strict' -var path = require('path') -var test = require('tap').test -var mr = require('npm-registry-mock') -var Tacks = require('tacks') -var File = Tacks.File -var Dir = Tacks.Dir -var chain = require('slide').chain -var common = require('../common-tap.js') - -var basedir = common.pkg -var testdir = path.join(basedir, 'testdir') -var cachedir = common.cache -var globaldir = path.join(basedir, 'global') -var tmpdir = path.join(basedir, 'tmp') - -var ciKeys = ['CI', 'TDDIUM', 'JENKINS_URL', 'bamboo.buildKey'] - -var filteredEnv = common.newEnv().delete(ciKeys) - -var conf = function (extraEnv) { - return { - cwd: testdir, - env: filteredEnv.clone().extend(extraEnv, { - npm_config_cache: cachedir, - npm_config_tmp: tmpdir, - npm_config_prefix: globaldir, - npm_config_registry: common.registry, - npm_config_loglevel: 'warn' - }) - } -} - -var server -var fixture = new Tacks(Dir({ - cache: Dir(), - global: Dir(), - tmp: Dir(), - testdir: Dir({ - 'package.json': File({ - name: 'example', - version: '1.0.0' - }) - }) -})) - -function setup () { - cleanup() - fixture.create(basedir) -} - -function cleanup () { - fixture.remove(basedir) -} - -var ciHeaderTestCI = { - 'time': {'1.0.0': ''}, - 'dist-tags': {'latest': '1.0.0'}, - 'versions': { - '1.0.0': { - name: 'ci-header-test', - version: '1.0.0', - gotCI: true - } - } -} -var ciHeaderTestNotCI = { - 'time': {'1.0.0': ''}, - 'dist-tags': {'latest': '1.0.0'}, - 'versions': { - '1.0.0': { - name: 'ci-header-test', - version: '1.0.0', - gotCI: false - } - } -} - -var ciHeaderTestNoCI = { - 'time': {'1.0.0': ''}, - 'dist-tags': {'latest': '1.0.0'}, - 'versions': { - '1.0.0': { - name: 'ci-header-test', - version: '1.0.0', - gotCI: null - } - } -} - -test('setup', function (t) { - setup() - mr({port: common.port, throwOnUnmatched: true}, function (err, s) { - if (err) throw err - server = s - server.get('/ci-header-test', { - 'NPM-In-CI': 'true' - }).many().reply('200', ciHeaderTestCI) - server.get('/ci-header-test', { - 'NPM-In-CI': 'false' - }).many().reply('200', ciHeaderTestNotCI) - server.get('/ci-header-test', {}).many().reply('200', ciHeaderTestNoCI) - t.done() - }) -}) - -test('various-ci', function (t) { - var todo = ciKeys.map(function (key) { return [checkKey, key] }) - return chain(todo, t.done) - - function checkKey (key, next) { - var env = {} - env[key] = 'true' - - common.npm(['view', '--cache-min=0', 'ci-header-test', 'gotCI'], conf(env), function (err, code, stdout, stderr) { - if (err) throw err - t.is(code, 0, key + ' command ran ok') - if (stderr.trim()) t.comment(stderr.trim()) - t.is(stdout.trim(), 'true', key + ' set results in CI header') - next() - }) - } -}) - -test('no-ci', function (t) { - common.npm(['view', '--cache-min=0', 'ci-header-test', 'gotCI'], conf(), function (err, code, stdout, stderr) { - if (err) throw err - t.is(code, 0, 'No CI env, command ran ok') - if (stderr.trim()) t.comment(stderr.trim()) - t.is(stdout.trim(), 'false', 'No CI env, not in CI') - t.done() - }) -}) - -test('cleanup', function (t) { - server.close() - cleanup() - t.done() -}) diff --git a/deps/npm/test/tap/ci-permissions.js b/deps/npm/test/tap/ci-permissions.js deleted file mode 100644 index c73d464236540e..00000000000000 --- a/deps/npm/test/tap/ci-permissions.js +++ /dev/null @@ -1,53 +0,0 @@ -const t = require('tap') -const tar = require('tar') -const common = require('../common-tap.js') -const pkg = common.pkg -const rimraf = require('rimraf') -const { writeFileSync, statSync, chmodSync } = require('fs') -const { resolve } = require('path') -const mkdirp = require('mkdirp') - -t.test('setup', t => { - mkdirp.sync(resolve(pkg, 'package')) - const pj = resolve(pkg, 'package', 'package.json') - writeFileSync(pj, JSON.stringify({ - name: 'foo', - version: '1.2.3' - })) - chmodSync(pj, 0o640) - tar.c({ - sync: true, - file: resolve(pkg, 'foo.tgz'), - gzip: true, - cwd: pkg - }, ['package']) - writeFileSync(resolve(pkg, 'package.json'), JSON.stringify({ - name: 'root', - version: '1.2.3', - dependencies: { - foo: 'file:foo.tgz' - } - })) - t.end() -}) - -t.test('run install to generate package-lock', t => - common.npm(['install'], { cwd: pkg }).then(([code]) => t.equal(code, 0))) - -t.test('remove node_modules', t => rimraf(resolve(pkg, 'node_modules'), t.end)) - -t.test('run ci and check modes', t => - common.npm(['ci'], { cwd: pkg, stdio: 'inherit' }).then(([code]) => { - t.equal(code, 0) - const file = resolve(pkg, 'node_modules', 'foo', 'package.json') - // bitwise AND against 0o705 so that we can detect whether - // the file is world-readable. - // Typical unix systems would leave the file 0o644 - // Travis-ci and some other Linux systems will be 0o664 - // Windows is 0o666 - // The regression this is detecting (ie, the default in the tarball) - // leaves the file as 0o640. - // Bitwise-AND 0o705 should always result in 0o604, and never 0o600 - const mode = statSync(file).mode & 0o705 - t.equal(mode, 0o604) - })) diff --git a/deps/npm/test/tap/ci-with-local-dependency.js b/deps/npm/test/tap/ci-with-local-dependency.js deleted file mode 100644 index 376dc978181537..00000000000000 --- a/deps/npm/test/tap/ci-with-local-dependency.js +++ /dev/null @@ -1,82 +0,0 @@ -const fs = require('graceful-fs') -const path = require('path') - -const mkdirp = require('mkdirp') -const t = require('tap') - -const common = require('../common-tap.js') - -const pkg = common.pkg + '/package' - -const EXEC_OPTS = { - cwd: pkg, - stdio: [0, 1, 2], - env: common.newEnv().extend({ - npm_config_registry: common.registry - }) -} - -const localDependencyJson = { - name: 'local-dependency', - version: '0.0.0', - dependencies: { - 'test-package': '0.0.0' - } -} - -const dependentJson = { - name: 'dependent', - version: '0.0.0', - dependencies: { - 'local-dependency': '../local-dependency' - } -} - -const target = path.resolve(pkg, '../local-dependency') -const mr = require('npm-registry-mock') -let server -t.teardown(() => { - if (server) { - server.close() - } -}) - -t.test('setup', function (t) { - mkdirp.sync(target) - fs.writeFileSync( - path.join(target, 'package.json'), - JSON.stringify(localDependencyJson, null, 2) - ) - mkdirp.sync(pkg) - fs.writeFileSync( - path.join(pkg, 'package.json'), - JSON.stringify(dependentJson, null, 2) - ) - mr({ port: common.port }, (er, s) => { - if (er) { - throw er - } - server = s - t.end() - }) -}) - -t.test('\'npm install\' should install local pkg from sub path', function (t) { - common.npm(['install', '--loglevel=silent'], EXEC_OPTS, function (err, code) { - if (err) throw err - t.equal(code, 0, 'npm install exited with code') - t.ok(fs.statSync(path.resolve(pkg, 'node_modules/local-dependency/package.json')).isFile(), 'local dependency package.json exists') - t.ok(fs.statSync(path.resolve(pkg, 'node_modules/local-dependency/node_modules/test-package')).isDirectory(), 'transitive dependency installed') - t.end() - }) -}) - -t.test('\'npm ci\' should work', function (t) { - common.npm(['ci', '--loglevel=silent'], EXEC_OPTS, function (err, code) { - if (err) throw err - t.equal(code, 0, 'npm install exited with code') - t.ok(fs.statSync(path.resolve(pkg, 'node_modules/local-dependency/package.json')).isFile(), 'local dependency package.json exists') - t.ok(fs.statSync(path.resolve(pkg, 'node_modules/local-dependency/node_modules/test-package')).isDirectory(), 'transitive dependency installed') - t.end() - }) -}) diff --git a/deps/npm/test/tap/ci.js b/deps/npm/test/tap/ci.js deleted file mode 100644 index e1c2d73b7a43d5..00000000000000 --- a/deps/npm/test/tap/ci.js +++ /dev/null @@ -1,344 +0,0 @@ -'use strict' - -const BB = require('bluebird') - -const common = BB.promisifyAll(require('../common-tap.js')) -const fs = BB.promisifyAll(require('fs')) -const mr = BB.promisify(require('npm-registry-mock')) -const path = require('path') -const rimraf = BB.promisify(require('rimraf')) -const Tacks = require('tacks') -const test = require('tap').test - -const Dir = Tacks.Dir -const File = Tacks.File -const cacheDir = common.cache -const testDir = common.pkg - -const EXEC_OPTS = { - cwd: testDir, - nodeExecPath: process.execPath -} - -const PKG = { - name: 'top', - version: '1.2.3', - scripts: { - install: 'node -p process.env.npm_config_foo' - }, - dependencies: { - optimist: '0.6.0', - clean: '2.1.6' - } -} -let RAW_LOCKFILE -let SERVER -let TREE - -function scrubFrom (tree) { - // npm ci and npm i write different `from` fields for dependency deps. This - // is fine any ok, but it messes with `t.deepEqual` comparisons. - function _scrubFrom (deps) { - Object.keys(deps).forEach((k) => { - deps[k].from = '' - if (deps[k].dependencies) { _scrubFrom(deps[k].dependencies) } - }) - } - tree.dependencies && _scrubFrom(tree.dependencies) -} - -test('setup', () => { - const fixture = new Tacks(Dir({ - 'package.json': File(PKG) - })) - return Promise.all([rimraf(cacheDir), rimraf(testDir)]).then(() => { - fixture.create(testDir) - return mr({port: common.port}) - }) - .then((server) => { - SERVER = server - return common.npm([ - 'install', - '--registry', common.registry - ], EXEC_OPTS) - }) - .then(() => fs.readFileAsync( - path.join(testDir, 'package-lock.json'), - 'utf8') - ) - .then((lock) => { - RAW_LOCKFILE = lock - }) - .then(() => common.npm(['ls', '--json'], EXEC_OPTS)) - .then((ret) => { - TREE = scrubFrom(JSON.parse(ret[1])) - }) -}) - -test('basic installation', (t) => { - const fixture = new Tacks(Dir({ - 'package.json': File(PKG), - 'package-lock.json': File(RAW_LOCKFILE) - })) - return rimraf(testDir) - .then(() => fixture.create(testDir)) - .then(() => common.npm([ - 'ci', - '--foo=asdf', - '--registry', common.registry, - '--loglevel', 'warn' - ], EXEC_OPTS)) - .then((ret) => { - const code = ret[0] - const stdout = ret[1] - const stderr = ret[2] - t.equal(code, 0, 'command completed without error') - t.equal(stderr.trim(), '', 'no output on stderr') - t.match( - stdout.trim(), - /\nasdf\nadded 6 packages in \d+(?:\.\d+)?s$/, - 'no warnings on stderr, and final output has right number of packages' - ) - return fs.readdirAsync(path.join(testDir, 'node_modules')) - }) - .then((modules) => { - t.deepEqual(modules.sort(), [ - 'async', 'checker', 'clean', 'minimist', 'optimist', 'wordwrap' - ], 'packages installed') - return BB.all(modules.map((mod) => { - return fs.readFileAsync( - path.join(testDir, 'node_modules', mod, 'package.json') - ) - .then((f) => JSON.parse(f)) - .then((pkgjson) => { - t.equal(pkgjson.name, mod, `${mod} package name correct`) - t.match( - pkgjson._integrity, - /sha\d+-[a-z0-9=+/]+$/i, - `${mod} pkgjson has _integrity` - ) - t.match( - pkgjson._resolved, - new RegExp(`http.*/-/${mod}-${pkgjson.version}.tgz`), - `${mod} pkgjson has correct _resolved` - ) - t.match( - pkgjson._from, - new RegExp(`${mod}@.*`), - `${mod} pkgjson has _from field` - ) - }) - })) - }) - .then(() => fs.readFileAsync( - path.join(testDir, 'package-lock.json'), - 'utf8') - ) - .then((lock) => t.equal(lock, RAW_LOCKFILE, 'package-lock.json unchanged')) - .then(() => common.npm(['ls', '--json'], EXEC_OPTS)) - .then((ret) => { - const lsResult = JSON.parse(ret[1]) - t.equal(ret[0], 0, 'ls exited successfully') - t.deepEqual(scrubFrom(lsResult), TREE, 'tree matches one from `install`') - }) -}) - -test('supports npm-shrinkwrap.json as well', (t) => { - const fixture = new Tacks(Dir({ - 'package.json': File(PKG), - 'npm-shrinkwrap.json': File(RAW_LOCKFILE) - })) - return rimraf(testDir) - .then(() => fixture.create(testDir)) - .then(() => common.npm([ - 'ci', - '--foo=asdf', - '--registry', common.registry, - '--loglevel', 'warn' - ], EXEC_OPTS)) - .then((ret) => { - const code = ret[0] - const stdout = ret[1] - const stderr = ret[2] - t.equal(code, 0, 'command completed without error') - t.equal(stderr.trim(), '', 'no output on stderr') - t.match( - stdout.trim(), - /\nasdf\nadded 6 packages in \d+(?:\.\d+)?s$/, - 'no warnings on stderr, and final output has right number of packages' - ) - }) - .then(() => common.npm(['ls', '--json'], EXEC_OPTS)) - .then((ret) => { - t.equal(ret[0], 0, 'ls exited successfully') - t.deepEqual( - scrubFrom(JSON.parse(ret[1])), - TREE, - 'tree matches one from `install`' - ) - }) - .then(() => fs.readFileAsync( - path.join(testDir, 'npm-shrinkwrap.json'), - 'utf8') - ) - .then((lock) => t.equal(lock, RAW_LOCKFILE, 'npm-shrinkwrap.json unchanged')) - .then(() => fs.readdirAsync(path.join(testDir))) - .then((files) => t.notOk( - files.some((f) => f === 'package-lock.json'), - 'no package-lock.json created' - )) -}) - -test('removes existing node_modules/ before installing', (t) => { - const fixture = new Tacks(Dir({ - 'package.json': File(PKG), - 'package-lock.json': File(RAW_LOCKFILE), - 'node_modules': Dir({ - foo: Dir({ - 'index.js': File('"hello world"') - }) - }) - })) - return rimraf(testDir) - .then(() => fixture.create(testDir)) - .then(() => common.npm([ - 'ci', - '--foo=asdf', - '--registry', common.registry, - '--loglevel', 'warn' - ], EXEC_OPTS)) - .then((ret) => { - const code = ret[0] - const stderr = ret[2] - t.equal(code, 0, 'command completed without error') - t.match( - stderr.trim(), - /^npm.*WARN.*removing existing node_modules/, - 'user warned that existing node_modules were removed' - ) - return fs.readdirAsync(path.join(testDir, 'node_modules')) - }) - .then((modules) => { - t.deepEqual(modules.sort(), [ - 'async', 'checker', 'clean', 'minimist', 'optimist', 'wordwrap' - ], 'packages installed, with old node_modules dir gone') - }) - .then(() => common.npm(['ls'], EXEC_OPTS)) - .then((ret) => t.equal(ret[0], 0, 'ls exited successfully')) - .then(() => fs.readFileAsync( - path.join(testDir, 'package-lock.json'), - 'utf8') - ) - .then((lock) => t.equal(lock, RAW_LOCKFILE, 'package-lock.json unchanged')) -}) - -test('installs all package types correctly') - -test('errors if package-lock.json missing', (t) => { - const fixture = new Tacks(Dir({ - 'package.json': File(PKG) - })) - return rimraf(testDir) - .then(() => fixture.create(testDir)) - .then(() => common.npm([ - 'ci', - '--foo=asdf', - '--registry', common.registry, - '--loglevel', 'warn' - ], EXEC_OPTS)) - .then((ret) => { - const code = ret[0] - const stdout = ret[1] - const stderr = ret[2] - t.equal(code, 1, 'command errored') - t.equal(stdout.trim(), '', 'no output on stdout') - t.match( - stderr.trim(), - /can only install packages with an existing package-lock/i, - 'user informed about the issue' - ) - return fs.readdirAsync(path.join(testDir)) - }) - .then((dir) => { - t.notOk(dir.some((f) => f === 'node_modules'), 'no node_modules installed') - t.notOk( - dir.some((f) => f === 'package-lock.json'), - 'no package-lock.json created' - ) - }) -}) - -test('errors if package-lock.json invalid', (t) => { - const badJson = JSON.parse(RAW_LOCKFILE) - delete badJson.dependencies.optimist - const fixture = new Tacks(Dir({ - 'package.json': File(PKG), - 'package-lock.json': File(badJson) - })) - return rimraf(testDir) - .then(() => fixture.create(testDir)) - .then(() => common.npm([ - 'ci', - '--foo=asdf', - '--registry', common.registry, - '--loglevel', 'warn' - ], EXEC_OPTS)) - .then((ret) => { - const code = ret[0] - const stdout = ret[1] - const stderr = ret[2] - t.equal(code, 1, 'command errored') - t.equal(stdout.trim(), '', 'no output on stdout') - t.match( - stderr.trim(), - /can only install packages when your package.json/i, - 'user informed about the issue' - ) - return fs.readdirAsync(path.join(testDir)) - }) - .then((dir) => { - t.notOk(dir.some((f) => f === 'node_modules'), 'no node_modules installed') - }) - .then(() => fs.readFileAsync( - path.join(testDir, 'package-lock.json'), - 'utf8') - ) - .then((lock) => t.deepEqual( - JSON.parse(lock), - badJson, - 'bad package-lock.json left unchanged') - ) -}) - -test('correct cache location when using cache config', (t) => { - const fixture = new Tacks(Dir({ - 'package.json': File(PKG), - 'package-lock.json': File(RAW_LOCKFILE) - })) - return Promise.all([rimraf(cacheDir), rimraf(testDir)]) - .then(() => fixture.create(cacheDir)) - .then(() => fixture.create(testDir)) - .then(() => common.npm([ - 'ci', - `--cache=${cacheDir}`, - '--foo=asdf', - '--registry', common.registry, - '--loglevel', 'warn' - ], EXEC_OPTS)) - .then((ret) => { - const code = ret[0] - const stderr = ret[2] - t.equal(code, 0, 'command completed without error') - t.equal(stderr.trim(), '', 'no output on stderr') - return fs.readdirAsync(path.join(cacheDir, '_cacache')) - }) - .then((modules) => { - t.ok(modules, 'should create _cacache folder') - t.end() - }) -}) - -test('cleanup', () => { - SERVER.close() - return Promise.all([rimraf(cacheDir), rimraf(testDir)]) -}) diff --git a/deps/npm/test/tap/circular-dep.js b/deps/npm/test/tap/circular-dep.js deleted file mode 100644 index f7e018d02346c7..00000000000000 --- a/deps/npm/test/tap/circular-dep.js +++ /dev/null @@ -1,93 +0,0 @@ -var fs = require('graceful-fs') -var path = require('path') -var existsSync = fs.existsSync || path.existsSync - -var mkdirp = require('mkdirp') -var mr = require('npm-registry-mock') -var test = require('tap').test - -var common = require('../common-tap.js') -var server - -var pkg = common.pkg -var minimist = path.join(pkg, 'minimist') - -var EXEC_OPTS = { - cwd: path.join(pkg, 'minimist/node_modules'), - npm_config_cache: common.cache -} - -var json = { - name: 'minimist', - version: '0.0.5', - dependencies: { - optimist: '0.6.0' - } -} - -test('setup', function (t) { - t.comment('test for https://github.com/npm/npm/issues/4312') - setup(function () { - t.end() - }) -}) - -test('installing a package that depends on the current package', function (t) { - common.npm( - [ - '--registry', common.registry, - '--loglevel', 'silent', - 'install', 'optimist' - ], - EXEC_OPTS, - function (err, code, stdout, stderr) { - t.ifError(err, 'npm ran without issue') - t.notOk(code, 'npm ran without raising an error code') - t.notOk(stderr, 'no error output') - - common.npm( - [ - '--registry', common.registry, - '--loglevel', 'silent', - 'dedupe' - ], - EXEC_OPTS, - function (err, code, stdout, stderr) { - t.ifError(err, 'npm ran without issue') - t.notOk(code, 'npm ran without raising an error code') - t.notOk(stderr, 'no error output') - - t.ok(existsSync(path.resolve( - minimist, - 'node_modules', 'optimist' - )), 'optimist in place') - t.ok(existsSync(path.resolve( - minimist, - 'node_modules', 'minimist' - )), 'circular dependency uncircled') - t.end() - } - ) - } - ) -}) - -test('cleanup', function (t) { - server.close() - t.end() -}) - -function setup (cb) { - mkdirp.sync(minimist) - fs.writeFileSync( - path.join(minimist, 'package.json'), - JSON.stringify(json, null, 2) - ) - process.chdir(path.resolve(pkg, 'minimist')) - - fs.mkdirSync(path.resolve(pkg, 'minimist/node_modules')) - mr({ port: common.port }, function (er, s) { - server = s - cb() - }) -} diff --git a/deps/npm/test/tap/config-basic.js b/deps/npm/test/tap/config-basic.js deleted file mode 100644 index a95e94db29fd66..00000000000000 --- a/deps/npm/test/tap/config-basic.js +++ /dev/null @@ -1,79 +0,0 @@ -var test = require('tap').test -var common = require('../common-config.js') -var npmconf = require('../../lib/config/core.js') -var path = require('path') - -var projectData = { -} - -var ucData = common.ucData -var envData = common.envData - -var gcData = { 'package-config:foo': 'boo' } - -var biData = {} - -var cli = { foo: 'bar', umask: parseInt('022', 8) } - -var expectNames = [ - 'cli', - 'envData', - 'projectData', - 'ucData', - 'gcData', - 'biData' -] -var expectList = [ - cli, - envData, - projectData, - ucData, - gcData, - biData -] - -var expectSources = { - cli: { data: cli }, - env: { - data: envData, - source: envData, - prefix: '' - }, - project: { - path: path.resolve(__dirname, '..', '..', '.npmrc'), - type: 'ini', - data: projectData - }, - user: { - path: common.userconfig, - type: 'ini', - data: ucData - }, - global: { - path: common.globalconfig, - type: 'ini', - data: gcData - }, - builtin: { data: biData } -} - -function isDeeplyDetails (t, aa, bb, msg, seen) { - return t.same(aa, bb, msg) -} - -test('no builtin', function (t) { - t.comment(process.env) - npmconf.load(cli, function (er, conf) { - if (er) throw er - expectNames.forEach(function (name, ii) { - isDeeplyDetails(t, conf.list[ii], expectList[ii], 'config properties list: ' + name) - }) - isDeeplyDetails(t, conf.sources, expectSources, 'config by source') - t.same(npmconf.rootConf.list, [], 'root configuration is empty') - isDeeplyDetails(t, npmconf.rootConf.root, npmconf.defs.defaults, 'defaults') - isDeeplyDetails(t, conf.root, npmconf.defs.defaults, 'current root config is defaults') - t.is(conf.get('umask'), parseInt('022', 8), 'umask is as expected') - t.is(conf.get('heading'), 'npm', 'config name is as expected') - t.end() - }) -}) diff --git a/deps/npm/test/tap/config-builtin.js b/deps/npm/test/tap/config-builtin.js deleted file mode 100644 index 713522d6ccfa23..00000000000000 --- a/deps/npm/test/tap/config-builtin.js +++ /dev/null @@ -1,66 +0,0 @@ -var test = require('tap').test -var npmconf = require('../../lib/config/core.js') -var common = require('../common-config.js') -var path = require('path') - -var ucData = common.ucData - -var envData = common.envData -var envDataFix = common.envDataFix - -var gcData = { 'package-config:foo': 'boo' } - -var biData = { 'builtin-config': true } - -var cli = { foo: 'bar', heading: 'foo', 'git-tag-version': false } - -var projectData = { -} - -var expectList = [ - cli, - envDataFix, - projectData, - ucData, - gcData, - biData -] - -var expectSources = { - cli: { data: cli }, - env: { - data: envDataFix, - source: envData, - prefix: '' - }, - project: { - path: path.resolve(__dirname, '..', '..', '.npmrc'), - type: 'ini', - data: projectData - }, - user: { - path: common.userconfig, - type: 'ini', - data: ucData - }, - global: { - path: common.globalconfig, - type: 'ini', - data: gcData - }, - builtin: { data: biData } -} - -test('with builtin', function (t) { - npmconf.load(cli, common.builtin, function (er, conf) { - if (er) throw er - t.same(conf.list, expectList) - t.same(conf.sources, expectSources) - t.same(npmconf.rootConf.list, []) - t.equal(npmconf.rootConf.root, npmconf.defs.defaults) - t.equal(conf.root, npmconf.defs.defaults) - t.equal(conf.get('heading'), 'foo') - t.equal(conf.get('git-tag-version'), false) - t.end() - }) -}) diff --git a/deps/npm/test/tap/config-certfile.js b/deps/npm/test/tap/config-certfile.js deleted file mode 100644 index 904a8c0147718b..00000000000000 --- a/deps/npm/test/tap/config-certfile.js +++ /dev/null @@ -1,19 +0,0 @@ -require('../common-config.js') - -var path = require('path') -var fs = require('fs') -var test = require('tap').test -var npmconf = require('../../lib/config/core.js') - -test('cafile loads as ca', function (t) { - var cafile = path.join(__dirname, '..', 'fixtures', 'config', 'multi-ca') - - npmconf.load({cafile: cafile}, function (er, conf) { - if (er) throw er - - t.same(conf.get('cafile'), cafile) - var ca = fs.readFileSync(cafile, 'utf8').trim() - t.same(conf.get('ca').join(ca.match(/\r/g) ? '\r\n' : '\n'), ca) - t.end() - }) -}) diff --git a/deps/npm/test/tap/config-credentials.js b/deps/npm/test/tap/config-credentials.js deleted file mode 100644 index d8f6770666e2dd..00000000000000 --- a/deps/npm/test/tap/config-credentials.js +++ /dev/null @@ -1,350 +0,0 @@ -var test = require('tap').test - -var npmconf = require('../../lib/config/core.js') -var common = require('../common-config.js') - -var URI = 'https://registry.lvh.me:8661/' - -test('getting scope with no credentials set', function (t) { - npmconf.load({}, function (er, conf) { - t.ifError(er, 'configuration loaded') - - var basic = conf.getCredentialsByURI(URI) - t.equal(basic.scope, '//registry.lvh.me:8661/', 'nerfed URL extracted') - - t.end() - }) -}) - -test('trying to set credentials with no URI', function (t) { - npmconf.load(common.builtin, function (er, conf) { - t.ifError(er, 'configuration loaded') - - t.throws(function () { - conf.setCredentialsByURI() - }, 'enforced missing URI') - - t.end() - }) -}) - -test('trying to clear credentials with no URI', function (t) { - npmconf.load(common.builtin, function (er, conf) { - t.ifError(er, 'configuration loaded') - - t.throws(function () { - conf.clearCredentialsByURI() - }, 'enforced missing URI') - - t.end() - }) -}) - -test('set with missing credentials object', function (t) { - npmconf.load(common.builtin, function (er, conf) { - t.ifError(er, 'configuration loaded') - - t.throws(function () { - conf.setCredentialsByURI(URI) - }, 'enforced missing credentials') - - t.end() - }) -}) - -test('set with empty credentials object', function (t) { - npmconf.load(common.builtin, function (er, conf) { - t.ifError(er, 'configuration loaded') - - t.throws(function () { - conf.setCredentialsByURI(URI, {}) - }, 'enforced missing credentials') - - t.end() - }) -}) - -test('set with token', function (t) { - npmconf.load(common.builtin, function (er, conf) { - t.ifError(er, 'configuration loaded') - - t.doesNotThrow(function () { - conf.setCredentialsByURI(URI, { token: 'simple-token' }) - }, 'needs only token') - - var expected = { - scope: '//registry.lvh.me:8661/', - token: 'simple-token', - username: undefined, - password: undefined, - email: undefined, - auth: undefined, - alwaysAuth: false - } - - t.same(conf.getCredentialsByURI(URI), expected, 'got bearer token and scope') - - t.end() - }) -}) - -test('clear with token', function (t) { - npmconf.load(common.builtin, function (er, conf) { - t.ifError(er, 'configuration loaded') - - t.doesNotThrow(function () { - conf.setCredentialsByURI(URI, { token: 'simple-token' }) - }, 'needs only token') - - t.doesNotThrow(function () { - conf.clearCredentialsByURI(URI) - }, 'needs only URI') - - t.notOk(conf.getCredentialsByURI(URI).token, 'token all gone') - - t.end() - }) -}) - -test('set with missing username', function (t) { - npmconf.load(common.builtin, function (er, conf) { - t.ifError(er, 'configuration loaded') - - var credentials = { - password: 'password', - email: 'ogd@aoaioxxysz.net' - } - - t.throws(function () { - conf.setCredentialsByURI(URI, credentials) - }, 'enforced missing email') - - t.end() - }) -}) - -test('set with missing password', function (t) { - npmconf.load(common.builtin, function (er, conf) { - t.ifError(er, 'configuration loaded') - - var credentials = { - username: 'username', - email: 'ogd@aoaioxxysz.net' - } - - t.throws(function () { - conf.setCredentialsByURI(URI, credentials) - }, 'enforced missing email') - - t.end() - }) -}) - -test('set with missing email', function (t) { - npmconf.load(common.builtin, function (er, conf) { - t.ifError(er, 'configuration loaded') - - var credentials = { - username: 'username', - password: 'password' - } - - t.throws(function () { - conf.setCredentialsByURI(URI, credentials) - }, 'enforced missing email') - - t.end() - }) -}) - -test('set with old-style credentials', function (t) { - npmconf.load(common.builtin, function (er, conf) { - t.ifError(er, 'configuration loaded') - - var credentials = { - username: 'username', - password: 'password', - email: 'ogd@aoaioxxysz.net' - } - - t.doesNotThrow(function () { - conf.setCredentialsByURI(URI, credentials) - }, 'requires all of username, password, and email') - - var expected = { - scope: '//registry.lvh.me:8661/', - token: undefined, - username: 'username', - password: 'password', - email: 'ogd@aoaioxxysz.net', - auth: 'dXNlcm5hbWU6cGFzc3dvcmQ=', - alwaysAuth: false - } - - t.same(conf.getCredentialsByURI(URI), expected, 'got credentials') - - t.end() - }) -}) - -test('clear with old-style credentials', function (t) { - npmconf.load(common.builtin, function (er, conf) { - t.ifError(er, 'configuration loaded') - - var credentials = { - username: 'username', - password: 'password', - email: 'ogd@aoaioxxysz.net' - } - - t.doesNotThrow(function () { - conf.setCredentialsByURI(URI, credentials) - }, 'requires all of username, password, and email') - - t.doesNotThrow(function () { - conf.clearCredentialsByURI(URI) - }, 'clearing only required URI') - - t.notOk(conf.getCredentialsByURI(URI).username, 'username cleared') - t.notOk(conf.getCredentialsByURI(URI).password, 'password cleared') - - t.end() - }) -}) - -test('get old-style credentials for default registry', function (t) { - npmconf.load(common.builtin, function (er, conf) { - var actual = conf.getCredentialsByURI(conf.get('registry')) - var expected = { - scope: '//registry.npmjs.org/', - token: undefined, - password: 'password', - username: 'username', - email: 'i@izs.me', - auth: 'dXNlcm5hbWU6cGFzc3dvcmQ=', - alwaysAuth: false - } - t.same(actual, expected) - t.end() - }) -}) - -test('set with always-auth enabled', function (t) { - npmconf.load(common.builtin, function (er, conf) { - t.ifError(er, 'configuration loaded') - - var credentials = { - username: 'username', - password: 'password', - email: 'ogd@aoaioxxysz.net', - alwaysAuth: true - } - - conf.setCredentialsByURI(URI, credentials) - - var expected = { - scope: '//registry.lvh.me:8661/', - token: undefined, - username: 'username', - password: 'password', - email: 'ogd@aoaioxxysz.net', - auth: 'dXNlcm5hbWU6cGFzc3dvcmQ=', - alwaysAuth: true - } - - t.same(conf.getCredentialsByURI(URI), expected, 'got credentials') - - t.end() - }) -}) - -test('set with always-auth disabled', function (t) { - npmconf.load(common.builtin, function (er, conf) { - t.ifError(er, 'configuration loaded') - - var credentials = { - username: 'username', - password: 'password', - email: 'ogd@aoaioxxysz.net', - alwaysAuth: false - } - - conf.setCredentialsByURI(URI, credentials) - - var expected = { - scope: '//registry.lvh.me:8661/', - token: undefined, - username: 'username', - password: 'password', - email: 'ogd@aoaioxxysz.net', - auth: 'dXNlcm5hbWU6cGFzc3dvcmQ=', - alwaysAuth: false - } - - t.same(conf.getCredentialsByURI(URI), expected, 'got credentials') - - t.end() - }) -}) - -test('set with global always-auth enabled', function (t) { - npmconf.load(common.builtin, function (er, conf) { - t.ifError(er, 'configuration loaded') - var original = conf.get('always-auth') - conf.set('always-auth', true) - - var credentials = { - username: 'username', - password: 'password', - email: 'ogd@aoaioxxysz.net' - } - - conf.setCredentialsByURI(URI, credentials) - - var expected = { - scope: '//registry.lvh.me:8661/', - token: undefined, - username: 'username', - password: 'password', - email: 'ogd@aoaioxxysz.net', - auth: 'dXNlcm5hbWU6cGFzc3dvcmQ=', - alwaysAuth: true - } - - t.same(conf.getCredentialsByURI(URI), expected, 'got credentials') - - conf.set('always-auth', original) - t.end() - }) -}) - -test('set with global always-auth disabled', function (t) { - npmconf.load(common.builtin, function (er, conf) { - t.ifError(er, 'configuration loaded') - var original = conf.get('always-auth') - conf.set('always-auth', false) - - var credentials = { - username: 'username', - password: 'password', - email: 'ogd@aoaioxxysz.net' - } - - conf.setCredentialsByURI(URI, credentials) - - var expected = { - scope: '//registry.lvh.me:8661/', - token: undefined, - username: 'username', - password: 'password', - email: 'ogd@aoaioxxysz.net', - auth: 'dXNlcm5hbWU6cGFzc3dvcmQ=', - alwaysAuth: false - } - - t.same(conf.getCredentialsByURI(URI), expected, 'got credentials') - - conf.set('always-auth', original) - t.end() - }) -}) diff --git a/deps/npm/test/tap/config-edit.js b/deps/npm/test/tap/config-edit.js deleted file mode 100644 index a4f78a262c8b9a..00000000000000 --- a/deps/npm/test/tap/config-edit.js +++ /dev/null @@ -1,74 +0,0 @@ -var fs = require('fs') -var path = require('path') - -var mkdirp = require('mkdirp') -var rimraf = require('rimraf') -var test = require('tap').test -var common = require('../common-tap.js') - -var pkg = common.pkg - -var editorSrc = function () { /* -#!/usr/bin/env node -var fs = require('fs') -if (fs.existsSync(process.argv[2])) { - console.log('success') -} else { - console.log('error') - process.exit(1) -} -*/ }.toString().split('\n').slice(1, -1).join('\n') -var editorPath = path.join(pkg, 'editor') - -test('setup', function (t) { - cleanup(function (er) { - t.ifError(er, 'old directory removed') - - mkdirp(pkg, '0777', function (er) { - fs.writeFileSync(editorPath, editorSrc) - fs.chmodSync(editorPath, '0777') - t.ifError(er, 'created package directory correctly') - t.end() - }) - }) -}) - -test('saving configs', function (t) { - var opts = { - cwd: pkg, - env: { - PATH: process.env.PATH, - // We rely on the cwd + relative path combo here because otherwise, - // this test will break if there's spaces in the editorPath - EDITOR: 'node editor' - } - } - common.npm( - [ - 'config', - '--prefix', pkg, - '--global', - 'edit' - ], - opts, - function (err, code, stdout, stderr) { - t.ifError(err, 'command ran without issue') - - t.equal(stderr, '', 'got nothing on stderr') - t.equal(code, 0, 'exit ok') - t.equal(stdout, 'success\n', 'got success message') - t.end() - } - ) -}) - -test('cleanup', function (t) { - cleanup(function (er) { - t.ifError(er, 'test directory removed OK') - t.end() - }) -}) - -function cleanup (cb) { - rimraf(pkg, cb) -} diff --git a/deps/npm/test/tap/config-envReplace.js b/deps/npm/test/tap/config-envReplace.js deleted file mode 100644 index f65609f050f751..00000000000000 --- a/deps/npm/test/tap/config-envReplace.js +++ /dev/null @@ -1,58 +0,0 @@ -/* eslint-disable no-template-curly-in-string */ - -const fs = require('fs') -const mkdirp = require('mkdirp') -const rimraf = require('rimraf') -const path = require('path') -const ini = require('ini') -const test = require('tap').test -const npmconf = require('../../lib/config/core.js') - -const common = require('../common-tap.js') -const packagePath = common.pkg - -const packageJsonFile = JSON.stringify({ - name: 'config-envReplace' -}) - -const inputConfigFile = [ - 'registry=${NPM_REGISTRY_URL}', - '//${NPM_REGISTRY_HOST}/:_authToken=${NPM_AUTH_TOKEN}', - 'always-auth=true', - '' -].join('\n') - -const expectConfigFile = [ - 'registry=http://my.registry.com/', - '//my.registry.com/:_authToken=xxxxxxxxxxxxxxx', - 'always-auth=true', - '' -].join('\n') - -test('environment variables replacing in configs', function (t) { - process.env = Object.assign(process.env, { - NPM_REGISTRY_URL: 'http://my.registry.com/', - NPM_REGISTRY_HOST: 'my.registry.com', - NPM_AUTH_TOKEN: 'xxxxxxxxxxxxxxx' - }) - mkdirp.sync(packagePath) - const packageJsonPath = path.resolve(packagePath, 'package.json') - const configPath = path.resolve(packagePath, '.npmrc') - fs.writeFileSync(packageJsonPath, packageJsonFile) - fs.writeFileSync(configPath, inputConfigFile) - - const originalCwdPath = process.cwd() - process.chdir(packagePath) - npmconf.load(function (error, conf) { - if (error) throw error - - const foundConfigFile = ini.stringify(conf.sources.project.data) - t.same(ini.parse(foundConfigFile), ini.parse(expectConfigFile)) - - fs.unlinkSync(packageJsonPath) - fs.unlinkSync(configPath) - rimraf.sync(packagePath) - process.chdir(originalCwdPath) - t.end() - }) -}) diff --git a/deps/npm/test/tap/config-list.js b/deps/npm/test/tap/config-list.js deleted file mode 100644 index 7559214a727a57..00000000000000 --- a/deps/npm/test/tap/config-list.js +++ /dev/null @@ -1,69 +0,0 @@ -var fs = require('fs') -var path = require('path') -var test = require('tap').test -var rimraf = require('rimraf') -var mkdirp = require('mkdirp') -var common = require('../common-tap.js') - -var pkg = common.pkg -var opts = { cwd: pkg, env: common.emptyEnv() } -var npmrc = path.resolve(pkg, '.npmrc') -var npmrcContents = ` -_private=private; -registry/:_pwd=pwd; -foo=1234 -` - -test('setup', function (t) { - rimraf.sync(pkg) - mkdirp.sync(pkg) - - // Write per-project conf file - fs.writeFileSync(npmrc, npmrcContents, 'utf8') - - // Create empty package.json to indicate project root - fs.writeFileSync(path.resolve(pkg, 'package.json'), '{}', 'utf8') - t.end() -}) - -test('config list includes project config', function (t) { - common.npm( - ['config', 'list'], - opts, - function (err, code, stdout, stderr) { - t.ifError(err) - t.equal(stderr, '', 'stderr is empty') - - var expected = '; project config ' + npmrc + '\nfoo = "1234"' - t.match(stdout, expected, 'contains project config') - t.notMatch(stdout, '_private', 'excludes private config') - t.notMatch(stdout, '_pwd', 'excludes private segmented config') - t.end() - } - ) -}) - -test('config list --json outputs json', function (t) { - common.npm( - ['config', 'list', '--json'], - opts, - function (err, code, stdout, stderr) { - t.ifError(err) - t.equal(stderr, '', 'stderr is empty') - - var json = JSON.parse(stdout) - t.equal(json.foo, '1234', 'contains project config') - t.equal(json.argv, undefined, 'excludes argv') - t.equal(json._private, undefined, 'excludes private config') - t.equal(json['registry/:_pwd'], undefined, 'excludes private config') - t.end() - } - ) -}) - -// TODO: test cases for other configuration types (cli, env, user, global) - -test('clean', function (t) { - rimraf.sync(pkg) - t.end() -}) diff --git a/deps/npm/test/tap/config-malformed.js b/deps/npm/test/tap/config-malformed.js deleted file mode 100644 index 0d859e00340f33..00000000000000 --- a/deps/npm/test/tap/config-malformed.js +++ /dev/null @@ -1,14 +0,0 @@ -var test = require('tap').test - -var npmconf = require('../../lib/config/core.js') -var common = require('../common-config.js') - -test('with malformed', function (t) { - npmconf.load({}, common.malformed, function (er, conf) { - t.ok(er, 'Expected parse error') - if (!(er && /Failed parsing JSON config key email/.test(er.message))) { - throw er - } - t.end() - }) -}) diff --git a/deps/npm/test/tap/config-meta.js b/deps/npm/test/tap/config-meta.js deleted file mode 100644 index a98d5e6c4dabd2..00000000000000 --- a/deps/npm/test/tap/config-meta.js +++ /dev/null @@ -1,137 +0,0 @@ -// this is a weird meta test. It verifies that all the instances of -// `npm.config.get(...)` are: -// a) Simple strings, and not variables -// b) Documented -// c) Defined in the `npmconf` package. - -var test = require('tap').test -var fs = require('fs') -var path = require('path') -var root = path.resolve(__dirname, '..', '..') -var lib = path.resolve(root, 'lib') -var bin = path.resolve(root, 'bin') -var nm = path.resolve(root, 'node_modules') -var doc = path.resolve(root, 'docs/content/using-npm/config.md') -var FILES = [] -var CONFS = {} -var DOC = {} - -var exceptions = [ - path.resolve(lib, 'adduser.js'), - path.resolve(lib, 'config.js'), - path.resolve(lib, 'config', 'pacote.js'), - path.resolve(lib, 'pack.js'), - path.resolve(lib, 'publish.js'), - path.resolve(lib, 'install', 'inflate-shrinkwrap.js'), - path.resolve(lib, 'utils', 'lifecycle.js'), - path.resolve(lib, 'utils', 'map-to-registry.js'), - path.resolve(nm, 'npm-registry-client', 'lib', 'publish.js'), - path.resolve(nm, 'npm-registry-client', 'lib', 'request.js') -] - -test('get files', function (t) { - walk(nm) - walk(lib) - walk(bin) - t.pass('got files') - t.end() - - function walk (lib) { - var files = fs.readdirSync(lib).map(function (f) { - return path.resolve(lib, f) - }) - files.forEach(function (f) { - try { - var s = fs.lstatSync(f) - } catch (er) { - return - } - if (s.isDirectory()) { - walk(f) - } else if (f.match(/\.js$/)) { - FILES.push(f) - } - }) - } -}) - -test('get lines', function (t) { - FILES.forEach(function (f) { - var lines = fs.readFileSync(f, 'utf8').split(/\r|\n/) - lines.forEach(function (l, i) { - var matches = l.split(/conf(?:ig)?\.get\(/g) - matches.shift() - matches.forEach(function (m) { - m = m.split(')').shift() - var literal = m.match(/^[''].+?['']/) - if (literal) { - m = literal[0].slice(1, -1) - if (!m.match(/^_/) && m !== 'argv') { - CONFS[m] = { - file: f, - line: i - } - } - } else if (exceptions.indexOf(f) === -1 && f.indexOf('.cache') === -1) { - t.fail('non-string-literal config used in ' + f + ':' + i) - } - }) - }) - }) - t.pass('got lines') - t.end() -}) - -test('get docs', function (t) { - var d = fs.readFileSync(doc, 'utf8').split(/\r|\n/) - // walk down until the '## Config Settings' section - for (var i = 0; i < d.length && d[i] !== '### Config Settings'; i++); - i++ - // now gather up all the ^###\s lines until the next ^##\s - for (; i < d.length && !d[i].match(/^### /); i++) { - if (d[i].match(/^#### /)) { - DOC[ d[i].replace(/^#### /, '').trim() ] = true - } - } - t.pass('read the docs') - t.end() -}) - -test('check configs', function (t) { - var defs = require('../../lib/config/defaults.js') - var types = Object.keys(defs.types) - var defaults = Object.keys(defs.defaults) - for (var c1 in CONFS) { - if (CONFS[c1].file.indexOf(lib) === 0) { - t.ok(DOC[c1], 'should be documented ' + c1 + ' ' + - CONFS[c1].file + ':' + CONFS[c1].line) - t.ok(types.indexOf(c1) !== -1, 'should be defined in npmconf ' + c1) - t.ok(defaults.indexOf(c1) !== -1, 'should have default in npmconf ' + c1) - } - } - - // TODO - needs better figgy-pudding introspection - // for (var c2 in DOC) { - // if (c2 !== 'versions' && c2 !== 'version' && c2 !== 'init.version' && c2 !== 'ham-it-up') { - // t.ok(CONFS[c2], 'config in doc should be used somewhere ' + c2) - // t.ok(types.indexOf(c2) !== -1, 'should be defined in npmconf ' + c2) - // t.ok(defaults.indexOf(c2) !== -1, 'should have default in npmconf ' + c2) - // } - // } - - types.forEach(function (c) { - if (!c.match(/^_/) && c !== 'argv' && !c.match(/^versions?$/) && c !== 'ham-it-up') { - t.ok(DOC[c], 'defined type should be documented ' + c) - // t.ok(CONFS[c], 'defined type should be used ' + c) - } - }) - - defaults.forEach(function (c) { - if (!c.match(/^_/) && c !== 'argv' && !c.match(/^versions?$/) && c !== 'ham-it-up') { - t.ok(DOC[c], 'defaulted type should be documented ' + c) - // t.ok(CONFS[c], 'defaulted type should be used ' + c) - } - }) - - t.end() -}) diff --git a/deps/npm/test/tap/config-new-cafile.js b/deps/npm/test/tap/config-new-cafile.js deleted file mode 100644 index e4cc65ec747a6e..00000000000000 --- a/deps/npm/test/tap/config-new-cafile.js +++ /dev/null @@ -1,37 +0,0 @@ -const common = require('../common-tap.js') - -var path = require('path') -var fs = require('graceful-fs') -var test = require('tap').test -var rimraf = require('rimraf') -var npmconf = require('../../lib/config/core.js') - -var dir = common.pkg -var beep = path.resolve(dir, 'beep.pem') -var npmrc = path.resolve(dir, 'npmrc') - -test('can set new cafile when old is gone', function (t) { - t.plan(5) - fs.writeFileSync(npmrc, '') - fs.writeFileSync(beep, '') - npmconf.load({ userconfig: npmrc }, function (error, conf) { - npmconf.loaded = false - t.ifError(error) - conf.set('cafile', beep, 'user') - conf.save('user', function (error) { - t.ifError(error) - t.equal(conf.get('cafile'), beep) - rimraf.sync(beep) - npmconf.load({ userconfig: npmrc }, function (error, conf) { - if (error) { - throw error - } - t.equal(conf.get('cafile'), beep) - conf.del('cafile') - conf.save('user', function (error) { - t.ifError(error) - }) - }) - }) - }) -}) diff --git a/deps/npm/test/tap/config-private.js b/deps/npm/test/tap/config-private.js deleted file mode 100644 index e6bf9d2e83cee3..00000000000000 --- a/deps/npm/test/tap/config-private.js +++ /dev/null @@ -1,83 +0,0 @@ -var fs = require('fs') -var path = require('path') -var test = require('tap').test -var rimraf = require('rimraf') -var mkdirp = require('mkdirp') -var common = require('../common-tap.js') - -var pkg = common.pkg -var opts = { cwd: pkg } - -test('setup', function (t) { - rimraf.sync(pkg) - mkdirp.sync(pkg) - t.end() -}) - -test('config get private var (old auth)', function (t) { - common.npm( - [ - 'config', - 'get', - '_auth' - ], - opts, - function (err, code, stdout, stderr) { - t.ifError(err) - - t.similar(stderr, /sekretz/, 'password blocked on stderr') - t.equal(stdout, '', 'no output') - t.end() - } - ) -}) - -test('config get private var (new auth)', function (t) { - common.npm( - [ - 'config', - 'get', - '//registry.npmjs.org/:_password' - ], - opts, - function (err, code, stdout, stderr) { - t.ifError(err) - - t.similar(stderr, /sekretz/, 'password blocked on stderr') - t.equal(stdout, '', 'no output') - t.end() - } - ) -}) - -test('config get public var (new username)', function (t) { - var FIXTURE_PATH = path.resolve(pkg, 'fixture_npmrc') - var s = '//registry.lvh.me/:username = wombat\n' + - '//registry.lvh.me/:_password = YmFkIHBhc3N3b3Jk\n' + - '//registry.lvh.me/:email = lindsay@wdu.org.au\n' - fs.writeFileSync(FIXTURE_PATH, s, 'ascii') - fs.chmodSync(FIXTURE_PATH, '0444') - - common.npm( - [ - 'config', - 'get', - '//registry.lvh.me/:username', - '--userconfig=' + FIXTURE_PATH, - '--registry=http://registry.lvh.me/' - ], - opts, - function (err, code, stdout, stderr) { - t.ifError(err) - - t.equal(stderr, '', 'stderr is empty') - t.equal(stdout, 'wombat\n', 'got usename is output') - t.end() - } - ) -}) - -test('clean', function (t) { - rimraf.sync(pkg) - t.end() -}) diff --git a/deps/npm/test/tap/config-project.js b/deps/npm/test/tap/config-project.js deleted file mode 100644 index 0f7be913c097fa..00000000000000 --- a/deps/npm/test/tap/config-project.js +++ /dev/null @@ -1,66 +0,0 @@ -var test = require('tap').test -var path = require('path') -var fix = path.resolve(__dirname, '..', 'fixtures', 'config') -var projectRc = path.resolve(fix, '.npmrc') -var npmconf = require('../../lib/config/core.js') -var common = require('../common-config.js') - -var projectData = { just: 'testing' } - -var ucData = common.ucData -var envData = common.envData -var envDataFix = common.envDataFix - -var gcData = { 'package-config:foo': 'boo' } - -var biData = {} - -var cli = { foo: 'bar', umask: parseInt('022', 8), prefix: fix } - -var expectList = [ - cli, - envDataFix, - projectData, - ucData, - gcData, - biData -] - -var expectSources = { - cli: { data: cli }, - env: { - data: envDataFix, - source: envData, - prefix: '' - }, - project: { - path: projectRc, - type: 'ini', - data: projectData - }, - user: { - path: common.userconfig, - type: 'ini', - data: ucData - }, - global: { - path: common.globalconfig, - type: 'ini', - data: gcData - }, - builtin: { data: biData } -} - -test('no builtin', function (t) { - npmconf.load(cli, function (er, conf) { - if (er) throw er - t.same(conf.list, expectList) - t.same(conf.sources, expectSources) - t.same(npmconf.rootConf.list, []) - t.equal(npmconf.rootConf.root, npmconf.defs.defaults) - t.equal(conf.root, npmconf.defs.defaults) - t.equal(conf.get('umask'), parseInt('022', 8)) - t.equal(conf.get('heading'), 'npm') - t.end() - }) -}) diff --git a/deps/npm/test/tap/config-save.js b/deps/npm/test/tap/config-save.js deleted file mode 100644 index 23dc7b59607859..00000000000000 --- a/deps/npm/test/tap/config-save.js +++ /dev/null @@ -1,91 +0,0 @@ -var fs = require('fs') -var ini = require('ini') -var t = require('tap') -const test = t.test -var common = require('../common-config.js') -var commonTap = require('../common-tap.js') -var npmconf = require('../../lib/config/core.js') - -var expectConf = [ - 'globalconfig = ' + common.globalconfig, - 'email = i@izs.me', - 'env-thing = foo', - 'init.author.name = Isaac Z. Schlueter', - 'init.author.email = i@izs.me', - 'init.author.url = http://blog.izs.me/', - 'init.version = 1.2.3', - 'npm:publishtest = true', - '_npmjs.org:couch = https://admin:password@localhost:5984/registry', - 'npm-www:nocache = 1', - 'sign-git-tag = false', - 'message = v%s', - 'strict-ssl = false', - '_auth = dXNlcm5hbWU6cGFzc3dvcmQ=', - '', - '[_token]', - 'AuthSession = yabba-dabba-doodle', - 'version = 1', - 'expires = 1345001053415', - 'path = /', - 'httponly = true', - '' -].join('\n') - -var expectFile = [ - 'globalconfig = ' + common.globalconfig, - 'email = i@izs.me', - 'env-thing = foo', - 'init.author.name = Isaac Z. Schlueter', - 'init.author.email = i@izs.me', - 'init.author.url = http://blog.izs.me/', - 'init.version = 1.2.3', - 'npm:publishtest = true', - '_npmjs.org:couch = https://admin:password@localhost:5984/registry', - 'npm-www:nocache = 1', - 'sign-git-tag = false', - 'message = v%s', - 'strict-ssl = false', - '_auth = dXNlcm5hbWU6cGFzc3dvcmQ=', - '', - '[_token]', - 'AuthSession = yabba-dabba-doodle', - 'version = 1', - 'expires = 1345001053415', - 'path = /', - 'httponly = true', - '' -].join('\n') - -const userconfig = commonTap.pkg + '/userconfig' -fs.writeFileSync(userconfig, fs.readFileSync(common.userconfig)) -process.env.npm_config_userconfig = userconfig - -test('saving configs', function (t) { - npmconf.load(function (er, conf) { - if (er) throw er - - conf.set('sign-git-tag', false, 'user') - conf.del('nodedir') - conf.del('tmp') - var foundConf = ini.stringify(conf.sources.user.data) - t.same(ini.parse(foundConf), ini.parse(expectConf)) - fs.unlinkSync(common.userconfig) - conf.save('user', function (er) { - if (er) throw er - - var uc = fs.readFileSync(conf.get('userconfig'), 'utf8') - t.same(ini.parse(uc), ini.parse(expectFile)) - t.end() - }) - }) -}) - -test('setting prefix', function (t) { - npmconf.load(function (er, conf) { - if (er) throw er - - conf.prefix = 'newvalue' - t.same(conf.prefix, 'newvalue') - t.end() - }) -}) diff --git a/deps/npm/test/tap/correct-mkdir.js b/deps/npm/test/tap/correct-mkdir.js deleted file mode 100644 index 175fb34a003bca..00000000000000 --- a/deps/npm/test/tap/correct-mkdir.js +++ /dev/null @@ -1,167 +0,0 @@ -/* eslint-disable camelcase */ -var t = require('tap') -var test = t.test -var assert = require('assert') -var requireInject = require('require-inject') -const common = require('../common-tap.js') -var cache_dir = common.pkg -common.skipIfWindows('windows does not use correct-mkdir behavior') - -test('correct-mkdir: no race conditions', function (t) { - var mock_fs = {} - var did_hook = false - mock_fs.lstat = function (path, cb) { - if (path === cache_dir) { - // Return a non-matching owner - cb(null, { - uid: +process.getuid() + 1, - isDirectory: function () { - return true - } - }) - if (!did_hook) { - did_hook = true - doHook() - } - } else { - assert.ok(false, 'Unhandled stat path: ' + path) - } - } - var chown_in_progress = 0 - var mock_chownr = function (path, uid, gid, cb) { - ++chown_in_progress - process.nextTick(function () { - --chown_in_progress - cb(null) - }) - } - var mocks = { - 'graceful-fs': mock_fs, - 'chownr': mock_chownr, - 'infer-owner': requireInject('infer-owner', { fs: mock_fs }) - } - var correctMkdir = requireInject('../../lib/utils/correct-mkdir.js', mocks) - - var calls_in_progress = 3 - function handleCallFinish () { - t.equal(chown_in_progress, 0, 'should not return while chown still in progress') - if (!--calls_in_progress) { - t.end() - } - } - function doHook () { - // This is fired during the first correctMkdir call, after the stat has finished - // but before the chownr has finished - // Buggy old code will fail and return a cached value before initial call is done - correctMkdir(cache_dir, handleCallFinish) - } - // Initial call - correctMkdir(cache_dir, handleCallFinish) - // Immediate call again in case of race condition there - correctMkdir(cache_dir, handleCallFinish) -}) - -test('correct-mkdir: ignore ENOENTs from chownr', function (t) { - var mock_fs = {} - mock_fs.lstat = function (path, cb) { - if (path === cache_dir) { - cb(null, { - isDirectory: function () { - return true - } - }) - } else { - assert.ok(false, 'Unhandled stat path: ' + path) - } - } - var mock_chownr = function (path, uid, gid, cb) { - cb(Object.assign(new Error(), {code: 'ENOENT'})) - } - var mocks = { - 'graceful-fs': mock_fs, - 'chownr': mock_chownr - } - var correctMkdir = requireInject('../../lib/utils/correct-mkdir.js', mocks) - - function handleCallFinish (err) { - t.ifErr(err, 'chownr\'s ENOENT errors were ignored') - t.end() - } - correctMkdir(cache_dir, handleCallFinish) -}) - -// NEED TO RUN LAST - -// These test checks that Windows users are protected by crashes related to -// unexpectedly having a UID/GID other than 0 if a user happens to add these -// variables to their environment. There are assumptions in correct-mkdir -// that special-case Windows by checking on UID-related things. -test('correct-mkdir: SUDO_UID and SUDO_GID non-Windows', function (t) { - process.env.SUDO_UID = 999 - process.env.SUDO_GID = 999 - process.getuid = function () { return 0 } - process.getgid = function () { return 0 } - var mock_fs = {} - mock_fs.lstat = function (path, cb) { - if (path === cache_dir) { - cb(null, { - uid: 0, - isDirectory: function () { - return true - } - }) - } else { - assert.ok(false, 'Unhandled stat path: ' + path) - } - } - var mock_chownr = function (path, uid, gid, cb) { - t.is(uid, +process.env.SUDO_UID, 'using the environment\'s UID') - t.is(gid, +process.env.SUDO_GID, 'using the environment\'s GID') - cb(null, {}) - } - var mocks = { - 'graceful-fs': mock_fs, - 'chownr': mock_chownr - } - var correctMkdir = requireInject('../../lib/utils/correct-mkdir.js', mocks) - - function handleCallFinish () { - t.end() - } - correctMkdir(cache_dir, handleCallFinish) -}) - -test('correct-mkdir: SUDO_UID and SUDO_GID Windows', function (t) { - process.env.SUDO_UID = 999 - process.env.SUDO_GID = 999 - delete process.getuid - delete process.getgid - var mock_fs = {} - mock_fs.lstat = function (path, cb) { - if (path === cache_dir) { - cb(null, { - uid: 0, - isDirectory: function () { - return true - } - }) - } else { - assert.ok(false, 'Unhandled stat path: ' + path) - } - } - var mock_chownr = function (path, uid, gid, cb) { - t.fail('chownr should not be called at all on Windows') - cb(new Error('nope')) - } - var mocks = { - 'graceful-fs': mock_fs, - 'chownr': mock_chownr - } - var correctMkdir = requireInject('../../lib/utils/correct-mkdir.js', mocks) - - function handleCallFinish (err) { - t.ifErr(err, 'chownr was not called because Windows') - t.end() - } - correctMkdir(cache_dir, handleCallFinish) -}) diff --git a/deps/npm/test/tap/cruft-test.js b/deps/npm/test/tap/cruft-test.js deleted file mode 100644 index 4f2ed6c0d0a713..00000000000000 --- a/deps/npm/test/tap/cruft-test.js +++ /dev/null @@ -1,43 +0,0 @@ -'use strict' -var fs = require('graceful-fs') -var path = require('path') -var mkdirpSync = require('mkdirp').sync -var rimraf = require('rimraf') -var test = require('tap').test -var common = require('../common-tap.js') - -var base = common.pkg -var cruft = path.join(base, 'node_modules', 'cruuuft') -var pkg = { - name: 'example', - version: '1.0.0', - dependencies: {} -} - -function setup () { - mkdirpSync(path.dirname(cruft)) - fs.writeFileSync(cruft, 'this is some cruft for sure') - fs.writeFileSync(path.join(base, 'package.json'), JSON.stringify(pkg)) -} - -function cleanup () { - rimraf.sync(base) -} - -test('setup', function (t) { - cleanup() - setup() - t.done() -}) - -test('cruft', function (t) { - common.npm(['ls'], {cwd: base}, function (er, code, stdout, stderr) { - t.is(stderr, '', 'no warnings or errors from ls') - t.done() - }) -}) - -test('cleanup', function (t) { - cleanup() - t.done() -}) diff --git a/deps/npm/test/tap/debug-logs.js b/deps/npm/test/tap/debug-logs.js deleted file mode 100644 index 4da52bfcee8ae3..00000000000000 --- a/deps/npm/test/tap/debug-logs.js +++ /dev/null @@ -1,97 +0,0 @@ -'use strict' -var path = require('path') -var test = require('tap').test -var Tacks = require('tacks') -var glob = require('glob') -var asyncMap = require('slide').asyncMap -var File = Tacks.File -var Dir = Tacks.Dir -var common = require('../common-tap.js') - -var basedir = common.pkg -var testdir = path.join(basedir, 'testdir') -var cachedir = common.cache -var globaldir = path.join(basedir, 'global') -var tmpdir = path.join(basedir, 'tmp') - -var conf = { - cwd: testdir, - env: Object.assign({}, process.env, { - npm_config_tmp: tmpdir, - npm_config_prefix: globaldir, - npm_config_registry: common.registry, - npm_config_loglevel: 'warn' - }) -} - -var fixture = new Tacks(Dir({ - global: Dir(), - tmp: Dir(), - testdir: Dir({ - 'package.json': File({ - name: 'debug-logs', - version: '1.0.0', - scripts: { - true: 'node -e "process.exit(0)"', - false: 'node -e "process.exit(1)"' - } - }) - }) -})) - -test('setup', function (t) { - fixture.create(basedir) - t.done() -}) - -test('example', function (t) { - common.npm(['run', 'false'], conf, function (err, code, stdout, stderr) { - if (err) throw err - t.is(code, 1, 'command errored') - const re = /A complete log of this run can be found in:.*\nnpm ERR! {5,5}(.*)/ - const matches = stderr.match(re) - t.match(stderr, re, 'debug log mentioned in error message') - if (matches) { - var logfile = matches[1] - t.matches(path.relative(cachedir, logfile), /^_logs/, 'debug log is inside the cache in _logs') - } - - // we run a bunch concurrently, this will actually create > than our limit - // as the check is done when the command starts - // - // It has to be > the log count (10) but also significantly higher than - // the number of cores on the machine, or else some might be able to get - // to the log folder pruning logic in parallel, resulting in FEWER files - // than we expect being present at the end. - var procCount = Math.max(require('os').cpus().length * 2, 12) - var todo = new Array(procCount).join(',').split(',').map((v, k) => k) - asyncMap(todo, function (num, next) { - // another way would be to just simulate this? - // var f = path.join(cachedir, '_logs', num + '-debug.log') - // require('fs').writeFile(f, 'log ' + num, next) - common.npm(['run', '--logs-max=10', 'false'], conf, function (err, code) { - if (err) throw err - t.is(code, 1, 'run #' + num + ' errored as expected') - next() - }) - }, function () { - var files = glob.sync(path.join(cachedir, '_logs', '*')) - t.ok(files.length > 10, 'there should be more than 10 log files') - - // now we do one more and that should clean up the list - common.npm(['run', '--logs-max=10', 'false'], conf, function (err, code) { - if (err) throw err - t.is(code, 1, 'final run errored as expected') - var files = glob.sync(path.join(cachedir, '_logs', '*')) - t.is(files.length, 10, 'there should never be more than 10 log files') - common.npm(['run', '--logs-max=5', 'true'], conf, function (err, code) { - if (err) throw err - t.is(code, 0, 'success run is ok') - var files = glob.sync(path.join(cachedir, '_logs', '*')) - t.is(files.length, 4, 'after success there should be logs-max - 1 log files') - t.done() - }) - }) - }) - }) -}) diff --git a/deps/npm/test/tap/dedupe-git-semver.js b/deps/npm/test/tap/dedupe-git-semver.js deleted file mode 100644 index b7e31b08614f01..00000000000000 --- a/deps/npm/test/tap/dedupe-git-semver.js +++ /dev/null @@ -1,138 +0,0 @@ -'use strict' -const fs = require('fs') -const path = require('path') -const test = require('tap').test -const requireInject = require('require-inject') -const Tacks = require('tacks') -const File = Tacks.File -const Dir = Tacks.Dir - -const manifests = { - 'git-wrap': { - name: 'git-wrap', - version: '1.0.0', - dependencies: { - git: 'git+https://example.com/git#semver:1.0' - } - }, - git: { - name: 'git', - version: '1.0.0' - } -} - -const npm = requireInject.installGlobally('../../lib/npm.js', { - pacote: { - manifest: function (spec) { - const manifest = manifests[spec.name] - manifest._requested = spec - manifest._resolved = spec.saveSpec.replace(/^file:/, '').replace(/(:?#.*)$/, '#0000000000000000000000000000000000000000') - manifest._from = spec.rawSpec - return Promise.resolve(manifest) - } - }, - '../../lib/utils/output.js': function () { - // do not output to stdout - } -}) - -const common = require('../common-tap.js') -const basedir = common.pkg -const testdir = path.join(basedir, 'testdir') -const cachedir = common.cache -const tmpdir = path.join(basedir, 'tmp') - -const cwd = process.cwd() - -const conf = { - cache: cachedir, - tmp: tmpdir, - loglevel: 'silent', - 'package-lock-only': true -} - -const fixture = new Tacks(Dir({ - cache: Dir(), - global: Dir(), - tmp: Dir(), - testdir: Dir({ - 'package.json': File({ - name: 'fixture', - version: '1.0.0', - dependencies: { - git: 'git+https://example.com/git#semver:1', - 'git-wrap': 'file:git-wrap-1.0.0.tgz' - } - }), - // Tarball source: - // 'git-wrap': Dir({ - // 'package.json': File({ - // name: 'git-wrap', - // version: '1.0.0', - // dependencies: { - // git: 'git+https://example.com/git#semver:1.0' - // } - // }) - // }), - 'git-wrap-1.0.0.tgz': File(Buffer.from( - '1f8b0800000000000003ed8fcd0ac23010843df729423caaf9c13642df26' + - 'b44bad9a3434f107a4efeec68aa7de2c8898ef32cb0c3bec3a5d1d7503dc' + - '8dca0ebeb38b991142a83c27537e44ee30db164a48a994c01987a210a873' + - '1f32c5d907dde3299ff68cbf90b7fe08f78c106ab5015a12dab46173edb5' + - 'a3ebe85ea0f76d676320996062746b70606bb0550b1ea3b84f9e9baf82d5' + - '3e04e74bcee1a68d3b01ab3ac3d15f7a30d8586215c59d211bb26fff9e48' + - '2412ffcc034458283d00080000', - 'hex' - )) - }) -})) - -function setup () { - cleanup() - fixture.create(basedir) -} - -function cleanup () { - fixture.remove(basedir) -} - -test('setup', function (t) { - setup() - process.chdir(testdir) - npm.load(conf, function (err) { - if (err) throw err - t.done() - }) -}) - -test('dedupe matching git semver ranges', function (t) { - npm.commands.install(function (err) { - if (err) throw err - const packageLock = JSON.parse(fs.readFileSync('package-lock.json')) - t.same(packageLock, { - name: 'fixture', - version: '1.0.0', - lockfileVersion: 1, - requires: true, - dependencies: { - git: { - from: 'git+https://example.com/git#semver:1', - version: 'git+https://example.com/git#0000000000000000000000000000000000000000' - }, - 'git-wrap': { - version: 'file:git-wrap-1.0.0.tgz', - requires: { - git: 'git+https://example.com/git#semver:1' - } - } - } - }) - t.done() - }) -}) - -test('cleanup', function (t) { - process.chdir(cwd) - cleanup() - t.done() -}) diff --git a/deps/npm/test/tap/dedupe-scoped.js b/deps/npm/test/tap/dedupe-scoped.js deleted file mode 100644 index 957f67e141c40c..00000000000000 --- a/deps/npm/test/tap/dedupe-scoped.js +++ /dev/null @@ -1,155 +0,0 @@ -var fs = require('fs') -var join = require('path').join - -var mkdirp = require('mkdirp') -var rimraf = require('rimraf') -var test = require('tap').test - -var common = require('../common-tap.js') -var pkg = common.pkg -var modules = join(pkg, 'node_modules') - -var EXEC_OPTS = { cwd: pkg } - -var body = [ - 'move\t@scope/shared\t2.1.6\tnode_modules/@scope/shared\t\tnode_modules/first/node_modules/@scope/shared', - 'move\tfirstUnique\t0.6.0\tnode_modules/firstUnique\t\tnode_modules/first/node_modules/firstUnique', - 'remove\t@scope/shared\t2.1.6\tnode_modules/second/node_modules/@scope/shared', - 'move\tsecondUnique\t1.2.0\tnode_modules/secondUnique\t\tnode_modules/second/node_modules/secondUnique' -] - -var deduper = { - 'name': 'dedupe', - 'version': '0.0.0', - 'dependencies': { - 'first': '1.0.0', - 'second': '2.0.0' - } -} - -var first = { - 'name': 'first', - 'version': '1.0.0', - 'dependencies': { - 'firstUnique': '0.6.0', - '@scope/shared': '2.1.6' - }, - '_resolved': 'foo', - '_integrity': 'sha1-deadbeef' -} - -var second = { - 'name': 'second', - 'version': '2.0.0', - 'dependencies': { - 'secondUnique': '1.2.0', - '@scope/shared': '2.1.6' - }, - '_resolved': 'foo', - '_integrity': 'sha1-deadbeef' -} - -var shared = { - 'name': '@scope/shared', - 'version': '2.1.6', - '_resolved': 'foo', - '_integrity': 'sha1-deadbeef' -} - -var firstUnique = { - 'name': 'firstUnique', - 'version': '0.6.0', - '_resolved': 'foo', - '_integrity': 'sha1-deadbeef' -} - -var secondUnique = { - 'name': 'secondUnique', - 'version': '1.2.0', - '_resolved': 'foo', - '_integrity': 'sha1-deadbeef' -} - -test('setup', function (t) { - setup() - t.end() -}) - -// we like the cars -function ltrimm (l) { return l.trim() } - -test('dedupe finds the common scoped modules and moves it up one level', function (t) { - common.npm( - [ - 'find-dupes' // I actually found a use for this command! - ], - EXEC_OPTS, - function (err, code, stdout, stderr) { - t.ifError(err, 'successful dry run against fake install') - t.notOk(code, 'npm ran without issue') - t.notOk(stderr, 'npm printed no errors') - t.same( - stdout.trim().replace(/\\/g, '/').split('\n').map(ltrimm), - body.map(ltrimm), - 'got expected output' - ) - - t.end() - } - ) -}) - -test('cleanup', function (t) { - cleanup() - t.end() -}) - -function setup (cb) { - cleanup() - - mkdirp.sync(pkg) - fs.writeFileSync( - join(pkg, 'package.json'), - JSON.stringify(deduper, null, 2) - ) - - mkdirp.sync(join(modules, 'first')) - fs.writeFileSync( - join(modules, 'first', 'package.json'), - JSON.stringify(first, null, 2) - ) - - mkdirp.sync(join(modules, 'first', 'node_modules', 'firstUnique')) - fs.writeFileSync( - join(modules, 'first', 'node_modules', 'firstUnique', 'package.json'), - JSON.stringify(firstUnique, null, 2) - ) - - mkdirp.sync(join(modules, 'first', 'node_modules', '@scope', 'shared')) - fs.writeFileSync( - join(modules, 'first', 'node_modules', '@scope', 'shared', 'package.json'), - JSON.stringify(shared, null, 2) - ) - - mkdirp.sync(join(modules, 'second')) - fs.writeFileSync( - join(modules, 'second', 'package.json'), - JSON.stringify(second, null, 2) - ) - - mkdirp.sync(join(modules, 'second', 'node_modules', 'secondUnique')) - fs.writeFileSync( - join(modules, 'second', 'node_modules', 'secondUnique', 'package.json'), - JSON.stringify(secondUnique, null, 2) - ) - - mkdirp.sync(join(modules, 'second', 'node_modules', '@scope', 'shared')) - fs.writeFileSync( - join(modules, 'second', 'node_modules', '@scope', 'shared', 'package.json'), - JSON.stringify(shared, null, 2) - ) -} - -function cleanup () { - rimraf.sync(pkg) -} diff --git a/deps/npm/test/tap/dedupe.js b/deps/npm/test/tap/dedupe.js deleted file mode 100644 index 109f81656237bf..00000000000000 --- a/deps/npm/test/tap/dedupe.js +++ /dev/null @@ -1,122 +0,0 @@ -var fs = require('graceful-fs') -var path = require('path') -var existsSync = fs.existsSync || path.existsSync - -var mkdirp = require('mkdirp') -var mr = require('npm-registry-mock') -var rimraf = require('rimraf') -var test = require('tap').test - -var common = require('../common-tap.js') -var server - -var pkg = common.pkg - -var EXEC_OPTS = { cwd: pkg } - -var json = { - author: 'Dedupe tester', - name: 'dedupe', - version: '0.0.0', - dependencies: { - optimist: '0.6.0', - clean: '2.1.6' - } -} - -var shrinkwrap = { - name: 'dedupe', - version: '0.0.0', - dependencies: { - clean: { - version: '2.1.6', - dependencies: { - checker: { - version: '0.5.2', - dependencies: { - async: { version: '0.2.10' } - } - }, - minimist: { version: '0.0.5' } - } - }, - optimist: { - version: '0.6.0', - dependencies: { - wordwrap: { version: '0.0.2' }, - minimist: { version: '0.0.5' } - } - } - } -} - -test('setup', function (t) { - t.comment('test for https://github.com/npm/npm/issues/4675') - setup(function () { - t.end() - }) -}) - -test('dedupe finds the common module and moves it up one level', function (t) { - common.npm([ - '--registry', common.registry, - '--no-save', - 'install', '.' - ], - EXEC_OPTS, - function (err, code) { - t.ifError(err, 'successfully installed directory') - t.equal(code, 0, 'npm install exited with code') - common.npm( - [ - 'dedupe' - ], - EXEC_OPTS, - function (err, code) { - t.ifError(err, 'successfully deduped against previous install') - t.notOk(code, 'npm dedupe exited with code') - - t.ok(existsSync(path.join(pkg, 'node_modules', 'minimist')), 'minimist module exists') - t.notOk( - existsSync(path.join(pkg, 'node_modules', 'clean', 'node_modules', 'minimist')), - 'no clean/minimist' - ) - t.notOk( - existsSync(path.join(pkg, 'node_modules', 'optimist', 'node_modules', 'minimist')), - 'no optmist/minimist' - ) - t.end() - } - ) - }) -}) - -test('cleanup', function (t) { - server.close() - cleanup() - - t.end() -}) - -function cleanup () { - rimraf.sync(pkg) -} - -function setup (cb) { - cleanup() - mkdirp.sync(pkg) - fs.writeFileSync( - path.join(pkg, 'package.json'), - JSON.stringify(json, null, 2) - ) - fs.writeFileSync( - path.join(pkg, 'npm-shrinkwrap.json'), - JSON.stringify(shrinkwrap, null, 2) - ) - process.chdir(pkg) - - mr({ port: common.port }, function (er, s) { - server = s - cb() - }) -} diff --git a/deps/npm/test/tap/deprecate.js b/deps/npm/test/tap/deprecate.js deleted file mode 100644 index 987acb80afd409..00000000000000 --- a/deps/npm/test/tap/deprecate.js +++ /dev/null @@ -1,157 +0,0 @@ -var mr = require('npm-registry-mock') - -var test = require('tap').test -var common = require('../common-tap.js') - -var server - -var cache = { - '_id': 'cond', - '_rev': '19-d458a706de1740662cd7728d7d7ddf07', - 'name': 'cond', - 'time': { - 'modified': '2015-02-13T07:33:58.120Z', - 'created': '2014-03-16T20:52:52.236Z', - '0.0.0': '2014-03-16T20:52:52.236Z', - '0.0.1': '2014-03-16T21:12:33.393Z', - '0.0.2': '2014-03-16T21:15:25.430Z' - }, - 'versions': { - '0.0.0': {}, - '0.0.1': {}, - '0.0.2': {} - }, - 'dist-tags': { - 'latest': '0.0.2' - }, - 'description': 'Restartable error handling system', - 'license': 'CC0' -} - -test('setup', function (t) { - mr({port: common.port}, function (err, s) { - t.ifError(err, 'registry mocked successfully') - server = s - t.ok(true) - t.end() - }) -}) - -test('npm deprecate an unscoped package', function (t) { - var deprecated = JSON.parse(JSON.stringify(cache)) - deprecated.versions = { - '0.0.0': {}, - '0.0.1': { deprecated: 'make it dead' }, - '0.0.2': {} - } - server.get('/cond?write=true').reply(200, cache) - server.put('/cond', deprecated).reply(201, { deprecated: true }) - common.npm([ - 'deprecate', - 'cond@0.0.1', - 'make it dead', - '--registry', common.registry, - '--loglevel', 'silent' - ], {}, - function (er, code, stdout, stderr) { - t.ifError(er, 'npm deprecate') - t.equal(stderr, '', 'no error output') - t.equal(code, 0, 'exited OK') - t.end() - }) -}) - -test('npm deprecate a scoped package', function (t) { - var cacheCopy = JSON.parse(JSON.stringify(cache)) - cacheCopy.name = '@scope/cond' - cacheCopy._id = '@scope/cond' - var deprecated = JSON.parse(JSON.stringify(cacheCopy)) - deprecated.versions = { - '0.0.0': {}, - '0.0.1': { deprecated: 'make it dead' }, - '0.0.2': {} - } - server.get('/@scope%2fcond?write=true').reply(200, cacheCopy) - server.put('/@scope%2fcond', deprecated).reply(201, { deprecated: true }) - common.npm([ - 'deprecate', - '@scope/cond@0.0.1', - 'make it dead', - '--registry', common.registry, - '--loglevel', 'silent' - ], {}, - function (er, code, stdout, stderr) { - t.ifError(er, 'npm deprecate') - t.equal(stderr, '', 'no error output') - t.equal(code, 0, 'exited OK') - t.end() - }) -}) - -test('npm deprecate semver range', function (t) { - var deprecated = JSON.parse(JSON.stringify(cache)) - deprecated.versions = { - '0.0.0': { deprecated: 'make it dead' }, - '0.0.1': { deprecated: 'make it dead' }, - '0.0.2': {} - } - server.get('/cond?write=true').reply(200, cache) - server.put('/cond', deprecated).reply(201, { deprecated: true }) - common.npm([ - 'deprecate', - 'cond@<0.0.2', - 'make it dead', - '--registry', common.registry, - '--loglevel', 'silent' - ], {}, - function (er, code, stdout, stderr) { - t.ifError(er, 'npm deprecate') - t.equal(stderr, '', 'no error output') - t.equal(code, 0, 'exited OK') - t.end() - }) -}) - -test('npm deprecate bad semver range', function (t) { - common.npm([ - 'deprecate', - 'cond@-9001', - 'make it dead', - '--registry', common.registry - ], {}, - function (er, code, stdout, stderr) { - t.equal(code, 1, 'errored') - t.match(stderr, /invalid version range/, 'bad semver') - t.end() - }) -}) - -test('npm deprecate a package with no semver range', function (t) { - var deprecated = JSON.parse(JSON.stringify(cache)) - deprecated.versions = { - '0.0.0': { deprecated: 'make it dead' }, - '0.0.1': { deprecated: 'make it dead' }, - '0.0.2': { deprecated: 'make it dead' } - } - server.get('/cond?write=true').reply(200, cache) - server.put('/cond', deprecated).reply(201, { deprecated: true }) - common.npm([ - 'deprecate', - 'cond', - 'make it dead', - '--registry', common.registry, - '--loglevel', 'silent' - ], {}, - function (er, code, stdout, stderr) { - t.ifError(er, 'npm deprecate') - t.equal(stderr, '', 'no error output') - t.equal(code, 0, 'exited OK') - t.end() - }) -}) - -test('cleanup', function (t) { - server.close() - t.ok(true) - t.end() -}) diff --git a/deps/npm/test/tap/dist-tag.js b/deps/npm/test/tap/dist-tag.js deleted file mode 100644 index a5cce5d2a0f93c..00000000000000 --- a/deps/npm/test/tap/dist-tag.js +++ /dev/null @@ -1,271 +0,0 @@ -var fs = require('fs') -var path = require('path') -var mkdirp = require('mkdirp') -var rimraf = require('rimraf') -var mr = require('npm-registry-mock') - -var test = require('tap').test -var common = require('../common-tap.js') - -var pkg = common.pkg -var server - -var scoped = { - name: '@scoped/pkg', - version: '1.1.1' -} - -function mocks (server) { - // ls current package - server.get('/-/package/@scoped%2fpkg/dist-tags') - .reply(200, { latest: '1.0.0', a: '0.0.1', b: '0.5.0' }) - - server.get('/-/package/@scoped%2fpkg/dist-tags') - .reply(200, { latest: '1.0.0', a: '0.0.1', b: '0.5.0' }) - - // ls named package - server.get('/-/package/@scoped%2fanother/dist-tags') - .reply(200, { latest: '2.0.0', a: '0.0.2', b: '0.6.0' }) - - server.get('/-/package/@scoped%2fanother/dist-tags') - .reply(200, { latest: '2.0.0', a: '0.0.2', b: '0.6.0' }) - - // add c - server.get('/-/package/@scoped%2fanother/dist-tags') - .reply(200, { latest: '2.0.0', a: '0.0.2', b: '0.6.0' }) - server.put('/-/package/@scoped%2fanother/dist-tags/c', '"7.7.7"') - .reply(200, { latest: '7.7.7', a: '0.0.2', b: '0.6.0', c: '7.7.7' }) - - // set same version - server.get('/-/package/@scoped%2fanother/dist-tags') - .reply(200, { latest: '2.0.0', b: '0.6.0' }) - - // rm - server.get('/-/package/@scoped%2fanother/dist-tags') - .reply(200, { latest: '2.0.0', a: '0.0.2', b: '0.6.0', c: '7.7.7' }) - server.delete('/-/package/@scoped%2fanother/dist-tags/c') - .reply(200, { c: '7.7.7' }) - - // using a scoped registry - server.get('/-/package/@scoped%2ffoo/dist-tags') - .reply(200, { latest: '2.0.0', a: '0.0.2', b: '0.6.0' }) - server.delete('/-/package/@scoped%2ffoo/dist-tags/b') - .reply(200, { b: '0.6.0' }) - - // rm - server.get('/-/package/@scoped%2fanother/dist-tags') - .reply(200, { latest: '4.0.0' }) -} - -test('setup', function (t) { - mkdirp(pkg, function (er) { - t.ifError(er, pkg + ' made successfully') - - mr({ port: common.port, plugin: mocks }, function (er, s) { - server = s - - fs.writeFile( - path.join(pkg, 'package.json'), - JSON.stringify(scoped), - function (er) { - t.ifError(er, 'wrote package.json') - t.end() - } - ) - }) - }) -}) - -test('npm dist-tags ls in current package', function (t) { - common.npm( - [ - 'dist-tags', 'ls', - '--registry', common.registry, - '--loglevel', 'silent' - ], - { cwd: pkg }, - function (er, code, stdout, stderr) { - t.ifError(er, 'npm access') - t.notOk(code, 'exited OK') - t.notOk(stderr, 'no error output') - t.equal(stdout, 'a: 0.0.1\nb: 0.5.0\nlatest: 1.0.0\n') - - t.end() - } - ) -}) - -test('npm dist-tags ls default in current package', function (t) { - common.npm( - [ - 'dist-tags', - '--registry', common.registry, - '--loglevel', 'silent' - ], - { cwd: pkg }, - function (er, code, stdout, stderr) { - t.ifError(er, 'npm access') - t.notOk(code, 'exited OK') - t.notOk(stderr, 'no error output') - t.equal(stdout, 'a: 0.0.1\nb: 0.5.0\nlatest: 1.0.0\n') - - t.end() - } - ) -}) - -test('npm dist-tags ls on named package', function (t) { - common.npm( - [ - 'dist-tags', - 'ls', '@scoped/another', - '--registry', common.registry, - '--loglevel', 'silent' - ], - { cwd: pkg }, - function (er, code, stdout, stderr) { - t.ifError(er, 'npm access') - t.notOk(code, 'exited OK') - t.notOk(stderr, 'no error output') - t.equal(stdout, 'a: 0.0.2\nb: 0.6.0\nlatest: 2.0.0\n') - - t.end() - } - ) -}) - -test('npm dist-tags ls default, named package', function (t) { - common.npm( - [ - 'dist-tags', - '@scoped/another', - '--registry', common.registry, - '--loglevel', 'silent' - ], - { cwd: pkg }, - function (er, code, stdout, stderr) { - t.ifError(er, 'npm access') - t.notOk(code, 'exited OK') - t.notOk(stderr, 'no error output') - t.equal(stdout, 'a: 0.0.2\nb: 0.6.0\nlatest: 2.0.0\n') - - t.end() - } - ) -}) - -test('npm dist-tags add @scoped/another@7.7.7 c', function (t) { - common.npm( - [ - 'dist-tags', - 'add', '@scoped/another@7.7.7', 'c', - '--registry', common.registry, - '--loglevel', 'silent' - ], - { cwd: pkg }, - function (er, code, stdout, stderr) { - t.ifError(er, 'npm access') - t.notOk(code, 'exited OK') - t.notOk(stderr, 'no error output') - t.equal(stdout, '+c: @scoped/another@7.7.7\n') - - t.end() - } - ) -}) - -test('npm dist-tags set same version', function (t) { - common.npm( - [ - 'dist-tag', - 'set', '@scoped/another@0.6.0', 'b', - '--registry', common.registry, - '--loglevel', 'warn' - ], - { cwd: pkg }, - function (er, code, stdout, stderr) { - t.ifError(er, 'npm access') - t.notOk(code, 'exited OK') - t.equal( - stderr, - 'npm WARN dist-tag add b is already set to version 0.6.0\n', - 'warned about setting same version' - ) - t.notOk(stdout, 'only expecting warning message') - - t.end() - } - ) -}) - -test('npm dist-tags rm @scoped/another c', function (t) { - common.npm( - [ - 'dist-tags', - 'rm', '@scoped/another', 'c', - '--registry', common.registry, - '--loglevel', 'silent' - ], - { cwd: pkg }, - function (er, code, stdout, stderr) { - t.ifError(er, 'npm access') - t.notOk(code, 'exited OK') - t.notOk(stderr, 'no error output') - t.equal(stdout, '-c: @scoped/another@7.7.7\n') - - t.end() - } - ) -}) - -test('npm dist-tags rm @scoped/another nonexistent', function (t) { - common.npm( - [ - 'dist-tags', - 'rm', '@scoped/another', 'nonexistent', - '--registry', common.registry, - '--loglevel', 'silent' - ], - { cwd: pkg }, - function (er, code, stdout, stderr) { - t.ifError(er, 'npm dist-tag') - t.ok(code, 'expecting nonzero exit code') - t.notOk(stderr, 'no error output') - t.notOk(stdout, 'not expecting output') - - t.end() - } - ) -}) - -test('npm dist-tags rm with registry assigned to scope', function (t) { - fs.writeFileSync(path.resolve(pkg, '.npmrc'), ` -@scoped:registry=${common.registry} -${common.registry.replace(/^https?:/, '')}:_authToken=taken -`) - - common.npm( - [ - 'dist-tags', - 'rm', '@scoped/foo', 'b', - '--loglevel', 'silent', - '--userconfig', path.resolve(pkg, '.npmrc') - ], - { cwd: pkg }, - function (er, code, stdout, stderr) { - t.ifError(er, 'npm access') - t.notOk(code, 'exited OK') - t.notOk(stderr, 'no error output') - t.equal(stdout, '-b: @scoped/foo@0.6.0\n') - - t.end() - } - ) -}) - -test('cleanup', function (t) { - t.pass('cleaned up') - rimraf.sync(pkg) - server.close() - t.end() -}) diff --git a/deps/npm/test/tap/do-not-remove-other-bins.js b/deps/npm/test/tap/do-not-remove-other-bins.js deleted file mode 100644 index a614043221f0df..00000000000000 --- a/deps/npm/test/tap/do-not-remove-other-bins.js +++ /dev/null @@ -1,117 +0,0 @@ -'use strict' -var fs = require('fs') -var path = require('path') - -var mkdirp = require('mkdirp') -var test = require('tap').test - -var common = require('../common-tap') - -var base = common.pkg -var installPath = path.resolve(base, 'install') -var installBin = path.resolve(installPath, 'node_modules', '.bin') -var packageApath = path.resolve(base, 'packageA') -var packageBpath = path.resolve(base, 'packageB') - -var packageA = { - name: 'a', - version: '1.0.0', - description: 'x', - repository: 'x', - license: 'MIT', - bin: { - testbin: './testbin.js' - } -} -var packageB = { - name: 'b', - version: '1.0.0', - description: 'x', - repository: 'x', - license: 'MIT', - bin: { - testbin: './testbin.js' - } -} - -var EXEC_OPTS = { - cwd: installPath -} - -test('setup', function (t) { - mkdirp.sync(path.join(installPath, 'node_modules')) - mkdirp.sync(packageApath) - fs.writeFileSync( - path.join(packageApath, 'package.json'), - JSON.stringify(packageA, null, 2) - ) - fs.writeFileSync( - path.join(packageApath, packageA.bin.testbin), - '' - ) - mkdirp.sync(packageBpath) - fs.writeFileSync( - path.join(packageBpath, 'package.json'), - JSON.stringify(packageB, null, 2) - ) - fs.writeFileSync( - path.join(packageBpath, packageB.bin.testbin), - '' - ) - t.end() -}) - -test('npm install A', function (t) { - process.chdir(installPath) - common.npm([ - 'install', packageApath - ], EXEC_OPTS, function (err, code, stdout, stderr) { - console.log(stdout, stderr) - t.ifErr(err, 'install finished successfully') - t.notOk(code, 'exit ok') - t.notOk(stderr, 'Should not get data on stderr: ' + stderr) - t.end() - }) -}) - -test('npm install B', function (t) { - process.chdir(installPath) - common.npm([ - 'install', packageBpath - ], EXEC_OPTS, function (err, code, stdout, stderr) { - t.ifErr(err, 'install finished successfully') - t.notOk(code, 'exit ok') - t.notOk(stderr, 'Should not get data on stderr: ' + stderr) - t.end() - }) -}) - -test('verify bins', function (t) { - var bin = path.dirname( - path.resolve( - installBin, - common.readBinLink(path.join(installBin, 'testbin')))) - t.is(bin, path.join(installPath, 'node_modules', 'b')) - t.end() -}) - -test('rm install A', function (t) { - process.chdir(installPath) - common.npm([ - 'rm', packageApath - ], EXEC_OPTS, function (err, code, stdout, stderr) { - t.ifErr(err, 'install finished successfully') - t.notOk(code, 'exit ok') - t.notOk(stderr, 'Should not get data on stderr: ' + stderr) - t.end() - }) -}) - -test('verify postremoval bins', function (t) { - var bin = path.dirname( - path.resolve( - installBin, - common.readBinLink(path.join(installBin, 'testbin')))) - t.is(bin, path.join(installPath, 'node_modules', 'b')) - t.end() -}) diff --git a/deps/npm/test/tap/doctor-ping-registry-404.js b/deps/npm/test/tap/doctor-ping-registry-404.js deleted file mode 100644 index 00a772a7c0dac3..00000000000000 --- a/deps/npm/test/tap/doctor-ping-registry-404.js +++ /dev/null @@ -1,108 +0,0 @@ -'use strict' -/* eslint-disable camelcase */ -const common = require('../common-tap.js') -const http = require('http') -const mr = require('npm-registry-mock') -const npm = require('../../lib/npm.js') -const path = require('path') -const Tacks = require('tacks') -const t = require('tap') -const which = require('which') - -const Dir = Tacks.Dir -const File = Tacks.File - -const ROOT = common.pkg -const CACHE = common.cache -const TMP = path.join(ROOT, 'tmp') -const PREFIX = path.join(ROOT, 'global-prefix') -const PKG = path.join(ROOT, 'pkg') - -let server, nodeServer -let node_url - -t.teardown(() => { - if (server) { - server.close() - } - if (nodeServer) { - nodeServer.close() - } -}) - -t.test('setup', (t) => { - const port = common.port + 2 - nodeServer = http.createServer(function (q, s) { - s.end(JSON.stringify([{ lts: true, version: '0.0.0' }])) - }) - nodeServer.listen(port, () => { - node_url = 'http://localhost:' + port - mr({ port: common.port }, (err, s) => { - t.ifError(err, 'registry mocked successfully') - server = s - server.get('/-/ping?write=true').reply(404) - server.get('/npm').reply( - 200, - JSON.stringify({ - name: 'npm', - 'dist-tags': { latest: '0.0.0' }, - versions: { - '0.0.0': { - name: 'npm', - version: '0.0.0', - _shrinkwrap: null, - _hasShrinkwrap: false, - dist: { - shasum: 'deadbeef', - tarball: 'https://reg.eh/npm-0.0.0.tgz' - } - } - } - }) - ) - const fixture = new Tacks( - Dir({ - [path.basename(PKG)]: Dir({ - 'package.json': File({ name: 'npm', version: '0.0.0' }) - }), - [path.basename(PREFIX)]: Dir({}) - }) - ) - fixture.create(ROOT) - npm.load( - { - registry: common.registry, - loglevel: 'silent', - cache: CACHE, - tmp: TMP, - prefix: PREFIX - }, - (err) => { - t.ifError(err, 'npm loaded successfully') - t.pass('all set up') - t.done() - } - ) - }) - }) -}) - -t.test('npm doctor ping returns 404 (or any other error)', function (t) { - npm.commands.doctor({ 'node-url': node_url }, true, function (e, list) { - t.ifError(e, 'npm loaded successfully') - t.same(list.length, 9, 'list should have 9 prop') - t.same(list[0][1], 'failed', 'npm ping') - t.same(list[1][1], 'v' + npm.version, 'npm -v') - t.same(list[2][1], process.version, 'node -v') - t.same(list[3][1], common.registry + '/', 'npm config get registry') - t.same(list[5][1], 'ok', 'Perms check on cached files') - t.same(list[6][1], 'ok', 'Perms check on global node_modules') - t.same(list[7][1], 'ok', 'Perms check on local node_modules') - t.match(list[8][1], /^verified \d+ tarballs?$/, 'Cache verified') - which('git', function (e, resolvedPath) { - t.ifError(e, 'git command is installed') - t.same(list[4][1], resolvedPath, 'which git') - t.done() - }) - }) -}) diff --git a/deps/npm/test/tap/doctor.js b/deps/npm/test/tap/doctor.js deleted file mode 100644 index 9a1b42cdd53616..00000000000000 --- a/deps/npm/test/tap/doctor.js +++ /dev/null @@ -1,131 +0,0 @@ -'use strict' -/* eslint-disable camelcase */ -const common = require('../common-tap.js') -const http = require('http') -const mr = require('npm-registry-mock') -const npm = require('../../lib/npm.js') -const path = require('path') -const Tacks = require('tacks') -const t = require('tap') -const which = require('which') - -const Dir = Tacks.Dir -const File = Tacks.File - -const ROOT = common.pkg -const CACHE = common.cache -const TMP = path.join(ROOT, 'tmp') -const PREFIX = path.join(ROOT, 'global-prefix') -const PKG = path.join(ROOT, 'pkg') - -let server -let node_url -const pingResponse = { - host: 'registry.npmjs.org', - ok: true, - username: null, - peer: 'example.com' -} -const npmResponse = { - name: 'npm', - 'dist-tags': {latest: '0.0.0'}, - 'versions': { - '0.0.0': { - name: 'npm', - version: '0.0.0', - _shrinkwrap: null, - _hasShrinkwrap: false, - dist: { - shasum: 'deadbeef', - tarball: 'https://reg.eh/npm-0.0.0.tgz' - } - } - } -} - -let nodeServer - -t.teardown(() => { - if (server) { - server.close() - } - if (nodeServer) { - nodeServer.close() - } -}) - -t.test('setup', (t) => { - const port = common.port + 1 - nodeServer = http.createServer(function (q, s) { - s.end(JSON.stringify([{lts: true, version: '0.0.0'}])) - }) - nodeServer.listen(port, () => { - node_url = 'http://localhost:' + port - mr({port: common.port}, (err, s) => { - t.ifError(err, 'registry mocked successfully') - server = s - server.get('/-/ping?write=true').reply(200, JSON.stringify(pingResponse)) - server.get('/npm').reply(200, JSON.stringify(npmResponse)) - const fixture = new Tacks(Dir({ - [path.basename(PKG)]: Dir({ - 'package.json': File({name: 'foo', version: '1.0.0'}) - }), - [path.basename(PREFIX)]: Dir({}) - })) - fixture.create(ROOT) - npm.load({ - registry: common.registry, - loglevel: 'silent', - cache: CACHE, - tmp: TMP, - prefix: PREFIX - }, (err) => { - t.ifError(err, 'npm loaded successfully') - t.pass('all set up') - t.done() - }) - }) - }) -}) - -t.test('npm doctor', function (t) { - npm.commands.doctor({'node-url': node_url}, true, function (e, list) { - t.ifError(e, 'npm loaded successfully') - t.same(list.length, 9, 'list should have 9 prop') - t.same(list[0][1], 'ok', 'npm ping') - t.same(list[1][1], 'v' + npm.version, 'npm -v') - t.same(list[2][1], process.version, 'node -v') - t.same(list[3][1], common.registry + '/', 'npm config get registry') - t.same(list[5][1], 'ok', 'Perms check on cached files') - t.same(list[6][1], 'ok', 'Perms check on global node_modules') - t.same(list[7][1], 'ok', 'Perms check on local node_modules') - t.match(list[8][1], /^verified \d+ tarballs?$/, 'Cache verified') - which('git', function (e, resolvedPath) { - t.ifError(e, 'git command is installed') - t.same(list[4][1], resolvedPath, 'which git') - t.done() - }) - }) -}) - -t.test('npm doctor works without registry', function (t) { - npm.config.set('registry', false) - npm.commands.doctor({'node-url': node_url}, true, function (e, list) { - t.ifError(e, 'npm loaded successfully') - t.same(list.length, 9, 'list should have 9 prop') - t.same(list[0][1], 'ok', 'npm ping') - t.same(list[1][1], 'v' + npm.version, 'npm -v') - t.same(list[2][1], process.version, 'node -v') - t.same(list[3][1], '', 'no registry, but no crash') - t.same(list[5][1], 'ok', 'Perms check on cached files') - t.same(list[6][1], 'ok', 'Perms check on global node_modules') - t.same(list[7][1], 'ok', 'Perms check on local node_modules') - t.match(list[8][1], /^verified \d+ tarballs?$/, 'Cache verified') - which('git', function (e, resolvedPath) { - t.ifError(e, 'git command is installed') - t.same(list[4][1], resolvedPath, 'which git') - server.close() - t.done() - }) - }) -}) diff --git a/deps/npm/test/tap/extraneous-dep-cycle-ls-ok.js b/deps/npm/test/tap/extraneous-dep-cycle-ls-ok.js deleted file mode 100644 index 11f52209ed8359..00000000000000 --- a/deps/npm/test/tap/extraneous-dep-cycle-ls-ok.js +++ /dev/null @@ -1,71 +0,0 @@ -'use strict' -var fs = require('fs') -var path = require('path') - -var test = require('tap').test -var mkdirp = require('mkdirp') -var rimraf = require('rimraf') - -var common = require('../common-tap') - -var pkg = common.pkg -var pathModA = path.join(pkg, 'node_modules', 'moduleA') -var pathModB = path.join(pkg, 'node_modules', 'moduleB') - -var modA = { - name: 'moduleA', - version: '1.0.0', - _requiredBy: [ '#USER', '/moduleB' ], - dependencies: { - moduleB: '1.0.0' - } -} -var modB = { - name: 'moduleB', - version: '1.0.0', - _requiredBy: [ '/moduleA' ], - dependencies: { - moduleA: '1.0.0' - } -} - -function setup () { - mkdirp.sync(pathModA) - fs.writeFileSync( - path.join(pathModA, 'package.json'), - JSON.stringify(modA, null, 2) - ) - mkdirp.sync(pathModB) - fs.writeFileSync( - path.join(pathModB, 'package.json'), - JSON.stringify(modB, null, 2) - ) -} - -function cleanup () { - rimraf.sync(pkg) -} - -test('setup', function (t) { - cleanup() - setup() - t.end() -}) - -var expected = pkg + '\n' + - '└─┬ moduleA@1.0.0\n' + - ' └─┬ moduleB@1.0.0\n' + - ' └── moduleA@1.0.0 deduped\n\n' - -test('extraneous-dep-cycle', function (t) { - common.npm(['ls', '--unicode=true'], {cwd: pkg}, function (er, code, stdout, stderr) { - t.ifErr(er, 'install finished successfully') - t.is(stdout, expected, 'ls output shows module') - t.end() - }) -}) - -test('cleanup', function (t) { - cleanup() - t.end() -}) diff --git a/deps/npm/test/tap/false-name.js b/deps/npm/test/tap/false-name.js deleted file mode 100644 index 57d2a2ad2f8dda..00000000000000 --- a/deps/npm/test/tap/false-name.js +++ /dev/null @@ -1,79 +0,0 @@ -// this is a test for fix #2538 - -// the false_name-test-package has the name property 'test-package' set -// in the package.json and a dependency named 'test-package' is also a -// defined dependency of 'test-package-with-one-dep'. -// -// this leads to a conflict during installation and the fix is covered -// by this test - -var fs = require('graceful-fs') -var path = require('path') -var existsSync = fs.existsSync || path.existsSync - -var mr = require('npm-registry-mock') -var test = require('tap').test - -var common = require('../common-tap.js') - -var pkg = common.pkg -var cache = common.cache -var server - -var EXEC_OPTS = { cwd: pkg } - -var indexContent = 'module.exports = true\n' -var json = { - name: 'test-package', - version: '0.0.0', - main: 'index.js', - dependencies: { - 'test-package-with-one-dep': '0.0.0' - } -} - -test('setup', function (t) { - t.comment('test for https://github.com/npm/npm/issues/2538') - setup() - mr({ port: common.port }, function (er, s) { - server = s - t.end() - }) -}) - -test('not every pkg.name can be required', function (t) { - common.npm( - [ - 'install', '.', - '--cache', cache, - '--registry', common.registry - ], - EXEC_OPTS, - function (err, code) { - t.ifErr(err, 'install finished without error') - t.equal(code, 0, 'install exited ok') - t.ok( - existsSync(path.join(pkg, 'node_modules', 'test-package-with-one-dep')), - 'test-package-with-one-dep installed OK' - ) - t.ok( - existsSync(path.join(pkg, 'node_modules', 'test-package')), - 'test-package subdep installed OK' - ) - t.end() - } - ) -}) - -test('cleanup', function (t) { - server.close() - t.end() -}) - -function setup () { - fs.writeFileSync( - path.join(pkg, 'package.json'), - JSON.stringify(json, null, 2) - ) - fs.writeFileSync(path.join(pkg, 'index.js'), indexContent) -} diff --git a/deps/npm/test/tap/fetch-package-metadata.js b/deps/npm/test/tap/fetch-package-metadata.js deleted file mode 100644 index 2e666772ed204b..00000000000000 --- a/deps/npm/test/tap/fetch-package-metadata.js +++ /dev/null @@ -1,48 +0,0 @@ -'use strict' -var mr = require('npm-registry-mock') -var npa = require('npm-package-arg') -var test = require('tap').test - -var common = require('../common-tap.js') -var npm = require('../../lib/npm.js') - -var pkg = common.pkg - -test('setup', function (t) { - process.chdir(pkg) - - var opts = { - cache: common.cache, - registry: common.registry, - // important to make sure devDependencies don't get stripped - dev: true - } - npm.load(opts, t.end) -}) - -test('fetch-package-metadata provides resolved metadata', function (t) { - t.plan(4) - - var fetchPackageMetadata = require('../../lib/fetch-package-metadata') - - var testPackage = npa('test-package@>=0.0.0') - - mr({ port: common.port }, thenFetchMetadata) - - var server - function thenFetchMetadata (err, s) { - t.ifError(err, 'setup mock registry') - server = s - - fetchPackageMetadata(testPackage, __dirname, thenVerifyMetadata) - } - - function thenVerifyMetadata (err, pkg) { - t.ifError(err, 'fetched metadata') - - t.equals(pkg._resolved, 'http://localhost:' + common.port + '/test-package/-/test-package-0.0.0.tgz', '_resolved') - t.equals(pkg._integrity, 'sha1-sNMrbEXCWcV4uiADdisgUTG9+9E=', '_integrity') - server.close() - t.end() - } -}) diff --git a/deps/npm/test/tap/format-package-lock.js b/deps/npm/test/tap/format-package-lock.js deleted file mode 100644 index ddf40915d9bd3f..00000000000000 --- a/deps/npm/test/tap/format-package-lock.js +++ /dev/null @@ -1,116 +0,0 @@ -'use strict' -const fs = require('fs') -const path = require('path') -const test = require('tap').test -const mr = require('npm-registry-mock') -const Tacks = require('tacks') -const File = Tacks.File -const Dir = Tacks.Dir -const common = require('../common-tap.js') - -const basedir = common.pkg -const testdir = path.join(basedir, 'testdir') -const cachedir = common.cache -const globaldir = path.join(basedir, 'global') -const tmpdir = path.join(basedir, 'tmp') - -const pkgPath = path.join(testdir, 'package.json') -const pkgLockPath = path.join(testdir, 'package-lock.json') -const shrinkwrapPath = path.join(testdir, 'npm-shrinkwrap.json') -const CRLFreg = /\r\n|\r|\n/ - -const env = common.newEnv().extend({ - npm_config_cache: cachedir, - npm_config_tmp: tmpdir, - npm_config_prefix: globaldir, - npm_config_registry: common.registry, - npm_config_loglevel: 'warn', - npm_config_format_package_lock: false -}) - -var server -var fixture = new Tacks(Dir({ - cache: Dir(), - global: Dir(), - tmp: Dir(), - testdir: Dir({ - 'package.json': File({ - name: 'install-package-lock-only', - version: '1.0.0', - dependencies: { - mkdirp: '^0.3.4' - } - }) - }) -})) - -function setup () { - cleanup() - fixture.create(basedir) -} - -function cleanup () { - fixture.remove(basedir) -} - -test('setup', function (t) { - mr({port: common.port, throwOnUnmatched: true}, function (err, s) { - if (err) throw err - server = s - t.done() - }) -}) - -test('package-lock.json unformatted, package.json formatted when config has `format-package-lock: false`', function (t) { - setup() - common.npm(['install'], {cwd: testdir, env}).spread((code, stdout, stderr) => { - t.is(code, 0, 'ok') - t.ok(fs.existsSync(pkgLockPath), 'ensure that package-lock.json was created') - const pkgLockUtf8 = fs.readFileSync(pkgLockPath, 'utf-8') - t.equal(pkgLockUtf8.split(CRLFreg).length, 2, 'package-lock.json is unformatted') - const pkgUtf8 = fs.readFileSync(pkgPath, 'utf-8') - t.notEqual(pkgUtf8.split(CRLFreg).length, 2, 'package.json is formatted') - t.done() - }) -}) - -test('npm-shrinkwrap.json unformatted when config has `format-package-lock: false`', function (t) { - setup() - common.npm(['shrinkwrap'], {cwd: testdir, env}).spread((code, stdout, stderr) => { - t.is(code, 0, 'ok') - t.ok(fs.existsSync(shrinkwrapPath), 'ensure that npm-shrinkwrap.json was created') - const shrinkwrapUtf8 = fs.readFileSync(shrinkwrapPath, 'utf-8') - t.equal(shrinkwrapUtf8.split(CRLFreg).length, 2, 'npm-shrinkwrap.json is unformatted') - t.done() - }) -}) - -test('package-lock.json and package.json formatted when config has `format-package-lock: true`', function (t) { - setup() - common.npm(['install'], {cwd: testdir}).spread((code, stdout, stderr) => { - t.is(code, 0, 'ok') - t.ok(fs.existsSync(pkgLockPath), 'ensure that package-lock.json was created') - const pkgLockUtf8 = fs.readFileSync(pkgLockPath, 'utf-8') - t.notEqual(pkgLockUtf8.split(CRLFreg).length, 2, 'package-lock.json is formatted') - const pkgUtf8 = fs.readFileSync(pkgPath, 'utf-8') - t.notEqual(pkgUtf8.split(CRLFreg).length, 2, 'package.json is formatted') - t.done() - }) -}) - -test('npm-shrinkwrap.json formatted when config has `format-package-lock: true`', function (t) { - setup() - common.npm(['shrinkwrap'], {cwd: testdir}).spread((code, stdout, stderr) => { - t.is(code, 0, 'ok') - t.ok(fs.existsSync(shrinkwrapPath), 'ensure that npm-shrinkwrap.json was created') - const shrinkwrapUtf8 = fs.readFileSync(shrinkwrapPath, 'utf-8') - t.notEqual(shrinkwrapUtf8.split(CRLFreg).length, 2, 'npm-shrinkwrap.json is unformatted') - t.done() - }) -}) - -test('cleanup', function (t) { - server.close() - cleanup() - t.done() -}) diff --git a/deps/npm/test/tap/full-warning-messages.js b/deps/npm/test/tap/full-warning-messages.js deleted file mode 100644 index 945cf66a629dd1..00000000000000 --- a/deps/npm/test/tap/full-warning-messages.js +++ /dev/null @@ -1,112 +0,0 @@ -'use strict' -var test = require('tap').test -var path = require('path') -var mkdirp = require('mkdirp') -var rimraf = require('rimraf') -var fs = require('graceful-fs') -var common = require('../common-tap') - -var base = common.pkg -var modA = path.resolve(base, 'modA') -var modB = path.resolve(base, 'modB') - -var json = { - 'name': 'test-full-warning-messages', - 'version': '1.0.0', - 'description': 'abc', - 'repository': 'git://abc/', - 'license': 'ISC', - 'dependencies': { - 'modA': modA - } -} - -var modAJson = { - 'name': 'modA', - 'version': '1.0.0', - 'optionalDependencies': { - 'modB': modB - } -} - -var modBJson = { - 'name': 'modB', - 'version': '1.0.0', - 'os': ['nope'], - 'cpu': 'invalid' -} - -function modJoin () { - var modules = Array.prototype.slice.call(arguments) - return modules.reduce(function (a, b) { - return path.resolve(a, 'node_modules', b) - }) -} - -function writeJson (mod, data) { - fs.writeFileSync(path.resolve(mod, 'package.json'), JSON.stringify(data)) -} - -function setup () { - cleanup() - ;[modA, modB].forEach(function (mod) { mkdirp.sync(mod) }) - writeJson(base, json) - writeJson(modA, modAJson) - writeJson(modB, modBJson) -} - -function cleanup () { - rimraf.sync(base) -} - -test('setup', function (t) { - setup() - t.end() -}) - -function exists (t, filepath, msg) { - try { - fs.statSync(filepath) - t.pass(msg) - return true - } catch (ex) { - t.fail(msg, {found: null, wanted: 'exists', compare: 'fs.stat(' + filepath + ')'}) - return false - } -} - -function notExists (t, filepath, msg) { - try { - fs.statSync(filepath) - t.fail(msg, {found: 'exists', wanted: null, compare: 'fs.stat(' + filepath + ')'}) - return true - } catch (ex) { - t.pass(msg) - return false - } -} - -test('tree-style', function (t) { - common.npm(['install', '--json', '--loglevel=warn'], {cwd: base}, function (err, code, stdout, stderr) { - if (err) throw err - t.is(code, 0, 'result code') - var result = JSON.parse(stdout) - t.is(result.added.length, 1, 'only added one module') - t.is(result.added[0].name, 'modA', 'modA got installed') - t.is(result.warnings.length, 1, 'one warning') - var stderrlines = stderr.trim().split(/\n/) - t.is(stderrlines.length, 2, 'two lines of warnings') - t.match(stderr, /SKIPPING OPTIONAL DEPENDENCY/, 'expected optional failure warning in stderr') - t.match(stderr, /Unsupported platform/, 'reason for optional failure in stderr') - t.match(result.warnings[0], /SKIPPING OPTIONAL DEPENDENCY/, 'expected optional failure warning in JSON') - t.match(result.warnings[0], /Unsupported platform/, 'reason for optional failure in JSON') - exists(t, modJoin(base, 'modA'), 'module A') - notExists(t, modJoin(base, 'modB'), 'module B') - t.done() - }) -}) - -test('cleanup', function (t) { - cleanup() - t.end() -}) diff --git a/deps/npm/test/tap/fund.js b/deps/npm/test/tap/fund.js deleted file mode 100644 index 48d903f9897f6f..00000000000000 --- a/deps/npm/test/tap/fund.js +++ /dev/null @@ -1,405 +0,0 @@ -'use strict' - -const fs = require('fs') -const path = require('path') - -const test = require('tap').test -const Tacks = require('tacks') -const Dir = Tacks.Dir -const File = Tacks.File -const common = require('../common-tap.js') -const isWindows = require('../../lib/utils/is-windows.js') - -const base = common.pkg -const noFunding = path.join(base, 'no-funding-package') -const maintainerOwnsAllDeps = path.join(base, 'maintainer-owns-all-deps') -const nestedNoFundingPackages = path.join(base, 'nested-no-funding-packages') -const nestedMultipleFundingPackages = path.join(base, 'nested-multiple-funding-packages') -const fundingStringShorthand = path.join(base, 'funding-string-shorthand') - -function getFixturePackage ({ name, version, dependencies, funding }, extras) { - const getDeps = () => Object - .keys(dependencies) - .reduce((res, dep) => (Object.assign({}, res, { - [dep]: '*' - })), {}) - - return Dir(Object.assign({ - 'package.json': File({ - name, - version: version || '1.0.0', - funding: (funding === undefined) ? { - type: 'individual', - url: 'http://example.com/donate' - } : funding, - dependencies: dependencies && getDeps(dependencies) - }) - }, extras)) -} - -const fixture = new Tacks(Dir({ - 'funding-string-shorthand': Dir({ - 'package.json': File({ - name: 'funding-string-shorthand', - version: '0.0.0', - funding: 'https://example.com/sponsor' - }) - }), - 'no-funding-package': Dir({ - 'package.json': File({ - name: 'no-funding-package', - version: '0.0.0' - }) - }), - 'maintainer-owns-all-deps': getFixturePackage({ - name: 'maintainer-owns-all-deps', - dependencies: { - 'dep-foo': '*', - 'dep-bar': '*' - } - }, { - node_modules: Dir({ - 'dep-foo': getFixturePackage({ - name: 'dep-foo', - dependencies: { - 'dep-sub-foo': '*' - } - }, { - node_modules: Dir({ - 'dep-sub-foo': getFixturePackage({ - name: 'dep-sub-foo' - }) - }) - }), - 'dep-bar': getFixturePackage({ - name: 'dep-bar' - }) - }) - }), - 'nested-no-funding-packages': getFixturePackage({ - name: 'nested-no-funding-packages', - funding: null, - dependencies: { - foo: '*' - }, - devDependencies: { - lorem: '*' - } - }, { - node_modules: Dir({ - foo: getFixturePackage({ - name: 'foo', - dependencies: { - bar: '*' - }, - funding: null - }, { - node_modules: Dir({ - bar: getFixturePackage({ - name: 'bar' - }, { - node_modules: Dir({ - 'sub-bar': getFixturePackage({ - name: 'sub-bar', - funding: 'https://example.com/sponsor' - }) - }) - }) - }) - }), - lorem: getFixturePackage({ - name: 'lorem', - funding: { - url: 'https://example.com/lorem' - } - }) - }) - }), - 'nested-multiple-funding-packages': getFixturePackage({ - name: 'nested-multiple-funding-packages', - funding: [ - 'https://one.example.com', - 'https://two.example.com' - ], - dependencies: { - foo: '*' - }, - devDependencies: { - bar: '*' - } - }, { - node_modules: Dir({ - foo: getFixturePackage({ - name: 'foo', - funding: [ - 'http://example.com', - { url: 'http://sponsors.example.com/me' }, - 'http://collective.example.com' - ] - }), - bar: getFixturePackage({ - name: 'bar', - funding: [ - 'http://collective.example.com', - { url: 'http://sponsors.example.com/you' } - ] - }) - }) - }) -})) - -function checkOutput (t, { code, stdout, stderr }) { - t.is(code, 0, `exited code 0`) - t.is(stderr, '', 'no warnings') -} - -function jsonTest (t, { assertionMsg, expected, stdout }) { - let parsed = JSON.parse(stdout) - t.deepEqual(parsed, expected, assertionMsg) -} - -function snapshotTest (t, { stdout, assertionMsg }) { - t.matchSnapshot(stdout, assertionMsg) -} - -function testFundCmd ({ title, assertionMsg, args = [], opts = {}, output = checkOutput, assertion = snapshotTest, expected }) { - const validate = (t) => (err, code, stdout, stderr) => { - if (err) throw err - - output(t, { code, stdout, stderr }) - assertion(t, { assertionMsg, expected, stdout }) - } - - return test(title, (t) => { - t.plan(3) - common.npm(['fund', '--unicode=false'].concat(args), opts, validate(t)) - }) -} - -test('setup', function (t) { - fixture.remove(base) - fixture.create(base) - t.end() -}) - -testFundCmd({ - title: 'fund with no package containing funding', - assertionMsg: 'should print empty funding info', - opts: { cwd: noFunding } -}) - -testFundCmd({ - title: 'fund in which same maintainer owns all its deps', - assertionMsg: 'should print stack packages together', - opts: { cwd: maintainerOwnsAllDeps } -}) - -testFundCmd({ - title: 'fund in which same maintainer owns all its deps, using --json option', - assertionMsg: 'should print stack packages together', - args: ['--json'], - opts: { cwd: maintainerOwnsAllDeps }, - assertion: jsonTest, - expected: { - length: 3, - name: 'maintainer-owns-all-deps', - version: '1.0.0', - funding: { type: 'individual', url: 'http://example.com/donate' }, - dependencies: { - 'dep-bar': { - version: '1.0.0', - funding: { type: 'individual', url: 'http://example.com/donate' } - }, - 'dep-foo': { - version: '1.0.0', - funding: { type: 'individual', url: 'http://example.com/donate' }, - dependencies: { - 'dep-sub-foo': { - version: '1.0.0', - funding: { type: 'individual', url: 'http://example.com/donate' } - } - } - } - } - } -}) - -testFundCmd({ - title: 'fund containing multi-level nested deps with no funding', - assertionMsg: 'should omit dependencies with no funding declared', - opts: { cwd: nestedNoFundingPackages } -}) - -testFundCmd({ - title: 'fund containing multi-level nested deps with no funding, using --json option', - assertionMsg: 'should omit dependencies with no funding declared', - args: ['--json'], - opts: { cwd: nestedNoFundingPackages }, - assertion: jsonTest, - expected: { - length: 3, - name: 'nested-no-funding-packages', - version: '1.0.0', - dependencies: { - lorem: { version: '1.0.0', funding: { url: 'https://example.com/lorem' } }, - bar: { - version: '1.0.0', - funding: { type: 'individual', url: 'http://example.com/donate' }, - dependencies: { - 'sub-bar': { - version: '1.0.0', - funding: { url: 'https://example.com/sponsor' } - } - } - } - } - } -}) - -testFundCmd({ - title: 'fund containing multi-level nested deps with multiple funding sources, using --json option', - assertionMsg: 'should omit dependencies with no funding declared', - args: ['--json'], - opts: { cwd: nestedMultipleFundingPackages }, - assertion: jsonTest, - expected: { - length: 2, - name: 'nested-multiple-funding-packages', - version: '1.0.0', - funding: [ - { - url: 'https://one.example.com' - }, - { - url: 'https://two.example.com' - } - ], - dependencies: { - bar: { - version: '1.0.0', - funding: [ - { - url: 'http://collective.example.com' - }, - { - url: 'http://sponsors.example.com/you' - } - ] - }, - foo: { - version: '1.0.0', - funding: [ - { - url: 'http://example.com' - }, - { - url: 'http://sponsors.example.com/me' - }, - { - url: 'http://collective.example.com' - } - ] - } - } - } -}) - -testFundCmd({ - title: 'fund does not support global', - assertionMsg: 'should throw EFUNDGLOBAL error', - args: ['--global'], - output: (t, { code, stdout, stderr }) => { - t.is(code, 1, `exited code 0`) - const [ errCode, errCmd ] = stderr.split('\n') - t.matchSnapshot(`${errCode}\n${errCmd}`, 'should write error msgs to stderr') - } -}) - -testFundCmd({ - title: 'fund does not support global, using --json option', - assertionMsg: 'should throw EFUNDGLOBAL error', - args: ['--global', '--json'], - output: (t, { code, stdout, stderr }) => { - t.is(code, 1, `exited code 0`) - const [ errCode, errCmd ] = stderr.split('\n') - t.matchSnapshot(`${errCode}\n${errCmd}`, 'should write error msgs to stderr') - }, - assertion: jsonTest, - expected: { - error: { - code: 'EFUNDGLOBAL', - summary: '`npm fund` does not support global packages', - detail: '' - } - } -}) - -testFundCmd({ - title: 'fund using package argument with no browser', - assertionMsg: 'should open funding url', - args: ['.', '--no-browser'], - opts: { cwd: maintainerOwnsAllDeps } -}) - -testFundCmd({ - title: 'fund using string shorthand', - assertionMsg: 'should open string-only url', - args: ['.', '--no-browser'], - opts: { cwd: fundingStringShorthand } -}) - -testFundCmd({ - title: 'fund using nested packages with multiple sources', - assertionMsg: 'should prompt with all available URLs', - args: ['.'], - opts: { cwd: nestedMultipleFundingPackages } -}) - -testFundCmd({ - title: 'fund using nested packages with multiple sources, with a source number', - assertionMsg: 'should open the numbered URL', - args: ['.', '--which=1', '--no-browser'], - opts: { cwd: nestedMultipleFundingPackages } -}) - -testFundCmd({ - title: 'fund using package argument with no browser, using --json option', - assertionMsg: 'should open funding url', - args: ['.', '--json', '--no-browser'], - opts: { cwd: maintainerOwnsAllDeps }, - assertion: jsonTest, - expected: { - title: 'individual funding available at the following URL', - url: 'http://example.com/donate' - } -}) - -if (!isWindows) { - test('fund using package argument', function (t) { - const fakeBrowser = path.join(common.pkg, '_script.sh') - const outFile = path.join(common.pkg, '_output') - - const s = '#!/usr/bin/env bash\n' + - 'echo "$@" > ' + JSON.stringify(common.pkg) + '/_output\n' - fs.writeFileSync(fakeBrowser, s) - fs.chmodSync(fakeBrowser, '0755') - - common.npm([ - 'fund', '.', - '--loglevel=silent', - '--browser=' + fakeBrowser - ], { cwd: maintainerOwnsAllDeps }, function (err, code, stdout, stderr) { - t.ifError(err, 'repo command ran without error') - t.equal(code, 0, 'exit ok') - var res = fs.readFileSync(outFile, 'utf8') - t.equal(res, 'http://example.com/donate\n') - t.end() - }) - }) -} - -test('cleanup', function (t) { - t.pass(base) - fixture.remove(base) - t.end() -}) diff --git a/deps/npm/test/tap/gently-rm-cmdshims.js b/deps/npm/test/tap/gently-rm-cmdshims.js deleted file mode 100644 index 6726fe76d8dbae..00000000000000 --- a/deps/npm/test/tap/gently-rm-cmdshims.js +++ /dev/null @@ -1,161 +0,0 @@ -'use strict' -/* eslint-disable camelcase */ -var path = require('path') -var fs = require('graceful-fs') -var test = require('tap').test -var mkdirp = require('mkdirp') -var rimraf = require('rimraf') -var npm = require('../../lib/npm.js') - -const common = require('../common-tap.js') -var work = common.pkg -var doremove = path.join(work, 'doremove') -var dontremove = path.join(work, 'dontremove') -var example_json = { - name: 'example', - version: '1.0.0', - bin: { - 'example': 'example.js' - } -} -var example_bin = - '#!/usr/bin/env node\n' + - 'true\n' - -// NOTE: if this were actually produced on windows it would be \ not / of -// course, buuut, path.resolve doesn't understand \ outside of windows =/ -var do_example_cmd = - '@IF EXIST "%~dp0\\node.exe" (\n' + - ' "%~dp0\\node.exe" "%~dp0\\../example/example.js" %*\n' + - ') ELSE (\n' + - ' @SETLOCAL\n' + - ' @SET PATHEXT=%PATHEXT:;.JS;=;%\n' + - ' node "%~dp0\\../example/example.js" %*\n' + - ')\n' - -var do_example_cygwin = - '#!/bin/sh\n' + - 'basedir=`dirname "$0"`\n' + - '\n' + - 'case `uname` in\n' + - ' *CYGWIN*) basedir=`cygpath -w "$basedir"`;;\n' + - 'esac\n' + - '\n' + - 'if [ -x "$basedir/node" ]; then\n' + - ' "$basedir/node" "$basedir/../example/example.js" "$@"\n' + - ' ret=$?\n' + - 'else\n' + - ' node "$basedir/../example/example.js" "$@"\n' + - ' ret=$?\n' + - 'fi\n' + - 'exit $ret\n' - -var dont_example_cmd = - '@IF EXIST "%~dp0\\node.exe" (\n' + - ' "%~dp0\\node.exe" "%~dp0\\../example-other/example.js" %*\n' + - ') ELSE (\n' + - ' @SETLOCAL\n' + - ' @SET PATHEXT=%PATHEXT:;.JS;=;%\n' + - ' node "%~dp0\\../example-other/example.js" %*\n' + - ')\n' - -var dont_example_cygwin = - '#!/bin/sh\n' + - 'basedir=`dirname "$0"`\n' + - '\n' + - 'case `uname` in\n' + - ' *CYGWIN*) basedir=`cygpath -w "$basedir"`;;\n' + - 'esac\n' + - '\n' + - 'if [ -x "$basedir/node" ]; then\n' + - ' "$basedir/node" "$basedir/../example-other/example.js" "$@"\n' + - ' ret=$?\n' + - 'else\n' + - ' node "$basedir/../example-other/example.js" "$@"\n' + - ' ret=$?\n' + - 'fi\n' + - 'exit $ret\n' - -function cleanup () { - rimraf.sync(work) -} - -var doremove_module = path.join(doremove, 'node_modules', 'example') -var doremove_example_cmd = path.join(doremove, 'node_modules', '.bin', 'example.cmd') -var doremove_example_cygwin = path.join(doremove, 'node_modules', '.bin', 'example') -var dontremove_module = path.join(dontremove, 'node_modules', 'example') -var dontremove_example_cmd = path.join(dontremove, 'node_modules', '.bin', 'example.cmd') -var dontremove_example_cygwin = path.join(dontremove, 'node_modules', '.bin', 'example') - -function setup () { - mkdirp.sync(doremove_module) - mkdirp.sync(path.join(doremove, 'node_modules', '.bin')) - fs.writeFileSync(path.join(doremove, 'node_modules', 'example', 'package.json'), JSON.stringify(example_json)) - fs.writeFileSync(path.join(doremove, 'node_modules', 'example', 'example.js'), JSON.stringify(example_bin)) - fs.writeFileSync(doremove_example_cmd, do_example_cmd) - fs.writeFileSync(doremove_example_cygwin, do_example_cygwin) - - mkdirp.sync(dontremove_module) - mkdirp.sync(path.join(dontremove, 'node_modules', '.bin')) - fs.writeFileSync(path.join(dontremove, 'node_modules', 'example', 'package.json'), JSON.stringify(example_json)) - fs.writeFileSync(path.join(dontremove, 'node_modules', 'example', 'example.js'), JSON.stringify(example_bin)) - fs.writeFileSync(dontremove_example_cmd, dont_example_cmd) - fs.writeFileSync(dontremove_example_cygwin, dont_example_cygwin) -} - -test('setup', function (t) { - cleanup() - setup() - npm.load({}, function () { - t.done() - }) -}) - -// Like slide.chain, but runs all commands even if they have errors, also -// throws away results. -function runAll (cmds, done) { - runNext() - function runNext () { - if (cmds.length === 0) return done() - var cmdline = cmds.shift() - var cmd = cmdline.shift() - cmdline.push(runNext) - cmd.apply(null, cmdline) - } -} - -test('remove-cmd-shims', function (t) { - t.plan(2) - - var gentlyRm = require('../../lib/utils/gently-rm.js') - runAll([ [gentlyRm, doremove_example_cmd, true, doremove_module], - [gentlyRm, doremove_example_cygwin, true, doremove_module] ], - function () { - fs.stat(doremove_example_cmd, function (er) { - t.is(er && er.code, 'ENOENT', 'cmd-shim was removed') - }) - fs.stat(doremove_example_cygwin, function (er) { - t.is(er && er.code, 'ENOENT', 'cmd-shim cygwin script was removed') - }) - }) -}) - -test('dont-remove-cmd-shims', function (t) { - t.plan(2) - var gentlyRm = require('../../lib/utils/gently-rm.js') - runAll([ [gentlyRm, dontremove_example_cmd, true, dontremove_module], - [gentlyRm, dontremove_example_cygwin, true, dontremove_module] ], - function () { - fs.stat(dontremove_example_cmd, function (er) { - t.is(er, null, 'cmd-shim was not removed') - }) - fs.stat(dontremove_example_cygwin, function (er) { - t.is(er, null, 'cmd-shim cygwin script was not removed') - }) - }) -}) - -test('cleanup', function (t) { - cleanup() - t.done() -}) diff --git a/deps/npm/test/tap/gently-rm-linked-module.js b/deps/npm/test/tap/gently-rm-linked-module.js deleted file mode 100644 index ab595e10c740f7..00000000000000 --- a/deps/npm/test/tap/gently-rm-linked-module.js +++ /dev/null @@ -1,100 +0,0 @@ -var common = require('../common-tap.js') - -var resolve = require('path').resolve -var fs = require('graceful-fs') -var test = require('tap').test -var rimraf = require('rimraf') -var Tacks = require('tacks') -var File = Tacks.File -var Dir = Tacks.Dir -var Symlink = Tacks.Symlink -var isWindows = require('../../lib/utils/is-windows.js') - -var base = common.pkg -var fixture = new Tacks(Dir({ - 'working-dir': Dir({ - 'node_modules': Dir({}) // so it doesn't try to install into npm's own node_modules - }), - 'test-module': Dir({ - 'package.json': File({ - name: '@test/linked', - version: '1.0.0', - bin: { - linked: './index.js' - } - }), - 'index.js': File("module.exports = function () { console.log('whoop whoop') }") - }), - 'global-dir': Dir({}), - 'linked-global-dir': Symlink('global-dir') -})) - -var workingDir = resolve(base, 'working-dir') -var toInstall = resolve(base, 'test-module') -var linkedGlobal = resolve(base, 'linked-global-dir') - -var env = Object.assign({}, process.env) - -// We set the global install location via env var here -// instead of passing it in via `--prefix` because -// `--prefix` ALSO changes the current package location. -// And we don't ue the PREFIX env var because -// npm_config_prefix takes precedence over it and is -// passed in when running from the npm test suite. -env.npm_config_prefix = linkedGlobal -var EXEC_OPTS = { - cwd: workingDir, - env: env, - stdio: [0, 'pipe', 2] -} - -test('setup', function (t) { - cleanup() - setup() - - t.end() -}) - -test('install and link', function (t) { - var globalBin = resolve(linkedGlobal, isWindows ? '.' : 'bin', 'linked') - var globalModule = resolve(linkedGlobal, isWindows ? '.' : 'lib', 'node_modules', '@test', 'linked') - // link our test module into the global folder - return common.npm(['--loglevel', 'error', 'link', toInstall], EXEC_OPTS).spread((code, out) => { - t.comment(out) - t.is(code, 0, 'link succeeded') - var localBin = resolve(workingDir, 'node_modules', '.bin', 'linked') - var localModule = resolve(workingDir, 'node_modules', '@test', 'linked') - try { - t.ok(fs.statSync(globalBin), 'global bin exists') - t.is(fs.lstatSync(globalModule).isSymbolicLink(), true, 'global module is link') - t.ok(fs.statSync(localBin), 'local bin exists') - t.is(fs.lstatSync(localModule).isSymbolicLink(), true, 'local module is link') - } catch (ex) { - t.ifError(ex, 'linking happened') - } - if (code !== 0) throw new Error('aborting') - - // and try removing it and make sure that succeeds - return common.npm(['--global', '--loglevel', 'error', 'rm', '@test/linked'], EXEC_OPTS) - }).spread((code, out) => { - t.comment(out) - t.is(code, 0, 'rm succeeded') - t.throws(function () { fs.statSync(globalBin) }, 'global bin removed') - t.throws(function () { fs.statSync(globalModule) }, 'global module removed') - }) -}) - -test('cleanup', function (t) { - cleanup() - - t.end() -}) - -function cleanup () { - fixture.remove(base) - rimraf.sync(base) -} - -function setup () { - fixture.create(base) -} diff --git a/deps/npm/test/tap/gently-rm-overeager.js b/deps/npm/test/tap/gently-rm-overeager.js deleted file mode 100644 index 91a3768aff705a..00000000000000 --- a/deps/npm/test/tap/gently-rm-overeager.js +++ /dev/null @@ -1,60 +0,0 @@ -var path = require('path') -var fs = require('graceful-fs') -var test = require('tap').test -var mkdirp = require('mkdirp') -var rimraf = require('rimraf') - -var common = require('../common-tap.js') - -var testdir = common.pkg -var pkg = path.join(testdir, 'gently-rm-overeager') -var dep = path.join(testdir, 'test-whoops') - -var EXEC_OPTS = { cwd: pkg } - -var fixture = { - name: '@test/whoops', - version: '1.0.0', - scripts: { - postinstall: 'echo \'nope\' && exit 1' - } -} - -test('setup', function (t) { - cleanup() - setup() - - return common.npm(['pack', 'file:test-whoops'], {cwd: testdir, stdio: 'inherit'}).spread((code) => { - t.is(code, 0, 'pack') - }) -}) - -test('cache add', function (t) { - common.npm(['install', '--no-save', '../test-whoops-1.0.0.tgz'], EXEC_OPTS, function (er, c) { - t.ifError(er, "test-whoops install didn't explode") - t.ok(c, 'test-whoops install also failed') - fs.readdir(pkg, function (er, files) { - t.ifError(er, 'package directory is still there') - t.deepEqual(files, [], 'no files remain') - t.end() - }) - }) -}) - -test('cleanup', function (t) { - cleanup() - - t.end() -}) - -function cleanup () { - rimraf.sync(testdir) -} - -function setup () { - mkdirp.sync(pkg) - // so it doesn't try to install into npm's own node_modules - mkdirp.sync(path.join(pkg, 'node_modules')) - mkdirp.sync(dep) - fs.writeFileSync(path.join(dep, 'package.json'), JSON.stringify(fixture)) -} diff --git a/deps/npm/test/tap/gently-rm-symlinked-global-dir.js b/deps/npm/test/tap/gently-rm-symlinked-global-dir.js deleted file mode 100644 index 0a27dae5c5e955..00000000000000 --- a/deps/npm/test/tap/gently-rm-symlinked-global-dir.js +++ /dev/null @@ -1,119 +0,0 @@ -var common = require('../common-tap.js') - -var resolve = require('path').resolve -var fs = require('graceful-fs') -var test = require('tap').test -var mkdirp = require('mkdirp') -var rimraf = require('rimraf') -var isWindows = require('../../lib/utils/is-windows.js') - -var pkg = resolve(common.pkg, 'package') -var dep = resolve(common.pkg, 'test-linked') -var glb = resolve(common.pkg, 'test-global') -var lnk = resolve(common.pkg, 'test-global-link') - -var EXEC_OPTS = { cwd: pkg } - -var index = "module.exports = function () { console.log('whoop whoop') }" - -var fixture = { - name: '@test/linked', - version: '1.0.0', - bin: { - linked: './index.js' - } -} - -test('setup', function (t) { - cleanup() - setup() - - t.end() -}) - -test('install and link', function (t) { - common.npm( - [ - '--global', - '--prefix', lnk, - '--loglevel', 'silent', - '--json', - 'install', '../test-linked' - ], - EXEC_OPTS, - function (er, code, stdout, stderr) { - t.ifError(er, "test-linked install didn't explode") - t.notOk(code, 'test-linked install also failed') - t.notOk(stderr, 'no log output') - - verify(t, stdout) - - // again, to make sure unlinking works properlyt - common.npm( - [ - '--global', - '--prefix', lnk, - '--loglevel', 'silent', - '--json', - 'install', '../test-linked' - ], - EXEC_OPTS, - function (er, code, stdout, stderr) { - t.ifError(er, "test-linked install didn't explode") - t.notOk(code, 'test-linked install also failed') - t.notOk(stderr, 'no log output') - - verify(t, stdout) - - fs.readdir(pkg, function (er, files) { - t.ifError(er, 'package directory is still there') - t.deepEqual(files, ['node_modules'], 'only stub modules dir remains') - - t.end() - }) - } - ) - } - ) -}) - -test('cleanup', function (t) { - cleanup() - - t.end() -}) - -function resolvePath () { - return resolve.apply(null, Array.prototype.slice.call(arguments) - .filter(function (arg) { return arg })) -} - -function verify (t, stdout) { - var result = JSON.parse(stdout) - var pkgPath = resolvePath(lnk, !isWindows && 'lib', 'node_modules', '@test', 'linked') - if (result.added.length) { - t.is(result.added.length, 1, 'added the module') - t.is(result.added[0].path, pkgPath, 'in the right location') - } else { - t.is(result.updated.length, 1, 'updated the module') - t.is(result.updated[0].path, pkgPath, 'in the right location') - } -} - -function cleanup () { - rimraf.sync(pkg) - rimraf.sync(dep) - rimraf.sync(lnk) - rimraf.sync(glb) -} - -function setup () { - mkdirp.sync(pkg) - mkdirp.sync(glb) - fs.symlinkSync(glb, lnk, 'junction') - // so it doesn't try to install into npm's own node_modules - mkdirp.sync(resolve(pkg, 'node_modules')) - mkdirp.sync(dep) - fs.writeFileSync(resolve(dep, 'package.json'), JSON.stringify(fixture)) - fs.writeFileSync(resolve(dep, 'index.js'), index) -} diff --git a/deps/npm/test/tap/gist-short-shortcut-package.js b/deps/npm/test/tap/gist-short-shortcut-package.js deleted file mode 100644 index 601d53a8276661..00000000000000 --- a/deps/npm/test/tap/gist-short-shortcut-package.js +++ /dev/null @@ -1,71 +0,0 @@ -'use strict' -var fs = require('graceful-fs') -var path = require('path') - -var mkdirp = require('mkdirp') -var requireInject = require('require-inject') -var test = require('tap').test - -var common = require('../common-tap.js') - -var pkg = common.pkg - -var json = { - name: 'gist-short-shortcut-package', - version: '0.0.0', - dependencies: { - 'private-gist': 'gist:deadbeef' - } -} - -test('setup', function (t) { - setup() - t.end() -}) - -test('gist-short-shortcut-package', function (t) { - var cloneUrls = [ - ['git://gist.github.com/deadbeef.git', 'GitHub gist shortcuts try git URLs first'], - ['https://gist.github.com/deadbeef.git', 'GitHub gist shortcuts try HTTPS URLs third'], - ['ssh://git@gist.github.com/deadbeef.git', 'GitHub gist shortcuts try SSH second'] - ] - var npm = requireInject.installGlobally('../../lib/npm.js', { - 'child_process': { - 'execFile': function (cmd, args, options, cb) { - process.nextTick(function () { - if (args.indexOf('clone') === -1) return cb(null, '', '') - var cloneUrl = cloneUrls.shift() - if (cloneUrl) { - t.is(args[args.length - 2], cloneUrl[0], cloneUrl[1]) - } else { - t.fail('too many attempts to clone') - } - cb(new Error()) - }) - } - } - }) - - var opts = { - cache: common.cache, - prefix: pkg, - registry: common.registry, - loglevel: 'silent' - } - npm.load(opts, function (er) { - t.ifError(er, 'npm loaded without error') - npm.commands.install([], function (er, result) { - t.ok(er, 'mocked install failed as expected') - t.end() - }) - }) -}) - -function setup () { - mkdirp.sync(pkg) - fs.writeFileSync( - path.join(pkg, 'package.json'), - JSON.stringify(json, null, 2) - ) - process.chdir(pkg) -} diff --git a/deps/npm/test/tap/gist-short-shortcut.js b/deps/npm/test/tap/gist-short-shortcut.js deleted file mode 100644 index 82c9ae17502dd8..00000000000000 --- a/deps/npm/test/tap/gist-short-shortcut.js +++ /dev/null @@ -1,68 +0,0 @@ -'use strict' -var fs = require('graceful-fs') -var path = require('path') - -var mkdirp = require('mkdirp') -var requireInject = require('require-inject') -var test = require('tap').test - -var common = require('../common-tap.js') - -var pkg = common.pkg - -var json = { - name: 'gist-short-shortcut', - version: '0.0.0' -} - -test('setup', function (t) { - setup() - t.end() -}) - -test('gist-shortcut', function (t) { - var cloneUrls = [ - ['git://gist.github.com/deadbeef.git', 'GitHub gist shortcuts try git URLs first'], - ['https://gist.github.com/deadbeef.git', 'GitHub gist shortcuts try HTTPS URLs second'], - ['ssh://git@gist.github.com/deadbeef.git', 'GitHub gist shortcuts try SSH third'] - ] - var npm = requireInject.installGlobally('../../lib/npm.js', { - 'child_process': { - 'execFile': function (cmd, args, options, cb) { - process.nextTick(function () { - if (args.indexOf('clone') === -1) return cb(null, '', '') - var cloneUrl = cloneUrls.shift() - if (cloneUrl) { - t.is(args[args.length - 2], cloneUrl[0], cloneUrl[1]) - } else { - t.fail('too many attempts to clone') - } - cb(new Error('execFile mock fails on purpose')) - }) - } - } - }) - - var opts = { - cache: common.cache, - prefix: pkg, - registry: common.registry, - loglevel: 'silent' - } - npm.load(opts, function (er) { - t.ifError(er, 'npm loaded without error') - npm.commands.install(['gist:deadbeef'], function (er, result) { - t.ok(er, 'mocked install failed as expected') - t.end() - }) - }) -}) - -function setup () { - mkdirp.sync(pkg) - fs.writeFileSync( - path.join(pkg, 'package.json'), - JSON.stringify(json, null, 2) - ) - process.chdir(pkg) -} diff --git a/deps/npm/test/tap/gist-shortcut-package.js b/deps/npm/test/tap/gist-shortcut-package.js deleted file mode 100644 index 28e57357cc3937..00000000000000 --- a/deps/npm/test/tap/gist-shortcut-package.js +++ /dev/null @@ -1,65 +0,0 @@ -'use strict' -var fs = require('graceful-fs') -var path = require('path') - -var requireInject = require('require-inject') -var test = require('tap').test - -var common = require('../common-tap.js') - -var pkg = common.pkg - -var json = { - name: 'gist-shortcut-package', - version: '0.0.0', - dependencies: { - 'private-gist': 'gist:foo/deadbeef' - } -} - -test('gist-shortcut-package', function (t) { - setup() - var cloneUrls = [ - ['git://gist.github.com/deadbeef.git', 'GitHub gist shortcuts try git URLs first'], - ['https://gist.github.com/deadbeef.git', 'GitHub gist shortcuts try HTTPS URLs second'], - ['ssh://git@gist.github.com/deadbeef.git', 'GitHub gist shortcuts try SSH third'] - ] - var npm = requireInject.installGlobally('../../lib/npm.js', { - 'child_process': { - 'execFile': function (cmd, args, options, cb) { - process.nextTick(function () { - if (args.indexOf('clone') === -1) return cb(null, '', '') - var cloneUrl = cloneUrls.shift() - if (cloneUrl) { - t.is(args[args.length - 2], cloneUrl[0], cloneUrl[1]) - } else { - t.fail('too many attempts to clone') - } - cb(new Error()) - }) - } - } - }) - - var opts = { - cache: common.cache, - prefix: pkg, - registry: common.registry, - loglevel: 'silent' - } - npm.load(opts, function (er) { - t.ifError(er, 'npm loaded without error') - npm.commands.install([], function (er, result) { - t.ok(er, 'mocked install failed as expected') - t.end() - }) - }) -}) - -function setup () { - fs.writeFileSync( - path.join(pkg, 'package.json'), - JSON.stringify(json, null, 2) - ) - process.chdir(pkg) -} diff --git a/deps/npm/test/tap/gist-shortcut.js b/deps/npm/test/tap/gist-shortcut.js deleted file mode 100644 index ca86d6bc55058a..00000000000000 --- a/deps/npm/test/tap/gist-shortcut.js +++ /dev/null @@ -1,58 +0,0 @@ -'use strict' -var fs = require('graceful-fs') -var path = require('path') - -var requireInject = require('require-inject') -var test = require('tap').test - -var common = require('../common-tap.js') - -var pkg = common.pkg - -var json = { - name: 'gist-shortcut', - version: '0.0.0' -} - -test('gist-shortcut', function (t) { - fs.writeFileSync( - path.join(pkg, 'package.json'), - JSON.stringify(json, null, 2) - ) - process.chdir(pkg) - var cloneUrls = [ - ['git://gist.github.com/deadbeef.git', 'GitHub gist shortcuts try git URLs first'], - ['https://gist.github.com/deadbeef.git', 'GitHub gist shortcuts try HTTPS URLs second'], - ['ssh://git@gist.github.com/deadbeef.git', 'GitHub gist shortcuts try SSH third'] - ] - var npm = requireInject.installGlobally('../../lib/npm.js', { - 'child_process': { - 'execFile': function (cmd, args, options, cb) { - process.nextTick(function () { - if (args.indexOf('clone') === -1) return cb(null, '', '') - var cloneUrl = cloneUrls.shift() - if (cloneUrl) { - t.is(args[args.length - 2], cloneUrl[0], cloneUrl[1]) - } else { - t.fail('too many attempts to clone') - } - cb(new Error()) - }) - } - } - }) - - var opts = { - cache: common.cache, - prefix: pkg, - registry: common.registry, - loglevel: 'silent' - } - npm.load(opts, function (er) { - t.ifError(er, 'npm loaded without error') - npm.commands.install(['gist:foo/deadbeef'], function (er, result) { - t.ok(er, 'mocked install failed as expected') - t.end() - }) - }) -}) diff --git a/deps/npm/test/tap/git-dependency-install-link.js b/deps/npm/test/tap/git-dependency-install-link.js deleted file mode 100644 index d80beab057f4da..00000000000000 --- a/deps/npm/test/tap/git-dependency-install-link.js +++ /dev/null @@ -1,172 +0,0 @@ -var fs = require('fs') -var resolve = require('path').resolve - -var mkdirp = require('mkdirp') -var rimraf = require('rimraf') -var test = require('tap').test -var readJson = require('read-package-json') -var mr = require('npm-registry-mock') - -var npm = require('../../lib/npm.js') -var common = require('../common-tap.js') - -var pkg = resolve(common.pkg, 'package') -var repo = resolve(common.pkg, 'repo') -var prefix = resolve(common.pkg, 'prefix') -var cache = common.cache - -var daemon -var daemonPID -var git -var mockRegistry - -var EXEC_OPTS = { - registry: common.registry, - cwd: pkg, - cache: cache -} -process.env.npm_config_prefix = prefix - -var pjParent = JSON.stringify({ - name: 'parent', - version: '1.2.3', - dependencies: { - 'child': 'git://localhost:' + common.gitPort + '/child.git' - } -}, null, 2) + '\n' - -var pjChild = JSON.stringify({ - name: 'child', - version: '1.0.3' -}, null, 2) + '\n' - -test('setup', function (t) { - t.test('bootstrap', t => bootstrap(t.end)) - t.test('setup', t => setup(function (er, r) { - t.ifError(er, 'git started up successfully') - - if (!er) { - daemon = r[r.length - 2] - daemonPID = r[r.length - 1] - } - - mr({ - port: common.port - }, function (er, server) { - t.ifError(er, 'started mock registry') - mockRegistry = server - - t.end() - }) - })) - t.end() -}) - -test('install from git repo [no --link]', function (t) { - process.chdir(pkg) - - common.npm(['install'], EXEC_OPTS, function (err, code, stdout, stderr) { - t.ifError(err, 'npm install failed') - - t.dissimilar(stderr, /Command failed:/, 'expect git to succeed') - t.dissimilar(stderr, /version not found/, 'should not go to repository') - - readJson(resolve(pkg, 'node_modules', 'child', 'package.json'), function (err, data) { - t.ifError(err, 'error reading child package.json') - - t.equal(data && data.version, '1.0.3') - t.end() - }) - }) -}) - -test('install from git repo [with --link]', function (t) { - process.chdir(pkg) - rimraf.sync(resolve(pkg, 'node_modules')) - - common.npm(['install', '--link'], EXEC_OPTS, function (err, code, stdout, stderr) { - t.ifError(err, 'npm install --link failed') - t.equal(code, 0, 'npm install --link returned non-0 code') - - t.dissimilar(stderr, /Command failed:/, 'expect git to succeed') - t.dissimilar(stderr, /version not found/, 'should not go to repository') - t.equal(stderr, '', 'no actual output on stderr') - - readJson(resolve(pkg, 'node_modules', 'child', 'package.json'), function (err, data) { - t.ifError(err, 'error reading child package.json') - - t.equal(data && data.version, '1.0.3') - t.end() - }) - }) -}) - -test('clean', function (t) { - mockRegistry.close() - daemon.on('close', t.end) - process.kill(daemonPID) -}) - -function bootstrap (cb) { - rimraf(repo, () => { - rimraf(pkg, () => { - mkdirp.sync(pkg) - mkdirp.sync(cache) - - fs.writeFileSync(resolve(pkg, 'package.json'), pjParent) - cb() - }) - }) -} - -function setup (cb) { - mkdirp.sync(repo) - fs.writeFileSync(resolve(repo, 'package.json'), pjChild) - npm.load({ - link: true, - prefix: pkg, - loglevel: 'silent' - }, function () { - git = require('../../lib/utils/git.js') - - function startDaemon (cb) { - // start git server - var d = git.spawn( - [ - 'daemon', - '--verbose', - '--listen=localhost', - '--export-all', - '--base-path=.', - '--reuseaddr', - '--port=' + common.gitPort - ], - { - cwd: pkg, - env: process.env, - stdio: ['pipe', 'pipe', 'pipe'] - } - ) - d.stderr.on('data', childFinder) - - function childFinder (c) { - var cpid = c.toString().match(/^\[(\d+)\]/) - if (cpid[1]) { - this.removeListener('data', childFinder) - cb(null, [d, cpid[1]]) - } - } - } - - common.makeGitRepo({ - path: repo, - commands: [ - git.chainableExec( - ['clone', '--bare', repo, 'child.git'], - { cwd: pkg, env: process.env } - ), - startDaemon - ] - }, cb) - }) -} diff --git a/deps/npm/test/tap/git-npmignore.js b/deps/npm/test/tap/git-npmignore.js deleted file mode 100644 index 2ab7db7304f0f3..00000000000000 --- a/deps/npm/test/tap/git-npmignore.js +++ /dev/null @@ -1,200 +0,0 @@ -/* eslint-disable camelcase */ -var child_process = require('child_process') -var readdir = require('graceful-fs').readdirSync -var resolve = require('path').resolve - -var rimraf = require('rimraf') -var test = require('tap').test -var which = require('which') - -var common = require('../common-tap.js') -var escapeArg = require('../../lib/utils/escape-arg.js') -var Tacks = require('tacks') -var Dir = Tacks.Dir -var File = Tacks.File - -var fixture = new Tacks(Dir({ - deps: Dir({ - gitch: Dir({ - '.npmignore': File( - 't.js\n' - ), - '.gitignore': File( - 'node_modules/\n' - ), - 'a.js': File( - "console.log('hi');" - ), - 't.js': File( - "require('tap').test(function (t) { t.pass('I am a test!'); t.end(); });" - ), - 'package.json': File({ - name: 'gitch', - version: '1.0.0', - private: true, - main: 'a.js' - }) - }) - }), - 'node_modules': Dir({ - }) -})) - -var testdir = common.pkg -var cachedir = common.cache -var dep = resolve(testdir, 'deps', 'gitch') -var packname = 'gitch-1.0.0.tgz' -var packed = resolve(testdir, packname) -var modules = resolve(testdir, 'node_modules') -var installed = resolve(modules, 'gitch') -var expected = [ - 'a.js', - 'package.json' -].sort() - -var NPM_OPTS = { - cwd: testdir, - env: common.newEnv().extend({ - npm_config_cache: cachedir - }) -} - -function exec (todo, opts, cb) { - console.log(' # EXEC:', todo) - child_process.exec(todo, opts, cb) -} - -test('setup', function (t) { - setup(function (er) { - t.ifError(er, 'setup ran OK') - - t.end() - }) -}) - -test('npm pack directly from directory', function (t) { - packInstallTest(dep, t) -}) - -test('npm pack via git', function (t) { - var urlPath = dep - .replace(/\\/g, '/') // fixup slashes for Windows - .replace(/^\/+/, '') // remove any leading slashes - packInstallTest('git+file:///' + urlPath, t) -}) - -test('cleanup', function (t) { - cleanup() - - t.end() -}) - -function packInstallTest (spec, t) { - console.log(' # pack', spec) - common.npm( - [ - '--loglevel', 'error', - 'pack', spec - ], - NPM_OPTS, - function (err, code, stdout, stderr) { - if (err) throw err - t.is(code, 0, 'npm pack exited cleanly') - t.is(stderr, '', 'npm pack ran silently') - t.is(stdout.trim(), packname, 'got expected package name') - - common.npm( - [ - '--loglevel', 'error', - 'install', packed - ], - NPM_OPTS, - function (err, code, stdout, stderr) { - if (err) throw err - t.is(code, 0, 'npm install exited cleanly') - t.is(stderr, '', 'npm install ran silently') - - var actual = readdir(installed).sort() - t.isDeeply(actual, expected, 'no unexpected files in packed directory') - - rimraf(packed, function () { - t.end() - }) - } - ) - } - ) -} - -function cleanup () { - fixture.remove(testdir) - rimraf.sync(testdir) -} - -function setup (cb) { - cleanup() - - fixture.create(testdir) - - common.npm( - [ - '--loglevel', 'error', - 'cache', 'clean', '--force' - ], - NPM_OPTS, - function (er, code, _, stderr) { - if (er) return cb(er) - if (stderr) return cb(new Error('npm cache clean error: ' + stderr)) - if (code) return cb(new Error('npm cache nonzero exit: ' + code)) - - which('git', function found (er, gitPath) { - if (er) return cb(er) - - var git = escapeArg(gitPath) - - exec(git + ' init', {cwd: dep}, init) - - function init (er, _, stderr) { - if (er) return cb(er) - if (stderr) return cb(new Error('git init error: ' + stderr)) - - exec(git + " config user.name 'Phantom Faker'", {cwd: dep}, user) - } - - function user (er, _, stderr) { - if (er) return cb(er) - if (stderr) return cb(new Error('git config error: ' + stderr)) - - exec(git + ' config user.email nope@not.real', {cwd: dep}, email) - } - - function email (er, _, stderr) { - if (er) return cb(er) - if (stderr) return cb(new Error('git config error: ' + stderr)) - - exec(git + ' config core.autocrlf input', {cwd: dep}, autocrlf) - } - - function autocrlf (er, _, stderr) { - if (er) return cb(er) - if (stderr) return cb(new Error('git config error: ' + stderr)) - - exec(git + ' add .', {cwd: dep}, addAll) - } - - function addAll (er, _, stderr) { - if (er) return cb(er) - if (stderr) return cb(new Error('git add . error: ' + stderr)) - - exec(git + ' commit -m boot', {cwd: dep}, commit) - } - - function commit (er, _, stderr) { - if (er) return cb(er) - if (stderr) return cb(new Error('git commit error: ' + stderr)) - cb() - } - }) - } - ) -} diff --git a/deps/npm/test/tap/git-prepare.js b/deps/npm/test/tap/git-prepare.js deleted file mode 100644 index 072f4dfc447fc9..00000000000000 --- a/deps/npm/test/tap/git-prepare.js +++ /dev/null @@ -1,166 +0,0 @@ -'use strict' - -const fs = require('fs') -const path = require('path') - -const test = require('tap').test -const mr = require('npm-registry-mock') - -const npm = require('../../lib/npm.js') -const common = require('../common-tap.js') - -const testdir = common.pkg -const repo = path.join(testdir, 'repo') -const prefix = path.join(testdir, 'prefix') -const cache = common.cache - -var Tacks = require('tacks') -var Dir = Tacks.Dir -var File = Tacks.File - -let daemon -let daemonPID -let git -let mockRegistry - -process.env.npm_config_prefix = prefix - -const fixture = new Tacks(Dir({ - repo: Dir({}), - prefix: Dir({}), - deps: Dir({ - parent: Dir({ - 'package.json': File({ - name: 'parent', - version: '1.2.3', - dependencies: { - 'child': 'git://localhost:' + common.gitPort + '/child.git' - } - }) - }), - child: Dir({ - 'package.json': File({ - name: 'child', - version: '1.0.3', - main: 'dobuild.js', - scripts: { - 'prepublish': 'exit 123', - 'prepare': 'writer build-artifact' - }, - devDependencies: { - writer: 'file:' + path.join(testdir, 'deps', 'writer') - } - }) - }), - writer: Dir({ - 'package.json': File({ - name: 'writer', - version: '1.0.0', - bin: 'writer.js' - }), - 'writer.js': File(`#!/usr/bin/env node\n - require('fs').writeFileSync(process.argv[2], 'hello, world!') - `) - }) - }) -})) - -test('setup', function (t) { - fixture.create(testdir) - setup(function (er, r) { - t.ifError(er, 'git started up successfully') - - if (!er) { - daemon = r[r.length - 2] - daemonPID = r[r.length - 1] - } - - mr({ - port: common.port - }, function (er, server) { - t.ifError(er, 'started mock registry') - mockRegistry = server - - t.end() - }) - }) -}) - -test('install from git repo with prepare script', function (t) { - const parent = path.join(testdir, 'deps', 'parent') - - common.npm([ - 'install', - '--no-save', - '--registry', common.registry, - '--cache', cache, - '--loglevel', 'error' - ], { - cwd: parent - }, function (err, code, stdout, stderr) { - if (err) { throw err } - t.equal(code, 0, 'exited successfully') - t.equal(stderr, '', 'no actual output on stderr') - - const target = path.join(parent, 'node_modules', 'child', 'build-artifact') - fs.readFile(target, 'utf8', (err, data) => { - if (err) { throw err } - t.equal(data, 'hello, world!', 'build artifact written for git dep') - t.end() - }) - }) -}) - -test('clean', function (t) { - mockRegistry.close() - daemon.on('close', t.end) - process.kill(daemonPID) -}) - -function setup (cb) { - npm.load({ - prefix: testdir, - loglevel: 'silent' - }, function () { - git = require('../../lib/utils/git.js') - - function startDaemon (cb) { - // start git server - const d = git.spawn( - [ - 'daemon', - '--verbose', - '--listen=localhost', - '--export-all', - '--base-path=.', - '--reuseaddr', - '--port=' + common.gitPort - ], - { - cwd: repo, - env: process.env - } - ) - d.stderr.on('data', childFinder) - - function childFinder (c) { - const cpid = c.toString().match(/^\[(\d+)\]/) - if (cpid[1]) { - this.removeListener('data', childFinder) - cb(null, [d, cpid[1]]) - } - } - } - - const childPath = path.join(testdir, 'deps', 'child') - common.makeGitRepo({ - path: childPath, - commands: [ - git.chainableExec([ - 'clone', '--bare', childPath, 'child.git' - ], { cwd: repo, env: process.env }), - startDaemon - ] - }, cb) - }) -} diff --git a/deps/npm/test/tap/github-shortcut-package.js b/deps/npm/test/tap/github-shortcut-package.js deleted file mode 100644 index 444520308a2452..00000000000000 --- a/deps/npm/test/tap/github-shortcut-package.js +++ /dev/null @@ -1,61 +0,0 @@ -'use strict' -var fs = require('graceful-fs') -var path = require('path') - -var requireInject = require('require-inject') -var test = require('tap').test - -var common = require('../common-tap.js') - -var pkg = common.pkg - -var json = { - name: 'github-shortcut-package', - version: '0.0.0', - dependencies: { - 'private': 'foo/private' - } -} - -test('github-shortcut-package', function (t) { - fs.writeFileSync( - path.join(pkg, 'package.json'), - JSON.stringify(json, null, 2) - ) - process.chdir(pkg) - var cloneUrls = [ - ['git://github.com/foo/private.git', 'GitHub shortcuts try git URLs first'], - ['https://github.com/foo/private.git', 'GitHub shortcuts try HTTPS URLs second'], - ['ssh://git@github.com/foo/private.git', 'GitHub shortcuts try SSH third'] - ] - var npm = requireInject.installGlobally('../../lib/npm.js', { - 'child_process': { - 'execFile': function (cmd, args, options, cb) { - process.nextTick(function () { - if (args.indexOf('clone') === -1) return cb(null, '', '') - var cloneUrl = cloneUrls.shift() - if (cloneUrl) { - t.is(args[args.length - 2], cloneUrl[0], cloneUrl[1]) - } else { - t.fail('too many attempts to clone') - } - cb(new Error()) - }) - } - } - }) - - var opts = { - cache: common.cache, - prefix: pkg, - registry: common.registry, - loglevel: 'silent' - } - npm.load(opts, function (er) { - t.ifError(er, 'npm loaded without error') - npm.commands.install([], function (er, result) { - t.ok(er, 'mocked install failed as expected') - t.end() - }) - }) -}) diff --git a/deps/npm/test/tap/github-shortcut.js b/deps/npm/test/tap/github-shortcut.js deleted file mode 100644 index 59c7e39ea948ff..00000000000000 --- a/deps/npm/test/tap/github-shortcut.js +++ /dev/null @@ -1,61 +0,0 @@ -'use strict' - -const BB = require('bluebird') - -const fs = require('graceful-fs') -const path = require('path') - -const requireInject = require('require-inject') -const test = require('tap').test - -const common = require('../common-tap.js') - -const pkg = common.pkg - -const json = { - name: 'github-shortcut', - version: '0.0.0' -} - -test('github-shortcut', function (t) { - fs.writeFileSync( - path.join(pkg, 'package.json'), - JSON.stringify(json, null, 2) - ) - process.chdir(pkg) - const cloneUrls = [ - ['git://github.com/foo/private.git', 'GitHub shortcuts try git URLs first'], - ['https://github.com/foo/private.git', 'GitHub shortcuts try HTTPS URLs second'], - ['ssh://git@github.com/foo/private.git', 'GitHub shortcuts try SSH third'] - ] - const npm = requireInject.installGlobally('../../lib/npm.js', { - 'pacote/lib/util/git': { - 'revs': (repo, opts) => { - return BB.resolve().then(() => { - const cloneUrl = cloneUrls.shift() - if (cloneUrl) { - t.is(repo, cloneUrl[0], cloneUrl[1]) - } else { - t.fail('too many attempts to clone') - } - throw new Error('git.revs mock fails on purpose') - }) - } - } - }) - - const opts = { - cache: common.cache, - prefix: pkg, - registry: common.registry, - loglevel: 'silent' - } - t.plan(2 + cloneUrls.length) - npm.load(opts, function (err) { - t.ifError(err, 'npm loaded without error') - npm.commands.install(['foo/private'], function (err, result) { - t.match(err.message, /mock fails on purpose/, 'mocked install failed as expected') - t.end() - }) - }) -}) diff --git a/deps/npm/test/tap/gitlab-shortcut-package.js b/deps/npm/test/tap/gitlab-shortcut-package.js deleted file mode 100644 index 9b431ff7b66f09..00000000000000 --- a/deps/npm/test/tap/gitlab-shortcut-package.js +++ /dev/null @@ -1,60 +0,0 @@ -'use strict' -var fs = require('graceful-fs') -var path = require('path') - -var requireInject = require('require-inject') -var test = require('tap').test - -var common = require('../common-tap.js') - -var pkg = common.pkg - -var json = { - name: 'gitlab-shortcut-package', - version: '0.0.0', - dependencies: { - 'private': 'gitlab:foo/private' - } -} - -test('gitlab-shortcut-package', function (t) { - fs.writeFileSync( - path.join(pkg, 'package.json'), - JSON.stringify(json, null, 2) - ) - process.chdir(pkg) - var cloneUrls = [ - ['https://gitlab.com/foo/private.git', 'GitLab shortcuts try HTTPS URLs second'], - ['ssh://git@gitlab.com/foo/private.git', 'GitLab shortcuts try SSH first'] - ] - var npm = requireInject.installGlobally('../../lib/npm.js', { - 'child_process': { - 'execFile': function (cmd, args, options, cb) { - process.nextTick(function () { - if (args.indexOf('clone') === -1) return cb(null, '', '') - var cloneUrl = cloneUrls.shift() - if (cloneUrl) { - t.is(args[args.length - 2], cloneUrl[0], cloneUrl[1]) - } else { - t.fail('too many attempts to clone') - } - cb(new Error()) - }) - } - } - }) - - var opts = { - cache: common.cache, - prefix: pkg, - registry: common.registry, - loglevel: 'silent' - } - npm.load(opts, function (er) { - t.ifError(er, 'npm loaded without error') - npm.commands.install([], function (er, result) { - t.ok(er, 'mocked install failed as expected') - t.end() - }) - }) -}) diff --git a/deps/npm/test/tap/gitlab-shortcut.js b/deps/npm/test/tap/gitlab-shortcut.js deleted file mode 100644 index 344311b45f26c2..00000000000000 --- a/deps/npm/test/tap/gitlab-shortcut.js +++ /dev/null @@ -1,57 +0,0 @@ -'use strict' -var fs = require('graceful-fs') -var path = require('path') - -var requireInject = require('require-inject') -var test = require('tap').test - -var common = require('../common-tap.js') - -var pkg = common.pkg - -var json = { - name: 'gitlab-shortcut', - version: '0.0.0' -} - -test('gitlab-shortcut', function (t) { - fs.writeFileSync( - path.join(pkg, 'package.json'), - JSON.stringify(json, null, 2) - ) - process.chdir(pkg) - var cloneUrls = [ - ['https://gitlab.com/foo/private.git', 'GitLab shortcuts try HTTPS URLs second'], - ['ssh://git@gitlab.com/foo/private.git', 'GitLab shortcuts try SSH first'] - ] - var npm = requireInject.installGlobally('../../lib/npm.js', { - 'child_process': { - 'execFile': function (cmd, args, options, cb) { - process.nextTick(function () { - if (args.indexOf('clone') === -1) return cb(null, '', '') - var cloneUrl = cloneUrls.shift() - if (cloneUrl) { - t.is(args[args.length - 2], cloneUrl[0], cloneUrl[1]) - } else { - t.fail('too many attempts to clone') - } - cb(new Error('execFile mock fails on purpose')) - }) - } - } - }) - - var opts = { - cache: common.cache, - prefix: pkg, - registry: common.registry, - loglevel: 'silent' - } - npm.load(opts, function (er) { - t.ifError(er, 'npm loaded without error') - npm.commands.install(['gitlab:foo/private'], function (er, result) { - t.ok(er, 'mocked install failed as expected') - t.end() - }) - }) -}) diff --git a/deps/npm/test/tap/global-prefix-set-in-userconfig.js b/deps/npm/test/tap/global-prefix-set-in-userconfig.js deleted file mode 100644 index 422bcb2477ec63..00000000000000 --- a/deps/npm/test/tap/global-prefix-set-in-userconfig.js +++ /dev/null @@ -1,36 +0,0 @@ -var common = require('../common-tap.js') -var test = require('tap').test -var rimraf = require('rimraf') -var prefix = __filename.replace(/\.js$/, '') -var rcfile = __filename.replace(/\.js$/, '.npmrc') -var fs = require('fs') -var conf = 'prefix = ' + prefix + '\n' - -test('setup', function (t) { - rimraf.sync(prefix) - fs.writeFileSync(rcfile, conf) - t.pass('ready') - t.end() -}) - -test('run command', function (t) { - var args = ['prefix', '-g', '--userconfig=' + rcfile] - common.npm(args, {env: {}}, function (er, code, so) { - if (er) throw er - t.notOk(code, 'npm prefix exited with code 0') - t.equal(so.trim(), prefix) - t.end() - }) -}) - -test('made dir', function (t) { - t.ok(fs.statSync(prefix).isDirectory()) - t.end() -}) - -test('cleanup', function (t) { - rimraf.sync(prefix) - rimraf.sync(rcfile) - t.pass('clean') - t.end() -}) diff --git a/deps/npm/test/tap/graceful-restart.js b/deps/npm/test/tap/graceful-restart.js deleted file mode 100644 index 787aa988949b64..00000000000000 --- a/deps/npm/test/tap/graceful-restart.js +++ /dev/null @@ -1,94 +0,0 @@ -var fs = require('fs') -var resolve = require('path').resolve -var test = require('tap').test -var common = require('../common-tap.js') -var pkg = common.pkg - -var outGraceless = [ - 'prerestart', - 'prestop', - 'stop', - 'poststop', - 'prestart', - 'start', - 'poststart', - 'postrestart', - '' -].join('\n') - -var outGraceful = [ - 'prerestart', - 'restart', - 'postrestart', - '' -].join('\n') - -var pjGraceless = JSON.stringify({ - name: 'graceless', - version: '1.2.3', - scripts: { - 'prestop': 'echo prestop', - 'stop': 'echo stop', - 'poststop': 'echo poststop', - 'prerestart': 'echo prerestart', - 'postrestart': 'echo postrestart', - 'prestart': 'echo prestart', - 'start': 'echo start', - 'poststart': 'echo poststart' - } -}, null, 2) + '\n' - -var pjGraceful = JSON.stringify({ - name: 'graceful', - version: '1.2.3', - scripts: { - 'prestop': 'echo prestop', - 'stop': 'echo stop', - 'poststop': 'echo poststop', - 'prerestart': 'echo prerestart', - 'restart': 'echo restart', - 'postrestart': 'echo postrestart', - 'prestart': 'echo prestart', - 'start': 'echo start', - 'poststart': 'echo poststart' - } -}, null, 2) + '\n' - -test('graceless restart', function (t) { - fs.writeFileSync(resolve(pkg, 'package.json'), pjGraceless) - createChild(['run-script', 'restart'], function (err, code, out) { - t.ifError(err, 'restart finished successfully') - t.equal(code, 0, 'npm run-script exited with code') - t.equal(out.replace(/\r/g, ''), outGraceless, 'expected all scripts to run') - t.end() - }) -}) - -test('graceful restart', function (t) { - fs.writeFileSync(resolve(pkg, 'package.json'), pjGraceful) - createChild(['run-script', 'restart'], function (err, code, out) { - t.ifError(err, 'restart finished successfully') - t.equal(code, 0, 'npm run-script exited with code') - t.equal(out.replace(/\r/g, ''), outGraceful, 'expected only *restart scripts to run') - t.end() - }) -}) - -function createChild (args, cb) { - var env = { - HOME: process.env.HOME, - Path: process.env.PATH, - PATH: process.env.PATH, - 'npm_config_loglevel': 'silent' - } - - if (process.platform === 'win32') { - env.npm_config_cache = '%APPDATA%\\npm-cache' - } - - return common.npm(args, { - cwd: pkg, - stdio: ['ignore', 'pipe', 'ignore'], - env: env - }, cb) -} diff --git a/deps/npm/test/tap/help.js b/deps/npm/test/tap/help.js deleted file mode 100644 index bc66a92298e003..00000000000000 --- a/deps/npm/test/tap/help.js +++ /dev/null @@ -1,26 +0,0 @@ -var test = require('tap').test -var common = require('../common-tap') - -test('npm food', function (t) { - common.npm('docz', {}, function (err, code, stdout, stderr) { - if (err) throw err - t.equal(code, 1, 'command ran with error') - - t.has(stdout, 'Did you mean this?') - - t.notOk(stderr, 'stderr should be empty') - t.end() - }) -}) - -test('npm jet', function (t) { - common.npm('jet', {}, function (err, code, stdout, stderr) { - if (err) throw err - t.equal(code, 1, 'command ran with error') - - t.has(stdout, 'Did you mean one of these?') - - t.notOk(stderr, 'stderr should be empty') - t.end() - }) -}) diff --git a/deps/npm/test/tap/hook.js b/deps/npm/test/tap/hook.js deleted file mode 100644 index d50b7b122174ae..00000000000000 --- a/deps/npm/test/tap/hook.js +++ /dev/null @@ -1,243 +0,0 @@ -'use strict' - -const common = require('../common-tap.js') -const test = require('tap').test - -test('hook add', (t) => { - let body - return common.withServer(server => { - server.filteringRequestBody(bod => { - body = JSON.parse(bod) - t.deepEqual(body, { - type: 'owner', - name: 'zkat', - endpoint: 'https://example.com', - secret: 'sekrit' - }, 'request sent correct body') - return true - }) - .post('/-/npm/v1/hooks/hook', true) - .reply(201, { - name: 'zkat', - type: 'owner', - endpoint: 'https://example.com' - }) - return common.npm([ - 'hook', 'add', '~zkat', 'https://example.com', 'sekrit', - '--registry', server.registry - ], {}).then(([code, stdout, stderr]) => { - t.comment(stdout) - t.comment(stderr) - t.equal(code, 0, 'exited successfully') - t.match( - stdout.trim(), - /^\+ ~zkat.*https:\/\/example\.com$/, - 'output info about new hook' - ) - }) - }) -}) - -test('hook add --json', (t) => { - return common.withServer(server => { - server - .filteringRequestBody(() => true) - .post('/-/npm/v1/hooks/hook', true) - .reply(201, { - name: 'npm', - type: 'scope', - endpoint: 'https://example.com' - }) - return common.npm([ - 'hook', 'add', '~zkat', 'https://example.com', 'sekrit', - '--json', - '--registry', server.registry - ], {}).then(([code, stdout, stderr]) => { - t.comment(stdout) - t.comment(stderr) - t.equal(code, 0, 'exited successfully') - t.deepEqual(JSON.parse(stdout), { - name: 'npm', - type: 'scope', - endpoint: 'https://example.com' - }, 'json response data returned') - }) - }) -}) - -test('hook rm', t => { - return common.withServer(server => { - server - .delete('/-/npm/v1/hooks/hook/dead%40beef') - .reply(200, { - name: 'zkat', - type: 'owner', - endpoint: 'https://example.com', - secret: 'sekrit' - }) - return common.npm([ - 'hook', 'rm', 'dead@beef', - '--registry', server.registry - ], {}).then(([code, stdout, stderr]) => { - t.comment(stdout) - t.comment(stderr) - t.equal(code, 0, 'exited successfully') - t.match( - stdout.trim(), - /^- ~zkat.*https:\/\/example\.com$/, - 'output info about new hook' - ) - }) - }) -}) - -test('hook rm --json', t => { - return common.withServer(server => { - server - .delete('/-/npm/v1/hooks/hook/dead%40beef') - .reply(200, { - name: 'zkat', - type: 'owner', - endpoint: 'https://example.com', - secret: 'sekrit' - }) - return common.npm([ - 'hook', 'rm', 'dead@beef', - '--json', - '--registry', server.registry - ], {}).then(([code, stdout, stderr]) => { - t.comment(stdout) - t.comment(stderr) - t.equal(code, 0, 'exited successfully') - t.deepEqual(JSON.parse(stdout), { - name: 'zkat', - type: 'owner', - endpoint: 'https://example.com', - secret: 'sekrit' - }, 'json response data returned') - }) - }) -}) - -test('hook ls', t => { - const objects = [ - {id: 'foo', type: 'package', name: '@foo/pkg', endpoint: 'foo.com'}, - {id: 'bar', type: 'owner', name: 'bar', endpoint: 'bar.com'}, - {id: 'baz', type: 'scope', name: 'baz', endpoint: 'baz.com'} - ] - return common.withServer(server => { - server - .get('/-/npm/v1/hooks?package=%40npm%2Fhooks') - .reply(200, {objects}) - return common.npm([ - 'hook', 'ls', '@npm/hooks', - '--registry', server.registry - ], {}).then(([code, stdout, stderr]) => { - t.comment(stdout) - t.comment(stderr) - t.equal(code, 0, 'exited successfully') - t.match( - stdout, - /You have 3 hooks configured/, - 'message about hook count' - ) - t.match( - stdout, - /foo\s+.*\s+@foo\/pkg\s+.*\s+foo\.com/, - 'package displayed as expected' - ) - t.match( - stdout, - /bar\s+.*\s+~bar\s+.*\s+bar\.com/, - 'owner displayed as expected' - ) - t.match( - stdout, - /baz\s+.*\s+@baz\s+.*\s+baz\.com/, - 'scope displayed as expected' - ) - }) - }) -}) - -test('hook ls --json', t => { - const objects = [ - {id: 'foo'}, - {id: 'bar'}, - {id: 'baz'} - ] - return common.withServer(server => { - server - .get('/-/npm/v1/hooks?package=%40npm%2Fhooks') - .reply(200, {objects}) - return common.npm([ - 'hook', 'ls', '@npm/hooks', - '--json', - '--registry', server.registry - ], {}).then(([code, stdout, stderr]) => { - t.comment(stdout) - t.comment(stderr) - t.equal(code, 0, 'exited successfully') - t.deepEqual(JSON.parse(stdout), objects, 'objects output as json') - }) - }) -}) - -test('hook update', t => { - return common.withServer(server => { - server.filteringRequestBody(() => true) - .put('/-/npm/v1/hooks/hook/dead%40beef', true) - .reply(200, { - type: 'scope', - name: 'npm', - endpoint: 'https://example.com', - secret: 'sekrit' - }) - return common.npm([ - 'hook', 'update', 'dead@beef', 'https://example.com', 'sekrit', - '--registry', server.registry - ], {}).then(([code, stdout, stderr]) => { - t.comment(stdout) - t.comment(stderr) - t.equal(code, 0, 'exited successfully') - t.match( - stdout.trim(), - /^\+ @npm\s+.*\s+https:\/\/example\.com$/, - 'output info about updated hook' - ) - }) - }) -}) - -test('hook update --json', t => { - let body - return common.withServer(server => { - server.filteringRequestBody(bod => { - body = JSON.parse(bod) - t.deepEqual(body, { - endpoint: 'https://example.com', - secret: 'sekrit' - }, 'request sent correct body') - return true - }) - .put('/-/npm/v1/hooks/hook/dead%40beef', true) - .reply(200, { - endpoint: 'https://example.com', - secret: 'sekrit' - }) - return common.npm([ - 'hook', 'update', 'dead@beef', 'https://example.com', 'sekrit', - '--json', - '--registry', server.registry - ], {}).then(([code, stdout, stderr]) => { - t.comment(stdout) - t.comment(stderr) - t.equal(code, 0, 'exited successfully') - const json = JSON.parse(stdout) - t.deepEqual(json, { - endpoint: 'https://example.com', - secret: 'sekrit' - }, 'json response data returned') - }) - }) -}) diff --git a/deps/npm/test/tap/ignore-install-link.js b/deps/npm/test/tap/ignore-install-link.js deleted file mode 100644 index 038b9448d78179..00000000000000 --- a/deps/npm/test/tap/ignore-install-link.js +++ /dev/null @@ -1,71 +0,0 @@ -var common = require('../common-tap.js') -common.skipIfWindows('symlinks are weird on windows') -var test = require('tap').test -var path = require('path') -var fs = require('fs') -var rimraf = require('rimraf') -var mkdirp = require('mkdirp') - -var root = common.pkg -var pkg = path.resolve(root, 'pkg') -var dep = path.resolve(root, 'dep') -var target = path.resolve(pkg, 'node_modules', 'dep') -var cache = common.cache -var globalPath = path.resolve(root, 'global') - -var pkgj = { - 'name': 'pkg', - 'version': '1.2.3', - 'dependencies': { - 'dep': '1.2.3' - } -} -var depj = { 'name': 'dep', 'version': '1.2.3' } - -var myreg = require('http').createServer(function (q, s) { - s.statusCode = 403 - s.end(JSON.stringify({'error': 'forbidden'}) + '\n') -}).listen(common.port) - -test('setup', function (t) { - rimraf.sync(root) - mkdirp.sync(root) - mkdirp.sync(path.resolve(pkg, 'node_modules')) - mkdirp.sync(dep) - mkdirp.sync(cache) - mkdirp.sync(globalPath) - fs.writeFileSync(path.resolve(pkg, 'package.json'), JSON.stringify(pkgj)) - fs.writeFileSync(path.resolve(dep, 'package.json'), JSON.stringify(depj)) - fs.symlinkSync(dep, target, 'dir') - t.end() -}) - -test('ignore install if package is linked', function (t) { - common.npm(['install'], { - cwd: pkg, - env: { - PATH: process.env.PATH || process.env.Path, - HOME: process.env.HOME, - 'npm_config_prefix': globalPath, - 'npm_config_cache': cache, - 'npm_config_registry': common.registry, - 'npm_config_loglevel': 'silent' - }, - stdio: 'inherit' - }, function (er, code) { - if (er) throw er - t.equal(code, 0, 'npm install exited with code') - t.end() - }) -}) - -test('still a symlink', function (t) { - t.equal(true, fs.lstatSync(target).isSymbolicLink()) - t.end() -}) - -test('cleanup', function (t) { - rimraf.sync(root) - myreg.close() - t.end() -}) diff --git a/deps/npm/test/tap/ignore-scripts.js b/deps/npm/test/tap/ignore-scripts.js deleted file mode 100644 index f5af4553c26c0f..00000000000000 --- a/deps/npm/test/tap/ignore-scripts.js +++ /dev/null @@ -1,128 +0,0 @@ -var fs = require('graceful-fs') -var path = require('path') - -var mkdirp = require('mkdirp') -var rimraf = require('rimraf') -var test = require('tap').test - -var common = require('../common-tap') - -// ignore-scripts/package.json has scripts that always exit with non-zero error -// codes. -var pkg = common.pkg - -var gypfile = 'bad_binding_file\n' -var json = { - author: 'Milton the Aussie', - name: 'ignore-scripts', - version: '0.0.0', - scripts: { - prepublish: 'exit 123', - publish: 'exit 123', - postpublish: 'exit 123', - preinstall: 'exit 123', - install: 'exit 123', - postinstall: 'exit 123', - preuninstall: 'exit 123', - uninstall: 'exit 123', - postuninstall: 'exit 123', - pretest: 'exit 123', - test: 'exit 123', - posttest: 'exit 123', - prestop: 'exit 123', - stop: 'exit 123', - poststop: 'exit 123', - prestart: 'exit 123', - start: 'exit 123', - poststart: 'exit 123', - prerestart: 'exit 123', - restart: 'exit 123', - postrestart: 'exit 123', - preversion: 'exit 123', - version: 'exit 123', - postversion: 'exit 123', - preshrinkwrap: 'exit 123', - shrinkwrap: 'exit 123', - postshrinkwrap: 'exit 123' - } -} - -test('setup', function (t) { - setup() - t.end() -}) - -test('ignore-scripts: install using the option', function (t) { - createChild(['install', '--ignore-scripts'], function (err, code) { - t.ifError(err, 'install with scripts ignored finished successfully') - t.equal(code, 0, 'npm install exited with code') - t.end() - }) -}) - -test('ignore-scripts: install NOT using the option', function (t) { - createChild(['install'], function (err, code) { - t.ifError(err, 'install with scripts successful') - t.notEqual(code, 0, 'npm install exited with code') - t.end() - }) -}) - -var scripts = [ - 'prepublish', 'publish', 'postpublish', - 'preinstall', 'install', 'postinstall', - 'preuninstall', 'uninstall', 'postuninstall', - 'pretest', 'test', 'posttest', - 'prestop', 'stop', 'poststop', - 'prestart', 'start', 'poststart', - 'prerestart', 'restart', 'postrestart', - 'preversion', 'version', 'postversion', - 'preshrinkwrap', 'shrinkwrap', 'postshrinkwrap' -] - -scripts.forEach(function (script) { - test('ignore-scripts: run-script ' + script + ' using the option', function (t) { - createChild(['--ignore-scripts', 'run-script', script], function (err, code, stdout, stderr) { - t.ifError(err, 'run-script ' + script + ' with ignore-scripts successful') - t.equal(code, 0, 'npm run-script exited with code') - t.end() - }) - }) -}) - -scripts.forEach(function (script) { - test('ignore-scripts: run-script ' + script + ' NOT using the option', function (t) { - createChild(['run-script', script], function (err, code) { - t.ifError(err, 'run-script ' + script + ' finished successfully') - t.notEqual(code, 0, 'npm run-script exited with code') - t.end() - }) - }) -}) - -test('cleanup', function (t) { - cleanup() - t.end() -}) - -function cleanup () { - rimraf.sync(pkg) -} - -function setup () { - cleanup() - mkdirp.sync(pkg) - fs.writeFileSync(path.join(pkg, 'binding.gyp'), gypfile) - fs.writeFileSync( - path.join(pkg, 'package.json'), - JSON.stringify(json, null, 2) - ) -} - -function createChild (args, cb) { - return common.npm( - args.concat(['--loglevel', 'silent']), - { cwd: pkg }, - cb - ) -} diff --git a/deps/npm/test/tap/init-create.js b/deps/npm/test/tap/init-create.js deleted file mode 100644 index 22d9090a97ef24..00000000000000 --- a/deps/npm/test/tap/init-create.js +++ /dev/null @@ -1,171 +0,0 @@ -/* eslint-disable standard/no-callback-literal */ -var test = require('tap').test -var requireInject = require('require-inject') - -var npm = require('../../lib/npm.js') - -test('npm init ', function (t) { - var initJsonMock = function () { - t.ok(false, 'should not run initJson()') - } - initJsonMock.yes = function () { - t.ok(false, 'should not run initJson.yes()') - return false - } - var libnpxMock = function () { - return Promise.resolve() - } - libnpxMock.parseArgs = function (argv, defaultNpm) { - t.ok(argv[0].includes('node'), 'node is the first arg') - t.equals(argv[2], '--always-spawn', 'set npx opts.alwaysSpawn') - t.equals(argv[3], 'create-name', 'expands name') - t.ok(defaultNpm.endsWith('npm-cli.js'), 'passes npm bin path') - } - - npm.load({ loglevel: 'silent' }, function () { - var init = requireInject('../../lib/init', { - 'init-package-json': initJsonMock, - 'libnpx': libnpxMock - }) - - init(['name'], function () {}) - - t.end() - }) -}) - -test('npm init expands scopes', function (t) { - var libnpxMock = function () { - return Promise.resolve() - } - - npm.load({ loglevel: 'silent' }, function () { - var init = requireInject('../../lib/init', { - 'libnpx': libnpxMock - }) - - libnpxMock.parseArgs = function (argv) { - t.equals(argv[3], '@scope/create', 'expands @scope') - } - - init(['@scope'], function () {}) - - libnpxMock.parseArgs = function (argv) { - t.equals(argv[3], '@scope/create-name', 'expands @scope/name') - } - - init(['@scope/name'], function () {}) - - t.end() - }) -}) - -test('npm init expands version names', function (t) { - var libnpxMock = function () { - return Promise.resolve() - } - - npm.load({ loglevel: 'silent' }, function () { - var init = requireInject('../../lib/init', { - 'libnpx': libnpxMock - }) - - libnpxMock.parseArgs = function (argv) { - t.equals(argv[3], 'create-name@1.2.3', 'expands name@1.2.3') - } - - init(['name@1.2.3'], function () {}) - - libnpxMock.parseArgs = function (argv) { - t.equals(argv[3], 'create-name@^1.2.3', 'expands name@^1.2.3') - } - - init(['name@^1.2.3'], function () {}) - - t.end() - }) -}) - -test('npm init expands git names', function (t) { - var libnpxMock = function () { - return Promise.resolve() - } - - npm.load({ loglevel: 'silent' }, function () { - var init = requireInject('../../lib/init', { - 'libnpx': libnpxMock - }) - - libnpxMock.parseArgs = function (argv) { - t.equals(argv[3], 'user/create-foo', 'expands git repo') - } - - init(['user/foo'], function () {}) - - libnpxMock.parseArgs = function (argv) { - t.equals(argv[3], 'git+https://github.com/user/create-foo', 'expands git url') - } - - init(['git+https://github.com/user/foo'], function () {}) - - t.end() - }) -}) - -test('npm init errors on folder and tarballs', function (t) { - npm.load({ loglevel: 'silent' }, function () { - var init = require('../../lib/init') - - try { - init(['../foo/bar/'], function () {}) - } catch (e) { - t.equals(e.code, 'EUNSUPPORTED') - } - - t.throws( - () => init(['../foo/bar/'], function () {}), - /Unrecognized initializer: \.\.\/foo\/bar\// - ) - - t.throws( - () => init(['file:foo.tar.gz'], function () {}), - /Unrecognized initializer: file:foo\.tar\.gz/ - ) - - t.throws( - () => init(['http://x.com/foo.tgz'], function () {}), - /Unrecognized initializer: http:\/\/x\.com\/foo\.tgz/ - ) - - t.end() - }) -}) - -test('npm init forwards arguments', function (t) { - var libnpxMock = function () { - return Promise.resolve() - } - - npm.load({ loglevel: 'silent' }, function () { - var origArgv = process.argv - var init = requireInject('../../lib/init', { - 'libnpx': libnpxMock - }) - - libnpxMock.parseArgs = function (argv) { - process.argv = origArgv - t.same(argv.slice(4), ['a', 'b', 'c']) - } - process.argv = [ - process.argv0, - 'NPM_CLI_PATH', - 'init', - 'name', - 'a', 'b', 'c' - ] - - init(['name'], function () {}) - - t.end() - }) -}) diff --git a/deps/npm/test/tap/init-interrupt.js b/deps/npm/test/tap/init-interrupt.js deleted file mode 100644 index 38c38053e590db..00000000000000 --- a/deps/npm/test/tap/init-interrupt.js +++ /dev/null @@ -1,38 +0,0 @@ -/* eslint-disable standard/no-callback-literal */ -// if 'npm init' is interrupted with ^C, don't report -// 'init written successfully' -var test = require('tap').test -var npmlog = require('npmlog') -var requireInject = require('require-inject') - -var npm = require('../../lib/npm.js') - -require('../common-tap.js') - -test('issue #6684 remove confusing message', function (t) { - var initJsonMock = function (dir, input, config, cb) { - process.nextTick(function () { - cb({ message: 'canceled' }) - }) - } - initJsonMock.yes = function () { return true } - - npm.load({ loglevel: 'silent' }, function () { - var log = '' - var init = requireInject('../../lib/init', { - 'init-package-json': initJsonMock - }) - - // capture log messages - npmlog.on('log', function (chunk) { log += chunk.message + '\n' }) - - init([], function (err, code) { - t.ifError(err, 'init ran successfully') - t.notOk(code, 'exited without issue') - t.notSimilar(log, /written successfully/, 'no success message written') - t.similar(log, /canceled/, 'alerted that init was canceled') - - t.end() - }) - }) -}) diff --git a/deps/npm/test/tap/install-actions.js b/deps/npm/test/tap/install-actions.js deleted file mode 100644 index 071dc2cc371edc..00000000000000 --- a/deps/npm/test/tap/install-actions.js +++ /dev/null @@ -1,117 +0,0 @@ -'use strict' -var npm = require('../../lib/npm.js') -var log = require('npmlog') -var test = require('tap').test - -var mockLog = { - finish: function () {}, - silly: function () {} -} - -var actions -test('setup', function (t) { - npm.load({ 'unsafe-perm': true }, function () { - log.disableProgress() - actions = require('../../lib/install/actions.js').actions - t.end() - }) -}) - -test('->optdep:a->dep:b', function (t) { - var moduleA = { - name: 'a', - path: '/a', - package: { - scripts: { - postinstall: 'false' - }, - dependencies: { - b: '*' - } - }, - isTop: true - } - var moduleB = { - name: 'b', - path: '/b', - package: {}, - requires: [], - requiredBy: [moduleA] - } - moduleA.requires = [moduleB] - - var tree = { - path: '/', - package: { - optionalDependencies: { - a: '*' - } - }, - children: [moduleA, moduleB], - requires: [moduleA], - isTop: true - } - moduleA.requiredBy = [tree] - moduleA.parent = tree - moduleB.parent = tree - - t.plan(3) - return actions.postinstall('/', moduleA, mockLog).then(() => { - throw new Error('was not supposed to succeed') - }, (err) => { - t.is(err && err.code, 'ELIFECYCLE', 'Lifecycle failed') - t.ok(moduleA.failed, 'moduleA (optional dep) is marked failed') - t.ok(moduleB.failed, 'moduleB (direct dep of moduleA) is marked as failed') - t.end() - }) -}) - -test('->dep:b,->optdep:a->dep:b', function (t) { - var moduleA = { - name: 'a', - path: '/', - package: { - scripts: { - postinstall: 'false' - }, - dependencies: { - b: '*' - } - }, - isTop: false - } - var moduleB = { - name: 'b', - path: '/', - package: {}, - requires: [], - requiredBy: [moduleA], - isTop: false - } - moduleA.requires = [moduleB] - - var tree = { - name: 'tree', - path: '/', - package: { - dependencies: { - b: '*' - }, - optionalDependencies: { - a: '*' - } - }, - children: [moduleA, moduleB], - requires: [moduleA, moduleB], - isTop: true - } - moduleA.requiredBy = [tree] - moduleB.requiredBy.push(tree) - moduleA.parent = tree - moduleB.parent = tree - - return actions.postinstall('/', moduleA, mockLog).then(() => { - t.ok(moduleA.failed, 'moduleA (optional dep) is marked failed') - t.ok(!moduleB.failed, 'moduleB (direct dep of moduleA) is marked as failed') - }) -}) diff --git a/deps/npm/test/tap/install-at-locally.js b/deps/npm/test/tap/install-at-locally.js deleted file mode 100644 index e4920d22d14aa9..00000000000000 --- a/deps/npm/test/tap/install-at-locally.js +++ /dev/null @@ -1,52 +0,0 @@ -var fs = require('graceful-fs') -var path = require('path') - -var mkdirp = require('mkdirp') -var rimraf = require('rimraf') -var test = require('tap').test - -var common = require('../common-tap.js') - -var pkg = common.pkg - -var EXEC_OPTS = { cwd: pkg, stdio: [0, 1, 2] } - -var json = { - name: 'install-at-locally-mock', - version: '0.0.0' -} - -test('\'npm install ./package@1.2.3\' should install local pkg', function (t) { - var target = './package@1.2.3' - setup(target) - common.npm(['install', '--loglevel=silent', target], EXEC_OPTS, function (err, code) { - if (err) throw err - var p = path.resolve(pkg, 'node_modules/install-at-locally-mock/package.json') - t.equal(code, 0, 'npm install exited with code') - t.ok(JSON.parse(fs.readFileSync(p, 'utf8'))) - t.end() - }) -}) - -test('\'npm install install/at/locally@./package@1.2.3\' should install local pkg', function (t) { - var target = 'install/at/locally@./package@1.2.3' - setup(target) - common.npm(['install', target], EXEC_OPTS, function (err, code) { - if (err) throw err - var p = path.resolve(pkg, 'node_modules/install-at-locally-mock/package.json') - t.equal(code, 0, 'npm install exited with code') - t.ok(JSON.parse(fs.readFileSync(p, 'utf8'))) - t.end() - }) -}) - -function setup (target) { - rimraf.sync(pkg) - var root = path.resolve(pkg, target) - mkdirp.sync(root) - fs.writeFileSync( - path.join(root, 'package.json'), - JSON.stringify(json, null, 2) - ) - mkdirp.sync(path.resolve(pkg, 'node_modules')) -} diff --git a/deps/npm/test/tap/install-at-sub-path-locally.js b/deps/npm/test/tap/install-at-sub-path-locally.js deleted file mode 100644 index 931d29bbd26422..00000000000000 --- a/deps/npm/test/tap/install-at-sub-path-locally.js +++ /dev/null @@ -1,49 +0,0 @@ -var fs = require('graceful-fs') -var path = require('path') - -var mkdirp = require('mkdirp') -var test = require('tap').test - -var common = require('../common-tap.js') - -var pkg = path.resolve(common.pkg, 'package') - -var EXEC_OPTS = { cwd: pkg, stdio: [0, 1, 2] } - -var json = { - name: 'install-at-sub-path-locally-mock', - version: '0.0.0' -} - -var target = '../package@1.2.3' - -test('setup', function (t) { - var root = path.resolve(pkg, target) - mkdirp.sync(root) - fs.writeFileSync( - path.join(root, 'package.json'), - JSON.stringify(json, null, 2) - ) - mkdirp.sync(path.resolve(pkg, 'node_modules')) - t.end() -}) - -test('\'npm install ../package@1.2.3\' should install local pkg from sub path', function (t) { - common.npm(['install', '--loglevel=silent', target], EXEC_OPTS, function (err, code) { - if (err) throw err - var p = path.resolve(pkg, 'node_modules/install-at-sub-path-locally-mock/package.json') - t.equal(code, 0, 'npm install exited with code') - t.ok(JSON.parse(fs.readFileSync(p, 'utf8'))) - t.end() - }) -}) - -test('\'running npm install ../package@1.2.3\' should not break on sub path re-install', function (t) { - common.npm(['install', '--loglevel=silent', target], EXEC_OPTS, function (err, code) { - if (err) throw err - var p = path.resolve(pkg, 'node_modules/install-at-sub-path-locally-mock/package.json') - t.equal(code, 0, 'npm install exited with code') - t.ok(JSON.parse(fs.readFileSync(p, 'utf8'))) - t.end() - }) -}) diff --git a/deps/npm/test/tap/install-bad-dep-format.js b/deps/npm/test/tap/install-bad-dep-format.js deleted file mode 100644 index 9d9a41383598df..00000000000000 --- a/deps/npm/test/tap/install-bad-dep-format.js +++ /dev/null @@ -1,33 +0,0 @@ -var fs = require('graceful-fs') -var path = require('path') - -var mkdirp = require('mkdirp') -var test = require('tap').test - -var common = require('../common-tap.js') - -var json = { - author: 'John Foo', - name: 'bad-dep-format', - version: '0.0.0', - dependencies: { - 'not-legit': 'bad:not-legit@1.0' - } -} - -test('invalid url format returns appropriate error', function (t) { - var pkgPath = path.resolve(common.pkg, json.name) - mkdirp.sync(pkgPath) - fs.writeFileSync( - path.join(pkgPath, 'package.json'), - JSON.stringify(json, null, 2) - ) - common.npm(['install'], {cwd: pkgPath}, function (err, code, stdout, stderr) { - t.ifError(err, 'install ran without error') - t.equals(code, 1, 'install exited with code 1') - t.match(stderr, - /ERR.*Unsupported URL Type/, - 'Error should report that invalid url-style formats are used') - t.end() - }) -}) diff --git a/deps/npm/test/tap/install-bad-man.js b/deps/npm/test/tap/install-bad-man.js deleted file mode 100644 index 0aa83a21c541a7..00000000000000 --- a/deps/npm/test/tap/install-bad-man.js +++ /dev/null @@ -1,61 +0,0 @@ -var fs = require('fs') -var resolve = require('path').resolve - -var mkdirp = require('mkdirp') -var test = require('tap').test - -var common = require('../common-tap.js') - -var pkg = resolve(common.pkg, 'package') -var target = resolve(common.pkg, 'target') - -var EXEC_OPTS = { - cwd: target -} - -var json = { - name: 'install-bad-man', - version: '1.2.3', - man: [ './install-bad-man.1.lol' ] -} - -common.skipIfWindows('man pages do not get installed on Windows') - -test('setup', function (t) { - mkdirp.sync(pkg) - // make sure it installs locally - mkdirp.sync(resolve(target, 'node_modules')) - fs.writeFileSync( - resolve(pkg, 'package.json'), - JSON.stringify(json, null, 2) + '\n' - ) - fs.writeFileSync(resolve(pkg, 'install-bad-man.1.lol'), 'lol\n') - t.end() -}) - -test("install from repo on 'OS X'", function (t) { - common.npm( - [ - 'install', - '--prefix', target, - '--global', - pkg - ], - EXEC_OPTS, - function (err, code, stdout, stderr) { - t.ifError(err, 'npm command ran from test') - t.equals(code, 1, 'install exited with failure (1)') - t.notOk(stdout, 'no output indicating success') - t.notOk( - stderr.match(/Cannot read property '1' of null/), - 'no longer has cryptic error output' - ) - t.ok( - stderr.match(/install-bad-man\.1\.lol is not a valid name/), - 'got expected error output' - ) - - t.end() - } - ) -}) diff --git a/deps/npm/test/tap/install-before.js b/deps/npm/test/tap/install-before.js deleted file mode 100644 index 05a254a1ef1ce9..00000000000000 --- a/deps/npm/test/tap/install-before.js +++ /dev/null @@ -1,89 +0,0 @@ -'use strict' - -const BB = require('bluebird') - -const common = require('../common-tap.js') -const mockTar = require('../util/mock-tarball.js') -const mr = common.fakeRegistry.compat -const path = require('path') -const rimraf = BB.promisify(require('rimraf')) -const Tacks = require('tacks') -const { test } = require('tap') - -const { Dir, File } = Tacks - -const testDir = common.pkg - -let server -test('setup', t => { - mr({}, (err, s) => { - t.ifError(err, 'registry mocked successfully') - server = s - t.end() - }) -}) - -test('installs an npm package before a certain date', t => { - const fixture = new Tacks(Dir({ - 'package.json': File({}) - })) - fixture.create(testDir) - const packument = { - name: 'foo', - 'dist-tags': { latest: '1.2.4' }, - versions: { - '1.2.3': { - name: 'foo', - version: '1.2.3', - dist: { - tarball: `${server.registry}/foo/-/foo-1.2.3.tgz` - } - }, - '1.2.4': { - name: 'foo', - version: '1.2.4', - dist: { - tarball: `${server.registry}/foo/-/foo-1.2.4.tgz` - } - } - }, - time: { - created: '2017-01-01T00:00:01.000Z', - modified: '2018-01-01T00:00:01.000Z', - '1.2.3': '2017-01-01T00:00:01.000Z', - '1.2.4': '2018-01-01T00:00:01.000Z' - } - } - server.get('/foo').reply(200, packument) - return mockTar({ - 'package.json': JSON.stringify({ - name: 'foo', - version: '1.2.3' - }) - }).then(tarball => { - server.get('/foo/-/foo-1.2.3.tgz').reply(200, tarball) - server.get('/foo/-/foo-1.2.4.tgz').reply(500) - return common.npm([ - 'install', 'foo', - '--before', '2018', - '--json', - '--cache', path.join(testDir, 'npmcache'), - '--registry', server.registry - ], { cwd: testDir }) - }).then(([code, stdout, stderr]) => { - t.comment(stdout) - t.comment(stderr) - t.like(JSON.parse(stdout), { - added: [{ - action: 'add', - name: 'foo', - version: '1.2.3' - }] - }, 'installed the 2017 version of the package') - }) -}) - -test('cleanup', t => { - server.close() - return rimraf(testDir) -}) diff --git a/deps/npm/test/tap/install-bin-null.js b/deps/npm/test/tap/install-bin-null.js deleted file mode 100644 index 2ad75eb59940aa..00000000000000 --- a/deps/npm/test/tap/install-bin-null.js +++ /dev/null @@ -1,73 +0,0 @@ -var fs = require('graceful-fs') -var path = require('path') - -var mkdirp = require('mkdirp') -var test = require('tap').test - -var common = require('../common-tap.js') - -var pkg = common.pkg - -var EXEC_OPTS = { cwd: pkg } - -var parentPkg = { - name: 'parent-package', - version: '0.0.0', - dependencies: { - 'child-package-a': 'file:./child-package-a', - 'child-package-b': 'file:./child-package-b' - } -} - -var childPkgA = { - name: 'child-package-a', - version: '0.0.0', - bin: 'index.js' -} - -var childPkgB = { - name: 'child-package-b', - version: '0.0.0', - dependencies: { - 'grandchild-package': 'file:../grandchild-package' - } -} - -var grandchildPkg = { - name: 'grandchild-package', - version: '0.0.0', - bin: null -} - -var pkgs = [childPkgA, childPkgB, grandchildPkg] - -test('setup', t => { - mkdirp.sync(pkg) - fs.writeFileSync( - path.join(pkg, 'package.json'), - JSON.stringify(parentPkg, null, 2) - ) - pkgs.forEach(function (json) { - var pkgPath = path.resolve(pkg, json.name) - mkdirp.sync(pkgPath) - fs.writeFileSync( - path.join(pkgPath, 'package.json'), - JSON.stringify(json, null, 2) - ) - }) - fs.writeFileSync( - path.join(pkg, childPkgA.name, 'index.js'), - '' - ) - t.end() -}) - -test('the grandchild has bin:null', function (t) { - common.npm(['install'], EXEC_OPTS, function (err, code, stdout, stderr) { - t.ifErr(err, 'npm link finished without error') - t.equal(code, 0, 'exited ok') - t.ok(stdout, 'output indicating success') - t.notOk(stderr, 'no output stderr') - t.end() - }) -}) diff --git a/deps/npm/test/tap/install-cli-only-development.js b/deps/npm/test/tap/install-cli-only-development.js deleted file mode 100644 index 6f03931d80e9cd..00000000000000 --- a/deps/npm/test/tap/install-cli-only-development.js +++ /dev/null @@ -1,95 +0,0 @@ -var fs = require('graceful-fs') -var path = require('path') -var existsSync = fs.existsSync || path.existsSync - -var mkdirp = require('mkdirp') -var rimraf = require('rimraf') -const t = require('tap') - -var common = require('../common-tap.js') - -var pkg = common.pkg - -var EXEC_OPTS = { cwd: pkg } - -var json = { - name: 'install-cli-development', - description: 'fixture', - version: '0.0.0', - dependencies: { - dependency: 'file:./dependency' - }, - devDependencies: { - 'dev-dependency': 'file:./dev-dependency' - } -} - -var dependency = { - name: 'dependency', - description: 'fixture', - version: '0.0.0' -} - -var devDependency = { - name: 'dev-dependency', - description: 'fixture', - version: '0.0.0' -} - -t.test('setup', t => { - mkdirp.sync(path.join(pkg, 'dependency')) - fs.writeFileSync( - path.join(pkg, 'dependency', 'package.json'), - JSON.stringify(dependency, null, 2) - ) - - mkdirp.sync(path.join(pkg, 'dev-dependency')) - fs.writeFileSync( - path.join(pkg, 'dev-dependency', 'package.json'), - JSON.stringify(devDependency, null, 2) - ) - - mkdirp.sync(path.join(pkg, 'node_modules')) - fs.writeFileSync( - path.join(pkg, 'package.json'), - JSON.stringify(json, null, 2) - ) - - t.end() -}) - -t.test('\'npm install --only=development\' should only install devDependencies', function (t) { - common.npm(['install', '--only=development'], EXEC_OPTS, function (err, code) { - t.ifError(err, 'install development successful') - t.equal(code, 0, 'npm install did not raise error code') - t.ok( - JSON.parse(fs.readFileSync( - path.resolve(pkg, 'node_modules/dev-dependency/package.json'), 'utf8') - ), - 'devDependency was installed' - ) - t.notOk( - existsSync(path.resolve(pkg, 'node_modules/dependency/package.json')), - 'dependency was NOT installed' - ) - rimraf(path.join(pkg, 'node_modules'), t.end) - }) -}) - -t.test('\'npm install --only=development\' should only install devDependencies regardless of npm.config.get(\'production\')', function (t) { - common.npm(['install', '--only=development', '--production'], EXEC_OPTS, function (err, code) { - t.ifError(err, 'install development successful') - t.equal(code, 0, 'npm install did not raise error code') - t.ok( - JSON.parse(fs.readFileSync( - path.resolve(pkg, 'node_modules/dev-dependency/package.json'), 'utf8') - ), - 'devDependency was installed' - ) - t.notOk( - existsSync(path.resolve(pkg, 'node_modules/dependency/package.json')), - 'dependency was NOT installed' - ) - rimraf(path.join(pkg, 'node_modules'), t.end) - }) -}) diff --git a/deps/npm/test/tap/install-cli-only-production.js b/deps/npm/test/tap/install-cli-only-production.js deleted file mode 100644 index 63863ff934d93a..00000000000000 --- a/deps/npm/test/tap/install-cli-only-production.js +++ /dev/null @@ -1,81 +0,0 @@ -var fs = require('graceful-fs') -var path = require('path') -var existsSync = fs.existsSync || path.existsSync - -var mkdirp = require('mkdirp') -var test = require('tap').test - -var common = require('../common-tap.js') - -var pkg = common.pkg - -var EXEC_OPTS = { cwd: pkg } - -var json = { - name: 'install-cli-only-production', - description: 'fixture', - version: '0.0.0', - scripts: { - prepublish: 'exit 123' - }, - dependencies: { - dependency: 'file:./dependency' - }, - devDependencies: { - 'dev-dependency': 'file:./dev-dependency' - } -} - -var dependency = { - name: 'dependency', - description: 'fixture', - version: '0.0.0' -} - -var devDependency = { - name: 'dev-dependency', - description: 'fixture', - version: '0.0.0' -} - -test('setup', function (t) { - mkdirp.sync(path.join(pkg, 'dependency')) - fs.writeFileSync( - path.join(pkg, 'dependency', 'package.json'), - JSON.stringify(dependency, null, 2) - ) - - mkdirp.sync(path.join(pkg, 'dev-dependency')) - fs.writeFileSync( - path.join(pkg, 'dev-dependency', 'package.json'), - JSON.stringify(devDependency, null, 2) - ) - - mkdirp.sync(path.join(pkg, 'node_modules')) - fs.writeFileSync( - path.join(pkg, 'package.json'), - JSON.stringify(json, null, 2) - ) - - t.end() -}) - -test('\'npm install --only=production\' should only install dependencies', function (t) { - common.npm(['install', '--only=production'], EXEC_OPTS, function (err, code, stdout, stderr) { - if (err) throw err - t.comment('1> ' + stdout) - t.comment('2> ' + stderr) - t.equal(code, 0, 'npm install did not raise error code') - t.ok( - JSON.parse(fs.readFileSync( - path.resolve(pkg, 'node_modules/dependency/package.json'), 'utf8') - ), - 'dependency was installed' - ) - t.notOk( - existsSync(path.resolve(pkg, 'node_modules/dev-dependency/package.json')), - 'devDependency was NOT installed' - ) - t.end() - }) -}) diff --git a/deps/npm/test/tap/install-cli-only-shrinkwrap.js b/deps/npm/test/tap/install-cli-only-shrinkwrap.js deleted file mode 100644 index 004593d782c227..00000000000000 --- a/deps/npm/test/tap/install-cli-only-shrinkwrap.js +++ /dev/null @@ -1,119 +0,0 @@ -var fs = require('graceful-fs') -var path = require('path') -var existsSync = fs.existsSync || path.existsSync - -var mkdirp = require('mkdirp') -var rimraf = require('rimraf') -var test = require('tap').test - -var common = require('../common-tap.js') - -var pkg = common.pkg - -var EXEC_OPTS = { cwd: pkg } - -var json = { - name: 'install-cli-only-shrinkwrap', - description: 'fixture', - version: '0.0.0', - dependencies: { - dependency: 'file:./dependency' - }, - devDependencies: { - 'dev-dependency': 'file:./dev-dependency' - } -} - -var shrinkwrap = { - name: 'install-cli-only-shrinkwrap', - description: 'fixture', - version: '0.0.0', - lockfileVersion: 1, - requires: true, - dependencies: { - dependency: { - version: 'file:./dependency' - }, - 'dev-dependency': { - version: 'file:./dev-dependency', - dev: true - } - } -} - -var dependency = { - name: 'dependency', - description: 'fixture', - version: '0.0.0' -} - -var devDependency = { - name: 'dev-dependency', - description: 'fixture', - version: '0.0.0' -} - -test('setup', function (t) { - mkdirp.sync(path.join(pkg, 'dependency')) - fs.writeFileSync( - path.join(pkg, 'dependency', 'package.json'), - JSON.stringify(dependency, null, 2) - ) - - mkdirp.sync(path.join(pkg, 'dev-dependency')) - fs.writeFileSync( - path.join(pkg, 'dev-dependency', 'package.json'), - JSON.stringify(devDependency, null, 2) - ) - - mkdirp.sync(path.join(pkg, 'node_modules')) - fs.writeFileSync( - path.join(pkg, 'package.json'), - JSON.stringify(json, null, 2) - ) - fs.writeFileSync( - path.join(pkg, 'npm-shrinkwrap.json'), - JSON.stringify(shrinkwrap, null, 2) - ) - t.end() -}) - -test('\'npm install --only=development\' should only install devDependencies', function (t) { - common.npm(['install', '--only=development'], EXEC_OPTS, function (err, code, stderr, stdout) { - if (err) throw err - t.comment(stdout.trim()) - t.comment(stderr.trim()) - t.is(code, 0, 'npm install did not raise error code') - t.ok( - existsSync( - path.resolve(pkg, 'node_modules/dev-dependency/package.json') - ), - 'devDependency was installed' - ) - t.notOk( - existsSync(path.resolve(pkg, 'node_modules/dependency/package.json')), - 'dependency was NOT installed' - ) - rimraf(path.join(pkg, 'node_modules'), t.end) - }) -}) - -test('\'npm install --only=production\' should only install dependencies', function (t) { - common.npm(['install', '--only=production'], EXEC_OPTS, function (err, code, stdout, stderr) { - if (err) throw err - t.comment(stdout.trim()) - t.comment(stderr.trim()) - t.is(code, 0, 'npm install did not raise error code') - t.ok( - existsSync( - path.resolve(pkg, 'node_modules/dependency/package.json') - ), - 'dependency was installed' - ) - t.notOk( - existsSync(path.resolve(pkg, 'node_modules/dev-dependency/package.json')), - 'devDependency was NOT installed' - ) - rimraf(path.join(pkg, 'node_modules'), t.end) - }) -}) diff --git a/deps/npm/test/tap/install-cli-production-nosave.js b/deps/npm/test/tap/install-cli-production-nosave.js deleted file mode 100644 index 23f54949964734..00000000000000 --- a/deps/npm/test/tap/install-cli-production-nosave.js +++ /dev/null @@ -1,48 +0,0 @@ -var fs = require('fs') -var path = require('path') - -var mkdirp = require('mkdirp') -var mr = require('npm-registry-mock') -var t = require('tap') - -var common = require('../common-tap.js') - -var pkg = common.pkg - -var EXEC_OPTS = { cwd: pkg } - -var PACKAGE_JSON1 = { - name: 'install-cli-production-nosave', - version: '0.0.1', - dependencies: { - } -} - -t.test('setup', function (t) { - mkdirp.sync(path.resolve(pkg, 'node_modules')) - fs.writeFileSync( - path.join(pkg, 'package.json'), - JSON.stringify(PACKAGE_JSON1, null, 2) - ) - mr({ port: common.port }, function (er, s) { - t.ifError(er, 'started mock registry') - t.parent.teardown(() => s.close()) - t.end() - }) -}) - -t.test('install --production without --save exits successfully', function (t) { - common.npm( - [ - '--registry', common.registry, - '--loglevel', 'silent', - 'install', '--production', 'underscore' - ], - EXEC_OPTS, - function (err, code) { - t.ifError(err, 'npm install ran without issue') - t.notOk(code, 'npm install exited with code 0') - t.end() - } - ) -}) diff --git a/deps/npm/test/tap/install-cli-production.js b/deps/npm/test/tap/install-cli-production.js deleted file mode 100644 index d083b4295738b0..00000000000000 --- a/deps/npm/test/tap/install-cli-production.js +++ /dev/null @@ -1,79 +0,0 @@ -var fs = require('graceful-fs') -var path = require('path') -var existsSync = fs.existsSync || path.existsSync - -var mkdirp = require('mkdirp') -var test = require('tap').test - -var common = require('../common-tap.js') - -var pkg = common.pkg - -var EXEC_OPTS = { cwd: pkg } - -var json = { - name: 'install-cli-production', - description: 'fixture', - version: '0.0.0', - scripts: { - prepublish: 'exit 123' - }, - dependencies: { - dependency: 'file:./dependency' - }, - devDependencies: { - 'dev-dependency': 'file:./dev-dependency' - } -} - -var dependency = { - name: 'dependency', - description: 'fixture', - version: '0.0.0' -} - -var devDependency = { - name: 'dev-dependency', - description: 'fixture', - version: '0.0.0' -} - -test('setup', function (t) { - mkdirp.sync(path.join(pkg, 'dependency')) - fs.writeFileSync( - path.join(pkg, 'dependency', 'package.json'), - JSON.stringify(dependency, null, 2) - ) - - mkdirp.sync(path.join(pkg, 'dev-dependency')) - fs.writeFileSync( - path.join(pkg, 'dev-dependency', 'package.json'), - JSON.stringify(devDependency, null, 2) - ) - - mkdirp.sync(path.join(pkg, 'node_modules')) - fs.writeFileSync( - path.join(pkg, 'package.json'), - JSON.stringify(json, null, 2) - ) - - t.end() -}) - -test('\'npm install --production\' should only install dependencies', function (t) { - common.npm(['install', '--production'], EXEC_OPTS, function (err, code) { - t.ifError(err, 'install production successful') - t.equal(code, 0, 'npm install did not raise error code') - t.ok( - JSON.parse(fs.readFileSync( - path.resolve(pkg, 'node_modules/dependency/package.json'), 'utf8') - ), - 'dependency was installed' - ) - t.notOk( - existsSync(path.resolve(pkg, 'node_modules/dev-dependency/package.json')), - 'devDependency was NOT installed' - ) - t.end() - }) -}) diff --git a/deps/npm/test/tap/install-cli-unicode.js b/deps/npm/test/tap/install-cli-unicode.js deleted file mode 100644 index 930066db5fe54d..00000000000000 --- a/deps/npm/test/tap/install-cli-unicode.js +++ /dev/null @@ -1,57 +0,0 @@ -var fs = require('graceful-fs') -var path = require('path') - -var mr = require('npm-registry-mock') -var test = require('tap').test - -var common = require('../common-tap.js') - -var pkg = common.pkg - -function hasOnlyAscii (s) { - return /^[\000-\177]*$/.test(s) -} - -var EXEC_OPTS = { cwd: pkg } - -var json = { - name: 'install-cli', - description: 'fixture', - version: '0.0.1', - dependencies: { - read: '1.0.5' - } -} - -test('setup', function (t) { - fs.writeFileSync( - path.join(pkg, 'package.json'), - JSON.stringify(json, null, 2) - ) - - mr({ port: common.port }, function (er, s) { - t.parent.teardown(() => s.close()) - t.end() - }) -}) - -test('does not use unicode with --unicode false', function (t) { - common.npm( - [ - '--unicode', 'false', - '--registry', common.registry, - '--loglevel', 'silent', - 'install', 'optimist' - ], - EXEC_OPTS, - function (err, code, stdout) { - t.ifError(err, 'install package read without unicode success') - t.notOk(code, 'npm install exited with code 0') - t.ifError(err, 'npm install ran without issue') - t.ok(stdout, 'got some output') - t.ok(hasOnlyAscii(stdout), 'only ASCII in install output') - - t.end() - } - ) -}) diff --git a/deps/npm/test/tap/install-contributors-count.js b/deps/npm/test/tap/install-contributors-count.js deleted file mode 100644 index ead925081330bb..00000000000000 --- a/deps/npm/test/tap/install-contributors-count.js +++ /dev/null @@ -1,69 +0,0 @@ -'use strict' -var test = require('tap').test -var Tacks = require('tacks') -var Dir = Tacks.Dir -var File = Tacks.File -var common = require('../common-tap.js') - -var testdir = common.pkg -var fixture = new Tacks(Dir({ - node_modules: Dir({ - a: Dir({ - 'package.json': File({ - name: 'a', - version: '1.0.0', - dependencies: { - b: '1.0.0' - } - }), - node_modules: Dir({ - b: Dir({ - 'package.json': File({ - name: 'b', - version: '1.0.0' - }) - }) - }) - }) - }), - 'b-src': Dir({ - 'package.json': File({ - name: 'b', - author: 'Author Contributor', - contributors: [ - {name: 'Author Contributor'}, - 'Another Contributor' - ], - version: '1.0.0' - }) - }) -})) - -function setup () { - cleanup() - fixture.create(testdir) -} - -function cleanup () { - fixture.remove(testdir) -} - -test('setup', function (t) { - setup() - t.end() -}) - -test('install', function (t) { - common.npm(['install', '--no-save', './b-src'], {cwd: testdir}, function (err, code, stdout, stderr) { - if (err) throw err - t.is(code, 0, 'installed successfully') - t.is(stderr, '', 'no warnings') - t.includes(stdout, 'added 1 package from 2 contributors', 'lists number of unique contributors') - t.end() - }) -}) - -test('cleanup', function (t) { - cleanup() - t.end() -}) diff --git a/deps/npm/test/tap/install-dep-classification.js b/deps/npm/test/tap/install-dep-classification.js deleted file mode 100644 index 1c9995cedc8a04..00000000000000 --- a/deps/npm/test/tap/install-dep-classification.js +++ /dev/null @@ -1,188 +0,0 @@ -'use strict' -const path = require('path') -const test = require('tap').test -const Tacks = require('tacks') -const File = Tacks.File -const Dir = Tacks.Dir -const common = require('../common-tap.js') -const fs = require('fs') - -const basedir = common.pkg -const testdir = path.join(basedir, 'testdir') -const cachedir = common.cache -const globaldir = path.join(basedir, 'global') -const tmpdir = path.join(basedir, 'tmp') -const optionaldir = path.join(testdir, 'optional') -const devdir = path.join(testdir, 'dev') - -const env = common.newEnv().extend({ - npm_config_cache: cachedir, - npm_config_tmp: tmpdir, - npm_config_prefix: globaldir, - npm_config_registry: common.registry, - npm_config_loglevel: 'error' -}) - -/** - * NOTE: Tarball Fixtures - * They contain package.json files with dependencies like the following: - * a-1.0.0.tgz: package/package.json - * { - * "name":"a", - * "version":"1.0.0", - * "dependencies":{ - * "b":"./b-1.0.0.tgz" - * } - * } - * example-1.0.0.tgz: package/package.json - * { - * "name":"example", - * "version":"1.0.0", - * "dependencies":{ - * "a":"./a-1.0.0.tgz", - * "b":"./b-1.0.0.tgz" - * } - * } - */ -const fixture = new Tacks(Dir({ - cache: Dir(), - global: Dir(), - tmp: Dir(), - testdir: Dir({ - 'a-1.0.0.tgz': File(Buffer.from( - '1f8b0800000000000003edcfc10a83300c06e09df71492f35653567bf06d' + - 'a2067163b558b7c3c4775f54f0e4654c18837e973f4da0249eca1bd59cfa' + - '25d535b4eeb03344b4c6245bfd8946995d328b5a5b3bd55264464beebdc8' + - '9647e8a99355befd67b92559f34f0ce0e8ce9003c1099edc85a675f2d20a' + - '154aa762cfae6257361c201fa090994a8bf33c577dfd82713cfefa86288a' + - 'a2e8736f68a0ff4400080000', - 'hex' - )), - 'b-1.0.0.tgz': File(Buffer.from( - '1f8b08000000000000032b484cce4e4c4fd52f80d07a59c5f9790c540606' + - '06066626260ad8c4c1c0d85c81c1d8d4ccc0d0d0cccc00a80ec830353103' + - 'd2d4760836505a5c925804740aa5e640bca200a78708a856ca4bcc4d55b2' + - '524a52d2512a4b2d2acecccf03f20cf50cf40c946ab906da79a360148c82' + - '51300a680400106986b400080000', - 'hex' - )), - dev: Dir({ - 'package.json': File({ - name: 'dev', - version: '1.0.0', - devDependencies: { - example: '../example-1.0.0.tgz' - } - }) - }), - 'example-1.0.0.tgz': File(Buffer.from( - '1f8b0800000000000003ed8fc10a83300c863def2924e7ada6587bf06daa' + - '06719bb55837c6c4775fa6307670a70963d0ef92f02584fcce94275353e2' + - '962a8ebeb3d1c620a2562a5ef34f64aae328cd344aa935f21e379962875b' + - '3fb2c6c50fa6e757bebdb364895ff54f18c19a962007ba99d69d09f670a5' + - 'de379d6527050a645391235b912d1bf2908f607826127398e762a8efbc53' + - 'ccae7873d3b4fb75ba402010087ce2014747c9d500080000', - 'hex' - )), - optional: Dir({ - 'package.json': File({ - name: 'optional', - version: '1.0.0', - optionalDependencies: { - example: '../example-1.0.0.tgz' - } - }) - }) - }) -})) - -function setup () { - cleanup() - fixture.create(basedir) -} - -function cleanup () { - fixture.remove(basedir) -} - -test('setup', function (t) { - setup() - return common.fakeRegistry.listen() -}) - -test('optional dependency identification', function (t) { - return common.npm(['install', '--no-optional'], {cwd: optionaldir, env}).then(([code, stdout, stderr]) => { - t.is(code, 0, 'no error code') - t.is(stderr, '', 'no error output') - t.notOk(fs.existsSync(path.join(optionaldir, 'node_modules')), 'did not install anything') - t.similar(JSON.parse(fs.readFileSync(path.join(optionaldir, 'package-lock.json'), 'utf8')), { - dependencies: { - a: { - version: 'file:../a-1.0.0.tgz', - optional: true - }, - b: { - version: 'file:../b-1.0.0.tgz', - optional: true - }, - example: { - version: 'file:../example-1.0.0.tgz', - optional: true - } - } - }, 'locks dependencies as optional') - }) -}) - -test('development dependency identification', function (t) { - return common.npm(['install', '--only=prod'], {cwd: devdir, env}).then(([code, stdout, stderr]) => { - t.is(code, 0, 'no error code') - t.is(stderr, '', 'no error output') - t.notOk(fs.existsSync(path.join(devdir, 'node_modules')), 'did not install anything') - t.similar(JSON.parse(fs.readFileSync(path.join(devdir, 'package-lock.json'), 'utf8')), { - dependencies: { - a: { - version: 'file:../a-1.0.0.tgz', - dev: true - }, - b: { - version: 'file:../b-1.0.0.tgz', - dev: true - }, - example: { - version: 'file:../example-1.0.0.tgz', - dev: true - } - } - }, 'locks dependencies as dev') - }) -}) - -test('default dependency identification', function (t) { - return common.npm(['install'], {cwd: optionaldir, env}).then(([code, stdout, stderr]) => { - t.is(code, 0, 'no error code') - t.is(stderr, '', 'no error output') - t.similar(JSON.parse(fs.readFileSync(path.join(optionaldir, 'package-lock.json'), 'utf8')), { - dependencies: { - a: { - version: 'file:../a-1.0.0.tgz', - optional: true - }, - b: { - version: 'file:../b-1.0.0.tgz', - optional: true - }, - example: { - version: 'file:../example-1.0.0.tgz', - optional: true - } - } - }, 'locks dependencies as optional') - }) -}) - -test('cleanup', function (t) { - common.fakeRegistry.close() - cleanup() - t.done() -}) diff --git a/deps/npm/test/tap/install-duplicate-deps-warning.js b/deps/npm/test/tap/install-duplicate-deps-warning.js deleted file mode 100644 index 869476ccd17ef1..00000000000000 --- a/deps/npm/test/tap/install-duplicate-deps-warning.js +++ /dev/null @@ -1,51 +0,0 @@ -var fs = require('graceful-fs') -var path = require('path') - -var mr = require('npm-registry-mock') -var test = require('tap').test - -var common = require('../common-tap.js') -var npm = require('../../') - -var pkg = common.pkg - -var json = { - dependencies: { - underscore: '1.5.1' - }, - devDependencies: { - underscore: '1.3.1' - } -} - -test('npm install with duplicate dependencies, different versions', function (t) { - t.plan(1) - t.comment('test for https://github.com/npm/npm/issues/6725') - - fs.writeFileSync( - path.join(pkg, 'package.json'), - JSON.stringify(json, null, 2) - ) - process.chdir(pkg) - - mr({ port: common.port }, function (er, s) { - var opts = { - cache: common.cache, - registry: common.registry - } - - npm.load(opts, function (err) { - if (err) return t.fail(err) - - npm.install('.', function (err, additions, result) { - if (err) return t.fail(err) - - var invalid = result.warnings.filter(function (warning) { return warning.code === 'EDUPLICATEDEP' }) - t.is(invalid.length, 1, 'got a warning (EDUPLICATEDEP) for duplicate dev/production dependencies') - - s.close() - t.end() - }) - }) - }) -}) diff --git a/deps/npm/test/tap/install-from-local-multipath.js b/deps/npm/test/tap/install-from-local-multipath.js deleted file mode 100644 index e35794dca986cb..00000000000000 --- a/deps/npm/test/tap/install-from-local-multipath.js +++ /dev/null @@ -1,173 +0,0 @@ -var fs = require('graceful-fs') -var path = require('path') - -var mkdirp = require('mkdirp') -var test = require('tap').test - -var common = require('../common-tap') - -var root = common.pkg -// Allow running this test on older commits (useful for bisecting) -if (!root) { - var main = require.main.filename - root = path.resolve(path.dirname(main), path.basename(main, '.js')) -} -var pkg = path.join(root, 'parent') - -var EXEC_OPTS = { cwd: pkg } - -var parent = { - name: 'parent', - version: '0.0.0', - dependencies: { - 'child-1-1': 'file:../children/child-1-1', - 'child-1-2': 'file:../children/child-1-2', - 'child-2': 'file:../children/child-2' - } -} - -var parentLock = { - 'name': 'parent', - 'version': '1.0.0', - 'lockfileVersion': 1, - 'requires': true, - 'dependencies': { - 'child-1-1': { - 'version': 'file:../children/child-1-1', - 'requires': { - 'child-2': 'file:../children/child-2' - } - }, - 'child-1-2': { - 'version': 'file:../children/child-1-2', - 'requires': { - 'child-1-1': 'file:../children/child-1-1', - 'child-2': 'file:../children/child-2' - } - }, - 'child-2': { - 'version': 'file:../children/child-2' - } - } -} - -var child11 = { - name: 'parent', - version: '0.0.0', - 'dependencies': { - 'child-2': 'file:../child-2' - } -} - -var child11Lock = { - 'name': 'child-1-1', - 'version': '1.0.0', - 'lockfileVersion': 1, - 'requires': true, - 'dependencies': { - 'child-2': { - 'version': 'file:../child-2' - } - } -} - -var child12 = { - 'name': 'child-1-2', - 'version': '1.0.0', - 'dependencies': { - 'child-1-1': 'file:../child-1-1', - 'child-2': 'file:../child-2' - } -} - -var child12Lock = { - 'name': 'child-1-2', - 'version': '1.0.0', - 'lockfileVersion': 1, - 'requires': true, - 'dependencies': { - 'child-1-1': { - 'version': 'file:../child-1-1', - 'requires': { - 'child-2': 'file:../child-2' - } - }, - 'child-2': { - 'version': 'file:../child-2' - } - } -} - -var child2 = { - 'name': 'child-2', - 'version': '1.0.0', - 'dependencies': {} -} - -var child2Lock = { - 'name': 'child-2', - 'version': '1.0.0', - 'lockfileVersion': 1, - 'requires': true, - 'dependencies': {} -} - -test('setup', function (t) { - mkdirp.sync(pkg) - fs.writeFileSync( - path.join(pkg, 'package.json'), - JSON.stringify(parent, null, 2) - ) - - fs.writeFileSync( - path.join(pkg, 'package-lock.json'), - JSON.stringify(parentLock, null, 2) - ) - - mkdirp.sync(path.join(root, 'children', 'child-1-1')) - fs.writeFileSync( - path.join(root, 'children', 'child-1-1', 'package.json'), - JSON.stringify(child11, null, 2) - ) - fs.writeFileSync( - path.join(root, 'children', 'child-1-1', 'package-lock.json'), - JSON.stringify(child11Lock, null, 2) - ) - - mkdirp.sync(path.join(root, 'children', 'child-1-2')) - fs.writeFileSync( - path.join(root, 'children', 'child-1-2', 'package.json'), - JSON.stringify(child12, null, 2) - ) - fs.writeFileSync( - path.join(root, 'children', 'child-1-2', 'package-lock.json'), - JSON.stringify(child12Lock, null, 2) - ) - - mkdirp.sync(path.join(root, 'children', 'child-2')) - fs.writeFileSync( - path.join(root, 'children', 'child-2', 'package.json'), - JSON.stringify(child2, null, 2) - ) - fs.writeFileSync( - path.join(root, 'children', 'child-2', 'package-lock.json'), - JSON.stringify(child2Lock, null, 2) - ) - - process.chdir(pkg) - t.end() -}) - -test('\'npm install\' should install local packages', function (t) { - common.npm( - [ - 'install', '.' - ], - EXEC_OPTS, - function (err, code) { - t.ifError(err, 'error should not exist') - t.notOk(code, 'npm install exited with code 0') - t.end() - } - ) -}) diff --git a/deps/npm/test/tap/install-from-local.js b/deps/npm/test/tap/install-from-local.js deleted file mode 100644 index 1ab94243ff3cad..00000000000000 --- a/deps/npm/test/tap/install-from-local.js +++ /dev/null @@ -1,89 +0,0 @@ -var fs = require('graceful-fs') -var path = require('path') - -var mkdirp = require('mkdirp') -var test = require('tap').test - -var common = require('../common-tap') - -var root = common.pkg -var pkg = path.join(root, 'package-with-local-paths') - -var EXEC_OPTS = { cwd: pkg } - -var localPaths = { - name: 'package-with-local-paths', - version: '0.0.0', - dependencies: { - 'package-local-dependency': 'file:../package-local-dependency' - }, - devDependencies: { - 'package-local-dev-dependency': 'file:../package-local-dev-dependency' - } -} - -var localDependency = { - name: 'package-local-dependency', - version: '0.0.0', - description: 'Test for local installs' -} - -var localDevDependency = { - name: 'package-local-dev-dependency', - version: '0.0.0', - description: 'Test for local installs' -} - -test('setup', function (t) { - mkdirp.sync(pkg) - fs.writeFileSync( - path.join(pkg, 'package.json'), - JSON.stringify(localPaths, null, 2) - ) - - mkdirp.sync(path.join(root, 'package-local-dependency')) - fs.writeFileSync( - path.join(root, 'package-local-dependency', 'package.json'), - JSON.stringify(localDependency, null, 2) - ) - - mkdirp.sync(path.join(root, 'package-local-dev-dependency')) - fs.writeFileSync( - path.join(root, 'package-local-dev-dependency', 'package.json'), - JSON.stringify(localDevDependency, null, 2) - ) - - process.chdir(pkg) - t.end() -}) - -test('\'npm install\' should install local packages', function (t) { - common.npm( - [ - 'install', '.' - ], - EXEC_OPTS, - function (err, code) { - t.ifError(err, 'error should not exist') - t.notOk(code, 'npm install exited with code 0') - var dependencyPackageJson = path.resolve( - pkg, - 'node_modules/package-local-dependency/package.json' - ) - t.ok( - JSON.parse(fs.readFileSync(dependencyPackageJson, 'utf8')), - 'package with local dependency installed' - ) - - var devDependencyPackageJson = path.resolve( - pkg, 'node_modules/package-local-dev-dependency/package.json' - ) - t.ok( - JSON.parse(fs.readFileSync(devDependencyPackageJson, 'utf8')), - 'package with local dev dependency installed' - ) - - t.end() - } - ) -}) diff --git a/deps/npm/test/tap/install-into-likenamed-folder.js b/deps/npm/test/tap/install-into-likenamed-folder.js deleted file mode 100644 index c7bc86f3baaf48..00000000000000 --- a/deps/npm/test/tap/install-into-likenamed-folder.js +++ /dev/null @@ -1,44 +0,0 @@ -'use strict' -var path = require('path') -var fs = require('graceful-fs') -var mkdirp = require('mkdirp') -var rimraf = require('rimraf') -var test = require('tap').test -var common = require('../common-tap.js') - -var base = common.pkg -var moduleDir = path.join(base, 'example-src') -var destDir = path.join(base, 'example') -var moduleJson = { - name: 'example', - version: '1.0.0' -} - -function setup () { - cleanup() - mkdirp.sync(moduleDir) - mkdirp.sync(path.join(destDir, 'node_modules')) - fs.writeFileSync(path.join(moduleDir, 'package.json'), JSON.stringify(moduleJson)) -} - -function cleanup () { - rimraf.sync(base) -} - -test('setup', function (t) { - setup() - t.end() -}) - -test('like-named', function (t) { - common.npm(['install', '../example-src'], {cwd: destDir}, function (er, code, stdout, stderr) { - t.is(code, 0, 'no error code') - t.is(stderr, '', 'no error output') - t.end() - }) -}) - -test('cleanup', function (t) { - cleanup() - t.end() -}) diff --git a/deps/npm/test/tap/install-lifecycle.js b/deps/npm/test/tap/install-lifecycle.js deleted file mode 100644 index c5b0fd35a020e5..00000000000000 --- a/deps/npm/test/tap/install-lifecycle.js +++ /dev/null @@ -1,35 +0,0 @@ -var fs = require('graceful-fs') -var path = require('path') -var test = require('tap').test -var common = require('../common-tap.js') -var pkg = common.pkg - -test('npm install execution order', function (t) { - const packageJson = { - name: 'life-test', - version: '0.0.1', - description: 'Test for npm install execution order', - scripts: { - install: 'true', - preinstall: 'true', - preshrinkwrap: 'true', - postinstall: 'true', - postshrinkwrap: 'true', - shrinkwrap: 'true' - } - } - fs.writeFileSync(path.resolve(pkg, 'package.json'), JSON.stringify(packageJson), 'utf8') - common.npm(['install', '--loglevel=error'], { cwd: pkg }, function (err, code, stdout, stderr) { - if (err) throw err - - t.comment(stdout) - t.comment(stderr) - - const steps = ['preinstall', 'install', 'postinstall', 'preshrinkwrap', 'shrinkwrap', 'postshrinkwrap'] - const expectedLines = steps.map(function (step) { - return '> ' + packageJson.name + '@' + packageJson.version + ' ' + step - }) - t.match(stdout, new RegExp(expectedLines.map(common.escapeForRe).join('(.|\n)*'))) - t.end() - }) -}) diff --git a/deps/npm/test/tap/install-link-metadeps-locally.js b/deps/npm/test/tap/install-link-metadeps-locally.js deleted file mode 100644 index 136fd46d10bbf0..00000000000000 --- a/deps/npm/test/tap/install-link-metadeps-locally.js +++ /dev/null @@ -1,52 +0,0 @@ -// XXX Remove in npm v7, when this is no longer how we do things -const t = require('tap') -const common = require('../common-tap.js') -const pkg = common.pkg -const mkdirp = require('mkdirp') -const { writeFileSync, statSync } = require('fs') -const { resolve } = require('path') -const mr = require('npm-registry-mock') -const rimraf = require('rimraf') - -t.test('setup', t => { - mkdirp.sync(resolve(pkg, 'node_modules')) - mkdirp.sync(resolve(pkg, 'foo')) - writeFileSync(resolve(pkg, 'foo', 'package.json'), JSON.stringify({ - name: 'foo', - version: '1.2.3', - dependencies: { - underscore: '*' - } - })) - - writeFileSync(resolve(pkg, 'package.json'), JSON.stringify({ - name: 'root', - version: '1.2.3', - dependencies: { - foo: 'file:foo' - } - })) - - mr({ port: common.port }, (er, s) => { - if (er) { - throw er - } - t.parent.teardown(() => s.close()) - t.end() - }) -}) - -t.test('initial install to create package-lock', - t => common.npm(['install', '--registry', common.registry], { cwd: pkg }) - .then(([code]) => t.equal(code, 0, 'command worked'))) - -t.test('remove node_modules', t => - rimraf(resolve(pkg, 'node_modules'), t.end)) - -t.test('install again from package-lock', t => - common.npm(['install', '--registry', common.registry], { cwd: pkg }) - .then(([code]) => { - t.equal(code, 0, 'command worked') - const underscore = resolve(pkg, 'node_modules', 'underscore') - t.equal(statSync(underscore).isDirectory(), true, 'underscore installed') - })) diff --git a/deps/npm/test/tap/install-link-metadeps-subfolders.js b/deps/npm/test/tap/install-link-metadeps-subfolders.js deleted file mode 100644 index 7544c8a4ebe841..00000000000000 --- a/deps/npm/test/tap/install-link-metadeps-subfolders.js +++ /dev/null @@ -1,68 +0,0 @@ -const t = require('tap') -const common = require('../common-tap.js') -const mkdirp = require('mkdirp') -const { writeFileSync, readFileSync } = require('fs') -const { resolve } = require('path') -const pkg = common.pkg -const app = resolve(pkg, 'app') -const lib = resolve(pkg, 'lib') -const moda = resolve(lib, 'module-a') -const modb = resolve(lib, 'module-b') - -const rimraf = require('rimraf') - -t.test('setup', t => { - mkdirp.sync(app) - mkdirp.sync(moda) - mkdirp.sync(modb) - - writeFileSync(resolve(app, 'package.json'), JSON.stringify({ - name: 'app', - version: '1.2.3', - dependencies: { - moda: 'file:../lib/module-a' - } - })) - - writeFileSync(resolve(moda, 'package.json'), JSON.stringify({ - name: 'moda', - version: '1.2.3', - dependencies: { - modb: 'file:../module-b' - } - })) - - writeFileSync(resolve(modb, 'package.json'), JSON.stringify({ - name: 'modb', - version: '1.2.3' - })) - - t.end() -}) - -t.test('initial install to create package-lock', - t => common.npm(['install'], { cwd: app }) - .then(([code]) => t.equal(code, 0, 'command worked'))) - -t.test('remove node_modules', t => - rimraf(resolve(pkg, 'node_modules'), t.end)) - -t.test('install again from package-lock', t => - common.npm(['install'], { cwd: app }) - .then(([code]) => { - t.equal(code, 0, 'command worked') - // verify that module-b is linked under module-a - const depPkg = resolve( - app, - 'node_modules', - 'moda', - 'node_modules', - 'modb', - 'package.json' - ) - const data = JSON.parse(readFileSync(depPkg, 'utf8')) - t.strictSame(data, { - name: 'modb', - version: '1.2.3' - }) - })) diff --git a/deps/npm/test/tap/install-link-scripts.js b/deps/npm/test/tap/install-link-scripts.js deleted file mode 100644 index 52e50c6e9fb0a5..00000000000000 --- a/deps/npm/test/tap/install-link-scripts.js +++ /dev/null @@ -1,121 +0,0 @@ -var fs = require('graceful-fs') -var path = require('path') - -var mkdirp = require('mkdirp') -var rimraf = require('rimraf') -const t = require('tap') - -var common = require('../common-tap.js') -common.skipIfWindows('links are weird on windows') - -var pkg = common.pkg -var tmp = path.join(pkg, 'tmp') -var dep = path.join(pkg, 'dep') - -var json = { - name: 'install-link-scripts', - version: '1.0.0', - description: 'a test', - repository: 'git://github.com/npm/npm.git', - license: 'ISC' -} - -var dependency = { - name: 'dep', - version: '1.0.0', - scripts: { - install: 'node ./bin/foo' - } -} - -var foo = function () { /* -#!/usr/bin/env node - -console.log('hey sup') -*/ }.toString().split('\n').slice(1, -1).join('\n') - -process.env.npm_config_prefix = tmp - -t.beforeEach(cb => { - rimraf(pkg, er => { - if (er) { - return cb(er) - } - mkdirp.sync(tmp) - fs.writeFileSync( - path.join(pkg, 'package.json'), - JSON.stringify(json, null, 2) - ) - - mkdirp.sync(path.join(dep, 'bin')) - fs.writeFileSync( - path.join(dep, 'package.json'), - JSON.stringify(dependency, null, 2) - ) - fs.writeFileSync(path.join(dep, 'bin', 'foo'), foo) - fs.chmod(path.join(dep, 'bin', 'foo'), '0755') - cb() - }) -}) - -t.test('plain install', function (t) { - common.npm( - [ - 'install', dep, - '--tmp', tmp - ], - { cwd: pkg }, - function (err, code, stdout, stderr) { - t.ifErr(err, 'npm install ' + dep + ' finished without error') - t.equal(code, 0, 'exited ok') - t.notOk(stderr, 'no output stderr') - t.match(stdout, /hey sup/, 'postinstall script for dep ran') - t.end() - } - ) -}) - -t.test('link', function (t) { - common.npm( - [ - 'link', - '--tmp', tmp - ], - { cwd: dep }, - function (err, code, stdout, stderr) { - t.ifErr(err, 'npm link finished without error') - t.equal(code, 0, 'exited ok') - t.notOk(stderr, 'no output stderr') - t.match(stdout, /hey sup/, 'script ran') - t.end() - } - ) -}) - -t.test('install --link', function (t) { - common.npm( - [ - 'link', - '--tmp', tmp - ], - { cwd: dep }, - function (err, code, stdout, stderr) { - t.ifErr(err, 'npm link finished without error') - - common.npm( - [ - 'install', '--link', dependency.name, - '--tmp', tmp - ], - { cwd: pkg }, - function (err, code, stdout, stderr) { - t.ifErr(err, 'npm install --link finished without error') - t.equal(code, 0, 'exited ok') - t.notOk(stderr, 'no output stderr') - t.notMatch(stdout, /hey sup/, "script didn't run") - t.end() - } - ) - } - ) -}) diff --git a/deps/npm/test/tap/install-local-dep-cycle.js b/deps/npm/test/tap/install-local-dep-cycle.js deleted file mode 100644 index a66f04bce4715d..00000000000000 --- a/deps/npm/test/tap/install-local-dep-cycle.js +++ /dev/null @@ -1,79 +0,0 @@ -'use strict' -var path = require('path') -var fs = require('graceful-fs') -var mkdirp = require('mkdirp') -var rimraf = require('rimraf') -var test = require('tap').test -var common = require('../common-tap.js') - -var base = common.pkg - -var baseJSON = { - name: 'base', - version: '1.0.0', - dependencies: { - a: 'file:a/', - b: 'file:b/' - } -} - -var aPath = path.join(base, 'a') -var aJSON = { - name: 'a', - version: '1.0.0', - dependencies: { - b: 'file:../b', - c: 'file:../c' - } -} - -var bPath = path.join(base, 'b') -var bJSON = { - name: 'b', - version: '1.0.0' -} - -var cPath = path.join(base, 'c') -var cJSON = { - name: 'c', - version: '1.0.0', - dependencies: { - b: 'file:../b' - } -} - -test('setup', function (t) { - cleanup() - setup() - t.end() -}) - -test('install', function (t) { - common.npm(['install'], {cwd: base}, function (er, code, stdout, stderr) { - t.ifError(er, 'npm config ran without issue') - t.is(code, 0, 'exited with a non-error code') - t.is(stderr, '', 'Ran without errors') - t.end() - }) -}) - -test('cleanup', function (t) { - cleanup() - t.end() -}) - -function saveJson (pkgPath, json) { - mkdirp.sync(pkgPath) - fs.writeFileSync(path.join(pkgPath, 'package.json'), JSON.stringify(json, null, 2)) -} - -function setup () { - saveJson(base, baseJSON) - saveJson(aPath, aJSON) - saveJson(bPath, bJSON) - saveJson(cPath, cJSON) -} - -function cleanup () { - rimraf.sync(base) -} diff --git a/deps/npm/test/tap/install-local-from-local.js b/deps/npm/test/tap/install-local-from-local.js deleted file mode 100644 index ec53c74a39206f..00000000000000 --- a/deps/npm/test/tap/install-local-from-local.js +++ /dev/null @@ -1,94 +0,0 @@ -'use strict' -var path = require('path') -var fs = require('graceful-fs') -var test = require('tap').test -var common = require('../common-tap.js') -var Tacks = require('tacks') -var Dir = Tacks.Dir -var File = Tacks.File - -var testdir = path.join(__dirname, path.basename(__filename, '.js')) -var cwd = path.join(testdir, '3') - -/** - * NOTE: Tarball Fixtures - * They contain package.json files with dependencies like the following: - * 1-1.0.0.tgz: package/package.json - * { - * "name":"1", - * "version":"1.0.0" - * } - * 2-1.0.0.tgz: package/package.json - * { - * "name":"2", - * "version":"1.0.0", - * "dependencies":{ - * "1":"file:../1/1-1.0.0.tgz" - * } - * } - */ -var fixture = new Tacks(Dir({ - '1': Dir({ - '1-1.0.0.tgz': File(Buffer.from( - '1f8b08000000000000032b484cce4e4c4fd52f80d07a59c5f9790c540606' + - '06066626260ad8c4c1c0d85c81c1d8d4ccc0d0d0cccc00a80ec830353103' + - 'd2d4760836505a5c925804740aa5e640bca200a78708a856ca4bcc4d55b2' + - '523254d2512a4b2d2acecccf03f1f40cf40c946ab906da79a360148c8251' + - '300a6804007849dfdf00080000', - 'hex' - )) - }), - '2': Dir({ - '2-1.0.0.tgz': File(Buffer.from( - '1f8b0800000000000003ed8f3d0e83300c8599394594b90d36840cdc2602' + - '17d19f80087468c5ddeb14a9135b91aa4af996e73c3f47f660eb8b6d291b' + - '565567dfbb646700c0682db6fc00ea5c24456900d118e01c17a52e58f75e' + - '648bd94f76e455befd67bd457cf44f78a64248676f242b21737908cf3b8d' + - 'beeb5d70508182d56d6820d790ab3bf2dc0a83ec62489dba2b554a6598e1' + - 'f13da1a6f62139b0a44bfaeb0b23914824b2c50b8b5b623100080000', - 'hex' - )) - }), - '3': Dir({ - 'package.json': File({ - name: '3', - version: '1.0.0', - dependencies: { - '2': '../2/2-1.0.0.tgz' - } - }) - }) -})) - -function setup () { - fixture.create(testdir) -} - -function cleanup () { - fixture.remove(testdir) -} - -test('setup', function (t) { - cleanup() - setup() - t.end() -}) - -test('installing local package with local dependency', function (t) { - common.npm( - ['install'], - {cwd: cwd}, - function (er, code, stdout, stderr) { - t.is(code, 0, 'no error code') - t.is(stderr, '', 'no error output') - t.ok(fs.existsSync(path.join(cwd, 'node_modules', '2')), 'installed direct dep') - t.ok(fs.existsSync(path.join(cwd, 'node_modules', '1')), 'installed indirect dep') - t.end() - } - ) -}) - -test('cleanup', function (t) { - cleanup() - t.end() -}) diff --git a/deps/npm/test/tap/install-man.js b/deps/npm/test/tap/install-man.js deleted file mode 100644 index 8c4b89015151fc..00000000000000 --- a/deps/npm/test/tap/install-man.js +++ /dev/null @@ -1,57 +0,0 @@ -var fs = require('fs') -var resolve = require('path').resolve - -var mkdirp = require('mkdirp') -var test = require('tap').test - -var common = require('../common-tap.js') - -var pkg = resolve(common.pkg, 'package') -var target = resolve(common.pkg, 'target') - -common.pendIfWindows('man pages do not get installed on Windows') - -var EXEC_OPTS = { - cwd: target -} - -var json = { - name: 'install-man', - version: '1.2.3', - man: [ './install-man.1' ] -} - -test('setup', function (t) { - mkdirp.sync(pkg) - // make sure it installs locally - mkdirp.sync(resolve(target, 'node_modules')) - fs.writeFileSync( - resolve(pkg, 'package.json'), - JSON.stringify(json, null, 2) + '\n' - ) - fs.writeFileSync(resolve(pkg, 'install-man.1'), 'THIS IS A MANPAGE\n') - t.end() -}) - -test('install man page', function (t) { - common.npm( - [ - 'install', - '--prefix', target, - '--global', - pkg - ], - EXEC_OPTS, - function (err, code, stdout, stderr) { - t.ifError(err, 'npm command ran from test') - t.equals(code, 0, 'install exited with success (0)') - t.ok(stdout, 'output indicating success') - t.ok( - fs.existsSync(resolve(target, 'share', 'man', 'man1', 'install-man.1')), - 'man page link was created' - ) - - t.end() - } - ) -}) diff --git a/deps/npm/test/tap/install-mention-funding.js b/deps/npm/test/tap/install-mention-funding.js deleted file mode 100644 index 3e9b81f24070b6..00000000000000 --- a/deps/npm/test/tap/install-mention-funding.js +++ /dev/null @@ -1,127 +0,0 @@ -'use strict' -const path = require('path') -const test = require('tap').test -const Tacks = require('tacks') -const Dir = Tacks.Dir -const File = Tacks.File -const common = require('../common-tap.js') - -const base = common.pkg -const singlePackage = path.join(base, 'single-funding-package') -const multiplePackages = path.join(base, 'top-level-funding') - -function getFixturePackage ({ name, version, dependencies, funding }) { - return Dir({ - 'package.json': File({ - name, - version: version || '1.0.0', - funding: funding || { - type: 'individual', - url: 'http://example.com/donate' - }, - dependencies: dependencies || {} - }) - }) -} - -const fixture = new Tacks(Dir({ - 'package.json': File({}), - 'single-funding-package': getFixturePackage({ - name: 'single-funding-package' - }), - 'top-level-funding': getFixturePackage({ - name: 'top-level-funding', - dependencies: { - 'dep-foo': 'file:../dep-foo', - 'dep-bar': 'file:../dep-bar' - } - }), - 'dep-foo': getFixturePackage({ - name: 'dep-foo', - funding: { - type: 'corporate', - url: 'https://corp.example.com/sponsor' - }, - dependencies: { - 'sub-dep-bar': 'file:../sub-dep-bar' - } - }), - 'dep-bar': getFixturePackage({ - name: 'dep-bar', - version: '2.1.0', - dependencies: { - 'sub-dep-bar': 'file:../sub-dep-bar' - } - }), - 'sub-dep-bar': getFixturePackage({ - name: 'sub-dep-bar', - funding: { - type: 'foo', - url: 'http://example.com/foo' - } - }) -})) - -test('mention npm fund upon installing single dependency', function (t) { - setup(t) - common.npm(['install', '--no-save', singlePackage], {cwd: base}, function (err, code, stdout, stderr) { - if (err) throw err - t.is(code, 0, 'installed successfully') - t.is(stderr, '', 'no warnings') - t.includes(stdout, '1 package is looking for funding', 'should print amount of packages needing funding') - t.includes(stdout, ' run `npm fund` for details', 'should print npm fund mention') - t.end() - }) -}) - -test('mention npm fund upon installing multiple dependencies', function (t) { - setup(t) - common.npm(['install', '--no-save', multiplePackages], {cwd: base}, function (err, code, stdout, stderr) { - if (err) throw err - t.is(code, 0, 'installed successfully') - t.is(stderr, '', 'no warnings') - t.includes(stdout, '4 packages are looking for funding', 'should print amount of packages needing funding') - t.includes(stdout, ' run `npm fund` for details', 'should print npm fund mention') - t.end() - }) -}) - -test('skips mention npm fund using --no-fund option', function (t) { - setup(t) - common.npm(['install', '--no-save', '--no-fund', multiplePackages], {cwd: base}, function (err, code, stdout, stderr) { - if (err) throw err - t.is(code, 0, 'installed successfully') - t.is(stderr, '', 'no warnings') - t.doesNotHave(stdout, '4 packages are looking for funding', 'should print amount of packages needing funding') - t.doesNotHave(stdout, ' run `npm fund` for details', 'should print npm fund mention') - t.end() - }) -}) - -test('mention packages looking for funding using --json', function (t) { - setup(t) - common.npm(['install', '--no-save', '--json', multiplePackages], {cwd: base}, function (err, code, stdout, stderr) { - if (err) throw err - t.is(code, 0, 'installed successfully') - t.is(stderr, '', 'no warnings') - const res = JSON.parse(stdout) - t.match(res.funding, '4 packages are looking for funding', 'should print amount of packages needing funding') - t.end() - }) -}) - -test('cleanup', function (t) { - cleanup() - t.end() -}) - -function setup (t) { - fixture.create(base) - t.teardown(() => { - cleanup() - }) -} - -function cleanup () { - fixture.remove(base) -} diff --git a/deps/npm/test/tap/install-noargs-dev.js b/deps/npm/test/tap/install-noargs-dev.js deleted file mode 100644 index 53422b9b5bc234..00000000000000 --- a/deps/npm/test/tap/install-noargs-dev.js +++ /dev/null @@ -1,90 +0,0 @@ -var fs = require('fs') -var path = require('path') - -var mkdirp = require('mkdirp') -var mr = require('npm-registry-mock') -var test = require('tap').test - -var common = require('../common-tap.js') - -var pkg = common.pkg - -var EXEC_OPTS = { cwd: pkg } - -var PACKAGE_JSON1 = { - name: 'install-noargs-dev', - version: '0.0.1', - devDependencies: { - 'underscore': '1.3.1' - } -} - -var PACKAGE_JSON2 = { - name: 'install-noargs-dev', - version: '0.0.2', - devDependencies: { - 'underscore': '1.5.1' - } -} - -test('setup', function (t) { - mkdirp.sync(path.resolve(pkg, 'node_modules')) - fs.writeFileSync( - path.join(pkg, 'package.json'), - JSON.stringify(PACKAGE_JSON1, null, 2) - ) - mr({ port: common.port }, function (er, s) { - t.ifError(er, 'started mock registry') - t.parent.teardown(() => s.close()) - t.end() - }) -}) - -test('install noargs installs devDependencies', function (t) { - common.npm( - [ - '--registry', common.registry, - '--loglevel', 'silent', - '--no-save', - 'install' - ], - EXEC_OPTS, - function (err, code) { - t.ifError(err, 'npm install ran without issue') - t.notOk(code, 'npm install exited with code 0') - - var p = path.join(pkg, 'node_modules', 'underscore', 'package.json') - var pkgJson = JSON.parse(fs.readFileSync(p)) - - t.equal(pkgJson.version, '1.3.1') - t.end() - } - ) -}) - -test('install noargs installs updated devDependencies', function (t) { - fs.writeFileSync( - path.join(pkg, 'package.json'), - JSON.stringify(PACKAGE_JSON2, null, 2) - ) - - common.npm( - [ - '--registry', common.registry, - '--loglevel', 'silent', - '--no-save', - 'install' - ], - EXEC_OPTS, - function (err, code) { - t.ifError(err, 'npm install ran without issue') - t.notOk(code, 'npm install exited with code 0') - - var p = path.join(pkg, 'node_modules', 'underscore', 'package.json') - var pkgJson = JSON.parse(fs.readFileSync(p)) - - t.equal(pkgJson.version, '1.5.1') - t.end() - } - ) -}) diff --git a/deps/npm/test/tap/install-order.js b/deps/npm/test/tap/install-order.js deleted file mode 100644 index c4a2b1c383eecc..00000000000000 --- a/deps/npm/test/tap/install-order.js +++ /dev/null @@ -1,65 +0,0 @@ -'use strict' -/* eslint-disable no-use-before-define */ -var test = require('tap').test -var sortActions = require('../../lib/install/diff-trees.js').sortActions -var top = { - location: '/', - package: {}, - requiredBy: [], - requires: [a, b], - isTop: true -} -var a = { - location: '/a', - package: {}, - requiredBy: [], - requires: [c], - isTop: false, - userRequired: false, - existing: false, - parent: top -} -var b = { - location: '/b', - package: {}, - requiredBy: [], - requires: [c], - isTop: false, - userRequired: false, - existing: false, - parent: top -} -var c = { - location: '/c', - package: {}, - requiredBy: [a, b], - requires: [], - isTop: false, - userRequired: false, - existing: false, - parent: top -} - -test('install-order when installing deps', function (t) { - var plain = [ - ['add', a], - ['add', b], - ['add', c]] - var sorted = [ - ['add', c], - ['add', a], - ['add', b]] - t.isDeeply(sortActions(plain), sorted) - t.end() -}) - -test('install-order when not installing deps', function (t) { - var plain = [ - ['add', a], - ['add', b]] - var sorted = [ - ['add', a], - ['add', b]] - t.isDeeply(sortActions(plain), sorted) - t.end() -}) diff --git a/deps/npm/test/tap/install-package-json-order.js b/deps/npm/test/tap/install-package-json-order.js deleted file mode 100644 index 45ce882620c7b4..00000000000000 --- a/deps/npm/test/tap/install-package-json-order.js +++ /dev/null @@ -1,42 +0,0 @@ -var test = require('tap').test -var path = require('path') -var mkdirp = require('mkdirp') -var spawn = require('child_process').spawn -var npm = require.resolve('../../bin/npm-cli.js') -var node = process.execPath -const common = require('../common-tap.js') -var pkg = common.pkg -var workdir = path.join(pkg, 'workdir') -var tmp = path.join(pkg, 'tmp') -var fs = require('fs') - -test('package.json sorting after install', function (t) { - var packageJson = path.resolve(pkg, 'package.json') - var installedPackage = path.resolve(workdir, - 'node_modules/install-package-json-order/package.json') - - mkdirp.sync(tmp) - mkdirp.sync(workdir) - - fs.writeFileSync(path.resolve(pkg, 'package.json'), JSON.stringify({ - 'name': 'install-package-json-order', - 'version': '0.0.0', - 'array': [ 'one', 'two', 'three' ] - }, null, 2), 'utf8') - - fs.writeFileSync(path.resolve(workdir, 'package.json'), JSON.stringify({ - 'name': 'install-package-json-order-work', - 'version': '0.0.0' - }, null, 2), 'utf8') - - var before = JSON.parse(fs.readFileSync(packageJson).toString()) - var child = spawn(node, [npm, 'install', pkg], { cwd: workdir }) - - child.on('close', function (code) { - t.equal(code, 0, 'npm install exited with code') - var result = fs.readFileSync(installedPackage, 'utf8') - var resultAsJson = JSON.parse(result) - t.same(resultAsJson.array, before.array) - t.end() - }) -}) diff --git a/deps/npm/test/tap/install-package-lock-only.js b/deps/npm/test/tap/install-package-lock-only.js deleted file mode 100644 index 2c5191a02e7d73..00000000000000 --- a/deps/npm/test/tap/install-package-lock-only.js +++ /dev/null @@ -1,123 +0,0 @@ -'use strict' -var fs = require('fs') -var path = require('path') -var test = require('tap').test -var mr = require('npm-registry-mock') -var Tacks = require('tacks') -var File = Tacks.File -var Dir = Tacks.Dir -var common = require('../common-tap.js') - -var basedir = common.pkg -var testdir = path.join(basedir, 'testdir') -var cachedir = common.cache -var globaldir = path.join(basedir, 'global') -var tmpdir = path.join(basedir, 'tmp') - -var pkgLockPath = path.join(testdir, 'package-lock.json') -var nodeModulesPath = path.join(testdir, 'node_modules') - -var conf = { - cwd: testdir, - env: Object.assign({}, process.env, { - npm_config_cache: cachedir, - npm_config_tmp: tmpdir, - npm_config_prefix: globaldir, - npm_config_registry: common.registry, - npm_config_loglevel: 'warn' - }) -} - -const confPkgLockFalse = { - cwd: testdir, - env: Object.assign({}, process.env, { - npm_config_cache: cachedir, - npm_config_tmp: tmpdir, - npm_config_prefix: globaldir, - npm_config_registry: common.registry, - npm_config_loglevel: 'warn', - npm_config_package_lock: false - }) -} - -var server -var fixture = new Tacks(Dir({ - cache: Dir(), - global: Dir(), - tmp: Dir(), - testdir: Dir({ - 'package.json': File({ - name: 'install-package-lock-only', - version: '1.0.0', - dependencies: { - mkdirp: '^0.3.4' - } - }) - }) -})) - -function setup () { - cleanup() - fixture.create(basedir) -} - -function cleanup () { - fixture.remove(basedir) -} - -test('setup', function (t) { - mr({port: common.port, throwOnUnmatched: true}, function (err, s) { - if (err) throw err - server = s - t.done() - }) -}) - -test('package-lock-only', function (t) { - setup() - return common.npm(['install', '--package-lock-only'], conf).spread((code, stdout, stderr) => { - t.is(code, 0, 'command ran ok') - t.comment(stdout.trim()) - t.comment(stderr.trim()) - // Verify that node_modules does not exist - t.notOk(fs.existsSync(nodeModulesPath), 'ensure that node_modules does not exist') - - // Verify that package-lock.json exists and has `mkdirp@0.3.5` in it. - t.ok(fs.existsSync(pkgLockPath), 'ensure that package-lock.json was created') - var pkgLock = JSON.parse(fs.readFileSync(pkgLockPath, 'utf-8')) - t.equal(pkgLock.dependencies.mkdirp.version, '0.3.5') - t.done() - }) -}) - -test('--package-lock-only with --package-lock negates `package_lock: false`', function (t) { - setup() - return common.npm(['install', '--package-lock', '--package-lock-only'], confPkgLockFalse).spread((code, stdout, stderr) => { - t.is(code, 0, 'ok') - t.comment(stdout.trim()) - t.comment(stderr.trim()) - - // Verify that package-lock.json exists. - t.ok(fs.existsSync(pkgLockPath), 'ensure that package-lock.json was created') - t.end() - }) -}) - -test('package-lock-only creates package_lock.json when config has `package_lock: false`', function (t) { - setup() - return common.npm(['install', '--package-lock-only'], confPkgLockFalse).spread((code, stdout, stderr) => { - t.is(code, 0, 'ok') - t.comment(stdout.trim()) - t.comment(stderr.trim()) - - // Verify that package-lock.json exists. - t.ok(fs.existsSync(pkgLockPath), 'ensure that package-lock.json was created') - t.end() - }) -}) - -test('cleanup', function (t) { - server.close() - cleanup() - t.done() -}) diff --git a/deps/npm/test/tap/install-parse-error.js b/deps/npm/test/tap/install-parse-error.js deleted file mode 100644 index 1a72c336de0714..00000000000000 --- a/deps/npm/test/tap/install-parse-error.js +++ /dev/null @@ -1,50 +0,0 @@ -'use strict' -var test = require('tap').test -var Tacks = require('tacks') -var File = Tacks.File -var Dir = Tacks.Dir -var common = require('../common-tap.js') - -var testdir = common.pkg - -var fixture = new Tacks(Dir({ - 'package.json': File( - '{\n' + - "'name': 'some-name',\n" + - "'dependencies': {}\n" + - '}' - ), - 'node_modules': Dir() -})) - -function setup () { - fixture.create(testdir) -} - -function cleanup () { - fixture.remove(testdir) -} - -test('setup', function (t) { - cleanup() - setup() - t.end() -}) - -test('failing to parse package.json should be error', function (t) { - common.npm( - ['install'], - {cwd: testdir}, - function (err, code, stdout, stderr) { - if (err) throw err - t.equal(code, 1, 'exit not ok') - t.similar(stderr, /npm ERR! JSON.parse Failed to parse json/) - t.end() - } - ) -}) - -test('cleanup', function (t) { - cleanup() - t.end() -}) diff --git a/deps/npm/test/tap/install-property-conflicts.js b/deps/npm/test/tap/install-property-conflicts.js deleted file mode 100644 index a98f8570c62bdc..00000000000000 --- a/deps/npm/test/tap/install-property-conflicts.js +++ /dev/null @@ -1,53 +0,0 @@ -var fs = require('fs') -var resolve = require('path').resolve - -var mkdirp = require('mkdirp') -var test = require('tap').test - -var common = require('../common-tap.js') - -var pkg = common.pkg -var target = resolve(pkg, '_target') - -var EXEC_OPTS = { - cwd: target -} - -var json = { - name: 'install-property-conflicts', - version: '1.2.3', - type: 'nose-boop!' -} - -test('setup', function (t) { - // make sure it installs locally - mkdirp.sync(resolve(target, 'node_modules')) - fs.writeFileSync( - resolve(pkg, 'package.json'), - JSON.stringify(json, null, 2) + '\n' - ) - t.end() -}) - -test('install package with a `type` property', function (t) { - t.comment('issue: https://github.com/npm/npm/issues/11398') - common.npm( - [ - 'install', - '--prefix', target, - pkg - ], - EXEC_OPTS, - function (err, code, stdout, stderr) { - t.ifError(err, 'npm command ran from test') - t.equals(code, 0, 'install exited with success (0)') - var installedPkg = resolve( - target, - 'node_modules', - 'install-property-conflicts', - 'package.json') - t.ok(fs.statSync(installedPkg), 'package installed successfully') - t.end() - } - ) -}) diff --git a/deps/npm/test/tap/install-report-just-installed.js b/deps/npm/test/tap/install-report-just-installed.js deleted file mode 100644 index 23b373b2694050..00000000000000 --- a/deps/npm/test/tap/install-report-just-installed.js +++ /dev/null @@ -1,74 +0,0 @@ -'use strict' -var test = require('tap').test -var Tacks = require('tacks') -var Dir = Tacks.Dir -var File = Tacks.File -var common = require('../common-tap.js') - -var testdir = common.pkg -var fixture = new Tacks(Dir({ - node_modules: Dir({ - a: Dir({ - 'package.json': File({ - name: 'a', - version: '1.0.0', - dependencies: { - b: '1.0.0' - } - }), - node_modules: Dir({ - b: Dir({ - 'package.json': File({ - name: 'b', - version: '1.0.0' - }) - }) - }) - }) - }), - 'b-src': Dir({ - 'package.json': File({ - name: 'b', - version: '1.0.0' - }) - }) -})) - -function setup () { - cleanup() - fixture.create(testdir) -} - -function cleanup () { - fixture.remove(testdir) -} - -test('setup', function (t) { - setup() - t.end() -}) - -test('install-report', function (t) { - common.npm(['install', '--no-save', '--json', './b-src'], {cwd: testdir}, function (err, code, stdout, stderr) { - if (err) throw err - t.is(code, 0, 'installed successfully') - t.is(stderr, '', 'no warnings') - try { - var report = JSON.parse(stdout) - t.pass('stdout was json') - } catch (ex) { - t.fail('stdout was json') - console.error(ex) - t.skip(2) - return t.end() - } - t.is(report.added.length, 1, 'one dependency reported as installed') - t.match(report.added, [{name: 'b'}], 'that dependency was `b`') - t.end() - }) -}) - -test('cleanup', function (t) { - cleanup() - t.end() -}) diff --git a/deps/npm/test/tap/install-save-consistent-newlines.js b/deps/npm/test/tap/install-save-consistent-newlines.js deleted file mode 100644 index dfe41c649d2afa..00000000000000 --- a/deps/npm/test/tap/install-save-consistent-newlines.js +++ /dev/null @@ -1,98 +0,0 @@ -'use strict' - -const fs = require('graceful-fs') -const path = require('path') - -const mkdirp = require('mkdirp') -const mr = require('npm-registry-mock') -const rimraf = require('rimraf') -const test = require('tap').test - -const common = require('../common-tap.js') - -const pkg = common.pkg - -const EXEC_OPTS = { cwd: pkg } - -const json = { - name: 'install-save-consistent-newlines', - version: '0.0.1', - description: 'fixture' -} - -test('mock registry', function (t) { - mr({ port: common.port }, function (er, s) { - t.parent.teardown(() => s.close()) - t.end() - }) -}) - -const runTest = (t, opts) => { - t.test('setup', setup(opts.ending)) - t.test('check', check(opts)) - t.end() -} - -const setup = lineEnding => t => { - rimraf(pkg, er => { - if (er) { - throw er - } - mkdirp.sync(path.resolve(pkg, 'node_modules')) - - var jsonStr = JSON.stringify(json, null, 2) - - if (lineEnding === '\r\n') { - jsonStr = jsonStr.replace(/\n/g, '\r\n') - } - - fs.writeFileSync( - path.join(pkg, 'package.json'), - jsonStr - ) - - t.end() - }) -} - -const check = opts => t => common.npm( - [ - '--loglevel', 'silent', - '--registry', common.registry, - '--save', - 'install', 'underscore@1.3.1' - ], - EXEC_OPTS -).then(([code, err, out]) => { - t.notOk(code, 'npm install exited without raising an error code') - - const pkgPath = path.resolve(pkg, 'package.json') - const pkgStr = fs.readFileSync(pkgPath, 'utf8') - - t.match(pkgStr, opts.match) - t.notMatch(pkgStr, opts.notMatch) - - const pkgLockPath = path.resolve(pkg, 'package-lock.json') - const pkgLockStr = fs.readFileSync(pkgLockPath, 'utf8') - - t.match(pkgLockStr, opts.match) - t.notMatch(pkgLockStr, opts.notMatch) - - t.end() -}) - -test('keep LF line endings', t => { - runTest(t, { - ending: '\n', - match: '\n', - notMatch: '\r' - }) -}) - -test('keep CRLF line endings', t => { - runTest(t, { - ending: '\r\n', - match: '\r\n', - notMatch: /[^\r]\n/ - }) -}) diff --git a/deps/npm/test/tap/install-save-exact.js b/deps/npm/test/tap/install-save-exact.js deleted file mode 100644 index efa1e636138a17..00000000000000 --- a/deps/npm/test/tap/install-save-exact.js +++ /dev/null @@ -1,82 +0,0 @@ -var fs = require('graceful-fs') -var path = require('path') - -var mkdirp = require('mkdirp') -var mr = require('npm-registry-mock') -var rimraf = require('rimraf') -var test = require('tap').test - -var common = require('../common-tap.js') - -var pkg = common.pkg - -var EXEC_OPTS = { cwd: pkg } - -var json = { - name: 'install-save-exact', - version: '0.0.1', - description: 'fixture' -} - -test('mock registry', function (t) { - mr({ port: common.port }, function (er, s) { - t.parent.teardown(() => s.close()) - t.end() - }) -}) - -const setup = t => { - t.test('destroy', t => rimraf(pkg, t.end)) - t.test('create', t => { - mkdirp.sync(path.resolve(pkg, 'node_modules')) - fs.writeFileSync( - path.join(pkg, 'package.json'), - JSON.stringify(json, null, 2) - ) - t.end() - }) - t.end() -} - -const check = (savearg, deptype) => t => { - common.npm( - [ - '--loglevel', 'silent', - '--registry', common.registry, - savearg, - '--save-exact', - 'install', 'underscore@1.3.1' - ], - EXEC_OPTS, - function (err, code) { - t.ifError(err, 'npm ran without issue') - t.notOk(code, 'npm install exited without raising an error code') - - var p = path.resolve(pkg, 'node_modules/underscore/package.json') - t.ok(JSON.parse(fs.readFileSync(p))) - - p = path.resolve(pkg, 'package.json') - var pkgJson = JSON.parse(fs.readFileSync(p, 'utf8')) - - t.same( - pkgJson[deptype], - { 'underscore': '1.3.1' }, - 'underscore dependency should specify exactly 1.3.1' - ) - - t.end() - } - ) -} - -test('\'npm install --save --save-exact\' should install local pkg', function (t) { - t.test('setup', setup) - t.test('check', check('--save', 'dependencies')) - t.end() -}) - -test('\'npm install --save-dev --save-exact\' should install local pkg', function (t) { - t.test('setup', setup) - t.test('check', check('--save-dev', 'devDependencies')) - t.end() -}) diff --git a/deps/npm/test/tap/install-save-local.js b/deps/npm/test/tap/install-save-local.js deleted file mode 100644 index 8b6597952813da..00000000000000 --- a/deps/npm/test/tap/install-save-local.js +++ /dev/null @@ -1,181 +0,0 @@ -var fs = require('graceful-fs') -var path = require('path') - -var mkdirp = require('mkdirp') -var rimraf = require('rimraf') -var test = require('tap').test - -var common = require('../common-tap.js') - -var root = common.pkg -var pkg = path.join(root, 'package') - -var EXEC_OPTS = { cwd: pkg } - -var json = { - name: 'install-save-local', - version: '0.0.0' -} - -var localDependency = { - name: 'package-local-dependency', - version: '0.0.0' -} - -var localDevDependency = { - name: 'package-local-dev-dependency', - version: '0.0.0' -} - -test('setup deps in root', t => { - mkdirp.sync(path.join(root, 'package-local-dependency')) - fs.writeFileSync( - path.join(root, 'package-local-dependency', 'package.json'), - JSON.stringify(localDependency, null, 2) - ) - - mkdirp.sync(path.join(root, 'package-local-dev-dependency')) - fs.writeFileSync( - path.join(root, 'package-local-dev-dependency', 'package.json'), - JSON.stringify(localDevDependency, null, 2) - ) - - t.end() -}) - -test('\'npm install --save ../local/path\' should save to package.json', function (t) { - t.plan(2) - t.test('setup', setup) - t.test('run test', t => common.npm( - [ - '--loglevel', 'silent', - '--save', - 'install', '../package-local-dependency' - ], - EXEC_OPTS - ).then(([code]) => { - t.equal(code, 0, 'npm install exited with code 0') - - var dependencyPackageJson = path.join( - pkg, 'node_modules', 'package-local-dependency', 'package.json' - ) - t.ok(JSON.parse(fs.readFileSync(dependencyPackageJson, 'utf8'))) - - var pkgJson = JSON.parse(fs.readFileSync(pkg + '/package.json', 'utf8')) - t.is(Object.keys(pkgJson.dependencies).length, 1, 'only one dep') - t.ok( - /file:.*?[/]package-local-dependency$/.test(pkgJson.dependencies['package-local-dependency']), - 'local package saved correctly' - ) - })) -}) - -test('\'npm install --save local/path\' should save to package.json', function (t) { - t.plan(2) - t.test('setup', setup) - t.test('run test', t => common.npm( - [ - '--loglevel', 'silent', - '--save', - 'install', 'package-local-dependency/' - ], - EXEC_OPTS - ).then(([code, out, err]) => { - t.equal(code, 0, 'npm install exited with code 0') - - var dependencyPackageJson = path.join( - pkg, 'node_modules', 'package-local-dependency', 'package.json' - ) - t.ok(JSON.parse(fs.readFileSync(dependencyPackageJson, 'utf8'))) - - var pkgJson = JSON.parse(fs.readFileSync(pkg + '/package.json', 'utf8')) - t.is(Object.keys(pkgJson.dependencies).length, 1, 'only one dep') - t.ok( - /file:package-local-dependency$/.test(pkgJson.dependencies['package-local-dependency']), - 'local package saved correctly' - ) - })) -}) - -test('\'npm install --save-dev ../local/path\' should save to package.json', function (t) { - t.plan(2) - t.test('setup', setup) - t.test('run test', t => common.npm( - [ - '--loglevel', 'silent', - '--save-dev', - 'install', '../package-local-dev-dependency' - ], - EXEC_OPTS - ).then(([code]) => { - t.equal(code, 0, 'npm install exited with code 0') - - var dependencyPackageJson = path.resolve( - pkg, 'node_modules', 'package-local-dev-dependency', 'package.json' - ) - t.ok(JSON.parse(fs.readFileSync(dependencyPackageJson, 'utf8'))) - - var pkgJson = JSON.parse(fs.readFileSync(pkg + '/package.json', 'utf8')) - t.is(Object.keys(pkgJson.devDependencies).length, 1, 'only one dep') - t.ok( - /file:.*?[/\\]package-local-dev-dependency$/.test(pkgJson.devDependencies['package-local-dev-dependency']), - 'local package saved correctly' - ) - - t.end() - })) -}) - -test('\'npm install --save-dev local/path\' should save to package.json', function (t) { - t.plan(2) - t.test('setup', setup) - t.test('run test', t => common.npm( - [ - '--loglevel', 'silent', - '--save-dev', - 'install', 'package-local-dev-dependency/' - ], - EXEC_OPTS - ).then(([code]) => { - t.equal(code, 0, 'npm install exited with code 0') - - var dependencyPackageJson = path.resolve( - pkg, 'node_modules', 'package-local-dev-dependency', 'package.json' - ) - t.ok(JSON.parse(fs.readFileSync(dependencyPackageJson, 'utf8'))) - - var pkgJson = JSON.parse(fs.readFileSync(pkg + '/package.json', 'utf8')) - t.is(Object.keys(pkgJson.devDependencies).length, 1, 'only one dep') - t.ok( - /file:package-local-dev-dependency$/.test(pkgJson.devDependencies['package-local-dev-dependency']), - 'local package saved correctly' - ) - - t.end() - })) -}) - -function setup (t) { - t.test('destroy', t => rimraf(pkg, t.end)) - t.test('create', t => { - mkdirp.sync(pkg) - fs.writeFileSync( - path.join(pkg, 'package.json'), - JSON.stringify(json, null, 2) - ) - - mkdirp.sync(path.join(pkg, 'package-local-dependency')) - fs.writeFileSync( - path.join(pkg, 'package-local-dependency', 'package.json'), - JSON.stringify(localDependency, null, 2) - ) - - mkdirp.sync(path.join(pkg, 'package-local-dev-dependency')) - fs.writeFileSync( - path.join(pkg, 'package-local-dev-dependency', 'package.json'), - JSON.stringify(localDevDependency, null, 2) - ) - t.end() - }) - t.end() -} diff --git a/deps/npm/test/tap/install-save-prefix.js b/deps/npm/test/tap/install-save-prefix.js deleted file mode 100644 index d61608e1cfd21d..00000000000000 --- a/deps/npm/test/tap/install-save-prefix.js +++ /dev/null @@ -1,164 +0,0 @@ -var fs = require('fs') -var path = require('path') - -var mr = require('npm-registry-mock') -var rimraf = require('rimraf') -var test = require('tap').test - -var common = require('../common-tap.js') - -var pkg = common.pkg - -var EXEC_OPTS = { cwd: pkg } - -var json = { - name: 'install-save-prefix', - version: '0.0.1' -} - -test('start mock reg', function (t) { - mr({ port: common.port }, function (er, s) { - t.ifError(er, 'started mock registry') - t.parent.teardown(() => s.close()) - t.end() - }) -}) - -test('install --save with \'^\' save prefix should accept minor updates', function (t) { - t.plan(2) - t.test('setup', setup) - t.test('run test', t => common.npm( - [ - '--registry', common.registry, - '--loglevel', 'silent', - '--save-prefix', '^', - '--save', - 'install', 'underscore@latest' - ], - EXEC_OPTS - ).then(([code]) => { - console.error('back from install!', code) - t.equal(code, 0, 'npm install exited with code 0') - - var p = path.join(pkg, 'node_modules', 'underscore', 'package.json') - t.ok(JSON.parse(fs.readFileSync(p))) - - var pkgJson = JSON.parse(fs.readFileSync( - path.join(pkg, 'package.json'), - 'utf8' - )) - t.deepEqual( - pkgJson.dependencies, - { 'underscore': '^1.5.1' }, - 'got expected save prefix and version of 1.5.1' - ) - })) -}) - -test('install --save-dev with \'^\' save prefix should accept minor dev updates', function (t) { - t.plan(2) - t.test('setup', setup) - t.test('run test', t => common.npm( - [ - '--registry', common.registry, - '--loglevel', 'silent', - '--save-prefix', '^', - '--save-dev', - 'install', 'underscore@1.3.1' - ], - EXEC_OPTS - ).then(([code]) => { - t.equal(code, 0, 'npm install exited with code 0') - - var p = path.join(pkg, 'node_modules', 'underscore', 'package.json') - t.ok(JSON.parse(fs.readFileSync(p))) - - var pkgJson = JSON.parse(fs.readFileSync( - path.join(pkg, 'package.json'), - 'utf8' - )) - t.deepEqual( - pkgJson.devDependencies, - { 'underscore': '^1.3.1' }, - 'got expected save prefix and version of 1.3.1' - ) - t.end() - })) -}) - -test('install --save with \'~\' save prefix should accept patch updates', function (t) { - t.plan(2) - t.test('setup', setup) - t.test('run test', t => common.npm( - [ - '--registry', common.registry, - '--loglevel', 'silent', - '--save-prefix', '~', - '--save', - 'install', 'underscore@1.3.1' - ], - EXEC_OPTS - ).then(([code]) => { - t.equal(code, 0, 'npm install exited with code 0') - - var p = path.join(pkg, 'node_modules', 'underscore', 'package.json') - t.ok(JSON.parse(fs.readFileSync(p))) - - var pkgJson = JSON.parse(fs.readFileSync( - path.join(pkg, 'package.json'), - 'utf8' - )) - t.deepEqual( - pkgJson.dependencies, - { 'underscore': '~1.3.1' }, - 'got expected save prefix and version of 1.3.1' - ) - })) -}) - -test('install --save-dev with \'~\' save prefix should accept patch updates', function (t) { - t.plan(2) - t.test('setup', setup) - t.test('run test', t => common.npm( - [ - '--registry', common.registry, - '--loglevel', 'silent', - '--save-prefix', '~', - '--save-dev', - 'install', 'underscore@1.3.1' - ], - EXEC_OPTS - ).then(([code]) => { - t.notOk(code, 'npm install exited with code 0') - - var p = path.join(pkg, 'node_modules', 'underscore', 'package.json') - t.ok(JSON.parse(fs.readFileSync(p))) - - var pkgJson = JSON.parse(fs.readFileSync( - path.join(pkg, 'package.json'), - 'utf8' - )) - t.deepEqual( - pkgJson.devDependencies, - { 'underscore': '~1.3.1' }, - 'got expected save prefix and version of 1.3.1' - ) - })) -}) - -function setup (t) { - t.test('destroy', t => { - t.plan(2) - rimraf(path.resolve(pkg, 'node_modules'), () => t.pass('node_modules')) - rimraf(path.resolve(pkg, 'pacakage-lock.json'), () => t.pass('lock file')) - }) - t.test('create', t => { - fs.writeFileSync( - path.join(pkg, 'package.json'), - JSON.stringify(json, null, 2) - ) - t.end() - }) - - t.end() -} diff --git a/deps/npm/test/tap/install-scoped-already-installed.js b/deps/npm/test/tap/install-scoped-already-installed.js deleted file mode 100644 index d4655f4a9a7483..00000000000000 --- a/deps/npm/test/tap/install-scoped-already-installed.js +++ /dev/null @@ -1,129 +0,0 @@ -var fs = require('graceful-fs') -var path = require('path') -var existsSync = fs.existsSync || path.existsSync - -var mkdirp = require('mkdirp') -var test = require('tap').test - -var common = require('../common-tap') - -var root = common.pkg -var pkg = path.join(root, 'package-with-scoped-paths') -var modules = path.join(pkg, 'node_modules') - -var EXEC_OPTS = { cwd: pkg } - -var scopedPaths = { - name: 'package-with-scoped-paths', - version: '0.0.0', - dependencies: { - 'package-local-dependency': 'file:../package-local-dependency', - '@scoped/package-scoped-dependency': 'file:../package-scoped-dependency' - } -} - -var localDependency = { - name: 'package-local-dependency', - version: '0.0.0', - description: 'Test for local installs' -} - -var scopedDependency = { - name: '@scoped/package-scoped-dependency', - version: '0.0.0', - description: 'Test for local installs' -} - -test('setup', function (t) { - mkdirp.sync(pkg) - fs.writeFileSync( - path.join(pkg, 'package.json'), - JSON.stringify(scopedPaths, null, 2) - ) - - mkdirp.sync(path.join(root, 'package-local-dependency')) - fs.writeFileSync( - path.join(root, 'package-local-dependency', 'package.json'), - JSON.stringify(localDependency, null, 2) - ) - - mkdirp.sync(path.join(root, 'package-scoped-dependency')) - fs.writeFileSync( - path.join(root, 'package-scoped-dependency', 'package.json'), - JSON.stringify(scopedDependency, null, 2) - ) - - t.end() -}) - -test('installing already installed local scoped package', function (t) { - common.npm( - [ - '--loglevel', 'silent', - '--parseable', - 'install' - ], - EXEC_OPTS, - function (err, code, stdout) { - var installed = parseNpmInstallOutput(stdout) - t.ifError(err, 'install ran to completion without error') - t.notOk(code, 'npm install exited with code 0') - t.ok( - existsSync(path.join(modules, '@scoped', 'package-scoped-dependency', 'package.json')), - 'package installed' - ) - t.ok( - contains(installed, 'node_modules/@scoped/package-scoped-dependency'), - 'installed @scoped/package-scoped-dependency' - ) - t.ok( - contains(installed, 'node_modules/package-local-dependency'), - 'installed package-local-dependency' - ) - - common.npm( - [ - '--loglevel', 'silent', - '--parseable', - 'install' - ], - EXEC_OPTS, - function (err, code, stdout) { - t.ifError(err, 'install ran to completion without error') - t.notOk(code, 'npm install raised no error code') - - installed = parseNpmInstallOutput(stdout) - - t.ok( - existsSync(path.join(modules, '@scoped', 'package-scoped-dependency', 'package.json')), - 'package installed' - ) - - t.notOk( - contains(installed, 'node_modules/@scoped/package-scoped-dependency'), - 'did not reinstall @scoped/package-scoped-dependency' - ) - t.notOk( - contains(installed, 'node_modules/package-local-dependency'), - 'did not reinstall package-local-dependency' - ) - t.end() - } - ) - } - ) -}) - -function contains (list, element) { - var matcher = new RegExp(element.replace(/\//g, '[\\\\/]') + '$') - for (var i = 0; i < list.length; ++i) { - if (matcher.test(list[i])) { - return true - } - } - return false -} - -function parseNpmInstallOutput (stdout) { - return stdout.trim().split(/\n\n|\s+/) -} diff --git a/deps/npm/test/tap/install-scoped-link.js b/deps/npm/test/tap/install-scoped-link.js deleted file mode 100644 index a0c9c61a9843ce..00000000000000 --- a/deps/npm/test/tap/install-scoped-link.js +++ /dev/null @@ -1,73 +0,0 @@ -var exec = require('child_process').exec -var fs = require('graceful-fs') -var path = require('path') -var existsSync = fs.existsSync || path.existsSync - -var mkdirp = require('mkdirp') -var test = require('tap').test - -var escapeExecPath = require('../../lib/utils/escape-exec-path') - -var common = require('../common-tap.js') - -var resolve = require('path').resolve -var pkg = resolve(common.pkg, 'package') -var work = resolve(common.pkg, 'TEST') -var modules = path.join(work, 'node_modules') - -var EXEC_OPTS = { cwd: work } - -var world = '#!/usr/bin/env node\nconsole.log("hello blrbld")\n' - -var json = { - name: '@scoped/package', - version: '0.0.0', - bin: { - hello: './world.js' - } -} - -test('setup', function (t) { - mkdirp.sync(pkg) - fs.writeFileSync( - path.join(pkg, 'package.json'), - JSON.stringify(json, null, 2) - ) - fs.writeFileSync(path.join(pkg, 'world.js'), world) - - mkdirp.sync(modules) - process.chdir(work) - - t.end() -}) - -test('installing package with links', function (t) { - common.npm( - [ - '--loglevel', 'silent', - 'install', pkg - ], - EXEC_OPTS, - function (err, code) { - t.ifError(err, 'install ran to completion without error') - t.notOk(code, 'npm install exited with code 0') - - t.ok( - existsSync(path.join(modules, '@scoped', 'package', 'package.json')), - 'package installed' - ) - t.ok(existsSync(path.join(modules, '.bin')), 'binary link directory exists') - - var hello = path.join(modules, '.bin', 'hello') - t.ok(existsSync(hello), 'binary link exists') - - exec(escapeExecPath(hello), function (err, stdout, stderr) { - t.ifError(err, 'command ran fine') - t.notOk(stderr, 'got no error output back') - t.equal(stdout, 'hello blrbld\n', 'output was as expected') - - t.end() - }) - } - ) -}) diff --git a/deps/npm/test/tap/install-scoped-with-bundled-dependency.js b/deps/npm/test/tap/install-scoped-with-bundled-dependency.js deleted file mode 100644 index db126eb6426c43..00000000000000 --- a/deps/npm/test/tap/install-scoped-with-bundled-dependency.js +++ /dev/null @@ -1,83 +0,0 @@ -'use strict' -var path = require('path') -var test = require('tap').test -var Tacks = require('tacks') -var File = Tacks.File -var Dir = Tacks.Dir -var common = require('../common-tap.js') - -var basedir = common.pkg -var testdir = path.join(basedir, 'testdir') -var cachedir = common.cache -var globaldir = path.join(basedir, 'global') -var tmpdir = path.join(basedir, 'tmp') - -var conf = { - cwd: testdir, - env: Object.assign({ - npm_config_cache: cachedir, - npm_config_tmp: tmpdir, - npm_config_prefix: globaldir, - npm_config_registry: common.registry, - npm_config_loglevel: 'warn' - }, process.env) -} - -var fixture = new Tacks(Dir({ - cache: Dir(), - global: Dir(), - tmp: Dir(), - testdir: Dir({ - node_modules: Dir({ - }), - package: Dir({ - node_modules: Dir({ - 'bundled-dep': Dir({ - 'package.json': File({ - name: 'bundled-dep', - version: '0.0.0' - }) - }) - }), - 'package.json': File({ - name: '@scope/package', - version: '0.0.0', - dependencies: { - 'bundled-dep': '*' - }, - bundledDependencies: [ - 'bundled-dep' - ] - }) - }) - }) -})) - -function setup () { - cleanup() - fixture.create(basedir) -} - -function cleanup () { - fixture.remove(basedir) -} - -test('setup', function (t) { - setup() - t.done() -}) - -test('install dependencies of bundled dependencies', function (t) { - common.npm(['install', './package'], conf, function (err, code, stdout, stderr) { - if (err) throw err - t.is(code, 0, 'command ran ok') - t.comment(stdout.trim()) - t.comment(stderr.trim()) - t.done() - }) -}) - -test('cleanup', function (t) { - cleanup() - t.done() -}) diff --git a/deps/npm/test/tap/install-scoped-with-peer-dependency.js b/deps/npm/test/tap/install-scoped-with-peer-dependency.js deleted file mode 100644 index 016f5f0453b31c..00000000000000 --- a/deps/npm/test/tap/install-scoped-with-peer-dependency.js +++ /dev/null @@ -1,40 +0,0 @@ -var fs = require('fs') -var path = require('path') - -var mkdirp = require('mkdirp') -var test = require('tap').test - -var common = require('../common-tap.js') -var pkg = common.pkg -var local = path.join(pkg, 'package') - -var EXEC_OPTS = { cwd: pkg } - -var json = { - name: '@scope/package', - version: '0.0.0', - peerDependencies: { - underscore: '*' - } -} - -test('setup', function (t) { - mkdirp.sync(local) - mkdirp.sync(path.resolve(pkg, 'node_modules')) - fs.writeFileSync( - path.join(local, 'package.json'), - JSON.stringify(json, null, 2) - ) - t.end() -}) - -test('it should install peerDependencies in same tree level as the parent package', function (t) { - common.npm(['install', '--loglevel=warn', './package'], EXEC_OPTS, function (err, code, stdout, stderr) { - t.ifError(err, 'install local package successful') - t.equal(code, 0, 'npm install exited with code') - t.match(stderr, /npm WARN @scope[/]package@0[.]0[.]0 requires a peer of underscore@[*] but none is installed[.] You must install peer dependencies yourself[.]\n/, - 'npm install warned about unresolved peer dep') - - t.end() - }) -}) diff --git a/deps/npm/test/tap/install-shrinkwrapped-git.js b/deps/npm/test/tap/install-shrinkwrapped-git.js deleted file mode 100644 index 3cdc2b91291d4d..00000000000000 --- a/deps/npm/test/tap/install-shrinkwrapped-git.js +++ /dev/null @@ -1,155 +0,0 @@ -'use strict' - -var fs = require('fs') -var path = require('path') -var resolve = path.resolve -var mkdirp = require('mkdirp') -var rimraf = require('rimraf') -var test = require('tap').test -var npm = require('../../lib/npm') -var common = require('../common-tap') -var chain = require('slide').chain - -var mockPath = common.pkg -var parentPath = resolve(mockPath, 'parent') -var parentNodeModulesPath = path.join(parentPath, 'node_modules') -var outdatedNodeModulesPath = resolve(mockPath, 'node-modules-backup') -var childPath = resolve(mockPath, 'child.git') - -var gitDaemon -var gitDaemonPID -var git - -var parentPackageJSON = JSON.stringify({ - name: 'parent', - version: '0.1.0' -}) - -var childPackageJSON = JSON.stringify({ - name: 'child', - version: '0.1.0' -}) - -test('setup', function (t) { - mkdirp.sync(parentPath) - fs.writeFileSync(resolve(parentPath, 'package.json'), parentPackageJSON) - process.chdir(parentPath) - - // Setup child - mkdirp.sync(childPath) - fs.writeFileSync(resolve(childPath, 'package.json'), childPackageJSON) - - // Setup npm and then git - npm.load({ - registry: common.registry, - loglevel: 'silent', - save: true // Always install packages with --save - }, function () { - // It's important to initialize git after npm because it uses config - initializeGit(function (err, result) { - t.ifError(err, 'git started up successfully') - - if (!err) { - gitDaemon = result[result.length - 2] - gitDaemonPID = result[result.length - 1] - } - - t.end() - }) - }) -}) - -test('shrinkwrapped git dependency got updated', function (t) { - t.comment('test for https://github.com/npm/npm/issues/12718') - - // Prepare the child package git repo with two commits - prepareChildAndGetRefs(function (err, refs) { - if (err) { throw err } - chain([ - // Install & shrinkwrap child package's first commit - [npm.commands.install, ['git://localhost:' + common.gitPort + '/child.git#' + refs[0]]], - // Backup node_modules with the first commit - [fs.rename, parentNodeModulesPath, outdatedNodeModulesPath], - // Install & shrinkwrap child package's latest commit - [npm.commands.install, ['git://localhost:' + common.gitPort + '/child.git#' + refs[1].substr(0, 8)]], - // Restore node_modules with the first commit - [rimraf, parentNodeModulesPath], - [fs.rename, outdatedNodeModulesPath, parentNodeModulesPath], - // Update node_modules - [npm.commands.install, []] - ], function () { - const pkglock = require(path.join(parentPath, 'package-lock.json')) - t.similar(pkglock, { - dependencies: { - child: { - version: `git://localhost:${common.gitPort}/child.git#${refs[1]}`, - from: `git://localhost:${common.gitPort}/child.git#${refs[1].substr(0, 8)}` - } - } - }, 'version and from fields are correct in git-based pkglock dep') - var childPackageJSON = require(path.join(parentNodeModulesPath, 'child', 'package.json')) - t.equal( - childPackageJSON._resolved, - 'git://localhost:' + common.gitPort + '/child.git#' + refs[1], - "Child package wasn't updated" - ) - t.end() - }) - }) -}) - -test('clean', function (t) { - gitDaemon.on('close', t.end) - process.kill(gitDaemonPID) -}) - -function prepareChildAndGetRefs (cb) { - var opts = { cwd: childPath, env: { PATH: process.env.PATH } } - chain([ - [fs.writeFile, path.join(childPath, 'README.md'), ''], - git.chainableExec(['add', 'README.md'], opts), - git.chainableExec(['commit', '-m', 'Add README'], opts), - git.chainableExec(['log', '--pretty=format:"%H"', '-2'], opts) - ], function (err) { - if (err) { return cb(err) } - var gitLogStdout = arguments[arguments.length - 1] - var refs = gitLogStdout[gitLogStdout.length - 1].split('\n').map(function (ref) { - return ref.match(/^"(.+)"$/)[1] - }).reverse() // Reverse refs order: last, first -> first, last - cb(null, refs) - }) -} - -function initializeGit (cb) { - git = require('../../lib/utils/git') - common.makeGitRepo({ - path: childPath, - commands: [startGitDaemon] - }, cb) -} - -function startGitDaemon (cb) { - var daemon = git.spawn( - [ - 'daemon', - '--verbose', - '--listen=localhost', - '--export-all', - '--base-path=' + mockPath, // Path to the dir that contains child.git - '--reuseaddr', - '--port=' + common.gitPort - ], - { - cwd: parentPath, - env: process.env, - stdio: ['pipe', 'pipe', 'pipe'] - } - ) - daemon.stderr.on('data', function findChild (c) { - var cpid = c.toString().match(/^\[(\d+)\]/) - if (cpid[1]) { - this.removeListener('data', findChild) - cb(null, [daemon, cpid[1]]) - } - }) -} diff --git a/deps/npm/test/tap/install-test-cli-with-broken-package-lock.js b/deps/npm/test/tap/install-test-cli-with-broken-package-lock.js deleted file mode 100644 index 3c1a56131bad46..00000000000000 --- a/deps/npm/test/tap/install-test-cli-with-broken-package-lock.js +++ /dev/null @@ -1,118 +0,0 @@ -var fs = require('graceful-fs') -var path = require('path') - -var mkdirp = require('mkdirp') -var osenv = require('osenv') -var rimraf = require('rimraf') -var test = require('tap').test - -var common = require('../common-tap.js') - -var pkg = common.pkg - -var EXEC_OPTS = { cwd: pkg } - -var json = { - name: 'install-test-cli-with-broken-package-lock', - description: 'fixture', - version: '0.0.0', - dependencies: { - optimist: '0.6.0' - } -} - -var brokenLockfile = { - name: 'install-test-cli-with-broken-package-lock', - version: '0.0.0', - lockfileVersion: 1, - requires: true, - dependencies: { - optimist: { - version: '0.6.0', - resolved: 'https://registry.npmjs.org/optimist/-/optimist-0.6.0.tgz', - integrity: 'sha1-aUJIJvNAX3nxQub8PZrljU27kgA=', - requires: { - minimist: '~0.0.1', - wordwrap: '~0.0.2' - } - }, - wordwrap: { - version: '0.0.3', - resolved: 'https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.3.tgz', - integrity: 'sha1-o9XabNXAvAAI03I0u68b7WMFkQc=' - } - } -} - -var expected = { - name: 'install-test-cli-with-broken-package-lock', - version: '0.0.0', - lockfileVersion: 1, - requires: true, - dependencies: { - minimist: { - version: '0.0.10', - resolved: 'https://registry.npmjs.org/minimist/-/minimist-0.0.10.tgz', - integrity: 'sha1-3j+YVD2/lggr5IrRoMfNqDYwHc8=' - }, - optimist: { - version: '0.6.0', - resolved: 'https://registry.npmjs.org/optimist/-/optimist-0.6.0.tgz', - integrity: 'sha1-aUJIJvNAX3nxQub8PZrljU27kgA=', - requires: { - minimist: '~0.0.1', - wordwrap: '~0.0.2' - } - }, - wordwrap: { - version: '0.0.3', - resolved: 'https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.3.tgz', - integrity: 'sha1-o9XabNXAvAAI03I0u68b7WMFkQc=' - } - } -} - -test('setup', function (t) { - setup() - t.end() -}) - -test('\'npm install-test\' should repair package-lock.json', function (t) { - common.npm(['install-test'], EXEC_OPTS, function (err, code, stderr, stdout) { - if (err) throw err - t.comment(stdout.trim()) - t.comment(stderr.trim()) - t.is(code, 0, 'npm install did not raise error code') - var lockfile = JSON.parse(fs.readFileSync(path.join(pkg, 'package-lock.json'))) - t.same( - lockfile, - expected, - 'package-lock.json should be repaired' - ) - t.end() - }) -}) - -test('cleanup', function (t) { - cleanup() - t.end() -}) - -function setup () { - cleanup() - mkdirp.sync(pkg) - fs.writeFileSync( - path.join(pkg, 'package.json'), - JSON.stringify(json, null, 2) - ) - fs.writeFileSync( - path.join(pkg, 'package-lock.json'), - JSON.stringify(brokenLockfile, null, 2) - ) - process.chdir(pkg) -} - -function cleanup () { - process.chdir(osenv.tmpdir()) - rimraf.sync(pkg) -} diff --git a/deps/npm/test/tap/install-test-cli-without-package-lock.js b/deps/npm/test/tap/install-test-cli-without-package-lock.js deleted file mode 100644 index 603043af8fd381..00000000000000 --- a/deps/npm/test/tap/install-test-cli-without-package-lock.js +++ /dev/null @@ -1,64 +0,0 @@ -var fs = require('graceful-fs') -var path = require('path') - -var mkdirp = require('mkdirp') -var test = require('tap').test - -var common = require('../common-tap.js') - -var pkg = common.pkg - -var EXEC_OPTS = { cwd: pkg } - -var json = { - name: 'install-test-cli-without-package-lock', - description: 'fixture', - version: '0.0.0', - dependencies: { - dependency: 'file:./dependency' - } -} - -var dependency = { - name: 'dependency', - description: 'fixture', - version: '0.0.0' -} - -test('setup', function (t) { - mkdirp.sync(path.join(pkg, 'dependency')) - fs.writeFileSync( - path.join(pkg, 'dependency', 'package.json'), - JSON.stringify(dependency, null, 2) - ) - - mkdirp.sync(path.join(pkg, 'node_modules')) - fs.writeFileSync( - path.join(pkg, 'package.json'), - JSON.stringify(json, null, 2) - ) - - // Disable package-lock - fs.writeFileSync( - path.join(pkg, '.npmrc'), - 'package-lock=false\n' - ) - t.end() -}) - -test('\'npm install-test\' should not generate package-lock.json.*', function (t) { - common.npm(['install-test'], EXEC_OPTS, function (err, code, stderr, stdout) { - if (err) throw err - t.comment(stdout.trim()) - t.comment(stderr.trim()) - t.is(code, 0, 'npm install did not raise error code') - var files = fs.readdirSync(pkg).filter(function (f) { - return f.indexOf('package-lock.json.') === 0 - }) - t.notOk( - files.length > 0, - 'package-lock.json.* should not be generated: ' + files - ) - t.end() - }) -}) diff --git a/deps/npm/test/tap/install-windows-newlines.js b/deps/npm/test/tap/install-windows-newlines.js deleted file mode 100644 index b56c7645ebf421..00000000000000 --- a/deps/npm/test/tap/install-windows-newlines.js +++ /dev/null @@ -1,90 +0,0 @@ -var fs = require('graceful-fs') -var path = require('path') -var existsSync = fs.existsSync || path.existsSync - -var mkdirp = require('mkdirp') -var rimraf = require('rimraf') -var test = require('tap').test - -var common = require('../common-tap.js') - -var pkg = common.pkg - -var EXEC_OPTS = { cwd: pkg, stdio: [0, 1, 2] } - -var json = { - name: 'install-windows-newlines', - description: 'fixture', - version: '0.0.0', - dependencies: { - 'cli-dependency': 'file:cli-dependency' - } -} - -var dependency = { - name: 'cli-dependency', - description: 'fixture', - version: '0.0.0', - bin: { - hashbang: './hashbang.js', - nohashbang: './nohashbang.js' - } -} - -test('setup', function (t) { - cleanup() - mkdirp.sync(path.join(pkg, 'cli-dependency')) - fs.writeFileSync( - path.join(pkg, 'cli-dependency', 'package.json'), - JSON.stringify(dependency, null, 2) - ) - fs.writeFileSync( - path.join(pkg, 'cli-dependency', 'hashbang.js'), - '#!/usr/bin/env node\r\nconsole.log(\'Hello, world!\')\r\n' - ) - fs.writeFileSync( - path.join(pkg, 'cli-dependency', 'nohashbang.js'), - '\'use strict\'\r\nconsole.log(\'Goodbye, world!\')\r\n' - ) - - mkdirp.sync(path.join(pkg, 'node_modules')) - fs.writeFileSync( - path.join(pkg, 'package.json'), - JSON.stringify(json, null, 2) - ) - - return common.npm(['install'], EXEC_OPTS).spread((code) => { - t.equal(code, 0, 'npm install did not raise error code') - t.ok( - existsSync(path.resolve(pkg, 'node_modules/.bin/hashbang')), - 'hashbang installed' - ) - t.ok( - existsSync(path.resolve(pkg, 'node_modules/.bin/nohashbang')), - 'nohashbang installed' - ) - t.notOk( - fs.readFileSync( - path.resolve(pkg, 'node_modules/cli-dependency/hashbang.js'), - 'utf8' - ).includes('node\r\n'), - 'hashbang dependency cli newlines converted' - ) - t.ok( - fs.readFileSync( - path.resolve(pkg, 'node_modules/cli-dependency/nohashbang.js'), - 'utf8' - ).includes('\r\n'), - 'nohashbang dependency cli newlines retained' - ) - }) -}) - -test('cleanup', function (t) { - cleanup() - t.end() -}) - -function cleanup () { - rimraf.sync(pkg) -} diff --git a/deps/npm/test/tap/install-with-dev-dep-duplicate.js b/deps/npm/test/tap/install-with-dev-dep-duplicate.js deleted file mode 100644 index 7d8586f47d4ad1..00000000000000 --- a/deps/npm/test/tap/install-with-dev-dep-duplicate.js +++ /dev/null @@ -1,81 +0,0 @@ -var fs = require('graceful-fs') -var path = require('path') - -var mr = require('npm-registry-mock') -var test = require('tap').test - -var common = require('../common-tap.js') -var npm = require('../../') - -var pkg = common.pkg - -var json = { - author: 'Anders Janmyr', - name: 'dev-dep-duplicate', - version: '0.0.0', - dependencies: { - underscore: '1.5.1' - }, - devDependencies: { - underscore: '1.3.1' - } -} - -var expected = { - name: 'dev-dep-duplicate', - version: '0.0.0', - dependencies: { - underscore: { - version: '1.5.1', - from: 'underscore@1.5.1', - resolved: common.registry + '/underscore/-/underscore-1.5.1.tgz', - invalid: true - } - } -} - -test('prefers version from dependencies over devDependencies', function (t) { - t.plan(1) - - mr({ port: common.port }, function (er, s) { - setup(function (err) { - if (err) { - throw err - } - - npm.install('.', function (err) { - if (err) { - throw err - } - - npm.commands.ls([], true, function (err, _, results) { - if (err) { - throw err - } - - // these contain full paths so we can't do an exact match - // with them - delete results.problems - delete results.dependencies.underscore.problems - t.deepEqual(results, expected) - s.close() - t.end() - }) - }) - }) - }) -}) - -function setup (cb) { - fs.writeFileSync( - path.join(pkg, 'package.json'), - JSON.stringify(json, null, 2) - ) - process.chdir(pkg) - - var opts = { - cache: common.cache, - registry: common.registry - } - npm.load(opts, cb) -} diff --git a/deps/npm/test/tap/install-without-registry-config.js b/deps/npm/test/tap/install-without-registry-config.js deleted file mode 100644 index 852bd777ced5a3..00000000000000 --- a/deps/npm/test/tap/install-without-registry-config.js +++ /dev/null @@ -1,35 +0,0 @@ -const t = require('tap') -const { pkg, npm } = require('../common-tap.js') -const { writeFileSync, statSync, readFileSync } = require('fs') -const mkdirp = require('mkdirp') -const proj = pkg + '/project' -const dep = pkg + '/dep' -mkdirp.sync(proj) -mkdirp.sync(dep) -writeFileSync(dep + '/package.json', JSON.stringify({ - name: 'dependency', - version: '1.2.3' -})) -writeFileSync(proj + '/package.json', JSON.stringify({ - name: 'project', - version: '4.2.0' -})) - -const runTest = t => npm([ - 'install', - '../dep', - '--no-registry' -], { cwd: proj }).then(([code, out, err]) => { - t.equal(code, 0) - t.match(out, /^\+ dependency@1\.2\.3\n.* 1 package in [0-9.]+m?s\n$/) - t.equal(err, '') - const data = readFileSync(proj + '/node_modules/dependency/package.json', 'utf8') - t.same(JSON.parse(data), { - name: 'dependency', - version: '1.2.3' - }, 'dep got installed') - t.ok(statSync(proj + '/package-lock.json').isFile(), 'package-lock exists') -}) - -t.test('install without a registry, no package lock', t => runTest(t)) -t.test('install without a registry, with package lock', t => runTest(t)) diff --git a/deps/npm/test/tap/install.fund.js b/deps/npm/test/tap/install.fund.js deleted file mode 100644 index fca5fb3afd123c..00000000000000 --- a/deps/npm/test/tap/install.fund.js +++ /dev/null @@ -1,99 +0,0 @@ -'use strict' - -const { test } = require('tap') -const { getPrintFundingReport } = require('../../lib/install/fund') - -test('message when there are no funding found', (t) => { - t.equal( - getPrintFundingReport({}), - '', - 'should not print any message if missing info' - ) - t.equal( - getPrintFundingReport({ - name: 'foo', - version: '1.0.0', - dependencies: {} - }), - '', - 'should not print any message if package has no dependencies' - ) - t.equal( - getPrintFundingReport({ - fund: true, - idealTree: { - name: 'foo', - version: '1.0.0', - dependencies: { - bar: {}, - lorem: {} - } - } - }), - '', - 'should not print any message if no package has funding info' - ) - t.end() -}) - -test('print appropriate message for a single package', (t) => { - t.equal( - getPrintFundingReport({ - fund: true, - idealTree: { - name: 'foo', - version: '1.0.0', - children: [ - { - package: { - name: 'bar', - version: '1.0.0', - funding: { type: 'foo', url: 'http://example.com' } - } - } - ] - } - }).replace(/[\r\n]+/g, '\n'), - `\n1 package is looking for funding\n run \`npm fund\` for details\n`, - 'should print single package message' - ) - t.end() -}) - -test('print appropriate message for many packages', (t) => { - t.equal( - getPrintFundingReport({ - fund: true, - idealTree: { - name: 'foo', - version: '1.0.0', - children: [ - { - package: { - name: 'bar', - version: '1.0.0', - funding: { type: 'foo', url: 'http://example.com' } - } - }, - { - package: { - name: 'lorem', - version: '1.0.0', - funding: { type: 'foo', url: 'http://example.com' } - } - }, - { - package: { - name: 'ipsum', - version: '1.0.0', - funding: { type: 'foo', url: 'http://example.com' } - } - } - ] - } - }).replace(/[\r\n]+/g, '\n'), - `\n3 packages are looking for funding\n run \`npm fund\` for details\n`, - 'should print many package message' - ) - t.end() -}) diff --git a/deps/npm/test/tap/invalid-cmd-exit-code.js b/deps/npm/test/tap/invalid-cmd-exit-code.js deleted file mode 100644 index b9a42f1be427b8..00000000000000 --- a/deps/npm/test/tap/invalid-cmd-exit-code.js +++ /dev/null @@ -1,34 +0,0 @@ -var test = require('tap').test -var common = require('../common-tap.js') - -var opts = { cwd: process.cwd() } - -test('npm asdf should return exit code 1', function (t) { - common.npm(['asdf'], opts, function (err, code, stdout, stderr) { - if (err) throw err - t.ok(code, 'exit code should not be zero') - if (stdout.trim()) t.comment(stdout.trim()) - if (stderr.trim()) t.comment(stderr.trim()) - t.end() - }) -}) - -test('npm help should return exit code 0', function (t) { - common.npm(['help'], opts, function (err, code, stdout, stderr) { - if (err) throw err - t.equal(code, 0, 'exit code should be 0') - if (stdout.trim()) t.comment(stdout.trim()) - if (stderr.trim()) t.comment(stderr.trim()) - t.end() - }) -}) - -test('npm help fadf should return exit code 0', function (t) { - common.npm(['help', 'fadf'], opts, function (err, code, stdout, stderr) { - if (err) throw err - t.equal(code, 0, 'exit code should be 0') - if (stdout.trim()) t.comment(stdout.trim()) - if (stderr.trim()) t.comment(stderr.trim()) - t.end() - }) -}) diff --git a/deps/npm/test/tap/invalid-dep-version-filtering.js b/deps/npm/test/tap/invalid-dep-version-filtering.js deleted file mode 100644 index f2f175b24ef5ec..00000000000000 --- a/deps/npm/test/tap/invalid-dep-version-filtering.js +++ /dev/null @@ -1,135 +0,0 @@ -'use strict' -var path = require('path') -var test = require('tap').test -var mr = require('npm-registry-mock') -var common = require('../common-tap') -var Tacks = require('tacks') -var File = Tacks.File -var Dir = Tacks.Dir - -var testdir = common.pkg -var cachedir = common.cache - -var fixture = new Tacks(Dir({ - cache: Dir(), - node_modules: Dir(), - tarballs: Dir({ - 'pkgA.tgz': File(Buffer.from( - '1f8b0800000000000003edcfcf0a0221100670cf3ec5e0396cfcb703bd8d' + - '842cb5e4ca5a5da2776f5da153b78408fc5d3e6684e133f9e3e4c7b04f35' + - 'e539cf9135868883b5509206b725ea3a6f9c01a634598d8e48134365d0e0' + - 'fadebac827b77cf5cb5ae5db3bf52bf0ce3ff1e00022fa4b100710691abd' + - 'd895cd3d2cf934c7b25412250afee4bfaeda755dd735f40211b5bced0008' + - '0000', - 'hex' - )), - 'pkgB1.tgz': File(Buffer.from( - '1f8b0800000000000003edcfc10a0221140550d77ec5c375d8d3d111fa1b' + - '0b196ac891b16913fd7be308adda2544f0cee6e25d3caec99f463f847daa' + - '292f798aac3144ec8d8192aeb75ba2aeef8ded8029ed8c46eb1c1a86aa43' + - 'bd76d87ac8274bbef9799df2ed9dfa1578e79f78700011fd35880388340e' + - '47b12bcd3dccf93cc5522a8912057ff25f4f258410d2d00b247d22080008' + - '0000', - 'hex' - )) - }) -})) - -var pkgAtgz = path.join(testdir, 'tarballs', 'pkgA.tgz') -var pkgB1tgz = path.join(testdir, 'tarballs', 'pkgB1.tgz') - -var server - -var pkgA = { - name: 'pkg-a', - 'dist-tags': { - latest: '1.0.0' - }, - versions: { - '1.0.0': { - name: 'pkg-a', - version: '1.0.0', - dependencies: { - 'pkg-b': '1.0.0' - }, - dist: { - shasum: 'dc5471ce0439f0f47749bb01473cad4570cc7dc5', - tarball: common.registry + '/pkg-a/-/pkg-a-1.0.0.tgz' - } - } - } -} - -var pkgB = { - name: 'pkg-b', - 'dist-tags': { - latest: '1.0.0' - }, - versions: { - '1.0.0': { - name: 'pkg-b', - version: '1.0.0', - dist: { - shasum: '53031aa2cf774c0e841c6fdbbe54c13825cd5640', - tarball: common.registry + '/pkg-b/-/pkg-b-1.0.0.tgz' - } - }, - '1.0.0rc1': { - name: 'pkg-b', - version: '1.0.0rc1', - dist: { - shasum: '7f4b1bf680e3a31113d77619b4dc7c3b4c7dc15c', - tarball: common.registry + '/pkg-b/-/pkg-b-1.0.0-rc1.tgz' - } - } - } -} - -function setup () { - cleanup() - fixture.create(testdir) -} -function cleanup () { - fixture.remove(testdir) -} - -test('setup', function (t) { - setup() - mr({ port: common.port, throwOnUnmatched: true }, function (err, s) { - t.ifError(err, 'registry mocked successfully') - server = s - t.end() - }) -}) - -test('invalid versions should be ignored', function (t) { - server.get('/pkg-a').reply(200, pkgA) - server.get('/pkg-b').reply(200, pkgB) - server.get('/pkg-a/-/pkg-a-1.0.0.tgz').replyWithFile(200, pkgAtgz) - server.get('/pkg-b/-/pkg-b-1.0.0.tgz').replyWithFile(200, pkgB1tgz) - - common.npm( - [ - 'install', - '--cache', cachedir, - '--registry', common.registry, - '--fetch-retries=0', - 'pkg-a@1.0.0' - ], - {cwd: testdir}, - function (err, code, stdout, stderr) { - if (err) throw err - t.equal(code, 0, 'install succeded') - t.comment(stdout.trim()) - t.comment(stderr.trim()) - server.done() - t.end() - } - ) -}) - -test('cleanup', function (t) { - server.close() - cleanup() - t.end() -}) diff --git a/deps/npm/test/tap/is-fs-access-available.js b/deps/npm/test/tap/is-fs-access-available.js deleted file mode 100644 index 2e5c7edc9810a6..00000000000000 --- a/deps/npm/test/tap/is-fs-access-available.js +++ /dev/null @@ -1,55 +0,0 @@ -'use strict' -var fs = require('fs') -var test = require('tap').test -var requireInject = require('require-inject') -var semver = require('semver') - -var globalProcess = global.process - -function loadIsFsAccessAvailable (newProcess, newFs) { - global.process = Object.assign({}, global.process, newProcess) - var mocks = {fs: Object.assign({}, fs, newFs)} - var isFsAccessAvailable = requireInject('../../lib/install/is-fs-access-available.js', mocks) - global.process = globalProcess - return isFsAccessAvailable -} - -var fsWithAccess = {access: function () {}} -var fsWithoutAccess = {access: undefined} - -if (semver.lt(process.version, '0.12.0')) { - test('skipping', function (t) { - t.pass('skipping all tests on < 0.12.0 due to process not being injectable') - t.end() - }) -} else { - test('mac + !fs.access', function (t) { - var isFsAccessAvailable = loadIsFsAccessAvailable({platform: 'darwin'}, fsWithoutAccess) - t.is(isFsAccessAvailable, false, 'not available') - t.end() - }) - - test('mac + fs.access', function (t) { - var isFsAccessAvailable = loadIsFsAccessAvailable({platform: 'darwin'}, fsWithAccess) - t.is(isFsAccessAvailable, true, 'available') - t.end() - }) - - test('windows + !fs.access', function (t) { - var isFsAccessAvailable = loadIsFsAccessAvailable({platform: 'win32'}, fsWithoutAccess) - t.is(isFsAccessAvailable, false, 'not available') - t.end() - }) - - test('windows + fs.access + node 0.12.7', function (t) { - var isFsAccessAvailable = loadIsFsAccessAvailable({platform: 'win32', version: '0.12.7'}, fsWithAccess) - t.is(isFsAccessAvailable, false, 'not available') - t.end() - }) - - test('windows + fs.access + node 2.4.0', function (t) { - var isFsAccessAvailable = loadIsFsAccessAvailable({platform: 'win32', version: '2.4.0'}, fsWithAccess) - t.is(isFsAccessAvailable, true, 'available') - t.end() - }) -} diff --git a/deps/npm/test/tap/is-registry.js b/deps/npm/test/tap/is-registry.js deleted file mode 100644 index 832eb537d3f9cf..00000000000000 --- a/deps/npm/test/tap/is-registry.js +++ /dev/null @@ -1,27 +0,0 @@ -'use strict' -const test = require('tap').test -const npa = require('npm-package-arg') -const isRegistry = require('../../lib/utils/is-registry.js') - -test('current npa', (t) => { - t.is(Boolean(isRegistry(npa('foo@1.0.0'))), true, 'version') - t.is(Boolean(isRegistry(npa('foo@^1.0.0'))), true, 'range') - t.is(Boolean(isRegistry(npa('foo@test'))), true, 'tag') - t.is(Boolean(isRegistry(npa('foo@git://foo.bar/test.git'))), false, 'git') - t.is(Boolean(isRegistry(npa('foo@foo/bar'))), false, 'github') - t.is(Boolean(isRegistry(npa('foo@http://example.com/example.tgz'))), false, 'remote') - t.is(Boolean(isRegistry(npa('foo@file:example.tgz'))), false, 'file') - t.is(Boolean(isRegistry(npa('foo@file:example/'))), false, 'dir') - t.done() -}) - -test('legacy spec data', (t) => { - t.is(Boolean(isRegistry({type: 'version'})), true, 'version') - t.is(Boolean(isRegistry({type: 'range'})), true, 'range') - t.is(Boolean(isRegistry({type: 'tag'})), true, 'tag') - t.is(Boolean(isRegistry({type: 'git'})), false, 'git') - t.is(Boolean(isRegistry({type: 'file'})), false, 'file') - t.is(Boolean(isRegistry({type: 'directory'})), false, 'directory') - t.is(Boolean(isRegistry({type: 'remote'})), false, 'remote') - t.done() -}) diff --git a/deps/npm/test/tap/it.js b/deps/npm/test/tap/it.js deleted file mode 100644 index bb59bc6f5e9044..00000000000000 --- a/deps/npm/test/tap/it.js +++ /dev/null @@ -1,65 +0,0 @@ -var join = require('path').join -var statSync = require('graceful-fs').statSync -var writeFileSync = require('graceful-fs').writeFileSync - -var mr = require('npm-registry-mock') -var rimraf = require('rimraf') -var test = require('tap').test - -var common = require('../common-tap') - -var pkg = common.pkg -var installed = join(pkg, 'node_modules', 'underscore', 'package.json') - -var json = { - name: 'npm-it-test', - dependencies: { - underscore: '1.5.1' - }, - scripts: { - test: 'echo hax' - } -} - -test('run up the mock registry', function (t) { - mr({ port: common.port }, function (err, s) { - if (err) throw err - t.parent.teardown(() => s.close()) - t.end() - }) -}) - -const check = args => t => - common.npm(args.concat('--registry=' + common.registry), { cwd: pkg }) - .then(([code, stdout, stderr]) => { - t.equal(code, 0, 'command ran without error') - t.ok(statSync(installed), 'package was installed') - t.equal(require(installed).version, '1.5.1', 'underscore got installed as expected') - t.match(stdout, /hax/, 'found expected test output') - t.notOk(stderr, 'stderr should be empty') - }) - -test('npm install-test', function (t) { - t.plan(2) - t.test('setup', setup) - t.test('check', check(['install-test', '--no-shrinkwrap'])) -}) - -test('npm it (the form most people will use)', function (t) { - t.plan(2) - t.test('setup', setup) - t.test('check', check(['it'])) -}) - -function setup (t) { - t.test('destroy', t => { - t.plan(2) - rimraf(join(pkg, 'node_modules'), () => t.pass('node_modules')) - rimraf(join(pkg, 'package-lock.json'), () => t.pass('lock file')) - }) - t.test('create', t => { - writeFileSync(join(pkg, 'package.json'), JSON.stringify(json, null, 2)) - t.end() - }) - t.end() -} diff --git a/deps/npm/test/tap/legacy-ignore-nested-nm.js b/deps/npm/test/tap/legacy-ignore-nested-nm.js deleted file mode 100644 index 6a57b72b604881..00000000000000 --- a/deps/npm/test/tap/legacy-ignore-nested-nm.js +++ /dev/null @@ -1,64 +0,0 @@ -'use strict' -var test = require('tap').test -var common = require('../common-tap.js') -var path = require('path') -var rimraf = require('rimraf') -var mkdirp = require('mkdirp') -var basepath = common.pkg -var fixturepath = path.resolve(basepath, 'npm-test-ignore-nested-nm') -var modulepath = path.resolve(basepath, 'node_modules') -var installedpath = path.resolve(modulepath, 'npm-test-ignore-nested-nm') -var fs = require('graceful-fs') -var Tacks = require('tacks') -var File = Tacks.File -var Dir = Tacks.Dir - -var fileData = 'I WILL NOT BE IGNORED!\n' -var fixture = new Tacks( - Dir({ - lib: Dir({ - node_modules: Dir({ - foo: File(fileData) - }) - }), - 'package.json': File({ - name: 'npm-test-ignore-nested-nm', - version: '1.2.5' - }) - }) -) -test('setup', function (t) { - setup() - t.done() -}) -test('ignore-nested-nm', function (t) { - common.npm(['install', fixturepath], {cwd: basepath}, installCheckAndTest) - function installCheckAndTest (err, code, stdout, stderr) { - if (err) throw err - t.is(code, 0, 'install went ok') - var foopath = path.resolve(installedpath, 'lib/node_modules/foo') - fs.readFile(foopath, function (err, data) { - t.ifError(err, 'file read successfully') - t.equal(data.toString(), fileData) - common.npm(['rm', fixturepath], {cwd: basepath}, removeCheckAndDone) - }) - } - function removeCheckAndDone (err, code, stdout, stderr) { - if (err) throw err - t.is(code, 0, 'remove went ok') - t.done() - } -}) -test('cleanup', function (t) { - cleanup() - t.done() -}) -function setup () { - cleanup() - fixture.create(fixturepath) - mkdirp.sync(modulepath) -} -function cleanup () { - fixture.remove(fixturepath) - rimraf.sync(basepath) -} diff --git a/deps/npm/test/tap/legacy-missing-bindir.js b/deps/npm/test/tap/legacy-missing-bindir.js deleted file mode 100644 index 398ef0e7acc517..00000000000000 --- a/deps/npm/test/tap/legacy-missing-bindir.js +++ /dev/null @@ -1,78 +0,0 @@ -'use strict' -var path = require('path') -var fs = require('fs') -var test = require('tap').test -var common = require('../common-tap.js') -var rimraf = require('rimraf') -var mkdirp = require('mkdirp') -var basepath = common.pkg -var fixturepath = path.resolve(basepath, 'npm-test-missing-bindir') -var modulepath = path.resolve(basepath, 'node_modules') -var installedpath = path.resolve(modulepath, 'npm-test-missing-bindir') -var Tacks = require('tacks') -var File = Tacks.File -var Dir = Tacks.Dir - -var fixture = new Tacks( - Dir({ - README: File( - 'just an npm test\n' - ), - 'package.json': File({ - name: 'npm-test-missing-bindir', - version: '0.0.0', - directories: { - bin: './not-found' - } - }) - }) -) - -test('setup', function (t) { - setup() - t.done() -}) - -function installedExists (filename) { - try { - fs.statSync(path.resolve(installedpath, filename)) - return true - } catch (ex) { - console.log(ex) - return false - } -} - -test('missing-bindir', function (t) { - common.npm(['install', fixturepath], {cwd: basepath}, installCheckAndTest) - - function installCheckAndTest (err, code, stdout, stderr) { - if (err) throw err - t.is(code, 0, 'install went ok') - t.is(installedExists('README'), true, 'README') - t.is(installedExists('package.json'), true, 'package.json') - common.npm(['rm', fixturepath], {cwd: basepath}, removeCheckAndDone) - } - - function removeCheckAndDone (err, code, stdout, stderr) { - if (err) throw err - t.is(code, 0, 'remove went ok') - t.done() - } -}) - -test('cleanup', function (t) { - cleanup() - t.done() -}) - -function setup () { - cleanup() - fixture.create(fixturepath) - mkdirp.sync(modulepath) -} - -function cleanup () { - fixture.remove(fixturepath) - rimraf.sync(basepath) -} diff --git a/deps/npm/test/tap/legacy-no-auth-leak.js b/deps/npm/test/tap/legacy-no-auth-leak.js deleted file mode 100644 index ce1adaeca756a5..00000000000000 --- a/deps/npm/test/tap/legacy-no-auth-leak.js +++ /dev/null @@ -1,74 +0,0 @@ -'use strict' -var test = require('tap').test -var common = require('../common-tap.js') -var basepath = common.pkg -var Tacks = require('tacks') -var File = Tacks.File -var Dir = Tacks.Dir - -var fixture = new Tacks( - Dir({ - README: File( - 'just an npm test\n' - ), - 'package.json': File({ - name: 'npm-test-no-auth-leak', - version: '0.0.0', - scripts: { - test: 'node test.js' - } - }), - '.npmrc': File( - 'auth=abc', - 'authCrypt=def', - 'password=xyz', - '//registry.npmjs.org/:_authToken=nopenope' - ), - 'test.js': File( - 'var authTokenKeys = Object.keys(process.env)\n' + - ' .filter(function (key) { return /authToken/.test(key) })\n' + - 'console.log(JSON.stringify({\n' + - ' password: process.env.npm_config__password || null,\n' + - ' auth: process.env.npm_config__auth || null,\n' + - ' authCrypt: process.env.npm_config__authCrypt || null ,\n' + - ' authToken: authTokenKeys && process.env[authTokenKeys[0]] || null\n' + - '}))' - ) - }) -) - -test('setup', function (t) { - setup() - t.done() -}) - -test('no-auth-leak', function (t) { - common.npm(['test'], {cwd: basepath}, function (err, code, stdout, stderr) { - if (err) throw err - t.is(code, 0, 'test ran ok') - if (stderr) console.log(stderr) - var matchResult = /^[^{]*(\{(?:.|\n)*\})[^}]*$/ - t.like(stdout, matchResult, 'got results with a JSON chunk in them') - var stripped = stdout.replace(matchResult, '$1') - var result = JSON.parse(stripped) - t.is(result.password, null, 'password') - t.is(result.auth, null, 'auth') - t.is(result.authCrypt, null, 'authCrypt') - t.is(result.authToken, null, 'authToken') - t.end() - }) -}) - -test('cleanup', function (t) { - cleanup() - t.done() -}) - -function setup () { - cleanup() - fixture.create(basepath) -} - -function cleanup () { - fixture.remove(basepath) -} diff --git a/deps/npm/test/tap/legacy-platform-all.js b/deps/npm/test/tap/legacy-platform-all.js deleted file mode 100644 index 01c7be7ec1c861..00000000000000 --- a/deps/npm/test/tap/legacy-platform-all.js +++ /dev/null @@ -1,74 +0,0 @@ -'use strict' -var test = require('tap').test -var common = require('../common-tap.js') -var path = require('path') -var rimraf = require('rimraf') -var mkdirp = require('mkdirp') -var basepath = common.pkg -var fixturepath = path.resolve(basepath, 'npm-test-platform-all') -var modulepath = path.resolve(basepath, 'node_modules') -var Tacks = require('tacks') -var File = Tacks.File -var Dir = Tacks.Dir - -var fixture = new Tacks( - Dir({ - README: File( - 'just an npm test\n' - ), - 'package.json': File({ - name: 'npm-test-platform-all', - version: '9.9.9-9', - homepage: 'http://www.zombo.com/', - os: [ - 'darwin', - 'linux', - 'win32', - 'solaris', - 'haiku', - 'sunos', - 'freebsd', - 'openbsd', - 'netbsd' - ], - cpu: [ - 'arm', - 'arm64', - 'mips', - 'ia32', - 'x64', - 'sparc' - ] - }) - }) -) - -test('setup', function (t) { - setup() - t.done() -}) - -test('platform-all', function (t) { - common.npm(['install', fixturepath], {cwd: basepath}, installCheckAndTest) - function installCheckAndTest (err, code, stdout, stderr) { - if (err) throw err - t.is(stderr, '', 'no error messages') - t.is(code, 0, 'install went ok') - t.done() - } -}) - -test('cleanup', function (t) { - cleanup() - t.done() -}) - -function setup () { - cleanup() - fixture.create(fixturepath) - mkdirp.sync(modulepath) -} -function cleanup () { - fixture.remove(fixturepath) - rimraf.sync(basepath) -} diff --git a/deps/npm/test/tap/legacy-platform.js b/deps/npm/test/tap/legacy-platform.js deleted file mode 100644 index 619d2e4330c59b..00000000000000 --- a/deps/npm/test/tap/legacy-platform.js +++ /dev/null @@ -1,64 +0,0 @@ -'use strict' -var test = require('tap').test -var common = require('../common-tap.js') -var path = require('path') -var rimraf = require('rimraf') -var mkdirp = require('mkdirp') -var basepath = common.pkg -var fixturepath = path.resolve(basepath, 'npm-test-platform') -var modulepath = path.resolve(basepath, 'node_modules') -var Tacks = require('tacks') -var File = Tacks.File -var Dir = Tacks.Dir - -var fixture = new Tacks( - Dir({ - README: File( - 'just an npm test\n' - ), - 'package.json': File({ - name: 'npm-test-platform', - version: '9.9.9-9', - homepage: 'http://www.youtube.com/watch?v=dQw4w9WgXcQ', - os: [ - '!this_is_not_a_real_os', - '!neither_is_this' - ], - cpu: [ - '!this_is_not_a_real_cpu', - '!this_isnt_either' - ] - }) - }) -) - -test('setup', function (t) { - setup() - t.done() -}) - -test('platform', function (t) { - common.npm(['install', fixturepath], {cwd: basepath}, installCheckAndTest) - function installCheckAndTest (err, code, stdout, stderr) { - if (err) throw err - console.error(stderr) - t.is(code, 0, 'install went ok') - t.done() - } -}) - -test('cleanup', function (t) { - cleanup() - t.done() -}) - -function setup () { - cleanup() - fixture.create(fixturepath) - mkdirp.sync(modulepath) -} - -function cleanup () { - fixture.remove(fixturepath) - rimraf.sync(basepath) -} diff --git a/deps/npm/test/tap/legacy-private.js b/deps/npm/test/tap/legacy-private.js deleted file mode 100644 index 44a1094cd0cc6b..00000000000000 --- a/deps/npm/test/tap/legacy-private.js +++ /dev/null @@ -1,58 +0,0 @@ -'use strict' -var test = require('tap').test -var common = require('../common-tap.js') -var path = require('path') -var rimraf = require('rimraf') -var mkdirp = require('mkdirp') -var basepath = common.pkg -var fixturepath = path.resolve(basepath, 'npm-test-private') -var modulepath = path.resolve(basepath, 'node_modules') -var Tacks = require('tacks') -var File = Tacks.File -var Dir = Tacks.Dir - -var fixture = new Tacks( - Dir({ - README: File( - 'just an npm test\n' - ), - 'package.json': File({ - name: 'npm-test-private', - version: '9.9.9-9', - homepage: 'http://www.youtube.com/watch?v=1MLry6Cn_D4', - private: 'true' - }) - }) -) - -test('setup', function (t) { - setup() - t.done() -}) - -test('private', function (t) { - common.npm(['install', fixturepath], {cwd: basepath}, installCheckAndTest) - function installCheckAndTest (err, code, stdout, stderr) { - if (err) throw err - console.error(stderr) - console.log(stdout) - t.is(code, 0, 'install went ok') - t.done() - } -}) - -test('cleanup', function (t) { - cleanup() - t.done() -}) - -function setup () { - cleanup() - fixture.create(fixturepath) - mkdirp.sync(modulepath) -} - -function cleanup () { - fixture.remove(fixturepath) - rimraf.sync(basepath) -} diff --git a/deps/npm/test/tap/legacy-test-package.js b/deps/npm/test/tap/legacy-test-package.js deleted file mode 100644 index 3c807e50491c72..00000000000000 --- a/deps/npm/test/tap/legacy-test-package.js +++ /dev/null @@ -1,70 +0,0 @@ -'use strict' -var test = require('tap').test -var common = require('../common-tap.js') -var path = require('path') -var rimraf = require('rimraf') -var mkdirp = require('mkdirp') -var basepath = common.pkg -var fixturepath = path.resolve(basepath, 'npm-test-test-package') -var modulepath = path.resolve(basepath, 'node_modules') -var installedpath = path.resolve(modulepath, 'npm-test-test-package') -var Tacks = require('tacks') -var File = Tacks.File -var Dir = Tacks.Dir - -var fixture = new Tacks( - Dir({ - README: File( - 'just an npm test\n' - ), - 'package.json': File({ - name: 'npm-test-test-package', - author: 'Testy McMock', - version: '1.2.3-99-b', - description: "This is a test package used for debugging. It has some random data and that's all." - }) - }) -) - -test('setup', function (t) { - setup() - t.done() -}) - -test('test-package', function (t) { - common.npm(['install', fixturepath], {cwd: basepath}, installCheckAndTest) - - function installCheckAndTest (err, code, stdout, stderr) { - if (err) throw err - t.is(code, 0, 'install went ok') - common.npm(['test'], {cwd: installedpath}, testCheckAndRemove) - } - - function testCheckAndRemove (err, code, stdout, stderr) { - if (err) throw err - t.is(code, 0, 'npm test w/o test is ok') - common.npm(['rm', fixturepath], {cwd: basepath}, removeCheckAndDone) - } - - function removeCheckAndDone (err, code, stdout, stderr) { - if (err) throw err - t.is(code, 0, 'remove went ok') - t.done() - } -}) - -test('cleanup', function (t) { - cleanup() - t.done() -}) - -function setup () { - cleanup() - fixture.create(fixturepath) - mkdirp.sync(modulepath) -} - -function cleanup () { - fixture.remove(fixturepath) - rimraf.sync(basepath) -} diff --git a/deps/npm/test/tap/lifecycle-INIT_CWD.js b/deps/npm/test/tap/lifecycle-INIT_CWD.js deleted file mode 100644 index fbedd3849c7085..00000000000000 --- a/deps/npm/test/tap/lifecycle-INIT_CWD.js +++ /dev/null @@ -1,36 +0,0 @@ -var fs = require('fs') -var path = require('path') - -var mkdirp = require('mkdirp') -var test = require('tap').test - -var common = require('../common-tap.js') - -var pkg = common.pkg -var subdir = path.resolve(pkg, 'subdir') - -var json = { - name: 'init-cwd', - version: '1.0.0', - scripts: { - initcwd: process.platform === 'win32' ? 'echo %INIT_CWD%' : 'echo "$INIT_CWD"' - } -} - -test('setup', function (t) { - mkdirp.sync(subdir) - fs.writeFileSync( - path.join(pkg, 'package.json'), - JSON.stringify(json, null, 2) - ) - t.end() -}) - -test('make sure the env.INIT_CWD is correct', t => - common.npm(['run-script', 'initcwd'], { cwd: subdir }) - .then(([code, stdout, stderr]) => { - t.equal(code, 0, 'exit code') - stdout = stdout.trim().split(/\r|\n/).pop() - var actual = stdout - t.equal(actual, subdir) - })) diff --git a/deps/npm/test/tap/lifecycle-order.js b/deps/npm/test/tap/lifecycle-order.js deleted file mode 100644 index ac6c07925c52bf..00000000000000 --- a/deps/npm/test/tap/lifecycle-order.js +++ /dev/null @@ -1,33 +0,0 @@ -var fs = require('graceful-fs') -var path = require('path') -var test = require('tap').test -var common = require('../common-tap.js') -var pkg = common.pkg - -var json = { - name: 'lifecycle-order', - version: '1.0.0', - scripts: { - preinstall: 'node -e "var fs = require(\'fs\'); fs.openSync(\'preinstall-step\', \'w+\'); if (fs.existsSync(\'node_modules\')) { throw \'node_modules exists on preinstall\' }"', - install: 'node -e "var fs = require(\'fs\'); if (fs.existsSync(\'preinstall-step\')) { fs.openSync(\'install-step\', \'w+\') } else { throw \'Out of order\' }"', - postinstall: 'node -e "var fs = require(\'fs\'); if (fs.existsSync(\'install-step\')) { fs.openSync(\'postinstall-step\', \'w+\') } else { throw \'Out of order\' }"' - } -} - -test('setup', function (t) { - fs.writeFileSync( - path.join(pkg, 'package.json'), - JSON.stringify(json, null, 2) - ) - t.end() -}) - -test('lifecycle scripts execute in the proper order', t => - common.npm('install', {cwd: pkg}).then(([code, stdout, stderr]) => { - t.is(code, 0, 'no error') - - // All three files should exist - t.ok(fs.existsSync(path.join(pkg, 'preinstall-step')), 'preinstall ok') - t.ok(fs.existsSync(path.join(pkg, 'install-step')), 'install ok') - t.ok(fs.existsSync(path.join(pkg, 'postinstall-step')), 'postinstall ok') - })) diff --git a/deps/npm/test/tap/lifecycle-path.js b/deps/npm/test/tap/lifecycle-path.js deleted file mode 100644 index 70fb8391971912..00000000000000 --- a/deps/npm/test/tap/lifecycle-path.js +++ /dev/null @@ -1,210 +0,0 @@ -var fs = require('fs') -var path = require('path') - -var mkdirp = require('mkdirp') -var rimraf = require('rimraf') -var which = require('which') -var test = require('tap').test - -var common = require('../common-tap.js') -var isWindows = require('../../lib/utils/is-windows.js') - -var pkg = common.pkg - -var PATH -if (isWindows) { - // On Windows the 'comspec' environment variable is used, - // so cmd.exe does not need to be on the path. - PATH = path.dirname(process.env.ComSpec) -} else { - // On non-Windows, without the path to the shell, nothing usually works. - PATH = '/bin:/usr/bin' -} - -var systemNode = which.sync('node', { nothrow: true, path: PATH }) -// the path to the system wide node (null if none) - -test('setup', function (t) { - fs.writeFileSync( - path.join(pkg, 'package.json'), - JSON.stringify({}, null, 2) - ) - t.end() -}) - -test('make sure the path is correct, without directory of current node', function (t) { - checkPath({ - withDirOfCurrentNode: false, - prependNodePathSetting: false - }, t) -}) - -test('make sure the path is correct, with directory of current node', function (t) { - checkPath({ - withDirOfCurrentNode: true, - prependNodePathSetting: false - }, t) -}) - -test('make sure the path is correct, with directory of current node but ignored node path', function (t) { - checkPath({ - withDirOfCurrentNode: true, - prependNodePathSetting: true - }, t) -}) - -test('make sure the path is correct, without directory of current node and automatic detection', function (t) { - checkPath({ - withDirOfCurrentNode: false, - prependNodePathSetting: 'auto' - }, t) -}) - -test('make sure the path is correct, with directory of current node and automatic detection', function (t) { - checkPath({ - withDirOfCurrentNode: true, - prependNodePathSetting: 'auto' - }, t) -}) - -test('make sure the path is correct, without directory of current node and warn-only detection', function (t) { - checkPath({ - withDirOfCurrentNode: false, - prependNodePathSetting: 'warn-only' - }, t) -}) - -test('make sure the path is correct, with directory of current node and warn-only detection', function (t) { - checkPath({ - withDirOfCurrentNode: true, - prependNodePathSetting: 'warn-only' - }, t) -}) - -test('make sure there is no warning with a symlinked node and warn-only detection', { - skip: isWindows && 'symlinks are weird on windows' -}, function (t) { - checkPath({ - withDirOfCurrentNode: false, - extraNode: true, - prependNodePathSetting: 'warn-only', - symlinkNodeInsteadOfCopying: true - }, t) -}) - -test('make sure the path is correct, with directory of current node and warn-only detection and an extra node in path', function (t) { - checkPath({ - withDirOfCurrentNode: false, - extraNode: true, - prependNodePathSetting: 'warn-only' - }, t) -}) - -function checkPath (testconfig, t) { - var withDirOfCurrentNode = testconfig.withDirOfCurrentNode - var prependNodePathSetting = testconfig.prependNodePathSetting - var symlinkedNode = testconfig.symlinkNodeInsteadOfCopying - var extraNode = testconfig.extraNode - - var newPATH = PATH - var currentNodeExecPath = process.execPath - if (withDirOfCurrentNode) { - var newNodeExeDir = path.join(pkg, 'node-bin', 'my_bundled_node') - mkdirp.sync(newNodeExeDir) - currentNodeExecPath = path.join(newNodeExeDir, path.basename(process.execPath)) - rimraf.sync(currentNodeExecPath) - - if (!symlinkedNode) { - fs.writeFileSync(currentNodeExecPath, fs.readFileSync(process.execPath)) - fs.chmodSync(currentNodeExecPath, '755') - } else { - fs.symlinkSync(process.execPath, currentNodeExecPath) - } - } - - if (!withDirOfCurrentNode) { - // Ensure that current node interpreter will be found in the PATH, - // so the PATH won't be prepended with its parent directory - newPATH = [path.dirname(process.execPath), PATH].join(process.platform === 'win32' ? ';' : ':') - } - - common.npm(['run-script', 'env'], { - cwd: pkg, - nodeExecPath: currentNodeExecPath, - env: { - PATH: newPATH, - npm_config_scripts_prepend_node_path: prependNodePathSetting - }, - stdio: [ 0, 'pipe', 'pipe' ] - }, function (er, code, stdout, stderr) { - if (er) throw er - if (!stderr.match(/^(npm WARN.*)?\n*$/)) console.error(stderr) - t.equal(code, 0, 'exit code') - var lineMatch = function (line) { - return /^PATH=/i.test(line) - } - // extract just the path value - stdout = stdout.split(/\r?\n/) - var observedPath = stdout.filter(lineMatch).pop().replace(/^PATH=/, '') - var pathSplit = process.platform === 'win32' ? ';' : ':' - var root = path.resolve(__dirname, '../..') - var actual = observedPath.split(pathSplit).map(function (p) { - if (p.indexOf(pkg) === 0) { - p = '{{PKG}}' + p.substr(pkg.length) - } - if (p.indexOf(root) === 0) { - p = '{{ROOT}}' + p.substr(root.length) - } - return p.replace(/\\/g, '/') - }) - // spawn-wrap adds itself to the path when coverage is enabled - actual = actual.filter(function (p) { - return !p.match(/\.node-spawn-wrap/) - }) - - // get the ones we tacked on, then the system-specific requirements - var expectedPaths = ['{{ROOT}}/node_modules/npm-lifecycle/node-gyp-bin', - '{{PKG}}/node_modules/.bin'] - - // Check that the behaviour matches the configuration that was actually - // used by the child process, as the coverage tooling may set the - // --scripts-prepend-node-path option on its own. - var realPrependNodePathSetting = stdout.filter(function (line) { - return line.match(/npm_config_scripts_prepend_node_path=(true|auto)/) - }).length > 0 - - if (prependNodePathSetting === 'warn-only') { - if (symlinkedNode) { - t.equal(stderr, '', 'does not spit out a warning') - } else if (withDirOfCurrentNode) { - t.match(stderr, /npm WARN lifecycle/, 'spit out a warning') - t.match(stderr, /npm is using .*node-bin.my_bundled_node(.exe)?/, 'mention the path of the binary npm itself is using.') - if (extraNode) { - var regex = new RegExp( - 'The node binary used for scripts is.*' + - process.execPath.replace(/[/\\]/g, '.')) - t.match(stderr, regex, 'reports the current binary vs conflicting') - } else if (systemNode !== null) { - var regexSystemNode = new RegExp( - 'The node binary used for scripts is.*' + - systemNode.replace(/[/\\]/g, '.') - ) - t.match(stderr, regexSystemNode, 'reports the system binary vs conflicting') - } else { - t.match(stderr, /there is no node binary in the current PATH/, 'informs user that there is no node binary in PATH') - } - } else { - t.same(stderr, '') - } - } - - if (withDirOfCurrentNode && realPrependNodePathSetting) { - expectedPaths.push('{{PKG}}/node-bin/my_bundled_node') - } - var expect = expectedPaths.concat(newPATH.split(pathSplit)).map(function (p) { - return p.replace(/\\/g, '/') - }) - t.same(actual, expect) - t.end() - }) -} diff --git a/deps/npm/test/tap/link.js b/deps/npm/test/tap/link.js deleted file mode 100644 index 2d2d63de214156..00000000000000 --- a/deps/npm/test/tap/link.js +++ /dev/null @@ -1,205 +0,0 @@ -var mkdirp = require('mkdirp') -var path = require('path') -var test = require('tap').test -var lstatSync = require('fs').lstatSync -var writeFileSync = require('fs').writeFileSync - -var common = require('../common-tap.js') - -var link = path.join(common.pkg, 'link') -var linkScoped = path.join(common.pkg, 'link-scoped') -var linkInstall = path.join(common.pkg, 'link-install') -var linkInside = path.join(linkInstall, 'node_modules', 'inside') -var linkRoot = path.join(common.pkg, 'link-root') - -var config = 'prefix = ' + linkRoot -var configPath = path.join(link, '_npmrc') - -var OPTS = { - env: { - 'npm_config_userconfig': configPath - } -} - -var readJSON = { - name: 'foo', - version: '1.0.0', - description: '', - main: 'index.js', - scripts: { - test: 'echo "Error: no test specified" && exit 1' - }, - author: '', - license: 'ISC' -} - -var readScopedJSON = { - name: '@scope/foo', - version: '1.0.0', - description: '', - main: 'index.js', - scripts: { - test: 'echo "Error: no test specified" && exit 1' - }, - author: '', - license: 'ISC' -} - -var installJSON = { - name: 'bar', - version: '1.0.0', - description: '', - main: 'index.js', - scripts: { - test: 'echo "Error: no test specified" && exit 1' - }, - author: '', - license: 'ISC' -} - -var insideInstallJSON = { - name: 'inside', - version: '1.0.0', - description: '', - main: 'index.js', - scripts: { - test: 'echo "Error: no test specified" && exit 1' - }, - author: '', - license: 'ISC' -} - -test('setup', function (t) { - mkdirp.sync(linkRoot) - mkdirp.sync(link) - writeFileSync( - path.join(link, 'package.json'), - JSON.stringify(readJSON, null, 2) - ) - mkdirp.sync(linkScoped) - writeFileSync( - path.join(linkScoped, 'package.json'), - JSON.stringify(readScopedJSON, null, 2) - ) - mkdirp.sync(linkInstall) - writeFileSync( - path.join(linkInstall, 'package.json'), - JSON.stringify(installJSON, null, 2) - ) - mkdirp.sync(linkInside) - writeFileSync( - path.join(linkInside, 'package.json'), - JSON.stringify(insideInstallJSON, null, 2) - ) - writeFileSync(configPath, config) - common.npm(['ls', '-g', '--depth=0'], OPTS, function (err, c, out) { - t.ifError(err) - t.equal(c, 0, 'set up ok') - t.notOk(out.match(/UNMET DEPENDENCY foo@/), "foo isn't in global") - t.end() - }) -}) - -test('create global link', function (t) { - process.chdir(link) - common.npm(['link'], OPTS, function (err, c, out) { - t.ifError(err, 'link has no error') - common.npm(['ls', '-g'], OPTS, function (err, c, out, stderr) { - t.ifError(err) - t.equal(c, 0) - t.equal(stderr, '', 'got expected stderr') - t.has(out, /foo@1.0.0/, 'creates global link ok') - t.end() - }) - }) -}) - -test('create global inside link', function (t) { - process.chdir(linkInside) - common.npm(['link'], OPTS, function (err, c, out) { - t.ifError(err, 'link has no error') - common.npm(['ls', '-g'], OPTS, function (err, c, out, stderr) { - t.ifError(err) - t.equal(c, 0) - t.equal(stderr, '', 'got expected stderr') - t.has(out, /inside@1.0.0/, 'creates global inside link ok') - t.end() - }) - }) -}) - -test('create scoped global link', function (t) { - process.chdir(linkScoped) - common.npm(['link'], OPTS, function (err, c, out) { - t.ifError(err, 'link has no error') - common.npm(['ls', '-g'], OPTS, function (err, c, out, stderr) { - t.ifError(err) - t.equal(c, 0) - t.equal(stderr, '', 'got expected stderr') - t.has(out, /@scope[/]foo@1.0.0/, 'creates global link ok') - t.end() - }) - }) -}) - -test('link-install the package', function (t) { - process.chdir(linkInstall) - common.npm(['link', 'foo'], OPTS, function (err) { - t.ifError(err, 'link-install has no error') - common.npm(['ls'], OPTS, function (err, c, out) { - t.ifError(err) - t.equal(c, 1) - t.has(out, /foo@1.0.0/, 'link-install ok') - t.end() - }) - }) -}) - -test('link-inside-install fails', function (t) { - process.chdir(linkInstall) - t.notOk(lstatSync(linkInside).isSymbolicLink(), 'directory for linked package is not a symlink to begin with') - common.npm(['link', 'inside'], OPTS, function (err, code) { - t.ifError(err, 'npm removed the linked package without error') - t.notEqual(code, 0, 'link operation failed') - t.notOk(lstatSync(linkInside).isSymbolicLink(), 'directory for linked package has not turned into a symlink') - t.end() - }) -}) - -test('link-install the scoped package', function (t) { - process.chdir(linkInstall) - common.npm(['link', linkScoped], OPTS, function (err) { - t.ifError(err, 'link-install has no error') - common.npm(['ls'], OPTS, function (err, c, out) { - t.ifError(err) - t.equal(c, 1) - t.has(out, /@scope[/]foo@1.0.0/, 'link-install ok') - t.end() - }) - }) -}) - -test('ls the linked packages', function (t) { - process.chdir(linkInstall) - common.npm(['ls', '--link'], OPTS, function (err, c, out) { - t.ifError(err, 'ls --link did not have an error') - t.equal(c, 1) - t.has(out, /@scope\/foo@1\.0\.0 ->/, 'output contains scoped link') - t.has(out, /foo@1\.0\.0 ->/, 'output contains link') - t.doesNotHave(out, /inside@1\.0\.0/, 'output does not contain unlinked dependency') - t.end() - }) -}) - -test('cleanup', function (t) { - process.chdir(common.pkg) - common.npm(['rm', 'foo'], OPTS, function (err, code) { - t.ifError(err, 'npm removed the linked package without error') - t.equal(code, 0, 'cleanup foo in local ok') - common.npm(['rm', '-g', 'foo'], OPTS, function (err, code) { - t.ifError(err, 'npm removed the global package without error') - t.equal(code, 0, 'cleanup foo in global ok') - t.end() - }) - }) -}) diff --git a/deps/npm/test/tap/local-args-relative-to-cwd.js b/deps/npm/test/tap/local-args-relative-to-cwd.js deleted file mode 100644 index de95516e2893ed..00000000000000 --- a/deps/npm/test/tap/local-args-relative-to-cwd.js +++ /dev/null @@ -1,65 +0,0 @@ -'use strict' -var fs = require('graceful-fs') -var path = require('path') -var test = require('tap').test -var Tacks = require('tacks') -var File = Tacks.File -var Dir = Tacks.Dir -var common = require('../common-tap.js') -var testdir = common.pkg - -var fixture = new Tacks( - Dir({ - example: Dir({ - }), - mod1: Dir({ - 'package.json': File({ - name: 'mod1', - version: '1.0.0' - }) - }), - node_modules: Dir({ - }) - }) -) - -function setup () { - fixture.create(testdir) -} - -function cleanup () { - fixture.remove(testdir) -} - -test('setup', function (t) { - cleanup() - setup() - t.end() -}) - -function exists (file) { - try { - fs.statSync(file) - return true - } catch (ex) { - return false - } -} - -test('local-args-relative-to-cwd', function (t) { - var instdir = path.join(testdir, 'example') - var config = ['--loglevel=error'] - common.npm(config.concat(['install', '../mod1']), {cwd: instdir}, function (err, code, stdout, stderr) { - if (err) throw err - t.comment(stdout.trim()) - t.comment(stderr.trim()) - t.is(code, 0, 'install ran ok') - t.ok(exists(path.join(testdir, 'node_modules', 'mod1')), 'mod1 installed') - t.end() - }) -}) - -test('cleanup', function (t) { - cleanup() - t.end() -}) diff --git a/deps/npm/test/tap/locker.js b/deps/npm/test/tap/locker.js deleted file mode 100644 index 1df6fda7102dce..00000000000000 --- a/deps/npm/test/tap/locker.js +++ /dev/null @@ -1,77 +0,0 @@ -var test = require('tap').test -var path = require('path') -var fs = require('graceful-fs') -var crypto = require('crypto') -var mkdirp = require('mkdirp') -var npm = require('../../') -var locker = require('../../lib/utils/locker.js') -var lock = locker.lock -var unlock = locker.unlock - -const common = require('../common-tap.js') -var pkg = common.pkg -var cache = path.join(pkg, '/cache') -var tmp = path.join(pkg, '/tmp') -var nm = path.join(pkg, '/node_modules') - -test('setup', function (t) { - mkdirp.sync(cache) - mkdirp.sync(tmp) - t.end() -}) - -test('locking file puts lock in correct place', function (t) { - npm.load({cache: cache, tmpdir: tmp}, function (er) { - t.ifError(er, 'npm bootstrapped OK') - - var n = 'correct' - var c = n.replace(/[^a-zA-Z0-9]+/g, '-').replace(/^-+|-+$/g, '') - var p = path.resolve(nm, n) - var h = crypto.createHash('sha1').update(p).digest('hex') - var l = c.substr(0, 24) + '-' + h.substr(0, 16) + '.lock' - var v = path.join(cache, '_locks', l) - - lock(nm, n, function (er) { - t.ifError(er, 'locked path') - - fs.exists(v, function (found) { - t.ok(found, 'lock found OK') - - unlock(nm, n, function (er) { - t.ifError(er, 'unlocked path') - - fs.exists(v, function (found) { - t.notOk(found, 'lock deleted OK') - t.end() - }) - }) - }) - }) - }) -}) - -test('unlocking out of order errors out', function (t) { - npm.load({cache: cache, tmpdir: tmp}, function (er) { - t.ifError(er, 'npm bootstrapped OK') - - var n = 'busted' - var c = n.replace(/[^a-zA-Z0-9]+/g, '-').replace(/^-+|-+$/g, '') - var p = path.resolve(nm, n) - var h = crypto.createHash('sha1').update(p).digest('hex') - var l = c.substr(0, 24) + '-' + h.substr(0, 16) + '.lock' - var v = path.join(cache, '_locks', l) - - fs.exists(v, function (found) { - t.notOk(found, 'no lock to unlock') - - t.throws(function () { - unlock(nm, n, function () { - t.fail("shouldn't get here") - t.end() - }) - }, 'blew up as expected') - - t.end() - }) - }) -}) diff --git a/deps/npm/test/tap/lockfile-empty-dep-value.js b/deps/npm/test/tap/lockfile-empty-dep-value.js deleted file mode 100644 index 1e30889fcb5225..00000000000000 --- a/deps/npm/test/tap/lockfile-empty-dep-value.js +++ /dev/null @@ -1,68 +0,0 @@ -'use strict' - -const common = require('../common-tap.js') -const path = require('path') -const test = require('tap').test - -const Tacks = require('tacks') -const File = Tacks.File -const Dir = Tacks.Dir - -const basedir = common.pkg -const testdir = path.join(basedir, 'testdir') - -const fixture = new Tacks(Dir({ - cache: Dir(), - global: Dir(), - tmp: Dir(), - testdir: Dir({ - 'package-lock.json': File({ - name: 'http-locks', - version: '1.0.0', - lockfileVersion: 1, - requires: true, - dependencies: { - minimist: {} - } - }), - 'package.json': File({ - name: 'http-locks', - version: '1.0.0', - dependencies: { - minimist: common.registry + '/minimist/-/minimist-0.0.5.tgz' - } - }) - }) -})) - -function setup () { - cleanup() - fixture.create(basedir) -} - -function cleanup () { - fixture.remove(basedir) -} - -test('setup', function (t) { - setup() - t.done() -}) - -test('raises error to regenerate the lock file', function (t) { - common.npm(['install'], {cwd: testdir}, function (err, code, stdout, stderr) { - if (err) throw err - t.match( - stderr, - 'npm ERR! Something went wrong. Regenerate the package-lock.json with "npm install".', - 'returns message to regenerate package-lock' - ) - - t.done() - }) -}) - -test('cleanup', function (t) { - cleanup() - t.done() -}) diff --git a/deps/npm/test/tap/lockfile-http-deps.js b/deps/npm/test/tap/lockfile-http-deps.js deleted file mode 100644 index b5eaa10760a434..00000000000000 --- a/deps/npm/test/tap/lockfile-http-deps.js +++ /dev/null @@ -1,90 +0,0 @@ -'use strict' -const fs = require('fs') -var path = require('path') -var test = require('tap').test -var mr = require('npm-registry-mock') -var Tacks = require('tacks') -var File = Tacks.File -var Dir = Tacks.Dir -var common = require('../common-tap.js') - -var basedir = common.pkg -var testdir = path.join(basedir, 'testdir') -var cachedir = common.cache -var globaldir = path.join(basedir, 'global') -var tmpdir = path.join(basedir, 'tmp') - -var conf = { - cwd: testdir, - env: Object.assign({}, process.env, { - npm_config_cache: cachedir, - npm_config_tmp: tmpdir, - npm_config_prefix: globaldir, - npm_config_registry: common.registry, - npm_config_loglevel: 'warn' - }) -} - -var server -var fixture = new Tacks(Dir({ - cache: Dir(), - global: Dir(), - tmp: Dir(), - testdir: Dir({ - 'package-lock.json': File({ - name: 'http-locks', - version: '1.0.0', - lockfileVersion: 1, - requires: true, - dependencies: { - minimist: { - version: common.registry + '/minimist/-/minimist-0.0.5.tgz', - integrity: 'sha1-16oye87PUY+RBqxrjwA/o7zqhWY=' - } - } - }), - 'package.json': File({ - name: 'http-locks', - version: '1.0.0', - dependencies: { - minimist: common.registry + '/minimist/-/minimist-0.0.5.tgz' - } - }) - }) -})) - -function setup () { - cleanup() - fixture.create(basedir) -} - -function cleanup () { - fixture.remove(basedir) -} - -test('setup', function (t) { - setup() - mr({port: common.port, throwOnUnmatched: true}, function (err, s) { - if (err) throw err - server = s - t.done() - }) -}) - -test('http deps in lock files', function (t) { - common.npm(['install'], conf, function (err, code, stdout, stderr) { - if (err) throw err - t.is(code, 0, 'command ran ok') - t.comment(stdout.trim()) - t.comment(stderr.trim()) - const minPackage = JSON.parse(fs.readFileSync(testdir + '/node_modules/minimist/package.json')) - t.is(minPackage.version, '0.0.5', 'package version was maintained') - t.done() - }) -}) - -test('cleanup', function (t) { - server.close() - cleanup() - t.done() -}) diff --git a/deps/npm/test/tap/logout-scoped.js b/deps/npm/test/tap/logout-scoped.js deleted file mode 100644 index 114cc09da73822..00000000000000 --- a/deps/npm/test/tap/logout-scoped.js +++ /dev/null @@ -1,69 +0,0 @@ -var fs = require('fs') -var path = require('path') - -var mkdirp = require('mkdirp') -var mr = require('npm-registry-mock') -var rimraf = require('rimraf') -var test = require('tap').test - -var common = require('../common-tap.js') - -var pkg = common.pkg -var outfile = path.join(pkg, '_npmrc') -var opts = { cwd: pkg } - -var contents = `foo=boo -@bar:registry=http://localhost:${common.port} -//localhost:${common.port}/:_authToken=glarb -` - -function mocks (server) { - server.delete('/-/user/token/glarb') - .reply(200, {}) -} - -test('setup', function (t) { - cleanup() - setup() - t.end() -}) - -test('npm logout', function (t) { - mr({ port: common.port, plugin: mocks }, function (err, s) { - if (err) throw err - - common.npm( - [ - 'logout', - '--registry', common.registry, - '--scope', '@bar', - '--loglevel', 'silent', - '--userconfig', outfile - ], - opts, - function (err, code) { - t.ifError(err, 'no error output') - t.notOk(code, 'exited OK') - - var config = fs.readFileSync(outfile, 'utf8') - t.equal(config.trim(), 'foo=boo', 'creds gone') - s.close() - t.end() - } - ) - }) -}) - -test('cleanup', function (t) { - cleanup() - t.end() -}) - -function setup () { - mkdirp.sync(pkg) - fs.writeFileSync(outfile, contents) -} - -function cleanup () { - rimraf.sync(pkg) -} diff --git a/deps/npm/test/tap/logout.js b/deps/npm/test/tap/logout.js deleted file mode 100644 index 9218b4bf6f1ca8..00000000000000 --- a/deps/npm/test/tap/logout.js +++ /dev/null @@ -1,67 +0,0 @@ -var fs = require('fs') -var path = require('path') - -var mkdirp = require('mkdirp') -var mr = require('npm-registry-mock') -var rimraf = require('rimraf') -var test = require('tap').test - -var common = require('../common-tap.js') - -var pkg = common.pkg -var outfile = path.join(pkg, '_npmrc') -var opts = { cwd: pkg } - -var contents = `foo=boo -//localhost:${common.port}/:_authToken=glarb -` - -function mocks (server) { - server.delete('/-/user/token/glarb') - .reply(200, {}) -} - -test('setup', function (t) { - cleanup() - setup() - t.end() -}) - -test('npm logout', function (t) { - mr({ port: common.port, plugin: mocks }, function (err, s) { - if (err) throw err - - common.npm( - [ - 'logout', - '--registry', common.registry, - '--loglevel', 'silent', - '--userconfig', outfile - ], - opts, - function (err, code) { - t.ifError(err, 'no error output') - t.notOk(code, 'exited OK') - - var config = fs.readFileSync(outfile, 'utf8') - t.notMatch(config, /localhost/, 'creds gone') - s.close() - t.end() - } - ) - }) -}) - -test('cleanup', function (t) { - cleanup() - t.end() -}) - -function setup () { - mkdirp.sync(pkg) - fs.writeFileSync(outfile, contents) -} - -function cleanup () { - rimraf.sync(pkg) -} diff --git a/deps/npm/test/tap/ls-depth-cli.js b/deps/npm/test/tap/ls-depth-cli.js deleted file mode 100644 index 55142b3ad167b2..00000000000000 --- a/deps/npm/test/tap/ls-depth-cli.js +++ /dev/null @@ -1,196 +0,0 @@ -var fs = require('graceful-fs') -var path = require('path') - -var Bluebird = require('bluebird') -var mr = Bluebird.promisify(require('npm-registry-mock')) -var test = require('tap').test - -var common = require('../common-tap') - -var pkg = common.pkg - -var EXEC_OPTS = { - cwd: pkg, - env: common.newEnv().extend({ - npm_config_registry: common.registry - }), - stdio: [0, 'pipe', 2] -} - -var json = { - name: 'ls-depth-cli', - version: '0.0.0', - dependencies: { - 'test-package-with-one-dep': '0.0.0' - } -} - -test('setup', function (t) { - fs.writeFileSync( - path.join(pkg, 'package.json'), - JSON.stringify(json, null, 2) - ) - return mr({ port: common.port }).then((s) => { - return common.npm(['install'], EXEC_OPTS).spread((c) => { - t.is(c, 0) - }).finally(() => s.close()) - }) -}) - -test('npm ls --depth=0', function (t) { - return common.npm(['ls', '--depth=0'], EXEC_OPTS).spread((c, out) => { - t.equal(c, 0, 'ls ran without raising error code') - t.has( - out, - /test-package-with-one-dep@0\.0\.0/, - 'output contains test-package-with-one-dep@0.0.0' - ) - t.doesNotHave( - out, - /test-package@0\.0\.0/, - 'output not contains test-package@0.0.0' - ) - }) -}) - -test('npm ls --depth=1', function (t) { - common.npm( - ['ls', '--depth=1'], - EXEC_OPTS, - function (er, c, out) { - t.ifError(er, 'npm ls ran without issue') - t.equal(c, 0, 'ls ran without raising error code') - t.has( - out, - /test-package-with-one-dep@0\.0\.0/, - 'output contains test-package-with-one-dep@0.0.0' - ) - t.has( - out, - /test-package@0\.0\.0/, - 'output contains test-package@0.0.0' - ) - t.end() - } - ) -}) - -test('npm ls --depth=Infinity', function (t) { - // travis has a preconfigured depth=0, in general we can not depend - // on the default value in all environments, so explicitly set it here - common.npm( - ['ls', '--depth=Infinity'], - EXEC_OPTS, - function (er, c, out) { - t.ifError(er, 'npm ls ran without issue') - t.equal(c, 0, 'ls ran without raising error code') - t.has( - out, - /test-package-with-one-dep@0\.0\.0/, - 'output contains test-package-with-one-dep@0.0.0' - ) - t.has( - out, - /test-package@0\.0\.0/, - 'output contains test-package@0.0.0' - ) - t.end() - } - ) -}) - -test('npm ls --depth=0 --json', function (t) { - common.npm( - ['ls', '--depth=0', '--json'], - EXEC_OPTS, - function (er, c, out) { - t.ifError(er, 'npm ls ran without issue') - t.equal(c, 0, 'ls ran without raising error code') - t.has(JSON.parse(out), { - 'name': 'ls-depth-cli', - 'version': '0.0.0', - 'dependencies': { - 'test-package-with-one-dep': { - 'version': '0.0.0', - 'resolved': 'http://localhost:' + common.port + '/test-package-with-one-dep/-/test-package-with-one-dep-0.0.0.tgz' - } - } - }) - t.end() - } - ) -}) - -test('npm ls --depth=Infinity --json', function (t) { - // travis has a preconfigured depth=0, in general we can not depend - // on the default value in all environments, so explicitly set it here - common.npm( - ['ls', '--depth=Infinity', '--json'], - EXEC_OPTS, - function (er, c, out) { - t.ifError(er, 'npm ls ran without issue') - t.equal(c, 0, 'ls ran without raising error code') - t.has(JSON.parse(out), { - 'name': 'ls-depth-cli', - 'version': '0.0.0', - 'dependencies': { - 'test-package-with-one-dep': { - 'version': '0.0.0', - 'resolved': 'http://localhost:' + common.port + '/test-package-with-one-dep/-/test-package-with-one-dep-0.0.0.tgz', - 'dependencies': { - 'test-package': { - 'version': '0.0.0', - 'resolved': 'http://localhost:' + common.port + '/test-package/-/test-package-0.0.0.tgz' - } - } - } - } - }) - t.end() - } - ) -}) - -test('npm ls --depth=0 --parseable --long', function (t) { - common.npm( - ['ls', '--depth=0', '--parseable', '--long'], - EXEC_OPTS, - function (er, c, out) { - t.ifError(er, 'npm ls ran without issue') - t.equal(c, 0, 'ls ran without raising error code') - t.has( - out, - /.*test-package-with-one-dep@0\.0\.0/, - 'output contains test-package-with-one-dep' - ) - t.doesNotHave( - out, - /.*test-package@0\.0\.0/, - 'output not contains test-package' - ) - t.end() - } - ) -}) - -test('npm ls --depth=1 --parseable --long', function (t) { - common.npm( - ['ls', '--depth=1', '--parseable', '--long'], - EXEC_OPTS, - function (er, c, out) { - t.ifError(er, 'npm ls ran without issue') - t.equal(c, 0, 'ls ran without raising error code') - t.has( - out, - /.*test-package-with-one-dep@0\.0\.0/, - 'output contains test-package-with-one-dep' - ) - t.has( - out, - /.*test-package@0\.0\.0/, - 'output not contains test-package' - ) - t.end() - } - ) -}) diff --git a/deps/npm/test/tap/ls-depth-unmet.js b/deps/npm/test/tap/ls-depth-unmet.js deleted file mode 100644 index bf032efe9c9aa0..00000000000000 --- a/deps/npm/test/tap/ls-depth-unmet.js +++ /dev/null @@ -1,157 +0,0 @@ -var fs = require('graceful-fs') -var path = require('path') - -var mr = require('npm-registry-mock') -var test = require('tap').test - -var common = require('../common-tap') - -var pkg = common.pkg - -var EXEC_OPTS = { cwd: pkg } - -var json = { - name: 'ls-depth-umnet', - author: 'Evan You', - version: '0.0.0', - dependencies: { - 'test-package-with-one-dep': '0.0.0', - underscore: '1.5.1', - optimist: '0.6.0' - } -} - -test('setup', function (t) { - fs.writeFileSync( - path.join(pkg, 'package.json'), - JSON.stringify(json, null, 2) - ) - mr({ port: common.port }, function (er, s) { - common.npm( - [ - '--registry', common.registry, - 'install', '--no-save', 'underscore@1.3.1', 'mkdirp', 'test-package-with-one-dep' - ], - EXEC_OPTS, - function (er, c) { - t.ifError(er, 'setup installation ran without issue') - t.equal(c, 0) - s.close() - t.end() - } - ) - }) -}) - -test('npm ls --depth=0', function (t) { - common.npm( - ['ls', '--depth=0'], - EXEC_OPTS, - function (er, c, out) { - t.ifError(er, 'setup installation ran without issue') - t.equal(c, 1, 'ls barfed') - t.has( - out, - /UNMET DEPENDENCY optimist@0\.6\.0/, - 'output contains optimist@0.6.0 and labeled as unmet dependency' - ) - t.has( - out, - /mkdirp@0\.3\.5 extraneous/, - 'output contains mkdirp@0.3.5 and labeled as extraneous' - ) - t.has( - out, - /underscore@1\.3\.1 invalid/, - 'output contains underscore@1.3.1 and labeled as invalid' - ) - t.has( - out, - /test-package-with-one-dep@0\.0\.0\n/, - 'output contains test-package-with-one-dep@0.0.0 and has no labels' - ) - t.doesNotHave( - out, - /test-package@0\.0\.0/, - 'output does not contain test-package@0.0.0 which is at depth=1' - ) - t.end() - } - ) -}) - -test('npm ls --depth=1', function (t) { - common.npm( - ['ls', '--depth=1'], - EXEC_OPTS, - function (er, c, out) { - t.ifError(er, 'setup installation ran without issue') - t.equal(c, 1, 'ls barfed') - t.has( - out, - /UNMET DEPENDENCY optimist@0\.6\.0/, - 'output contains optimist@0.6.0 and labeled as unmet dependency' - ) - t.has( - out, - /mkdirp@0\.3\.5 extraneous/, - 'output contains mkdirp@0.3.5 and labeled as extraneous' - ) - t.has( - out, - /underscore@1\.3\.1 invalid/, - 'output contains underscore@1.3.1 and labeled as invalid' - ) - t.has( - out, - /test-package-with-one-dep@0\.0\.0\n/, - 'output contains test-package-with-one-dep@0.0.0 and has no labels' - ) - t.has( - out, - /test-package@0\.0\.0/, - 'output contains test-package@0.0.0 which is at depth=1' - ) - t.end() - } - ) -}) - -test('npm ls --depth=Infinity', function (t) { - // travis has a preconfigured depth=0, in general we can not depend - // on the default value in all environments, so explicitly set it here - common.npm( - ['ls', '--depth=Infinity'], - EXEC_OPTS, - function (er, c, out) { - t.ifError(er, 'setup installation ran without issue') - t.equal(c, 1, 'ls barfed') - t.has( - out, - /UNMET DEPENDENCY optimist@0\.6\.0/, - 'output contains optimist@0.6.0 and labeled as unmet dependency' - ) - t.has( - out, - /mkdirp@0\.3\.5 extraneous/, - 'output contains mkdirp@0.3.5 and labeled as extraneous' - ) - t.has( - out, - /underscore@1\.3\.1 invalid/, - 'output contains underscore@1.3.1 and labeled as invalid' - ) - t.has( - out, - /test-package-with-one-dep@0\.0\.0\n/, - 'output contains test-package-with-one-dep@0.0.0 and has no labels' - ) - t.has( - out, - /test-package@0\.0\.0/, - 'output contains test-package@0.0.0 which is at depth=1' - ) - t.end() - } - ) -}) diff --git a/deps/npm/test/tap/ls-env.js b/deps/npm/test/tap/ls-env.js deleted file mode 100644 index 5d9d7cd06b2cf6..00000000000000 --- a/deps/npm/test/tap/ls-env.js +++ /dev/null @@ -1,120 +0,0 @@ -var fs = require('graceful-fs') -var path = require('path') - -var mr = require('npm-registry-mock') -var test = require('tap').test - -var common = require('../common-tap') - -var pkg = common.pkg - -var EXEC_OPTS = { cwd: pkg } - -var json = { - name: 'ls-env', - version: '0.0.0', - dependencies: { - 'test-package-with-one-dep': '0.0.0' - } -} - -test('setup', function (t) { - fs.writeFileSync( - path.join(pkg, 'package.json'), - JSON.stringify(json, null, 2) - ) - mr({port: common.port}, function (er, s) { - common.npm( - [ - '--registry', common.registry, - 'install' - ], - EXEC_OPTS, - function (er, c) { - t.ifError(er, 'install ran without issue') - t.equal(c, 0) - s.close() - t.end() - } - ) - }) -}) - -test('npm ls --dev', function (t) { - common.npm(['ls', '--dev'], EXEC_OPTS, function (er, code, stdout) { - t.ifError(er, 'ls --dev ran without issue') - t.equal(code, 0) - t.has(stdout, /(empty)/, 'output contains (empty)') - t.end() - }) -}) - -test('npm ls --only=development', function (t) { - common.npm(['ls', '--only=development'], EXEC_OPTS, function (er, code, stdout) { - t.ifError(er, 'ls --only=development ran without issue') - t.equal(code, 0) - t.has(stdout, /(empty)/, 'output contains (empty)') - t.end() - }) -}) - -test('npm ls --only=dev', function (t) { - common.npm(['ls', '--only=dev'], EXEC_OPTS, function (er, code, stdout) { - t.ifError(er, 'ls --only=dev ran without issue') - t.equal(code, 0) - t.has(stdout, /(empty)/, 'output contains (empty)') - t.end() - }) -}) - -test('npm ls --production', function (t) { - common.npm(['ls', '--production'], EXEC_OPTS, function (er, code, stdout) { - t.ifError(er, 'ls --production ran without issue') - t.notOk(code, 'npm exited ok') - t.has( - stdout, - /test-package-with-one-dep@0\.0\.0/, - 'output contains test-package-with-one-dep@0.0.0' - ) - t.end() - }) -}) - -test('npm ls --prod', function (t) { - common.npm(['ls', '--prod'], EXEC_OPTS, function (er, code, stdout) { - t.ifError(er, 'ls --prod ran without issue') - t.notOk(code, 'npm exited ok') - t.has( - stdout, - /test-package-with-one-dep@0\.0\.0/, - 'output contains test-package-with-one-dep@0.0.0' - ) - t.end() - }) -}) - -test('npm ls --only=production', function (t) { - common.npm(['ls', '--only=production'], EXEC_OPTS, function (er, code, stdout) { - t.ifError(er, 'ls --only=production ran without issue') - t.notOk(code, 'npm exited ok') - t.has( - stdout, - /test-package-with-one-dep@0\.0\.0/, - 'output contains test-package-with-one-dep@0.0.0' - ) - t.end() - }) -}) - -test('npm ls --only=prod', function (t) { - common.npm(['ls', '--only=prod'], EXEC_OPTS, function (er, code, stdout) { - t.ifError(er, 'ls --only=prod ran without issue') - t.notOk(code, 'npm exited ok') - t.has( - stdout, - /test-package-with-one-dep@0\.0\.0/, - 'output contains test-package-with-one-dep@0.0.0' - ) - t.end() - }) -}) diff --git a/deps/npm/test/tap/ls-l-depth-0.js b/deps/npm/test/tap/ls-l-depth-0.js deleted file mode 100644 index 8e707a1d399b5f..00000000000000 --- a/deps/npm/test/tap/ls-l-depth-0.js +++ /dev/null @@ -1,100 +0,0 @@ -var writeFileSync = require('graceful-fs').writeFileSync -var resolve = require('path').resolve - -var mkdirp = require('mkdirp') -var Bluebird = require('bluebird') -var mr = Bluebird.promisify(require('npm-registry-mock')) -var test = require('tap').test -var common = require('../common-tap.js') - -var pkg = common.pkg -var dep = resolve(pkg, 'deps', 'glock') -var modules = resolve(pkg, 'node_modules') - -var expected = - '\n' + - '│ ' + pkg + '\n' + - '│ \n' + - '└── glock@1.8.7\n' + - ' an inexplicably hostile sample package\n' + - ' git+https://github.com/npm/glo.ck.git\n' + - ' https://glo.ck\n' + - ' file:glock-1.8.7.tgz\n' + - '\n' - -var EXEC_OPTS = { cwd: pkg } - -var fixture = { - 'name': 'glock', - 'version': '1.8.7', - 'private': true, - 'description': 'an inexplicably hostile sample package', - 'homepage': 'https://glo.ck', - 'repository': 'https://github.com/npm/glo.ck', - 'dependencies': { - 'underscore': '1.5.1' - } -} - -var deppack - -test('setup', function (t) { - mkdirp.sync(modules) - mkdirp.sync(dep) - - writeFileSync(resolve(dep, 'package.json'), JSON.stringify(fixture)) - return mr({ port: common.port }).then((s) => { - t.parent.teardown(() => s.close()) - return common.npm(['pack', dep], EXEC_OPTS) - }).spread((code, stdout) => { - t.is(code, 0, 'pack') - deppack = stdout.trim() - }) -}) - -test('#6311: npm ll --depth=0 duplicates listing', function (t) { - common.npm( - [ - '--loglevel', 'silent', - '--registry', common.registry, - '--parseable', - 'install', deppack - ], - EXEC_OPTS, - function (err, code, stdout, stderr) { - if (err) throw err - t.notOk(code, 'npm install exited cleanly') - t.is(stderr, '', 'npm install ran silently') - t.match( - stdout.trim(), - new RegExp( - '^add\tunderscore\t1[.]5[.]1\tnode_modules[\\\\/]underscore\t\t[\n]' + - 'add\tglock\t1[.]8[.]7\tnode_modules[\\\\/]glock$' - ), - 'got expected install output' - ) - - common.npm( - [ - '--loglevel', 'silent', - 'ls', '--long', - '--unicode=true', - '--depth', '0' - ], - EXEC_OPTS, - function (err, code, stdout, stderr) { - if (err) throw err - t.is(code, 0, 'npm ll exited cleanly') - t.is(stderr, '', 'npm ll ran silently') - t.equal( - stdout, - expected, - 'got expected package name' - ) - - t.end() - } - ) - } - ) -}) diff --git a/deps/npm/test/tap/ls-no-results.js b/deps/npm/test/tap/ls-no-results.js deleted file mode 100644 index 9792774c69b296..00000000000000 --- a/deps/npm/test/tap/ls-no-results.js +++ /dev/null @@ -1,12 +0,0 @@ -var test = require('tap').test -var spawn = require('child_process').spawn -var node = process.execPath -var npm = require.resolve('../../') -var args = [ npm, 'ls', 'ceci n’est pas une package' ] -test('ls exits non-zero when nothing found', function (t) { - var child = spawn(node, args) - child.on('exit', function (code) { - t.notEqual(code, 0) - t.end() - }) -}) diff --git a/deps/npm/test/tap/ls-peer.js b/deps/npm/test/tap/ls-peer.js deleted file mode 100644 index 05cc1382250c1c..00000000000000 --- a/deps/npm/test/tap/ls-peer.js +++ /dev/null @@ -1,123 +0,0 @@ -'use strict' -const path = require('path') -const test = require('tap').test -const Tacks = require('tacks') -const File = Tacks.File -const Dir = Tacks.Dir -const common = require('../common-tap.js') - -const basedir = common.pkg -const testdir = path.join(basedir, 'testdir') -const cachedir = common.cache -const globaldir = path.join(basedir, 'global') -const tmpdir = path.join(basedir, 'tmp') - -const conf = { - cwd: testdir, - env: common.newEnv().extend({ - npm_config_cache: cachedir, - npm_config_tmp: tmpdir, - npm_config_prefix: globaldir, - npm_config_registry: common.registry, - npm_config_loglevel: 'warn' - }) -} - -const fixture = new Tacks(Dir({ - cache: Dir(), - global: Dir(), - tmp: Dir(), - testdir: Dir({ - 'package.json': File({ - name: 'fixture', - version: '1.0.0', - dependencies: { - dep: 'file:dep-1.0.0.tgz', - 'peer-dep': 'file:peer-dep-2.0.0.tgz' - } - }), - // Source dir - // dep: Dir({ - // 'package.json': File({ - // name: 'dep', - // version: '1.0.0', - // peerDependencies: { - // 'peer-dep': 'file:peer-dep-1.0.0.tgz' - // } - // }) - // }), - 'dep-1.0.0.tgz': File(Buffer.from( - '1f8b0800000000000003ed8f3d0ec2300c853be71451661a1cd166e8cc45' + - 'a2d654e1278d92c200eadd491a60ea462584946fb1f5fc9e655bd59e548f' + - '5b9b2a3ffac1142b0300b2aae8921e1152d062574b10424a08bed0d4d10f' + - '6b1fb2c4d58fca8553bedd937ea19ffa273c08a5cca80bb286b20e2ddb44' + - 'e186ceebc1444d70e090548be8f668d174685a8d3e8c63fc3529633a040e' + - 'fa8ccd5b28e7381ffb3b0bce894ce4d70f6732994c66e60975aec5690008' + - '0000', - 'hex' - )), - // Source dir - // 'peer-dep': Dir({ - // 'package.json': File({ - // name: 'peer-dep', - // version: '2.0.0' - // }) - // }), - 'peer-dep-1.0.0.tgz': File(Buffer.from( - '1f8b08000000000000032b484cce4e4c4fd52f80d07a59c5f9790c540606' + - '06066626260ad8c4c1c0d45c81c1d8d4ccc0d0d0cccc00a80ec830353500' + - 'd2d4760836505a5c925804740aa5e640bca200a78708a8e6525050ca4bcc' + - '4d55b252502a484d2dd24d492d50d2018996a5161567e6e781240cf50cf4' + - '0c94b86ab906dab9a360148c8251300aa80400c1c67f6300080000', - 'hex' - )), - 'peer-dep-2.0.0.tgz': File(Buffer.from( - '1f8b08000000000000032b484cce4e4c4fd52f80d07a59c5f9790c540606' + - '06066626260ad8c4c1c0d45c81c1d8d4ccc0d0d0cccc00a80ec830353500' + - 'd2d4760836505a5c925804740aa5e640bca200a78708a8e6525050ca4bcc' + - '4d55b252502a484d2dd24d492d50d2018996a5161567e6e781248cf40cf4' + - '0c94b86ab906dab9a360148c8251300aa80400cb30060800080000', - 'hex' - )) - }) -})) - -function setup () { - cleanup() - fixture.create(basedir) -} - -function cleanup () { - fixture.remove(basedir) -} - -test('setup', t => { - setup() - return common.fakeRegistry.listen().then(() => common.npm(['install'], conf)) -}) - -test('list warns about unmet peer dependency', t => { - return common.npm(['ls'], conf).then(([code, stdout, stderr]) => { - t.is(code, 1, 'command ran not ok') - t.comment(stdout.trim()) - t.comment(stderr.trim()) - t.match(stdout, 'UNMET PEER DEPENDENCY peer-dep@2.0.0') - t.match(stderr, 'npm ERR! peer dep missing: peer-dep@file:peer-dep-1.0.0.tgz, required by dep@1.0.0') - }) -}) - -test('list shows installed but unmet peer dependency', t => { - return common.npm(['ls', 'peer-dep'], conf).then(([code, stdout, stderr]) => { - t.is(code, 1, 'command ran not ok') - t.comment(stdout.trim()) - t.comment(stderr.trim()) - t.match(stdout, 'UNMET PEER DEPENDENCY peer-dep@2.0.0') - t.match(stderr, 'npm ERR! peer dep missing: peer-dep@file:peer-dep-1.0.0.tgz, required by dep@1.0.0') - }) -}) - -test('cleanup', t => { - common.fakeRegistry.close() - cleanup() - t.done() -}) diff --git a/deps/npm/test/tap/ls-production-and-dev.js b/deps/npm/test/tap/ls-production-and-dev.js deleted file mode 100644 index 5836c8fc137146..00000000000000 --- a/deps/npm/test/tap/ls-production-and-dev.js +++ /dev/null @@ -1,157 +0,0 @@ -var fs = require('graceful-fs') -var path = require('path') - -var mr = require('npm-registry-mock') -var test = require('tap').test - -var common = require('../common-tap') - -var pkg = common.pkg - -var EXEC_OPTS = { cwd: pkg } - -var json = { - name: 'ls-env', - version: '0.0.0', - dependencies: { - 'test-package-with-one-dep': '0.0.0', - 'test-repo-url-ssh': '0.0.1' - }, - devDependencies: { - 'test-package-with-one-dep': '0.0.0', - 'test-repo-url-https': '0.0.1' - } -} - -test('setup', function (t) { - fs.writeFileSync( - path.join(pkg, 'package.json'), - JSON.stringify(json, null, 2) - ) - mr({port: common.port}, function (er, s) { - common.npm( - [ - '--registry', common.registry, - 'install' - ], - EXEC_OPTS, - function (er, c) { - if (er) throw er - t.equal(c, 0, 'install ran without issue') - s.close() - t.end() - } - ) - }) -}) - -test('npm ls --dev', function (t) { - common.npm(['ls', '--dev'], EXEC_OPTS, function (er, code, stdout) { - if (er) throw er - t.equal(code, 0, 'ls --dev ran without issue') - t.has( - stdout, - /test-package-with-one-dep@0\.0\.0/, - 'output contains test-package-with-one-dep@0.0.0' - ) - t.has( - stdout, - /test-repo-url-https@0\.0\.1/, - 'output contains test-repo-url-https@0.0.1' - ) - t.doesNotHave( - stdout, - /test-repo-url-ssh@0\.0\.1/, - 'output does NOT contain test-repo-url-ssh@0.0.1' - ) - t.end() - }) -}) - -test('npm ls --only=development', function (t) { - common.npm(['ls', '--only=development'], EXEC_OPTS, function (er, code, stdout) { - if (er) throw er - t.equal(code, 0, 'ls --only=development ran without issue') - t.has( - stdout, - /test-package-with-one-dep@0\.0\.0/, - 'output contains test-package-with-one-dep@0.0.0' - ) - t.end() - }) -}) - -test('npm ls --only=dev', function (t) { - common.npm(['ls', '--only=dev'], EXEC_OPTS, function (er, code, stdout) { - if (er) throw er - t.equal(code, 0, 'ls --only=dev ran without issue') - t.has( - stdout, - /test-package-with-one-dep@0\.0\.0/, - 'output contains test-package-with-one-dep@0.0.0' - ) - t.end() - }) -}) - -test('npm ls --production', function (t) { - common.npm(['ls', '--production'], EXEC_OPTS, function (er, code, stdout) { - if (er) throw er - t.equal(code, 0, 'ls --production ran without issue') - t.has( - stdout, - /test-package-with-one-dep@0\.0\.0/, - 'output contains test-package-with-one-dep@0.0.0' - ) - t.has( - stdout, - /test-repo-url-ssh@0\.0\.1/, - 'output contains test-repo-url-ssh@0.0.1' - ) - t.doesNotHave( - stdout, - /test-repo-url-https@0\.0\.1/, - 'output does NOT contain test-repo-url-https@0.0.1' - ) - t.end() - }) -}) - -test('npm ls --prod', function (t) { - common.npm(['ls', '--prod'], EXEC_OPTS, function (er, code, stdout) { - if (er) throw er - t.equal(code, 0, 'ls --prod ran without issue') - t.has( - stdout, - /test-package-with-one-dep@0\.0\.0/, - 'output contains test-package-with-one-dep@0.0.0' - ) - t.end() - }) -}) - -test('npm ls --only=production', function (t) { - common.npm(['ls', '--only=production'], EXEC_OPTS, function (er, code, stdout) { - if (er) throw er - t.equal(code, 0, 'ls --only=production ran without issue') - t.has( - stdout, - /test-package-with-one-dep@0\.0\.0/, - 'output contains test-package-with-one-dep@0.0.0' - ) - t.end() - }) -}) - -test('npm ls --only=prod', function (t) { - common.npm(['ls', '--only=prod'], EXEC_OPTS, function (er, code, stdout) { - if (er) throw er - t.equal(code, 0, 'ls --only=prod ran without issue') - t.has( - stdout, - /test-package-with-one-dep@0\.0\.0/, - 'output contains test-package-with-one-dep@0.0.0' - ) - t.end() - }) -}) diff --git a/deps/npm/test/tap/ls-top-errors.js b/deps/npm/test/tap/ls-top-errors.js deleted file mode 100644 index 79a466fb127a49..00000000000000 --- a/deps/npm/test/tap/ls-top-errors.js +++ /dev/null @@ -1,71 +0,0 @@ -'use strict' -var fs = require('fs') -var path = require('path') - -var test = require('tap').test -var mkdirp = require('mkdirp') -var rimraf = require('rimraf') - -var common = require('../common-tap') - -var pkg = common.pkg -var pathModA = path.join(pkg, 'node_modules', 'moduleA') -var pathModB = path.join(pkg, 'node_modules', 'moduleB') - -var modA = { - name: 'moduleA', - version: '1.0.0', - _requiredBy: [ '#USER', '/moduleB' ], - dependencies: { - moduleB: '1.0.0' - } -} -var modB = { - name: 'moduleB', - version: '1.0.0', - _requiredBy: [ '/moduleA' ], - dependencies: { - moduleA: '1.0.0' - } -} - -function setup () { - mkdirp.sync(pkg) - fs.writeFileSync( - path.join(pkg, 'package.json'), - '{broken json' - ) - mkdirp.sync(pathModA) - fs.writeFileSync( - path.join(pathModA, 'package.json'), - JSON.stringify(modA, null, 2) - ) - mkdirp.sync(pathModB) - fs.writeFileSync( - path.join(pathModB, 'package.json'), - JSON.stringify(modB, null, 2) - ) -} - -function cleanup () { - rimraf.sync(pkg) -} - -test('setup', function (t) { - cleanup() - setup() - t.end() -}) - -test('ls-top-errors', function (t) { - common.npm(['ls'], {cwd: pkg}, function (er, code, stdout, stderr) { - t.ifErr(er, 'install finished successfully') - t.match(stderr, /Failed to parse json/) - t.end() - }) -}) - -test('cleanup', function (t) { - cleanup() - t.end() -}) diff --git a/deps/npm/test/tap/ls.js b/deps/npm/test/tap/ls.js deleted file mode 100644 index 9dd3779b3d170b..00000000000000 --- a/deps/npm/test/tap/ls.js +++ /dev/null @@ -1,222 +0,0 @@ -'use strict' -var test = require('tap').test -var path = require('path') -var rimraf = require('rimraf') -var common = require('../common-tap.js') -var basepath = common.pkg -var fixturepath = path.resolve(basepath, 'npm-test-files') -var pkgpath = path.resolve(fixturepath, 'npm-test-ls') -var Tacks = require('tacks') -var File = Tacks.File -var Dir = Tacks.Dir - -test('ls without arg', function (t) { - var fixture = new Tacks( - Dir({ - 'npm-test-ls': Dir({ - 'package.json': File({ - name: 'npm-test-ls', - version: '1.0.0', - dependencies: { - 'dep': 'file:../dep' - } - }) - }), - 'dep': Dir({ - 'package.json': File({ - name: 'dep', - version: '1.0.0' - }) - }) - }) - ) - withFixture(t, fixture, function (done) { - common.npm([ - 'ls', '--json' - ], { - cwd: pkgpath - }, function (err, code, stdout, stderr) { - t.ifErr(err, 'ls succeeded') - t.equal(0, code, 'exit 0 on ls') - var pkg = JSON.parse(stdout) - var deps = pkg.dependencies - t.ok(deps.dep, 'dep present') - done() - }) - }) -}) - -test('ls with filter arg', function (t) { - var fixture = new Tacks( - Dir({ - 'npm-test-ls': Dir({ - 'package.json': File({ - name: 'npm-test-ls', - version: '1.0.0', - dependencies: { - 'dep': 'file:../dep' - } - }) - }), - 'dep': Dir({ - 'package.json': File({ - name: 'dep', - version: '1.0.0' - }) - }), - 'otherdep': Dir({ - 'package.json': File({ - name: 'otherdep', - version: '1.0.0' - }) - }) - }) - ) - withFixture(t, fixture, function (done) { - common.npm([ - 'ls', 'dep', - '--json' - ], { - cwd: path.join(fixturepath, 'npm-test-ls') - }, function (err, code, stdout, stderr) { - t.ifErr(err, 'ls succeeded') - t.equal(0, code, 'exit 0 on ls') - var pkg = JSON.parse(stdout) - var deps = pkg.dependencies - t.ok(deps.dep, 'dep present') - t.notOk(deps.otherdep, 'other dep not present') - done() - }) - }) -}) - -test('ls with missing filtered arg', function (t) { - var fixture = new Tacks( - Dir({ - 'npm-test-ls': Dir({ - 'package.json': File({ - name: 'npm-test-ls', - version: '1.0.0', - dependencies: { - 'dep': 'file:../dep' - } - }) - }), - 'dep': Dir({ - 'package.json': File({ - name: 'dep', - version: '1.0.0' - }) - }) - }) - ) - withFixture(t, fixture, function (done) { - common.npm([ - 'ls', 'notadep', - '--json' - ], { - cwd: path.join(fixturepath, 'npm-test-ls') - }, function (err, code, stdout, stderr) { - t.ifErr(err, 'ls succeeded') - t.equal(1, code, 'exit 1 on ls') - var pkg = JSON.parse(stdout) - var deps = pkg.dependencies - t.notOk(deps, 'deps missing') - t.done() - }) - }) -}) - -test('ls with prerelease pkg', function (t) { - var fixture = new Tacks( - Dir({ - 'npm-test-ls': Dir({ - 'package.json': File({ - name: 'npm-test-ls', - version: '1.0.0', - dependencies: { - 'dep': 'file:../dep' - } - }) - }), - 'dep': Dir({ - 'package.json': File({ - name: 'dep', - version: '1.0.0-pre' - }) - }) - }) - ) - withFixture(t, fixture, function (done) { - common.npm([ - 'ls', 'dep', - '--json' - ], { - cwd: path.join(fixturepath, 'npm-test-ls') - }, function (err, code, stdout, stderr) { - t.ifErr(err, 'ls succeeded') - t.equal(0, code, 'exit 0 on ls') - var pkg = JSON.parse(stdout) - var deps = pkg.dependencies - t.ok(deps.dep, 'dep present') - t.done() - }) - }) -}) - -test('cleanup', function (t) { - rimraf.sync(basepath) - t.done() -}) - -test('ls parseable long', function (t) { - var fixture = new Tacks( - Dir({ - 'npm-test-ls': Dir({ - 'package.json': File({ - name: 'npm-test-ls', - version: '1.0.0', - dependencies: { - 'dep': 'file:../dep' - } - }) - }), - 'dep': Dir({ - 'package.json': File({ - name: 'dep', - version: '1.0.0' - }) - }) - }) - ) - withFixture(t, fixture, function (done) { - common.npm([ - 'ls', '--parseable', '--long' - ], { - cwd: pkgpath - }, function (err, code, stdout, stderr) { - t.ifErr(err, 'ls succeeded') - t.equal(0, code, 'exit 0 on ls') - t.notMatch(stdout, /undefined/, 'must not output undefined for non-symlinked items') - done() - }) - }) -}) - -function withFixture (t, fixture, tester) { - fixture.create(fixturepath) - common.npm(['install'], { - cwd: path.join(fixturepath, 'npm-test-ls') - }, checkAndTest) - function checkAndTest (err, code) { - if (err) throw err - t.is(code, 0, 'install went ok') - tester(removeAndDone) - } - function removeAndDone (err) { - if (err) throw err - fixture.remove(fixturepath) - rimraf.sync(basepath) - t.done() - } -} diff --git a/deps/npm/test/tap/meta-test-flaky-root-ownership-test.js b/deps/npm/test/tap/meta-test-flaky-root-ownership-test.js deleted file mode 100644 index 24dd9e3d95ddaf..00000000000000 --- a/deps/npm/test/tap/meta-test-flaky-root-ownership-test.js +++ /dev/null @@ -1,20 +0,0 @@ -const t = require('tap') -if (!process.getuid || process.getuid() !== 0 || !process.env.SUDO_UID || !process.env.SUDO_GID) { - t.pass('this test only runs in sudo mode') - t.end() - process.exit(0) -} - -const common = require('../common-tap.js') -const fs = require('fs') -const mkdirp = require('mkdirp') -mkdirp.sync(common.cache + '/root/owned') -fs.writeFileSync(common.cache + '/root/owned/file.txt', 'should be chowned') -const chown = require('chownr') - -// this will fire after t.teardown() but before process.on('exit') -setTimeout(() => { - chown.sync(common.cache, +process.env.SUDO_UID, +process.env.SUDO_GID) -}, 100) - -t.pass('this is fine') diff --git a/deps/npm/test/tap/nerf-dart.js b/deps/npm/test/tap/nerf-dart.js deleted file mode 100644 index d205e527cc8bb1..00000000000000 --- a/deps/npm/test/tap/nerf-dart.js +++ /dev/null @@ -1,32 +0,0 @@ -// taken from https://raw.githubusercontent.com/indexzero/npm/bd3cad01fbd3ab481d2f5da441b9eead16029123/test/tap/config-nerf-dart.js -// originally written by Charlie Robbins, https://github.com/indexzero -var test = require('tap').test -var toNerfDart = require('../../lib/config/nerf-dart.js') - -function validNerfDart (uri, valid) { - if (!valid) valid = '//registry.npmjs.org/' - test(uri, function (t) { - t.equal(toNerfDart(uri), valid) - t.end() - }) -} - -validNerfDart('http://registry.npmjs.org') -validNerfDart('http://registry.npmjs.org/some-package') -validNerfDart('http://registry.npmjs.org/some-package?write=true') -validNerfDart('http://user:pass@registry.npmjs.org/some-package?write=true') -validNerfDart('http://registry.npmjs.org/#random-hash') -validNerfDart('http://registry.npmjs.org/some-package#random-hash') - -validNerfDart( - 'http://relative.couchapp.npm/design/-/rewrite/', - '//relative.couchapp.npm/design/-/rewrite/' -) -validNerfDart( - 'http://relative.couchapp.npm:8080/design/-/rewrite/', - '//relative.couchapp.npm:8080/design/-/rewrite/' -) -validNerfDart( - 'http://relative.couchapp.npm:8080/design/-/rewrite/some-package', - '//relative.couchapp.npm:8080/design/-/rewrite/' -) diff --git a/deps/npm/test/tap/nested-extraneous.js b/deps/npm/test/tap/nested-extraneous.js deleted file mode 100644 index 1764a41c752790..00000000000000 --- a/deps/npm/test/tap/nested-extraneous.js +++ /dev/null @@ -1,53 +0,0 @@ -var common = require('../common-tap.js') -var test = require('tap').test -var mkdirp = require('mkdirp') -var fs = require('fs') -var rimraf = require('rimraf') -var path = require('path') - -var pkg = common.pkg -var pj = { - name: 'nested-extraneous', - version: '1.2.3' -} - -var dep = path.resolve(pkg, 'node_modules', 'dep') -var deppj = { - name: 'nested-extraneous-dep', - version: '1.2.3', - dependencies: { - 'nested-extra-depdep': '*' - } -} - -var depdep = path.resolve(dep, 'node_modules', 'depdep') -var depdeppj = { - name: 'nested-extra-depdep', - version: '1.2.3' -} - -test('setup', function (t) { - rimraf.sync(pkg) - mkdirp.sync(depdep) - fs.writeFileSync(path.resolve(pkg, 'package.json'), JSON.stringify(pj)) - fs.writeFileSync(path.resolve(dep, 'package.json'), JSON.stringify(deppj)) - fs.writeFileSync(path.resolve(depdep, 'package.json'), JSON.stringify(depdeppj)) - t.end() -}) - -test('test', function (t) { - common.npm(['ls'], { - cwd: pkg - }, function (er, code, sto, ste) { - if (er) throw er - t.notEqual(code, 0) - t.notSimilar(ste, /depdep/) - t.notSimilar(sto, /depdep/) - t.end() - }) -}) - -test('clean', function (t) { - rimraf.sync(pkg) - t.end() -}) diff --git a/deps/npm/test/tap/no-global-warns.js b/deps/npm/test/tap/no-global-warns.js deleted file mode 100644 index 1c39fd79549c06..00000000000000 --- a/deps/npm/test/tap/no-global-warns.js +++ /dev/null @@ -1,65 +0,0 @@ -'use strict' -var path = require('path') -var test = require('tap').test -var mkdirp = require('mkdirp') -var writeFileSync = require('fs').writeFileSync -var common = require('../common-tap.js') - -var base = common.pkg -var mockGlobal = path.join(base, 'global') -var toInstall = path.join(base, 'to-install') - -var config = 'prefix = ' + base -var configPath = path.join(base, '_npmrc') - -// use a clean environment for this test -// otherwise local dev-time npm settings can throw it off -var OPTS = { - env: Object.keys(process.env).filter(function (k) { - return !/^npm_config_/i.test(k) - }).reduce(function (set, k) { - set[k] = process.env[k] - return set - }, {}) -} - -var installJSON = { - name: 'to-install', - version: '1.0.0', - description: '', - main: 'index.js', - scripts: { - test: 'echo "Error: no test specified" && exit 1' - }, - author: '', - license: 'ISC' -} - -test('setup', function (t) { - mkdirp.sync(mockGlobal) - mkdirp.sync(toInstall) - writeFileSync( - path.join(toInstall, 'package.json'), - JSON.stringify(installJSON, null, 2) - ) - writeFileSync(configPath, config) - t.end() -}) - -test('no-global-warns', function (t) { - common.npm( - [ - 'install', '-g', - '--userconfig=' + configPath, - toInstall - ], - OPTS, - function (err, code, stdout, stderr) { - t.ifError(err, 'installed w/o error') - const preWarn = 'npm WARN You are using a pre-release version ' + - 'of node and things may not work as expected' - stderr = stderr.trim().replace(preWarn, '') - t.is(stderr, '', 'no warnings printed to stderr') - t.end() - }) -}) diff --git a/deps/npm/test/tap/no-scan-full-global-dir.js b/deps/npm/test/tap/no-scan-full-global-dir.js deleted file mode 100644 index 7501b881c98cc9..00000000000000 --- a/deps/npm/test/tap/no-scan-full-global-dir.js +++ /dev/null @@ -1,107 +0,0 @@ -'use strict' -var fs = require('fs') -var path = require('path') -var test = require('tap').test -var requireInject = require('require-inject') -var npm = require('../../lib/npm.js') - -// XXX update this when rpt's realpath.js is extracted out -var rptRealpath = require.resolve('read-package-tree/realpath.js') - -const common = require('../common-tap.js') -const pkg = common.pkg -var packages = { - test: {package: {name: 'test'}, path: pkg, children: ['abc', 'def', 'ghi', 'jkl']}, - abc: {package: {name: 'abc'}, path: path.join(pkg, 'node_modules', 'abc')}, - def: {package: {name: 'def'}, path: path.join(pkg, 'node_modules', 'def')}, - ghi: {package: {name: 'ghi'}, path: path.join(pkg, 'node_modules', 'ghi')}, - jkl: {package: {name: 'jkl'}, path: path.join(pkg, 'node_modules', 'jkl')} -} -var dirs = {} -var files = {} -Object.keys(packages).forEach(function (name) { - dirs[path.join(packages[name].path, 'node_modules')] = packages[name].children || [] - files[path.join(packages[name].path, 'package.json')] = packages[name].package -}) - -var mockReaddir = function (name, cb) { - if (dirs[name]) return cb(null, dirs[name]) - var er = new Error('No such mock: ' + name) - er.code = 'ENOENT' - cb(er) -} -var mockReadPackageJson = function (file, cb) { - if (files[file]) return cb(null, files[file]) - var er = new Error('No such mock: ' + file) - er.code = 'ENOENT' - cb(er) -} -var mockFs = Object.create(fs) -mockFs.realpath = function (dir, cb) { - return cb(null, dir) -} - -const mockRptRealpath = path => Promise.resolve(path) - -test('setup', function (t) { - npm.load(function () { - t.pass('npm loaded') - t.end() - }) -}) - -test('installer', function (t) { - t.plan(1) - var installer = requireInject('../../lib/install.js', { - 'fs': mockFs, - 'readdir-scoped-modules': mockReaddir, - 'read-package-json': mockReadPackageJson, - 'mkdirp': function (path, cb) { cb() }, - [rptRealpath]: mockRptRealpath - }) - - var Installer = installer.Installer - class TestInstaller extends Installer { - constructor (where, dryrun, args) { - super(where, dryrun, args) - this.global = true - } - loadArgMetadata (cb) { - this.args = this.args.map(function (arg) { return {name: arg} }) - cb() - } - } - - var inst = new TestInstaller(pkg, false, ['def', 'abc']) - inst.loadCurrentTree(function () { - var kids = inst.currentTree.children.map(function (child) { return child.package.name }) - t.isDeeply(kids, ['abc', 'def']) - t.end() - }) -}) - -test('uninstaller', function (t) { - t.plan(1) - var uninstaller = requireInject('../../lib/uninstall.js', { - 'fs': mockFs, - 'readdir-scoped-modules': mockReaddir, - 'read-package-json': mockReadPackageJson, - 'mkdirp': function (path, cb) { cb() }, - [rptRealpath]: mockRptRealpath - }) - - var Uninstaller = uninstaller.Uninstaller - class TestUninstaller extends Uninstaller { - constructor (where, dryrun, args) { - super(where, dryrun, args) - this.global = true - } - } - - var uninst = new TestUninstaller(pkg, false, ['ghi', 'jkl']) - uninst.loadCurrentTree(function () { - var kids = uninst.currentTree.children.map(function (child) { return child.package.name }) - t.isDeeply(kids, ['ghi', 'jkl']) - t.end() - }) -}) diff --git a/deps/npm/test/tap/noargs-install-config-save.js b/deps/npm/test/tap/noargs-install-config-save.js deleted file mode 100644 index cb1af408abb5c6..00000000000000 --- a/deps/npm/test/tap/noargs-install-config-save.js +++ /dev/null @@ -1,76 +0,0 @@ -var common = require('../common-tap.js') -var test = require('tap').test -var fs = require('fs') -var rimraf = require('rimraf') -var mkdirp = require('mkdirp') - -var mr = require('npm-registry-mock') - -var pkg = common.pkg - -function writePackageJson () { - rimraf.sync(pkg) - mkdirp.sync(pkg) - mkdirp.sync(pkg + '/cache') - - fs.writeFileSync(pkg + '/package.json', JSON.stringify({ - 'author': 'Rocko Artischocko', - 'name': 'noargs', - 'version': '0.0.0', - 'devDependencies': { - 'underscore': '1.3.1' - } - }), 'utf8') -} - -var env = { - 'npm_config_save': true, - 'npm_config_registry': common.registry, - 'npm_config_cache': pkg + '/cache', - HOME: process.env.HOME, - Path: process.env.PATH, - PATH: process.env.PATH -} -var OPTS = { - cwd: pkg, - env: env -} - -test('does not update the package.json with empty arguments', function (t) { - writePackageJson() - t.plan(2) - - mr({ port: common.port }, function (er, s) { - common.npm('install', OPTS, function (er, code, stdout, stderr) { - if (er) throw er - t.is(code, 0) - if (code !== 0) { - console.error('#', stdout) - console.error('#', stderr) - } - var text = JSON.stringify(fs.readFileSync(pkg + '/package.json', 'utf8')) - s.close() - t.equal(text.indexOf('"dependencies'), -1, 'dependencies do not exist in file') - }) - }) -}) - -test('updates the package.json (adds dependencies) with an argument', function (t) { - writePackageJson() - t.plan(2) - - mr({ port: common.port }, function (er, s) { - common.npm(['install', 'underscore', '-P'], OPTS, function (er, code, stdout, stderr) { - if (er) throw er - t.is(code, 0) - s.close() - var text = JSON.stringify(fs.readFileSync(pkg + '/package.json', 'utf8')) - t.notEqual(text.indexOf('"dependencies'), -1, 'dependencies exist in file') - }) - }) -}) - -test('cleanup', function (t) { - rimraf.sync(pkg) - t.end() -}) diff --git a/deps/npm/test/tap/node-modules-path-munge.js b/deps/npm/test/tap/node-modules-path-munge.js deleted file mode 100644 index fb116806c8cbc9..00000000000000 --- a/deps/npm/test/tap/node-modules-path-munge.js +++ /dev/null @@ -1,39 +0,0 @@ -var common = require('../common-tap.js') -var t = require('tap') -var fs = require('fs') -var rimraf = require('rimraf') -var mkdirp = require('mkdirp') -var path = require('path') -var dir = path.join(common.pkg, 'my_node_modules') -var script = process.platform === 'win32' ? 'echo %PATH%' : 'echo $PATH' - -t.test('setup', function (t) { - rimraf.sync(dir) - mkdirp.sync(dir) - fs.writeFileSync(dir + '/package.json', JSON.stringify({ - name: 'my_node_modules', - version: '1.2.3', - scripts: { - test: script - } - })) - t.end() -}) - -t.test('verify PATH is munged right', function (t) { - common.npm(['test'], { cwd: dir }, function (err, code, stdout, stderr) { - if (err) { - throw err - } - t.equal(code, 0, 'exit ok') - t.notOk(stderr, 'should have no stderr') - var expect = path.resolve(dir, 'node_modules', '.bin').toLowerCase() - t.contains(stdout.toLowerCase(), expect) - t.end() - }) -}) - -t.test('cleanup', function (t) { - rimraf.sync(dir) - t.end() -}) diff --git a/deps/npm/test/tap/normalize-package-explode.js b/deps/npm/test/tap/normalize-package-explode.js deleted file mode 100644 index 57faec8b60250d..00000000000000 --- a/deps/npm/test/tap/normalize-package-explode.js +++ /dev/null @@ -1,26 +0,0 @@ -'use strict' -var test = require('tap').test -var log = require('npmlog') -var npm = require('../../lib/npm.js') - -var idealTree = { - package: { - name: 'a b c', - version: '3.what' - }, - children: [], - warnings: [] -} - -test('setup', function (t) { - npm.load({}, t.end) -}) - -test('validate-tree', function (t) { - log.disableProgress() - var validateTree = require('../../lib/install/validate-tree.js') - validateTree(idealTree, log.newGroup('validate'), function (er) { - t.pass("we didn't crash") - t.end() - }) -}) diff --git a/deps/npm/test/tap/npm-api-not-loaded-error.js b/deps/npm/test/tap/npm-api-not-loaded-error.js deleted file mode 100644 index 8bf263503874e8..00000000000000 --- a/deps/npm/test/tap/npm-api-not-loaded-error.js +++ /dev/null @@ -1,48 +0,0 @@ -var test = require('tap').test -const common = require('../common-tap.js') -var npm = require('../..') -var path = require('path') -var rimraf = require('rimraf') -var npmrc = path.join(common.pkg, 'npmrc') -var fs = require('fs') - -test('setup', function (t) { - fs.writeFileSync(npmrc, 'foo = bar\n', 'ascii') - t.end() -}) - -test('calling set/get on config pre-load should throw', function (t) { - var threw = true - try { - npm.config.get('foo') - threw = false - } catch (er) { - t.equal(er.message, 'npm.load() required') - } finally { - t.ok(threw, 'get before load should throw') - } - - threw = true - try { - npm.config.set('foo', 'bar') - threw = false - } catch (er) { - t.equal(er.message, 'npm.load() required') - } finally { - t.ok(threw, 'set before load should throw') - } - - npm.load({ userconfig: npmrc }, function (er) { - if (er) throw er - - t.equal(npm.config.get('foo'), 'bar') - npm.config.set('foo', 'baz') - t.equal(npm.config.get('foo'), 'baz') - t.end() - }) -}) - -test('cleanup', function (t) { - rimraf.sync(npmrc) - t.end() -}) diff --git a/deps/npm/test/tap/onload.js b/deps/npm/test/tap/onload.js deleted file mode 100644 index 4750fa6f88c2a8..00000000000000 --- a/deps/npm/test/tap/onload.js +++ /dev/null @@ -1,39 +0,0 @@ -var path = require('path') -var test = require('tap').test -var rimraf = require('rimraf') -var common = require('../common-tap.js') -var opts = { cwd: common.pkg } -var binDir = '../../node_modules/.bin' -var fixture = path.resolve(__dirname, binDir) -var onload = path.resolve(__dirname, '../fixtures/onload.js') - -test('setup', function (t) { - rimraf.sync(path.join(common.pkg, 'node_modules')) - t.end() -}) - -test('npm bin with valid onload script', function (t) { - var args = ['--onload', onload, 'bin'] - common.npm(args, opts, function (err, code, stdout, stderr) { - t.ifError(err, 'bin ran without issue') - t.equal(stderr.trim(), 'called onload') - t.equal(code, 0, 'exit ok') - t.equal(stdout, fixture + '\n') - t.end() - }) -}) - -test('npm bin with invalid onload script', function (t) { - var onloadScript = onload + 'jsfd' - var args = ['--onload', onloadScript, '--loglevel=warn', 'bin'] - common.npm(args, opts, function (err, code, stdout, stderr) { - t.ifError(err, 'bin ran without issue') - t.match(stderr, /npm WARN onload-script failed to require onload script/) - t.match(stderr, /MODULE_NOT_FOUND/) - t.notEqual(stderr.indexOf(onloadScript), -1) - t.equal(code, 0, 'exit ok') - var res = path.resolve(stdout) - t.equal(res, fixture + '\n') - t.end() - }) -}) diff --git a/deps/npm/test/tap/optional-metadep-rollback-collision.js b/deps/npm/test/tap/optional-metadep-rollback-collision.js deleted file mode 100644 index b62d63d7f760f6..00000000000000 --- a/deps/npm/test/tap/optional-metadep-rollback-collision.js +++ /dev/null @@ -1,188 +0,0 @@ -'use strict' -/* eslint-disable camelcase */ -var fs = require('graceful-fs') -var path = require('path') - -var mkdirp = require('mkdirp') -var test = require('tap').test - -var common = require('../common-tap.js') - -var pkg = common.pkg -var deps = path.resolve(pkg, 'deps') -var opdep = path.resolve(pkg, 'node_modules', 'opdep') -var cache = common.cache -var createServer = require('http').createServer -var mr = require('npm-registry-mock') -var serverPort = 27991 - -var json = { - name: 'optional-metadep-rollback-collision', - version: '1.0.0', - description: 'let\'s just see about that race condition', - optionalDependencies: { - opdep: 'file:./deps/opdep' - } -} - -var d1 = { - name: 'd1', - version: '1.0.0', - description: 'I FAIL CONSTANTLY', - scripts: { - preinstall: 'sleep 1' - }, - dependencies: { - foo: 'http://localhost:' + serverPort + '/' - } -} - -var d2 = { - name: 'd2', - version: '1.0.0', - description: 'how do you *really* know you exist?', - scripts: { - postinstall: 'node blart.js' - }, - dependencies: { - 'request': '^0.9.0', - mkdirp: '^0.3.5', - wordwrap: '^0.0.2' - } -} - -var opdep_json = { - name: 'opdep', - version: '1.0.0', - description: 'To explode, of course!', - main: 'index.js', - dependencies: { - d1: 'file:../d1', - d2: 'file:../d2' - } -} - -var blart = ` -var rando = require('crypto').randomBytes -var resolve = require('path').resolve - -var mkdirp = require('mkdirp') -var rimraf = require('rimraf') -var writeFile = require('graceful-fs').writeFile - -var BASEDIR = resolve(__dirname, 'arena') - -var keepItGoingLouder = {} -var writers = 0 -var errors = 0 - -function gensym () { return rando(16).toString('hex') } - -function writeAlmostForever (filename) { - if (!keepItGoingLouder[filename]) { - writers-- - if (writers < 1) return done() - } else { - writeFile(filename, keepItGoingLouder[filename], function (err) { - if (err) errors++ - - writeAlmostForever(filename) - }) - } -} - -function done () { - rimraf(BASEDIR, function () { - if (errors > 0) console.log('not ok - %d errors', errors) - else console.log('ok') - }) -} - -mkdirp(BASEDIR, function go () { - for (var i = 0; i < 16; i++) { - var filename = resolve(BASEDIR, gensym() + '.txt') - - keepItGoingLouder[filename] = '' - for (var j = 0; j < 512; j++) keepItGoingLouder[filename] += filename - - writers++ - writeAlmostForever(filename) - } - - setTimeout(function viktor () { - // kill all the writers - keepItGoingLouder = {} - }, 3 * 1000) -}) -` - -test('setup', function (t) { - const badServer = createServer(function (req, res) { - setTimeout(function () { - res.writeHead(404) - res.end() - }, 1000) - }).listen(serverPort, () => t.parent.teardown(() => badServer.close())) - - mkdirp.sync(pkg) - fs.writeFileSync( - path.join(pkg, 'package.json'), - JSON.stringify(json, null, 2) - ) - - mkdirp.sync(path.join(deps, 'd1')) - fs.writeFileSync( - path.join(deps, 'd1', 'package.json'), - JSON.stringify(d1, null, 2) - ) - - mkdirp.sync(path.join(deps, 'd2')) - fs.writeFileSync( - path.join(deps, 'd2', 'package.json'), - JSON.stringify(d2, null, 2) - ) - fs.writeFileSync(path.join(deps, 'd2', 'blart.js'), blart) - - mkdirp.sync(path.join(deps, 'opdep')) - fs.writeFileSync( - path.join(deps, 'opdep', 'package.json'), - JSON.stringify(opdep_json, null, 2) - ) - mr({ port: common.port }, function (er, server) { - t.parent.teardown(() => server.close()) - t.end() - }) -}) - -test('go go test racer', t => common.npm( - [ - '--prefix', pkg, - '--fetch-retries', '0', - '--loglevel', 'error', - '--no-progress', - '--registry', common.registry, - '--parseable', - '--cache', cache, - 'install' - ], - { - cwd: pkg, - env: { - PATH: process.env.PATH, - Path: process.env.Path - }, - stdio: 'pipe' - } -).spread((code, stdout, stderr) => { - t.comment(stdout.trim()) - t.comment(stderr.trim()) - t.is(code, 0, 'npm install exited with code 0') - t.notOk(/not ok/.test(stdout), 'should not contain the string \'not ok\'') -})) - -test('verify results', function (t) { - t.throws(function () { - fs.statSync(opdep) - }) - t.end() -}) diff --git a/deps/npm/test/tap/org.js b/deps/npm/test/tap/org.js deleted file mode 100644 index 7315cf0b6faf1b..00000000000000 --- a/deps/npm/test/tap/org.js +++ /dev/null @@ -1,136 +0,0 @@ -'use strict' - -var test = require('tap').test -var common = require('../common-tap.js') - -var mr = common.fakeRegistry.compat - -var server - -test('setup', function (t) { - mr({port: common.port}, function (err, s) { - t.ifError(err, 'registry mocked successfully') - server = s - t.end() - }) -}) - -const names = ['add', 'set'] -const roles = ['developer', 'admin', 'owner'] - -names.forEach(function (name) { - test('org ' + name + ' [orgname] [username]: defaults to developer', function (t) { - const membershipData = { - org: { - name: 'myorg', - size: 1 - }, - user: 'myuser', - role: 'developer' - } - server.put('/-/org/myorg/user', JSON.stringify({ - user: 'myuser' - })).reply(200, membershipData) - common.npm([ - 'org', 'add', 'myorg', 'myuser', - '--json', - '--registry', common.registry, - '--loglevel', 'silent' - ], {}, function (err, code, stdout, stderr) { - t.ifError(err, 'npm org') - - t.equal(code, 0, 'exited OK') - t.equal(stderr, '', 'no error output') - - t.same(JSON.parse(stdout), membershipData) - t.end() - }) - }) - - roles.forEach(function (role) { - test('org ' + name + ' [orgname] [username]: accepts role ' + role, function (t) { - const membershipData = { - org: { - name: 'myorg', - size: 1 - }, - user: 'myuser', - role: role - } - server.put('/-/org/myorg/user', JSON.stringify({ - user: 'myuser' - })).reply(200, membershipData) - common.npm([ - 'org', name, 'myorg', 'myuser', - '--json', - '--registry', common.registry, - '--loglevel', 'silent' - ], {}, function (err, code, stdout, stderr) { - t.ifError(err, 'npm org') - - t.equal(code, 0, 'exited OK') - t.equal(stderr, '', 'no error output') - - t.same(JSON.parse(stdout), membershipData) - t.end() - }) - }) - }) -}) - -test('org rm [orgname] [username]', function (t) { - const membershipData = { - otheruser: 'admin' - } - server.delete('/-/org/myorg/user', JSON.stringify({ - user: 'myuser' - })).reply(204, {}) - server.get('/-/org/myorg/user') - .reply(200, membershipData) - common.npm([ - 'org', 'rm', 'myorg', 'myuser', - '--json', - '--registry', common.registry, - '--loglevel', 'silent' - ], {}, function (err, code, stdout, stderr) { - t.ifError(err, 'npm org') - - t.equal(code, 0, 'exited OK') - t.equal(stderr, '', 'no error output') - t.deepEqual(JSON.parse(stdout), { - user: 'myuser', - org: 'myorg', - deleted: true, - userCount: 1 - }, 'got useful info') - t.end() - }) -}) - -test('org ls [orgname]', function (t) { - const membershipData = { - username: 'admin', - username2: 'foo' - } - server.get('/-/org/myorg/user') - .reply(200, membershipData) - common.npm([ - 'org', 'ls', 'myorg', - '--json', - '--registry', common.registry, - '--loglevel', 'silent' - ], {}, function (err, code, stdout, stderr) { - t.ifError(err, 'npm org') - t.equal(code, 0, 'exited OK') - t.equal(stderr, '', 'no error output') - t.same(JSON.parse(stdout), membershipData, 'outputs members') - t.end() - }) -}) - -test('cleanup', function (t) { - t.pass('cleaned up') - server.done() - server.close() - t.end() -}) diff --git a/deps/npm/test/tap/outdated-bad-read-tree.js b/deps/npm/test/tap/outdated-bad-read-tree.js deleted file mode 100644 index eb4bac36ef0836..00000000000000 --- a/deps/npm/test/tap/outdated-bad-read-tree.js +++ /dev/null @@ -1,21 +0,0 @@ -'use strict' -var test = require('tap').test -var requireInject = require('require-inject') -var npm = require('../../lib/npm.js') - -test('setup', function (t) { - npm.load({progress: false}, t.end) -}) - -test('outdated', function (t) { - var rptError = new Error('read-package-tree') - var outdated = requireInject('../../lib/outdated.js', { - 'read-package-tree': function (dir, cb) { - cb(rptError) - } - }) - outdated([], function (err) { - t.is(err, rptError) - t.end() - }) -}) diff --git a/deps/npm/test/tap/outdated-color.js b/deps/npm/test/tap/outdated-color.js deleted file mode 100644 index 11c967650f3b04..00000000000000 --- a/deps/npm/test/tap/outdated-color.js +++ /dev/null @@ -1,75 +0,0 @@ -var fs = require('graceful-fs') -var path = require('path') - -var mkdirp = require('mkdirp') -var mr = require('npm-registry-mock') -var rimraf = require('rimraf') -var test = require('tap').test - -var common = require('../common-tap.js') - -var pkg = common.pkg - -var EXEC_OPTS = { cwd: pkg } - -function hasControlCodes (str) { - return str.length !== ansiTrim(str).length -} - -function ansiTrim (str) { - var r = new RegExp('\x1b(?:\\[(?:\\d+[ABCDEFGJKSTm]|\\d+;\\d+[Hfm]|' + - '\\d+;\\d+;\\d+m|6n|s|u|\\?25[lh])|\\w)', 'g') - return str.replace(r, '') -} - -var json = { - name: 'outdated-color', - description: 'fixture', - version: '0.0.1', - dependencies: { - underscore: '1.3.1' - } -} - -test('setup', function (t) { - cleanup() - mkdirp.sync(pkg) - fs.writeFileSync( - path.join(pkg, 'package.json'), - JSON.stringify(json, null, 2) - ) - - process.chdir(pkg) - t.end() -}) - -// note hard to automate tests for color = true -// as npm kills the color config when it detects -// it's not running in a tty -test('does not use ansi styling', function (t) { - t.plan(4) - mr({ port: common.port }, function (er, s) { // create mock registry. - common.npm( - [ - '--registry', common.registry, - 'outdated', 'underscore' - ], - EXEC_OPTS, - function (err, code, stdout) { - t.ifError(err) - t.is(code, 1, 'npm outdated exited with code 1') - t.ok(stdout, stdout.length) - t.ok(!hasControlCodes(stdout)) - s.close() - }) - }) -}) - -test('cleanup', function (t) { - cleanup() - t.end() -}) - -function cleanup () { - rimraf.sync(pkg) -} diff --git a/deps/npm/test/tap/outdated-depth.js b/deps/npm/test/tap/outdated-depth.js deleted file mode 100644 index 368d32230abf06..00000000000000 --- a/deps/npm/test/tap/outdated-depth.js +++ /dev/null @@ -1,76 +0,0 @@ -var fs = require('graceful-fs') -var path = require('path') - -var mr = require('npm-registry-mock') -var test = require('tap').test - -var npm = require('../../') -var common = require('../common-tap') - -var pkg = common.pkg - -var json = { - name: 'outdated-depth', - version: '1.2.3', - dependencies: { - underscore: '1.3.1', - 'npm-test-peer-deps': '0.0.0' - } -} - -test('setup', function (t) { - fs.writeFileSync( - path.join(pkg, 'package.json'), - JSON.stringify(json, null, 2) - ) - process.chdir(pkg) - - t.end() -}) - -test('outdated depth zero', function (t) { - var expected = [ - pkg, - 'underscore', - '1.3.1', - '1.3.1', - '1.5.1', - '1.3.1', - null - ] - - mr({ port: common.port }, function (er, s) { - npm.load( - { - depth: 0, - loglevel: 'silent', - registry: common.registry - }, - function () { - npm.install('.', function (er) { - if (er) throw new Error(er) - npm.outdated(function (err, d) { - if (err) { - throw err - } - t.is(process.exitCode, 1, 'exit code set to 1') - process.exitCode = 0 - t.deepEqual(d[0], expected) - t.equal(d.length, 1) - npm.config.set('depth', 1) - npm.outdated(function (err, d) { - t.equal(d.length, 2) - if (err) { - throw err - } - t.is(process.exitCode, 1, 'exit code set to 1') - process.exitCode = 0 - s.close() - t.end() - }) - }) - }) - } - ) - }) -}) diff --git a/deps/npm/test/tap/outdated-git.js b/deps/npm/test/tap/outdated-git.js deleted file mode 100644 index 15db1a30c7c74d..00000000000000 --- a/deps/npm/test/tap/outdated-git.js +++ /dev/null @@ -1,61 +0,0 @@ -var path = require('path') - -var test = require('tap').test -var mkdirp = require('mkdirp') -var fs = require('graceful-fs') -var rimraf = require('rimraf') - -var common = require('../common-tap.js') -var npm = require('../../') - -// config -var pkg = common.pkg -var cache = common.cache -var json = { - name: 'outdated-git', - author: 'Rocko Artischocko', - description: 'fixture', - version: '0.0.1', - main: 'index.js', - dependencies: { - 'foo-github': 'robertkowalski/foo', - 'foo-private': 'git://github.com/robertkowalski/foo-private.git', - 'foo-private-credentials': 'git://user:pass@github.com/robertkowalski/foo-private.git' - } -} - -test('setup', function (t) { - setup() - t.end() -}) - -test('discovers new versions in outdated', function (t) { - process.chdir(pkg) - t.plan(7) - npm.load({cache: cache, registry: common.registry, loglevel: 'silent'}, function () { - npm.commands.outdated([], function (er, d) { - t.ifError(er, 'npm outdated completed successfully') - t.is(process.exitCode, 1, 'exitCode set to 1') - process.exitCode = 0 - t.equal(d[0][3], 'git') - t.equal(d[0][4], 'git') - t.equal(d[0][5], 'github:robertkowalski/foo') - t.equal(d[1][5], 'git://github.com/robertkowalski/foo-private.git') - t.equal(d[2][5], 'git://user:pass@github.com/robertkowalski/foo-private.git') - }) - }) -}) - -test('cleanup', function (t) { - cleanup() - t.end() -}) - -function setup () { - mkdirp.sync(cache) - fs.writeFileSync(path.join(pkg, 'package.json'), JSON.stringify(json, null, 2), 'utf8') -} - -function cleanup () { - rimraf.sync(pkg) -} diff --git a/deps/npm/test/tap/outdated-json.js b/deps/npm/test/tap/outdated-json.js deleted file mode 100644 index 77db52cc725211..00000000000000 --- a/deps/npm/test/tap/outdated-json.js +++ /dev/null @@ -1,123 +0,0 @@ -var fs = require('graceful-fs') -var path = require('path') - -var mr = require('npm-registry-mock') -var test = require('tap').test - -var common = require('../common-tap.js') -var server - -var pkg = common.pkg - -var EXEC_OPTS = { cwd: pkg } - -var json = { - name: 'outdated-json', - author: 'Rockbert', - version: '0.0.0', - dependencies: { - underscore: '~1.3.1' - }, - devDependencies: { - request: '~0.9.0' - } -} - -var expected = { - underscore: { - current: '1.3.3', - wanted: '1.3.3', - latest: '1.5.1', - location: 'node_modules' + path.sep + 'underscore' - }, - request: { - current: '0.9.5', - wanted: '0.9.5', - latest: '2.27.0', - location: 'node_modules' + path.sep + 'request' - } -} - -test('setup', function (t) { - fs.writeFileSync( - path.join(pkg, 'package.json'), - JSON.stringify(json, null, 2) - ) - process.chdir(pkg) - mr({ port: common.port }, function (er, s) { - t.ifError(er, 'mock registry should never fail to start') - server = s - common.npm( - [ - '--registry', common.registry, - '--silent', - 'install' - ], - EXEC_OPTS, - function (err, code) { - t.ifError(err, 'npm install ran without issue') - t.notOk(code, 'npm install ran without raising error code') - - t.end() - } - ) - }) -}) - -test('it should log json data', function (t) { - common.npm( - [ - '--registry', common.registry, - '--silent', - '--json', - 'outdated' - ], - EXEC_OPTS, - function (err, code, stdout) { - t.ifError(err, 'npm outdated ran without error') - t.is(code, 1, 'npm outdated exited with code 1') - var out - t.doesNotThrow(function () { - out = JSON.parse(stdout) - }, 'output correctly parsed as JSON') - t.deepEqual(out, expected) - - t.end() - } - ) -}) - -test('it should log json data even when the list is empty', function (t) { - common.npm( - [ - 'rm', - 'request', - 'underscore' - ], - EXEC_OPTS, - function (er, code, stdout) { - t.ifError(er, 'run without error') - t.is(code, 0, 'successful exit status') - common.npm( - [ - '--registry', common.registry, - '--silent', - '--json', - 'outdated' - ], - EXEC_OPTS, - function (er, code, stdout) { - t.ifError(er, 'run without error') - t.is(code, 0, 'successful exit status') - t.same(JSON.parse(stdout), {}, 'got an empty object printed') - t.end() - } - ) - } - ) -}) - -test('cleanup', function (t) { - server.close() - t.end() -}) diff --git a/deps/npm/test/tap/outdated-latest.js b/deps/npm/test/tap/outdated-latest.js deleted file mode 100644 index 073b71da91cc68..00000000000000 --- a/deps/npm/test/tap/outdated-latest.js +++ /dev/null @@ -1,109 +0,0 @@ -'use strict' -const path = require('path') -const test = require('tap').test -const mr = require('npm-registry-mock') -const Tacks = require('tacks') -const File = Tacks.File -const Dir = Tacks.Dir -const common = require('../common-tap.js') - -const basedir = common.pkg -const testdir = path.join(basedir, 'testdir') -const cachedir = common.cache -const globaldir = path.join(basedir, 'global') -const tmpdir = path.join(basedir, 'tmp') - -const conf = { - cwd: testdir, - env: Object.assign({}, process.env, { - npm_config_cache: cachedir, - npm_config_tmp: tmpdir, - npm_config_prefix: globaldir, - npm_config_registry: common.registry, - npm_config_loglevel: 'warn' - }) -} - -function exampleManifest (version) { - return { - name: 'example', - version: version - } -} - -const examplePackument = { - 'name': 'example', - 'dist-tags': { - 'latest': '1.2.4', - 'beta': '1.2.6' - }, - 'versions': { - '1.2.0': exampleManifest('1.2.0'), - '1.2.1': exampleManifest('1.2.1'), - '1.2.2': exampleManifest('1.2.2'), - '1.2.3': exampleManifest('1.2.3'), - '1.2.4': exampleManifest('1.2.4'), - '1.2.5': exampleManifest('1.2.5'), - '1.2.6': exampleManifest('1.2.6') - } -} - -const fixture = new Tacks(Dir({ - cache: Dir(), - global: Dir(), - tmp: Dir(), - testdir: Dir({ - node_modules: Dir({ - example: Dir({ - 'package.json': File({ - name: 'example', - version: '1.2.3' - }) - }) - }), - 'package.json': File({ - name: 'outdated-latest', - version: '1.0.0', - dependencies: { - example: '^1.2.0' - } - }) - }) -})) - -function setup () { - cleanup() - fixture.create(basedir) -} - -function cleanup () { - fixture.remove(basedir) -} - -let server - -test('setup', function (t) { - setup() - mr({port: common.port, throwOnUnmatched: true}, function (err, s) { - if (err) throw err - server = s - server.get('/example').reply(200, examplePackument) - t.done() - }) -}) - -test('example', function (t) { - return common.npm(['outdated', '--json'], conf).spread((code, stdout, stderr) => { - t.is(code, 1, 'files ARE outdated!') - const result = JSON.parse(stdout.trim()) - t.comment(stderr.trim()) - // your assertions here - t.like(result, {example: {current: '1.2.3', wanted: '1.2.4', latest: '1.2.4'}}, 'got latest, not beta') - }) -}) - -test('cleanup', function (t) { - server.close() - cleanup() - t.done() -}) diff --git a/deps/npm/test/tap/outdated-long.js b/deps/npm/test/tap/outdated-long.js deleted file mode 100644 index 8cd2ceadb96fc9..00000000000000 --- a/deps/npm/test/tap/outdated-long.js +++ /dev/null @@ -1,93 +0,0 @@ -var fs = require('graceful-fs') -var path = require('path') - -var mr = require('npm-registry-mock') -var test = require('tap').test - -var common = require('../common-tap.js') -var npm = require('../../') - -// config -var pkg = common.pkg -var cache = common.cache - -var json = { - name: 'outdated-long', - description: 'fixture', - version: '0.0.1', - dependencies: { - underscore: '1.3.1' - } -} - -test('setup', function (t) { - fs.writeFileSync( - path.join(pkg, 'package.json'), - JSON.stringify(json, null, 2) - ) - - process.chdir(pkg) - t.end() -}) - -test('it should not throw', function (t) { - var originalLog = console.log - - var output = [] - var expOut = [ - 'add\tunderscore\t1.3.1\tnode_modules/underscore\t\t', - path.resolve(pkg, 'node_modules', 'underscore') + - ':underscore@1.3.1' + - ':underscore@1.3.1' + - ':underscore@1.5.1' + - ':dependencies' - ] - - var expData = [ - [ - pkg, - 'underscore', - '1.3.1', - '1.3.1', - '1.5.1', - '1.3.1', - 'dependencies' - ] - ] - - console.log = function () { - output.push.apply(output, arguments) - } - mr({ port: common.port }, function (er, s) { - npm.load( - { - cache: cache, - loglevel: 'silent', - parseable: true, - registry: common.registry - }, - function () { - npm.install('.', function (err) { - t.ifError(err, 'install success') - npm.config.set('long', true) - // since it's possible for the homepage of a package to change, after the - // install we read the value from the package.json directly to specify our - // expected output. - expOut[1] = expOut[1] + ':' + JSON.parse(fs.readFileSync(path.resolve(pkg, 'node_modules', 'underscore', 'package.json'))).homepage - npm.outdated(function (er, d) { - t.ifError(err, 'npm outdated ran without error') - t.is(process.exitCode, 1, 'exit code set to 1') - process.exitCode = 0 - console.log = originalLog - output[0] = output[0].replace(/\\/g, '/') - t.same(output, expOut) - t.same(d, expData) - - s.close() - t.end() - }) - }) - } - ) - }) -}) diff --git a/deps/npm/test/tap/outdated-remote.js b/deps/npm/test/tap/outdated-remote.js deleted file mode 100644 index e6cbd0e8acddef..00000000000000 --- a/deps/npm/test/tap/outdated-remote.js +++ /dev/null @@ -1,89 +0,0 @@ -'use strict' -const path = require('path') -const test = require('tap').test -const Tacks = require('tacks') -const File = Tacks.File -const Dir = Tacks.Dir -const common = require('../common-tap.js') - -const basedir = common.pkg -const testdir = path.join(basedir, 'testdir') -const cachedir = common.cache -const globaldir = path.join(basedir, 'global') -const tmpdir = path.join(basedir, 'tmp') - -const conf = { - cwd: testdir, - env: common.newEnv().extend({ - npm_config_cache: cachedir, - npm_config_tmp: tmpdir, - npm_config_prefix: globaldir, - npm_config_registry: common.registry, - npm_config_loglevel: 'warn' - }) -} - -const fixture = new Tacks(Dir({ - cache: Dir(), - global: Dir(), - tmp: Dir(), - testdir: Dir({ - node_modules: Dir({ - 'foo-http': Dir({ - 'package.json': File({ - name: 'foo-http', - version: '1.0.0' - }) - }), - 'foo-https': Dir({ - 'package.json': File({ - name: 'foo-https', - version: '1.0.0' - }) - }) - }), - 'package.json': File({ - name: 'outdated-remote', - version: '1.0.0', - dependencies: { - 'foo-http': 'http://example.com/foo.tar.gz', - 'foo-https': 'https://example.com/foo.tar.gz' - } - }) - }) -})) - -function setup () { - fixture.create(basedir) -} - -test('setup', t => { - setup() - return common.fakeRegistry.listen() -}) - -test('discovers new versions in outdated', t => { - return common.npm(['outdated', '--json'], conf).then(([code, stdout, stderr]) => { - t.is(code, 1, 'npm outdated completed successfully') - t.comment(stdout.trim()) - t.comment(stderr.trim()) - const data = JSON.parse(stdout) - t.same(data['foo-http'], { - current: '1.0.0', - wanted: 'remote', - latest: 'remote', - location: '' - }) - t.same(data['foo-https'], { - current: '1.0.0', - wanted: 'remote', - latest: 'remote', - location: '' - }) - }) -}) - -test('cleanup', t => { - common.fakeRegistry.close() - t.done() -}) diff --git a/deps/npm/test/tap/outdated-symlink.js b/deps/npm/test/tap/outdated-symlink.js deleted file mode 100644 index 5ec089758a3caa..00000000000000 --- a/deps/npm/test/tap/outdated-symlink.js +++ /dev/null @@ -1,133 +0,0 @@ -'use strict' -const path = require('path') -const test = require('tap').test -const mr = require('npm-registry-mock') -const Tacks = require('tacks') -const File = Tacks.File -const Symlink = Tacks.Symlink -const Dir = Tacks.Dir -const common = require('../common-tap.js') - -const basedir = common.pkg -const testdir = path.join(basedir, 'testdir') -const cachedir = common.cache -const globaldir = path.join(basedir, 'global') -const tmpdir = path.join(basedir, 'tmp') - -const conf = { - cwd: path.join(testdir, 'main'), - env: Object.assign({}, process.env, { - npm_config_cache: cachedir, - npm_config_tmp: tmpdir, - npm_config_prefix: globaldir, - npm_config_registry: common.registry, - npm_config_loglevel: 'warn' - }) -} - -let server -const fixture = new Tacks(Dir({ - cache: Dir(), - global: Dir(), - tmp: Dir(), - testdir: Dir({ - broken: Dir({ - 'package.json': File({ - name: 'broken', - version: '1.0.0' - }) - }), - main: Dir({ - node_modules: Dir({ - unbroken: Symlink('/testdir/unbroken') - }), - 'package-lock.json': File({ - name: 'main', - version: '1.0.0', - lockfileVersion: 1, - requires: true, - dependencies: { - broken: { - version: 'file:../broken' - }, - unbroken: { - version: 'file:../unbroken' - } - } - }), - 'package.json': File({ - name: 'main', - version: '1.0.0', - dependencies: { - broken: 'file:../broken', - unbroken: 'file:../unbroken' - } - }) - }), - unbroken: Dir({ - 'package.json': File({ - name: 'unbroken', - version: '1.0.0' - }) - }) - }) -})) - -function setup () { - cleanup() - fixture.create(basedir) -} - -function cleanup () { - fixture.remove(basedir) -} - -test('setup', function (t) { - setup() - mr({port: common.port, throwOnUnmatched: true}, function (err, s) { - if (err) throw err - server = s - t.done() - }) -}) - -test('outdated sees broken links', function (t) { - common.npm(['outdated', '--json'], conf, function (err, code, stdout, stderr) { - if (err) throw err - t.is(code, 1, 'command ran not ok') - t.comment(stderr.trim()) - t.comment(stdout.trim()) - t.same(JSON.parse(stdout), { - broken: { - wanted: 'linked', - latest: 'linked', - location: '' - } - }) - t.done() - }) -}) - -test('outdated with long output sees broken links', function (t) { - common.npm(['outdated', '--long', '--json'], conf, function (err, code, stdout, stderr) { - if (err) throw err - t.is(code, 1, 'command ran not ok') - t.comment(stderr.trim()) - t.comment(stdout.trim()) - t.same(JSON.parse(stdout), { - broken: { - wanted: 'linked', - latest: 'linked', - type: 'dependencies', - location: '' - } - }) - t.done() - }) -}) - -test('cleanup', function (t) { - server.close() - cleanup() - t.done() -}) diff --git a/deps/npm/test/tap/outdated.js b/deps/npm/test/tap/outdated.js deleted file mode 100644 index e64b7b0f813c89..00000000000000 --- a/deps/npm/test/tap/outdated.js +++ /dev/null @@ -1,123 +0,0 @@ -var fs = require('graceful-fs') -var path = require('path') - -var mr = require('npm-registry-mock') -var test = require('tap').test - -var npm = require('../../') -var common = require('../common-tap.js') - -// config -var pkg = common.pkg -var cache = common.cache -var originalLog - -var json = { - name: 'outdated', - description: 'fixture', - version: '0.0.1', - dependencies: { - underscore: '1.3.1', - async: '0.2.9', - checker: '0.5.1' - } -} - -test('setup', function (t) { - originalLog = console.log - fs.writeFileSync( - path.join(pkg, 'package.json'), - JSON.stringify(json, null, 2) - ) - - process.chdir(pkg) - t.end() -}) - -test('it should not throw', function (t) { - var output = [] - var expOut = [ - path.resolve(pkg, 'node_modules', 'async') + - ':async@0.2.9' + - ':async@0.2.9' + - ':async@0.2.10' + - '\n' + - path.resolve(pkg, 'node_modules', 'checker') + - ':checker@0.5.1' + - ':checker@0.5.1' + - ':checker@0.5.2' + - '\n' + - path.resolve(pkg, 'node_modules', 'underscore') + - ':underscore@1.3.1' + - ':underscore@1.3.1' + - ':underscore@1.5.1' - ] - - var expData = [ - [ - pkg, - 'async', - '0.2.9', - '0.2.9', - '0.2.10', - '0.2.9', - null - ], - [ - pkg, - 'checker', - '0.5.1', - '0.5.1', - '0.5.2', - '0.5.1', - null - ], - [ - pkg, - 'underscore', - '1.3.1', - '1.3.1', - '1.5.1', - '1.3.1', - null - ] - ] - - console.log = function () {} - mr({ port: common.port }, function (er, s) { - npm.load( - { - cache: cache, - loglevel: 'silent', - parseable: true, - registry: common.registry - }, - function () { - npm.install('.', function (err) { - t.ifError(err, 'install success') - console.log = function () { - output.push.apply(output, arguments) - } - npm.outdated(function (er, d) { - t.ifError(err, 'outdated completed without error') - t.equals(process.exitCode, 1, 'exitCode set to 1') - process.exitCode = 0 - output = output.map(function (x) { return x.replace(/\r/g, '') }) - console.log = originalLog - - t.same(output, expOut) - t.same(d, expData) - - s.close() - t.end() - }) - }) - } - ) - }) -}) - -test('cleanup', function (t) { - console.log = originalLog - t.end() -}) diff --git a/deps/npm/test/tap/override-bundled.js b/deps/npm/test/tap/override-bundled.js deleted file mode 100644 index 7f87c0999fe063..00000000000000 --- a/deps/npm/test/tap/override-bundled.js +++ /dev/null @@ -1,191 +0,0 @@ -'use strict' -var Bluebird = require('bluebird') -var test = require('tap').test -var fs = require('fs') -var mkdirp = require('mkdirp') -var rimraf = require('rimraf') -var path = require('path') -var common = require('../common-tap.js') - -var testname = path.basename(__filename, '.js') -var testdir = common.pkg -var testmod = path.resolve(testdir, 'top-test') -var testtgz = testmod + '-1.0.0.tgz' - -var bundleupdatesrc = path.resolve(testmod, 'bundle-update') -var bundleupdatetgz = bundleupdatesrc + '-1.0.0.tgz' -var bundleupdateNEW = path.resolve(bundleupdatesrc, 'NEW') -var bundleupdateNEWpostinstall = path.resolve(testdir, 'node_modules', 'bundle-update', 'NEW') -var bundleupdatebad = path.resolve(testmod, 'node_modules', 'bundle-update') - -var bundlekeepsrc = path.resolve(testmod, 'bundle-keep') -var bundlekeeptgz = bundlekeepsrc + '-1.0.0.tgz' -var bundlekeep = path.resolve(testmod, 'node_modules', 'bundle-keep') -var bundlekeepOLD = path.resolve(bundlekeep, 'OLD') -var bundlekeepOLDpostinstall = path.resolve(testdir, 'node_modules', 'top-test', 'node_modules', 'bundle-keep', 'OLD') - -var bundledeepsrc = path.resolve(testmod, 'bundle-deep') -var bundledeeptgz = bundledeepsrc + '-1.0.0.tgz' -var bundledeep = path.resolve(testmod, 'node_modules', 'bundle-deep') -var bundledeepOLD = path.resolve(bundledeep, 'OLD') -var bundledeepOLDpostinstall = path.resolve(testdir, 'node_modules', 'top-test', 'node_modules', 'bundle-deep', 'OLD') - -var bundledeepupdatesrc = path.resolve(testmod, 'bundle-deep-update') -var bundledeepupdatetgz = bundledeepupdatesrc + '-1.0.0.tgz' -var bundledeepupdate = path.resolve(bundledeep, 'node_modules', 'bundle-deep-update') -var bundledeepupdateNEW = path.resolve(bundledeepupdatesrc, 'NEW') -var bundledeepupdateNEWpostinstall = path.resolve(testdir, 'node_modules', 'bundle-deep-update', 'NEW') - -var testjson = { - dependencies: {'top-test': 'file:' + testtgz} -} - -var testmodjson = { - name: 'top-test', - version: '1.0.0', - dependencies: { - 'bundle-update': bundleupdatetgz, - 'bundle-keep': bundlekeeptgz, - 'bundle-deep': bundledeeptgz - }, - bundledDependencies: ['bundle-update', 'bundle-keep', 'bundle-deep'], - files: ['OLD', 'NEW'] -} -var bundlejson = { - name: 'bundle-update', - version: '1.0.0', - files: ['OLD', 'NEW'] -} - -var bundlekeepjson = { - name: 'bundle-keep', - version: '1.0.0', - _requested: { - rawSpec: bundlekeeptgz - }, - _resolved: bundlekeeptgz, - _shasum: 'baadf00d', - files: ['OLD', 'NEW'] - -} -var bundledeepjson = { - name: 'bundle-deep', - version: '1.0.0', - dependencies: { - 'bundle-deep-update': bundledeepupdatetgz - }, - _requested: { - rawSpec: bundledeeptgz - }, - _resolved: bundlekeeptgz, - _shasum: 'deadbeef', - files: ['OLD', 'NEW'] - -} - -var bundledeepupdatejson = { - version: '1.0.0', - name: 'bundle-deep-update', - files: ['OLD', 'NEW'] - -} - -function writepjs (dir, content) { - fs.writeFileSync(path.join(dir, 'package.json'), JSON.stringify(content, null, 2)) -} - -function setup () { - mkdirp.sync(testdir) - writepjs(testdir, testjson) - mkdirp.sync(testmod) - writepjs(testmod, testmodjson) - - mkdirp.sync(bundleupdatesrc) - writepjs(bundleupdatesrc, bundlejson) - fs.writeFileSync(bundleupdateNEW, '') - mkdirp.sync(bundleupdatebad) - writepjs(bundleupdatebad, bundlejson) - - mkdirp.sync(bundlekeepsrc) - writepjs(bundlekeepsrc, bundlekeepjson) - mkdirp.sync(bundlekeep) - writepjs(bundlekeep, bundlekeepjson) - fs.writeFileSync(bundlekeepOLD, '') - - mkdirp.sync(bundledeepsrc) - writepjs(bundledeepsrc, bundledeepjson) - mkdirp.sync(bundledeep) - writepjs(bundledeep, bundledeepjson) - fs.writeFileSync(bundledeepOLD, '') - - mkdirp.sync(bundledeepupdatesrc) - writepjs(bundledeepupdatesrc, bundledeepupdatejson) - mkdirp.sync(bundledeepupdate) - writepjs(bundledeepupdate, bundledeepupdatejson) - fs.writeFileSync(bundledeepupdateNEW, '') -} - -function cleanup () { - rimraf.sync(testdir) -} - -test('setup', function (t) { - cleanup() - setup() - return Bluebird.all([ - common.npm(['pack', bundleupdatesrc], {cwd: path.dirname(bundleupdatetgz), stdio: 'inherit'}), - common.npm(['pack', bundlekeepsrc], {cwd: path.dirname(bundlekeeptgz), stdio: 'inherit'}), - common.npm(['pack', bundledeepupdatesrc], {cwd: path.dirname(bundledeepupdatetgz), stdio: 'inherit'}) - ]).map((result) => result[0]).spread((bundleupdate, bundlekeep, bundledeepupdate) => { - t.is(bundleupdate, 0, 'bundleupdate') - t.is(bundlekeep, 0, 'bundlekeep') - t.is(bundledeepupdate, 0, 'bundledeepupdate') - }).then(() => { - return common.npm(['pack', bundledeepsrc], {cwd: path.dirname(bundledeeptgz), stdio: 'inherit'}) - }).spread((code) => { - t.is(code, 0, 'bundledeep') - return common.npm(['pack', testmod], {cwd: path.dirname(testtgz), stdio: 'inherit'}) - }).spread((code) => { - t.is(code, 0, 'testmod') - }) -}) - -test('bundled', function (t) { - common.npm(['install', '--loglevel=verbose'], {cwd: testdir}, function (err, code, stdout, stderr) { - if (err) throw err - t.plan(9) - t.is(code, 0, 'npm itself completed ok') - - // This tests that after the install we have a freshly installed version - // of `bundle-update` (in alignment with the package.json), instead of the - // version that was bundled with `top-test`. - // If npm doesn't do this, and selects the bundled version, things go very - // wrong because npm thinks it has a different module (with different - // metadata) installed in that location and will go off and try to do - // _things_ to it. Things like chmod in particular, which in turn results - // in the dreaded ENOENT errors. - t.like(stderr, new RegExp('npm WARN ' + testname), "didn't stomp on other warnings") - t.like(stderr, /npm verb.*bundle-update/, 'included update warning about bundled dep') - t.like(stderr, /npm verb.*bundle-deep-update/, 'included update warning about deeply bundled dep') - t.like(stderr, /npm WARN top-test@1\.0\.0 had bundled packages that do not match/, 'single grouped warning') - fs.stat(bundleupdateNEWpostinstall, function (missing) { - t.ok(!missing, 'package.json overrode bundle') - }) - fs.stat(bundledeepupdateNEWpostinstall, function (missing) { - t.ok(!missing, 'deep package.json overrode bundle') - }) - // Relatedly, when upgrading, if a bundled module is replacing an existing - // module we want to choose the bundled version, not the version we're replacing. - fs.stat(bundlekeepOLDpostinstall, function (missing) { - t.ok(!missing, 'no override when package.json matches') - }) - fs.stat(bundledeepOLDpostinstall, function (missing) { - t.ok(!missing, 'deep no override when package.json matches') - }) - }) -}) - -test('cleanup', function (t) { - cleanup() - t.end() -}) diff --git a/deps/npm/test/tap/owner.js b/deps/npm/test/tap/owner.js deleted file mode 100644 index 622b272852c7d0..00000000000000 --- a/deps/npm/test/tap/owner.js +++ /dev/null @@ -1,159 +0,0 @@ -var mr = require('npm-registry-mock') -var test = require('tap').test - -var common = require('../common-tap.js') -var basedir = common.pkg -var cachedir = common.cache - -var server - -var EXEC_OPTS = { - cwd: basedir, - stdio: [0, 'pipe', 2], - env: common.newEnv().extend({ - npm_config_cache: cachedir - }) -} - -var jashkenas = { - name: 'jashkenas', - email: 'jashkenas@gmail.com' -} - -var othiym23 = { - name: 'othiym23', - email: 'forrest@npmjs.com' -} - -var bcoe = { - name: 'bcoe', - email: 'ben@npmjs.com' -} - -function shrt (user) { - return user.name + ' <' + user.email + '>\n' -} - -function mocks (server) { - server.get('/-/user/org.couchdb.user:othiym23') - .many().reply(200, othiym23) - - // test 1 - server.get('/underscore') - .reply(200, { _id: 'underscore', _rev: 1, maintainers: [jashkenas] }) - server.put( - '/underscore/-rev/1', - { _id: 'underscore', _rev: 1, maintainers: [jashkenas, othiym23] }, - {} - ).reply(200, { _id: 'underscore', _rev: 2, maintainers: [jashkenas, othiym23] }) - - // test 2 - server.get('/@xxx%2fscoped') - .reply(200, { _id: '@xxx/scoped', _rev: 1, maintainers: [bcoe] }) - server.put( - '/@xxx%2fscoped/-rev/1', - { _id: '@xxx/scoped', _rev: 1, maintainers: [bcoe, othiym23] }, - {} - ).reply(200, { _id: '@xxx/scoped', _rev: 2, maintainers: [bcoe, othiym23] }) - - // test 3 - server.get('/underscore') - .reply(200, { _id: 'underscore', _rev: 2, maintainers: [jashkenas, othiym23] }) - - // test 4 - server.get('/underscore') - .reply(200, { _id: 'underscore', _rev: 2, maintainers: [jashkenas, othiym23] }) - server.put( - '/underscore/-rev/2', - { _id: 'underscore', _rev: 2, maintainers: [jashkenas] }, - {} - ).reply(200, { _id: 'underscore', _rev: 3, maintainers: [jashkenas] }) -} - -test('setup', function (t) { - mr({ port: common.port, plugin: mocks }, function (er, s) { - server = s - t.end() - }) -}) - -test('npm owner add', function (t) { - common.npm( - [ - '--loglevel', 'warn', - '--registry', common.registry, - 'owner', 'add', 'othiym23', 'underscore' - ], - EXEC_OPTS, - function (err, code, stdout, stderr) { - t.ifError(err, 'npm owner add ran without error') - t.notOk(code, 'npm owner add exited cleanly') - t.notOk(stderr, 'npm owner add ran silently') - t.equal(stdout, '+ othiym23 (underscore)\n', 'got expected add output') - - t.end() - } - ) -}) - -test('npm owner add (scoped)', function (t) { - common.npm( - [ - '--loglevel', 'silent', - '--registry', common.registry, - 'owner', 'add', 'othiym23', '@xxx/scoped' - ], - EXEC_OPTS, - function (err, code, stdout, stderr) { - t.ifError(err, 'npm owner add (scoped) ran without error') - t.notOk(code, 'npm owner add (scoped) exited cleanly') - t.notOk(stderr, 'npm owner add (scoped) ran silently') - t.equal(stdout, '+ othiym23 (@xxx/scoped)\n', 'got expected scoped add output') - - t.end() - } - ) -}) - -test('npm owner ls', function (t) { - common.npm( - [ - '--loglevel', 'silent', - '--registry', common.registry, - 'owner', 'ls', 'underscore' - ], - EXEC_OPTS, - function (err, code, stdout, stderr) { - t.ifError(err, 'npm owner ls ran without error') - t.notOk(code, 'npm owner ls exited cleanly') - t.notOk(stderr, 'npm owner ls ran silently') - t.equal(stdout, shrt(jashkenas) + shrt(othiym23), 'got expected ls output') - - t.end() - } - ) -}) - -test('npm owner rm', function (t) { - common.npm( - [ - '--loglevel', 'silent', - '--registry', common.registry, - 'owner', 'rm', 'othiym23', 'underscore' - ], - EXEC_OPTS, - function (err, code, stdout, stderr) { - t.ifError(err, 'npm owner rm ran without error') - t.notOk(code, 'npm owner rm exited cleanly') - t.notOk(stderr, 'npm owner rm ran silently') - t.equal(stdout, '- othiym23 (underscore)\n', 'got expected rm output') - - t.end() - } - ) -}) - -test('cleanup', function (t) { - server.close() - t.end() -}) diff --git a/deps/npm/test/tap/pack-files-and-ignores.js b/deps/npm/test/tap/pack-files-and-ignores.js deleted file mode 100644 index 4d9b97a32ad253..00000000000000 --- a/deps/npm/test/tap/pack-files-and-ignores.js +++ /dev/null @@ -1,707 +0,0 @@ -'use strict' -var test = require('tap').test -var common = require('../common-tap.js') -var path = require('path') -var rimraf = require('rimraf') -var mkdirp = require('mkdirp') -var fs = require('graceful-fs') -var tar = require('tar') -var basepath = common.pkg -var fixturepath = path.resolve(basepath, 'npm-test-files') -var targetpath = path.resolve(basepath, 'target') -var Tacks = require('tacks') -var File = Tacks.File -var Dir = Tacks.Dir - -test('basic file inclusion', function (t) { - var fixture = new Tacks( - Dir({ - 'package.json': File({ - name: 'npm-test-files', - version: '1.2.5', - files: [ - 'include', - 'sub/include' - ] - }), - include: File(''), - sub: Dir({ include: File('') }), - notincluded: File('') - }) - ) - withFixture(t, fixture, function (done) { - t.ok(fileExists('include'), 'toplevel file included') - t.ok(fileExists('sub/include'), 'nested file included') - t.notOk(fileExists('notincluded'), 'unspecified file not included') - done() - }) -}) - -test('basic file exclusion', function (t) { - var fixture = new Tacks( - Dir({ - 'package.json': File({ - name: 'npm-test-files', - version: '1.2.5' - }), - '.npmignore': File( - 'ignore\n' + - 'sub/ignore\n' - ), - include: File(''), - ignore: File(''), - sub: Dir({ ignore: File('') }) - }) - ) - withFixture(t, fixture, function (done) { - t.notOk(fileExists('ignore'), 'toplevel file excluded') - t.notOk(fileExists('sub/ignore'), 'nested file excluded') - t.ok(fileExists('include'), 'unignored file included') - done() - }) -}) - -test('toplevel-only and blanket ignores', function (t) { - var fixture = new Tacks( - Dir({ - 'package.json': File({ - name: 'npm-test-files', - version: '1.2.5' - }), - '.npmignore': File( - './shallow1\n' + - '/shallow2\n' + - '/sub/onelevel\n' + - 'deep\n' + - '' - ), - shallow1: File(''), - shallow2: File(''), - deep: File(''), - sub: Dir({ - shallow1: File(''), - shallow2: File(''), - onelevel: File(''), - deep: File(''), - sub: Dir({ - deep: File(''), - onelevel: File('') - }) - }) - }) - ) - withFixture(t, fixture, function (done) { - t.notOk(fileExists('shallow2'), '/ file excluded') - t.ok(fileExists('sub/shallow1'), 'nested ./ file included') - t.ok(fileExists('sub/shallow2'), 'nested / file included') - t.ok(fileExists('sub/sub/onelevel'), 'double-nested file included') - t.notOk(fileExists('sub/onelevel'), 'nested / file excluded') - t.notOk(fileExists('deep'), 'deep file excluded') - t.notOk(fileExists('sub/deep'), 'nested deep file excluded') - t.notOk(fileExists('sub/sub/deep'), 'double-nested deep file excluded') - t.ok(fileExists('shallow1'), './ file included') - done() - }) -}) - -test('.npmignore works for nested directories recursively', function (t) { - var fixture = new Tacks( - Dir({ - 'package.json': File({ - name: 'npm-test-files', - version: '1.2.5' - }), - '.npmignore': File( - '/ignore\n' + - 'deep\n' - ), - include: File(''), - ignore: File(''), - deep: File(''), - sub: Dir({ - ignore: File(''), - include: File(''), - deep: File(''), - sub: Dir({ - '.npmignore': File( - '/ignore\n' - ), - ignore: File(''), - include: File(''), - deep: File('') - }) - }) - }) - ) - withFixture(t, fixture, function (done) { - t.notOk(fileExists('ignore'), 'toplevel file excluded') - t.ok(fileExists('include'), 'unignored file included') - t.ok(fileExists('sub/ignore'), 'same-name file in nested dir included') - t.ok(fileExists('sub/include'), 'unignored nested dir file included') - t.notOk(fileExists('sub/sub/ignore'), 'sub-sub-directory file excluded') - t.ok(fileExists('sub/sub/include'), 'sub-sube-directory file included') - t.notOk(fileExists('deep'), 'deep file excluded') - t.notOk(fileExists('sub/deep'), 'sub-dir deep file excluded') - t.notOk(fileExists('sub/sub/deep'), 'sub-sub-dir deep file excluded') - done() - }) -}) - -test('.gitignore should have identical semantics', function (t) { - var fixture = new Tacks( - Dir({ - 'package.json': File({ - name: 'npm-test-files', - version: '1.2.5' - }), - '.gitignore': File( - './shallow1\n' + - '/shallow2\n' + - '/sub/onelevel\n' + - 'deep\n' + - '' - ), - shallow1: File(''), - shallow2: File(''), - deep: File(''), - sub: Dir({ - shallow1: File(''), - shallow2: File(''), - onelevel: File(''), - deep: File(''), - sub: Dir({ - deep: File(''), - onelevel: File('') - }) - }) - }) - ) - withFixture(t, fixture, function (done) { - t.notOk(fileExists('shallow2'), '/ file excluded') - t.ok(fileExists('sub/shallow1'), 'nested ./ file included') - t.ok(fileExists('sub/shallow2'), 'nested / file included') - t.ok(fileExists('sub/sub/onelevel'), 'double-nested file included') - t.notOk(fileExists('sub/onelevel'), 'nested / file excluded') - t.notOk(fileExists('deep'), 'deep file excluded') - t.notOk(fileExists('sub/deep'), 'nested deep file excluded') - t.notOk(fileExists('sub/sub/deep'), 'double-nested deep file excluded') - t.ok(fileExists('shallow1'), './ file included') - done() - }) -}) - -test('.npmignore should always be overridden by files array', function (t) { - var fixture = new Tacks( - Dir({ - 'package.json': File({ - name: 'npm-test-files', - version: '1.2.5', - files: [ - 'include', - 'sub' - ] - }), - '.npmignore': File( - 'include\n' + - 'ignore\n' + - 'sub/included\n' - ), - include: File(''), - ignore: File(''), - sub: Dir({ - included: File('') - }) - }) - ) - withFixture(t, fixture, function (done) { - t.notOk(fileExists('ignore'), 'toplevel file excluded') - t.ok(fileExists('include'), 'unignored file included') - t.ok(fileExists('sub/included'), 'nested file included') - done() - }) -}) - -test('.gitignore supported for ignores', function (t) { - var fixture = new Tacks( - Dir({ - 'package.json': File({ - name: 'npm-test-files', - version: '1.2.5' - }), - '.gitignore': File( - 'ignore\n' + - 'sub/ignore\n' - ), - include: File(''), - ignore: File(''), - sub: Dir({ ignore: File('') }) - }) - ) - withFixture(t, fixture, function (done) { - t.notOk(fileExists('ignore'), 'toplevel file excluded') - t.notOk(fileExists('sub/ignore'), 'nested file excluded') - t.ok(fileExists('include'), 'unignored file included') - done() - }) -}) - -test('.npmignore completely overrides .gitignore', function (t) { - var fixture = new Tacks( - Dir({ - 'package.json': File({ - name: 'npm-test-files', - version: '1.2.5' - }), - '.npmignore': File( - 'ignore\n' + - 'sub/ignore\n' - ), - '.gitignore': File( - 'include\n' + - 'sub/include\n' + - 'extra\n' - ), - include: File(''), - sub: Dir({ include: File('') }), - extra: File('') - }) - ) - withFixture(t, fixture, function (done) { - t.ok(fileExists('include'), 'gitignored toplevel file included') - t.ok(fileExists('extra'), 'gitignored extra toplevel file included') - t.ok(fileExists('sub/include'), 'gitignored nested file included') - t.notOk(fileExists('ignore'), 'toplevel file excluded') - t.notOk(fileExists('sub/ignore'), 'nested file excluded') - done() - }) -}) - -test('files array overrides .npmignore', function (t) { - var fixture = new Tacks( - Dir({ - 'package.json': File({ - name: 'npm-test-files', - version: '1.2.5', - files: [ - 'include', - 'sub/include' - ] - }), - '.npmignore': File( - 'include\n' + - 'sub/include\n' - ), - include: File(''), - sub: Dir({ include: File('') }) - }) - ) - withFixture(t, fixture, function (done) { - t.ok(fileExists('include'), 'toplevel file included') - t.ok(fileExists('sub/include'), 'nested file included') - done() - }) -}) - -test('includes files regardless of emptiness', function (t) { - var fixture = new Tacks( - Dir({ - 'package.json': File({ - name: 'npm-test-files', - version: '1.2.5', - files: [ - 'full', - 'empty' - ] - }), - full: File('This file has contents~'), - empty: File('') - }) - ) - withFixture(t, fixture, function (done) { - t.ok(fileExists('full'), 'contentful file included') - t.ok(fileExists('empty'), 'empty file included') - done() - }) -}) - -test('.npmignore itself gets included', function (t) { - var fixture = new Tacks( - Dir({ - 'package.json': File({ - name: 'npm-test-files', - version: '1.2.5', - files: [ - '.npmignore' - ] - }), - '.npmignore': File('') - }) - ) - withFixture(t, fixture, function (done) { - t.ok(fileExists('.npmignore'), '.npmignore included') - done() - }) -}) - -test('include default files when missing files spec', function (t) { - var fixture = new Tacks( - Dir({ - 'package.json': File({ - name: 'npm-test-files', - version: '1.2.5' - }), - 'index.js': File(''), - foo: File(''), - node_modules: Dir({foo: Dir({bar: File('')})}) - }) - ) - withFixture(t, fixture, function (done) { - t.ok(fileExists('index.js'), 'index.js included') - t.ok(fileExists('foo'), 'foo included') - t.notOk(fileExists('node_modules'), 'node_modules not included') - done() - }) -}) - -test('include main file', function (t) { - var fixture = new Tacks( - Dir({ - 'package.json': File({ - name: 'npm-test-files', - version: '1.2.5', - main: 'foo.js', - files: [] - }), - 'index.js': File(''), - 'foo.js': File('') - }) - ) - withFixture(t, fixture, function (done) { - t.ok(fileExists('foo.js'), 'foo.js included because of main') - t.notOk(fileExists('index.js'), 'index.js not included') - done() - }) -}) - -test('certain files ignored by default', function (t) { - var fixture = new Tacks( - Dir({ - 'package.json': File({ - name: 'npm-test-files', - version: '1.2.5' - }), - '.git': Dir({foo: File('')}), - '.svn': Dir({foo: File('')}), - 'CVS': Dir({foo: File('')}), - '.hg': Dir({foo: File('')}), - '.lock-wscript': File(''), - '.wafpickle-0': File(''), - '.wafpickle-5': File(''), - '.wafpickle-50': File(''), - 'build': Dir({'config.gypi': File('')}), - 'npm-debug.log': File(''), - '.npmrc': File(''), - '.foo.swp': File(''), - 'core': Dir({core: File(''), foo: File('')}), - '.DS_Store': Dir({foo: File('')}), - '._ohno': File(''), - '._ohnoes': Dir({noes: File('')}), - 'foo.orig': File(''), - 'package-lock.json': File('') - }) - ) - withFixture(t, fixture, function (done) { - t.notOk(fileExists('.git'), '.git not included') - t.notOk(fileExists('.svn'), '.svn not included') - t.notOk(fileExists('CVS'), 'CVS not included') - t.notOk(fileExists('.hg'), '.hg not included') - t.notOk(fileExists('.lock-wscript'), '.lock-wscript not included') - t.notOk(fileExists('.wafpickle-0'), '.wafpickle-0 not included') - t.notOk(fileExists('.wafpickle-5'), '.wafpickle-5 not included') - t.notOk(fileExists('.wafpickle-50'), '.wafpickle-50 not included') - t.notOk(fileExists('build/config.gypi'), 'build/config.gypi not included') - t.notOk(fileExists('npm-debug.log'), 'npm-debug.log not included') - t.notOk(fileExists('.npmrc'), '.npmrc not included') - t.notOk(fileExists('.foo.swp'), '.foo.swp not included') - t.ok(fileExists('core'), 'core/ included') - t.ok(fileExists('core/foo'), 'core/foo included') - t.notOk(fileExists('core/core'), 'core/core not included') - t.notOk(fileExists('.DS_Store'), '.DS_Store not included') - t.notOk(fileExists('.DS_Store/foo'), '.DS_Store/foo not included') - t.notOk(fileExists('._ohno'), '._ohno not included') - t.notOk(fileExists('._ohnoes'), '._ohnoes not included') - t.notOk(fileExists('foo.orig'), 'foo.orig not included') - t.notOk(fileExists('package-lock.json'), 'package-lock.json not included') - done() - }) -}) - -test('default-ignored files can be explicitly included', function (t) { - var fixture = new Tacks( - Dir({ - 'package.json': File({ - name: 'npm-test-files', - version: '1.2.5', - files: [ - '.git', - '.svn', - 'CVS', - '.hg', - '.lock-wscript', - '.wafpickle-0', - '.wafpickle-5', - '.wafpickle-50', - 'build/config.gypi', - 'npm-debug.log', - '.npmrc', - '.foo.swp', - 'core', - '.DS_Store', - '._ohno', - '._ohnoes', - 'foo.orig', - 'package-lock.json' - ] - }), - '.git': Dir({foo: File('')}), - '.svn': Dir({foo: File('')}), - 'CVS': Dir({foo: File('')}), - '.hg': Dir({foo: File('')}), - '.lock-wscript': File(''), - '.wafpickle-0': File(''), - '.wafpickle-5': File(''), - '.wafpickle-50': File(''), - 'build': Dir({'config.gypi': File('')}), - 'npm-debug.log': File(''), - '.npmrc': File(''), - '.foo.swp': File(''), - 'core': Dir({core: File(''), foo: File('')}), - '.DS_Store': Dir({foo: File('')}), - '._ohno': File(''), - '._ohnoes': Dir({noes: File('')}), - 'foo.orig': File(''), - 'package-lock.json': File('') - }) - ) - withFixture(t, fixture, function (done) { - t.notOk(fileExists('.git'), '.git should never be included') - t.ok(fileExists('.svn'), '.svn included') - t.ok(fileExists('CVS'), 'CVS included') - t.ok(fileExists('.hg'), '.hg included') - t.ok(fileExists('.lock-wscript'), '.lock-wscript included') - t.ok(fileExists('.wafpickle-0'), '.wafpickle-0 included') - t.ok(fileExists('.wafpickle-5'), '.wafpickle-5 included') - t.ok(fileExists('.wafpickle-50'), '.wafpickle-50 included') - t.ok(fileExists('build/config.gypi'), 'build/config.gypi included') - t.ok(fileExists('npm-debug.log'), 'npm-debug.log included') - t.ok(fileExists('.npmrc'), '.npmrc included') - t.ok(fileExists('.foo.swp'), '.foo.swp included') - t.ok(fileExists('core'), 'core/ included') - t.ok(fileExists('core/foo'), 'core/foo included') - t.ok(fileExists('core/core'), 'core/core included') - t.ok(fileExists('.DS_Store'), '.DS_Store included') - t.ok(fileExists('._ohno'), '._ohno included') - t.ok(fileExists('._ohnoes'), '._ohnoes included') - t.ok(fileExists('foo.orig'), 'foo.orig included') - t.ok(fileExists('package-lock.json'), 'package-lock.json included') - done() - }) -}) - -test('certain files included unconditionally', function (t) { - var fixture = new Tacks( - Dir({ - 'package.json': File({ - name: 'npm-test-files', - version: '1.2.5' - }), - '.npmignore': File( - 'package.json', - 'README', - 'Readme', - 'readme.md', - 'readme.randomext', - 'changelog', - 'CHAngelog', - 'ChangeLOG.txt', - 'history', - 'HistorY', - 'HistorY.md', - 'license', - 'licence', - 'LICENSE', - 'LICENCE' - ), - 'README': File(''), - 'Readme': File(''), - 'readme.md': File(''), - 'readme.randomext': File(''), - 'changelog': File(''), - 'CHAngelog': File(''), - 'ChangeLOG.txt': File(''), - 'history': File(''), - 'HistorY': File(''), - 'HistorY.md': File(''), - 'license': File(''), - 'licence': File(''), - 'LICENSE': File(''), - 'LICENCE': File('') - }) - ) - withFixture(t, fixture, function (done) { - t.ok(fileExists('package.json'), 'package.json included') - t.ok(fileExists('README'), 'README included') - t.ok(fileExists('Readme'), 'Readme included') - t.ok(fileExists('readme.md'), 'readme.md included') - t.ok(fileExists('readme.randomext'), 'readme.randomext included') - t.ok(fileExists('changelog'), 'changelog included') - t.ok(fileExists('CHAngelog'), 'CHAngelog included') - t.ok(fileExists('ChangeLOG.txt'), 'ChangeLOG.txt included') - t.ok(fileExists('license'), 'license included') - t.ok(fileExists('licence'), 'licence included') - t.ok(fileExists('LICENSE'), 'LICENSE included') - t.ok(fileExists('LICENCE'), 'LICENCE included') - done() - }) -}) - -test('unconditional inclusion does not capture modules', function (t) { - var fixture = new Tacks( - Dir({ - 'package.json': File({ - name: 'npm-test-files', - version: '1.2.5' - }), - 'node_modules': Dir({ - 'readme': Dir({ 'file': File('') }), - 'README': Dir({ 'file': File('') }), - 'licence': Dir({ 'file': File('') }), - 'license': Dir({ 'file': File('') }), - 'history': Dir({ 'file': File('') }), - 'History': Dir({ 'file': File('') }), - 'changelog': Dir({ 'file': File('') }), - 'ChangeLOG': Dir({ 'file': File('') }) - }) - }) - ) - withFixture(t, fixture, function (done) { - t.notOk(fileExists('node_modules/readme/file'), 'readme module not included') - t.notOk(fileExists('node_modules/README/file'), 'README module not included') - t.notOk(fileExists('node_modules/licence/file'), 'licence module not included') - t.notOk(fileExists('node_modules/license/file'), 'license module not included') - t.notOk(fileExists('node_modules/history/file'), 'history module not included') - t.notOk(fileExists('node_modules/History/file'), 'History module not included') - t.notOk(fileExists('node_modules/changelog/file'), 'changelog module not included') - t.notOk(fileExists('node_modules/ChangeLOG/file'), 'ChangeLOG module not included') - - done() - }) -}) - -test('folder-based inclusion works', function (t) { - var fixture = new Tacks( - Dir({ - 'package.json': File({ - name: 'npm-test-files', - version: '1.2.5', - files: [ - 'sub1/sub', - 'sub2' - ] - }), - sub1: Dir({ - sub: Dir({ - include1: File(''), - include2: File('') - }), - ignored: File('') - }), - sub2: Dir({ - include1: File(''), - include2: File(''), - empty: Dir({}) - }) - }) - ) - withFixture(t, fixture, function (done) { - t.ok(fileExists('sub1/sub/include1'), 'nested dir included') - t.ok(fileExists('sub1/sub/include2'), 'nested dir included') - t.notOk(fileExists('sub1/ignored'), 'unspecified file not included') - - t.ok(fileExists('sub2/include1'), 'dir contents included') - t.ok(fileExists('sub2/include2'), 'dir contents included') - t.notOk(fileExists('sub2/empty'), 'empty dir not included') - - done() - }) -}) - -test('file that starts with @ sign included normally', (t) => { - const fixture = new Tacks( - Dir({ - 'package.json': File({ - name: 'npm-test-files', - version: '1.2.5' - }), - '@sub1': Dir({ - sub: Dir({ - include1: File('') - }) - }), - sub2: Dir({ - '@include': File(''), - '@sub3': Dir({ - include1: File('') - }) - }) - }) - ) - withFixture(t, fixture, function (done) { - t.ok(fileExists('@sub1/sub/include1'), '@ dir included') - - t.ok(fileExists('sub2/@include'), '@ file included') - t.ok(fileExists('sub2/@sub3/include1'), 'nested @ dir included') - - done() - }) -}) - -function fileExists (file) { - try { - return !!fs.statSync(path.resolve(targetpath, 'package', file)) - } catch (_) { - return false - } -} - -function withFixture (t, fixture, tester) { - fixture.create(fixturepath) - mkdirp.sync(targetpath) - common.npm(['pack', fixturepath], {cwd: basepath}, extractAndCheck) - function extractAndCheck (err, code) { - if (err) throw err - t.is(code, 0, 'pack went ok') - extractTarball(checkTests) - } - function checkTests (err) { - if (err) throw err - tester(removeAndDone) - } - function removeAndDone (err) { - if (err) throw err - fixture.remove(fixturepath) - rimraf.sync(basepath) - t.done() - } -} - -function extractTarball (cb) { - // Unpack to disk so case-insensitive filesystems are consistent - tar.extract({ - file: basepath + '/npm-test-files-1.2.5.tgz', - cwd: targetpath, - sync: true - }) - - cb() -} diff --git a/deps/npm/test/tap/pack-scoped.js b/deps/npm/test/tap/pack-scoped.js deleted file mode 100644 index 06d02297fd5d02..00000000000000 --- a/deps/npm/test/tap/pack-scoped.js +++ /dev/null @@ -1,81 +0,0 @@ -// verify that prepublish runs on pack and publish -var test = require('tap').test -var common = require('../common-tap') -var fs = require('graceful-fs') -var join = require('path').join -var mkdirp = require('mkdirp') -var rimraf = require('rimraf') - -var pkg = common.pkg -var manifest = join(pkg, 'package.json') -var tmp = join(pkg, 'tmp') -var cache = common.cache - -var data = { - name: '@scope/generic-package', - version: '90000.100001.5' -} - -test('setup', function (t) { - var n = 0 - - rimraf.sync(pkg) - - mkdirp(pkg, then()) - mkdirp(cache, then()) - mkdirp(tmp, then()) - - function then () { - n++ - return function (er) { - t.ifError(er) - if (--n === 0) next() - } - } - - function next () { - fs.writeFile(manifest, JSON.stringify(data), 'ascii', done) - } - - function done (er) { - t.ifError(er) - - t.pass('setup done') - t.end() - } -}) - -test('test', function (t) { - var env = { - 'npm_config_cache': cache, - 'npm_config_tmp': tmp, - 'npm_config_prefix': pkg, - 'npm_config_global': 'false' - } - - for (var i in process.env) { - if (!/^npm_config_/.test(i)) env[i] = process.env[i] - } - - common.npm([ - 'pack', - '--loglevel', 'warn' - ], { - cwd: pkg, - env: env - }, function (err, code, stdout, stderr) { - t.ifErr(err, 'npm pack finished without error') - t.equal(code, 0, 'npm pack exited ok') - t.notOk(stderr, 'got stderr data: ' + JSON.stringify('' + stderr)) - stdout = stdout.trim() - var regex = new RegExp('scope-generic-package-90000.100001.5.tgz', 'ig') - t.ok(stdout.match(regex), 'found package') - t.end() - }) -}) - -test('cleanup', function (t) { - rimraf.sync(pkg) - t.pass('cleaned up') - t.end() -}) diff --git a/deps/npm/test/tap/pack.js b/deps/npm/test/tap/pack.js deleted file mode 100644 index 23c8296d003cd2..00000000000000 --- a/deps/npm/test/tap/pack.js +++ /dev/null @@ -1,199 +0,0 @@ -'use strict' - -const BB = require('bluebird') - -const test = require('tap').test -const common = require('../common-tap') -const fs = BB.promisifyAll(require('graceful-fs')) -const path = require('path') -const rimraf = BB.promisify(require('rimraf')) -const Tacks = require('tacks') - -const Dir = Tacks.Dir -const File = Tacks.File - -const testDir = common.pkg -const tmp = path.join(testDir, 'tmp') -const cache = common.cache - -test('basic pack', (t) => { - const fixture = new Tacks(new Dir({ - 'package.json': new File({ - name: 'generic-package', - version: '90000.100001.5' - }) - })) - return rimraf(testDir) - .then(() => fixture.create(testDir)) - .then(() => common.npm([ - 'pack', - '--loglevel', 'notice', - '--cache', cache, - '--tmp', tmp, - '--prefix', testDir, - '--no-global' - ], { - cwd: testDir - })) - .spread((code, stdout, stderr) => { - t.equal(code, 0, 'npm pack exited ok') - t.match(stderr, /notice\s+\d+[a-z]+\s+package\.json/gi, 'mentions package.json') - t.match(stdout, /generic-package-90000\.100001\.5\.tgz/ig, 'found pkg') - return fs.statAsync( - path.join(testDir, 'generic-package-90000.100001.5.tgz') - ) - }) - .then((stat) => t.ok(stat, 'tarball written to cwd')) - .then(() => rimraf(testDir)) -}) - -test('pack with bundled', (t) => { - const fixture = new Tacks(new Dir({ - 'package.json': new File({ - name: 'generic-package', - version: '90000.100001.5', - dependencies: { - '@bundle/dep': '^1.0.0', - 'regular-dep': '^1.0.0' - }, - bundleDependencies: [ - '@bundle/dep', - 'regular-dep' - ] - }), - 'node_modules': new Dir({ - 'regular-dep': new Dir({ - 'package.json': new File({ - name: 'regular-dep', - version: '1.0.0' - }) - }), - '@bundle': new Dir({ - 'dep': new Dir({ - 'package.json': new File({ - name: '@bundle/dep', - version: '1.0.0' - }) - }) - }) - }) - })) - return rimraf(testDir) - .then(() => fixture.create(testDir)) - .then(() => common.npm([ - 'pack', - '--loglevel', 'notice', - '--cache', cache, - '--tmp', tmp, - '--prefix', testDir, - '--no-global' - ], { - cwd: testDir - })) - .spread((code, stdout, stderr) => { - t.equal(code, 0, 'npm pack exited ok') - t.match(stderr, /notice\s+\d+[a-z]+\s+package\.json/gi, 'mentions package.json') - t.match(stderr, /notice\s+regular-dep/, 'regular dep mentioned') - t.match(stderr, /notice\s+@bundle\/dep/, 'bundled dep mentioned') - }) - .then(() => rimraf(testDir)) -}) - -test('pack --dry-run', (t) => { - const fixture = new Tacks(new Dir({ - 'package.json': new File({ - name: 'generic-package', - version: '90000.100001.5' - }) - })) - return rimraf(testDir) - .then(() => fixture.create(testDir)) - .then(() => common.npm([ - 'pack', - '--dry-run', - '--loglevel', 'notice', - '--cache', cache, - '--tmp', tmp, - '--prefix', testDir, - '--no-global' - ], { - cwd: testDir - })) - .spread((code, stdout, stderr) => { - t.equal(code, 0, 'npm pack exited ok') - t.match(stdout, /generic-package-90000\.100001\.5\.tgz/ig, 'found pkg') - return fs.statAsync( - path.join(testDir, 'generic-package-90000.100001.5.tgz') - ) - .then( - () => { throw new Error('should have failed') }, - (err) => t.equal(err.code, 'ENOENT', 'no tarball written!') - ) - }) - .then(() => rimraf(testDir)) -}) - -test('pack --json', (t) => { - const fixture = new Tacks(new Dir({ - 'package.json': new File({ - name: 'generic-package', - version: '90000.100001.5' - }) - })) - return rimraf(testDir) - .then(() => fixture.create(testDir)) - .then(() => common.npm([ - 'pack', - '--dry-run', - '--json', - '--loglevel', 'notice', - '--cache', cache, - '--tmp', tmp, - '--prefix', testDir, - '--no-global' - ], { - cwd: testDir - })) - .spread((code, stdout, stderr) => { - t.equal(code, 0, 'npm pack exited ok') - t.equal(stderr.trim(), '', 'no notice output') - t.similar(JSON.parse(stdout), [{ - filename: 'generic-package-90000.100001.5.tgz', - files: [{path: 'package.json'}], - entryCount: 1 - }], 'pack details output as valid json') - }) - .then(() => rimraf(testDir)) -}) - -test('postpack', (t) => { - const fixture = new Tacks(new Dir({ - 'package.json': new File({ - name: 'generic-package', - version: '90000.100001.5', - scripts: { - postpack: 'node -e "var fs = require(\'fs\'); fs.openSync(\'postpack-step\', \'w+\'); if (!fs.existsSync(\'generic-package-90000.100001.5.tgz\')) { throw new Error(\'tar archive does not exist on postpack\') }"' - } - }) - })) - - return rimraf(testDir) - .then(() => fixture.create(testDir)) - .then(() => common.npm([ - 'pack', - '--loglevel', 'notice', - '--cache', cache, - '--tmp', tmp, - '--prefix', testDir, - '--no-global' - ], { - cwd: testDir - })) - .spread((code, stdout, stderr) => { - t.equal(code, 0, 'npm pack exited ok') - return fs.statAsync( - path.join(testDir, 'postpack-step') - ) - }) - .then(() => rimraf(testDir)) -}) diff --git a/deps/npm/test/tap/peer-deps.js b/deps/npm/test/tap/peer-deps.js deleted file mode 100644 index 558fe9c4e6d965..00000000000000 --- a/deps/npm/test/tap/peer-deps.js +++ /dev/null @@ -1,52 +0,0 @@ -var fs = require('graceful-fs') -var path = require('path') - -var mr = require('npm-registry-mock') -var test = require('tap').test - -var common = require('../common-tap.js') -var npm = require('../../') - -var pkg = common.pkg - -var expected = [ 'peer dep missing: request@0.9.x, required by npm-test-peer-deps@0.0.0' ] - -var json = { - author: 'Domenic Denicola', - name: 'npm-test-peer-deps-installer', - version: '0.0.0', - dependencies: { - 'npm-test-peer-deps': '*' - } -} - -function setup (cb) { - fs.writeFileSync( - path.join(pkg, 'package.json'), - JSON.stringify(json, null, 2) - ) - process.chdir(pkg) - - var opts = { cache: common.cache, registry: common.registry } - npm.load(opts, cb) -} - -test('installs the peer dependency directory structure', function (t) { - mr({ port: common.port }, function (er, s) { - setup(function (err) { - if (err) return t.fail(err) - - npm.install('.', function (err) { - if (err) return t.fail(err) - - npm.commands.ls([], true, function (err, _, results) { - if (err) return t.fail(err) - - t.deepEqual(results.problems, expected) - s.close() - t.end() - }) - }) - }) - }) -}) diff --git a/deps/npm/test/tap/pick-manifest-from-registry-metadata.js b/deps/npm/test/tap/pick-manifest-from-registry-metadata.js deleted file mode 100644 index 3af354aed3819c..00000000000000 --- a/deps/npm/test/tap/pick-manifest-from-registry-metadata.js +++ /dev/null @@ -1,145 +0,0 @@ -'use strict' -var test = require('tap').test - -var pickManifest = require('../../lib/utils/pick-manifest-from-registry-metadata.js') - -test('basic carat range selection', function (t) { - var metadata = { - 'dist-tags': { - 'example': '1.1.0' - }, - versions: { - '1.0.0': { version: '1.0.0' }, - '1.0.1': { version: '1.0.1' }, - '1.0.2': { version: '1.0.2' }, - '1.1.0': { version: '1.1.0' }, - '2.0.0': { version: '2.0.0' } - } - } - var versions = Object.keys(metadata.versions) - var selected = pickManifest('^1.0.0', 'latest', versions, metadata) - t.equal(selected.manifest.version, '1.1.0', 'picked the right manifest using ^') - t.equal(selected.resolvedTo, '1.1.0', 'resolved using version match') - selected = pickManifest('^1.0.0', 'example', versions, metadata) - t.equal(selected.manifest.version, '1.1.0', 'picked the right manifest using ^') - t.equal(selected.resolvedTo, 'example', 'resolved using tag') - t.end() -}) - -test('basic tilde range selection', function (t) { - var metadata = { - 'dist-tags': { - 'example': '1.1.0' - }, - versions: { - '1.0.0': { version: '1.0.0' }, - '1.0.1': { version: '1.0.1' }, - '1.0.2': { version: '1.0.2' }, - '1.1.0': { version: '1.1.0' }, - '2.0.0': { version: '2.0.0' } - } - } - var versions = Object.keys(metadata.versions) - var selected = pickManifest('~1.0.0', 'latest', versions, metadata) - t.equal(selected.manifest.version, '1.0.2', 'picked the right manifest using ~') - t.equal(selected.resolvedTo, '1.0.2', 'resolved using version match') - t.end() -}) - -test('basic mathematical range selection', function (t) { - var metadata = { - 'dist-tags': {}, - versions: { - '1.0.0': { version: '1.0.0' }, - '1.0.1': { version: '1.0.1' }, - '1.0.2': { version: '1.0.2' }, - '2.0.0': { version: '2.0.0' } - } - } - var versions = Object.keys(metadata.versions) - var selected = pickManifest('>=1.0.0 <2', 'example', versions, metadata) - t.equal(selected.manifest.version, '1.0.2', 'picked the right manifest using mathematical range') - t.equal(selected.resolvedTo, '1.0.2', 'resolved using version match') - t.end() -}) - -test('basic version selection', function (t) { - var metadata = { - 'dist-tags': {}, - versions: { - '1.0.0': { version: '1.0.0' }, - '1.0.1': { version: '1.0.1' }, - '1.0.2': { version: '1.0.2' }, - '2.0.0': { version: '2.0.0' } - } - } - var versions = Object.keys(metadata.versions) - var selected = pickManifest('1.0.0', 'latest', versions, metadata) - t.equal(selected.manifest.version, '1.0.0', 'picked the right manifest using specific version') - t.equal(selected.resolvedTo, '1.0.0', 'resolved using version match') - t.end() -}) - -test('nothing if range does not match anything', function (t) { - var metadata = { - 'dist-tags': {}, - versions: { - '1.0.0': { version: '1.0.0' }, - '2.0.0': { version: '2.0.0' }, - '2.0.5': { version: '2.0.5' } - } - } - var versions = Object.keys(metadata.versions) - var selected = pickManifest('^2.1.0', 'latest', versions, metadata) - t.equal(selected, undefined, 'no manifest matched') - t.end() -}) - -test('if `defaultTag` matches a given range, use it', function (t) { - var metadata = { - 'dist-tags': { - foo: '1.0.1' - }, - versions: { - '1.0.0': { version: '1.0.0' }, - '1.0.1': { version: '1.0.1' }, - '1.0.2': { version: '1.0.2' }, - '2.0.0': { version: '2.0.0' } - } - } - var versions = Object.keys(metadata.versions) - var selected = pickManifest('^1.0.0', 'foo', versions, metadata) - t.equal(selected.manifest.version, '1.0.1', 'picked the version for foo') - t.equal(selected.resolvedTo, 'foo', 'resolved using tag') - - selected = pickManifest('^2.0.0', 'foo', versions, metadata) - t.equal(selected.manifest.version, '2.0.0', 'no match, no foo') - t.equal(selected.resolvedTo, '2.0.0', 'resolved using version match') - - t.end() -}) - -test('* ranges use `defaultTag` if no versions match', function (t) { - var metadata = { - 'dist-tags': { - beta: '2.0.0-beta.0' - }, - versions: { - '1.0.0-pre.0': { version: '1.0.0-pre.0' }, - '1.0.0-pre.1': { version: '1.0.0-pre.1' }, - '2.0.0-beta.0': { version: '2.0.0-beta.0' }, - '2.0.0-beta.1': { version: '2.0.0-beta.1' } - } - } - var versions = Object.keys(metadata.versions) - var selected = pickManifest('*', 'beta', versions, metadata) - t.equal(selected.manifest.version, '2.0.0-beta.0', 'used defaultTag for all-prerelease splat.') - t.equal(selected.resolvedTo, 'beta', 'resolved using tag') - t.end() -}) - -test('no result if metadata has no versions', function (t) { - var selected = pickManifest('^1.0.0', 'latest', [], {'dist-tags': {}, versions: {}}) - t.equal(selected, undefined, 'no versions, no result') - t.end() -}) diff --git a/deps/npm/test/tap/ping.js b/deps/npm/test/tap/ping.js deleted file mode 100644 index 3687b05bd4518c..00000000000000 --- a/deps/npm/test/tap/ping.js +++ /dev/null @@ -1,95 +0,0 @@ -var fs = require('fs') -var path = require('path') - -var mkdirp = require('mkdirp') -var mr = require('npm-registry-mock') -var rimraf = require('rimraf') -var test = require('tap').test - -var common = require('../common-tap.js') - -var pkg = common.pkg -var opts = { cwd: pkg } - -var outfile = path.join(pkg, '_npmrc') - -var contents = function () { -}.toString().split('\n').slice(1, -1).join('\n') - -var pingResponse = { - host: 'registry.npmjs.org', - ok: true, - username: null, - peer: 'example.com' -} - -function mocks (server) { - server.get('/-/ping?write=true').reply(200, JSON.stringify(pingResponse)) -} - -test('setup', function (t) { - cleanup() - setup() - t.end() -}) - -test('npm ping', function (t) { - mr({ port: common.port, plugin: mocks }, function (err, s) { - if (err) throw err - - common.npm([ - 'ping', - '--registry', common.registry, - '--loglevel', 'notice', - '--userconfig', outfile - ], opts, function (err, code, stdout, stderr) { - s.close() - t.ifError(err, 'command completed') - t.notOk(code, 'exited OK') - - t.match(stderr, /PING/, 'ping notification output') - t.match(stderr, /PONG/, 'pong response output') - t.end() - }) - }) -}) - -test('npm ping --json', function (t) { - mr({ port: common.port, plugin: mocks }, function (err, s) { - if (err) throw err - - common.npm([ - 'ping', - '--json', - '--registry', common.registry, - '--loglevel', 'notice', - '--userconfig', outfile - ], opts, function (err, code, stdout, stderr) { - s.close() - t.ifError(err, 'command completed') - t.notOk(code, 'exited OK') - - const json = JSON.parse(stdout.trim()) - t.similar(json, { - registry: common.registry, - details: pingResponse - }, 'JSON info returned') - t.equal(typeof json.time, 'number', 'got a timestamp') - t.end() - }) - }) -}) - -test('cleanup', function (t) { - cleanup() - t.end() -}) - -function setup () { - mkdirp.sync(pkg) - fs.writeFileSync(outfile, contents) -} - -function cleanup () { - rimraf.sync(pkg) -} diff --git a/deps/npm/test/tap/prepare.js b/deps/npm/test/tap/prepare.js deleted file mode 100644 index d0966000735c47..00000000000000 --- a/deps/npm/test/tap/prepare.js +++ /dev/null @@ -1,89 +0,0 @@ -// verify that prepare runs on pack and publish -var common = require('../common-tap') -var test = require('tap').test -var fs = require('graceful-fs') -var join = require('path').join -var mkdirp = require('mkdirp') -var rimraf = require('rimraf') - -var pkg = common.pkg -var tmp = join(pkg, 'tmp') -var cache = common.cache - -test('setup', function (t) { - var n = 0 - cleanup() - mkdirp(pkg, then()) - mkdirp(cache, then()) - mkdirp(tmp, then()) - function then () { - n++ - return function (er) { - if (er) throw er - if (--n === 0) next() - } - } - - function next () { - fs.writeFile(join(pkg, 'package.json'), JSON.stringify({ - name: 'npm-test-prepare', - version: '1.2.5', - scripts: { prepare: 'echo ok' } - }), 'ascii', function (er) { - if (er) throw er - - t.pass('setup done') - t.end() - }) - } -}) - -test('test', function (t) { - var env = { - 'npm_config_cache': cache, - 'npm_config_tmp': tmp, - 'npm_config_prefix': pkg, - 'npm_config_global': 'false' - } - - for (var i in process.env) { - if (!/^npm_config_/.test(i)) { - env[i] = process.env[i] - } - } - - common.npm([ - 'pack', - '--loglevel', 'warn' - ], { - cwd: pkg, - env: env, - nodeExecPath: process.execPath - }, function (err, code, stdout, stderr) { - t.equal(code, 0, 'pack finished successfully') - t.ifErr(err, 'pack finished successfully') - - t.notOk(stderr, 'got stderr data:' + JSON.stringify('' + stderr)) - var c = stdout.trim() - var regex = new RegExp( - '> npm-test-prepare@1.2.5 prepare [^\\r\\n]+\\r?\\n' + - '> echo ok\\r?\\n' + - '\\r?\\n' + - 'ok\\r?\\n' + - 'npm-test-prepare-1.2.5.tgz', 'ig' - ) - - t.match(c, regex) - t.end() - }) -}) - -test('cleanup', function (t) { - cleanup() - t.pass('cleaned up') - t.end() -}) - -function cleanup () { - rimraf.sync(pkg) -} diff --git a/deps/npm/test/tap/prepublish-only.js b/deps/npm/test/tap/prepublish-only.js deleted file mode 100644 index 988d507c6359f4..00000000000000 --- a/deps/npm/test/tap/prepublish-only.js +++ /dev/null @@ -1,136 +0,0 @@ -// verify that prepublishOnly runs _only_ on publish -var join = require('path').join - -var mr = require('npm-registry-mock') -var test = require('tap').test -var Tacks = require('tacks') -var File = Tacks.File -var Dir = Tacks.Dir -var path = require('path') - -var common = require('../common-tap') - -var pkg = common.pkg -var cachedir = common.cache -var tmpdir = join(pkg, 'tmp') - -var env = { - 'npm_config_cache': cachedir, - 'npm_config_tmp': tmpdir, - 'npm_config_global': 'false' -} - -for (var i in process.env) { - if (!/^npm_config_/.test(i)) { - env[i] = process.env[i] - } -} - -var server - -var fixture = new Tacks(Dir({ - cache: Dir(), - tmp: Dir(), - '.npmrc': File([ - 'progress=false', - 'registry=' + common.registry, - '//localhost:1337/:username=username', - '//localhost:1337/:_authToken=deadbeeffeed' - ].join('\n') + '\n'), - helper: Dir({ - 'script.js': File([ - '#!/usr/bin/env node\n', - 'console.log("ok")\n' - ].join('\n') + '\n' - ), - 'package.json': File({ - name: 'helper', - version: '6.6.6', - bin: './script.js' - }) - }), - 'package.json': File({ - name: 'npm-test-prepublish-only', - version: '1.2.5', - dependencies: { - 'helper': 'file:./helper' - }, - scripts: { - build: 'helper', - prepublishOnly: 'node ' + path.resolve(__dirname, '../../') + ' run build' - } - }) -})) - -test('setup', function (t) { - fixture.create(pkg) - mr({port: common.port, throwOnUnmatched: true}, function (err, s) { - t.ifError(err, 'registry mocked successfully') - server = s - common.npm( - [ - 'install', - '--loglevel', 'error', - '--cache', cachedir, - '--tmp', tmpdir - ], - { - cwd: pkg, - env: env - }, - function (err, code, stdout, stderr) { - t.equal(code, 0, 'install exited OK') - t.ifErr(err, 'installed successfully') - - t.notOk(stderr, 'got stderr data:' + JSON.stringify('' + stderr)) - - t.end() - } - ) - }) -}) - -test('test', function (t) { - server.filteringRequestBody(function () { return true }) - .put('/npm-test-prepublish-only', true) - .reply(201, {ok: true}) - - common.npm( - [ - 'publish', - '--loglevel', 'warn', - '--scripts-prepend-node-path' - ], - { - cwd: pkg, - env: env - }, - function (err, code, stdout, stderr) { - t.equal(code, 0, 'publish ran without error') - t.ifErr(err, 'published successfully') - - t.notOk(stderr, 'got stderr data:' + JSON.stringify('' + stderr)) - var c = stdout.trim() - var regex = new RegExp( - '> npm-test-prepublish-only@1.2.5 prepublishOnly [^\\r\\n]+\\r?\\n' + - '> .* run build\\r?\\n' + - '\\r?\\n' + - '\\r?\\n' + - '> npm-test-prepublish-only@1.2.5 build [^\\r\\n]+\\r?\\n' + - '> helper\\r?\\n' + - '\\r?\\n' + - 'ok\\r?\\n' + - '\\+ npm-test-prepublish-only@1.2.5', 'ig' - ) - - t.match(c, regex) - t.end() - } - ) -}) - -test('cleanup', function (t) { - server.close() - t.pass('cleaned up') - t.end() -}) diff --git a/deps/npm/test/tap/prepublish.js b/deps/npm/test/tap/prepublish.js deleted file mode 100644 index e561d057f21243..00000000000000 --- a/deps/npm/test/tap/prepublish.js +++ /dev/null @@ -1,118 +0,0 @@ -// verify that prepublish runs on install, pack, and publish -var common = require('../common-tap') -var test = require('tap').test -var fs = require('graceful-fs') -var join = require('path').join -var mkdirp = require('mkdirp') -var rimraf = require('rimraf') - -var pkg = common.pkg -var tmp = join(pkg, 'tmp') -var cache = common.cache - -test('setup', function (t) { - var n = 0 - cleanup() - mkdirp(pkg, then()) - mkdirp(cache, then()) - mkdirp(tmp, then()) - function then () { - n++ - return function (er) { - if (er) throw er - if (--n === 0) next() - } - } - - function next () { - fs.writeFile(join(pkg, 'package.json'), JSON.stringify({ - name: 'npm-test-prepublish', - version: '1.2.5', - scripts: { prepublish: 'echo ok' } - }), 'ascii', function (er) { - if (er) throw er - - t.pass('setup done') - t.end() - }) - } -}) - -test('prepublish deprecation warning on `npm pack`', function (t) { - var env = { - 'npm_config_cache': cache, - 'npm_config_tmp': tmp, - 'npm_config_prefix': pkg, - 'npm_config_global': 'false' - } - - for (var i in process.env) { - if (!/^npm_config_/.test(i)) { - env[i] = process.env[i] - } - } - - common.npm([ - 'pack', - '--loglevel', 'warn' - ], { cwd: pkg, env: env }, function (err, code, stdout, stderr) { - t.equal(code, 0, 'pack finished successfully') - t.ifErr(err, 'pack finished successfully') - - t.match(stderr, /`prepublish` scripts are deprecated/) - var c = stdout.trim() - var regex = new RegExp('' + - '> npm-test-prepublish@1.2.5 prepublish [^\\r\\n]+\\r?\\n' + - '> echo ok\\r?\\n' + - '\\r?\\n' + - 'ok\\r?\\n' + - 'npm-test-prepublish-1.2.5.tgz', 'ig') - - t.match(c, regex) - t.end() - }) -}) - -test('prepublish deprecation warning on `npm install`', function (t) { - var env = { - 'npm_config_cache': cache, - 'npm_config_tmp': tmp, - 'npm_config_prefix': pkg, - 'npm_config_global': 'false' - } - - for (var i in process.env) { - if (!/^npm_config_/.test(i)) { - env[i] = process.env[i] - } - } - - common.npm([ - 'install', - '--loglevel', 'warn' - ], { cwd: pkg, env: env }, function (err, code, stdout, stderr) { - t.equal(code, 0, 'pack finished successfully') - t.ifErr(err, 'pack finished successfully') - - t.match(stderr, /`prepublish` scripts are deprecated/) - var c = stdout.trim() - var regex = new RegExp('' + - '> npm-test-prepublish@1.2.5 prepublish [^\\r\\n]+\\r?\\n' + - '> echo ok\\r?\\n' + - '\\r?\\n' + - 'ok' + - '', 'ig') - - t.match(c, regex) - t.end() - }) -}) -test('cleanup', function (t) { - cleanup() - t.pass('cleaned up') - t.end() -}) - -function cleanup () { - rimraf.sync(pkg) -} diff --git a/deps/npm/test/tap/process-logger.js b/deps/npm/test/tap/process-logger.js deleted file mode 100644 index 45c4e708cc1bbc..00000000000000 --- a/deps/npm/test/tap/process-logger.js +++ /dev/null @@ -1,12 +0,0 @@ -'use strict' -const test = require('tap').test -require('../../lib/npm.js') - -test('process logging', (t) => { - t.ok(process.listenerCount('log') >= 1, `log listener attached ${process.listenerCount('log')} >= 1`) - t.doesNotThrow(() => process.emit('log', 'error', 'test', 'this'), 'logging does not throw') - t.doesNotThrow(() => process.emit('log', 2348), 'invalid args do not throw') - t.doesNotThrow(() => process.emit('log', null), 'null does not throw') - t.doesNotThrow(() => process.emit('log', {}), 'obj does not throw') - t.done() -}) diff --git a/deps/npm/test/tap/progress-config.js b/deps/npm/test/tap/progress-config.js deleted file mode 100644 index 92468004f2c538..00000000000000 --- a/deps/npm/test/tap/progress-config.js +++ /dev/null @@ -1,87 +0,0 @@ -'use strict' -var test = require('tap').test -var log = require('npmlog') -var fs = require('graceful-fs') -const common = require('../common-tap.js') -var configName = common.pkg + '/npmrc' - -// We use requireInject to get a fresh copy of -// the npm singleton each time we require it. -// If we didn't, we'd have shared state between -// these various tests. -var requireInject = require('require-inject') - -// Make sure existing environment vars don't muck up the test -process.env = {} -// Pretend that stderr is a tty regardless, so we can get consistent -// results. -process.stderr.isTTY = true - -test('setup', function (t) { - fs.writeFileSync(configName, '') - t.done() -}) - -function getFreshNpm () { - return requireInject.withEmptyCache('../../lib/npm.js', {npmlog: log}) -} - -test('disabled', function (t) { - t.plan(1) - var npm = getFreshNpm() - npm.load({userconfig: configName, progress: false}, function () { - t.is(log.progressEnabled, false, 'should be disabled') - }) -}) - -test('enabled', function (t) { - t.plan(1) - var npm = getFreshNpm() - npm.load({userconfig: configName, progress: true}, function () { - t.is(log.progressEnabled, true, 'should be enabled') - }) -}) - -test('default', function (t) { - t.plan(1) - var npm = getFreshNpm() - npm.load({userconfig: configName}, function () { - t.is(log.progressEnabled, true, 'should be enabled') - }) -}) - -test('default-travis', function (t) { - t.plan(1) - process.env.TRAVIS = 'true' - var npm = getFreshNpm() - npm.load({userconfig: configName}, function () { - t.is(log.progressEnabled, false, 'should be disabled') - delete process.env.TRAVIS - }) -}) - -test('default-ci', function (t) { - t.plan(1) - process.env.CI = 'true' - var npm = getFreshNpm() - npm.load({userconfig: configName}, function () { - t.is(log.progressEnabled, false, 'should be disabled') - delete process.env.CI - }) -}) - -test('unicode-true', function (t) { - var npm = getFreshNpm() - npm.load({userconfig: configName, unicode: true}, function () { - t.is(log.gauge._theme.hasUnicode, true, 'unicode will be selected') - t.done() - }) -}) - -test('unicode-false', function (t) { - var npm = getFreshNpm() - npm.load({userconfig: configName, unicode: false}, function () { - t.is(log.gauge._theme.hasUnicode, false, 'unicode will NOT be selected') - t.done() - }) -}) diff --git a/deps/npm/test/tap/prune-dev-dep-cycle.js b/deps/npm/test/tap/prune-dev-dep-cycle.js deleted file mode 100644 index e226ac6d32f682..00000000000000 --- a/deps/npm/test/tap/prune-dev-dep-cycle.js +++ /dev/null @@ -1,85 +0,0 @@ -'use strict' -var fs = require('fs') -var test = require('tap').test -var Tacks = require('tacks') -var File = Tacks.File -var Dir = Tacks.Dir -var common = require('../common-tap.js') -var testdir = common.pkg - -var fixture = new Tacks( - Dir({ - node_modules: Dir({ - 'a': Dir({ - 'package.json': File({ - _requested: { - rawSpec: 'file:///mods/a' - }, - dependencies: { - 'b': 'file:///mods/b' - }, - name: 'a', - version: '1.0.0' - }) - }), - 'b': Dir({ - 'package.json': File({ - _requested: { - rawSpec: 'file:///mods/b' - }, - dependencies: { - 'a': 'file:///mods/a' - }, - name: 'b', - version: '1.0.0' - }) - }) - }), - 'package.json': File({ - name: 'test', - version: '1.0.0', - devDependencies: { - 'a': 'file:///mods/a' - } - }) - }) -) - -function setup () { - cleanup() - fixture.create(testdir) -} - -function cleanup () { - fixture.remove(testdir) -} - -test('setup', function (t) { - setup() - t.end() -}) - -function readdir (dir) { - try { - return fs.readdirSync(dir) - } catch (ex) { - if (ex.code === 'ENOENT') return [] - throw ex - } -} - -test('prune cycle in dev deps', function (t) { - common.npm(['prune', '--production', '--json'], {cwd: testdir}, function (err, code, stdout, stderr) { - if (err) throw err - t.is(code, 0, 'prune finished successfully') - t.like(JSON.parse(stdout), {removed: [{name: 'a'}, {name: 'b'}]}, 'removed the right modules') - var dirs = readdir(testdir + '/node_modules').sort() - t.same(dirs, []) - t.end() - }) -}) - -test('cleanup', function (t) { - cleanup() - t.end() -}) diff --git a/deps/npm/test/tap/prune-dev-dep-with-bins.js b/deps/npm/test/tap/prune-dev-dep-with-bins.js deleted file mode 100644 index a75652f9a177c6..00000000000000 --- a/deps/npm/test/tap/prune-dev-dep-with-bins.js +++ /dev/null @@ -1,103 +0,0 @@ -'use strict' -var fs = require('fs') -var test = require('tap').test -var Tacks = require('tacks') -var File = Tacks.File -var Dir = Tacks.Dir -var common = require('../common-tap.js') -var testdir = common.pkg - -var fixture = new Tacks( - Dir({ - node_modules: Dir({ - 'yes': Dir({ - 'package.json': File({ - _requested: { - rawSpec: 'file:///mods/yes' - }, - dependencies: {}, - bin: { - 'yes': 'yes.js' - }, - name: 'yes', - version: '1.0.0' - }), - 'yes.js': File('while (true) { console.log("y") }') - }), - '.bin': Dir({ - // verbose, but needed for `read-cmd-shim` to properly identify which - // package this belongs to - 'yes': File( - '#!/bin/sh\n' + - 'basedir=$(dirname "$(echo "$0" | sed -e \'s,\\\\,/,g\')")\n' + - '\n' + - 'case `uname` in\n' + - ' *CYGWIN*) basedir=`cygpath -w "$basedir"`;;\n' + - 'esac\n' + - '\n' + - 'if [ -x "$basedir/node" ]; then\n' + - ' "$basedir/node" "$basedir/../yes/yes.js" "$@"\n' + - ' ret=$?\n' + - 'else\n' + - ' node "$basedir/../yes/yes.js" "$@"\n' + - ' ret=$?\n' + - 'fi\n' + - 'exit $ret\n'), - 'yes.cmd': File( - '@IF EXIST "%~dp0\node.exe" (\n' + - '"%~dp0\\node.exe" "%~dp0\\..\\yes\\yes.js" %*\n' + - ') ELSE (\n' + - '@SETLOCAL\n' + - '@SET PATHEXT=%PATHEXT:;.JS;=;%\n' + - 'node "%~dp0\\..\\yes\\yes.js" %*') - }) - }), - 'package.json': File({ - name: 'test', - version: '1.0.0', - devDependencies: { - 'yes': 'file:///mods/yes' - } - }) - }) -) - -function setup () { - cleanup() - fixture.create(testdir) -} - -function cleanup () { - fixture.remove(testdir) -} - -test('setup', function (t) { - setup() - t.end() -}) - -function readdir (dir) { - try { - return fs.readdirSync(dir) - } catch (ex) { - if (ex.code === 'ENOENT') return [] - throw ex - } -} - -test('prune cycle in dev deps', function (t) { - common.npm(['prune', '--production', '--json'], {cwd: testdir}, function (err, code, stdout, stderr) { - if (err) throw err - t.is(code, 0, 'prune finished successfully') - t.like(JSON.parse(stdout), {removed: [{name: 'yes'}]}, 'removed the right modules') - var dirs = readdir(testdir + '/node_modules').sort() - // bindirs are never removed, it's ok for them to remain after prune - t.same(dirs, ['.bin']) - t.end() - }) -}) - -test('cleanup', function (t) { - cleanup() - t.end() -}) diff --git a/deps/npm/test/tap/prune-with-dev-dep-duplicate.js b/deps/npm/test/tap/prune-with-dev-dep-duplicate.js deleted file mode 100644 index 7e7632b489cf6d..00000000000000 --- a/deps/npm/test/tap/prune-with-dev-dep-duplicate.js +++ /dev/null @@ -1,103 +0,0 @@ -var fs = require('fs') -var path = require('path') - -var mr = require('npm-registry-mock') -var test = require('tap').test - -var common = require('../common-tap') -var server - -var pkg = common.pkg -var cache = common.cache - -var json = { - name: 'prune-with-dev-dep-duplicate', - description: 'fixture', - version: '0.0.1', - main: 'index.js', - dependencies: { - 'test-package': '0.0.0' - }, - devDependencies: { - 'test-package': '0.0.0' - } -} - -var EXEC_OPTS = { - cwd: pkg, - npm_config_depth: 'Infinity' -} - -test('setup', function (t) { - fs.writeFileSync( - path.join(pkg, 'package.json'), - JSON.stringify(json, null, 2) - ) - mr({ port: common.port }, function (er, s) { - server = s - t.end() - }) -}) - -function readdir (dir) { - try { - return fs.readdirSync(dir) - } catch (ex) { - if (ex.code === 'ENOENT') return [] - throw ex - } -} - -test('npm install also=dev', function (t) { - common.npm([ - 'install', - '--cache', cache, - '--registry', common.registry, - '--loglevel', 'silent', - '--also=dev' - ], EXEC_OPTS, function (err, code, stdout, stderr) { - if (err) throw err - t.notOk(code, 'exit ok') - t.notOk(stderr, 'Should not get data on stderr: ' + stderr) - var dirs = readdir(pkg + '/node_modules').sort() - t.same(dirs, [ 'test-package' ].sort()) - t.end() - }) -}) - -test('npm prune also=dev', function (t) { - common.npm([ - 'prune', - '--loglevel', 'silent', - '--also=dev' - ], EXEC_OPTS, function (err, code, stdout, stderr) { - if (err) throw err - t.notOk(code, 'exit ok') - t.notOk(stderr, 'Should not get data on stderr: ' + stderr) - var dirs = readdir(pkg + '/node_modules').sort() - t.same(dirs, [ 'test-package' ]) - t.end() - }) -}) - -test('npm prune only=prod', function (t) { - common.npm([ - 'prune', - '--loglevel', 'silent', - '--only=prod', - '--json' - ], EXEC_OPTS, function (err, code, stdout, stderr) { - if (err) throw err - t.notOk(code, 'exit ok') - t.isDeeply(JSON.parse(stdout).removed, [], 'removed nothing') - var dirs = readdir(pkg + '/node_modules').sort() - t.same(dirs, [ 'test-package' ]) - t.end() - }) -}) - -test('cleanup', function (t) { - server.close() - t.pass('cleaned up') - t.end() -}) diff --git a/deps/npm/test/tap/prune-with-only-dev-deps.js b/deps/npm/test/tap/prune-with-only-dev-deps.js deleted file mode 100644 index 6ea1bcf64b4804..00000000000000 --- a/deps/npm/test/tap/prune-with-only-dev-deps.js +++ /dev/null @@ -1,114 +0,0 @@ -var fs = require('fs') -var path = require('path') - -var mkdirp = require('mkdirp') -var mr = require('npm-registry-mock') -var test = require('tap').test - -var common = require('../common-tap') -var server - -var pkg = common.pkg -var cache = common.cache - -var json = { - name: 'prune-with-only-dev-deps', - description: 'fixture', - version: '0.0.1', - main: 'index.js', - devDependencies: { - 'test-package-with-one-dep': '0.0.0', - 'test-package': '0.0.0' - } -} - -var EXEC_OPTS = { - cwd: pkg, - npm_config_depth: 'Infinity' -} - -test('setup', function (t) { - mkdirp.sync(cache) - fs.writeFileSync( - path.join(pkg, 'package.json'), - JSON.stringify(json, null, 2) - ) - mr({ port: common.port }, function (er, s) { - server = s - t.end() - }) -}) - -test('npm install', function (t) { - common.npm([ - 'install', - '--cache', cache, - '--registry', common.registry, - '--loglevel', 'silent', - '--production', 'false' - ], EXEC_OPTS, function (err, code, stdout, stderr) { - t.ifErr(err, 'install finished successfully') - t.notOk(code, 'exit ok') - t.notOk(stderr, 'Should not get data on stderr: ' + stderr) - t.end() - }) -}) - -function readdir (dir) { - try { - return fs.readdirSync(dir) - } catch (ex) { - if (ex.code === 'ENOENT') return [] - throw ex - } -} - -test('verify installs', function (t) { - var dirs = readdir(pkg + '/node_modules').sort() - t.same(dirs, [ 'test-package', 'test-package-with-one-dep' ].sort()) - t.end() -}) - -test('npm prune', function (t) { - common.npm([ - 'prune', - '--loglevel', 'silent', - '--production', 'false' - ], EXEC_OPTS, function (err, code, stdout, stderr) { - t.ifErr(err, 'prune finished successfully') - t.notOk(code, 'exit ok') - t.notOk(stderr, 'Should not get data on stderr: ' + stderr) - t.end() - }) -}) - -test('verify installs', function (t) { - var dirs = readdir(pkg + '/node_modules').sort() - t.same(dirs, [ 'test-package', 'test-package-with-one-dep' ]) - t.end() -}) - -test('npm prune', function (t) { - common.npm([ - 'prune', - '--loglevel', 'silent', - '--production', - '--json' - ], EXEC_OPTS, function (err, code, stdout, stderr) { - t.ifErr(err, 'prune finished successfully') - t.notOk(code, 'exit ok') - t.like(JSON.parse(stdout), {removed: [{name: 'test-package'}, {name: 'test-package-with-one-dep'}]}) - t.end() - }) -}) - -test('verify installs', function (t) { - var dirs = readdir(pkg + '/node_modules').sort() - t.same(dirs, []) - t.end() -}) - -test('cleanup', function (t) { - server.close() - t.end() -}) diff --git a/deps/npm/test/tap/prune.js b/deps/npm/test/tap/prune.js deleted file mode 100644 index ce2a300b1a5378..00000000000000 --- a/deps/npm/test/tap/prune.js +++ /dev/null @@ -1,121 +0,0 @@ -var fs = require('fs') -var path = require('path') - -var mr = require('npm-registry-mock') -var test = require('tap').test - -var common = require('../common-tap') -var server - -var pkg = common.pkg -var cache = common.cache - -var json = { - name: 'prune', - description: 'fixture', - version: '0.0.1', - main: 'index.js', - dependencies: { - underscore: '1.3.1' - }, - devDependencies: { - mkdirp: '*' - } -} - -var EXEC_OPTS = { - cwd: pkg, - npm_config_depth: 'Infinity' -} - -test('setup', function (t) { - fs.writeFileSync( - path.join(pkg, 'package.json'), - JSON.stringify(json, null, 2) - ) - mr({ port: common.port }, function (er, s) { - server = s - t.end() - }) -}) - -test('npm install', function (t) { - common.npm([ - 'install', - '--cache', cache, - '--registry', common.registry, - '--loglevel', 'silent', - '--production', 'false' - ], EXEC_OPTS, function (err, code, stdout, stderr) { - if (err) throw err - t.notOk(code, 'exit ok') - t.notOk(stderr, 'Should not get data on stderr: ' + stderr) - t.end() - }) -}) - -test('npm install test-package', function (t) { - common.npm([ - 'install', 'test-package', - '--cache', cache, - '--registry', common.registry, - '--no-save', - '--loglevel', 'silent', - '--production', 'false' - ], EXEC_OPTS, function (err, code, stdout, stderr) { - if (err) throw err - t.notOk(code, 'exit ok') - t.notOk(stderr, 'Should not get data on stderr: ' + stderr) - t.end() - }) -}) - -test('setup: verify installs', function (t) { - var dirs = fs.readdirSync(pkg + '/node_modules').sort() - t.same(dirs, [ 'test-package', 'mkdirp', 'underscore' ].sort()) - t.end() -}) - -test('dev: npm prune', function (t) { - common.npm([ - 'prune', - '--loglevel', 'silent', - '--production', 'false' - ], EXEC_OPTS, function (err, code, stdout, stderr) { - if (err) throw err - t.notOk(code, 'exit ok') - t.notOk(stderr, 'Should not get data on stderr: ' + stderr) - t.end() - }) -}) - -test('dev: verify installs', function (t) { - var dirs = fs.readdirSync(pkg + '/node_modules').sort() - t.same(dirs, [ 'mkdirp', 'underscore' ]) - t.end() -}) - -test('production: npm prune', function (t) { - common.npm([ - 'prune', - '--loglevel', 'silent', - '--parseable', - '--production' - ], EXEC_OPTS, function (err, code, stdout) { - if (err) throw err - t.notOk(code, 'exit ok') - t.equal(stdout.trim().replace(/\\/g, '/'), 'remove\tmkdirp\t0.3.5\tnode_modules/mkdirp') - t.end() - }) -}) - -test('pruduction: verify installs', function (t) { - var dirs = fs.readdirSync(pkg + '/node_modules').sort() - t.same(dirs, [ 'underscore' ]) - t.end() -}) - -test('cleanup', function (t) { - server.close() - t.end() -}) diff --git a/deps/npm/test/tap/publish-access-scoped.js b/deps/npm/test/tap/publish-access-scoped.js deleted file mode 100644 index 7b9a3ecb59b9cb..00000000000000 --- a/deps/npm/test/tap/publish-access-scoped.js +++ /dev/null @@ -1,65 +0,0 @@ -var fs = require('fs') -var path = require('path') - -var test = require('tap').test -var mr = require('npm-registry-mock') -var common = require('../common-tap') -var server - -var pkg = common.pkg - -test('setup', function (t) { - mr({port: common.port, throwOnUnmatched: true}, function (err, s) { - t.ifError(err, 'registry mocked successfully') - t.pass('setup done') - server = s - t.end() - }) -}) - -test('scoped packages pass public access if set', function (t) { - server.filteringRequestBody(function (body) { - t.doesNotThrow(function () { - var parsed = JSON.parse(body) - t.equal(parsed.access, 'public', 'access level is correct') - }, 'converted body back into object') - return true - }).put('/@bigco%2fpublish-access', true).reply(201, {ok: true}) - - fs.writeFile( - path.join(pkg, 'package.json'), - JSON.stringify({ - name: '@bigco/publish-access', - version: '1.2.5', - public: true - }), - 'ascii', - function (er) { - t.ifError(er, 'package file written') - common.npm( - [ - 'publish', - '--access', 'public', - '--cache', common.cache, - '--loglevel', 'silly', - '--registry', common.registry - ], - { - cwd: pkg - }, - function (er) { - t.ifError(er, 'published without error') - - server.done() - t.end() - } - ) - } - ) -}) - -test('cleanup', function (t) { - process.chdir(__dirname) - server.close() - t.end() -}) diff --git a/deps/npm/test/tap/publish-access-unscoped-restricted-fails.js b/deps/npm/test/tap/publish-access-unscoped-restricted-fails.js deleted file mode 100644 index f615fa60f2450c..00000000000000 --- a/deps/npm/test/tap/publish-access-unscoped-restricted-fails.js +++ /dev/null @@ -1,38 +0,0 @@ -var fs = require('fs') -var path = require('path') - -var test = require('tap').test -var mkdirp = require('mkdirp') -var rimraf = require('rimraf') -var common = require('../common-tap.js') - -var pkg = common.pkg - -test('setup', function (t) { - mkdirp.sync(pkg) - fs.writeFileSync( - path.join(pkg, 'package.json'), - JSON.stringify({ - name: 'publish-access', - version: '1.2.5' - })) - t.pass('setup done') - t.end() -}) - -test('unscoped packages cannot be restricted', function (t) { - var args = ['--access=restricted', '--loglevel=warn', '--registry=' + common.registry] - var opts = {stdio: [0, 1, 'pipe'], cwd: pkg} - common.npm(['publish'].concat(args), opts, function (err, code, stdout, stderr) { - if (err) throw err - t.notEqual(code, 0, 'publish not successful') - t.match(stderr, "Can't restrict access to unscoped packages.") - - t.end() - }) -}) - -test('cleanup', function (t) { - rimraf.sync(pkg) - t.end() -}) diff --git a/deps/npm/test/tap/publish-access-unscoped.js b/deps/npm/test/tap/publish-access-unscoped.js deleted file mode 100644 index a7ea8e6694849d..00000000000000 --- a/deps/npm/test/tap/publish-access-unscoped.js +++ /dev/null @@ -1,65 +0,0 @@ -var fs = require('fs') -var path = require('path') - -var test = require('tap').test -var mr = require('npm-registry-mock') -var common = require('../common-tap') -var server - -var pkg = common.pkg - -test('setup', function (t) { - mr({port: common.port, throwOnUnmatched: true}, function (err, s) { - t.ifError(err, 'registry mocked successfully') - t.pass('setup done') - server = s - t.end() - }) -}) - -test('unscoped packages can be explicitly set as public', function (t) { - server.filteringRequestBody(function (body) { - t.doesNotThrow(function () { - var parsed = JSON.parse(body) - t.equal(parsed.access, 'public', 'access level is correct') - }, 'converted body back into object') - return true - }).put('/publish-access', true).reply(201, {ok: true}) - - fs.writeFile( - path.join(pkg, 'package.json'), - JSON.stringify({ - name: 'publish-access', - version: '1.2.5', - public: true - }), - 'ascii', - function (er) { - t.ifError(er, 'package file written') - common.npm( - [ - 'publish', - '--access', 'public', - '--cache', common.cache, - '--loglevel', 'silly', - '--registry', common.registry - ], - { - cwd: pkg - }, - function (er) { - t.ifError(er, 'published without error') - - server.done() - t.end() - } - ) - } - ) -}) - -test('cleanup', function (t) { - process.chdir(__dirname) - server.close() - t.end() -}) diff --git a/deps/npm/test/tap/publish-config.js b/deps/npm/test/tap/publish-config.js deleted file mode 100644 index 0d6406316b4a09..00000000000000 --- a/deps/npm/test/tap/publish-config.js +++ /dev/null @@ -1,69 +0,0 @@ -'use strict' - -const common = require('../common-tap.js') -const test = require('tap').test -const fs = require('fs') -const pkg = common.pkg - -fs.writeFileSync(pkg + '/package.json', JSON.stringify({ - name: 'npm-test-publish-config', - version: '1.2.3', - publishConfig: { - registry: common.registry - } -}), 'utf8') - -fs.writeFileSync(pkg + '/fixture_npmrc', - '//localhost:' + common.port + '/:email = fancy@feast.net\n' + - '//localhost:' + common.port + '/:username = fancy\n' + - '//localhost:' + common.port + '/:_password = ' + Buffer.from('feast').toString('base64')) - -test(function (t) { - let child - t.plan(5) - require('http').createServer(function (req, res) { - t.pass('got request on the fakey fake registry') - let body = '' - req.on('data', (d) => { body += d }) - req.on('end', () => { - this.close() - res.statusCode = 500 - res.end(JSON.stringify({ - error: 'sshhh. naptime nao. \\^O^/ <(YAWWWWN!)' - })) - t.match(body, /"beta"/, 'got expected tag') - child.kill('SIGINT') - }) - }).listen(common.port, () => { - t.pass('server is listening') - - // don't much care about listening to the child's results - // just wanna make sure it hits the server we just set up. - // - // there are plenty of other tests to verify that publish - // itself functions normally. - // - // Make sure that we don't sit around waiting for lock files - child = common.npm([ - 'publish', - '--userconfig=' + pkg + '/fixture_npmrc', - '--tag=beta', - '--loglevel', 'error' - ], { - cwd: pkg, - env: { - 'npm_config_cache_lock_stale': 1000, - 'npm_config_cache_lock_wait': 1000, - HOME: process.env.HOME, - Path: process.env.PATH, - PATH: process.env.PATH, - USERPROFILE: process.env.USERPROFILE - } - }, function (err, code, stdout, stderr) { - t.comment(stdout) - t.comment(stderr) - t.ifError(err, 'publish command finished successfully') - t.notOk(code, 'npm install exited with code 0') - }) - }) -}) diff --git a/deps/npm/test/tap/publish-invalid-semver-tag.js b/deps/npm/test/tap/publish-invalid-semver-tag.js deleted file mode 100644 index 9c2f40813b06e4..00000000000000 --- a/deps/npm/test/tap/publish-invalid-semver-tag.js +++ /dev/null @@ -1,76 +0,0 @@ -var common = require('../common-tap.js') -var test = require('tap').test -var npm = require('../../lib/npm.js') -var mkdirp = require('mkdirp') -var path = require('path') -var fs = require('fs') -var mr = require('npm-registry-mock') - -var PKG_DIR = common.pkg -let cacheIteration = 0 -let CACHE_DIR - -var DEFAULT_PKG = { - 'name': 'examples', - 'version': '1.2.3' -} - -const isRoot = process.getuid && process.getuid() === 0 -const sudoUID = isRoot ? +process.env.SUDO_UID : null -const sudoGID = isRoot ? +process.env.SUDO_GID : null -const { chownSync } = require('fs') -function resetPackage (options) { - CACHE_DIR = path.resolve(common.cache, '' + cacheIteration++) - mkdirp.sync(CACHE_DIR) - npm.config.set('cache', CACHE_DIR) - - if (isRoot && sudoUID && sudoGID) { - chownSync(CACHE_DIR, sudoUID, sudoGID) - } - - fs.writeFileSync(path.resolve(PKG_DIR, 'package.json'), JSON.stringify(DEFAULT_PKG)) -} - -test('setup', function (t) { - mkdirp.sync(PKG_DIR) - process.chdir(PKG_DIR) - - mr({ port: common.port }, function (er, server) { - if (er) { - throw er - } - t.parent.teardown(() => server.close()) - npm.load({ - cache: common.cache, - registry: common.registry, - cwd: PKG_DIR - }, function (err) { - if (err) { - throw err - } - t.end() - }) - }) -}) - -test('attempt publish with semver-like version', function (t) { - resetPackage({}) - - npm.config.set('tag', 'v1.x') - npm.commands.publish([], function (err) { - t.notEqual(err, null) - t.same(err.message, 'Tag name must not be a valid SemVer range: v1.x') - t.end() - }) -}) - -test('attempt publish with semver-like version', function (t) { - resetPackage({}) - - npm.config.set('tag', '1.2.3') - npm.commands.publish([], function (err) { - t.notEqual(err, null) - t.same(err.message, 'Tag name must not be a valid SemVer range: 1.2.3') - t.end() - }) -}) diff --git a/deps/npm/test/tap/publish-scoped.js b/deps/npm/test/tap/publish-scoped.js deleted file mode 100644 index 82873688cdce9e..00000000000000 --- a/deps/npm/test/tap/publish-scoped.js +++ /dev/null @@ -1,81 +0,0 @@ -var fs = require('fs') -var path = require('path') - -var test = require('tap').test -var common = require('../common-tap') -var mr = require('npm-registry-mock') - -var pkg = common.pkg - -var server - -function setup () { - fs.writeFileSync( - path.join(pkg, 'package.json'), - JSON.stringify({ - name: '@bigco/publish-organized', - version: '1.2.5' - }, null, 2), - 'ascii') -} - -test('setup', function (t) { - setup() - mr({port: common.port, throwOnUnmatched: true}, function (err, s) { - t.ifError(err, 'registry mocked successfully') - server = s - t.end() - }) -}) - -test('npm publish should honor scoping', function (t) { - server.filteringRequestBody(verify) - .put('/@bigco%2fpublish-organized', true) - .reply(201, {ok: true}) - - var configuration = [ - 'progress=false', - 'cache=' + common.cache, - 'registry=http://nonexistent.lvh.me', - '//localhost:' + common.port + '/:username=username', - '//localhost:' + common.port + '/:_password=' + Buffer.from('password').toString('base64'), - '//localhost:' + common.port + '/:email=' + 'ogd@aoaioxxysz.net', - '@bigco:registry=' + common.registry - ] - var configFile = path.join(pkg, '.npmrc') - - fs.writeFileSync(configFile, configuration.join('\n') + '\n') - - common.npm(['publish'], {'cwd': pkg, nodeExecPath: process.execPath}, function (err, code, stdout, stderr) { - if (err) throw err - t.is(code, 0, 'published without error') - server.done() - t.end() - }) - - function verify (body) { - t.doesNotThrow(function () { - var parsed = JSON.parse(body) - var current = parsed.versions['1.2.5'] - t.equal( - current._npmVersion, - require(path.resolve(__dirname, '../../package.json')).version, - 'npm version is correct' - ) - - t.equal( - current._nodeVersion, - process.versions.node, - 'node version is correct' - ) - }, 'converted body back into object') - - return true - } -}) - -test('cleanup', function (t) { - server.close() - process.chdir(__dirname) - t.end() -}) diff --git a/deps/npm/test/tap/publish.js b/deps/npm/test/tap/publish.js deleted file mode 100644 index 453abcecd47abd..00000000000000 --- a/deps/npm/test/tap/publish.js +++ /dev/null @@ -1,162 +0,0 @@ -'use strict' - -const BB = require('bluebird') - -const common = require('../common-tap') -const fs = require('fs') -const mr = BB.promisify(require('npm-registry-mock')) -const path = require('path') -const test = require('tap').test - -const testDir = common.pkg - -function setup () { - fs.writeFileSync( - path.join(testDir, 'package.json'), - JSON.stringify({ - name: 'publish-organized', - version: '1.2.5' - }, null, 2), - 'utf8' - ) - - fs.writeFileSync( - path.join(testDir, 'index.js'), - 'hello', - 'utf8' - ) -} - -let port = common.port -function withServer (cb) { - return mr({port: port++, throwOnUnmatched: true}) - .tap(cb) - .then((server) => { - server.done() - return server.close() - }) -} - -test('basic npm publish', (t) => { - setup() - return withServer((server) => { - server.filteringRequestBody(verify) - .put('/publish-organized', true) - .reply(201, {ok: true}) - - return common.npm([ - 'publish', - '--no-color', - '--cache', common.cache, - '--registry=' + common.registry.replace(common.port, server.port), - `--//localhost:${server.port}/:username=username`, - `--//localhost:${server.port}/:_password=` + Buffer.from('password').toString('base64'), - `--//localhost:${server.port}/:email=` + 'ogd@aoaioxxysz.net' - ], { - 'cwd': testDir, - nodeExecPath: process.execPath - }) - .spread((code, stdout, stderr) => { - t.comment(stdout) - t.comment(stderr) - t.is(code, 0, 'published without error') - }) - - function verify (body) { - t.doesNotThrow(() => { - const parsed = JSON.parse(body) - const current = parsed.versions['1.2.5'] - t.equal( - current._npmVersion, - require(path.resolve(__dirname, '../../package.json')).version, - 'npm version is correct' - ) - - t.equal( - current._nodeVersion, - process.versions.node, - 'node version is correct' - ) - }, 'converted body back into object') - - return true - } - }) -}) - -test('npm publish --dry-run', (t) => { - setup() - return common.npm([ - 'publish', - '--dry-run', - '--registry=https://example.registry/fake', - '--cache', common.cache, - '--loglevel=notice', - '--no-color' - ], {'cwd': testDir}) - .spread((code, stdout, stderr) => { - t.comment(stdout) - t.comment(stderr) - t.is(code, 0, 'published without error') - t.match(stderr, /notice\s+\d+[a-z]+\s+package\.json/gi, 'mentions package.json') - t.match(stderr, /notice\s+\d+[a-z]+\s+index\.js/gi, 'mentions index.js') - }) -}) - -test('npm publish --json', (t) => { - setup() - return withServer((server) => { - server.filteringRequestBody(() => true) - .put('/publish-organized', true) - .reply(201, {ok: true}) - return common.npm([ - 'publish', - '--json', - '--registry', common.registry.replace(common.port, server.port), - '--cache', common.cache - ], {'cwd': testDir}) - .spread((code, stdout, stderr) => { - t.comment(stdout) - t.comment(stderr) - t.is(code, 0, 'published without error') - t.similar(JSON.parse(stdout), { - name: 'publish-organized', - version: '1.2.5', - files: [ - {path: 'index.js'}, - {path: 'package.json'} - ], - entryCount: 2 - }, 'JSON output reflects package contents') - t.equal(stderr.trim(), '', 'nothing on stderr') - }) - }) -}) - -test('npm publish --dry-run --json', (t) => { - setup() - return common.npm([ - 'publish', - '--dry-run', - '--json', - '--registry=https://example.registry/fake', - '--cache', common.cache, - '--loglevel=notice', - '--no-color' - ], {'cwd': testDir}) - .spread((code, stdout, stderr) => { - t.comment(stdout) - t.comment(stderr) - t.is(code, 0, 'published without error') - t.similar(JSON.parse(stdout), { - name: 'publish-organized', - version: '1.2.5', - files: [ - {path: 'index.js'}, - {path: 'package.json'} - ], - entryCount: 2 - }, 'JSON output reflects package contents') - t.equal(stderr.trim(), '', 'nothing on stderr') - }) -}) diff --git a/deps/npm/test/tap/pwd-prefix.js b/deps/npm/test/tap/pwd-prefix.js deleted file mode 100644 index 1b59f5c838cc85..00000000000000 --- a/deps/npm/test/tap/pwd-prefix.js +++ /dev/null @@ -1,35 +0,0 @@ -// This test ensures that a few commands do the same -// thing when the cwd is where package.json is, and when -// the package.json is one level up. - -var test = require('tap').test -var common = require('../common-tap.js') -var path = require('path') -var root = path.resolve(__dirname, '../..') -var lib = path.resolve(root, 'lib') -var commands = ['run', 'version'] - -commands.forEach(function (cmd) { - // Should get the same stdout and stderr each time - var stdout, stderr - - test(cmd + ' in root', function (t) { - common.npm([cmd], {cwd: root}, function (er, code, so, se) { - if (er) throw er - t.notOk(code, 'npm ' + cmd + ' exited with code 0') - stdout = so - stderr = se - t.end() - }) - }) - - test(cmd + ' in lib', function (t) { - common.npm([cmd], {cwd: lib}, function (er, code, so, se) { - if (er) throw er - t.notOk(code, 'npm ' + cmd + ' exited with code 0') - t.equal(so, stdout) - t.equal(se, stderr) - t.end() - }) - }) -}) diff --git a/deps/npm/test/tap/referer.js b/deps/npm/test/tap/referer.js deleted file mode 100644 index 6df676db62e279..00000000000000 --- a/deps/npm/test/tap/referer.js +++ /dev/null @@ -1,83 +0,0 @@ -var common = require('../common-tap.js') -var test = require('tap').test -var http = require('http') - -test('should send referer http header', function (t) { - http.createServer(function (q, s) { - t.equal(q.headers.referer, 'install foo') - s.statusCode = 404 - s.end(JSON.stringify({error: 'whatever'})) - this.close() - }).listen(common.port, function () { - var reg = 'http://localhost:' + common.port - var args = [ 'install', 'foo', '--registry', reg ] - common.npm(args, {}, function (er, code) { - if (er) { - throw er - } - // should not have ended nicely, since we returned an error - t.ok(code) - t.end() - }) - }) -}) - -test('should redact user secret from hook add command', function (t) { - http.createServer(function (q, s) { - t.equal(q.headers.referer, 'hook add ~zkat [REDACTED] [REDACTED]') - s.statusCode = 204 - s.end() - this.close() - }).listen(common.port, function () { - var reg = `http://localhost:${common.port}` - var args = [ 'hook', 'add', '~zkat', 'https://example.com', 'sekrit', '--registry', reg ] - common.npm(args, {}, function (er, code) { - if (er) { - throw er - } - // should not have ended nicely, since we returned an error - t.ok(code) - t.end() - }) - }) -}) - -test('should redact user secret from hook up command', function (t) { - http.createServer(function (q, s) { - t.equal(q.headers.referer, 'hook up ~zkat [REDACTED] [REDACTED]') - s.statusCode = 204 - s.end() - this.close() - }).listen(common.port, function () { - var reg = `http://localhost:${common.port}` - var args = [ 'hook', 'up', '~zkat', 'https://example.com', 'sekrit', '--registry', reg ] - common.npm(args, {}, function (er, code) { - if (er) { - throw er - } - // should not have ended nicely, since we returned an error - t.ok(code) - t.end() - }) - }) -}) - -test('should redact user secret from hook update command', function (t) { - http.createServer(function (q, s) { - t.equal(q.headers.referer, 'hook update ~zkat [REDACTED] [REDACTED]') - s.statusCode = 204 - s.end() - this.close() - }).listen(common.port, function () { - var reg = `http://localhost:${common.port}` - var args = [ 'hook', 'update', '~zkat', 'https://example.com', 'sekrit', '--registry', reg ] - common.npm(args, {}, function (er, code) { - if (er) { - throw er - } - // should not have ended nicely, since we returned an error - t.ok(code) - t.end() - }) - }) -}) diff --git a/deps/npm/test/tap/repo.js b/deps/npm/test/tap/repo.js deleted file mode 100644 index 3e97fdeaed2283..00000000000000 --- a/deps/npm/test/tap/repo.js +++ /dev/null @@ -1,175 +0,0 @@ -var common = require('../common-tap.js') -var mr = require('npm-registry-mock') - -var test = require('tap').test -var rimraf = require('rimraf') -var fs = require('fs') -var path = require('path') -var fakeBrowser = path.join(common.pkg, '_script.sh') -var outFile = path.join(common.pkg, '_output') -var opts = { cwd: common.pkg } -var mkdirp = require('mkdirp') - -common.pendIfWindows('This is trickier to convert without opening new shells') - -test('setup', function (t) { - mkdirp.sync(common.pkg) - var s = '#!/usr/bin/env bash\n' + - 'echo "$@" > ' + JSON.stringify(common.pkg) + '/_output\n' - fs.writeFileSync(fakeBrowser, s, 'ascii') - fs.chmodSync(fakeBrowser, '0755') - t.pass('made script') - t.end() -}) - -test('npm repo underscore', function (t) { - mr({ port: common.port }, function (er, s) { - common.npm([ - 'repo', 'underscore', - '--registry=' + common.registry, - '--loglevel=silent', - '--browser=' + fakeBrowser - ], opts, function (err, code, stdout, stderr) { - t.ifError(err, 'repo command ran without error') - t.equal(code, 0, 'exit ok') - var res = fs.readFileSync(outFile, 'ascii') - s.close() - t.equal(res, 'https://github.com/jashkenas/underscore\n') - rimraf.sync(outFile) - t.end() - }) - }) -}) - -test('npm repo underscore --json', function (t) { - mr({ port: common.port }, function (er, s) { - common.npm([ - 'repo', 'underscore', - '--json', - '--registry=' + common.registry, - '--loglevel=silent', - '--no-browser' - ], opts, function (err, code, stdout, stderr) { - t.ifError(err, 'repo command ran without error') - t.equal(code, 0, 'exit ok') - t.matchSnapshot(stdout, 'should print json result') - s.close() - t.end() - }) - }) -}) - -test('npm repo underscore --no-browser', function (t) { - mr({ port: common.port }, function (er, s) { - common.npm([ - 'repo', 'underscore', - '--no-browser', - '--registry=' + common.registry, - '--loglevel=silent' - ], opts, function (err, code, stdout, stderr) { - t.ifError(err, 'repo command ran without error') - t.equal(code, 0, 'exit ok') - t.matchSnapshot(stdout, 'should print alternative msg') - s.close() - t.end() - }) - }) -}) - -test('npm repo optimist - github (https://)', function (t) { - mr({ port: common.port }, function (er, s) { - common.npm([ - 'repo', 'optimist', - '--registry=' + common.registry, - '--loglevel=silent', - '--browser=' + fakeBrowser - ], opts, function (err, code, stdout, stderr) { - t.ifError(err, 'repo command ran without error') - t.equal(code, 0, 'exit ok') - var res = fs.readFileSync(outFile, 'ascii') - s.close() - t.equal(res, 'https://github.com/substack/node-optimist\n') - rimraf.sync(outFile) - t.end() - }) - }) -}) - -test('npm repo npm-test-peer-deps - no repo', function (t) { - mr({ port: common.port }, function (er, s) { - common.npm([ - 'repo', 'npm-test-peer-deps', - '--registry=' + common.registry, - '--loglevel=silent', - '--browser=' + fakeBrowser - ], opts, function (err, code, stdout, stderr) { - t.ifError(err, 'repo command ran without error') - t.equal(code, 1, 'exit not ok') - s.close() - t.end() - }) - }) -}) - -test('npm repo test-repo-url-http - non-github (http://)', function (t) { - mr({ port: common.port }, function (er, s) { - common.npm([ - 'repo', 'test-repo-url-http', - '--registry=' + common.registry, - '--loglevel=silent', - '--browser=' + fakeBrowser - ], opts, function (err, code, stdout, stderr) { - t.ifError(err, 'repo command ran without error') - t.equal(code, 0, 'exit ok') - var res = fs.readFileSync(outFile, 'ascii') - s.close() - t.equal(res, 'http://gitlab.com/evanlucas/test-repo-url-http\n') - rimraf.sync(outFile) - t.end() - }) - }) -}) - -test('npm repo test-repo-url-https - non-github (https://)', function (t) { - mr({ port: common.port }, function (er, s) { - common.npm([ - 'repo', 'test-repo-url-https', - '--registry=' + common.registry, - '--loglevel=silent', - '--browser=' + fakeBrowser - ], opts, function (err, code, stdout, stderr) { - t.ifError(err, 'repo command ran without error') - t.equal(code, 0, 'exit ok') - var res = fs.readFileSync(outFile, 'ascii') - s.close() - t.equal(res, 'https://gitlab.com/evanlucas/test-repo-url-https\n') - rimraf.sync(outFile) - t.end() - }) - }) -}) - -test('npm repo test-repo-url-ssh - non-github (ssh://)', function (t) { - mr({ port: common.port }, function (er, s) { - common.npm([ - 'repo', 'test-repo-url-ssh', - '--registry=' + common.registry, - '--loglevel=silent', - '--browser=' + fakeBrowser - ], opts, function (err, code, stdout, stderr) { - t.ifError(err, 'repo command ran without error') - t.equal(code, 0, 'exit ok') - var res = fs.readFileSync(outFile, 'ascii') - s.close() - t.equal(res, 'https://gitlab.com/evanlucas/test-repo-url-ssh\n') - rimraf.sync(outFile) - t.end() - }) - }) -}) - -test('cleanup', function (t) { - fs.unlinkSync(fakeBrowser) - t.pass('cleaned up') - t.end() -}) diff --git a/deps/npm/test/tap/retry-on-stale-cache.js b/deps/npm/test/tap/retry-on-stale-cache.js deleted file mode 100644 index 7e3d291a5bdd78..00000000000000 --- a/deps/npm/test/tap/retry-on-stale-cache.js +++ /dev/null @@ -1,195 +0,0 @@ -var path = require('path') - -var mr = require('npm-registry-mock') -var test = require('tap').test -var common = require('../common-tap') -var Tacks = require('tacks') -var Dir = Tacks.Dir -var File = Tacks.File - -var workdir = common.pkg -var cachedir = common.cache -var modulesdir = path.join(workdir, 'modules') -var oldModule = path.join(modulesdir, 'good-night-0.1.0.tgz') -var newModule = path.join(modulesdir, 'good-night-1.0.0.tgz') - -var config = [ - '--cache', cachedir, - '--prefix', workdir, - '--registry', common.registry -] - -var fixture = new Tacks(Dir({ - 'modules': Dir({ - 'good-night-0.1.0.tgz': File(Buffer.from( - '1f8b0800000000000003ed934f4bc43010c57beea7187a59056dd36eff80' + - 'de85050541c1f3d8c634da4e4a925a8af8dd6db7bb8ba0e0c15559e9eff2' + - '206f929909bc06f327143c6826f51f8d2267cf30c6d2388641c32c61ef75' + - '4d9426e084519a25491645cbcc61e192c5d1e0ef7b90cf688d453d8cf2dd' + - '77a65d60a707c28b0b031e61cdbd33f08452c52949515aef64729eb93652' + - 'd168323ff4d9f6bce026d7b2b11bafef11b1eb3a221a2aa6126c6da9f4e8' + - '5e691f6e908a1a697b5ff346196995eec7023399c1c7fe95cc3999f57077' + - 'b717d7979efbeafef5a7fd2336b90f6a943484ff477a7c917f96c5bbfc87' + - '493ae63f627138e7ff37c815195571bf52e268b1820e0d0825498055d069' + - '6939d8521ab86f2dace0815715a0a9386f16c7e7730c676666660e9837c0' + - 'f6795d000c0000', - 'hex' - )), - 'good-night-1.0.0.tgz': File(Buffer.from( - '1f8b0800000000000003ed954d6bc24010863dfb2bb6b9a8503793b849a0' + - 'eda5979efa052d484184252e495a331b76d78a94fef76e8cf683163cd42a' + - '957d2e03796777268187543c7de299f0aba6d2472db1b5650020668cd81a' + - '24117cae4bc23822ad208c93284a1208c216040318c436dff6223f31d386' + - '2bbbca6fef69de85bcd77fc24b9b583ce4a5f04e88974939e96391e5c63b' + - '6e9267a17421b10e030a14d6cf2742a7aaa8cc2a5b2c38e7f3f91c116d47' + - 'd3c2672697aa4eaf1425771c2725c7f579252aa90b23d5a26ed04de87f9f' + - '3f2d52817ab9dcf0fee2f6d26bbfb6f7fdd10e8895f77ec90bb4f2ffc98c' + - '0dfe439c7cf81fc4b5ff213070feef8254a2965341a732eb76b4cef39c12' + - 'e456eb52d82a29198dc637639f9c751fce8796eba35ea777ea0c3c14d6fe' + - '532314f62ba9ccf6676cf21fbefcff59ed3f4b22e7ff2e60110bc37d2fe1' + - '70381c8e9df306642df14500100000', - 'hex' - )) - }) -})) - -var server - -// In this test we mock a situation where the user has a package in his cache, -// a newer version of the package is published, and the user tried to install -// said new version while requestion that the cache be used. -// npm should see that it doesn't have the package in its cache and hit the -// registry. -var onlyOldMetadata = { - 'name': 'good-night', - 'dist-tags': { - 'latest': '0.1.0' - }, - 'versions': { - '0.1.0': { - 'name': 'good-night', - 'version': '0.1.0', - 'dist': { - 'shasum': '2a746d49dd074ba0ec2d6ff13babd40c658d89eb', - 'tarball': 'http://localhost:' + common.port + '/good-night/-/good-night-0.1.0.tgz' - } - } - } -} - -var oldAndNewMetadata = Object.assign({}, onlyOldMetadata) -oldAndNewMetadata['dist-tags'] = { latest: '1.0.0' } -oldAndNewMetadata.versions = Object.assign({ - '1.0.0': { - 'name': 'good-night', - 'version': '1.0.0', - 'dist': { - 'shasum': 'f377bf002a0a8fc4085d347a160a790b76896bc3', - 'tarball': 'http://localhost:' + common.port + '/good-night/-/good-night-1.0.0.tgz' - } - } -}, oldAndNewMetadata.versions) - -function setup () { - cleanup() - fixture.create(workdir) -} - -function cleanup () { - fixture.remove(workdir) -} - -test('setup', function (t) { - setup() - t.end() -}) - -test('setup initial server', function (t) { - mr({ - port: common.port, - throwOnUnmatched: true - }, function (err, s) { - t.ifError(err, 'registry mocked successfully') - server = s - - server.get('/good-night') - .many({ min: 1, max: 1 }) - .reply(200, onlyOldMetadata) - server.get('/good-night/-/good-night-0.1.0.tgz') - .many({ min: 1, max: 1 }) - .replyWithFile(200, oldModule) - - t.end() - }) -}) - -test('install initial version', function (t) { - common.npm(config.concat([ - 'install', 'good-night' - ]), {stdio: 'inherit'}, function (err, code) { - if (err) throw err - t.is(code, 0, 'initial install succeeded') - server.done() - t.end() - }) -}) - -test('cleanup initial server', function (t) { - server.close() - t.end() -}) - -test('setup new server', function (t) { - mr({ - port: common.port, - throwOnUnmatched: true - }, function (err, s) { - t.ifError(err, 'registry mocked successfully') - server = s - - server.get('/good-night') - .many({ min: 1, max: 1 }) - .reply(200, oldAndNewMetadata) - - server.get('/good-night/-/good-night-1.0.0.tgz') - .many({ min: 1, max: 1 }) - .replyWithFile(200, newModule) - - t.end() - }) -}) - -test('install new version', function (t) { - common.npm(config.concat([ - '--prefer-offline', - 'install', 'good-night@1.0.0' - ]), {}, function (err, code, stdout, stderr) { - if (err) throw err - t.equal(stderr, '', 'no error output') - t.is(code, 0, 'install succeeded') - - t.end() - }) -}) - -test('install does not hit server again', function (t) { - // The mock server route definitions ensure we don't hit the server again - common.npm(config.concat([ - '--prefer-offline', - '--parseable', - 'install', 'good-night' - ]), {stdio: [0, 'pipe', 2]}, function (err, code, stdout) { - if (err) throw err - t.is(code, 0, 'install succeeded') - - t.match(stdout, /^update\tgood-night\t1.0.0\t/, 'installed latest version') - server.done() - t.end() - }) -}) - -test('cleanup', function (t) { - server.close() - cleanup() - t.end() -}) diff --git a/deps/npm/test/tap/run-script-filter-private.js b/deps/npm/test/tap/run-script-filter-private.js deleted file mode 100644 index 31f1912fd103a0..00000000000000 --- a/deps/npm/test/tap/run-script-filter-private.js +++ /dev/null @@ -1,52 +0,0 @@ -var fs = require('graceful-fs') -var path = require('path') - -var mkdirp = require('mkdirp') -var rimraf = require('rimraf') -var test = require('tap').test - -var common = require('../common-tap') - -var pkg = common.pkg - -var opts = { cwd: pkg } - -var json = { - name: 'run-script-filter-private', - version: '1.2.3' -} - -var npmrc = '//blah.com:_harsh=realms\n' - -test('setup', function (t) { - cleanup() - mkdirp.sync(pkg) - fs.writeFileSync( - path.resolve(pkg, 'package.json'), - JSON.stringify(json, null, 2) + '\n' - ) - fs.writeFileSync( - path.resolve(pkg, '.npmrc'), - npmrc - ) - t.end() -}) - -test('npm run-script env', function (t) { - common.npm(['run-script', 'env'], opts, function (er, code, stdout, stderr) { - t.ifError(er, 'using default env script') - t.notOk(stderr, 'should not generate errors') - t.ok(stdout.indexOf('npm_config_init_version') > 0, 'expected values in var list') - t.notMatch(stdout, /harsh/, 'unexpected config not there') - t.end() - }) -}) - -test('cleanup', function (t) { - cleanup() - t.end() -}) - -function cleanup () { - rimraf.sync(pkg) -} diff --git a/deps/npm/test/tap/run-script.js b/deps/npm/test/tap/run-script.js deleted file mode 100644 index 75b714002e2c84..00000000000000 --- a/deps/npm/test/tap/run-script.js +++ /dev/null @@ -1,373 +0,0 @@ -var fs = require('graceful-fs') -var path = require('path') - -var mkdirp = require('mkdirp') -var test = require('tap').test -var rimraf = require('rimraf') - -var common = require('../common-tap') - -var pkg = common.pkg -var cache = common.cache -var tmp = path.resolve(pkg, 'tmp') - -var opts = { cwd: pkg } - -var fullyPopulated = { - 'name': 'runscript', - 'version': '1.2.3', - 'scripts': { - 'start': 'node -e "console.log(process.argv[1] || \'start\')"', - 'prewith-pre': 'node -e "console.log(process.argv[1] || \'pre\')"', - 'with-pre': 'node -e "console.log(process.argv[1] || \'main\')"', - 'with-post': 'node -e "console.log(process.argv[1] || \'main\')"', - 'postwith-post': 'node -e "console.log(process.argv[1] || \'post\')"', - 'prewith-both': 'node -e "console.log(process.argv[1] || \'pre\')"', - 'with-both': 'node -e "console.log(process.argv[1] || \'main\')"', - 'postwith-both': 'node -e "console.log(process.argv[1] || \'post\')"', - 'stop': 'node -e "console.log(process.argv[1] || \'stop\')"', - 'env-vars': 'node -e "console.log(process.env.run_script_foo_var)"', - 'npm-env-vars': 'node -e "console.log(process.env.npm_run_script_foo_var)"', - 'package-env-vars': 'node -e "console.log(process.env.run_script_foo_var)"', - 'prefixed-package-env-vars': 'node -e "console.log(process.env.npm_package_run_script_foo_var)"' - }, - 'run_script_foo_var': 'run_script_test_foo_val' -} - -var lifecycleOnly = { - name: 'scripted', - version: '1.2.3', - scripts: { - 'prestart': 'echo prestart' - } -} - -var directOnly = { - name: 'scripted', - version: '1.2.3', - scripts: { - 'whoa': 'echo whoa' - } -} - -var both = { - name: 'scripted', - version: '1.2.3', - scripts: { - 'prestart': 'echo prestart', - 'whoa': 'echo whoa' - } -} - -var preversionOnly = { - name: 'scripted', - version: '1.2.3', - scripts: { - 'preversion': 'echo preversion' - } -} - -var exitCode = { - name: 'scripted', - version: '1.2.3', - scripts: { - 'start': 'node -e "process.exit(7)"' - } -} - -var shell = { - name: 'scripted', - version: '1.2.3', - scripts: { - 'start': 'echo foo' - } -} - -function testOutput (t, command, er, code, stdout, stderr) { - var lines - - if (er) throw er - - if (stderr) { - throw new Error('npm ' + command + ' stderr: ' + stderr.toString()) - } - - lines = stdout.trim().split('\n') - stdout = lines.filter(function (line) { - return line.trim() !== '' && line[0] !== '>' - }).join(';') - - t.equal(stdout, command) - t.end() -} - -function writeMetadata (object) { - fs.writeFileSync( - path.resolve(pkg, 'package.json'), - JSON.stringify(object, null, 2) + '\n' - ) -} - -function cleanup () { - rimraf.sync(pkg) -} - -test('setup', function (t) { - cleanup() - mkdirp.sync(cache) - mkdirp.sync(tmp) - writeMetadata(fullyPopulated) - t.end() -}) - -test('npm run-script start', function (t) { - common.npm(['run-script', 'start'], opts, testOutput.bind(null, t, 'start')) -}) - -test('npm run-script with args', function (t) { - common.npm(['run-script', 'start', '--', 'stop'], opts, testOutput.bind(null, t, 'stop')) -}) - -test('npm run-script with args that contain spaces', function (t) { - common.npm(['run-script', 'start', '--', 'hello world'], opts, testOutput.bind(null, t, 'hello world')) -}) - -test('npm run-script with args that contain single quotes', function (t) { - common.npm(['run-script', 'start', '--', 'they"re awesome'], opts, testOutput.bind(null, t, 'they"re awesome')) -}) - -test('npm run-script with args that contain double quotes', function (t) { - common.npm(['run-script', 'start', '--', 'what"s "up"?'], opts, testOutput.bind(null, t, 'what"s "up"?')) -}) - -test('npm run-script with args that contain ticks', function (t) { - common.npm(['run-script', 'start', '--', 'what\'s \'up\'?'], opts, testOutput.bind(null, t, 'what\'s \'up\'?')) -}) - -test('npm run-script with pre script', function (t) { - common.npm(['run-script', 'with-post'], opts, testOutput.bind(null, t, 'main;post')) -}) - -test('npm run-script with post script', function (t) { - common.npm(['run-script', 'with-pre'], opts, testOutput.bind(null, t, 'pre;main')) -}) - -test('npm run-script with both pre and post script', function (t) { - common.npm(['run-script', 'with-both'], opts, testOutput.bind(null, t, 'pre;main;post')) -}) - -test('npm run-script with both pre and post script and with args', function (t) { - common.npm(['run-script', 'with-both', '--', 'an arg'], opts, testOutput.bind(null, t, 'pre;an arg;post')) -}) - -test('npm run-script explicitly call pre script with arg', function (t) { - common.npm(['run-script', 'prewith-pre', '--', 'an arg'], opts, testOutput.bind(null, t, 'an arg')) -}) - -test('npm run-script test', function (t) { - common.npm(['run-script', 'test'], opts, function (er, code, stdout, stderr) { - t.ifError(er, 'npm run-script test ran without issue') - t.notOk(stderr, 'should not generate errors') - t.end() - }) -}) - -test('npm run-script env', function (t) { - common.npm(['run-script', 'env'], opts, function (er, code, stdout, stderr) { - t.ifError(er, 'using default env script') - t.notOk(stderr, 'should not generate errors') - t.ok(stdout.indexOf('npm_config_init_version') > 0, 'expected values in var list') - t.end() - }) -}) - -test('npm run-script nonexistent-script', function (t) { - common.npm(['run-script', 'nonexistent-script'], opts, function (er, code, stdout, stderr) { - t.ifError(er, 'npm run-script nonexistent-script did not cause npm to explode') - t.ok(stderr, 'should generate errors') - t.end() - }) -}) - -test('npm run-script restart when there isn\'t restart', function (t) { - common.npm(['run-script', 'restart'], opts, testOutput.bind(null, t, 'stop;start')) -}) - -test('npm run-script nonexistent-script with --if-present flag', function (t) { - common.npm(['run-script', '--if-present', 'nonexistent-script'], opts, function (er, code, stdout, stderr) { - t.ifError(er, 'npm run-script --if-present non-existent-script ran without issue') - t.notOk(stderr, 'should not generate errors') - t.end() - }) -}) - -test('npm run-script env vars accessible', function (t) { - process.env.run_script_foo_var = 'run_script_test_foo_val' - common.npm(['run-script', 'env-vars'], { - cwd: pkg - }, function (err, code, stdout, stderr) { - t.ifError(err, 'ran run-script without crashing') - t.equal(code, 0, 'exited normally') - t.equal(stderr, '', 'no error output') - t.match(stdout, - new RegExp(process.env.run_script_foo_var), - 'script had env access') - t.end() - }) -}) - -test('npm run-script package.json vars injected', function (t) { - common.npm(['run-script', 'package-env-vars'], { - cwd: pkg - }, function (err, code, stdout, stderr) { - t.ifError(err, 'ran run-script without crashing') - t.equal(code, 0, 'exited normally') - t.equal(stderr, '', 'no error output') - t.match(stdout, - new RegExp(fullyPopulated.run_script_foo_var), - 'script injected package.json value') - t.end() - }) -}) - -test('npm run-script package.json vars injected with prefix', function (t) { - common.npm(['run-script', 'prefixed-package-env-vars'], { - cwd: pkg - }, function (err, code, stdout, stderr) { - t.ifError(err, 'ran run-script without crashing') - t.equal(code, 0, 'exited normally') - t.equal(stderr, '', 'no error output') - t.match(stdout, - new RegExp(fullyPopulated.run_script_foo_var), - 'script injected npm_package-prefixed package.json value') - t.end() - }) -}) - -test('npm run-script env vars stripped npm-prefixed', function (t) { - process.env.npm_run_script_foo_var = 'run_script_test_foo_val' - common.npm(['run-script', 'npm-env-vars'], { - cwd: pkg - }, function (err, code, stdout, stderr) { - t.ifError(err, 'ran run-script without crashing') - t.equal(code, 0, 'exited normally') - t.equal(stderr, '', 'no error output') - t.notMatch(stdout, - new RegExp(process.env.npm_run_script_foo_var), - 'script stripped npm-prefixed env var') - t.end() - }) -}) - -test('npm run-script no-params (lifecycle only)', function (t) { - var expected = [ - 'Lifecycle scripts included in scripted:', - ' prestart', - ' echo prestart', - '' - ].join('\n') - - writeMetadata(lifecycleOnly) - - common.npm(['run-script'], opts, function (err, code, stdout, stderr) { - t.ifError(err, 'ran run-script without parameters without crashing') - t.notOk(code, 'npm exited without error code') - t.notOk(stderr, 'npm printed nothing to stderr') - t.equal(stdout, expected, 'got expected output') - t.end() - }) -}) - -test('npm run-script no-params (preversion only)', function (t) { - var expected = [ - 'Lifecycle scripts included in scripted:', - ' preversion', - ' echo preversion', - '' - ].join('\n') - - writeMetadata(preversionOnly) - - common.npm(['run-script'], opts, function (err, code, stdout, stderr) { - t.ifError(err, 'ran run-script without parameters without crashing') - t.notOk(code, 'npm exited without error code') - t.notOk(stderr, 'npm printed nothing to stderr') - t.equal(stdout, expected, 'got expected output') - t.end() - }) -}) - -test('npm run-script no-params (direct only)', function (t) { - var expected = [ - 'Scripts available in scripted via `npm run-script`:', - ' whoa', - ' echo whoa', - '' - ].join('\n') - - writeMetadata(directOnly) - - common.npm(['run-script'], opts, function (err, code, stdout, stderr) { - t.ifError(err, 'ran run-script without parameters without crashing') - t.notOk(code, 'npm exited without error code') - t.notOk(stderr, 'npm printed nothing to stderr') - t.equal(stdout, expected, 'got expected output') - t.end() - }) -}) - -test('npm run-script script-shell config', function (t) { - writeMetadata(shell) - - common.npm(['run-script', 'start', '--script-shell', 'echo'], opts, testOutput.bind(null, t, '-c echo foo')) -}) - -test('npm run-script no-params (direct only)', function (t) { - var expected = [ - 'Lifecycle scripts included in scripted:', - ' prestart', - ' echo prestart', - '', - 'available via `npm run-script`:', - ' whoa', - ' echo whoa', - '' - ].join('\n') - - writeMetadata(both) - - common.npm(['run-script'], opts, function (err, code, stdout, stderr) { - t.ifError(err, 'ran run-script without parameters without crashing') - t.notOk(code, 'npm exited without error code') - t.notOk(stderr, 'npm printed nothing to stderr') - t.equal(stdout, expected, 'got expected output') - t.end() - }) -}) - -test('npm run-script keep non-zero exit code', function (t) { - writeMetadata(exitCode) - - common.npm(['run-script', 'start'], opts, function (err, code, stdout, stderr) { - t.ifError(err, 'ran run-script without parameters without crashing') - t.equal(code, 7, 'got expected exit code') - t.ok(stderr, 'should generate errors') - t.end() - }) -}) - -test('npm run-script nonexistent script and display suggestions', function (t) { - writeMetadata(directOnly) - - common.npm(['run-script', 'whoop'], opts, function (err, code, stdout, stderr) { - t.ifError(err, 'ran run-script without crashing') - t.equal(code, 1, 'got expected exit code') - t.has(stderr, 'Did you mean this?') - t.end() - }) -}) - -test('cleanup', function (t) { - cleanup() - t.end() -}) diff --git a/deps/npm/test/tap/save-optional.js b/deps/npm/test/tap/save-optional.js deleted file mode 100644 index 9985451684d074..00000000000000 --- a/deps/npm/test/tap/save-optional.js +++ /dev/null @@ -1,81 +0,0 @@ -'use strict' -const path = require('path') -const test = require('tap').test -const mr = require('npm-registry-mock') -const Tacks = require('tacks') -const fs = require('fs') -const File = Tacks.File -const Dir = Tacks.Dir -const common = require('../common-tap.js') - -const basedir = common.pkg -const testdir = path.join(basedir, 'testdir') -const cachedir = common.cache -const globaldir = path.join(basedir, 'global') -const tmpdir = path.join(basedir, 'tmp') - -const conf = { - cwd: testdir, - stdio: [0, 1, 2], - env: Object.assign({}, process.env, { - npm_config_cache: cachedir, - npm_config_tmp: tmpdir, - npm_config_prefix: globaldir, - npm_config_registry: common.registry, - npm_config_loglevel: 'silly' - }) -} - -let server -const fixture = new Tacks(Dir({ - cache: Dir(), - global: Dir(), - tmp: Dir(), - testdir: Dir({ - example: Dir({ - 'package.json': File({ - name: 'example', - version: '1.0.0' - }) - }), - 'package.json': File({ - name: 'save-optional', - version: '1.0.0' - }) - }) -})) - -function setup () { - cleanup() - fixture.create(basedir) -} - -function cleanup () { - fixture.remove(basedir) -} - -test('setup', function (t) { - setup() - mr({port: common.port, throwOnUnmatched: true}, function (err, s) { - if (err) throw err - server = s - t.done() - }) -}) - -test('example', function (t) { - common.npm(['install', '-O', '--package-lock-only', 'file:example'], conf, function (err, code) { - if (err) throw err - t.is(code, 0, 'command ran ok') - const plock = JSON.parse(fs.readFileSync(`${testdir}/package-lock.json`)) - t.like(plock, { dependencies: { example: { optional: true } } }, 'optional status saved') - // your assertions here - t.done() - }) -}) - -test('cleanup', function (t) { - server.close() - cleanup() - t.done() -}) diff --git a/deps/npm/test/tap/scope-header.js b/deps/npm/test/tap/scope-header.js deleted file mode 100644 index f4eb7ae12c1046..00000000000000 --- a/deps/npm/test/tap/scope-header.js +++ /dev/null @@ -1,160 +0,0 @@ -'use strict' -var path = require('path') -var test = require('tap').test -var mr = require('npm-registry-mock') -var Tacks = require('tacks') -var File = Tacks.File -var Dir = Tacks.Dir -var common = require('../common-tap.js') - -var basedir = common.pkg -var testdir = path.join(basedir, 'testdir') -var withScope = path.join(testdir, 'with-scope') -var withoutScope = path.join(testdir, 'without-scope') -var onlyProjectScope = path.join(testdir, 'only-project-scope') -var cachedir = common.cache -var globaldir = path.join(basedir, 'global') -var tmpdir = path.join(basedir, 'tmp') - -var env = common.newEnv().extend({ - npm_config_cache: cachedir, - npm_config_tmp: tmpdir, - npm_config_prefix: globaldir, - npm_config_registry: common.registry, - npm_config_loglevel: 'warn' -}) - -var conf = function (cwd) { - return { - cwd: cwd || testdir, - env: env - } -} -var server -var fixture = new Tacks(Dir({ - cache: Dir(), - global: Dir(), - tmp: Dir(), - testdir: Dir({ - 'with-scope': Dir({ - 'package.json': File({ - name: '@example/with-scope', - version: '1.0.0' - }) - }), - 'without-scope': Dir({ - 'package.json': File({ - name: 'without-scope', - version: '1.0.0' - }) - }), - 'only-project-scope': Dir({ - '.npmrc': File('@example:registry=thisisinvalid\n'), - 'package.json': File({ - name: '@example/only-project-scope', - version: '1.0.0' - }) - }) - }) -})) - -function setup () { - cleanup() - fixture.create(basedir) -} - -function cleanup () { - fixture.remove(basedir) -} - -var scopeHeaderTestGotScope = { - 'time': {'1.0.0': ''}, - 'dist-tags': {'latest': '1.0.0'}, - 'versions': { - '1.0.0': { - name: 'scope-header-test', - version: '1.0.0', - gotScope: true - } - } -} -var scopeHeaderTestNoScope = { - 'time': {'1.0.0': ''}, - 'dist-tags': {'latest': '1.0.0'}, - 'versions': { - '1.0.0': { - name: 'scope-header-test', - version: '1.0.0', - gotScope: false - } - } -} - -test('setup', function (t) { - setup() - mr({port: common.port, throwOnUnmatched: true}, function (err, s) { - if (err) throw err - server = s - server.get('/scope-header-test', { - 'NPM-Scope': '@example' - }).many().reply('200', scopeHeaderTestGotScope) - server.get('/scope-header-test', {}).many().reply('200', scopeHeaderTestNoScope) - t.done() - }) -}) - -test('with-scope', function (t) { - common.npm(['view', '--cache-min=0', 'scope-header-test', 'gotScope'], conf(withScope), function (err, code, stdout, stderr) { - if (err) throw err - t.is(code, 0, 'command ran ok') - t.comment(stderr.trim()) - t.is(stdout.trim(), 'true', 'got version matched to scope header') - t.done() - }) -}) - -test('without-scope', function (t) { - common.npm(['view', '--cache-min=0', 'scope-header-test', 'gotScope'], conf(withoutScope), function (err, code, stdout, stderr) { - if (err) throw err - t.is(code, 0, 'command ran ok') - t.comment(stderr.trim()) - t.is(stdout.trim(), 'false', 'got version matched to NO scope header') - t.done() - }) -}) - -test('scope can be forced by having an explicit one', function (t) { - common.npm([ - 'view', - '--cache-min=0', - '--scope=example', - 'scope-header-test', - 'gotScope' - ], conf(withoutScope), function (err, code, stdout, stderr) { - if (err) throw err - t.is(code, 0, 'command ran ok') - t.comment(stderr.trim()) - t.is(stdout.trim(), 'true', 'got version matched to scope header') - t.done() - }) -}) - -test('only the project scope is used', function (t) { - common.npm([ - 'view', - '--cache-min=0', - 'scope-header-test', 'gotScope' - ], conf(onlyProjectScope), function (err, code, stdout, stderr) { - if (err) throw err - t.is(code, 0, 'command ran ok') - t.comment(stderr.trim()) - t.is(stdout.trim(), 'true', 'got version scope') - t.done() - }) -}) - -test('cleanup', function (t) { - server.close() - cleanup() - t.done() -}) diff --git a/deps/npm/test/tap/scripts-whitespace-windows.js b/deps/npm/test/tap/scripts-whitespace-windows.js deleted file mode 100644 index 9a301dca526d05..00000000000000 --- a/deps/npm/test/tap/scripts-whitespace-windows.js +++ /dev/null @@ -1,88 +0,0 @@ -var fs = require('graceful-fs') -var path = require('path') - -var mkdirp = require('mkdirp') -var test = require('tap').test - -var common = require('../common-tap') - -var pkg = common.pkg -var tmp = path.resolve(pkg, 'tmp') -var cache = common.cache -var dep = path.resolve(pkg, 'dep') - -var EXEC_OPTS = { cwd: pkg } - -var json = { - name: 'scripts-whitespace-windows', - version: '1.0.0', - description: 'a test', - repository: 'git://github.com/robertkowalski/bogus', - scripts: { - foo: 'foo --title "Analysis of" --recurse -d report src' - }, - dependencies: { - 'scripts-whitespace-windows-dep': '0.0.1' - }, - license: 'WTFPL' -} - -var dependency = { - name: 'scripts-whitespace-windows-dep', - version: '0.0.1', - bin: [ 'bin/foo' ] -} - -var foo = function () { /* -#!/usr/bin/env node - -if (process.argv.length === 8) - console.log('npm-test-fine') -*/ }.toString().split('\n').slice(1, -1).join('\n') - -test('setup', function (t) { - mkdirp.sync(tmp) - fs.writeFileSync( - path.join(pkg, 'package.json'), - JSON.stringify(json, null, 2) - ) - fs.writeFileSync( - path.join(pkg, 'README.md'), - "### THAT'S RIGHT\n" - ) - - mkdirp.sync(path.join(dep, 'bin')) - fs.writeFileSync( - path.join(dep, 'package.json'), - JSON.stringify(dependency, null, 2) - ) - fs.writeFileSync(path.join(dep, 'bin', 'foo'), foo) - - common.npm(['i', dep], { - cwd: pkg, - env: Object.assign({ - npm_config_cache: cache, - npm_config_tmp: tmp, - npm_config_prefix: pkg, - npm_config_global: 'false' - }, process.env) - }, function (err, code, stdout, stderr) { - t.ifErr(err, 'npm i ' + dep + ' finished without error') - t.equal(code, 0, 'npm i ' + dep + ' exited ok') - t.notOk(stderr, 'no output stderr') - t.end() - }) -}) - -test('test', function (t) { - common.npm(['run', 'foo'], EXEC_OPTS, function (err, code, stdout, stderr) { - stderr = stderr.trim() - if (stderr) console.error(stderr) - t.ifErr(err, 'npm run finished without error') - t.equal(code, 0, 'npm run exited ok') - t.notOk(stderr, 'no output stderr: ' + stderr) - stdout = stdout.trim() - t.ok(/npm-test-fine/.test(stdout)) - t.end() - }) -}) diff --git a/deps/npm/test/tap/search.all-package-search.js b/deps/npm/test/tap/search.all-package-search.js deleted file mode 100644 index 9b3b989f9c7261..00000000000000 --- a/deps/npm/test/tap/search.all-package-search.js +++ /dev/null @@ -1,207 +0,0 @@ -'use strict' - -const cacheFile = require('npm-cache-filename') -const mkdirp = require('mkdirp') -const mr = require('npm-registry-mock') -const path = require('path') -const qs = require('querystring') -const Tacks = require('tacks') -const test = require('tap').test - -const {File} = Tacks - -const common = require('../common-tap.js') - -const CACHE_DIR = common.cache -const cacheBase = cacheFile(CACHE_DIR)(common.registry + '/-/all') -const cachePath = path.join(cacheBase, '.cache.json') -const chownr = require('chownr') -const fixOwner = ( - process.getuid && process.getuid() === 0 && - process.env.SUDO_UID && process.env.SUDO_GID -) ? (path) => chownr.sync(path, +process.env.SUDO_UID, +process.env.SUDO_GID) - : () => {} - -let server - -test('setup', function (t) { - mkdirp.sync(cacheBase) - fixOwner(CACHE_DIR) - mr({port: common.port, throwOnUnmatched: true}, function (err, s) { - t.ifError(err, 'registry mocked successfully') - server = s - t.pass('all set up') - t.done() - }) -}) - -const searches = [ - { - term: 'cool', - description: 'non-regex search', - location: 103 - }, - { - term: '/cool/', - description: 'regex search', - location: 103 - }, - { - term: 'cool', - description: 'searches name field', - location: 103 - }, - { - term: 'ool', - description: 'excludes matches for --searchexclude', - location: 205, - inject: { - other: { name: 'other', description: 'this is a simple tool' } - }, - extraOpts: ['--searchexclude', 'cool'] - }, - { - term: 'neat lib', - description: 'searches description field', - location: 141, - inject: { - cool: { - name: 'cool', version: '5.0.0', description: 'this is a neat lib' - } - } - }, - { - term: 'foo', - description: 'skips description field with --no-description', - location: 80, - inject: { - cool: { - name: 'cool', version: '5.0.0', description: 'foo bar!' - } - }, - extraOpts: ['--no-description'] - }, - { - term: 'zkat', - description: 'searches maintainers by name', - location: 155, - inject: { - cool: { - name: 'cool', - version: '5.0.0', - maintainers: [{ - name: 'zkat' - }] - } - } - }, - { - term: '=zkat', - description: 'searches maintainers unambiguously by =name', - location: 154, - inject: { - bar: { name: 'bar', description: 'zkat thing', version: '1.0.0' }, - cool: { - name: 'cool', - version: '5.0.0', - maintainers: [{ - name: 'zkat' - }] - } - } - }, - { - term: 'github.com', - description: 'searches projects by url', - location: 205, - inject: { - bar: { - name: 'bar', - url: 'gitlab.com/bar', - // For historical reasons, `url` is only present if `versions` is there - versions: ['1.0.0'], - version: '1.0.0' - }, - cool: { - name: 'cool', - version: '5.0.0', - versions: ['1.0.0'], - url: 'github.com/cool/cool' - } - } - }, - { - term: 'monad', - description: 'searches projects by keywords', - location: 197, - inject: { - cool: { - name: 'cool', - version: '5.0.0', - keywords: ['monads'] - } - } - } -] - -// These test classic hand-matched searches -searches.forEach(function (search) { - test(search.description, function (t) { - const query = qs.stringify({ - text: search.term, - size: 20, - from: 0, - quality: 0.65, - popularity: 0.98, - maintenance: 0.5 - }) - server.get(`/-/v1/search?${query}`).once().reply(404, {}) - const now = Date.now() - const cacheContents = { - '_updated': now, - bar: { name: 'bar', version: '1.0.0' }, - cool: { name: 'cool', version: '5.0.0' }, - foo: { name: 'foo', version: '2.0.0' }, - other: { name: 'other', version: '1.0.0' } - } - for (let k in search.inject) { - cacheContents[k] = search.inject[k] - } - const fixture = new Tacks(File(cacheContents)) - fixture.create(cachePath) - fixOwner(cachePath) - common.npm([ - 'search', search.term, - '--registry', common.registry, - '--cache', CACHE_DIR, - '--loglevel', 'error', - '--color', 'always' - ].concat(search.extraOpts || []), - {}, - function (err, code, stdout, stderr) { - t.equal(stderr, '', 'no error output') - t.notEqual(stdout, '', 'got output') - t.equal(code, 0, 'search finished successfully') - t.ifErr(err, 'search finished successfully') - // \033 == \u001B - const markStart = '\u001B\\[[0-9][0-9]m' - const markEnd = '\u001B\\[0m' - - const re = new RegExp(markStart + '.*?' + markEnd) - - const cnt = stdout.search(re) - t.equal( - cnt, - search.location, - search.description + ' search for ' + search.term - ) - t.end() - }) - }) -}) - -test('cleanup', function (t) { - server.done() - server.close() - t.end() -}) diff --git a/deps/npm/test/tap/search.js b/deps/npm/test/tap/search.js deleted file mode 100644 index 049706cc0892d8..00000000000000 --- a/deps/npm/test/tap/search.js +++ /dev/null @@ -1,254 +0,0 @@ -'use strict' - -const cacheFile = require('npm-cache-filename') -const mkdirp = require('mkdirp') -const mr = require('npm-registry-mock') -const path = require('path') -const qs = require('querystring') -const test = require('tap').test - -const Tacks = require('tacks') -const File = Tacks.File - -const common = require('../common-tap.js') - -// this test uses a fresh cache for each test block -// create them all in common.cache so that we can verify -// them for root-owned files in sudotest -let CACHE_DIR -let cacheBase -let cachePath -let cacheCounter = 1 -function setup () { - CACHE_DIR = common.cache + '/' + cacheCounter++ - cacheBase = cacheFile(CACHE_DIR)(common.registry + '/-/all') - cachePath = path.join(cacheBase, '.cache.json') - mkdirp.sync(cacheBase) - fixOwner(CACHE_DIR) -} - -const chownr = require('chownr') -const fixOwner = ( - process.getuid && process.getuid() === 0 && - process.env.SUDO_UID && process.env.SUDO_GID -) ? (path) => chownr.sync(path, +process.env.SUDO_UID, +process.env.SUDO_GID) - : () => {} - -let server - -test('setup', function (t) { - mr({port: common.port, throwOnUnmatched: true}, function (err, s) { - t.ifError(err, 'registry mocked successfully') - server = s - t.pass('all set up') - t.done() - }) -}) - -test('notifies when there are no results', function (t) { - setup() - const query = qs.stringify({ - text: 'none', - size: 20, - from: 0, - quality: 0.65, - popularity: 0.98, - maintenance: 0.5 - }) - server.get(`/-/v1/search?${query}`).once().reply(200, { - objects: [] - }) - common.npm([ - 'search', 'none', - '--registry', common.registry, - '--loglevel', 'error', - '--cache', CACHE_DIR - ], {}, function (err, code, stdout, stderr) { - if (err) throw err - t.equal(stderr, '', 'no error output') - t.equal(code, 0, 'search gives 0 error code even if no matches') - t.match(stdout, /No matches found/, 'Useful message on search failure') - t.done() - }) -}) - -test('spits out a useful error when no cache nor network', function (t) { - setup() - const query = qs.stringify({ - text: 'foo', - size: 20, - from: 0, - quality: 0.65, - popularity: 0.98, - maintenance: 0.5 - }) - server.get(`/-/v1/search?${query}`).once().reply(404, {}) - server.get('/-/all').many().reply(404, {}) - const cacheContents = {} - const fixture = new Tacks(File(cacheContents)) - fixture.create(cachePath) - fixOwner(cachePath) - common.npm([ - 'search', 'foo', - '--registry', common.registry, - '--loglevel', 'silly', - '--json', - '--fetch-retry-mintimeout', 0, - '--fetch-retry-maxtimeout', 0, - '--cache', CACHE_DIR - ], {}, function (err, code, stdout, stderr) { - if (err) throw err - t.equal(code, 1, 'non-zero exit code') - t.match(JSON.parse(stdout).error.summary, /No search sources available/) - t.match(stderr, /No search sources available/, 'useful error') - t.done() - }) -}) - -test('can switch to JSON mode', function (t) { - setup() - const query = qs.stringify({ - text: 'oo', - size: 20, - from: 0, - quality: 0.65, - popularity: 0.98, - maintenance: 0.5 - }) - server.get(`/-/v1/search?${query}`).once().reply(200, { - objects: [ - { package: { name: 'cool', version: '1.0.0' } }, - { package: { name: 'foo', version: '2.0.0' } } - ] - }) - common.npm([ - 'search', 'oo', - '--json', - '--registry', common.registry, - '--loglevel', 'error', - '--cache', CACHE_DIR - ], {}, function (err, code, stdout, stderr) { - if (err) throw err - t.equal(stderr, '', 'no error output') - t.equal(code, 0, 'search gives 0 error code even if no matches') - t.similar(JSON.parse(stdout), [ - { - name: 'cool', - version: '1.0.0' - }, - { - name: 'foo', - version: '2.0.0' - } - ], 'results returned as valid json') - t.done() - }) -}) - -test('JSON mode does not notify on empty', function (t) { - setup() - const query = qs.stringify({ - text: 'oo', - size: 20, - from: 0, - quality: 0.65, - popularity: 0.98, - maintenance: 0.5 - }) - server.get(`/-/v1/search?${query}`).once().reply(200, { - objects: [] - }) - common.npm([ - 'search', 'oo', - '--json', - '--registry', common.registry, - '--loglevel', 'error', - '--cache', CACHE_DIR - ], {}, function (err, code, stdout, stderr) { - if (err) throw err - t.deepEquals(JSON.parse(stdout), [], 'no notification about no results') - t.equal(stderr, '', 'no error output') - t.equal(code, 0, 'search gives 0 error code even if no matches') - t.done() - }) -}) - -test('can switch to tab separated mode', function (t) { - setup() - const query = qs.stringify({ - text: 'oo', - size: 20, - from: 0, - quality: 0.65, - popularity: 0.98, - maintenance: 0.5 - }) - server.get(`/-/v1/search?${query}`).once().reply(200, { - objects: [ - { package: { name: 'cool', version: '1.0.0' } }, - { package: { name: 'foo', description: 'this\thas\ttabs', version: '2.0.0' } } - ] - }) - common.npm([ - 'search', 'oo', - '--parseable', - '--registry', common.registry, - '--loglevel', 'error', - '--cache', CACHE_DIR - ], {}, function (err, code, stdout, stderr) { - if (err) throw err - t.equal(stdout, 'cool\t\t\tprehistoric\t1.0.0\t\nfoo\tthis has tabs\t\tprehistoric\t2.0.0\t\n', 'correct output, including replacing tabs in descriptions') - t.equal(stderr, '', 'no error output') - t.equal(code, 0, 'search gives 0 error code even if no matches') - t.done() - }) -}) - -test('tab mode does not notify on empty', function (t) { - setup() - const query = qs.stringify({ - text: 'oo', - size: 20, - from: 0, - quality: 0.65, - popularity: 0.98, - maintenance: 0.5 - }) - server.get(`/-/v1/search?${query}`).once().reply(200, { - objects: [] - }) - common.npm([ - 'search', 'oo', - '--parseable', - '--registry', common.registry, - '--loglevel', 'error', - '--cache', CACHE_DIR - ], {}, function (err, code, stdout, stderr) { - if (err) throw err - t.equal(stdout, '', 'no notification about no results') - t.equal(stderr, '', 'no error output') - t.equal(code, 0, 'search gives 0 error code even if no matches') - t.done() - }) -}) - -test('no arguments provided should error', function (t) { - setup() - common.npm(['search', '--cache', CACHE_DIR], {}, function (err, code, stdout, stderr) { - if (err) throw err - t.equal(code, 1, 'search finished unsuccessfully') - - t.match( - stderr, - /search must be called with arguments/, - 'should have correct error message' - ) - t.end() - }) -}) - -test('cleanup', function (t) { - server.done() - server.close() - t.end() -}) diff --git a/deps/npm/test/tap/semver-doc.js b/deps/npm/test/tap/semver-doc.js deleted file mode 100644 index fe2077660c1dd1..00000000000000 --- a/deps/npm/test/tap/semver-doc.js +++ /dev/null @@ -1,14 +0,0 @@ -var test = require('tap').test - -test('semver doc is up to date', function (t) { - var path = require('path') - var moddoc = path.join(__dirname, '../../node_modules/semver/README.md') - var mydoc = path.join(__dirname, '../../docs/content/using-npm/semver.md') - var fs = require('fs') - var mod = fs.readFileSync(moddoc, 'utf8') - mod = mod.substr(mod.match(/^## Install$/m).index) - var my = fs.readFileSync(mydoc, 'utf8') - my = my.substr(my.match(/^## Install$/m).index) - t.equal(my, mod) - t.end() -}) diff --git a/deps/npm/test/tap/shared-linked.js b/deps/npm/test/tap/shared-linked.js deleted file mode 100644 index 517be4699d9738..00000000000000 --- a/deps/npm/test/tap/shared-linked.js +++ /dev/null @@ -1,151 +0,0 @@ -'use strict' -var path = require('path') -var test = require('tap').test -var Tacks = require('tacks') -var File = Tacks.File -var Symlink = Tacks.Symlink -var Dir = Tacks.Dir -var common = require('../common-tap.js') -var mr = require('npm-registry-mock') - -var testdir = common.pkg -var bugdir = path.join(testdir, 'modules', 'bug') - -// This is an absolutely minimal version of the optimist included with -// npm-registry-mock. -var optimist = Dir({ - 'package.json': File({ - dependencies: { - minimist: '~0.0.1', - wordwrap: '~0.0.2' - }, - name: 'optimist', - version: '0.6.0' - }), - node_modules: Dir({ - minimist: Dir({ - 'package.json': File({ - _shasum: 'd7aa327bcecf518f9106ac6b8f003fa3bcea8566', - _resolve: 'foo', - name: 'minimist', - version: '0.0.5' - }) - }), - wordwrap: Dir({ - 'package.json': File({ - _shasum: 'b79669bb42ecb409f83d583cad52ca17eaa1643f', - _resolve: 'foo', - name: 'wordwrap', - version: '0.0.2' - }) - }) - }) -}) - -var fixture = new Tacks( - Dir({ - global: Dir({ - lib: Dir({ - node_modules: Dir({ - linked1: Symlink('../../../modules/linked1/'), - linked2: Symlink('../../../modules/linked2/') - }) - }) - }), - modules: Dir({ - bug: Dir({ - node_modules: Dir({ - linked1: Symlink('../../../global/lib/node_modules/linked1'), - linked2: Symlink('../../../global/lib/node_modules/linked2') - }), - 'package.json': File({ - name: 'bug', - version: '10800.0.0', - devDependencies: { - optimist: '0.6.0', - linked1: '^1.0.0', - linked2: '^1.0.0' - } - }) - }), - linked1: Dir({ - 'package.json': File({ - name: 'linked1', - version: '1.0.0', - devDependencies: { - optimist: '0.6.0' - } - }), - node_modules: Dir({ - optimist: optimist - }) - }), - linked2: Dir({ - 'package.json': File({ - name: 'linked2', - version: '1.0.0', - devDependencies: { - optimist: '0.6.0', - linked1: '^1.0.0' - } - }), - node_modules: Dir({ - linked1: Symlink('../../../global/lib/node_modules/linked1'), - optimist: optimist - }) - }) - }) - }) -) - -function setup () { - cleanup() - fixture.create(testdir) -} - -function cleanup () { - fixture.remove(testdir) -} - -var server -test('setup', function (t) { - setup() - mr({port: common.port}, function (er, s) { - t.ifError(er) - server = s - t.end() - }) -}) - -test('shared-linked', function (t) { - var options = { - cwd: bugdir, - env: Object.assign({}, process.env, { - npm_config_prefix: path.join(testdir, 'global') - }) - } - var config = [ - '--cache', common.cache, - '--registry', common.registry, - '--unicode', 'false' - ] - - common.npm(config.concat(['install', '--dry-run', '--parseable']), options, function (err, code, stdout, stderr) { - if (err) throw err - t.is(code, 0) - var got = stdout.trim().replace(/\s+\n/g, '\n').replace(/\\/g, '/') - var expected = - 'add\tminimist\t0.0.5\tnode_modules/minimist\n' + - 'add\twordwrap\t0.0.2\tnode_modules/wordwrap\n' + - 'add\toptimist\t0.6.0\tnode_modules/optimist' - t.is(got, expected, 'just an optimist install please') - server.done() - t.end() - }) -}) - -test('cleanup', function (t) { - if (server) server.close() - cleanup() - t.end() -}) diff --git a/deps/npm/test/tap/shrinkwrap-_auth.js b/deps/npm/test/tap/shrinkwrap-_auth.js deleted file mode 100644 index 2987e3eec0ace8..00000000000000 --- a/deps/npm/test/tap/shrinkwrap-_auth.js +++ /dev/null @@ -1,109 +0,0 @@ -'use strict' - -var fs = require('fs') -var path = require('path') -var writeFileSync = require('graceful-fs').writeFileSync - -var mkdirp = require('mkdirp') -var http = require('http') -var ssri = require('ssri') -var t = require('tap') -var test = t.test - -var common = require('../common-tap.js') - -var pkg = common.pkg -var outfile = path.resolve(pkg, '_npmrc') - -var modules = path.resolve(pkg, 'node_modules') -var tarballPath = '/scoped-underscore/-/scoped-underscore-1.3.1.tgz' -var tarballURL = common.registry + tarballPath -var tarball = path.resolve(__dirname, '../fixtures/scoped-underscore-1.3.1.tgz') -var tarballIntegrity = ssri.fromData(fs.readFileSync(tarball)).toString() - -var _auth = '0xabad1dea' - -var contents = '_auth=' + _auth + '\n' + - '\'always-auth\'=true\n' - -var json = { - name: 'test-package-install', - version: '1.0.0', - dependencies: { - '@scoped/underscore': '1.0.0' - } -} - -var shrinkwrap = { - name: 'test-package-install', - version: '1.0.0', - lockfileVersion: 1, - dependencies: { - '@scoped/underscore': { - resolved: tarballURL, - integrity: tarballIntegrity, - version: '1.3.1' - } - } -} - -var server = http.createServer() -t.teardown(() => server.close()) - -const errors = [] -server.on('request', (req, res) => { - const auth = 'Basic ' + _auth - if (req.method === 'GET' && req.url === tarballPath) { - if (req.headers.authorization === auth) { - res.writeHead(200, 'ok') - res.end(fs.readFileSync(tarball)) - } else { - res.writeHead(403, 'unauthorized') - errors.push("Got authorization of '" + req.headers.authorization + "' expected '" + auth + "'") - res.end() - } - } else { - res.writeHead(500) - errors.push('Unknown request: ' + req.method + ' ' + req.url) - res.end() - } -}) - -test('setup', function (t) { - mkdirp.sync(modules) - writeFileSync(path.resolve(pkg, 'package.json'), JSON.stringify(json, null, 2) + '\n') - writeFileSync(outfile, contents) - writeFileSync( - path.resolve(pkg, 'npm-shrinkwrap.json'), - JSON.stringify(shrinkwrap, null, 2) + '\n' - ) - server.listen(common.port, t.end) -}) - -test('authed npm install with shrinkwrapped global package using _auth', function (t) { - common.npm( - [ - 'install', - '--loglevel', 'error', - '--json', - '--fetch-retries', 0, - '--registry', common.registry, - '--userconfig', outfile - ], - {cwd: pkg, stdio: [0, 'pipe', 2]}, - function (err, code, stdout) { - if (err) throw err - t.equal(code, 0, 'npm install exited OK') - errors.forEach((err) => t.comment('Error: ' + err)) - try { - var results = JSON.parse(stdout) - t.match(results, {added: [{name: '@scoped/underscore', version: '1.3.1'}]}, '@scoped/underscore installed') - } catch (ex) { - console.error('#', ex) - t.ifError(ex, 'stdout was valid JSON') - } - - t.end() - } - ) -}) diff --git a/deps/npm/test/tap/shrinkwrap-default-dev.js b/deps/npm/test/tap/shrinkwrap-default-dev.js deleted file mode 100644 index cd101092d4e92d..00000000000000 --- a/deps/npm/test/tap/shrinkwrap-default-dev.js +++ /dev/null @@ -1,93 +0,0 @@ -'use strict' -var path = require('path') -var test = require('tap').test -var fs = require('fs') -var Tacks = require('tacks') -var File = Tacks.File -var Dir = Tacks.Dir -var common = require('../common-tap.js') - -var basedir = common.pkg -var testdir = path.join(basedir, 'testdir') -var cachedir = common.cache -var globaldir = path.join(basedir, 'global') -var tmpdir = path.join(basedir, 'tmp') - -var conf = { - cwd: testdir, - env: Object.assign({}, process.env, { - npm_config_cache: cachedir, - npm_config_tmp: tmpdir, - npm_config_prefix: globaldir, - npm_config_registry: common.registry, - npm_config_loglevel: 'error' - }) -} - -var fixture = new Tacks(Dir({ - cache: Dir(), - global: Dir(), - tmp: Dir(), - testdir: Dir({ - node_modules: Dir({ - '@npmtest': Dir({ - example: Dir({ - 'package.json': File({ - name: '@npmtest/example', - version: '1.0.0' - }) - }) - }) - }), - 'package.json': File({ - name: 'shrinkwrap-default-dev', - version: '1.0.0', - devDependencies: { - '@npmtest/example': '1.0.0' - } - }) - }) -})) - -var shrinkwrapPath = path.join(testdir, 'npm-shrinkwrap.json') -var shrinkwrapWithDev = { - name: 'shrinkwrap-default-dev', - version: '1.0.0', - dependencies: { - '@npmtest/example': { - 'version': '1.0.0', - 'dev': true - } - } -} - -function setup () { - cleanup() - fixture.create(basedir) -} - -function cleanup () { - fixture.remove(basedir) -} - -test('setup', function (t) { - setup() - t.done() -}) - -test('shrinkwrap-default-dev', function (t) { - common.npm(['shrinkwrap'], conf, function (err, code, stdout, stderr) { - if (err) throw err - t.is(code, 0, 'command ran ok') - t.comment(stdout.trim()) - t.comment(stderr.trim()) - var swrap = JSON.parse(fs.readFileSync(shrinkwrapPath)) - t.isDeeply(swrap.dependencies, shrinkwrapWithDev.dependencies, 'Shrinkwrap included dev deps by default') - t.done() - }) -}) - -test('cleanup', function (t) { - cleanup() - t.done() -}) diff --git a/deps/npm/test/tap/shrinkwrap-dev-dependency.js b/deps/npm/test/tap/shrinkwrap-dev-dependency.js deleted file mode 100644 index 973cb5435b8f24..00000000000000 --- a/deps/npm/test/tap/shrinkwrap-dev-dependency.js +++ /dev/null @@ -1,70 +0,0 @@ -var fs = require('fs') -var path = require('path') - -var mr = require('npm-registry-mock') -var test = require('tap').test - -var common = require('../common-tap.js') - -var pkg = common.pkg - -var opts = [ - '--cache', common.cache, - '--registry', common.registry -] - -var desired = { - name: 'npm-test-shrinkwrap-dev-dependency', - version: '0.0.0', - dependencies: { - request: { - version: '0.9.0', - resolved: common.registry + '/request/-/request-0.9.0.tgz', - integrity: 'sha1-EEn1mm9GWI5tAwkh+7hMovDCcU4=' - }, - underscore: { - version: '1.3.1', - resolved: common.registry + '/underscore/-/underscore-1.3.1.tgz', - integrity: 'sha1-bLiq0Od+tdu/tUsivNhpcwnPlkE=' - } - } -} - -var json = { - author: 'Domenic Denicola', - name: 'npm-test-shrinkwrap-dev-dependency', - version: '0.0.0', - dependencies: { - request: '0.9.0', - underscore: '1.3.1' - }, - devDependencies: { - underscore: '1.5.1' - } -} - -test("shrinkwrap doesn't strip out the dependency", function (t) { - t.plan(3) - - fs.writeFileSync(path.join(pkg, 'package.json'), JSON.stringify(json, null, 2)) - process.chdir(pkg) - - mr({port: common.port}, function (er, s) { - common.npm(opts.concat(['install', '.']), {stdio: [0, 'pipe', 2]}, function (err, code) { - if (err) throw err - if (!t.is(code, 0)) return (s.close(), t.end()) - common.npm(opts.concat(['shrinkwrap']), {stdio: [0, 2, 2]}, function (err, code) { - if (err) throw err - t.is(code, 0) - try { - var results = JSON.parse(fs.readFileSync(path.join(pkg, 'npm-shrinkwrap.json'))) - } catch (ex) { - t.comment(ex) - } - t.deepEqual(results.dependencies, desired.dependencies) - s.close() - t.end() - }) - }) - }) -}) diff --git a/deps/npm/test/tap/shrinkwrap-empty-dep-value.js b/deps/npm/test/tap/shrinkwrap-empty-dep-value.js deleted file mode 100644 index 3a264f5a100542..00000000000000 --- a/deps/npm/test/tap/shrinkwrap-empty-dep-value.js +++ /dev/null @@ -1,66 +0,0 @@ -'use strict' - -const common = require('../common-tap.js') -const path = require('path') -const test = require('tap').test - -const Tacks = require('tacks') -const File = Tacks.File -const Dir = Tacks.Dir - -const basedir = common.pkg -const testdir = path.join(basedir, 'testdir') - -const fixture = new Tacks(Dir({ - cache: Dir(), - global: Dir(), - tmp: Dir(), - testdir: Dir({ - 'npm-shrinkwrap.json': File({ - name: 'http-locks', - version: '0.0.0', - dependencies: { - minimist: {} - } - }), - 'package.json': File({ - name: 'http-locks', - version: '1.0.0', - dependencies: { - minimist: common.registry + '/minimist/-/minimist-0.0.5.tgz' - } - }) - }) -})) - -function setup () { - cleanup() - fixture.create(basedir) -} - -function cleanup () { - fixture.remove(basedir) -} - -test('setup', function (t) { - setup() - t.done() -}) - -test('raises error to regenerate the shrinkwrap', function (t) { - common.npm(['install'], {cwd: testdir}, function (err, code, stdout, stderr) { - if (err) throw err - t.match( - stderr, - 'npm ERR! If using a shrinkwrap, regenerate with "npm shrinkwrap".', - 'returns message to regenerate shrinkwrap' - ) - - t.done() - }) -}) - -test('cleanup', function (t) { - cleanup() - t.done() -}) diff --git a/deps/npm/test/tap/shrinkwrap-empty-deps.js b/deps/npm/test/tap/shrinkwrap-empty-deps.js deleted file mode 100644 index 3c68845745a943..00000000000000 --- a/deps/npm/test/tap/shrinkwrap-empty-deps.js +++ /dev/null @@ -1,58 +0,0 @@ -'use strict' - -const common = require('../common-tap.js') -const fs = require('fs') -const mr = require('npm-registry-mock') -const path = require('path') -const test = require('tap').test - -const pkg = common.pkg - -const EXEC_OPTS = { cwd: pkg } - -const json = { - author: 'Rockbert', - name: 'shrinkwrap-empty-deps', - version: '0.0.0', - dependencies: {}, - devDependencies: {} -} - -test('setup', function (t) { - fs.writeFileSync( - path.join(pkg, 'package.json'), - JSON.stringify(json, null, 2) - ) - - process.chdir(pkg) - t.end() -}) - -test('returns a list of removed items', function (t) { - mr({ port: common.port }, function (er, s) { - common.npm( - [ - '--registry', common.registry, - '--loglevel', 'silent', - 'shrinkwrap' - ], - EXEC_OPTS, - function (err, code, stdout, stderr) { - t.ifError(err, 'shrinkwrap ran without issue') - t.notOk(code, 'shrinkwrap ran without raising error code') - - fs.readFile(path.resolve(pkg, 'npm-shrinkwrap.json'), function (err, found) { - t.ifError(err, 'read npm-shrinkwrap.json without issue') - t.same( - JSON.parse(found).dependencies, - undefined, - 'shrinkwrap handled empty deps without exploding' - ) - - s.close() - t.end() - }) - } - ) - }) -}) diff --git a/deps/npm/test/tap/shrinkwrap-extra-metadata.js b/deps/npm/test/tap/shrinkwrap-extra-metadata.js deleted file mode 100644 index 6e652e2db07147..00000000000000 --- a/deps/npm/test/tap/shrinkwrap-extra-metadata.js +++ /dev/null @@ -1,60 +0,0 @@ -'use strict' - -const common = require('../common-tap.js') -const fs = require('fs') -const mr = require('npm-registry-mock') -const npm = require('../../lib/npm.js') -const path = require('path') -const test = require('tap').test - -const pkg = common.pkg - -const json = { - author: 'Rockbert', - name: 'shrinkwrap-extra-metadata', - version: '0.0.0' -} - -test('setup', function (t) { - fs.writeFileSync( - path.join(pkg, 'package.json'), - JSON.stringify(json, null, 2) - ) - - process.chdir(pkg) - t.end() -}) - -test('adds additional metadata fields from the pkglock spec', function (t) { - mr({ port: common.port }, function (er, s) { - t.teardown(() => s.close()) - common.npm( - [ - '--registry', common.registry, - '--loglevel', 'silent', - 'shrinkwrap' - ], - { cwd: pkg, env: { NODE_PRESERVE_SYMLINKS: 'foo' } }, - function (err, code, stdout, stderr) { - t.ifError(err, 'shrinkwrap ran without issue') - t.notOk(code, 'shrinkwrap ran without raising error code') - - fs.readFile(path.resolve(pkg, 'npm-shrinkwrap.json'), function (err, desired) { - t.ifError(err, 'read npm-shrinkwrap.json without issue') - t.same( - { - 'name': 'shrinkwrap-extra-metadata', - 'version': '0.0.0', - 'lockfileVersion': npm.lockfileVersion, - 'preserveSymlinks': 'foo' - }, - JSON.parse(desired), - 'shrinkwrap wrote the expected metadata fields' - ) - - t.end() - }) - } - ) - }) -}) diff --git a/deps/npm/test/tap/shrinkwrap-global-auth.js b/deps/npm/test/tap/shrinkwrap-global-auth.js deleted file mode 100644 index e14a328a43a518..00000000000000 --- a/deps/npm/test/tap/shrinkwrap-global-auth.js +++ /dev/null @@ -1,97 +0,0 @@ -'use strict' - -var fs = require('fs') -var path = require('path') -var writeFileSync = require('graceful-fs').writeFileSync - -var mkdirp = require('mkdirp') -var mr = require('npm-registry-mock') -var ssri = require('ssri') -var test = require('tap').test - -var common = require('../common-tap.js') - -var pkg = common.pkg -var outfile = path.resolve(pkg, '_npmrc') - -var modules = path.resolve(pkg, 'node_modules') -var tarballPath = '/scoped-underscore/-/scoped-underscore-1.3.1.tgz' -var tarballURL = common.registry + tarballPath -var tarball = path.resolve(__dirname, '../fixtures/scoped-underscore-1.3.1.tgz') -var tarballIntegrity = ssri.fromData(fs.readFileSync(tarball)).toString() - -var contents = 'registry=' + common.registry + '\n' + - '_authToken=0xabad1dea\n' + - '\'always-auth\'=true\n' - -var json = { - name: 'test-package-install', - version: '1.0.0', - dependencies: { - '@scoped/underscore': '1.0.0' - } -} - -var shrinkwrap = { - name: 'test-package-install', - version: '1.0.0', - lockfileVersion: 1, - dependencies: { - '@scoped/underscore': { - resolved: tarballURL, - integrity: tarballIntegrity, - version: '1.3.1' - } - } -} - -function mocks (server) { - var auth = 'Bearer 0xabad1dea' - server.get(tarballPath, { authorization: auth }).replyWithFile(200, tarball) - server.get(tarballPath).reply(401, { - error: 'unauthorized', - reason: 'You are not authorized to access this db.' - }) -} - -test('setup', function (t) { - mkdirp.sync(modules) - writeFileSync(path.resolve(pkg, 'package.json'), JSON.stringify(json, null, 2) + '\n') - writeFileSync(outfile, contents) - writeFileSync( - path.resolve(pkg, 'npm-shrinkwrap.json'), - JSON.stringify(shrinkwrap, null, 2) + '\n' - ) - mr({ port: common.port, plugin: mocks }, function (er, s) { - t.parent.teardown(() => s.close()) - t.ok(s, 'set up mock registry') - t.end() - }) -}) - -test('authed npm install with shrinkwrapped global package', function (t) { - common.npm( - [ - 'install', - '--loglevel', 'error', - '--json', - '--fetch-retries', 0, - '--userconfig', outfile, - '--registry', common.registry - ], - {cwd: pkg, stdio: [0, 'pipe', 2]}, - function (err, code, stdout) { - if (err) throw err - t.equal(code, 0, 'npm install exited OK') - try { - var results = JSON.parse(stdout) - t.match(results, {added: [{name: '@scoped/underscore', version: '1.3.1'}]}, '@scoped/underscore installed') - } catch (ex) { - console.error('#', ex) - t.ifError(ex, 'stdout was valid JSON') - } - - t.end() - } - ) -}) diff --git a/deps/npm/test/tap/shrinkwrap-lifecycle-cwd.js b/deps/npm/test/tap/shrinkwrap-lifecycle-cwd.js deleted file mode 100644 index 78f40f52976285..00000000000000 --- a/deps/npm/test/tap/shrinkwrap-lifecycle-cwd.js +++ /dev/null @@ -1,87 +0,0 @@ -'use strict' -var path = require('path') -var test = require('tap').test -var mr = require('npm-registry-mock') -var Tacks = require('tacks') -var File = Tacks.File -var Dir = Tacks.Dir -var common = require('../common-tap.js') - -var basedir = common.pkg -var testdir = path.join(basedir, 'testdir') -var cachedir = common.cache -var globaldir = path.join(basedir, 'global') -var tmpdir = path.join(basedir, 'tmp') - -var conf = { - cwd: testdir, - env: Object.assign({ - npm_config_cache: cachedir, - npm_config_tmp: tmpdir, - npm_config_prefix: globaldir, - npm_config_registry: common.registry, - npm_config_loglevel: 'warn' - }, process.env) -} - -var server -var fixture = new Tacks(Dir({ - cache: Dir(), - global: Dir(), - tmp: Dir(), - testdir: Dir({ - node_modules: Dir({}), - 'package.json': File({ - name: '13252', - version: '1.0.0', - scripts: { - // add this to the end of the command to preserve the debug log: - // || mv npm-debug.log real-debug.log - // removed for windows compat reasons - abc: 'node ' + JSON.stringify(common.bin) + ' shrinkwrap', - shrinkwrap: 'node scripts/shrinkwrap.js' - } - }), - scripts: Dir({ - 'shrinkwrap.js': File( - 'console.log("OK " + process.cwd())' - ) - }) - }) -})) - -function setup () { - cleanup() - fixture.create(basedir) -} - -function cleanup () { - fixture.remove(basedir) -} - -test('setup', function (t) { - setup() - mr({port: common.port, throwOnUnmatched: true}, function (err, s) { - if (err) throw err - server = s - t.done() - }) -}) - -test('shrinkwrap-lifecycle-cwd', function (t) { - common.npm(['run', 'abc'], conf, function (err, code, stdout, stderr) { - if (err) throw err - t.is(code, 0, 'command ran ok') - t.comment(stdout.trim()) - t.comment(stderr.trim()) - t.match(stdout.trim(), 'OK ' + testdir, 'got output from lifecycle script') - t.is(stderr.trim().length, 0, 'no errors') - t.done() - }) -}) - -test('cleanup', function (t) { - server.close() - cleanup() - t.done() -}) diff --git a/deps/npm/test/tap/shrinkwrap-lifecycle.js b/deps/npm/test/tap/shrinkwrap-lifecycle.js deleted file mode 100644 index 6e6bc4c2872b2a..00000000000000 --- a/deps/npm/test/tap/shrinkwrap-lifecycle.js +++ /dev/null @@ -1,37 +0,0 @@ -var fs = require('graceful-fs') -var path = require('path') -var test = require('tap').test -var common = require('../common-tap.js') -var pkg = common.pkg - -test('npm shrinkwrap execution order', function (t) { - fs.writeFileSync(path.resolve(pkg, 'package.json'), JSON.stringify({ - author: 'Simen Bekkhus', - name: 'shrinkwrap-lifecycle', - shrinkwrap: '0.0.0', - description: 'Test for npm shrinkwrap execution order', - scripts: { - preshrinkwrap: 'echo this happens first', - shrinkwrap: 'echo this happens second', - postshrinkwrap: 'echo this happens third' - } - }), 'utf8') - common.npm(['shrinkwrap', '--loglevel=error'], { cwd: pkg }, function (err, code, stdout, stderr) { - if (err) throw err - - t.comment(stdout) - t.comment(stderr) - var indexOfFirst = stdout.indexOf('echo this happens first') - var indexOfSecond = stdout.indexOf('echo this happens second') - var indexOfThird = stdout.indexOf('echo this happens third') - - t.ok(indexOfFirst >= 0) - t.ok(indexOfSecond >= 0) - t.ok(indexOfThird >= 0) - - t.ok(indexOfFirst < indexOfSecond) - t.ok(indexOfSecond < indexOfThird) - - t.end() - }) -}) diff --git a/deps/npm/test/tap/shrinkwrap-local-dependency.js b/deps/npm/test/tap/shrinkwrap-local-dependency.js deleted file mode 100644 index 5e6d278d30c251..00000000000000 --- a/deps/npm/test/tap/shrinkwrap-local-dependency.js +++ /dev/null @@ -1,124 +0,0 @@ -var test = require('tap').test -var path = require('path') -var fs = require('fs') -var rimraf = require('rimraf') -var common = require('../common-tap.js') -var Tacks = require('tacks') -var unixFormatPath = require('../../lib/utils/unix-format-path.js') -var File = Tacks.File -var Dir = Tacks.Dir - -var testdir = common.pkg -var cachedir = common.cache -var config = ['--cache=' + cachedir, '--loglevel=error'] - -var shrinkwrap = { - name: 'shrinkwrap-local-dependency', - version: '1.0.0', - dependencies: { - mod2: { - version: 'file:' + unixFormatPath(path.join('mods', 'mod2')), - dependencies: { - mod1: { - version: 'file:' + unixFormatPath(path.join('mods', 'mod1')) - } - } - } - } -} - -var fixture = new Tacks( - Dir({ - cache: Dir(), - mods: Dir({ - mod1: Dir({ - 'package.json': File({ - name: 'mod1', - version: '1.0.0' - }) - }), - mod2: Dir({ - 'package.json': File({ - name: 'mod2', - version: '1.0.0', - dependencies: { - mod1: 'file:' + path.join('..', 'mod1') - } - }) - }) - }), - 'package.json': File({ - name: 'shrinkwrap-local-dependency', - version: '1.0.0', - dependencies: { - mod2: 'file:' + path.join('mods', 'mod2') - } - }) - }) -) - -function setup () { - cleanup() - fixture.create(testdir) -} - -function cleanNodeModules () { - rimraf.sync(path.resolve(testdir, 'node_modules')) -} - -function cleanup () { - fixture.remove(testdir) -} - -test('shrinkwrap uses resolved with file: on local deps', function (t) { - setup() - - common.npm(config.concat(['install', '--legacy']), {cwd: testdir}, function (err, code, stdout, stderr) { - if (err) throw err - t.comment(stdout.trim()) - t.comment(stderr.trim()) - t.equal(code, 0, 'npm exited normally') - - common.npm(config.concat('shrinkwrap'), {cwd: testdir}, function (err, code, stdout, stderr) { - if (err) throw err - t.comment(stdout.trim()) - t.comment(stderr.trim()) - t.equal(code, 0, 'npm exited normally') - var data = fs.readFileSync(path.join(testdir, 'npm-shrinkwrap.json'), { encoding: 'utf8' }) - t.like( - JSON.parse(data).dependencies, - shrinkwrap.dependencies, - 'shrinkwrap looks correct' - ) - t.end() - }) - }) -}) - -function exists (file) { - try { - fs.statSync(file) - return true - } catch (ex) { - return false - } -} - -test("'npm install' should install local packages from shrinkwrap", function (t) { - cleanNodeModules() - - common.npm(config.concat(['install']), {cwd: testdir}, function (err, code, stdout, stderr) { - if (err) throw err - t.comment(stdout.trim()) - t.comment(stderr.trim()) - t.equal(code, 0, 'npm exited normally') - t.ok(exists(path.join(testdir, 'node_modules', 'mod2')), 'mod2 exists') - t.ok(exists(path.join(testdir, 'node_modules', 'mod2', 'node_modules', 'mod1')), 'mod1 exists') - t.end() - }) -}) - -test('cleanup', function (t) { - cleanup() - t.end() -}) diff --git a/deps/npm/test/tap/shrinkwrap-nested.js b/deps/npm/test/tap/shrinkwrap-nested.js deleted file mode 100644 index bace44d01aa422..00000000000000 --- a/deps/npm/test/tap/shrinkwrap-nested.js +++ /dev/null @@ -1,165 +0,0 @@ -'use strict' -var test = require('tap').test -var Bluebird = require('bluebird') -var Tacks = require('tacks') -var File = Tacks.File -var Dir = Tacks.Dir -var fs = require('fs') -var path = require('path') -var common = require('../common-tap.js') - -var testdir = common.pkg -var modAtgz = path.resolve(testdir, 'modA') + '-1.0.0.tgz' -var modB1tgz = path.resolve(testdir, 'modB') + '-1.0.0.tgz' -var modB2tgz = path.resolve(testdir, 'modB') + '-2.0.0.tgz' -var modCtgz = path.resolve(testdir, 'modC') + '-1.0.0.tgz' - -var fixture = new Tacks(Dir({ - 'package.json': File({ - dependencies: { - modA: 'file://' + modAtgz, - modC: 'file://' + modCtgz - } - }), - 'npm-shrinkwrap.json': File({ - dependencies: { - modA: { - version: '1.0.0', - resolved: 'file://' + modAtgz - }, - modB: { - version: '1.0.0', - resolved: 'file://' + modB1tgz - } - } - }), - 'modA': Dir({ - 'package.json': File({ - name: 'modA', - version: '1.0.0', - dependencies: { - 'modB': 'file://' + modB1tgz - } - }) - }), - 'modB@1': Dir({ - 'package.json': File({ - name: 'modB', - version: '1.0.0' - }), - 'B1': File('') - }), - 'modB@2': Dir({ - 'package.json': File({ - name: 'modB', - version: '2.0.0' - }), - 'B2': File('') - }), - 'modC': Dir({ - 'package.json': File({ - name: 'modC', - version: '1.0.0', - dependencies: { - 'modB': 'file://' + modB2tgz - } - }) - }) -})) - -var newShrinkwrap = new Tacks(Dir({ - 'npm-shrinkwrap.json': File({ - dependencies: { - modA: { - version: '1.0.0', - resolved: 'file://' + modAtgz - }, - modB: { - version: '1.0.0', - resolved: 'file://' + modB1tgz - }, - modC: { - version: '1.0.0', - resolved: 'file://' + modCtgz, - dependencies: { - modB: { - version: '1.0.0', - resolved: 'file://' + modB1tgz - } - } - } - } - }), - 'node_modules': Dir({ - 'modB@1': Dir({ - 'package.json': File({ - _requested: { - name: 'modB', - raw: 'modB@file:' + modB1tgz, - rawSpec: 'file:' + modB1tgz, - scope: null, - spec: modB1tgz, - type: 'directory' - }, - dependencies: { }, - devDependencies: { }, - name: 'modB', - optionalDependencies: { }, - readme: 'ERROR: No README data found!', - version: '1.0.0' - }) - }) - }) -})) - -function setup () { - fixture.create(testdir) -} - -function cleanup () { - fixture.remove(testdir) -} - -test('setup', function (t) { - cleanup() - setup() - return Bluebird.try(() => { - return Bluebird.join( - common.npm(['pack', 'file:modB@1'], {cwd: testdir, stdio: [0, 2, 2]}), - common.npm(['pack', 'file:modB@2'], {cwd: testdir, stdio: [0, 2, 2]}), - function (b1, b2) { - t.is(b1[0], 0, 'pack modB@1') - t.is(b2[0], 0, 'pack modB@2') - }) - }).then(() => { - return Bluebird.join( - common.npm(['pack', 'file:modA'], {cwd: testdir, stdio: [0, 2, 2]}), - common.npm(['pack', 'file:modC'], {cwd: testdir, stdio: [0, 2, 2]}), - function (a, c) { - t.is(a[0], 0, 'pack modA') - t.is(c[0], 0, 'pack modC') - }) - }).then(() => { - return common.npm(['install'], {cwd: testdir, stdio: [0, 2, 2]}) - }).spread((code) => { - t.is(code, 0, 'top level install') - t.end() - }) -}) - -test('incremental install', function (t) { - newShrinkwrap.create(testdir) - common.npm(['install'], {cwd: testdir, stdio: [0, 2, 2]}, function (err, code) { - if (err) throw err - t.is(code, 0, 'npm itself completed ok') - fs.stat(path.join(testdir, 'node_modules', 'modC', 'node_modules', 'modB', 'B1'), function (missing) { - t.ok(!missing, 'modC got the updated version of modB') - t.end() - }) - }) -}) - -test('cleanup', function (t) { - cleanup() - t.end() -}) diff --git a/deps/npm/test/tap/shrinkwrap-optional-dependency.js b/deps/npm/test/tap/shrinkwrap-optional-dependency.js deleted file mode 100644 index a08d1538490db9..00000000000000 --- a/deps/npm/test/tap/shrinkwrap-optional-dependency.js +++ /dev/null @@ -1,91 +0,0 @@ -var fs = require('fs') -var path = require('path') - -var mkdirp = require('mkdirp') -var mr = require('npm-registry-mock') -var test = require('tap').test - -var common = require('../common-tap.js') -var npm = require('../../') - -var pkg = common.pkg - -test('shrinkwrap does not fail on missing optional dependency', function (t) { - t.plan(1) - - var mocks = { - get: { - '/random-package': [404, {}] - } - } - - mr({port: common.port, mocks: mocks}, function (er, s) { - t.parent.teardown(() => s.close()) - setup(function (err) { - if (err) { - throw err - } - - // Install without the optional dependency - npm.install('.', function (err) { - if (err) { - throw err - } - - // Pretend the optional dependency was specified, but somehow failed to load: - json.optionalDependencies = { - 'random-package': '0.0.0' - } - writePackage() - - npm.commands.shrinkwrap([], true, function (err, results) { - if (err) { - throw err - } - - t.deepEqual(results.dependencies, desired.dependencies) - s.close() - t.end() - }) - }) - }) - }) -}) - -var desired = { - name: 'npm-test-shrinkwrap-optional-dependency', - version: '0.0.0', - dependencies: { - 'test-package': { - version: '0.0.0', - resolved: common.registry + '/test-package/-/test-package-0.0.0.tgz', - integrity: 'sha1-sNMrbEXCWcV4uiADdisgUTG9+9E=' - } - } -} - -var json = { - author: 'Maximilian Antoni', - name: 'npm-test-shrinkwrap-optional-dependency', - version: '0.0.0', - dependencies: { - 'test-package': '0.0.0' - } -} - -function writePackage () { - fs.writeFileSync(path.join(pkg, 'package.json'), JSON.stringify(json, null, 2)) -} - -function setup (cb) { - mkdirp.sync(pkg) - writePackage() - process.chdir(pkg) - - var opts = { - cache: common.cache, - registry: common.registry, - cwd: pkg - } - npm.load(opts, cb) -} diff --git a/deps/npm/test/tap/shrinkwrap-optional-platform.js b/deps/npm/test/tap/shrinkwrap-optional-platform.js deleted file mode 100644 index f5b87d2f8d445c..00000000000000 --- a/deps/npm/test/tap/shrinkwrap-optional-platform.js +++ /dev/null @@ -1,107 +0,0 @@ -'use strict' -var path = require('path') -var test = require('tap').test -var Tacks = require('tacks') -var File = Tacks.File -var Dir = Tacks.Dir -var common = require('../common-tap.js') - -var basedir = common.pkg -var testdir = path.join(basedir, 'testdir') -var cachedir = common.cache -var globaldir = path.join(basedir, 'global') -var tmpdir = path.join(basedir, 'tmp') - -var conf = { - cwd: testdir, - env: Object.assign({}, process.env, { - npm_config_cache: cachedir, - npm_config_tmp: tmpdir, - npm_config_prefix: globaldir, - npm_config_registry: common.registry, - npm_config_loglevel: 'warn' - }) -} - -var fixture = new Tacks(Dir({ - cache: Dir(), - global: Dir(), - tmp: Dir(), - testdir: Dir({ - mod1: Dir({ - 'package.json': File({ - name: 'mod1', - version: '1.0.0', - scripts: {}, - 'optionalDependencies': { - 'mod2': 'file:../mod2' - }, - os: ['nosuchos'] - }) - }), - mod2: Dir({ - 'package.json': File({ - name: 'mod2', - version: '1.0.0', - scripts: {}, - os: ['nosuchos'] - }) - }), - 'npm-shrinkwrap.json': File({ - name: 'shrinkwrap-optional-platform', - version: '1.0.0', - dependencies: { - mod1: { - version: '1.0.0', - resolved: 'file:mod1', - optional: true - }, - mod2: { - version: '1.0.0', - resolved: 'file:mod2', - optional: true - } - } - }), - 'package.json': File({ - name: 'shrinkwrap-optional-platform', - version: '1.0.0', - optionalDependencies: { - mod1: 'file:mod1' - }, - description: 'x', - repository: 'x', - license: 'Artistic-2.0' - }) - }) -})) - -function setup () { - cleanup() - fixture.create(basedir) -} - -function cleanup () { - fixture.remove(basedir) -} - -test('setup', function (t) { - setup() - t.done() -}) - -test('example', function (t) { - common.npm(['install'], conf, function (err, code, stdout, stderr) { - if (err) throw err - t.is(code, 0, 'install ran ok') - t.comment(stdout.trim()) - t.comment(stderr.trim()) - t.notMatch(stderr, /Exit status 1/, 'did not try to install opt dep') - t.done() - }) -}) - -test('cleanup', function (t) { - cleanup() - t.done() -}) diff --git a/deps/npm/test/tap/shrinkwrap-optional-property.js b/deps/npm/test/tap/shrinkwrap-optional-property.js deleted file mode 100644 index c2dc8585aec1cf..00000000000000 --- a/deps/npm/test/tap/shrinkwrap-optional-property.js +++ /dev/null @@ -1,87 +0,0 @@ -var fs = require('fs') -var path = require('path') - -var mr = require('npm-registry-mock') -var test = require('tap').test - -var common = require('../common-tap.js') -var npm = require('../../') - -var pkg = common.pkg - -test('shrinkwrap adds optional property when optional dependency', function (t) { - t.plan(1) - - mr({port: common.port}, function (er, s) { - t.parent.teardown(() => s.close()) - setup(function (err) { - if (err) { - throw err - } - - // Install with the optional dependency - npm.install('.', function (err) { - if (err) { - throw err - } - - writePackage() - - npm.commands.shrinkwrap([], true, function (err, results) { - if (err) { - throw err - } - - t.deepEqual(results.dependencies, desired.dependencies) - s.close() - t.end() - }) - }) - }) - }) -}) - -var desired = { - name: 'npm-test-shrinkwrap-optional-dependency', - version: '0.0.0', - dependencies: { - 'test-package': { - version: '0.0.0', - resolved: common.registry + '/test-package/-/test-package-0.0.0.tgz', - integrity: 'sha1-sNMrbEXCWcV4uiADdisgUTG9+9E=' - }, - 'underscore': { - version: '1.3.3', - resolved: 'http://localhost:' + common.port + '/underscore/-/underscore-1.3.3.tgz', - optional: true, - integrity: 'sha1-R6xTaD2vgyv6lS4XdEF9pHgXrkI=' - } - } -} - -var json = { - author: 'Maximilian Antoni', - name: 'npm-test-shrinkwrap-optional-dependency', - version: '0.0.0', - dependencies: { - 'test-package': '0.0.0' - }, - optionalDependencies: { - 'underscore': '1.3.3' - } -} - -function writePackage () { - fs.writeFileSync(path.join(pkg, 'package.json'), JSON.stringify(json, null, 2)) -} - -function setup (cb) { - writePackage() - process.chdir(pkg) - - var opts = { - cache: common.cache, - registry: common.registry - } - npm.load(opts, cb) -} diff --git a/deps/npm/test/tap/shrinkwrap-prod-dependency-also.js b/deps/npm/test/tap/shrinkwrap-prod-dependency-also.js deleted file mode 100644 index 1e4e9d7438a2c8..00000000000000 --- a/deps/npm/test/tap/shrinkwrap-prod-dependency-also.js +++ /dev/null @@ -1,85 +0,0 @@ -var fs = require('fs') -var path = require('path') - -var mr = require('npm-registry-mock') -var test = require('tap').test - -var common = require('../common-tap.js') -var pkg = common.pkg -var opts = [ - '--cache=' + common.cache, - '--registry=' + common.registry -] - -function reportOutput (t, fh, out) { - var trimmed = out.trim() - if (!trimmed.length) return - var prefix = fh + '> ' - t.comment(prefix + trimmed.split(/\n/).join('\n' + prefix)) -} - -var desired = { - name: 'npm-test-shrinkwrap-prod-dependency', - version: '0.0.0', - dependencies: { - request: { - version: '0.9.0', - resolved: common.registry + '/request/-/request-0.9.0.tgz', - integrity: 'sha1-EEn1mm9GWI5tAwkh+7hMovDCcU4=' - }, - underscore: { - dev: true, - version: '1.5.1', - resolved: common.registry + '/underscore/-/underscore-1.5.1.tgz', - integrity: 'sha1-0r3oF9F2/63olKtxRY5oKhS4bck=' - } - } -} - -var json = { - author: 'Domenic Denicola', - name: 'npm-test-shrinkwrap-prod-dependency', - version: '0.0.0', - dependencies: { - request: '0.9.0' - }, - devDependencies: { - underscore: '1.5.1' - } -} - -test("shrinkwrap --also=development doesn't strip out prod dependencies", function (t) { - t.plan(4) - - mr({port: common.port}, function (er, s) { - t.parent.teardown(() => s.close()) - fs.writeFileSync(path.join(pkg, 'package.json'), JSON.stringify(json, null, 2)) - common.npm(['install', '.'].concat(opts), {cwd: pkg}, function (err, code, stdout, stderr) { - if (err) return t.fail(err) - t.is(code, 0, 'install') - reportOutput(t, 'out', stdout) - reportOutput(t, 'err', stderr) - common.npm(['shrinkwrap', '--also=development'].concat(opts), {cwd: pkg}, function (err, code, stdout, stderr) { - if (err) return t.fail(err) - var ok = t.is(code, 0, 'shrinkwrap') - reportOutput(t, 'out', stdout) - reportOutput(t, 'err', stderr) - if (ok) { - try { - var results = JSON.parse(fs.readFileSync(path.join(pkg, 'npm-shrinkwrap.json'))) - t.pass('read shrinkwrap') - } catch (ex) { - t.ifError(ex, 'read shrinkwrap') - } - } - t.deepEqual( - results.dependencies, - desired.dependencies, - 'results have dev dep' - ) - s.done() - t.end() - }) - }) - }) -}) diff --git a/deps/npm/test/tap/shrinkwrap-prod-dependency.js b/deps/npm/test/tap/shrinkwrap-prod-dependency.js deleted file mode 100644 index bf6d98bf801521..00000000000000 --- a/deps/npm/test/tap/shrinkwrap-prod-dependency.js +++ /dev/null @@ -1,76 +0,0 @@ -var fs = require('fs') -var path = require('path') - -var mkdirp = require('mkdirp') -var mr = require('npm-registry-mock') -var test = require('tap').test - -var npm = require('../../') - -var common = require('../common-tap.js') -var pkg = common.pkg - -var desired = { - name: 'npm-test-shrinkwrap-prod-dependency', - version: '0.0.0', - dependencies: { - request: { - version: '0.9.0', - resolved: common.registry + '/request/-/request-0.9.0.tgz', - integrity: 'sha1-EEn1mm9GWI5tAwkh+7hMovDCcU4=' - }, - underscore: { - dev: true, - version: '1.5.1', - resolved: common.registry + '/underscore/-/underscore-1.5.1.tgz', - integrity: 'sha1-0r3oF9F2/63olKtxRY5oKhS4bck=' - } - } -} - -var json = { - author: 'Domenic Denicola', - name: 'npm-test-shrinkwrap-prod-dependency', - version: '0.0.0', - dependencies: { - request: '0.9.0' - }, - devDependencies: { - underscore: '1.5.1' - } -} - -test('setup', function (t) { - mkdirp.sync(pkg) - fs.writeFileSync(path.join(pkg, 'package.json'), JSON.stringify(json, null, 2)) - process.chdir(pkg) - - var allOpts = { - cache: common.cache, - registry: common.registry - } - - npm.load(allOpts, t.end) -}) - -test('mock registry', t => { - mr({port: common.port}, function (er, s) { - t.parent.teardown(() => s.close()) - t.end() - }) -}) - -test("shrinkwrap --dev doesn't strip out prod dependencies", t => { - t.plan(1) - npm.install('.', function (err) { - if (err) return t.fail(err) - - npm.config.set('dev', true) - npm.commands.shrinkwrap([], true, function (err, results) { - if (err) return t.fail(err) - - t.deepEqual(results.dependencies, desired.dependencies) - t.end() - }) - }) -}) diff --git a/deps/npm/test/tap/shrinkwrap-resolve-conflict.js b/deps/npm/test/tap/shrinkwrap-resolve-conflict.js deleted file mode 100644 index d1f63f7e62661f..00000000000000 --- a/deps/npm/test/tap/shrinkwrap-resolve-conflict.js +++ /dev/null @@ -1,117 +0,0 @@ -'use strict' - -const BB = require('bluebird') - -const common = require('../common-tap.js') -const fs = BB.promisifyAll(require('fs')) -const path = require('path') -const rimraf = BB.promisify(require('rimraf')) -const test = require('tap').test -const Tacks = require('tacks') - -const File = Tacks.File -const Dir = Tacks.Dir - -const testDir = common.pkg -const modAdir = path.resolve(testDir, 'modA') -const modBdir = path.resolve(testDir, 'modB') -const modCdir = path.resolve(testDir, 'modC') - -test('conflicts in shrinkwrap are auto-resolved on install', (t) => { - const fixture = new Tacks(Dir({ - 'package.json': File({ - name: 'foo', - dependencies: { - modA: 'file://' + modAdir, - modB: 'file://' + modBdir - }, - devDependencies: { - modC: 'file://' + modCdir - } - }), - 'npm-shrinkwrap.json': File( - ` -{ - "name": "foo", - "requires": true, - "lockfileVersion": 1, - "dependencies": { -<<` + `<<` + `<<` + `< HEAD - "modA": { - "version": "file:modA" -||` + `||` + `||` + `| merged common ancestors - "modB": { - "version": "file:modB" -==` + `==` + `==` + `= - "modC": { - "version": "file:modC", - "dev": true ->>` + `>>` + `>>` + `> branch - } - } -} -`), - 'modA': Dir({ - 'package.json': File({ - name: 'modA', - version: '1.0.0' - }) - }), - 'modB': Dir({ - 'package.json': File({ - name: 'modB', - version: '1.0.0' - }) - }), - 'modC': Dir({ - 'package.json': File({ - name: 'modC', - version: '1.0.0' - }) - }) - })) - fixture.create(testDir) - function readJson (file) { - return fs.readFileAsync(path.join(testDir, file)).then(JSON.parse) - } - return BB.fromNode((cb) => { - common.npm([ - 'install', - '--loglevel', 'warn' - ], {cwd: testDir}, (err, code, out, stderr) => { - t.comment(stderr) - t.match(stderr, /warn.*conflict/gi, 'warns about a conflict') - cb(err || (code && new Error('non-zero exit code')) || null, out) - }) - }) - .then(() => BB.join( - readJson('npm-shrinkwrap.json'), - readJson('node_modules/modA/package.json'), - readJson('node_modules/modB/package.json'), - readJson('node_modules/modC/package.json'), - (lockfile, A, B, C) => { - t.deepEqual(lockfile, { - name: 'foo', - requires: true, - lockfileVersion: 1, - dependencies: { - modA: { - version: 'file:modA' - }, - modB: { - version: 'file:modB' - }, - modC: { - version: 'file:modC', - dev: true - } - } - }, 'resolved lockfile matches expectations') - t.equal(A.name, 'modA', 'installed modA') - t.equal(B.name, 'modB', 'installed modB') - t.equal(C.name, 'modC', 'installed modC') - } - )) -}) - -test('cleanup', () => rimraf(testDir)) diff --git a/deps/npm/test/tap/shrinkwrap-save-dev-with-existing-deps.js b/deps/npm/test/tap/shrinkwrap-save-dev-with-existing-deps.js deleted file mode 100644 index 1c35bf226b9136..00000000000000 --- a/deps/npm/test/tap/shrinkwrap-save-dev-with-existing-deps.js +++ /dev/null @@ -1,92 +0,0 @@ -/* eslint-disable camelcase */ -var fs = require('fs') -var path = require('path') -var mkdirp = require('mkdirp') -var test = require('tap').test -var common = require('../common-tap.js') - -var base = common.pkg -var installme = path.join(base, 'installme') -var installme_pkg = path.join(installme, 'package.json') -var example = path.join(base, 'example') -var example_shrinkwrap = path.join(example, 'npm-shrinkwrap.json') -var example_pkg = path.join(example, 'package.json') -var installed_prod = path.join(example, 'node_modules', 'installed-prod') -var installed_prod_pkg = path.join(installed_prod, 'package.json') -var installed_dev = path.join(example, 'node_modules', 'installed-dev') -var installed_dev_pkg = path.join(installed_dev, 'package.json') - -var EXEC_OPTS = { cwd: example } - -var installme_pkg_json = { - name: 'installme', - version: '1.0.0', - dependencies: {} -} - -var example_pkg_json = { - name: 'example', - version: '1.0.0', - dependencies: { - 'installed-prod': '1.0' - }, - devDependencies: { - 'installed-dev': '1.0' - } -} - -var example_shrinkwrap_json = { - name: 'example', - version: '1.0.0', - dependencies: { - 'installed-prod': { - version: '1.0.0' - }, - 'installed-dev': { - version: '1.0.0' - } - } -} - -var installed_prod_pkg_json = { - _id: 'installed-prod@1.0.0', - _integrity: 'sha1-deadbeef', - _resolved: 'foo', - name: 'installed-prod', - version: '1.0.0' -} - -var installed_dev_pkg_json = { - _id: 'installed-dev@1.0.0', - _integrity: 'sha1-deadbeef', - _resolved: 'foo', - name: 'installed-dev', - version: '1.0.0' -} - -function writeJson (filename, obj) { - mkdirp.sync(path.dirname(filename)) - fs.writeFileSync(filename, JSON.stringify(obj, null, 2)) -} - -test('setup', function (t) { - writeJson(installme_pkg, installme_pkg_json) - writeJson(example_pkg, example_pkg_json) - writeJson(example_shrinkwrap, example_shrinkwrap_json) - writeJson(installed_prod_pkg, installed_prod_pkg_json) - writeJson(installed_dev_pkg, installed_dev_pkg_json) - t.end() -}) - -test('install --save-dev leaves prod deps alone', function (t) { - common.npm(['install', '--save-dev', 'file://' + installme], EXEC_OPTS, function (er, code, stdout, stderr) { - t.ifError(er, "spawn didn't catch fire") - t.is(code, 0, 'install completed ok') - t.is(stderr, '', 'install completed without error output') - var shrinkwrap = JSON.parse(fs.readFileSync(example_shrinkwrap)) - t.ok(shrinkwrap.dependencies['installed-prod'], "save-dev new install didn't remove prod dep") - t.ok(shrinkwrap.dependencies['installed-dev'], "save-dev new install didn't remove dev dep") - t.ok(shrinkwrap.dependencies.installme, 'save-dev new install DID add new dev dep') - t.end() - }) -}) diff --git a/deps/npm/test/tap/shrinkwrap-save-with-existing-dev-deps.js b/deps/npm/test/tap/shrinkwrap-save-with-existing-dev-deps.js deleted file mode 100644 index acf6ac21014d15..00000000000000 --- a/deps/npm/test/tap/shrinkwrap-save-with-existing-dev-deps.js +++ /dev/null @@ -1,79 +0,0 @@ -/* eslint-disable camelcase */ -var fs = require('fs') -var path = require('path') - -var mkdirp = require('mkdirp') -var test = require('tap').test - -var common = require('../common-tap.js') - -var base = common.pkg -var installme = path.join(base, 'installme') -var installme_pkg = path.join(installme, 'package.json') -var example = path.join(base, 'example') -var example_shrinkwrap = path.join(example, 'npm-shrinkwrap.json') -var example_pkg = path.join(example, 'package.json') -var installed = path.join(example, 'node_modules', 'installed') -var installed_pkg = path.join(installed, 'package.json') - -// Ignore max listeners warnings until that gets fixed -var env = Object.keys(process.env).reduce((set, key) => { - if (!set[key]) set[key] = process.env[key] - return set -}, { NODE_NO_WARNINGS: '1' }) - -var EXEC_OPTS = { cwd: example, env: env } - -var installme_pkg_json = { - name: 'installme', - version: '1.0.0', - dependencies: {} -} - -var example_pkg_json = { - name: 'example', - version: '1.0.0', - dependencies: {}, - devDependencies: { - 'installed': '1.0' - } -} - -var example_shrinkwrap_json = { - name: 'example', - version: '1.0.0', - dependencies: { - installed: { - version: '1.0.0' - } - } -} - -var installed_pkg_json = { - _id: 'installed@1.0.0', - name: 'installed', - version: '1.0.0' -} - -function writeJson (filename, obj) { - mkdirp.sync(path.dirname(filename)) - fs.writeFileSync(filename, JSON.stringify(obj, null, 2)) -} - -test('setup', function (t) { - writeJson(installme_pkg, installme_pkg_json) - writeJson(example_pkg, example_pkg_json) - writeJson(example_shrinkwrap, example_shrinkwrap_json) - writeJson(installed_pkg, installed_pkg_json) - t.end() -}) - -test('install --save leaves dev deps alone', t => - common.npm(['install', '--save', 'file://' + installme], EXEC_OPTS) - .then(([code, stdout, stderr]) => { - t.is(code, 0, 'install completed ok') - t.is(stderr, '', 'install completed without error output') - var shrinkwrap = JSON.parse(fs.readFileSync(example_shrinkwrap)) - t.ok(shrinkwrap.dependencies.installed, "save new install didn't remove dev dep") - t.ok(shrinkwrap.dependencies.installme, 'save new install DID add new dep') - })) diff --git a/deps/npm/test/tap/shrinkwrap-scoped-auth.js b/deps/npm/test/tap/shrinkwrap-scoped-auth.js deleted file mode 100644 index cc1b2270012ec6..00000000000000 --- a/deps/npm/test/tap/shrinkwrap-scoped-auth.js +++ /dev/null @@ -1,96 +0,0 @@ -'use strict' - -var fs = require('fs') -var path = require('path') -var writeFileSync = require('graceful-fs').writeFileSync - -var mkdirp = require('mkdirp') -var mr = require('npm-registry-mock') -var ssri = require('ssri') -var test = require('tap').test - -var common = require('../common-tap.js') -var toNerfDart = require('../../lib/config/nerf-dart.js') - -var pkg = common.pkg -var outfile = path.resolve(pkg, '_npmrc') -var modules = path.resolve(pkg, 'node_modules') -var tarballPath = '/scoped-underscore/-/scoped-underscore-1.3.1.tgz' -var tarballURL = common.registry + tarballPath -var tarball = path.resolve(__dirname, '../fixtures/scoped-underscore-1.3.1.tgz') -var tarballIntegrity = ssri.fromData(fs.readFileSync(tarball)).toString() - -function mocks (server) { - var auth = 'Bearer 0xabad1dea' - server.get(tarballPath, { authorization: auth }).replyWithFile(200, tarball) - server.get(tarballPath).reply(401, { - error: 'unauthorized', - reason: 'You are not authorized to access this db.' - }) -} - -var contents = '@scoped:registry=' + common.registry + '\n' + - toNerfDart(common.registry) + ':_authToken=0xabad1dea\n' - -var json = { - name: 'test-package-install', - version: '1.0.0', - dependencies: { - '@scoped/underscore': '1.0.0' - } -} - -var shrinkwrap = { - name: 'test-package-install', - version: '1.0.0', - lockfileVersion: 1, - dependencies: { - '@scoped/underscore': { - resolved: tarballURL, - integrity: tarballIntegrity, - version: '1.3.1' - } - } -} - -test('setup', function (t) { - mkdirp.sync(modules) - writeFileSync(path.resolve(pkg, 'package.json'), JSON.stringify(json, null, 2) + '\n') - writeFileSync(outfile, contents) - writeFileSync( - path.resolve(pkg, 'npm-shrinkwrap.json'), - JSON.stringify(shrinkwrap, null, 2) + '\n' - ) - mr({ port: common.port, plugin: mocks }, function (er, s) { - t.parent.teardown(() => s.close()) - t.ok(s, 'set up mock registry') - t.end() - }) -}) - -test('authed npm install with shrinkwrapped scoped package', function (t) { - common.npm( - [ - 'install', - '--loglevel', 'error', - '--json', - '--fetch-retries', 0, - '--userconfig', outfile, - '--registry', common.registry - ], - {cwd: pkg, stdio: [0, 'pipe', 2]}, - function (err, code, stdout) { - if (err) throw err - t.equal(code, 0, 'npm install exited OK') - try { - var results = JSON.parse(stdout) - t.match(results, {added: [{name: '@scoped/underscore', version: '1.3.1'}]}, '@scoped/underscore installed') - } catch (ex) { - console.error('#', ex) - t.ifError(ex, 'stdout was valid JSON') - } - - t.end() - } - ) -}) diff --git a/deps/npm/test/tap/shrinkwrap-shared-dev-dependency.js b/deps/npm/test/tap/shrinkwrap-shared-dev-dependency.js deleted file mode 100644 index 5aa331f34cc463..00000000000000 --- a/deps/npm/test/tap/shrinkwrap-shared-dev-dependency.js +++ /dev/null @@ -1,89 +0,0 @@ -var fs = require('fs') -var path = require('path') - -var mkdirp = require('mkdirp') -var mr = require('npm-registry-mock') -var rimraf = require('rimraf') -var test = require('tap').test - -var common = require('../common-tap.js') - -var pkg = common.pkg - -var opts = { - env: common.newEnv().extend({ - npm_config_cache: common.cache, - npm_config_registry: common.registry - }), - stdio: [0, 1, 2], - cwd: pkg -} - -var json = { - author: 'Domenic Denicola', - name: 'npm-test-shrinkwrap-shared-dev-dependency', - version: '0.0.0', - dependencies: { - 'test-package-with-one-dep': '0.0.0' - }, - devDependencies: { - 'test-package': '0.0.0' - } -} - -var server -test('setup', function (t) { - setup() - mr({ port: common.port }, function (er, s) { - if (er) throw er - server = s - t.done() - }) -}) - -var desired = { - name: 'npm-test-shrinkwrap-shared-dev-dependency', - version: '0.0.0', - dependencies: { - 'test-package-with-one-dep': { - version: '0.0.0', - resolved: common.registry + '/test-package-with-one-dep/-/test-package-with-one-dep-0.0.0.tgz', - integrity: 'sha1-JWwVltusKyPRImjatagCuy42Wsg=' - }, - 'test-package': { - version: '0.0.0', - resolved: common.registry + '/test-package/-/test-package-0.0.0.tgz', - integrity: 'sha1-sNMrbEXCWcV4uiADdisgUTG9+9E=' - } - } -} - -test("shrinkwrap doesn't strip out the shared dependency", function (t) { - t.plan(3) - - return common.npm(['install'], opts).spread((code) => { - t.is(code, 0, 'install') - return common.npm(['shrinkwrap'], opts) - }).spread((code) => { - t.is(code, 0, 'shrinkwrap') - var results = JSON.parse(fs.readFileSync(`${pkg}/npm-shrinkwrap.json`)) - t.like(results.dependencies, desired.dependencies) - t.end() - }) -}) - -test('cleanup', function (t) { - server.close() - cleanup() - t.end() -}) - -function setup () { - cleanup() - mkdirp.sync(pkg) - fs.writeFileSync(path.join(pkg, 'package.json'), JSON.stringify(json, null, 2)) -} - -function cleanup () { - rimraf.sync(pkg) -} diff --git a/deps/npm/test/tap/shrinkwrap-version-match.js b/deps/npm/test/tap/shrinkwrap-version-match.js deleted file mode 100644 index e579f84d4b3bd4..00000000000000 --- a/deps/npm/test/tap/shrinkwrap-version-match.js +++ /dev/null @@ -1,115 +0,0 @@ -'use strict' -var test = require('tap').test -var Tacks = require('tacks') -var File = Tacks.File -var Dir = Tacks.Dir -var fs = require('fs') -var path = require('path') -var common = require('../common-tap.js') - -var testdir = common.pkg -var modAdir = path.resolve(testdir, 'modA') -var modB1dir = path.resolve(testdir, 'modB@1') -var modB2dir = path.resolve(testdir, 'modB@2') -var modCdir = path.resolve(testdir, 'modC') - -var fixture = new Tacks(Dir({ - 'package.json': File({ - dependencies: { - modA: 'file://' + modAdir - }, - devDependencies: { - modC: 'file://' + modCdir - } - }), - 'npm-shrinkwrap.json': File({ - requires: true, - lockfileVersion: 1, - dependencies: { - modA: { - version: 'file://' + modAdir, - requires: { - modB: 'file://' + modB1dir - } - }, - modB: { - version: 'file://' + modB1dir - } - } - }), - 'modA': Dir({ - 'package.json': File({ - name: 'modA', - version: '1.0.0', - dependencies: { - 'modB': 'file://' + modB1dir - } - }) - }), - 'modB@1': Dir({ - 'package.json': File({ - name: 'modB', - version: '1.0.0' - }), - 'B1': File('') - }), - 'modB@2': Dir({ - 'package.json': File({ - name: 'modB', - version: '2.0.0' - }), - 'B2': File('') - }), - 'modC': Dir({ - 'package.json': File({ - name: 'modC', - version: '1.0.0', - dependencies: { - 'modB': 'file://' + modB2dir - } - }) - }) -})) - -function setup () { - fixture.create(testdir) -} - -function cleanup () { - fixture.remove(testdir) -} - -test('setup', function (t) { - cleanup() - setup() - t.end() -}) - -// Shrinkwraps need to let you override dependency versions specified in -// package.json files. Indeed, this was already supported, but it was a bit -// to keen on this. Previously, if you had a dep in your shrinkwrap then -// anything that required that dependency would count as a match, regardless -// of version. - -// This test ensures that the broad matching is not done when the matched -// module is not a direct child of the module doing the requiring. - -test('bundled', function (t) { - common.npm(['install'], {cwd: testdir}, function (err, code, out, stderr) { - t.is(err, null, 'No fatal errors running npm') - t.is(code, 0, 'npm itself completed ok') - // Specifically, if B2 exists (or the modB directory under modC at all) - // that means modC was given its own copy of modB. Without the patch - // that went with this test, it wouldn't have been installed because npm - // would have consider modB@1 to have fulfilled modC's requirement. - fs.stat(path.join(testdir, 'node_modules', 'modC', 'node_modules', 'modB', 'B2'), function (missing) { - t.ok(!missing, 'modC got the right version of modB') - t.end() - }) - }) -}) - -test('cleanup', function (t) { - cleanup() - t.end() -}) diff --git a/deps/npm/test/tap/sorted-package-json.js b/deps/npm/test/tap/sorted-package-json.js deleted file mode 100644 index f802bfd9e56058..00000000000000 --- a/deps/npm/test/tap/sorted-package-json.js +++ /dev/null @@ -1,61 +0,0 @@ -var test = require('tap').test -var path = require('path') -var common = require('../common-tap.js') -var pkg = common.pkg -var tmp = path.join(pkg, 'tmp') -var cache = common.cache -var fs = require('fs') -var mr = require('npm-registry-mock') -var packageJson = path.resolve(pkg, 'package.json') - -fs.writeFileSync(packageJson, JSON.stringify({ - 'name': 'sorted-package-json', - 'version': '0.0.0', - 'description': '', - 'main': 'index.js', - 'scripts': { - 'test': 'echo \'Error: no test specified\' && exit 1' - }, - 'author': 'Rocko Artischocko', - 'license': 'ISC', - 'dependencies': { - 'underscore': '^1.3.3', - 'request': '^0.9.0' - } -}, null, 2), 'utf8') - -test('sorting dependencies', function (t) { - var before = JSON.parse(fs.readFileSync(packageJson).toString()) - - mr({ port: common.port }, function (er, s) { - // underscore is already in the package.json, - // but --save will trigger a rewrite with sort - common.npm([ - 'install', - '--save', 'underscore@1.3.3', - '--no-progress', - '--cache', cache, - '--tmp', tmp, - '--registry', common.registry - ], { - cwd: pkg - }, function (err, code, stdout, stderr) { - t.ifError(err, 'no error') - t.equal(code, 0, 'npm install exited with code') - var result = fs.readFileSync(packageJson).toString() - var resultAsJson = JSON.parse(result) - - s.close() - - t.same(Object.keys(resultAsJson.dependencies), - Object.keys(before.dependencies).sort()) - - t.notSame(Object.keys(resultAsJson.dependencies), - Object.keys(before.dependencies)) - - t.ok(resultAsJson.dependencies.underscore) - t.ok(resultAsJson.dependencies.request) - t.end() - }) - }) -}) diff --git a/deps/npm/test/tap/spawn-enoent-help.js b/deps/npm/test/tap/spawn-enoent-help.js deleted file mode 100644 index cb7c942be8e7b1..00000000000000 --- a/deps/npm/test/tap/spawn-enoent-help.js +++ /dev/null @@ -1,35 +0,0 @@ -var test = require('tap').test -var rimraf = require('rimraf') -var mkdirp = require('mkdirp') -var common = require('../common-tap.js') - -var pkg = common.pkg - -common.pendIfWindows('man pages are not built on Windows') - -test('setup', function (t) { - rimraf.sync(pkg) - mkdirp.sync(pkg) - t.end() -}) - -test('enoent help', function (t) { - common.npm(['help', 'config'], { - cwd: pkg, - env: { - PATH: '', - Path: '', - 'npm_config_loglevel': 'warn', - 'npm_config_viewer': 'woman' - } - }, function (er, code, sout, serr) { - t.similar(serr, /Check if the file 'emacsclient' is present./) - t.equal(global.cooked, undefined, "Don't leak into global scope") - t.end() - }) -}) - -test('clean', function (t) { - rimraf.sync(pkg) - t.end() -}) diff --git a/deps/npm/test/tap/spawn-enoent.js b/deps/npm/test/tap/spawn-enoent.js deleted file mode 100644 index 78153572eeb708..00000000000000 --- a/deps/npm/test/tap/spawn-enoent.js +++ /dev/null @@ -1,38 +0,0 @@ -var test = require('tap').test -var fs = require('fs') -var rimraf = require('rimraf') -var mkdirp = require('mkdirp') -var common = require('../common-tap.js') - -var pkg = common.pkg -var pj = JSON.stringify({ - name: 'x', - version: '1.2.3', - scripts: { start: 'wharble-garble-blorst' } -}, null, 2) + '\n' - -test('setup', function (t) { - rimraf.sync(pkg) - mkdirp.sync(pkg) - fs.writeFileSync(pkg + '/package.json', pj) - t.end() -}) - -test('enoent script', function (t) { - common.npm(['start'], { - cwd: pkg, - env: { - PATH: process.env.PATH, - Path: process.env.Path, - 'npm_config_loglevel': 'warn' - } - }, function (er, code, sout, serr) { - t.similar(serr, /npm ERR! Failed at the x@1\.2\.3 start script\./) - t.end() - }) -}) - -test('clean', function (t) { - rimraf.sync(pkg) - t.end() -}) diff --git a/deps/npm/test/tap/spec-local-specifiers.js b/deps/npm/test/tap/spec-local-specifiers.js deleted file mode 100644 index 6ea65278cda261..00000000000000 --- a/deps/npm/test/tap/spec-local-specifiers.js +++ /dev/null @@ -1,752 +0,0 @@ -'use strict' -var path = require('path') -var test = require('tap').test -var fs = require('fs') -var rimraf = require('rimraf') -var mr = require('npm-registry-mock') -var Tacks = require('tacks') -var File = Tacks.File -var Symlink = Tacks.Symlink -var Dir = Tacks.Dir -var common = require('../common-tap.js') -var isWindows = require('../../lib/utils/is-windows.js') - -var basedir = common.pkg -var testdir = path.join(basedir, 'testdir') -var cachedir = common.cache -var globaldir = path.join(basedir, 'global') -var tmpdir = path.join(basedir, 'tmp') - -var conf = { - cwd: testdir, - env: common.emptyEnv().extend({ - npm_config_cache: cachedir, - npm_config_tmp: tmpdir, - npm_config_prefix: globaldir, - npm_config_registry: common.registry, - npm_config_loglevel: 'error' - }), - stdio: [0, 'pipe', 2] -} -var confE = { - cwd: testdir, - env: conf.env, - stdio: [0, 'pipe', 'pipe'] -} - -function readJson (file) { - return JSON.parse(fs.readFileSync(file)) -} - -function isSymlink (t, file, message) { - try { - var info = fs.lstatSync(file) - t.is(info.isSymbolicLink(), true, message) - } catch (ex) { - if (ex.code === 'ENOENT') { - t.fail(message, {found: null, wanted: 'symlink', compare: 'fs.lstat(' + file + ')'}) - } else { - t.fail(message, {found: ex, wanted: 'symlink', compare: 'fs.lstat(' + file + ')'}) - } - } -} - -function fileExists (t, file, message) { - try { - fs.statSync(file) - t.pass(message) - } catch (ex) { - if (ex.code === 'ENOENT') { - t.fail(message, {found: null, wanted: 'exists', compare: 'fs.stat(' + file + ')'}) - } else { - t.fail(message, {found: ex, wanted: 'exists', compare: 'fs.stat(' + file + ')'}) - } - } -} - -function noFileExists (t, file, message) { - try { - fs.statSync(file) - t.fail(message, {found: 'exists', wanted: 'not exists', compare: 'fs.stat(' + file + ')'}) - } catch (ex) { - if (ex.code === 'ENOENT') { - t.pass(message) - } else { - t.fail(message, {found: ex, wanted: 'not exists', compare: 'fs.stat(' + file + ')'}) - } - } -} - -var server -var testdirContent = { - node_modules: Dir({}), - pkga: Dir({ - 'package.json': File({ - name: 'pkga', - version: '1.0.0' - }) - }), - pkgb: Dir({ - 'package.json': File({ - name: 'pkgb', - version: '1.0.0' - }) - }), - pkgc: Dir({ - 'package.json': File({ - name: 'pkgc', - version: '1.0.0' - }) - }), - pkgd: Dir({ - 'package.json': File({ - name: 'pkgd', - version: '1.0.0' - }) - }) -} - -var fixture -function setup () { - fixture = new Tacks(Dir({ - cache: Dir(), - global: Dir(), - tmp: Dir(), - testdir: Dir(testdirContent) - })) - cleanup() - fixture.create(basedir) -} - -function cleanup () { - fixture.remove(basedir) -} - -test('setup', function (t) { - process.nextTick(function () { - setup() - mr({port: common.port, throwOnUnmatched: true}, function (err, s) { - if (err) throw err - server = s - t.done() - }) - }) -}) - -var installOk = [] -var slashes = [ 'unix', 'win' ] -slashes.forEach(function (os) { - var slash = os === 'unix' - ? function (ss) { return ss.replace(/\\/g, '/') } - : function (ss) { return ss.replace(/\//g, '\\') } - installOk.push(os + '-file-abs-f') - testdirContent[os + '-file-abs-f'] = Dir({ - 'package.json': File({ - name: os + '-file-abs-f', - version: '1.0.0', - dependencies: { - pkga: 'file:' + slash(testdir + '/pkga') - } - }) - }) - installOk.push(os + '-file-abs-fff') - testdirContent[os + '-file-abs-fff'] = Dir({ - 'package.json': File({ - name: os + '-file-abs-fff', - version: '1.0.0', - dependencies: { - pkga: 'file://' + slash(testdir + '/pkga') - } - }) - }) - installOk.push(os + '-file-rel') - testdirContent[os + '-file-rel'] = Dir({ - 'package.json': File({ - name: os + '-file-rel', - version: '1.0.0', - dependencies: { - pkga: 'file:' + slash('../pkga') - } - }) - }) - installOk.push(os + '-file-rel-fffff') - testdirContent[os + '-file-rel-fffff'] = Dir({ - 'package.json': File({ - name: os + '-file-rel-fffff', - version: '1.0.0', - dependencies: { - pkga: 'file:' + slash('/////../pkga') - } - }) - }) -}) - -testdirContent['win-abs-drive-win'] = Dir({ - 'package.json': File({ - name: 'win-abs-drive-win', - version: '1.0.0', - dependencies: { - pkga: 'file:D:\\thing\\pkga' - } - }) -}) - -testdirContent['win-abs-drive-unix'] = Dir({ - 'package.json': File({ - name: 'win-abs-drive-unix', - version: '1.0.0', - dependencies: { - pkga: 'file://D:/thing/pkga' - } - }) -}) - -test('specifiers', function (t) { - t.plan(installOk.length + 2) - installOk.forEach(function (mod) { - t.test(mod, function (t) { - common.npm(['install', '--dry-run', '--json', 'file:' + mod], conf, function (err, code, stdout) { - if (err) throw err - t.is(code, 0, 'command ran ok') - t.comment(stdout.trim()) - t.done() - }) - }) - }) - slashes.forEach(function (os) { - t.test('win-abs-drive-' + os, function (t) { - common.npm(['install', '--dry-run', '--json', 'file:win-abs-drive-' + os], confE, function (err, code, stdout, stderr) { - if (err) throw err - t.not(code, 0, 'command errored ok') - t.comment(stderr.trim()) - if (isWindows) { - t.test('verify failure of file-not-found or wrong drive letter on windows') - } else { - var result = JSON.parse(stdout) - t.is(result.error && result.error.code, 'EWINDOWSPATH', 'verify failure due to windows paths not supported on non-Windows') - } - - t.done() - }) - }) - }) -}) -testdirContent['mkdirp'] = Dir({ - 'package.json': File({ - name: 'mkdirp', - version: '9.9.9' - }) -}) -testdirContent['example'] = Dir({ - 'minimist': Dir({ - 'package.json': File({ - name: 'minimist', - version: '9.9.9' - }) - }) -}) -testdirContent['wordwrap'] = Dir({ -}) -testdirContent['prefer-pkg'] = Dir({ - 'package.json': File({ - name: 'perfer-pkg', - version: '1.0.0', - dependencies: { - 'mkdirp': 'latest' - } - }), - 'latest': Dir({ - 'package.json': File({ - name: 'mkdirp', - version: '9.9.9' - }) - }) -}) - -test('ambiguity', function (t) { - t.plan(5) - t.test('arg: looks like package name, is dir', function (t) { - common.npm(['install', 'mkdirp', '--dry-run', '--json'], conf, function (err, code, stdout) { - if (err) throw err - t.is(code, 0, 'command ran ok') - const result = JSON.parse(stdout.trim()) - t.like(result, {added: [{name: 'mkdirp', version: '9.9.9'}]}, 'got local dir') - t.done() - }) - }) - t.test('arg: looks like package name, is package', function (t) { - common.npm(['install', 'wordwrap', '--dry-run', '--json'], conf, function (err, code, stdout) { - if (err) throw err - t.is(code, 0, 'command ran ok') - const result = JSON.parse(stdout.trim()) - t.like(result, {added: [{name: 'wordwrap', version: '0.0.2'}]}, 'even with local dir w/o package.json, got global') - t.done() - }) - }) - t.test('arg: looks like github repo, is dir', function (t) { - common.npm(['install', 'example/minimist', '--dry-run', '--json'], conf, function (err, code, stdout) { - if (err) throw err - t.is(code, 0, 'command ran ok') - const result = JSON.parse(stdout.trim()) - t.like(result, {added: [{name: 'minimist', version: '9.9.9'}]}, 'got local dir') - t.done() - }) - }) - t.test('package: looks like tag, has dir, use tag', function (t) { - common.npm(['install', '--dry-run', '--json'], {cwd: path.join(testdir, 'prefer-pkg'), env: conf.env}, function (err, code, stdout) { - if (err) throw err - t.is(code, 0, 'command ran ok') - const result = JSON.parse(stdout.trim()) - t.like(result, {added: [{name: 'mkdirp', version: '0.3.5'}]}, 'got local dir') - t.done() - }) - }) - - t.test('test ambiguity for github repos') -}) -testdirContent['existing-matches'] = Dir({ - 'package.json': File({ - name: 'existing-matches', - version: '1.0.0', - dependencies: { - 'pkga': 'file:../pkga', - 'pkgb': 'file:' + testdir + '/pkgb', - 'pkgc': 'file:../pkgc', - 'pkgd': 'file:' + testdir + '/pkgd' - } - }), - 'node_modules': Dir({ - 'pkga': Symlink('../../pkga'), - 'pkgd': Symlink('../../pkgd') - }) -}) - -test('existing install matches', function (t) { - t.plan(1) - // have to make these by hand because tacks doesn't support absolute paths in symlinks - fs.symlinkSync(testdir + '/pkgb', testdir + '/existing-matches/node_modules/pkgb', 'junction') - fs.symlinkSync(testdir + '/pkgc', testdir + '/existing-matches/node_modules/pkgc', 'junction') - t.test('relative symlink counts as match of relative symlink in package.json', function (t) { - common.npm(['ls', '--json'], {cwd: path.join(testdir, 'existing-matches'), env: conf.env}, function (err, code, stdout) { - if (err) throw err - t.is(code, 0, 'command ran ok') - if (stdout) t.comment(stdout.trim()) - t.test('specifically test that output is valid') - // relative symlink counts as match of relative symlink in package.json (pkga) - // relative symlink counts as match of abs symlink in package.json (pkgc) - // abs symlink counts as match of relative symlink in package.json (pkgb) - // abs symlink counts as match of abs symlink in package.json (pkgd) - t.done() - }) - }) -}) -var ibdir = testdir + '/install-behavior' -testdirContent['ib-out'] = Dir({ - 'package.json': File({ - name: 'ib-out', - version: '1.0.0', - dependencies: { - 'minimist': '*' - } - }) -}) - -testdirContent['install-behavior'] = Dir({ - 'package.json': File({ - name: 'install-behavior', - version: '1.0.0' - }), - 'ib-in': Dir({ - 'package.json': File({ - name: 'ib-in', - version: '1.0.0', - dependencies: { - 'mkdirp': '*' - } - }) - }), - 'noext': File(Buffer.from( - '1f8b08000000000000032b484cce4e4c4fd52f80d07a59c5f9790c540606' + - '06066626260a20dadccc144c1b1841f86000923334363037343536343732' + - '633000728c0c80f2d4760836505a5c925804740aa5e640bca200a78708a8' + - '56ca4bcc4d55b252cacb4fad2851d251502a4b2d2acecccf030a19ea19e8' + - '1928d5720db41b47c1281805a36014501f00005012007200080000', - 'hex' - )), - 'tarball-1.0.0.tgz': File(Buffer.from( - '1f8b08000000000000032b484cce4e4c4fd52f80d07a59c5f9790c540606' + - '06066626260a20dadccc144c1b1841f8606062a6c060686c606e686a6c68' + - '666ec26000e480e5a9ed106ca0b4b824b108e8144acd817845014e0f1150' + - 'ad9497989baa64a5040c85a4c49c1c251d05a5b2d4a2e2ccfc3ca0a0a19e' + - '819e81522dd740bb72148c8251300a4601b50100473dd15800080000', - 'hex' - )), - 'not-module': Dir({}), - 'test-preinstall': Dir({ - 'preinstall.js': File('console.log("CWD:" + process.cwd())'), - 'package.json': File({ - name: 'test-preinstall', - version: '1.0.0', - scripts: { - 'preinstall': 'node ' + ibdir + '/test-preinstall/preinstall.js' - } - }) - }) -}) - -test('install behavior', function (t) { - var ibconf = {cwd: ibdir, env: conf.env.extend({npm_config_loglevel: 'silent'}), stdio: conf.stdio} - t.plan(7) - t.test('transitive deps for in-larger-module cases', function (t) { - common.npm(['install', 'file:ib-in'], ibconf, function (err, code, stdout) { - if (err) throw err - t.is(code, 0, 'command ran ok') - if (stdout) t.comment(stdout.trim()) - fileExists(t, ibdir + '/node_modules/mkdirp', 'transitive dep flattened') - isSymlink(t, ibdir + '/node_modules/ib-in', 'dep is symlink') - noFileExists(t, ibdir + '/ib-in/node_modules/mkdirp', 'transitive dep not nested') - t.done() - }) - }) - t.test('transitive deps for out-of-larger module cases', function (t) { - common.npm(['install', 'file:../ib-out'], ibconf, function (err, code, stdout) { - if (err) throw err - t.is(code, 0, 'command ran ok') - if (stdout) t.comment(stdout.trim()) - noFileExists(t, ibdir + '/node_modules/minimist', 'transitive dep not flattened') - fileExists(t, testdir + '/ib-out/node_modules/minimist', 'transitive dep nested') - t.done() - }) - }) - t.test('transitive deps for out-of-larger module cases w/ --preserve-symlinks', function (t) { - rimraf.sync(ibdir + '/node_modules') - rimraf.sync(testdir + '/ib-out/node_modules') - var env = conf.env.extend({NODE_PRESERVE_SYMLINKS: '1'}) - common.npm(['install', 'file:../ib-out'], {cwd: ibdir, env: env}, function (err, code, stdout) { - if (err) throw err - t.is(code, 0, 'command ran ok') - if (stdout) t.comment(stdout.trim()) - fileExists(t, ibdir + '/node_modules/minimist', 'transitive dep flattened') - noFileExists(t, testdir + '/ib-out/node_modules/minimist', 'transitive dep not nested') - t.done() - }) - }) - t.test('tar/tgz/tar.gz should install a tarball', function (t) { - common.npm(['install', 'file:tarball-1.0.0.tgz'], ibconf, function (err, code, stdout) { - if (err) throw err - t.is(code, 0, 'command ran ok') - if (stdout) t.comment(stdout.trim()) - fileExists(t, ibdir + '/node_modules/tarball') - t.done() - }) - }) - t.test('non tar/tgz/tar.gz files should give good error message', function (t) { - common.npm(['install', 'file:noext', '--json'], ibconf, function (err, code, stdout) { - if (err) throw err - t.not(code, 0, 'do not install files w/o extensions') - noFileExists(t, ibdir + '/node_modules/noext') - var result = JSON.parse(stdout) - t.like(result, {error: {code: 'ENOLOCAL'}}, 'new type of error') - t.done() - }) - }) - t.test('directories without package.json should give good error message', function (t) { - common.npm(['install', 'file:not-module', '--json'], ibconf, function (err, code, stdout) { - if (err) throw err - t.not(code, 0, 'error on dir w/o module') - var result = JSON.parse(stdout) - t.like(result, {error: {code: 'ENOLOCAL'}}, 'new type of error') - t.done() - }) - }) - t.test('verify preinstall step runs after finalize, such that cwd is as expected', function (t) { - common.npm(['install', 'file:test-preinstall'], ibconf, function (err, code, stdout) { - if (err) throw err - t.is(code, 0, 'command ran ok') - isSymlink(t, `${ibdir}/node_modules/test-preinstall`, 'installed as symlink') - t.notLike(stdout, /CWD:.*[.]staging/, 'cwd should not be in staging') - - t.test('verify that env is as expected') - t.done() - }) - }) -}) -var sbdir = testdir + '/save-behavior' -testdirContent['save-behavior'] = Dir({ - 'package.json': File({ - name: 'save-behavior', - version: '1.0.0' - }), - 'npm-shrinkwrap.json': File({ - name: 'save-behavior', - version: '1.0.0', - dependencies: {} - }), - 'transitive': Dir({ - 'package.json': File({ - name: 'transitive', - version: '1.0.0', - dependencies: { - 'pkgc': 'file:../../pkgc' - } - }) - }) -}) -testdirContent['sb-transitive'] = Dir({ - 'package.json': File({ - name: 'sb-transitive', - version: '1.0.0', - dependencies: { - 'sbta': 'file:sbta' - } - }), - 'sbta': Dir({ - 'package.json': File({ - name: 'sbta', - version: '1.0.0' - }) - }) -}) -var sbdirp = testdir + '/save-behavior-pre' -testdirContent['save-behavior-pre'] = Dir({ - 'package.json': File({ - name: 'save-behavior', - version: '1.0.0' - }), - 'npm-shrinkwrap.json': File({ - name: 'save-behavior', - version: '1.0.0', - dependencies: {} - }) -}) -testdirContent['sb-transitive-preserve'] = Dir({ - 'package.json': File({ - name: 'sb-transitive-preserve', - version: '1.0.0', - dependencies: { - 'sbtb': 'file:sbtb' - } - }), - 'sbtb': Dir({ - 'package.json': File({ - name: 'sbtb', - version: '1.0.0' - }) - }) -}) -test('save behavior', function (t) { - t.plan(6) - var sbconf = {cwd: sbdir, env: conf.env, stdio: conf.stdio} - t.test('to package.json and npm-shrinkwrap.json w/ abs', function (t) { - common.npm(['install', '--save', 'file:' + testdir + '/pkga'], sbconf, function (err, code, stdout) { - if (err) throw err - t.is(code, 0, 'command ran ok') - var pjson = readJson(sbdir + '/package.json') - var shrinkwrap = readJson(sbdir + '/npm-shrinkwrap.json') - t.is(pjson.dependencies.pkga, 'file:../pkga', 'package.json') - var sdep = shrinkwrap.dependencies - t.like(sdep, {pkga: {version: 'file:../pkga', resolved: null}}, 'npm-shrinkwrap.json') - t.done() - }) - }) - t.test('to package.json and npm-shrinkwrap.json w/ drive abs') - t.test('to package.json and npm-shrinkwrap.json w/ rel', function (t) { - common.npm(['install', '--save', 'file:../pkgb'], sbconf, function (err, code, stdout) { - if (err) throw err - t.is(code, 0, 'command ran ok') - var pjson = readJson(sbdir + '/package.json') - var shrinkwrap = readJson(sbdir + '/npm-shrinkwrap.json') - t.is(pjson.dependencies.pkgb, 'file:../pkgb', 'package.json') - var sdep = shrinkwrap.dependencies - t.like(sdep, {pkgb: {version: 'file:../pkgb', resolved: null}}, 'npm-shrinkwrap.json') - t.done() - }) - }) - t.test('internal transitive dependencies of shrinkwraps', function (t) { - common.npm(['install', '--save', 'file:transitive'], sbconf, function (err, code, stdout) { - if (err) throw err - t.is(code, 0, 'command ran ok') - var pjson = readJson(sbdir + '/package.json') - var shrinkwrap = readJson(sbdir + '/npm-shrinkwrap.json') - t.is(pjson.dependencies.transitive, 'file:transitive', 'package.json') - var sdep = shrinkwrap.dependencies.transitive || {} - var tdep = shrinkwrap.dependencies.pkgc - t.is(sdep.version, 'file:transitive', 'npm-shrinkwrap.json direct dep') - t.is(tdep.version, 'file:../pkgc', 'npm-shrinkwrap.json transitive dep') - t.done() - }) - }) - t.test('external transitive dependencies of shrinkwraps', function (t) { - common.npm(['install', '--save', 'file:../sb-transitive'], sbconf, function (err, code, stdout) { - if (err) throw err - t.is(code, 0, 'command ran ok') - var pjson = readJson(sbdir + '/package.json') - var shrinkwrap = readJson(sbdir + '/npm-shrinkwrap.json') - var deps = pjson.dependencies || {} - t.is(deps['sb-transitive'], 'file:../sb-transitive', 'package.json') - var sdep = shrinkwrap.dependencies['sb-transitive'] || {} - var tdep = sdep.dependencies.sbta - t.like(tdep, {bundled: null, version: 'file:../sb-transitive/sbta'}, 'npm-shrinkwrap.json transitive dep') - t.like(sdep, {bundled: null, version: 'file:../sb-transitive'}, 'npm-shrinkwrap.json direct dep') - t.done() - }) - }) - t.test('external transitive dependencies of shrinkwraps > preserve symlinks', function (t) { - var preserveEnv = conf.env.extend({NODE_PRESERVE_SYMLINKS: '1'}) - var preserveConf = {cwd: sbdirp, env: preserveEnv, stdio: conf.stdio} - common.npm(['install', '--save', 'file:../sb-transitive-preserve'], preserveConf, function (err, code, stdout) { - if (err) throw err - t.is(code, 0, 'command ran ok') - var pjson = readJson(sbdirp + '/package.json') - var shrinkwrap = readJson(sbdirp + '/npm-shrinkwrap.json') - t.is(pjson.dependencies['sb-transitive-preserve'], 'file:../sb-transitive-preserve', 'package.json') - var sdep = shrinkwrap.dependencies['sb-transitive-preserve'] || {} - var tdep = shrinkwrap.dependencies.sbtb - t.like(sdep, {bundled: null, version: 'file:../sb-transitive-preserve'}, 'npm-shrinkwrap.json direct dep') - t.like(tdep, {bundled: null, version: 'file:../sb-transitive-preserve/sbtb'}, 'npm-shrinkwrap.json transitive dep') - t.done() - }) - }) -}) - -var rmdir = testdir + '/remove-behavior' -testdirContent['remove-behavior'] = Dir({ - 'rmsymlink': Dir({ - 'package.json': File({ - name: 'remove-behavior', - version: '1.0.0', - dependencies: { - dep1: 'file:dep1' - } - }), - 'package-lock.json': File({ - name: 'remove-behavior', - version: '1.0.0', - lockfileVersion: 1, - requires: true, - dependencies: { - dep1: { - version: 'file:dep1', - requires: { - dep2: 'file:dep2' - }, - dependencies: { - dep2: { - version: 'file:dep2', - bundled: true - } - } - } - } - }), - dep1: Dir({ - 'package.json': File({ - name: 'dep1', - version: '1.0.0', - dependencies: { - dep2: 'file:../dep2' - } - }), - 'node_modules': Dir({ - dep2: Symlink('../../dep2') - }) - }), - dep2: Dir({ - 'package.json': File({ - name: 'dep2', - version: '1.0.0' - }) - }), - 'node_modules': Dir({ - dep1: Symlink('../dep1') - }) - }), - 'rmesymlink': Dir({ - 'package.json': File({ - name: 'remove-behavior', - version: '1.0.0', - dependencies: { - edep1: 'file:../edep1' - } - }), - 'package-lock.json': File({ - name: 'remove-behavior', - version: '1.0.0', - lockfileVersion: 1, - requires: true, - dependencies: { - edep1: { - version: 'file:../edep1', - requires: { - edep2: 'file:../edep2' - }, - dependencies: { - edep2: { - version: 'file:../edep2', - bundled: true - } - } - } - } - }), - 'node_modules': Dir({ - edep1: Symlink('../../edep1') - }) - }), - edep1: Dir({ - 'package.json': File({ - name: 'edep1', - version: '1.0.0', - dependencies: { - edep2: 'file:../edep2' - } - }), - 'node_modules': Dir({ - edep2: Symlink('../../edep2') - }) - }), - edep2: Dir({ - 'package.json': File({ - name: 'edep2', - version: '1.0.0' - }) - }) -}) - -test('removal', function (t) { - t.plan(2) - - t.test('should remove the symlink', (t) => { - const rmconf = {cwd: `${rmdir}/rmsymlink`, env: conf.env, stdio: conf.stdio} - return common.npm(['uninstall', 'dep1'], rmconf).spread((code, stdout) => { - t.is(code, 0, 'uninstall ran ok') - t.comment(stdout) - noFileExists(t, `${rmdir}/rmsymlink/node_modules/dep1`, 'removed symlink') - noFileExists(t, `${rmdir}/rmsymlink/dep1/node_modules/dep2`, 'removed transitive dep') - fileExists(t, `${rmdir}/rmsymlink/dep2`, 'original transitive dep still exists') - }) - }) - t.test("should not remove transitive deps if it's outside the package and --preserver-symlinks isn't set", (t) => { - const rmconf = {cwd: `${rmdir}/rmesymlink`, env: conf.env, stdio: conf.stdio} - return common.npm(['uninstall', 'edep1'], rmconf).spread((code, stdout) => { - t.is(code, 0, 'uninstall ran ok') - t.comment(stdout) - noFileExists(t, `${rmdir}/rmsymlink/node_modules/edep1`, 'removed symlink') - fileExists(t, `${rmdir}/edep1/node_modules/edep2`, 'did NOT remove transitive dep') - fileExists(t, `${rmdir}/edep2`, 'original transitive dep still exists') - }) - }) -}) - -test('misc', function (t) { - t.plan(3) - t.test('listing: should look right, not include version') - t.test('outdated: show LOCAL for wanted / latest') - t.test('update: if specifier exists, do nothing. otherwise as if `npm install`.') -}) - -test('cleanup', function (t) { - server.close() - cleanup() - t.done() -}) diff --git a/deps/npm/test/tap/splat-with-only-prerelease-to-latest.js b/deps/npm/test/tap/splat-with-only-prerelease-to-latest.js deleted file mode 100644 index ac2c58b5b9de9a..00000000000000 --- a/deps/npm/test/tap/splat-with-only-prerelease-to-latest.js +++ /dev/null @@ -1,95 +0,0 @@ -'use strict' - -const common = require('../common-tap.js') -const mr = require('npm-registry-mock') -const npm = require('../../lib/npm') -const test = require('tap').test - -const testdir = common.pkg - -const moduleName = 'xyzzy-wibble' -const testModule = { - name: moduleName, - 'dist-tags': { - latest: '1.3.0-a', - other: '1.2.0-a' - }, - versions: { - '1.0.0-a': { - name: moduleName, - version: '1.0.0-a', - dist: { - shasum: 'da39a3ee5e6b4b0d3255bfef95601890afd80709', - tarball: 'http://registry.npmjs.org/aproba/-/xyzzy-wibble-1.0.0-a.tgz' - } - }, - '1.1.0-a': { - name: moduleName, - version: '1.1.0-a', - dist: { - shasum: 'da39a3ee5e6b4b0d3255bfef95601890afd80709', - tarball: 'http://registry.npmjs.org/aproba/-/xyzzy-wibble-1.1.0-a.tgz' - } - }, - '1.2.0-a': { - name: moduleName, - version: '1.2.0-a', - dist: { - shasum: 'da39a3ee5e6b4b0d3255bfef95601890afd80709', - tarball: 'http://registry.npmjs.org/aproba/-/xyzzy-wibble-1.2.0-a.tgz' - } - }, - '1.3.0-a': { - name: moduleName, - version: '1.3.0-a', - dist: { - shasum: 'da39a3ee5e6b4b0d3255bfef95601890afd80709', - tarball: 'http://registry.npmjs.org/aproba/-/xyzzy-wibble-1.3.0-a.tgz' - } - } - } -} - -let server -test('setup', (t) => { - mr({port: common.port}, (er, s) => { - if (er) throw er - t.ok(true, 'mock registry loaded') - server = s - npm.load({ - loglevel: 'silent', - registry: common.registry, - cache: common.cache - }, (err) => { - if (err) { throw err } - t.ok(true, 'npm loaded') - t.end() - }) - }) -}) - -test('splat', (t) => { - server.get('/xyzzy-wibble').reply(200, testModule) - return npm.commands.cache.add('xyzzy-wibble', '*', testdir).then((pkg) => { - throw new Error(`Was not supposed to succeed on ${pkg}`) - }).catch((err) => { - t.equal(err.code, 'E404', 'got a 404 on the tarball fetch') - t.equal( - err.uri, - testModule.versions['1.3.0-a'].dist.tarball, - 'tried to get tarball for `latest` tag' - ) - npm.config.set('tag', 'other') - return npm.commands.cache.add('xyzzy-wibble', '*', testdir) - }).then((pkg) => { - throw new Error(`Was not supposed to succeed on ${pkg}`) - }).catch((err) => { - t.equal(err.code, 'E404', 'got a 404 on the tarball fetch') - t.equal( - err.uri, - testModule.versions['1.2.0-a'].dist.tarball, - 'tried to get tarball for `other` tag' - ) - server.close() - }) -}) diff --git a/deps/npm/test/tap/startstop.js b/deps/npm/test/tap/startstop.js deleted file mode 100644 index dd07352e0dc813..00000000000000 --- a/deps/npm/test/tap/startstop.js +++ /dev/null @@ -1,61 +0,0 @@ -var fs = require('graceful-fs') -var path = require('path') - -var mkdirp = require('mkdirp') -var test = require('tap').test - -var common = require('../common-tap') - -var pkg = common.pkg - -var EXEC_OPTS = { cwd: pkg } - -var json = { - name: 'startstop', - version: '1.2.3', - scripts: { - start: 'node -e "console.log(\'start\')"', - stop: 'node -e "console.log(\'stop\')"' - } -} - -function testOutput (t, command, er, code, stdout, stderr) { - t.notOk(code, 'npm ' + command + ' exited with code 0') - - if (stderr) throw new Error('npm ' + command + ' stderr: ' + stderr.toString()) - - stdout = stdout.trim().split(/\n|\r/) - stdout = stdout[stdout.length - 1] - t.equal(stdout, command) - t.end() -} - -test('setup', function (t) { - mkdirp.sync(pkg) - fs.writeFileSync( - path.join(pkg, 'package.json'), - JSON.stringify(json, null, 2) - ) - t.end() -}) - -test('npm start', function (t) { - common.npm(['start'], EXEC_OPTS, testOutput.bind(null, t, 'start')) -}) - -test('npm stop', function (t) { - common.npm(['stop'], EXEC_OPTS, testOutput.bind(null, t, 'stop')) -}) - -test('npm restart', function (t) { - common.npm(['restart'], EXEC_OPTS, function (er, c, stdout) { - if (er) throw er - - var output = stdout.split('\n').filter(function (val) { - return val.match(/^s/) - }) - - t.same(output.sort(), ['start', 'stop'].sort()) - t.end() - }) -}) diff --git a/deps/npm/test/tap/symlink-cycle.js b/deps/npm/test/tap/symlink-cycle.js deleted file mode 100644 index ea0c0f53594439..00000000000000 --- a/deps/npm/test/tap/symlink-cycle.js +++ /dev/null @@ -1,44 +0,0 @@ -'use strict' -var fs = require('fs') -var path = require('path') -var test = require('tap').test -var mkdirp = require('mkdirp') -var writeFileSync = require('fs').writeFileSync -var common = require('../common-tap.js') - -var base = common.pkg -var cycle = path.join(base, 'cycle') - -var cycleJSON = { - name: 'cycle', - version: '1.0.0', - description: '', - main: 'index.js', - scripts: { - test: 'echo "Error: no test specified" && exit 1' - }, - dependencies: { - 'cycle': '*' - }, - author: '', - license: 'ISC' -} - -test('setup', function (t) { - mkdirp.sync(path.join(cycle, 'node_modules')) - writeFileSync( - path.join(cycle, 'package.json'), - JSON.stringify(cycleJSON, null, 2) - ) - fs.symlinkSync(cycle, path.join(cycle, 'node_modules', 'cycle'), 'junction') - t.end() -}) - -test('ls', function (t) { - process.chdir(cycle) - common.npm(['ls'], {}, function (err, code, stdout, stderr) { - t.ifError(err, 'installed w/o error') - t.is(stderr, '', 'no warnings printed to stderr') - t.end() - }) -}) diff --git a/deps/npm/test/tap/tag-version-prefix.js b/deps/npm/test/tap/tag-version-prefix.js deleted file mode 100644 index 70c968705ab07d..00000000000000 --- a/deps/npm/test/tap/tag-version-prefix.js +++ /dev/null @@ -1,73 +0,0 @@ -var common = require('../common-tap.js') -var fs = require('fs') -var path = require('path') - -var test = require('tap').test - -var npm = require('../../lib/npm.js') - -var pkg = common.pkg -var npmrc = path.resolve(pkg, '.npmrc') -var packagePath = path.resolve(pkg, 'package.json') - -var json = { name: 'blah', version: '0.1.2' } - -var configContents = 'sign-git-commit=false\nsign-git-tag=false\nmessage=":bookmark: %s"\n' - -test('npm version with message config', function (t) { - setup() - - npm.load({ prefix: pkg, userconfig: npmrc }, function () { - var git = require('../../lib/utils/git.js') - - common.makeGitRepo({ path: pkg }, function (er) { - t.ifErr(er, 'git bootstrap ran without error') - - common.npm( - [ - '--userconfig', npmrc, - 'config', - 'set', - 'tag-version-prefix', - 'q' - ], - { cwd: pkg, env: { PATH: process.env.PATH } }, - function (err, code, stdout, stderr) { - t.ifError(err, 'npm config ran without issue') - t.notOk(code, 'exited with a non-error code') - t.notOk(stderr, 'no error output') - - common.npm( - [ - 'version', - 'patch', - '--loglevel', 'silent' - // package config is picked up from env - ], - { cwd: pkg, env: { PATH: process.env.PATH } }, - function (err, code, stdout, stderr) { - t.ifError(err, 'npm version ran without issue') - t.notOk(code, 'exited with a non-error code') - t.notOk(stderr, 'no error output') - - git.whichAndExec( - ['tag'], - { cwd: pkg, env: process.env }, - function (er, tags, stderr) { - t.ok(tags.match(/q0\.1\.3/g), 'tag was created by version' + tags) - t.end() - } - ) - } - ) - } - ) - }) - }) -}) - -function setup () { - process.chdir(pkg) - fs.writeFileSync(packagePath, JSON.stringify(json), 'utf8') - fs.writeFileSync(npmrc, configContents, 'ascii') -} diff --git a/deps/npm/test/tap/tagged-version-matching.js b/deps/npm/test/tap/tagged-version-matching.js deleted file mode 100644 index a939c21c0d749b..00000000000000 --- a/deps/npm/test/tap/tagged-version-matching.js +++ /dev/null @@ -1,151 +0,0 @@ -'use strict' -var path = require('path') -var test = require('tap').test -var Tacks = require('tacks') -var File = Tacks.File -var Dir = Tacks.Dir -var Symlink = Tacks.Symlink -var common = require('../common-tap.js') - -var basedir = common.pkg -var testdir = path.join(basedir, 'testdir') -var cachedir = common.cache -var globaldir = path.join(basedir, 'global') -var tmpdir = path.join(basedir, 'tmp') - -var conf = { - cwd: testdir, - env: Object.assign({ - npm_config_cache: cachedir, - npm_config_tmp: tmpdir, - npm_config_prefix: globaldir, - npm_config_registry: common.registry, - npm_config_loglevel: 'warn' - }, process.env) -} - -var fixture = new Tacks(Dir({ - cache: Dir(), - global: Dir(), - tmp: Dir(), - testdir: Dir({ - example: Dir({ - 'package.json': File({ - dependencies: { - tagdep: 'latest', - gitdep: 'npm/example-gitdep' - }, - name: 'example', - version: '1.0.0' - }) - }), - node_modules: Dir({ - example: Symlink('../example'), - gitdep: Dir({ - 'package.json': File({ - _from: 'npm/example-gitdep', - _id: 'gitdep@1.0.0', - _resolved: 'github:npm/example-gitdep#da39a3ee5e6b4b0d3255bfef95601890afd80709', - name: 'gitdep', - version: '1.0.0' - }) - }), - tagdep: Dir({ - 'package.json': File({ - _from: 'tagdep@latest', - _id: 'tagdep@1.0.0', - _integrity: 'sha1-0EJSKmsdk39848LlrRg/hZQo2B8=', - _resolved: 'https://registry.example.com/tagdep/-/tagdep-1.0.0.tgz', - name: 'tagdep', - version: '1.0.0' - }) - }) - }), - 'npm-shrinkwrap.json': File({ - name: 'tagged-version-matching', - version: '1.0.0', - lockfileVersion: 1, - requires: true, - dependencies: { - tagdep: { - version: '1.0.0', - resolved: 'https://registry.example.com/tagdep/-/tagdep-1.0.0.tgz', - integrity: 'sha1-0EJSKmsdk39848LlrRg/hZQo2B8=' - }, - example: { - version: 'file:example', - requires: { - tagdep: '^1.0.0', - gitdep: 'github:npm/example-gitdep#da39a3ee5e6b4b0d3255bfef95601890afd80709' - } - }, - gitdep: { - version: 'github:npm/example-gitdep#da39a3ee5e6b4b0d3255bfef95601890afd80709' - } - } - }), - 'package.json': File({ - name: 'tagged-version-matching', - version: '1.0.0', - dependencies: { - example: 'file:example', - gitdep: 'npm/example-gitdep' - } - }) - }) -})) - -function setup () { - cleanup() - fixture.create(basedir) -} - -function cleanup () { - fixture.remove(basedir) -} - -test('setup', function (t) { - setup() - t.done() -}) - -test('tagged-version-matching', function (t) { - common.npm(['ls', '--json'], conf, function (err, code, stdout, stderr) { - if (err) throw err - t.is(code, 0, 'command ran ok') - if (stderr.trim()) t.comment(stderr.trim()) - var result = JSON.parse(stdout.trim()) - var expected = { - name: 'tagged-version-matching', - version: '1.0.0', - dependencies: { - example: { - version: '1.0.0', - dependencies: { - gitdep: { - version: '1.0.0', - from: 'npm/example-gitdep' - }, - tagdep: { - version: '1.0.0', - from: 'tagdep@latest' - } - } - }, - gitdep: { - version: '1.0.0', - from: 'npm/example-gitdep' - } - } - } - - t.like(result, expected, 'ls looks ok') - t.is((result.problems || []).length, 0, 'no problems') - t.done() - }) -}) - -test('cleanup', function (t) { - cleanup() - t.done() -}) diff --git a/deps/npm/test/tap/team.js b/deps/npm/test/tap/team.js deleted file mode 100644 index 17acf82f4b231f..00000000000000 --- a/deps/npm/test/tap/team.js +++ /dev/null @@ -1,189 +0,0 @@ -var mr = require('npm-registry-mock') - -var test = require('tap').test -var common = require('../common-tap.js') - -var server - -test('setup', function (t) { - mr({port: common.port}, function (err, s) { - t.ifError(err, 'registry mocked successfully') - server = s - t.end() - }) -}) - -test('team create basic', function (t) { - var teamData = { - name: 'test', - scope_id: 1234, - created: '2015-07-23T18:07:49.959Z', - updated: '2015-07-23T18:07:49.959Z', - deleted: null - } - server.put('/-/org/myorg/team', JSON.stringify({ - name: teamData.name, - description: null - })).reply(200, teamData) - common.npm([ - 'team', 'create', 'myorg:' + teamData.name, - '--registry', common.registry, - '--loglevel', 'error', - '--json' - ], {}, function (err, code, stdout, stderr) { - t.ifError(err, 'npm team') - t.equal(code, 0, 'exited OK') - t.equal(stderr, '', 'no error output') - t.same(JSON.parse(stdout), {created: true, team: `myorg:${teamData.name}`}) - t.end() - }) -}) - -test('team create (allow optional @ prefix on scope)', function (t) { - var teamData = { - name: 'test', - scope_id: 1234, - created: '2015-07-23T18:07:49.959Z', - updated: '2015-07-23T18:07:49.959Z', - deleted: null - } - server.put('/-/org/myorg/team', JSON.stringify({ - name: teamData.name, - description: null - })).reply(200, teamData) - common.npm([ - 'team', 'create', '@myorg:' + teamData.name, - '--registry', common.registry, - '--loglevel', 'silent', - '--json' - ], {}, function (err, code, stdout, stderr) { - t.ifError(err, 'npm team') - t.equal(code, 0, 'exited OK') - t.equal(stderr, '', 'no error output') - t.same(JSON.parse(stdout), {created: true, team: `myorg:${teamData.name}`}) - t.end() - }) -}) - -test('team destroy', function (t) { - var teamData = { - name: 'myteam', - scope_id: 1234, - created: '2015-07-23T18:07:49.959Z', - updated: '2015-07-23T18:07:49.959Z', - deleted: '2015-07-23T18:27:27.178Z' - } - server.delete('/-/team/myorg/' + teamData.name).reply(200, teamData) - common.npm([ - 'team', 'destroy', 'myorg:' + teamData.name, - '--registry', common.registry, - '--loglevel', 'silent', - '--json' - ], {}, function (err, code, stdout, stderr) { - t.ifError(err, 'npm team') - t.equal(code, 0, 'exited OK') - t.equal(stderr, '', 'no error output') - t.same(JSON.parse(stdout), {deleted: true, team: `myorg:${teamData.name}`}) - t.end() - }) -}) - -test('team destroy is not allowed for the default developers team', (t) => { - const teamData = { - name: 'developers', - scope_id: 1234, - created: '2015-07-23T18:07:49.959Z', - updated: '2015-07-23T18:07:49.959Z', - deleted: '2015-07-23T18:27:27.178Z' - } - server.delete('/-/team/myorg/' + teamData.name).reply(405, teamData) - common.npm([ - 'team', 'destroy', 'myorg:' + teamData.name, - '--registry', common.registry, - '--loglevel', 'silent', - '--json' - ], {}, function (err, code, stdout, stderr) { - t.ifError(err, 'npm team') - t.equal(code, 1, 'exited with code 1') - t.equal(stderr, '', 'no error output') - t.match(JSON.parse(stdout), {error: {code: 'E405'}}) - t.end() - }) -}) - -test('team add', function (t) { - var user = 'zkat' - server.put('/-/team/myorg/myteam/user', JSON.stringify({ - user: user - })).reply(200, {}) - common.npm([ - 'team', 'add', 'myorg:myteam', user, - '--registry', common.registry, - '--loglevel', 'error', - '--json' - ], {}, function (err, code, stdout, stderr) { - t.ifError(err, 'npm team') - t.equal(code, 0, 'exited OK') - t.equal(stderr, '', 'no error output') - t.end() - }) -}) - -test('team rm', function (t) { - var user = 'zkat' - server.delete('/-/team/myorg/myteam/user', JSON.stringify({ - user: user - })).reply(200, {}) - common.npm([ - 'team', 'rm', 'myorg:myteam', user, - '--registry', common.registry, - '--loglevel', 'silent', - '--json' - ], {}, function (err, code, stdout, stderr) { - t.ifError(err, 'npm team') - t.equal(code, 0, 'exited OK') - t.equal(stderr, '', 'no error output') - t.end() - }) -}) - -test('team ls (on org)', function (t) { - var teams = ['myorg:team1', 'myorg:team2', 'myorg:team3'] - server.get('/-/org/myorg/team?format=cli').reply(200, teams) - common.npm([ - 'team', 'ls', 'myorg', - '--registry', common.registry, - '--loglevel', 'silent', - '--json' - ], {}, function (err, code, stdout, stderr) { - t.ifError(err, 'npm team') - t.equal(code, 0, 'exited OK') - t.equal(stderr, '', 'no error output') - t.same(JSON.parse(stdout), teams) - t.end() - }) -}) - -test('team ls (on team)', function (t) { - var users = ['zkat', 'bcoe'] - server.get('/-/team/myorg/myteam/user?format=cli').reply(200, users) - common.npm([ - 'team', 'ls', 'myorg:myteam', - '--registry', common.registry, - '--loglevel', 'silent', - '--json' - ], {}, function (err, code, stdout, stderr) { - t.ifError(err, 'npm team') - t.equal(code, 0, 'exited OK') - t.equal(stderr, '', 'no error output') - t.same(JSON.parse(stdout).sort(), users.sort()) - t.end() - }) -}) - -test('cleanup', function (t) { - t.pass('cleaned up') - server.done() - server.close() - t.end() -}) diff --git a/deps/npm/test/tap/test-run-ls.js b/deps/npm/test/tap/test-run-ls.js deleted file mode 100644 index 9475695cb6bd9f..00000000000000 --- a/deps/npm/test/tap/test-run-ls.js +++ /dev/null @@ -1,33 +0,0 @@ -var common = require('../common-tap.js') -var test = require('tap').test -var path = require('path') -var cwd = path.resolve(__dirname, '..', '..') -var testscript = require('../../package.json').scripts.test -var tsregexp = testscript.replace(/([[.*\]])/g, '\\$1') - -test('default', function (t) { - common.npm(['run'], { cwd: cwd }, function (er, code, so) { - if (er) throw er - t.notOk(code) - t.similar(so, new RegExp('\\n test\\n ' + tsregexp + '\\n')) - t.end() - }) -}) - -test('parseable', function (t) { - common.npm(['run', '-p'], { cwd: cwd }, function (er, code, so) { - if (er) throw er - t.notOk(code) - t.similar(so, new RegExp('\\ntest:' + tsregexp + '\\n')) - t.end() - }) -}) - -test('parseable', function (t) { - common.npm(['run', '--json'], { cwd: cwd }, function (er, code, so) { - if (er) throw er - t.notOk(code) - t.equal(JSON.parse(so).test, testscript) - t.end() - }) -}) diff --git a/deps/npm/test/tap/tree-style.js b/deps/npm/test/tap/tree-style.js deleted file mode 100644 index 5d8abef3698b29..00000000000000 --- a/deps/npm/test/tap/tree-style.js +++ /dev/null @@ -1,127 +0,0 @@ -'use strict' -var Bluebird = require('bluebird') -var test = require('tap').test -var path = require('path') -var mkdirp = require('mkdirp') -var rimraf = require('rimraf') -var fs = require('graceful-fs') -var common = require('../common-tap') - -var base = common.pkg -var modA = path.resolve(base, 'modA') -var modB = path.resolve(base, 'modB') -var modC = path.resolve(base, 'modC') -var testNormal = path.resolve(base, 'testNormal') -var testGlobal = path.resolve(base, 'testGlobal') -var testLegacy = path.resolve(base, 'testLegacy') - -var json = { - 'name': 'test-tree-style', - 'version': '1.0.0', - 'dependencies': { - 'modA': modA + '-1.0.0.tgz' - } -} - -var modAJson = { - 'name': 'modA', - 'version': '1.0.0', - 'dependencies': { - 'modB': modB + '-1.0.0.tgz' - } -} - -var modBJson = { - 'name': 'modB', - 'version': '1.0.0', - 'dependencies': { - 'modC': modC + '-1.0.0.tgz' - } -} - -var modCJson = { - 'name': 'modC', - 'version': '1.0.0' -} - -function modJoin () { - var modules = Array.prototype.slice.call(arguments) - return modules.reduce(function (a, b) { - return path.resolve(a, 'node_modules', b) - }) -} - -function writeJson (mod, data) { - fs.writeFileSync(path.resolve(mod, 'package.json'), JSON.stringify(data)) -} - -function setup () { - cleanup() - ;[modA, modB, modC, testNormal, testGlobal, testLegacy].forEach(function (mod) { - mkdirp.sync(mod) - }) - writeJson(modA, modAJson) - writeJson(modB, modBJson) - writeJson(modC, modCJson) - ;[testNormal, testGlobal, testLegacy].forEach(function (mod) { writeJson(mod, json) }) -} - -function cleanup () { - rimraf.sync(base) -} - -test('setup', function (t) { - setup() - return Bluebird.try(() => { - return common.npm(['pack', 'file:modC'], {cwd: base}) - }).spread((code) => { - t.is(code, 0, 'pack modC') - return common.npm(['pack', 'file:modB'], {cwd: base}) - }).spread((code) => { - t.is(code, 0, 'pack modB') - return common.npm(['pack', 'file:modA'], {cwd: base}) - }).spread((code) => { - t.is(code, 0, 'pack modA') - }) -}) - -function exists (t, filepath, msg) { - try { - fs.statSync(filepath) - t.pass(msg) - return true - } catch (ex) { - t.fail(msg, {found: null, wanted: 'exists', compare: 'fs.stat(' + filepath + ')'}) - return false - } -} - -test('tree-style', function (t) { - t.plan(12) - common.npm(['install'], {cwd: testNormal}, function (err, code, stdout, stderr) { - if (err) throw err - t.is(code, 0, 'normal install; result code') - t.is(stderr, '', 'normal install; no errors') - exists(t, modJoin(testNormal, 'modA'), 'normal install; module A') - exists(t, modJoin(testNormal, 'modB'), 'normal install; module B') - exists(t, modJoin(testNormal, 'modC'), 'normal install; module C') - }) - common.npm(['install', '--global-style'], {cwd: testGlobal}, function (err, code, stdout, stderr) { - if (err) throw err - t.is(code, 0, 'global-style install; result code') - t.is(stderr, '', 'global-style install; no errors') - exists(t, modJoin(testGlobal, 'modA', 'modB'), 'global-style install; module B') - exists(t, modJoin(testGlobal, 'modA', 'modC'), 'global-style install; module C') - }) - common.npm(['install', '--legacy-bundling'], {cwd: testLegacy}, function (err, code, stdout, stderr) { - if (err) throw err - t.is(code, 0, 'legacy-bundling install; result code') - t.is(stderr, '', 'legacy-bundling install; no errors') - exists(t, modJoin(testLegacy, 'modA', 'modB', 'modC'), 'legacy-bundling install; module C') - }) -}) - -test('cleanup', function (t) { - cleanup() - t.end() -}) diff --git a/deps/npm/test/tap/umask-lifecycle.js b/deps/npm/test/tap/umask-lifecycle.js deleted file mode 100644 index dc365c94abbd56..00000000000000 --- a/deps/npm/test/tap/umask-lifecycle.js +++ /dev/null @@ -1,61 +0,0 @@ -var fs = require('fs') - -var mkdirp = require('mkdirp') -var rimraf = require('rimraf') -var test = require('tap').test -var sprintf = require('sprintf-js').sprintf - -var escapeExecPath = require('../../lib/utils/escape-exec-path.js') -var escapeArg = require('../../lib/utils/escape-arg.js') -var common = require('../common-tap.js') -var pkg = common.pkg - -var nodeCmd = escapeExecPath(common.nodeBin) -var npmCmd = nodeCmd + ' ' + escapeArg(common.bin) -var umaskScript = npmCmd + ' config get umask && ' + nodeCmd + ' -pe "[process.env.npm_config_umask, process.umask()]"' - -var pj = JSON.stringify({ - name: 'x', - version: '1.2.3', - scripts: { umask: umaskScript } -}, null, 2) + '\n' - -var umask = process.umask() -var expected = [ - '', - '> x@1.2.3 umask ' + pkg, - '> ' + umaskScript, - '', - sprintf('%04o', umask), - "[ '" + sprintf('%04o', umask) + "', " + - sprintf('%d', umask) + ' ]', - '' -].join('\n') - -test('setup', function (t) { - rimraf.sync(pkg) - mkdirp.sync(pkg) - fs.writeFileSync(pkg + '/package.json', pj) - t.end() -}) - -test('umask script', function (t) { - common.npm(['run', 'umask', '--scripts-prepend-node-path'], { - cwd: pkg, - env: { - PATH: process.env.PATH, - Path: process.env.Path, - 'npm_config_loglevel': 'warn', - nodeExecPath: process.execPath - } - }, function (er, code, sout, serr) { - t.equal(sout, expected) - t.equal(serr, '') - t.end() - }) -}) - -test('clean', function (t) { - rimraf.sync(pkg) - t.end() -}) diff --git a/deps/npm/test/tap/uninstall-in-reverse.js b/deps/npm/test/tap/uninstall-in-reverse.js deleted file mode 100644 index 5a13e904f341c6..00000000000000 --- a/deps/npm/test/tap/uninstall-in-reverse.js +++ /dev/null @@ -1,38 +0,0 @@ -'use strict' -var test = require('tap').test -var requireInject = require('require-inject') -var log = require('npmlog') - -/* -The remove actions need to happen in the opposite of their normally defined -order. That is, they need to go shallow -> deep. -*/ - -var unbuilt = [] -var npm = requireInject.installGlobally('../../lib/npm.js', { - '../../lib/install/action/unbuild.js': function (staging, pkg, log, next) { - unbuilt.push(pkg.package.name) - next() - } -}) - -test('setup', function (t) { - npm.load(function () { - t.pass('npm loaded') - t.end() - }) -}) - -test('abc', function (t) { - var Installer = require('../../lib/install.js').Installer - var inst = new Installer(__dirname, false, []) - inst.progress = {executeActions: log} - inst.todo = [ - ['unbuild', {package: {name: 'first'}}], - ['unbuild', {package: {name: 'second'}}] - ] - inst.executeActions(function () { - t.isDeeply(unbuilt, ['second', 'first']) - t.end() - }) -}) diff --git a/deps/npm/test/tap/uninstall-link-clean.js b/deps/npm/test/tap/uninstall-link-clean.js deleted file mode 100644 index e21c370f603b70..00000000000000 --- a/deps/npm/test/tap/uninstall-link-clean.js +++ /dev/null @@ -1,113 +0,0 @@ -var fs = require('graceful-fs') -var path = require('path') -var existsSync = fs.existsSync || path.existsSync - -var mkdirp = require('mkdirp') -var rimraf = require('rimraf') -var test = require('tap').test - -var common = require('../common-tap.js') - -var testdir = common.pkg -var pkg = path.join(testdir, 'pkg') -var dep = path.join(testdir, 'dep') -var work = path.join(testdir, 'uninstall-link-clean-TEST') -var modules = path.join(work, 'node_modules') - -var EXEC_OPTS = { cwd: work, stdio: [0, 'ignore', 2] } - -var world = 'console.log("hello blrbld")\n' - -var json = { - name: 'package', - version: '0.0.0', - bin: { - hello: './world.js' - }, - dependencies: { - 'dep': 'file:../dep' - } -} - -var pjDep = { - name: 'dep', - version: '0.0.0', - bin: { - hello: './world.js' - } -} - -test('setup', function (t) { - cleanup() - mkdirp.sync(pkg) - fs.writeFileSync( - path.join(pkg, 'package.json'), - JSON.stringify(json, null, 2) - ) - fs.writeFileSync(path.join(pkg, 'world.js'), world) - - mkdirp.sync(dep) - fs.writeFileSync( - path.join(dep, 'package.json'), - JSON.stringify(pjDep, null, 2) - ) - fs.writeFileSync(path.join(dep, 'world.js'), world) - - mkdirp.sync(modules) - - t.end() -}) - -test('installing package with links', function (t) { - common.npm( - [ - '--loglevel', 'error', - 'install', pkg - ], - EXEC_OPTS, - function (err, code) { - t.ifError(err, 'install ran to completion without error') - t.notOk(code, 'npm install exited with code 0') - - t.ok( - existsSync(path.join(modules, 'package', 'package.json')), - 'package installed' - ) - t.ok(existsSync(path.join(modules, '.bin')), 'binary link directory exists') - t.ok(existsSync(path.join(modules, 'package', 'node_modules', '.bin')), - 'nested binary link directory exists') - - t.end() - } - ) -}) - -test('uninstalling package with links', function (t) { - common.npm( - [ - '--loglevel', 'error', - 'uninstall', 'package' - ], - EXEC_OPTS, - function (err, code) { - t.ifError(err, 'uninstall ran to completion without error') - t.notOk(code, 'npm uninstall exited with code 0') - - t.notOk(existsSync(path.join(modules, 'package')), - 'package directory no longer exists') - t.notOk(existsSync(path.join(modules, 'package', 'node_modules', '.bin')), - 'nested binary link directory no longer exists') - - t.end() - } - ) -}) - -test('cleanup', function (t) { - cleanup() - t.end() -}) - -function cleanup () { - rimraf.sync(testdir) -} diff --git a/deps/npm/test/tap/uninstall-package.js b/deps/npm/test/tap/uninstall-package.js deleted file mode 100644 index 3e0b404b6c4573..00000000000000 --- a/deps/npm/test/tap/uninstall-package.js +++ /dev/null @@ -1,85 +0,0 @@ -var fs = require('graceful-fs') -var path = require('path') - -var mr = require('npm-registry-mock') -var test = require('tap').test - -var common = require('../common-tap.js') - -var pkg = common.pkg - -var EXEC_OPTS = { cwd: pkg, stdio: [0, 'pipe', 2] } - -var json = { - name: 'uninstall-package', - version: '0.0.0', - dependencies: { - underscore: '~1.3.1', - request: '~0.9.0', - '@isaacs/namespace-test': '1.x' - } -} - -test('setup', function (t) { - fs.writeFileSync( - path.join(pkg, 'package.json'), - JSON.stringify(json, null, 2) - ) - t.end() -}) - -test('returns a list of removed items', function (t) { - mr({ port: common.port }, function (er, s) { - common.npm( - [ - '--registry', common.registry, - '--loglevel', 'error', - 'install', '.' - ], - EXEC_OPTS, - function (err, code, stdout, stderr) { - if (err) throw err - t.notOk(code, 'install ran without raising error code') - common.npm( - [ - '--registry', common.registry, - '--loglevel', 'error', - '--parseable', - 'uninstall', 'underscore', 'request', 'lala' - ], - EXEC_OPTS, - function (err, code, stdout, stderr) { - if (err) throw err - t.notOk(code, 'uninstall ran without raising error code') - t.has(stdout, /^remove\tunderscore\t1.3.3\t/m, 'underscore uninstalled') - t.has(stdout, /^remove\trequest\t0.9.5\t/m, 'request uninstalled') - - s.close() - t.end() - } - ) - } - ) - }) -}) - -test('does not fail if installed package lacks a name somehow', function (t) { - const scope = path.resolve(pkg, 'node_modules/@isaacs') - const scopePkg = path.resolve(scope, 'namespace-test') - const pj = path.resolve(scopePkg, 'package.json') - fs.writeFileSync(pj, JSON.stringify({ - lol: 'yolo', - name: 99 - })) - common.npm( - ['uninstall', '@isaacs/namespace-test'], - EXEC_OPTS, - function (err, code, stdout, stderr) { - if (err) throw err - t.equal(code, 0, 'should exit successfully') - t.has(stdout, /removed 1 package in/) - t.notOk(fs.existsSync(scope), 'scoped package removed') - t.end() - } - ) -}) diff --git a/deps/npm/test/tap/uninstall-save.js b/deps/npm/test/tap/uninstall-save.js deleted file mode 100644 index bf1683edcab2cc..00000000000000 --- a/deps/npm/test/tap/uninstall-save.js +++ /dev/null @@ -1,72 +0,0 @@ -var fs = require('fs') -var path = require('path') - -var mkdirp = require('mkdirp') -var mr = require('npm-registry-mock') -var rimraf = require('rimraf') -var test = require('tap').test - -var common = require('../common-tap.js') - -var pkg = common.pkg - -var EXEC_OPTS = { cwd: pkg, stdio: [0, 'ignore', 2] } - -var json = { - name: 'uninstall-save', - version: '0.0.1' -} - -test('setup', function (t) { - mkdirp.sync(path.resolve(pkg, 'node_modules')) - fs.writeFileSync( - path.join(pkg, 'package.json'), - JSON.stringify(json, null, 2) - ) - mr({ port: common.port }, function (er, s) { - t.ifError(er, 'started mock registry') - t.parent.teardown(() => s.close()) - t.end() - }) -}) - -test('uninstall --save removes rm-ed package from package.json', function (t) { - var config = [ - '--registry', common.registry, - '--save-prefix', '^', - '--save', - '--loglevel=error' - ] - return common.npm(config.concat(['install', 'underscore@latest']), EXEC_OPTS).spread((code) => { - t.notOk(code, 'npm install exited with code 0') - - var p = path.join(pkg, 'node_modules', 'underscore', 'package.json') - t.ok(JSON.parse(fs.readFileSync(p))) - - var pkgJson = JSON.parse(fs.readFileSync( - path.join(pkg, 'package.json'), - 'utf8' - )) - t.deepEqual( - pkgJson.dependencies, - { 'underscore': '^1.5.1' }, - 'got expected save prefix and version of 1.5.1' - ) - - var installed = path.join(pkg, 'node_modules', 'underscore') - rimraf.sync(installed) - - return common.npm(config.concat(['uninstall', 'underscore']), EXEC_OPTS) - }).spread((code) => { - var pkgJson = JSON.parse(fs.readFileSync( - path.join(pkg, 'package.json'), - 'utf8' - )) - - t.deepEqual( - pkgJson.dependencies, - { }, - 'dependency removed as expected' - ) - }) -}) diff --git a/deps/npm/test/tap/unit-child-path.js b/deps/npm/test/tap/unit-child-path.js deleted file mode 100644 index 902e8f5ec7483a..00000000000000 --- a/deps/npm/test/tap/unit-child-path.js +++ /dev/null @@ -1,16 +0,0 @@ -'use strict' -var test = require('tap').test -var childPath = require('../../lib/utils/child-path.js') -var path = require('path') - -test('childPath', function (t) { - t.is( - path.resolve(childPath('/path/to', {name: 'abc'})), - path.resolve('/path/to/node_modules/abc'), - 'basic use') - t.is( - path.resolve(childPath('/path/to', {package: {name: '@zed/abc'}})), - path.resolve('/path/to/node_modules/@zed/abc'), - 'scoped use') - t.end() -}) diff --git a/deps/npm/test/tap/unit-deps-earliestInstallable.js b/deps/npm/test/tap/unit-deps-earliestInstallable.js deleted file mode 100644 index 47d1ab4119b1e9..00000000000000 --- a/deps/npm/test/tap/unit-deps-earliestInstallable.js +++ /dev/null @@ -1,114 +0,0 @@ -'use strict' -var test = require('tap').test -var requireInject = require('require-inject') -var npa = require('npm-package-arg') -var log = require('npmlog') - -// we're just mocking to avoid having to call `npm.load` -var deps = requireInject('../../lib/install/deps.js', { - '../../lib/npm.js': { - config: { - get: function (val) { return (val === 'global-style' || val === 'legacy-bundling') ? false : 'mock' } - }, - limit: { - fetch: 10 - } - } -}) - -var earliestInstallable = deps.earliestInstallable - -test('earliestInstallable should consider devDependencies', function (t) { - var dep1 = { - children: [], - package: { - name: 'dep1', - dependencies: { dep2: '2.0.0' } - }, - path: '/dep1', - realpath: '/dep1' - } - - // a library required by the base package - var dep2 = { - package: { - name: 'dep2', - version: '1.0.0' - }, - path: '/dep2', - realpath: '/dep2' - } - - // an incompatible version of dep2. required by dep1 - var dep2a = { - package: { - name: 'dep2', - version: '2.0.0', - _requested: npa('dep2@2.0.0') - }, - parent: dep1, - path: '/dep1/node_modules/dep2a', - realpath: '/dep1/node_modules/dep2a' - } - - var pkg = { - isTop: true, - children: [dep1, dep2], - package: { - name: 'pkg', - dependencies: { dep1: '1.0.0' }, - devDependencies: { dep2: '1.0.0' } - }, - path: '/', - realpath: '/' - } - - dep1.parent = pkg - dep2a.parent = dep1 - dep2.parent = pkg - - var earliest = earliestInstallable(dep1, dep1, dep2a.package, log) - t.isDeeply(earliest, dep1, 'should hoist package when an incompatible devDependency is present') - t.end() -}) - -test('earliestInstallable should reuse shared prod/dev deps when they are identical', function (t) { - var dep1 = { - children: [], - package: { - name: 'dep1', - dependencies: { dep2: '1.0.0' } - }, - path: '/dep1', - realpath: '/dep1' - } - - var dep2 = { - package: { - name: 'dep2', - version: '1.0.0', - _requested: npa('dep2@^1.0.0') - }, - path: '/dep2', - realpath: '/dep2' - } - - var pkg = { - isTop: true, - children: [dep1], - package: { - name: 'pkg', - dependencies: { dep1: '1.0.0' }, - devDependencies: { dep2: '^1.0.0' } - }, - path: '/', - realpath: '/' - } - - dep1.parent = pkg - dep2.parent = pkg - - var earliest = earliestInstallable(dep1, dep1, dep2.package, log) - t.isDeeply(earliest, pkg, 'should reuse identical shared dev/prod deps when installing both') - t.end() -}) diff --git a/deps/npm/test/tap/unit-deps-removeObsoleteDep.js b/deps/npm/test/tap/unit-deps-removeObsoleteDep.js deleted file mode 100644 index 71ae60863771af..00000000000000 --- a/deps/npm/test/tap/unit-deps-removeObsoleteDep.js +++ /dev/null @@ -1,44 +0,0 @@ -'use strict' -var test = require('tap').test -var requireInject = require('require-inject') - -// we're just mocking to avoid having to call `npm.load` -var deps = requireInject('../../lib/install/deps.js', { - '../../lib/npm.js': { - config: { - get: function () { return 'mock' } - }, - limit: { - fetch: 10 - } - } -}) - -var removeObsoleteDep = deps.removeObsoleteDep - -test('removeObsoleteDep', function (t) { - var child1 = {requiredBy: []} - var test1 = { - removed: true, - requires: [ child1 ] - } - removeObsoleteDep(test1) - t.is(child1.removed, undefined, 'no recursion on deps flagged as removed already') - - var child2 = {requiredBy: []} - var test2 = { - requires: [ child2 ] - } - child2.requiredBy.push(test2) - removeObsoleteDep(test2) - t.is(child2.removed, true, 'required by no other modules, removing') - - var child3 = {requiredBy: [{isTop: true}]} - var test3 = { - requires: [ child3 ] - } - child3.requiredBy.push(test3) - removeObsoleteDep(test3) - t.is(child3.removed, undefined, 'required by other modules, keeping') - t.done() -}) diff --git a/deps/npm/test/tap/unit-deps-replaceModule.js b/deps/npm/test/tap/unit-deps-replaceModule.js deleted file mode 100644 index 15cce005d5dcff..00000000000000 --- a/deps/npm/test/tap/unit-deps-replaceModule.js +++ /dev/null @@ -1,65 +0,0 @@ -'use strict' -var test = require('tap').test -var npm = require('../../lib/npm') - -test('setup', function (t) { - npm.load({}, t.done) -}) - -test('replaceModuleByName', function (t) { - var replaceModuleByName = require('../../lib/install/deps')._replaceModuleByName - var mods = [] - for (var ii = 0; ii < 10; ++ii) { - mods.push({package: {name: String(ii)}, path: '/path/to/' + ii}) - } - - var test = {} - test.A = mods.slice(0, 4) - replaceModuleByName(test, 'A', mods[2]) - t.isDeeply(test.A, mods.slice(0, 4), 'replacing an existing module leaves the order alone') - replaceModuleByName(test, 'A', mods[7]) - t.isDeeply(test.A, mods.slice(0, 4).concat(mods[7]), 'replacing a new module appends') - - test.B = mods.slice(0, 4) - var replacement = {package: {name: '1'}, isReplacement: true} - replaceModuleByName(test, 'B', replacement) - t.isDeeply(test.B, [mods[0], replacement, mods[2], mods[3]], 'replacing existing module swaps out for the new version') - - replaceModuleByName(test, 'C', mods[7]) - t.isDeeply(test.C, [mods[7]], 'replacing when the key does not exist yet, causes its creation') - - test.D = mods.slice(0, 4) - var duplicateByPath = {package: {name: 'dup'}, path: test.D[0].path} - replaceModuleByName(test, 'D', duplicateByPath) - t.isDeeply(test.D, mods.slice(0, 4).concat(duplicateByPath), 'replacing with a duplicate path but diff names appends') - t.end() -}) - -test('replaceModuleByPath', function (t) { - var replaceModuleByPath = require('../../lib/install/deps')._replaceModuleByPath - var mods = [] - for (var ii = 0; ii < 10; ++ii) { - mods.push({package: {name: String(ii)}, path: '/path/to/' + ii}) - } - - var test = {} - test.A = mods.slice(0, 4) - replaceModuleByPath(test, 'A', mods[2]) - t.isDeeply(test.A, mods.slice(0, 4), 'replacing an existing module leaves the order alone') - replaceModuleByPath(test, 'A', mods[7]) - t.isDeeply(test.A, mods.slice(0, 4).concat(mods[7]), 'replacing a new module appends') - - test.B = mods.slice(0, 4) - var replacement = {package: {name: '1'}, isReplacement: true, path: '/path/to/1'} - replaceModuleByPath(test, 'B', replacement) - t.isDeeply(test.B, [mods[0], replacement, mods[2], mods[3]], 'replacing existing module swaps out for the new version') - - replaceModuleByPath(test, 'C', mods[7]) - t.isDeeply(test.C, [mods[7]], 'replacing when the key does not exist yet, causes its creation') - - test.D = mods.slice(0, 4) - var duplicateByPath = {package: {name: 'dup'}, path: test.D[0].path} - replaceModuleByPath(test, 'D', duplicateByPath) - t.isDeeply(test.D, [duplicateByPath].concat(mods.slice(1, 4)), 'replacing with a duplicate path but diff names replaces') - t.end() -}) diff --git a/deps/npm/test/tap/unit-module-name.js b/deps/npm/test/tap/unit-module-name.js deleted file mode 100644 index 59d4b44f0b36c7..00000000000000 --- a/deps/npm/test/tap/unit-module-name.js +++ /dev/null @@ -1,40 +0,0 @@ -'use strict' -var test = require('tap').test -var moduleName = require('../../lib/utils/module-name.js') - -test('pathToPackageName', function (t) { - var pathToPackageName = moduleName.test.pathToPackageName - t.is(pathToPackageName('/foo/bar/baz/bark'), 'bark', 'simple module name') - t.is(pathToPackageName('/foo/bar/@baz/bark'), '@baz/bark', 'scoped module name') - t.is(pathToPackageName('/foo'), 'foo', 'module at top') - t.is(pathToPackageName('/@foo'), '@foo', 'invalid module at top') - t.is(pathToPackageName('/'), '', 'root, empty result') - t.is(pathToPackageName(''), '', 'empty, empty') - t.is(pathToPackageName(undefined), '', 'undefined is empty') - t.is(pathToPackageName(null), '', 'null is empty') - t.done() -}) - -test('isNotEmpty', function (t) { - var isNotEmpty = moduleName.test.isNotEmpty - t.is(isNotEmpty('abc'), true, 'string is not empty') - t.is(isNotEmpty(''), false, 'empty string is empty') - t.is(isNotEmpty(null), false, 'null is empty') - t.is(isNotEmpty(undefined), false, 'undefined is empty') - t.is(isNotEmpty(0), true, 'zero is not empty') - t.is(isNotEmpty(true), true, 'true is not empty') - t.is(isNotEmpty([]), true, 'empty array is not empty') - t.is(isNotEmpty({}), true, 'object is not empty') - t.done() -}) - -test('moduleName', function (t) { - t.is(moduleName({package: {name: 'foo'}}), 'foo', 'package named') - t.is(moduleName({name: 'foo'}), 'foo', 'package named, no tree') - t.is(moduleName({path: '/foo/bar'}), 'bar', 'path named') - t.is(moduleName({}), '!invalid#1', 'no named') - t.is(moduleName({path: '/'}), '!invalid#2', 'invalid named') - var obj = {} - t.is(moduleName(obj), moduleName(obj), 'once computed, an invalid module name will not change') - t.done() -}) diff --git a/deps/npm/test/tap/unit-package-id.js b/deps/npm/test/tap/unit-package-id.js deleted file mode 100644 index 19590d82efee7f..00000000000000 --- a/deps/npm/test/tap/unit-package-id.js +++ /dev/null @@ -1,17 +0,0 @@ -'use strict' -var test = require('tap').test -var packageId = require('../../lib/utils/package-id.js') - -test('packageId', function (t) { - t.is(packageId({package: {_id: 'abc@123'}}), 'abc@123', 'basic') - t.is(packageId({_id: 'abc@123'}), 'abc@123', 'basic no tree') - t.is(packageId({package: {name: 'abc', version: '123'}}), 'abc@123', 'computed') - t.is(packageId({package: {_id: '@', name: 'abc', version: '123'}}), 'abc@123', 'computed, ignore invalid id') - t.is(packageId({package: {name: 'abc'}}), 'abc', 'no version') - t.is(packageId({package: {version: '123'}}), '!invalid#1@123', 'version, no name') - t.is(packageId({package: {version: '123'}, path: '/path/to/abc'}), 'abc@123', 'version path-name') - t.is(packageId({package: {version: '123'}, path: '/path/@to/abc'}), '@to/abc@123', 'version scoped-path-name') - t.is(packageId({path: '/path/to/abc'}), 'abc', 'path name, no version') - t.is(packageId({}), '!invalid#2', 'nothing') - t.done() -}) diff --git a/deps/npm/test/tap/unit-token-validate-cidr.js b/deps/npm/test/tap/unit-token-validate-cidr.js deleted file mode 100644 index cda91b8f1e0da3..00000000000000 --- a/deps/npm/test/tap/unit-token-validate-cidr.js +++ /dev/null @@ -1,18 +0,0 @@ -'use strict' -const test = require('tap').test -const validateCIDRList = require('../../lib/token.js')._validateCIDRList - -test('validateCIDRList', (t) => { - t.plan(10) - const single = ['127.0.0.0/24'] - const double = ['127.0.0.0/24', '192.168.0.0/16'] - const ipv6 = '2620:0:2d0:200::7/32' - const ipv6Mixed = ['127.0.0/24', '2620:0:2d0:200::7/32', '192.168.0.0/16'] - t.doesNotThrow(() => t.isDeeply(validateCIDRList(single.join(',')), single), 'single string ipv4') - t.doesNotThrow(() => t.isDeeply(validateCIDRList(single), single), 'single array ipv4') - t.doesNotThrow(() => t.isDeeply(validateCIDRList(double.join(',')), double), 'double string ipv4') - t.doesNotThrow(() => t.isDeeply(validateCIDRList(double), double), 'double array ipv4') - t.throws(() => validateCIDRList(ipv6)) - t.throws(() => validateCIDRList(ipv6Mixed)) - t.done() -}) diff --git a/deps/npm/test/tap/unpack-foreign-tarball.js b/deps/npm/test/tap/unpack-foreign-tarball.js deleted file mode 100644 index b3a9026f84ab20..00000000000000 --- a/deps/npm/test/tap/unpack-foreign-tarball.js +++ /dev/null @@ -1,84 +0,0 @@ -var fs = require('graceful-fs') -var path = require('path') - -var t = require('tap') -var mkdirp = require('mkdirp') -var rimraf = require('rimraf') - -var common = require('../common-tap.js') - -var fixtures = path.resolve(__dirname, '..', 'fixtures') - -var pkg = common.pkg -var nm = path.resolve(pkg, 'node_modules') -var target = path.resolve(nm, 'npm-test-gitignore') -var cache = common.cache -var tmp = path.resolve(pkg, 'tmp') - -var EXEC_OPTS = { - env: { - 'npm_config_cache': cache, - 'npm_config_tmp': tmp - }, - cwd: pkg -} - -function verify (t, files, code) { - if (code) { - return t.fail('exited with failure: ' + code) - } - var actual = fs.readdirSync(target).sort() - var expect = files.concat(['.npmignore', 'package.json']).sort() - t.same(actual, expect) -} - -t.comment('test for https://github.com/npm/npm/issues/5658') - -t.test('npmignore only', function (t) { - t.test('setup', setup) - var file = path.resolve(fixtures, 'npmignore.tgz') - return t.test('test', t => common.npm(['install', file], EXEC_OPTS) - .then(([code]) => verify(t, ['foo'], code))) -}) - -t.test('gitignore only', function (t) { - t.test('setup', setup) - var file = path.resolve(fixtures, 'gitignore.tgz') - return t.test('test', t => common.npm(['install', file], EXEC_OPTS) - .then(([code]) => verify(t, ['foo'], code))) -}) - -t.test('gitignore and npmignore', function (t) { - t.test('setup', setup) - var file = path.resolve(fixtures, 'gitignore-and-npmignore.tgz') - return t.test('test', t => common.npm(['install', file], EXEC_OPTS) - .then(([code]) => verify(t, ['foo', 'bar'], code))) -}) - -t.test('gitignore and npmignore, not gzipped 1/2', function (t) { - t.test('setup', setup) - var file = path.resolve(fixtures, 'gitignore-and-npmignore.tar') - return t.test('test', t => common.npm(['install', file], EXEC_OPTS) - .then(([code]) => verify(t, ['foo', 'bar'], code))) -}) - -t.test('gitignore and npmignore, not gzipped 2/2', function (t) { - t.test('setup', setup) - var file = path.resolve(fixtures, 'gitignore-and-npmignore-2.tar') - return t.test('test', t => common.npm(['install', file], EXEC_OPTS) - .then(([code]) => verify(t, ['foo', 'bar'], code))) -}) - -function setup (t) { - t.test('destroy', t => { - t.plan(2) - t.test('node_modules', t => rimraf(nm, t.end)) - t.test('tmp', t => rimraf(tmp, t.end)) - }) - t.test('create', t => { - mkdirp.sync(nm) - mkdirp.sync(tmp) - t.end() - }) - t.end() -} diff --git a/deps/npm/test/tap/unpublish-config.js b/deps/npm/test/tap/unpublish-config.js deleted file mode 100644 index 6d5c981d08d958..00000000000000 --- a/deps/npm/test/tap/unpublish-config.js +++ /dev/null @@ -1,70 +0,0 @@ -var fs = require('graceful-fs') -var http = require('http') -var path = require('path') - -var test = require('tap').test - -var common = require('../common-tap.js') -var pkg = common.pkg -var fixturePath = path.join(pkg, 'fixture_npmrc') - -var json = { - name: 'npm-test-unpublish-config', - version: '1.2.3', - publishConfig: { registry: common.registry } -} - -test('setup', function (t) { - fs.writeFileSync( - path.join(pkg, 'package.json'), - JSON.stringify(json), 'utf8' - ) - fs.writeFileSync( - fixturePath, - '//localhost:' + common.port + '/:_authToken = beeeeeeeeeeeeef\n' + - 'registry = http://lvh.me:4321/registry/path\n' - ) - - t.end() -}) - -test('cursory test of unpublishing with config', function (t) { - var child - t.plan(4) - http.createServer(function (req, res) { - t.pass('got request on the fakey fake registry') - this.close() - res.statusCode = 500 - res.end(JSON.stringify({ - error: 'shh no tears, only dreams now' - })) - child.kill('SIGINT') - }).listen(common.port, function () { - t.pass('server is listening') - - child = common.npm( - [ - '--userconfig', fixturePath, - '--loglevel', 'error', - '--force', - 'unpublish' - ], - { - cwd: pkg, - stdio: 'inherit', - env: { - 'npm_config_cache_lock_stale': 1000, - 'npm_config_cache_lock_wait': 1000, - HOME: process.env.HOME, - Path: process.env.PATH, - PATH: process.env.PATH, - USERPROFILE: process.env.USERPROFILE - } - }, - function (err, code) { - t.ifError(err, 'publish command finished successfully') - t.notOk(code, 'npm install exited with code 0') - } - ) - }) -}) diff --git a/deps/npm/test/tap/unsupported.js b/deps/npm/test/tap/unsupported.js deleted file mode 100644 index 2ebbd2d6542e2b..00000000000000 --- a/deps/npm/test/tap/unsupported.js +++ /dev/null @@ -1,48 +0,0 @@ -'use strict' -var test = require('tap').test -var unsupported = require('../../lib/utils/unsupported.js') - -var versions = [ - // broken unsupported - ['v0.1.103', true, true], - ['v0.2.0', true, true], - ['v0.3.5', true, true], - ['v0.4.7', true, true], - ['v0.5.3', true, true], - ['v0.6.17', true, true], - ['v0.7.8', true, true], - ['v0.8.28', true, true], - ['v0.9.6', true, true], - ['v0.10.48', true, true], - ['v0.11.16', true, true], - ['v0.12.9', true, true], - ['v1.0.1', true, true], - ['v1.6.0', true, true], - ['v2.3.1', true, true], - ['v3.0.0', true, true], - ['v4.5.0', true, true], - ['v4.8.4', true, true], - ['v5.7.1', true, true], - ['v6.8.1', false, false], - ['v7.0.0-beta23', false, true], - ['v7.2.3', false, true], - ['v8.4.0', false, false], - ['v9.3.0', false, false], - ['v10.0.0-0', false, false], - ['v11.0.0-0', false, false], - ['v12.0.0-0', false, false], - ['v13.0.0-0', false, false] -] - -test('versions', function (t) { - t.plan(versions.length * 2) - versions.forEach(function (verinfo) { - var version = verinfo[0] - var broken = verinfo[1] - var unsupp = verinfo[2] - var nodejs = unsupported.checkVersion(version) - t.is(nodejs.broken, broken, version + ' ' + (broken ? '' : 'not ') + 'broken') - t.is(nodejs.unsupported, unsupp, version + ' ' + (unsupp ? 'unsupported' : 'supported')) - }) - t.done() -}) diff --git a/deps/npm/test/tap/update-examples.js b/deps/npm/test/tap/update-examples.js deleted file mode 100644 index 2217386de8d23f..00000000000000 --- a/deps/npm/test/tap/update-examples.js +++ /dev/null @@ -1,221 +0,0 @@ -var common = require('../common-tap.js') -var test = require('tap').test -var mkdirp = require('mkdirp') -var mr = require('npm-registry-mock') -var requireInject = require('require-inject') - -var PKG_DIR = common.pkg -var CACHE_DIR = common.cache - -// ** constant templates for mocks ** -var DEFAULT_PKG = { - 'name': 'update-examples', - 'version': '1.2.3', - 'dependencies': { - 'dep1': '*' - } -} - -var DEP_PKG = { - name: 'dep1', - version: '1.1.1', - _from: '^1.1.1' -} - -var INSTALLED = { - path: '/mock/root', - realpath: '/mock/root', - isLink: false, - package: DEFAULT_PKG, - children: [ - { - path: '/mock/root/node_modules/dep1', - realpath: '/mock/root/node_modules/dep1', - isLink: false, - package: DEP_PKG, - children: [] - } - ] -} - -var DEP1_REGISTRY = { name: 'dep1', - 'dist-tags': { latest: '1.2.2' }, - versions: { - '1.2.2': { version: '1.2.2' }, - '1.2.1': { version: '1.2.1' }, - '1.2.0': { version: '1.2.0' }, - '1.1.2': { version: '1.1.2' }, - '1.1.1': { version: '1.1.1' }, - '1.0.0': { version: '1.0.0' }, - '0.4.1': { version: '0.4.1' }, - '0.4.0': { version: '0.4.0' }, - '0.2.0': { version: '0.2.0' } - } -} - -var registryMocks = { - 'get': { - '/dep1': [200, DEP1_REGISTRY] - } -} - -// ** dynamic mocks, cloned from templates and modified ** -var mockDepJson = clone(DEP_PKG) -var mockInstalled = clone(INSTALLED) -var mockParentJson = clone(DEFAULT_PKG) - -// target -var installAskedFor - -function clone (a) { - return extend({}, a) -} - -function extend (a, b) { - for (var key in b) { - a[key] = b[key] - } - return a -} - -const path = require('path') -let cacheIteration = 0 -const isRoot = process.getuid && process.getuid() === 0 -const sudoUID = isRoot ? +process.env.SUDO_UID : null -const sudoGID = isRoot ? +process.env.SUDO_GID : null -const { chownSync } = require('fs') -function resetPackage (options) { - CACHE_DIR = path.resolve(common.cache, '' + cacheIteration++) - npm.config.set('cache', CACHE_DIR) - mkdirp.sync(CACHE_DIR) - - if (isRoot && sudoUID && sudoGID) { - chownSync(CACHE_DIR, sudoUID, sudoGID) - } - - installAskedFor = undefined - - mockParentJson = clone(DEFAULT_PKG) - mockInstalled = clone(INSTALLED) - mockDepJson = clone(DEP_PKG) - - if (options.wanted) { - mockParentJson.dependencies.dep1 = options.wanted - mockInstalled.package.dependencies.dep1 = options.wanted - mockDepJson._from = options.wanted - } - - if (options.installed) { - mockInstalled.package.dependencies.dep1 = options.installed - mockInstalled.children[0].package.version = options.installed - mockDepJson.version = options.installed - } -} - -function mockReadPackageTree (dir, cb) { - cb(null, mockInstalled) -} - -function mockReadJson (file, cb) { - cb(null, file.match(/dep1/) ? mockDepJson : mockParentJson) -} - -function mockCommand (npm, name, fn) { - delete npm.commands[name] - npm.commands[name] = fn -} - -function mockInstaller (where, dryrun, what) { - installAskedFor = what[0] -} -mockInstaller.prototype = {} -mockInstaller.prototype.run = function (cb) { - return cb ? cb() : Promise.resolve() -} - -var npm = requireInject.installGlobally('../../lib/npm.js', { - 'read-package-tree': mockReadPackageTree, - 'read-package-json': mockReadJson, - '../../lib/install': { - Installer: mockInstaller - } -}) - -test('setup', function (t) { - t.plan(5) - process.chdir(PKG_DIR) - t.pass('made ' + PKG_DIR) - - mr({ port: common.port, mocks: registryMocks }, function (er, server) { - t.pass('mock registry active') - npm.load({ - cache: CACHE_DIR, - registry: common.registry, - cwd: PKG_DIR - }, function (err) { - t.ifError(err, 'started server') - t.parent.teardown(() => server.close()) - - t.pass('npm.load complete') - - mockCommand(npm, 'install', function mockInstall (where, what, cb) { - installAskedFor = what - cb(null) - }) - - t.pass('mocks configured') - t.end() - }) - }) -}) - -test('update caret dependency to latest', function (t) { - resetPackage({ wanted: '^1.1.1' }) - - npm.config.set('loglevel', 'silly') - npm.commands.update([], function (err) { - t.ifError(err) - t.equal(installAskedFor, 'dep1@1.2.2', 'should want to install dep@1.2.2') - t.end() - }) -}) - -test('update tilde dependency to latest', function (t) { - resetPackage({ wanted: '~1.1.1' }) - - npm.commands.update([], function (err) { - t.ifError(err) - t.equal(installAskedFor, 'dep1@1.1.2', 'should want to install dep@1.1.2') - t.end() - }) -}) - -test('hold tilde dependency at wanted (#6441)', function (t) { - resetPackage({ wanted: '~1.1.2', installed: '1.1.2' }) - - npm.commands.update([], function (err) { - t.ifError(err) - t.notOk(installAskedFor, 'should not want to install anything') - t.end() - }) -}) - -test('update old caret dependency with no newer', function (t) { - resetPackage({ wanted: '^0.2.0', installed: '^0.2.0' }) - - npm.commands.update([], function (err) { - t.ifError(err) - t.equal(installAskedFor, 'dep1@0.2.0', 'should want to install dep@0.2.0') - t.end() - }) -}) - -test('update old caret dependency with newer', function (t) { - resetPackage({ wanted: '^0.4.0', installed: '^0.4.0' }) - - npm.commands.update([], function (err) { - t.ifError(err) - t.equal(installAskedFor, 'dep1@0.4.1', 'should want to install dep@0.4.1') - t.end() - }) -}) diff --git a/deps/npm/test/tap/update-path.js b/deps/npm/test/tap/update-path.js deleted file mode 100644 index 1578669a253fb9..00000000000000 --- a/deps/npm/test/tap/update-path.js +++ /dev/null @@ -1,35 +0,0 @@ -'use strict' -var test = require('tap').test -var requireInject = require('require-inject') - -var mockNpm = { - config: { - get: function (key) { - return false - } - }, - commands: { - outdated: function (args, silent, cb) { - cb(null, [ - [{path: '/incorrect', parent: {path: '/correct'}}, 'abc', '1.0.0', '1.1.0', '1.1.0', '^1.1.0'] - ]) - } - } -} - -// What we're testing here is that updates use the parent module's path to -// install from. -test('update', function (t) { - var update = requireInject('../../lib/update.js', { - '../../lib/npm.js': mockNpm, - '../../lib/install.js': { - 'Installer': function (where, dryrun, args) { - t.is(where, '/correct', 'We should be installing to the parent of the modules being updated') - this.run = function (cb) { cb() } - } - } - }) - update(['abc'], function () { - t.end() - }) -}) diff --git a/deps/npm/test/tap/update-symlink.js b/deps/npm/test/tap/update-symlink.js deleted file mode 100644 index eda07c56e1f698..00000000000000 --- a/deps/npm/test/tap/update-symlink.js +++ /dev/null @@ -1,109 +0,0 @@ -'use strict' -const path = require('path') -const test = require('tap').test -const mr = require('npm-registry-mock') -const Tacks = require('tacks') -const File = Tacks.File -const Symlink = Tacks.Symlink -const Dir = Tacks.Dir -const common = require('../common-tap.js') - -const basedir = common.pkg -const testdir = path.join(basedir, 'testdir') -const cachedir = common.cache -const globaldir = path.join(basedir, 'global') -const tmpdir = path.join(basedir, 'tmp') - -const conf = { - cwd: path.join(testdir, 'main'), - env: Object.assign({}, process.env, { - npm_config_cache: cachedir, - npm_config_tmp: tmpdir, - npm_config_prefix: globaldir, - npm_config_registry: common.registry, - npm_config_loglevel: 'warn' - }) -} - -let server -const fixture = new Tacks(Dir({ - cache: Dir(), - global: Dir(), - tmp: Dir(), - testdir: Dir({ - broken: Dir({ - 'package.json': File({ - name: 'broken', - version: '1.0.0' - }) - }), - main: Dir({ - node_modules: Dir({ - unbroken: Symlink('/testdir/unbroken') - }), - 'package-lock.json': File({ - name: 'main', - version: '1.0.0', - lockfileVersion: 1, - requires: true, - dependencies: { - broken: { - version: 'file:../broken' - }, - unbroken: { - version: 'file:../unbroken' - } - } - }), - 'package.json': File({ - name: 'main', - version: '1.0.0', - dependencies: { - broken: 'file:../broken', - unbroken: 'file:../unbroken' - } - }) - }), - unbroken: Dir({ - 'package.json': File({ - name: 'unbroken', - version: '1.0.0' - }) - }) - }) -})) - -function setup () { - cleanup() - fixture.create(basedir) -} - -function cleanup () { - fixture.remove(basedir) -} - -test('setup', function (t) { - setup() - mr({port: common.port, throwOnUnmatched: true}, function (err, s) { - if (err) throw err - server = s - t.done() - }) -}) - -test('update fixes broken links', function (t) { - common.npm(['update'], conf, function (err, code, stdout, stderr) { - if (err) throw err - t.is(code, 0, 'command ran ok') - t.comment(stdout.trim()) - t.comment(stderr.trim()) - t.match(stdout, '+ broken@1.0.0') - t.done() - }) -}) - -test('cleanup', function (t) { - server.close() - cleanup() - t.done() -}) diff --git a/deps/npm/test/tap/upgrade-lifecycles.js b/deps/npm/test/tap/upgrade-lifecycles.js deleted file mode 100644 index 0821cacba60cd9..00000000000000 --- a/deps/npm/test/tap/upgrade-lifecycles.js +++ /dev/null @@ -1,88 +0,0 @@ -'use strict' -var path = require('path') -var test = require('tap').test -var Tacks = require('tacks') -var File = Tacks.File -var Dir = Tacks.Dir -var common = require('../common-tap.js') - -var basedir = common.pkg -var testdir = path.join(basedir, 'testdir') -var cachedir = common.cache -var globaldir = path.join(basedir, 'global') -var tmpdir = path.join(basedir, 'tmp') - -var conf = { - cwd: testdir, - env: Object.assign({ - npm_config_cache: cachedir, - npm_config_tmp: tmpdir, - npm_config_prefix: globaldir, - npm_config_registry: common.registry, - npm_config_loglevel: 'warn' - }, process.env) -} - -var cycler = { - name: 'cycler', - version: '1.0.0', - scripts: { - uninstall: 'echo #UNINSTALL#', - install: 'echo #INSTALL#' - } -} - -var fixture = new Tacks(Dir({ - cache: Dir(), - global: Dir(), - tmp: Dir(), - testdir: Dir({ - 'cycler': Dir({ - 'package.json': File(cycler) - }), - node_modules: Dir({ - 'cycler': Dir({ - 'package.json': File(cycler) - }) - }), - 'package.json': File({ - name: 'upgrade-lifecycles', - version: '1.0.0', - dependencies: { - 'cycler': 'file:cycler' - } - }) - }) -})) - -function setup () { - cleanup() - fixture.create(basedir) -} - -function cleanup () { - fixture.remove(basedir) -} - -test('setup', function (t) { - setup() - t.done() -}) - -test('upgrade-lifecycles', function (t) { - common.npm(['install', 'file:cycler'], conf, function (err, code, stdout, stderr) { - if (err) throw err - t.is(code, 0, 'command ran ok') - - t.comment(stdout.trim()) - t.comment(stderr.trim()) - t.match(stdout, /#INSTALL#/, 'ran install lifecycle') - t.match(stdout, /#UNINSTALL#/, 'ran uninstall lifecycle') - t.done() - }) -}) - -test('cleanup', function (t) { - cleanup() - t.done() -}) diff --git a/deps/npm/test/tap/url-dependencies.js b/deps/npm/test/tap/url-dependencies.js deleted file mode 100644 index 14da5d1fc4fc7e..00000000000000 --- a/deps/npm/test/tap/url-dependencies.js +++ /dev/null @@ -1,61 +0,0 @@ -var fs = require('graceful-fs') -var path = require('path') - -var mr = require('npm-registry-mock') -var test = require('tap').test - -var common = require('../common-tap') - -var pkg = common.pkg - -var json = { - author: 'Steve Mason', - name: 'url-dependencies', - version: '0.0.0', - dependencies: { - underscore: common.registry + '/underscore/-/underscore-1.3.1.tgz' - } -} - -var mockRoutes = { - 'get': { - '/underscore/-/underscore-1.3.1.tgz': [200] - } -} - -const tarballWasFetched = output => output.includes( - `GET 200 ${common.registry}/underscore/-/underscore-1.3.1.tgz`) - -const performInstall = () => common.npm(['install'], { - cwd: pkg, - env: { - npm_config_registry: common.registry, - npm_config_cache_lock_stale: 1000, - npm_config_cache_lock_wait: 1000, - npm_config_loglevel: 'http', - HOME: process.env.HOME, - Path: process.env.PATH, - PATH: process.env.PATH - } -}) - -test('setup', function (t) { - fs.writeFileSync( - path.join(pkg, 'package.json'), - JSON.stringify(json, null, 2) - ) - mr({ port: common.port, mocks: mockRoutes }, function (er, s) { - t.parent.teardown(() => s.close()) - t.end() - }) -}) - -test('url-dependencies: download first time', t => - performInstall().then(([code, _, output]) => { - t.equal(code, 0, 'exited successfully') - t.ok(tarballWasFetched(output), 'download first time') - }) - .then(() => performInstall()).then(([code, _, output]) => { - t.equal(code, 0, 'exited successfully') - t.notOk(tarballWasFetched(output), 'do not download second time') - })) diff --git a/deps/npm/test/tap/utils.funding.js b/deps/npm/test/tap/utils.funding.js deleted file mode 100644 index 4276f3e43a5cfe..00000000000000 --- a/deps/npm/test/tap/utils.funding.js +++ /dev/null @@ -1,657 +0,0 @@ -'use strict' - -const { test } = require('tap') -const { retrieveFunding, getFundingInfo } = require('../../lib/utils/funding') - -test('empty tree', (t) => { - t.deepEqual( - getFundingInfo({}), - { - name: null, - dependencies: {}, - length: 0 - }, - 'should return empty list' - ) - t.end() -}) - -test('single item missing funding', (t) => { - t.deepEqual( - getFundingInfo({ name: 'project', - dependencies: { - 'single-item': { - name: 'single-item', - version: '1.0.0' - } - }}), - { - name: 'project', - dependencies: {}, - length: 0 - }, - 'should return empty list' - ) - t.end() -}) - -test('funding object missing url', (t) => { - t.deepEqual( - getFundingInfo({ name: 'project', - dependencies: { - 'single-item': { - name: 'single-item', - version: '1.0.0', - funding: { - type: 'Foo' - } - } - }}), - { - name: 'project', - dependencies: {}, - length: 0 - }, - 'should return empty list' - ) - t.end() -}) - -test('use path if name is missing', (t) => { - t.deepEqual( - getFundingInfo({ name: undefined, - path: '/tmp/foo', - children: { - 'single-item': { - name: 'single-item', - version: '1.0.0' - } - }}), - { - name: '/tmp/foo', - dependencies: {}, - length: 0 - }, - 'should use path as top level name' - ) - t.end() -}) - -test('single item tree', (t) => { - t.deepEqual( - getFundingInfo({ name: 'project', - dependencies: { - 'single-item': { - name: 'single-item', - version: '1.0.0', - funding: { - type: 'foo', - url: 'http://example.com' - } - } - }}), - { - name: 'project', - dependencies: { - 'single-item': { - version: '1.0.0', - funding: { - type: 'foo', - url: 'http://example.com' - } - } - }, - length: 1 - }, - 'should return list with a single item' - ) - t.end() -}) - -test('top-level funding info', (t) => { - t.deepEqual( - getFundingInfo({ name: 'project', - funding: 'http://example.com' - }), - { - name: 'project', - funding: { - url: 'http://example.com' - }, - dependencies: {}, - length: 0 - }, - 'should return top-level item with normalized funding info' - ) - t.end() -}) - -test('use string shorthand', (t) => { - t.deepEqual( - getFundingInfo({ name: 'project', - dependencies: { - 'single-item': { - name: 'single-item', - version: '1.0.0', - funding: 'http://example.com' - } - }}), - { - name: 'project', - dependencies: { - 'single-item': { - version: '1.0.0', - funding: { - url: 'http://example.com' - } - } - }, - length: 1 - }, - 'should return item with normalized funding info' - ) - t.end() -}) - -test('duplicate items along the tree', (t) => { - t.deepEqual( - getFundingInfo({ name: 'project', - version: '2.3.4', - dependencies: { - 'single-item': { - name: 'single-item', - version: '1.0.0', - funding: { - type: 'foo', - url: 'https://example.com' - }, - dependencies: { - 'shared-top-first': { - name: 'shared-top-first', - version: '1.0.0', - funding: { - type: 'foo', - url: 'https://example.com' - } - }, - 'sub-dep': { - name: 'sub-dep', - version: '1.0.0', - funding: { - type: 'foo', - url: 'https://example.com' - }, - dependencies: { - 'shared-nested-first': { - name: 'shared-nested-first', - version: '1.0.0', - funding: { - type: 'foo', - url: 'https://example.com' - }, - dependencies: { - 'shared-top-first': { - name: 'shared-top-first', - version: '1.0.0', - funding: { - type: 'foo', - url: 'https://example.com' - } - } - } - } - } - }, - 'shared-nested-first': { - name: 'shared-nested-first', - version: '1.0.0', - funding: { - type: 'foo', - url: 'https://example.com' - } - } - } - } - }}), - { - name: 'project', - version: '2.3.4', - dependencies: { - 'single-item': { - version: '1.0.0', - funding: { - type: 'foo', - url: 'https://example.com' - }, - dependencies: { - 'shared-top-first': { - version: '1.0.0', - funding: { - type: 'foo', - url: 'https://example.com' - } - }, - 'sub-dep': { - version: '1.0.0', - funding: { - type: 'foo', - url: 'https://example.com' - } - }, - 'shared-nested-first': { - version: '1.0.0', - funding: { - type: 'foo', - url: 'https://example.com' - } - } - } - } - }, - length: 4 - }, - 'should return list with a single item' - ) - t.end() -}) - -test('multi-level nested items tree', (t) => { - t.deepEqual( - getFundingInfo({ name: 'project', - dependencies: { - 'first-level-dep': { - name: 'first-level-dep', - version: '1.0.0', - funding: { - type: 'foo', - url: 'https://example.com' - }, - dependencies: { - 'sub-dep': { - name: 'sub-dep', - version: '1.0.0', - funding: { - type: 'foo', - url: 'https://example.com' - }, - dependencies: { - package: { - name: 'sub-sub-dep', - version: '1.0.0', - funding: { - type: 'foo', - url: 'https://example.com' - }, - dependencies: {} - } - } - } - } - } - }}), - { - name: 'project', - dependencies: { - 'first-level-dep': { - version: '1.0.0', - funding: { - type: 'foo', - url: 'https://example.com' - }, - dependencies: { - 'sub-dep': { - version: '1.0.0', - funding: { - type: 'foo', - url: 'https://example.com' - }, - dependencies: { - 'sub-sub-dep': { - version: '1.0.0', - funding: { - type: 'foo', - url: 'https://example.com' - } - } - } - } - } - } - }, - length: 3 - }, - 'should return list with all items' - ) - t.end() -}) - -test('missing fund nested items tree', (t) => { - t.deepEqual( - getFundingInfo({ name: 'project', - dependencies: { - 'first-level-dep': { - name: 'first-level-dep', - version: '1.0.0', - funding: { - type: 'foo' - }, - dependencies: { - 'sub-dep': { - name: 'sub-dep', - version: '1.0.0', - dependencies: { - 'sub-sub-dep-01': { - name: 'sub-sub-dep-01', - version: '1.0.0', - funding: { - type: 'foo', - url: 'https://example.com' - }, - dependencies: { - 'non-funding-child': { - name: 'non-funding-child', - version: '1.0.0', - dependencies: { - 'sub-sub-sub-dep': { - name: 'sub-sub-sub-dep', - version: '1.0.0', - funding: { - type: 'foo', - url: 'https://example.com' - } - } - } - } - } - }, - 'sub-sub-dep-02': { - name: 'sub-sub-dep-02', - version: '1.0.0', - funding: { - type: 'foo', - url: 'https://example.com' - }, - dependencies: {} - }, - 'sub-sub-dep-03': { - name: 'sub-sub-dep-03', - version: '1.0.0', - funding: { - type: 'foo', - url: 'git://example.git' - }, - dependencies: { - 'sub-sub-sub-dep-03': { - name: 'sub-sub-sub-dep-03', - version: '1.0.0', - dependencies: { - 'sub-sub-sub-sub-dep': { - name: 'sub-sub-sub-sub-dep', - version: '1.0.0', - funding: { - type: 'foo', - url: 'http://example.com' - } - } - } - } - } - } - } - } - } - } - }}), - { - name: 'project', - dependencies: { - 'sub-sub-dep-01': { - version: '1.0.0', - funding: { - type: 'foo', - url: 'https://example.com' - }, - dependencies: { - 'sub-sub-sub-dep': { - version: '1.0.0', - funding: { - type: 'foo', - url: 'https://example.com' - } - } - } - }, - 'sub-sub-dep-02': { - version: '1.0.0', - funding: { - type: 'foo', - url: 'https://example.com' - } - }, - 'sub-sub-sub-sub-dep': { - version: '1.0.0', - funding: { - type: 'foo', - url: 'http://example.com' - } - } - }, - length: 4 - }, - 'should return list excluding missing funding items' - ) - t.end() -}) - -test('countOnly option', (t) => { - t.deepEqual( - getFundingInfo({ name: 'project', - dependencies: { - 'first-level-dep': { - name: 'first-level-dep', - version: '1.0.0', - funding: { - type: 'foo' - }, - dependencies: { - 'sub-dep': { - name: 'sub-dep', - version: '1.0.0', - funding: { - type: 'foo', - url: 'https://example.com' - }, - dependencies: { - 'sub-sub-dep': { - name: 'sub-sub-dep', - version: '1.0.0', - funding: { - type: 'foo', - url: 'https://example.com' - } - }, - dependencies: {} - } - }, - 'sub-sub-dep': { - name: 'sub-sub-dep', - version: '1.0.0', - funding: { - type: 'foo', - url: 'https://example.com' - } - } - } - } - }}, { countOnly: true }), - { - length: 2 - }, - 'should return only the length property' - ) - t.end() -}) - -test('handle different versions', (t) => { - t.deepEqual( - getFundingInfo({ name: 'project', - dependencies: { - foo: { - name: 'foo', - version: '1.0.0', - funding: { - type: 'foo', - url: 'https://example.com' - }, - dependencies: { - bar: { - name: 'bar', - version: '1.0.0', - funding: { - type: 'foo', - url: 'https://example.com' - } - } - } - }, - lorem: { - dependencies: { - fooo: { - name: 'foo', - version: '2.0.0', - funding: { - type: 'foo', - url: 'https://example.com' - }, - dependencies: { - 'foo-bar': { - name: 'foo-bar', - version: '1.0.0', - funding: { - type: 'foo', - url: 'https://example.com' - } - } - } - } - } - } - } - }, { countOnly: true }), - { - length: 4 - }, - 'should treat different versions as diff packages' - ) - t.end() -}) - -test('retrieve funding info from valid objects', (t) => { - t.deepEqual( - retrieveFunding({ - url: 'http://example.com', - type: 'Foo' - }), - { - url: 'http://example.com', - type: 'Foo' - }, - 'should return standard object fields' - ) - t.deepEqual( - retrieveFunding({ - extra: 'Foo', - url: 'http://example.com', - type: 'Foo' - }), - { - extra: 'Foo', - url: 'http://example.com', - type: 'Foo' - }, - 'should leave untouched extra fields' - ) - t.deepEqual( - retrieveFunding({ - url: 'http://example.com' - }), - { - url: 'http://example.com' - }, - 'should accept url-only objects' - ) - t.end() -}) - -test('retrieve funding info from invalid objects', (t) => { - t.deepEqual( - retrieveFunding({}), - {}, - 'should passthrough empty objects' - ) - t.deepEqual( - retrieveFunding(), - undefined, - 'should not care about undefined' - ) - t.deepEqual( - retrieveFunding(), - null, - 'should not care about null' - ) - t.end() -}) - -test('retrieve funding info string shorthand', (t) => { - t.deepEqual( - retrieveFunding('http://example.com'), - { - url: 'http://example.com' - }, - 'should accept string shorthand' - ) - t.end() -}) - -test('retrieve funding info from an array', (t) => { - t.deepEqual( - retrieveFunding([ - 'http://example.com', - { - url: 'http://two.example.com' - }, - 'http://three.example.com', - { - url: 'http://three.example.com', - type: 'dos' - }, - { - url: 'http://three.example.com', - type: 'third copy!', - extra: 'extra metadata!' - } - ]), - [ - { - url: 'http://example.com' - }, - { - url: 'http://two.example.com' - }, - { - url: 'http://three.example.com' - }, - { - url: 'http://three.example.com', - type: 'dos' - }, - { - url: 'http://three.example.com', - type: 'third copy!', - extra: 'extra metadata!' - } - ], - 'should accept and normalize multiple funding sources' - ) - t.end() -}) diff --git a/deps/npm/test/tap/verify-no-lifecycle-on-repo.js b/deps/npm/test/tap/verify-no-lifecycle-on-repo.js deleted file mode 100644 index c9232715a7079c..00000000000000 --- a/deps/npm/test/tap/verify-no-lifecycle-on-repo.js +++ /dev/null @@ -1,73 +0,0 @@ -'use strict' -var path = require('path') -var fs = require('graceful-fs') -var mkdirp = require('mkdirp') -var rimraf = require('rimraf') -var test = require('tap').test -var requireInject = require('require-inject') -const common = require('../common-tap.js') - -var base = common.pkg - -var baseJSON = { - name: 'base', - version: '1.0.0', - repository: { - type: 'git', - url: 'http://example.com' - }, - scripts: { - prepublish: 'false' - } -} - -var lastOpened -var npm = requireInject.installGlobally('../../lib/npm.js', { - '../../lib/utils/lifecycle.js': function (pkg, stage, wd, moreOpts, cb) { - if (typeof moreOpts === 'function') { - cb = moreOpts - } - - cb(new Error("Shouldn't be calling lifecycle scripts")) - }, - opener: function (url, options, cb) { - lastOpened = {url: url, options: options} - cb() - } -}) - -test('setup', function (t) { - cleanup() - setup() - t.end() -}) - -test('repo', function (t) { - process.chdir(base) - npm.load({browser: 'echo'}, function () { - npm.commands.repo([], function (err) { - t.ifError(err, 'no errors') - t.match(lastOpened.url, baseJSON.repository.url, 'opened the right url') - t.is(lastOpened.options.command, 'echo', 'opened with a specified browser') - t.end() - }) - }) -}) - -test('cleanup', function (t) { - cleanup() - t.end() -}) - -function saveJson (pkgPath, json) { - mkdirp.sync(pkgPath) - fs.writeFileSync(path.join(pkgPath, 'package.json'), JSON.stringify(json, null, 2)) -} - -function setup () { - saveJson(base, baseJSON) -} - -function cleanup () { - rimraf.sync(base) -} diff --git a/deps/npm/test/tap/version-allow-same-version.js b/deps/npm/test/tap/version-allow-same-version.js deleted file mode 100644 index 14506aac7d9285..00000000000000 --- a/deps/npm/test/tap/version-allow-same-version.js +++ /dev/null @@ -1,70 +0,0 @@ -const fs = require('graceful-fs') -const path = require('path') -const t = require('tap') -const common = require('../common-tap.js') -const npm = require('../../') -const pkg = common.pkg -const cache = common.cache -const npmrc = path.resolve(pkg, './.npmrc') -const configContents = 'sign-git-tag=false\n' - -t.test('setup', t => { - process.chdir(pkg) - fs.writeFileSync(npmrc, configContents, 'ascii') - fs.writeFileSync(path.resolve(pkg, 'package.json'), JSON.stringify({ - author: 'Lucas Theisen', - name: 'version-allow-same-version', - version: '0.0.1', - description: 'Test for npm version without --allow-same-version' - }), 'utf8') - npm.load({cache: cache, 'allow-same-version': false, registry: common.registry}, t.end) -}) - -t.test('without --allow-same-version', t => { - npm.config.set('allow-same-version', false) - - const version = require('../../lib/version') - - const commit1 = version.buildCommitArgs() - const commit2 = version.buildCommitArgs([ 'commit' ]) - const commit3 = version.buildCommitArgs([ 'commit', '-m', 'some commit message' ]) - - t.same(commit1, [ 'commit' ]) - t.same(commit2, [ 'commit' ]) - t.same(commit3, [ 'commit', '-m', 'some commit message' ]) - - const tag = version.buildTagFlags() - - t.same(tag, '-m') - - npm.commands.version(['0.0.1'], function (err) { - t.isa(err, Error, 'got an error') - t.like(err.message, /Version not changed/) - t.end() - }) -}) - -t.test('with --allow-same-version', t => { - npm.config.set('allow-same-version', true) - - const version = require('../../lib/version') - - const commit1 = version.buildCommitArgs() - const commit2 = version.buildCommitArgs([ 'commit' ]) - const commit3 = version.buildCommitArgs([ 'commit', '-m', 'some commit message' ]) - - t.same(commit1, [ 'commit', '--allow-empty' ]) - t.same(commit2, [ 'commit', '--allow-empty' ]) - t.same(commit3, [ 'commit', '--allow-empty', '-m', 'some commit message' ]) - - const tag = version.buildTagFlags() - - t.same(tag, '-fm') - - npm.commands.version(['0.0.1'], function (err) { - if (err) { - throw err - } - t.end() - }) -}) diff --git a/deps/npm/test/tap/version-commit-hooks-default.js b/deps/npm/test/tap/version-commit-hooks-default.js deleted file mode 100644 index 890aa554101637..00000000000000 --- a/deps/npm/test/tap/version-commit-hooks-default.js +++ /dev/null @@ -1,13 +0,0 @@ -var test = require('tap').test -var npm = require('../../') - -// This test has to be separate from `version-commit-hooks.js`, due to -// mutual exclusivity with the first test in that file. Initial configuration -// seems to only work as expected for defaults during the first `npm.load()`. - -test('npm config `commit-hooks` defaults to `true`', function (t) { - npm.load({}, function () { - t.same(npm.config.get('commit-hooks'), true) - t.end() - }) -}) diff --git a/deps/npm/test/tap/version-commit-hooks.js b/deps/npm/test/tap/version-commit-hooks.js deleted file mode 100644 index 36694d7eae9591..00000000000000 --- a/deps/npm/test/tap/version-commit-hooks.js +++ /dev/null @@ -1,55 +0,0 @@ -const fs = require('graceful-fs') -const path = require('path') -const common = require('../common-tap.js') -const pkg = common.pkg - -var test = require('tap').test -var npm = require('../../') - -delete process.env['npm_config_commit_hooks'] - -test('npm version with commit-hooks disabled in .npmrc', function (t) { - var npmrc = path.resolve(pkg, '.npmrc') - fs.writeFileSync(npmrc, 'commit-hooks=false\n', 'ascii') - process.chdir(pkg) - - npm.load({ prefix: pkg, userconfig: npmrc }, function (err, conf) { - if (err) { - t.fail('error loading npm') - } - t.same(npm.config.get('commit-hooks'), false) - t.end() - }) -}) - -test('npm version with commit-hooks disabled', function (t) { - npm.load({}, function () { - npm.config.set('commit-hooks', false) - - var version = require('../../lib/version') - var args1 = version.buildCommitArgs() - var args2 = version.buildCommitArgs([ 'commit' ]) - var args3 = version.buildCommitArgs([ 'commit', '-m', 'some commit message' ]) - - t.same(args1, [ 'commit', '-n' ]) - t.same(args2, [ 'commit', '-n' ]) - t.same(args3, [ 'commit', '-n', '-m', 'some commit message' ]) - t.end() - }) -}) - -test('npm version with commit-hooks enabled (default)', function (t) { - npm.load({}, function () { - npm.config.set('commit-hooks', true) - - var version = require('../../lib/version') - var args1 = version.buildCommitArgs() - var args2 = version.buildCommitArgs([ 'commit' ]) - var args3 = version.buildCommitArgs([ 'commit', '-m', 'some commit message' ]) - - t.same(args1, [ 'commit' ]) - t.same(args2, [ 'commit' ]) - t.same(args3, [ 'commit', '-m', 'some commit message' ]) - t.end() - }) -}) diff --git a/deps/npm/test/tap/version-consistent-newlines.js b/deps/npm/test/tap/version-consistent-newlines.js deleted file mode 100644 index 583874db7a3051..00000000000000 --- a/deps/npm/test/tap/version-consistent-newlines.js +++ /dev/null @@ -1,80 +0,0 @@ -'use strict' - -const common = require('../common-tap.js') -const test = require('tap').test -const npm = require('../../') -const path = require('path') -const fs = require('fs') -const mkdirp = require('mkdirp') -const requireInject = require('require-inject') - -const pkg = common.pkg -const cache = common.cache -const gitDir = path.resolve(pkg, '.git') - -test('npm version does not alter the line endings in package.json (LF)', function (t) { - setup('\n') - - npm.load({cache: cache, registry: common.registry}, function () { - const version = requireInject('../../lib/version', { - which: function (cmd, cb) { - process.nextTick(function () { - cb(new Error('ENOGIT!')) - }) - } - }) - - version(['patch'], function (err) { - if (!t.error(err)) return t.end() - - const pkgPath = path.resolve(pkg, 'package.json') - const pkgStr = fs.readFileSync(pkgPath, 'utf8') - - t.match(pkgStr, '\n') - t.notMatch(pkgStr, '\r') - - t.end() - }) - }) -}) - -test('npm version does not alter the line endings in package.json (CRLF)', function (t) { - setup('\r\n') - - npm.load({cache: cache, registry: common.registry}, function () { - const version = requireInject('../../lib/version', { - which: function (cmd, cb) { - process.nextTick(function () { - cb(new Error('ENOGIT!')) - }) - } - }) - - version(['patch'], function (err) { - if (!t.error(err)) return t.end() - - const pkgPath = path.resolve(pkg, 'package.json') - const pkgStr = fs.readFileSync(pkgPath, 'utf8') - - t.match(pkgStr, '\r\n') - t.notMatch(pkgStr, /[^\r]\n/) - - t.end() - }) - }) -}) - -function setup (lineEnding) { - mkdirp.sync(gitDir) - fs.writeFileSync( - path.resolve(pkg, 'package.json'), - JSON.stringify({ - author: 'Terin Stock', - name: 'version-no-git-test', - version: '0.0.0', - description: "Test for npm version if git binary doesn't exist" - }, null, 2).replace(/\n/g, lineEnding), - 'utf8' - ) - process.chdir(pkg) -} diff --git a/deps/npm/test/tap/version-from-git.js b/deps/npm/test/tap/version-from-git.js deleted file mode 100644 index e63865a73378a4..00000000000000 --- a/deps/npm/test/tap/version-from-git.js +++ /dev/null @@ -1,220 +0,0 @@ -var common = require('../common-tap.js') -var fs = require('fs') -var path = require('path') - -var mkdirp = require('mkdirp') -var rimraf = require('rimraf') -var test = require('tap').test - -var npm = require('../../lib/npm.js') - -var pkg = common.pkg -var packagePath = path.resolve(pkg, 'package.json') -var cache = common.cache - -var json = { name: 'cat', version: '0.1.2' } - -test('npm version from-git with a valid tag creates a new commit', function (t) { - var version = '1.2.3' - setup() - createTag(t, version, runVersion) - - function runVersion (er) { - t.ifError(er, 'git tag ran without error') - npm.config.set('sign-git-commit', false) - npm.config.set('sign-git-tag', false) - npm.commands.version(['from-git'], checkVersion) - } - - function checkVersion (er) { - var git = require('../../lib/utils/git.js') - t.ifError(er, 'version command ran without error') - git.whichAndExec( - ['log'], - { cwd: pkg, env: process.env }, - checkCommit - ) - } - - function checkCommit (er, log, stderr) { - t.ifError(er, 'git log ran without issue') - t.notOk(stderr, 'no error output') - t.ok(log.indexOf(version) !== -1, 'commit was created') - t.end() - } -}) - -test('npm version from-git with a valid tag updates the package.json version', function (t) { - var version = '1.2.3' - setup() - createTag(t, version, runVersion) - - function runVersion (er) { - t.ifError(er, 'git tag ran without error') - npm.config.set('sign-git-commit', false) - npm.config.set('sign-git-tag', false) - npm.commands.version(['from-git'], checkManifest) - } - - function checkManifest (er) { - t.ifError(er, 'npm run version ran without error') - fs.readFile(path.resolve(pkg, 'package.json'), 'utf8', function (er, data) { - t.ifError(er, 'read manifest without error') - var manifest = JSON.parse(data) - t.equal(manifest.version, version, 'updated the package.json version') - t.done() - }) - } -}) - -test('npm version from-git strips tag-version-prefix', function (t) { - var version = '1.2.3' - var prefix = 'custom-' - var tag = prefix + version - setup() - createTag(t, tag, runVersion) - - function runVersion (er) { - t.ifError(er, 'git tag ran without error') - npm.config.set('sign-git-commit', false) - npm.config.set('sign-git-tag', false) - npm.config.set('tag-version-prefix', prefix) - npm.commands.version(['from-git'], checkVersion) - } - - function checkVersion (er) { - var git = require('../../lib/utils/git.js') - t.ifError(er, 'version command ran without error') - git.whichAndExec( - ['log', '--pretty=medium'], - { cwd: pkg, env: process.env }, - checkCommit - ) - } - - function checkCommit (er, log, stderr) { - t.ifError(er, 'git log ran without issue') - t.notOk(stderr, 'no error output') - t.ok(log.indexOf(tag) === -1, 'commit should not include prefix') - t.ok(log.indexOf(version) !== -1, 'commit should include version') - t.end() - } -}) - -test('npm version from-git only strips tag-version-prefix if it is a prefix', function (t) { - var prefix = 'test' - var version = '1.2.3-' + prefix - setup() - createTag(t, version, runVersion) - - function runVersion (er) { - t.ifError(er, 'git tag ran without error') - npm.config.set('sign-git-commit', false) - npm.config.set('sign-git-tag', false) - npm.config.set('tag-version-prefix', prefix) - npm.commands.version(['from-git'], checkVersion) - } - - function checkVersion (er) { - var git = require('../../lib/utils/git.js') - t.ifError(er, 'version command ran without error') - git.whichAndExec( - ['log'], - { cwd: pkg, env: process.env }, - checkCommit - ) - } - - function checkCommit (er, log, stderr) { - t.ifError(er, 'git log ran without issue') - t.notOk(stderr, 'no error output') - t.ok(log.indexOf(version) !== -1, 'commit should include the full version') - t.end() - } -}) - -test('npm version from-git with an existing version', function (t) { - var tag = 'v' + json.version - setup() - createTag(t, tag, runVersion) - - function runVersion (er) { - t.ifError(er, 'git tag ran without error') - npm.config.set('sign-git-commit', false) - npm.config.set('sign-git-tag', false) - npm.commands.version(['from-git'], checkVersion) - } - - function checkVersion (er) { - t.like(er.message, /Version not changed/) - t.done() - } -}) - -test('npm version from-git with an invalid version tag', function (t) { - var tag = 'invalidversion' - setup() - createTag(t, tag, runVersion) - - function runVersion (er) { - t.ifError(er, 'git tag ran without error') - npm.config.set('sign-git-commit', false) - npm.config.set('sign-git-tag', false) - npm.commands.version(['from-git'], checkVersion) - } - - function checkVersion (er) { - t.equal(er.message, tag + ' is not a valid version') - t.done() - } -}) - -test('npm version from-git without any versions', function (t) { - setup() - createGitRepo(t, runVersion) - - function runVersion (er) { - t.ifError(er, 'created git repo without errors') - npm.config.set('sign-git-commit', false) - npm.config.set('sign-git-tag', false) - npm.commands.version(['from-git'], checkVersion) - } - - function checkVersion (er) { - t.equal(er.message, 'No tags found') - t.done() - } -}) - -function setup () { - process.chdir(__dirname) - rimraf.sync(pkg) - mkdirp.sync(pkg) - process.chdir(pkg) - fs.writeFileSync(packagePath, JSON.stringify(json), 'utf8') -} - -function createGitRepo (t, cb) { - npm.load({ cache: cache }, function (er) { - t.ifError(er, 'npm load ran without issue') - common.makeGitRepo({ - path: pkg, - added: ['package.json'] - }, cb) - }) -} - -function createTag (t, tag, cb) { - var opts = { cwd: pkg, env: { PATH: process.env.PATH } } - npm.load({ cache: cache }, function (er) { - t.ifError(er, 'npm load ran without issue') - - // git must be called after npm.load because it uses config - var git = require('../../lib/utils/git.js') - common.makeGitRepo({ - path: pkg, - added: ['package.json'], - commands: [git.chainableExec(['tag', tag, '-am', tag], opts)] - }, cb) - }) -} diff --git a/deps/npm/test/tap/version-git-not-clean.js b/deps/npm/test/tap/version-git-not-clean.js deleted file mode 100644 index 486e2e0766181d..00000000000000 --- a/deps/npm/test/tap/version-git-not-clean.js +++ /dev/null @@ -1,79 +0,0 @@ -var common = require('../common-tap.js') -var test = require('tap').test -var npm = require('../../') -var fs = require('fs') -var which = require('which') -var spawn = require('child_process').spawn - -var pkg = common.pkg -var cache = common.cache - -test('npm version with working directory not clean', function (t) { - process.chdir(pkg) - npm.load({ cache: cache, registry: common.registry, prefix: pkg }, function () { - which('git', function (err, git) { - t.ifError(err, 'git found') - - function addPackageJSON (_cb) { - var data = JSON.stringify({ name: 'blah', version: '0.1.2' }) - fs.writeFile('package.json', data, function () { - var child = spawn(git, ['add', 'package.json']) - child.on('exit', function () { - var child2 = spawn(git, ['commit', 'package.json', '-m', 'init']) - var out = '' - child2.stdout.on('data', function (d) { - out += d.toString() - }) - child2.on('exit', function () { - return _cb(out) - }) - }) - }) - } - - common.makeGitRepo({path: pkg}, function () { - addPackageJSON(function () { - var data = JSON.stringify({ name: 'blah', version: '0.1.3' }) - fs.writeFile('package.json', data, function () { - npm.commands.version(['patch'], function (err) { - if (!err) { - t.fail('should fail on non-clean working directory') - } else { - t.ok(err.message.match(/Git working directory not clean./)) - t.ok(err.message.match(/M package.json/)) - } - t.end() - }) - }) - }) - }) - }) - }) -}) - -test('npm version --force with working directory not clean', function (t) { - common.npm( - [ - '--force', - '--no-sign-git-commit', - '--no-sign-git-tag', - '--registry', common.registry, - '--prefix', pkg, - 'version', - 'patch' - ], - { cwd: pkg, env: {PATH: process.env.PATH} }, - function (err, code, stdout, stderr) { - t.ifError(err, 'npm version ran without issue') - t.notOk(code, 'exited with a non-error code') - var errorLines = stderr.trim().split('\n') - .map(function (line) { - return line.trim() - }) - .filter(function (line) { - return !line.indexOf('using --force') - }) - t.notOk(errorLines.length, 'no error output') - t.end() - }) -}) diff --git a/deps/npm/test/tap/version-lifecycle.js b/deps/npm/test/tap/version-lifecycle.js deleted file mode 100644 index 590ae86aa4b021..00000000000000 --- a/deps/npm/test/tap/version-lifecycle.js +++ /dev/null @@ -1,202 +0,0 @@ -var fs = require('graceful-fs') -var path = require('path') - -var mkdirp = require('mkdirp') -var rimraf = require('rimraf') -var test = require('tap').test - -var common = require('../common-tap.js') -var npm = require('../../') -var pkg = common.pkg -var cache = common.cache -var npmrc = path.resolve(pkg, './.npmrc') -var configContents = 'sign-git-commit=false\nsign-git-tag=false\n' - -test('npm version with failing preversion lifecycle script', function (t) { - setup() - fs.writeFileSync(path.resolve(pkg, 'package.json'), JSON.stringify({ - author: 'Alex Wolfe', - name: 'version-lifecycle', - version: '0.0.0', - description: 'Test for npm version if preversion script fails', - scripts: { - preversion: 'node ./fail.js' - } - }), 'utf8') - fs.writeFileSync(path.resolve(pkg, 'fail.js'), 'process.exit(50)', 'utf8') - npm.load({ - cache: cache, - 'sign-git-commit': false, - 'sign-git-tag': false, - registry: common.registry - }, function () { - var version = require('../../lib/version') - version(['patch'], function (err) { - t.ok(err) - t.ok(err.message.match(/Exit status 50/)) - t.end() - }) - }) -}) - -test('npm version with failing version lifecycle script', function (t) { - setup() - fs.writeFileSync(path.resolve(pkg, 'package.json'), JSON.stringify({ - author: 'Alex Wolfe', - name: 'version-lifecycle', - version: '0.0.0', - description: 'Test for npm version if postversion script fails', - scripts: { - version: 'node ./fail.js' - } - }), 'utf8') - fs.writeFileSync(path.resolve(pkg, 'fail.js'), 'process.exit(50)', 'utf8') - npm.load({ - cache: cache, - 'sign-git-commit': false, - 'sign-git-tag': false, - registry: common.registry - }, function () { - var version = require('../../lib/version') - version(['patch'], function (err) { - t.ok(err) - t.ok(err.message.match(/Exit status 50/)) - t.end() - }) - }) -}) - -test('npm version with failing postversion lifecycle script', function (t) { - setup() - fs.writeFileSync(path.resolve(pkg, 'package.json'), JSON.stringify({ - author: 'Alex Wolfe', - name: 'version-lifecycle', - version: '0.0.0', - description: 'Test for npm version if postversion script fails', - scripts: { - postversion: 'node ./fail.js' - } - }), 'utf8') - fs.writeFileSync(path.resolve(pkg, 'fail.js'), 'process.exit(50)', 'utf8') - npm.load({ - cache: cache, - 'sign-git-commit': false, - 'sign-git-tag': false, - registry: common.registry - }, function () { - var version = require('../../lib/version') - version(['patch'], function (err) { - t.ok(err) - t.ok(err.message.match(/Exit status 50/)) - t.end() - }) - }) -}) - -test('npm version execution order', function (t) { - setup() - fs.writeFileSync(path.resolve(pkg, 'package.json'), JSON.stringify({ - author: 'Alex Wolfe', - name: 'version-lifecycle', - version: '0.0.0', - description: 'Test for npm version if postversion script fails', - scripts: { - preversion: 'node ./preversion.js', - version: 'node ./version.js', - postversion: 'node ./postversion.js' - } - }), 'utf8') - makeScript('preversion') - makeScript('version') - makeScript('postversion') - npm.load({ - cache: cache, - 'sign-git-commit': false, - 'sign-git-tag': false, - registry: common.registry - }, function () { - common.makeGitRepo({path: pkg}, function (err, git) { - t.ifError(err, 'git bootstrap ran without error') - - var version = require('../../lib/version') - version(['patch'], function (err) { - t.ifError(err, 'version command complete') - - t.equal('0.0.0', readPackage('preversion').version, 'preversion') - t.deepEqual(readStatus('preversion', t), { - 'preversion-package.json': 'A' - }) - - t.equal('0.0.1', readPackage('version').version, 'version') - t.deepEqual(readStatus('version', t), { - 'package.json': 'M', - 'preversion-package.json': 'A', - 'version-package.json': 'A' - }) - - t.equal('0.0.1', readPackage('postversion').version, 'postversion') - t.deepEqual(readStatus('postversion', t), { - 'postversion-package.json': 'A' - }) - t.end() - }) - }) - }) -}) - -function setup () { - process.chdir(__dirname) - rimraf.sync(pkg) - mkdirp.sync(pkg) - mkdirp.sync(path.join(pkg, 'node_modules')) - fs.writeFileSync(npmrc, configContents, 'ascii') - process.chdir(pkg) -} - -function makeScript (lifecycle) { - function contents (lifecycle) { - var fs = require('fs') - var exec = require('child_process').exec - fs.createReadStream('package.json') - .pipe(fs.createWriteStream(lifecycle + '-package.json')) - .on('close', function () { - exec( - 'git add ' + lifecycle + '-package.json', - function () { - exec( - 'git status --porcelain', - function (err, stdout) { - if (err) throw err - fs.writeFileSync(lifecycle + '-git.txt', stdout) - } - ) - } - ) - }) - } - var scriptPath = path.join(pkg, lifecycle + '.js') - fs.writeFileSync( - scriptPath, - '(' + contents.toString() + ')(\'' + lifecycle + '\')', - 'utf-8') -} - -function readPackage (lifecycle) { - return JSON.parse(fs.readFileSync(path.join(pkg, lifecycle + '-package.json'), 'utf-8')) -} - -function readStatus (lifecycle, t) { - var status = {} - fs.readFileSync(path.join(pkg, lifecycle + '-git.txt'), 'utf-8') - .trim() - .split('\n') - .forEach(function (line) { - line = line.trim() - if (line && !line.match(/^\?\? /)) { - var parts = line.split(/\s+/) - t.equal(parts.length, 2, lifecycle + ' : git status has too many words : ' + line) - status[parts[1].trim()] = parts[0].trim() - } - }) - return status -} diff --git a/deps/npm/test/tap/version-message-config.js b/deps/npm/test/tap/version-message-config.js deleted file mode 100644 index 94e9e951e776f0..00000000000000 --- a/deps/npm/test/tap/version-message-config.js +++ /dev/null @@ -1,58 +0,0 @@ -var common = require('../common-tap.js') -var fs = require('fs') -var path = require('path') - -var test = require('tap').test - -var npm = require('../../lib/npm.js') - -var pkg = common.pkg -var npmrc = path.resolve(pkg, '.npmrc') -var packagePath = path.resolve(pkg, 'package.json') - -var json = { name: 'blah', version: '0.1.2' } - -var configContents = 'sign-git-commit=false\nsign-git-tag=false\nmessage=":bookmark: %s"\n' - -test('npm version with message config', function (t) { - setup() - - npm.load({ prefix: pkg, userconfig: npmrc }, function () { - var git = require('../../lib/utils/git.js') - - common.makeGitRepo({ path: pkg }, function (er) { - t.ifErr(er, 'git bootstrap ran without error') - - common.npm( - [ - 'version', - 'patch', - '--loglevel', 'silent' - // package config is picked up from env - ], - { cwd: pkg, env: { PATH: process.env.PATH } }, - function (err, code, stdout, stderr) { - t.ifError(err, 'npm version ran without issue') - t.notOk(code, 'exited with a non-error code') - t.notOk(stderr, 'no error output') - - git.whichAndExec( - ['log'], - { cwd: pkg, env: process.env }, - function (er, log, stderr) { - t.ok(log.match(/:bookmark: 0\.1\.3/g), 'config was picked up by version') - t.end() - } - ) - } - ) - }) - }) -}) - -function setup () { - process.chdir(pkg) - - fs.writeFileSync(packagePath, JSON.stringify(json), 'utf8') - fs.writeFileSync(npmrc, configContents, 'ascii') -} diff --git a/deps/npm/test/tap/version-no-git.js b/deps/npm/test/tap/version-no-git.js deleted file mode 100644 index cea8b55ddcd8cb..00000000000000 --- a/deps/npm/test/tap/version-no-git.js +++ /dev/null @@ -1,43 +0,0 @@ -var common = require('../common-tap.js') -var test = require('tap').test -var npm = require('../../') -var path = require('path') -var fs = require('fs') -var mkdirp = require('mkdirp') -var requireInject = require('require-inject') - -var pkg = common.pkg -var cache = common.cache -var gitDir = path.resolve(pkg, '.git') - -test('npm version in a git repo without the git binary', function (t) { - setup() - npm.load({cache: cache, registry: common.registry}, function () { - var version = requireInject('../../lib/version', { - which: function (cmd, cb) { - process.nextTick(function () { - cb(new Error('ENOGIT!')) - }) - } - }) - - version(['patch'], function (err) { - if (!t.error(err)) return t.end() - var p = path.resolve(pkg, 'package') - var testPkg = require(p) - t.equal('0.0.1', testPkg.version, '\'' + testPkg.version + '\' === \'0.0.1\'') - t.end() - }) - }) -}) - -function setup () { - mkdirp.sync(gitDir) - fs.writeFileSync(path.resolve(pkg, 'package.json'), JSON.stringify({ - author: 'Terin Stock', - name: 'version-no-git-test', - version: '0.0.0', - description: "Test for npm version if git binary doesn't exist" - }), 'utf8') - process.chdir(pkg) -} diff --git a/deps/npm/test/tap/version-no-package.js b/deps/npm/test/tap/version-no-package.js deleted file mode 100644 index 60c0e3be7adb90..00000000000000 --- a/deps/npm/test/tap/version-no-package.js +++ /dev/null @@ -1,23 +0,0 @@ -var common = require('../common-tap.js') -var test = require('tap').test - -var pkg = common.pkg - -test('npm version in a prefix with no package.json', function (t) { - process.chdir(pkg) - common.npm( - ['version', '--json', '--prefix', pkg], - { cwd: pkg, nodeExecPath: process.execPath }, - function (er, code, stdout, stderr) { - t.ifError(er, "npm version doesn't care that there's no package.json") - t.notOk(code, 'npm version ran without barfing') - t.ok(stdout, 'got version output') - t.notOk(stderr, 'no error output') - t.doesNotThrow(function () { - var metadata = JSON.parse(stdout) - t.equal(metadata.node, process.versions.node, 'node versions match') - }, 'able to reconstitute version object from stdout') - t.end() - } - ) -}) diff --git a/deps/npm/test/tap/version-no-tags.js b/deps/npm/test/tap/version-no-tags.js deleted file mode 100644 index c2c11d875b55af..00000000000000 --- a/deps/npm/test/tap/version-no-tags.js +++ /dev/null @@ -1,58 +0,0 @@ -var common = require('../common-tap.js') -var test = require('tap').test -var npm = require('../../') -var path = require('path') -var fs = require('fs') -var which = require('which') -var spawn = require('child_process').spawn - -var pkg = common.pkg -var cache = common.cache - -test('npm version without git tag', function (t) { - setup() - npm.load({ cache: cache, registry: common.registry }, function () { - which('git', function (err, git) { - t.ifError(err, 'git found on system') - function tagExists (tag, _cb) { - var child1 = spawn(git, ['tag', '-l', tag]) - var out = '' - child1.stdout.on('data', function (d) { - out += d.toString() - }) - child1.on('exit', function () { - return _cb(null, Boolean(~out.indexOf(tag))) - }) - } - - var child2 = spawn(git, ['init']) - child2.stdout.pipe(process.stdout) - child2.on('exit', function () { - npm.config.set('git-tag-version', false) - npm.commands.version(['patch'], function (err) { - if (err) return t.fail('Error perform version patch') - var p = path.resolve(pkg, 'package') - var testPkg = require(p) - if (testPkg.version !== '0.0.1') t.fail(testPkg.version + ' !== \'0.0.1\'') - t.equal('0.0.1', testPkg.version) - tagExists('v0.0.1', function (err, exists) { - t.ifError(err, 'tag found to exist') - t.equal(exists, false, 'git tag DOES exist') - t.pass('git tag does not exist') - t.end() - }) - }) - }) - }) - }) -}) - -function setup () { - fs.writeFileSync(path.resolve(pkg, 'package.json'), JSON.stringify({ - author: 'Evan Lucas', - name: 'version-no-tags-test', - version: '0.0.0', - description: 'Test for git-tag-version flag' - }), 'utf8') - process.chdir(pkg) -} diff --git a/deps/npm/test/tap/version-prerelease-id.js b/deps/npm/test/tap/version-prerelease-id.js deleted file mode 100644 index 0e248423cd052f..00000000000000 --- a/deps/npm/test/tap/version-prerelease-id.js +++ /dev/null @@ -1,37 +0,0 @@ -var fs = require('fs') -var path = require('path') - -var test = require('tap').test - -var npm = require('../../') -var common = require('../common-tap.js') - -var pkg = common.pkg - -var EXEC_OPTS = { cwd: pkg } - -test('npm version --preid=rc uses prerelease id', function (t) { - setup() - - npm.load({ cache: pkg + '/cache', registry: common.registry }, function () { - common.npm(['version', 'prerelease', '--preid=rc'], EXEC_OPTS, function (err) { - if (err) return t.fail('Error perform version prerelease') - var newVersion = require(path.resolve(pkg, 'package.json')).version - t.equal(newVersion, '0.0.1-rc.0', 'got expected version') - t.end() - }) - }) -}) - -function setup () { - var contents = { - author: 'Daniel Wilches', - name: 'version-prerelease-id', - version: '0.0.0', - description: 'Test for version of prereleases with preids' - } - - fs.writeFileSync(path.resolve(pkg, 'package.json'), JSON.stringify(contents), 'utf8') - fs.writeFileSync(path.resolve(pkg, 'npm-shrinkwrap.json'), JSON.stringify(contents), 'utf8') - process.chdir(pkg) -} diff --git a/deps/npm/test/tap/version-sub-directory-shrinkwrap.js b/deps/npm/test/tap/version-sub-directory-shrinkwrap.js deleted file mode 100644 index 5f2d688f42ba5a..00000000000000 --- a/deps/npm/test/tap/version-sub-directory-shrinkwrap.js +++ /dev/null @@ -1,65 +0,0 @@ -var common = require('../common-tap.js') -var fs = require('fs') -var path = require('path') - -var mkdirp = require('mkdirp') -var test = require('tap').test - -var npm = require('../../lib/npm.js') - -var pkg = common.pkg -var subDirectory = path.resolve(pkg, 'sub-directory') -var packagePath = path.resolve(pkg, 'package.json') -var shrinkwrapPath = path.resolve(pkg, 'npm-shrinkwrap.json') -var cache = common.cache - -var json = { name: 'cat', version: '0.1.2' } - -test('npm version from a subdirectory', function (t) { - setup() - npmLoad() - - function npmLoad () { - npm.load({ cache: cache }, function () { - common.makeGitRepo({ - path: pkg, - added: ['package.json', 'npm-shrinkwrap.json'] - }, version) - }) - } - - function version (er, stdout, stderr) { - t.ifError(er, 'git repo initialized without issue') - t.notOk(stderr, 'no error output') - npm.config.set('sign-git-tag', false) - npm.commands.version(['patch'], checkVersion) - } - - function checkVersion (er) { - var newShrinkwrap = JSON.parse(fs.readFileSync(shrinkwrapPath)) - t.is(newShrinkwrap.version, '0.1.3', 'shrinkwrap has right version') - var newPackage = JSON.parse(fs.readFileSync(packagePath)) - t.is(newPackage.version, '0.1.3', 'package.json has right version') - var git = require('../../lib/utils/git.js') - t.ifError(er, 'version command ran without error') - git.whichAndExec( - ['log'], - { cwd: pkg, env: process.env }, - checkCommit - ) - } - - function checkCommit (er, log, stderr) { - t.ifError(er, 'git log ran without issue') - t.notOk(stderr, 'no error output') - t.ok(log.match(/0\.1\.3/g), 'commited from subdirectory') - t.end() - } -}) - -function setup () { - mkdirp.sync(subDirectory) - process.chdir(subDirectory) - fs.writeFileSync(packagePath, JSON.stringify(json), 'utf8') - fs.writeFileSync(shrinkwrapPath, JSON.stringify(json), 'utf8') -} diff --git a/deps/npm/test/tap/version-sub-directory.js b/deps/npm/test/tap/version-sub-directory.js deleted file mode 100644 index fc4a41f36e5834..00000000000000 --- a/deps/npm/test/tap/version-sub-directory.js +++ /dev/null @@ -1,56 +0,0 @@ -var common = require('../common-tap.js') -var fs = require('fs') -var path = require('path') - -var mkdirp = require('mkdirp') -var test = require('tap').test - -var npm = require('../../lib/npm.js') - -var pkg = common.pkg -var subDirectory = path.resolve(pkg, 'sub-directory') -var packagePath = path.resolve(pkg, 'package.json') -var cache = common.cache - -var json = { name: 'cat', version: '0.1.2' } - -test('npm version from a subdirectory', function (t) { - mkdirp.sync(subDirectory) - process.chdir(subDirectory) - fs.writeFileSync(packagePath, JSON.stringify(json), 'utf8') - npmLoad() - - function npmLoad () { - npm.load({ cache: cache }, function () { - common.makeGitRepo({ - path: pkg, - added: ['package.json'] - }, version) - }) - } - - function version (er, stdout, stderr) { - t.ifError(er, 'git repo initialized without issue') - t.notOk(stderr, 'no error output') - npm.config.set('sign-git-commit', false) - npm.config.set('sign-git-tag', false) - npm.commands.version(['patch'], checkVersion) - } - - function checkVersion (er) { - var git = require('../../lib/utils/git.js') - t.ifError(er, 'version command ran without error') - git.whichAndExec( - ['log'], - { cwd: pkg, env: process.env }, - checkCommit - ) - } - - function checkCommit (er, log, stderr) { - t.ifError(er, 'git log ran without issue') - t.notOk(stderr, 'no error output') - t.ok(log.match(/0\.1\.3/g), 'commited from subdirectory') - t.end() - } -}) diff --git a/deps/npm/test/tap/version-update-shrinkwrap.js b/deps/npm/test/tap/version-update-shrinkwrap.js deleted file mode 100644 index e6ba5ee6182ba9..00000000000000 --- a/deps/npm/test/tap/version-update-shrinkwrap.js +++ /dev/null @@ -1,127 +0,0 @@ -var fs = require('fs') -var path = require('path') - -var mkdirp = require('mkdirp') -var rimraf = require('rimraf') -var test = require('tap').test - -var npm = require('../../') -var common = require('../common-tap.js') - -var pkg = common.pkg -var cache = common.cache - -test('npm version updates shrinkwrap - no git', function (t) { - setup() - npm.load({ cache: cache, registry: common.registry }, function () { - npm.commands.version(['patch'], function (err) { - if (err) return t.fail('Error perform version patch') - var shrinkwrap = require(path.resolve(pkg, 'npm-shrinkwrap.json')) - t.equal(shrinkwrap.version, '0.0.1', 'got expected version') - t.end() - }) - }) -}) - -test('npm version updates git works with no shrinkwrap', function (t) { - setup() - rimraf.sync(path.resolve(pkg, 'npm-shrinkwrap.json')) - - npm.config.set('sign-git-commit', false) - npm.config.set('sign-git-tag', false) - - common.makeGitRepo({ - path: pkg, - added: ['package.json'] - }, version) - - function version (er, stdout, stderr) { - t.ifError(er, 'git repo initialized without issue') - t.notOk(stderr, 'no error output') - - npm.commands.version(['patch'], checkCommit) - } - - function checkCommit (er) { - t.ifError(er, 'version command ran without error') - - var shrinkwrap = require(path.resolve(pkg, 'npm-shrinkwrap.json')) - t.equal(shrinkwrap.version, '0.0.1', 'got expected version') - - var opts = { cwd: pkg, env: { PATH: process.env.PATH } } - var git = require('../../lib/utils/git.js') - git.whichAndExec( - ['show', 'HEAD', '--name-only'], - opts, - function (er, stdout, stderr) { - t.ifError(er, 'git show ran without issues') - t.notOk(stderr, 'no error output') - - var lines = stdout.split('\n') - t.notEqual(lines.indexOf('package.json'), -1, 'package.json commited') - t.equal(lines.indexOf('npm-shrinkwrap.json'), -1, 'npm-shrinkwrap.json not present') - - t.end() - } - ) - } -}) - -test('npm version updates shrinkwrap and updates git', function (t) { - setup() - - npm.config.set('sign-git-commit', false) - npm.config.set('sign-git-tag', false) - - common.makeGitRepo({ - path: pkg, - added: ['package.json', 'npm-shrinkwrap.json'] - }, version) - - function version (er, stdout, stderr) { - t.ifError(er, 'git repo initialized without issue') - t.notOk(stderr, 'no error output') - - npm.commands.version(['patch'], checkCommit) - } - - function checkCommit (er) { - t.ifError(er, 'version command ran without error') - - var shrinkwrap = require(path.resolve(pkg, 'npm-shrinkwrap.json')) - t.equal(shrinkwrap.version, '0.0.1', 'got expected version') - - var git = require('../../lib/utils/git.js') - var opts = { cwd: pkg, env: { PATH: process.env.PATH } } - git.whichAndExec( - ['show', 'HEAD', '--name-only'], - opts, - function (er, stdout, stderr) { - t.ifError(er, 'git show ran without issues') - t.notOk(stderr, 'no error output') - - var lines = stdout.split('\n') - t.notEqual(lines.indexOf('package.json'), -1, 'package.json commited') - t.notEqual(lines.indexOf('npm-shrinkwrap.json'), -1, 'npm-shrinkwrap.json commited') - - t.end() - } - ) - } -}) - -function setup () { - process.chdir(__dirname) - rimraf.sync(pkg) - mkdirp.sync(pkg) - var contents = { - author: 'Nathan Bowser && Faiq Raza', - name: 'version-with-shrinkwrap-test', - version: '0.0.0', - description: 'Test for version with shrinkwrap update' - } - - fs.writeFileSync(path.resolve(pkg, 'package.json'), JSON.stringify(contents), 'utf8') - fs.writeFileSync(path.resolve(pkg, 'npm-shrinkwrap.json'), JSON.stringify(contents), 'utf8') - process.chdir(pkg) -} diff --git a/deps/npm/test/tap/view.js b/deps/npm/test/tap/view.js deleted file mode 100644 index 71d21487ae99c6..00000000000000 --- a/deps/npm/test/tap/view.js +++ /dev/null @@ -1,381 +0,0 @@ -var common = require('../common-tap.js') -const t = require('tap') -var test = t.test -var osenv = require('osenv') -var path = require('path') -var fs = require('fs') -var rimraf = require('rimraf') -var mkdirp = require('mkdirp') - -// this test has to use a tmpdir so that it's outside of -// the current package context of npm. -var tmp = osenv.tmpdir() -var t1dir = path.resolve(tmp, 'view-local-no-pkg') -var t2dir = path.resolve(tmp, 'view-local-notmine') -var t3dir = path.resolve(tmp, 'view-local-mine') -var mr = require('npm-registry-mock') - -var server - -t.teardown(() => { - rimraf.sync(t1dir) - rimraf.sync(t2dir) - rimraf.sync(t3dir) - if (server) { - server.close() - } -}) - -test('setup', function (t) { - mkdirp.sync(t1dir) - mkdirp.sync(t2dir) - mkdirp.sync(t3dir) - - fs.writeFileSync(t2dir + '/package.json', JSON.stringify({ - author: 'Evan Lucas', - name: 'test-repo-url-https', - version: '0.0.1' - }), 'utf8') - - fs.writeFileSync(t3dir + '/package.json', JSON.stringify({ - author: 'Evan Lucas', - name: 'biscuits', - version: '0.0.1' - }), 'utf8') - - t.pass('created fixtures') - - mr({ port: common.port, plugin: plugin }, function (er, s) { - server = s - t.end() - }) -}) - -function plugin (server) { - server - .get('/biscuits') - .many() - .reply(404, {'error': 'version not found'}) -} - -test('npm view . in global mode', function (t) { - common.npm([ - 'view', - '.', - '--registry=' + common.registry, - '--global' - ], { cwd: t1dir }, function (err, code, stdout, stderr) { - t.ifError(err, 'view command finished successfully') - t.equal(code, 1, 'exit not ok') - t.similar(stderr, /Cannot use view command in global mode./m) - t.end() - }) -}) - -test('npm view --global', function (t) { - common.npm([ - 'view', - '--registry=' + common.registry, - '--global' - ], { cwd: t1dir }, function (err, code, stdout, stderr) { - t.ifError(err, 'view command finished successfully') - t.equal(code, 1, 'exit not ok') - t.similar(stderr, /Cannot use view command in global mode./m) - t.end() - }) -}) - -test('npm view . with no package.json', function (t) { - common.npm([ - 'view', - '.', - '--registry=' + common.registry - ], { cwd: t1dir }, function (err, code, stdout, stderr) { - t.ifError(err, 'view command finished successfully') - t.equal(code, 1, 'exit not ok') - t.similar(stderr, /Invalid package.json/m) - t.end() - }) -}) - -test('npm view . with no published package', function (t) { - common.npm([ - 'view', - '.', - '--registry=' + common.registry - ], { cwd: t3dir }, function (err, code, stdout, stderr) { - t.ifError(err, 'view command finished successfully') - t.equal(code, 1, 'exit not ok') - t.similar(stderr, /not in the npm registry/m) - t.end() - }) -}) - -test('npm view .', function (t) { - common.npm([ - 'view', - '.', - '--registry=' + common.registry - ], { cwd: t2dir }, function (err, code, stdout) { - t.ifError(err, 'view command finished successfully') - t.equal(code, 0, 'exit ok') - t.matches(stdout, /test-repo-url-https/, 'has the right package') - t.end() - }) -}) - -test('npm view . select fields', function (t) { - common.npm([ - 'view', - '.', - 'main', - '--registry=' + common.registry - ], { cwd: t2dir }, function (err, code, stdout) { - t.ifError(err, 'view command finished successfully') - t.equal(code, 0, 'exit ok') - t.equal(stdout.trim(), 'index.js', 'should print `index.js`') - t.end() - }) -}) - -test('npm view .@', function (t) { - common.npm([ - 'view', - '.@0.0.0', - 'version', - '--registry=' + common.registry - ], { cwd: t2dir }, function (err, code, stdout) { - t.ifError(err, 'view command finished successfully') - t.equal(code, 0, 'exit ok') - t.equal(stdout.trim(), '0.0.0', 'should print `0.0.0`') - t.end() - }) -}) - -test('npm view .@ version --json', function (t) { - common.npm([ - 'view', - '.@0.0.0', - 'version', - '--json', - '--registry=' + common.registry - ], { cwd: t2dir }, function (err, code, stdout) { - t.ifError(err, 'view command finished successfully') - t.equal(code, 0, 'exit ok') - t.equal(stdout.trim(), '"0.0.0"', 'should print `"0.0.0"`') - t.end() - }) -}) - -test('npm view . --json author name version', function (t) { - common.npm([ - 'view', - '.', - 'author', - 'name', - 'version', - '--json', - '--registry=' + common.registry - ], { cwd: t2dir }, function (err, code, stdout) { - var expected = JSON.stringify({ - author: 'Evan Lucas ', - name: 'test-repo-url-https', - version: '0.0.1' - }, null, 2) - t.ifError(err, 'view command finished successfully') - t.equal(code, 0, 'exit ok') - t.equal(stdout.trim(), expected, 'should print ' + expected) - t.end() - }) -}) - -test('npm view .@ --json author name version', function (t) { - common.npm([ - 'view', - '.@0.0.0', - 'author', - 'name', - 'version', - '--json', - '--registry=' + common.registry - ], { cwd: t2dir }, function (err, code, stdout) { - var expected = JSON.stringify({ - author: 'Evan Lucas ', - name: 'test-repo-url-https', - version: '0.0.0' - }, null, 2) - t.ifError(err, 'view command finished successfully') - t.equal(code, 0, 'exit ok') - t.equal(stdout.trim(), expected, 'should print ' + expected) - t.end() - }) -}) - -test('npm view ', function (t) { - common.npm([ - 'view', - 'underscore', - '--registry=' + common.registry - ], { cwd: t2dir }, function (err, code, stdout) { - t.ifError(err, 'view command finished successfully') - t.equal(code, 0, 'exit ok') - t.matches(stdout, /underscore/, 'should have name `underscore`') - t.end() - }) -}) - -test('npm view --global', function (t) { - common.npm([ - 'view', - 'underscore', - '--global', - '--registry=' + common.registry - ], { cwd: t2dir }, function (err, code, stdout) { - t.ifError(err, 'view command finished successfully') - t.equal(code, 0, 'exit ok') - t.matches(stdout, /underscore/, 'should have name `underscore`') - t.end() - }) -}) - -test('npm view @ versions', function (t) { - common.npm([ - 'view', - 'underscore@^1.5.0', - 'versions', - '--registry=' + common.registry - ], { cwd: t2dir }, function (err, code, stdout) { - t.ifError(err, 'view command finished successfully') - t.equal(code, 0, 'exit ok') - var re = new RegExp('1.5.0') - t.similar(stdout, re, 'should have version `1.5.0`') - t.end() - }) -}) - -test('npm view @ version --json', function (t) { - common.npm([ - 'view', - 'underscore@~1.5.0', - 'version', - '--json', - '--registry=' + common.registry - ], { cwd: t2dir }, function (err, code, stdout) { - t.ifError(err, 'view command finished successfully') - t.equal(code, 0, 'exit ok') - t.equal(stdout.trim(), JSON.stringify([ - '1.5.0', - '1.5.1' - ], null, 2), 'should have three versions') - t.end() - }) -}) - -test('npm view --json', function (t) { - t.plan(3) - common.npm([ - 'view', - 'underscore', - '--json', - '--registry=' + common.registry - ], { cwd: t2dir }, function (err, code, stdout) { - t.ifError(err, 'view command finished successfully') - t.equal(code, 0, 'exit ok') - try { - var out = JSON.parse(stdout.trim()) - t.similar(out, { - maintainers: ['jashkenas '] - }, 'should have the same maintainer') - } catch (er) { - t.fail('Unable to parse JSON') - } - }) -}) - -test('npm view @', function (t) { - common.npm([ - 'view', - 'underscore@12345', - '--registry=' + common.registry - ], { cwd: t2dir }, function (err, code, stdout) { - t.ifError(err, 'view command finished successfully') - t.equal(code, 0, 'exit ok') - t.equal(stdout.trim(), '', 'should return empty') - t.end() - }) -}) - -test('npm view @ --json', function (t) { - common.npm([ - 'view', - 'underscore@12345', - '--json', - '--registry=' + common.registry - ], { cwd: t2dir }, function (err, code, stdout) { - t.ifError(err, 'view command finished successfully') - t.equal(code, 0, 'exit ok') - t.equal(stdout.trim(), '', 'should return empty') - t.end() - }) -}) - -test('npm view ', function (t) { - common.npm([ - 'view', - 'underscore', - 'homepage', - '--registry=' + common.registry - ], { cwd: t2dir }, function (err, code, stdout) { - t.ifError(err, 'view command finished successfully') - t.equal(code, 0, 'exit ok') - t.equal(stdout.trim(), 'http://underscorejs.org', - 'homepage should equal `http://underscorejs.org`') - t.end() - }) -}) - -test('npm view with invalid package name', function (t) { - var invalidName = 'InvalidPackage' - - server.get('/' + invalidName).reply('404', {'error': 'not found'}) - common.npm([ - 'view', - invalidName, - '--registry=' + common.registry - ], {}, function (err, code, stdout, stderr) { - t.ifError(err, 'view command finished successfully') - t.equal(code, 1, 'exit not ok') - - t.similar(stderr, new RegExp('is not in the npm registry'), - 'Package should NOT be found') - - t.dissimilar(stderr, new RegExp('use the name yourself!'), - 'Suggestion should not be there') - - t.similar(stderr, new RegExp('name can no longer contain capital letters'), - 'Suggestion about Capital letter should be there') - - t.end() - }) -}) - -test('npm view with valid but non existent package name', function (t) { - server.get('/valid-but-non-existent-package').reply(404, {'error': 'not found'}) - common.npm([ - 'view', - 'valid-but-non-existent-package', - '--registry=' + common.registry - ], {}, function (err, code, stdout, stderr) { - t.ifError(err, 'view command finished successfully') - t.equal(code, 1, 'exit not ok') - - t.similar(stderr, - new RegExp("'valid-but-non-existent-package' is not in the npm registry\\."), - 'Package should NOT be found') - - t.similar(stderr, new RegExp('use the name yourself!'), - 'Suggestion should be there') - - t.end() - }) -}) diff --git a/deps/npm/test/tap/whoami.js b/deps/npm/test/tap/whoami.js deleted file mode 100644 index aabf5b282160f1..00000000000000 --- a/deps/npm/test/tap/whoami.js +++ /dev/null @@ -1,76 +0,0 @@ -var common = require('../common-tap.js') - -var fs = require('fs') -var path = require('path') -var createServer = require('http').createServer - -var test = require('tap').test -var rimraf = require('rimraf') - -var opts = { cwd: __dirname } - -var FIXTURE_PATH = path.resolve(common.pkg, 'fixture_npmrc') - -test('npm whoami with basic auth', function (t) { - var s = '//registry.lvh.me/:username = wombat\n' + - '//registry.lvh.me/:_password = YmFkIHBhc3N3b3Jk\n' + - '//registry.lvh.me/:email = lindsay@wdu.org.au\n' - fs.writeFileSync(FIXTURE_PATH, s, 'ascii') - fs.chmodSync(FIXTURE_PATH, 0o644) - - common.npm( - [ - 'whoami', - '--userconfig=' + FIXTURE_PATH, - '--registry=http://registry.lvh.me/' - ], - opts, - function (err, code, stdout, stderr) { - t.ifError(err) - - t.equal(stderr, '', 'got nothing on stderr') - t.equal(code, 0, 'exit ok') - t.equal(stdout, 'wombat\n', 'got username') - t.end() - } - ) -}) - -test('npm whoami with bearer auth', { timeout: 8000 }, function (t) { - var s = '//localhost:' + common.port + - '/:_authToken = wombat-developers-union\n' - fs.writeFileSync(FIXTURE_PATH, s, 'ascii') - fs.chmodSync(FIXTURE_PATH, 0o644) - - function verify (req, res) { - t.equal(req.method, 'GET') - t.equal(req.url, '/-/whoami') - - res.setHeader('content-type', 'application/json') - res.writeHead(200) - res.end(JSON.stringify({ username: 'wombat' }), 'utf8') - } - - var server = createServer(verify) - - server.listen(common.port, function () { - common.npm( - [ - 'whoami', - '--userconfig=' + FIXTURE_PATH, - '--registry=http://localhost:' + common.port + '/' - ], - opts, - function (err, code, stdout, stderr) { - t.ifError(err) - - t.equal(stderr, '', 'got nothing on stderr') - t.equal(code, 0, 'exit ok') - t.equal(stdout, 'wombat\n', 'got username') - rimraf.sync(FIXTURE_PATH) - server.close() - t.end() - } - ) - }) -}) diff --git a/deps/npm/test/util/mock-tarball.js b/deps/npm/test/util/mock-tarball.js deleted file mode 100644 index f62eaf4e423d04..00000000000000 --- a/deps/npm/test/util/mock-tarball.js +++ /dev/null @@ -1,47 +0,0 @@ -'use strict' - -const BB = require('bluebird') - -const getStream = require('get-stream') -const pipeline = require('mississippi').pipeline -const tar = require('tar-stream') -const zlib = require('zlib') - -module.exports = makeTarball -function makeTarball (files, opts) { - opts = opts || {} - const pack = tar.pack() - Object.keys(files).forEach(function (filename) { - const entry = files[filename] - pack.entry({ - name: (opts.noPrefix ? '' : 'package/') + filename, - type: entry.type, - size: entry.size, - mode: entry.mode, - mtime: entry.mtime || new Date(0), - linkname: entry.linkname, - uid: entry.uid, - gid: entry.gid, - uname: entry.uname, - gname: entry.gname - }, typeof files[filename] === 'string' - ? files[filename] - : files[filename].data) - }) - pack.finalize() - return BB.try(() => { - if (opts.stream && opts.gzip) { - return pipeline(pack, zlib.createGzip()) - } else if (opts.stream) { - return pack - } else { - return getStream.buffer(pack).then(ret => { - if (opts.gzip) { - return BB.fromNode(cb => zlib.gzip(ret, cb)) - } else { - return ret - } - }) - } - }) -} From 73150f94d8edd595c6aff83db56ea883483c60e8 Mon Sep 17 00:00:00 2001 From: Myles Borins Date: Fri, 2 Oct 2020 19:12:24 -0400 Subject: [PATCH 2/2] test: fix test suite to work with npm 7 --- Makefile | 2 +- test/addons/dlopen-ping-pong/test.js | 12 ++++++++-- test/parallel/test-macos-signed-deps.js | 31 ------------------------- test/parallel/test-npm-version.js | 2 +- 4 files changed, 12 insertions(+), 35 deletions(-) delete mode 100644 test/parallel/test-macos-signed-deps.js diff --git a/Makefile b/Makefile index a63713ccdf9103..cc450ee888ee9c 100644 --- a/Makefile +++ b/Makefile @@ -1384,7 +1384,7 @@ CONFLICT_RE=^>>>>>>> [0-9A-Fa-f]+|^<<<<<<< [A-Za-z]+ # Related CI job: node-test-linter lint-ci: lint-js-ci lint-cpp lint-py lint-md lint-addon-docs - @if ! ( grep -IEqrs "$(CONFLICT_RE)" benchmark deps doc lib src test tools ) \ + @if ! ( grep -IEqrs "$(CONFLICT_RE)" --exclude="error-message.js" benchmark deps doc lib src test tools ) \ && ! ( $(FIND) . -maxdepth 1 -type f | xargs grep -IEqs "$(CONFLICT_RE)" ); then \ exit 0 ; \ else \ diff --git a/test/addons/dlopen-ping-pong/test.js b/test/addons/dlopen-ping-pong/test.js index c3461d8bd269c5..eca516619a1484 100644 --- a/test/addons/dlopen-ping-pong/test.js +++ b/test/addons/dlopen-ping-pong/test.js @@ -12,8 +12,16 @@ const bindingPath = require.resolve(`./build/${common.buildType}/binding`); console.log('process.dlopen:', bindingPath); process.dlopen(module, bindingPath, os.constants.dlopen.RTLD_NOW | os.constants.dlopen.RTLD_GLOBAL); -console.log('module.exports.load:', `${path.dirname(bindingPath)}/ping.so`); -module.exports.load(`${path.dirname(bindingPath)}/ping.so`); + +let pingSOPath = `${path.dirname(bindingPath)}/lib.target/ping.so`; + +if (common.isOSX) { + pingSOPath = `${path.dirname(bindingPath)}/ping.so`; +} + +console.log('module.exports.load:', pingSOPath); +module.exports.load(pingSOPath); + assert.strictEqual(module.exports.ping(), 'pong'); // Check that after the addon is loaded with diff --git a/test/parallel/test-macos-signed-deps.js b/test/parallel/test-macos-signed-deps.js deleted file mode 100644 index 1932d7686caae3..00000000000000 --- a/test/parallel/test-macos-signed-deps.js +++ /dev/null @@ -1,31 +0,0 @@ -'use strict'; - -// Notarization on macOS requires all binaries to be signed. -// We sign our own binaries but check here if any binaries from our dependencies -// (e.g. npm) are signed. -const common = require('../common'); - -if (!common.isOSX) { - common.skip('macOS specific test'); -} - -const assert = require('assert'); -const { spawnSync } = require('child_process'); -const path = require('path'); - -const debuglog = require('util').debuglog('test'); - -const binaries = [ - 'deps/npm/node_modules/term-size/vendor/macos/term-size', -]; - -for (const testbin of binaries) { - const bin = path.resolve(__dirname, '..', '..', testbin); - debuglog(`Checking ${bin}`); - const cp = spawnSync('codesign', [ '-vvvv', bin ], { encoding: 'utf8' }); - debuglog(cp.stdout); - debuglog(cp.stderr); - assert.strictEqual(cp.signal, null); - assert.strictEqual(cp.status, 0, `${bin} does not appear to be signed.\n` + - `${cp.stdout}\n${cp.stderr}`); -} diff --git a/test/parallel/test-npm-version.js b/test/parallel/test-npm-version.js index aa4bb77ac8a44f..e167ab0d1bcd11 100644 --- a/test/parallel/test-npm-version.js +++ b/test/parallel/test-npm-version.js @@ -14,5 +14,5 @@ const npmPathPackageJson = path.resolve( ); const pkg = require(npmPathPackageJson); -assert(pkg.version.match(/^\d+\.\d+\.\d+$/), +assert(pkg.version.match(/^\d+\.\d+\.\d+-rc\.\d+$/), `unexpected version number: ${pkg.version}`);